From: support Date: Wed, 9 Nov 2022 11:47:33 +0000 (+0000) Subject: Built motion from commit bbec7235.|2.6.20 X-Git-Url: http://repos.xcallymotion.com/base//%22angular-material.themes.css/%22?a=commitdiff_plain;h=5cda470f32f8fcbb66a6655133c8acc73629ef3b;p=motion2.git Built motion from commit bbec7235.|2.6.20 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index da8fcde..7709d32 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-10-27T14:26:31.596Z", + "time": "2022-11-09T11:37:31.069Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 9490509..c66a9c1 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-10-27T14:26:31.596Z", + "time": "2022-11-09T11:37:31.069Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 641b96a..1067d3d 100644 --- a/server/api/action/action.attributes.js +++ b/server/api/action/action.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbd1d=['urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','VIRTUAL','getDataValue','action','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0xbd1d,0x193));var _0xdbd1=function(_0x4a2ba2,_0x5901b9){_0x4a2ba2=_0x4a2ba2-0x0;var _0x1d09fd=_0xbd1d[_0x4a2ba2];return _0x1d09fd;};'use strict';var Sequelize=require(_0xdbd1('0x0'));module['exports']={'name':{'type':Sequelize[_0xdbd1('0x1')],'get':function(_0x327b10){return this[_0xdbd1('0x2')](_0xdbd1('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xdbd1('0x4'),_0xdbd1('0x5'),_0xdbd1('0x6'),_0xdbd1('0x7'),_0xdbd1('0x8'),_0xdbd1('0x9'),_0xdbd1('0xa')]],'msg':_0xdbd1('0xb')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0xdbd1('0xc')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0xdbd1('0xc')](0x1000),'comment':_0xdbd1('0xd')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xdbd1('0xe')},'data4':{'type':Sequelize[_0xdbd1('0xc')](0x1000),'comments':_0xdbd1('0xf')},'data5':{'type':Sequelize[_0xdbd1('0xc')](0x1000),'comments':_0xdbd1('0x10')},'data6':{'type':Sequelize[_0xdbd1('0xc')],'comments':_0xdbd1('0x11')},'data7':{'type':Sequelize[_0xdbd1('0x12')],'comments':_0xdbd1('0x13')}}; \ No newline at end of file +var _0x6ced=['contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','urlForward[body]','VIRTUAL','STRING','integration','motionbar','urlForward','browser','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'];(function(_0x592c91,_0x488431){var _0x557acd=function(_0x28cc4e){while(--_0x28cc4e){_0x592c91['push'](_0x592c91['shift']());}};_0x557acd(++_0x488431);}(_0x6ced,0x116));var _0xd6ce=function(_0x2bf341,_0x4d20a6){_0x2bf341=_0x2bf341-0x0;var _0x394e22=_0x6ced[_0x2bf341];return _0x394e22;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd6ce('0x0')],'get':function(_0x22577c){return this['getDataValue']('action');}},'action':{'type':Sequelize[_0xd6ce('0x1')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xd6ce('0x2'),_0xd6ce('0x3'),'jscripty',_0xd6ce('0x4'),_0xd6ce('0x5'),'bot','script']],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xd6ce('0x6')},'data1':{'type':Sequelize[_0xd6ce('0x1')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0xd6ce('0x1')](0x1000),'comment':_0xd6ce('0x7')},'data3':{'type':Sequelize[_0xd6ce('0x1')](0x1000),'comment':_0xd6ce('0x8')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0xd6ce('0x9')},'data5':{'type':Sequelize[_0xd6ce('0x1')](0x1000),'comments':_0xd6ce('0xa')},'data6':{'type':Sequelize[_0xd6ce('0x1')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0xd6ce('0xb')],'comments':_0xd6ce('0xc')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 1bc101b..ea90125 100644 --- a/server/api/action/action.controller.js +++ b/server/api/action/action.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x626c=['mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','body','Action','params','catch','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0x626c,0x1bc));var _0xc626=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x626c[_0x550d12];return _0x12103d;};'use strict';var emlformat=require(_0xc626('0x0'));var rimraf=require(_0xc626('0x1'));var zipdir=require(_0xc626('0x2'));var jsonpatch=require(_0xc626('0x3'));var rp=require('request-promise');var moment=require(_0xc626('0x4'));var BPromise=require(_0xc626('0x5'));var Mustache=require(_0xc626('0x6'));var util=require(_0xc626('0x7'));var path=require(_0xc626('0x8'));var sox=require(_0xc626('0x9'));var csv=require(_0xc626('0xa'));var ejs=require(_0xc626('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc626('0xc'));var crypto=require(_0xc626('0xd'));var jsforce=require(_0xc626('0xe'));var deskjs=require(_0xc626('0xf'));var toCsv=require(_0xc626('0xa'));var querystring=require(_0xc626('0x10'));var Papa=require(_0xc626('0x11'));var Redis=require(_0xc626('0x12'));var authService=require(_0xc626('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc626('0x14'));var logger=require(_0xc626('0x15'))(_0xc626('0x16'));var utils=require(_0xc626('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xc626('0x18'));var db=require(_0xc626('0x19'))['db'];function respondWithStatusCode(_0x25db9c,_0x32bcf6){_0x32bcf6=_0x32bcf6||0xcc;return function(_0x311d47){if(_0x311d47){return _0x25db9c[_0xc626('0x1a')](_0x32bcf6);}return _0x25db9c['status'](_0x32bcf6)[_0xc626('0x1b')]();};}function respondWithResult(_0x52548f,_0x2b53c3){_0x2b53c3=_0x2b53c3||0xc8;return function(_0x111d28){if(_0x111d28){return _0x52548f['status'](_0x2b53c3)[_0xc626('0x1c')](_0x111d28);}};}function respondWithFilteredResult(_0xccc2bd,_0x3c617c){return function(_0x1f3e7a){if(_0x1f3e7a){var _0xc2cdcf=typeof _0x3c617c[_0xc626('0x1d')]===_0xc626('0x1e')&&typeof _0x3c617c[_0xc626('0x1f')]==='undefined';var _0x31e835=_0x1f3e7a[_0xc626('0x20')];var _0x4b4546=_0xc2cdcf?0x0:_0x3c617c['offset'];var _0x25baa9=_0xc2cdcf?_0x1f3e7a[_0xc626('0x20')]:_0x3c617c[_0xc626('0x1d')]+_0x3c617c[_0xc626('0x1f')];var _0x743b4;if(_0x25baa9>=_0x31e835){_0x25baa9=_0x31e835;_0x743b4=0xc8;}else{_0x743b4=0xce;}_0xccc2bd[_0xc626('0x21')](_0x743b4);return _0xccc2bd['set'](_0xc626('0x22'),_0x4b4546+'-'+_0x25baa9+'/'+_0x31e835)['json'](_0x1f3e7a);}return null;};}function patchUpdates(_0x3a6997){return function(_0x4043e9){try{jsonpatch[_0xc626('0x23')](_0x4043e9,_0x3a6997,!![]);}catch(_0x1c6cf4){return BPromise[_0xc626('0x24')](_0x1c6cf4);}return _0x4043e9[_0xc626('0x25')]();};}function saveUpdates(_0xe940fa,_0xf32b14){return function(_0x19540f){if(_0x19540f){return _0x19540f[_0xc626('0x26')](_0xe940fa)[_0xc626('0x27')](function(_0x221330){return _0x221330;});}return null;};}function removeEntity(_0x4c864b,_0x9f6d06){return function(_0x170ad8){if(_0x170ad8){return _0x170ad8[_0xc626('0x28')]()[_0xc626('0x27')](function(){_0x4c864b[_0xc626('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a8b7f,_0x2244b0){return function(_0x4e4ea3){if(!_0x4e4ea3){_0x3a8b7f['sendStatus'](0x194);}return _0x4e4ea3;};}function handleError(_0x2cea5c,_0xec891e){_0xec891e=_0xec891e||0x1f4;return function(_0x145e49){logger[_0xc626('0x29')](_0x145e49[_0xc626('0x2a')]);if(_0x145e49[_0xc626('0x2b')]){delete _0x145e49[_0xc626('0x2b')];}_0x2cea5c[_0xc626('0x21')](_0xec891e)[_0xc626('0x2c')](_0x145e49);};}exports[_0xc626('0x26')]=function(_0x20521c,_0x1be5b8){if(_0x20521c['body']['id']){delete _0x20521c[_0xc626('0x2d')]['id'];}return db[_0xc626('0x2e')]['find']({'where':{'id':_0x20521c[_0xc626('0x2f')]['id']}})['then'](handleEntityNotFound(_0x1be5b8,null))[_0xc626('0x27')](saveUpdates(_0x20521c[_0xc626('0x2d')],null))[_0xc626('0x27')](respondWithResult(_0x1be5b8,null))[_0xc626('0x30')](handleError(_0x1be5b8,null));};exports['destroy']=function(_0x2845f8,_0x56c935){return db[_0xc626('0x2e')][_0xc626('0x31')]({'where':{'id':_0x2845f8[_0xc626('0x2f')]['id']}})[_0xc626('0x27')](handleEntityNotFound(_0x56c935,null))[_0xc626('0x27')](removeEntity(_0x56c935,null))[_0xc626('0x30')](handleError(_0x56c935,null));}; \ No newline at end of file +var _0x59f3=['eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','end','status','offset','undefined','limit','set','Content-Range','json','reject','save','update','then','destroy','stack','name','send','body','Action','find','params','catch'];(function(_0x18c8dc,_0x510c11){var _0x5b1272=function(_0xd359a3){while(--_0xd359a3){_0x18c8dc['push'](_0x18c8dc['shift']());}};_0x5b1272(++_0x510c11);}(_0x59f3,0x18c));var _0x359f=function(_0x2e0443,_0x7e5974){_0x2e0443=_0x2e0443-0x0;var _0x52d450=_0x59f3[_0x2e0443];return _0x52d450;};'use strict';var emlformat=require(_0x359f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x359f('0x1'));var rp=require(_0x359f('0x2'));var moment=require(_0x359f('0x3'));var BPromise=require(_0x359f('0x4'));var Mustache=require('mustache');var util=require(_0x359f('0x5'));var path=require(_0x359f('0x6'));var sox=require(_0x359f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x359f('0x8'));var _=require(_0x359f('0x9'));var squel=require(_0x359f('0xa'));var crypto=require(_0x359f('0xb'));var jsforce=require(_0x359f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x359f('0xd'));var querystring=require(_0x359f('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x359f('0xf'));var qs=require(_0x359f('0x10'));var as=require(_0x359f('0x11'));var hardwareService=require(_0x359f('0x12'));var logger=require(_0x359f('0x13'))('api');var utils=require(_0x359f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x359f('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x169d35,_0x443188){_0x443188=_0x443188||0xcc;return function(_0x5c235a){if(_0x5c235a){return _0x169d35[_0x359f('0x16')](_0x443188);}return _0x169d35['status'](_0x443188)[_0x359f('0x17')]();};}function respondWithResult(_0x25677c,_0x5458ba){_0x5458ba=_0x5458ba||0xc8;return function(_0x208bdd){if(_0x208bdd){return _0x25677c[_0x359f('0x18')](_0x5458ba)['json'](_0x208bdd);}};}function respondWithFilteredResult(_0x674650,_0x1393f1){return function(_0x59a4b5){if(_0x59a4b5){var _0x493c9b=typeof _0x1393f1[_0x359f('0x19')]===_0x359f('0x1a')&&typeof _0x1393f1[_0x359f('0x1b')]===_0x359f('0x1a');var _0x2f4993=_0x59a4b5['count'];var _0x2030e3=_0x493c9b?0x0:_0x1393f1['offset'];var _0x591f82=_0x493c9b?_0x59a4b5['count']:_0x1393f1[_0x359f('0x19')]+_0x1393f1[_0x359f('0x1b')];var _0x5a255b;if(_0x591f82>=_0x2f4993){_0x591f82=_0x2f4993;_0x5a255b=0xc8;}else{_0x5a255b=0xce;}_0x674650['status'](_0x5a255b);return _0x674650[_0x359f('0x1c')](_0x359f('0x1d'),_0x2030e3+'-'+_0x591f82+'/'+_0x2f4993)[_0x359f('0x1e')](_0x59a4b5);}return null;};}function patchUpdates(_0x2bee27){return function(_0x409594){try{jsonpatch['apply'](_0x409594,_0x2bee27,!![]);}catch(_0x1e40f3){return BPromise[_0x359f('0x1f')](_0x1e40f3);}return _0x409594[_0x359f('0x20')]();};}function saveUpdates(_0x2da026,_0x1f17f1){return function(_0x3f1fb1){if(_0x3f1fb1){return _0x3f1fb1[_0x359f('0x21')](_0x2da026)[_0x359f('0x22')](function(_0x10f53a){return _0x10f53a;});}return null;};}function removeEntity(_0x1887fa,_0x2f7554){return function(_0x42491b){if(_0x42491b){return _0x42491b[_0x359f('0x23')]()[_0x359f('0x22')](function(){_0x1887fa[_0x359f('0x18')](0xcc)[_0x359f('0x17')]();});}};}function handleEntityNotFound(_0x45b684,_0x2e7cea){return function(_0x40b7c6){if(!_0x40b7c6){_0x45b684[_0x359f('0x16')](0x194);}return _0x40b7c6;};}function handleError(_0xfb5787,_0x52d7b1){_0x52d7b1=_0x52d7b1||0x1f4;return function(_0x210283){logger['error'](_0x210283[_0x359f('0x24')]);if(_0x210283[_0x359f('0x25')]){delete _0x210283[_0x359f('0x25')];}_0xfb5787[_0x359f('0x18')](_0x52d7b1)[_0x359f('0x26')](_0x210283);};}exports[_0x359f('0x21')]=function(_0x34a77f,_0x3b1734){if(_0x34a77f[_0x359f('0x27')]['id']){delete _0x34a77f[_0x359f('0x27')]['id'];}return db[_0x359f('0x28')][_0x359f('0x29')]({'where':{'id':_0x34a77f[_0x359f('0x2a')]['id']}})[_0x359f('0x22')](handleEntityNotFound(_0x3b1734,null))[_0x359f('0x22')](saveUpdates(_0x34a77f[_0x359f('0x27')],null))[_0x359f('0x22')](respondWithResult(_0x3b1734,null))[_0x359f('0x2b')](handleError(_0x3b1734,null));};exports[_0x359f('0x23')]=function(_0x57c428,_0x31381a){return db['Action'][_0x359f('0x29')]({'where':{'id':_0x57c428[_0x359f('0x2a')]['id']}})[_0x359f('0x22')](handleEntityNotFound(_0x31381a,null))[_0x359f('0x22')](removeEntity(_0x31381a,null))[_0x359f('0x2b')](handleError(_0x31381a,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 5ed425d..3a21f8e 100644 --- a/server/api/action/action.model.js +++ b/server/api/action/action.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0227=['exports','define','Action','tools_actions','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x3c2e6c,_0x3c88da){var _0x5bf29e=function(_0x381948){while(--_0x381948){_0x3c2e6c['push'](_0x3c2e6c['shift']());}};_0x5bf29e(++_0x3c88da);}(_0x0227,0xe8));var _0x7022=function(_0x43f494,_0x5d5e9f){_0x43f494=_0x43f494-0x0;var _0x2ce562=_0x0227[_0x43f494];return _0x2ce562;};'use strict';var _=require('lodash');var util=require(_0x7022('0x0'));var logger=require(_0x7022('0x1'))(_0x7022('0x2'));var moment=require(_0x7022('0x3'));var BPromise=require(_0x7022('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7022('0x5'));var rimraf=require(_0x7022('0x6'));var config=require(_0x7022('0x7'));var attributes=require('./action.attributes');module[_0x7022('0x8')]=function(_0x4f26e2,_0x1a5800){return _0x4f26e2[_0x7022('0x9')](_0x7022('0xa'),attributes,{'tableName':_0x7022('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a27=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./action.attributes','exports'];(function(_0x55a4fc,_0x35564d){var _0x15dfe8=function(_0xd50bae){while(--_0xd50bae){_0x55a4fc['push'](_0x55a4fc['shift']());}};_0x15dfe8(++_0x35564d);}(_0x7a27,0x172));var _0x77a2=function(_0xe1f27b,_0x4b5b1b){_0xe1f27b=_0xe1f27b-0x0;var _0x420910=_0x7a27[_0xe1f27b];return _0x420910;};'use strict';var _=require(_0x77a2('0x0'));var util=require(_0x77a2('0x1'));var logger=require(_0x77a2('0x2'))(_0x77a2('0x3'));var moment=require('moment');var BPromise=require(_0x77a2('0x4'));var rp=require(_0x77a2('0x5'));var fs=require('fs');var path=require(_0x77a2('0x6'));var rimraf=require(_0x77a2('0x7'));var config=require('../../config/environment');var attributes=require(_0x77a2('0x8'));module[_0x77a2('0x9')]=function(_0x3a39cd,_0xeb95aa){return _0x3a39cd['define']('Action',attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index 71f7f84..2b9fd77 100644 --- a/server/api/action/action.rpc.js +++ b/server/api/action/action.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0xcfc5fa,_0x57e383){var _0x11926a=function(_0x263281){while(--_0x263281){_0xcfc5fa['push'](_0xcfc5fa['shift']());}};_0x11926a(++_0x57e383);}(_0x1261,0x144));var _0x1126=function(_0x2aa83a,_0x4b5c0b){_0x2aa83a=_0x2aa83a-0x0;var _0x36a653=_0x1261[_0x2aa83a];return _0x36a653;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('Action,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x53ec,0x192));var _0xc53e=function(_0x654102,_0x4fa2f9){_0x654102=_0x654102-0x0;var _0x3cc306=_0x53ec[_0x654102];return _0x3cc306;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index b1614c6..121e787 100644 --- a/server/api/action/index.js +++ b/server/api/action/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbb3f=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated','update','/:id','destroy','exports','multer','path','connect-timeout'];(function(_0x1515c9,_0x3db945){var _0x3e9c59=function(_0x56ef9f){while(--_0x56ef9f){_0x1515c9['push'](_0x1515c9['shift']());}};_0x3e9c59(++_0x3db945);}(_0xbb3f,0xcf));var _0xfbb3=function(_0x2b1d7e,_0x32f2ff){_0x2b1d7e=_0x2b1d7e-0x0;var _0xecbf53=_0xbb3f[_0x2b1d7e];return _0xecbf53;};'use strict';var multer=require(_0xfbb3('0x0'));var util=require('util');var path=require(_0xfbb3('0x1'));var timeout=require(_0xfbb3('0x2'));var express=require('express');var router=express[_0xfbb3('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xfbb3('0x4'));var interaction=require(_0xfbb3('0x5'));var config=require(_0xfbb3('0x6'));var controller=require(_0xfbb3('0x7'));router[_0xfbb3('0x8')]('/:id',auth[_0xfbb3('0x9')](),controller[_0xfbb3('0xa')]);router['delete'](_0xfbb3('0xb'),auth[_0xfbb3('0x9')](),controller[_0xfbb3('0xc')]);module[_0xfbb3('0xd')]=router; \ No newline at end of file +var _0x8f57=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','put','/:id','isAuthenticated','update','destroy'];(function(_0x1b3e87,_0xd3706c){var _0x4a89e3=function(_0x1ded84){while(--_0x1ded84){_0x1b3e87['push'](_0x1b3e87['shift']());}};_0x4a89e3(++_0xd3706c);}(_0x8f57,0x16c));var _0x78f5=function(_0x89ee68,_0x18ca4d){_0x89ee68=_0x89ee68-0x0;var _0x1dfd3b=_0x8f57[_0x89ee68];return _0x1dfd3b;};'use strict';var multer=require(_0x78f5('0x0'));var util=require(_0x78f5('0x1'));var path=require('path');var timeout=require(_0x78f5('0x2'));var express=require(_0x78f5('0x3'));var router=express[_0x78f5('0x4')]();var fs_extra=require(_0x78f5('0x5'));var auth=require(_0x78f5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x78f5('0x7'));var controller=require('./action.controller');router[_0x78f5('0x8')](_0x78f5('0x9'),auth[_0x78f5('0xa')](),controller[_0x78f5('0xb')]);router['delete'](_0x78f5('0x9'),auth['isAuthenticated'](),controller[_0x78f5('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 08c457d..10e9f6f 100644 --- a/server/api/analyticCustomReport/analyticCustomReport.attributes.js +++ b/server/api/analyticCustomReport/analyticCustomReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x53ec=['STRING','TEXT','sequelize','exports'];(function(_0x58c984,_0x4a4dcf){var _0x9b3b5e=function(_0x59870b){while(--_0x59870b){_0x58c984['push'](_0x58c984['shift']());}};_0x9b3b5e(++_0x4a4dcf);}(_0x53ec,0x192));var _0xc53e=function(_0x3c414c,_0x399dbb){_0x3c414c=_0x3c414c-0x0;var _0x4f3062=_0x53ec[_0x3c414c];return _0x4f3062;};'use strict';var Sequelize=require(_0xc53e('0x0'));module[_0xc53e('0x1')]={'name':{'type':Sequelize[_0xc53e('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xc53e('0x2')]},'parent':{'type':Sequelize[_0xc53e('0x2')]},'table':{'type':Sequelize[_0xc53e('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xc53e('0x3')]}}; \ No newline at end of file +var _0xc4aa=['STRING','sequelize','exports'];(function(_0x10453a,_0x4a24d8){var _0x58e278=function(_0xa56ad1){while(--_0xa56ad1){_0x10453a['push'](_0x10453a['shift']());}};_0x58e278(++_0x4a24d8);}(_0xc4aa,0x1b7));var _0xac4a=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0xc4aa[_0xaa1b3e];return _0x454d7d;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'name':{'type':Sequelize[_0xac4a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xac4a('0x2')]},'parent':{'type':Sequelize[_0xac4a('0x2')]},'table':{'type':Sequelize[_0xac4a('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index d037e5b..ed02ffa 100644 --- a/server/api/analyticCustomReport/analyticCustomReport.controller.js +++ b/server/api/analyticCustomReport/analyticCustomReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3351=['map','AnalyticCustomReport','rawAttributes','type','model','query','keys','filters','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','merge','includeAll','findAll','rows','catch','params','intersection','include','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','AVG(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','table','MetricId','function','format','replace','groupBy','orderBy','order','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','IS\x20NOT\x20NULL','condition','ValidationErrorItem','metric','output','fullPath','%s-%s.%s','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','select','COUNT(*)','runReport','operator','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','get','CustomReports','UserProfileResource','destroy','error','stack','name','send','index'];(function(_0xfce7,_0x4c3103){var _0x4ab9fd=function(_0x2ad559){while(--_0x2ad559){_0xfce7['push'](_0xfce7['shift']());}};_0x4ab9fd(++_0x4c3103);}(_0x3351,0x116));var _0x1335=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x3351[_0x92c450];return _0x2a9599;};'use strict';var emlformat=require(_0x1335('0x0'));var rimraf=require(_0x1335('0x1'));var zipdir=require(_0x1335('0x2'));var jsonpatch=require(_0x1335('0x3'));var rp=require(_0x1335('0x4'));var moment=require(_0x1335('0x5'));var BPromise=require(_0x1335('0x6'));var Mustache=require('mustache');var util=require(_0x1335('0x7'));var path=require(_0x1335('0x8'));var sox=require(_0x1335('0x9'));var csv=require('to-csv');var ejs=require(_0x1335('0xa'));var fs=require('fs');var fs_extra=require(_0x1335('0xb'));var _=require('lodash');var squel=require(_0x1335('0xc'));var crypto=require('crypto');var jsforce=require(_0x1335('0xd'));var deskjs=require(_0x1335('0xe'));var toCsv=require(_0x1335('0xf'));var querystring=require('querystring');var Papa=require(_0x1335('0x10'));var Redis=require('ioredis');var authService=require(_0x1335('0x11'));var qs=require(_0x1335('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1335('0x13'))(_0x1335('0x14'));var utils=require('../../config/utils');var config=require(_0x1335('0x15'));var licenseUtil=require(_0x1335('0x16'));var db=require(_0x1335('0x17'))['db'];var dbH=require(_0x1335('0x17'))[_0x1335('0x18')];function respondWithStatusCode(_0xaae222,_0x1aaf6c){_0x1aaf6c=_0x1aaf6c||0xcc;return function(_0x46c204){if(_0x46c204){return _0xaae222['sendStatus'](_0x1aaf6c);}return _0xaae222[_0x1335('0x19')](_0x1aaf6c)[_0x1335('0x1a')]();};}function respondWithResult(_0x35ea1b,_0x454eb1){_0x454eb1=_0x454eb1||0xc8;return function(_0x18df8d){if(_0x18df8d){return _0x35ea1b[_0x1335('0x19')](_0x454eb1)['json'](_0x18df8d);}};}function respondWithFilteredResult(_0x249c9f,_0xf00a55){return function(_0x4dd6f4){if(_0x4dd6f4){var _0x2e36e3=typeof _0xf00a55[_0x1335('0x1b')]==='undefined'&&typeof _0xf00a55[_0x1335('0x1c')]===_0x1335('0x1d');var _0x1bd554=_0x4dd6f4[_0x1335('0x1e')];var _0x3c918a=_0x2e36e3?0x0:_0xf00a55['offset'];var _0x40916c=_0x2e36e3?_0x4dd6f4[_0x1335('0x1e')]:_0xf00a55['offset']+_0xf00a55['limit'];var _0x40fdb6;if(_0x40916c>=_0x1bd554){_0x40916c=_0x1bd554;_0x40fdb6=0xc8;}else{_0x40fdb6=0xce;}_0x249c9f[_0x1335('0x19')](_0x40fdb6);return _0x249c9f[_0x1335('0x1f')](_0x1335('0x20'),_0x3c918a+'-'+_0x40916c+'/'+_0x1bd554)['json'](_0x4dd6f4);}return null;};}function patchUpdates(_0x4e1fd2){return function(_0x56231a){try{jsonpatch[_0x1335('0x21')](_0x56231a,_0x4e1fd2,!![]);}catch(_0x50a5b9){return BPromise[_0x1335('0x22')](_0x50a5b9);}return _0x56231a[_0x1335('0x23')]();};}function saveUpdates(_0x456277,_0x51f61d){return function(_0x3763b9){if(_0x3763b9){return _0x3763b9['update'](_0x456277)['then'](function(_0x36c7cf){return _0x36c7cf;});}return null;};}function removeEntity(_0x28abcc,_0x5601a2){return function(_0x480403){if(_0x480403){return _0x480403['destroy']()[_0x1335('0x24')](function(){var _0x46b96a=_0x480403[_0x1335('0x25')]({'plain':!![]});var _0x230da6=_0x1335('0x26');return db[_0x1335('0x27')][_0x1335('0x28')]({'where':{'type':_0x230da6,'resourceId':_0x46b96a['id']}})[_0x1335('0x24')](function(){return _0x480403;});})['then'](function(){_0x28abcc[_0x1335('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x435894,_0x5d8dc1){return function(_0x4903b7){if(!_0x4903b7){_0x435894['sendStatus'](0x194);}return _0x4903b7;};}function handleError(_0x1a151a,_0x3c4404){_0x3c4404=_0x3c4404||0x1f4;return function(_0x59bde5){logger[_0x1335('0x29')](_0x59bde5[_0x1335('0x2a')]);if(_0x59bde5[_0x1335('0x2b')]){delete _0x59bde5[_0x1335('0x2b')];}_0x1a151a[_0x1335('0x19')](_0x3c4404)[_0x1335('0x2c')](_0x59bde5);};}exports[_0x1335('0x2d')]=function(_0x33bf59,_0x52c04a){var _0x3cbac1={},_0x3e4503={},_0x4216f0={'count':0x0,'rows':[]};var _0xfb3dbf=_[_0x1335('0x2e')](db[_0x1335('0x2f')][_0x1335('0x30')],function(_0x5e5fc2){return{'name':_0x5e5fc2['fieldName'],'type':_0x5e5fc2[_0x1335('0x31')]['key']};});_0x3e4503[_0x1335('0x32')]=_[_0x1335('0x2e')](_0xfb3dbf,_0x1335('0x2b'));_0x3e4503[_0x1335('0x33')]=_[_0x1335('0x34')](_0x33bf59[_0x1335('0x33')]);_0x3e4503[_0x1335('0x35')]=_['intersection'](_0x3e4503[_0x1335('0x32')],_0x3e4503['query']);_0x3cbac1['attributes']=_['intersection'](_0x3e4503[_0x1335('0x32')],qs[_0x1335('0x36')](_0x33bf59[_0x1335('0x33')][_0x1335('0x36')]));_0x3cbac1[_0x1335('0x37')]=_0x3cbac1[_0x1335('0x37')][_0x1335('0x38')]?_0x3cbac1[_0x1335('0x37')]:_0x3e4503[_0x1335('0x32')];if(!_0x33bf59[_0x1335('0x33')][_0x1335('0x39')]('nolimit')){_0x3cbac1['limit']=qs[_0x1335('0x1c')](_0x33bf59[_0x1335('0x33')][_0x1335('0x1c')]);_0x3cbac1['offset']=qs['offset'](_0x33bf59['query']['offset']);}_0x3cbac1['order']=qs['sort'](_0x33bf59[_0x1335('0x33')][_0x1335('0x3a')]);_0x3cbac1['where']=qs[_0x1335('0x35')](_[_0x1335('0x3b')](_0x33bf59[_0x1335('0x33')],_0x3e4503[_0x1335('0x35')]),_0xfb3dbf);if(_0x33bf59[_0x1335('0x33')][_0x1335('0x3c')]){_0x3cbac1[_0x1335('0x3d')]=_[_0x1335('0x3e')](_0x3cbac1[_0x1335('0x3d')],{'$or':_[_0x1335('0x2e')](_0xfb3dbf,function(_0x297eb7){if(_0x297eb7[_0x1335('0x31')]!=='VIRTUAL'){var _0x168bc8={};_0x168bc8[_0x297eb7[_0x1335('0x2b')]]={'$like':'%'+_0x33bf59['query'][_0x1335('0x3c')]+'%'};return _0x168bc8;}})});}_0x3cbac1=_[_0x1335('0x3e')]({},_0x3cbac1,_0x33bf59['options']);var _0x2dc795={'where':_0x3cbac1[_0x1335('0x3d')]};return db[_0x1335('0x2f')][_0x1335('0x1e')](_0x2dc795)[_0x1335('0x24')](function(_0x4ef51c){_0x4216f0[_0x1335('0x1e')]=_0x4ef51c;if(_0x33bf59['query'][_0x1335('0x3f')]){_0x3cbac1['include']=[{'all':!![]}];}return db[_0x1335('0x2f')][_0x1335('0x40')](_0x3cbac1);})[_0x1335('0x24')](function(_0x1bce1d){_0x4216f0[_0x1335('0x41')]=_0x1bce1d;return _0x4216f0;})[_0x1335('0x24')](respondWithFilteredResult(_0x52c04a,_0x3cbac1))[_0x1335('0x42')](handleError(_0x52c04a,null));};exports['show']=function(_0x91f7b5,_0x5ec4fd){var _0x19dbf9={'raw':![],'where':{'id':_0x91f7b5[_0x1335('0x43')]['id']}},_0x39b303={};_0x39b303[_0x1335('0x32')]=_[_0x1335('0x34')](db[_0x1335('0x2f')][_0x1335('0x30')]);_0x39b303[_0x1335('0x33')]=_['keys'](_0x91f7b5[_0x1335('0x33')]);_0x39b303[_0x1335('0x35')]=_[_0x1335('0x44')](_0x39b303[_0x1335('0x32')],_0x39b303[_0x1335('0x33')]);_0x19dbf9[_0x1335('0x37')]=_['intersection'](_0x39b303[_0x1335('0x32')],qs['fields'](_0x91f7b5[_0x1335('0x33')]['fields']));_0x19dbf9['attributes']=_0x19dbf9['attributes']['length']?_0x19dbf9['attributes']:_0x39b303[_0x1335('0x32')];if(_0x91f7b5['query'][_0x1335('0x3f')]){_0x19dbf9[_0x1335('0x45')]=[{'all':!![]}];}_0x19dbf9=_[_0x1335('0x3e')]({},_0x19dbf9,_0x91f7b5[_0x1335('0x46')]);return db[_0x1335('0x2f')][_0x1335('0x47')](_0x19dbf9)[_0x1335('0x24')](handleEntityNotFound(_0x5ec4fd,null))[_0x1335('0x24')](respondWithResult(_0x5ec4fd,null))[_0x1335('0x42')](handleError(_0x5ec4fd,null));};exports[_0x1335('0x48')]=function(_0x38b0aa,_0x3e1814){return db[_0x1335('0x2f')][_0x1335('0x48')](_0x38b0aa[_0x1335('0x49')],{})[_0x1335('0x24')](function(_0x1d1568){var _0x4a56d9=_0x38b0aa['user'][_0x1335('0x25')]({'plain':!![]});if(!_0x4a56d9)throw new Error(_0x1335('0x4a'));if(_0x4a56d9[_0x1335('0x4b')]===_0x1335('0x4c')){var _0x441821=_0x1d1568[_0x1335('0x25')]({'plain':!![]});var _0x92706=_0x1335('0x4d');return db['UserProfileSection'][_0x1335('0x47')]({'where':{'name':_0x92706,'userProfileId':_0x4a56d9[_0x1335('0x4e')]},'raw':!![]})[_0x1335('0x24')](function(_0x2bdeef){if(_0x2bdeef&&_0x2bdeef['autoAssociation']===0x0){return db[_0x1335('0x27')][_0x1335('0x48')]({'name':_0x441821[_0x1335('0x2b')],'resourceId':_0x441821['id'],'type':_0x1335('0x26'),'sectionId':_0x2bdeef['id']},{})[_0x1335('0x24')](function(){return _0x1d1568;});}else{return _0x1d1568;}})[_0x1335('0x42')](function(_0x3c6552){logger[_0x1335('0x29')](_0x1335('0x4f'),_0x3c6552);throw _0x3c6552;});}return _0x1d1568;})['then'](respondWithResult(_0x3e1814,0xc9))[_0x1335('0x42')](handleError(_0x3e1814,null));};exports['update']=function(_0x5c35f3,_0x390bf6){if(_0x5c35f3[_0x1335('0x49')]['id']){delete _0x5c35f3[_0x1335('0x49')]['id'];}return db[_0x1335('0x2f')][_0x1335('0x47')]({'where':{'id':_0x5c35f3[_0x1335('0x43')]['id']}})['then'](handleEntityNotFound(_0x390bf6,null))[_0x1335('0x24')](saveUpdates(_0x5c35f3[_0x1335('0x49')],null))[_0x1335('0x24')](respondWithResult(_0x390bf6,null))['catch'](handleError(_0x390bf6,null));};exports[_0x1335('0x28')]=function(_0x172d3b,_0x28ef33){return db[_0x1335('0x2f')][_0x1335('0x47')]({'where':{'id':_0x172d3b[_0x1335('0x43')]['id']}})[_0x1335('0x24')](handleEntityNotFound(_0x28ef33,null))[_0x1335('0x24')](removeEntity(_0x28ef33,null))[_0x1335('0x42')](handleError(_0x28ef33,null));};exports[_0x1335('0x50')]=function(_0x4115fa,_0x336282){var _0xd988b7=0xa;var _0x3cc5ae=[_0x1335('0x51'),_0x1335('0x52'),_0x1335('0x53'),'cross_join'];var _0x126c66={'SUM':_0x1335('0x54'),'COUNT':_0x1335('0x55'),'COUNT DISTINCT':_0x1335('0x56'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x1335('0x57'),'GROUP_CONCAT':_0x1335('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1485f1={'SEC_TO_TIME':_0x1335('0x59'),'DATE':_0x1335('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x1335('0x5b'),'UNIX_TIMESTAMP':_0x1335('0x5c')};var _0x3c94db=function(_0x92c882){return!_[_0x1335('0x5d')]([_0x1335('0x5e'),'IS\x20NOT\x20NULL',_0x1335('0x5f'),_0x1335('0x60')],_0x92c882);};var _0x1ea6ca=function(_0x346a90){if(!_0x346a90||!_0x346a90[_0x1335('0x61')][_0x1335('0x38')]){return'';}for(var _0x3e2a50='(',_0x33b8d0=0x0;_0x33b8d0<_0x346a90[_0x1335('0x61')][_0x1335('0x38')];_0x33b8d0+=0x1){_0x33b8d0>0x0&&(_0x3e2a50+='\x20'+_0x346a90['operator']+'\x20');_0x3e2a50+=_0x346a90[_0x1335('0x61')][_0x33b8d0][_0x1335('0x62')]?_0x1ea6ca(_0x346a90['rules'][_0x33b8d0][_0x1335('0x62')]):_0x346a90['rules'][_0x33b8d0][_0x1335('0x63')]+'\x20'+_0x346a90['rules'][_0x33b8d0]['condition']+(_0x3c94db(_0x346a90[_0x1335('0x61')][_0x33b8d0]['condition'])?'\x20'+_0x346a90[_0x1335('0x61')][_0x33b8d0][_0x1335('0x64')]:'');}return _0x3e2a50+')';};var _0x1369da={'where':{'id':_0x4115fa[_0x1335('0x43')]['id']}},_0x218b40,_0x3cf97f,_0x1e9958,_0x4956c7,_0x401e41;_0x1369da=_[_0x1335('0x3e')]({},_0x1369da,_0x4115fa[_0x1335('0x46')]);return db[_0x1335('0x2f')]['find'](_0x1369da)[_0x1335('0x24')](function(_0x2bbad3){if(_0x2bbad3){_0x218b40=_0x2bbad3;return _0x2bbad3[_0x1335('0x65')]();}return null;})['then'](function(_0x3f8cd9){if(_0x3f8cd9){if(!_0x3f8cd9['length']){throw new db[(_0x1335('0x66'))]['ValidationErrorItem'](_0x1335('0x67'),0x193);}_0x3cf97f=_0x3f8cd9;return db[_0x1335('0x68')][_0x1335('0x40')]({'raw':!![]});}return null;})[_0x1335('0x24')](function(_0x119ba8){if(_0x119ba8){_0x1e9958=_[_0x1335('0x69')](_0x119ba8,'id');var _0x55c408;var _0x478a4b=squel['select']();_0x478a4b[_0x1335('0x6a')](_0x218b40[_0x1335('0x6b')]);for(var _0x1d222a=0x0;_0x1d222a<_0x3cf97f[_0x1335('0x38')];_0x1d222a+=0x1){_0x55c408=_0x3cf97f[_0x1d222a][_0x1335('0x6c')]?_0x1e9958[_0x3cf97f[_0x1d222a][_0x1335('0x6c')]]['metric']:_0x3cf97f[_0x1d222a]['field'];_0x55c408=_0x3cf97f[_0x1d222a]['function']?_['replace'](_0x126c66[_0x3cf97f[_0x1d222a][_0x1335('0x6d')]],'%s',_0x55c408):_0x55c408;_0x55c408=_0x3cf97f[_0x1d222a][_0x1335('0x6e')]?_[_0x1335('0x6f')](_0x1485f1[_0x3cf97f[_0x1d222a][_0x1335('0x6e')]],'%s',_0x55c408):_0x55c408;if(_0x3cf97f[_0x1d222a][_0x1335('0x70')]){_0x478a4b['group'](_0x55c408);}_0x3cf97f[_0x1d222a][_0x1335('0x71')]&&_0x478a4b[_0x1335('0x72')](_0x55c408,_0x3cf97f[_0x1d222a]['orderBy']===_0x1335('0x73')?![]:!![]);_0x478a4b['field'](_0x55c408,_0x3cf97f[_0x1d222a][_0x1335('0x74')]||_0x55c408);}if(_0x218b40[_0x1335('0x75')]){_0x218b40[_0x1335('0x75')]=JSON['parse'](_0x218b40[_0x1335('0x75')]);for(var _0x223f64=0x0;_0x223f64<_0x218b40['joins'][_0x1335('0x38')];_0x223f64+=0x1){if(_0x218b40['joins'][_0x223f64][_0x1335('0x31')]&&_['includes'](_0x3cc5ae,_0x218b40[_0x1335('0x75')][_0x223f64][_0x1335('0x31')])&&_0x218b40[_0x1335('0x75')][_0x223f64][_0x1335('0x76')]&&_0x218b40[_0x1335('0x75')][_0x223f64][_0x1335('0x77')]&&_0x218b40[_0x1335('0x75')][_0x223f64]['foreignKey']){_0x478a4b[_0x218b40[_0x1335('0x75')][_0x223f64][_0x1335('0x31')]](_0x218b40[_0x1335('0x75')][_0x223f64][_0x1335('0x77')],null,util[_0x1335('0x6e')](_0x1335('0x78'),_0x218b40['table'],_0x218b40[_0x1335('0x75')][_0x223f64][_0x1335('0x76')],_0x218b40[_0x1335('0x75')][_0x223f64][_0x1335('0x77')],_0x218b40[_0x1335('0x75')][_0x223f64][_0x1335('0x79')]));}}}if(_0x218b40[_0x1335('0x7a')]){_0x218b40[_0x1335('0x7a')]=JSON[_0x1335('0x7b')](_0x218b40[_0x1335('0x7a')]);_0x478a4b[_0x1335('0x3d')](_0x1ea6ca(_0x218b40[_0x1335('0x7a')][_0x1335('0x62')]));}_0x401e41=_0x478a4b[_0x1335('0x7c')]();_0x478a4b[_0x1335('0x1c')](_0xd988b7);_0x478a4b['offset'](0x0);logger[_0x1335('0x7d')](_0x1335('0x7e'),_0x478a4b[_0x1335('0x7f')]());return dbH[_0x1335('0x80')][_0x1335('0x33')](_0x478a4b['toString'](),{'type':dbH[_0x1335('0x80')][_0x1335('0x81')][_0x1335('0x82')]});}})['then'](respondWithResult(_0x336282,null))['catch'](handleError(_0x336282,null));};function runReport(_0xb700f0,_0x3d62b,_0x1d8d76){var _0x25f403=_0x3d62b['name'];var _0x1d1f2e=0xa;var _0x5cb218=['join',_0x1335('0x52'),_0x1335('0x53'),_0x1335('0x83')];var _0x454c1f={'SUM':_0x1335('0x54'),'COUNT':_0x1335('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x1335('0x84'),'MIN':_0x1335('0x85'),'AVG':_0x1335('0x57'),'GROUP_CONCAT':_0x1335('0x58'),'GROUP_CONCAT ASC':_0x1335('0x86'),'GROUP_CONCAT DESC':_0x1335('0x87')};var _0x42fc8b={'SEC_TO_TIME':_0x1335('0x59'),'DATE':_0x1335('0x5a'),'HOUR':_0x1335('0x88'),'ROUND':_0x1335('0x5b'),'UNIX_TIMESTAMP':_0x1335('0x5c')};var _0x3eb1bb=function(_0x2a9769){return!_[_0x1335('0x5d')]([_0x1335('0x5e'),_0x1335('0x89'),_0x1335('0x5f'),_0x1335('0x60')],_0x2a9769);};var _0x5e8e74=function(_0x3aedbf){if(!_0x3aedbf||!_0x3aedbf['rules'][_0x1335('0x38')]){return'';}for(var _0x2dc872='(',_0x193c2c=0x0;_0x193c2c<_0x3aedbf[_0x1335('0x61')][_0x1335('0x38')];_0x193c2c+=0x1){_0x193c2c>0x0&&(_0x2dc872+='\x20'+_0x3aedbf['operator']+'\x20');_0x2dc872+=_0x3aedbf['rules'][_0x193c2c][_0x1335('0x62')]?_0x5e8e74(_0x3aedbf[_0x1335('0x61')][_0x193c2c][_0x1335('0x62')]):_0x3aedbf[_0x1335('0x61')][_0x193c2c][_0x1335('0x63')]+'\x20'+_0x3aedbf['rules'][_0x193c2c][_0x1335('0x8a')]+(_0x3eb1bb(_0x3aedbf[_0x1335('0x61')][_0x193c2c][_0x1335('0x8a')])?'\x20'+_0x3aedbf['rules'][_0x193c2c][_0x1335('0x64')]:'');}return _0x2dc872+')';};var _0x3336c2={'where':{'id':_0xb700f0['id']}},_0x58c04c,_0x58448f,_0x40a45e,_0x6bb417,_0x5678cc;_0x3336c2=_['merge']({},_0x3336c2,_0x1d8d76);return db['AnalyticCustomReport'][_0x1335('0x47')](_0x3336c2)[_0x1335('0x24')](function(_0x3f2feb){if(_0x3f2feb){_0x58c04c=_0x3f2feb;return _0x3f2feb[_0x1335('0x65')]();}return null;})[_0x1335('0x24')](function(_0x860e05){if(_0x860e05){if(!_0x860e05['length']){throw new db[(_0x1335('0x66'))][(_0x1335('0x8b'))](_0x1335('0x67'),0x193);}_0x58448f=_0x860e05;return db[_0x1335('0x68')][_0x1335('0x40')]({'raw':!![]});}return null;})[_0x1335('0x24')](function(_0x36d118){if(_0x36d118){_0x40a45e=_[_0x1335('0x69')](_0x36d118,'id');var _0x5ecf33;var _0x462e07=squel['select']();_0x462e07[_0x1335('0x6a')](_0x58c04c[_0x1335('0x6b')]);for(var _0x3f5890=0x0;_0x3f5890<_0x58448f[_0x1335('0x38')];_0x3f5890+=0x1){_0x5ecf33=_0x58448f[_0x3f5890][_0x1335('0x6c')]?_0x40a45e[_0x58448f[_0x3f5890][_0x1335('0x6c')]][_0x1335('0x8c')]:_0x58448f[_0x3f5890]['field'];_0x5ecf33=_0x58448f[_0x3f5890]['function']?_['replace'](_0x454c1f[_0x58448f[_0x3f5890][_0x1335('0x6d')]],'%s',_0x5ecf33):_0x5ecf33;_0x5ecf33=_0x58448f[_0x3f5890]['format']?_[_0x1335('0x6f')](_0x42fc8b[_0x58448f[_0x3f5890]['format']],'%s',_0x5ecf33):_0x5ecf33;if(_0x58448f[_0x3f5890][_0x1335('0x70')]){_0x462e07['group'](_0x5ecf33);}_0x58448f[_0x3f5890][_0x1335('0x71')]&&_0x462e07[_0x1335('0x72')](_0x5ecf33,_0x58448f[_0x3f5890]['orderBy']==='DESC'?![]:!![]);_0x462e07['field'](_0x5ecf33,_0x58448f[_0x3f5890][_0x1335('0x74')]||_0x5ecf33);}if(_0x58c04c[_0x1335('0x75')]){_0x58c04c[_0x1335('0x75')]=JSON[_0x1335('0x7b')](_0x58c04c[_0x1335('0x75')]);for(var _0x27c222=0x0;_0x27c222<_0x58c04c[_0x1335('0x75')][_0x1335('0x38')];_0x27c222+=0x1){if(_0x58c04c[_0x1335('0x75')][_0x27c222][_0x1335('0x31')]&&_[_0x1335('0x5d')](_0x5cb218,_0x58c04c[_0x1335('0x75')][_0x27c222]['type'])&&_0x58c04c[_0x1335('0x75')][_0x27c222]['parentKey']&&_0x58c04c['joins'][_0x27c222]['foreignTable']&&_0x58c04c[_0x1335('0x75')][_0x27c222][_0x1335('0x79')]){_0x462e07[_0x58c04c[_0x1335('0x75')][_0x27c222][_0x1335('0x31')]](_0x58c04c[_0x1335('0x75')][_0x27c222][_0x1335('0x77')],null,util[_0x1335('0x6e')](_0x1335('0x78'),_0x58c04c['table'],_0x58c04c[_0x1335('0x75')][_0x27c222][_0x1335('0x76')],_0x58c04c['joins'][_0x27c222][_0x1335('0x77')],_0x58c04c['joins'][_0x27c222][_0x1335('0x79')]));}}}if(_0x58c04c['conditions']){_0x58c04c[_0x1335('0x7a')]=JSON['parse'](_0x58c04c[_0x1335('0x7a')]);_0x462e07[_0x1335('0x3d')](_0x5e8e74(_0x58c04c['conditions'][_0x1335('0x62')]));}_0x5678cc=_0x462e07['clone']();_0x462e07[_0x1335('0x1c')](_0x1d1f2e);_0x462e07[_0x1335('0x1b')](0x0);return;}})[_0x1335('0x24')](function(){if(_0x3d62b[_0x1335('0x8d')]==='web'){return null;}var _0xcce0bf=_[_0x1335('0x3e')](_0x3d62b,{'name':_0x3d62b[_0x1335('0x8e')]||_0x3d62b[_0x1335('0x2b')]||_0x58c04c[_0x1335('0x2b')],'basename':_0x25f403,'savename':util[_0x1335('0x6e')](_0x1335('0x8f'),_0x3d62b[_0x1335('0x2b')]||_0x58c04c[_0x1335('0x2b')],require('randomstring')[_0x1335('0x90')](0x4),_0x3d62b[_0x1335('0x8d')]||_0x1335('0x91')),'reportId':_0x58c04c['id'],'reportType':_0x1335('0x92')});return db[_0x1335('0x93')][_0x1335('0x48')](_0xcce0bf,{'raw':!![]});})[_0x1335('0x24')](function(_0x506bcb){if(_0x58c04c[_0x1335('0x6b')]===_0x1335('0x94')){_0x5678cc['where'](_0x58c04c['table']+_0x1335('0x95'),_0x3d62b[_0x1335('0x96')],_0x3d62b[_0x1335('0x97')]);}else{_0x5678cc['where'](_0x58c04c[_0x1335('0x6b')]+_0x1335('0x98'),_0x3d62b['startDate'],_0x3d62b[_0x1335('0x97')]);}if(_0x506bcb){logger[_0x1335('0x99')](_0x1335('0x9a'),_0x5678cc['toString']());require(_0x1335('0x9b'))[_0x1335('0x9c')](path[_0x1335('0x51')](__dirname,'../../components/export/',_0x506bcb[_0x1335('0x8d')]),[_0x506bcb['id'],_0x5678cc['toString'](),path[_0x1335('0x51')](__dirname,_0x1335('0x9d'),_0x506bcb['savename']),_0x25f403]);return _0x506bcb;}else{var _0x4c24aa=squel[_0x1335('0x9e')]();_0x4c24aa[_0x1335('0x6a')]('('+_0x5678cc[_0x1335('0x7f')]()+')','countTable');_0x4c24aa[_0x1335('0x63')](_0x1335('0x9f'),_0x1335('0x1e'));_0x5678cc['limit'](_0x3d62b[_0x1335('0x1c')]||_0x1d1f2e);_0x5678cc['offset'](_0x3d62b[_0x1335('0x1b')]||0x0);return dbH['sequelize'][_0x1335('0x33')](_0x4c24aa[_0x1335('0x7f')](),{'type':dbH[_0x1335('0x80')][_0x1335('0x81')][_0x1335('0x82')]})[_0x1335('0x24')](function(_0x5de130){if(!_0x5de130[_0x1335('0x38')]){_0x6bb417=0x0;}else{_0x6bb417=_0x5de130[0x0][_0x1335('0x1e')]||0x0;}return dbH['sequelize'][_0x1335('0x33')](_0x5678cc[_0x1335('0x7f')](),{'type':dbH[_0x1335('0x80')][_0x1335('0x81')][_0x1335('0x82')]});})[_0x1335('0x24')](function(_0x5df216){return{'rows':_0x5df216||[],'count':_0x6bb417};});}});}exports['run']=function(_0x2356b9,_0x4721b5){return runReport(_0x2356b9[_0x1335('0x43')],_0x2356b9[_0x1335('0x33')],_0x2356b9['options'])[_0x1335('0x24')](respondWithResult(_0x4721b5,null))['catch'](handleError(_0x4721b5,null));};exports[_0x1335('0xa0')]=runReport;exports[_0x1335('0x33')]=function(_0x7e5d1b,_0x1b5297){var _0x275a2f=0xa;var _0x20e165=[_0x1335('0x51'),_0x1335('0x52'),_0x1335('0x53'),'cross_join'];var _0x469041={'SUM':_0x1335('0x54'),'COUNT':_0x1335('0x55'),'COUNT DISTINCT':_0x1335('0x56'),'MAX':_0x1335('0x84'),'MIN':'MIN(%s)','AVG':_0x1335('0x57'),'GROUP_CONCAT':_0x1335('0x58'),'GROUP_CONCAT ASC':_0x1335('0x86'),'GROUP_CONCAT DESC':_0x1335('0x87')};var _0x1fa217={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x1335('0x5a'),'HOUR':_0x1335('0x88'),'ROUND':_0x1335('0x5b'),'UNIX_TIMESTAMP':_0x1335('0x5c')};var _0x43a369=function(_0xb6d261){return!_[_0x1335('0x5d')]([_0x1335('0x5e'),_0x1335('0x89'),'IS\x20EMPTY',_0x1335('0x60')],_0xb6d261);};var _0x555c47=function(_0x3772e7){if(!_0x3772e7||!_0x3772e7[_0x1335('0x61')][_0x1335('0x38')]){return'';}for(var _0x1b258b='(',_0x4e0fbd=0x0;_0x4e0fbd<_0x3772e7[_0x1335('0x61')][_0x1335('0x38')];_0x4e0fbd+=0x1){_0x4e0fbd>0x0&&(_0x1b258b+='\x20'+_0x3772e7[_0x1335('0xa1')]+'\x20');_0x1b258b+=_0x3772e7[_0x1335('0x61')][_0x4e0fbd][_0x1335('0x62')]?_0x555c47(_0x3772e7['rules'][_0x4e0fbd][_0x1335('0x62')]):_0x3772e7[_0x1335('0x61')][_0x4e0fbd][_0x1335('0x63')]+'\x20'+_0x3772e7[_0x1335('0x61')][_0x4e0fbd][_0x1335('0x8a')]+(_0x43a369(_0x3772e7[_0x1335('0x61')][_0x4e0fbd]['condition'])?'\x20'+_0x3772e7[_0x1335('0x61')][_0x4e0fbd][_0x1335('0x64')]:'');}return _0x1b258b+')';};var _0x129e3c={'where':{'id':_0x7e5d1b['params']['id']}},_0x3efad5,_0x40fba0,_0x22d3fe,_0x11ed82,_0x22fe38;_0x129e3c=_[_0x1335('0x3e')]({},_0x129e3c,_0x7e5d1b[_0x1335('0x46')]);return db[_0x1335('0x2f')][_0x1335('0x47')](_0x129e3c)['then'](function(_0x1e34d3){if(_0x1e34d3){_0x3efad5=_0x1e34d3;return _0x1e34d3[_0x1335('0x65')]();}return null;})[_0x1335('0x24')](function(_0x192e3b){if(_0x192e3b){if(!_0x192e3b[_0x1335('0x38')]){throw new db[(_0x1335('0x66'))][(_0x1335('0x8b'))](_0x1335('0x67'),0x193);}_0x40fba0=_0x192e3b;return db[_0x1335('0x68')]['findAll']({'raw':!![]});}return null;})[_0x1335('0x24')](function(_0x5248c7){if(_0x5248c7){_0x22d3fe=_['keyBy'](_0x5248c7,'id');var _0x3b1817;var _0x2b785a=squel[_0x1335('0x9e')]();_0x2b785a[_0x1335('0x6a')](_0x3efad5[_0x1335('0x6b')]);for(var _0x5e37b9=0x0;_0x5e37b9<_0x40fba0[_0x1335('0x38')];_0x5e37b9+=0x1){_0x3b1817=_0x40fba0[_0x5e37b9][_0x1335('0x6c')]?_0x22d3fe[_0x40fba0[_0x5e37b9][_0x1335('0x6c')]]['metric']:_0x40fba0[_0x5e37b9][_0x1335('0x63')];_0x3b1817=_0x40fba0[_0x5e37b9][_0x1335('0x6d')]?_['replace'](_0x469041[_0x40fba0[_0x5e37b9][_0x1335('0x6d')]],'%s',_0x3b1817):_0x3b1817;_0x3b1817=_0x40fba0[_0x5e37b9][_0x1335('0x6e')]?_['replace'](_0x1fa217[_0x40fba0[_0x5e37b9][_0x1335('0x6e')]],'%s',_0x3b1817):_0x3b1817;if(_0x40fba0[_0x5e37b9]['groupBy']){_0x2b785a[_0x1335('0x62')](_0x3b1817);}_0x40fba0[_0x5e37b9][_0x1335('0x71')]&&_0x2b785a[_0x1335('0x72')](_0x3b1817,_0x40fba0[_0x5e37b9][_0x1335('0x71')]==='DESC'?![]:!![]);_0x2b785a[_0x1335('0x63')](_0x3b1817,_0x40fba0[_0x5e37b9][_0x1335('0x74')]||_0x3b1817);}if(_0x3efad5[_0x1335('0x75')]){_0x3efad5['joins']=JSON[_0x1335('0x7b')](_0x3efad5[_0x1335('0x75')]);for(var _0x407f43=0x0;_0x407f43<_0x3efad5[_0x1335('0x75')][_0x1335('0x38')];_0x407f43+=0x1){if(_0x3efad5[_0x1335('0x75')][_0x407f43]['type']&&_[_0x1335('0x5d')](_0x20e165,_0x3efad5[_0x1335('0x75')][_0x407f43]['type'])&&_0x3efad5[_0x1335('0x75')][_0x407f43]['parentKey']&&_0x3efad5['joins'][_0x407f43][_0x1335('0x77')]&&_0x3efad5[_0x1335('0x75')][_0x407f43][_0x1335('0x79')]){_0x2b785a[_0x3efad5[_0x1335('0x75')][_0x407f43][_0x1335('0x31')]](_0x3efad5['joins'][_0x407f43][_0x1335('0x77')],null,util[_0x1335('0x6e')](_0x1335('0x78'),_0x3efad5[_0x1335('0x6b')],_0x3efad5[_0x1335('0x75')][_0x407f43][_0x1335('0x76')],_0x3efad5[_0x1335('0x75')][_0x407f43][_0x1335('0x77')],_0x3efad5[_0x1335('0x75')][_0x407f43][_0x1335('0x79')]));}}}if(_0x3efad5['conditions']){_0x3efad5[_0x1335('0x7a')]=JSON['parse'](_0x3efad5[_0x1335('0x7a')]);_0x2b785a['where'](_0x555c47(_0x3efad5[_0x1335('0x7a')][_0x1335('0x62')]));}_0x22fe38=_0x2b785a[_0x1335('0x7c')]();_0x2b785a[_0x1335('0x1c')](_0x275a2f);_0x2b785a['offset'](0x0);logger['debug'](_0x1335('0x7e'),_0x2b785a['toString']());return dbH[_0x1335('0x80')][_0x1335('0x33')](_0x2b785a[_0x1335('0x7f')](),{'type':dbH[_0x1335('0x80')][_0x1335('0x81')][_0x1335('0x82')]});}})[_0x1335('0x24')](function(){return{'sql':_0x22fe38[_0x1335('0x7f')]()};})[_0x1335('0x24')](respondWithResult(_0x1b5297,null))[_0x1335('0x42')](handleError(_0x1b5297,null));}; \ No newline at end of file +var _0xa573=['parentKey','%s.%s\x20=\x20%s.%s','clone','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','dbH','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','get','CustomReports','UserProfileResource','stack','name','send','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','AnalyticCustomReport','includeAll','include','rows','show','params','keys','options','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','error','body','destroy','join','left_join','right_join','cross_join','SUM(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','MetricId','function','format','replace','groupBy','orderBy','order','DESC','alias','joins','parse','includes','foreignKey','table','foreignTable','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','HOUR(%s)','IS\x20NOT\x20EMPTY','metric'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0xa573,0xc2));var _0x3a57=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa573[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x3a57('0x0'));var rimraf=require(_0x3a57('0x1'));var zipdir=require(_0x3a57('0x2'));var jsonpatch=require(_0x3a57('0x3'));var rp=require('request-promise');var moment=require(_0x3a57('0x4'));var BPromise=require(_0x3a57('0x5'));var Mustache=require(_0x3a57('0x6'));var util=require(_0x3a57('0x7'));var path=require(_0x3a57('0x8'));var sox=require('sox');var csv=require(_0x3a57('0x9'));var ejs=require(_0x3a57('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3a57('0xb'));var squel=require(_0x3a57('0xc'));var crypto=require(_0x3a57('0xd'));var jsforce=require(_0x3a57('0xe'));var deskjs=require(_0x3a57('0xf'));var toCsv=require(_0x3a57('0x9'));var querystring=require(_0x3a57('0x10'));var Papa=require(_0x3a57('0x11'));var Redis=require(_0x3a57('0x12'));var authService=require(_0x3a57('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x3a57('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3a57('0x15'));var utils=require(_0x3a57('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x3a57('0x17'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x3a57('0x18')];function respondWithStatusCode(_0xeaa402,_0xb1da14){_0xb1da14=_0xb1da14||0xcc;return function(_0x43d4b1){if(_0x43d4b1){return _0xeaa402[_0x3a57('0x19')](_0xb1da14);}return _0xeaa402[_0x3a57('0x1a')](_0xb1da14)[_0x3a57('0x1b')]();};}function respondWithResult(_0x4393d8,_0x508513){_0x508513=_0x508513||0xc8;return function(_0x3691a8){if(_0x3691a8){return _0x4393d8[_0x3a57('0x1a')](_0x508513)[_0x3a57('0x1c')](_0x3691a8);}};}function respondWithFilteredResult(_0x417cb6,_0x2676b6){return function(_0x1fa8c1){if(_0x1fa8c1){var _0x392a5b=typeof _0x2676b6[_0x3a57('0x1d')]==='undefined'&&typeof _0x2676b6[_0x3a57('0x1e')]===_0x3a57('0x1f');var _0x21e5b0=_0x1fa8c1[_0x3a57('0x20')];var _0x2a9b74=_0x392a5b?0x0:_0x2676b6['offset'];var _0x3c316d=_0x392a5b?_0x1fa8c1[_0x3a57('0x20')]:_0x2676b6[_0x3a57('0x1d')]+_0x2676b6['limit'];var _0x2513ef;if(_0x3c316d>=_0x21e5b0){_0x3c316d=_0x21e5b0;_0x2513ef=0xc8;}else{_0x2513ef=0xce;}_0x417cb6['status'](_0x2513ef);return _0x417cb6[_0x3a57('0x21')](_0x3a57('0x22'),_0x2a9b74+'-'+_0x3c316d+'/'+_0x21e5b0)['json'](_0x1fa8c1);}return null;};}function patchUpdates(_0xd95a35){return function(_0x594b62){try{jsonpatch['apply'](_0x594b62,_0xd95a35,!![]);}catch(_0x594a4c){return BPromise[_0x3a57('0x23')](_0x594a4c);}return _0x594b62[_0x3a57('0x24')]();};}function saveUpdates(_0x1d4ef6,_0x1a1589){return function(_0x511b2f){if(_0x511b2f){return _0x511b2f[_0x3a57('0x25')](_0x1d4ef6)[_0x3a57('0x26')](function(_0xa52d29){return _0xa52d29;});}return null;};}function removeEntity(_0x1903e0,_0x2065ea){return function(_0x4fa3be){if(_0x4fa3be){return _0x4fa3be['destroy']()[_0x3a57('0x26')](function(){var _0xe59683=_0x4fa3be[_0x3a57('0x27')]({'plain':!![]});var _0x2f2f7f=_0x3a57('0x28');return db[_0x3a57('0x29')]['destroy']({'where':{'type':_0x2f2f7f,'resourceId':_0xe59683['id']}})[_0x3a57('0x26')](function(){return _0x4fa3be;});})[_0x3a57('0x26')](function(){_0x1903e0[_0x3a57('0x1a')](0xcc)[_0x3a57('0x1b')]();});}};}function handleEntityNotFound(_0x9a8a15,_0x46ac53){return function(_0x1254e4){if(!_0x1254e4){_0x9a8a15[_0x3a57('0x19')](0x194);}return _0x1254e4;};}function handleError(_0x82c7af,_0x3407d4){_0x3407d4=_0x3407d4||0x1f4;return function(_0x10526e){logger['error'](_0x10526e[_0x3a57('0x2a')]);if(_0x10526e[_0x3a57('0x2b')]){delete _0x10526e['name'];}_0x82c7af[_0x3a57('0x1a')](_0x3407d4)[_0x3a57('0x2c')](_0x10526e);};}exports['index']=function(_0x272b4f,_0x5d9c5e){var _0x4bcf82={},_0x1f7d2c={},_0xf442f9={'count':0x0,'rows':[]};var _0x383959=_[_0x3a57('0x2d')](db['AnalyticCustomReport'][_0x3a57('0x2e')],function(_0x414d76){return{'name':_0x414d76[_0x3a57('0x2f')],'type':_0x414d76[_0x3a57('0x30')]['key']};});_0x1f7d2c[_0x3a57('0x31')]=_[_0x3a57('0x2d')](_0x383959,_0x3a57('0x2b'));_0x1f7d2c[_0x3a57('0x32')]=_['keys'](_0x272b4f[_0x3a57('0x32')]);_0x1f7d2c[_0x3a57('0x33')]=_[_0x3a57('0x34')](_0x1f7d2c['model'],_0x1f7d2c[_0x3a57('0x32')]);_0x4bcf82[_0x3a57('0x35')]=_['intersection'](_0x1f7d2c[_0x3a57('0x31')],qs['fields'](_0x272b4f[_0x3a57('0x32')][_0x3a57('0x36')]));_0x4bcf82[_0x3a57('0x35')]=_0x4bcf82[_0x3a57('0x35')][_0x3a57('0x37')]?_0x4bcf82['attributes']:_0x1f7d2c[_0x3a57('0x31')];if(!_0x272b4f[_0x3a57('0x32')][_0x3a57('0x38')](_0x3a57('0x39'))){_0x4bcf82['limit']=qs[_0x3a57('0x1e')](_0x272b4f['query']['limit']);_0x4bcf82[_0x3a57('0x1d')]=qs[_0x3a57('0x1d')](_0x272b4f[_0x3a57('0x32')][_0x3a57('0x1d')]);}_0x4bcf82['order']=qs[_0x3a57('0x3a')](_0x272b4f[_0x3a57('0x32')][_0x3a57('0x3a')]);_0x4bcf82[_0x3a57('0x3b')]=qs[_0x3a57('0x33')](_[_0x3a57('0x3c')](_0x272b4f['query'],_0x1f7d2c[_0x3a57('0x33')]),_0x383959);if(_0x272b4f['query'][_0x3a57('0x3d')]){_0x4bcf82[_0x3a57('0x3b')]=_[_0x3a57('0x3e')](_0x4bcf82[_0x3a57('0x3b')],{'$or':_['map'](_0x383959,function(_0x184094){if(_0x184094['type']!==_0x3a57('0x3f')){var _0x1e6074={};_0x1e6074[_0x184094[_0x3a57('0x2b')]]={'$like':'%'+_0x272b4f[_0x3a57('0x32')][_0x3a57('0x3d')]+'%'};return _0x1e6074;}})});}_0x4bcf82=_['merge']({},_0x4bcf82,_0x272b4f['options']);var _0x4d9cba={'where':_0x4bcf82['where']};return db[_0x3a57('0x40')][_0x3a57('0x20')](_0x4d9cba)[_0x3a57('0x26')](function(_0x5a3dcd){_0xf442f9[_0x3a57('0x20')]=_0x5a3dcd;if(_0x272b4f['query'][_0x3a57('0x41')]){_0x4bcf82[_0x3a57('0x42')]=[{'all':!![]}];}return db[_0x3a57('0x40')]['findAll'](_0x4bcf82);})[_0x3a57('0x26')](function(_0xfd64a9){_0xf442f9[_0x3a57('0x43')]=_0xfd64a9;return _0xf442f9;})[_0x3a57('0x26')](respondWithFilteredResult(_0x5d9c5e,_0x4bcf82))['catch'](handleError(_0x5d9c5e,null));};exports[_0x3a57('0x44')]=function(_0x1ccc88,_0x2d1c09){var _0x45602f={'raw':![],'where':{'id':_0x1ccc88[_0x3a57('0x45')]['id']}},_0x237a2e={};_0x237a2e[_0x3a57('0x31')]=_[_0x3a57('0x46')](db[_0x3a57('0x40')][_0x3a57('0x2e')]);_0x237a2e[_0x3a57('0x32')]=_['keys'](_0x1ccc88['query']);_0x237a2e[_0x3a57('0x33')]=_['intersection'](_0x237a2e[_0x3a57('0x31')],_0x237a2e[_0x3a57('0x32')]);_0x45602f[_0x3a57('0x35')]=_['intersection'](_0x237a2e[_0x3a57('0x31')],qs[_0x3a57('0x36')](_0x1ccc88[_0x3a57('0x32')]['fields']));_0x45602f['attributes']=_0x45602f[_0x3a57('0x35')]['length']?_0x45602f['attributes']:_0x237a2e[_0x3a57('0x31')];if(_0x1ccc88[_0x3a57('0x32')][_0x3a57('0x41')]){_0x45602f[_0x3a57('0x42')]=[{'all':!![]}];}_0x45602f=_[_0x3a57('0x3e')]({},_0x45602f,_0x1ccc88[_0x3a57('0x47')]);return db['AnalyticCustomReport']['find'](_0x45602f)[_0x3a57('0x26')](handleEntityNotFound(_0x2d1c09,null))[_0x3a57('0x26')](respondWithResult(_0x2d1c09,null))[_0x3a57('0x48')](handleError(_0x2d1c09,null));};exports[_0x3a57('0x49')]=function(_0x1f0f81,_0x18db47){return db[_0x3a57('0x40')][_0x3a57('0x49')](_0x1f0f81['body'],{})[_0x3a57('0x26')](function(_0x5a6d16){var _0x2cadbf=_0x1f0f81[_0x3a57('0x4a')][_0x3a57('0x27')]({'plain':!![]});if(!_0x2cadbf)throw new Error(_0x3a57('0x4b'));if(_0x2cadbf[_0x3a57('0x4c')]===_0x3a57('0x4a')){var _0x41cffb=_0x5a6d16[_0x3a57('0x27')]({'plain':!![]});var _0x289b0b='Reports';return db[_0x3a57('0x4d')][_0x3a57('0x4e')]({'where':{'name':_0x289b0b,'userProfileId':_0x2cadbf['userProfileId']},'raw':!![]})[_0x3a57('0x26')](function(_0x4fdeff){if(_0x4fdeff&&_0x4fdeff[_0x3a57('0x4f')]===0x0){return db['UserProfileResource'][_0x3a57('0x49')]({'name':_0x41cffb[_0x3a57('0x2b')],'resourceId':_0x41cffb['id'],'type':_0x3a57('0x28'),'sectionId':_0x4fdeff['id']},{})[_0x3a57('0x26')](function(){return _0x5a6d16;});}else{return _0x5a6d16;}})[_0x3a57('0x48')](function(_0x824c28){logger[_0x3a57('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x824c28);throw _0x824c28;});}return _0x5a6d16;})[_0x3a57('0x26')](respondWithResult(_0x18db47,0xc9))['catch'](handleError(_0x18db47,null));};exports['update']=function(_0x564e85,_0x19b375){if(_0x564e85['body']['id']){delete _0x564e85[_0x3a57('0x51')]['id'];}return db['AnalyticCustomReport'][_0x3a57('0x4e')]({'where':{'id':_0x564e85[_0x3a57('0x45')]['id']}})['then'](handleEntityNotFound(_0x19b375,null))[_0x3a57('0x26')](saveUpdates(_0x564e85[_0x3a57('0x51')],null))[_0x3a57('0x26')](respondWithResult(_0x19b375,null))[_0x3a57('0x48')](handleError(_0x19b375,null));};exports[_0x3a57('0x52')]=function(_0x44f250,_0x1fe3b8){return db[_0x3a57('0x40')]['find']({'where':{'id':_0x44f250[_0x3a57('0x45')]['id']}})[_0x3a57('0x26')](handleEntityNotFound(_0x1fe3b8,null))[_0x3a57('0x26')](removeEntity(_0x1fe3b8,null))[_0x3a57('0x48')](handleError(_0x1fe3b8,null));};exports['preview']=function(_0x3ec915,_0x28bdf3){var _0x3e8bbf=0xa;var _0x231693=[_0x3a57('0x53'),_0x3a57('0x54'),_0x3a57('0x55'),_0x3a57('0x56')];var _0x12d95c={'SUM':_0x3a57('0x57'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x3a57('0x58'),'MIN':_0x3a57('0x59'),'AVG':_0x3a57('0x5a'),'GROUP_CONCAT':_0x3a57('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x3a57('0x5c')};var _0x3b6b34={'SEC_TO_TIME':_0x3a57('0x5d'),'DATE':_0x3a57('0x5e'),'HOUR':'HOUR(%s)','ROUND':_0x3a57('0x5f'),'UNIX_TIMESTAMP':_0x3a57('0x60')};var _0xabaac2=function(_0x486345){return!_['includes']([_0x3a57('0x61'),'IS\x20NOT\x20NULL',_0x3a57('0x62'),'IS\x20NOT\x20EMPTY'],_0x486345);};var _0x40308e=function(_0x456388){if(!_0x456388||!_0x456388[_0x3a57('0x63')][_0x3a57('0x37')]){return'';}for(var _0x615769='(',_0x45e805=0x0;_0x45e805<_0x456388[_0x3a57('0x63')][_0x3a57('0x37')];_0x45e805+=0x1){_0x45e805>0x0&&(_0x615769+='\x20'+_0x456388[_0x3a57('0x64')]+'\x20');_0x615769+=_0x456388[_0x3a57('0x63')][_0x45e805][_0x3a57('0x65')]?_0x40308e(_0x456388['rules'][_0x45e805][_0x3a57('0x65')]):_0x456388[_0x3a57('0x63')][_0x45e805][_0x3a57('0x66')]+'\x20'+_0x456388['rules'][_0x45e805][_0x3a57('0x67')]+(_0xabaac2(_0x456388[_0x3a57('0x63')][_0x45e805]['condition'])?'\x20'+_0x456388[_0x3a57('0x63')][_0x45e805][_0x3a57('0x68')]:'');}return _0x615769+')';};var _0x260c66={'where':{'id':_0x3ec915[_0x3a57('0x45')]['id']}},_0x4f9b98,_0x135559,_0x4a2ce0,_0x2e470b,_0x217bd6;_0x260c66=_[_0x3a57('0x3e')]({},_0x260c66,_0x3ec915[_0x3a57('0x47')]);return db['AnalyticCustomReport']['find'](_0x260c66)[_0x3a57('0x26')](function(_0x122ff2){if(_0x122ff2){_0x4f9b98=_0x122ff2;return _0x122ff2[_0x3a57('0x69')]();}return null;})[_0x3a57('0x26')](function(_0x53a3bb){if(_0x53a3bb){if(!_0x53a3bb[_0x3a57('0x37')]){throw new db[(_0x3a57('0x6a'))][(_0x3a57('0x6b'))](_0x3a57('0x6c'),0x193);}_0x135559=_0x53a3bb;return db[_0x3a57('0x6d')][_0x3a57('0x6e')]({'raw':!![]});}return null;})[_0x3a57('0x26')](function(_0x2434f4){if(_0x2434f4){_0x4a2ce0=_[_0x3a57('0x6f')](_0x2434f4,'id');var _0xd2c2bd;var _0x11d46c=squel[_0x3a57('0x70')]();_0x11d46c[_0x3a57('0x71')](_0x4f9b98['table']);for(var _0x4db123=0x0;_0x4db123<_0x135559[_0x3a57('0x37')];_0x4db123+=0x1){_0xd2c2bd=_0x135559[_0x4db123][_0x3a57('0x72')]?_0x4a2ce0[_0x135559[_0x4db123][_0x3a57('0x72')]]['metric']:_0x135559[_0x4db123][_0x3a57('0x66')];_0xd2c2bd=_0x135559[_0x4db123][_0x3a57('0x73')]?_['replace'](_0x12d95c[_0x135559[_0x4db123][_0x3a57('0x73')]],'%s',_0xd2c2bd):_0xd2c2bd;_0xd2c2bd=_0x135559[_0x4db123][_0x3a57('0x74')]?_[_0x3a57('0x75')](_0x3b6b34[_0x135559[_0x4db123][_0x3a57('0x74')]],'%s',_0xd2c2bd):_0xd2c2bd;if(_0x135559[_0x4db123][_0x3a57('0x76')]){_0x11d46c['group'](_0xd2c2bd);}_0x135559[_0x4db123][_0x3a57('0x77')]&&_0x11d46c[_0x3a57('0x78')](_0xd2c2bd,_0x135559[_0x4db123][_0x3a57('0x77')]===_0x3a57('0x79')?![]:!![]);_0x11d46c['field'](_0xd2c2bd,_0x135559[_0x4db123][_0x3a57('0x7a')]||_0xd2c2bd);}if(_0x4f9b98[_0x3a57('0x7b')]){_0x4f9b98[_0x3a57('0x7b')]=JSON[_0x3a57('0x7c')](_0x4f9b98[_0x3a57('0x7b')]);for(var _0x5581d9=0x0;_0x5581d9<_0x4f9b98[_0x3a57('0x7b')][_0x3a57('0x37')];_0x5581d9+=0x1){if(_0x4f9b98[_0x3a57('0x7b')][_0x5581d9]['type']&&_[_0x3a57('0x7d')](_0x231693,_0x4f9b98[_0x3a57('0x7b')][_0x5581d9][_0x3a57('0x30')])&&_0x4f9b98[_0x3a57('0x7b')][_0x5581d9]['parentKey']&&_0x4f9b98['joins'][_0x5581d9]['foreignTable']&&_0x4f9b98[_0x3a57('0x7b')][_0x5581d9][_0x3a57('0x7e')]){_0x11d46c[_0x4f9b98[_0x3a57('0x7b')][_0x5581d9][_0x3a57('0x30')]](_0x4f9b98[_0x3a57('0x7b')][_0x5581d9]['foreignTable'],null,util[_0x3a57('0x74')]('%s.%s\x20=\x20%s.%s',_0x4f9b98[_0x3a57('0x7f')],_0x4f9b98[_0x3a57('0x7b')][_0x5581d9]['parentKey'],_0x4f9b98[_0x3a57('0x7b')][_0x5581d9][_0x3a57('0x80')],_0x4f9b98['joins'][_0x5581d9][_0x3a57('0x7e')]));}}}if(_0x4f9b98[_0x3a57('0x81')]){_0x4f9b98[_0x3a57('0x81')]=JSON[_0x3a57('0x7c')](_0x4f9b98['conditions']);_0x11d46c['where'](_0x40308e(_0x4f9b98[_0x3a57('0x81')][_0x3a57('0x65')]));}_0x217bd6=_0x11d46c['clone']();_0x11d46c['limit'](_0x3e8bbf);_0x11d46c['offset'](0x0);logger[_0x3a57('0x82')](_0x3a57('0x83'),_0x11d46c[_0x3a57('0x84')]());return dbH[_0x3a57('0x85')][_0x3a57('0x32')](_0x11d46c[_0x3a57('0x84')](),{'type':dbH[_0x3a57('0x85')][_0x3a57('0x86')][_0x3a57('0x87')]});}})[_0x3a57('0x26')](respondWithResult(_0x28bdf3,null))[_0x3a57('0x48')](handleError(_0x28bdf3,null));};function runReport(_0x3ff690,_0x449f92,_0x157395){var _0x18b9fe=_0x449f92['name'];var _0x40f970=0xa;var _0x3d2246=['join',_0x3a57('0x54'),_0x3a57('0x55'),_0x3a57('0x56')];var _0xfd7d10={'SUM':_0x3a57('0x57'),'COUNT':_0x3a57('0x88'),'COUNT DISTINCT':_0x3a57('0x89'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x3a57('0x5a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x3a57('0x8a'),'GROUP_CONCAT DESC':_0x3a57('0x5c')};var _0x41ac32={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x3a57('0x5e'),'HOUR':_0x3a57('0x8b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4b74f6=function(_0x17ac25){return!_['includes']([_0x3a57('0x61'),'IS\x20NOT\x20NULL',_0x3a57('0x62'),_0x3a57('0x8c')],_0x17ac25);};var _0x4e6e95=function(_0x335f8c){if(!_0x335f8c||!_0x335f8c[_0x3a57('0x63')]['length']){return'';}for(var _0x1ccff0='(',_0x28f3b0=0x0;_0x28f3b0<_0x335f8c[_0x3a57('0x63')]['length'];_0x28f3b0+=0x1){_0x28f3b0>0x0&&(_0x1ccff0+='\x20'+_0x335f8c[_0x3a57('0x64')]+'\x20');_0x1ccff0+=_0x335f8c[_0x3a57('0x63')][_0x28f3b0][_0x3a57('0x65')]?_0x4e6e95(_0x335f8c[_0x3a57('0x63')][_0x28f3b0][_0x3a57('0x65')]):_0x335f8c[_0x3a57('0x63')][_0x28f3b0][_0x3a57('0x66')]+'\x20'+_0x335f8c['rules'][_0x28f3b0][_0x3a57('0x67')]+(_0x4b74f6(_0x335f8c[_0x3a57('0x63')][_0x28f3b0]['condition'])?'\x20'+_0x335f8c[_0x3a57('0x63')][_0x28f3b0][_0x3a57('0x68')]:'');}return _0x1ccff0+')';};var _0x33e574={'where':{'id':_0x3ff690['id']}},_0x23a623,_0x3aafeb,_0x2b0816,_0x6c2bf2,_0x3bf411;_0x33e574=_[_0x3a57('0x3e')]({},_0x33e574,_0x157395);return db[_0x3a57('0x40')]['find'](_0x33e574)['then'](function(_0x485eee){if(_0x485eee){_0x23a623=_0x485eee;return _0x485eee['getFields']();}return null;})[_0x3a57('0x26')](function(_0x259591){if(_0x259591){if(!_0x259591[_0x3a57('0x37')]){throw new db[(_0x3a57('0x6a'))][(_0x3a57('0x6b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3aafeb=_0x259591;return db[_0x3a57('0x6d')]['findAll']({'raw':!![]});}return null;})[_0x3a57('0x26')](function(_0x4264a3){if(_0x4264a3){_0x2b0816=_[_0x3a57('0x6f')](_0x4264a3,'id');var _0x45726d;var _0x13960e=squel['select']();_0x13960e[_0x3a57('0x71')](_0x23a623[_0x3a57('0x7f')]);for(var _0x32390a=0x0;_0x32390a<_0x3aafeb[_0x3a57('0x37')];_0x32390a+=0x1){_0x45726d=_0x3aafeb[_0x32390a][_0x3a57('0x72')]?_0x2b0816[_0x3aafeb[_0x32390a][_0x3a57('0x72')]][_0x3a57('0x8d')]:_0x3aafeb[_0x32390a][_0x3a57('0x66')];_0x45726d=_0x3aafeb[_0x32390a][_0x3a57('0x73')]?_[_0x3a57('0x75')](_0xfd7d10[_0x3aafeb[_0x32390a][_0x3a57('0x73')]],'%s',_0x45726d):_0x45726d;_0x45726d=_0x3aafeb[_0x32390a][_0x3a57('0x74')]?_['replace'](_0x41ac32[_0x3aafeb[_0x32390a][_0x3a57('0x74')]],'%s',_0x45726d):_0x45726d;if(_0x3aafeb[_0x32390a][_0x3a57('0x76')]){_0x13960e[_0x3a57('0x65')](_0x45726d);}_0x3aafeb[_0x32390a][_0x3a57('0x77')]&&_0x13960e['order'](_0x45726d,_0x3aafeb[_0x32390a][_0x3a57('0x77')]===_0x3a57('0x79')?![]:!![]);_0x13960e[_0x3a57('0x66')](_0x45726d,_0x3aafeb[_0x32390a][_0x3a57('0x7a')]||_0x45726d);}if(_0x23a623[_0x3a57('0x7b')]){_0x23a623['joins']=JSON[_0x3a57('0x7c')](_0x23a623[_0x3a57('0x7b')]);for(var _0x10ccc1=0x0;_0x10ccc1<_0x23a623[_0x3a57('0x7b')][_0x3a57('0x37')];_0x10ccc1+=0x1){if(_0x23a623[_0x3a57('0x7b')][_0x10ccc1][_0x3a57('0x30')]&&_[_0x3a57('0x7d')](_0x3d2246,_0x23a623[_0x3a57('0x7b')][_0x10ccc1][_0x3a57('0x30')])&&_0x23a623[_0x3a57('0x7b')][_0x10ccc1][_0x3a57('0x8e')]&&_0x23a623[_0x3a57('0x7b')][_0x10ccc1][_0x3a57('0x80')]&&_0x23a623[_0x3a57('0x7b')][_0x10ccc1][_0x3a57('0x7e')]){_0x13960e[_0x23a623[_0x3a57('0x7b')][_0x10ccc1]['type']](_0x23a623['joins'][_0x10ccc1]['foreignTable'],null,util[_0x3a57('0x74')](_0x3a57('0x8f'),_0x23a623[_0x3a57('0x7f')],_0x23a623[_0x3a57('0x7b')][_0x10ccc1][_0x3a57('0x8e')],_0x23a623[_0x3a57('0x7b')][_0x10ccc1]['foreignTable'],_0x23a623[_0x3a57('0x7b')][_0x10ccc1]['foreignKey']));}}}if(_0x23a623['conditions']){_0x23a623[_0x3a57('0x81')]=JSON['parse'](_0x23a623[_0x3a57('0x81')]);_0x13960e[_0x3a57('0x3b')](_0x4e6e95(_0x23a623['conditions']['group']));}_0x3bf411=_0x13960e[_0x3a57('0x90')]();_0x13960e[_0x3a57('0x1e')](_0x40f970);_0x13960e[_0x3a57('0x1d')](0x0);return;}})['then'](function(){if(_0x449f92[_0x3a57('0x91')]===_0x3a57('0x92')){return null;}var _0x1953b9=_['merge'](_0x449f92,{'name':_0x449f92[_0x3a57('0x93')]||_0x449f92['name']||_0x23a623[_0x3a57('0x2b')],'basename':_0x18b9fe,'savename':util[_0x3a57('0x74')](_0x3a57('0x94'),_0x449f92[_0x3a57('0x2b')]||_0x23a623['name'],require(_0x3a57('0x95'))[_0x3a57('0x96')](0x4),_0x449f92[_0x3a57('0x91')]||_0x3a57('0x97')),'reportId':_0x23a623['id'],'reportType':_0x3a57('0x98')});return db[_0x3a57('0x99')][_0x3a57('0x49')](_0x1953b9,{'raw':!![]});})[_0x3a57('0x26')](function(_0x3919e2){if(_0x23a623[_0x3a57('0x7f')]===_0x3a57('0x9a')){_0x3bf411['where'](_0x23a623[_0x3a57('0x7f')]+_0x3a57('0x9b'),_0x449f92[_0x3a57('0x9c')],_0x449f92[_0x3a57('0x9d')]);}else{_0x3bf411[_0x3a57('0x3b')](_0x23a623['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x449f92[_0x3a57('0x9c')],_0x449f92[_0x3a57('0x9d')]);}if(_0x3919e2){logger['info'](_0x3a57('0x9e'),_0x3bf411[_0x3a57('0x84')]());require('child_process')[_0x3a57('0x9f')](path[_0x3a57('0x53')](__dirname,_0x3a57('0xa0'),_0x3919e2['output']),[_0x3919e2['id'],_0x3bf411[_0x3a57('0x84')](),path[_0x3a57('0x53')](__dirname,_0x3a57('0xa1'),_0x3919e2[_0x3a57('0xa2')]),_0x18b9fe]);return _0x3919e2;}else{var _0x13a9a5=squel['select']();_0x13a9a5['from']('('+_0x3bf411[_0x3a57('0x84')]()+')',_0x3a57('0xa3'));_0x13a9a5[_0x3a57('0x66')](_0x3a57('0xa4'),_0x3a57('0x20'));_0x3bf411[_0x3a57('0x1e')](_0x449f92[_0x3a57('0x1e')]||_0x40f970);_0x3bf411[_0x3a57('0x1d')](_0x449f92['offset']||0x0);return dbH[_0x3a57('0x85')]['query'](_0x13a9a5['toString'](),{'type':dbH[_0x3a57('0x85')][_0x3a57('0x86')][_0x3a57('0x87')]})[_0x3a57('0x26')](function(_0x57502e){if(!_0x57502e[_0x3a57('0x37')]){_0x6c2bf2=0x0;}else{_0x6c2bf2=_0x57502e[0x0][_0x3a57('0x20')]||0x0;}return dbH[_0x3a57('0x85')][_0x3a57('0x32')](_0x3bf411[_0x3a57('0x84')](),{'type':dbH[_0x3a57('0x85')][_0x3a57('0x86')][_0x3a57('0x87')]});})['then'](function(_0x5c740b){return{'rows':_0x5c740b||[],'count':_0x6c2bf2};});}});}exports[_0x3a57('0xa5')]=function(_0x696ec2,_0x40c87f){return runReport(_0x696ec2[_0x3a57('0x45')],_0x696ec2['query'],_0x696ec2[_0x3a57('0x47')])[_0x3a57('0x26')](respondWithResult(_0x40c87f,null))[_0x3a57('0x48')](handleError(_0x40c87f,null));};exports[_0x3a57('0xa6')]=runReport;exports['query']=function(_0x2e2208,_0x46ee2e){var _0x109b18=0xa;var _0x686061=[_0x3a57('0x53'),_0x3a57('0x54'),_0x3a57('0x55'),_0x3a57('0x56')];var _0x11a0a5={'SUM':'SUM(%s)','COUNT':_0x3a57('0x88'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x3a57('0x58'),'MIN':_0x3a57('0x59'),'AVG':_0x3a57('0x5a'),'GROUP_CONCAT':_0x3a57('0x5b'),'GROUP_CONCAT ASC':_0x3a57('0x8a'),'GROUP_CONCAT DESC':_0x3a57('0x5c')};var _0x305885={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x3a57('0x5e'),'HOUR':_0x3a57('0x8b'),'ROUND':_0x3a57('0x5f'),'UNIX_TIMESTAMP':_0x3a57('0x60')};var _0x21face=function(_0x288a58){return!_['includes'](['IS\x20NULL',_0x3a57('0xa7'),_0x3a57('0x62'),'IS\x20NOT\x20EMPTY'],_0x288a58);};var _0x2eb14f=function(_0x290407){if(!_0x290407||!_0x290407['rules']['length']){return'';}for(var _0x1d4129='(',_0x1d43e5=0x0;_0x1d43e5<_0x290407[_0x3a57('0x63')][_0x3a57('0x37')];_0x1d43e5+=0x1){_0x1d43e5>0x0&&(_0x1d4129+='\x20'+_0x290407[_0x3a57('0x64')]+'\x20');_0x1d4129+=_0x290407[_0x3a57('0x63')][_0x1d43e5][_0x3a57('0x65')]?_0x2eb14f(_0x290407[_0x3a57('0x63')][_0x1d43e5]['group']):_0x290407[_0x3a57('0x63')][_0x1d43e5][_0x3a57('0x66')]+'\x20'+_0x290407[_0x3a57('0x63')][_0x1d43e5]['condition']+(_0x21face(_0x290407[_0x3a57('0x63')][_0x1d43e5][_0x3a57('0x67')])?'\x20'+_0x290407[_0x3a57('0x63')][_0x1d43e5][_0x3a57('0x68')]:'');}return _0x1d4129+')';};var _0x21da4a={'where':{'id':_0x2e2208['params']['id']}},_0xf9c9a9,_0x36b89d,_0x5291ca,_0x2b8f3d,_0x56c175;_0x21da4a=_[_0x3a57('0x3e')]({},_0x21da4a,_0x2e2208['options']);return db[_0x3a57('0x40')][_0x3a57('0x4e')](_0x21da4a)['then'](function(_0x276077){if(_0x276077){_0xf9c9a9=_0x276077;return _0x276077[_0x3a57('0x69')]();}return null;})[_0x3a57('0x26')](function(_0x148709){if(_0x148709){if(!_0x148709['length']){throw new db[(_0x3a57('0x6a'))][(_0x3a57('0x6b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x36b89d=_0x148709;return db[_0x3a57('0x6d')][_0x3a57('0x6e')]({'raw':!![]});}return null;})['then'](function(_0xa88412){if(_0xa88412){_0x5291ca=_[_0x3a57('0x6f')](_0xa88412,'id');var _0x1a7608;var _0x119869=squel[_0x3a57('0x70')]();_0x119869[_0x3a57('0x71')](_0xf9c9a9[_0x3a57('0x7f')]);for(var _0x36ea0b=0x0;_0x36ea0b<_0x36b89d[_0x3a57('0x37')];_0x36ea0b+=0x1){_0x1a7608=_0x36b89d[_0x36ea0b][_0x3a57('0x72')]?_0x5291ca[_0x36b89d[_0x36ea0b]['MetricId']][_0x3a57('0x8d')]:_0x36b89d[_0x36ea0b][_0x3a57('0x66')];_0x1a7608=_0x36b89d[_0x36ea0b][_0x3a57('0x73')]?_[_0x3a57('0x75')](_0x11a0a5[_0x36b89d[_0x36ea0b][_0x3a57('0x73')]],'%s',_0x1a7608):_0x1a7608;_0x1a7608=_0x36b89d[_0x36ea0b][_0x3a57('0x74')]?_[_0x3a57('0x75')](_0x305885[_0x36b89d[_0x36ea0b][_0x3a57('0x74')]],'%s',_0x1a7608):_0x1a7608;if(_0x36b89d[_0x36ea0b][_0x3a57('0x76')]){_0x119869[_0x3a57('0x65')](_0x1a7608);}_0x36b89d[_0x36ea0b][_0x3a57('0x77')]&&_0x119869[_0x3a57('0x78')](_0x1a7608,_0x36b89d[_0x36ea0b][_0x3a57('0x77')]===_0x3a57('0x79')?![]:!![]);_0x119869[_0x3a57('0x66')](_0x1a7608,_0x36b89d[_0x36ea0b][_0x3a57('0x7a')]||_0x1a7608);}if(_0xf9c9a9['joins']){_0xf9c9a9[_0x3a57('0x7b')]=JSON['parse'](_0xf9c9a9['joins']);for(var _0x58a66c=0x0;_0x58a66c<_0xf9c9a9[_0x3a57('0x7b')][_0x3a57('0x37')];_0x58a66c+=0x1){if(_0xf9c9a9[_0x3a57('0x7b')][_0x58a66c][_0x3a57('0x30')]&&_[_0x3a57('0x7d')](_0x686061,_0xf9c9a9['joins'][_0x58a66c]['type'])&&_0xf9c9a9['joins'][_0x58a66c][_0x3a57('0x8e')]&&_0xf9c9a9[_0x3a57('0x7b')][_0x58a66c]['foreignTable']&&_0xf9c9a9[_0x3a57('0x7b')][_0x58a66c][_0x3a57('0x7e')]){_0x119869[_0xf9c9a9[_0x3a57('0x7b')][_0x58a66c][_0x3a57('0x30')]](_0xf9c9a9[_0x3a57('0x7b')][_0x58a66c][_0x3a57('0x80')],null,util[_0x3a57('0x74')]('%s.%s\x20=\x20%s.%s',_0xf9c9a9[_0x3a57('0x7f')],_0xf9c9a9[_0x3a57('0x7b')][_0x58a66c][_0x3a57('0x8e')],_0xf9c9a9[_0x3a57('0x7b')][_0x58a66c][_0x3a57('0x80')],_0xf9c9a9[_0x3a57('0x7b')][_0x58a66c][_0x3a57('0x7e')]));}}}if(_0xf9c9a9[_0x3a57('0x81')]){_0xf9c9a9[_0x3a57('0x81')]=JSON[_0x3a57('0x7c')](_0xf9c9a9[_0x3a57('0x81')]);_0x119869['where'](_0x2eb14f(_0xf9c9a9[_0x3a57('0x81')]['group']));}_0x56c175=_0x119869[_0x3a57('0x90')]();_0x119869['limit'](_0x109b18);_0x119869[_0x3a57('0x1d')](0x0);logger[_0x3a57('0x82')](_0x3a57('0x83'),_0x119869[_0x3a57('0x84')]());return dbH['sequelize']['query'](_0x119869[_0x3a57('0x84')](),{'type':dbH[_0x3a57('0x85')]['QueryTypes'][_0x3a57('0x87')]});}})[_0x3a57('0x26')](function(){return{'sql':_0x56c175['toString']()};})['then'](respondWithResult(_0x46ee2e,null))[_0x3a57('0x48')](handleError(_0x46ee2e,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 41f0d5c..5b3a406 100644 --- a/server/api/analyticCustomReport/analyticCustomReport.model.js +++ b/server/api/analyticCustomReport/analyticCustomReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x51d4=['../../config/environment','./analyticCustomReport.attributes','exports','AnalyticCustomReport','analytics_custom_reports','lodash','util','api','bluebird','rimraf'];(function(_0x5c6ceb,_0x4ed099){var _0x28821b=function(_0x391add){while(--_0x391add){_0x5c6ceb['push'](_0x5c6ceb['shift']());}};_0x28821b(++_0x4ed099);}(_0x51d4,0x13b));var _0x451d=function(_0x3d658e,_0x513bec){_0x3d658e=_0x3d658e-0x0;var _0x38c2e7=_0x51d4[_0x3d658e];return _0x38c2e7;};'use strict';var _=require(_0x451d('0x0'));var util=require(_0x451d('0x1'));var logger=require('../../config/logger')(_0x451d('0x2'));var moment=require('moment');var BPromise=require(_0x451d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x451d('0x4'));var config=require(_0x451d('0x5'));var attributes=require(_0x451d('0x6'));module[_0x451d('0x7')]=function(_0x60e192,_0x24c0fe){return _0x60e192['define'](_0x451d('0x8'),attributes,{'tableName':_0x451d('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa5ef=['./analyticCustomReport.attributes','AnalyticCustomReport','analytics_custom_reports','lodash','moment','path','rimraf','../../config/environment'];(function(_0x4e4b82,_0xf4df54){var _0x2c874e=function(_0x4a41d8){while(--_0x4a41d8){_0x4e4b82['push'](_0x4e4b82['shift']());}};_0x2c874e(++_0xf4df54);}(_0xa5ef,0xeb));var _0xfa5e=function(_0x41c842,_0x3865f6){_0x41c842=_0x41c842-0x0;var _0x15ee6b=_0xa5ef[_0x41c842];return _0x15ee6b;};'use strict';var _=require(_0xfa5e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xfa5e('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfa5e('0x2'));var rimraf=require(_0xfa5e('0x3'));var config=require(_0xfa5e('0x4'));var attributes=require(_0xfa5e('0x5'));module['exports']=function(_0x3c96e7,_0x369260){return _0x3c96e7['define'](_0xfa5e('0x6'),attributes,{'tableName':_0xfa5e('0x7'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index bc60ce8..6ab3129 100644 --- a/server/api/analyticCustomReport/analyticCustomReport.rpc.js +++ b/server/api/analyticCustomReport/analyticCustomReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4590=['AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent'];(function(_0x474bb8,_0x1873e9){var _0x1507db=function(_0x58ba7c){while(--_0x58ba7c){_0x474bb8['push'](_0x474bb8['shift']());}};_0x1507db(++_0x1873e9);}(_0x4590,0x159));var _0x0459=function(_0x2e1cc4,_0x5e93f6){_0x2e1cc4=_0x2e1cc4-0x0;var _0x50be05=_0x4590[_0x2e1cc4];return _0x50be05;};'use strict';var _=require(_0x0459('0x0'));var util=require(_0x0459('0x1'));var moment=require(_0x0459('0x2'));var BPromise=require(_0x0459('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0459('0x4'));var db=require(_0x0459('0x5'))['db'];var utils=require(_0x0459('0x6'));var logger=require(_0x0459('0x7'))(_0x0459('0x8'));var config=require(_0x0459('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0459('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27128d,_0x5ac42c,_0x11f51c){return new BPromise(function(_0x149623,_0xed1a41){return client[_0x0459('0xb')](_0x27128d,_0x11f51c)['then'](function(_0x36bdd1){logger[_0x0459('0xc')](_0x0459('0xd'),_0x5ac42c,_0x0459('0xe'));logger['debug'](_0x0459('0xf'),_0x5ac42c,'request\x20sent',JSON[_0x0459('0x10')](_0x36bdd1));if(_0x36bdd1[_0x0459('0x11')]){if(_0x36bdd1['error']['code']===0x1f4){logger[_0x0459('0x11')](_0x0459('0xd'),_0x5ac42c,_0x36bdd1['error'][_0x0459('0x12')]);return _0xed1a41(_0x36bdd1['error'][_0x0459('0x12')]);}logger[_0x0459('0x11')](_0x0459('0xd'),_0x5ac42c,_0x36bdd1[_0x0459('0x11')]['message']);return _0x149623(_0x36bdd1[_0x0459('0x11')][_0x0459('0x12')]);}else{logger[_0x0459('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5ac42c,_0x0459('0xe'));_0x149623(_0x36bdd1[_0x0459('0x13')][_0x0459('0x12')]);}})['catch'](function(_0x2d77fa){logger[_0x0459('0x11')](_0x0459('0xd'),_0x5ac42c,_0x2d77fa);_0xed1a41(_0x2d77fa);});});} \ No newline at end of file +var _0x34b5=['rpc','http','request','info','AnalyticCustomReport,\x20%s,\x20%s','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x5ad771,_0x34186f){var _0x5b5dce=function(_0x5ad0fb){while(--_0x5ad0fb){_0x5ad771['push'](_0x5ad771['shift']());}};_0x5b5dce(++_0x34186f);}(_0x34b5,0xe8));var _0x534b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x34b5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x534b('0x0'));var util=require(_0x534b('0x1'));var moment=require(_0x534b('0x2'));var BPromise=require(_0x534b('0x3'));var rs=require(_0x534b('0x4'));var fs=require('fs');var Redis=require(_0x534b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x534b('0x6'));var logger=require(_0x534b('0x7'))(_0x534b('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x534b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d8866,_0x5666cb,_0x1538a7){return new BPromise(function(_0xb4df6b,_0x4a620d){return client[_0x534b('0xa')](_0x3d8866,_0x1538a7)['then'](function(_0x3f8025){logger[_0x534b('0xb')](_0x534b('0xc'),_0x5666cb,'request\x20sent');logger['debug'](_0x534b('0xd'),_0x5666cb,_0x534b('0xe'),JSON[_0x534b('0xf')](_0x3f8025));if(_0x3f8025[_0x534b('0x10')]){if(_0x3f8025[_0x534b('0x10')][_0x534b('0x11')]===0x1f4){logger[_0x534b('0x10')](_0x534b('0xc'),_0x5666cb,_0x3f8025['error'][_0x534b('0x12')]);return _0x4a620d(_0x3f8025[_0x534b('0x10')][_0x534b('0x12')]);}logger['error'](_0x534b('0xc'),_0x5666cb,_0x3f8025[_0x534b('0x10')][_0x534b('0x12')]);return _0xb4df6b(_0x3f8025[_0x534b('0x10')][_0x534b('0x12')]);}else{logger[_0x534b('0xb')](_0x534b('0xc'),_0x5666cb,'request\x20sent');_0xb4df6b(_0x3f8025[_0x534b('0x13')]['message']);}})['catch'](function(_0x4b3b78){logger[_0x534b('0x10')](_0x534b('0xc'),_0x5666cb,_0x4b3b78);_0x4a620d(_0x4b3b78);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 9e78d3e..e05f32b 100644 --- a/server/api/analyticCustomReport/index.js +++ b/server/api/analyticCustomReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x101b=['/:id/preview','preview','/:id/run','get','/:id/query','create','put','update','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','/:id'];(function(_0x40fd89,_0x53973a){var _0x5e6192=function(_0x553e54){while(--_0x553e54){_0x40fd89['push'](_0x40fd89['shift']());}};_0x5e6192(++_0x53973a);}(_0x101b,0x183));var _0xb101=function(_0x5350cc,_0x46aeeb){_0x5350cc=_0x5350cc-0x0;var _0x2f0a16=_0x101b[_0x5350cc];return _0x2f0a16;};'use strict';var multer=require(_0xb101('0x0'));var util=require(_0xb101('0x1'));var path=require(_0xb101('0x2'));var timeout=require(_0xb101('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb101('0x4'));var auth=require(_0xb101('0x5'));var interaction=require(_0xb101('0x6'));var config=require(_0xb101('0x7'));var controller=require(_0xb101('0x8'));router['get']('/',auth[_0xb101('0x9')](),controller[_0xb101('0xa')]);router['get'](_0xb101('0xb'),auth[_0xb101('0x9')](),controller['show']);router['get'](_0xb101('0xc'),auth['isAuthenticated'](),controller[_0xb101('0xd')]);router['get'](_0xb101('0xe'),auth[_0xb101('0x9')](),controller['run']);router[_0xb101('0xf')](_0xb101('0x10'),auth[_0xb101('0x9')](),controller['query']);router['post']('/',auth[_0xb101('0x9')](),controller[_0xb101('0x11')]);router[_0xb101('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xb101('0x13')]);router['delete'](_0xb101('0xb'),auth['isAuthenticated'](),controller[_0xb101('0x14')]);module['exports']=router; \ No newline at end of file +var _0x9eac=['../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/run','run','query','post','create','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4f3463,_0x5a1ee7){var _0x5f0e49=function(_0x41419f){while(--_0x41419f){_0x4f3463['push'](_0x4f3463['shift']());}};_0x5f0e49(++_0x5a1ee7);}(_0x9eac,0x152));var _0xc9ea=function(_0x2becba,_0x4ea656){_0x2becba=_0x2becba-0x0;var _0x90b5dd=_0x9eac[_0x2becba];return _0x90b5dd;};'use strict';var multer=require('multer');var util=require(_0xc9ea('0x0'));var path=require(_0xc9ea('0x1'));var timeout=require(_0xc9ea('0x2'));var express=require(_0xc9ea('0x3'));var router=express[_0xc9ea('0x4')]();var fs_extra=require(_0xc9ea('0x5'));var auth=require(_0xc9ea('0x6'));var interaction=require(_0xc9ea('0x7'));var config=require(_0xc9ea('0x8'));var controller=require('./analyticCustomReport.controller');router[_0xc9ea('0x9')]('/',auth[_0xc9ea('0xa')](),controller['index']);router[_0xc9ea('0x9')](_0xc9ea('0xb'),auth[_0xc9ea('0xa')](),controller[_0xc9ea('0xc')]);router[_0xc9ea('0x9')](_0xc9ea('0xd'),auth[_0xc9ea('0xa')](),controller[_0xc9ea('0xe')]);router[_0xc9ea('0x9')](_0xc9ea('0xf'),auth[_0xc9ea('0xa')](),controller[_0xc9ea('0x10')]);router[_0xc9ea('0x9')]('/:id/query',auth['isAuthenticated'](),controller[_0xc9ea('0x11')]);router[_0xc9ea('0x12')]('/',auth['isAuthenticated'](),controller[_0xc9ea('0x13')]);router['put'](_0xc9ea('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xc9ea('0x14')](_0xc9ea('0xb'),auth[_0xc9ea('0xa')](),controller[_0xc9ea('0x15')]);module[_0xc9ea('0x16')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index a381cbd..a902109 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7c09=['exports','STRING','TEXT'];(function(_0x20edb2,_0x127ca7){var _0x24e94a=function(_0x52163a){while(--_0x52163a){_0x20edb2['push'](_0x20edb2['shift']());}};_0x24e94a(++_0x127ca7);}(_0x7c09,0x102));var _0x97c0=function(_0x4196b4,_0x236af2){_0x4196b4=_0x4196b4-0x0;var _0x420b40=_0x7c09[_0x4196b4];return _0x420b40;};'use strict';var Sequelize=require('sequelize');module[_0x97c0('0x0')]={'name':{'type':Sequelize[_0x97c0('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x97c0('0x1')]},'table':{'type':Sequelize[_0x97c0('0x1')]},'conditions':{'type':Sequelize[_0x97c0('0x2')]},'joins':{'type':Sequelize[_0x97c0('0x2')]}}; \ No newline at end of file +var _0xac9d=['TEXT','sequelize','exports','STRING'];(function(_0x111d40,_0x14ce0c){var _0x261ce8=function(_0x3cced1){while(--_0x3cced1){_0x111d40['push'](_0x111d40['shift']());}};_0x261ce8(++_0x14ce0c);}(_0xac9d,0x14d));var _0xdac9=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0xac9d[_0x4a747d];return _0x3a5b5c;};'use strict';var Sequelize=require(_0xdac9('0x0'));module[_0xdac9('0x1')]={'name':{'type':Sequelize[_0xdac9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdac9('0x2')]},'parent':{'type':Sequelize[_0xdac9('0x2')]},'table':{'type':Sequelize[_0xdac9('0x2')]},'conditions':{'type':Sequelize[_0xdac9('0x3')]},'joins':{'type':Sequelize[_0xdac9('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index e607e72..55420af 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc6ac=['keyBy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','dbH','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','DefaultReports','UserProfileResource','stack','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','name','query','keys','filters','fields','attributes','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','intersection','length','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','left_join','right_join','cross_join','SUM(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','field','condition','value','Sequelize','AnalyticMetric','select','from','table','MetricId','replace','format','group','DESC','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','join','COUNT(%s)','COUNT(DISTINCT\x20%s)','IS\x20NOT\x20EMPTY','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','metric','function','groupBy','orderBy','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','getFields'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x15b659,_0x3d8086){_0x15b659=_0x15b659-0x0;var _0x2b37bc=_0xc6ac[_0x15b659];return _0x2b37bc;};'use strict';var emlformat=require(_0xcc6a('0x0'));var rimraf=require(_0xcc6a('0x1'));var zipdir=require(_0xcc6a('0x2'));var jsonpatch=require(_0xcc6a('0x3'));var rp=require(_0xcc6a('0x4'));var moment=require(_0xcc6a('0x5'));var BPromise=require(_0xcc6a('0x6'));var Mustache=require(_0xcc6a('0x7'));var util=require(_0xcc6a('0x8'));var path=require(_0xcc6a('0x9'));var sox=require(_0xcc6a('0xa'));var csv=require(_0xcc6a('0xb'));var ejs=require(_0xcc6a('0xc'));var fs=require('fs');var fs_extra=require(_0xcc6a('0xd'));var _=require('lodash');var squel=require(_0xcc6a('0xe'));var crypto=require(_0xcc6a('0xf'));var jsforce=require(_0xcc6a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xcc6a('0xb'));var querystring=require(_0xcc6a('0x11'));var Papa=require(_0xcc6a('0x12'));var Redis=require(_0xcc6a('0x13'));var authService=require(_0xcc6a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xcc6a('0x15'));var hardwareService=require(_0xcc6a('0x16'));var logger=require(_0xcc6a('0x17'))('api');var utils=require(_0xcc6a('0x18'));var config=require(_0xcc6a('0x19'));var licenseUtil=require(_0xcc6a('0x1a'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xcc6a('0x1b')];function respondWithStatusCode(_0x211444,_0x4300c0){_0x4300c0=_0x4300c0||0xcc;return function(_0x559a0a){if(_0x559a0a){return _0x211444['sendStatus'](_0x4300c0);}return _0x211444[_0xcc6a('0x1c')](_0x4300c0)[_0xcc6a('0x1d')]();};}function respondWithResult(_0x43710d,_0x348af7){_0x348af7=_0x348af7||0xc8;return function(_0x96f9de){if(_0x96f9de){return _0x43710d[_0xcc6a('0x1c')](_0x348af7)[_0xcc6a('0x1e')](_0x96f9de);}};}function respondWithFilteredResult(_0x403b18,_0x56ffb0){return function(_0x4e628f){if(_0x4e628f){var _0x4d021a=typeof _0x56ffb0[_0xcc6a('0x1f')]===_0xcc6a('0x20')&&typeof _0x56ffb0[_0xcc6a('0x21')]===_0xcc6a('0x20');var _0x33079c=_0x4e628f[_0xcc6a('0x22')];var _0x2d9585=_0x4d021a?0x0:_0x56ffb0[_0xcc6a('0x1f')];var _0x374e51=_0x4d021a?_0x4e628f[_0xcc6a('0x22')]:_0x56ffb0[_0xcc6a('0x1f')]+_0x56ffb0['limit'];var _0xfec60f;if(_0x374e51>=_0x33079c){_0x374e51=_0x33079c;_0xfec60f=0xc8;}else{_0xfec60f=0xce;}_0x403b18[_0xcc6a('0x1c')](_0xfec60f);return _0x403b18[_0xcc6a('0x23')](_0xcc6a('0x24'),_0x2d9585+'-'+_0x374e51+'/'+_0x33079c)[_0xcc6a('0x1e')](_0x4e628f);}return null;};}function patchUpdates(_0x30b8ed){return function(_0x36c80f){try{jsonpatch[_0xcc6a('0x25')](_0x36c80f,_0x30b8ed,!![]);}catch(_0x2254a8){return BPromise[_0xcc6a('0x26')](_0x2254a8);}return _0x36c80f[_0xcc6a('0x27')]();};}function saveUpdates(_0x845088,_0x51be9a){return function(_0x41c4c8){if(_0x41c4c8){return _0x41c4c8[_0xcc6a('0x28')](_0x845088)[_0xcc6a('0x29')](function(_0x581aae){return _0x581aae;});}return null;};}function removeEntity(_0x10016a,_0x294486){return function(_0x3a00e5){if(_0x3a00e5){return _0x3a00e5[_0xcc6a('0x2a')]()[_0xcc6a('0x29')](function(){var _0x5fc697=_0x3a00e5['get']({'plain':!![]});var _0x26def8=_0xcc6a('0x2b');return db[_0xcc6a('0x2c')]['destroy']({'where':{'type':_0x26def8,'resourceId':_0x5fc697['id']}})[_0xcc6a('0x29')](function(){return _0x3a00e5;});})[_0xcc6a('0x29')](function(){_0x10016a['status'](0xcc)[_0xcc6a('0x1d')]();});}};}function handleEntityNotFound(_0x8b1b2b,_0x3233d1){return function(_0x473f88){if(!_0x473f88){_0x8b1b2b['sendStatus'](0x194);}return _0x473f88;};}function handleError(_0x194aab,_0x3cf14c){_0x3cf14c=_0x3cf14c||0x1f4;return function(_0x2c6d88){logger['error'](_0x2c6d88[_0xcc6a('0x2d')]);if(_0x2c6d88['name']){delete _0x2c6d88['name'];}_0x194aab[_0xcc6a('0x1c')](_0x3cf14c)[_0xcc6a('0x2e')](_0x2c6d88);};}exports[_0xcc6a('0x2f')]=function(_0x11b481,_0x2b575d){var _0x131138={},_0x4e2de4={},_0x7b2b54={'count':0x0,'rows':[]};var _0x28e3c3=_[_0xcc6a('0x30')](db[_0xcc6a('0x31')][_0xcc6a('0x32')],function(_0x152ebd){return{'name':_0x152ebd[_0xcc6a('0x33')],'type':_0x152ebd[_0xcc6a('0x34')]['key']};});_0x4e2de4[_0xcc6a('0x35')]=_[_0xcc6a('0x30')](_0x28e3c3,_0xcc6a('0x36'));_0x4e2de4[_0xcc6a('0x37')]=_[_0xcc6a('0x38')](_0x11b481[_0xcc6a('0x37')]);_0x4e2de4[_0xcc6a('0x39')]=_['intersection'](_0x4e2de4[_0xcc6a('0x35')],_0x4e2de4['query']);_0x131138['attributes']=_['intersection'](_0x4e2de4[_0xcc6a('0x35')],qs[_0xcc6a('0x3a')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x3a')]));_0x131138[_0xcc6a('0x3b')]=_0x131138['attributes']['length']?_0x131138[_0xcc6a('0x3b')]:_0x4e2de4[_0xcc6a('0x35')];if(!_0x11b481[_0xcc6a('0x37')]['hasOwnProperty'](_0xcc6a('0x3c'))){_0x131138[_0xcc6a('0x21')]=qs[_0xcc6a('0x21')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x21')]);_0x131138[_0xcc6a('0x1f')]=qs[_0xcc6a('0x1f')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x1f')]);}_0x131138[_0xcc6a('0x3d')]=qs[_0xcc6a('0x3e')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x3e')]);_0x131138[_0xcc6a('0x3f')]=qs[_0xcc6a('0x39')](_[_0xcc6a('0x40')](_0x11b481[_0xcc6a('0x37')],_0x4e2de4[_0xcc6a('0x39')]),_0x28e3c3);if(_0x11b481['query']['filter']){_0x131138[_0xcc6a('0x3f')]=_[_0xcc6a('0x41')](_0x131138[_0xcc6a('0x3f')],{'$or':_[_0xcc6a('0x30')](_0x28e3c3,function(_0x1e628b){if(_0x1e628b[_0xcc6a('0x34')]!==_0xcc6a('0x42')){var _0x1199f1={};_0x1199f1[_0x1e628b['name']]={'$like':'%'+_0x11b481['query'][_0xcc6a('0x43')]+'%'};return _0x1199f1;}})});}_0x131138=_['merge']({},_0x131138,_0x11b481['options']);var _0x5cf1ba={'where':_0x131138[_0xcc6a('0x3f')]};return db[_0xcc6a('0x31')][_0xcc6a('0x22')](_0x5cf1ba)[_0xcc6a('0x29')](function(_0xe8056f){_0x7b2b54['count']=_0xe8056f;if(_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x44')]){_0x131138[_0xcc6a('0x45')]=[{'all':!![]}];}return db[_0xcc6a('0x31')][_0xcc6a('0x46')](_0x131138);})[_0xcc6a('0x29')](function(_0x54f862){_0x7b2b54[_0xcc6a('0x47')]=_0x54f862;return _0x7b2b54;})[_0xcc6a('0x29')](respondWithFilteredResult(_0x2b575d,_0x131138))[_0xcc6a('0x48')](handleError(_0x2b575d,null));};exports[_0xcc6a('0x49')]=function(_0x494904,_0x1fe723){var _0x4a9cea={'raw':!![],'where':{'id':_0x494904[_0xcc6a('0x4a')]['id']}},_0x351529={};_0x351529[_0xcc6a('0x35')]=_['keys'](db[_0xcc6a('0x31')][_0xcc6a('0x32')]);_0x351529[_0xcc6a('0x37')]=_['keys'](_0x494904['query']);_0x351529[_0xcc6a('0x39')]=_[_0xcc6a('0x4b')](_0x351529[_0xcc6a('0x35')],_0x351529[_0xcc6a('0x37')]);_0x4a9cea[_0xcc6a('0x3b')]=_['intersection'](_0x351529[_0xcc6a('0x35')],qs[_0xcc6a('0x3a')](_0x494904['query'][_0xcc6a('0x3a')]));_0x4a9cea[_0xcc6a('0x3b')]=_0x4a9cea[_0xcc6a('0x3b')][_0xcc6a('0x4c')]?_0x4a9cea[_0xcc6a('0x3b')]:_0x351529[_0xcc6a('0x35')];if(_0x494904['query']['includeAll']){_0x4a9cea['include']=[{'all':!![]}];}_0x4a9cea=_[_0xcc6a('0x41')]({},_0x4a9cea,_0x494904[_0xcc6a('0x4d')]);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x4a9cea)['then'](handleEntityNotFound(_0x1fe723,null))[_0xcc6a('0x29')](respondWithResult(_0x1fe723,null))['catch'](handleError(_0x1fe723,null));};exports[_0xcc6a('0x4f')]=function(_0x4299ca,_0xcfc540){return db[_0xcc6a('0x31')][_0xcc6a('0x4f')](_0x4299ca[_0xcc6a('0x50')],{})['then'](function(_0x1a3b82){var _0x7288b2=_0x4299ca[_0xcc6a('0x51')][_0xcc6a('0x52')]({'plain':!![]});if(!_0x7288b2)throw new Error(_0xcc6a('0x53'));if(_0x7288b2[_0xcc6a('0x54')]===_0xcc6a('0x51')){var _0x392805=_0x1a3b82[_0xcc6a('0x52')]({'plain':!![]});var _0x30d0ef='Reports';return db[_0xcc6a('0x55')][_0xcc6a('0x4e')]({'where':{'name':_0x30d0ef,'userProfileId':_0x7288b2[_0xcc6a('0x56')]},'raw':!![]})[_0xcc6a('0x29')](function(_0x14f5e5){if(_0x14f5e5&&_0x14f5e5[_0xcc6a('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x392805[_0xcc6a('0x36')],'resourceId':_0x392805['id'],'type':'DefaultReports','sectionId':_0x14f5e5['id']},{})[_0xcc6a('0x29')](function(){return _0x1a3b82;});}else{return _0x1a3b82;}})[_0xcc6a('0x48')](function(_0x2b5782){logger[_0xcc6a('0x58')](_0xcc6a('0x59'),_0x2b5782);throw _0x2b5782;});}return _0x1a3b82;})[_0xcc6a('0x29')](respondWithResult(_0xcfc540,0xc9))[_0xcc6a('0x48')](handleError(_0xcfc540,null));};exports[_0xcc6a('0x28')]=function(_0x68b823,_0x27b074){if(_0x68b823[_0xcc6a('0x50')]['id']){delete _0x68b823['body']['id'];}return db[_0xcc6a('0x31')]['find']({'where':{'id':_0x68b823[_0xcc6a('0x4a')]['id']}})[_0xcc6a('0x29')](handleEntityNotFound(_0x27b074,null))[_0xcc6a('0x29')](saveUpdates(_0x68b823['body'],null))[_0xcc6a('0x29')](respondWithResult(_0x27b074,null))['catch'](handleError(_0x27b074,null));};exports[_0xcc6a('0x2a')]=function(_0x5db3b5,_0x3c0b1c){return db[_0xcc6a('0x31')][_0xcc6a('0x4e')]({'where':{'id':_0x5db3b5[_0xcc6a('0x4a')]['id']}})[_0xcc6a('0x29')](handleEntityNotFound(_0x3c0b1c,null))[_0xcc6a('0x29')](removeEntity(_0x3c0b1c,null))[_0xcc6a('0x48')](handleError(_0x3c0b1c,null));};exports[_0xcc6a('0x5a')]=function(_0x506311,_0x14d3ff){var _0x56d512=0xa;var _0x3a6b7e=['join',_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x586789={'SUM':_0xcc6a('0x5e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xcc6a('0x5f'),'MIN':_0xcc6a('0x60'),'AVG':_0xcc6a('0x61'),'GROUP_CONCAT':_0xcc6a('0x62'),'GROUP_CONCAT ASC':_0xcc6a('0x63'),'GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x389e5f={'SEC_TO_TIME':_0xcc6a('0x65'),'DATE':_0xcc6a('0x66'),'HOUR':_0xcc6a('0x67'),'ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x2cc561=function(_0x483aa4){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),_0xcc6a('0x6c'),_0xcc6a('0x6d'),'IS\x20NOT\x20EMPTY'],_0x483aa4);};var _0x46d93b=function(_0x4ed702){if(!_0x4ed702||!_0x4ed702[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x20a16b='(',_0x19a578=0x0;_0x19a578<_0x4ed702[_0xcc6a('0x6e')][_0xcc6a('0x4c')];_0x19a578+=0x1){_0x19a578>0x0&&(_0x20a16b+='\x20'+_0x4ed702[_0xcc6a('0x6f')]+'\x20');_0x20a16b+=_0x4ed702[_0xcc6a('0x6e')][_0x19a578]['group']?_0x46d93b(_0x4ed702['rules'][_0x19a578]['group']):_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x70')]+'\x20'+_0x4ed702[_0xcc6a('0x6e')][_0x19a578]['condition']+(_0x2cc561(_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x71')])?'\x20'+_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x72')]:'');}return _0x20a16b+')';};var _0x5e1c69={'where':{'id':_0x506311['params']['id']}},_0x481d25,_0xaec5e8,_0x41527b,_0x4403d3,_0x386a74;_0x5e1c69=_[_0xcc6a('0x41')]({},_0x5e1c69,_0x506311[_0xcc6a('0x4d')]);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x5e1c69)[_0xcc6a('0x29')](function(_0x55d129){if(_0x55d129){_0x481d25=_0x55d129;return _0x55d129['getFields']();}return null;})[_0xcc6a('0x29')](function(_0xd1a27b){if(_0xd1a27b){if(!_0xd1a27b[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xaec5e8=_0xd1a27b;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x421d0b){if(_0x421d0b){_0x41527b=_['keyBy'](_0x421d0b,'id');var _0x4a8863;var _0x58e6b4=squel[_0xcc6a('0x75')]();_0x58e6b4[_0xcc6a('0x76')](_0x481d25[_0xcc6a('0x77')]);for(var _0x729b2=0x0;_0x729b2<_0xaec5e8['length'];_0x729b2+=0x1){_0x4a8863=_0xaec5e8[_0x729b2][_0xcc6a('0x78')]?_0x41527b[_0xaec5e8[_0x729b2][_0xcc6a('0x78')]]['metric']:_0xaec5e8[_0x729b2][_0xcc6a('0x70')];_0x4a8863=_0xaec5e8[_0x729b2]['function']?_[_0xcc6a('0x79')](_0x586789[_0xaec5e8[_0x729b2]['function']],'%s',_0x4a8863):_0x4a8863;_0x4a8863=_0xaec5e8[_0x729b2][_0xcc6a('0x7a')]?_[_0xcc6a('0x79')](_0x389e5f[_0xaec5e8[_0x729b2][_0xcc6a('0x7a')]],'%s',_0x4a8863):_0x4a8863;if(_0xaec5e8[_0x729b2]['groupBy']){_0x58e6b4[_0xcc6a('0x7b')](_0x4a8863);}_0xaec5e8[_0x729b2]['orderBy']&&_0x58e6b4[_0xcc6a('0x3d')](_0x4a8863,_0xaec5e8[_0x729b2]['orderBy']===_0xcc6a('0x7c')?![]:!![]);_0x58e6b4[_0xcc6a('0x70')](_0x4a8863,_0xaec5e8[_0x729b2][_0xcc6a('0x7d')]||_0x4a8863);}if(_0x481d25[_0xcc6a('0x7e')]){_0x481d25[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x481d25['joins']);for(var _0x18f5dc=0x0;_0x18f5dc<_0x481d25[_0xcc6a('0x7e')][_0xcc6a('0x4c')];_0x18f5dc+=0x1){if(_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')]&&_['includes'](_0x3a6b7e,_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')])&&_0x481d25['joins'][_0x18f5dc]['parentKey']&&_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x80')]&&_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x81')]){_0x58e6b4[_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')]](_0x481d25['joins'][_0x18f5dc][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x481d25[_0xcc6a('0x77')],_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x83')],_0x481d25['joins'][_0x18f5dc]['foreignTable'],_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x81')]));}}}if(_0x481d25[_0xcc6a('0x84')]){_0x481d25[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x481d25[_0xcc6a('0x84')]);_0x58e6b4[_0xcc6a('0x3f')](_0x46d93b(_0x481d25['conditions'][_0xcc6a('0x7b')]));}_0x386a74=_0x58e6b4[_0xcc6a('0x85')]();_0x58e6b4[_0xcc6a('0x21')](_0x56d512);_0x58e6b4[_0xcc6a('0x1f')](0x0);logger[_0xcc6a('0x86')](_0xcc6a('0x87'),_0x58e6b4['toString']());return dbH[_0xcc6a('0x88')][_0xcc6a('0x37')](_0x58e6b4[_0xcc6a('0x89')](),{'type':dbH['sequelize'][_0xcc6a('0x8a')][_0xcc6a('0x8b')]});}})[_0xcc6a('0x29')](respondWithResult(_0x14d3ff,null))[_0xcc6a('0x48')](handleError(_0x14d3ff,null));};function runReport(_0x2a25df,_0x1f1ff7,_0x565bcd){var _0x45c45f=_0x1f1ff7[_0xcc6a('0x36')];var _0x58cd56=0xa;var _0x1848dd=[_0xcc6a('0x8c'),_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x5abd5c={'SUM':_0xcc6a('0x5e'),'COUNT':_0xcc6a('0x8d'),'COUNT DISTINCT':_0xcc6a('0x8e'),'MAX':_0xcc6a('0x5f'),'MIN':_0xcc6a('0x60'),'AVG':_0xcc6a('0x61'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x5be65b={'SEC_TO_TIME':_0xcc6a('0x65'),'DATE':_0xcc6a('0x66'),'HOUR':_0xcc6a('0x67'),'ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x2b5c15=function(_0x3207b2){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),_0xcc6a('0x6c'),_0xcc6a('0x6d'),_0xcc6a('0x8f')],_0x3207b2);};var _0x58fdb3=function(_0xb4b2b4){if(!_0xb4b2b4||!_0xb4b2b4[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x275e15='(',_0x53b419=0x0;_0x53b419<_0xb4b2b4[_0xcc6a('0x6e')]['length'];_0x53b419+=0x1){_0x53b419>0x0&&(_0x275e15+='\x20'+_0xb4b2b4[_0xcc6a('0x6f')]+'\x20');_0x275e15+=_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x7b')]?_0x58fdb3(_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x7b')]):_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x70')]+'\x20'+_0xb4b2b4['rules'][_0x53b419][_0xcc6a('0x71')]+(_0x2b5c15(_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x71')])?'\x20'+_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x72')]:'');}return _0x275e15+')';};var _0x4473ab={'where':{'id':_0x2a25df['id']}},_0x558e2f,_0x14a957,_0x350766,_0x589bff,_0x5661b5;_0x4473ab=_[_0xcc6a('0x41')]({},_0x4473ab,_0x565bcd);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x4473ab)[_0xcc6a('0x29')](function(_0x2f0b79){if(_0x2f0b79){_0x558e2f=_0x2f0b79;return _0x2f0b79['getFields']();}return null;})[_0xcc6a('0x29')](function(_0x4a268b){if(_0x4a268b){if(!_0x4a268b[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))][(_0xcc6a('0x90'))](_0xcc6a('0x91'),0x193);}_0x14a957=_0x4a268b;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x1f4c4e){if(_0x1f4c4e){_0x350766=_['keyBy'](_0x1f4c4e,'id');var _0x312431;var _0x2a850c=squel[_0xcc6a('0x75')]();_0x2a850c['from'](_0x558e2f[_0xcc6a('0x77')]);for(var _0xd5b9f3=0x0;_0xd5b9f3<_0x14a957[_0xcc6a('0x4c')];_0xd5b9f3+=0x1){_0x312431=_0x14a957[_0xd5b9f3][_0xcc6a('0x78')]?_0x350766[_0x14a957[_0xd5b9f3][_0xcc6a('0x78')]][_0xcc6a('0x92')]:_0x14a957[_0xd5b9f3][_0xcc6a('0x70')];_0x312431=_0x14a957[_0xd5b9f3]['function']?_[_0xcc6a('0x79')](_0x5abd5c[_0x14a957[_0xd5b9f3][_0xcc6a('0x93')]],'%s',_0x312431):_0x312431;_0x312431=_0x14a957[_0xd5b9f3][_0xcc6a('0x7a')]?_[_0xcc6a('0x79')](_0x5be65b[_0x14a957[_0xd5b9f3][_0xcc6a('0x7a')]],'%s',_0x312431):_0x312431;if(_0x14a957[_0xd5b9f3][_0xcc6a('0x94')]){_0x2a850c[_0xcc6a('0x7b')](_0x312431);}_0x14a957[_0xd5b9f3][_0xcc6a('0x95')]&&_0x2a850c['order'](_0x312431,_0x14a957[_0xd5b9f3]['orderBy']===_0xcc6a('0x7c')?![]:!![]);_0x2a850c['field'](_0x312431,_0x14a957[_0xd5b9f3][_0xcc6a('0x7d')]||_0x312431);}if(_0x558e2f[_0xcc6a('0x7e')]){_0x558e2f[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x558e2f[_0xcc6a('0x7e')]);for(var _0x1f7ee5=0x0;_0x1f7ee5<_0x558e2f[_0xcc6a('0x7e')]['length'];_0x1f7ee5+=0x1){if(_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['type']&&_['includes'](_0x1848dd,_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['type'])&&_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x83')]&&_0x558e2f['joins'][_0x1f7ee5]['foreignTable']&&_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['foreignKey']){_0x2a850c[_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x34')]](_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x558e2f['table'],_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x83')],_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x80')],_0x558e2f['joins'][_0x1f7ee5][_0xcc6a('0x81')]));}}}if(_0x558e2f[_0xcc6a('0x84')]){_0x558e2f[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x558e2f[_0xcc6a('0x84')]);_0x2a850c[_0xcc6a('0x3f')](_0x58fdb3(_0x558e2f[_0xcc6a('0x84')]['group']));}_0x5661b5=_0x2a850c[_0xcc6a('0x85')]();_0x2a850c[_0xcc6a('0x21')](_0x58cd56);_0x2a850c['offset'](0x0);return;}})[_0xcc6a('0x29')](function(){if(_0x1f1ff7[_0xcc6a('0x96')]===_0xcc6a('0x97')){return null;}var _0x2297ea=_[_0xcc6a('0x41')](_0x1f1ff7,{'name':_0x1f1ff7[_0xcc6a('0x98')]||_0x1f1ff7[_0xcc6a('0x36')]||_0x558e2f[_0xcc6a('0x36')],'basename':_0x45c45f,'savename':util[_0xcc6a('0x7a')](_0xcc6a('0x99'),_0x1f1ff7[_0xcc6a('0x36')]||_0x558e2f[_0xcc6a('0x36')],require(_0xcc6a('0x9a'))[_0xcc6a('0x9b')](0x4),_0x1f1ff7['output']||'csv'),'reportId':_0x558e2f['id'],'reportType':_0xcc6a('0x9c')});return db[_0xcc6a('0x9d')]['create'](_0x2297ea,{'raw':!![]});})[_0xcc6a('0x29')](function(_0x1e74a4){if(_0x558e2f[_0xcc6a('0x77')]==='cdr'){_0x5661b5[_0xcc6a('0x3f')](_0x558e2f['table']+_0xcc6a('0x9e'),_0x1f1ff7[_0xcc6a('0x9f')],_0x1f1ff7['endDate']);}else{_0x5661b5[_0xcc6a('0x3f')](_0x558e2f['table']+_0xcc6a('0xa0'),_0x1f1ff7[_0xcc6a('0x9f')],_0x1f1ff7[_0xcc6a('0xa1')]);}if(_0x1e74a4){logger[_0xcc6a('0xa2')](_0xcc6a('0xa3'),_0x5661b5[_0xcc6a('0x89')]());require('child_process')['fork'](path[_0xcc6a('0x8c')](__dirname,_0xcc6a('0xa4'),_0x1e74a4[_0xcc6a('0x96')]),[_0x1e74a4['id'],_0x5661b5['toString'](),path[_0xcc6a('0x8c')](__dirname,_0xcc6a('0xa5'),_0x1e74a4[_0xcc6a('0xa6')]),_0x45c45f]);return _0x1e74a4;}else{var _0x3b7b43=squel['select']();_0x3b7b43[_0xcc6a('0x76')]('('+_0x5661b5[_0xcc6a('0x89')]()+')',_0xcc6a('0xa7'));_0x3b7b43['field'](_0xcc6a('0xa8'),'count');_0x5661b5[_0xcc6a('0x21')](_0x1f1ff7[_0xcc6a('0x21')]||_0x58cd56);_0x5661b5['offset'](_0x1f1ff7[_0xcc6a('0x1f')]||0x0);return dbH[_0xcc6a('0x88')][_0xcc6a('0x37')](_0x3b7b43[_0xcc6a('0x89')](),{'type':dbH[_0xcc6a('0x88')][_0xcc6a('0x8a')][_0xcc6a('0x8b')]})[_0xcc6a('0x29')](function(_0x25ba57){if(!_0x25ba57[_0xcc6a('0x4c')]){_0x589bff=0x0;}else{_0x589bff=_0x25ba57[0x0][_0xcc6a('0x22')]||0x0;}return dbH['sequelize']['query'](_0x5661b5[_0xcc6a('0x89')](),{'type':dbH['sequelize'][_0xcc6a('0x8a')]['SELECT']});})['then'](function(_0x32ced0){return{'rows':_0x32ced0||[],'count':_0x589bff};});}});}exports[_0xcc6a('0xa9')]=function(_0xc638ae,_0x3367e8){return runReport(_0xc638ae['params'],_0xc638ae[_0xcc6a('0x37')],_0xc638ae['options'])['then'](respondWithResult(_0x3367e8,null))[_0xcc6a('0x48')](handleError(_0x3367e8,null));};exports[_0xcc6a('0xaa')]=runReport;exports[_0xcc6a('0x37')]=function(_0x38d805,_0x3f5f97){var _0x399eb6=0xa;var _0x2ae391=['join',_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x50b948={'SUM':_0xcc6a('0x5e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xcc6a('0x8e'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xcc6a('0x61'),'GROUP_CONCAT':_0xcc6a('0x62'),'GROUP_CONCAT ASC':_0xcc6a('0x63'),'GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x1d2ae0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x41d17b=function(_0x1827e6){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),'IS\x20NOT\x20NULL',_0xcc6a('0x6d'),'IS\x20NOT\x20EMPTY'],_0x1827e6);};var _0xa70fa=function(_0x33ec76){if(!_0x33ec76||!_0x33ec76[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x30162c='(',_0x48746a=0x0;_0x48746a<_0x33ec76['rules'][_0xcc6a('0x4c')];_0x48746a+=0x1){_0x48746a>0x0&&(_0x30162c+='\x20'+_0x33ec76[_0xcc6a('0x6f')]+'\x20');_0x30162c+=_0x33ec76['rules'][_0x48746a][_0xcc6a('0x7b')]?_0xa70fa(_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x7b')]):_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x70')]+'\x20'+_0x33ec76[_0xcc6a('0x6e')][_0x48746a]['condition']+(_0x41d17b(_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x71')])?'\x20'+_0x33ec76[_0xcc6a('0x6e')][_0x48746a]['value']:'');}return _0x30162c+')';};var _0x54f0e4={'where':{'id':_0x38d805[_0xcc6a('0x4a')]['id']}},_0x559f4f,_0x545b15,_0x17a4e1,_0x5a7da7,_0x434c8b;_0x54f0e4=_['merge']({},_0x54f0e4,_0x38d805[_0xcc6a('0x4d')]);return db['AnalyticDefaultReport'][_0xcc6a('0x4e')](_0x54f0e4)[_0xcc6a('0x29')](function(_0xe9231f){if(_0xe9231f){_0x559f4f=_0xe9231f;return _0xe9231f[_0xcc6a('0xab')]();}return null;})[_0xcc6a('0x29')](function(_0x197961){if(_0x197961){if(!_0x197961[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))][(_0xcc6a('0x90'))](_0xcc6a('0x91'),0x193);}_0x545b15=_0x197961;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x171a2a){if(_0x171a2a){_0x17a4e1=_[_0xcc6a('0xac')](_0x171a2a,'id');var _0x13860b;var _0x3b52f7=squel[_0xcc6a('0x75')]();_0x3b52f7[_0xcc6a('0x76')](_0x559f4f[_0xcc6a('0x77')]);for(var _0x319f4a=0x0;_0x319f4a<_0x545b15[_0xcc6a('0x4c')];_0x319f4a+=0x1){_0x13860b=_0x545b15[_0x319f4a]['MetricId']?_0x17a4e1[_0x545b15[_0x319f4a][_0xcc6a('0x78')]][_0xcc6a('0x92')]:_0x545b15[_0x319f4a][_0xcc6a('0x70')];_0x13860b=_0x545b15[_0x319f4a]['function']?_[_0xcc6a('0x79')](_0x50b948[_0x545b15[_0x319f4a][_0xcc6a('0x93')]],'%s',_0x13860b):_0x13860b;_0x13860b=_0x545b15[_0x319f4a]['format']?_[_0xcc6a('0x79')](_0x1d2ae0[_0x545b15[_0x319f4a][_0xcc6a('0x7a')]],'%s',_0x13860b):_0x13860b;if(_0x545b15[_0x319f4a]['groupBy']){_0x3b52f7[_0xcc6a('0x7b')](_0x13860b);}_0x545b15[_0x319f4a][_0xcc6a('0x95')]&&_0x3b52f7[_0xcc6a('0x3d')](_0x13860b,_0x545b15[_0x319f4a][_0xcc6a('0x95')]===_0xcc6a('0x7c')?![]:!![]);_0x3b52f7[_0xcc6a('0x70')](_0x13860b,_0x545b15[_0x319f4a]['alias']||_0x13860b);}if(_0x559f4f['joins']){_0x559f4f[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x559f4f['joins']);for(var _0x154885=0x0;_0x154885<_0x559f4f['joins'][_0xcc6a('0x4c')];_0x154885+=0x1){if(_0x559f4f['joins'][_0x154885][_0xcc6a('0x34')]&&_[_0xcc6a('0x6a')](_0x2ae391,_0x559f4f[_0xcc6a('0x7e')][_0x154885]['type'])&&_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x83')]&&_0x559f4f[_0xcc6a('0x7e')][_0x154885]['foreignTable']&&_0x559f4f['joins'][_0x154885]['foreignKey']){_0x3b52f7[_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x34')]](_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x559f4f[_0xcc6a('0x77')],_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x83')],_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x80')],_0x559f4f[_0xcc6a('0x7e')][_0x154885]['foreignKey']));}}}if(_0x559f4f[_0xcc6a('0x84')]){_0x559f4f[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x559f4f['conditions']);_0x3b52f7[_0xcc6a('0x3f')](_0xa70fa(_0x559f4f[_0xcc6a('0x84')][_0xcc6a('0x7b')]));}_0x434c8b=_0x3b52f7['clone']();_0x3b52f7[_0xcc6a('0x21')](_0x399eb6);_0x3b52f7[_0xcc6a('0x1f')](0x0);logger[_0xcc6a('0x86')](_0xcc6a('0x87'),_0x3b52f7['toString']());return dbH[_0xcc6a('0x88')]['query'](_0x3b52f7['toString'](),{'type':dbH['sequelize'][_0xcc6a('0x8a')]['SELECT']});}})['then'](function(){return{'sql':_0x434c8b[_0xcc6a('0x89')]()};})[_0xcc6a('0x29')](respondWithResult(_0x3f5f97,null))[_0xcc6a('0x48')](handleError(_0x3f5f97,null));}; \ No newline at end of file +var _0x7a54=['options','AnalyticDefaultReport','includeAll','include','show','keys','attributes','create','body','user','role','get','Reports','UserProfileSection','userProfileId','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','MetricId','metric','field','function','replace','format','orderBy','DESC','joins','parse','type','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','debug','toString','sequelize','QueryTypes','SELECT','join','left_join','COUNT(DISTINCT\x20%s)','MAX(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','operator','groupBy','alias','output','web','fullPath','%s-%s.%s','generate','default','AnalyticExtractedReport','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','getFields','clone','Limited\x20Query:','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','limit','count','offset','Content-Range','apply','save','then','destroy','DefaultReports','error','stack','name','index','map','fieldName','model','query','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge'];(function(_0xe5e3fb,_0x2fa636){var _0xdc5834=function(_0x5960b7){while(--_0x5960b7){_0xe5e3fb['push'](_0xe5e3fb['shift']());}};_0xdc5834(++_0x2fa636);}(_0x7a54,0x106));var _0x47a5=function(_0x5f3079,_0x5f5f2a){_0x5f3079=_0x5f3079-0x0;var _0x125893=_0x7a54[_0x5f3079];return _0x125893;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];var dbH=require(_0x47a5('0x15'))[_0x47a5('0x16')];function respondWithStatusCode(_0x5beb89,_0x44bd3e){_0x44bd3e=_0x44bd3e||0xcc;return function(_0x221b54){if(_0x221b54){return _0x5beb89[_0x47a5('0x17')](_0x44bd3e);}return _0x5beb89[_0x47a5('0x18')](_0x44bd3e)[_0x47a5('0x19')]();};}function respondWithResult(_0x620ee9,_0x3c6c46){_0x3c6c46=_0x3c6c46||0xc8;return function(_0x190faa){if(_0x190faa){return _0x620ee9['status'](_0x3c6c46)[_0x47a5('0x1a')](_0x190faa);}};}function respondWithFilteredResult(_0x11faf5,_0x3b001e){return function(_0x2a2cbb){if(_0x2a2cbb){var _0x1ef44c=typeof _0x3b001e['offset']==='undefined'&&typeof _0x3b001e[_0x47a5('0x1b')]==='undefined';var _0x5247fd=_0x2a2cbb[_0x47a5('0x1c')];var _0xaf70a6=_0x1ef44c?0x0:_0x3b001e[_0x47a5('0x1d')];var _0x1ef371=_0x1ef44c?_0x2a2cbb[_0x47a5('0x1c')]:_0x3b001e[_0x47a5('0x1d')]+_0x3b001e[_0x47a5('0x1b')];var _0xe3c618;if(_0x1ef371>=_0x5247fd){_0x1ef371=_0x5247fd;_0xe3c618=0xc8;}else{_0xe3c618=0xce;}_0x11faf5[_0x47a5('0x18')](_0xe3c618);return _0x11faf5['set'](_0x47a5('0x1e'),_0xaf70a6+'-'+_0x1ef371+'/'+_0x5247fd)[_0x47a5('0x1a')](_0x2a2cbb);}return null;};}function patchUpdates(_0x47cf3c){return function(_0x2b0360){try{jsonpatch[_0x47a5('0x1f')](_0x2b0360,_0x47cf3c,!![]);}catch(_0x36874d){return BPromise['reject'](_0x36874d);}return _0x2b0360[_0x47a5('0x20')]();};}function saveUpdates(_0x2f142b,_0x23db32){return function(_0x7a9f9e){if(_0x7a9f9e){return _0x7a9f9e['update'](_0x2f142b)[_0x47a5('0x21')](function(_0x385687){return _0x385687;});}return null;};}function removeEntity(_0x513981,_0x28747d){return function(_0xc4cd63){if(_0xc4cd63){return _0xc4cd63[_0x47a5('0x22')]()[_0x47a5('0x21')](function(){var _0x3abd6a=_0xc4cd63['get']({'plain':!![]});var _0x53078a=_0x47a5('0x23');return db['UserProfileResource'][_0x47a5('0x22')]({'where':{'type':_0x53078a,'resourceId':_0x3abd6a['id']}})['then'](function(){return _0xc4cd63;});})[_0x47a5('0x21')](function(){_0x513981[_0x47a5('0x18')](0xcc)[_0x47a5('0x19')]();});}};}function handleEntityNotFound(_0x1dac65,_0x21f296){return function(_0x3ba0b7){if(!_0x3ba0b7){_0x1dac65[_0x47a5('0x17')](0x194);}return _0x3ba0b7;};}function handleError(_0x136b14,_0x16631f){_0x16631f=_0x16631f||0x1f4;return function(_0x361bfa){logger[_0x47a5('0x24')](_0x361bfa[_0x47a5('0x25')]);if(_0x361bfa[_0x47a5('0x26')]){delete _0x361bfa['name'];}_0x136b14[_0x47a5('0x18')](_0x16631f)['send'](_0x361bfa);};}exports[_0x47a5('0x27')]=function(_0x9ac908,_0x16901f){var _0x4d6b57={},_0x256650={},_0x625952={'count':0x0,'rows':[]};var _0x39b50b=_[_0x47a5('0x28')](db['AnalyticDefaultReport']['rawAttributes'],function(_0x6f9a12){return{'name':_0x6f9a12[_0x47a5('0x29')],'type':_0x6f9a12['type']['key']};});_0x256650[_0x47a5('0x2a')]=_[_0x47a5('0x28')](_0x39b50b,'name');_0x256650[_0x47a5('0x2b')]=_['keys'](_0x9ac908[_0x47a5('0x2b')]);_0x256650[_0x47a5('0x2c')]=_['intersection'](_0x256650['model'],_0x256650[_0x47a5('0x2b')]);_0x4d6b57['attributes']=_[_0x47a5('0x2d')](_0x256650[_0x47a5('0x2a')],qs[_0x47a5('0x2e')](_0x9ac908['query'][_0x47a5('0x2e')]));_0x4d6b57['attributes']=_0x4d6b57['attributes'][_0x47a5('0x2f')]?_0x4d6b57['attributes']:_0x256650[_0x47a5('0x2a')];if(!_0x9ac908['query'][_0x47a5('0x30')](_0x47a5('0x31'))){_0x4d6b57[_0x47a5('0x1b')]=qs[_0x47a5('0x1b')](_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x1b')]);_0x4d6b57[_0x47a5('0x1d')]=qs[_0x47a5('0x1d')](_0x9ac908[_0x47a5('0x2b')]['offset']);}_0x4d6b57[_0x47a5('0x32')]=qs[_0x47a5('0x33')](_0x9ac908['query'][_0x47a5('0x33')]);_0x4d6b57[_0x47a5('0x34')]=qs[_0x47a5('0x2c')](_['pick'](_0x9ac908[_0x47a5('0x2b')],_0x256650[_0x47a5('0x2c')]),_0x39b50b);if(_0x9ac908['query'][_0x47a5('0x35')]){_0x4d6b57[_0x47a5('0x34')]=_['merge'](_0x4d6b57['where'],{'$or':_['map'](_0x39b50b,function(_0x12d9f2){if(_0x12d9f2['type']!==_0x47a5('0x36')){var _0x1f9631={};_0x1f9631[_0x12d9f2[_0x47a5('0x26')]]={'$like':'%'+_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x35')]+'%'};return _0x1f9631;}})});}_0x4d6b57=_[_0x47a5('0x37')]({},_0x4d6b57,_0x9ac908[_0x47a5('0x38')]);var _0x1f3d01={'where':_0x4d6b57[_0x47a5('0x34')]};return db[_0x47a5('0x39')][_0x47a5('0x1c')](_0x1f3d01)[_0x47a5('0x21')](function(_0x23d6d8){_0x625952['count']=_0x23d6d8;if(_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x3a')]){_0x4d6b57[_0x47a5('0x3b')]=[{'all':!![]}];}return db[_0x47a5('0x39')]['findAll'](_0x4d6b57);})[_0x47a5('0x21')](function(_0x528ef3){_0x625952['rows']=_0x528ef3;return _0x625952;})['then'](respondWithFilteredResult(_0x16901f,_0x4d6b57))['catch'](handleError(_0x16901f,null));};exports[_0x47a5('0x3c')]=function(_0x5ec4e5,_0x2bb502){var _0x3a740b={'raw':!![],'where':{'id':_0x5ec4e5['params']['id']}},_0x448610={};_0x448610[_0x47a5('0x2a')]=_[_0x47a5('0x3d')](db['AnalyticDefaultReport']['rawAttributes']);_0x448610[_0x47a5('0x2b')]=_['keys'](_0x5ec4e5[_0x47a5('0x2b')]);_0x448610[_0x47a5('0x2c')]=_[_0x47a5('0x2d')](_0x448610[_0x47a5('0x2a')],_0x448610[_0x47a5('0x2b')]);_0x3a740b[_0x47a5('0x3e')]=_[_0x47a5('0x2d')](_0x448610[_0x47a5('0x2a')],qs[_0x47a5('0x2e')](_0x5ec4e5[_0x47a5('0x2b')][_0x47a5('0x2e')]));_0x3a740b[_0x47a5('0x3e')]=_0x3a740b[_0x47a5('0x3e')][_0x47a5('0x2f')]?_0x3a740b[_0x47a5('0x3e')]:_0x448610[_0x47a5('0x2a')];if(_0x5ec4e5['query'][_0x47a5('0x3a')]){_0x3a740b[_0x47a5('0x3b')]=[{'all':!![]}];}_0x3a740b=_['merge']({},_0x3a740b,_0x5ec4e5['options']);return db[_0x47a5('0x39')]['find'](_0x3a740b)[_0x47a5('0x21')](handleEntityNotFound(_0x2bb502,null))[_0x47a5('0x21')](respondWithResult(_0x2bb502,null))['catch'](handleError(_0x2bb502,null));};exports['create']=function(_0x3d85cc,_0x52d409){return db[_0x47a5('0x39')][_0x47a5('0x3f')](_0x3d85cc[_0x47a5('0x40')],{})[_0x47a5('0x21')](function(_0x44fe8a){var _0x26acd2=_0x3d85cc[_0x47a5('0x41')]['get']({'plain':!![]});if(!_0x26acd2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26acd2[_0x47a5('0x42')]===_0x47a5('0x41')){var _0x1163e3=_0x44fe8a[_0x47a5('0x43')]({'plain':!![]});var _0x2c7020=_0x47a5('0x44');return db[_0x47a5('0x45')]['find']({'where':{'name':_0x2c7020,'userProfileId':_0x26acd2[_0x47a5('0x46')]},'raw':!![]})[_0x47a5('0x21')](function(_0x5f6a){if(_0x5f6a&&_0x5f6a['autoAssociation']===0x0){return db[_0x47a5('0x47')]['create']({'name':_0x1163e3[_0x47a5('0x26')],'resourceId':_0x1163e3['id'],'type':_0x47a5('0x23'),'sectionId':_0x5f6a['id']},{})[_0x47a5('0x21')](function(){return _0x44fe8a;});}else{return _0x44fe8a;}})[_0x47a5('0x48')](function(_0x588551){logger[_0x47a5('0x24')](_0x47a5('0x49'),_0x588551);throw _0x588551;});}return _0x44fe8a;})[_0x47a5('0x21')](respondWithResult(_0x52d409,0xc9))[_0x47a5('0x48')](handleError(_0x52d409,null));};exports[_0x47a5('0x4a')]=function(_0x6a53b3,_0x24e9f4){if(_0x6a53b3['body']['id']){delete _0x6a53b3[_0x47a5('0x40')]['id'];}return db[_0x47a5('0x39')][_0x47a5('0x4b')]({'where':{'id':_0x6a53b3[_0x47a5('0x4c')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x24e9f4,null))[_0x47a5('0x21')](saveUpdates(_0x6a53b3['body'],null))[_0x47a5('0x21')](respondWithResult(_0x24e9f4,null))[_0x47a5('0x48')](handleError(_0x24e9f4,null));};exports[_0x47a5('0x22')]=function(_0x53871e,_0x4c5ed){return db[_0x47a5('0x39')][_0x47a5('0x4b')]({'where':{'id':_0x53871e['params']['id']}})['then'](handleEntityNotFound(_0x4c5ed,null))[_0x47a5('0x21')](removeEntity(_0x4c5ed,null))[_0x47a5('0x48')](handleError(_0x4c5ed,null));};exports['preview']=function(_0x4cf792,_0x6d6b2b){var _0x4d6a82=0xa;var _0x16bb8a=['join','left_join',_0x47a5('0x4d'),_0x47a5('0x4e')];var _0x53eedf={'SUM':_0x47a5('0x4f'),'COUNT':_0x47a5('0x50'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':_0x47a5('0x53'),'GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x199621={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':_0x47a5('0x56'),'HOUR':'HOUR(%s)','ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x485e3c=function(_0x470da6){return!_[_0x47a5('0x58')]([_0x47a5('0x59'),_0x47a5('0x5a'),'IS\x20EMPTY',_0x47a5('0x5b')],_0x470da6);};var _0x5d1550=function(_0x5cbe97){if(!_0x5cbe97||!_0x5cbe97['rules']['length']){return'';}for(var _0x212d92='(',_0x6cd4ea=0x0;_0x6cd4ea<_0x5cbe97[_0x47a5('0x5c')]['length'];_0x6cd4ea+=0x1){_0x6cd4ea>0x0&&(_0x212d92+='\x20'+_0x5cbe97['operator']+'\x20');_0x212d92+=_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5d')]?_0x5d1550(_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5d')]):_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea]['field']+'\x20'+_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea]['condition']+(_0x485e3c(_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5e')])?'\x20'+_0x5cbe97['rules'][_0x6cd4ea][_0x47a5('0x5f')]:'');}return _0x212d92+')';};var _0x345104={'where':{'id':_0x4cf792[_0x47a5('0x4c')]['id']}},_0x132854,_0x3e8274,_0x2d6494,_0x215634,_0x35cca8;_0x345104=_['merge']({},_0x345104,_0x4cf792[_0x47a5('0x38')]);return db[_0x47a5('0x39')][_0x47a5('0x4b')](_0x345104)[_0x47a5('0x21')](function(_0x396cb0){if(_0x396cb0){_0x132854=_0x396cb0;return _0x396cb0['getFields']();}return null;})[_0x47a5('0x21')](function(_0xdfcecc){if(_0xdfcecc){if(!_0xdfcecc[_0x47a5('0x2f')]){throw new db[(_0x47a5('0x60'))][(_0x47a5('0x61'))](_0x47a5('0x62'),0x193);}_0x3e8274=_0xdfcecc;return db[_0x47a5('0x63')][_0x47a5('0x64')]({'raw':!![]});}return null;})[_0x47a5('0x21')](function(_0x44cb90){if(_0x44cb90){_0x2d6494=_[_0x47a5('0x65')](_0x44cb90,'id');var _0x44fda9;var _0x3c0006=squel[_0x47a5('0x66')]();_0x3c0006[_0x47a5('0x67')](_0x132854['table']);for(var _0x42dd7d=0x0;_0x42dd7d<_0x3e8274[_0x47a5('0x2f')];_0x42dd7d+=0x1){_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x68')]?_0x2d6494[_0x3e8274[_0x42dd7d]['MetricId']][_0x47a5('0x69')]:_0x3e8274[_0x42dd7d][_0x47a5('0x6a')];_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x6b')]?_[_0x47a5('0x6c')](_0x53eedf[_0x3e8274[_0x42dd7d]['function']],'%s',_0x44fda9):_0x44fda9;_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x6d')]?_['replace'](_0x199621[_0x3e8274[_0x42dd7d][_0x47a5('0x6d')]],'%s',_0x44fda9):_0x44fda9;if(_0x3e8274[_0x42dd7d]['groupBy']){_0x3c0006[_0x47a5('0x5d')](_0x44fda9);}_0x3e8274[_0x42dd7d]['orderBy']&&_0x3c0006[_0x47a5('0x32')](_0x44fda9,_0x3e8274[_0x42dd7d][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x3c0006['field'](_0x44fda9,_0x3e8274[_0x42dd7d]['alias']||_0x44fda9);}if(_0x132854['joins']){_0x132854[_0x47a5('0x70')]=JSON[_0x47a5('0x71')](_0x132854[_0x47a5('0x70')]);for(var _0x117510=0x0;_0x117510<_0x132854['joins'][_0x47a5('0x2f')];_0x117510+=0x1){if(_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x72')]&&_[_0x47a5('0x58')](_0x16bb8a,_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x72')])&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x73')]&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x74')]&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x75')]){_0x3c0006[_0x132854['joins'][_0x117510][_0x47a5('0x72')]](_0x132854['joins'][_0x117510][_0x47a5('0x74')],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x132854[_0x47a5('0x77')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x73')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x74')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x75')]));}}}if(_0x132854[_0x47a5('0x78')]){_0x132854[_0x47a5('0x78')]=JSON[_0x47a5('0x71')](_0x132854[_0x47a5('0x78')]);_0x3c0006[_0x47a5('0x34')](_0x5d1550(_0x132854['conditions']['group']));}_0x35cca8=_0x3c0006['clone']();_0x3c0006['limit'](_0x4d6a82);_0x3c0006[_0x47a5('0x1d')](0x0);logger[_0x47a5('0x79')]('Limited\x20Query:',_0x3c0006[_0x47a5('0x7a')]());return dbH[_0x47a5('0x7b')][_0x47a5('0x2b')](_0x3c0006[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')][_0x47a5('0x7d')]});}})[_0x47a5('0x21')](respondWithResult(_0x6d6b2b,null))[_0x47a5('0x48')](handleError(_0x6d6b2b,null));};function runReport(_0x1ffe3c,_0x24a6c1,_0x5e5f16){var _0x18fa31=_0x24a6c1[_0x47a5('0x26')];var _0x420671=0xa;var _0x4f35ff=[_0x47a5('0x7e'),_0x47a5('0x7f'),_0x47a5('0x4d'),'cross_join'];var _0x19dc8c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x47a5('0x80'),'MAX':_0x47a5('0x81'),'MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':_0x47a5('0x53'),'GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x592322={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':'DATE(%s)','HOUR':_0x47a5('0x82'),'ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':_0x47a5('0x83')};var _0xb16bdd=function(_0x53ea2b){return!_[_0x47a5('0x58')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x47a5('0x84'),_0x47a5('0x5b')],_0x53ea2b);};var _0x5b91f7=function(_0x1926bd){if(!_0x1926bd||!_0x1926bd[_0x47a5('0x5c')][_0x47a5('0x2f')]){return'';}for(var _0x4c25ec='(',_0x280372=0x0;_0x280372<_0x1926bd['rules'][_0x47a5('0x2f')];_0x280372+=0x1){_0x280372>0x0&&(_0x4c25ec+='\x20'+_0x1926bd[_0x47a5('0x85')]+'\x20');_0x4c25ec+=_0x1926bd[_0x47a5('0x5c')][_0x280372]['group']?_0x5b91f7(_0x1926bd[_0x47a5('0x5c')][_0x280372][_0x47a5('0x5d')]):_0x1926bd[_0x47a5('0x5c')][_0x280372]['field']+'\x20'+_0x1926bd[_0x47a5('0x5c')][_0x280372]['condition']+(_0xb16bdd(_0x1926bd[_0x47a5('0x5c')][_0x280372]['condition'])?'\x20'+_0x1926bd[_0x47a5('0x5c')][_0x280372][_0x47a5('0x5f')]:'');}return _0x4c25ec+')';};var _0x20a742={'where':{'id':_0x1ffe3c['id']}},_0x211fbf,_0x51738b,_0x42fcce,_0x2ae130,_0x23c393;_0x20a742=_[_0x47a5('0x37')]({},_0x20a742,_0x5e5f16);return db[_0x47a5('0x39')]['find'](_0x20a742)['then'](function(_0x569550){if(_0x569550){_0x211fbf=_0x569550;return _0x569550['getFields']();}return null;})[_0x47a5('0x21')](function(_0xa8809a){if(_0xa8809a){if(!_0xa8809a[_0x47a5('0x2f')]){throw new db['Sequelize'][(_0x47a5('0x61'))](_0x47a5('0x62'),0x193);}_0x51738b=_0xa8809a;return db['AnalyticMetric'][_0x47a5('0x64')]({'raw':!![]});}return null;})[_0x47a5('0x21')](function(_0x19acfa){if(_0x19acfa){_0x42fcce=_[_0x47a5('0x65')](_0x19acfa,'id');var _0x58dacd;var _0x4b5353=squel[_0x47a5('0x66')]();_0x4b5353[_0x47a5('0x67')](_0x211fbf['table']);for(var _0x27d422=0x0;_0x27d422<_0x51738b[_0x47a5('0x2f')];_0x27d422+=0x1){_0x58dacd=_0x51738b[_0x27d422]['MetricId']?_0x42fcce[_0x51738b[_0x27d422][_0x47a5('0x68')]][_0x47a5('0x69')]:_0x51738b[_0x27d422][_0x47a5('0x6a')];_0x58dacd=_0x51738b[_0x27d422]['function']?_[_0x47a5('0x6c')](_0x19dc8c[_0x51738b[_0x27d422]['function']],'%s',_0x58dacd):_0x58dacd;_0x58dacd=_0x51738b[_0x27d422][_0x47a5('0x6d')]?_['replace'](_0x592322[_0x51738b[_0x27d422][_0x47a5('0x6d')]],'%s',_0x58dacd):_0x58dacd;if(_0x51738b[_0x27d422][_0x47a5('0x86')]){_0x4b5353['group'](_0x58dacd);}_0x51738b[_0x27d422][_0x47a5('0x6e')]&&_0x4b5353['order'](_0x58dacd,_0x51738b[_0x27d422][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x4b5353[_0x47a5('0x6a')](_0x58dacd,_0x51738b[_0x27d422][_0x47a5('0x87')]||_0x58dacd);}if(_0x211fbf['joins']){_0x211fbf[_0x47a5('0x70')]=JSON['parse'](_0x211fbf['joins']);for(var _0x2bb2df=0x0;_0x2bb2df<_0x211fbf[_0x47a5('0x70')][_0x47a5('0x2f')];_0x2bb2df+=0x1){if(_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')]&&_['includes'](_0x4f35ff,_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')])&&_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x73')]&&_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x74')]&&_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x75')]){_0x4b5353[_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')]](_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x74')],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x211fbf[_0x47a5('0x77')],_0x211fbf[_0x47a5('0x70')][_0x2bb2df]['parentKey'],_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x74')],_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x75')]));}}}if(_0x211fbf[_0x47a5('0x78')]){_0x211fbf[_0x47a5('0x78')]=JSON['parse'](_0x211fbf['conditions']);_0x4b5353[_0x47a5('0x34')](_0x5b91f7(_0x211fbf[_0x47a5('0x78')]['group']));}_0x23c393=_0x4b5353['clone']();_0x4b5353[_0x47a5('0x1b')](_0x420671);_0x4b5353[_0x47a5('0x1d')](0x0);return;}})['then'](function(){if(_0x24a6c1[_0x47a5('0x88')]===_0x47a5('0x89')){return null;}var _0x4c9e6a=_[_0x47a5('0x37')](_0x24a6c1,{'name':_0x24a6c1[_0x47a5('0x8a')]||_0x24a6c1[_0x47a5('0x26')]||_0x211fbf[_0x47a5('0x26')],'basename':_0x18fa31,'savename':util[_0x47a5('0x6d')](_0x47a5('0x8b'),_0x24a6c1['name']||_0x211fbf['name'],require('randomstring')[_0x47a5('0x8c')](0x4),_0x24a6c1[_0x47a5('0x88')]||'csv'),'reportId':_0x211fbf['id'],'reportType':_0x47a5('0x8d')});return db[_0x47a5('0x8e')][_0x47a5('0x3f')](_0x4c9e6a,{'raw':!![]});})[_0x47a5('0x21')](function(_0xcdbfd7){if(_0x211fbf['table']===_0x47a5('0x8f')){_0x23c393['where'](_0x211fbf['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x24a6c1[_0x47a5('0x90')],_0x24a6c1['endDate']);}else{_0x23c393[_0x47a5('0x34')](_0x211fbf[_0x47a5('0x77')]+_0x47a5('0x91'),_0x24a6c1['startDate'],_0x24a6c1[_0x47a5('0x92')]);}if(_0xcdbfd7){logger[_0x47a5('0x93')](_0x47a5('0x94'),_0x23c393[_0x47a5('0x7a')]());require(_0x47a5('0x95'))['fork'](path[_0x47a5('0x7e')](__dirname,_0x47a5('0x96'),_0xcdbfd7['output']),[_0xcdbfd7['id'],_0x23c393[_0x47a5('0x7a')](),path[_0x47a5('0x7e')](__dirname,_0x47a5('0x97'),_0xcdbfd7[_0x47a5('0x98')]),_0x18fa31]);return _0xcdbfd7;}else{var _0x3c117a=squel[_0x47a5('0x66')]();_0x3c117a['from']('('+_0x23c393[_0x47a5('0x7a')]()+')',_0x47a5('0x99'));_0x3c117a['field'](_0x47a5('0x9a'),_0x47a5('0x1c'));_0x23c393[_0x47a5('0x1b')](_0x24a6c1[_0x47a5('0x1b')]||_0x420671);_0x23c393['offset'](_0x24a6c1['offset']||0x0);return dbH['sequelize']['query'](_0x3c117a[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')][_0x47a5('0x7d')]})[_0x47a5('0x21')](function(_0x6bc37b){if(!_0x6bc37b[_0x47a5('0x2f')]){_0x2ae130=0x0;}else{_0x2ae130=_0x6bc37b[0x0][_0x47a5('0x1c')]||0x0;}return dbH['sequelize'][_0x47a5('0x2b')](_0x23c393[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')]['SELECT']});})['then'](function(_0x3770ae){return{'rows':_0x3770ae||[],'count':_0x2ae130};});}});}exports['run']=function(_0x4cb8e4,_0x1b6a5c){return runReport(_0x4cb8e4[_0x47a5('0x4c')],_0x4cb8e4['query'],_0x4cb8e4[_0x47a5('0x38')])[_0x47a5('0x21')](respondWithResult(_0x1b6a5c,null))[_0x47a5('0x48')](handleError(_0x1b6a5c,null));};exports['runReport']=runReport;exports[_0x47a5('0x2b')]=function(_0xee23c7,_0x48a491){var _0x1172fd=0xa;var _0x280b7b=[_0x47a5('0x7e'),_0x47a5('0x7f'),_0x47a5('0x4d'),_0x47a5('0x4e')];var _0x482c87={'SUM':_0x47a5('0x4f'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x47a5('0x80'),'MAX':_0x47a5('0x81'),'MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':_0x47a5('0x9b')};var _0x151540={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':_0x47a5('0x56'),'HOUR':_0x47a5('0x82'),'ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':_0x47a5('0x83')};var _0x1b3e82=function(_0xa2045c){return!_[_0x47a5('0x58')]([_0x47a5('0x59'),'IS\x20NOT\x20NULL',_0x47a5('0x84'),_0x47a5('0x5b')],_0xa2045c);};var _0x591bde=function(_0x55d955){if(!_0x55d955||!_0x55d955[_0x47a5('0x5c')][_0x47a5('0x2f')]){return'';}for(var _0x2ccf21='(',_0x2ff467=0x0;_0x2ff467<_0x55d955['rules'][_0x47a5('0x2f')];_0x2ff467+=0x1){_0x2ff467>0x0&&(_0x2ccf21+='\x20'+_0x55d955[_0x47a5('0x85')]+'\x20');_0x2ccf21+=_0x55d955[_0x47a5('0x5c')][_0x2ff467][_0x47a5('0x5d')]?_0x591bde(_0x55d955[_0x47a5('0x5c')][_0x2ff467][_0x47a5('0x5d')]):_0x55d955[_0x47a5('0x5c')][_0x2ff467]['field']+'\x20'+_0x55d955['rules'][_0x2ff467][_0x47a5('0x5e')]+(_0x1b3e82(_0x55d955['rules'][_0x2ff467][_0x47a5('0x5e')])?'\x20'+_0x55d955['rules'][_0x2ff467][_0x47a5('0x5f')]:'');}return _0x2ccf21+')';};var _0x8b4354={'where':{'id':_0xee23c7[_0x47a5('0x4c')]['id']}},_0x134c1a,_0x2bc7ae,_0x49cb8c,_0x220557,_0x11f07b;_0x8b4354=_['merge']({},_0x8b4354,_0xee23c7['options']);return db[_0x47a5('0x39')][_0x47a5('0x4b')](_0x8b4354)[_0x47a5('0x21')](function(_0xfccf9c){if(_0xfccf9c){_0x134c1a=_0xfccf9c;return _0xfccf9c[_0x47a5('0x9c')]();}return null;})[_0x47a5('0x21')](function(_0x1c0323){if(_0x1c0323){if(!_0x1c0323[_0x47a5('0x2f')]){throw new db['Sequelize'][(_0x47a5('0x61'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2bc7ae=_0x1c0323;return db[_0x47a5('0x63')][_0x47a5('0x64')]({'raw':!![]});}return null;})['then'](function(_0x48d4cf){if(_0x48d4cf){_0x49cb8c=_[_0x47a5('0x65')](_0x48d4cf,'id');var _0x41d2da;var _0x530387=squel[_0x47a5('0x66')]();_0x530387[_0x47a5('0x67')](_0x134c1a[_0x47a5('0x77')]);for(var _0x44567e=0x0;_0x44567e<_0x2bc7ae['length'];_0x44567e+=0x1){_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x68')]?_0x49cb8c[_0x2bc7ae[_0x44567e]['MetricId']]['metric']:_0x2bc7ae[_0x44567e]['field'];_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x6b')]?_['replace'](_0x482c87[_0x2bc7ae[_0x44567e][_0x47a5('0x6b')]],'%s',_0x41d2da):_0x41d2da;_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x6d')]?_[_0x47a5('0x6c')](_0x151540[_0x2bc7ae[_0x44567e][_0x47a5('0x6d')]],'%s',_0x41d2da):_0x41d2da;if(_0x2bc7ae[_0x44567e][_0x47a5('0x86')]){_0x530387[_0x47a5('0x5d')](_0x41d2da);}_0x2bc7ae[_0x44567e][_0x47a5('0x6e')]&&_0x530387[_0x47a5('0x32')](_0x41d2da,_0x2bc7ae[_0x44567e][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x530387[_0x47a5('0x6a')](_0x41d2da,_0x2bc7ae[_0x44567e][_0x47a5('0x87')]||_0x41d2da);}if(_0x134c1a[_0x47a5('0x70')]){_0x134c1a[_0x47a5('0x70')]=JSON[_0x47a5('0x71')](_0x134c1a['joins']);for(var _0xdd95c8=0x0;_0xdd95c8<_0x134c1a[_0x47a5('0x70')][_0x47a5('0x2f')];_0xdd95c8+=0x1){if(_0x134c1a[_0x47a5('0x70')][_0xdd95c8]['type']&&_[_0x47a5('0x58')](_0x280b7b,_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x72')])&&_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x73')]&&_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x74')]&&_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x75')]){_0x530387[_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x72')]](_0x134c1a['joins'][_0xdd95c8]['foreignTable'],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x134c1a[_0x47a5('0x77')],_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x73')],_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x74')],_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x75')]));}}}if(_0x134c1a[_0x47a5('0x78')]){_0x134c1a[_0x47a5('0x78')]=JSON[_0x47a5('0x71')](_0x134c1a['conditions']);_0x530387['where'](_0x591bde(_0x134c1a[_0x47a5('0x78')][_0x47a5('0x5d')]));}_0x11f07b=_0x530387[_0x47a5('0x9d')]();_0x530387[_0x47a5('0x1b')](_0x1172fd);_0x530387[_0x47a5('0x1d')](0x0);logger[_0x47a5('0x79')](_0x47a5('0x9e'),_0x530387[_0x47a5('0x7a')]());return dbH[_0x47a5('0x7b')]['query'](_0x530387['toString'](),{'type':dbH[_0x47a5('0x7b')]['QueryTypes'][_0x47a5('0x7d')]});}})[_0x47a5('0x21')](function(){return{'sql':_0x11f07b[_0x47a5('0x7a')]()};})['then'](respondWithResult(_0x48a491,null))[_0x47a5('0x48')](handleError(_0x48a491,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index f290308..2734bba 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.model.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x904a=['../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','api','moment','bluebird','path'];(function(_0x540feb,_0x54cb50){var _0x25dfee=function(_0x52356b){while(--_0x52356b){_0x540feb['push'](_0x540feb['shift']());}};_0x25dfee(++_0x54cb50);}(_0x904a,0x1e6));var _0xa904=function(_0x4ca3ca,_0x2092b2){_0x4ca3ca=_0x4ca3ca-0x0;var _0x5c94ac=_0x904a[_0x4ca3ca];return _0x5c94ac;};'use strict';var _=require(_0xa904('0x0'));var util=require(_0xa904('0x1'));var logger=require('../../config/logger')(_0xa904('0x2'));var moment=require(_0xa904('0x3'));var BPromise=require(_0xa904('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa904('0x5'));var rimraf=require('rimraf');var config=require(_0xa904('0x6'));var attributes=require(_0xa904('0x7'));module[_0xa904('0x8')]=function(_0x4d9c44,_0x3dc517){return _0x4d9c44[_0xa904('0x9')](_0xa904('0xa'),attributes,{'tableName':_0xa904('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5dd2=['rimraf','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment','path'];(function(_0x1e7ed4,_0x2a6e68){var _0x563f46=function(_0xaa8c37){while(--_0xaa8c37){_0x1e7ed4['push'](_0x1e7ed4['shift']());}};_0x563f46(++_0x2a6e68);}(_0x5dd2,0x13e));var _0x25dd=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0x5dd2[_0x346737];return _0x1ade2e;};'use strict';var _=require(_0x25dd('0x0'));var util=require(_0x25dd('0x1'));var logger=require(_0x25dd('0x2'))(_0x25dd('0x3'));var moment=require(_0x25dd('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x25dd('0x5'));var rimraf=require(_0x25dd('0x6'));var config=require('../../config/environment');var attributes=require(_0x25dd('0x7'));module[_0x25dd('0x8')]=function(_0x174dd1,_0xa3f094){return _0x174dd1[_0x25dd('0x9')](_0x25dd('0xa'),attributes,{'tableName':_0x25dd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 4453af6..f540c49 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2607=['AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2607,0x13d));var _0x7260=function(_0x30c2ae,_0x4c98a2){_0x30c2ae=_0x30c2ae-0x0;var _0x1ee1cc=_0x2607[_0x30c2ae];return _0x1ee1cc;};'use strict';var _=require(_0x7260('0x0'));var util=require(_0x7260('0x1'));var moment=require(_0x7260('0x2'));var BPromise=require(_0x7260('0x3'));var rs=require(_0x7260('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7260('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7260('0x6'))(_0x7260('0x7'));var config=require(_0x7260('0x8'));var jayson=require(_0x7260('0x9'));var client=jayson[_0x7260('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x116627,_0x1927c6,_0x1135aa){return new BPromise(function(_0x502cf6,_0x5888cf){return client['request'](_0x116627,_0x1135aa)[_0x7260('0xb')](function(_0xa4338d){logger[_0x7260('0xc')](_0x7260('0xd'),_0x1927c6,_0x7260('0xe'));logger[_0x7260('0xf')](_0x7260('0x10'),_0x1927c6,_0x7260('0xe'),JSON['stringify'](_0xa4338d));if(_0xa4338d['error']){if(_0xa4338d[_0x7260('0x11')][_0x7260('0x12')]===0x1f4){logger[_0x7260('0x11')](_0x7260('0xd'),_0x1927c6,_0xa4338d['error'][_0x7260('0x13')]);return _0x5888cf(_0xa4338d[_0x7260('0x11')][_0x7260('0x13')]);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x1927c6,_0xa4338d[_0x7260('0x11')][_0x7260('0x13')]);return _0x502cf6(_0xa4338d[_0x7260('0x11')][_0x7260('0x13')]);}else{logger[_0x7260('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1927c6,_0x7260('0xe'));_0x502cf6(_0xa4338d[_0x7260('0x14')][_0x7260('0x13')]);}})[_0x7260('0x15')](function(_0x26a36b){logger[_0x7260('0x11')](_0x7260('0xd'),_0x1927c6,_0x26a36b);_0x5888cf(_0x26a36b);});});} \ No newline at end of file +var _0x2dd8=['../../config/utils','../../config/logger','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','bluebird','ioredis','../../mysqldb'];(function(_0x48fa5d,_0x86f7a4){var _0x25c1e1=function(_0x13ae3b){while(--_0x13ae3b){_0x48fa5d['push'](_0x48fa5d['shift']());}};_0x25c1e1(++_0x86f7a4);}(_0x2dd8,0x163));var _0x82dd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2dd8[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x82dd('0x0'));var util=require(_0x82dd('0x1'));var moment=require('moment');var BPromise=require(_0x82dd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x82dd('0x3'));var db=require(_0x82dd('0x4'))['db'];var utils=require(_0x82dd('0x5'));var logger=require(_0x82dd('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x82dd('0x7')][_0x82dd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xb78095,_0x53898b,_0x202399){return new BPromise(function(_0x1131ec,_0xe0f43a){return client[_0x82dd('0x9')](_0xb78095,_0x202399)[_0x82dd('0xa')](function(_0x4d514e){logger[_0x82dd('0xb')](_0x82dd('0xc'),_0x53898b,_0x82dd('0xd'));logger[_0x82dd('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x53898b,_0x82dd('0xd'),JSON[_0x82dd('0xf')](_0x4d514e));if(_0x4d514e[_0x82dd('0x10')]){if(_0x4d514e[_0x82dd('0x10')][_0x82dd('0x11')]===0x1f4){logger[_0x82dd('0x10')](_0x82dd('0xc'),_0x53898b,_0x4d514e['error'][_0x82dd('0x12')]);return _0xe0f43a(_0x4d514e[_0x82dd('0x10')][_0x82dd('0x12')]);}logger[_0x82dd('0x10')](_0x82dd('0xc'),_0x53898b,_0x4d514e[_0x82dd('0x10')][_0x82dd('0x12')]);return _0x1131ec(_0x4d514e['error']['message']);}else{logger[_0x82dd('0xb')](_0x82dd('0xc'),_0x53898b,'request\x20sent');_0x1131ec(_0x4d514e['result']['message']);}})[_0x82dd('0x13')](function(_0x1ef3ba){logger['error'](_0x82dd('0xc'),_0x53898b,_0x1ef3ba);_0xe0f43a(_0x1ef3ba);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 9c2d299..3b4f754 100644 --- a/server/api/analyticDefaultReport/index.js +++ b/server/api/analyticDefaultReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x50de=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','/:id/query','query','put','update','destroy','exports','multer','util','path','Router','fs-extra'];(function(_0x356e0c,_0x546362){var _0x93d464=function(_0x4ebeae){while(--_0x4ebeae){_0x356e0c['push'](_0x356e0c['shift']());}};_0x93d464(++_0x546362);}(_0x50de,0x12f));var _0xe50d=function(_0x2d5934,_0x1acc4f){_0x2d5934=_0x2d5934-0x0;var _0x5807c8=_0x50de[_0x2d5934];return _0x5807c8;};'use strict';var multer=require(_0xe50d('0x0'));var util=require(_0xe50d('0x1'));var path=require(_0xe50d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe50d('0x3')]();var fs_extra=require(_0xe50d('0x4'));var auth=require(_0xe50d('0x5'));var interaction=require(_0xe50d('0x6'));var config=require(_0xe50d('0x7'));var controller=require('./analyticDefaultReport.controller');router[_0xe50d('0x8')]('/',auth[_0xe50d('0x9')](),controller[_0xe50d('0xa')]);router[_0xe50d('0x8')](_0xe50d('0xb'),auth[_0xe50d('0x9')](),controller[_0xe50d('0xc')]);router[_0xe50d('0x8')](_0xe50d('0xd'),auth[_0xe50d('0x9')](),controller[_0xe50d('0xe')]);router['get'](_0xe50d('0xf'),auth[_0xe50d('0x9')](),controller['run']);router[_0xe50d('0x8')](_0xe50d('0x10'),auth[_0xe50d('0x9')](),controller[_0xe50d('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xe50d('0x12')](_0xe50d('0xb'),auth[_0xe50d('0x9')](),controller[_0xe50d('0x13')]);router['delete'](_0xe50d('0xb'),auth[_0xe50d('0x9')](),controller[_0xe50d('0x14')]);module[_0xe50d('0x15')]=router; \ No newline at end of file +var _0x07ca=['query','post','create','put','/:id','update','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','get','index','isAuthenticated','show','/:id/preview','run','/:id/query'];(function(_0x238671,_0x34aea0){var _0x474844=function(_0x26cab4){while(--_0x26cab4){_0x238671['push'](_0x238671['shift']());}};_0x474844(++_0x34aea0);}(_0x07ca,0xd7));var _0xa07c=function(_0x5a125c,_0x155fa2){_0x5a125c=_0x5a125c-0x0;var _0x4c70af=_0x07ca[_0x5a125c];return _0x4c70af;};'use strict';var multer=require('multer');var util=require(_0xa07c('0x0'));var path=require(_0xa07c('0x1'));var timeout=require(_0xa07c('0x2'));var express=require(_0xa07c('0x3'));var router=express['Router']();var fs_extra=require(_0xa07c('0x4'));var auth=require(_0xa07c('0x5'));var interaction=require(_0xa07c('0x6'));var config=require('../../config/environment');var controller=require(_0xa07c('0x7'));router[_0xa07c('0x8')]('/',auth['isAuthenticated'](),controller[_0xa07c('0x9')]);router[_0xa07c('0x8')]('/:id',auth[_0xa07c('0xa')](),controller[_0xa07c('0xb')]);router[_0xa07c('0x8')](_0xa07c('0xc'),auth[_0xa07c('0xa')](),controller['preview']);router[_0xa07c('0x8')]('/:id/run',auth[_0xa07c('0xa')](),controller[_0xa07c('0xd')]);router[_0xa07c('0x8')](_0xa07c('0xe'),auth[_0xa07c('0xa')](),controller[_0xa07c('0xf')]);router[_0xa07c('0x10')]('/',auth['isAuthenticated'](),controller[_0xa07c('0x11')]);router[_0xa07c('0x12')](_0xa07c('0x13'),auth['isAuthenticated'](),controller[_0xa07c('0x14')]);router['delete'](_0xa07c('0x13'),auth[_0xa07c('0xa')](),controller[_0xa07c('0x15')]);module[_0xa07c('0x16')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index d42ee24..92d4ed3 100644 --- a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js +++ b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0a56=['scheduled','sequelize','STRING','ENUM','csv','xlsx','DATE','Loading','manual'];(function(_0x40352,_0x15f089){var _0xa20e40=function(_0x4cef24){while(--_0x4cef24){_0x40352['push'](_0x40352['shift']());}};_0xa20e40(++_0x15f089);}(_0x0a56,0x1de));var _0x60a5=function(_0x5e50b5,_0x264ccd){_0x5e50b5=_0x5e50b5-0x0;var _0x57c7f3=_0x0a56[_0x5e50b5];return _0x57c7f3;};'use strict';var Sequelize=require(_0x60a5('0x0'));var moment=require('moment');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x60a5('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0x60a5('0x2')](_0x60a5('0x3'),'pdf',_0x60a5('0x4')),'allowNull':![],'defaultValue':_0x60a5('0x3')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x60a5('0x5')]},'endDate':{'type':Sequelize[_0x60a5('0x5')]},'status':{'type':Sequelize[_0x60a5('0x1')],'defaultValue':_0x60a5('0x6')},'type':{'type':Sequelize[_0x60a5('0x2')](_0x60a5('0x7'),_0x60a5('0x8')),'allowNull':![],'defaultValue':_0x60a5('0x7')},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x40a1=['sequelize','moment','exports','STRING','ENUM','csv','DATE','Loading','manual','INTEGER'];(function(_0x1f0e0a,_0x4c2b9a){var _0xe9c80b=function(_0x432e6f){while(--_0x432e6f){_0x1f0e0a['push'](_0x1f0e0a['shift']());}};_0xe9c80b(++_0x4c2b9a);}(_0x40a1,0x10e));var _0x140a=function(_0x49b981,_0x46dea1){_0x49b981=_0x49b981-0x0;var _0x211893=_0x40a1[_0x49b981];return _0x211893;};'use strict';var Sequelize=require(_0x140a('0x0'));var moment=require(_0x140a('0x1'));module[_0x140a('0x2')]={'name':{'type':Sequelize[_0x140a('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x140a('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x140a('0x4')](_0x140a('0x5'),'pdf','xlsx'),'allowNull':![],'defaultValue':_0x140a('0x5')},'savename':{'type':Sequelize[_0x140a('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x140a('0x6')]},'endDate':{'type':Sequelize[_0x140a('0x6')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x140a('0x7')},'type':{'type':Sequelize[_0x140a('0x4')](_0x140a('0x8'),'scheduled'),'allowNull':![],'defaultValue':_0x140a('0x8')},'reportId':{'type':Sequelize[_0x140a('0x9')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x140a('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 6e01360..54d26fe 100644 --- a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js +++ b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x440c=['root','%s.%s','eml-format','rimraf','zip-dir','request-promise','moment','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','update','destroy','get','ExtractedReports','UserProfileResource','then','error','name','send','map','AnalyticExtractedReport','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','include','rows','catch','show','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','basename','savename','output','existsSync','join','server/files/reports'];(function(_0x221379,_0x18c5a4){var _0x56cb6c=function(_0x2ee9b5){while(--_0x2ee9b5){_0x221379['push'](_0x221379['shift']());}};_0x56cb6c(++_0x18c5a4);}(_0x440c,0x15e));var _0xc440=function(_0x24296c,_0x1bcdef){_0x24296c=_0x24296c-0x0;var _0x22f7da=_0x440c[_0x24296c];return _0x22f7da;};'use strict';var emlformat=require(_0xc440('0x0'));var rimraf=require(_0xc440('0x1'));var zipdir=require(_0xc440('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc440('0x3'));var moment=require(_0xc440('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc440('0x5'));var path=require(_0xc440('0x6'));var sox=require('sox');var csv=require(_0xc440('0x7'));var ejs=require(_0xc440('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc440('0x9'));var squel=require(_0xc440('0xa'));var crypto=require('crypto');var jsforce=require(_0xc440('0xb'));var deskjs=require(_0xc440('0xc'));var toCsv=require(_0xc440('0x7'));var querystring=require(_0xc440('0xd'));var Papa=require(_0xc440('0xe'));var Redis=require(_0xc440('0xf'));var authService=require(_0xc440('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xc440('0x11'));var hardwareService=require(_0xc440('0x12'));var logger=require(_0xc440('0x13'))('api');var utils=require(_0xc440('0x14'));var config=require(_0xc440('0x15'));var licenseUtil=require(_0xc440('0x16'));var db=require(_0xc440('0x17'))['db'];function respondWithStatusCode(_0x33e656,_0x2d8bca){_0x2d8bca=_0x2d8bca||0xcc;return function(_0x26a868){if(_0x26a868){return _0x33e656[_0xc440('0x18')](_0x2d8bca);}return _0x33e656['status'](_0x2d8bca)[_0xc440('0x19')]();};}function respondWithResult(_0x114f08,_0x4c14f1){_0x4c14f1=_0x4c14f1||0xc8;return function(_0x5da834){if(_0x5da834){return _0x114f08[_0xc440('0x1a')](_0x4c14f1)['json'](_0x5da834);}};}function respondWithFilteredResult(_0x5236eb,_0x37baaf){return function(_0x51a8a5){if(_0x51a8a5){var _0x159db1=typeof _0x37baaf[_0xc440('0x1b')]===_0xc440('0x1c')&&typeof _0x37baaf[_0xc440('0x1d')]===_0xc440('0x1c');var _0x2b5700=_0x51a8a5['count'];var _0x179c8a=_0x159db1?0x0:_0x37baaf[_0xc440('0x1b')];var _0x5c3f80=_0x159db1?_0x51a8a5[_0xc440('0x1e')]:_0x37baaf[_0xc440('0x1b')]+_0x37baaf[_0xc440('0x1d')];var _0x84bda0;if(_0x5c3f80>=_0x2b5700){_0x5c3f80=_0x2b5700;_0x84bda0=0xc8;}else{_0x84bda0=0xce;}_0x5236eb[_0xc440('0x1a')](_0x84bda0);return _0x5236eb[_0xc440('0x1f')](_0xc440('0x20'),_0x179c8a+'-'+_0x5c3f80+'/'+_0x2b5700)[_0xc440('0x21')](_0x51a8a5);}return null;};}function patchUpdates(_0xb1b9ee){return function(_0x2f1267){try{jsonpatch['apply'](_0x2f1267,_0xb1b9ee,!![]);}catch(_0x157727){return BPromise['reject'](_0x157727);}return _0x2f1267['save']();};}function saveUpdates(_0x31e025,_0x868afc){return function(_0x256a0d){if(_0x256a0d){return _0x256a0d[_0xc440('0x22')](_0x31e025)['then'](function(_0x2b4f3b){return _0x2b4f3b;});}return null;};}function removeEntity(_0x26d2a9,_0x1aa227){return function(_0x702eb){if(_0x702eb){return _0x702eb[_0xc440('0x23')]()['then'](function(){var _0x52a6d5=_0x702eb[_0xc440('0x24')]({'plain':!![]});var _0x2464c9=_0xc440('0x25');return db[_0xc440('0x26')][_0xc440('0x23')]({'where':{'type':_0x2464c9,'resourceId':_0x52a6d5['id']}})['then'](function(){return _0x702eb;});})[_0xc440('0x27')](function(){_0x26d2a9['status'](0xcc)[_0xc440('0x19')]();});}};}function handleEntityNotFound(_0x3848aa,_0x172c1c){return function(_0x3521ae){if(!_0x3521ae){_0x3848aa['sendStatus'](0x194);}return _0x3521ae;};}function handleError(_0x5410b9,_0x12b0f8){_0x12b0f8=_0x12b0f8||0x1f4;return function(_0x47a0ae){logger[_0xc440('0x28')](_0x47a0ae['stack']);if(_0x47a0ae['name']){delete _0x47a0ae[_0xc440('0x29')];}_0x5410b9[_0xc440('0x1a')](_0x12b0f8)[_0xc440('0x2a')](_0x47a0ae);};}exports['index']=function(_0x43273b,_0x2245f3){var _0x505e5c={},_0x1369eb={},_0x1d9cb9={'count':0x0,'rows':[]};var _0x514099=_[_0xc440('0x2b')](db[_0xc440('0x2c')]['rawAttributes'],function(_0x570524){return{'name':_0x570524[_0xc440('0x2d')],'type':_0x570524[_0xc440('0x2e')][_0xc440('0x2f')]};});_0x1369eb['model']=_['map'](_0x514099,_0xc440('0x29'));_0x1369eb[_0xc440('0x30')]=_[_0xc440('0x31')](_0x43273b[_0xc440('0x30')]);_0x1369eb[_0xc440('0x32')]=_[_0xc440('0x33')](_0x1369eb[_0xc440('0x34')],_0x1369eb[_0xc440('0x30')]);_0x505e5c[_0xc440('0x35')]=_[_0xc440('0x33')](_0x1369eb[_0xc440('0x34')],qs['fields'](_0x43273b[_0xc440('0x30')][_0xc440('0x36')]));_0x505e5c[_0xc440('0x35')]=_0x505e5c[_0xc440('0x35')][_0xc440('0x37')]?_0x505e5c['attributes']:_0x1369eb[_0xc440('0x34')];if(!_0x43273b[_0xc440('0x30')][_0xc440('0x38')](_0xc440('0x39'))){_0x505e5c[_0xc440('0x1d')]=qs[_0xc440('0x1d')](_0x43273b[_0xc440('0x30')][_0xc440('0x1d')]);_0x505e5c[_0xc440('0x1b')]=qs['offset'](_0x43273b[_0xc440('0x30')][_0xc440('0x1b')]);}_0x505e5c[_0xc440('0x3a')]=qs['sort'](_0x43273b['query'][_0xc440('0x3b')]);_0x505e5c[_0xc440('0x3c')]=qs[_0xc440('0x32')](_[_0xc440('0x3d')](_0x43273b[_0xc440('0x30')],_0x1369eb[_0xc440('0x32')]),_0x514099);if(_0x43273b[_0xc440('0x30')]['filter']){_0x505e5c[_0xc440('0x3c')]=_[_0xc440('0x3e')](_0x505e5c[_0xc440('0x3c')],{'$or':_['map'](_0x514099,function(_0x2dcddc){if(_0x2dcddc[_0xc440('0x2e')]!=='VIRTUAL'){var _0x340370={};_0x340370[_0x2dcddc[_0xc440('0x29')]]={'$like':'%'+_0x43273b[_0xc440('0x30')][_0xc440('0x3f')]+'%'};return _0x340370;}})});}_0x505e5c=_[_0xc440('0x3e')]({},_0x505e5c,_0x43273b[_0xc440('0x40')]);var _0x38bcc5={'where':_0x505e5c[_0xc440('0x3c')]};return db[_0xc440('0x2c')][_0xc440('0x1e')](_0x38bcc5)['then'](function(_0x4e4013){_0x1d9cb9['count']=_0x4e4013;if(_0x43273b['query']['includeAll']){_0x505e5c[_0xc440('0x41')]=[{'all':!![]}];}return db[_0xc440('0x2c')]['findAll'](_0x505e5c);})[_0xc440('0x27')](function(_0x2cb59d){_0x1d9cb9[_0xc440('0x42')]=_0x2cb59d;return _0x1d9cb9;})[_0xc440('0x27')](respondWithFilteredResult(_0x2245f3,_0x505e5c))[_0xc440('0x43')](handleError(_0x2245f3,null));};exports[_0xc440('0x44')]=function(_0x4f394f,_0x4f7068){var _0x3d2803={'raw':!![],'where':{'id':_0x4f394f['params']['id']}},_0x2c6b2a={};_0x2c6b2a[_0xc440('0x34')]=_['keys'](db[_0xc440('0x2c')]['rawAttributes']);_0x2c6b2a[_0xc440('0x30')]=_[_0xc440('0x31')](_0x4f394f['query']);_0x2c6b2a[_0xc440('0x32')]=_[_0xc440('0x33')](_0x2c6b2a['model'],_0x2c6b2a[_0xc440('0x30')]);_0x3d2803['attributes']=_['intersection'](_0x2c6b2a[_0xc440('0x34')],qs[_0xc440('0x36')](_0x4f394f[_0xc440('0x30')][_0xc440('0x36')]));_0x3d2803[_0xc440('0x35')]=_0x3d2803[_0xc440('0x35')][_0xc440('0x37')]?_0x3d2803[_0xc440('0x35')]:_0x2c6b2a['model'];if(_0x4f394f['query']['includeAll']){_0x3d2803[_0xc440('0x41')]=[{'all':!![]}];}_0x3d2803=_[_0xc440('0x3e')]({},_0x3d2803,_0x4f394f[_0xc440('0x40')]);return db['AnalyticExtractedReport'][_0xc440('0x45')](_0x3d2803)[_0xc440('0x27')](handleEntityNotFound(_0x4f7068,null))['then'](respondWithResult(_0x4f7068,null))['catch'](handleError(_0x4f7068,null));};exports['create']=function(_0x229a19,_0x4b0e74){return db[_0xc440('0x2c')][_0xc440('0x46')](_0x229a19[_0xc440('0x47')],{})['then'](function(_0x3560f3){var _0x12a69c=_0x229a19[_0xc440('0x48')][_0xc440('0x24')]({'plain':!![]});if(!_0x12a69c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x12a69c[_0xc440('0x49')]===_0xc440('0x48')){var _0x346ac2=_0x3560f3[_0xc440('0x24')]({'plain':!![]});var _0x24b6bd='ExtractedReports';return db['UserProfileSection']['find']({'where':{'name':_0x24b6bd,'userProfileId':_0x12a69c[_0xc440('0x4a')]},'raw':!![]})[_0xc440('0x27')](function(_0x3048df){if(_0x3048df&&_0x3048df[_0xc440('0x4b')]===0x0){return db['UserProfileResource'][_0xc440('0x46')]({'name':_0x346ac2[_0xc440('0x29')],'resourceId':_0x346ac2['id'],'type':_0x3048df['name'],'sectionId':_0x3048df['id']},{})[_0xc440('0x27')](function(){return _0x3560f3;});}else{return _0x3560f3;}})[_0xc440('0x43')](function(_0x45c6b0){logger[_0xc440('0x28')](_0xc440('0x4c'),_0x45c6b0);throw _0x45c6b0;});}return _0x3560f3;})['then'](respondWithResult(_0x4b0e74,0xc9))[_0xc440('0x43')](handleError(_0x4b0e74,null));};exports[_0xc440('0x22')]=function(_0x380e7e,_0x2c4999){if(_0x380e7e[_0xc440('0x47')]['id']){delete _0x380e7e['body']['id'];}return db['AnalyticExtractedReport'][_0xc440('0x45')]({'where':{'id':_0x380e7e[_0xc440('0x4d')]['id']}})[_0xc440('0x27')](handleEntityNotFound(_0x2c4999,null))[_0xc440('0x27')](saveUpdates(_0x380e7e['body'],null))[_0xc440('0x27')](respondWithResult(_0x2c4999,null))[_0xc440('0x43')](handleError(_0x2c4999,null));};exports[_0xc440('0x23')]=function(_0x2b231f,_0xb2fc0f){return db[_0xc440('0x2c')][_0xc440('0x45')]({'where':{'id':_0x2b231f[_0xc440('0x4d')]['id']}})[_0xc440('0x27')](handleEntityNotFound(_0xb2fc0f,null))['then'](removeEntity(_0xb2fc0f,null))[_0xc440('0x43')](handleError(_0xb2fc0f,null));};exports[_0xc440('0x4e')]=function(_0x12b610,_0x2c0593,_0xabcdb9){return db[_0xc440('0x2c')][_0xc440('0x45')]({'where':{'id':_0x12b610[_0xc440('0x4d')]['id']},'attributes':[_0xc440('0x29'),_0xc440('0x4f'),_0xc440('0x50'),_0xc440('0x51')],'raw':!![]})[_0xc440('0x27')](handleEntityNotFound(_0x2c0593,null))[_0xc440('0x27')](function(_0x537c69){if(_0x537c69){if(!fs[_0xc440('0x52')](path[_0xc440('0x53')](config['root'],_0xc440('0x54'),_0x537c69['savename']))){throw new db['Sequelize']['ValidationError']('Report\x20not\x20found\x20or\x20empty');}if(_0x12b610[_0xc440('0x30')]['exists']){return _0x2c0593['sendStatus'](0xc8);}return _0x2c0593[_0xc440('0x4e')](path[_0xc440('0x53')](config[_0xc440('0x55')],'server/files/reports',_0x537c69[_0xc440('0x50')]),util['format'](_0xc440('0x56'),_0x537c69[_0xc440('0x4f')]||_0x537c69[_0xc440('0x29')],_0x537c69[_0xc440('0x51')]['toLowerCase']()));}})['catch'](handleError(_0x2c0593,null));}; \ No newline at end of file +var _0xc6d8=['UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','existsSync','join','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','basename','output','toLowerCase','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','destroy','then','get','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','length','AnalyticExtractedReport','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ExtractedReports'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xc6d8,0x144));var _0x8c6d=function(_0x54bb5e,_0xc9513a){_0x54bb5e=_0x54bb5e-0x0;var _0x2cfe75=_0xc6d8[_0x54bb5e];return _0x2cfe75;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8c6d('0x0'));var jsonpatch=require(_0x8c6d('0x1'));var rp=require('request-promise');var moment=require(_0x8c6d('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x8c6d('0x3'));var util=require(_0x8c6d('0x4'));var path=require(_0x8c6d('0x5'));var sox=require(_0x8c6d('0x6'));var csv=require(_0x8c6d('0x7'));var ejs=require(_0x8c6d('0x8'));var fs=require('fs');var fs_extra=require(_0x8c6d('0x9'));var _=require(_0x8c6d('0xa'));var squel=require(_0x8c6d('0xb'));var crypto=require(_0x8c6d('0xc'));var jsforce=require(_0x8c6d('0xd'));var deskjs=require(_0x8c6d('0xe'));var toCsv=require(_0x8c6d('0x7'));var querystring=require(_0x8c6d('0xf'));var Papa=require(_0x8c6d('0x10'));var Redis=require('ioredis');var authService=require(_0x8c6d('0x11'));var qs=require(_0x8c6d('0x12'));var as=require(_0x8c6d('0x13'));var hardwareService=require(_0x8c6d('0x14'));var logger=require(_0x8c6d('0x15'))(_0x8c6d('0x16'));var utils=require(_0x8c6d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8c6d('0x18'));var db=require(_0x8c6d('0x19'))['db'];function respondWithStatusCode(_0xf3555b,_0x3a37e8){_0x3a37e8=_0x3a37e8||0xcc;return function(_0x2168f4){if(_0x2168f4){return _0xf3555b[_0x8c6d('0x1a')](_0x3a37e8);}return _0xf3555b[_0x8c6d('0x1b')](_0x3a37e8)[_0x8c6d('0x1c')]();};}function respondWithResult(_0x6316f3,_0x22bbb2){_0x22bbb2=_0x22bbb2||0xc8;return function(_0x26fbb0){if(_0x26fbb0){return _0x6316f3[_0x8c6d('0x1b')](_0x22bbb2)[_0x8c6d('0x1d')](_0x26fbb0);}};}function respondWithFilteredResult(_0x4c6006,_0x5ad638){return function(_0x527f90){if(_0x527f90){var _0x233a9a=typeof _0x5ad638[_0x8c6d('0x1e')]===_0x8c6d('0x1f')&&typeof _0x5ad638[_0x8c6d('0x20')]===_0x8c6d('0x1f');var _0x5ccabc=_0x527f90[_0x8c6d('0x21')];var _0x1cf92f=_0x233a9a?0x0:_0x5ad638['offset'];var _0x35f921=_0x233a9a?_0x527f90[_0x8c6d('0x21')]:_0x5ad638[_0x8c6d('0x1e')]+_0x5ad638[_0x8c6d('0x20')];var _0x1f89a4;if(_0x35f921>=_0x5ccabc){_0x35f921=_0x5ccabc;_0x1f89a4=0xc8;}else{_0x1f89a4=0xce;}_0x4c6006['status'](_0x1f89a4);return _0x4c6006['set']('Content-Range',_0x1cf92f+'-'+_0x35f921+'/'+_0x5ccabc)[_0x8c6d('0x1d')](_0x527f90);}return null;};}function patchUpdates(_0x4ffbae){return function(_0x1b80cd){try{jsonpatch[_0x8c6d('0x22')](_0x1b80cd,_0x4ffbae,!![]);}catch(_0x186623){return BPromise[_0x8c6d('0x23')](_0x186623);}return _0x1b80cd[_0x8c6d('0x24')]();};}function saveUpdates(_0x50af7a,_0x5d6b4a){return function(_0x126060){if(_0x126060){return _0x126060[_0x8c6d('0x25')](_0x50af7a)['then'](function(_0x54ceb6){return _0x54ceb6;});}return null;};}function removeEntity(_0x3a2ff8,_0x426f21){return function(_0x4ec873){if(_0x4ec873){return _0x4ec873[_0x8c6d('0x26')]()[_0x8c6d('0x27')](function(){var _0x11b4e2=_0x4ec873[_0x8c6d('0x28')]({'plain':!![]});var _0xf2799c='ExtractedReports';return db[_0x8c6d('0x29')][_0x8c6d('0x26')]({'where':{'type':_0xf2799c,'resourceId':_0x11b4e2['id']}})[_0x8c6d('0x27')](function(){return _0x4ec873;});})[_0x8c6d('0x27')](function(){_0x3a2ff8[_0x8c6d('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9e9f1f,_0x1f1319){return function(_0x52bb86){if(!_0x52bb86){_0x9e9f1f['sendStatus'](0x194);}return _0x52bb86;};}function handleError(_0x1df2d9,_0x4ab7fa){_0x4ab7fa=_0x4ab7fa||0x1f4;return function(_0x3f70e0){logger[_0x8c6d('0x2a')](_0x3f70e0[_0x8c6d('0x2b')]);if(_0x3f70e0[_0x8c6d('0x2c')]){delete _0x3f70e0[_0x8c6d('0x2c')];}_0x1df2d9[_0x8c6d('0x1b')](_0x4ab7fa)[_0x8c6d('0x2d')](_0x3f70e0);};}exports[_0x8c6d('0x2e')]=function(_0x181b5c,_0x459860){var _0x896728={},_0x4b894e={},_0x257c12={'count':0x0,'rows':[]};var _0x33ef71=_[_0x8c6d('0x2f')](db['AnalyticExtractedReport'][_0x8c6d('0x30')],function(_0x2c6959){return{'name':_0x2c6959[_0x8c6d('0x31')],'type':_0x2c6959[_0x8c6d('0x32')][_0x8c6d('0x33')]};});_0x4b894e[_0x8c6d('0x34')]=_['map'](_0x33ef71,_0x8c6d('0x2c'));_0x4b894e['query']=_['keys'](_0x181b5c[_0x8c6d('0x35')]);_0x4b894e['filters']=_[_0x8c6d('0x36')](_0x4b894e[_0x8c6d('0x34')],_0x4b894e[_0x8c6d('0x35')]);_0x896728[_0x8c6d('0x37')]=_[_0x8c6d('0x36')](_0x4b894e[_0x8c6d('0x34')],qs[_0x8c6d('0x38')](_0x181b5c[_0x8c6d('0x35')]['fields']));_0x896728[_0x8c6d('0x37')]=_0x896728['attributes']['length']?_0x896728[_0x8c6d('0x37')]:_0x4b894e[_0x8c6d('0x34')];if(!_0x181b5c[_0x8c6d('0x35')][_0x8c6d('0x39')](_0x8c6d('0x3a'))){_0x896728[_0x8c6d('0x20')]=qs[_0x8c6d('0x20')](_0x181b5c[_0x8c6d('0x35')][_0x8c6d('0x20')]);_0x896728[_0x8c6d('0x1e')]=qs['offset'](_0x181b5c[_0x8c6d('0x35')][_0x8c6d('0x1e')]);}_0x896728[_0x8c6d('0x3b')]=qs[_0x8c6d('0x3c')](_0x181b5c['query'][_0x8c6d('0x3c')]);_0x896728[_0x8c6d('0x3d')]=qs[_0x8c6d('0x3e')](_[_0x8c6d('0x3f')](_0x181b5c[_0x8c6d('0x35')],_0x4b894e[_0x8c6d('0x3e')]),_0x33ef71);if(_0x181b5c['query'][_0x8c6d('0x40')]){_0x896728[_0x8c6d('0x3d')]=_[_0x8c6d('0x41')](_0x896728[_0x8c6d('0x3d')],{'$or':_[_0x8c6d('0x2f')](_0x33ef71,function(_0x46eff2){if(_0x46eff2[_0x8c6d('0x32')]!==_0x8c6d('0x42')){var _0x49002c={};_0x49002c[_0x46eff2[_0x8c6d('0x2c')]]={'$like':'%'+_0x181b5c[_0x8c6d('0x35')][_0x8c6d('0x40')]+'%'};return _0x49002c;}})});}_0x896728=_[_0x8c6d('0x41')]({},_0x896728,_0x181b5c[_0x8c6d('0x43')]);var _0x713486={'where':_0x896728[_0x8c6d('0x3d')]};return db['AnalyticExtractedReport'][_0x8c6d('0x21')](_0x713486)[_0x8c6d('0x27')](function(_0x42f024){_0x257c12[_0x8c6d('0x21')]=_0x42f024;if(_0x181b5c['query'][_0x8c6d('0x44')]){_0x896728[_0x8c6d('0x45')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x8c6d('0x46')](_0x896728);})[_0x8c6d('0x27')](function(_0x26b707){_0x257c12['rows']=_0x26b707;return _0x257c12;})[_0x8c6d('0x27')](respondWithFilteredResult(_0x459860,_0x896728))[_0x8c6d('0x47')](handleError(_0x459860,null));};exports[_0x8c6d('0x48')]=function(_0x59585f,_0x3e0910){var _0x5a648b={'raw':!![],'where':{'id':_0x59585f[_0x8c6d('0x49')]['id']}},_0xa905d4={};_0xa905d4[_0x8c6d('0x34')]=_[_0x8c6d('0x4a')](db['AnalyticExtractedReport'][_0x8c6d('0x30')]);_0xa905d4['query']=_['keys'](_0x59585f[_0x8c6d('0x35')]);_0xa905d4[_0x8c6d('0x3e')]=_[_0x8c6d('0x36')](_0xa905d4['model'],_0xa905d4[_0x8c6d('0x35')]);_0x5a648b[_0x8c6d('0x37')]=_['intersection'](_0xa905d4[_0x8c6d('0x34')],qs['fields'](_0x59585f[_0x8c6d('0x35')][_0x8c6d('0x38')]));_0x5a648b[_0x8c6d('0x37')]=_0x5a648b[_0x8c6d('0x37')][_0x8c6d('0x4b')]?_0x5a648b[_0x8c6d('0x37')]:_0xa905d4[_0x8c6d('0x34')];if(_0x59585f['query']['includeAll']){_0x5a648b['include']=[{'all':!![]}];}_0x5a648b=_[_0x8c6d('0x41')]({},_0x5a648b,_0x59585f[_0x8c6d('0x43')]);return db[_0x8c6d('0x4c')][_0x8c6d('0x4d')](_0x5a648b)[_0x8c6d('0x27')](handleEntityNotFound(_0x3e0910,null))[_0x8c6d('0x27')](respondWithResult(_0x3e0910,null))[_0x8c6d('0x47')](handleError(_0x3e0910,null));};exports[_0x8c6d('0x4e')]=function(_0x17b91a,_0x56d8c4){return db[_0x8c6d('0x4c')]['create'](_0x17b91a[_0x8c6d('0x4f')],{})[_0x8c6d('0x27')](function(_0x30d16d){var _0x1352a1=_0x17b91a['user'][_0x8c6d('0x28')]({'plain':!![]});if(!_0x1352a1)throw new Error(_0x8c6d('0x50'));if(_0x1352a1[_0x8c6d('0x51')]===_0x8c6d('0x52')){var _0x23233d=_0x30d16d['get']({'plain':!![]});var _0x306976=_0x8c6d('0x53');return db[_0x8c6d('0x54')][_0x8c6d('0x4d')]({'where':{'name':_0x306976,'userProfileId':_0x1352a1[_0x8c6d('0x55')]},'raw':!![]})[_0x8c6d('0x27')](function(_0x57cc4e){if(_0x57cc4e&&_0x57cc4e[_0x8c6d('0x56')]===0x0){return db[_0x8c6d('0x29')][_0x8c6d('0x4e')]({'name':_0x23233d[_0x8c6d('0x2c')],'resourceId':_0x23233d['id'],'type':_0x57cc4e['name'],'sectionId':_0x57cc4e['id']},{})[_0x8c6d('0x27')](function(){return _0x30d16d;});}else{return _0x30d16d;}})['catch'](function(_0x2b5679){logger[_0x8c6d('0x2a')](_0x8c6d('0x57'),_0x2b5679);throw _0x2b5679;});}return _0x30d16d;})[_0x8c6d('0x27')](respondWithResult(_0x56d8c4,0xc9))[_0x8c6d('0x47')](handleError(_0x56d8c4,null));};exports[_0x8c6d('0x25')]=function(_0x246dd1,_0x5efa7e){if(_0x246dd1['body']['id']){delete _0x246dd1[_0x8c6d('0x4f')]['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x246dd1[_0x8c6d('0x49')]['id']}})['then'](handleEntityNotFound(_0x5efa7e,null))[_0x8c6d('0x27')](saveUpdates(_0x246dd1['body'],null))['then'](respondWithResult(_0x5efa7e,null))[_0x8c6d('0x47')](handleError(_0x5efa7e,null));};exports[_0x8c6d('0x26')]=function(_0x3a8c9b,_0x45b39f){return db[_0x8c6d('0x4c')]['find']({'where':{'id':_0x3a8c9b[_0x8c6d('0x49')]['id']}})[_0x8c6d('0x27')](handleEntityNotFound(_0x45b39f,null))['then'](removeEntity(_0x45b39f,null))['catch'](handleError(_0x45b39f,null));};exports[_0x8c6d('0x58')]=function(_0x1278f2,_0x280f3d,_0x3532b4){return db[_0x8c6d('0x4c')]['find']({'where':{'id':_0x1278f2[_0x8c6d('0x49')]['id']},'attributes':[_0x8c6d('0x2c'),'basename','savename','output'],'raw':!![]})[_0x8c6d('0x27')](handleEntityNotFound(_0x280f3d,null))[_0x8c6d('0x27')](function(_0x535cd2){if(_0x535cd2){if(!fs[_0x8c6d('0x59')](path[_0x8c6d('0x5a')](config['root'],_0x8c6d('0x5b'),_0x535cd2[_0x8c6d('0x5c')]))){throw new db[(_0x8c6d('0x5d'))][(_0x8c6d('0x5e'))](_0x8c6d('0x5f'));}if(_0x1278f2['query'][_0x8c6d('0x60')]){return _0x280f3d[_0x8c6d('0x1a')](0xc8);}return _0x280f3d[_0x8c6d('0x58')](path[_0x8c6d('0x5a')](config['root'],_0x8c6d('0x5b'),_0x535cd2['savename']),util[_0x8c6d('0x61')](_0x8c6d('0x62'),_0x535cd2[_0x8c6d('0x63')]||_0x535cd2[_0x8c6d('0x2c')],_0x535cd2[_0x8c6d('0x64')][_0x8c6d('0x65')]()));}})[_0x8c6d('0x47')](handleError(_0x280f3d,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 6529405..5fdc007 100644 --- a/server/api/analyticExtractedReport/analyticExtractedReport.model.js +++ b/server/api/analyticExtractedReport/analyticExtractedReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x736b=['api','bluebird','request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger'];(function(_0x3bb859,_0x589816){var _0x3bf534=function(_0xa586c){while(--_0xa586c){_0x3bb859['push'](_0x3bb859['shift']());}};_0x3bf534(++_0x589816);}(_0x736b,0x77));var _0xb736=function(_0x3c7968,_0x969c7){_0x3c7968=_0x3c7968-0x0;var _0x45cceb=_0x736b[_0x3c7968];return _0x45cceb;};'use strict';var _=require('lodash');var util=require(_0xb736('0x0'));var logger=require(_0xb736('0x1'))(_0xb736('0x2'));var moment=require('moment');var BPromise=require(_0xb736('0x3'));var rp=require(_0xb736('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb736('0x5'));var config=require(_0xb736('0x6'));var attributes=require(_0xb736('0x7'));module['exports']=function(_0x6d4e03,_0x104602){return _0x6d4e03[_0xb736('0x8')](_0xb736('0x9'),attributes,{'tableName':_0xb736('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeda8=['../../config/logger','api','moment','bluebird','path','../../config/environment','./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports','lodash','util'];(function(_0x9db5d3,_0x4eea5e){var _0x477a81=function(_0x28e774){while(--_0x28e774){_0x9db5d3['push'](_0x9db5d3['shift']());}};_0x477a81(++_0x4eea5e);}(_0xeda8,0xee));var _0x8eda=function(_0x510690,_0x2b1772){_0x510690=_0x510690-0x0;var _0x3a431e=_0xeda8[_0x510690];return _0x3a431e;};'use strict';var _=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var logger=require(_0x8eda('0x2'))(_0x8eda('0x3'));var moment=require(_0x8eda('0x4'));var BPromise=require(_0x8eda('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8eda('0x6'));var rimraf=require('rimraf');var config=require(_0x8eda('0x7'));var attributes=require(_0x8eda('0x8'));module[_0x8eda('0x9')]=function(_0x2e16cc,_0x48df73){return _0x2e16cc[_0x8eda('0xa')]('AnalyticExtractedReport',attributes,{'tableName':_0x8eda('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index 6f5615f..2521487 100644 --- a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js +++ b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xafba=['catch','lodash','util','moment','bluebird','../../mysqldb','rpc','../../config/environment','client','then','request\x20sent','stringify','error','AnalyticExtractedReport,\x20%s,\x20%s','message','result'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xafba,0x91));var _0xaafb=function(_0xa405e1,_0x395137){_0xa405e1=_0xa405e1-0x0;var _0x2e28a1=_0xafba[_0xa405e1];return _0x2e28a1;};'use strict';var _=require(_0xaafb('0x0'));var util=require(_0xaafb('0x1'));var moment=require(_0xaafb('0x2'));var BPromise=require(_0xaafb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaafb('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xaafb('0x5'));var config=require(_0xaafb('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xaafb('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f106a,_0x53455d,_0x507cb3){return new BPromise(function(_0x2db8c4,_0x343de8){return client['request'](_0x4f106a,_0x507cb3)[_0xaafb('0x8')](function(_0x8150bf){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x53455d,'request\x20sent');logger['debug']('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x53455d,_0xaafb('0x9'),JSON[_0xaafb('0xa')](_0x8150bf));if(_0x8150bf['error']){if(_0x8150bf[_0xaafb('0xb')]['code']===0x1f4){logger[_0xaafb('0xb')](_0xaafb('0xc'),_0x53455d,_0x8150bf['error'][_0xaafb('0xd')]);return _0x343de8(_0x8150bf[_0xaafb('0xb')]['message']);}logger[_0xaafb('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x53455d,_0x8150bf['error'][_0xaafb('0xd')]);return _0x2db8c4(_0x8150bf['error'][_0xaafb('0xd')]);}else{logger['info'](_0xaafb('0xc'),_0x53455d,_0xaafb('0x9'));_0x2db8c4(_0x8150bf[_0xaafb('0xe')][_0xaafb('0xd')]);}})[_0xaafb('0xf')](function(_0x164ec4){logger[_0xaafb('0xb')](_0xaafb('0xc'),_0x53455d,_0x164ec4);_0x343de8(_0x164ec4);});});} \ No newline at end of file +var _0x058b=['debug','stringify','error','message','info','result','catch','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent'];(function(_0x41eccf,_0x6ab0ad){var _0x3bb165=function(_0x217cc7){while(--_0x217cc7){_0x41eccf['push'](_0x41eccf['shift']());}};_0x3bb165(++_0x6ab0ad);}(_0x058b,0x15b));var _0xb058=function(_0x1895b7,_0x21fbc7){_0x1895b7=_0x1895b7-0x0;var _0x1aecdc=_0x058b[_0x1895b7];return _0x1aecdc;};'use strict';var _=require('lodash');var util=require(_0xb058('0x0'));var moment=require(_0xb058('0x1'));var BPromise=require(_0xb058('0x2'));var rs=require(_0xb058('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb058('0x4'));var logger=require('../../config/logger')(_0xb058('0x5'));var config=require(_0xb058('0x6'));var jayson=require(_0xb058('0x7'));var client=jayson[_0xb058('0x8')][_0xb058('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x754e33,_0x159bb1,_0x26565a){return new BPromise(function(_0x2c82e1,_0x7ea6a0){return client[_0xb058('0xa')](_0x754e33,_0x26565a)['then'](function(_0x34ede3){logger['info'](_0xb058('0xb'),_0x159bb1,_0xb058('0xc'));logger[_0xb058('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x159bb1,_0xb058('0xc'),JSON[_0xb058('0xe')](_0x34ede3));if(_0x34ede3[_0xb058('0xf')]){if(_0x34ede3[_0xb058('0xf')]['code']===0x1f4){logger['error'](_0xb058('0xb'),_0x159bb1,_0x34ede3['error']['message']);return _0x7ea6a0(_0x34ede3['error']['message']);}logger[_0xb058('0xf')](_0xb058('0xb'),_0x159bb1,_0x34ede3[_0xb058('0xf')][_0xb058('0x10')]);return _0x2c82e1(_0x34ede3[_0xb058('0xf')]['message']);}else{logger[_0xb058('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x159bb1,_0xb058('0xc'));_0x2c82e1(_0x34ede3[_0xb058('0x12')][_0xb058('0x10')]);}})[_0xb058('0x13')](function(_0x1ea42e){logger[_0xb058('0xf')](_0xb058('0xb'),_0x159bb1,_0x1ea42e);_0x7ea6a0(_0x1ea42e);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index e4592c7..aec7981 100644 --- a/server/api/analyticExtractedReport/index.js +++ b/server/api/analyticExtractedReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xefe7=['../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','/:id/download','download','post','create','put','delete','destroy','util','path','fs-extra','../../components/interaction/service'];(function(_0x182fff,_0x568aee){var _0x1b4171=function(_0x212d46){while(--_0x212d46){_0x182fff['push'](_0x182fff['shift']());}};_0x1b4171(++_0x568aee);}(_0xefe7,0x1a5));var _0x7efe=function(_0x49ec58,_0x59a955){_0x49ec58=_0x49ec58-0x0;var _0x3547f2=_0xefe7[_0x49ec58];return _0x3547f2;};'use strict';var multer=require('multer');var util=require(_0x7efe('0x0'));var path=require(_0x7efe('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x7efe('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x7efe('0x3'));var config=require(_0x7efe('0x4'));var controller=require(_0x7efe('0x5'));router[_0x7efe('0x6')]('/',auth[_0x7efe('0x7')](),controller[_0x7efe('0x8')]);router[_0x7efe('0x6')](_0x7efe('0x9'),auth[_0x7efe('0x7')](),controller['show']);router[_0x7efe('0x6')](_0x7efe('0xa'),auth[_0x7efe('0x7')](),controller[_0x7efe('0xb')]);router[_0x7efe('0xc')]('/',auth[_0x7efe('0x7')](),controller[_0x7efe('0xd')]);router[_0x7efe('0xe')](_0x7efe('0x9'),auth[_0x7efe('0x7')](),controller['update']);router[_0x7efe('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x7efe('0x10')]);module['exports']=router; \ No newline at end of file +var _0x6a30=['express','Router','fs-extra','../../components/auth/service','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put','update','delete','exports','multer','util','path'];(function(_0x395e0b,_0x3f93fc){var _0x26b110=function(_0x1e90d8){while(--_0x1e90d8){_0x395e0b['push'](_0x395e0b['shift']());}};_0x26b110(++_0x3f93fc);}(_0x6a30,0x1e0));var _0x06a3=function(_0x4687aa,_0x52ce79){_0x4687aa=_0x4687aa-0x0;var _0x129611=_0x6a30[_0x4687aa];return _0x129611;};'use strict';var multer=require(_0x06a3('0x0'));var util=require(_0x06a3('0x1'));var path=require(_0x06a3('0x2'));var timeout=require('connect-timeout');var express=require(_0x06a3('0x3'));var router=express[_0x06a3('0x4')]();var fs_extra=require(_0x06a3('0x5'));var auth=require(_0x06a3('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x06a3('0x7'));router[_0x06a3('0x8')]('/',auth[_0x06a3('0x9')](),controller[_0x06a3('0xa')]);router[_0x06a3('0x8')](_0x06a3('0xb'),auth[_0x06a3('0x9')](),controller[_0x06a3('0xc')]);router['get'](_0x06a3('0xd'),auth[_0x06a3('0x9')](),controller[_0x06a3('0xe')]);router[_0x06a3('0xf')]('/',auth[_0x06a3('0x9')](),controller[_0x06a3('0x10')]);router[_0x06a3('0x11')]('/:id',auth[_0x06a3('0x9')](),controller[_0x06a3('0x12')]);router[_0x06a3('0x13')](_0x06a3('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x06a3('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 500ae2c..e2d9515 100644 --- a/server/api/analyticFieldReport/analyticFieldReport.attributes.js +++ b/server/api/analyticFieldReport/analyticFieldReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0654=['STRING','BOOLEAN','sequelize','TEXT'];(function(_0x3b6eb9,_0x409248){var _0x2d48a4=function(_0x5c5fb8){while(--_0x5c5fb8){_0x3b6eb9['push'](_0x3b6eb9['shift']());}};_0x2d48a4(++_0x409248);}(_0x0654,0x112));var _0x4065=function(_0x3f0d91,_0x4085a9){_0x3f0d91=_0x3f0d91-0x0;var _0x347609=_0x0654[_0x3f0d91];return _0x347609;};'use strict';var Sequelize=require(_0x4065('0x0'));module['exports']={'field':{'type':Sequelize[_0x4065('0x1')]},'alias':{'type':Sequelize[_0x4065('0x2')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x4065('0x2')]},'groupBy':{'type':Sequelize[_0x4065('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x4065('0x2')]},'custom':{'type':Sequelize[_0x4065('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x2e8f=['TEXT','STRING','BOOLEAN','sequelize'];(function(_0xea9e1c,_0x577088){var _0x3bdb61=function(_0x35e3c1){while(--_0x35e3c1){_0xea9e1c['push'](_0xea9e1c['shift']());}};_0x3bdb61(++_0x577088);}(_0x2e8f,0x1d3));var _0xf2e8=function(_0x30cd7e,_0x4db10a){_0x30cd7e=_0x30cd7e-0x0;var _0x462a02=_0x2e8f[_0x30cd7e];return _0x462a02;};'use strict';var Sequelize=require(_0xf2e8('0x0'));module['exports']={'field':{'type':Sequelize[_0xf2e8('0x1')]},'alias':{'type':Sequelize[_0xf2e8('0x2')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xf2e8('0x2')]},'groupBy':{'type':Sequelize[_0xf2e8('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xf2e8('0x2')]},'custom':{'type':Sequelize[_0xf2e8('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 8a3bc8d..4603bc5 100644 --- a/server/api/analyticFieldReport/analyticFieldReport.controller.js +++ b/server/api/analyticFieldReport/analyticFieldReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4b3b=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','undefined','offset','count','limit','set','Content-Range','apply','update','then','end','sendStatus','error','stack','name','send','index','map','AnalyticFieldReport','fieldName','type','key','model','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','rawAttributes','keys','length','find','catch','create','bulkCreate','body','destroy','bulkDestroy','AnalyticCustomReport','transaction','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x4b5d99,_0x44ecdf){var _0x47d02a=function(_0x5a76ee){while(--_0x5a76ee){_0x4b5d99['push'](_0x4b5d99['shift']());}};_0x47d02a(++_0x44ecdf);}(_0x4b3b,0x9e));var _0xb4b3=function(_0x14af86,_0x132945){_0x14af86=_0x14af86-0x0;var _0x3e7433=_0x4b3b[_0x14af86];return _0x3e7433;};'use strict';var emlformat=require(_0xb4b3('0x0'));var rimraf=require(_0xb4b3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb4b3('0x2'));var rp=require(_0xb4b3('0x3'));var moment=require(_0xb4b3('0x4'));var BPromise=require(_0xb4b3('0x5'));var Mustache=require(_0xb4b3('0x6'));var util=require(_0xb4b3('0x7'));var path=require(_0xb4b3('0x8'));var sox=require(_0xb4b3('0x9'));var csv=require(_0xb4b3('0xa'));var ejs=require(_0xb4b3('0xb'));var fs=require('fs');var fs_extra=require(_0xb4b3('0xc'));var _=require(_0xb4b3('0xd'));var squel=require(_0xb4b3('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb4b3('0xf'));var toCsv=require(_0xb4b3('0xa'));var querystring=require(_0xb4b3('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb4b3('0x11'));var as=require(_0xb4b3('0x12'));var hardwareService=require(_0xb4b3('0x13'));var logger=require(_0xb4b3('0x14'))(_0xb4b3('0x15'));var utils=require(_0xb4b3('0x16'));var config=require(_0xb4b3('0x17'));var licenseUtil=require(_0xb4b3('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x547572,_0x57424a){_0x57424a=_0x57424a||0xcc;return function(_0x292004){if(_0x292004){return _0x547572['sendStatus'](_0x57424a);}return _0x547572[_0xb4b3('0x19')](_0x57424a)['end']();};}function respondWithResult(_0x3bc160,_0x4f88e3){_0x4f88e3=_0x4f88e3||0xc8;return function(_0x2ae9f7){if(_0x2ae9f7){return _0x3bc160[_0xb4b3('0x19')](_0x4f88e3)[_0xb4b3('0x1a')](_0x2ae9f7);}};}function respondWithFilteredResult(_0x21f8ff,_0x286fa4){return function(_0x394b87){if(_0x394b87){var _0xbe961a=typeof _0x286fa4['offset']===_0xb4b3('0x1b')&&typeof _0x286fa4['limit']===_0xb4b3('0x1b');var _0x313bd7=_0x394b87['count'];var _0xbd9945=_0xbe961a?0x0:_0x286fa4[_0xb4b3('0x1c')];var _0x26f6cc=_0xbe961a?_0x394b87[_0xb4b3('0x1d')]:_0x286fa4[_0xb4b3('0x1c')]+_0x286fa4[_0xb4b3('0x1e')];var _0x4c9e8e;if(_0x26f6cc>=_0x313bd7){_0x26f6cc=_0x313bd7;_0x4c9e8e=0xc8;}else{_0x4c9e8e=0xce;}_0x21f8ff[_0xb4b3('0x19')](_0x4c9e8e);return _0x21f8ff[_0xb4b3('0x1f')](_0xb4b3('0x20'),_0xbd9945+'-'+_0x26f6cc+'/'+_0x313bd7)[_0xb4b3('0x1a')](_0x394b87);}return null;};}function patchUpdates(_0x55a6c1){return function(_0x985351){try{jsonpatch[_0xb4b3('0x21')](_0x985351,_0x55a6c1,!![]);}catch(_0x3e1107){return BPromise['reject'](_0x3e1107);}return _0x985351['save']();};}function saveUpdates(_0x57ab56,_0x56f4f4){return function(_0x4166bb){if(_0x4166bb){return _0x4166bb[_0xb4b3('0x22')](_0x57ab56)[_0xb4b3('0x23')](function(_0x372c6b){return _0x372c6b;});}return null;};}function removeEntity(_0x56fad5,_0x18ee92){return function(_0xe51afe){if(_0xe51afe){return _0xe51afe['destroy']()[_0xb4b3('0x23')](function(){_0x56fad5[_0xb4b3('0x19')](0xcc)[_0xb4b3('0x24')]();});}};}function handleEntityNotFound(_0x36b63a,_0x310eff){return function(_0x57d4ba){if(!_0x57d4ba){_0x36b63a[_0xb4b3('0x25')](0x194);}return _0x57d4ba;};}function handleError(_0x4abf89,_0x3347ed){_0x3347ed=_0x3347ed||0x1f4;return function(_0x5e68e1){logger[_0xb4b3('0x26')](_0x5e68e1[_0xb4b3('0x27')]);if(_0x5e68e1[_0xb4b3('0x28')]){delete _0x5e68e1[_0xb4b3('0x28')];}_0x4abf89['status'](_0x3347ed)[_0xb4b3('0x29')](_0x5e68e1);};}exports[_0xb4b3('0x2a')]=function(_0x24cc17,_0x27baa4){var _0x47a3d7={},_0xd5db1f={},_0x2e2b98={'count':0x0,'rows':[]};var _0x1d1c71=_[_0xb4b3('0x2b')](db[_0xb4b3('0x2c')]['rawAttributes'],function(_0x424434){return{'name':_0x424434[_0xb4b3('0x2d')],'type':_0x424434[_0xb4b3('0x2e')][_0xb4b3('0x2f')]};});_0xd5db1f[_0xb4b3('0x30')]=_[_0xb4b3('0x2b')](_0x1d1c71,'name');_0xd5db1f[_0xb4b3('0x31')]=_['keys'](_0x24cc17[_0xb4b3('0x31')]);_0xd5db1f['filters']=_['intersection'](_0xd5db1f['model'],_0xd5db1f[_0xb4b3('0x31')]);_0x47a3d7[_0xb4b3('0x32')]=_[_0xb4b3('0x33')](_0xd5db1f['model'],qs[_0xb4b3('0x34')](_0x24cc17[_0xb4b3('0x31')][_0xb4b3('0x34')]));_0x47a3d7[_0xb4b3('0x32')]=_0x47a3d7[_0xb4b3('0x32')]['length']?_0x47a3d7[_0xb4b3('0x32')]:_0xd5db1f[_0xb4b3('0x30')];if(!_0x24cc17[_0xb4b3('0x31')][_0xb4b3('0x35')](_0xb4b3('0x36'))){_0x47a3d7[_0xb4b3('0x1e')]=qs['limit'](_0x24cc17[_0xb4b3('0x31')][_0xb4b3('0x1e')]);_0x47a3d7[_0xb4b3('0x1c')]=qs[_0xb4b3('0x1c')](_0x24cc17[_0xb4b3('0x31')][_0xb4b3('0x1c')]);}_0x47a3d7[_0xb4b3('0x37')]=qs[_0xb4b3('0x38')](_0x24cc17[_0xb4b3('0x31')]['sort']);_0x47a3d7[_0xb4b3('0x39')]=qs[_0xb4b3('0x3a')](_[_0xb4b3('0x3b')](_0x24cc17[_0xb4b3('0x31')],_0xd5db1f[_0xb4b3('0x3a')]),_0x1d1c71);if(_0x24cc17[_0xb4b3('0x31')][_0xb4b3('0x3c')]){_0x47a3d7[_0xb4b3('0x39')]=_['merge'](_0x47a3d7[_0xb4b3('0x39')],{'$or':_['map'](_0x1d1c71,function(_0x3382a1){if(_0x3382a1['type']!==_0xb4b3('0x3d')){var _0xfe4982={};_0xfe4982[_0x3382a1[_0xb4b3('0x28')]]={'$like':'%'+_0x24cc17[_0xb4b3('0x31')][_0xb4b3('0x3c')]+'%'};return _0xfe4982;}})});}_0x47a3d7=_[_0xb4b3('0x3e')]({},_0x47a3d7,_0x24cc17[_0xb4b3('0x3f')]);var _0x1f2f36={'where':_0x47a3d7['where']};return db['AnalyticFieldReport'][_0xb4b3('0x1d')](_0x1f2f36)[_0xb4b3('0x23')](function(_0x5c5fb5){_0x2e2b98[_0xb4b3('0x1d')]=_0x5c5fb5;if(_0x24cc17['query'][_0xb4b3('0x40')]){_0x47a3d7[_0xb4b3('0x41')]=[{'all':!![]}];}return db[_0xb4b3('0x2c')][_0xb4b3('0x42')](_0x47a3d7);})[_0xb4b3('0x23')](function(_0x58ef38){_0x2e2b98['rows']=_0x58ef38;return _0x2e2b98;})['then'](respondWithFilteredResult(_0x27baa4,_0x47a3d7))['catch'](handleError(_0x27baa4,null));};exports[_0xb4b3('0x43')]=function(_0xe4312f,_0x566414){var _0x57d4d7={'raw':![],'where':{'id':_0xe4312f[_0xb4b3('0x44')]['id']}},_0x46ac6c={};_0x46ac6c[_0xb4b3('0x30')]=_['keys'](db[_0xb4b3('0x2c')][_0xb4b3('0x45')]);_0x46ac6c[_0xb4b3('0x31')]=_[_0xb4b3('0x46')](_0xe4312f[_0xb4b3('0x31')]);_0x46ac6c[_0xb4b3('0x3a')]=_[_0xb4b3('0x33')](_0x46ac6c[_0xb4b3('0x30')],_0x46ac6c[_0xb4b3('0x31')]);_0x57d4d7[_0xb4b3('0x32')]=_[_0xb4b3('0x33')](_0x46ac6c[_0xb4b3('0x30')],qs[_0xb4b3('0x34')](_0xe4312f[_0xb4b3('0x31')][_0xb4b3('0x34')]));_0x57d4d7[_0xb4b3('0x32')]=_0x57d4d7[_0xb4b3('0x32')][_0xb4b3('0x47')]?_0x57d4d7[_0xb4b3('0x32')]:_0x46ac6c[_0xb4b3('0x30')];if(_0xe4312f['query'][_0xb4b3('0x40')]){_0x57d4d7[_0xb4b3('0x41')]=[{'all':!![]}];}_0x57d4d7=_[_0xb4b3('0x3e')]({},_0x57d4d7,_0xe4312f['options']);return db[_0xb4b3('0x2c')][_0xb4b3('0x48')](_0x57d4d7)[_0xb4b3('0x23')](handleEntityNotFound(_0x566414,null))[_0xb4b3('0x23')](respondWithResult(_0x566414,null))[_0xb4b3('0x49')](handleError(_0x566414,null));};exports[_0xb4b3('0x4a')]=function(_0x7b71c5,_0x3bb709){return db[_0xb4b3('0x2c')]['create'](_0x7b71c5['body'],{})[_0xb4b3('0x23')](respondWithResult(_0x3bb709,0xc9))[_0xb4b3('0x49')](handleError(_0x3bb709,null));};exports[_0xb4b3('0x4b')]=function(_0x1ffdf7,_0x860cfe){return db[_0xb4b3('0x2c')][_0xb4b3('0x4b')](_0x1ffdf7[_0xb4b3('0x4c')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x860cfe,0xc9))[_0xb4b3('0x49')](handleError(_0x860cfe,null));};exports[_0xb4b3('0x22')]=function(_0x4790c9,_0x5aac59){if(_0x4790c9[_0xb4b3('0x4c')]['id']){delete _0x4790c9[_0xb4b3('0x4c')]['id'];}return db['AnalyticFieldReport'][_0xb4b3('0x48')]({'where':{'id':_0x4790c9[_0xb4b3('0x44')]['id']}})[_0xb4b3('0x23')](handleEntityNotFound(_0x5aac59,null))[_0xb4b3('0x23')](saveUpdates(_0x4790c9[_0xb4b3('0x4c')],null))[_0xb4b3('0x23')](respondWithResult(_0x5aac59,null))[_0xb4b3('0x49')](handleError(_0x5aac59,null));};exports[_0xb4b3('0x4d')]=function(_0x227a8e,_0x4bc5f5){return db['AnalyticFieldReport'][_0xb4b3('0x48')]({'where':{'id':_0x227a8e[_0xb4b3('0x44')]['id']}})[_0xb4b3('0x23')](handleEntityNotFound(_0x4bc5f5,null))['then'](removeEntity(_0x4bc5f5,null))[_0xb4b3('0x49')](handleError(_0x4bc5f5,null));};exports[_0xb4b3('0x4e')]=function(_0x43157a,_0x313ef0){return db[_0xb4b3('0x2c')][_0xb4b3('0x4d')]({'where':{'id':_0x43157a[_0xb4b3('0x31')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0xb4b3('0x23')](respondWithResult(_0x313ef0,0xcc))[_0xb4b3('0x49')](handleError(_0x313ef0,null));};exports['addFields']=function(_0x17a388,_0x6a22cb,_0x2513c4){return db[_0xb4b3('0x4f')]['findOne']({'where':{'id':_0x17a388['params']['id']}})[_0xb4b3('0x23')](handleEntityNotFound(_0x6a22cb,null))[_0xb4b3('0x23')](function(_0x3c04fc){if(_0x3c04fc){return db['sequelize'][_0xb4b3('0x50')](function(_0x48b245){return db['AnalyticFieldReport'][_0xb4b3('0x4d')]({'where':{'CustomReportId':_0x17a388['params']['id']},'transaction':_0x48b245})[_0xb4b3('0x23')](function(_0x2931b2){var _0x425532=_[_0xb4b3('0x2b')](_0x17a388[_0xb4b3('0x4c')],function(_0x2e1a78){delete _0x2e1a78['id'];_0x2e1a78['CustomReportId']=_0x17a388[_0xb4b3('0x44')]['id'];return _0x2e1a78;});return db[_0xb4b3('0x2c')][_0xb4b3('0x4b')](_0x425532,{'transaction':_0x48b245});});})[_0xb4b3('0x23')](function(){return db[_0xb4b3('0x2c')]['findAll']({'where':{'CustomReportId':_0x17a388['params']['id']}});});}})[_0xb4b3('0x23')](respondWithResult(_0x6a22cb,null))[_0xb4b3('0x49')](handleError(_0x6a22cb,null));}; \ No newline at end of file +var _0xb27a=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticFieldReport','include','rows','catch','show','params','intersection','includeAll','find','create','body','bulkCreate','ids','addFields','findOne','sequelize','transaction','CustomReportId','findAll','eml-format','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','length'];(function(_0x1288db,_0x211057){var _0x1df750=function(_0x2caccc){while(--_0x2caccc){_0x1288db['push'](_0x1288db['shift']());}};_0x1df750(++_0x211057);}(_0xb27a,0x15d));var _0xab27=function(_0xdbd4f7,_0x4e3bdd){_0xdbd4f7=_0xdbd4f7-0x0;var _0x5c3f9d=_0xb27a[_0xdbd4f7];return _0x5c3f9d;};'use strict';var emlformat=require(_0xab27('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xab27('0x1'));var rp=require(_0xab27('0x2'));var moment=require(_0xab27('0x3'));var BPromise=require(_0xab27('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xab27('0x5'));var sox=require('sox');var csv=require(_0xab27('0x6'));var ejs=require(_0xab27('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xab27('0x8'));var crypto=require(_0xab27('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xab27('0xa'));var toCsv=require(_0xab27('0x6'));var querystring=require('querystring');var Papa=require(_0xab27('0xb'));var Redis=require(_0xab27('0xc'));var authService=require(_0xab27('0xd'));var qs=require(_0xab27('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xab27('0xf'));var logger=require(_0xab27('0x10'))(_0xab27('0x11'));var utils=require('../../config/utils');var config=require(_0xab27('0x12'));var licenseUtil=require(_0xab27('0x13'));var db=require(_0xab27('0x14'))['db'];function respondWithStatusCode(_0x38fe92,_0x328b35){_0x328b35=_0x328b35||0xcc;return function(_0x5bdd7a){if(_0x5bdd7a){return _0x38fe92[_0xab27('0x15')](_0x328b35);}return _0x38fe92[_0xab27('0x16')](_0x328b35)[_0xab27('0x17')]();};}function respondWithResult(_0x4cc759,_0x34bc1c){_0x34bc1c=_0x34bc1c||0xc8;return function(_0xea6b5a){if(_0xea6b5a){return _0x4cc759['status'](_0x34bc1c)[_0xab27('0x18')](_0xea6b5a);}};}function respondWithFilteredResult(_0x129f22,_0x4105da){return function(_0x4b2d5f){if(_0x4b2d5f){var _0x3bab27=typeof _0x4105da[_0xab27('0x19')]==='undefined'&&typeof _0x4105da[_0xab27('0x1a')]===_0xab27('0x1b');var _0x299e97=_0x4b2d5f[_0xab27('0x1c')];var _0xb2a05a=_0x3bab27?0x0:_0x4105da[_0xab27('0x19')];var _0x4ecb6b=_0x3bab27?_0x4b2d5f[_0xab27('0x1c')]:_0x4105da[_0xab27('0x19')]+_0x4105da[_0xab27('0x1a')];var _0x112d30;if(_0x4ecb6b>=_0x299e97){_0x4ecb6b=_0x299e97;_0x112d30=0xc8;}else{_0x112d30=0xce;}_0x129f22[_0xab27('0x16')](_0x112d30);return _0x129f22[_0xab27('0x1d')](_0xab27('0x1e'),_0xb2a05a+'-'+_0x4ecb6b+'/'+_0x299e97)['json'](_0x4b2d5f);}return null;};}function patchUpdates(_0x17f648){return function(_0x14f0ca){try{jsonpatch[_0xab27('0x1f')](_0x14f0ca,_0x17f648,!![]);}catch(_0x588f90){return BPromise[_0xab27('0x20')](_0x588f90);}return _0x14f0ca[_0xab27('0x21')]();};}function saveUpdates(_0xc35d41,_0xd6b8ff){return function(_0x57a8c2){if(_0x57a8c2){return _0x57a8c2[_0xab27('0x22')](_0xc35d41)[_0xab27('0x23')](function(_0xe3720e){return _0xe3720e;});}return null;};}function removeEntity(_0x3ad723,_0x4822dc){return function(_0x5756e9){if(_0x5756e9){return _0x5756e9[_0xab27('0x24')]()[_0xab27('0x23')](function(){_0x3ad723[_0xab27('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e03c9,_0x26ef77){return function(_0x39681a){if(!_0x39681a){_0x1e03c9[_0xab27('0x15')](0x194);}return _0x39681a;};}function handleError(_0x383aef,_0x3a591a){_0x3a591a=_0x3a591a||0x1f4;return function(_0x524b9e){logger[_0xab27('0x25')](_0x524b9e[_0xab27('0x26')]);if(_0x524b9e[_0xab27('0x27')]){delete _0x524b9e[_0xab27('0x27')];}_0x383aef['status'](_0x3a591a)[_0xab27('0x28')](_0x524b9e);};}exports['index']=function(_0x160ff0,_0x5b257e){var _0x3ba5be={},_0x45c6bf={},_0x1c9898={'count':0x0,'rows':[]};var _0x31c96a=_[_0xab27('0x29')](db['AnalyticFieldReport'][_0xab27('0x2a')],function(_0x57ef62){return{'name':_0x57ef62[_0xab27('0x2b')],'type':_0x57ef62['type']['key']};});_0x45c6bf[_0xab27('0x2c')]=_[_0xab27('0x29')](_0x31c96a,_0xab27('0x27'));_0x45c6bf[_0xab27('0x2d')]=_[_0xab27('0x2e')](_0x160ff0['query']);_0x45c6bf[_0xab27('0x2f')]=_['intersection'](_0x45c6bf[_0xab27('0x2c')],_0x45c6bf[_0xab27('0x2d')]);_0x3ba5be[_0xab27('0x30')]=_['intersection'](_0x45c6bf[_0xab27('0x2c')],qs[_0xab27('0x31')](_0x160ff0[_0xab27('0x2d')]['fields']));_0x3ba5be[_0xab27('0x30')]=_0x3ba5be['attributes'][_0xab27('0x32')]?_0x3ba5be[_0xab27('0x30')]:_0x45c6bf[_0xab27('0x2c')];if(!_0x160ff0[_0xab27('0x2d')][_0xab27('0x33')](_0xab27('0x34'))){_0x3ba5be[_0xab27('0x1a')]=qs['limit'](_0x160ff0[_0xab27('0x2d')][_0xab27('0x1a')]);_0x3ba5be['offset']=qs['offset'](_0x160ff0[_0xab27('0x2d')][_0xab27('0x19')]);}_0x3ba5be[_0xab27('0x35')]=qs['sort'](_0x160ff0[_0xab27('0x2d')][_0xab27('0x36')]);_0x3ba5be[_0xab27('0x37')]=qs['filters'](_[_0xab27('0x38')](_0x160ff0[_0xab27('0x2d')],_0x45c6bf[_0xab27('0x2f')]),_0x31c96a);if(_0x160ff0['query'][_0xab27('0x39')]){_0x3ba5be[_0xab27('0x37')]=_[_0xab27('0x3a')](_0x3ba5be[_0xab27('0x37')],{'$or':_['map'](_0x31c96a,function(_0x59a18a){if(_0x59a18a['type']!==_0xab27('0x3b')){var _0x19ef19={};_0x19ef19[_0x59a18a['name']]={'$like':'%'+_0x160ff0['query'][_0xab27('0x39')]+'%'};return _0x19ef19;}})});}_0x3ba5be=_['merge']({},_0x3ba5be,_0x160ff0[_0xab27('0x3c')]);var _0x2b4c1e={'where':_0x3ba5be['where']};return db[_0xab27('0x3d')][_0xab27('0x1c')](_0x2b4c1e)[_0xab27('0x23')](function(_0x359557){_0x1c9898[_0xab27('0x1c')]=_0x359557;if(_0x160ff0[_0xab27('0x2d')]['includeAll']){_0x3ba5be[_0xab27('0x3e')]=[{'all':!![]}];}return db[_0xab27('0x3d')]['findAll'](_0x3ba5be);})[_0xab27('0x23')](function(_0x3b4581){_0x1c9898[_0xab27('0x3f')]=_0x3b4581;return _0x1c9898;})[_0xab27('0x23')](respondWithFilteredResult(_0x5b257e,_0x3ba5be))[_0xab27('0x40')](handleError(_0x5b257e,null));};exports[_0xab27('0x41')]=function(_0xb400be,_0x1b875c){var _0x375fc7={'raw':![],'where':{'id':_0xb400be[_0xab27('0x42')]['id']}},_0x567f8a={};_0x567f8a[_0xab27('0x2c')]=_[_0xab27('0x2e')](db['AnalyticFieldReport']['rawAttributes']);_0x567f8a[_0xab27('0x2d')]=_['keys'](_0xb400be['query']);_0x567f8a['filters']=_[_0xab27('0x43')](_0x567f8a[_0xab27('0x2c')],_0x567f8a[_0xab27('0x2d')]);_0x375fc7[_0xab27('0x30')]=_['intersection'](_0x567f8a[_0xab27('0x2c')],qs['fields'](_0xb400be[_0xab27('0x2d')][_0xab27('0x31')]));_0x375fc7[_0xab27('0x30')]=_0x375fc7[_0xab27('0x30')]['length']?_0x375fc7[_0xab27('0x30')]:_0x567f8a['model'];if(_0xb400be[_0xab27('0x2d')][_0xab27('0x44')]){_0x375fc7[_0xab27('0x3e')]=[{'all':!![]}];}_0x375fc7=_[_0xab27('0x3a')]({},_0x375fc7,_0xb400be[_0xab27('0x3c')]);return db[_0xab27('0x3d')][_0xab27('0x45')](_0x375fc7)[_0xab27('0x23')](handleEntityNotFound(_0x1b875c,null))[_0xab27('0x23')](respondWithResult(_0x1b875c,null))[_0xab27('0x40')](handleError(_0x1b875c,null));};exports[_0xab27('0x46')]=function(_0x20e968,_0x16aa4e){return db[_0xab27('0x3d')][_0xab27('0x46')](_0x20e968[_0xab27('0x47')],{})['then'](respondWithResult(_0x16aa4e,0xc9))[_0xab27('0x40')](handleError(_0x16aa4e,null));};exports[_0xab27('0x48')]=function(_0x327490,_0x3b0800){return db[_0xab27('0x3d')][_0xab27('0x48')](_0x327490[_0xab27('0x47')],{'raw':![],'individualHooks':!![]})[_0xab27('0x23')](respondWithResult(_0x3b0800,0xc9))[_0xab27('0x40')](handleError(_0x3b0800,null));};exports[_0xab27('0x22')]=function(_0x58ad8a,_0x5e9d02){if(_0x58ad8a[_0xab27('0x47')]['id']){delete _0x58ad8a[_0xab27('0x47')]['id'];}return db[_0xab27('0x3d')]['find']({'where':{'id':_0x58ad8a[_0xab27('0x42')]['id']}})['then'](handleEntityNotFound(_0x5e9d02,null))[_0xab27('0x23')](saveUpdates(_0x58ad8a[_0xab27('0x47')],null))['then'](respondWithResult(_0x5e9d02,null))[_0xab27('0x40')](handleError(_0x5e9d02,null));};exports[_0xab27('0x24')]=function(_0x360038,_0x8bd080){return db[_0xab27('0x3d')][_0xab27('0x45')]({'where':{'id':_0x360038[_0xab27('0x42')]['id']}})[_0xab27('0x23')](handleEntityNotFound(_0x8bd080,null))['then'](removeEntity(_0x8bd080,null))[_0xab27('0x40')](handleError(_0x8bd080,null));};exports['bulkDestroy']=function(_0x1c72e9,_0x14ba0a){return db[_0xab27('0x3d')][_0xab27('0x24')]({'where':{'id':_0x1c72e9['query'][_0xab27('0x49')]||[]},'raw':![],'individualHooks':!![]})[_0xab27('0x23')](respondWithResult(_0x14ba0a,0xcc))[_0xab27('0x40')](handleError(_0x14ba0a,null));};exports[_0xab27('0x4a')]=function(_0x3c82a0,_0x471fd7,_0x45a873){return db['AnalyticCustomReport'][_0xab27('0x4b')]({'where':{'id':_0x3c82a0[_0xab27('0x42')]['id']}})['then'](handleEntityNotFound(_0x471fd7,null))[_0xab27('0x23')](function(_0x215070){if(_0x215070){return db[_0xab27('0x4c')][_0xab27('0x4d')](function(_0x274454){return db[_0xab27('0x3d')][_0xab27('0x24')]({'where':{'CustomReportId':_0x3c82a0[_0xab27('0x42')]['id']},'transaction':_0x274454})[_0xab27('0x23')](function(_0x4ac641){var _0x33ead2=_['map'](_0x3c82a0[_0xab27('0x47')],function(_0x42726b){delete _0x42726b['id'];_0x42726b[_0xab27('0x4e')]=_0x3c82a0['params']['id'];return _0x42726b;});return db[_0xab27('0x3d')][_0xab27('0x48')](_0x33ead2,{'transaction':_0x274454});});})[_0xab27('0x23')](function(){return db[_0xab27('0x3d')][_0xab27('0x4f')]({'where':{'CustomReportId':_0x3c82a0[_0xab27('0x42')]['id']}});});}})[_0xab27('0x23')](respondWithResult(_0x471fd7,null))['catch'](handleError(_0x471fd7,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 1908249..08bc382 100644 --- a/server/api/analyticFieldReport/analyticFieldReport.model.js +++ b/server/api/analyticFieldReport/analyticFieldReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8021=['lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','analytics_report_fields'];(function(_0x5253d7,_0x2ea8f8){var _0x1dd6c9=function(_0x5a6448){while(--_0x5a6448){_0x5253d7['push'](_0x5253d7['shift']());}};_0x1dd6c9(++_0x2ea8f8);}(_0x8021,0x1bc));var _0x1802=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0x8021[_0xfa634c];return _0x73e478;};'use strict';var _=require(_0x1802('0x0'));var util=require(_0x1802('0x1'));var logger=require(_0x1802('0x2'))(_0x1802('0x3'));var moment=require(_0x1802('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1802('0x5'));var rimraf=require(_0x1802('0x6'));var config=require(_0x1802('0x7'));var attributes=require(_0x1802('0x8'));module[_0x1802('0x9')]=function(_0x4be4ef,_0xc0bea4){return _0x4be4ef[_0x1802('0xa')]('AnalyticFieldReport',attributes,{'tableName':_0x1802('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde1e=['lodash','util','api','bluebird','path','../../config/environment','./analyticFieldReport.attributes','AnalyticFieldReport','analytics_report_fields'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xde1e,0xd8));var _0xede1=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xde1e[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xede1('0x0'));var util=require(_0xede1('0x1'));var logger=require('../../config/logger')(_0xede1('0x2'));var moment=require('moment');var BPromise=require(_0xede1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xede1('0x4'));var rimraf=require('rimraf');var config=require(_0xede1('0x5'));var attributes=require(_0xede1('0x6'));module['exports']=function(_0x2611ce,_0x15da99){return _0x2611ce['define'](_0xede1('0x7'),attributes,{'tableName':_0xede1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index 16e5506..3611f69 100644 --- a/server/api/analyticFieldReport/analyticFieldReport.rpc.js +++ b/server/api/analyticFieldReport/analyticFieldReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xefb1=['code','AnalyticFieldReport,\x20%s,\x20%s','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1913ee,_0x42ad2e){var _0x144c22=function(_0x27f5ac){while(--_0x27f5ac){_0x1913ee['push'](_0x1913ee['shift']());}};_0x144c22(++_0x42ad2e);}(_0xefb1,0xe0));var _0x1efb=function(_0x4969ce,_0x1cf3ee){_0x4969ce=_0x4969ce-0x0;var _0x24d478=_0xefb1[_0x4969ce];return _0x24d478;};'use strict';var _=require('lodash');var util=require(_0x1efb('0x0'));var moment=require(_0x1efb('0x1'));var BPromise=require('bluebird');var rs=require(_0x1efb('0x2'));var fs=require('fs');var Redis=require(_0x1efb('0x3'));var db=require(_0x1efb('0x4'))['db'];var utils=require(_0x1efb('0x5'));var logger=require(_0x1efb('0x6'))(_0x1efb('0x7'));var config=require('../../config/environment');var jayson=require(_0x1efb('0x8'));var client=jayson[_0x1efb('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31d82a,_0x1a6e48,_0x3e305d){return new BPromise(function(_0x5ab77b,_0x18aa90){return client[_0x1efb('0xa')](_0x31d82a,_0x3e305d)[_0x1efb('0xb')](function(_0x1c27e0){logger[_0x1efb('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1a6e48,_0x1efb('0xd'));logger[_0x1efb('0xe')](_0x1efb('0xf'),_0x1a6e48,_0x1efb('0xd'),JSON[_0x1efb('0x10')](_0x1c27e0));if(_0x1c27e0[_0x1efb('0x11')]){if(_0x1c27e0[_0x1efb('0x11')][_0x1efb('0x12')]===0x1f4){logger[_0x1efb('0x11')](_0x1efb('0x13'),_0x1a6e48,_0x1c27e0[_0x1efb('0x11')][_0x1efb('0x14')]);return _0x18aa90(_0x1c27e0[_0x1efb('0x11')][_0x1efb('0x14')]);}logger[_0x1efb('0x11')](_0x1efb('0x13'),_0x1a6e48,_0x1c27e0[_0x1efb('0x11')]['message']);return _0x5ab77b(_0x1c27e0[_0x1efb('0x11')][_0x1efb('0x14')]);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x1a6e48,'request\x20sent');_0x5ab77b(_0x1c27e0['result'][_0x1efb('0x14')]);}})[_0x1efb('0x15')](function(_0x4aac88){logger[_0x1efb('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1a6e48,_0x4aac88);_0x18aa90(_0x4aac88);});});} \ No newline at end of file +var _0x2ddd=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash'];(function(_0x33317b,_0x1394d0){var _0x5b607c=function(_0x3b2ec3){while(--_0x3b2ec3){_0x33317b['push'](_0x33317b['shift']());}};_0x5b607c(++_0x1394d0);}(_0x2ddd,0x197));var _0xd2dd=function(_0x4e93a9,_0x413f30){_0x4e93a9=_0x4e93a9-0x0;var _0x43013c=_0x2ddd[_0x4e93a9];return _0x43013c;};'use strict';var _=require(_0xd2dd('0x0'));var util=require(_0xd2dd('0x1'));var moment=require(_0xd2dd('0x2'));var BPromise=require(_0xd2dd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd2dd('0x4'));var db=require(_0xd2dd('0x5'))['db'];var utils=require(_0xd2dd('0x6'));var logger=require(_0xd2dd('0x7'))(_0xd2dd('0x8'));var config=require(_0xd2dd('0x9'));var jayson=require(_0xd2dd('0xa'));var client=jayson[_0xd2dd('0xb')][_0xd2dd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5bdacb,_0x20f76c,_0x1c6dbb){return new BPromise(function(_0x1c190f,_0x33f8a3){return client[_0xd2dd('0xd')](_0x5bdacb,_0x1c6dbb)['then'](function(_0xeaaca9){logger['info'](_0xd2dd('0xe'),_0x20f76c,_0xd2dd('0xf'));logger['debug'](_0xd2dd('0x10'),_0x20f76c,_0xd2dd('0xf'),JSON[_0xd2dd('0x11')](_0xeaaca9));if(_0xeaaca9[_0xd2dd('0x12')]){if(_0xeaaca9[_0xd2dd('0x12')][_0xd2dd('0x13')]===0x1f4){logger['error'](_0xd2dd('0xe'),_0x20f76c,_0xeaaca9[_0xd2dd('0x12')]['message']);return _0x33f8a3(_0xeaaca9['error'][_0xd2dd('0x14')]);}logger[_0xd2dd('0x12')](_0xd2dd('0xe'),_0x20f76c,_0xeaaca9[_0xd2dd('0x12')][_0xd2dd('0x14')]);return _0x1c190f(_0xeaaca9[_0xd2dd('0x12')][_0xd2dd('0x14')]);}else{logger[_0xd2dd('0x15')](_0xd2dd('0xe'),_0x20f76c,_0xd2dd('0xf'));_0x1c190f(_0xeaaca9[_0xd2dd('0x16')]['message']);}})[_0xd2dd('0x17')](function(_0x37be5f){logger[_0xd2dd('0x12')](_0xd2dd('0xe'),_0x20f76c,_0x37be5f);_0x33f8a3(_0x37be5f);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index bb842e8..720a632 100644 --- a/server/api/analyticFieldReport/index.js +++ b/server/api/analyticFieldReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x384016,_0x484d32){var _0x5f3433=function(_0x52c6a5){while(--_0x52c6a5){_0x384016['push'](_0x384016['shift']());}};_0x5f3433(++_0x484d32);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file +var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0xa7719a,_0x291173){var _0x347ac6=function(_0x3e2e5e){while(--_0x3e2e5e){_0xa7719a['push'](_0xa7719a['shift']());}};_0x347ac6(++_0x291173);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index c8347af..b67bb1f 100644 --- a/server/api/analyticMetric/analyticMetric.attributes.js +++ b/server/api/analyticMetric/analyticMetric.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8c38=['TEXT','sequelize','exports','name','STRING'];(function(_0x502664,_0x1b58c5){var _0x1ee5f9=function(_0x7b9d48){while(--_0x7b9d48){_0x502664['push'](_0x502664['shift']());}};_0x1ee5f9(++_0x1b58c5);}(_0x8c38,0x83));var _0x88c3=function(_0x5943d3,_0xb4cbee){_0x5943d3=_0x5943d3-0x0;var _0x3a4c08=_0x8c38[_0x5943d3];return _0x3a4c08;};'use strict';var Sequelize=require(_0x88c3('0x0'));module[_0x88c3('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x88c3('0x2')},'table':{'type':Sequelize[_0x88c3('0x3')]},'metric':{'type':Sequelize[_0x88c3('0x4')]},'description':{'type':Sequelize[_0x88c3('0x3')]}}; \ No newline at end of file +var _0xd48a=['name','TEXT','sequelize','STRING'];(function(_0xff073f,_0x1f1934){var _0x3cb13e=function(_0x5d41f2){while(--_0x5d41f2){_0xff073f['push'](_0xff073f['shift']());}};_0x3cb13e(++_0x1f1934);}(_0xd48a,0x96));var _0xad48=function(_0x1f5af8,_0x277b26){_0x1f5af8=_0x1f5af8-0x0;var _0x9398b6=_0xd48a[_0x1f5af8];return _0x9398b6;};'use strict';var Sequelize=require(_0xad48('0x0'));module['exports']={'name':{'type':Sequelize[_0xad48('0x1')],'allowNull':![],'unique':_0xad48('0x2')},'table':{'type':Sequelize[_0xad48('0x1')]},'metric':{'type':Sequelize[_0xad48('0x3')]},'description':{'type':Sequelize[_0xad48('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index f31af93..893cfd5 100644 --- a/server/api/analyticMetric/analyticMetric.controller.js +++ b/server/api/analyticMetric/analyticMetric.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4b84=['status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','stack','name','map','AnalyticMetric','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','mustache','util','path','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x2401e6,_0x2248d7){var _0xf06a43=function(_0x477bd8){while(--_0x477bd8){_0x2401e6['push'](_0x2401e6['shift']());}};_0xf06a43(++_0x2248d7);}(_0x4b84,0x1cc));var _0x44b8=function(_0xb833b1,_0x1c3d3f){_0xb833b1=_0xb833b1-0x0;var _0x1ab87a=_0x4b84[_0xb833b1];return _0x1ab87a;};'use strict';var emlformat=require(_0x44b8('0x0'));var rimraf=require(_0x44b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x44b8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x44b8('0x3'));var util=require(_0x44b8('0x4'));var path=require(_0x44b8('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x44b8('0x6'));var _=require('lodash');var squel=require(_0x44b8('0x7'));var crypto=require('crypto');var jsforce=require(_0x44b8('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44b8('0x9'));var Papa=require(_0x44b8('0xa'));var Redis=require(_0x44b8('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x44b8('0xc'));var as=require(_0x44b8('0xd'));var hardwareService=require(_0x44b8('0xe'));var logger=require(_0x44b8('0xf'))(_0x44b8('0x10'));var utils=require(_0x44b8('0x11'));var config=require(_0x44b8('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x44b8('0x13'))['db'];function respondWithStatusCode(_0x4301a6,_0x4bcc43){_0x4bcc43=_0x4bcc43||0xcc;return function(_0x194230){if(_0x194230){return _0x4301a6['sendStatus'](_0x4bcc43);}return _0x4301a6[_0x44b8('0x14')](_0x4bcc43)[_0x44b8('0x15')]();};}function respondWithResult(_0x4df670,_0x63e8f6){_0x63e8f6=_0x63e8f6||0xc8;return function(_0x4be54c){if(_0x4be54c){return _0x4df670['status'](_0x63e8f6)[_0x44b8('0x16')](_0x4be54c);}};}function respondWithFilteredResult(_0x2af0ad,_0x1722da){return function(_0x41ab46){if(_0x41ab46){var _0x5e52f2=typeof _0x1722da['offset']==='undefined'&&typeof _0x1722da[_0x44b8('0x17')]==='undefined';var _0x28ef36=_0x41ab46[_0x44b8('0x18')];var _0x55e258=_0x5e52f2?0x0:_0x1722da[_0x44b8('0x19')];var _0xe3de8f=_0x5e52f2?_0x41ab46['count']:_0x1722da[_0x44b8('0x19')]+_0x1722da[_0x44b8('0x17')];var _0x4b600f;if(_0xe3de8f>=_0x28ef36){_0xe3de8f=_0x28ef36;_0x4b600f=0xc8;}else{_0x4b600f=0xce;}_0x2af0ad[_0x44b8('0x14')](_0x4b600f);return _0x2af0ad[_0x44b8('0x1a')](_0x44b8('0x1b'),_0x55e258+'-'+_0xe3de8f+'/'+_0x28ef36)[_0x44b8('0x16')](_0x41ab46);}return null;};}function patchUpdates(_0x102ef9){return function(_0x369c09){try{jsonpatch[_0x44b8('0x1c')](_0x369c09,_0x102ef9,!![]);}catch(_0x9b0536){return BPromise[_0x44b8('0x1d')](_0x9b0536);}return _0x369c09[_0x44b8('0x1e')]();};}function saveUpdates(_0x1d642b,_0x14996c){return function(_0x48327e){if(_0x48327e){return _0x48327e[_0x44b8('0x1f')](_0x1d642b)[_0x44b8('0x20')](function(_0x416b34){return _0x416b34;});}return null;};}function removeEntity(_0x1418db,_0x305a5c){return function(_0x51a34a){if(_0x51a34a){return _0x51a34a[_0x44b8('0x21')]()['then'](function(){var _0x41a922=_0x51a34a[_0x44b8('0x22')]({'plain':!![]});var _0x25a0c1=_0x44b8('0x23');return db[_0x44b8('0x24')]['destroy']({'where':{'type':_0x25a0c1,'resourceId':_0x41a922['id']}})[_0x44b8('0x20')](function(){return _0x51a34a;});})['then'](function(){_0x1418db[_0x44b8('0x14')](0xcc)[_0x44b8('0x15')]();});}};}function handleEntityNotFound(_0x549a26,_0x17ac44){return function(_0x470f49){if(!_0x470f49){_0x549a26[_0x44b8('0x25')](0x194);}return _0x470f49;};}function handleError(_0x59c1bf,_0xb22107){_0xb22107=_0xb22107||0x1f4;return function(_0x242342){logger['error'](_0x242342[_0x44b8('0x26')]);if(_0x242342['name']){delete _0x242342[_0x44b8('0x27')];}_0x59c1bf['status'](_0xb22107)['send'](_0x242342);};}exports['index']=function(_0x387293,_0x29b18d){var _0x44ce5a={},_0x1bd1be={},_0x38cd17={'count':0x0,'rows':[]};var _0xc3f667=_[_0x44b8('0x28')](db[_0x44b8('0x29')][_0x44b8('0x2a')],function(_0x28f918){return{'name':_0x28f918[_0x44b8('0x2b')],'type':_0x28f918[_0x44b8('0x2c')][_0x44b8('0x2d')]};});_0x1bd1be['model']=_[_0x44b8('0x28')](_0xc3f667,'name');_0x1bd1be[_0x44b8('0x2e')]=_[_0x44b8('0x2f')](_0x387293[_0x44b8('0x2e')]);_0x1bd1be[_0x44b8('0x30')]=_[_0x44b8('0x31')](_0x1bd1be['model'],_0x1bd1be[_0x44b8('0x2e')]);_0x44ce5a[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x1bd1be[_0x44b8('0x33')],qs[_0x44b8('0x34')](_0x387293['query'][_0x44b8('0x34')]));_0x44ce5a[_0x44b8('0x32')]=_0x44ce5a[_0x44b8('0x32')][_0x44b8('0x35')]?_0x44ce5a[_0x44b8('0x32')]:_0x1bd1be[_0x44b8('0x33')];if(!_0x387293[_0x44b8('0x2e')][_0x44b8('0x36')](_0x44b8('0x37'))){_0x44ce5a[_0x44b8('0x17')]=qs[_0x44b8('0x17')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x17')]);_0x44ce5a[_0x44b8('0x19')]=qs[_0x44b8('0x19')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x19')]);}_0x44ce5a[_0x44b8('0x38')]=qs[_0x44b8('0x39')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x39')]);_0x44ce5a[_0x44b8('0x3a')]=qs['filters'](_[_0x44b8('0x3b')](_0x387293[_0x44b8('0x2e')],_0x1bd1be['filters']),_0xc3f667);if(_0x387293[_0x44b8('0x2e')][_0x44b8('0x3c')]){_0x44ce5a[_0x44b8('0x3a')]=_[_0x44b8('0x3d')](_0x44ce5a['where'],{'$or':_[_0x44b8('0x28')](_0xc3f667,function(_0x11e4e3){if(_0x11e4e3[_0x44b8('0x2c')]!==_0x44b8('0x3e')){var _0x9cb2a={};_0x9cb2a[_0x11e4e3[_0x44b8('0x27')]]={'$like':'%'+_0x387293[_0x44b8('0x2e')][_0x44b8('0x3c')]+'%'};return _0x9cb2a;}})});}_0x44ce5a=_[_0x44b8('0x3d')]({},_0x44ce5a,_0x387293[_0x44b8('0x3f')]);var _0x1c9983={'where':_0x44ce5a[_0x44b8('0x3a')]};return db[_0x44b8('0x29')][_0x44b8('0x18')](_0x1c9983)[_0x44b8('0x20')](function(_0x29b43f){_0x38cd17['count']=_0x29b43f;if(_0x387293[_0x44b8('0x2e')][_0x44b8('0x40')]){_0x44ce5a[_0x44b8('0x41')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x44b8('0x42')](_0x44ce5a);})[_0x44b8('0x20')](function(_0x229cc9){_0x38cd17['rows']=_0x229cc9;return _0x38cd17;})[_0x44b8('0x20')](respondWithFilteredResult(_0x29b18d,_0x44ce5a))[_0x44b8('0x43')](handleError(_0x29b18d,null));};exports[_0x44b8('0x44')]=function(_0x334f86,_0xfd590a){var _0x499a3e={'raw':!![],'where':{'id':_0x334f86[_0x44b8('0x45')]['id']}},_0x5ae5f9={};_0x5ae5f9[_0x44b8('0x33')]=_[_0x44b8('0x2f')](db[_0x44b8('0x29')][_0x44b8('0x2a')]);_0x5ae5f9[_0x44b8('0x2e')]=_[_0x44b8('0x2f')](_0x334f86[_0x44b8('0x2e')]);_0x5ae5f9[_0x44b8('0x30')]=_[_0x44b8('0x31')](_0x5ae5f9[_0x44b8('0x33')],_0x5ae5f9[_0x44b8('0x2e')]);_0x499a3e[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x5ae5f9[_0x44b8('0x33')],qs[_0x44b8('0x34')](_0x334f86[_0x44b8('0x2e')][_0x44b8('0x34')]));_0x499a3e[_0x44b8('0x32')]=_0x499a3e['attributes']['length']?_0x499a3e[_0x44b8('0x32')]:_0x5ae5f9[_0x44b8('0x33')];if(_0x334f86[_0x44b8('0x2e')][_0x44b8('0x40')]){_0x499a3e[_0x44b8('0x41')]=[{'all':!![]}];}_0x499a3e=_[_0x44b8('0x3d')]({},_0x499a3e,_0x334f86[_0x44b8('0x3f')]);return db['AnalyticMetric'][_0x44b8('0x46')](_0x499a3e)['then'](handleEntityNotFound(_0xfd590a,null))[_0x44b8('0x20')](respondWithResult(_0xfd590a,null))[_0x44b8('0x43')](handleError(_0xfd590a,null));};exports[_0x44b8('0x47')]=function(_0x9207bf,_0x103d57){return db[_0x44b8('0x29')]['create'](_0x9207bf[_0x44b8('0x48')],{})[_0x44b8('0x20')](function(_0x10602c){var _0x25d266=_0x9207bf['user'][_0x44b8('0x22')]({'plain':!![]});if(!_0x25d266)throw new Error(_0x44b8('0x49'));if(_0x25d266[_0x44b8('0x4a')]===_0x44b8('0x4b')){var _0x44ec23=_0x10602c[_0x44b8('0x22')]({'plain':!![]});var _0x500bad=_0x44b8('0x23');return db[_0x44b8('0x4c')][_0x44b8('0x46')]({'where':{'name':_0x500bad,'userProfileId':_0x25d266[_0x44b8('0x4d')]},'raw':!![]})[_0x44b8('0x20')](function(_0x57d0e2){if(_0x57d0e2&&_0x57d0e2['autoAssociation']===0x0){return db[_0x44b8('0x24')]['create']({'name':_0x44ec23[_0x44b8('0x27')],'resourceId':_0x44ec23['id'],'type':_0x57d0e2['name'],'sectionId':_0x57d0e2['id']},{})[_0x44b8('0x20')](function(){return _0x10602c;});}else{return _0x10602c;}})[_0x44b8('0x43')](function(_0x1a29f6){logger[_0x44b8('0x4e')](_0x44b8('0x4f'),_0x1a29f6);throw _0x1a29f6;});}return _0x10602c;})[_0x44b8('0x20')](respondWithResult(_0x103d57,0xc9))[_0x44b8('0x43')](handleError(_0x103d57,null));};exports['update']=function(_0x3ad278,_0x37b2c2){if(_0x3ad278[_0x44b8('0x48')]['id']){delete _0x3ad278['body']['id'];}return db[_0x44b8('0x29')][_0x44b8('0x46')]({'where':{'id':_0x3ad278[_0x44b8('0x45')]['id']}})[_0x44b8('0x20')](handleEntityNotFound(_0x37b2c2,null))['then'](saveUpdates(_0x3ad278[_0x44b8('0x48')],null))[_0x44b8('0x20')](respondWithResult(_0x37b2c2,null))['catch'](handleError(_0x37b2c2,null));};exports[_0x44b8('0x21')]=function(_0x19f22b,_0x35136e){return db[_0x44b8('0x29')][_0x44b8('0x46')]({'where':{'id':_0x19f22b['params']['id']}})['then'](handleEntityNotFound(_0x35136e,null))[_0x44b8('0x20')](removeEntity(_0x35136e,null))[_0x44b8('0x43')](handleError(_0x35136e,null));}; \ No newline at end of file +var _0xa41a=['attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Metrics','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','save','update','destroy','then','error','stack','name','send','map','AnalyticMetric','type','key','model','query','keys','intersection','fields'];(function(_0x399d54,_0x58ee80){var _0x11e764=function(_0x2c50ef){while(--_0x2c50ef){_0x399d54['push'](_0x399d54['shift']());}};_0x11e764(++_0x58ee80);}(_0xa41a,0x6b));var _0xaa41=function(_0x1c3905,_0x96f071){_0x1c3905=_0x1c3905-0x0;var _0x5e7217=_0xa41a[_0x1c3905];return _0x5e7217;};'use strict';var emlformat=require(_0xaa41('0x0'));var rimraf=require(_0xaa41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa41('0x2'));var rp=require(_0xaa41('0x3'));var moment=require(_0xaa41('0x4'));var BPromise=require(_0xaa41('0x5'));var Mustache=require(_0xaa41('0x6'));var util=require(_0xaa41('0x7'));var path=require(_0xaa41('0x8'));var sox=require(_0xaa41('0x9'));var csv=require('to-csv');var ejs=require(_0xaa41('0xa'));var fs=require('fs');var fs_extra=require(_0xaa41('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa41('0xc'));var jsforce=require(_0xaa41('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaa41('0xe'));var querystring=require(_0xaa41('0xf'));var Papa=require(_0xaa41('0x10'));var Redis=require(_0xaa41('0x11'));var authService=require(_0xaa41('0x12'));var qs=require(_0xaa41('0x13'));var as=require(_0xaa41('0x14'));var hardwareService=require(_0xaa41('0x15'));var logger=require(_0xaa41('0x16'))('api');var utils=require(_0xaa41('0x17'));var config=require(_0xaa41('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d0a54,_0x518b5b){_0x518b5b=_0x518b5b||0xcc;return function(_0x19bd69){if(_0x19bd69){return _0x1d0a54[_0xaa41('0x19')](_0x518b5b);}return _0x1d0a54[_0xaa41('0x1a')](_0x518b5b)[_0xaa41('0x1b')]();};}function respondWithResult(_0x6f9ade,_0x4eaf81){_0x4eaf81=_0x4eaf81||0xc8;return function(_0x1e9d7f){if(_0x1e9d7f){return _0x6f9ade[_0xaa41('0x1a')](_0x4eaf81)[_0xaa41('0x1c')](_0x1e9d7f);}};}function respondWithFilteredResult(_0x1ef7d9,_0x2a6988){return function(_0x2005ae){if(_0x2005ae){var _0x1e1e02=typeof _0x2a6988['offset']===_0xaa41('0x1d')&&typeof _0x2a6988[_0xaa41('0x1e')]===_0xaa41('0x1d');var _0x391b01=_0x2005ae[_0xaa41('0x1f')];var _0xd20ddf=_0x1e1e02?0x0:_0x2a6988[_0xaa41('0x20')];var _0x46e6d3=_0x1e1e02?_0x2005ae[_0xaa41('0x1f')]:_0x2a6988['offset']+_0x2a6988['limit'];var _0x1f502a;if(_0x46e6d3>=_0x391b01){_0x46e6d3=_0x391b01;_0x1f502a=0xc8;}else{_0x1f502a=0xce;}_0x1ef7d9[_0xaa41('0x1a')](_0x1f502a);return _0x1ef7d9[_0xaa41('0x21')]('Content-Range',_0xd20ddf+'-'+_0x46e6d3+'/'+_0x391b01)[_0xaa41('0x1c')](_0x2005ae);}return null;};}function patchUpdates(_0x1f692b){return function(_0x4e768e){try{jsonpatch['apply'](_0x4e768e,_0x1f692b,!![]);}catch(_0x1b1910){return BPromise['reject'](_0x1b1910);}return _0x4e768e[_0xaa41('0x22')]();};}function saveUpdates(_0x209c83,_0x3e2175){return function(_0x1f27f3){if(_0x1f27f3){return _0x1f27f3[_0xaa41('0x23')](_0x209c83)['then'](function(_0x43c430){return _0x43c430;});}return null;};}function removeEntity(_0x43a85c,_0x448a21){return function(_0x21f596){if(_0x21f596){return _0x21f596[_0xaa41('0x24')]()[_0xaa41('0x25')](function(){var _0x5c3074=_0x21f596['get']({'plain':!![]});var _0x16aec5='Metrics';return db['UserProfileResource'][_0xaa41('0x24')]({'where':{'type':_0x16aec5,'resourceId':_0x5c3074['id']}})['then'](function(){return _0x21f596;});})['then'](function(){_0x43a85c[_0xaa41('0x1a')](0xcc)[_0xaa41('0x1b')]();});}};}function handleEntityNotFound(_0x392214,_0x632fd2){return function(_0x3f5272){if(!_0x3f5272){_0x392214[_0xaa41('0x19')](0x194);}return _0x3f5272;};}function handleError(_0x57ef96,_0x30a174){_0x30a174=_0x30a174||0x1f4;return function(_0x1f0275){logger[_0xaa41('0x26')](_0x1f0275[_0xaa41('0x27')]);if(_0x1f0275[_0xaa41('0x28')]){delete _0x1f0275[_0xaa41('0x28')];}_0x57ef96[_0xaa41('0x1a')](_0x30a174)[_0xaa41('0x29')](_0x1f0275);};}exports['index']=function(_0x377add,_0x48b48b){var _0x5dad80={},_0x714537={},_0x1176bd={'count':0x0,'rows':[]};var _0x534a85=_[_0xaa41('0x2a')](db[_0xaa41('0x2b')]['rawAttributes'],function(_0x5022fb){return{'name':_0x5022fb['fieldName'],'type':_0x5022fb[_0xaa41('0x2c')][_0xaa41('0x2d')]};});_0x714537[_0xaa41('0x2e')]=_[_0xaa41('0x2a')](_0x534a85,'name');_0x714537[_0xaa41('0x2f')]=_[_0xaa41('0x30')](_0x377add[_0xaa41('0x2f')]);_0x714537['filters']=_[_0xaa41('0x31')](_0x714537[_0xaa41('0x2e')],_0x714537[_0xaa41('0x2f')]);_0x5dad80['attributes']=_[_0xaa41('0x31')](_0x714537[_0xaa41('0x2e')],qs['fields'](_0x377add[_0xaa41('0x2f')][_0xaa41('0x32')]));_0x5dad80[_0xaa41('0x33')]=_0x5dad80['attributes'][_0xaa41('0x34')]?_0x5dad80['attributes']:_0x714537[_0xaa41('0x2e')];if(!_0x377add[_0xaa41('0x2f')][_0xaa41('0x35')]('nolimit')){_0x5dad80['limit']=qs['limit'](_0x377add[_0xaa41('0x2f')][_0xaa41('0x1e')]);_0x5dad80[_0xaa41('0x20')]=qs[_0xaa41('0x20')](_0x377add['query']['offset']);}_0x5dad80[_0xaa41('0x36')]=qs[_0xaa41('0x37')](_0x377add[_0xaa41('0x2f')][_0xaa41('0x37')]);_0x5dad80[_0xaa41('0x38')]=qs[_0xaa41('0x39')](_[_0xaa41('0x3a')](_0x377add['query'],_0x714537[_0xaa41('0x39')]),_0x534a85);if(_0x377add[_0xaa41('0x2f')][_0xaa41('0x3b')]){_0x5dad80[_0xaa41('0x38')]=_['merge'](_0x5dad80['where'],{'$or':_[_0xaa41('0x2a')](_0x534a85,function(_0x275fa3){if(_0x275fa3['type']!==_0xaa41('0x3c')){var _0x563687={};_0x563687[_0x275fa3[_0xaa41('0x28')]]={'$like':'%'+_0x377add[_0xaa41('0x2f')][_0xaa41('0x3b')]+'%'};return _0x563687;}})});}_0x5dad80=_[_0xaa41('0x3d')]({},_0x5dad80,_0x377add[_0xaa41('0x3e')]);var _0x12ba1a={'where':_0x5dad80[_0xaa41('0x38')]};return db[_0xaa41('0x2b')]['count'](_0x12ba1a)[_0xaa41('0x25')](function(_0x2abf39){_0x1176bd[_0xaa41('0x1f')]=_0x2abf39;if(_0x377add[_0xaa41('0x2f')][_0xaa41('0x3f')]){_0x5dad80[_0xaa41('0x40')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x5dad80);})[_0xaa41('0x25')](function(_0x4f9086){_0x1176bd[_0xaa41('0x41')]=_0x4f9086;return _0x1176bd;})[_0xaa41('0x25')](respondWithFilteredResult(_0x48b48b,_0x5dad80))[_0xaa41('0x42')](handleError(_0x48b48b,null));};exports[_0xaa41('0x43')]=function(_0x2aac10,_0x10bf09){var _0x2db8d6={'raw':!![],'where':{'id':_0x2aac10[_0xaa41('0x44')]['id']}},_0x5ee74c={};_0x5ee74c['model']=_['keys'](db[_0xaa41('0x2b')]['rawAttributes']);_0x5ee74c['query']=_['keys'](_0x2aac10[_0xaa41('0x2f')]);_0x5ee74c['filters']=_[_0xaa41('0x31')](_0x5ee74c[_0xaa41('0x2e')],_0x5ee74c['query']);_0x2db8d6['attributes']=_[_0xaa41('0x31')](_0x5ee74c[_0xaa41('0x2e')],qs[_0xaa41('0x32')](_0x2aac10[_0xaa41('0x2f')][_0xaa41('0x32')]));_0x2db8d6[_0xaa41('0x33')]=_0x2db8d6[_0xaa41('0x33')][_0xaa41('0x34')]?_0x2db8d6[_0xaa41('0x33')]:_0x5ee74c['model'];if(_0x2aac10[_0xaa41('0x2f')][_0xaa41('0x3f')]){_0x2db8d6[_0xaa41('0x40')]=[{'all':!![]}];}_0x2db8d6=_[_0xaa41('0x3d')]({},_0x2db8d6,_0x2aac10[_0xaa41('0x3e')]);return db[_0xaa41('0x2b')]['find'](_0x2db8d6)[_0xaa41('0x25')](handleEntityNotFound(_0x10bf09,null))[_0xaa41('0x25')](respondWithResult(_0x10bf09,null))[_0xaa41('0x42')](handleError(_0x10bf09,null));};exports[_0xaa41('0x45')]=function(_0x57d1f6,_0x23bc61){return db['AnalyticMetric']['create'](_0x57d1f6[_0xaa41('0x46')],{})[_0xaa41('0x25')](function(_0x3e16ef){var _0x4ca114=_0x57d1f6[_0xaa41('0x47')][_0xaa41('0x48')]({'plain':!![]});if(!_0x4ca114)throw new Error(_0xaa41('0x49'));if(_0x4ca114['role']===_0xaa41('0x47')){var _0x3c4f24=_0x3e16ef[_0xaa41('0x48')]({'plain':!![]});var _0x1378f9=_0xaa41('0x4a');return db[_0xaa41('0x4b')][_0xaa41('0x4c')]({'where':{'name':_0x1378f9,'userProfileId':_0x4ca114[_0xaa41('0x4d')]},'raw':!![]})['then'](function(_0x9f0a81){if(_0x9f0a81&&_0x9f0a81['autoAssociation']===0x0){return db['UserProfileResource'][_0xaa41('0x45')]({'name':_0x3c4f24[_0xaa41('0x28')],'resourceId':_0x3c4f24['id'],'type':_0x9f0a81[_0xaa41('0x28')],'sectionId':_0x9f0a81['id']},{})[_0xaa41('0x25')](function(){return _0x3e16ef;});}else{return _0x3e16ef;}})[_0xaa41('0x42')](function(_0x288db3){logger[_0xaa41('0x26')](_0xaa41('0x4e'),_0x288db3);throw _0x288db3;});}return _0x3e16ef;})['then'](respondWithResult(_0x23bc61,0xc9))[_0xaa41('0x42')](handleError(_0x23bc61,null));};exports[_0xaa41('0x23')]=function(_0x1d518f,_0x4f9e92){if(_0x1d518f[_0xaa41('0x46')]['id']){delete _0x1d518f[_0xaa41('0x46')]['id'];}return db['AnalyticMetric'][_0xaa41('0x4c')]({'where':{'id':_0x1d518f[_0xaa41('0x44')]['id']}})[_0xaa41('0x25')](handleEntityNotFound(_0x4f9e92,null))['then'](saveUpdates(_0x1d518f[_0xaa41('0x46')],null))[_0xaa41('0x25')](respondWithResult(_0x4f9e92,null))['catch'](handleError(_0x4f9e92,null));};exports['destroy']=function(_0x3745ed,_0x3cd14f){return db[_0xaa41('0x2b')]['find']({'where':{'id':_0x3745ed[_0xaa41('0x44')]['id']}})[_0xaa41('0x25')](handleEntityNotFound(_0x3cd14f,null))[_0xaa41('0x25')](removeEntity(_0x3cd14f,null))[_0xaa41('0x42')](handleError(_0x3cd14f,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index dfddd18..12b3212 100644 --- a/server/api/analyticMetric/analyticMetric.model.js +++ b/server/api/analyticMetric/analyticMetric.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x723e=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics'];(function(_0x4f32de,_0x5bd4a){var _0x149821=function(_0x205885){while(--_0x205885){_0x4f32de['push'](_0x4f32de['shift']());}};_0x149821(++_0x5bd4a);}(_0x723e,0x179));var _0xe723=function(_0x3e6729,_0x16d4af){_0x3e6729=_0x3e6729-0x0;var _0x535bcd=_0x723e[_0x3e6729];return _0x535bcd;};'use strict';var _=require('lodash');var util=require(_0xe723('0x0'));var logger=require(_0xe723('0x1'))(_0xe723('0x2'));var moment=require(_0xe723('0x3'));var BPromise=require(_0xe723('0x4'));var rp=require(_0xe723('0x5'));var fs=require('fs');var path=require(_0xe723('0x6'));var rimraf=require(_0xe723('0x7'));var config=require(_0xe723('0x8'));var attributes=require(_0xe723('0x9'));module['exports']=function(_0x32d689,_0x20c13b){return _0x32d689[_0xe723('0xa')](_0xe723('0xb'),attributes,{'tableName':_0xe723('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x96aa=['request-promise','path','../../config/environment','./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics','lodash','util','api','moment','bluebird'];(function(_0x2559ad,_0x56e4ac){var _0x1c2bbd=function(_0x26d9b6){while(--_0x26d9b6){_0x2559ad['push'](_0x2559ad['shift']());}};_0x1c2bbd(++_0x56e4ac);}(_0x96aa,0x67));var _0xa96a=function(_0x582484,_0xf698b6){_0x582484=_0x582484-0x0;var _0x490338=_0x96aa[_0x582484];return _0x490338;};'use strict';var _=require(_0xa96a('0x0'));var util=require(_0xa96a('0x1'));var logger=require('../../config/logger')(_0xa96a('0x2'));var moment=require(_0xa96a('0x3'));var BPromise=require(_0xa96a('0x4'));var rp=require(_0xa96a('0x5'));var fs=require('fs');var path=require(_0xa96a('0x6'));var rimraf=require('rimraf');var config=require(_0xa96a('0x7'));var attributes=require(_0xa96a('0x8'));module['exports']=function(_0x464684,_0x2e9a41){return _0x464684[_0xa96a('0x9')](_0xa96a('0xa'),attributes,{'tableName':_0xa96a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index 80ca62b..2f44cf8 100644 --- a/server/api/analyticMetric/analyticMetric.rpc.js +++ b/server/api/analyticMetric/analyticMetric.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x242f=['AnalyticMetric,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0x3aa17f,_0xfbe06d){var _0x205e5d=function(_0x154522){while(--_0x154522){_0x3aa17f['push'](_0x3aa17f['shift']());}};_0x205e5d(++_0xfbe06d);}(_0x242f,0x7e));var _0xf242=function(_0x2c21fa,_0x5f0a10){_0x2c21fa=_0x2c21fa-0x0;var _0x5aafc6=_0x242f[_0x2c21fa];return _0x5aafc6;};'use strict';var _=require(_0xf242('0x0'));var util=require(_0xf242('0x1'));var moment=require(_0xf242('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf242('0x3'));var db=require(_0xf242('0x4'))['db'];var utils=require(_0xf242('0x5'));var logger=require(_0xf242('0x6'))(_0xf242('0x7'));var config=require(_0xf242('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf242('0x9')][_0xf242('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x838f7f,_0x11ecea,_0x418967){return new BPromise(function(_0x4848a5,_0x11d344){return client[_0xf242('0xb')](_0x838f7f,_0x418967)[_0xf242('0xc')](function(_0x68d59f){logger[_0xf242('0xd')](_0xf242('0xe'),_0x11ecea,_0xf242('0xf'));logger['debug']('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x11ecea,_0xf242('0xf'),JSON['stringify'](_0x68d59f));if(_0x68d59f['error']){if(_0x68d59f[_0xf242('0x10')][_0xf242('0x11')]===0x1f4){logger[_0xf242('0x10')](_0xf242('0xe'),_0x11ecea,_0x68d59f[_0xf242('0x10')][_0xf242('0x12')]);return _0x11d344(_0x68d59f[_0xf242('0x10')][_0xf242('0x12')]);}logger[_0xf242('0x10')](_0xf242('0xe'),_0x11ecea,_0x68d59f[_0xf242('0x10')][_0xf242('0x12')]);return _0x4848a5(_0x68d59f['error'][_0xf242('0x12')]);}else{logger[_0xf242('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x11ecea,_0xf242('0xf'));_0x4848a5(_0x68d59f[_0xf242('0x13')][_0xf242('0x12')]);}})['catch'](function(_0x4d9bd3){logger[_0xf242('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x11ecea,_0x4d9bd3);_0x11d344(_0x4d9bd3);});});} \ No newline at end of file +var _0x5330=['request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s'];(function(_0x3227c1,_0x4318c5){var _0x31fd48=function(_0x5c5850){while(--_0x5c5850){_0x3227c1['push'](_0x3227c1['shift']());}};_0x31fd48(++_0x4318c5);}(_0x5330,0xe4));var _0x0533=function(_0x3215fc,_0x1821c2){_0x3215fc=_0x3215fc-0x0;var _0x21d34b=_0x5330[_0x3215fc];return _0x21d34b;};'use strict';var _=require(_0x0533('0x0'));var util=require('util');var moment=require(_0x0533('0x1'));var BPromise=require(_0x0533('0x2'));var rs=require(_0x0533('0x3'));var fs=require('fs');var Redis=require(_0x0533('0x4'));var db=require(_0x0533('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0533('0x6'))(_0x0533('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0533('0x8')][_0x0533('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ae90b,_0x1de94a,_0x21b029){return new BPromise(function(_0x20ba43,_0x1e7428){return client[_0x0533('0xa')](_0x1ae90b,_0x21b029)[_0x0533('0xb')](function(_0x1b38f7){logger[_0x0533('0xc')](_0x0533('0xd'),_0x1de94a,_0x0533('0xe'));logger[_0x0533('0xf')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x1de94a,'request\x20sent',JSON[_0x0533('0x10')](_0x1b38f7));if(_0x1b38f7[_0x0533('0x11')]){if(_0x1b38f7[_0x0533('0x11')][_0x0533('0x12')]===0x1f4){logger[_0x0533('0x11')](_0x0533('0xd'),_0x1de94a,_0x1b38f7[_0x0533('0x11')][_0x0533('0x13')]);return _0x1e7428(_0x1b38f7['error'][_0x0533('0x13')]);}logger[_0x0533('0x11')](_0x0533('0xd'),_0x1de94a,_0x1b38f7[_0x0533('0x11')][_0x0533('0x13')]);return _0x20ba43(_0x1b38f7[_0x0533('0x11')][_0x0533('0x13')]);}else{logger['info'](_0x0533('0xd'),_0x1de94a,_0x0533('0xe'));_0x20ba43(_0x1b38f7[_0x0533('0x14')][_0x0533('0x13')]);}})[_0x0533('0x15')](function(_0x4169b5){logger[_0x0533('0x11')](_0x0533('0xd'),_0x1de94a,_0x4169b5);_0x1e7428(_0x4169b5);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index a67a301..73779d6 100644 --- a/server/api/analyticMetric/index.js +++ b/server/api/analyticMetric/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4317=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','index','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','util','path'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0x4317,0x7c));var _0x7431=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x4317[_0x432682];return _0x463d05;};'use strict';var multer=require('multer');var util=require(_0x7431('0x0'));var path=require(_0x7431('0x1'));var timeout=require(_0x7431('0x2'));var express=require('express');var router=express[_0x7431('0x3')]();var fs_extra=require(_0x7431('0x4'));var auth=require(_0x7431('0x5'));var interaction=require(_0x7431('0x6'));var config=require(_0x7431('0x7'));var controller=require(_0x7431('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x7431('0x9')]);router[_0x7431('0xa')](_0x7431('0xb'),auth[_0x7431('0xc')](),controller[_0x7431('0xd')]);router[_0x7431('0xe')]('/',auth[_0x7431('0xc')](),controller[_0x7431('0xf')]);router[_0x7431('0x10')](_0x7431('0xb'),auth[_0x7431('0xc')](),controller[_0x7431('0x11')]);router[_0x7431('0x12')](_0x7431('0xb'),auth[_0x7431('0xc')](),controller[_0x7431('0x13')]);module[_0x7431('0x14')]=router; \ No newline at end of file +var _0x6596=['isAuthenticated','index','/:id','post','create','put','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get'];(function(_0xfc5024,_0x41b609){var _0x5317ef=function(_0x58dccf){while(--_0x58dccf){_0xfc5024['push'](_0xfc5024['shift']());}};_0x5317ef(++_0x41b609);}(_0x6596,0x1d3));var _0x6659=function(_0x2df2bb,_0x4768b9){_0x2df2bb=_0x2df2bb-0x0;var _0x1afd80=_0x6596[_0x2df2bb];return _0x1afd80;};'use strict';var multer=require(_0x6659('0x0'));var util=require(_0x6659('0x1'));var path=require('path');var timeout=require(_0x6659('0x2'));var express=require(_0x6659('0x3'));var router=express[_0x6659('0x4')]();var fs_extra=require(_0x6659('0x5'));var auth=require(_0x6659('0x6'));var interaction=require(_0x6659('0x7'));var config=require('../../config/environment');var controller=require('./analyticMetric.controller');router[_0x6659('0x8')]('/',auth[_0x6659('0x9')](),controller[_0x6659('0xa')]);router[_0x6659('0x8')](_0x6659('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x6659('0xc')]('/',auth[_0x6659('0x9')](),controller[_0x6659('0xd')]);router[_0x6659('0xe')](_0x6659('0xb'),auth[_0x6659('0x9')](),controller['update']);router[_0x6659('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x6659('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 1fcbf04..fbf6eea 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.attributes.js +++ b/server/api/analyticTreeReport/analyticTreeReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x25f0=['exports'];(function(_0x3ec412,_0x195122){var _0x29479c=function(_0x3e7517){while(--_0x3e7517){_0x3ec412['push'](_0x3ec412['shift']());}};_0x29479c(++_0x195122);}(_0x25f0,0xf0));var _0x025f=function(_0x24dd47,_0x314303){_0x24dd47=_0x24dd47-0x0;var _0x4ef431=_0x25f0[_0x24dd47];return _0x4ef431;};'use strict';var Sequelize=require('sequelize');module[_0x025f('0x0')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file +var _0xa433=['TEXT','sequelize','exports'];(function(_0x4d296b,_0x46af29){var _0x67ce0c=function(_0x13239c){while(--_0x13239c){_0x4d296b['push'](_0x4d296b['shift']());}};_0x67ce0c(++_0x46af29);}(_0xa433,0x1b1));var _0x3a43=function(_0x49efd6,_0x4273a7){_0x49efd6=_0x49efd6-0x0;var _0x34a576=_0xa433[_0x49efd6];return _0x34a576;};'use strict';var Sequelize=require(_0x3a43('0x0'));module[_0x3a43('0x1')]={'tree':{'type':Sequelize[_0x3a43('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index a733325..76fa58e 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.controller.js +++ b/server/api/analyticTreeReport/analyticTreeReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe83e=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','undefined','limit','count','offset','status','set','Content-Range','json','apply','save','update','then','destroy','stack','name','send','index','map','AnalyticTreeReport','fieldName','type','model','keys','query','intersection','fields','attributes','length','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','show','params','rawAttributes','merge','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis'];(function(_0x332741,_0x2ab38c){var _0x4a803a=function(_0x2c596f){while(--_0x2c596f){_0x332741['push'](_0x332741['shift']());}};_0x4a803a(++_0x2ab38c);}(_0xe83e,0x19a));var _0xee83=function(_0x2da568,_0x5e62e6){_0x2da568=_0x2da568-0x0;var _0x7125e0=_0xe83e[_0x2da568];return _0x7125e0;};'use strict';var emlformat=require(_0xee83('0x0'));var rimraf=require(_0xee83('0x1'));var zipdir=require(_0xee83('0x2'));var jsonpatch=require(_0xee83('0x3'));var rp=require(_0xee83('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xee83('0x5'));var csv=require(_0xee83('0x6'));var ejs=require(_0xee83('0x7'));var fs=require('fs');var fs_extra=require(_0xee83('0x8'));var _=require(_0xee83('0x9'));var squel=require(_0xee83('0xa'));var crypto=require(_0xee83('0xb'));var jsforce=require(_0xee83('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xee83('0x6'));var querystring=require(_0xee83('0xd'));var Papa=require(_0xee83('0xe'));var Redis=require(_0xee83('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xee83('0x10'));var as=require(_0xee83('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xee83('0x12'))('api');var utils=require(_0xee83('0x13'));var config=require(_0xee83('0x14'));var licenseUtil=require(_0xee83('0x15'));var db=require(_0xee83('0x16'))['db'];function respondWithStatusCode(_0xc9e8d0,_0x40ace5){_0x40ace5=_0x40ace5||0xcc;return function(_0x1c420f){if(_0x1c420f){return _0xc9e8d0[_0xee83('0x17')](_0x40ace5);}return _0xc9e8d0['status'](_0x40ace5)['end']();};}function respondWithResult(_0x54c5c6,_0x3c6478){_0x3c6478=_0x3c6478||0xc8;return function(_0x3dd199){if(_0x3dd199){return _0x54c5c6['status'](_0x3c6478)['json'](_0x3dd199);}};}function respondWithFilteredResult(_0x240fb7,_0xd265e3){return function(_0x4bd344){if(_0x4bd344){var _0x2b5b21=typeof _0xd265e3['offset']===_0xee83('0x18')&&typeof _0xd265e3[_0xee83('0x19')]===_0xee83('0x18');var _0x4651db=_0x4bd344[_0xee83('0x1a')];var _0xfa6ddb=_0x2b5b21?0x0:_0xd265e3[_0xee83('0x1b')];var _0x52c103=_0x2b5b21?_0x4bd344['count']:_0xd265e3[_0xee83('0x1b')]+_0xd265e3[_0xee83('0x19')];var _0x3d6dd4;if(_0x52c103>=_0x4651db){_0x52c103=_0x4651db;_0x3d6dd4=0xc8;}else{_0x3d6dd4=0xce;}_0x240fb7[_0xee83('0x1c')](_0x3d6dd4);return _0x240fb7[_0xee83('0x1d')](_0xee83('0x1e'),_0xfa6ddb+'-'+_0x52c103+'/'+_0x4651db)[_0xee83('0x1f')](_0x4bd344);}return null;};}function patchUpdates(_0x47aa8a){return function(_0x42928e){try{jsonpatch[_0xee83('0x20')](_0x42928e,_0x47aa8a,!![]);}catch(_0x53b5ac){return BPromise['reject'](_0x53b5ac);}return _0x42928e[_0xee83('0x21')]();};}function saveUpdates(_0xc652a9,_0x287620){return function(_0x22b590){if(_0x22b590){return _0x22b590[_0xee83('0x22')](_0xc652a9)[_0xee83('0x23')](function(_0x243d7d){return _0x243d7d;});}return null;};}function removeEntity(_0x4ca350,_0x4c4298){return function(_0x30f846){if(_0x30f846){return _0x30f846[_0xee83('0x24')]()[_0xee83('0x23')](function(){_0x4ca350[_0xee83('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d8471,_0x8c02b5){return function(_0x376c2e){if(!_0x376c2e){_0x3d8471[_0xee83('0x17')](0x194);}return _0x376c2e;};}function handleError(_0x5c2399,_0x365bc8){_0x365bc8=_0x365bc8||0x1f4;return function(_0x166f3b){logger['error'](_0x166f3b[_0xee83('0x25')]);if(_0x166f3b[_0xee83('0x26')]){delete _0x166f3b['name'];}_0x5c2399[_0xee83('0x1c')](_0x365bc8)[_0xee83('0x27')](_0x166f3b);};}exports[_0xee83('0x28')]=function(_0x78cb3b,_0x542c60){var _0x5288f6={},_0x1bf9bc={},_0xd05898={'count':0x0,'rows':[]};var _0x51df24=_[_0xee83('0x29')](db[_0xee83('0x2a')]['rawAttributes'],function(_0x585e95){return{'name':_0x585e95[_0xee83('0x2b')],'type':_0x585e95[_0xee83('0x2c')]['key']};});_0x1bf9bc[_0xee83('0x2d')]=_['map'](_0x51df24,'name');_0x1bf9bc['query']=_[_0xee83('0x2e')](_0x78cb3b[_0xee83('0x2f')]);_0x1bf9bc['filters']=_[_0xee83('0x30')](_0x1bf9bc[_0xee83('0x2d')],_0x1bf9bc[_0xee83('0x2f')]);_0x5288f6['attributes']=_[_0xee83('0x30')](_0x1bf9bc[_0xee83('0x2d')],qs[_0xee83('0x31')](_0x78cb3b[_0xee83('0x2f')][_0xee83('0x31')]));_0x5288f6['attributes']=_0x5288f6[_0xee83('0x32')][_0xee83('0x33')]?_0x5288f6['attributes']:_0x1bf9bc['model'];if(!_0x78cb3b[_0xee83('0x2f')]['hasOwnProperty'](_0xee83('0x34'))){_0x5288f6[_0xee83('0x19')]=qs[_0xee83('0x19')](_0x78cb3b[_0xee83('0x2f')][_0xee83('0x19')]);_0x5288f6[_0xee83('0x1b')]=qs[_0xee83('0x1b')](_0x78cb3b['query'][_0xee83('0x1b')]);}_0x5288f6[_0xee83('0x35')]=qs[_0xee83('0x36')](_0x78cb3b['query'][_0xee83('0x36')]);_0x5288f6['where']=qs[_0xee83('0x37')](_[_0xee83('0x38')](_0x78cb3b['query'],_0x1bf9bc[_0xee83('0x37')]),_0x51df24);if(_0x78cb3b[_0xee83('0x2f')][_0xee83('0x39')]){_0x5288f6[_0xee83('0x3a')]=_['merge'](_0x5288f6[_0xee83('0x3a')],{'$or':_[_0xee83('0x29')](_0x51df24,function(_0x4c8ff8){if(_0x4c8ff8[_0xee83('0x2c')]!==_0xee83('0x3b')){var _0x1221d6={};_0x1221d6[_0x4c8ff8['name']]={'$like':'%'+_0x78cb3b[_0xee83('0x2f')]['filter']+'%'};return _0x1221d6;}})});}_0x5288f6=_['merge']({},_0x5288f6,_0x78cb3b[_0xee83('0x3c')]);var _0x38398a={'where':_0x5288f6[_0xee83('0x3a')]};return db[_0xee83('0x2a')][_0xee83('0x1a')](_0x38398a)[_0xee83('0x23')](function(_0x53bc36){_0xd05898[_0xee83('0x1a')]=_0x53bc36;if(_0x78cb3b[_0xee83('0x2f')][_0xee83('0x3d')]){_0x5288f6[_0xee83('0x3e')]=[{'all':!![]}];}return db[_0xee83('0x2a')][_0xee83('0x3f')](_0x5288f6);})[_0xee83('0x23')](function(_0x4d0be0){_0xd05898['rows']=_0x4d0be0;return _0xd05898;})[_0xee83('0x23')](respondWithFilteredResult(_0x542c60,_0x5288f6))['catch'](handleError(_0x542c60,null));};exports[_0xee83('0x40')]=function(_0x3782ce,_0x19e9ce){var _0xa157ff={'raw':!![],'where':{'id':_0x3782ce[_0xee83('0x41')]['id']}},_0x54548a={};_0x54548a[_0xee83('0x2d')]=_[_0xee83('0x2e')](db[_0xee83('0x2a')][_0xee83('0x42')]);_0x54548a[_0xee83('0x2f')]=_[_0xee83('0x2e')](_0x3782ce[_0xee83('0x2f')]);_0x54548a['filters']=_['intersection'](_0x54548a[_0xee83('0x2d')],_0x54548a[_0xee83('0x2f')]);_0xa157ff[_0xee83('0x32')]=_['intersection'](_0x54548a[_0xee83('0x2d')],qs['fields'](_0x3782ce[_0xee83('0x2f')][_0xee83('0x31')]));_0xa157ff['attributes']=_0xa157ff[_0xee83('0x32')][_0xee83('0x33')]?_0xa157ff['attributes']:_0x54548a[_0xee83('0x2d')];if(_0x3782ce['query'][_0xee83('0x3d')]){_0xa157ff[_0xee83('0x3e')]=[{'all':!![]}];}_0xa157ff=_[_0xee83('0x43')]({},_0xa157ff,_0x3782ce[_0xee83('0x3c')]);return db[_0xee83('0x2a')][_0xee83('0x44')](_0xa157ff)['then'](handleEntityNotFound(_0x19e9ce,null))[_0xee83('0x23')](respondWithResult(_0x19e9ce,null))[_0xee83('0x45')](handleError(_0x19e9ce,null));};exports['create']=function(_0x4a10c9,_0x4d9f2b){return db[_0xee83('0x2a')]['create'](_0x4a10c9[_0xee83('0x46')],{})[_0xee83('0x23')](respondWithResult(_0x4d9f2b,0xc9))[_0xee83('0x45')](handleError(_0x4d9f2b,null));};exports['update']=function(_0x58e17f,_0x36ef8e){if(_0x58e17f[_0xee83('0x46')]['id']){delete _0x58e17f[_0xee83('0x46')]['id'];}return db['AnalyticTreeReport'][_0xee83('0x44')]({'where':{'id':_0x58e17f[_0xee83('0x41')]['id']}})[_0xee83('0x23')](handleEntityNotFound(_0x36ef8e,null))[_0xee83('0x23')](saveUpdates(_0x58e17f[_0xee83('0x46')],null))[_0xee83('0x23')](respondWithResult(_0x36ef8e,null))[_0xee83('0x45')](handleError(_0x36ef8e,null));};exports['destroy']=function(_0x4bcbed,_0x54733f){return db[_0xee83('0x2a')][_0xee83('0x44')]({'where':{'id':_0x4bcbed['params']['id']}})[_0xee83('0x23')](handleEntityNotFound(_0x54733f,null))[_0xee83('0x23')](removeEntity(_0x54733f,null))[_0xee83('0x45')](handleError(_0x54733f,null));}; \ No newline at end of file +var _0xf10c=['sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','sort','where','pick','merge','VIRTUAL','filter','options','AnalyticTreeReport','includeAll','include','findAll','rows','catch','params','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x383e64,_0x2c3425){var _0x12725d=function(_0x186a04){while(--_0x186a04){_0x383e64['push'](_0x383e64['shift']());}};_0x12725d(++_0x2c3425);}(_0xf10c,0x1f4));var _0xcf10=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf10c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xcf10('0x0'));var rimraf=require(_0xcf10('0x1'));var zipdir=require(_0xcf10('0x2'));var jsonpatch=require(_0xcf10('0x3'));var rp=require('request-promise');var moment=require(_0xcf10('0x4'));var BPromise=require(_0xcf10('0x5'));var Mustache=require('mustache');var util=require(_0xcf10('0x6'));var path=require('path');var sox=require(_0xcf10('0x7'));var csv=require(_0xcf10('0x8'));var ejs=require(_0xcf10('0x9'));var fs=require('fs');var fs_extra=require(_0xcf10('0xa'));var _=require(_0xcf10('0xb'));var squel=require('squel');var crypto=require(_0xcf10('0xc'));var jsforce=require(_0xcf10('0xd'));var deskjs=require(_0xcf10('0xe'));var toCsv=require('to-csv');var querystring=require(_0xcf10('0xf'));var Papa=require(_0xcf10('0x10'));var Redis=require(_0xcf10('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xcf10('0x12'));var as=require(_0xcf10('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xcf10('0x14'));var utils=require(_0xcf10('0x15'));var config=require(_0xcf10('0x16'));var licenseUtil=require(_0xcf10('0x17'));var db=require(_0xcf10('0x18'))['db'];function respondWithStatusCode(_0x3a4f5b,_0x1a73a1){_0x1a73a1=_0x1a73a1||0xcc;return function(_0xf4906d){if(_0xf4906d){return _0x3a4f5b[_0xcf10('0x19')](_0x1a73a1);}return _0x3a4f5b[_0xcf10('0x1a')](_0x1a73a1)[_0xcf10('0x1b')]();};}function respondWithResult(_0xfb8ee6,_0x1fcf37){_0x1fcf37=_0x1fcf37||0xc8;return function(_0x4c569d){if(_0x4c569d){return _0xfb8ee6['status'](_0x1fcf37)[_0xcf10('0x1c')](_0x4c569d);}};}function respondWithFilteredResult(_0x204166,_0x52fe8b){return function(_0x4f421d){if(_0x4f421d){var _0x51c4f5=typeof _0x52fe8b['offset']===_0xcf10('0x1d')&&typeof _0x52fe8b[_0xcf10('0x1e')]===_0xcf10('0x1d');var _0x26929a=_0x4f421d[_0xcf10('0x1f')];var _0x1fd76b=_0x51c4f5?0x0:_0x52fe8b[_0xcf10('0x20')];var _0x27ea53=_0x51c4f5?_0x4f421d[_0xcf10('0x1f')]:_0x52fe8b['offset']+_0x52fe8b[_0xcf10('0x1e')];var _0x3b041b;if(_0x27ea53>=_0x26929a){_0x27ea53=_0x26929a;_0x3b041b=0xc8;}else{_0x3b041b=0xce;}_0x204166['status'](_0x3b041b);return _0x204166[_0xcf10('0x21')](_0xcf10('0x22'),_0x1fd76b+'-'+_0x27ea53+'/'+_0x26929a)['json'](_0x4f421d);}return null;};}function patchUpdates(_0x442daa){return function(_0x1aa9e1){try{jsonpatch[_0xcf10('0x23')](_0x1aa9e1,_0x442daa,!![]);}catch(_0x2e90ad){return BPromise[_0xcf10('0x24')](_0x2e90ad);}return _0x1aa9e1[_0xcf10('0x25')]();};}function saveUpdates(_0xf2b27e,_0x4c4756){return function(_0x229956){if(_0x229956){return _0x229956[_0xcf10('0x26')](_0xf2b27e)['then'](function(_0x1c9c24){return _0x1c9c24;});}return null;};}function removeEntity(_0x16cd14,_0x1ea74c){return function(_0x1bafd4){if(_0x1bafd4){return _0x1bafd4[_0xcf10('0x27')]()[_0xcf10('0x28')](function(){_0x16cd14['status'](0xcc)[_0xcf10('0x1b')]();});}};}function handleEntityNotFound(_0x5de3ef,_0x32a371){return function(_0x2e1ac8){if(!_0x2e1ac8){_0x5de3ef['sendStatus'](0x194);}return _0x2e1ac8;};}function handleError(_0x58e5d0,_0x2a0774){_0x2a0774=_0x2a0774||0x1f4;return function(_0x3fba00){logger[_0xcf10('0x29')](_0x3fba00[_0xcf10('0x2a')]);if(_0x3fba00[_0xcf10('0x2b')]){delete _0x3fba00['name'];}_0x58e5d0[_0xcf10('0x1a')](_0x2a0774)[_0xcf10('0x2c')](_0x3fba00);};}exports['index']=function(_0x80da3a,_0x27f1da){var _0x2d74ac={},_0x201c35={},_0x404074={'count':0x0,'rows':[]};var _0xa95e88=_[_0xcf10('0x2d')](db['AnalyticTreeReport'][_0xcf10('0x2e')],function(_0x7a967b){return{'name':_0x7a967b[_0xcf10('0x2f')],'type':_0x7a967b[_0xcf10('0x30')][_0xcf10('0x31')]};});_0x201c35[_0xcf10('0x32')]=_[_0xcf10('0x2d')](_0xa95e88,_0xcf10('0x2b'));_0x201c35[_0xcf10('0x33')]=_[_0xcf10('0x34')](_0x80da3a[_0xcf10('0x33')]);_0x201c35[_0xcf10('0x35')]=_[_0xcf10('0x36')](_0x201c35['model'],_0x201c35[_0xcf10('0x33')]);_0x2d74ac['attributes']=_[_0xcf10('0x36')](_0x201c35[_0xcf10('0x32')],qs[_0xcf10('0x37')](_0x80da3a[_0xcf10('0x33')][_0xcf10('0x37')]));_0x2d74ac[_0xcf10('0x38')]=_0x2d74ac[_0xcf10('0x38')][_0xcf10('0x39')]?_0x2d74ac[_0xcf10('0x38')]:_0x201c35['model'];if(!_0x80da3a['query']['hasOwnProperty']('nolimit')){_0x2d74ac[_0xcf10('0x1e')]=qs['limit'](_0x80da3a[_0xcf10('0x33')][_0xcf10('0x1e')]);_0x2d74ac[_0xcf10('0x20')]=qs[_0xcf10('0x20')](_0x80da3a[_0xcf10('0x33')][_0xcf10('0x20')]);}_0x2d74ac['order']=qs[_0xcf10('0x3a')](_0x80da3a[_0xcf10('0x33')]['sort']);_0x2d74ac[_0xcf10('0x3b')]=qs[_0xcf10('0x35')](_[_0xcf10('0x3c')](_0x80da3a[_0xcf10('0x33')],_0x201c35[_0xcf10('0x35')]),_0xa95e88);if(_0x80da3a['query']['filter']){_0x2d74ac[_0xcf10('0x3b')]=_[_0xcf10('0x3d')](_0x2d74ac['where'],{'$or':_['map'](_0xa95e88,function(_0x2a4bb7){if(_0x2a4bb7[_0xcf10('0x30')]!==_0xcf10('0x3e')){var _0x520db1={};_0x520db1[_0x2a4bb7['name']]={'$like':'%'+_0x80da3a['query'][_0xcf10('0x3f')]+'%'};return _0x520db1;}})});}_0x2d74ac=_[_0xcf10('0x3d')]({},_0x2d74ac,_0x80da3a[_0xcf10('0x40')]);var _0x54182b={'where':_0x2d74ac[_0xcf10('0x3b')]};return db[_0xcf10('0x41')][_0xcf10('0x1f')](_0x54182b)[_0xcf10('0x28')](function(_0x4895e1){_0x404074[_0xcf10('0x1f')]=_0x4895e1;if(_0x80da3a['query'][_0xcf10('0x42')]){_0x2d74ac[_0xcf10('0x43')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xcf10('0x44')](_0x2d74ac);})['then'](function(_0x3826f6){_0x404074[_0xcf10('0x45')]=_0x3826f6;return _0x404074;})[_0xcf10('0x28')](respondWithFilteredResult(_0x27f1da,_0x2d74ac))[_0xcf10('0x46')](handleError(_0x27f1da,null));};exports['show']=function(_0xfaad93,_0x3f27be){var _0x122aa6={'raw':!![],'where':{'id':_0xfaad93[_0xcf10('0x47')]['id']}},_0x435f6b={};_0x435f6b['model']=_[_0xcf10('0x34')](db[_0xcf10('0x41')][_0xcf10('0x2e')]);_0x435f6b['query']=_[_0xcf10('0x34')](_0xfaad93[_0xcf10('0x33')]);_0x435f6b['filters']=_['intersection'](_0x435f6b[_0xcf10('0x32')],_0x435f6b[_0xcf10('0x33')]);_0x122aa6['attributes']=_[_0xcf10('0x36')](_0x435f6b[_0xcf10('0x32')],qs[_0xcf10('0x37')](_0xfaad93['query'][_0xcf10('0x37')]));_0x122aa6['attributes']=_0x122aa6[_0xcf10('0x38')]['length']?_0x122aa6['attributes']:_0x435f6b[_0xcf10('0x32')];if(_0xfaad93['query'][_0xcf10('0x42')]){_0x122aa6[_0xcf10('0x43')]=[{'all':!![]}];}_0x122aa6=_[_0xcf10('0x3d')]({},_0x122aa6,_0xfaad93[_0xcf10('0x40')]);return db['AnalyticTreeReport']['find'](_0x122aa6)[_0xcf10('0x28')](handleEntityNotFound(_0x3f27be,null))[_0xcf10('0x28')](respondWithResult(_0x3f27be,null))[_0xcf10('0x46')](handleError(_0x3f27be,null));};exports[_0xcf10('0x48')]=function(_0x267065,_0x3c434c){return db[_0xcf10('0x41')]['create'](_0x267065['body'],{})[_0xcf10('0x28')](respondWithResult(_0x3c434c,0xc9))[_0xcf10('0x46')](handleError(_0x3c434c,null));};exports['update']=function(_0x18558f,_0x352166){if(_0x18558f[_0xcf10('0x49')]['id']){delete _0x18558f[_0xcf10('0x49')]['id'];}return db[_0xcf10('0x41')][_0xcf10('0x4a')]({'where':{'id':_0x18558f[_0xcf10('0x47')]['id']}})['then'](handleEntityNotFound(_0x352166,null))[_0xcf10('0x28')](saveUpdates(_0x18558f[_0xcf10('0x49')],null))[_0xcf10('0x28')](respondWithResult(_0x352166,null))[_0xcf10('0x46')](handleError(_0x352166,null));};exports[_0xcf10('0x27')]=function(_0x4603ad,_0x45d788){return db[_0xcf10('0x41')][_0xcf10('0x4a')]({'where':{'id':_0x4603ad[_0xcf10('0x47')]['id']}})['then'](handleEntityNotFound(_0x45d788,null))[_0xcf10('0x28')](removeEntity(_0x45d788,null))['catch'](handleError(_0x45d788,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 749bfaa..bb53205 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.model.js +++ b/server/api/analyticTreeReport/analyticTreeReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1858=['define','analytics_report_trees','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports'];(function(_0x1e5f85,_0x46ccf2){var _0x3a9ea6=function(_0x1310c0){while(--_0x1310c0){_0x1e5f85['push'](_0x1e5f85['shift']());}};_0x3a9ea6(++_0x46ccf2);}(_0x1858,0x122));var _0x8185=function(_0x19f1e4,_0x1e62de){_0x19f1e4=_0x19f1e4-0x0;var _0x219ebc=_0x1858[_0x19f1e4];return _0x219ebc;};'use strict';var _=require(_0x8185('0x0'));var util=require(_0x8185('0x1'));var logger=require(_0x8185('0x2'))('api');var moment=require(_0x8185('0x3'));var BPromise=require('bluebird');var rp=require(_0x8185('0x4'));var fs=require('fs');var path=require(_0x8185('0x5'));var rimraf=require(_0x8185('0x6'));var config=require(_0x8185('0x7'));var attributes=require(_0x8185('0x8'));module[_0x8185('0x9')]=function(_0x22b4c7,_0x2c50e1){return _0x22b4c7[_0x8185('0xa')]('AnalyticTreeReport',attributes,{'tableName':_0x8185('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x456a=['request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','analytics_report_trees','util','../../config/logger','api','moment','bluebird'];(function(_0x41a37a,_0x1d68cc){var _0x1cd56a=function(_0x4e395a){while(--_0x4e395a){_0x41a37a['push'](_0x41a37a['shift']());}};_0x1cd56a(++_0x1d68cc);}(_0x456a,0x15a));var _0xa456=function(_0x37811e,_0x236854){_0x37811e=_0x37811e-0x0;var _0x533db5=_0x456a[_0x37811e];return _0x533db5;};'use strict';var _=require('lodash');var util=require(_0xa456('0x0'));var logger=require(_0xa456('0x1'))(_0xa456('0x2'));var moment=require(_0xa456('0x3'));var BPromise=require(_0xa456('0x4'));var rp=require(_0xa456('0x5'));var fs=require('fs');var path=require(_0xa456('0x6'));var rimraf=require(_0xa456('0x7'));var config=require(_0xa456('0x8'));var attributes=require(_0xa456('0x9'));module[_0xa456('0xa')]=function(_0x59dce9,_0x534fb1){return _0x59dce9[_0xa456('0xb')]('AnalyticTreeReport',attributes,{'tableName':_0xa456('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index e765e4c..c1059e8 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7a54,0x106));var _0x47a5=function(_0x3f5f67,_0x2831f0){_0x3f5f67=_0x3f5f67-0x0;var _0x54e376=_0x7a54[_0x3f5f67];return _0x54e376;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x43bf7d,_0x23ba22){var _0x3abfbe=function(_0x502c7e){while(--_0x502c7e){_0x43bf7d['push'](_0x43bf7d['shift']());}};_0x3abfbe(++_0x23ba22);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xc4aa[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index e0c7b43..2a1d585 100644 --- a/server/api/analyticTreeReport/index.js +++ b/server/api/analyticTreeReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd501=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','get','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x1bf7a6,_0x3db8a2){var _0x47b453=function(_0x46cb61){while(--_0x46cb61){_0x1bf7a6['push'](_0x1bf7a6['shift']());}};_0x47b453(++_0x3db8a2);}(_0xd501,0x1df));var _0x1d50=function(_0xf27234,_0x4c8d80){_0xf27234=_0xf27234-0x0;var _0x528122=_0xd501[_0xf27234];return _0x528122;};'use strict';var multer=require(_0x1d50('0x0'));var util=require(_0x1d50('0x1'));var path=require(_0x1d50('0x2'));var timeout=require(_0x1d50('0x3'));var express=require(_0x1d50('0x4'));var router=express[_0x1d50('0x5')]();var fs_extra=require(_0x1d50('0x6'));var auth=require(_0x1d50('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x1d50('0x8'));var controller=require(_0x1d50('0x9'));router['get']('/',auth[_0x1d50('0xa')](),controller['index']);router[_0x1d50('0xb')]('/:id',auth[_0x1d50('0xa')](),controller[_0x1d50('0xc')]);router[_0x1d50('0xd')]('/',auth[_0x1d50('0xa')](),controller[_0x1d50('0xe')]);router[_0x1d50('0xf')](_0x1d50('0x10'),auth[_0x1d50('0xa')](),controller[_0x1d50('0x11')]);router[_0x1d50('0x12')](_0x1d50('0x10'),auth[_0x1d50('0xa')](),controller[_0x1d50('0x13')]);module[_0x1d50('0x14')]=router; \ No newline at end of file +var _0x770e=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/:id','isAuthenticated','show','post','create','put','delete','exports'];(function(_0x4e112c,_0x27a1){var _0x16042e=function(_0x6a4b22){while(--_0x6a4b22){_0x4e112c['push'](_0x4e112c['shift']());}};_0x16042e(++_0x27a1);}(_0x770e,0x120));var _0xe770=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0x770e[_0x18cd5b];return _0x5eaa52;};'use strict';var multer=require(_0xe770('0x0'));var util=require(_0xe770('0x1'));var path=require(_0xe770('0x2'));var timeout=require('connect-timeout');var express=require(_0xe770('0x3'));var router=express[_0xe770('0x4')]();var fs_extra=require(_0xe770('0x5'));var auth=require(_0xe770('0x6'));var interaction=require(_0xe770('0x7'));var config=require(_0xe770('0x8'));var controller=require('./analyticTreeReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xe770('0x9')]);router['get'](_0xe770('0xa'),auth[_0xe770('0xb')](),controller[_0xe770('0xc')]);router[_0xe770('0xd')]('/',auth[_0xe770('0xb')](),controller[_0xe770('0xe')]);router[_0xe770('0xf')](_0xe770('0xa'),auth[_0xe770('0xb')](),controller['update']);router[_0xe770('0x10')](_0xe770('0xa'),auth[_0xe770('0xb')](),controller['destroy']);module[_0xe770('0x11')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 023a620..bf98503 100644 --- a/server/api/attachment/attachment.attributes.js +++ b/server/api/attachment/attachment.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f49=['exports','STRING','sequelize'];(function(_0x4848a3,_0x384354){var _0x75ba9a=function(_0x3c5256){while(--_0x3c5256){_0x4848a3['push'](_0x4848a3['shift']());}};_0x75ba9a(++_0x384354);}(_0x3f49,0x11f));var _0x93f4=function(_0x46610f,_0x22d6f1){_0x46610f=_0x46610f-0x0;var _0x5be0f9=_0x3f49[_0x46610f];return _0x5be0f9;};'use strict';var Sequelize=require(_0x93f4('0x0'));module[_0x93f4('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x93f4('0x2')]},'type':{'type':Sequelize[_0x93f4('0x2')]}}; \ No newline at end of file +var _0x55ca=['sequelize','exports'];(function(_0x29e3ca,_0x3369bd){var _0x36645b=function(_0x566414){while(--_0x566414){_0x29e3ca['push'](_0x29e3ca['shift']());}};_0x36645b(++_0x3369bd);}(_0x55ca,0x126));var _0xa55c=function(_0x26371f,_0x3529d6){_0x26371f=_0x26371f-0x0;var _0x7bf77f=_0x55ca[_0x26371f];return _0x7bf77f;};'use strict';var Sequelize=require(_0xa55c('0x0'));module[_0xa55c('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 1e9f6ad..b6e7193 100644 --- a/server/api/attachment/attachment.controller.js +++ b/server/api/attachment/attachment.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8d33=['name','send','index','map','Attachment','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','include','find','length','get','omit','createdAt','updatedAt','body','create','file','originalname','basename','filename','mimetype','download','ChatOfflineMessageId','server/files/attachments/','join','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','set','Content-Range','apply','reject','save','update','then','destroy','error'];(function(_0x57b236,_0x30614e){var _0x4feb29=function(_0x26d3e6){while(--_0x26d3e6){_0x57b236['push'](_0x57b236['shift']());}};_0x4feb29(++_0x30614e);}(_0x8d33,0x1a0));var _0x38d3=function(_0x3354d7,_0x5166f3){_0x3354d7=_0x3354d7-0x0;var _0x489c70=_0x8d33[_0x3354d7];return _0x489c70;};'use strict';var emlformat=require(_0x38d3('0x0'));var rimraf=require(_0x38d3('0x1'));var zipdir=require(_0x38d3('0x2'));var jsonpatch=require(_0x38d3('0x3'));var rp=require(_0x38d3('0x4'));var moment=require(_0x38d3('0x5'));var BPromise=require(_0x38d3('0x6'));var Mustache=require(_0x38d3('0x7'));var util=require(_0x38d3('0x8'));var path=require(_0x38d3('0x9'));var sox=require(_0x38d3('0xa'));var csv=require(_0x38d3('0xb'));var ejs=require(_0x38d3('0xc'));var fs=require('fs');var fs_extra=require(_0x38d3('0xd'));var _=require(_0x38d3('0xe'));var squel=require('squel');var crypto=require(_0x38d3('0xf'));var jsforce=require(_0x38d3('0x10'));var deskjs=require(_0x38d3('0x11'));var toCsv=require('to-csv');var querystring=require(_0x38d3('0x12'));var Papa=require(_0x38d3('0x13'));var Redis=require(_0x38d3('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x38d3('0x15'));var hardwareService=require(_0x38d3('0x16'));var logger=require(_0x38d3('0x17'))('api');var utils=require(_0x38d3('0x18'));var config=require(_0x38d3('0x19'));var licenseUtil=require(_0x38d3('0x1a'));var db=require(_0x38d3('0x1b'))['db'];function respondWithStatusCode(_0x2ab31f,_0x213736){_0x213736=_0x213736||0xcc;return function(_0x5173e2){if(_0x5173e2){return _0x2ab31f[_0x38d3('0x1c')](_0x213736);}return _0x2ab31f[_0x38d3('0x1d')](_0x213736)[_0x38d3('0x1e')]();};}function respondWithResult(_0x507e62,_0x14e4d3){_0x14e4d3=_0x14e4d3||0xc8;return function(_0x335954){if(_0x335954){return _0x507e62['status'](_0x14e4d3)[_0x38d3('0x1f')](_0x335954);}};}function respondWithFilteredResult(_0xf444fd,_0xc4dfa8){return function(_0x3902de){if(_0x3902de){var _0x52408d=typeof _0xc4dfa8['offset']==='undefined'&&typeof _0xc4dfa8[_0x38d3('0x20')]===_0x38d3('0x21');var _0x1955aa=_0x3902de['count'];var _0x4c31f4=_0x52408d?0x0:_0xc4dfa8[_0x38d3('0x22')];var _0x152b6e=_0x52408d?_0x3902de['count']:_0xc4dfa8[_0x38d3('0x22')]+_0xc4dfa8[_0x38d3('0x20')];var _0x39e608;if(_0x152b6e>=_0x1955aa){_0x152b6e=_0x1955aa;_0x39e608=0xc8;}else{_0x39e608=0xce;}_0xf444fd['status'](_0x39e608);return _0xf444fd[_0x38d3('0x23')](_0x38d3('0x24'),_0x4c31f4+'-'+_0x152b6e+'/'+_0x1955aa)[_0x38d3('0x1f')](_0x3902de);}return null;};}function patchUpdates(_0x32d74c){return function(_0xf72e67){try{jsonpatch[_0x38d3('0x25')](_0xf72e67,_0x32d74c,!![]);}catch(_0x1c2267){return BPromise[_0x38d3('0x26')](_0x1c2267);}return _0xf72e67[_0x38d3('0x27')]();};}function saveUpdates(_0x28a479,_0x30135c){return function(_0x1e9d54){if(_0x1e9d54){return _0x1e9d54[_0x38d3('0x28')](_0x28a479)[_0x38d3('0x29')](function(_0x40254d){return _0x40254d;});}return null;};}function removeEntity(_0x200f4a,_0x3ee75f){return function(_0x21722b){if(_0x21722b){return _0x21722b[_0x38d3('0x2a')]()['then'](function(){_0x200f4a[_0x38d3('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44c352,_0x398aea){return function(_0x547b56){if(!_0x547b56){_0x44c352[_0x38d3('0x1c')](0x194);}return _0x547b56;};}function handleError(_0x21890c,_0x2d5d02){_0x2d5d02=_0x2d5d02||0x1f4;return function(_0x2dd571){logger[_0x38d3('0x2b')](_0x2dd571['stack']);if(_0x2dd571['name']){delete _0x2dd571[_0x38d3('0x2c')];}_0x21890c['status'](_0x2d5d02)[_0x38d3('0x2d')](_0x2dd571);};}exports[_0x38d3('0x2e')]=function(_0x119281,_0x5d8e63){var _0x394f33={},_0xa716df={},_0x152888={'count':0x0,'rows':[]};var _0x1042d5=_[_0x38d3('0x2f')](db[_0x38d3('0x30')][_0x38d3('0x31')],function(_0xb07851){return{'name':_0xb07851[_0x38d3('0x32')],'type':_0xb07851[_0x38d3('0x33')]['key']};});_0xa716df['model']=_['map'](_0x1042d5,_0x38d3('0x2c'));_0xa716df[_0x38d3('0x34')]=_['keys'](_0x119281[_0x38d3('0x34')]);_0xa716df[_0x38d3('0x35')]=_[_0x38d3('0x36')](_0xa716df[_0x38d3('0x37')],_0xa716df['query']);_0x394f33[_0x38d3('0x38')]=_[_0x38d3('0x36')](_0xa716df['model'],qs[_0x38d3('0x39')](_0x119281['query'][_0x38d3('0x39')]));_0x394f33[_0x38d3('0x38')]=_0x394f33[_0x38d3('0x38')]['length']?_0x394f33[_0x38d3('0x38')]:_0xa716df['model'];if(!_0x119281[_0x38d3('0x34')]['hasOwnProperty'](_0x38d3('0x3a'))){_0x394f33['limit']=qs[_0x38d3('0x20')](_0x119281[_0x38d3('0x34')][_0x38d3('0x20')]);_0x394f33['offset']=qs[_0x38d3('0x22')](_0x119281['query']['offset']);}_0x394f33[_0x38d3('0x3b')]=qs[_0x38d3('0x3c')](_0x119281[_0x38d3('0x34')][_0x38d3('0x3c')]);_0x394f33[_0x38d3('0x3d')]=qs['filters'](_[_0x38d3('0x3e')](_0x119281[_0x38d3('0x34')],_0xa716df['filters']),_0x1042d5);if(_0x119281[_0x38d3('0x34')][_0x38d3('0x3f')]){_0x394f33[_0x38d3('0x3d')]=_[_0x38d3('0x40')](_0x394f33['where'],{'$or':_[_0x38d3('0x2f')](_0x1042d5,function(_0x1256fa){if(_0x1256fa['type']!==_0x38d3('0x41')){var _0x197e52={};_0x197e52[_0x1256fa[_0x38d3('0x2c')]]={'$like':'%'+_0x119281[_0x38d3('0x34')][_0x38d3('0x3f')]+'%'};return _0x197e52;}})});}_0x394f33=_['merge']({},_0x394f33,_0x119281[_0x38d3('0x42')]);var _0x3d122f={'where':_0x394f33[_0x38d3('0x3d')]};return db['Attachment']['count'](_0x3d122f)[_0x38d3('0x29')](function(_0x592b63){_0x152888['count']=_0x592b63;if(_0x119281[_0x38d3('0x34')][_0x38d3('0x43')]){_0x394f33['include']=[{'all':!![]}];}return db[_0x38d3('0x30')][_0x38d3('0x44')](_0x394f33);})['then'](function(_0x10f0f4){_0x152888[_0x38d3('0x45')]=_0x10f0f4;return _0x152888;})[_0x38d3('0x29')](respondWithFilteredResult(_0x5d8e63,_0x394f33))[_0x38d3('0x46')](handleError(_0x5d8e63,null));};exports[_0x38d3('0x47')]=function(_0x1d0d39,_0x5ba956){var _0x573563={'raw':!![],'where':{'id':_0x1d0d39[_0x38d3('0x48')]['id']}},_0x401bc4={};_0x401bc4[_0x38d3('0x37')]=_[_0x38d3('0x49')](db[_0x38d3('0x30')][_0x38d3('0x31')]);_0x401bc4[_0x38d3('0x34')]=_['keys'](_0x1d0d39[_0x38d3('0x34')]);_0x401bc4['filters']=_[_0x38d3('0x36')](_0x401bc4[_0x38d3('0x37')],_0x401bc4['query']);_0x573563[_0x38d3('0x38')]=_[_0x38d3('0x36')](_0x401bc4[_0x38d3('0x37')],qs['fields'](_0x1d0d39[_0x38d3('0x34')][_0x38d3('0x39')]));_0x573563['attributes']=_0x573563['attributes']['length']?_0x573563[_0x38d3('0x38')]:_0x401bc4[_0x38d3('0x37')];if(_0x1d0d39[_0x38d3('0x34')][_0x38d3('0x43')]){_0x573563[_0x38d3('0x4a')]=[{'all':!![]}];}_0x573563=_['merge']({},_0x573563,_0x1d0d39[_0x38d3('0x42')]);return db[_0x38d3('0x30')][_0x38d3('0x4b')](_0x573563)[_0x38d3('0x29')](handleEntityNotFound(_0x5ba956,null))['then'](respondWithResult(_0x5ba956,null))[_0x38d3('0x46')](handleError(_0x5ba956,null));};exports['clone']=function(_0x24a7e1,_0x16d6bd){var _0x3e335a={'where':{'id':_0x24a7e1[_0x38d3('0x48')]['id']}},_0x163392={};_0x163392['model']=_[_0x38d3('0x49')](db['Attachment']['rawAttributes']);_0x3e335a[_0x38d3('0x38')]=_['intersection'](_0x163392[_0x38d3('0x37')],qs[_0x38d3('0x39')](_0x24a7e1[_0x38d3('0x34')][_0x38d3('0x39')]));_0x3e335a['attributes']=_0x3e335a[_0x38d3('0x38')][_0x38d3('0x4c')]?_0x3e335a[_0x38d3('0x38')]:_0x163392[_0x38d3('0x37')];if(_0x24a7e1[_0x38d3('0x34')][_0x38d3('0x43')]){_0x3e335a['include']=[{'all':!![]}];}_0x3e335a=_[_0x38d3('0x40')]({},_0x3e335a,_0x24a7e1[_0x38d3('0x42')]);return db[_0x38d3('0x30')][_0x38d3('0x4b')](_0x3e335a)[_0x38d3('0x29')](handleEntityNotFound(_0x16d6bd,null))[_0x38d3('0x29')](function(_0x40c993){if(_0x40c993){var _0x2e4c00=_0x40c993[_0x38d3('0x4d')]({'plain':!![]});_0x2e4c00=qs[_0x38d3('0x4e')](_0x2e4c00,['id',_0x38d3('0x4f'),_0x38d3('0x50')]);_0x24a7e1[_0x38d3('0x51')]=_['omit'](_0x24a7e1[_0x38d3('0x51')],['id',_0x38d3('0x4f'),_0x38d3('0x50')]);return db[_0x38d3('0x30')][_0x38d3('0x52')](_['merge'](_0x2e4c00,_0x24a7e1[_0x38d3('0x51')]),{'include':_0x24a7e1['query'][_0x38d3('0x43')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x16d6bd,0xc9))[_0x38d3('0x46')](handleError(_0x16d6bd,null));};exports[_0x38d3('0x28')]=function(_0x21dff5,_0x4abba8){if(_0x21dff5[_0x38d3('0x51')]['id']){delete _0x21dff5[_0x38d3('0x51')]['id'];}return db[_0x38d3('0x30')]['find']({'where':{'id':_0x21dff5['params']['id']}})[_0x38d3('0x29')](handleEntityNotFound(_0x4abba8,null))[_0x38d3('0x29')](saveUpdates(_0x21dff5[_0x38d3('0x51')],null))[_0x38d3('0x29')](respondWithResult(_0x4abba8,null))[_0x38d3('0x46')](handleError(_0x4abba8,null));};exports[_0x38d3('0x2a')]=function(_0xc7bfec,_0x28a3d6){return db[_0x38d3('0x30')][_0x38d3('0x4b')]({'where':{'id':_0xc7bfec[_0x38d3('0x48')]['id']}})['then'](handleEntityNotFound(_0x28a3d6,null))['then'](removeEntity(_0x28a3d6,null))['catch'](handleError(_0x28a3d6,null));};exports[_0x38d3('0x52')]=function(_0x83af43,_0x221f22,_0x1d027d){_0x83af43[_0x38d3('0x51')][_0x38d3('0x2c')]=_0x83af43[_0x38d3('0x53')][_0x38d3('0x54')];_0x83af43[_0x38d3('0x51')][_0x38d3('0x55')]=_0x83af43['file'][_0x38d3('0x56')];_0x83af43['body'][_0x38d3('0x33')]=_0x83af43[_0x38d3('0x53')][_0x38d3('0x57')];return db[_0x38d3('0x30')][_0x38d3('0x52')](_0x83af43[_0x38d3('0x51')])['then'](respondWithResult(_0x221f22,0xc9))[_0x38d3('0x46')](handleError(_0x221f22,null));};exports[_0x38d3('0x58')]=function(_0x294503,_0x3aae95,_0x4ba447){return db[_0x38d3('0x30')]['findOne']({'where':{'id':_0x294503[_0x38d3('0x48')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x3aae95,null))[_0x38d3('0x29')](function(_0x312f63){if(_0x312f63){var _0x473d1f=_0x312f63[_0x38d3('0x59')]!==null;var _0x2270d5=path['join'](config['root'],_0x38d3('0x5a'));if(_0x473d1f){_0x2270d5=path[_0x38d3('0x5b')](_0x2270d5,'offline-chat/');}var _0x530023=path[_0x38d3('0x5b')](_0x2270d5,_0x312f63[_0x38d3('0x55')]);return _0x3aae95[_0x38d3('0x58')](_0x530023);}})[_0x38d3('0x46')](handleError(_0x3aae95,null));}; \ No newline at end of file +var _0x7440=['where','merge','options','Attachment','findAll','rows','catch','show','params','rawAttributes','fields','includeAll','include','find','clone','get','createdAt','body','omit','updatedAt','create','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','reject','save','update','destroy','then','sendStatus','error','name','send','index','map','fieldName','type','model','keys','filters','intersection','query','attributes','length','nolimit','order','pick','filter'];(function(_0x4629ee,_0x5802d8){var _0x47fb5b=function(_0xf899cd){while(--_0xf899cd){_0x4629ee['push'](_0x4629ee['shift']());}};_0x47fb5b(++_0x5802d8);}(_0x7440,0x132));var _0x0744=function(_0x3fd293,_0x1810ac){_0x3fd293=_0x3fd293-0x0;var _0x15ddca=_0x7440[_0x3fd293];return _0x15ddca;};'use strict';var emlformat=require(_0x0744('0x0'));var rimraf=require(_0x0744('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0744('0x2'));var rp=require(_0x0744('0x3'));var moment=require('moment');var BPromise=require(_0x0744('0x4'));var Mustache=require(_0x0744('0x5'));var util=require(_0x0744('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0744('0x7'));var _=require(_0x0744('0x8'));var squel=require(_0x0744('0x9'));var crypto=require(_0x0744('0xa'));var jsforce=require(_0x0744('0xb'));var deskjs=require(_0x0744('0xc'));var toCsv=require(_0x0744('0xd'));var querystring=require(_0x0744('0xe'));var Papa=require(_0x0744('0xf'));var Redis=require(_0x0744('0x10'));var authService=require(_0x0744('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0744('0x12'));var hardwareService=require(_0x0744('0x13'));var logger=require(_0x0744('0x14'))(_0x0744('0x15'));var utils=require(_0x0744('0x16'));var config=require(_0x0744('0x17'));var licenseUtil=require(_0x0744('0x18'));var db=require(_0x0744('0x19'))['db'];function respondWithStatusCode(_0x3575d0,_0x679399){_0x679399=_0x679399||0xcc;return function(_0x255a35){if(_0x255a35){return _0x3575d0['sendStatus'](_0x679399);}return _0x3575d0[_0x0744('0x1a')](_0x679399)[_0x0744('0x1b')]();};}function respondWithResult(_0x1dcfa1,_0x5eb5a9){_0x5eb5a9=_0x5eb5a9||0xc8;return function(_0x258e45){if(_0x258e45){return _0x1dcfa1[_0x0744('0x1a')](_0x5eb5a9)[_0x0744('0x1c')](_0x258e45);}};}function respondWithFilteredResult(_0xbde0b0,_0x840a91){return function(_0x3b2c40){if(_0x3b2c40){var _0x442f64=typeof _0x840a91[_0x0744('0x1d')]===_0x0744('0x1e')&&typeof _0x840a91[_0x0744('0x1f')]===_0x0744('0x1e');var _0x175002=_0x3b2c40[_0x0744('0x20')];var _0x3626ec=_0x442f64?0x0:_0x840a91[_0x0744('0x1d')];var _0x26f0b9=_0x442f64?_0x3b2c40['count']:_0x840a91[_0x0744('0x1d')]+_0x840a91['limit'];var _0xa05fd7;if(_0x26f0b9>=_0x175002){_0x26f0b9=_0x175002;_0xa05fd7=0xc8;}else{_0xa05fd7=0xce;}_0xbde0b0[_0x0744('0x1a')](_0xa05fd7);return _0xbde0b0[_0x0744('0x21')]('Content-Range',_0x3626ec+'-'+_0x26f0b9+'/'+_0x175002)[_0x0744('0x1c')](_0x3b2c40);}return null;};}function patchUpdates(_0x34b49b){return function(_0x40a83e){try{jsonpatch['apply'](_0x40a83e,_0x34b49b,!![]);}catch(_0x203646){return BPromise[_0x0744('0x22')](_0x203646);}return _0x40a83e[_0x0744('0x23')]();};}function saveUpdates(_0x10f6e4,_0xeda4a1){return function(_0x2774db){if(_0x2774db){return _0x2774db[_0x0744('0x24')](_0x10f6e4)['then'](function(_0x512402){return _0x512402;});}return null;};}function removeEntity(_0x1d3a61,_0x55189c){return function(_0x221250){if(_0x221250){return _0x221250[_0x0744('0x25')]()[_0x0744('0x26')](function(){_0x1d3a61[_0x0744('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10b0ba,_0x3b4d89){return function(_0x5e88c8){if(!_0x5e88c8){_0x10b0ba[_0x0744('0x27')](0x194);}return _0x5e88c8;};}function handleError(_0x4b1897,_0x31159e){_0x31159e=_0x31159e||0x1f4;return function(_0x49ff0e){logger[_0x0744('0x28')](_0x49ff0e['stack']);if(_0x49ff0e[_0x0744('0x29')]){delete _0x49ff0e[_0x0744('0x29')];}_0x4b1897[_0x0744('0x1a')](_0x31159e)[_0x0744('0x2a')](_0x49ff0e);};}exports[_0x0744('0x2b')]=function(_0x55e50f,_0x2babc7){var _0x1378a5={},_0x29310d={},_0x149b1d={'count':0x0,'rows':[]};var _0x162a98=_[_0x0744('0x2c')](db['Attachment']['rawAttributes'],function(_0x280483){return{'name':_0x280483[_0x0744('0x2d')],'type':_0x280483[_0x0744('0x2e')]['key']};});_0x29310d[_0x0744('0x2f')]=_[_0x0744('0x2c')](_0x162a98,_0x0744('0x29'));_0x29310d['query']=_[_0x0744('0x30')](_0x55e50f['query']);_0x29310d[_0x0744('0x31')]=_[_0x0744('0x32')](_0x29310d[_0x0744('0x2f')],_0x29310d[_0x0744('0x33')]);_0x1378a5[_0x0744('0x34')]=_['intersection'](_0x29310d['model'],qs['fields'](_0x55e50f['query']['fields']));_0x1378a5[_0x0744('0x34')]=_0x1378a5['attributes'][_0x0744('0x35')]?_0x1378a5[_0x0744('0x34')]:_0x29310d[_0x0744('0x2f')];if(!_0x55e50f[_0x0744('0x33')]['hasOwnProperty'](_0x0744('0x36'))){_0x1378a5[_0x0744('0x1f')]=qs[_0x0744('0x1f')](_0x55e50f[_0x0744('0x33')][_0x0744('0x1f')]);_0x1378a5['offset']=qs['offset'](_0x55e50f[_0x0744('0x33')][_0x0744('0x1d')]);}_0x1378a5[_0x0744('0x37')]=qs['sort'](_0x55e50f[_0x0744('0x33')]['sort']);_0x1378a5['where']=qs[_0x0744('0x31')](_[_0x0744('0x38')](_0x55e50f['query'],_0x29310d[_0x0744('0x31')]),_0x162a98);if(_0x55e50f[_0x0744('0x33')][_0x0744('0x39')]){_0x1378a5[_0x0744('0x3a')]=_[_0x0744('0x3b')](_0x1378a5[_0x0744('0x3a')],{'$or':_[_0x0744('0x2c')](_0x162a98,function(_0x2ee214){if(_0x2ee214[_0x0744('0x2e')]!=='VIRTUAL'){var _0x544dd4={};_0x544dd4[_0x2ee214[_0x0744('0x29')]]={'$like':'%'+_0x55e50f[_0x0744('0x33')][_0x0744('0x39')]+'%'};return _0x544dd4;}})});}_0x1378a5=_[_0x0744('0x3b')]({},_0x1378a5,_0x55e50f[_0x0744('0x3c')]);var _0x2a56fe={'where':_0x1378a5[_0x0744('0x3a')]};return db[_0x0744('0x3d')]['count'](_0x2a56fe)['then'](function(_0x5b09b8){_0x149b1d[_0x0744('0x20')]=_0x5b09b8;if(_0x55e50f[_0x0744('0x33')]['includeAll']){_0x1378a5['include']=[{'all':!![]}];}return db[_0x0744('0x3d')][_0x0744('0x3e')](_0x1378a5);})[_0x0744('0x26')](function(_0x282668){_0x149b1d[_0x0744('0x3f')]=_0x282668;return _0x149b1d;})['then'](respondWithFilteredResult(_0x2babc7,_0x1378a5))[_0x0744('0x40')](handleError(_0x2babc7,null));};exports[_0x0744('0x41')]=function(_0x1696ad,_0x3d51f1){var _0x5bf23b={'raw':!![],'where':{'id':_0x1696ad[_0x0744('0x42')]['id']}},_0x14d1d6={};_0x14d1d6[_0x0744('0x2f')]=_[_0x0744('0x30')](db[_0x0744('0x3d')][_0x0744('0x43')]);_0x14d1d6['query']=_['keys'](_0x1696ad['query']);_0x14d1d6[_0x0744('0x31')]=_[_0x0744('0x32')](_0x14d1d6[_0x0744('0x2f')],_0x14d1d6[_0x0744('0x33')]);_0x5bf23b[_0x0744('0x34')]=_[_0x0744('0x32')](_0x14d1d6[_0x0744('0x2f')],qs[_0x0744('0x44')](_0x1696ad[_0x0744('0x33')]['fields']));_0x5bf23b[_0x0744('0x34')]=_0x5bf23b[_0x0744('0x34')][_0x0744('0x35')]?_0x5bf23b[_0x0744('0x34')]:_0x14d1d6[_0x0744('0x2f')];if(_0x1696ad[_0x0744('0x33')][_0x0744('0x45')]){_0x5bf23b[_0x0744('0x46')]=[{'all':!![]}];}_0x5bf23b=_[_0x0744('0x3b')]({},_0x5bf23b,_0x1696ad['options']);return db[_0x0744('0x3d')][_0x0744('0x47')](_0x5bf23b)[_0x0744('0x26')](handleEntityNotFound(_0x3d51f1,null))[_0x0744('0x26')](respondWithResult(_0x3d51f1,null))[_0x0744('0x40')](handleError(_0x3d51f1,null));};exports[_0x0744('0x48')]=function(_0x5a54d9,_0x496613){var _0x5a53da={'where':{'id':_0x5a54d9[_0x0744('0x42')]['id']}},_0x235c50={};_0x235c50[_0x0744('0x2f')]=_[_0x0744('0x30')](db[_0x0744('0x3d')][_0x0744('0x43')]);_0x5a53da[_0x0744('0x34')]=_[_0x0744('0x32')](_0x235c50[_0x0744('0x2f')],qs[_0x0744('0x44')](_0x5a54d9[_0x0744('0x33')][_0x0744('0x44')]));_0x5a53da[_0x0744('0x34')]=_0x5a53da['attributes'][_0x0744('0x35')]?_0x5a53da['attributes']:_0x235c50['model'];if(_0x5a54d9[_0x0744('0x33')][_0x0744('0x45')]){_0x5a53da[_0x0744('0x46')]=[{'all':!![]}];}_0x5a53da=_[_0x0744('0x3b')]({},_0x5a53da,_0x5a54d9[_0x0744('0x3c')]);return db[_0x0744('0x3d')][_0x0744('0x47')](_0x5a53da)[_0x0744('0x26')](handleEntityNotFound(_0x496613,null))[_0x0744('0x26')](function(_0x2c014f){if(_0x2c014f){var _0x4e37dd=_0x2c014f[_0x0744('0x49')]({'plain':!![]});_0x4e37dd=qs['omit'](_0x4e37dd,['id',_0x0744('0x4a'),'updatedAt']);_0x5a54d9[_0x0744('0x4b')]=_[_0x0744('0x4c')](_0x5a54d9[_0x0744('0x4b')],['id','createdAt',_0x0744('0x4d')]);return db[_0x0744('0x3d')][_0x0744('0x4e')](_['merge'](_0x4e37dd,_0x5a54d9[_0x0744('0x4b')]),{'include':_0x5a54d9[_0x0744('0x33')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x0744('0x26')](respondWithResult(_0x496613,0xc9))[_0x0744('0x40')](handleError(_0x496613,null));};exports[_0x0744('0x24')]=function(_0x45c22b,_0x56861a){if(_0x45c22b[_0x0744('0x4b')]['id']){delete _0x45c22b[_0x0744('0x4b')]['id'];}return db[_0x0744('0x3d')]['find']({'where':{'id':_0x45c22b[_0x0744('0x42')]['id']}})[_0x0744('0x26')](handleEntityNotFound(_0x56861a,null))[_0x0744('0x26')](saveUpdates(_0x45c22b[_0x0744('0x4b')],null))[_0x0744('0x26')](respondWithResult(_0x56861a,null))['catch'](handleError(_0x56861a,null));};exports['destroy']=function(_0x1f8dcc,_0x28e62a){return db[_0x0744('0x3d')][_0x0744('0x47')]({'where':{'id':_0x1f8dcc[_0x0744('0x42')]['id']}})[_0x0744('0x26')](handleEntityNotFound(_0x28e62a,null))[_0x0744('0x26')](removeEntity(_0x28e62a,null))[_0x0744('0x40')](handleError(_0x28e62a,null));};exports['create']=function(_0xe1e25d,_0x4f7f98,_0xfeb542){_0xe1e25d[_0x0744('0x4b')][_0x0744('0x29')]=_0xe1e25d[_0x0744('0x4f')][_0x0744('0x50')];_0xe1e25d[_0x0744('0x4b')][_0x0744('0x51')]=_0xe1e25d[_0x0744('0x4f')][_0x0744('0x52')];_0xe1e25d[_0x0744('0x4b')][_0x0744('0x2e')]=_0xe1e25d[_0x0744('0x4f')][_0x0744('0x53')];return db[_0x0744('0x3d')][_0x0744('0x4e')](_0xe1e25d[_0x0744('0x4b')])['then'](respondWithResult(_0x4f7f98,0xc9))[_0x0744('0x40')](handleError(_0x4f7f98,null));};exports[_0x0744('0x54')]=function(_0x30c2e8,_0x35e8fc,_0x2aaf6a){return db[_0x0744('0x3d')][_0x0744('0x55')]({'where':{'id':_0x30c2e8['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x35e8fc,null))[_0x0744('0x26')](function(_0x178ea9){if(_0x178ea9){var _0x1eb1c1=_0x178ea9[_0x0744('0x56')]!==null;var _0x1239b2=path[_0x0744('0x57')](config[_0x0744('0x58')],_0x0744('0x59'));if(_0x1eb1c1){_0x1239b2=path[_0x0744('0x57')](_0x1239b2,_0x0744('0x5a'));}var _0x3894eb=path['join'](_0x1239b2,_0x178ea9['basename']);return _0x35e8fc[_0x0744('0x54')](_0x3894eb);}})[_0x0744('0x40')](handleError(_0x35e8fc,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 0d47f17..3083c48 100644 --- a/server/api/attachment/attachment.model.js +++ b/server/api/attachment/attachment.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2e85=['rimraf','../../config/environment','exports','define','util','../../config/logger','api','moment','bluebird','path'];(function(_0x2b63ea,_0x182b86){var _0x838701=function(_0x22d6d6){while(--_0x22d6d6){_0x2b63ea['push'](_0x2b63ea['shift']());}};_0x838701(++_0x182b86);}(_0x2e85,0x144));var _0x52e8=function(_0x1aef08,_0x521afc){_0x1aef08=_0x1aef08-0x0;var _0x105a2c=_0x2e85[_0x1aef08];return _0x105a2c;};'use strict';var _=require('lodash');var util=require(_0x52e8('0x0'));var logger=require(_0x52e8('0x1'))(_0x52e8('0x2'));var moment=require(_0x52e8('0x3'));var BPromise=require(_0x52e8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x52e8('0x5'));var rimraf=require(_0x52e8('0x6'));var config=require(_0x52e8('0x7'));var attributes=require('./attachment.attributes');module[_0x52e8('0x8')]=function(_0x444d91,_0x5720fe){return _0x444d91[_0x52e8('0x9')]('Attachment',attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc665=['lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./attachment.attributes','define','attachments'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0xc665,0x84));var _0x5c66=function(_0x4b12a4,_0x4a2df0){_0x4b12a4=_0x4b12a4-0x0;var _0x22ee43=_0xc665[_0x4b12a4];return _0x22ee43;};'use strict';var _=require(_0x5c66('0x0'));var util=require(_0x5c66('0x1'));var logger=require(_0x5c66('0x2'))(_0x5c66('0x3'));var moment=require(_0x5c66('0x4'));var BPromise=require(_0x5c66('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5c66('0x6'));var rimraf=require('rimraf');var config=require(_0x5c66('0x7'));var attributes=require(_0x5c66('0x8'));module['exports']=function(_0x361d2d,_0x3c6c60){return _0x361d2d[_0x5c66('0x9')]('Attachment',attributes,{'tableName':_0x5c66('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index 58eb301..4e70eea 100644 --- a/server/api/attachment/attachment.rpc.js +++ b/server/api/attachment/attachment.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa75b=['client','http','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','Attachment','create','options','CreateAttachment','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xa75b,0x170));var _0xba75=function(_0x46d6b7,_0x117a8d){_0x46d6b7=_0x46d6b7-0x0;var _0x44f492=_0xa75b[_0x46d6b7];return _0x44f492;};'use strict';var _=require(_0xba75('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xba75('0x1'));var rs=require(_0xba75('0x2'));var fs=require('fs');var Redis=require(_0xba75('0x3'));var db=require(_0xba75('0x4'))['db'];var utils=require(_0xba75('0x5'));var logger=require(_0xba75('0x6'))(_0xba75('0x7'));var config=require(_0xba75('0x8'));var jayson=require(_0xba75('0x9'));var client=jayson[_0xba75('0xa')][_0xba75('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x238a33,_0x3ccab5,_0x5c79e3){return new BPromise(function(_0x4b842d,_0x731cae){return client['request'](_0x238a33,_0x5c79e3)['then'](function(_0x218dbd){logger['info'](_0xba75('0xc'),_0x3ccab5,_0xba75('0xd'));logger[_0xba75('0xe')](_0xba75('0xf'),_0x3ccab5,_0xba75('0xd'),JSON[_0xba75('0x10')](_0x218dbd));if(_0x218dbd[_0xba75('0x11')]){if(_0x218dbd[_0xba75('0x11')][_0xba75('0x12')]===0x1f4){logger[_0xba75('0x11')](_0xba75('0xc'),_0x3ccab5,_0x218dbd[_0xba75('0x11')]['message']);return _0x731cae(_0x218dbd['error'][_0xba75('0x13')]);}logger['error'](_0xba75('0xc'),_0x3ccab5,_0x218dbd[_0xba75('0x11')][_0xba75('0x13')]);return _0x4b842d(_0x218dbd[_0xba75('0x11')]['message']);}else{logger[_0xba75('0x14')](_0xba75('0xc'),_0x3ccab5,_0xba75('0xd'));_0x4b842d(_0x218dbd[_0xba75('0x15')][_0xba75('0x13')]);}})['catch'](function(_0x350a9d){logger[_0xba75('0x11')](_0xba75('0xc'),_0x3ccab5,_0x350a9d);_0x731cae(_0x350a9d);});});}exports['CreateAttachment']=function(_0x2822af){var _0xd8850f=this;return new Promise(function(_0xc4bf17,_0x132750){return db[_0xba75('0x16')][_0xba75('0x17')](_0x2822af['body'],{'raw':_0x2822af[_0xba75('0x18')]?_0x2822af[_0xba75('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x35ffd2){logger[_0xba75('0x14')]('CreateAttachment',_0x2822af);logger['debug'](_0xba75('0x19'),_0x2822af,JSON['stringify'](_0x35ffd2));_0xc4bf17(_0x35ffd2);})[_0xba75('0x1a')](function(_0x2ece41){logger[_0xba75('0x11')]('CreateAttachment',_0x2ece41[_0xba75('0x13')],_0x2822af);_0x132750(_0xd8850f[_0xba75('0x11')](0x1f4,_0x2ece41[_0xba75('0x13')]));});});}; \ No newline at end of file +var _0xe644=['code','message','catch','CreateAttachment','create','body','options','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5a7da7,_0x4f132a){var _0x14459e=function(_0x4daa47){while(--_0x4daa47){_0x5a7da7['push'](_0x5a7da7['shift']());}};_0x14459e(++_0x4f132a);}(_0xe644,0x159));var _0x4e64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe644[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4e64('0x0'));var util=require(_0x4e64('0x1'));var moment=require(_0x4e64('0x2'));var BPromise=require(_0x4e64('0x3'));var rs=require(_0x4e64('0x4'));var fs=require('fs');var Redis=require(_0x4e64('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4e64('0x6'));var logger=require(_0x4e64('0x7'))(_0x4e64('0x8'));var config=require(_0x4e64('0x9'));var jayson=require(_0x4e64('0xa'));var client=jayson[_0x4e64('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x66faf,_0x12c40d,_0x5cce6e){return new BPromise(function(_0x4d5aa6,_0x8573c1){return client['request'](_0x66faf,_0x5cce6e)['then'](function(_0x2ebcfe){logger[_0x4e64('0xc')](_0x4e64('0xd'),_0x12c40d,_0x4e64('0xe'));logger[_0x4e64('0xf')](_0x4e64('0x10'),_0x12c40d,'request\x20sent',JSON[_0x4e64('0x11')](_0x2ebcfe));if(_0x2ebcfe[_0x4e64('0x12')]){if(_0x2ebcfe['error'][_0x4e64('0x13')]===0x1f4){logger['error']('Attachment,\x20%s,\x20%s',_0x12c40d,_0x2ebcfe[_0x4e64('0x12')]['message']);return _0x8573c1(_0x2ebcfe[_0x4e64('0x12')][_0x4e64('0x14')]);}logger[_0x4e64('0x12')](_0x4e64('0xd'),_0x12c40d,_0x2ebcfe[_0x4e64('0x12')][_0x4e64('0x14')]);return _0x4d5aa6(_0x2ebcfe[_0x4e64('0x12')]['message']);}else{logger[_0x4e64('0xc')](_0x4e64('0xd'),_0x12c40d,_0x4e64('0xe'));_0x4d5aa6(_0x2ebcfe['result'][_0x4e64('0x14')]);}})[_0x4e64('0x15')](function(_0x452f34){logger[_0x4e64('0x12')](_0x4e64('0xd'),_0x12c40d,_0x452f34);_0x8573c1(_0x452f34);});});}exports[_0x4e64('0x16')]=function(_0x135ffb){var _0x3961c5=this;return new Promise(function(_0x1be196,_0x2df16a){return db['Attachment'][_0x4e64('0x17')](_0x135ffb[_0x4e64('0x18')],{'raw':_0x135ffb['options']?_0x135ffb[_0x4e64('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x18a1d3){logger[_0x4e64('0xc')](_0x4e64('0x16'),_0x135ffb);logger['debug'](_0x4e64('0x16'),_0x135ffb,JSON['stringify'](_0x18a1d3));_0x1be196(_0x18a1d3);})[_0x4e64('0x15')](function(_0x336c53){logger[_0x4e64('0x12')]('CreateAttachment',_0x336c53[_0x4e64('0x14')],_0x135ffb);_0x2df16a(_0x3961c5[_0x4e64('0x12')](0x1f4,_0x336c53[_0x4e64('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 4ac2ab2..58009fe 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0xa7144f,_0x53ba7a){var _0x417dfe=function(_0x1b6e19){while(--_0x1b6e19){_0xa7144f['push'](_0xa7144f['shift']());}};_0x417dfe(++_0x53ba7a);}(_0x2032,0xd9));var _0x2203=function(_0x5dbb14,_0xfa4e72){_0x5dbb14=_0x5dbb14-0x0;var _0x1e181e=_0x2032[_0x5dbb14];return _0x1e181e;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router; \ No newline at end of file +var _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x3ccdf8,_0x584ceb){var _0x243dab=function(_0x1a90d1){while(--_0x1a90d1){_0x3ccdf8['push'](_0x3ccdf8['shift']());}};_0x243dab(++_0x584ceb);}(_0x5f66,0x1a0));var _0x65f6=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x5f66[_0x297fd3];return _0x2af381;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 3aab988..80d7324 100644 --- a/server/api/authActiveDirectory/authActiveDirectory.controller.js +++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda51=['login','authenticate','ad-login','use','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','url','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','name','password','salt','disabled','online','admin','user','domain','blocked','blockedAt','add','clearBlockUser','getLicense','catch','status','send','message'];(function(_0x1fd3f8,_0x8bdd8a){var _0x3d5169=function(_0x582938){while(--_0x582938){_0x1fd3f8['push'](_0x1fd3f8['shift']());}};_0x3d5169(++_0x8bdd8a);}(_0xda51,0x1db));var _0x1da5=function(_0x25e109,_0x6ab24c){_0x25e109=_0x25e109-0x0;var _0xc0f7d6=_0xda51[_0x25e109];return _0xc0f7d6;};'use strict';var passport=require(_0x1da5('0x0'));var LocalStrategy=require(_0x1da5('0x1'))[_0x1da5('0x2')];var moment=require(_0x1da5('0x3'));var ActiveDirectory=require(_0x1da5('0x4'));var BPromise=require(_0x1da5('0x5'));var util=require(_0x1da5('0x6'));var db=require(_0x1da5('0x7'))['db'];var authService=require(_0x1da5('0x8'));var utils=require(_0x1da5('0x9'));var config=require(_0x1da5('0xa'));var logger=require(_0x1da5('0xb'))(_0x1da5('0xc'));function isActiveDirectoryConfigured(_0x35eceb){var _0x415ada=![];if(typeof _0x35eceb[_0x1da5('0xd')]!=='undefined'){_0x415ada=_0x35eceb[_0x1da5('0xd')]['baseDN']&&_0x35eceb[_0x1da5('0xd')][_0x1da5('0xe')]&&_0x35eceb[_0x1da5('0xd')]['domain'];}return _0x415ada;}function adAuthenticate(_0x3abc63,_0x4c8f31,_0x123cfb){return new BPromise(function(_0x39e915,_0x40019a){try{var _0x488999=new ActiveDirectory(_0x3abc63);_0x488999['authenticate'](_0x4c8f31,_0x123cfb,function(_0x32cec0,_0x123819){if(_0x32cec0){logger[_0x1da5('0xf')](_0x1da5('0x10'),_0x4c8f31,util['inspect'](_0x32cec0,{'showHidden':![],'depth':null}));_0x40019a(_0x1da5('0x11'));}else if(!_0x123819){logger['error'](_0x1da5('0x12'),_0x4c8f31);_0x40019a(_0x1da5('0x11'));}else{_0x39e915(_0x123819);}});}catch(_0x41772e){_0x40019a(_0x41772e);}});}function ActiveDirectoryAuthenticate(_0x5ca1a3,_0x395e91,_0x57d9bb,_0x458a9b){var _0x2d4c34,_0x111e62;if(!isActiveDirectoryConfigured(config)){logger[_0x1da5('0xf')](_0x1da5('0x13'),_0x395e91);return _0x458a9b(null,![],{'message':_0x1da5('0x11')});}return db[_0x1da5('0x14')][_0x1da5('0x15')]({'where':{'id':0x1},'attributes':[_0x1da5('0x16'),_0x1da5('0x17')],'raw':!![]})[_0x1da5('0x18')](function(_0x123e72){_0x2d4c34=_0x123e72;if(!_0x2d4c34[_0x1da5('0x16')]){logger[_0x1da5('0xf')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x395e91);throw new Error(_0x1da5('0x11'));}return _0x5ca1a3[_0x1da5('0x15')]({'attributes':['id',_0x1da5('0x19'),_0x1da5('0x1a'),_0x1da5('0x1b'),'role',_0x1da5('0x1c'),'blocked','blockedAt',_0x1da5('0x1d')],'where':{'name':_0x395e91,'role':{'$or':[_0x1da5('0x1e'),_0x1da5('0x1f'),'agent']},'adSsoEnabled':!![]}});})[_0x1da5('0x18')](function(_0x7e90de){if(!_0x7e90de||_0x7e90de&&_0x7e90de[_0x1da5('0x19')]!==_0x395e91){throw new Error(_0x1da5('0x11'));}_0x111e62=_0x7e90de;var _0x2f5679=_0x111e62[_0x1da5('0x19')]+'@'+config[_0x1da5('0xd')][_0x1da5('0x20')];return adAuthenticate(config['activedirectory'],_0x2f5679,_0x57d9bb);})[_0x1da5('0x18')](function(_0x358619){if(_0x111e62[_0x1da5('0x1c')]){throw new Error(_0x1da5('0x11'));}if(_0x2d4c34[_0x1da5('0x17')]>0x0){if(_0x111e62[_0x1da5('0x21')]){if(moment(_0x111e62[_0x1da5('0x22')])[_0x1da5('0x23')](_0x2d4c34[_0x1da5('0x17')],'minutes')>moment()){throw new Error(_0x1da5('0x11'));}return utils[_0x1da5('0x24')](_0x111e62,0x0,![],null)[_0x1da5('0x18')](function(){return utils['getLicense'](_0x111e62);})[_0x1da5('0x18')](function(){return _0x458a9b(null,_0x111e62);});}else{return utils[_0x1da5('0x25')](_0x111e62)['then'](function(){return _0x458a9b(null,_0x111e62);});}}else{return utils[_0x1da5('0x25')](_0x111e62)[_0x1da5('0x18')](function(){return _0x458a9b(null,_0x111e62);});}})[_0x1da5('0x26')](function(_0x1f22c3){return _0x458a9b(null,![],_0x1f22c3);});}function handleError(_0x3e00d1,_0x43f59c,_0x5901b8){return _0x3e00d1[_0x1da5('0x27')](_0x43f59c||0x1f4)[_0x1da5('0x28')]({'message':_0x5901b8?_0x5901b8[_0x1da5('0x29')]||_0x5901b8:''});}exports[_0x1da5('0x2a')]=function(_0x538396,_0x3e5ce1,_0x417ee4){passport[_0x1da5('0x2b')](_0x1da5('0x2c'),function(_0x5e66e5,_0x41c82b,_0x5af5c7){var _0x34b9c0=_0x5e66e5||_0x5af5c7;if(_0x34b9c0){return handleError(_0x3e5ce1,0x191,_0x34b9c0);}if(!_0x41c82b){return handleError(_0x3e5ce1,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x567375={'payload':{'id':_0x41c82b['id'],'role':_0x41c82b['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x567375)[_0x1da5('0x18')](function(_0x1684cc){_0x3e5ce1['json']({'id':_0x41c82b['id'],'token':_0x1684cc,'statusCall':'','isAlreadyLogged':_0x41c82b[_0x1da5('0x1d')]});});}})(_0x538396,_0x3e5ce1,_0x417ee4);};passport[_0x1da5('0x2d')](_0x1da5('0x2c'),new LocalStrategy({'usernameField':_0x1da5('0x19'),'passwordField':_0x1da5('0x1a')},function(_0x145210,_0x124101,_0x488e46){return ActiveDirectoryAuthenticate(db[_0x1da5('0x2e')],_0x145210,_0x124101,_0x488e46);})); \ No newline at end of file +var _0xdac5=['findOne','password','salt','role','disabled','blockedAt','online','user','name','domain','blocked','add','minutes','clearBlockUser','getLicense','catch','status','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','use','passport','passport-local','Strategy','moment','activedirectory2','bluebird','../../config/utils','../../config/environment','../../config/logger','activedirectory','undefined','baseDN','url','error','Error\x20authenticate\x20%s:\x20%s','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled'];(function(_0x38c644,_0x3e695d){var _0x33f443=function(_0x3c8208){while(--_0x3c8208){_0x38c644['push'](_0x38c644['shift']());}};_0x33f443(++_0x3e695d);}(_0xdac5,0x159));var _0x5dac=function(_0x28419f,_0x4c48a7){_0x28419f=_0x28419f-0x0;var _0xafa7f=_0xdac5[_0x28419f];return _0xafa7f;};'use strict';var passport=require(_0x5dac('0x0'));var LocalStrategy=require(_0x5dac('0x1'))[_0x5dac('0x2')];var moment=require(_0x5dac('0x3'));var ActiveDirectory=require(_0x5dac('0x4'));var BPromise=require(_0x5dac('0x5'));var util=require('util');var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0x5dac('0x6'));var config=require(_0x5dac('0x7'));var logger=require(_0x5dac('0x8'))('api');function isActiveDirectoryConfigured(_0x4b30da){var _0x4ca638=![];if(typeof _0x4b30da[_0x5dac('0x9')]!==_0x5dac('0xa')){_0x4ca638=_0x4b30da[_0x5dac('0x9')][_0x5dac('0xb')]&&_0x4b30da[_0x5dac('0x9')][_0x5dac('0xc')]&&_0x4b30da[_0x5dac('0x9')]['domain'];}return _0x4ca638;}function adAuthenticate(_0x4db839,_0x3a8d29,_0x297458){return new BPromise(function(_0x5e1be4,_0x4e8c77){try{var _0x23cf2e=new ActiveDirectory(_0x4db839);_0x23cf2e['authenticate'](_0x3a8d29,_0x297458,function(_0x5dd2e8,_0x17fa6e){if(_0x5dd2e8){logger[_0x5dac('0xd')](_0x5dac('0xe'),_0x3a8d29,util[_0x5dac('0xf')](_0x5dd2e8,{'showHidden':![],'depth':null}));_0x4e8c77('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x17fa6e){logger[_0x5dac('0xd')](_0x5dac('0x10'),_0x3a8d29);_0x4e8c77('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x5e1be4(_0x17fa6e);}});}catch(_0x46dbea){_0x4e8c77(_0x46dbea);}});}function ActiveDirectoryAuthenticate(_0x1ba8fd,_0x2e4396,_0x4182ef,_0x1ddbf3){var _0x29542c,_0x59d1d8;if(!isActiveDirectoryConfigured(config)){logger[_0x5dac('0xd')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x2e4396);return _0x1ddbf3(null,![],{'message':_0x5dac('0x11')});}return db[_0x5dac('0x12')]['findOne']({'where':{'id':0x1},'attributes':[_0x5dac('0x13'),_0x5dac('0x14')],'raw':!![]})[_0x5dac('0x15')](function(_0x291c33){_0x29542c=_0x291c33;if(!_0x29542c[_0x5dac('0x13')]){logger[_0x5dac('0xd')](_0x5dac('0x16'),_0x2e4396);throw new Error(_0x5dac('0x11'));}return _0x1ba8fd[_0x5dac('0x17')]({'attributes':['id','name',_0x5dac('0x18'),_0x5dac('0x19'),_0x5dac('0x1a'),_0x5dac('0x1b'),'blocked',_0x5dac('0x1c'),_0x5dac('0x1d')],'where':{'name':_0x2e4396,'role':{'$or':['admin',_0x5dac('0x1e'),'agent']},'adSsoEnabled':!![]}});})['then'](function(_0x553af4){if(!_0x553af4||_0x553af4&&_0x553af4[_0x5dac('0x1f')]!==_0x2e4396){throw new Error(_0x5dac('0x11'));}_0x59d1d8=_0x553af4;var _0x2e1604=_0x59d1d8[_0x5dac('0x1f')]+'@'+config[_0x5dac('0x9')][_0x5dac('0x20')];return adAuthenticate(config['activedirectory'],_0x2e1604,_0x4182ef);})[_0x5dac('0x15')](function(_0x36177f){if(_0x59d1d8[_0x5dac('0x1b')]){throw new Error(_0x5dac('0x11'));}if(_0x29542c[_0x5dac('0x14')]>0x0){if(_0x59d1d8[_0x5dac('0x21')]){if(moment(_0x59d1d8[_0x5dac('0x1c')])[_0x5dac('0x22')](_0x29542c['blockDuration'],_0x5dac('0x23'))>moment()){throw new Error(_0x5dac('0x11'));}return utils[_0x5dac('0x24')](_0x59d1d8,0x0,![],null)[_0x5dac('0x15')](function(){return utils[_0x5dac('0x25')](_0x59d1d8);})[_0x5dac('0x15')](function(){return _0x1ddbf3(null,_0x59d1d8);});}else{return utils[_0x5dac('0x25')](_0x59d1d8)[_0x5dac('0x15')](function(){return _0x1ddbf3(null,_0x59d1d8);});}}else{return utils[_0x5dac('0x25')](_0x59d1d8)[_0x5dac('0x15')](function(){return _0x1ddbf3(null,_0x59d1d8);});}})[_0x5dac('0x26')](function(_0xd24521){return _0x1ddbf3(null,![],_0xd24521);});}function handleError(_0xacd19,_0x1b4e44,_0x1b0f9b){return _0xacd19[_0x5dac('0x27')](_0x1b4e44||0x1f4)['send']({'message':_0x1b0f9b?_0x1b0f9b[_0x5dac('0x28')]||_0x1b0f9b:''});}exports[_0x5dac('0x29')]=function(_0xb35ac7,_0x4f7317,_0x649ebe){passport['authenticate'](_0x5dac('0x2a'),function(_0x1d00af,_0x9bdf00,_0x355bef){var _0x39aa84=_0x1d00af||_0x355bef;if(_0x39aa84){return handleError(_0x4f7317,0x191,_0x39aa84);}if(!_0x9bdf00){return handleError(_0x4f7317,0x194,{'message':_0x5dac('0x2b')});}else{var _0x465906={'payload':{'id':_0x9bdf00['id'],'role':_0x9bdf00[_0x5dac('0x1a')]},'options':{'expiresIn':0x15180}};return authService[_0x5dac('0x2c')](_0x465906)[_0x5dac('0x15')](function(_0xf1f7d4){_0x4f7317['json']({'id':_0x9bdf00['id'],'token':_0xf1f7d4,'statusCall':'','isAlreadyLogged':_0x9bdf00[_0x5dac('0x1d')]});});}})(_0xb35ac7,_0x4f7317,_0x649ebe);};passport[_0x5dac('0x2d')](_0x5dac('0x2a'),new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x49e07b,_0x5c2f9d,_0x5adb80){return ActiveDirectoryAuthenticate(db['User'],_0x49e07b,_0x5c2f9d,_0x5adb80);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index fe13be6..c2e7cfd 100644 --- a/server/api/authActiveDirectory/index.js +++ b/server/api/authActiveDirectory/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x663c=['post','exports','express','Router'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x663c,0x196));var _0xc663=function(_0x1e01ca,_0x14dc80){_0x1e01ca=_0x1e01ca-0x0;var _0x318e7f=_0x663c[_0x1e01ca];return _0x318e7f;};'use strict';var express=require(_0xc663('0x0'));var router=express[_0xc663('0x1')]();var controller=require('./authActiveDirectory.controller');router[_0xc663('0x2')]('/',controller['login']);module[_0xc663('0x3')]=router; \ No newline at end of file +var _0xaca4=['exports','express','Router','./authActiveDirectory.controller','post','login'];(function(_0x4a3c92,_0x323bfc){var _0x47a918=function(_0x4b74a6){while(--_0x4b74a6){_0x4a3c92['push'](_0x4a3c92['shift']());}};_0x47a918(++_0x323bfc);}(_0xaca4,0xd9));var _0x4aca=function(_0x4c5202,_0x35c30f){_0x4c5202=_0x4c5202-0x0;var _0x38dd6b=_0xaca4[_0x4c5202];return _0x38dd6b;};'use strict';var express=require(_0x4aca('0x0'));var router=express[_0x4aca('0x1')]();var controller=require(_0x4aca('0x2'));router[_0x4aca('0x3')]('/',controller[_0x4aca('0x4')]);module[_0x4aca('0x5')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index c984ffc..a068811 100644 --- a/server/api/authGoogle/authGoogle.controller.js +++ b/server/api/authGoogle/authGoogle.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x7a54,0x106));var _0x47a5=function(_0x2554fb,_0x5b724a){_0x2554fb=_0x2554fb-0x0;var _0x1ffb55=_0x7a54[_0x2554fb];return _0x1ffb55;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file +var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x7a54,0x106));var _0x47a5=function(_0x2f4080,_0x34c89e){_0x2f4080=_0x2f4080-0x0;var _0x115391=_0x7a54[_0x2f4080];return _0x115391;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 583db8a..e69154f 100644 --- a/server/api/authGoogle/index.js +++ b/server/api/authGoogle/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5e93=['../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x5e93,0x174));var _0x35e9=function(_0x2b7c86,_0x3d3ab4){_0x2b7c86=_0x2b7c86-0x0;var _0x5d7cd3=_0x5e93[_0x2b7c86];return _0x5d7cd3;};'use strict';var express=require(_0x35e9('0x0'));var passport=require(_0x35e9('0x1'));var router=express[_0x35e9('0x2')]();var controller=require(_0x35e9('0x3'));var userController=require(_0x35e9('0x4'));var authService=require(_0x35e9('0x5'));router[_0x35e9('0x6')]('/',controller[_0x35e9('0x7')]);router[_0x35e9('0x6')](_0x35e9('0x8'),controller[_0x35e9('0x9')],authService[_0x35e9('0xa')],userController['login'],authService[_0x35e9('0xb')]);module[_0x35e9('0xc')]=router; \ No newline at end of file +var _0x47ac=['../../components/auth/service','get','login','exports','express','passport','Router','../user/user.controller.js'];(function(_0x2073f8,_0x34a29d){var _0x11c069=function(_0x1c49ab){while(--_0x1c49ab){_0x2073f8['push'](_0x2073f8['shift']());}};_0x11c069(++_0x34a29d);}(_0x47ac,0x14c));var _0xc47a=function(_0x2241db,_0x3c3572){_0x2241db=_0x2241db-0x0;var _0x36e3bd=_0x47ac[_0x2241db];return _0x36e3bd;};'use strict';var express=require(_0xc47a('0x0'));var passport=require(_0xc47a('0x1'));var router=express[_0xc47a('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0xc47a('0x3'));var authService=require(_0xc47a('0x4'));router[_0xc47a('0x5')]('/',controller[_0xc47a('0x6')]);router['get']('/callback',controller['callback'],authService['isMiddleware'],userController[_0xc47a('0x6')],authService['setTokenCookie']);module[_0xc47a('0x7')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index f2b9f08..8e03942 100644 --- a/server/api/authLocal/authLocal.controller.js +++ b/server/api/authLocal/authLocal.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdd8c=['MailAccount','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','send','login','authenticate','local-login','json','forgot','Email\x20parameter\x20is\x20missing','generate','body','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','host','status','Reset\x20Email\x20sent!','reset','find','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','save','use','User','util','passport-local','Strategy','jayson/promise','lodash','moment','../../mysqldb','../../config/utils','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','minutes','clearBlockUser','getLicense','catch'];(function(_0x4cc13,_0x40f7a6){var _0x801be7=function(_0x103cda){while(--_0x103cda){_0x4cc13['push'](_0x4cc13['shift']());}};_0x801be7(++_0x40f7a6);}(_0xdd8c,0x7c));var _0xcdd8=function(_0x322dce,_0x2c374c){_0x322dce=_0x322dce-0x0;var _0x128e19=_0xdd8c[_0x322dce];return _0x128e19;};'use strict';var util=require(_0xcdd8('0x0'));var passport=require('passport');var LocalStrategy=require(_0xcdd8('0x1'))[_0xcdd8('0x2')];var jayson=require(_0xcdd8('0x3'));var _=require(_0xcdd8('0x4'));var rs=require('randomstring');var moment=require(_0xcdd8('0x5'));var db=require(_0xcdd8('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xcdd8('0x7'));var client=jayson['client']['http']({'port':0x232b});function localAuthenticate(_0x42daa6,_0xfefd03,_0x2c60bf,_0x556cad){var _0x540430,_0x40bfaf;return db[_0xcdd8('0x8')][_0xcdd8('0x9')]({'where':{'id':0x1},'attributes':[_0xcdd8('0xa'),_0xcdd8('0xb')],'raw':!![]})[_0xcdd8('0xc')](function(_0x386c9f){_0x540430=_0x386c9f;return _0x42daa6[_0xcdd8('0x9')]({'attributes':['id',_0xcdd8('0xd'),_0xcdd8('0xe'),_0xcdd8('0xf'),_0xcdd8('0x10'),_0xcdd8('0x11'),'blocked',_0xcdd8('0x12'),_0xcdd8('0x13')],'where':{'name':_0xfefd03,'role':{'$or':[_0xcdd8('0x14'),_0xcdd8('0x15'),_0xcdd8('0x16')]}}});})[_0xcdd8('0xc')](function(_0x4cac91){if(!_0x4cac91||_0x4cac91&&_0x4cac91['name']!==_0xfefd03){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x40bfaf=_0x4cac91;return _0x40bfaf;}})['then'](function(){_0x40bfaf['authenticate'](_0x2c60bf,function(_0x52de36,_0x3daf13){var _0x345042=_0x40bfaf[_0xcdd8('0x13')]+0x1;if(_0x52de36){return _0x556cad(_0x52de36);}else if(!_0x3daf13){if(_0x40bfaf[_0xcdd8('0x11')]){return _0x556cad(null,![],{'message':_0xcdd8('0x17')});}else if(_0x540430[_0xcdd8('0xa')]>0x0){if(_0x40bfaf[_0xcdd8('0x18')]){if(_0x540430['blockDuration']>0x0){if(moment(_0x40bfaf[_0xcdd8('0x12')])[_0xcdd8('0x19')](_0x540430['blockDuration'],_0xcdd8('0x1a'))>moment()){return _0x556cad(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xcdd8('0x1b')](_0x40bfaf,_0x345042,![],null)[_0xcdd8('0xc')](function(){return _0x556cad(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x556cad(null,![],{'message':_0xcdd8('0x17')});}}else{if(_0x345042>=_0x540430[_0xcdd8('0xa')]){return utils[_0xcdd8('0x1b')](_0x40bfaf,0x0,!![],moment())[_0xcdd8('0xc')](function(){return _0x556cad(null,![],{'message':_0xcdd8('0x17')});});}else{return utils[_0xcdd8('0x1b')](_0x40bfaf,_0x345042,![],null)[_0xcdd8('0xc')](function(){return _0x556cad(null,![],{'message':_0xcdd8('0x17')});});}}}else{return _0x556cad(null,![],{'message':_0xcdd8('0x17')});}}else{if(_0x40bfaf['disabled']){return _0x556cad(null,![],{'message':_0xcdd8('0x17')});}else if(_0x540430[_0xcdd8('0xa')]>0x0){if(_0x40bfaf['blocked']){if(_0x540430['blockDuration']>0x0){if(moment(_0x40bfaf[_0xcdd8('0x12')])[_0xcdd8('0x19')](_0x540430[_0xcdd8('0xb')],_0xcdd8('0x1a'))>moment()){return _0x556cad(null,![],{'message':_0xcdd8('0x17')});}else{return utils[_0xcdd8('0x1b')](_0x40bfaf,0x0,![],null)['then'](function(){return utils[_0xcdd8('0x1c')](_0x40bfaf);})[_0xcdd8('0xc')](function(){return _0x556cad(null,_0x40bfaf);});}}else{return _0x556cad(null,![],{'message':_0xcdd8('0x17')});}}else{return utils[_0xcdd8('0x1b')](_0x40bfaf,0x0,![],null)['then'](function(){return utils[_0xcdd8('0x1c')](_0x40bfaf);})['then'](function(){return _0x556cad(null,_0x40bfaf);})[_0xcdd8('0x1d')](function(_0x132600){return _0x556cad(null,![],_0x132600);});}}else{if(_0x40bfaf[_0xcdd8('0x18')]){return _0x556cad(null,![],{'message':_0xcdd8('0x17')});}else{return utils[_0xcdd8('0x1c')](_0x40bfaf)['then'](function(){return _0x556cad(null,_0x40bfaf);});}}}});})[_0xcdd8('0x1d')](function(_0x1e6f57){return _0x556cad(null,![],_0x1e6f57);});}function sendServiceMail(_0x3c628d){return db[_0xcdd8('0x1e')]['find']({'where':{'service':!![]},'attributes':['id',_0xcdd8('0xd'),_0xcdd8('0x1f')],'include':[{'model':db[_0xcdd8('0x20')],'as':_0xcdd8('0x21'),'include':[{'model':db[_0xcdd8('0x22')],'as':_0xcdd8('0x22')}]}]})[_0xcdd8('0xc')](function(_0x307bd2){if(!_0x307bd2){throw new Error(_0xcdd8('0x23'));}var _0x5aa256=_0x307bd2[_0xcdd8('0x24')]();var _0x188e8f={'account':_0x5aa256,'message':_['merge']({'from':util[_0xcdd8('0x25')]('\x22%s\x22\x20<%s>',_0x307bd2[_0xcdd8('0xd')],_0x307bd2[_0xcdd8('0x1f')]||_0x307bd2[_0xcdd8('0x21')][_0xcdd8('0x15')])},_0x3c628d)};return client[_0xcdd8('0x26')]('SendMail',_0x188e8f);})[_0xcdd8('0xc')](function(_0x2a63c0){if(_0x2a63c0[_0xcdd8('0x27')]){throw new Error(util['format'](_0xcdd8('0x28'),_0x2a63c0['error'][_0xcdd8('0x29')]||JSON[_0xcdd8('0x2a')](_0x2a63c0['error'])));}return!![];});}function handleError(_0x2c5350,_0x10543a,_0x1cab32){return _0x2c5350['status'](_0x10543a||0x1f4)[_0xcdd8('0x2b')]({'message':_0x1cab32?_0x1cab32[_0xcdd8('0x29')]||_0x1cab32:''});}exports[_0xcdd8('0x2c')]=function(_0x17dd7c,_0x3e0fb4,_0x593d3e){passport[_0xcdd8('0x2d')](_0xcdd8('0x2e'),function(_0x2fa6f8,_0x159af7,_0x1165d3){var _0x10bbbf=_0x2fa6f8||_0x1165d3;if(_0x10bbbf){return handleError(_0x3e0fb4,0x191,_0x10bbbf);}if(!_0x159af7){return handleError(_0x3e0fb4,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x2cabb3={'payload':{'id':_0x159af7['id'],'role':_0x159af7['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x2cabb3)['then'](function(_0x268e42){_0x3e0fb4[_0xcdd8('0x2f')]({'id':_0x159af7['id'],'token':_0x268e42,'statusCall':'','isAlreadyLogged':_0x159af7['online']});});}})(_0x17dd7c,_0x3e0fb4,_0x593d3e);};exports[_0xcdd8('0x30')]=function(_0x107203,_0x489aae){if(!_0x107203['body'][_0xcdd8('0x1f')]){return handleError(_0x489aae,0x1f4,{'message':_0xcdd8('0x31')});}var _0x57b0b0=rs[_0xcdd8('0x32')]();_0x107203[_0xcdd8('0x33')][_0xcdd8('0x1f')]=_0x107203['body'][_0xcdd8('0x1f')]['trim']()['toLowerCase']();var _0x363612;return db[_0xcdd8('0x8')][_0xcdd8('0x9')]({'where':{'id':0x1},'attributes':[_0xcdd8('0xa'),_0xcdd8('0xb')],'raw':!![]})[_0xcdd8('0xc')](function(_0x700487){_0x363612=_0x700487;return db['User']['find']({'where':{'email':_0x107203['body'][_0xcdd8('0x1f')]}});})[_0xcdd8('0xc')](function(_0x4c01fc){if(!_0x4c01fc){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x4c01fc[_0xcdd8('0x11')]){throw new Error(_0xcdd8('0x34'));}if(_0x4c01fc['blocked']){if(moment(_0x4c01fc[_0xcdd8('0x12')])[_0xcdd8('0x19')](_0x363612[_0xcdd8('0xb')],'minutes')>moment()){throw new Error(_0xcdd8('0x35'));}else{_0x4c01fc[_0xcdd8('0x18')]=![];_0x4c01fc[_0xcdd8('0x12')]=null;}}_0x4c01fc[_0xcdd8('0x36')]=_0x57b0b0;_0x4c01fc[_0xcdd8('0x37')]=Date['now']()+0x36ee80;return _0x4c01fc['save']();})[_0xcdd8('0xc')](function(){return sendServiceMail({'to':_0x107203[_0xcdd8('0x33')][_0xcdd8('0x1f')],'subject':_0xcdd8('0x38'),'text':_0xcdd8('0x39')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xcdd8('0x3a')+_0x107203[_0xcdd8('0x3b')][_0xcdd8('0x3c')]+'/reset/'+_0x57b0b0+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xcdd8('0xc')](function(){_0x489aae[_0xcdd8('0x3d')](0xc8)['send']({'message':_0xcdd8('0x3e')});})[_0xcdd8('0x1d')](function(_0x38f469){return handleError(_0x489aae,0x1f4,_0x38f469);});};exports[_0xcdd8('0x3f')]=function(_0x50f1a0,_0x22d7f0){return db['User'][_0xcdd8('0x40')]({'where':{'resetPasswordToken':_0x50f1a0[_0xcdd8('0x41')][_0xcdd8('0x42')],'resetPasswordExpires':{'$gt':Date[_0xcdd8('0x43')]()}}})[_0xcdd8('0xc')](function(_0x462473){if(!_0x462473){throw new Error(_0xcdd8('0x44'));}return db[_0xcdd8('0x8')][_0xcdd8('0x9')]({'attributes':['id',_0xcdd8('0x45'),_0xcdd8('0x46'),_0xcdd8('0x47')]})[_0xcdd8('0xc')](function(_0x4f4e07){if(_0x4f4e07['securePassword'])authService['validatePasswordPattern'](_0x50f1a0['body']['password']);if(!_0x4f4e07[_0xcdd8('0x46')]||!_0x462473[_0xcdd8('0x48')])return _0x462473;authService[_0xcdd8('0x49')](_0x50f1a0[_0xcdd8('0x33')][_0xcdd8('0xe')],_0x462473[_0xcdd8('0x48')],_0x4f4e07[_0xcdd8('0x47')]);return _0x462473;})['then'](function(){_0x462473[_0xcdd8('0xe')]=_0x50f1a0[_0xcdd8('0x33')][_0xcdd8('0xe')];_0x462473['resetPasswordToken']=null;_0x462473[_0xcdd8('0x37')]=null;return _0x462473[_0xcdd8('0x4a')]();});})[_0xcdd8('0xc')](function(){_0x22d7f0[_0xcdd8('0x3d')](0xc8)[_0xcdd8('0x2b')]({'message':'Password\x20reset!'});})['catch'](function(_0x4a6f8f){return handleError(_0x22d7f0,0x1f4,_0x4a6f8f);});};passport[_0xcdd8('0x4b')]('local-login',new LocalStrategy({'usernameField':_0xcdd8('0xd'),'passwordField':_0xcdd8('0xe')},function(_0x4f7810,_0x2233de,_0x5c33e2){return localAuthenticate(db[_0xcdd8('0x4c')],_0x4f7810,_0x2233de,_0x5c33e2);})); \ No newline at end of file +var _0xc48a=['\x22%s\x22\x20<%s>','SendMail','error','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online','body','generate','trim','toLowerCase','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','validatePasswordPattern','previousPasswords','passwordHistoryLimit','Password\x20reset!','use','passport','passport-local','Strategy','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','Setting','allowedLoginAttempts','blockDuration','then','findOne','name','password','salt','disabled','blockedAt','loginAttempts','user','agent','authenticate','blocked','add','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','catch','find','email','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format'];(function(_0x309770,_0x32bd73){var _0x30c86b=function(_0x1adcf2){while(--_0x1adcf2){_0x309770['push'](_0x309770['shift']());}};_0x30c86b(++_0x32bd73);}(_0xc48a,0x74));var _0xac48=function(_0x7a7d01,_0x34253c){_0x7a7d01=_0x7a7d01-0x0;var _0x312c6c=_0xc48a[_0x7a7d01];return _0x312c6c;};'use strict';var util=require('util');var passport=require(_0xac48('0x0'));var LocalStrategy=require(_0xac48('0x1'))[_0xac48('0x2')];var jayson=require('jayson/promise');var _=require(_0xac48('0x3'));var rs=require('randomstring');var moment=require(_0xac48('0x4'));var db=require(_0xac48('0x5'))['db'];var authService=require(_0xac48('0x6'));var utils=require(_0xac48('0x7'));var client=jayson['client'][_0xac48('0x8')]({'port':0x232b});function localAuthenticate(_0x1b057a,_0x269c1c,_0x1f25ec,_0x403ed3){var _0x2fa728,_0x738b44;return db[_0xac48('0x9')]['findOne']({'where':{'id':0x1},'attributes':[_0xac48('0xa'),_0xac48('0xb')],'raw':!![]})[_0xac48('0xc')](function(_0x437ba3){_0x2fa728=_0x437ba3;return _0x1b057a[_0xac48('0xd')]({'attributes':['id',_0xac48('0xe'),_0xac48('0xf'),_0xac48('0x10'),'role',_0xac48('0x11'),'blocked',_0xac48('0x12'),_0xac48('0x13')],'where':{'name':_0x269c1c,'role':{'$or':['admin',_0xac48('0x14'),_0xac48('0x15')]}}});})[_0xac48('0xc')](function(_0x2bb0f3){if(!_0x2bb0f3||_0x2bb0f3&&_0x2bb0f3['name']!==_0x269c1c){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x738b44=_0x2bb0f3;return _0x738b44;}})['then'](function(){_0x738b44[_0xac48('0x16')](_0x1f25ec,function(_0x163979,_0x3ce77b){var _0x43a1fc=_0x738b44[_0xac48('0x13')]+0x1;if(_0x163979){return _0x403ed3(_0x163979);}else if(!_0x3ce77b){if(_0x738b44[_0xac48('0x11')]){return _0x403ed3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x2fa728[_0xac48('0xa')]>0x0){if(_0x738b44[_0xac48('0x17')]){if(_0x2fa728[_0xac48('0xb')]>0x0){if(moment(_0x738b44['blockedAt'])[_0xac48('0x18')](_0x2fa728[_0xac48('0xb')],_0xac48('0x19'))>moment()){return _0x403ed3(null,![],{'message':_0xac48('0x1a')});}else{return utils['clearBlockUser'](_0x738b44,_0x43a1fc,![],null)[_0xac48('0xc')](function(){return _0x403ed3(null,![],{'message':_0xac48('0x1a')});});}}else{return _0x403ed3(null,![],{'message':_0xac48('0x1a')});}}else{if(_0x43a1fc>=_0x2fa728['allowedLoginAttempts']){return utils[_0xac48('0x1b')](_0x738b44,0x0,!![],moment())[_0xac48('0xc')](function(){return _0x403ed3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xac48('0x1b')](_0x738b44,_0x43a1fc,![],null)[_0xac48('0xc')](function(){return _0x403ed3(null,![],{'message':_0xac48('0x1a')});});}}}else{return _0x403ed3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x738b44['disabled']){return _0x403ed3(null,![],{'message':_0xac48('0x1a')});}else if(_0x2fa728['allowedLoginAttempts']>0x0){if(_0x738b44[_0xac48('0x17')]){if(_0x2fa728[_0xac48('0xb')]>0x0){if(moment(_0x738b44[_0xac48('0x12')])[_0xac48('0x18')](_0x2fa728[_0xac48('0xb')],_0xac48('0x19'))>moment()){return _0x403ed3(null,![],{'message':_0xac48('0x1a')});}else{return utils['clearBlockUser'](_0x738b44,0x0,![],null)['then'](function(){return utils[_0xac48('0x1c')](_0x738b44);})[_0xac48('0xc')](function(){return _0x403ed3(null,_0x738b44);});}}else{return _0x403ed3(null,![],{'message':_0xac48('0x1a')});}}else{return utils[_0xac48('0x1b')](_0x738b44,0x0,![],null)[_0xac48('0xc')](function(){return utils[_0xac48('0x1c')](_0x738b44);})[_0xac48('0xc')](function(){return _0x403ed3(null,_0x738b44);})['catch'](function(_0x2a0fb5){return _0x403ed3(null,![],_0x2a0fb5);});}}else{if(_0x738b44['blocked']){return _0x403ed3(null,![],{'message':_0xac48('0x1a')});}else{return utils[_0xac48('0x1c')](_0x738b44)[_0xac48('0xc')](function(){return _0x403ed3(null,_0x738b44);});}}}});})[_0xac48('0x1d')](function(_0x4218f6){return _0x403ed3(null,![],_0x4218f6);});}function sendServiceMail(_0x2c238a){return db['MailAccount'][_0xac48('0x1e')]({'where':{'service':!![]},'attributes':['id','name',_0xac48('0x1f')],'include':[{'model':db[_0xac48('0x20')],'as':'Smtp','include':[{'model':db['CloudProvider'],'as':_0xac48('0x21')}]}]})[_0xac48('0xc')](function(_0xb0b3f2){if(!_0xb0b3f2){throw new Error(_0xac48('0x22'));}var _0xb93397=_0xb0b3f2[_0xac48('0x23')]();var _0x2cdeb0={'account':_0xb93397,'message':_[_0xac48('0x24')]({'from':util[_0xac48('0x25')](_0xac48('0x26'),_0xb0b3f2['name'],_0xb0b3f2['email']||_0xb0b3f2['Smtp']['user'])},_0x2c238a)};return client['request'](_0xac48('0x27'),_0x2cdeb0);})[_0xac48('0xc')](function(_0x334dcf){if(_0x334dcf[_0xac48('0x28')]){throw new Error(util[_0xac48('0x25')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x334dcf['error'][_0xac48('0x29')]||JSON[_0xac48('0x2a')](_0x334dcf[_0xac48('0x28')])));}return!![];});}function handleError(_0x595555,_0x5c42c0,_0x4a3c2b){return _0x595555[_0xac48('0x2b')](_0x5c42c0||0x1f4)[_0xac48('0x2c')]({'message':_0x4a3c2b?_0x4a3c2b[_0xac48('0x29')]||_0x4a3c2b:''});}exports[_0xac48('0x2d')]=function(_0x1e6dd9,_0x328460,_0x2b040c){passport[_0xac48('0x16')](_0xac48('0x2e'),function(_0xa3731e,_0x148c61,_0x27f291){var _0x391084=_0xa3731e||_0x27f291;if(_0x391084){return handleError(_0x328460,0x191,_0x391084);}if(!_0x148c61){return handleError(_0x328460,0x194,{'message':_0xac48('0x2f')});}else{var _0xface0={'payload':{'id':_0x148c61['id'],'role':_0x148c61[_0xac48('0x30')]},'options':{'expiresIn':0x15180}};return authService[_0xac48('0x31')](_0xface0)[_0xac48('0xc')](function(_0x8f429a){_0x328460[_0xac48('0x32')]({'id':_0x148c61['id'],'token':_0x8f429a,'statusCall':'','isAlreadyLogged':_0x148c61[_0xac48('0x33')]});});}})(_0x1e6dd9,_0x328460,_0x2b040c);};exports['forgot']=function(_0x2e52fe,_0xd48eb7){if(!_0x2e52fe[_0xac48('0x34')]['email']){return handleError(_0xd48eb7,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x127343=rs[_0xac48('0x35')]();_0x2e52fe['body'][_0xac48('0x1f')]=_0x2e52fe[_0xac48('0x34')]['email'][_0xac48('0x36')]()[_0xac48('0x37')]();var _0x1cf5a0;return db[_0xac48('0x9')]['findOne']({'where':{'id':0x1},'attributes':[_0xac48('0xa'),_0xac48('0xb')],'raw':!![]})[_0xac48('0xc')](function(_0x49d203){_0x1cf5a0=_0x49d203;return db[_0xac48('0x38')][_0xac48('0x1e')]({'where':{'email':_0x2e52fe[_0xac48('0x34')][_0xac48('0x1f')]}});})['then'](function(_0x5a66f1){if(!_0x5a66f1){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x5a66f1['disabled']){throw new Error(_0xac48('0x39'));}if(_0x5a66f1[_0xac48('0x17')]){if(moment(_0x5a66f1[_0xac48('0x12')])['add'](_0x1cf5a0[_0xac48('0xb')],_0xac48('0x19'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x5a66f1[_0xac48('0x17')]=![];_0x5a66f1[_0xac48('0x12')]=null;}}_0x5a66f1[_0xac48('0x3a')]=_0x127343;_0x5a66f1[_0xac48('0x3b')]=Date['now']()+0x36ee80;return _0x5a66f1[_0xac48('0x3c')]();})[_0xac48('0xc')](function(){return sendServiceMail({'to':_0x2e52fe[_0xac48('0x34')]['email'],'subject':_0xac48('0x3d'),'text':_0xac48('0x3e')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xac48('0x3f')+_0x2e52fe[_0xac48('0x40')]['host']+'/reset/'+_0x127343+'\x0a\x0a'+_0xac48('0x41')});})[_0xac48('0xc')](function(){_0xd48eb7['status'](0xc8)[_0xac48('0x2c')]({'message':_0xac48('0x42')});})[_0xac48('0x1d')](function(_0x418d5c){return handleError(_0xd48eb7,0x1f4,_0x418d5c);});};exports[_0xac48('0x43')]=function(_0x289c27,_0x7a87a9){return db['User'][_0xac48('0x1e')]({'where':{'resetPasswordToken':_0x289c27['params'][_0xac48('0x44')],'resetPasswordExpires':{'$gt':Date[_0xac48('0x45')]()}}})[_0xac48('0xc')](function(_0x18f776){if(!_0x18f776){throw new Error(_0xac48('0x46'));}return db['Setting'][_0xac48('0xd')]({'attributes':['id','securePassword',_0xac48('0x47'),'passwordHistoryLimit']})['then'](function(_0x22cf09){if(_0x22cf09['securePassword'])authService[_0xac48('0x48')](_0x289c27[_0xac48('0x34')][_0xac48('0xf')]);if(!_0x22cf09[_0xac48('0x47')]||!_0x18f776[_0xac48('0x49')])return _0x18f776;authService['validatePasswordHistory'](_0x289c27['body']['password'],_0x18f776[_0xac48('0x49')],_0x22cf09[_0xac48('0x4a')]);return _0x18f776;})[_0xac48('0xc')](function(){_0x18f776[_0xac48('0xf')]=_0x289c27[_0xac48('0x34')][_0xac48('0xf')];_0x18f776[_0xac48('0x3a')]=null;_0x18f776[_0xac48('0x3b')]=null;return _0x18f776[_0xac48('0x3c')]();});})[_0xac48('0xc')](function(){_0x7a87a9[_0xac48('0x2b')](0xc8)[_0xac48('0x2c')]({'message':_0xac48('0x4b')});})[_0xac48('0x1d')](function(_0x454165){return handleError(_0x7a87a9,0x1f4,_0x454165);});};passport[_0xac48('0x4c')](_0xac48('0x2e'),new LocalStrategy({'usernameField':_0xac48('0xe'),'passwordField':'password'},function(_0x57626b,_0x1fd6b8,_0x34e7d7){return localAuthenticate(db[_0xac48('0x38')],_0x57626b,_0x1fd6b8,_0x34e7d7);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index e583f0a..402bc00 100644 --- a/server/api/authLocal/index.js +++ b/server/api/authLocal/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2fed=['post','login','/forgot','/reset/:token','reset','exports','express','./authLocal.controller'];(function(_0x16065c,_0x4c193f){var _0x160c85=function(_0x389bc5){while(--_0x389bc5){_0x16065c['push'](_0x16065c['shift']());}};_0x160c85(++_0x4c193f);}(_0x2fed,0x7e));var _0xd2fe=function(_0x5bdc41,_0x4edf28){_0x5bdc41=_0x5bdc41-0x0;var _0x21b11e=_0x2fed[_0x5bdc41];return _0x21b11e;};'use strict';var express=require(_0xd2fe('0x0'));var router=express['Router']();var controller=require(_0xd2fe('0x1'));router[_0xd2fe('0x2')]('/',controller[_0xd2fe('0x3')]);router['post'](_0xd2fe('0x4'),controller['forgot']);router['post'](_0xd2fe('0x5'),controller[_0xd2fe('0x6')]);module[_0xd2fe('0x7')]=router; \ No newline at end of file +var _0x507b=['exports','Router','login','post','/forgot','forgot','/reset/:token','reset'];(function(_0x32b30c,_0x2d5ec8){var _0xcfc212=function(_0x42e668){while(--_0x42e668){_0x32b30c['push'](_0x32b30c['shift']());}};_0xcfc212(++_0x2d5ec8);}(_0x507b,0x1e1));var _0xb507=function(_0x58b812,_0x5ae1de){_0x58b812=_0x58b812-0x0;var _0x1f3712=_0x507b[_0x58b812];return _0x1f3712;};'use strict';var express=require('express');var router=express[_0xb507('0x0')]();var controller=require('./authLocal.controller');router['post']('/',controller[_0xb507('0x1')]);router[_0xb507('0x2')](_0xb507('0x3'),controller[_0xb507('0x4')]);router[_0xb507('0x2')](_0xb507('0x5'),controller[_0xb507('0x6')]);module[_0xb507('0x7')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index bbd2904..e7e5d03 100644 --- a/server/api/automation/automation.attributes.js +++ b/server/api/automation/automation.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf67f=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x12fbd3,_0x3912af){var _0x2a1f2e=function(_0x2790db){while(--_0x2790db){_0x12fbd3['push'](_0x12fbd3['shift']());}};_0x2a1f2e(++_0x3912af);}(_0xf67f,0x12a));var _0xff67=function(_0x591781,_0x8e0ed2){_0x591781=_0x591781-0x0;var _0x315bd9=_0xf67f[_0x591781];return _0x315bd9;};'use strict';var Sequelize=require(_0xff67('0x0'));module[_0xff67('0x1')]={'name':{'type':Sequelize[_0xff67('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xff67('0x2')]},'description':{'type':Sequelize[_0xff67('0x2')]},'status':{'type':Sequelize[_0xff67('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xff67('0x4')],'defaultValue':0xa}}; \ No newline at end of file +var _0x014b=['sequelize','STRING','INTEGER'];(function(_0x254abd,_0x1ab7f0){var _0x31bf1b=function(_0x447fd8){while(--_0x447fd8){_0x254abd['push'](_0x254abd['shift']());}};_0x31bf1b(++_0x1ab7f0);}(_0x014b,0x1bc));var _0xb014=function(_0x112198,_0x52c556){_0x112198=_0x112198-0x0;var _0x21b4b3=_0x014b[_0x112198];return _0x21b4b3;};'use strict';var Sequelize=require(_0xb014('0x0'));module['exports']={'name':{'type':Sequelize[_0xb014('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb014('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xb014('0x2')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index e53603a..413548c 100644 --- a/server/api/automation/automation.controller.js +++ b/server/api/automation/automation.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc0e6=['Automation','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','Condition','addConditions','ids','getConditions','pick','addActions','Action','omit','getActions','findOne','order','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map'];(function(_0x4d32e9,_0x390d44){var _0x2d9ece=function(_0xabbd89){while(--_0xabbd89){_0x4d32e9['push'](_0x4d32e9['shift']());}};_0x2d9ece(++_0x390d44);}(_0xc0e6,0x7e));var _0x6c0e=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xc0e6[_0x4ae6ef];return _0x3cbb4e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6c0e('0x0'));var zipdir=require(_0x6c0e('0x1'));var jsonpatch=require(_0x6c0e('0x2'));var rp=require(_0x6c0e('0x3'));var moment=require(_0x6c0e('0x4'));var BPromise=require(_0x6c0e('0x5'));var Mustache=require(_0x6c0e('0x6'));var util=require('util');var path=require(_0x6c0e('0x7'));var sox=require(_0x6c0e('0x8'));var csv=require(_0x6c0e('0x9'));var ejs=require(_0x6c0e('0xa'));var fs=require('fs');var fs_extra=require(_0x6c0e('0xb'));var _=require(_0x6c0e('0xc'));var squel=require(_0x6c0e('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6c0e('0xe'));var toCsv=require(_0x6c0e('0x9'));var querystring=require(_0x6c0e('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6c0e('0x10'));var qs=require(_0x6c0e('0x11'));var as=require(_0x6c0e('0x12'));var hardwareService=require(_0x6c0e('0x13'));var logger=require('../../config/logger')(_0x6c0e('0x14'));var utils=require('../../config/utils');var config=require(_0x6c0e('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e95ae,_0x5c79db){_0x5c79db=_0x5c79db||0xcc;return function(_0x1e8fb3){if(_0x1e8fb3){return _0x5e95ae[_0x6c0e('0x16')](_0x5c79db);}return _0x5e95ae['status'](_0x5c79db)[_0x6c0e('0x17')]();};}function respondWithResult(_0x1d5312,_0x4a9ad8){_0x4a9ad8=_0x4a9ad8||0xc8;return function(_0x3d5081){if(_0x3d5081){return _0x1d5312[_0x6c0e('0x18')](_0x4a9ad8)[_0x6c0e('0x19')](_0x3d5081);}};}function respondWithFilteredResult(_0x43bb26,_0x4567e2){return function(_0x2a740b){if(_0x2a740b){var _0x281621=typeof _0x4567e2[_0x6c0e('0x1a')]===_0x6c0e('0x1b')&&typeof _0x4567e2[_0x6c0e('0x1c')]===_0x6c0e('0x1b');var _0x972f3c=_0x2a740b['count'];var _0x28743b=_0x281621?0x0:_0x4567e2[_0x6c0e('0x1a')];var _0x32d8e7=_0x281621?_0x2a740b[_0x6c0e('0x1d')]:_0x4567e2[_0x6c0e('0x1a')]+_0x4567e2[_0x6c0e('0x1c')];var _0x277e2e;if(_0x32d8e7>=_0x972f3c){_0x32d8e7=_0x972f3c;_0x277e2e=0xc8;}else{_0x277e2e=0xce;}_0x43bb26[_0x6c0e('0x18')](_0x277e2e);return _0x43bb26[_0x6c0e('0x1e')](_0x6c0e('0x1f'),_0x28743b+'-'+_0x32d8e7+'/'+_0x972f3c)[_0x6c0e('0x19')](_0x2a740b);}return null;};}function patchUpdates(_0x23c307){return function(_0x389705){try{jsonpatch[_0x6c0e('0x20')](_0x389705,_0x23c307,!![]);}catch(_0x3ff3ba){return BPromise[_0x6c0e('0x21')](_0x3ff3ba);}return _0x389705[_0x6c0e('0x22')]();};}function saveUpdates(_0x4fb7b8,_0x5bbcf7){return function(_0x2f8e84){if(_0x2f8e84){return _0x2f8e84[_0x6c0e('0x23')](_0x4fb7b8)[_0x6c0e('0x24')](function(_0x7c6d0c){return _0x7c6d0c;});}return null;};}function removeEntity(_0x783771,_0x47e6f1){return function(_0x427951){if(_0x427951){return _0x427951[_0x6c0e('0x25')]()[_0x6c0e('0x24')](function(){_0x783771['status'](0xcc)[_0x6c0e('0x17')]();});}};}function handleEntityNotFound(_0x481284,_0x51ba92){return function(_0x1f502d){if(!_0x1f502d){_0x481284[_0x6c0e('0x16')](0x194);}return _0x1f502d;};}function handleError(_0x4c79ac,_0x2d718d){_0x2d718d=_0x2d718d||0x1f4;return function(_0x23c285){logger[_0x6c0e('0x26')](_0x23c285[_0x6c0e('0x27')]);if(_0x23c285[_0x6c0e('0x28')]){delete _0x23c285[_0x6c0e('0x28')];}_0x4c79ac[_0x6c0e('0x18')](_0x2d718d)[_0x6c0e('0x29')](_0x23c285);};}exports[_0x6c0e('0x2a')]=function(_0x37e7ae,_0x4bd1d7){var _0x9cbc32={},_0x18df2d={},_0x47810f={'count':0x0,'rows':[]};var _0x8b1eeb=_[_0x6c0e('0x2b')](db[_0x6c0e('0x2c')]['rawAttributes'],function(_0x5f43e0){return{'name':_0x5f43e0['fieldName'],'type':_0x5f43e0['type'][_0x6c0e('0x2d')]};});_0x18df2d[_0x6c0e('0x2e')]=_[_0x6c0e('0x2b')](_0x8b1eeb,_0x6c0e('0x28'));_0x18df2d[_0x6c0e('0x2f')]=_[_0x6c0e('0x30')](_0x37e7ae[_0x6c0e('0x2f')]);_0x18df2d['filters']=_[_0x6c0e('0x31')](_0x18df2d[_0x6c0e('0x2e')],_0x18df2d['query']);_0x9cbc32['attributes']=_[_0x6c0e('0x31')](_0x18df2d[_0x6c0e('0x2e')],qs[_0x6c0e('0x32')](_0x37e7ae[_0x6c0e('0x2f')][_0x6c0e('0x32')]));_0x9cbc32['attributes']=_0x9cbc32['attributes']['length']?_0x9cbc32[_0x6c0e('0x33')]:_0x18df2d[_0x6c0e('0x2e')];if(!_0x37e7ae['query'][_0x6c0e('0x34')](_0x6c0e('0x35'))){_0x9cbc32[_0x6c0e('0x1c')]=qs['limit'](_0x37e7ae[_0x6c0e('0x2f')]['limit']);_0x9cbc32['offset']=qs['offset'](_0x37e7ae['query'][_0x6c0e('0x1a')]);}_0x9cbc32['order']=qs[_0x6c0e('0x36')](_0x37e7ae['query'][_0x6c0e('0x36')]);_0x9cbc32[_0x6c0e('0x37')]=qs[_0x6c0e('0x38')](_['pick'](_0x37e7ae[_0x6c0e('0x2f')],_0x18df2d['filters']),_0x8b1eeb);if(_0x37e7ae[_0x6c0e('0x2f')][_0x6c0e('0x39')]){_0x9cbc32[_0x6c0e('0x37')]=_[_0x6c0e('0x3a')](_0x9cbc32[_0x6c0e('0x37')],{'$or':_['map'](_0x8b1eeb,function(_0x30177d){if(_0x30177d[_0x6c0e('0x3b')]!==_0x6c0e('0x3c')){var _0x3b5765={};_0x3b5765[_0x30177d[_0x6c0e('0x28')]]={'$like':'%'+_0x37e7ae['query'][_0x6c0e('0x39')]+'%'};return _0x3b5765;}})});}_0x9cbc32=_[_0x6c0e('0x3a')]({},_0x9cbc32,_0x37e7ae[_0x6c0e('0x3d')]);var _0x215b1a={'where':_0x9cbc32[_0x6c0e('0x37')]};return db[_0x6c0e('0x2c')]['count'](_0x215b1a)[_0x6c0e('0x24')](function(_0x5ab8b7){_0x47810f[_0x6c0e('0x1d')]=_0x5ab8b7;if(_0x37e7ae[_0x6c0e('0x2f')][_0x6c0e('0x3e')]){_0x9cbc32[_0x6c0e('0x3f')]=[{'all':!![]}];}return db['Automation'][_0x6c0e('0x40')](_0x9cbc32);})[_0x6c0e('0x24')](function(_0xa1e420){_0x47810f[_0x6c0e('0x41')]=_0xa1e420;return _0x47810f;})[_0x6c0e('0x24')](respondWithFilteredResult(_0x4bd1d7,_0x9cbc32))[_0x6c0e('0x42')](handleError(_0x4bd1d7,null));};exports[_0x6c0e('0x43')]=function(_0x19ebca,_0x264731){var _0x1811f2={'raw':![],'where':{'id':_0x19ebca[_0x6c0e('0x44')]['id']}},_0x5e4c14={};_0x5e4c14[_0x6c0e('0x2e')]=_[_0x6c0e('0x30')](db['Automation'][_0x6c0e('0x45')]);_0x5e4c14[_0x6c0e('0x2f')]=_['keys'](_0x19ebca[_0x6c0e('0x2f')]);_0x5e4c14[_0x6c0e('0x38')]=_[_0x6c0e('0x31')](_0x5e4c14[_0x6c0e('0x2e')],_0x5e4c14[_0x6c0e('0x2f')]);_0x1811f2[_0x6c0e('0x33')]=_['intersection'](_0x5e4c14['model'],qs[_0x6c0e('0x32')](_0x19ebca[_0x6c0e('0x2f')]['fields']));_0x1811f2['attributes']=_0x1811f2['attributes'][_0x6c0e('0x46')]?_0x1811f2[_0x6c0e('0x33')]:_0x5e4c14[_0x6c0e('0x2e')];if(_0x19ebca[_0x6c0e('0x2f')][_0x6c0e('0x3e')]){_0x1811f2[_0x6c0e('0x3f')]=[{'all':!![]}];}_0x1811f2=_[_0x6c0e('0x3a')]({},_0x1811f2,_0x19ebca['options']);return db[_0x6c0e('0x2c')][_0x6c0e('0x47')](_0x1811f2)[_0x6c0e('0x24')](handleEntityNotFound(_0x264731,null))[_0x6c0e('0x24')](respondWithResult(_0x264731,null))['catch'](handleError(_0x264731,null));};exports[_0x6c0e('0x48')]=function(_0x34c512,_0x51013f){return db[_0x6c0e('0x2c')]['create'](_0x34c512[_0x6c0e('0x49')],{})[_0x6c0e('0x24')](respondWithResult(_0x51013f,0xc9))[_0x6c0e('0x42')](handleError(_0x51013f,null));};exports[_0x6c0e('0x23')]=function(_0x19aa83,_0xd75110){if(_0x19aa83[_0x6c0e('0x49')]['id']){delete _0x19aa83[_0x6c0e('0x49')]['id'];}return db[_0x6c0e('0x2c')][_0x6c0e('0x47')]({'where':{'id':_0x19aa83['params']['id']}})[_0x6c0e('0x24')](handleEntityNotFound(_0xd75110,null))['then'](saveUpdates(_0x19aa83['body'],null))[_0x6c0e('0x24')](respondWithResult(_0xd75110,null))[_0x6c0e('0x42')](handleError(_0xd75110,null));};exports[_0x6c0e('0x25')]=function(_0xd49817,_0x4b9e95){return db['Automation'][_0x6c0e('0x47')]({'where':{'id':_0xd49817['params']['id']}})[_0x6c0e('0x24')](handleEntityNotFound(_0x4b9e95,null))[_0x6c0e('0x24')](removeEntity(_0x4b9e95,null))[_0x6c0e('0x42')](handleError(_0x4b9e95,null));};exports['addConditions']=function(_0x533716,_0x2f5ba2,_0x420e5e){return db[_0x6c0e('0x4a')][_0x6c0e('0x47')]({'where':{'id':_0x533716[_0x6c0e('0x44')]['id']}})['then'](handleEntityNotFound(_0x2f5ba2,null))[_0x6c0e('0x24')](function(_0x47fd49){if(_0x47fd49){return _0x47fd49[_0x6c0e('0x4b')](_0x533716[_0x6c0e('0x49')][_0x6c0e('0x4c')],_['omit'](_0x533716['body'],['ids','id'])||{});}})[_0x6c0e('0x24')](respondWithResult(_0x2f5ba2,null))[_0x6c0e('0x42')](handleError(_0x2f5ba2,null));};exports[_0x6c0e('0x4d')]=function(_0x3adec7,_0x43c54b,_0x26b2bc){var _0x10322e={};var _0x18234e={};var _0x54a51b;var _0x2298ab;return db[_0x6c0e('0x2c')]['findOne']({'where':{'id':_0x3adec7[_0x6c0e('0x44')]['id']}})['then'](handleEntityNotFound(_0x43c54b,null))[_0x6c0e('0x24')](function(_0x72fd59){if(_0x72fd59){_0x54a51b=_0x72fd59;_0x18234e['model']=_[_0x6c0e('0x30')](db[_0x6c0e('0x4a')][_0x6c0e('0x45')]);_0x18234e[_0x6c0e('0x2f')]=_[_0x6c0e('0x30')](_0x3adec7[_0x6c0e('0x2f')]);_0x18234e[_0x6c0e('0x38')]=_[_0x6c0e('0x31')](_0x18234e[_0x6c0e('0x2e')],_0x18234e['query']);_0x10322e['attributes']=_[_0x6c0e('0x31')](_0x18234e[_0x6c0e('0x2e')],qs[_0x6c0e('0x32')](_0x3adec7[_0x6c0e('0x2f')]['fields']));_0x10322e['attributes']=_0x10322e[_0x6c0e('0x33')][_0x6c0e('0x46')]?_0x10322e['attributes']:_0x18234e[_0x6c0e('0x2e')];_0x10322e['order']=qs[_0x6c0e('0x36')](_0x3adec7[_0x6c0e('0x2f')][_0x6c0e('0x36')]);_0x10322e['where']=qs[_0x6c0e('0x38')](_[_0x6c0e('0x4e')](_0x3adec7[_0x6c0e('0x2f')],_0x18234e['filters']));if(_0x3adec7[_0x6c0e('0x2f')][_0x6c0e('0x39')]){_0x10322e[_0x6c0e('0x37')]=_['merge'](_0x10322e[_0x6c0e('0x37')],{'$or':_[_0x6c0e('0x2b')](_0x10322e[_0x6c0e('0x33')],function(_0x168c08){var _0xfdb304={};_0xfdb304[_0x168c08]={'$like':'%'+_0x3adec7[_0x6c0e('0x2f')][_0x6c0e('0x39')]+'%'};return _0xfdb304;})});}_0x10322e=_['merge']({},_0x10322e,_0x3adec7[_0x6c0e('0x3d')]);return _0x54a51b['getConditions'](_0x10322e);}})[_0x6c0e('0x24')](function(_0x15c8fe){if(_0x15c8fe){_0x2298ab=_0x15c8fe[_0x6c0e('0x46')];if(!_0x3adec7[_0x6c0e('0x2f')]['hasOwnProperty']('nolimit')){_0x10322e['limit']=qs[_0x6c0e('0x1c')](_0x3adec7[_0x6c0e('0x2f')][_0x6c0e('0x1c')]);_0x10322e[_0x6c0e('0x1a')]=qs['offset'](_0x3adec7[_0x6c0e('0x2f')][_0x6c0e('0x1a')]);}return _0x54a51b[_0x6c0e('0x4d')](_0x10322e);}})[_0x6c0e('0x24')](function(_0xbb3e27){if(_0xbb3e27){return _0xbb3e27?{'count':_0x2298ab,'rows':_0xbb3e27}:null;}})[_0x6c0e('0x24')](respondWithResult(_0x43c54b,null))[_0x6c0e('0x42')](handleError(_0x43c54b,null));};exports[_0x6c0e('0x4f')]=function(_0x20c0a6,_0x100b7d,_0x4df92a){return db[_0x6c0e('0x50')][_0x6c0e('0x47')]({'where':{'id':_0x20c0a6[_0x6c0e('0x44')]['id']}})['then'](handleEntityNotFound(_0x100b7d,null))[_0x6c0e('0x24')](function(_0xea7683){if(_0xea7683){return _0xea7683[_0x6c0e('0x4f')](_0x20c0a6['body'][_0x6c0e('0x4c')],_[_0x6c0e('0x51')](_0x20c0a6[_0x6c0e('0x49')],['ids','id'])||{});}})[_0x6c0e('0x24')](respondWithResult(_0x100b7d,null))[_0x6c0e('0x42')](handleError(_0x100b7d,null));};exports[_0x6c0e('0x52')]=function(_0x509f19,_0xd608f8,_0x5ae1f6){var _0x339f5a={};var _0x3387c8={};var _0x54506b;var _0x1eb110;return db[_0x6c0e('0x2c')][_0x6c0e('0x53')]({'where':{'id':_0x509f19['params']['id']}})[_0x6c0e('0x24')](handleEntityNotFound(_0xd608f8,null))[_0x6c0e('0x24')](function(_0x3bd870){if(_0x3bd870){_0x54506b=_0x3bd870;_0x3387c8[_0x6c0e('0x2e')]=_[_0x6c0e('0x30')](db[_0x6c0e('0x50')][_0x6c0e('0x45')]);_0x3387c8[_0x6c0e('0x2f')]=_[_0x6c0e('0x30')](_0x509f19[_0x6c0e('0x2f')]);_0x3387c8[_0x6c0e('0x38')]=_[_0x6c0e('0x31')](_0x3387c8[_0x6c0e('0x2e')],_0x3387c8['query']);_0x339f5a[_0x6c0e('0x33')]=_[_0x6c0e('0x31')](_0x3387c8['model'],qs['fields'](_0x509f19[_0x6c0e('0x2f')][_0x6c0e('0x32')]));_0x339f5a['attributes']=_0x339f5a[_0x6c0e('0x33')][_0x6c0e('0x46')]?_0x339f5a['attributes']:_0x3387c8[_0x6c0e('0x2e')];_0x339f5a[_0x6c0e('0x54')]=qs[_0x6c0e('0x36')](_0x509f19[_0x6c0e('0x2f')][_0x6c0e('0x36')]);_0x339f5a[_0x6c0e('0x37')]=qs[_0x6c0e('0x38')](_[_0x6c0e('0x4e')](_0x509f19['query'],_0x3387c8[_0x6c0e('0x38')]));if(_0x509f19[_0x6c0e('0x2f')][_0x6c0e('0x39')]){_0x339f5a[_0x6c0e('0x37')]=_[_0x6c0e('0x3a')](_0x339f5a[_0x6c0e('0x37')],{'$or':_['map'](_0x339f5a[_0x6c0e('0x33')],function(_0x341a3d){var _0x44aa2e={};_0x44aa2e[_0x341a3d]={'$like':'%'+_0x509f19['query']['filter']+'%'};return _0x44aa2e;})});}_0x339f5a=_[_0x6c0e('0x3a')]({},_0x339f5a,_0x509f19[_0x6c0e('0x3d')]);return _0x54506b['getActions'](_0x339f5a);}})[_0x6c0e('0x24')](function(_0x1bbe65){if(_0x1bbe65){_0x1eb110=_0x1bbe65[_0x6c0e('0x46')];if(!_0x509f19[_0x6c0e('0x2f')][_0x6c0e('0x34')]('nolimit')){_0x339f5a[_0x6c0e('0x1c')]=qs[_0x6c0e('0x1c')](_0x509f19[_0x6c0e('0x2f')]['limit']);_0x339f5a['offset']=qs[_0x6c0e('0x1a')](_0x509f19[_0x6c0e('0x2f')][_0x6c0e('0x1a')]);}return _0x54506b[_0x6c0e('0x52')](_0x339f5a);}})[_0x6c0e('0x24')](function(_0x5975bb){if(_0x5975bb){return _0x5975bb?{'count':_0x1eb110,'rows':_0x5975bb}:null;}})[_0x6c0e('0x24')](respondWithResult(_0xd608f8,null))[_0x6c0e('0x42')](handleError(_0xd608f8,null));}; \ No newline at end of file +var _0x12f2=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','Automation','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','include','rows','catch','params','rawAttributes','includeAll','find','create','body','addConditions','Condition','ids','omit','getConditions','findOne','order','pick','addActions','Action','getActions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x2bb82d,_0x42c7f8){var _0x5e0b92=function(_0x19f44b){while(--_0x19f44b){_0x2bb82d['push'](_0x2bb82d['shift']());}};_0x5e0b92(++_0x42c7f8);}(_0x12f2,0x1d9));var _0x212f=function(_0x3d6445,_0x5cf50c){_0x3d6445=_0x3d6445-0x0;var _0xc0b055=_0x12f2[_0x3d6445];return _0xc0b055;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x212f('0x0'));var zipdir=require(_0x212f('0x1'));var jsonpatch=require(_0x212f('0x2'));var rp=require(_0x212f('0x3'));var moment=require(_0x212f('0x4'));var BPromise=require(_0x212f('0x5'));var Mustache=require(_0x212f('0x6'));var util=require(_0x212f('0x7'));var path=require('path');var sox=require(_0x212f('0x8'));var csv=require(_0x212f('0x9'));var ejs=require(_0x212f('0xa'));var fs=require('fs');var fs_extra=require(_0x212f('0xb'));var _=require('lodash');var squel=require(_0x212f('0xc'));var crypto=require('crypto');var jsforce=require(_0x212f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x212f('0x9'));var querystring=require(_0x212f('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x212f('0xf'));var qs=require(_0x212f('0x10'));var as=require(_0x212f('0x11'));var hardwareService=require(_0x212f('0x12'));var logger=require('../../config/logger')(_0x212f('0x13'));var utils=require(_0x212f('0x14'));var config=require(_0x212f('0x15'));var licenseUtil=require(_0x212f('0x16'));var db=require(_0x212f('0x17'))['db'];function respondWithStatusCode(_0x30b87a,_0xdefc76){_0xdefc76=_0xdefc76||0xcc;return function(_0x3f4e7c){if(_0x3f4e7c){return _0x30b87a[_0x212f('0x18')](_0xdefc76);}return _0x30b87a[_0x212f('0x19')](_0xdefc76)[_0x212f('0x1a')]();};}function respondWithResult(_0x351e91,_0x4b2927){_0x4b2927=_0x4b2927||0xc8;return function(_0x6a42e6){if(_0x6a42e6){return _0x351e91[_0x212f('0x19')](_0x4b2927)['json'](_0x6a42e6);}};}function respondWithFilteredResult(_0x4971c4,_0x3cd68e){return function(_0x4cee11){if(_0x4cee11){var _0x109c21=typeof _0x3cd68e['offset']===_0x212f('0x1b')&&typeof _0x3cd68e[_0x212f('0x1c')]===_0x212f('0x1b');var _0x18055d=_0x4cee11['count'];var _0x554166=_0x109c21?0x0:_0x3cd68e[_0x212f('0x1d')];var _0x3c9490=_0x109c21?_0x4cee11[_0x212f('0x1e')]:_0x3cd68e['offset']+_0x3cd68e['limit'];var _0x1c3ab6;if(_0x3c9490>=_0x18055d){_0x3c9490=_0x18055d;_0x1c3ab6=0xc8;}else{_0x1c3ab6=0xce;}_0x4971c4[_0x212f('0x19')](_0x1c3ab6);return _0x4971c4['set'](_0x212f('0x1f'),_0x554166+'-'+_0x3c9490+'/'+_0x18055d)['json'](_0x4cee11);}return null;};}function patchUpdates(_0x3e4b66){return function(_0x158cf4){try{jsonpatch[_0x212f('0x20')](_0x158cf4,_0x3e4b66,!![]);}catch(_0x2318dc){return BPromise[_0x212f('0x21')](_0x2318dc);}return _0x158cf4[_0x212f('0x22')]();};}function saveUpdates(_0x18d5d8,_0x45a8d2){return function(_0x2ee3e2){if(_0x2ee3e2){return _0x2ee3e2[_0x212f('0x23')](_0x18d5d8)[_0x212f('0x24')](function(_0x6e121c){return _0x6e121c;});}return null;};}function removeEntity(_0x23f914,_0x4307ce){return function(_0x5509df){if(_0x5509df){return _0x5509df[_0x212f('0x25')]()[_0x212f('0x24')](function(){_0x23f914[_0x212f('0x19')](0xcc)[_0x212f('0x1a')]();});}};}function handleEntityNotFound(_0x406c87,_0x2b861e){return function(_0x458890){if(!_0x458890){_0x406c87['sendStatus'](0x194);}return _0x458890;};}function handleError(_0x5096af,_0x364784){_0x364784=_0x364784||0x1f4;return function(_0x55c329){logger['error'](_0x55c329[_0x212f('0x26')]);if(_0x55c329[_0x212f('0x27')]){delete _0x55c329['name'];}_0x5096af['status'](_0x364784)['send'](_0x55c329);};}exports[_0x212f('0x28')]=function(_0x222afe,_0x39435c){var _0x4e7424={},_0x576692={},_0x504c44={'count':0x0,'rows':[]};var _0x46e6bd=_[_0x212f('0x29')](db[_0x212f('0x2a')]['rawAttributes'],function(_0x593eca){return{'name':_0x593eca[_0x212f('0x2b')],'type':_0x593eca[_0x212f('0x2c')][_0x212f('0x2d')]};});_0x576692[_0x212f('0x2e')]=_[_0x212f('0x29')](_0x46e6bd,'name');_0x576692[_0x212f('0x2f')]=_[_0x212f('0x30')](_0x222afe['query']);_0x576692['filters']=_[_0x212f('0x31')](_0x576692[_0x212f('0x2e')],_0x576692[_0x212f('0x2f')]);_0x4e7424[_0x212f('0x32')]=_['intersection'](_0x576692[_0x212f('0x2e')],qs[_0x212f('0x33')](_0x222afe[_0x212f('0x2f')][_0x212f('0x33')]));_0x4e7424['attributes']=_0x4e7424[_0x212f('0x32')][_0x212f('0x34')]?_0x4e7424[_0x212f('0x32')]:_0x576692[_0x212f('0x2e')];if(!_0x222afe[_0x212f('0x2f')][_0x212f('0x35')](_0x212f('0x36'))){_0x4e7424[_0x212f('0x1c')]=qs[_0x212f('0x1c')](_0x222afe[_0x212f('0x2f')][_0x212f('0x1c')]);_0x4e7424[_0x212f('0x1d')]=qs[_0x212f('0x1d')](_0x222afe['query'][_0x212f('0x1d')]);}_0x4e7424['order']=qs[_0x212f('0x37')](_0x222afe[_0x212f('0x2f')]['sort']);_0x4e7424[_0x212f('0x38')]=qs[_0x212f('0x39')](_['pick'](_0x222afe['query'],_0x576692[_0x212f('0x39')]),_0x46e6bd);if(_0x222afe['query'][_0x212f('0x3a')]){_0x4e7424['where']=_[_0x212f('0x3b')](_0x4e7424[_0x212f('0x38')],{'$or':_[_0x212f('0x29')](_0x46e6bd,function(_0x3ae2e1){if(_0x3ae2e1[_0x212f('0x2c')]!==_0x212f('0x3c')){var _0x13308e={};_0x13308e[_0x3ae2e1[_0x212f('0x27')]]={'$like':'%'+_0x222afe[_0x212f('0x2f')][_0x212f('0x3a')]+'%'};return _0x13308e;}})});}_0x4e7424=_['merge']({},_0x4e7424,_0x222afe[_0x212f('0x3d')]);var _0x42c9df={'where':_0x4e7424[_0x212f('0x38')]};return db[_0x212f('0x2a')][_0x212f('0x1e')](_0x42c9df)['then'](function(_0x3a880d){_0x504c44[_0x212f('0x1e')]=_0x3a880d;if(_0x222afe['query']['includeAll']){_0x4e7424[_0x212f('0x3e')]=[{'all':!![]}];}return db[_0x212f('0x2a')]['findAll'](_0x4e7424);})['then'](function(_0x4b9605){_0x504c44[_0x212f('0x3f')]=_0x4b9605;return _0x504c44;})['then'](respondWithFilteredResult(_0x39435c,_0x4e7424))[_0x212f('0x40')](handleError(_0x39435c,null));};exports['show']=function(_0x3a1847,_0x116348){var _0xefdd3e={'raw':![],'where':{'id':_0x3a1847[_0x212f('0x41')]['id']}},_0xa4d9ee={};_0xa4d9ee['model']=_['keys'](db[_0x212f('0x2a')][_0x212f('0x42')]);_0xa4d9ee['query']=_[_0x212f('0x30')](_0x3a1847[_0x212f('0x2f')]);_0xa4d9ee['filters']=_[_0x212f('0x31')](_0xa4d9ee[_0x212f('0x2e')],_0xa4d9ee['query']);_0xefdd3e[_0x212f('0x32')]=_[_0x212f('0x31')](_0xa4d9ee[_0x212f('0x2e')],qs[_0x212f('0x33')](_0x3a1847[_0x212f('0x2f')][_0x212f('0x33')]));_0xefdd3e[_0x212f('0x32')]=_0xefdd3e['attributes']['length']?_0xefdd3e[_0x212f('0x32')]:_0xa4d9ee[_0x212f('0x2e')];if(_0x3a1847[_0x212f('0x2f')][_0x212f('0x43')]){_0xefdd3e[_0x212f('0x3e')]=[{'all':!![]}];}_0xefdd3e=_[_0x212f('0x3b')]({},_0xefdd3e,_0x3a1847['options']);return db[_0x212f('0x2a')][_0x212f('0x44')](_0xefdd3e)['then'](handleEntityNotFound(_0x116348,null))[_0x212f('0x24')](respondWithResult(_0x116348,null))[_0x212f('0x40')](handleError(_0x116348,null));};exports[_0x212f('0x45')]=function(_0x3af176,_0x3af307){return db[_0x212f('0x2a')][_0x212f('0x45')](_0x3af176['body'],{})[_0x212f('0x24')](respondWithResult(_0x3af307,0xc9))['catch'](handleError(_0x3af307,null));};exports['update']=function(_0x5dc8c1,_0x4bc226){if(_0x5dc8c1[_0x212f('0x46')]['id']){delete _0x5dc8c1[_0x212f('0x46')]['id'];}return db['Automation'][_0x212f('0x44')]({'where':{'id':_0x5dc8c1[_0x212f('0x41')]['id']}})[_0x212f('0x24')](handleEntityNotFound(_0x4bc226,null))['then'](saveUpdates(_0x5dc8c1[_0x212f('0x46')],null))[_0x212f('0x24')](respondWithResult(_0x4bc226,null))[_0x212f('0x40')](handleError(_0x4bc226,null));};exports[_0x212f('0x25')]=function(_0x3b783b,_0x1c14e7){return db['Automation'][_0x212f('0x44')]({'where':{'id':_0x3b783b['params']['id']}})['then'](handleEntityNotFound(_0x1c14e7,null))[_0x212f('0x24')](removeEntity(_0x1c14e7,null))[_0x212f('0x40')](handleError(_0x1c14e7,null));};exports[_0x212f('0x47')]=function(_0x590dcd,_0x4ff867,_0x5b5721){return db[_0x212f('0x48')]['find']({'where':{'id':_0x590dcd['params']['id']}})['then'](handleEntityNotFound(_0x4ff867,null))[_0x212f('0x24')](function(_0x136e47){if(_0x136e47){return _0x136e47[_0x212f('0x47')](_0x590dcd['body'][_0x212f('0x49')],_[_0x212f('0x4a')](_0x590dcd[_0x212f('0x46')],[_0x212f('0x49'),'id'])||{});}})[_0x212f('0x24')](respondWithResult(_0x4ff867,null))[_0x212f('0x40')](handleError(_0x4ff867,null));};exports[_0x212f('0x4b')]=function(_0x1a953c,_0x558131,_0x3f5aa5){var _0x5288b3={};var _0x1da500={};var _0x54ed0f;var _0x1fc494;return db[_0x212f('0x2a')][_0x212f('0x4c')]({'where':{'id':_0x1a953c[_0x212f('0x41')]['id']}})[_0x212f('0x24')](handleEntityNotFound(_0x558131,null))[_0x212f('0x24')](function(_0x46015e){if(_0x46015e){_0x54ed0f=_0x46015e;_0x1da500[_0x212f('0x2e')]=_[_0x212f('0x30')](db[_0x212f('0x48')]['rawAttributes']);_0x1da500[_0x212f('0x2f')]=_[_0x212f('0x30')](_0x1a953c[_0x212f('0x2f')]);_0x1da500[_0x212f('0x39')]=_[_0x212f('0x31')](_0x1da500[_0x212f('0x2e')],_0x1da500[_0x212f('0x2f')]);_0x5288b3['attributes']=_[_0x212f('0x31')](_0x1da500[_0x212f('0x2e')],qs['fields'](_0x1a953c[_0x212f('0x2f')][_0x212f('0x33')]));_0x5288b3['attributes']=_0x5288b3[_0x212f('0x32')]['length']?_0x5288b3['attributes']:_0x1da500['model'];_0x5288b3[_0x212f('0x4d')]=qs[_0x212f('0x37')](_0x1a953c['query']['sort']);_0x5288b3[_0x212f('0x38')]=qs[_0x212f('0x39')](_[_0x212f('0x4e')](_0x1a953c[_0x212f('0x2f')],_0x1da500[_0x212f('0x39')]));if(_0x1a953c['query'][_0x212f('0x3a')]){_0x5288b3[_0x212f('0x38')]=_[_0x212f('0x3b')](_0x5288b3[_0x212f('0x38')],{'$or':_[_0x212f('0x29')](_0x5288b3[_0x212f('0x32')],function(_0xf4a5c8){var _0x44fdbb={};_0x44fdbb[_0xf4a5c8]={'$like':'%'+_0x1a953c[_0x212f('0x2f')][_0x212f('0x3a')]+'%'};return _0x44fdbb;})});}_0x5288b3=_[_0x212f('0x3b')]({},_0x5288b3,_0x1a953c[_0x212f('0x3d')]);return _0x54ed0f['getConditions'](_0x5288b3);}})['then'](function(_0x27b711){if(_0x27b711){_0x1fc494=_0x27b711[_0x212f('0x34')];if(!_0x1a953c[_0x212f('0x2f')]['hasOwnProperty'](_0x212f('0x36'))){_0x5288b3['limit']=qs[_0x212f('0x1c')](_0x1a953c['query'][_0x212f('0x1c')]);_0x5288b3[_0x212f('0x1d')]=qs[_0x212f('0x1d')](_0x1a953c[_0x212f('0x2f')][_0x212f('0x1d')]);}return _0x54ed0f[_0x212f('0x4b')](_0x5288b3);}})[_0x212f('0x24')](function(_0x50eb17){if(_0x50eb17){return _0x50eb17?{'count':_0x1fc494,'rows':_0x50eb17}:null;}})[_0x212f('0x24')](respondWithResult(_0x558131,null))[_0x212f('0x40')](handleError(_0x558131,null));};exports[_0x212f('0x4f')]=function(_0x24676a,_0x5ee4bc,_0x4244fe){return db[_0x212f('0x50')][_0x212f('0x44')]({'where':{'id':_0x24676a[_0x212f('0x41')]['id']}})[_0x212f('0x24')](handleEntityNotFound(_0x5ee4bc,null))['then'](function(_0x4e22c5){if(_0x4e22c5){return _0x4e22c5['addActions'](_0x24676a[_0x212f('0x46')][_0x212f('0x49')],_[_0x212f('0x4a')](_0x24676a[_0x212f('0x46')],[_0x212f('0x49'),'id'])||{});}})[_0x212f('0x24')](respondWithResult(_0x5ee4bc,null))[_0x212f('0x40')](handleError(_0x5ee4bc,null));};exports[_0x212f('0x51')]=function(_0x2198e1,_0x499c9b,_0x4f602d){var _0x4a73f4={};var _0x30e5d4={};var _0x4a8dd8;var _0xd81b92;return db[_0x212f('0x2a')]['findOne']({'where':{'id':_0x2198e1['params']['id']}})['then'](handleEntityNotFound(_0x499c9b,null))[_0x212f('0x24')](function(_0x520371){if(_0x520371){_0x4a8dd8=_0x520371;_0x30e5d4[_0x212f('0x2e')]=_['keys'](db['Action']['rawAttributes']);_0x30e5d4[_0x212f('0x2f')]=_[_0x212f('0x30')](_0x2198e1[_0x212f('0x2f')]);_0x30e5d4[_0x212f('0x39')]=_[_0x212f('0x31')](_0x30e5d4[_0x212f('0x2e')],_0x30e5d4[_0x212f('0x2f')]);_0x4a73f4[_0x212f('0x32')]=_[_0x212f('0x31')](_0x30e5d4['model'],qs[_0x212f('0x33')](_0x2198e1[_0x212f('0x2f')][_0x212f('0x33')]));_0x4a73f4['attributes']=_0x4a73f4[_0x212f('0x32')]['length']?_0x4a73f4[_0x212f('0x32')]:_0x30e5d4['model'];_0x4a73f4[_0x212f('0x4d')]=qs[_0x212f('0x37')](_0x2198e1['query'][_0x212f('0x37')]);_0x4a73f4['where']=qs[_0x212f('0x39')](_['pick'](_0x2198e1[_0x212f('0x2f')],_0x30e5d4[_0x212f('0x39')]));if(_0x2198e1['query'][_0x212f('0x3a')]){_0x4a73f4['where']=_[_0x212f('0x3b')](_0x4a73f4[_0x212f('0x38')],{'$or':_[_0x212f('0x29')](_0x4a73f4[_0x212f('0x32')],function(_0x14131c){var _0xf8cb89={};_0xf8cb89[_0x14131c]={'$like':'%'+_0x2198e1['query'][_0x212f('0x3a')]+'%'};return _0xf8cb89;})});}_0x4a73f4=_[_0x212f('0x3b')]({},_0x4a73f4,_0x2198e1[_0x212f('0x3d')]);return _0x4a8dd8[_0x212f('0x51')](_0x4a73f4);}})[_0x212f('0x24')](function(_0x1ef78a){if(_0x1ef78a){_0xd81b92=_0x1ef78a[_0x212f('0x34')];if(!_0x2198e1[_0x212f('0x2f')][_0x212f('0x35')](_0x212f('0x36'))){_0x4a73f4['limit']=qs[_0x212f('0x1c')](_0x2198e1[_0x212f('0x2f')]['limit']);_0x4a73f4[_0x212f('0x1d')]=qs[_0x212f('0x1d')](_0x2198e1['query'][_0x212f('0x1d')]);}return _0x4a8dd8[_0x212f('0x51')](_0x4a73f4);}})[_0x212f('0x24')](function(_0xcb85c1){if(_0xcb85c1){return _0xcb85c1?{'count':_0xd81b92,'rows':_0xcb85c1}:null;}})[_0x212f('0x24')](respondWithResult(_0x499c9b,null))['catch'](handleError(_0x499c9b,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 07e32bf..5674483 100644 --- a/server/api/automation/automation.model.js +++ b/server/api/automation/automation.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7b6=['path','rimraf','./automation.attributes','exports','define','Automation','tools_automations','api','moment','bluebird'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0xb7b6,0x89));var _0x6b7b=function(_0x2f4385,_0x1505d0){_0x2f4385=_0x2f4385-0x0;var _0x1f4fbe=_0xb7b6[_0x2f4385];return _0x1f4fbe;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x6b7b('0x0'));var moment=require(_0x6b7b('0x1'));var BPromise=require(_0x6b7b('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6b7b('0x3'));var rimraf=require(_0x6b7b('0x4'));var config=require('../../config/environment');var attributes=require(_0x6b7b('0x5'));module[_0x6b7b('0x6')]=function(_0xb58fca,_0x5d9933){return _0xb58fca[_0x6b7b('0x7')](_0x6b7b('0x8'),attributes,{'tableName':_0x6b7b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6375=['request-promise','rimraf','../../config/environment','exports','Automation','tools_automations','util','../../config/logger'];(function(_0xf22003,_0x4daaad){var _0x1af727=function(_0x99db67){while(--_0x99db67){_0xf22003['push'](_0xf22003['shift']());}};_0x1af727(++_0x4daaad);}(_0x6375,0xc6));var _0x5637=function(_0x51ec61,_0xf9d1e3){_0x51ec61=_0x51ec61-0x0;var _0x223200=_0x6375[_0x51ec61];return _0x223200;};'use strict';var _=require('lodash');var util=require(_0x5637('0x0'));var logger=require(_0x5637('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5637('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5637('0x3'));var config=require(_0x5637('0x4'));var attributes=require('./automation.attributes');module[_0x5637('0x5')]=function(_0xce0eca,_0x5da297){return _0xce0eca['define'](_0x5637('0x6'),attributes,{'tableName':_0x5637('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index fa5f151..ff8c8b1 100644 --- a/server/api/automation/automation.rpc.js +++ b/server/api/automation/automation.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2cc4=['client','http','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise'];(function(_0x273ace,_0x3b28bc){var _0x5a5548=function(_0x2d2aaf){while(--_0x2d2aaf){_0x273ace['push'](_0x273ace['shift']());}};_0x5a5548(++_0x3b28bc);}(_0x2cc4,0x1f0));var _0x42cc=function(_0x393500,_0x1037af){_0x393500=_0x393500-0x0;var _0x120d3b=_0x2cc4[_0x393500];return _0x120d3b;};'use strict';var _=require(_0x42cc('0x0'));var util=require(_0x42cc('0x1'));var moment=require(_0x42cc('0x2'));var BPromise=require(_0x42cc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x42cc('0x4'));var db=require(_0x42cc('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x42cc('0x6'));var jayson=require(_0x42cc('0x7'));var client=jayson[_0x42cc('0x8')][_0x42cc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2348b1,_0x5f2d27,_0x1fac7b){return new BPromise(function(_0x3b686b,_0x3a64ba){return client['request'](_0x2348b1,_0x1fac7b)['then'](function(_0xef766b){logger[_0x42cc('0xa')](_0x42cc('0xb'),_0x5f2d27,_0x42cc('0xc'));logger[_0x42cc('0xd')](_0x42cc('0xe'),_0x5f2d27,_0x42cc('0xc'),JSON[_0x42cc('0xf')](_0xef766b));if(_0xef766b[_0x42cc('0x10')]){if(_0xef766b[_0x42cc('0x10')][_0x42cc('0x11')]===0x1f4){logger[_0x42cc('0x10')]('Automation,\x20%s,\x20%s',_0x5f2d27,_0xef766b['error']['message']);return _0x3a64ba(_0xef766b[_0x42cc('0x10')][_0x42cc('0x12')]);}logger[_0x42cc('0x10')]('Automation,\x20%s,\x20%s',_0x5f2d27,_0xef766b[_0x42cc('0x10')]['message']);return _0x3b686b(_0xef766b[_0x42cc('0x10')]['message']);}else{logger[_0x42cc('0xa')](_0x42cc('0xb'),_0x5f2d27,_0x42cc('0xc'));_0x3b686b(_0xef766b[_0x42cc('0x13')][_0x42cc('0x12')]);}})[_0x42cc('0x14')](function(_0x4245de){logger[_0x42cc('0x10')](_0x42cc('0xb'),_0x5f2d27,_0x4245de);_0x3a64ba(_0x4245de);});});} \ No newline at end of file +var _0x5236=['http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x2e341b,_0x4e9059){var _0x41a33f=function(_0x388da8){while(--_0x388da8){_0x2e341b['push'](_0x2e341b['shift']());}};_0x41a33f(++_0x4e9059);}(_0x5236,0x109));var _0x6523=function(_0x322a7c,_0x45b6e3){_0x322a7c=_0x322a7c-0x0;var _0x5a95f6=_0x5236[_0x322a7c];return _0x5a95f6;};'use strict';var _=require(_0x6523('0x0'));var util=require(_0x6523('0x1'));var moment=require(_0x6523('0x2'));var BPromise=require(_0x6523('0x3'));var rs=require(_0x6523('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6523('0x5'))['db'];var utils=require(_0x6523('0x6'));var logger=require('../../config/logger')(_0x6523('0x7'));var config=require(_0x6523('0x8'));var jayson=require(_0x6523('0x9'));var client=jayson[_0x6523('0xa')][_0x6523('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x53548c,_0x32e99c,_0x17b335){return new BPromise(function(_0x24550b,_0x514e29){return client[_0x6523('0xc')](_0x53548c,_0x17b335)[_0x6523('0xd')](function(_0x2afd63){logger[_0x6523('0xe')](_0x6523('0xf'),_0x32e99c,_0x6523('0x10'));logger['debug'](_0x6523('0x11'),_0x32e99c,_0x6523('0x10'),JSON[_0x6523('0x12')](_0x2afd63));if(_0x2afd63[_0x6523('0x13')]){if(_0x2afd63[_0x6523('0x13')]['code']===0x1f4){logger[_0x6523('0x13')](_0x6523('0xf'),_0x32e99c,_0x2afd63['error'][_0x6523('0x14')]);return _0x514e29(_0x2afd63['error']['message']);}logger[_0x6523('0x13')](_0x6523('0xf'),_0x32e99c,_0x2afd63[_0x6523('0x13')][_0x6523('0x14')]);return _0x24550b(_0x2afd63[_0x6523('0x13')][_0x6523('0x14')]);}else{logger['info'](_0x6523('0xf'),_0x32e99c,'request\x20sent');_0x24550b(_0x2afd63[_0x6523('0x15')][_0x6523('0x14')]);}})[_0x6523('0x16')](function(_0x34acbe){logger[_0x6523('0x13')](_0x6523('0xf'),_0x32e99c,_0x34acbe);_0x514e29(_0x34acbe);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index f3b8bc6..2db9513 100644 --- a/server/api/automation/index.js +++ b/server/api/automation/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4350=['delete','destroy','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','index','isAuthenticated','/:id/conditions','getConditions','post','create','addConditions','addActions','/:id','update'];(function(_0x2742db,_0x58e00c){var _0x18659e=function(_0x5bd3ac){while(--_0x5bd3ac){_0x2742db['push'](_0x2742db['shift']());}};_0x18659e(++_0x58e00c);}(_0x4350,0x1d0));var _0x0435=function(_0x29cbfa,_0xa1afd6){_0x29cbfa=_0x29cbfa-0x0;var _0x231b3d=_0x4350[_0x29cbfa];return _0x231b3d;};'use strict';var multer=require(_0x0435('0x0'));var util=require(_0x0435('0x1'));var path=require('path');var timeout=require(_0x0435('0x2'));var express=require('express');var router=express[_0x0435('0x3')]();var fs_extra=require(_0x0435('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0435('0x5'));var config=require(_0x0435('0x6'));var controller=require(_0x0435('0x7'));router[_0x0435('0x8')]('/',auth['isAuthenticated'](),controller[_0x0435('0x9')]);router['get']('/:id',auth[_0x0435('0xa')](),controller['show']);router['get'](_0x0435('0xb'),auth['isAuthenticated'](),controller[_0x0435('0xc')]);router[_0x0435('0x8')]('/:id/actions',auth[_0x0435('0xa')](),controller['getActions']);router[_0x0435('0xd')]('/',auth[_0x0435('0xa')](),controller[_0x0435('0xe')]);router[_0x0435('0xd')](_0x0435('0xb'),auth[_0x0435('0xa')](),controller[_0x0435('0xf')]);router[_0x0435('0xd')]('/:id/actions',auth['isAuthenticated'](),controller[_0x0435('0x10')]);router['put'](_0x0435('0x11'),auth['isAuthenticated'](),controller[_0x0435('0x12')]);router[_0x0435('0x13')]('/:id',auth[_0x0435('0xa')](),controller[_0x0435('0x14')]);module['exports']=router; \ No newline at end of file +var _0x3cb7=['post','create','update','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/conditions','getConditions','/:id/actions','getActions'];(function(_0x2ae2ad,_0xac5b0c){var _0x26dbd7=function(_0x5e685b){while(--_0x5e685b){_0x2ae2ad['push'](_0x2ae2ad['shift']());}};_0x26dbd7(++_0xac5b0c);}(_0x3cb7,0x1a8));var _0x73cb=function(_0x217542,_0x15cc22){_0x217542=_0x217542-0x0;var _0x4bb071=_0x3cb7[_0x217542];return _0x4bb071;};'use strict';var multer=require(_0x73cb('0x0'));var util=require(_0x73cb('0x1'));var path=require('path');var timeout=require(_0x73cb('0x2'));var express=require(_0x73cb('0x3'));var router=express[_0x73cb('0x4')]();var fs_extra=require(_0x73cb('0x5'));var auth=require(_0x73cb('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x73cb('0x7'));var controller=require('./automation.controller');router[_0x73cb('0x8')]('/',auth[_0x73cb('0x9')](),controller[_0x73cb('0xa')]);router[_0x73cb('0x8')](_0x73cb('0xb'),auth[_0x73cb('0x9')](),controller['show']);router[_0x73cb('0x8')](_0x73cb('0xc'),auth[_0x73cb('0x9')](),controller[_0x73cb('0xd')]);router[_0x73cb('0x8')](_0x73cb('0xe'),auth[_0x73cb('0x9')](),controller[_0x73cb('0xf')]);router[_0x73cb('0x10')]('/',auth[_0x73cb('0x9')](),controller[_0x73cb('0x11')]);router[_0x73cb('0x10')](_0x73cb('0xc'),auth[_0x73cb('0x9')](),controller['addConditions']);router[_0x73cb('0x10')](_0x73cb('0xe'),auth[_0x73cb('0x9')](),controller['addActions']);router['put'](_0x73cb('0xb'),auth[_0x73cb('0x9')](),controller[_0x73cb('0x12')]);router['delete'](_0x73cb('0xb'),auth[_0x73cb('0x9')](),controller['destroy']);module[_0x73cb('0x13')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 794b8fb..4426698 100644 --- a/server/api/campaign/campaign.attributes.js +++ b/server/api/campaign/campaign.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x30ad=['#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','INTEGER','UNSIGNED','Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x592f46,_0x268ae3){var _0x225678=function(_0x451593){while(--_0x451593){_0x592f46['push'](_0x592f46['shift']());}};_0x225678(++_0x268ae3);}(_0x30ad,0xaa));var _0xd30a=function(_0x2e7314,_0x434700){_0x2e7314=_0x2e7314-0x0;var _0x58a977=_0x30ad[_0x2e7314];return _0x58a977;};'use strict';var Sequelize=require(_0xd30a('0x0'));module[_0xd30a('0x1')]={'name':{'type':Sequelize[_0xd30a('0x2')],'unique':_0xd30a('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xd30a('0x4')](_0xd30a('0x5')),'allowNull':![],'defaultValue':_0xd30a('0x5')},'description':{'type':Sequelize[_0xd30a('0x2')]},'active':{'type':Sequelize[_0xd30a('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xd30a('0x7')](0x4)[_0xd30a('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xd30a('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0xd30a('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xd30a('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xd30a('0x7')](0x3)[_0xd30a('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xd30a('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd30a('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xd30a('0x7')](0x3)[_0xd30a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xd30a('0x7')](0x5)[_0xd30a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd30a('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xd30a('0x7')](0x3)[_0xd30a('0x8')],'defaultValue':0x3,'comment':_0xd30a('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xd30a('0x7')](0x3)[_0xd30a('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xd30a('0xd')},'dialTimezone':{'type':Sequelize[_0xd30a('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always','never','onlyIfOpen'),'defaultValue':_0xd30a('0xe')},'dialAMDActive':{'type':Sequelize[_0xd30a('0x6')],'defaultValue':0x0,'comment':_0xd30a('0xf')},'dialAMDInitialSilence':{'type':Sequelize[_0xd30a('0x7')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xd30a('0x10')},'dialAMDGreeting':{'type':Sequelize[_0xd30a('0x7')](0x9)[_0xd30a('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xd30a('0x11')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xd30a('0x7')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xd30a('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd30a('0x12')},'dialAMDMinWordLength':{'type':Sequelize[_0xd30a('0x7')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xd30a('0x13')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xd30a('0x7')](0x9)[_0xd30a('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xd30a('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xd30a('0x14')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xd30a('0x7')](0x9)[_0xd30a('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd30a('0x15')},'dialOrderByScheduledAt':{'type':Sequelize[_0xd30a('0x4')](_0xd30a('0x16'),_0xd30a('0x17')),'defaultValue':_0xd30a('0x16')},'dialPrefix':{'type':Sequelize[_0xd30a('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xd30a('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd30a('0x18')},'dialCutDigit':{'type':Sequelize[_0xd30a('0x7')](0x3)[_0xd30a('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd30a('0x19')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xd30a('0x7')](0x3)[_0xd30a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd30a('0x1a')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xd30a('0x7')](0x5)[_0xd30a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd30a('0x1b')},'dialDropMaxRetry':{'type':Sequelize[_0xd30a('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd30a('0x1c')},'dialDropRetryFrequency':{'type':Sequelize[_0xd30a('0x7')](0x5)[_0xd30a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd30a('0x1d')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd30a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd30a('0x1e')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xd30a('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd30a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xd30a('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd30a('0x1f')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xd30a('0x7')](0x3)[_0xd30a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd30a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd30a('0x20')}}; \ No newline at end of file +var _0xf190=['STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize'];(function(_0xe7281f,_0x2d77c3){var _0x90dc99=function(_0x1e335b){while(--_0x1e335b){_0xe7281f['push'](_0xe7281f['shift']());}};_0x90dc99(++_0x2d77c3);}(_0xf190,0xc7));var _0x0f19=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf190[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x0f19('0x0'));module['exports']={'name':{'type':Sequelize[_0x0f19('0x1')],'unique':_0x0f19('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x0f19('0x3')](_0x0f19('0x4')),'allowNull':![],'defaultValue':_0x0f19('0x4')},'description':{'type':Sequelize[_0x0f19('0x1')]},'active':{'type':Sequelize[_0x0f19('0x5')],'defaultValue':0x0,'comment':_0x0f19('0x6')},'limitCalls':{'type':Sequelize[_0x0f19('0x7')](0x4)[_0x0f19('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x0f19('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0f19('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x0f19('0x7')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0f19('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0f19('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0f19('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0f19('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0f19('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x0f19('0x7')](0x3)[_0x0f19('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x0f19('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0f19('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0f19('0x8')],'defaultValue':0x3,'comment':_0x0f19('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0f19('0x7')](0x5)[_0x0f19('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x0f19('0x7')](0x3)[_0x0f19('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0f19('0xe')},'dialTimezone':{'type':Sequelize[_0x0f19('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0f19('0x1')],'defaultValue':_0x0f19('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x0f19('0x3')](_0x0f19('0x10'),_0x0f19('0x11'),_0x0f19('0x12')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x0f19('0x5')],'defaultValue':0x0,'comment':_0x0f19('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x0f19('0x7')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0f19('0x14')},'dialAMDGreeting':{'type':Sequelize[_0x0f19('0x7')](0x9)[_0x0f19('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0f19('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0f19('0x7')](0x9)[_0x0f19('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0f19('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0f19('0x7')](0x9)[_0x0f19('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0f19('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x0f19('0x7')](0x9)[_0x0f19('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0f19('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0f19('0x7')](0x9)[_0x0f19('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0f19('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0f19('0x7')](0x9)[_0x0f19('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0f19('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x0f19('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0f19('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0f19('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0f19('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x0f19('0x1d')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0f19('0x7')](0x3)[_0x0f19('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x0f19('0x7')](0x3)[_0x0f19('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0f19('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0f19('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0f19('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x0f19('0x7')](0x5)[_0x0f19('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0f19('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0f19('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0x0f19('0x7')](0x5)[_0x0f19('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0f19('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x0f19('0x7')](0x3)[_0x0f19('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0f19('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0f19('0x7')](0x5)[_0x0f19('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0f19('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0x0f19('0x7')](0x3)[_0x0f19('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0f19('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0x0f19('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0f19('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0f19('0x7')](0x3)[_0x0f19('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0f19('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0f19('0x7')](0x5)[_0x0f19('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0f19('0x27')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 5509795..1c6b64e 100644 --- a/server/api/campaign/campaign.controller.js +++ b/server/api/campaign/campaign.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x83cd=['catch','show','params','fields','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','user','getHoppers','findOne','pick','CampaignId','CmHopper','findAll','getHopperHistories','CmHopperHistory','nolimit','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','fromQuery','scheduledAt','ContactId','ListId','select','phone','field','NOW()','CmListId','toString','cm_contacts','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','cmHopperId','OrderBy','ci.item','ci.OrderBY','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','destroy','get','IvrCampaigns','error','stack','name','send','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','order','sort','where','merge','type','VIRTUAL','filter','options','Campaign','includeAll','include','rows'];(function(_0x24106c,_0x367a6f){var _0xbaeb73=function(_0x483603){while(--_0x483603){_0x24106c['push'](_0x24106c['shift']());}};_0xbaeb73(++_0x367a6f);}(_0x83cd,0x17b));var _0xd83c=function(_0x472851,_0x333c1b){_0x472851=_0x472851-0x0;var _0x210868=_0x83cd[_0x472851];return _0x210868;};'use strict';var emlformat=require(_0xd83c('0x0'));var rimraf=require(_0xd83c('0x1'));var zipdir=require(_0xd83c('0x2'));var jsonpatch=require(_0xd83c('0x3'));var rp=require(_0xd83c('0x4'));var moment=require('moment');var BPromise=require(_0xd83c('0x5'));var Mustache=require(_0xd83c('0x6'));var util=require(_0xd83c('0x7'));var path=require(_0xd83c('0x8'));var sox=require('sox');var csv=require(_0xd83c('0x9'));var ejs=require(_0xd83c('0xa'));var fs=require('fs');var fs_extra=require(_0xd83c('0xb'));var _=require('lodash');var squel=require(_0xd83c('0xc'));var crypto=require('crypto');var jsforce=require(_0xd83c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd83c('0x9'));var querystring=require('querystring');var Papa=require(_0xd83c('0xe'));var Redis=require(_0xd83c('0xf'));var authService=require(_0xd83c('0x10'));var qs=require(_0xd83c('0x11'));var as=require(_0xd83c('0x12'));var hardwareService=require(_0xd83c('0x13'));var logger=require(_0xd83c('0x14'))('api');var utils=require(_0xd83c('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd83c('0x16'))['db'];function respondWithStatusCode(_0x19c134,_0xfece32){_0xfece32=_0xfece32||0xcc;return function(_0x51d8f4){if(_0x51d8f4){return _0x19c134[_0xd83c('0x17')](_0xfece32);}return _0x19c134[_0xd83c('0x18')](_0xfece32)[_0xd83c('0x19')]();};}function respondWithResult(_0x2a75af,_0x405078){_0x405078=_0x405078||0xc8;return function(_0x23099c){if(_0x23099c){return _0x2a75af[_0xd83c('0x18')](_0x405078)['json'](_0x23099c);}};}function respondWithFilteredResult(_0x1617a1,_0x54b716){return function(_0x1271d4){if(_0x1271d4){var _0x276b19=typeof _0x54b716[_0xd83c('0x1a')]===_0xd83c('0x1b')&&typeof _0x54b716['limit']===_0xd83c('0x1b');var _0x5eef2f=_0x1271d4['count'];var _0xbd63d9=_0x276b19?0x0:_0x54b716[_0xd83c('0x1a')];var _0x1bf410=_0x276b19?_0x1271d4[_0xd83c('0x1c')]:_0x54b716[_0xd83c('0x1a')]+_0x54b716[_0xd83c('0x1d')];var _0x2810b3;if(_0x1bf410>=_0x5eef2f){_0x1bf410=_0x5eef2f;_0x2810b3=0xc8;}else{_0x2810b3=0xce;}_0x1617a1[_0xd83c('0x18')](_0x2810b3);return _0x1617a1[_0xd83c('0x1e')](_0xd83c('0x1f'),_0xbd63d9+'-'+_0x1bf410+'/'+_0x5eef2f)[_0xd83c('0x20')](_0x1271d4);}return null;};}function patchUpdates(_0x30d96c){return function(_0x24452f){try{jsonpatch['apply'](_0x24452f,_0x30d96c,!![]);}catch(_0xd70446){return BPromise[_0xd83c('0x21')](_0xd70446);}return _0x24452f[_0xd83c('0x22')]();};}function saveUpdates(_0x10dbda,_0x3ee772){return function(_0x1b7d89){if(_0x1b7d89){return _0x1b7d89[_0xd83c('0x23')](_0x10dbda)[_0xd83c('0x24')](function(_0x6a21d1){return _0x6a21d1;});}return null;};}function removeEntity(_0x312f2c,_0x35142f){return function(_0xeafa7e){if(_0xeafa7e){return _0xeafa7e[_0xd83c('0x25')]()[_0xd83c('0x24')](function(){var _0x22569d=_0xeafa7e[_0xd83c('0x26')]({'plain':!![]});var _0x4cdda1=_0xd83c('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x4cdda1,'resourceId':_0x22569d['id']}})['then'](function(){return _0xeafa7e;});})[_0xd83c('0x24')](function(){_0x312f2c['status'](0xcc)[_0xd83c('0x19')]();});}};}function handleEntityNotFound(_0x339ff9,_0x539a6a){return function(_0x142e8f){if(!_0x142e8f){_0x339ff9[_0xd83c('0x17')](0x194);}return _0x142e8f;};}function handleError(_0xcc9268,_0x56c281){_0x56c281=_0x56c281||0x1f4;return function(_0x1e3f30){logger[_0xd83c('0x28')](_0x1e3f30[_0xd83c('0x29')]);if(_0x1e3f30['name']){delete _0x1e3f30[_0xd83c('0x2a')];}_0xcc9268[_0xd83c('0x18')](_0x56c281)[_0xd83c('0x2b')](_0x1e3f30);};}exports['index']=function(_0x3d6a54,_0x25493e){var _0x2130a6={},_0xe04b9a={},_0x35bdec={'count':0x0,'rows':[]};var _0x1fd8c1=_[_0xd83c('0x2c')](db['Campaign'][_0xd83c('0x2d')],function(_0xaec462){return{'name':_0xaec462[_0xd83c('0x2e')],'type':_0xaec462['type'][_0xd83c('0x2f')]};});_0xe04b9a['model']=_['map'](_0x1fd8c1,_0xd83c('0x2a'));_0xe04b9a[_0xd83c('0x30')]=_[_0xd83c('0x31')](_0x3d6a54[_0xd83c('0x30')]);_0xe04b9a[_0xd83c('0x32')]=_[_0xd83c('0x33')](_0xe04b9a[_0xd83c('0x34')],_0xe04b9a[_0xd83c('0x30')]);_0x2130a6[_0xd83c('0x35')]=_[_0xd83c('0x33')](_0xe04b9a[_0xd83c('0x34')],qs['fields'](_0x3d6a54['query']['fields']));_0x2130a6[_0xd83c('0x35')]=_0x2130a6['attributes'][_0xd83c('0x36')]?_0x2130a6[_0xd83c('0x35')]:_0xe04b9a['model'];if(!_0x3d6a54[_0xd83c('0x30')][_0xd83c('0x37')]('nolimit')){_0x2130a6['limit']=qs[_0xd83c('0x1d')](_0x3d6a54[_0xd83c('0x30')]['limit']);_0x2130a6['offset']=qs['offset'](_0x3d6a54[_0xd83c('0x30')][_0xd83c('0x1a')]);}_0x2130a6[_0xd83c('0x38')]=qs[_0xd83c('0x39')](_0x3d6a54[_0xd83c('0x30')][_0xd83c('0x39')]);_0x2130a6[_0xd83c('0x3a')]=qs['filters'](_['pick'](_0x3d6a54[_0xd83c('0x30')],_0xe04b9a[_0xd83c('0x32')]),_0x1fd8c1);if(_0x3d6a54['query']['filter']){_0x2130a6[_0xd83c('0x3a')]=_[_0xd83c('0x3b')](_0x2130a6[_0xd83c('0x3a')],{'$or':_[_0xd83c('0x2c')](_0x1fd8c1,function(_0x16ebff){if(_0x16ebff[_0xd83c('0x3c')]!==_0xd83c('0x3d')){var _0x114108={};_0x114108[_0x16ebff[_0xd83c('0x2a')]]={'$like':'%'+_0x3d6a54['query'][_0xd83c('0x3e')]+'%'};return _0x114108;}})});}_0x2130a6=_[_0xd83c('0x3b')]({},_0x2130a6,_0x3d6a54[_0xd83c('0x3f')]);var _0x5bf1cd={'where':_0x2130a6[_0xd83c('0x3a')]};return db[_0xd83c('0x40')]['count'](_0x5bf1cd)[_0xd83c('0x24')](function(_0x39d451){_0x35bdec[_0xd83c('0x1c')]=_0x39d451;if(_0x3d6a54['query'][_0xd83c('0x41')]){_0x2130a6[_0xd83c('0x42')]=[{'all':!![]}];}return db[_0xd83c('0x40')]['findAll'](_0x2130a6);})[_0xd83c('0x24')](function(_0x3edcdf){_0x35bdec[_0xd83c('0x43')]=_0x3edcdf;return _0x35bdec;})[_0xd83c('0x24')](respondWithFilteredResult(_0x25493e,_0x2130a6))[_0xd83c('0x44')](handleError(_0x25493e,null));};exports[_0xd83c('0x45')]=function(_0x11f8d1,_0x3eb29a){var _0x1d6f93={'raw':![],'where':{'id':_0x11f8d1[_0xd83c('0x46')]['id']}},_0x5ece5d={};_0x5ece5d[_0xd83c('0x34')]=_['keys'](db[_0xd83c('0x40')][_0xd83c('0x2d')]);_0x5ece5d[_0xd83c('0x30')]=_[_0xd83c('0x31')](_0x11f8d1['query']);_0x5ece5d[_0xd83c('0x32')]=_[_0xd83c('0x33')](_0x5ece5d[_0xd83c('0x34')],_0x5ece5d[_0xd83c('0x30')]);_0x1d6f93[_0xd83c('0x35')]=_[_0xd83c('0x33')](_0x5ece5d[_0xd83c('0x34')],qs['fields'](_0x11f8d1['query'][_0xd83c('0x47')]));_0x1d6f93[_0xd83c('0x35')]=_0x1d6f93[_0xd83c('0x35')][_0xd83c('0x36')]?_0x1d6f93[_0xd83c('0x35')]:_0x5ece5d[_0xd83c('0x34')];if(_0x11f8d1[_0xd83c('0x30')][_0xd83c('0x41')]){_0x1d6f93[_0xd83c('0x42')]=[{'all':!![]}];}_0x1d6f93=_['merge']({},_0x1d6f93,_0x11f8d1[_0xd83c('0x3f')]);return db[_0xd83c('0x40')][_0xd83c('0x48')](_0x1d6f93)[_0xd83c('0x24')](handleEntityNotFound(_0x3eb29a,null))[_0xd83c('0x24')](respondWithResult(_0x3eb29a,null))['catch'](handleError(_0x3eb29a,null));};exports[_0xd83c('0x49')]=function(_0x3f30e3,_0x18e2bc){return db[_0xd83c('0x40')]['create'](_0x3f30e3['body'],{})[_0xd83c('0x24')](function(_0x5c57a0){var _0xf6ee83=_0x3f30e3['user'][_0xd83c('0x26')]({'plain':!![]});if(!_0xf6ee83)throw new Error(_0xd83c('0x4a'));if(_0xf6ee83[_0xd83c('0x4b')]==='user'){var _0x13ff5a=_0x5c57a0[_0xd83c('0x26')]({'plain':!![]});var _0x58dfd8=_0xd83c('0x27');return db[_0xd83c('0x4c')]['find']({'where':{'name':_0x58dfd8,'userProfileId':_0xf6ee83[_0xd83c('0x4d')]},'raw':!![]})[_0xd83c('0x24')](function(_0x168a7b){if(_0x168a7b&&_0x168a7b['autoAssociation']===0x0){return db[_0xd83c('0x4e')][_0xd83c('0x49')]({'name':_0x13ff5a['name'],'resourceId':_0x13ff5a['id'],'type':_0x168a7b[_0xd83c('0x2a')],'sectionId':_0x168a7b['id']},{})['then'](function(){return _0x5c57a0;});}else{return _0x5c57a0;}})['catch'](function(_0x50cd59){logger[_0xd83c('0x28')](_0xd83c('0x4f'),_0x50cd59);throw _0x50cd59;});}return _0x5c57a0;})[_0xd83c('0x24')](respondWithResult(_0x18e2bc,0xc9))[_0xd83c('0x44')](handleError(_0x18e2bc,null));};exports[_0xd83c('0x50')]=function(_0x575e2b,_0x1749ed){var _0x29bf30={'where':{'id':_0x575e2b[_0xd83c('0x46')]['id']}},_0x34774b={};_0x34774b[_0xd83c('0x34')]=_[_0xd83c('0x31')](db[_0xd83c('0x40')][_0xd83c('0x2d')]);_0x29bf30['attributes']=_['intersection'](_0x34774b[_0xd83c('0x34')],qs['fields'](_0x575e2b[_0xd83c('0x30')][_0xd83c('0x47')]));_0x29bf30[_0xd83c('0x35')]=_0x29bf30[_0xd83c('0x35')][_0xd83c('0x36')]?_0x29bf30[_0xd83c('0x35')]:_0x34774b[_0xd83c('0x34')];if(_0x575e2b['query']['includeAll']){_0x29bf30[_0xd83c('0x42')]=[{'all':!![]}];}_0x29bf30=_['merge']({},_0x29bf30,_0x575e2b[_0xd83c('0x3f')]);return db[_0xd83c('0x40')]['find'](_0x29bf30)[_0xd83c('0x24')](handleEntityNotFound(_0x1749ed,null))[_0xd83c('0x24')](function(_0x1158c0){if(_0x1158c0){var _0x4ffc45=_0x1158c0[_0xd83c('0x26')]({'plain':!![]});_0x4ffc45=qs[_0xd83c('0x51')](_0x4ffc45,['id',_0xd83c('0x52'),_0xd83c('0x53')]);_0x575e2b[_0xd83c('0x54')]=_['omit'](_0x575e2b[_0xd83c('0x54')],['id',_0xd83c('0x52'),'updatedAt']);return db[_0xd83c('0x40')][_0xd83c('0x49')](_[_0xd83c('0x3b')](_0x4ffc45,_0x575e2b['body']),{'include':_0x575e2b[_0xd83c('0x30')][_0xd83c('0x41')]?[{'all':!![]}]:undefined})[_0xd83c('0x24')](function(_0x1ea75e){var _0x15f040=_0x575e2b[_0xd83c('0x55')][_0xd83c('0x26')]({'plain':!![]});if(!_0x15f040)throw new Error(_0xd83c('0x4a'));if(_0x15f040[_0xd83c('0x4b')]==='user'){var _0x2bde69=_0x1ea75e[_0xd83c('0x26')]({'plain':!![]});var _0xb9a03b='IvrCampaigns';return db['UserProfileSection']['find']({'where':{'name':_0xb9a03b,'userProfileId':_0x15f040[_0xd83c('0x4d')]},'raw':!![]})[_0xd83c('0x24')](function(_0x58bd27){if(_0x58bd27&&_0x58bd27['autoAssociation']===0x0){return db['UserProfileResource'][_0xd83c('0x49')]({'name':_0x2bde69['name'],'resourceId':_0x2bde69['id'],'type':_0x58bd27[_0xd83c('0x2a')],'sectionId':_0x58bd27['id']},{})['then'](function(){return _0x1ea75e;});}else{return _0x1ea75e;}})['catch'](function(_0x1927de){logger[_0xd83c('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1927de);throw _0x1927de;});}return _0x1ea75e;});}})[_0xd83c('0x24')](respondWithResult(_0x1749ed,0xc9))[_0xd83c('0x44')](handleError(_0x1749ed,null));};exports[_0xd83c('0x23')]=function(_0x848a01,_0x4c4c3e){if(_0x848a01[_0xd83c('0x54')]['id']){delete _0x848a01[_0xd83c('0x54')]['id'];}return db[_0xd83c('0x40')][_0xd83c('0x48')]({'where':{'id':_0x848a01['params']['id']}})['then'](handleEntityNotFound(_0x4c4c3e,null))[_0xd83c('0x24')](saveUpdates(_0x848a01['body'],null))[_0xd83c('0x24')](respondWithResult(_0x4c4c3e,null))[_0xd83c('0x44')](handleError(_0x4c4c3e,null));};exports[_0xd83c('0x25')]=function(_0x32776b,_0x310198){return db[_0xd83c('0x40')][_0xd83c('0x48')]({'where':{'id':_0x32776b[_0xd83c('0x46')]['id']}})['then'](handleEntityNotFound(_0x310198,null))[_0xd83c('0x24')](removeEntity(_0x310198,null))[_0xd83c('0x44')](handleError(_0x310198,null));};exports[_0xd83c('0x56')]=function(_0x2f1ca2,_0x3b2879,_0x49ed80){var _0x1a801e={'raw':!![],'where':{}};var _0x2621ee={};var _0x403c75={'count':0x0,'rows':[]};return db[_0xd83c('0x40')][_0xd83c('0x57')]({'where':{'id':_0x2f1ca2[_0xd83c('0x46')]['id']}})['then'](handleEntityNotFound(_0x3b2879,null))['then'](function(_0x4b58a2){if(_0x4b58a2){_0x2621ee[_0xd83c('0x34')]=_[_0xd83c('0x31')](db['CmHopper'][_0xd83c('0x2d')]);_0x2621ee[_0xd83c('0x30')]=_[_0xd83c('0x31')](_0x2f1ca2['query']);_0x2621ee[_0xd83c('0x32')]=_[_0xd83c('0x33')](_0x2621ee[_0xd83c('0x34')],_0x2621ee[_0xd83c('0x30')]);_0x1a801e['attributes']=_[_0xd83c('0x33')](_0x2621ee[_0xd83c('0x34')],qs[_0xd83c('0x47')](_0x2f1ca2['query'][_0xd83c('0x47')]));_0x1a801e[_0xd83c('0x35')]=_0x1a801e[_0xd83c('0x35')][_0xd83c('0x36')]?_0x1a801e[_0xd83c('0x35')]:_0x2621ee[_0xd83c('0x34')];if(!_0x2f1ca2[_0xd83c('0x30')][_0xd83c('0x37')]('nolimit')){_0x1a801e[_0xd83c('0x1d')]=qs[_0xd83c('0x1d')](_0x2f1ca2[_0xd83c('0x30')]['limit']);_0x1a801e[_0xd83c('0x1a')]=qs['offset'](_0x2f1ca2[_0xd83c('0x30')][_0xd83c('0x1a')]);}_0x1a801e[_0xd83c('0x38')]=qs['sort'](_0x2f1ca2[_0xd83c('0x30')]['sort']);_0x1a801e['where']=qs[_0xd83c('0x32')](_[_0xd83c('0x58')](_0x2f1ca2[_0xd83c('0x30')],_0x2621ee[_0xd83c('0x32')]));_0x1a801e[_0xd83c('0x3a')][_0xd83c('0x59')]=_0x4b58a2['id'];if(_0x2f1ca2[_0xd83c('0x30')]['filter']){_0x1a801e[_0xd83c('0x3a')]=_['merge'](_0x1a801e['where'],{'$or':_[_0xd83c('0x2c')](_0x1a801e['attributes'],function(_0x35c561){var _0xe59564={};_0xe59564[_0x35c561]={'$like':'%'+_0x2f1ca2[_0xd83c('0x30')]['filter']+'%'};return _0xe59564;})});}_0x1a801e=_[_0xd83c('0x3b')]({},_0x1a801e,_0x2f1ca2[_0xd83c('0x3f')]);return db['CmHopper'][_0xd83c('0x1c')]({'where':_0x1a801e[_0xd83c('0x3a')]})[_0xd83c('0x24')](function(_0x22d5ea){_0x403c75[_0xd83c('0x1c')]=_0x22d5ea;if(_0x2f1ca2[_0xd83c('0x30')][_0xd83c('0x41')]){_0x1a801e[_0xd83c('0x42')]=[{'all':!![]}];}return db[_0xd83c('0x5a')][_0xd83c('0x5b')](_0x1a801e);})[_0xd83c('0x24')](function(_0x302bb9){_0x403c75[_0xd83c('0x43')]=_0x302bb9;return _0x403c75;});}})[_0xd83c('0x24')](respondWithFilteredResult(_0x3b2879,_0x1a801e))['catch'](handleError(_0x3b2879,null));};exports[_0xd83c('0x5c')]=function(_0x52c219,_0x621e37,_0x17c06c){var _0x2cde9e={'raw':!![],'where':{}};var _0x2f20a5={};var _0x479a11={'count':0x0,'rows':[]};return db[_0xd83c('0x40')]['findOne']({'where':{'id':_0x52c219['params']['id']}})['then'](handleEntityNotFound(_0x621e37,null))[_0xd83c('0x24')](function(_0x271d2d){if(_0x271d2d){_0x2f20a5[_0xd83c('0x34')]=_[_0xd83c('0x31')](db[_0xd83c('0x5d')][_0xd83c('0x2d')]);_0x2f20a5[_0xd83c('0x30')]=_[_0xd83c('0x31')](_0x52c219['query']);_0x2f20a5['filters']=_[_0xd83c('0x33')](_0x2f20a5['model'],_0x2f20a5['query']);_0x2cde9e[_0xd83c('0x35')]=_[_0xd83c('0x33')](_0x2f20a5['model'],qs[_0xd83c('0x47')](_0x52c219[_0xd83c('0x30')][_0xd83c('0x47')]));_0x2cde9e['attributes']=_0x2cde9e[_0xd83c('0x35')]['length']?_0x2cde9e[_0xd83c('0x35')]:_0x2f20a5['model'];if(!_0x52c219[_0xd83c('0x30')][_0xd83c('0x37')](_0xd83c('0x5e'))){_0x2cde9e[_0xd83c('0x1d')]=qs[_0xd83c('0x1d')](_0x52c219[_0xd83c('0x30')][_0xd83c('0x1d')]);_0x2cde9e[_0xd83c('0x1a')]=qs[_0xd83c('0x1a')](_0x52c219[_0xd83c('0x30')][_0xd83c('0x1a')]);}_0x2cde9e['order']=qs['sort'](_0x52c219[_0xd83c('0x30')][_0xd83c('0x39')]);_0x2cde9e[_0xd83c('0x3a')]=qs[_0xd83c('0x32')](_[_0xd83c('0x58')](_0x52c219[_0xd83c('0x30')],_0x2f20a5[_0xd83c('0x32')]));_0x2cde9e[_0xd83c('0x3a')][_0xd83c('0x59')]=_0x271d2d['id'];if(_0x52c219[_0xd83c('0x30')]['filter']){_0x2cde9e[_0xd83c('0x3a')]=_['merge'](_0x2cde9e[_0xd83c('0x3a')],{'$or':_[_0xd83c('0x2c')](_0x2cde9e[_0xd83c('0x35')],function(_0x1f46df){var _0x2dd610={};_0x2dd610[_0x1f46df]={'$like':'%'+_0x52c219[_0xd83c('0x30')][_0xd83c('0x3e')]+'%'};return _0x2dd610;})});}_0x2cde9e=_[_0xd83c('0x3b')]({},_0x2cde9e,_0x52c219[_0xd83c('0x3f')]);return db['CmHopperHistory']['count']({'where':_0x2cde9e['where']})[_0xd83c('0x24')](function(_0x2d7993){_0x479a11[_0xd83c('0x1c')]=_0x2d7993;if(_0x52c219[_0xd83c('0x30')][_0xd83c('0x41')]){_0x2cde9e[_0xd83c('0x42')]=[{'all':!![]}];}return db[_0xd83c('0x5d')][_0xd83c('0x5b')](_0x2cde9e);})[_0xd83c('0x24')](function(_0x26c297){_0x479a11[_0xd83c('0x43')]=_0x26c297;return _0x479a11;});}})[_0xd83c('0x24')](respondWithFilteredResult(_0x621e37,_0x2cde9e))['catch'](handleError(_0x621e37,null));};exports[_0xd83c('0x5f')]=function(_0x72d4c6,_0x243aa8,_0x49b7f4){var _0x345131={'raw':!![],'where':{}};var _0x195241={};var _0x8b6359={'count':0x0,'rows':[]};return db[_0xd83c('0x40')]['findOne']({'where':{'id':_0x72d4c6['params']['id']}})[_0xd83c('0x24')](handleEntityNotFound(_0x243aa8,null))[_0xd83c('0x24')](function(_0x23f212){if(_0x23f212){_0x195241[_0xd83c('0x34')]=_[_0xd83c('0x31')](db[_0xd83c('0x60')][_0xd83c('0x2d')]);_0x195241['query']=_[_0xd83c('0x31')](_0x72d4c6[_0xd83c('0x30')]);_0x195241[_0xd83c('0x32')]=_[_0xd83c('0x33')](_0x195241['model'],_0x195241[_0xd83c('0x30')]);_0x345131[_0xd83c('0x35')]=_[_0xd83c('0x33')](_0x195241[_0xd83c('0x34')],qs[_0xd83c('0x47')](_0x72d4c6['query'][_0xd83c('0x47')]));_0x345131['attributes']=_0x345131[_0xd83c('0x35')]['length']?_0x345131[_0xd83c('0x35')]:_0x195241[_0xd83c('0x34')];if(!_0x72d4c6[_0xd83c('0x30')]['hasOwnProperty'](_0xd83c('0x5e'))){_0x345131[_0xd83c('0x1d')]=qs[_0xd83c('0x1d')](_0x72d4c6[_0xd83c('0x30')][_0xd83c('0x1d')]);_0x345131['offset']=qs[_0xd83c('0x1a')](_0x72d4c6[_0xd83c('0x30')][_0xd83c('0x1a')]);}_0x345131['order']=qs['sort'](_0x72d4c6[_0xd83c('0x30')]['sort']);_0x345131[_0xd83c('0x3a')]=qs['filters'](_['pick'](_0x72d4c6[_0xd83c('0x30')],_0x195241[_0xd83c('0x32')]));_0x345131[_0xd83c('0x3a')][_0xd83c('0x59')]=_0x23f212['id'];if(_0x72d4c6['query'][_0xd83c('0x3e')]){_0x345131[_0xd83c('0x3a')]=_[_0xd83c('0x3b')](_0x345131[_0xd83c('0x3a')],{'$or':_['map'](_0x345131[_0xd83c('0x35')],function(_0x230352){var _0x3f5129={};_0x3f5129[_0x230352]={'$like':'%'+_0x72d4c6[_0xd83c('0x30')]['filter']+'%'};return _0x3f5129;})});}_0x345131=_[_0xd83c('0x3b')]({},_0x345131,_0x72d4c6[_0xd83c('0x3f')]);return db[_0xd83c('0x60')][_0xd83c('0x1c')]({'where':_0x345131[_0xd83c('0x3a')]})[_0xd83c('0x24')](function(_0x676644){_0x8b6359[_0xd83c('0x1c')]=_0x676644;if(_0x72d4c6[_0xd83c('0x30')][_0xd83c('0x41')]){_0x345131[_0xd83c('0x42')]=[{'all':!![]}];}return db[_0xd83c('0x60')][_0xd83c('0x5b')](_0x345131);})[_0xd83c('0x24')](function(_0x2b2bc4){_0x8b6359['rows']=_0x2b2bc4;return _0x8b6359;});}})[_0xd83c('0x24')](respondWithFilteredResult(_0x243aa8,_0x345131))[_0xd83c('0x44')](handleError(_0x243aa8,null));};exports[_0xd83c('0x61')]=function(_0x40ea3f,_0x10ed21,_0x323560){var _0x13b4b1={'raw':!![],'where':{}};var _0xb688b5={};var _0x59c782={'count':0x0,'rows':[]};return db[_0xd83c('0x40')][_0xd83c('0x57')]({'where':{'id':_0x40ea3f[_0xd83c('0x46')]['id']}})[_0xd83c('0x24')](handleEntityNotFound(_0x10ed21,null))[_0xd83c('0x24')](function(_0x23e7ff){if(_0x23e7ff){_0xb688b5[_0xd83c('0x34')]=_[_0xd83c('0x31')](db[_0xd83c('0x62')][_0xd83c('0x2d')]);_0xb688b5[_0xd83c('0x30')]=_[_0xd83c('0x31')](_0x40ea3f[_0xd83c('0x30')]);_0xb688b5[_0xd83c('0x32')]=_[_0xd83c('0x33')](_0xb688b5['model'],_0xb688b5[_0xd83c('0x30')]);_0x13b4b1[_0xd83c('0x35')]=_[_0xd83c('0x33')](_0xb688b5[_0xd83c('0x34')],qs[_0xd83c('0x47')](_0x40ea3f['query']['fields']));_0x13b4b1['attributes']=_0x13b4b1[_0xd83c('0x35')][_0xd83c('0x36')]?_0x13b4b1[_0xd83c('0x35')]:_0xb688b5[_0xd83c('0x34')];if(!_0x40ea3f[_0xd83c('0x30')][_0xd83c('0x37')]('nolimit')){_0x13b4b1[_0xd83c('0x1d')]=qs[_0xd83c('0x1d')](_0x40ea3f['query'][_0xd83c('0x1d')]);_0x13b4b1[_0xd83c('0x1a')]=qs['offset'](_0x40ea3f[_0xd83c('0x30')][_0xd83c('0x1a')]);}_0x13b4b1[_0xd83c('0x38')]=qs['sort'](_0x40ea3f[_0xd83c('0x30')][_0xd83c('0x39')]);_0x13b4b1[_0xd83c('0x3a')]=qs[_0xd83c('0x32')](_[_0xd83c('0x58')](_0x40ea3f[_0xd83c('0x30')],_0xb688b5['filters']));_0x13b4b1[_0xd83c('0x3a')][_0xd83c('0x59')]=_0x23e7ff['id'];if(_0x40ea3f[_0xd83c('0x30')][_0xd83c('0x3e')]){_0x13b4b1[_0xd83c('0x3a')]=_['merge'](_0x13b4b1[_0xd83c('0x3a')],{'$or':_[_0xd83c('0x2c')](_0x13b4b1[_0xd83c('0x35')],function(_0x4cc940){var _0x16d002={};_0x16d002[_0x4cc940]={'$like':'%'+_0x40ea3f[_0xd83c('0x30')][_0xd83c('0x3e')]+'%'};return _0x16d002;})});}_0x13b4b1=_[_0xd83c('0x3b')]({},_0x13b4b1,_0x40ea3f[_0xd83c('0x3f')]);return db[_0xd83c('0x62')][_0xd83c('0x1c')]({'where':_0x13b4b1[_0xd83c('0x3a')]})[_0xd83c('0x24')](function(_0x51e615){_0x59c782[_0xd83c('0x1c')]=_0x51e615;if(_0x40ea3f[_0xd83c('0x30')]['includeAll']){_0x13b4b1[_0xd83c('0x42')]=[{'all':!![]}];}return db[_0xd83c('0x62')][_0xd83c('0x5b')](_0x13b4b1);})[_0xd83c('0x24')](function(_0x58e463){_0x59c782['rows']=_0x58e463;return _0x59c782;});}})[_0xd83c('0x24')](respondWithFilteredResult(_0x10ed21,_0x13b4b1))['catch'](handleError(_0x10ed21,null));};exports['getLists']=function(_0xb035ce,_0x1223e8,_0x5d320e){var _0x27b4c9={};var _0x16f9a9={};var _0x15b77d;var _0x107666;return db[_0xd83c('0x40')]['findOne']({'where':{'id':_0xb035ce[_0xd83c('0x46')]['id']}})[_0xd83c('0x24')](handleEntityNotFound(_0x1223e8,null))[_0xd83c('0x24')](function(_0x3a4586){if(_0x3a4586){_0x15b77d=_0x3a4586;_0x16f9a9[_0xd83c('0x34')]=_[_0xd83c('0x31')](db['CmList']['rawAttributes']);_0x16f9a9[_0xd83c('0x30')]=_[_0xd83c('0x31')](_0xb035ce[_0xd83c('0x30')]);_0x16f9a9[_0xd83c('0x32')]=_[_0xd83c('0x33')](_0x16f9a9[_0xd83c('0x34')],_0x16f9a9[_0xd83c('0x30')]);_0x27b4c9[_0xd83c('0x35')]=_[_0xd83c('0x33')](_0x16f9a9[_0xd83c('0x34')],qs['fields'](_0xb035ce['query'][_0xd83c('0x47')]));_0x27b4c9[_0xd83c('0x35')]=_0x27b4c9[_0xd83c('0x35')]['length']?_0x27b4c9[_0xd83c('0x35')]:_0x16f9a9[_0xd83c('0x34')];_0x27b4c9[_0xd83c('0x38')]=qs[_0xd83c('0x39')](_0xb035ce[_0xd83c('0x30')][_0xd83c('0x39')]);_0x27b4c9[_0xd83c('0x3a')]=qs['filters'](_[_0xd83c('0x58')](_0xb035ce[_0xd83c('0x30')],_0x16f9a9['filters']));if(_0xb035ce[_0xd83c('0x30')][_0xd83c('0x3e')]){_0x27b4c9['where']=_['merge'](_0x27b4c9[_0xd83c('0x3a')],{'$or':_[_0xd83c('0x2c')](_0x27b4c9[_0xd83c('0x35')],function(_0x20d743){var _0x38c87f={};_0x38c87f[_0x20d743]={'$like':'%'+_0xb035ce['query'][_0xd83c('0x3e')]+'%'};return _0x38c87f;})});}_0x27b4c9=_[_0xd83c('0x3b')]({},_0x27b4c9,_0xb035ce[_0xd83c('0x3f')]);return _0x15b77d[_0xd83c('0x63')](_0x27b4c9);}})[_0xd83c('0x24')](function(_0x5ab89e){if(_0x5ab89e){_0x107666=_0x5ab89e[_0xd83c('0x36')];if(!_0xb035ce[_0xd83c('0x30')]['hasOwnProperty']('nolimit')){_0x27b4c9['limit']=qs[_0xd83c('0x1d')](_0xb035ce[_0xd83c('0x30')][_0xd83c('0x1d')]);_0x27b4c9[_0xd83c('0x1a')]=qs['offset'](_0xb035ce[_0xd83c('0x30')][_0xd83c('0x1a')]);}return _0x15b77d[_0xd83c('0x63')](_0x27b4c9);}})['then'](function(_0x493752){if(_0x493752){return _0x493752?{'count':_0x107666,'rows':_0x493752}:null;}})[_0xd83c('0x24')](respondWithResult(_0x1223e8,null))[_0xd83c('0x44')](handleError(_0x1223e8,null));};exports[_0xd83c('0x64')]=function(_0x2ba6a4,_0x29f284,_0x57d870){var _0x3e7398,_0x1bbe98;var _0x28420d=[];var _0x29e91=moment()[_0xd83c('0x65')](_0xd83c('0x66'));return db['Campaign'][_0xd83c('0x48')]({'where':{'id':_0x2ba6a4['params']['id']}})['then'](handleEntityNotFound(_0x29f284,null))['then'](function(_0x21ab47){if(_0x21ab47){_0x1bbe98=_0x21ab47;return _0x21ab47[_0xd83c('0x64')](_0x2ba6a4[_0xd83c('0x54')][_0xd83c('0x67')],_[_0xd83c('0x51')](_0x2ba6a4['body'],[_0xd83c('0x67'),'id'])||{});}return null;})[_0xd83c('0x68')](function(_0xf9d12e){var _0x41f53a;var _0x5b22c0;_0x3e7398=_0xf9d12e||[];var _0x2ea2b8=[];if(_0xf9d12e){for(var _0x3e3094=0x0;_0x3e3094<_0xf9d12e[_0xd83c('0x36')];_0x3e3094+=0x1){var _0x460c98=_0xf9d12e[_0x3e3094][_0xd83c('0x26')]({'plain':!![]});_0x1bbe98[_0xd83c('0x69')]=_0x2ba6a4['body']['dialCheckDuplicateType']?_0x2ba6a4[_0xd83c('0x54')][_0xd83c('0x69')]:_0x1bbe98[_0xd83c('0x69')];switch(_0x1bbe98[_0xd83c('0x69')]){case _0xd83c('0x6a'):_0x41f53a=squel[_0xd83c('0x6b')]()[_0xd83c('0x6c')]('cm_hopper')[_0xd83c('0x6d')](['phone',_0xd83c('0x6e'),_0xd83c('0x6f'),_0xd83c('0x70'),_0xd83c('0x59'),_0xd83c('0x52'),_0xd83c('0x53')],squel[_0xd83c('0x71')]()['field']('phone',_0xd83c('0x72'))[_0xd83c('0x73')](_0xd83c('0x74'),_0xd83c('0x6e'))[_0xd83c('0x73')]('id','ContactId')[_0xd83c('0x73')](_0x460c98[_0xd83c('0x75')]['toString'](),_0xd83c('0x70'))['field'](_0x2ba6a4[_0xd83c('0x46')]['id'][_0xd83c('0x76')](),_0xd83c('0x59'))[_0xd83c('0x73')]('\x27'+_0x29e91+'\x27',_0xd83c('0x52'))[_0xd83c('0x73')]('\x27'+_0x29e91+'\x27','updatedAt')['from'](_0xd83c('0x77'))['where']('deletedAt\x20IS\x20NULL')[_0xd83c('0x3a')]('ListId\x20=\x20?',_0x460c98['CmListId'][_0xd83c('0x76')]())[_0xd83c('0x3a')]('phone\x20IS\x20NOT\x20NULL')[_0xd83c('0x3a')](_0xd83c('0x78'),squel[_0xd83c('0x71')]()[_0xd83c('0x73')](_0xd83c('0x79'))[_0xd83c('0x7a')](_0xd83c('0x7b'))[_0xd83c('0x3a')](_0xd83c('0x7c'),_0x2ba6a4[_0xd83c('0x46')]['id'][_0xd83c('0x76')]()))[_0xd83c('0x3a')](_0xd83c('0x78'),squel[_0xd83c('0x71')]()[_0xd83c('0x73')](_0xd83c('0x7d'))[_0xd83c('0x7a')](_0xd83c('0x7e'))['where'](_0xd83c('0x7c'),_0x2ba6a4[_0xd83c('0x46')]['id'][_0xd83c('0x76')]())))['toString']();break;case'onlyIfOpen':_0x41f53a=squel['insert']()[_0xd83c('0x6c')](_0xd83c('0x7e'))[_0xd83c('0x6d')](['phone',_0xd83c('0x6e'),_0xd83c('0x6f'),'ListId','CampaignId',_0xd83c('0x52'),_0xd83c('0x53')],squel[_0xd83c('0x71')]()[_0xd83c('0x73')](_0xd83c('0x72'),_0xd83c('0x72'))[_0xd83c('0x73')]('NOW()','scheduledAt')[_0xd83c('0x73')]('id',_0xd83c('0x6f'))[_0xd83c('0x73')](_0x460c98[_0xd83c('0x75')][_0xd83c('0x76')](),_0xd83c('0x70'))[_0xd83c('0x73')](_0x2ba6a4[_0xd83c('0x46')]['id']['toString'](),_0xd83c('0x59'))[_0xd83c('0x73')]('\x27'+_0x29e91+'\x27','createdAt')[_0xd83c('0x73')]('\x27'+_0x29e91+'\x27','updatedAt')[_0xd83c('0x7a')]('cm_contacts')[_0xd83c('0x3a')](_0xd83c('0x7f'))['where'](_0xd83c('0x80'),_0x460c98['CmListId'][_0xd83c('0x76')]())[_0xd83c('0x3a')](_0xd83c('0x81'))[_0xd83c('0x3a')](_0xd83c('0x78'),squel[_0xd83c('0x71')]()[_0xd83c('0x73')](_0xd83c('0x7d'))[_0xd83c('0x7a')](_0xd83c('0x7e'))[_0xd83c('0x3a')]('CampaignId\x20=\x20?',_0x2ba6a4['params']['id'][_0xd83c('0x76')]())))[_0xd83c('0x76')]();break;default:_0x41f53a=squel[_0xd83c('0x6b')]()['into'](_0xd83c('0x7e'))[_0xd83c('0x6d')](['phone',_0xd83c('0x6e'),_0xd83c('0x6f'),_0xd83c('0x70'),_0xd83c('0x59'),_0xd83c('0x52'),'updatedAt'],squel[_0xd83c('0x71')]()['field']('phone','phone')[_0xd83c('0x73')](_0xd83c('0x74'),_0xd83c('0x6e'))[_0xd83c('0x73')]('id',_0xd83c('0x6f'))['field'](_0x460c98[_0xd83c('0x75')][_0xd83c('0x76')](),_0xd83c('0x70'))[_0xd83c('0x73')](_0x2ba6a4[_0xd83c('0x46')]['id'][_0xd83c('0x76')](),_0xd83c('0x59'))[_0xd83c('0x73')]('\x27'+_0x29e91+'\x27',_0xd83c('0x52'))['field']('\x27'+_0x29e91+'\x27',_0xd83c('0x53'))[_0xd83c('0x7a')](_0xd83c('0x77'))[_0xd83c('0x3a')](_0xd83c('0x7f'))['where'](_0xd83c('0x80'),_0x460c98['CmListId'][_0xd83c('0x76')]())[_0xd83c('0x3a')](_0xd83c('0x81')))['toString']();}_0x5b22c0=squel[_0xd83c('0x6b')]()[_0xd83c('0x6c')](_0xd83c('0x82'))[_0xd83c('0x6d')]([_0xd83c('0x83'),_0xd83c('0x6e'),'phone',_0xd83c('0x84'),'createdAt',_0xd83c('0x53')],squel[_0xd83c('0x71')]()[_0xd83c('0x73')]('h.id','id')[_0xd83c('0x73')](_0xd83c('0x74'),'scheduledAt')[_0xd83c('0x73')](_0xd83c('0x85'),_0xd83c('0x72'))[_0xd83c('0x73')](_0xd83c('0x86'),'OrderBy')[_0xd83c('0x73')]('\x27'+_0x29e91+'\x27',_0xd83c('0x52'))[_0xd83c('0x73')]('\x27'+_0x29e91+'\x27',_0xd83c('0x53'))[_0xd83c('0x7a')](_0xd83c('0x87'),'ci')['join'](_0xd83c('0x7e'),'h',_0xd83c('0x88'))[_0xd83c('0x3a')](_0xd83c('0x89'),_0x460c98[_0xd83c('0x75')]['toString']())[_0xd83c('0x3a')](_0xd83c('0x8a'),_0x2ba6a4[_0xd83c('0x46')]['id'][_0xd83c('0x76')]())[_0xd83c('0x3a')](_0xd83c('0x8b'),_0x29e91))[_0xd83c('0x76')]();_0x2ea2b8[_0xd83c('0x8c')](db[_0xd83c('0x8d')][_0xd83c('0x30')](_0x41f53a));_0x28420d[_0xd83c('0x8c')](db[_0xd83c('0x8d')][_0xd83c('0x30')](_0x5b22c0));}return BPromise['all'](_0x2ea2b8);}})['then'](function(){return BPromise[_0xd83c('0x8e')](_0x28420d);})['then'](function(){return _0x3e7398;})[_0xd83c('0x24')](respondWithResult(_0x29f284,null))['catch'](handleError(_0x29f284,null));};exports[_0xd83c('0x8f')]=function(_0xbcc447,_0x68e40f,_0x3435eb){return db[_0xd83c('0x40')][_0xd83c('0x48')]({'where':{'id':_0xbcc447['params']['id']}})[_0xd83c('0x24')](handleEntityNotFound(_0x68e40f,null))[_0xd83c('0x24')](function(_0x2e66a8){if(_0x2e66a8){return _0x2e66a8[_0xd83c('0x8f')](_0xbcc447[_0xd83c('0x30')][_0xd83c('0x67')]);}})['then'](function(_0x437077){if(_0x437077){return db[_0xd83c('0x5a')][_0xd83c('0x25')]({'where':{'ListId':_0xbcc447[_0xd83c('0x30')][_0xd83c('0x67')],'CampaignId':_0xbcc447[_0xd83c('0x46')]['id']}})[_0xd83c('0x24')](function(){return _0x437077;});}})[_0xd83c('0x24')](respondWithStatusCode(_0x68e40f,null))[_0xd83c('0x44')](handleError(_0x68e40f,null));};exports[_0xd83c('0x90')]=function(_0x315a70,_0x3481ec,_0x2f05e4){var _0x587ac8={};var _0x1d34e7={};var _0x3ed95b;var _0x25903e;return db[_0xd83c('0x40')][_0xd83c('0x57')]({'where':{'id':_0x315a70[_0xd83c('0x46')]['id']}})[_0xd83c('0x24')](handleEntityNotFound(_0x3481ec,null))['then'](function(_0x14d069){if(_0x14d069){_0x3ed95b=_0x14d069;_0x1d34e7[_0xd83c('0x34')]=_[_0xd83c('0x31')](db[_0xd83c('0x91')][_0xd83c('0x2d')]);_0x1d34e7[_0xd83c('0x30')]=_[_0xd83c('0x31')](_0x315a70[_0xd83c('0x30')]);_0x1d34e7[_0xd83c('0x32')]=_[_0xd83c('0x33')](_0x1d34e7['model'],_0x1d34e7[_0xd83c('0x30')]);_0x587ac8[_0xd83c('0x35')]=_[_0xd83c('0x33')](_0x1d34e7[_0xd83c('0x34')],qs[_0xd83c('0x47')](_0x315a70[_0xd83c('0x30')]['fields']));_0x587ac8['attributes']=_0x587ac8[_0xd83c('0x35')]['length']?_0x587ac8[_0xd83c('0x35')]:_0x1d34e7[_0xd83c('0x34')];_0x587ac8[_0xd83c('0x38')]=qs['sort'](_0x315a70['query'][_0xd83c('0x39')]);_0x587ac8[_0xd83c('0x3a')]=qs[_0xd83c('0x32')](_[_0xd83c('0x58')](_0x315a70['query'],_0x1d34e7[_0xd83c('0x32')]));if(_0x315a70['query']['filter']){_0x587ac8['where']=_['merge'](_0x587ac8['where'],{'$or':_['map'](_0x587ac8['attributes'],function(_0x5ab251){var _0x1add72={};_0x1add72[_0x5ab251]={'$like':'%'+_0x315a70[_0xd83c('0x30')]['filter']+'%'};return _0x1add72;})});}_0x587ac8=_[_0xd83c('0x3b')]({},_0x587ac8,_0x315a70[_0xd83c('0x3f')]);return _0x3ed95b['getBlackLists'](_0x587ac8);}})[_0xd83c('0x24')](function(_0x38e6b2){if(_0x38e6b2){_0x25903e=_0x38e6b2[_0xd83c('0x36')];if(!_0x315a70['query'][_0xd83c('0x37')](_0xd83c('0x5e'))){_0x587ac8[_0xd83c('0x1d')]=qs[_0xd83c('0x1d')](_0x315a70['query']['limit']);_0x587ac8[_0xd83c('0x1a')]=qs[_0xd83c('0x1a')](_0x315a70['query']['offset']);}return _0x3ed95b[_0xd83c('0x90')](_0x587ac8);}})[_0xd83c('0x24')](function(_0x33c347){if(_0x33c347){return _0x33c347?{'count':_0x25903e,'rows':_0x33c347}:null;}})['then'](respondWithResult(_0x3481ec,null))[_0xd83c('0x44')](handleError(_0x3481ec,null));};exports[_0xd83c('0x92')]=function(_0x1c5266,_0x197653,_0x40e5f5){var _0x5a0559,_0x17201c;var _0x4f676e=[];var _0x139d97=moment()[_0xd83c('0x65')](_0xd83c('0x66'));return db['Campaign'][_0xd83c('0x48')]({'where':{'id':_0x1c5266[_0xd83c('0x46')]['id']}})[_0xd83c('0x24')](handleEntityNotFound(_0x197653,null))[_0xd83c('0x24')](function(_0x246d64){if(_0x246d64){_0x17201c=_0x246d64;return _0x246d64[_0xd83c('0x92')](_0x1c5266['body']['ids'],_[_0xd83c('0x51')](_0x1c5266[_0xd83c('0x54')],[_0xd83c('0x67'),'id'])||{});}return null;})[_0xd83c('0x68')](function(_0x18fa97){var _0x3204f2;var _0x2ffed4;_0x5a0559=_0x18fa97||[];var _0x5b4569=[];if(_0x18fa97){for(var _0x2614d6=0x0;_0x2614d6<_0x18fa97[_0xd83c('0x36')];_0x2614d6+=0x1){var _0x2f9cd5=_0x18fa97[_0x2614d6][_0xd83c('0x26')]({'plain':!![]});_0x3204f2=squel[_0xd83c('0x6b')]()[_0xd83c('0x6c')](_0xd83c('0x93'))[_0xd83c('0x6d')]([_0xd83c('0x72'),'ContactId','ListId',_0xd83c('0x59'),_0xd83c('0x52'),_0xd83c('0x53')],squel[_0xd83c('0x71')]()[_0xd83c('0x73')]('phone',_0xd83c('0x72'))[_0xd83c('0x73')]('id',_0xd83c('0x6f'))[_0xd83c('0x73')](_0x2f9cd5['CmListId'][_0xd83c('0x76')](),_0xd83c('0x70'))[_0xd83c('0x73')](_0x1c5266['params']['id'][_0xd83c('0x76')](),_0xd83c('0x59'))['field'](_0xd83c('0x74'),_0xd83c('0x52'))[_0xd83c('0x73')](_0xd83c('0x74'),_0xd83c('0x53'))[_0xd83c('0x7a')]('cm_contacts')['where'](_0xd83c('0x7f'))[_0xd83c('0x3a')](_0xd83c('0x80'),_0x2f9cd5[_0xd83c('0x75')][_0xd83c('0x76')]())['where'](_0xd83c('0x81')))[_0xd83c('0x76')]();_0x5b4569['push'](db[_0xd83c('0x8d')][_0xd83c('0x30')](_0x3204f2));}return BPromise[_0xd83c('0x8e')](_0x5b4569);}})[_0xd83c('0x24')](function(){return _0x5a0559;})['then'](respondWithResult(_0x197653,null))[_0xd83c('0x44')](handleError(_0x197653,null));};exports[_0xd83c('0x94')]=function(_0x489b73,_0x1cbc5a,_0x32a19a){return db['Campaign']['find']({'where':{'id':_0x489b73[_0xd83c('0x46')]['id']}})[_0xd83c('0x24')](handleEntityNotFound(_0x1cbc5a,null))[_0xd83c('0x24')](function(_0x2eaf1f){if(_0x2eaf1f){return _0x2eaf1f['removeBlackLists'](_0x489b73[_0xd83c('0x30')][_0xd83c('0x67')]);}})[_0xd83c('0x24')](function(_0x5e5e96){if(_0x5e5e96){return db['CmHopperBlack'][_0xd83c('0x25')]({'where':{'ListId':_0x489b73['query'][_0xd83c('0x67')],'CampaignId':_0x489b73['params']['id']}})[_0xd83c('0x24')](function(){return _0x5e5e96;});}})[_0xd83c('0x24')](respondWithStatusCode(_0x1cbc5a,null))[_0xd83c('0x44')](handleError(_0x1cbc5a,null));}; \ No newline at end of file +var _0x10d6=['field','NOW()','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','fromQuery','COALESCE(phone,\x27\x27)','ListId\x20=\x20?','cmHopperId','OrderBy','ci.OrderBY','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','sequelize','push','all','removeLists','CmList','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','offset','limit','undefined','status','set','Content-Range','json','apply','reject','save','update','destroy','then','get','IvrCampaigns','UserProfileResource','error','stack','name','send','map','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filters','merge','where','VIRTUAL','filter','options','Campaign','includeAll','include','rows','catch','params','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','clone','updatedAt','omit','createdAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','count','findAll','getHopperHistories','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','nolimit','getHopperBlacks','CmHopperBlack','getLists','addLists','format','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','select'];(function(_0x177e72,_0x28bf32){var _0x392698=function(_0x45a052){while(--_0x45a052){_0x177e72['push'](_0x177e72['shift']());}};_0x392698(++_0x28bf32);}(_0x10d6,0x145));var _0x610d=function(_0x2864e5,_0x7be4d9){_0x2864e5=_0x2864e5-0x0;var _0x28d3d7=_0x10d6[_0x2864e5];return _0x28d3d7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x610d('0x0'));var zipdir=require(_0x610d('0x1'));var jsonpatch=require(_0x610d('0x2'));var rp=require('request-promise');var moment=require(_0x610d('0x3'));var BPromise=require(_0x610d('0x4'));var Mustache=require(_0x610d('0x5'));var util=require(_0x610d('0x6'));var path=require(_0x610d('0x7'));var sox=require(_0x610d('0x8'));var csv=require(_0x610d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x610d('0xa'));var _=require(_0x610d('0xb'));var squel=require(_0x610d('0xc'));var crypto=require(_0x610d('0xd'));var jsforce=require(_0x610d('0xe'));var deskjs=require(_0x610d('0xf'));var toCsv=require(_0x610d('0x9'));var querystring=require(_0x610d('0x10'));var Papa=require(_0x610d('0x11'));var Redis=require(_0x610d('0x12'));var authService=require(_0x610d('0x13'));var qs=require(_0x610d('0x14'));var as=require(_0x610d('0x15'));var hardwareService=require(_0x610d('0x16'));var logger=require('../../config/logger')(_0x610d('0x17'));var utils=require(_0x610d('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x610d('0x19'));var db=require(_0x610d('0x1a'))['db'];function respondWithStatusCode(_0x57e0d4,_0x29bc8e){_0x29bc8e=_0x29bc8e||0xcc;return function(_0x2f226f){if(_0x2f226f){return _0x57e0d4[_0x610d('0x1b')](_0x29bc8e);}return _0x57e0d4['status'](_0x29bc8e)[_0x610d('0x1c')]();};}function respondWithResult(_0x36bbf3,_0x2a34a2){_0x2a34a2=_0x2a34a2||0xc8;return function(_0x590806){if(_0x590806){return _0x36bbf3['status'](_0x2a34a2)['json'](_0x590806);}};}function respondWithFilteredResult(_0x2c8406,_0x20db4b){return function(_0x1cafc9){if(_0x1cafc9){var _0x505dce=typeof _0x20db4b[_0x610d('0x1d')]==='undefined'&&typeof _0x20db4b[_0x610d('0x1e')]===_0x610d('0x1f');var _0x1ad466=_0x1cafc9['count'];var _0x2a4f41=_0x505dce?0x0:_0x20db4b['offset'];var _0x19b6e1=_0x505dce?_0x1cafc9['count']:_0x20db4b[_0x610d('0x1d')]+_0x20db4b[_0x610d('0x1e')];var _0x241275;if(_0x19b6e1>=_0x1ad466){_0x19b6e1=_0x1ad466;_0x241275=0xc8;}else{_0x241275=0xce;}_0x2c8406[_0x610d('0x20')](_0x241275);return _0x2c8406[_0x610d('0x21')](_0x610d('0x22'),_0x2a4f41+'-'+_0x19b6e1+'/'+_0x1ad466)[_0x610d('0x23')](_0x1cafc9);}return null;};}function patchUpdates(_0x5d0f95){return function(_0x40a275){try{jsonpatch[_0x610d('0x24')](_0x40a275,_0x5d0f95,!![]);}catch(_0x534743){return BPromise[_0x610d('0x25')](_0x534743);}return _0x40a275[_0x610d('0x26')]();};}function saveUpdates(_0x7acc43,_0x47ddd4){return function(_0x2ed804){if(_0x2ed804){return _0x2ed804[_0x610d('0x27')](_0x7acc43)['then'](function(_0x4e7caf){return _0x4e7caf;});}return null;};}function removeEntity(_0x12b17b,_0x335a9f){return function(_0x108dac){if(_0x108dac){return _0x108dac[_0x610d('0x28')]()[_0x610d('0x29')](function(){var _0x3ff3d4=_0x108dac[_0x610d('0x2a')]({'plain':!![]});var _0x7e7c5a=_0x610d('0x2b');return db[_0x610d('0x2c')][_0x610d('0x28')]({'where':{'type':_0x7e7c5a,'resourceId':_0x3ff3d4['id']}})[_0x610d('0x29')](function(){return _0x108dac;});})['then'](function(){_0x12b17b[_0x610d('0x20')](0xcc)[_0x610d('0x1c')]();});}};}function handleEntityNotFound(_0x889281,_0x3cecbb){return function(_0x249c91){if(!_0x249c91){_0x889281[_0x610d('0x1b')](0x194);}return _0x249c91;};}function handleError(_0x2bf05f,_0x42c9f6){_0x42c9f6=_0x42c9f6||0x1f4;return function(_0x415c35){logger[_0x610d('0x2d')](_0x415c35[_0x610d('0x2e')]);if(_0x415c35['name']){delete _0x415c35[_0x610d('0x2f')];}_0x2bf05f[_0x610d('0x20')](_0x42c9f6)[_0x610d('0x30')](_0x415c35);};}exports['index']=function(_0x26a761,_0xa78d6e){var _0x226f0b={},_0x3884dd={},_0x159c9c={'count':0x0,'rows':[]};var _0x314965=_[_0x610d('0x31')](db['Campaign'][_0x610d('0x32')],function(_0x50d75c){return{'name':_0x50d75c['fieldName'],'type':_0x50d75c[_0x610d('0x33')][_0x610d('0x34')]};});_0x3884dd[_0x610d('0x35')]=_['map'](_0x314965,'name');_0x3884dd[_0x610d('0x36')]=_[_0x610d('0x37')](_0x26a761[_0x610d('0x36')]);_0x3884dd['filters']=_[_0x610d('0x38')](_0x3884dd['model'],_0x3884dd[_0x610d('0x36')]);_0x226f0b[_0x610d('0x39')]=_[_0x610d('0x38')](_0x3884dd[_0x610d('0x35')],qs[_0x610d('0x3a')](_0x26a761['query']['fields']));_0x226f0b[_0x610d('0x39')]=_0x226f0b[_0x610d('0x39')][_0x610d('0x3b')]?_0x226f0b[_0x610d('0x39')]:_0x3884dd[_0x610d('0x35')];if(!_0x26a761[_0x610d('0x36')][_0x610d('0x3c')]('nolimit')){_0x226f0b['limit']=qs[_0x610d('0x1e')](_0x26a761[_0x610d('0x36')]['limit']);_0x226f0b['offset']=qs['offset'](_0x26a761['query'][_0x610d('0x1d')]);}_0x226f0b[_0x610d('0x3d')]=qs[_0x610d('0x3e')](_0x26a761[_0x610d('0x36')][_0x610d('0x3e')]);_0x226f0b['where']=qs['filters'](_[_0x610d('0x3f')](_0x26a761['query'],_0x3884dd[_0x610d('0x40')]),_0x314965);if(_0x26a761[_0x610d('0x36')]['filter']){_0x226f0b['where']=_[_0x610d('0x41')](_0x226f0b[_0x610d('0x42')],{'$or':_[_0x610d('0x31')](_0x314965,function(_0x16d35b){if(_0x16d35b[_0x610d('0x33')]!==_0x610d('0x43')){var _0x2dbccb={};_0x2dbccb[_0x16d35b[_0x610d('0x2f')]]={'$like':'%'+_0x26a761[_0x610d('0x36')][_0x610d('0x44')]+'%'};return _0x2dbccb;}})});}_0x226f0b=_[_0x610d('0x41')]({},_0x226f0b,_0x26a761[_0x610d('0x45')]);var _0x29fcc4={'where':_0x226f0b[_0x610d('0x42')]};return db[_0x610d('0x46')]['count'](_0x29fcc4)['then'](function(_0x498296){_0x159c9c['count']=_0x498296;if(_0x26a761['query'][_0x610d('0x47')]){_0x226f0b[_0x610d('0x48')]=[{'all':!![]}];}return db[_0x610d('0x46')]['findAll'](_0x226f0b);})[_0x610d('0x29')](function(_0x12f83b){_0x159c9c[_0x610d('0x49')]=_0x12f83b;return _0x159c9c;})[_0x610d('0x29')](respondWithFilteredResult(_0xa78d6e,_0x226f0b))[_0x610d('0x4a')](handleError(_0xa78d6e,null));};exports['show']=function(_0x17d7a5,_0x5160e2){var _0x7dc21b={'raw':![],'where':{'id':_0x17d7a5[_0x610d('0x4b')]['id']}},_0x59c603={};_0x59c603[_0x610d('0x35')]=_[_0x610d('0x37')](db['Campaign'][_0x610d('0x32')]);_0x59c603['query']=_[_0x610d('0x37')](_0x17d7a5[_0x610d('0x36')]);_0x59c603[_0x610d('0x40')]=_[_0x610d('0x38')](_0x59c603['model'],_0x59c603['query']);_0x7dc21b[_0x610d('0x39')]=_[_0x610d('0x38')](_0x59c603['model'],qs[_0x610d('0x3a')](_0x17d7a5['query'][_0x610d('0x3a')]));_0x7dc21b[_0x610d('0x39')]=_0x7dc21b[_0x610d('0x39')][_0x610d('0x3b')]?_0x7dc21b[_0x610d('0x39')]:_0x59c603[_0x610d('0x35')];if(_0x17d7a5['query'][_0x610d('0x47')]){_0x7dc21b['include']=[{'all':!![]}];}_0x7dc21b=_[_0x610d('0x41')]({},_0x7dc21b,_0x17d7a5['options']);return db[_0x610d('0x46')][_0x610d('0x4c')](_0x7dc21b)[_0x610d('0x29')](handleEntityNotFound(_0x5160e2,null))[_0x610d('0x29')](respondWithResult(_0x5160e2,null))[_0x610d('0x4a')](handleError(_0x5160e2,null));};exports[_0x610d('0x4d')]=function(_0x585345,_0x3e6c4f){return db[_0x610d('0x46')][_0x610d('0x4d')](_0x585345[_0x610d('0x4e')],{})[_0x610d('0x29')](function(_0x2cd7c3){var _0x5e8dd9=_0x585345[_0x610d('0x4f')][_0x610d('0x2a')]({'plain':!![]});if(!_0x5e8dd9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5e8dd9[_0x610d('0x50')]===_0x610d('0x4f')){var _0x585858=_0x2cd7c3[_0x610d('0x2a')]({'plain':!![]});var _0x47895f=_0x610d('0x2b');return db[_0x610d('0x51')][_0x610d('0x4c')]({'where':{'name':_0x47895f,'userProfileId':_0x5e8dd9[_0x610d('0x52')]},'raw':!![]})[_0x610d('0x29')](function(_0x3a2e5c){if(_0x3a2e5c&&_0x3a2e5c[_0x610d('0x53')]===0x0){return db[_0x610d('0x2c')]['create']({'name':_0x585858[_0x610d('0x2f')],'resourceId':_0x585858['id'],'type':_0x3a2e5c[_0x610d('0x2f')],'sectionId':_0x3a2e5c['id']},{})[_0x610d('0x29')](function(){return _0x2cd7c3;});}else{return _0x2cd7c3;}})[_0x610d('0x4a')](function(_0x2b523f){logger[_0x610d('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2b523f);throw _0x2b523f;});}return _0x2cd7c3;})[_0x610d('0x29')](respondWithResult(_0x3e6c4f,0xc9))[_0x610d('0x4a')](handleError(_0x3e6c4f,null));};exports[_0x610d('0x54')]=function(_0xf4e816,_0x467fbd){var _0x2d65b4={'where':{'id':_0xf4e816[_0x610d('0x4b')]['id']}},_0x55a8e8={};_0x55a8e8[_0x610d('0x35')]=_['keys'](db['Campaign'][_0x610d('0x32')]);_0x2d65b4[_0x610d('0x39')]=_['intersection'](_0x55a8e8[_0x610d('0x35')],qs[_0x610d('0x3a')](_0xf4e816[_0x610d('0x36')][_0x610d('0x3a')]));_0x2d65b4[_0x610d('0x39')]=_0x2d65b4['attributes']['length']?_0x2d65b4[_0x610d('0x39')]:_0x55a8e8[_0x610d('0x35')];if(_0xf4e816[_0x610d('0x36')][_0x610d('0x47')]){_0x2d65b4[_0x610d('0x48')]=[{'all':!![]}];}_0x2d65b4=_[_0x610d('0x41')]({},_0x2d65b4,_0xf4e816['options']);return db[_0x610d('0x46')][_0x610d('0x4c')](_0x2d65b4)[_0x610d('0x29')](handleEntityNotFound(_0x467fbd,null))['then'](function(_0x2beff7){if(_0x2beff7){var _0x5cfe00=_0x2beff7['get']({'plain':!![]});_0x5cfe00=qs['omit'](_0x5cfe00,['id','createdAt',_0x610d('0x55')]);_0xf4e816[_0x610d('0x4e')]=_[_0x610d('0x56')](_0xf4e816['body'],['id',_0x610d('0x57'),'updatedAt']);return db[_0x610d('0x46')][_0x610d('0x4d')](_['merge'](_0x5cfe00,_0xf4e816[_0x610d('0x4e')]),{'include':_0xf4e816[_0x610d('0x36')][_0x610d('0x47')]?[{'all':!![]}]:undefined})[_0x610d('0x29')](function(_0x549671){var _0x3115cb=_0xf4e816['user'][_0x610d('0x2a')]({'plain':!![]});if(!_0x3115cb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3115cb[_0x610d('0x50')]===_0x610d('0x4f')){var _0x567606=_0x549671[_0x610d('0x2a')]({'plain':!![]});var _0x56a44c=_0x610d('0x2b');return db[_0x610d('0x51')]['find']({'where':{'name':_0x56a44c,'userProfileId':_0x3115cb['userProfileId']},'raw':!![]})[_0x610d('0x29')](function(_0x3d7621){if(_0x3d7621&&_0x3d7621[_0x610d('0x53')]===0x0){return db[_0x610d('0x2c')][_0x610d('0x4d')]({'name':_0x567606[_0x610d('0x2f')],'resourceId':_0x567606['id'],'type':_0x3d7621[_0x610d('0x2f')],'sectionId':_0x3d7621['id']},{})[_0x610d('0x29')](function(){return _0x549671;});}else{return _0x549671;}})[_0x610d('0x4a')](function(_0x23a464){logger[_0x610d('0x2d')](_0x610d('0x58'),_0x23a464);throw _0x23a464;});}return _0x549671;});}})[_0x610d('0x29')](respondWithResult(_0x467fbd,0xc9))[_0x610d('0x4a')](handleError(_0x467fbd,null));};exports[_0x610d('0x27')]=function(_0x428d53,_0x5684e2){if(_0x428d53[_0x610d('0x4e')]['id']){delete _0x428d53[_0x610d('0x4e')]['id'];}return db['Campaign']['find']({'where':{'id':_0x428d53[_0x610d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5684e2,null))['then'](saveUpdates(_0x428d53['body'],null))[_0x610d('0x29')](respondWithResult(_0x5684e2,null))[_0x610d('0x4a')](handleError(_0x5684e2,null));};exports[_0x610d('0x28')]=function(_0x54ac18,_0x1a60d1){return db['Campaign']['find']({'where':{'id':_0x54ac18[_0x610d('0x4b')]['id']}})[_0x610d('0x29')](handleEntityNotFound(_0x1a60d1,null))[_0x610d('0x29')](removeEntity(_0x1a60d1,null))[_0x610d('0x4a')](handleError(_0x1a60d1,null));};exports[_0x610d('0x59')]=function(_0x3f6f18,_0xe3ffe,_0xa86545){var _0x36ce98={'raw':!![],'where':{}};var _0x1ad245={};var _0x6b8fca={'count':0x0,'rows':[]};return db['Campaign'][_0x610d('0x5a')]({'where':{'id':_0x3f6f18[_0x610d('0x4b')]['id']}})[_0x610d('0x29')](handleEntityNotFound(_0xe3ffe,null))[_0x610d('0x29')](function(_0x466f37){if(_0x466f37){_0x1ad245[_0x610d('0x35')]=_[_0x610d('0x37')](db['CmHopper']['rawAttributes']);_0x1ad245[_0x610d('0x36')]=_[_0x610d('0x37')](_0x3f6f18[_0x610d('0x36')]);_0x1ad245[_0x610d('0x40')]=_['intersection'](_0x1ad245[_0x610d('0x35')],_0x1ad245[_0x610d('0x36')]);_0x36ce98[_0x610d('0x39')]=_[_0x610d('0x38')](_0x1ad245[_0x610d('0x35')],qs[_0x610d('0x3a')](_0x3f6f18[_0x610d('0x36')]['fields']));_0x36ce98['attributes']=_0x36ce98[_0x610d('0x39')]['length']?_0x36ce98[_0x610d('0x39')]:_0x1ad245[_0x610d('0x35')];if(!_0x3f6f18[_0x610d('0x36')][_0x610d('0x3c')]('nolimit')){_0x36ce98['limit']=qs['limit'](_0x3f6f18[_0x610d('0x36')][_0x610d('0x1e')]);_0x36ce98['offset']=qs[_0x610d('0x1d')](_0x3f6f18[_0x610d('0x36')][_0x610d('0x1d')]);}_0x36ce98['order']=qs[_0x610d('0x3e')](_0x3f6f18[_0x610d('0x36')][_0x610d('0x3e')]);_0x36ce98['where']=qs[_0x610d('0x40')](_[_0x610d('0x3f')](_0x3f6f18[_0x610d('0x36')],_0x1ad245['filters']));_0x36ce98[_0x610d('0x42')]['CampaignId']=_0x466f37['id'];if(_0x3f6f18[_0x610d('0x36')]['filter']){_0x36ce98['where']=_[_0x610d('0x41')](_0x36ce98[_0x610d('0x42')],{'$or':_['map'](_0x36ce98[_0x610d('0x39')],function(_0x16abab){var _0x188dbd={};_0x188dbd[_0x16abab]={'$like':'%'+_0x3f6f18[_0x610d('0x36')][_0x610d('0x44')]+'%'};return _0x188dbd;})});}_0x36ce98=_[_0x610d('0x41')]({},_0x36ce98,_0x3f6f18[_0x610d('0x45')]);return db[_0x610d('0x5b')][_0x610d('0x5c')]({'where':_0x36ce98[_0x610d('0x42')]})[_0x610d('0x29')](function(_0x1e16e0){_0x6b8fca[_0x610d('0x5c')]=_0x1e16e0;if(_0x3f6f18[_0x610d('0x36')][_0x610d('0x47')]){_0x36ce98[_0x610d('0x48')]=[{'all':!![]}];}return db['CmHopper'][_0x610d('0x5d')](_0x36ce98);})[_0x610d('0x29')](function(_0xf7409a){_0x6b8fca['rows']=_0xf7409a;return _0x6b8fca;});}})['then'](respondWithFilteredResult(_0xe3ffe,_0x36ce98))['catch'](handleError(_0xe3ffe,null));};exports[_0x610d('0x5e')]=function(_0x357778,_0x15b722,_0xc7bb5e){var _0x3ee379={'raw':!![],'where':{}};var _0x3789bb={};var _0x12f276={'count':0x0,'rows':[]};return db['Campaign'][_0x610d('0x5a')]({'where':{'id':_0x357778[_0x610d('0x4b')]['id']}})[_0x610d('0x29')](handleEntityNotFound(_0x15b722,null))['then'](function(_0x4abc25){if(_0x4abc25){_0x3789bb[_0x610d('0x35')]=_[_0x610d('0x37')](db[_0x610d('0x5f')][_0x610d('0x32')]);_0x3789bb[_0x610d('0x36')]=_[_0x610d('0x37')](_0x357778[_0x610d('0x36')]);_0x3789bb[_0x610d('0x40')]=_[_0x610d('0x38')](_0x3789bb[_0x610d('0x35')],_0x3789bb[_0x610d('0x36')]);_0x3ee379[_0x610d('0x39')]=_[_0x610d('0x38')](_0x3789bb[_0x610d('0x35')],qs['fields'](_0x357778[_0x610d('0x36')][_0x610d('0x3a')]));_0x3ee379['attributes']=_0x3ee379[_0x610d('0x39')][_0x610d('0x3b')]?_0x3ee379['attributes']:_0x3789bb[_0x610d('0x35')];if(!_0x357778[_0x610d('0x36')][_0x610d('0x3c')]('nolimit')){_0x3ee379[_0x610d('0x1e')]=qs[_0x610d('0x1e')](_0x357778['query'][_0x610d('0x1e')]);_0x3ee379[_0x610d('0x1d')]=qs[_0x610d('0x1d')](_0x357778[_0x610d('0x36')][_0x610d('0x1d')]);}_0x3ee379[_0x610d('0x3d')]=qs[_0x610d('0x3e')](_0x357778[_0x610d('0x36')][_0x610d('0x3e')]);_0x3ee379[_0x610d('0x42')]=qs[_0x610d('0x40')](_['pick'](_0x357778[_0x610d('0x36')],_0x3789bb['filters']));_0x3ee379[_0x610d('0x42')][_0x610d('0x60')]=_0x4abc25['id'];if(_0x357778['query'][_0x610d('0x44')]){_0x3ee379[_0x610d('0x42')]=_['merge'](_0x3ee379['where'],{'$or':_[_0x610d('0x31')](_0x3ee379[_0x610d('0x39')],function(_0x59ec18){var _0x163543={};_0x163543[_0x59ec18]={'$like':'%'+_0x357778['query']['filter']+'%'};return _0x163543;})});}_0x3ee379=_[_0x610d('0x41')]({},_0x3ee379,_0x357778[_0x610d('0x45')]);return db[_0x610d('0x5f')][_0x610d('0x5c')]({'where':_0x3ee379['where']})['then'](function(_0x2312e9){_0x12f276['count']=_0x2312e9;if(_0x357778['query'][_0x610d('0x47')]){_0x3ee379[_0x610d('0x48')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x610d('0x5d')](_0x3ee379);})['then'](function(_0x465c57){_0x12f276['rows']=_0x465c57;return _0x12f276;});}})[_0x610d('0x29')](respondWithFilteredResult(_0x15b722,_0x3ee379))[_0x610d('0x4a')](handleError(_0x15b722,null));};exports[_0x610d('0x61')]=function(_0x29c52f,_0x51b7bd,_0x87ec6c){var _0x1d3891={'raw':!![],'where':{}};var _0x1f9511={};var _0x53bc7a={'count':0x0,'rows':[]};return db[_0x610d('0x46')][_0x610d('0x5a')]({'where':{'id':_0x29c52f[_0x610d('0x4b')]['id']}})[_0x610d('0x29')](handleEntityNotFound(_0x51b7bd,null))[_0x610d('0x29')](function(_0x1ea9a7){if(_0x1ea9a7){_0x1f9511[_0x610d('0x35')]=_[_0x610d('0x37')](db[_0x610d('0x62')][_0x610d('0x32')]);_0x1f9511['query']=_[_0x610d('0x37')](_0x29c52f['query']);_0x1f9511[_0x610d('0x40')]=_['intersection'](_0x1f9511['model'],_0x1f9511[_0x610d('0x36')]);_0x1d3891['attributes']=_[_0x610d('0x38')](_0x1f9511['model'],qs[_0x610d('0x3a')](_0x29c52f[_0x610d('0x36')]['fields']));_0x1d3891[_0x610d('0x39')]=_0x1d3891[_0x610d('0x39')][_0x610d('0x3b')]?_0x1d3891[_0x610d('0x39')]:_0x1f9511['model'];if(!_0x29c52f[_0x610d('0x36')][_0x610d('0x3c')](_0x610d('0x63'))){_0x1d3891['limit']=qs[_0x610d('0x1e')](_0x29c52f[_0x610d('0x36')][_0x610d('0x1e')]);_0x1d3891[_0x610d('0x1d')]=qs[_0x610d('0x1d')](_0x29c52f[_0x610d('0x36')][_0x610d('0x1d')]);}_0x1d3891[_0x610d('0x3d')]=qs[_0x610d('0x3e')](_0x29c52f['query']['sort']);_0x1d3891[_0x610d('0x42')]=qs[_0x610d('0x40')](_[_0x610d('0x3f')](_0x29c52f[_0x610d('0x36')],_0x1f9511['filters']));_0x1d3891[_0x610d('0x42')][_0x610d('0x60')]=_0x1ea9a7['id'];if(_0x29c52f[_0x610d('0x36')][_0x610d('0x44')]){_0x1d3891[_0x610d('0x42')]=_[_0x610d('0x41')](_0x1d3891[_0x610d('0x42')],{'$or':_[_0x610d('0x31')](_0x1d3891['attributes'],function(_0x2f37d0){var _0x1b388c={};_0x1b388c[_0x2f37d0]={'$like':'%'+_0x29c52f[_0x610d('0x36')][_0x610d('0x44')]+'%'};return _0x1b388c;})});}_0x1d3891=_['merge']({},_0x1d3891,_0x29c52f['options']);return db[_0x610d('0x62')][_0x610d('0x5c')]({'where':_0x1d3891['where']})[_0x610d('0x29')](function(_0x127234){_0x53bc7a['count']=_0x127234;if(_0x29c52f[_0x610d('0x36')][_0x610d('0x47')]){_0x1d3891[_0x610d('0x48')]=[{'all':!![]}];}return db[_0x610d('0x62')][_0x610d('0x5d')](_0x1d3891);})[_0x610d('0x29')](function(_0x317a48){_0x53bc7a[_0x610d('0x49')]=_0x317a48;return _0x53bc7a;});}})[_0x610d('0x29')](respondWithFilteredResult(_0x51b7bd,_0x1d3891))['catch'](handleError(_0x51b7bd,null));};exports[_0x610d('0x64')]=function(_0x19c786,_0x562d2e,_0x146b6d){var _0x2e3a85={'raw':!![],'where':{}};var _0x3016f5={};var _0x480775={'count':0x0,'rows':[]};return db[_0x610d('0x46')][_0x610d('0x5a')]({'where':{'id':_0x19c786[_0x610d('0x4b')]['id']}})[_0x610d('0x29')](handleEntityNotFound(_0x562d2e,null))[_0x610d('0x29')](function(_0x3dbea1){if(_0x3dbea1){_0x3016f5[_0x610d('0x35')]=_[_0x610d('0x37')](db['CmHopperBlack'][_0x610d('0x32')]);_0x3016f5[_0x610d('0x36')]=_[_0x610d('0x37')](_0x19c786[_0x610d('0x36')]);_0x3016f5[_0x610d('0x40')]=_[_0x610d('0x38')](_0x3016f5[_0x610d('0x35')],_0x3016f5['query']);_0x2e3a85[_0x610d('0x39')]=_[_0x610d('0x38')](_0x3016f5[_0x610d('0x35')],qs[_0x610d('0x3a')](_0x19c786[_0x610d('0x36')][_0x610d('0x3a')]));_0x2e3a85[_0x610d('0x39')]=_0x2e3a85[_0x610d('0x39')][_0x610d('0x3b')]?_0x2e3a85[_0x610d('0x39')]:_0x3016f5[_0x610d('0x35')];if(!_0x19c786[_0x610d('0x36')][_0x610d('0x3c')](_0x610d('0x63'))){_0x2e3a85[_0x610d('0x1e')]=qs['limit'](_0x19c786[_0x610d('0x36')][_0x610d('0x1e')]);_0x2e3a85[_0x610d('0x1d')]=qs[_0x610d('0x1d')](_0x19c786[_0x610d('0x36')][_0x610d('0x1d')]);}_0x2e3a85[_0x610d('0x3d')]=qs[_0x610d('0x3e')](_0x19c786[_0x610d('0x36')][_0x610d('0x3e')]);_0x2e3a85[_0x610d('0x42')]=qs[_0x610d('0x40')](_[_0x610d('0x3f')](_0x19c786[_0x610d('0x36')],_0x3016f5[_0x610d('0x40')]));_0x2e3a85['where'][_0x610d('0x60')]=_0x3dbea1['id'];if(_0x19c786['query']['filter']){_0x2e3a85[_0x610d('0x42')]=_[_0x610d('0x41')](_0x2e3a85[_0x610d('0x42')],{'$or':_[_0x610d('0x31')](_0x2e3a85[_0x610d('0x39')],function(_0x5f0f5d){var _0x5384be={};_0x5384be[_0x5f0f5d]={'$like':'%'+_0x19c786['query'][_0x610d('0x44')]+'%'};return _0x5384be;})});}_0x2e3a85=_[_0x610d('0x41')]({},_0x2e3a85,_0x19c786[_0x610d('0x45')]);return db['CmHopperBlack'][_0x610d('0x5c')]({'where':_0x2e3a85[_0x610d('0x42')]})[_0x610d('0x29')](function(_0x13293f){_0x480775['count']=_0x13293f;if(_0x19c786[_0x610d('0x36')][_0x610d('0x47')]){_0x2e3a85['include']=[{'all':!![]}];}return db[_0x610d('0x65')]['findAll'](_0x2e3a85);})['then'](function(_0x454e18){_0x480775[_0x610d('0x49')]=_0x454e18;return _0x480775;});}})[_0x610d('0x29')](respondWithFilteredResult(_0x562d2e,_0x2e3a85))['catch'](handleError(_0x562d2e,null));};exports['getLists']=function(_0x24838b,_0x232cdb,_0x29de6f){var _0x12fec2={};var _0x1f355c={};var _0x347263;var _0x2cf784;return db[_0x610d('0x46')]['findOne']({'where':{'id':_0x24838b[_0x610d('0x4b')]['id']}})[_0x610d('0x29')](handleEntityNotFound(_0x232cdb,null))[_0x610d('0x29')](function(_0x113b3c){if(_0x113b3c){_0x347263=_0x113b3c;_0x1f355c[_0x610d('0x35')]=_[_0x610d('0x37')](db['CmList']['rawAttributes']);_0x1f355c[_0x610d('0x36')]=_[_0x610d('0x37')](_0x24838b[_0x610d('0x36')]);_0x1f355c[_0x610d('0x40')]=_[_0x610d('0x38')](_0x1f355c[_0x610d('0x35')],_0x1f355c[_0x610d('0x36')]);_0x12fec2[_0x610d('0x39')]=_[_0x610d('0x38')](_0x1f355c[_0x610d('0x35')],qs['fields'](_0x24838b[_0x610d('0x36')][_0x610d('0x3a')]));_0x12fec2[_0x610d('0x39')]=_0x12fec2[_0x610d('0x39')]['length']?_0x12fec2[_0x610d('0x39')]:_0x1f355c[_0x610d('0x35')];_0x12fec2[_0x610d('0x3d')]=qs[_0x610d('0x3e')](_0x24838b[_0x610d('0x36')][_0x610d('0x3e')]);_0x12fec2[_0x610d('0x42')]=qs['filters'](_['pick'](_0x24838b['query'],_0x1f355c[_0x610d('0x40')]));if(_0x24838b[_0x610d('0x36')][_0x610d('0x44')]){_0x12fec2[_0x610d('0x42')]=_[_0x610d('0x41')](_0x12fec2[_0x610d('0x42')],{'$or':_['map'](_0x12fec2['attributes'],function(_0x391444){var _0xcb169a={};_0xcb169a[_0x391444]={'$like':'%'+_0x24838b['query'][_0x610d('0x44')]+'%'};return _0xcb169a;})});}_0x12fec2=_['merge']({},_0x12fec2,_0x24838b[_0x610d('0x45')]);return _0x347263[_0x610d('0x66')](_0x12fec2);}})[_0x610d('0x29')](function(_0x272053){if(_0x272053){_0x2cf784=_0x272053[_0x610d('0x3b')];if(!_0x24838b[_0x610d('0x36')]['hasOwnProperty']('nolimit')){_0x12fec2[_0x610d('0x1e')]=qs[_0x610d('0x1e')](_0x24838b['query'][_0x610d('0x1e')]);_0x12fec2[_0x610d('0x1d')]=qs[_0x610d('0x1d')](_0x24838b[_0x610d('0x36')][_0x610d('0x1d')]);}return _0x347263[_0x610d('0x66')](_0x12fec2);}})[_0x610d('0x29')](function(_0x2ffc4a){if(_0x2ffc4a){return _0x2ffc4a?{'count':_0x2cf784,'rows':_0x2ffc4a}:null;}})[_0x610d('0x29')](respondWithResult(_0x232cdb,null))[_0x610d('0x4a')](handleError(_0x232cdb,null));};exports[_0x610d('0x67')]=function(_0x42364c,_0x3ddb2f,_0x42ec64){var _0x59b5c9,_0x51eb27;var _0x9b78db=[];var _0x1dc97a=moment()[_0x610d('0x68')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x610d('0x46')][_0x610d('0x4c')]({'where':{'id':_0x42364c[_0x610d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3ddb2f,null))['then'](function(_0x18e2ba){if(_0x18e2ba){_0x51eb27=_0x18e2ba;return _0x18e2ba[_0x610d('0x67')](_0x42364c[_0x610d('0x4e')]['ids'],_[_0x610d('0x56')](_0x42364c[_0x610d('0x4e')],[_0x610d('0x69'),'id'])||{});}return null;})[_0x610d('0x6a')](function(_0x24fbfd){var _0x170e02;var _0xbc6672;_0x59b5c9=_0x24fbfd||[];var _0x137f77=[];if(_0x24fbfd){for(var _0x5789d8=0x0;_0x5789d8<_0x24fbfd[_0x610d('0x3b')];_0x5789d8+=0x1){var _0x1d3362=_0x24fbfd[_0x5789d8][_0x610d('0x2a')]({'plain':!![]});_0x51eb27['dialCheckDuplicateType']=_0x42364c['body']['dialCheckDuplicateType']?_0x42364c[_0x610d('0x4e')][_0x610d('0x6b')]:_0x51eb27[_0x610d('0x6b')];switch(_0x51eb27[_0x610d('0x6b')]){case'always':_0x170e02=squel[_0x610d('0x6c')]()[_0x610d('0x6d')](_0x610d('0x6e'))['fromQuery']([_0x610d('0x6f'),_0x610d('0x70'),_0x610d('0x71'),_0x610d('0x72'),_0x610d('0x60'),_0x610d('0x57'),_0x610d('0x55')],squel[_0x610d('0x73')]()[_0x610d('0x74')]('phone',_0x610d('0x6f'))[_0x610d('0x74')](_0x610d('0x75'),'scheduledAt')[_0x610d('0x74')]('id',_0x610d('0x71'))[_0x610d('0x74')](_0x1d3362['CmListId'][_0x610d('0x76')](),_0x610d('0x72'))[_0x610d('0x74')](_0x42364c[_0x610d('0x4b')]['id']['toString'](),_0x610d('0x60'))[_0x610d('0x74')]('\x27'+_0x1dc97a+'\x27',_0x610d('0x57'))[_0x610d('0x74')]('\x27'+_0x1dc97a+'\x27',_0x610d('0x55'))[_0x610d('0x77')](_0x610d('0x78'))['where'](_0x610d('0x79'))[_0x610d('0x42')]('ListId\x20=\x20?',_0x1d3362[_0x610d('0x7a')][_0x610d('0x76')]())[_0x610d('0x42')](_0x610d('0x7b'))[_0x610d('0x42')](_0x610d('0x7c'),squel[_0x610d('0x73')]()[_0x610d('0x74')]('COALESCE(calleridnum,\x27\x27)')['from'](_0x610d('0x7d'))[_0x610d('0x42')](_0x610d('0x7e'),_0x42364c['params']['id'][_0x610d('0x76')]()))[_0x610d('0x42')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x610d('0x74')]('COALESCE(phone,\x27\x27)')[_0x610d('0x77')](_0x610d('0x6e'))[_0x610d('0x42')](_0x610d('0x7e'),_0x42364c[_0x610d('0x4b')]['id'][_0x610d('0x76')]())))[_0x610d('0x76')]();break;case'onlyIfOpen':_0x170e02=squel[_0x610d('0x6c')]()['into'](_0x610d('0x6e'))[_0x610d('0x7f')](['phone',_0x610d('0x70'),_0x610d('0x71'),_0x610d('0x72'),_0x610d('0x60'),_0x610d('0x57'),'updatedAt'],squel['select']()['field'](_0x610d('0x6f'),_0x610d('0x6f'))[_0x610d('0x74')](_0x610d('0x75'),_0x610d('0x70'))['field']('id','ContactId')[_0x610d('0x74')](_0x1d3362[_0x610d('0x7a')][_0x610d('0x76')](),'ListId')[_0x610d('0x74')](_0x42364c['params']['id']['toString'](),_0x610d('0x60'))[_0x610d('0x74')]('\x27'+_0x1dc97a+'\x27',_0x610d('0x57'))[_0x610d('0x74')]('\x27'+_0x1dc97a+'\x27',_0x610d('0x55'))[_0x610d('0x77')](_0x610d('0x78'))[_0x610d('0x42')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x1d3362['CmListId'][_0x610d('0x76')]())['where'](_0x610d('0x7b'))[_0x610d('0x42')](_0x610d('0x7c'),squel[_0x610d('0x73')]()[_0x610d('0x74')](_0x610d('0x80'))[_0x610d('0x77')]('cm_hopper')['where'](_0x610d('0x7e'),_0x42364c[_0x610d('0x4b')]['id'][_0x610d('0x76')]())))[_0x610d('0x76')]();break;default:_0x170e02=squel['insert']()[_0x610d('0x6d')](_0x610d('0x6e'))[_0x610d('0x7f')]([_0x610d('0x6f'),'scheduledAt',_0x610d('0x71'),_0x610d('0x72'),'CampaignId',_0x610d('0x57'),_0x610d('0x55')],squel['select']()['field'](_0x610d('0x6f'),_0x610d('0x6f'))['field'](_0x610d('0x75'),_0x610d('0x70'))[_0x610d('0x74')]('id',_0x610d('0x71'))[_0x610d('0x74')](_0x1d3362[_0x610d('0x7a')][_0x610d('0x76')](),_0x610d('0x72'))[_0x610d('0x74')](_0x42364c['params']['id'][_0x610d('0x76')](),_0x610d('0x60'))['field']('\x27'+_0x1dc97a+'\x27',_0x610d('0x57'))['field']('\x27'+_0x1dc97a+'\x27','updatedAt')[_0x610d('0x77')]('cm_contacts')[_0x610d('0x42')]('deletedAt\x20IS\x20NULL')[_0x610d('0x42')](_0x610d('0x81'),_0x1d3362[_0x610d('0x7a')]['toString']())[_0x610d('0x42')](_0x610d('0x7b')))[_0x610d('0x76')]();}_0xbc6672=squel[_0x610d('0x6c')]()['into']('cm_hopper_additional_phones')['fromQuery']([_0x610d('0x82'),_0x610d('0x70'),'phone',_0x610d('0x83'),'createdAt',_0x610d('0x55')],squel[_0x610d('0x73')]()[_0x610d('0x74')]('h.id','id')['field'](_0x610d('0x75'),_0x610d('0x70'))['field']('ci.item',_0x610d('0x6f'))[_0x610d('0x74')](_0x610d('0x84'),_0x610d('0x83'))[_0x610d('0x74')]('\x27'+_0x1dc97a+'\x27',_0x610d('0x57'))['field']('\x27'+_0x1dc97a+'\x27',_0x610d('0x55'))['from'](_0x610d('0x85'),'ci')['join'](_0x610d('0x6e'),'h',_0x610d('0x86'))[_0x610d('0x42')](_0x610d('0x87'),_0x1d3362[_0x610d('0x7a')][_0x610d('0x76')]())[_0x610d('0x42')](_0x610d('0x88'),_0x42364c[_0x610d('0x4b')]['id'][_0x610d('0x76')]())[_0x610d('0x42')]('h.createdAt\x20=\x20?',_0x1dc97a))[_0x610d('0x76')]();_0x137f77['push'](db[_0x610d('0x89')][_0x610d('0x36')](_0x170e02));_0x9b78db[_0x610d('0x8a')](db[_0x610d('0x89')][_0x610d('0x36')](_0xbc6672));}return BPromise['all'](_0x137f77);}})['then'](function(){return BPromise[_0x610d('0x8b')](_0x9b78db);})[_0x610d('0x29')](function(){return _0x59b5c9;})[_0x610d('0x29')](respondWithResult(_0x3ddb2f,null))[_0x610d('0x4a')](handleError(_0x3ddb2f,null));};exports[_0x610d('0x8c')]=function(_0x137d30,_0xd55192,_0x137eb6){return db[_0x610d('0x46')][_0x610d('0x4c')]({'where':{'id':_0x137d30[_0x610d('0x4b')]['id']}})[_0x610d('0x29')](handleEntityNotFound(_0xd55192,null))[_0x610d('0x29')](function(_0x3adf86){if(_0x3adf86){return _0x3adf86[_0x610d('0x8c')](_0x137d30['query'][_0x610d('0x69')]);}})[_0x610d('0x29')](function(_0x16d85b){if(_0x16d85b){return db[_0x610d('0x5b')][_0x610d('0x28')]({'where':{'ListId':_0x137d30[_0x610d('0x36')]['ids'],'CampaignId':_0x137d30[_0x610d('0x4b')]['id']}})[_0x610d('0x29')](function(){return _0x16d85b;});}})[_0x610d('0x29')](respondWithStatusCode(_0xd55192,null))[_0x610d('0x4a')](handleError(_0xd55192,null));};exports['getBlackLists']=function(_0x5a8368,_0x2ddce6,_0x2107e3){var _0x3b8ece={};var _0x19ef4b={};var _0x500437;var _0x12fe22;return db[_0x610d('0x46')]['findOne']({'where':{'id':_0x5a8368[_0x610d('0x4b')]['id']}})[_0x610d('0x29')](handleEntityNotFound(_0x2ddce6,null))[_0x610d('0x29')](function(_0x4322b3){if(_0x4322b3){_0x500437=_0x4322b3;_0x19ef4b[_0x610d('0x35')]=_[_0x610d('0x37')](db[_0x610d('0x8d')][_0x610d('0x32')]);_0x19ef4b['query']=_[_0x610d('0x37')](_0x5a8368[_0x610d('0x36')]);_0x19ef4b[_0x610d('0x40')]=_[_0x610d('0x38')](_0x19ef4b[_0x610d('0x35')],_0x19ef4b['query']);_0x3b8ece[_0x610d('0x39')]=_[_0x610d('0x38')](_0x19ef4b[_0x610d('0x35')],qs['fields'](_0x5a8368['query'][_0x610d('0x3a')]));_0x3b8ece[_0x610d('0x39')]=_0x3b8ece[_0x610d('0x39')][_0x610d('0x3b')]?_0x3b8ece['attributes']:_0x19ef4b['model'];_0x3b8ece[_0x610d('0x3d')]=qs['sort'](_0x5a8368[_0x610d('0x36')]['sort']);_0x3b8ece['where']=qs[_0x610d('0x40')](_[_0x610d('0x3f')](_0x5a8368[_0x610d('0x36')],_0x19ef4b[_0x610d('0x40')]));if(_0x5a8368[_0x610d('0x36')]['filter']){_0x3b8ece[_0x610d('0x42')]=_['merge'](_0x3b8ece[_0x610d('0x42')],{'$or':_['map'](_0x3b8ece[_0x610d('0x39')],function(_0x58378b){var _0x3f172e={};_0x3f172e[_0x58378b]={'$like':'%'+_0x5a8368[_0x610d('0x36')][_0x610d('0x44')]+'%'};return _0x3f172e;})});}_0x3b8ece=_[_0x610d('0x41')]({},_0x3b8ece,_0x5a8368['options']);return _0x500437[_0x610d('0x8e')](_0x3b8ece);}})[_0x610d('0x29')](function(_0x5451be){if(_0x5451be){_0x12fe22=_0x5451be[_0x610d('0x3b')];if(!_0x5a8368[_0x610d('0x36')]['hasOwnProperty'](_0x610d('0x63'))){_0x3b8ece['limit']=qs[_0x610d('0x1e')](_0x5a8368[_0x610d('0x36')]['limit']);_0x3b8ece[_0x610d('0x1d')]=qs[_0x610d('0x1d')](_0x5a8368[_0x610d('0x36')][_0x610d('0x1d')]);}return _0x500437[_0x610d('0x8e')](_0x3b8ece);}})[_0x610d('0x29')](function(_0x3f0c94){if(_0x3f0c94){return _0x3f0c94?{'count':_0x12fe22,'rows':_0x3f0c94}:null;}})['then'](respondWithResult(_0x2ddce6,null))[_0x610d('0x4a')](handleError(_0x2ddce6,null));};exports[_0x610d('0x8f')]=function(_0x3be743,_0x3b3fbe,_0x108ea6){var _0x3da964,_0x3a047b;var _0x3e945d=[];var _0x5a5492=moment()['format'](_0x610d('0x90'));return db[_0x610d('0x46')][_0x610d('0x4c')]({'where':{'id':_0x3be743[_0x610d('0x4b')]['id']}})[_0x610d('0x29')](handleEntityNotFound(_0x3b3fbe,null))['then'](function(_0xc936cf){if(_0xc936cf){_0x3a047b=_0xc936cf;return _0xc936cf[_0x610d('0x8f')](_0x3be743[_0x610d('0x4e')][_0x610d('0x69')],_[_0x610d('0x56')](_0x3be743[_0x610d('0x4e')],['ids','id'])||{});}return null;})[_0x610d('0x6a')](function(_0x1b9b45){var _0x4df8ec;var _0x1126c8;_0x3da964=_0x1b9b45||[];var _0x8a5d2c=[];if(_0x1b9b45){for(var _0xdad211=0x0;_0xdad211<_0x1b9b45[_0x610d('0x3b')];_0xdad211+=0x1){var _0x42627d=_0x1b9b45[_0xdad211][_0x610d('0x2a')]({'plain':!![]});_0x4df8ec=squel['insert']()[_0x610d('0x6d')](_0x610d('0x91'))[_0x610d('0x7f')]([_0x610d('0x6f'),_0x610d('0x71'),'ListId',_0x610d('0x60'),_0x610d('0x57'),_0x610d('0x55')],squel[_0x610d('0x73')]()['field']('phone',_0x610d('0x6f'))[_0x610d('0x74')]('id',_0x610d('0x71'))[_0x610d('0x74')](_0x42627d['CmListId'][_0x610d('0x76')](),_0x610d('0x72'))[_0x610d('0x74')](_0x3be743[_0x610d('0x4b')]['id']['toString'](),_0x610d('0x60'))[_0x610d('0x74')](_0x610d('0x75'),_0x610d('0x57'))[_0x610d('0x74')](_0x610d('0x75'),_0x610d('0x55'))['from'](_0x610d('0x78'))['where'](_0x610d('0x79'))[_0x610d('0x42')](_0x610d('0x81'),_0x42627d[_0x610d('0x7a')]['toString']())[_0x610d('0x42')](_0x610d('0x7b')))[_0x610d('0x76')]();_0x8a5d2c['push'](db[_0x610d('0x89')]['query'](_0x4df8ec));}return BPromise[_0x610d('0x8b')](_0x8a5d2c);}})[_0x610d('0x29')](function(){return _0x3da964;})[_0x610d('0x29')](respondWithResult(_0x3b3fbe,null))[_0x610d('0x4a')](handleError(_0x3b3fbe,null));};exports[_0x610d('0x92')]=function(_0x563656,_0x46983b,_0x4c21fa){return db['Campaign'][_0x610d('0x4c')]({'where':{'id':_0x563656['params']['id']}})[_0x610d('0x29')](handleEntityNotFound(_0x46983b,null))[_0x610d('0x29')](function(_0x41857a){if(_0x41857a){return _0x41857a[_0x610d('0x92')](_0x563656[_0x610d('0x36')][_0x610d('0x69')]);}})[_0x610d('0x29')](function(_0x56bd57){if(_0x56bd57){return db['CmHopperBlack'][_0x610d('0x28')]({'where':{'ListId':_0x563656[_0x610d('0x36')][_0x610d('0x69')],'CampaignId':_0x563656[_0x610d('0x4b')]['id']}})[_0x610d('0x29')](function(){return _0x56bd57;});}})[_0x610d('0x29')](respondWithStatusCode(_0x46983b,null))['catch'](handleError(_0x46983b,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 40cb9df..d6903b0 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x38d9cb,_0x30654d){var _0x15102a=function(_0x13db6b){while(--_0x13db6b){_0x38d9cb['push'](_0x38d9cb['shift']());}};_0x15102a(++_0x30654d);}(_0x7a54,0x106));var _0x47a5=function(_0x3cbaed,_0x118959){_0x3cbaed=_0x3cbaed-0x0;var _0x46ae24=_0x7a54[_0x3cbaed];return _0x46ae24;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 5a10437..074fc71 100644 --- a/server/api/campaign/campaign.rpc.js +++ b/server/api/campaign/campaign.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6931=['lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0xf7db51,_0x362b44){var _0x442ae3=function(_0x2d011e){while(--_0x2d011e){_0xf7db51['push'](_0xf7db51['shift']());}};_0x442ae3(++_0x362b44);}(_0x6931,0xa5));var _0x1693=function(_0x2e5392,_0x61af7e){_0x2e5392=_0x2e5392-0x0;var _0x4dda58=_0x6931[_0x2e5392];return _0x4dda58;};'use strict';var _=require(_0x1693('0x0'));var util=require(_0x1693('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1693('0x2'));var fs=require('fs');var Redis=require(_0x1693('0x3'));var db=require(_0x1693('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1693('0x5'))(_0x1693('0x6'));var config=require(_0x1693('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1693('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3594e0,_0x45aa35,_0x328cfc){return new BPromise(function(_0x2ab0a0,_0x31bff8){return client[_0x1693('0x9')](_0x3594e0,_0x328cfc)[_0x1693('0xa')](function(_0x391134){logger[_0x1693('0xb')](_0x1693('0xc'),_0x45aa35,_0x1693('0xd'));logger[_0x1693('0xe')](_0x1693('0xf'),_0x45aa35,_0x1693('0xd'),JSON[_0x1693('0x10')](_0x391134));if(_0x391134[_0x1693('0x11')]){if(_0x391134['error'][_0x1693('0x12')]===0x1f4){logger['error'](_0x1693('0xc'),_0x45aa35,_0x391134[_0x1693('0x11')]['message']);return _0x31bff8(_0x391134[_0x1693('0x11')][_0x1693('0x13')]);}logger[_0x1693('0x11')]('Campaign,\x20%s,\x20%s',_0x45aa35,_0x391134[_0x1693('0x11')][_0x1693('0x13')]);return _0x2ab0a0(_0x391134[_0x1693('0x11')][_0x1693('0x13')]);}else{logger[_0x1693('0xb')](_0x1693('0xc'),_0x45aa35,_0x1693('0xd'));_0x2ab0a0(_0x391134[_0x1693('0x14')][_0x1693('0x13')]);}})[_0x1693('0x15')](function(_0x59cbff){logger[_0x1693('0x11')]('Campaign,\x20%s,\x20%s',_0x45aa35,_0x59cbff);_0x31bff8(_0x59cbff);});});}exports[_0x1693('0x16')]=function(_0x20906b){var _0x2ffa86=this;return new Promise(function(_0x410c3b,_0x3f5287){return db[_0x1693('0x17')][_0x1693('0x18')]({'raw':_0x20906b[_0x1693('0x19')]?_0x20906b[_0x1693('0x19')][_0x1693('0x1a')]===undefined?!![]:![]:!![],'where':_0x20906b[_0x1693('0x19')]?_0x20906b[_0x1693('0x19')][_0x1693('0x1b')]||null:null,'attributes':_0x20906b[_0x1693('0x19')]?_0x20906b[_0x1693('0x19')][_0x1693('0x1c')]||null:null,'limit':_0x20906b['options']?_0x20906b[_0x1693('0x19')][_0x1693('0x1d')]||null:null,'include':_0x20906b['options']?_0x20906b[_0x1693('0x19')][_0x1693('0x1e')]?_[_0x1693('0x1f')](_0x20906b[_0x1693('0x19')][_0x1693('0x1e')],function(_0x588ebe){return{'model':db[_0x588ebe[_0x1693('0x20')]],'as':_0x588ebe['as'],'attributes':_0x588ebe[_0x1693('0x1c')],'include':_0x588ebe[_0x1693('0x1e')]?_['map'](_0x588ebe[_0x1693('0x1e')],function(_0x28a1cc){return{'model':db[_0x28a1cc['model']],'as':_0x28a1cc['as'],'attributes':_0x28a1cc[_0x1693('0x1c')],'include':_0x28a1cc[_0x1693('0x1e')]?_['map'](_0x28a1cc['include'],function(_0x5655dd){return{'model':db[_0x5655dd[_0x1693('0x20')]],'as':_0x5655dd['as'],'attributes':_0x5655dd['attributes']};}):[]};}):[]};}):[]:[]})[_0x1693('0xa')](function(_0x3ee757){logger[_0x1693('0xb')](_0x1693('0x16'),_0x20906b);logger['debug'](_0x1693('0x16'),_0x20906b,JSON[_0x1693('0x10')](_0x3ee757));_0x410c3b(_0x3ee757);})['catch'](function(_0x37bce9){logger[_0x1693('0x11')](_0x1693('0x16'),_0x37bce9['message'],_0x20906b);_0x3f5287(_0x2ffa86[_0x1693('0x11')](0x1f4,_0x37bce9[_0x1693('0x13')]));});});}; \ No newline at end of file +var _0x7daf=['limit','map','include','model','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','code','error','message','GetCampaign','Campaign','findAll','options','raw','where','attributes'];(function(_0x16e106,_0x19cb2e){var _0x598706=function(_0x13b2ac){while(--_0x13b2ac){_0x16e106['push'](_0x16e106['shift']());}};_0x598706(++_0x19cb2e);}(_0x7daf,0xaa));var _0xf7da=function(_0x1c6d4f,_0x37e880){_0x1c6d4f=_0x1c6d4f-0x0;var _0x2598af=_0x7daf[_0x1c6d4f];return _0x2598af;};'use strict';var _=require('lodash');var util=require(_0xf7da('0x0'));var moment=require('moment');var BPromise=require(_0xf7da('0x1'));var rs=require(_0xf7da('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf7da('0x3'))['db'];var utils=require(_0xf7da('0x4'));var logger=require(_0xf7da('0x5'))(_0xf7da('0x6'));var config=require(_0xf7da('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf7da('0x8')][_0xf7da('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b35ec,_0x110cad,_0x2c70ad){return new BPromise(function(_0x468ca3,_0x53d71f){return client[_0xf7da('0xa')](_0x1b35ec,_0x2c70ad)[_0xf7da('0xb')](function(_0x326ff5){logger[_0xf7da('0xc')](_0xf7da('0xd'),_0x110cad,_0xf7da('0xe'));logger[_0xf7da('0xf')](_0xf7da('0x10'),_0x110cad,_0xf7da('0xe'),JSON[_0xf7da('0x11')](_0x326ff5));if(_0x326ff5['error']){if(_0x326ff5['error'][_0xf7da('0x12')]===0x1f4){logger[_0xf7da('0x13')](_0xf7da('0xd'),_0x110cad,_0x326ff5[_0xf7da('0x13')][_0xf7da('0x14')]);return _0x53d71f(_0x326ff5[_0xf7da('0x13')]['message']);}logger[_0xf7da('0x13')](_0xf7da('0xd'),_0x110cad,_0x326ff5['error'][_0xf7da('0x14')]);return _0x468ca3(_0x326ff5[_0xf7da('0x13')][_0xf7da('0x14')]);}else{logger[_0xf7da('0xc')](_0xf7da('0xd'),_0x110cad,_0xf7da('0xe'));_0x468ca3(_0x326ff5['result']['message']);}})['catch'](function(_0x39d9c0){logger[_0xf7da('0x13')](_0xf7da('0xd'),_0x110cad,_0x39d9c0);_0x53d71f(_0x39d9c0);});});}exports[_0xf7da('0x15')]=function(_0x336fca){var _0x1f3d53=this;return new Promise(function(_0xb75a2c,_0x13cd4a){return db[_0xf7da('0x16')][_0xf7da('0x17')]({'raw':_0x336fca[_0xf7da('0x18')]?_0x336fca[_0xf7da('0x18')][_0xf7da('0x19')]===undefined?!![]:![]:!![],'where':_0x336fca[_0xf7da('0x18')]?_0x336fca['options'][_0xf7da('0x1a')]||null:null,'attributes':_0x336fca[_0xf7da('0x18')]?_0x336fca[_0xf7da('0x18')][_0xf7da('0x1b')]||null:null,'limit':_0x336fca[_0xf7da('0x18')]?_0x336fca[_0xf7da('0x18')][_0xf7da('0x1c')]||null:null,'include':_0x336fca[_0xf7da('0x18')]?_0x336fca[_0xf7da('0x18')]['include']?_[_0xf7da('0x1d')](_0x336fca[_0xf7da('0x18')][_0xf7da('0x1e')],function(_0x4b627e){return{'model':db[_0x4b627e[_0xf7da('0x1f')]],'as':_0x4b627e['as'],'attributes':_0x4b627e[_0xf7da('0x1b')],'include':_0x4b627e[_0xf7da('0x1e')]?_[_0xf7da('0x1d')](_0x4b627e[_0xf7da('0x1e')],function(_0x9d2da){return{'model':db[_0x9d2da['model']],'as':_0x9d2da['as'],'attributes':_0x9d2da[_0xf7da('0x1b')],'include':_0x9d2da[_0xf7da('0x1e')]?_[_0xf7da('0x1d')](_0x9d2da['include'],function(_0x13ace4){return{'model':db[_0x13ace4[_0xf7da('0x1f')]],'as':_0x13ace4['as'],'attributes':_0x13ace4[_0xf7da('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf7da('0xb')](function(_0x13dc9f){logger['info'](_0xf7da('0x15'),_0x336fca);logger['debug'](_0xf7da('0x15'),_0x336fca,JSON[_0xf7da('0x11')](_0x13dc9f));_0xb75a2c(_0x13dc9f);})[_0xf7da('0x20')](function(_0x23a27e){logger['error'](_0xf7da('0x15'),_0x23a27e[_0xf7da('0x14')],_0x336fca);_0x13cd4a(_0x1f3d53[_0xf7da('0x13')](0x1f4,_0x23a27e[_0xf7da('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 73c6460..991ca4e 100644 --- a/server/api/campaign/index.js +++ b/server/api/campaign/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xccbe=['getLists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','addLists','put','/:id','update','delete','destroy','removeBlackLists','exports','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0xccbe,0xa4));var _0xeccb=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0xccbe[_0x5d4607];return _0x5e4a86;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xeccb('0x0'));var timeout=require(_0xeccb('0x1'));var express=require('express');var router=express[_0xeccb('0x2')]();var fs_extra=require(_0xeccb('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xeccb('0x4'));var config=require(_0xeccb('0x5'));var controller=require('./campaign.controller');router[_0xeccb('0x6')]('/',auth[_0xeccb('0x7')](),controller[_0xeccb('0x8')]);router['get']('/:id',auth[_0xeccb('0x7')](),controller['show']);router[_0xeccb('0x6')]('/:id/hoppers',auth[_0xeccb('0x7')](),controller[_0xeccb('0x9')]);router[_0xeccb('0x6')](_0xeccb('0xa'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xeccb('0x6')](_0xeccb('0xb'),auth[_0xeccb('0x7')](),controller[_0xeccb('0xc')]);router[_0xeccb('0x6')](_0xeccb('0xd'),auth[_0xeccb('0x7')](),controller[_0xeccb('0xe')]);router[_0xeccb('0x6')](_0xeccb('0xf'),auth[_0xeccb('0x7')](),controller[_0xeccb('0x10')]);router[_0xeccb('0x6')](_0xeccb('0x11'),auth[_0xeccb('0x7')](),controller[_0xeccb('0x12')]);router[_0xeccb('0x13')]('/',auth[_0xeccb('0x7')](),controller['create']);router['post'](_0xeccb('0x14'),auth['isAuthenticated'](),controller[_0xeccb('0x15')]);router[_0xeccb('0x13')](_0xeccb('0xf'),auth['isAuthenticated'](),controller[_0xeccb('0x16')]);router[_0xeccb('0x13')](_0xeccb('0x11'),auth[_0xeccb('0x7')](),controller['addBlackLists']);router[_0xeccb('0x17')](_0xeccb('0x18'),auth[_0xeccb('0x7')](),controller[_0xeccb('0x19')]);router[_0xeccb('0x1a')](_0xeccb('0x18'),auth[_0xeccb('0x7')](),controller[_0xeccb('0x1b')]);router['delete'](_0xeccb('0xf'),auth[_0xeccb('0x7')](),controller['removeLists']);router['delete'](_0xeccb('0x11'),auth[_0xeccb('0x7')](),controller[_0xeccb('0x1c')]);module[_0xeccb('0x1d')]=router; \ No newline at end of file +var _0xb745=['getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','post','/:id/clone','clone','addLists','addBlackLists','put','/:id','delete','destroy','removeLists','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','get','show','/:id/hoppers'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb745,0xe0));var _0x5b74=function(_0x139154,_0x1548cf){_0x139154=_0x139154-0x0;var _0x5c2447=_0xb745[_0x139154];return _0x5c2447;};'use strict';var multer=require(_0x5b74('0x0'));var util=require(_0x5b74('0x1'));var path=require(_0x5b74('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5b74('0x3')]();var fs_extra=require(_0x5b74('0x4'));var auth=require(_0x5b74('0x5'));var interaction=require(_0x5b74('0x6'));var config=require(_0x5b74('0x7'));var controller=require(_0x5b74('0x8'));router['get']('/',auth[_0x5b74('0x9')](),controller[_0x5b74('0xa')]);router[_0x5b74('0xb')]('/:id',auth[_0x5b74('0x9')](),controller[_0x5b74('0xc')]);router['get'](_0x5b74('0xd'),auth[_0x5b74('0x9')](),controller[_0x5b74('0xe')]);router['get'](_0x5b74('0xf'),auth[_0x5b74('0x9')](),controller[_0x5b74('0x10')]);router[_0x5b74('0xb')](_0x5b74('0x11'),auth[_0x5b74('0x9')](),controller[_0x5b74('0x12')]);router[_0x5b74('0xb')](_0x5b74('0x13'),auth[_0x5b74('0x9')](),controller[_0x5b74('0x14')]);router[_0x5b74('0xb')](_0x5b74('0x15'),auth['isAuthenticated'](),controller['getLists']);router[_0x5b74('0xb')](_0x5b74('0x16'),auth[_0x5b74('0x9')](),controller['getBlackLists']);router[_0x5b74('0x17')]('/',auth[_0x5b74('0x9')](),controller['create']);router[_0x5b74('0x17')](_0x5b74('0x18'),auth[_0x5b74('0x9')](),controller[_0x5b74('0x19')]);router[_0x5b74('0x17')](_0x5b74('0x15'),auth[_0x5b74('0x9')](),controller[_0x5b74('0x1a')]);router[_0x5b74('0x17')](_0x5b74('0x16'),auth[_0x5b74('0x9')](),controller[_0x5b74('0x1b')]);router[_0x5b74('0x1c')](_0x5b74('0x1d'),auth[_0x5b74('0x9')](),controller['update']);router[_0x5b74('0x1e')](_0x5b74('0x1d'),auth['isAuthenticated'](),controller[_0x5b74('0x1f')]);router[_0x5b74('0x1e')](_0x5b74('0x15'),auth['isAuthenticated'](),controller[_0x5b74('0x20')]);router[_0x5b74('0x1e')]('/:id/blacklists',auth[_0x5b74('0x9')](),controller['removeBlackLists']);module[_0x5b74('0x21')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index fc50909..3c458ac 100644 --- a/server/api/cannedAnswer/cannedAnswer.attributes.js +++ b/server/api/cannedAnswer/cannedAnswer.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4259=['VIRTUAL','getDataValue','key','STRING','TEXT','medium'];(function(_0xcfc44,_0x179bc1){var _0x307a25=function(_0x2b64de){while(--_0x2b64de){_0xcfc44['push'](_0xcfc44['shift']());}};_0x307a25(++_0x179bc1);}(_0x4259,0x19b));var _0x9425=function(_0x23e567,_0x317c3b){_0x23e567=_0x23e567-0x0;var _0x1fceaf=_0x4259[_0x23e567];return _0x1fceaf;};'use strict';var Sequelize=require('sequelize');module['exports']={'key':{'type':Sequelize[_0x9425('0x0')],'allowNull':![]},'value':{'type':Sequelize[_0x9425('0x1')],'length':_0x9425('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x9425('0x0')]},'name':{'type':Sequelize[_0x9425('0x3')],'get':function(){return this[_0x9425('0x4')](_0x9425('0x5'));}}}; \ No newline at end of file +var _0x7cf2=['TEXT','VIRTUAL','key','sequelize','exports','STRING'];(function(_0x3f2abd,_0x23b3a9){var _0x3d8338=function(_0x26d053){while(--_0x26d053){_0x3f2abd['push'](_0x3f2abd['shift']());}};_0x3d8338(++_0x23b3a9);}(_0x7cf2,0x93));var _0x27cf=function(_0x46306f,_0x5aef14){_0x46306f=_0x46306f-0x0;var _0x16a27f=_0x7cf2[_0x46306f];return _0x16a27f;};'use strict';var Sequelize=require(_0x27cf('0x0'));module[_0x27cf('0x1')]={'key':{'type':Sequelize[_0x27cf('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x27cf('0x3')],'length':'medium','allowNull':![]},'description':{'type':Sequelize[_0x27cf('0x2')]},'name':{'type':Sequelize[_0x27cf('0x4')],'get':function(){return this['getDataValue'](_0x27cf('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 5a8c10c..4dea71c 100644 --- a/server/api/cannedAnswer/cannedAnswer.controller.js +++ b/server/api/cannedAnswer/cannedAnswer.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x81f4=['UserProfileResource','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','destroy','then','CannedAnswers','sendStatus','stack','name','send','map','CannedAnswer','fieldName','key','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','includeAll','include','findAll','rows','catch','params','options','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','userProfileId','autoAssociation'];(function(_0x5a8112,_0x465890){var _0x47d887=function(_0x21be3a){while(--_0x21be3a){_0x5a8112['push'](_0x5a8112['shift']());}};_0x47d887(++_0x465890);}(_0x81f4,0xb6));var _0x481f=function(_0x1680f2,_0x13f7b9){_0x1680f2=_0x1680f2-0x0;var _0x19d047=_0x81f4[_0x1680f2];return _0x19d047;};'use strict';var emlformat=require(_0x481f('0x0'));var rimraf=require(_0x481f('0x1'));var zipdir=require(_0x481f('0x2'));var jsonpatch=require(_0x481f('0x3'));var rp=require(_0x481f('0x4'));var moment=require(_0x481f('0x5'));var BPromise=require(_0x481f('0x6'));var Mustache=require(_0x481f('0x7'));var util=require(_0x481f('0x8'));var path=require(_0x481f('0x9'));var sox=require(_0x481f('0xa'));var csv=require(_0x481f('0xb'));var ejs=require(_0x481f('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x481f('0xd'));var crypto=require(_0x481f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x481f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x481f('0x10'));var Papa=require(_0x481f('0x11'));var Redis=require('ioredis');var authService=require(_0x481f('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x481f('0x13'));var logger=require('../../config/logger')(_0x481f('0x14'));var utils=require('../../config/utils');var config=require(_0x481f('0x15'));var licenseUtil=require(_0x481f('0x16'));var db=require(_0x481f('0x17'))['db'];function respondWithStatusCode(_0x131a80,_0x191d9f){_0x191d9f=_0x191d9f||0xcc;return function(_0x17510){if(_0x17510){return _0x131a80['sendStatus'](_0x191d9f);}return _0x131a80[_0x481f('0x18')](_0x191d9f)[_0x481f('0x19')]();};}function respondWithResult(_0xe9cb43,_0x56b77e){_0x56b77e=_0x56b77e||0xc8;return function(_0x54b308){if(_0x54b308){return _0xe9cb43['status'](_0x56b77e)[_0x481f('0x1a')](_0x54b308);}};}function respondWithFilteredResult(_0x36b2be,_0x2da707){return function(_0x5b27e2){if(_0x5b27e2){var _0x191c1e=typeof _0x2da707['offset']===_0x481f('0x1b')&&typeof _0x2da707['limit']===_0x481f('0x1b');var _0x3a6488=_0x5b27e2[_0x481f('0x1c')];var _0x1d89e3=_0x191c1e?0x0:_0x2da707['offset'];var _0x346ad6=_0x191c1e?_0x5b27e2['count']:_0x2da707[_0x481f('0x1d')]+_0x2da707[_0x481f('0x1e')];var _0x10ee2e;if(_0x346ad6>=_0x3a6488){_0x346ad6=_0x3a6488;_0x10ee2e=0xc8;}else{_0x10ee2e=0xce;}_0x36b2be[_0x481f('0x18')](_0x10ee2e);return _0x36b2be[_0x481f('0x1f')](_0x481f('0x20'),_0x1d89e3+'-'+_0x346ad6+'/'+_0x3a6488)['json'](_0x5b27e2);}return null;};}function patchUpdates(_0x13b429){return function(_0x4dd473){try{jsonpatch['apply'](_0x4dd473,_0x13b429,!![]);}catch(_0x5ec1c8){return BPromise[_0x481f('0x21')](_0x5ec1c8);}return _0x4dd473[_0x481f('0x22')]();};}function saveUpdates(_0x2359b0,_0x2e200b){return function(_0x527f9a){if(_0x527f9a){return _0x527f9a[_0x481f('0x23')](_0x2359b0)['then'](function(_0x91bd55){return _0x91bd55;});}return null;};}function removeEntity(_0x2e5ba8,_0x1e2d45){return function(_0x3fd3d3){if(_0x3fd3d3){return _0x3fd3d3[_0x481f('0x24')]()[_0x481f('0x25')](function(){var _0x1b68d2=_0x3fd3d3['get']({'plain':!![]});var _0x16fa31=_0x481f('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x16fa31,'resourceId':_0x1b68d2['id']}})[_0x481f('0x25')](function(){return _0x3fd3d3;});})[_0x481f('0x25')](function(){_0x2e5ba8[_0x481f('0x18')](0xcc)[_0x481f('0x19')]();});}};}function handleEntityNotFound(_0x5534aa,_0x216e7a){return function(_0x2e08a1){if(!_0x2e08a1){_0x5534aa[_0x481f('0x27')](0x194);}return _0x2e08a1;};}function handleError(_0x56f086,_0x5775ae){_0x5775ae=_0x5775ae||0x1f4;return function(_0x8537d2){logger['error'](_0x8537d2[_0x481f('0x28')]);if(_0x8537d2[_0x481f('0x29')]){delete _0x8537d2[_0x481f('0x29')];}_0x56f086[_0x481f('0x18')](_0x5775ae)[_0x481f('0x2a')](_0x8537d2);};}exports['index']=function(_0xb4de99,_0x573918){var _0x3ed034={},_0x5bd2b1={},_0x2fa5ce={'count':0x0,'rows':[]};var _0x5c031b=_[_0x481f('0x2b')](db[_0x481f('0x2c')]['rawAttributes'],function(_0x39ab70){return{'name':_0x39ab70[_0x481f('0x2d')],'type':_0x39ab70['type'][_0x481f('0x2e')]};});_0x5bd2b1['model']=_[_0x481f('0x2b')](_0x5c031b,_0x481f('0x29'));_0x5bd2b1[_0x481f('0x2f')]=_[_0x481f('0x30')](_0xb4de99[_0x481f('0x2f')]);_0x5bd2b1[_0x481f('0x31')]=_[_0x481f('0x32')](_0x5bd2b1['model'],_0x5bd2b1[_0x481f('0x2f')]);_0x3ed034[_0x481f('0x33')]=_['intersection'](_0x5bd2b1['model'],qs[_0x481f('0x34')](_0xb4de99[_0x481f('0x2f')][_0x481f('0x34')]));_0x3ed034[_0x481f('0x33')]=_0x3ed034[_0x481f('0x33')][_0x481f('0x35')]?_0x3ed034['attributes']:_0x5bd2b1[_0x481f('0x36')];if(!_0xb4de99[_0x481f('0x2f')][_0x481f('0x37')](_0x481f('0x38'))){_0x3ed034[_0x481f('0x1e')]=qs[_0x481f('0x1e')](_0xb4de99[_0x481f('0x2f')][_0x481f('0x1e')]);_0x3ed034['offset']=qs[_0x481f('0x1d')](_0xb4de99[_0x481f('0x2f')][_0x481f('0x1d')]);}_0x3ed034[_0x481f('0x39')]=qs[_0x481f('0x3a')](_0xb4de99[_0x481f('0x2f')][_0x481f('0x3a')]);_0x3ed034[_0x481f('0x3b')]=qs[_0x481f('0x31')](_[_0x481f('0x3c')](_0xb4de99['query'],_0x5bd2b1[_0x481f('0x31')]),_0x5c031b);if(_0xb4de99[_0x481f('0x2f')]['filter']){_0x3ed034[_0x481f('0x3b')]=_[_0x481f('0x3d')](_0x3ed034['where'],{'$or':[{'key':{'$like':'%'+_0xb4de99[_0x481f('0x2f')][_0x481f('0x3e')]+'%'}},{'value':{'$like':'%'+_0xb4de99['query'][_0x481f('0x3e')]+'%'}}]});}_0x3ed034=_['merge']({},_0x3ed034,_0xb4de99['options']);var _0x34d8ab={'where':_0x3ed034['where']};return db['CannedAnswer'][_0x481f('0x1c')](_0x34d8ab)['then'](function(_0x48949b){_0x2fa5ce['count']=_0x48949b;if(_0xb4de99['query'][_0x481f('0x3f')]){_0x3ed034[_0x481f('0x40')]=[{'all':!![]}];}return db['CannedAnswer'][_0x481f('0x41')](_0x3ed034);})[_0x481f('0x25')](function(_0x5019ba){_0x2fa5ce[_0x481f('0x42')]=_0x5019ba;return _0x2fa5ce;})['then'](respondWithFilteredResult(_0x573918,_0x3ed034))[_0x481f('0x43')](handleError(_0x573918,null));};exports['show']=function(_0xe1a390,_0x501fe1){var _0x58cc40={'raw':!![],'where':{'id':_0xe1a390[_0x481f('0x44')]['id']}},_0x159cbb={};_0x159cbb['model']=_[_0x481f('0x30')](db[_0x481f('0x2c')]['rawAttributes']);_0x159cbb[_0x481f('0x2f')]=_['keys'](_0xe1a390['query']);_0x159cbb[_0x481f('0x31')]=_[_0x481f('0x32')](_0x159cbb[_0x481f('0x36')],_0x159cbb['query']);_0x58cc40['attributes']=_[_0x481f('0x32')](_0x159cbb['model'],qs[_0x481f('0x34')](_0xe1a390[_0x481f('0x2f')][_0x481f('0x34')]));_0x58cc40[_0x481f('0x33')]=_0x58cc40[_0x481f('0x33')]['length']?_0x58cc40['attributes']:_0x159cbb['model'];if(_0xe1a390[_0x481f('0x2f')][_0x481f('0x3f')]){_0x58cc40['include']=[{'all':!![]}];}_0x58cc40=_[_0x481f('0x3d')]({},_0x58cc40,_0xe1a390[_0x481f('0x45')]);return db[_0x481f('0x2c')][_0x481f('0x46')](_0x58cc40)[_0x481f('0x25')](handleEntityNotFound(_0x501fe1,null))[_0x481f('0x25')](respondWithResult(_0x501fe1,null))[_0x481f('0x43')](handleError(_0x501fe1,null));};exports[_0x481f('0x23')]=function(_0x1f574e,_0x2303a8){if(_0x1f574e[_0x481f('0x47')]['id']){delete _0x1f574e['body']['id'];}return db[_0x481f('0x2c')][_0x481f('0x46')]({'where':{'id':_0x1f574e[_0x481f('0x44')]['id']}})['then'](handleEntityNotFound(_0x2303a8,null))[_0x481f('0x25')](saveUpdates(_0x1f574e[_0x481f('0x47')],null))[_0x481f('0x25')](respondWithResult(_0x2303a8,null))[_0x481f('0x43')](handleError(_0x2303a8,null));};exports[_0x481f('0x24')]=function(_0x529e7a,_0xfaa214){return db[_0x481f('0x2c')][_0x481f('0x46')]({'where':{'id':_0x529e7a[_0x481f('0x44')]['id']}})[_0x481f('0x25')](handleEntityNotFound(_0xfaa214,null))[_0x481f('0x25')](removeEntity(_0xfaa214,null))[_0x481f('0x43')](handleError(_0xfaa214,null));};exports['create']=function(_0x56cf3e,_0x1a3714){var _0x530497={'key':_0x56cf3e[_0x481f('0x47')][_0x481f('0x2e')]};if(_0x56cf3e['body'][_0x481f('0x48')]){_0x530497[_0x481f('0x48')]=_0x56cf3e[_0x481f('0x47')][_0x481f('0x48')];}else if(_0x56cf3e[_0x481f('0x47')][_0x481f('0x49')]){_0x530497[_0x481f('0x49')]=_0x56cf3e[_0x481f('0x47')][_0x481f('0x49')];}else if(_0x56cf3e[_0x481f('0x47')][_0x481f('0x4a')]){_0x530497[_0x481f('0x4a')]=_0x56cf3e[_0x481f('0x47')]['OpenchannelAccountId'];}else if(_0x56cf3e[_0x481f('0x47')][_0x481f('0x4b')]){_0x530497['ChatWebsiteId']=_0x56cf3e[_0x481f('0x47')][_0x481f('0x4b')];}return db[_0x481f('0x2c')][_0x481f('0x46')]({'where':_0x530497})['then'](function(_0x5f5011){if(_0x5f5011){throw new db[(_0x481f('0x4c'))][(_0x481f('0x4d'))](_0x481f('0x4e'));}return db[_0x481f('0x2c')]['create'](_0x56cf3e[_0x481f('0x47')]);})[_0x481f('0x25')](function(_0x2bc95e){var _0x51dca1=_0x56cf3e[_0x481f('0x4f')]['get']({'plain':!![]});if(!_0x51dca1)throw new Error(_0x481f('0x50'));if(_0x51dca1['role']===_0x481f('0x4f')){var _0x5ac879=_0x2bc95e[_0x481f('0x51')]({'plain':!![]});return db[_0x481f('0x52')][_0x481f('0x46')]({'where':{'name':'CannedAnswers','userProfileId':_0x51dca1[_0x481f('0x53')]},'raw':!![]})[_0x481f('0x25')](function(_0x17a3e0){if(_0x17a3e0&&_0x17a3e0[_0x481f('0x54')]===0x0){return db[_0x481f('0x55')][_0x481f('0x56')]({'name':_0x5ac879[_0x481f('0x29')],'resourceId':_0x5ac879['id'],'type':_0x17a3e0[_0x481f('0x29')],'sectionId':_0x17a3e0['id']},{})['then'](function(){return _0x2bc95e;});}else{return _0x2bc95e;}})['catch'](function(_0x3e7a03){logger[_0x481f('0x57')](_0x481f('0x58'),_0x3e7a03);throw _0x3e7a03;});}return _0x2bc95e;})['then'](respondWithResult(_0x1a3714,0xc9))[_0x481f('0x43')](handleError(_0x1a3714,null));}; \ No newline at end of file +var _0xd807=['bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','then','get','CannedAnswers','UserProfileResource','error','name','send','map','CannedAnswer','fieldName','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','catch','show','params','intersection','length','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','role','UserProfileSection','eml-format','rimraf','zip-dir','request-promise'];(function(_0x5c562d,_0x34b2c9){var _0x2d3352=function(_0x5f3f04){while(--_0x5f3f04){_0x5c562d['push'](_0x5c562d['shift']());}};_0x2d3352(++_0x34b2c9);}(_0xd807,0x1a0));var _0x7d80=function(_0x1c4582,_0x4017f6){_0x1c4582=_0x1c4582-0x0;var _0x3bfdde=_0xd807[_0x1c4582];return _0x3bfdde;};'use strict';var emlformat=require(_0x7d80('0x0'));var rimraf=require(_0x7d80('0x1'));var zipdir=require(_0x7d80('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7d80('0x3'));var moment=require('moment');var BPromise=require(_0x7d80('0x4'));var Mustache=require(_0x7d80('0x5'));var util=require(_0x7d80('0x6'));var path=require(_0x7d80('0x7'));var sox=require(_0x7d80('0x8'));var csv=require(_0x7d80('0x9'));var ejs=require(_0x7d80('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7d80('0xb'));var squel=require(_0x7d80('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7d80('0x9'));var querystring=require(_0x7d80('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7d80('0xe'));var qs=require(_0x7d80('0xf'));var as=require(_0x7d80('0x10'));var hardwareService=require(_0x7d80('0x11'));var logger=require(_0x7d80('0x12'))(_0x7d80('0x13'));var utils=require(_0x7d80('0x14'));var config=require(_0x7d80('0x15'));var licenseUtil=require(_0x7d80('0x16'));var db=require(_0x7d80('0x17'))['db'];function respondWithStatusCode(_0x1c9163,_0x15bcd4){_0x15bcd4=_0x15bcd4||0xcc;return function(_0x4dde7c){if(_0x4dde7c){return _0x1c9163[_0x7d80('0x18')](_0x15bcd4);}return _0x1c9163[_0x7d80('0x19')](_0x15bcd4)[_0x7d80('0x1a')]();};}function respondWithResult(_0x28cd54,_0x1486aa){_0x1486aa=_0x1486aa||0xc8;return function(_0x1b865f){if(_0x1b865f){return _0x28cd54['status'](_0x1486aa)[_0x7d80('0x1b')](_0x1b865f);}};}function respondWithFilteredResult(_0x582b9a,_0x31acae){return function(_0x42463d){if(_0x42463d){var _0x37e708=typeof _0x31acae[_0x7d80('0x1c')]===_0x7d80('0x1d')&&typeof _0x31acae['limit']===_0x7d80('0x1d');var _0x344980=_0x42463d[_0x7d80('0x1e')];var _0x1730c5=_0x37e708?0x0:_0x31acae['offset'];var _0x2117ff=_0x37e708?_0x42463d[_0x7d80('0x1e')]:_0x31acae['offset']+_0x31acae[_0x7d80('0x1f')];var _0x16523b;if(_0x2117ff>=_0x344980){_0x2117ff=_0x344980;_0x16523b=0xc8;}else{_0x16523b=0xce;}_0x582b9a[_0x7d80('0x19')](_0x16523b);return _0x582b9a[_0x7d80('0x20')](_0x7d80('0x21'),_0x1730c5+'-'+_0x2117ff+'/'+_0x344980)[_0x7d80('0x1b')](_0x42463d);}return null;};}function patchUpdates(_0x3bff4b){return function(_0x20a5a2){try{jsonpatch[_0x7d80('0x22')](_0x20a5a2,_0x3bff4b,!![]);}catch(_0x1609cd){return BPromise[_0x7d80('0x23')](_0x1609cd);}return _0x20a5a2['save']();};}function saveUpdates(_0xff7252,_0x57e580){return function(_0x3b7430){if(_0x3b7430){return _0x3b7430[_0x7d80('0x24')](_0xff7252)['then'](function(_0x137905){return _0x137905;});}return null;};}function removeEntity(_0x5afcec,_0x1bfee0){return function(_0x5a23bf){if(_0x5a23bf){return _0x5a23bf[_0x7d80('0x25')]()[_0x7d80('0x26')](function(){var _0x173875=_0x5a23bf[_0x7d80('0x27')]({'plain':!![]});var _0x2deeaa=_0x7d80('0x28');return db[_0x7d80('0x29')][_0x7d80('0x25')]({'where':{'type':_0x2deeaa,'resourceId':_0x173875['id']}})['then'](function(){return _0x5a23bf;});})[_0x7d80('0x26')](function(){_0x5afcec[_0x7d80('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24c716,_0x21e182){return function(_0x558da5){if(!_0x558da5){_0x24c716['sendStatus'](0x194);}return _0x558da5;};}function handleError(_0xe71da2,_0x380b53){_0x380b53=_0x380b53||0x1f4;return function(_0x57a7b0){logger[_0x7d80('0x2a')](_0x57a7b0['stack']);if(_0x57a7b0[_0x7d80('0x2b')]){delete _0x57a7b0[_0x7d80('0x2b')];}_0xe71da2['status'](_0x380b53)[_0x7d80('0x2c')](_0x57a7b0);};}exports['index']=function(_0x4a6971,_0x41341c){var _0x4346f0={},_0xa3ca0f={},_0x27bdce={'count':0x0,'rows':[]};var _0x5f1b2d=_[_0x7d80('0x2d')](db[_0x7d80('0x2e')]['rawAttributes'],function(_0x2ef52e){return{'name':_0x2ef52e[_0x7d80('0x2f')],'type':_0x2ef52e[_0x7d80('0x30')][_0x7d80('0x31')]};});_0xa3ca0f[_0x7d80('0x32')]=_[_0x7d80('0x2d')](_0x5f1b2d,_0x7d80('0x2b'));_0xa3ca0f[_0x7d80('0x33')]=_[_0x7d80('0x34')](_0x4a6971[_0x7d80('0x33')]);_0xa3ca0f[_0x7d80('0x35')]=_['intersection'](_0xa3ca0f[_0x7d80('0x32')],_0xa3ca0f[_0x7d80('0x33')]);_0x4346f0[_0x7d80('0x36')]=_['intersection'](_0xa3ca0f[_0x7d80('0x32')],qs[_0x7d80('0x37')](_0x4a6971[_0x7d80('0x33')][_0x7d80('0x37')]));_0x4346f0['attributes']=_0x4346f0[_0x7d80('0x36')]['length']?_0x4346f0[_0x7d80('0x36')]:_0xa3ca0f['model'];if(!_0x4a6971[_0x7d80('0x33')][_0x7d80('0x38')](_0x7d80('0x39'))){_0x4346f0['limit']=qs[_0x7d80('0x1f')](_0x4a6971['query'][_0x7d80('0x1f')]);_0x4346f0[_0x7d80('0x1c')]=qs[_0x7d80('0x1c')](_0x4a6971['query']['offset']);}_0x4346f0['order']=qs[_0x7d80('0x3a')](_0x4a6971[_0x7d80('0x33')]['sort']);_0x4346f0[_0x7d80('0x3b')]=qs['filters'](_[_0x7d80('0x3c')](_0x4a6971[_0x7d80('0x33')],_0xa3ca0f[_0x7d80('0x35')]),_0x5f1b2d);if(_0x4a6971[_0x7d80('0x33')][_0x7d80('0x3d')]){_0x4346f0[_0x7d80('0x3b')]=_[_0x7d80('0x3e')](_0x4346f0[_0x7d80('0x3b')],{'$or':[{'key':{'$like':'%'+_0x4a6971[_0x7d80('0x33')][_0x7d80('0x3d')]+'%'}},{'value':{'$like':'%'+_0x4a6971['query'][_0x7d80('0x3d')]+'%'}}]});}_0x4346f0=_[_0x7d80('0x3e')]({},_0x4346f0,_0x4a6971[_0x7d80('0x3f')]);var _0x54bb91={'where':_0x4346f0[_0x7d80('0x3b')]};return db['CannedAnswer'][_0x7d80('0x1e')](_0x54bb91)['then'](function(_0x53ccdf){_0x27bdce[_0x7d80('0x1e')]=_0x53ccdf;if(_0x4a6971[_0x7d80('0x33')][_0x7d80('0x40')]){_0x4346f0[_0x7d80('0x41')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x4346f0);})[_0x7d80('0x26')](function(_0x1af101){_0x27bdce['rows']=_0x1af101;return _0x27bdce;})[_0x7d80('0x26')](respondWithFilteredResult(_0x41341c,_0x4346f0))[_0x7d80('0x42')](handleError(_0x41341c,null));};exports[_0x7d80('0x43')]=function(_0x94b2f6,_0x24cebd){var _0x427600={'raw':!![],'where':{'id':_0x94b2f6[_0x7d80('0x44')]['id']}},_0x45c209={};_0x45c209[_0x7d80('0x32')]=_[_0x7d80('0x34')](db[_0x7d80('0x2e')]['rawAttributes']);_0x45c209['query']=_[_0x7d80('0x34')](_0x94b2f6['query']);_0x45c209[_0x7d80('0x35')]=_[_0x7d80('0x45')](_0x45c209[_0x7d80('0x32')],_0x45c209[_0x7d80('0x33')]);_0x427600[_0x7d80('0x36')]=_[_0x7d80('0x45')](_0x45c209['model'],qs['fields'](_0x94b2f6[_0x7d80('0x33')][_0x7d80('0x37')]));_0x427600['attributes']=_0x427600[_0x7d80('0x36')][_0x7d80('0x46')]?_0x427600[_0x7d80('0x36')]:_0x45c209['model'];if(_0x94b2f6['query']['includeAll']){_0x427600[_0x7d80('0x41')]=[{'all':!![]}];}_0x427600=_[_0x7d80('0x3e')]({},_0x427600,_0x94b2f6[_0x7d80('0x3f')]);return db[_0x7d80('0x2e')]['find'](_0x427600)[_0x7d80('0x26')](handleEntityNotFound(_0x24cebd,null))['then'](respondWithResult(_0x24cebd,null))[_0x7d80('0x42')](handleError(_0x24cebd,null));};exports[_0x7d80('0x24')]=function(_0x58a569,_0x2bd940){if(_0x58a569[_0x7d80('0x47')]['id']){delete _0x58a569[_0x7d80('0x47')]['id'];}return db[_0x7d80('0x2e')][_0x7d80('0x48')]({'where':{'id':_0x58a569['params']['id']}})[_0x7d80('0x26')](handleEntityNotFound(_0x2bd940,null))[_0x7d80('0x26')](saveUpdates(_0x58a569['body'],null))[_0x7d80('0x26')](respondWithResult(_0x2bd940,null))[_0x7d80('0x42')](handleError(_0x2bd940,null));};exports[_0x7d80('0x25')]=function(_0x415b38,_0x10dbe3){return db[_0x7d80('0x2e')]['find']({'where':{'id':_0x415b38[_0x7d80('0x44')]['id']}})[_0x7d80('0x26')](handleEntityNotFound(_0x10dbe3,null))['then'](removeEntity(_0x10dbe3,null))[_0x7d80('0x42')](handleError(_0x10dbe3,null));};exports[_0x7d80('0x49')]=function(_0x32bf97,_0xf7510){var _0x313c04={'key':_0x32bf97[_0x7d80('0x47')][_0x7d80('0x31')]};if(_0x32bf97[_0x7d80('0x47')][_0x7d80('0x4a')]){_0x313c04[_0x7d80('0x4a')]=_0x32bf97[_0x7d80('0x47')][_0x7d80('0x4a')];}else if(_0x32bf97[_0x7d80('0x47')]['SmsAccountId']){_0x313c04[_0x7d80('0x4b')]=_0x32bf97[_0x7d80('0x47')][_0x7d80('0x4b')];}else if(_0x32bf97['body'][_0x7d80('0x4c')]){_0x313c04[_0x7d80('0x4c')]=_0x32bf97[_0x7d80('0x47')]['OpenchannelAccountId'];}else if(_0x32bf97[_0x7d80('0x47')]['ChatWebsiteId']){_0x313c04[_0x7d80('0x4d')]=_0x32bf97[_0x7d80('0x47')][_0x7d80('0x4d')];}return db['CannedAnswer'][_0x7d80('0x48')]({'where':_0x313c04})[_0x7d80('0x26')](function(_0x2c8ae1){if(_0x2c8ae1){throw new db[(_0x7d80('0x4e'))][(_0x7d80('0x4f'))](_0x7d80('0x50'));}return db[_0x7d80('0x2e')][_0x7d80('0x49')](_0x32bf97['body']);})['then'](function(_0x5d3690){var _0x1aabe5=_0x32bf97[_0x7d80('0x51')][_0x7d80('0x27')]({'plain':!![]});if(!_0x1aabe5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1aabe5[_0x7d80('0x52')]===_0x7d80('0x51')){var _0x2aa054=_0x5d3690[_0x7d80('0x27')]({'plain':!![]});return db[_0x7d80('0x53')][_0x7d80('0x48')]({'where':{'name':_0x7d80('0x28'),'userProfileId':_0x1aabe5['userProfileId']},'raw':!![]})[_0x7d80('0x26')](function(_0x18eb22){if(_0x18eb22&&_0x18eb22['autoAssociation']===0x0){return db[_0x7d80('0x29')]['create']({'name':_0x2aa054[_0x7d80('0x2b')],'resourceId':_0x2aa054['id'],'type':_0x18eb22['name'],'sectionId':_0x18eb22['id']},{})['then'](function(){return _0x5d3690;});}else{return _0x5d3690;}})[_0x7d80('0x42')](function(_0x45c119){logger[_0x7d80('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x45c119);throw _0x45c119;});}return _0x5d3690;})[_0x7d80('0x26')](respondWithResult(_0xf7510,0xc9))[_0x7d80('0x42')](handleError(_0xf7510,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 4a8519a..23feb9c 100644 --- a/server/api/cannedAnswer/cannedAnswer.model.js +++ b/server/api/cannedAnswer/cannedAnswer.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaaf8=['moment','bluebird','request-promise','path','../../config/environment','./cannedAnswer.attributes','exports','define','utf8mb4','util','api'];(function(_0x222f42,_0x21fa16){var _0x34c41d=function(_0x41ac2a){while(--_0x41ac2a){_0x222f42['push'](_0x222f42['shift']());}};_0x34c41d(++_0x21fa16);}(_0xaaf8,0x1ab));var _0x8aaf=function(_0x15f0e2,_0x22e3ee){_0x15f0e2=_0x15f0e2-0x0;var _0x21cc0c=_0xaaf8[_0x15f0e2];return _0x21cc0c;};'use strict';var _=require('lodash');var util=require(_0x8aaf('0x0'));var logger=require('../../config/logger')(_0x8aaf('0x1'));var moment=require(_0x8aaf('0x2'));var BPromise=require(_0x8aaf('0x3'));var rp=require(_0x8aaf('0x4'));var fs=require('fs');var path=require(_0x8aaf('0x5'));var rimraf=require('rimraf');var config=require(_0x8aaf('0x6'));var attributes=require(_0x8aaf('0x7'));module[_0x8aaf('0x8')]=function(_0x4d0a49,_0xc3fdc7){return _0x4d0a49[_0x8aaf('0x9')]('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8aaf('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x41e3=['bluebird','../../config/environment','exports','define','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x49542d,_0x54ffb8){var _0x3a65d6=function(_0x48506f){while(--_0x48506f){_0x49542d['push'](_0x49542d['shift']());}};_0x3a65d6(++_0x54ffb8);}(_0x41e3,0x146));var _0x341e=function(_0x7290bf,_0x10acee){_0x7290bf=_0x7290bf-0x0;var _0x1027b6=_0x41e3[_0x7290bf];return _0x1027b6;};'use strict';var _=require(_0x341e('0x0'));var util=require(_0x341e('0x1'));var logger=require(_0x341e('0x2'))(_0x341e('0x3'));var moment=require('moment');var BPromise=require(_0x341e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x341e('0x5'));var attributes=require('./cannedAnswer.attributes');module[_0x341e('0x6')]=function(_0x50154b,_0x2b07ae){return _0x50154b[_0x341e('0x7')](_0x341e('0x8'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x341e('0x9'),'collate':_0x341e('0xa')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index fd9f43d..f40e3ec 100644 --- a/server/api/cannedAnswer/cannedAnswer.rpc.js +++ b/server/api/cannedAnswer/cannedAnswer.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x42676d,_0x14924a){var _0x920e=function(_0x1528d0){while(--_0x1528d0){_0x42676d['push'](_0x42676d['shift']());}};_0x920e(++_0x14924a);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x29cbc6,_0x4661a2){var _0x19b727=function(_0x5609c4){while(--_0x5609c4){_0x29cbc6['push'](_0x29cbc6['shift']());}};_0x19b727(++_0x4661a2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index eae0b5f..bfe02f9 100644 --- a/server/api/cannedAnswer/index.js +++ b/server/api/cannedAnswer/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb7e=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb7e,0xb5));var _0xedb7=function(_0x9e049f,_0x4bfa95){_0x9e049f=_0x9e049f-0x0;var _0x2700b2=_0xdb7e[_0x9e049f];return _0x2700b2;};'use strict';var multer=require(_0xedb7('0x0'));var util=require(_0xedb7('0x1'));var path=require(_0xedb7('0x2'));var timeout=require(_0xedb7('0x3'));var express=require(_0xedb7('0x4'));var router=express['Router']();var fs_extra=require(_0xedb7('0x5'));var auth=require(_0xedb7('0x6'));var interaction=require(_0xedb7('0x7'));var config=require('../../config/environment');var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0xedb7('0x8')](),controller[_0xedb7('0x9')]);router[_0xedb7('0xa')](_0xedb7('0xb'),auth['isAuthenticated'](),controller[_0xedb7('0xc')]);router[_0xedb7('0xd')]('/',auth['isAuthenticated'](),controller[_0xedb7('0xe')]);router[_0xedb7('0xf')]('/:id',auth[_0xedb7('0x8')](),controller[_0xedb7('0x10')]);router[_0xedb7('0x11')](_0xedb7('0xb'),auth['isAuthenticated'](),controller[_0xedb7('0x12')]);module[_0xedb7('0x13')]=router; \ No newline at end of file +var _0x68aa=['../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','post','create','put','update','delete','destroy','multer','path','connect-timeout','express','fs-extra'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x68aa,0x1e1));var _0xa68a=function(_0x31ea0e,_0x115eee){_0x31ea0e=_0x31ea0e-0x0;var _0x215d56=_0x68aa[_0x31ea0e];return _0x215d56;};'use strict';var multer=require(_0xa68a('0x0'));var util=require('util');var path=require(_0xa68a('0x1'));var timeout=require(_0xa68a('0x2'));var express=require(_0xa68a('0x3'));var router=express['Router']();var fs_extra=require(_0xa68a('0x4'));var auth=require(_0xa68a('0x5'));var interaction=require(_0xa68a('0x6'));var config=require(_0xa68a('0x7'));var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0xa68a('0x8')](),controller[_0xa68a('0x9')]);router[_0xa68a('0xa')]('/:id',auth[_0xa68a('0x8')](),controller[_0xa68a('0xb')]);router[_0xa68a('0xc')]('/',auth[_0xa68a('0x8')](),controller[_0xa68a('0xd')]);router[_0xa68a('0xe')]('/:id',auth[_0xa68a('0x8')](),controller[_0xa68a('0xf')]);router[_0xa68a('0x10')]('/:id',auth[_0xa68a('0x8')](),controller[_0xa68a('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index b4415a0..ec475fa 100644 --- a/server/api/cdr/cdr.attributes.js +++ b/server/api/cdr/cdr.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb226=['exports','DATE','STRING','INTEGER','sequelize'];(function(_0x57add2,_0x4f2b7d){var _0x4e3670=function(_0x3311b){while(--_0x3311b){_0x57add2['push'](_0x57add2['shift']());}};_0x4e3670(++_0x4f2b7d);}(_0xb226,0x11c));var _0x6b22=function(_0x1d790b,_0x218767){_0x1d790b=_0x1d790b-0x0;var _0x4880e5=_0xb226[_0x1d790b];return _0x4880e5;};'use strict';var Sequelize=require(_0x6b22('0x0'));module[_0x6b22('0x1')]={'calldate':{'type':Sequelize[_0x6b22('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x6b22('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x6b22('0x3')]},'dcontext':{'type':Sequelize[_0x6b22('0x3')]},'channel':{'type':Sequelize[_0x6b22('0x3')]},'dstchannel':{'type':Sequelize[_0x6b22('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x6b22('0x3')]},'duration':{'type':Sequelize[_0x6b22('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x6b22('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x6b22('0x3')]},'amaflags':{'type':Sequelize[_0x6b22('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x6b22('0x3')]},'userfield':{'type':Sequelize[_0x6b22('0x3')]},'uniqueid':{'type':Sequelize[_0x6b22('0x3')]},'linkedid':{'type':Sequelize[_0x6b22('0x3')]},'sequence':{'type':Sequelize[_0x6b22('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x6b22('0x3')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xfb3f=['STRING','INTEGER','sequelize','exports','1970-01-01\x2000:00:01'];(function(_0x4d7808,_0x702235){var _0x2f4977=function(_0x3c5e8c){while(--_0x3c5e8c){_0x4d7808['push'](_0x4d7808['shift']());}};_0x2f4977(++_0x702235);}(_0xfb3f,0xd9));var _0xffb3=function(_0x4541e4,_0x328d04){_0x4541e4=_0x4541e4-0x0;var _0x3d6418=_0xfb3f[_0x4541e4];return _0x3d6418;};'use strict';var Sequelize=require(_0xffb3('0x0'));module[_0xffb3('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xffb3('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xffb3('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xffb3('0x3')]},'dstchannel':{'type':Sequelize[_0xffb3('0x3')]},'lastapp':{'type':Sequelize[_0xffb3('0x3')]},'lastdata':{'type':Sequelize[_0xffb3('0x3')]},'duration':{'type':Sequelize[_0xffb3('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xffb3('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xffb3('0x3')]},'amaflags':{'type':Sequelize[_0xffb3('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xffb3('0x3')]},'uniqueid':{'type':Sequelize[_0xffb3('0x3')]},'linkedid':{'type':Sequelize[_0xffb3('0x3')]},'sequence':{'type':Sequelize[_0xffb3('0x3')]},'peeraccount':{'type':Sequelize[_0xffb3('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xffb3('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index d207570..ba6c4fd 100644 --- a/server/api/cdr/cdr.controller.js +++ b/server/api/cdr/cdr.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb458=['reject','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','Cdr','includeAll','rows','catch','show','include','find','create','body','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x422f6f,_0x1ffe7c){var _0x5564f6=function(_0x4488a6){while(--_0x4488a6){_0x422f6f['push'](_0x422f6f['shift']());}};_0x5564f6(++_0x1ffe7c);}(_0xb458,0x103));var _0x8b45=function(_0x31600c,_0x16295b){_0x31600c=_0x31600c-0x0;var _0x295cc1=_0xb458[_0x31600c];return _0x295cc1;};'use strict';var emlformat=require(_0x8b45('0x0'));var rimraf=require(_0x8b45('0x1'));var zipdir=require(_0x8b45('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8b45('0x3'));var BPromise=require(_0x8b45('0x4'));var Mustache=require(_0x8b45('0x5'));var util=require(_0x8b45('0x6'));var path=require('path');var sox=require(_0x8b45('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8b45('0x8'));var _=require(_0x8b45('0x9'));var squel=require(_0x8b45('0xa'));var crypto=require(_0x8b45('0xb'));var jsforce=require(_0x8b45('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8b45('0xd'));var querystring=require(_0x8b45('0xe'));var Papa=require(_0x8b45('0xf'));var Redis=require(_0x8b45('0x10'));var authService=require(_0x8b45('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8b45('0x12'));var hardwareService=require(_0x8b45('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8b45('0x14'));var db=require(_0x8b45('0x15'))['db'];function respondWithStatusCode(_0x37c220,_0x52c4db){_0x52c4db=_0x52c4db||0xcc;return function(_0x30d38c){if(_0x30d38c){return _0x37c220[_0x8b45('0x16')](_0x52c4db);}return _0x37c220[_0x8b45('0x17')](_0x52c4db)[_0x8b45('0x18')]();};}function respondWithResult(_0x32babc,_0x2ad2ae){_0x2ad2ae=_0x2ad2ae||0xc8;return function(_0x5f0b20){if(_0x5f0b20){return _0x32babc['status'](_0x2ad2ae)[_0x8b45('0x19')](_0x5f0b20);}};}function respondWithFilteredResult(_0x23f1dd,_0x445170){return function(_0x39c1d1){if(_0x39c1d1){var _0x4781d7=typeof _0x445170[_0x8b45('0x1a')]===_0x8b45('0x1b')&&typeof _0x445170[_0x8b45('0x1c')]===_0x8b45('0x1b');var _0x391d1e=_0x39c1d1[_0x8b45('0x1d')];var _0x21d5b2=_0x4781d7?0x0:_0x445170[_0x8b45('0x1a')];var _0x43ffb7=_0x4781d7?_0x39c1d1[_0x8b45('0x1d')]:_0x445170[_0x8b45('0x1a')]+_0x445170[_0x8b45('0x1c')];var _0x309e23;if(_0x43ffb7>=_0x391d1e){_0x43ffb7=_0x391d1e;_0x309e23=0xc8;}else{_0x309e23=0xce;}_0x23f1dd['status'](_0x309e23);return _0x23f1dd[_0x8b45('0x1e')](_0x8b45('0x1f'),_0x21d5b2+'-'+_0x43ffb7+'/'+_0x391d1e)[_0x8b45('0x19')](_0x39c1d1);}return null;};}function patchUpdates(_0x46e21a){return function(_0x3e1438){try{jsonpatch[_0x8b45('0x20')](_0x3e1438,_0x46e21a,!![]);}catch(_0x2f4f1c){return BPromise[_0x8b45('0x21')](_0x2f4f1c);}return _0x3e1438['save']();};}function saveUpdates(_0x52f93f,_0x41154a){return function(_0x580e17){if(_0x580e17){return _0x580e17[_0x8b45('0x22')](_0x52f93f)[_0x8b45('0x23')](function(_0x30f405){return _0x30f405;});}return null;};}function removeEntity(_0x45e2db,_0x165570){return function(_0x2b8526){if(_0x2b8526){return _0x2b8526[_0x8b45('0x24')]()['then'](function(){_0x45e2db['status'](0xcc)[_0x8b45('0x18')]();});}};}function handleEntityNotFound(_0x2c2c06,_0x500044){return function(_0x5723a2){if(!_0x5723a2){_0x2c2c06[_0x8b45('0x16')](0x194);}return _0x5723a2;};}function handleError(_0x32f6f0,_0x2ca2d9){_0x2ca2d9=_0x2ca2d9||0x1f4;return function(_0x2f37bc){logger['error'](_0x2f37bc[_0x8b45('0x25')]);if(_0x2f37bc[_0x8b45('0x26')]){delete _0x2f37bc[_0x8b45('0x26')];}_0x32f6f0[_0x8b45('0x17')](_0x2ca2d9)[_0x8b45('0x27')](_0x2f37bc);};}exports[_0x8b45('0x28')]=function(_0x461017,_0x234f62){var _0x1733a7={},_0xf21bd1={},_0x339c73={'count':0x0,'rows':[]};var _0x1ba2d4=_[_0x8b45('0x29')](db['Cdr'][_0x8b45('0x2a')],function(_0x36db96){return{'name':_0x36db96[_0x8b45('0x2b')],'type':_0x36db96[_0x8b45('0x2c')][_0x8b45('0x2d')]};});_0xf21bd1[_0x8b45('0x2e')]=_[_0x8b45('0x29')](_0x1ba2d4,_0x8b45('0x26'));_0xf21bd1['query']=_[_0x8b45('0x2f')](_0x461017[_0x8b45('0x30')]);_0xf21bd1[_0x8b45('0x31')]=_[_0x8b45('0x32')](_0xf21bd1[_0x8b45('0x2e')],_0xf21bd1['query']);_0x1733a7[_0x8b45('0x33')]=_['intersection'](_0xf21bd1['model'],qs[_0x8b45('0x34')](_0x461017[_0x8b45('0x30')][_0x8b45('0x34')]));_0x1733a7[_0x8b45('0x33')]=_0x1733a7[_0x8b45('0x33')][_0x8b45('0x35')]?_0x1733a7['attributes']:_0xf21bd1[_0x8b45('0x2e')];if(!_0x461017[_0x8b45('0x30')][_0x8b45('0x36')](_0x8b45('0x37'))){_0x1733a7['limit']=qs[_0x8b45('0x1c')](_0x461017[_0x8b45('0x30')][_0x8b45('0x1c')]);_0x1733a7['offset']=qs[_0x8b45('0x1a')](_0x461017[_0x8b45('0x30')][_0x8b45('0x1a')]);}_0x1733a7['order']=qs[_0x8b45('0x38')](_0x461017[_0x8b45('0x30')][_0x8b45('0x38')]);_0x1733a7[_0x8b45('0x39')]=qs['filters'](_[_0x8b45('0x3a')](_0x461017[_0x8b45('0x30')],_0xf21bd1[_0x8b45('0x31')]),_0x1ba2d4);if(_0x461017[_0x8b45('0x30')][_0x8b45('0x3b')]){_0x1733a7[_0x8b45('0x39')]=_['merge'](_0x1733a7['where'],{'$or':_[_0x8b45('0x29')](_0x1ba2d4,function(_0x179f3b){if(_0x179f3b[_0x8b45('0x2c')]!==_0x8b45('0x3c')){var _0x23eb2e={};_0x23eb2e[_0x179f3b['name']]={'$like':'%'+_0x461017[_0x8b45('0x30')]['filter']+'%'};return _0x23eb2e;}})});}_0x1733a7=_[_0x8b45('0x3d')]({},_0x1733a7,_0x461017[_0x8b45('0x3e')]);var _0x5fae26={'where':_0x1733a7[_0x8b45('0x39')]};return db[_0x8b45('0x3f')][_0x8b45('0x1d')](_0x5fae26)[_0x8b45('0x23')](function(_0x1e9d50){_0x339c73[_0x8b45('0x1d')]=_0x1e9d50;if(_0x461017[_0x8b45('0x30')][_0x8b45('0x40')]){_0x1733a7['include']=[{'all':!![]}];}return db[_0x8b45('0x3f')]['findAll'](_0x1733a7);})[_0x8b45('0x23')](function(_0x4eda71){_0x339c73[_0x8b45('0x41')]=_0x4eda71;return _0x339c73;})[_0x8b45('0x23')](respondWithFilteredResult(_0x234f62,_0x1733a7))[_0x8b45('0x42')](handleError(_0x234f62,null));};exports[_0x8b45('0x43')]=function(_0x454cbc,_0x2770bc){var _0x58e663={'raw':!![],'where':{'id':_0x454cbc['params']['id']}},_0x6fbca4={};_0x6fbca4['model']=_[_0x8b45('0x2f')](db[_0x8b45('0x3f')][_0x8b45('0x2a')]);_0x6fbca4['query']=_[_0x8b45('0x2f')](_0x454cbc['query']);_0x6fbca4[_0x8b45('0x31')]=_[_0x8b45('0x32')](_0x6fbca4[_0x8b45('0x2e')],_0x6fbca4[_0x8b45('0x30')]);_0x58e663[_0x8b45('0x33')]=_[_0x8b45('0x32')](_0x6fbca4['model'],qs[_0x8b45('0x34')](_0x454cbc[_0x8b45('0x30')][_0x8b45('0x34')]));_0x58e663[_0x8b45('0x33')]=_0x58e663[_0x8b45('0x33')][_0x8b45('0x35')]?_0x58e663[_0x8b45('0x33')]:_0x6fbca4[_0x8b45('0x2e')];if(_0x454cbc[_0x8b45('0x30')][_0x8b45('0x40')]){_0x58e663[_0x8b45('0x44')]=[{'all':!![]}];}_0x58e663=_[_0x8b45('0x3d')]({},_0x58e663,_0x454cbc[_0x8b45('0x3e')]);return db[_0x8b45('0x3f')][_0x8b45('0x45')](_0x58e663)[_0x8b45('0x23')](handleEntityNotFound(_0x2770bc,null))['then'](respondWithResult(_0x2770bc,null))['catch'](handleError(_0x2770bc,null));};exports['create']=function(_0x308b0d,_0x214e28){return db[_0x8b45('0x3f')][_0x8b45('0x46')](_0x308b0d[_0x8b45('0x47')],{})[_0x8b45('0x23')](respondWithResult(_0x214e28,0xc9))[_0x8b45('0x42')](handleError(_0x214e28,null));};exports[_0x8b45('0x22')]=function(_0x5e2a03,_0x102d01){if(_0x5e2a03['body']['id']){delete _0x5e2a03[_0x8b45('0x47')]['id'];}return db[_0x8b45('0x3f')][_0x8b45('0x45')]({'where':{'id':_0x5e2a03[_0x8b45('0x48')]['id']}})['then'](handleEntityNotFound(_0x102d01,null))[_0x8b45('0x23')](saveUpdates(_0x5e2a03[_0x8b45('0x47')],null))['then'](respondWithResult(_0x102d01,null))[_0x8b45('0x42')](handleError(_0x102d01,null));};exports[_0x8b45('0x24')]=function(_0x52970c,_0xceb596){return db[_0x8b45('0x3f')][_0x8b45('0x45')]({'where':{'id':_0x52970c[_0x8b45('0x48')]['id']}})[_0x8b45('0x23')](handleEntityNotFound(_0xceb596,null))[_0x8b45('0x23')](removeEntity(_0xceb596,null))['catch'](handleError(_0xceb596,null));};exports['describe']=function(_0x3f7a16,_0x2a2e59){return db[_0x8b45('0x3f')]['describe']()[_0x8b45('0x23')](respondWithResult(_0x2a2e59,null))[_0x8b45('0x42')](handleError(_0x2a2e59,null));}; \ No newline at end of file +var _0x6b8f=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','rows','catch','show','params','keys','find','create','body','describe','rimraf','fast-json-patch','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','apply','reject','save','update','destroy','then','end','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','query','filters','intersection','model'];(function(_0x2f37e0,_0x393ef9){var _0x43ccce=function(_0x318b51){while(--_0x318b51){_0x2f37e0['push'](_0x2f37e0['shift']());}};_0x43ccce(++_0x393ef9);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x240878,_0x2069d2){_0x240878=_0x240878-0x0;var _0x3dce47=_0x6b8f[_0x240878];return _0x3dce47;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf6b8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf6b8('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf6b8('0x2'));var Mustache=require(_0xf6b8('0x3'));var util=require('util');var path=require(_0xf6b8('0x4'));var sox=require(_0xf6b8('0x5'));var csv=require(_0xf6b8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf6b8('0x7'));var _=require(_0xf6b8('0x8'));var squel=require(_0xf6b8('0x9'));var crypto=require(_0xf6b8('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf6b8('0x6'));var querystring=require('querystring');var Papa=require(_0xf6b8('0xb'));var Redis=require(_0xf6b8('0xc'));var authService=require(_0xf6b8('0xd'));var qs=require(_0xf6b8('0xe'));var as=require(_0xf6b8('0xf'));var hardwareService=require(_0xf6b8('0x10'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xf6b8('0x11'));var licenseUtil=require(_0xf6b8('0x12'));var db=require(_0xf6b8('0x13'))['db'];function respondWithStatusCode(_0x1d96b9,_0x5a6118){_0x5a6118=_0x5a6118||0xcc;return function(_0x4e5235){if(_0x4e5235){return _0x1d96b9[_0xf6b8('0x14')](_0x5a6118);}return _0x1d96b9[_0xf6b8('0x15')](_0x5a6118)['end']();};}function respondWithResult(_0xfcecc9,_0x2db10c){_0x2db10c=_0x2db10c||0xc8;return function(_0x454d8a){if(_0x454d8a){return _0xfcecc9['status'](_0x2db10c)[_0xf6b8('0x16')](_0x454d8a);}};}function respondWithFilteredResult(_0x53d744,_0x410345){return function(_0x1ee041){if(_0x1ee041){var _0x2e1748=typeof _0x410345[_0xf6b8('0x17')]===_0xf6b8('0x18')&&typeof _0x410345['limit']==='undefined';var _0x3bb9ae=_0x1ee041['count'];var _0x3cf63c=_0x2e1748?0x0:_0x410345[_0xf6b8('0x17')];var _0x4a93a8=_0x2e1748?_0x1ee041['count']:_0x410345[_0xf6b8('0x17')]+_0x410345[_0xf6b8('0x19')];var _0x3081db;if(_0x4a93a8>=_0x3bb9ae){_0x4a93a8=_0x3bb9ae;_0x3081db=0xc8;}else{_0x3081db=0xce;}_0x53d744[_0xf6b8('0x15')](_0x3081db);return _0x53d744['set']('Content-Range',_0x3cf63c+'-'+_0x4a93a8+'/'+_0x3bb9ae)['json'](_0x1ee041);}return null;};}function patchUpdates(_0x3298a4){return function(_0x2a8195){try{jsonpatch[_0xf6b8('0x1a')](_0x2a8195,_0x3298a4,!![]);}catch(_0x56b48a){return BPromise[_0xf6b8('0x1b')](_0x56b48a);}return _0x2a8195[_0xf6b8('0x1c')]();};}function saveUpdates(_0x3d2c57,_0x9c660c){return function(_0x5dd616){if(_0x5dd616){return _0x5dd616[_0xf6b8('0x1d')](_0x3d2c57)['then'](function(_0x22c52d){return _0x22c52d;});}return null;};}function removeEntity(_0x2b5bd3,_0x13a451){return function(_0x4127c9){if(_0x4127c9){return _0x4127c9[_0xf6b8('0x1e')]()[_0xf6b8('0x1f')](function(){_0x2b5bd3['status'](0xcc)[_0xf6b8('0x20')]();});}};}function handleEntityNotFound(_0x1ebfea,_0x4815f7){return function(_0x205d6c){if(!_0x205d6c){_0x1ebfea[_0xf6b8('0x14')](0x194);}return _0x205d6c;};}function handleError(_0x324057,_0xd5ebb5){_0xd5ebb5=_0xd5ebb5||0x1f4;return function(_0x3365b8){logger['error'](_0x3365b8['stack']);if(_0x3365b8[_0xf6b8('0x21')]){delete _0x3365b8[_0xf6b8('0x21')];}_0x324057['status'](_0xd5ebb5)[_0xf6b8('0x22')](_0x3365b8);};}exports[_0xf6b8('0x23')]=function(_0x888319,_0x5a7f55){var _0x458935={},_0xc958f4={},_0x511896={'count':0x0,'rows':[]};var _0x309f04=_[_0xf6b8('0x24')](db[_0xf6b8('0x25')][_0xf6b8('0x26')],function(_0x51ffcf){return{'name':_0x51ffcf[_0xf6b8('0x27')],'type':_0x51ffcf[_0xf6b8('0x28')][_0xf6b8('0x29')]};});_0xc958f4['model']=_[_0xf6b8('0x24')](_0x309f04,_0xf6b8('0x21'));_0xc958f4[_0xf6b8('0x2a')]=_['keys'](_0x888319[_0xf6b8('0x2a')]);_0xc958f4[_0xf6b8('0x2b')]=_[_0xf6b8('0x2c')](_0xc958f4[_0xf6b8('0x2d')],_0xc958f4['query']);_0x458935[_0xf6b8('0x2e')]=_[_0xf6b8('0x2c')](_0xc958f4[_0xf6b8('0x2d')],qs['fields'](_0x888319['query'][_0xf6b8('0x2f')]));_0x458935[_0xf6b8('0x2e')]=_0x458935[_0xf6b8('0x2e')][_0xf6b8('0x30')]?_0x458935[_0xf6b8('0x2e')]:_0xc958f4[_0xf6b8('0x2d')];if(!_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x31')](_0xf6b8('0x32'))){_0x458935[_0xf6b8('0x19')]=qs[_0xf6b8('0x19')](_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x19')]);_0x458935[_0xf6b8('0x17')]=qs[_0xf6b8('0x17')](_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x17')]);}_0x458935[_0xf6b8('0x33')]=qs['sort'](_0x888319['query'][_0xf6b8('0x34')]);_0x458935[_0xf6b8('0x35')]=qs[_0xf6b8('0x2b')](_[_0xf6b8('0x36')](_0x888319[_0xf6b8('0x2a')],_0xc958f4[_0xf6b8('0x2b')]),_0x309f04);if(_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x37')]){_0x458935[_0xf6b8('0x35')]=_[_0xf6b8('0x38')](_0x458935[_0xf6b8('0x35')],{'$or':_[_0xf6b8('0x24')](_0x309f04,function(_0x4a8c49){if(_0x4a8c49[_0xf6b8('0x28')]!==_0xf6b8('0x39')){var _0x5d26ad={};_0x5d26ad[_0x4a8c49[_0xf6b8('0x21')]]={'$like':'%'+_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x37')]+'%'};return _0x5d26ad;}})});}_0x458935=_[_0xf6b8('0x38')]({},_0x458935,_0x888319[_0xf6b8('0x3a')]);var _0x87a4ee={'where':_0x458935[_0xf6b8('0x35')]};return db[_0xf6b8('0x25')][_0xf6b8('0x3b')](_0x87a4ee)[_0xf6b8('0x1f')](function(_0x15a63b){_0x511896[_0xf6b8('0x3b')]=_0x15a63b;if(_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x3c')]){_0x458935['include']=[{'all':!![]}];}return db['Cdr']['findAll'](_0x458935);})[_0xf6b8('0x1f')](function(_0x2c68f5){_0x511896[_0xf6b8('0x3d')]=_0x2c68f5;return _0x511896;})[_0xf6b8('0x1f')](respondWithFilteredResult(_0x5a7f55,_0x458935))[_0xf6b8('0x3e')](handleError(_0x5a7f55,null));};exports[_0xf6b8('0x3f')]=function(_0x1390dc,_0x48f4cb){var _0x1f5e72={'raw':!![],'where':{'id':_0x1390dc[_0xf6b8('0x40')]['id']}},_0x5086d9={};_0x5086d9[_0xf6b8('0x2d')]=_[_0xf6b8('0x41')](db[_0xf6b8('0x25')][_0xf6b8('0x26')]);_0x5086d9['query']=_[_0xf6b8('0x41')](_0x1390dc[_0xf6b8('0x2a')]);_0x5086d9[_0xf6b8('0x2b')]=_[_0xf6b8('0x2c')](_0x5086d9[_0xf6b8('0x2d')],_0x5086d9['query']);_0x1f5e72[_0xf6b8('0x2e')]=_[_0xf6b8('0x2c')](_0x5086d9[_0xf6b8('0x2d')],qs['fields'](_0x1390dc['query'][_0xf6b8('0x2f')]));_0x1f5e72[_0xf6b8('0x2e')]=_0x1f5e72[_0xf6b8('0x2e')][_0xf6b8('0x30')]?_0x1f5e72['attributes']:_0x5086d9['model'];if(_0x1390dc['query'][_0xf6b8('0x3c')]){_0x1f5e72['include']=[{'all':!![]}];}_0x1f5e72=_[_0xf6b8('0x38')]({},_0x1f5e72,_0x1390dc[_0xf6b8('0x3a')]);return db[_0xf6b8('0x25')][_0xf6b8('0x42')](_0x1f5e72)[_0xf6b8('0x1f')](handleEntityNotFound(_0x48f4cb,null))[_0xf6b8('0x1f')](respondWithResult(_0x48f4cb,null))[_0xf6b8('0x3e')](handleError(_0x48f4cb,null));};exports[_0xf6b8('0x43')]=function(_0x394a34,_0x597511){return db[_0xf6b8('0x25')]['create'](_0x394a34[_0xf6b8('0x44')],{})[_0xf6b8('0x1f')](respondWithResult(_0x597511,0xc9))[_0xf6b8('0x3e')](handleError(_0x597511,null));};exports[_0xf6b8('0x1d')]=function(_0x1abf17,_0x291845){if(_0x1abf17[_0xf6b8('0x44')]['id']){delete _0x1abf17['body']['id'];}return db[_0xf6b8('0x25')][_0xf6b8('0x42')]({'where':{'id':_0x1abf17[_0xf6b8('0x40')]['id']}})[_0xf6b8('0x1f')](handleEntityNotFound(_0x291845,null))['then'](saveUpdates(_0x1abf17[_0xf6b8('0x44')],null))[_0xf6b8('0x1f')](respondWithResult(_0x291845,null))['catch'](handleError(_0x291845,null));};exports[_0xf6b8('0x1e')]=function(_0x143164,_0x392582){return db[_0xf6b8('0x25')][_0xf6b8('0x42')]({'where':{'id':_0x143164['params']['id']}})[_0xf6b8('0x1f')](handleEntityNotFound(_0x392582,null))[_0xf6b8('0x1f')](removeEntity(_0x392582,null))['catch'](handleError(_0x392582,null));};exports['describe']=function(_0x55c392,_0x22c1eb){return db[_0xf6b8('0x25')][_0xf6b8('0x45')]()[_0xf6b8('0x1f')](respondWithResult(_0x22c1eb,null))['catch'](handleError(_0x22c1eb,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 81a6ba9..a6a4df2 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x488723,_0x1bba3b){var _0x517a0c=function(_0x186eae){while(--_0x186eae){_0x488723['push'](_0x488723['shift']());}};_0x517a0c(++_0x1bba3b);}(_0x7a54,0x106));var _0x47a5=function(_0x4acff3,_0x5bc3e9){_0x4acff3=_0x4acff3-0x0;var _0x21f9b1=_0x7a54[_0x4acff3];return _0x21f9b1;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x42a3c3,_0x5b5a81){var _0x18101c=function(_0x4c7312){while(--_0x4c7312){_0x42a3c3['push'](_0x42a3c3['shift']());}};_0x18101c(++_0x5b5a81);}(_0x7a54,0x106));var _0x47a5=function(_0x24eb62,_0x33e2d4){_0x24eb62=_0x24eb62-0x0;var _0x392d2f=_0x7a54[_0x24eb62];return _0x392d2f;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index a11a185..c25058e 100644 --- a/server/api/cdr/cdr.rpc.js +++ b/server/api/cdr/cdr.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x093e=['../../config/environment','client','http','request','then','info','Cdr,\x20%s,\x20%s','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0x093e,0x149));var _0xe093=function(_0x13ec46,_0x44efb1){_0x13ec46=_0x13ec46-0x0;var _0x17ab99=_0x093e[_0x13ec46];return _0x17ab99;};'use strict';var _=require(_0xe093('0x0'));var util=require(_0xe093('0x1'));var moment=require(_0xe093('0x2'));var BPromise=require(_0xe093('0x3'));var rs=require(_0xe093('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe093('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe093('0x6'))('rpc');var config=require(_0xe093('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe093('0x8')][_0xe093('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x358381,_0x239097,_0x21cfc3){return new BPromise(function(_0x2c59f3,_0x2f0ea9){return client[_0xe093('0xa')](_0x358381,_0x21cfc3)[_0xe093('0xb')](function(_0x45e7bb){logger[_0xe093('0xc')](_0xe093('0xd'),_0x239097,'request\x20sent');logger['debug'](_0xe093('0xe'),_0x239097,'request\x20sent',JSON[_0xe093('0xf')](_0x45e7bb));if(_0x45e7bb[_0xe093('0x10')]){if(_0x45e7bb[_0xe093('0x10')][_0xe093('0x11')]===0x1f4){logger[_0xe093('0x10')](_0xe093('0xd'),_0x239097,_0x45e7bb[_0xe093('0x10')][_0xe093('0x12')]);return _0x2f0ea9(_0x45e7bb[_0xe093('0x10')][_0xe093('0x12')]);}logger['error'](_0xe093('0xd'),_0x239097,_0x45e7bb[_0xe093('0x10')][_0xe093('0x12')]);return _0x2c59f3(_0x45e7bb[_0xe093('0x10')][_0xe093('0x12')]);}else{logger[_0xe093('0xc')](_0xe093('0xd'),_0x239097,_0xe093('0x13'));_0x2c59f3(_0x45e7bb['result'][_0xe093('0x12')]);}})[_0xe093('0x14')](function(_0x3b943c){logger[_0xe093('0x10')]('Cdr,\x20%s,\x20%s',_0x239097,_0x3b943c);_0x2f0ea9(_0x3b943c);});});} \ No newline at end of file +var _0x30ea=['result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','message','info'];(function(_0x6799a,_0x55da52){var _0x1bae93=function(_0x2168f3){while(--_0x2168f3){_0x6799a['push'](_0x6799a['shift']());}};_0x1bae93(++_0x55da52);}(_0x30ea,0xe9));var _0xa30e=function(_0x98eab9,_0x1f2132){_0x98eab9=_0x98eab9-0x0;var _0x238daa=_0x30ea[_0x98eab9];return _0x238daa;};'use strict';var _=require(_0xa30e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa30e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa30e('0x2'));var db=require(_0xa30e('0x3'))['db'];var utils=require(_0xa30e('0x4'));var logger=require(_0xa30e('0x5'))('rpc');var config=require(_0xa30e('0x6'));var jayson=require(_0xa30e('0x7'));var client=jayson[_0xa30e('0x8')][_0xa30e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x58b5ad,_0x6b0b6f,_0x3b2be2){return new BPromise(function(_0x10e36e,_0x3e40d3){return client[_0xa30e('0xa')](_0x58b5ad,_0x3b2be2)[_0xa30e('0xb')](function(_0x349c38){logger['info'](_0xa30e('0xc'),_0x6b0b6f,_0xa30e('0xd'));logger[_0xa30e('0xe')](_0xa30e('0xf'),_0x6b0b6f,_0xa30e('0xd'),JSON['stringify'](_0x349c38));if(_0x349c38[_0xa30e('0x10')]){if(_0x349c38[_0xa30e('0x10')]['code']===0x1f4){logger['error'](_0xa30e('0xc'),_0x6b0b6f,_0x349c38[_0xa30e('0x10')][_0xa30e('0x11')]);return _0x3e40d3(_0x349c38[_0xa30e('0x10')][_0xa30e('0x11')]);}logger[_0xa30e('0x10')]('Cdr,\x20%s,\x20%s',_0x6b0b6f,_0x349c38[_0xa30e('0x10')][_0xa30e('0x11')]);return _0x10e36e(_0x349c38[_0xa30e('0x10')][_0xa30e('0x11')]);}else{logger[_0xa30e('0x12')](_0xa30e('0xc'),_0x6b0b6f,_0xa30e('0xd'));_0x10e36e(_0x349c38[_0xa30e('0x13')][_0xa30e('0x11')]);}})[_0xa30e('0x14')](function(_0x4fe9e3){logger[_0xa30e('0x10')]('Cdr,\x20%s,\x20%s',_0x6b0b6f,_0x4fe9e3);_0x3e40d3(_0x4fe9e3);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 82601da..ae4b745 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x2c1859,_0x1a3db0){var _0x3663aa=function(_0x3bd0d1){while(--_0x3bd0d1){_0x2c1859['push'](_0x2c1859['shift']());}};_0x3663aa(++_0x1a3db0);}(_0xb10b,0x12a));var _0xbb10=function(_0x98ac1f,_0x2effb0){_0x98ac1f=_0x98ac1f-0x0;var _0x1579d1=_0xb10b[_0x98ac1f];return _0x1579d1;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file +var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 757ca82..a3e7fce 100644 --- a/server/api/chatApplication/chatApplication.attributes.js +++ b/server/api/chatApplication/chatApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4f9e=['STRING','TEXT','*,*,*,*','sequelize','exports'];(function(_0x332026,_0x16c26f){var _0x34064d=function(_0x5e57ef){while(--_0x5e57ef){_0x332026['push'](_0x332026['shift']());}};_0x34064d(++_0x16c26f);}(_0x4f9e,0x99));var _0xe4f9=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x4f9e[_0x278e3c];return _0x3e2d9b;};'use strict';var Sequelize=require(_0xe4f9('0x0'));module[_0xe4f9('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xe4f9('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xe4f9('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xe4f9('0x4')}}; \ No newline at end of file +var _0x24e1=['*,*,*,*','sequelize','STRING','noop','TEXT'];(function(_0x51ffd6,_0xc0533a){var _0x9c28=function(_0x5325bf){while(--_0x5325bf){_0x51ffd6['push'](_0x51ffd6['shift']());}};_0x9c28(++_0xc0533a);}(_0x24e1,0xd8));var _0x124e=function(_0x3be7fb,_0x3f4f3f){_0x3be7fb=_0x3be7fb-0x0;var _0x2f6f14=_0x24e1[_0x3be7fb];return _0x2f6f14;};'use strict';var Sequelize=require(_0x124e('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x124e('0x1')],'allowNull':![],'defaultValue':_0x124e('0x2')},'appdata':{'type':Sequelize[_0x124e('0x3')]()},'description':{'type':Sequelize[_0x124e('0x1')]},'interval':{'type':Sequelize[_0x124e('0x1')],'defaultValue':_0x124e('0x4')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 66b19df..6839b47 100644 --- a/server/api/chatApplication/chatApplication.controller.js +++ b/server/api/chatApplication/chatApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc7ea=['request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','name','send','show','params','model','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','merge','options','find','catch','body','eml-format','rimraf','fast-json-patch'];(function(_0x55e5cb,_0x3d0213){var _0x4a8ea1=function(_0xab0a29){while(--_0xab0a29){_0x55e5cb['push'](_0x55e5cb['shift']());}};_0x4a8ea1(++_0x3d0213);}(_0xc7ea,0x171));var _0xac7e=function(_0x562cc9,_0x1cb01e){_0x562cc9=_0x562cc9-0x0;var _0x5ddbf8=_0xc7ea[_0x562cc9];return _0x5ddbf8;};'use strict';var emlformat=require(_0xac7e('0x0'));var rimraf=require(_0xac7e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xac7e('0x2'));var rp=require(_0xac7e('0x3'));var moment=require(_0xac7e('0x4'));var BPromise=require(_0xac7e('0x5'));var Mustache=require('mustache');var util=require(_0xac7e('0x6'));var path=require(_0xac7e('0x7'));var sox=require(_0xac7e('0x8'));var csv=require(_0xac7e('0x9'));var ejs=require(_0xac7e('0xa'));var fs=require('fs');var fs_extra=require(_0xac7e('0xb'));var _=require(_0xac7e('0xc'));var squel=require(_0xac7e('0xd'));var crypto=require(_0xac7e('0xe'));var jsforce=require(_0xac7e('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xac7e('0x9'));var querystring=require(_0xac7e('0x10'));var Papa=require(_0xac7e('0x11'));var Redis=require(_0xac7e('0x12'));var authService=require(_0xac7e('0x13'));var qs=require(_0xac7e('0x14'));var as=require(_0xac7e('0x15'));var hardwareService=require(_0xac7e('0x16'));var logger=require(_0xac7e('0x17'))(_0xac7e('0x18'));var utils=require(_0xac7e('0x19'));var config=require(_0xac7e('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xac7e('0x1b'))['db'];function respondWithStatusCode(_0x13e126,_0x5d4537){_0x5d4537=_0x5d4537||0xcc;return function(_0x617cf9){if(_0x617cf9){return _0x13e126[_0xac7e('0x1c')](_0x5d4537);}return _0x13e126[_0xac7e('0x1d')](_0x5d4537)[_0xac7e('0x1e')]();};}function respondWithResult(_0x31a8e7,_0x52be09){_0x52be09=_0x52be09||0xc8;return function(_0x3486ac){if(_0x3486ac){return _0x31a8e7[_0xac7e('0x1d')](_0x52be09)[_0xac7e('0x1f')](_0x3486ac);}};}function respondWithFilteredResult(_0x41c055,_0x333436){return function(_0x232ce5){if(_0x232ce5){var _0x7ee114=typeof _0x333436[_0xac7e('0x20')]==='undefined'&&typeof _0x333436[_0xac7e('0x21')]===_0xac7e('0x22');var _0x95f21c=_0x232ce5[_0xac7e('0x23')];var _0x242889=_0x7ee114?0x0:_0x333436['offset'];var _0x2be7d7=_0x7ee114?_0x232ce5['count']:_0x333436[_0xac7e('0x20')]+_0x333436['limit'];var _0xa048e9;if(_0x2be7d7>=_0x95f21c){_0x2be7d7=_0x95f21c;_0xa048e9=0xc8;}else{_0xa048e9=0xce;}_0x41c055[_0xac7e('0x1d')](_0xa048e9);return _0x41c055[_0xac7e('0x24')](_0xac7e('0x25'),_0x242889+'-'+_0x2be7d7+'/'+_0x95f21c)[_0xac7e('0x1f')](_0x232ce5);}return null;};}function patchUpdates(_0x2ad784){return function(_0x4d23f9){try{jsonpatch[_0xac7e('0x26')](_0x4d23f9,_0x2ad784,!![]);}catch(_0x3c177d){return BPromise['reject'](_0x3c177d);}return _0x4d23f9[_0xac7e('0x27')]();};}function saveUpdates(_0x2ebc78,_0x2c3b6e){return function(_0x3ce3cc){if(_0x3ce3cc){return _0x3ce3cc[_0xac7e('0x28')](_0x2ebc78)[_0xac7e('0x29')](function(_0x45f7b6){return _0x45f7b6;});}return null;};}function removeEntity(_0x57abe8,_0x2b5f43){return function(_0x32ef52){if(_0x32ef52){return _0x32ef52[_0xac7e('0x2a')]()['then'](function(){_0x57abe8['status'](0xcc)[_0xac7e('0x1e')]();});}};}function handleEntityNotFound(_0x1ae3b4,_0x4620da){return function(_0x50b1e5){if(!_0x50b1e5){_0x1ae3b4[_0xac7e('0x1c')](0x194);}return _0x50b1e5;};}function handleError(_0x1de558,_0x2cafcb){_0x2cafcb=_0x2cafcb||0x1f4;return function(_0x3e0f1a){logger['error'](_0x3e0f1a['stack']);if(_0x3e0f1a[_0xac7e('0x2b')]){delete _0x3e0f1a['name'];}_0x1de558['status'](_0x2cafcb)[_0xac7e('0x2c')](_0x3e0f1a);};}exports[_0xac7e('0x2d')]=function(_0x3ecfc1,_0x4864d1){var _0x224259={'raw':!![],'where':{'id':_0x3ecfc1[_0xac7e('0x2e')]['id']}},_0x376247={};_0x376247[_0xac7e('0x2f')]=_['keys'](db[_0xac7e('0x30')][_0xac7e('0x31')]);_0x376247[_0xac7e('0x32')]=_['keys'](_0x3ecfc1[_0xac7e('0x32')]);_0x376247[_0xac7e('0x33')]=_[_0xac7e('0x34')](_0x376247[_0xac7e('0x2f')],_0x376247['query']);_0x224259[_0xac7e('0x35')]=_['intersection'](_0x376247[_0xac7e('0x2f')],qs[_0xac7e('0x36')](_0x3ecfc1[_0xac7e('0x32')]['fields']));_0x224259[_0xac7e('0x35')]=_0x224259[_0xac7e('0x35')]['length']?_0x224259['attributes']:_0x376247[_0xac7e('0x2f')];if(_0x3ecfc1[_0xac7e('0x32')][_0xac7e('0x37')]){_0x224259[_0xac7e('0x38')]=[{'all':!![]}];}_0x224259=_[_0xac7e('0x39')]({},_0x224259,_0x3ecfc1[_0xac7e('0x3a')]);return db[_0xac7e('0x30')][_0xac7e('0x3b')](_0x224259)[_0xac7e('0x29')](handleEntityNotFound(_0x4864d1,null))['then'](respondWithResult(_0x4864d1,null))[_0xac7e('0x3c')](handleError(_0x4864d1,null));};exports[_0xac7e('0x28')]=function(_0x1e3cc4,_0x38d61e){if(_0x1e3cc4[_0xac7e('0x3d')]['id']){delete _0x1e3cc4[_0xac7e('0x3d')]['id'];}return db['ChatApplication']['find']({'where':{'id':_0x1e3cc4[_0xac7e('0x2e')]['id']}})[_0xac7e('0x29')](handleEntityNotFound(_0x38d61e,null))[_0xac7e('0x29')](saveUpdates(_0x1e3cc4[_0xac7e('0x3d')],null))[_0xac7e('0x29')](respondWithResult(_0x38d61e,null))[_0xac7e('0x3c')](handleError(_0x38d61e,null));};exports[_0xac7e('0x2a')]=function(_0x2160cd,_0xacc6b9){return db['ChatApplication'][_0xac7e('0x3b')]({'where':{'id':_0x2160cd[_0xac7e('0x2e')]['id']}})['then'](handleEntityNotFound(_0xacc6b9,null))[_0xac7e('0x29')](removeEntity(_0xacc6b9,null))[_0xac7e('0x3c')](handleError(_0xacc6b9,null));}; \ No newline at end of file +var _0xf69b=['apply','reject','update','then','destroy','sendStatus','error','stack','name','show','params','model','ChatApplication','rawAttributes','intersection','attributes','fields','length','query','includeAll','include','merge','options','find','catch','body','rimraf','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','Content-Range'];(function(_0x52ff2e,_0x392a70){var _0x903697=function(_0xa67638){while(--_0xa67638){_0x52ff2e['push'](_0x52ff2e['shift']());}};_0x903697(++_0x392a70);}(_0xf69b,0xc8));var _0xbf69=function(_0x44bb25,_0x11524d){_0x44bb25=_0x44bb25-0x0;var _0x55a226=_0xf69b[_0x44bb25];return _0x55a226;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbf69('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbf69('0x1'));var rp=require('request-promise');var moment=require(_0xbf69('0x2'));var BPromise=require(_0xbf69('0x3'));var Mustache=require(_0xbf69('0x4'));var util=require('util');var path=require(_0xbf69('0x5'));var sox=require('sox');var csv=require(_0xbf69('0x6'));var ejs=require(_0xbf69('0x7'));var fs=require('fs');var fs_extra=require(_0xbf69('0x8'));var _=require(_0xbf69('0x9'));var squel=require(_0xbf69('0xa'));var crypto=require(_0xbf69('0xb'));var jsforce=require(_0xbf69('0xc'));var deskjs=require(_0xbf69('0xd'));var toCsv=require(_0xbf69('0x6'));var querystring=require(_0xbf69('0xe'));var Papa=require('papaparse');var Redis=require(_0xbf69('0xf'));var authService=require(_0xbf69('0x10'));var qs=require(_0xbf69('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbf69('0x12'));var logger=require(_0xbf69('0x13'))(_0xbf69('0x14'));var utils=require(_0xbf69('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xbf69('0x16'));var db=require(_0xbf69('0x17'))['db'];function respondWithStatusCode(_0x2edf93,_0x980232){_0x980232=_0x980232||0xcc;return function(_0x294fdb){if(_0x294fdb){return _0x2edf93['sendStatus'](_0x980232);}return _0x2edf93['status'](_0x980232)[_0xbf69('0x18')]();};}function respondWithResult(_0x514f81,_0x4d858a){_0x4d858a=_0x4d858a||0xc8;return function(_0x4bd76d){if(_0x4bd76d){return _0x514f81[_0xbf69('0x19')](_0x4d858a)[_0xbf69('0x1a')](_0x4bd76d);}};}function respondWithFilteredResult(_0x87c8a9,_0x4a44a5){return function(_0x1b7412){if(_0x1b7412){var _0x301fe7=typeof _0x4a44a5[_0xbf69('0x1b')]===_0xbf69('0x1c')&&typeof _0x4a44a5[_0xbf69('0x1d')]===_0xbf69('0x1c');var _0x342883=_0x1b7412[_0xbf69('0x1e')];var _0x307fbb=_0x301fe7?0x0:_0x4a44a5[_0xbf69('0x1b')];var _0x41e749=_0x301fe7?_0x1b7412[_0xbf69('0x1e')]:_0x4a44a5[_0xbf69('0x1b')]+_0x4a44a5[_0xbf69('0x1d')];var _0x191972;if(_0x41e749>=_0x342883){_0x41e749=_0x342883;_0x191972=0xc8;}else{_0x191972=0xce;}_0x87c8a9[_0xbf69('0x19')](_0x191972);return _0x87c8a9['set'](_0xbf69('0x1f'),_0x307fbb+'-'+_0x41e749+'/'+_0x342883)[_0xbf69('0x1a')](_0x1b7412);}return null;};}function patchUpdates(_0x331a3c){return function(_0x4998b7){try{jsonpatch[_0xbf69('0x20')](_0x4998b7,_0x331a3c,!![]);}catch(_0x3fcfd9){return BPromise[_0xbf69('0x21')](_0x3fcfd9);}return _0x4998b7['save']();};}function saveUpdates(_0x4cb86f,_0xc75cf){return function(_0x1e5cf1){if(_0x1e5cf1){return _0x1e5cf1[_0xbf69('0x22')](_0x4cb86f)[_0xbf69('0x23')](function(_0x3e0f36){return _0x3e0f36;});}return null;};}function removeEntity(_0x5de824,_0x14b4b0){return function(_0x49edb3){if(_0x49edb3){return _0x49edb3[_0xbf69('0x24')]()['then'](function(){_0x5de824[_0xbf69('0x19')](0xcc)[_0xbf69('0x18')]();});}};}function handleEntityNotFound(_0x10b9c0,_0x276a00){return function(_0x23bef3){if(!_0x23bef3){_0x10b9c0[_0xbf69('0x25')](0x194);}return _0x23bef3;};}function handleError(_0x1ff38b,_0xfb7055){_0xfb7055=_0xfb7055||0x1f4;return function(_0x7ad809){logger[_0xbf69('0x26')](_0x7ad809[_0xbf69('0x27')]);if(_0x7ad809[_0xbf69('0x28')]){delete _0x7ad809[_0xbf69('0x28')];}_0x1ff38b[_0xbf69('0x19')](_0xfb7055)['send'](_0x7ad809);};}exports[_0xbf69('0x29')]=function(_0x3c8f0a,_0x36c8e5){var _0x320585={'raw':!![],'where':{'id':_0x3c8f0a[_0xbf69('0x2a')]['id']}},_0x1711f7={};_0x1711f7[_0xbf69('0x2b')]=_['keys'](db[_0xbf69('0x2c')][_0xbf69('0x2d')]);_0x1711f7['query']=_['keys'](_0x3c8f0a['query']);_0x1711f7['filters']=_[_0xbf69('0x2e')](_0x1711f7[_0xbf69('0x2b')],_0x1711f7['query']);_0x320585[_0xbf69('0x2f')]=_[_0xbf69('0x2e')](_0x1711f7[_0xbf69('0x2b')],qs['fields'](_0x3c8f0a['query'][_0xbf69('0x30')]));_0x320585[_0xbf69('0x2f')]=_0x320585[_0xbf69('0x2f')][_0xbf69('0x31')]?_0x320585['attributes']:_0x1711f7[_0xbf69('0x2b')];if(_0x3c8f0a[_0xbf69('0x32')][_0xbf69('0x33')]){_0x320585[_0xbf69('0x34')]=[{'all':!![]}];}_0x320585=_[_0xbf69('0x35')]({},_0x320585,_0x3c8f0a[_0xbf69('0x36')]);return db[_0xbf69('0x2c')][_0xbf69('0x37')](_0x320585)['then'](handleEntityNotFound(_0x36c8e5,null))[_0xbf69('0x23')](respondWithResult(_0x36c8e5,null))[_0xbf69('0x38')](handleError(_0x36c8e5,null));};exports[_0xbf69('0x22')]=function(_0x5c41d7,_0x17ed4d){if(_0x5c41d7['body']['id']){delete _0x5c41d7['body']['id'];}return db[_0xbf69('0x2c')][_0xbf69('0x37')]({'where':{'id':_0x5c41d7['params']['id']}})['then'](handleEntityNotFound(_0x17ed4d,null))[_0xbf69('0x23')](saveUpdates(_0x5c41d7[_0xbf69('0x39')],null))[_0xbf69('0x23')](respondWithResult(_0x17ed4d,null))['catch'](handleError(_0x17ed4d,null));};exports[_0xbf69('0x24')]=function(_0x5908ed,_0x179971){return db['ChatApplication'][_0xbf69('0x37')]({'where':{'id':_0x5908ed['params']['id']}})['then'](handleEntityNotFound(_0x179971,null))[_0xbf69('0x23')](removeEntity(_0x179971,null))[_0xbf69('0x38')](handleError(_0x179971,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 042c636..88d5b73 100644 --- a/server/api/chatApplication/chatApplication.model.js +++ b/server/api/chatApplication/chatApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x42cf=['moment','request-promise','rimraf','../../config/environment','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x42cf,0x11f));var _0xf42c=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x42cf[_0x4a53d];return _0x27410e;};'use strict';var _=require(_0xf42c('0x0'));var util=require(_0xf42c('0x1'));var logger=require('../../config/logger')(_0xf42c('0x2'));var moment=require(_0xf42c('0x3'));var BPromise=require('bluebird');var rp=require(_0xf42c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf42c('0x5'));var config=require(_0xf42c('0x6'));var attributes=require('./chatApplication.attributes');module['exports']=function(_0x1cb366,_0x51292c){return _0x1cb366[_0xf42c('0x7')]('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf42c('0x8'),'collate':_0xf42c('0x9')});}; \ No newline at end of file +var _0x0775=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications'];(function(_0x31e9b3,_0x39bc9b){var _0x3e7890=function(_0x4ec306){while(--_0x4ec306){_0x31e9b3['push'](_0x31e9b3['shift']());}};_0x3e7890(++_0x39bc9b);}(_0x0775,0x92));var _0x5077=function(_0x14a69f,_0x159b4e){_0x14a69f=_0x14a69f-0x0;var _0x4d542c=_0x0775[_0x14a69f];return _0x4d542c;};'use strict';var _=require(_0x5077('0x0'));var util=require(_0x5077('0x1'));var logger=require(_0x5077('0x2'))(_0x5077('0x3'));var moment=require(_0x5077('0x4'));var BPromise=require(_0x5077('0x5'));var rp=require(_0x5077('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5077('0x7'));var config=require(_0x5077('0x8'));var attributes=require(_0x5077('0x9'));module[_0x5077('0xa')]=function(_0xa0b89a,_0xecb868){return _0xa0b89a[_0x5077('0xb')](_0x5077('0xc'),attributes,{'tableName':_0x5077('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5077('0xe'),'collate':_0x5077('0xf')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index ae91ace..13ba2ab 100644 --- a/server/api/chatApplication/chatApplication.rpc.js +++ b/server/api/chatApplication/chatApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb8b6=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util'];(function(_0x6e420a,_0x2b93e2){var _0x115b00=function(_0x13e07a){while(--_0x13e07a){_0x6e420a['push'](_0x6e420a['shift']());}};_0x115b00(++_0x2b93e2);}(_0xb8b6,0x107));var _0x6b8b=function(_0x71d4a,_0x275eb3){_0x71d4a=_0x71d4a-0x0;var _0x1bff75=_0xb8b6[_0x71d4a];return _0x1bff75;};'use strict';var _=require('lodash');var util=require(_0x6b8b('0x0'));var moment=require(_0x6b8b('0x1'));var BPromise=require(_0x6b8b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6b8b('0x3'));var db=require(_0x6b8b('0x4'))['db'];var utils=require(_0x6b8b('0x5'));var logger=require('../../config/logger')(_0x6b8b('0x6'));var config=require(_0x6b8b('0x7'));var jayson=require(_0x6b8b('0x8'));var client=jayson[_0x6b8b('0x9')][_0x6b8b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x342902,_0x1e9725,_0x4d2ab4){return new BPromise(function(_0x483e12,_0x2fcc5e){return client[_0x6b8b('0xb')](_0x342902,_0x4d2ab4)['then'](function(_0x5b890c){logger[_0x6b8b('0xc')](_0x6b8b('0xd'),_0x1e9725,_0x6b8b('0xe'));logger[_0x6b8b('0xf')](_0x6b8b('0x10'),_0x1e9725,'request\x20sent',JSON[_0x6b8b('0x11')](_0x5b890c));if(_0x5b890c[_0x6b8b('0x12')]){if(_0x5b890c[_0x6b8b('0x12')][_0x6b8b('0x13')]===0x1f4){logger[_0x6b8b('0x12')]('ChatApplication,\x20%s,\x20%s',_0x1e9725,_0x5b890c[_0x6b8b('0x12')]['message']);return _0x2fcc5e(_0x5b890c[_0x6b8b('0x12')][_0x6b8b('0x14')]);}logger[_0x6b8b('0x12')](_0x6b8b('0xd'),_0x1e9725,_0x5b890c['error'][_0x6b8b('0x14')]);return _0x483e12(_0x5b890c[_0x6b8b('0x12')]['message']);}else{logger[_0x6b8b('0xc')]('ChatApplication,\x20%s,\x20%s',_0x1e9725,'request\x20sent');_0x483e12(_0x5b890c[_0x6b8b('0x15')][_0x6b8b('0x14')]);}})['catch'](function(_0x5c9662){logger[_0x6b8b('0x12')](_0x6b8b('0xd'),_0x1e9725,_0x5c9662);_0x2fcc5e(_0x5c9662);});});} \ No newline at end of file +var _0x2d83=['jayson/promise','http','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x334627,_0x116072){var _0x53fddf=function(_0x1c3698){while(--_0x1c3698){_0x334627['push'](_0x334627['shift']());}};_0x53fddf(++_0x116072);}(_0x2d83,0x1f1));var _0x32d8=function(_0x5d9f13,_0x38cc73){_0x5d9f13=_0x5d9f13-0x0;var _0x3745d3=_0x2d83[_0x5d9f13];return _0x3745d3;};'use strict';var _=require(_0x32d8('0x0'));var util=require(_0x32d8('0x1'));var moment=require(_0x32d8('0x2'));var BPromise=require(_0x32d8('0x3'));var rs=require(_0x32d8('0x4'));var fs=require('fs');var Redis=require(_0x32d8('0x5'));var db=require(_0x32d8('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x32d8('0x7'))(_0x32d8('0x8'));var config=require('../../config/environment');var jayson=require(_0x32d8('0x9'));var client=jayson['client'][_0x32d8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe94500,_0x3e28f8,_0x4e7e2c){return new BPromise(function(_0x768f22,_0x1c6d63){return client[_0x32d8('0xb')](_0xe94500,_0x4e7e2c)[_0x32d8('0xc')](function(_0xdd730b){logger['info'](_0x32d8('0xd'),_0x3e28f8,_0x32d8('0xe'));logger['debug'](_0x32d8('0xf'),_0x3e28f8,_0x32d8('0xe'),JSON[_0x32d8('0x10')](_0xdd730b));if(_0xdd730b[_0x32d8('0x11')]){if(_0xdd730b['error']['code']===0x1f4){logger[_0x32d8('0x11')]('ChatApplication,\x20%s,\x20%s',_0x3e28f8,_0xdd730b['error'][_0x32d8('0x12')]);return _0x1c6d63(_0xdd730b['error'][_0x32d8('0x12')]);}logger['error'](_0x32d8('0xd'),_0x3e28f8,_0xdd730b[_0x32d8('0x11')][_0x32d8('0x12')]);return _0x768f22(_0xdd730b[_0x32d8('0x11')][_0x32d8('0x12')]);}else{logger[_0x32d8('0x13')](_0x32d8('0xd'),_0x3e28f8,'request\x20sent');_0x768f22(_0xdd730b[_0x32d8('0x14')]['message']);}})[_0x32d8('0x15')](function(_0x579098){logger[_0x32d8('0x11')](_0x32d8('0xd'),_0x3e28f8,_0x579098);_0x1c6d63(_0x579098);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 6cc1a2e..de1e5c5 100644 --- a/server/api/chatApplication/index.js +++ b/server/api/chatApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x200b=['Router','fs-extra','../../components/interaction/service','get','isAuthenticated','show','put','update','/:id','destroy','exports','multer','util','connect-timeout','express'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x200b,0x173));var _0xb200=function(_0x4e28db,_0x4ab3b5){_0x4e28db=_0x4e28db-0x0;var _0x5b4e65=_0x200b[_0x4e28db];return _0x5b4e65;};'use strict';var multer=require(_0xb200('0x0'));var util=require(_0xb200('0x1'));var path=require('path');var timeout=require(_0xb200('0x2'));var express=require(_0xb200('0x3'));var router=express[_0xb200('0x4')]();var fs_extra=require(_0xb200('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb200('0x6'));var config=require('../../config/environment');var controller=require('./chatApplication.controller');router[_0xb200('0x7')]('/:id',auth[_0xb200('0x8')](),controller[_0xb200('0x9')]);router[_0xb200('0xa')]('/:id',auth[_0xb200('0x8')](),controller[_0xb200('0xb')]);router['delete'](_0xb200('0xc'),auth['isAuthenticated'](),controller[_0xb200('0xd')]);module[_0xb200('0xe')]=router; \ No newline at end of file +var _0x9dbe=['update','delete','destroy','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','put'];(function(_0x34d346,_0x4c6502){var _0x122d76=function(_0x22a5fd){while(--_0x22a5fd){_0x34d346['push'](_0x34d346['shift']());}};_0x122d76(++_0x4c6502);}(_0x9dbe,0x1b0));var _0xe9db=function(_0x4a0ebf,_0x55ba40){_0x4a0ebf=_0x4a0ebf-0x0;var _0x181f1e=_0x9dbe[_0x4a0ebf];return _0x181f1e;};'use strict';var multer=require('multer');var util=require(_0xe9db('0x0'));var path=require('path');var timeout=require(_0xe9db('0x1'));var express=require('express');var router=express[_0xe9db('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xe9db('0x3'));var interaction=require(_0xe9db('0x4'));var config=require(_0xe9db('0x5'));var controller=require('./chatApplication.controller');router[_0xe9db('0x6')](_0xe9db('0x7'),auth[_0xe9db('0x8')](),controller['show']);router[_0xe9db('0x9')](_0xe9db('0x7'),auth['isAuthenticated'](),controller[_0xe9db('0xa')]);router[_0xe9db('0xb')](_0xe9db('0x7'),auth[_0xe9db('0x8')](),controller[_0xe9db('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index c9f272b..4c8d482 100644 --- a/server/api/chatGroup/chatGroup.attributes.js +++ b/server/api/chatGroup/chatGroup.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7b84=['exports','STRING','sequelize'];(function(_0x4e9274,_0x49576e){var _0x8b474c=function(_0x204cca){while(--_0x204cca){_0x4e9274['push'](_0x4e9274['shift']());}};_0x8b474c(++_0x49576e);}(_0x7b84,0x167));var _0x47b8=function(_0x4e3a9c,_0x421cf8){_0x4e3a9c=_0x4e3a9c-0x0;var _0x116527=_0x7b84[_0x4e3a9c];return _0x116527;};'use strict';var Sequelize=require(_0x47b8('0x0'));module[_0x47b8('0x1')]={'name':{'type':Sequelize[_0x47b8('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xf39c=['STRING','sequelize','exports'];(function(_0x7db8aa,_0x4e5012){var _0x4e79af=function(_0x3a8070){while(--_0x3a8070){_0x7db8aa['push'](_0x7db8aa['shift']());}};_0x4e79af(++_0x4e5012);}(_0xf39c,0x16c));var _0xcf39=function(_0x2702b3,_0x4292f4){_0x2702b3=_0x2702b3-0x0;var _0x3c4731=_0xf39c[_0x2702b3];return _0x3c4731;};'use strict';var Sequelize=require(_0xcf39('0x0'));module[_0xcf39('0x1')]={'name':{'type':Sequelize[_0xcf39('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xcf39('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 2197c9f..52b70fc 100644 --- a/server/api/chatGroup/chatGroup.controller.js +++ b/server/api/chatGroup/chatGroup.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c06=['findOne','ChatInternalMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','catch','params','find','create','body','describe','getUnread','user','addMembers','ids','omit','getMembers','User','removeMembers','ChatGroupId','getMessages'];(function(_0x3c4a5d,_0x28c1c8){var _0x31b36a=function(_0x3a3634){while(--_0x3a3634){_0x3c4a5d['push'](_0x3c4a5d['shift']());}};_0x31b36a(++_0x28c1c8);}(_0x1c06,0xce));var _0x61c0=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x1c06[_0x4baae2];return _0x1a2285;};'use strict';var emlformat=require(_0x61c0('0x0'));var rimraf=require(_0x61c0('0x1'));var zipdir=require(_0x61c0('0x2'));var jsonpatch=require(_0x61c0('0x3'));var rp=require(_0x61c0('0x4'));var moment=require(_0x61c0('0x5'));var BPromise=require(_0x61c0('0x6'));var Mustache=require(_0x61c0('0x7'));var util=require(_0x61c0('0x8'));var path=require(_0x61c0('0x9'));var sox=require('sox');var csv=require(_0x61c0('0xa'));var ejs=require(_0x61c0('0xb'));var fs=require('fs');var fs_extra=require(_0x61c0('0xc'));var _=require(_0x61c0('0xd'));var squel=require(_0x61c0('0xe'));var crypto=require(_0x61c0('0xf'));var jsforce=require(_0x61c0('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x61c0('0xa'));var querystring=require(_0x61c0('0x11'));var Papa=require(_0x61c0('0x12'));var Redis=require(_0x61c0('0x13'));var authService=require(_0x61c0('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x61c0('0x15'));var hardwareService=require(_0x61c0('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x61c0('0x17'));var config=require(_0x61c0('0x18'));var licenseUtil=require(_0x61c0('0x19'));var db=require(_0x61c0('0x1a'))['db'];config['redis']=_[_0x61c0('0x1b')](config[_0x61c0('0x1c')],{'host':_0x61c0('0x1d'),'port':0x18eb});var socket=require(_0x61c0('0x1e'))(new Redis(config[_0x61c0('0x1c')]));require(_0x61c0('0x1f'))[_0x61c0('0x20')](socket);function respondWithStatusCode(_0x4216b2,_0x49bba2){_0x49bba2=_0x49bba2||0xcc;return function(_0x3c10d0){if(_0x3c10d0){return _0x4216b2[_0x61c0('0x21')](_0x49bba2);}return _0x4216b2['status'](_0x49bba2)[_0x61c0('0x22')]();};}function respondWithResult(_0x233fc0,_0x192644){_0x192644=_0x192644||0xc8;return function(_0x226724){if(_0x226724){return _0x233fc0[_0x61c0('0x23')](_0x192644)[_0x61c0('0x24')](_0x226724);}};}function respondWithFilteredResult(_0x175096,_0x3d6552){return function(_0x12f2e6){if(_0x12f2e6){var _0x522b89=typeof _0x3d6552['offset']===_0x61c0('0x25')&&typeof _0x3d6552[_0x61c0('0x26')]===_0x61c0('0x25');var _0x601b54=_0x12f2e6[_0x61c0('0x27')];var _0x1fd0cc=_0x522b89?0x0:_0x3d6552[_0x61c0('0x28')];var _0x3eff17=_0x522b89?_0x12f2e6['count']:_0x3d6552[_0x61c0('0x28')]+_0x3d6552[_0x61c0('0x26')];var _0x3bd6b3;if(_0x3eff17>=_0x601b54){_0x3eff17=_0x601b54;_0x3bd6b3=0xc8;}else{_0x3bd6b3=0xce;}_0x175096[_0x61c0('0x23')](_0x3bd6b3);return _0x175096['set'](_0x61c0('0x29'),_0x1fd0cc+'-'+_0x3eff17+'/'+_0x601b54)[_0x61c0('0x24')](_0x12f2e6);}return null;};}function patchUpdates(_0xbba82a){return function(_0x49bdc6){try{jsonpatch[_0x61c0('0x2a')](_0x49bdc6,_0xbba82a,!![]);}catch(_0x2ca004){return BPromise['reject'](_0x2ca004);}return _0x49bdc6[_0x61c0('0x2b')]();};}function saveUpdates(_0x3fb75f,_0x146fcc){return function(_0x39b50a){if(_0x39b50a){return _0x39b50a[_0x61c0('0x2c')](_0x3fb75f)[_0x61c0('0x2d')](function(_0x202f8d){return _0x202f8d;});}return null;};}function removeEntity(_0xd8e1b4,_0x5a9299){return function(_0x156b63){if(_0x156b63){return _0x156b63[_0x61c0('0x2e')]()[_0x61c0('0x2d')](function(){_0xd8e1b4['status'](0xcc)[_0x61c0('0x22')]();});}};}function handleEntityNotFound(_0x3d2fcc,_0x1cd854){return function(_0x3c4440){if(!_0x3c4440){_0x3d2fcc[_0x61c0('0x21')](0x194);}return _0x3c4440;};}function handleError(_0xc84e1e,_0x5e13f7){_0x5e13f7=_0x5e13f7||0x1f4;return function(_0x21ad56){logger['error'](_0x21ad56[_0x61c0('0x2f')]);if(_0x21ad56[_0x61c0('0x30')]){delete _0x21ad56[_0x61c0('0x30')];}_0xc84e1e[_0x61c0('0x23')](_0x5e13f7)[_0x61c0('0x31')](_0x21ad56);};}exports[_0x61c0('0x32')]=function(_0x5074a9,_0x364895){var _0x43d99c={},_0x720837={},_0x19567a={'count':0x0,'rows':[]};var _0x11b908=_[_0x61c0('0x33')](db[_0x61c0('0x34')][_0x61c0('0x35')],function(_0xf3d1e2){return{'name':_0xf3d1e2[_0x61c0('0x36')],'type':_0xf3d1e2['type'][_0x61c0('0x37')]};});_0x720837[_0x61c0('0x38')]=_[_0x61c0('0x33')](_0x11b908,_0x61c0('0x30'));_0x720837[_0x61c0('0x39')]=_[_0x61c0('0x3a')](_0x5074a9['query']);_0x720837[_0x61c0('0x3b')]=_[_0x61c0('0x3c')](_0x720837[_0x61c0('0x38')],_0x720837[_0x61c0('0x39')]);_0x43d99c[_0x61c0('0x3d')]=_[_0x61c0('0x3c')](_0x720837['model'],qs[_0x61c0('0x3e')](_0x5074a9[_0x61c0('0x39')][_0x61c0('0x3e')]));_0x43d99c[_0x61c0('0x3d')]=_0x43d99c[_0x61c0('0x3d')][_0x61c0('0x3f')]?_0x43d99c[_0x61c0('0x3d')]:_0x720837[_0x61c0('0x38')];if(!_0x5074a9['query'][_0x61c0('0x40')](_0x61c0('0x41'))){_0x43d99c[_0x61c0('0x26')]=qs[_0x61c0('0x26')](_0x5074a9['query']['limit']);_0x43d99c[_0x61c0('0x28')]=qs[_0x61c0('0x28')](_0x5074a9[_0x61c0('0x39')][_0x61c0('0x28')]);}_0x43d99c[_0x61c0('0x42')]=qs[_0x61c0('0x43')](_0x5074a9[_0x61c0('0x39')][_0x61c0('0x43')]);_0x43d99c[_0x61c0('0x44')]=qs[_0x61c0('0x3b')](_[_0x61c0('0x45')](_0x5074a9[_0x61c0('0x39')],_0x720837[_0x61c0('0x3b')]),_0x11b908);if(_0x5074a9[_0x61c0('0x39')]['filter']){_0x43d99c[_0x61c0('0x44')]=_[_0x61c0('0x46')](_0x43d99c[_0x61c0('0x44')],{'$or':_[_0x61c0('0x33')](_0x11b908,function(_0x4a9948){if(_0x4a9948[_0x61c0('0x47')]!==_0x61c0('0x48')){var _0x2b4f49={};_0x2b4f49[_0x4a9948[_0x61c0('0x30')]]={'$like':'%'+_0x5074a9[_0x61c0('0x39')][_0x61c0('0x49')]+'%'};return _0x2b4f49;}})});}_0x43d99c=_['merge']({},_0x43d99c,_0x5074a9[_0x61c0('0x4a')]);var _0xd259cf={'where':_0x43d99c['where']};return db[_0x61c0('0x34')][_0x61c0('0x27')](_0xd259cf)[_0x61c0('0x2d')](function(_0x2a4f06){_0x19567a['count']=_0x2a4f06;if(_0x5074a9[_0x61c0('0x39')][_0x61c0('0x4b')]){_0x43d99c[_0x61c0('0x4c')]=[{'all':!![]}];}return db[_0x61c0('0x34')][_0x61c0('0x4d')](_0x43d99c);})['then'](function(_0xd24916){_0x19567a['rows']=_0xd24916;return _0x19567a;})[_0x61c0('0x2d')](respondWithFilteredResult(_0x364895,_0x43d99c))[_0x61c0('0x4e')](handleError(_0x364895,null));};exports['show']=function(_0x5b2258,_0x29de52){var _0x3fe551={'raw':!![],'where':{'id':_0x5b2258[_0x61c0('0x4f')]['id']}},_0x1c400b={};_0x1c400b[_0x61c0('0x38')]=_[_0x61c0('0x3a')](db['ChatGroup'][_0x61c0('0x35')]);_0x1c400b['query']=_[_0x61c0('0x3a')](_0x5b2258[_0x61c0('0x39')]);_0x1c400b[_0x61c0('0x3b')]=_[_0x61c0('0x3c')](_0x1c400b['model'],_0x1c400b['query']);_0x3fe551['attributes']=_[_0x61c0('0x3c')](_0x1c400b['model'],qs['fields'](_0x5b2258[_0x61c0('0x39')]['fields']));_0x3fe551[_0x61c0('0x3d')]=_0x3fe551[_0x61c0('0x3d')][_0x61c0('0x3f')]?_0x3fe551[_0x61c0('0x3d')]:_0x1c400b[_0x61c0('0x38')];if(_0x5b2258[_0x61c0('0x39')][_0x61c0('0x4b')]){_0x3fe551[_0x61c0('0x4c')]=[{'all':!![]}];}_0x3fe551=_['merge']({},_0x3fe551,_0x5b2258[_0x61c0('0x4a')]);return db[_0x61c0('0x34')][_0x61c0('0x50')](_0x3fe551)['then'](handleEntityNotFound(_0x29de52,null))[_0x61c0('0x2d')](respondWithResult(_0x29de52,null))[_0x61c0('0x4e')](handleError(_0x29de52,null));};exports[_0x61c0('0x51')]=function(_0x1478ef,_0x2293ba){return db['ChatGroup'][_0x61c0('0x51')](_0x1478ef[_0x61c0('0x52')],{})[_0x61c0('0x2d')](respondWithResult(_0x2293ba,0xc9))['catch'](handleError(_0x2293ba,null));};exports[_0x61c0('0x2c')]=function(_0x305ea7,_0x43da02){if(_0x305ea7['body']['id']){delete _0x305ea7[_0x61c0('0x52')]['id'];}return db[_0x61c0('0x34')]['find']({'where':{'id':_0x305ea7[_0x61c0('0x4f')]['id']}})[_0x61c0('0x2d')](handleEntityNotFound(_0x43da02,null))['then'](saveUpdates(_0x305ea7['body'],null))[_0x61c0('0x2d')](respondWithResult(_0x43da02,null))[_0x61c0('0x4e')](handleError(_0x43da02,null));};exports[_0x61c0('0x2e')]=function(_0x5501e8,_0x16e9b8){return db['ChatGroup']['find']({'where':{'id':_0x5501e8['params']['id']}})[_0x61c0('0x2d')](handleEntityNotFound(_0x16e9b8,null))['then'](removeEntity(_0x16e9b8,null))[_0x61c0('0x4e')](handleError(_0x16e9b8,null));};exports['describe']=function(_0x4d1b3a,_0x25e33a){return db[_0x61c0('0x34')][_0x61c0('0x53')]()[_0x61c0('0x2d')](respondWithResult(_0x25e33a,null))[_0x61c0('0x4e')](handleError(_0x25e33a,null));};exports[_0x61c0('0x54')]=function(_0x573427,_0x5942b6,_0xdc2127){return db['ChatInternalMessage'][_0x61c0('0x27')]({'where':{'ChatGroupId':_0x573427['params']['id'],'ToId':_0x573427[_0x61c0('0x55')]['id'],'read':![]}})[_0x61c0('0x2d')](function(_0x2c525f){return{'id':_['toInteger'](_0x573427['params']['id']),'count':_0x2c525f};})['then'](respondWithResult(_0x5942b6,null))[_0x61c0('0x4e')](handleError(_0x5942b6,null));};exports[_0x61c0('0x56')]=function(_0x130304,_0x39af02,_0x2e03b8){return db[_0x61c0('0x34')]['find']({'where':{'id':_0x130304['params']['id']}})['then'](handleEntityNotFound(_0x39af02,null))[_0x61c0('0x2d')](function(_0x2f5b60){if(_0x2f5b60){return _0x2f5b60['addMembers'](_0x130304['body'][_0x61c0('0x57')],_[_0x61c0('0x58')](_0x130304[_0x61c0('0x52')],[_0x61c0('0x57'),'id'])||{});}})[_0x61c0('0x2d')](respondWithResult(_0x39af02,null))[_0x61c0('0x4e')](handleError(_0x39af02,null));};exports[_0x61c0('0x59')]=function(_0x38e0e0,_0x1f1f95,_0x3b11f1){var _0x2751af={};var _0x3bf721={};var _0x57c682;var _0x37dc7b;return db[_0x61c0('0x34')]['findOne']({'where':{'id':_0x38e0e0['params']['id']}})[_0x61c0('0x2d')](handleEntityNotFound(_0x1f1f95,null))[_0x61c0('0x2d')](function(_0x917804){if(_0x917804){_0x57c682=_0x917804;_0x3bf721[_0x61c0('0x38')]=_[_0x61c0('0x3a')](db[_0x61c0('0x5a')][_0x61c0('0x35')]);_0x3bf721[_0x61c0('0x39')]=_[_0x61c0('0x3a')](_0x38e0e0[_0x61c0('0x39')]);_0x3bf721['filters']=_['intersection'](_0x3bf721[_0x61c0('0x38')],_0x3bf721[_0x61c0('0x39')]);_0x2751af['attributes']=_[_0x61c0('0x3c')](_0x3bf721[_0x61c0('0x38')],qs[_0x61c0('0x3e')](_0x38e0e0['query'][_0x61c0('0x3e')]));_0x2751af[_0x61c0('0x3d')]=_0x2751af[_0x61c0('0x3d')]['length']?_0x2751af[_0x61c0('0x3d')]:_0x3bf721[_0x61c0('0x38')];_0x2751af['order']=qs['sort'](_0x38e0e0['query']['sort']);_0x2751af[_0x61c0('0x44')]=qs[_0x61c0('0x3b')](_[_0x61c0('0x45')](_0x38e0e0[_0x61c0('0x39')],_0x3bf721[_0x61c0('0x3b')]));if(_0x38e0e0[_0x61c0('0x39')]['filter']){_0x2751af['where']=_[_0x61c0('0x46')](_0x2751af[_0x61c0('0x44')],{'$or':_['map'](_0x2751af[_0x61c0('0x3d')],function(_0x3cd882){var _0x59b396={};_0x59b396[_0x3cd882]={'$like':'%'+_0x38e0e0[_0x61c0('0x39')]['filter']+'%'};return _0x59b396;})});}_0x2751af=_[_0x61c0('0x46')]({},_0x2751af,_0x38e0e0[_0x61c0('0x4a')]);return _0x57c682[_0x61c0('0x59')](_0x2751af);}})[_0x61c0('0x2d')](function(_0x44d0a5){if(_0x44d0a5){_0x37dc7b=_0x44d0a5[_0x61c0('0x3f')];if(!_0x38e0e0[_0x61c0('0x39')]['hasOwnProperty'](_0x61c0('0x41'))){_0x2751af[_0x61c0('0x26')]=qs[_0x61c0('0x26')](_0x38e0e0['query']['limit']);_0x2751af[_0x61c0('0x28')]=qs[_0x61c0('0x28')](_0x38e0e0[_0x61c0('0x39')][_0x61c0('0x28')]);}return _0x57c682[_0x61c0('0x59')](_0x2751af);}})[_0x61c0('0x2d')](function(_0x3303cd){if(_0x3303cd){return _0x3303cd?{'count':_0x37dc7b,'rows':_0x3303cd}:null;}})[_0x61c0('0x2d')](respondWithResult(_0x1f1f95,null))[_0x61c0('0x4e')](handleError(_0x1f1f95,null));};exports[_0x61c0('0x5b')]=function(_0x4ae8ca,_0x16d6b4,_0x280cba){return db[_0x61c0('0x34')][_0x61c0('0x50')]({'where':{'id':_0x4ae8ca[_0x61c0('0x4f')]['id']}})[_0x61c0('0x2d')](handleEntityNotFound(_0x16d6b4,null))['then'](function(_0x1a52af){if(_0x1a52af){return _0x1a52af[_0x61c0('0x5b')](_0x4ae8ca[_0x61c0('0x39')][_0x61c0('0x57')]);}})[_0x61c0('0x2d')](respondWithStatusCode(_0x16d6b4,null))[_0x61c0('0x4e')](handleError(_0x16d6b4,null));};exports['addMessage']=function(_0x2a6673,_0x557260,_0x1463c0){if(_0x2a6673[_0x61c0('0x52')]['id']){delete _0x2a6673[_0x61c0('0x52')]['id'];}return db[_0x61c0('0x34')][_0x61c0('0x50')]({'where':{'id':_0x2a6673[_0x61c0('0x4f')]['id']}})[_0x61c0('0x2d')](handleEntityNotFound(_0x557260,null))['then'](function(_0x41517d){if(_0x41517d){_0x2a6673[_0x61c0('0x52')][_0x61c0('0x5c')]=_0x41517d['id'];return db['ChatInternalMessage'][_0x61c0('0x51')](_0x2a6673[_0x61c0('0x52')]);}})['then'](respondWithResult(_0x557260,null))[_0x61c0('0x4e')](handleError(_0x557260,null));};exports[_0x61c0('0x5d')]=function(_0x3326bc,_0x1e855b,_0x4984b7){var _0x1e1bc3={};var _0x76e7bd={};var _0x5be670;var _0x54584d;return db[_0x61c0('0x34')][_0x61c0('0x5e')]({'where':{'id':_0x3326bc['params']['id']}})[_0x61c0('0x2d')](handleEntityNotFound(_0x1e855b,null))[_0x61c0('0x2d')](function(_0x18eec2){if(_0x18eec2){_0x5be670=_0x18eec2;_0x76e7bd[_0x61c0('0x38')]=_[_0x61c0('0x3a')](db[_0x61c0('0x5f')]['rawAttributes']);_0x76e7bd[_0x61c0('0x39')]=_['keys'](_0x3326bc[_0x61c0('0x39')]);_0x76e7bd['filters']=_[_0x61c0('0x3c')](_0x76e7bd[_0x61c0('0x38')],_0x76e7bd[_0x61c0('0x39')]);_0x1e1bc3[_0x61c0('0x3d')]=_[_0x61c0('0x3c')](_0x76e7bd['model'],qs['fields'](_0x3326bc['query'][_0x61c0('0x3e')]));_0x1e1bc3[_0x61c0('0x3d')]=_0x1e1bc3[_0x61c0('0x3d')]['length']?_0x1e1bc3[_0x61c0('0x3d')]:_0x76e7bd['model'];_0x1e1bc3[_0x61c0('0x42')]=qs[_0x61c0('0x43')](_0x3326bc[_0x61c0('0x39')]['sort']);_0x1e1bc3[_0x61c0('0x44')]=qs[_0x61c0('0x3b')](_['pick'](_0x3326bc['query'],_0x76e7bd[_0x61c0('0x3b')]));if(_0x3326bc[_0x61c0('0x39')]['filter']){_0x1e1bc3[_0x61c0('0x44')]=_['merge'](_0x1e1bc3[_0x61c0('0x44')],{'$or':_[_0x61c0('0x33')](_0x1e1bc3['attributes'],function(_0x27dfff){var _0x21256e={};_0x21256e[_0x27dfff]={'$like':'%'+_0x3326bc['query'][_0x61c0('0x49')]+'%'};return _0x21256e;})});}if(_0x3326bc[_0x61c0('0x39')]['$gte']){var _0x3f3dea=_0x3326bc[_0x61c0('0x39')][_0x61c0('0x60')][_0x61c0('0x61')](',');var _0x168363={};_0x168363[_0x3f3dea[0x0]]={'$gte':moment(_0x3f3dea[0x1])[_0x61c0('0x62')](_0x61c0('0x63'))};_0x1e1bc3[_0x61c0('0x44')]=_[_0x61c0('0x46')](_0x1e1bc3['where'],_0x168363);}_0x1e1bc3=_[_0x61c0('0x46')]({},_0x1e1bc3,_0x3326bc[_0x61c0('0x4a')]);return _0x5be670[_0x61c0('0x5d')](_0x1e1bc3);}})['then'](function(_0x3d5791){if(_0x3d5791){_0x54584d=_0x3d5791[_0x61c0('0x3f')];if(!_0x3326bc['query'][_0x61c0('0x40')](_0x61c0('0x41'))){_0x1e1bc3[_0x61c0('0x26')]=qs['limit'](_0x3326bc[_0x61c0('0x39')][_0x61c0('0x26')]);_0x1e1bc3['offset']=qs[_0x61c0('0x28')](_0x3326bc[_0x61c0('0x39')][_0x61c0('0x28')]);}return _0x5be670[_0x61c0('0x5d')](_0x1e1bc3);}})[_0x61c0('0x2d')](function(_0x1f8508){if(_0x1f8508){return _0x1f8508?{'count':_0x54584d,'rows':_0x1f8508}:null;}})[_0x61c0('0x2d')](respondWithResult(_0x1e855b,null))[_0x61c0('0x4e')](handleError(_0x1e855b,null));}; \ No newline at end of file +var _0x37e8=['destroy','then','error','stack','name','status','send','index','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','options','ChatGroup','include','findAll','rows','catch','params','length','includeAll','create','body','update','find','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','omit','getMembers','findOne','User','filter','removeMembers','addMessage','ChatGroupId','rawAttributes','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','defaults','redis','./chatGroup.socket','register','sendStatus','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save'];(function(_0x5ce173,_0x34e8d3){var _0x2b7c7b=function(_0x1cd99f){while(--_0x1cd99f){_0x5ce173['push'](_0x5ce173['shift']());}};_0x2b7c7b(++_0x34e8d3);}(_0x37e8,0x101));var _0x837e=function(_0x482ced,_0x240f3f){_0x482ced=_0x482ced-0x0;var _0x85a839=_0x37e8[_0x482ced];return _0x85a839;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x837e('0x0'));var zipdir=require(_0x837e('0x1'));var jsonpatch=require(_0x837e('0x2'));var rp=require(_0x837e('0x3'));var moment=require(_0x837e('0x4'));var BPromise=require(_0x837e('0x5'));var Mustache=require(_0x837e('0x6'));var util=require(_0x837e('0x7'));var path=require(_0x837e('0x8'));var sox=require(_0x837e('0x9'));var csv=require(_0x837e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x837e('0xb'));var _=require('lodash');var squel=require(_0x837e('0xc'));var crypto=require(_0x837e('0xd'));var jsforce=require(_0x837e('0xe'));var deskjs=require(_0x837e('0xf'));var toCsv=require(_0x837e('0xa'));var querystring=require('querystring');var Papa=require(_0x837e('0x10'));var Redis=require(_0x837e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x837e('0x12'));var as=require(_0x837e('0x13'));var hardwareService=require(_0x837e('0x14'));var logger=require(_0x837e('0x15'))('api');var utils=require(_0x837e('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x837e('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x837e('0x18')](config[_0x837e('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x837e('0x19')]));require(_0x837e('0x1a'))[_0x837e('0x1b')](socket);function respondWithStatusCode(_0xe9a354,_0x3a8d5f){_0x3a8d5f=_0x3a8d5f||0xcc;return function(_0x345c4f){if(_0x345c4f){return _0xe9a354[_0x837e('0x1c')](_0x3a8d5f);}return _0xe9a354['status'](_0x3a8d5f)[_0x837e('0x1d')]();};}function respondWithResult(_0xb515e7,_0x3d69ce){_0x3d69ce=_0x3d69ce||0xc8;return function(_0x197131){if(_0x197131){return _0xb515e7['status'](_0x3d69ce)['json'](_0x197131);}};}function respondWithFilteredResult(_0xff022f,_0x52098a){return function(_0x301e61){if(_0x301e61){var _0x5e4b36=typeof _0x52098a[_0x837e('0x1e')]==='undefined'&&typeof _0x52098a[_0x837e('0x1f')]===_0x837e('0x20');var _0x1c6575=_0x301e61[_0x837e('0x21')];var _0x21fe66=_0x5e4b36?0x0:_0x52098a['offset'];var _0x5909d5=_0x5e4b36?_0x301e61['count']:_0x52098a['offset']+_0x52098a[_0x837e('0x1f')];var _0x537bc2;if(_0x5909d5>=_0x1c6575){_0x5909d5=_0x1c6575;_0x537bc2=0xc8;}else{_0x537bc2=0xce;}_0xff022f['status'](_0x537bc2);return _0xff022f[_0x837e('0x22')](_0x837e('0x23'),_0x21fe66+'-'+_0x5909d5+'/'+_0x1c6575)[_0x837e('0x24')](_0x301e61);}return null;};}function patchUpdates(_0x4d8d2d){return function(_0xe1b1d3){try{jsonpatch[_0x837e('0x25')](_0xe1b1d3,_0x4d8d2d,!![]);}catch(_0x159e7a){return BPromise[_0x837e('0x26')](_0x159e7a);}return _0xe1b1d3[_0x837e('0x27')]();};}function saveUpdates(_0x256a52,_0x4baca5){return function(_0x12683f){if(_0x12683f){return _0x12683f['update'](_0x256a52)['then'](function(_0x363782){return _0x363782;});}return null;};}function removeEntity(_0x728496,_0x361539){return function(_0xd096b4){if(_0xd096b4){return _0xd096b4[_0x837e('0x28')]()[_0x837e('0x29')](function(){_0x728496['status'](0xcc)[_0x837e('0x1d')]();});}};}function handleEntityNotFound(_0x66ba9f,_0x284e7d){return function(_0x302ffc){if(!_0x302ffc){_0x66ba9f['sendStatus'](0x194);}return _0x302ffc;};}function handleError(_0x1a65da,_0x298ff2){_0x298ff2=_0x298ff2||0x1f4;return function(_0x17036e){logger[_0x837e('0x2a')](_0x17036e[_0x837e('0x2b')]);if(_0x17036e[_0x837e('0x2c')]){delete _0x17036e[_0x837e('0x2c')];}_0x1a65da[_0x837e('0x2d')](_0x298ff2)[_0x837e('0x2e')](_0x17036e);};}exports[_0x837e('0x2f')]=function(_0x3262d9,_0x5ce46c){var _0x7cfee3={},_0x47e440={},_0x5b3d6b={'count':0x0,'rows':[]};var _0x438f75=_['map'](db['ChatGroup']['rawAttributes'],function(_0x5140ab){return{'name':_0x5140ab[_0x837e('0x30')],'type':_0x5140ab[_0x837e('0x31')][_0x837e('0x32')]};});_0x47e440[_0x837e('0x33')]=_['map'](_0x438f75,_0x837e('0x2c'));_0x47e440[_0x837e('0x34')]=_[_0x837e('0x35')](_0x3262d9[_0x837e('0x34')]);_0x47e440[_0x837e('0x36')]=_['intersection'](_0x47e440[_0x837e('0x33')],_0x47e440[_0x837e('0x34')]);_0x7cfee3['attributes']=_[_0x837e('0x37')](_0x47e440['model'],qs[_0x837e('0x38')](_0x3262d9[_0x837e('0x34')][_0x837e('0x38')]));_0x7cfee3[_0x837e('0x39')]=_0x7cfee3['attributes']['length']?_0x7cfee3[_0x837e('0x39')]:_0x47e440['model'];if(!_0x3262d9[_0x837e('0x34')][_0x837e('0x3a')](_0x837e('0x3b'))){_0x7cfee3[_0x837e('0x1f')]=qs['limit'](_0x3262d9[_0x837e('0x34')][_0x837e('0x1f')]);_0x7cfee3[_0x837e('0x1e')]=qs[_0x837e('0x1e')](_0x3262d9[_0x837e('0x34')]['offset']);}_0x7cfee3[_0x837e('0x3c')]=qs[_0x837e('0x3d')](_0x3262d9['query'][_0x837e('0x3d')]);_0x7cfee3['where']=qs['filters'](_[_0x837e('0x3e')](_0x3262d9[_0x837e('0x34')],_0x47e440[_0x837e('0x36')]),_0x438f75);if(_0x3262d9[_0x837e('0x34')]['filter']){_0x7cfee3['where']=_[_0x837e('0x3f')](_0x7cfee3[_0x837e('0x40')],{'$or':_['map'](_0x438f75,function(_0x303d27){if(_0x303d27[_0x837e('0x31')]!==_0x837e('0x41')){var _0x5476c9={};_0x5476c9[_0x303d27[_0x837e('0x2c')]]={'$like':'%'+_0x3262d9[_0x837e('0x34')]['filter']+'%'};return _0x5476c9;}})});}_0x7cfee3=_['merge']({},_0x7cfee3,_0x3262d9[_0x837e('0x42')]);var _0x2e5efc={'where':_0x7cfee3[_0x837e('0x40')]};return db[_0x837e('0x43')][_0x837e('0x21')](_0x2e5efc)[_0x837e('0x29')](function(_0x476cdd){_0x5b3d6b[_0x837e('0x21')]=_0x476cdd;if(_0x3262d9[_0x837e('0x34')]['includeAll']){_0x7cfee3[_0x837e('0x44')]=[{'all':!![]}];}return db[_0x837e('0x43')][_0x837e('0x45')](_0x7cfee3);})[_0x837e('0x29')](function(_0x236f4e){_0x5b3d6b[_0x837e('0x46')]=_0x236f4e;return _0x5b3d6b;})[_0x837e('0x29')](respondWithFilteredResult(_0x5ce46c,_0x7cfee3))[_0x837e('0x47')](handleError(_0x5ce46c,null));};exports['show']=function(_0x37c52b,_0x187180){var _0x598cd4={'raw':!![],'where':{'id':_0x37c52b[_0x837e('0x48')]['id']}},_0x9b48a={};_0x9b48a['model']=_['keys'](db[_0x837e('0x43')]['rawAttributes']);_0x9b48a[_0x837e('0x34')]=_[_0x837e('0x35')](_0x37c52b['query']);_0x9b48a[_0x837e('0x36')]=_['intersection'](_0x9b48a[_0x837e('0x33')],_0x9b48a[_0x837e('0x34')]);_0x598cd4['attributes']=_['intersection'](_0x9b48a['model'],qs['fields'](_0x37c52b[_0x837e('0x34')][_0x837e('0x38')]));_0x598cd4[_0x837e('0x39')]=_0x598cd4[_0x837e('0x39')][_0x837e('0x49')]?_0x598cd4[_0x837e('0x39')]:_0x9b48a[_0x837e('0x33')];if(_0x37c52b['query'][_0x837e('0x4a')]){_0x598cd4[_0x837e('0x44')]=[{'all':!![]}];}_0x598cd4=_['merge']({},_0x598cd4,_0x37c52b['options']);return db[_0x837e('0x43')]['find'](_0x598cd4)[_0x837e('0x29')](handleEntityNotFound(_0x187180,null))['then'](respondWithResult(_0x187180,null))[_0x837e('0x47')](handleError(_0x187180,null));};exports[_0x837e('0x4b')]=function(_0x463093,_0x4e3b99){return db[_0x837e('0x43')][_0x837e('0x4b')](_0x463093[_0x837e('0x4c')],{})[_0x837e('0x29')](respondWithResult(_0x4e3b99,0xc9))['catch'](handleError(_0x4e3b99,null));};exports[_0x837e('0x4d')]=function(_0x14b214,_0x18b4b6){if(_0x14b214[_0x837e('0x4c')]['id']){delete _0x14b214[_0x837e('0x4c')]['id'];}return db['ChatGroup'][_0x837e('0x4e')]({'where':{'id':_0x14b214[_0x837e('0x48')]['id']}})[_0x837e('0x29')](handleEntityNotFound(_0x18b4b6,null))[_0x837e('0x29')](saveUpdates(_0x14b214[_0x837e('0x4c')],null))[_0x837e('0x29')](respondWithResult(_0x18b4b6,null))['catch'](handleError(_0x18b4b6,null));};exports['destroy']=function(_0x3bda8f,_0x55bc31){return db[_0x837e('0x43')][_0x837e('0x4e')]({'where':{'id':_0x3bda8f[_0x837e('0x48')]['id']}})[_0x837e('0x29')](handleEntityNotFound(_0x55bc31,null))['then'](removeEntity(_0x55bc31,null))[_0x837e('0x47')](handleError(_0x55bc31,null));};exports[_0x837e('0x4f')]=function(_0x1c40e1,_0xfd98ed){return db['ChatGroup'][_0x837e('0x4f')]()[_0x837e('0x29')](respondWithResult(_0xfd98ed,null))['catch'](handleError(_0xfd98ed,null));};exports[_0x837e('0x50')]=function(_0x3cb954,_0x24d68f,_0xeaba93){return db[_0x837e('0x51')][_0x837e('0x21')]({'where':{'ChatGroupId':_0x3cb954[_0x837e('0x48')]['id'],'ToId':_0x3cb954['user']['id'],'read':![]}})['then'](function(_0x503f24){return{'id':_[_0x837e('0x52')](_0x3cb954['params']['id']),'count':_0x503f24};})[_0x837e('0x29')](respondWithResult(_0x24d68f,null))[_0x837e('0x47')](handleError(_0x24d68f,null));};exports[_0x837e('0x53')]=function(_0x44932d,_0x4bfa26,_0x58cfe6){return db[_0x837e('0x43')][_0x837e('0x4e')]({'where':{'id':_0x44932d[_0x837e('0x48')]['id']}})[_0x837e('0x29')](handleEntityNotFound(_0x4bfa26,null))[_0x837e('0x29')](function(_0x502d7a){if(_0x502d7a){return _0x502d7a['addMembers'](_0x44932d[_0x837e('0x4c')][_0x837e('0x54')],_[_0x837e('0x55')](_0x44932d[_0x837e('0x4c')],['ids','id'])||{});}})[_0x837e('0x29')](respondWithResult(_0x4bfa26,null))[_0x837e('0x47')](handleError(_0x4bfa26,null));};exports[_0x837e('0x56')]=function(_0x426cd4,_0x1c4c24,_0x23f25a){var _0x14c2af={};var _0x420cd={};var _0x3ac249;var _0x2cb0aa;return db[_0x837e('0x43')][_0x837e('0x57')]({'where':{'id':_0x426cd4['params']['id']}})[_0x837e('0x29')](handleEntityNotFound(_0x1c4c24,null))['then'](function(_0x3c5d02){if(_0x3c5d02){_0x3ac249=_0x3c5d02;_0x420cd[_0x837e('0x33')]=_[_0x837e('0x35')](db[_0x837e('0x58')]['rawAttributes']);_0x420cd['query']=_[_0x837e('0x35')](_0x426cd4['query']);_0x420cd[_0x837e('0x36')]=_[_0x837e('0x37')](_0x420cd[_0x837e('0x33')],_0x420cd[_0x837e('0x34')]);_0x14c2af[_0x837e('0x39')]=_[_0x837e('0x37')](_0x420cd[_0x837e('0x33')],qs[_0x837e('0x38')](_0x426cd4[_0x837e('0x34')][_0x837e('0x38')]));_0x14c2af[_0x837e('0x39')]=_0x14c2af[_0x837e('0x39')][_0x837e('0x49')]?_0x14c2af[_0x837e('0x39')]:_0x420cd[_0x837e('0x33')];_0x14c2af['order']=qs[_0x837e('0x3d')](_0x426cd4[_0x837e('0x34')]['sort']);_0x14c2af[_0x837e('0x40')]=qs[_0x837e('0x36')](_['pick'](_0x426cd4[_0x837e('0x34')],_0x420cd[_0x837e('0x36')]));if(_0x426cd4['query']['filter']){_0x14c2af[_0x837e('0x40')]=_[_0x837e('0x3f')](_0x14c2af['where'],{'$or':_['map'](_0x14c2af['attributes'],function(_0x480224){var _0x3e8310={};_0x3e8310[_0x480224]={'$like':'%'+_0x426cd4[_0x837e('0x34')][_0x837e('0x59')]+'%'};return _0x3e8310;})});}_0x14c2af=_['merge']({},_0x14c2af,_0x426cd4[_0x837e('0x42')]);return _0x3ac249['getMembers'](_0x14c2af);}})[_0x837e('0x29')](function(_0xa9272d){if(_0xa9272d){_0x2cb0aa=_0xa9272d[_0x837e('0x49')];if(!_0x426cd4[_0x837e('0x34')][_0x837e('0x3a')]('nolimit')){_0x14c2af['limit']=qs[_0x837e('0x1f')](_0x426cd4[_0x837e('0x34')]['limit']);_0x14c2af['offset']=qs['offset'](_0x426cd4['query'][_0x837e('0x1e')]);}return _0x3ac249['getMembers'](_0x14c2af);}})[_0x837e('0x29')](function(_0x2d0088){if(_0x2d0088){return _0x2d0088?{'count':_0x2cb0aa,'rows':_0x2d0088}:null;}})['then'](respondWithResult(_0x1c4c24,null))[_0x837e('0x47')](handleError(_0x1c4c24,null));};exports[_0x837e('0x5a')]=function(_0x1b9707,_0x36ddba,_0x332a2c){return db[_0x837e('0x43')][_0x837e('0x4e')]({'where':{'id':_0x1b9707[_0x837e('0x48')]['id']}})[_0x837e('0x29')](handleEntityNotFound(_0x36ddba,null))[_0x837e('0x29')](function(_0x118123){if(_0x118123){return _0x118123['removeMembers'](_0x1b9707['query'][_0x837e('0x54')]);}})[_0x837e('0x29')](respondWithStatusCode(_0x36ddba,null))[_0x837e('0x47')](handleError(_0x36ddba,null));};exports[_0x837e('0x5b')]=function(_0x4c1acd,_0x156689,_0x23fc24){if(_0x4c1acd[_0x837e('0x4c')]['id']){delete _0x4c1acd[_0x837e('0x4c')]['id'];}return db['ChatGroup'][_0x837e('0x4e')]({'where':{'id':_0x4c1acd[_0x837e('0x48')]['id']}})[_0x837e('0x29')](handleEntityNotFound(_0x156689,null))[_0x837e('0x29')](function(_0x20f269){if(_0x20f269){_0x4c1acd[_0x837e('0x4c')][_0x837e('0x5c')]=_0x20f269['id'];return db[_0x837e('0x51')]['create'](_0x4c1acd['body']);}})[_0x837e('0x29')](respondWithResult(_0x156689,null))['catch'](handleError(_0x156689,null));};exports['getMessages']=function(_0x543767,_0x4bd7f3,_0x3bd83f){var _0x19b175={};var _0x260ddc={};var _0x4a5f64;var _0x2062c6;return db[_0x837e('0x43')]['findOne']({'where':{'id':_0x543767[_0x837e('0x48')]['id']}})[_0x837e('0x29')](handleEntityNotFound(_0x4bd7f3,null))[_0x837e('0x29')](function(_0x5e8d32){if(_0x5e8d32){_0x4a5f64=_0x5e8d32;_0x260ddc[_0x837e('0x33')]=_[_0x837e('0x35')](db[_0x837e('0x51')][_0x837e('0x5d')]);_0x260ddc[_0x837e('0x34')]=_['keys'](_0x543767[_0x837e('0x34')]);_0x260ddc['filters']=_[_0x837e('0x37')](_0x260ddc[_0x837e('0x33')],_0x260ddc[_0x837e('0x34')]);_0x19b175[_0x837e('0x39')]=_[_0x837e('0x37')](_0x260ddc[_0x837e('0x33')],qs[_0x837e('0x38')](_0x543767['query'][_0x837e('0x38')]));_0x19b175[_0x837e('0x39')]=_0x19b175['attributes']['length']?_0x19b175[_0x837e('0x39')]:_0x260ddc[_0x837e('0x33')];_0x19b175[_0x837e('0x3c')]=qs[_0x837e('0x3d')](_0x543767[_0x837e('0x34')]['sort']);_0x19b175[_0x837e('0x40')]=qs[_0x837e('0x36')](_[_0x837e('0x3e')](_0x543767['query'],_0x260ddc[_0x837e('0x36')]));if(_0x543767[_0x837e('0x34')][_0x837e('0x59')]){_0x19b175[_0x837e('0x40')]=_[_0x837e('0x3f')](_0x19b175[_0x837e('0x40')],{'$or':_['map'](_0x19b175['attributes'],function(_0x34409c){var _0x142fd1={};_0x142fd1[_0x34409c]={'$like':'%'+_0x543767[_0x837e('0x34')][_0x837e('0x59')]+'%'};return _0x142fd1;})});}if(_0x543767['query'][_0x837e('0x5e')]){var _0x1d149d=_0x543767['query'][_0x837e('0x5e')][_0x837e('0x5f')](',');var _0x418f0c={};_0x418f0c[_0x1d149d[0x0]]={'$gte':moment(_0x1d149d[0x1])[_0x837e('0x60')](_0x837e('0x61'))};_0x19b175[_0x837e('0x40')]=_[_0x837e('0x3f')](_0x19b175[_0x837e('0x40')],_0x418f0c);}_0x19b175=_['merge']({},_0x19b175,_0x543767[_0x837e('0x42')]);return _0x4a5f64[_0x837e('0x62')](_0x19b175);}})[_0x837e('0x29')](function(_0x5d5cee){if(_0x5d5cee){_0x2062c6=_0x5d5cee[_0x837e('0x49')];if(!_0x543767[_0x837e('0x34')][_0x837e('0x3a')](_0x837e('0x3b'))){_0x19b175[_0x837e('0x1f')]=qs['limit'](_0x543767['query'][_0x837e('0x1f')]);_0x19b175[_0x837e('0x1e')]=qs['offset'](_0x543767[_0x837e('0x34')][_0x837e('0x1e')]);}return _0x4a5f64[_0x837e('0x62')](_0x19b175);}})[_0x837e('0x29')](function(_0x50178a){if(_0x50178a){return _0x50178a?{'count':_0x2062c6,'rows':_0x50178a}:null;}})[_0x837e('0x29')](respondWithResult(_0x4bd7f3,null))[_0x837e('0x47')](handleError(_0x4bd7f3,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index bceb7ea..3efdb50 100644 --- a/server/api/chatGroup/chatGroup.events.js +++ b/server/api/chatGroup/chatGroup.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e3=['setMaxListeners','update','remove','emit','hook','events','../../mysqldb','ChatGroup'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x70e3,0x9d));var _0x370e=function(_0x5c4f6b,_0x2cdfce){_0x5c4f6b=_0x5c4f6b-0x0;var _0x104c4e=_0x70e3[_0x5c4f6b];return _0x104c4e;};'use strict';var EventEmitter=require(_0x370e('0x0'));var ChatGroup=require(_0x370e('0x1'))['db'][_0x370e('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x370e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x370e('0x4'),'afterDestroy':_0x370e('0x5')};function emitEvent(_0x3ae8ba){return function(_0x5e8764,_0x3649c7,_0x4166dd){ChatGroupEvents[_0x370e('0x6')](_0x3ae8ba+':'+_0x5e8764['id'],_0x5e8764);ChatGroupEvents[_0x370e('0x6')](_0x3ae8ba,_0x5e8764);_0x4166dd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x370e('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +var _0x36d3=['exports','events','../../mysqldb','ChatGroup','update','remove','emit','hasOwnProperty','hook'];(function(_0xb7b878,_0x5c3b92){var _0x3c84b9=function(_0x21d5a2){while(--_0x21d5a2){_0xb7b878['push'](_0xb7b878['shift']());}};_0x3c84b9(++_0x5c3b92);}(_0x36d3,0xb5));var _0x336d=function(_0x545cfd,_0x180db8){_0x545cfd=_0x545cfd-0x0;var _0xa19618=_0x36d3[_0x545cfd];return _0xa19618;};'use strict';var EventEmitter=require(_0x336d('0x0'));var ChatGroup=require(_0x336d('0x1'))['db'][_0x336d('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x336d('0x3'),'afterDestroy':_0x336d('0x4')};function emitEvent(_0x23233b){return function(_0x25a5de,_0x352fc0,_0x24cf91){ChatGroupEvents[_0x336d('0x5')](_0x23233b+':'+_0x25a5de['id'],_0x25a5de);ChatGroupEvents[_0x336d('0x5')](_0x23233b,_0x25a5de);_0x24cf91(null);};}for(var e in events){if(events[_0x336d('0x6')](e)){var event=events[e];ChatGroup[_0x336d('0x7')](e,emitEvent(event));}}module[_0x336d('0x8')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 4b727fa..d8e2807 100644 --- a/server/api/chatGroup/chatGroup.model.js +++ b/server/api/chatGroup/chatGroup.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x660f=['path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','../../config/logger','moment','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x660f,0x1ac));var _0xf660=function(_0x34e639,_0x23ae3f){_0x34e639=_0x34e639-0x0;var _0x52823e=_0x660f[_0x34e639];return _0x52823e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf660('0x0'))('api');var moment=require(_0xf660('0x1'));var BPromise=require(_0xf660('0x2'));var rp=require(_0xf660('0x3'));var fs=require('fs');var path=require(_0xf660('0x4'));var rimraf=require(_0xf660('0x5'));var config=require(_0xf660('0x6'));var attributes=require(_0xf660('0x7'));module[_0xf660('0x8')]=function(_0x110f22,_0x1e0daa){return _0x110f22[_0xf660('0x9')](_0xf660('0xa'),attributes,{'tableName':_0xf660('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2146=['./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x2146,0xbb));var _0x6214=function(_0x4b544e,_0x1b40c7){_0x4b544e=_0x4b544e-0x0;var _0x119683=_0x2146[_0x4b544e];return _0x119683;};'use strict';var _=require(_0x6214('0x0'));var util=require(_0x6214('0x1'));var logger=require(_0x6214('0x2'))(_0x6214('0x3'));var moment=require(_0x6214('0x4'));var BPromise=require(_0x6214('0x5'));var rp=require(_0x6214('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6214('0x7'));var config=require('../../config/environment');var attributes=require(_0x6214('0x8'));module[_0x6214('0x9')]=function(_0x485e18,_0x486a9d){return _0x485e18[_0x6214('0xa')](_0x6214('0xb'),attributes,{'tableName':_0x6214('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index 9f451d2..24330c9 100644 --- a/server/api/chatGroup/chatGroup.rpc.js +++ b/server/api/chatGroup/chatGroup.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xef72=['register','request','then','info','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ChatGroup,\x20%s,\x20%s','result','catch','lodash','util','moment','../../mysqldb','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter'];(function(_0x3aa48e,_0x22eb8d){var _0x26f857=function(_0x59c01d){while(--_0x59c01d){_0x3aa48e['push'](_0x3aa48e['shift']());}};_0x26f857(++_0x22eb8d);}(_0xef72,0xf8));var _0x2ef7=function(_0x13e724,_0x296739){_0x13e724=_0x13e724-0x0;var _0x334a44=_0xef72[_0x13e724];return _0x334a44;};'use strict';var _=require(_0x2ef7('0x0'));var util=require(_0x2ef7('0x1'));var moment=require(_0x2ef7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2ef7('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2ef7('0x4'))(_0x2ef7('0x5'));var config=require(_0x2ef7('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2ef7('0x7')]['http']({'port':0x232a});config[_0x2ef7('0x8')]=_[_0x2ef7('0x9')](config[_0x2ef7('0x8')],{'host':_0x2ef7('0xa'),'port':0x18eb});var socket=require(_0x2ef7('0xb'))(new Redis(config[_0x2ef7('0x8')]));require('./chatGroup.socket')[_0x2ef7('0xc')](socket);function respondWithRpcPromise(_0x5e1adf,_0x574115,_0x448770){return new BPromise(function(_0x5f54f2,_0x54e43b){return client[_0x2ef7('0xd')](_0x5e1adf,_0x448770)[_0x2ef7('0xe')](function(_0xb1cc9){logger[_0x2ef7('0xf')]('ChatGroup,\x20%s,\x20%s',_0x574115,'request\x20sent');logger[_0x2ef7('0x10')](_0x2ef7('0x11'),_0x574115,_0x2ef7('0x12'),JSON[_0x2ef7('0x13')](_0xb1cc9));if(_0xb1cc9['error']){if(_0xb1cc9[_0x2ef7('0x14')][_0x2ef7('0x15')]===0x1f4){logger[_0x2ef7('0x14')]('ChatGroup,\x20%s,\x20%s',_0x574115,_0xb1cc9[_0x2ef7('0x14')][_0x2ef7('0x16')]);return _0x54e43b(_0xb1cc9[_0x2ef7('0x14')][_0x2ef7('0x16')]);}logger['error'](_0x2ef7('0x17'),_0x574115,_0xb1cc9[_0x2ef7('0x14')][_0x2ef7('0x16')]);return _0x5f54f2(_0xb1cc9[_0x2ef7('0x14')][_0x2ef7('0x16')]);}else{logger['info'](_0x2ef7('0x17'),_0x574115,'request\x20sent');_0x5f54f2(_0xb1cc9[_0x2ef7('0x18')][_0x2ef7('0x16')]);}})[_0x2ef7('0x19')](function(_0x290e13){logger[_0x2ef7('0x14')](_0x2ef7('0x17'),_0x574115,_0x290e13);_0x54e43b(_0x290e13);});});} \ No newline at end of file +var _0xe233=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','bluebird','../../mysqldb'];(function(_0x440341,_0x1ca54d){var _0x399e1c=function(_0x201acc){while(--_0x201acc){_0x440341['push'](_0x440341['shift']());}};_0x399e1c(++_0x1ca54d);}(_0xe233,0x15b));var _0x3e23=function(_0xb4411,_0x5d04ac){_0xb4411=_0xb4411-0x0;var _0x481db4=_0xe233[_0xb4411];return _0x481db4;};'use strict';var _=require(_0x3e23('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3e23('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3e23('0x2'))['db'];var utils=require(_0x3e23('0x3'));var logger=require(_0x3e23('0x4'))(_0x3e23('0x5'));var config=require(_0x3e23('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3e23('0x7')][_0x3e23('0x8')]({'port':0x232a});config[_0x3e23('0x9')]=_[_0x3e23('0xa')](config[_0x3e23('0x9')],{'host':_0x3e23('0xb'),'port':0x18eb});var socket=require(_0x3e23('0xc'))(new Redis(config[_0x3e23('0x9')]));require(_0x3e23('0xd'))[_0x3e23('0xe')](socket);function respondWithRpcPromise(_0x20f5d2,_0x39cb79,_0x1f9e56){return new BPromise(function(_0x492b77,_0x556b9e){return client[_0x3e23('0xf')](_0x20f5d2,_0x1f9e56)[_0x3e23('0x10')](function(_0x449d78){logger[_0x3e23('0x11')](_0x3e23('0x12'),_0x39cb79,'request\x20sent');logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x39cb79,_0x3e23('0x13'),JSON[_0x3e23('0x14')](_0x449d78));if(_0x449d78[_0x3e23('0x15')]){if(_0x449d78[_0x3e23('0x15')][_0x3e23('0x16')]===0x1f4){logger[_0x3e23('0x15')]('ChatGroup,\x20%s,\x20%s',_0x39cb79,_0x449d78['error']['message']);return _0x556b9e(_0x449d78['error'][_0x3e23('0x17')]);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x39cb79,_0x449d78[_0x3e23('0x15')][_0x3e23('0x17')]);return _0x492b77(_0x449d78[_0x3e23('0x15')]['message']);}else{logger[_0x3e23('0x11')]('ChatGroup,\x20%s,\x20%s',_0x39cb79,'request\x20sent');_0x492b77(_0x449d78['result'][_0x3e23('0x17')]);}})[_0x3e23('0x18')](function(_0x1b4da7){logger[_0x3e23('0x15')](_0x3e23('0x12'),_0x39cb79,_0x1b4da7);_0x556b9e(_0x1b4da7);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index fca5b29..75ef1ab 100644 --- a/server/api/chatGroup/chatGroup.socket.js +++ b/server/api/chatGroup/chatGroup.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc7c4=['./chatGroup.events','save','remove','emit','removeListener','register','chatGroup:'];(function(_0xfff28b,_0x204443){var _0x13c9f0=function(_0x4d9f58){while(--_0x4d9f58){_0xfff28b['push'](_0xfff28b['shift']());}};_0x13c9f0(++_0x204443);}(_0xc7c4,0x165));var _0x4c7c=function(_0x85df03,_0x451d08){_0x85df03=_0x85df03-0x0;var _0x3d5ea3=_0xc7c4[_0x85df03];return _0x3d5ea3;};'use strict';var ChatGroupEvents=require(_0x4c7c('0x0'));var events=[_0x4c7c('0x1'),_0x4c7c('0x2'),'update'];function createListener(_0x9409fb,_0x2eba69){return function(_0x46650d){_0x2eba69[_0x4c7c('0x3')](_0x9409fb,_0x46650d);};}function removeListener(_0x18536a,_0x280630){return function(){ChatGroupEvents[_0x4c7c('0x4')](_0x18536a,_0x280630);};}exports[_0x4c7c('0x5')]=function(_0xbbbd14){for(var _0x5e7296=0x0,_0x58eb7d=events['length'];_0x5e7296<_0x58eb7d;_0x5e7296++){var _0x5f1733=events[_0x5e7296];var _0x2e5404=createListener(_0x4c7c('0x6')+_0x5f1733,_0xbbbd14);ChatGroupEvents['on'](_0x5f1733,_0x2e5404);}}; \ No newline at end of file +var _0xa86b=['emit','removeListener','chatGroup:','save','remove','update'];(function(_0x4a9a1c,_0x25e250){var _0x10fe5f=function(_0x2a22cd){while(--_0x2a22cd){_0x4a9a1c['push'](_0x4a9a1c['shift']());}};_0x10fe5f(++_0x25e250);}(_0xa86b,0x75));var _0xba86=function(_0x51615c,_0x1ab65b){_0x51615c=_0x51615c-0x0;var _0x365de5=_0xa86b[_0x51615c];return _0x365de5;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0xba86('0x0'),_0xba86('0x1'),_0xba86('0x2')];function createListener(_0x228f1e,_0xe50b49){return function(_0x175a50){_0xe50b49[_0xba86('0x3')](_0x228f1e,_0x175a50);};}function removeListener(_0x40fcb7,_0x296dab){return function(){ChatGroupEvents[_0xba86('0x4')](_0x40fcb7,_0x296dab);};}exports['register']=function(_0xaf4f08){for(var _0x3f5051=0x0,_0x444879=events['length'];_0x3f5051<_0x444879;_0x3f5051++){var _0x6ab239=events[_0x3f5051];var _0x58855a=createListener(_0xba86('0x5')+_0x6ab239,_0xaf4f08);ChatGroupEvents['on'](_0x6ab239,_0x58855a);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 17e25e4..1ac2c84 100644 --- a/server/api/chatGroup/index.js +++ b/server/api/chatGroup/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa460=['index','get','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','addMembers','addMessage','put','update','delete','destroy','removeMembers','multer','util','path','connect-timeout','express','Router','../../components/auth/service','isAuthenticated'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xa460,0xbc));var _0x0a46=function(_0x40de6f,_0x3d5f9c){_0x40de6f=_0x40de6f-0x0;var _0x44a887=_0xa460[_0x40de6f];return _0x44a887;};'use strict';var multer=require(_0x0a46('0x0'));var util=require(_0x0a46('0x1'));var path=require(_0x0a46('0x2'));var timeout=require(_0x0a46('0x3'));var express=require(_0x0a46('0x4'));var router=express[_0x0a46('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0a46('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatGroup.controller');router['get']('/',auth[_0x0a46('0x7')](),controller[_0x0a46('0x8')]);router[_0x0a46('0x9')](_0x0a46('0xa'),auth[_0x0a46('0x7')](),controller[_0x0a46('0xb')]);router[_0x0a46('0x9')](_0x0a46('0xc'),auth[_0x0a46('0x7')](),controller[_0x0a46('0xd')]);router['get'](_0x0a46('0xe'),auth[_0x0a46('0x7')](),controller[_0x0a46('0xf')]);router[_0x0a46('0x9')](_0x0a46('0x10'),auth['isAuthenticated'](),controller[_0x0a46('0x11')]);router[_0x0a46('0x9')](_0x0a46('0x12'),auth['isAuthenticated'](),controller[_0x0a46('0x13')]);router[_0x0a46('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a46('0x14')](_0x0a46('0x10'),auth[_0x0a46('0x7')](),controller[_0x0a46('0x15')]);router['post'](_0x0a46('0x12'),auth[_0x0a46('0x7')](),controller[_0x0a46('0x16')]);router[_0x0a46('0x17')](_0x0a46('0xc'),auth['isAuthenticated'](),controller[_0x0a46('0x18')]);router[_0x0a46('0x19')](_0x0a46('0xc'),auth[_0x0a46('0x7')](),controller[_0x0a46('0x1a')]);router['delete'](_0x0a46('0x10'),auth['isAuthenticated'](),controller[_0x0a46('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x33ff=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','index','/describe','isAuthenticated','/:id','/:id/unread','getUnread','getMembers','getMessages','post','create','/:id/members','addMembers','addMessage','put','update','delete','destroy','removeMembers','exports','multer','util'];(function(_0x1989e2,_0x5a3b47){var _0x218d38=function(_0x572af8){while(--_0x572af8){_0x1989e2['push'](_0x1989e2['shift']());}};_0x218d38(++_0x5a3b47);}(_0x33ff,0x12a));var _0xf33f=function(_0x37d4ac,_0x4e47d6){_0x37d4ac=_0x37d4ac-0x0;var _0x5e727a=_0x33ff[_0x37d4ac];return _0x5e727a;};'use strict';var multer=require(_0xf33f('0x0'));var util=require(_0xf33f('0x1'));var path=require('path');var timeout=require(_0xf33f('0x2'));var express=require(_0xf33f('0x3'));var router=express[_0xf33f('0x4')]();var fs_extra=require(_0xf33f('0x5'));var auth=require(_0xf33f('0x6'));var interaction=require(_0xf33f('0x7'));var config=require(_0xf33f('0x8'));var controller=require(_0xf33f('0x9'));router[_0xf33f('0xa')]('/',auth['isAuthenticated'](),controller[_0xf33f('0xb')]);router['get'](_0xf33f('0xc'),auth[_0xf33f('0xd')](),controller['describe']);router[_0xf33f('0xa')](_0xf33f('0xe'),auth[_0xf33f('0xd')](),controller['show']);router[_0xf33f('0xa')](_0xf33f('0xf'),auth['isAuthenticated'](),controller[_0xf33f('0x10')]);router[_0xf33f('0xa')]('/:id/members',auth[_0xf33f('0xd')](),controller[_0xf33f('0x11')]);router['get']('/:id/messages',auth[_0xf33f('0xd')](),controller[_0xf33f('0x12')]);router[_0xf33f('0x13')]('/',auth[_0xf33f('0xd')](),controller[_0xf33f('0x14')]);router[_0xf33f('0x13')](_0xf33f('0x15'),auth[_0xf33f('0xd')](),controller[_0xf33f('0x16')]);router[_0xf33f('0x13')]('/:id/messages',auth[_0xf33f('0xd')](),controller[_0xf33f('0x17')]);router[_0xf33f('0x18')](_0xf33f('0xe'),auth[_0xf33f('0xd')](),controller[_0xf33f('0x19')]);router[_0xf33f('0x1a')]('/:id',auth[_0xf33f('0xd')](),controller[_0xf33f('0x1b')]);router[_0xf33f('0x1a')](_0xf33f('0x15'),auth[_0xf33f('0xd')](),controller[_0xf33f('0x1c')]);module[_0xf33f('0x1d')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 57cb771..e48d3f6 100644 --- a/server/api/chatInteraction/chatInteraction.attributes.js +++ b/server/api/chatInteraction/chatInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcf4a=['STRING','long','DATE','out','BOOLEAN','sequelize','exports','INTEGER','ENUM','thumb','TEXT'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xcf4a,0xec));var _0xacf4=function(_0x18b367,_0x349a8e){_0x18b367=_0x18b367-0x0;var _0xaa88a8=_0xcf4a[_0x18b367];return _0xaa88a8;};'use strict';var Sequelize=require(_0xacf4('0x0'));module[_0xacf4('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xacf4('0x2')]},'ratingType':{'type':Sequelize[_0xacf4('0x3')]('star',_0xacf4('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xacf4('0x5')]},'pathTranscript':{'type':Sequelize[_0xacf4('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xacf4('0x6')]},'secondDisposition':{'type':Sequelize[_0xacf4('0x6')]},'thirdDisposition':{'type':Sequelize[_0xacf4('0x6')]},'note':{'type':Sequelize[_0xacf4('0x6')]},'browserName':{'type':Sequelize[_0xacf4('0x6')]},'browserVersion':{'type':Sequelize[_0xacf4('0x6')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0xacf4('0x6')]},'deviceModel':{'type':Sequelize[_0xacf4('0x6')]},'deviceVendor':{'type':Sequelize[_0xacf4('0x6')]},'deviceType':{'type':Sequelize[_0xacf4('0x6')]},'referer':{'type':Sequelize[_0xacf4('0x5')]},'customerIp':{'type':Sequelize[_0xacf4('0x6')]},'formData':{'type':Sequelize[_0xacf4('0x5')](_0xacf4('0x7'))},'read1stAt':{'type':Sequelize[_0xacf4('0x8')]},'lastMsgAt':{'type':Sequelize[_0xacf4('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xacf4('0x3')]('in',_0xacf4('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xacf4('0x6')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0xacf4('0xa')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x647d=['BOOLEAN','INTEGER','ENUM','star','TEXT','STRING','DATE','out','sequelize','exports'];(function(_0x45d9fa,_0xb02522){var _0x1fb6d8=function(_0x2e2569){while(--_0x2e2569){_0x45d9fa['push'](_0x45d9fa['shift']());}};_0x1fb6d8(++_0xb02522);}(_0x647d,0xb2));var _0xd647=function(_0x47ff3a,_0x280a82){_0x47ff3a=_0x47ff3a-0x0;var _0x4ab5df=_0x647d[_0x47ff3a];return _0x4ab5df;};'use strict';var Sequelize=require(_0xd647('0x0'));module[_0xd647('0x1')]={'closed':{'type':Sequelize[_0xd647('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xd647('0x3')]},'ratingType':{'type':Sequelize[_0xd647('0x4')](_0xd647('0x5'),'thumb'),'defaultValue':_0xd647('0x5')},'ratingMessage':{'type':Sequelize[_0xd647('0x6')]},'pathTranscript':{'type':Sequelize[_0xd647('0x6')]},'mailTranscript':{'type':Sequelize[_0xd647('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xd647('0x8')]},'disposition':{'type':Sequelize[_0xd647('0x7')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xd647('0x7')]},'browserName':{'type':Sequelize[_0xd647('0x7')]},'browserVersion':{'type':Sequelize[_0xd647('0x7')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0xd647('0x7')]},'deviceModel':{'type':Sequelize[_0xd647('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0xd647('0x7')]},'referer':{'type':Sequelize[_0xd647('0x6')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xd647('0x6')]('long')},'read1stAt':{'type':Sequelize[_0xd647('0x8')]},'lastMsgAt':{'type':Sequelize[_0xd647('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xd647('0x4')]('in',_0xd647('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xd647('0x7')]},'customerPort':{'type':Sequelize[_0xd647('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xd647('0x6')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0xd647('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 2b89236..87bc6fd 100644 --- a/server/api/chatInteraction/chatInteraction.controller.js +++ b/server/api/chatInteraction/chatInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf378=['debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','end','status','json','offset','limit','count','set','destroy','sendStatus','stack','name','render','merge','interaction','account','index','ChatInteraction','fieldName','getOptions','findAll','chat','user','show','params','model','keys','rawAttributes','filters','intersection','query','fields','attributes','length','includeAll','include','options','find','create','update','body','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','fullname','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','follow','isNull','vidaooMetadata','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','UserId','Interaction\x20already\x20assigned','closed','attachmentUpload','file','originalname','filename','Attachment','attachmentDownload','attachId','root','offline-chat/','join','basename','download','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','now','pathTranscript','Messages','User','CmContact','ContactId','format','agentAlias','System','customer','%s%d','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ids','omit','getMessages','hasOwnProperty','order','sort','where','pick','ChatInteractionId','filter','map','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMyMessages','nolimit','includeAgent','push','addTags','setTags','spread','Tag','emit','chatInteractionTags:save','removeTags','unix','toString','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','read','Account','get','mkdirSync','Chat','Owner','createdAt','disposition','browserName','osName','referer','customerIp','customerPort','N.A.','existsSync','createReadStream','pipe','lastName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./chatInteraction.socket','register','jayson/promise','client','http','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf378,0x18e));var _0x8f37=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xf378[_0x1d1779];return _0x2377e9;};'use strict';var rimraf=require(_0x8f37('0x0'));var zipdir=require(_0x8f37('0x1'));var rp=require(_0x8f37('0x2'));var moment=require('moment');var BPromise=require(_0x8f37('0x3'));var Mustache=require(_0x8f37('0x4'));var util=require(_0x8f37('0x5'));var path=require(_0x8f37('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8f37('0x7'));var Redis=require('ioredis');var interaction=require(_0x8f37('0x8'));var qs=require(_0x8f37('0x9'));var pdf=require(_0x8f37('0xa'));var logger=require(_0x8f37('0xb'))(_0x8f37('0xc'));var config=require(_0x8f37('0xd'));var db=require(_0x8f37('0xe'))['db'];config['redis']=_[_0x8f37('0xf')](config['redis'],{'host':_0x8f37('0x10'),'port':0x18eb});var socket=require(_0x8f37('0x11'))(new Redis(config[_0x8f37('0x12')]));require(_0x8f37('0x13'))[_0x8f37('0x14')](socket);var jayson=require(_0x8f37('0x15'));var client=jayson[_0x8f37('0x16')][_0x8f37('0x17')]({'port':0x232b});var client9004=jayson[_0x8f37('0x16')]['http']({'port':0x232c});function respondWithRpcPromise(_0x18621b,_0x181d76,_0x57dfb5,_0x373fde){return new BPromise(function(_0x357ed7,_0x16746d){var _0xe7faaa=_0x373fde||client;return _0xe7faaa[_0x8f37('0x18')](_0x18621b,_0x57dfb5)[_0x8f37('0x19')](function(_0x485644){logger['info'](_0x8f37('0x1a'),_0x181d76,_0x8f37('0x1b'));logger[_0x8f37('0x1c')](_0x8f37('0x1d'),_0x181d76,'request\x20sent',JSON[_0x8f37('0x1e')](_0x485644));if(_0x485644[_0x8f37('0x1f')]){if(_0x485644[_0x8f37('0x1f')][_0x8f37('0x20')]===0x1f4){logger[_0x8f37('0x1f')](_0x8f37('0x1a'),_0x181d76,_0x485644[_0x8f37('0x1f')][_0x8f37('0x21')]);return _0x16746d(_0x485644[_0x8f37('0x1f')][_0x8f37('0x21')]);}logger[_0x8f37('0x1f')](_0x8f37('0x1a'),_0x181d76,_0x485644['error'][_0x8f37('0x21')]);return _0x357ed7(_0x485644[_0x8f37('0x1f')][_0x8f37('0x21')]);}else{logger[_0x8f37('0x22')](_0x8f37('0x1a'),_0x181d76,'request\x20sent');_0x357ed7(_0x485644[_0x8f37('0x23')]['message']);}})[_0x8f37('0x24')](function(_0x4ca8e9){logger[_0x8f37('0x1f')]('ChatInteraction,\x20%s,\x20%s',_0x181d76,_0x4ca8e9);_0x16746d(_0x4ca8e9);});});}function respondWithStatusCode(_0x36017b,_0x6c4025){_0x6c4025=_0x6c4025||0xcc;return function(_0x3cb24e){if(_0x3cb24e){return _0x36017b['sendStatus'](_0x6c4025);}return _0x36017b['status'](_0x6c4025)[_0x8f37('0x25')]();};}function respondWithResult(_0xf8475e,_0xaf1ff4){_0xaf1ff4=_0xaf1ff4||0xc8;return function(_0x20cc37){if(_0x20cc37){return _0xf8475e[_0x8f37('0x26')](_0xaf1ff4)[_0x8f37('0x27')](_0x20cc37);}};}function respondWithFilteredResult(_0x517bc4,_0x1f436c){return function(_0xc5ca7a){if(_0xc5ca7a){var _0x528383=typeof _0x1f436c[_0x8f37('0x28')]==='undefined'&&typeof _0x1f436c[_0x8f37('0x29')]==='undefined';var _0x15ab23=_0xc5ca7a[_0x8f37('0x2a')];var _0x34881a=_0x528383?0x0:_0x1f436c[_0x8f37('0x28')];var _0x132573=_0x528383?_0xc5ca7a['count']:_0x1f436c[_0x8f37('0x28')]+_0x1f436c[_0x8f37('0x29')];var _0x192c94;if(_0x132573>=_0x15ab23){_0x132573=_0x15ab23;_0x192c94=0xc8;}else{_0x192c94=0xce;}_0x517bc4[_0x8f37('0x26')](_0x192c94);return _0x517bc4[_0x8f37('0x2b')]('Content-Range',_0x34881a+'-'+_0x132573+'/'+_0x15ab23)['json'](_0xc5ca7a);}return null;};}function saveUpdates(_0x147ada){return function(_0xe98fd7){if(_0xe98fd7){return _0xe98fd7['update'](_0x147ada)[_0x8f37('0x19')](function(_0x52852b){return _0x52852b;});}return null;};}function removeEntity(_0x2fb30a){return function(_0xbde708){if(_0xbde708){return _0xbde708[_0x8f37('0x2c')]()[_0x8f37('0x19')](function(){_0x2fb30a[_0x8f37('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0xff8a68){return function(_0x38087e){if(!_0x38087e){_0xff8a68[_0x8f37('0x2d')](0x194);}return _0x38087e;};}function handleError(_0x26b5eb,_0x373faf){_0x373faf=_0x373faf||0x1f4;return function(_0x4614c0){logger[_0x8f37('0x1f')](_0x4614c0[_0x8f37('0x2e')]);if(_0x4614c0[_0x8f37('0x2f')]){delete _0x4614c0[_0x8f37('0x2f')];}_0x26b5eb['status'](_0x373faf)['send'](_0x4614c0);};}function getMustacheRender(_0x44abab,_0x36c9b0){return Mustache[_0x8f37('0x30')](_0x44abab,_[_0x8f37('0x31')](_0x36c9b0['body'],{'contact':_0x36c9b0['contact'],'message':_0x36c9b0[_0x8f37('0x21')],'agent':_0x36c9b0['agent'],'interaction':_0x36c9b0[_0x8f37('0x32')],'account':_0x36c9b0[_0x8f37('0x33')]}))||'';}exports[_0x8f37('0x34')]=function(_0x1d5e13,_0x4da227){var _0x1cd378={};var _0x7c0249=_['map'](db[_0x8f37('0x35')]['rawAttributes'],function(_0x22fd6f){return{'name':_0x22fd6f[_0x8f37('0x36')],'type':_0x22fd6f['type']['key']};});_0x1cd378=qs[_0x8f37('0x37')](_0x7c0249,_0x1d5e13);return interaction[_0x8f37('0x38')](_0x8f37('0x39'),_0x1d5e13['query'],_0x1d5e13[_0x8f37('0x3a')],_0x1cd378,_0x7c0249)[_0x8f37('0x19')](respondWithFilteredResult(_0x4da227,_0x1cd378))[_0x8f37('0x24')](handleError(_0x4da227,null));};exports[_0x8f37('0x3b')]=function(_0x230351,_0x3968bf){var _0x1549ec={'raw':![],'where':{'id':_0x230351[_0x8f37('0x3c')]['id']}},_0x3830c4={};_0x3830c4[_0x8f37('0x3d')]=_[_0x8f37('0x3e')](db[_0x8f37('0x35')][_0x8f37('0x3f')]);_0x3830c4['query']=_[_0x8f37('0x3e')](_0x230351['query']);_0x3830c4[_0x8f37('0x40')]=_[_0x8f37('0x41')](_0x3830c4[_0x8f37('0x3d')],_0x3830c4[_0x8f37('0x42')]);_0x1549ec['attributes']=_['intersection'](_0x3830c4[_0x8f37('0x3d')],qs[_0x8f37('0x43')](_0x230351[_0x8f37('0x42')][_0x8f37('0x43')]));_0x1549ec[_0x8f37('0x44')]=_0x1549ec[_0x8f37('0x44')][_0x8f37('0x45')]?_0x1549ec[_0x8f37('0x44')]:_0x3830c4['model'];if(_0x230351['query'][_0x8f37('0x46')]){_0x1549ec[_0x8f37('0x47')]=[{'all':!![]}];}_0x1549ec=_['merge']({},_0x1549ec,_0x230351[_0x8f37('0x48')]);return db[_0x8f37('0x35')][_0x8f37('0x49')](_0x1549ec)['then'](handleEntityNotFound(_0x3968bf,null))[_0x8f37('0x19')](respondWithResult(_0x3968bf,null))[_0x8f37('0x24')](handleError(_0x3968bf,null));};exports[_0x8f37('0x4a')]=function(_0x401c5f,_0x14e43f){return db[_0x8f37('0x35')][_0x8f37('0x4a')](_0x401c5f['body'],{})[_0x8f37('0x19')](respondWithResult(_0x14e43f,0xc9))[_0x8f37('0x24')](handleError(_0x14e43f,null));};exports[_0x8f37('0x4b')]=function(_0x410dd4,_0xbccb24){if(_0x410dd4[_0x8f37('0x4c')]['id']){delete _0x410dd4['body']['id'];}return db[_0x8f37('0x35')][_0x8f37('0x49')]({'where':{'id':_0x410dd4[_0x8f37('0x3c')]['id']}})[_0x8f37('0x19')](handleEntityNotFound(_0xbccb24,null))[_0x8f37('0x19')](saveUpdates(_0x410dd4[_0x8f37('0x4c')],null))['then'](respondWithResult(_0xbccb24,null))[_0x8f37('0x24')](handleError(_0xbccb24,null));};exports[_0x8f37('0x2c')]=function(_0x1a5d68,_0xbeec17){return db[_0x8f37('0x35')][_0x8f37('0x49')]({'where':{'id':_0x1a5d68[_0x8f37('0x3c')]['id']}})[_0x8f37('0x19')](handleEntityNotFound(_0xbeec17,null))[_0x8f37('0x19')](removeEntity(_0xbeec17,null))[_0x8f37('0x24')](handleError(_0xbeec17,null));};exports['describe']=function(_0x654d8e,_0x82b688){return db['ChatInteraction'][_0x8f37('0x4d')]()[_0x8f37('0x19')](respondWithResult(_0x82b688,null))[_0x8f37('0x24')](handleError(_0x82b688,null));};exports[_0x8f37('0x4e')]=function(_0x2cd9ea,_0x533ef2){var _0x474331=_0x2cd9ea[_0x8f37('0x3c')]['id'];var _0x39e9e4;var _0x1921df;var _0x673b7d;return db[_0x8f37('0x35')][_0x8f37('0x4f')]({'where':{'id':_0x474331}})['then'](function(_0x2856ff){_0x39e9e4=_0x2856ff;return db[_0x8f37('0x50')][_0x8f37('0x4f')]({'where':{'id':_0x2856ff[_0x8f37('0x51')]},'attributes':['id',_0x8f37('0x52'),_0x8f37('0x53'),_0x8f37('0x54'),_0x8f37('0x55'),'vidaooMetadata'],'raw':!![]});})[_0x8f37('0x19')](function(_0xb14342){if(_0xb14342&&_0xb14342['vidaooApiKey']&&_0xb14342[_0x8f37('0x53')]){_0x1921df=_0xb14342;var _0x1797b2={'interaction':{'id':_0x474331},'agent':{'id':_0x2cd9ea[_0x8f37('0x3a')]['id'],'name':_0x2cd9ea[_0x8f37('0x3a')][_0x8f37('0x2f')],'fullname':_0x2cd9ea['user'][_0x8f37('0x56')],'email':_0x2cd9ea[_0x8f37('0x3a')]['email']},'contact':_0x2cd9ea[_0x8f37('0x4c')][_0x8f37('0x57')],'account':_0x2cd9ea[_0x8f37('0x4c')]['account']};var _0x7cad03={'rejectUnauthorized':![],'method':_0x8f37('0x58'),'url':_0x8f37('0x59'),'headers':{'X-APIKEY':_0xb14342['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x2cd9ea[_0x8f37('0x3a')][_0x8f37('0x5a')]],'buttons':null,'topic':_0x1921df['vidaooTopic'],'note':_['isNull'](_0x1921df[_0x8f37('0x55')])?null:getMustacheRender(_0x1921df[_0x8f37('0x55')],_0x1797b2),'metadata':null},'redirect':_0x8f37('0x5b'),'json':!![]};try{if(!_[_0x8f37('0x5c')](_0x1921df[_0x8f37('0x5d')])){var _0x5eb841=getMustacheRender(_0x1921df['vidaooMetadata'],_0x1797b2);var _0x1043a5=JSON[_0x8f37('0x5e')](_0x5eb841);_0x7cad03['body'][_0x8f37('0x5f')]=_0x1043a5;}}catch(_0xf26cd2){throw new db[(_0x8f37('0x60'))][(_0x8f37('0x61'))](_0x8f37('0x62'));}return rp(_0x7cad03);}else{throw new db['Sequelize'][(_0x8f37('0x61'))](_0x8f37('0x63'));}})[_0x8f37('0x19')](function(_0xe7b740){_0x673b7d=_0xe7b740;if(_0x673b7d['id']){var _0x475f2f={'body':_0x673b7d['join_url'],'ChatWebsiteId':_0x1921df['id'],'ChatInteractionId':_0x39e9e4['id'],'direction':_0x8f37('0x64'),'UserId':_0x2cd9ea[_0x8f37('0x3a')]['id']};return db[_0x8f37('0x65')][_0x8f37('0x4a')](_0x475f2f,{});}else{throw new db['Sequelize']['ValidationError'](_0x8f37('0x66'));}})['then'](function(){return _0x39e9e4['updateAttributes']({'vidaooSessionId':_0x673b7d['id']});})[_0x8f37('0x19')](respondWithResult(_0x533ef2,null))[_0x8f37('0x24')](handleError(_0x533ef2,null));};exports[_0x8f37('0x67')]=function(_0x434e26,_0x1eaef8){if(_0x434e26[_0x8f37('0x4c')]['id']){delete _0x434e26[_0x8f37('0x4c')]['id'];}return db[_0x8f37('0x35')]['find']({'where':{'id':_0x434e26[_0x8f37('0x3c')]['id']},'include':[{'model':db['CmContact'],'as':_0x8f37('0x68')}]})[_0x8f37('0x19')](handleEntityNotFound(_0x1eaef8,null))['then'](saveUpdates(_0x434e26[_0x8f37('0x4c')],null))[_0x8f37('0x19')](respondWithResult(_0x1eaef8,null))[_0x8f37('0x24')](handleError(_0x1eaef8,null));};exports[_0x8f37('0x69')]=function(_0x34a77f,_0x4bd5c6){if(_0x34a77f[_0x8f37('0x4c')]['id']){delete _0x34a77f[_0x8f37('0x4c')]['id'];}return db[_0x8f37('0x35')][_0x8f37('0x49')]({'where':{'id':_0x34a77f[_0x8f37('0x3c')]['id']}})[_0x8f37('0x19')](function(_0x493039){if(!_0x493039){logger['error'](_0x8f37('0x6a'),_0x8f37('0x69'),0x194,'entity\x20not\x20found');_0x4bd5c6[_0x8f37('0x2d')](0x194);}else{if(_0x493039[_0x8f37('0x6b')]){throw new db[(_0x8f37('0x60'))][(_0x8f37('0x61'))](_0x8f37('0x6c'));}}return _0x493039;})[_0x8f37('0x19')](function(_0x57d41e){if(_0x57d41e){return _0x57d41e[_0x8f37('0x4b')]({'closed':_0x34a77f[_0x8f37('0x4c')][_0x8f37('0x6d')],'disposition':_0x34a77f['body']['disposition']})[_0x8f37('0x19')](function(_0x4f75da){return _0x4f75da;});}})[_0x8f37('0x19')](function(){return respondWithRpcPromise('AbandonInteraction','abandon',_0x34a77f[_0x8f37('0x4c')],client9004);})[_0x8f37('0x19')](respondWithResult(_0x4bd5c6,null))[_0x8f37('0x24')](handleError(_0x4bd5c6,null));};exports[_0x8f37('0x6e')]=function(_0x12f335,_0x1d360f){_0x12f335[_0x8f37('0x4c')][_0x8f37('0x2f')]=_0x12f335[_0x8f37('0x6f')][_0x8f37('0x70')];_0x12f335['body']['basename']=_0x12f335[_0x8f37('0x6f')][_0x8f37('0x71')];_0x12f335['body']['type']=_0x12f335[_0x8f37('0x6f')]['mimetype'];return db[_0x8f37('0x72')][_0x8f37('0x4a')](_0x12f335[_0x8f37('0x4c')])[_0x8f37('0x19')](respondWithResult(_0x1d360f,0xc9))[_0x8f37('0x24')](handleError(_0x1d360f,null));};exports[_0x8f37('0x73')]=function(_0x5e4dbc,_0x430ac9){return db['ChatInteraction']['findOne']({'where':{'id':_0x5e4dbc['params']['id']},'raw':!![]})[_0x8f37('0x19')](handleEntityNotFound(_0x430ac9,null))[_0x8f37('0x19')](function(_0x4e3a0e){if(_0x4e3a0e){if(_0x4e3a0e[_0x8f37('0x6d')]){return _0x430ac9[_0x8f37('0x26')](0x193)[_0x8f37('0x27')]({'status':0x193,'message':'Unauthorized'});}return db['Attachment']['findOne']({'where':{'id':_0x5e4dbc[_0x8f37('0x42')][_0x8f37('0x74')]},'raw':!![]})['then'](handleEntityNotFound(_0x430ac9,null));}})[_0x8f37('0x19')](function(_0x1b11d6){if(_0x1b11d6){var _0x5c65db=_0x1b11d6['ChatOfflineMessageId']!==null;var _0x193f82=path['join'](config[_0x8f37('0x75')],'server/files/attachments/');if(_0x5c65db){_0x193f82=path['join'](_0x193f82,_0x8f37('0x76'));}var _0xdb5263=path[_0x8f37('0x77')](_0x193f82,_0x1b11d6[_0x8f37('0x78')]);return _0x430ac9[_0x8f37('0x79')](_0xdb5263);}})[_0x8f37('0x24')](handleError(_0x430ac9,null));};exports[_0x8f37('0x7a')]=function(_0x290056,_0x55c272){var _0x34b2be=null;var _0x19a697=null;var _0x280a59=null;if(_0x290056[_0x8f37('0x4c')]['id']){delete _0x290056[_0x8f37('0x4c')]['id'];}if(_0x290056[_0x8f37('0x4c')][_0x8f37('0x7b')]){_0x280a59=path[_0x8f37('0x77')](config[_0x8f37('0x75')],_0x8f37('0x7c'),util['format'](_0x8f37('0x7d'),Date[_0x8f37('0x7e')]()));_0x290056[_0x8f37('0x4c')][_0x8f37('0x7f')]=_0x280a59;}return db[_0x8f37('0x35')][_0x8f37('0x49')]({'where':{'id':_0x290056[_0x8f37('0x3c')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x8f37('0x80'),'include':[{'model':db[_0x8f37('0x81')],'as':_0x8f37('0x81')}]}]})[_0x8f37('0x19')](handleEntityNotFound(_0x55c272,null))[_0x8f37('0x19')](saveUpdates(_0x290056[_0x8f37('0x4c')],null))[_0x8f37('0x19')](function(_0x458b96){if(_0x458b96){_0x34b2be=_0x458b96;return db['ChatWebsite']['find']({'where':{'id':_0x34b2be['ChatWebsiteId']}});}})[_0x8f37('0x19')](function(_0x1461b9){if(_0x1461b9){_0x19a697=_0x1461b9;return db[_0x8f37('0x82')]['find']({'where':{'id':_0x34b2be[_0x8f37('0x83')]}});}})[_0x8f37('0x19')](function(_0x24460b){if(_0x24460b){if(_0x280a59){var _0x20b824=null;for(var _0xf799f=0x1;_0xf799f<_0x34b2be[_0x8f37('0x80')]['length'];++_0xf799f){_0x20b824=_0x34b2be[_0x8f37('0x80')][_0xf799f];var _0x35373a=_0x20b824['UserId']?util[_0x8f37('0x84')]('%s%d',_0x19a697[_0x8f37('0x85')],_0x20b824[_0x8f37('0x6b')]):_0x8f37('0x86');var _0x4ac5c6=_0x290056[_0x8f37('0x4c')][_0x8f37('0x87')]||util['format'](_0x8f37('0x88'),_0x8f37('0x89'),_0x20b824[_0x8f37('0x83')]);switch(_0x19a697[_0x8f37('0x8a')]){case _0x8f37('0x8b'):_0x35373a=_0x20b824[_0x8f37('0x6b')]?util[_0x8f37('0x84')](_0x8f37('0x88'),_0x19a697[_0x8f37('0x85')],_0x20b824[_0x8f37('0x6b')]):_0x8f37('0x86');break;case _0x8f37('0x8c'):_0x35373a=_0x20b824['UserId']?_0x20b824[_0x8f37('0x81')][_0x8f37('0x8d')]||_0x20b824[_0x8f37('0x81')][_0x8f37('0x56')]:_0x8f37('0x86');break;case _0x8f37('0x8e'):_0x35373a=_0x20b824[_0x8f37('0x6b')]?_0x20b824[_0x8f37('0x81')][_0x8f37('0x56')]:'System';break;default:_0x35373a=_0x20b824[_0x8f37('0x6b')]?util[_0x8f37('0x84')]('%s%d',_0x19a697[_0x8f37('0x85')],_0x20b824[_0x8f37('0x6b')]):_0x8f37('0x86');}var _0x5ce2ec=util[_0x8f37('0x84')](_0x8f37('0x8f'),moment(_0x20b824['createdAt'])[_0x8f37('0x84')]('MM/DD/YYYY\x20HH:mm:ss'),_0x20b824[_0x8f37('0x90')]==='in'?_0x4ac5c6:_0x35373a,_0x20b824['body']);if(!_0x20b824[_0x8f37('0x91')]){fs[_0x8f37('0x92')](_0x280a59,_0x5ce2ec);}}return db[_0x8f37('0x93')][_0x8f37('0x4f')]({'where':{'service':!![]},'include':[{'model':db[_0x8f37('0x94')],'as':_0x8f37('0x95'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x8f37('0x96'),'raw':!![]}]}]});}}})['then'](function(_0x43f16f){if(!_0x43f16f||!_0x43f16f[_0x8f37('0x95')]||!_0x290056[_0x8f37('0x4c')])return _0x34b2be;var _0x414cff=_0x43f16f['getSmtpOptions']();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x414cff,'message':{'from':util['format'](_0x8f37('0x97'),_0x43f16f[_0x8f37('0x2f')],_0x43f16f[_0x8f37('0x5a')]||_0x43f16f['Smtp'][_0x8f37('0x3a')]),'to':_0x290056[_0x8f37('0x4c')][_0x8f37('0x7b')],'subject':_0x8f37('0x98'),'text':util[_0x8f37('0x84')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x290056[_0x8f37('0x4c')]['mailTranscript']),'attachments':[{'path':_0x280a59}]}})['then'](function(){return _0x34b2be;})[_0x8f37('0x24')](function(_0x56bade){logger[_0x8f37('0x1f')](_0x56bade);});})[_0x8f37('0x19')](respondWithStatusCode(_0x55c272,0xc8))[_0x8f37('0x24')](handleError(_0x55c272,null));};exports[_0x8f37('0x99')]=function(_0x1b0343,_0x15b4fc){return db[_0x8f37('0x65')][_0x8f37('0x49')]({'where':{'id':_0x1b0343[_0x8f37('0x3c')]['id']}})[_0x8f37('0x19')](handleEntityNotFound(_0x15b4fc,null))[_0x8f37('0x19')](function(_0x3f0510){if(_0x3f0510){return _0x3f0510['addMessage'](_0x1b0343[_0x8f37('0x4c')][_0x8f37('0x9a')],_[_0x8f37('0x9b')](_0x1b0343[_0x8f37('0x4c')],[_0x8f37('0x9a'),'id'])||{});}})[_0x8f37('0x19')](respondWithResult(_0x15b4fc,null))[_0x8f37('0x24')](handleError(_0x15b4fc,null));};exports[_0x8f37('0x9c')]=function(_0x4431b2,_0x14f091){var _0x1809f5={'raw':![],'where':{}};var _0x38d0f3={};var _0x14ff6c={'count':0x0,'rows':[]};return db[_0x8f37('0x35')][_0x8f37('0x4f')]({'where':{'id':_0x4431b2['params']['id']}})[_0x8f37('0x19')](handleEntityNotFound(_0x14f091,null))[_0x8f37('0x19')](function(_0x4909f3){if(_0x4909f3){_0x38d0f3[_0x8f37('0x3d')]=_[_0x8f37('0x3e')](db[_0x8f37('0x65')]['rawAttributes']);_0x38d0f3['query']=_[_0x8f37('0x3e')](_0x4431b2[_0x8f37('0x42')]);_0x38d0f3[_0x8f37('0x40')]=_[_0x8f37('0x41')](_0x38d0f3[_0x8f37('0x3d')],_0x38d0f3['query']);_0x1809f5[_0x8f37('0x44')]=_[_0x8f37('0x41')](_0x38d0f3[_0x8f37('0x3d')],qs['fields'](_0x4431b2[_0x8f37('0x42')]['fields']));_0x1809f5[_0x8f37('0x44')]=_0x1809f5[_0x8f37('0x44')]['length']?_0x1809f5[_0x8f37('0x44')]:_0x38d0f3[_0x8f37('0x3d')];if(!_0x4431b2['query'][_0x8f37('0x9d')]('nolimit')){_0x1809f5[_0x8f37('0x29')]=qs[_0x8f37('0x29')](_0x4431b2[_0x8f37('0x42')][_0x8f37('0x29')]);_0x1809f5[_0x8f37('0x28')]=qs[_0x8f37('0x28')](_0x4431b2['query'][_0x8f37('0x28')]);}_0x1809f5[_0x8f37('0x9e')]=qs['sort'](_0x4431b2[_0x8f37('0x42')][_0x8f37('0x9f')]);_0x1809f5[_0x8f37('0xa0')]=qs['filters'](_[_0x8f37('0xa1')](_0x4431b2[_0x8f37('0x42')],_0x38d0f3[_0x8f37('0x40')]));_0x1809f5[_0x8f37('0xa0')][_0x8f37('0xa2')]=_0x4909f3['id'];if(_0x4431b2[_0x8f37('0x42')][_0x8f37('0xa3')]){_0x1809f5[_0x8f37('0xa0')]=_[_0x8f37('0x31')](_0x1809f5[_0x8f37('0xa0')],{'$or':_[_0x8f37('0xa4')](_0x1809f5[_0x8f37('0x44')],function(_0x2c108f){var _0x3cd7d0={};_0x3cd7d0[_0x2c108f]={'$like':'%'+_0x4431b2[_0x8f37('0x42')][_0x8f37('0xa3')]+'%'};return _0x3cd7d0;})});}if(_0x4431b2[_0x8f37('0x42')][_0x8f37('0xa5')]){var _0xc3e13f=_0x4431b2['query'][_0x8f37('0xa5')][_0x8f37('0xa6')](',');var _0x40bf79={};_0x40bf79[_0xc3e13f[0x0]]={'$gte':moment(_0xc3e13f[0x1])[_0x8f37('0x84')](_0x8f37('0xa7'))};_0x1809f5[_0x8f37('0xa0')]=_[_0x8f37('0x31')](_0x1809f5[_0x8f37('0xa0')],_0x40bf79);}_0x1809f5=_[_0x8f37('0x31')]({},_0x1809f5,_0x4431b2[_0x8f37('0x48')]);return db['ChatMessage'][_0x8f37('0x2a')]({'where':_0x1809f5['where']})[_0x8f37('0x19')](function(_0x3d1455){_0x14ff6c[_0x8f37('0x2a')]=_0x3d1455;if(_0x4431b2[_0x8f37('0x42')][_0x8f37('0x46')]){_0x1809f5['include']=[{'all':!![]}];}return db[_0x8f37('0x65')][_0x8f37('0x38')](_0x1809f5);})[_0x8f37('0x19')](function(_0x5d6f2f){_0x14ff6c['rows']=_0x5d6f2f;return _0x14ff6c;});}})['then'](respondWithFilteredResult(_0x14f091,_0x1809f5))[_0x8f37('0x24')](handleError(_0x14f091,null));};exports[_0x8f37('0xa8')]=function(_0x3c9552,_0xe98a86){var _0x4a459d={'where':{}},_0x33c8d6={},_0x5ebb6e={'count':0x0,'rows':[]};return db[_0x8f37('0x35')][_0x8f37('0x4f')]({'where':{'id':_0x3c9552[_0x8f37('0x3c')]['id']}})['then'](handleEntityNotFound(_0xe98a86,null))[_0x8f37('0x19')](function(_0x1a005d){if(_0x1a005d){_0x33c8d6[_0x8f37('0x3d')]=_['keys'](db[_0x8f37('0x65')]['rawAttributes']);_0x33c8d6[_0x8f37('0x42')]=_[_0x8f37('0x3e')](_0x3c9552[_0x8f37('0x42')]);_0x33c8d6['filters']=_[_0x8f37('0x41')](_0x33c8d6[_0x8f37('0x3d')],_0x33c8d6[_0x8f37('0x42')]);_0x4a459d[_0x8f37('0x44')]=_[_0x8f37('0x41')](_0x33c8d6['model'],qs[_0x8f37('0x43')](_0x3c9552[_0x8f37('0x42')][_0x8f37('0x43')]));_0x4a459d[_0x8f37('0x44')]=_0x4a459d[_0x8f37('0x44')][_0x8f37('0x45')]?_0x4a459d[_0x8f37('0x44')]:_0x33c8d6[_0x8f37('0x3d')];if(!_0x3c9552[_0x8f37('0x42')]['hasOwnProperty'](_0x8f37('0xa9'))){_0x4a459d[_0x8f37('0x29')]=qs[_0x8f37('0x29')](_0x3c9552[_0x8f37('0x42')]['limit']);_0x4a459d[_0x8f37('0x28')]=qs[_0x8f37('0x28')](_0x3c9552[_0x8f37('0x42')][_0x8f37('0x28')]);}_0x4a459d[_0x8f37('0x9e')]=qs[_0x8f37('0x9f')](_0x3c9552[_0x8f37('0x42')][_0x8f37('0x9f')]);_0x4a459d[_0x8f37('0xa0')]=qs['filters'](_['pick'](_0x3c9552[_0x8f37('0x42')],_0x33c8d6['filters']));_0x4a459d[_0x8f37('0xa0')][_0x8f37('0xa2')]=_0x1a005d['id'];if(_0x3c9552['query'][_0x8f37('0xa3')]){_0x4a459d[_0x8f37('0xa0')]=_[_0x8f37('0x31')](_0x4a459d['where'],{'$or':_[_0x8f37('0xa4')](_0x4a459d[_0x8f37('0x44')],function(_0x26292e){var _0x1cec20={};_0x1cec20[_0x26292e]={'$like':'%'+_0x3c9552[_0x8f37('0x42')][_0x8f37('0xa3')]+'%'};return _0x1cec20;})});}_0x4a459d[_0x8f37('0xa0')][_0x8f37('0x91')]=![];if(_0x3c9552[_0x8f37('0x42')]['id']){_0x4a459d['where']['id']={'$gt':_0x3c9552['query']['id']};}_0x4a459d=_[_0x8f37('0x31')]({},_0x4a459d,_0x3c9552['options']);return db[_0x8f37('0x65')][_0x8f37('0x2a')]({'where':_0x4a459d[_0x8f37('0xa0')]})[_0x8f37('0x19')](function(_0x33cac2){_0x5ebb6e[_0x8f37('0x2a')]=_0x33cac2;_0x4a459d[_0x8f37('0x47')]=[];if(_0x3c9552[_0x8f37('0x42')][_0x8f37('0xaa')]){_0x4a459d['include'][_0x8f37('0xab')]({'model':db[_0x8f37('0x81')],'as':'User','attributes':['id',_0x8f37('0x56'),'alias']});}if(_0x3c9552['query'][_0x8f37('0x46')]){_0x4a459d[_0x8f37('0x47')]=[{'all':!![]}];}return db[_0x8f37('0x65')][_0x8f37('0x38')](_0x4a459d);})[_0x8f37('0x19')](function(_0x597edf){_0x5ebb6e['rows']=_0x597edf;return _0x5ebb6e;});}})[_0x8f37('0x19')](respondWithFilteredResult(_0xe98a86,_0x4a459d))[_0x8f37('0x24')](handleError(_0xe98a86,null));};exports[_0x8f37('0xac')]=function(_0x486ade,_0x32ad3b){return db['ChatInteraction'][_0x8f37('0x49')]({'where':{'id':_0x486ade[_0x8f37('0x3c')]['id']}})[_0x8f37('0x19')](handleEntityNotFound(_0x32ad3b,null))[_0x8f37('0x19')](function(_0x72fc5e){if(_0x72fc5e){return _0x72fc5e[_0x8f37('0xad')](_0x486ade['body'][_0x8f37('0x9a')],_['omit'](_0x486ade[_0x8f37('0x4c')],['ids','id'])||{})[_0x8f37('0xae')](function(){return db[_0x8f37('0xaf')]['findAll']({'attributes':['id',_0x8f37('0x2f'),'color'],'where':{'id':_0x486ade['body'][_0x8f37('0x9a')]}});})[_0x8f37('0x19')](function(_0x4d7bc2){socket[_0x8f37('0xb0')](_0x8f37('0xb1'),{'id':Number(_0x486ade[_0x8f37('0x3c')]['id']),'tags':_0x4d7bc2||[]});return{'id':Number(_0x486ade['params']['id']),'tags':_0x4d7bc2||[]};});}})[_0x8f37('0x19')](respondWithResult(_0x32ad3b,null))[_0x8f37('0x24')](handleError(_0x32ad3b,null));};exports[_0x8f37('0xb2')]=function(_0x3cbe49,_0x31ee87){return db[_0x8f37('0x35')][_0x8f37('0x49')]({'where':{'id':_0x3cbe49[_0x8f37('0x3c')]['id']}})['then'](handleEntityNotFound(_0x31ee87,null))[_0x8f37('0x19')](function(_0x46553b){if(_0x46553b){return _0x46553b[_0x8f37('0xb2')](_0x3cbe49[_0x8f37('0x42')][_0x8f37('0x9a')]);}})[_0x8f37('0x19')](respondWithStatusCode(_0x31ee87,null))[_0x8f37('0x24')](handleError(_0x31ee87,null));};exports[_0x8f37('0x79')]=function(_0x18755e,_0x9ca19b){var _0x37e8be=moment()[_0x8f37('0xb3')]()[_0x8f37('0xb4')]();var _0x53a9f1=path[_0x8f37('0x77')](config[_0x8f37('0x75')],_0x8f37('0xb5'),_0x8f37('0xb6'),_0x8f37('0xb7'));var _0xbe2b04=path[_0x8f37('0x77')](config[_0x8f37('0x75')],_0x8f37('0xb5'),'files',_0x8f37('0xb8'));var _0x46f1ac=path[_0x8f37('0x77')](_0x53a9f1,_0x37e8be);var _0x234344=util[_0x8f37('0x84')](_0x8f37('0xb9'),_0x18755e[_0x8f37('0x3c')]['id'],_0x37e8be);var _0x5618a5=path[_0x8f37('0x77')](_0x53a9f1,_0x234344);var _0x4cc480=[];_0x4cc480[_0x8f37('0xab')]({'model':db[_0x8f37('0x81')],'as':_0x8f37('0x81'),'attributes':['id',_0x8f37('0x56')],'raw':!![]});_0x4cc480[_0x8f37('0xab')]({'model':db[_0x8f37('0x82')],'as':_0x8f37('0x68'),'attributes':['id',_0x8f37('0xba'),'lastName'],'raw':!![]});if(_0x18755e['query'][_0x8f37('0xb8')]){_0x4cc480[_0x8f37('0xab')]({'model':db['Attachment'],'as':_0x8f37('0x72'),'raw':!![]});}var _0x30a794=[{'model':db[_0x8f37('0x65')],'as':_0x8f37('0x80'),'attributes':['id','body','createdAt',_0x8f37('0x90'),'secret',_0x8f37('0xbb')],'include':_0x4cc480}];_0x30a794[_0x8f37('0xab')]({'model':db[_0x8f37('0x50')],'as':_0x8f37('0xbc'),'attributes':['id','name']});_0x30a794[_0x8f37('0xab')]({'model':db[_0x8f37('0x81')],'as':'Owner','attributes':['id',_0x8f37('0x56')]});return db['ChatInteraction']['find']({'where':{'id':_0x18755e['params']['id']},'include':_0x30a794})[_0x8f37('0x19')](handleEntityNotFound(_0x9ca19b,null))[_0x8f37('0x19')](function(_0x11c9bd){if(_0x11c9bd){var _0x1cf4e3=_0x11c9bd[_0x8f37('0xbd')]({'plain':!![]});fs[_0x8f37('0xbe')](_0x46f1ac);var _0x55c5b8={'channel':_0x8f37('0xbf'),'account':_0x1cf4e3[_0x8f37('0xbc')]['name'],'agent':_0x1cf4e3[_0x8f37('0xc0')]?_0x1cf4e3[_0x8f37('0xc0')]['fullname']:'N.A.','createdAt':moment(_0x1cf4e3[_0x8f37('0xc1')])[_0x8f37('0x84')]('YYYY-MM-DD\x20HH:mm:ss')[_0x8f37('0xb4')](),'closedAt':_0x1cf4e3[_0x8f37('0x6d')]?moment(_0x1cf4e3['closedAt'])[_0x8f37('0x84')]('YYYY-MM-DD\x20HH:mm:ss')[_0x8f37('0xb4')]():'','disposition':_0x1cf4e3[_0x8f37('0xc2')],'chatInfo':{'browser':_0x1cf4e3[_0x8f37('0xc3')],'os':_0x1cf4e3[_0x8f37('0xc4')],'referer':_0x1cf4e3[_0x8f37('0xc5')],'customerIp':_0x1cf4e3[_0x8f37('0xc6')],'customerPort':_0x1cf4e3[_0x8f37('0xc7')]?_0x1cf4e3['customerPort']:_0x8f37('0xc8')},'messages':_(_0x1cf4e3[_0x8f37('0x80')])['tail']()[_0x8f37('0xa3')]({'secret':![]})[_0x8f37('0xa4')](function(_0x48bb0f){if(_0x48bb0f[_0x8f37('0x72')]){var _0x4f46c1=path['join'](_0xbe2b04,_0x48bb0f[_0x8f37('0x72')]['basename']);if(fs[_0x8f37('0xc9')](_0x4f46c1)){fs[_0x8f37('0xca')](_0x4f46c1)[_0x8f37('0xcb')](fs['createWriteStream'](path['join'](_0x46f1ac,_0x48bb0f['Attachment'][_0x8f37('0x78')])));}}return{'date':moment(_0x48bb0f[_0x8f37('0xc1')])[_0x8f37('0x84')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x48bb0f[_0x8f37('0x90')]===_0x8f37('0x64')?_0x48bb0f['User']?_0x48bb0f[_0x8f37('0x81')][_0x8f37('0x56')]:'System':_0x48bb0f[_0x8f37('0x68')][_0x8f37('0xba')]+(_0x48bb0f['Contact'][_0x8f37('0xcc')]?'\x20'+_0x48bb0f[_0x8f37('0x68')][_0x8f37('0xcc')]:''),'body':_0x48bb0f[_0x8f37('0x72')]?_0x48bb0f['Attachment'][_0x8f37('0x78')]:_0x48bb0f[_0x8f37('0x4c')],'direction':_0x48bb0f['direction']===_0x8f37('0x64')?'A':'C','secret':_0x48bb0f['secret'],'read':_0x48bb0f[_0x8f37('0xbb')],'attachment':_0x48bb0f[_0x8f37('0x72')]};})['value']()};return ejs[_0x8f37('0xcd')](path[_0x8f37('0x77')](config['root'],'server',_0x8f37('0xce'),_0x8f37('0xcf')),{'interaction':_0x55c5b8})['then'](function(_0x347d63){var _0x2fbc35=path[_0x8f37('0x77')](_0x46f1ac,_0x8f37('0xd0')+_0x1cf4e3['id']+'-'+_0x37e8be+_0x8f37('0xd1'));var _0x5bc7fc={'path':_0x2fbc35,'channel':'Chat','interactionId':_0x1cf4e3['id']};return pdf[_0x8f37('0xd2')](_0x347d63,_0x5bc7fc);})[_0x8f37('0x19')](function(){return new Promise(function(_0x580174,_0x5caa23){zipdir(_0x46f1ac,{'saveTo':_0x5618a5},function(_0x106840,_0x2259cc){if(_0x106840)return _0x5caa23(_0x106840);return _0x580174(_0x2259cc);});})[_0x8f37('0x19')](function(){return new BPromise(function(_0x4d40a5,_0x27b231){rimraf(_0x46f1ac,function(_0x55ab6d){if(_0x55ab6d)_0x27b231(_0x55ab6d);return _0x4d40a5();});});})['then'](function(){return _0x9ca19b[_0x8f37('0x79')](_0x5618a5,_0x234344,function(_0x568cba){if(_0x568cba){logger[_0x8f37('0x1f')](_0x8f37('0xd3'),_0x568cba);}else{fs[_0x8f37('0xd4')](_0x5618a5);}});});});}else{return _0x9ca19b[_0x8f37('0x2d')](0xc8);}})[_0x8f37('0x24')](handleError(_0x9ca19b,null));}; \ No newline at end of file +var _0x0cf2=['error','message','result','catch','status','limit','undefined','offset','count','Content-Range','json','update','end','stack','name','render','agent','interaction','index','map','rawAttributes','fieldName','type','findAll','chat','user','show','model','keys','query','filters','intersection','attributes','fields','include','merge','ChatInteraction','create','body','find','params','describe','findOne','ChatWebsite','vidaooApiKey','vidaooTopic','vidaooNote','vidaooEscalation','fullname','email','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','vidaooMetadata','parse','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','updateAttributes','customUpdate','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','sendStatus','Interaction\x20already\x20assigned','closed','abandon','attachmentUpload','file','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','Messages','User','ContactId','length','UserId','%s%d','agentAlias','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','System','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','MailServerOut','CloudProvider','Smtp','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','hasOwnProperty','nolimit','order','sort','where','pick','filter','split','options','includeAll','rows','getMyMessages','ChatInteractionId','secret','includeAgent','setTags','spread','Tag','color','removeTags','download','unix','toString','server','files','tmp','attachments','push','firstName','lastName','read','Account','Owner','get','mkdirSync','Chat','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','browserName','osName','referer','customerIp','customerPort','N.A.','tail','createReadStream','pipe','createWriteStream','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','register','jayson/promise','http','client','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x9ab959,_0x32f2e2){var _0x37fbe3=function(_0x1d9c28){while(--_0x1d9c28){_0x9ab959['push'](_0x9ab959['shift']());}};_0x37fbe3(++_0x32f2e2);}(_0x0cf2,0xb6));var _0x20cf=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0x0cf2[_0xe66cf2];return _0x2d84e7;};'use strict';var rimraf=require(_0x20cf('0x0'));var zipdir=require(_0x20cf('0x1'));var rp=require('request-promise');var moment=require(_0x20cf('0x2'));var BPromise=require(_0x20cf('0x3'));var Mustache=require(_0x20cf('0x4'));var util=require(_0x20cf('0x5'));var path=require(_0x20cf('0x6'));var ejs=require(_0x20cf('0x7'));var fs=require('fs');var _=require(_0x20cf('0x8'));var Redis=require(_0x20cf('0x9'));var interaction=require(_0x20cf('0xa'));var qs=require('../../components/parsers/qs');var pdf=require(_0x20cf('0xb'));var logger=require(_0x20cf('0xc'))('api');var config=require(_0x20cf('0xd'));var db=require(_0x20cf('0xe'))['db'];config[_0x20cf('0xf')]=_['defaults'](config[_0x20cf('0xf')],{'host':_0x20cf('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x20cf('0xf')]));require('./chatInteraction.socket')[_0x20cf('0x11')](socket);var jayson=require(_0x20cf('0x12'));var client=jayson['client'][_0x20cf('0x13')]({'port':0x232b});var client9004=jayson[_0x20cf('0x14')][_0x20cf('0x13')]({'port':0x232c});function respondWithRpcPromise(_0x24fa7c,_0x239dc7,_0x3cadae,_0x470cb1){return new BPromise(function(_0x5b0e95,_0x3f9ab1){var _0x2e8fdf=_0x470cb1||client;return _0x2e8fdf[_0x20cf('0x15')](_0x24fa7c,_0x3cadae)[_0x20cf('0x16')](function(_0xc8be91){logger[_0x20cf('0x17')](_0x20cf('0x18'),_0x239dc7,_0x20cf('0x19'));logger[_0x20cf('0x1a')](_0x20cf('0x1b'),_0x239dc7,_0x20cf('0x19'),JSON[_0x20cf('0x1c')](_0xc8be91));if(_0xc8be91[_0x20cf('0x1d')]){if(_0xc8be91[_0x20cf('0x1d')]['code']===0x1f4){logger[_0x20cf('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x239dc7,_0xc8be91[_0x20cf('0x1d')]['message']);return _0x3f9ab1(_0xc8be91[_0x20cf('0x1d')][_0x20cf('0x1e')]);}logger[_0x20cf('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x239dc7,_0xc8be91[_0x20cf('0x1d')]['message']);return _0x5b0e95(_0xc8be91[_0x20cf('0x1d')][_0x20cf('0x1e')]);}else{logger['info'](_0x20cf('0x18'),_0x239dc7,_0x20cf('0x19'));_0x5b0e95(_0xc8be91[_0x20cf('0x1f')][_0x20cf('0x1e')]);}})[_0x20cf('0x20')](function(_0x4aa17c){logger[_0x20cf('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x239dc7,_0x4aa17c);_0x3f9ab1(_0x4aa17c);});});}function respondWithStatusCode(_0x1ef71b,_0x13e0d1){_0x13e0d1=_0x13e0d1||0xcc;return function(_0x4ffc1a){if(_0x4ffc1a){return _0x1ef71b['sendStatus'](_0x13e0d1);}return _0x1ef71b[_0x20cf('0x21')](_0x13e0d1)['end']();};}function respondWithResult(_0x11924f,_0x4a3464){_0x4a3464=_0x4a3464||0xc8;return function(_0x2403af){if(_0x2403af){return _0x11924f[_0x20cf('0x21')](_0x4a3464)['json'](_0x2403af);}};}function respondWithFilteredResult(_0x2db25f,_0x1ecf73){return function(_0x4dccd6){if(_0x4dccd6){var _0x530ae3=typeof _0x1ecf73['offset']==='undefined'&&typeof _0x1ecf73[_0x20cf('0x22')]===_0x20cf('0x23');var _0x29c97a=_0x4dccd6['count'];var _0x1dce3d=_0x530ae3?0x0:_0x1ecf73[_0x20cf('0x24')];var _0x28d9a5=_0x530ae3?_0x4dccd6[_0x20cf('0x25')]:_0x1ecf73[_0x20cf('0x24')]+_0x1ecf73[_0x20cf('0x22')];var _0x193d2e;if(_0x28d9a5>=_0x29c97a){_0x28d9a5=_0x29c97a;_0x193d2e=0xc8;}else{_0x193d2e=0xce;}_0x2db25f['status'](_0x193d2e);return _0x2db25f['set'](_0x20cf('0x26'),_0x1dce3d+'-'+_0x28d9a5+'/'+_0x29c97a)[_0x20cf('0x27')](_0x4dccd6);}return null;};}function saveUpdates(_0x5c0f7c){return function(_0x4b846b){if(_0x4b846b){return _0x4b846b[_0x20cf('0x28')](_0x5c0f7c)[_0x20cf('0x16')](function(_0x4aa609){return _0x4aa609;});}return null;};}function removeEntity(_0x45294f){return function(_0x6f1d90){if(_0x6f1d90){return _0x6f1d90['destroy']()[_0x20cf('0x16')](function(){_0x45294f[_0x20cf('0x21')](0xcc)[_0x20cf('0x29')]();});}};}function handleEntityNotFound(_0x9ea48e){return function(_0x4fba82){if(!_0x4fba82){_0x9ea48e['sendStatus'](0x194);}return _0x4fba82;};}function handleError(_0xff9c20,_0x1a63ba){_0x1a63ba=_0x1a63ba||0x1f4;return function(_0x4de5e3){logger[_0x20cf('0x1d')](_0x4de5e3[_0x20cf('0x2a')]);if(_0x4de5e3[_0x20cf('0x2b')]){delete _0x4de5e3[_0x20cf('0x2b')];}_0xff9c20[_0x20cf('0x21')](_0x1a63ba)['send'](_0x4de5e3);};}function getMustacheRender(_0x246caf,_0x1bdbfd){return Mustache[_0x20cf('0x2c')](_0x246caf,_['merge'](_0x1bdbfd['body'],{'contact':_0x1bdbfd['contact'],'message':_0x1bdbfd[_0x20cf('0x1e')],'agent':_0x1bdbfd[_0x20cf('0x2d')],'interaction':_0x1bdbfd[_0x20cf('0x2e')],'account':_0x1bdbfd['account']}))||'';}exports[_0x20cf('0x2f')]=function(_0x431958,_0x22b950){var _0x24659f={};var _0x42281a=_[_0x20cf('0x30')](db['ChatInteraction'][_0x20cf('0x31')],function(_0x33837a){return{'name':_0x33837a[_0x20cf('0x32')],'type':_0x33837a[_0x20cf('0x33')]['key']};});_0x24659f=qs['getOptions'](_0x42281a,_0x431958);return interaction[_0x20cf('0x34')](_0x20cf('0x35'),_0x431958['query'],_0x431958[_0x20cf('0x36')],_0x24659f,_0x42281a)['then'](respondWithFilteredResult(_0x22b950,_0x24659f))[_0x20cf('0x20')](handleError(_0x22b950,null));};exports[_0x20cf('0x37')]=function(_0x1415b5,_0x295c0c){var _0x7c3d6={'raw':![],'where':{'id':_0x1415b5['params']['id']}},_0x41e45a={};_0x41e45a[_0x20cf('0x38')]=_[_0x20cf('0x39')](db['ChatInteraction'][_0x20cf('0x31')]);_0x41e45a['query']=_[_0x20cf('0x39')](_0x1415b5[_0x20cf('0x3a')]);_0x41e45a[_0x20cf('0x3b')]=_[_0x20cf('0x3c')](_0x41e45a[_0x20cf('0x38')],_0x41e45a['query']);_0x7c3d6[_0x20cf('0x3d')]=_[_0x20cf('0x3c')](_0x41e45a[_0x20cf('0x38')],qs[_0x20cf('0x3e')](_0x1415b5[_0x20cf('0x3a')]['fields']));_0x7c3d6[_0x20cf('0x3d')]=_0x7c3d6[_0x20cf('0x3d')]['length']?_0x7c3d6['attributes']:_0x41e45a['model'];if(_0x1415b5['query']['includeAll']){_0x7c3d6[_0x20cf('0x3f')]=[{'all':!![]}];}_0x7c3d6=_[_0x20cf('0x40')]({},_0x7c3d6,_0x1415b5['options']);return db[_0x20cf('0x41')]['find'](_0x7c3d6)[_0x20cf('0x16')](handleEntityNotFound(_0x295c0c,null))[_0x20cf('0x16')](respondWithResult(_0x295c0c,null))[_0x20cf('0x20')](handleError(_0x295c0c,null));};exports[_0x20cf('0x42')]=function(_0x30d548,_0x4dee71){return db[_0x20cf('0x41')][_0x20cf('0x42')](_0x30d548['body'],{})[_0x20cf('0x16')](respondWithResult(_0x4dee71,0xc9))[_0x20cf('0x20')](handleError(_0x4dee71,null));};exports[_0x20cf('0x28')]=function(_0x457f89,_0x5415cd){if(_0x457f89[_0x20cf('0x43')]['id']){delete _0x457f89[_0x20cf('0x43')]['id'];}return db[_0x20cf('0x41')][_0x20cf('0x44')]({'where':{'id':_0x457f89[_0x20cf('0x45')]['id']}})[_0x20cf('0x16')](handleEntityNotFound(_0x5415cd,null))['then'](saveUpdates(_0x457f89[_0x20cf('0x43')],null))[_0x20cf('0x16')](respondWithResult(_0x5415cd,null))['catch'](handleError(_0x5415cd,null));};exports['destroy']=function(_0x2b93df,_0x5049eb){return db[_0x20cf('0x41')]['find']({'where':{'id':_0x2b93df[_0x20cf('0x45')]['id']}})[_0x20cf('0x16')](handleEntityNotFound(_0x5049eb,null))[_0x20cf('0x16')](removeEntity(_0x5049eb,null))[_0x20cf('0x20')](handleError(_0x5049eb,null));};exports[_0x20cf('0x46')]=function(_0x55ae9d,_0x5585b4){return db['ChatInteraction'][_0x20cf('0x46')]()[_0x20cf('0x16')](respondWithResult(_0x5585b4,null))[_0x20cf('0x20')](handleError(_0x5585b4,null));};exports['createVidaooSession']=function(_0x2eb2d2,_0xed1182){var _0x1d2b62=_0x2eb2d2[_0x20cf('0x45')]['id'];var _0x26ca36;var _0x3ba8ab;var _0x3852e9;return db[_0x20cf('0x41')][_0x20cf('0x47')]({'where':{'id':_0x1d2b62}})['then'](function(_0x5e892d){_0x26ca36=_0x5e892d;return db[_0x20cf('0x48')][_0x20cf('0x47')]({'where':{'id':_0x5e892d['ChatWebsiteId']},'attributes':['id',_0x20cf('0x49'),'vidaooEscalation',_0x20cf('0x4a'),_0x20cf('0x4b'),'vidaooMetadata'],'raw':!![]});})['then'](function(_0x34be9c){if(_0x34be9c&&_0x34be9c[_0x20cf('0x49')]&&_0x34be9c[_0x20cf('0x4c')]){_0x3ba8ab=_0x34be9c;var _0x37e0fa={'interaction':{'id':_0x1d2b62},'agent':{'id':_0x2eb2d2['user']['id'],'name':_0x2eb2d2['user']['name'],'fullname':_0x2eb2d2[_0x20cf('0x36')][_0x20cf('0x4d')],'email':_0x2eb2d2['user'][_0x20cf('0x4e')]},'contact':_0x2eb2d2[_0x20cf('0x43')]['contact'],'account':_0x2eb2d2[_0x20cf('0x43')][_0x20cf('0x4f')]};var _0x47485d={'rejectUnauthorized':![],'method':_0x20cf('0x50'),'url':_0x20cf('0x51'),'headers':{'X-APIKEY':_0x34be9c[_0x20cf('0x49')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x2eb2d2[_0x20cf('0x36')]['email']],'buttons':null,'topic':_0x3ba8ab['vidaooTopic'],'note':_[_0x20cf('0x52')](_0x3ba8ab['vidaooNote'])?null:getMustacheRender(_0x3ba8ab['vidaooNote'],_0x37e0fa),'metadata':null},'redirect':_0x20cf('0x53'),'json':!![]};try{if(!_[_0x20cf('0x52')](_0x3ba8ab[_0x20cf('0x54')])){var _0x15b8b2=getMustacheRender(_0x3ba8ab[_0x20cf('0x54')],_0x37e0fa);var _0x354979=JSON[_0x20cf('0x55')](_0x15b8b2);_0x47485d['body']['metadata']=_0x354979;}}catch(_0x219097){throw new db[(_0x20cf('0x56'))][(_0x20cf('0x57'))](_0x20cf('0x58'));}return rp(_0x47485d);}else{throw new db[(_0x20cf('0x56'))][(_0x20cf('0x57'))](_0x20cf('0x59'));}})[_0x20cf('0x16')](function(_0xc8dd97){_0x3852e9=_0xc8dd97;if(_0x3852e9['id']){var _0x17bb89={'body':_0x3852e9[_0x20cf('0x5a')],'ChatWebsiteId':_0x3ba8ab['id'],'ChatInteractionId':_0x26ca36['id'],'direction':_0x20cf('0x5b'),'UserId':_0x2eb2d2[_0x20cf('0x36')]['id']};return db[_0x20cf('0x5c')]['create'](_0x17bb89,{});}else{throw new db[(_0x20cf('0x56'))][(_0x20cf('0x57'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x20cf('0x16')](function(){return _0x26ca36[_0x20cf('0x5d')]({'vidaooSessionId':_0x3852e9['id']});})[_0x20cf('0x16')](respondWithResult(_0xed1182,null))[_0x20cf('0x20')](handleError(_0xed1182,null));};exports[_0x20cf('0x5e')]=function(_0x482411,_0x41d56f){if(_0x482411[_0x20cf('0x43')]['id']){delete _0x482411[_0x20cf('0x43')]['id'];}return db['ChatInteraction'][_0x20cf('0x44')]({'where':{'id':_0x482411['params']['id']},'include':[{'model':db[_0x20cf('0x5f')],'as':_0x20cf('0x60')}]})[_0x20cf('0x16')](handleEntityNotFound(_0x41d56f,null))[_0x20cf('0x16')](saveUpdates(_0x482411[_0x20cf('0x43')],null))[_0x20cf('0x16')](respondWithResult(_0x41d56f,null))['catch'](handleError(_0x41d56f,null));};exports['abandon']=function(_0x4810b2,_0x5be4b3){if(_0x4810b2[_0x20cf('0x43')]['id']){delete _0x4810b2[_0x20cf('0x43')]['id'];}return db[_0x20cf('0x41')][_0x20cf('0x44')]({'where':{'id':_0x4810b2['params']['id']}})[_0x20cf('0x16')](function(_0x1f0be4){if(!_0x1f0be4){logger[_0x20cf('0x1d')](_0x20cf('0x61'),'abandon',0x194,'entity\x20not\x20found');_0x5be4b3[_0x20cf('0x62')](0x194);}else{if(_0x1f0be4['UserId']){throw new db[(_0x20cf('0x56'))][(_0x20cf('0x57'))](_0x20cf('0x63'));}}return _0x1f0be4;})[_0x20cf('0x16')](function(_0x11e8c3){if(_0x11e8c3){return _0x11e8c3[_0x20cf('0x28')]({'closed':_0x4810b2[_0x20cf('0x43')][_0x20cf('0x64')],'disposition':_0x4810b2['body']['disposition']})['then'](function(_0x4ffebd){return _0x4ffebd;});}})[_0x20cf('0x16')](function(){return respondWithRpcPromise('AbandonInteraction',_0x20cf('0x65'),_0x4810b2[_0x20cf('0x43')],client9004);})[_0x20cf('0x16')](respondWithResult(_0x5be4b3,null))['catch'](handleError(_0x5be4b3,null));};exports[_0x20cf('0x66')]=function(_0x300e55,_0x9066d1){_0x300e55[_0x20cf('0x43')][_0x20cf('0x2b')]=_0x300e55[_0x20cf('0x67')]['originalname'];_0x300e55[_0x20cf('0x43')][_0x20cf('0x68')]=_0x300e55[_0x20cf('0x67')][_0x20cf('0x69')];_0x300e55[_0x20cf('0x43')][_0x20cf('0x33')]=_0x300e55['file'][_0x20cf('0x6a')];return db[_0x20cf('0x6b')][_0x20cf('0x42')](_0x300e55[_0x20cf('0x43')])[_0x20cf('0x16')](respondWithResult(_0x9066d1,0xc9))[_0x20cf('0x20')](handleError(_0x9066d1,null));};exports[_0x20cf('0x6c')]=function(_0x2b288a,_0x4fa955){return db[_0x20cf('0x41')]['findOne']({'where':{'id':_0x2b288a[_0x20cf('0x45')]['id']},'raw':!![]})[_0x20cf('0x16')](handleEntityNotFound(_0x4fa955,null))[_0x20cf('0x16')](function(_0x38fc00){if(_0x38fc00){if(_0x38fc00[_0x20cf('0x64')]){return _0x4fa955[_0x20cf('0x21')](0x193)[_0x20cf('0x27')]({'status':0x193,'message':_0x20cf('0x6d')});}return db['Attachment'][_0x20cf('0x47')]({'where':{'id':_0x2b288a[_0x20cf('0x3a')][_0x20cf('0x6e')]},'raw':!![]})['then'](handleEntityNotFound(_0x4fa955,null));}})[_0x20cf('0x16')](function(_0x1b1340){if(_0x1b1340){var _0x162b1e=_0x1b1340[_0x20cf('0x6f')]!==null;var _0xd51fd1=path[_0x20cf('0x70')](config[_0x20cf('0x71')],_0x20cf('0x72'));if(_0x162b1e){_0xd51fd1=path[_0x20cf('0x70')](_0xd51fd1,_0x20cf('0x73'));}var _0x1d4dc4=path[_0x20cf('0x70')](_0xd51fd1,_0x1b1340[_0x20cf('0x68')]);return _0x4fa955['download'](_0x1d4dc4);}})[_0x20cf('0x20')](handleError(_0x4fa955,null));};exports[_0x20cf('0x74')]=function(_0x4dba17,_0x7500a4){var _0x5d1dbe=null;var _0x4e21d5=null;var _0xb4627f=null;if(_0x4dba17['body']['id']){delete _0x4dba17[_0x20cf('0x43')]['id'];}if(_0x4dba17[_0x20cf('0x43')][_0x20cf('0x75')]){_0xb4627f=path[_0x20cf('0x70')](config[_0x20cf('0x71')],_0x20cf('0x76'),util[_0x20cf('0x77')](_0x20cf('0x78'),Date[_0x20cf('0x79')]()));_0x4dba17[_0x20cf('0x43')]['pathTranscript']=_0xb4627f;}return db['ChatInteraction'][_0x20cf('0x44')]({'where':{'id':_0x4dba17[_0x20cf('0x45')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x20cf('0x7a'),'include':[{'model':db[_0x20cf('0x7b')],'as':_0x20cf('0x7b')}]}]})[_0x20cf('0x16')](handleEntityNotFound(_0x7500a4,null))['then'](saveUpdates(_0x4dba17['body'],null))[_0x20cf('0x16')](function(_0x4fff12){if(_0x4fff12){_0x5d1dbe=_0x4fff12;return db[_0x20cf('0x48')]['find']({'where':{'id':_0x5d1dbe['ChatWebsiteId']}});}})[_0x20cf('0x16')](function(_0x599676){if(_0x599676){_0x4e21d5=_0x599676;return db[_0x20cf('0x5f')]['find']({'where':{'id':_0x5d1dbe[_0x20cf('0x7c')]}});}})[_0x20cf('0x16')](function(_0x32fbfa){if(_0x32fbfa){if(_0xb4627f){var _0xb12b95=null;for(var _0x164991=0x1;_0x164991<_0x5d1dbe[_0x20cf('0x7a')][_0x20cf('0x7d')];++_0x164991){_0xb12b95=_0x5d1dbe['Messages'][_0x164991];var _0x5ec54e=_0xb12b95[_0x20cf('0x7e')]?util[_0x20cf('0x77')](_0x20cf('0x7f'),_0x4e21d5[_0x20cf('0x80')],_0xb12b95['UserId']):'System';var _0x130d32=_0x4dba17['body'][_0x20cf('0x81')]||util[_0x20cf('0x77')](_0x20cf('0x7f'),_0x20cf('0x82'),_0xb12b95[_0x20cf('0x7c')]);switch(_0x4e21d5[_0x20cf('0x83')]){case _0x20cf('0x84'):_0x5ec54e=_0xb12b95['UserId']?util[_0x20cf('0x77')](_0x20cf('0x7f'),_0x4e21d5['agentAlias'],_0xb12b95[_0x20cf('0x7e')]):'System';break;case _0x20cf('0x85'):_0x5ec54e=_0xb12b95[_0x20cf('0x7e')]?_0xb12b95[_0x20cf('0x7b')][_0x20cf('0x86')]||_0xb12b95[_0x20cf('0x7b')]['fullname']:_0x20cf('0x87');break;case _0x20cf('0x88'):_0x5ec54e=_0xb12b95[_0x20cf('0x7e')]?_0xb12b95[_0x20cf('0x7b')][_0x20cf('0x4d')]:_0x20cf('0x87');break;default:_0x5ec54e=_0xb12b95[_0x20cf('0x7e')]?util['format'](_0x20cf('0x7f'),_0x4e21d5[_0x20cf('0x80')],_0xb12b95[_0x20cf('0x7e')]):_0x20cf('0x87');}var _0x4211f3=util['format'](_0x20cf('0x89'),moment(_0xb12b95[_0x20cf('0x8a')])[_0x20cf('0x77')](_0x20cf('0x8b')),_0xb12b95[_0x20cf('0x8c')]==='in'?_0x130d32:_0x5ec54e,_0xb12b95[_0x20cf('0x43')]);if(!_0xb12b95['secret']){fs[_0x20cf('0x8d')](_0xb4627f,_0x4211f3);}}return db[_0x20cf('0x8e')][_0x20cf('0x47')]({'where':{'service':!![]},'include':[{'model':db[_0x20cf('0x8f')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x20cf('0x90')],'as':_0x20cf('0x90'),'raw':!![]}]}]});}}})[_0x20cf('0x16')](function(_0x5ecb2f){if(!_0x5ecb2f||!_0x5ecb2f[_0x20cf('0x91')]||!_0x4dba17['body'])return _0x5d1dbe;var _0x30c1d7=_0x5ecb2f['getSmtpOptions']();return respondWithRpcPromise(_0x20cf('0x92'),_0x20cf('0x93'),{'account':_0x30c1d7,'message':{'from':util['format'](_0x20cf('0x94'),_0x5ecb2f[_0x20cf('0x2b')],_0x5ecb2f[_0x20cf('0x4e')]||_0x5ecb2f['Smtp'][_0x20cf('0x36')]),'to':_0x4dba17[_0x20cf('0x43')][_0x20cf('0x75')],'subject':_0x20cf('0x95'),'text':util[_0x20cf('0x77')](_0x20cf('0x96'),_0x4dba17['body'][_0x20cf('0x75')]),'attachments':[{'path':_0xb4627f}]}})[_0x20cf('0x16')](function(){return _0x5d1dbe;})[_0x20cf('0x20')](function(_0xd0d5fe){logger[_0x20cf('0x1d')](_0xd0d5fe);});})[_0x20cf('0x16')](respondWithStatusCode(_0x7500a4,0xc8))[_0x20cf('0x20')](handleError(_0x7500a4,null));};exports[_0x20cf('0x97')]=function(_0x5d8fff,_0x2c7a9a){return db[_0x20cf('0x5c')]['find']({'where':{'id':_0x5d8fff[_0x20cf('0x45')]['id']}})['then'](handleEntityNotFound(_0x2c7a9a,null))[_0x20cf('0x16')](function(_0x39a238){if(_0x39a238){return _0x39a238['addMessage'](_0x5d8fff[_0x20cf('0x43')][_0x20cf('0x98')],_[_0x20cf('0x99')](_0x5d8fff['body'],[_0x20cf('0x98'),'id'])||{});}})['then'](respondWithResult(_0x2c7a9a,null))[_0x20cf('0x20')](handleError(_0x2c7a9a,null));};exports['getMessages']=function(_0x4e0156,_0x4cb327){var _0x4dcd65={'raw':![],'where':{}};var _0xfddb04={};var _0x586a10={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x20cf('0x47')]({'where':{'id':_0x4e0156[_0x20cf('0x45')]['id']}})[_0x20cf('0x16')](handleEntityNotFound(_0x4cb327,null))['then'](function(_0x477aa0){if(_0x477aa0){_0xfddb04[_0x20cf('0x38')]=_[_0x20cf('0x39')](db['ChatMessage'][_0x20cf('0x31')]);_0xfddb04[_0x20cf('0x3a')]=_[_0x20cf('0x39')](_0x4e0156[_0x20cf('0x3a')]);_0xfddb04['filters']=_[_0x20cf('0x3c')](_0xfddb04[_0x20cf('0x38')],_0xfddb04[_0x20cf('0x3a')]);_0x4dcd65[_0x20cf('0x3d')]=_[_0x20cf('0x3c')](_0xfddb04[_0x20cf('0x38')],qs['fields'](_0x4e0156[_0x20cf('0x3a')]['fields']));_0x4dcd65[_0x20cf('0x3d')]=_0x4dcd65['attributes']['length']?_0x4dcd65[_0x20cf('0x3d')]:_0xfddb04['model'];if(!_0x4e0156[_0x20cf('0x3a')][_0x20cf('0x9a')](_0x20cf('0x9b'))){_0x4dcd65[_0x20cf('0x22')]=qs[_0x20cf('0x22')](_0x4e0156[_0x20cf('0x3a')]['limit']);_0x4dcd65[_0x20cf('0x24')]=qs[_0x20cf('0x24')](_0x4e0156[_0x20cf('0x3a')][_0x20cf('0x24')]);}_0x4dcd65[_0x20cf('0x9c')]=qs[_0x20cf('0x9d')](_0x4e0156['query']['sort']);_0x4dcd65[_0x20cf('0x9e')]=qs[_0x20cf('0x3b')](_[_0x20cf('0x9f')](_0x4e0156[_0x20cf('0x3a')],_0xfddb04[_0x20cf('0x3b')]));_0x4dcd65[_0x20cf('0x9e')]['ChatInteractionId']=_0x477aa0['id'];if(_0x4e0156['query']['filter']){_0x4dcd65['where']=_[_0x20cf('0x40')](_0x4dcd65['where'],{'$or':_[_0x20cf('0x30')](_0x4dcd65[_0x20cf('0x3d')],function(_0x2a8380){var _0x2b28e3={};_0x2b28e3[_0x2a8380]={'$like':'%'+_0x4e0156[_0x20cf('0x3a')][_0x20cf('0xa0')]+'%'};return _0x2b28e3;})});}if(_0x4e0156[_0x20cf('0x3a')]['$gte']){var _0x233da3=_0x4e0156['query']['$gte'][_0x20cf('0xa1')](',');var _0x5d4d9e={};_0x5d4d9e[_0x233da3[0x0]]={'$gte':moment(_0x233da3[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x4dcd65[_0x20cf('0x9e')]=_['merge'](_0x4dcd65[_0x20cf('0x9e')],_0x5d4d9e);}_0x4dcd65=_[_0x20cf('0x40')]({},_0x4dcd65,_0x4e0156[_0x20cf('0xa2')]);return db['ChatMessage'][_0x20cf('0x25')]({'where':_0x4dcd65[_0x20cf('0x9e')]})[_0x20cf('0x16')](function(_0x238f91){_0x586a10[_0x20cf('0x25')]=_0x238f91;if(_0x4e0156['query'][_0x20cf('0xa3')]){_0x4dcd65[_0x20cf('0x3f')]=[{'all':!![]}];}return db[_0x20cf('0x5c')][_0x20cf('0x34')](_0x4dcd65);})['then'](function(_0x42489f){_0x586a10[_0x20cf('0xa4')]=_0x42489f;return _0x586a10;});}})[_0x20cf('0x16')](respondWithFilteredResult(_0x4cb327,_0x4dcd65))[_0x20cf('0x20')](handleError(_0x4cb327,null));};exports[_0x20cf('0xa5')]=function(_0xd6c2e4,_0x286239){var _0x1152ba={'where':{}},_0x245bd1={},_0x54b0d4={'count':0x0,'rows':[]};return db[_0x20cf('0x41')][_0x20cf('0x47')]({'where':{'id':_0xd6c2e4[_0x20cf('0x45')]['id']}})[_0x20cf('0x16')](handleEntityNotFound(_0x286239,null))['then'](function(_0x4457c9){if(_0x4457c9){_0x245bd1[_0x20cf('0x38')]=_['keys'](db['ChatMessage']['rawAttributes']);_0x245bd1['query']=_[_0x20cf('0x39')](_0xd6c2e4[_0x20cf('0x3a')]);_0x245bd1[_0x20cf('0x3b')]=_['intersection'](_0x245bd1['model'],_0x245bd1[_0x20cf('0x3a')]);_0x1152ba[_0x20cf('0x3d')]=_[_0x20cf('0x3c')](_0x245bd1[_0x20cf('0x38')],qs[_0x20cf('0x3e')](_0xd6c2e4[_0x20cf('0x3a')][_0x20cf('0x3e')]));_0x1152ba[_0x20cf('0x3d')]=_0x1152ba[_0x20cf('0x3d')]['length']?_0x1152ba[_0x20cf('0x3d')]:_0x245bd1[_0x20cf('0x38')];if(!_0xd6c2e4['query']['hasOwnProperty']('nolimit')){_0x1152ba[_0x20cf('0x22')]=qs[_0x20cf('0x22')](_0xd6c2e4['query'][_0x20cf('0x22')]);_0x1152ba['offset']=qs[_0x20cf('0x24')](_0xd6c2e4[_0x20cf('0x3a')][_0x20cf('0x24')]);}_0x1152ba[_0x20cf('0x9c')]=qs[_0x20cf('0x9d')](_0xd6c2e4[_0x20cf('0x3a')][_0x20cf('0x9d')]);_0x1152ba[_0x20cf('0x9e')]=qs[_0x20cf('0x3b')](_[_0x20cf('0x9f')](_0xd6c2e4[_0x20cf('0x3a')],_0x245bd1[_0x20cf('0x3b')]));_0x1152ba[_0x20cf('0x9e')][_0x20cf('0xa6')]=_0x4457c9['id'];if(_0xd6c2e4[_0x20cf('0x3a')]['filter']){_0x1152ba['where']=_[_0x20cf('0x40')](_0x1152ba[_0x20cf('0x9e')],{'$or':_[_0x20cf('0x30')](_0x1152ba[_0x20cf('0x3d')],function(_0x5293ad){var _0x17713a={};_0x17713a[_0x5293ad]={'$like':'%'+_0xd6c2e4[_0x20cf('0x3a')]['filter']+'%'};return _0x17713a;})});}_0x1152ba[_0x20cf('0x9e')][_0x20cf('0xa7')]=![];if(_0xd6c2e4[_0x20cf('0x3a')]['id']){_0x1152ba['where']['id']={'$gt':_0xd6c2e4[_0x20cf('0x3a')]['id']};}_0x1152ba=_[_0x20cf('0x40')]({},_0x1152ba,_0xd6c2e4[_0x20cf('0xa2')]);return db['ChatMessage'][_0x20cf('0x25')]({'where':_0x1152ba[_0x20cf('0x9e')]})[_0x20cf('0x16')](function(_0x21a650){_0x54b0d4[_0x20cf('0x25')]=_0x21a650;_0x1152ba[_0x20cf('0x3f')]=[];if(_0xd6c2e4[_0x20cf('0x3a')][_0x20cf('0xa8')]){_0x1152ba[_0x20cf('0x3f')]['push']({'model':db[_0x20cf('0x7b')],'as':'User','attributes':['id',_0x20cf('0x4d'),'alias']});}if(_0xd6c2e4[_0x20cf('0x3a')][_0x20cf('0xa3')]){_0x1152ba[_0x20cf('0x3f')]=[{'all':!![]}];}return db['ChatMessage'][_0x20cf('0x34')](_0x1152ba);})[_0x20cf('0x16')](function(_0x1067f0){_0x54b0d4[_0x20cf('0xa4')]=_0x1067f0;return _0x54b0d4;});}})[_0x20cf('0x16')](respondWithFilteredResult(_0x286239,_0x1152ba))[_0x20cf('0x20')](handleError(_0x286239,null));};exports['addTags']=function(_0x3ca75c,_0x3bcafe){return db[_0x20cf('0x41')][_0x20cf('0x44')]({'where':{'id':_0x3ca75c[_0x20cf('0x45')]['id']}})[_0x20cf('0x16')](handleEntityNotFound(_0x3bcafe,null))[_0x20cf('0x16')](function(_0x12cc21){if(_0x12cc21){return _0x12cc21[_0x20cf('0xa9')](_0x3ca75c[_0x20cf('0x43')][_0x20cf('0x98')],_[_0x20cf('0x99')](_0x3ca75c[_0x20cf('0x43')],[_0x20cf('0x98'),'id'])||{})[_0x20cf('0xaa')](function(){return db[_0x20cf('0xab')][_0x20cf('0x34')]({'attributes':['id','name',_0x20cf('0xac')],'where':{'id':_0x3ca75c[_0x20cf('0x43')][_0x20cf('0x98')]}});})[_0x20cf('0x16')](function(_0x133450){socket['emit']('chatInteractionTags:save',{'id':Number(_0x3ca75c[_0x20cf('0x45')]['id']),'tags':_0x133450||[]});return{'id':Number(_0x3ca75c[_0x20cf('0x45')]['id']),'tags':_0x133450||[]};});}})[_0x20cf('0x16')](respondWithResult(_0x3bcafe,null))[_0x20cf('0x20')](handleError(_0x3bcafe,null));};exports[_0x20cf('0xad')]=function(_0x3391da,_0x2efccc){return db[_0x20cf('0x41')][_0x20cf('0x44')]({'where':{'id':_0x3391da[_0x20cf('0x45')]['id']}})[_0x20cf('0x16')](handleEntityNotFound(_0x2efccc,null))['then'](function(_0x3eda38){if(_0x3eda38){return _0x3eda38[_0x20cf('0xad')](_0x3391da[_0x20cf('0x3a')][_0x20cf('0x98')]);}})[_0x20cf('0x16')](respondWithStatusCode(_0x2efccc,null))['catch'](handleError(_0x2efccc,null));};exports[_0x20cf('0xae')]=function(_0x25be1c,_0x982e98){var _0x1354d6=moment()[_0x20cf('0xaf')]()[_0x20cf('0xb0')]();var _0x3728d4=path[_0x20cf('0x70')](config[_0x20cf('0x71')],_0x20cf('0xb1'),_0x20cf('0xb2'),_0x20cf('0xb3'));var _0x3239be=path[_0x20cf('0x70')](config['root'],_0x20cf('0xb1'),'files',_0x20cf('0xb4'));var _0x307ad6=path['join'](_0x3728d4,_0x1354d6);var _0x2cbdec=util[_0x20cf('0x77')]('transcript-%d-%s.zip',_0x25be1c[_0x20cf('0x45')]['id'],_0x1354d6);var _0x55bfa7=path['join'](_0x3728d4,_0x2cbdec);var _0x50a219=[];_0x50a219[_0x20cf('0xb5')]({'model':db[_0x20cf('0x7b')],'as':_0x20cf('0x7b'),'attributes':['id','fullname'],'raw':!![]});_0x50a219[_0x20cf('0xb5')]({'model':db[_0x20cf('0x5f')],'as':_0x20cf('0x60'),'attributes':['id',_0x20cf('0xb6'),_0x20cf('0xb7')],'raw':!![]});if(_0x25be1c[_0x20cf('0x3a')][_0x20cf('0xb4')]){_0x50a219[_0x20cf('0xb5')]({'model':db[_0x20cf('0x6b')],'as':'Attachment','raw':!![]});}var _0x5077ad=[{'model':db['ChatMessage'],'as':_0x20cf('0x7a'),'attributes':['id','body','createdAt',_0x20cf('0x8c'),_0x20cf('0xa7'),_0x20cf('0xb8')],'include':_0x50a219}];_0x5077ad[_0x20cf('0xb5')]({'model':db[_0x20cf('0x48')],'as':_0x20cf('0xb9'),'attributes':['id','name']});_0x5077ad['push']({'model':db[_0x20cf('0x7b')],'as':_0x20cf('0xba'),'attributes':['id',_0x20cf('0x4d')]});return db[_0x20cf('0x41')][_0x20cf('0x44')]({'where':{'id':_0x25be1c[_0x20cf('0x45')]['id']},'include':_0x5077ad})[_0x20cf('0x16')](handleEntityNotFound(_0x982e98,null))[_0x20cf('0x16')](function(_0x674fc6){if(_0x674fc6){var _0x1cbd99=_0x674fc6[_0x20cf('0xbb')]({'plain':!![]});fs[_0x20cf('0xbc')](_0x307ad6);var _0x304aad={'channel':_0x20cf('0xbd'),'account':_0x1cbd99[_0x20cf('0xb9')][_0x20cf('0x2b')],'agent':_0x1cbd99[_0x20cf('0xba')]?_0x1cbd99[_0x20cf('0xba')]['fullname']:'N.A.','createdAt':moment(_0x1cbd99[_0x20cf('0x8a')])[_0x20cf('0x77')](_0x20cf('0xbe'))['toString'](),'closedAt':_0x1cbd99[_0x20cf('0x64')]?moment(_0x1cbd99[_0x20cf('0xbf')])[_0x20cf('0x77')](_0x20cf('0xbe'))[_0x20cf('0xb0')]():'','disposition':_0x1cbd99[_0x20cf('0xc0')],'chatInfo':{'browser':_0x1cbd99[_0x20cf('0xc1')],'os':_0x1cbd99[_0x20cf('0xc2')],'referer':_0x1cbd99[_0x20cf('0xc3')],'customerIp':_0x1cbd99[_0x20cf('0xc4')],'customerPort':_0x1cbd99['customerPort']?_0x1cbd99[_0x20cf('0xc5')]:_0x20cf('0xc6')},'messages':_(_0x1cbd99[_0x20cf('0x7a')])[_0x20cf('0xc7')]()[_0x20cf('0xa0')]({'secret':![]})[_0x20cf('0x30')](function(_0x5808ee){if(_0x5808ee['Attachment']){var _0x57a530=path['join'](_0x3239be,_0x5808ee[_0x20cf('0x6b')][_0x20cf('0x68')]);if(fs['existsSync'](_0x57a530)){fs[_0x20cf('0xc8')](_0x57a530)[_0x20cf('0xc9')](fs[_0x20cf('0xca')](path[_0x20cf('0x70')](_0x307ad6,_0x5808ee[_0x20cf('0x6b')][_0x20cf('0x68')])));}}return{'date':moment(_0x5808ee[_0x20cf('0x8a')])[_0x20cf('0x77')](_0x20cf('0xbe'))[_0x20cf('0xb0')](),'sender':_0x5808ee[_0x20cf('0x8c')]===_0x20cf('0x5b')?_0x5808ee[_0x20cf('0x7b')]?_0x5808ee[_0x20cf('0x7b')][_0x20cf('0x4d')]:_0x20cf('0x87'):_0x5808ee['Contact'][_0x20cf('0xb6')]+(_0x5808ee['Contact'][_0x20cf('0xb7')]?'\x20'+_0x5808ee['Contact'][_0x20cf('0xb7')]:''),'body':_0x5808ee['Attachment']?_0x5808ee[_0x20cf('0x6b')]['basename']:_0x5808ee[_0x20cf('0x43')],'direction':_0x5808ee[_0x20cf('0x8c')]===_0x20cf('0x5b')?'A':'C','secret':_0x5808ee[_0x20cf('0xa7')],'read':_0x5808ee[_0x20cf('0xb8')],'attachment':_0x5808ee[_0x20cf('0x6b')]};})[_0x20cf('0xcb')]()};return ejs[_0x20cf('0xcc')](path['join'](config[_0x20cf('0x71')],_0x20cf('0xb1'),_0x20cf('0xcd'),_0x20cf('0xce')),{'interaction':_0x304aad})[_0x20cf('0x16')](function(_0x1ae814){var _0x1b6895=path[_0x20cf('0x70')](_0x307ad6,_0x20cf('0xcf')+_0x1cbd99['id']+'-'+_0x1354d6+_0x20cf('0xd0'));var _0x31c131={'path':_0x1b6895,'channel':_0x20cf('0xbd'),'interactionId':_0x1cbd99['id']};return pdf[_0x20cf('0xd1')](_0x1ae814,_0x31c131);})[_0x20cf('0x16')](function(){return new Promise(function(_0x35ec08,_0x10f25a){zipdir(_0x307ad6,{'saveTo':_0x55bfa7},function(_0x1215a4,_0xbac6b4){if(_0x1215a4)return _0x10f25a(_0x1215a4);return _0x35ec08(_0xbac6b4);});})[_0x20cf('0x16')](function(){return new BPromise(function(_0x321a4d,_0x6ce3a5){rimraf(_0x307ad6,function(_0x13a219){if(_0x13a219)_0x6ce3a5(_0x13a219);return _0x321a4d();});});})[_0x20cf('0x16')](function(){return _0x982e98['download'](_0x55bfa7,_0x2cbdec,function(_0x348633){if(_0x348633){logger[_0x20cf('0x1d')](_0x20cf('0xd2'),_0x348633);}else{fs['unlinkSync'](_0x55bfa7);}});});});}else{return _0x982e98[_0x20cf('0x62')](0xc8);}})[_0x20cf('0x20')](handleError(_0x982e98,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 7df649a..46ea181 100644 --- a/server/api/chatInteraction/chatInteraction.events.js +++ b/server/api/chatInteraction/chatInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe8a7=['ChatInteraction','setMaxListeners','save','update','remove','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','exports','events','../../mysqldb'];(function(_0xbc2974,_0xec3342){var _0x3a5b4f=function(_0x5ec5b5){while(--_0x5ec5b5){_0xbc2974['push'](_0xbc2974['shift']());}};_0x3a5b4f(++_0xec3342);}(_0xe8a7,0x1b8));var _0x7e8a=function(_0x290578,_0x2d4981){_0x290578=_0x290578-0x0;var _0x387494=_0xe8a7[_0x290578];return _0x387494;};'use strict';var EventEmitter=require(_0x7e8a('0x0'));var ChatInteraction=require(_0x7e8a('0x1'))['db'][_0x7e8a('0x2')];var ChatMessage=require(_0x7e8a('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x7e8a('0x3')](0x0);var events={'afterCreate':_0x7e8a('0x4'),'afterUpdate':_0x7e8a('0x5'),'afterDestroy':_0x7e8a('0x6')};function emitEvent(_0x576f4c){return function(_0x59436b,_0x256912,_0x2f554c){_0x59436b['getUsers']({'attributes':['id'],'raw':!![]})[_0x7e8a('0x7')](function(_0x4e87e1){_0x59436b[_0x7e8a('0x8')](_0x7e8a('0x9'),_0x4e87e1[_0x7e8a('0xa')](function(_0x22fb3f){return{'id':_0x22fb3f['id']};}));return ChatMessage[_0x7e8a('0xb')]({'where':{'ChatInteractionId':_0x59436b['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7e8a('0x7')](function(_0x29700){_0x59436b[_0x7e8a('0x8')](_0x7e8a('0xc'),_0x29700[_0x7e8a('0xd')]);ChatInteractionEvents['emit'](_0x576f4c+':'+_0x59436b['id'],_0x59436b);ChatInteractionEvents[_0x7e8a('0xe')](_0x576f4c,_0x59436b);_0x2f554c(null);})[_0x7e8a('0xf')](_0x2f554c(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x7e8a('0x10')]=ChatInteractionEvents; \ No newline at end of file +var _0x20c3=['setDataValue','Users','map','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','ChatInteraction','../../mysqldb','setMaxListeners','save','update','remove','getUsers','then'];(function(_0x54b69f,_0x240de6){var _0x5d7826=function(_0x356161){while(--_0x356161){_0x54b69f['push'](_0x54b69f['shift']());}};_0x5d7826(++_0x240de6);}(_0x20c3,0x127));var _0x320c=function(_0x26e9d3,_0x4cb793){_0x26e9d3=_0x26e9d3-0x0;var _0x17739b=_0x20c3[_0x26e9d3];return _0x17739b;};'use strict';var EventEmitter=require(_0x320c('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x320c('0x1')];var ChatMessage=require(_0x320c('0x2'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x320c('0x3')](0x0);var events={'afterCreate':_0x320c('0x4'),'afterUpdate':_0x320c('0x5'),'afterDestroy':_0x320c('0x6')};function emitEvent(_0x5d4f97){return function(_0x418e04,_0x584b54,_0x1a984b){_0x418e04[_0x320c('0x7')]({'attributes':['id'],'raw':!![]})[_0x320c('0x8')](function(_0x4d3f1c){_0x418e04[_0x320c('0x9')](_0x320c('0xa'),_0x4d3f1c[_0x320c('0xb')](function(_0xad7c3f){return{'id':_0xad7c3f['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x418e04['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x25dd69){_0x418e04['setDataValue'](_0x320c('0xc'),_0x25dd69[_0x320c('0xd')]);ChatInteractionEvents[_0x320c('0xe')](_0x5d4f97+':'+_0x418e04['id'],_0x418e04);ChatInteractionEvents[_0x320c('0xe')](_0x5d4f97,_0x418e04);_0x1a984b(null);})[_0x320c('0xf')](_0x1a984b(null));};}for(var e in events){if(events[_0x320c('0x10')](e)){var event=events[e];ChatInteraction[_0x320c('0x11')](e,emitEvent(event));}}module[_0x320c('0x12')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 81b0f32..4a59a95 100644 --- a/server/api/chatInteraction/chatInteraction.model.js +++ b/server/api/chatInteraction/chatInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x908d=['../../config/logger','moment','request-promise','path','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x1ac120,_0x3e7e45){var _0x19b703=function(_0x5f32cb){while(--_0x5f32cb){_0x1ac120['push'](_0x1ac120['shift']());}};_0x19b703(++_0x3e7e45);}(_0x908d,0x10f));var _0xd908=function(_0x8c12db,_0x591626){_0x8c12db=_0x8c12db-0x0;var _0x1290a7=_0x908d[_0x8c12db];return _0x1290a7;};'use strict';var _=require('lodash');var util=require(_0xd908('0x0'));var logger=require(_0xd908('0x1'))('api');var moment=require(_0xd908('0x2'));var BPromise=require('bluebird');var rp=require(_0xd908('0x3'));var fs=require('fs');var path=require(_0xd908('0x4'));var rimraf=require('rimraf');var config=require(_0xd908('0x5'));var attributes=require(_0xd908('0x6'));module[_0xd908('0x7')]=function(_0x35ebb8,_0x5a68a1){return _0x35ebb8[_0xd908('0x8')](_0xd908('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2d2055,_0xba6c50,_0x4454e2){if(_0x2d2055[_0xd908('0xa')](_0xd908('0xb'))){_0x2d2055[_0xd908('0xc')]=moment()[_0xd908('0xd')](_0xd908('0xe'));}_0x4454e2(null,_0x2d2055);}},'charset':_0xd908('0xf'),'collate':_0xd908('0x10')});}; \ No newline at end of file +var _0xe773=['./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x3bee13,_0x29cae3){var _0x82c3cc=function(_0x41297c){while(--_0x41297c){_0x3bee13['push'](_0x3bee13['shift']());}};_0x82c3cc(++_0x29cae3);}(_0xe773,0xc4));var _0x3e77=function(_0x437ef0,_0x5e58f9){_0x437ef0=_0x437ef0-0x0;var _0x16056b=_0xe773[_0x437ef0];return _0x16056b;};'use strict';var _=require(_0x3e77('0x0'));var util=require(_0x3e77('0x1'));var logger=require(_0x3e77('0x2'))('api');var moment=require(_0x3e77('0x3'));var BPromise=require(_0x3e77('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3e77('0x5'));var rimraf=require(_0x3e77('0x6'));var config=require(_0x3e77('0x7'));var attributes=require(_0x3e77('0x8'));module[_0x3e77('0x9')]=function(_0x1281f7,_0x35f2da){return _0x1281f7['define'](_0x3e77('0xa'),attributes,{'tableName':_0x3e77('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3a01a2,_0x9c4746,_0x53dea4){if(_0x3a01a2['changed']('closed')){_0x3a01a2[_0x3e77('0xc')]=moment()[_0x3e77('0xd')](_0x3e77('0xe'));}_0x53dea4(null,_0x3a01a2);}},'charset':_0x3e77('0xf'),'collate':_0x3e77('0x10')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index d075ff0..c2c8272 100644 --- a/server/api/chatInteraction/chatInteraction.rpc.js +++ b/server/api/chatInteraction/chatInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x32b4=['options','raw','where','attributes','limit','ChatInteraction','find','addTags','ids','spread','debug','AddTags','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateChatInteraction','update','body'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x32b4,0x164));var _0x432b=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x32b4[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0x432b('0x0'));var util=require(_0x432b('0x1'));var moment=require(_0x432b('0x2'));var BPromise=require(_0x432b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x432b('0x4'))['db'];var utils=require(_0x432b('0x5'));var logger=require('../../config/logger')(_0x432b('0x6'));var config=require(_0x432b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x432b('0x8')][_0x432b('0x9')]({'port':0x232a});config[_0x432b('0xa')]=_[_0x432b('0xb')](config[_0x432b('0xa')],{'host':_0x432b('0xc'),'port':0x18eb});var socket=require(_0x432b('0xd'))(new Redis(config[_0x432b('0xa')]));require(_0x432b('0xe'))[_0x432b('0xf')](socket);function respondWithRpcPromise(_0x174737,_0x4cd957,_0x283f5f){return new BPromise(function(_0x3c9925,_0x3a734a){return client[_0x432b('0x10')](_0x174737,_0x283f5f)[_0x432b('0x11')](function(_0x45c250){logger[_0x432b('0x12')](_0x432b('0x13'),_0x4cd957,_0x432b('0x14'));logger['debug'](_0x432b('0x15'),_0x4cd957,_0x432b('0x14'),JSON[_0x432b('0x16')](_0x45c250));if(_0x45c250[_0x432b('0x17')]){if(_0x45c250[_0x432b('0x17')][_0x432b('0x18')]===0x1f4){logger[_0x432b('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x4cd957,_0x45c250[_0x432b('0x17')]['message']);return _0x3a734a(_0x45c250[_0x432b('0x17')][_0x432b('0x19')]);}logger[_0x432b('0x17')](_0x432b('0x13'),_0x4cd957,_0x45c250[_0x432b('0x17')][_0x432b('0x19')]);return _0x3c9925(_0x45c250['error'][_0x432b('0x19')]);}else{logger[_0x432b('0x12')](_0x432b('0x13'),_0x4cd957,'request\x20sent');_0x3c9925(_0x45c250[_0x432b('0x1a')][_0x432b('0x19')]);}})[_0x432b('0x1b')](function(_0x38ea99){logger[_0x432b('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x4cd957,_0x38ea99);_0x3a734a(_0x38ea99);});});}exports[_0x432b('0x1c')]=function(_0x19fcdb){var _0x2ddb70=this;return new Promise(function(_0x568034,_0x37752c){return db['ChatInteraction'][_0x432b('0x1d')](_0x19fcdb[_0x432b('0x1e')],{'raw':_0x19fcdb[_0x432b('0x1f')]?_0x19fcdb[_0x432b('0x1f')][_0x432b('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19fcdb[_0x432b('0x1f')]?_0x19fcdb[_0x432b('0x1f')][_0x432b('0x21')]||null:null,'attributes':_0x19fcdb[_0x432b('0x1f')]?_0x19fcdb[_0x432b('0x1f')][_0x432b('0x22')]||null:null,'limit':_0x19fcdb[_0x432b('0x1f')]?_0x19fcdb[_0x432b('0x1f')][_0x432b('0x23')]||null:null})['then'](function(_0x345a92){logger[_0x432b('0x12')](_0x432b('0x1c'),_0x19fcdb);logger['debug']('UpdateChatInteraction',_0x19fcdb,JSON[_0x432b('0x16')](_0x345a92));_0x568034(_0x345a92);})['catch'](function(_0x11463a){logger[_0x432b('0x17')](_0x432b('0x1c'),_0x11463a[_0x432b('0x19')],_0x19fcdb);_0x37752c(_0x2ddb70['error'](0x1f4,_0x11463a[_0x432b('0x19')]));});});};exports['AddTagsToChatInteraction']=function(_0x1e5cb1){return new Promise(function(_0x3d5124,_0x23d9f6){return db[_0x432b('0x24')][_0x432b('0x25')]({'where':_0x1e5cb1[_0x432b('0x1f')]?_0x1e5cb1[_0x432b('0x1f')][_0x432b('0x21')]||null:null})['then'](function(_0x3cacb9){if(_0x3cacb9){return _0x3cacb9[_0x432b('0x26')](_0x1e5cb1[_0x432b('0x1e')][_0x432b('0x27')],_['omit'](_0x1e5cb1[_0x432b('0x1e')],[_0x432b('0x27'),'id'])||{});}})[_0x432b('0x28')](function(_0x40be6e){logger[_0x432b('0x12')]('AddTags',_0x1e5cb1);logger[_0x432b('0x29')](_0x432b('0x2a'),_0x1e5cb1,JSON['stringify'](_0x40be6e));_0x3d5124(_0x40be6e);})['catch'](function(_0xb5cbde){logger[_0x432b('0x17')](_0x432b('0x2a'),_0xb5cbde['message'],_0x1e5cb1);_0x23d9f6(_this[_0x432b('0x17')](0x1f4,_0xb5cbde['message']));});});}; \ No newline at end of file +var _0x084c=['code','message','result','catch','UpdateChatInteraction','ChatInteraction','options','raw','where','attributes','limit','debug','find','addTags','body','ids','spread','AddTags','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x23beb0,_0x216a71){var _0x308011=function(_0x2980fe){while(--_0x2980fe){_0x23beb0['push'](_0x23beb0['shift']());}};_0x308011(++_0x216a71);}(_0x084c,0xdf));var _0xc084=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0x084c[_0x5a3cf0];return _0x5a64ee;};'use strict';var _=require(_0xc084('0x0'));var util=require(_0xc084('0x1'));var moment=require(_0xc084('0x2'));var BPromise=require(_0xc084('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc084('0x4'))['db'];var utils=require(_0xc084('0x5'));var logger=require('../../config/logger')(_0xc084('0x6'));var config=require(_0xc084('0x7'));var jayson=require(_0xc084('0x8'));var client=jayson[_0xc084('0x9')][_0xc084('0xa')]({'port':0x232a});config['redis']=_[_0xc084('0xb')](config[_0xc084('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xc084('0xd'))(new Redis(config['redis']));require(_0xc084('0xe'))[_0xc084('0xf')](socket);function respondWithRpcPromise(_0x4fe46d,_0x2f631f,_0x4c10cd){return new BPromise(function(_0xfa07ef,_0x10b968){return client[_0xc084('0x10')](_0x4fe46d,_0x4c10cd)[_0xc084('0x11')](function(_0xa01bc2){logger[_0xc084('0x12')](_0xc084('0x13'),_0x2f631f,_0xc084('0x14'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x2f631f,'request\x20sent',JSON[_0xc084('0x15')](_0xa01bc2));if(_0xa01bc2[_0xc084('0x16')]){if(_0xa01bc2[_0xc084('0x16')][_0xc084('0x17')]===0x1f4){logger[_0xc084('0x16')](_0xc084('0x13'),_0x2f631f,_0xa01bc2['error'][_0xc084('0x18')]);return _0x10b968(_0xa01bc2[_0xc084('0x16')]['message']);}logger[_0xc084('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x2f631f,_0xa01bc2[_0xc084('0x16')][_0xc084('0x18')]);return _0xfa07ef(_0xa01bc2[_0xc084('0x16')][_0xc084('0x18')]);}else{logger[_0xc084('0x12')](_0xc084('0x13'),_0x2f631f,_0xc084('0x14'));_0xfa07ef(_0xa01bc2[_0xc084('0x19')][_0xc084('0x18')]);}})[_0xc084('0x1a')](function(_0x345b0c){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x2f631f,_0x345b0c);_0x10b968(_0x345b0c);});});}exports[_0xc084('0x1b')]=function(_0x1bd5e6){var _0x13e37d=this;return new Promise(function(_0x2fcef8,_0x204212){return db[_0xc084('0x1c')]['update'](_0x1bd5e6['body'],{'raw':_0x1bd5e6['options']?_0x1bd5e6[_0xc084('0x1d')][_0xc084('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1bd5e6['options']?_0x1bd5e6[_0xc084('0x1d')][_0xc084('0x1f')]||null:null,'attributes':_0x1bd5e6[_0xc084('0x1d')]?_0x1bd5e6['options'][_0xc084('0x20')]||null:null,'limit':_0x1bd5e6['options']?_0x1bd5e6[_0xc084('0x1d')][_0xc084('0x21')]||null:null})[_0xc084('0x11')](function(_0x230a72){logger[_0xc084('0x12')]('UpdateChatInteraction',_0x1bd5e6);logger[_0xc084('0x22')](_0xc084('0x1b'),_0x1bd5e6,JSON['stringify'](_0x230a72));_0x2fcef8(_0x230a72);})[_0xc084('0x1a')](function(_0x3fefcf){logger[_0xc084('0x16')](_0xc084('0x1b'),_0x3fefcf[_0xc084('0x18')],_0x1bd5e6);_0x204212(_0x13e37d[_0xc084('0x16')](0x1f4,_0x3fefcf[_0xc084('0x18')]));});});};exports['AddTagsToChatInteraction']=function(_0x5423b6){return new Promise(function(_0x6fc01d,_0x1c2b63){return db[_0xc084('0x1c')][_0xc084('0x23')]({'where':_0x5423b6[_0xc084('0x1d')]?_0x5423b6[_0xc084('0x1d')]['where']||null:null})['then'](function(_0x17f061){if(_0x17f061){return _0x17f061[_0xc084('0x24')](_0x5423b6[_0xc084('0x25')]['ids'],_['omit'](_0x5423b6[_0xc084('0x25')],[_0xc084('0x26'),'id'])||{});}})[_0xc084('0x27')](function(_0x34c21d){logger[_0xc084('0x12')](_0xc084('0x28'),_0x5423b6);logger['debug'](_0xc084('0x28'),_0x5423b6,JSON['stringify'](_0x34c21d));_0x6fc01d(_0x34c21d);})['catch'](function(_0x264cfe){logger[_0xc084('0x16')](_0xc084('0x28'),_0x264cfe['message'],_0x5423b6);_0x1c2b63(_this[_0xc084('0x16')](0x1f4,_0x264cfe['message']));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 6e238aa..03a809f 100644 --- a/server/api/chatInteraction/chatInteraction.socket.js +++ b/server/api/chatInteraction/chatInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2131=['update','removeListener','length','chatInteraction:','./chatInteraction.events','save'];(function(_0xc0d9bc,_0x2bd6be){var _0x32ff73=function(_0x28c592){while(--_0x28c592){_0xc0d9bc['push'](_0xc0d9bc['shift']());}};_0x32ff73(++_0x2bd6be);}(_0x2131,0xee));var _0x1213=function(_0x2e72c7,_0x3cefda){_0x2e72c7=_0x2e72c7-0x0;var _0x12f876=_0x2131[_0x2e72c7];return _0x12f876;};'use strict';var ChatInteractionEvents=require(_0x1213('0x0'));var events=[_0x1213('0x1'),'remove',_0x1213('0x2')];function createListener(_0x2dab26,_0x2fc8f5){return function(_0x437c93){_0x2fc8f5['emit'](_0x2dab26,_0x437c93);};}function removeListener(_0xbb5d2,_0x5db678){return function(){ChatInteractionEvents[_0x1213('0x3')](_0xbb5d2,_0x5db678);};}exports['register']=function(_0x4fbbc2){for(var _0x1dc8d3=0x0,_0x1672e2=events[_0x1213('0x4')];_0x1dc8d3<_0x1672e2;_0x1dc8d3++){var _0x4949af=events[_0x1dc8d3];var _0x253e45=createListener(_0x1213('0x5')+_0x4949af,_0x4fbbc2);ChatInteractionEvents['on'](_0x4949af,_0x253e45);}}; \ No newline at end of file +var _0xe893=['emit','removeListener','register','length','save','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe893,0xbe));var _0x3e89=function(_0x3221ae,_0x10dd4c){_0x3221ae=_0x3221ae-0x0;var _0x314b92=_0xe893[_0x3221ae];return _0x314b92;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x3e89('0x0'),_0x3e89('0x1'),'update'];function createListener(_0x2b462b,_0x2b3753){return function(_0x2aab48){_0x2b3753[_0x3e89('0x2')](_0x2b462b,_0x2aab48);};}function removeListener(_0x2e4719,_0x55e262){return function(){ChatInteractionEvents[_0x3e89('0x3')](_0x2e4719,_0x55e262);};}exports[_0x3e89('0x4')]=function(_0x2eb068){for(var _0x4a2a6f=0x0,_0x16d340=events[_0x3e89('0x5')];_0x4a2a6f<_0x16d340;_0x4a2a6f++){var _0x344d91=events[_0x4a2a6f];var _0x429b8e=createListener('chatInteraction:'+_0x344d91,_0x2eb068);ChatInteractionEvents['on'](_0x344d91,_0x429b8e);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 600468a..b9292ca 100644 --- a/server/api/chatInteraction/index.js +++ b/server/api/chatInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcae2=['replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chatinteraction:addtags','put','chat','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','close','destroy','delete','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/my_messages','getMyMessages','/:id/download','download','post','createVidaooSession','diskStorage','root','server/files/attachments/','format','now','originalname'];(function(_0x16531b,_0x584ced){var _0x19d85=function(_0x6073a6){while(--_0x6073a6){_0x16531b['push'](_0x16531b['shift']());}};_0x19d85(++_0x584ced);}(_0xcae2,0x1ea));var _0x2cae=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcae2[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x2cae('0x0'));var util=require(_0x2cae('0x1'));var path=require(_0x2cae('0x2'));var timeout=require(_0x2cae('0x3'));var express=require(_0x2cae('0x4'));var router=express[_0x2cae('0x5')]();var fs_extra=require(_0x2cae('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x2cae('0x7'));var config=require(_0x2cae('0x8'));var controller=require('./chatInteraction.controller');router[_0x2cae('0x9')]('/',auth[_0x2cae('0xa')](),controller[_0x2cae('0xb')]);router[_0x2cae('0x9')]('/describe',auth[_0x2cae('0xa')](),controller[_0x2cae('0xc')]);router[_0x2cae('0x9')](_0x2cae('0xd'),auth[_0x2cae('0xe')](),controller[_0x2cae('0xf')]);router[_0x2cae('0x9')](_0x2cae('0x10'),auth['isChatInteractionAuthorized'](),controller[_0x2cae('0x11')]);router['get']('/:id/messages',auth[_0x2cae('0xa')](),controller['getMessages']);router[_0x2cae('0x9')](_0x2cae('0x12'),auth[_0x2cae('0xe')](),controller[_0x2cae('0x13')]);router[_0x2cae('0x9')](_0x2cae('0x14'),auth[_0x2cae('0xa')](),controller[_0x2cae('0x15')]);router[_0x2cae('0x16')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2cae('0x16')]('/:id/vidaoo',auth[_0x2cae('0xa')](),controller[_0x2cae('0x17')]);var upload=multer({'storage':multer[_0x2cae('0x18')]({'destination':function(_0x427b21,_0x1afd37,_0x37fc56){_0x37fc56(null,path['join'](config[_0x2cae('0x19')],_0x2cae('0x1a')));},'filename':function(_0x389f35,_0x447e3d,_0x45ba03){_0x45ba03(null,util[_0x2cae('0x1b')]('%s-%s',Date[_0x2cae('0x1c')](),_0x447e3d[_0x2cae('0x1d')][_0x2cae('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2cae('0x16')](_0x2cae('0x1f'),upload[_0x2cae('0x20')](_0x2cae('0x21')),controller[_0x2cae('0x22')]);router['post']('/:id/messages',auth[_0x2cae('0xe')](),controller[_0x2cae('0x23')]);router[_0x2cae('0x16')](_0x2cae('0x24'),auth['isAuthenticated'](),interaction[_0x2cae('0x25')]('chat',_0x2cae('0x26')),controller['addTags']);router[_0x2cae('0x27')]('/:id',auth['isAuthenticated'](),interaction[_0x2cae('0x25')](_0x2cae('0x28'),_0x2cae('0x29')),controller[_0x2cae('0x2a')]);router[_0x2cae('0x27')](_0x2cae('0x2b'),controller[_0x2cae('0x2c')]);router[_0x2cae('0x27')](_0x2cae('0x2d'),auth[_0x2cae('0xe')](),controller[_0x2cae('0x2e')]);router['put']('/:id/close',controller[_0x2cae('0x2f')]);router['delete'](_0x2cae('0xd'),auth[_0x2cae('0xa')](),interaction[_0x2cae('0x25')](_0x2cae('0x28'),'chatinteraction:destroy'),controller[_0x2cae('0x30')]);router[_0x2cae('0x31')](_0x2cae('0x24'),auth[_0x2cae('0xa')](),controller[_0x2cae('0x32')]);module[_0x2cae('0x33')]=router; \ No newline at end of file +var _0x189a=['removeTags','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','index','get','/describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','isAuthenticated','getMessages','getMyMessages','post','create','createVidaooSession','root','server/files/attachments/','%s-%s','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chatinteraction:addtags','addTags','put','chat','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/close','delete','chatinteraction:destroy'];(function(_0x31d03c,_0x158cef){var _0x420e61=function(_0x1ddac1){while(--_0x1ddac1){_0x31d03c['push'](_0x31d03c['shift']());}};_0x420e61(++_0x158cef);}(_0x189a,0x1e1));var _0xa189=function(_0x575e5f,_0x5bd284){_0x575e5f=_0x575e5f-0x0;var _0xbe8e8b=_0x189a[_0x575e5f];return _0xbe8e8b;};'use strict';var multer=require(_0xa189('0x0'));var util=require(_0xa189('0x1'));var path=require('path');var timeout=require(_0xa189('0x2'));var express=require(_0xa189('0x3'));var router=express[_0xa189('0x4')]();var fs_extra=require(_0xa189('0x5'));var auth=require(_0xa189('0x6'));var interaction=require(_0xa189('0x7'));var config=require(_0xa189('0x8'));var controller=require(_0xa189('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xa189('0xa')]);router[_0xa189('0xb')](_0xa189('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xa189('0xb')](_0xa189('0xd'),auth[_0xa189('0xe')](),controller['show']);router[_0xa189('0xb')](_0xa189('0xf'),auth[_0xa189('0xe')](),controller[_0xa189('0x10')]);router[_0xa189('0xb')](_0xa189('0x11'),auth[_0xa189('0x12')](),controller[_0xa189('0x13')]);router[_0xa189('0xb')]('/:id/my_messages',auth[_0xa189('0xe')](),controller[_0xa189('0x14')]);router[_0xa189('0xb')]('/:id/download',auth[_0xa189('0x12')](),controller['download']);router[_0xa189('0x15')]('/',auth[_0xa189('0x12')](),controller[_0xa189('0x16')]);router[_0xa189('0x15')]('/:id/vidaoo',auth[_0xa189('0x12')](),controller[_0xa189('0x17')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x369efa,_0x239d13,_0x293cea){_0x293cea(null,path['join'](config[_0xa189('0x18')],_0xa189('0x19')));},'filename':function(_0x1131dd,_0x12eca7,_0x56a929){_0x56a929(null,util['format'](_0xa189('0x1a'),Date['now'](),_0x12eca7[_0xa189('0x1b')][_0xa189('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa189('0x15')](_0xa189('0x1d'),upload[_0xa189('0x1e')](_0xa189('0x1f')),controller[_0xa189('0x20')]);router[_0xa189('0x15')]('/:id/messages',auth[_0xa189('0xe')](),controller[_0xa189('0x21')]);router[_0xa189('0x15')](_0xa189('0x22'),auth['isAuthenticated'](),interaction[_0xa189('0x23')]('chat',_0xa189('0x24')),controller[_0xa189('0x25')]);router[_0xa189('0x26')]('/:id',auth[_0xa189('0x12')](),interaction[_0xa189('0x23')](_0xa189('0x27'),_0xa189('0x28')),controller[_0xa189('0x29')]);router['put'](_0xa189('0x2a'),controller[_0xa189('0x2b')]);router[_0xa189('0x26')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller['abandon']);router[_0xa189('0x26')](_0xa189('0x2c'),controller['close']);router[_0xa189('0x2d')](_0xa189('0xd'),auth[_0xa189('0x12')](),interaction[_0xa189('0x23')](_0xa189('0x27'),_0xa189('0x2e')),controller['destroy']);router[_0xa189('0x2d')](_0xa189('0x22'),auth[_0xa189('0x12')](),controller[_0xa189('0x2f')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 6f7c58d..a1e32e6 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.attributes.js +++ b/server/api/chatInternalMessage/chatInternalMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xad56=['exports','TEXT','medium','INTEGER','sequelize'];(function(_0x3a6c22,_0x25539e){var _0x61930a=function(_0x69ae65){while(--_0x69ae65){_0x3a6c22['push'](_0x3a6c22['shift']());}};_0x61930a(++_0x25539e);}(_0xad56,0x199));var _0x6ad5=function(_0x30b58,_0x48df3b){_0x30b58=_0x30b58-0x0;var _0x9d210d=_0xad56[_0x30b58];return _0x9d210d;};'use strict';var Sequelize=require(_0x6ad5('0x0'));module[_0x6ad5('0x1')]={'body':{'type':Sequelize[_0x6ad5('0x2')](_0x6ad5('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x6ad5('0x4')]}}; \ No newline at end of file +var _0xcc4e=['INTEGER','sequelize','BOOLEAN'];(function(_0x3d8c3f,_0x1c568f){var _0x1b2fd1=function(_0x5dc7b5){while(--_0x5dc7b5){_0x3d8c3f['push'](_0x3d8c3f['shift']());}};_0x1b2fd1(++_0x1c568f);}(_0xcc4e,0x91));var _0xecc4=function(_0x6358c7,_0xb14e68){_0x6358c7=_0x6358c7-0x0;var _0x3d2af0=_0xcc4e[_0x6358c7];return _0x3d2af0;};'use strict';var Sequelize=require(_0xecc4('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xecc4('0x1')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xecc4('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 5044bee..2f6ffd6 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.controller.js +++ b/server/api/chatInternalMessage/chatInternalMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb627=['error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','then','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','get','messages','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','User','agent','admin','user','fullname','online','lastLoginAt','allowmessenger','showWebBar','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','isEmpty','role','resourceId','push','createdAt','ToId','read','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy'];(function(_0x268000,_0xd65943){var _0x3bdfe1=function(_0x3af23a){while(--_0x3af23a){_0x268000['push'](_0x268000['shift']());}};_0x3bdfe1(++_0xd65943);}(_0xb627,0x194));var _0x7b62=function(_0x1322fb,_0x3e07c2){_0x1322fb=_0x1322fb-0x0;var _0x5d1690=_0xb627[_0x1322fb];return _0x5d1690;};'use strict';var emlformat=require(_0x7b62('0x0'));var rimraf=require(_0x7b62('0x1'));var zipdir=require(_0x7b62('0x2'));var jsonpatch=require(_0x7b62('0x3'));var rp=require(_0x7b62('0x4'));var moment=require('moment');var BPromise=require(_0x7b62('0x5'));var Mustache=require(_0x7b62('0x6'));var util=require('util');var path=require(_0x7b62('0x7'));var sox=require(_0x7b62('0x8'));var csv=require(_0x7b62('0x9'));var ejs=require(_0x7b62('0xa'));var fs=require('fs');var fs_extra=require(_0x7b62('0xb'));var _=require(_0x7b62('0xc'));var squel=require(_0x7b62('0xd'));var crypto=require(_0x7b62('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7b62('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7b62('0x10'));var Papa=require(_0x7b62('0x11'));var Redis=require(_0x7b62('0x12'));var authService=require(_0x7b62('0x13'));var qs=require(_0x7b62('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b62('0x15'));var logger=require(_0x7b62('0x16'))(_0x7b62('0x17'));var utils=require(_0x7b62('0x18'));var config=require(_0x7b62('0x19'));var licenseUtil=require(_0x7b62('0x1a'));var db=require(_0x7b62('0x1b'))['db'];config[_0x7b62('0x1c')]=_[_0x7b62('0x1d')](config['redis'],{'host':_0x7b62('0x1e'),'port':0x18eb});var socket=require(_0x7b62('0x1f'))(new Redis(config[_0x7b62('0x1c')]));require(_0x7b62('0x20'))[_0x7b62('0x21')](socket);function respondWithStatusCode(_0x1fb9ee,_0x35dcf8){_0x35dcf8=_0x35dcf8||0xcc;return function(_0x3ddb0e){if(_0x3ddb0e){return _0x1fb9ee[_0x7b62('0x22')](_0x35dcf8);}return _0x1fb9ee['status'](_0x35dcf8)[_0x7b62('0x23')]();};}function respondWithResult(_0x12f4ab,_0x211e7f){_0x211e7f=_0x211e7f||0xc8;return function(_0x3f9517){if(_0x3f9517){return _0x12f4ab[_0x7b62('0x24')](_0x211e7f)[_0x7b62('0x25')](_0x3f9517);}};}function respondWithFilteredResult(_0x13df6e,_0x1e2964){return function(_0x198763){if(_0x198763){var _0x128127=typeof _0x1e2964[_0x7b62('0x26')]===_0x7b62('0x27')&&typeof _0x1e2964[_0x7b62('0x28')]===_0x7b62('0x27');var _0xeb2b3b=_0x198763[_0x7b62('0x29')];var _0x31fced=_0x128127?0x0:_0x1e2964[_0x7b62('0x26')];var _0x532da3=_0x128127?_0x198763[_0x7b62('0x29')]:_0x1e2964[_0x7b62('0x26')]+_0x1e2964['limit'];var _0x3e03af;if(_0x532da3>=_0xeb2b3b){_0x532da3=_0xeb2b3b;_0x3e03af=0xc8;}else{_0x3e03af=0xce;}_0x13df6e[_0x7b62('0x24')](_0x3e03af);return _0x13df6e[_0x7b62('0x2a')](_0x7b62('0x2b'),_0x31fced+'-'+_0x532da3+'/'+_0xeb2b3b)['json'](_0x198763);}return null;};}function patchUpdates(_0x3d4ef9){return function(_0xe54625){try{jsonpatch[_0x7b62('0x2c')](_0xe54625,_0x3d4ef9,!![]);}catch(_0x39f9bb){return BPromise['reject'](_0x39f9bb);}return _0xe54625[_0x7b62('0x2d')]();};}function saveUpdates(_0x216a2e,_0x2c88af){return function(_0x1eb73e){if(_0x1eb73e){return _0x1eb73e[_0x7b62('0x2e')](_0x216a2e)['then'](function(_0x1b29a6){return _0x1b29a6;});}return null;};}function removeEntity(_0x1f1794,_0x2f1c06){return function(_0xb238ee){if(_0xb238ee){return _0xb238ee[_0x7b62('0x2f')]()['then'](function(){_0x1f1794[_0x7b62('0x24')](0xcc)[_0x7b62('0x23')]();});}};}function handleEntityNotFound(_0x4edad0,_0xd415ec){return function(_0xffcdb8){if(!_0xffcdb8){_0x4edad0['sendStatus'](0x194);}return _0xffcdb8;};}function handleError(_0x10b341,_0x5483f4){_0x5483f4=_0x5483f4||0x1f4;return function(_0xca6a83){logger[_0x7b62('0x30')](_0xca6a83[_0x7b62('0x31')]);if(_0xca6a83[_0x7b62('0x32')]){delete _0xca6a83[_0x7b62('0x32')];}_0x10b341[_0x7b62('0x24')](_0x5483f4)[_0x7b62('0x33')](_0xca6a83);};}exports[_0x7b62('0x34')]=function(_0x2d87ac,_0x1c8a67){var _0x5e3583={},_0x330ce9={},_0x1e0676={'count':0x0,'rows':[]};var _0x4a2dda=_[_0x7b62('0x35')](db[_0x7b62('0x36')][_0x7b62('0x37')],function(_0x47f6f5){return{'name':_0x47f6f5[_0x7b62('0x38')],'type':_0x47f6f5[_0x7b62('0x39')]['key']};});_0x330ce9[_0x7b62('0x3a')]=_[_0x7b62('0x35')](_0x4a2dda,_0x7b62('0x32'));_0x330ce9[_0x7b62('0x3b')]=_[_0x7b62('0x3c')](_0x2d87ac[_0x7b62('0x3b')]);_0x330ce9[_0x7b62('0x3d')]=_[_0x7b62('0x3e')](_0x330ce9[_0x7b62('0x3a')],_0x330ce9[_0x7b62('0x3b')]);_0x5e3583[_0x7b62('0x3f')]=_['intersection'](_0x330ce9['model'],qs[_0x7b62('0x40')](_0x2d87ac[_0x7b62('0x3b')]['fields']));_0x5e3583[_0x7b62('0x3f')]=_0x5e3583[_0x7b62('0x3f')][_0x7b62('0x41')]?_0x5e3583[_0x7b62('0x3f')]:_0x330ce9[_0x7b62('0x3a')];if(!_0x2d87ac[_0x7b62('0x3b')]['hasOwnProperty'](_0x7b62('0x42'))){_0x5e3583[_0x7b62('0x28')]=qs[_0x7b62('0x28')](_0x2d87ac[_0x7b62('0x3b')][_0x7b62('0x28')]);_0x5e3583[_0x7b62('0x26')]=qs['offset'](_0x2d87ac['query']['offset']);}_0x5e3583['order']=qs['sort'](_0x2d87ac[_0x7b62('0x3b')][_0x7b62('0x43')]);_0x5e3583[_0x7b62('0x44')]=qs[_0x7b62('0x3d')](_[_0x7b62('0x45')](_0x2d87ac[_0x7b62('0x3b')],_0x330ce9['filters']),_0x4a2dda);if(_0x2d87ac[_0x7b62('0x3b')]['filter']){_0x5e3583[_0x7b62('0x44')]=_[_0x7b62('0x46')](_0x5e3583['where'],{'$or':_[_0x7b62('0x35')](_0x4a2dda,function(_0x5863b9){if(_0x5863b9[_0x7b62('0x39')]!==_0x7b62('0x47')){var _0x288f3a={};_0x288f3a[_0x5863b9['name']]={'$like':'%'+_0x2d87ac[_0x7b62('0x3b')][_0x7b62('0x48')]+'%'};return _0x288f3a;}})});}_0x5e3583=_[_0x7b62('0x46')]({},_0x5e3583,_0x2d87ac['options']);var _0x88ced1={'where':_0x5e3583['where']};return db[_0x7b62('0x36')]['count'](_0x88ced1)[_0x7b62('0x49')](function(_0x3387f0){_0x1e0676['count']=_0x3387f0;if(_0x2d87ac[_0x7b62('0x3b')][_0x7b62('0x4a')]){_0x5e3583['include']=[{'all':!![]}];}return db[_0x7b62('0x36')][_0x7b62('0x4b')](_0x5e3583);})[_0x7b62('0x49')](function(_0x19108f){_0x1e0676[_0x7b62('0x4c')]=_0x19108f;return _0x1e0676;})[_0x7b62('0x49')](respondWithFilteredResult(_0x1c8a67,_0x5e3583))[_0x7b62('0x4d')](handleError(_0x1c8a67,null));};exports[_0x7b62('0x4e')]=function(_0x4672f3,_0x217671){var _0x5011f5={'raw':!![],'where':{'id':_0x4672f3[_0x7b62('0x4f')]['id']}},_0x222886={};_0x222886[_0x7b62('0x3a')]=_[_0x7b62('0x3c')](db[_0x7b62('0x36')][_0x7b62('0x37')]);_0x222886[_0x7b62('0x3b')]=_['keys'](_0x4672f3['query']);_0x222886[_0x7b62('0x3d')]=_[_0x7b62('0x3e')](_0x222886[_0x7b62('0x3a')],_0x222886['query']);_0x5011f5[_0x7b62('0x3f')]=_[_0x7b62('0x3e')](_0x222886['model'],qs[_0x7b62('0x40')](_0x4672f3['query']['fields']));_0x5011f5[_0x7b62('0x3f')]=_0x5011f5[_0x7b62('0x3f')]['length']?_0x5011f5[_0x7b62('0x3f')]:_0x222886[_0x7b62('0x3a')];if(_0x4672f3[_0x7b62('0x3b')][_0x7b62('0x4a')]){_0x5011f5[_0x7b62('0x50')]=[{'all':!![]}];}_0x5011f5=_[_0x7b62('0x46')]({},_0x5011f5,_0x4672f3['options']);return db[_0x7b62('0x36')][_0x7b62('0x51')](_0x5011f5)[_0x7b62('0x49')](handleEntityNotFound(_0x217671,null))[_0x7b62('0x49')](respondWithResult(_0x217671,null))[_0x7b62('0x4d')](handleError(_0x217671,null));};exports[_0x7b62('0x52')]=function(_0x41931e,_0x53312a){return db[_0x7b62('0x36')]['create'](_0x41931e['body'],{})[_0x7b62('0x49')](respondWithResult(_0x53312a,0xc9))['catch'](handleError(_0x53312a,null));};exports[_0x7b62('0x2e')]=function(_0xcf74a3,_0x23c72d){if(_0xcf74a3[_0x7b62('0x53')]['id']){delete _0xcf74a3[_0x7b62('0x53')]['id'];}return db[_0x7b62('0x36')][_0x7b62('0x51')]({'where':{'id':_0xcf74a3[_0x7b62('0x4f')]['id']}})[_0x7b62('0x49')](handleEntityNotFound(_0x23c72d,null))[_0x7b62('0x49')](saveUpdates(_0xcf74a3[_0x7b62('0x53')],null))[_0x7b62('0x49')](respondWithResult(_0x23c72d,null))['catch'](handleError(_0x23c72d,null));};exports[_0x7b62('0x2f')]=function(_0x4fc2b6,_0x3bbb41){return db[_0x7b62('0x36')][_0x7b62('0x51')]({'where':{'id':_0x4fc2b6[_0x7b62('0x4f')]['id']}})[_0x7b62('0x49')](handleEntityNotFound(_0x3bbb41,null))[_0x7b62('0x49')](removeEntity(_0x3bbb41,null))['catch'](handleError(_0x3bbb41,null));};exports[_0x7b62('0x54')]=function(_0x586429,_0x526c46){return db[_0x7b62('0x36')][_0x7b62('0x54')]()[_0x7b62('0x49')](respondWithResult(_0x526c46,null))[_0x7b62('0x4d')](handleError(_0x526c46,null));};function wrapUser(_0x2e2b08){return function(_0x5912d0){var _0x324b38=_0x2e2b08[_0x7b62('0x55')]({'plain':!![]});_0x324b38[_0x7b62('0x56')]=[];if(_0x5912d0){_0x324b38[_0x7b62('0x57')]=_0x5912d0['createdAt'];_0x324b38[_0x7b62('0x58')]=_0x5912d0;}else{_0x324b38['lastMessageAt']=moment(0x0)[_0x7b62('0x59')](_0x7b62('0x5a'));_0x324b38[_0x7b62('0x58')]={};}return _0x324b38;};}exports['getUsers']=function(_0x2763a3,_0x3d9918,_0x1a0507){var _0x31ca77=[];return db[_0x7b62('0x5b')][_0x7b62('0x4b')]({'where':{'role':[_0x7b62('0x5c'),_0x7b62('0x5d'),_0x7b62('0x5e')]},'attributes':['id',_0x7b62('0x5f'),'name','role','userpic','internal',_0x7b62('0x60'),_0x7b62('0x61'),_0x7b62('0x62'),_0x7b62('0x63')],'order':qs['sort']('-online'),'include':[{'model':db['VoiceQueue'],'as':'VoiceQueues','attributes':['id','name','type'],'through':{'attributes':[]}}]})[_0x7b62('0x49')](function(_0x1dc985){if(_0x1dc985){var _0x5f170f=_0x2763a3[_0x7b62('0x5e')][_0x7b62('0x55')]({'plain':!![]});if(!_0x5f170f)throw new Error(_0x7b62('0x64'));if(_0x5f170f['role']===_0x7b62('0x5e')){return db[_0x7b62('0x65')][_0x7b62('0x51')]({'where':{'name':'Agents','userProfileId':_0x5f170f[_0x7b62('0x66')]},'raw':!![]})['then'](function(_0x53020b){if(_0x53020b){if(_0x53020b[_0x7b62('0x67')]===0x0){return db[_0x7b62('0x68')][_0x7b62('0x4b')]({'where':{'sectionId':_0x53020b['id']},'raw':!![]})[_0x7b62('0x49')](function(_0x24dbae){var _0x58290b=[];if(_[_0x7b62('0x69')](_0x24dbae)){_0x58290b=_[_0x7b62('0x48')](_0x1dc985,function(_0x2b7a68){if(_0x2b7a68[_0x7b62('0x6a')]!==_0x7b62('0x5c')){return _0x2b7a68;}});return _0x58290b;}else{for(var _0x2670e4=0x0;_0x2670e4<_0x1dc985[_0x7b62('0x41')];_0x2670e4++){var _0x36f9c7=_0x1dc985[_0x2670e4];if(_0x36f9c7[_0x7b62('0x6a')]===_0x7b62('0x5c')){var _0x8bceee=_['find'](_0x24dbae,function(_0x3685bb){return _0x3685bb[_0x7b62('0x6b')]===_0x36f9c7['id'];});if(_0x8bceee)_0x58290b[_0x7b62('0x6c')](_0x36f9c7);}else{_0x58290b[_0x7b62('0x6c')](_0x36f9c7);}}return _0x58290b;}});}else{return _0x1dc985;}}else{var _0xecb8ae=_[_0x7b62('0x48')](_0x1dc985,function(_0x480878){if(_0x480878[_0x7b62('0x6a')]!==_0x7b62('0x5c')){return _0x480878;}});return _0xecb8ae;}});}else{return _0x1dc985;}}})[_0x7b62('0x49')](function(_0x45d7b9){var _0x581d61=[];if(_0x45d7b9){_0x31ca77=_0x45d7b9;for(var _0x37ec1f=0x0;_0x37ec1f<_0x45d7b9[_0x7b62('0x41')];_0x37ec1f+=0x1){_0x31ca77[_0x37ec1f][_0x7b62('0x56')]=[];_0x581d61[_0x7b62('0x6c')](db['ChatInternalMessage']['find']({'where':{'FromId':[_0x2763a3[_0x7b62('0x5e')]['id'],_0x45d7b9[_0x37ec1f]['id']],'ToId':[_0x2763a3[_0x7b62('0x5e')]['id'],_0x45d7b9[_0x37ec1f]['id']],'ChatGroupId':null},'attributes':['id',_0x7b62('0x6d'),'FromId',_0x7b62('0x6e'),_0x7b62('0x6f'),_0x7b62('0x53')],'order':qs[_0x7b62('0x43')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x7b62('0x49')](wrapUser(_0x45d7b9[_0x37ec1f])));}return BPromise[_0x7b62('0x70')](_0x581d61);}return[];})[_0x7b62('0x49')](function(_0x5d7af5){return{'rows':_0x5d7af5,'count':_0x5d7af5[_0x7b62('0x41')]};})['then'](respondWithResult(_0x3d9918,null))[_0x7b62('0x4d')](handleError(_0x3d9918,null));}; \ No newline at end of file +var _0x6117=['query','filters','model','attributes','intersection','fields','hasOwnProperty','order','where','pick','filter','merge','map','VIRTUAL','ChatInternalMessage','include','findAll','rows','catch','show','keys','length','includeAll','options','find','create','body','params','describe','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','userpic','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueues','get','Agents','autoAssociation','UserProfileResource','isEmpty','push','FromId','read','sort','-createdAt','all','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','crypto','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','destroy','then','end','error','name','send','rawAttributes','type','key'];(function(_0x1c902b,_0x40189c){var _0x4e3196=function(_0x5bfe87){while(--_0x5bfe87){_0x1c902b['push'](_0x1c902b['shift']());}};_0x4e3196(++_0x40189c);}(_0x6117,0x10a));var _0x7611=function(_0x2ec7e6,_0x1a216f){_0x2ec7e6=_0x2ec7e6-0x0;var _0x21740a=_0x6117[_0x2ec7e6];return _0x21740a;};'use strict';var emlformat=require(_0x7611('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7611('0x1'));var jsonpatch=require(_0x7611('0x2'));var rp=require(_0x7611('0x3'));var moment=require(_0x7611('0x4'));var BPromise=require(_0x7611('0x5'));var Mustache=require(_0x7611('0x6'));var util=require('util');var path=require(_0x7611('0x7'));var sox=require(_0x7611('0x8'));var csv=require(_0x7611('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7611('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7611('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7611('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7611('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7611('0xe'));var hardwareService=require(_0x7611('0xf'));var logger=require(_0x7611('0x10'))(_0x7611('0x11'));var utils=require(_0x7611('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x7611('0x13'));var db=require(_0x7611('0x14'))['db'];config[_0x7611('0x15')]=_[_0x7611('0x16')](config[_0x7611('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x7611('0x17'))(new Redis(config['redis']));require(_0x7611('0x18'))[_0x7611('0x19')](socket);function respondWithStatusCode(_0x4d9463,_0x370681){_0x370681=_0x370681||0xcc;return function(_0x5e5152){if(_0x5e5152){return _0x4d9463[_0x7611('0x1a')](_0x370681);}return _0x4d9463['status'](_0x370681)['end']();};}function respondWithResult(_0x5f504b,_0x416c61){_0x416c61=_0x416c61||0xc8;return function(_0x4ccec0){if(_0x4ccec0){return _0x5f504b[_0x7611('0x1b')](_0x416c61)[_0x7611('0x1c')](_0x4ccec0);}};}function respondWithFilteredResult(_0x441d44,_0x3b733e){return function(_0x289061){if(_0x289061){var _0x1bcb73=typeof _0x3b733e[_0x7611('0x1d')]===_0x7611('0x1e')&&typeof _0x3b733e[_0x7611('0x1f')]==='undefined';var _0x588824=_0x289061[_0x7611('0x20')];var _0x168965=_0x1bcb73?0x0:_0x3b733e['offset'];var _0x17715f=_0x1bcb73?_0x289061[_0x7611('0x20')]:_0x3b733e['offset']+_0x3b733e[_0x7611('0x1f')];var _0x1e789e;if(_0x17715f>=_0x588824){_0x17715f=_0x588824;_0x1e789e=0xc8;}else{_0x1e789e=0xce;}_0x441d44['status'](_0x1e789e);return _0x441d44[_0x7611('0x21')]('Content-Range',_0x168965+'-'+_0x17715f+'/'+_0x588824)[_0x7611('0x1c')](_0x289061);}return null;};}function patchUpdates(_0x32dbf0){return function(_0x4cffaf){try{jsonpatch[_0x7611('0x22')](_0x4cffaf,_0x32dbf0,!![]);}catch(_0x57ae4d){return BPromise['reject'](_0x57ae4d);}return _0x4cffaf[_0x7611('0x23')]();};}function saveUpdates(_0x4bf551,_0x33db4a){return function(_0x3a2005){if(_0x3a2005){return _0x3a2005[_0x7611('0x24')](_0x4bf551)['then'](function(_0x23d058){return _0x23d058;});}return null;};}function removeEntity(_0x47fe22,_0x2c15e7){return function(_0x449810){if(_0x449810){return _0x449810[_0x7611('0x25')]()[_0x7611('0x26')](function(){_0x47fe22[_0x7611('0x1b')](0xcc)[_0x7611('0x27')]();});}};}function handleEntityNotFound(_0x4637c2,_0x410864){return function(_0x188b04){if(!_0x188b04){_0x4637c2[_0x7611('0x1a')](0x194);}return _0x188b04;};}function handleError(_0x2f7766,_0x24a01a){_0x24a01a=_0x24a01a||0x1f4;return function(_0x37b6a9){logger[_0x7611('0x28')](_0x37b6a9['stack']);if(_0x37b6a9['name']){delete _0x37b6a9[_0x7611('0x29')];}_0x2f7766[_0x7611('0x1b')](_0x24a01a)[_0x7611('0x2a')](_0x37b6a9);};}exports['index']=function(_0x8b62df,_0x36b8cb){var _0x4408ec={},_0x44c474={},_0x1bec4f={'count':0x0,'rows':[]};var _0x4b2796=_['map'](db['ChatInternalMessage'][_0x7611('0x2b')],function(_0x16b4a9){return{'name':_0x16b4a9['fieldName'],'type':_0x16b4a9[_0x7611('0x2c')][_0x7611('0x2d')]};});_0x44c474['model']=_['map'](_0x4b2796,_0x7611('0x29'));_0x44c474[_0x7611('0x2e')]=_['keys'](_0x8b62df[_0x7611('0x2e')]);_0x44c474[_0x7611('0x2f')]=_['intersection'](_0x44c474[_0x7611('0x30')],_0x44c474[_0x7611('0x2e')]);_0x4408ec[_0x7611('0x31')]=_[_0x7611('0x32')](_0x44c474[_0x7611('0x30')],qs[_0x7611('0x33')](_0x8b62df[_0x7611('0x2e')][_0x7611('0x33')]));_0x4408ec[_0x7611('0x31')]=_0x4408ec['attributes']['length']?_0x4408ec[_0x7611('0x31')]:_0x44c474[_0x7611('0x30')];if(!_0x8b62df[_0x7611('0x2e')][_0x7611('0x34')]('nolimit')){_0x4408ec[_0x7611('0x1f')]=qs[_0x7611('0x1f')](_0x8b62df[_0x7611('0x2e')][_0x7611('0x1f')]);_0x4408ec[_0x7611('0x1d')]=qs[_0x7611('0x1d')](_0x8b62df[_0x7611('0x2e')][_0x7611('0x1d')]);}_0x4408ec[_0x7611('0x35')]=qs['sort'](_0x8b62df[_0x7611('0x2e')]['sort']);_0x4408ec[_0x7611('0x36')]=qs['filters'](_[_0x7611('0x37')](_0x8b62df['query'],_0x44c474['filters']),_0x4b2796);if(_0x8b62df[_0x7611('0x2e')][_0x7611('0x38')]){_0x4408ec[_0x7611('0x36')]=_[_0x7611('0x39')](_0x4408ec[_0x7611('0x36')],{'$or':_[_0x7611('0x3a')](_0x4b2796,function(_0x25aff5){if(_0x25aff5[_0x7611('0x2c')]!==_0x7611('0x3b')){var _0x14219d={};_0x14219d[_0x25aff5[_0x7611('0x29')]]={'$like':'%'+_0x8b62df[_0x7611('0x2e')]['filter']+'%'};return _0x14219d;}})});}_0x4408ec=_[_0x7611('0x39')]({},_0x4408ec,_0x8b62df['options']);var _0xfe129f={'where':_0x4408ec[_0x7611('0x36')]};return db[_0x7611('0x3c')][_0x7611('0x20')](_0xfe129f)[_0x7611('0x26')](function(_0x5123e2){_0x1bec4f[_0x7611('0x20')]=_0x5123e2;if(_0x8b62df['query']['includeAll']){_0x4408ec[_0x7611('0x3d')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x7611('0x3e')](_0x4408ec);})['then'](function(_0x314a43){_0x1bec4f[_0x7611('0x3f')]=_0x314a43;return _0x1bec4f;})[_0x7611('0x26')](respondWithFilteredResult(_0x36b8cb,_0x4408ec))[_0x7611('0x40')](handleError(_0x36b8cb,null));};exports[_0x7611('0x41')]=function(_0x9abd9,_0x509dc0){var _0x367fe3={'raw':!![],'where':{'id':_0x9abd9['params']['id']}},_0x332d2e={};_0x332d2e[_0x7611('0x30')]=_[_0x7611('0x42')](db[_0x7611('0x3c')]['rawAttributes']);_0x332d2e['query']=_[_0x7611('0x42')](_0x9abd9['query']);_0x332d2e['filters']=_[_0x7611('0x32')](_0x332d2e['model'],_0x332d2e[_0x7611('0x2e')]);_0x367fe3[_0x7611('0x31')]=_[_0x7611('0x32')](_0x332d2e['model'],qs[_0x7611('0x33')](_0x9abd9[_0x7611('0x2e')][_0x7611('0x33')]));_0x367fe3['attributes']=_0x367fe3[_0x7611('0x31')][_0x7611('0x43')]?_0x367fe3[_0x7611('0x31')]:_0x332d2e[_0x7611('0x30')];if(_0x9abd9[_0x7611('0x2e')][_0x7611('0x44')]){_0x367fe3[_0x7611('0x3d')]=[{'all':!![]}];}_0x367fe3=_[_0x7611('0x39')]({},_0x367fe3,_0x9abd9[_0x7611('0x45')]);return db['ChatInternalMessage'][_0x7611('0x46')](_0x367fe3)[_0x7611('0x26')](handleEntityNotFound(_0x509dc0,null))[_0x7611('0x26')](respondWithResult(_0x509dc0,null))[_0x7611('0x40')](handleError(_0x509dc0,null));};exports[_0x7611('0x47')]=function(_0x237fd4,_0x1e0a73){return db[_0x7611('0x3c')][_0x7611('0x47')](_0x237fd4[_0x7611('0x48')],{})[_0x7611('0x26')](respondWithResult(_0x1e0a73,0xc9))[_0x7611('0x40')](handleError(_0x1e0a73,null));};exports[_0x7611('0x24')]=function(_0x52491d,_0x2e4024){if(_0x52491d[_0x7611('0x48')]['id']){delete _0x52491d[_0x7611('0x48')]['id'];}return db['ChatInternalMessage'][_0x7611('0x46')]({'where':{'id':_0x52491d[_0x7611('0x49')]['id']}})['then'](handleEntityNotFound(_0x2e4024,null))[_0x7611('0x26')](saveUpdates(_0x52491d[_0x7611('0x48')],null))[_0x7611('0x26')](respondWithResult(_0x2e4024,null))[_0x7611('0x40')](handleError(_0x2e4024,null));};exports['destroy']=function(_0x56d8f5,_0x4bc2be){return db[_0x7611('0x3c')]['find']({'where':{'id':_0x56d8f5[_0x7611('0x49')]['id']}})[_0x7611('0x26')](handleEntityNotFound(_0x4bc2be,null))[_0x7611('0x26')](removeEntity(_0x4bc2be,null))[_0x7611('0x40')](handleError(_0x4bc2be,null));};exports[_0x7611('0x4a')]=function(_0x5367c4,_0x4f6841){return db[_0x7611('0x3c')]['describe']()[_0x7611('0x26')](respondWithResult(_0x4f6841,null))[_0x7611('0x40')](handleError(_0x4f6841,null));};function wrapUser(_0x16b997){return function(_0x1358f6){var _0x52927e=_0x16b997['get']({'plain':!![]});_0x52927e[_0x7611('0x4b')]=[];if(_0x1358f6){_0x52927e[_0x7611('0x4c')]=_0x1358f6[_0x7611('0x4d')];_0x52927e['lastMessage']=_0x1358f6;}else{_0x52927e[_0x7611('0x4c')]=moment(0x0)[_0x7611('0x4e')](_0x7611('0x4f'));_0x52927e['lastMessage']={};}return _0x52927e;};}exports[_0x7611('0x50')]=function(_0x4b1bca,_0x116624,_0x2a526e){var _0x2d7411=[];return db[_0x7611('0x51')]['findAll']({'where':{'role':[_0x7611('0x52'),_0x7611('0x53'),_0x7611('0x54')]},'attributes':['id',_0x7611('0x55'),_0x7611('0x29'),_0x7611('0x56'),_0x7611('0x57'),'internal',_0x7611('0x58'),_0x7611('0x59'),_0x7611('0x5a'),_0x7611('0x5b')],'order':qs['sort']('-online'),'include':[{'model':db['VoiceQueue'],'as':_0x7611('0x5c'),'attributes':['id',_0x7611('0x29'),'type'],'through':{'attributes':[]}}]})[_0x7611('0x26')](function(_0x3e5ae3){if(_0x3e5ae3){var _0x3d679c=_0x4b1bca['user'][_0x7611('0x5d')]({'plain':!![]});if(!_0x3d679c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3d679c[_0x7611('0x56')]==='user'){return db['UserProfileSection'][_0x7611('0x46')]({'where':{'name':_0x7611('0x5e'),'userProfileId':_0x3d679c['userProfileId']},'raw':!![]})['then'](function(_0xef0865){if(_0xef0865){if(_0xef0865[_0x7611('0x5f')]===0x0){return db[_0x7611('0x60')]['findAll']({'where':{'sectionId':_0xef0865['id']},'raw':!![]})[_0x7611('0x26')](function(_0x3fccb0){var _0x25684a=[];if(_[_0x7611('0x61')](_0x3fccb0)){_0x25684a=_[_0x7611('0x38')](_0x3e5ae3,function(_0x31c943){if(_0x31c943['role']!=='agent'){return _0x31c943;}});return _0x25684a;}else{for(var _0x51ee06=0x0;_0x51ee06<_0x3e5ae3['length'];_0x51ee06++){var _0x43ae58=_0x3e5ae3[_0x51ee06];if(_0x43ae58[_0x7611('0x56')]===_0x7611('0x52')){var _0x1c6c67=_[_0x7611('0x46')](_0x3fccb0,function(_0x498929){return _0x498929['resourceId']===_0x43ae58['id'];});if(_0x1c6c67)_0x25684a[_0x7611('0x62')](_0x43ae58);}else{_0x25684a['push'](_0x43ae58);}}return _0x25684a;}});}else{return _0x3e5ae3;}}else{var _0x2b457c=_[_0x7611('0x38')](_0x3e5ae3,function(_0x140123){if(_0x140123['role']!==_0x7611('0x52')){return _0x140123;}});return _0x2b457c;}});}else{return _0x3e5ae3;}}})['then'](function(_0x9abad4){var _0x109b97=[];if(_0x9abad4){_0x2d7411=_0x9abad4;for(var _0x507c0d=0x0;_0x507c0d<_0x9abad4[_0x7611('0x43')];_0x507c0d+=0x1){_0x2d7411[_0x507c0d][_0x7611('0x4b')]=[];_0x109b97[_0x7611('0x62')](db['ChatInternalMessage'][_0x7611('0x46')]({'where':{'FromId':[_0x4b1bca[_0x7611('0x54')]['id'],_0x9abad4[_0x507c0d]['id']],'ToId':[_0x4b1bca[_0x7611('0x54')]['id'],_0x9abad4[_0x507c0d]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x7611('0x63'),'ToId',_0x7611('0x64'),'body'],'order':qs[_0x7611('0x65')](_0x7611('0x66')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x7611('0x26')](wrapUser(_0x9abad4[_0x507c0d])));}return BPromise[_0x7611('0x67')](_0x109b97);}return[];})[_0x7611('0x26')](function(_0x515a2e){return{'rows':_0x515a2e,'count':_0x515a2e[_0x7611('0x43')]};})[_0x7611('0x26')](respondWithResult(_0x116624,null))[_0x7611('0x40')](handleError(_0x116624,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index af19207..caf86fa 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.events.js +++ b/server/api/chatInternalMessage/chatInternalMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0362=['update','remove','emit','hook','exports','events','ChatInternalMessage','save'];(function(_0x11c3a3,_0x5b6b7c){var _0xa19d6a=function(_0x5ddd0f){while(--_0x5ddd0f){_0x11c3a3['push'](_0x11c3a3['shift']());}};_0xa19d6a(++_0x5b6b7c);}(_0x0362,0x15d));var _0x2036=function(_0x5e20ba,_0x2adb5d){_0x5e20ba=_0x5e20ba-0x0;var _0x29b623=_0x0362[_0x5e20ba];return _0x29b623;};'use strict';var EventEmitter=require(_0x2036('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x2036('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2036('0x2'),'afterUpdate':_0x2036('0x3'),'afterDestroy':_0x2036('0x4')};function emitEvent(_0x5ad87b){return function(_0x2dcda5,_0x107482,_0x41db72){ChatInternalMessageEvents[_0x2036('0x5')](_0x5ad87b+':'+_0x2dcda5['id'],_0x2dcda5);ChatInternalMessageEvents[_0x2036('0x5')](_0x5ad87b,_0x2dcda5);_0x41db72(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x2036('0x6')](e,emitEvent(event));}}module[_0x2036('0x7')]=ChatInternalMessageEvents; \ No newline at end of file +var _0xbc6f=['../../mysqldb','ChatInternalMessage','setMaxListeners','update','remove','emit','exports','events'];(function(_0x45e14c,_0x9dabd){var _0x3f364f=function(_0x59312d){while(--_0x59312d){_0x45e14c['push'](_0x45e14c['shift']());}};_0x3f364f(++_0x9dabd);}(_0xbc6f,0xf7));var _0xfbc6=function(_0x3a3d20,_0x244316){_0x3a3d20=_0x3a3d20-0x0;var _0x33bc94=_0xbc6f[_0x3a3d20];return _0x33bc94;};'use strict';var EventEmitter=require(_0xfbc6('0x0'));var ChatInternalMessage=require(_0xfbc6('0x1'))['db'][_0xfbc6('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xfbc6('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfbc6('0x4'),'afterDestroy':_0xfbc6('0x5')};function emitEvent(_0x119b4c){return function(_0x3822ec,_0x2f51ef,_0x5047a6){ChatInternalMessageEvents[_0xfbc6('0x6')](_0x119b4c+':'+_0x3822ec['id'],_0x3822ec);ChatInternalMessageEvents[_0xfbc6('0x6')](_0x119b4c,_0x3822ec);_0x5047a6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xfbc6('0x7')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 10835b2..b1f00d1 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.model.js +++ b/server/api/chatInternalMessage/chatInternalMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdf1e=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x27f614,_0x2b0fdc){var _0x533fe0=function(_0x2f42f5){while(--_0x2f42f5){_0x27f614['push'](_0x27f614['shift']());}};_0x533fe0(++_0x2b0fdc);}(_0xdf1e,0x15e));var _0xedf1=function(_0x35826c,_0x57bdf7){_0x35826c=_0x35826c-0x0;var _0x2d844f=_0xdf1e[_0x35826c];return _0x2d844f;};'use strict';var _=require('lodash');var util=require(_0xedf1('0x0'));var logger=require('../../config/logger')(_0xedf1('0x1'));var moment=require(_0xedf1('0x2'));var BPromise=require(_0xedf1('0x3'));var rp=require(_0xedf1('0x4'));var fs=require('fs');var path=require(_0xedf1('0x5'));var rimraf=require(_0xedf1('0x6'));var config=require(_0xedf1('0x7'));var attributes=require('./chatInternalMessage.attributes');module['exports']=function(_0x11fa72,_0x1ec6b8){return _0x11fa72[_0xedf1('0x8')](_0xedf1('0x9'),attributes,{'tableName':_0xedf1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xedf1('0xb'),'collate':_0xedf1('0xc')});}; \ No newline at end of file +var _0xd6ec=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x284862,_0x2a060f){var _0x3f9522=function(_0x59e24c){while(--_0x59e24c){_0x284862['push'](_0x284862['shift']());}};_0x3f9522(++_0x2a060f);}(_0xd6ec,0x1ec));var _0xcd6e=function(_0x36753c,_0x4320e7){_0x36753c=_0x36753c-0x0;var _0x12d55b=_0xd6ec[_0x36753c];return _0x12d55b;};'use strict';var _=require(_0xcd6e('0x0'));var util=require(_0xcd6e('0x1'));var logger=require(_0xcd6e('0x2'))(_0xcd6e('0x3'));var moment=require(_0xcd6e('0x4'));var BPromise=require(_0xcd6e('0x5'));var rp=require(_0xcd6e('0x6'));var fs=require('fs');var path=require(_0xcd6e('0x7'));var rimraf=require(_0xcd6e('0x8'));var config=require(_0xcd6e('0x9'));var attributes=require(_0xcd6e('0xa'));module[_0xcd6e('0xb')]=function(_0x13ced7,_0x115d84){return _0x13ced7[_0xcd6e('0xc')](_0xcd6e('0xd'),attributes,{'tableName':_0xcd6e('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xcd6e('0xf')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 2cdd7fe..ac748de 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.rpc.js +++ b/server/api/chatInternalMessage/chatInternalMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x620b=['defaults','./chatInternalMessage.socket','request','info','request\x20sent','debug','error','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x620b,0x1c3));var _0xb620=function(_0x5e6678,_0x3f0c45){_0x5e6678=_0x5e6678-0x0;var _0x5c1dc5=_0x620b[_0x5e6678];return _0x5c1dc5;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xb620('0x0'));var rs=require(_0xb620('0x1'));var fs=require('fs');var Redis=require(_0xb620('0x2'));var db=require(_0xb620('0x3'))['db'];var utils=require(_0xb620('0x4'));var logger=require(_0xb620('0x5'))(_0xb620('0x6'));var config=require(_0xb620('0x7'));var jayson=require(_0xb620('0x8'));var client=jayson['client'][_0xb620('0x9')]({'port':0x232a});config[_0xb620('0xa')]=_[_0xb620('0xb')](config[_0xb620('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb620('0xa')]));require(_0xb620('0xc'))['register'](socket);function respondWithRpcPromise(_0x186a11,_0x18c4fd,_0x1fd63d){return new BPromise(function(_0x3f2911,_0x34e508){return client[_0xb620('0xd')](_0x186a11,_0x1fd63d)['then'](function(_0x2de2d1){logger[_0xb620('0xe')]('ChatInternalMessage,\x20%s,\x20%s',_0x18c4fd,_0xb620('0xf'));logger[_0xb620('0x10')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x18c4fd,'request\x20sent',JSON['stringify'](_0x2de2d1));if(_0x2de2d1[_0xb620('0x11')]){if(_0x2de2d1['error']['code']===0x1f4){logger[_0xb620('0x11')](_0xb620('0x12'),_0x18c4fd,_0x2de2d1[_0xb620('0x11')]['message']);return _0x34e508(_0x2de2d1[_0xb620('0x11')]['message']);}logger[_0xb620('0x11')](_0xb620('0x12'),_0x18c4fd,_0x2de2d1[_0xb620('0x11')][_0xb620('0x13')]);return _0x3f2911(_0x2de2d1[_0xb620('0x11')][_0xb620('0x13')]);}else{logger['info'](_0xb620('0x12'),_0x18c4fd,_0xb620('0xf'));_0x3f2911(_0x2de2d1[_0xb620('0x14')][_0xb620('0x13')]);}})[_0xb620('0x15')](function(_0x448bb8){logger[_0xb620('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x18c4fd,_0x448bb8);_0x34e508(_0x448bb8);});});} \ No newline at end of file +var _0x907a=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','register','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x907a,0xe9));var _0xa907=function(_0x42d529,_0x4a9bde){_0x42d529=_0x42d529-0x0;var _0x502bdc=_0x907a[_0x42d529];return _0x502bdc;};'use strict';var _=require('lodash');var util=require(_0xa907('0x0'));var moment=require(_0xa907('0x1'));var BPromise=require(_0xa907('0x2'));var rs=require(_0xa907('0x3'));var fs=require('fs');var Redis=require(_0xa907('0x4'));var db=require(_0xa907('0x5'))['db'];var utils=require(_0xa907('0x6'));var logger=require(_0xa907('0x7'))(_0xa907('0x8'));var config=require(_0xa907('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa907('0xa')]['http']({'port':0x232a});config['redis']=_[_0xa907('0xb')](config[_0xa907('0xc')],{'host':_0xa907('0xd'),'port':0x18eb});var socket=require(_0xa907('0xe'))(new Redis(config[_0xa907('0xc')]));require('./chatInternalMessage.socket')[_0xa907('0xf')](socket);function respondWithRpcPromise(_0x4008a7,_0x57cbc6,_0x512ddd){return new BPromise(function(_0x31efea,_0x2b625c){return client[_0xa907('0x10')](_0x4008a7,_0x512ddd)['then'](function(_0x517f3a){logger[_0xa907('0x11')](_0xa907('0x12'),_0x57cbc6,_0xa907('0x13'));logger[_0xa907('0x14')](_0xa907('0x15'),_0x57cbc6,_0xa907('0x13'),JSON[_0xa907('0x16')](_0x517f3a));if(_0x517f3a['error']){if(_0x517f3a[_0xa907('0x17')][_0xa907('0x18')]===0x1f4){logger[_0xa907('0x17')](_0xa907('0x12'),_0x57cbc6,_0x517f3a['error'][_0xa907('0x19')]);return _0x2b625c(_0x517f3a[_0xa907('0x17')][_0xa907('0x19')]);}logger['error'](_0xa907('0x12'),_0x57cbc6,_0x517f3a[_0xa907('0x17')][_0xa907('0x19')]);return _0x31efea(_0x517f3a[_0xa907('0x17')][_0xa907('0x19')]);}else{logger[_0xa907('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x57cbc6,_0xa907('0x13'));_0x31efea(_0x517f3a['result'][_0xa907('0x19')]);}})['catch'](function(_0x1ab640){logger[_0xa907('0x17')](_0xa907('0x12'),_0x57cbc6,_0x1ab640);_0x2b625c(_0x1ab640);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index aca73d7..e0e96f4 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.socket.js +++ b/server/api/chatInternalMessage/chatInternalMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf5c4=['chatInternalMessage:','./chatInternalMessage.events','remove','update','emit','removeListener','register','length'];(function(_0x5eaf1f,_0xac547c){var _0x24e765=function(_0x412b0f){while(--_0x412b0f){_0x5eaf1f['push'](_0x5eaf1f['shift']());}};_0x24e765(++_0xac547c);}(_0xf5c4,0xa1));var _0x4f5c=function(_0x4d1ecf,_0x374814){_0x4d1ecf=_0x4d1ecf-0x0;var _0x19c055=_0xf5c4[_0x4d1ecf];return _0x19c055;};'use strict';var ChatInternalMessageEvents=require(_0x4f5c('0x0'));var events=['save',_0x4f5c('0x1'),_0x4f5c('0x2')];function createListener(_0xec8856,_0x720e6d){return function(_0x48ba2d){_0x720e6d[_0x4f5c('0x3')](_0xec8856,_0x48ba2d);};}function removeListener(_0x1ce3b0,_0x424cbb){return function(){ChatInternalMessageEvents[_0x4f5c('0x4')](_0x1ce3b0,_0x424cbb);};}exports[_0x4f5c('0x5')]=function(_0x370033){for(var _0x4bb052=0x0,_0x1e2806=events[_0x4f5c('0x6')];_0x4bb052<_0x1e2806;_0x4bb052++){var _0x1e964f=events[_0x4bb052];var _0x4be69b=createListener(_0x4f5c('0x7')+_0x1e964f,_0x370033);ChatInternalMessageEvents['on'](_0x1e964f,_0x4be69b);}}; \ No newline at end of file +var _0x3fc7=['length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit','removeListener'];(function(_0x50e938,_0x23924f){var _0x271134=function(_0x3b05f1){while(--_0x3b05f1){_0x50e938['push'](_0x50e938['shift']());}};_0x271134(++_0x23924f);}(_0x3fc7,0x1e2));var _0x73fc=function(_0x567bcb,_0x4978c1){_0x567bcb=_0x567bcb-0x0;var _0x4eebc2=_0x3fc7[_0x567bcb];return _0x4eebc2;};'use strict';var ChatInternalMessageEvents=require(_0x73fc('0x0'));var events=[_0x73fc('0x1'),_0x73fc('0x2'),_0x73fc('0x3')];function createListener(_0x2ba433,_0x5940f6){return function(_0x507782){_0x5940f6[_0x73fc('0x4')](_0x2ba433,_0x507782);};}function removeListener(_0x2e35d2,_0x185c0e){return function(){ChatInternalMessageEvents[_0x73fc('0x5')](_0x2e35d2,_0x185c0e);};}exports['register']=function(_0x354b1){for(var _0xba88ae=0x0,_0x4c9e12=events[_0x73fc('0x6')];_0xba88ae<_0x4c9e12;_0xba88ae++){var _0x18b986=events[_0xba88ae];var _0x1abcab=createListener(_0x73fc('0x7')+_0x18b986,_0x354b1);ChatInternalMessageEvents['on'](_0x18b986,_0x1abcab);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index fffba65..98be9a6 100644 --- a/server/api/chatInternalMessage/index.js +++ b/server/api/chatInternalMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5057=['Router','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','describe','/users','getUsers','show','post','put','/:id','update','delete','exports','util','path','connect-timeout','express'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x5057,0x1ca));var _0x7505=function(_0xb08374,_0x141ef3){_0xb08374=_0xb08374-0x0;var _0x428d38=_0x5057[_0xb08374];return _0x428d38;};'use strict';var multer=require('multer');var util=require(_0x7505('0x0'));var path=require(_0x7505('0x1'));var timeout=require(_0x7505('0x2'));var express=require(_0x7505('0x3'));var router=express[_0x7505('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7505('0x5'));var config=require(_0x7505('0x6'));var controller=require(_0x7505('0x7'));router[_0x7505('0x8')]('/',auth[_0x7505('0x9')](),controller[_0x7505('0xa')]);router[_0x7505('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x7505('0xb')]);router['get'](_0x7505('0xc'),auth[_0x7505('0x9')](),controller[_0x7505('0xd')]);router[_0x7505('0x8')]('/:id',auth[_0x7505('0x9')](),controller[_0x7505('0xe')]);router[_0x7505('0xf')]('/',auth[_0x7505('0x9')](),controller['create']);router[_0x7505('0x10')](_0x7505('0x11'),controller[_0x7505('0x12')]);router[_0x7505('0x13')]('/:id',auth[_0x7505('0x9')](),controller['destroy']);module[_0x7505('0x14')]=router; \ No newline at end of file +var _0x61cb=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','index','isAuthenticated','describe','/users','getUsers','/:id','show','post','update','delete','destroy','exports','path'];(function(_0x3aa728,_0x5036d5){var _0x20e389=function(_0x50c57d){while(--_0x50c57d){_0x3aa728['push'](_0x3aa728['shift']());}};_0x20e389(++_0x5036d5);}(_0x61cb,0x1b7));var _0xb61c=function(_0x4800bf,_0x3f6aa0){_0x4800bf=_0x4800bf-0x0;var _0x4dc339=_0x61cb[_0x4800bf];return _0x4dc339;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb61c('0x0'));var timeout=require(_0xb61c('0x1'));var express=require(_0xb61c('0x2'));var router=express[_0xb61c('0x3')]();var fs_extra=require(_0xb61c('0x4'));var auth=require(_0xb61c('0x5'));var interaction=require(_0xb61c('0x6'));var config=require(_0xb61c('0x7'));var controller=require(_0xb61c('0x8'));router[_0xb61c('0x9')]('/',auth['isAuthenticated'](),controller[_0xb61c('0xa')]);router['get']('/describe',auth[_0xb61c('0xb')](),controller[_0xb61c('0xc')]);router['get'](_0xb61c('0xd'),auth[_0xb61c('0xb')](),controller[_0xb61c('0xe')]);router['get'](_0xb61c('0xf'),auth[_0xb61c('0xb')](),controller[_0xb61c('0x10')]);router[_0xb61c('0x11')]('/',auth[_0xb61c('0xb')](),controller['create']);router['put'](_0xb61c('0xf'),controller[_0xb61c('0x12')]);router[_0xb61c('0x13')]('/:id',auth[_0xb61c('0xb')](),controller[_0xb61c('0x14')]);module[_0xb61c('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index a45a3d6..31790a8 100644 --- a/server/api/chatMessage/chatMessage.attributes.js +++ b/server/api/chatMessage/chatMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xee4f=['BOOLEAN','out','DATE','sequelize','medium'];(function(_0x2cb4a0,_0x221e34){var _0x19bd31=function(_0x5c973b){while(--_0x5c973b){_0x2cb4a0['push'](_0x2cb4a0['shift']());}};_0x19bd31(++_0x221e34);}(_0xee4f,0xad));var _0xfee4=function(_0x329a93,_0x2321ef){_0x329a93=_0x329a93-0x0;var _0x5b9b61=_0xee4f[_0x329a93];return _0x5b9b61;};'use strict';var Sequelize=require(_0xfee4('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xfee4('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xfee4('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xfee4('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xfee4('0x3')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xfee4('0x4')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xa149=['BOOLEAN','ENUM','out','STRING','sequelize','exports','TEXT','medium'];(function(_0x2d4eb8,_0x57d1e9){var _0x11f386=function(_0x47da21){while(--_0x47da21){_0x2d4eb8['push'](_0x2d4eb8['shift']());}};_0x11f386(++_0x57d1e9);}(_0xa149,0x18c));var _0x9a14=function(_0x1a6c0f,_0x284fd9){_0x1a6c0f=_0x1a6c0f-0x0;var _0x24b595=_0xa149[_0x1a6c0f];return _0x24b595;};'use strict';var Sequelize=require(_0x9a14('0x0'));module[_0x9a14('0x1')]={'body':{'type':Sequelize[_0x9a14('0x2')](_0x9a14('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x9a14('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x9a14('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9a14('0x5')]('in',_0x9a14('0x6')),'defaultValue':_0x9a14('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x9a14('0x7')]},'providerResponse':{'type':Sequelize[_0x9a14('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 60259b9..ab3d501 100644 --- a/server/api/chatMessage/chatMessage.controller.js +++ b/server/api/chatMessage/chatMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa318=['options','includeAll','include','findAll','rows','show','params','keys','find','create','body','destroy','describe','../../config/logger','chat-interactions','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','role','RejectMessage','rejectMessage','Sequelize','motionChannel','eml-format','rimraf','zip-dir','bluebird','mustache','util','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','redis','defaults','localhost','./chatMessage.socket','client','http','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','stack','name','index','map','ChatMessage','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x52a23d,_0xd93644){var _0x4f360b=function(_0x1c60c0){while(--_0x1c60c0){_0x52a23d['push'](_0x52a23d['shift']());}};_0x4f360b(++_0xd93644);}(_0xa318,0x13e));var _0x8a31=function(_0x27a9cd,_0x40311d){_0x27a9cd=_0x27a9cd-0x0;var _0xd8be27=_0xa318[_0x27a9cd];return _0xd8be27;};'use strict';var emlformat=require(_0x8a31('0x0'));var rimraf=require(_0x8a31('0x1'));var zipdir=require(_0x8a31('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8a31('0x3'));var Mustache=require(_0x8a31('0x4'));var util=require(_0x8a31('0x5'));var path=require('path');var sox=require(_0x8a31('0x6'));var csv=require('to-csv');var ejs=require(_0x8a31('0x7'));var fs=require('fs');var fs_extra=require(_0x8a31('0x8'));var _=require('lodash');var squel=require(_0x8a31('0x9'));var crypto=require('crypto');var jsforce=require(_0x8a31('0xa'));var deskjs=require(_0x8a31('0xb'));var toCsv=require(_0x8a31('0xc'));var querystring=require(_0x8a31('0xd'));var Papa=require(_0x8a31('0xe'));var Redis=require(_0x8a31('0xf'));var authService=require(_0x8a31('0x10'));var qs=require(_0x8a31('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8a31('0x12'));var logger=require('../../config/logger')(_0x8a31('0x13'));var utils=require(_0x8a31('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8a31('0x15'));var db=require('../../mysqldb')['db'];config[_0x8a31('0x16')]=_[_0x8a31('0x17')](config['redis'],{'host':_0x8a31('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8a31('0x16')]));require(_0x8a31('0x19'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x8a31('0x1a')][_0x8a31('0x1b')]({'port':0x232c});var client9002=jayson[_0x8a31('0x1a')][_0x8a31('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x3f9398,_0x970c2f,_0xc423ee,_0x1f0508){return new BPromise(function(_0x1b941d,_0x49ec24){var _0x5b9b9e=_0x1f0508||client;return _0x5b9b9e['request'](_0x3f9398,_0xc423ee)['then'](function(_0xc40602){logger['info'](_0x8a31('0x1c'),_0x970c2f,_0x8a31('0x1d'));logger[_0x8a31('0x1e')](_0x8a31('0x1f'),_0x970c2f,_0x8a31('0x1d'),JSON['stringify'](_0xc40602));if(_0xc40602[_0x8a31('0x20')]){if(_0xc40602[_0x8a31('0x20')]['code']===0x1f4){logger['error'](_0x8a31('0x1c'),_0x970c2f,_0xc40602[_0x8a31('0x20')][_0x8a31('0x21')]);return _0x49ec24(_0xc40602[_0x8a31('0x20')][_0x8a31('0x21')]);}logger[_0x8a31('0x20')](_0x8a31('0x1c'),_0x970c2f,_0xc40602[_0x8a31('0x20')][_0x8a31('0x21')]);return _0x1b941d(_0xc40602['error'][_0x8a31('0x21')]);}else{logger[_0x8a31('0x22')]('ChatMessage,\x20%s,\x20%s',_0x970c2f,_0x8a31('0x1d'));_0x1b941d(_0xc40602[_0x8a31('0x23')][_0x8a31('0x21')]);}})[_0x8a31('0x24')](function(_0x1da35b){logger['error'](_0x8a31('0x1c'),_0x970c2f,_0x1da35b);_0x49ec24(_0x1da35b);});});}function respondWithStatusCode(_0xce4f0a,_0x94e6f1){_0x94e6f1=_0x94e6f1||0xcc;return function(_0x395005){if(_0x395005){return _0xce4f0a['sendStatus'](_0x94e6f1);}return _0xce4f0a[_0x8a31('0x25')](_0x94e6f1)['end']();};}function respondWithResult(_0xd847d3,_0x3b7128){_0x3b7128=_0x3b7128||0xc8;return function(_0xfc6943){if(_0xfc6943){return _0xd847d3[_0x8a31('0x25')](_0x3b7128)[_0x8a31('0x26')](_0xfc6943);}};}function respondWithFilteredResult(_0x4baab1,_0x2280ca){return function(_0x4db5d2){if(_0x4db5d2){var _0xc1e63=typeof _0x2280ca[_0x8a31('0x27')]===_0x8a31('0x28')&&typeof _0x2280ca[_0x8a31('0x29')]===_0x8a31('0x28');var _0x339ed2=_0x4db5d2[_0x8a31('0x2a')];var _0x5e4c49=_0xc1e63?0x0:_0x2280ca['offset'];var _0x44db32=_0xc1e63?_0x4db5d2[_0x8a31('0x2a')]:_0x2280ca[_0x8a31('0x27')]+_0x2280ca[_0x8a31('0x29')];var _0x15dd0a;if(_0x44db32>=_0x339ed2){_0x44db32=_0x339ed2;_0x15dd0a=0xc8;}else{_0x15dd0a=0xce;}_0x4baab1[_0x8a31('0x25')](_0x15dd0a);return _0x4baab1[_0x8a31('0x2b')](_0x8a31('0x2c'),_0x5e4c49+'-'+_0x44db32+'/'+_0x339ed2)[_0x8a31('0x26')](_0x4db5d2);}return null;};}function patchUpdates(_0x209695){return function(_0x3e12db){try{jsonpatch[_0x8a31('0x2d')](_0x3e12db,_0x209695,!![]);}catch(_0x4385f8){return BPromise[_0x8a31('0x2e')](_0x4385f8);}return _0x3e12db[_0x8a31('0x2f')]();};}function saveUpdates(_0x3b56df,_0x3d2b7f){return function(_0x4f894f){if(_0x4f894f){return _0x4f894f[_0x8a31('0x30')](_0x3b56df)[_0x8a31('0x31')](function(_0x3142b9){return _0x3142b9;});}return null;};}function removeEntity(_0x6df394,_0x11c8ab){return function(_0xfba038){if(_0xfba038){return _0xfba038['destroy']()['then'](function(){_0x6df394[_0x8a31('0x25')](0xcc)[_0x8a31('0x32')]();});}};}function handleEntityNotFound(_0x32b424,_0x30bf2a){return function(_0x3e7261){if(!_0x3e7261){_0x32b424['sendStatus'](0x194);}return _0x3e7261;};}function handleError(_0x4cf542,_0x159813){_0x159813=_0x159813||0x1f4;return function(_0x3452a2){logger[_0x8a31('0x20')](_0x3452a2[_0x8a31('0x33')]);if(_0x3452a2[_0x8a31('0x34')]){delete _0x3452a2[_0x8a31('0x34')];}_0x4cf542['status'](_0x159813)['send'](_0x3452a2);};}exports[_0x8a31('0x35')]=function(_0x476c65,_0x2e3c64){var _0x181ad7={},_0x5b4014={},_0x18a220={'count':0x0,'rows':[]};var _0x37c227=_[_0x8a31('0x36')](db[_0x8a31('0x37')][_0x8a31('0x38')],function(_0x117bca){return{'name':_0x117bca[_0x8a31('0x39')],'type':_0x117bca[_0x8a31('0x3a')][_0x8a31('0x3b')]};});_0x5b4014['model']=_[_0x8a31('0x36')](_0x37c227,_0x8a31('0x34'));_0x5b4014[_0x8a31('0x3c')]=_['keys'](_0x476c65[_0x8a31('0x3c')]);_0x5b4014[_0x8a31('0x3d')]=_[_0x8a31('0x3e')](_0x5b4014['model'],_0x5b4014[_0x8a31('0x3c')]);_0x181ad7[_0x8a31('0x3f')]=_['intersection'](_0x5b4014[_0x8a31('0x40')],qs[_0x8a31('0x41')](_0x476c65[_0x8a31('0x3c')]['fields']));_0x181ad7[_0x8a31('0x3f')]=_0x181ad7[_0x8a31('0x3f')][_0x8a31('0x42')]?_0x181ad7[_0x8a31('0x3f')]:_0x5b4014[_0x8a31('0x40')];if(!_0x476c65[_0x8a31('0x3c')][_0x8a31('0x43')](_0x8a31('0x44'))){_0x181ad7[_0x8a31('0x29')]=qs[_0x8a31('0x29')](_0x476c65[_0x8a31('0x3c')][_0x8a31('0x29')]);_0x181ad7[_0x8a31('0x27')]=qs[_0x8a31('0x27')](_0x476c65[_0x8a31('0x3c')][_0x8a31('0x27')]);}_0x181ad7['order']=qs[_0x8a31('0x45')](_0x476c65[_0x8a31('0x3c')][_0x8a31('0x45')]);_0x181ad7[_0x8a31('0x46')]=qs[_0x8a31('0x3d')](_[_0x8a31('0x47')](_0x476c65[_0x8a31('0x3c')],_0x5b4014[_0x8a31('0x3d')]),_0x37c227);if(_0x476c65[_0x8a31('0x3c')][_0x8a31('0x48')]){_0x181ad7[_0x8a31('0x46')]=_[_0x8a31('0x49')](_0x181ad7[_0x8a31('0x46')],{'$or':_[_0x8a31('0x36')](_0x37c227,function(_0x3f5bc4){if(_0x3f5bc4['type']!==_0x8a31('0x4a')){var _0x5b1fd9={};_0x5b1fd9[_0x3f5bc4['name']]={'$like':'%'+_0x476c65[_0x8a31('0x3c')][_0x8a31('0x48')]+'%'};return _0x5b1fd9;}})});}_0x181ad7=_['merge']({},_0x181ad7,_0x476c65[_0x8a31('0x4b')]);var _0x3483e3={'where':_0x181ad7['where']};return db[_0x8a31('0x37')][_0x8a31('0x2a')](_0x3483e3)[_0x8a31('0x31')](function(_0x55f49a){_0x18a220['count']=_0x55f49a;if(_0x476c65[_0x8a31('0x3c')][_0x8a31('0x4c')]){_0x181ad7[_0x8a31('0x4d')]=[{'all':!![]}];}return db[_0x8a31('0x37')][_0x8a31('0x4e')](_0x181ad7);})[_0x8a31('0x31')](function(_0x3bb22c){_0x18a220[_0x8a31('0x4f')]=_0x3bb22c;return _0x18a220;})[_0x8a31('0x31')](respondWithFilteredResult(_0x2e3c64,_0x181ad7))[_0x8a31('0x24')](handleError(_0x2e3c64,null));};exports[_0x8a31('0x50')]=function(_0x497512,_0x106f81){var _0x352bc9={'raw':!![],'where':{'id':_0x497512[_0x8a31('0x51')]['id']}},_0x588c36={};_0x588c36[_0x8a31('0x40')]=_[_0x8a31('0x52')](db[_0x8a31('0x37')][_0x8a31('0x38')]);_0x588c36[_0x8a31('0x3c')]=_[_0x8a31('0x52')](_0x497512[_0x8a31('0x3c')]);_0x588c36[_0x8a31('0x3d')]=_[_0x8a31('0x3e')](_0x588c36[_0x8a31('0x40')],_0x588c36[_0x8a31('0x3c')]);_0x352bc9['attributes']=_[_0x8a31('0x3e')](_0x588c36[_0x8a31('0x40')],qs[_0x8a31('0x41')](_0x497512['query'][_0x8a31('0x41')]));_0x352bc9[_0x8a31('0x3f')]=_0x352bc9[_0x8a31('0x3f')][_0x8a31('0x42')]?_0x352bc9['attributes']:_0x588c36[_0x8a31('0x40')];if(_0x497512[_0x8a31('0x3c')][_0x8a31('0x4c')]){_0x352bc9[_0x8a31('0x4d')]=[{'all':!![]}];}_0x352bc9=_['merge']({},_0x352bc9,_0x497512[_0x8a31('0x4b')]);return db[_0x8a31('0x37')][_0x8a31('0x53')](_0x352bc9)[_0x8a31('0x31')](handleEntityNotFound(_0x106f81,null))[_0x8a31('0x31')](respondWithResult(_0x106f81,null))[_0x8a31('0x24')](handleError(_0x106f81,null));};exports['create']=function(_0x49384d,_0x5f2cd7){return db[_0x8a31('0x37')][_0x8a31('0x54')](_0x49384d['body'],{})[_0x8a31('0x31')](respondWithResult(_0x5f2cd7,0xc9))[_0x8a31('0x24')](handleError(_0x5f2cd7,null));};exports[_0x8a31('0x30')]=function(_0x525d62,_0x220704){if(_0x525d62[_0x8a31('0x55')]['id']){delete _0x525d62[_0x8a31('0x55')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x525d62[_0x8a31('0x51')]['id']}})['then'](handleEntityNotFound(_0x220704,null))[_0x8a31('0x31')](saveUpdates(_0x525d62[_0x8a31('0x55')],null))[_0x8a31('0x31')](respondWithResult(_0x220704,null))[_0x8a31('0x24')](handleError(_0x220704,null));};exports[_0x8a31('0x56')]=function(_0x5255cd,_0x3d3615){return db[_0x8a31('0x37')][_0x8a31('0x53')]({'where':{'id':_0x5255cd[_0x8a31('0x51')]['id']}})[_0x8a31('0x31')](handleEntityNotFound(_0x3d3615,null))[_0x8a31('0x31')](removeEntity(_0x3d3615,null))[_0x8a31('0x24')](handleError(_0x3d3615,null));};exports[_0x8a31('0x57')]=function(_0x1be34b,_0x55ce9d){return db[_0x8a31('0x37')][_0x8a31('0x57')]()['then'](respondWithResult(_0x55ce9d,null))[_0x8a31('0x24')](handleError(_0x55ce9d,null));};var interaction_log=require(_0x8a31('0x58'))(_0x8a31('0x59'));exports[_0x8a31('0x5a')]=function(_0x392d26,_0x8813ab,_0xfbd8c5){var _0x2a3ac1={'agent':{},'channel':_0x8a31('0x5b')};if(_0x392d26[_0x8a31('0x55')]['id']){delete _0x392d26[_0x8a31('0x55')]['id'];}_0x392d26[_0x8a31('0x55')][_0x8a31('0x5c')]=!![];_0x392d26[_0x8a31('0x55')]['readAt']=moment()[_0x8a31('0x5d')](_0x8a31('0x5e'));_0x392d26['body'][_0x8a31('0x5f')]=_0x392d26[_0x8a31('0x55')][_0x8a31('0x5f')]||_0x392d26[_0x8a31('0x60')]['id'];_0x2a3ac1[_0x8a31('0x61')]['id']=_0x392d26[_0x8a31('0x55')][_0x8a31('0x5f')];return db[_0x8a31('0x37')][_0x8a31('0x53')]({'where':{'id':_0x392d26['params']['id'],'UserId':null}})[_0x8a31('0x31')](handleEntityNotFound(_0x8813ab,null))[_0x8a31('0x31')](saveUpdates(_0x392d26['body'],null))[_0x8a31('0x31')](function(_0x3a65f6){if(_0x3a65f6){_0x2a3ac1[_0x8a31('0x21')]=_0x3a65f6[_0x8a31('0x62')]({'plain':!![]});return db[_0x8a31('0x63')]['find']({'where':{'id':_0x3a65f6[_0x8a31('0x64')]}});}return null;})[_0x8a31('0x31')](handleEntityNotFound(_0x8813ab,null))['then'](function(_0x5bd9f8){if(_0x5bd9f8){return _0x5bd9f8[_0x8a31('0x30')]({'UserId':_0x392d26[_0x8a31('0x55')][_0x8a31('0x5f')],'read1stAt':_[_0x8a31('0x65')](_0x5bd9f8[_0x8a31('0x66')])?moment()['format'](_0x8a31('0x5e')):undefined});}return null;})[_0x8a31('0x31')](function(_0xfb6d05){if(_0xfb6d05){_0x2a3ac1[_0x8a31('0x67')]=_0xfb6d05['get']({'plain':!![]});interaction_log['info'](_0x8a31('0x68'),_0x392d26[_0x8a31('0x60')]['id'],_0x392d26['user'][_0x8a31('0x34')],_0x392d26[_0x8a31('0x60')]['role'],_0x2a3ac1[_0x8a31('0x67')]['id'],_0x392d26[_0x8a31('0x55')]?JSON[_0x8a31('0x69')](_0x392d26[_0x8a31('0x55')]):_0x8a31('0x6a'));return respondWithRpcPromise(_0x8a31('0x6b'),_0x8a31('0x6c'),_0x2a3ac1);}return null;})[_0x8a31('0x31')](function(_0x9bd1f2){var _0x11f0fe=_0x8a31('0x6d')+_0x9bd1f2[_0x8a31('0x21')][_0x8a31('0x6e')];return db[_0x8a31('0x6f')][_0x8a31('0x3c')](_0x11f0fe,{'type':db['Sequelize'][_0x8a31('0x70')][_0x8a31('0x71')],'raw':!![]})[_0x8a31('0x31')](function(_0x52d7bd){return _0x52d7bd;});})[_0x8a31('0x31')](function(_0x596275){if(_0x596275){_0x2a3ac1[_0x8a31('0x21')][_0x8a31('0x72')]=_0x596275[0x0];if(!_0x392d26[_0x8a31('0x55')][_0x8a31('0x5f')])return;return db[_0x8a31('0x73')]['find']({'where':{'id':_0x392d26['body'][_0x8a31('0x5f')],'role':_0x8a31('0x61')},'attributes':['id',_0x8a31('0x34'),'fullname',_0x8a31('0x74'),_0x8a31('0x75')],'raw':!![]});}return null;})[_0x8a31('0x31')](function(_0xac1f9b){if(!_0xac1f9b)return null;_0x2a3ac1[_0x8a31('0x21')][_0x8a31('0x61')]=_0xac1f9b;return _0x2a3ac1;})[_0x8a31('0x31')](function(_0x49598d){if(_0x49598d){if(_0x392d26[_0x8a31('0x55')][_0x8a31('0x76')]){_0x2a3ac1[_0x8a31('0x21')][_0x8a31('0x77')]=util[_0x8a31('0x5d')](_0x8a31('0x78'),_0x392d26[_0x8a31('0x60')][_0x8a31('0x34')]);_0x2a3ac1[_0x8a31('0x21')][_0x8a31('0x79')]=_0x2a3ac1['channel'];_0x2a3ac1[_0x8a31('0x21')]['motionChannel']=_0x2a3ac1[_0x8a31('0x79')];_0x2a3ac1[_0x8a31('0x21')][_0x8a31('0x7a')]=_0x8a31('0x5a');return respondWithRpcPromise(_0x8a31('0x7b'),'EventManager',{'event':_0x8a31('0x7c'),'message':_[_0x8a31('0x49')](_0x2a3ac1[_0x8a31('0x21')],JSON[_0x8a31('0x7d')](_0x2a3ac1['interaction']['formData']))},client9002)[_0x8a31('0x31')](function(){return _0x2a3ac1;});}return _0x2a3ac1;}return null;})[_0x8a31('0x31')](respondWithResult(_0x8813ab,null))[_0x8a31('0x24')](handleError(_0x8813ab,null));};var interaction_log=require(_0x8a31('0x58'))(_0x8a31('0x59'));exports[_0x8a31('0x2e')]=function(_0x1c1027,_0x593409,_0x340cd3){var _0x3ca6a7={'agent':{},'channel':_0x8a31('0x5b')};if(_0x1c1027['body']['id']){delete _0x1c1027[_0x8a31('0x55')]['id'];}_0x1c1027['body'][_0x8a31('0x5f')]=_0x1c1027[_0x8a31('0x55')][_0x8a31('0x5f')]||_0x1c1027['user']['id'];_0x3ca6a7[_0x8a31('0x61')]['id']=_0x1c1027['body']['UserId'];return db[_0x8a31('0x37')][_0x8a31('0x53')]({'where':{'id':_0x1c1027[_0x8a31('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x593409,null))[_0x8a31('0x31')](function(_0x1de5bc){if(_0x1de5bc){_0x3ca6a7[_0x8a31('0x21')]=_0x1de5bc[_0x8a31('0x62')]({'plain':!![]});return db[_0x8a31('0x63')][_0x8a31('0x53')]({'where':{'id':_0x1de5bc[_0x8a31('0x64')]}});}return null;})[_0x8a31('0x31')](handleEntityNotFound(_0x593409,null))['then'](function(_0x7abb79){if(_0x7abb79){_0x3ca6a7[_0x8a31('0x67')]=_0x7abb79[_0x8a31('0x62')]({'plain':!![]});interaction_log[_0x8a31('0x22')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1c1027[_0x8a31('0x60')]['id'],_0x1c1027['user'][_0x8a31('0x34')],_0x1c1027['user'][_0x8a31('0x7e')],_0x3ca6a7['interaction']['id'],_0x1c1027['body']?JSON[_0x8a31('0x69')](_0x1c1027['body']):_0x8a31('0x6a'));return respondWithRpcPromise(_0x8a31('0x7f'),_0x8a31('0x80'),_0x3ca6a7);}return null;})['then'](function(_0x9c952c){var _0x597aea=_0x8a31('0x6d')+_0x9c952c['message'][_0x8a31('0x6e')];return db['sequelize']['query'](_0x597aea,{'type':db[_0x8a31('0x81')][_0x8a31('0x70')][_0x8a31('0x71')],'raw':!![]})[_0x8a31('0x31')](function(_0xd07d75){return _0xd07d75;});})['then'](function(_0x453666){if(_0x453666){_0x3ca6a7[_0x8a31('0x21')][_0x8a31('0x72')]=_0x453666[0x0];if(!_0x1c1027[_0x8a31('0x55')][_0x8a31('0x5f')])return;return db[_0x8a31('0x73')][_0x8a31('0x53')]({'where':{'id':_0x1c1027[_0x8a31('0x55')][_0x8a31('0x5f')],'role':_0x8a31('0x61')},'attributes':['id',_0x8a31('0x34'),'fullname','email',_0x8a31('0x75')],'raw':!![]});}return null;})[_0x8a31('0x31')](function(_0x47ba3a){if(!_0x47ba3a)return null;_0x3ca6a7['message']['agent']=_0x47ba3a;return _0x3ca6a7;})[_0x8a31('0x31')](function(_0x5f9402){if(_0x5f9402){_0x5f9402[_0x8a31('0x21')][_0x8a31('0x77')]=util[_0x8a31('0x5d')](_0x8a31('0x78'),_0x1c1027[_0x8a31('0x60')][_0x8a31('0x34')]);_0x5f9402['message']['channel']=_0x3ca6a7[_0x8a31('0x79')];_0x5f9402[_0x8a31('0x21')][_0x8a31('0x82')]=_0x3ca6a7['channel'];_0x5f9402[_0x8a31('0x21')]['event']=_0x8a31('0x2e');respondWithRpcPromise(_0x8a31('0x7b'),_0x8a31('0x7b'),{'event':'rejectmessage','message':_[_0x8a31('0x49')](_0x3ca6a7[_0x8a31('0x21')],JSON[_0x8a31('0x7d')](_0x3ca6a7[_0x8a31('0x67')]['formData']))},client9002);return _0x3ca6a7;}return null;})[_0x8a31('0x31')](respondWithResult(_0x593409,null))[_0x8a31('0x24')](handleError(_0x593409,null));}; \ No newline at end of file +var _0x4be2=['stack','name','send','index','map','rawAttributes','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','options','ChatMessage','includeAll','include','findAll','rows','show','params','keys','length','merge','find','create','body','describe','chat-interactions','accept','readAt','user','agent','ChatInteraction','ChatInteractionId','UserId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','email','internal','manual','format','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','formData','chat','get','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','contact','interface','rejectmessage','parse','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','redis','./chatMessage.socket','register','jayson/promise','client','request','info','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','status','end','limit','undefined','count','offset','Content-Range','json','reject','save','update','then','destroy'];(function(_0x616fb8,_0x177e11){var _0x739e20=function(_0xfe27e9){while(--_0xfe27e9){_0x616fb8['push'](_0x616fb8['shift']());}};_0x739e20(++_0x177e11);}(_0x4be2,0xcb));var _0x24be=function(_0x99ba67,_0x10eae9){_0x99ba67=_0x99ba67-0x0;var _0x5c4f7d=_0x4be2[_0x99ba67];return _0x5c4f7d;};'use strict';var emlformat=require(_0x24be('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x24be('0x1'));var jsonpatch=require(_0x24be('0x2'));var rp=require(_0x24be('0x3'));var moment=require('moment');var BPromise=require(_0x24be('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x24be('0x5'));var sox=require(_0x24be('0x6'));var csv=require(_0x24be('0x7'));var ejs=require(_0x24be('0x8'));var fs=require('fs');var fs_extra=require(_0x24be('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x24be('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x24be('0x7'));var querystring=require(_0x24be('0xb'));var Papa=require('papaparse');var Redis=require(_0x24be('0xc'));var authService=require(_0x24be('0xd'));var qs=require(_0x24be('0xe'));var as=require(_0x24be('0xf'));var hardwareService=require(_0x24be('0x10'));var logger=require(_0x24be('0x11'))('api');var utils=require(_0x24be('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x24be('0x13')]=_['defaults'](config[_0x24be('0x13')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x24be('0x13')]));require(_0x24be('0x14'))[_0x24be('0x15')](socket);var jayson=require(_0x24be('0x16'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x24be('0x17')]['http']({'port':0x232a});function respondWithRpcPromise(_0x76e93e,_0x29754b,_0x46200a,_0x5e8bd1){return new BPromise(function(_0x44ad4b,_0x539221){var _0x566a3f=_0x5e8bd1||client;return _0x566a3f[_0x24be('0x18')](_0x76e93e,_0x46200a)['then'](function(_0x1f1a16){logger[_0x24be('0x19')](_0x24be('0x1a'),_0x29754b,'request\x20sent');logger['debug'](_0x24be('0x1b'),_0x29754b,_0x24be('0x1c'),JSON[_0x24be('0x1d')](_0x1f1a16));if(_0x1f1a16['error']){if(_0x1f1a16[_0x24be('0x1e')]['code']===0x1f4){logger[_0x24be('0x1e')](_0x24be('0x1a'),_0x29754b,_0x1f1a16[_0x24be('0x1e')][_0x24be('0x1f')]);return _0x539221(_0x1f1a16[_0x24be('0x1e')][_0x24be('0x1f')]);}logger[_0x24be('0x1e')](_0x24be('0x1a'),_0x29754b,_0x1f1a16[_0x24be('0x1e')]['message']);return _0x44ad4b(_0x1f1a16[_0x24be('0x1e')][_0x24be('0x1f')]);}else{logger['info'](_0x24be('0x1a'),_0x29754b,'request\x20sent');_0x44ad4b(_0x1f1a16[_0x24be('0x20')][_0x24be('0x1f')]);}})[_0x24be('0x21')](function(_0x1c293e){logger[_0x24be('0x1e')](_0x24be('0x1a'),_0x29754b,_0x1c293e);_0x539221(_0x1c293e);});});}function respondWithStatusCode(_0x2a6cfc,_0x15e2d3){_0x15e2d3=_0x15e2d3||0xcc;return function(_0x2f68c7){if(_0x2f68c7){return _0x2a6cfc['sendStatus'](_0x15e2d3);}return _0x2a6cfc[_0x24be('0x22')](_0x15e2d3)[_0x24be('0x23')]();};}function respondWithResult(_0x13c47d,_0x363036){_0x363036=_0x363036||0xc8;return function(_0x145850){if(_0x145850){return _0x13c47d[_0x24be('0x22')](_0x363036)['json'](_0x145850);}};}function respondWithFilteredResult(_0x3c3cf3,_0x3e339b){return function(_0x1e4848){if(_0x1e4848){var _0x37cf58=typeof _0x3e339b['offset']==='undefined'&&typeof _0x3e339b[_0x24be('0x24')]===_0x24be('0x25');var _0x5a07c0=_0x1e4848[_0x24be('0x26')];var _0x4578ca=_0x37cf58?0x0:_0x3e339b[_0x24be('0x27')];var _0x527343=_0x37cf58?_0x1e4848['count']:_0x3e339b['offset']+_0x3e339b['limit'];var _0x2f197c;if(_0x527343>=_0x5a07c0){_0x527343=_0x5a07c0;_0x2f197c=0xc8;}else{_0x2f197c=0xce;}_0x3c3cf3[_0x24be('0x22')](_0x2f197c);return _0x3c3cf3['set'](_0x24be('0x28'),_0x4578ca+'-'+_0x527343+'/'+_0x5a07c0)[_0x24be('0x29')](_0x1e4848);}return null;};}function patchUpdates(_0x2667d4){return function(_0x3bb674){try{jsonpatch['apply'](_0x3bb674,_0x2667d4,!![]);}catch(_0xb2fc1){return BPromise[_0x24be('0x2a')](_0xb2fc1);}return _0x3bb674[_0x24be('0x2b')]();};}function saveUpdates(_0x44bca9,_0x243519){return function(_0xf8f7a){if(_0xf8f7a){return _0xf8f7a[_0x24be('0x2c')](_0x44bca9)[_0x24be('0x2d')](function(_0x1fd5e1){return _0x1fd5e1;});}return null;};}function removeEntity(_0x55c025,_0x85a07){return function(_0x2d50fa){if(_0x2d50fa){return _0x2d50fa[_0x24be('0x2e')]()[_0x24be('0x2d')](function(){_0x55c025['status'](0xcc)[_0x24be('0x23')]();});}};}function handleEntityNotFound(_0x280a57,_0x1f6eb4){return function(_0x4f265b){if(!_0x4f265b){_0x280a57['sendStatus'](0x194);}return _0x4f265b;};}function handleError(_0x18d2a9,_0x19f7e6){_0x19f7e6=_0x19f7e6||0x1f4;return function(_0x4d49d5){logger[_0x24be('0x1e')](_0x4d49d5[_0x24be('0x2f')]);if(_0x4d49d5[_0x24be('0x30')]){delete _0x4d49d5[_0x24be('0x30')];}_0x18d2a9[_0x24be('0x22')](_0x19f7e6)[_0x24be('0x31')](_0x4d49d5);};}exports[_0x24be('0x32')]=function(_0x6b53ab,_0xe9b722){var _0x267018={},_0x5c968e={},_0x5202a0={'count':0x0,'rows':[]};var _0x9d2c7e=_[_0x24be('0x33')](db['ChatMessage'][_0x24be('0x34')],function(_0xdff40a){return{'name':_0xdff40a['fieldName'],'type':_0xdff40a['type'][_0x24be('0x35')]};});_0x5c968e[_0x24be('0x36')]=_[_0x24be('0x33')](_0x9d2c7e,_0x24be('0x30'));_0x5c968e[_0x24be('0x37')]=_['keys'](_0x6b53ab[_0x24be('0x37')]);_0x5c968e[_0x24be('0x38')]=_['intersection'](_0x5c968e[_0x24be('0x36')],_0x5c968e[_0x24be('0x37')]);_0x267018[_0x24be('0x39')]=_[_0x24be('0x3a')](_0x5c968e[_0x24be('0x36')],qs[_0x24be('0x3b')](_0x6b53ab[_0x24be('0x37')][_0x24be('0x3b')]));_0x267018['attributes']=_0x267018[_0x24be('0x39')]['length']?_0x267018[_0x24be('0x39')]:_0x5c968e[_0x24be('0x36')];if(!_0x6b53ab['query'][_0x24be('0x3c')](_0x24be('0x3d'))){_0x267018['limit']=qs[_0x24be('0x24')](_0x6b53ab['query'][_0x24be('0x24')]);_0x267018[_0x24be('0x27')]=qs[_0x24be('0x27')](_0x6b53ab['query'][_0x24be('0x27')]);}_0x267018['order']=qs['sort'](_0x6b53ab['query'][_0x24be('0x3e')]);_0x267018[_0x24be('0x3f')]=qs[_0x24be('0x38')](_[_0x24be('0x40')](_0x6b53ab['query'],_0x5c968e[_0x24be('0x38')]),_0x9d2c7e);if(_0x6b53ab[_0x24be('0x37')][_0x24be('0x41')]){_0x267018[_0x24be('0x3f')]=_['merge'](_0x267018[_0x24be('0x3f')],{'$or':_[_0x24be('0x33')](_0x9d2c7e,function(_0x5f110c){if(_0x5f110c[_0x24be('0x42')]!==_0x24be('0x43')){var _0x47a104={};_0x47a104[_0x5f110c[_0x24be('0x30')]]={'$like':'%'+_0x6b53ab[_0x24be('0x37')][_0x24be('0x41')]+'%'};return _0x47a104;}})});}_0x267018=_['merge']({},_0x267018,_0x6b53ab[_0x24be('0x44')]);var _0x5c2243={'where':_0x267018[_0x24be('0x3f')]};return db[_0x24be('0x45')]['count'](_0x5c2243)['then'](function(_0x1f6fc5){_0x5202a0[_0x24be('0x26')]=_0x1f6fc5;if(_0x6b53ab[_0x24be('0x37')][_0x24be('0x46')]){_0x267018[_0x24be('0x47')]=[{'all':!![]}];}return db[_0x24be('0x45')][_0x24be('0x48')](_0x267018);})[_0x24be('0x2d')](function(_0x2e075b){_0x5202a0[_0x24be('0x49')]=_0x2e075b;return _0x5202a0;})[_0x24be('0x2d')](respondWithFilteredResult(_0xe9b722,_0x267018))[_0x24be('0x21')](handleError(_0xe9b722,null));};exports[_0x24be('0x4a')]=function(_0x48afa4,_0x54a00c){var _0x4df4ca={'raw':!![],'where':{'id':_0x48afa4[_0x24be('0x4b')]['id']}},_0x14e672={};_0x14e672[_0x24be('0x36')]=_[_0x24be('0x4c')](db[_0x24be('0x45')][_0x24be('0x34')]);_0x14e672[_0x24be('0x37')]=_[_0x24be('0x4c')](_0x48afa4['query']);_0x14e672['filters']=_[_0x24be('0x3a')](_0x14e672[_0x24be('0x36')],_0x14e672['query']);_0x4df4ca['attributes']=_[_0x24be('0x3a')](_0x14e672[_0x24be('0x36')],qs['fields'](_0x48afa4['query']['fields']));_0x4df4ca[_0x24be('0x39')]=_0x4df4ca[_0x24be('0x39')][_0x24be('0x4d')]?_0x4df4ca['attributes']:_0x14e672[_0x24be('0x36')];if(_0x48afa4[_0x24be('0x37')][_0x24be('0x46')]){_0x4df4ca[_0x24be('0x47')]=[{'all':!![]}];}_0x4df4ca=_[_0x24be('0x4e')]({},_0x4df4ca,_0x48afa4[_0x24be('0x44')]);return db[_0x24be('0x45')][_0x24be('0x4f')](_0x4df4ca)[_0x24be('0x2d')](handleEntityNotFound(_0x54a00c,null))[_0x24be('0x2d')](respondWithResult(_0x54a00c,null))[_0x24be('0x21')](handleError(_0x54a00c,null));};exports[_0x24be('0x50')]=function(_0x560ba1,_0x40839d){return db[_0x24be('0x45')]['create'](_0x560ba1[_0x24be('0x51')],{})['then'](respondWithResult(_0x40839d,0xc9))[_0x24be('0x21')](handleError(_0x40839d,null));};exports[_0x24be('0x2c')]=function(_0x35793d,_0x5249aa){if(_0x35793d[_0x24be('0x51')]['id']){delete _0x35793d['body']['id'];}return db[_0x24be('0x45')][_0x24be('0x4f')]({'where':{'id':_0x35793d[_0x24be('0x4b')]['id']}})[_0x24be('0x2d')](handleEntityNotFound(_0x5249aa,null))[_0x24be('0x2d')](saveUpdates(_0x35793d[_0x24be('0x51')],null))[_0x24be('0x2d')](respondWithResult(_0x5249aa,null))[_0x24be('0x21')](handleError(_0x5249aa,null));};exports[_0x24be('0x2e')]=function(_0x585a9b,_0x505024){return db[_0x24be('0x45')][_0x24be('0x4f')]({'where':{'id':_0x585a9b[_0x24be('0x4b')]['id']}})['then'](handleEntityNotFound(_0x505024,null))[_0x24be('0x2d')](removeEntity(_0x505024,null))[_0x24be('0x21')](handleError(_0x505024,null));};exports[_0x24be('0x52')]=function(_0x51b446,_0x56cd22){return db[_0x24be('0x45')][_0x24be('0x52')]()['then'](respondWithResult(_0x56cd22,null))[_0x24be('0x21')](handleError(_0x56cd22,null));};var interaction_log=require(_0x24be('0x11'))(_0x24be('0x53'));exports[_0x24be('0x54')]=function(_0x1946ca,_0x4303a5,_0x49d50b){var _0x2a88df={'agent':{},'channel':'chat'};if(_0x1946ca['body']['id']){delete _0x1946ca[_0x24be('0x51')]['id'];}_0x1946ca[_0x24be('0x51')]['read']=!![];_0x1946ca[_0x24be('0x51')][_0x24be('0x55')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x1946ca[_0x24be('0x51')]['UserId']=_0x1946ca[_0x24be('0x51')]['UserId']||_0x1946ca[_0x24be('0x56')]['id'];_0x2a88df[_0x24be('0x57')]['id']=_0x1946ca[_0x24be('0x51')]['UserId'];return db[_0x24be('0x45')][_0x24be('0x4f')]({'where':{'id':_0x1946ca['params']['id'],'UserId':null}})[_0x24be('0x2d')](handleEntityNotFound(_0x4303a5,null))[_0x24be('0x2d')](saveUpdates(_0x1946ca[_0x24be('0x51')],null))[_0x24be('0x2d')](function(_0x4cd8e7){if(_0x4cd8e7){_0x2a88df[_0x24be('0x1f')]=_0x4cd8e7['get']({'plain':!![]});return db[_0x24be('0x58')][_0x24be('0x4f')]({'where':{'id':_0x4cd8e7[_0x24be('0x59')]}});}return null;})['then'](handleEntityNotFound(_0x4303a5,null))[_0x24be('0x2d')](function(_0x2ae3a3){if(_0x2ae3a3){return _0x2ae3a3['update']({'UserId':_0x1946ca[_0x24be('0x51')][_0x24be('0x5a')],'read1stAt':_[_0x24be('0x5b')](_0x2ae3a3[_0x24be('0x5c')])?moment()['format'](_0x24be('0x5d')):undefined});}return null;})[_0x24be('0x2d')](function(_0x495e6b){if(_0x495e6b){_0x2a88df[_0x24be('0x5e')]=_0x495e6b['get']({'plain':!![]});interaction_log[_0x24be('0x19')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1946ca['user']['id'],_0x1946ca['user'][_0x24be('0x30')],_0x1946ca[_0x24be('0x56')][_0x24be('0x5f')],_0x2a88df[_0x24be('0x5e')]['id'],_0x1946ca['body']?JSON['stringify'](_0x1946ca['body']):_0x24be('0x60'));return respondWithRpcPromise(_0x24be('0x61'),_0x24be('0x62'),_0x2a88df);}return null;})[_0x24be('0x2d')](function(_0x2c49dc){var _0x42dd28=_0x24be('0x63')+_0x2c49dc[_0x24be('0x1f')][_0x24be('0x64')];return db[_0x24be('0x65')][_0x24be('0x37')](_0x42dd28,{'type':db[_0x24be('0x66')][_0x24be('0x67')][_0x24be('0x68')],'raw':!![]})['then'](function(_0x4eeaea){return _0x4eeaea;});})[_0x24be('0x2d')](function(_0x3b1db0){if(_0x3b1db0){_0x2a88df[_0x24be('0x1f')]['contact']=_0x3b1db0[0x0];if(!_0x1946ca['body']['UserId'])return;return db[_0x24be('0x69')][_0x24be('0x4f')]({'where':{'id':_0x1946ca[_0x24be('0x51')][_0x24be('0x5a')],'role':'agent'},'attributes':['id',_0x24be('0x30'),'fullname',_0x24be('0x6a'),_0x24be('0x6b')],'raw':!![]});}return null;})['then'](function(_0x1534a9){if(!_0x1534a9)return null;_0x2a88df['message'][_0x24be('0x57')]=_0x1534a9;return _0x2a88df;})['then'](function(_0x1a9fb5){if(_0x1a9fb5){if(_0x1946ca[_0x24be('0x51')][_0x24be('0x6c')]){_0x2a88df['message']['interface']=util[_0x24be('0x6d')](_0x24be('0x6e'),_0x1946ca[_0x24be('0x56')]['name']);_0x2a88df[_0x24be('0x1f')][_0x24be('0x6f')]=_0x2a88df[_0x24be('0x6f')];_0x2a88df['message'][_0x24be('0x70')]=_0x2a88df['channel'];_0x2a88df[_0x24be('0x1f')][_0x24be('0x71')]='accept';return respondWithRpcPromise('EventManager',_0x24be('0x72'),{'event':_0x24be('0x73'),'message':_[_0x24be('0x4e')](_0x2a88df[_0x24be('0x1f')],JSON['parse'](_0x2a88df[_0x24be('0x5e')][_0x24be('0x74')]))},client9002)[_0x24be('0x2d')](function(){return _0x2a88df;});}return _0x2a88df;}return null;})[_0x24be('0x2d')](respondWithResult(_0x4303a5,null))[_0x24be('0x21')](handleError(_0x4303a5,null));};var interaction_log=require('../../config/logger')(_0x24be('0x53'));exports[_0x24be('0x2a')]=function(_0x43c557,_0x695c17,_0x192bfc){var _0x18705d={'agent':{},'channel':_0x24be('0x75')};if(_0x43c557[_0x24be('0x51')]['id']){delete _0x43c557[_0x24be('0x51')]['id'];}_0x43c557[_0x24be('0x51')][_0x24be('0x5a')]=_0x43c557[_0x24be('0x51')][_0x24be('0x5a')]||_0x43c557[_0x24be('0x56')]['id'];_0x18705d['agent']['id']=_0x43c557[_0x24be('0x51')][_0x24be('0x5a')];return db['ChatMessage'][_0x24be('0x4f')]({'where':{'id':_0x43c557['params']['id'],'UserId':null}})[_0x24be('0x2d')](handleEntityNotFound(_0x695c17,null))[_0x24be('0x2d')](function(_0x310cfa){if(_0x310cfa){_0x18705d[_0x24be('0x1f')]=_0x310cfa[_0x24be('0x76')]({'plain':!![]});return db[_0x24be('0x58')][_0x24be('0x4f')]({'where':{'id':_0x310cfa[_0x24be('0x59')]}});}return null;})[_0x24be('0x2d')](handleEntityNotFound(_0x695c17,null))[_0x24be('0x2d')](function(_0x22098a){if(_0x22098a){_0x18705d[_0x24be('0x5e')]=_0x22098a['get']({'plain':!![]});interaction_log[_0x24be('0x19')](_0x24be('0x77'),_0x43c557['user']['id'],_0x43c557[_0x24be('0x56')][_0x24be('0x30')],_0x43c557[_0x24be('0x56')][_0x24be('0x5f')],_0x18705d['interaction']['id'],_0x43c557['body']?JSON[_0x24be('0x1d')](_0x43c557['body']):_0x24be('0x60'));return respondWithRpcPromise(_0x24be('0x78'),'rejectMessage',_0x18705d);}return null;})['then'](function(_0x555129){var _0x13f288='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x555129[_0x24be('0x1f')][_0x24be('0x64')];return db[_0x24be('0x65')][_0x24be('0x37')](_0x13f288,{'type':db[_0x24be('0x66')][_0x24be('0x67')][_0x24be('0x68')],'raw':!![]})[_0x24be('0x2d')](function(_0x353ace){return _0x353ace;});})[_0x24be('0x2d')](function(_0x3541e7){if(_0x3541e7){_0x18705d[_0x24be('0x1f')][_0x24be('0x79')]=_0x3541e7[0x0];if(!_0x43c557['body'][_0x24be('0x5a')])return;return db[_0x24be('0x69')][_0x24be('0x4f')]({'where':{'id':_0x43c557[_0x24be('0x51')][_0x24be('0x5a')],'role':_0x24be('0x57')},'attributes':['id','name','fullname',_0x24be('0x6a'),_0x24be('0x6b')],'raw':!![]});}return null;})['then'](function(_0x521e86){if(!_0x521e86)return null;_0x18705d['message'][_0x24be('0x57')]=_0x521e86;return _0x18705d;})['then'](function(_0x3f0ba1){if(_0x3f0ba1){_0x3f0ba1[_0x24be('0x1f')][_0x24be('0x7a')]=util[_0x24be('0x6d')]('SIP/%s',_0x43c557['user']['name']);_0x3f0ba1[_0x24be('0x1f')][_0x24be('0x6f')]=_0x18705d['channel'];_0x3f0ba1[_0x24be('0x1f')][_0x24be('0x70')]=_0x18705d[_0x24be('0x6f')];_0x3f0ba1['message'][_0x24be('0x71')]='reject';respondWithRpcPromise(_0x24be('0x72'),_0x24be('0x72'),{'event':_0x24be('0x7b'),'message':_[_0x24be('0x4e')](_0x18705d[_0x24be('0x1f')],JSON[_0x24be('0x7c')](_0x18705d[_0x24be('0x5e')]['formData']))},client9002);return _0x18705d;}return null;})[_0x24be('0x2d')](respondWithResult(_0x695c17,null))['catch'](handleError(_0x695c17,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 9c431ad..ea5e6fb 100644 --- a/server/api/chatMessage/chatMessage.events.js +++ b/server/api/chatMessage/chatMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6ea3=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save'];(function(_0x24c5df,_0x36adbc){var _0x374082=function(_0x332441){while(--_0x332441){_0x24c5df['push'](_0x24c5df['shift']());}};_0x374082(++_0x36adbc);}(_0x6ea3,0x1c9));var _0x36ea=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x6ea3[_0x42cae2];return _0x5f256f;};'use strict';var EventEmitter=require(_0x36ea('0x0'));var ChatMessage=require(_0x36ea('0x1'))['db'][_0x36ea('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x36ea('0x3')](0x0);var events={'afterCreate':_0x36ea('0x4'),'afterUpdate':_0x36ea('0x5'),'afterDestroy':_0x36ea('0x6')};function emitEvent(_0x2b9ccb){return function(_0x734803,_0x2cb540,_0x4d154e){ChatMessageEvents[_0x36ea('0x7')](_0x2b9ccb+':'+_0x734803['id'],_0x734803);ChatMessageEvents[_0x36ea('0x7')](_0x2b9ccb,_0x734803);_0x4d154e(null);};}for(var e in events){if(events[_0x36ea('0x8')](e)){var event=events[e];ChatMessage[_0x36ea('0x9')](e,emitEvent(event));}}module[_0x36ea('0xa')]=ChatMessageEvents; \ No newline at end of file +var _0x5587=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x54f2a6,_0x1b5b42){var _0x7d84c1=function(_0x9b1ebc){while(--_0x9b1ebc){_0x54f2a6['push'](_0x54f2a6['shift']());}};_0x7d84c1(++_0x1b5b42);}(_0x5587,0x77));var _0x7558=function(_0x55c746,_0x1485c0){_0x55c746=_0x55c746-0x0;var _0x847901=_0x5587[_0x55c746];return _0x847901;};'use strict';var EventEmitter=require(_0x7558('0x0'));var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x7558('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7558('0x2'),'afterDestroy':_0x7558('0x3')};function emitEvent(_0x29678d){return function(_0x1cffd2,_0xb1ee0,_0x16bf49){ChatMessageEvents[_0x7558('0x4')](_0x29678d+':'+_0x1cffd2['id'],_0x1cffd2);ChatMessageEvents['emit'](_0x29678d,_0x1cffd2);_0x16bf49(null);};}for(var e in events){if(events[_0x7558('0x5')](e)){var event=events[e];ChatMessage[_0x7558('0x6')](e,emitEvent(event));}}module[_0x7558('0x7')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 970628b..0d59da3 100644 --- a/server/api/chatMessage/chatMessage.model.js +++ b/server/api/chatMessage/chatMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x17da=['request-promise','path','../../config/environment','exports','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird'];(function(_0x10b95c,_0x134f5a){var _0x53fbf8=function(_0x5cc266){while(--_0x5cc266){_0x10b95c['push'](_0x10b95c['shift']());}};_0x53fbf8(++_0x134f5a);}(_0x17da,0x167));var _0xa17d=function(_0x8d3fdb,_0x35f605){_0x8d3fdb=_0x8d3fdb-0x0;var _0x42d81a=_0x17da[_0x8d3fdb];return _0x42d81a;};'use strict';var _=require(_0xa17d('0x0'));var util=require('util');var logger=require(_0xa17d('0x1'))(_0xa17d('0x2'));var moment=require(_0xa17d('0x3'));var BPromise=require(_0xa17d('0x4'));var rp=require(_0xa17d('0x5'));var fs=require('fs');var path=require(_0xa17d('0x6'));var rimraf=require('rimraf');var config=require(_0xa17d('0x7'));var attributes=require('./chatMessage.attributes');module[_0xa17d('0x8')]=function(_0x25ce5b,_0x34d2da){return _0x25ce5b['define'](_0xa17d('0x9'),attributes,{'tableName':_0xa17d('0xa'),'paranoid':![],'indexes':[{'name':_0xa17d('0xb'),'fields':[_0xa17d('0xc')],'type':_0xa17d('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x326298,_0x4b130f,_0x9c1c55){var _0x57584d=_0x25ce5b[_0xa17d('0xe')];var _0x5d5bc8=_0x326298['get']({'plain':!![]});if(_0x5d5bc8[_0xa17d('0xf')][_0xa17d('0x10')]()==='in'||_0x5d5bc8['direction']['toLowerCase']()===_0xa17d('0x11')&&!_0x5d5bc8[_0xa17d('0x12')]&&!_['isNil'](_0x5d5bc8[_0xa17d('0x13')])){_0x57584d[_0xa17d('0x14')][_0xa17d('0x15')]({'where':{'id':_0x5d5bc8[_0xa17d('0x16')]}})[_0xa17d('0x17')](function(_0x5d68b4){if(_0x5d68b4){_0x5d68b4[_0xa17d('0x18')]({'lastMsgAt':_0x5d5bc8[_0xa17d('0x19')],'lastMsgDirection':_0x5d5bc8[_0xa17d('0xf')][_0xa17d('0x10')]()});}})['catch'](function(_0x567530){console['error'](_0x567530);});}_0x9c1c55();}},'charset':_0xa17d('0x1a'),'collate':_0xa17d('0x1b')});}; \ No newline at end of file +var _0x1b4e=['out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','models','get','direction','toLowerCase'];(function(_0x3ebfe1,_0x3dfa31){var _0xe262c3=function(_0x20a9eb){while(--_0x20a9eb){_0x3ebfe1['push'](_0x3ebfe1['shift']());}};_0xe262c3(++_0x3dfa31);}(_0x1b4e,0x1ad));var _0xe1b4=function(_0x59e7fe,_0x226bec){_0x59e7fe=_0x59e7fe-0x0;var _0x23aed0=_0x1b4e[_0x59e7fe];return _0x23aed0;};'use strict';var _=require(_0xe1b4('0x0'));var util=require(_0xe1b4('0x1'));var logger=require(_0xe1b4('0x2'))(_0xe1b4('0x3'));var moment=require(_0xe1b4('0x4'));var BPromise=require('bluebird');var rp=require(_0xe1b4('0x5'));var fs=require('fs');var path=require(_0xe1b4('0x6'));var rimraf=require(_0xe1b4('0x7'));var config=require(_0xe1b4('0x8'));var attributes=require(_0xe1b4('0x9'));module[_0xe1b4('0xa')]=function(_0x46bafd,_0x2449be){return _0x46bafd['define'](_0xe1b4('0xb'),attributes,{'tableName':_0xe1b4('0xc'),'paranoid':![],'indexes':[{'name':_0xe1b4('0xd'),'fields':['body'],'type':_0xe1b4('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5917a8,_0x37154f,_0x4f6e41){var _0x4ca172=_0x46bafd[_0xe1b4('0xf')];var _0x42e616=_0x5917a8[_0xe1b4('0x10')]({'plain':!![]});if(_0x42e616[_0xe1b4('0x11')][_0xe1b4('0x12')]()==='in'||_0x42e616[_0xe1b4('0x11')][_0xe1b4('0x12')]()===_0xe1b4('0x13')&&!_0x42e616[_0xe1b4('0x14')]&&!_[_0xe1b4('0x15')](_0x42e616[_0xe1b4('0x16')])){_0x4ca172[_0xe1b4('0x17')][_0xe1b4('0x18')]({'where':{'id':_0x42e616[_0xe1b4('0x19')]}})[_0xe1b4('0x1a')](function(_0x4079df){if(_0x4079df){_0x4079df[_0xe1b4('0x1b')]({'lastMsgAt':_0x42e616[_0xe1b4('0x1c')],'lastMsgDirection':_0x42e616[_0xe1b4('0x11')][_0xe1b4('0x12')]()});}})[_0xe1b4('0x1d')](function(_0x605ed3){console['error'](_0x605ed3);});}_0x4f6e41();}},'charset':_0xe1b4('0x1e'),'collate':_0xe1b4('0x1f')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 895bc72..b729711 100644 --- a/server/api/chatMessage/chatMessage.rpc.js +++ b/server/api/chatMessage/chatMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7937=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','error','ChatMessage,\x20%s,\x20%s','message','catch','CreateChatMessage','ChatMessage','create','body','options','raw','stringify','lodash','util','moment'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0x7937,0x81));var _0x7793=function(_0x30853f,_0x4aa320){_0x30853f=_0x30853f-0x0;var _0x3c416d=_0x7937[_0x30853f];return _0x3c416d;};'use strict';var _=require(_0x7793('0x0'));var util=require(_0x7793('0x1'));var moment=require(_0x7793('0x2'));var BPromise=require(_0x7793('0x3'));var rs=require(_0x7793('0x4'));var fs=require('fs');var Redis=require(_0x7793('0x5'));var db=require(_0x7793('0x6'))['db'];var utils=require(_0x7793('0x7'));var logger=require(_0x7793('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7793('0x9'));var client=jayson[_0x7793('0xa')][_0x7793('0xb')]({'port':0x232a});config[_0x7793('0xc')]=_[_0x7793('0xd')](config[_0x7793('0xc')],{'host':_0x7793('0xe'),'port':0x18eb});var socket=require(_0x7793('0xf'))(new Redis(config['redis']));require('./chatMessage.socket')[_0x7793('0x10')](socket);function respondWithRpcPromise(_0x5e236d,_0x2801bd,_0x5451f7){return new BPromise(function(_0x4f74ea,_0x2bddf2){return client[_0x7793('0x11')](_0x5e236d,_0x5451f7)[_0x7793('0x12')](function(_0x2dc2d8){logger[_0x7793('0x13')]('ChatMessage,\x20%s,\x20%s',_0x2801bd,_0x7793('0x14'));logger[_0x7793('0x15')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x2801bd,'request\x20sent',JSON['stringify'](_0x2dc2d8));if(_0x2dc2d8['error']){if(_0x2dc2d8[_0x7793('0x16')]['code']===0x1f4){logger[_0x7793('0x16')](_0x7793('0x17'),_0x2801bd,_0x2dc2d8[_0x7793('0x16')]['message']);return _0x2bddf2(_0x2dc2d8[_0x7793('0x16')][_0x7793('0x18')]);}logger[_0x7793('0x16')](_0x7793('0x17'),_0x2801bd,_0x2dc2d8[_0x7793('0x16')]['message']);return _0x4f74ea(_0x2dc2d8[_0x7793('0x16')]['message']);}else{logger[_0x7793('0x13')](_0x7793('0x17'),_0x2801bd,_0x7793('0x14'));_0x4f74ea(_0x2dc2d8['result'][_0x7793('0x18')]);}})[_0x7793('0x19')](function(_0xbd5808){logger[_0x7793('0x16')](_0x7793('0x17'),_0x2801bd,_0xbd5808);_0x2bddf2(_0xbd5808);});});}exports[_0x7793('0x1a')]=function(_0x4ad07a){var _0x179f67=this;return new Promise(function(_0x115410,_0x1a856f){return db[_0x7793('0x1b')][_0x7793('0x1c')](_0x4ad07a[_0x7793('0x1d')],{'raw':_0x4ad07a[_0x7793('0x1e')]?_0x4ad07a[_0x7793('0x1e')][_0x7793('0x1f')]===undefined?!![]:![]:!![]})[_0x7793('0x12')](function(_0x2b4781){logger['info'](_0x7793('0x1a'),_0x4ad07a);logger[_0x7793('0x15')]('CreateChatMessage',_0x4ad07a,JSON[_0x7793('0x20')](_0x2b4781));_0x115410(_0x2b4781);})[_0x7793('0x19')](function(_0x45b3f7){logger['error']('CreateChatMessage',_0x45b3f7['message'],_0x4ad07a);_0x1a856f(_0x179f67[_0x7793('0x16')](0x1f4,_0x45b3f7['message']));});});}; \ No newline at end of file +var _0xc52c=['body','options','raw','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','defaults','register','then','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatMessage,\x20%s,\x20%s','message','CreateChatMessage','create'];(function(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0xc52c,0x144));var _0xcc52=function(_0x5e848d,_0x1dbd20){_0x5e848d=_0x5e848d-0x0;var _0x3785e5=_0xc52c[_0x5e848d];return _0x3785e5;};'use strict';var _=require(_0xcc52('0x0'));var util=require(_0xcc52('0x1'));var moment=require(_0xcc52('0x2'));var BPromise=require(_0xcc52('0x3'));var rs=require(_0xcc52('0x4'));var fs=require('fs');var Redis=require(_0xcc52('0x5'));var db=require(_0xcc52('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcc52('0x7'));var config=require(_0xcc52('0x8'));var jayson=require(_0xcc52('0x9'));var client=jayson['client'][_0xcc52('0xa')]({'port':0x232a});config[_0xcc52('0xb')]=_[_0xcc52('0xc')](config[_0xcc52('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatMessage.socket')[_0xcc52('0xd')](socket);function respondWithRpcPromise(_0x463999,_0x139154,_0xc44204){return new BPromise(function(_0x38bf62,_0x4242b7){return client['request'](_0x463999,_0xc44204)[_0xcc52('0xe')](function(_0x1af4dd){logger['info']('ChatMessage,\x20%s,\x20%s',_0x139154,'request\x20sent');logger[_0xcc52('0xf')](_0xcc52('0x10'),_0x139154,_0xcc52('0x11'),JSON[_0xcc52('0x12')](_0x1af4dd));if(_0x1af4dd[_0xcc52('0x13')]){if(_0x1af4dd['error']['code']===0x1f4){logger[_0xcc52('0x13')](_0xcc52('0x14'),_0x139154,_0x1af4dd[_0xcc52('0x13')][_0xcc52('0x15')]);return _0x4242b7(_0x1af4dd[_0xcc52('0x13')]['message']);}logger[_0xcc52('0x13')](_0xcc52('0x14'),_0x139154,_0x1af4dd['error'][_0xcc52('0x15')]);return _0x38bf62(_0x1af4dd[_0xcc52('0x13')]['message']);}else{logger['info'](_0xcc52('0x14'),_0x139154,_0xcc52('0x11'));_0x38bf62(_0x1af4dd['result'][_0xcc52('0x15')]);}})['catch'](function(_0x4015ed){logger[_0xcc52('0x13')](_0xcc52('0x14'),_0x139154,_0x4015ed);_0x4242b7(_0x4015ed);});});}exports[_0xcc52('0x16')]=function(_0x1072c6){var _0x40ea65=this;return new Promise(function(_0x1c3206,_0x2805e5){return db['ChatMessage'][_0xcc52('0x17')](_0x1072c6[_0xcc52('0x18')],{'raw':_0x1072c6[_0xcc52('0x19')]?_0x1072c6[_0xcc52('0x19')][_0xcc52('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x30c328){logger[_0xcc52('0x1b')](_0xcc52('0x16'),_0x1072c6);logger[_0xcc52('0xf')]('CreateChatMessage',_0x1072c6,JSON[_0xcc52('0x12')](_0x30c328));_0x1c3206(_0x30c328);})[_0xcc52('0x1c')](function(_0x425d76){logger['error']('CreateChatMessage',_0x425d76[_0xcc52('0x15')],_0x1072c6);_0x2805e5(_0x40ea65[_0xcc52('0x13')](0x1f4,_0x425d76[_0xcc52('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 0e1fea7..223743a 100644 --- a/server/api/chatMessage/chatMessage.socket.js +++ b/server/api/chatMessage/chatMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3435=['length','chatMessage:','./chatMessage.events','save','remove','update','emit','register'];(function(_0x2896e3,_0x23ed8e){var _0x5e551f=function(_0x2a28f4){while(--_0x2a28f4){_0x2896e3['push'](_0x2896e3['shift']());}};_0x5e551f(++_0x23ed8e);}(_0x3435,0xfa));var _0x5343=function(_0x35af23,_0x9190f6){_0x35af23=_0x35af23-0x0;var _0x340506=_0x3435[_0x35af23];return _0x340506;};'use strict';var ChatMessageEvents=require(_0x5343('0x0'));var events=[_0x5343('0x1'),_0x5343('0x2'),_0x5343('0x3')];function createListener(_0x14c416,_0x2a91fe){return function(_0x597aa9){_0x2a91fe[_0x5343('0x4')](_0x14c416,_0x597aa9);};}function removeListener(_0x3ae07e,_0x578a24){return function(){ChatMessageEvents['removeListener'](_0x3ae07e,_0x578a24);};}exports[_0x5343('0x5')]=function(_0x28f0f3){for(var _0x4d26b5=0x0,_0x544b29=events[_0x5343('0x6')];_0x4d26b5<_0x544b29;_0x4d26b5++){var _0x1e1911=events[_0x4d26b5];var _0x9ea9b6=createListener(_0x5343('0x7')+_0x1e1911,_0x28f0f3);ChatMessageEvents['on'](_0x1e1911,_0x9ea9b6);}}; \ No newline at end of file +var _0x42b0=['register','length','./chatMessage.events','save','update','removeListener'];(function(_0x254dcb,_0x515b3f){var _0x4be1d9=function(_0x4a517c){while(--_0x4a517c){_0x254dcb['push'](_0x254dcb['shift']());}};_0x4be1d9(++_0x515b3f);}(_0x42b0,0xbc));var _0x042b=function(_0x591781,_0x8e0ed2){_0x591781=_0x591781-0x0;var _0x315bd9=_0x42b0[_0x591781];return _0x315bd9;};'use strict';var ChatMessageEvents=require(_0x042b('0x0'));var events=[_0x042b('0x1'),'remove',_0x042b('0x2')];function createListener(_0x4bf494,_0x1d7aa3){return function(_0x5a7e27){_0x1d7aa3['emit'](_0x4bf494,_0x5a7e27);};}function removeListener(_0x401a0c,_0xd73d53){return function(){ChatMessageEvents[_0x042b('0x3')](_0x401a0c,_0xd73d53);};}exports[_0x042b('0x4')]=function(_0x135bc1){for(var _0x5d194a=0x0,_0x51c41c=events[_0x042b('0x5')];_0x5d194a<_0x51c41c;_0x5d194a++){var _0x1ec28f=events[_0x5d194a];var _0x49ab70=createListener('chatMessage:'+_0x1ec28f,_0x135bc1);ChatMessageEvents['on'](_0x1ec28f,_0x49ab70);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index cb45009..88c993e 100644 --- a/server/api/chatMessage/index.js +++ b/server/api/chatMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ce9=['chatmessage:create','create','/:id','/:id/accept','accept','put','/:id/reject','reject','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','show','post','tracked'];(function(_0x189e73,_0x452b70){var _0x21d62c=function(_0x5d4089){while(--_0x5d4089){_0x189e73['push'](_0x189e73['shift']());}};_0x21d62c(++_0x452b70);}(_0x2ce9,0x76));var _0x92ce=function(_0x2b5b44,_0x17189c){_0x2b5b44=_0x2b5b44-0x0;var _0x32cb66=_0x2ce9[_0x2b5b44];return _0x32cb66;};'use strict';var multer=require('multer');var util=require(_0x92ce('0x0'));var path=require(_0x92ce('0x1'));var timeout=require(_0x92ce('0x2'));var express=require(_0x92ce('0x3'));var router=express['Router']();var fs_extra=require(_0x92ce('0x4'));var auth=require(_0x92ce('0x5'));var interaction=require(_0x92ce('0x6'));var config=require(_0x92ce('0x7'));var controller=require(_0x92ce('0x8'));router[_0x92ce('0x9')]('/',auth[_0x92ce('0xa')](),controller[_0x92ce('0xb')]);router['get'](_0x92ce('0xc'),auth[_0x92ce('0xa')](),controller[_0x92ce('0xd')]);router[_0x92ce('0x9')]('/:id',auth[_0x92ce('0xa')](),controller[_0x92ce('0xe')]);router[_0x92ce('0xf')]('/',auth[_0x92ce('0xa')](),interaction[_0x92ce('0x10')]('chat',_0x92ce('0x11')),controller[_0x92ce('0x12')]);router['put'](_0x92ce('0x13'),controller['update']);router['put'](_0x92ce('0x14'),auth[_0x92ce('0xa')](),controller[_0x92ce('0x15')]);router[_0x92ce('0x16')](_0x92ce('0x17'),auth[_0x92ce('0xa')](),controller[_0x92ce('0x18')]);router['delete'](_0x92ce('0x13'),auth['isAuthenticated'](),controller[_0x92ce('0x19')]);module[_0x92ce('0x1a')]=router; \ No newline at end of file +var _0xf347=['/describe','describe','/:id','isAuthenticated','show','post','tracked','chat','chatmessage:create','update','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index'];(function(_0xc5cb1a,_0x1f590e){var _0x253df7=function(_0x3f1543){while(--_0x3f1543){_0xc5cb1a['push'](_0xc5cb1a['shift']());}};_0x253df7(++_0x1f590e);}(_0xf347,0x1b5));var _0x7f34=function(_0x5bc2a2,_0xec487e){_0x5bc2a2=_0x5bc2a2-0x0;var _0xe9294e=_0xf347[_0x5bc2a2];return _0xe9294e;};'use strict';var multer=require(_0x7f34('0x0'));var util=require(_0x7f34('0x1'));var path=require(_0x7f34('0x2'));var timeout=require(_0x7f34('0x3'));var express=require('express');var router=express[_0x7f34('0x4')]();var fs_extra=require(_0x7f34('0x5'));var auth=require(_0x7f34('0x6'));var interaction=require(_0x7f34('0x7'));var config=require(_0x7f34('0x8'));var controller=require('./chatMessage.controller');router[_0x7f34('0x9')]('/',auth['isAuthenticated'](),controller[_0x7f34('0xa')]);router[_0x7f34('0x9')](_0x7f34('0xb'),auth['isAuthenticated'](),controller[_0x7f34('0xc')]);router[_0x7f34('0x9')](_0x7f34('0xd'),auth[_0x7f34('0xe')](),controller[_0x7f34('0xf')]);router[_0x7f34('0x10')]('/',auth[_0x7f34('0xe')](),interaction[_0x7f34('0x11')](_0x7f34('0x12'),_0x7f34('0x13')),controller['create']);router['put']('/:id',controller[_0x7f34('0x14')]);router[_0x7f34('0x15')](_0x7f34('0x16'),auth[_0x7f34('0xe')](),controller[_0x7f34('0x17')]);router[_0x7f34('0x15')](_0x7f34('0x18'),auth[_0x7f34('0xe')](),controller[_0x7f34('0x19')]);router[_0x7f34('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0x7f34('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index aa5dba6..bac3849 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['medium','sequelize','TEXT'];(function(_0x463bc8,_0x135367){var _0x441a37=function(_0xbb4c5a){while(--_0xbb4c5a){_0x463bc8['push'](_0x463bc8['shift']());}};_0x441a37(++_0x135367);}(_0xb10b,0x12a));var _0xbb10=function(_0x768458,_0x3d0933){_0x768458=_0x768458-0x0;var _0x31385c=_0xb10b[_0x768458];return _0x31385c;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbb10('0x1')]('medium'),'allowNull':![]}}; \ No newline at end of file +var _0x5f66=['medium','TEXT','exports'];(function(_0x1e6f5c,_0x40cf58){var _0x29c2b8=function(_0x4cba9f){while(--_0x4cba9f){_0x1e6f5c['push'](_0x1e6f5c['shift']());}};_0x29c2b8(++_0x40cf58);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x5f66[_0x3e5086];return _0xfeb102;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 3c580bd..a9dfde9 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x38e863,_0x4d104f){var _0x59693c=function(_0xf1e9e2){while(--_0xf1e9e2){_0x38e863['push'](_0x38e863['shift']());}};_0x59693c(++_0x4d104f);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x7a54,0x106));var _0x47a5=function(_0x5481b1,_0x4e1ff5){_0x5481b1=_0x5481b1-0x0;var _0x2b43a7=_0x7a54[_0x5481b1];return _0x2b43a7;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index 8b0bc8e..1a36f3d 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x31b9=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners'];(function(_0x440ad4,_0x3c4f8f){var _0x16ce8c=function(_0x4fab87){while(--_0x4fab87){_0x440ad4['push'](_0x440ad4['shift']());}};_0x16ce8c(++_0x3c4f8f);}(_0x31b9,0x151));var _0x931b=function(_0x2190d6,_0x12d5a2){_0x2190d6=_0x2190d6-0x0;var _0x31514b=_0x31b9[_0x2190d6];return _0x31514b;};'use strict';var EventEmitter=require(_0x931b('0x0'));var ChatOfflineMessage=require(_0x931b('0x1'))['db'][_0x931b('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x931b('0x3')](0x0);var events={'afterCreate':_0x931b('0x4'),'afterUpdate':_0x931b('0x5'),'afterDestroy':_0x931b('0x6')};function emitEvent(_0x450c01){return function(_0x566a05,_0x4861ce,_0x20bd00){ChatOfflineMessageEvents[_0x931b('0x7')](_0x450c01+':'+_0x566a05['id'],_0x566a05);ChatOfflineMessageEvents[_0x931b('0x7')](_0x450c01,_0x566a05);_0x20bd00(null);};}for(var e in events){if(events[_0x931b('0x8')](e)){var event=events[e];ChatOfflineMessage[_0x931b('0x9')](e,emitEvent(event));}}module[_0x931b('0xa')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0xe8f9=['ChatOfflineMessage','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x5cd473,_0x267cdb){var _0x1ed98c=function(_0x555522){while(--_0x555522){_0x5cd473['push'](_0x5cd473['shift']());}};_0x1ed98c(++_0x267cdb);}(_0xe8f9,0x103));var _0x9e8f=function(_0x5955e1,_0x452f50){_0x5955e1=_0x5955e1-0x0;var _0x2ec7d1=_0xe8f9[_0x5955e1];return _0x2ec7d1;};'use strict';var EventEmitter=require(_0x9e8f('0x0'));var ChatOfflineMessage=require(_0x9e8f('0x1'))['db'][_0x9e8f('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9e8f('0x3'),'afterUpdate':_0x9e8f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x33c493){return function(_0x5768dc,_0x4fa050,_0x5d20fe){ChatOfflineMessageEvents[_0x9e8f('0x5')](_0x33c493+':'+_0x5768dc['id'],_0x5768dc);ChatOfflineMessageEvents[_0x9e8f('0x5')](_0x33c493,_0x5768dc);_0x5d20fe(null);};}for(var e in events){if(events[_0x9e8f('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x9e8f('0x7')](e,emitEvent(event));}}module[_0x9e8f('0x8')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 0724b17..3da8c76 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.model.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x31ea=['chat_offline_messages','utf8mb4','./chatOfflineMessage.attributes','define','ChatOfflineMessage'];(function(_0x4d9403,_0x33c5f0){var _0x5eef11=function(_0x50bb5c){while(--_0x50bb5c){_0x4d9403['push'](_0x4d9403['shift']());}};_0x5eef11(++_0x33c5f0);}(_0x31ea,0xb1));var _0xa31e=function(_0x330da3,_0x485558){_0x330da3=_0x330da3-0x0;var _0x2d2863=_0x31ea[_0x330da3];return _0x2d2863;};'use strict';var attributes=require(_0xa31e('0x0'));module['exports']=function(_0x287b20){return _0x287b20[_0xa31e('0x1')](_0xa31e('0x2'),attributes,{'tableName':_0xa31e('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa31e('0x4'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x55d0=['exports','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes'];(function(_0x43c2dd,_0xc6bcc9){var _0x432de4=function(_0x379e1a){while(--_0x379e1a){_0x43c2dd['push'](_0x43c2dd['shift']());}};_0x432de4(++_0xc6bcc9);}(_0x55d0,0xfb));var _0x055d=function(_0x11d684,_0x4d4123){_0x11d684=_0x11d684-0x0;var _0x78a301=_0x55d0[_0x11d684];return _0x78a301;};'use strict';var attributes=require(_0x055d('0x0'));module[_0x055d('0x1')]=function(_0x1083b9){return _0x1083b9['define'](_0x055d('0x2'),attributes,{'tableName':_0x055d('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x055d('0x4'),'collate':_0x055d('0x5')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index ffeaede..c802005 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb016=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x306d94,_0x46ed19){var _0x3e0a16=function(_0x4ea686){while(--_0x4ea686){_0x306d94['push'](_0x306d94['shift']());}};_0x3e0a16(++_0x46ed19);}(_0xb016,0x129));var _0x6b01=function(_0x410c11,_0x279873){_0x410c11=_0x410c11-0x0;var _0x3957a7=_0xb016[_0x410c11];return _0x3957a7;};'use strict';var _=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var moment=require(_0x6b01('0x2'));var BPromise=require(_0x6b01('0x3'));var rs=require(_0x6b01('0x4'));var fs=require('fs');var Redis=require(_0x6b01('0x5'));var db=require(_0x6b01('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6b01('0x7'))(_0x6b01('0x8'));var config=require(_0x6b01('0x9'));var jayson=require(_0x6b01('0xa'));var client=jayson[_0x6b01('0xb')][_0x6b01('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4069a6,_0x596508,_0x398a77){return new BPromise(function(_0x37875c,_0x5115b0){return client[_0x6b01('0xd')](_0x4069a6,_0x398a77)[_0x6b01('0xe')](function(_0x53db4f){logger['info'](_0x6b01('0xf'),_0x596508,_0x6b01('0x10'));logger['debug'](_0x6b01('0x11'),_0x596508,_0x6b01('0x10'),JSON[_0x6b01('0x12')](_0x53db4f));if(_0x53db4f[_0x6b01('0x13')]){if(_0x53db4f[_0x6b01('0x13')][_0x6b01('0x14')]===0x1f4){logger[_0x6b01('0x13')](_0x6b01('0xf'),_0x596508,_0x53db4f[_0x6b01('0x13')]['message']);return _0x5115b0(_0x53db4f['error'][_0x6b01('0x15')]);}logger[_0x6b01('0x13')](_0x6b01('0xf'),_0x596508,_0x53db4f[_0x6b01('0x13')][_0x6b01('0x15')]);return _0x37875c(_0x53db4f[_0x6b01('0x13')][_0x6b01('0x15')]);}else{logger['info'](_0x6b01('0xf'),_0x596508,_0x6b01('0x10'));_0x37875c(_0x53db4f[_0x6b01('0x16')][_0x6b01('0x15')]);}})['catch'](function(_0x33f51b){logger[_0x6b01('0x13')](_0x6b01('0xf'),_0x596508,_0x33f51b);_0x5115b0(_0x33f51b);});});} \ No newline at end of file +var _0x87e6=['stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s'];(function(_0x67f67d,_0x2a0d8a){var _0x2c1653=function(_0x28a2fe){while(--_0x28a2fe){_0x67f67d['push'](_0x67f67d['shift']());}};_0x2c1653(++_0x2a0d8a);}(_0x87e6,0x1a3));var _0x687e=function(_0xc191df,_0x4a58a2){_0xc191df=_0xc191df-0x0;var _0x383022=_0x87e6[_0xc191df];return _0x383022;};'use strict';var _=require(_0x687e('0x0'));var util=require(_0x687e('0x1'));var moment=require(_0x687e('0x2'));var BPromise=require(_0x687e('0x3'));var rs=require(_0x687e('0x4'));var fs=require('fs');var Redis=require(_0x687e('0x5'));var db=require(_0x687e('0x6'))['db'];var utils=require(_0x687e('0x7'));var logger=require(_0x687e('0x8'))(_0x687e('0x9'));var config=require('../../config/environment');var jayson=require(_0x687e('0xa'));var client=jayson[_0x687e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d5eec,_0xf19ed2,_0x2b50f0){return new BPromise(function(_0x2f074a,_0x7cf8cb){return client[_0x687e('0xc')](_0x4d5eec,_0x2b50f0)[_0x687e('0xd')](function(_0x61b4c3){logger[_0x687e('0xe')](_0x687e('0xf'),_0xf19ed2,_0x687e('0x10'));logger['debug'](_0x687e('0x11'),_0xf19ed2,_0x687e('0x10'),JSON[_0x687e('0x12')](_0x61b4c3));if(_0x61b4c3[_0x687e('0x13')]){if(_0x61b4c3['error'][_0x687e('0x14')]===0x1f4){logger[_0x687e('0x13')](_0x687e('0xf'),_0xf19ed2,_0x61b4c3[_0x687e('0x13')][_0x687e('0x15')]);return _0x7cf8cb(_0x61b4c3[_0x687e('0x13')]['message']);}logger['error'](_0x687e('0xf'),_0xf19ed2,_0x61b4c3['error']['message']);return _0x2f074a(_0x61b4c3[_0x687e('0x13')][_0x687e('0x15')]);}else{logger[_0x687e('0xe')](_0x687e('0xf'),_0xf19ed2,_0x687e('0x10'));_0x2f074a(_0x61b4c3['result'][_0x687e('0x15')]);}})[_0x687e('0x16')](function(_0x445942){logger[_0x687e('0x13')](_0x687e('0xf'),_0xf19ed2,_0x445942);_0x7cf8cb(_0x445942);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 1a7ee8a..edbb0d3 100644 --- a/server/api/chatOfflineMessage/index.js +++ b/server/api/chatOfflineMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcee9=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','/describe','isAuthenticated','/:id','show','post','create','put','destroy','multer','util','Router','fs-extra'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xcee9,0x183));var _0x9cee=function(_0x2cc1d5,_0x3446f5){_0x2cc1d5=_0x2cc1d5-0x0;var _0x2be77f=_0xcee9[_0x2cc1d5];return _0x2be77f;};'use strict';var multer=require(_0x9cee('0x0'));var util=require(_0x9cee('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9cee('0x2')]();var fs_extra=require(_0x9cee('0x3'));var auth=require(_0x9cee('0x4'));var interaction=require(_0x9cee('0x5'));var config=require(_0x9cee('0x6'));var controller=require(_0x9cee('0x7'));router[_0x9cee('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9cee('0x8')](_0x9cee('0x9'),auth[_0x9cee('0xa')](),controller['describe']);router[_0x9cee('0x8')](_0x9cee('0xb'),auth['isAuthenticated'](),controller[_0x9cee('0xc')]);router[_0x9cee('0xd')]('/',auth[_0x9cee('0xa')](),controller[_0x9cee('0xe')]);router[_0x9cee('0xf')](_0x9cee('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x9cee('0xb'),auth[_0x9cee('0xa')](),controller[_0x9cee('0x10')]);module['exports']=router; \ No newline at end of file +var _0x665d=['isAuthenticated','index','/describe','describe','/:id','create','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get'];(function(_0x305766,_0x4ed775){var _0x1d6353=function(_0x414f3c){while(--_0x414f3c){_0x305766['push'](_0x305766['shift']());}};_0x1d6353(++_0x4ed775);}(_0x665d,0xe4));var _0xd665=function(_0x1a1d9b,_0x5ea65a){_0x1a1d9b=_0x1a1d9b-0x0;var _0x1d7a59=_0x665d[_0x1a1d9b];return _0x1d7a59;};'use strict';var multer=require(_0xd665('0x0'));var util=require(_0xd665('0x1'));var path=require(_0xd665('0x2'));var timeout=require(_0xd665('0x3'));var express=require(_0xd665('0x4'));var router=express[_0xd665('0x5')]();var fs_extra=require(_0xd665('0x6'));var auth=require(_0xd665('0x7'));var interaction=require(_0xd665('0x8'));var config=require(_0xd665('0x9'));var controller=require(_0xd665('0xa'));router[_0xd665('0xb')]('/',auth[_0xd665('0xc')](),controller[_0xd665('0xd')]);router[_0xd665('0xb')](_0xd665('0xe'),auth[_0xd665('0xc')](),controller[_0xd665('0xf')]);router[_0xd665('0xb')](_0xd665('0x10'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xd665('0xc')](),controller[_0xd665('0x11')]);router['put'](_0xd665('0x10'),auth[_0xd665('0xc')](),controller['update']);router[_0xd665('0x12')](_0xd665('0x10'),auth[_0xd665('0xc')](),controller['destroy']);module[_0xd665('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 66b9135..0434691 100644 --- a/server/api/chatProactiveAction/chatProactiveAction.attributes.js +++ b/server/api/chatProactiveAction/chatProactiveAction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x07b5=['ENUM','mouseOver','timeout','INTEGER','sequelize','exports','STRING'];(function(_0x4e27ed,_0x49b6cf){var _0x177582=function(_0x415eaf){while(--_0x415eaf){_0x4e27ed['push'](_0x4e27ed['shift']());}};_0x177582(++_0x49b6cf);}(_0x07b5,0x170));var _0x507b=function(_0xe2c95e,_0x3e6545){_0xe2c95e=_0xe2c95e-0x0;var _0x42ce6f=_0x07b5[_0xe2c95e];return _0x42ce6f;};'use strict';var Sequelize=require(_0x507b('0x0'));module[_0x507b('0x1')]={'name':{'type':Sequelize[_0x507b('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x507b('0x3')](_0x507b('0x4'),_0x507b('0x5')),'defaultValue':_0x507b('0x4')},'selector':{'type':Sequelize[_0x507b('0x2')]},'timeout':{'type':Sequelize[_0x507b('0x6')]}}; \ No newline at end of file +var _0x5ad6=['mouseOver','STRING','INTEGER','exports','timeout'];(function(_0x5abcb4,_0x4d9c06){var _0x428f91=function(_0x31a3af){while(--_0x31a3af){_0x5abcb4['push'](_0x5abcb4['shift']());}};_0x428f91(++_0x4d9c06);}(_0x5ad6,0x71));var _0x65ad=function(_0x36f284,_0x24cbd1){_0x36f284=_0x36f284-0x0;var _0x4ea099=_0x5ad6[_0x36f284];return _0x4ea099;};'use strict';var Sequelize=require('sequelize');module[_0x65ad('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver',_0x65ad('0x1')),'defaultValue':_0x65ad('0x2')},'selector':{'type':Sequelize[_0x65ad('0x3')]},'timeout':{'type':Sequelize[_0x65ad('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 90b74f0..d967324 100644 --- a/server/api/chatProactiveAction/chatProactiveAction.controller.js +++ b/server/api/chatProactiveAction/chatProactiveAction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7d9f=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','apply','reject','update','then','error','stack','name','show','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','fields','attributes','length','includeAll','include','merge','find','catch','create','body'];(function(_0x5d0a3f,_0x147089){var _0x57add7=function(_0x2d8c15){while(--_0x2d8c15){_0x5d0a3f['push'](_0x5d0a3f['shift']());}};_0x57add7(++_0x147089);}(_0x7d9f,0x15c));var _0xf7d9=function(_0x3cc8cb,_0x31f8fe){_0x3cc8cb=_0x3cc8cb-0x0;var _0x427615=_0x7d9f[_0x3cc8cb];return _0x427615;};'use strict';var emlformat=require(_0xf7d9('0x0'));var rimraf=require(_0xf7d9('0x1'));var zipdir=require(_0xf7d9('0x2'));var jsonpatch=require(_0xf7d9('0x3'));var rp=require(_0xf7d9('0x4'));var moment=require('moment');var BPromise=require(_0xf7d9('0x5'));var Mustache=require(_0xf7d9('0x6'));var util=require(_0xf7d9('0x7'));var path=require(_0xf7d9('0x8'));var sox=require(_0xf7d9('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf7d9('0xa'));var _=require(_0xf7d9('0xb'));var squel=require('squel');var crypto=require(_0xf7d9('0xc'));var jsforce=require(_0xf7d9('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf7d9('0xe'));var querystring=require('querystring');var Papa=require(_0xf7d9('0xf'));var Redis=require(_0xf7d9('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf7d9('0x11'));var hardwareService=require(_0xf7d9('0x12'));var logger=require(_0xf7d9('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xf7d9('0x14'));var licenseUtil=require(_0xf7d9('0x15'));var db=require(_0xf7d9('0x16'))['db'];function respondWithStatusCode(_0x35e156,_0x594dfe){_0x594dfe=_0x594dfe||0xcc;return function(_0x16e680){if(_0x16e680){return _0x35e156[_0xf7d9('0x17')](_0x594dfe);}return _0x35e156[_0xf7d9('0x18')](_0x594dfe)[_0xf7d9('0x19')]();};}function respondWithResult(_0x49f766,_0x189c82){_0x189c82=_0x189c82||0xc8;return function(_0x359843){if(_0x359843){return _0x49f766[_0xf7d9('0x18')](_0x189c82)[_0xf7d9('0x1a')](_0x359843);}};}function respondWithFilteredResult(_0x5d3029,_0x405ed4){return function(_0x22ed4a){if(_0x22ed4a){var _0x341e27=typeof _0x405ed4['offset']==='undefined'&&typeof _0x405ed4[_0xf7d9('0x1b')]===_0xf7d9('0x1c');var _0xe29103=_0x22ed4a['count'];var _0x44ebd3=_0x341e27?0x0:_0x405ed4[_0xf7d9('0x1d')];var _0x5eb7c9=_0x341e27?_0x22ed4a[_0xf7d9('0x1e')]:_0x405ed4['offset']+_0x405ed4[_0xf7d9('0x1b')];var _0x1bbc77;if(_0x5eb7c9>=_0xe29103){_0x5eb7c9=_0xe29103;_0x1bbc77=0xc8;}else{_0x1bbc77=0xce;}_0x5d3029['status'](_0x1bbc77);return _0x5d3029[_0xf7d9('0x1f')](_0xf7d9('0x20'),_0x44ebd3+'-'+_0x5eb7c9+'/'+_0xe29103)[_0xf7d9('0x1a')](_0x22ed4a);}return null;};}function patchUpdates(_0x316d54){return function(_0x165160){try{jsonpatch[_0xf7d9('0x21')](_0x165160,_0x316d54,!![]);}catch(_0xd04b9d){return BPromise[_0xf7d9('0x22')](_0xd04b9d);}return _0x165160['save']();};}function saveUpdates(_0x5e96df,_0x36b974){return function(_0x4cfe93){if(_0x4cfe93){return _0x4cfe93[_0xf7d9('0x23')](_0x5e96df)[_0xf7d9('0x24')](function(_0x574b12){return _0x574b12;});}return null;};}function removeEntity(_0x8d8e48,_0x27ba8c){return function(_0x514ffa){if(_0x514ffa){return _0x514ffa['destroy']()[_0xf7d9('0x24')](function(){_0x8d8e48[_0xf7d9('0x18')](0xcc)[_0xf7d9('0x19')]();});}};}function handleEntityNotFound(_0x595556,_0x3c0b91){return function(_0x496ab7){if(!_0x496ab7){_0x595556[_0xf7d9('0x17')](0x194);}return _0x496ab7;};}function handleError(_0x3b3ea5,_0x144ae2){_0x144ae2=_0x144ae2||0x1f4;return function(_0x5b1ea5){logger[_0xf7d9('0x25')](_0x5b1ea5[_0xf7d9('0x26')]);if(_0x5b1ea5[_0xf7d9('0x27')]){delete _0x5b1ea5[_0xf7d9('0x27')];}_0x3b3ea5[_0xf7d9('0x18')](_0x144ae2)['send'](_0x5b1ea5);};}exports[_0xf7d9('0x28')]=function(_0x3847ff,_0x2b5f17){var _0x2c04c3={'raw':!![],'where':{'id':_0x3847ff[_0xf7d9('0x29')]['id']}},_0x508b00={};_0x508b00[_0xf7d9('0x2a')]=_[_0xf7d9('0x2b')](db[_0xf7d9('0x2c')][_0xf7d9('0x2d')]);_0x508b00[_0xf7d9('0x2e')]=_['keys'](_0x3847ff['query']);_0x508b00['filters']=_[_0xf7d9('0x2f')](_0x508b00['model'],_0x508b00[_0xf7d9('0x2e')]);_0x2c04c3['attributes']=_[_0xf7d9('0x2f')](_0x508b00['model'],qs['fields'](_0x3847ff['query'][_0xf7d9('0x30')]));_0x2c04c3['attributes']=_0x2c04c3[_0xf7d9('0x31')][_0xf7d9('0x32')]?_0x2c04c3[_0xf7d9('0x31')]:_0x508b00[_0xf7d9('0x2a')];if(_0x3847ff[_0xf7d9('0x2e')][_0xf7d9('0x33')]){_0x2c04c3[_0xf7d9('0x34')]=[{'all':!![]}];}_0x2c04c3=_[_0xf7d9('0x35')]({},_0x2c04c3,_0x3847ff['options']);return db[_0xf7d9('0x2c')][_0xf7d9('0x36')](_0x2c04c3)['then'](handleEntityNotFound(_0x2b5f17,null))['then'](respondWithResult(_0x2b5f17,null))[_0xf7d9('0x37')](handleError(_0x2b5f17,null));};exports[_0xf7d9('0x38')]=function(_0x4110ce,_0x5301a8){return db[_0xf7d9('0x2c')][_0xf7d9('0x38')](_0x4110ce[_0xf7d9('0x39')],{})[_0xf7d9('0x24')](respondWithResult(_0x5301a8,0xc9))[_0xf7d9('0x37')](handleError(_0x5301a8,null));};exports[_0xf7d9('0x23')]=function(_0x427963,_0x1280fa){if(_0x427963[_0xf7d9('0x39')]['id']){delete _0x427963[_0xf7d9('0x39')]['id'];}return db[_0xf7d9('0x2c')]['find']({'where':{'id':_0x427963[_0xf7d9('0x29')]['id']}})['then'](handleEntityNotFound(_0x1280fa,null))[_0xf7d9('0x24')](saveUpdates(_0x427963[_0xf7d9('0x39')],null))[_0xf7d9('0x24')](respondWithResult(_0x1280fa,null))[_0xf7d9('0x37')](handleError(_0x1280fa,null));};exports['destroy']=function(_0x55b49d,_0x2173e2){return db['ChatProactiveAction'][_0xf7d9('0x36')]({'where':{'id':_0x55b49d[_0xf7d9('0x29')]['id']}})[_0xf7d9('0x24')](handleEntityNotFound(_0x2173e2,null))[_0xf7d9('0x24')](removeEntity(_0x2173e2,null))['catch'](handleError(_0x2173e2,null));}; \ No newline at end of file +var _0xac31=['filters','intersection','attributes','fields','length','include','merge','options','then','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query'];(function(_0x3c3e72,_0x3e1858){var _0x48a7e5=function(_0x3d1c72){while(--_0x3d1c72){_0x3c3e72['push'](_0x3c3e72['shift']());}};_0x48a7e5(++_0x3e1858);}(_0xac31,0xca));var _0x1ac3=function(_0x484a13,_0x49bbb4){_0x484a13=_0x484a13-0x0;var _0x5ad030=_0xac31[_0x484a13];return _0x5ad030;};'use strict';var emlformat=require(_0x1ac3('0x0'));var rimraf=require(_0x1ac3('0x1'));var zipdir=require(_0x1ac3('0x2'));var jsonpatch=require(_0x1ac3('0x3'));var rp=require(_0x1ac3('0x4'));var moment=require(_0x1ac3('0x5'));var BPromise=require(_0x1ac3('0x6'));var Mustache=require('mustache');var util=require(_0x1ac3('0x7'));var path=require(_0x1ac3('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1ac3('0x9'));var fs=require('fs');var fs_extra=require(_0x1ac3('0xa'));var _=require(_0x1ac3('0xb'));var squel=require(_0x1ac3('0xc'));var crypto=require(_0x1ac3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1ac3('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1ac3('0xf'));var Papa=require(_0x1ac3('0x10'));var Redis=require(_0x1ac3('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1ac3('0x12'));var as=require(_0x1ac3('0x13'));var hardwareService=require(_0x1ac3('0x14'));var logger=require(_0x1ac3('0x15'))(_0x1ac3('0x16'));var utils=require(_0x1ac3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x1ac3('0x18'));var db=require(_0x1ac3('0x19'))['db'];function respondWithStatusCode(_0x2eeabf,_0x2338b9){_0x2338b9=_0x2338b9||0xcc;return function(_0x50d3b6){if(_0x50d3b6){return _0x2eeabf[_0x1ac3('0x1a')](_0x2338b9);}return _0x2eeabf[_0x1ac3('0x1b')](_0x2338b9)[_0x1ac3('0x1c')]();};}function respondWithResult(_0x2def9f,_0x53cc35){_0x53cc35=_0x53cc35||0xc8;return function(_0x24bb5e){if(_0x24bb5e){return _0x2def9f[_0x1ac3('0x1b')](_0x53cc35)['json'](_0x24bb5e);}};}function respondWithFilteredResult(_0x29a7b3,_0x1f9641){return function(_0x38b52a){if(_0x38b52a){var _0x51f1e4=typeof _0x1f9641[_0x1ac3('0x1d')]===_0x1ac3('0x1e')&&typeof _0x1f9641[_0x1ac3('0x1f')]==='undefined';var _0x195683=_0x38b52a['count'];var _0x291616=_0x51f1e4?0x0:_0x1f9641[_0x1ac3('0x1d')];var _0x20091d=_0x51f1e4?_0x38b52a[_0x1ac3('0x20')]:_0x1f9641[_0x1ac3('0x1d')]+_0x1f9641['limit'];var _0x136e73;if(_0x20091d>=_0x195683){_0x20091d=_0x195683;_0x136e73=0xc8;}else{_0x136e73=0xce;}_0x29a7b3[_0x1ac3('0x1b')](_0x136e73);return _0x29a7b3[_0x1ac3('0x21')](_0x1ac3('0x22'),_0x291616+'-'+_0x20091d+'/'+_0x195683)['json'](_0x38b52a);}return null;};}function patchUpdates(_0x48d18a){return function(_0x2879d8){try{jsonpatch[_0x1ac3('0x23')](_0x2879d8,_0x48d18a,!![]);}catch(_0x14070b){return BPromise[_0x1ac3('0x24')](_0x14070b);}return _0x2879d8[_0x1ac3('0x25')]();};}function saveUpdates(_0x319988,_0x23b767){return function(_0x10912a){if(_0x10912a){return _0x10912a[_0x1ac3('0x26')](_0x319988)['then'](function(_0x1e277f){return _0x1e277f;});}return null;};}function removeEntity(_0x231b7f,_0x4b19f2){return function(_0x2b5182){if(_0x2b5182){return _0x2b5182[_0x1ac3('0x27')]()['then'](function(){_0x231b7f[_0x1ac3('0x1b')](0xcc)[_0x1ac3('0x1c')]();});}};}function handleEntityNotFound(_0x145486,_0x2dfdb7){return function(_0x10db3d){if(!_0x10db3d){_0x145486['sendStatus'](0x194);}return _0x10db3d;};}function handleError(_0x5a2ab2,_0x503a64){_0x503a64=_0x503a64||0x1f4;return function(_0x528807){logger['error'](_0x528807[_0x1ac3('0x28')]);if(_0x528807['name']){delete _0x528807[_0x1ac3('0x29')];}_0x5a2ab2[_0x1ac3('0x1b')](_0x503a64)[_0x1ac3('0x2a')](_0x528807);};}exports[_0x1ac3('0x2b')]=function(_0x4b3d3c,_0x61441d){var _0x541da0={'raw':!![],'where':{'id':_0x4b3d3c[_0x1ac3('0x2c')]['id']}},_0x2ddd73={};_0x2ddd73[_0x1ac3('0x2d')]=_[_0x1ac3('0x2e')](db[_0x1ac3('0x2f')][_0x1ac3('0x30')]);_0x2ddd73[_0x1ac3('0x31')]=_['keys'](_0x4b3d3c[_0x1ac3('0x31')]);_0x2ddd73[_0x1ac3('0x32')]=_[_0x1ac3('0x33')](_0x2ddd73[_0x1ac3('0x2d')],_0x2ddd73['query']);_0x541da0[_0x1ac3('0x34')]=_[_0x1ac3('0x33')](_0x2ddd73[_0x1ac3('0x2d')],qs[_0x1ac3('0x35')](_0x4b3d3c[_0x1ac3('0x31')]['fields']));_0x541da0[_0x1ac3('0x34')]=_0x541da0[_0x1ac3('0x34')][_0x1ac3('0x36')]?_0x541da0[_0x1ac3('0x34')]:_0x2ddd73[_0x1ac3('0x2d')];if(_0x4b3d3c[_0x1ac3('0x31')]['includeAll']){_0x541da0[_0x1ac3('0x37')]=[{'all':!![]}];}_0x541da0=_[_0x1ac3('0x38')]({},_0x541da0,_0x4b3d3c[_0x1ac3('0x39')]);return db[_0x1ac3('0x2f')]['find'](_0x541da0)[_0x1ac3('0x3a')](handleEntityNotFound(_0x61441d,null))[_0x1ac3('0x3a')](respondWithResult(_0x61441d,null))[_0x1ac3('0x3b')](handleError(_0x61441d,null));};exports[_0x1ac3('0x3c')]=function(_0x31a932,_0x170bb8){return db[_0x1ac3('0x2f')][_0x1ac3('0x3c')](_0x31a932[_0x1ac3('0x3d')],{})['then'](respondWithResult(_0x170bb8,0xc9))[_0x1ac3('0x3b')](handleError(_0x170bb8,null));};exports[_0x1ac3('0x26')]=function(_0x4e4a20,_0xc6b21f){if(_0x4e4a20[_0x1ac3('0x3d')]['id']){delete _0x4e4a20[_0x1ac3('0x3d')]['id'];}return db[_0x1ac3('0x2f')][_0x1ac3('0x3e')]({'where':{'id':_0x4e4a20[_0x1ac3('0x2c')]['id']}})[_0x1ac3('0x3a')](handleEntityNotFound(_0xc6b21f,null))[_0x1ac3('0x3a')](saveUpdates(_0x4e4a20['body'],null))[_0x1ac3('0x3a')](respondWithResult(_0xc6b21f,null))['catch'](handleError(_0xc6b21f,null));};exports[_0x1ac3('0x27')]=function(_0x7bba2a,_0x2d449e){return db[_0x1ac3('0x2f')][_0x1ac3('0x3e')]({'where':{'id':_0x7bba2a[_0x1ac3('0x2c')]['id']}})['then'](handleEntityNotFound(_0x2d449e,null))[_0x1ac3('0x3a')](removeEntity(_0x2d449e,null))[_0x1ac3('0x3b')](handleError(_0x2d449e,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index ce384e3..b862974 100644 --- a/server/api/chatProactiveAction/chatProactiveAction.model.js +++ b/server/api/chatProactiveAction/chatProactiveAction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x603e=['rimraf','exports','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3dee92,_0x55e1eb){var _0x44d36e=function(_0x34de1a){while(--_0x34de1a){_0x3dee92['push'](_0x3dee92['shift']());}};_0x44d36e(++_0x55e1eb);}(_0x603e,0x130));var _0xe603=function(_0x20714a,_0x7de591){_0x20714a=_0x20714a-0x0;var _0x15e877=_0x603e[_0x20714a];return _0x15e877;};'use strict';var _=require(_0xe603('0x0'));var util=require(_0xe603('0x1'));var logger=require(_0xe603('0x2'))(_0xe603('0x3'));var moment=require(_0xe603('0x4'));var BPromise=require(_0xe603('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe603('0x6'));var config=require('../../config/environment');var attributes=require('./chatProactiveAction.attributes');module[_0xe603('0x7')]=function(_0x49b951,_0x381a83){return _0x49b951['define'](_0xe603('0x8'),attributes,{'tableName':_0xe603('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6e26=['util','../../config/logger','api','moment','request-promise','path','../../config/environment','./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions','lodash'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x6e26,0x107));var _0x66e2=function(_0x40089f,_0x51b8ef){_0x40089f=_0x40089f-0x0;var _0x2a6b80=_0x6e26[_0x40089f];return _0x2a6b80;};'use strict';var _=require(_0x66e2('0x0'));var util=require(_0x66e2('0x1'));var logger=require(_0x66e2('0x2'))(_0x66e2('0x3'));var moment=require(_0x66e2('0x4'));var BPromise=require('bluebird');var rp=require(_0x66e2('0x5'));var fs=require('fs');var path=require(_0x66e2('0x6'));var rimraf=require('rimraf');var config=require(_0x66e2('0x7'));var attributes=require(_0x66e2('0x8'));module['exports']=function(_0x599c96,_0x1e1524){return _0x599c96[_0x66e2('0x9')](_0x66e2('0xa'),attributes,{'tableName':_0x66e2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index 16ebc79..0b572de 100644 --- a/server/api/chatProactiveAction/chatProactiveAction.rpc.js +++ b/server/api/chatProactiveAction/chatProactiveAction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xecab=['jayson/promise','client','http','request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0xecab,0x77));var _0xbeca=function(_0x1aa1aa,_0x33b9e8){_0x1aa1aa=_0x1aa1aa-0x0;var _0xd4b78d=_0xecab[_0x1aa1aa];return _0xd4b78d;};'use strict';var _=require(_0xbeca('0x0'));var util=require('util');var moment=require(_0xbeca('0x1'));var BPromise=require(_0xbeca('0x2'));var rs=require(_0xbeca('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbeca('0x4'));var logger=require(_0xbeca('0x5'))(_0xbeca('0x6'));var config=require('../../config/environment');var jayson=require(_0xbeca('0x7'));var client=jayson[_0xbeca('0x8')][_0xbeca('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e8771,_0x45e188,_0x204c05){return new BPromise(function(_0x313b71,_0x4f82df){return client[_0xbeca('0xa')](_0x4e8771,_0x204c05)[_0xbeca('0xb')](function(_0x19d9f3){logger['info'](_0xbeca('0xc'),_0x45e188,_0xbeca('0xd'));logger['debug'](_0xbeca('0xe'),_0x45e188,_0xbeca('0xd'),JSON['stringify'](_0x19d9f3));if(_0x19d9f3[_0xbeca('0xf')]){if(_0x19d9f3[_0xbeca('0xf')][_0xbeca('0x10')]===0x1f4){logger[_0xbeca('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x45e188,_0x19d9f3[_0xbeca('0xf')]['message']);return _0x4f82df(_0x19d9f3[_0xbeca('0xf')][_0xbeca('0x11')]);}logger['error'](_0xbeca('0xc'),_0x45e188,_0x19d9f3[_0xbeca('0xf')]['message']);return _0x313b71(_0x19d9f3[_0xbeca('0xf')][_0xbeca('0x11')]);}else{logger[_0xbeca('0x12')](_0xbeca('0xc'),_0x45e188,_0xbeca('0xd'));_0x313b71(_0x19d9f3[_0xbeca('0x13')][_0xbeca('0x11')]);}})[_0xbeca('0x14')](function(_0x187f95){logger[_0xbeca('0xf')](_0xbeca('0xc'),_0x45e188,_0x187f95);_0x4f82df(_0x187f95);});});} \ No newline at end of file +var _0x65a8=['client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment'];(function(_0x8bc1c6,_0x37bbc5){var _0xc63cfb=function(_0x3e868a){while(--_0x3e868a){_0x8bc1c6['push'](_0x8bc1c6['shift']());}};_0xc63cfb(++_0x37bbc5);}(_0x65a8,0x19c));var _0x865a=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x65a8[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x865a('0x0'));var util=require(_0x865a('0x1'));var moment=require(_0x865a('0x2'));var BPromise=require(_0x865a('0x3'));var rs=require(_0x865a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x865a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x865a('0x6'));var config=require(_0x865a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x865a('0x8')][_0x865a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ae3f4,_0x3cca80,_0x3c3151){return new BPromise(function(_0x40edbe,_0x1e21fe){return client[_0x865a('0xa')](_0x5ae3f4,_0x3c3151)[_0x865a('0xb')](function(_0x4f98c5){logger[_0x865a('0xc')](_0x865a('0xd'),_0x3cca80,'request\x20sent');logger[_0x865a('0xe')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x3cca80,_0x865a('0xf'),JSON['stringify'](_0x4f98c5));if(_0x4f98c5[_0x865a('0x10')]){if(_0x4f98c5[_0x865a('0x10')][_0x865a('0x11')]===0x1f4){logger[_0x865a('0x10')](_0x865a('0xd'),_0x3cca80,_0x4f98c5[_0x865a('0x10')][_0x865a('0x12')]);return _0x1e21fe(_0x4f98c5[_0x865a('0x10')][_0x865a('0x12')]);}logger[_0x865a('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x3cca80,_0x4f98c5['error'][_0x865a('0x12')]);return _0x40edbe(_0x4f98c5[_0x865a('0x10')]['message']);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x3cca80,_0x865a('0xf'));_0x40edbe(_0x4f98c5[_0x865a('0x13')][_0x865a('0x12')]);}})[_0x865a('0x14')](function(_0x183e60){logger[_0x865a('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x3cca80,_0x183e60);_0x1e21fe(_0x183e60);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 1a3ab02..c0ece2c 100644 --- a/server/api/chatProactiveAction/index.js +++ b/server/api/chatProactiveAction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb138=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','post','create','destroy','exports','multer','util','path'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0xb138,0x1dd));var _0x8b13=function(_0x162810,_0x4dd5aa){_0x162810=_0x162810-0x0;var _0x503762=_0xb138[_0x162810];return _0x503762;};'use strict';var multer=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var path=require(_0x8b13('0x2'));var timeout=require(_0x8b13('0x3'));var express=require(_0x8b13('0x4'));var router=express[_0x8b13('0x5')]();var fs_extra=require(_0x8b13('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8b13('0x7'));var config=require(_0x8b13('0x8'));var controller=require(_0x8b13('0x9'));router['get'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller['show']);router[_0x8b13('0xc')]('/',auth[_0x8b13('0xb')](),controller[_0x8b13('0xd')]);router['put'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller['update']);router['delete'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller[_0x8b13('0xe')]);module[_0x8b13('0xf')]=router; \ No newline at end of file +var _0xb138=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','post','create','destroy','exports','multer','util','path'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0xb138,0x1dd));var _0x8b13=function(_0x484b61,_0x55f992){_0x484b61=_0x484b61-0x0;var _0x44a4d4=_0xb138[_0x484b61];return _0x44a4d4;};'use strict';var multer=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var path=require(_0x8b13('0x2'));var timeout=require(_0x8b13('0x3'));var express=require(_0x8b13('0x4'));var router=express[_0x8b13('0x5')]();var fs_extra=require(_0x8b13('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8b13('0x7'));var config=require(_0x8b13('0x8'));var controller=require(_0x8b13('0x9'));router['get'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller['show']);router[_0x8b13('0xc')]('/',auth[_0x8b13('0xb')](),controller[_0x8b13('0xd')]);router['put'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller['update']);router['delete'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller[_0x8b13('0xe')]);module[_0x8b13('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 544bcf5..890810b 100644 --- a/server/api/chatQueue/chatQueue.attributes.js +++ b/server/api/chatQueue/chatQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc02d=['exports','STRING','roundrobin'];(function(_0x322515,_0x4e6c82){var _0x55e219=function(_0x4c9cbc){while(--_0x4c9cbc){_0x322515['push'](_0x322515['shift']());}};_0x55e219(++_0x4e6c82);}(_0xc02d,0x7e));var _0xdc02=function(_0x17b0ab,_0x24651d){_0x17b0ab=_0x17b0ab-0x0;var _0x5b8268=_0xc02d[_0x17b0ab];return _0x5b8268;};'use strict';var Sequelize=require('sequelize');module[_0xdc02('0x0')]={'name':{'type':Sequelize[_0xdc02('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xdc02('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall',_0xdc02('0x2'))}}; \ No newline at end of file +var _0x79e7=['ENUM','rrmemory','STRING','INTEGER'];(function(_0x373169,_0x554e5f){var _0x4468e2=function(_0x983ca8){while(--_0x983ca8){_0x373169['push'](_0x373169['shift']());}};_0x4468e2(++_0x554e5f);}(_0x79e7,0x72));var _0x779e=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x79e7[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x779e('0x0')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x779e('0x0')]},'timeout':{'type':Sequelize[_0x779e('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x779e('0x2')](_0x779e('0x3'),'beepall','roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index dd47346..8f7b948 100644 --- a/server/api/chatQueue/chatQueue.controller.js +++ b/server/api/chatQueue/chatQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcbf9=['ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','sequelize','QueryTypes','SELECT','TeamId','includes','all','compact','userChatQueue:remove','addAgents','omit','removeAgents','getAgents','nolimit','util','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','ChatQueues','UserProfileResource','error','stack','name','send','index','ChatQueue','fieldName','key','where','include','findAll','catch','model','keys','query','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserChatQueue','rawAttributes','filters','hasOwnProperty','order','sort','pick','ChatQueueId','filter','map','User','findAndCountAll','UserId','agent','chatPause','updatedAt','rows','format','SIP','getTeams','Team','ids','Agents','online','flatMap','transaction','addTeams','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId'];(function(_0xbb6fb5,_0x4db9fb){var _0x2f9501=function(_0x4a9b92){while(--_0x4a9b92){_0xbb6fb5['push'](_0xbb6fb5['shift']());}};_0x2f9501(++_0x4db9fb);}(_0xcbf9,0x16d));var _0x9cbf=function(_0x4e255e,_0x1681c5){_0x4e255e=_0x4e255e-0x0;var _0x88c0aa=_0xcbf9[_0x4e255e];return _0x88c0aa;};'use strict';var BPromise=require('bluebird');var util=require(_0x9cbf('0x0'));var _=require('lodash');var squel=require('squel');var Redis=require(_0x9cbf('0x1'));var qs=require(_0x9cbf('0x2'));var logger=require('../../config/logger')(_0x9cbf('0x3'));var config=require(_0x9cbf('0x4'));var db=require(_0x9cbf('0x5'))['db'];config[_0x9cbf('0x6')]=_['defaults'](config['redis'],{'host':_0x9cbf('0x7'),'port':0x18eb});var socket=require(_0x9cbf('0x8'))(new Redis(config[_0x9cbf('0x6')]));require(_0x9cbf('0x9'))['register'](socket);function respondWithStatusCode(_0x1322ab,_0x115d02){_0x115d02=_0x115d02||0xcc;return function(_0x4cf4df){if(_0x4cf4df){return _0x1322ab[_0x9cbf('0xa')](_0x115d02);}return _0x1322ab[_0x9cbf('0xb')](_0x115d02)[_0x9cbf('0xc')]();};}function respondWithResult(_0x406029,_0x4ddc7c){_0x4ddc7c=_0x4ddc7c||0xc8;return function(_0x2f6a1b){if(_0x2f6a1b){return _0x406029['status'](_0x4ddc7c)[_0x9cbf('0xd')](_0x2f6a1b);}};}function respondWithFilteredResult(_0x5b3bca,_0x4788ae){return function(_0x392ec3){if(_0x392ec3){var _0x5994a1=typeof _0x4788ae[_0x9cbf('0xe')]===_0x9cbf('0xf')&&typeof _0x4788ae[_0x9cbf('0x10')]==='undefined';var _0x262b66=_0x392ec3[_0x9cbf('0x11')];var _0x1d5c60=_0x5994a1?0x0:_0x4788ae['offset'];var _0xa0f05b=_0x5994a1?_0x392ec3[_0x9cbf('0x11')]:_0x4788ae[_0x9cbf('0xe')]+_0x4788ae[_0x9cbf('0x10')];var _0x5ac2fd;if(_0xa0f05b>=_0x262b66){_0xa0f05b=_0x262b66;_0x5ac2fd=0xc8;}else{_0x5ac2fd=0xce;}_0x5b3bca[_0x9cbf('0xb')](_0x5ac2fd);return _0x5b3bca[_0x9cbf('0x12')](_0x9cbf('0x13'),_0x1d5c60+'-'+_0xa0f05b+'/'+_0x262b66)[_0x9cbf('0xd')](_0x392ec3);}return null;};}function saveUpdates(_0xde2291){return function(_0x250863){if(_0x250863){return _0x250863[_0x9cbf('0x14')](_0xde2291)[_0x9cbf('0x15')](function(_0x2fde8b){return _0x2fde8b;});}return null;};}function removeEntity(_0x3f72a4){return function(_0x1e048b){if(_0x1e048b){return _0x1e048b[_0x9cbf('0x16')]()[_0x9cbf('0x15')](function(){var _0x4e5b58=_0x1e048b[_0x9cbf('0x17')]({'plain':!![]});var _0x5166c7=_0x9cbf('0x18');return db[_0x9cbf('0x19')][_0x9cbf('0x16')]({'where':{'type':_0x5166c7,'resourceId':_0x4e5b58['id']}})[_0x9cbf('0x15')](function(){return _0x1e048b;});})[_0x9cbf('0x15')](function(){_0x3f72a4[_0x9cbf('0xb')](0xcc)[_0x9cbf('0xc')]();});}};}function handleEntityNotFound(_0x2fef7f){return function(_0xbb2b6a){if(!_0xbb2b6a){_0x2fef7f[_0x9cbf('0xa')](0x194);}return _0xbb2b6a;};}function handleError(_0x5edc1e,_0x4ce092){_0x4ce092=_0x4ce092||0x1f4;return function(_0x1eda82){logger[_0x9cbf('0x1a')](_0x1eda82[_0x9cbf('0x1b')]);if(_0x1eda82['name']){delete _0x1eda82[_0x9cbf('0x1c')];}_0x5edc1e[_0x9cbf('0xb')](_0x4ce092)[_0x9cbf('0x1d')](_0x1eda82);};}exports[_0x9cbf('0x1e')]=function(_0x3ae0db,_0x25aca3){var _0x3eca65={};var _0x226d68={'count':0x0,'rows':[]};var _0xb84c58=_['map'](db[_0x9cbf('0x1f')]['rawAttributes'],function(_0x3d5a2b){return{'name':_0x3d5a2b[_0x9cbf('0x20')],'type':_0x3d5a2b['type'][_0x9cbf('0x21')]};});_0x3eca65=qs['getOptions'](_0xb84c58,_0x3ae0db);var _0x8e70e0={'where':_0x3eca65[_0x9cbf('0x22')]};return db[_0x9cbf('0x1f')]['count'](_0x8e70e0)[_0x9cbf('0x15')](function(_0x2109f5){_0x226d68[_0x9cbf('0x11')]=_0x2109f5;_0x3eca65[_0x9cbf('0x23')]=qs[_0x9cbf('0x23')](_0x3ae0db['query']);return db[_0x9cbf('0x1f')][_0x9cbf('0x24')](_0x3eca65);})['then'](function(_0x5b091c){_0x226d68['rows']=_0x5b091c;return _0x226d68;})[_0x9cbf('0x15')](respondWithFilteredResult(_0x25aca3,_0x3eca65))[_0x9cbf('0x25')](handleError(_0x25aca3,null));};exports['show']=function(_0x4f09b8,_0x38ff99){var _0x827300={'raw':!![],'where':{'id':_0x4f09b8['params']['id']}},_0x2b6374={};_0x2b6374[_0x9cbf('0x26')]=_[_0x9cbf('0x27')](db[_0x9cbf('0x1f')]['rawAttributes']);_0x2b6374[_0x9cbf('0x28')]=_[_0x9cbf('0x27')](_0x4f09b8[_0x9cbf('0x28')]);_0x2b6374['filters']=_[_0x9cbf('0x29')](_0x2b6374['model'],_0x2b6374[_0x9cbf('0x28')]);_0x827300[_0x9cbf('0x2a')]=_[_0x9cbf('0x29')](_0x2b6374['model'],qs[_0x9cbf('0x2b')](_0x4f09b8[_0x9cbf('0x28')]['fields']));_0x827300[_0x9cbf('0x2a')]=_0x827300[_0x9cbf('0x2a')][_0x9cbf('0x2c')]?_0x827300['attributes']:_0x2b6374['model'];if(_0x4f09b8[_0x9cbf('0x28')][_0x9cbf('0x2d')]){_0x827300[_0x9cbf('0x23')]=[{'all':!![]}];}_0x827300=_[_0x9cbf('0x2e')]({},_0x827300,_0x4f09b8[_0x9cbf('0x2f')]);return db[_0x9cbf('0x1f')][_0x9cbf('0x30')](_0x827300)[_0x9cbf('0x15')](handleEntityNotFound(_0x38ff99,null))[_0x9cbf('0x15')](respondWithResult(_0x38ff99,null))[_0x9cbf('0x25')](handleError(_0x38ff99,null));};exports[_0x9cbf('0x31')]=function(_0xb3d678,_0x462f2e){return db[_0x9cbf('0x1f')]['create'](_0xb3d678[_0x9cbf('0x32')],{})[_0x9cbf('0x15')](function(_0x2dcfe2){var _0x62b69b=_0xb3d678[_0x9cbf('0x33')]['get']({'plain':!![]});if(!_0x62b69b)throw new Error(_0x9cbf('0x34'));if(_0x62b69b[_0x9cbf('0x35')]===_0x9cbf('0x33')){var _0x4c9762=_0x2dcfe2[_0x9cbf('0x17')]({'plain':!![]});var _0x3e4753=_0x9cbf('0x18');return db[_0x9cbf('0x36')][_0x9cbf('0x30')]({'where':{'name':_0x3e4753,'userProfileId':_0x62b69b[_0x9cbf('0x37')]},'raw':!![]})[_0x9cbf('0x15')](function(_0x489601){if(_0x489601&&_0x489601['autoAssociation']===0x0){return db[_0x9cbf('0x19')][_0x9cbf('0x31')]({'name':_0x4c9762[_0x9cbf('0x1c')],'resourceId':_0x4c9762['id'],'type':_0x489601['name'],'sectionId':_0x489601['id']},{})[_0x9cbf('0x15')](function(){return _0x2dcfe2;});}else{return _0x2dcfe2;}})[_0x9cbf('0x25')](function(_0x2b47f4){logger[_0x9cbf('0x1a')](_0x9cbf('0x38'),_0x2b47f4);throw _0x2b47f4;});}return _0x2dcfe2;})[_0x9cbf('0x15')](respondWithResult(_0x462f2e,0xc9))[_0x9cbf('0x25')](handleError(_0x462f2e,null));};exports[_0x9cbf('0x14')]=function(_0xe6f035,_0x5dcb39){if(_0xe6f035[_0x9cbf('0x32')]['id']){delete _0xe6f035[_0x9cbf('0x32')]['id'];}return db['ChatQueue']['find']({'where':{'id':_0xe6f035[_0x9cbf('0x39')]['id']}})[_0x9cbf('0x15')](handleEntityNotFound(_0x5dcb39,null))[_0x9cbf('0x15')](saveUpdates(_0xe6f035[_0x9cbf('0x32')],null))[_0x9cbf('0x15')](respondWithResult(_0x5dcb39,null))[_0x9cbf('0x25')](handleError(_0x5dcb39,null));};exports[_0x9cbf('0x16')]=function(_0x131ca0,_0x51053d){return db[_0x9cbf('0x1f')][_0x9cbf('0x30')]({'where':{'id':_0x131ca0['params']['id']}})[_0x9cbf('0x15')](handleEntityNotFound(_0x51053d,null))['then'](removeEntity(_0x51053d,null))[_0x9cbf('0x25')](handleError(_0x51053d,null));};exports[_0x9cbf('0x3a')]=function(_0xc17e7,_0x6920e5){return db[_0x9cbf('0x1f')][_0x9cbf('0x3a')]()[_0x9cbf('0x15')](respondWithResult(_0x6920e5,null))[_0x9cbf('0x25')](handleError(_0x6920e5,null));};exports[_0x9cbf('0x3b')]=function(_0x412fc2,_0x14cdac){var _0x4efd7e={'raw':!![],'where':{}},_0x1219e4={},_0x4db280;return db[_0x9cbf('0x1f')][_0x9cbf('0x3c')]({'where':{'id':_0x412fc2[_0x9cbf('0x39')]['id']}})['then'](handleEntityNotFound(_0x14cdac,null))[_0x9cbf('0x15')](function(_0x53a304){if(_0x53a304){_0x4db280=_0x53a304[_0x9cbf('0x17')]({'plain':!![]});_0x1219e4[_0x9cbf('0x26')]=_[_0x9cbf('0x27')](db[_0x9cbf('0x3d')][_0x9cbf('0x3e')]);_0x1219e4[_0x9cbf('0x28')]=_[_0x9cbf('0x27')](_0x412fc2['query']);_0x1219e4[_0x9cbf('0x3f')]=_['intersection'](_0x1219e4[_0x9cbf('0x26')],_0x1219e4['query']);_0x4efd7e['attributes']=_[_0x9cbf('0x29')](_0x1219e4[_0x9cbf('0x26')],qs[_0x9cbf('0x2b')](_0x412fc2[_0x9cbf('0x28')][_0x9cbf('0x2b')]));_0x4efd7e[_0x9cbf('0x2a')]=_0x4efd7e[_0x9cbf('0x2a')][_0x9cbf('0x2c')]?_0x4efd7e[_0x9cbf('0x2a')]:_0x1219e4[_0x9cbf('0x26')];if(!_0x412fc2['query'][_0x9cbf('0x40')]('nolimit')){_0x4efd7e[_0x9cbf('0x10')]=qs[_0x9cbf('0x10')](_0x412fc2[_0x9cbf('0x28')][_0x9cbf('0x10')]);_0x4efd7e[_0x9cbf('0xe')]=qs[_0x9cbf('0xe')](_0x412fc2[_0x9cbf('0x28')][_0x9cbf('0xe')]);}_0x4efd7e[_0x9cbf('0x41')]=qs['sort'](_0x412fc2['query'][_0x9cbf('0x42')]);_0x4efd7e['where']=qs[_0x9cbf('0x3f')](_[_0x9cbf('0x43')](_0x412fc2[_0x9cbf('0x28')],_0x1219e4['filters']));_0x4efd7e['where'][_0x9cbf('0x44')]=_0x53a304['id'];if(_0x412fc2['query'][_0x9cbf('0x45')]){_0x4efd7e['where']=_[_0x9cbf('0x2e')](_0x4efd7e[_0x9cbf('0x22')],{'$or':_[_0x9cbf('0x46')](_0x4efd7e[_0x9cbf('0x2a')],function(_0x353fab){var _0x24a7b5={};_0x24a7b5[_0x353fab]={'$like':'%'+_0x412fc2[_0x9cbf('0x28')][_0x9cbf('0x45')]+'%'};return _0x24a7b5;})});}_0x4efd7e=_[_0x9cbf('0x2e')]({},_0x4efd7e,_0x412fc2[_0x9cbf('0x2f')]);return db['UserChatQueue'][_0x9cbf('0x24')](_0x4efd7e);}})[_0x9cbf('0x15')](function(_0x2d6357){if(_0x2d6357){return db[_0x9cbf('0x47')][_0x9cbf('0x48')]({'where':{'id':_[_0x9cbf('0x46')](_0x2d6357,_0x9cbf('0x49')),'role':_0x9cbf('0x4a')},'attributes':['id',_0x9cbf('0x1c'),_0x9cbf('0x4b'),_0x9cbf('0x4c'),'createdAt']});}})[_0x9cbf('0x15')](function(_0x3de927){if(_0x3de927){return{'count':_0x3de927[_0x9cbf('0x11')],'rows':_['map'](_0x3de927[_0x9cbf('0x4d')],function(_0x23e51b){return{'membername':_0x23e51b['name'],'UserId':_0x23e51b['id'],'queue_name':_0x4db280[_0x9cbf('0x1c')],'ChatQueueId':_0x4db280['id'],'interface':util[_0x9cbf('0x4e')]('%s/%s',_0x9cbf('0x4f'),_0x23e51b[_0x9cbf('0x1c')]),'penalty':0x0,'paused':_0x23e51b[_0x9cbf('0x4b')],'createdAt':_0x23e51b['createdAt'],'updatedAt':_0x23e51b['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x9cbf('0x15')](respondWithFilteredResult(_0x14cdac,_0x4efd7e))[_0x9cbf('0x25')](handleError(_0x14cdac,null));};exports[_0x9cbf('0x50')]=function(_0x799f90,_0x220786){var _0x59ee9d={};var _0x2315df={};var _0x38fe22;var _0x1b7a4c;return db[_0x9cbf('0x1f')]['findOne']({'where':{'id':_0x799f90[_0x9cbf('0x39')]['id']}})['then'](handleEntityNotFound(_0x220786,null))['then'](function(_0x456480){if(_0x456480){_0x38fe22=_0x456480;_0x2315df[_0x9cbf('0x26')]=_[_0x9cbf('0x27')](db[_0x9cbf('0x51')][_0x9cbf('0x3e')]);_0x2315df[_0x9cbf('0x28')]=_[_0x9cbf('0x27')](_0x799f90[_0x9cbf('0x28')]);_0x2315df['filters']=_['intersection'](_0x2315df[_0x9cbf('0x26')],_0x2315df['query']);_0x59ee9d[_0x9cbf('0x2a')]=_['intersection'](_0x2315df[_0x9cbf('0x26')],qs[_0x9cbf('0x2b')](_0x799f90[_0x9cbf('0x28')][_0x9cbf('0x2b')]));_0x59ee9d[_0x9cbf('0x2a')]=_0x59ee9d['attributes'][_0x9cbf('0x2c')]?_0x59ee9d[_0x9cbf('0x2a')]:_0x2315df['model'];_0x59ee9d[_0x9cbf('0x41')]=qs['sort'](_0x799f90[_0x9cbf('0x28')]['sort']);_0x59ee9d[_0x9cbf('0x22')]=qs[_0x9cbf('0x3f')](_[_0x9cbf('0x43')](_0x799f90[_0x9cbf('0x28')],_0x2315df[_0x9cbf('0x3f')]));if(_0x799f90['query']['filter']){_0x59ee9d[_0x9cbf('0x22')]=_[_0x9cbf('0x2e')](_0x59ee9d['where'],{'$or':_[_0x9cbf('0x46')](_0x59ee9d[_0x9cbf('0x2a')],function(_0x17c1a1){var _0x3991be={};_0x3991be[_0x17c1a1]={'$like':'%'+_0x799f90[_0x9cbf('0x28')][_0x9cbf('0x45')]+'%'};return _0x3991be;})});}_0x59ee9d=_[_0x9cbf('0x2e')]({},_0x59ee9d,_0x799f90[_0x9cbf('0x2f')]);return _0x38fe22['getTeams'](_0x59ee9d);}})[_0x9cbf('0x15')](function(_0x4873d8){if(_0x4873d8){_0x1b7a4c=_0x4873d8[_0x9cbf('0x2c')];if(!_0x799f90[_0x9cbf('0x28')][_0x9cbf('0x40')]('nolimit')){_0x59ee9d['limit']=qs[_0x9cbf('0x10')](_0x799f90['query'][_0x9cbf('0x10')]);_0x59ee9d[_0x9cbf('0xe')]=qs[_0x9cbf('0xe')](_0x799f90[_0x9cbf('0x28')][_0x9cbf('0xe')]);}return _0x38fe22[_0x9cbf('0x50')](_0x59ee9d);}})['then'](function(_0x16478f){if(_0x16478f){return _0x16478f?{'count':_0x1b7a4c,'rows':_0x16478f}:null;}})[_0x9cbf('0x15')](respondWithResult(_0x220786,null))[_0x9cbf('0x25')](handleError(_0x220786,null));};exports['addTeams']=function(_0xe4bdb0,_0x4a92cd){var _0x3c1133=_0xe4bdb0[_0x9cbf('0x32')][_0x9cbf('0x52')];return db[_0x9cbf('0x51')]['findAll']({'where':{'id':_0x3c1133},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9cbf('0x53'),'attributes':['id',_0x9cbf('0x1c'),_0x9cbf('0x54'),'voicePause','interface'],'raw':!![]}]})[_0x9cbf('0x15')](function(_0x17fd79){if(_0x17fd79){var _0x45eedb=_[_0x9cbf('0x55')](_0x17fd79,function(_0x2f816e){var _0xba6dac=_0x2f816e[_0x9cbf('0x17')]({'plain':!![]});return _0xba6dac['Agents'];});return db[_0x9cbf('0x1f')][_0x9cbf('0x30')]({'where':{'id':_0xe4bdb0['params']['id']}})[_0x9cbf('0x15')](function(_0x3fe225){return db['sequelize'][_0x9cbf('0x56')](function(_0x219b53){return _0x3fe225[_0x9cbf('0x57')](_0x3c1133,{'transaction':_0x219b53})['then'](function(){return BPromise['each'](_0x45eedb,function(_0x3dcca1){return db[_0x9cbf('0x3d')][_0x9cbf('0x58')]({'where':{'UserId':_0x3dcca1['id'],'ChatQueueId':_0xe4bdb0[_0x9cbf('0x39')]['id']},'transaction':_0x219b53});});})['then'](function(){_0x45eedb[_0x9cbf('0x59')](function(_0xb91c89){socket[_0x9cbf('0x5a')](_0x9cbf('0x5b'),{'UserId':_0xb91c89['id'],'ChatQueueId':_0x3fe225['id']});});});});});}})['then'](respondWithStatusCode(_0x4a92cd,null))[_0x9cbf('0x25')](handleError(_0x4a92cd,null));};exports[_0x9cbf('0x5c')]=function(_0x7b418d,_0x338ff7){return db[_0x9cbf('0x51')][_0x9cbf('0x24')]({'where':{'id':_0x7b418d[_0x9cbf('0x28')][_0x9cbf('0x52')]},'attributes':['id'],'include':[{'model':db[_0x9cbf('0x47')],'as':_0x9cbf('0x53'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x338ff7,null))[_0x9cbf('0x15')](function(_0x5eb2e3){var _0x5cb1a6=_[_0x9cbf('0x46')](_0x5eb2e3,'id');var _0x14e80a=[];var _0x55e16b=[];var _0x320698=squel[_0x9cbf('0x5d')]();_0x320698[_0x9cbf('0x5e')]('tq.TeamId')[_0x9cbf('0x5f')](_0x9cbf('0x60'),'tq')['join'](_0x9cbf('0x61'),'ut',_0x9cbf('0x62'))[_0x9cbf('0x22')](_0x9cbf('0x63'),_0x7b418d['params']['id']);for(var _0x483a94=0x0;_0x483a94<_0x5eb2e3[_0x9cbf('0x2c')];_0x483a94+=0x1){let _0xbd3521=_0x5eb2e3[_0x483a94];for(var _0x353158=0x0;_0x353158<_0xbd3521[_0x9cbf('0x53')][_0x9cbf('0x2c')];_0x353158+=0x1){let _0x303bef=_0xbd3521[_0x9cbf('0x53')][_0x353158];var _0xc37ced=_0x320698[_0x9cbf('0x64')]();_0xc37ced['where'](_0x9cbf('0x65'),_0x303bef['id']);_0x55e16b['push'](db['sequelize'][_0x9cbf('0x28')](_0xc37ced[_0x9cbf('0x66')](),{'type':db[_0x9cbf('0x67')][_0x9cbf('0x68')][_0x9cbf('0x69')]})[_0x9cbf('0x15')](function(_0x369f3b){if(_0x369f3b[_0x9cbf('0x2c')]===0x1){return _0x303bef['id'];}else{var _0x32247d=_['every'](_[_0x9cbf('0x46')](_0x369f3b,_0x9cbf('0x6a')),function(_0x116c1c){return _[_0x9cbf('0x6b')](_0x5cb1a6,_0x116c1c);});if(_0x32247d){return _0x303bef['id'];}}}));}}return BPromise[_0x9cbf('0x6c')](_0x55e16b)[_0x9cbf('0x15')](function(_0x2aaa73){_0x14e80a=_(_0x14e80a)['union'](_0x2aaa73)[_0x9cbf('0x6d')]()['value']();return db[_0x9cbf('0x1f')][_0x9cbf('0x30')]({'where':{'id':_0x7b418d[_0x9cbf('0x39')]['id']}})[_0x9cbf('0x15')](function(_0xed2417){return db['sequelize'][_0x9cbf('0x56')](function(_0x48f6d0){return _0xed2417[_0x9cbf('0x5c')](_0x7b418d[_0x9cbf('0x28')][_0x9cbf('0x52')],{'transaction':_0x48f6d0})['then'](function(){if(!_['isEmpty'](_0x14e80a)){return _0xed2417['removeAgents'](_0x14e80a,{'transaction':_0x48f6d0});}})[_0x9cbf('0x15')](function(){_0x14e80a[_0x9cbf('0x59')](function(_0x48213d){socket[_0x9cbf('0x5a')](_0x9cbf('0x6e'),{'UserId':_0x48213d,'ChatQueueId':_0xed2417['id']});});});});});});})[_0x9cbf('0x15')](respondWithStatusCode(_0x338ff7,null))['catch'](handleError(_0x338ff7,null));};exports[_0x9cbf('0x6f')]=function(_0x43b34d,_0x610cb3){return db[_0x9cbf('0x1f')][_0x9cbf('0x30')]({'where':{'id':_0x43b34d['params']['id']}})[_0x9cbf('0x15')](handleEntityNotFound(_0x610cb3,null))[_0x9cbf('0x15')](function(_0x219e6c){if(_0x219e6c){return _0x219e6c[_0x9cbf('0x6f')](_0x43b34d[_0x9cbf('0x32')][_0x9cbf('0x52')],_[_0x9cbf('0x70')](_0x43b34d['body'],[_0x9cbf('0x52'),'id'])||{})['spread'](function(_0x5d0bdf){for(var _0x4954bb=0x0;_0x4954bb<_0x43b34d['body'][_0x9cbf('0x52')][_0x9cbf('0x2c')];_0x4954bb+=0x1){socket[_0x9cbf('0x5a')](_0x9cbf('0x5b'),{'UserId':Number(_0x43b34d[_0x9cbf('0x32')][_0x9cbf('0x52')][_0x4954bb]),'ChatQueueId':Number(_0x43b34d['params']['id'])});}return _0x5d0bdf;});}})[_0x9cbf('0x15')](respondWithResult(_0x610cb3,null))[_0x9cbf('0x25')](handleError(_0x610cb3,null));};exports[_0x9cbf('0x71')]=function(_0x3f50c6,_0x35d221){return db[_0x9cbf('0x1f')][_0x9cbf('0x30')]({'where':{'id':_0x3f50c6['params']['id']}})[_0x9cbf('0x15')](handleEntityNotFound(_0x35d221,null))[_0x9cbf('0x15')](function(_0x3e6c68){if(_0x3e6c68){return _0x3e6c68[_0x9cbf('0x71')](_0x3f50c6[_0x9cbf('0x28')]['ids'])[_0x9cbf('0x15')](function(){if(_['isArray'](_0x3f50c6['query'][_0x9cbf('0x52')])){for(var _0x513420=0x0;_0x513420<_0x3f50c6[_0x9cbf('0x28')][_0x9cbf('0x52')][_0x9cbf('0x2c')];_0x513420+=0x1){socket[_0x9cbf('0x5a')](_0x9cbf('0x6e'),{'UserId':Number(_0x3f50c6[_0x9cbf('0x28')][_0x9cbf('0x52')][_0x513420]),'ChatQueueId':Number(_0x3f50c6[_0x9cbf('0x39')]['id'])});}}else{socket['emit'](_0x9cbf('0x6e'),{'UserId':Number(_0x3f50c6[_0x9cbf('0x28')]['ids']),'ChatQueueId':Number(_0x3f50c6[_0x9cbf('0x39')]['id'])});}});}})[_0x9cbf('0x15')](respondWithStatusCode(_0x35d221,null))[_0x9cbf('0x25')](handleError(_0x35d221,null));};exports[_0x9cbf('0x72')]=function(_0x12f5fb,_0x323ea0){var _0x43dd6a={};var _0x1707b5={};var _0x20d734;var _0x13fccc;return db[_0x9cbf('0x1f')][_0x9cbf('0x3c')]({'where':{'id':_0x12f5fb[_0x9cbf('0x39')]['id']}})['then'](handleEntityNotFound(_0x323ea0,null))[_0x9cbf('0x15')](function(_0x1d3e2f){if(_0x1d3e2f){_0x20d734=_0x1d3e2f;_0x1707b5[_0x9cbf('0x26')]=_[_0x9cbf('0x27')](db[_0x9cbf('0x47')]['rawAttributes']);_0x1707b5[_0x9cbf('0x28')]=_[_0x9cbf('0x27')](_0x12f5fb[_0x9cbf('0x28')]);_0x1707b5[_0x9cbf('0x3f')]=_['intersection'](_0x1707b5[_0x9cbf('0x26')],_0x1707b5['query']);_0x43dd6a[_0x9cbf('0x2a')]=_[_0x9cbf('0x29')](_0x1707b5[_0x9cbf('0x26')],qs[_0x9cbf('0x2b')](_0x12f5fb[_0x9cbf('0x28')][_0x9cbf('0x2b')]));_0x43dd6a[_0x9cbf('0x2a')]=_0x43dd6a['attributes'][_0x9cbf('0x2c')]?_0x43dd6a[_0x9cbf('0x2a')]:_0x1707b5[_0x9cbf('0x26')];_0x43dd6a[_0x9cbf('0x41')]=qs['sort'](_0x12f5fb[_0x9cbf('0x28')][_0x9cbf('0x42')]);_0x43dd6a[_0x9cbf('0x22')]=qs['filters'](_[_0x9cbf('0x43')](_0x12f5fb[_0x9cbf('0x28')],_0x1707b5['filters']));if(_0x12f5fb[_0x9cbf('0x28')][_0x9cbf('0x45')]){_0x43dd6a['where']=_[_0x9cbf('0x2e')](_0x43dd6a[_0x9cbf('0x22')],{'$or':_[_0x9cbf('0x46')](_0x43dd6a[_0x9cbf('0x2a')],function(_0x955f43){var _0x5990e6={};_0x5990e6[_0x955f43]={'$like':'%'+_0x12f5fb[_0x9cbf('0x28')][_0x9cbf('0x45')]+'%'};return _0x5990e6;})});}_0x43dd6a=_[_0x9cbf('0x2e')]({},_0x43dd6a,_0x12f5fb[_0x9cbf('0x2f')]);return _0x20d734['getAgents'](_0x43dd6a);}})['then'](function(_0x241327){if(_0x241327){_0x13fccc=_0x241327[_0x9cbf('0x2c')];if(!_0x12f5fb[_0x9cbf('0x28')][_0x9cbf('0x40')](_0x9cbf('0x73'))){_0x43dd6a[_0x9cbf('0x10')]=qs[_0x9cbf('0x10')](_0x12f5fb[_0x9cbf('0x28')][_0x9cbf('0x10')]);_0x43dd6a['offset']=qs[_0x9cbf('0xe')](_0x12f5fb[_0x9cbf('0x28')][_0x9cbf('0xe')]);}return _0x20d734[_0x9cbf('0x72')](_0x43dd6a);}})['then'](function(_0x21e4d7){if(_0x21e4d7){return _0x21e4d7?{'count':_0x13fccc,'rows':_0x21e4d7}:null;}})[_0x9cbf('0x15')](respondWithResult(_0x323ea0,null))[_0x9cbf('0x25')](handleError(_0x323ea0,null));}; \ No newline at end of file +var _0xf370=['ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','isEmpty','removeAgents','forEach','userChatQueue:remove','addAgents','omit','spread','emit','isArray','getAgents','bluebird','util','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','ChatQueues','UserProfileResource','error','stack','name','send','fieldName','key','getOptions','where','ChatQueue','include','query','findAll','rows','show','params','model','keys','rawAttributes','filters','intersection','attributes','fields','length','includeAll','merge','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','order','sort','pick','filter','options','User','findAndCountAll','map','UserId','updatedAt','format','%s/%s','SIP','createdAt','Team','getTeams','nolimit','ids','online','interface','flatMap','Agents','transaction','addTeams','each','findOrCreate','userChatQueue:save','removeTeams','select','tq.TeamId','team_has_chat_queues','join','user_has_teams'];(function(_0x251e3b,_0x46afaf){var _0x469080=function(_0x3962af){while(--_0x3962af){_0x251e3b['push'](_0x251e3b['shift']());}};_0x469080(++_0x46afaf);}(_0xf370,0x18d));var _0x0f37=function(_0x36a5f3,_0xf4d305){_0x36a5f3=_0x36a5f3-0x0;var _0x41d37f=_0xf370[_0x36a5f3];return _0x41d37f;};'use strict';var BPromise=require(_0x0f37('0x0'));var util=require(_0x0f37('0x1'));var _=require('lodash');var squel=require(_0x0f37('0x2'));var Redis=require(_0x0f37('0x3'));var qs=require(_0x0f37('0x4'));var logger=require(_0x0f37('0x5'))(_0x0f37('0x6'));var config=require('../../config/environment');var db=require(_0x0f37('0x7'))['db'];config[_0x0f37('0x8')]=_['defaults'](config[_0x0f37('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x0f37('0x9'))(new Redis(config[_0x0f37('0x8')]));require('./chatQueue.socket')[_0x0f37('0xa')](socket);function respondWithStatusCode(_0x52ba05,_0x6389e8){_0x6389e8=_0x6389e8||0xcc;return function(_0x2c8a38){if(_0x2c8a38){return _0x52ba05[_0x0f37('0xb')](_0x6389e8);}return _0x52ba05[_0x0f37('0xc')](_0x6389e8)['end']();};}function respondWithResult(_0x5a8dfe,_0x3d9604){_0x3d9604=_0x3d9604||0xc8;return function(_0x52b75e){if(_0x52b75e){return _0x5a8dfe[_0x0f37('0xc')](_0x3d9604)[_0x0f37('0xd')](_0x52b75e);}};}function respondWithFilteredResult(_0x1cdad2,_0x46a714){return function(_0x260b27){if(_0x260b27){var _0x424c1d=typeof _0x46a714[_0x0f37('0xe')]===_0x0f37('0xf')&&typeof _0x46a714[_0x0f37('0x10')]==='undefined';var _0x4fd3cd=_0x260b27[_0x0f37('0x11')];var _0x16b411=_0x424c1d?0x0:_0x46a714[_0x0f37('0xe')];var _0xd8b06f=_0x424c1d?_0x260b27[_0x0f37('0x11')]:_0x46a714[_0x0f37('0xe')]+_0x46a714['limit'];var _0x478201;if(_0xd8b06f>=_0x4fd3cd){_0xd8b06f=_0x4fd3cd;_0x478201=0xc8;}else{_0x478201=0xce;}_0x1cdad2['status'](_0x478201);return _0x1cdad2[_0x0f37('0x12')](_0x0f37('0x13'),_0x16b411+'-'+_0xd8b06f+'/'+_0x4fd3cd)[_0x0f37('0xd')](_0x260b27);}return null;};}function saveUpdates(_0x21941f){return function(_0x1f8cd7){if(_0x1f8cd7){return _0x1f8cd7[_0x0f37('0x14')](_0x21941f)[_0x0f37('0x15')](function(_0x523c2b){return _0x523c2b;});}return null;};}function removeEntity(_0x23028f){return function(_0x5e1822){if(_0x5e1822){return _0x5e1822[_0x0f37('0x16')]()['then'](function(){var _0x447d25=_0x5e1822[_0x0f37('0x17')]({'plain':!![]});var _0x311161=_0x0f37('0x18');return db[_0x0f37('0x19')][_0x0f37('0x16')]({'where':{'type':_0x311161,'resourceId':_0x447d25['id']}})[_0x0f37('0x15')](function(){return _0x5e1822;});})[_0x0f37('0x15')](function(){_0x23028f[_0x0f37('0xc')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1858d1){return function(_0x168020){if(!_0x168020){_0x1858d1['sendStatus'](0x194);}return _0x168020;};}function handleError(_0x3f042b,_0x2f3083){_0x2f3083=_0x2f3083||0x1f4;return function(_0x47cfaf){logger[_0x0f37('0x1a')](_0x47cfaf[_0x0f37('0x1b')]);if(_0x47cfaf['name']){delete _0x47cfaf[_0x0f37('0x1c')];}_0x3f042b[_0x0f37('0xc')](_0x2f3083)[_0x0f37('0x1d')](_0x47cfaf);};}exports['index']=function(_0x580016,_0x24133e){var _0x595650={};var _0x1c403e={'count':0x0,'rows':[]};var _0x2e0e30=_['map'](db['ChatQueue']['rawAttributes'],function(_0x363658){return{'name':_0x363658[_0x0f37('0x1e')],'type':_0x363658['type'][_0x0f37('0x1f')]};});_0x595650=qs[_0x0f37('0x20')](_0x2e0e30,_0x580016);var _0x373173={'where':_0x595650[_0x0f37('0x21')]};return db[_0x0f37('0x22')][_0x0f37('0x11')](_0x373173)['then'](function(_0x3a17b3){_0x1c403e[_0x0f37('0x11')]=_0x3a17b3;_0x595650[_0x0f37('0x23')]=qs['include'](_0x580016[_0x0f37('0x24')]);return db[_0x0f37('0x22')][_0x0f37('0x25')](_0x595650);})[_0x0f37('0x15')](function(_0x5a2e26){_0x1c403e[_0x0f37('0x26')]=_0x5a2e26;return _0x1c403e;})[_0x0f37('0x15')](respondWithFilteredResult(_0x24133e,_0x595650))['catch'](handleError(_0x24133e,null));};exports[_0x0f37('0x27')]=function(_0x4a9120,_0x3f0b7e){var _0x3de8fa={'raw':!![],'where':{'id':_0x4a9120[_0x0f37('0x28')]['id']}},_0x7c36e0={};_0x7c36e0[_0x0f37('0x29')]=_[_0x0f37('0x2a')](db[_0x0f37('0x22')][_0x0f37('0x2b')]);_0x7c36e0[_0x0f37('0x24')]=_[_0x0f37('0x2a')](_0x4a9120[_0x0f37('0x24')]);_0x7c36e0[_0x0f37('0x2c')]=_[_0x0f37('0x2d')](_0x7c36e0['model'],_0x7c36e0[_0x0f37('0x24')]);_0x3de8fa[_0x0f37('0x2e')]=_['intersection'](_0x7c36e0[_0x0f37('0x29')],qs[_0x0f37('0x2f')](_0x4a9120[_0x0f37('0x24')]['fields']));_0x3de8fa[_0x0f37('0x2e')]=_0x3de8fa['attributes'][_0x0f37('0x30')]?_0x3de8fa['attributes']:_0x7c36e0[_0x0f37('0x29')];if(_0x4a9120[_0x0f37('0x24')][_0x0f37('0x31')]){_0x3de8fa[_0x0f37('0x23')]=[{'all':!![]}];}_0x3de8fa=_[_0x0f37('0x32')]({},_0x3de8fa,_0x4a9120['options']);return db[_0x0f37('0x22')][_0x0f37('0x33')](_0x3de8fa)['then'](handleEntityNotFound(_0x3f0b7e,null))[_0x0f37('0x15')](respondWithResult(_0x3f0b7e,null))[_0x0f37('0x34')](handleError(_0x3f0b7e,null));};exports[_0x0f37('0x35')]=function(_0x27878c,_0x4b0cd2){return db[_0x0f37('0x22')]['create'](_0x27878c[_0x0f37('0x36')],{})[_0x0f37('0x15')](function(_0xcfca76){var _0x57db14=_0x27878c[_0x0f37('0x37')]['get']({'plain':!![]});if(!_0x57db14)throw new Error(_0x0f37('0x38'));if(_0x57db14[_0x0f37('0x39')]===_0x0f37('0x37')){var _0x131f9b=_0xcfca76['get']({'plain':!![]});var _0x1d89b5=_0x0f37('0x18');return db[_0x0f37('0x3a')][_0x0f37('0x33')]({'where':{'name':_0x1d89b5,'userProfileId':_0x57db14[_0x0f37('0x3b')]},'raw':!![]})['then'](function(_0x675ca1){if(_0x675ca1&&_0x675ca1['autoAssociation']===0x0){return db[_0x0f37('0x19')][_0x0f37('0x35')]({'name':_0x131f9b['name'],'resourceId':_0x131f9b['id'],'type':_0x675ca1[_0x0f37('0x1c')],'sectionId':_0x675ca1['id']},{})[_0x0f37('0x15')](function(){return _0xcfca76;});}else{return _0xcfca76;}})[_0x0f37('0x34')](function(_0x4a3e17){logger[_0x0f37('0x1a')](_0x0f37('0x3c'),_0x4a3e17);throw _0x4a3e17;});}return _0xcfca76;})['then'](respondWithResult(_0x4b0cd2,0xc9))['catch'](handleError(_0x4b0cd2,null));};exports[_0x0f37('0x14')]=function(_0x481245,_0xf776e2){if(_0x481245['body']['id']){delete _0x481245[_0x0f37('0x36')]['id'];}return db[_0x0f37('0x22')][_0x0f37('0x33')]({'where':{'id':_0x481245['params']['id']}})[_0x0f37('0x15')](handleEntityNotFound(_0xf776e2,null))[_0x0f37('0x15')](saveUpdates(_0x481245['body'],null))[_0x0f37('0x15')](respondWithResult(_0xf776e2,null))[_0x0f37('0x34')](handleError(_0xf776e2,null));};exports[_0x0f37('0x16')]=function(_0x4d4ab5,_0xe120fd){return db[_0x0f37('0x22')][_0x0f37('0x33')]({'where':{'id':_0x4d4ab5[_0x0f37('0x28')]['id']}})[_0x0f37('0x15')](handleEntityNotFound(_0xe120fd,null))[_0x0f37('0x15')](removeEntity(_0xe120fd,null))[_0x0f37('0x34')](handleError(_0xe120fd,null));};exports[_0x0f37('0x3d')]=function(_0x133fcd,_0x519d04){return db[_0x0f37('0x22')][_0x0f37('0x3d')]()[_0x0f37('0x15')](respondWithResult(_0x519d04,null))[_0x0f37('0x34')](handleError(_0x519d04,null));};exports[_0x0f37('0x3e')]=function(_0x10d7d9,_0x54d08e){var _0x19afc0={'raw':!![],'where':{}},_0x2a2327={},_0x287c9b;return db[_0x0f37('0x22')][_0x0f37('0x3f')]({'where':{'id':_0x10d7d9[_0x0f37('0x28')]['id']}})[_0x0f37('0x15')](handleEntityNotFound(_0x54d08e,null))[_0x0f37('0x15')](function(_0x284609){if(_0x284609){_0x287c9b=_0x284609['get']({'plain':!![]});_0x2a2327['model']=_[_0x0f37('0x2a')](db[_0x0f37('0x40')][_0x0f37('0x2b')]);_0x2a2327[_0x0f37('0x24')]=_[_0x0f37('0x2a')](_0x10d7d9[_0x0f37('0x24')]);_0x2a2327['filters']=_[_0x0f37('0x2d')](_0x2a2327[_0x0f37('0x29')],_0x2a2327[_0x0f37('0x24')]);_0x19afc0[_0x0f37('0x2e')]=_['intersection'](_0x2a2327[_0x0f37('0x29')],qs[_0x0f37('0x2f')](_0x10d7d9['query'][_0x0f37('0x2f')]));_0x19afc0[_0x0f37('0x2e')]=_0x19afc0[_0x0f37('0x2e')]['length']?_0x19afc0[_0x0f37('0x2e')]:_0x2a2327[_0x0f37('0x29')];if(!_0x10d7d9[_0x0f37('0x24')][_0x0f37('0x41')]('nolimit')){_0x19afc0[_0x0f37('0x10')]=qs[_0x0f37('0x10')](_0x10d7d9[_0x0f37('0x24')][_0x0f37('0x10')]);_0x19afc0[_0x0f37('0xe')]=qs['offset'](_0x10d7d9[_0x0f37('0x24')]['offset']);}_0x19afc0[_0x0f37('0x42')]=qs[_0x0f37('0x43')](_0x10d7d9[_0x0f37('0x24')]['sort']);_0x19afc0['where']=qs['filters'](_[_0x0f37('0x44')](_0x10d7d9[_0x0f37('0x24')],_0x2a2327[_0x0f37('0x2c')]));_0x19afc0['where']['ChatQueueId']=_0x284609['id'];if(_0x10d7d9['query'][_0x0f37('0x45')]){_0x19afc0['where']=_['merge'](_0x19afc0[_0x0f37('0x21')],{'$or':_['map'](_0x19afc0['attributes'],function(_0xa18e81){var _0x55dd36={};_0x55dd36[_0xa18e81]={'$like':'%'+_0x10d7d9['query'][_0x0f37('0x45')]+'%'};return _0x55dd36;})});}_0x19afc0=_[_0x0f37('0x32')]({},_0x19afc0,_0x10d7d9[_0x0f37('0x46')]);return db[_0x0f37('0x40')][_0x0f37('0x25')](_0x19afc0);}})['then'](function(_0x42ca50){if(_0x42ca50){return db[_0x0f37('0x47')][_0x0f37('0x48')]({'where':{'id':_[_0x0f37('0x49')](_0x42ca50,_0x0f37('0x4a')),'role':'agent'},'attributes':['id',_0x0f37('0x1c'),'chatPause',_0x0f37('0x4b'),'createdAt']});}})[_0x0f37('0x15')](function(_0x2a3dbf){if(_0x2a3dbf){return{'count':_0x2a3dbf['count'],'rows':_[_0x0f37('0x49')](_0x2a3dbf[_0x0f37('0x26')],function(_0x182229){return{'membername':_0x182229[_0x0f37('0x1c')],'UserId':_0x182229['id'],'queue_name':_0x287c9b['name'],'ChatQueueId':_0x287c9b['id'],'interface':util[_0x0f37('0x4c')](_0x0f37('0x4d'),_0x0f37('0x4e'),_0x182229[_0x0f37('0x1c')]),'penalty':0x0,'paused':_0x182229['chatPause'],'createdAt':_0x182229[_0x0f37('0x4f')],'updatedAt':_0x182229['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x0f37('0x15')](respondWithFilteredResult(_0x54d08e,_0x19afc0))['catch'](handleError(_0x54d08e,null));};exports['getTeams']=function(_0x5ffaac,_0x4f2a9d){var _0x4e172a={};var _0x221c93={};var _0x3f4a4c;var _0x446830;return db[_0x0f37('0x22')][_0x0f37('0x3f')]({'where':{'id':_0x5ffaac['params']['id']}})['then'](handleEntityNotFound(_0x4f2a9d,null))[_0x0f37('0x15')](function(_0x167610){if(_0x167610){_0x3f4a4c=_0x167610;_0x221c93[_0x0f37('0x29')]=_[_0x0f37('0x2a')](db[_0x0f37('0x50')][_0x0f37('0x2b')]);_0x221c93[_0x0f37('0x24')]=_[_0x0f37('0x2a')](_0x5ffaac['query']);_0x221c93[_0x0f37('0x2c')]=_[_0x0f37('0x2d')](_0x221c93[_0x0f37('0x29')],_0x221c93['query']);_0x4e172a[_0x0f37('0x2e')]=_[_0x0f37('0x2d')](_0x221c93[_0x0f37('0x29')],qs['fields'](_0x5ffaac['query']['fields']));_0x4e172a[_0x0f37('0x2e')]=_0x4e172a[_0x0f37('0x2e')][_0x0f37('0x30')]?_0x4e172a[_0x0f37('0x2e')]:_0x221c93[_0x0f37('0x29')];_0x4e172a['order']=qs['sort'](_0x5ffaac[_0x0f37('0x24')][_0x0f37('0x43')]);_0x4e172a['where']=qs['filters'](_['pick'](_0x5ffaac[_0x0f37('0x24')],_0x221c93[_0x0f37('0x2c')]));if(_0x5ffaac['query']['filter']){_0x4e172a['where']=_['merge'](_0x4e172a[_0x0f37('0x21')],{'$or':_[_0x0f37('0x49')](_0x4e172a[_0x0f37('0x2e')],function(_0x51ee42){var _0x4da2dd={};_0x4da2dd[_0x51ee42]={'$like':'%'+_0x5ffaac[_0x0f37('0x24')][_0x0f37('0x45')]+'%'};return _0x4da2dd;})});}_0x4e172a=_['merge']({},_0x4e172a,_0x5ffaac[_0x0f37('0x46')]);return _0x3f4a4c[_0x0f37('0x51')](_0x4e172a);}})[_0x0f37('0x15')](function(_0x15e697){if(_0x15e697){_0x446830=_0x15e697[_0x0f37('0x30')];if(!_0x5ffaac[_0x0f37('0x24')][_0x0f37('0x41')](_0x0f37('0x52'))){_0x4e172a['limit']=qs[_0x0f37('0x10')](_0x5ffaac[_0x0f37('0x24')][_0x0f37('0x10')]);_0x4e172a[_0x0f37('0xe')]=qs[_0x0f37('0xe')](_0x5ffaac[_0x0f37('0x24')][_0x0f37('0xe')]);}return _0x3f4a4c[_0x0f37('0x51')](_0x4e172a);}})[_0x0f37('0x15')](function(_0x429442){if(_0x429442){return _0x429442?{'count':_0x446830,'rows':_0x429442}:null;}})[_0x0f37('0x15')](respondWithResult(_0x4f2a9d,null))[_0x0f37('0x34')](handleError(_0x4f2a9d,null));};exports['addTeams']=function(_0x2f8f26,_0x292feb){var _0x361f3e=_0x2f8f26['body'][_0x0f37('0x53')];return db[_0x0f37('0x50')][_0x0f37('0x25')]({'where':{'id':_0x361f3e},'attributes':['id'],'include':[{'model':db[_0x0f37('0x47')],'as':'Agents','attributes':['id','name',_0x0f37('0x54'),'voicePause',_0x0f37('0x55')],'raw':!![]}]})[_0x0f37('0x15')](function(_0x4fef36){if(_0x4fef36){var _0x132bcd=_[_0x0f37('0x56')](_0x4fef36,function(_0x38ecb5){var _0x8f4498=_0x38ecb5[_0x0f37('0x17')]({'plain':!![]});return _0x8f4498[_0x0f37('0x57')];});return db[_0x0f37('0x22')]['find']({'where':{'id':_0x2f8f26[_0x0f37('0x28')]['id']}})[_0x0f37('0x15')](function(_0x136968){return db['sequelize'][_0x0f37('0x58')](function(_0x523834){return _0x136968[_0x0f37('0x59')](_0x361f3e,{'transaction':_0x523834})[_0x0f37('0x15')](function(){return BPromise[_0x0f37('0x5a')](_0x132bcd,function(_0x5678bf){return db[_0x0f37('0x40')][_0x0f37('0x5b')]({'where':{'UserId':_0x5678bf['id'],'ChatQueueId':_0x2f8f26[_0x0f37('0x28')]['id']},'transaction':_0x523834});});})[_0x0f37('0x15')](function(){_0x132bcd['forEach'](function(_0xa4427a){socket['emit'](_0x0f37('0x5c'),{'UserId':_0xa4427a['id'],'ChatQueueId':_0x136968['id']});});});});});}})['then'](respondWithStatusCode(_0x292feb,null))[_0x0f37('0x34')](handleError(_0x292feb,null));};exports[_0x0f37('0x5d')]=function(_0x34eff2,_0x54310e){return db[_0x0f37('0x50')][_0x0f37('0x25')]({'where':{'id':_0x34eff2[_0x0f37('0x24')][_0x0f37('0x53')]},'attributes':['id'],'include':[{'model':db[_0x0f37('0x47')],'as':_0x0f37('0x57'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x54310e,null))[_0x0f37('0x15')](function(_0x5f1c72){var _0xe67e3d=_[_0x0f37('0x49')](_0x5f1c72,'id');var _0x41de54=[];var _0x1cf0c1=[];var _0x14f95c=squel[_0x0f37('0x5e')]();_0x14f95c['field'](_0x0f37('0x5f'))['from'](_0x0f37('0x60'),'tq')[_0x0f37('0x61')](_0x0f37('0x62'),'ut',_0x0f37('0x63'))[_0x0f37('0x21')](_0x0f37('0x64'),_0x34eff2[_0x0f37('0x28')]['id']);for(var _0x2a4415=0x0;_0x2a4415<_0x5f1c72['length'];_0x2a4415+=0x1){let _0x4738d3=_0x5f1c72[_0x2a4415];for(var _0x130014=0x0;_0x130014<_0x4738d3[_0x0f37('0x57')][_0x0f37('0x30')];_0x130014+=0x1){let _0xa0a19a=_0x4738d3[_0x0f37('0x57')][_0x130014];var _0x2ce41a=_0x14f95c[_0x0f37('0x65')]();_0x2ce41a['where'](_0x0f37('0x66'),_0xa0a19a['id']);_0x1cf0c1[_0x0f37('0x67')](db[_0x0f37('0x68')][_0x0f37('0x24')](_0x2ce41a[_0x0f37('0x69')](),{'type':db['sequelize'][_0x0f37('0x6a')][_0x0f37('0x6b')]})[_0x0f37('0x15')](function(_0x2e8947){if(_0x2e8947[_0x0f37('0x30')]===0x1){return _0xa0a19a['id'];}else{var _0x5d9d1b=_[_0x0f37('0x6c')](_['map'](_0x2e8947,_0x0f37('0x6d')),function(_0x46f4a4){return _['includes'](_0xe67e3d,_0x46f4a4);});if(_0x5d9d1b){return _0xa0a19a['id'];}}}));}}return BPromise[_0x0f37('0x6e')](_0x1cf0c1)[_0x0f37('0x15')](function(_0x5d85a8){_0x41de54=_(_0x41de54)[_0x0f37('0x6f')](_0x5d85a8)[_0x0f37('0x70')]()[_0x0f37('0x71')]();return db[_0x0f37('0x22')]['find']({'where':{'id':_0x34eff2[_0x0f37('0x28')]['id']}})[_0x0f37('0x15')](function(_0x613223){return db[_0x0f37('0x68')]['transaction'](function(_0x39408d){return _0x613223[_0x0f37('0x5d')](_0x34eff2[_0x0f37('0x24')][_0x0f37('0x53')],{'transaction':_0x39408d})[_0x0f37('0x15')](function(){if(!_[_0x0f37('0x72')](_0x41de54)){return _0x613223[_0x0f37('0x73')](_0x41de54,{'transaction':_0x39408d});}})[_0x0f37('0x15')](function(){_0x41de54[_0x0f37('0x74')](function(_0x1dddcd){socket['emit'](_0x0f37('0x75'),{'UserId':_0x1dddcd,'ChatQueueId':_0x613223['id']});});});});});});})[_0x0f37('0x15')](respondWithStatusCode(_0x54310e,null))[_0x0f37('0x34')](handleError(_0x54310e,null));};exports[_0x0f37('0x76')]=function(_0x194480,_0x259af7){return db[_0x0f37('0x22')]['find']({'where':{'id':_0x194480[_0x0f37('0x28')]['id']}})[_0x0f37('0x15')](handleEntityNotFound(_0x259af7,null))[_0x0f37('0x15')](function(_0x5f2a9e){if(_0x5f2a9e){return _0x5f2a9e[_0x0f37('0x76')](_0x194480[_0x0f37('0x36')][_0x0f37('0x53')],_[_0x0f37('0x77')](_0x194480[_0x0f37('0x36')],['ids','id'])||{})[_0x0f37('0x78')](function(_0x913e17){for(var _0x3faa2e=0x0;_0x3faa2e<_0x194480['body'][_0x0f37('0x53')][_0x0f37('0x30')];_0x3faa2e+=0x1){socket[_0x0f37('0x79')](_0x0f37('0x5c'),{'UserId':Number(_0x194480['body'][_0x0f37('0x53')][_0x3faa2e]),'ChatQueueId':Number(_0x194480[_0x0f37('0x28')]['id'])});}return _0x913e17;});}})[_0x0f37('0x15')](respondWithResult(_0x259af7,null))[_0x0f37('0x34')](handleError(_0x259af7,null));};exports['removeAgents']=function(_0x354c0b,_0x407ae0){return db['ChatQueue']['find']({'where':{'id':_0x354c0b[_0x0f37('0x28')]['id']}})['then'](handleEntityNotFound(_0x407ae0,null))[_0x0f37('0x15')](function(_0x583da1){if(_0x583da1){return _0x583da1[_0x0f37('0x73')](_0x354c0b[_0x0f37('0x24')][_0x0f37('0x53')])[_0x0f37('0x15')](function(){if(_[_0x0f37('0x7a')](_0x354c0b['query'][_0x0f37('0x53')])){for(var _0x2ea581=0x0;_0x2ea581<_0x354c0b[_0x0f37('0x24')]['ids'][_0x0f37('0x30')];_0x2ea581+=0x1){socket['emit'](_0x0f37('0x75'),{'UserId':Number(_0x354c0b[_0x0f37('0x24')][_0x0f37('0x53')][_0x2ea581]),'ChatQueueId':Number(_0x354c0b[_0x0f37('0x28')]['id'])});}}else{socket['emit'](_0x0f37('0x75'),{'UserId':Number(_0x354c0b[_0x0f37('0x24')]['ids']),'ChatQueueId':Number(_0x354c0b[_0x0f37('0x28')]['id'])});}});}})[_0x0f37('0x15')](respondWithStatusCode(_0x407ae0,null))[_0x0f37('0x34')](handleError(_0x407ae0,null));};exports['getAgents']=function(_0x1b26d7,_0xcd5ed4){var _0x10c505={};var _0x1b1160={};var _0x498e19;var _0x18bcf8;return db['ChatQueue'][_0x0f37('0x3f')]({'where':{'id':_0x1b26d7[_0x0f37('0x28')]['id']}})[_0x0f37('0x15')](handleEntityNotFound(_0xcd5ed4,null))[_0x0f37('0x15')](function(_0x55284c){if(_0x55284c){_0x498e19=_0x55284c;_0x1b1160[_0x0f37('0x29')]=_['keys'](db[_0x0f37('0x47')][_0x0f37('0x2b')]);_0x1b1160['query']=_[_0x0f37('0x2a')](_0x1b26d7[_0x0f37('0x24')]);_0x1b1160['filters']=_[_0x0f37('0x2d')](_0x1b1160[_0x0f37('0x29')],_0x1b1160['query']);_0x10c505['attributes']=_['intersection'](_0x1b1160[_0x0f37('0x29')],qs[_0x0f37('0x2f')](_0x1b26d7['query'][_0x0f37('0x2f')]));_0x10c505[_0x0f37('0x2e')]=_0x10c505['attributes']['length']?_0x10c505[_0x0f37('0x2e')]:_0x1b1160[_0x0f37('0x29')];_0x10c505[_0x0f37('0x42')]=qs[_0x0f37('0x43')](_0x1b26d7[_0x0f37('0x24')]['sort']);_0x10c505[_0x0f37('0x21')]=qs[_0x0f37('0x2c')](_['pick'](_0x1b26d7[_0x0f37('0x24')],_0x1b1160['filters']));if(_0x1b26d7[_0x0f37('0x24')][_0x0f37('0x45')]){_0x10c505[_0x0f37('0x21')]=_[_0x0f37('0x32')](_0x10c505[_0x0f37('0x21')],{'$or':_[_0x0f37('0x49')](_0x10c505[_0x0f37('0x2e')],function(_0x13e3c1){var _0xf76d00={};_0xf76d00[_0x13e3c1]={'$like':'%'+_0x1b26d7[_0x0f37('0x24')]['filter']+'%'};return _0xf76d00;})});}_0x10c505=_[_0x0f37('0x32')]({},_0x10c505,_0x1b26d7[_0x0f37('0x46')]);return _0x498e19['getAgents'](_0x10c505);}})[_0x0f37('0x15')](function(_0x5b3640){if(_0x5b3640){_0x18bcf8=_0x5b3640[_0x0f37('0x30')];if(!_0x1b26d7['query'][_0x0f37('0x41')](_0x0f37('0x52'))){_0x10c505[_0x0f37('0x10')]=qs[_0x0f37('0x10')](_0x1b26d7['query'][_0x0f37('0x10')]);_0x10c505[_0x0f37('0xe')]=qs['offset'](_0x1b26d7[_0x0f37('0x24')][_0x0f37('0xe')]);}return _0x498e19[_0x0f37('0x7b')](_0x10c505);}})['then'](function(_0x9b75ae){if(_0x9b75ae){return _0x9b75ae?{'count':_0x18bcf8,'rows':_0x9b75ae}:null;}})['then'](respondWithResult(_0xcd5ed4,null))[_0x0f37('0x34')](handleError(_0xcd5ed4,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index cff7bf5..32b27d0 100644 --- a/server/api/chatQueue/chatQueue.events.js +++ b/server/api/chatQueue/chatQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd2f=['exports','events','../../mysqldb','ChatQueue','save','remove','hook'];(function(_0x565fc6,_0x4ad48f){var _0x2fa55a=function(_0x41bdd9){while(--_0x41bdd9){_0x565fc6['push'](_0x565fc6['shift']());}};_0x2fa55a(++_0x4ad48f);}(_0xfd2f,0x14a));var _0xffd2=function(_0x35df33,_0x513c52){_0x35df33=_0x35df33-0x0;var _0x5077fd=_0xfd2f[_0x35df33];return _0x5077fd;};'use strict';var EventEmitter=require(_0xffd2('0x0'));var ChatQueue=require(_0xffd2('0x1'))['db'][_0xffd2('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xffd2('0x3'),'afterUpdate':'update','afterDestroy':_0xffd2('0x4')};function emitEvent(_0x407d4b){return function(_0x492c33,_0x983987,_0x22c424){ChatQueueEvents['emit'](_0x407d4b+':'+_0x492c33['id'],_0x492c33);ChatQueueEvents['emit'](_0x407d4b,_0x492c33);_0x22c424(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xffd2('0x5')](e,emitEvent(event));}}module[_0xffd2('0x6')]=ChatQueueEvents; \ No newline at end of file +var _0x7bfa=['hasOwnProperty','hook','exports','events','setMaxListeners','save','remove','emit'];(function(_0x5756f8,_0x22b6d5){var _0x3bb749=function(_0x332204){while(--_0x332204){_0x5756f8['push'](_0x5756f8['shift']());}};_0x3bb749(++_0x22b6d5);}(_0x7bfa,0x173));var _0xa7bf=function(_0x4c0155,_0x5b20db){_0x4c0155=_0x4c0155-0x0;var _0x1276db=_0x7bfa[_0x4c0155];return _0x1276db;};'use strict';var EventEmitter=require(_0xa7bf('0x0'));var ChatQueue=require('../../mysqldb')['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xa7bf('0x1')](0x0);var events={'afterCreate':_0xa7bf('0x2'),'afterUpdate':'update','afterDestroy':_0xa7bf('0x3')};function emitEvent(_0x21f0bd){return function(_0x39223a,_0x10fbf0,_0x2debe9){ChatQueueEvents[_0xa7bf('0x4')](_0x21f0bd+':'+_0x39223a['id'],_0x39223a);ChatQueueEvents[_0xa7bf('0x4')](_0x21f0bd,_0x39223a);_0x2debe9(null);};}for(var e in events){if(events[_0xa7bf('0x5')](e)){var event=events[e];ChatQueue[_0xa7bf('0x6')](e,emitEvent(event));}}module[_0xa7bf('0x7')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index ddd3f89..a236132 100644 --- a/server/api/chatQueue/chatQueue.model.js +++ b/server/api/chatQueue/chatQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x981a=['moment','bluebird','request-promise','path','./chatQueue.attributes','define','ChatQueue','lodash','api'];(function(_0x10b44f,_0x12b994){var _0x3b0325=function(_0x3f33c7){while(--_0x3f33c7){_0x10b44f['push'](_0x10b44f['shift']());}};_0x3b0325(++_0x12b994);}(_0x981a,0x1db));var _0xa981=function(_0x11406e,_0x681277){_0x11406e=_0x11406e-0x0;var _0x3ee71c=_0x981a[_0x11406e];return _0x3ee71c;};'use strict';var _=require(_0xa981('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa981('0x1'));var moment=require(_0xa981('0x2'));var BPromise=require(_0xa981('0x3'));var rp=require(_0xa981('0x4'));var fs=require('fs');var path=require(_0xa981('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa981('0x6'));module['exports']=function(_0xf15e6,_0xfccc60){return _0xf15e6[_0xa981('0x7')](_0xa981('0x8'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x664f=['../../config/logger','moment','bluebird','request-promise','path','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util'];(function(_0x7986a2,_0x2967e0){var _0x23c61a=function(_0x52c17d){while(--_0x52c17d){_0x7986a2['push'](_0x7986a2['shift']());}};_0x23c61a(++_0x2967e0);}(_0x664f,0x14e));var _0xf664=function(_0x9ffdd8,_0x414bbd){_0x9ffdd8=_0x9ffdd8-0x0;var _0x222710=_0x664f[_0x9ffdd8];return _0x222710;};'use strict';var _=require(_0xf664('0x0'));var util=require(_0xf664('0x1'));var logger=require(_0xf664('0x2'))('api');var moment=require(_0xf664('0x3'));var BPromise=require(_0xf664('0x4'));var rp=require(_0xf664('0x5'));var fs=require('fs');var path=require(_0xf664('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf664('0x7'));module[_0xf664('0x8')]=function(_0x5e9af2,_0x5a8737){return _0x5e9af2[_0xf664('0x9')](_0xf664('0xa'),attributes,{'tableName':_0xf664('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index 9ba575e..3a6b36b 100644 --- a/server/api/chatQueue/chatQueue.rpc.js +++ b/server/api/chatQueue/chatQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6b20=['message','catch','GetChatQueue','ChatQueue','findAll','options','raw','attributes','include','model','map','then','ShowChatQueue','where','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x6b20,0xd1));var _0x06b2=function(_0xe396bc,_0x477b9d){_0xe396bc=_0xe396bc-0x0;var _0x31f195=_0x6b20[_0xe396bc];return _0x31f195;};'use strict';var _=require(_0x06b2('0x0'));var util=require(_0x06b2('0x1'));var moment=require('moment');var BPromise=require(_0x06b2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x06b2('0x3'));var db=require(_0x06b2('0x4'))['db'];var utils=require(_0x06b2('0x5'));var logger=require('../../config/logger')(_0x06b2('0x6'));var config=require(_0x06b2('0x7'));var jayson=require(_0x06b2('0x8'));var client=jayson[_0x06b2('0x9')][_0x06b2('0xa')]({'port':0x232a});config[_0x06b2('0xb')]=_[_0x06b2('0xc')](config['redis'],{'host':_0x06b2('0xd'),'port':0x18eb});var socket=require(_0x06b2('0xe'))(new Redis(config[_0x06b2('0xb')]));require('./chatQueue.socket')[_0x06b2('0xf')](socket);function respondWithRpcPromise(_0x57f854,_0x2cc28f,_0x4da705){return new BPromise(function(_0x552cd8,_0x301519){return client[_0x06b2('0x10')](_0x57f854,_0x4da705)['then'](function(_0x182f8f){logger[_0x06b2('0x11')](_0x06b2('0x12'),_0x2cc28f,_0x06b2('0x13'));logger[_0x06b2('0x14')](_0x06b2('0x15'),_0x2cc28f,_0x06b2('0x13'),JSON[_0x06b2('0x16')](_0x182f8f));if(_0x182f8f[_0x06b2('0x17')]){if(_0x182f8f[_0x06b2('0x17')][_0x06b2('0x18')]===0x1f4){logger[_0x06b2('0x17')](_0x06b2('0x12'),_0x2cc28f,_0x182f8f['error'][_0x06b2('0x19')]);return _0x301519(_0x182f8f[_0x06b2('0x17')][_0x06b2('0x19')]);}logger[_0x06b2('0x17')](_0x06b2('0x12'),_0x2cc28f,_0x182f8f[_0x06b2('0x17')]['message']);return _0x552cd8(_0x182f8f[_0x06b2('0x17')][_0x06b2('0x19')]);}else{logger['info'](_0x06b2('0x12'),_0x2cc28f,'request\x20sent');_0x552cd8(_0x182f8f['result'][_0x06b2('0x19')]);}})[_0x06b2('0x1a')](function(_0x27852e){logger[_0x06b2('0x17')]('ChatQueue,\x20%s,\x20%s',_0x2cc28f,_0x27852e);_0x301519(_0x27852e);});});}exports[_0x06b2('0x1b')]=function(_0x39b309){var _0x18f55b=this;return new Promise(function(_0x465325,_0xe28985){return db[_0x06b2('0x1c')][_0x06b2('0x1d')]({'raw':_0x39b309['options']?_0x39b309[_0x06b2('0x1e')][_0x06b2('0x1f')]===undefined?!![]:![]:!![],'where':_0x39b309[_0x06b2('0x1e')]?_0x39b309[_0x06b2('0x1e')]['where']||null:null,'attributes':_0x39b309['options']?_0x39b309[_0x06b2('0x1e')][_0x06b2('0x20')]||null:null,'limit':_0x39b309['options']?_0x39b309[_0x06b2('0x1e')]['limit']||null:null,'include':_0x39b309[_0x06b2('0x1e')]?_0x39b309[_0x06b2('0x1e')][_0x06b2('0x21')]?_['map'](_0x39b309[_0x06b2('0x1e')][_0x06b2('0x21')],function(_0xc65820){return{'model':db[_0xc65820[_0x06b2('0x22')]],'as':_0xc65820['as'],'attributes':_0xc65820[_0x06b2('0x20')],'include':_0xc65820['include']?_[_0x06b2('0x23')](_0xc65820[_0x06b2('0x21')],function(_0x40a73f){return{'model':db[_0x40a73f[_0x06b2('0x22')]],'as':_0x40a73f['as'],'attributes':_0x40a73f[_0x06b2('0x20')],'include':_0x40a73f[_0x06b2('0x21')]?_['map'](_0x40a73f[_0x06b2('0x21')],function(_0x2a3228){return{'model':db[_0x2a3228[_0x06b2('0x22')]],'as':_0x2a3228['as'],'attributes':_0x2a3228[_0x06b2('0x20')]};}):[]};}):[]};}):[]:[]})[_0x06b2('0x24')](function(_0x1bfaa9){logger[_0x06b2('0x11')]('GetChatQueue',_0x39b309);logger[_0x06b2('0x14')](_0x06b2('0x1b'),_0x39b309,JSON[_0x06b2('0x16')](_0x1bfaa9));_0x465325(_0x1bfaa9);})[_0x06b2('0x1a')](function(_0x1cc725){logger[_0x06b2('0x17')](_0x06b2('0x1b'),_0x1cc725[_0x06b2('0x19')],_0x39b309);_0xe28985(_0x18f55b['error'](0x1f4,_0x1cc725[_0x06b2('0x19')]));});});};exports[_0x06b2('0x25')]=function(_0x259e3d){var _0x438c16=this;return new Promise(function(_0x7a7cd7,_0x422393){return db[_0x06b2('0x1c')]['find']({'raw':_0x259e3d['options']?_0x259e3d[_0x06b2('0x1e')][_0x06b2('0x1f')]===undefined?!![]:![]:!![],'where':_0x259e3d[_0x06b2('0x1e')]?_0x259e3d['options'][_0x06b2('0x26')]||null:null,'attributes':_0x259e3d[_0x06b2('0x1e')]?_0x259e3d[_0x06b2('0x1e')][_0x06b2('0x20')]||null:null,'include':_0x259e3d[_0x06b2('0x1e')]?_0x259e3d[_0x06b2('0x1e')]['include']?_[_0x06b2('0x23')](_0x259e3d[_0x06b2('0x1e')][_0x06b2('0x21')],function(_0x4b9b83){return{'model':db[_0x4b9b83[_0x06b2('0x22')]],'as':_0x4b9b83['as'],'attributes':_0x4b9b83[_0x06b2('0x20')],'include':_0x4b9b83['include']?_[_0x06b2('0x23')](_0x4b9b83[_0x06b2('0x21')],function(_0x8d3648){return{'model':db[_0x8d3648[_0x06b2('0x22')]],'as':_0x8d3648['as'],'attributes':_0x8d3648[_0x06b2('0x20')],'include':_0x8d3648[_0x06b2('0x21')]?_[_0x06b2('0x23')](_0x8d3648[_0x06b2('0x21')],function(_0x22e77a){return{'model':db[_0x22e77a[_0x06b2('0x22')]],'as':_0x22e77a['as'],'attributes':_0x22e77a[_0x06b2('0x20')]};}):[]};}):[]};}):[]:[]})[_0x06b2('0x24')](function(_0x5ec05d){logger[_0x06b2('0x11')]('ShowChatQueue',_0x259e3d);logger['debug'](_0x06b2('0x25'),_0x259e3d,JSON['stringify'](_0x5ec05d));_0x7a7cd7(_0x5ec05d);})[_0x06b2('0x1a')](function(_0x5313a5){logger[_0x06b2('0x17')](_0x06b2('0x25'),_0x5313a5[_0x06b2('0x19')],_0x259e3d);_0x422393(_0x438c16[_0x06b2('0x17')](0x1f4,_0x5313a5[_0x06b2('0x19')]));});});}; \ No newline at end of file +var _0x40a3=['options','where','limit','include','map','model','attributes','GetChatQueue','ShowChatQueue','find','then','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','ChatQueue','findAll','raw'];(function(_0x19dde2,_0xded705){var _0x224424=function(_0x224260){while(--_0x224260){_0x19dde2['push'](_0x19dde2['shift']());}};_0x224424(++_0xded705);}(_0x40a3,0x153));var _0x340a=function(_0x3259e2,_0x153d84){_0x3259e2=_0x3259e2-0x0;var _0x127b72=_0x40a3[_0x3259e2];return _0x127b72;};'use strict';var _=require(_0x340a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x340a('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x340a('0x2'))['db'];var utils=require(_0x340a('0x3'));var logger=require(_0x340a('0x4'))(_0x340a('0x5'));var config=require(_0x340a('0x6'));var jayson=require(_0x340a('0x7'));var client=jayson[_0x340a('0x8')]['http']({'port':0x232a});config[_0x340a('0x9')]=_[_0x340a('0xa')](config['redis'],{'host':_0x340a('0xb'),'port':0x18eb});var socket=require(_0x340a('0xc'))(new Redis(config[_0x340a('0x9')]));require(_0x340a('0xd'))[_0x340a('0xe')](socket);function respondWithRpcPromise(_0x4895a3,_0x36ea9b,_0x135421){return new BPromise(function(_0x7eb940,_0x5a92bb){return client[_0x340a('0xf')](_0x4895a3,_0x135421)['then'](function(_0x2e0b3d){logger[_0x340a('0x10')]('ChatQueue,\x20%s,\x20%s',_0x36ea9b,_0x340a('0x11'));logger[_0x340a('0x12')](_0x340a('0x13'),_0x36ea9b,_0x340a('0x11'),JSON[_0x340a('0x14')](_0x2e0b3d));if(_0x2e0b3d[_0x340a('0x15')]){if(_0x2e0b3d[_0x340a('0x15')][_0x340a('0x16')]===0x1f4){logger[_0x340a('0x15')](_0x340a('0x17'),_0x36ea9b,_0x2e0b3d[_0x340a('0x15')][_0x340a('0x18')]);return _0x5a92bb(_0x2e0b3d[_0x340a('0x15')][_0x340a('0x18')]);}logger[_0x340a('0x15')]('ChatQueue,\x20%s,\x20%s',_0x36ea9b,_0x2e0b3d[_0x340a('0x15')]['message']);return _0x7eb940(_0x2e0b3d['error'][_0x340a('0x18')]);}else{logger[_0x340a('0x10')](_0x340a('0x17'),_0x36ea9b,_0x340a('0x11'));_0x7eb940(_0x2e0b3d[_0x340a('0x19')][_0x340a('0x18')]);}})[_0x340a('0x1a')](function(_0x16c923){logger[_0x340a('0x15')](_0x340a('0x17'),_0x36ea9b,_0x16c923);_0x5a92bb(_0x16c923);});});}exports['GetChatQueue']=function(_0x15489e){var _0x53bdf7=this;return new Promise(function(_0x393551,_0x30f383){return db[_0x340a('0x1b')][_0x340a('0x1c')]({'raw':_0x15489e['options']?_0x15489e['options'][_0x340a('0x1d')]===undefined?!![]:![]:!![],'where':_0x15489e[_0x340a('0x1e')]?_0x15489e['options'][_0x340a('0x1f')]||null:null,'attributes':_0x15489e[_0x340a('0x1e')]?_0x15489e[_0x340a('0x1e')]['attributes']||null:null,'limit':_0x15489e['options']?_0x15489e[_0x340a('0x1e')][_0x340a('0x20')]||null:null,'include':_0x15489e['options']?_0x15489e[_0x340a('0x1e')][_0x340a('0x21')]?_[_0x340a('0x22')](_0x15489e[_0x340a('0x1e')][_0x340a('0x21')],function(_0x2d0be0){return{'model':db[_0x2d0be0[_0x340a('0x23')]],'as':_0x2d0be0['as'],'attributes':_0x2d0be0[_0x340a('0x24')],'include':_0x2d0be0[_0x340a('0x21')]?_['map'](_0x2d0be0[_0x340a('0x21')],function(_0x4c59ff){return{'model':db[_0x4c59ff[_0x340a('0x23')]],'as':_0x4c59ff['as'],'attributes':_0x4c59ff[_0x340a('0x24')],'include':_0x4c59ff['include']?_['map'](_0x4c59ff['include'],function(_0x151a15){return{'model':db[_0x151a15[_0x340a('0x23')]],'as':_0x151a15['as'],'attributes':_0x151a15[_0x340a('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29c4c0){logger[_0x340a('0x10')]('GetChatQueue',_0x15489e);logger[_0x340a('0x12')](_0x340a('0x25'),_0x15489e,JSON[_0x340a('0x14')](_0x29c4c0));_0x393551(_0x29c4c0);})[_0x340a('0x1a')](function(_0x3ad80f){logger[_0x340a('0x15')]('GetChatQueue',_0x3ad80f[_0x340a('0x18')],_0x15489e);_0x30f383(_0x53bdf7[_0x340a('0x15')](0x1f4,_0x3ad80f[_0x340a('0x18')]));});});};exports[_0x340a('0x26')]=function(_0x4248c3){var _0x3bb7b5=this;return new Promise(function(_0x35d569,_0x140189){return db[_0x340a('0x1b')][_0x340a('0x27')]({'raw':_0x4248c3['options']?_0x4248c3[_0x340a('0x1e')][_0x340a('0x1d')]===undefined?!![]:![]:!![],'where':_0x4248c3[_0x340a('0x1e')]?_0x4248c3[_0x340a('0x1e')]['where']||null:null,'attributes':_0x4248c3[_0x340a('0x1e')]?_0x4248c3['options'][_0x340a('0x24')]||null:null,'include':_0x4248c3['options']?_0x4248c3[_0x340a('0x1e')]['include']?_['map'](_0x4248c3[_0x340a('0x1e')]['include'],function(_0x25a550){return{'model':db[_0x25a550[_0x340a('0x23')]],'as':_0x25a550['as'],'attributes':_0x25a550[_0x340a('0x24')],'include':_0x25a550[_0x340a('0x21')]?_['map'](_0x25a550['include'],function(_0x51ebb7){return{'model':db[_0x51ebb7[_0x340a('0x23')]],'as':_0x51ebb7['as'],'attributes':_0x51ebb7[_0x340a('0x24')],'include':_0x51ebb7['include']?_['map'](_0x51ebb7[_0x340a('0x21')],function(_0x45d63f){return{'model':db[_0x45d63f['model']],'as':_0x45d63f['as'],'attributes':_0x45d63f[_0x340a('0x24')]};}):[]};}):[]};}):[]:[]})[_0x340a('0x28')](function(_0x10daa3){logger[_0x340a('0x10')](_0x340a('0x26'),_0x4248c3);logger[_0x340a('0x12')](_0x340a('0x26'),_0x4248c3,JSON[_0x340a('0x14')](_0x10daa3));_0x35d569(_0x10daa3);})[_0x340a('0x1a')](function(_0x8f0903){logger[_0x340a('0x15')](_0x340a('0x26'),_0x8f0903[_0x340a('0x18')],_0x4248c3);_0x140189(_0x3bb7b5['error'](0x1f4,_0x8f0903[_0x340a('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index b1a9d96..ad33252 100644 --- a/server/api/chatQueue/chatQueue.socket.js +++ b/server/api/chatQueue/chatQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f0d=['update','emit','removeListener','length','save','remove'];(function(_0x5828d0,_0x2c3e93){var _0x239b02=function(_0x702fe4){while(--_0x702fe4){_0x5828d0['push'](_0x5828d0['shift']());}};_0x239b02(++_0x2c3e93);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x19f7a5,_0x4b7eb3){_0x19f7a5=_0x19f7a5-0x0;var _0x172e23=_0x6f0d[_0x19f7a5];return _0x172e23;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0xd6f0('0x0'),_0xd6f0('0x1'),_0xd6f0('0x2')];function createListener(_0x107a8c,_0x573473){return function(_0x275230){_0x573473[_0xd6f0('0x3')](_0x107a8c,_0x275230);};}function removeListener(_0x2f78fb,_0x25344b){return function(){ChatQueueEvents[_0xd6f0('0x4')](_0x2f78fb,_0x25344b);};}exports['register']=function(_0x2d2ce6){for(var _0x4a8b0c=0x0,_0xe21ac4=events[_0xd6f0('0x5')];_0x4a8b0c<_0xe21ac4;_0x4a8b0c++){var _0x8b89a9=events[_0x4a8b0c];var _0x1a48a0=createListener('chatQueue:'+_0x8b89a9,_0x2d2ce6);ChatQueueEvents['on'](_0x8b89a9,_0x1a48a0);}}; \ No newline at end of file +var _0xbec5=['emit','removeListener','register','length','chatQueue:','./chatQueue.events','save','update'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xbec5,0xe5));var _0x5bec=function(_0x29632e,_0x5ecba4){_0x29632e=_0x29632e-0x0;var _0x426e04=_0xbec5[_0x29632e];return _0x426e04;};'use strict';var ChatQueueEvents=require(_0x5bec('0x0'));var events=[_0x5bec('0x1'),'remove',_0x5bec('0x2')];function createListener(_0x38c81a,_0x276b9e){return function(_0x3859a1){_0x276b9e[_0x5bec('0x3')](_0x38c81a,_0x3859a1);};}function removeListener(_0x4ee982,_0x1f8933){return function(){ChatQueueEvents[_0x5bec('0x4')](_0x4ee982,_0x1f8933);};}exports[_0x5bec('0x5')]=function(_0x4aaac6){for(var _0x3ed67a=0x0,_0x28a427=events[_0x5bec('0x6')];_0x3ed67a<_0x28a427;_0x3ed67a++){var _0x406e65=events[_0x3ed67a];var _0x43d96e=createListener(_0x5bec('0x7')+_0x406e65,_0x4aaac6);ChatQueueEvents['on'](_0x406e65,_0x43d96e);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index d8195f8..b3b0f6f 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x3e74,0x175));var _0x43e7=function(_0x380682,_0x5f5bb8){_0x380682=_0x380682-0x0;var _0x1800c2=_0x3e74[_0x380682];return _0x1800c2;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x2c3919,_0x46d781){var _0x11f383=function(_0x17611c){while(--_0x17611c){_0x2c3919['push'](_0x2c3919['shift']());}};_0x11f383(++_0x46d781);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 7e4af23..75a1381 100644 --- a/server/api/chatQueueReport/chatQueueReport.attributes.js +++ b/server/api/chatQueueReport/chatQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1cf4=['STRING','DATE','moment'];(function(_0xc56144,_0x5d23ef){var _0x1252de=function(_0x2373c0){while(--_0x2373c0){_0xc56144['push'](_0xc56144['shift']());}};_0x1252de(++_0x5d23ef);}(_0x1cf4,0xbf));var _0x41cf=function(_0x3b3767,_0x22856b){_0x3b3767=_0x3b3767-0x0;var _0x2b3863=_0x1cf4[_0x3b3767];return _0x2b3863;};'use strict';var moment=require(_0x41cf('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x41cf('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x41cf('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x41cf('0x2')]},'acceptAt':{'type':Sequelize[_0x41cf('0x2')]},'exitAt':{'type':Sequelize[_0x41cf('0x2')]},'reason':{'type':Sequelize[_0x41cf('0x1')]}}; \ No newline at end of file +var _0x687d=['DATE','moment','sequelize','exports','STRING'];(function(_0x2e0bd8,_0x11e41d){var _0x5cb4b5=function(_0x416739){while(--_0x416739){_0x2e0bd8['push'](_0x2e0bd8['shift']());}};_0x5cb4b5(++_0x11e41d);}(_0x687d,0x187));var _0xd687=function(_0x426b48,_0x595c31){_0x426b48=_0x426b48-0x0;var _0x31004d=_0x687d[_0x426b48];return _0x31004d;};'use strict';var moment=require(_0xd687('0x0'));var Sequelize=require(_0xd687('0x1'));module[_0xd687('0x2')]={'uniqueid':{'type':Sequelize[_0xd687('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xd687('0x4')]},'acceptAt':{'type':Sequelize[_0xd687('0x4')]},'exitAt':{'type':Sequelize[_0xd687('0x4')]},'reason':{'type':Sequelize[_0xd687('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 372651a..f5437c2 100644 --- a/server/api/chatQueueReport/chatQueueReport.controller.js +++ b/server/api/chatQueueReport/chatQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6c14=['../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','rows','catch','params','keys','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x1a1bf9,_0x30ded7){var _0x55e193=function(_0xbe5ee5){while(--_0xbe5ee5){_0x1a1bf9['push'](_0x1a1bf9['shift']());}};_0x55e193(++_0x30ded7);}(_0x6c14,0xd1));var _0x46c1=function(_0x263257,_0x30d269){_0x263257=_0x263257-0x0;var _0x32516d=_0x6c14[_0x263257];return _0x32516d;};'use strict';var emlformat=require(_0x46c1('0x0'));var rimraf=require(_0x46c1('0x1'));var zipdir=require(_0x46c1('0x2'));var jsonpatch=require(_0x46c1('0x3'));var rp=require(_0x46c1('0x4'));var moment=require('moment');var BPromise=require(_0x46c1('0x5'));var Mustache=require(_0x46c1('0x6'));var util=require(_0x46c1('0x7'));var path=require('path');var sox=require(_0x46c1('0x8'));var csv=require(_0x46c1('0x9'));var ejs=require(_0x46c1('0xa'));var fs=require('fs');var fs_extra=require(_0x46c1('0xb'));var _=require(_0x46c1('0xc'));var squel=require(_0x46c1('0xd'));var crypto=require(_0x46c1('0xe'));var jsforce=require(_0x46c1('0xf'));var deskjs=require(_0x46c1('0x10'));var toCsv=require('to-csv');var querystring=require(_0x46c1('0x11'));var Papa=require(_0x46c1('0x12'));var Redis=require(_0x46c1('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x46c1('0x14'));var as=require(_0x46c1('0x15'));var hardwareService=require(_0x46c1('0x16'));var logger=require('../../config/logger')(_0x46c1('0x17'));var utils=require(_0x46c1('0x18'));var config=require(_0x46c1('0x19'));var licenseUtil=require(_0x46c1('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c8a7c,_0x24626f){_0x24626f=_0x24626f||0xcc;return function(_0x52af54){if(_0x52af54){return _0x2c8a7c['sendStatus'](_0x24626f);}return _0x2c8a7c[_0x46c1('0x1b')](_0x24626f)[_0x46c1('0x1c')]();};}function respondWithResult(_0xa10462,_0x228380){_0x228380=_0x228380||0xc8;return function(_0x12437d){if(_0x12437d){return _0xa10462['status'](_0x228380)[_0x46c1('0x1d')](_0x12437d);}};}function respondWithFilteredResult(_0x3033a6,_0x221905){return function(_0x414a3f){if(_0x414a3f){var _0x3ce709=typeof _0x221905['offset']==='undefined'&&typeof _0x221905[_0x46c1('0x1e')]===_0x46c1('0x1f');var _0xad4a1b=_0x414a3f[_0x46c1('0x20')];var _0x466899=_0x3ce709?0x0:_0x221905[_0x46c1('0x21')];var _0x2ec920=_0x3ce709?_0x414a3f['count']:_0x221905[_0x46c1('0x21')]+_0x221905[_0x46c1('0x1e')];var _0x537a9d;if(_0x2ec920>=_0xad4a1b){_0x2ec920=_0xad4a1b;_0x537a9d=0xc8;}else{_0x537a9d=0xce;}_0x3033a6['status'](_0x537a9d);return _0x3033a6[_0x46c1('0x22')]('Content-Range',_0x466899+'-'+_0x2ec920+'/'+_0xad4a1b)['json'](_0x414a3f);}return null;};}function patchUpdates(_0x301c0c){return function(_0xfc1f36){try{jsonpatch[_0x46c1('0x23')](_0xfc1f36,_0x301c0c,!![]);}catch(_0x261c6d){return BPromise[_0x46c1('0x24')](_0x261c6d);}return _0xfc1f36[_0x46c1('0x25')]();};}function saveUpdates(_0x3768e9,_0x21e02d){return function(_0x3db7b1){if(_0x3db7b1){return _0x3db7b1[_0x46c1('0x26')](_0x3768e9)[_0x46c1('0x27')](function(_0x217c2c){return _0x217c2c;});}return null;};}function removeEntity(_0x12ce45,_0x712eb8){return function(_0x37fa8c){if(_0x37fa8c){return _0x37fa8c[_0x46c1('0x28')]()[_0x46c1('0x27')](function(){_0x12ce45[_0x46c1('0x1b')](0xcc)[_0x46c1('0x1c')]();});}};}function handleEntityNotFound(_0x361c66,_0x4209e6){return function(_0x2924b8){if(!_0x2924b8){_0x361c66[_0x46c1('0x29')](0x194);}return _0x2924b8;};}function handleError(_0x552932,_0x4aacea){_0x4aacea=_0x4aacea||0x1f4;return function(_0xa8b66e){logger[_0x46c1('0x2a')](_0xa8b66e['stack']);if(_0xa8b66e[_0x46c1('0x2b')]){delete _0xa8b66e[_0x46c1('0x2b')];}_0x552932[_0x46c1('0x1b')](_0x4aacea)[_0x46c1('0x2c')](_0xa8b66e);};}exports[_0x46c1('0x2d')]=function(_0x3fdaea,_0x4d646d){var _0x114048={},_0x4475f7={},_0x32f553={'count':0x0,'rows':[]};var _0x187ecf=_[_0x46c1('0x2e')](db[_0x46c1('0x2f')][_0x46c1('0x30')],function(_0x55b4e6){return{'name':_0x55b4e6[_0x46c1('0x31')],'type':_0x55b4e6['type'][_0x46c1('0x32')]};});_0x4475f7[_0x46c1('0x33')]=_[_0x46c1('0x2e')](_0x187ecf,_0x46c1('0x2b'));_0x4475f7['query']=_['keys'](_0x3fdaea[_0x46c1('0x34')]);_0x4475f7[_0x46c1('0x35')]=_['intersection'](_0x4475f7[_0x46c1('0x33')],_0x4475f7[_0x46c1('0x34')]);_0x114048[_0x46c1('0x36')]=_[_0x46c1('0x37')](_0x4475f7['model'],qs[_0x46c1('0x38')](_0x3fdaea[_0x46c1('0x34')]['fields']));_0x114048[_0x46c1('0x36')]=_0x114048['attributes'][_0x46c1('0x39')]?_0x114048[_0x46c1('0x36')]:_0x4475f7[_0x46c1('0x33')];if(!_0x3fdaea[_0x46c1('0x34')][_0x46c1('0x3a')](_0x46c1('0x3b'))){_0x114048['limit']=qs['limit'](_0x3fdaea[_0x46c1('0x34')]['limit']);_0x114048[_0x46c1('0x21')]=qs['offset'](_0x3fdaea['query'][_0x46c1('0x21')]);}_0x114048[_0x46c1('0x3c')]=qs[_0x46c1('0x3d')](_0x3fdaea['query'][_0x46c1('0x3d')]);_0x114048[_0x46c1('0x3e')]=qs[_0x46c1('0x35')](_['pick'](_0x3fdaea[_0x46c1('0x34')],_0x4475f7[_0x46c1('0x35')]),_0x187ecf);if(_0x3fdaea[_0x46c1('0x34')][_0x46c1('0x3f')]){_0x114048[_0x46c1('0x3e')]=_[_0x46c1('0x40')](_0x114048[_0x46c1('0x3e')],{'$or':_[_0x46c1('0x2e')](_0x187ecf,function(_0x114ed3){if(_0x114ed3['type']!==_0x46c1('0x41')){var _0x3db8f1={};_0x3db8f1[_0x114ed3[_0x46c1('0x2b')]]={'$like':'%'+_0x3fdaea[_0x46c1('0x34')][_0x46c1('0x3f')]+'%'};return _0x3db8f1;}})});}_0x114048=_[_0x46c1('0x40')]({},_0x114048,_0x3fdaea['options']);var _0x102f12={'where':_0x114048['where']};return db[_0x46c1('0x2f')][_0x46c1('0x20')](_0x102f12)[_0x46c1('0x27')](function(_0x4c237b){_0x32f553[_0x46c1('0x20')]=_0x4c237b;if(_0x3fdaea['query'][_0x46c1('0x42')]){_0x114048[_0x46c1('0x43')]=[{'all':!![]}];}return db['ChatQueueReport']['findAll'](_0x114048);})[_0x46c1('0x27')](function(_0x520f5d){_0x32f553[_0x46c1('0x44')]=_0x520f5d;return _0x32f553;})[_0x46c1('0x27')](respondWithFilteredResult(_0x4d646d,_0x114048))[_0x46c1('0x45')](handleError(_0x4d646d,null));};exports['show']=function(_0x1228d8,_0x4571ed){var _0x5bc21c={'raw':!![],'where':{'id':_0x1228d8[_0x46c1('0x46')]['id']}},_0x171db5={};_0x171db5['model']=_['keys'](db[_0x46c1('0x2f')]['rawAttributes']);_0x171db5[_0x46c1('0x34')]=_[_0x46c1('0x47')](_0x1228d8[_0x46c1('0x34')]);_0x171db5[_0x46c1('0x35')]=_['intersection'](_0x171db5['model'],_0x171db5[_0x46c1('0x34')]);_0x5bc21c[_0x46c1('0x36')]=_[_0x46c1('0x37')](_0x171db5[_0x46c1('0x33')],qs['fields'](_0x1228d8[_0x46c1('0x34')]['fields']));_0x5bc21c['attributes']=_0x5bc21c[_0x46c1('0x36')][_0x46c1('0x39')]?_0x5bc21c['attributes']:_0x171db5[_0x46c1('0x33')];if(_0x1228d8[_0x46c1('0x34')][_0x46c1('0x42')]){_0x5bc21c[_0x46c1('0x43')]=[{'all':!![]}];}_0x5bc21c=_[_0x46c1('0x40')]({},_0x5bc21c,_0x1228d8[_0x46c1('0x48')]);return db['ChatQueueReport'][_0x46c1('0x49')](_0x5bc21c)[_0x46c1('0x27')](handleEntityNotFound(_0x4571ed,null))[_0x46c1('0x27')](respondWithResult(_0x4571ed,null))[_0x46c1('0x45')](handleError(_0x4571ed,null));};exports['create']=function(_0x362157,_0x3e3d7e){return db['ChatQueueReport'][_0x46c1('0x4a')](_0x362157[_0x46c1('0x4b')],{})['then'](respondWithResult(_0x3e3d7e,0xc9))['catch'](handleError(_0x3e3d7e,null));};exports[_0x46c1('0x26')]=function(_0x40aae9,_0x1911e7){if(_0x40aae9['body']['id']){delete _0x40aae9[_0x46c1('0x4b')]['id'];}return db[_0x46c1('0x2f')][_0x46c1('0x49')]({'where':{'id':_0x40aae9['params']['id']}})[_0x46c1('0x27')](handleEntityNotFound(_0x1911e7,null))[_0x46c1('0x27')](saveUpdates(_0x40aae9[_0x46c1('0x4b')],null))[_0x46c1('0x27')](respondWithResult(_0x1911e7,null))[_0x46c1('0x45')](handleError(_0x1911e7,null));};exports[_0x46c1('0x28')]=function(_0x39de88,_0x3194e6){return db[_0x46c1('0x2f')][_0x46c1('0x49')]({'where':{'id':_0x39de88[_0x46c1('0x46')]['id']}})[_0x46c1('0x27')](handleEntityNotFound(_0x3194e6,null))[_0x46c1('0x27')](removeEntity(_0x3194e6,null))[_0x46c1('0x45')](handleError(_0x3194e6,null));};exports[_0x46c1('0x4c')]=function(_0x359425,_0x2a53cb){return db['ChatQueueReport'][_0x46c1('0x4c')]()[_0x46c1('0x27')](respondWithResult(_0x2a53cb,null))[_0x46c1('0x45')](handleError(_0x2a53cb,null));}; \ No newline at end of file +var _0x7409=['then','destroy','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','ChatQueueReport','includeAll','include','findAll','rows','catch','merge','options','create','body','find','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','end','json','offset','limit','undefined','count','status','set','Content-Range','apply','reject','update'];(function(_0x39d35c,_0x338b41){var _0x35d0ed=function(_0x41c62e){while(--_0x41c62e){_0x39d35c['push'](_0x39d35c['shift']());}};_0x35d0ed(++_0x338b41);}(_0x7409,0x6e));var _0x9740=function(_0x5938c8,_0x4a9ca){_0x5938c8=_0x5938c8-0x0;var _0x4353f7=_0x7409[_0x5938c8];return _0x4353f7;};'use strict';var emlformat=require(_0x9740('0x0'));var rimraf=require(_0x9740('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9740('0x2'));var rp=require(_0x9740('0x3'));var moment=require(_0x9740('0x4'));var BPromise=require(_0x9740('0x5'));var Mustache=require(_0x9740('0x6'));var util=require(_0x9740('0x7'));var path=require(_0x9740('0x8'));var sox=require(_0x9740('0x9'));var csv=require(_0x9740('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9740('0xb'));var _=require(_0x9740('0xc'));var squel=require(_0x9740('0xd'));var crypto=require('crypto');var jsforce=require(_0x9740('0xe'));var deskjs=require(_0x9740('0xf'));var toCsv=require(_0x9740('0xa'));var querystring=require('querystring');var Papa=require(_0x9740('0x10'));var Redis=require('ioredis');var authService=require(_0x9740('0x11'));var qs=require(_0x9740('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9740('0x13'));var utils=require(_0x9740('0x14'));var config=require(_0x9740('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5263b3,_0x5a6773){_0x5a6773=_0x5a6773||0xcc;return function(_0x4adaae){if(_0x4adaae){return _0x5263b3['sendStatus'](_0x5a6773);}return _0x5263b3['status'](_0x5a6773)[_0x9740('0x16')]();};}function respondWithResult(_0x4d50ad,_0x495051){_0x495051=_0x495051||0xc8;return function(_0x12f130){if(_0x12f130){return _0x4d50ad['status'](_0x495051)[_0x9740('0x17')](_0x12f130);}};}function respondWithFilteredResult(_0x1d4aa8,_0x3c20ec){return function(_0x217a52){if(_0x217a52){var _0x480af9=typeof _0x3c20ec[_0x9740('0x18')]==='undefined'&&typeof _0x3c20ec[_0x9740('0x19')]===_0x9740('0x1a');var _0x8bf9df=_0x217a52[_0x9740('0x1b')];var _0x22843a=_0x480af9?0x0:_0x3c20ec[_0x9740('0x18')];var _0xd5d590=_0x480af9?_0x217a52[_0x9740('0x1b')]:_0x3c20ec[_0x9740('0x18')]+_0x3c20ec['limit'];var _0x28e655;if(_0xd5d590>=_0x8bf9df){_0xd5d590=_0x8bf9df;_0x28e655=0xc8;}else{_0x28e655=0xce;}_0x1d4aa8[_0x9740('0x1c')](_0x28e655);return _0x1d4aa8[_0x9740('0x1d')](_0x9740('0x1e'),_0x22843a+'-'+_0xd5d590+'/'+_0x8bf9df)[_0x9740('0x17')](_0x217a52);}return null;};}function patchUpdates(_0xdf62fc){return function(_0x3a785c){try{jsonpatch[_0x9740('0x1f')](_0x3a785c,_0xdf62fc,!![]);}catch(_0x56766c){return BPromise[_0x9740('0x20')](_0x56766c);}return _0x3a785c['save']();};}function saveUpdates(_0x1f8a78,_0x46d768){return function(_0x1af88e){if(_0x1af88e){return _0x1af88e[_0x9740('0x21')](_0x1f8a78)[_0x9740('0x22')](function(_0x34af43){return _0x34af43;});}return null;};}function removeEntity(_0x4e4627,_0x2550f2){return function(_0x192ab9){if(_0x192ab9){return _0x192ab9[_0x9740('0x23')]()[_0x9740('0x22')](function(){_0x4e4627[_0x9740('0x1c')](0xcc)[_0x9740('0x16')]();});}};}function handleEntityNotFound(_0x15aa2f,_0x278510){return function(_0x11ee90){if(!_0x11ee90){_0x15aa2f['sendStatus'](0x194);}return _0x11ee90;};}function handleError(_0xfb0753,_0x577323){_0x577323=_0x577323||0x1f4;return function(_0x4e5074){logger['error'](_0x4e5074['stack']);if(_0x4e5074[_0x9740('0x24')]){delete _0x4e5074[_0x9740('0x24')];}_0xfb0753[_0x9740('0x1c')](_0x577323)['send'](_0x4e5074);};}exports[_0x9740('0x25')]=function(_0x353630,_0x311e1b){var _0x4483a3={},_0x4cdccd={},_0x3bfa1f={'count':0x0,'rows':[]};var _0x3c826d=_[_0x9740('0x26')](db['ChatQueueReport'][_0x9740('0x27')],function(_0x3f6800){return{'name':_0x3f6800[_0x9740('0x28')],'type':_0x3f6800[_0x9740('0x29')][_0x9740('0x2a')]};});_0x4cdccd[_0x9740('0x2b')]=_[_0x9740('0x26')](_0x3c826d,_0x9740('0x24'));_0x4cdccd[_0x9740('0x2c')]=_[_0x9740('0x2d')](_0x353630['query']);_0x4cdccd[_0x9740('0x2e')]=_[_0x9740('0x2f')](_0x4cdccd[_0x9740('0x2b')],_0x4cdccd[_0x9740('0x2c')]);_0x4483a3[_0x9740('0x30')]=_[_0x9740('0x2f')](_0x4cdccd['model'],qs[_0x9740('0x31')](_0x353630['query']['fields']));_0x4483a3[_0x9740('0x30')]=_0x4483a3[_0x9740('0x30')][_0x9740('0x32')]?_0x4483a3[_0x9740('0x30')]:_0x4cdccd[_0x9740('0x2b')];if(!_0x353630['query'][_0x9740('0x33')](_0x9740('0x34'))){_0x4483a3[_0x9740('0x19')]=qs[_0x9740('0x19')](_0x353630[_0x9740('0x2c')][_0x9740('0x19')]);_0x4483a3[_0x9740('0x18')]=qs[_0x9740('0x18')](_0x353630[_0x9740('0x2c')][_0x9740('0x18')]);}_0x4483a3[_0x9740('0x35')]=qs[_0x9740('0x36')](_0x353630[_0x9740('0x2c')][_0x9740('0x36')]);_0x4483a3[_0x9740('0x37')]=qs[_0x9740('0x2e')](_[_0x9740('0x38')](_0x353630[_0x9740('0x2c')],_0x4cdccd[_0x9740('0x2e')]),_0x3c826d);if(_0x353630[_0x9740('0x2c')][_0x9740('0x39')]){_0x4483a3[_0x9740('0x37')]=_['merge'](_0x4483a3[_0x9740('0x37')],{'$or':_['map'](_0x3c826d,function(_0x221ff5){if(_0x221ff5[_0x9740('0x29')]!==_0x9740('0x3a')){var _0x3612a1={};_0x3612a1[_0x221ff5[_0x9740('0x24')]]={'$like':'%'+_0x353630[_0x9740('0x2c')][_0x9740('0x39')]+'%'};return _0x3612a1;}})});}_0x4483a3=_['merge']({},_0x4483a3,_0x353630['options']);var _0x54018a={'where':_0x4483a3[_0x9740('0x37')]};return db[_0x9740('0x3b')][_0x9740('0x1b')](_0x54018a)[_0x9740('0x22')](function(_0x38b1d9){_0x3bfa1f['count']=_0x38b1d9;if(_0x353630[_0x9740('0x2c')][_0x9740('0x3c')]){_0x4483a3[_0x9740('0x3d')]=[{'all':!![]}];}return db[_0x9740('0x3b')][_0x9740('0x3e')](_0x4483a3);})[_0x9740('0x22')](function(_0x4c5860){_0x3bfa1f[_0x9740('0x3f')]=_0x4c5860;return _0x3bfa1f;})[_0x9740('0x22')](respondWithFilteredResult(_0x311e1b,_0x4483a3))[_0x9740('0x40')](handleError(_0x311e1b,null));};exports['show']=function(_0x536b61,_0x62bf4e){var _0x199cd3={'raw':!![],'where':{'id':_0x536b61['params']['id']}},_0xcd85b3={};_0xcd85b3[_0x9740('0x2b')]=_[_0x9740('0x2d')](db[_0x9740('0x3b')]['rawAttributes']);_0xcd85b3[_0x9740('0x2c')]=_[_0x9740('0x2d')](_0x536b61[_0x9740('0x2c')]);_0xcd85b3[_0x9740('0x2e')]=_[_0x9740('0x2f')](_0xcd85b3['model'],_0xcd85b3[_0x9740('0x2c')]);_0x199cd3[_0x9740('0x30')]=_[_0x9740('0x2f')](_0xcd85b3['model'],qs[_0x9740('0x31')](_0x536b61[_0x9740('0x2c')]['fields']));_0x199cd3[_0x9740('0x30')]=_0x199cd3[_0x9740('0x30')][_0x9740('0x32')]?_0x199cd3[_0x9740('0x30')]:_0xcd85b3['model'];if(_0x536b61[_0x9740('0x2c')][_0x9740('0x3c')]){_0x199cd3[_0x9740('0x3d')]=[{'all':!![]}];}_0x199cd3=_[_0x9740('0x41')]({},_0x199cd3,_0x536b61[_0x9740('0x42')]);return db[_0x9740('0x3b')]['find'](_0x199cd3)[_0x9740('0x22')](handleEntityNotFound(_0x62bf4e,null))[_0x9740('0x22')](respondWithResult(_0x62bf4e,null))[_0x9740('0x40')](handleError(_0x62bf4e,null));};exports[_0x9740('0x43')]=function(_0x53e84b,_0x16d114){return db[_0x9740('0x3b')]['create'](_0x53e84b[_0x9740('0x44')],{})[_0x9740('0x22')](respondWithResult(_0x16d114,0xc9))[_0x9740('0x40')](handleError(_0x16d114,null));};exports['update']=function(_0xac3ed,_0x45df52){if(_0xac3ed[_0x9740('0x44')]['id']){delete _0xac3ed[_0x9740('0x44')]['id'];}return db[_0x9740('0x3b')][_0x9740('0x45')]({'where':{'id':_0xac3ed['params']['id']}})[_0x9740('0x22')](handleEntityNotFound(_0x45df52,null))[_0x9740('0x22')](saveUpdates(_0xac3ed[_0x9740('0x44')],null))[_0x9740('0x22')](respondWithResult(_0x45df52,null))['catch'](handleError(_0x45df52,null));};exports[_0x9740('0x23')]=function(_0x33e4e2,_0x41f7cb){return db['ChatQueueReport']['find']({'where':{'id':_0x33e4e2[_0x9740('0x46')]['id']}})[_0x9740('0x22')](handleEntityNotFound(_0x41f7cb,null))[_0x9740('0x22')](removeEntity(_0x41f7cb,null))['catch'](handleError(_0x41f7cb,null));};exports[_0x9740('0x47')]=function(_0x4f4c0f,_0x209d76){return db[_0x9740('0x3b')][_0x9740('0x47')]()[_0x9740('0x22')](respondWithResult(_0x209d76,null))[_0x9740('0x40')](handleError(_0x209d76,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index dd49790..13c8f8c 100644 --- a/server/api/chatQueueReport/chatQueueReport.model.js +++ b/server/api/chatQueueReport/chatQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x2384bb,_0x12f81b){var _0x3f2bac=function(_0x337ece){while(--_0x337ece){_0x2384bb['push'](_0x2384bb['shift']());}};_0x3f2bac(++_0x12f81b);}(_0xb10b,0x12a));var _0xbb10=function(_0x1045ef,_0xfea295){_0x1045ef=_0x1045ef-0x0;var _0x3e99f2=_0xb10b[_0x1045ef];return _0x3e99f2;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x268979,_0x1fce42){var _0x5df270=function(_0x10b61e){while(--_0x10b61e){_0x268979['push'](_0x268979['shift']());}};_0x5df270(++_0x1fce42);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index aeb7f5f..4f56cc8 100644 --- a/server/api/chatQueueReport/chatQueueReport.rpc.js +++ b/server/api/chatQueueReport/chatQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdba6=['CreateChatQueueReport','ChatQueueReport','create','body','options','raw','stringify','UpdateChatQueueReport','update','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','ChatQueueReport,\x20%s,\x20%s','message','result','catch'];(function(_0x637194,_0x430b89){var _0x330895=function(_0x2e0c24){while(--_0x2e0c24){_0x637194['push'](_0x637194['shift']());}};_0x330895(++_0x430b89);}(_0xdba6,0x169));var _0x6dba=function(_0x12c27a,_0x501e9a){_0x12c27a=_0x12c27a-0x0;var _0x2d5d1c=_0xdba6[_0x12c27a];return _0x2d5d1c;};'use strict';var _=require(_0x6dba('0x0'));var util=require(_0x6dba('0x1'));var moment=require(_0x6dba('0x2'));var BPromise=require(_0x6dba('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6dba('0x4'));var db=require(_0x6dba('0x5'))['db'];var utils=require(_0x6dba('0x6'));var logger=require(_0x6dba('0x7'))(_0x6dba('0x8'));var config=require('../../config/environment');var jayson=require(_0x6dba('0x9'));var client=jayson[_0x6dba('0xa')][_0x6dba('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2bfeb0,_0x975b58,_0x4bfecb){return new BPromise(function(_0x9c0e99,_0x198453){return client[_0x6dba('0xc')](_0x2bfeb0,_0x4bfecb)[_0x6dba('0xd')](function(_0x18cfb3){logger[_0x6dba('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x975b58,_0x6dba('0xf'));logger[_0x6dba('0x10')](_0x6dba('0x11'),_0x975b58,_0x6dba('0xf'),JSON['stringify'](_0x18cfb3));if(_0x18cfb3['error']){if(_0x18cfb3[_0x6dba('0x12')]['code']===0x1f4){logger[_0x6dba('0x12')](_0x6dba('0x13'),_0x975b58,_0x18cfb3[_0x6dba('0x12')][_0x6dba('0x14')]);return _0x198453(_0x18cfb3[_0x6dba('0x12')]['message']);}logger[_0x6dba('0x12')](_0x6dba('0x13'),_0x975b58,_0x18cfb3[_0x6dba('0x12')][_0x6dba('0x14')]);return _0x9c0e99(_0x18cfb3[_0x6dba('0x12')][_0x6dba('0x14')]);}else{logger[_0x6dba('0xe')](_0x6dba('0x13'),_0x975b58,_0x6dba('0xf'));_0x9c0e99(_0x18cfb3[_0x6dba('0x15')][_0x6dba('0x14')]);}})[_0x6dba('0x16')](function(_0x28d9a6){logger[_0x6dba('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x975b58,_0x28d9a6);_0x198453(_0x28d9a6);});});}exports[_0x6dba('0x17')]=function(_0x6a4787){var _0x40d0a2=this;return new Promise(function(_0x1da25c,_0x3e06a3){return db[_0x6dba('0x18')][_0x6dba('0x19')](_0x6a4787[_0x6dba('0x1a')],{'raw':_0x6a4787[_0x6dba('0x1b')]?_0x6a4787['options'][_0x6dba('0x1c')]===undefined?!![]:![]:!![]})[_0x6dba('0xd')](function(_0x278f39){logger[_0x6dba('0xe')](_0x6dba('0x17'),_0x6a4787);logger[_0x6dba('0x10')](_0x6dba('0x17'),_0x6a4787,JSON[_0x6dba('0x1d')](_0x278f39));_0x1da25c(_0x278f39);})[_0x6dba('0x16')](function(_0x1cb8cb){logger[_0x6dba('0x12')](_0x6dba('0x17'),_0x1cb8cb[_0x6dba('0x14')],_0x6a4787);_0x3e06a3(_0x40d0a2[_0x6dba('0x12')](0x1f4,_0x1cb8cb[_0x6dba('0x14')]));});});};exports[_0x6dba('0x1e')]=function(_0x247d46){var _0x1ae37c=this;return new Promise(function(_0x105a78,_0x10fabc){return db[_0x6dba('0x18')][_0x6dba('0x1f')](_0x247d46[_0x6dba('0x1a')],{'raw':_0x247d46['options']?_0x247d46['options'][_0x6dba('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x247d46[_0x6dba('0x1b')]?_0x247d46[_0x6dba('0x1b')]['where']||null:null,'attributes':_0x247d46[_0x6dba('0x1b')]?_0x247d46['options']['attributes']||null:null,'limit':_0x247d46[_0x6dba('0x1b')]?_0x247d46[_0x6dba('0x1b')]['limit']||null:null})[_0x6dba('0xd')](function(_0x2e803f){logger[_0x6dba('0xe')](_0x6dba('0x1e'),_0x247d46);logger[_0x6dba('0x10')](_0x6dba('0x1e'),_0x247d46,JSON[_0x6dba('0x1d')](_0x2e803f));_0x105a78(_0x2e803f);})[_0x6dba('0x16')](function(_0xb9339f){logger[_0x6dba('0x12')](_0x6dba('0x1e'),_0xb9339f[_0x6dba('0x14')],_0x247d46);_0x10fabc(_0x1ae37c[_0x6dba('0x12')](0x1f4,_0xb9339f[_0x6dba('0x14')]));});});}; \ No newline at end of file +var _0x6691=['attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ChatQueueReport','create','body','options','CreateChatQueueReport','UpdateChatQueueReport','update','raw'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x6691,0x134));var _0x1669=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x6691[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x1669('0x0'));var util=require(_0x1669('0x1'));var moment=require(_0x1669('0x2'));var BPromise=require(_0x1669('0x3'));var rs=require(_0x1669('0x4'));var fs=require('fs');var Redis=require(_0x1669('0x5'));var db=require(_0x1669('0x6'))['db'];var utils=require(_0x1669('0x7'));var logger=require('../../config/logger')(_0x1669('0x8'));var config=require(_0x1669('0x9'));var jayson=require(_0x1669('0xa'));var client=jayson[_0x1669('0xb')][_0x1669('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1810e5,_0x1e3038,_0x40a41b){return new BPromise(function(_0x5c8145,_0x28a69e){return client[_0x1669('0xd')](_0x1810e5,_0x40a41b)[_0x1669('0xe')](function(_0x4be0c7){logger[_0x1669('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x1e3038,'request\x20sent');logger['debug'](_0x1669('0x10'),_0x1e3038,_0x1669('0x11'),JSON[_0x1669('0x12')](_0x4be0c7));if(_0x4be0c7[_0x1669('0x13')]){if(_0x4be0c7[_0x1669('0x13')][_0x1669('0x14')]===0x1f4){logger[_0x1669('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x1e3038,_0x4be0c7[_0x1669('0x13')]['message']);return _0x28a69e(_0x4be0c7[_0x1669('0x13')][_0x1669('0x15')]);}logger[_0x1669('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x1e3038,_0x4be0c7['error'][_0x1669('0x15')]);return _0x5c8145(_0x4be0c7[_0x1669('0x13')][_0x1669('0x15')]);}else{logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x1e3038,'request\x20sent');_0x5c8145(_0x4be0c7[_0x1669('0x16')][_0x1669('0x15')]);}})[_0x1669('0x17')](function(_0x1038bb){logger[_0x1669('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x1e3038,_0x1038bb);_0x28a69e(_0x1038bb);});});}exports['CreateChatQueueReport']=function(_0x18434){var _0x3c6533=this;return new Promise(function(_0x335c4c,_0x4837b8){return db[_0x1669('0x18')][_0x1669('0x19')](_0x18434[_0x1669('0x1a')],{'raw':_0x18434[_0x1669('0x1b')]?_0x18434[_0x1669('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x1669('0xe')](function(_0x14a90c){logger[_0x1669('0xf')](_0x1669('0x1c'),_0x18434);logger['debug'](_0x1669('0x1c'),_0x18434,JSON[_0x1669('0x12')](_0x14a90c));_0x335c4c(_0x14a90c);})[_0x1669('0x17')](function(_0x217da3){logger[_0x1669('0x13')](_0x1669('0x1c'),_0x217da3[_0x1669('0x15')],_0x18434);_0x4837b8(_0x3c6533['error'](0x1f4,_0x217da3[_0x1669('0x15')]));});});};exports[_0x1669('0x1d')]=function(_0x5328f7){var _0x482186=this;return new Promise(function(_0xedd4a3,_0x63e3eb){return db['ChatQueueReport'][_0x1669('0x1e')](_0x5328f7['body'],{'raw':_0x5328f7[_0x1669('0x1b')]?_0x5328f7['options'][_0x1669('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5328f7[_0x1669('0x1b')]?_0x5328f7[_0x1669('0x1b')]['where']||null:null,'attributes':_0x5328f7[_0x1669('0x1b')]?_0x5328f7[_0x1669('0x1b')][_0x1669('0x20')]||null:null,'limit':_0x5328f7[_0x1669('0x1b')]?_0x5328f7[_0x1669('0x1b')][_0x1669('0x21')]||null:null})[_0x1669('0xe')](function(_0x5eb952){logger[_0x1669('0xf')](_0x1669('0x1d'),_0x5328f7);logger['debug'](_0x1669('0x1d'),_0x5328f7,JSON['stringify'](_0x5eb952));_0xedd4a3(_0x5eb952);})['catch'](function(_0x195cc3){logger[_0x1669('0x13')](_0x1669('0x1d'),_0x195cc3['message'],_0x5328f7);_0x63e3eb(_0x482186[_0x1669('0x13')](0x1f4,_0x195cc3[_0x1669('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 4f889f1..cbeaa17 100644 --- a/server/api/chatQueueReport/index.js +++ b/server/api/chatQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9881=['./chatQueueReport.controller','get','isAuthenticated','/describe','/:id','show','put','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x9881,0xf4));var _0x1988=function(_0x3877f5,_0xeaac42){_0x3877f5=_0x3877f5-0x0;var _0x249e7f=_0x9881[_0x3877f5];return _0x249e7f;};'use strict';var multer=require(_0x1988('0x0'));var util=require('util');var path=require(_0x1988('0x1'));var timeout=require(_0x1988('0x2'));var express=require(_0x1988('0x3'));var router=express['Router']();var fs_extra=require(_0x1988('0x4'));var auth=require(_0x1988('0x5'));var interaction=require(_0x1988('0x6'));var config=require(_0x1988('0x7'));var controller=require(_0x1988('0x8'));router[_0x1988('0x9')]('/',auth[_0x1988('0xa')](),controller['index']);router[_0x1988('0x9')](_0x1988('0xb'),auth[_0x1988('0xa')](),controller['describe']);router[_0x1988('0x9')](_0x1988('0xc'),auth['isAuthenticated'](),controller[_0x1988('0xd')]);router['post']('/',auth[_0x1988('0xa')](),controller['create']);router[_0x1988('0xe')]('/:id',auth[_0x1988('0xa')](),controller[_0x1988('0xf')]);router['delete'](_0x1988('0xc'),auth[_0x1988('0xa')](),controller[_0x1988('0x10')]);module[_0x1988('0x11')]=router; \ No newline at end of file +var _0x67c7=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','update','delete','multer','util','path','connect-timeout'];(function(_0x90cba6,_0x3c97d3){var _0x500b97=function(_0x2b6263){while(--_0x2b6263){_0x90cba6['push'](_0x90cba6['shift']());}};_0x500b97(++_0x3c97d3);}(_0x67c7,0x128));var _0x767c=function(_0x585199,_0x10d223){_0x585199=_0x585199-0x0;var _0x4f5eaf=_0x67c7[_0x585199];return _0x4f5eaf;};'use strict';var multer=require(_0x767c('0x0'));var util=require(_0x767c('0x1'));var path=require(_0x767c('0x2'));var timeout=require(_0x767c('0x3'));var express=require(_0x767c('0x4'));var router=express[_0x767c('0x5')]();var fs_extra=require(_0x767c('0x6'));var auth=require(_0x767c('0x7'));var interaction=require(_0x767c('0x8'));var config=require(_0x767c('0x9'));var controller=require(_0x767c('0xa'));router[_0x767c('0xb')]('/',auth[_0x767c('0xc')](),controller[_0x767c('0xd')]);router[_0x767c('0xb')](_0x767c('0xe'),auth['isAuthenticated'](),controller[_0x767c('0xf')]);router['get'](_0x767c('0x10'),auth[_0x767c('0xc')](),controller[_0x767c('0x11')]);router['post']('/',auth[_0x767c('0xc')](),controller['create']);router['put'](_0x767c('0x10'),auth['isAuthenticated'](),controller[_0x767c('0x12')]);router[_0x767c('0x13')](_0x767c('0x10'),auth[_0x767c('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 47a0fb7..a074e6d 100644 --- a/server/api/chatTransferReport/chatTransferReport.attributes.js +++ b/server/api/chatTransferReport/chatTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x1f5887,_0x2fa1f1){var _0x21774b=function(_0x48a7e5){while(--_0x48a7e5){_0x1f5887['push'](_0x1f5887['shift']());}};_0x21774b(++_0x2fa1f1);}(_0x9bde,0xe1));var _0xe9bd=function(_0x318966,_0x197359){_0x318966=_0x318966-0x0;var _0x159adb=_0x9bde[_0x318966];return _0x159adb;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file +var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x470d59,_0x2d6c72){var _0x48d24b=function(_0x1ebd42){while(--_0x1ebd42){_0x470d59['push'](_0x470d59['shift']());}};_0x48d24b(++_0x2d6c72);}(_0x008c,0x188));var _0xc008=function(_0xb6ea0a,_0x483190){_0xb6ea0a=_0xb6ea0a-0x0;var _0x397ff4=_0x008c[_0xb6ea0a];return _0x397ff4;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index b3e6a7c..8aac232 100644 --- a/server/api/chatTransferReport/chatTransferReport.controller.js +++ b/server/api/chatTransferReport/chatTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb700=['pick','where','merge','VIRTUAL','filter','options','ChatTransferReport','includeAll','include','rows','catch','params','keys','create','body','find','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','save','then','stack','name','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xb700,0xf3));var _0x0b70=function(_0x4bf96c,_0x4d24fd){_0x4bf96c=_0x4bf96c-0x0;var _0x281d09=_0xb700[_0x4bf96c];return _0x281d09;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0b70('0x0'));var zipdir=require(_0x0b70('0x1'));var jsonpatch=require(_0x0b70('0x2'));var rp=require(_0x0b70('0x3'));var moment=require(_0x0b70('0x4'));var BPromise=require(_0x0b70('0x5'));var Mustache=require(_0x0b70('0x6'));var util=require(_0x0b70('0x7'));var path=require(_0x0b70('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0b70('0x9'));var _=require(_0x0b70('0xa'));var squel=require(_0x0b70('0xb'));var crypto=require(_0x0b70('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0b70('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0b70('0xe'));var Papa=require(_0x0b70('0xf'));var Redis=require(_0x0b70('0x10'));var authService=require(_0x0b70('0x11'));var qs=require(_0x0b70('0x12'));var as=require(_0x0b70('0x13'));var hardwareService=require(_0x0b70('0x14'));var logger=require(_0x0b70('0x15'))(_0x0b70('0x16'));var utils=require(_0x0b70('0x17'));var config=require(_0x0b70('0x18'));var licenseUtil=require(_0x0b70('0x19'));var db=require(_0x0b70('0x1a'))['db'];function respondWithStatusCode(_0x3bc877,_0x40ac56){_0x40ac56=_0x40ac56||0xcc;return function(_0x552b49){if(_0x552b49){return _0x3bc877[_0x0b70('0x1b')](_0x40ac56);}return _0x3bc877[_0x0b70('0x1c')](_0x40ac56)[_0x0b70('0x1d')]();};}function respondWithResult(_0x11f197,_0x3ac07d){_0x3ac07d=_0x3ac07d||0xc8;return function(_0x2a3ce3){if(_0x2a3ce3){return _0x11f197[_0x0b70('0x1c')](_0x3ac07d)[_0x0b70('0x1e')](_0x2a3ce3);}};}function respondWithFilteredResult(_0x5b1847,_0x21d414){return function(_0x1969b4){if(_0x1969b4){var _0x325a4e=typeof _0x21d414[_0x0b70('0x1f')]==='undefined'&&typeof _0x21d414[_0x0b70('0x20')]===_0x0b70('0x21');var _0x5a0b84=_0x1969b4[_0x0b70('0x22')];var _0x37b408=_0x325a4e?0x0:_0x21d414[_0x0b70('0x1f')];var _0x314d9f=_0x325a4e?_0x1969b4[_0x0b70('0x22')]:_0x21d414[_0x0b70('0x1f')]+_0x21d414[_0x0b70('0x20')];var _0x3f572c;if(_0x314d9f>=_0x5a0b84){_0x314d9f=_0x5a0b84;_0x3f572c=0xc8;}else{_0x3f572c=0xce;}_0x5b1847[_0x0b70('0x1c')](_0x3f572c);return _0x5b1847[_0x0b70('0x23')](_0x0b70('0x24'),_0x37b408+'-'+_0x314d9f+'/'+_0x5a0b84)[_0x0b70('0x1e')](_0x1969b4);}return null;};}function patchUpdates(_0x116a00){return function(_0x1dffca){try{jsonpatch['apply'](_0x1dffca,_0x116a00,!![]);}catch(_0x47962d){return BPromise['reject'](_0x47962d);}return _0x1dffca[_0x0b70('0x25')]();};}function saveUpdates(_0x512113,_0x2e0375){return function(_0x39bf3b){if(_0x39bf3b){return _0x39bf3b['update'](_0x512113)[_0x0b70('0x26')](function(_0x57a20d){return _0x57a20d;});}return null;};}function removeEntity(_0xbbea03,_0x1ab15f){return function(_0x53503e){if(_0x53503e){return _0x53503e['destroy']()[_0x0b70('0x26')](function(){_0xbbea03[_0x0b70('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xcb5c8e,_0x3d0ee3){return function(_0x15a52){if(!_0x15a52){_0xcb5c8e['sendStatus'](0x194);}return _0x15a52;};}function handleError(_0x476dba,_0x227555){_0x227555=_0x227555||0x1f4;return function(_0x264270){logger['error'](_0x264270[_0x0b70('0x27')]);if(_0x264270[_0x0b70('0x28')]){delete _0x264270[_0x0b70('0x28')];}_0x476dba[_0x0b70('0x1c')](_0x227555)['send'](_0x264270);};}exports['index']=function(_0x19bdd9,_0x368bda){var _0x45936e={},_0x547e67={},_0x5a3113={'count':0x0,'rows':[]};var _0x5d40da=_['map'](db['ChatTransferReport'][_0x0b70('0x29')],function(_0x5898f9){return{'name':_0x5898f9[_0x0b70('0x2a')],'type':_0x5898f9[_0x0b70('0x2b')][_0x0b70('0x2c')]};});_0x547e67[_0x0b70('0x2d')]=_[_0x0b70('0x2e')](_0x5d40da,_0x0b70('0x28'));_0x547e67[_0x0b70('0x2f')]=_['keys'](_0x19bdd9[_0x0b70('0x2f')]);_0x547e67[_0x0b70('0x30')]=_[_0x0b70('0x31')](_0x547e67[_0x0b70('0x2d')],_0x547e67['query']);_0x45936e[_0x0b70('0x32')]=_[_0x0b70('0x31')](_0x547e67[_0x0b70('0x2d')],qs[_0x0b70('0x33')](_0x19bdd9[_0x0b70('0x2f')][_0x0b70('0x33')]));_0x45936e['attributes']=_0x45936e[_0x0b70('0x32')][_0x0b70('0x34')]?_0x45936e['attributes']:_0x547e67[_0x0b70('0x2d')];if(!_0x19bdd9['query'][_0x0b70('0x35')](_0x0b70('0x36'))){_0x45936e[_0x0b70('0x20')]=qs[_0x0b70('0x20')](_0x19bdd9[_0x0b70('0x2f')][_0x0b70('0x20')]);_0x45936e[_0x0b70('0x1f')]=qs[_0x0b70('0x1f')](_0x19bdd9[_0x0b70('0x2f')][_0x0b70('0x1f')]);}_0x45936e[_0x0b70('0x37')]=qs[_0x0b70('0x38')](_0x19bdd9[_0x0b70('0x2f')]['sort']);_0x45936e['where']=qs[_0x0b70('0x30')](_[_0x0b70('0x39')](_0x19bdd9[_0x0b70('0x2f')],_0x547e67['filters']),_0x5d40da);if(_0x19bdd9[_0x0b70('0x2f')]['filter']){_0x45936e[_0x0b70('0x3a')]=_[_0x0b70('0x3b')](_0x45936e['where'],{'$or':_[_0x0b70('0x2e')](_0x5d40da,function(_0x14c154){if(_0x14c154[_0x0b70('0x2b')]!==_0x0b70('0x3c')){var _0x584336={};_0x584336[_0x14c154['name']]={'$like':'%'+_0x19bdd9[_0x0b70('0x2f')][_0x0b70('0x3d')]+'%'};return _0x584336;}})});}_0x45936e=_[_0x0b70('0x3b')]({},_0x45936e,_0x19bdd9[_0x0b70('0x3e')]);var _0xbe8b37={'where':_0x45936e[_0x0b70('0x3a')]};return db[_0x0b70('0x3f')]['count'](_0xbe8b37)[_0x0b70('0x26')](function(_0xe37290){_0x5a3113['count']=_0xe37290;if(_0x19bdd9[_0x0b70('0x2f')][_0x0b70('0x40')]){_0x45936e[_0x0b70('0x41')]=[{'all':!![]}];}return db[_0x0b70('0x3f')]['findAll'](_0x45936e);})['then'](function(_0x5d71a5){_0x5a3113[_0x0b70('0x42')]=_0x5d71a5;return _0x5a3113;})[_0x0b70('0x26')](respondWithFilteredResult(_0x368bda,_0x45936e))[_0x0b70('0x43')](handleError(_0x368bda,null));};exports['show']=function(_0x52c701,_0x16b5f4){var _0x2df2aa={'raw':!![],'where':{'id':_0x52c701[_0x0b70('0x44')]['id']}},_0x320765={};_0x320765['model']=_[_0x0b70('0x45')](db[_0x0b70('0x3f')][_0x0b70('0x29')]);_0x320765[_0x0b70('0x2f')]=_[_0x0b70('0x45')](_0x52c701[_0x0b70('0x2f')]);_0x320765[_0x0b70('0x30')]=_[_0x0b70('0x31')](_0x320765[_0x0b70('0x2d')],_0x320765[_0x0b70('0x2f')]);_0x2df2aa[_0x0b70('0x32')]=_[_0x0b70('0x31')](_0x320765[_0x0b70('0x2d')],qs['fields'](_0x52c701[_0x0b70('0x2f')][_0x0b70('0x33')]));_0x2df2aa['attributes']=_0x2df2aa[_0x0b70('0x32')]['length']?_0x2df2aa['attributes']:_0x320765[_0x0b70('0x2d')];if(_0x52c701[_0x0b70('0x2f')]['includeAll']){_0x2df2aa[_0x0b70('0x41')]=[{'all':!![]}];}_0x2df2aa=_[_0x0b70('0x3b')]({},_0x2df2aa,_0x52c701['options']);return db['ChatTransferReport']['find'](_0x2df2aa)[_0x0b70('0x26')](handleEntityNotFound(_0x16b5f4,null))[_0x0b70('0x26')](respondWithResult(_0x16b5f4,null))[_0x0b70('0x43')](handleError(_0x16b5f4,null));};exports[_0x0b70('0x46')]=function(_0x5efbb6,_0x440bf6){return db['ChatTransferReport'][_0x0b70('0x46')](_0x5efbb6[_0x0b70('0x47')],{})['then'](respondWithResult(_0x440bf6,0xc9))[_0x0b70('0x43')](handleError(_0x440bf6,null));};exports['update']=function(_0x39b803,_0x1c07a3){if(_0x39b803[_0x0b70('0x47')]['id']){delete _0x39b803[_0x0b70('0x47')]['id'];}return db[_0x0b70('0x3f')][_0x0b70('0x48')]({'where':{'id':_0x39b803[_0x0b70('0x44')]['id']}})[_0x0b70('0x26')](handleEntityNotFound(_0x1c07a3,null))[_0x0b70('0x26')](saveUpdates(_0x39b803[_0x0b70('0x47')],null))['then'](respondWithResult(_0x1c07a3,null))['catch'](handleError(_0x1c07a3,null));};exports[_0x0b70('0x49')]=function(_0x10fa73,_0x232ad1){return db['ChatTransferReport'][_0x0b70('0x48')]({'where':{'id':_0x10fa73['params']['id']}})[_0x0b70('0x26')](handleEntityNotFound(_0x232ad1,null))['then'](removeEntity(_0x232ad1,null))[_0x0b70('0x43')](handleError(_0x232ad1,null));};exports[_0x0b70('0x4a')]=function(_0x5857ff,_0x8ec27b){return db[_0x0b70('0x3f')][_0x0b70('0x4a')]()[_0x0b70('0x26')](respondWithResult(_0x8ec27b,null))[_0x0b70('0x43')](handleError(_0x8ec27b,null));}; \ No newline at end of file +var _0xfe42=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','includeAll','findAll','rows','catch','show','params','include','options','create','body','destroy','describe','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel'];(function(_0x47e783,_0xbd9f10){var _0x5af855=function(_0x117fd6){while(--_0x117fd6){_0x47e783['push'](_0x47e783['shift']());}};_0x5af855(++_0xbd9f10);}(_0xfe42,0x1d4));var _0x2fe4=function(_0x52cf0d,_0x91507b){_0x52cf0d=_0x52cf0d-0x0;var _0x12cc59=_0xfe42[_0x52cf0d];return _0x12cc59;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2fe4('0x0'));var jsonpatch=require(_0x2fe4('0x1'));var rp=require('request-promise');var moment=require(_0x2fe4('0x2'));var BPromise=require(_0x2fe4('0x3'));var Mustache=require(_0x2fe4('0x4'));var util=require(_0x2fe4('0x5'));var path=require(_0x2fe4('0x6'));var sox=require(_0x2fe4('0x7'));var csv=require(_0x2fe4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2fe4('0x9'));var _=require(_0x2fe4('0xa'));var squel=require(_0x2fe4('0xb'));var crypto=require(_0x2fe4('0xc'));var jsforce=require(_0x2fe4('0xd'));var deskjs=require(_0x2fe4('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2fe4('0xf'));var Papa=require(_0x2fe4('0x10'));var Redis=require(_0x2fe4('0x11'));var authService=require(_0x2fe4('0x12'));var qs=require(_0x2fe4('0x13'));var as=require(_0x2fe4('0x14'));var hardwareService=require(_0x2fe4('0x15'));var logger=require(_0x2fe4('0x16'))('api');var utils=require(_0x2fe4('0x17'));var config=require(_0x2fe4('0x18'));var licenseUtil=require(_0x2fe4('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2fb5f7,_0x5cfc8b){_0x5cfc8b=_0x5cfc8b||0xcc;return function(_0x4b53ea){if(_0x4b53ea){return _0x2fb5f7[_0x2fe4('0x1a')](_0x5cfc8b);}return _0x2fb5f7[_0x2fe4('0x1b')](_0x5cfc8b)[_0x2fe4('0x1c')]();};}function respondWithResult(_0x465532,_0x3897c5){_0x3897c5=_0x3897c5||0xc8;return function(_0x29ad25){if(_0x29ad25){return _0x465532[_0x2fe4('0x1b')](_0x3897c5)[_0x2fe4('0x1d')](_0x29ad25);}};}function respondWithFilteredResult(_0x588e17,_0x5e29a5){return function(_0x33387c){if(_0x33387c){var _0x55aa07=typeof _0x5e29a5[_0x2fe4('0x1e')]===_0x2fe4('0x1f')&&typeof _0x5e29a5[_0x2fe4('0x20')]===_0x2fe4('0x1f');var _0x460a7c=_0x33387c[_0x2fe4('0x21')];var _0x17ac70=_0x55aa07?0x0:_0x5e29a5['offset'];var _0x25e9d7=_0x55aa07?_0x33387c[_0x2fe4('0x21')]:_0x5e29a5['offset']+_0x5e29a5[_0x2fe4('0x20')];var _0x5ff0c4;if(_0x25e9d7>=_0x460a7c){_0x25e9d7=_0x460a7c;_0x5ff0c4=0xc8;}else{_0x5ff0c4=0xce;}_0x588e17['status'](_0x5ff0c4);return _0x588e17[_0x2fe4('0x22')](_0x2fe4('0x23'),_0x17ac70+'-'+_0x25e9d7+'/'+_0x460a7c)[_0x2fe4('0x1d')](_0x33387c);}return null;};}function patchUpdates(_0xe3d7f8){return function(_0x7616e){try{jsonpatch[_0x2fe4('0x24')](_0x7616e,_0xe3d7f8,!![]);}catch(_0x2d23c9){return BPromise[_0x2fe4('0x25')](_0x2d23c9);}return _0x7616e['save']();};}function saveUpdates(_0x2ccb16,_0x15cc4f){return function(_0x37be84){if(_0x37be84){return _0x37be84[_0x2fe4('0x26')](_0x2ccb16)[_0x2fe4('0x27')](function(_0x410c34){return _0x410c34;});}return null;};}function removeEntity(_0x1873ce,_0x404d5c){return function(_0x3bc79){if(_0x3bc79){return _0x3bc79['destroy']()[_0x2fe4('0x27')](function(){_0x1873ce['status'](0xcc)[_0x2fe4('0x1c')]();});}};}function handleEntityNotFound(_0x2e1585,_0x5db177){return function(_0x427e2c){if(!_0x427e2c){_0x2e1585[_0x2fe4('0x1a')](0x194);}return _0x427e2c;};}function handleError(_0x86b28,_0x2c9eaf){_0x2c9eaf=_0x2c9eaf||0x1f4;return function(_0x408c63){logger[_0x2fe4('0x28')](_0x408c63[_0x2fe4('0x29')]);if(_0x408c63[_0x2fe4('0x2a')]){delete _0x408c63[_0x2fe4('0x2a')];}_0x86b28[_0x2fe4('0x1b')](_0x2c9eaf)[_0x2fe4('0x2b')](_0x408c63);};}exports[_0x2fe4('0x2c')]=function(_0x4a5846,_0x1e6680){var _0x3be575={},_0x1098a6={},_0x2c0b2c={'count':0x0,'rows':[]};var _0x26bc2d=_[_0x2fe4('0x2d')](db[_0x2fe4('0x2e')][_0x2fe4('0x2f')],function(_0x1321c8){return{'name':_0x1321c8[_0x2fe4('0x30')],'type':_0x1321c8[_0x2fe4('0x31')][_0x2fe4('0x32')]};});_0x1098a6[_0x2fe4('0x33')]=_[_0x2fe4('0x2d')](_0x26bc2d,'name');_0x1098a6['query']=_[_0x2fe4('0x34')](_0x4a5846[_0x2fe4('0x35')]);_0x1098a6[_0x2fe4('0x36')]=_[_0x2fe4('0x37')](_0x1098a6[_0x2fe4('0x33')],_0x1098a6[_0x2fe4('0x35')]);_0x3be575[_0x2fe4('0x38')]=_[_0x2fe4('0x37')](_0x1098a6[_0x2fe4('0x33')],qs[_0x2fe4('0x39')](_0x4a5846[_0x2fe4('0x35')][_0x2fe4('0x39')]));_0x3be575['attributes']=_0x3be575[_0x2fe4('0x38')][_0x2fe4('0x3a')]?_0x3be575['attributes']:_0x1098a6[_0x2fe4('0x33')];if(!_0x4a5846[_0x2fe4('0x35')][_0x2fe4('0x3b')](_0x2fe4('0x3c'))){_0x3be575[_0x2fe4('0x20')]=qs['limit'](_0x4a5846[_0x2fe4('0x35')][_0x2fe4('0x20')]);_0x3be575[_0x2fe4('0x1e')]=qs[_0x2fe4('0x1e')](_0x4a5846[_0x2fe4('0x35')][_0x2fe4('0x1e')]);}_0x3be575[_0x2fe4('0x3d')]=qs[_0x2fe4('0x3e')](_0x4a5846['query']['sort']);_0x3be575[_0x2fe4('0x3f')]=qs[_0x2fe4('0x36')](_[_0x2fe4('0x40')](_0x4a5846[_0x2fe4('0x35')],_0x1098a6['filters']),_0x26bc2d);if(_0x4a5846[_0x2fe4('0x35')]['filter']){_0x3be575[_0x2fe4('0x3f')]=_['merge'](_0x3be575[_0x2fe4('0x3f')],{'$or':_[_0x2fe4('0x2d')](_0x26bc2d,function(_0x30a8db){if(_0x30a8db[_0x2fe4('0x31')]!==_0x2fe4('0x41')){var _0x5da0c0={};_0x5da0c0[_0x30a8db[_0x2fe4('0x2a')]]={'$like':'%'+_0x4a5846[_0x2fe4('0x35')][_0x2fe4('0x42')]+'%'};return _0x5da0c0;}})});}_0x3be575=_[_0x2fe4('0x43')]({},_0x3be575,_0x4a5846['options']);var _0x5d3bc6={'where':_0x3be575[_0x2fe4('0x3f')]};return db['ChatTransferReport'][_0x2fe4('0x21')](_0x5d3bc6)[_0x2fe4('0x27')](function(_0x1ed87d){_0x2c0b2c['count']=_0x1ed87d;if(_0x4a5846[_0x2fe4('0x35')][_0x2fe4('0x44')]){_0x3be575['include']=[{'all':!![]}];}return db['ChatTransferReport'][_0x2fe4('0x45')](_0x3be575);})[_0x2fe4('0x27')](function(_0x1597f8){_0x2c0b2c[_0x2fe4('0x46')]=_0x1597f8;return _0x2c0b2c;})[_0x2fe4('0x27')](respondWithFilteredResult(_0x1e6680,_0x3be575))[_0x2fe4('0x47')](handleError(_0x1e6680,null));};exports[_0x2fe4('0x48')]=function(_0x3013c0,_0x4cf25b){var _0x21def2={'raw':!![],'where':{'id':_0x3013c0[_0x2fe4('0x49')]['id']}},_0x12cf7c={};_0x12cf7c[_0x2fe4('0x33')]=_[_0x2fe4('0x34')](db[_0x2fe4('0x2e')][_0x2fe4('0x2f')]);_0x12cf7c[_0x2fe4('0x35')]=_[_0x2fe4('0x34')](_0x3013c0[_0x2fe4('0x35')]);_0x12cf7c['filters']=_['intersection'](_0x12cf7c[_0x2fe4('0x33')],_0x12cf7c[_0x2fe4('0x35')]);_0x21def2[_0x2fe4('0x38')]=_[_0x2fe4('0x37')](_0x12cf7c[_0x2fe4('0x33')],qs[_0x2fe4('0x39')](_0x3013c0[_0x2fe4('0x35')][_0x2fe4('0x39')]));_0x21def2['attributes']=_0x21def2[_0x2fe4('0x38')][_0x2fe4('0x3a')]?_0x21def2[_0x2fe4('0x38')]:_0x12cf7c[_0x2fe4('0x33')];if(_0x3013c0[_0x2fe4('0x35')]['includeAll']){_0x21def2[_0x2fe4('0x4a')]=[{'all':!![]}];}_0x21def2=_['merge']({},_0x21def2,_0x3013c0[_0x2fe4('0x4b')]);return db['ChatTransferReport']['find'](_0x21def2)['then'](handleEntityNotFound(_0x4cf25b,null))['then'](respondWithResult(_0x4cf25b,null))[_0x2fe4('0x47')](handleError(_0x4cf25b,null));};exports[_0x2fe4('0x4c')]=function(_0x24adef,_0xd267ef){return db[_0x2fe4('0x2e')][_0x2fe4('0x4c')](_0x24adef[_0x2fe4('0x4d')],{})[_0x2fe4('0x27')](respondWithResult(_0xd267ef,0xc9))[_0x2fe4('0x47')](handleError(_0xd267ef,null));};exports[_0x2fe4('0x26')]=function(_0x53afe0,_0x351497){if(_0x53afe0[_0x2fe4('0x4d')]['id']){delete _0x53afe0[_0x2fe4('0x4d')]['id'];}return db[_0x2fe4('0x2e')]['find']({'where':{'id':_0x53afe0[_0x2fe4('0x49')]['id']}})[_0x2fe4('0x27')](handleEntityNotFound(_0x351497,null))[_0x2fe4('0x27')](saveUpdates(_0x53afe0[_0x2fe4('0x4d')],null))['then'](respondWithResult(_0x351497,null))['catch'](handleError(_0x351497,null));};exports[_0x2fe4('0x4e')]=function(_0x479d36,_0x4a9582){return db[_0x2fe4('0x2e')]['find']({'where':{'id':_0x479d36[_0x2fe4('0x49')]['id']}})[_0x2fe4('0x27')](handleEntityNotFound(_0x4a9582,null))[_0x2fe4('0x27')](removeEntity(_0x4a9582,null))[_0x2fe4('0x47')](handleError(_0x4a9582,null));};exports[_0x2fe4('0x4f')]=function(_0x46149f,_0x4458aa){return db['ChatTransferReport'][_0x2fe4('0x4f')]()['then'](respondWithResult(_0x4458aa,null))[_0x2fe4('0x47')](handleError(_0x4458aa,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index b387bb4..e9b1b79 100644 --- a/server/api/chatTransferReport/chatTransferReport.model.js +++ b/server/api/chatTransferReport/chatTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x73e9=['ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','api','moment','bluebird','../../config/environment','exports','define'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0x73e9,0xd4));var _0x973e=function(_0x150fd9,_0xa49dcb){_0x150fd9=_0x150fd9-0x0;var _0x556529=_0x73e9[_0x150fd9];return _0x556529;};'use strict';var _=require(_0x973e('0x0'));var util=require(_0x973e('0x1'));var logger=require('../../config/logger')(_0x973e('0x2'));var moment=require(_0x973e('0x3'));var BPromise=require(_0x973e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x973e('0x5'));var attributes=require('./chatTransferReport.attributes');module[_0x973e('0x6')]=function(_0x302acc,_0x2a0b73){return _0x302acc[_0x973e('0x7')](_0x973e('0x8'),attributes,{'tableName':_0x973e('0x9'),'paranoid':![],'indexes':[{'name':_0x973e('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xdd7c=['../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x2f4683,_0x35dc74){var _0x53d543=function(_0x41792d){while(--_0x41792d){_0x2f4683['push'](_0x2f4683['shift']());}};_0x53d543(++_0x35dc74);}(_0xdd7c,0xf6));var _0xcdd7=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xdd7c[_0x2576d7];return _0x16a08c;};'use strict';var _=require(_0xcdd7('0x0'));var util=require('util');var logger=require(_0xcdd7('0x1'))(_0xcdd7('0x2'));var moment=require(_0xcdd7('0x3'));var BPromise=require(_0xcdd7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcdd7('0x5'));var config=require(_0xcdd7('0x6'));var attributes=require(_0xcdd7('0x7'));module['exports']=function(_0xd1be8,_0x5c5477){return _0xd1be8[_0xcdd7('0x8')](_0xcdd7('0x9'),attributes,{'tableName':_0xcdd7('0xa'),'paranoid':![],'indexes':[{'name':_0xcdd7('0xb'),'fields':[_0xcdd7('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 23a9116..316d1a8 100644 --- a/server/api/chatTransferReport/chatTransferReport.rpc.js +++ b/server/api/chatTransferReport/chatTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x401e=['request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5a257f,_0x18ab97){var _0x3a7574=function(_0x35fae6){while(--_0x35fae6){_0x5a257f['push'](_0x5a257f['shift']());}};_0x3a7574(++_0x18ab97);}(_0x401e,0x1c4));var _0xe401=function(_0x5a02b9,_0x5c0c06){_0x5a02b9=_0x5a02b9-0x0;var _0x4d2bb8=_0x401e[_0x5a02b9];return _0x4d2bb8;};'use strict';var _=require(_0xe401('0x0'));var util=require(_0xe401('0x1'));var moment=require('moment');var BPromise=require(_0xe401('0x2'));var rs=require(_0xe401('0x3'));var fs=require('fs');var Redis=require(_0xe401('0x4'));var db=require(_0xe401('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe401('0x6'))(_0xe401('0x7'));var config=require(_0xe401('0x8'));var jayson=require(_0xe401('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5042c2,_0xe1666,_0x4a8195){return new BPromise(function(_0x2b0262,_0x208b1c){return client[_0xe401('0xa')](_0x5042c2,_0x4a8195)[_0xe401('0xb')](function(_0x279fa9){logger[_0xe401('0xc')](_0xe401('0xd'),_0xe1666,_0xe401('0xe'));logger[_0xe401('0xf')](_0xe401('0x10'),_0xe1666,_0xe401('0xe'),JSON[_0xe401('0x11')](_0x279fa9));if(_0x279fa9[_0xe401('0x12')]){if(_0x279fa9[_0xe401('0x12')]['code']===0x1f4){logger[_0xe401('0x12')](_0xe401('0xd'),_0xe1666,_0x279fa9[_0xe401('0x12')][_0xe401('0x13')]);return _0x208b1c(_0x279fa9['error'][_0xe401('0x13')]);}logger[_0xe401('0x12')](_0xe401('0xd'),_0xe1666,_0x279fa9['error'][_0xe401('0x13')]);return _0x2b0262(_0x279fa9[_0xe401('0x12')][_0xe401('0x13')]);}else{logger['info'](_0xe401('0xd'),_0xe1666,_0xe401('0xe'));_0x2b0262(_0x279fa9[_0xe401('0x14')][_0xe401('0x13')]);}})[_0xe401('0x15')](function(_0x5b4e73){logger[_0xe401('0x12')](_0xe401('0xd'),_0xe1666,_0x5b4e73);_0x208b1c(_0x5b4e73);});});} \ No newline at end of file +var _0x6c14=['util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x4f7bb0,_0x3dd03a){var _0x2ef9d2=function(_0x14b956){while(--_0x14b956){_0x4f7bb0['push'](_0x4f7bb0['shift']());}};_0x2ef9d2(++_0x3dd03a);}(_0x6c14,0x69));var _0x46c1=function(_0x42378b,_0x168de4){_0x42378b=_0x42378b-0x0;var _0x124d1d=_0x6c14[_0x42378b];return _0x124d1d;};'use strict';var _=require('lodash');var util=require(_0x46c1('0x0'));var moment=require(_0x46c1('0x1'));var BPromise=require('bluebird');var rs=require(_0x46c1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x46c1('0x3'))['db'];var utils=require(_0x46c1('0x4'));var logger=require(_0x46c1('0x5'))(_0x46c1('0x6'));var config=require('../../config/environment');var jayson=require(_0x46c1('0x7'));var client=jayson[_0x46c1('0x8')][_0x46c1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d025b,_0x35936b,_0x46a9cf){return new BPromise(function(_0xa95f81,_0x23d9f7){return client['request'](_0x4d025b,_0x46a9cf)[_0x46c1('0xa')](function(_0x10beb6){logger[_0x46c1('0xb')](_0x46c1('0xc'),_0x35936b,_0x46c1('0xd'));logger[_0x46c1('0xe')](_0x46c1('0xf'),_0x35936b,_0x46c1('0xd'),JSON[_0x46c1('0x10')](_0x10beb6));if(_0x10beb6[_0x46c1('0x11')]){if(_0x10beb6[_0x46c1('0x11')][_0x46c1('0x12')]===0x1f4){logger['error'](_0x46c1('0xc'),_0x35936b,_0x10beb6[_0x46c1('0x11')][_0x46c1('0x13')]);return _0x23d9f7(_0x10beb6['error']['message']);}logger[_0x46c1('0x11')](_0x46c1('0xc'),_0x35936b,_0x10beb6[_0x46c1('0x11')]['message']);return _0xa95f81(_0x10beb6[_0x46c1('0x11')][_0x46c1('0x13')]);}else{logger[_0x46c1('0xb')](_0x46c1('0xc'),_0x35936b,_0x46c1('0xd'));_0xa95f81(_0x10beb6['result'][_0x46c1('0x13')]);}})[_0x46c1('0x14')](function(_0x856b6f){logger['error'](_0x46c1('0xc'),_0x35936b,_0x856b6f);_0x23d9f7(_0x856b6f);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index bd8d9f7..1820f92 100644 --- a/server/api/chatTransferReport/index.js +++ b/server/api/chatTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4e86=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','/describe','describe','post','/:id','update','delete','destroy','exports','util','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4e86,0x1f2));var _0x64e8=function(_0x2be82e,_0x1b042b){_0x2be82e=_0x2be82e-0x0;var _0x4e0410=_0x4e86[_0x2be82e];return _0x4e0410;};'use strict';var multer=require('multer');var util=require(_0x64e8('0x0'));var path=require(_0x64e8('0x1'));var timeout=require(_0x64e8('0x2'));var express=require(_0x64e8('0x3'));var router=express[_0x64e8('0x4')]();var fs_extra=require(_0x64e8('0x5'));var auth=require(_0x64e8('0x6'));var interaction=require(_0x64e8('0x7'));var config=require(_0x64e8('0x8'));var controller=require(_0x64e8('0x9'));router[_0x64e8('0xa')]('/',auth[_0x64e8('0xb')](),controller['index']);router['get'](_0x64e8('0xc'),auth[_0x64e8('0xb')](),controller[_0x64e8('0xd')]);router[_0x64e8('0xa')]('/:id',auth[_0x64e8('0xb')](),controller['show']);router[_0x64e8('0xe')]('/',auth[_0x64e8('0xb')](),controller['create']);router['put'](_0x64e8('0xf'),auth[_0x64e8('0xb')](),controller[_0x64e8('0x10')]);router[_0x64e8('0x11')](_0x64e8('0xf'),auth[_0x64e8('0xb')](),controller[_0x64e8('0x12')]);module[_0x64e8('0x13')]=router; \ No newline at end of file +var _0xef02=['path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','/:id','post','create','put','update','destroy','exports','util'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xef02,0x1c1));var _0x2ef0=function(_0x2067e9,_0x5e6a97){_0x2067e9=_0x2067e9-0x0;var _0x280ce4=_0xef02[_0x2067e9];return _0x280ce4;};'use strict';var multer=require('multer');var util=require(_0x2ef0('0x0'));var path=require(_0x2ef0('0x1'));var timeout=require(_0x2ef0('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2ef0('0x3'));var auth=require(_0x2ef0('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2ef0('0x5'));var controller=require(_0x2ef0('0x6'));router[_0x2ef0('0x7')]('/',auth[_0x2ef0('0x8')](),controller[_0x2ef0('0x9')]);router[_0x2ef0('0x7')](_0x2ef0('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x2ef0('0x7')](_0x2ef0('0xb'),auth[_0x2ef0('0x8')](),controller['show']);router[_0x2ef0('0xc')]('/',auth[_0x2ef0('0x8')](),controller[_0x2ef0('0xd')]);router[_0x2ef0('0xe')](_0x2ef0('0xb'),auth['isAuthenticated'](),controller[_0x2ef0('0xf')]);router['delete'](_0x2ef0('0xb'),auth[_0x2ef0('0x8')](),controller[_0x2ef0('0x10')]);module[_0x2ef0('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 3e22839..9cd9edd 100644 --- a/server/api/chatWebsite/chatWebsite.attributes.js +++ b/server/api/chatWebsite/chatWebsite.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb842=['sequelize','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','TEXT','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}'];(function(_0x43bdf1,_0x41737e){var _0x67f96e=function(_0x5a4db4){while(--_0x5a4db4){_0x43bdf1['push'](_0x43bdf1['shift']());}};_0x67f96e(++_0x41737e);}(_0xb842,0x1ef));var _0x2b84=function(_0x72895a,_0x433607){_0x72895a=_0x72895a-0x0;var _0x5226d5=_0xb842[_0x72895a];return _0x5226d5;};'use strict';var Sequelize=require(_0x2b84('0x0'));var rs=require(_0x2b84('0x1'));module['exports']={'name':{'type':Sequelize[_0x2b84('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x2b84('0x2')],'allowNull':![],'unique':_0x2b84('0x3')},'description':{'type':Sequelize[_0x2b84('0x2')]},'mapKey':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x2b84('0x4')},'key':{'type':Sequelize[_0x2b84('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':_0x2b84('0x5')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x2b84('0x2')],'allowNull':![],'defaultValue':_0x2b84('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2b84('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x2b84('0x2')],'allowNull':![],'defaultValue':_0x2b84('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x2b84('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x2b84('0x2')]},'animation':{'type':Sequelize[_0x2b84('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x2b84('0xa')](_0x2b84('0xb'),_0x2b84('0xc')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':_0x2b84('0xd')},'start_chat_button':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':_0x2b84('0xe')},'offline_chat_button':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':_0x2b84('0xf')},'header_offline':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':_0x2b84('0x10')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x2b84('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x2b84('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':_0x2b84('0x11')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x2b84('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':_0x2b84('0x13')},'placeholderMessage':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':_0x2b84('0x14')},'closingMessage':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':_0x2b84('0x15')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x2b84('0xf')},'skipMessageButton':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':_0x2b84('0x16')},'conditionAgreement':{'type':Sequelize[_0x2b84('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x2b84('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x2b84('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x2b84('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':_0x2b84('0x17')},'ratingType':{'type':Sequelize['ENUM'](_0x2b84('0x18'),_0x2b84('0x19')),'defaultValue':_0x2b84('0x18')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x2b84('0x1a')],'defaultValue':function(){return JSON[_0x2b84('0x1b')]({'items':[{'type':_0x2b84('0x1c'),'variable':null,'config':{'placeholder':_0x2b84('0x1d'),'type':_0x2b84('0x1e'),'required':!![]},'props':{'title':_0x2b84('0x1d'),'helpText':''}},{'type':_0x2b84('0x1c'),'props':{'title':_0x2b84('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x2b84('0x4'),'type':_0x2b84('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x2b84('0x1f')](_0x2b84('0x20'))?JSON[_0x2b84('0x21')](this[_0x2b84('0x1f')](_0x2b84('0x20'))):{};},'set':function(_0xcabe7a){return this[_0x2b84('0x22')](_0x2b84('0x20'),JSON['stringify'](_0xcabe7a));}},'offlineForm':{'type':Sequelize[_0x2b84('0x1a')],'defaultValue':function(){return JSON[_0x2b84('0x1b')]({'items':[{'type':_0x2b84('0x1c'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x2b84('0x4'),'type':_0x2b84('0x4')},'variable':null},{'type':_0x2b84('0x23'),'config':{'placeholder':'Comments'},'props':{'title':_0x2b84('0x24'),'helpText':_0x2b84('0x25')}}],'fromKey':0x0});},'get':function(){return this['getDataValue']('offlineForm')?JSON[_0x2b84('0x21')](this['getDataValue'](_0x2b84('0x26'))):{};},'set':function(_0x537cb7){return this['setDataValue']('offlineForm',JSON['stringify'](_0x537cb7));}},'token':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':function(){return rs[_0x2b84('0x27')]();}},'autoclose':{'type':Sequelize[_0x2b84('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x2b84('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x2b84('0x2')]},'forwardOffline':{'type':Sequelize[_0x2b84('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x2b84('0x2')]},'waitingTitle':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':_0x2b84('0x28')},'waitingMessage':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':_0x2b84('0x29')},'offlineMessageSubject':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':_0x2b84('0x2a')},'offlineMessageBody':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':_0x2b84('0x2b')},'enableUnmanagedNote':{'type':Sequelize[_0x2b84('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x2b84('0x2c')},'skipUnmanaged':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':_0x2b84('0x16')},'sendUnmanaged':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':_0x2b84('0xf')},'enableCustomerAttachment':{'type':Sequelize[_0x2b84('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x2b84('0x1a')]},'showAgentAvatar':{'type':Sequelize[_0x2b84('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x2b84('0x2')]},'notificationTemplate':{'type':Sequelize[_0x2b84('0x1a')],'defaultValue':function(){return _0x2b84('0x2d');}},'notificationSound':{'type':Sequelize[_0x2b84('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x2b84('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x2b84('0x2e')},'waitForTheAssignedAgent':{'type':Sequelize[_0x2b84('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x2b84('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':_0x2b84('0x2f')},'verticalAlignment':{'type':Sequelize[_0x2b84('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x2b84('0x30')},'messagesAlignment':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':_0x2b84('0x31')},'defaultTitle':{'type':Sequelize[_0x2b84('0x2')]},'customerAvatar':{'type':Sequelize[_0x2b84('0x1a')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x2b84('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x2b84('0x2')],'allowNull':![],'defaultValue':_0x2b84('0x32'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2b84('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2b84('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2b84('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x2b84('0x1a')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2b84('0x8')],'comment':_0x2b84('0x33')},'mandatoryDisposition':{'type':Sequelize[_0x2b84('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4b4a94){if(!_0x4b4a94)this['setDataValue'](_0x2b84('0x34'),null);this[_0x2b84('0x22')](_0x2b84('0x35'),_0x4b4a94);}},'vidaooEscalation':{'type':Sequelize[_0x2b84('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x2b84('0x2')]},'vidaooTopic':{'type':Sequelize[_0x2b84('0x2')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x2b84('0x36');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x2b84('0x1a')]}}; \ No newline at end of file +var _0x3900=['alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','STRING','address','email','#011F6A','#ffffff','INTEGER','ENUM','squared','Chat','Send','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','stringify','text','name','getDataValue','onlineForm','parse','setDataValue','input','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','website_alias','bottom_right'];(function(_0x17e375,_0x383e48){var _0x4bded5=function(_0x77d54a){while(--_0x77d54a){_0x17e375['push'](_0x17e375['shift']());}};_0x4bded5(++_0x383e48);}(_0x3900,0xcd));var _0x0390=function(_0x5756f8,_0x22b6d5){_0x5756f8=_0x5756f8-0x0;var _0x3bb749=_0x3900[_0x5756f8];return _0x3bb749;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x0390('0x0'));module['exports']={'name':{'type':Sequelize[_0x0390('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0x0390('0x1')],'allowNull':![],'unique':_0x0390('0x2')},'description':{'type':Sequelize[_0x0390('0x1')]},'mapKey':{'type':Sequelize[_0x0390('0x1')],'defaultValue':_0x0390('0x3')},'mapKeyOffline':{'type':Sequelize[_0x0390('0x1')],'defaultValue':_0x0390('0x3')},'key':{'type':Sequelize[_0x0390('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x0390('0x1')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x0390('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x0390('0x1')],'allowNull':![],'defaultValue':_0x0390('0x4'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0390('0x4'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x0390('0x1')],'allowNull':![],'defaultValue':_0x0390('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x0390('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x0390('0x1')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x0390('0x7')]('rounded',_0x0390('0x8')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x0390('0x1')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x0390('0x1')],'defaultValue':_0x0390('0x9')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x0390('0xa')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x0390('0xb')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x0390('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x0390('0xc')},'defaultWhiteLabel':{'type':Sequelize[_0x0390('0xb')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x0390('0xd')]},'closingQuestion':{'type':Sequelize[_0x0390('0x1')],'defaultValue':_0x0390('0xe')},'formSubmitSuccessMessage':{'type':Sequelize[_0x0390('0x1')],'defaultValue':_0x0390('0xf')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0390('0x10')},'noteTitle':{'type':Sequelize[_0x0390('0x1')],'defaultValue':_0x0390('0x11')},'placeholderMessage':{'type':Sequelize[_0x0390('0x1')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x0390('0x1')],'defaultValue':_0x0390('0x12')},'closingMessageButton':{'type':Sequelize[_0x0390('0x1')],'defaultValue':_0x0390('0xa')},'skipMessageButton':{'type':Sequelize[_0x0390('0x1')],'defaultValue':_0x0390('0x13')},'conditionAgreement':{'type':Sequelize[_0x0390('0xb')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x0390('0xb')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x0390('0xb')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x0390('0xb')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x0390('0x1')],'defaultValue':_0x0390('0x14')},'ratingType':{'type':Sequelize[_0x0390('0x7')]('star','thumb'),'defaultValue':_0x0390('0x15')},'ratingStarsNumber':{'type':Sequelize[_0x0390('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x0390('0xd')],'defaultValue':function(){return JSON[_0x0390('0x16')]({'items':[{'type':'input','variable':null,'config':{'placeholder':'name','type':_0x0390('0x17'),'required':!![]},'props':{'title':_0x0390('0x18'),'helpText':''}},{'type':'input','props':{'title':_0x0390('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x0390('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x0390('0x19')](_0x0390('0x1a'))?JSON[_0x0390('0x1b')](this[_0x0390('0x19')](_0x0390('0x1a'))):{};},'set':function(_0x13b3e4){return this[_0x0390('0x1c')](_0x0390('0x1a'),JSON[_0x0390('0x16')](_0x13b3e4));}},'offlineForm':{'type':Sequelize[_0x0390('0xd')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x0390('0x1d'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x0390('0x3'),'type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':_0x0390('0x1e')},'props':{'title':_0x0390('0x1e'),'helpText':_0x0390('0x1f')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x0390('0x20'))?JSON[_0x0390('0x1b')](this['getDataValue'](_0x0390('0x20'))):{};},'set':function(_0x51981c){return this['setDataValue'](_0x0390('0x20'),JSON[_0x0390('0x16')](_0x51981c));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x0390('0x21')]();}},'autoclose':{'type':Sequelize[_0x0390('0xb')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x0390('0xb')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x0390('0x1')]},'waitingTitle':{'type':Sequelize[_0x0390('0x1')],'defaultValue':_0x0390('0x22')},'waitingMessage':{'type':Sequelize[_0x0390('0x1')],'defaultValue':_0x0390('0x23')},'offlineMessageSubject':{'type':Sequelize[_0x0390('0x1')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x0390('0x1')],'defaultValue':_0x0390('0x24')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x0390('0x1')],'defaultValue':_0x0390('0x25')},'skipUnmanaged':{'type':Sequelize[_0x0390('0x1')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x0390('0x1')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x0390('0xb')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x0390('0xd')]},'showAgentAvatar':{'type':Sequelize[_0x0390('0xb')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x0390('0x1')]},'notificationTemplate':{'type':Sequelize[_0x0390('0xd')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x0390('0x26')},'waitForTheAssignedAgent':{'type':Sequelize[_0x0390('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x0390('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x0390('0x1')],'defaultValue':_0x0390('0x27')},'verticalAlignment':{'type':Sequelize[_0x0390('0x6')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x0390('0x1')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x0390('0x1')],'defaultValue':_0x0390('0x28')},'defaultTitle':{'type':Sequelize[_0x0390('0x1')]},'customerAvatar':{'type':Sequelize[_0x0390('0xd')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x0390('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x0390('0x1')],'allowNull':![],'defaultValue':_0x0390('0x29'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x0390('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0390('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x0390('0x1')],'defaultValue':_0x0390('0x2a')},'systemAvatar':{'type':Sequelize[_0x0390('0xd')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0390('0x6')],'comment':_0x0390('0x2b')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x0390('0x2c'),'set':function(_0x3fe751){if(!_0x3fe751)this['setDataValue'](_0x0390('0x2d'),null);this[_0x0390('0x1c')](_0x0390('0x2e'),_0x3fe751);}},'vidaooEscalation':{'type':Sequelize[_0x0390('0xb')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x0390('0x1')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0390('0x2f')},'vidaooNote':{'type':Sequelize[_0x0390('0x1')],'defaultValue':function(){return _0x0390('0x30');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x0390('0xb')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x0390('0xd')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 4d3ab75..c3e29ff 100644 --- a/server/api/chatWebsite/chatWebsite.controller.js +++ b/server/api/chatWebsite/chatWebsite.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb3e5=['pick','ChatWebsiteId','include','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','addAvatar','agentAvatar','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','server/files/images/logos/','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','download','notify','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','Applications','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','list','orderBy','priority','asc','from','contact','headers','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','autoclose','push','applications','close','unmanaged','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','queueId','queue','startRouting','EventManager','ListId','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','mimetype','server','files','attachments','basename','openNewInteraction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','SendMail','sendMail','email','originalname','subjectOffline','toPairsIn','offlineMessageSubject','Chat','MailAccountId','NotifyMailAccount','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','increment','readFileSync','server/files/chat/iframe.ejs','URL','address','origin','3.5.0','remote','x-real-ip','connection','remoteAddress','virtual','replace','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','sendStatus','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','getFields','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','removeAgents','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','lodash','querystring','ioredis','jayson/promise','url','../../components/parsers/qs','api','APIOutOfIntervalError','../../errors/api','APINotFoundError','handleError','defaults','register','http','client','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','json','limit','undefined','count','offset','set','Content-Range','update','then','destroy','get','UserProfileResource','stack','name','send','Command','getSnippet','format','iftime\x20%s,%s','timezone','iftime\x20%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','catch','inspect','map','Interval','Intervals','all','some','setUA','user-agent','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','unknown','device','vendor','%s\x20%s\x20%s','model','type','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','findOne'];(function(_0x574a38,_0x23c116){var _0x47084c=function(_0x1a2e6a){while(--_0x1a2e6a){_0x574a38['push'](_0x574a38['shift']());}};_0x47084c(++_0x23c116);}(_0xb3e5,0xb9));var _0x5b3e=function(_0x55b114,_0xe1c816){_0x55b114=_0x55b114-0x0;var _0xa1156a=_0xb3e5[_0x55b114];return _0xa1156a;};'use strict';var Mustache=require(_0x5b3e('0x0'));var util=require(_0x5b3e('0x1'));var path=require(_0x5b3e('0x2'));var ejs=require(_0x5b3e('0x3'));var fs=require('fs');var fs_extra=require(_0x5b3e('0x4'));var _=require(_0x5b3e('0x5'));var querystring=require(_0x5b3e('0x6'));var htmlToText=require('html-to-text');var Redis=require(_0x5b3e('0x7'));var jayson=require(_0x5b3e('0x8'));var url=require(_0x5b3e('0x9'));var qs=require(_0x5b3e('0xa'));var logger=require('../../config/logger')(_0x5b3e('0xb'));var config=require('../../config/environment');var APIOutOfIntervalError=require('../../errors/api')[_0x5b3e('0xc')];var APINotFoundError=require(_0x5b3e('0xd'))[_0x5b3e('0xe')];var APIHandleError=require(_0x5b3e('0xd'))[_0x5b3e('0xf')];var db=require('../../mysqldb')['db'];config['redis']=_[_0x5b3e('0x10')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatWebsite.socket')[_0x5b3e('0x11')](socket);var client=jayson['client'][_0x5b3e('0x12')]({'port':0x232c});var client9002=jayson[_0x5b3e('0x13')][_0x5b3e('0x12')]({'port':0x232a});var client9003=jayson[_0x5b3e('0x13')][_0x5b3e('0x12')]({'port':0x232b});var client9001=jayson['client'][_0x5b3e('0x12')]({'port':0x2329});function respondWithRpcPromise(_0x3ed8d2,_0x1b7740,_0x1e27cb,_0x30a73f){return new Promise(function(_0x21499d,_0x51322a){var _0x3b5e8b=_0x30a73f||client;return _0x3b5e8b[_0x5b3e('0x14')](_0x3ed8d2,_0x1e27cb)['then'](function(_0x548a66){logger[_0x5b3e('0x15')](_0x5b3e('0x16'),_0x1b7740,_0x5b3e('0x17'));logger[_0x5b3e('0x18')](_0x5b3e('0x19'),_0x1b7740,_0x5b3e('0x17'),JSON[_0x5b3e('0x1a')](_0x548a66));if(_0x548a66[_0x5b3e('0x1b')]){if(_0x548a66['error'][_0x5b3e('0x1c')]===0x1f4){logger['error'](_0x5b3e('0x16'),_0x1b7740,_0x548a66[_0x5b3e('0x1b')][_0x5b3e('0x1d')]);return _0x51322a(_0x548a66['error'][_0x5b3e('0x1d')]);}logger['error'](_0x5b3e('0x16'),_0x1b7740,_0x548a66[_0x5b3e('0x1b')]['message']);return _0x21499d(_0x548a66[_0x5b3e('0x1b')][_0x5b3e('0x1d')]);}else{logger[_0x5b3e('0x15')](_0x5b3e('0x16'),_0x1b7740,_0x5b3e('0x17'));_0x21499d(_0x548a66[_0x5b3e('0x1e')][_0x5b3e('0x1d')]);}})['catch'](function(_0xf582e5){logger[_0x5b3e('0x1b')](_0x5b3e('0x16'),_0x1b7740,_0xf582e5);_0x51322a(_0xf582e5);});});}function respondWithStatusCode(_0x45a90e,_0x16f5e6){_0x16f5e6=_0x16f5e6||0xcc;return function(_0x1470d6){if(_0x1470d6){return _0x45a90e['sendStatus'](_0x16f5e6);}return _0x45a90e[_0x5b3e('0x1f')](_0x16f5e6)[_0x5b3e('0x20')]();};}function respondWithResult(_0x5d2347,_0x1a8a1c){_0x1a8a1c=_0x1a8a1c||0xc8;return function(_0x48e052){if(_0x48e052){return _0x5d2347[_0x5b3e('0x1f')](_0x1a8a1c)[_0x5b3e('0x21')](_0x48e052);}};}function respondWithFilteredResult(_0x59f95f,_0xd3f0e6){return function(_0x217bba){if(_0x217bba){var _0x1619ef=typeof _0xd3f0e6['offset']==='undefined'&&typeof _0xd3f0e6[_0x5b3e('0x22')]===_0x5b3e('0x23');var _0x4b6b23=_0x217bba[_0x5b3e('0x24')];var _0xf19eca=_0x1619ef?0x0:_0xd3f0e6[_0x5b3e('0x25')];var _0x466d0c=_0x1619ef?_0x217bba['count']:_0xd3f0e6[_0x5b3e('0x25')]+_0xd3f0e6[_0x5b3e('0x22')];var _0x281e6a;if(_0x466d0c>=_0x4b6b23){_0x466d0c=_0x4b6b23;_0x281e6a=0xc8;}else{_0x281e6a=0xce;}_0x59f95f[_0x5b3e('0x1f')](_0x281e6a);return _0x59f95f[_0x5b3e('0x26')](_0x5b3e('0x27'),_0xf19eca+'-'+_0x466d0c+'/'+_0x4b6b23)[_0x5b3e('0x21')](_0x217bba);}return null;};}function saveUpdates(_0x536206){return function(_0x13ab09){if(_0x13ab09){return _0x13ab09[_0x5b3e('0x28')](_0x536206)[_0x5b3e('0x29')](function(_0x16edd5){return _0x16edd5;});}return null;};}function removeEntity(_0x3547f7){return function(_0x1db87b){if(_0x1db87b){return _0x1db87b[_0x5b3e('0x2a')]()[_0x5b3e('0x29')](function(){var _0xcb5f0e=_0x1db87b[_0x5b3e('0x2b')]({'plain':!![]});var _0x186c8f='ChatWebsites';return db[_0x5b3e('0x2c')]['destroy']({'where':{'type':_0x186c8f,'resourceId':_0xcb5f0e['id']}})['then'](function(){return _0x1db87b;});})[_0x5b3e('0x29')](function(){_0x3547f7[_0x5b3e('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c43df){return function(_0xedc72b){if(!_0xedc72b){_0x2c43df['sendStatus'](0x194);}return _0xedc72b;};}function handleError(_0x33e60d,_0x4eccbf){_0x4eccbf=_0x4eccbf||0x1f4;return function(_0x3478f9){logger[_0x5b3e('0x1b')](_0x3478f9[_0x5b3e('0x2d')]);if(_0x3478f9['name']){delete _0x3478f9[_0x5b3e('0x2e')];}_0x33e60d[_0x5b3e('0x1f')](_0x4eccbf)[_0x5b3e('0x2f')](_0x3478f9);};}function iftimePromise(_0x18a451,_0x29d8d0){return respondWithRpcPromise(_0x5b3e('0x30'),_0x5b3e('0x31'),{'command':_0x29d8d0['timezone']?util[_0x5b3e('0x32')](_0x5b3e('0x33'),_0x18a451['interval'],_0x29d8d0[_0x5b3e('0x34')]):util[_0x5b3e('0x32')](_0x5b3e('0x35'),_0x18a451[_0x5b3e('0x36')])},client9002)[_0x5b3e('0x29')](function(_0x528afb){var _0x5603e5=_0x528afb&&_0x528afb[_0x5b3e('0x37')](_0x5b3e('0x38'))>=0x0?!![]:![];logger['info'](_0x5b3e('0x39'),_0x29d8d0['id'],_0x18a451['id'],_0x18a451[_0x5b3e('0x36')],_0x5603e5?'ONLINE':_0x5b3e('0x3a'),_0x29d8d0[_0x5b3e('0x34')]?_0x29d8d0[_0x5b3e('0x34')]:_0x5b3e('0x3b'));return _0x5603e5;})[_0x5b3e('0x3c')](function(_0x46c73f){logger[_0x5b3e('0x1b')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x29d8d0['id'],_0x18a451['id'],_0x18a451[_0x5b3e('0x36')],util[_0x5b3e('0x3d')](_0x46c73f,{'showHidden':![],'depth':null}),_0x29d8d0[_0x5b3e('0x34')]?_0x29d8d0[_0x5b3e('0x34')]:_0x5b3e('0x3b'));return![];});}function checkWebsiteIntervals(_0x1373cb){var _0xb0ac69=_[_0x5b3e('0x3e')](_0x1373cb[_0x5b3e('0x3f')][_0x5b3e('0x40')],function(_0x5dc88e){var _0x546a9e=_0x5dc88e[_0x5b3e('0x2b')]({'plain':!![]});return iftimePromise(_0x546a9e,_0x1373cb);});return Promise[_0x5b3e('0x41')](_0xb0ac69)[_0x5b3e('0x29')](function(_0xad3af9){return _[_0x5b3e('0x42')](_0xad3af9);});}function createInteractionObject(_0xdc6508,_0x3a2178,_0x40b74f,_0x3c57d7){var _0xdbeee7=require('user-agent-parser');var _0x43dc0b=new _0xdbeee7();var _0x12ffd3=_0x43dc0b[_0x5b3e('0x43')](_0x40b74f[_0x5b3e('0x44')])['getResult']();var _0x2fb6be=_0x3a2178['customerIp'];if(_0x40b74f['cf-connecting-ip']){_0x2fb6be=_0x40b74f['cf-connecting-ip'];}else if(_0x40b74f[_0x5b3e('0x45')]){_0x2fb6be=_['first'](_0x40b74f['x-forwarded-for'][_0x5b3e('0x46')](','));}return{'ContactId':_0x3c57d7['id'],'ChatWebsiteId':_0xdc6508,'from':(_0x3c57d7[_0x5b3e('0x47')]||'')+'\x20'+(_0x3c57d7[_0x5b3e('0x48')]||''),'customerIp':_0x2fb6be,'customerPort':_0x40b74f[_0x5b3e('0x49')]?_0x40b74f[_0x5b3e('0x49')]:null,'referer':_0x3a2178[_0x5b3e('0x4a')],'browserName':_0x12ffd3[_0x5b3e('0x4b')][_0x5b3e('0x2e')]&&_0x12ffd3[_0x5b3e('0x4b')][_0x5b3e('0x4c')]?util[_0x5b3e('0x32')]('%s\x20%s',_0x12ffd3['browser'][_0x5b3e('0x2e')],_0x12ffd3['browser'][_0x5b3e('0x4c')]):_0x5b3e('0x4d'),'browserVersion':_0x12ffd3[_0x5b3e('0x4b')][_0x5b3e('0x4c')]||_0x5b3e('0x4d'),'osName':util['format']('%s\x20%s',_0x12ffd3['os'][_0x5b3e('0x2e')],_0x12ffd3['os']['version']),'osVersion':_0x12ffd3['os'][_0x5b3e('0x4c')],'deviceModel':_0x12ffd3[_0x5b3e('0x4e')]['model']&&_0x12ffd3[_0x5b3e('0x4e')][_0x5b3e('0x4f')]?util['format'](_0x5b3e('0x50'),_0x12ffd3[_0x5b3e('0x4e')][_0x5b3e('0x51')],_0x12ffd3['device'][_0x5b3e('0x4f')],_0x12ffd3[_0x5b3e('0x4e')]['type']):null,'deviceVendor':_0x12ffd3[_0x5b3e('0x4e')]['vendor'],'deviceType':_0x12ffd3[_0x5b3e('0x4e')][_0x5b3e('0x52')],'formData':JSON['stringify'](_0x3a2178)};}exports[_0x5b3e('0x53')]=function(_0x3a0d6c,_0x4146d4){var _0x166cda={'include':[{'model':db[_0x5b3e('0x54')],'as':_0x5b3e('0x55')}]},_0x3d4275={},_0x4835ef={'count':0x0,'rows':[]};var _0x5a6f45=_['map'](db[_0x5b3e('0x56')][_0x5b3e('0x57')],function(_0x50f97e){return{'name':_0x50f97e[_0x5b3e('0x58')],'type':_0x50f97e[_0x5b3e('0x52')]['key']};});_0x3d4275[_0x5b3e('0x51')]=_[_0x5b3e('0x3e')](_0x5a6f45,'name');_0x3d4275[_0x5b3e('0x59')]=_[_0x5b3e('0x5a')](_0x3a0d6c[_0x5b3e('0x59')]);_0x3d4275[_0x5b3e('0x5b')]=_[_0x5b3e('0x5c')](_0x3d4275[_0x5b3e('0x51')],_0x3d4275[_0x5b3e('0x59')]);_0x166cda['attributes']=_['intersection'](_0x3d4275['model'],qs['fields'](_0x3a0d6c[_0x5b3e('0x59')][_0x5b3e('0x5d')]));_0x166cda[_0x5b3e('0x5e')]=_0x166cda[_0x5b3e('0x5e')][_0x5b3e('0x5f')]?_0x166cda[_0x5b3e('0x5e')]:_0x3d4275[_0x5b3e('0x51')];if(!_0x3a0d6c[_0x5b3e('0x59')][_0x5b3e('0x60')](_0x5b3e('0x61'))){_0x166cda[_0x5b3e('0x22')]=qs[_0x5b3e('0x22')](_0x3a0d6c[_0x5b3e('0x59')][_0x5b3e('0x22')]);_0x166cda['offset']=qs['offset'](_0x3a0d6c[_0x5b3e('0x59')][_0x5b3e('0x25')]);}_0x166cda[_0x5b3e('0x62')]=qs['sort'](_0x3a0d6c['query'][_0x5b3e('0x63')]);_0x166cda[_0x5b3e('0x64')]=qs[_0x5b3e('0x5b')](_['pick'](_0x3a0d6c[_0x5b3e('0x59')],_0x3d4275[_0x5b3e('0x5b')]),_0x5a6f45);if(_0x3a0d6c[_0x5b3e('0x59')]['filter']){_0x166cda[_0x5b3e('0x64')]=_[_0x5b3e('0x65')](_0x166cda['where'],{'$or':_[_0x5b3e('0x3e')](_0x5a6f45,function(_0x1a20d4){if(_0x1a20d4[_0x5b3e('0x52')]!==_0x5b3e('0x66')){var _0x1a83b1={};_0x1a83b1[_0x1a20d4[_0x5b3e('0x2e')]]={'$like':'%'+_0x3a0d6c[_0x5b3e('0x59')][_0x5b3e('0x67')]+'%'};return _0x1a83b1;}})});}_0x166cda=_[_0x5b3e('0x65')]({},_0x166cda,_0x3a0d6c[_0x5b3e('0x68')]);var _0x376a00={'where':_0x166cda[_0x5b3e('0x64')]};return db[_0x5b3e('0x56')][_0x5b3e('0x24')](_0x376a00)[_0x5b3e('0x29')](function(_0x237765){_0x4835ef[_0x5b3e('0x24')]=_0x237765;if(_0x3a0d6c['query'][_0x5b3e('0x69')]){_0x166cda['include']=[{'all':!![]}];}return db[_0x5b3e('0x56')][_0x5b3e('0x6a')](_0x166cda);})[_0x5b3e('0x29')](function(_0x33fb47){_0x4835ef[_0x5b3e('0x6b')]=_0x33fb47;return _0x4835ef;})['then'](respondWithFilteredResult(_0x4146d4,_0x166cda))[_0x5b3e('0x3c')](handleError(_0x4146d4,null));};exports[_0x5b3e('0x6c')]=function(_0x1774b3,_0x223eb3){var _0x39a95f={'raw':![],'where':{'id':_0x1774b3[_0x5b3e('0x6d')]['id']},'include':[{'model':db['Pause'],'as':_0x5b3e('0x55')}]},_0x5e873f={};_0x5e873f[_0x5b3e('0x51')]=_[_0x5b3e('0x5a')](db[_0x5b3e('0x56')][_0x5b3e('0x57')]);_0x5e873f[_0x5b3e('0x59')]=_[_0x5b3e('0x5a')](_0x1774b3[_0x5b3e('0x59')]);_0x5e873f[_0x5b3e('0x5b')]=_['intersection'](_0x5e873f[_0x5b3e('0x51')],_0x5e873f[_0x5b3e('0x59')]);_0x39a95f['attributes']=_[_0x5b3e('0x5c')](_0x5e873f['model'],qs[_0x5b3e('0x5d')](_0x1774b3[_0x5b3e('0x59')][_0x5b3e('0x5d')]));_0x39a95f[_0x5b3e('0x5e')]=_0x39a95f[_0x5b3e('0x5e')][_0x5b3e('0x5f')]?_0x39a95f['attributes']:_0x5e873f[_0x5b3e('0x51')];if(_0x1774b3['query'][_0x5b3e('0x69')]){_0x39a95f['include']=[{'all':!![]}];}_0x39a95f=_[_0x5b3e('0x65')]({},_0x39a95f,_0x1774b3[_0x5b3e('0x68')]);return db[_0x5b3e('0x56')][_0x5b3e('0x6e')](_0x39a95f)[_0x5b3e('0x29')](handleEntityNotFound(_0x223eb3,null))[_0x5b3e('0x29')](respondWithResult(_0x223eb3,null))['catch'](handleError(_0x223eb3,null));};exports[_0x5b3e('0x6f')]=function(_0x12de91,_0x518e61){return db['ChatWebsite']['create'](_0x12de91[_0x5b3e('0x70')],{})[_0x5b3e('0x29')](function(_0x42b073){var _0x59b77c=_0x12de91[_0x5b3e('0x71')][_0x5b3e('0x2b')]({'plain':!![]});if(!_0x59b77c)throw new Error(_0x5b3e('0x72'));if(_0x59b77c[_0x5b3e('0x73')]===_0x5b3e('0x71')){var _0x17b229=_0x42b073[_0x5b3e('0x2b')]({'plain':!![]});var _0x448cbd=_0x5b3e('0x74');return db[_0x5b3e('0x75')][_0x5b3e('0x6e')]({'where':{'name':_0x448cbd,'userProfileId':_0x59b77c['userProfileId']},'raw':!![]})[_0x5b3e('0x29')](function(_0x384d03){if(_0x384d03&&_0x384d03['autoAssociation']===0x0){return db[_0x5b3e('0x2c')][_0x5b3e('0x6f')]({'name':_0x17b229[_0x5b3e('0x2e')],'resourceId':_0x17b229['id'],'type':_0x384d03['name'],'sectionId':_0x384d03['id']},{})['then'](function(){return _0x42b073;});}else{return _0x42b073;}})[_0x5b3e('0x3c')](function(_0x342bf7){logger[_0x5b3e('0x1b')](_0x5b3e('0x76'),_0x342bf7);throw _0x342bf7;});}return _0x42b073;})['then'](respondWithResult(_0x518e61,0xc9))[_0x5b3e('0x3c')](handleError(_0x518e61,null));};exports[_0x5b3e('0x28')]=function(_0x4c05b3,_0x24d2e9){if(_0x4c05b3['body']['id']){delete _0x4c05b3['body']['id'];}return db[_0x5b3e('0x56')][_0x5b3e('0x6e')]({'where':{'id':_0x4c05b3[_0x5b3e('0x6d')]['id']},'include':[{'model':db['Pause'],'as':_0x5b3e('0x55')}]})[_0x5b3e('0x29')](handleEntityNotFound(_0x24d2e9,null))[_0x5b3e('0x29')](saveUpdates(_0x4c05b3[_0x5b3e('0x70')],null))['then'](respondWithResult(_0x24d2e9,null))[_0x5b3e('0x3c')](handleError(_0x24d2e9,null));};exports[_0x5b3e('0x2a')]=function(_0x170efe,_0x1c6e31){return db[_0x5b3e('0x56')]['find']({'where':{'id':_0x170efe['params']['id']}})[_0x5b3e('0x29')](handleEntityNotFound(_0x1c6e31,null))['then'](removeEntity(_0x1c6e31,null))[_0x5b3e('0x3c')](handleError(_0x1c6e31,null));};exports['describe']=function(_0x19cb12,_0x3281d5){return db[_0x5b3e('0x56')][_0x5b3e('0x77')]()[_0x5b3e('0x29')](respondWithResult(_0x3281d5,null))[_0x5b3e('0x3c')](handleError(_0x3281d5,null));};exports[_0x5b3e('0x78')]=function(_0x58e12c,_0x38b830){if(_0x58e12c[_0x5b3e('0x70')]['id']){delete _0x58e12c[_0x5b3e('0x70')]['id'];}return db[_0x5b3e('0x56')][_0x5b3e('0x6e')]({'where':{'id':_0x58e12c['params']['id']}})['then'](handleEntityNotFound(_0x38b830,null))[_0x5b3e('0x29')](function(_0x3d66a5){if(_0x3d66a5){_0x58e12c[_0x5b3e('0x70')]['ChatWebsiteId']=_0x3d66a5['id'];return db[_0x5b3e('0x79')][_0x5b3e('0x6f')](_0x58e12c[_0x5b3e('0x70')]);}})[_0x5b3e('0x29')](respondWithResult(_0x38b830,null))[_0x5b3e('0x3c')](handleError(_0x38b830,null));};exports[_0x5b3e('0x7a')]=function(_0x59ce5f,_0x58628b){var _0x562b55={'raw':![],'where':{}};var _0x2445a2={};var _0x28361f={'count':0x0,'rows':[]};return db[_0x5b3e('0x56')][_0x5b3e('0x7b')]({'where':{'id':_0x59ce5f[_0x5b3e('0x6d')]['id']}})[_0x5b3e('0x29')](handleEntityNotFound(_0x58628b,null))[_0x5b3e('0x29')](function(_0x2dc087){if(_0x2dc087){_0x2445a2[_0x5b3e('0x51')]=_[_0x5b3e('0x5a')](db['Disposition']['rawAttributes']);_0x2445a2['query']=_[_0x5b3e('0x5a')](_0x59ce5f['query']);_0x2445a2[_0x5b3e('0x5b')]=_['intersection'](_0x2445a2[_0x5b3e('0x51')],_0x2445a2[_0x5b3e('0x59')]);_0x562b55[_0x5b3e('0x5e')]=_[_0x5b3e('0x5c')](_0x2445a2[_0x5b3e('0x51')],qs[_0x5b3e('0x5d')](_0x59ce5f[_0x5b3e('0x59')][_0x5b3e('0x5d')]));_0x562b55[_0x5b3e('0x5e')]=_0x562b55[_0x5b3e('0x5e')]['length']?_0x562b55[_0x5b3e('0x5e')]:_0x2445a2[_0x5b3e('0x51')];if(!_0x59ce5f[_0x5b3e('0x59')][_0x5b3e('0x60')](_0x5b3e('0x61'))){_0x562b55[_0x5b3e('0x22')]=qs[_0x5b3e('0x22')](_0x59ce5f[_0x5b3e('0x59')][_0x5b3e('0x22')]);_0x562b55['offset']=qs[_0x5b3e('0x25')](_0x59ce5f['query'][_0x5b3e('0x25')]);}_0x562b55[_0x5b3e('0x62')]=qs['sort'](_0x59ce5f[_0x5b3e('0x59')][_0x5b3e('0x63')]);_0x562b55[_0x5b3e('0x64')]=qs[_0x5b3e('0x5b')](_[_0x5b3e('0x7c')](_0x59ce5f[_0x5b3e('0x59')],_0x2445a2['filters']));_0x562b55['where'][_0x5b3e('0x7d')]=_0x2dc087['id'];if(_0x59ce5f[_0x5b3e('0x59')][_0x5b3e('0x67')]){_0x562b55[_0x5b3e('0x64')]=_[_0x5b3e('0x65')](_0x562b55['where'],{'$or':_[_0x5b3e('0x3e')](_0x562b55[_0x5b3e('0x5e')],function(_0x26ca16){var _0x5a899f={};_0x5a899f[_0x26ca16]={'$like':'%'+_0x59ce5f['query'][_0x5b3e('0x67')]+'%'};return _0x5a899f;})});}_0x562b55=_[_0x5b3e('0x65')]({},_0x562b55,_0x59ce5f[_0x5b3e('0x68')]);return db[_0x5b3e('0x79')][_0x5b3e('0x24')]({'where':_0x562b55[_0x5b3e('0x64')]})[_0x5b3e('0x29')](function(_0x1e7425){_0x28361f[_0x5b3e('0x24')]=_0x1e7425;if(_0x59ce5f[_0x5b3e('0x59')][_0x5b3e('0x69')]){_0x562b55[_0x5b3e('0x7e')]=[{'all':!![]}];}return db[_0x5b3e('0x79')][_0x5b3e('0x6a')](_0x562b55);})[_0x5b3e('0x29')](function(_0x31d55a){_0x28361f[_0x5b3e('0x6b')]=_0x31d55a;return _0x28361f;});}})['then'](respondWithFilteredResult(_0x58628b,_0x562b55))[_0x5b3e('0x3c')](handleError(_0x58628b,null));};exports[_0x5b3e('0x7f')]=function(_0x3a181f,_0x3eff05){return db[_0x5b3e('0x56')][_0x5b3e('0x6e')]({'where':{'id':_0x3a181f[_0x5b3e('0x6d')]['id']}})['then'](handleEntityNotFound(_0x3eff05,null))['then'](function(_0x289ed2){if(_0x289ed2){return _0x289ed2[_0x5b3e('0x7f')](_0x3a181f[_0x5b3e('0x59')][_0x5b3e('0x80')]);}})['then'](respondWithStatusCode(_0x3eff05,null))[_0x5b3e('0x3c')](handleError(_0x3eff05,null));};exports[_0x5b3e('0x81')]=function(_0x2b47e7,_0x388873){if(_0x2b47e7[_0x5b3e('0x70')]['id']){delete _0x2b47e7[_0x5b3e('0x70')]['id'];}return db[_0x5b3e('0x56')][_0x5b3e('0x6e')]({'where':{'id':_0x2b47e7[_0x5b3e('0x6d')]['id']}})[_0x5b3e('0x29')](handleEntityNotFound(_0x388873,null))[_0x5b3e('0x29')](function(_0x3b3358){if(_0x3b3358){_0x2b47e7['body'][_0x5b3e('0x7d')]=_0x3b3358['id'];return db[_0x5b3e('0x82')][_0x5b3e('0x6f')](_0x2b47e7[_0x5b3e('0x70')]);}})['then'](respondWithResult(_0x388873,null))['catch'](handleError(_0x388873,null));};exports[_0x5b3e('0x83')]=function(_0x4af0c0,_0x57ff44){var _0x532bf4={'raw':![],'where':{}};var _0x4d25f4={};var _0x37fc92={'count':0x0,'rows':[]};return db[_0x5b3e('0x56')][_0x5b3e('0x7b')]({'where':{'id':_0x4af0c0[_0x5b3e('0x6d')]['id']}})[_0x5b3e('0x29')](handleEntityNotFound(_0x57ff44,null))[_0x5b3e('0x29')](function(_0x3d7172){if(_0x3d7172){_0x4d25f4[_0x5b3e('0x51')]=_[_0x5b3e('0x5a')](db[_0x5b3e('0x82')][_0x5b3e('0x57')]);_0x4d25f4[_0x5b3e('0x59')]=_[_0x5b3e('0x5a')](_0x4af0c0[_0x5b3e('0x59')]);_0x4d25f4['filters']=_[_0x5b3e('0x5c')](_0x4d25f4[_0x5b3e('0x51')],_0x4d25f4[_0x5b3e('0x59')]);_0x532bf4[_0x5b3e('0x5e')]=_[_0x5b3e('0x5c')](_0x4d25f4[_0x5b3e('0x51')],qs[_0x5b3e('0x5d')](_0x4af0c0['query'][_0x5b3e('0x5d')]));_0x532bf4[_0x5b3e('0x5e')]=_0x532bf4[_0x5b3e('0x5e')][_0x5b3e('0x5f')]?_0x532bf4[_0x5b3e('0x5e')]:_0x4d25f4['model'];if(!_0x4af0c0[_0x5b3e('0x59')][_0x5b3e('0x60')](_0x5b3e('0x61'))){_0x532bf4['limit']=qs['limit'](_0x4af0c0[_0x5b3e('0x59')][_0x5b3e('0x22')]);_0x532bf4[_0x5b3e('0x25')]=qs[_0x5b3e('0x25')](_0x4af0c0[_0x5b3e('0x59')]['offset']);}_0x532bf4['order']=qs['sort'](_0x4af0c0['query'][_0x5b3e('0x63')]);_0x532bf4['where']=qs['filters'](_['pick'](_0x4af0c0[_0x5b3e('0x59')],_0x4d25f4[_0x5b3e('0x5b')]));_0x532bf4[_0x5b3e('0x64')][_0x5b3e('0x7d')]=_0x3d7172['id'];if(_0x4af0c0[_0x5b3e('0x59')][_0x5b3e('0x67')]){_0x532bf4[_0x5b3e('0x64')]=_[_0x5b3e('0x65')](_0x532bf4[_0x5b3e('0x64')],{'$or':_[_0x5b3e('0x3e')](_0x532bf4[_0x5b3e('0x5e')],function(_0x4297b){var _0xe5bc84={};_0xe5bc84[_0x4297b]={'$like':'%'+_0x4af0c0['query'][_0x5b3e('0x67')]+'%'};return _0xe5bc84;})});}_0x532bf4=_[_0x5b3e('0x65')]({},_0x532bf4,_0x4af0c0[_0x5b3e('0x68')]);return db[_0x5b3e('0x82')][_0x5b3e('0x24')]({'where':_0x532bf4[_0x5b3e('0x64')]})[_0x5b3e('0x29')](function(_0x5a1801){_0x37fc92['count']=_0x5a1801;if(_0x4af0c0[_0x5b3e('0x59')]['includeAll']){_0x532bf4['include']=[{'all':!![]}];}return db[_0x5b3e('0x82')][_0x5b3e('0x6a')](_0x532bf4);})[_0x5b3e('0x29')](function(_0x2dfe4e){_0x37fc92[_0x5b3e('0x6b')]=_0x2dfe4e;return _0x37fc92;});}})[_0x5b3e('0x29')](respondWithFilteredResult(_0x57ff44,_0x532bf4))[_0x5b3e('0x3c')](handleError(_0x57ff44,null));};exports[_0x5b3e('0x84')]=function(_0x41780a,_0x2a24a5){return db['ChatWebsite'][_0x5b3e('0x6e')]({'where':{'id':_0x41780a[_0x5b3e('0x6d')]['id']}})['then'](handleEntityNotFound(_0x2a24a5,null))[_0x5b3e('0x29')](function(_0x5d31c7){if(_0x5d31c7){return _0x5d31c7['removeAnswers'](_0x41780a[_0x5b3e('0x59')][_0x5b3e('0x80')]);}})[_0x5b3e('0x29')](respondWithStatusCode(_0x2a24a5,null))[_0x5b3e('0x3c')](handleError(_0x2a24a5,null));};exports[_0x5b3e('0x85')]=function(_0x2c06f5,_0x31226b){_0x2c06f5[_0x5b3e('0x70')][_0x5b3e('0x86')]=_0x2c06f5[_0x5b3e('0x87')]['filename'];return db['ChatWebsite']['find']({'where':{'id':_0x2c06f5['params']['id']}})[_0x5b3e('0x29')](handleEntityNotFound(_0x31226b,null))[_0x5b3e('0x29')](saveUpdates(_0x2c06f5[_0x5b3e('0x70')],null))[_0x5b3e('0x29')](respondWithResult(_0x31226b,null))[_0x5b3e('0x3c')](handleError(_0x31226b,null));};exports[_0x5b3e('0x88')]=function(_0x1131b9,_0x318afe){_0x1131b9[_0x5b3e('0x70')][_0x5b3e('0x89')]=_0x1131b9['file'][_0x5b3e('0x8a')];return db[_0x5b3e('0x56')][_0x5b3e('0x6e')]({'where':{'id':_0x1131b9[_0x5b3e('0x6d')]['id']}})[_0x5b3e('0x29')](handleEntityNotFound(_0x318afe,null))[_0x5b3e('0x29')](saveUpdates(_0x1131b9[_0x5b3e('0x70')],null))[_0x5b3e('0x29')](respondWithResult(_0x318afe,null))[_0x5b3e('0x3c')](handleError(_0x318afe,null));};exports[_0x5b3e('0x8b')]=function(_0x2a70d1,_0x7c6909){_0x2a70d1[_0x5b3e('0x70')][_0x5b3e('0x8c')]=_0x2a70d1[_0x5b3e('0x87')]['filename'];return db['ChatWebsite']['find']({'where':{'id':_0x2a70d1[_0x5b3e('0x6d')]['id']}})[_0x5b3e('0x29')](handleEntityNotFound(_0x7c6909,null))[_0x5b3e('0x29')](saveUpdates(_0x2a70d1[_0x5b3e('0x70')],null))[_0x5b3e('0x29')](respondWithResult(_0x7c6909,null))[_0x5b3e('0x3c')](handleError(_0x7c6909,null));};exports[_0x5b3e('0x8d')]=function(_0x133082,_0x5cf169){_0x133082[_0x5b3e('0x70')][_0x5b3e('0x8e')]=_0x133082[_0x5b3e('0x87')][_0x5b3e('0x8a')];return db['ChatWebsite']['find']({'where':{'id':_0x133082[_0x5b3e('0x6d')]['id']}})[_0x5b3e('0x29')](handleEntityNotFound(_0x5cf169,null))['then'](saveUpdates(_0x133082['body'],null))[_0x5b3e('0x29')](respondWithResult(_0x5cf169,null))[_0x5b3e('0x3c')](handleError(_0x5cf169,null));};exports[_0x5b3e('0x8f')]=function(_0x1124bc,_0x45a1ee){var _0x2cb167=path[_0x5b3e('0x90')](config[_0x5b3e('0x91')],_0x5b3e('0x92'));var _0x4a7d45={'where':{'id':_0x1124bc['params']['id']},'attributes':['id',_0x5b3e('0x86')],'raw':!![]};var _0x7150e6=![];return require(_0x5b3e('0x93'))[_0x5b3e('0x94')]()[_0x5b3e('0x29')](function(_0x2cdd09){if(_0x2cdd09){_0x7150e6=_0x2cdd09[_0x5b3e('0x95')];}})['then'](function(){return db[_0x5b3e('0x56')]['find'](_0x4a7d45);})['then'](handleEntityNotFound(_0x45a1ee,null))[_0x5b3e('0x29')](function(_0x36857c){if(_0x36857c){if(!_[_0x5b3e('0x96')](_0x36857c[_0x5b3e('0x86')])){if(fs['existsSync'](path[_0x5b3e('0x90')](config[_0x5b3e('0x91')],_0x5b3e('0x97'),_0x36857c[_0x5b3e('0x86')]))&&_0x7150e6){_0x2cb167=path[_0x5b3e('0x90')](config[_0x5b3e('0x91')],_0x5b3e('0x97'),_0x36857c[_0x5b3e('0x86')]);}}return _0x45a1ee['download'](_0x2cb167);}})[_0x5b3e('0x3c')](handleError(_0x45a1ee,null));};exports['getAvatar']=function(_0xae81fa,_0x4ca45d){var _0x5b3b12=path[_0x5b3e('0x90')](config['root'],_0x5b3e('0x98'));var _0x1910b9={'where':{'id':_0xae81fa[_0x5b3e('0x6d')]['id']},'attributes':['id',_0x5b3e('0x89')],'raw':!![]};return db['ChatWebsite'][_0x5b3e('0x6e')](_0x1910b9)[_0x5b3e('0x29')](handleEntityNotFound(_0x4ca45d,null))[_0x5b3e('0x29')](function(_0x1b3ee4){if(_0x1b3ee4){if(!_[_0x5b3e('0x96')](_0x1b3ee4[_0x5b3e('0x89')])){if(fs[_0x5b3e('0x99')](path[_0x5b3e('0x90')](config['root'],_0x5b3e('0x9a'),_0x1b3ee4[_0x5b3e('0x89')]))){_0x5b3b12=path[_0x5b3e('0x90')](config['root'],_0x5b3e('0x9a'),_0x1b3ee4[_0x5b3e('0x89')]);}}return _0x4ca45d['download'](_0x5b3b12);}})[_0x5b3e('0x3c')](handleError(_0x4ca45d,null));};exports[_0x5b3e('0x9b')]=function(_0x534090,_0x15f0f0){var _0x16b60=path['join'](config[_0x5b3e('0x91')],_0x5b3e('0x9c'));var _0x9b4ab0={'where':{'id':_0x534090[_0x5b3e('0x6d')]['id']},'attributes':['id',_0x5b3e('0x8c'),_0x5b3e('0x9d')],'raw':!![]};return db[_0x5b3e('0x56')][_0x5b3e('0x6e')](_0x9b4ab0)['then'](handleEntityNotFound(_0x15f0f0,null))[_0x5b3e('0x29')](function(_0xc9c204){if(_0xc9c204){if(!_[_0x5b3e('0x96')](_0xc9c204['customerAvatar'])){if(fs[_0x5b3e('0x99')](path[_0x5b3e('0x90')](config[_0x5b3e('0x91')],'server/files/images/avatars/',_0xc9c204['customerAvatar']))&&_0xc9c204[_0x5b3e('0x9d')]){_0x16b60=path['join'](config['root'],_0x5b3e('0x9a'),_0xc9c204[_0x5b3e('0x8c')]);}}return _0x15f0f0['download'](_0x16b60);}})[_0x5b3e('0x3c')](handleError(_0x15f0f0,null));};exports[_0x5b3e('0x9e')]=function(_0x24cf08,_0x5a3acd){var _0x19e30d=path['join'](config[_0x5b3e('0x91')],_0x5b3e('0x9f'));var _0x33fb94={'where':{'id':_0x24cf08[_0x5b3e('0x6d')]['id']},'attributes':['id',_0x5b3e('0x8e')],'raw':!![]};return db[_0x5b3e('0x56')][_0x5b3e('0x6e')](_0x33fb94)[_0x5b3e('0x29')](handleEntityNotFound(_0x5a3acd,null))['then'](function(_0x180107){if(_0x180107){if(!_[_0x5b3e('0x96')](_0x180107[_0x5b3e('0x8e')])){if(fs[_0x5b3e('0x99')](path[_0x5b3e('0x90')](config[_0x5b3e('0x91')],_0x5b3e('0x9a'),_0x180107[_0x5b3e('0x8e')]))){_0x19e30d=path['join'](config[_0x5b3e('0x91')],'server/files/images/avatars/',_0x180107[_0x5b3e('0x8e')]);}}return _0x5a3acd[_0x5b3e('0xa0')](_0x19e30d);}})[_0x5b3e('0x3c')](handleError(_0x5a3acd,null));};exports[_0x5b3e('0xa1')]=function(_0x247153,_0x56c88d){var _0x4360ec={'body':_0x247153[_0x5b3e('0x70')],'channel':_0x5b3e('0xa2')};var _0xe31ed7=[];var _0x2579dd=[];var _0x31b962={};var _0x2a6f44=![];return db[_0x5b3e('0xa3')][_0x5b3e('0x77')]()[_0x5b3e('0x29')](function(_0x5ea5a6){if(!_0x5ea5a6){throw new db[(_0x5b3e('0xa4'))][(_0x5b3e('0xa5'))](_0x5b3e('0xa6'));}_0xe31ed7=_[_0x5b3e('0xa7')](_[_0x5b3e('0x5a')](_0x5ea5a6),[_0x5b3e('0xa8'),_0x5b3e('0xa9')]);_0x2579dd=_[_0x5b3e('0xa7')](_[_0x5b3e('0x5a')](_0x5ea5a6),[_0x5b3e('0xa8'),'updatedAt','CompanyId','ListId']);if(_0x247153[_0x5b3e('0x70')]['id']){delete _0x247153[_0x5b3e('0x70')]['id'];}if(_[_0x5b3e('0x96')](_0x247153[_0x5b3e('0x70')]['from'])){throw new db[(_0x5b3e('0xa4'))]['ValidationError'](_0x5b3e('0xaa'));}if(_[_0x5b3e('0x96')](_0x247153[_0x5b3e('0x70')]['body'])||_0x247153[_0x5b3e('0x70')][_0x5b3e('0x70')]===''){throw new db[(_0x5b3e('0xa4'))]['ValidationError'](_0x5b3e('0xab'));}if(_[_0x5b3e('0x96')](_0x247153[_0x5b3e('0x70')][_0x5b3e('0xac')])){throw new db[(_0x5b3e('0xa4'))][(_0x5b3e('0xa5'))](_0x5b3e('0xad')+_0x2579dd);}if(!_[_0x5b3e('0xae')](_0x2579dd,_0x247153['body'][_0x5b3e('0xac')])){throw new db['Sequelize']['ValidationError'](_0x5b3e('0xaf')+_0x2579dd);}_0x31b962[_0x247153[_0x5b3e('0x70')]['mapKey']]=_0x247153[_0x5b3e('0x70')]['from'];})[_0x5b3e('0x29')](function(){return db[_0x5b3e('0x56')][_0x5b3e('0x6e')]({'where':{'id':_0x247153['params']['id']},'include':[{'model':db[_0x5b3e('0xb0')],'as':_0x5b3e('0xb1'),'include':[{'model':db[_0x5b3e('0xa3')],'as':_0x5b3e('0xb2'),'where':_0x31b962,'limit':0x1,'order':[[_0x5b3e('0xa9'),'DESC']]}]},{'model':db['ChatApplication'],'as':_0x5b3e('0xb3')},{'model':db[_0x5b3e('0x3f')],'as':'Interval','include':[{'model':db[_0x5b3e('0x3f')],'as':_0x5b3e('0x40'),'attributes':['id',_0x5b3e('0x36')],'raw':!![]}]}]});})[_0x5b3e('0x29')](function(_0x2b762c){if(!_0x2b762c)throw new APINotFoundError(util[_0x5b3e('0x32')](_0x5b3e('0xb4'),_0x247153['params']['id']));if(!_0x2b762c[_0x5b3e('0x3f')]||!_0x2b762c[_0x5b3e('0x3f')]['Intervals'])return[_0x2b762c,!![]];return[_0x2b762c,checkWebsiteIntervals(_0x2b762c)];})['spread'](function(_0x5f57eb,_0x508b2f){if(!_0x508b2f)throw new APIOutOfIntervalError();if(!_0x5f57eb[_0x5b3e('0xb1')])return;_0x4360ec[_0x5b3e('0xb5')]=_0x5f57eb;_0x4360ec[_0x5b3e('0xb6')]=_0x5f57eb['List'];_0x4360ec['applications']=_[_0x5b3e('0xb7')](_0x5f57eb[_0x5b3e('0xb3')],[_0x5b3e('0xb8')],[_0x5b3e('0xb9')]);if(_0x4360ec[_0x5b3e('0xb5')][_0x5b3e('0xb3')]){delete _0x4360ec[_0x5b3e('0xb5')][_0x5b3e('0xb3')];}if(_0x4360ec['account']['List']&&_0x4360ec[_0x5b3e('0xb5')][_0x5b3e('0xb1')][_0x5b3e('0xb2')][_0x5b3e('0x5f')]){return _0x4360ec[_0x5b3e('0xb5')][_0x5b3e('0xb1')][_0x5b3e('0xb2')][0x0];}var _0x2a681b=_[_0x5b3e('0x10')](_0x247153[_0x5b3e('0x70')],{'firstName':_0x247153[_0x5b3e('0x70')][_0x5b3e('0xba')],'ListId':_0x5f57eb['ListId']});_0x2a681b[_0x247153['body'][_0x5b3e('0xac')]]=_0x247153[_0x5b3e('0x70')]['from'];return db[_0x5b3e('0xa3')][_0x5b3e('0x6f')](_0x2a681b,{'fields':_0xe31ed7,'raw':!![]});})['then'](function(_0x32906b){_0x4360ec[_0x5b3e('0xbb')]=_0x32906b;var _0x2b6cfb=createInteractionObject(_0x247153['params']['id'],_0x247153[_0x5b3e('0x70')],_0x247153[_0x5b3e('0xbc')],_0x32906b);var _0x349c76={'ChatWebsiteId':_0x247153[_0x5b3e('0x6d')]['id'],'closed':![]};if(_0x247153[_0x5b3e('0x70')]['threadId']){_0x349c76[_0x5b3e('0xbd')]=_0x247153['body']['threadId'];return db[_0x5b3e('0xbe')][_0x5b3e('0x6e')]({'where':_0x349c76})[_0x5b3e('0x29')](function(_0x207f1b){if(_0x207f1b){_0x2a6f44=!![];return _0x207f1b;}_0x2b6cfb[_0x5b3e('0xbd')]=_0x247153[_0x5b3e('0x70')][_0x5b3e('0xbd')];_0x2b6cfb[_0x5b3e('0xbf')]=_0x247153[_0x5b3e('0x70')][_0x5b3e('0xbf')];return db['ChatInteraction']['create'](_0x2b6cfb);});}_0x349c76[_0x5b3e('0xc0')]=_0x32906b['id'];if(_0x247153[_0x5b3e('0x70')]['interaction']&&_0x247153[_0x5b3e('0x70')][_0x5b3e('0xc1')]['id']){_0x349c76['id']=_0x247153['body'][_0x5b3e('0xc1')]['id'];return db[_0x5b3e('0xbe')][_0x5b3e('0x6e')]({'where':_0x349c76})[_0x5b3e('0x29')](function(_0x1b49d1){if(_0x1b49d1){_0x2a6f44=!![];return _0x1b49d1;}return db[_0x5b3e('0xbe')]['create'](_0x2b6cfb);});}return db[_0x5b3e('0xbe')][_0x5b3e('0x6f')](_0x2b6cfb);})[_0x5b3e('0x29')](function(_0x2fc748){if(!_0x2a6f44)return _0x2fc748;var _0x2c26c3={'from':(_0x4360ec[_0x5b3e('0xbb')][_0x5b3e('0x47')]||'')+'\x20'+(_0x4360ec['contact'][_0x5b3e('0x48')]||'')};if(_0x247153[_0x5b3e('0x70')][_0x5b3e('0xbd')]&&_0x247153['body'][_0x5b3e('0xc2')]&&_0x247153[_0x5b3e('0x70')][_0x5b3e('0xbd')]!=_0x247153[_0x5b3e('0x70')][_0x5b3e('0xc2')]){_0x2c26c3[_0x5b3e('0xbd')]=_0x247153[_0x5b3e('0x70')][_0x5b3e('0xc2')];}return _0x2fc748['update'](_0x2c26c3);})['then'](function(_0x580e52){_0x4360ec[_0x5b3e('0xc1')]=_0x580e52[_0x5b3e('0x2b')]({'plain':!![]});_0x4360ec[_0x5b3e('0xc1')][_0x5b3e('0xc3')]=!_0x2a6f44;if(_0x4360ec[_0x5b3e('0xc1')][_0x5b3e('0xc3')]){if(_0x4360ec['account'][_0x5b3e('0xc4')]){_0x4360ec['applications'][_0x5b3e('0xc5')]({'id':0x0,'priority':_0x4360ec[_0x5b3e('0xc6')]['length']+0x1,'app':_0x5b3e('0xc7'),'appdata':_0x5b3e('0xc8'),'interval':'*,*,*,*'});}}return db['ChatMessage']['create']({'body':_0x247153['body']['body'],'ChatWebsiteId':_0x247153[_0x5b3e('0x6d')]['id'],'ChatInteractionId':_0x580e52['id'],'direction':'in','ContactId':_0x4360ec['contact']['id'],'AttachmentId':_0x247153[_0x5b3e('0x70')][_0x5b3e('0xc9')]});})[_0x5b3e('0x29')](function(_0x37cc79){_0x4360ec[_0x5b3e('0x1d')]=_0x37cc79;if(!_0x4360ec[_0x5b3e('0xc1')][_0x5b3e('0xca')]){return;}return db[_0x5b3e('0xcb')]['find']({'attributes':['id',_0x5b3e('0x2e')],'where':{'id':_0x4360ec[_0x5b3e('0xc1')][_0x5b3e('0xca')]}});})[_0x5b3e('0x29')](function(_0x4f2039){if(_0x4f2039){_0x4360ec[_0x5b3e('0xc6')][_0x5b3e('0xcc')]({'id':0x0,'priority':0x0,'app':_0x5b3e('0xcd'),'appdata':_0x4f2039[_0x5b3e('0x2e')]+','+(_0x4360ec[_0x5b3e('0xb5')][_0x5b3e('0xce')]||0xa),'interval':_0x5b3e('0xcf')});_0x4360ec[_0x5b3e('0xd0')]=!![];}if(!_0x4360ec[_0x5b3e('0xc1')][_0x5b3e('0xd1')]){return;}return db['ChatQueue'][_0x5b3e('0x6e')]({'attributes':['id',_0x5b3e('0x2e')],'where':{'id':_0x4360ec[_0x5b3e('0xc1')][_0x5b3e('0xd1')]}});})[_0x5b3e('0x29')](function(_0x18c380){if(_0x18c380){_0x4360ec['applications']['unshift']({'id':0x0,'priority':0x1,'app':_0x5b3e('0xd2'),'appdata':_0x18c380['name']+','+(_0x4360ec[_0x5b3e('0xb5')]['waitForTheAssignedQueue']||0x12c),'interval':_0x5b3e('0xcf')});}return respondWithRpcPromise('Start',_0x5b3e('0xd3'),_0x4360ec);})[_0x5b3e('0x29')](function(_0x4257be){respondWithRpcPromise(_0x5b3e('0xd4'),_0x5b3e('0xd4'),{'event':_0x5b3e('0xa1'),'message':_0x4257be},client9002);return _0x4257be;})[_0x5b3e('0x29')](respondWithResult(_0x56c88d,null))[_0x5b3e('0x3c')](APIHandleError(_0x56c88d));};exports['offline']=function(_0x42c76a,_0x9fa59f){var _0x1b0ab7,_0x4edad0,_0xfb7a2d;var _0x132f05=[];var _0x41fa9f={};var _0x137d33=_0x42c76a['files']||[];var _0x29f594=[];var _0x2d9d67;return db[_0x5b3e('0xa3')][_0x5b3e('0x77')]()[_0x5b3e('0x29')](function(_0x2066ff){if(!_0x2066ff){throw new db[(_0x5b3e('0xa4'))]['ValidationError']('no\x20available\x20attributes');}_0x132f05=_['difference'](_['keys'](_0x2066ff),[_0x5b3e('0xa8'),_0x5b3e('0xa9'),'CompanyId',_0x5b3e('0xd5')]);if(_0x42c76a[_0x5b3e('0x70')]['id']){delete _0x42c76a[_0x5b3e('0x70')]['id'];}if(_[_0x5b3e('0x96')](_0x42c76a[_0x5b3e('0x70')]['from'])){throw _0x9fa59f[_0x5b3e('0x1f')](0x1f4)['send'](new db[(_0x5b3e('0xa4'))][(_0x5b3e('0xa5'))](_0x5b3e('0xaa')));}if(_[_0x5b3e('0x96')](_0x42c76a[_0x5b3e('0x70')]['body'])||_0x42c76a[_0x5b3e('0x70')][_0x5b3e('0x70')]===''){throw _0x9fa59f[_0x5b3e('0x1f')](0x1f4)[_0x5b3e('0x2f')](new db[(_0x5b3e('0xa4'))][(_0x5b3e('0xa5'))](_0x5b3e('0xab')));}if(_[_0x5b3e('0x96')](_0x42c76a[_0x5b3e('0x70')][_0x5b3e('0xd6')])){throw _0x9fa59f[_0x5b3e('0x1f')](0x1f4)['send'](new db[(_0x5b3e('0xa4'))]['ValidationError']('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x132f05));}if(!_['includes'](_0x132f05,_0x42c76a[_0x5b3e('0x70')]['mapKeyOffline'])){throw _0x9fa59f[_0x5b3e('0x1f')](0x1f4)[_0x5b3e('0x2f')](new db[(_0x5b3e('0xa4'))][(_0x5b3e('0xa5'))](_0x5b3e('0xd7')+_0x132f05));}_0x41fa9f[_0x42c76a[_0x5b3e('0x70')][_0x5b3e('0xd6')]]=_0x42c76a['body'][_0x5b3e('0xba')];})[_0x5b3e('0x29')](function(){return db['ChatWebsite'][_0x5b3e('0x6e')]({'where':{'id':_0x42c76a['params']['id']},'include':[{'model':db[_0x5b3e('0xb0')],'as':_0x5b3e('0xb1')},{'model':db[_0x5b3e('0xd8')],'as':_0x5b3e('0xd8')}]});})[_0x5b3e('0x29')](handleEntityNotFound(_0x9fa59f,null))[_0x5b3e('0x29')](function(_0x40dfef){if(_0x40dfef&&_0x40dfef[_0x5b3e('0xb1')]){_0x4edad0=_0x40dfef;var _0x1473d3=_[_0x5b3e('0x10')](_0x42c76a[_0x5b3e('0x70')],{'firstName':_0x42c76a[_0x5b3e('0x70')][_0x5b3e('0xba')],'phone':_0x42c76a[_0x5b3e('0x70')]['from'],'ListId':_0x40dfef['ListId']});_0x1473d3[_0x42c76a[_0x5b3e('0x70')][_0x5b3e('0xd6')]]=_0x42c76a[_0x5b3e('0x70')][_0x5b3e('0xba')];return db[_0x5b3e('0xa3')][_0x5b3e('0xd9')]({'where':_0x41fa9f,'defaults':_0x1473d3});}})[_0x5b3e('0xda')](function(_0x4a8097){if(_0x4a8097){_0xfb7a2d=_0x4a8097;var _0x550631=fs['readFileSync'](path[_0x5b3e('0x90')](config['root'],_0x5b3e('0xdb')),_0x5b3e('0xdc'));var _0x2e071b=ejs[_0x5b3e('0xdd')](_0x550631,{'body':_[_0x5b3e('0xde')](_0x42c76a[_0x5b3e('0x70')][_0x5b3e('0x70')]),'bodyTitle':_0x4edad0[_0x5b3e('0xdf')]});return db[_0x5b3e('0xe0')][_0x5b3e('0x6f')]({'body':_0x2e071b,'plainBody':htmlToText['fromString'](_0x2e071b),'ContactId':_0x4a8097['id'],'ChatWebsiteId':_0x4edad0['id']});}})[_0x5b3e('0x29')](function(_0x3e9ac4){_0x2d9d67=_0x3e9ac4;if(_0x137d33[_0x5b3e('0x5f')]){var _0x735b76=_0x137d33[_0x5b3e('0x3e')](function(_0x194818){return{'name':_0x194818['originalname'],'basename':_0x194818['filename'],'type':_0x194818[_0x5b3e('0xe1')],'ChatOfflineMessageId':_0x3e9ac4['id']};});_0x29f594=_0x735b76[_0x5b3e('0x3e')](_0x2dacd0=>{var _0x58830d={'filename':_0x2dacd0['name'],'path':path['join'](config[_0x5b3e('0x91')],_0x5b3e('0xe2'),_0x5b3e('0xe3'),_0x5b3e('0xe4'),'offline-chat',_0x2dacd0[_0x5b3e('0xe5')])};return _0x58830d;});if(!_0x4edad0[_0x5b3e('0xe6')]){return db['sequelize']['transaction'](function(_0x2ebdd2){return db[_0x5b3e('0xe7')][_0x5b3e('0xe8')](_0x735b76,{'transaction':_0x2ebdd2});});}}})[_0x5b3e('0x29')](function(){if(_0x2d9d67){_0x1b0ab7=_0x2d9d67;return db[_0x5b3e('0xd8')][_0x5b3e('0x7b')]({'where':{'service':!![]},'include':[{'model':db[_0x5b3e('0xe9')],'as':_0x5b3e('0xea'),'raw':!![],'include':[{'model':db[_0x5b3e('0xeb')],'as':_0x5b3e('0xeb'),'raw':!![]}]}]});}})[_0x5b3e('0x29')](function(_0x5b11ef){if(_0x5b11ef&&_0x5b11ef[_0x5b3e('0xea')]&&_0x4edad0[_0x5b3e('0xec')]&&_0x4edad0[_0x5b3e('0xed')]){var _0xeeb9de=_0x5b11ef['getSmtpOptions']();return respondWithRpcPromise(_0x5b3e('0xee'),_0x5b3e('0xef'),{'account':_0xeeb9de,'message':{'from':util[_0x5b3e('0x32')]('\x22%s\x22\x20<%s>',_0x5b11ef['name'],_0x5b11ef[_0x5b3e('0xf0')]||_0x5b11ef[_0x5b3e('0xea')][_0x5b3e('0x71')]),'to':_0x4edad0[_0x5b3e('0xed')],'subject':_0x4edad0['offlineMessageSubject'],'html':_0x1b0ab7[_0x5b3e('0x70')],'attachments':_0x29f594}},client9003)[_0x5b3e('0x29')](function(){return _0x1b0ab7;})[_0x5b3e('0x3c')](function(_0x57cde6){logger[_0x5b3e('0x1b')](_0x57cde6);});}})[_0x5b3e('0x29')](function(){if(_0x4edad0&&_0x4edad0['openNewInteraction']&&_0x4edad0['MailAccountId']){var _0x456e2e=[];if(_0x137d33[_0x5b3e('0x5f')]){_0x456e2e=_0x137d33[_0x5b3e('0x3e')](function(_0x4a9475){return{'name':_0x4a9475[_0x5b3e('0xf1')],'basename':_0x4a9475[_0x5b3e('0x8a')],'type':_0x4a9475[_0x5b3e('0xe1')],'ChatOfflineMessageId':_0x2d9d67['id']};});}var _0x28f3de;if(!_['isNil'](_0x4edad0[_0x5b3e('0xf2')])){var _0x2fa034=_[_0x5b3e('0x3e')](_0x42c76a[_0x5b3e('0x70')],function(_0xe49cec){return _0xe49cec;});var _0x30c1c4=_[_0x5b3e('0xf3')](_0x2fa034)[0x0];var _0xf2de24=_['mapValues'](_0x30c1c4,function(_0x173b3f){return _0x173b3f;});_0x28f3de=_0xf2de24[0x1][_0x4edad0[_0x5b3e('0xf2')]];}var _0xeaf7bb={'from':_0xfb7a2d[_0x5b3e('0xf0')],'firstName':_0xfb7a2d['firstName'],'lastName':_0xfb7a2d[_0x5b3e('0x48')],'mapKey':'email','message':{'from':_0xfb7a2d[_0x5b3e('0xf0')],'to':_0x4edad0[_0x5b3e('0xd8')][_0x5b3e('0xf0')],'cc':'','subject':_[_0x5b3e('0x96')](_0x28f3de)?_0x4edad0[_0x5b3e('0xf4')]:_0x28f3de,'messageId':'','sentAt':new Date(),'attach':_0x456e2e[_0x5b3e('0x5f')],'attachments':_0x456e2e,'originChannel':_0x5b3e('0xf5'),'ChatWebsiteId':_0x4edad0['id'],'ChatOfflineMessageId':_0x1b0ab7['id'],'originTo':_0x4edad0[_0x5b3e('0xd8')][_0x5b3e('0xf0')]},'body':_0x1b0ab7[_0x5b3e('0x70')]};var _0x2dd1da={'account':{'id':_0x4edad0[_0x5b3e('0xf6')]},'body':_0xeaf7bb,'log':_0x5b3e('0xf7')};return respondWithRpcPromise(_0x5b3e('0xf7'),'notifyMail',_0x2dd1da,client9001)['then'](function(){return _0x1b0ab7;})[_0x5b3e('0x3c')](function(_0x516701){logger[_0x5b3e('0x1b')](_0x516701);});}return;})[_0x5b3e('0x29')](function(){if(_0x1b0ab7){return _0x1b0ab7;}})[_0x5b3e('0x29')](respondWithResult(_0x9fa59f,null))[_0x5b3e('0x3c')](function(){for(var _0x2b1143 of _0x137d33){var _0x41784a=path['join'](config[_0x5b3e('0x91')],_0x5b3e('0xe2'),'files',_0x5b3e('0xe4'),_0x5b3e('0xf8'),_0x2b1143[_0x5b3e('0x8a')]);fs_extra[_0x5b3e('0xf9')](_0x41784a)[_0x5b3e('0x3c')](function(_0x11156e){logger[_0x5b3e('0x1b')](_0x5b3e('0xfa'),_0x41784a,_0x11156e);});}});};exports[_0x5b3e('0xfb')]=function(_0x295ff9,_0x473f71){return db['ChatInteraction']['find']({'where':{'id':_0x295ff9[_0x5b3e('0x6d')]['id']}})[_0x5b3e('0x29')](handleEntityNotFound(_0x473f71,null))['then'](function(_0x57d6d7){if(_0x57d6d7){return _0x57d6d7[_0x5b3e('0xfb')](_0x295ff9[_0x5b3e('0x70')][_0x5b3e('0x80')],_[_0x5b3e('0xfc')](_0x295ff9['body'],[_0x5b3e('0x80'),'id'])||{});}})[_0x5b3e('0x29')](respondWithResult(_0x473f71,null))[_0x5b3e('0x3c')](handleError(_0x473f71,null));};exports[_0x5b3e('0xfd')]=function(_0x35ed63,_0xbd755){var _0x3b0c2c={'raw':![],'where':{}};var _0x31920f={};var _0x4e34b8={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x5b3e('0x7b')]({'where':{'id':_0x35ed63['params']['id']}})[_0x5b3e('0x29')](handleEntityNotFound(_0xbd755,null))['then'](function(_0x1c5a42){if(_0x1c5a42){_0x31920f['model']=_[_0x5b3e('0x5a')](db[_0x5b3e('0xbe')][_0x5b3e('0x57')]);_0x31920f[_0x5b3e('0x59')]=_['keys'](_0x35ed63[_0x5b3e('0x59')]);_0x31920f[_0x5b3e('0x5b')]=_[_0x5b3e('0x5c')](_0x31920f[_0x5b3e('0x51')],_0x31920f[_0x5b3e('0x59')]);_0x3b0c2c['attributes']=_['intersection'](_0x31920f[_0x5b3e('0x51')],qs[_0x5b3e('0x5d')](_0x35ed63[_0x5b3e('0x59')][_0x5b3e('0x5d')]));_0x3b0c2c[_0x5b3e('0x5e')]=_0x3b0c2c['attributes'][_0x5b3e('0x5f')]?_0x3b0c2c[_0x5b3e('0x5e')]:_0x31920f[_0x5b3e('0x51')];if(!_0x35ed63['query'][_0x5b3e('0x60')]('nolimit')){_0x3b0c2c['limit']=qs[_0x5b3e('0x22')](_0x35ed63[_0x5b3e('0x59')]['limit']);_0x3b0c2c[_0x5b3e('0x25')]=qs[_0x5b3e('0x25')](_0x35ed63[_0x5b3e('0x59')][_0x5b3e('0x25')]);}_0x3b0c2c['order']=qs[_0x5b3e('0x63')](_0x35ed63[_0x5b3e('0x59')][_0x5b3e('0x63')]);_0x3b0c2c[_0x5b3e('0x64')]=qs['filters'](_[_0x5b3e('0x7c')](_0x35ed63[_0x5b3e('0x59')],_0x31920f[_0x5b3e('0x5b')]));_0x3b0c2c[_0x5b3e('0x64')][_0x5b3e('0x7d')]=_0x1c5a42['id'];if(_0x35ed63['query'][_0x5b3e('0x67')]){_0x3b0c2c[_0x5b3e('0x64')]=_['merge'](_0x3b0c2c[_0x5b3e('0x64')],{'$or':_[_0x5b3e('0x3e')](_0x3b0c2c['attributes'],function(_0x37f536){var _0x248fee={};_0x248fee[_0x37f536]={'$like':'%'+_0x35ed63[_0x5b3e('0x59')][_0x5b3e('0x67')]+'%'};return _0x248fee;})});}_0x3b0c2c=_[_0x5b3e('0x65')]({},_0x3b0c2c,_0x35ed63[_0x5b3e('0x68')]);return db[_0x5b3e('0xbe')][_0x5b3e('0x24')]({'where':_0x3b0c2c[_0x5b3e('0x64')]})[_0x5b3e('0x29')](function(_0x435636){_0x4e34b8[_0x5b3e('0x24')]=_0x435636;if(_0x35ed63[_0x5b3e('0x59')]['includeAll']){_0x3b0c2c[_0x5b3e('0x7e')]=[{'model':db[_0x5b3e('0xa3')],'as':_0x5b3e('0xfe'),'required':![]},{'model':db[_0x5b3e('0xcb')],'as':_0x5b3e('0xff'),'attributes':[_0x5b3e('0x2e'),_0x5b3e('0x100'),_0x5b3e('0x101')],'required':![]},{'model':db[_0x5b3e('0x102')],'as':_0x5b3e('0x103'),'attributes':['id','name',_0x5b3e('0x104')],'where':_0x35ed63[_0x5b3e('0x59')][_0x5b3e('0x105')]?{'id':_0x35ed63['query'][_0x5b3e('0x105')]}:undefined,'required':_0x35ed63[_0x5b3e('0x59')][_0x5b3e('0x105')]?!![]:![]}];}return db[_0x5b3e('0xbe')][_0x5b3e('0x6a')](_0x3b0c2c);})[_0x5b3e('0x29')](function(_0x3fe59e){_0x4e34b8['rows']=_0x3fe59e;return _0x4e34b8;});}})[_0x5b3e('0x29')](respondWithFilteredResult(_0xbd755,_0x3b0c2c))[_0x5b3e('0x3c')](handleError(_0xbd755,null));};exports['getSnippet']=function(_0x341143,_0x2493a6){var _0x5852c6=0x0;var _0x5ecfff=0x0;var _0x3c9291=![];var _0x3f16e4;var _0x5b51c0;return db['ChatWebsite'][_0x5b3e('0x6e')]({'where':{'id':_0x341143[_0x5b3e('0x6d')]['id']},'include':[{'model':db[_0x5b3e('0x3f')],'as':_0x5b3e('0x3f'),'include':[{'model':db[_0x5b3e('0x3f')],'as':_0x5b3e('0x40'),'attributes':['id','interval']}]}]})['then'](handleEntityNotFound(_0x2493a6,null))[_0x5b3e('0x29')](function(_0x24eb3d){if(_0x24eb3d){_0x3f16e4=_0x24eb3d;return _0x24eb3d['getProactiveActions']({'raw':!![]});}})[_0x5b3e('0x29')](function(_0x2627a5){if(_0x3f16e4){if(_0x2627a5){_0x5b51c0=_0x2627a5;}}return require('../../config/license/util')[_0x5b3e('0x94')]();})[_0x5b3e('0x29')](function(_0x50c01b){if(_0x50c01b){_0x5ecfff=_0x50c01b['virtual'];_0x3c9291=_0x50c01b[_0x5b3e('0x95')];}})[_0x5b3e('0x29')](function(){return db[_0x5b3e('0xbe')][_0x5b3e('0x24')]({'where':{'closed':![]}});})[_0x5b3e('0x29')](function(_0x3c1346){_0x5852c6=_0x3c1346;if(_0x5ecfff&&_0x3c1346>_0x5ecfff){return db['License'][_0x5b3e('0x7b')]({'where':{'id':0x1}})[_0x5b3e('0x29')](function(_0x58984e){if(_0x58984e){_0x58984e[_0x5b3e('0x106')]('chatLicenseExceeded');}});}})[_0x5b3e('0x29')](function(){if(!_0x3f16e4[_0x5b3e('0x3f')]||!_0x3f16e4['Interval'][_0x5b3e('0x40')])return!![];return checkWebsiteIntervals(_0x3f16e4);})['then'](function(_0x3605e3){var _0x399f88=fs[_0x5b3e('0x107')](path[_0x5b3e('0x90')](config['root'],_0x5b3e('0x108')),'utf8');var _0x277a58=new url[(_0x5b3e('0x109'))](_0x3f16e4[_0x5b3e('0x10a')])[_0x5b3e('0x10b')];var _0x20c67e=_0x5b3e('0x10c');var _0xd01fa2=![];var _0x4ac110={'chatVersion':_0x20c67e,'chatWebsiteAddressOrigin':_0x277a58,'remote':_0x3f16e4[_0x5b3e('0x10d')],'query':querystring[_0x5b3e('0x1a')](_[_0x5b3e('0x65')](_0x3f16e4[_0x5b3e('0x2b')]({'plain':!![]}),{'customerIp':_0x341143[_0x5b3e('0xbc')][_0x5b3e('0x45')]||_0x341143['headers'][_0x5b3e('0x10e')]||_0x341143[_0x5b3e('0x10f')][_0x5b3e('0x110')]||_0x341143['ip'],'referer':_0x341143[_0x5b3e('0xbc')][_0x5b3e('0x4a')],'openedInteractions':_0x5852c6,'maxInteractions':_0x5ecfff,'virtual':_0x3c9291[_0x5b3e('0x111')],'online':_0x3605e3,'custom':_0x3c9291}))[_0x5b3e('0x112')](/'/g,'\x5c\x27')};_0x2493a6[_0x5b3e('0x2f')](ejs[_0x5b3e('0xdd')](Mustache[_0x5b3e('0xdd')](_0x399f88,_0x4ac110),{'proactiveActions':_0x5b51c0,'alignment':_0x3f16e4['alignment'],'verticalAlignment':_0x3f16e4[_0x5b3e('0x113')],'div_color':_0x3f16e4[_0x5b3e('0x104')],'labelText':_0x3f16e4[_0x5b3e('0x114')],'text_color':_0x3f16e4[_0x5b3e('0x115')],'text_button_color':_0x3f16e4[_0x5b3e('0x116')],'button_color':_0x3f16e4[_0x5b3e('0x117')],'background_color':_0x3f16e4[_0x5b3e('0x118')],'hideWhenOffline':_0x3f16e4[_0x5b3e('0x119')],'intervalId':_0x3f16e4[_0x5b3e('0x11a')],'isDevelopment':_0xd01fa2,'chatVersion':_0x20c67e}));})['catch'](handleError(_0x2493a6,null));};exports[_0x5b3e('0x11b')]=function(_0x3bc5f0,_0x422b45){var _0x21a894=_0x3bc5f0[_0x5b3e('0x6d')]['id'];var _0x13f02f=_0x3bc5f0[_0x5b3e('0x70')];var _0x2ea515=0xc8;var _0x3f34d2=null;return db[_0x5b3e('0x11c')][_0x5b3e('0x11d')]({'isolationLevel':db['sequelize'][_0x5b3e('0x11e')][_0x5b3e('0x11f')][_0x5b3e('0x120')]},function(_0x4f24a4){return db[_0x5b3e('0x56')][_0x5b3e('0x7b')]({'where':{'id':_0x21a894},'transaction':_0x4f24a4})[_0x5b3e('0x29')](function(_0x5c62a0){if(_0x5c62a0){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x21a894},'transaction':_0x4f24a4})[_0x5b3e('0x29')](function(){var _0x1397d3=_[_0x5b3e('0x3e')](_0x13f02f,function(_0x383a8a){_0x383a8a['ChatWebsiteId']=_0x21a894;return _0x383a8a;});return db[_0x5b3e('0x121')][_0x5b3e('0xe8')](_0x1397d3,{'transaction':_0x4f24a4});});}else{_0x2ea515=0x194;_0x3f34d2=[];}});})[_0x5b3e('0x29')](function(){if(_0x2ea515!==0x194){return db[_0x5b3e('0x121')][_0x5b3e('0x122')]({'where':{'ChatWebsiteId':_0x21a894},'order':_0x5b3e('0xb8')})[_0x5b3e('0x29')](function(_0x445ab0){_0x3f34d2=_0x445ab0;});}})[_0x5b3e('0x3c')](function(_0x5ef5fb){_0x2ea515=0x1f4;logger[_0x5b3e('0x1b')](_0x5ef5fb[_0x5b3e('0x2d')]);if(_0x5ef5fb['name']){delete _0x5ef5fb[_0x5b3e('0x2e')];}_0x3f34d2=_0x5ef5fb;})['finally'](function(){if(_0x3f34d2===null){_0x422b45[_0x5b3e('0x123')](_0x2ea515);}else{if(_0x2ea515===0x1f4){_0x422b45[_0x5b3e('0x1f')](_0x2ea515)['send'](_0x3f34d2);}else{_0x422b45[_0x5b3e('0x1f')](_0x2ea515)[_0x5b3e('0x21')](_0x3f34d2);}}});};exports['getApplications']=function(_0x149328,_0x3437a0){var _0x5743db={};var _0x58809e={};var _0x30b850;var _0x48cef3;return db[_0x5b3e('0x56')][_0x5b3e('0x7b')]({'where':{'id':_0x149328[_0x5b3e('0x6d')]['id']}})['then'](handleEntityNotFound(_0x3437a0,null))[_0x5b3e('0x29')](function(_0x366796){if(_0x366796){_0x30b850=_0x366796;_0x58809e[_0x5b3e('0x51')]=_[_0x5b3e('0x5a')](db[_0x5b3e('0x121')][_0x5b3e('0x57')]);_0x58809e[_0x5b3e('0x59')]=_['keys'](_0x149328[_0x5b3e('0x59')]);_0x58809e[_0x5b3e('0x5b')]=_[_0x5b3e('0x5c')](_0x58809e['model'],_0x58809e['query']);_0x5743db[_0x5b3e('0x5e')]=_[_0x5b3e('0x5c')](_0x58809e['model'],qs['fields'](_0x149328[_0x5b3e('0x59')][_0x5b3e('0x5d')]));_0x5743db['attributes']=_0x5743db['attributes'][_0x5b3e('0x5f')]?_0x5743db[_0x5b3e('0x5e')]:_0x58809e[_0x5b3e('0x51')];_0x5743db[_0x5b3e('0x62')]=qs[_0x5b3e('0x63')](_0x149328[_0x5b3e('0x59')]['sort']);_0x5743db[_0x5b3e('0x64')]=qs[_0x5b3e('0x5b')](_[_0x5b3e('0x7c')](_0x149328['query'],_0x58809e[_0x5b3e('0x5b')]));if(_0x149328['query'][_0x5b3e('0x67')]){_0x5743db[_0x5b3e('0x64')]=_[_0x5b3e('0x65')](_0x5743db['where'],{'$or':_[_0x5b3e('0x3e')](_0x5743db[_0x5b3e('0x5e')],function(_0x4af0f3){var _0x1fe447={};_0x1fe447[_0x4af0f3]={'$like':'%'+_0x149328[_0x5b3e('0x59')][_0x5b3e('0x67')]+'%'};return _0x1fe447;})});}_0x5743db=_[_0x5b3e('0x65')]({},_0x5743db,_0x149328[_0x5b3e('0x68')]);return _0x30b850[_0x5b3e('0x124')](_0x5743db);}})[_0x5b3e('0x29')](function(_0x16c194){if(_0x16c194){_0x48cef3=_0x16c194[_0x5b3e('0x5f')];if(!_0x149328['query'][_0x5b3e('0x60')](_0x5b3e('0x61'))){_0x5743db[_0x5b3e('0x22')]=qs[_0x5b3e('0x22')](_0x149328[_0x5b3e('0x59')][_0x5b3e('0x22')]);_0x5743db[_0x5b3e('0x25')]=qs[_0x5b3e('0x25')](_0x149328[_0x5b3e('0x59')][_0x5b3e('0x25')]);}return _0x30b850[_0x5b3e('0x124')](_0x5743db);}})['then'](function(_0x2c3bf2){if(_0x2c3bf2){return _0x2c3bf2?{'count':_0x48cef3,'rows':_0x2c3bf2}:null;}})[_0x5b3e('0x29')](respondWithResult(_0x3437a0,null))[_0x5b3e('0x3c')](handleError(_0x3437a0,null));};exports[_0x5b3e('0x125')]=function(_0x2cb895,_0x2fc63b){return db[_0x5b3e('0x126')][_0x5b3e('0x6e')]({'where':{'id':_0x2cb895[_0x5b3e('0x6d')]['id']}})[_0x5b3e('0x29')](handleEntityNotFound(_0x2fc63b,null))[_0x5b3e('0x29')](function(_0x4ed019){if(_0x4ed019){return _0x4ed019[_0x5b3e('0x125')](_0x2cb895['body'][_0x5b3e('0x80')],_[_0x5b3e('0xfc')](_0x2cb895[_0x5b3e('0x70')],[_0x5b3e('0x80'),'id'])||{});}})[_0x5b3e('0x29')](respondWithResult(_0x2fc63b,null))[_0x5b3e('0x3c')](handleError(_0x2fc63b,null));};exports[_0x5b3e('0x127')]=function(_0x37db5e,_0x1be671){var _0x5e62d9={};var _0x597506={};var _0x4852c4;var _0x10335a;return db[_0x5b3e('0x56')][_0x5b3e('0x7b')]({'where':{'id':_0x37db5e[_0x5b3e('0x6d')]['id']}})[_0x5b3e('0x29')](handleEntityNotFound(_0x1be671,null))[_0x5b3e('0x29')](function(_0x2d125d){if(_0x2d125d){_0x4852c4=_0x2d125d;_0x597506[_0x5b3e('0x51')]=_['keys'](db['ChatProactiveAction']['rawAttributes']);_0x597506[_0x5b3e('0x59')]=_['keys'](_0x37db5e[_0x5b3e('0x59')]);_0x597506['filters']=_[_0x5b3e('0x5c')](_0x597506[_0x5b3e('0x51')],_0x597506[_0x5b3e('0x59')]);_0x5e62d9[_0x5b3e('0x5e')]=_[_0x5b3e('0x5c')](_0x597506['model'],qs[_0x5b3e('0x5d')](_0x37db5e[_0x5b3e('0x59')][_0x5b3e('0x5d')]));_0x5e62d9[_0x5b3e('0x5e')]=_0x5e62d9['attributes'][_0x5b3e('0x5f')]?_0x5e62d9[_0x5b3e('0x5e')]:_0x597506[_0x5b3e('0x51')];_0x5e62d9[_0x5b3e('0x62')]=qs[_0x5b3e('0x63')](_0x37db5e['query'][_0x5b3e('0x63')]);_0x5e62d9[_0x5b3e('0x64')]=qs['filters'](_[_0x5b3e('0x7c')](_0x37db5e[_0x5b3e('0x59')],_0x597506['filters']));if(_0x37db5e[_0x5b3e('0x59')][_0x5b3e('0x67')]){_0x5e62d9['where']=_['merge'](_0x5e62d9[_0x5b3e('0x64')],{'$or':_[_0x5b3e('0x3e')](_0x5e62d9['attributes'],function(_0x46148a){var _0x1b3952={};_0x1b3952[_0x46148a]={'$like':'%'+_0x37db5e[_0x5b3e('0x59')][_0x5b3e('0x67')]+'%'};return _0x1b3952;})});}_0x5e62d9=_['merge']({},_0x5e62d9,_0x37db5e[_0x5b3e('0x68')]);return _0x4852c4[_0x5b3e('0x127')](_0x5e62d9);}})[_0x5b3e('0x29')](function(_0x209eed){if(_0x209eed){_0x10335a=_0x209eed[_0x5b3e('0x5f')];if(!_0x37db5e[_0x5b3e('0x59')]['hasOwnProperty']('nolimit')){_0x5e62d9[_0x5b3e('0x22')]=qs[_0x5b3e('0x22')](_0x37db5e[_0x5b3e('0x59')][_0x5b3e('0x22')]);_0x5e62d9['offset']=qs[_0x5b3e('0x25')](_0x37db5e[_0x5b3e('0x59')]['offset']);}return _0x4852c4['getProactiveActions'](_0x5e62d9);}})[_0x5b3e('0x29')](function(_0x33b6be){if(_0x33b6be){return _0x33b6be?{'count':_0x10335a,'rows':_0x33b6be}:null;}})[_0x5b3e('0x29')](respondWithResult(_0x1be671,null))[_0x5b3e('0x3c')](handleError(_0x1be671,null));};exports[_0x5b3e('0x128')]=function(_0x1696ec,_0x2b7b74){var _0x2b4064=_0x1696ec[_0x5b3e('0x59')]['online']===_0x5b3e('0x129')?_0x5b3e('0x12a'):_0x5b3e('0x12b');return db[_0x5b3e('0x56')][_0x5b3e('0x6e')]({'attributes':['id',_0x2b4064],'where':{'id':_0x1696ec[_0x5b3e('0x6d')]['id']}})['then'](handleEntityNotFound(_0x2b7b74,null))['then'](function(_0x5e32eb){if(_0x5e32eb){var _0x295a80=_0x5e32eb[_0x2b4064];var _0x1cb4d9=_0x295a80&&_0x295a80[_0x5b3e('0x12c')]?_0x295a80['items']:[];_0x2b7b74[_0x5b3e('0x2f')]({'fromKey':_['isNil'](_0x295a80[_0x5b3e('0x12d')])?undefined:_0x295a80['fromKey'],'count':_0x1cb4d9['length'],'rows':_0x1cb4d9});}})['catch'](handleError(_0x2b7b74,null));};exports[_0x5b3e('0x12e')]=function(_0x3d4f10,_0x16331d){var _0x3f6d37={'raw':![],'where':{}};var _0x549711={};var _0x1e8f47={'count':0x0,'rows':[]};return db[_0x5b3e('0x56')][_0x5b3e('0x7b')]({'where':{'id':_0x3d4f10[_0x5b3e('0x6d')]['id']}})[_0x5b3e('0x29')](handleEntityNotFound(_0x16331d,null))[_0x5b3e('0x29')](function(_0x869738){if(_0x869738){_0x549711['model']=_[_0x5b3e('0x5a')](db[_0x5b3e('0xe0')][_0x5b3e('0x57')]);_0x549711[_0x5b3e('0x59')]=_[_0x5b3e('0x5a')](_0x3d4f10[_0x5b3e('0x59')]);_0x549711['filters']=_[_0x5b3e('0x5c')](_0x549711[_0x5b3e('0x51')],_0x549711[_0x5b3e('0x59')]);_0x3f6d37[_0x5b3e('0x5e')]=_[_0x5b3e('0x5c')](_0x549711[_0x5b3e('0x51')],qs['fields'](_0x3d4f10[_0x5b3e('0x59')][_0x5b3e('0x5d')]));_0x3f6d37[_0x5b3e('0x5e')]=_0x3f6d37[_0x5b3e('0x5e')][_0x5b3e('0x5f')]?_0x3f6d37['attributes']:_0x549711[_0x5b3e('0x51')];if(!_0x3d4f10[_0x5b3e('0x59')]['hasOwnProperty'](_0x5b3e('0x61'))){_0x3f6d37['limit']=qs['limit'](_0x3d4f10[_0x5b3e('0x59')][_0x5b3e('0x22')]);_0x3f6d37[_0x5b3e('0x25')]=qs[_0x5b3e('0x25')](_0x3d4f10[_0x5b3e('0x59')]['offset']);}_0x3f6d37[_0x5b3e('0x62')]=qs[_0x5b3e('0x63')](_0x3d4f10[_0x5b3e('0x59')]['sort']);_0x3f6d37[_0x5b3e('0x64')]=qs[_0x5b3e('0x5b')](_[_0x5b3e('0x7c')](_0x3d4f10[_0x5b3e('0x59')],_0x549711[_0x5b3e('0x5b')]));_0x3f6d37['where']['ChatWebsiteId']=_0x869738['id'];if(_0x3d4f10[_0x5b3e('0x59')]['filter']){_0x3f6d37['where']=_[_0x5b3e('0x65')](_0x3f6d37[_0x5b3e('0x64')],{'$or':_[_0x5b3e('0x3e')](_0x3f6d37[_0x5b3e('0x5e')],function(_0x30b7e5){var _0x57acee={};_0x57acee[_0x30b7e5]={'$like':'%'+_0x3d4f10[_0x5b3e('0x59')][_0x5b3e('0x67')]+'%'};return _0x57acee;})});}_0x3f6d37=_[_0x5b3e('0x65')]({},_0x3f6d37,_0x3d4f10[_0x5b3e('0x68')]);return db['ChatOfflineMessage']['count']({'where':_0x3f6d37[_0x5b3e('0x64')]})['then'](function(_0x4d561c){_0x1e8f47['count']=_0x4d561c;if(_0x3d4f10[_0x5b3e('0x59')][_0x5b3e('0x69')]){_0x3f6d37[_0x5b3e('0x7e')]=[{'all':!![]}];}else{_0x3f6d37['include']=[{'model':db[_0x5b3e('0xa3')],'as':'Contact','required':![]},{'model':db[_0x5b3e('0xe7')],'as':_0x5b3e('0x12f'),'required':![]}];}return db[_0x5b3e('0xe0')][_0x5b3e('0x6a')](_0x3f6d37);})[_0x5b3e('0x29')](function(_0x4a074f){_0x1e8f47[_0x5b3e('0x6b')]=_0x4a074f;return _0x1e8f47;});}})[_0x5b3e('0x29')](respondWithFilteredResult(_0x16331d,_0x3f6d37))['catch'](handleError(_0x16331d,null));};exports[_0x5b3e('0x130')]=function(_0x1137d7,_0x1097b3){return db[_0x5b3e('0x56')][_0x5b3e('0x6e')]({'where':{'id':_0x1137d7['params']['id']}})[_0x5b3e('0x29')](handleEntityNotFound(_0x1097b3,null))[_0x5b3e('0x29')](function(_0x19556b){if(_0x19556b){return _0x19556b[_0x5b3e('0x130')](_0x1137d7[_0x5b3e('0x70')]['ids'],_['omit'](_0x1137d7[_0x5b3e('0x70')],['ids','id'])||{})[_0x5b3e('0xda')](function(_0x233fd0){for(var _0x1bb28d=0x0;_0x1bb28d<_0x1137d7[_0x5b3e('0x70')]['ids'][_0x5b3e('0x5f')];_0x1bb28d+=0x1){socket[_0x5b3e('0x131')]('userChatWebsite:save',{'UserId':Number(_0x1137d7['body']['ids'][_0x1bb28d]),'ChatWebsiteId':Number(_0x1137d7['params']['id'])});}return _0x233fd0;});}})['then'](respondWithResult(_0x1097b3,null))[_0x5b3e('0x3c')](handleError(_0x1097b3,null));};exports[_0x5b3e('0x132')]=function(_0x103d7e,_0x529a80){return db[_0x5b3e('0x56')][_0x5b3e('0x6e')]({'where':{'id':_0x103d7e[_0x5b3e('0x6d')]['id']}})[_0x5b3e('0x29')](handleEntityNotFound(_0x529a80,null))[_0x5b3e('0x29')](function(_0x5aee89){if(_0x5aee89){return _0x5aee89['removeAgents'](_0x103d7e[_0x5b3e('0x59')][_0x5b3e('0x80')])['then'](function(){if(_['isArray'](_0x103d7e['query'][_0x5b3e('0x80')])){for(var _0x3a3c29=0x0;_0x3a3c29<_0x103d7e[_0x5b3e('0x59')][_0x5b3e('0x80')][_0x5b3e('0x5f')];_0x3a3c29+=0x1){socket[_0x5b3e('0x131')]('userChatWebsite:remove',{'UserId':Number(_0x103d7e[_0x5b3e('0x59')][_0x5b3e('0x80')][_0x3a3c29]),'ChatWebsiteId':Number(_0x103d7e[_0x5b3e('0x6d')]['id'])});}}else{socket[_0x5b3e('0x131')](_0x5b3e('0x133'),{'UserId':Number(_0x103d7e[_0x5b3e('0x59')][_0x5b3e('0x80')]),'ChatWebsiteId':Number(_0x103d7e['params']['id'])});}});}})['then'](respondWithStatusCode(_0x529a80,null))[_0x5b3e('0x3c')](handleError(_0x529a80,null));};exports[_0x5b3e('0x134')]=function(_0x47806c,_0x4bfe9f){var _0x3fd6bb={};var _0x5d871d={};var _0x4a9512;var _0x3e4138;return db['ChatWebsite'][_0x5b3e('0x7b')]({'where':{'id':_0x47806c[_0x5b3e('0x6d')]['id']}})[_0x5b3e('0x29')](handleEntityNotFound(_0x4bfe9f,null))['then'](function(_0x5d2db6){if(_0x5d2db6){_0x4a9512=_0x5d2db6;_0x5d871d[_0x5b3e('0x51')]=_[_0x5b3e('0x5a')](db['User'][_0x5b3e('0x57')]);_0x5d871d[_0x5b3e('0x59')]=_['keys'](_0x47806c[_0x5b3e('0x59')]);_0x5d871d['filters']=_[_0x5b3e('0x5c')](_0x5d871d['model'],_0x5d871d[_0x5b3e('0x59')]);_0x3fd6bb[_0x5b3e('0x5e')]=_['intersection'](_0x5d871d[_0x5b3e('0x51')],qs[_0x5b3e('0x5d')](_0x47806c[_0x5b3e('0x59')][_0x5b3e('0x5d')]));_0x3fd6bb['attributes']=_0x3fd6bb[_0x5b3e('0x5e')]['length']?_0x3fd6bb[_0x5b3e('0x5e')]:_0x5d871d[_0x5b3e('0x51')];_0x3fd6bb['order']=qs[_0x5b3e('0x63')](_0x47806c[_0x5b3e('0x59')]['sort']);_0x3fd6bb[_0x5b3e('0x64')]=qs[_0x5b3e('0x5b')](_[_0x5b3e('0x7c')](_0x47806c[_0x5b3e('0x59')],_0x5d871d[_0x5b3e('0x5b')]));if(_0x47806c[_0x5b3e('0x59')]['filter']){_0x3fd6bb['where']=_[_0x5b3e('0x65')](_0x3fd6bb[_0x5b3e('0x64')],{'$or':_[_0x5b3e('0x3e')](_0x3fd6bb[_0x5b3e('0x5e')],function(_0x2cdc91){var _0x265b73={};_0x265b73[_0x2cdc91]={'$like':'%'+_0x47806c['query']['filter']+'%'};return _0x265b73;})});}_0x3fd6bb=_[_0x5b3e('0x65')]({},_0x3fd6bb,_0x47806c[_0x5b3e('0x68')]);return _0x4a9512[_0x5b3e('0x134')](_0x3fd6bb);}})['then'](function(_0x31d591){if(_0x31d591){_0x3e4138=_0x31d591[_0x5b3e('0x5f')];if(!_0x47806c[_0x5b3e('0x59')][_0x5b3e('0x60')](_0x5b3e('0x61'))){_0x3fd6bb[_0x5b3e('0x22')]=qs[_0x5b3e('0x22')](_0x47806c[_0x5b3e('0x59')]['limit']);_0x3fd6bb[_0x5b3e('0x25')]=qs[_0x5b3e('0x25')](_0x47806c['query'][_0x5b3e('0x25')]);}return _0x4a9512[_0x5b3e('0x134')](_0x3fd6bb);}})[_0x5b3e('0x29')](function(_0x21c53c){if(_0x21c53c){return _0x21c53c?{'count':_0x3e4138,'rows':_0x21c53c}:null;}})[_0x5b3e('0x29')](respondWithResult(_0x4bfe9f,null))[_0x5b3e('0x3c')](handleError(_0x4bfe9f,null));}; \ No newline at end of file +var _0xbe34=['x-real-port','browser','version','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','model','type','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','key','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','options','includeAll','findAll','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','pick','include','removeDispositions','addAnswer','getAnswers','findOne','CannedAnswer','hasOwnProperty','removeAnswers','ids','addLogo','sitepic','file','filename','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','isNil','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','CompanyId','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Applications','Interval','Intervals','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','spread','list','applications','priority','asc','account','Contacts','contact','headers','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','push','close','unmanaged','*,*,*,*','ChatMessage','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','queueId','queue','Start','startRouting','EventManager','offline','createdAt','ListId','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','files','attachments','offline-chat','basename','openNewInteraction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','mimetype','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','User','fullname','internal','Tag','color','tag','getProactiveActions','../../config/license/util','virtual','custom','License','chatLicenseExceeded','server/files/chat/iframe.ejs','address','origin','remoteAddress','referer','replace','verticalAlignment','textColor','textButtonColor','color_button','hideWhenOffline','IntervalId','addApplications','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','omit','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','mustache','util','fs-extra','lodash','querystring','html-to-text','url','../../components/parsers/qs','api','APIOutOfIntervalError','../../errors/api','APINotFoundError','handleError','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','Command','getSnippet','timezone','format','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','catch','inspect','No\x20timezone','map','some','user-agent-parser','user-agent','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName'];(function(_0x3efc77,_0x1fa6ad){var _0x146c7e=function(_0x3f59ea){while(--_0x3f59ea){_0x3efc77['push'](_0x3efc77['shift']());}};_0x146c7e(++_0x1fa6ad);}(_0xbe34,0xe8));var _0x4be3=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xbe34[_0x42cae2];return _0x5f256f;};'use strict';var Mustache=require(_0x4be3('0x0'));var util=require(_0x4be3('0x1'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4be3('0x2'));var _=require(_0x4be3('0x3'));var querystring=require(_0x4be3('0x4'));var htmlToText=require(_0x4be3('0x5'));var Redis=require('ioredis');var jayson=require('jayson/promise');var url=require(_0x4be3('0x6'));var qs=require(_0x4be3('0x7'));var logger=require('../../config/logger')(_0x4be3('0x8'));var config=require('../../config/environment');var APIOutOfIntervalError=require('../../errors/api')[_0x4be3('0x9')];var APINotFoundError=require(_0x4be3('0xa'))[_0x4be3('0xb')];var APIHandleError=require(_0x4be3('0xa'))[_0x4be3('0xc')];var db=require('../../mysqldb')['db'];config[_0x4be3('0xd')]=_[_0x4be3('0xe')](config['redis'],{'host':_0x4be3('0xf'),'port':0x18eb});var socket=require(_0x4be3('0x10'))(new Redis(config['redis']));require(_0x4be3('0x11'))[_0x4be3('0x12')](socket);var client=jayson[_0x4be3('0x13')][_0x4be3('0x14')]({'port':0x232c});var client9002=jayson['client'][_0x4be3('0x14')]({'port':0x232a});var client9003=jayson['client'][_0x4be3('0x14')]({'port':0x232b});var client9001=jayson['client'][_0x4be3('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x2a931f,_0x37133d,_0x49edcd,_0x208872){return new Promise(function(_0x115f54,_0x2be2ed){var _0x4c0336=_0x208872||client;return _0x4c0336[_0x4be3('0x15')](_0x2a931f,_0x49edcd)[_0x4be3('0x16')](function(_0x23b76b){logger['info'](_0x4be3('0x17'),_0x37133d,_0x4be3('0x18'));logger[_0x4be3('0x19')](_0x4be3('0x1a'),_0x37133d,_0x4be3('0x18'),JSON[_0x4be3('0x1b')](_0x23b76b));if(_0x23b76b['error']){if(_0x23b76b[_0x4be3('0x1c')][_0x4be3('0x1d')]===0x1f4){logger[_0x4be3('0x1c')]('ChatWebsite,\x20%s,\x20%s',_0x37133d,_0x23b76b[_0x4be3('0x1c')]['message']);return _0x2be2ed(_0x23b76b[_0x4be3('0x1c')][_0x4be3('0x1e')]);}logger[_0x4be3('0x1c')]('ChatWebsite,\x20%s,\x20%s',_0x37133d,_0x23b76b[_0x4be3('0x1c')][_0x4be3('0x1e')]);return _0x115f54(_0x23b76b[_0x4be3('0x1c')][_0x4be3('0x1e')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x37133d,_0x4be3('0x18'));_0x115f54(_0x23b76b[_0x4be3('0x1f')][_0x4be3('0x1e')]);}})['catch'](function(_0x37661f){logger[_0x4be3('0x1c')](_0x4be3('0x17'),_0x37133d,_0x37661f);_0x2be2ed(_0x37661f);});});}function respondWithStatusCode(_0x3bf7cb,_0x317ceb){_0x317ceb=_0x317ceb||0xcc;return function(_0x307334){if(_0x307334){return _0x3bf7cb[_0x4be3('0x20')](_0x317ceb);}return _0x3bf7cb['status'](_0x317ceb)[_0x4be3('0x21')]();};}function respondWithResult(_0x46326f,_0x4c45fa){_0x4c45fa=_0x4c45fa||0xc8;return function(_0x529f38){if(_0x529f38){return _0x46326f[_0x4be3('0x22')](_0x4c45fa)[_0x4be3('0x23')](_0x529f38);}};}function respondWithFilteredResult(_0xa811dc,_0x263664){return function(_0x3c22aa){if(_0x3c22aa){var _0x27081e=typeof _0x263664['offset']===_0x4be3('0x24')&&typeof _0x263664[_0x4be3('0x25')]==='undefined';var _0x432681=_0x3c22aa[_0x4be3('0x26')];var _0x3f0889=_0x27081e?0x0:_0x263664[_0x4be3('0x27')];var _0x35e1d7=_0x27081e?_0x3c22aa['count']:_0x263664['offset']+_0x263664[_0x4be3('0x25')];var _0x37f4aa;if(_0x35e1d7>=_0x432681){_0x35e1d7=_0x432681;_0x37f4aa=0xc8;}else{_0x37f4aa=0xce;}_0xa811dc[_0x4be3('0x22')](_0x37f4aa);return _0xa811dc[_0x4be3('0x28')](_0x4be3('0x29'),_0x3f0889+'-'+_0x35e1d7+'/'+_0x432681)[_0x4be3('0x23')](_0x3c22aa);}return null;};}function saveUpdates(_0x1a262b){return function(_0x1f80f0){if(_0x1f80f0){return _0x1f80f0[_0x4be3('0x2a')](_0x1a262b)[_0x4be3('0x16')](function(_0x4bf10b){return _0x4bf10b;});}return null;};}function removeEntity(_0x1324a9){return function(_0x17b886){if(_0x17b886){return _0x17b886[_0x4be3('0x2b')]()[_0x4be3('0x16')](function(){var _0x13cd13=_0x17b886[_0x4be3('0x2c')]({'plain':!![]});var _0x307593=_0x4be3('0x2d');return db[_0x4be3('0x2e')][_0x4be3('0x2b')]({'where':{'type':_0x307593,'resourceId':_0x13cd13['id']}})[_0x4be3('0x16')](function(){return _0x17b886;});})[_0x4be3('0x16')](function(){_0x1324a9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x546a06){return function(_0x119641){if(!_0x119641){_0x546a06[_0x4be3('0x20')](0x194);}return _0x119641;};}function handleError(_0x3f19a6,_0x2f0b07){_0x2f0b07=_0x2f0b07||0x1f4;return function(_0x3af0bb){logger['error'](_0x3af0bb[_0x4be3('0x2f')]);if(_0x3af0bb['name']){delete _0x3af0bb[_0x4be3('0x30')];}_0x3f19a6[_0x4be3('0x22')](_0x2f0b07)[_0x4be3('0x31')](_0x3af0bb);};}function iftimePromise(_0x48c267,_0x460be3){return respondWithRpcPromise(_0x4be3('0x32'),_0x4be3('0x33'),{'command':_0x460be3[_0x4be3('0x34')]?util[_0x4be3('0x35')](_0x4be3('0x36'),_0x48c267[_0x4be3('0x37')],_0x460be3[_0x4be3('0x34')]):util[_0x4be3('0x35')](_0x4be3('0x38'),_0x48c267['interval'])},client9002)['then'](function(_0x46a61f){var _0xbf7160=_0x46a61f&&_0x46a61f[_0x4be3('0x39')](_0x4be3('0x3a'))>=0x0?!![]:![];logger['info'](_0x4be3('0x3b'),_0x460be3['id'],_0x48c267['id'],_0x48c267[_0x4be3('0x37')],_0xbf7160?_0x4be3('0x3c'):_0x4be3('0x3d'),_0x460be3[_0x4be3('0x34')]?_0x460be3['timezone']:'No\x20timezone');return _0xbf7160;})[_0x4be3('0x3e')](function(_0x34c4fb){logger[_0x4be3('0x1c')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x460be3['id'],_0x48c267['id'],_0x48c267[_0x4be3('0x37')],util[_0x4be3('0x3f')](_0x34c4fb,{'showHidden':![],'depth':null}),_0x460be3[_0x4be3('0x34')]?_0x460be3[_0x4be3('0x34')]:_0x4be3('0x40'));return![];});}function checkWebsiteIntervals(_0xb257ba){var _0x21b93c=_[_0x4be3('0x41')](_0xb257ba['Interval']['Intervals'],function(_0x5de0ae){var _0x87f3ea=_0x5de0ae[_0x4be3('0x2c')]({'plain':!![]});return iftimePromise(_0x87f3ea,_0xb257ba);});return Promise['all'](_0x21b93c)['then'](function(_0x4746ba){return _[_0x4be3('0x42')](_0x4746ba);});}function createInteractionObject(_0x10d66e,_0x51820d,_0x43d94a,_0x55fd23){var _0x33613d=require(_0x4be3('0x43'));var _0x3a6ab1=new _0x33613d();var _0x3143ae=_0x3a6ab1['setUA'](_0x43d94a[_0x4be3('0x44')])[_0x4be3('0x45')]();var _0x30ca0b=_0x51820d[_0x4be3('0x46')];if(_0x43d94a[_0x4be3('0x47')]){_0x30ca0b=_0x43d94a[_0x4be3('0x47')];}else if(_0x43d94a[_0x4be3('0x48')]){_0x30ca0b=_[_0x4be3('0x49')](_0x43d94a[_0x4be3('0x48')][_0x4be3('0x4a')](','));}return{'ContactId':_0x55fd23['id'],'ChatWebsiteId':_0x10d66e,'from':(_0x55fd23[_0x4be3('0x4b')]||'')+'\x20'+(_0x55fd23[_0x4be3('0x4c')]||''),'customerIp':_0x30ca0b,'customerPort':_0x43d94a[_0x4be3('0x4d')]?_0x43d94a[_0x4be3('0x4d')]:null,'referer':_0x51820d['referer'],'browserName':_0x3143ae['browser'][_0x4be3('0x30')]&&_0x3143ae[_0x4be3('0x4e')][_0x4be3('0x4f')]?util[_0x4be3('0x35')](_0x4be3('0x50'),_0x3143ae[_0x4be3('0x4e')]['name'],_0x3143ae[_0x4be3('0x4e')][_0x4be3('0x4f')]):_0x4be3('0x51'),'browserVersion':_0x3143ae['browser']['version']||'unknown','osName':util[_0x4be3('0x35')](_0x4be3('0x50'),_0x3143ae['os'][_0x4be3('0x30')],_0x3143ae['os'][_0x4be3('0x4f')]),'osVersion':_0x3143ae['os'][_0x4be3('0x4f')],'deviceModel':_0x3143ae[_0x4be3('0x52')]['model']&&_0x3143ae[_0x4be3('0x52')][_0x4be3('0x53')]?util[_0x4be3('0x35')](_0x4be3('0x54'),_0x3143ae[_0x4be3('0x52')][_0x4be3('0x55')],_0x3143ae[_0x4be3('0x52')]['vendor'],_0x3143ae[_0x4be3('0x52')][_0x4be3('0x56')]):null,'deviceVendor':_0x3143ae['device']['vendor'],'deviceType':_0x3143ae[_0x4be3('0x52')][_0x4be3('0x56')],'formData':JSON[_0x4be3('0x1b')](_0x51820d)};}exports[_0x4be3('0x57')]=function(_0x12db5e,_0x4a378c){var _0x337d65={'include':[{'model':db[_0x4be3('0x58')],'as':_0x4be3('0x59')}]},_0x548fa2={},_0x4b0472={'count':0x0,'rows':[]};var _0x4d0fea=_[_0x4be3('0x41')](db[_0x4be3('0x5a')][_0x4be3('0x5b')],function(_0x3855eb){return{'name':_0x3855eb[_0x4be3('0x5c')],'type':_0x3855eb[_0x4be3('0x56')][_0x4be3('0x5d')]};});_0x548fa2[_0x4be3('0x55')]=_['map'](_0x4d0fea,'name');_0x548fa2[_0x4be3('0x5e')]=_[_0x4be3('0x5f')](_0x12db5e[_0x4be3('0x5e')]);_0x548fa2[_0x4be3('0x60')]=_[_0x4be3('0x61')](_0x548fa2[_0x4be3('0x55')],_0x548fa2[_0x4be3('0x5e')]);_0x337d65['attributes']=_[_0x4be3('0x61')](_0x548fa2[_0x4be3('0x55')],qs['fields'](_0x12db5e['query'][_0x4be3('0x62')]));_0x337d65[_0x4be3('0x63')]=_0x337d65['attributes'][_0x4be3('0x64')]?_0x337d65[_0x4be3('0x63')]:_0x548fa2[_0x4be3('0x55')];if(!_0x12db5e[_0x4be3('0x5e')]['hasOwnProperty'](_0x4be3('0x65'))){_0x337d65['limit']=qs[_0x4be3('0x25')](_0x12db5e[_0x4be3('0x5e')]['limit']);_0x337d65[_0x4be3('0x27')]=qs['offset'](_0x12db5e[_0x4be3('0x5e')][_0x4be3('0x27')]);}_0x337d65[_0x4be3('0x66')]=qs[_0x4be3('0x67')](_0x12db5e[_0x4be3('0x5e')][_0x4be3('0x67')]);_0x337d65[_0x4be3('0x68')]=qs['filters'](_['pick'](_0x12db5e[_0x4be3('0x5e')],_0x548fa2[_0x4be3('0x60')]),_0x4d0fea);if(_0x12db5e[_0x4be3('0x5e')][_0x4be3('0x69')]){_0x337d65[_0x4be3('0x68')]=_[_0x4be3('0x6a')](_0x337d65[_0x4be3('0x68')],{'$or':_['map'](_0x4d0fea,function(_0x2625f6){if(_0x2625f6['type']!=='VIRTUAL'){var _0x3d6d40={};_0x3d6d40[_0x2625f6[_0x4be3('0x30')]]={'$like':'%'+_0x12db5e['query'][_0x4be3('0x69')]+'%'};return _0x3d6d40;}})});}_0x337d65=_[_0x4be3('0x6a')]({},_0x337d65,_0x12db5e[_0x4be3('0x6b')]);var _0x5c8014={'where':_0x337d65[_0x4be3('0x68')]};return db[_0x4be3('0x5a')]['count'](_0x5c8014)[_0x4be3('0x16')](function(_0x587645){_0x4b0472[_0x4be3('0x26')]=_0x587645;if(_0x12db5e[_0x4be3('0x5e')][_0x4be3('0x6c')]){_0x337d65['include']=[{'all':!![]}];}return db['ChatWebsite'][_0x4be3('0x6d')](_0x337d65);})['then'](function(_0x550ab1){_0x4b0472[_0x4be3('0x6e')]=_0x550ab1;return _0x4b0472;})[_0x4be3('0x16')](respondWithFilteredResult(_0x4a378c,_0x337d65))[_0x4be3('0x3e')](handleError(_0x4a378c,null));};exports[_0x4be3('0x6f')]=function(_0x35d68a,_0x5937a1){var _0x526e99={'raw':![],'where':{'id':_0x35d68a[_0x4be3('0x70')]['id']},'include':[{'model':db[_0x4be3('0x58')],'as':_0x4be3('0x59')}]},_0x49340b={};_0x49340b[_0x4be3('0x55')]=_[_0x4be3('0x5f')](db[_0x4be3('0x5a')]['rawAttributes']);_0x49340b[_0x4be3('0x5e')]=_['keys'](_0x35d68a['query']);_0x49340b[_0x4be3('0x60')]=_[_0x4be3('0x61')](_0x49340b[_0x4be3('0x55')],_0x49340b[_0x4be3('0x5e')]);_0x526e99[_0x4be3('0x63')]=_[_0x4be3('0x61')](_0x49340b[_0x4be3('0x55')],qs[_0x4be3('0x62')](_0x35d68a[_0x4be3('0x5e')][_0x4be3('0x62')]));_0x526e99[_0x4be3('0x63')]=_0x526e99[_0x4be3('0x63')]['length']?_0x526e99[_0x4be3('0x63')]:_0x49340b[_0x4be3('0x55')];if(_0x35d68a[_0x4be3('0x5e')][_0x4be3('0x6c')]){_0x526e99['include']=[{'all':!![]}];}_0x526e99=_[_0x4be3('0x6a')]({},_0x526e99,_0x35d68a[_0x4be3('0x6b')]);return db[_0x4be3('0x5a')][_0x4be3('0x71')](_0x526e99)[_0x4be3('0x16')](handleEntityNotFound(_0x5937a1,null))[_0x4be3('0x16')](respondWithResult(_0x5937a1,null))['catch'](handleError(_0x5937a1,null));};exports['create']=function(_0x22b807,_0x239b2b){return db[_0x4be3('0x5a')][_0x4be3('0x72')](_0x22b807[_0x4be3('0x73')],{})['then'](function(_0xbe48c8){var _0x4aa89c=_0x22b807[_0x4be3('0x74')]['get']({'plain':!![]});if(!_0x4aa89c)throw new Error(_0x4be3('0x75'));if(_0x4aa89c[_0x4be3('0x76')]==='user'){var _0x1b2417=_0xbe48c8[_0x4be3('0x2c')]({'plain':!![]});var _0x1dd571=_0x4be3('0x2d');return db[_0x4be3('0x77')]['find']({'where':{'name':_0x1dd571,'userProfileId':_0x4aa89c[_0x4be3('0x78')]},'raw':!![]})[_0x4be3('0x16')](function(_0x1fb47f){if(_0x1fb47f&&_0x1fb47f[_0x4be3('0x79')]===0x0){return db[_0x4be3('0x2e')][_0x4be3('0x72')]({'name':_0x1b2417[_0x4be3('0x30')],'resourceId':_0x1b2417['id'],'type':_0x1fb47f[_0x4be3('0x30')],'sectionId':_0x1fb47f['id']},{})[_0x4be3('0x16')](function(){return _0xbe48c8;});}else{return _0xbe48c8;}})['catch'](function(_0x2e610b){logger[_0x4be3('0x1c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e610b);throw _0x2e610b;});}return _0xbe48c8;})[_0x4be3('0x16')](respondWithResult(_0x239b2b,0xc9))[_0x4be3('0x3e')](handleError(_0x239b2b,null));};exports[_0x4be3('0x2a')]=function(_0x366152,_0x40bbbd){if(_0x366152[_0x4be3('0x73')]['id']){delete _0x366152['body']['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x366152[_0x4be3('0x70')]['id']},'include':[{'model':db['Pause'],'as':_0x4be3('0x59')}]})['then'](handleEntityNotFound(_0x40bbbd,null))[_0x4be3('0x16')](saveUpdates(_0x366152['body'],null))[_0x4be3('0x16')](respondWithResult(_0x40bbbd,null))[_0x4be3('0x3e')](handleError(_0x40bbbd,null));};exports[_0x4be3('0x2b')]=function(_0x56044b,_0x3bb95d){return db['ChatWebsite'][_0x4be3('0x71')]({'where':{'id':_0x56044b[_0x4be3('0x70')]['id']}})[_0x4be3('0x16')](handleEntityNotFound(_0x3bb95d,null))[_0x4be3('0x16')](removeEntity(_0x3bb95d,null))[_0x4be3('0x3e')](handleError(_0x3bb95d,null));};exports[_0x4be3('0x7a')]=function(_0x10e0a6,_0x43e1b7){return db['ChatWebsite']['describe']()[_0x4be3('0x16')](respondWithResult(_0x43e1b7,null))[_0x4be3('0x3e')](handleError(_0x43e1b7,null));};exports[_0x4be3('0x7b')]=function(_0x516089,_0x2c03c9){if(_0x516089[_0x4be3('0x73')]['id']){delete _0x516089[_0x4be3('0x73')]['id'];}return db[_0x4be3('0x5a')][_0x4be3('0x71')]({'where':{'id':_0x516089[_0x4be3('0x70')]['id']}})[_0x4be3('0x16')](handleEntityNotFound(_0x2c03c9,null))[_0x4be3('0x16')](function(_0x635339){if(_0x635339){_0x516089[_0x4be3('0x73')][_0x4be3('0x7c')]=_0x635339['id'];return db[_0x4be3('0x7d')][_0x4be3('0x72')](_0x516089['body']);}})[_0x4be3('0x16')](respondWithResult(_0x2c03c9,null))[_0x4be3('0x3e')](handleError(_0x2c03c9,null));};exports[_0x4be3('0x7e')]=function(_0x48d0fb,_0x3961e4){var _0x59ecda={'raw':![],'where':{}};var _0x7458d7={};var _0x12cb83={'count':0x0,'rows':[]};return db[_0x4be3('0x5a')]['findOne']({'where':{'id':_0x48d0fb['params']['id']}})[_0x4be3('0x16')](handleEntityNotFound(_0x3961e4,null))[_0x4be3('0x16')](function(_0x6aab57){if(_0x6aab57){_0x7458d7[_0x4be3('0x55')]=_[_0x4be3('0x5f')](db[_0x4be3('0x7d')][_0x4be3('0x5b')]);_0x7458d7['query']=_['keys'](_0x48d0fb['query']);_0x7458d7[_0x4be3('0x60')]=_['intersection'](_0x7458d7['model'],_0x7458d7[_0x4be3('0x5e')]);_0x59ecda[_0x4be3('0x63')]=_[_0x4be3('0x61')](_0x7458d7[_0x4be3('0x55')],qs[_0x4be3('0x62')](_0x48d0fb['query']['fields']));_0x59ecda['attributes']=_0x59ecda[_0x4be3('0x63')][_0x4be3('0x64')]?_0x59ecda[_0x4be3('0x63')]:_0x7458d7['model'];if(!_0x48d0fb[_0x4be3('0x5e')]['hasOwnProperty'](_0x4be3('0x65'))){_0x59ecda[_0x4be3('0x25')]=qs[_0x4be3('0x25')](_0x48d0fb[_0x4be3('0x5e')][_0x4be3('0x25')]);_0x59ecda[_0x4be3('0x27')]=qs[_0x4be3('0x27')](_0x48d0fb[_0x4be3('0x5e')][_0x4be3('0x27')]);}_0x59ecda[_0x4be3('0x66')]=qs[_0x4be3('0x67')](_0x48d0fb[_0x4be3('0x5e')][_0x4be3('0x67')]);_0x59ecda[_0x4be3('0x68')]=qs[_0x4be3('0x60')](_[_0x4be3('0x7f')](_0x48d0fb[_0x4be3('0x5e')],_0x7458d7[_0x4be3('0x60')]));_0x59ecda[_0x4be3('0x68')][_0x4be3('0x7c')]=_0x6aab57['id'];if(_0x48d0fb[_0x4be3('0x5e')]['filter']){_0x59ecda[_0x4be3('0x68')]=_[_0x4be3('0x6a')](_0x59ecda[_0x4be3('0x68')],{'$or':_[_0x4be3('0x41')](_0x59ecda[_0x4be3('0x63')],function(_0x4fdef7){var _0x45bcbe={};_0x45bcbe[_0x4fdef7]={'$like':'%'+_0x48d0fb[_0x4be3('0x5e')][_0x4be3('0x69')]+'%'};return _0x45bcbe;})});}_0x59ecda=_['merge']({},_0x59ecda,_0x48d0fb['options']);return db['Disposition'][_0x4be3('0x26')]({'where':_0x59ecda['where']})[_0x4be3('0x16')](function(_0x1be523){_0x12cb83[_0x4be3('0x26')]=_0x1be523;if(_0x48d0fb[_0x4be3('0x5e')]['includeAll']){_0x59ecda[_0x4be3('0x80')]=[{'all':!![]}];}return db[_0x4be3('0x7d')][_0x4be3('0x6d')](_0x59ecda);})[_0x4be3('0x16')](function(_0x170db0){_0x12cb83[_0x4be3('0x6e')]=_0x170db0;return _0x12cb83;});}})[_0x4be3('0x16')](respondWithFilteredResult(_0x3961e4,_0x59ecda))['catch'](handleError(_0x3961e4,null));};exports[_0x4be3('0x81')]=function(_0xfccad4,_0x5c8bf1){return db['ChatWebsite'][_0x4be3('0x71')]({'where':{'id':_0xfccad4[_0x4be3('0x70')]['id']}})[_0x4be3('0x16')](handleEntityNotFound(_0x5c8bf1,null))[_0x4be3('0x16')](function(_0x4c88af){if(_0x4c88af){return _0x4c88af[_0x4be3('0x81')](_0xfccad4['query']['ids']);}})[_0x4be3('0x16')](respondWithStatusCode(_0x5c8bf1,null))[_0x4be3('0x3e')](handleError(_0x5c8bf1,null));};exports[_0x4be3('0x82')]=function(_0x2ad927,_0x5bfa89){if(_0x2ad927[_0x4be3('0x73')]['id']){delete _0x2ad927[_0x4be3('0x73')]['id'];}return db['ChatWebsite'][_0x4be3('0x71')]({'where':{'id':_0x2ad927['params']['id']}})[_0x4be3('0x16')](handleEntityNotFound(_0x5bfa89,null))['then'](function(_0x47e961){if(_0x47e961){_0x2ad927[_0x4be3('0x73')][_0x4be3('0x7c')]=_0x47e961['id'];return db['CannedAnswer']['create'](_0x2ad927[_0x4be3('0x73')]);}})[_0x4be3('0x16')](respondWithResult(_0x5bfa89,null))[_0x4be3('0x3e')](handleError(_0x5bfa89,null));};exports[_0x4be3('0x83')]=function(_0x664c77,_0xd8222a){var _0x264978={'raw':![],'where':{}};var _0x461086={};var _0x103769={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x4be3('0x84')]({'where':{'id':_0x664c77[_0x4be3('0x70')]['id']}})[_0x4be3('0x16')](handleEntityNotFound(_0xd8222a,null))[_0x4be3('0x16')](function(_0x193d39){if(_0x193d39){_0x461086['model']=_[_0x4be3('0x5f')](db[_0x4be3('0x85')][_0x4be3('0x5b')]);_0x461086[_0x4be3('0x5e')]=_[_0x4be3('0x5f')](_0x664c77['query']);_0x461086['filters']=_['intersection'](_0x461086['model'],_0x461086[_0x4be3('0x5e')]);_0x264978[_0x4be3('0x63')]=_[_0x4be3('0x61')](_0x461086[_0x4be3('0x55')],qs[_0x4be3('0x62')](_0x664c77[_0x4be3('0x5e')][_0x4be3('0x62')]));_0x264978[_0x4be3('0x63')]=_0x264978[_0x4be3('0x63')][_0x4be3('0x64')]?_0x264978[_0x4be3('0x63')]:_0x461086[_0x4be3('0x55')];if(!_0x664c77[_0x4be3('0x5e')][_0x4be3('0x86')](_0x4be3('0x65'))){_0x264978[_0x4be3('0x25')]=qs['limit'](_0x664c77['query'][_0x4be3('0x25')]);_0x264978[_0x4be3('0x27')]=qs[_0x4be3('0x27')](_0x664c77['query'][_0x4be3('0x27')]);}_0x264978[_0x4be3('0x66')]=qs[_0x4be3('0x67')](_0x664c77[_0x4be3('0x5e')]['sort']);_0x264978[_0x4be3('0x68')]=qs[_0x4be3('0x60')](_[_0x4be3('0x7f')](_0x664c77[_0x4be3('0x5e')],_0x461086[_0x4be3('0x60')]));_0x264978[_0x4be3('0x68')][_0x4be3('0x7c')]=_0x193d39['id'];if(_0x664c77[_0x4be3('0x5e')][_0x4be3('0x69')]){_0x264978[_0x4be3('0x68')]=_['merge'](_0x264978[_0x4be3('0x68')],{'$or':_[_0x4be3('0x41')](_0x264978[_0x4be3('0x63')],function(_0x550f09){var _0x41cf00={};_0x41cf00[_0x550f09]={'$like':'%'+_0x664c77[_0x4be3('0x5e')][_0x4be3('0x69')]+'%'};return _0x41cf00;})});}_0x264978=_['merge']({},_0x264978,_0x664c77['options']);return db['CannedAnswer'][_0x4be3('0x26')]({'where':_0x264978[_0x4be3('0x68')]})[_0x4be3('0x16')](function(_0x18ee1a){_0x103769[_0x4be3('0x26')]=_0x18ee1a;if(_0x664c77['query'][_0x4be3('0x6c')]){_0x264978['include']=[{'all':!![]}];}return db[_0x4be3('0x85')][_0x4be3('0x6d')](_0x264978);})[_0x4be3('0x16')](function(_0x1a99c3){_0x103769[_0x4be3('0x6e')]=_0x1a99c3;return _0x103769;});}})[_0x4be3('0x16')](respondWithFilteredResult(_0xd8222a,_0x264978))[_0x4be3('0x3e')](handleError(_0xd8222a,null));};exports[_0x4be3('0x87')]=function(_0x32133f,_0x329912){return db[_0x4be3('0x5a')][_0x4be3('0x71')]({'where':{'id':_0x32133f[_0x4be3('0x70')]['id']}})[_0x4be3('0x16')](handleEntityNotFound(_0x329912,null))['then'](function(_0x5d17c9){if(_0x5d17c9){return _0x5d17c9[_0x4be3('0x87')](_0x32133f[_0x4be3('0x5e')][_0x4be3('0x88')]);}})['then'](respondWithStatusCode(_0x329912,null))[_0x4be3('0x3e')](handleError(_0x329912,null));};exports[_0x4be3('0x89')]=function(_0x345389,_0xa9b34f){_0x345389[_0x4be3('0x73')][_0x4be3('0x8a')]=_0x345389[_0x4be3('0x8b')][_0x4be3('0x8c')];return db['ChatWebsite']['find']({'where':{'id':_0x345389[_0x4be3('0x70')]['id']}})['then'](handleEntityNotFound(_0xa9b34f,null))[_0x4be3('0x16')](saveUpdates(_0x345389[_0x4be3('0x73')],null))[_0x4be3('0x16')](respondWithResult(_0xa9b34f,null))['catch'](handleError(_0xa9b34f,null));};exports['addAvatar']=function(_0x362877,_0x46f83e){_0x362877['body'][_0x4be3('0x8d')]=_0x362877[_0x4be3('0x8b')][_0x4be3('0x8c')];return db[_0x4be3('0x5a')][_0x4be3('0x71')]({'where':{'id':_0x362877[_0x4be3('0x70')]['id']}})[_0x4be3('0x16')](handleEntityNotFound(_0x46f83e,null))[_0x4be3('0x16')](saveUpdates(_0x362877[_0x4be3('0x73')],null))['then'](respondWithResult(_0x46f83e,null))[_0x4be3('0x3e')](handleError(_0x46f83e,null));};exports[_0x4be3('0x8e')]=function(_0x4e30ad,_0x10497b){_0x4e30ad[_0x4be3('0x73')][_0x4be3('0x8f')]=_0x4e30ad['file'][_0x4be3('0x8c')];return db[_0x4be3('0x5a')][_0x4be3('0x71')]({'where':{'id':_0x4e30ad[_0x4be3('0x70')]['id']}})[_0x4be3('0x16')](handleEntityNotFound(_0x10497b,null))[_0x4be3('0x16')](saveUpdates(_0x4e30ad['body'],null))[_0x4be3('0x16')](respondWithResult(_0x10497b,null))[_0x4be3('0x3e')](handleError(_0x10497b,null));};exports[_0x4be3('0x90')]=function(_0x348ef6,_0x1dc671){_0x348ef6[_0x4be3('0x73')][_0x4be3('0x91')]=_0x348ef6['file'][_0x4be3('0x8c')];return db[_0x4be3('0x5a')][_0x4be3('0x71')]({'where':{'id':_0x348ef6[_0x4be3('0x70')]['id']}})['then'](handleEntityNotFound(_0x1dc671,null))[_0x4be3('0x16')](saveUpdates(_0x348ef6['body'],null))[_0x4be3('0x16')](respondWithResult(_0x1dc671,null))[_0x4be3('0x3e')](handleError(_0x1dc671,null));};exports[_0x4be3('0x92')]=function(_0x5b60f1,_0x17ded7){var _0x1b3b5f=path[_0x4be3('0x93')](config[_0x4be3('0x94')],_0x4be3('0x95'));var _0x5ced18={'where':{'id':_0x5b60f1[_0x4be3('0x70')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x463199=![];return require('../../config/license/util')[_0x4be3('0x96')]()[_0x4be3('0x16')](function(_0x417413){if(_0x417413){_0x463199=_0x417413['custom'];}})[_0x4be3('0x16')](function(){return db[_0x4be3('0x5a')][_0x4be3('0x71')](_0x5ced18);})['then'](handleEntityNotFound(_0x17ded7,null))[_0x4be3('0x16')](function(_0x58a2c4){if(_0x58a2c4){if(!_[_0x4be3('0x97')](_0x58a2c4[_0x4be3('0x8a')])){if(fs['existsSync'](path[_0x4be3('0x93')](config[_0x4be3('0x94')],'server/files/images/logos/',_0x58a2c4['sitepic']))&&_0x463199){_0x1b3b5f=path['join'](config[_0x4be3('0x94')],_0x4be3('0x98'),_0x58a2c4[_0x4be3('0x8a')]);}}return _0x17ded7[_0x4be3('0x99')](_0x1b3b5f);}})['catch'](handleError(_0x17ded7,null));};exports[_0x4be3('0x9a')]=function(_0x58a7a9,_0x1df715){var _0x31cd69=path[_0x4be3('0x93')](config[_0x4be3('0x94')],_0x4be3('0x9b'));var _0x303b11={'where':{'id':_0x58a7a9[_0x4be3('0x70')]['id']},'attributes':['id',_0x4be3('0x8d')],'raw':!![]};return db[_0x4be3('0x5a')][_0x4be3('0x71')](_0x303b11)['then'](handleEntityNotFound(_0x1df715,null))[_0x4be3('0x16')](function(_0x52e712){if(_0x52e712){if(!_[_0x4be3('0x97')](_0x52e712[_0x4be3('0x8d')])){if(fs[_0x4be3('0x9c')](path[_0x4be3('0x93')](config[_0x4be3('0x94')],'server/files/images/avatars/',_0x52e712[_0x4be3('0x8d')]))){_0x31cd69=path[_0x4be3('0x93')](config[_0x4be3('0x94')],_0x4be3('0x9d'),_0x52e712[_0x4be3('0x8d')]);}}return _0x1df715[_0x4be3('0x99')](_0x31cd69);}})[_0x4be3('0x3e')](handleError(_0x1df715,null));};exports[_0x4be3('0x9e')]=function(_0x257f59,_0x9d8d5e){var _0x5c3283=path['join'](config[_0x4be3('0x94')],'server/files/images/avatars/customer_avatar.png');var _0x3dec62={'where':{'id':_0x257f59['params']['id']},'attributes':['id',_0x4be3('0x8f'),_0x4be3('0x9f')],'raw':!![]};return db[_0x4be3('0x5a')][_0x4be3('0x71')](_0x3dec62)[_0x4be3('0x16')](handleEntityNotFound(_0x9d8d5e,null))[_0x4be3('0x16')](function(_0x384d28){if(_0x384d28){if(!_[_0x4be3('0x97')](_0x384d28[_0x4be3('0x8f')])){if(fs['existsSync'](path['join'](config[_0x4be3('0x94')],_0x4be3('0x9d'),_0x384d28[_0x4be3('0x8f')]))&&_0x384d28[_0x4be3('0x9f')]){_0x5c3283=path[_0x4be3('0x93')](config[_0x4be3('0x94')],_0x4be3('0x9d'),_0x384d28[_0x4be3('0x8f')]);}}return _0x9d8d5e[_0x4be3('0x99')](_0x5c3283);}})[_0x4be3('0x3e')](handleError(_0x9d8d5e,null));};exports[_0x4be3('0xa0')]=function(_0x181a81,_0x492929){var _0x28c7d4=path[_0x4be3('0x93')](config[_0x4be3('0x94')],_0x4be3('0xa1'));var _0x351289={'where':{'id':_0x181a81['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x4be3('0x5a')][_0x4be3('0x71')](_0x351289)[_0x4be3('0x16')](handleEntityNotFound(_0x492929,null))[_0x4be3('0x16')](function(_0x35d4ba){if(_0x35d4ba){if(!_['isNil'](_0x35d4ba[_0x4be3('0x91')])){if(fs[_0x4be3('0x9c')](path['join'](config[_0x4be3('0x94')],_0x4be3('0x9d'),_0x35d4ba[_0x4be3('0x91')]))){_0x28c7d4=path[_0x4be3('0x93')](config['root'],_0x4be3('0x9d'),_0x35d4ba['systemAvatar']);}}return _0x492929['download'](_0x28c7d4);}})[_0x4be3('0x3e')](handleError(_0x492929,null));};exports[_0x4be3('0xa2')]=function(_0x3b0143,_0x3d3fbd){var _0x4a3b63={'body':_0x3b0143[_0x4be3('0x73')],'channel':_0x4be3('0xa3')};var _0xb0fd84=[];var _0x2b200f=[];var _0x2bd13f={};var _0x596377=![];return db[_0x4be3('0xa4')][_0x4be3('0x7a')]()['then'](function(_0x1d2564){if(!_0x1d2564){throw new db[(_0x4be3('0xa5'))][(_0x4be3('0xa6'))](_0x4be3('0xa7'));}_0xb0fd84=_[_0x4be3('0xa8')](_['keys'](_0x1d2564),['createdAt',_0x4be3('0xa9')]);_0x2b200f=_[_0x4be3('0xa8')](_['keys'](_0x1d2564),['createdAt',_0x4be3('0xa9'),_0x4be3('0xaa'),'ListId']);if(_0x3b0143[_0x4be3('0x73')]['id']){delete _0x3b0143[_0x4be3('0x73')]['id'];}if(_['isNil'](_0x3b0143['body']['from'])){throw new db['Sequelize'][(_0x4be3('0xa6'))](_0x4be3('0xab'));}if(_['isNil'](_0x3b0143[_0x4be3('0x73')]['body'])||_0x3b0143['body'][_0x4be3('0x73')]===''){throw new db[(_0x4be3('0xa5'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x4be3('0x97')](_0x3b0143[_0x4be3('0x73')][_0x4be3('0xac')])){throw new db[(_0x4be3('0xa5'))]['ValidationError'](_0x4be3('0xad')+_0x2b200f);}if(!_[_0x4be3('0xae')](_0x2b200f,_0x3b0143[_0x4be3('0x73')][_0x4be3('0xac')])){throw new db[(_0x4be3('0xa5'))][(_0x4be3('0xa6'))](_0x4be3('0xaf')+_0x2b200f);}_0x2bd13f[_0x3b0143[_0x4be3('0x73')][_0x4be3('0xac')]]=_0x3b0143[_0x4be3('0x73')][_0x4be3('0xb0')];})[_0x4be3('0x16')](function(){return db[_0x4be3('0x5a')][_0x4be3('0x71')]({'where':{'id':_0x3b0143['params']['id']},'include':[{'model':db[_0x4be3('0xb1')],'as':_0x4be3('0xb2'),'include':[{'model':db[_0x4be3('0xa4')],'as':'Contacts','where':_0x2bd13f,'limit':0x1,'order':[[_0x4be3('0xa9'),'DESC']]}]},{'model':db['ChatApplication'],'as':_0x4be3('0xb3')},{'model':db[_0x4be3('0xb4')],'as':_0x4be3('0xb4'),'include':[{'model':db[_0x4be3('0xb4')],'as':_0x4be3('0xb5'),'attributes':['id',_0x4be3('0x37')],'raw':!![]}]}]});})[_0x4be3('0x16')](function(_0x335877){if(!_0x335877)throw new APINotFoundError(util[_0x4be3('0x35')](_0x4be3('0xb6'),_0x3b0143[_0x4be3('0x70')]['id']));if(!_0x335877[_0x4be3('0xb4')]||!_0x335877[_0x4be3('0xb4')][_0x4be3('0xb5')])return[_0x335877,!![]];return[_0x335877,checkWebsiteIntervals(_0x335877)];})[_0x4be3('0xb7')](function(_0x3b5bd0,_0x2d9684){if(!_0x2d9684)throw new APIOutOfIntervalError();if(!_0x3b5bd0['List'])return;_0x4a3b63['account']=_0x3b5bd0;_0x4a3b63[_0x4be3('0xb8')]=_0x3b5bd0[_0x4be3('0xb2')];_0x4a3b63[_0x4be3('0xb9')]=_['orderBy'](_0x3b5bd0['Applications'],[_0x4be3('0xba')],[_0x4be3('0xbb')]);if(_0x4a3b63[_0x4be3('0xbc')][_0x4be3('0xb3')]){delete _0x4a3b63[_0x4be3('0xbc')][_0x4be3('0xb3')];}if(_0x4a3b63[_0x4be3('0xbc')]['List']&&_0x4a3b63[_0x4be3('0xbc')][_0x4be3('0xb2')][_0x4be3('0xbd')][_0x4be3('0x64')]){return _0x4a3b63[_0x4be3('0xbc')][_0x4be3('0xb2')][_0x4be3('0xbd')][0x0];}var _0x393919=_[_0x4be3('0xe')](_0x3b0143['body'],{'firstName':_0x3b0143['body'][_0x4be3('0xb0')],'ListId':_0x3b5bd0['ListId']});_0x393919[_0x3b0143[_0x4be3('0x73')][_0x4be3('0xac')]]=_0x3b0143[_0x4be3('0x73')][_0x4be3('0xb0')];return db['CmContact']['create'](_0x393919,{'fields':_0xb0fd84,'raw':!![]});})[_0x4be3('0x16')](function(_0x1f3a56){_0x4a3b63[_0x4be3('0xbe')]=_0x1f3a56;var _0x3d48b5=createInteractionObject(_0x3b0143[_0x4be3('0x70')]['id'],_0x3b0143[_0x4be3('0x73')],_0x3b0143[_0x4be3('0xbf')],_0x1f3a56);var _0x12ca44={'ChatWebsiteId':_0x3b0143['params']['id'],'closed':![]};if(_0x3b0143[_0x4be3('0x73')][_0x4be3('0xc0')]){_0x12ca44[_0x4be3('0xc0')]=_0x3b0143['body'][_0x4be3('0xc0')];return db[_0x4be3('0xc1')]['find']({'where':_0x12ca44})[_0x4be3('0x16')](function(_0x3d9179){if(_0x3d9179){_0x596377=!![];return _0x3d9179;}_0x3d48b5[_0x4be3('0xc0')]=_0x3b0143['body'][_0x4be3('0xc0')];_0x3d48b5[_0x4be3('0xc2')]=_0x3b0143[_0x4be3('0x73')]['externalUrl'];return db[_0x4be3('0xc1')]['create'](_0x3d48b5);});}_0x12ca44[_0x4be3('0xc3')]=_0x1f3a56['id'];if(_0x3b0143[_0x4be3('0x73')][_0x4be3('0xc4')]&&_0x3b0143[_0x4be3('0x73')][_0x4be3('0xc4')]['id']){_0x12ca44['id']=_0x3b0143[_0x4be3('0x73')]['interaction']['id'];return db[_0x4be3('0xc1')][_0x4be3('0x71')]({'where':_0x12ca44})[_0x4be3('0x16')](function(_0x159f76){if(_0x159f76){_0x596377=!![];return _0x159f76;}return db['ChatInteraction'][_0x4be3('0x72')](_0x3d48b5);});}return db[_0x4be3('0xc1')][_0x4be3('0x72')](_0x3d48b5);})[_0x4be3('0x16')](function(_0xae85be){if(!_0x596377)return _0xae85be;var _0x58f6cc={'from':(_0x4a3b63[_0x4be3('0xbe')]['firstName']||'')+'\x20'+(_0x4a3b63['contact'][_0x4be3('0x4c')]||'')};if(_0x3b0143[_0x4be3('0x73')]['threadId']&&_0x3b0143[_0x4be3('0x73')]['messageId']&&_0x3b0143[_0x4be3('0x73')]['threadId']!=_0x3b0143[_0x4be3('0x73')]['messageId']){_0x58f6cc[_0x4be3('0xc0')]=_0x3b0143['body'][_0x4be3('0xc5')];}return _0xae85be[_0x4be3('0x2a')](_0x58f6cc);})[_0x4be3('0x16')](function(_0x3fc4e9){_0x4a3b63['interaction']=_0x3fc4e9[_0x4be3('0x2c')]({'plain':!![]});_0x4a3b63[_0x4be3('0xc4')][_0x4be3('0xc6')]=!_0x596377;if(_0x4a3b63[_0x4be3('0xc4')]['created']){if(_0x4a3b63[_0x4be3('0xbc')]['autoclose']){_0x4a3b63['applications'][_0x4be3('0xc7')]({'id':0x0,'priority':_0x4a3b63[_0x4be3('0xb9')][_0x4be3('0x64')]+0x1,'app':_0x4be3('0xc8'),'appdata':_0x4be3('0xc9'),'interval':_0x4be3('0xca')});}}return db[_0x4be3('0xcb')][_0x4be3('0x72')]({'body':_0x3b0143[_0x4be3('0x73')][_0x4be3('0x73')],'ChatWebsiteId':_0x3b0143['params']['id'],'ChatInteractionId':_0x3fc4e9['id'],'direction':'in','ContactId':_0x4a3b63[_0x4be3('0xbe')]['id'],'AttachmentId':_0x3b0143['body']['AttachmentId']});})[_0x4be3('0x16')](function(_0xc9d527){_0x4a3b63['message']=_0xc9d527;if(!_0x4a3b63[_0x4be3('0xc4')][_0x4be3('0xcc')]){return;}return db['User'][_0x4be3('0x71')]({'attributes':['id',_0x4be3('0x30')],'where':{'id':_0x4a3b63[_0x4be3('0xc4')][_0x4be3('0xcc')]}});})[_0x4be3('0x16')](function(_0x3869f2){if(_0x3869f2){_0x4a3b63[_0x4be3('0xb9')][_0x4be3('0xcd')]({'id':0x0,'priority':0x0,'app':_0x4be3('0xce'),'appdata':_0x3869f2[_0x4be3('0x30')]+','+(_0x4a3b63[_0x4be3('0xbc')][_0x4be3('0xcf')]||0xa),'interval':_0x4be3('0xca')});_0x4a3b63[_0x4be3('0xd0')]=!![];}if(!_0x4a3b63[_0x4be3('0xc4')][_0x4be3('0xd1')]){return;}return db['ChatQueue']['find']({'attributes':['id','name'],'where':{'id':_0x4a3b63[_0x4be3('0xc4')][_0x4be3('0xd1')]}});})['then'](function(_0xcbeab6){if(_0xcbeab6){_0x4a3b63[_0x4be3('0xb9')][_0x4be3('0xcd')]({'id':0x0,'priority':0x1,'app':_0x4be3('0xd2'),'appdata':_0xcbeab6[_0x4be3('0x30')]+','+(_0x4a3b63[_0x4be3('0xbc')]['waitForTheAssignedQueue']||0x12c),'interval':_0x4be3('0xca')});}return respondWithRpcPromise(_0x4be3('0xd3'),_0x4be3('0xd4'),_0x4a3b63);})[_0x4be3('0x16')](function(_0x2f9b37){respondWithRpcPromise('EventManager',_0x4be3('0xd5'),{'event':'notify','message':_0x2f9b37},client9002);return _0x2f9b37;})['then'](respondWithResult(_0x3d3fbd,null))[_0x4be3('0x3e')](APIHandleError(_0x3d3fbd));};exports[_0x4be3('0xd6')]=function(_0x37224d,_0x111596){var _0x67ea32,_0xfafbba,_0x45f594;var _0xe44b00=[];var _0x36681d={};var _0xa93fe3=_0x37224d['files']||[];var _0x3842ab=[];var _0xe9aa4d;return db[_0x4be3('0xa4')]['describe']()['then'](function(_0xce7d20){if(!_0xce7d20){throw new db[(_0x4be3('0xa5'))][(_0x4be3('0xa6'))]('no\x20available\x20attributes');}_0xe44b00=_[_0x4be3('0xa8')](_[_0x4be3('0x5f')](_0xce7d20),[_0x4be3('0xd7'),_0x4be3('0xa9'),_0x4be3('0xaa'),_0x4be3('0xd8')]);if(_0x37224d['body']['id']){delete _0x37224d[_0x4be3('0x73')]['id'];}if(_[_0x4be3('0x97')](_0x37224d[_0x4be3('0x73')]['from'])){throw _0x111596[_0x4be3('0x22')](0x1f4)[_0x4be3('0x31')](new db[(_0x4be3('0xa5'))]['ValidationError']('from\x20is\x20mandatory'));}if(_['isNil'](_0x37224d[_0x4be3('0x73')][_0x4be3('0x73')])||_0x37224d['body']['body']===''){throw _0x111596[_0x4be3('0x22')](0x1f4)['send'](new db[(_0x4be3('0xa5'))][(_0x4be3('0xa6'))](_0x4be3('0xd9')));}if(_[_0x4be3('0x97')](_0x37224d[_0x4be3('0x73')][_0x4be3('0xda')])){throw _0x111596[_0x4be3('0x22')](0x1f4)[_0x4be3('0x31')](new db[(_0x4be3('0xa5'))]['ValidationError'](_0x4be3('0xdb')+_0xe44b00));}if(!_['includes'](_0xe44b00,_0x37224d[_0x4be3('0x73')][_0x4be3('0xda')])){throw _0x111596['status'](0x1f4)['send'](new db[(_0x4be3('0xa5'))]['ValidationError']('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xe44b00));}_0x36681d[_0x37224d['body'][_0x4be3('0xda')]]=_0x37224d[_0x4be3('0x73')]['from'];})[_0x4be3('0x16')](function(){return db[_0x4be3('0x5a')][_0x4be3('0x71')]({'where':{'id':_0x37224d[_0x4be3('0x70')]['id']},'include':[{'model':db[_0x4be3('0xb1')],'as':_0x4be3('0xb2')},{'model':db[_0x4be3('0xdc')],'as':_0x4be3('0xdc')}]});})['then'](handleEntityNotFound(_0x111596,null))[_0x4be3('0x16')](function(_0x3023cf){if(_0x3023cf&&_0x3023cf['List']){_0xfafbba=_0x3023cf;var _0x44e0ec=_[_0x4be3('0xe')](_0x37224d['body'],{'firstName':_0x37224d[_0x4be3('0x73')][_0x4be3('0xb0')],'phone':_0x37224d['body'][_0x4be3('0xb0')],'ListId':_0x3023cf[_0x4be3('0xd8')]});_0x44e0ec[_0x37224d[_0x4be3('0x73')][_0x4be3('0xda')]]=_0x37224d[_0x4be3('0x73')][_0x4be3('0xb0')];return db[_0x4be3('0xa4')]['findOrCreate']({'where':_0x36681d,'defaults':_0x44e0ec});}})[_0x4be3('0xb7')](function(_0x39bc04){if(_0x39bc04){_0x45f594=_0x39bc04;var _0x3b3c74=fs['readFileSync'](path[_0x4be3('0x93')](config[_0x4be3('0x94')],_0x4be3('0xdd')),_0x4be3('0xde'));var _0x3a6d9b=ejs[_0x4be3('0xdf')](_0x3b3c74,{'body':_[_0x4be3('0xe0')](_0x37224d[_0x4be3('0x73')][_0x4be3('0x73')]),'bodyTitle':_0xfafbba[_0x4be3('0xe1')]});return db[_0x4be3('0xe2')][_0x4be3('0x72')]({'body':_0x3a6d9b,'plainBody':htmlToText[_0x4be3('0xe3')](_0x3a6d9b),'ContactId':_0x39bc04['id'],'ChatWebsiteId':_0xfafbba['id']});}})['then'](function(_0x339b70){_0xe9aa4d=_0x339b70;if(_0xa93fe3[_0x4be3('0x64')]){var _0x44b8f2=_0xa93fe3['map'](function(_0x5a73d8){return{'name':_0x5a73d8[_0x4be3('0xe4')],'basename':_0x5a73d8['filename'],'type':_0x5a73d8['mimetype'],'ChatOfflineMessageId':_0x339b70['id']};});_0x3842ab=_0x44b8f2['map'](_0x312d4b=>{var _0x367c66={'filename':_0x312d4b[_0x4be3('0x30')],'path':path[_0x4be3('0x93')](config[_0x4be3('0x94')],'server',_0x4be3('0xe5'),_0x4be3('0xe6'),_0x4be3('0xe7'),_0x312d4b[_0x4be3('0xe8')])};return _0x367c66;});if(!_0xfafbba[_0x4be3('0xe9')]){return db['sequelize']['transaction'](function(_0xff91c5){return db[_0x4be3('0xea')][_0x4be3('0xeb')](_0x44b8f2,{'transaction':_0xff91c5});});}}})[_0x4be3('0x16')](function(){if(_0xe9aa4d){_0x67ea32=_0xe9aa4d;return db[_0x4be3('0xdc')][_0x4be3('0x84')]({'where':{'service':!![]},'include':[{'model':db[_0x4be3('0xec')],'as':_0x4be3('0xed'),'raw':!![],'include':[{'model':db[_0x4be3('0xee')],'as':_0x4be3('0xee'),'raw':!![]}]}]});}})[_0x4be3('0x16')](function(_0x41219f){if(_0x41219f&&_0x41219f[_0x4be3('0xed')]&&_0xfafbba[_0x4be3('0xef')]&&_0xfafbba[_0x4be3('0xf0')]){var _0x1f09c1=_0x41219f[_0x4be3('0xf1')]();return respondWithRpcPromise(_0x4be3('0xf2'),_0x4be3('0xf3'),{'account':_0x1f09c1,'message':{'from':util[_0x4be3('0x35')](_0x4be3('0xf4'),_0x41219f[_0x4be3('0x30')],_0x41219f[_0x4be3('0xf5')]||_0x41219f[_0x4be3('0xed')][_0x4be3('0x74')]),'to':_0xfafbba[_0x4be3('0xf0')],'subject':_0xfafbba[_0x4be3('0xf6')],'html':_0x67ea32[_0x4be3('0x73')],'attachments':_0x3842ab}},client9003)['then'](function(){return _0x67ea32;})['catch'](function(_0xf5212e){logger[_0x4be3('0x1c')](_0xf5212e);});}})['then'](function(){if(_0xfafbba&&_0xfafbba[_0x4be3('0xe9')]&&_0xfafbba[_0x4be3('0xf7')]){var _0x48e430=[];if(_0xa93fe3[_0x4be3('0x64')]){_0x48e430=_0xa93fe3[_0x4be3('0x41')](function(_0x28ca21){return{'name':_0x28ca21[_0x4be3('0xe4')],'basename':_0x28ca21[_0x4be3('0x8c')],'type':_0x28ca21[_0x4be3('0xf8')],'ChatOfflineMessageId':_0xe9aa4d['id']};});}var _0x4c267f;if(!_['isNil'](_0xfafbba[_0x4be3('0xf9')])){var _0x11a4a7=_[_0x4be3('0x41')](_0x37224d[_0x4be3('0x73')],function(_0x48d3de){return _0x48d3de;});var _0x36edad=_[_0x4be3('0xfa')](_0x11a4a7)[0x0];var _0x415d83=_[_0x4be3('0xfb')](_0x36edad,function(_0x1eed97){return _0x1eed97;});_0x4c267f=_0x415d83[0x1][_0xfafbba['subjectOffline']];}var _0x4cee1c={'from':_0x45f594[_0x4be3('0xf5')],'firstName':_0x45f594[_0x4be3('0x4b')],'lastName':_0x45f594['lastName'],'mapKey':'email','message':{'from':_0x45f594[_0x4be3('0xf5')],'to':_0xfafbba[_0x4be3('0xdc')][_0x4be3('0xf5')],'cc':'','subject':_[_0x4be3('0x97')](_0x4c267f)?_0xfafbba['offlineMessageSubject']:_0x4c267f,'messageId':'','sentAt':new Date(),'attach':_0x48e430['length'],'attachments':_0x48e430,'originChannel':_0x4be3('0xfc'),'ChatWebsiteId':_0xfafbba['id'],'ChatOfflineMessageId':_0x67ea32['id'],'originTo':_0xfafbba[_0x4be3('0xdc')][_0x4be3('0xf5')]},'body':_0x67ea32['body']};var _0x1493a5={'account':{'id':_0xfafbba[_0x4be3('0xf7')]},'body':_0x4cee1c,'log':_0x4be3('0xfd')};return respondWithRpcPromise('NotifyMailAccount','notifyMail',_0x1493a5,client9001)['then'](function(){return _0x67ea32;})[_0x4be3('0x3e')](function(_0x5af500){logger['error'](_0x5af500);});}return;})[_0x4be3('0x16')](function(){if(_0x67ea32){return _0x67ea32;}})[_0x4be3('0x16')](respondWithResult(_0x111596,null))['catch'](function(){for(var _0x177301 of _0xa93fe3){var _0x2c9ec9=path[_0x4be3('0x93')](config['root'],'server','files',_0x4be3('0xe6'),_0x4be3('0xe7'),_0x177301[_0x4be3('0x8c')]);fs_extra[_0x4be3('0xfe')](_0x2c9ec9)[_0x4be3('0x3e')](function(_0x134953){logger[_0x4be3('0x1c')](_0x4be3('0xff'),_0x2c9ec9,_0x134953);});}});};exports[_0x4be3('0x100')]=function(_0x4c2ff6,_0x4e2f41){return db[_0x4be3('0xc1')][_0x4be3('0x71')]({'where':{'id':_0x4c2ff6[_0x4be3('0x70')]['id']}})[_0x4be3('0x16')](handleEntityNotFound(_0x4e2f41,null))[_0x4be3('0x16')](function(_0x5d6bb2){if(_0x5d6bb2){return _0x5d6bb2['addInteraction'](_0x4c2ff6[_0x4be3('0x73')][_0x4be3('0x88')],_['omit'](_0x4c2ff6[_0x4be3('0x73')],[_0x4be3('0x88'),'id'])||{});}})[_0x4be3('0x16')](respondWithResult(_0x4e2f41,null))[_0x4be3('0x3e')](handleError(_0x4e2f41,null));};exports[_0x4be3('0x101')]=function(_0x3e298d,_0x113a04){var _0x114a14={'raw':![],'where':{}};var _0x525202={};var _0xee6b77={'count':0x0,'rows':[]};return db[_0x4be3('0x5a')]['findOne']({'where':{'id':_0x3e298d['params']['id']}})[_0x4be3('0x16')](handleEntityNotFound(_0x113a04,null))['then'](function(_0x1e78f7){if(_0x1e78f7){_0x525202[_0x4be3('0x55')]=_[_0x4be3('0x5f')](db[_0x4be3('0xc1')][_0x4be3('0x5b')]);_0x525202[_0x4be3('0x5e')]=_[_0x4be3('0x5f')](_0x3e298d['query']);_0x525202[_0x4be3('0x60')]=_['intersection'](_0x525202[_0x4be3('0x55')],_0x525202['query']);_0x114a14['attributes']=_[_0x4be3('0x61')](_0x525202[_0x4be3('0x55')],qs[_0x4be3('0x62')](_0x3e298d['query']['fields']));_0x114a14[_0x4be3('0x63')]=_0x114a14[_0x4be3('0x63')][_0x4be3('0x64')]?_0x114a14[_0x4be3('0x63')]:_0x525202[_0x4be3('0x55')];if(!_0x3e298d['query'][_0x4be3('0x86')](_0x4be3('0x65'))){_0x114a14[_0x4be3('0x25')]=qs[_0x4be3('0x25')](_0x3e298d[_0x4be3('0x5e')]['limit']);_0x114a14['offset']=qs[_0x4be3('0x27')](_0x3e298d['query'][_0x4be3('0x27')]);}_0x114a14[_0x4be3('0x66')]=qs[_0x4be3('0x67')](_0x3e298d[_0x4be3('0x5e')][_0x4be3('0x67')]);_0x114a14[_0x4be3('0x68')]=qs[_0x4be3('0x60')](_[_0x4be3('0x7f')](_0x3e298d['query'],_0x525202['filters']));_0x114a14[_0x4be3('0x68')][_0x4be3('0x7c')]=_0x1e78f7['id'];if(_0x3e298d[_0x4be3('0x5e')][_0x4be3('0x69')]){_0x114a14['where']=_[_0x4be3('0x6a')](_0x114a14[_0x4be3('0x68')],{'$or':_['map'](_0x114a14[_0x4be3('0x63')],function(_0x1cd353){var _0x42ed99={};_0x42ed99[_0x1cd353]={'$like':'%'+_0x3e298d['query'][_0x4be3('0x69')]+'%'};return _0x42ed99;})});}_0x114a14=_[_0x4be3('0x6a')]({},_0x114a14,_0x3e298d[_0x4be3('0x6b')]);return db[_0x4be3('0xc1')][_0x4be3('0x26')]({'where':_0x114a14[_0x4be3('0x68')]})[_0x4be3('0x16')](function(_0x444e64){_0xee6b77[_0x4be3('0x26')]=_0x444e64;if(_0x3e298d[_0x4be3('0x5e')]['includeAll']){_0x114a14[_0x4be3('0x80')]=[{'model':db[_0x4be3('0xa4')],'as':_0x4be3('0x102'),'required':![]},{'model':db[_0x4be3('0x103')],'as':'Owner','attributes':[_0x4be3('0x30'),_0x4be3('0x104'),_0x4be3('0x105')],'required':![]},{'model':db[_0x4be3('0x106')],'as':'Tags','attributes':['id','name',_0x4be3('0x107')],'where':_0x3e298d[_0x4be3('0x5e')]['tag']?{'id':_0x3e298d[_0x4be3('0x5e')][_0x4be3('0x108')]}:undefined,'required':_0x3e298d[_0x4be3('0x5e')][_0x4be3('0x108')]?!![]:![]}];}return db[_0x4be3('0xc1')][_0x4be3('0x6d')](_0x114a14);})['then'](function(_0x472f0a){_0xee6b77['rows']=_0x472f0a;return _0xee6b77;});}})[_0x4be3('0x16')](respondWithFilteredResult(_0x113a04,_0x114a14))['catch'](handleError(_0x113a04,null));};exports[_0x4be3('0x33')]=function(_0xd2a7db,_0x55a680){var _0xcd3c8b=0x0;var _0x1965b4=0x0;var _0x37d4d7=![];var _0x36c15e;var _0x4a2f2e;return db[_0x4be3('0x5a')][_0x4be3('0x71')]({'where':{'id':_0xd2a7db[_0x4be3('0x70')]['id']},'include':[{'model':db[_0x4be3('0xb4')],'as':'Interval','include':[{'model':db['Interval'],'as':_0x4be3('0xb5'),'attributes':['id',_0x4be3('0x37')]}]}]})[_0x4be3('0x16')](handleEntityNotFound(_0x55a680,null))[_0x4be3('0x16')](function(_0x18d761){if(_0x18d761){_0x36c15e=_0x18d761;return _0x18d761[_0x4be3('0x109')]({'raw':!![]});}})[_0x4be3('0x16')](function(_0x5751c7){if(_0x36c15e){if(_0x5751c7){_0x4a2f2e=_0x5751c7;}}return require(_0x4be3('0x10a'))[_0x4be3('0x96')]();})[_0x4be3('0x16')](function(_0x1f4ab7){if(_0x1f4ab7){_0x1965b4=_0x1f4ab7[_0x4be3('0x10b')];_0x37d4d7=_0x1f4ab7[_0x4be3('0x10c')];}})[_0x4be3('0x16')](function(){return db['ChatInteraction'][_0x4be3('0x26')]({'where':{'closed':![]}});})[_0x4be3('0x16')](function(_0x25e9a5){_0xcd3c8b=_0x25e9a5;if(_0x1965b4&&_0x25e9a5>_0x1965b4){return db[_0x4be3('0x10d')]['findOne']({'where':{'id':0x1}})[_0x4be3('0x16')](function(_0x281ebe){if(_0x281ebe){_0x281ebe['increment'](_0x4be3('0x10e'));}});}})[_0x4be3('0x16')](function(){if(!_0x36c15e[_0x4be3('0xb4')]||!_0x36c15e[_0x4be3('0xb4')][_0x4be3('0xb5')])return!![];return checkWebsiteIntervals(_0x36c15e);})[_0x4be3('0x16')](function(_0x55cbc8){var _0x4c7688=fs['readFileSync'](path[_0x4be3('0x93')](config[_0x4be3('0x94')],_0x4be3('0x10f')),_0x4be3('0xde'));var _0x2bc980=new url['URL'](_0x36c15e[_0x4be3('0x110')])[_0x4be3('0x111')];var _0x3da56b='3.5.0';var _0x558e88=![];var _0x348294={'chatVersion':_0x3da56b,'chatWebsiteAddressOrigin':_0x2bc980,'remote':_0x36c15e['remote'],'query':querystring[_0x4be3('0x1b')](_[_0x4be3('0x6a')](_0x36c15e['get']({'plain':!![]}),{'customerIp':_0xd2a7db[_0x4be3('0xbf')][_0x4be3('0x48')]||_0xd2a7db[_0x4be3('0xbf')]['x-real-ip']||_0xd2a7db['connection'][_0x4be3('0x112')]||_0xd2a7db['ip'],'referer':_0xd2a7db[_0x4be3('0xbf')][_0x4be3('0x113')],'openedInteractions':_0xcd3c8b,'maxInteractions':_0x1965b4,'virtual':_0x37d4d7['virtual'],'online':_0x55cbc8,'custom':_0x37d4d7}))[_0x4be3('0x114')](/'/g,'\x5c\x27')};_0x55a680[_0x4be3('0x31')](ejs['render'](Mustache[_0x4be3('0xdf')](_0x4c7688,_0x348294),{'proactiveActions':_0x4a2f2e,'alignment':_0x36c15e['alignment'],'verticalAlignment':_0x36c15e[_0x4be3('0x115')],'div_color':_0x36c15e[_0x4be3('0x107')],'labelText':_0x36c15e['labelText'],'text_color':_0x36c15e[_0x4be3('0x116')],'text_button_color':_0x36c15e[_0x4be3('0x117')],'button_color':_0x36c15e[_0x4be3('0x118')],'background_color':_0x36c15e['backgroundColor'],'hideWhenOffline':_0x36c15e[_0x4be3('0x119')],'intervalId':_0x36c15e[_0x4be3('0x11a')],'isDevelopment':_0x558e88,'chatVersion':_0x3da56b}));})[_0x4be3('0x3e')](handleError(_0x55a680,null));};exports[_0x4be3('0x11b')]=function(_0x4e60aa,_0x204e43){var _0x1029e1=_0x4e60aa[_0x4be3('0x70')]['id'];var _0x26af9f=_0x4e60aa[_0x4be3('0x73')];var _0x24498d=0xc8;var _0xf0b71d=null;return db['sequelize'][_0x4be3('0x11c')]({'isolationLevel':db['sequelize'][_0x4be3('0x11d')][_0x4be3('0x11e')][_0x4be3('0x11f')]},function(_0x22fc88){return db[_0x4be3('0x5a')][_0x4be3('0x84')]({'where':{'id':_0x1029e1},'transaction':_0x22fc88})[_0x4be3('0x16')](function(_0x531d4a){if(_0x531d4a){return db[_0x4be3('0x120')][_0x4be3('0x2b')]({'where':{'ChatWebsiteId':_0x1029e1},'transaction':_0x22fc88})['then'](function(){var _0x3deda9=_['map'](_0x26af9f,function(_0x3a7975){_0x3a7975[_0x4be3('0x7c')]=_0x1029e1;return _0x3a7975;});return db[_0x4be3('0x120')][_0x4be3('0xeb')](_0x3deda9,{'transaction':_0x22fc88});});}else{_0x24498d=0x194;_0xf0b71d=[];}});})[_0x4be3('0x16')](function(){if(_0x24498d!==0x194){return db[_0x4be3('0x120')][_0x4be3('0x121')]({'where':{'ChatWebsiteId':_0x1029e1},'order':_0x4be3('0xba')})[_0x4be3('0x16')](function(_0x21111a){_0xf0b71d=_0x21111a;});}})[_0x4be3('0x3e')](function(_0x23b675){_0x24498d=0x1f4;logger['error'](_0x23b675[_0x4be3('0x2f')]);if(_0x23b675[_0x4be3('0x30')]){delete _0x23b675[_0x4be3('0x30')];}_0xf0b71d=_0x23b675;})['finally'](function(){if(_0xf0b71d===null){_0x204e43[_0x4be3('0x20')](_0x24498d);}else{if(_0x24498d===0x1f4){_0x204e43[_0x4be3('0x22')](_0x24498d)['send'](_0xf0b71d);}else{_0x204e43['status'](_0x24498d)[_0x4be3('0x23')](_0xf0b71d);}}});};exports[_0x4be3('0x122')]=function(_0x1c6628,_0x220f09){var _0x2fcca0={};var _0x503f6f={};var _0x417e92;var _0x546210;return db[_0x4be3('0x5a')][_0x4be3('0x84')]({'where':{'id':_0x1c6628[_0x4be3('0x70')]['id']}})[_0x4be3('0x16')](handleEntityNotFound(_0x220f09,null))[_0x4be3('0x16')](function(_0xdcf808){if(_0xdcf808){_0x417e92=_0xdcf808;_0x503f6f['model']=_[_0x4be3('0x5f')](db[_0x4be3('0x120')]['rawAttributes']);_0x503f6f[_0x4be3('0x5e')]=_[_0x4be3('0x5f')](_0x1c6628[_0x4be3('0x5e')]);_0x503f6f[_0x4be3('0x60')]=_[_0x4be3('0x61')](_0x503f6f[_0x4be3('0x55')],_0x503f6f[_0x4be3('0x5e')]);_0x2fcca0[_0x4be3('0x63')]=_[_0x4be3('0x61')](_0x503f6f[_0x4be3('0x55')],qs[_0x4be3('0x62')](_0x1c6628['query'][_0x4be3('0x62')]));_0x2fcca0[_0x4be3('0x63')]=_0x2fcca0[_0x4be3('0x63')]['length']?_0x2fcca0[_0x4be3('0x63')]:_0x503f6f[_0x4be3('0x55')];_0x2fcca0['order']=qs[_0x4be3('0x67')](_0x1c6628[_0x4be3('0x5e')][_0x4be3('0x67')]);_0x2fcca0[_0x4be3('0x68')]=qs[_0x4be3('0x60')](_[_0x4be3('0x7f')](_0x1c6628[_0x4be3('0x5e')],_0x503f6f['filters']));if(_0x1c6628[_0x4be3('0x5e')]['filter']){_0x2fcca0['where']=_[_0x4be3('0x6a')](_0x2fcca0[_0x4be3('0x68')],{'$or':_[_0x4be3('0x41')](_0x2fcca0[_0x4be3('0x63')],function(_0xca6dc1){var _0x2f7fc9={};_0x2f7fc9[_0xca6dc1]={'$like':'%'+_0x1c6628[_0x4be3('0x5e')]['filter']+'%'};return _0x2f7fc9;})});}_0x2fcca0=_[_0x4be3('0x6a')]({},_0x2fcca0,_0x1c6628[_0x4be3('0x6b')]);return _0x417e92['getApplications'](_0x2fcca0);}})[_0x4be3('0x16')](function(_0x565dd4){if(_0x565dd4){_0x546210=_0x565dd4[_0x4be3('0x64')];if(!_0x1c6628['query'][_0x4be3('0x86')]('nolimit')){_0x2fcca0[_0x4be3('0x25')]=qs[_0x4be3('0x25')](_0x1c6628['query'][_0x4be3('0x25')]);_0x2fcca0[_0x4be3('0x27')]=qs[_0x4be3('0x27')](_0x1c6628['query']['offset']);}return _0x417e92[_0x4be3('0x122')](_0x2fcca0);}})[_0x4be3('0x16')](function(_0x3972db){if(_0x3972db){return _0x3972db?{'count':_0x546210,'rows':_0x3972db}:null;}})[_0x4be3('0x16')](respondWithResult(_0x220f09,null))['catch'](handleError(_0x220f09,null));};exports[_0x4be3('0x123')]=function(_0x3d2c18,_0x37df0b){return db[_0x4be3('0x124')][_0x4be3('0x71')]({'where':{'id':_0x3d2c18['params']['id']}})[_0x4be3('0x16')](handleEntityNotFound(_0x37df0b,null))['then'](function(_0x191d10){if(_0x191d10){return _0x191d10[_0x4be3('0x123')](_0x3d2c18[_0x4be3('0x73')][_0x4be3('0x88')],_['omit'](_0x3d2c18[_0x4be3('0x73')],[_0x4be3('0x88'),'id'])||{});}})[_0x4be3('0x16')](respondWithResult(_0x37df0b,null))['catch'](handleError(_0x37df0b,null));};exports['getProactiveActions']=function(_0x438533,_0x9839f4){var _0x26227a={};var _0x1e0e41={};var _0x79ba73;var _0x4664c2;return db[_0x4be3('0x5a')][_0x4be3('0x84')]({'where':{'id':_0x438533[_0x4be3('0x70')]['id']}})[_0x4be3('0x16')](handleEntityNotFound(_0x9839f4,null))[_0x4be3('0x16')](function(_0x34719e){if(_0x34719e){_0x79ba73=_0x34719e;_0x1e0e41['model']=_['keys'](db[_0x4be3('0x125')][_0x4be3('0x5b')]);_0x1e0e41[_0x4be3('0x5e')]=_[_0x4be3('0x5f')](_0x438533[_0x4be3('0x5e')]);_0x1e0e41[_0x4be3('0x60')]=_[_0x4be3('0x61')](_0x1e0e41[_0x4be3('0x55')],_0x1e0e41[_0x4be3('0x5e')]);_0x26227a[_0x4be3('0x63')]=_[_0x4be3('0x61')](_0x1e0e41[_0x4be3('0x55')],qs[_0x4be3('0x62')](_0x438533['query'][_0x4be3('0x62')]));_0x26227a[_0x4be3('0x63')]=_0x26227a[_0x4be3('0x63')]['length']?_0x26227a[_0x4be3('0x63')]:_0x1e0e41['model'];_0x26227a[_0x4be3('0x66')]=qs[_0x4be3('0x67')](_0x438533[_0x4be3('0x5e')][_0x4be3('0x67')]);_0x26227a[_0x4be3('0x68')]=qs[_0x4be3('0x60')](_[_0x4be3('0x7f')](_0x438533['query'],_0x1e0e41[_0x4be3('0x60')]));if(_0x438533[_0x4be3('0x5e')]['filter']){_0x26227a[_0x4be3('0x68')]=_[_0x4be3('0x6a')](_0x26227a[_0x4be3('0x68')],{'$or':_['map'](_0x26227a[_0x4be3('0x63')],function(_0x5bc1d8){var _0x53d6a3={};_0x53d6a3[_0x5bc1d8]={'$like':'%'+_0x438533[_0x4be3('0x5e')][_0x4be3('0x69')]+'%'};return _0x53d6a3;})});}_0x26227a=_['merge']({},_0x26227a,_0x438533[_0x4be3('0x6b')]);return _0x79ba73['getProactiveActions'](_0x26227a);}})['then'](function(_0x5a0b84){if(_0x5a0b84){_0x4664c2=_0x5a0b84['length'];if(!_0x438533['query'][_0x4be3('0x86')](_0x4be3('0x65'))){_0x26227a[_0x4be3('0x25')]=qs['limit'](_0x438533[_0x4be3('0x5e')]['limit']);_0x26227a[_0x4be3('0x27')]=qs[_0x4be3('0x27')](_0x438533[_0x4be3('0x5e')]['offset']);}return _0x79ba73['getProactiveActions'](_0x26227a);}})[_0x4be3('0x16')](function(_0x16df3a){if(_0x16df3a){return _0x16df3a?{'count':_0x4664c2,'rows':_0x16df3a}:null;}})['then'](respondWithResult(_0x9839f4,null))[_0x4be3('0x3e')](handleError(_0x9839f4,null));};exports['getFields']=function(_0x5f0533,_0x37c641){var _0x2c5b64=_0x5f0533[_0x4be3('0x5e')][_0x4be3('0x126')]===_0x4be3('0x127')?_0x4be3('0x128'):_0x4be3('0x129');return db[_0x4be3('0x5a')][_0x4be3('0x71')]({'attributes':['id',_0x2c5b64],'where':{'id':_0x5f0533[_0x4be3('0x70')]['id']}})['then'](handleEntityNotFound(_0x37c641,null))['then'](function(_0x18740e){if(_0x18740e){var _0x18c91e=_0x18740e[_0x2c5b64];var _0x54e330=_0x18c91e&&_0x18c91e[_0x4be3('0x12a')]?_0x18c91e['items']:[];_0x37c641[_0x4be3('0x31')]({'fromKey':_['isNil'](_0x18c91e[_0x4be3('0x12b')])?undefined:_0x18c91e[_0x4be3('0x12b')],'count':_0x54e330[_0x4be3('0x64')],'rows':_0x54e330});}})['catch'](handleError(_0x37c641,null));};exports[_0x4be3('0x12c')]=function(_0x39d61b,_0x4b9709){var _0xbebd72={'raw':![],'where':{}};var _0x2af81f={};var _0x5149a4={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x4be3('0x84')]({'where':{'id':_0x39d61b['params']['id']}})[_0x4be3('0x16')](handleEntityNotFound(_0x4b9709,null))[_0x4be3('0x16')](function(_0x474a3e){if(_0x474a3e){_0x2af81f[_0x4be3('0x55')]=_[_0x4be3('0x5f')](db[_0x4be3('0xe2')][_0x4be3('0x5b')]);_0x2af81f['query']=_[_0x4be3('0x5f')](_0x39d61b['query']);_0x2af81f[_0x4be3('0x60')]=_[_0x4be3('0x61')](_0x2af81f[_0x4be3('0x55')],_0x2af81f[_0x4be3('0x5e')]);_0xbebd72[_0x4be3('0x63')]=_[_0x4be3('0x61')](_0x2af81f[_0x4be3('0x55')],qs[_0x4be3('0x62')](_0x39d61b['query'][_0x4be3('0x62')]));_0xbebd72[_0x4be3('0x63')]=_0xbebd72['attributes'][_0x4be3('0x64')]?_0xbebd72[_0x4be3('0x63')]:_0x2af81f[_0x4be3('0x55')];if(!_0x39d61b[_0x4be3('0x5e')][_0x4be3('0x86')]('nolimit')){_0xbebd72[_0x4be3('0x25')]=qs[_0x4be3('0x25')](_0x39d61b[_0x4be3('0x5e')][_0x4be3('0x25')]);_0xbebd72[_0x4be3('0x27')]=qs[_0x4be3('0x27')](_0x39d61b[_0x4be3('0x5e')][_0x4be3('0x27')]);}_0xbebd72[_0x4be3('0x66')]=qs['sort'](_0x39d61b[_0x4be3('0x5e')][_0x4be3('0x67')]);_0xbebd72[_0x4be3('0x68')]=qs['filters'](_[_0x4be3('0x7f')](_0x39d61b['query'],_0x2af81f['filters']));_0xbebd72[_0x4be3('0x68')][_0x4be3('0x7c')]=_0x474a3e['id'];if(_0x39d61b[_0x4be3('0x5e')][_0x4be3('0x69')]){_0xbebd72['where']=_[_0x4be3('0x6a')](_0xbebd72[_0x4be3('0x68')],{'$or':_[_0x4be3('0x41')](_0xbebd72[_0x4be3('0x63')],function(_0x34004c){var _0x374c49={};_0x374c49[_0x34004c]={'$like':'%'+_0x39d61b[_0x4be3('0x5e')][_0x4be3('0x69')]+'%'};return _0x374c49;})});}_0xbebd72=_[_0x4be3('0x6a')]({},_0xbebd72,_0x39d61b['options']);return db['ChatOfflineMessage']['count']({'where':_0xbebd72['where']})[_0x4be3('0x16')](function(_0x25fd8b){_0x5149a4['count']=_0x25fd8b;if(_0x39d61b[_0x4be3('0x5e')][_0x4be3('0x6c')]){_0xbebd72['include']=[{'all':!![]}];}else{_0xbebd72[_0x4be3('0x80')]=[{'model':db[_0x4be3('0xa4')],'as':_0x4be3('0x102'),'required':![]},{'model':db[_0x4be3('0xea')],'as':_0x4be3('0x12d'),'required':![]}];}return db[_0x4be3('0xe2')][_0x4be3('0x6d')](_0xbebd72);})[_0x4be3('0x16')](function(_0xce7d5a){_0x5149a4[_0x4be3('0x6e')]=_0xce7d5a;return _0x5149a4;});}})[_0x4be3('0x16')](respondWithFilteredResult(_0x4b9709,_0xbebd72))[_0x4be3('0x3e')](handleError(_0x4b9709,null));};exports['addAgents']=function(_0x31c14b,_0xe97f47){return db['ChatWebsite'][_0x4be3('0x71')]({'where':{'id':_0x31c14b[_0x4be3('0x70')]['id']}})[_0x4be3('0x16')](handleEntityNotFound(_0xe97f47,null))[_0x4be3('0x16')](function(_0x462c19){if(_0x462c19){return _0x462c19['addAgents'](_0x31c14b['body'][_0x4be3('0x88')],_[_0x4be3('0x12e')](_0x31c14b['body'],['ids','id'])||{})['spread'](function(_0x290cf0){for(var _0x95967d=0x0;_0x95967d<_0x31c14b[_0x4be3('0x73')]['ids'][_0x4be3('0x64')];_0x95967d+=0x1){socket['emit'](_0x4be3('0x12f'),{'UserId':Number(_0x31c14b[_0x4be3('0x73')][_0x4be3('0x88')][_0x95967d]),'ChatWebsiteId':Number(_0x31c14b['params']['id'])});}return _0x290cf0;});}})[_0x4be3('0x16')](respondWithResult(_0xe97f47,null))[_0x4be3('0x3e')](handleError(_0xe97f47,null));};exports[_0x4be3('0x130')]=function(_0x211465,_0x577b3f){return db[_0x4be3('0x5a')]['find']({'where':{'id':_0x211465[_0x4be3('0x70')]['id']}})[_0x4be3('0x16')](handleEntityNotFound(_0x577b3f,null))[_0x4be3('0x16')](function(_0x343b09){if(_0x343b09){return _0x343b09['removeAgents'](_0x211465['query'][_0x4be3('0x88')])[_0x4be3('0x16')](function(){if(_[_0x4be3('0x131')](_0x211465['query'][_0x4be3('0x88')])){for(var _0x2f65f2=0x0;_0x2f65f2<_0x211465[_0x4be3('0x5e')]['ids']['length'];_0x2f65f2+=0x1){socket[_0x4be3('0x132')](_0x4be3('0x133'),{'UserId':Number(_0x211465['query'][_0x4be3('0x88')][_0x2f65f2]),'ChatWebsiteId':Number(_0x211465[_0x4be3('0x70')]['id'])});}}else{socket[_0x4be3('0x132')](_0x4be3('0x133'),{'UserId':Number(_0x211465[_0x4be3('0x5e')]['ids']),'ChatWebsiteId':Number(_0x211465[_0x4be3('0x70')]['id'])});}});}})[_0x4be3('0x16')](respondWithStatusCode(_0x577b3f,null))['catch'](handleError(_0x577b3f,null));};exports[_0x4be3('0x134')]=function(_0x2f9d46,_0x1b3a14){var _0x20c555={};var _0x3a9f7f={};var _0xf38522;var _0x1cec80;return db[_0x4be3('0x5a')][_0x4be3('0x84')]({'where':{'id':_0x2f9d46[_0x4be3('0x70')]['id']}})['then'](handleEntityNotFound(_0x1b3a14,null))[_0x4be3('0x16')](function(_0x2c5bff){if(_0x2c5bff){_0xf38522=_0x2c5bff;_0x3a9f7f[_0x4be3('0x55')]=_[_0x4be3('0x5f')](db['User']['rawAttributes']);_0x3a9f7f['query']=_[_0x4be3('0x5f')](_0x2f9d46[_0x4be3('0x5e')]);_0x3a9f7f[_0x4be3('0x60')]=_['intersection'](_0x3a9f7f[_0x4be3('0x55')],_0x3a9f7f['query']);_0x20c555[_0x4be3('0x63')]=_['intersection'](_0x3a9f7f[_0x4be3('0x55')],qs[_0x4be3('0x62')](_0x2f9d46[_0x4be3('0x5e')][_0x4be3('0x62')]));_0x20c555['attributes']=_0x20c555[_0x4be3('0x63')][_0x4be3('0x64')]?_0x20c555[_0x4be3('0x63')]:_0x3a9f7f[_0x4be3('0x55')];_0x20c555[_0x4be3('0x66')]=qs['sort'](_0x2f9d46[_0x4be3('0x5e')][_0x4be3('0x67')]);_0x20c555[_0x4be3('0x68')]=qs[_0x4be3('0x60')](_['pick'](_0x2f9d46[_0x4be3('0x5e')],_0x3a9f7f[_0x4be3('0x60')]));if(_0x2f9d46[_0x4be3('0x5e')][_0x4be3('0x69')]){_0x20c555[_0x4be3('0x68')]=_[_0x4be3('0x6a')](_0x20c555[_0x4be3('0x68')],{'$or':_[_0x4be3('0x41')](_0x20c555['attributes'],function(_0x5b1b5e){var _0x227812={};_0x227812[_0x5b1b5e]={'$like':'%'+_0x2f9d46[_0x4be3('0x5e')]['filter']+'%'};return _0x227812;})});}_0x20c555=_[_0x4be3('0x6a')]({},_0x20c555,_0x2f9d46['options']);return _0xf38522[_0x4be3('0x134')](_0x20c555);}})[_0x4be3('0x16')](function(_0x53e250){if(_0x53e250){_0x1cec80=_0x53e250[_0x4be3('0x64')];if(!_0x2f9d46[_0x4be3('0x5e')][_0x4be3('0x86')](_0x4be3('0x65'))){_0x20c555[_0x4be3('0x25')]=qs[_0x4be3('0x25')](_0x2f9d46[_0x4be3('0x5e')]['limit']);_0x20c555['offset']=qs[_0x4be3('0x27')](_0x2f9d46[_0x4be3('0x5e')][_0x4be3('0x27')]);}return _0xf38522[_0x4be3('0x134')](_0x20c555);}})['then'](function(_0x7c8275){if(_0x7c8275){return _0x7c8275?{'count':_0x1cec80,'rows':_0x7c8275}:null;}})[_0x4be3('0x16')](respondWithResult(_0x1b3a14,null))[_0x4be3('0x3e')](handleError(_0x1b3a14,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index db619e0..04e13d6 100644 --- a/server/api/chatWebsite/chatWebsite.events.js +++ b/server/api/chatWebsite/chatWebsite.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x95f4=['ChatWebsite','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0x95f4,0xf1));var _0x495f=function(_0x31742e,_0x223fdf){_0x31742e=_0x31742e-0x0;var _0x522b5e=_0x95f4[_0x31742e];return _0x522b5e;};'use strict';var EventEmitter=require(_0x495f('0x0'));var ChatWebsite=require(_0x495f('0x1'))['db'][_0x495f('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x495f('0x3'),'afterDestroy':_0x495f('0x4')};function emitEvent(_0x5edb36){return function(_0x501377,_0x87cc22,_0x22465d){ChatWebsiteEvents[_0x495f('0x5')](_0x5edb36+':'+_0x501377['id'],_0x501377);ChatWebsiteEvents['emit'](_0x5edb36,_0x501377);_0x22465d(null);};}for(var e in events){if(events[_0x495f('0x6')](e)){var event=events[e];ChatWebsite[_0x495f('0x7')](e,emitEvent(event));}}module[_0x495f('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0x8a8b=['events','setMaxListeners','save','remove','emit','hook'];(function(_0x1df8f8,_0x5db671){var _0xab71a0=function(_0x4f23b1){while(--_0x4f23b1){_0x1df8f8['push'](_0x1df8f8['shift']());}};_0xab71a0(++_0x5db671);}(_0x8a8b,0xae));var _0xb8a8=function(_0x16c495,_0x4f7f07){_0x16c495=_0x16c495-0x0;var _0x231292=_0x8a8b[_0x16c495];return _0x231292;};'use strict';var EventEmitter=require(_0xb8a8('0x0'));var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xb8a8('0x1')](0x0);var events={'afterCreate':_0xb8a8('0x2'),'afterUpdate':'update','afterDestroy':_0xb8a8('0x3')};function emitEvent(_0x5710bc){return function(_0xca9854,_0x4fe301,_0x4043fd){ChatWebsiteEvents[_0xb8a8('0x4')](_0x5710bc+':'+_0xca9854['id'],_0xca9854);ChatWebsiteEvents[_0xb8a8('0x4')](_0x5710bc,_0xca9854);_0x4043fd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xb8a8('0x5')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index b33044a..3473ba8 100644 --- a/server/api/chatWebsite/chatWebsite.model.js +++ b/server/api/chatWebsite/chatWebsite.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd9dc=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','chat_websites','lodash','util','../../config/logger'];(function(_0x190d26,_0x133371){var _0x2302e4=function(_0x108222){while(--_0x108222){_0x190d26['push'](_0x190d26['shift']());}};_0x2302e4(++_0x133371);}(_0xd9dc,0x101));var _0xcd9d=function(_0x4bdcbf,_0x306baf){_0x4bdcbf=_0x4bdcbf-0x0;var _0x21b314=_0xd9dc[_0x4bdcbf];return _0x21b314;};'use strict';var _=require(_0xcd9d('0x0'));var util=require(_0xcd9d('0x1'));var logger=require(_0xcd9d('0x2'))(_0xcd9d('0x3'));var moment=require(_0xcd9d('0x4'));var BPromise=require(_0xcd9d('0x5'));var rp=require(_0xcd9d('0x6'));var fs=require('fs');var path=require(_0xcd9d('0x7'));var rimraf=require(_0xcd9d('0x8'));var config=require(_0xcd9d('0x9'));var attributes=require(_0xcd9d('0xa'));module[_0xcd9d('0xb')]=function(_0x47190f,_0x3937d6){return _0x47190f['define']('ChatWebsite',attributes,{'tableName':_0xcd9d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x52c3=['moment','bluebird','rimraf','../../config/environment','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger'];(function(_0x3a0b5f,_0x175511){var _0x370688=function(_0x594aa6){while(--_0x594aa6){_0x3a0b5f['push'](_0x3a0b5f['shift']());}};_0x370688(++_0x175511);}(_0x52c3,0x105));var _0x352c=function(_0x402731,_0x43c115){_0x402731=_0x402731-0x0;var _0x111736=_0x52c3[_0x402731];return _0x111736;};'use strict';var _=require(_0x352c('0x0'));var util=require(_0x352c('0x1'));var logger=require(_0x352c('0x2'))('api');var moment=require(_0x352c('0x3'));var BPromise=require(_0x352c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x352c('0x5'));var config=require(_0x352c('0x6'));var attributes=require('./chatWebsite.attributes');module[_0x352c('0x7')]=function(_0x4dd4d8,_0x384108){return _0x4dd4d8[_0x352c('0x8')](_0x352c('0x9'),attributes,{'tableName':_0x352c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 8814806..a3f9d1d 100644 --- a/server/api/chatWebsite/chatWebsite.rpc.js +++ b/server/api/chatWebsite/chatWebsite.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd22f=['error','message','request\x20sent','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','stringify'];(function(_0x1ebc0f,_0x12171a){var _0x5d9cbd=function(_0x1d3bb4){while(--_0x1d3bb4){_0x1ebc0f['push'](_0x1ebc0f['shift']());}};_0x5d9cbd(++_0x12171a);}(_0xd22f,0x1a4));var _0xfd22=function(_0x97501e,_0x48c8fd){_0x97501e=_0x97501e-0x0;var _0x5919c8=_0xd22f[_0x97501e];return _0x5919c8;};'use strict';var _=require(_0xfd22('0x0'));var util=require(_0xfd22('0x1'));var moment=require(_0xfd22('0x2'));var BPromise=require('bluebird');var rs=require(_0xfd22('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfd22('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfd22('0x5'))(_0xfd22('0x6'));var config=require(_0xfd22('0x7'));var jayson=require(_0xfd22('0x8'));var client=jayson[_0xfd22('0x9')]['http']({'port':0x232a});config[_0xfd22('0xa')]=_[_0xfd22('0xb')](config[_0xfd22('0xa')],{'host':_0xfd22('0xc'),'port':0x18eb});var socket=require(_0xfd22('0xd'))(new Redis(config[_0xfd22('0xa')]));require(_0xfd22('0xe'))[_0xfd22('0xf')](socket);function respondWithRpcPromise(_0x9671a,_0x17ea00,_0x2d9aa7){return new BPromise(function(_0xc67996,_0x36e1cc){return client[_0xfd22('0x10')](_0x9671a,_0x2d9aa7)[_0xfd22('0x11')](function(_0x38601f){logger[_0xfd22('0x12')](_0xfd22('0x13'),_0x17ea00,'request\x20sent');logger[_0xfd22('0x14')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x17ea00,'request\x20sent',JSON[_0xfd22('0x15')](_0x38601f));if(_0x38601f[_0xfd22('0x16')]){if(_0x38601f['error']['code']===0x1f4){logger[_0xfd22('0x16')](_0xfd22('0x13'),_0x17ea00,_0x38601f[_0xfd22('0x16')][_0xfd22('0x17')]);return _0x36e1cc(_0x38601f[_0xfd22('0x16')]['message']);}logger['error'](_0xfd22('0x13'),_0x17ea00,_0x38601f[_0xfd22('0x16')][_0xfd22('0x17')]);return _0xc67996(_0x38601f['error']['message']);}else{logger[_0xfd22('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x17ea00,_0xfd22('0x18'));_0xc67996(_0x38601f['result']['message']);}})[_0xfd22('0x19')](function(_0x3faade){logger[_0xfd22('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x17ea00,_0x3faade);_0x36e1cc(_0x3faade);});});} \ No newline at end of file +var _0x24de=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','util','moment','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x24de,0x74));var _0xe24d=function(_0x566667,_0x3f99c2){_0x566667=_0x566667-0x0;var _0x277136=_0x24de[_0x566667];return _0x277136;};'use strict';var _=require(_0xe24d('0x0'));var util=require(_0xe24d('0x1'));var moment=require(_0xe24d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe24d('0x3'));var db=require(_0xe24d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe24d('0x5'))(_0xe24d('0x6'));var config=require(_0xe24d('0x7'));var jayson=require(_0xe24d('0x8'));var client=jayson['client'][_0xe24d('0x9')]({'port':0x232a});config[_0xe24d('0xa')]=_[_0xe24d('0xb')](config[_0xe24d('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xe24d('0xc'))(new Redis(config[_0xe24d('0xa')]));require(_0xe24d('0xd'))[_0xe24d('0xe')](socket);function respondWithRpcPromise(_0x34b026,_0x1d01b5,_0x571ba1){return new BPromise(function(_0x29056d,_0xfef677){return client[_0xe24d('0xf')](_0x34b026,_0x571ba1)[_0xe24d('0x10')](function(_0x5483c9){logger[_0xe24d('0x11')](_0xe24d('0x12'),_0x1d01b5,'request\x20sent');logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x1d01b5,_0xe24d('0x13'),JSON[_0xe24d('0x14')](_0x5483c9));if(_0x5483c9[_0xe24d('0x15')]){if(_0x5483c9[_0xe24d('0x15')][_0xe24d('0x16')]===0x1f4){logger[_0xe24d('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x1d01b5,_0x5483c9[_0xe24d('0x15')][_0xe24d('0x17')]);return _0xfef677(_0x5483c9[_0xe24d('0x15')][_0xe24d('0x17')]);}logger[_0xe24d('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x1d01b5,_0x5483c9[_0xe24d('0x15')][_0xe24d('0x17')]);return _0x29056d(_0x5483c9[_0xe24d('0x15')][_0xe24d('0x17')]);}else{logger[_0xe24d('0x11')](_0xe24d('0x12'),_0x1d01b5,_0xe24d('0x13'));_0x29056d(_0x5483c9['result'][_0xe24d('0x17')]);}})['catch'](function(_0x6e90c2){logger['error'](_0xe24d('0x12'),_0x1d01b5,_0x6e90c2);_0xfef677(_0x6e90c2);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 7f3a1a4..7417c2a 100644 --- a/server/api/chatWebsite/chatWebsite.socket.js +++ b/server/api/chatWebsite/chatWebsite.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6bd9=['emit','removeListener','chatWebsite:','./chatWebsite.events','save','remove','update'];(function(_0x22d7bb,_0x4c158e){var _0x40a737=function(_0xd85bab){while(--_0xd85bab){_0x22d7bb['push'](_0x22d7bb['shift']());}};_0x40a737(++_0x4c158e);}(_0x6bd9,0xea));var _0x96bd=function(_0x2ab202,_0x5a8f28){_0x2ab202=_0x2ab202-0x0;var _0x64b1be=_0x6bd9[_0x2ab202];return _0x64b1be;};'use strict';var ChatWebsiteEvents=require(_0x96bd('0x0'));var events=[_0x96bd('0x1'),_0x96bd('0x2'),_0x96bd('0x3')];function createListener(_0x31c113,_0x585a33){return function(_0x591b34){_0x585a33[_0x96bd('0x4')](_0x31c113,_0x591b34);};}function removeListener(_0x1878a7,_0x5f49e4){return function(){ChatWebsiteEvents[_0x96bd('0x5')](_0x1878a7,_0x5f49e4);};}exports['register']=function(_0x1e50e1){for(var _0x53fbdf=0x0,_0x3cde87=events['length'];_0x53fbdf<_0x3cde87;_0x53fbdf++){var _0x452759=events[_0x53fbdf];var _0x532736=createListener(_0x96bd('0x6')+_0x452759,_0x1e50e1);ChatWebsiteEvents['on'](_0x452759,_0x532736);}}; \ No newline at end of file +var _0xb3cf=['save','remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events'];(function(_0x294c1c,_0x567301){var _0x1e7943=function(_0x575323){while(--_0x575323){_0x294c1c['push'](_0x294c1c['shift']());}};_0x1e7943(++_0x567301);}(_0xb3cf,0x1b8));var _0xfb3c=function(_0x4a8e69,_0x593023){_0x4a8e69=_0x4a8e69-0x0;var _0x55d440=_0xb3cf[_0x4a8e69];return _0x55d440;};'use strict';var ChatWebsiteEvents=require(_0xfb3c('0x0'));var events=[_0xfb3c('0x1'),_0xfb3c('0x2'),_0xfb3c('0x3')];function createListener(_0x33066b,_0x2c71cb){return function(_0x3b0aa1){_0x2c71cb[_0xfb3c('0x4')](_0x33066b,_0x3b0aa1);};}function removeListener(_0x31a9d8,_0x29f9ec){return function(){ChatWebsiteEvents[_0xfb3c('0x5')](_0x31a9d8,_0x29f9ec);};}exports[_0xfb3c('0x6')]=function(_0x3befe1){for(var _0x1bae50=0x0,_0xaa53ff=events[_0xfb3c('0x7')];_0x1bae50<_0xaa53ff;_0x1bae50++){var _0x3e1f1f=events[_0x1bae50];var _0x2d3753=createListener(_0xfb3c('0x8')+_0x3e1f1f,_0x3befe1);ChatWebsiteEvents['on'](_0x3e1f1f,_0x2d3753);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 31efb6d..b1f285a 100644 --- a/server/api/chatWebsite/index.js +++ b/server/api/chatWebsite/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8c21=['/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','getProactiveActions','getFields','getOfflineMessages','getAgents','post','create','addAnswer','diskStorage','join','server/files/images/logos/','format','%s-%s','now','originalname','file','addLogo','server/files/images/avatars/','/:id/avatar','single','addAvatar','root','addCustomerAvatar','addSystemAvatar','/:id/notify','server/files','offline-chat','ensureDir','replace','addInteraction','/:id/applications','addApplications','/:id/proactive_actions','addProactiveActions','/:id/users','put','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar'];(function(_0x95b44e,_0x4af5e1){var _0x4d33ea=function(_0x35acd6){while(--_0x35acd6){_0x95b44e['push'](_0x95b44e['shift']());}};_0x4d33ea(++_0x4af5e1);}(_0x8c21,0x18c));var _0x18c2=function(_0x54996a,_0x4670ee){_0x54996a=_0x54996a-0x0;var _0x2f2bdd=_0x8c21[_0x54996a];return _0x2f2bdd;};'use strict';var multer=require(_0x18c2('0x0'));var util=require(_0x18c2('0x1'));var path=require(_0x18c2('0x2'));var timeout=require(_0x18c2('0x3'));var express=require(_0x18c2('0x4'));var router=express['Router']();var fs_extra=require(_0x18c2('0x5'));var auth=require(_0x18c2('0x6'));var interaction=require(_0x18c2('0x7'));var config=require(_0x18c2('0x8'));var controller=require(_0x18c2('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x18c2('0xa')]('/describe',auth[_0x18c2('0xb')](),controller[_0x18c2('0xc')]);router[_0x18c2('0xa')](_0x18c2('0xd'),auth['isAuthenticated'](),controller[_0x18c2('0xe')]);router[_0x18c2('0xa')](_0x18c2('0xf'),auth['isAuthenticated'](),controller[_0x18c2('0x10')]);router[_0x18c2('0xa')](_0x18c2('0x11'),auth[_0x18c2('0xb')](),controller[_0x18c2('0x12')]);router[_0x18c2('0xa')](_0x18c2('0x13'),controller[_0x18c2('0x14')]);router[_0x18c2('0xa')]('/:id/avatar',controller[_0x18c2('0x15')]);router[_0x18c2('0xa')](_0x18c2('0x16'),controller[_0x18c2('0x17')]);router['get'](_0x18c2('0x18'),controller[_0x18c2('0x19')]);router[_0x18c2('0xa')](_0x18c2('0x1a'),auth[_0x18c2('0xb')](),controller[_0x18c2('0x1b')]);router[_0x18c2('0xa')]('/:id/snippet',controller[_0x18c2('0x1c')]);router[_0x18c2('0xa')]('/:id/applications',auth[_0x18c2('0xb')](),controller['getApplications']);router['get']('/:id/proactive_actions',auth[_0x18c2('0xb')](),controller[_0x18c2('0x1d')]);router[_0x18c2('0xa')]('/:id/fields',controller[_0x18c2('0x1e')]);router[_0x18c2('0xa')]('/:id/offline_messages',auth[_0x18c2('0xb')](),controller[_0x18c2('0x1f')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x18c2('0x20')]);router[_0x18c2('0x21')]('/',auth['isAuthenticated'](),controller[_0x18c2('0x22')]);router[_0x18c2('0x21')](_0x18c2('0xf'),auth[_0x18c2('0xb')](),controller['addDisposition']);router[_0x18c2('0x21')]('/:id/canned_answers',auth[_0x18c2('0xb')](),controller[_0x18c2('0x23')]);var upload=multer({'storage':multer[_0x18c2('0x24')]({'destination':function(_0xb14e9b,_0x2bfb51,_0x50a013){_0x50a013(null,path[_0x18c2('0x25')](config['root'],_0x18c2('0x26')));},'filename':function(_0x13803f,_0x354cad,_0x11015e){_0x11015e(null,util[_0x18c2('0x27')](_0x18c2('0x28'),Date[_0x18c2('0x29')](),_0x354cad[_0x18c2('0x2a')]));}})});router[_0x18c2('0x21')](_0x18c2('0x13'),upload['single'](_0x18c2('0x2b')),controller[_0x18c2('0x2c')]);var upload=multer({'storage':multer[_0x18c2('0x24')]({'destination':function(_0x2d9a08,_0x575a79,_0x3aac00){_0x3aac00(null,path[_0x18c2('0x25')](config['root'],_0x18c2('0x2d')));},'filename':function(_0xe29d4f,_0x2d9cec,_0x12659e){_0x12659e(null,util['format']('%s-%s',Date[_0x18c2('0x29')](),_0x2d9cec[_0x18c2('0x2a')]));}})});router[_0x18c2('0x21')](_0x18c2('0x2e'),upload[_0x18c2('0x2f')](_0x18c2('0x2b')),controller[_0x18c2('0x30')]);var upload=multer({'storage':multer[_0x18c2('0x24')]({'destination':function(_0x3dc230,_0xc55e6,_0x65c98a){_0x65c98a(null,path['join'](config[_0x18c2('0x31')],_0x18c2('0x2d')));},'filename':function(_0x577ab8,_0x366f38,_0x23d0ca){_0x23d0ca(null,util[_0x18c2('0x27')](_0x18c2('0x28'),Date[_0x18c2('0x29')](),_0x366f38[_0x18c2('0x2a')]));}})});router[_0x18c2('0x21')](_0x18c2('0x16'),upload['single']('file'),controller[_0x18c2('0x32')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4a08b9,_0x1c3eb3,_0x2f27da){_0x2f27da(null,path['join'](config[_0x18c2('0x31')],'server/files/images/avatars/'));},'filename':function(_0x367acc,_0x2c2a9c,_0x2f0477){_0x2f0477(null,util[_0x18c2('0x27')](_0x18c2('0x28'),Date[_0x18c2('0x29')](),_0x2c2a9c['originalname']));}})});router['post'](_0x18c2('0x18'),upload['single'](_0x18c2('0x2b')),controller[_0x18c2('0x33')]);router[_0x18c2('0x21')](_0x18c2('0x34'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x18c2('0x24')]({'destination':function(_0x181c52,_0x5e3744,_0x662105){const _0x5718e2=path[_0x18c2('0x25')](config['root'],_0x18c2('0x35'),'attachments',_0x18c2('0x36'));fs_extra[_0x18c2('0x37')](_0x5718e2,function(){_0x662105(null,_0x5718e2);});},'filename':function(_0x2ca086,_0x4d30b3,_0x3ae70d){const _0x524b64=_0x4d30b3[_0x18c2('0x2a')][_0x18c2('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x335fde=path['extname'](_0x524b64);const _0xbe5908=Date[_0x18c2('0x29')]()+'-'+_0x524b64[_0x18c2('0x38')](_0x335fde,'')+_0x335fde;_0x3ae70d(null,_0xbe5908);}})});router[_0x18c2('0x21')]('/:id/offline',offlineUploadMulter['any'](),controller['offline']);router['post'](_0x18c2('0x1a'),auth['isAuthenticated'](),controller[_0x18c2('0x39')]);router['post'](_0x18c2('0x3a'),auth['isAuthenticated'](),controller[_0x18c2('0x3b')]);router['post'](_0x18c2('0x3c'),auth['isAuthenticated'](),controller[_0x18c2('0x3d')]);router[_0x18c2('0x21')](_0x18c2('0x3e'),auth[_0x18c2('0xb')](),controller['addAgents']);router[_0x18c2('0x3f')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x18c2('0xb')](),controller[_0x18c2('0x40')]);router[_0x18c2('0x41')](_0x18c2('0xf'),auth[_0x18c2('0xb')](),controller[_0x18c2('0x42')]);router[_0x18c2('0x41')](_0x18c2('0x11'),auth[_0x18c2('0xb')](),controller[_0x18c2('0x43')]);router[_0x18c2('0x41')](_0x18c2('0x3e'),auth[_0x18c2('0xb')](),controller[_0x18c2('0x44')]);module[_0x18c2('0x45')]=router; \ No newline at end of file +var _0x4d29=['join','now','addAvatar','server/files/images/avatars/','/:id/customer_avatar','addCustomerAvatar','/:id/notify','notify','server/files','attachments','ensureDir','replace','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','/:id/users','addAgents','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','index','/describe','describe','/:id','show','/:id/dispositions','isAuthenticated','getDispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/offline_messages','getOfflineMessages','getAgents','post','create','/:id/canned_answers','addAnswer','diskStorage','root','format','%s-%s','originalname','single','file'];(function(_0x2c3bd9,_0x45f815){var _0x112e55=function(_0x22de25){while(--_0x22de25){_0x2c3bd9['push'](_0x2c3bd9['shift']());}};_0x112e55(++_0x45f815);}(_0x4d29,0x1e3));var _0x94d2=function(_0x16e78e,_0x106c9c){_0x16e78e=_0x16e78e-0x0;var _0x273665=_0x4d29[_0x16e78e];return _0x273665;};'use strict';var multer=require('multer');var util=require(_0x94d2('0x0'));var path=require(_0x94d2('0x1'));var timeout=require(_0x94d2('0x2'));var express=require(_0x94d2('0x3'));var router=express[_0x94d2('0x4')]();var fs_extra=require(_0x94d2('0x5'));var auth=require(_0x94d2('0x6'));var interaction=require(_0x94d2('0x7'));var config=require(_0x94d2('0x8'));var controller=require(_0x94d2('0x9'));router[_0x94d2('0xa')]('/',auth['isAuthenticated'](),controller[_0x94d2('0xb')]);router[_0x94d2('0xa')](_0x94d2('0xc'),auth['isAuthenticated'](),controller[_0x94d2('0xd')]);router[_0x94d2('0xa')](_0x94d2('0xe'),auth['isAuthenticated'](),controller[_0x94d2('0xf')]);router[_0x94d2('0xa')](_0x94d2('0x10'),auth[_0x94d2('0x11')](),controller[_0x94d2('0x12')]);router[_0x94d2('0xa')]('/:id/canned_answers',auth[_0x94d2('0x11')](),controller[_0x94d2('0x13')]);router[_0x94d2('0xa')](_0x94d2('0x14'),controller[_0x94d2('0x15')]);router['get'](_0x94d2('0x16'),controller[_0x94d2('0x17')]);router['get']('/:id/customer_avatar',controller[_0x94d2('0x18')]);router[_0x94d2('0xa')](_0x94d2('0x19'),controller[_0x94d2('0x1a')]);router[_0x94d2('0xa')](_0x94d2('0x1b'),auth['isAuthenticated'](),controller[_0x94d2('0x1c')]);router[_0x94d2('0xa')](_0x94d2('0x1d'),controller[_0x94d2('0x1e')]);router[_0x94d2('0xa')](_0x94d2('0x1f'),auth[_0x94d2('0x11')](),controller[_0x94d2('0x20')]);router[_0x94d2('0xa')](_0x94d2('0x21'),auth[_0x94d2('0x11')](),controller[_0x94d2('0x22')]);router['get']('/:id/fields',controller['getFields']);router[_0x94d2('0xa')](_0x94d2('0x23'),auth['isAuthenticated'](),controller[_0x94d2('0x24')]);router['get']('/:id/users',auth[_0x94d2('0x11')](),controller[_0x94d2('0x25')]);router[_0x94d2('0x26')]('/',auth[_0x94d2('0x11')](),controller[_0x94d2('0x27')]);router[_0x94d2('0x26')](_0x94d2('0x10'),auth[_0x94d2('0x11')](),controller['addDisposition']);router[_0x94d2('0x26')](_0x94d2('0x28'),auth['isAuthenticated'](),controller[_0x94d2('0x29')]);var upload=multer({'storage':multer[_0x94d2('0x2a')]({'destination':function(_0x218f0b,_0x5bd37c,_0x58e299){_0x58e299(null,path['join'](config[_0x94d2('0x2b')],'server/files/images/logos/'));},'filename':function(_0x23c9ed,_0xe4c083,_0x32aae8){_0x32aae8(null,util[_0x94d2('0x2c')](_0x94d2('0x2d'),Date['now'](),_0xe4c083[_0x94d2('0x2e')]));}})});router[_0x94d2('0x26')](_0x94d2('0x14'),upload[_0x94d2('0x2f')](_0x94d2('0x30')),controller['addLogo']);var upload=multer({'storage':multer[_0x94d2('0x2a')]({'destination':function(_0x5546b7,_0x1eb542,_0x406b80){_0x406b80(null,path[_0x94d2('0x31')](config[_0x94d2('0x2b')],'server/files/images/avatars/'));},'filename':function(_0x295846,_0x366a27,_0x5ec42c){_0x5ec42c(null,util[_0x94d2('0x2c')](_0x94d2('0x2d'),Date[_0x94d2('0x32')](),_0x366a27[_0x94d2('0x2e')]));}})});router[_0x94d2('0x26')](_0x94d2('0x16'),upload[_0x94d2('0x2f')](_0x94d2('0x30')),controller[_0x94d2('0x33')]);var upload=multer({'storage':multer[_0x94d2('0x2a')]({'destination':function(_0x1be353,_0x38579b,_0x25b66e){_0x25b66e(null,path[_0x94d2('0x31')](config[_0x94d2('0x2b')],_0x94d2('0x34')));},'filename':function(_0x5d009a,_0x17171e,_0x4a2876){_0x4a2876(null,util['format']('%s-%s',Date[_0x94d2('0x32')](),_0x17171e[_0x94d2('0x2e')]));}})});router['post'](_0x94d2('0x35'),upload[_0x94d2('0x2f')]('file'),controller[_0x94d2('0x36')]);var upload=multer({'storage':multer[_0x94d2('0x2a')]({'destination':function(_0x49d328,_0x390160,_0x19c9e8){_0x19c9e8(null,path['join'](config[_0x94d2('0x2b')],_0x94d2('0x34')));},'filename':function(_0x13fbbe,_0x27071a,_0x219217){_0x219217(null,util[_0x94d2('0x2c')](_0x94d2('0x2d'),Date[_0x94d2('0x32')](),_0x27071a['originalname']));}})});router['post'](_0x94d2('0x19'),upload[_0x94d2('0x2f')](_0x94d2('0x30')),controller['addSystemAvatar']);router['post'](_0x94d2('0x37'),controller[_0x94d2('0x38')]);const offlineUploadMulter=multer({'storage':multer[_0x94d2('0x2a')]({'destination':function(_0x354342,_0x6c60,_0x44ed63){const _0x48d5de=path[_0x94d2('0x31')](config['root'],_0x94d2('0x39'),_0x94d2('0x3a'),'offline-chat');fs_extra[_0x94d2('0x3b')](_0x48d5de,function(){_0x44ed63(null,_0x48d5de);});},'filename':function(_0x9693e3,_0x261015,_0x16eb43){const _0x194292=_0x261015['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x512c1b=path['extname'](_0x194292);const _0x3c095e=Date[_0x94d2('0x32')]()+'-'+_0x194292[_0x94d2('0x3c')](_0x512c1b,'')+_0x512c1b;_0x16eb43(null,_0x3c095e);}})});router[_0x94d2('0x26')](_0x94d2('0x3d'),offlineUploadMulter[_0x94d2('0x3e')](),controller[_0x94d2('0x3f')]);router[_0x94d2('0x26')](_0x94d2('0x1b'),auth[_0x94d2('0x11')](),controller[_0x94d2('0x40')]);router[_0x94d2('0x26')](_0x94d2('0x1f'),auth[_0x94d2('0x11')](),controller[_0x94d2('0x41')]);router[_0x94d2('0x26')](_0x94d2('0x21'),auth['isAuthenticated'](),controller[_0x94d2('0x42')]);router[_0x94d2('0x26')](_0x94d2('0x43'),auth[_0x94d2('0x11')](),controller[_0x94d2('0x44')]);router[_0x94d2('0x45')]('/:id',auth[_0x94d2('0x11')](),controller[_0x94d2('0x46')]);router['delete'](_0x94d2('0xe'),auth[_0x94d2('0x11')](),controller['destroy']);router[_0x94d2('0x47')]('/:id/dispositions',auth[_0x94d2('0x11')](),controller[_0x94d2('0x48')]);router[_0x94d2('0x47')](_0x94d2('0x28'),auth[_0x94d2('0x11')](),controller[_0x94d2('0x49')]);router[_0x94d2('0x47')](_0x94d2('0x43'),auth[_0x94d2('0x11')](),controller[_0x94d2('0x4a')]);module[_0x94d2('0x4b')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index dd7c0c6..32654b3 100644 --- a/server/api/client-side-logs.js +++ b/server/api/client-side-logs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfabe=['exports','../components/auth/service','../config/environment','Router','env','get','Client-Side\x20logger\x20not\x20found!','/client-logs','isAuthenticated'];(function(_0x466247,_0x5d69e3){var _0x4b352e=function(_0x58c71b){while(--_0x58c71b){_0x466247['push'](_0x466247['shift']());}};_0x4b352e(++_0x5d69e3);}(_0xfabe,0x64));var _0xefab=function(_0x4b4765,_0x32d7b6){_0x4b4765=_0x4b4765-0x0;var _0x590656=_0xfabe[_0x4b4765];return _0x590656;};var beaverLogger=require('beaver-logger/server');var express=require('express');var auth=require(_0xefab('0x0'));var config=require(_0xefab('0x1'));var router=express[_0xefab('0x2')]();var isProduction=config[_0xefab('0x3')]==='production'||![];function clientSideLogs(_0x54d8b3,_0x1d5015,_0x3e5bb7){var _0x36ae9=_0x54d8b3['app'][_0xefab('0x4')]('client-side-logger');if(!_0x36ae9){throw new Error(_0xefab('0x5'));}return beaverLogger['expressEndpoint']({'uri':_0xefab('0x6'),'logger':_0x36ae9,'enableCors':!isProduction})(_0x54d8b3,_0x1d5015,_0x3e5bb7);}router['use'](auth[_0xefab('0x7')](),clientSideLogs);module[_0xefab('0x8')]=router; \ No newline at end of file +var _0x20fd=['/client-logs','isAuthenticated','exports','express','../components/auth/service','../config/environment','production','get','Client-Side\x20logger\x20not\x20found!','expressEndpoint'];(function(_0x293630,_0x174077){var _0x5ae4c0=function(_0x514cf7){while(--_0x514cf7){_0x293630['push'](_0x293630['shift']());}};_0x5ae4c0(++_0x174077);}(_0x20fd,0xdf));var _0xd20f=function(_0x328e48,_0x2d31b1){_0x328e48=_0x328e48-0x0;var _0x2fefa4=_0x20fd[_0x328e48];return _0x2fefa4;};var beaverLogger=require('beaver-logger/server');var express=require(_0xd20f('0x0'));var auth=require(_0xd20f('0x1'));var config=require(_0xd20f('0x2'));var router=express['Router']();var isProduction=config['env']===_0xd20f('0x3')||![];function clientSideLogs(_0xe4b9f3,_0x54dd92,_0xf5f411){var _0x401152=_0xe4b9f3['app'][_0xd20f('0x4')]('client-side-logger');if(!_0x401152){throw new Error(_0xd20f('0x5'));}return beaverLogger[_0xd20f('0x6')]({'uri':_0xd20f('0x7'),'logger':_0x401152,'enableCors':!isProduction})(_0xe4b9f3,_0x54dd92,_0xf5f411);}router['use'](auth[_0xd20f('0x8')](),clientSideLogs);module[_0xd20f('0x9')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 9554fe9..9b5df81 100644 --- a/server/api/cloudProvider/cloudProvider.attributes.js +++ b/server/api/cloudProvider/cloudProvider.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x214c=['exports','STRING','ENUM','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token'];(function(_0x1e6601,_0x99250b){var _0x44ddf1=function(_0x118097){while(--_0x118097){_0x1e6601['push'](_0x1e6601['shift']());}};_0x44ddf1(++_0x99250b);}(_0x214c,0x1a0));var _0xc214=function(_0x4353cd,_0x3c8895){_0x4353cd=_0x4353cd-0x0;var _0x4eb363=_0x214c[_0x4353cd];return _0x4eb363;};'use strict';var Sequelize=require('sequelize');module[_0xc214('0x0')]={'name':{'type':Sequelize[_0xc214('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xc214('0x2')]('AmazonAWS',_0xc214('0x3'),_0xc214('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xc214('0x2')](_0xc214('0x5'),_0xc214('0x6'))},'data1':{'type':Sequelize[_0xc214('0x1')],'comment':_0xc214('0x7')},'data2':{'type':Sequelize[_0xc214('0x1')],'comment':_0xc214('0x8')},'data3':{'type':Sequelize['STRING'],'comment':_0xc214('0x9')},'data4':{'type':Sequelize[_0xc214('0x1')],'comment':_0xc214('0xa')},'data5':{'type':Sequelize[_0xc214('0xb')],'comment':_0xc214('0xc')},'data6':{'type':Sequelize[_0xc214('0xb')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0xc214('0xb')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}}; \ No newline at end of file +var _0x47ed=['Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365'];(function(_0xe2b8fc,_0x3ec76a){var _0x1bfefb=function(_0x11e1ec){while(--_0x11e1ec){_0xe2b8fc['push'](_0xe2b8fc['shift']());}};_0x1bfefb(++_0x3ec76a);}(_0x47ed,0x98));var _0xd47e=function(_0x534185,_0x1e880f){_0x534185=_0x534185-0x0;var _0xd10ee2=_0x47ed[_0x534185];return _0xd10ee2;};'use strict';var Sequelize=require(_0xd47e('0x0'));module[_0xd47e('0x1')]={'name':{'type':Sequelize[_0xd47e('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xd47e('0x3')](_0xd47e('0x4'),_0xd47e('0x5'),_0xd47e('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xd47e('0x7'),_0xd47e('0x8'))},'data1':{'type':Sequelize['STRING'],'comment':_0xd47e('0x9')},'data2':{'type':Sequelize[_0xd47e('0x2')],'comment':_0xd47e('0xa')},'data3':{'type':Sequelize[_0xd47e('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize['STRING'],'comment':_0xd47e('0xb')},'data5':{'type':Sequelize['TEXT'],'comment':_0xd47e('0xc')},'data6':{'type':Sequelize['TEXT'],'comment':_0xd47e('0xd')},'data7':{'type':Sequelize[_0xd47e('0xe')],'comment':_0xd47e('0xf')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index ac34583..2a0a8a9 100644 --- a/server/api/cloudProvider/cloudProvider.controller.js +++ b/server/api/cloudProvider/cloudProvider.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x201b=['Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','params','encryptString','destroy','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','toString','ascii','id_token','oauth2Claims','del','getOauth2MicrosoftAccessToken','code','data5','refresh_token','startRefreshInterval','emit','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','update','then','error','stack','send','padEnd','slice','index','CloudProvider','type','key','map','name','query','keys','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','options','includeAll','findAll','service','MicrosoftAzure','data3','show','rawAttributes','intersection','include','merge','find','decryptString','catch','create','body','Service\x20parameter\x20not\x20specified','values','includes'];(function(_0x3b1a74,_0x431559){var _0x58b051=function(_0x2b62c4){while(--_0x2b62c4){_0x3b1a74['push'](_0x3b1a74['shift']());}};_0x58b051(++_0x431559);}(_0x201b,0x77));var _0xb201=function(_0x4ec784,_0x3995d7){_0x4ec784=_0x4ec784-0x0;var _0x4e3ec3=_0x201b[_0x4ec784];return _0x4e3ec3;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require(_0xb201('0x0'));var encryptor=require(_0xb201('0x1'));var config=require(_0xb201('0x2'));var logger=require(_0xb201('0x3'))(_0xb201('0x4'));var db=require('../../mysqldb')['db'];var oauth=require(_0xb201('0x5'));config[_0xb201('0x6')]=_[_0xb201('0x7')](config['redis'],{'host':_0xb201('0x8'),'port':0x18eb});var socket=require(_0xb201('0x9'))(new Redis(config[_0xb201('0x6')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x29ee00,_0x9ead73){_0x9ead73=_0x9ead73||0xcc;return function(_0x4d0f07){if(_0x4d0f07){return _0x29ee00[_0xb201('0xa')](_0x9ead73);}return _0x29ee00[_0xb201('0xb')](_0x9ead73)[_0xb201('0xc')]();};}function respondWithResult(_0xeab41d,_0x20bce8){_0x20bce8=_0x20bce8||0xc8;return function(_0xd03a90){if(_0xd03a90){return _0xeab41d[_0xb201('0xb')](_0x20bce8)[_0xb201('0xd')](_0xd03a90);}};}function respondWithFilteredResult(_0x40be56,_0x528c5b){return function(_0x4ac92f){if(_0x4ac92f){var _0x33ad7b=typeof _0x528c5b[_0xb201('0xe')]===_0xb201('0xf')&&typeof _0x528c5b[_0xb201('0x10')]==='undefined';var _0x3c8c4a=_0x4ac92f[_0xb201('0x11')];var _0x5607fe=_0x33ad7b?0x0:_0x528c5b[_0xb201('0xe')];var _0x40ad8f=_0x33ad7b?_0x4ac92f[_0xb201('0x11')]:_0x528c5b[_0xb201('0xe')]+_0x528c5b['limit'];var _0x3d26b7;if(_0x40ad8f>=_0x3c8c4a){_0x40ad8f=_0x3c8c4a;_0x3d26b7=0xc8;}else{_0x3d26b7=0xce;}_0x40be56[_0xb201('0xb')](_0x3d26b7);return _0x40be56[_0xb201('0x12')]('Content-Range',_0x5607fe+'-'+_0x40ad8f+'/'+_0x3c8c4a)[_0xb201('0xd')](_0x4ac92f);}return null;};}function saveUpdates(_0x5ef6ba){return function(_0x2de787){if(_0x2de787){return _0x2de787[_0xb201('0x13')](_0x5ef6ba)[_0xb201('0x14')](function(_0x2cdd49){return _0x2cdd49;});}return null;};}function removeEntity(_0x32da75){return function(_0xc8cf49){if(_0xc8cf49){return _0xc8cf49['destroy']()['then'](function(){_0x32da75[_0xb201('0xb')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3af8a9){return function(_0x3ef4e4){if(!_0x3ef4e4){_0x3af8a9[_0xb201('0xa')](0x194);}return _0x3ef4e4;};}function handleError(_0xe3fcf1,_0x5234a8){_0x5234a8=_0x5234a8||0x1f4;return function(_0x2bb4af){logger[_0xb201('0x15')](_0x2bb4af[_0xb201('0x16')]);if(_0x2bb4af['name']){delete _0x2bb4af['name'];}_0xe3fcf1[_0xb201('0xb')](_0x5234a8)[_0xb201('0x17')](_0x2bb4af);};}function maskClientSecret(_0x1ab884){return _[_0xb201('0x18')](_0x1ab884[_0xb201('0x19')](0x0,0x3),0x14,'*');}exports[_0xb201('0x1a')]=function(_0x52c34c,_0x8acd21){var _0x3384ab={},_0x441a1d={},_0x40be3d={'count':0x0,'rows':[]};var _0x408420=_['map'](db[_0xb201('0x1b')]['rawAttributes'],function(_0x2ae695){return{'name':_0x2ae695['fieldName'],'type':_0x2ae695[_0xb201('0x1c')][_0xb201('0x1d')]};});_0x441a1d['model']=_[_0xb201('0x1e')](_0x408420,_0xb201('0x1f'));_0x441a1d[_0xb201('0x20')]=_[_0xb201('0x21')](_0x52c34c[_0xb201('0x20')]);_0x441a1d['filters']=_['intersection'](_0x441a1d[_0xb201('0x22')],_0x441a1d['query']);_0x3384ab['attributes']=_['intersection'](_0x441a1d['model'],qs[_0xb201('0x23')](_0x52c34c['query']['fields']));_0x3384ab[_0xb201('0x24')]=_0x3384ab[_0xb201('0x24')][_0xb201('0x25')]?_0x3384ab[_0xb201('0x24')]:_0x441a1d[_0xb201('0x22')];if(!_0x52c34c[_0xb201('0x20')][_0xb201('0x26')](_0xb201('0x27'))){_0x3384ab[_0xb201('0x10')]=qs['limit'](_0x52c34c[_0xb201('0x20')][_0xb201('0x10')]);_0x3384ab[_0xb201('0xe')]=qs[_0xb201('0xe')](_0x52c34c[_0xb201('0x20')][_0xb201('0xe')]);}_0x3384ab[_0xb201('0x28')]=qs[_0xb201('0x29')](_0x52c34c[_0xb201('0x20')]['sort']);_0x3384ab[_0xb201('0x2a')]=qs['filters'](_[_0xb201('0x2b')](_0x52c34c[_0xb201('0x20')],_0x441a1d[_0xb201('0x2c')]),_0x408420);if(_0x52c34c['query'][_0xb201('0x2d')]){_0x3384ab[_0xb201('0x2a')]=_['merge'](_0x3384ab[_0xb201('0x2a')],{'$or':_['map'](_0x408420,function(_0x18b526){if(_0x18b526[_0xb201('0x1c')]!=='VIRTUAL'){var _0x452290={};_0x452290[_0x18b526['name']]={'$like':'%'+_0x52c34c[_0xb201('0x20')][_0xb201('0x2d')]+'%'};return _0x452290;}})});}_0x3384ab=_['merge']({},_0x3384ab,_0x52c34c[_0xb201('0x2e')]);var _0x3494ba={'where':_0x3384ab['where']};return db[_0xb201('0x1b')][_0xb201('0x11')](_0x3494ba)[_0xb201('0x14')](function(_0x63d806){_0x40be3d[_0xb201('0x11')]=_0x63d806;if(_0x52c34c[_0xb201('0x20')][_0xb201('0x2f')]){_0x3384ab['include']=[{'all':!![]}];}return db[_0xb201('0x1b')][_0xb201('0x30')](_0x3384ab);})[_0xb201('0x14')](function(_0x3d8507){_0x40be3d['rows']=_['map'](_0x3d8507,function(_0x513d26){if(_0x513d26[_0xb201('0x31')]===_0xb201('0x32')){var _0x22c6ce=encryptor['decryptString'](_0x513d26[_0xb201('0x33')]);_0x513d26[_0xb201('0x33')]=maskClientSecret(_0x22c6ce);}return _0x513d26;});return _0x40be3d;})[_0xb201('0x14')](respondWithFilteredResult(_0x8acd21,_0x3384ab))['catch'](handleError(_0x8acd21,null));};exports[_0xb201('0x34')]=function(_0x4f619c,_0x5cf413){var _0x286a11={'raw':!![],'where':{'id':_0x4f619c['params']['id']}},_0x248b31={};_0x248b31[_0xb201('0x22')]=_[_0xb201('0x21')](db[_0xb201('0x1b')][_0xb201('0x35')]);_0x248b31[_0xb201('0x20')]=_[_0xb201('0x21')](_0x4f619c['query']);_0x248b31[_0xb201('0x2c')]=_[_0xb201('0x36')](_0x248b31[_0xb201('0x22')],_0x248b31[_0xb201('0x20')]);_0x286a11[_0xb201('0x24')]=_[_0xb201('0x36')](_0x248b31[_0xb201('0x22')],qs[_0xb201('0x23')](_0x4f619c[_0xb201('0x20')]['fields']));_0x286a11[_0xb201('0x24')]=_0x286a11[_0xb201('0x24')][_0xb201('0x25')]?_0x286a11['attributes']:_0x248b31[_0xb201('0x22')];if(_0x4f619c[_0xb201('0x20')][_0xb201('0x2f')]){_0x286a11[_0xb201('0x37')]=[{'all':!![]}];}_0x286a11=_[_0xb201('0x38')]({},_0x286a11,_0x4f619c['options']);return db[_0xb201('0x1b')][_0xb201('0x39')](_0x286a11)[_0xb201('0x14')](handleEntityNotFound(_0x5cf413,null))[_0xb201('0x14')](function(_0x4669f5){if(_0x4669f5[_0xb201('0x31')]==='MicrosoftAzure'){var _0x19e62d=encryptor[_0xb201('0x3a')](_0x4669f5[_0xb201('0x33')]);_0x4669f5[_0xb201('0x33')]=maskClientSecret(_0x19e62d);}return _0x4669f5;})['then'](respondWithResult(_0x5cf413,null))[_0xb201('0x3b')](handleError(_0x5cf413,null));};exports[_0xb201('0x3c')]=function(_0x215a02,_0x4c7aef){if(!_0x215a02[_0xb201('0x3d')][_0xb201('0x1f')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x215a02[_0xb201('0x3d')][_0xb201('0x31')])throw new Error(_0xb201('0x3e'));var _0x4cdcf3=db[_0xb201('0x1b')][_0xb201('0x35')][_0xb201('0x31')][_0xb201('0x3f')];if(!_0x4cdcf3[_0xb201('0x40')](_0x215a02[_0xb201('0x3d')][_0xb201('0x31')]))throw new Error(_0xb201('0x41')+_0x4cdcf3[_0xb201('0x42')](',\x20'));if(_0x215a02['body']['service']===_0xb201('0x32')&&_0x215a02[_0xb201('0x3d')][_0xb201('0x33')]){_0x215a02[_0xb201('0x3d')]['data3']=encryptor['encryptString'](_0x215a02['body']['data3']);}return db['CloudProvider'][_0xb201('0x3c')](_0x215a02[_0xb201('0x3d')],{})[_0xb201('0x14')](respondWithResult(_0x4c7aef,0xc9))[_0xb201('0x3b')](handleError(_0x4c7aef,null));};exports['update']=function(_0x2e1f42,_0x2644d6){if(_0x2e1f42[_0xb201('0x3d')]['id']){delete _0x2e1f42[_0xb201('0x3d')]['id'];}return db['CloudProvider'][_0xb201('0x39')]({'where':{'id':_0x2e1f42[_0xb201('0x43')]['id']}})[_0xb201('0x14')](handleEntityNotFound(_0x2644d6,null))[_0xb201('0x14')](function(_0x2a9dc2){if(_0x2a9dc2[_0xb201('0x31')]===_0xb201('0x32')&&_0x2e1f42['body'][_0xb201('0x33')]){_0x2e1f42[_0xb201('0x3d')]['data3']=encryptor[_0xb201('0x44')](_0x2e1f42[_0xb201('0x3d')][_0xb201('0x33')]);}return _0x2a9dc2;})[_0xb201('0x14')](saveUpdates(_0x2e1f42[_0xb201('0x3d')],null))[_0xb201('0x14')](respondWithResult(_0x2644d6,null))[_0xb201('0x3b')](handleError(_0x2644d6,null));};exports[_0xb201('0x45')]=function(_0x280fa4,_0x1c8eff){return db[_0xb201('0x1b')][_0xb201('0x39')]({'where':{'id':_0x280fa4['params']['id']}})[_0xb201('0x14')](handleEntityNotFound(_0x1c8eff,null))[_0xb201('0x14')](removeEntity(_0x1c8eff,null))[_0xb201('0x3b')](handleError(_0x1c8eff,null));};exports[_0xb201('0x46')]=function(_0x4bd5a0,_0x7684c5){return db[_0xb201('0x1b')]['findOne']({'where':{'id':_0x4bd5a0[_0xb201('0x43')]['id']},'raw':!![]})[_0xb201('0x14')](function(_0x594061){if(!_0x594061)return _0x7684c5[_0xb201('0xa')](0x194);return{'url':oauth[_0xb201('0x47')](_0x594061,_0x4bd5a0[_0xb201('0x48')]['id'])};})[_0xb201('0x14')](respondWithResult(_0x7684c5,null))[_0xb201('0x3b')](handleError(_0x7684c5,null));};exports[_0xb201('0x49')]=function(_0x38a099,_0x502265){var _0x472811=_0x38a099[_0xb201('0x3d')];var _0x27ab79;var _0x3d5829;if(_0x472811['error'])throw _0x472811;redis[_0xb201('0x4a')](_0x472811[_0xb201('0x4b')])[_0xb201('0x14')](function(_0x2db7e0){if(!_0x2db7e0)throw new Error(_0xb201('0x4c'));_0x27ab79=JSON[_0xb201('0x4d')](_0x2db7e0);var _0x3ddb28=Buffer[_0xb201('0x4e')](_0x472811[_0xb201('0x4b')],'base64')[_0xb201('0x4f')](_0xb201('0x50'));_0x3d5829=JSON[_0xb201('0x4d')](_0x3ddb28);if(!oauth['isValidIdToken'](_0x472811[_0xb201('0x51')],_0x27ab79[_0xb201('0x52')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0xb201('0x53')](_0x472811[_0xb201('0x4b')]);return oauth[_0xb201('0x54')](_0x472811[_0xb201('0x55')],_0x27ab79);})[_0xb201('0x14')](function(_0x88ddb7){_0x27ab79[_0xb201('0x56')]=_0x88ddb7['access_token'];_0x27ab79['data6']=_0x88ddb7[_0xb201('0x57')];return db[_0xb201('0x1b')]['update']({'data5':_0x27ab79[_0xb201('0x56')],'data6':_0x27ab79['data6']},{'where':{'id':_0x27ab79['id']}});})[_0xb201('0x14')](function(){oauth[_0xb201('0x58')](_0x27ab79);socket['emit']('microsoftAuthorization:success',{'id':_0x3d5829['id']});return;})[_0xb201('0x14')](respondWithStatusCode(_0x502265,null))[_0xb201('0x3b')](function(_0x10f25d){if(_0x3d5829){socket[_0xb201('0x59')]('microsoftAuthorization:error',{'id':_0x3d5829['id']});}if(!_0x27ab79){logger[_0xb201('0x15')](_0xb201('0x5a'),_0x10f25d);return _0x502265['status'](0x1f4)[_0xb201('0x17')](_0x10f25d['message']);}logger[_0xb201('0x15')](_0xb201('0x5b'),_0x27ab79['id'],JSON['stringify'](_0x10f25d));});}; \ No newline at end of file +var _0x58ff=['params','keys','CloudProvider','find','create','body','values','includes','join','encryptString','update','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','access_token','data6','refresh_token','data5','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','stringify','lodash','ioredis','../../components/encryptor','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','then','destroy','error','stack','name','index','map','rawAttributes','key','filters','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x58ff,0x81));var _0xf58f=function(_0x5b446f,_0x1e7e46){_0x5b446f=_0x5b446f-0x0;var _0x20c754=_0x58ff[_0x5b446f];return _0x20c754;};'use strict';var _=require(_0xf58f('0x0'));var Redis=require(_0xf58f('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0xf58f('0x2'));var config=require('../../config/environment');var logger=require(_0xf58f('0x3'))(_0xf58f('0x4'));var db=require(_0xf58f('0x5'))['db'];var oauth=require(_0xf58f('0x6'));config[_0xf58f('0x7')]=_[_0xf58f('0x8')](config[_0xf58f('0x7')],{'host':_0xf58f('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf58f('0x7')]));var redis=new Redis(config[_0xf58f('0x7')]);function respondWithStatusCode(_0x4b4020,_0x37d8af){_0x37d8af=_0x37d8af||0xcc;return function(_0xa5443f){if(_0xa5443f){return _0x4b4020[_0xf58f('0xa')](_0x37d8af);}return _0x4b4020[_0xf58f('0xb')](_0x37d8af)[_0xf58f('0xc')]();};}function respondWithResult(_0x15cdae,_0xbc421c){_0xbc421c=_0xbc421c||0xc8;return function(_0x38e407){if(_0x38e407){return _0x15cdae[_0xf58f('0xb')](_0xbc421c)[_0xf58f('0xd')](_0x38e407);}};}function respondWithFilteredResult(_0xdd6dcb,_0x5a2889){return function(_0x197f11){if(_0x197f11){var _0x2e7e2b=typeof _0x5a2889[_0xf58f('0xe')]===_0xf58f('0xf')&&typeof _0x5a2889[_0xf58f('0x10')]===_0xf58f('0xf');var _0x17fbb6=_0x197f11['count'];var _0x2944b2=_0x2e7e2b?0x0:_0x5a2889[_0xf58f('0xe')];var _0x5dd93b=_0x2e7e2b?_0x197f11[_0xf58f('0x11')]:_0x5a2889[_0xf58f('0xe')]+_0x5a2889['limit'];var _0x15db88;if(_0x5dd93b>=_0x17fbb6){_0x5dd93b=_0x17fbb6;_0x15db88=0xc8;}else{_0x15db88=0xce;}_0xdd6dcb['status'](_0x15db88);return _0xdd6dcb['set'](_0xf58f('0x12'),_0x2944b2+'-'+_0x5dd93b+'/'+_0x17fbb6)[_0xf58f('0xd')](_0x197f11);}return null;};}function saveUpdates(_0x2d90a8){return function(_0x5244be){if(_0x5244be){return _0x5244be['update'](_0x2d90a8)[_0xf58f('0x13')](function(_0x3af39f){return _0x3af39f;});}return null;};}function removeEntity(_0x140b83){return function(_0x2de73b){if(_0x2de73b){return _0x2de73b[_0xf58f('0x14')]()[_0xf58f('0x13')](function(){_0x140b83[_0xf58f('0xb')](0xcc)[_0xf58f('0xc')]();});}};}function handleEntityNotFound(_0x2b9738){return function(_0x20eeee){if(!_0x20eeee){_0x2b9738[_0xf58f('0xa')](0x194);}return _0x20eeee;};}function handleError(_0x574871,_0x553a2d){_0x553a2d=_0x553a2d||0x1f4;return function(_0x1afaaf){logger[_0xf58f('0x15')](_0x1afaaf[_0xf58f('0x16')]);if(_0x1afaaf['name']){delete _0x1afaaf[_0xf58f('0x17')];}_0x574871[_0xf58f('0xb')](_0x553a2d)['send'](_0x1afaaf);};}function maskClientSecret(_0x19c828){return _['padEnd'](_0x19c828['slice'](0x0,0x3),0x14,'*');}exports[_0xf58f('0x18')]=function(_0x1b8bc9,_0x112b3c){var _0x598445={},_0x2775c9={},_0x1007d8={'count':0x0,'rows':[]};var _0x4611dd=_[_0xf58f('0x19')](db['CloudProvider'][_0xf58f('0x1a')],function(_0xaacc60){return{'name':_0xaacc60['fieldName'],'type':_0xaacc60['type'][_0xf58f('0x1b')]};});_0x2775c9['model']=_['map'](_0x4611dd,_0xf58f('0x17'));_0x2775c9['query']=_['keys'](_0x1b8bc9['query']);_0x2775c9[_0xf58f('0x1c')]=_[_0xf58f('0x1d')](_0x2775c9[_0xf58f('0x1e')],_0x2775c9[_0xf58f('0x1f')]);_0x598445[_0xf58f('0x20')]=_[_0xf58f('0x1d')](_0x2775c9['model'],qs['fields'](_0x1b8bc9[_0xf58f('0x1f')][_0xf58f('0x21')]));_0x598445[_0xf58f('0x20')]=_0x598445[_0xf58f('0x20')]['length']?_0x598445['attributes']:_0x2775c9[_0xf58f('0x1e')];if(!_0x1b8bc9[_0xf58f('0x1f')][_0xf58f('0x22')](_0xf58f('0x23'))){_0x598445[_0xf58f('0x10')]=qs[_0xf58f('0x10')](_0x1b8bc9[_0xf58f('0x1f')]['limit']);_0x598445['offset']=qs[_0xf58f('0xe')](_0x1b8bc9['query'][_0xf58f('0xe')]);}_0x598445[_0xf58f('0x24')]=qs[_0xf58f('0x25')](_0x1b8bc9[_0xf58f('0x1f')][_0xf58f('0x25')]);_0x598445[_0xf58f('0x26')]=qs[_0xf58f('0x1c')](_[_0xf58f('0x27')](_0x1b8bc9[_0xf58f('0x1f')],_0x2775c9['filters']),_0x4611dd);if(_0x1b8bc9[_0xf58f('0x1f')]['filter']){_0x598445['where']=_['merge'](_0x598445[_0xf58f('0x26')],{'$or':_[_0xf58f('0x19')](_0x4611dd,function(_0x399955){if(_0x399955['type']!==_0xf58f('0x28')){var _0x449c6b={};_0x449c6b[_0x399955['name']]={'$like':'%'+_0x1b8bc9['query'][_0xf58f('0x29')]+'%'};return _0x449c6b;}})});}_0x598445=_[_0xf58f('0x2a')]({},_0x598445,_0x1b8bc9[_0xf58f('0x2b')]);var _0x24caf6={'where':_0x598445['where']};return db['CloudProvider']['count'](_0x24caf6)[_0xf58f('0x13')](function(_0x25045d){_0x1007d8[_0xf58f('0x11')]=_0x25045d;if(_0x1b8bc9['query'][_0xf58f('0x2c')]){_0x598445[_0xf58f('0x2d')]=[{'all':!![]}];}return db['CloudProvider'][_0xf58f('0x2e')](_0x598445);})[_0xf58f('0x13')](function(_0x549e0f){_0x1007d8[_0xf58f('0x2f')]=_[_0xf58f('0x19')](_0x549e0f,function(_0x2f03e1){if(_0x2f03e1[_0xf58f('0x30')]===_0xf58f('0x31')){var _0x2133f4=encryptor[_0xf58f('0x32')](_0x2f03e1[_0xf58f('0x33')]);_0x2f03e1[_0xf58f('0x33')]=maskClientSecret(_0x2133f4);}return _0x2f03e1;});return _0x1007d8;})[_0xf58f('0x13')](respondWithFilteredResult(_0x112b3c,_0x598445))[_0xf58f('0x34')](handleError(_0x112b3c,null));};exports['show']=function(_0x56c1d6,_0x4b1c0a){var _0x33307d={'raw':!![],'where':{'id':_0x56c1d6[_0xf58f('0x35')]['id']}},_0x2daf0c={};_0x2daf0c[_0xf58f('0x1e')]=_[_0xf58f('0x36')](db[_0xf58f('0x37')][_0xf58f('0x1a')]);_0x2daf0c[_0xf58f('0x1f')]=_['keys'](_0x56c1d6[_0xf58f('0x1f')]);_0x2daf0c['filters']=_['intersection'](_0x2daf0c[_0xf58f('0x1e')],_0x2daf0c[_0xf58f('0x1f')]);_0x33307d[_0xf58f('0x20')]=_['intersection'](_0x2daf0c['model'],qs[_0xf58f('0x21')](_0x56c1d6[_0xf58f('0x1f')][_0xf58f('0x21')]));_0x33307d[_0xf58f('0x20')]=_0x33307d[_0xf58f('0x20')]['length']?_0x33307d[_0xf58f('0x20')]:_0x2daf0c['model'];if(_0x56c1d6[_0xf58f('0x1f')]['includeAll']){_0x33307d[_0xf58f('0x2d')]=[{'all':!![]}];}_0x33307d=_['merge']({},_0x33307d,_0x56c1d6[_0xf58f('0x2b')]);return db['CloudProvider'][_0xf58f('0x38')](_0x33307d)[_0xf58f('0x13')](handleEntityNotFound(_0x4b1c0a,null))[_0xf58f('0x13')](function(_0x54f10f){if(_0x54f10f[_0xf58f('0x30')]===_0xf58f('0x31')){var _0x49dabc=encryptor[_0xf58f('0x32')](_0x54f10f[_0xf58f('0x33')]);_0x54f10f['data3']=maskClientSecret(_0x49dabc);}return _0x54f10f;})['then'](respondWithResult(_0x4b1c0a,null))[_0xf58f('0x34')](handleError(_0x4b1c0a,null));};exports[_0xf58f('0x39')]=function(_0x3f87c6,_0x5a0ebb){if(!_0x3f87c6['body'][_0xf58f('0x17')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x3f87c6[_0xf58f('0x3a')][_0xf58f('0x30')])throw new Error('Service\x20parameter\x20not\x20specified');var _0xaffc3f=db[_0xf58f('0x37')][_0xf58f('0x1a')]['service'][_0xf58f('0x3b')];if(!_0xaffc3f[_0xf58f('0x3c')](_0x3f87c6[_0xf58f('0x3a')]['service']))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0xaffc3f[_0xf58f('0x3d')](',\x20'));if(_0x3f87c6[_0xf58f('0x3a')][_0xf58f('0x30')]===_0xf58f('0x31')&&_0x3f87c6[_0xf58f('0x3a')][_0xf58f('0x33')]){_0x3f87c6[_0xf58f('0x3a')][_0xf58f('0x33')]=encryptor[_0xf58f('0x3e')](_0x3f87c6['body'][_0xf58f('0x33')]);}return db[_0xf58f('0x37')][_0xf58f('0x39')](_0x3f87c6[_0xf58f('0x3a')],{})[_0xf58f('0x13')](respondWithResult(_0x5a0ebb,0xc9))[_0xf58f('0x34')](handleError(_0x5a0ebb,null));};exports[_0xf58f('0x3f')]=function(_0x9820f7,_0x56d31b){if(_0x9820f7[_0xf58f('0x3a')]['id']){delete _0x9820f7[_0xf58f('0x3a')]['id'];}return db[_0xf58f('0x37')][_0xf58f('0x38')]({'where':{'id':_0x9820f7[_0xf58f('0x35')]['id']}})[_0xf58f('0x13')](handleEntityNotFound(_0x56d31b,null))[_0xf58f('0x13')](function(_0x8ddfc6){if(_0x8ddfc6[_0xf58f('0x30')]===_0xf58f('0x31')&&_0x9820f7[_0xf58f('0x3a')]['data3']){_0x9820f7[_0xf58f('0x3a')][_0xf58f('0x33')]=encryptor[_0xf58f('0x3e')](_0x9820f7[_0xf58f('0x3a')]['data3']);}return _0x8ddfc6;})['then'](saveUpdates(_0x9820f7[_0xf58f('0x3a')],null))[_0xf58f('0x13')](respondWithResult(_0x56d31b,null))[_0xf58f('0x34')](handleError(_0x56d31b,null));};exports[_0xf58f('0x14')]=function(_0x180821,_0x11da48){return db['CloudProvider'][_0xf58f('0x38')]({'where':{'id':_0x180821[_0xf58f('0x35')]['id']}})[_0xf58f('0x13')](handleEntityNotFound(_0x11da48,null))[_0xf58f('0x13')](removeEntity(_0x11da48,null))[_0xf58f('0x34')](handleError(_0x11da48,null));};exports[_0xf58f('0x40')]=function(_0x46df21,_0x3a03f0){return db['CloudProvider'][_0xf58f('0x41')]({'where':{'id':_0x46df21[_0xf58f('0x35')]['id']},'raw':!![]})['then'](function(_0x278661){if(!_0x278661)return _0x3a03f0[_0xf58f('0xa')](0x194);return{'url':oauth[_0xf58f('0x42')](_0x278661,_0x46df21['user']['id'])};})['then'](respondWithResult(_0x3a03f0,null))['catch'](handleError(_0x3a03f0,null));};exports[_0xf58f('0x43')]=function(_0xb64737,_0x5884fb){var _0x2412f2=_0xb64737[_0xf58f('0x3a')];var _0x30cc38;var _0x3597b2;if(_0x2412f2[_0xf58f('0x15')])throw _0x2412f2;redis[_0xf58f('0x44')](_0x2412f2[_0xf58f('0x45')])['then'](function(_0x44756f){if(!_0x44756f)throw new Error(_0xf58f('0x46'));_0x30cc38=JSON[_0xf58f('0x47')](_0x44756f);var _0xc199a5=Buffer[_0xf58f('0x48')](_0x2412f2['state'],_0xf58f('0x49'))[_0xf58f('0x4a')]('ascii');_0x3597b2=JSON[_0xf58f('0x47')](_0xc199a5);if(!oauth[_0xf58f('0x4b')](_0x2412f2['id_token'],_0x30cc38[_0xf58f('0x4c')]))throw new Error(_0xf58f('0x4d'));redis[_0xf58f('0x4e')](_0x2412f2[_0xf58f('0x45')]);return oauth[_0xf58f('0x4f')](_0x2412f2[_0xf58f('0x50')],_0x30cc38);})[_0xf58f('0x13')](function(_0xcd5a64){_0x30cc38['data5']=_0xcd5a64[_0xf58f('0x51')];_0x30cc38[_0xf58f('0x52')]=_0xcd5a64[_0xf58f('0x53')];return db['CloudProvider']['update']({'data5':_0x30cc38[_0xf58f('0x54')],'data6':_0x30cc38[_0xf58f('0x52')]},{'where':{'id':_0x30cc38['id']}});})[_0xf58f('0x13')](function(){oauth[_0xf58f('0x55')](_0x30cc38);socket[_0xf58f('0x56')](_0xf58f('0x57'),{'id':_0x3597b2['id']});return;})[_0xf58f('0x13')](respondWithStatusCode(_0x5884fb,null))[_0xf58f('0x34')](function(_0xc7ff69){if(_0x3597b2){socket[_0xf58f('0x56')](_0xf58f('0x58'),{'id':_0x3597b2['id']});}if(!_0x30cc38){logger[_0xf58f('0x15')](_0xf58f('0x59'),_0xc7ff69);return _0x5884fb[_0xf58f('0xb')](0x1f4)['send'](_0xc7ff69['message']);}logger['error']('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x30cc38['id'],JSON[_0xf58f('0x5a')](_0xc7ff69));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 9d5d0ff..1f977d2 100644 --- a/server/api/cloudProvider/cloudProvider.model.js +++ b/server/api/cloudProvider/cloudProvider.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6bef=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash'];(function(_0x1186cb,_0x488e8b){var _0x4500b6=function(_0x2629ae){while(--_0x2629ae){_0x1186cb['push'](_0x1186cb['shift']());}};_0x4500b6(++_0x488e8b);}(_0x6bef,0x158));var _0xf6be=function(_0x272307,_0x34935f){_0x272307=_0x272307-0x0;var _0x279aa2=_0x6bef[_0x272307];return _0x279aa2;};'use strict';var _=require(_0xf6be('0x0'));var util=require(_0xf6be('0x1'));var logger=require(_0xf6be('0x2'))(_0xf6be('0x3'));var moment=require(_0xf6be('0x4'));var BPromise=require(_0xf6be('0x5'));var rp=require(_0xf6be('0x6'));var fs=require('fs');var path=require(_0xf6be('0x7'));var rimraf=require(_0xf6be('0x8'));var config=require(_0xf6be('0x9'));var attributes=require(_0xf6be('0xa'));module[_0xf6be('0xb')]=function(_0x10a7a3,_0x3b5540){return _0x10a7a3[_0xf6be('0xc')](_0xf6be('0xd'),attributes,{'tableName':_0xf6be('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9d18=['request-promise','path','../../config/environment','exports','define','CloudProvider','lodash','util','api','moment'];(function(_0x3bcc49,_0xd32f5){var _0x622a6=function(_0x41cfd5){while(--_0x41cfd5){_0x3bcc49['push'](_0x3bcc49['shift']());}};_0x622a6(++_0xd32f5);}(_0x9d18,0x150));var _0x89d1=function(_0x5305dc,_0x3a0acc){_0x5305dc=_0x5305dc-0x0;var _0x47b203=_0x9d18[_0x5305dc];return _0x47b203;};'use strict';var _=require(_0x89d1('0x0'));var util=require(_0x89d1('0x1'));var logger=require('../../config/logger')(_0x89d1('0x2'));var moment=require(_0x89d1('0x3'));var BPromise=require('bluebird');var rp=require(_0x89d1('0x4'));var fs=require('fs');var path=require(_0x89d1('0x5'));var rimraf=require('rimraf');var config=require(_0x89d1('0x6'));var attributes=require('./cloudProvider.attributes');module[_0x89d1('0x7')]=function(_0x13d5a3,_0x28ff5f){return _0x13d5a3[_0x89d1('0x8')](_0x89d1('0x9'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index 4193f4c..902f885 100644 --- a/server/api/cloudProvider/cloudProvider.oauth.js +++ b/server/api/cloudProvider/cloudProvider.oauth.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe4ea=['openid','offline_access','/authorize','/token','map','type','Dynamics365','push','data7','/.default','join','replace','{TENANT_ID}','code','base64','randomBytes','toString','client_id','data1','data4','response_mode','scope','nonce','key','value','oauth2/','set','stringify','decode','issuer','aud','audience','isAfter','unix','exp','then','CloudProvider','data6','decryptString','data2','access_token','refresh_token','data5','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','data3','POST','intervals','findAll','all','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','jsonwebtoken','moment','ioredis','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','redis','defaults','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','https://outlook.office.com/POP.AccessAsUser.All'];(function(_0x584b1a,_0x5b4d87){var _0x1a72aa=function(_0x20d216){while(--_0x20d216){_0x584b1a['push'](_0x584b1a['shift']());}};_0x1a72aa(++_0x5b4d87);}(_0xe4ea,0x14e));var _0xae4e=function(_0x21c43f,_0x188b41){_0x21c43f=_0x21c43f-0x0;var _0x3d146a=_0xe4ea[_0x21c43f];return _0x3d146a;};'use strict';var _=require(_0xae4e('0x0'));var crypto=require('crypto');var jwt=require(_0xae4e('0x1'));var moment=require(_0xae4e('0x2'));var Redis=require(_0xae4e('0x3'));var rp=require('request-promise');var util=require(_0xae4e('0x4'));var encryptor=require(_0xae4e('0x5'));var config=require(_0xae4e('0x6'));var logger=require(_0xae4e('0x7'))(_0xae4e('0x8'));var schedule=require(_0xae4e('0x9'));var db=require('../../mysqldb')['db'];config[_0xae4e('0xa')]=_[_0xae4e('0xb')](config[_0xae4e('0xa')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0xae4e('0xa')]);var MICROSOFT_AUTH_URL=_0xae4e('0xc');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0xae4e('0xd'),_0xae4e('0xe'),'offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All',_0xae4e('0xf'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0xae4e('0x10'),_0xae4e('0x11')]};var MICROSOFT_AUTH_ENDPOINT=_0xae4e('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0xae4e('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x4198d4){var _0x1ba975=_[_0xae4e('0x14')](AZURE_AUTH_SCOPES[_0x4198d4[_0xae4e('0x15')]]);if(_0x4198d4[_0xae4e('0x15')]===_0xae4e('0x16'))_0x1ba975[_0xae4e('0x17')](_0x4198d4[_0xae4e('0x18')]+_0xae4e('0x19'));return _0x1ba975[_0xae4e('0x1a')]('\x20');}function getAccessTokenScope(_0x5620c0){if(_0x5620c0['type']==='Outlook365')return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x5620c0['type']===_0xae4e('0x16'))return _0x5620c0[_0xae4e('0x18')]+_0xae4e('0x19');}function generateMicrosoftAuthorizationUrl(_0x1220a4,_0x4b977f){var _0x21264c=MICROSOFT_AUTH_URL[_0xae4e('0x1b')](_0xae4e('0x1c'),_0x1220a4['data2']);var _0x271138=[_0xae4e('0x1d'),'id_token'];var _0x17cea8=Buffer['from'](JSON['stringify']({'id':_0x4b977f}))['toString'](_0xae4e('0x1e'));var _0x3aaaa7=crypto[_0xae4e('0x1f')](0x10)[_0xae4e('0x20')]('hex');var _0x4ac3c7=getAuthorizationScopes(_0x1220a4);var _0x5b90c1=[{'key':_0xae4e('0x21'),'value':_0x1220a4[_0xae4e('0x22')]},{'key':'response_type','value':encodeURIComponent(_0x271138['join']('\x20'))},{'key':'redirect_uri','value':_0x1220a4[_0xae4e('0x23')]},{'key':_0xae4e('0x24'),'value':'form_post'},{'key':_0xae4e('0x25'),'value':encodeURIComponent(_0x4ac3c7)},{'key':'state','value':_0x17cea8},{'key':_0xae4e('0x26'),'value':_0x3aaaa7},{'key':'prompt','value':'login'}];var _0x5bcfe6=_0x21264c+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xae4e('0x14')](_0x5b90c1,function(_0x3a6ee3){return _0x3a6ee3[_0xae4e('0x27')]+'='+_0x3a6ee3[_0xae4e('0x28')];})[_0xae4e('0x1a')]('&');_0x1220a4['oauth2Claims']={'issuer':_0x21264c[_0xae4e('0x1b')](_0xae4e('0x29'),''),'audience':_0x1220a4[_0xae4e('0x22')],'state':_0x17cea8,'nonce':_0x3aaaa7};redis[_0xae4e('0x2a')](_0x17cea8,JSON[_0xae4e('0x2b')](_0x1220a4));return _0x5bcfe6;}function isValidIdToken(_0x2a1357,_0x309821){try{var _0x1483c2=jwt[_0xae4e('0x2c')](_0x2a1357,{'complete':!![]});var _0x5b0504=_0x1483c2['payload'];if(_0x5b0504['iss']!==_0x309821[_0xae4e('0x2d')])return![];if(_0x5b0504[_0xae4e('0x2e')]!==_0x309821[_0xae4e('0x2f')])return![];if(_0x5b0504[_0xae4e('0x26')]!==_0x309821[_0xae4e('0x26')])return![];if(moment()[_0xae4e('0x30')](moment[_0xae4e('0x31')](_0x5b0504[_0xae4e('0x32')])))return![];return!![];}catch(_0xa67abb){throw _0xa67abb;}}function refreshOauth2MicrosoftAccessToken(_0x4d1f45){return Promise['resolve']()[_0xae4e('0x33')](function(){if(_0x4d1f45['data3'])return _0x4d1f45;return db[_0xae4e('0x34')]['findOne']({'where':{'id':_0x4d1f45['id']},'raw':!![]});})['then'](function(_0x56f646){var _0x32b83b={'grant_type':'refresh_token','refresh_token':_0x56f646[_0xae4e('0x35')],'scope':getAccessTokenScope(_0x56f646),'redirect_uri':_0x56f646[_0xae4e('0x23')],'client_id':_0x56f646[_0xae4e('0x22')],'client_secret':encryptor[_0xae4e('0x36')](_0x56f646['data3'])};var _0x3e721d={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xae4e('0x1b')](_0xae4e('0x1c'),_0x56f646[_0xae4e('0x37')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x32b83b,'json':!![]};return rp(_0x3e721d);})[_0xae4e('0x33')](function(_0x1c1287){_0x4d1f45['data5']=_0x1c1287[_0xae4e('0x38')];_0x4d1f45[_0xae4e('0x35')]=_0x1c1287[_0xae4e('0x39')];return db[_0xae4e('0x34')]['update']({'data5':_0x4d1f45[_0xae4e('0x3a')],'data6':_0x4d1f45['data6']},{'where':{'id':_0x4d1f45['id']}});})[_0xae4e('0x33')](function(){return _0x4d1f45;})[_0xae4e('0x3b')](function(_0x585099){logger[_0xae4e('0x3c')](_0xae4e('0x3d'),_0x4d1f45['id'],_0x585099);});}function getOauth2MicrosoftAccessToken(_0x289181,_0x2dc51f){var _0x4f9588={'grant_type':_0xae4e('0x3e'),'code':_0x289181,'scope':getAccessTokenScope(_0x2dc51f),'redirect_uri':_0x2dc51f[_0xae4e('0x23')],'client_id':_0x2dc51f[_0xae4e('0x22')],'client_secret':encryptor[_0xae4e('0x36')](_0x2dc51f[_0xae4e('0x3f')])};var _0x3e873f={'method':_0xae4e('0x40'),'uri':MICROSOFT_AUTH_URL[_0xae4e('0x1b')](_0xae4e('0x1c'),_0x2dc51f[_0xae4e('0x37')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4f9588,'json':!![]};return rp(_0x3e873f);}function startRefreshInterval(_0x5a8ff0){var _0x3d77a8=schedule[_0xae4e('0x41')];if(_0x3d77a8[_0x5a8ff0['id']])clearInterval(_0x3d77a8[_0x5a8ff0['id']]);_0x3d77a8[_0x5a8ff0['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x5a8ff0['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xae4e('0x41')]=_0x3d77a8;}function startAllRefreshIntervals(){return db['CloudProvider'][_0xae4e('0x42')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xae4e('0x33')](function(_0x4d27e4){var _0x4e3a24=_0x4d27e4['map'](function(_0x316afa){return refreshOauth2MicrosoftAccessToken(_0x316afa)['then'](function(_0x18ee79){startRefreshInterval(_0x18ee79);});});return Promise[_0xae4e('0x43')](_0x4e3a24);})[_0xae4e('0x3b')](function(_0x3ea1ab){var _0x5a3bed=_0x3ea1ab?util['inspect'](_0x3ea1ab,{'showHidden':![],'depth':null}):'';logger[_0xae4e('0x3c')](_0xae4e('0x44'),_0x5a3bed);});}module[_0xae4e('0x45')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0xd147=['randomBytes','hex','client_id','data1','response_type','data4','response_mode','state','nonce','prompt','key','value','oauth2Claims','oauth2/','set','decode','payload','iss','issuer','aud','audience','exp','resolve','then','data3','CloudProvider','findOne','POST','refresh_token','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','decryptString','{TENANT_ID}','intervals','findAll','all','inspect','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','redis','localhost','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','map','type','Dynamics365','push','data7','/.default','join','Outlook365','replace','data2','stringify','toString'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd147,0x1d1));var _0x7d14=function(_0x20b770,_0x2c2fbb){_0x20b770=_0x20b770-0x0;var _0x4460ff=_0xd147[_0x20b770];return _0x4460ff;};'use strict';var _=require('lodash');var crypto=require(_0x7d14('0x0'));var jwt=require(_0x7d14('0x1'));var moment=require(_0x7d14('0x2'));var Redis=require(_0x7d14('0x3'));var rp=require(_0x7d14('0x4'));var util=require(_0x7d14('0x5'));var encryptor=require(_0x7d14('0x6'));var config=require('../../config/environment');var logger=require(_0x7d14('0x7'))('api');var schedule=require(_0x7d14('0x8'));var db=require(_0x7d14('0x9'))['db'];config[_0x7d14('0xa')]=_['defaults'](config[_0x7d14('0xa')],{'host':_0x7d14('0xb'),'port':0x18eb});var redis=new Redis(config[_0x7d14('0xa')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x7d14('0xc'),_0x7d14('0xd'),_0x7d14('0xe'),_0x7d14('0xf'),_0x7d14('0x10'),_0x7d14('0x11'),_0x7d14('0x12')],'Dynamics365':[_0x7d14('0xc'),_0x7d14('0xf')]};var MICROSOFT_AUTH_ENDPOINT=_0x7d14('0x13');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x30f204){var _0x3c3390=_[_0x7d14('0x14')](AZURE_AUTH_SCOPES[_0x30f204[_0x7d14('0x15')]]);if(_0x30f204['type']===_0x7d14('0x16'))_0x3c3390[_0x7d14('0x17')](_0x30f204[_0x7d14('0x18')]+_0x7d14('0x19'));return _0x3c3390[_0x7d14('0x1a')]('\x20');}function getAccessTokenScope(_0x2c31f9){if(_0x2c31f9['type']===_0x7d14('0x1b'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x2c31f9[_0x7d14('0x15')]==='Dynamics365')return _0x2c31f9[_0x7d14('0x18')]+_0x7d14('0x19');}function generateMicrosoftAuthorizationUrl(_0x278c25,_0x68be57){var _0x43ff89=MICROSOFT_AUTH_URL[_0x7d14('0x1c')]('{TENANT_ID}',_0x278c25[_0x7d14('0x1d')]);var _0x29e6ed=['code','id_token'];var _0x526b1c=Buffer['from'](JSON[_0x7d14('0x1e')]({'id':_0x68be57}))[_0x7d14('0x1f')]('base64');var _0x5523ed=crypto[_0x7d14('0x20')](0x10)[_0x7d14('0x1f')](_0x7d14('0x21'));var _0x257680=getAuthorizationScopes(_0x278c25);var _0x535ef3=[{'key':_0x7d14('0x22'),'value':_0x278c25[_0x7d14('0x23')]},{'key':_0x7d14('0x24'),'value':encodeURIComponent(_0x29e6ed[_0x7d14('0x1a')]('\x20'))},{'key':'redirect_uri','value':_0x278c25[_0x7d14('0x25')]},{'key':_0x7d14('0x26'),'value':'form_post'},{'key':'scope','value':encodeURIComponent(_0x257680)},{'key':_0x7d14('0x27'),'value':_0x526b1c},{'key':_0x7d14('0x28'),'value':_0x5523ed},{'key':_0x7d14('0x29'),'value':'login'}];var _0x35af6f=_0x43ff89+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x535ef3,function(_0x26a6e6){return _0x26a6e6[_0x7d14('0x2a')]+'='+_0x26a6e6[_0x7d14('0x2b')];})[_0x7d14('0x1a')]('&');_0x278c25[_0x7d14('0x2c')]={'issuer':_0x43ff89[_0x7d14('0x1c')](_0x7d14('0x2d'),''),'audience':_0x278c25[_0x7d14('0x23')],'state':_0x526b1c,'nonce':_0x5523ed};redis[_0x7d14('0x2e')](_0x526b1c,JSON[_0x7d14('0x1e')](_0x278c25));return _0x35af6f;}function isValidIdToken(_0x3c38f7,_0x5969b1){try{var _0x380f24=jwt[_0x7d14('0x2f')](_0x3c38f7,{'complete':!![]});var _0xb8241c=_0x380f24[_0x7d14('0x30')];if(_0xb8241c[_0x7d14('0x31')]!==_0x5969b1[_0x7d14('0x32')])return![];if(_0xb8241c[_0x7d14('0x33')]!==_0x5969b1[_0x7d14('0x34')])return![];if(_0xb8241c[_0x7d14('0x28')]!==_0x5969b1[_0x7d14('0x28')])return![];if(moment()['isAfter'](moment['unix'](_0xb8241c[_0x7d14('0x35')])))return![];return!![];}catch(_0xb0658f){throw _0xb0658f;}}function refreshOauth2MicrosoftAccessToken(_0x3e2fa5){return Promise[_0x7d14('0x36')]()[_0x7d14('0x37')](function(){if(_0x3e2fa5[_0x7d14('0x38')])return _0x3e2fa5;return db[_0x7d14('0x39')][_0x7d14('0x3a')]({'where':{'id':_0x3e2fa5['id']},'raw':!![]});})[_0x7d14('0x37')](function(_0x1b5790){var _0x2b3cd9={'grant_type':'refresh_token','refresh_token':_0x1b5790['data6'],'scope':getAccessTokenScope(_0x1b5790),'redirect_uri':_0x1b5790['data4'],'client_id':_0x1b5790[_0x7d14('0x23')],'client_secret':encryptor['decryptString'](_0x1b5790['data3'])};var _0x257d05={'method':_0x7d14('0x3b'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x1b5790['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2b3cd9,'json':!![]};return rp(_0x257d05);})['then'](function(_0x5113cd){_0x3e2fa5['data5']=_0x5113cd['access_token'];_0x3e2fa5['data6']=_0x5113cd[_0x7d14('0x3c')];return db[_0x7d14('0x39')]['update']({'data5':_0x3e2fa5['data5'],'data6':_0x3e2fa5['data6']},{'where':{'id':_0x3e2fa5['id']}});})['then'](function(){return _0x3e2fa5;})[_0x7d14('0x3d')](function(_0x20e65c){logger[_0x7d14('0x3e')](_0x7d14('0x3f'),_0x3e2fa5['id'],_0x20e65c);});}function getOauth2MicrosoftAccessToken(_0x39bab7,_0x3b7b3a){var _0x48039c={'grant_type':_0x7d14('0x40'),'code':_0x39bab7,'scope':getAccessTokenScope(_0x3b7b3a),'redirect_uri':_0x3b7b3a['data4'],'client_id':_0x3b7b3a[_0x7d14('0x23')],'client_secret':encryptor[_0x7d14('0x41')](_0x3b7b3a[_0x7d14('0x38')])};var _0x68c183={'method':_0x7d14('0x3b'),'uri':MICROSOFT_AUTH_URL[_0x7d14('0x1c')](_0x7d14('0x42'),_0x3b7b3a[_0x7d14('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x48039c,'json':!![]};return rp(_0x68c183);}function startRefreshInterval(_0xc2a214){var _0x12b8b3=schedule[_0x7d14('0x43')];if(_0x12b8b3[_0xc2a214['id']])clearInterval(_0x12b8b3[_0xc2a214['id']]);_0x12b8b3[_0xc2a214['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0xc2a214['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x12b8b3;}function startAllRefreshIntervals(){return db[_0x7d14('0x39')][_0x7d14('0x44')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x7d14('0x37')](function(_0x2021d6){var _0x12d9a6=_0x2021d6[_0x7d14('0x14')](function(_0x25a190){return refreshOauth2MicrosoftAccessToken(_0x25a190)['then'](function(_0x54a622){startRefreshInterval(_0x54a622);});});return Promise[_0x7d14('0x45')](_0x12d9a6);})[_0x7d14('0x3d')](function(_0x3fac06){var _0x3a2b04=_0x3fac06?util[_0x7d14('0x46')](_0x3fac06,{'showHidden':![],'depth':null}):'';logger[_0x7d14('0x3e')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x3a2b04);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 2748c45..3f89940 100644 --- a/server/api/cloudProvider/cloudProvider.rpc.js +++ b/server/api/cloudProvider/cloudProvider.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2015=['client','http','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x5c8fc7,_0x571e82){var _0x389dfc=function(_0x830e4b){while(--_0x830e4b){_0x5c8fc7['push'](_0x5c8fc7['shift']());}};_0x389dfc(++_0x571e82);}(_0x2015,0x193));var _0x5201=function(_0x358a1c,_0x2434d4){_0x358a1c=_0x358a1c-0x0;var _0x12e845=_0x2015[_0x358a1c];return _0x12e845;};'use strict';var _=require(_0x5201('0x0'));var util=require(_0x5201('0x1'));var moment=require(_0x5201('0x2'));var BPromise=require(_0x5201('0x3'));var rs=require(_0x5201('0x4'));var fs=require('fs');var Redis=require(_0x5201('0x5'));var db=require(_0x5201('0x6'))['db'];var utils=require(_0x5201('0x7'));var logger=require('../../config/logger')(_0x5201('0x8'));var config=require(_0x5201('0x9'));var jayson=require(_0x5201('0xa'));var client=jayson[_0x5201('0xb')][_0x5201('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x11ce7b,_0x334b42,_0x374d23){return new BPromise(function(_0x15367c,_0x6fc2c3){return client['request'](_0x11ce7b,_0x374d23)[_0x5201('0xd')](function(_0x17d8f3){logger['info'](_0x5201('0xe'),_0x334b42,_0x5201('0xf'));logger[_0x5201('0x10')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x334b42,_0x5201('0xf'),JSON[_0x5201('0x11')](_0x17d8f3));if(_0x17d8f3[_0x5201('0x12')]){if(_0x17d8f3[_0x5201('0x12')][_0x5201('0x13')]===0x1f4){logger[_0x5201('0x12')](_0x5201('0xe'),_0x334b42,_0x17d8f3[_0x5201('0x12')][_0x5201('0x14')]);return _0x6fc2c3(_0x17d8f3[_0x5201('0x12')][_0x5201('0x14')]);}logger[_0x5201('0x12')]('CloudProvider,\x20%s,\x20%s',_0x334b42,_0x17d8f3[_0x5201('0x12')][_0x5201('0x14')]);return _0x15367c(_0x17d8f3['error']['message']);}else{logger[_0x5201('0x15')](_0x5201('0xe'),_0x334b42,_0x5201('0xf'));_0x15367c(_0x17d8f3['result']['message']);}})[_0x5201('0x16')](function(_0x582210){logger[_0x5201('0x12')]('CloudProvider,\x20%s,\x20%s',_0x334b42,_0x582210);_0x6fc2c3(_0x582210);});});} \ No newline at end of file +var _0xf3e2=['rpc','jayson/promise','client','http','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xf3e2,0x168));var _0x2f3e=function(_0x2f3aa7,_0x2d7ce7){_0x2f3aa7=_0x2f3aa7-0x0;var _0x2c334c=_0xf3e2[_0x2f3aa7];return _0x2c334c;};'use strict';var _=require(_0x2f3e('0x0'));var util=require(_0x2f3e('0x1'));var moment=require(_0x2f3e('0x2'));var BPromise=require(_0x2f3e('0x3'));var rs=require(_0x2f3e('0x4'));var fs=require('fs');var Redis=require(_0x2f3e('0x5'));var db=require(_0x2f3e('0x6'))['db'];var utils=require(_0x2f3e('0x7'));var logger=require('../../config/logger')(_0x2f3e('0x8'));var config=require('../../config/environment');var jayson=require(_0x2f3e('0x9'));var client=jayson[_0x2f3e('0xa')][_0x2f3e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x392f91,_0x3b556b,_0x1ac142){return new BPromise(function(_0x30f939,_0x46ec1b){return client['request'](_0x392f91,_0x1ac142)[_0x2f3e('0xc')](function(_0x4d7f7d){logger[_0x2f3e('0xd')](_0x2f3e('0xe'),_0x3b556b,_0x2f3e('0xf'));logger[_0x2f3e('0x10')](_0x2f3e('0x11'),_0x3b556b,_0x2f3e('0xf'),JSON[_0x2f3e('0x12')](_0x4d7f7d));if(_0x4d7f7d[_0x2f3e('0x13')]){if(_0x4d7f7d[_0x2f3e('0x13')][_0x2f3e('0x14')]===0x1f4){logger[_0x2f3e('0x13')](_0x2f3e('0xe'),_0x3b556b,_0x4d7f7d['error'][_0x2f3e('0x15')]);return _0x46ec1b(_0x4d7f7d['error'][_0x2f3e('0x15')]);}logger[_0x2f3e('0x13')]('CloudProvider,\x20%s,\x20%s',_0x3b556b,_0x4d7f7d['error'][_0x2f3e('0x15')]);return _0x30f939(_0x4d7f7d[_0x2f3e('0x13')][_0x2f3e('0x15')]);}else{logger[_0x2f3e('0xd')](_0x2f3e('0xe'),_0x3b556b,_0x2f3e('0xf'));_0x30f939(_0x4d7f7d['result'][_0x2f3e('0x15')]);}})[_0x2f3e('0x16')](function(_0x15398d){logger[_0x2f3e('0x13')]('CloudProvider,\x20%s,\x20%s',_0x3b556b,_0x15398d);_0x46ec1b(_0x15398d);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 2ec8df6..21a043d 100644 --- a/server/api/cloudProvider/index.js +++ b/server/api/cloudProvider/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x4b2716,_0x50e907){var _0x58ef2f=function(_0x3c15de){while(--_0x3c15de){_0x4b2716['push'](_0x4b2716['shift']());}};_0x58ef2f(++_0x50e907);}(_0x2ef3,0xba));var _0x32ef=function(_0x9cf372,_0x20736a){_0x9cf372=_0x9cf372-0x0;var _0xd46b2b=_0x2ef3[_0x9cf372];return _0xd46b2b;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router; \ No newline at end of file +var _0xdb28=['delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','oauth2MicrosoftCallback','express','Router','../../components/auth/service','./cloudProvider.controller','isAuthenticated','index','get','/:id','post','update'];(function(_0x5d0273,_0x3fbc92){var _0x461cff=function(_0x571f80){while(--_0x571f80){_0x5d0273['push'](_0x5d0273['shift']());}};_0x461cff(++_0x3fbc92);}(_0xdb28,0x106));var _0x8db2=function(_0x22beff,_0x340efb){_0x22beff=_0x22beff-0x0;var _0x40f153=_0xdb28[_0x22beff];return _0x40f153;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['get']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);router[_0x8db2('0x6')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller['show']);router[_0x8db2('0x8')]('/',auth[_0x8db2('0x4')](),controller['create']);router['put'](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0x9')]);router[_0x8db2('0xa')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xb')]);router['get'](_0x8db2('0xc'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xd')]);router['post'](_0x8db2('0xe'),controller[_0x8db2('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 85ca962..384262f 100644 --- a/server/api/cmCompany/cmCompany.attributes.js +++ b/server/api/cmCompany/cmCompany.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd2df=['STRING','name','sequelize','exports'];(function(_0x5a8fad,_0x3feb4f){var _0x2791d8=function(_0x2987c6){while(--_0x2987c6){_0x5a8fad['push'](_0x5a8fad['shift']());}};_0x2791d8(++_0x3feb4f);}(_0xd2df,0x1ea));var _0xfd2d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd2df[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xfd2d('0x0'));module[_0xfd2d('0x1')]={'name':{'type':Sequelize[_0xfd2d('0x2')],'unique':_0xfd2d('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xfd2d('0x2')]},'companyId':{'type':Sequelize[_0xfd2d('0x2')]},'website':{'type':Sequelize[_0xfd2d('0x2')]},'phone':{'type':Sequelize[_0xfd2d('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xfd2d('0x2')]},'street':{'type':Sequelize[_0xfd2d('0x2')]},'postalCode':{'type':Sequelize[_0xfd2d('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xfd2d('0x2')]},'email':{'type':Sequelize[_0xfd2d('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xfd2d('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xfd2d('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xfd2d('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2e61=['exports','STRING','name','sequelize'];(function(_0xee1ec9,_0x2f0599){var _0x102a53=function(_0x4e5f7f){while(--_0x4e5f7f){_0xee1ec9['push'](_0xee1ec9['shift']());}};_0x102a53(++_0x2f0599);}(_0x2e61,0x11b));var _0x12e6=function(_0x2f39fe,_0x2b88e7){_0x2f39fe=_0x2f39fe-0x0;var _0x32bfce=_0x2e61[_0x2f39fe];return _0x32bfce;};'use strict';var Sequelize=require(_0x12e6('0x0'));module[_0x12e6('0x1')]={'name':{'type':Sequelize[_0x12e6('0x2')],'unique':_0x12e6('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x12e6('0x2')]},'companyId':{'type':Sequelize[_0x12e6('0x2')]},'website':{'type':Sequelize[_0x12e6('0x2')]},'phone':{'type':Sequelize[_0x12e6('0x2')]},'fax':{'type':Sequelize[_0x12e6('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x12e6('0x2')]},'postalCode':{'type':Sequelize[_0x12e6('0x2')]},'city':{'type':Sequelize[_0x12e6('0x2')]},'country':{'type':Sequelize[_0x12e6('0x2')]},'email':{'type':Sequelize[_0x12e6('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x12e6('0x2')]},'sStreet':{'type':Sequelize[_0x12e6('0x2')]},'sPostalCode':{'type':Sequelize[_0x12e6('0x2')]},'sCity':{'type':Sequelize[_0x12e6('0x2')]},'sCountry':{'type':Sequelize[_0x12e6('0x2')]},'description':{'type':Sequelize[_0x12e6('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index ce3630b..ec68851 100644 --- a/server/api/cmCompany/cmCompany.controller.js +++ b/server/api/cmCompany/cmCompany.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x29ef=['UserProfileSection','find','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','getContacts','findOne','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','jsforce','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','get','UserProfileResource','sendStatus','stack','name','send','index','CmCompany','describe','model','keys','query','intersection','attributes','fields','nolimit','order','sort','where','pick','filters','filter','merge','map','options','findAll','rows','catch','show','params','rawAttributes','length','includeAll','include','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Companies'];(function(_0xdd0288,_0x548640){var _0x40cf11=function(_0x56bf3f){while(--_0x56bf3f){_0xdd0288['push'](_0xdd0288['shift']());}};_0x40cf11(++_0x548640);}(_0x29ef,0xb4));var _0xf29e=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x29ef[_0x525c7b];return _0x27b33e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf29e('0x0'));var jsonpatch=require(_0xf29e('0x1'));var rp=require(_0xf29e('0x2'));var moment=require(_0xf29e('0x3'));var BPromise=require(_0xf29e('0x4'));var Mustache=require(_0xf29e('0x5'));var util=require(_0xf29e('0x6'));var path=require(_0xf29e('0x7'));var sox=require(_0xf29e('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf29e('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf29e('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xf29e('0xb'));var querystring=require(_0xf29e('0xc'));var Papa=require('papaparse');var Redis=require(_0xf29e('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xf29e('0xe'));var as=require(_0xf29e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf29e('0x10'))(_0xf29e('0x11'));var utils=require(_0xf29e('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf29e('0x13'))['db'];function respondWithStatusCode(_0x249e64,_0x3ee795){_0x3ee795=_0x3ee795||0xcc;return function(_0x5298bf){if(_0x5298bf){return _0x249e64['sendStatus'](_0x3ee795);}return _0x249e64['status'](_0x3ee795)[_0xf29e('0x14')]();};}function respondWithResult(_0x550b17,_0x1ff2f7){_0x1ff2f7=_0x1ff2f7||0xc8;return function(_0x27e1c9){if(_0x27e1c9){return _0x550b17[_0xf29e('0x15')](_0x1ff2f7)['json'](_0x27e1c9);}};}function respondWithFilteredResult(_0x3b90b3,_0x104710){return function(_0x7effb){if(_0x7effb){var _0x282d32=typeof _0x104710[_0xf29e('0x16')]==='undefined'&&typeof _0x104710[_0xf29e('0x17')]===_0xf29e('0x18');var _0x4861a8=_0x7effb[_0xf29e('0x19')];var _0x477006=_0x282d32?0x0:_0x104710[_0xf29e('0x16')];var _0x18b393=_0x282d32?_0x7effb[_0xf29e('0x19')]:_0x104710[_0xf29e('0x16')]+_0x104710[_0xf29e('0x17')];var _0x2bfde9;if(_0x18b393>=_0x4861a8){_0x18b393=_0x4861a8;_0x2bfde9=0xc8;}else{_0x2bfde9=0xce;}_0x3b90b3[_0xf29e('0x15')](_0x2bfde9);return _0x3b90b3[_0xf29e('0x1a')](_0xf29e('0x1b'),_0x477006+'-'+_0x18b393+'/'+_0x4861a8)[_0xf29e('0x1c')](_0x7effb);}return null;};}function patchUpdates(_0x5d07c2){return function(_0x3eafaf){try{jsonpatch[_0xf29e('0x1d')](_0x3eafaf,_0x5d07c2,!![]);}catch(_0x28e94d){return BPromise['reject'](_0x28e94d);}return _0x3eafaf[_0xf29e('0x1e')]();};}function saveUpdates(_0x2c24df,_0x551fcf){return function(_0x5a1b25){if(_0x5a1b25){return _0x5a1b25[_0xf29e('0x1f')](_0x2c24df)[_0xf29e('0x20')](function(_0x502732){return _0x502732;});}return null;};}function removeEntity(_0x2891bc,_0x1d8187){return function(_0x1b1b8c){if(_0x1b1b8c){return _0x1b1b8c[_0xf29e('0x21')]()[_0xf29e('0x20')](function(){var _0x22938d=_0x1b1b8c[_0xf29e('0x22')]({'plain':!![]});var _0x58b573='Companies';return db[_0xf29e('0x23')][_0xf29e('0x21')]({'where':{'type':_0x58b573,'resourceId':_0x22938d['id']}})[_0xf29e('0x20')](function(){return _0x1b1b8c;});})[_0xf29e('0x20')](function(){_0x2891bc[_0xf29e('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22e63e,_0x3d501d){return function(_0x495c5b){if(!_0x495c5b){_0x22e63e[_0xf29e('0x24')](0x194);}return _0x495c5b;};}function handleError(_0x210598,_0x16c441){_0x16c441=_0x16c441||0x1f4;return function(_0x39cc99){logger['error'](_0x39cc99[_0xf29e('0x25')]);if(_0x39cc99[_0xf29e('0x26')]){delete _0x39cc99['name'];}_0x210598[_0xf29e('0x15')](_0x16c441)[_0xf29e('0x27')](_0x39cc99);};}exports[_0xf29e('0x28')]=function(_0x5da270,_0x495885){var _0x509183={},_0x5bc602={},_0x4325c7={'count':0x0,'rows':[]};return db[_0xf29e('0x29')][_0xf29e('0x2a')]()[_0xf29e('0x20')](function(_0x67cb31){_0x5bc602[_0xf29e('0x2b')]=_[_0xf29e('0x2c')](_0x67cb31);_0x5bc602[_0xf29e('0x2d')]=_['keys'](_0x5da270[_0xf29e('0x2d')]);_0x5bc602['filters']=_[_0xf29e('0x2e')](_0x5bc602[_0xf29e('0x2b')],_0x5bc602['query']);_0x509183[_0xf29e('0x2f')]=_[_0xf29e('0x2e')](_0x5bc602[_0xf29e('0x2b')],qs[_0xf29e('0x30')](_0x5da270[_0xf29e('0x2d')]['fields']));_0x509183[_0xf29e('0x2f')]=_0x509183['attributes']['length']?_0x509183[_0xf29e('0x2f')]:_0x5bc602[_0xf29e('0x2b')];if(!_0x5da270[_0xf29e('0x2d')]['hasOwnProperty'](_0xf29e('0x31'))){_0x509183['limit']=qs[_0xf29e('0x17')](_0x5da270['query']['limit']);_0x509183[_0xf29e('0x16')]=qs[_0xf29e('0x16')](_0x5da270[_0xf29e('0x2d')]['offset']);}_0x509183[_0xf29e('0x32')]=qs[_0xf29e('0x33')](_0x5da270[_0xf29e('0x2d')][_0xf29e('0x33')]);_0x509183[_0xf29e('0x34')]=qs['filters'](_[_0xf29e('0x35')](_0x5da270[_0xf29e('0x2d')],_0x5bc602[_0xf29e('0x36')]),_0x67cb31);if(_0x5da270[_0xf29e('0x2d')][_0xf29e('0x37')]){_0x509183[_0xf29e('0x34')]=_[_0xf29e('0x38')](_0x509183[_0xf29e('0x34')],{'$or':_[_0xf29e('0x39')](_0x509183[_0xf29e('0x2f')],function(_0x1c10b9){var _0x3e0932={};_0x3e0932[_0x1c10b9]={'$like':'%'+_0x5da270[_0xf29e('0x2d')]['filter']+'%'};return _0x3e0932;})});}_0x509183=_[_0xf29e('0x38')]({},_0x509183,_0x5da270[_0xf29e('0x3a')]);var _0x5d95d4={'where':_0x509183['where']};return db[_0xf29e('0x29')]['count'](_0x5d95d4)[_0xf29e('0x20')](function(_0xb1c458){_0x4325c7[_0xf29e('0x19')]=_0xb1c458;if(_0x5da270[_0xf29e('0x2d')]['includeAll']){_0x509183['include']=[{'all':!![]}];}return db[_0xf29e('0x29')][_0xf29e('0x3b')](_0x509183);})[_0xf29e('0x20')](function(_0x52e07c){_0x4325c7[_0xf29e('0x3c')]=_0x52e07c;return _0x4325c7;})[_0xf29e('0x20')](respondWithFilteredResult(_0x495885,_0x509183))[_0xf29e('0x3d')](handleError(_0x495885,null));})['catch'](handleError(_0x495885,null));};exports[_0xf29e('0x3e')]=function(_0x289c96,_0x402788){var _0x4a1155={'raw':![],'where':{'id':_0x289c96[_0xf29e('0x3f')]['id']}},_0x3e8053={};_0x3e8053[_0xf29e('0x2b')]=_[_0xf29e('0x2c')](db[_0xf29e('0x29')][_0xf29e('0x40')]);_0x3e8053[_0xf29e('0x2d')]=_['keys'](_0x289c96['query']);_0x3e8053['filters']=_[_0xf29e('0x2e')](_0x3e8053['model'],_0x3e8053[_0xf29e('0x2d')]);_0x4a1155[_0xf29e('0x2f')]=_[_0xf29e('0x2e')](_0x3e8053[_0xf29e('0x2b')],qs[_0xf29e('0x30')](_0x289c96[_0xf29e('0x2d')][_0xf29e('0x30')]));_0x4a1155[_0xf29e('0x2f')]=_0x4a1155[_0xf29e('0x2f')][_0xf29e('0x41')]?_0x4a1155[_0xf29e('0x2f')]:_0x3e8053[_0xf29e('0x2b')];if(_0x289c96[_0xf29e('0x2d')][_0xf29e('0x42')]){_0x4a1155[_0xf29e('0x43')]=[{'all':!![]}];}_0x4a1155=_['merge']({},_0x4a1155,_0x289c96[_0xf29e('0x3a')]);return db['CmCompany']['find'](_0x4a1155)[_0xf29e('0x20')](handleEntityNotFound(_0x402788,null))[_0xf29e('0x20')](respondWithResult(_0x402788,null))[_0xf29e('0x3d')](handleError(_0x402788,null));};exports['create']=function(_0x26bddd,_0x3c2e81){return db['CmCompany']['create'](_0x26bddd[_0xf29e('0x44')],{})[_0xf29e('0x20')](function(_0x1e8351){var _0x2d1f20=_0x26bddd[_0xf29e('0x45')][_0xf29e('0x22')]({'plain':!![]});if(!_0x2d1f20)throw new Error(_0xf29e('0x46'));if(_0x2d1f20['role']===_0xf29e('0x45')){var _0x50e547=_0x1e8351[_0xf29e('0x22')]({'plain':!![]});var _0x266a43=_0xf29e('0x47');return db[_0xf29e('0x48')][_0xf29e('0x49')]({'where':{'name':_0x266a43,'userProfileId':_0x2d1f20[_0xf29e('0x4a')]},'raw':!![]})['then'](function(_0x41ba59){if(_0x41ba59&&_0x41ba59[_0xf29e('0x4b')]===0x0){return db[_0xf29e('0x23')][_0xf29e('0x4c')]({'name':_0x50e547[_0xf29e('0x26')],'resourceId':_0x50e547['id'],'type':_0x41ba59[_0xf29e('0x26')],'sectionId':_0x41ba59['id']},{})[_0xf29e('0x20')](function(){return _0x1e8351;});}else{return _0x1e8351;}})[_0xf29e('0x3d')](function(_0xe541ad){logger['error'](_0xf29e('0x4d'),_0xe541ad);throw _0xe541ad;});}return _0x1e8351;})['then'](respondWithResult(_0x3c2e81,0xc9))[_0xf29e('0x3d')](handleError(_0x3c2e81,null));};exports[_0xf29e('0x1f')]=function(_0x862657,_0x5d115e){if(_0x862657[_0xf29e('0x44')]['id']){delete _0x862657[_0xf29e('0x44')]['id'];}return db[_0xf29e('0x29')][_0xf29e('0x49')]({'where':{'id':_0x862657[_0xf29e('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5d115e,null))[_0xf29e('0x20')](saveUpdates(_0x862657[_0xf29e('0x44')],null))[_0xf29e('0x20')](respondWithResult(_0x5d115e,null))['catch'](handleError(_0x5d115e,null));};exports[_0xf29e('0x21')]=function(_0x4ce492,_0x1a71eb){return db[_0xf29e('0x29')][_0xf29e('0x49')]({'where':{'id':_0x4ce492['params']['id']}})['then'](handleEntityNotFound(_0x1a71eb,null))[_0xf29e('0x20')](removeEntity(_0x1a71eb,null))[_0xf29e('0x3d')](handleError(_0x1a71eb,null));};exports[_0xf29e('0x2a')]=function(_0x2e40f4,_0x53a21c){return db['CmCompany'][_0xf29e('0x2a')]()['then'](respondWithResult(_0x53a21c,null))[_0xf29e('0x3d')](handleError(_0x53a21c,null));};exports[_0xf29e('0x4e')]=function(_0x4f2f42,_0x1d694b,_0x2e74de){return db[_0xf29e('0x4f')][_0xf29e('0x49')]({'where':{'id':_0x4f2f42[_0xf29e('0x3f')]['id']}})[_0xf29e('0x20')](handleEntityNotFound(_0x1d694b,null))['then'](function(_0x3040d2){if(_0x3040d2){return _0x3040d2[_0xf29e('0x4e')](_0x4f2f42[_0xf29e('0x44')][_0xf29e('0x50')],_[_0xf29e('0x51')](_0x4f2f42[_0xf29e('0x44')],['ids','id'])||{});}})[_0xf29e('0x20')](respondWithResult(_0x1d694b,null))[_0xf29e('0x3d')](handleError(_0x1d694b,null));};exports[_0xf29e('0x52')]=function(_0x45cc1e,_0x44ecc1,_0x1ed704){var _0x2789f5={};var _0x368606={};var _0x5e9d9f;var _0x1df646;return db[_0xf29e('0x29')][_0xf29e('0x53')]({'where':{'id':_0x45cc1e[_0xf29e('0x3f')]['id']}})[_0xf29e('0x20')](handleEntityNotFound(_0x44ecc1,null))['then'](function(_0x41aa23){if(_0x41aa23){_0x5e9d9f=_0x41aa23;_0x368606[_0xf29e('0x2b')]=_[_0xf29e('0x2c')](db['CmContact']['rawAttributes']);_0x368606[_0xf29e('0x2d')]=_['keys'](_0x45cc1e['query']);_0x368606[_0xf29e('0x36')]=_[_0xf29e('0x2e')](_0x368606[_0xf29e('0x2b')],_0x368606[_0xf29e('0x2d')]);_0x2789f5['attributes']=_[_0xf29e('0x2e')](_0x368606[_0xf29e('0x2b')],qs[_0xf29e('0x30')](_0x45cc1e[_0xf29e('0x2d')]['fields']));_0x2789f5['attributes']=_0x2789f5[_0xf29e('0x2f')][_0xf29e('0x41')]?_0x2789f5[_0xf29e('0x2f')]:_0x368606[_0xf29e('0x2b')];_0x2789f5[_0xf29e('0x32')]=qs[_0xf29e('0x33')](_0x45cc1e[_0xf29e('0x2d')][_0xf29e('0x33')]);_0x2789f5[_0xf29e('0x34')]=qs[_0xf29e('0x36')](_['pick'](_0x45cc1e[_0xf29e('0x2d')],_0x368606['filters']));if(_0x45cc1e['query']['filter']){_0x2789f5[_0xf29e('0x34')]=_[_0xf29e('0x38')](_0x2789f5[_0xf29e('0x34')],{'$or':_['map'](_0x2789f5[_0xf29e('0x2f')],function(_0x327455){var _0xb767dd={};_0xb767dd[_0x327455]={'$like':'%'+_0x45cc1e[_0xf29e('0x2d')][_0xf29e('0x37')]+'%'};return _0xb767dd;})});}_0x2789f5=_['merge']({},_0x2789f5,_0x45cc1e[_0xf29e('0x3a')]);return _0x5e9d9f[_0xf29e('0x52')](_0x2789f5);}})[_0xf29e('0x20')](function(_0x1e56b3){if(_0x1e56b3){_0x1df646=_0x1e56b3[_0xf29e('0x41')];if(!_0x45cc1e['query']['hasOwnProperty'](_0xf29e('0x31'))){_0x2789f5[_0xf29e('0x17')]=qs[_0xf29e('0x17')](_0x45cc1e[_0xf29e('0x2d')]['limit']);_0x2789f5[_0xf29e('0x16')]=qs[_0xf29e('0x16')](_0x45cc1e['query']['offset']);}return _0x5e9d9f['getContacts'](_0x2789f5);}})[_0xf29e('0x20')](function(_0x1a5027){if(_0x1a5027){return _0x1a5027?{'count':_0x1df646,'rows':_0x1a5027}:null;}})[_0xf29e('0x20')](respondWithResult(_0x44ecc1,null))[_0xf29e('0x3d')](handleError(_0x44ecc1,null));}; \ No newline at end of file +var _0x77e2=['rawAttributes','intersection','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','CmContact','addContacts','ids','omit','getContacts','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','Companies','UserProfileResource','error','stack','name','index','describe','model','keys','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','CmCompany','includeAll','catch','show','params'];(function(_0xc3b9f5,_0x32e40e){var _0x89713=function(_0x5599d6){while(--_0x5599d6){_0xc3b9f5['push'](_0xc3b9f5['shift']());}};_0x89713(++_0x32e40e);}(_0x77e2,0x1b7));var _0x277e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x77e2[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x277e('0x0'));var rimraf=require(_0x277e('0x1'));var zipdir=require(_0x277e('0x2'));var jsonpatch=require(_0x277e('0x3'));var rp=require(_0x277e('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x277e('0x5'));var util=require(_0x277e('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x277e('0x7'));var ejs=require(_0x277e('0x8'));var fs=require('fs');var fs_extra=require(_0x277e('0x9'));var _=require(_0x277e('0xa'));var squel=require(_0x277e('0xb'));var crypto=require(_0x277e('0xc'));var jsforce=require(_0x277e('0xd'));var deskjs=require(_0x277e('0xe'));var toCsv=require(_0x277e('0x7'));var querystring=require(_0x277e('0xf'));var Papa=require(_0x277e('0x10'));var Redis=require(_0x277e('0x11'));var authService=require(_0x277e('0x12'));var qs=require(_0x277e('0x13'));var as=require(_0x277e('0x14'));var hardwareService=require(_0x277e('0x15'));var logger=require(_0x277e('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x46755e,_0x58be48){_0x58be48=_0x58be48||0xcc;return function(_0x3db6d8){if(_0x3db6d8){return _0x46755e[_0x277e('0x17')](_0x58be48);}return _0x46755e[_0x277e('0x18')](_0x58be48)[_0x277e('0x19')]();};}function respondWithResult(_0x4bad81,_0x326b90){_0x326b90=_0x326b90||0xc8;return function(_0x2c1102){if(_0x2c1102){return _0x4bad81[_0x277e('0x18')](_0x326b90)[_0x277e('0x1a')](_0x2c1102);}};}function respondWithFilteredResult(_0x178ba7,_0x5903c6){return function(_0x3f7500){if(_0x3f7500){var _0x2dca34=typeof _0x5903c6[_0x277e('0x1b')]==='undefined'&&typeof _0x5903c6[_0x277e('0x1c')]===_0x277e('0x1d');var _0x15ba88=_0x3f7500[_0x277e('0x1e')];var _0x115af7=_0x2dca34?0x0:_0x5903c6[_0x277e('0x1b')];var _0x5d7f1d=_0x2dca34?_0x3f7500[_0x277e('0x1e')]:_0x5903c6[_0x277e('0x1b')]+_0x5903c6[_0x277e('0x1c')];var _0xbadce6;if(_0x5d7f1d>=_0x15ba88){_0x5d7f1d=_0x15ba88;_0xbadce6=0xc8;}else{_0xbadce6=0xce;}_0x178ba7[_0x277e('0x18')](_0xbadce6);return _0x178ba7[_0x277e('0x1f')](_0x277e('0x20'),_0x115af7+'-'+_0x5d7f1d+'/'+_0x15ba88)['json'](_0x3f7500);}return null;};}function patchUpdates(_0x38fdf0){return function(_0x4064e9){try{jsonpatch[_0x277e('0x21')](_0x4064e9,_0x38fdf0,!![]);}catch(_0x4374f1){return BPromise[_0x277e('0x22')](_0x4374f1);}return _0x4064e9[_0x277e('0x23')]();};}function saveUpdates(_0x3142e1,_0x20df10){return function(_0xb5c2e1){if(_0xb5c2e1){return _0xb5c2e1['update'](_0x3142e1)[_0x277e('0x24')](function(_0x200498){return _0x200498;});}return null;};}function removeEntity(_0x4e0232,_0x17b0ad){return function(_0x25d42f){if(_0x25d42f){return _0x25d42f[_0x277e('0x25')]()[_0x277e('0x24')](function(){var _0x570699=_0x25d42f['get']({'plain':!![]});var _0x3b345f=_0x277e('0x26');return db[_0x277e('0x27')][_0x277e('0x25')]({'where':{'type':_0x3b345f,'resourceId':_0x570699['id']}})[_0x277e('0x24')](function(){return _0x25d42f;});})[_0x277e('0x24')](function(){_0x4e0232[_0x277e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47afbb,_0x1d1c4c){return function(_0x10f928){if(!_0x10f928){_0x47afbb[_0x277e('0x17')](0x194);}return _0x10f928;};}function handleError(_0x2db9ac,_0x93a573){_0x93a573=_0x93a573||0x1f4;return function(_0x46fcda){logger[_0x277e('0x28')](_0x46fcda[_0x277e('0x29')]);if(_0x46fcda[_0x277e('0x2a')]){delete _0x46fcda[_0x277e('0x2a')];}_0x2db9ac[_0x277e('0x18')](_0x93a573)['send'](_0x46fcda);};}exports[_0x277e('0x2b')]=function(_0x33d74c,_0x2bc34d){var _0x2afc42={},_0x5c268d={},_0x3d4d9c={'count':0x0,'rows':[]};return db['CmCompany'][_0x277e('0x2c')]()[_0x277e('0x24')](function(_0x39895e){_0x5c268d[_0x277e('0x2d')]=_[_0x277e('0x2e')](_0x39895e);_0x5c268d[_0x277e('0x2f')]=_[_0x277e('0x2e')](_0x33d74c[_0x277e('0x2f')]);_0x5c268d[_0x277e('0x30')]=_['intersection'](_0x5c268d[_0x277e('0x2d')],_0x5c268d[_0x277e('0x2f')]);_0x2afc42[_0x277e('0x31')]=_['intersection'](_0x5c268d['model'],qs[_0x277e('0x32')](_0x33d74c[_0x277e('0x2f')]['fields']));_0x2afc42[_0x277e('0x31')]=_0x2afc42[_0x277e('0x31')][_0x277e('0x33')]?_0x2afc42['attributes']:_0x5c268d[_0x277e('0x2d')];if(!_0x33d74c[_0x277e('0x2f')][_0x277e('0x34')]('nolimit')){_0x2afc42[_0x277e('0x1c')]=qs['limit'](_0x33d74c[_0x277e('0x2f')][_0x277e('0x1c')]);_0x2afc42[_0x277e('0x1b')]=qs['offset'](_0x33d74c['query'][_0x277e('0x1b')]);}_0x2afc42[_0x277e('0x35')]=qs[_0x277e('0x36')](_0x33d74c[_0x277e('0x2f')][_0x277e('0x36')]);_0x2afc42[_0x277e('0x37')]=qs[_0x277e('0x30')](_[_0x277e('0x38')](_0x33d74c['query'],_0x5c268d['filters']),_0x39895e);if(_0x33d74c[_0x277e('0x2f')][_0x277e('0x39')]){_0x2afc42[_0x277e('0x37')]=_[_0x277e('0x3a')](_0x2afc42[_0x277e('0x37')],{'$or':_['map'](_0x2afc42[_0x277e('0x31')],function(_0x172980){var _0x21b543={};_0x21b543[_0x172980]={'$like':'%'+_0x33d74c[_0x277e('0x2f')][_0x277e('0x39')]+'%'};return _0x21b543;})});}_0x2afc42=_[_0x277e('0x3a')]({},_0x2afc42,_0x33d74c[_0x277e('0x3b')]);var _0x5cb67a={'where':_0x2afc42['where']};return db[_0x277e('0x3c')][_0x277e('0x1e')](_0x5cb67a)[_0x277e('0x24')](function(_0x1b985d){_0x3d4d9c['count']=_0x1b985d;if(_0x33d74c[_0x277e('0x2f')][_0x277e('0x3d')]){_0x2afc42['include']=[{'all':!![]}];}return db[_0x277e('0x3c')]['findAll'](_0x2afc42);})[_0x277e('0x24')](function(_0x2ef172){_0x3d4d9c['rows']=_0x2ef172;return _0x3d4d9c;})[_0x277e('0x24')](respondWithFilteredResult(_0x2bc34d,_0x2afc42))['catch'](handleError(_0x2bc34d,null));})[_0x277e('0x3e')](handleError(_0x2bc34d,null));};exports[_0x277e('0x3f')]=function(_0x195474,_0x347bed){var _0x3de823={'raw':![],'where':{'id':_0x195474[_0x277e('0x40')]['id']}},_0x5cabe5={};_0x5cabe5[_0x277e('0x2d')]=_[_0x277e('0x2e')](db[_0x277e('0x3c')][_0x277e('0x41')]);_0x5cabe5[_0x277e('0x2f')]=_[_0x277e('0x2e')](_0x195474[_0x277e('0x2f')]);_0x5cabe5[_0x277e('0x30')]=_[_0x277e('0x42')](_0x5cabe5['model'],_0x5cabe5[_0x277e('0x2f')]);_0x3de823[_0x277e('0x31')]=_[_0x277e('0x42')](_0x5cabe5['model'],qs[_0x277e('0x32')](_0x195474[_0x277e('0x2f')][_0x277e('0x32')]));_0x3de823['attributes']=_0x3de823[_0x277e('0x31')][_0x277e('0x33')]?_0x3de823['attributes']:_0x5cabe5[_0x277e('0x2d')];if(_0x195474['query']['includeAll']){_0x3de823['include']=[{'all':!![]}];}_0x3de823=_[_0x277e('0x3a')]({},_0x3de823,_0x195474[_0x277e('0x3b')]);return db[_0x277e('0x3c')][_0x277e('0x43')](_0x3de823)['then'](handleEntityNotFound(_0x347bed,null))['then'](respondWithResult(_0x347bed,null))[_0x277e('0x3e')](handleError(_0x347bed,null));};exports[_0x277e('0x44')]=function(_0x3f7e4d,_0x5c6603){return db[_0x277e('0x3c')][_0x277e('0x44')](_0x3f7e4d[_0x277e('0x45')],{})[_0x277e('0x24')](function(_0x5faabc){var _0x5038de=_0x3f7e4d[_0x277e('0x46')][_0x277e('0x47')]({'plain':!![]});if(!_0x5038de)throw new Error(_0x277e('0x48'));if(_0x5038de[_0x277e('0x49')]===_0x277e('0x46')){var _0x48f503=_0x5faabc[_0x277e('0x47')]({'plain':!![]});var _0x2a041a=_0x277e('0x26');return db[_0x277e('0x4a')]['find']({'where':{'name':_0x2a041a,'userProfileId':_0x5038de['userProfileId']},'raw':!![]})[_0x277e('0x24')](function(_0x517ba4){if(_0x517ba4&&_0x517ba4[_0x277e('0x4b')]===0x0){return db[_0x277e('0x27')][_0x277e('0x44')]({'name':_0x48f503[_0x277e('0x2a')],'resourceId':_0x48f503['id'],'type':_0x517ba4['name'],'sectionId':_0x517ba4['id']},{})[_0x277e('0x24')](function(){return _0x5faabc;});}else{return _0x5faabc;}})[_0x277e('0x3e')](function(_0x40a1cd){logger[_0x277e('0x28')](_0x277e('0x4c'),_0x40a1cd);throw _0x40a1cd;});}return _0x5faabc;})[_0x277e('0x24')](respondWithResult(_0x5c6603,0xc9))[_0x277e('0x3e')](handleError(_0x5c6603,null));};exports[_0x277e('0x4d')]=function(_0x43d9d9,_0x56c4de){if(_0x43d9d9[_0x277e('0x45')]['id']){delete _0x43d9d9[_0x277e('0x45')]['id'];}return db['CmCompany']['find']({'where':{'id':_0x43d9d9[_0x277e('0x40')]['id']}})[_0x277e('0x24')](handleEntityNotFound(_0x56c4de,null))['then'](saveUpdates(_0x43d9d9[_0x277e('0x45')],null))[_0x277e('0x24')](respondWithResult(_0x56c4de,null))['catch'](handleError(_0x56c4de,null));};exports['destroy']=function(_0x895976,_0x363c48){return db[_0x277e('0x3c')]['find']({'where':{'id':_0x895976[_0x277e('0x40')]['id']}})[_0x277e('0x24')](handleEntityNotFound(_0x363c48,null))[_0x277e('0x24')](removeEntity(_0x363c48,null))[_0x277e('0x3e')](handleError(_0x363c48,null));};exports[_0x277e('0x2c')]=function(_0x37b845,_0x68c2e0){return db[_0x277e('0x3c')][_0x277e('0x2c')]()[_0x277e('0x24')](respondWithResult(_0x68c2e0,null))[_0x277e('0x3e')](handleError(_0x68c2e0,null));};exports['addContacts']=function(_0x52a78c,_0xda97b9,_0xfcd57){return db[_0x277e('0x4e')][_0x277e('0x43')]({'where':{'id':_0x52a78c[_0x277e('0x40')]['id']}})[_0x277e('0x24')](handleEntityNotFound(_0xda97b9,null))['then'](function(_0x56a9ed){if(_0x56a9ed){return _0x56a9ed[_0x277e('0x4f')](_0x52a78c[_0x277e('0x45')][_0x277e('0x50')],_[_0x277e('0x51')](_0x52a78c[_0x277e('0x45')],['ids','id'])||{});}})[_0x277e('0x24')](respondWithResult(_0xda97b9,null))[_0x277e('0x3e')](handleError(_0xda97b9,null));};exports[_0x277e('0x52')]=function(_0x47693e,_0x1170b5,_0x39ca00){var _0x4ddf05={};var _0x45a1c2={};var _0x26c936;var _0x48b534;return db[_0x277e('0x3c')]['findOne']({'where':{'id':_0x47693e[_0x277e('0x40')]['id']}})[_0x277e('0x24')](handleEntityNotFound(_0x1170b5,null))[_0x277e('0x24')](function(_0x1e1f26){if(_0x1e1f26){_0x26c936=_0x1e1f26;_0x45a1c2[_0x277e('0x2d')]=_[_0x277e('0x2e')](db[_0x277e('0x4e')][_0x277e('0x41')]);_0x45a1c2[_0x277e('0x2f')]=_['keys'](_0x47693e[_0x277e('0x2f')]);_0x45a1c2['filters']=_['intersection'](_0x45a1c2[_0x277e('0x2d')],_0x45a1c2[_0x277e('0x2f')]);_0x4ddf05[_0x277e('0x31')]=_['intersection'](_0x45a1c2['model'],qs[_0x277e('0x32')](_0x47693e[_0x277e('0x2f')][_0x277e('0x32')]));_0x4ddf05[_0x277e('0x31')]=_0x4ddf05[_0x277e('0x31')][_0x277e('0x33')]?_0x4ddf05[_0x277e('0x31')]:_0x45a1c2['model'];_0x4ddf05[_0x277e('0x35')]=qs[_0x277e('0x36')](_0x47693e[_0x277e('0x2f')][_0x277e('0x36')]);_0x4ddf05[_0x277e('0x37')]=qs['filters'](_['pick'](_0x47693e['query'],_0x45a1c2[_0x277e('0x30')]));if(_0x47693e[_0x277e('0x2f')][_0x277e('0x39')]){_0x4ddf05[_0x277e('0x37')]=_['merge'](_0x4ddf05[_0x277e('0x37')],{'$or':_['map'](_0x4ddf05[_0x277e('0x31')],function(_0x370d05){var _0x13969c={};_0x13969c[_0x370d05]={'$like':'%'+_0x47693e[_0x277e('0x2f')][_0x277e('0x39')]+'%'};return _0x13969c;})});}_0x4ddf05=_['merge']({},_0x4ddf05,_0x47693e['options']);return _0x26c936['getContacts'](_0x4ddf05);}})[_0x277e('0x24')](function(_0x3b9557){if(_0x3b9557){_0x48b534=_0x3b9557['length'];if(!_0x47693e[_0x277e('0x2f')][_0x277e('0x34')](_0x277e('0x53'))){_0x4ddf05[_0x277e('0x1c')]=qs['limit'](_0x47693e['query'][_0x277e('0x1c')]);_0x4ddf05['offset']=qs[_0x277e('0x1b')](_0x47693e[_0x277e('0x2f')][_0x277e('0x1b')]);}return _0x26c936[_0x277e('0x52')](_0x4ddf05);}})[_0x277e('0x24')](function(_0x44c43c){if(_0x44c43c){return _0x44c43c?{'count':_0x48b534,'rows':_0x44c43c}:null;}})[_0x277e('0x24')](respondWithResult(_0x1170b5,null))['catch'](handleError(_0x1170b5,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 097103f..056f17d 100644 --- a/server/api/cmCompany/cmCompany.model.js +++ b/server/api/cmCompany/cmCompany.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1a16=['rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2e5c92,_0x3cb152){var _0x3cdb5e=function(_0x53863b){while(--_0x53863b){_0x2e5c92['push'](_0x2e5c92['shift']());}};_0x3cdb5e(++_0x3cb152);}(_0x1a16,0xca));var _0x61a1=function(_0x390bad,_0x28740b){_0x390bad=_0x390bad-0x0;var _0x498f18=_0x1a16[_0x390bad];return _0x498f18;};'use strict';var _=require(_0x61a1('0x0'));var util=require(_0x61a1('0x1'));var logger=require(_0x61a1('0x2'))(_0x61a1('0x3'));var moment=require(_0x61a1('0x4'));var BPromise=require(_0x61a1('0x5'));var rp=require(_0x61a1('0x6'));var fs=require('fs');var path=require(_0x61a1('0x7'));var rimraf=require(_0x61a1('0x8'));var config=require(_0x61a1('0x9'));var attributes=require(_0x61a1('0xa'));module['exports']=function(_0x5590a0,_0x340b76){return _0x5590a0[_0x61a1('0xb')](_0x61a1('0xc'),attributes,{'tableName':_0x61a1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0ca2=['cm_companies','lodash','util','moment','bluebird','path','../../config/environment','./cmCompany.attributes','define','CmCompany'];(function(_0x526dbb,_0x240d9c){var _0x4c30e8=function(_0x5c6a85){while(--_0x5c6a85){_0x526dbb['push'](_0x526dbb['shift']());}};_0x4c30e8(++_0x240d9c);}(_0x0ca2,0x119));var _0x20ca=function(_0x3cc751,_0x38b8ff){_0x3cc751=_0x3cc751-0x0;var _0x3956a2=_0x0ca2[_0x3cc751];return _0x3956a2;};'use strict';var _=require(_0x20ca('0x0'));var util=require(_0x20ca('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x20ca('0x2'));var BPromise=require(_0x20ca('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x20ca('0x4'));var rimraf=require('rimraf');var config=require(_0x20ca('0x5'));var attributes=require(_0x20ca('0x6'));module['exports']=function(_0x4e02aa,_0x3a6e20){return _0x4e02aa[_0x20ca('0x7')](_0x20ca('0x8'),attributes,{'tableName':_0x20ca('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index b62668b..c6719a6 100644 --- a/server/api/cmCompany/cmCompany.rpc.js +++ b/server/api/cmCompany/cmCompany.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7d93=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x7d93,0x1b0));var _0x37d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7d93[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x37d9('0x0'));var util=require(_0x37d9('0x1'));var moment=require(_0x37d9('0x2'));var BPromise=require('bluebird');var rs=require(_0x37d9('0x3'));var fs=require('fs');var Redis=require(_0x37d9('0x4'));var db=require(_0x37d9('0x5'))['db'];var utils=require(_0x37d9('0x6'));var logger=require(_0x37d9('0x7'))(_0x37d9('0x8'));var config=require(_0x37d9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x37d9('0xa')][_0x37d9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4976dc,_0x52a609,_0x1855a3){return new BPromise(function(_0x593b81,_0x105140){return client[_0x37d9('0xc')](_0x4976dc,_0x1855a3)['then'](function(_0x2fffb1){logger[_0x37d9('0xd')](_0x37d9('0xe'),_0x52a609,_0x37d9('0xf'));logger[_0x37d9('0x10')](_0x37d9('0x11'),_0x52a609,'request\x20sent',JSON[_0x37d9('0x12')](_0x2fffb1));if(_0x2fffb1[_0x37d9('0x13')]){if(_0x2fffb1[_0x37d9('0x13')][_0x37d9('0x14')]===0x1f4){logger[_0x37d9('0x13')](_0x37d9('0xe'),_0x52a609,_0x2fffb1[_0x37d9('0x13')][_0x37d9('0x15')]);return _0x105140(_0x2fffb1[_0x37d9('0x13')][_0x37d9('0x15')]);}logger[_0x37d9('0x13')](_0x37d9('0xe'),_0x52a609,_0x2fffb1[_0x37d9('0x13')][_0x37d9('0x15')]);return _0x593b81(_0x2fffb1['error']['message']);}else{logger['info'](_0x37d9('0xe'),_0x52a609,_0x37d9('0xf'));_0x593b81(_0x2fffb1[_0x37d9('0x16')][_0x37d9('0x15')]);}})[_0x37d9('0x17')](function(_0x25f413){logger['error'](_0x37d9('0xe'),_0x52a609,_0x25f413);_0x105140(_0x25f413);});});} \ No newline at end of file +var _0xab75=['info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xab75,0x198));var _0x5ab7=function(_0x2e3c3a,_0x36f457){_0x2e3c3a=_0x2e3c3a-0x0;var _0x5bcc9c=_0xab75[_0x2e3c3a];return _0x5bcc9c;};'use strict';var _=require(_0x5ab7('0x0'));var util=require(_0x5ab7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5ab7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5ab7('0x3'));var logger=require(_0x5ab7('0x4'))(_0x5ab7('0x5'));var config=require(_0x5ab7('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5ab7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x37ad10,_0x41a304,_0x30aa58){return new BPromise(function(_0x5b50c2,_0x36458b){return client[_0x5ab7('0x8')](_0x37ad10,_0x30aa58)[_0x5ab7('0x9')](function(_0x459d61){logger[_0x5ab7('0xa')](_0x5ab7('0xb'),_0x41a304,_0x5ab7('0xc'));logger[_0x5ab7('0xd')](_0x5ab7('0xe'),_0x41a304,_0x5ab7('0xc'),JSON['stringify'](_0x459d61));if(_0x459d61['error']){if(_0x459d61[_0x5ab7('0xf')][_0x5ab7('0x10')]===0x1f4){logger[_0x5ab7('0xf')](_0x5ab7('0xb'),_0x41a304,_0x459d61[_0x5ab7('0xf')][_0x5ab7('0x11')]);return _0x36458b(_0x459d61[_0x5ab7('0xf')][_0x5ab7('0x11')]);}logger[_0x5ab7('0xf')](_0x5ab7('0xb'),_0x41a304,_0x459d61[_0x5ab7('0xf')]['message']);return _0x5b50c2(_0x459d61[_0x5ab7('0xf')][_0x5ab7('0x11')]);}else{logger['info']('CmCompany,\x20%s,\x20%s',_0x41a304,'request\x20sent');_0x5b50c2(_0x459d61['result']['message']);}})[_0x5ab7('0x12')](function(_0x51195c){logger[_0x5ab7('0xf')]('CmCompany,\x20%s,\x20%s',_0x41a304,_0x51195c);_0x36458b(_0x51195c);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index b094cb3..9fd53dc 100644 --- a/server/api/cmCompany/index.js +++ b/server/api/cmCompany/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x65b6=['../../components/interaction/service','../../config/environment','./cmCompany.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/contacts','getContacts','post','create','addContacts','put','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x9efe0,_0x1e7272){var _0x232a0f=function(_0x377439){while(--_0x377439){_0x9efe0['push'](_0x9efe0['shift']());}};_0x232a0f(++_0x1e7272);}(_0x65b6,0x101));var _0x665b=function(_0xa97e74,_0x17c03a){_0xa97e74=_0xa97e74-0x0;var _0x399b97=_0x65b6[_0xa97e74];return _0x399b97;};'use strict';var multer=require(_0x665b('0x0'));var util=require(_0x665b('0x1'));var path=require(_0x665b('0x2'));var timeout=require(_0x665b('0x3'));var express=require(_0x665b('0x4'));var router=express[_0x665b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x665b('0x6'));var interaction=require(_0x665b('0x7'));var config=require(_0x665b('0x8'));var controller=require(_0x665b('0x9'));router[_0x665b('0xa')]('/',auth['isAuthenticated'](),controller[_0x665b('0xb')]);router[_0x665b('0xa')](_0x665b('0xc'),auth[_0x665b('0xd')](),controller[_0x665b('0xe')]);router[_0x665b('0xa')](_0x665b('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x665b('0xa')](_0x665b('0x10'),auth['isAuthenticated'](),controller[_0x665b('0x11')]);router[_0x665b('0x12')]('/',auth['isAuthenticated'](),controller[_0x665b('0x13')]);router[_0x665b('0x12')](_0x665b('0x10'),auth['isAuthenticated'](),controller[_0x665b('0x14')]);router[_0x665b('0x15')](_0x665b('0xf'),auth[_0x665b('0xd')](),controller['update']);router[_0x665b('0x16')](_0x665b('0xf'),auth[_0x665b('0xd')](),controller[_0x665b('0x17')]);module['exports']=router; \ No newline at end of file +var _0x2838=['post','create','addContacts','put','delete','exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','/describe','get','/:id','show','/:id/contacts','getContacts'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x2838,0x1bf));var _0x8283=function(_0x24853d,_0x16931f){_0x24853d=_0x24853d-0x0;var _0x4c5cff=_0x2838[_0x24853d];return _0x4c5cff;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8283('0x0'));var timeout=require(_0x8283('0x1'));var express=require('express');var router=express[_0x8283('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x8283('0x3'));var interaction=require(_0x8283('0x4'));var config=require(_0x8283('0x5'));var controller=require(_0x8283('0x6'));router['get']('/',auth[_0x8283('0x7')](),controller[_0x8283('0x8')]);router['get'](_0x8283('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x8283('0xa')](_0x8283('0xb'),auth[_0x8283('0x7')](),controller[_0x8283('0xc')]);router['get'](_0x8283('0xd'),auth['isAuthenticated'](),controller[_0x8283('0xe')]);router[_0x8283('0xf')]('/',auth[_0x8283('0x7')](),controller[_0x8283('0x10')]);router[_0x8283('0xf')](_0x8283('0xd'),auth[_0x8283('0x7')](),controller[_0x8283('0x11')]);router[_0x8283('0x12')](_0x8283('0xb'),auth[_0x8283('0x7')](),controller['update']);router[_0x8283('0x13')](_0x8283('0xb'),auth[_0x8283('0x7')](),controller['destroy']);module[_0x8283('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index ba455c4..4605a7f 100644 --- a/server/api/cmContact/cmContact.attributes.js +++ b/server/api/cmContact/cmContact.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcf9c=['NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0xcf9c,0x99));var _0xccf9=function(_0x1ade92,_0x523089){_0x1ade92=_0x1ade92-0x0;var _0x233f59=_0xcf9c[_0x1ade92];return _0x233f59;};'use strict';var _=require(_0xccf9('0x0'));var Sequelize=require(_0xccf9('0x1'));module[_0xccf9('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xccf9('0x3')]},'street':{'type':Sequelize[_0xccf9('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xccf9('0x3')]},'country':{'type':Sequelize[_0xccf9('0x3')]},'dateOfBirth':{'type':Sequelize[_0xccf9('0x3')]},'description':{'type':Sequelize[_0xccf9('0x4')]},'phone':{'type':Sequelize[_0xccf9('0x3')]},'mobile':{'type':Sequelize[_0xccf9('0x3')]},'fax':{'type':Sequelize[_0xccf9('0x3')]},'email':{'type':Sequelize[_0xccf9('0x3')]},'url':{'type':Sequelize[_0xccf9('0x3')]},'facebook':{'type':Sequelize[_0xccf9('0x3')]},'fb_data':{'type':Sequelize[_0xccf9('0x3')]},'twitter':{'type':Sequelize[_0xccf9('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xccf9('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xccf9('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xccf9('0x5')]},'AdditionalPhones':{'type':Sequelize[_0xccf9('0x3')]},'priority':{'type':Sequelize[_0xccf9('0x5')](0x2)[_0xccf9('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xccf9('0x7')]},'dialTimezone':{'type':Sequelize[_0xccf9('0x3')]},'utcOffset':{'type':Sequelize[_0xccf9('0x5')]}}; \ No newline at end of file +var _0xe1ce=['TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize','STRING'];(function(_0x13d45f,_0x4d89d1){var _0x36f284=function(_0x443adb){while(--_0x443adb){_0x13d45f['push'](_0x13d45f['shift']());}};_0x36f284(++_0x4d89d1);}(_0xe1ce,0x18d));var _0xee1c=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0xe1ce[_0x432fca];return _0x3adba4;};'use strict';var _=require(_0xee1c('0x0'));var Sequelize=require(_0xee1c('0x1'));module['exports']={'firstName':{'type':Sequelize[_0xee1c('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xee1c('0x2')]},'city':{'type':Sequelize[_0xee1c('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xee1c('0x3')]},'phone':{'type':Sequelize[_0xee1c('0x2')]},'mobile':{'type':Sequelize[_0xee1c('0x2')]},'fax':{'type':Sequelize[_0xee1c('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0xee1c('0x2')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0xee1c('0x2')]},'teams':{'type':Sequelize[_0xee1c('0x2')]},'viber':{'type':Sequelize[_0xee1c('0x2')]},'line':{'type':Sequelize[_0xee1c('0x2')]},'wechat':{'type':Sequelize[_0xee1c('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xee1c('0x4')]},'AdditionalPhones':{'type':Sequelize[_0xee1c('0x2')]},'priority':{'type':Sequelize[_0xee1c('0x4')](0x2)[_0xee1c('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xee1c('0x6')],'defaultValue':Sequelize[_0xee1c('0x7')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0xee1c('0x4')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 3f55482..1b0e397 100644 --- a/server/api/cmContact/cmContact.controller.js +++ b/server/api/cmContact/cmContact.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd566=['nolimit','setTags','ids','setAdditionalPhones','all','OrderBy','item_types','items','ItemTypeId','description','CmHopper','PHONE','`ItemType`.OrderBy','CmHopperId','item','ItemType.OrderBy','CmHopperAdditionalPhone','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','includeAll','include','rows','getHopperHistories','ContactId','getHopperFinals','CmHopperFinal','getJscriptySessions','JscriptySessionReport','No\x20association\x20keys\x20specified!','socket_timestamp','binding_keys','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','root','server/files/tmp','file','filename','chmodSync','0777','fork','../../components/import/cm/csv','binding_values','CompanyId','File\x20uploaded\x20correctly!','pid','path','parse','import','User','agent','No\x20ListId\x20specified','No\x20firstName\x20column\x20specified','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','child_process','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','binding','../../components/import/cm/csvUpdates','getJourney','mail','openchannel','fax','whatsapp','voice','resolve','channel','includes','Invalid\x20channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','uniqueid','source','destination','callerid','starttime','duration','note','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','createdAt','DESC','findAndCountAll','startCase','chat','Website','Account','closed','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','deviceModel','osName','ratingMessage','referer','subject','substatus','threadId','Interaction','flatten','sortBy','reverse','slice','util','lodash','papaparse','ioredis','../../components/contacts','../../components/parsers/qs','api','../../config/environment','../../config/environment/shared','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','json','offset','undefined','limit','count','status','set','Content-Range','update','then','destroy','error','stack','name','send','index','describe','findAll','catch','CmContact','find','params','tags','keys','length','startsWith','cf_','columnName','displayName','analytics','query','CmCustomField','custom','type','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','hasOwnProperty','merge','body','from','get','mergeWith','isArray','[CmContact][merge]\x20to\x20%s\x20from\x20%s','info','CmHopperBlack','create','ChatInteraction','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','OpenchannelInteraction','OpenchannelMessage','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','WhatsappInteraction','join','isNil','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','where','$or','ListId','findOrCreate','spread','push','show','Tag','Tags','color','tag','CmContactHasItem','Phones','ContactItemType','ItemType','sequelize','literal','Phones.OrderBy','$and','cf_%d','omit','pickBy','map','format','isEmpty','table','cm_contacts','setFields','toParam','values','phone','getTags','findOne','model','rawAttributes','intersection','attributes','fields','order','sort','filters','pick','filter','options'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xd566,0x17a));var _0x6d56=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xd566[_0x19950b];return _0x3c6b41;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x6d56('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x6d56('0x1'));var squel=require('squel');var Papa=require(_0x6d56('0x2'));var Redis=require(_0x6d56('0x3'));var contacts=require(_0x6d56('0x4'));var qs=require(_0x6d56('0x5'));var logger=require('../../config/logger')(_0x6d56('0x6'));var config=require(_0x6d56('0x7'));var shared=require(_0x6d56('0x8'));var db=require('../../mysqldb')['db'];config[_0x6d56('0x9')]=_[_0x6d56('0xa')](config['redis'],{'host':_0x6d56('0xb'),'port':0x18eb});var socket=require(_0x6d56('0xc'))(new Redis(config[_0x6d56('0x9')]));require(_0x6d56('0xd'))[_0x6d56('0xe')](socket);function respondWithResult(_0x2262f7,_0x2f671d){_0x2f671d=_0x2f671d||0xc8;return function(_0x5db4cc){if(_0x5db4cc){return _0x2262f7['status'](_0x2f671d)[_0x6d56('0xf')](_0x5db4cc);}};}function respondWithFilteredResult(_0xa45411,_0x22dc36){return function(_0xdc55da){if(_0xdc55da){var _0x49790e=typeof _0x22dc36[_0x6d56('0x10')]===_0x6d56('0x11')&&typeof _0x22dc36[_0x6d56('0x12')]===_0x6d56('0x11');var _0x513e5c=_0xdc55da[_0x6d56('0x13')];var _0x3eac9b=_0x49790e?0x0:_0x22dc36[_0x6d56('0x10')];var _0x37f746=_0x49790e?_0xdc55da['count']:_0x22dc36[_0x6d56('0x10')]+_0x22dc36['limit'];var _0x45f160;if(_0x37f746>=_0x513e5c){_0x37f746=_0x513e5c;_0x45f160=0xc8;}else{_0x45f160=0xce;}_0xa45411[_0x6d56('0x14')](_0x45f160);return _0xa45411[_0x6d56('0x15')](_0x6d56('0x16'),_0x3eac9b+'-'+_0x37f746+'/'+_0x513e5c)[_0x6d56('0xf')](_0xdc55da);}return null;};}function saveUpdates(_0x3f6e91){return function(_0x189136){if(_0x189136){return _0x189136[_0x6d56('0x17')](_0x3f6e91)[_0x6d56('0x18')](function(_0x1d0a08){return _0x1d0a08;});}return null;};}function removeEntity(_0x463318){return function(_0x595ea7){if(_0x595ea7){return _0x595ea7[_0x6d56('0x19')]()['then'](function(){_0x463318[_0x6d56('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f31b4){return function(_0x15231c){if(!_0x15231c){_0x2f31b4['sendStatus'](0x194);}return _0x15231c;};}function handleError(_0x28f022,_0x4881e2){_0x4881e2=_0x4881e2||0x1f4;return function(_0x1ee869){logger[_0x6d56('0x1a')](_0x1ee869[_0x6d56('0x1b')]);if(_0x1ee869[_0x6d56('0x1c')]){delete _0x1ee869[_0x6d56('0x1c')];}_0x28f022['status'](_0x4881e2)[_0x6d56('0x1d')](_0x1ee869);};}exports[_0x6d56('0x1e')]=function(_0x43e820,_0x24e411){var _0x5dde8d={};return contacts[_0x6d56('0x1f')]()[_0x6d56('0x18')](function(_0x41542f){_0x5dde8d=qs['getOptions'](_0x41542f,_0x43e820);return contacts[_0x6d56('0x20')](_0x43e820['query'],_0x43e820['user'],_0x5dde8d,_0x41542f);})[_0x6d56('0x18')](respondWithFilteredResult(_0x24e411,_0x5dde8d))[_0x6d56('0x21')](handleError(_0x24e411,null));};exports[_0x6d56('0x19')]=function(_0x29cf62,_0x1fd712){return db[_0x6d56('0x22')][_0x6d56('0x23')]({'where':{'id':_0x29cf62[_0x6d56('0x24')]['id']}})['then'](handleEntityNotFound(_0x1fd712,null))[_0x6d56('0x18')](removeEntity(_0x1fd712,null))[_0x6d56('0x21')](handleError(_0x1fd712,null));};exports[_0x6d56('0x1f')]=function(_0x3a1b85,_0x46d85b){return db['CmContact']['describe']()['then'](function(_0x491470){delete _0x491470[_0x6d56('0x25')];for(var _0x115fa8=0x0;_0x115fa80x0){return new Promise(function(_0x4425ee){var _0x23ef3d=[];for(var _0x5becf6=0x0;_0x5becf6<_0x268285[_0x6d56('0x27')];_0x5becf6++){_0x23ef3d['push'](insertAdditionalPhones(_0x268285[_0x5becf6]['contact'],_0x268285[_0x5becf6][_0x6d56('0x50')]));}Promise['all'](_0x23ef3d)['then'](function(){_0x4425ee(0x1);});})[_0x6d56('0x18')](function(){return{'success':_0x3498f3,'failure':_0x13f079,'duplicates':_0x45f57b};});}else{return{'success':_0x3498f3,'failure':_0x13f079,'duplicates':_0x45f57b};}}})[_0x6d56('0x18')](respondWithResult(_0x2c8f01,0xc9))[_0x6d56('0x21')](handleError(_0x2c8f01,null));};exports[_0x6d56('0x5a')]=function(_0x2fc4fc,_0x6f0d02){var _0x6e359b;return db[_0x6d56('0x22')][_0x6d56('0x1f')]()[_0x6d56('0x18')](function(_0x81fa3d){return db['CmContact'][_0x6d56('0x23')]({'where':{'id':_0x2fc4fc[_0x6d56('0x24')]['id']},'include':[{'model':db[_0x6d56('0x5b')],'as':_0x6d56('0x5c'),'attributes':['id','name',_0x6d56('0x5d')],'required':_0x2fc4fc['query'][_0x6d56('0x5e')]?!![]:![]},{'model':db[_0x6d56('0x5f')],'as':_0x6d56('0x60'),'where':{'CmContactId':_0x2fc4fc[_0x6d56('0x24')]['id']},'required':![],'include':[{'model':db[_0x6d56('0x61')],'as':_0x6d56('0x62')}]}],'order':[db[_0x6d56('0x63')][_0x6d56('0x64')](_0x6d56('0x65'))],'attributes':_[_0x6d56('0x26')](_0x81fa3d)});})['then'](function(_0x3f22a5){if(!_[_0x6d56('0x4c')](_0x3f22a5)){_0x6e359b=_0x3f22a5['get']({'plain':!![]});var _0x5dd593={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x3f22a5&&_0x3f22a5[_0x6d56('0x56')]){if(_0x3f22a5[_0x6d56('0x56')]){_0x5dd593[_0x6d56('0x54')][_0x6d56('0x66')]['push']({'ListId':{'$ne':_0x3f22a5[_0x6d56('0x56')]}});}}return db[_0x6d56('0x2e')][_0x6d56('0x20')](_0x5dd593);}})['then'](function(_0xfb9e36){if(!_[_0x6d56('0x4c')](_0xfb9e36)){return _['omit'](_0x6e359b,_['map'](_0xfb9e36,function(_0x4e4e14){return util['format'](_0x6d56('0x67'),_0x4e4e14['id']);}));}})[_0x6d56('0x18')](handleEntityNotFound(_0x6f0d02,null))[_0x6d56('0x18')](respondWithResult(_0x6f0d02,null))['catch'](handleError(_0x6f0d02,null));};exports[_0x6d56('0x17')]=function(_0x5c1c6a,_0x4abf1a){var _0x24f28d;if(_0x5c1c6a[_0x6d56('0x34')]['id']){delete _0x5c1c6a[_0x6d56('0x34')]['id'];}if(!_[_0x6d56('0x4c')](_0x5c1c6a[_0x6d56('0x34')]['dialTimezone'])){var _0x248e5b=_0x5c1c6a[_0x6d56('0x34')][_0x6d56('0x4d')];if(!_['isNil'](shared[_0x6d56('0x4e')][_0x248e5b]))_0x5c1c6a[_0x6d56('0x34')][_0x6d56('0x4f')]=shared['timezones'][_0x248e5b][_0x6d56('0x4f')];}return db[_0x6d56('0x22')][_0x6d56('0x23')]({'where':{'id':_0x5c1c6a[_0x6d56('0x24')]['id']}})[_0x6d56('0x18')](handleEntityNotFound(_0x4abf1a,null))['then'](saveUpdates(_0x5c1c6a['body'],null))[_0x6d56('0x18')](function(_0x400cd6){_0x24f28d=_0x400cd6;var _0x381f9c={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x400cd6&&_0x400cd6[_0x6d56('0x56')]){if(_0x400cd6[_0x6d56('0x56')]){_0x381f9c['where'][_0x6d56('0x66')][_0x6d56('0x59')]({'ListId':{'$ne':_0x400cd6[_0x6d56('0x56')]}});}}return db['CmCustomField'][_0x6d56('0x20')](_0x381f9c);})[_0x6d56('0x18')](function(_0x43fe98){if(_0x43fe98){return _[_0x6d56('0x68')](_[_0x6d56('0x69')](_0x5c1c6a['body'],function(_0x55d52c,_0x223478){return _[_0x6d56('0x28')](_0x223478,_0x6d56('0x29'));}),_[_0x6d56('0x6a')](_0x43fe98,function(_0x383c84){return util[_0x6d56('0x6b')](_0x6d56('0x67'),_0x383c84['id']);}));}})[_0x6d56('0x18')](function(_0x1bc875){if(_0x1bc875&&!_[_0x6d56('0x6c')](_0x1bc875)){var _0x4fc252=squel[_0x6d56('0x17')]()[_0x6d56('0x6d')](_0x6d56('0x6e'))[_0x6d56('0x6f')](_0x1bc875)[_0x6d56('0x54')]('id\x20=\x20?',_0x5c1c6a[_0x6d56('0x24')]['id'])[_0x6d56('0x70')]();return db[_0x6d56('0x63')][_0x6d56('0x2d')](_0x4fc252['text'],{'replacements':_0x4fc252[_0x6d56('0x71')]});}})[_0x6d56('0x18')](function(){if(_0x5c1c6a[_0x6d56('0x34')][_0x6d56('0x72')]&&_0x24f28d){return db['CmHopper'][_0x6d56('0x17')]({'phone':_0x5c1c6a[_0x6d56('0x34')][_0x6d56('0x72')],'OrderBy':0x0},{'where':{'ContactId':_0x24f28d['id']}});}})[_0x6d56('0x18')](function(){return _0x24f28d;})['then'](respondWithResult(_0x4abf1a,null))[_0x6d56('0x21')](handleError(_0x4abf1a,null));};exports[_0x6d56('0x73')]=function(_0x1c97c1,_0x499050){var _0x1ed812={};var _0x4775c0={};var _0x39c339;var _0x20d2ef;return db[_0x6d56('0x22')][_0x6d56('0x74')]({'where':{'id':_0x1c97c1['params']['id']}})[_0x6d56('0x18')](handleEntityNotFound(_0x499050,null))[_0x6d56('0x18')](function(_0x4f40b0){if(_0x4f40b0){_0x39c339=_0x4f40b0;_0x4775c0[_0x6d56('0x75')]=_['keys'](db['Tag'][_0x6d56('0x76')]);_0x4775c0[_0x6d56('0x2d')]=_[_0x6d56('0x26')](_0x1c97c1['query']);_0x4775c0['filters']=_[_0x6d56('0x77')](_0x4775c0['model'],_0x4775c0[_0x6d56('0x2d')]);_0x1ed812[_0x6d56('0x78')]=_[_0x6d56('0x77')](_0x4775c0['model'],qs[_0x6d56('0x79')](_0x1c97c1[_0x6d56('0x2d')]['fields']));_0x1ed812[_0x6d56('0x78')]=_0x1ed812['attributes'][_0x6d56('0x27')]?_0x1ed812[_0x6d56('0x78')]:_0x4775c0[_0x6d56('0x75')];_0x1ed812[_0x6d56('0x7a')]=qs['sort'](_0x1c97c1[_0x6d56('0x2d')][_0x6d56('0x7b')]);_0x1ed812['where']=qs[_0x6d56('0x7c')](_[_0x6d56('0x7d')](_0x1c97c1[_0x6d56('0x2d')],_0x4775c0[_0x6d56('0x7c')]));if(_0x1c97c1[_0x6d56('0x2d')][_0x6d56('0x7e')]){_0x1ed812['where']=_['merge'](_0x1ed812[_0x6d56('0x54')],{'$or':_['map'](_0x1ed812[_0x6d56('0x78')],function(_0x53583f){var _0xd56b2a={};_0xd56b2a[_0x53583f]={'$like':'%'+_0x1c97c1[_0x6d56('0x2d')][_0x6d56('0x7e')]+'%'};return _0xd56b2a;})});}_0x1ed812=_[_0x6d56('0x33')]({},_0x1ed812,_0x1c97c1[_0x6d56('0x7f')]);return _0x39c339['getTags'](_0x1ed812);}})[_0x6d56('0x18')](function(_0x3e96f4){if(_0x3e96f4){_0x20d2ef=_0x3e96f4['length'];if(!_0x1c97c1[_0x6d56('0x2d')][_0x6d56('0x32')](_0x6d56('0x80'))){_0x1ed812[_0x6d56('0x12')]=qs['limit'](_0x1c97c1[_0x6d56('0x2d')][_0x6d56('0x12')]);_0x1ed812[_0x6d56('0x10')]=qs['offset'](_0x1c97c1[_0x6d56('0x2d')][_0x6d56('0x10')]);}return _0x39c339[_0x6d56('0x73')](_0x1ed812);}})[_0x6d56('0x18')](function(_0x1ce19d){if(_0x1ce19d){return _0x1ce19d?{'count':_0x20d2ef,'rows':_0x1ce19d}:null;}})['then'](respondWithResult(_0x499050,null))['catch'](handleError(_0x499050,null));};exports['setTags']=function(_0x38dcc0,_0x1cbfd7){if(_0x38dcc0[_0x6d56('0x34')]['id']){delete _0x38dcc0[_0x6d56('0x34')]['id'];}return db[_0x6d56('0x22')][_0x6d56('0x74')]({'where':{'id':_0x38dcc0[_0x6d56('0x24')]['id']}})[_0x6d56('0x18')](handleEntityNotFound(_0x1cbfd7,null))[_0x6d56('0x18')](function(_0x2111d0){if(_0x2111d0){return _0x2111d0[_0x6d56('0x81')](_0x38dcc0[_0x6d56('0x34')][_0x6d56('0x82')]||[]);}return null;})[_0x6d56('0x18')](respondWithResult(_0x1cbfd7,null))[_0x6d56('0x21')](handleError(_0x1cbfd7,null));};exports[_0x6d56('0x83')]=function(_0x49716c,_0x3e3de9){var _0x16b03a=[];_0x16b03a[_0x6d56('0x59')](addAdditionalPhones(_0x49716c[_0x6d56('0x34')]));Promise[_0x6d56('0x84')](_0x16b03a)[_0x6d56('0x18')](function(){_0x16b03a=[];_0x16b03a[_0x6d56('0x59')](deleteCmHopperPhones(_0x49716c[_0x6d56('0x34')]['id']));_0x16b03a[_0x6d56('0x59')](addCmHopperPhones(_0x49716c['body']['id']));Promise[_0x6d56('0x84')](_0x16b03a)['then'](function(){return[0x1];})['then'](respondWithResult(_0x3e3de9,null));});};function addAdditionalPhones(_0x17da2b){var _0x8985;return new Promise(function(_0x1bc86e){return db['CmContactHasItem'][_0x6d56('0x19')]({'where':{'CmContactId':_0x17da2b['id']}})[_0x6d56('0x18')](function(){db['ContactItemType'][_0x6d56('0x20')]({'raw':!![],'attributes':['id',_0x6d56('0x85')]})['then'](function(_0x5d0954){var _0x4c882c=[];for(var _0x5f1da3=0x0;_0x5f1da3<_0x17da2b['items']['length'];_0x5f1da3++){var _0x382ea1=_0x17da2b[_0x6d56('0x86')]?_[_0x6d56('0x4c')](_0x17da2b[_0x6d56('0x86')][_0x5f1da3])?'':_0x17da2b[_0x6d56('0x86')][_0x5f1da3]:_0x17da2b[_0x6d56('0x87')][_0x5f1da3][_0x6d56('0x88')]?_0x17da2b[_0x6d56('0x87')][_0x5f1da3][_0x6d56('0x88')]:'';var _0x5f53dd=_[_0x6d56('0x4c')](_0x17da2b[_0x6d56('0x87')][_0x5f1da3][_0x6d56('0x89')])?'':_0x17da2b[_0x6d56('0x87')][_0x5f1da3][_0x6d56('0x89')];var _0x150f1a=_0x382ea1+':'+_0x17da2b[_0x6d56('0x87')][_0x5f1da3][_0x6d56('0x72')]+'§'+_0x5f53dd;if(_['isNil'](_0x8985))_0x8985=_0x150f1a;else _0x8985+=';'+_0x150f1a;var _0x45d17a=null;var _0x4a152b=null;if(_0x17da2b[_0x6d56('0x86')]){if(!_[_0x6d56('0x4c')](_0x17da2b[_0x6d56('0x86')][_0x5f1da3])){_0x4a152b=_[_0x6d56('0x23')](_0x5d0954,function(_0x39b3ef){return _0x39b3ef['id']===_0x17da2b[_0x6d56('0x86')][_0x5f1da3];});if(!_[_0x6d56('0x4c')](_0x4a152b)){_0x45d17a=_0x4a152b['OrderBy'];}}}else{if(!_['isNil'](_0x17da2b[_0x6d56('0x87')][_0x5f1da3])){_0x4a152b=_[_0x6d56('0x23')](_0x5d0954,function(_0x58f68f){return _0x58f68f['id']===_0x17da2b[_0x6d56('0x87')][_0x5f1da3][_0x6d56('0x88')];});if(!_['isNil'](_0x4a152b)){_0x45d17a=_0x5f1da3;}}}if(_[_0x6d56('0x4c')](_0x45d17a)){_0x45d17a=0x64;}_0x4c882c['push'](addAdditionalPhone(_0x17da2b['id'],_0x17da2b[_0x6d56('0x87')][_0x5f1da3][_0x6d56('0x72')],_0x17da2b[_0x6d56('0x86')]?_[_0x6d56('0x4c')](_0x17da2b[_0x6d56('0x86')][_0x5f1da3])?null:_0x17da2b[_0x6d56('0x86')][_0x5f1da3]:_0x17da2b[_0x6d56('0x87')][_0x5f1da3][_0x6d56('0x88')]?_0x17da2b[_0x6d56('0x87')][_0x5f1da3][_0x6d56('0x88')]:null,_0x45d17a,_0x5f53dd));}Promise[_0x6d56('0x84')](_0x4c882c)[_0x6d56('0x18')](function(){db[_0x6d56('0x22')][_0x6d56('0x17')]({'AdditionalPhones':_0x8985},{'where':{'id':_0x17da2b['id']}})['then'](function(){_0x1bc86e(0x1);});});});});});}function addAdditionalPhone(_0x9a589,_0x157d79,_0x2560ce,_0x3061f7,_0x15efe7){return db['CmContactHasItem'][_0x6d56('0x23')]({'where':{'CmContactId':_0x9a589,'item':_0x157d79}})[_0x6d56('0x18')](function(_0x62c987){if(_0x62c987)logger[_0x6d56('0x3a')]('contact\x20phone\x20exists',_0x62c987);else{db[_0x6d56('0x5f')][_0x6d56('0x3c')]({'CmContactId':_0x9a589,'item':_0x157d79,'ItemTypeId':_0x2560ce,'OrderBy':_0x3061f7,'ItemClass':'PHONE','description':_0x15efe7});}});}function deleteCmHopperPhones(_0x69ffa7){return new Promise(function(_0x30b102){return db[_0x6d56('0x8a')][_0x6d56('0x20')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x69ffa7}})[_0x6d56('0x18')](function(_0x3493c9){db['CmHopperAdditionalPhone'][_0x6d56('0x19')]({'where':{'CmHopperId':{'$in':_[_0x6d56('0x6a')](_0x3493c9,'id')}}});})[_0x6d56('0x18')](function(){_0x30b102(0x1);});});}function addCmHopperPhones(_0xdcc6be){return new Promise(function(_0x396968){return db['CmHopper'][_0x6d56('0x20')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0xdcc6be}})[_0x6d56('0x18')](function(_0x47d8aa){var _0x3e1983=[];_[_0x6d56('0x6a')](_0x47d8aa,function(_0x476f7d){_0x3e1983['push'](createCmHopperPhone(_0xdcc6be,_0x476f7d['id']));});Promise[_0x6d56('0x84')](_0x3e1983)[_0x6d56('0x18')](function(){_0x396968(0x1);});});});}function createCmHopperPhone(_0x349b46,_0x808bc7){return new Promise(function(_0x545057){db[_0x6d56('0x5f')][_0x6d56('0x20')]({'raw':!![],'attributes':['item',_0x6d56('0x85')],'where':{'CmContactId':_0x349b46,'ItemClass':_0x6d56('0x8b')},'include':[{'model':db[_0x6d56('0x61')],'attributes':['OrderBy'],'as':_0x6d56('0x62')}],'order':[_0x6d56('0x85'),db[_0x6d56('0x63')][_0x6d56('0x64')](_0x6d56('0x8c'))]})[_0x6d56('0x18')](function(_0xce6ab){var _0x52d1a2=0x1;var _0x3269e9=_[_0x6d56('0x6a')](_0xce6ab,function(_0x416a42){_0x416a42[_0x6d56('0x8d')]=_0x808bc7;_0x416a42[_0x6d56('0x72')]=_0x416a42[_0x6d56('0x8e')];_0x416a42['OrderBy']=_0x52d1a2;delete _0x416a42[_0x6d56('0x8f')];_0x52d1a2=_0x52d1a2+0x1;return _0x416a42;});return db[_0x6d56('0x90')]['bulkCreate'](_0x3269e9,{});})[_0x6d56('0x18')](function(){_0x545057(0x1);});});}function insertAdditionalPhones(_0x51581c,_0xd5200a){return new Promise(function(_0x21efa0){var _0x49e099=[];for(var _0xa6e2da=0x0;_0xa6e2da<_0xd5200a['length'];_0xa6e2da++){var _0x26a671=_0xd5200a[_0xa6e2da];_0x49e099[_0x6d56('0x59')](parseContactItemType(_0x26a671));}Promise[_0x6d56('0x84')](_0x49e099)[_0x6d56('0x18')](function(){var _0x57d70b={'id':_0x51581c['id'],'items':_0xd5200a};return addAdditionalPhones(_0x57d70b)[_0x6d56('0x18')](function(){return addCmHopperPhones(_0x51581c['id']);});})[_0x6d56('0x18')](function(){_0x21efa0(_0x51581c);});});}function parseContactItemType(_0x422773){return new Promise(function(_0x1e16c3){if(_0x422773[_0x6d56('0x32')](_0x6d56('0x88'))){_0x1e16c3(_0x422773);}else{return db[_0x6d56('0x61')]['find']({'where':{'name':_0x422773[_0x6d56('0x62')]}})[_0x6d56('0x18')](function(_0xa57659){if(_[_0x6d56('0x4c')](_0xa57659))_0x422773['ItemTypeId']=null;else _0x422773[_0x6d56('0x88')]=_0xa57659['id'];_0x1e16c3(_0x422773);});}});}exports['getAdditionalPhones']=function(_0xf288fa,_0x5a5510){return db[_0x6d56('0x5f')][_0x6d56('0x20')]({'raw':!![],'where':{'CmContactId':_0xf288fa[_0x6d56('0x24')]['id'],'ItemClass':'PHONE'},'include':[{'model':db['ContactItemType'],'as':'ItemType'}],'order':[[_0x6d56('0x85')],[db[_0x6d56('0x63')][_0x6d56('0x64')](_0x6d56('0x8c'))]]})[_0x6d56('0x18')](function(_0x3d7e66){return _0x3d7e66;})[_0x6d56('0x18')](respondWithResult(_0x5a5510,null))[_0x6d56('0x21')](handleError(_0x5a5510,null));};exports[_0x6d56('0x91')]=function(_0x30c480,_0x5341b8){return db[_0x6d56('0x5f')][_0x6d56('0x20')]({'raw':!![],'where':{'CmContactId':_0x30c480[_0x6d56('0x34')][_0x6d56('0x92')]}})[_0x6d56('0x18')](function(_0x441c17){var _0x558a41=_[_0x6d56('0x6a')](_0x441c17,function(_0x38ea23){_0x38ea23[_0x6d56('0x93')]=_0x30c480[_0x6d56('0x34')][_0x6d56('0x94')];return _0x38ea23;});return db[_0x6d56('0x5f')][_0x6d56('0x51')](_0x558a41,{});})[_0x6d56('0x18')](function(){return addCmHopperPhones(_0x30c480['body'][_0x6d56('0x94')]);})['then'](function(){return['ok'];})[_0x6d56('0x18')](respondWithResult(_0x5341b8,null))[_0x6d56('0x21')](handleError(_0x5341b8,null));};exports[_0x6d56('0x95')]=function(_0x5b0906,_0x2401a3){var _0xdfbe6=[];_0xdfbe6['push'](createCmHopperPhone(_0x5b0906['body']['id'],_0x5b0906[_0x6d56('0x34')][_0x6d56('0x96')]));Promise[_0x6d56('0x84')](_0xdfbe6)[_0x6d56('0x18')](function(){return[0x1];})[_0x6d56('0x18')](respondWithResult(_0x2401a3,null));};exports[_0x6d56('0x97')]=function(_0x12e024,_0x1c4ebd){var _0x323652={'raw':![],'where':{}};var _0x50a4e7={};var _0x3c028e={'count':0x0,'rows':[]};return db[_0x6d56('0x22')][_0x6d56('0x74')]({'where':{'id':_0x12e024[_0x6d56('0x24')]['id']}})[_0x6d56('0x18')](handleEntityNotFound(_0x1c4ebd,null))[_0x6d56('0x18')](function(_0x22e1a4){if(_0x22e1a4){_0x50a4e7[_0x6d56('0x75')]=_[_0x6d56('0x26')](db[_0x6d56('0x8a')][_0x6d56('0x76')]);_0x50a4e7[_0x6d56('0x2d')]=_[_0x6d56('0x26')](_0x12e024[_0x6d56('0x2d')]);_0x50a4e7[_0x6d56('0x7c')]=_['intersection'](_0x50a4e7[_0x6d56('0x75')],_0x50a4e7[_0x6d56('0x2d')]);_0x323652[_0x6d56('0x78')]=_[_0x6d56('0x77')](_0x50a4e7[_0x6d56('0x75')],qs['fields'](_0x12e024['query'][_0x6d56('0x79')]));_0x323652[_0x6d56('0x78')]=_0x323652[_0x6d56('0x78')][_0x6d56('0x27')]?_0x323652[_0x6d56('0x78')]:_0x50a4e7['model'];if(!_0x12e024[_0x6d56('0x2d')][_0x6d56('0x32')](_0x6d56('0x80'))){_0x323652[_0x6d56('0x12')]=qs[_0x6d56('0x12')](_0x12e024[_0x6d56('0x2d')]['limit']);_0x323652[_0x6d56('0x10')]=qs[_0x6d56('0x10')](_0x12e024[_0x6d56('0x2d')][_0x6d56('0x10')]);}_0x323652[_0x6d56('0x7a')]=qs['sort'](_0x12e024['query'][_0x6d56('0x7b')]);_0x323652['where']=qs[_0x6d56('0x7c')](_['pick'](_0x12e024[_0x6d56('0x2d')],_0x50a4e7[_0x6d56('0x7c')]));_0x323652[_0x6d56('0x54')]['ContactId']=_0x22e1a4['id'];if(_0x12e024[_0x6d56('0x2d')][_0x6d56('0x7e')]){_0x323652[_0x6d56('0x54')]=_[_0x6d56('0x33')](_0x323652[_0x6d56('0x54')],{'$or':_['map'](_0x323652['attributes'],function(_0x1f764d){var _0x2276dc={};_0x2276dc[_0x1f764d]={'$like':'%'+_0x12e024[_0x6d56('0x2d')]['filter']+'%'};return _0x2276dc;})});}_0x323652=_[_0x6d56('0x33')]({},_0x323652,_0x12e024['options']);return db['CmHopper']['count']({'where':_0x323652[_0x6d56('0x54')]})[_0x6d56('0x18')](function(_0x5b4d26){_0x3c028e[_0x6d56('0x13')]=_0x5b4d26;if(_0x12e024[_0x6d56('0x2d')][_0x6d56('0x98')]){_0x323652[_0x6d56('0x99')]=[{'all':!![]}];}return db[_0x6d56('0x8a')][_0x6d56('0x20')](_0x323652);})[_0x6d56('0x18')](function(_0x21e85c){_0x3c028e[_0x6d56('0x9a')]=_0x21e85c;return _0x3c028e;});}})[_0x6d56('0x18')](respondWithFilteredResult(_0x1c4ebd,_0x323652))[_0x6d56('0x21')](handleError(_0x1c4ebd,null));};exports[_0x6d56('0x9b')]=function(_0x120aef,_0x5d300b){var _0x300200={'raw':!![],'where':{}};var _0x44fcf9={};var _0x3020a3={'count':0x0,'rows':[]};return db[_0x6d56('0x22')][_0x6d56('0x74')]({'where':{'id':_0x120aef[_0x6d56('0x24')]['id']}})[_0x6d56('0x18')](handleEntityNotFound(_0x5d300b,null))[_0x6d56('0x18')](function(_0x38fbce){if(_0x38fbce){_0x44fcf9[_0x6d56('0x75')]=_[_0x6d56('0x26')](db[_0x6d56('0x45')][_0x6d56('0x76')]);_0x44fcf9[_0x6d56('0x2d')]=_[_0x6d56('0x26')](_0x120aef[_0x6d56('0x2d')]);_0x44fcf9[_0x6d56('0x7c')]=_['intersection'](_0x44fcf9[_0x6d56('0x75')],_0x44fcf9[_0x6d56('0x2d')]);_0x300200[_0x6d56('0x78')]=_[_0x6d56('0x77')](_0x44fcf9[_0x6d56('0x75')],qs[_0x6d56('0x79')](_0x120aef[_0x6d56('0x2d')][_0x6d56('0x79')]));_0x300200[_0x6d56('0x78')]=_0x300200[_0x6d56('0x78')][_0x6d56('0x27')]?_0x300200[_0x6d56('0x78')]:_0x44fcf9[_0x6d56('0x75')];if(!_0x120aef[_0x6d56('0x2d')]['hasOwnProperty'](_0x6d56('0x80'))){_0x300200['limit']=qs[_0x6d56('0x12')](_0x120aef['query']['limit']);_0x300200[_0x6d56('0x10')]=qs['offset'](_0x120aef[_0x6d56('0x2d')][_0x6d56('0x10')]);}_0x300200['order']=qs['sort'](_0x120aef[_0x6d56('0x2d')][_0x6d56('0x7b')]);_0x300200['where']=qs['filters'](_['pick'](_0x120aef['query'],_0x44fcf9[_0x6d56('0x7c')]));_0x300200[_0x6d56('0x54')][_0x6d56('0x9c')]=_0x38fbce['id'];if(_0x120aef['query'][_0x6d56('0x7e')]){_0x300200[_0x6d56('0x54')]=_[_0x6d56('0x33')](_0x300200[_0x6d56('0x54')],{'$or':_[_0x6d56('0x6a')](_0x300200[_0x6d56('0x78')],function(_0x18b90a){var _0x4b6256={};_0x4b6256[_0x18b90a]={'$like':'%'+_0x120aef[_0x6d56('0x2d')][_0x6d56('0x7e')]+'%'};return _0x4b6256;})});}_0x300200=_[_0x6d56('0x33')]({},_0x300200,_0x120aef[_0x6d56('0x7f')]);return db['CmHopperHistory']['count']({'where':_0x300200[_0x6d56('0x54')]})[_0x6d56('0x18')](function(_0x1974cb){_0x3020a3['count']=_0x1974cb;if(_0x120aef[_0x6d56('0x2d')][_0x6d56('0x98')]){_0x300200['include']=[{'all':!![]}];}return db[_0x6d56('0x45')]['findAll'](_0x300200);})[_0x6d56('0x18')](function(_0x249ba8){_0x3020a3['rows']=_0x249ba8;return _0x3020a3;});}})[_0x6d56('0x18')](respondWithFilteredResult(_0x5d300b,_0x300200))['catch'](handleError(_0x5d300b,null));};exports[_0x6d56('0x9d')]=function(_0x2f72ea,_0x3c591d){var _0x202841={'raw':!![],'where':{}};var _0x3f5b6e={};var _0x4b2b50={'count':0x0,'rows':[]};return db[_0x6d56('0x22')]['findOne']({'where':{'id':_0x2f72ea['params']['id']}})[_0x6d56('0x18')](handleEntityNotFound(_0x3c591d,null))[_0x6d56('0x18')](function(_0x15586b){if(_0x15586b){_0x3f5b6e['model']=_['keys'](db[_0x6d56('0x9e')][_0x6d56('0x76')]);_0x3f5b6e[_0x6d56('0x2d')]=_[_0x6d56('0x26')](_0x2f72ea['query']);_0x3f5b6e[_0x6d56('0x7c')]=_['intersection'](_0x3f5b6e['model'],_0x3f5b6e[_0x6d56('0x2d')]);_0x202841[_0x6d56('0x78')]=_[_0x6d56('0x77')](_0x3f5b6e['model'],qs['fields'](_0x2f72ea[_0x6d56('0x2d')][_0x6d56('0x79')]));_0x202841[_0x6d56('0x78')]=_0x202841[_0x6d56('0x78')][_0x6d56('0x27')]?_0x202841[_0x6d56('0x78')]:_0x3f5b6e[_0x6d56('0x75')];if(!_0x2f72ea[_0x6d56('0x2d')]['hasOwnProperty'](_0x6d56('0x80'))){_0x202841['limit']=qs[_0x6d56('0x12')](_0x2f72ea[_0x6d56('0x2d')][_0x6d56('0x12')]);_0x202841['offset']=qs[_0x6d56('0x10')](_0x2f72ea[_0x6d56('0x2d')][_0x6d56('0x10')]);}_0x202841[_0x6d56('0x7a')]=qs[_0x6d56('0x7b')](_0x2f72ea[_0x6d56('0x2d')][_0x6d56('0x7b')]);_0x202841['where']=qs[_0x6d56('0x7c')](_[_0x6d56('0x7d')](_0x2f72ea[_0x6d56('0x2d')],_0x3f5b6e[_0x6d56('0x7c')]));_0x202841[_0x6d56('0x54')]['ContactId']=_0x15586b['id'];if(_0x2f72ea[_0x6d56('0x2d')][_0x6d56('0x7e')]){_0x202841[_0x6d56('0x54')]=_['merge'](_0x202841[_0x6d56('0x54')],{'$or':_['map'](_0x202841[_0x6d56('0x78')],function(_0x45bab9){var _0x554dbf={};_0x554dbf[_0x45bab9]={'$like':'%'+_0x2f72ea[_0x6d56('0x2d')][_0x6d56('0x7e')]+'%'};return _0x554dbf;})});}_0x202841=_[_0x6d56('0x33')]({},_0x202841,_0x2f72ea['options']);return db['CmHopperFinal'][_0x6d56('0x13')]({'where':_0x202841[_0x6d56('0x54')]})[_0x6d56('0x18')](function(_0x4edf73){_0x4b2b50['count']=_0x4edf73;if(_0x2f72ea[_0x6d56('0x2d')][_0x6d56('0x98')]){_0x202841['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0x6d56('0x20')](_0x202841);})['then'](function(_0x5df263){_0x4b2b50[_0x6d56('0x9a')]=_0x5df263;return _0x4b2b50;});}})[_0x6d56('0x18')](respondWithFilteredResult(_0x3c591d,_0x202841))[_0x6d56('0x21')](handleError(_0x3c591d,null));};exports[_0x6d56('0x9f')]=function(_0xf67ff6,_0x81cbbc){var _0x48fc63={'raw':!![],'where':{}};var _0xe4024e={};var _0x502a95={'count':0x0,'rows':[]};return db[_0x6d56('0x22')][_0x6d56('0x74')]({'where':{'id':_0xf67ff6['params']['id']}})[_0x6d56('0x18')](handleEntityNotFound(_0x81cbbc,null))[_0x6d56('0x18')](function(_0x59f34f){if(_0x59f34f){_0xe4024e[_0x6d56('0x75')]=_['keys'](db[_0x6d56('0xa0')][_0x6d56('0x76')]);_0xe4024e['query']=_['keys'](_0xf67ff6[_0x6d56('0x2d')]);_0xe4024e[_0x6d56('0x7c')]=_[_0x6d56('0x77')](_0xe4024e[_0x6d56('0x75')],_0xe4024e[_0x6d56('0x2d')]);_0x48fc63['attributes']=_[_0x6d56('0x77')](_0xe4024e[_0x6d56('0x75')],qs['fields'](_0xf67ff6[_0x6d56('0x2d')][_0x6d56('0x79')]));_0x48fc63[_0x6d56('0x78')]=_0x48fc63['attributes'][_0x6d56('0x27')]?_0x48fc63['attributes']:_0xe4024e[_0x6d56('0x75')];if(!_0xf67ff6['query'][_0x6d56('0x32')]('nolimit')){_0x48fc63[_0x6d56('0x12')]=qs[_0x6d56('0x12')](_0xf67ff6[_0x6d56('0x2d')][_0x6d56('0x12')]);_0x48fc63[_0x6d56('0x10')]=qs['offset'](_0xf67ff6[_0x6d56('0x2d')][_0x6d56('0x10')]);}_0x48fc63[_0x6d56('0x7a')]=qs['sort'](_0xf67ff6[_0x6d56('0x2d')][_0x6d56('0x7b')]);_0x48fc63['where']=qs['filters'](_[_0x6d56('0x7d')](_0xf67ff6['query'],_0xe4024e[_0x6d56('0x7c')]));_0x48fc63[_0x6d56('0x54')][_0x6d56('0x9c')]=_0x59f34f['id'];if(_0xf67ff6['query'][_0x6d56('0x7e')]){_0x48fc63[_0x6d56('0x54')]=_[_0x6d56('0x33')](_0x48fc63[_0x6d56('0x54')],{'$or':_[_0x6d56('0x6a')](_0x48fc63[_0x6d56('0x78')],function(_0x2546a1){var _0x622232={};_0x622232[_0x2546a1]={'$like':'%'+_0xf67ff6[_0x6d56('0x2d')][_0x6d56('0x7e')]+'%'};return _0x622232;})});}_0x48fc63=_['merge']({},_0x48fc63,_0xf67ff6['options']);return db[_0x6d56('0xa0')][_0x6d56('0x13')]({'where':_0x48fc63[_0x6d56('0x54')]})[_0x6d56('0x18')](function(_0x22bc60){_0x502a95[_0x6d56('0x13')]=_0x22bc60;if(_0xf67ff6[_0x6d56('0x2d')][_0x6d56('0x98')]){_0x48fc63[_0x6d56('0x99')]=[{'all':!![]}];}return db[_0x6d56('0xa0')][_0x6d56('0x20')](_0x48fc63);})['then'](function(_0x31288c){_0x502a95[_0x6d56('0x9a')]=_0x31288c;return _0x502a95;});}})[_0x6d56('0x18')](respondWithFilteredResult(_0x81cbbc,_0x48fc63))[_0x6d56('0x21')](handleError(_0x81cbbc,null));};exports['uploadCsv']=function(_0x52b47f,_0x1a612e){try{if(!_0x52b47f[_0x6d56('0x34')][_0x6d56('0x56')]){throw new Error('No\x20ListId\x20specified');}if(!_0x52b47f[_0x6d56('0x34')]['binding_keys']){throw new Error(_0x6d56('0xa1'));}if(!_0x52b47f['body']['binding_values']){throw new Error('No\x20association\x20values\x20specified!');}if(!_0x52b47f['body'][_0x6d56('0xa2')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x125c14=_0x52b47f[_0x6d56('0x34')][_0x6d56('0xa3')][_0x6d56('0xa4')](',');var _0x200721=_0x52b47f[_0x6d56('0x34')]['binding_values']['split'](',');if(!_0x125c14[_0x6d56('0x27')]||!_0x200721[_0x6d56('0x27')]||_0x125c14[_0x6d56('0x27')]!==_0x200721[_0x6d56('0x27')]){throw new Error(_0x6d56('0xa5'));}_0x52b47f[_0x6d56('0x34')][_0x6d56('0x79')]=_[_0x6d56('0xa6')](_0x125c14,_0x200721);if(!_0x52b47f['body'][_0x6d56('0x79')][_0x6d56('0x72')]){throw new Error(_0x6d56('0xa7'));}if(!_0x52b47f[_0x6d56('0x34')][_0x6d56('0x79')][_0x6d56('0xa8')]){throw new Error('No\x20firstName\x20column\x20specified');}var _0x310906=path[_0x6d56('0x4b')](config[_0x6d56('0xa9')],_0x6d56('0xaa'),_0x52b47f[_0x6d56('0xab')][_0x6d56('0xac')]);fs[_0x6d56('0xad')](_0x310906,parseInt(_0x6d56('0xae'),0x8));var _0x3bb98a=require('child_process')[_0x6d56('0xaf')](path[_0x6d56('0x4b')](__dirname,_0x6d56('0xb0')),[_0x310906,_0x52b47f[_0x6d56('0x34')]['binding_keys'],_0x52b47f[_0x6d56('0x34')][_0x6d56('0xb1')],_0x52b47f['body'][_0x6d56('0x56')],_0x52b47f[_0x6d56('0x34')][_0x6d56('0xb2')],_0x52b47f[_0x6d56('0x34')][_0x6d56('0x53')],_0x52b47f[_0x6d56('0x34')][_0x6d56('0xa2')]]);return _0x1a612e[_0x6d56('0x14')](0xc8)[_0x6d56('0xf')]({'message':_0x6d56('0xb3'),'pid':_0x3bb98a[_0x6d56('0xb4')]});}catch(_0x2a4592){return _0x1a612e[_0x6d56('0x14')](0x1f4)[_0x6d56('0x1d')](_0x2a4592);}};exports['upload']=function(_0x2c802f,_0x2e089e){var _0x1d539b=fs['createReadStream'](_0x2c802f['file'][_0x6d56('0xb5')]);Papa[_0x6d56('0xb6')](_0x1d539b,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c89fd){return _0x2e089e['status'](0xc8)[_0x6d56('0xf')]({'file':_0x2c802f[_0x6d56('0xab')],'fields':_0x5c89fd['meta'][_0x6d56('0x79')]});}});};exports[_0x6d56('0xb7')]=function(_0x1ab914,_0x11c2a9){return db[_0x6d56('0xb8')][_0x6d56('0x20')]({'raw':!![],'attributes':['id'],'where':{'role':_0x6d56('0xb9')}})[_0x6d56('0x18')](function(_0x294411){var _0xefd249=![];if(!_0x1ab914[_0x6d56('0x34')]['ListId']){throw new Error(_0x6d56('0xba'));}if(!_0x1ab914[_0x6d56('0x34')]['binding'][_0x6d56('0x72')]){throw new Error(_0x6d56('0xa7'));}if(!_0x1ab914['body']['binding'][_0x6d56('0xa8')]){throw new Error(_0x6d56('0xbb'));}if(!_0x1ab914[_0x6d56('0x34')][_0x6d56('0xa2')]){throw new Error(_0x6d56('0xbc'));}var _0x3c6945=require(_0x6d56('0xbd'))['fork'](path[_0x6d56('0x4b')](__dirname,_0x6d56('0xbe')),[_0x1ab914[_0x6d56('0x24')]['id'],JSON['stringify'](_0x1ab914['body']),JSON[_0x6d56('0xbf')](_0x294411)]);_0x3c6945['on'](_0x6d56('0xc0'),function(){_0xefd249=!![];return _0x11c2a9[_0x6d56('0x14')](0xc8)['json']({'message':_0x6d56('0xc1'),'pid':_0x3c6945[_0x6d56('0xb4')]});});_0x3c6945['on'](_0x6d56('0xc2'),function(_0x2f2098){if(_0x2f2098&&!_0xefd249){return _0x11c2a9[_0x6d56('0x14')](0x1f4)[_0x6d56('0xf')]({'message':_0x6d56('0xc3'),'pid':_0x3c6945['pid']});}});})[_0x6d56('0x21')](handleError(_0x11c2a9,null));};exports[_0x6d56('0xc4')]=function(_0x1a996b,_0x302774){return db['User']['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x6d56('0xb9')}})[_0x6d56('0x18')](function(_0x2dbc24){var _0x4e5361=![];if(!_0x1a996b[_0x6d56('0x34')]['ListId']){throw new Error('No\x20ListId\x20specified');}if(!_0x1a996b[_0x6d56('0x34')][_0x6d56('0xc5')]['phone']){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x1a996b[_0x6d56('0x34')][_0x6d56('0xc5')][_0x6d56('0xa8')]){throw new Error(_0x6d56('0xbb'));}if(!_0x1a996b[_0x6d56('0x34')][_0x6d56('0xa2')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x5e3663=require('child_process')[_0x6d56('0xaf')](path['join'](__dirname,_0x6d56('0xc6')),[_0x1a996b[_0x6d56('0x24')]['id'],JSON[_0x6d56('0xbf')](_0x1a996b[_0x6d56('0x34')]),JSON['stringify'](_0x2dbc24)]);_0x5e3663['on'](_0x6d56('0xc0'),function(){_0x4e5361=!![];return _0x302774[_0x6d56('0x14')](0xc8)['json']({'message':'start\x20child\x20process\x20correctly!','pid':_0x5e3663[_0x6d56('0xb4')]});});_0x5e3663['on'](_0x6d56('0xc2'),function(_0x2fec0e){if(_0x2fec0e&&!_0x4e5361){return _0x302774['status'](0x1f4)[_0x6d56('0xf')]({'message':_0x6d56('0xc3'),'pid':_0x5e3663[_0x6d56('0xb4')]});}});})[_0x6d56('0x21')](handleError(_0x302774,null));};exports[_0x6d56('0xc7')]=function(_0x923890,_0x5709fa){var _0x535cc9=[_0x6d56('0xc8'),'chat','sms',_0x6d56('0xc9'),_0x6d56('0xca'),_0x6d56('0xcb'),_0x6d56('0xcc')];var _0x42de91={'offset':0x0,'order':qs[_0x6d56('0x7b')]('-createdAt')},_0x52cb74={'count':0x0,'rows':[]};Promise[_0x6d56('0xcd')]()[_0x6d56('0x18')](function(){if(_0x923890[_0x6d56('0x2d')][_0x6d56('0xce')]){if(!_[_0x6d56('0xcf')](_0x535cc9,_0x923890['query']['channel']['toLowerCase']())){throw new Error(_0x6d56('0xd0'));}_0x535cc9=[_0x923890[_0x6d56('0x2d')][_0x6d56('0xce')][_0x6d56('0xd1')]()];}if(_0x923890[_0x6d56('0x2d')][_0x6d56('0xd2')]){try{var _0x2d09d5=JSON[_0x6d56('0xb6')](_0x923890[_0x6d56('0x2d')][_0x6d56('0xd2')]);if(!moment(_0x2d09d5[_0x6d56('0x35')])[_0x6d56('0xd3')]()){throw new Error(_0x6d56('0xd4'));}if(!moment(_0x2d09d5['to'])['isValid']()){throw new Error(_0x6d56('0xd5'));}}catch(_0x12213f){throw new Error('Invalid\x20createdAt\x20filter');}}if(!_0x923890[_0x6d56('0x2d')]['hasOwnProperty'](_0x6d56('0x80'))){_0x42de91[_0x6d56('0x12')]=qs[_0x6d56('0x12')](_0x923890[_0x6d56('0x2d')]['limit']||0xa);_0x42de91[_0x6d56('0x10')]=qs[_0x6d56('0x10')](_0x923890['query'][_0x6d56('0x10')]);}var _0xb45f33=_0x535cc9[_0x6d56('0x6a')](function(_0x535cb5){if(_0x535cb5==='voice'){var _0x8b4ee3={'attributes':['id',_0x6d56('0xd6'),_0x6d56('0x30'),_0x6d56('0xd7'),_0x6d56('0xd8'),_0x6d56('0xd9'),_0x6d56('0xda'),'endtime',_0x6d56('0xdb'),_0x6d56('0xdc'),'createdAt',_0x6d56('0xdd'),_0x6d56('0xde'),_0x6d56('0xdf'),_0x6d56('0xe0')],'where':{'ContactId':_0x923890[_0x6d56('0x24')]['id']},'include':[{'model':db[_0x6d56('0xb8')],'as':_0x6d56('0xb8'),'attributes':['id',_0x6d56('0x1c'),_0x6d56('0xe1'),_0x6d56('0xe2')]}],'order':[[_0x6d56('0xe3'),_0x6d56('0xe4')]]};if(_0x923890[_0x6d56('0x2d')]['range']){_0x8b4ee3['where']['createdAt']={'$gte':_0x2d09d5[_0x6d56('0x35')],'$lte':_0x2d09d5['to']};}return db[_0x6d56('0x47')][_0x6d56('0xe5')](_0x8b4ee3)[_0x6d56('0x18')](function(_0x244ef0){_0x52cb74[_0x6d56('0x13')]+=_0x244ef0['count'];return _[_0x6d56('0x6a')](_0x244ef0[_0x6d56('0x9a')],function(_0x4d2cbe){var _0x2b0d4d=_0x4d2cbe['get']({'plain':!![]});_0x2b0d4d[_0x6d56('0xce')]=_0x535cb5;if(_0x2b0d4d['User']){_0x2b0d4d[_0x6d56('0xb8')]={'id':_0x2b0d4d[_0x6d56('0xb8')]['id'],'name':_0x2b0d4d['User'][_0x6d56('0x1c')],'fullname':_0x2b0d4d[_0x6d56('0xb8')]['fullname'],'alias':_0x2b0d4d[_0x6d56('0xb8')][_0x6d56('0xe2')]};}return _0x2b0d4d;});});}else{var _0x867ec1=_[_0x6d56('0xe6')](_0x535cb5)+(_0x535cb5===_0x6d56('0xe7')?_0x6d56('0xe8'):_0x6d56('0xe9'));var _0x437355={'attributes':['id',_0x6d56('0xea'),'closedAt','createdAt',_0x6d56('0xdc'),_0x6d56('0xeb'),_0x6d56('0xec'),_0x6d56('0xed'),_0x6d56('0xe0'),_0x867ec1+'Id'],'where':{'ContactId':_0x923890[_0x6d56('0x24')]['id']},'include':[{'model':db[_0x867ec1],'as':_0x6d56('0xe9'),'attributes':['id',_0x6d56('0x1c'),'key']},{'model':db[_0x6d56('0xb8')],'as':_0x6d56('0xee'),'attributes':['id',_0x6d56('0x1c'),_0x6d56('0xe1')]},{'model':db[_0x6d56('0x5b')],'as':_0x6d56('0x5c'),'attributes':['id',_0x6d56('0x1c'),_0x6d56('0x5d')],'through':{'attributes':[]}}],'order':[[_0x6d56('0xe3'),'DESC']]};if(_0x923890[_0x6d56('0x2d')][_0x6d56('0xd2')]){_0x437355[_0x6d56('0x54')]['createdAt']={'$gte':_0x2d09d5[_0x6d56('0x35')],'$lte':_0x2d09d5['to']};}switch(_0x535cb5){case _0x6d56('0xe7'):_0x437355['attributes'][_0x6d56('0x59')](_0x6d56('0xef'),_0x6d56('0xf0'),'customerPort',_0x6d56('0xf1'),_0x6d56('0xf2'),_0x6d56('0xf3'),'ratingType','ratingValue',_0x6d56('0xf4'));break;case _0x6d56('0xc8'):_0x437355[_0x6d56('0x78')][_0x6d56('0x59')](_0x6d56('0xf5'),_0x6d56('0xf6'));break;case _0x6d56('0xc9'):_0x437355[_0x6d56('0x78')][_0x6d56('0x59')]('externalUrl',_0x6d56('0xf7'));break;}return db[_[_0x6d56('0xe6')](_0x535cb5)+_0x6d56('0xf8')][_0x6d56('0xe5')](_0x437355)[_0x6d56('0x18')](function(_0x5132be){_0x52cb74[_0x6d56('0x13')]+=_0x5132be[_0x6d56('0x13')];return _[_0x6d56('0x6a')](_0x5132be['rows'],function(_0x577c8d){var _0x1f42ab=_0x577c8d[_0x6d56('0x36')]({'plain':!![]});_0x1f42ab[_0x6d56('0xce')]=_0x535cb5;if(_0x1f42ab['Owner']){_0x1f42ab['Owner']={'id':_0x1f42ab['Owner']['id'],'name':_0x1f42ab[_0x6d56('0xee')][_0x6d56('0x1c')],'fullname':_0x1f42ab['Owner'][_0x6d56('0xe1')]};}return _0x1f42ab;});});}});return Promise[_0x6d56('0x84')](_0xb45f33);})[_0x6d56('0x18')](function(_0x24fb9b){return _(_0x24fb9b)[_0x6d56('0xf9')]()[_0x6d56('0xfa')](_0x6d56('0xe3'))[_0x6d56('0xfb')]()['value']();})[_0x6d56('0x18')](function(_0x1b1002){_0x52cb74['rows']=_0x42de91['limit']?_0x1b1002[_0x6d56('0xfc')](_0x42de91['offset'],_0x42de91['offset']+_0x42de91[_0x6d56('0x12')]):_0x1b1002;return _0x52cb74;})[_0x6d56('0x18')](respondWithFilteredResult(_0x5709fa,_0x42de91))['catch'](handleError(_0x5709fa,null));}; \ No newline at end of file +var _0x26a3=['CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappQueueReport','isNil','dialTimezone','timezones','utcOffset','additionalPhones','each','duplicates','where','$or','push','ListId','spread','contact','all','show','Tags','color','tag','Phones','ItemType','sequelize','literal','Phones.OrderBy','$and','omit','map','format','CmCustomField','pickBy','cf_%d','table','cm_contacts','setFields','id\x20=\x20?','toParam','text','phone','CmHopper','getTags','findOne','rawAttributes','filters','intersection','model','attributes','fields','sort','filter','options','setTags','setAdditionalPhones','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','OrderBy','ContactItemType','`ItemType`.OrderBy','CmHopperId','item','bulkCreate','getAdditionalPhones','duplicateAdditionalPhones','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','nolimit','order','ContactId','include','rows','pick','includeAll','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','binding_values','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','fork','../../components/import/cm/csv','pid','upload','createReadStream','path','parse','meta','import','User','binding','child_process','../../components/import/cm/csv2','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','agent','../../components/import/cm/csvUpdates','stringify','getJourney','chat','sms','fax','voice','resolve','channel','includes','Invalid\x20channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','callerid','starttime','endtime','duration','note','createdAt','userDisposition','UserId','DESC','findAndCountAll','fullname','Website','Account','disposition','secondDisposition','thirdDisposition','key','Owner','Tag','browserName','customerIp','deviceModel','ratingMessage','ratingValue','referer','substatus','openchannel','externalUrl','threadId','startCase','flatten','sortBy','reverse','value','moment','util','lodash','squel','papaparse','ioredis','../../components/contacts','../../config/logger','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','./cmContact.socket','register','json','offset','undefined','limit','count','Content-Range','then','destroy','status','end','sendStatus','error','stack','name','send','index','getOptions','findAll','query','user','catch','CmContact','find','params','describe','tags','length','keys','startsWith','cf_','columnName','displayName','analytics','alias','custom','type','values','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','merge','body','from','get','mergeWith','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal'];(function(_0x210d7f,_0x2abe4f){var _0x42d687=function(_0x46b2ae){while(--_0x46b2ae){_0x210d7f['push'](_0x210d7f['shift']());}};_0x42d687(++_0x2abe4f);}(_0x26a3,0x1a9));var _0x326a=function(_0x3b326a,_0xdd9dc8){_0x3b326a=_0x3b326a-0x0;var _0xd5cf60=_0x26a3[_0x3b326a];return _0xd5cf60;};'use strict';var moment=require(_0x326a('0x0'));var BPromise=require('bluebird');var util=require(_0x326a('0x1'));var path=require('path');var fs=require('fs');var _=require(_0x326a('0x2'));var squel=require(_0x326a('0x3'));var Papa=require(_0x326a('0x4'));var Redis=require(_0x326a('0x5'));var contacts=require(_0x326a('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x326a('0x7'))('api');var config=require(_0x326a('0x8'));var shared=require(_0x326a('0x9'));var db=require(_0x326a('0xa'))['db'];config[_0x326a('0xb')]=_[_0x326a('0xc')](config[_0x326a('0xb')],{'host':_0x326a('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x326a('0xb')]));require(_0x326a('0xe'))[_0x326a('0xf')](socket);function respondWithResult(_0x49e020,_0x106800){_0x106800=_0x106800||0xc8;return function(_0x176002){if(_0x176002){return _0x49e020['status'](_0x106800)[_0x326a('0x10')](_0x176002);}};}function respondWithFilteredResult(_0x5418df,_0x2bfae5){return function(_0x445df8){if(_0x445df8){var _0x55adf2=typeof _0x2bfae5[_0x326a('0x11')]===_0x326a('0x12')&&typeof _0x2bfae5[_0x326a('0x13')]===_0x326a('0x12');var _0x39dbaf=_0x445df8[_0x326a('0x14')];var _0x2293d4=_0x55adf2?0x0:_0x2bfae5[_0x326a('0x11')];var _0x11a386=_0x55adf2?_0x445df8['count']:_0x2bfae5[_0x326a('0x11')]+_0x2bfae5[_0x326a('0x13')];var _0x5afc3c;if(_0x11a386>=_0x39dbaf){_0x11a386=_0x39dbaf;_0x5afc3c=0xc8;}else{_0x5afc3c=0xce;}_0x5418df['status'](_0x5afc3c);return _0x5418df['set'](_0x326a('0x15'),_0x2293d4+'-'+_0x11a386+'/'+_0x39dbaf)[_0x326a('0x10')](_0x445df8);}return null;};}function saveUpdates(_0x42ad5e){return function(_0xe45081){if(_0xe45081){return _0xe45081['update'](_0x42ad5e)[_0x326a('0x16')](function(_0x586f6d){return _0x586f6d;});}return null;};}function removeEntity(_0x183b49){return function(_0x57ff8f){if(_0x57ff8f){return _0x57ff8f[_0x326a('0x17')]()[_0x326a('0x16')](function(){_0x183b49[_0x326a('0x18')](0xcc)[_0x326a('0x19')]();});}};}function handleEntityNotFound(_0x2d9ed8){return function(_0x4a0dc7){if(!_0x4a0dc7){_0x2d9ed8[_0x326a('0x1a')](0x194);}return _0x4a0dc7;};}function handleError(_0x425dd0,_0x2ec639){_0x2ec639=_0x2ec639||0x1f4;return function(_0x40d5de){logger[_0x326a('0x1b')](_0x40d5de[_0x326a('0x1c')]);if(_0x40d5de[_0x326a('0x1d')]){delete _0x40d5de[_0x326a('0x1d')];}_0x425dd0[_0x326a('0x18')](_0x2ec639)[_0x326a('0x1e')](_0x40d5de);};}exports[_0x326a('0x1f')]=function(_0x3536db,_0x3a4f04){var _0x188ba3={};return contacts['describe']()['then'](function(_0x4de804){_0x188ba3=qs[_0x326a('0x20')](_0x4de804,_0x3536db);return contacts[_0x326a('0x21')](_0x3536db[_0x326a('0x22')],_0x3536db[_0x326a('0x23')],_0x188ba3,_0x4de804);})['then'](respondWithFilteredResult(_0x3a4f04,_0x188ba3))[_0x326a('0x24')](handleError(_0x3a4f04,null));};exports[_0x326a('0x17')]=function(_0x544d13,_0x4198f4){return db[_0x326a('0x25')][_0x326a('0x26')]({'where':{'id':_0x544d13[_0x326a('0x27')]['id']}})[_0x326a('0x16')](handleEntityNotFound(_0x4198f4,null))[_0x326a('0x16')](removeEntity(_0x4198f4,null))[_0x326a('0x24')](handleError(_0x4198f4,null));};exports['describe']=function(_0x2571ab,_0x14dd6a){return db['CmContact'][_0x326a('0x28')]()['then'](function(_0x5825e7){delete _0x5825e7[_0x326a('0x29')];for(var _0x494285=0x0;_0x4942850x0){return new Promise(function(_0x116b88){var _0x1c416=[];for(var _0x1ab974=0x0;_0x1ab974<_0x5ac582[_0x326a('0x2a')];_0x1ab974++){_0x1c416[_0x326a('0x63')](insertAdditionalPhones(_0x5ac582[_0x1ab974][_0x326a('0x66')],_0x5ac582[_0x1ab974][_0x326a('0x5e')]));}Promise[_0x326a('0x67')](_0x1c416)[_0x326a('0x16')](function(){_0x116b88(0x1);});})[_0x326a('0x16')](function(){return{'success':_0x2f692e,'failure':_0x31683c,'duplicates':_0xb0270d};});}else{return{'success':_0x2f692e,'failure':_0x31683c,'duplicates':_0xb0270d};}}})[_0x326a('0x16')](respondWithResult(_0x441da3,0xc9))[_0x326a('0x24')](handleError(_0x441da3,null));};exports[_0x326a('0x68')]=function(_0x1c7558,_0x1c8df3){var _0x30185a;return db[_0x326a('0x25')][_0x326a('0x28')]()[_0x326a('0x16')](function(_0x53ae8a){return db[_0x326a('0x25')]['find']({'where':{'id':_0x1c7558[_0x326a('0x27')]['id']},'include':[{'model':db['Tag'],'as':_0x326a('0x69'),'attributes':['id',_0x326a('0x1d'),_0x326a('0x6a')],'required':_0x1c7558['query'][_0x326a('0x6b')]?!![]:![]},{'model':db[_0x326a('0x4f')],'as':_0x326a('0x6c'),'where':{'CmContactId':_0x1c7558[_0x326a('0x27')]['id']},'required':![],'include':[{'model':db['ContactItemType'],'as':_0x326a('0x6d')}]}],'order':[db[_0x326a('0x6e')][_0x326a('0x6f')](_0x326a('0x70'))],'attributes':_[_0x326a('0x2b')](_0x53ae8a)});})[_0x326a('0x16')](function(_0x52992a){if(!_[_0x326a('0x5a')](_0x52992a)){_0x30185a=_0x52992a['get']({'plain':!![]});var _0x5cec9d={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x52992a&&_0x52992a[_0x326a('0x64')]){if(_0x52992a[_0x326a('0x64')]){_0x5cec9d[_0x326a('0x61')][_0x326a('0x71')][_0x326a('0x63')]({'ListId':{'$ne':_0x52992a[_0x326a('0x64')]}});}}return db['CmCustomField'][_0x326a('0x21')](_0x5cec9d);}})['then'](function(_0x293cce){if(!_[_0x326a('0x5a')](_0x293cce)){return _[_0x326a('0x72')](_0x30185a,_[_0x326a('0x73')](_0x293cce,function(_0x3e75b6){return util[_0x326a('0x74')]('cf_%d',_0x3e75b6['id']);}));}})['then'](handleEntityNotFound(_0x1c8df3,null))[_0x326a('0x16')](respondWithResult(_0x1c8df3,null))[_0x326a('0x24')](handleError(_0x1c8df3,null));};exports['update']=function(_0x4c1523,_0x2fe784){var _0x13f8c6;if(_0x4c1523[_0x326a('0x39')]['id']){delete _0x4c1523[_0x326a('0x39')]['id'];}if(!_[_0x326a('0x5a')](_0x4c1523[_0x326a('0x39')][_0x326a('0x5b')])){var _0x3dc45e=_0x4c1523[_0x326a('0x39')][_0x326a('0x5b')];if(!_[_0x326a('0x5a')](shared[_0x326a('0x5c')][_0x3dc45e]))_0x4c1523[_0x326a('0x39')][_0x326a('0x5d')]=shared['timezones'][_0x3dc45e]['utcOffset'];}return db['CmContact'][_0x326a('0x26')]({'where':{'id':_0x4c1523[_0x326a('0x27')]['id']}})['then'](handleEntityNotFound(_0x2fe784,null))[_0x326a('0x16')](saveUpdates(_0x4c1523[_0x326a('0x39')],null))[_0x326a('0x16')](function(_0x36815b){_0x13f8c6=_0x36815b;var _0x7ee4fd={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x36815b&&_0x36815b['ListId']){if(_0x36815b['ListId']){_0x7ee4fd['where'][_0x326a('0x71')]['push']({'ListId':{'$ne':_0x36815b['ListId']}});}}return db[_0x326a('0x75')][_0x326a('0x21')](_0x7ee4fd);})['then'](function(_0x2994ab){if(_0x2994ab){return _[_0x326a('0x72')](_[_0x326a('0x76')](_0x4c1523[_0x326a('0x39')],function(_0x1ebd49,_0x40f09b){return _[_0x326a('0x2c')](_0x40f09b,_0x326a('0x2d'));}),_['map'](_0x2994ab,function(_0x153c8d){return util[_0x326a('0x74')](_0x326a('0x77'),_0x153c8d['id']);}));}})['then'](function(_0x32c2e4){if(_0x32c2e4&&!_['isEmpty'](_0x32c2e4)){var _0x2288fe=squel['update']()[_0x326a('0x78')](_0x326a('0x79'))[_0x326a('0x7a')](_0x32c2e4)['where'](_0x326a('0x7b'),_0x4c1523[_0x326a('0x27')]['id'])[_0x326a('0x7c')]();return db['sequelize']['query'](_0x2288fe[_0x326a('0x7d')],{'replacements':_0x2288fe[_0x326a('0x34')]});}})['then'](function(){if(_0x4c1523[_0x326a('0x39')][_0x326a('0x7e')]&&_0x13f8c6){return db[_0x326a('0x7f')][_0x326a('0x45')]({'phone':_0x4c1523[_0x326a('0x39')][_0x326a('0x7e')],'OrderBy':0x0},{'where':{'ContactId':_0x13f8c6['id']}});}})[_0x326a('0x16')](function(){return _0x13f8c6;})[_0x326a('0x16')](respondWithResult(_0x2fe784,null))['catch'](handleError(_0x2fe784,null));};exports[_0x326a('0x80')]=function(_0x1ead0e,_0x1f4fad){var _0xffb1ac={};var _0x3b0346={};var _0x480df8;var _0x1e5c59;return db[_0x326a('0x25')][_0x326a('0x81')]({'where':{'id':_0x1ead0e[_0x326a('0x27')]['id']}})[_0x326a('0x16')](handleEntityNotFound(_0x1f4fad,null))[_0x326a('0x16')](function(_0x2c77f0){if(_0x2c77f0){_0x480df8=_0x2c77f0;_0x3b0346['model']=_[_0x326a('0x2b')](db['Tag'][_0x326a('0x82')]);_0x3b0346[_0x326a('0x22')]=_[_0x326a('0x2b')](_0x1ead0e[_0x326a('0x22')]);_0x3b0346[_0x326a('0x83')]=_[_0x326a('0x84')](_0x3b0346[_0x326a('0x85')],_0x3b0346[_0x326a('0x22')]);_0xffb1ac[_0x326a('0x86')]=_[_0x326a('0x84')](_0x3b0346[_0x326a('0x85')],qs[_0x326a('0x87')](_0x1ead0e[_0x326a('0x22')][_0x326a('0x87')]));_0xffb1ac[_0x326a('0x86')]=_0xffb1ac[_0x326a('0x86')][_0x326a('0x2a')]?_0xffb1ac['attributes']:_0x3b0346[_0x326a('0x85')];_0xffb1ac['order']=qs[_0x326a('0x88')](_0x1ead0e[_0x326a('0x22')][_0x326a('0x88')]);_0xffb1ac[_0x326a('0x61')]=qs[_0x326a('0x83')](_['pick'](_0x1ead0e[_0x326a('0x22')],_0x3b0346[_0x326a('0x83')]));if(_0x1ead0e[_0x326a('0x22')][_0x326a('0x89')]){_0xffb1ac['where']=_[_0x326a('0x38')](_0xffb1ac[_0x326a('0x61')],{'$or':_['map'](_0xffb1ac[_0x326a('0x86')],function(_0x2b9014){var _0x3158c0={};_0x3158c0[_0x2b9014]={'$like':'%'+_0x1ead0e[_0x326a('0x22')][_0x326a('0x89')]+'%'};return _0x3158c0;})});}_0xffb1ac=_[_0x326a('0x38')]({},_0xffb1ac,_0x1ead0e[_0x326a('0x8a')]);return _0x480df8[_0x326a('0x80')](_0xffb1ac);}})[_0x326a('0x16')](function(_0x1c4b7a){if(_0x1c4b7a){_0x1e5c59=_0x1c4b7a[_0x326a('0x2a')];if(!_0x1ead0e[_0x326a('0x22')][_0x326a('0x37')]('nolimit')){_0xffb1ac[_0x326a('0x13')]=qs[_0x326a('0x13')](_0x1ead0e[_0x326a('0x22')]['limit']);_0xffb1ac[_0x326a('0x11')]=qs[_0x326a('0x11')](_0x1ead0e[_0x326a('0x22')][_0x326a('0x11')]);}return _0x480df8[_0x326a('0x80')](_0xffb1ac);}})[_0x326a('0x16')](function(_0x547d14){if(_0x547d14){return _0x547d14?{'count':_0x1e5c59,'rows':_0x547d14}:null;}})['then'](respondWithResult(_0x1f4fad,null))['catch'](handleError(_0x1f4fad,null));};exports[_0x326a('0x8b')]=function(_0x39d56f,_0x5728dc){if(_0x39d56f[_0x326a('0x39')]['id']){delete _0x39d56f[_0x326a('0x39')]['id'];}return db['CmContact'][_0x326a('0x81')]({'where':{'id':_0x39d56f[_0x326a('0x27')]['id']}})[_0x326a('0x16')](handleEntityNotFound(_0x5728dc,null))[_0x326a('0x16')](function(_0x1c767e){if(_0x1c767e){return _0x1c767e[_0x326a('0x8b')](_0x39d56f[_0x326a('0x39')]['ids']||[]);}return null;})[_0x326a('0x16')](respondWithResult(_0x5728dc,null))[_0x326a('0x24')](handleError(_0x5728dc,null));};exports[_0x326a('0x8c')]=function(_0x43fda1,_0x53fff8){var _0x5ac5e8=[];_0x5ac5e8['push'](addAdditionalPhones(_0x43fda1['body']));Promise['all'](_0x5ac5e8)[_0x326a('0x16')](function(){_0x5ac5e8=[];_0x5ac5e8['push'](deleteCmHopperPhones(_0x43fda1[_0x326a('0x39')]['id']));_0x5ac5e8[_0x326a('0x63')](addCmHopperPhones(_0x43fda1[_0x326a('0x39')]['id']));Promise[_0x326a('0x67')](_0x5ac5e8)[_0x326a('0x16')](function(){return[0x1];})[_0x326a('0x16')](respondWithResult(_0x53fff8,null));});};function addAdditionalPhones(_0x34ad5){var _0x108556;return new Promise(function(_0x5b49ae){return db[_0x326a('0x4f')]['destroy']({'where':{'CmContactId':_0x34ad5['id']}})['then'](function(){db['ContactItemType'][_0x326a('0x21')]({'raw':!![],'attributes':['id','OrderBy']})[_0x326a('0x16')](function(_0x18563c){var _0x41caac=[];for(var _0x396ebb=0x0;_0x396ebb<_0x34ad5[_0x326a('0x8d')]['length'];_0x396ebb++){var _0x2d4fc4=_0x34ad5[_0x326a('0x8e')]?_['isNil'](_0x34ad5['item_types'][_0x396ebb])?'':_0x34ad5[_0x326a('0x8e')][_0x396ebb]:_0x34ad5[_0x326a('0x8d')][_0x396ebb][_0x326a('0x8f')]?_0x34ad5[_0x326a('0x8d')][_0x396ebb]['ItemTypeId']:'';var _0x33d5f0=_[_0x326a('0x5a')](_0x34ad5['items'][_0x396ebb][_0x326a('0x90')])?'':_0x34ad5[_0x326a('0x8d')][_0x396ebb][_0x326a('0x90')];var _0x56c0dd=_0x2d4fc4+':'+_0x34ad5['items'][_0x396ebb][_0x326a('0x7e')]+'§'+_0x33d5f0;if(_[_0x326a('0x5a')](_0x108556))_0x108556=_0x56c0dd;else _0x108556+=';'+_0x56c0dd;var _0x387d6a=null;var _0x589616=null;if(_0x34ad5['item_types']){if(!_[_0x326a('0x5a')](_0x34ad5[_0x326a('0x8e')][_0x396ebb])){_0x589616=_[_0x326a('0x26')](_0x18563c,function(_0x4d5ebc){return _0x4d5ebc['id']===_0x34ad5[_0x326a('0x8e')][_0x396ebb];});if(!_[_0x326a('0x5a')](_0x589616)){_0x387d6a=_0x589616['OrderBy'];}}}else{if(!_[_0x326a('0x5a')](_0x34ad5[_0x326a('0x8d')][_0x396ebb])){_0x589616=_['find'](_0x18563c,function(_0x3d6998){return _0x3d6998['id']===_0x34ad5['items'][_0x396ebb][_0x326a('0x8f')];});if(!_[_0x326a('0x5a')](_0x589616)){_0x387d6a=_0x396ebb;}}}if(_['isNil'](_0x387d6a)){_0x387d6a=0x64;}_0x41caac[_0x326a('0x63')](addAdditionalPhone(_0x34ad5['id'],_0x34ad5[_0x326a('0x8d')][_0x396ebb]['phone'],_0x34ad5[_0x326a('0x8e')]?_['isNil'](_0x34ad5['item_types'][_0x396ebb])?null:_0x34ad5[_0x326a('0x8e')][_0x396ebb]:_0x34ad5[_0x326a('0x8d')][_0x396ebb]['ItemTypeId']?_0x34ad5[_0x326a('0x8d')][_0x396ebb]['ItemTypeId']:null,_0x387d6a,_0x33d5f0));}Promise[_0x326a('0x67')](_0x41caac)[_0x326a('0x16')](function(){db[_0x326a('0x25')][_0x326a('0x45')]({'AdditionalPhones':_0x108556},{'where':{'id':_0x34ad5['id']}})[_0x326a('0x16')](function(){_0x5b49ae(0x1);});});});});});}function addAdditionalPhone(_0x56f588,_0x1509cb,_0x3975d4,_0x149f9f,_0x1cb482){return db[_0x326a('0x4f')][_0x326a('0x26')]({'where':{'CmContactId':_0x56f588,'item':_0x1509cb}})[_0x326a('0x16')](function(_0x21f134){if(_0x21f134)logger[_0x326a('0x3f')](_0x326a('0x91'),_0x21f134);else{db[_0x326a('0x4f')][_0x326a('0x43')]({'CmContactId':_0x56f588,'item':_0x1509cb,'ItemTypeId':_0x3975d4,'OrderBy':_0x149f9f,'ItemClass':_0x326a('0x92'),'description':_0x1cb482});}});}function deleteCmHopperPhones(_0x3d3145){return new Promise(function(_0x43f419){return db['CmHopper'][_0x326a('0x21')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x3d3145}})['then'](function(_0x4bc8ab){db['CmHopperAdditionalPhone'][_0x326a('0x17')]({'where':{'CmHopperId':{'$in':_['map'](_0x4bc8ab,'id')}}});})[_0x326a('0x16')](function(){_0x43f419(0x1);});});}function addCmHopperPhones(_0x90bc64){return new Promise(function(_0x12f247){return db[_0x326a('0x7f')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x90bc64}})[_0x326a('0x16')](function(_0x895d3b){var _0x181599=[];_[_0x326a('0x73')](_0x895d3b,function(_0x1105d9){_0x181599[_0x326a('0x63')](createCmHopperPhone(_0x90bc64,_0x1105d9['id']));});Promise[_0x326a('0x67')](_0x181599)[_0x326a('0x16')](function(){_0x12f247(0x1);});});});}function createCmHopperPhone(_0xcbd73,_0x4214ed){return new Promise(function(_0x5163bd){db[_0x326a('0x4f')][_0x326a('0x21')]({'raw':!![],'attributes':['item',_0x326a('0x93')],'where':{'CmContactId':_0xcbd73,'ItemClass':_0x326a('0x92')},'include':[{'model':db[_0x326a('0x94')],'attributes':[_0x326a('0x93')],'as':_0x326a('0x6d')}],'order':['OrderBy',db[_0x326a('0x6e')]['literal'](_0x326a('0x95'))]})[_0x326a('0x16')](function(_0x27aded){var _0x37729f=0x1;var _0x1c4781=_[_0x326a('0x73')](_0x27aded,function(_0x27ba1c){_0x27ba1c[_0x326a('0x96')]=_0x4214ed;_0x27ba1c[_0x326a('0x7e')]=_0x27ba1c[_0x326a('0x97')];_0x27ba1c[_0x326a('0x93')]=_0x37729f;delete _0x27ba1c['ItemType.OrderBy'];_0x37729f=_0x37729f+0x1;return _0x27ba1c;});return db['CmHopperAdditionalPhone'][_0x326a('0x98')](_0x1c4781,{});})[_0x326a('0x16')](function(){_0x5163bd(0x1);});});}function insertAdditionalPhones(_0x4810c7,_0x5b099a){return new Promise(function(_0x286a80){var _0x5c3a98=[];for(var _0x440dcf=0x0;_0x440dcf<_0x5b099a[_0x326a('0x2a')];_0x440dcf++){var _0x5c2cc2=_0x5b099a[_0x440dcf];_0x5c3a98[_0x326a('0x63')](parseContactItemType(_0x5c2cc2));}Promise['all'](_0x5c3a98)[_0x326a('0x16')](function(){var _0x4b1e13={'id':_0x4810c7['id'],'items':_0x5b099a};return addAdditionalPhones(_0x4b1e13)[_0x326a('0x16')](function(){return addCmHopperPhones(_0x4810c7['id']);});})['then'](function(){_0x286a80(_0x4810c7);});});}function parseContactItemType(_0x423791){return new Promise(function(_0x422063){if(_0x423791[_0x326a('0x37')](_0x326a('0x8f'))){_0x422063(_0x423791);}else{return db[_0x326a('0x94')][_0x326a('0x26')]({'where':{'name':_0x423791[_0x326a('0x6d')]}})[_0x326a('0x16')](function(_0x339fb1){if(_[_0x326a('0x5a')](_0x339fb1))_0x423791['ItemTypeId']=null;else _0x423791['ItemTypeId']=_0x339fb1['id'];_0x422063(_0x423791);});}});}exports[_0x326a('0x99')]=function(_0x4c5277,_0x52c352){return db['CmContactHasItem']['findAll']({'raw':!![],'where':{'CmContactId':_0x4c5277[_0x326a('0x27')]['id'],'ItemClass':_0x326a('0x92')},'include':[{'model':db[_0x326a('0x94')],'as':_0x326a('0x6d')}],'order':[[_0x326a('0x93')],[db['sequelize']['literal'](_0x326a('0x95'))]]})[_0x326a('0x16')](function(_0x1d0d3f){return _0x1d0d3f;})['then'](respondWithResult(_0x52c352,null))[_0x326a('0x24')](handleError(_0x52c352,null));};exports[_0x326a('0x9a')]=function(_0x1b74d2,_0x52a3a5){return db[_0x326a('0x4f')]['findAll']({'raw':!![],'where':{'CmContactId':_0x1b74d2[_0x326a('0x39')]['fromContactId']}})[_0x326a('0x16')](function(_0x12dc5a){var _0x57bdde=_[_0x326a('0x73')](_0x12dc5a,function(_0x575616){_0x575616['CmContactId']=_0x1b74d2[_0x326a('0x39')]['toContactId'];return _0x575616;});return db['CmContactHasItem'][_0x326a('0x98')](_0x57bdde,{});})[_0x326a('0x16')](function(){return addCmHopperPhones(_0x1b74d2[_0x326a('0x39')][_0x326a('0x9b')]);})[_0x326a('0x16')](function(){return['ok'];})[_0x326a('0x16')](respondWithResult(_0x52a3a5,null))[_0x326a('0x24')](handleError(_0x52a3a5,null));};exports[_0x326a('0x9c')]=function(_0x5e9a21,_0x4cfba2){var _0xab2481=[];_0xab2481[_0x326a('0x63')](createCmHopperPhone(_0x5e9a21['body']['id'],_0x5e9a21['body'][_0x326a('0x9d')]));Promise['all'](_0xab2481)[_0x326a('0x16')](function(){return[0x1];})[_0x326a('0x16')](respondWithResult(_0x4cfba2,null));};exports[_0x326a('0x9e')]=function(_0x122f3,_0x38d945){var _0x1a88a2={'raw':![],'where':{}};var _0x4cb84c={};var _0x289bce={'count':0x0,'rows':[]};return db['CmContact'][_0x326a('0x81')]({'where':{'id':_0x122f3[_0x326a('0x27')]['id']}})[_0x326a('0x16')](handleEntityNotFound(_0x38d945,null))['then'](function(_0x5c1309){if(_0x5c1309){_0x4cb84c[_0x326a('0x85')]=_[_0x326a('0x2b')](db[_0x326a('0x7f')]['rawAttributes']);_0x4cb84c['query']=_['keys'](_0x122f3['query']);_0x4cb84c[_0x326a('0x83')]=_[_0x326a('0x84')](_0x4cb84c['model'],_0x4cb84c['query']);_0x1a88a2[_0x326a('0x86')]=_['intersection'](_0x4cb84c[_0x326a('0x85')],qs[_0x326a('0x87')](_0x122f3[_0x326a('0x22')][_0x326a('0x87')]));_0x1a88a2[_0x326a('0x86')]=_0x1a88a2[_0x326a('0x86')][_0x326a('0x2a')]?_0x1a88a2[_0x326a('0x86')]:_0x4cb84c['model'];if(!_0x122f3[_0x326a('0x22')][_0x326a('0x37')](_0x326a('0x9f'))){_0x1a88a2[_0x326a('0x13')]=qs[_0x326a('0x13')](_0x122f3[_0x326a('0x22')][_0x326a('0x13')]);_0x1a88a2[_0x326a('0x11')]=qs['offset'](_0x122f3[_0x326a('0x22')][_0x326a('0x11')]);}_0x1a88a2[_0x326a('0xa0')]=qs['sort'](_0x122f3[_0x326a('0x22')]['sort']);_0x1a88a2[_0x326a('0x61')]=qs[_0x326a('0x83')](_['pick'](_0x122f3[_0x326a('0x22')],_0x4cb84c[_0x326a('0x83')]));_0x1a88a2[_0x326a('0x61')][_0x326a('0xa1')]=_0x5c1309['id'];if(_0x122f3['query'][_0x326a('0x89')]){_0x1a88a2['where']=_[_0x326a('0x38')](_0x1a88a2[_0x326a('0x61')],{'$or':_[_0x326a('0x73')](_0x1a88a2[_0x326a('0x86')],function(_0x5920d2){var _0x4eae47={};_0x4eae47[_0x5920d2]={'$like':'%'+_0x122f3['query'][_0x326a('0x89')]+'%'};return _0x4eae47;})});}_0x1a88a2=_['merge']({},_0x1a88a2,_0x122f3['options']);return db[_0x326a('0x7f')][_0x326a('0x14')]({'where':_0x1a88a2[_0x326a('0x61')]})[_0x326a('0x16')](function(_0x4ab07d){_0x289bce[_0x326a('0x14')]=_0x4ab07d;if(_0x122f3['query']['includeAll']){_0x1a88a2[_0x326a('0xa2')]=[{'all':!![]}];}return db[_0x326a('0x7f')]['findAll'](_0x1a88a2);})[_0x326a('0x16')](function(_0x20acf5){_0x289bce[_0x326a('0xa3')]=_0x20acf5;return _0x289bce;});}})[_0x326a('0x16')](respondWithFilteredResult(_0x38d945,_0x1a88a2))[_0x326a('0x24')](handleError(_0x38d945,null));};exports['getHopperHistories']=function(_0x3e2ee7,_0x20f2bd){var _0x1e7012={'raw':!![],'where':{}};var _0x244c81={};var _0x26d1b6={'count':0x0,'rows':[]};return db[_0x326a('0x25')][_0x326a('0x81')]({'where':{'id':_0x3e2ee7[_0x326a('0x27')]['id']}})[_0x326a('0x16')](handleEntityNotFound(_0x20f2bd,null))[_0x326a('0x16')](function(_0x23d2c1){if(_0x23d2c1){_0x244c81[_0x326a('0x85')]=_[_0x326a('0x2b')](db[_0x326a('0x51')][_0x326a('0x82')]);_0x244c81['query']=_['keys'](_0x3e2ee7['query']);_0x244c81[_0x326a('0x83')]=_[_0x326a('0x84')](_0x244c81['model'],_0x244c81[_0x326a('0x22')]);_0x1e7012[_0x326a('0x86')]=_['intersection'](_0x244c81[_0x326a('0x85')],qs[_0x326a('0x87')](_0x3e2ee7['query'][_0x326a('0x87')]));_0x1e7012[_0x326a('0x86')]=_0x1e7012['attributes'][_0x326a('0x2a')]?_0x1e7012[_0x326a('0x86')]:_0x244c81['model'];if(!_0x3e2ee7[_0x326a('0x22')][_0x326a('0x37')](_0x326a('0x9f'))){_0x1e7012[_0x326a('0x13')]=qs[_0x326a('0x13')](_0x3e2ee7[_0x326a('0x22')][_0x326a('0x13')]);_0x1e7012[_0x326a('0x11')]=qs[_0x326a('0x11')](_0x3e2ee7[_0x326a('0x22')][_0x326a('0x11')]);}_0x1e7012[_0x326a('0xa0')]=qs[_0x326a('0x88')](_0x3e2ee7[_0x326a('0x22')]['sort']);_0x1e7012['where']=qs['filters'](_[_0x326a('0xa4')](_0x3e2ee7[_0x326a('0x22')],_0x244c81[_0x326a('0x83')]));_0x1e7012['where'][_0x326a('0xa1')]=_0x23d2c1['id'];if(_0x3e2ee7['query'][_0x326a('0x89')]){_0x1e7012[_0x326a('0x61')]=_[_0x326a('0x38')](_0x1e7012[_0x326a('0x61')],{'$or':_[_0x326a('0x73')](_0x1e7012[_0x326a('0x86')],function(_0x2ce018){var _0x5415a7={};_0x5415a7[_0x2ce018]={'$like':'%'+_0x3e2ee7[_0x326a('0x22')][_0x326a('0x89')]+'%'};return _0x5415a7;})});}_0x1e7012=_['merge']({},_0x1e7012,_0x3e2ee7[_0x326a('0x8a')]);return db[_0x326a('0x51')][_0x326a('0x14')]({'where':_0x1e7012['where']})[_0x326a('0x16')](function(_0xb862e2){_0x26d1b6[_0x326a('0x14')]=_0xb862e2;if(_0x3e2ee7[_0x326a('0x22')][_0x326a('0xa5')]){_0x1e7012[_0x326a('0xa2')]=[{'all':!![]}];}return db[_0x326a('0x51')][_0x326a('0x21')](_0x1e7012);})[_0x326a('0x16')](function(_0x2f3247){_0x26d1b6[_0x326a('0xa3')]=_0x2f3247;return _0x26d1b6;});}})[_0x326a('0x16')](respondWithFilteredResult(_0x20f2bd,_0x1e7012))[_0x326a('0x24')](handleError(_0x20f2bd,null));};exports['getHopperFinals']=function(_0xedf057,_0x44a229){var _0x2444c8={'raw':!![],'where':{}};var _0x173d16={};var _0x235003={'count':0x0,'rows':[]};return db['CmContact'][_0x326a('0x81')]({'where':{'id':_0xedf057[_0x326a('0x27')]['id']}})[_0x326a('0x16')](handleEntityNotFound(_0x44a229,null))[_0x326a('0x16')](function(_0x516ba9){if(_0x516ba9){_0x173d16[_0x326a('0x85')]=_['keys'](db[_0x326a('0x50')]['rawAttributes']);_0x173d16['query']=_[_0x326a('0x2b')](_0xedf057[_0x326a('0x22')]);_0x173d16[_0x326a('0x83')]=_[_0x326a('0x84')](_0x173d16[_0x326a('0x85')],_0x173d16[_0x326a('0x22')]);_0x2444c8[_0x326a('0x86')]=_[_0x326a('0x84')](_0x173d16['model'],qs[_0x326a('0x87')](_0xedf057[_0x326a('0x22')][_0x326a('0x87')]));_0x2444c8[_0x326a('0x86')]=_0x2444c8[_0x326a('0x86')][_0x326a('0x2a')]?_0x2444c8[_0x326a('0x86')]:_0x173d16[_0x326a('0x85')];if(!_0xedf057[_0x326a('0x22')][_0x326a('0x37')]('nolimit')){_0x2444c8[_0x326a('0x13')]=qs[_0x326a('0x13')](_0xedf057['query'][_0x326a('0x13')]);_0x2444c8[_0x326a('0x11')]=qs[_0x326a('0x11')](_0xedf057[_0x326a('0x22')][_0x326a('0x11')]);}_0x2444c8[_0x326a('0xa0')]=qs[_0x326a('0x88')](_0xedf057[_0x326a('0x22')][_0x326a('0x88')]);_0x2444c8[_0x326a('0x61')]=qs[_0x326a('0x83')](_['pick'](_0xedf057[_0x326a('0x22')],_0x173d16[_0x326a('0x83')]));_0x2444c8['where'][_0x326a('0xa1')]=_0x516ba9['id'];if(_0xedf057[_0x326a('0x22')][_0x326a('0x89')]){_0x2444c8[_0x326a('0x61')]=_['merge'](_0x2444c8['where'],{'$or':_[_0x326a('0x73')](_0x2444c8[_0x326a('0x86')],function(_0xdc73a5){var _0x5687f6={};_0x5687f6[_0xdc73a5]={'$like':'%'+_0xedf057[_0x326a('0x22')][_0x326a('0x89')]+'%'};return _0x5687f6;})});}_0x2444c8=_[_0x326a('0x38')]({},_0x2444c8,_0xedf057['options']);return db['CmHopperFinal'][_0x326a('0x14')]({'where':_0x2444c8[_0x326a('0x61')]})[_0x326a('0x16')](function(_0x254160){_0x235003[_0x326a('0x14')]=_0x254160;if(_0xedf057[_0x326a('0x22')][_0x326a('0xa5')]){_0x2444c8['include']=[{'all':!![]}];}return db[_0x326a('0x50')][_0x326a('0x21')](_0x2444c8);})['then'](function(_0x54d125){_0x235003[_0x326a('0xa3')]=_0x54d125;return _0x235003;});}})[_0x326a('0x16')](respondWithFilteredResult(_0x44a229,_0x2444c8))[_0x326a('0x24')](handleError(_0x44a229,null));};exports['getJscriptySessions']=function(_0x4093fe,_0x47da66){var _0x3789f4={'raw':!![],'where':{}};var _0x1ab0d5={};var _0x1875e7={'count':0x0,'rows':[]};return db[_0x326a('0x25')][_0x326a('0x81')]({'where':{'id':_0x4093fe[_0x326a('0x27')]['id']}})[_0x326a('0x16')](handleEntityNotFound(_0x47da66,null))[_0x326a('0x16')](function(_0x324249){if(_0x324249){_0x1ab0d5[_0x326a('0x85')]=_['keys'](db[_0x326a('0x58')]['rawAttributes']);_0x1ab0d5[_0x326a('0x22')]=_['keys'](_0x4093fe[_0x326a('0x22')]);_0x1ab0d5[_0x326a('0x83')]=_[_0x326a('0x84')](_0x1ab0d5[_0x326a('0x85')],_0x1ab0d5[_0x326a('0x22')]);_0x3789f4['attributes']=_[_0x326a('0x84')](_0x1ab0d5[_0x326a('0x85')],qs['fields'](_0x4093fe[_0x326a('0x22')][_0x326a('0x87')]));_0x3789f4[_0x326a('0x86')]=_0x3789f4[_0x326a('0x86')][_0x326a('0x2a')]?_0x3789f4[_0x326a('0x86')]:_0x1ab0d5[_0x326a('0x85')];if(!_0x4093fe[_0x326a('0x22')]['hasOwnProperty'](_0x326a('0x9f'))){_0x3789f4[_0x326a('0x13')]=qs['limit'](_0x4093fe[_0x326a('0x22')][_0x326a('0x13')]);_0x3789f4[_0x326a('0x11')]=qs[_0x326a('0x11')](_0x4093fe['query'][_0x326a('0x11')]);}_0x3789f4['order']=qs[_0x326a('0x88')](_0x4093fe[_0x326a('0x22')]['sort']);_0x3789f4[_0x326a('0x61')]=qs['filters'](_['pick'](_0x4093fe[_0x326a('0x22')],_0x1ab0d5['filters']));_0x3789f4[_0x326a('0x61')][_0x326a('0xa1')]=_0x324249['id'];if(_0x4093fe[_0x326a('0x22')]['filter']){_0x3789f4[_0x326a('0x61')]=_[_0x326a('0x38')](_0x3789f4[_0x326a('0x61')],{'$or':_[_0x326a('0x73')](_0x3789f4[_0x326a('0x86')],function(_0x2e888e){var _0x16f9ee={};_0x16f9ee[_0x2e888e]={'$like':'%'+_0x4093fe['query']['filter']+'%'};return _0x16f9ee;})});}_0x3789f4=_[_0x326a('0x38')]({},_0x3789f4,_0x4093fe[_0x326a('0x8a')]);return db[_0x326a('0x58')][_0x326a('0x14')]({'where':_0x3789f4[_0x326a('0x61')]})[_0x326a('0x16')](function(_0xff9858){_0x1875e7['count']=_0xff9858;if(_0x4093fe[_0x326a('0x22')]['includeAll']){_0x3789f4[_0x326a('0xa2')]=[{'all':!![]}];}return db[_0x326a('0x58')][_0x326a('0x21')](_0x3789f4);})[_0x326a('0x16')](function(_0x383d20){_0x1875e7[_0x326a('0xa3')]=_0x383d20;return _0x1875e7;});}})[_0x326a('0x16')](respondWithFilteredResult(_0x47da66,_0x3789f4))[_0x326a('0x24')](handleError(_0x47da66,null));};exports[_0x326a('0xa6')]=function(_0x3c486e,_0x3518d3){try{if(!_0x3c486e[_0x326a('0x39')][_0x326a('0x64')]){throw new Error(_0x326a('0xa7'));}if(!_0x3c486e[_0x326a('0x39')][_0x326a('0xa8')]){throw new Error('No\x20association\x20keys\x20specified!');}if(!_0x3c486e[_0x326a('0x39')]['binding_values']){throw new Error(_0x326a('0xa9'));}if(!_0x3c486e[_0x326a('0x39')][_0x326a('0xaa')]){throw new Error(_0x326a('0xab'));}var _0x14e9c1=_0x3c486e[_0x326a('0x39')][_0x326a('0xa8')][_0x326a('0xac')](',');var _0x7817ff=_0x3c486e['body'][_0x326a('0xad')][_0x326a('0xac')](',');if(!_0x14e9c1['length']||!_0x7817ff[_0x326a('0x2a')]||_0x14e9c1['length']!==_0x7817ff[_0x326a('0x2a')]){throw new Error(_0x326a('0xae'));}_0x3c486e[_0x326a('0x39')][_0x326a('0x87')]=_['zipObject'](_0x14e9c1,_0x7817ff);if(!_0x3c486e[_0x326a('0x39')]['fields']['phone']){throw new Error(_0x326a('0xaf'));}if(!_0x3c486e[_0x326a('0x39')][_0x326a('0x87')][_0x326a('0xb0')]){throw new Error(_0x326a('0xb1'));}var _0x1f69d3=path[_0x326a('0x3e')](config[_0x326a('0xb2')],_0x326a('0xb3'),_0x3c486e[_0x326a('0xb4')][_0x326a('0xb5')]);fs[_0x326a('0xb6')](_0x1f69d3,parseInt(_0x326a('0xb7'),0x8));var _0x2d4c45=require('child_process')[_0x326a('0xb8')](path[_0x326a('0x3e')](__dirname,_0x326a('0xb9')),[_0x1f69d3,_0x3c486e[_0x326a('0x39')][_0x326a('0xa8')],_0x3c486e[_0x326a('0x39')][_0x326a('0xad')],_0x3c486e[_0x326a('0x39')]['ListId'],_0x3c486e['body']['CompanyId'],_0x3c486e[_0x326a('0x39')]['duplicates'],_0x3c486e[_0x326a('0x39')][_0x326a('0xaa')]]);return _0x3518d3[_0x326a('0x18')](0xc8)[_0x326a('0x10')]({'message':'File\x20uploaded\x20correctly!','pid':_0x2d4c45[_0x326a('0xba')]});}catch(_0x432a10){return _0x3518d3[_0x326a('0x18')](0x1f4)[_0x326a('0x1e')](_0x432a10);}};exports[_0x326a('0xbb')]=function(_0x444cac,_0x1c9a70){var _0x8694ef=fs[_0x326a('0xbc')](_0x444cac[_0x326a('0xb4')][_0x326a('0xbd')]);Papa[_0x326a('0xbe')](_0x8694ef,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x46e9c7){return _0x1c9a70[_0x326a('0x18')](0xc8)[_0x326a('0x10')]({'file':_0x444cac[_0x326a('0xb4')],'fields':_0x46e9c7[_0x326a('0xbf')][_0x326a('0x87')]});}});};exports[_0x326a('0xc0')]=function(_0x2e1d43,_0x5bce69){return db[_0x326a('0xc1')][_0x326a('0x21')]({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})[_0x326a('0x16')](function(_0x3b794e){var _0x2dd8a0=![];if(!_0x2e1d43[_0x326a('0x39')]['ListId']){throw new Error(_0x326a('0xa7'));}if(!_0x2e1d43[_0x326a('0x39')][_0x326a('0xc2')][_0x326a('0x7e')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x2e1d43['body'][_0x326a('0xc2')][_0x326a('0xb0')]){throw new Error(_0x326a('0xb1'));}if(!_0x2e1d43[_0x326a('0x39')][_0x326a('0xaa')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x41aace=require(_0x326a('0xc3'))['fork'](path[_0x326a('0x3e')](__dirname,_0x326a('0xc4')),[_0x2e1d43[_0x326a('0x27')]['id'],JSON['stringify'](_0x2e1d43[_0x326a('0x39')]),JSON['stringify'](_0x3b794e)]);_0x41aace['on'](_0x326a('0xc5'),function(){_0x2dd8a0=!![];return _0x5bce69[_0x326a('0x18')](0xc8)[_0x326a('0x10')]({'message':_0x326a('0xc6'),'pid':_0x41aace[_0x326a('0xba')]});});_0x41aace['on'](_0x326a('0xc7'),function(_0x1c8010){if(_0x1c8010&&!_0x2dd8a0){return _0x5bce69[_0x326a('0x18')](0x1f4)['json']({'message':_0x326a('0xc8'),'pid':_0x41aace[_0x326a('0xba')]});}});})[_0x326a('0x24')](handleError(_0x5bce69,null));};exports['importUpdates']=function(_0x5c1128,_0x29e2ff){return db[_0x326a('0xc1')][_0x326a('0x21')]({'raw':!![],'attributes':['id'],'where':{'role':_0x326a('0xc9')}})['then'](function(_0x401431){var _0x2cde43=![];if(!_0x5c1128['body']['ListId']){throw new Error(_0x326a('0xa7'));}if(!_0x5c1128[_0x326a('0x39')][_0x326a('0xc2')][_0x326a('0x7e')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x5c1128['body'][_0x326a('0xc2')][_0x326a('0xb0')]){throw new Error(_0x326a('0xb1'));}if(!_0x5c1128[_0x326a('0x39')][_0x326a('0xaa')]){throw new Error(_0x326a('0xab'));}var _0x51fcbd=require('child_process')[_0x326a('0xb8')](path['join'](__dirname,_0x326a('0xca')),[_0x5c1128[_0x326a('0x27')]['id'],JSON[_0x326a('0xcb')](_0x5c1128[_0x326a('0x39')]),JSON[_0x326a('0xcb')](_0x401431)]);_0x51fcbd['on'](_0x326a('0xc5'),function(){_0x2cde43=!![];return _0x29e2ff['status'](0xc8)[_0x326a('0x10')]({'message':'start\x20child\x20process\x20correctly!','pid':_0x51fcbd[_0x326a('0xba')]});});_0x51fcbd['on'](_0x326a('0xc7'),function(_0x4fab7b){if(_0x4fab7b&&!_0x2cde43){return _0x29e2ff[_0x326a('0x18')](0x1f4)[_0x326a('0x10')]({'message':_0x326a('0xc8'),'pid':_0x51fcbd[_0x326a('0xba')]});}});})[_0x326a('0x24')](handleError(_0x29e2ff,null));};exports[_0x326a('0xcc')]=function(_0x142bb5,_0x34ef61){var _0xfa7399=['mail',_0x326a('0xcd'),_0x326a('0xce'),'openchannel',_0x326a('0xcf'),'whatsapp',_0x326a('0xd0')];var _0x42040c={'offset':0x0,'order':qs[_0x326a('0x88')]('-createdAt')},_0x4750bf={'count':0x0,'rows':[]};Promise[_0x326a('0xd1')]()[_0x326a('0x16')](function(){if(_0x142bb5[_0x326a('0x22')][_0x326a('0xd2')]){if(!_[_0x326a('0xd3')](_0xfa7399,_0x142bb5[_0x326a('0x22')]['channel']['toLowerCase']())){throw new Error(_0x326a('0xd4'));}_0xfa7399=[_0x142bb5[_0x326a('0x22')]['channel'][_0x326a('0xd5')]()];}if(_0x142bb5[_0x326a('0x22')][_0x326a('0xd6')]){try{var _0x3b54e2=JSON['parse'](_0x142bb5[_0x326a('0x22')][_0x326a('0xd6')]);if(!moment(_0x3b54e2[_0x326a('0x3a')])[_0x326a('0xd7')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x3b54e2['to'])[_0x326a('0xd7')]()){throw new Error(_0x326a('0xd8'));}}catch(_0x3dbe06){throw new Error(_0x326a('0xd9'));}}if(!_0x142bb5[_0x326a('0x22')][_0x326a('0x37')](_0x326a('0x9f'))){_0x42040c[_0x326a('0x13')]=qs['limit'](_0x142bb5[_0x326a('0x22')][_0x326a('0x13')]||0xa);_0x42040c[_0x326a('0x11')]=qs[_0x326a('0x11')](_0x142bb5[_0x326a('0x22')][_0x326a('0x11')]);}var _0x1f0a10=_0xfa7399[_0x326a('0x73')](function(_0x102c61){if(_0x102c61===_0x326a('0xd0')){var _0x32ccb2={'attributes':['id',_0x326a('0xda'),'type','source','destination',_0x326a('0xdb'),_0x326a('0xdc'),_0x326a('0xdd'),_0x326a('0xde'),_0x326a('0xdf'),_0x326a('0xe0'),_0x326a('0xe1'),'userSecondDisposition','userThirdDisposition',_0x326a('0xe2')],'where':{'ContactId':_0x142bb5['params']['id']},'include':[{'model':db[_0x326a('0xc1')],'as':_0x326a('0xc1'),'attributes':['id','name','fullname',_0x326a('0x31')]}],'order':[[_0x326a('0xe0'),_0x326a('0xe3')]]};if(_0x142bb5[_0x326a('0x22')][_0x326a('0xd6')]){_0x32ccb2[_0x326a('0x61')]['createdAt']={'$gte':_0x3b54e2[_0x326a('0x3a')],'$lte':_0x3b54e2['to']};}return db[_0x326a('0x53')][_0x326a('0xe4')](_0x32ccb2)[_0x326a('0x16')](function(_0x138af6){_0x4750bf[_0x326a('0x14')]+=_0x138af6[_0x326a('0x14')];return _[_0x326a('0x73')](_0x138af6['rows'],function(_0x371002){var _0x1eae73=_0x371002['get']({'plain':!![]});_0x1eae73[_0x326a('0xd2')]=_0x102c61;if(_0x1eae73['User']){_0x1eae73[_0x326a('0xc1')]={'id':_0x1eae73[_0x326a('0xc1')]['id'],'name':_0x1eae73['User'][_0x326a('0x1d')],'fullname':_0x1eae73['User'][_0x326a('0xe5')],'alias':_0x1eae73[_0x326a('0xc1')][_0x326a('0x31')]};}return _0x1eae73;});});}else{var _0xc4c558=_['startCase'](_0x102c61)+(_0x102c61==='chat'?_0x326a('0xe6'):_0x326a('0xe7'));var _0x3af463={'attributes':['id','closed','closedAt','createdAt','note',_0x326a('0xe8'),_0x326a('0xe9'),_0x326a('0xea'),_0x326a('0xe2'),_0xc4c558+'Id'],'where':{'ContactId':_0x142bb5['params']['id']},'include':[{'model':db[_0xc4c558],'as':_0x326a('0xe7'),'attributes':['id','name',_0x326a('0xeb')]},{'model':db[_0x326a('0xc1')],'as':_0x326a('0xec'),'attributes':['id',_0x326a('0x1d'),_0x326a('0xe5')]},{'model':db[_0x326a('0xed')],'as':'Tags','attributes':['id',_0x326a('0x1d'),_0x326a('0x6a')],'through':{'attributes':[]}}],'order':[['createdAt',_0x326a('0xe3')]]};if(_0x142bb5[_0x326a('0x22')][_0x326a('0xd6')]){_0x3af463['where'][_0x326a('0xe0')]={'$gte':_0x3b54e2[_0x326a('0x3a')],'$lte':_0x3b54e2['to']};}switch(_0x102c61){case _0x326a('0xcd'):_0x3af463[_0x326a('0x86')]['push'](_0x326a('0xee'),_0x326a('0xef'),'customerPort',_0x326a('0xf0'),'osName',_0x326a('0xf1'),'ratingType',_0x326a('0xf2'),_0x326a('0xf3'));break;case'mail':_0x3af463[_0x326a('0x86')][_0x326a('0x63')]('subject',_0x326a('0xf4'));break;case _0x326a('0xf5'):_0x3af463[_0x326a('0x86')][_0x326a('0x63')](_0x326a('0xf6'),_0x326a('0xf7'));break;}return db[_[_0x326a('0xf8')](_0x102c61)+'Interaction'][_0x326a('0xe4')](_0x3af463)[_0x326a('0x16')](function(_0x41a627){_0x4750bf[_0x326a('0x14')]+=_0x41a627[_0x326a('0x14')];return _[_0x326a('0x73')](_0x41a627['rows'],function(_0x27c732){var _0x516888=_0x27c732[_0x326a('0x3b')]({'plain':!![]});_0x516888['channel']=_0x102c61;if(_0x516888['Owner']){_0x516888[_0x326a('0xec')]={'id':_0x516888['Owner']['id'],'name':_0x516888[_0x326a('0xec')][_0x326a('0x1d')],'fullname':_0x516888['Owner'][_0x326a('0xe5')]};}return _0x516888;});});}});return Promise[_0x326a('0x67')](_0x1f0a10);})[_0x326a('0x16')](function(_0x3828f4){return _(_0x3828f4)[_0x326a('0xf9')]()[_0x326a('0xfa')](_0x326a('0xe0'))[_0x326a('0xfb')]()[_0x326a('0xfc')]();})[_0x326a('0x16')](function(_0x3bf6d0){_0x4750bf[_0x326a('0xa3')]=_0x42040c['limit']?_0x3bf6d0['slice'](_0x42040c[_0x326a('0x11')],_0x42040c[_0x326a('0x11')]+_0x42040c[_0x326a('0x13')]):_0x3bf6d0;return _0x4750bf;})[_0x326a('0x16')](respondWithFilteredResult(_0x34ef61,_0x42040c))['catch'](handleError(_0x34ef61,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 2e5f993..e410aa0 100644 --- a/server/api/cmContact/cmContact.events.js +++ b/server/api/cmContact/cmContact.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x025b=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save'];(function(_0x14510c,_0x3f66f0){var _0x31c5f8=function(_0x1660ec){while(--_0x1660ec){_0x14510c['push'](_0x14510c['shift']());}};_0x31c5f8(++_0x3f66f0);}(_0x025b,0x191));var _0xb025=function(_0x5f4adb,_0x3e363f){_0x5f4adb=_0x5f4adb-0x0;var _0x9964ce=_0x025b[_0x5f4adb];return _0x9964ce;};'use strict';var EventEmitter=require(_0xb025('0x0'));var CmContact=require(_0xb025('0x1'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0xb025('0x2')](0x0);var events={'afterCreate':_0xb025('0x3'),'afterUpdate':_0xb025('0x4'),'afterDestroy':_0xb025('0x5')};function emitEvent(_0xc8c235){return function(_0x597759,_0x3641cc,_0x3e45f0){CmContactEvents[_0xb025('0x6')](_0xc8c235+':'+_0x597759['id'],_0x597759);CmContactEvents[_0xb025('0x6')](_0xc8c235,_0x597759);_0x3e45f0(null);};}for(var e in events){if(events[_0xb025('0x7')](e)){var event=events[e];CmContact[_0xb025('0x8')](e,emitEvent(event));}}module['exports']=CmContactEvents; \ No newline at end of file +var _0x89f8=['emit','hasOwnProperty','hook','events','../../mysqldb','save','update','remove'];(function(_0x407699,_0x468180){var _0x297621=function(_0x5c5848){while(--_0x5c5848){_0x407699['push'](_0x407699['shift']());}};_0x297621(++_0x468180);}(_0x89f8,0xeb));var _0x889f=function(_0x5614fb,_0x57e908){_0x5614fb=_0x5614fb-0x0;var _0x1bc73d=_0x89f8[_0x5614fb];return _0x1bc73d;};'use strict';var EventEmitter=require(_0x889f('0x0'));var CmContact=require(_0x889f('0x1'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x889f('0x2'),'afterUpdate':_0x889f('0x3'),'afterDestroy':_0x889f('0x4')};function emitEvent(_0x2de772){return function(_0x23ed32,_0x339484,_0x488728){CmContactEvents[_0x889f('0x5')](_0x2de772+':'+_0x23ed32['id'],_0x23ed32);CmContactEvents[_0x889f('0x5')](_0x2de772,_0x23ed32);_0x488728(null);};}for(var e in events){if(events[_0x889f('0x6')](e)){var event=events[e];CmContact[_0x889f('0x7')](e,emitEvent(event));}}module['exports']=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 5183d2b..246dc96 100644 --- a/server/api/cmContact/cmContact.model.js +++ b/server/api/cmContact/cmContact.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5711=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment/shared','./cmContact.attributes','exports','define','cm_contacts','phone','fti_cm_contacts','firstName','lastName','mobile','fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','get','error','cmContact','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','VoiceQueue','findOne','then','dialTimezone','timezones','utcOffset','add','minutes','cmContact,\x20afterCreate\x20','CmHopper','create','ListId','priority','callbackUniqueid','catch','ret','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','inspect','Campaign','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','length','dialCheckDuplicateType','onlyIfOpen','BlackLists','cmContact,\x20%s,\x20%s','afterCreate','message','CmList','Lists','always','List\x20not\x20found','isEmpty','destroy','ContactId','CampaignId','push','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','util'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x5711,0x17b));var _0x1571=function(_0x72a33d,_0x5691da){_0x72a33d=_0x72a33d-0x0;var _0x2621d5=_0x5711[_0x72a33d];return _0x2621d5;};'use strict';var _=require('lodash');var util=require(_0x1571('0x0'));var logger=require(_0x1571('0x1'))(_0x1571('0x2'));var moment=require(_0x1571('0x3'));var BPromise=require(_0x1571('0x4'));var rp=require(_0x1571('0x5'));var fs=require('fs');var path=require(_0x1571('0x6'));var rimraf=require(_0x1571('0x7'));var config=require('../../config/environment');var shared=require(_0x1571('0x8'));var attributes=require(_0x1571('0x9'));module[_0x1571('0xa')]=function(_0x2c8a65,_0x5c8cc1){return _0x2c8a65[_0x1571('0xb')]('CmContact',attributes,{'tableName':_0x1571('0xc'),'paranoid':!![],'indexes':[{'name':_0x1571('0xd'),'fields':[_0x1571('0xd')]},{'name':_0x1571('0xe'),'fields':[_0x1571('0xf'),_0x1571('0x10'),_0x1571('0xd'),_0x1571('0x11'),_0x1571('0x12'),_0x1571('0x13')],'type':_0x1571('0x14')}],'timestamps':!![],'charset':_0x1571('0x15'),'collate':_0x1571('0x16'),'hooks':{'afterCreate':function(_0x4e67d1,_0x4988ee,_0x1952f6){var _0x187062=_0x2c8a65[_0x1571('0x17')];var _0x30a9ba=_0x4e67d1[_0x1571('0x18')]({'plain':!![]});function _0x19d5a1(){return function(_0x456122){logger[_0x1571('0x19')](_0x1571('0x1a'),'afterCreate',util['inspect'](_0x456122,{'showHidden':![],'depth':null}));};}function _0x5e7b4a(_0x160fa2,_0x3e9154){var _0x2be727=_0x3e9154[_0x1571('0x1b')]?_0x3e9154[_0x1571('0x1b')]:moment()[_0x1571('0x1c')](_0x1571('0x1d'));return new BPromise(function(_0x15b378,_0x3f6c3c){if(_[_0x1571('0x1e')](_0x3e9154['dialTimezone'])){_0x15b378({'ret':_0x2be727});}else{_0x187062[_0x1571('0x1f')][_0x1571('0x20')]({'where':{'id':_0x160fa2['id']}})[_0x1571('0x21')](function(_0x33e1e0){if(!_[_0x1571('0x1e')](_0x33e1e0)){var _0x4a6749=_0x33e1e0[_0x1571('0x22')];if(!_['isNil'](_0x4a6749)){var _0x2069ca=shared[_0x1571('0x23')];var _0x1cb454=_0x2069ca[_0x4a6749];var _0x2c1dca=_0x2069ca[_0x3e9154[_0x1571('0x22')]];if(!_['isNil'](_0x1cb454)&&!_[_0x1571('0x1e')](_0x2c1dca)){var _0x170f1d=_0x1cb454[_0x1571('0x24')]-_0x2c1dca[_0x1571('0x24')];_0x2be727=_0x3e9154[_0x1571('0x1b')]?_0x3e9154['scheduledat']:moment();var _0x5968ee=moment(_0x2be727)[_0x1571('0x25')](_0x170f1d,_0x1571('0x26'));_0x15b378({'ret':_0x5968ee['format']('YYYY-MM-DD\x20HH:mm:ss')});}else _0x15b378({'ret':_0x2be727});}else _0x15b378({'ret':_0x2be727});}else{_0x15b378({'ret':_0x2be727});}});}});return 0xa;}var _0x3acb48=function(_0x3b3575){return new BPromise(function(_0x161ca6,_0x5ccd89){_0x5e7b4a(_0x3b3575,_0x30a9ba)['then'](function(_0x12b37e){_0x30a9ba[_0x1571('0x1b')]=_0x12b37e['ret'];_0x187062['CmHopper'][_0x1571('0x20')]({'where':{'phone':_0x30a9ba[_0x1571('0xd')],'VoiceQueueId':_0x3b3575['id']}})['then'](function(_0x150a58){if(!_[_0x1571('0x1e')](_0x150a58)){throw new Error(_0x1571('0x27')+_0x30a9ba[_0x1571('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x3b3575['id']);}return _0x187062[_0x1571('0x28')][_0x1571('0x29')]({'phone':_0x30a9ba[_0x1571('0xd')],'ContactId':_0x30a9ba['id'],'ListId':_0x30a9ba[_0x1571('0x2a')],'priority':_0x30a9ba['priority']?_0x30a9ba[_0x1571('0x2b')]:0x2,'scheduledat':_0x30a9ba[_0x1571('0x1b')]?_0x30a9ba[_0x1571('0x1b')]:moment()[_0x1571('0x1c')](_0x1571('0x1d')),'callback':_0x30a9ba[_0x1571('0x2c')]?!![]:![],'callbackuniqueid':_0x30a9ba['callbackUniqueid']?_0x30a9ba[_0x1571('0x2c')]:undefined,'callbackat':_0x30a9ba['callbackUniqueid']?moment()[_0x1571('0x1c')](_0x1571('0x1d')):undefined,'VoiceQueueId':_0x3b3575['id']});})[_0x1571('0x2d')](function(_0x5acc44){_0x5ccd89(_0x5acc44);});});});};var _0x5de752=function(_0x3bf681){return new BPromise(function(_0x632987,_0xa710b6){_0x5e7b4a(_0x3bf681,_0x30a9ba)[_0x1571('0x21')](function(_0x15e33d){_0x30a9ba[_0x1571('0x1b')]=_0x15e33d[_0x1571('0x2e')];_0x187062[_0x1571('0x28')][_0x1571('0x20')]({'where':{'phone':_0x30a9ba[_0x1571('0xd')],'VoiceQueueId':_0x3bf681['id']}})['then'](function(_0x21a796){if(!_[_0x1571('0x1e')](_0x21a796)){throw new Error('cmContact,\x20afterCreate\x20'+_0x30a9ba[_0x1571('0xd')]+_0x1571('0x2f')+_0x3bf681['id']);}return _0x187062[_0x1571('0x30')]['findOne']({'where':{'calleridnum':_0x30a9ba[_0x1571('0xd')],'VoiceQueueId':_0x3bf681['id']}});})[_0x1571('0x21')](function(_0x418fd6){if(!_[_0x1571('0x1e')](_0x418fd6)){throw new Error(_0x1571('0x31')+_0x30a9ba[_0x1571('0xd')]+_0x1571('0x32')+_0x3bf681['id']);}return _0x187062[_0x1571('0x28')][_0x1571('0x29')]({'phone':_0x30a9ba[_0x1571('0xd')],'ContactId':_0x30a9ba['id'],'ListId':_0x30a9ba[_0x1571('0x2a')],'priority':_0x30a9ba[_0x1571('0x2b')]?_0x30a9ba[_0x1571('0x2b')]:0x2,'scheduledat':_0x30a9ba[_0x1571('0x1b')]?_0x30a9ba[_0x1571('0x1b')]:moment()[_0x1571('0x1c')](_0x1571('0x1d')),'callback':_0x30a9ba[_0x1571('0x2c')]?!![]:![],'callbackuniqueid':_0x30a9ba[_0x1571('0x2c')]?_0x30a9ba[_0x1571('0x2c')]:undefined,'callbackat':_0x30a9ba[_0x1571('0x2c')]?moment()['format'](_0x1571('0x1d')):undefined,'VoiceQueueId':_0x3bf681['id']});})[_0x1571('0x2d')](function(_0x5766d9){_0xa710b6(_0x5766d9);});});});};function _0x5f153c(){return function(_0x1e82d3){logger[_0x1571('0x19')]('cmContact','afterCreate',util[_0x1571('0x33')](_0x1e82d3,{'showHidden':![],'depth':null}));};}function _0x337614(_0x4e0883,_0x3b5c47){var _0x25d024=_0x3b5c47[_0x1571('0x1b')]?_0x3b5c47['scheduledat']:moment()['format'](_0x1571('0x1d'));return new BPromise(function(_0xd3b3aa,_0x3dc4fc){if(_['isNil'](_0x3b5c47[_0x1571('0x22')])){_0xd3b3aa({'ret':_0x25d024});}else{_0x187062[_0x1571('0x34')][_0x1571('0x20')]({'where':{'id':_0x4e0883['id']}})[_0x1571('0x21')](function(_0x476a92){if(!_[_0x1571('0x1e')](_0x476a92)){var _0x276339=_0x476a92[_0x1571('0x22')];if(!_[_0x1571('0x1e')](_0x276339)){var _0x1b3779=shared[_0x1571('0x23')];var _0x254d82=_0x1b3779[_0x276339];var _0x165d6f=_0x1b3779[_0x3b5c47['dialTimezone']];if(!_[_0x1571('0x1e')](_0x254d82)&&!_[_0x1571('0x1e')](_0x165d6f)){var _0x3e778d=_0x254d82[_0x1571('0x24')]-_0x165d6f[_0x1571('0x24')];_0x25d024=_0x3b5c47[_0x1571('0x1b')]?_0x3b5c47[_0x1571('0x1b')]:moment();var _0x15e6e8=moment(_0x25d024)['add'](_0x3e778d,'minutes');_0xd3b3aa({'ret':_0x15e6e8['format'](_0x1571('0x1d'))});}else _0xd3b3aa({'ret':_0x25d024});}else _0xd3b3aa({'ret':_0x25d024});}else{_0xd3b3aa({'ret':_0x25d024});}});}});return 0xa;}var _0x3326e8=function(_0x66591){return new BPromise(function(_0x19c086,_0x14c50e){_0x337614(_0x66591,_0x30a9ba)[_0x1571('0x21')](function(_0x41f931){_0x30a9ba['scheduledat']=_0x41f931['ret'];_0x187062[_0x1571('0x28')]['findOne']({'where':{'phone':_0x30a9ba[_0x1571('0xd')],'CampaignId':_0x66591['id']}})[_0x1571('0x21')](function(_0x5b2a9f){if(!_['isNil'](_0x5b2a9f)){throw new Error('cmContact,\x20afterCreate\x20'+_0x30a9ba[_0x1571('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x66591['id']);}return _0x187062[_0x1571('0x28')][_0x1571('0x29')]({'phone':_0x30a9ba[_0x1571('0xd')],'ContactId':_0x30a9ba['id'],'ListId':_0x30a9ba[_0x1571('0x2a')],'priority':_0x30a9ba[_0x1571('0x2b')]?_0x30a9ba[_0x1571('0x2b')]:0x2,'scheduledat':_0x30a9ba['scheduledat']?_0x30a9ba[_0x1571('0x1b')]:moment()[_0x1571('0x1c')](_0x1571('0x1d')),'callback':_0x30a9ba[_0x1571('0x2c')]?!![]:![],'callbackuniqueid':_0x30a9ba[_0x1571('0x2c')]?_0x30a9ba[_0x1571('0x2c')]:undefined,'callbackat':_0x30a9ba[_0x1571('0x2c')]?moment()[_0x1571('0x1c')](_0x1571('0x1d')):undefined,'CampaignId':_0x66591['id']});})[_0x1571('0x2d')](function(_0x13838f){_0x14c50e(_0x13838f);});});});};var _0x1fcea7=function(_0x12bba2){return new BPromise(function(_0xdebffa,_0xb3cb22){_0x337614(_0x12bba2,_0x30a9ba)[_0x1571('0x21')](function(_0x5cfaf7){_0x30a9ba[_0x1571('0x1b')]=_0x5cfaf7[_0x1571('0x2e')];_0x187062[_0x1571('0x28')][_0x1571('0x20')]({'where':{'phone':_0x30a9ba[_0x1571('0xd')],'CampaignId':_0x12bba2['id']}})['then'](function(_0x53a475){if(!_['isNil'](_0x53a475)){throw new Error('cmContact,\x20afterCreate\x20'+_0x30a9ba[_0x1571('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x12bba2['id']);}return _0x187062[_0x1571('0x30')][_0x1571('0x20')]({'where':{'calleridnum':_0x30a9ba[_0x1571('0xd')],'CampaignId':_0x12bba2['id']}});})[_0x1571('0x21')](function(_0x459dd5){if(!_[_0x1571('0x1e')](_0x459dd5)){throw new Error(_0x1571('0x31')+_0x30a9ba[_0x1571('0xd')]+_0x1571('0x35')+_0x12bba2['id']);}return _0x187062[_0x1571('0x28')]['create']({'phone':_0x30a9ba['phone'],'ContactId':_0x30a9ba['id'],'ListId':_0x30a9ba[_0x1571('0x2a')],'priority':_0x30a9ba[_0x1571('0x2b')]?_0x30a9ba[_0x1571('0x2b')]:0x2,'scheduledat':_0x30a9ba[_0x1571('0x1b')]?_0x30a9ba[_0x1571('0x1b')]:moment()[_0x1571('0x1c')](_0x1571('0x1d')),'callback':_0x30a9ba[_0x1571('0x2c')]?!![]:![],'callbackuniqueid':_0x30a9ba['callbackUniqueid']?_0x30a9ba['callbackUniqueid']:undefined,'callbackat':_0x30a9ba[_0x1571('0x2c')]?moment()[_0x1571('0x1c')](_0x1571('0x1d')):undefined,'CampaignId':_0x12bba2['id']});})['catch'](function(_0x2d491e){_0xb3cb22(_0x2d491e);});});});};if(_0x30a9ba[_0x1571('0x2a')]){_0x187062['VoiceQueue'][_0x1571('0x36')]({'where':{'type':_0x1571('0x37')},'attributes':['id','dialCheckDuplicateType',_0x1571('0x22')],'include':[{'model':_0x187062['CmList'],'as':'Lists','where':{'id':_0x30a9ba[_0x1571('0x2a')]}}]})[_0x1571('0x21')](function(_0x1598e2){if(_0x1598e2){var _0x94d68f=[];for(var _0x45323d=0x0,_0x159c8e;_0x45323d<_0x1598e2[_0x1571('0x38')];_0x45323d+=0x1){_0x159c8e=_0x1598e2[_0x45323d][_0x1571('0x18')]({'plain':!![]});switch(_0x159c8e[_0x1571('0x39')]){case'always':_0x5de752(_0x159c8e)[_0x1571('0x2d')](_0x19d5a1());break;case _0x1571('0x3a'):_0x3acb48(_0x159c8e)[_0x1571('0x2d')](_0x19d5a1());break;default:_0x337614(_0x159c8e,_0x30a9ba)[_0x1571('0x21')](function(_0xb308ac){_0x30a9ba['scheduledat']=_0xb308ac[_0x1571('0x2e')];_0x187062['CmHopper'][_0x1571('0x29')]({'phone':_0x30a9ba[_0x1571('0xd')],'ContactId':_0x30a9ba['id'],'ListId':_0x30a9ba[_0x1571('0x2a')],'scheduledat':_0x30a9ba[_0x1571('0x1b')]?_0x30a9ba['scheduledat']:moment()[_0x1571('0x1c')](_0x1571('0x1d')),'priority':_0x30a9ba[_0x1571('0x2b')]?_0x30a9ba['priority']:0x2,'callback':_0x30a9ba['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x30a9ba['callbackUniqueid']?_0x30a9ba['callbackUniqueid']:undefined,'callbackat':_0x30a9ba[_0x1571('0x2c')]?moment()[_0x1571('0x1c')](_0x1571('0x1d')):undefined,'VoiceQueueId':_0x159c8e['id']})[_0x1571('0x2d')](_0x19d5a1());});}}}})[_0x1571('0x21')](function(){return _0x187062['VoiceQueue'][_0x1571('0x36')]({'where':{'type':_0x1571('0x37')},'attributes':['id'],'include':[{'model':_0x187062['CmList'],'as':_0x1571('0x3b'),'where':{'id':_0x30a9ba['ListId']}}]})[_0x1571('0x21')](function(_0xa674ce){if(_0xa674ce){var _0x5d5a64=[];for(var _0x4a55f7=0x0,_0x47dabd;_0x4a55f7<_0xa674ce[_0x1571('0x38')];_0x4a55f7+=0x1){_0x47dabd=_0xa674ce[_0x4a55f7][_0x1571('0x18')]({'plain':!![]});_0x187062['CmHopperBlack'][_0x1571('0x29')]({'phone':_0x30a9ba[_0x1571('0xd')],'ContactId':_0x30a9ba['id'],'ListId':_0x30a9ba[_0x1571('0x2a')],'VoiceQueueId':_0x47dabd['id']})[_0x1571('0x2d')](function(_0x58b47d){logger[_0x1571('0x19')](_0x1571('0x3c'),_0x1571('0x3d'),_0x58b47d[_0x1571('0x3e')]);});}}});})[_0x1571('0x21')](function(){return _0x187062[_0x1571('0x34')]['findAll']({'attributes':['id','dialCheckDuplicateType','dialTimezone'],'include':[{'model':_0x187062[_0x1571('0x3f')],'as':_0x1571('0x40'),'where':{'id':_0x30a9ba[_0x1571('0x2a')]}}]})['then'](function(_0x3861cc){if(_0x3861cc){var _0x5cd7d1=[];for(var _0x5d3cdc=0x0,_0x3995c9;_0x5d3cdc<_0x3861cc[_0x1571('0x38')];_0x5d3cdc+=0x1){_0x3995c9=_0x3861cc[_0x5d3cdc][_0x1571('0x18')]({'plain':!![]});switch(_0x3995c9[_0x1571('0x39')]){case _0x1571('0x41'):_0x1fcea7(_0x3995c9)[_0x1571('0x2d')](_0x5f153c());break;case _0x1571('0x3a'):_0x3326e8(_0x3995c9)['catch'](_0x5f153c());break;default:_0x187062[_0x1571('0x28')][_0x1571('0x29')]({'phone':_0x30a9ba[_0x1571('0xd')],'ContactId':_0x30a9ba['id'],'ListId':_0x30a9ba['ListId'],'scheduledat':_0x30a9ba['scheduledat']?_0x30a9ba[_0x1571('0x1b')]:moment()[_0x1571('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x30a9ba[_0x1571('0x2b')]?_0x30a9ba['priority']:0x2,'callback':_0x30a9ba[_0x1571('0x2c')]?!![]:![],'callbackuniqueid':_0x30a9ba[_0x1571('0x2c')]?_0x30a9ba[_0x1571('0x2c')]:undefined,'callbackat':_0x30a9ba[_0x1571('0x2c')]?moment()[_0x1571('0x1c')](_0x1571('0x1d')):undefined,'CampaignId':_0x3995c9['id']})[_0x1571('0x2d')](_0x5f153c());}}}});})['then'](function(){return _0x187062[_0x1571('0x34')][_0x1571('0x36')]({'attributes':['id'],'include':[{'model':_0x187062[_0x1571('0x3f')],'as':'BlackLists','where':{'id':_0x30a9ba[_0x1571('0x2a')]}}]})[_0x1571('0x21')](function(_0x5c138f){if(_0x5c138f){var _0x451cd4=[];for(var _0x5d4fd9=0x0,_0x435385;_0x5d4fd9<_0x5c138f[_0x1571('0x38')];_0x5d4fd9+=0x1){_0x435385=_0x5c138f[_0x5d4fd9][_0x1571('0x18')]({'plain':!![]});_0x187062['CmHopperBlack'][_0x1571('0x29')]({'phone':_0x30a9ba['phone'],'ContactId':_0x30a9ba['id'],'ListId':_0x30a9ba['ListId'],'CampaignId':_0x435385['id']})['catch'](function(_0x4d94f8){logger[_0x1571('0x19')]('cmContact,\x20%s,\x20%s','afterCreate',_0x4d94f8[_0x1571('0x3e')]);});}}});})[_0x1571('0x21')](function(){_0x1952f6();})[_0x1571('0x2d')](function(_0x17e468){logger[_0x1571('0x19')](_0x1571('0x3c'),_0x1571('0x3d'),_0x17e468[_0x1571('0x3e')]);_0x1952f6(_0x17e468);});}else{_0x1952f6(new Error(_0x1571('0x42')));}},'afterDestroy':function(_0x4224e7,_0x4635e1,_0x2688e4){var _0x331520=_0x2c8a65[_0x1571('0x17')];var _0x37997b=_0x4224e7[_0x1571('0x18')]({'plain':!![]});return _0x331520[_0x1571('0x28')][_0x1571('0x36')]({'raw':!![],'where':{'ListId':_0x37997b[_0x1571('0x2a')],'ContactId':_0x37997b['id']}})['then'](function(_0x4c41ae){if(!_[_0x1571('0x43')](_0x4c41ae)){var _0x9e49c3=[];for(var _0x209f60=0x0;_0x209f60<_0x4c41ae[_0x1571('0x38')];_0x209f60+=0x1){var _0x4cae1e=_0x331520['CmHopper'][_0x1571('0x44')]({'where':{'ListId':_0x4c41ae[_0x209f60][_0x1571('0x2a')],'ContactId':_0x4c41ae[_0x209f60][_0x1571('0x45')],'VoiceQueueId':_0x4c41ae[_0x209f60]['VoiceQueueId'],'CampaignId':_0x4c41ae[_0x209f60][_0x1571('0x46')]}});_0x9e49c3[_0x1571('0x47')](_0x4cae1e);}return BPromise[_0x1571('0x48')](_0x9e49c3);}})[_0x1571('0x21')](function(_0x41b8ab){logger[_0x1571('0x49')](_0x1571('0x4a'),util[_0x1571('0x33')](_0x41b8ab,{'showHidden':![],'depth':null}));_0x2688e4();})['catch'](function(_0x42a464){logger['error'](_0x1571('0x4b'),util[_0x1571('0x33')](_0x42a464,{'showHidden':![],'depth':null}));_0x2688e4(_0x42a464);});}}});}; \ No newline at end of file +var _0xfbba=['exports','CmContact','cm_contacts','phone','firstName','lastName','mobile','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','get','error','cmContact','afterCreate','inspect','scheduledat','YYYY-MM-DD\x20HH:mm:ss','dialTimezone','VoiceQueue','findOne','isNil','utcOffset','minutes','format','then','ret','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopper','create','priority','callbackUniqueid','catch','timezones','add','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','cmContact,\x20afterCreate,\x20','findAll','outbound','dialCheckDuplicateType','Lists','ListId','always','CmList','BlackLists','length','Campaign','onlyIfOpen','CmHopperBlack','message','cmContact,\x20%s,\x20%s','List\x20not\x20found','isEmpty','destroy','VoiceQueueId','CampaignId','push','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes'];(function(_0x4a6bad,_0x6d58bc){var _0xc9a004=function(_0x382a0f){while(--_0x382a0f){_0x4a6bad['push'](_0x4a6bad['shift']());}};_0xc9a004(++_0x6d58bc);}(_0xfbba,0x87));var _0xafbb=function(_0x15ee00,_0x3a5c42){_0x15ee00=_0x15ee00-0x0;var _0x3d2558=_0xfbba[_0x15ee00];return _0x3d2558;};'use strict';var _=require(_0xafbb('0x0'));var util=require(_0xafbb('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xafbb('0x2'));var rp=require(_0xafbb('0x3'));var fs=require('fs');var path=require(_0xafbb('0x4'));var rimraf=require(_0xafbb('0x5'));var config=require(_0xafbb('0x6'));var shared=require(_0xafbb('0x7'));var attributes=require(_0xafbb('0x8'));module[_0xafbb('0x9')]=function(_0x522966,_0x7773c3){return _0x522966['define'](_0xafbb('0xa'),attributes,{'tableName':_0xafbb('0xb'),'paranoid':!![],'indexes':[{'name':_0xafbb('0xc'),'fields':[_0xafbb('0xc')]},{'name':'fti_cm_contacts','fields':[_0xafbb('0xd'),_0xafbb('0xe'),_0xafbb('0xc'),_0xafbb('0xf'),'fax',_0xafbb('0x10')],'type':_0xafbb('0x11')}],'timestamps':!![],'charset':_0xafbb('0x12'),'collate':_0xafbb('0x13'),'hooks':{'afterCreate':function(_0xf74037,_0x2100b5,_0x54742e){var _0x4691e5=_0x522966[_0xafbb('0x14')];var _0x126a82=_0xf74037[_0xafbb('0x15')]({'plain':!![]});function _0xa8423(){return function(_0xded472){logger[_0xafbb('0x16')](_0xafbb('0x17'),_0xafbb('0x18'),util[_0xafbb('0x19')](_0xded472,{'showHidden':![],'depth':null}));};}function _0x31eb01(_0x5e76c6,_0x569d37){var _0x41dab7=_0x569d37[_0xafbb('0x1a')]?_0x569d37[_0xafbb('0x1a')]:moment()['format'](_0xafbb('0x1b'));return new BPromise(function(_0xb5f010,_0x41a3d8){if(_['isNil'](_0x569d37[_0xafbb('0x1c')])){_0xb5f010({'ret':_0x41dab7});}else{_0x4691e5[_0xafbb('0x1d')][_0xafbb('0x1e')]({'where':{'id':_0x5e76c6['id']}})['then'](function(_0x3e7561){if(!_[_0xafbb('0x1f')](_0x3e7561)){var _0x552af8=_0x3e7561[_0xafbb('0x1c')];if(!_[_0xafbb('0x1f')](_0x552af8)){var _0x29e137=shared['timezones'];var _0x4384ce=_0x29e137[_0x552af8];var _0x5136d7=_0x29e137[_0x569d37[_0xafbb('0x1c')]];if(!_[_0xafbb('0x1f')](_0x4384ce)&&!_['isNil'](_0x5136d7)){var _0x15966f=_0x4384ce[_0xafbb('0x20')]-_0x5136d7[_0xafbb('0x20')];_0x41dab7=_0x569d37[_0xafbb('0x1a')]?_0x569d37[_0xafbb('0x1a')]:moment();var _0x579945=moment(_0x41dab7)['add'](_0x15966f,_0xafbb('0x21'));_0xb5f010({'ret':_0x579945[_0xafbb('0x22')](_0xafbb('0x1b'))});}else _0xb5f010({'ret':_0x41dab7});}else _0xb5f010({'ret':_0x41dab7});}else{_0xb5f010({'ret':_0x41dab7});}});}});return 0xa;}var _0x564e7d=function(_0x2d857e){return new BPromise(function(_0x407a43,_0x3388a3){_0x31eb01(_0x2d857e,_0x126a82)[_0xafbb('0x23')](function(_0x1f9af9){_0x126a82[_0xafbb('0x1a')]=_0x1f9af9[_0xafbb('0x24')];_0x4691e5['CmHopper']['findOne']({'where':{'phone':_0x126a82['phone'],'VoiceQueueId':_0x2d857e['id']}})[_0xafbb('0x23')](function(_0x2bd23f){if(!_[_0xafbb('0x1f')](_0x2bd23f)){throw new Error(_0xafbb('0x25')+_0x126a82[_0xafbb('0xc')]+_0xafbb('0x26')+_0x2d857e['id']);}return _0x4691e5[_0xafbb('0x27')][_0xafbb('0x28')]({'phone':_0x126a82[_0xafbb('0xc')],'ContactId':_0x126a82['id'],'ListId':_0x126a82['ListId'],'priority':_0x126a82[_0xafbb('0x29')]?_0x126a82[_0xafbb('0x29')]:0x2,'scheduledat':_0x126a82['scheduledat']?_0x126a82[_0xafbb('0x1a')]:moment()[_0xafbb('0x22')](_0xafbb('0x1b')),'callback':_0x126a82['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x126a82[_0xafbb('0x2a')]?_0x126a82[_0xafbb('0x2a')]:undefined,'callbackat':_0x126a82[_0xafbb('0x2a')]?moment()[_0xafbb('0x22')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x2d857e['id']});})[_0xafbb('0x2b')](function(_0x4e29bf){_0x3388a3(_0x4e29bf);});});});};var _0xc28e08=function(_0x4a4795){return new BPromise(function(_0x163a14,_0x2c3e24){_0x31eb01(_0x4a4795,_0x126a82)[_0xafbb('0x23')](function(_0x4689d2){_0x126a82[_0xafbb('0x1a')]=_0x4689d2['ret'];_0x4691e5[_0xafbb('0x27')]['findOne']({'where':{'phone':_0x126a82[_0xafbb('0xc')],'VoiceQueueId':_0x4a4795['id']}})[_0xafbb('0x23')](function(_0xa3dcd2){if(!_['isNil'](_0xa3dcd2)){throw new Error(_0xafbb('0x25')+_0x126a82[_0xafbb('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x4a4795['id']);}return _0x4691e5['CmHopperFinal'][_0xafbb('0x1e')]({'where':{'calleridnum':_0x126a82['phone'],'VoiceQueueId':_0x4a4795['id']}});})[_0xafbb('0x23')](function(_0x222f11){if(!_[_0xafbb('0x1f')](_0x222f11)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x126a82[_0xafbb('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x4a4795['id']);}return _0x4691e5[_0xafbb('0x27')][_0xafbb('0x28')]({'phone':_0x126a82['phone'],'ContactId':_0x126a82['id'],'ListId':_0x126a82['ListId'],'priority':_0x126a82[_0xafbb('0x29')]?_0x126a82[_0xafbb('0x29')]:0x2,'scheduledat':_0x126a82[_0xafbb('0x1a')]?_0x126a82[_0xafbb('0x1a')]:moment()[_0xafbb('0x22')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x126a82['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x126a82[_0xafbb('0x2a')]?_0x126a82['callbackUniqueid']:undefined,'callbackat':_0x126a82[_0xafbb('0x2a')]?moment()['format'](_0xafbb('0x1b')):undefined,'VoiceQueueId':_0x4a4795['id']});})['catch'](function(_0xd91d18){_0x2c3e24(_0xd91d18);});});});};function _0x3842db(){return function(_0x3ae3cf){logger[_0xafbb('0x16')](_0xafbb('0x17'),_0xafbb('0x18'),util['inspect'](_0x3ae3cf,{'showHidden':![],'depth':null}));};}function _0x3ad5d4(_0x4c4dfb,_0x3e2ce6){var _0x926f3f=_0x3e2ce6['scheduledat']?_0x3e2ce6['scheduledat']:moment()['format'](_0xafbb('0x1b'));return new BPromise(function(_0x265261,_0x5242b8){if(_['isNil'](_0x3e2ce6['dialTimezone'])){_0x265261({'ret':_0x926f3f});}else{_0x4691e5['Campaign']['findOne']({'where':{'id':_0x4c4dfb['id']}})[_0xafbb('0x23')](function(_0xdf955){if(!_[_0xafbb('0x1f')](_0xdf955)){var _0x410807=_0xdf955['dialTimezone'];if(!_[_0xafbb('0x1f')](_0x410807)){var _0x4d323d=shared[_0xafbb('0x2c')];var _0x2f50ca=_0x4d323d[_0x410807];var _0x48d054=_0x4d323d[_0x3e2ce6[_0xafbb('0x1c')]];if(!_['isNil'](_0x2f50ca)&&!_[_0xafbb('0x1f')](_0x48d054)){var _0x32ae2f=_0x2f50ca[_0xafbb('0x20')]-_0x48d054[_0xafbb('0x20')];_0x926f3f=_0x3e2ce6[_0xafbb('0x1a')]?_0x3e2ce6[_0xafbb('0x1a')]:moment();var _0x1ec051=moment(_0x926f3f)[_0xafbb('0x2d')](_0x32ae2f,'minutes');_0x265261({'ret':_0x1ec051['format'](_0xafbb('0x1b'))});}else _0x265261({'ret':_0x926f3f});}else _0x265261({'ret':_0x926f3f});}else{_0x265261({'ret':_0x926f3f});}});}});return 0xa;}var _0x36638e=function(_0x3f938c){return new BPromise(function(_0x4b4578,_0x5204e2){_0x3ad5d4(_0x3f938c,_0x126a82)[_0xafbb('0x23')](function(_0x14b303){_0x126a82[_0xafbb('0x1a')]=_0x14b303[_0xafbb('0x24')];_0x4691e5[_0xafbb('0x27')]['findOne']({'where':{'phone':_0x126a82[_0xafbb('0xc')],'CampaignId':_0x3f938c['id']}})[_0xafbb('0x23')](function(_0x3bf712){if(!_['isNil'](_0x3bf712)){throw new Error(_0xafbb('0x25')+_0x126a82['phone']+_0xafbb('0x2e')+_0x3f938c['id']);}return _0x4691e5[_0xafbb('0x27')][_0xafbb('0x28')]({'phone':_0x126a82[_0xafbb('0xc')],'ContactId':_0x126a82['id'],'ListId':_0x126a82['ListId'],'priority':_0x126a82[_0xafbb('0x29')]?_0x126a82[_0xafbb('0x29')]:0x2,'scheduledat':_0x126a82['scheduledat']?_0x126a82[_0xafbb('0x1a')]:moment()[_0xafbb('0x22')](_0xafbb('0x1b')),'callback':_0x126a82[_0xafbb('0x2a')]?!![]:![],'callbackuniqueid':_0x126a82['callbackUniqueid']?_0x126a82[_0xafbb('0x2a')]:undefined,'callbackat':_0x126a82[_0xafbb('0x2a')]?moment()[_0xafbb('0x22')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x3f938c['id']});})[_0xafbb('0x2b')](function(_0x4b1948){_0x5204e2(_0x4b1948);});});});};var _0x5e31ee=function(_0x2258a4){return new BPromise(function(_0x2e17a8,_0x8c8dd2){_0x3ad5d4(_0x2258a4,_0x126a82)[_0xafbb('0x23')](function(_0x75fb20){_0x126a82[_0xafbb('0x1a')]=_0x75fb20['ret'];_0x4691e5[_0xafbb('0x27')][_0xafbb('0x1e')]({'where':{'phone':_0x126a82[_0xafbb('0xc')],'CampaignId':_0x2258a4['id']}})['then'](function(_0x1816ad){if(!_[_0xafbb('0x1f')](_0x1816ad)){throw new Error('cmContact,\x20afterCreate\x20'+_0x126a82[_0xafbb('0xc')]+_0xafbb('0x2f')+_0x2258a4['id']);}return _0x4691e5['CmHopperFinal'][_0xafbb('0x1e')]({'where':{'calleridnum':_0x126a82[_0xafbb('0xc')],'CampaignId':_0x2258a4['id']}});})[_0xafbb('0x23')](function(_0x228219){if(!_[_0xafbb('0x1f')](_0x228219)){throw new Error(_0xafbb('0x30')+_0x126a82[_0xafbb('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x2258a4['id']);}return _0x4691e5[_0xafbb('0x27')]['create']({'phone':_0x126a82['phone'],'ContactId':_0x126a82['id'],'ListId':_0x126a82['ListId'],'priority':_0x126a82[_0xafbb('0x29')]?_0x126a82['priority']:0x2,'scheduledat':_0x126a82[_0xafbb('0x1a')]?_0x126a82[_0xafbb('0x1a')]:moment()[_0xafbb('0x22')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x126a82['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x126a82[_0xafbb('0x2a')]?_0x126a82['callbackUniqueid']:undefined,'callbackat':_0x126a82[_0xafbb('0x2a')]?moment()[_0xafbb('0x22')](_0xafbb('0x1b')):undefined,'CampaignId':_0x2258a4['id']});})[_0xafbb('0x2b')](function(_0x2c0cbf){_0x8c8dd2(_0x2c0cbf);});});});};if(_0x126a82['ListId']){_0x4691e5[_0xafbb('0x1d')][_0xafbb('0x31')]({'where':{'type':_0xafbb('0x32')},'attributes':['id',_0xafbb('0x33'),_0xafbb('0x1c')],'include':[{'model':_0x4691e5['CmList'],'as':_0xafbb('0x34'),'where':{'id':_0x126a82[_0xafbb('0x35')]}}]})[_0xafbb('0x23')](function(_0x239853){if(_0x239853){var _0x47442c=[];for(var _0x4badb2=0x0,_0x2aaf24;_0x4badb2<_0x239853['length'];_0x4badb2+=0x1){_0x2aaf24=_0x239853[_0x4badb2][_0xafbb('0x15')]({'plain':!![]});switch(_0x2aaf24[_0xafbb('0x33')]){case _0xafbb('0x36'):_0xc28e08(_0x2aaf24)['catch'](_0xa8423());break;case'onlyIfOpen':_0x564e7d(_0x2aaf24)['catch'](_0xa8423());break;default:_0x3ad5d4(_0x2aaf24,_0x126a82)[_0xafbb('0x23')](function(_0x56f09a){_0x126a82[_0xafbb('0x1a')]=_0x56f09a[_0xafbb('0x24')];_0x4691e5[_0xafbb('0x27')][_0xafbb('0x28')]({'phone':_0x126a82[_0xafbb('0xc')],'ContactId':_0x126a82['id'],'ListId':_0x126a82['ListId'],'scheduledat':_0x126a82[_0xafbb('0x1a')]?_0x126a82[_0xafbb('0x1a')]:moment()['format'](_0xafbb('0x1b')),'priority':_0x126a82['priority']?_0x126a82[_0xafbb('0x29')]:0x2,'callback':_0x126a82[_0xafbb('0x2a')]?!![]:![],'callbackuniqueid':_0x126a82['callbackUniqueid']?_0x126a82[_0xafbb('0x2a')]:undefined,'callbackat':_0x126a82[_0xafbb('0x2a')]?moment()['format'](_0xafbb('0x1b')):undefined,'VoiceQueueId':_0x2aaf24['id']})[_0xafbb('0x2b')](_0xa8423());});}}}})[_0xafbb('0x23')](function(){return _0x4691e5[_0xafbb('0x1d')][_0xafbb('0x31')]({'where':{'type':_0xafbb('0x32')},'attributes':['id'],'include':[{'model':_0x4691e5[_0xafbb('0x37')],'as':_0xafbb('0x38'),'where':{'id':_0x126a82[_0xafbb('0x35')]}}]})[_0xafbb('0x23')](function(_0x2ceb3b){if(_0x2ceb3b){var _0x245556=[];for(var _0x1b7244=0x0,_0x184f0a;_0x1b7244<_0x2ceb3b[_0xafbb('0x39')];_0x1b7244+=0x1){_0x184f0a=_0x2ceb3b[_0x1b7244][_0xafbb('0x15')]({'plain':!![]});_0x4691e5['CmHopperBlack'][_0xafbb('0x28')]({'phone':_0x126a82['phone'],'ContactId':_0x126a82['id'],'ListId':_0x126a82[_0xafbb('0x35')],'VoiceQueueId':_0x184f0a['id']})['catch'](function(_0x1f3546){logger['error']('cmContact,\x20%s,\x20%s','afterCreate',_0x1f3546['message']);});}}});})[_0xafbb('0x23')](function(){return _0x4691e5[_0xafbb('0x3a')][_0xafbb('0x31')]({'attributes':['id',_0xafbb('0x33'),_0xafbb('0x1c')],'include':[{'model':_0x4691e5[_0xafbb('0x37')],'as':_0xafbb('0x34'),'where':{'id':_0x126a82[_0xafbb('0x35')]}}]})[_0xafbb('0x23')](function(_0x309c68){if(_0x309c68){var _0x3d2a8a=[];for(var _0xc01c05=0x0,_0x4e6310;_0xc01c05<_0x309c68['length'];_0xc01c05+=0x1){_0x4e6310=_0x309c68[_0xc01c05][_0xafbb('0x15')]({'plain':!![]});switch(_0x4e6310[_0xafbb('0x33')]){case _0xafbb('0x36'):_0x5e31ee(_0x4e6310)['catch'](_0x3842db());break;case _0xafbb('0x3b'):_0x36638e(_0x4e6310)['catch'](_0x3842db());break;default:_0x4691e5[_0xafbb('0x27')]['create']({'phone':_0x126a82[_0xafbb('0xc')],'ContactId':_0x126a82['id'],'ListId':_0x126a82[_0xafbb('0x35')],'scheduledat':_0x126a82[_0xafbb('0x1a')]?_0x126a82[_0xafbb('0x1a')]:moment()[_0xafbb('0x22')](_0xafbb('0x1b')),'priority':_0x126a82[_0xafbb('0x29')]?_0x126a82['priority']:0x2,'callback':_0x126a82[_0xafbb('0x2a')]?!![]:![],'callbackuniqueid':_0x126a82[_0xafbb('0x2a')]?_0x126a82['callbackUniqueid']:undefined,'callbackat':_0x126a82[_0xafbb('0x2a')]?moment()[_0xafbb('0x22')](_0xafbb('0x1b')):undefined,'CampaignId':_0x4e6310['id']})[_0xafbb('0x2b')](_0x3842db());}}}});})['then'](function(){return _0x4691e5[_0xafbb('0x3a')]['findAll']({'attributes':['id'],'include':[{'model':_0x4691e5[_0xafbb('0x37')],'as':_0xafbb('0x38'),'where':{'id':_0x126a82[_0xafbb('0x35')]}}]})[_0xafbb('0x23')](function(_0x5f3150){if(_0x5f3150){var _0x2e86bb=[];for(var _0x5c68bf=0x0,_0x1779b2;_0x5c68bf<_0x5f3150[_0xafbb('0x39')];_0x5c68bf+=0x1){_0x1779b2=_0x5f3150[_0x5c68bf][_0xafbb('0x15')]({'plain':!![]});_0x4691e5[_0xafbb('0x3c')][_0xafbb('0x28')]({'phone':_0x126a82[_0xafbb('0xc')],'ContactId':_0x126a82['id'],'ListId':_0x126a82[_0xafbb('0x35')],'CampaignId':_0x1779b2['id']})[_0xafbb('0x2b')](function(_0x46ecaa){logger[_0xafbb('0x16')]('cmContact,\x20%s,\x20%s',_0xafbb('0x18'),_0x46ecaa[_0xafbb('0x3d')]);});}}});})['then'](function(){_0x54742e();})[_0xafbb('0x2b')](function(_0x1f03cf){logger[_0xafbb('0x16')](_0xafbb('0x3e'),_0xafbb('0x18'),_0x1f03cf[_0xafbb('0x3d')]);_0x54742e(_0x1f03cf);});}else{_0x54742e(new Error(_0xafbb('0x3f')));}},'afterDestroy':function(_0x40bacb,_0xd9b1b0,_0x57def7){var _0x7fdb4b=_0x522966[_0xafbb('0x14')];var _0xbe97de=_0x40bacb[_0xafbb('0x15')]({'plain':!![]});return _0x7fdb4b[_0xafbb('0x27')][_0xafbb('0x31')]({'raw':!![],'where':{'ListId':_0xbe97de[_0xafbb('0x35')],'ContactId':_0xbe97de['id']}})[_0xafbb('0x23')](function(_0x11b594){if(!_[_0xafbb('0x40')](_0x11b594)){var _0x389d8a=[];for(var _0x52990f=0x0;_0x52990f<_0x11b594[_0xafbb('0x39')];_0x52990f+=0x1){var _0x28b571=_0x7fdb4b[_0xafbb('0x27')][_0xafbb('0x41')]({'where':{'ListId':_0x11b594[_0x52990f][_0xafbb('0x35')],'ContactId':_0x11b594[_0x52990f]['ContactId'],'VoiceQueueId':_0x11b594[_0x52990f][_0xafbb('0x42')],'CampaignId':_0x11b594[_0x52990f][_0xafbb('0x43')]}});_0x389d8a[_0xafbb('0x44')](_0x28b571);}return BPromise['all'](_0x389d8a);}})[_0xafbb('0x23')](function(_0x28861e){logger[_0xafbb('0x45')](_0xafbb('0x46'),util[_0xafbb('0x19')](_0x28861e,{'showHidden':![],'depth':null}));_0x57def7();})[_0xafbb('0x2b')](function(_0x2bf0ac){logger['error'](_0xafbb('0x47'),util[_0xafbb('0x19')](_0x2bf0ac,{'showHidden':![],'depth':null}));_0x57def7(_0x2bf0ac);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index fd9d776..a2307cc 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['phone','ListId','Contact','CmContactId','create','body','keys','length','startsWith','update','table','cm_contacts','id\x20=\x20?','sequelize','query','CreateCmContact','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./cmContact.socket','register','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','where','limit','include','map','model','attributes','then','stringify','CmContactHasItem','find'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var squel=require('squel');var db=require(_0x0a9e('0x4'))['db'];var utils=require(_0x0a9e('0x5'));var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var config=require(_0x0a9e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0a9e('0x9')][_0x0a9e('0xa')]({'port':0x232a});config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithRpcPromise(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){return client['request'](_0x307b3e,_0xfeb75b)['then'](function(_0x4cfe67){logger[_0x0a9e('0xf')](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));logger[_0x0a9e('0x12')](_0x0a9e('0x13'),_0x3ab53f,_0x0a9e('0x11'),JSON['stringify'](_0x4cfe67));if(_0x4cfe67[_0x0a9e('0x14')]){if(_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x15')]===0x1f4){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')]['message']);return _0x4a4c56(_0x4cfe67[_0x0a9e('0x14')]['message']);}logger[_0x0a9e('0x14')]('CmContact,\x20%s,\x20%s',_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x16')]);return _0xbd1168(_0x4cfe67['error'][_0x0a9e('0x16')]);}else{logger['info'](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));_0xbd1168(_0x4cfe67[_0x0a9e('0x17')][_0x0a9e('0x16')]);}})[_0x0a9e('0x18')](function(_0x2eb11f){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x2eb11f);_0x4a4c56(_0x2eb11f);});});}exports[_0x0a9e('0x19')]=function(_0x112016){var _0x1c696a=this;return new Promise(function(_0x105080,_0x4bb1e3){return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':_0x112016['options']?_0x112016[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x112016['options']?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')]||null:null,'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')]['attributes']||null:null,'limit':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1e')]||null:null,'include':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x112016['options']['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x21')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x22')],'include':_0x197ec0[_0x0a9e('0x1f')]?_['map'](_0x197ec0[_0x0a9e('0x1f')],function(_0x479bc4){return{'model':db[_0x479bc4[_0x0a9e('0x21')]],'as':_0x479bc4['as'],'attributes':_0x479bc4['attributes'],'include':_0x479bc4[_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x479bc4[_0x0a9e('0x1f')],function(_0x14433c){return{'model':db[_0x14433c[_0x0a9e('0x21')]],'as':_0x14433c['as'],'attributes':_0x14433c[_0x0a9e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x14de77){logger['info'](_0x0a9e('0x19'),_0x112016);logger[_0x0a9e('0x12')](_0x0a9e('0x19'),_0x112016,JSON[_0x0a9e('0x24')](_0x14de77));if(_0x14de77['length']==0x0){return db[_0x0a9e('0x25')][_0x0a9e('0x26')]({'raw':!![],'where':{'item':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x27')]},'include':[{'model':db[_0x0a9e('0x1a')],'where':{'ListId':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')][_0x0a9e('0x28')],'deletedAt':{'$eq':null}},'as':_0x0a9e('0x29')}]})['then'](function(_0x426950){if(_['isNil'](_0x426950)){_0x105080(_0x14de77);}else{var _0x2407f9=_0x426950[_0x0a9e('0x2a')];return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':!![],'where':{'id':_0x2407f9},'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016['options'][_0x0a9e('0x22')]||null:null})[_0x0a9e('0x23')](function(_0x40cb85){_0x105080(_0x40cb85);});}});}else{_0x105080(_0x14de77);}})[_0x0a9e('0x18')](function(_0x2b45ea){logger[_0x0a9e('0x14')](_0x0a9e('0x19'),_0x2b45ea[_0x0a9e('0x16')],_0x112016);_0x4bb1e3(_0x1c696a['error'](0x1f4,_0x2b45ea[_0x0a9e('0x16')]));});});};exports['CreateCmContact']=function(_0x2cc7a0){var _0x14b13f=this;return new Promise(function(_0x2b7e7f,_0x3f3d41){return db['CmContact'][_0x0a9e('0x2b')](_0x2cc7a0[_0x0a9e('0x2c')],{'raw':_0x2cc7a0[_0x0a9e('0x1c')]?_0x2cc7a0[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e8694){var _0x5640eb;for(var _0x24936a=0x0;_0x24936a{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file +var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x1d4478,_0x583110){var _0x519f04=function(_0x2bdb07){while(--_0x2bdb07){_0x1d4478['push'](_0x1d4478['shift']());}};_0x519f04(++_0x583110);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/phones',auth['isAuthenticated'](),controller['getAdditionalPhones']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getHopperHistories']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x18')]('/merge',auth[_0x0a9e('0xd')](),controller['merge']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/phones',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x1e'),auth['isAuthenticated'](),controller['duplicateAdditionalPhones']);router[_0x0a9e('0x18')](_0x0a9e('0x1f'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xfb6e48,_0x2fb0e4,_0x3b45bc){_0x3b45bc(null,path[_0x0a9e('0x21')](config[_0x0a9e('0x22')],_0x0a9e('0x23')));},'filename':function(_0x16b1ca,_0x5ea472,_0x59181e){_0x5ea472[_0x0a9e('0x24')]=_0x5ea472[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.attributes.js b/server/api/cmContactHasItem/cmContactHasItem.attributes.js index d5c22a1..a71244a 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.attributes.js +++ b/server/api/cmContactHasItem/cmContactHasItem.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0531=['INTEGER','STRING','sequelize','exports'];(function(_0x1ba995,_0x46e0e3){var _0x4798bf=function(_0x544294){while(--_0x544294){_0x1ba995['push'](_0x1ba995['shift']());}};_0x4798bf(++_0x46e0e3);}(_0x0531,0xde));var _0x1053=function(_0x1e8b1e,_0x407bbd){_0x1e8b1e=_0x1e8b1e-0x0;var _0x4a0fde=_0x0531[_0x1e8b1e];return _0x4a0fde;};'use strict';var Sequelize=require(_0x1053('0x0'));module[_0x1053('0x1')]={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x1053('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize[_0x1053('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0x1053('0x3')],'defaultValue':null}}; \ No newline at end of file +var _0x4d46=['exports','INTEGER','STRING','sequelize'];(function(_0x131881,_0x4a2bcf){var _0x3e14ad=function(_0x5f036f){while(--_0x5f036f){_0x131881['push'](_0x131881['shift']());}};_0x3e14ad(++_0x4a2bcf);}(_0x4d46,0x197));var _0x64d4=function(_0x47965e,_0x1163f8){_0x47965e=_0x47965e-0x0;var _0x277d2d=_0x4d46[_0x47965e];return _0x277d2d;};'use strict';var Sequelize=require(_0x64d4('0x0'));module[_0x64d4('0x1')]={'CmContactId':{'type':Sequelize[_0x64d4('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0x64d4('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x64d4('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x64d4('0x3')],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize[_0x64d4('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0x64d4('0x3')],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js index 7dc1896..2780c23 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.controller.js +++ b/server/api/cmContactHasItem/cmContactHasItem.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x58ff=['nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','update','destroy','then','get','CmContactHasItems','UserProfileResource','error','stack','name','map','CmContactHasItem','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty'];(function(_0x20d0dc,_0x57635c){var _0x208280=function(_0x416ae4){while(--_0x416ae4){_0x20d0dc['push'](_0x20d0dc['shift']());}};_0x208280(++_0x57635c);}(_0x58ff,0x1ad));var _0xf58f=function(_0x55ff82,_0x5d2144){_0x55ff82=_0x55ff82-0x0;var _0x13ba8e=_0x58ff[_0x55ff82];return _0x13ba8e;};'use strict';var emlformat=require(_0xf58f('0x0'));var rimraf=require(_0xf58f('0x1'));var zipdir=require(_0xf58f('0x2'));var jsonpatch=require(_0xf58f('0x3'));var rp=require(_0xf58f('0x4'));var moment=require(_0xf58f('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xf58f('0x6'));var sox=require('sox');var csv=require(_0xf58f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf58f('0x8'));var _=require(_0xf58f('0x9'));var squel=require(_0xf58f('0xa'));var crypto=require('crypto');var jsforce=require(_0xf58f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf58f('0x7'));var querystring=require(_0xf58f('0xc'));var Papa=require(_0xf58f('0xd'));var Redis=require(_0xf58f('0xe'));var authService=require(_0xf58f('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xf58f('0x10'));var hardwareService=require(_0xf58f('0x11'));var logger=require(_0xf58f('0x12'))(_0xf58f('0x13'));var utils=require(_0xf58f('0x14'));var config=require(_0xf58f('0x15'));var licenseUtil=require(_0xf58f('0x16'));var db=require(_0xf58f('0x17'))['db'];function respondWithStatusCode(_0xd9dc12,_0x49c35d){_0x49c35d=_0x49c35d||0xcc;return function(_0x2f3aaa){if(_0x2f3aaa){return _0xd9dc12[_0xf58f('0x18')](_0x49c35d);}return _0xd9dc12[_0xf58f('0x19')](_0x49c35d)[_0xf58f('0x1a')]();};}function respondWithResult(_0xb10d70,_0x35529c){_0x35529c=_0x35529c||0xc8;return function(_0x3b4b0d){if(_0x3b4b0d){return _0xb10d70[_0xf58f('0x19')](_0x35529c)['json'](_0x3b4b0d);}};}function respondWithFilteredResult(_0x34db25,_0x1aa34b){return function(_0x50b2d2){if(_0x50b2d2){var _0x5a46d8=typeof _0x1aa34b[_0xf58f('0x1b')]===_0xf58f('0x1c')&&typeof _0x1aa34b[_0xf58f('0x1d')]===_0xf58f('0x1c');var _0x2bab62=_0x50b2d2[_0xf58f('0x1e')];var _0x287caa=_0x5a46d8?0x0:_0x1aa34b['offset'];var _0x48d177=_0x5a46d8?_0x50b2d2[_0xf58f('0x1e')]:_0x1aa34b[_0xf58f('0x1b')]+_0x1aa34b[_0xf58f('0x1d')];var _0x3831ca;if(_0x48d177>=_0x2bab62){_0x48d177=_0x2bab62;_0x3831ca=0xc8;}else{_0x3831ca=0xce;}_0x34db25[_0xf58f('0x19')](_0x3831ca);return _0x34db25[_0xf58f('0x1f')]('Content-Range',_0x287caa+'-'+_0x48d177+'/'+_0x2bab62)[_0xf58f('0x20')](_0x50b2d2);}return null;};}function patchUpdates(_0x40b43d){return function(_0xab29fb){try{jsonpatch['apply'](_0xab29fb,_0x40b43d,!![]);}catch(_0x31c020){return BPromise[_0xf58f('0x21')](_0x31c020);}return _0xab29fb['save']();};}function saveUpdates(_0x3141cb,_0x4e81de){return function(_0x42c5bf){if(_0x42c5bf){return _0x42c5bf[_0xf58f('0x22')](_0x3141cb)['then'](function(_0x20a97d){return _0x20a97d;});}return null;};}function removeEntity(_0x57bda7,_0x4887bd){return function(_0x180177){if(_0x180177){return _0x180177[_0xf58f('0x23')]()[_0xf58f('0x24')](function(){var _0x183ba0=_0x180177[_0xf58f('0x25')]({'plain':!![]});var _0x4cdcf6=_0xf58f('0x26');return db[_0xf58f('0x27')][_0xf58f('0x23')]({'where':{'type':_0x4cdcf6,'resourceId':_0x183ba0['id']}})[_0xf58f('0x24')](function(){return _0x180177;});})['then'](function(){_0x57bda7['status'](0xcc)[_0xf58f('0x1a')]();});}};}function handleEntityNotFound(_0x52dcf1,_0x21df33){return function(_0x5c0a6d){if(!_0x5c0a6d){_0x52dcf1[_0xf58f('0x18')](0x194);}return _0x5c0a6d;};}function handleError(_0xf3441e,_0x53352e){_0x53352e=_0x53352e||0x1f4;return function(_0x210ad2){logger[_0xf58f('0x28')](_0x210ad2[_0xf58f('0x29')]);if(_0x210ad2[_0xf58f('0x2a')]){delete _0x210ad2[_0xf58f('0x2a')];}_0xf3441e['status'](_0x53352e)['send'](_0x210ad2);};}exports['index']=function(_0x5a8a8d,_0x2907b7){var _0x1bf38f={},_0x54466f={},_0x1e76be={'count':0x0,'rows':[]};var _0x37a856=_[_0xf58f('0x2b')](db[_0xf58f('0x2c')][_0xf58f('0x2d')],function(_0xbe5469){return{'name':_0xbe5469[_0xf58f('0x2e')],'type':_0xbe5469[_0xf58f('0x2f')][_0xf58f('0x30')]};});_0x54466f[_0xf58f('0x31')]=_[_0xf58f('0x2b')](_0x37a856,_0xf58f('0x2a'));_0x54466f[_0xf58f('0x32')]=_[_0xf58f('0x33')](_0x5a8a8d[_0xf58f('0x32')]);_0x54466f[_0xf58f('0x34')]=_[_0xf58f('0x35')](_0x54466f[_0xf58f('0x31')],_0x54466f[_0xf58f('0x32')]);_0x1bf38f['attributes']=_['intersection'](_0x54466f[_0xf58f('0x31')],qs['fields'](_0x5a8a8d['query'][_0xf58f('0x36')]));_0x1bf38f[_0xf58f('0x37')]=_0x1bf38f['attributes']['length']?_0x1bf38f[_0xf58f('0x37')]:_0x54466f[_0xf58f('0x31')];if(!_0x5a8a8d['query'][_0xf58f('0x38')](_0xf58f('0x39'))){_0x1bf38f['limit']=qs['limit'](_0x5a8a8d[_0xf58f('0x32')]['limit']);_0x1bf38f[_0xf58f('0x1b')]=qs[_0xf58f('0x1b')](_0x5a8a8d[_0xf58f('0x32')][_0xf58f('0x1b')]);}_0x1bf38f[_0xf58f('0x3a')]=qs[_0xf58f('0x3b')](_0x5a8a8d[_0xf58f('0x32')][_0xf58f('0x3b')]);_0x1bf38f[_0xf58f('0x3c')]=qs[_0xf58f('0x34')](_['pick'](_0x5a8a8d['query'],_0x54466f[_0xf58f('0x34')]),_0x37a856);if(_0x5a8a8d[_0xf58f('0x32')][_0xf58f('0x3d')]){_0x1bf38f[_0xf58f('0x3c')]=_[_0xf58f('0x3e')](_0x1bf38f['where'],{'$or':_[_0xf58f('0x2b')](_0x37a856,function(_0x3369fc){if(_0x3369fc[_0xf58f('0x2f')]!==_0xf58f('0x3f')){var _0x35d035={};_0x35d035[_0x3369fc[_0xf58f('0x2a')]]={'$like':'%'+_0x5a8a8d[_0xf58f('0x32')][_0xf58f('0x3d')]+'%'};return _0x35d035;}})});}_0x1bf38f=_['merge']({},_0x1bf38f,_0x5a8a8d['options']);var _0x59808a={'where':_0x1bf38f[_0xf58f('0x3c')]};return db[_0xf58f('0x2c')][_0xf58f('0x1e')](_0x59808a)[_0xf58f('0x24')](function(_0x2f0815){_0x1e76be[_0xf58f('0x1e')]=_0x2f0815;if(_0x5a8a8d[_0xf58f('0x32')][_0xf58f('0x40')]){_0x1bf38f[_0xf58f('0x41')]=[{'all':!![]}];}return db[_0xf58f('0x2c')][_0xf58f('0x42')](_0x1bf38f);})['then'](function(_0x2e527f){_0x1e76be[_0xf58f('0x43')]=_0x2e527f;return _0x1e76be;})['then'](respondWithFilteredResult(_0x2907b7,_0x1bf38f))[_0xf58f('0x44')](handleError(_0x2907b7,null));};exports[_0xf58f('0x45')]=function(_0x520a5c,_0x3b762d){var _0x3defdc={'raw':!![],'where':{'id':_0x520a5c[_0xf58f('0x46')]['id']}},_0x1cad15={};_0x1cad15['model']=_[_0xf58f('0x33')](db['CmContactHasItem'][_0xf58f('0x2d')]);_0x1cad15[_0xf58f('0x32')]=_[_0xf58f('0x33')](_0x520a5c[_0xf58f('0x32')]);_0x1cad15['filters']=_[_0xf58f('0x35')](_0x1cad15[_0xf58f('0x31')],_0x1cad15[_0xf58f('0x32')]);_0x3defdc[_0xf58f('0x37')]=_[_0xf58f('0x35')](_0x1cad15[_0xf58f('0x31')],qs[_0xf58f('0x36')](_0x520a5c[_0xf58f('0x32')][_0xf58f('0x36')]));_0x3defdc[_0xf58f('0x37')]=_0x3defdc[_0xf58f('0x37')][_0xf58f('0x47')]?_0x3defdc[_0xf58f('0x37')]:_0x1cad15[_0xf58f('0x31')];if(_0x520a5c['query'][_0xf58f('0x40')]){_0x3defdc[_0xf58f('0x41')]=[{'all':!![]}];}_0x3defdc=_[_0xf58f('0x3e')]({},_0x3defdc,_0x520a5c['options']);return db[_0xf58f('0x2c')][_0xf58f('0x48')](_0x3defdc)['then'](handleEntityNotFound(_0x3b762d,null))[_0xf58f('0x24')](respondWithResult(_0x3b762d,null))['catch'](handleError(_0x3b762d,null));};exports[_0xf58f('0x49')]=function(_0x564335,_0x2f76e4){return db['CmContactHasItem'][_0xf58f('0x49')](_0x564335[_0xf58f('0x4a')],{})[_0xf58f('0x24')](function(_0x4dc826){var _0x446b96=_0x564335[_0xf58f('0x4b')][_0xf58f('0x25')]({'plain':!![]});if(!_0x446b96)throw new Error(_0xf58f('0x4c'));if(_0x446b96[_0xf58f('0x4d')]===_0xf58f('0x4b')){var _0x52b591=_0x4dc826[_0xf58f('0x25')]({'plain':!![]});var _0xd5d5a3='CmContactHasItems';return db[_0xf58f('0x4e')]['find']({'where':{'name':_0xd5d5a3,'userProfileId':_0x446b96[_0xf58f('0x4f')]},'raw':!![]})['then'](function(_0x1b3a65){if(_0x1b3a65&&_0x1b3a65['autoAssociation']===0x0){return db[_0xf58f('0x27')][_0xf58f('0x49')]({'name':_0x52b591[_0xf58f('0x2a')],'resourceId':_0x52b591['id'],'type':_0x1b3a65[_0xf58f('0x2a')],'sectionId':_0x1b3a65['id']},{})[_0xf58f('0x24')](function(){return _0x4dc826;});}else{return _0x4dc826;}})[_0xf58f('0x44')](function(_0x9c700c){logger[_0xf58f('0x28')](_0xf58f('0x50'),_0x9c700c);throw _0x9c700c;});}return _0x4dc826;})[_0xf58f('0x24')](respondWithResult(_0x2f76e4,0xc9))[_0xf58f('0x44')](handleError(_0x2f76e4,null));};exports[_0xf58f('0x22')]=function(_0x2b5701,_0x1649a2){if(_0x2b5701['body']['id']){delete _0x2b5701['body']['id'];}return db[_0xf58f('0x2c')]['find']({'where':{'id':_0x2b5701[_0xf58f('0x46')]['id']}})[_0xf58f('0x24')](handleEntityNotFound(_0x1649a2,null))['then'](saveUpdates(_0x2b5701[_0xf58f('0x4a')],null))[_0xf58f('0x24')](respondWithResult(_0x1649a2,null))['catch'](handleError(_0x1649a2,null));};exports[_0xf58f('0x23')]=function(_0x365eb2,_0x49b14f){return db[_0xf58f('0x2c')][_0xf58f('0x48')]({'where':{'id':_0x365eb2['params']['id']}})['then'](handleEntityNotFound(_0x49b14f,null))['then'](removeEntity(_0x49b14f,null))['catch'](handleError(_0x49b14f,null));}; \ No newline at end of file +var _0xba7f=['destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','get','CmContactHasItems','UserProfileResource','stack','name','send','index','map','CmContactHasItem','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','findAll','catch','show','params','keys','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xba7f,0xad));var _0xfba7=function(_0x3a91b3,_0x1531c4){_0x3a91b3=_0x3a91b3-0x0;var _0x316e2c=_0xba7f[_0x3a91b3];return _0x316e2c;};'use strict';var emlformat=require(_0xfba7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfba7('0x1'));var jsonpatch=require(_0xfba7('0x2'));var rp=require(_0xfba7('0x3'));var moment=require(_0xfba7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xfba7('0x5'));var util=require(_0xfba7('0x6'));var path=require('path');var sox=require(_0xfba7('0x7'));var csv=require('to-csv');var ejs=require(_0xfba7('0x8'));var fs=require('fs');var fs_extra=require(_0xfba7('0x9'));var _=require(_0xfba7('0xa'));var squel=require(_0xfba7('0xb'));var crypto=require(_0xfba7('0xc'));var jsforce=require(_0xfba7('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfba7('0xe'));var querystring=require(_0xfba7('0xf'));var Papa=require(_0xfba7('0x10'));var Redis=require(_0xfba7('0x11'));var authService=require(_0xfba7('0x12'));var qs=require(_0xfba7('0x13'));var as=require(_0xfba7('0x14'));var hardwareService=require(_0xfba7('0x15'));var logger=require(_0xfba7('0x16'))(_0xfba7('0x17'));var utils=require(_0xfba7('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xfba7('0x19'));var db=require(_0xfba7('0x1a'))['db'];function respondWithStatusCode(_0x13bef8,_0x4b8256){_0x4b8256=_0x4b8256||0xcc;return function(_0x2cfbcb){if(_0x2cfbcb){return _0x13bef8[_0xfba7('0x1b')](_0x4b8256);}return _0x13bef8[_0xfba7('0x1c')](_0x4b8256)[_0xfba7('0x1d')]();};}function respondWithResult(_0x3815fb,_0x157ccf){_0x157ccf=_0x157ccf||0xc8;return function(_0xd753fc){if(_0xd753fc){return _0x3815fb[_0xfba7('0x1c')](_0x157ccf)[_0xfba7('0x1e')](_0xd753fc);}};}function respondWithFilteredResult(_0x4bc32f,_0x2645c3){return function(_0xcc02a8){if(_0xcc02a8){var _0x9f92d=typeof _0x2645c3[_0xfba7('0x1f')]==='undefined'&&typeof _0x2645c3[_0xfba7('0x20')]===_0xfba7('0x21');var _0x4cf936=_0xcc02a8[_0xfba7('0x22')];var _0x207700=_0x9f92d?0x0:_0x2645c3[_0xfba7('0x1f')];var _0x17db2c=_0x9f92d?_0xcc02a8[_0xfba7('0x22')]:_0x2645c3[_0xfba7('0x1f')]+_0x2645c3[_0xfba7('0x20')];var _0x4039cb;if(_0x17db2c>=_0x4cf936){_0x17db2c=_0x4cf936;_0x4039cb=0xc8;}else{_0x4039cb=0xce;}_0x4bc32f['status'](_0x4039cb);return _0x4bc32f[_0xfba7('0x23')](_0xfba7('0x24'),_0x207700+'-'+_0x17db2c+'/'+_0x4cf936)['json'](_0xcc02a8);}return null;};}function patchUpdates(_0x509387){return function(_0x1cd2d5){try{jsonpatch[_0xfba7('0x25')](_0x1cd2d5,_0x509387,!![]);}catch(_0x341baa){return BPromise['reject'](_0x341baa);}return _0x1cd2d5[_0xfba7('0x26')]();};}function saveUpdates(_0x55725c,_0x376727){return function(_0x16dd39){if(_0x16dd39){return _0x16dd39[_0xfba7('0x27')](_0x55725c)[_0xfba7('0x28')](function(_0x5da84d){return _0x5da84d;});}return null;};}function removeEntity(_0x3f8429,_0x420de2){return function(_0x55d744){if(_0x55d744){return _0x55d744['destroy']()['then'](function(){var _0x406303=_0x55d744[_0xfba7('0x29')]({'plain':!![]});var _0x2ed045=_0xfba7('0x2a');return db[_0xfba7('0x2b')]['destroy']({'where':{'type':_0x2ed045,'resourceId':_0x406303['id']}})[_0xfba7('0x28')](function(){return _0x55d744;});})[_0xfba7('0x28')](function(){_0x3f8429[_0xfba7('0x1c')](0xcc)[_0xfba7('0x1d')]();});}};}function handleEntityNotFound(_0x16ed69,_0x53dfb1){return function(_0x5edd62){if(!_0x5edd62){_0x16ed69[_0xfba7('0x1b')](0x194);}return _0x5edd62;};}function handleError(_0x3d09c9,_0x3849e6){_0x3849e6=_0x3849e6||0x1f4;return function(_0x5971d7){logger['error'](_0x5971d7[_0xfba7('0x2c')]);if(_0x5971d7[_0xfba7('0x2d')]){delete _0x5971d7[_0xfba7('0x2d')];}_0x3d09c9['status'](_0x3849e6)[_0xfba7('0x2e')](_0x5971d7);};}exports[_0xfba7('0x2f')]=function(_0x470e99,_0x21bba5){var _0x1acbf0={},_0x203e6e={},_0x4aadb6={'count':0x0,'rows':[]};var _0x296532=_[_0xfba7('0x30')](db[_0xfba7('0x31')]['rawAttributes'],function(_0xb41f5d){return{'name':_0xb41f5d['fieldName'],'type':_0xb41f5d[_0xfba7('0x32')][_0xfba7('0x33')]};});_0x203e6e[_0xfba7('0x34')]=_['map'](_0x296532,'name');_0x203e6e['query']=_['keys'](_0x470e99[_0xfba7('0x35')]);_0x203e6e[_0xfba7('0x36')]=_[_0xfba7('0x37')](_0x203e6e[_0xfba7('0x34')],_0x203e6e['query']);_0x1acbf0[_0xfba7('0x38')]=_[_0xfba7('0x37')](_0x203e6e[_0xfba7('0x34')],qs[_0xfba7('0x39')](_0x470e99['query'][_0xfba7('0x39')]));_0x1acbf0[_0xfba7('0x38')]=_0x1acbf0[_0xfba7('0x38')][_0xfba7('0x3a')]?_0x1acbf0['attributes']:_0x203e6e[_0xfba7('0x34')];if(!_0x470e99['query'][_0xfba7('0x3b')]('nolimit')){_0x1acbf0[_0xfba7('0x20')]=qs[_0xfba7('0x20')](_0x470e99['query'][_0xfba7('0x20')]);_0x1acbf0['offset']=qs[_0xfba7('0x1f')](_0x470e99[_0xfba7('0x35')]['offset']);}_0x1acbf0['order']=qs[_0xfba7('0x3c')](_0x470e99[_0xfba7('0x35')][_0xfba7('0x3c')]);_0x1acbf0['where']=qs[_0xfba7('0x36')](_[_0xfba7('0x3d')](_0x470e99[_0xfba7('0x35')],_0x203e6e[_0xfba7('0x36')]),_0x296532);if(_0x470e99[_0xfba7('0x35')]['filter']){_0x1acbf0[_0xfba7('0x3e')]=_[_0xfba7('0x3f')](_0x1acbf0[_0xfba7('0x3e')],{'$or':_[_0xfba7('0x30')](_0x296532,function(_0x211fdd){if(_0x211fdd['type']!==_0xfba7('0x40')){var _0xd81141={};_0xd81141[_0x211fdd[_0xfba7('0x2d')]]={'$like':'%'+_0x470e99[_0xfba7('0x35')][_0xfba7('0x41')]+'%'};return _0xd81141;}})});}_0x1acbf0=_[_0xfba7('0x3f')]({},_0x1acbf0,_0x470e99['options']);var _0x5e99f9={'where':_0x1acbf0[_0xfba7('0x3e')]};return db[_0xfba7('0x31')][_0xfba7('0x22')](_0x5e99f9)[_0xfba7('0x28')](function(_0x3d7021){_0x4aadb6[_0xfba7('0x22')]=_0x3d7021;if(_0x470e99['query'][_0xfba7('0x42')]){_0x1acbf0[_0xfba7('0x43')]=[{'all':!![]}];}return db[_0xfba7('0x31')][_0xfba7('0x44')](_0x1acbf0);})[_0xfba7('0x28')](function(_0x1252da){_0x4aadb6['rows']=_0x1252da;return _0x4aadb6;})[_0xfba7('0x28')](respondWithFilteredResult(_0x21bba5,_0x1acbf0))[_0xfba7('0x45')](handleError(_0x21bba5,null));};exports[_0xfba7('0x46')]=function(_0x34ef99,_0x2aa59a){var _0x18ef3a={'raw':!![],'where':{'id':_0x34ef99[_0xfba7('0x47')]['id']}},_0x12a455={};_0x12a455[_0xfba7('0x34')]=_[_0xfba7('0x48')](db[_0xfba7('0x31')][_0xfba7('0x49')]);_0x12a455[_0xfba7('0x35')]=_[_0xfba7('0x48')](_0x34ef99[_0xfba7('0x35')]);_0x12a455['filters']=_[_0xfba7('0x37')](_0x12a455['model'],_0x12a455[_0xfba7('0x35')]);_0x18ef3a[_0xfba7('0x38')]=_[_0xfba7('0x37')](_0x12a455[_0xfba7('0x34')],qs[_0xfba7('0x39')](_0x34ef99['query'][_0xfba7('0x39')]));_0x18ef3a[_0xfba7('0x38')]=_0x18ef3a['attributes'][_0xfba7('0x3a')]?_0x18ef3a[_0xfba7('0x38')]:_0x12a455['model'];if(_0x34ef99[_0xfba7('0x35')]['includeAll']){_0x18ef3a[_0xfba7('0x43')]=[{'all':!![]}];}_0x18ef3a=_['merge']({},_0x18ef3a,_0x34ef99['options']);return db[_0xfba7('0x31')][_0xfba7('0x4a')](_0x18ef3a)[_0xfba7('0x28')](handleEntityNotFound(_0x2aa59a,null))[_0xfba7('0x28')](respondWithResult(_0x2aa59a,null))[_0xfba7('0x45')](handleError(_0x2aa59a,null));};exports[_0xfba7('0x4b')]=function(_0x23ed8e,_0x58eea2){return db[_0xfba7('0x31')]['create'](_0x23ed8e[_0xfba7('0x4c')],{})['then'](function(_0x5efae5){var _0x1c0623=_0x23ed8e[_0xfba7('0x4d')]['get']({'plain':!![]});if(!_0x1c0623)throw new Error(_0xfba7('0x4e'));if(_0x1c0623[_0xfba7('0x4f')]===_0xfba7('0x4d')){var _0x40f58a=_0x5efae5[_0xfba7('0x29')]({'plain':!![]});var _0x48c73b=_0xfba7('0x2a');return db[_0xfba7('0x50')][_0xfba7('0x4a')]({'where':{'name':_0x48c73b,'userProfileId':_0x1c0623[_0xfba7('0x51')]},'raw':!![]})[_0xfba7('0x28')](function(_0xc7ab96){if(_0xc7ab96&&_0xc7ab96[_0xfba7('0x52')]===0x0){return db[_0xfba7('0x2b')]['create']({'name':_0x40f58a[_0xfba7('0x2d')],'resourceId':_0x40f58a['id'],'type':_0xc7ab96['name'],'sectionId':_0xc7ab96['id']},{})[_0xfba7('0x28')](function(){return _0x5efae5;});}else{return _0x5efae5;}})['catch'](function(_0x395dac){logger[_0xfba7('0x53')](_0xfba7('0x54'),_0x395dac);throw _0x395dac;});}return _0x5efae5;})[_0xfba7('0x28')](respondWithResult(_0x58eea2,0xc9))[_0xfba7('0x45')](handleError(_0x58eea2,null));};exports[_0xfba7('0x27')]=function(_0x3852a2,_0x58a403){if(_0x3852a2[_0xfba7('0x4c')]['id']){delete _0x3852a2[_0xfba7('0x4c')]['id'];}return db[_0xfba7('0x31')][_0xfba7('0x4a')]({'where':{'id':_0x3852a2[_0xfba7('0x47')]['id']}})[_0xfba7('0x28')](handleEntityNotFound(_0x58a403,null))['then'](saveUpdates(_0x3852a2['body'],null))['then'](respondWithResult(_0x58a403,null))[_0xfba7('0x45')](handleError(_0x58a403,null));};exports[_0xfba7('0x55')]=function(_0x3adabc,_0x4bf137){return db[_0xfba7('0x31')]['find']({'where':{'id':_0x3adabc[_0xfba7('0x47')]['id']}})[_0xfba7('0x28')](handleEntityNotFound(_0x4bf137,null))[_0xfba7('0x28')](removeEntity(_0x4bf137,null))[_0xfba7('0x45')](handleError(_0x4bf137,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 9dc0434..4272e13 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.model.js +++ b/server/api/cmContactHasItem/cmContactHasItem.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x35aa=['./cmContactHasItem.attributes','exports','define','CmContactHasItem','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x599d71,_0xc4507a){var _0x22b097=function(_0x1666a6){while(--_0x1666a6){_0x599d71['push'](_0x599d71['shift']());}};_0x22b097(++_0xc4507a);}(_0x35aa,0x7c));var _0xa35a=function(_0xc07d8c,_0x59d21f){_0xc07d8c=_0xc07d8c-0x0;var _0xdfe2ab=_0x35aa[_0xc07d8c];return _0xdfe2ab;};'use strict';var _=require(_0xa35a('0x0'));var util=require(_0xa35a('0x1'));var logger=require(_0xa35a('0x2'))('api');var moment=require(_0xa35a('0x3'));var BPromise=require('bluebird');var rp=require(_0xa35a('0x4'));var fs=require('fs');var path=require(_0xa35a('0x5'));var rimraf=require(_0xa35a('0x6'));var config=require(_0xa35a('0x7'));var attributes=require(_0xa35a('0x8'));module[_0xa35a('0x9')]=function(_0x2e2e98,_0x28f68c){return _0x2e2e98[_0xa35a('0xa')](_0xa35a('0xb'),attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x684f=['CmContactHasItem','cm_contact_has_items','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','define'];(function(_0x22ccc0,_0x914457){var _0xe2af6a=function(_0x55aa01){while(--_0x55aa01){_0x22ccc0['push'](_0x22ccc0['shift']());}};_0xe2af6a(++_0x914457);}(_0x684f,0x120));var _0xf684=function(_0x1ed3e4,_0x5621c2){_0x1ed3e4=_0x1ed3e4-0x0;var _0x1f2380=_0x684f[_0x1ed3e4];return _0x1f2380;};'use strict';var _=require(_0xf684('0x0'));var util=require(_0xf684('0x1'));var logger=require(_0xf684('0x2'))(_0xf684('0x3'));var moment=require(_0xf684('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf684('0x5'));var rimraf=require(_0xf684('0x6'));var config=require(_0xf684('0x7'));var attributes=require('./cmContactHasItem.attributes');module['exports']=function(_0x5d296a,_0x368aa5){return _0x5d296a[_0xf684('0x8')](_0xf684('0x9'),attributes,{'tableName':_0xf684('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js index 1c5c79e..42b8f88 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.rpc.js +++ b/server/api/cmContactHasItem/cmContactHasItem.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb61=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','CmContactHasItem,\x20%s,\x20%s','message','result','lodash','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x42fada,_0xe53baf){var _0x14a3e7=function(_0x42bfe5){while(--_0x42bfe5){_0x42fada['push'](_0x42fada['shift']());}};_0x14a3e7(++_0xe53baf);}(_0xcb61,0x14b));var _0x1cb6=function(_0x2d378d,_0x5f50d2){_0x2d378d=_0x2d378d-0x0;var _0x2417fe=_0xcb61[_0x2d378d];return _0x2417fe;};'use strict';var _=require(_0x1cb6('0x0'));var util=require('util');var moment=require(_0x1cb6('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1cb6('0x2'));var db=require(_0x1cb6('0x3'))['db'];var utils=require(_0x1cb6('0x4'));var logger=require(_0x1cb6('0x5'))('rpc');var config=require(_0x1cb6('0x6'));var jayson=require(_0x1cb6('0x7'));var client=jayson[_0x1cb6('0x8')][_0x1cb6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1f368d,_0x1b5c79,_0x134ac3){return new BPromise(function(_0x4aeb89,_0x532e18){return client[_0x1cb6('0xa')](_0x1f368d,_0x134ac3)[_0x1cb6('0xb')](function(_0x298c0a){logger[_0x1cb6('0xc')]('CmContactHasItem,\x20%s,\x20%s',_0x1b5c79,_0x1cb6('0xd'));logger[_0x1cb6('0xe')](_0x1cb6('0xf'),_0x1b5c79,'request\x20sent',JSON[_0x1cb6('0x10')](_0x298c0a));if(_0x298c0a[_0x1cb6('0x11')]){if(_0x298c0a[_0x1cb6('0x11')]['code']===0x1f4){logger[_0x1cb6('0x11')](_0x1cb6('0x12'),_0x1b5c79,_0x298c0a[_0x1cb6('0x11')][_0x1cb6('0x13')]);return _0x532e18(_0x298c0a[_0x1cb6('0x11')][_0x1cb6('0x13')]);}logger[_0x1cb6('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0x1b5c79,_0x298c0a[_0x1cb6('0x11')][_0x1cb6('0x13')]);return _0x4aeb89(_0x298c0a[_0x1cb6('0x11')][_0x1cb6('0x13')]);}else{logger[_0x1cb6('0xc')](_0x1cb6('0x12'),_0x1b5c79,_0x1cb6('0xd'));_0x4aeb89(_0x298c0a[_0x1cb6('0x14')][_0x1cb6('0x13')]);}})['catch'](function(_0x46da24){logger[_0x1cb6('0x11')](_0x1cb6('0x12'),_0x1b5c79,_0x46da24);_0x532e18(_0x46da24);});});} \ No newline at end of file +var _0x890b=['client','request','then','info','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','CmContactHasItem,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x482870,_0x23f26b){var _0x4ade02=function(_0x4594de){while(--_0x4594de){_0x482870['push'](_0x482870['shift']());}};_0x4ade02(++_0x23f26b);}(_0x890b,0xbe));var _0xb890=function(_0x4220b1,_0x599047){_0x4220b1=_0x4220b1-0x0;var _0x28c7e0=_0x890b[_0x4220b1];return _0x28c7e0;};'use strict';var _=require(_0xb890('0x0'));var util=require(_0xb890('0x1'));var moment=require('moment');var BPromise=require(_0xb890('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb890('0x3'));var db=require(_0xb890('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb890('0x5'))(_0xb890('0x6'));var config=require('../../config/environment');var jayson=require(_0xb890('0x7'));var client=jayson[_0xb890('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a68e4,_0x310f0a,_0x5a2f3c){return new BPromise(function(_0x319071,_0x57fd74){return client[_0xb890('0x9')](_0x3a68e4,_0x5a2f3c)[_0xb890('0xa')](function(_0x2a16a9){logger[_0xb890('0xb')]('CmContactHasItem,\x20%s,\x20%s',_0x310f0a,_0xb890('0xc'));logger[_0xb890('0xd')](_0xb890('0xe'),_0x310f0a,_0xb890('0xc'),JSON[_0xb890('0xf')](_0x2a16a9));if(_0x2a16a9[_0xb890('0x10')]){if(_0x2a16a9[_0xb890('0x10')][_0xb890('0x11')]===0x1f4){logger['error'](_0xb890('0x12'),_0x310f0a,_0x2a16a9[_0xb890('0x10')]['message']);return _0x57fd74(_0x2a16a9[_0xb890('0x10')]['message']);}logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x310f0a,_0x2a16a9['error'][_0xb890('0x13')]);return _0x319071(_0x2a16a9['error'][_0xb890('0x13')]);}else{logger['info'](_0xb890('0x12'),_0x310f0a,'request\x20sent');_0x319071(_0x2a16a9[_0xb890('0x14')][_0xb890('0x13')]);}})[_0xb890('0x15')](function(_0x26d3b9){logger[_0xb890('0x10')](_0xb890('0x12'),_0x310f0a,_0x26d3b9);_0x57fd74(_0x26d3b9);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 91aadfb..256b60e 100644 --- a/server/api/cmContactHasItem/index.js +++ b/server/api/cmContactHasItem/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xce03=['../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','index','show','create','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3dc2c0,_0x3e39ab){var _0x4291c6=function(_0x4229fc){while(--_0x4229fc){_0x3dc2c0['push'](_0x3dc2c0['shift']());}};_0x4291c6(++_0x3e39ab);}(_0xce03,0x114));var _0x3ce0=function(_0x324746,_0x4fd874){_0x324746=_0x324746-0x0;var _0x230038=_0xce03[_0x324746];return _0x230038;};'use strict';var multer=require(_0x3ce0('0x0'));var util=require(_0x3ce0('0x1'));var path=require(_0x3ce0('0x2'));var timeout=require(_0x3ce0('0x3'));var express=require(_0x3ce0('0x4'));var router=express[_0x3ce0('0x5')]();var fs_extra=require(_0x3ce0('0x6'));var auth=require(_0x3ce0('0x7'));var interaction=require(_0x3ce0('0x8'));var config=require(_0x3ce0('0x9'));var controller=require(_0x3ce0('0xa'));router[_0x3ce0('0xb')]('/',auth[_0x3ce0('0xc')](),controller[_0x3ce0('0xd')]);router[_0x3ce0('0xb')]('/:id',auth[_0x3ce0('0xc')](),controller[_0x3ce0('0xe')]);router['post']('/',auth[_0x3ce0('0xc')](),controller[_0x3ce0('0xf')]);router['put'](_0x3ce0('0x10'),auth[_0x3ce0('0xc')](),controller['update']);router['delete'](_0x3ce0('0x10'),auth[_0x3ce0('0xc')](),controller[_0x3ce0('0x11')]);module[_0x3ce0('0x12')]=router; \ No newline at end of file +var _0xbd31=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','show','post','isAuthenticated','create','put','/:id','delete','destroy'];(function(_0x2f0f20,_0xe6bbea){var _0x2c342e=function(_0x1993bd){while(--_0x1993bd){_0x2f0f20['push'](_0x2f0f20['shift']());}};_0x2c342e(++_0xe6bbea);}(_0xbd31,0x79));var _0x1bd3=function(_0x179f1c,_0x1a9730){_0x179f1c=_0x179f1c-0x0;var _0x3ba09b=_0xbd31[_0x179f1c];return _0x3ba09b;};'use strict';var multer=require(_0x1bd3('0x0'));var util=require(_0x1bd3('0x1'));var path=require(_0x1bd3('0x2'));var timeout=require(_0x1bd3('0x3'));var express=require(_0x1bd3('0x4'));var router=express[_0x1bd3('0x5')]();var fs_extra=require(_0x1bd3('0x6'));var auth=require(_0x1bd3('0x7'));var interaction=require(_0x1bd3('0x8'));var config=require(_0x1bd3('0x9'));var controller=require(_0x1bd3('0xa'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x1bd3('0xb')]);router[_0x1bd3('0xc')]('/',auth[_0x1bd3('0xd')](),controller[_0x1bd3('0xe')]);router[_0x1bd3('0xf')](_0x1bd3('0x10'),auth[_0x1bd3('0xd')](),controller['update']);router[_0x1bd3('0x11')](_0x1bd3('0x10'),auth[_0x1bd3('0xd')](),controller[_0x1bd3('0x12')]);module[_0x1bd3('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 41c8f55..e642ad4 100644 --- a/server/api/cmCustomField/cmCustomField.attributes.js +++ b/server/api/cmCustomField/cmCustomField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9da6=['BOOLEAN','ENUM','voice','sequelize','lodash','exports','VIRTUAL','getDataValue','alias','STRING','setDataValue','TEXT','long','type','select','values','isArray','stringify'];(function(_0x21391d,_0x357b8a){var _0x515d5e=function(_0xb88b77){while(--_0xb88b77){_0x21391d['push'](_0x21391d['shift']());}};_0x515d5e(++_0x357b8a);}(_0x9da6,0x1b3));var _0x69da=function(_0x201d18,_0x373335){_0x201d18=_0x201d18-0x0;var _0x58c0dd=_0x9da6[_0x201d18];return _0x58c0dd;};'use strict';var Sequelize=require(_0x69da('0x0'));var _=require(_0x69da('0x1'));module[_0x69da('0x2')]={'name':{'type':Sequelize[_0x69da('0x3')],'get':function(_0x50cb37){return this[_0x69da('0x4')](_0x69da('0x5'));}},'alias':{'type':Sequelize[_0x69da('0x6')],'allowNull':![],'set':function(_0x635b6c){this[_0x69da('0x7')]('alias',_0x635b6c?_0x635b6c:this['getDataValue']('name'));}},'type':{'type':Sequelize[_0x69da('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0x69da('0x8')](_0x69da('0x9')),'get':function(){if(this[_0x69da('0x4')](_0x69da('0xa'))===_0x69da('0xb')){return JSON['parse'](this[_0x69da('0x4')](_0x69da('0xc')));}else{return this['getDataValue'](_0x69da('0xc'));}},'set':function(_0x428d0c){if(Array[_0x69da('0xd')](_0x428d0c)){this[_0x69da('0x7')](_0x69da('0xc'),JSON[_0x69da('0xe')](_0x428d0c));}else{this[_0x69da('0x7')]('values',_0x428d0c);}}},'required':{'type':Sequelize[_0x69da('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x69da('0xf')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x69da('0x10')](_0x69da('0x11'))}}; \ No newline at end of file +var _0x4376=['isArray','stringify','BOOLEAN','ENUM','voice','lodash','exports','VIRTUAL','getDataValue','alias','setDataValue','STRING','TEXT','long','type','select','parse','values'];(function(_0x2b93d7,_0x2cca9e){var _0x5bee84=function(_0x30562a){while(--_0x30562a){_0x2b93d7['push'](_0x2b93d7['shift']());}};_0x5bee84(++_0x2cca9e);}(_0x4376,0x1d9));var _0x6437=function(_0x3007c,_0x2cd422){_0x3007c=_0x3007c-0x0;var _0x1c9b8f=_0x4376[_0x3007c];return _0x1c9b8f;};'use strict';var Sequelize=require('sequelize');var _=require(_0x6437('0x0'));module[_0x6437('0x1')]={'name':{'type':Sequelize[_0x6437('0x2')],'get':function(_0x342946){return this[_0x6437('0x3')](_0x6437('0x4'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x54e3fd){this[_0x6437('0x5')]('alias',_0x54e3fd?_0x54e3fd:this['getDataValue']('name'));}},'type':{'type':Sequelize[_0x6437('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0x6437('0x7')](_0x6437('0x8')),'get':function(){if(this[_0x6437('0x3')](_0x6437('0x9'))===_0x6437('0xa')){return JSON[_0x6437('0xb')](this[_0x6437('0x3')]('values'));}else{return this[_0x6437('0x3')](_0x6437('0xc'));}},'set':function(_0x590e2e){if(Array[_0x6437('0xd')](_0x590e2e)){this[_0x6437('0x5')](_0x6437('0xc'),JSON[_0x6437('0xe')](_0x590e2e));}else{this[_0x6437('0x5')]('values',_0x590e2e);}}},'required':{'type':Sequelize[_0x6437('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0x6437('0x10')](_0x6437('0x11'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index d1d79c2..676ac78 100644 --- a/server/api/cmCustomField/cmCustomField.controller.js +++ b/server/api/cmCustomField/cmCustomField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb1f=['moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','CmCustomField','fieldName','type','key','model','differenceBy','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','update','body','find','create','sequelize','transaction','Sequelize','text','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','addColumn','cf_%d','eml-format','zip-dir','fast-json-patch'];(function(_0x363bc7,_0x18f9f6){var _0x2a43c4=function(_0x2688dd){while(--_0x2688dd){_0x363bc7['push'](_0x363bc7['shift']());}};_0x2a43c4(++_0x18f9f6);}(_0xcb1f,0xb1));var _0xfcb1=function(_0x7d0afa,_0x25ede4){_0x7d0afa=_0x7d0afa-0x0;var _0x124bfd=_0xcb1f[_0x7d0afa];return _0x124bfd;};'use strict';var emlformat=require(_0xfcb1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfcb1('0x1'));var jsonpatch=require(_0xfcb1('0x2'));var rp=require('request-promise');var moment=require(_0xfcb1('0x3'));var BPromise=require(_0xfcb1('0x4'));var Mustache=require(_0xfcb1('0x5'));var util=require(_0xfcb1('0x6'));var path=require(_0xfcb1('0x7'));var sox=require('sox');var csv=require(_0xfcb1('0x8'));var ejs=require(_0xfcb1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfcb1('0xa'));var squel=require(_0xfcb1('0xb'));var crypto=require(_0xfcb1('0xc'));var jsforce=require(_0xfcb1('0xd'));var deskjs=require(_0xfcb1('0xe'));var toCsv=require(_0xfcb1('0x8'));var querystring=require(_0xfcb1('0xf'));var Papa=require(_0xfcb1('0x10'));var Redis=require(_0xfcb1('0x11'));var authService=require(_0xfcb1('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xfcb1('0x13'));var hardwareService=require(_0xfcb1('0x14'));var logger=require(_0xfcb1('0x15'))(_0xfcb1('0x16'));var utils=require(_0xfcb1('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xfcb1('0x18'));var db=require(_0xfcb1('0x19'))['db'];function respondWithStatusCode(_0x401cfb,_0x12d82c){_0x12d82c=_0x12d82c||0xcc;return function(_0x9932e3){if(_0x9932e3){return _0x401cfb['sendStatus'](_0x12d82c);}return _0x401cfb[_0xfcb1('0x1a')](_0x12d82c)[_0xfcb1('0x1b')]();};}function respondWithResult(_0x18f3e8,_0x3c9fb0){_0x3c9fb0=_0x3c9fb0||0xc8;return function(_0x5626f1){if(_0x5626f1){return _0x18f3e8['status'](_0x3c9fb0)[_0xfcb1('0x1c')](_0x5626f1);}};}function respondWithFilteredResult(_0x4de4cb,_0x2efd7c){return function(_0x124dc5){if(_0x124dc5){var _0x4bf3d9=typeof _0x2efd7c[_0xfcb1('0x1d')]===_0xfcb1('0x1e')&&typeof _0x2efd7c[_0xfcb1('0x1f')]===_0xfcb1('0x1e');var _0x44012e=_0x124dc5['count'];var _0x48e14a=_0x4bf3d9?0x0:_0x2efd7c['offset'];var _0x378f9c=_0x4bf3d9?_0x124dc5[_0xfcb1('0x20')]:_0x2efd7c[_0xfcb1('0x1d')]+_0x2efd7c[_0xfcb1('0x1f')];var _0x521f65;if(_0x378f9c>=_0x44012e){_0x378f9c=_0x44012e;_0x521f65=0xc8;}else{_0x521f65=0xce;}_0x4de4cb[_0xfcb1('0x1a')](_0x521f65);return _0x4de4cb[_0xfcb1('0x21')]('Content-Range',_0x48e14a+'-'+_0x378f9c+'/'+_0x44012e)['json'](_0x124dc5);}return null;};}function patchUpdates(_0x56471f){return function(_0x24438b){try{jsonpatch['apply'](_0x24438b,_0x56471f,!![]);}catch(_0x31ba87){return BPromise[_0xfcb1('0x22')](_0x31ba87);}return _0x24438b[_0xfcb1('0x23')]();};}function saveUpdates(_0x5d99ec,_0x2a9c95){return function(_0x1b6472){if(_0x1b6472){return _0x1b6472['update'](_0x5d99ec)[_0xfcb1('0x24')](function(_0x5f2644){return _0x5f2644;});}return null;};}function removeEntity(_0x4881ce,_0x109b33){return function(_0x461f61){if(_0x461f61){return _0x461f61[_0xfcb1('0x25')]()[_0xfcb1('0x24')](function(){_0x4881ce[_0xfcb1('0x1a')](0xcc)[_0xfcb1('0x1b')]();});}};}function handleEntityNotFound(_0x54c6bd,_0x29fb2c){return function(_0x21d705){if(!_0x21d705){_0x54c6bd[_0xfcb1('0x26')](0x194);}return _0x21d705;};}function handleError(_0x3623e0,_0x1a7cb7){_0x1a7cb7=_0x1a7cb7||0x1f4;return function(_0x4f332f){logger[_0xfcb1('0x27')](_0x4f332f[_0xfcb1('0x28')]);if(_0x4f332f['name']){delete _0x4f332f[_0xfcb1('0x29')];}_0x3623e0['status'](_0x1a7cb7)[_0xfcb1('0x2a')](_0x4f332f);};}exports[_0xfcb1('0x2b')]=function(_0x516969,_0x1d2f09){var _0x52fff0={},_0xff4f9f={},_0x222242={'count':0x0,'rows':[]};var _0x15360a=_[_0xfcb1('0x2c')](db[_0xfcb1('0x2d')]['rawAttributes'],function(_0x410723){return{'name':_0x410723[_0xfcb1('0x2e')],'type':_0x410723[_0xfcb1('0x2f')][_0xfcb1('0x30')]};});_0xff4f9f[_0xfcb1('0x31')]=_[_0xfcb1('0x32')](_[_0xfcb1('0x2c')](_0x15360a,_0xfcb1('0x29')),[_0xfcb1('0x29')]);_0xff4f9f['query']=_[_0xfcb1('0x33')](_0x516969[_0xfcb1('0x34')]);_0xff4f9f[_0xfcb1('0x35')]=_['intersection'](_0xff4f9f[_0xfcb1('0x31')],_0xff4f9f[_0xfcb1('0x34')]);_0x52fff0['attributes']=_[_0xfcb1('0x36')](_0xff4f9f['model'],qs[_0xfcb1('0x37')](_0x516969[_0xfcb1('0x34')][_0xfcb1('0x37')]));_0x52fff0[_0xfcb1('0x38')]=_0x52fff0[_0xfcb1('0x38')][_0xfcb1('0x39')]?_0x52fff0[_0xfcb1('0x38')]:_0xff4f9f[_0xfcb1('0x31')];if(!_0x516969[_0xfcb1('0x34')][_0xfcb1('0x3a')](_0xfcb1('0x3b'))){_0x52fff0[_0xfcb1('0x1f')]=qs[_0xfcb1('0x1f')](_0x516969[_0xfcb1('0x34')][_0xfcb1('0x1f')]);_0x52fff0[_0xfcb1('0x1d')]=qs[_0xfcb1('0x1d')](_0x516969['query'][_0xfcb1('0x1d')]);}_0x52fff0[_0xfcb1('0x3c')]=qs[_0xfcb1('0x3d')](_0x516969[_0xfcb1('0x34')]['sort']);_0x52fff0[_0xfcb1('0x3e')]=qs['filters'](_[_0xfcb1('0x3f')](_0x516969[_0xfcb1('0x34')],_0xff4f9f[_0xfcb1('0x35')]),_0x15360a);if(_0x516969[_0xfcb1('0x34')][_0xfcb1('0x40')]){_0x52fff0['where']=_[_0xfcb1('0x41')](_0x52fff0[_0xfcb1('0x3e')],{'$or':_['map'](_0x15360a,function(_0x1bd5c9){if(_0x1bd5c9[_0xfcb1('0x2f')]!=='VIRTUAL'){var _0x4a020b={};_0x4a020b[_0x1bd5c9[_0xfcb1('0x29')]]={'$like':'%'+_0x516969['query']['filter']+'%'};return _0x4a020b;}})});}_0x52fff0=_[_0xfcb1('0x41')]({},_0x52fff0,_0x516969[_0xfcb1('0x42')]);var _0x185b01={'where':_0x52fff0['where']};return db[_0xfcb1('0x2d')][_0xfcb1('0x20')](_0x185b01)[_0xfcb1('0x24')](function(_0x11254c){_0x222242['count']=_0x11254c;if(_0x516969[_0xfcb1('0x34')][_0xfcb1('0x43')]){_0x52fff0[_0xfcb1('0x44')]=[{'all':!![]}];}return db[_0xfcb1('0x2d')][_0xfcb1('0x45')](_0x52fff0);})[_0xfcb1('0x24')](function(_0x32174c){_0x222242['rows']=_0x32174c;return _0x222242;})['then'](respondWithFilteredResult(_0x1d2f09,_0x52fff0))[_0xfcb1('0x46')](handleError(_0x1d2f09,null));};exports[_0xfcb1('0x47')]=function(_0x4eb942,_0x4d595e){var _0x1850d2={'raw':!![],'where':{'id':_0x4eb942[_0xfcb1('0x48')]['id']}},_0x39220e={};_0x39220e[_0xfcb1('0x31')]=_['keys'](db['CmCustomField'][_0xfcb1('0x49')]);_0x39220e['query']=_['keys'](_0x4eb942[_0xfcb1('0x34')]);_0x39220e[_0xfcb1('0x35')]=_[_0xfcb1('0x36')](_0x39220e['model'],_0x39220e[_0xfcb1('0x34')]);_0x1850d2[_0xfcb1('0x38')]=_[_0xfcb1('0x36')](_0x39220e['model'],qs['fields'](_0x4eb942[_0xfcb1('0x34')][_0xfcb1('0x37')]));_0x1850d2[_0xfcb1('0x38')]=_0x1850d2[_0xfcb1('0x38')][_0xfcb1('0x39')]?_0x1850d2[_0xfcb1('0x38')]:_0x39220e[_0xfcb1('0x31')];if(_0x4eb942['query'][_0xfcb1('0x43')]){_0x1850d2[_0xfcb1('0x44')]=[{'all':!![]}];}_0x1850d2=_['merge']({},_0x1850d2,_0x4eb942[_0xfcb1('0x42')]);return db[_0xfcb1('0x2d')]['find'](_0x1850d2)['then'](handleEntityNotFound(_0x4d595e,null))[_0xfcb1('0x24')](respondWithResult(_0x4d595e,null))[_0xfcb1('0x46')](handleError(_0x4d595e,null));};exports[_0xfcb1('0x4a')]=function(_0x1edb30,_0x9f477e){if(_0x1edb30['body']['id']){delete _0x1edb30[_0xfcb1('0x4b')]['id'];}return db['CmCustomField'][_0xfcb1('0x4c')]({'where':{'id':_0x1edb30['params']['id']}})[_0xfcb1('0x24')](handleEntityNotFound(_0x9f477e,null))[_0xfcb1('0x24')](saveUpdates(_0x1edb30['body'],null))['then'](respondWithResult(_0x9f477e,null))[_0xfcb1('0x46')](handleError(_0x9f477e,null));};exports[_0xfcb1('0x25')]=function(_0x8907dc,_0x200bc5){return db['CmCustomField'][_0xfcb1('0x4c')]({'where':{'id':_0x8907dc['params']['id']}})[_0xfcb1('0x24')](handleEntityNotFound(_0x200bc5,null))['then'](removeEntity(_0x200bc5,null))[_0xfcb1('0x46')](handleError(_0x200bc5,null));};exports[_0xfcb1('0x4d')]=function(_0x35fff9,_0x511a9f){var _0x48c43f;return db[_0xfcb1('0x4e')][_0xfcb1('0x4f')](function(_0x4408f7){return db[_0xfcb1('0x2d')][_0xfcb1('0x4d')](_0x35fff9[_0xfcb1('0x4b')],{'transaction':_0x4408f7})[_0xfcb1('0x24')](function(_0x218d98){_0x48c43f=_0x218d98;var _0x45ebdc={'type':db[_0xfcb1('0x50')]['TEXT'],'transaction':_0x4408f7};switch(_0x35fff9['body'][_0xfcb1('0x2f')]){case _0xfcb1('0x51'):_0x45ebdc[_0xfcb1('0x2f')]=db['Sequelize'][_0xfcb1('0x52')];break;case _0xfcb1('0x53'):_0x45ebdc[_0xfcb1('0x2f')]=db['Sequelize'][_0xfcb1('0x54')];break;case _0xfcb1('0x55'):_0x45ebdc['type']=db[_0xfcb1('0x50')][_0xfcb1('0x56')];_0x45ebdc[_0xfcb1('0x57')]=![];break;default:}return db['sequelize']['queryInterface'][_0xfcb1('0x58')]('cm_contacts',util['format'](_0xfcb1('0x59'),_0x48c43f['id']),_0x45ebdc);})[_0xfcb1('0x24')](function(){return _0x48c43f;});})['then'](respondWithResult(_0x511a9f,0xc9))['catch'](handleError(_0x511a9f,null));}; \ No newline at end of file +var _0xce52=['error','stack','name','send','index','rawAttributes','type','model','differenceBy','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','CmCustomField','includeAll','findAll','rows','show','params','keys','find','catch','body','sequelize','create','Sequelize','TEXT','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%d','zip-dir','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','apply','then','end','sendStatus'];(function(_0x5dc9c6,_0x1bc545){var _0x4eadb0=function(_0x48de35){while(--_0x48de35){_0x5dc9c6['push'](_0x5dc9c6['shift']());}};_0x4eadb0(++_0x1bc545);}(_0xce52,0x167));var _0x2ce5=function(_0x12f557,_0x3fd1c0){_0x12f557=_0x12f557-0x0;var _0x19819c=_0xce52[_0x12f557];return _0x19819c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2ce5('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2ce5('0x1'));var util=require(_0x2ce5('0x2'));var path=require(_0x2ce5('0x3'));var sox=require('sox');var csv=require(_0x2ce5('0x4'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2ce5('0x5'));var _=require(_0x2ce5('0x6'));var squel=require(_0x2ce5('0x7'));var crypto=require(_0x2ce5('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x2ce5('0x9'));var toCsv=require(_0x2ce5('0x4'));var querystring=require(_0x2ce5('0xa'));var Papa=require(_0x2ce5('0xb'));var Redis=require(_0x2ce5('0xc'));var authService=require(_0x2ce5('0xd'));var qs=require(_0x2ce5('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2ce5('0xf'));var logger=require(_0x2ce5('0x10'))('api');var utils=require(_0x2ce5('0x11'));var config=require(_0x2ce5('0x12'));var licenseUtil=require(_0x2ce5('0x13'));var db=require(_0x2ce5('0x14'))['db'];function respondWithStatusCode(_0x2fd4dd,_0x58e96e){_0x58e96e=_0x58e96e||0xcc;return function(_0x59baab){if(_0x59baab){return _0x2fd4dd['sendStatus'](_0x58e96e);}return _0x2fd4dd[_0x2ce5('0x15')](_0x58e96e)['end']();};}function respondWithResult(_0x242e6a,_0x12d523){_0x12d523=_0x12d523||0xc8;return function(_0x4aa2df){if(_0x4aa2df){return _0x242e6a['status'](_0x12d523)[_0x2ce5('0x16')](_0x4aa2df);}};}function respondWithFilteredResult(_0x2b0f4a,_0x5da760){return function(_0x59df8d){if(_0x59df8d){var _0xf235f0=typeof _0x5da760[_0x2ce5('0x17')]===_0x2ce5('0x18')&&typeof _0x5da760[_0x2ce5('0x19')]===_0x2ce5('0x18');var _0x11019b=_0x59df8d[_0x2ce5('0x1a')];var _0x447491=_0xf235f0?0x0:_0x5da760[_0x2ce5('0x17')];var _0x55e883=_0xf235f0?_0x59df8d[_0x2ce5('0x1a')]:_0x5da760['offset']+_0x5da760['limit'];var _0x5ab2b3;if(_0x55e883>=_0x11019b){_0x55e883=_0x11019b;_0x5ab2b3=0xc8;}else{_0x5ab2b3=0xce;}_0x2b0f4a[_0x2ce5('0x15')](_0x5ab2b3);return _0x2b0f4a['set']('Content-Range',_0x447491+'-'+_0x55e883+'/'+_0x11019b)[_0x2ce5('0x16')](_0x59df8d);}return null;};}function patchUpdates(_0x5bfd5b){return function(_0x425971){try{jsonpatch[_0x2ce5('0x1b')](_0x425971,_0x5bfd5b,!![]);}catch(_0xb15e16){return BPromise['reject'](_0xb15e16);}return _0x425971['save']();};}function saveUpdates(_0x56eae,_0x15b6f9){return function(_0x57b997){if(_0x57b997){return _0x57b997['update'](_0x56eae)[_0x2ce5('0x1c')](function(_0x2fd9b2){return _0x2fd9b2;});}return null;};}function removeEntity(_0x4725b9,_0x286ecd){return function(_0x31a158){if(_0x31a158){return _0x31a158['destroy']()[_0x2ce5('0x1c')](function(){_0x4725b9['status'](0xcc)[_0x2ce5('0x1d')]();});}};}function handleEntityNotFound(_0x233574,_0x26e867){return function(_0x489d8d){if(!_0x489d8d){_0x233574[_0x2ce5('0x1e')](0x194);}return _0x489d8d;};}function handleError(_0x5e6830,_0xdd5178){_0xdd5178=_0xdd5178||0x1f4;return function(_0x3edf5c){logger[_0x2ce5('0x1f')](_0x3edf5c[_0x2ce5('0x20')]);if(_0x3edf5c[_0x2ce5('0x21')]){delete _0x3edf5c[_0x2ce5('0x21')];}_0x5e6830['status'](_0xdd5178)[_0x2ce5('0x22')](_0x3edf5c);};}exports[_0x2ce5('0x23')]=function(_0x26eb8c,_0x5edfa8){var _0x165e03={},_0x192ef7={},_0x2d257d={'count':0x0,'rows':[]};var _0x574355=_['map'](db['CmCustomField'][_0x2ce5('0x24')],function(_0x1047cf){return{'name':_0x1047cf['fieldName'],'type':_0x1047cf[_0x2ce5('0x25')]['key']};});_0x192ef7[_0x2ce5('0x26')]=_[_0x2ce5('0x27')](_['map'](_0x574355,_0x2ce5('0x21')),['name']);_0x192ef7['query']=_['keys'](_0x26eb8c[_0x2ce5('0x28')]);_0x192ef7[_0x2ce5('0x29')]=_[_0x2ce5('0x2a')](_0x192ef7[_0x2ce5('0x26')],_0x192ef7[_0x2ce5('0x28')]);_0x165e03[_0x2ce5('0x2b')]=_[_0x2ce5('0x2a')](_0x192ef7[_0x2ce5('0x26')],qs[_0x2ce5('0x2c')](_0x26eb8c[_0x2ce5('0x28')][_0x2ce5('0x2c')]));_0x165e03['attributes']=_0x165e03[_0x2ce5('0x2b')][_0x2ce5('0x2d')]?_0x165e03[_0x2ce5('0x2b')]:_0x192ef7['model'];if(!_0x26eb8c[_0x2ce5('0x28')][_0x2ce5('0x2e')](_0x2ce5('0x2f'))){_0x165e03[_0x2ce5('0x19')]=qs['limit'](_0x26eb8c[_0x2ce5('0x28')]['limit']);_0x165e03['offset']=qs[_0x2ce5('0x17')](_0x26eb8c['query'][_0x2ce5('0x17')]);}_0x165e03[_0x2ce5('0x30')]=qs['sort'](_0x26eb8c['query'][_0x2ce5('0x31')]);_0x165e03[_0x2ce5('0x32')]=qs[_0x2ce5('0x29')](_[_0x2ce5('0x33')](_0x26eb8c['query'],_0x192ef7[_0x2ce5('0x29')]),_0x574355);if(_0x26eb8c['query'][_0x2ce5('0x34')]){_0x165e03['where']=_[_0x2ce5('0x35')](_0x165e03[_0x2ce5('0x32')],{'$or':_['map'](_0x574355,function(_0x10f352){if(_0x10f352['type']!==_0x2ce5('0x36')){var _0x5cbeee={};_0x5cbeee[_0x10f352[_0x2ce5('0x21')]]={'$like':'%'+_0x26eb8c[_0x2ce5('0x28')][_0x2ce5('0x34')]+'%'};return _0x5cbeee;}})});}_0x165e03=_[_0x2ce5('0x35')]({},_0x165e03,_0x26eb8c[_0x2ce5('0x37')]);var _0x16a457={'where':_0x165e03[_0x2ce5('0x32')]};return db[_0x2ce5('0x38')][_0x2ce5('0x1a')](_0x16a457)[_0x2ce5('0x1c')](function(_0x125634){_0x2d257d[_0x2ce5('0x1a')]=_0x125634;if(_0x26eb8c[_0x2ce5('0x28')][_0x2ce5('0x39')]){_0x165e03['include']=[{'all':!![]}];}return db[_0x2ce5('0x38')][_0x2ce5('0x3a')](_0x165e03);})['then'](function(_0x5683e6){_0x2d257d[_0x2ce5('0x3b')]=_0x5683e6;return _0x2d257d;})[_0x2ce5('0x1c')](respondWithFilteredResult(_0x5edfa8,_0x165e03))['catch'](handleError(_0x5edfa8,null));};exports[_0x2ce5('0x3c')]=function(_0x240e51,_0x3eaaa8){var _0x5b4a21={'raw':!![],'where':{'id':_0x240e51[_0x2ce5('0x3d')]['id']}},_0x1f80dc={};_0x1f80dc[_0x2ce5('0x26')]=_[_0x2ce5('0x3e')](db[_0x2ce5('0x38')]['rawAttributes']);_0x1f80dc[_0x2ce5('0x28')]=_[_0x2ce5('0x3e')](_0x240e51[_0x2ce5('0x28')]);_0x1f80dc[_0x2ce5('0x29')]=_[_0x2ce5('0x2a')](_0x1f80dc[_0x2ce5('0x26')],_0x1f80dc[_0x2ce5('0x28')]);_0x5b4a21[_0x2ce5('0x2b')]=_[_0x2ce5('0x2a')](_0x1f80dc[_0x2ce5('0x26')],qs[_0x2ce5('0x2c')](_0x240e51[_0x2ce5('0x28')][_0x2ce5('0x2c')]));_0x5b4a21[_0x2ce5('0x2b')]=_0x5b4a21[_0x2ce5('0x2b')]['length']?_0x5b4a21[_0x2ce5('0x2b')]:_0x1f80dc[_0x2ce5('0x26')];if(_0x240e51[_0x2ce5('0x28')][_0x2ce5('0x39')]){_0x5b4a21['include']=[{'all':!![]}];}_0x5b4a21=_[_0x2ce5('0x35')]({},_0x5b4a21,_0x240e51['options']);return db[_0x2ce5('0x38')][_0x2ce5('0x3f')](_0x5b4a21)[_0x2ce5('0x1c')](handleEntityNotFound(_0x3eaaa8,null))['then'](respondWithResult(_0x3eaaa8,null))[_0x2ce5('0x40')](handleError(_0x3eaaa8,null));};exports['update']=function(_0x2ba86e,_0x39a507){if(_0x2ba86e[_0x2ce5('0x41')]['id']){delete _0x2ba86e[_0x2ce5('0x41')]['id'];}return db['CmCustomField']['find']({'where':{'id':_0x2ba86e['params']['id']}})[_0x2ce5('0x1c')](handleEntityNotFound(_0x39a507,null))[_0x2ce5('0x1c')](saveUpdates(_0x2ba86e[_0x2ce5('0x41')],null))[_0x2ce5('0x1c')](respondWithResult(_0x39a507,null))['catch'](handleError(_0x39a507,null));};exports['destroy']=function(_0x46b119,_0x5c6133){return db['CmCustomField'][_0x2ce5('0x3f')]({'where':{'id':_0x46b119[_0x2ce5('0x3d')]['id']}})[_0x2ce5('0x1c')](handleEntityNotFound(_0x5c6133,null))[_0x2ce5('0x1c')](removeEntity(_0x5c6133,null))['catch'](handleError(_0x5c6133,null));};exports['create']=function(_0x484612,_0x36f463){var _0xf36b15;return db[_0x2ce5('0x42')]['transaction'](function(_0x77f521){return db[_0x2ce5('0x38')][_0x2ce5('0x43')](_0x484612[_0x2ce5('0x41')],{'transaction':_0x77f521})[_0x2ce5('0x1c')](function(_0x118288){_0xf36b15=_0x118288;var _0x2891da={'type':db[_0x2ce5('0x44')]['TEXT'],'transaction':_0x77f521};switch(_0x484612[_0x2ce5('0x41')][_0x2ce5('0x25')]){case'text':_0x2891da[_0x2ce5('0x25')]=db[_0x2ce5('0x44')][_0x2ce5('0x45')];break;case _0x2ce5('0x46'):_0x2891da[_0x2ce5('0x25')]=db['Sequelize'][_0x2ce5('0x47')];break;case'switch':_0x2891da['type']=db[_0x2ce5('0x44')][_0x2ce5('0x48')];_0x2891da[_0x2ce5('0x49')]=![];break;default:}return db[_0x2ce5('0x42')][_0x2ce5('0x4a')][_0x2ce5('0x4b')](_0x2ce5('0x4c'),util['format'](_0x2ce5('0x4d'),_0xf36b15['id']),_0x2891da);})[_0x2ce5('0x1c')](function(){return _0xf36b15;});})[_0x2ce5('0x1c')](respondWithResult(_0x36f463,0xc9))[_0x2ce5('0x40')](handleError(_0x36f463,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 7f01c40..991bf9a 100644 --- a/server/api/cmCustomField/cmCustomField.model.js +++ b/server/api/cmCustomField/cmCustomField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ea0=['CmCustomField','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./cmCustomField.attributes','define'];(function(_0x33c92d,_0x2cbd62){var _0xde178=function(_0x370e79){while(--_0x370e79){_0x33c92d['push'](_0x33c92d['shift']());}};_0xde178(++_0x2cbd62);}(_0x2ea0,0xdd));var _0x02ea=function(_0xf3d4dd,_0x3d1208){_0xf3d4dd=_0xf3d4dd-0x0;var _0x1f4e7b=_0x2ea0[_0xf3d4dd];return _0x1f4e7b;};'use strict';var _=require(_0x02ea('0x0'));var util=require(_0x02ea('0x1'));var logger=require(_0x02ea('0x2'))(_0x02ea('0x3'));var moment=require(_0x02ea('0x4'));var BPromise=require(_0x02ea('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x02ea('0x6'));var config=require(_0x02ea('0x7'));var attributes=require(_0x02ea('0x8'));module['exports']=function(_0x45ee04,_0x5cf3a6){return _0x45ee04[_0x02ea('0x9')](_0x02ea('0xa'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaf83=['path','./cmCustomField.attributes','define','cm_custom_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x46d8db,_0x1f2c3c){var _0x38f834=function(_0x500eb0){while(--_0x500eb0){_0x46d8db['push'](_0x46d8db['shift']());}};_0x38f834(++_0x1f2c3c);}(_0xaf83,0x185));var _0x3af8=function(_0xc31fa0,_0x258f9c){_0xc31fa0=_0xc31fa0-0x0;var _0x30bbf5=_0xaf83[_0xc31fa0];return _0x30bbf5;};'use strict';var _=require(_0x3af8('0x0'));var util=require(_0x3af8('0x1'));var logger=require(_0x3af8('0x2'))(_0x3af8('0x3'));var moment=require(_0x3af8('0x4'));var BPromise=require(_0x3af8('0x5'));var rp=require(_0x3af8('0x6'));var fs=require('fs');var path=require(_0x3af8('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3af8('0x8'));module['exports']=function(_0x7d4b80,_0x2fbb46){return _0x7d4b80[_0x3af8('0x9')]('CmCustomField',attributes,{'tableName':_0x3af8('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 2c19694..cde44fd 100644 --- a/server/api/cmCustomField/cmCustomField.rpc.js +++ b/server/api/cmCustomField/cmCustomField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ee1=['result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','CmCustomField,\x20%s,\x20%s','message'];(function(_0x473706,_0x438bc3){var _0x2f1a5d=function(_0x222319){while(--_0x222319){_0x473706['push'](_0x473706['shift']());}};_0x2f1a5d(++_0x438bc3);}(_0x8ee1,0x1e4));var _0x18ee=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x8ee1[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x18ee('0x0'));var util=require('util');var moment=require(_0x18ee('0x1'));var BPromise=require(_0x18ee('0x2'));var rs=require(_0x18ee('0x3'));var fs=require('fs');var Redis=require(_0x18ee('0x4'));var db=require(_0x18ee('0x5'))['db'];var utils=require(_0x18ee('0x6'));var logger=require(_0x18ee('0x7'))(_0x18ee('0x8'));var config=require(_0x18ee('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x18ee('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x133d4c,_0x43453a,_0x251335){return new BPromise(function(_0x1d6d5d,_0x320855){return client[_0x18ee('0xb')](_0x133d4c,_0x251335)['then'](function(_0x16fa5e){logger[_0x18ee('0xc')]('CmCustomField,\x20%s,\x20%s',_0x43453a,_0x18ee('0xd'));logger[_0x18ee('0xe')](_0x18ee('0xf'),_0x43453a,_0x18ee('0xd'),JSON[_0x18ee('0x10')](_0x16fa5e));if(_0x16fa5e['error']){if(_0x16fa5e['error']['code']===0x1f4){logger[_0x18ee('0x11')](_0x18ee('0x12'),_0x43453a,_0x16fa5e['error'][_0x18ee('0x13')]);return _0x320855(_0x16fa5e[_0x18ee('0x11')][_0x18ee('0x13')]);}logger[_0x18ee('0x11')](_0x18ee('0x12'),_0x43453a,_0x16fa5e[_0x18ee('0x11')][_0x18ee('0x13')]);return _0x1d6d5d(_0x16fa5e[_0x18ee('0x11')]['message']);}else{logger['info'](_0x18ee('0x12'),_0x43453a,_0x18ee('0xd'));_0x1d6d5d(_0x16fa5e[_0x18ee('0x14')][_0x18ee('0x13')]);}})['catch'](function(_0x152f14){logger['error'](_0x18ee('0x12'),_0x43453a,_0x152f14);_0x320855(_0x152f14);});});} \ No newline at end of file +var _0xb9fc=['message','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CmCustomField,\x20%s,\x20%s','CmCustomField,\x20%s,\x20%s,\x20%s','code','error'];(function(_0x212069,_0x2f44a9){var _0x3874e8=function(_0x598be9){while(--_0x598be9){_0x212069['push'](_0x212069['shift']());}};_0x3874e8(++_0x2f44a9);}(_0xb9fc,0x1e2));var _0xcb9f=function(_0x8c5181,_0x23099c){_0x8c5181=_0x8c5181-0x0;var _0x51de67=_0xb9fc[_0x8c5181];return _0x51de67;};'use strict';var _=require('lodash');var util=require(_0xcb9f('0x0'));var moment=require(_0xcb9f('0x1'));var BPromise=require(_0xcb9f('0x2'));var rs=require(_0xcb9f('0x3'));var fs=require('fs');var Redis=require(_0xcb9f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcb9f('0x5'));var logger=require(_0xcb9f('0x6'))(_0xcb9f('0x7'));var config=require(_0xcb9f('0x8'));var jayson=require(_0xcb9f('0x9'));var client=jayson[_0xcb9f('0xa')][_0xcb9f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ccee9,_0x49191c,_0x2d4d89){return new BPromise(function(_0x48d246,_0x17be6e){return client['request'](_0x4ccee9,_0x2d4d89)[_0xcb9f('0xc')](function(_0x9cb4a9){logger[_0xcb9f('0xd')](_0xcb9f('0xe'),_0x49191c,'request\x20sent');logger['debug'](_0xcb9f('0xf'),_0x49191c,'request\x20sent',JSON['stringify'](_0x9cb4a9));if(_0x9cb4a9['error']){if(_0x9cb4a9['error'][_0xcb9f('0x10')]===0x1f4){logger['error']('CmCustomField,\x20%s,\x20%s',_0x49191c,_0x9cb4a9[_0xcb9f('0x11')][_0xcb9f('0x12')]);return _0x17be6e(_0x9cb4a9[_0xcb9f('0x11')]['message']);}logger[_0xcb9f('0x11')](_0xcb9f('0xe'),_0x49191c,_0x9cb4a9[_0xcb9f('0x11')][_0xcb9f('0x12')]);return _0x48d246(_0x9cb4a9['error']['message']);}else{logger['info'](_0xcb9f('0xe'),_0x49191c,'request\x20sent');_0x48d246(_0x9cb4a9['result']['message']);}})[_0xcb9f('0x13')](function(_0xb88094){logger['error'](_0xcb9f('0xe'),_0x49191c,_0xb88094);_0x17be6e(_0xb88094);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 1178102..4c26c0a 100644 --- a/server/api/cmCustomField/index.js +++ b/server/api/cmCustomField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x897d=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x257d84,_0x8eaaea){var _0x3d1ba2=function(_0x349119){while(--_0x349119){_0x257d84['push'](_0x257d84['shift']());}};_0x3d1ba2(++_0x8eaaea);}(_0x897d,0x80));var _0xd897=function(_0x217a95,_0xd8b1e7){_0x217a95=_0x217a95-0x0;var _0x2646c0=_0x897d[_0x217a95];return _0x2646c0;};'use strict';var multer=require(_0xd897('0x0'));var util=require(_0xd897('0x1'));var path=require(_0xd897('0x2'));var timeout=require(_0xd897('0x3'));var express=require(_0xd897('0x4'));var router=express[_0xd897('0x5')]();var fs_extra=require(_0xd897('0x6'));var auth=require(_0xd897('0x7'));var interaction=require(_0xd897('0x8'));var config=require(_0xd897('0x9'));var controller=require(_0xd897('0xa'));router[_0xd897('0xb')]('/',auth[_0xd897('0xc')](),controller[_0xd897('0xd')]);router[_0xd897('0xb')](_0xd897('0xe'),auth[_0xd897('0xc')](),controller[_0xd897('0xf')]);router[_0xd897('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd897('0x11')](_0xd897('0xe'),auth['isAuthenticated'](),controller[_0xd897('0x12')]);router[_0xd897('0x13')](_0xd897('0xe'),auth[_0xd897('0xc')](),controller[_0xd897('0x14')]);module[_0xd897('0x15')]=router; \ No newline at end of file +var _0x4cfd=['/:id','show','post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCustomField.controller','get','isAuthenticated','index'];(function(_0x466945,_0x2c9ee2){var _0x4c8f6e=function(_0xfa0d64){while(--_0xfa0d64){_0x466945['push'](_0x466945['shift']());}};_0x4c8f6e(++_0x2c9ee2);}(_0x4cfd,0x170));var _0xd4cf=function(_0x5179a5,_0x419746){_0x5179a5=_0x5179a5-0x0;var _0x15c8ce=_0x4cfd[_0x5179a5];return _0x15c8ce;};'use strict';var multer=require(_0xd4cf('0x0'));var util=require(_0xd4cf('0x1'));var path=require('path');var timeout=require(_0xd4cf('0x2'));var express=require(_0xd4cf('0x3'));var router=express[_0xd4cf('0x4')]();var fs_extra=require(_0xd4cf('0x5'));var auth=require(_0xd4cf('0x6'));var interaction=require(_0xd4cf('0x7'));var config=require('../../config/environment');var controller=require(_0xd4cf('0x8'));router[_0xd4cf('0x9')]('/',auth[_0xd4cf('0xa')](),controller[_0xd4cf('0xb')]);router[_0xd4cf('0x9')](_0xd4cf('0xc'),auth['isAuthenticated'](),controller[_0xd4cf('0xd')]);router[_0xd4cf('0xe')]('/',auth[_0xd4cf('0xa')](),controller[_0xd4cf('0xf')]);router[_0xd4cf('0x10')](_0xd4cf('0xc'),auth[_0xd4cf('0xa')](),controller['update']);router[_0xd4cf('0x11')](_0xd4cf('0xc'),auth[_0xd4cf('0xa')](),controller[_0xd4cf('0x12')]);module[_0xd4cf('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index e03d17d..921afef 100644 --- a/server/api/cmHopper/cmHopper.attributes.js +++ b/server/api/cmHopper/cmHopper.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8bff=['STRING','format','YYYY-MM-DD\x20HH:mm:ss','BOOLEAN','DATE','INTEGER','UNSIGNED','contactListQueue','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8bff,0xb3));var _0xf8bf=function(_0x35f2f3,_0x1bbec2){_0x35f2f3=_0x35f2f3-0x0;var _0x38c76a=_0x8bff[_0x35f2f3];return _0x38c76a;};'use strict';var moment=require('moment');var Sequelize=require(_0xf8bf('0x0'));module['exports']={'phone':{'type':Sequelize[_0xf8bf('0x1')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0xf8bf('0x2')](_0xf8bf('0x3'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0xf8bf('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xf8bf('0x5')]},'priority':{'type':Sequelize[_0xf8bf('0x6')](0x2)[_0xf8bf('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xf8bf('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xf8bf('0x6')],'unique':_0xf8bf('0x8')},'UserId':{'type':Sequelize[_0xf8bf('0x6')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xf8bf('0x8')},'CampaignId':{'type':Sequelize[_0xf8bf('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0xf8bf('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xf8bf('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xf8bf('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xf8bf('0x6')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xf8bf('0x6')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xf8bf('0x1')]},'recallmeNotifiedDate':{'type':Sequelize[_0xf8bf('0x5')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x65e2=['contactListQueue','moment','sequelize','STRING','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','BOOLEAN','DATE','UNSIGNED'];(function(_0x18f1ab,_0x481922){var _0x3122da=function(_0x5c8066){while(--_0x5c8066){_0x18f1ab['push'](_0x18f1ab['shift']());}};_0x3122da(++_0x481922);}(_0x65e2,0xe7));var _0x265e=function(_0x12e2cc,_0x38bbff){_0x12e2cc=_0x12e2cc-0x0;var _0x59d963=_0x65e2[_0x12e2cc];return _0x59d963;};'use strict';var moment=require(_0x265e('0x0'));var Sequelize=require(_0x265e('0x1'));module['exports']={'phone':{'type':Sequelize[_0x265e('0x2')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x265e('0x3')](_0x265e('0x4'))},'countbusyretry':{'type':Sequelize[_0x265e('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x265e('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x265e('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x265e('0x6')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x265e('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x265e('0x7')]},'priority':{'type':Sequelize[_0x265e('0x5')](0x2)[_0x265e('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x265e('0x6')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x265e('0x5')],'unique':_0x265e('0x9')},'ListId':{'type':Sequelize[_0x265e('0x5')],'unique':_0x265e('0x9')},'UserId':{'type':Sequelize[_0x265e('0x5')]},'VoiceQueueId':{'type':Sequelize[_0x265e('0x5')],'unique':_0x265e('0x9')},'CampaignId':{'type':Sequelize[_0x265e('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x265e('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x265e('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x265e('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x265e('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x265e('0x5')],'defaultValue':0x0},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x265e('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0x265e('0x7')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index b14aed4..1502601 100644 --- a/server/api/cmHopper/cmHopper.controller.js +++ b/server/api/cmHopper/cmHopper.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x885a=['key','model','query','keys','filters','concat','$and','$gt','$gte','$lte','$eq','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$any','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','destroy','CampaignId','VoiceQueueId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','getVoiceQueues','outbound','dialOrderByScheduledAt','sequelize','value','direction','prev','isEmpty','hopperIds','ASC','scheduledAt','DESC','priority','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','CmCompany','Company','CmList','dialActive','getPreviewRecall','transaction','recallme','Contact','Queue','getOpenContacts','preview','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','getTimezone','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','then','error','stack','name','index','CmHopper','rawAttributes','type'];(function(_0x23cfaf,_0x1d8545){var _0xf8af44=function(_0x163779){while(--_0x163779){_0x23cfaf['push'](_0x23cfaf['shift']());}};_0xf8af44(++_0x1d8545);}(_0x885a,0x180));var _0xa885=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x885a[_0x20a584];return _0x4b41a8;};'use strict';var moment=require('moment');var _=require(_0xa885('0x0'));var qs=require(_0xa885('0x1'));var logger=require(_0xa885('0x2'))(_0xa885('0x3'));var shared=require('../../config/environment');var db=require(_0xa885('0x4'))['db'];function respondWithResult(_0x1c41b5,_0x2386ec){_0x2386ec=_0x2386ec||0xc8;return function(_0x106e16){if(_0x106e16){return _0x1c41b5[_0xa885('0x5')](_0x2386ec)[_0xa885('0x6')](_0x106e16);}};}function respondWithFilteredResult(_0x5dfd7e,_0x7ac6bd){return function(_0x1200c7){if(_0x1200c7){var _0x31fd77=typeof _0x7ac6bd['offset']===_0xa885('0x7')&&typeof _0x7ac6bd[_0xa885('0x8')]===_0xa885('0x7');var _0x5e49d0=_0x1200c7[_0xa885('0x9')];var _0x299f57=_0x31fd77?0x0:_0x7ac6bd[_0xa885('0xa')];var _0x745710=_0x31fd77?_0x1200c7[_0xa885('0x9')]:_0x7ac6bd[_0xa885('0xa')]+_0x7ac6bd[_0xa885('0x8')];var _0x571c0d;if(_0x745710>=_0x5e49d0){_0x745710=_0x5e49d0;_0x571c0d=0xc8;}else{_0x571c0d=0xce;}_0x5dfd7e[_0xa885('0x5')](_0x571c0d);return _0x5dfd7e[_0xa885('0xb')](_0xa885('0xc'),_0x299f57+'-'+_0x745710+'/'+_0x5e49d0)[_0xa885('0x6')](_0x1200c7);}return null;};}function saveUpdates(_0x412b2a,_0x3e9c7a){return function(_0x4585d9){if(_0x4585d9){return _0x4585d9['update'](_0x412b2a)[_0xa885('0xd')](function(_0x1d789f){return _0x1d789f;});}return null;};}function handleEntityNotFound(_0x27b24a,_0x12d81c){return function(_0x33ce2e){if(!_0x33ce2e){_0x27b24a['sendStatus'](0x194);}return _0x33ce2e;};}function handleError(_0x1c9687,_0x2ca5c5){_0x2ca5c5=_0x2ca5c5||0x1f4;return function(_0x5296e6){logger[_0xa885('0xe')](_0x5296e6[_0xa885('0xf')]);if(_0x5296e6['name']){delete _0x5296e6[_0xa885('0x10')];}_0x1c9687[_0xa885('0x5')](_0x2ca5c5)['send'](_0x5296e6);};}exports[_0xa885('0x11')]=function(_0x543e7a,_0x2e9290){var _0x3960ea={},_0x8c26c={},_0x4e4d51={'count':0x0,'rows':[]};var _0x289b76=_['map'](db[_0xa885('0x12')][_0xa885('0x13')],function(_0x113043){return{'name':_0x113043['fieldName'],'type':_0x113043[_0xa885('0x14')][_0xa885('0x15')]};});_0x8c26c[_0xa885('0x16')]=_['map'](_0x289b76,_0xa885('0x10'));_0x8c26c[_0xa885('0x17')]=_[_0xa885('0x18')](_0x543e7a['query']);_0x8c26c[_0xa885('0x19')]=_['intersection'](_0x8c26c[_0xa885('0x16')],_0x8c26c[_0xa885('0x17')]);_0x8c26c['filters']=_[_0xa885('0x1a')](_0x8c26c[_0xa885('0x19')],[_0xa885('0x1b'),'$or',_0xa885('0x1c'),_0xa885('0x1d'),'$lt',_0xa885('0x1e'),'$ne',_0xa885('0x1f'),'$not',_0xa885('0x20'),_0xa885('0x21'),_0xa885('0x22'),_0xa885('0x23'),_0xa885('0x24'),_0xa885('0x25'),_0xa885('0x26'),_0xa885('0x27'),'$like','$overlap','$contains','$contained',_0xa885('0x28')]);_0x3960ea[_0xa885('0x29')]=_[_0xa885('0x2a')](_0x8c26c[_0xa885('0x16')],qs[_0xa885('0x2b')](_0x543e7a[_0xa885('0x17')]['fields']));_0x3960ea[_0xa885('0x29')]=_0x3960ea['attributes'][_0xa885('0x2c')]?_0x3960ea['attributes']:_0x8c26c[_0xa885('0x16')];if(!_0x543e7a['query'][_0xa885('0x2d')](_0xa885('0x2e'))){_0x3960ea[_0xa885('0x8')]=qs['limit'](_0x543e7a[_0xa885('0x17')][_0xa885('0x8')]);_0x3960ea['offset']=qs[_0xa885('0xa')](_0x543e7a['query'][_0xa885('0xa')]);}_0x3960ea[_0xa885('0x2f')]=qs[_0xa885('0x30')](_0x543e7a['query'][_0xa885('0x30')]);_0x3960ea[_0xa885('0x31')]=qs[_0xa885('0x19')](_['pick'](_0x543e7a[_0xa885('0x17')],_0x8c26c[_0xa885('0x19')]),_0x289b76);if(_0x543e7a[_0xa885('0x17')][_0xa885('0x32')]){_0x3960ea[_0xa885('0x31')]=_[_0xa885('0x33')](_0x3960ea[_0xa885('0x31')],{'$or':_[_0xa885('0x34')](_0x289b76,function(_0x5235af){if(_0x5235af['type']!==_0xa885('0x35')){var _0x1d43b5={};_0x1d43b5[_0x5235af[_0xa885('0x10')]]={'$like':'%'+_0x543e7a[_0xa885('0x17')][_0xa885('0x32')]+'%'};return _0x1d43b5;}})});}_0x3960ea=_[_0xa885('0x33')]({},_0x3960ea,_0x543e7a[_0xa885('0x36')]);var _0x337e55={'where':_0x3960ea[_0xa885('0x31')]};return db['CmHopper']['count'](_0x337e55)[_0xa885('0xd')](function(_0x576c78){_0x4e4d51['count']=_0x576c78;if(_0x543e7a[_0xa885('0x17')]['includeAll']){_0x3960ea[_0xa885('0x37')]=[{'all':!![]}];}return db[_0xa885('0x12')][_0xa885('0x38')](_0x3960ea);})[_0xa885('0xd')](function(_0x2d433e){_0x4e4d51[_0xa885('0x39')]=_0x2d433e;return _0x4e4d51;})[_0xa885('0xd')](respondWithFilteredResult(_0x2e9290,_0x3960ea))[_0xa885('0x3a')](handleError(_0x2e9290,null));};exports[_0xa885('0x3b')]=function(_0x2f48a9,_0x531586){var _0x30759d={'raw':!![],'where':{'id':_0x2f48a9[_0xa885('0x3c')]['id']}},_0x4012b3={};_0x4012b3[_0xa885('0x16')]=_[_0xa885('0x18')](db['CmHopper']['rawAttributes']);_0x4012b3[_0xa885('0x17')]=_[_0xa885('0x18')](_0x2f48a9[_0xa885('0x17')]);_0x4012b3[_0xa885('0x19')]=_[_0xa885('0x2a')](_0x4012b3['model'],_0x4012b3[_0xa885('0x17')]);_0x30759d[_0xa885('0x29')]=_['intersection'](_0x4012b3['model'],qs[_0xa885('0x2b')](_0x2f48a9[_0xa885('0x17')]['fields']));_0x30759d['attributes']=_0x30759d[_0xa885('0x29')][_0xa885('0x2c')]?_0x30759d[_0xa885('0x29')]:_0x4012b3[_0xa885('0x16')];if(_0x2f48a9[_0xa885('0x17')][_0xa885('0x3d')]){_0x30759d[_0xa885('0x37')]=[{'all':!![]}];}_0x30759d=_[_0xa885('0x33')]({},_0x30759d,_0x2f48a9[_0xa885('0x36')]);return db[_0xa885('0x12')][_0xa885('0x3e')](_0x30759d)['then'](handleEntityNotFound(_0x531586,null))[_0xa885('0xd')](respondWithResult(_0x531586,null))[_0xa885('0x3a')](handleError(_0x531586,null));};exports[_0xa885('0x3f')]=function(_0x49c6a7,_0x47f3b4){return db[_0xa885('0x12')][_0xa885('0x3f')](_0x49c6a7[_0xa885('0x40')],{})['then'](respondWithResult(_0x47f3b4,0xc9))[_0xa885('0x3a')](handleError(_0x47f3b4,null));};exports['update']=function(_0x2d4bb5,_0x245fe9){if(_0x2d4bb5['body']['id']){delete _0x2d4bb5[_0xa885('0x40')]['id'];}return db[_0xa885('0x12')][_0xa885('0x3e')]({'where':{'id':_0x2d4bb5[_0xa885('0x3c')]['id']}})[_0xa885('0xd')](handleEntityNotFound(_0x245fe9,null))['then'](saveUpdates(_0x2d4bb5[_0xa885('0x40')],null))[_0xa885('0xd')](respondWithResult(_0x245fe9,null))[_0xa885('0x3a')](handleError(_0x245fe9,null));};exports['describe']=function(_0x4d146e,_0x52fbeb){return db[_0xa885('0x12')][_0xa885('0x41')]()[_0xa885('0xd')](respondWithResult(_0x52fbeb,null))[_0xa885('0x3a')](handleError(_0x52fbeb,null));};exports[_0xa885('0x42')]=function(_0x49aa9b,_0x43245c){var _0x476532;var _0x4397d6=_0x49aa9b[_0xa885('0x3c')]['id'];return db[_0xa885('0x12')]['find']({'where':{'id':_0x49aa9b['params']['id']}})['then'](handleEntityNotFound(_0x43245c,null))[_0xa885('0xd')](function(_0x289716){if(_0x289716){return _0x289716[_0xa885('0x42')]()[_0xa885('0xd')](function(_0x164d9d){return _0x164d9d;});}})[_0xa885('0xd')](function(_0x35e931){_0x476532=_0x35e931;if(_0x35e931){if(_0x35e931['VoiceQueueId']||_0x35e931[_0xa885('0x43')]){return db[_0x35e931[_0xa885('0x44')]?_0xa885('0x45'):_0xa885('0x46')][_0xa885('0x3e')]({'where':{'id':_0x35e931[_0xa885('0x44')]?_0x35e931[_0xa885('0x44')]:_0x35e931['CampaignId']},'attributes':['id',_0xa885('0x10')],'raw':!![]});}}})[_0xa885('0xd')](function(_0x1fde66){var _0x55ea83={};if(_0x1fde66){_[_0xa885('0x33')](_0x55ea83,_[_0xa885('0x47')](_0x476532[_0xa885('0x48')],[_0xa885('0x49'),_0xa885('0x4a'),'id']));_0x55ea83[_0xa885('0x4b')]=0x15;_0x55ea83[_0xa885('0x4c')]=_0xa885('0x4d');_0x55ea83['campaign']=_0x1fde66[_0xa885('0x10')];_0x55ea83[_0xa885('0x4e')]=_0x49aa9b[_0xa885('0x4f')]['name'];_0x55ea83[_0xa885('0x50')]=_0x49aa9b[_0xa885('0x4f')]['id'];_0x55ea83[_0xa885('0x4d')]=!![];_0x55ea83[_0xa885('0x51')]=moment()[_0xa885('0x52')](_0xa885('0x53'));_0x55ea83['calleridnum']=_0x476532[_0xa885('0x54')];_0x55ea83[_0xa885('0x55')]=_0x476532[_0xa885('0x44')]?'queue':_0xa885('0x56');return db[_0xa885('0x57')][_0xa885('0x3e')]({'where':{'id':_0x55ea83[_0xa885('0x58')]},'attributes':[_0xa885('0x59'),_0xa885('0x5a')]})[_0xa885('0xd')](function(_0x288bbc){if(!_[_0xa885('0x5b')](_0x43245c)&&!_['isNil'](_0x288bbc[_0xa885('0x59')])){_0x55ea83[_0xa885('0x5c')]=_0x288bbc['firstName'];if(!_['isNil'](_0x288bbc[_0xa885('0x5a')])){_0x55ea83[_0xa885('0x5c')]+='\x20'+_0x288bbc['lastName'];}}})[_0xa885('0x5d')](function(){return db[_0xa885('0x5e')][_0xa885('0x3f')](_0x55ea83);});}})[_0xa885('0xd')](function(_0x1e3576){return db[_0xa885('0x5f')][_0xa885('0x42')]({'where':{'CmHopperId':_0x4397d6}});})['then'](function(){return _0x43245c[_0xa885('0x5')](0xcc)[_0xa885('0x60')]();})['catch'](handleError(_0x43245c,null));};exports[_0xa885('0x61')]=function(_0x48ded4,_0x117cfe){var _0x5698d6=[];return db[_0xa885('0x57')][_0xa885('0x41')]()[_0xa885('0xd')](function(_0x22eb32){_0x5698d6=_['keys'](_0x22eb32);return _0x48ded4[_0xa885('0x4f')][_0xa885('0x62')]({'where':{'type':_0xa885('0x63'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0xa885('0x64'),'dialPreviewAutoRecallMe'],'raw':!![]});})[_0xa885('0xd')](function(_0xb066be){if(_0xb066be&&_0xb066be['length']){return db[_0xa885('0x65')]['transaction'](function(_0x36c7ba){var _0x2f053a={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xa885('0x53'))},'VoiceQueueId':{'$in':_[_0xa885('0x34')](_0xb066be,'id')},'$or':[{'UserId':null},{'UserId':_0x48ded4[_0xa885('0x4f')]['id']}]};var _0x3bc750={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0xb066be)['filter'](['dialPreviewAutoRecallMe',0x0])[_0xa885('0x34')]('id')[_0xa885('0x66')]()},'$or':[{'UserId':null},{'UserId':_0x48ded4['user']['id']}]};var _0x55d5d0={'$or':[_0x2f053a,_0x3bc750]};var _0x3c9df4=[];if(_0x48ded4[_0xa885('0x40')][_0xa885('0x67')]&&_0x48ded4[_0xa885('0x40')][_0xa885('0x67')]===_0xa885('0x68')){if(!_[_0xa885('0x69')](_0x48ded4[_0xa885('0x40')][_0xa885('0x6a')])){_0x55d5d0['id']={'$in':_0x48ded4[_0xa885('0x40')][_0xa885('0x6a')]};}_0x3c9df4=[['priority',_0xa885('0x6b')],[_0xa885('0x6c'),_0xb066be[0x0][_0xa885('0x64')]===_0xa885('0x6b')?_0xa885('0x6d'):'ASC'],db[_0xa885('0x65')]['literal']('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0xa885('0x6d')]];}else{if(!_[_0xa885('0x69')](_0x48ded4['body']['hopperIds'])){_0x55d5d0['id']={'$notIn':_0x48ded4[_0xa885('0x40')][_0xa885('0x6a')]};}_0x3c9df4=[[_0xa885('0x6e'),'DESC'],['scheduledAt',_0xb066be[0x0][_0xa885('0x64')]],db[_0xa885('0x65')][_0xa885('0x6f')](_0xa885('0x70')),['id','ASC']];}return db[_0xa885('0x12')][_0xa885('0x71')]({'attributes':['id',_0xa885('0x72'),'phone','recallme'],'where':_0x55d5d0,'order':_0x3c9df4,'transaction':_0x36c7ba,'lock':_0x36c7ba[_0xa885('0x73')][_0xa885('0x74')],'include':[{'model':db[_0xa885('0x57')],'as':'Contact','attributes':_0x5698d6,'include':[{'model':db[_0xa885('0x75')],'as':_0xa885('0x76'),'attributes':['id',_0xa885('0x10')]}]},{'model':db[_0xa885('0x77')],'as':'List','attributes':['id',_0xa885('0x10')]},{'model':db[_0xa885('0x45')],'as':'Queue','attributes':['id',_0xa885('0x10'),_0xa885('0x78')]}]})['then'](function(_0x314d83){if(_0x314d83){return _0x314d83['update']({'UserId':_0x48ded4[_0xa885('0x4f')]['id']},{'transaction':_0x36c7ba});}});});}})[_0xa885('0xd')](handleEntityNotFound(_0x117cfe,null))[_0xa885('0xd')](respondWithResult(_0x117cfe,null))[_0xa885('0x3a')](handleError(_0x117cfe,null));};exports[_0xa885('0x79')]=function(_0x29ed6e,_0x1ca586,_0x3aa8bc){var _0x490d15=[];var _0x55413d=_0x29ed6e[_0xa885('0x3c')]['id'];var _0xb1eac6=_0x29ed6e['user']['id'];return db[_0xa885('0x57')][_0xa885('0x41')]()['then'](function(_0x425374){_0x490d15=_['keys'](_0x425374);return db[_0xa885('0x65')][_0xa885('0x7a')](function(_0x37ef1b){const _0x26950f={'id':_0x55413d};return db['CmHopper']['findOne']({'attributes':['id',_0xa885('0x72'),_0xa885('0x7b')],'where':_0x26950f,'transaction':_0x37ef1b,'lock':_0x37ef1b[_0xa885('0x73')][_0xa885('0x74')],'include':[{'model':db[_0xa885('0x57')],'as':_0xa885('0x7c'),'attributes':_0x490d15,'include':[{'model':db[_0xa885('0x75')],'as':_0xa885('0x76'),'attributes':['id','name']}]},{'model':db[_0xa885('0x77')],'as':'List','attributes':['id',_0xa885('0x10')]},{'model':db[_0xa885('0x45')],'as':_0xa885('0x7d'),'attributes':['id','name',_0xa885('0x78')]}]})[_0xa885('0xd')](function(_0x50a7ef){if(_0x50a7ef){return _0x50a7ef['update']({'UserId':_0xb1eac6},{'transaction':_0x37ef1b});}});});})[_0xa885('0xd')](handleEntityNotFound(_0x1ca586,null))[_0xa885('0xd')](respondWithResult(_0x1ca586,null))[_0xa885('0x3a')](handleError(_0x1ca586,null));};exports[_0xa885('0x7e')]=function(_0x243d5e,_0x4bd60c){return _0x243d5e['user'][_0xa885('0x62')]({'where':{'type':_0xa885('0x63'),'dialActive':!![],'dialMethod':_0xa885('0x7f')},'attributes':['id'],'raw':!![]})[_0xa885('0xd')](function(_0x56bd37){if(_0x56bd37&&_0x56bd37['length']){return db['CmHopper'][_0xa885('0x9')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xa885('0x52')](_0xa885('0x53'))},'VoiceQueueId':{'$in':_[_0xa885('0x34')](_0x56bd37,'id')},'$or':[{'UserId':null},{'UserId':_0x243d5e[_0xa885('0x4f')]['id']}]}});}return 0x0;})[_0xa885('0xd')](function(_0x220614){if(!_['isNil'](_0x220614)&&_['isNumber'](_0x220614)){return _0x4bd60c[_0xa885('0x5')](0xc8)['json']({'contacts':_0x220614});}else{logger[_0xa885('0xe')](_0xa885('0x80'),_0xa885('0x7e'),0x194,_0xa885('0x81'));_0x4bd60c['sendStatus'](0x194);}})[_0xa885('0x3a')](handleError(_0x4bd60c,null));};exports[_0xa885('0x82')]=function(_0x2ff728,_0x5a6f1f){var _0xe5881c=shared[_0xa885('0x83')];var _0x9cda91=[];_['map'](_0xe5881c,function(_0x1d51ac){_0x9cda91[_0xa885('0x84')]({'id':_0x1d51ac[_0xa885('0x10')],'name':_0x1d51ac[_0xa885('0x10')],'utcOffset':_0x1d51ac[_0xa885('0x85')]});});return _0x5a6f1f[_0xa885('0x5')](0xc8)['json']({'tz':_0x9cda91});};exports[_0xa885('0x86')]=function(_0x40a85d,_0x3be76a){var _0x1689c8=shared['timezones'];var _0x3c088d={};if(!_[_0xa885('0x5b')](_0x1689c8[_0x40a85d[_0xa885('0x40')]['id']]))_0x3c088d=_0x1689c8[_0x40a85d[_0xa885('0x40')]['id']];return _0x3be76a[_0xa885('0x5')](0xc8)[_0xa885('0x6')](_0x3c088d);}; \ No newline at end of file +var _0x6c32=['type','keys','filters','model','concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$not','$in','$notIn','$notLike','$notILike','$like','$overlap','$contains','$contained','attributes','intersection','fields','query','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','params','rawAttributes','include','create','body','find','describe','destroy','VoiceQueueId','VoiceQueue','Campaign','CampaignId','omit','dataValues','updatedAt','state','statedesc','deleted','campaign','user','format','calleridnum','phone','campaigntype','CmContact','lastName','isNil','firstName','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','getPreview','getVoiceQueues','outbound','preview','dialPreviewAutoRecallMe','sequelize','transaction','YYYY-MM-DD\x20HH:mm:ss','value','direction','prev','hopperIds','priority','ASC','scheduledAt','dialOrderByScheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','LOCK','Contact','Company','List','dialActive','getPreviewRecall','UPDATE','CmCompany','CmList','Queue','getOpenContacts','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','push','getTimezone','timezones','moment','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','update','then','stack','name','index','map','CmHopper','fieldName'];(function(_0x347a64,_0x46cb9a){var _0x305c26=function(_0x4bd10f){while(--_0x4bd10f){_0x347a64['push'](_0x347a64['shift']());}};_0x305c26(++_0x46cb9a);}(_0x6c32,0x6e));var _0x26c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c32[_0x20a584];return _0x4b41a8;};'use strict';var moment=require(_0x26c3('0x0'));var _=require(_0x26c3('0x1'));var qs=require(_0x26c3('0x2'));var logger=require(_0x26c3('0x3'))(_0x26c3('0x4'));var shared=require(_0x26c3('0x5'));var db=require(_0x26c3('0x6'))['db'];function respondWithResult(_0x321cc5,_0x36528a){_0x36528a=_0x36528a||0xc8;return function(_0x49d4a1){if(_0x49d4a1){return _0x321cc5[_0x26c3('0x7')](_0x36528a)[_0x26c3('0x8')](_0x49d4a1);}};}function respondWithFilteredResult(_0x15ac36,_0x57d915){return function(_0x187b81){if(_0x187b81){var _0x5b3a5f=typeof _0x57d915[_0x26c3('0x9')]===_0x26c3('0xa')&&typeof _0x57d915[_0x26c3('0xb')]===_0x26c3('0xa');var _0x2bbb9a=_0x187b81[_0x26c3('0xc')];var _0x155187=_0x5b3a5f?0x0:_0x57d915[_0x26c3('0x9')];var _0x356992=_0x5b3a5f?_0x187b81[_0x26c3('0xc')]:_0x57d915['offset']+_0x57d915['limit'];var _0x4aa8e2;if(_0x356992>=_0x2bbb9a){_0x356992=_0x2bbb9a;_0x4aa8e2=0xc8;}else{_0x4aa8e2=0xce;}_0x15ac36['status'](_0x4aa8e2);return _0x15ac36[_0x26c3('0xd')](_0x26c3('0xe'),_0x155187+'-'+_0x356992+'/'+_0x2bbb9a)[_0x26c3('0x8')](_0x187b81);}return null;};}function saveUpdates(_0x457fc9,_0x4b8d92){return function(_0x4c7b94){if(_0x4c7b94){return _0x4c7b94[_0x26c3('0xf')](_0x457fc9)[_0x26c3('0x10')](function(_0xbbbec7){return _0xbbbec7;});}return null;};}function handleEntityNotFound(_0x3cd3c7,_0x17c399){return function(_0x568d0b){if(!_0x568d0b){_0x3cd3c7['sendStatus'](0x194);}return _0x568d0b;};}function handleError(_0x2acfb1,_0xc14c69){_0xc14c69=_0xc14c69||0x1f4;return function(_0x4f4256){logger['error'](_0x4f4256[_0x26c3('0x11')]);if(_0x4f4256['name']){delete _0x4f4256[_0x26c3('0x12')];}_0x2acfb1['status'](_0xc14c69)['send'](_0x4f4256);};}exports[_0x26c3('0x13')]=function(_0x5545ee,_0x38fe17){var _0x50a3e5={},_0x170039={},_0x2613e2={'count':0x0,'rows':[]};var _0x1405fb=_[_0x26c3('0x14')](db[_0x26c3('0x15')]['rawAttributes'],function(_0x5c530f){return{'name':_0x5c530f[_0x26c3('0x16')],'type':_0x5c530f[_0x26c3('0x17')]['key']};});_0x170039['model']=_[_0x26c3('0x14')](_0x1405fb,'name');_0x170039['query']=_[_0x26c3('0x18')](_0x5545ee['query']);_0x170039[_0x26c3('0x19')]=_['intersection'](_0x170039[_0x26c3('0x1a')],_0x170039['query']);_0x170039[_0x26c3('0x19')]=_[_0x26c3('0x1b')](_0x170039[_0x26c3('0x19')],[_0x26c3('0x1c'),_0x26c3('0x1d'),_0x26c3('0x1e'),_0x26c3('0x1f'),_0x26c3('0x20'),_0x26c3('0x21'),_0x26c3('0x22'),'$eq',_0x26c3('0x23'),'$between','$notBetween',_0x26c3('0x24'),_0x26c3('0x25'),'$like',_0x26c3('0x26'),'$iLike',_0x26c3('0x27'),_0x26c3('0x28'),_0x26c3('0x29'),_0x26c3('0x2a'),_0x26c3('0x2b'),'$any']);_0x50a3e5[_0x26c3('0x2c')]=_[_0x26c3('0x2d')](_0x170039[_0x26c3('0x1a')],qs[_0x26c3('0x2e')](_0x5545ee[_0x26c3('0x2f')][_0x26c3('0x2e')]));_0x50a3e5['attributes']=_0x50a3e5[_0x26c3('0x2c')][_0x26c3('0x30')]?_0x50a3e5[_0x26c3('0x2c')]:_0x170039['model'];if(!_0x5545ee[_0x26c3('0x2f')][_0x26c3('0x31')](_0x26c3('0x32'))){_0x50a3e5[_0x26c3('0xb')]=qs[_0x26c3('0xb')](_0x5545ee[_0x26c3('0x2f')]['limit']);_0x50a3e5[_0x26c3('0x9')]=qs[_0x26c3('0x9')](_0x5545ee['query']['offset']);}_0x50a3e5['order']=qs['sort'](_0x5545ee['query'][_0x26c3('0x33')]);_0x50a3e5[_0x26c3('0x34')]=qs['filters'](_[_0x26c3('0x35')](_0x5545ee[_0x26c3('0x2f')],_0x170039['filters']),_0x1405fb);if(_0x5545ee['query'][_0x26c3('0x36')]){_0x50a3e5['where']=_[_0x26c3('0x37')](_0x50a3e5['where'],{'$or':_[_0x26c3('0x14')](_0x1405fb,function(_0x40e41c){if(_0x40e41c[_0x26c3('0x17')]!==_0x26c3('0x38')){var _0x474349={};_0x474349[_0x40e41c['name']]={'$like':'%'+_0x5545ee[_0x26c3('0x2f')][_0x26c3('0x36')]+'%'};return _0x474349;}})});}_0x50a3e5=_[_0x26c3('0x37')]({},_0x50a3e5,_0x5545ee[_0x26c3('0x39')]);var _0x43145f={'where':_0x50a3e5[_0x26c3('0x34')]};return db['CmHopper']['count'](_0x43145f)[_0x26c3('0x10')](function(_0xcdb3fb){_0x2613e2[_0x26c3('0xc')]=_0xcdb3fb;if(_0x5545ee[_0x26c3('0x2f')][_0x26c3('0x3a')]){_0x50a3e5['include']=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x50a3e5);})[_0x26c3('0x10')](function(_0x3fc4f7){_0x2613e2[_0x26c3('0x3b')]=_0x3fc4f7;return _0x2613e2;})[_0x26c3('0x10')](respondWithFilteredResult(_0x38fe17,_0x50a3e5))[_0x26c3('0x3c')](handleError(_0x38fe17,null));};exports['show']=function(_0x592764,_0x6db262){var _0x16e680={'raw':!![],'where':{'id':_0x592764[_0x26c3('0x3d')]['id']}},_0x2d9e80={};_0x2d9e80['model']=_[_0x26c3('0x18')](db[_0x26c3('0x15')][_0x26c3('0x3e')]);_0x2d9e80[_0x26c3('0x2f')]=_[_0x26c3('0x18')](_0x592764[_0x26c3('0x2f')]);_0x2d9e80[_0x26c3('0x19')]=_[_0x26c3('0x2d')](_0x2d9e80[_0x26c3('0x1a')],_0x2d9e80[_0x26c3('0x2f')]);_0x16e680[_0x26c3('0x2c')]=_[_0x26c3('0x2d')](_0x2d9e80[_0x26c3('0x1a')],qs['fields'](_0x592764[_0x26c3('0x2f')][_0x26c3('0x2e')]));_0x16e680[_0x26c3('0x2c')]=_0x16e680[_0x26c3('0x2c')][_0x26c3('0x30')]?_0x16e680[_0x26c3('0x2c')]:_0x2d9e80['model'];if(_0x592764[_0x26c3('0x2f')]['includeAll']){_0x16e680[_0x26c3('0x3f')]=[{'all':!![]}];}_0x16e680=_['merge']({},_0x16e680,_0x592764[_0x26c3('0x39')]);return db[_0x26c3('0x15')]['find'](_0x16e680)[_0x26c3('0x10')](handleEntityNotFound(_0x6db262,null))[_0x26c3('0x10')](respondWithResult(_0x6db262,null))[_0x26c3('0x3c')](handleError(_0x6db262,null));};exports[_0x26c3('0x40')]=function(_0x651d74,_0x4a7d48){return db[_0x26c3('0x15')]['create'](_0x651d74[_0x26c3('0x41')],{})['then'](respondWithResult(_0x4a7d48,0xc9))['catch'](handleError(_0x4a7d48,null));};exports[_0x26c3('0xf')]=function(_0x2b86da,_0x278563){if(_0x2b86da['body']['id']){delete _0x2b86da[_0x26c3('0x41')]['id'];}return db[_0x26c3('0x15')][_0x26c3('0x42')]({'where':{'id':_0x2b86da[_0x26c3('0x3d')]['id']}})[_0x26c3('0x10')](handleEntityNotFound(_0x278563,null))[_0x26c3('0x10')](saveUpdates(_0x2b86da['body'],null))[_0x26c3('0x10')](respondWithResult(_0x278563,null))[_0x26c3('0x3c')](handleError(_0x278563,null));};exports[_0x26c3('0x43')]=function(_0x133cf7,_0x551e22){return db[_0x26c3('0x15')][_0x26c3('0x43')]()['then'](respondWithResult(_0x551e22,null))[_0x26c3('0x3c')](handleError(_0x551e22,null));};exports[_0x26c3('0x44')]=function(_0x522fe2,_0x4566ab){var _0x4827c6;var _0x2c6d8b=_0x522fe2[_0x26c3('0x3d')]['id'];return db[_0x26c3('0x15')][_0x26c3('0x42')]({'where':{'id':_0x522fe2[_0x26c3('0x3d')]['id']}})[_0x26c3('0x10')](handleEntityNotFound(_0x4566ab,null))[_0x26c3('0x10')](function(_0x4b7578){if(_0x4b7578){return _0x4b7578[_0x26c3('0x44')]()['then'](function(_0x4ada42){return _0x4ada42;});}})[_0x26c3('0x10')](function(_0x3a46f9){_0x4827c6=_0x3a46f9;if(_0x3a46f9){if(_0x3a46f9[_0x26c3('0x45')]||_0x3a46f9['CampaignId']){return db[_0x3a46f9['VoiceQueueId']?_0x26c3('0x46'):_0x26c3('0x47')][_0x26c3('0x42')]({'where':{'id':_0x3a46f9['VoiceQueueId']?_0x3a46f9[_0x26c3('0x45')]:_0x3a46f9[_0x26c3('0x48')]},'attributes':['id',_0x26c3('0x12')],'raw':!![]});}}})['then'](function(_0x24f3a1){var _0x4f3564={};if(_0x24f3a1){_[_0x26c3('0x37')](_0x4f3564,_[_0x26c3('0x49')](_0x4827c6[_0x26c3('0x4a')],['createdAt',_0x26c3('0x4b'),'id']));_0x4f3564[_0x26c3('0x4c')]=0x15;_0x4f3564[_0x26c3('0x4d')]=_0x26c3('0x4e');_0x4f3564[_0x26c3('0x4f')]=_0x24f3a1[_0x26c3('0x12')];_0x4f3564['membername']=_0x522fe2[_0x26c3('0x50')][_0x26c3('0x12')];_0x4f3564['UserId']=_0x522fe2[_0x26c3('0x50')]['id'];_0x4f3564['deleted']=!![];_0x4f3564['deletedat']=moment()[_0x26c3('0x51')]('YYYY-MM-DD\x20HH:mm:ss');_0x4f3564[_0x26c3('0x52')]=_0x4827c6[_0x26c3('0x53')];_0x4f3564[_0x26c3('0x54')]=_0x4827c6[_0x26c3('0x45')]?'queue':'ivr';return db[_0x26c3('0x55')]['find']({'where':{'id':_0x4f3564['ContactId']},'attributes':['firstName',_0x26c3('0x56')]})['then'](function(_0x4a0100){if(!_[_0x26c3('0x57')](_0x4566ab)&&!_[_0x26c3('0x57')](_0x4a0100[_0x26c3('0x58')])){_0x4f3564[_0x26c3('0x59')]=_0x4a0100[_0x26c3('0x58')];if(!_[_0x26c3('0x57')](_0x4a0100['lastName'])){_0x4f3564[_0x26c3('0x59')]+='\x20'+_0x4a0100[_0x26c3('0x56')];}}})[_0x26c3('0x5a')](function(){return db[_0x26c3('0x5b')]['create'](_0x4f3564);});}})[_0x26c3('0x10')](function(_0x2c8390){return db[_0x26c3('0x5c')][_0x26c3('0x44')]({'where':{'CmHopperId':_0x2c6d8b}});})[_0x26c3('0x10')](function(){return _0x4566ab[_0x26c3('0x7')](0xcc)['end']();})[_0x26c3('0x3c')](handleError(_0x4566ab,null));};exports[_0x26c3('0x5d')]=function(_0x34c041,_0x3ad7b1){var _0x5cc9fc=[];return db[_0x26c3('0x55')][_0x26c3('0x43')]()[_0x26c3('0x10')](function(_0x416373){_0x5cc9fc=_['keys'](_0x416373);return _0x34c041[_0x26c3('0x50')][_0x26c3('0x5e')]({'where':{'type':_0x26c3('0x5f'),'dialActive':!![],'dialMethod':_0x26c3('0x60')},'attributes':['id','dialOrderByScheduledAt',_0x26c3('0x61')],'raw':!![]});})['then'](function(_0x2ada84){if(_0x2ada84&&_0x2ada84['length']){return db[_0x26c3('0x62')][_0x26c3('0x63')](function(_0x4bfda1){var _0x4518bc={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x26c3('0x51')](_0x26c3('0x64'))},'VoiceQueueId':{'$in':_[_0x26c3('0x14')](_0x2ada84,'id')},'$or':[{'UserId':null},{'UserId':_0x34c041[_0x26c3('0x50')]['id']}]};var _0x4fbd2e={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x2ada84)[_0x26c3('0x36')]([_0x26c3('0x61'),0x0])[_0x26c3('0x14')]('id')[_0x26c3('0x65')]()},'$or':[{'UserId':null},{'UserId':_0x34c041[_0x26c3('0x50')]['id']}]};var _0x3268d7={'$or':[_0x4518bc,_0x4fbd2e]};var _0x38cd7e=[];if(_0x34c041['body'][_0x26c3('0x66')]&&_0x34c041[_0x26c3('0x41')][_0x26c3('0x66')]===_0x26c3('0x67')){if(!_['isEmpty'](_0x34c041[_0x26c3('0x41')][_0x26c3('0x68')])){_0x3268d7['id']={'$in':_0x34c041['body'][_0x26c3('0x68')]};}_0x38cd7e=[[_0x26c3('0x69'),_0x26c3('0x6a')],[_0x26c3('0x6b'),_0x2ada84[0x0][_0x26c3('0x6c')]===_0x26c3('0x6a')?_0x26c3('0x6d'):_0x26c3('0x6a')],db[_0x26c3('0x62')][_0x26c3('0x6e')](_0x26c3('0x6f')),['id',_0x26c3('0x6d')]];}else{if(!_['isEmpty'](_0x34c041['body']['hopperIds'])){_0x3268d7['id']={'$notIn':_0x34c041['body'][_0x26c3('0x68')]};}_0x38cd7e=[[_0x26c3('0x69'),_0x26c3('0x6d')],[_0x26c3('0x6b'),_0x2ada84[0x0][_0x26c3('0x6c')]],db[_0x26c3('0x62')][_0x26c3('0x6e')](_0x26c3('0x70')),['id','ASC']];}return db[_0x26c3('0x15')][_0x26c3('0x71')]({'attributes':['id',_0x26c3('0x72'),_0x26c3('0x53'),_0x26c3('0x73')],'where':_0x3268d7,'order':_0x38cd7e,'transaction':_0x4bfda1,'lock':_0x4bfda1[_0x26c3('0x74')]['UPDATE'],'include':[{'model':db[_0x26c3('0x55')],'as':_0x26c3('0x75'),'attributes':_0x5cc9fc,'include':[{'model':db['CmCompany'],'as':_0x26c3('0x76'),'attributes':['id',_0x26c3('0x12')]}]},{'model':db['CmList'],'as':_0x26c3('0x77'),'attributes':['id',_0x26c3('0x12')]},{'model':db[_0x26c3('0x46')],'as':'Queue','attributes':['id',_0x26c3('0x12'),_0x26c3('0x78')]}]})[_0x26c3('0x10')](function(_0x13f0ac){if(_0x13f0ac){return _0x13f0ac[_0x26c3('0xf')]({'UserId':_0x34c041[_0x26c3('0x50')]['id']},{'transaction':_0x4bfda1});}});});}})[_0x26c3('0x10')](handleEntityNotFound(_0x3ad7b1,null))['then'](respondWithResult(_0x3ad7b1,null))['catch'](handleError(_0x3ad7b1,null));};exports[_0x26c3('0x79')]=function(_0x1ce607,_0x1c7387,_0x18189a){var _0x56b282=[];var _0x3c03cb=_0x1ce607['params']['id'];var _0x568151=_0x1ce607[_0x26c3('0x50')]['id'];return db[_0x26c3('0x55')]['describe']()[_0x26c3('0x10')](function(_0x59a8b8){_0x56b282=_[_0x26c3('0x18')](_0x59a8b8);return db[_0x26c3('0x62')][_0x26c3('0x63')](function(_0x5bbaae){const _0xc40965={'id':_0x3c03cb};return db['CmHopper'][_0x26c3('0x71')]({'attributes':['id',_0x26c3('0x72'),_0x26c3('0x73')],'where':_0xc40965,'transaction':_0x5bbaae,'lock':_0x5bbaae[_0x26c3('0x74')][_0x26c3('0x7a')],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_0x56b282,'include':[{'model':db[_0x26c3('0x7b')],'as':_0x26c3('0x76'),'attributes':['id','name']}]},{'model':db[_0x26c3('0x7c')],'as':_0x26c3('0x77'),'attributes':['id',_0x26c3('0x12')]},{'model':db['VoiceQueue'],'as':_0x26c3('0x7d'),'attributes':['id',_0x26c3('0x12'),'dialActive']}]})['then'](function(_0x1440c9){if(_0x1440c9){return _0x1440c9[_0x26c3('0xf')]({'UserId':_0x568151},{'transaction':_0x5bbaae});}});});})[_0x26c3('0x10')](handleEntityNotFound(_0x1c7387,null))[_0x26c3('0x10')](respondWithResult(_0x1c7387,null))[_0x26c3('0x3c')](handleError(_0x1c7387,null));};exports[_0x26c3('0x7e')]=function(_0x483458,_0x3ca3d7){return _0x483458[_0x26c3('0x50')]['getVoiceQueues']({'where':{'type':_0x26c3('0x5f'),'dialActive':!![],'dialMethod':_0x26c3('0x60')},'attributes':['id'],'raw':!![]})[_0x26c3('0x10')](function(_0x54691c){if(_0x54691c&&_0x54691c[_0x26c3('0x30')]){return db[_0x26c3('0x15')][_0x26c3('0xc')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x26c3('0x51')](_0x26c3('0x64'))},'VoiceQueueId':{'$in':_['map'](_0x54691c,'id')},'$or':[{'UserId':null},{'UserId':_0x483458['user']['id']}]}});}return 0x0;})[_0x26c3('0x10')](function(_0x469a0a){if(!_[_0x26c3('0x57')](_0x469a0a)&&_['isNumber'](_0x469a0a)){return _0x3ca3d7[_0x26c3('0x7')](0xc8)[_0x26c3('0x8')]({'contacts':_0x469a0a});}else{logger['error'](_0x26c3('0x7f'),_0x26c3('0x7e'),0x194,_0x26c3('0x80'));_0x3ca3d7['sendStatus'](0x194);}})[_0x26c3('0x3c')](handleError(_0x3ca3d7,null));};exports[_0x26c3('0x81')]=function(_0x452a3e,_0x188f2e){var _0x4e9d4b=shared['timezones'];var _0x34acb7=[];_[_0x26c3('0x14')](_0x4e9d4b,function(_0x1be246){_0x34acb7[_0x26c3('0x82')]({'id':_0x1be246[_0x26c3('0x12')],'name':_0x1be246[_0x26c3('0x12')],'utcOffset':_0x1be246['utcOffset']});});return _0x188f2e[_0x26c3('0x7')](0xc8)[_0x26c3('0x8')]({'tz':_0x34acb7});};exports[_0x26c3('0x83')]=function(_0x44a99e,_0x2c91f1){var _0x23f7af=shared[_0x26c3('0x84')];var _0x1da826={};if(!_[_0x26c3('0x57')](_0x23f7af[_0x44a99e[_0x26c3('0x41')]['id']]))_0x1da826=_0x23f7af[_0x44a99e['body']['id']];return _0x2c91f1[_0x26c3('0x7')](0xc8)[_0x26c3('0x8')](_0x1da826);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index f7b68e2..f343dbe 100644 --- a/server/api/cmHopper/cmHopper.model.js +++ b/server/api/cmHopper/cmHopper.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4819=['request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','CmHopper','cm_hopper','scheduledat','phone','priority','util','../../config/logger','api','moment','bluebird'];(function(_0x2b374b,_0x165a3c){var _0x2bdfe3=function(_0x18ea45){while(--_0x18ea45){_0x2b374b['push'](_0x2b374b['shift']());}};_0x2bdfe3(++_0x165a3c);}(_0x4819,0xcd));var _0x9481=function(_0x408de5,_0x24fa7b){_0x408de5=_0x408de5-0x0;var _0x2015a1=_0x4819[_0x408de5];return _0x2015a1;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var logger=require(_0x9481('0x1'))(_0x9481('0x2'));var moment=require(_0x9481('0x3'));var BPromise=require(_0x9481('0x4'));var rp=require(_0x9481('0x5'));var fs=require('fs');var path=require(_0x9481('0x6'));var rimraf=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var attributes=require(_0x9481('0x9'));module['exports']=function(_0x4d9e3a,_0x5def07){return _0x4d9e3a['define'](_0x9481('0xa'),attributes,{'tableName':_0x9481('0xb'),'paranoid':![],'indexes':[{'name':_0x9481('0xc'),'fields':[_0x9481('0xc')]},{'name':_0x9481('0xd'),'fields':['phone']},{'name':_0x9481('0xe'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0xda19=['define','CmHopper','cm_hopper','scheduledat','priority','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./cmHopper.attributes','exports'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xda19,0xd5));var _0x9da1=function(_0x333815,_0x667133){_0x333815=_0x333815-0x0;var _0x393c79=_0xda19[_0x333815];return _0x393c79;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var logger=require(_0x9da1('0x1'))('api');var moment=require(_0x9da1('0x2'));var BPromise=require('bluebird');var rp=require(_0x9da1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9da1('0x4'));var config=require(_0x9da1('0x5'));var attributes=require(_0x9da1('0x6'));module[_0x9da1('0x7')]=function(_0x156faf,_0x2dcbc6){return _0x156faf[_0x9da1('0x8')](_0x9da1('0x9'),attributes,{'tableName':_0x9da1('0xa'),'paranoid':![],'indexes':[{'name':_0x9da1('0xb'),'fields':['scheduledat']},{'name':'phone','fields':['phone']},{'name':_0x9da1('0xc'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 182f6d8..2eb547c 100644 --- a/server/api/cmHopper/cmHopper.rpc.js +++ b/server/api/cmHopper/cmHopper.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9f37=['`scheduledat`\x20>=\x20','format','\x22%s\x22','contactsRescheduled','CountReScheduled','findAll','all','GetContactRecallMe','GetCmHopperPreview','Contact','keys','GetContactByPhone','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','literal','\x20MINUTE','NOW()','CmList','List','lodash','util','moment','../../mysqldb','rpc','CmHopper','options','raw','where','attributes','limit','model','include','map','info','GetCmHopper','debug','stringify','error','message','ShowCmHopper','catch','CreateCmHopper','create','body','then','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','describe','sequelize','order','UPDATE','CmContact','User','name','voicePause','length','UserId','push','includes','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','transaction','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]'];(function(_0x768165,_0x1e7660){var _0x5874ee=function(_0x56e35c){while(--_0x56e35c){_0x768165['push'](_0x768165['shift']());}};_0x5874ee(++_0x1e7660);}(_0x9f37,0xb6));var _0x79f3=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x9f37[_0x7e2eb0];return _0xd92de4;};'use strict';var _=require(_0x79f3('0x0'));var util=require(_0x79f3('0x1'));var moment=require(_0x79f3('0x2'));var BPromise=require('bluebird');var db=require(_0x79f3('0x3'))['db'];var logger=require('../../config/logger')(_0x79f3('0x4'));exports['GetCmHopper']=function(_0x47de24){var _0x49ef78=this;return new Promise(function(_0x3284f9,_0x8b3eba){return db[_0x79f3('0x5')]['findAll']({'raw':_0x47de24[_0x79f3('0x6')]?_0x47de24[_0x79f3('0x6')][_0x79f3('0x7')]===undefined?!![]:![]:!![],'where':_0x47de24[_0x79f3('0x6')]?_0x47de24['options'][_0x79f3('0x8')]||null:null,'attributes':_0x47de24[_0x79f3('0x6')]?_0x47de24[_0x79f3('0x6')][_0x79f3('0x9')]||null:null,'limit':_0x47de24[_0x79f3('0x6')]?_0x47de24[_0x79f3('0x6')][_0x79f3('0xa')]||null:null,'include':_0x47de24[_0x79f3('0x6')]?_0x47de24[_0x79f3('0x6')]['include']?_['map'](_0x47de24[_0x79f3('0x6')]['include'],function(_0xf8b67c){return{'model':db[_0xf8b67c[_0x79f3('0xb')]],'as':_0xf8b67c['as'],'attributes':_0xf8b67c[_0x79f3('0x9')],'include':_0xf8b67c[_0x79f3('0xc')]?_[_0x79f3('0xd')](_0xf8b67c[_0x79f3('0xc')],function(_0x20513b){return{'model':db[_0x20513b[_0x79f3('0xb')]],'as':_0x20513b['as'],'attributes':_0x20513b[_0x79f3('0x9')],'include':_0x20513b[_0x79f3('0xc')]?_[_0x79f3('0xd')](_0x20513b[_0x79f3('0xc')],function(_0x42a04a){return{'model':db[_0x42a04a[_0x79f3('0xb')]],'as':_0x42a04a['as'],'attributes':_0x42a04a[_0x79f3('0x9')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x26941b){logger[_0x79f3('0xe')](_0x79f3('0xf'),_0x47de24);logger[_0x79f3('0x10')](_0x79f3('0xf'),_0x47de24,JSON[_0x79f3('0x11')](_0x26941b));_0x3284f9(_0x26941b);})['catch'](function(_0x3490dc){logger['error'](_0x79f3('0xf'),_0x3490dc['message'],_0x47de24);_0x8b3eba(_0x49ef78[_0x79f3('0x12')](0x1f4,_0x3490dc[_0x79f3('0x13')]));});});};exports[_0x79f3('0x14')]=function(_0xaf5bf8){var _0x2f0ec7=this;return new Promise(function(_0x3c3009,_0x515800){return db['CmHopper']['find']({'raw':_0xaf5bf8[_0x79f3('0x6')]?_0xaf5bf8[_0x79f3('0x6')][_0x79f3('0x7')]===undefined?!![]:![]:!![],'where':_0xaf5bf8[_0x79f3('0x6')]?_0xaf5bf8[_0x79f3('0x6')]['where']||null:null,'attributes':_0xaf5bf8[_0x79f3('0x6')]?_0xaf5bf8[_0x79f3('0x6')][_0x79f3('0x9')]||null:null,'include':_0xaf5bf8['options']?_0xaf5bf8[_0x79f3('0x6')][_0x79f3('0xc')]?_[_0x79f3('0xd')](_0xaf5bf8[_0x79f3('0x6')][_0x79f3('0xc')],function(_0x360845){return{'model':db[_0x360845[_0x79f3('0xb')]],'as':_0x360845['as'],'attributes':_0x360845[_0x79f3('0x9')],'include':_0x360845[_0x79f3('0xc')]?_[_0x79f3('0xd')](_0x360845[_0x79f3('0xc')],function(_0x1ae10b){return{'model':db[_0x1ae10b['model']],'as':_0x1ae10b['as'],'attributes':_0x1ae10b[_0x79f3('0x9')],'include':_0x1ae10b[_0x79f3('0xc')]?_[_0x79f3('0xd')](_0x1ae10b[_0x79f3('0xc')],function(_0x23510b){return{'model':db[_0x23510b[_0x79f3('0xb')]],'as':_0x23510b['as'],'attributes':_0x23510b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b9140){logger['info'](_0x79f3('0x14'),_0xaf5bf8);logger[_0x79f3('0x10')](_0x79f3('0x14'),_0xaf5bf8,JSON[_0x79f3('0x11')](_0x4b9140));_0x3c3009(_0x4b9140);})[_0x79f3('0x15')](function(_0x3635b0){logger[_0x79f3('0x12')](_0x79f3('0x14'),_0x3635b0[_0x79f3('0x13')],_0xaf5bf8);_0x515800(_0x2f0ec7[_0x79f3('0x12')](0x1f4,_0x3635b0[_0x79f3('0x13')]));});});};exports[_0x79f3('0x16')]=function(_0x11e047){var _0x4895bd=this;return new Promise(function(_0x3c0527,_0x5f573e){return db[_0x79f3('0x5')][_0x79f3('0x17')](_0x11e047[_0x79f3('0x18')],{'raw':_0x11e047[_0x79f3('0x6')]?_0x11e047[_0x79f3('0x6')][_0x79f3('0x7')]===undefined?!![]:![]:!![]})[_0x79f3('0x19')](function(_0x2e1c61){logger['info'](_0x79f3('0x16'),_0x11e047);logger[_0x79f3('0x10')](_0x79f3('0x16'),_0x11e047,JSON[_0x79f3('0x11')](_0x2e1c61));_0x3c0527(_0x2e1c61);})[_0x79f3('0x15')](function(_0x1893e1){logger['error'](_0x79f3('0x16'),_0x1893e1[_0x79f3('0x13')],_0x11e047);_0x5f573e(_0x4895bd[_0x79f3('0x12')](0x1f4,_0x1893e1[_0x79f3('0x13')]));});});};exports[_0x79f3('0x1a')]=function(_0x42c786){var _0x8018ef=this;return new Promise(function(_0xa5168f,_0x58571d){return db[_0x79f3('0x5')][_0x79f3('0x1b')](_0x42c786[_0x79f3('0x18')],{'raw':_0x42c786[_0x79f3('0x6')]?_0x42c786[_0x79f3('0x6')][_0x79f3('0x7')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42c786[_0x79f3('0x6')]?_0x42c786[_0x79f3('0x6')]['where']||null:null,'attributes':_0x42c786['options']?_0x42c786[_0x79f3('0x6')][_0x79f3('0x9')]||null:null,'limit':_0x42c786['options']?_0x42c786[_0x79f3('0x6')]['limit']||null:null})[_0x79f3('0x19')](function(_0x30cdd1){logger['info']('UpdateCmHopper',_0x42c786);logger[_0x79f3('0xe')](_0x79f3('0x1c'),JSON[_0x79f3('0x11')](_0x42c786[_0x79f3('0x6')][_0x79f3('0x8')]),_0x42c786[_0x79f3('0x18')][_0x79f3('0x1d')]);logger[_0x79f3('0x10')](_0x79f3('0x1a'),_0x42c786,JSON[_0x79f3('0x11')](_0x30cdd1));_0xa5168f(_0x30cdd1);})[_0x79f3('0x15')](function(_0xe2ddbc){logger[_0x79f3('0x12')](_0x79f3('0x1a'),_0xe2ddbc['message'],_0x42c786);_0x58571d(_0x8018ef['error'](0x1f4,_0xe2ddbc[_0x79f3('0x13')]));});});};exports[_0x79f3('0x1e')]=function(_0x4929f2){var _0xdac768=this;return new Promise(function(_0x519e1d,_0x68782){return db[_0x79f3('0x5')][_0x79f3('0x1f')]({'where':_0x4929f2[_0x79f3('0x6')]?_0x4929f2[_0x79f3('0x6')]['where']||null:null})[_0x79f3('0x19')](function(_0x392a68){logger[_0x79f3('0xe')](_0x79f3('0x1e'),_0x4929f2);logger[_0x79f3('0x10')](_0x79f3('0x1e'),_0x4929f2,JSON[_0x79f3('0x11')](_0x392a68));_0x519e1d(_0x392a68);})[_0x79f3('0x15')](function(_0x54b27f){logger[_0x79f3('0x12')]('DestroyCmHopper',_0x54b27f[_0x79f3('0x13')],_0x4929f2);_0x68782(_0xdac768[_0x79f3('0x12')](0x1f4,_0x54b27f[_0x79f3('0x13')]));});});};exports[_0x79f3('0x20')]=function(_0x12dffc){var _0x25d9df=this;return new Promise(function(_0x50ff70,_0x40bf65){return db['CmContact'][_0x79f3('0x21')]()[_0x79f3('0x19')](function(_0x4c3d08){return db[_0x79f3('0x22')]['transaction'](function(_0x33ac22){return db['CmHopper']['findAll']({'where':_0x12dffc[_0x79f3('0x6')]?_0x12dffc[_0x79f3('0x6')][_0x79f3('0x8')]||null:null,'attributes':_0x12dffc[_0x79f3('0x6')]?_0x12dffc['options'][_0x79f3('0x9')]||null:null,'limit':_0x12dffc['options']?_0x12dffc['options']['limit']||null:null,'order':_0x12dffc[_0x79f3('0x6')]?_0x12dffc[_0x79f3('0x6')][_0x79f3('0x23')]||null:null,'transaction':_0x33ac22,'lock':_0x33ac22['LOCK'][_0x79f3('0x24')],'include':[{'model':db[_0x79f3('0x25')],'as':'Contact','attributes':_['keys'](_0x4c3d08)},{'model':db[_0x79f3('0x26')],'as':'Agent','attributes':['id',_0x79f3('0x27'),_0x79f3('0x28')]}]})[_0x79f3('0x19')](function(_0x4dd7f3){var _0x54c6e0=[];var _0x1a005b=[];for(var _0x2460dc=0x0;_0x2460dc<_0x4dd7f3[_0x79f3('0x29')];_0x2460dc+=0x1){var _0x49d4c6=_0x4dd7f3[_0x2460dc][_0x79f3('0x2a')];if(_0x49d4c6===null){_0x54c6e0[_0x79f3('0x2b')](_0x4dd7f3[_0x2460dc][_0x79f3('0x1b')](_0x12dffc[_0x79f3('0x18')],{'transaction':_0x33ac22}));}else if(!_0x1a005b[_0x79f3('0x2c')](_0x49d4c6)){_0x1a005b[_0x79f3('0x2b')](_0x49d4c6);_0x54c6e0[_0x79f3('0x2b')](_0x4dd7f3[_0x2460dc]['update'](_0x12dffc[_0x79f3('0x18')],{'transaction':_0x33ac22}));}}return BPromise['all'](_0x54c6e0);});})[_0x79f3('0x19')](function(_0x2e8fcf){logger[_0x79f3('0xe')]('GetContactDialer',_0x12dffc);if(_0x2e8fcf[_0x79f3('0x29')]>0x0){logger['info'](_0x79f3('0x2d'),_0x2e8fcf[0x0][_0x79f3('0x2e')]['id'],_0x2e8fcf[0x0][_0x79f3('0x2e')][_0x79f3('0x2f')],_0x2e8fcf[0x0][_0x79f3('0x2e')][_0x79f3('0x1d')]);}logger['debug']('GetContactDialer',_0x12dffc,JSON[_0x79f3('0x11')](_0x2e8fcf));_0x50ff70(_0x2e8fcf);})[_0x79f3('0x15')](function(_0x12d16d){logger['error'](_0x79f3('0x20'),_0x12d16d[_0x79f3('0x13')],_0x12dffc);_0x40bf65(_0x25d9df[_0x79f3('0x12')](0x1f4,_0x12d16d[_0x79f3('0x13')]));});});});};exports[_0x79f3('0x30')]=function(_0x66c47b){var _0x547bd6=this;return new Promise(function(_0x12ecca,_0x504392){return db[_0x79f3('0x22')][_0x79f3('0x31')](function(_0x2fa3a7){return db[_0x79f3('0x32')]['create'](_0x66c47b['body'],{'raw':_0x66c47b['options']?_0x66c47b[_0x79f3('0x6')][_0x79f3('0x7')]===undefined?!![]:![]:!![],'transaction':_0x2fa3a7})[_0x79f3('0x19')](function(){logger['info'](_0x79f3('0x33'),JSON[_0x79f3('0x11')](_0x66c47b[_0x79f3('0x6')]['where']),_0x66c47b[_0x79f3('0x6')]['where'][_0x79f3('0x1d')]);return db[_0x79f3('0x5')]['destroy']({'where':_0x66c47b[_0x79f3('0x6')]?_0x66c47b['options']['where']||null:null,'transaction':_0x2fa3a7});});})[_0x79f3('0x19')](function(_0x54bdd0){logger[_0x79f3('0xe')](_0x79f3('0x30'),_0x66c47b);logger[_0x79f3('0x10')](_0x79f3('0x30'),_0x66c47b,JSON[_0x79f3('0x11')](_0x54bdd0));_0x12ecca(_0x54bdd0);})[_0x79f3('0x15')](function(_0x6135ff){logger[_0x79f3('0x12')](_0x79f3('0x30'),_0x6135ff['message'],_0x66c47b);_0x504392(_0x547bd6[_0x79f3('0x12')](0x1f4,_0x6135ff[_0x79f3('0x13')]));});});};exports['CountReScheduled']=function(_0x331b9a){var _0x4b3f72=this;return new Promise(function(_0x55e59e,_0x5bb9bf){return db[_0x79f3('0x5')]['findAll']({'raw':_0x331b9a[_0x79f3('0x6')]?_0x331b9a[_0x79f3('0x6')][_0x79f3('0x7')]===undefined?!![]:![]:!![],'where':_0x331b9a[_0x79f3('0x6')]?_0x331b9a[_0x79f3('0x6')][_0x79f3('0x8')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0x79f3('0x22')]['fn']('IF',db[_0x79f3('0x22')]['literal'](_0x79f3('0x34')+util[_0x79f3('0x35')](_0x79f3('0x36'),moment()[_0x79f3('0x35')]('YYYY-MM-DD\x20HH:mm:ss'))+'\x20,\x201,\x20null'))),_0x79f3('0x37')]]})[_0x79f3('0x19')](function(_0x4e4dfc){logger['info'](_0x79f3('0x38'),_0x331b9a);logger[_0x79f3('0x10')](_0x79f3('0x38'),_0x331b9a,JSON['stringify'](_0x4e4dfc));_0x55e59e(_0x4e4dfc);})[_0x79f3('0x15')](function(_0x4bbc2c){logger[_0x79f3('0x12')](_0x79f3('0x38'),_0x4bbc2c[_0x79f3('0x13')],_0x331b9a);_0x5bb9bf(_0x4b3f72[_0x79f3('0x12')](0x1f4,_0x4bbc2c[_0x79f3('0x13')]));});});};exports['GetContactRecallMe']=function(_0x161f6c){var _0x3431c2=this;return new Promise(function(_0x2fb212,_0x2e3ceb){return db[_0x79f3('0x25')][_0x79f3('0x21')]()[_0x79f3('0x19')](function(){return db[_0x79f3('0x22')][_0x79f3('0x31')](function(_0xa298af){return db['CmHopper'][_0x79f3('0x39')]({'where':_0x161f6c[_0x79f3('0x6')]?_0x161f6c[_0x79f3('0x6')]['where']||null:null,'attributes':_0x161f6c[_0x79f3('0x6')]?_0x161f6c[_0x79f3('0x6')][_0x79f3('0x9')]||null:null,'limit':0x1,'order':_0x161f6c[_0x79f3('0x6')]?_0x161f6c[_0x79f3('0x6')][_0x79f3('0x23')]||null:null,'group':db[_0x79f3('0x5')][_0x79f3('0x2a')],'transaction':_0xa298af,'lock':_0xa298af['LOCK'][_0x79f3('0x24')],'include':_0x161f6c['options']?_0x161f6c[_0x79f3('0x6')]['include']?_['map'](_0x161f6c[_0x79f3('0x6')]['include'],function(_0x5270b8){return{'model':db[_0x5270b8[_0x79f3('0xb')]],'as':_0x5270b8['as'],'attributes':_0x5270b8['attributes'],'include':_0x5270b8[_0x79f3('0xc')]?_[_0x79f3('0xd')](_0x5270b8['include'],function(_0x4e9e92){return{'model':db[_0x4e9e92[_0x79f3('0xb')]],'as':_0x4e9e92['as'],'attributes':_0x4e9e92['attributes'],'include':_0x4e9e92[_0x79f3('0xc')]?_[_0x79f3('0xd')](_0x4e9e92[_0x79f3('0xc')],function(_0x1a05e7){return{'model':db[_0x1a05e7['model']],'as':_0x1a05e7['as'],'attributes':_0x1a05e7[_0x79f3('0x9')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a3ce9){var _0x13c5b5=[];for(var _0x188bd8=0x0;_0x188bd8<_0x2a3ce9[_0x79f3('0x29')];_0x188bd8+=0x1){_0x13c5b5[_0x79f3('0x2b')](_0x2a3ce9[_0x188bd8][_0x79f3('0x1b')](_0x161f6c['body'],{'transaction':_0xa298af}));}return BPromise[_0x79f3('0x3a')](_0x13c5b5);});})['then'](function(_0x555986){logger[_0x79f3('0xe')](_0x79f3('0x3b'),_0x161f6c);logger[_0x79f3('0x10')](_0x79f3('0x3b'),_0x161f6c,JSON[_0x79f3('0x11')](_0x555986));_0x2fb212(_0x555986);})[_0x79f3('0x15')](function(_0x2e325e){logger[_0x79f3('0x12')](_0x79f3('0x3b'),_0x2e325e['message'],_0x161f6c);_0x2e3ceb(_0x3431c2[_0x79f3('0x12')](0x1f4,_0x2e325e[_0x79f3('0x13')]));});});});};exports[_0x79f3('0x3c')]=function(_0x5c3f5e){var _0x348a6e=this;return new Promise(function(_0x31ed84,_0x1f139d){db[_0x79f3('0x25')][_0x79f3('0x21')]()[_0x79f3('0x19')](function(_0x803ad3){return db['CmHopper'][_0x79f3('0x39')]({'raw':_0x5c3f5e['options']?_0x5c3f5e[_0x79f3('0x6')][_0x79f3('0x7')]===undefined?!![]:![]:!![],'where':_0x5c3f5e[_0x79f3('0x6')]?_0x5c3f5e[_0x79f3('0x6')][_0x79f3('0x8')]||null:null,'attributes':_0x5c3f5e[_0x79f3('0x6')]?_0x5c3f5e[_0x79f3('0x6')][_0x79f3('0x9')]||null:null,'limit':_0x5c3f5e['options']?_0x5c3f5e['options'][_0x79f3('0xa')]||null:null,'include':_0x5c3f5e['options']?_0x5c3f5e['options'][_0x79f3('0xc')]?_[_0x79f3('0xd')](_0x5c3f5e[_0x79f3('0x6')][_0x79f3('0xc')],function(_0x65bc64){return{'model':db[_0x65bc64[_0x79f3('0xb')]],'as':_0x65bc64['as'],'attributes':_0x65bc64['as']===_0x79f3('0x3d')?_[_0x79f3('0x3e')](_0x803ad3):_0x65bc64[_0x79f3('0x9')],'include':_0x65bc64[_0x79f3('0xc')]?_[_0x79f3('0xd')](_0x65bc64['include'],function(_0x485b04){return{'model':db[_0x485b04[_0x79f3('0xb')]],'as':_0x485b04['as'],'attributes':_0x485b04[_0x79f3('0x9')],'include':_0x485b04[_0x79f3('0xc')]?_[_0x79f3('0xd')](_0x485b04[_0x79f3('0xc')],function(_0x5ea979){return{'model':db[_0x5ea979[_0x79f3('0xb')]],'as':_0x5ea979['as'],'attributes':_0x5ea979[_0x79f3('0x9')]};}):[]};}):[]};}):[]:[]})[_0x79f3('0x19')](function(_0x1a9033){logger[_0x79f3('0xe')](_0x79f3('0xf'),_0x5c3f5e);logger['debug']('GetCmHopper',_0x5c3f5e,JSON[_0x79f3('0x11')](_0x1a9033));_0x31ed84(_0x1a9033);})[_0x79f3('0x15')](function(_0x41110e){logger['error'](_0x79f3('0xf'),_0x41110e[_0x79f3('0x13')],_0x5c3f5e);_0x1f139d(_0x348a6e[_0x79f3('0x12')](0x1f4,_0x41110e[_0x79f3('0x13')]));});});});};exports[_0x79f3('0x3f')]=function(_0x2ad24d){var _0x333ea2=this;return new Promise(function(_0x364b7c,_0x10f6b4){return db['CmContact'][_0x79f3('0x40')]({'raw':!![],'where':{'phone':_0x2ad24d[_0x79f3('0x6')][_0x79f3('0x8')][_0x79f3('0x41')]},'attributes':['id',_0x79f3('0x42')],'order':[['id',_0x79f3('0x43')]]})['then'](function(_0x3cfb8d){logger[_0x79f3('0xe')](_0x79f3('0x44'),_0x2ad24d);logger[_0x79f3('0x10')](_0x79f3('0x44'),_0x2ad24d,JSON[_0x79f3('0x11')](_0x3cfb8d));_0x364b7c(_0x3cfb8d);})['catch'](function(_0x275823){logger[_0x79f3('0x12')](_0x79f3('0x44'),_0x275823[_0x79f3('0x13')],_0x2ad24d);_0x10f6b4(_0x333ea2[_0x79f3('0x12')](0x1f4,_0x275823[_0x79f3('0x13')]));});});};exports['ResetActiveCalls']=function(_0x39ebe5){var _0x18e10b=this;return new Promise(function(_0x4c9c90,_0x4df05f){return db['sequelize'][_0x79f3('0x31')](function(_0xdd26ca){var _0x1804d2=_0x39ebe5['options']&&_0x39ebe5[_0x79f3('0x6')]['where']?_0x39ebe5[_0x79f3('0x6')][_0x79f3('0x8')]:{};return db['CmHopper'][_0x79f3('0x1b')](_0x39ebe5[_0x79f3('0x18')],{'where':_0x1804d2,'transaction':_0xdd26ca})[_0x79f3('0x19')](function(_0x3ecefd){logger[_0x79f3('0xe')](_0x79f3('0x45'),_0x39ebe5);logger[_0x79f3('0x10')](_0x79f3('0x45'),_0x39ebe5,JSON[_0x79f3('0x11')](_0x3ecefd));_0x4c9c90(_0x3ecefd);})[_0x79f3('0x15')](function(_0x90b3fa){logger[_0x79f3('0x12')](_0x79f3('0x45'),_0x90b3fa[_0x79f3('0x13')],_0x39ebe5);_0x4df05f(_0x18e10b[_0x79f3('0x12')](0x1f4,_0x90b3fa[_0x79f3('0x13')]));});});});};exports[_0x79f3('0x46')]=function(_0x5f4095){var _0x8e40bb=this;var _0x540faf=_0x5f4095[_0x79f3('0x18')][_0x79f3('0x8')][_0x79f3('0x47')];var _0x21cca6=_0x5f4095[_0x79f3('0x18')]['where'][_0x79f3('0x48')];var _0x53db90=_0x5f4095['body']['where']['availableAgentsIds'];return new Promise(function(_0x75fa54,_0x2c8900){return db[_0x79f3('0x5')][_0x79f3('0x39')]({'where':{'voiceQueueId':{'$in':_0x540faf},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x79f3('0x22')][_0x79f3('0x49')]('NOW()\x20+\x20INTERVAL\x20'+_0x21cca6+_0x79f3('0x4a')),'$gt':db[_0x79f3('0x22')][_0x79f3('0x49')](_0x79f3('0x4b'))}},'UserId':{'$in':_0x53db90}},'include':[{'model':db[_0x79f3('0x25')],'as':_0x79f3('0x3d')},{'model':db['User'],'as':'Agent','attributes':['id',_0x79f3('0x27'),_0x79f3('0x28')]},{'model':db[_0x79f3('0x4c')],'as':_0x79f3('0x4d')}]})[_0x79f3('0x19')](function(_0x308043){if(_0x308043[_0x79f3('0x29')]>0x0){return db['sequelize'][_0x79f3('0x31')](function(_0x1dd2a7){return db[_0x79f3('0x5')][_0x79f3('0x1b')]({'recallmeNotifiedDate':db[_0x79f3('0x22')][_0x79f3('0x49')](_0x79f3('0x4b'))},{'where':{'id':{'$in':_[_0x79f3('0xd')](_0x308043,'id')}},'transaction':_0x1dd2a7})[_0x79f3('0x19')](function(){_0x75fa54(_0x308043);})[_0x79f3('0x15')](function(_0x54b266){logger[_0x79f3('0x12')](_0x79f3('0x46'),_0x54b266['message'],_0x5f4095);_0x2c8900(_0x8e40bb[_0x79f3('0x12')](0x1f4,_0x54b266[_0x79f3('0x13')]));});})[_0x79f3('0x15')](function(_0x4f55bc){logger[_0x79f3('0x12')](_0x79f3('0x46'),_0x4f55bc[_0x79f3('0x13')],_0x5f4095);_0x2c8900(_0x8e40bb['error'](0x1f4,_0x4f55bc[_0x79f3('0x13')]));});}else{_0x75fa54(_0x308043);}});});}; \ No newline at end of file +var _0xbfc7=['stringify','catch','error','message','ShowCmHopper','find','where','CreateCmHopper','create','body','UpdateCmHopper','destroy','DestroyCmHopper','GetContactDialer','CmContact','describe','limit','order','LOCK','UPDATE','Contact','Agent','name','voicePause','length','UserId','push','update','includes','all','dataValues','ContactId','active','sequelize','transaction','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','MoveContactManagedDialer','CountReScheduled','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','findAll','GetContactRecallMe','GetContactByPhone','findOne','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','literal','\x20MINUTE','NOW()','User','CmList','List','util','moment','bluebird','../../config/logger','rpc','CmHopper','options','raw','attributes','include','map','model','then','info','GetCmHopper','debug'];(function(_0x591d06,_0x534b3e){var _0x352214=function(_0xa6bc8c){while(--_0xa6bc8c){_0x591d06['push'](_0x591d06['shift']());}};_0x352214(++_0x534b3e);}(_0xbfc7,0x1b8));var _0x7bfc=function(_0x3c78ed,_0x4c442e){_0x3c78ed=_0x3c78ed-0x0;var _0x33a5f5=_0xbfc7[_0x3c78ed];return _0x33a5f5;};'use strict';var _=require('lodash');var util=require(_0x7bfc('0x0'));var moment=require(_0x7bfc('0x1'));var BPromise=require(_0x7bfc('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0x7bfc('0x3'))(_0x7bfc('0x4'));exports['GetCmHopper']=function(_0x13a701){var _0x2c8644=this;return new Promise(function(_0x337e3d,_0x14d49a){return db[_0x7bfc('0x5')]['findAll']({'raw':_0x13a701[_0x7bfc('0x6')]?_0x13a701[_0x7bfc('0x6')][_0x7bfc('0x7')]===undefined?!![]:![]:!![],'where':_0x13a701[_0x7bfc('0x6')]?_0x13a701['options']['where']||null:null,'attributes':_0x13a701[_0x7bfc('0x6')]?_0x13a701[_0x7bfc('0x6')][_0x7bfc('0x8')]||null:null,'limit':_0x13a701[_0x7bfc('0x6')]?_0x13a701['options']['limit']||null:null,'include':_0x13a701[_0x7bfc('0x6')]?_0x13a701[_0x7bfc('0x6')][_0x7bfc('0x9')]?_[_0x7bfc('0xa')](_0x13a701[_0x7bfc('0x6')]['include'],function(_0xbd766a){return{'model':db[_0xbd766a['model']],'as':_0xbd766a['as'],'attributes':_0xbd766a['attributes'],'include':_0xbd766a[_0x7bfc('0x9')]?_[_0x7bfc('0xa')](_0xbd766a[_0x7bfc('0x9')],function(_0x29d343){return{'model':db[_0x29d343['model']],'as':_0x29d343['as'],'attributes':_0x29d343[_0x7bfc('0x8')],'include':_0x29d343[_0x7bfc('0x9')]?_['map'](_0x29d343['include'],function(_0xcbeeef){return{'model':db[_0xcbeeef[_0x7bfc('0xb')]],'as':_0xcbeeef['as'],'attributes':_0xcbeeef[_0x7bfc('0x8')]};}):[]};}):[]};}):[]:[]})[_0x7bfc('0xc')](function(_0x391041){logger[_0x7bfc('0xd')](_0x7bfc('0xe'),_0x13a701);logger[_0x7bfc('0xf')](_0x7bfc('0xe'),_0x13a701,JSON[_0x7bfc('0x10')](_0x391041));_0x337e3d(_0x391041);})[_0x7bfc('0x11')](function(_0x1e2080){logger[_0x7bfc('0x12')](_0x7bfc('0xe'),_0x1e2080[_0x7bfc('0x13')],_0x13a701);_0x14d49a(_0x2c8644['error'](0x1f4,_0x1e2080[_0x7bfc('0x13')]));});});};exports[_0x7bfc('0x14')]=function(_0x25c805){var _0x436065=this;return new Promise(function(_0x412a88,_0x3d81f7){return db[_0x7bfc('0x5')][_0x7bfc('0x15')]({'raw':_0x25c805[_0x7bfc('0x6')]?_0x25c805[_0x7bfc('0x6')][_0x7bfc('0x7')]===undefined?!![]:![]:!![],'where':_0x25c805['options']?_0x25c805[_0x7bfc('0x6')][_0x7bfc('0x16')]||null:null,'attributes':_0x25c805[_0x7bfc('0x6')]?_0x25c805['options']['attributes']||null:null,'include':_0x25c805[_0x7bfc('0x6')]?_0x25c805[_0x7bfc('0x6')]['include']?_['map'](_0x25c805['options']['include'],function(_0x3a933d){return{'model':db[_0x3a933d[_0x7bfc('0xb')]],'as':_0x3a933d['as'],'attributes':_0x3a933d[_0x7bfc('0x8')],'include':_0x3a933d[_0x7bfc('0x9')]?_['map'](_0x3a933d['include'],function(_0x343584){return{'model':db[_0x343584[_0x7bfc('0xb')]],'as':_0x343584['as'],'attributes':_0x343584['attributes'],'include':_0x343584[_0x7bfc('0x9')]?_['map'](_0x343584[_0x7bfc('0x9')],function(_0x3d554d){return{'model':db[_0x3d554d[_0x7bfc('0xb')]],'as':_0x3d554d['as'],'attributes':_0x3d554d[_0x7bfc('0x8')]};}):[]};}):[]};}):[]:[]})[_0x7bfc('0xc')](function(_0x568570){logger[_0x7bfc('0xd')](_0x7bfc('0x14'),_0x25c805);logger['debug']('ShowCmHopper',_0x25c805,JSON[_0x7bfc('0x10')](_0x568570));_0x412a88(_0x568570);})[_0x7bfc('0x11')](function(_0x27b664){logger[_0x7bfc('0x12')](_0x7bfc('0x14'),_0x27b664['message'],_0x25c805);_0x3d81f7(_0x436065[_0x7bfc('0x12')](0x1f4,_0x27b664[_0x7bfc('0x13')]));});});};exports[_0x7bfc('0x17')]=function(_0x27962b){var _0x44d343=this;return new Promise(function(_0x1c02db,_0x358039){return db['CmHopper'][_0x7bfc('0x18')](_0x27962b[_0x7bfc('0x19')],{'raw':_0x27962b[_0x7bfc('0x6')]?_0x27962b['options']['raw']===undefined?!![]:![]:!![]})[_0x7bfc('0xc')](function(_0xc462d5){logger[_0x7bfc('0xd')](_0x7bfc('0x17'),_0x27962b);logger[_0x7bfc('0xf')](_0x7bfc('0x17'),_0x27962b,JSON[_0x7bfc('0x10')](_0xc462d5));_0x1c02db(_0xc462d5);})[_0x7bfc('0x11')](function(_0xa5838){logger['error'](_0x7bfc('0x17'),_0xa5838['message'],_0x27962b);_0x358039(_0x44d343[_0x7bfc('0x12')](0x1f4,_0xa5838[_0x7bfc('0x13')]));});});};exports[_0x7bfc('0x1a')]=function(_0x2778ea){var _0x11e467=this;return new Promise(function(_0x5c1d55,_0x306ff4){return db[_0x7bfc('0x5')]['update'](_0x2778ea[_0x7bfc('0x19')],{'raw':_0x2778ea[_0x7bfc('0x6')]?_0x2778ea[_0x7bfc('0x6')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2778ea[_0x7bfc('0x6')]?_0x2778ea[_0x7bfc('0x6')][_0x7bfc('0x16')]||null:null,'attributes':_0x2778ea[_0x7bfc('0x6')]?_0x2778ea[_0x7bfc('0x6')][_0x7bfc('0x8')]||null:null,'limit':_0x2778ea[_0x7bfc('0x6')]?_0x2778ea[_0x7bfc('0x6')]['limit']||null:null})[_0x7bfc('0xc')](function(_0x4fe02d){logger[_0x7bfc('0xd')](_0x7bfc('0x1a'),_0x2778ea);logger[_0x7bfc('0xd')]('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x7bfc('0x10')](_0x2778ea[_0x7bfc('0x6')]['where']),_0x2778ea['body']['active']);logger[_0x7bfc('0xf')](_0x7bfc('0x1a'),_0x2778ea,JSON[_0x7bfc('0x10')](_0x4fe02d));_0x5c1d55(_0x4fe02d);})[_0x7bfc('0x11')](function(_0x4e38c){logger[_0x7bfc('0x12')](_0x7bfc('0x1a'),_0x4e38c[_0x7bfc('0x13')],_0x2778ea);_0x306ff4(_0x11e467[_0x7bfc('0x12')](0x1f4,_0x4e38c[_0x7bfc('0x13')]));});});};exports['DestroyCmHopper']=function(_0x34f0a7){var _0x1959f7=this;return new Promise(function(_0x4b2a91,_0x1d86eb){return db['CmHopper'][_0x7bfc('0x1b')]({'where':_0x34f0a7[_0x7bfc('0x6')]?_0x34f0a7[_0x7bfc('0x6')][_0x7bfc('0x16')]||null:null})[_0x7bfc('0xc')](function(_0x51b5be){logger[_0x7bfc('0xd')](_0x7bfc('0x1c'),_0x34f0a7);logger[_0x7bfc('0xf')](_0x7bfc('0x1c'),_0x34f0a7,JSON[_0x7bfc('0x10')](_0x51b5be));_0x4b2a91(_0x51b5be);})['catch'](function(_0x54a040){logger['error'](_0x7bfc('0x1c'),_0x54a040[_0x7bfc('0x13')],_0x34f0a7);_0x1d86eb(_0x1959f7[_0x7bfc('0x12')](0x1f4,_0x54a040[_0x7bfc('0x13')]));});});};exports[_0x7bfc('0x1d')]=function(_0x38eb23){var _0x242541=this;return new Promise(function(_0x33e420,_0x3604be){return db[_0x7bfc('0x1e')][_0x7bfc('0x1f')]()['then'](function(_0x3473cd){return db['sequelize']['transaction'](function(_0x1d0ce0){return db[_0x7bfc('0x5')]['findAll']({'where':_0x38eb23[_0x7bfc('0x6')]?_0x38eb23[_0x7bfc('0x6')]['where']||null:null,'attributes':_0x38eb23[_0x7bfc('0x6')]?_0x38eb23['options'][_0x7bfc('0x8')]||null:null,'limit':_0x38eb23[_0x7bfc('0x6')]?_0x38eb23[_0x7bfc('0x6')][_0x7bfc('0x20')]||null:null,'order':_0x38eb23[_0x7bfc('0x6')]?_0x38eb23[_0x7bfc('0x6')][_0x7bfc('0x21')]||null:null,'transaction':_0x1d0ce0,'lock':_0x1d0ce0[_0x7bfc('0x22')][_0x7bfc('0x23')],'include':[{'model':db[_0x7bfc('0x1e')],'as':_0x7bfc('0x24'),'attributes':_['keys'](_0x3473cd)},{'model':db['User'],'as':_0x7bfc('0x25'),'attributes':['id',_0x7bfc('0x26'),_0x7bfc('0x27')]}]})[_0x7bfc('0xc')](function(_0x37965f){var _0x1d75e=[];var _0x34b2ed=[];for(var _0x42351f=0x0;_0x42351f<_0x37965f[_0x7bfc('0x28')];_0x42351f+=0x1){var _0x31ccae=_0x37965f[_0x42351f][_0x7bfc('0x29')];if(_0x31ccae===null){_0x1d75e[_0x7bfc('0x2a')](_0x37965f[_0x42351f][_0x7bfc('0x2b')](_0x38eb23[_0x7bfc('0x19')],{'transaction':_0x1d0ce0}));}else if(!_0x34b2ed[_0x7bfc('0x2c')](_0x31ccae)){_0x34b2ed['push'](_0x31ccae);_0x1d75e['push'](_0x37965f[_0x42351f]['update'](_0x38eb23[_0x7bfc('0x19')],{'transaction':_0x1d0ce0}));}}return BPromise[_0x7bfc('0x2d')](_0x1d75e);});})[_0x7bfc('0xc')](function(_0x1ac5f9){logger[_0x7bfc('0xd')](_0x7bfc('0x1d'),_0x38eb23);if(_0x1ac5f9[_0x7bfc('0x28')]>0x0){logger[_0x7bfc('0xd')]('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x1ac5f9[0x0][_0x7bfc('0x2e')]['id'],_0x1ac5f9[0x0][_0x7bfc('0x2e')][_0x7bfc('0x2f')],_0x1ac5f9[0x0][_0x7bfc('0x2e')][_0x7bfc('0x30')]);}logger[_0x7bfc('0xf')](_0x7bfc('0x1d'),_0x38eb23,JSON[_0x7bfc('0x10')](_0x1ac5f9));_0x33e420(_0x1ac5f9);})[_0x7bfc('0x11')](function(_0x295cf1){logger[_0x7bfc('0x12')]('GetContactDialer',_0x295cf1[_0x7bfc('0x13')],_0x38eb23);_0x3604be(_0x242541[_0x7bfc('0x12')](0x1f4,_0x295cf1[_0x7bfc('0x13')]));});});});};exports['MoveContactManagedDialer']=function(_0x1f7671){var _0x1223f8=this;return new Promise(function(_0x4c2dd3,_0x1046dd){return db[_0x7bfc('0x31')][_0x7bfc('0x32')](function(_0x336450){return db[_0x7bfc('0x33')][_0x7bfc('0x18')](_0x1f7671['body'],{'raw':_0x1f7671[_0x7bfc('0x6')]?_0x1f7671[_0x7bfc('0x6')][_0x7bfc('0x7')]===undefined?!![]:![]:!![],'transaction':_0x336450})[_0x7bfc('0xc')](function(){logger[_0x7bfc('0xd')](_0x7bfc('0x34'),JSON[_0x7bfc('0x10')](_0x1f7671[_0x7bfc('0x6')][_0x7bfc('0x16')]),_0x1f7671[_0x7bfc('0x6')][_0x7bfc('0x16')]['active']);return db['CmHopper'][_0x7bfc('0x1b')]({'where':_0x1f7671[_0x7bfc('0x6')]?_0x1f7671[_0x7bfc('0x6')][_0x7bfc('0x16')]||null:null,'transaction':_0x336450});});})[_0x7bfc('0xc')](function(_0x22150a){logger[_0x7bfc('0xd')]('MoveContactManagedDialer',_0x1f7671);logger[_0x7bfc('0xf')](_0x7bfc('0x35'),_0x1f7671,JSON[_0x7bfc('0x10')](_0x22150a));_0x4c2dd3(_0x22150a);})[_0x7bfc('0x11')](function(_0x352b40){logger[_0x7bfc('0x12')](_0x7bfc('0x35'),_0x352b40[_0x7bfc('0x13')],_0x1f7671);_0x1046dd(_0x1223f8[_0x7bfc('0x12')](0x1f4,_0x352b40[_0x7bfc('0x13')]));});});};exports[_0x7bfc('0x36')]=function(_0x7f7214){var _0x326d0d=this;return new Promise(function(_0x51de78,_0x5c36b5){return db[_0x7bfc('0x5')]['findAll']({'raw':_0x7f7214[_0x7bfc('0x6')]?_0x7f7214['options'][_0x7bfc('0x7')]===undefined?!![]:![]:!![],'where':_0x7f7214[_0x7bfc('0x6')]?_0x7f7214[_0x7bfc('0x6')][_0x7bfc('0x16')]||null:null,'attributes':[[db[_0x7bfc('0x31')]['fn']('COUNT',db[_0x7bfc('0x31')]['fn']('IF',db['sequelize']['literal']('`scheduledat`\x20>=\x20'+util[_0x7bfc('0x37')](_0x7bfc('0x38'),moment()[_0x7bfc('0x37')](_0x7bfc('0x39')))+'\x20,\x201,\x20null'))),'contactsRescheduled']]})[_0x7bfc('0xc')](function(_0x2c0f07){logger[_0x7bfc('0xd')](_0x7bfc('0x36'),_0x7f7214);logger[_0x7bfc('0xf')](_0x7bfc('0x36'),_0x7f7214,JSON[_0x7bfc('0x10')](_0x2c0f07));_0x51de78(_0x2c0f07);})['catch'](function(_0x115419){logger['error']('CountReScheduled',_0x115419[_0x7bfc('0x13')],_0x7f7214);_0x5c36b5(_0x326d0d['error'](0x1f4,_0x115419['message']));});});};exports['GetContactRecallMe']=function(_0x1fef47){var _0x30fd8d=this;return new Promise(function(_0x299f91,_0x22ab69){return db[_0x7bfc('0x1e')][_0x7bfc('0x1f')]()[_0x7bfc('0xc')](function(){return db[_0x7bfc('0x31')][_0x7bfc('0x32')](function(_0x53d5d1){return db[_0x7bfc('0x5')][_0x7bfc('0x3a')]({'where':_0x1fef47[_0x7bfc('0x6')]?_0x1fef47[_0x7bfc('0x6')]['where']||null:null,'attributes':_0x1fef47['options']?_0x1fef47[_0x7bfc('0x6')][_0x7bfc('0x8')]||null:null,'limit':0x1,'order':_0x1fef47['options']?_0x1fef47['options'][_0x7bfc('0x21')]||null:null,'group':db[_0x7bfc('0x5')][_0x7bfc('0x29')],'transaction':_0x53d5d1,'lock':_0x53d5d1[_0x7bfc('0x22')][_0x7bfc('0x23')],'include':_0x1fef47[_0x7bfc('0x6')]?_0x1fef47[_0x7bfc('0x6')][_0x7bfc('0x9')]?_[_0x7bfc('0xa')](_0x1fef47[_0x7bfc('0x6')]['include'],function(_0x5082eb){return{'model':db[_0x5082eb[_0x7bfc('0xb')]],'as':_0x5082eb['as'],'attributes':_0x5082eb[_0x7bfc('0x8')],'include':_0x5082eb['include']?_['map'](_0x5082eb['include'],function(_0x7f220){return{'model':db[_0x7f220['model']],'as':_0x7f220['as'],'attributes':_0x7f220[_0x7bfc('0x8')],'include':_0x7f220[_0x7bfc('0x9')]?_[_0x7bfc('0xa')](_0x7f220[_0x7bfc('0x9')],function(_0x40ee65){return{'model':db[_0x40ee65['model']],'as':_0x40ee65['as'],'attributes':_0x40ee65[_0x7bfc('0x8')]};}):[]};}):[]};}):[]:[]})[_0x7bfc('0xc')](function(_0x492df5){var _0x2b9208=[];for(var _0x5dd969=0x0;_0x5dd969<_0x492df5[_0x7bfc('0x28')];_0x5dd969+=0x1){_0x2b9208[_0x7bfc('0x2a')](_0x492df5[_0x5dd969][_0x7bfc('0x2b')](_0x1fef47[_0x7bfc('0x19')],{'transaction':_0x53d5d1}));}return BPromise[_0x7bfc('0x2d')](_0x2b9208);});})[_0x7bfc('0xc')](function(_0x5feb9f){logger['info'](_0x7bfc('0x3b'),_0x1fef47);logger[_0x7bfc('0xf')]('GetContactRecallMe',_0x1fef47,JSON[_0x7bfc('0x10')](_0x5feb9f));_0x299f91(_0x5feb9f);})['catch'](function(_0x2dac54){logger['error'](_0x7bfc('0x3b'),_0x2dac54[_0x7bfc('0x13')],_0x1fef47);_0x22ab69(_0x30fd8d[_0x7bfc('0x12')](0x1f4,_0x2dac54[_0x7bfc('0x13')]));});});});};exports['GetCmHopperPreview']=function(_0x3ab417){var _0xb2282c=this;return new Promise(function(_0x5b1a91,_0x2aed27){db[_0x7bfc('0x1e')][_0x7bfc('0x1f')]()[_0x7bfc('0xc')](function(_0x2f2529){return db[_0x7bfc('0x5')]['findAll']({'raw':_0x3ab417['options']?_0x3ab417[_0x7bfc('0x6')][_0x7bfc('0x7')]===undefined?!![]:![]:!![],'where':_0x3ab417['options']?_0x3ab417[_0x7bfc('0x6')][_0x7bfc('0x16')]||null:null,'attributes':_0x3ab417['options']?_0x3ab417[_0x7bfc('0x6')][_0x7bfc('0x8')]||null:null,'limit':_0x3ab417[_0x7bfc('0x6')]?_0x3ab417[_0x7bfc('0x6')][_0x7bfc('0x20')]||null:null,'include':_0x3ab417[_0x7bfc('0x6')]?_0x3ab417[_0x7bfc('0x6')][_0x7bfc('0x9')]?_[_0x7bfc('0xa')](_0x3ab417[_0x7bfc('0x6')][_0x7bfc('0x9')],function(_0x32f7a9){return{'model':db[_0x32f7a9['model']],'as':_0x32f7a9['as'],'attributes':_0x32f7a9['as']==='Contact'?_['keys'](_0x2f2529):_0x32f7a9[_0x7bfc('0x8')],'include':_0x32f7a9[_0x7bfc('0x9')]?_[_0x7bfc('0xa')](_0x32f7a9['include'],function(_0x3ea452){return{'model':db[_0x3ea452[_0x7bfc('0xb')]],'as':_0x3ea452['as'],'attributes':_0x3ea452[_0x7bfc('0x8')],'include':_0x3ea452[_0x7bfc('0x9')]?_['map'](_0x3ea452['include'],function(_0x275a69){return{'model':db[_0x275a69[_0x7bfc('0xb')]],'as':_0x275a69['as'],'attributes':_0x275a69['attributes']};}):[]};}):[]};}):[]:[]})[_0x7bfc('0xc')](function(_0x87dad9){logger[_0x7bfc('0xd')]('GetCmHopper',_0x3ab417);logger[_0x7bfc('0xf')](_0x7bfc('0xe'),_0x3ab417,JSON['stringify'](_0x87dad9));_0x5b1a91(_0x87dad9);})['catch'](function(_0x371f3c){logger['error'](_0x7bfc('0xe'),_0x371f3c['message'],_0x3ab417);_0x2aed27(_0xb2282c[_0x7bfc('0x12')](0x1f4,_0x371f3c[_0x7bfc('0x13')]));});});});};exports[_0x7bfc('0x3c')]=function(_0x5ea69d){var _0x22098f=this;return new Promise(function(_0x4c9581,_0x28ee62){return db[_0x7bfc('0x1e')][_0x7bfc('0x3d')]({'raw':!![],'where':{'phone':_0x5ea69d[_0x7bfc('0x6')][_0x7bfc('0x16')]['phone']},'attributes':['id',_0x7bfc('0x3e')],'order':[['id',_0x7bfc('0x3f')]]})[_0x7bfc('0xc')](function(_0xf850a0){logger['info']('getContactByPhone',_0x5ea69d);logger['debug'](_0x7bfc('0x40'),_0x5ea69d,JSON[_0x7bfc('0x10')](_0xf850a0));_0x4c9581(_0xf850a0);})[_0x7bfc('0x11')](function(_0x40d0e3){logger[_0x7bfc('0x12')](_0x7bfc('0x40'),_0x40d0e3[_0x7bfc('0x13')],_0x5ea69d);_0x28ee62(_0x22098f[_0x7bfc('0x12')](0x1f4,_0x40d0e3[_0x7bfc('0x13')]));});});};exports[_0x7bfc('0x41')]=function(_0xcf498f){var _0x1fd793=this;return new Promise(function(_0x28f2b2,_0x3404a4){return db[_0x7bfc('0x31')][_0x7bfc('0x32')](function(_0x487e2b){var _0x55ed42=_0xcf498f['options']&&_0xcf498f['options'][_0x7bfc('0x16')]?_0xcf498f[_0x7bfc('0x6')][_0x7bfc('0x16')]:{};return db['CmHopper'][_0x7bfc('0x2b')](_0xcf498f[_0x7bfc('0x19')],{'where':_0x55ed42,'transaction':_0x487e2b})[_0x7bfc('0xc')](function(_0x48e564){logger[_0x7bfc('0xd')](_0x7bfc('0x41'),_0xcf498f);logger['debug'](_0x7bfc('0x41'),_0xcf498f,JSON[_0x7bfc('0x10')](_0x48e564));_0x28f2b2(_0x48e564);})[_0x7bfc('0x11')](function(_0x7fedc9){logger['error'](_0x7bfc('0x41'),_0x7fedc9[_0x7bfc('0x13')],_0xcf498f);_0x3404a4(_0x1fd793[_0x7bfc('0x12')](0x1f4,_0x7fedc9[_0x7bfc('0x13')]));});});});};exports[_0x7bfc('0x42')]=function(_0x43257b){var _0x3d6d86=this;var _0x593387=_0x43257b[_0x7bfc('0x19')][_0x7bfc('0x16')][_0x7bfc('0x43')];var _0x213a0d=_0x43257b[_0x7bfc('0x19')][_0x7bfc('0x16')][_0x7bfc('0x44')];var _0x12918e=_0x43257b['body'][_0x7bfc('0x16')][_0x7bfc('0x45')];return new Promise(function(_0x32a0a6,_0x4e2541){return db['CmHopper'][_0x7bfc('0x3a')]({'where':{'voiceQueueId':{'$in':_0x593387},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x7bfc('0x31')][_0x7bfc('0x46')]('NOW()\x20+\x20INTERVAL\x20'+_0x213a0d+_0x7bfc('0x47')),'$gt':db['sequelize'][_0x7bfc('0x46')](_0x7bfc('0x48'))}},'UserId':{'$in':_0x12918e}},'include':[{'model':db[_0x7bfc('0x1e')],'as':_0x7bfc('0x24')},{'model':db[_0x7bfc('0x49')],'as':_0x7bfc('0x25'),'attributes':['id',_0x7bfc('0x26'),_0x7bfc('0x27')]},{'model':db[_0x7bfc('0x4a')],'as':_0x7bfc('0x4b')}]})[_0x7bfc('0xc')](function(_0x59fbc3){if(_0x59fbc3[_0x7bfc('0x28')]>0x0){return db[_0x7bfc('0x31')]['transaction'](function(_0x43eca4){return db[_0x7bfc('0x5')]['update']({'recallmeNotifiedDate':db['sequelize'][_0x7bfc('0x46')](_0x7bfc('0x48'))},{'where':{'id':{'$in':_[_0x7bfc('0xa')](_0x59fbc3,'id')}},'transaction':_0x43eca4})[_0x7bfc('0xc')](function(){_0x32a0a6(_0x59fbc3);})['catch'](function(_0x24fcf5){logger[_0x7bfc('0x12')](_0x7bfc('0x42'),_0x24fcf5[_0x7bfc('0x13')],_0x43257b);_0x4e2541(_0x3d6d86[_0x7bfc('0x12')](0x1f4,_0x24fcf5[_0x7bfc('0x13')]));});})[_0x7bfc('0x11')](function(_0x434729){logger[_0x7bfc('0x12')](_0x7bfc('0x42'),_0x434729[_0x7bfc('0x13')],_0x43257b);_0x4e2541(_0x3d6d86[_0x7bfc('0x12')](0x1f4,_0x434729['message']));});}else{_0x32a0a6(_0x59fbc3);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 10553cc..12976ac 100644 --- a/server/api/cmHopper/index.js +++ b/server/api/cmHopper/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8175=['getTimezones','/:id','getPreviewRecall','post','create','/preview','getPreview','/timezone','put','update','delete','destroy','express','Router','../../components/auth/service','get','isAuthenticated','/describe','describe','/opencontacts','getOpenContacts'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x8175,0xc9));var _0x5817=function(_0x4f1651,_0xc4ac4f){_0x4f1651=_0x4f1651-0x0;var _0x44868e=_0x8175[_0x4f1651];return _0x44868e;};'use strict';var express=require(_0x5817('0x0'));var router=express[_0x5817('0x1')]();var auth=require(_0x5817('0x2'));var controller=require('./cmHopper.controller');router[_0x5817('0x3')]('/',auth[_0x5817('0x4')](),controller['index']);router[_0x5817('0x3')](_0x5817('0x5'),auth[_0x5817('0x4')](),controller[_0x5817('0x6')]);router[_0x5817('0x3')](_0x5817('0x7'),auth[_0x5817('0x4')](),controller[_0x5817('0x8')]);router[_0x5817('0x3')]('/timezones',auth[_0x5817('0x4')](),controller[_0x5817('0x9')]);router[_0x5817('0x3')](_0x5817('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x5817('0x3')]('/:id/previewrecall',auth[_0x5817('0x4')](),controller[_0x5817('0xb')]);router[_0x5817('0xc')]('/',auth[_0x5817('0x4')](),controller[_0x5817('0xd')]);router['post'](_0x5817('0xe'),auth[_0x5817('0x4')](),controller[_0x5817('0xf')]);router[_0x5817('0xc')](_0x5817('0x10'),auth[_0x5817('0x4')](),controller['getTimezone']);router[_0x5817('0x11')](_0x5817('0xa'),auth[_0x5817('0x4')](),controller[_0x5817('0x12')]);router[_0x5817('0x13')](_0x5817('0xa'),auth[_0x5817('0x4')](),controller[_0x5817('0x14')]);module['exports']=router; \ No newline at end of file +var _0x4b7d=['/timezone','put','update','delete','destroy','exports','Router','../../components/auth/service','index','get','/describe','describe','/opencontacts','isAuthenticated','getOpenContacts','/timezones','getTimezones','/:id','show','/:id/previewrecall','getPreviewRecall','post','/preview'];(function(_0x135fb0,_0x28a7a9){var _0x5db641=function(_0x3ad24e){while(--_0x3ad24e){_0x135fb0['push'](_0x135fb0['shift']());}};_0x5db641(++_0x28a7a9);}(_0x4b7d,0x103));var _0xd4b7=function(_0x4fac19,_0x4eb3d9){_0x4fac19=_0x4fac19-0x0;var _0x3afdb0=_0x4b7d[_0x4fac19];return _0x3afdb0;};'use strict';var express=require('express');var router=express[_0xd4b7('0x0')]();var auth=require(_0xd4b7('0x1'));var controller=require('./cmHopper.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xd4b7('0x2')]);router[_0xd4b7('0x3')](_0xd4b7('0x4'),auth['isAuthenticated'](),controller[_0xd4b7('0x5')]);router[_0xd4b7('0x3')](_0xd4b7('0x6'),auth[_0xd4b7('0x7')](),controller[_0xd4b7('0x8')]);router[_0xd4b7('0x3')](_0xd4b7('0x9'),auth[_0xd4b7('0x7')](),controller[_0xd4b7('0xa')]);router[_0xd4b7('0x3')](_0xd4b7('0xb'),auth['isAuthenticated'](),controller[_0xd4b7('0xc')]);router[_0xd4b7('0x3')](_0xd4b7('0xd'),auth[_0xd4b7('0x7')](),controller[_0xd4b7('0xe')]);router['post']('/',auth[_0xd4b7('0x7')](),controller['create']);router[_0xd4b7('0xf')](_0xd4b7('0x10'),auth[_0xd4b7('0x7')](),controller['getPreview']);router[_0xd4b7('0xf')](_0xd4b7('0x11'),auth[_0xd4b7('0x7')](),controller['getTimezone']);router[_0xd4b7('0x12')](_0xd4b7('0xb'),auth[_0xd4b7('0x7')](),controller[_0xd4b7('0x13')]);router[_0xd4b7('0x14')](_0xd4b7('0xb'),auth[_0xd4b7('0x7')](),controller[_0xd4b7('0x15')]);module[_0xd4b7('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index c9c03fa..e6f3ad6 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x56a9=['YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','exports','INTEGER','STRING','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x56a9,0x6a));var _0x956a=function(_0x22b39b,_0x2b7d63){_0x22b39b=_0x22b39b-0x0;var _0x280e1d=_0x56a9[_0x22b39b];return _0x280e1d;};'use strict';var moment=require(_0x956a('0x0'));var Sequelize=require(_0x956a('0x1'));module[_0x956a('0x2')]={'CmHopperId':{'type':Sequelize[_0x956a('0x3')]},'phone':{'type':Sequelize[_0x956a('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x956a('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x956a('0x5')],'defaultValue':moment()['format'](_0x956a('0x6'))},'countbusyretry':{'type':Sequelize[_0x956a('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x956a('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x956a('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x956a('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x956a('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x956a('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x956a('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x956a('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe986=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment','exports','INTEGER'];(function(_0x2ef8f1,_0x1280a3){var _0x17498d=function(_0xd20876){while(--_0xd20876){_0x2ef8f1['push'](_0x2ef8f1['shift']());}};_0x17498d(++_0x1280a3);}(_0xe986,0xf3));var _0x6e98=function(_0x105e5f,_0x32f2a0){_0x105e5f=_0x105e5f-0x0;var _0x1165d5=_0xe986[_0x105e5f];return _0x1165d5;};'use strict';var moment=require(_0x6e98('0x0'));var Sequelize=require('sequelize');module[_0x6e98('0x1')]={'CmHopperId':{'type':Sequelize[_0x6e98('0x2')]},'phone':{'type':Sequelize['STRING'],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x6e98('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x6e98('0x3')],'defaultValue':moment()[_0x6e98('0x4')](_0x6e98('0x5'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x6e98('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x6e98('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x6e98('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6e98('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index 05578a4..bc81e30 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb0cb=['VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','get','CmHopperAdditionalPhones','error','stack','name','send','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xb0cb,0x170));var _0xbb0c=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xb0cb[_0x209941];return _0x1e8729;};'use strict';var emlformat=require(_0xbb0c('0x0'));var rimraf=require(_0xbb0c('0x1'));var zipdir=require(_0xbb0c('0x2'));var jsonpatch=require(_0xbb0c('0x3'));var rp=require('request-promise');var moment=require(_0xbb0c('0x4'));var BPromise=require(_0xbb0c('0x5'));var Mustache=require(_0xbb0c('0x6'));var util=require(_0xbb0c('0x7'));var path=require(_0xbb0c('0x8'));var sox=require(_0xbb0c('0x9'));var csv=require(_0xbb0c('0xa'));var ejs=require(_0xbb0c('0xb'));var fs=require('fs');var fs_extra=require(_0xbb0c('0xc'));var _=require('lodash');var squel=require(_0xbb0c('0xd'));var crypto=require('crypto');var jsforce=require(_0xbb0c('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbb0c('0xf'));var Papa=require(_0xbb0c('0x10'));var Redis=require(_0xbb0c('0x11'));var authService=require(_0xbb0c('0x12'));var qs=require(_0xbb0c('0x13'));var as=require(_0xbb0c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbb0c('0x15'))(_0xbb0c('0x16'));var utils=require('../../config/utils');var config=require(_0xbb0c('0x17'));var licenseUtil=require(_0xbb0c('0x18'));var db=require(_0xbb0c('0x19'))['db'];function respondWithStatusCode(_0x4c1482,_0x1369c5){_0x1369c5=_0x1369c5||0xcc;return function(_0x1c494d){if(_0x1c494d){return _0x4c1482[_0xbb0c('0x1a')](_0x1369c5);}return _0x4c1482[_0xbb0c('0x1b')](_0x1369c5)[_0xbb0c('0x1c')]();};}function respondWithResult(_0x4ecb10,_0x37aea0){_0x37aea0=_0x37aea0||0xc8;return function(_0x17ac0f){if(_0x17ac0f){return _0x4ecb10[_0xbb0c('0x1b')](_0x37aea0)[_0xbb0c('0x1d')](_0x17ac0f);}};}function respondWithFilteredResult(_0x5c882b,_0x5af34a){return function(_0x439bc8){if(_0x439bc8){var _0x2c2412=typeof _0x5af34a[_0xbb0c('0x1e')]===_0xbb0c('0x1f')&&typeof _0x5af34a[_0xbb0c('0x20')]===_0xbb0c('0x1f');var _0x322f81=_0x439bc8[_0xbb0c('0x21')];var _0x4cf770=_0x2c2412?0x0:_0x5af34a[_0xbb0c('0x1e')];var _0x489eea=_0x2c2412?_0x439bc8[_0xbb0c('0x21')]:_0x5af34a[_0xbb0c('0x1e')]+_0x5af34a[_0xbb0c('0x20')];var _0x484554;if(_0x489eea>=_0x322f81){_0x489eea=_0x322f81;_0x484554=0xc8;}else{_0x484554=0xce;}_0x5c882b[_0xbb0c('0x1b')](_0x484554);return _0x5c882b['set'](_0xbb0c('0x22'),_0x4cf770+'-'+_0x489eea+'/'+_0x322f81)['json'](_0x439bc8);}return null;};}function patchUpdates(_0x5512a2){return function(_0x9346c2){try{jsonpatch['apply'](_0x9346c2,_0x5512a2,!![]);}catch(_0x56dd18){return BPromise[_0xbb0c('0x23')](_0x56dd18);}return _0x9346c2[_0xbb0c('0x24')]();};}function saveUpdates(_0x580ed9,_0x269baf){return function(_0x3ea245){if(_0x3ea245){return _0x3ea245[_0xbb0c('0x25')](_0x580ed9)[_0xbb0c('0x26')](function(_0x42cdc3){return _0x42cdc3;});}return null;};}function removeEntity(_0x258c7e,_0x56eade){return function(_0x2bbbe0){if(_0x2bbbe0){return _0x2bbbe0[_0xbb0c('0x27')]()[_0xbb0c('0x26')](function(){var _0xa48934=_0x2bbbe0[_0xbb0c('0x28')]({'plain':!![]});var _0x3d27e5=_0xbb0c('0x29');return db['UserProfileResource'][_0xbb0c('0x27')]({'where':{'type':_0x3d27e5,'resourceId':_0xa48934['id']}})[_0xbb0c('0x26')](function(){return _0x2bbbe0;});})[_0xbb0c('0x26')](function(){_0x258c7e[_0xbb0c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5754aa,_0x56fa1f){return function(_0x49db8f){if(!_0x49db8f){_0x5754aa[_0xbb0c('0x1a')](0x194);}return _0x49db8f;};}function handleError(_0x3d67c7,_0x5c7be9){_0x5c7be9=_0x5c7be9||0x1f4;return function(_0x50d521){logger[_0xbb0c('0x2a')](_0x50d521[_0xbb0c('0x2b')]);if(_0x50d521['name']){delete _0x50d521[_0xbb0c('0x2c')];}_0x3d67c7[_0xbb0c('0x1b')](_0x5c7be9)[_0xbb0c('0x2d')](_0x50d521);};}exports[_0xbb0c('0x2e')]=function(_0x1cd573,_0x2d1149){var _0x3fbe98={},_0xe3af0={},_0x12dd51={'count':0x0,'rows':[]};var _0xf3fbc=_[_0xbb0c('0x2f')](db[_0xbb0c('0x30')][_0xbb0c('0x31')],function(_0x325cab){return{'name':_0x325cab[_0xbb0c('0x32')],'type':_0x325cab[_0xbb0c('0x33')]['key']};});_0xe3af0[_0xbb0c('0x34')]=_[_0xbb0c('0x2f')](_0xf3fbc,_0xbb0c('0x2c'));_0xe3af0[_0xbb0c('0x35')]=_['keys'](_0x1cd573['query']);_0xe3af0['filters']=_[_0xbb0c('0x36')](_0xe3af0[_0xbb0c('0x34')],_0xe3af0[_0xbb0c('0x35')]);_0x3fbe98[_0xbb0c('0x37')]=_[_0xbb0c('0x36')](_0xe3af0[_0xbb0c('0x34')],qs['fields'](_0x1cd573[_0xbb0c('0x35')][_0xbb0c('0x38')]));_0x3fbe98[_0xbb0c('0x37')]=_0x3fbe98[_0xbb0c('0x37')][_0xbb0c('0x39')]?_0x3fbe98[_0xbb0c('0x37')]:_0xe3af0['model'];if(!_0x1cd573[_0xbb0c('0x35')][_0xbb0c('0x3a')](_0xbb0c('0x3b'))){_0x3fbe98[_0xbb0c('0x20')]=qs[_0xbb0c('0x20')](_0x1cd573[_0xbb0c('0x35')][_0xbb0c('0x20')]);_0x3fbe98[_0xbb0c('0x1e')]=qs[_0xbb0c('0x1e')](_0x1cd573['query'][_0xbb0c('0x1e')]);}_0x3fbe98[_0xbb0c('0x3c')]=qs['sort'](_0x1cd573['query'][_0xbb0c('0x3d')]);_0x3fbe98[_0xbb0c('0x3e')]=qs[_0xbb0c('0x3f')](_[_0xbb0c('0x40')](_0x1cd573[_0xbb0c('0x35')],_0xe3af0[_0xbb0c('0x3f')]),_0xf3fbc);if(_0x1cd573[_0xbb0c('0x35')][_0xbb0c('0x41')]){_0x3fbe98[_0xbb0c('0x3e')]=_[_0xbb0c('0x42')](_0x3fbe98['where'],{'$or':_[_0xbb0c('0x2f')](_0xf3fbc,function(_0x33facd){if(_0x33facd[_0xbb0c('0x33')]!==_0xbb0c('0x43')){var _0x40ffdc={};_0x40ffdc[_0x33facd[_0xbb0c('0x2c')]]={'$like':'%'+_0x1cd573[_0xbb0c('0x35')][_0xbb0c('0x41')]+'%'};return _0x40ffdc;}})});}_0x3fbe98=_['merge']({},_0x3fbe98,_0x1cd573[_0xbb0c('0x44')]);var _0x4df488={'where':_0x3fbe98[_0xbb0c('0x3e')]};return db['CmHopperAdditionalPhone'][_0xbb0c('0x21')](_0x4df488)['then'](function(_0x5835a9){_0x12dd51[_0xbb0c('0x21')]=_0x5835a9;if(_0x1cd573['query'][_0xbb0c('0x45')]){_0x3fbe98[_0xbb0c('0x46')]=[{'all':!![]}];}return db[_0xbb0c('0x30')][_0xbb0c('0x47')](_0x3fbe98);})['then'](function(_0xd27bf2){_0x12dd51[_0xbb0c('0x48')]=_0xd27bf2;return _0x12dd51;})[_0xbb0c('0x26')](respondWithFilteredResult(_0x2d1149,_0x3fbe98))[_0xbb0c('0x49')](handleError(_0x2d1149,null));};exports[_0xbb0c('0x4a')]=function(_0x43d4e4,_0x5e0311){var _0x165062={'raw':!![],'where':{'id':_0x43d4e4[_0xbb0c('0x4b')]['id']}},_0x1858cc={};_0x1858cc[_0xbb0c('0x34')]=_['keys'](db[_0xbb0c('0x30')]['rawAttributes']);_0x1858cc['query']=_[_0xbb0c('0x4c')](_0x43d4e4[_0xbb0c('0x35')]);_0x1858cc[_0xbb0c('0x3f')]=_[_0xbb0c('0x36')](_0x1858cc[_0xbb0c('0x34')],_0x1858cc[_0xbb0c('0x35')]);_0x165062[_0xbb0c('0x37')]=_[_0xbb0c('0x36')](_0x1858cc[_0xbb0c('0x34')],qs['fields'](_0x43d4e4[_0xbb0c('0x35')][_0xbb0c('0x38')]));_0x165062[_0xbb0c('0x37')]=_0x165062[_0xbb0c('0x37')]['length']?_0x165062['attributes']:_0x1858cc['model'];if(_0x43d4e4[_0xbb0c('0x35')]['includeAll']){_0x165062[_0xbb0c('0x46')]=[{'all':!![]}];}_0x165062=_[_0xbb0c('0x42')]({},_0x165062,_0x43d4e4[_0xbb0c('0x44')]);return db['CmHopperAdditionalPhone'][_0xbb0c('0x4d')](_0x165062)['then'](handleEntityNotFound(_0x5e0311,null))[_0xbb0c('0x26')](respondWithResult(_0x5e0311,null))[_0xbb0c('0x49')](handleError(_0x5e0311,null));};exports[_0xbb0c('0x4e')]=function(_0x5afb20,_0x3d3b07){return db[_0xbb0c('0x30')][_0xbb0c('0x4e')](_0x5afb20[_0xbb0c('0x4f')],{})['then'](function(_0x1736ef){var _0x1c0222=_0x5afb20['user'][_0xbb0c('0x28')]({'plain':!![]});if(!_0x1c0222)throw new Error(_0xbb0c('0x50'));if(_0x1c0222[_0xbb0c('0x51')]===_0xbb0c('0x52')){var _0x4ff090=_0x1736ef[_0xbb0c('0x28')]({'plain':!![]});var _0x3f5f8b='CmHopperAdditionalPhones';return db[_0xbb0c('0x53')]['find']({'where':{'name':_0x3f5f8b,'userProfileId':_0x1c0222['userProfileId']},'raw':!![]})[_0xbb0c('0x26')](function(_0x42b5c2){if(_0x42b5c2&&_0x42b5c2[_0xbb0c('0x54')]===0x0){return db[_0xbb0c('0x55')]['create']({'name':_0x4ff090[_0xbb0c('0x2c')],'resourceId':_0x4ff090['id'],'type':_0x42b5c2[_0xbb0c('0x2c')],'sectionId':_0x42b5c2['id']},{})['then'](function(){return _0x1736ef;});}else{return _0x1736ef;}})[_0xbb0c('0x49')](function(_0x916a83){logger[_0xbb0c('0x2a')](_0xbb0c('0x56'),_0x916a83);throw _0x916a83;});}return _0x1736ef;})['then'](respondWithResult(_0x3d3b07,0xc9))[_0xbb0c('0x49')](handleError(_0x3d3b07,null));};exports[_0xbb0c('0x25')]=function(_0x37ce1b,_0x28da32){if(_0x37ce1b['body']['id']){delete _0x37ce1b[_0xbb0c('0x4f')]['id'];}return db[_0xbb0c('0x30')]['find']({'where':{'id':_0x37ce1b[_0xbb0c('0x4b')]['id']}})[_0xbb0c('0x26')](handleEntityNotFound(_0x28da32,null))[_0xbb0c('0x26')](saveUpdates(_0x37ce1b[_0xbb0c('0x4f')],null))[_0xbb0c('0x26')](respondWithResult(_0x28da32,null))['catch'](handleError(_0x28da32,null));};exports[_0xbb0c('0x27')]=function(_0x1b9218,_0x261182){return db[_0xbb0c('0x30')][_0xbb0c('0x4d')]({'where':{'id':_0x1b9218[_0xbb0c('0x4b')]['id']}})['then'](handleEntityNotFound(_0x261182,null))[_0xbb0c('0x26')](removeEntity(_0x261182,null))[_0xbb0c('0x49')](handleError(_0x261182,null));}; \ No newline at end of file +var _0x999d=['undefined','limit','count','set','reject','update','then','get','CmHopperAdditionalPhones','UserProfileResource','destroy','end','sendStatus','error','name','send','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','includeAll','find','create','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','request-promise','bluebird','util','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset'];(function(_0x189305,_0x46c43f){var _0xea3406=function(_0x2aa435){while(--_0x2aa435){_0x189305['push'](_0x189305['shift']());}};_0xea3406(++_0x46c43f);}(_0x999d,0x11d));var _0xd999=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x999d[_0xdea41a];return _0x15d0d8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd999('0x0'));var zipdir=require(_0xd999('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd999('0x2'));var moment=require('moment');var BPromise=require(_0xd999('0x3'));var Mustache=require('mustache');var util=require(_0xd999('0x4'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd999('0x5'));var fs=require('fs');var fs_extra=require(_0xd999('0x6'));var _=require(_0xd999('0x7'));var squel=require(_0xd999('0x8'));var crypto=require(_0xd999('0x9'));var jsforce=require(_0xd999('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xd999('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd999('0xc'));var qs=require(_0xd999('0xd'));var as=require(_0xd999('0xe'));var hardwareService=require(_0xd999('0xf'));var logger=require(_0xd999('0x10'))(_0xd999('0x11'));var utils=require('../../config/utils');var config=require(_0xd999('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xd999('0x13'))['db'];function respondWithStatusCode(_0x54f4d7,_0x2477d9){_0x2477d9=_0x2477d9||0xcc;return function(_0x30a22c){if(_0x30a22c){return _0x54f4d7['sendStatus'](_0x2477d9);}return _0x54f4d7['status'](_0x2477d9)['end']();};}function respondWithResult(_0x34ca9b,_0x570b27){_0x570b27=_0x570b27||0xc8;return function(_0x2074b4){if(_0x2074b4){return _0x34ca9b[_0xd999('0x14')](_0x570b27)[_0xd999('0x15')](_0x2074b4);}};}function respondWithFilteredResult(_0x5b92f9,_0x4b3f5d){return function(_0x11af13){if(_0x11af13){var _0xee8c5a=typeof _0x4b3f5d[_0xd999('0x16')]===_0xd999('0x17')&&typeof _0x4b3f5d[_0xd999('0x18')]===_0xd999('0x17');var _0x4e8bfa=_0x11af13[_0xd999('0x19')];var _0x3b2b25=_0xee8c5a?0x0:_0x4b3f5d[_0xd999('0x16')];var _0x11ef1e=_0xee8c5a?_0x11af13['count']:_0x4b3f5d[_0xd999('0x16')]+_0x4b3f5d['limit'];var _0x3c04e4;if(_0x11ef1e>=_0x4e8bfa){_0x11ef1e=_0x4e8bfa;_0x3c04e4=0xc8;}else{_0x3c04e4=0xce;}_0x5b92f9['status'](_0x3c04e4);return _0x5b92f9[_0xd999('0x1a')]('Content-Range',_0x3b2b25+'-'+_0x11ef1e+'/'+_0x4e8bfa)[_0xd999('0x15')](_0x11af13);}return null;};}function patchUpdates(_0x3d6a9f){return function(_0x1056f3){try{jsonpatch['apply'](_0x1056f3,_0x3d6a9f,!![]);}catch(_0x259ef3){return BPromise[_0xd999('0x1b')](_0x259ef3);}return _0x1056f3['save']();};}function saveUpdates(_0x49fc6b,_0x29b302){return function(_0x402eee){if(_0x402eee){return _0x402eee[_0xd999('0x1c')](_0x49fc6b)['then'](function(_0x347b53){return _0x347b53;});}return null;};}function removeEntity(_0x2e2f3f,_0x4502db){return function(_0x4cfe68){if(_0x4cfe68){return _0x4cfe68['destroy']()[_0xd999('0x1d')](function(){var _0xa820c4=_0x4cfe68[_0xd999('0x1e')]({'plain':!![]});var _0x1016b9=_0xd999('0x1f');return db[_0xd999('0x20')][_0xd999('0x21')]({'where':{'type':_0x1016b9,'resourceId':_0xa820c4['id']}})[_0xd999('0x1d')](function(){return _0x4cfe68;});})[_0xd999('0x1d')](function(){_0x2e2f3f[_0xd999('0x14')](0xcc)[_0xd999('0x22')]();});}};}function handleEntityNotFound(_0x3db78e,_0x505e4e){return function(_0x44b9d7){if(!_0x44b9d7){_0x3db78e[_0xd999('0x23')](0x194);}return _0x44b9d7;};}function handleError(_0x92e416,_0x58316c){_0x58316c=_0x58316c||0x1f4;return function(_0xed9bc){logger[_0xd999('0x24')](_0xed9bc['stack']);if(_0xed9bc['name']){delete _0xed9bc[_0xd999('0x25')];}_0x92e416[_0xd999('0x14')](_0x58316c)[_0xd999('0x26')](_0xed9bc);};}exports['index']=function(_0x51edf0,_0x255fe4){var _0x7c1af={},_0x7a5a43={},_0xad015b={'count':0x0,'rows':[]};var _0x519e01=_[_0xd999('0x27')](db[_0xd999('0x28')][_0xd999('0x29')],function(_0x2bd917){return{'name':_0x2bd917[_0xd999('0x2a')],'type':_0x2bd917[_0xd999('0x2b')][_0xd999('0x2c')]};});_0x7a5a43[_0xd999('0x2d')]=_[_0xd999('0x27')](_0x519e01,_0xd999('0x25'));_0x7a5a43['query']=_[_0xd999('0x2e')](_0x51edf0['query']);_0x7a5a43[_0xd999('0x2f')]=_[_0xd999('0x30')](_0x7a5a43['model'],_0x7a5a43[_0xd999('0x31')]);_0x7c1af[_0xd999('0x32')]=_[_0xd999('0x30')](_0x7a5a43[_0xd999('0x2d')],qs[_0xd999('0x33')](_0x51edf0[_0xd999('0x31')][_0xd999('0x33')]));_0x7c1af['attributes']=_0x7c1af[_0xd999('0x32')][_0xd999('0x34')]?_0x7c1af['attributes']:_0x7a5a43[_0xd999('0x2d')];if(!_0x51edf0[_0xd999('0x31')][_0xd999('0x35')](_0xd999('0x36'))){_0x7c1af[_0xd999('0x18')]=qs['limit'](_0x51edf0[_0xd999('0x31')][_0xd999('0x18')]);_0x7c1af[_0xd999('0x16')]=qs[_0xd999('0x16')](_0x51edf0[_0xd999('0x31')][_0xd999('0x16')]);}_0x7c1af['order']=qs['sort'](_0x51edf0[_0xd999('0x31')][_0xd999('0x37')]);_0x7c1af[_0xd999('0x38')]=qs[_0xd999('0x2f')](_[_0xd999('0x39')](_0x51edf0[_0xd999('0x31')],_0x7a5a43['filters']),_0x519e01);if(_0x51edf0[_0xd999('0x31')]['filter']){_0x7c1af[_0xd999('0x38')]=_[_0xd999('0x3a')](_0x7c1af[_0xd999('0x38')],{'$or':_[_0xd999('0x27')](_0x519e01,function(_0xcd4f86){if(_0xcd4f86[_0xd999('0x2b')]!==_0xd999('0x3b')){var _0x400cf3={};_0x400cf3[_0xcd4f86[_0xd999('0x25')]]={'$like':'%'+_0x51edf0[_0xd999('0x31')][_0xd999('0x3c')]+'%'};return _0x400cf3;}})});}_0x7c1af=_[_0xd999('0x3a')]({},_0x7c1af,_0x51edf0[_0xd999('0x3d')]);var _0x423f20={'where':_0x7c1af[_0xd999('0x38')]};return db[_0xd999('0x28')][_0xd999('0x19')](_0x423f20)[_0xd999('0x1d')](function(_0x455541){_0xad015b[_0xd999('0x19')]=_0x455541;if(_0x51edf0[_0xd999('0x31')]['includeAll']){_0x7c1af[_0xd999('0x3e')]=[{'all':!![]}];}return db[_0xd999('0x28')][_0xd999('0x3f')](_0x7c1af);})[_0xd999('0x1d')](function(_0x3b6eda){_0xad015b[_0xd999('0x40')]=_0x3b6eda;return _0xad015b;})['then'](respondWithFilteredResult(_0x255fe4,_0x7c1af))[_0xd999('0x41')](handleError(_0x255fe4,null));};exports[_0xd999('0x42')]=function(_0x32785b,_0x357d4e){var _0x5d92fb={'raw':!![],'where':{'id':_0x32785b[_0xd999('0x43')]['id']}},_0x33cf8e={};_0x33cf8e[_0xd999('0x2d')]=_[_0xd999('0x2e')](db['CmHopperAdditionalPhone'][_0xd999('0x29')]);_0x33cf8e[_0xd999('0x31')]=_['keys'](_0x32785b['query']);_0x33cf8e[_0xd999('0x2f')]=_['intersection'](_0x33cf8e[_0xd999('0x2d')],_0x33cf8e['query']);_0x5d92fb[_0xd999('0x32')]=_[_0xd999('0x30')](_0x33cf8e['model'],qs[_0xd999('0x33')](_0x32785b['query'][_0xd999('0x33')]));_0x5d92fb[_0xd999('0x32')]=_0x5d92fb[_0xd999('0x32')][_0xd999('0x34')]?_0x5d92fb['attributes']:_0x33cf8e[_0xd999('0x2d')];if(_0x32785b['query'][_0xd999('0x44')]){_0x5d92fb[_0xd999('0x3e')]=[{'all':!![]}];}_0x5d92fb=_['merge']({},_0x5d92fb,_0x32785b[_0xd999('0x3d')]);return db[_0xd999('0x28')][_0xd999('0x45')](_0x5d92fb)[_0xd999('0x1d')](handleEntityNotFound(_0x357d4e,null))[_0xd999('0x1d')](respondWithResult(_0x357d4e,null))[_0xd999('0x41')](handleError(_0x357d4e,null));};exports[_0xd999('0x46')]=function(_0xf778f0,_0x269e72){return db[_0xd999('0x28')]['create'](_0xf778f0['body'],{})['then'](function(_0x38011f){var _0x39beee=_0xf778f0['user']['get']({'plain':!![]});if(!_0x39beee)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x39beee[_0xd999('0x47')]===_0xd999('0x48')){var _0x369579=_0x38011f[_0xd999('0x1e')]({'plain':!![]});var _0x3d4557='CmHopperAdditionalPhones';return db[_0xd999('0x49')][_0xd999('0x45')]({'where':{'name':_0x3d4557,'userProfileId':_0x39beee['userProfileId']},'raw':!![]})[_0xd999('0x1d')](function(_0x2c76a3){if(_0x2c76a3&&_0x2c76a3[_0xd999('0x4a')]===0x0){return db[_0xd999('0x20')]['create']({'name':_0x369579['name'],'resourceId':_0x369579['id'],'type':_0x2c76a3[_0xd999('0x25')],'sectionId':_0x2c76a3['id']},{})['then'](function(){return _0x38011f;});}else{return _0x38011f;}})[_0xd999('0x41')](function(_0x9e3a89){logger[_0xd999('0x24')](_0xd999('0x4b'),_0x9e3a89);throw _0x9e3a89;});}return _0x38011f;})[_0xd999('0x1d')](respondWithResult(_0x269e72,0xc9))[_0xd999('0x41')](handleError(_0x269e72,null));};exports[_0xd999('0x1c')]=function(_0x3ae34f,_0x24c9d1){if(_0x3ae34f[_0xd999('0x4c')]['id']){delete _0x3ae34f[_0xd999('0x4c')]['id'];}return db['CmHopperAdditionalPhone']['find']({'where':{'id':_0x3ae34f[_0xd999('0x43')]['id']}})[_0xd999('0x1d')](handleEntityNotFound(_0x24c9d1,null))[_0xd999('0x1d')](saveUpdates(_0x3ae34f[_0xd999('0x4c')],null))[_0xd999('0x1d')](respondWithResult(_0x24c9d1,null))[_0xd999('0x41')](handleError(_0x24c9d1,null));};exports['destroy']=function(_0x326a25,_0x5b7bf7){return db[_0xd999('0x28')][_0xd999('0x45')]({'where':{'id':_0x326a25['params']['id']}})[_0xd999('0x1d')](handleEntityNotFound(_0x5b7bf7,null))['then'](removeEntity(_0x5b7bf7,null))['catch'](handleError(_0x5b7bf7,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 3159ab3..a082163 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2e35=['bluebird','request-promise','path','../../config/environment','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','../../config/logger','moment'];(function(_0x36cb47,_0xb4dbe){var _0x3ea2b7=function(_0x20a626){while(--_0x20a626){_0x36cb47['push'](_0x36cb47['shift']());}};_0x3ea2b7(++_0xb4dbe);}(_0x2e35,0x101));var _0x52e3=function(_0x350ad8,_0x4c5ff3){_0x350ad8=_0x350ad8-0x0;var _0x308b44=_0x2e35[_0x350ad8];return _0x308b44;};'use strict';var _=require(_0x52e3('0x0'));var util=require('util');var logger=require(_0x52e3('0x1'))('api');var moment=require(_0x52e3('0x2'));var BPromise=require(_0x52e3('0x3'));var rp=require(_0x52e3('0x4'));var fs=require('fs');var path=require(_0x52e3('0x5'));var rimraf=require('rimraf');var config=require(_0x52e3('0x6'));var attributes=require('./cmHopperAdditionalPhone.attributes');module['exports']=function(_0x583d54,_0x8477a3){return _0x583d54[_0x52e3('0x7')](_0x52e3('0x8'),attributes,{'tableName':_0x52e3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3d32=['path','rimraf','../../config/environment','define','lodash','request-promise'];(function(_0x52a6e3,_0x4a73b4){var _0x8910d0=function(_0x57e5ef){while(--_0x57e5ef){_0x52a6e3['push'](_0x52a6e3['shift']());}};_0x8910d0(++_0x4a73b4);}(_0x3d32,0x13c));var _0x23d3=function(_0x2fc59b,_0x379706){_0x2fc59b=_0x2fc59b-0x0;var _0x113fe2=_0x3d32[_0x2fc59b];return _0x113fe2;};'use strict';var _=require(_0x23d3('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x23d3('0x1'));var fs=require('fs');var path=require(_0x23d3('0x2'));var rimraf=require(_0x23d3('0x3'));var config=require(_0x23d3('0x4'));var attributes=require('./cmHopperAdditionalPhone.attributes');module['exports']=function(_0x40e1c4,_0x5ae258){return _0x40e1c4[_0x23d3('0x5')]('CmHopperAdditionalPhone',attributes,{'tableName':'cm_hopper_additional_phones','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js index 5ebc2fb..85ac03b 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8c39=['VerifyAdditionalPhones','CmHopper','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','countcongestionretry','SwapAdditionalPhones','duration','waitTime','isNil','scheduledat','add','minutes','phone','createdAt','updatedAt','sequelize','activateAdditionalPhone','IncrementPreviewCounters','update','field','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x60e43,_0x5011d7){var _0x5d270d=function(_0x4a176c){while(--_0x4a176c){_0x60e43['push'](_0x60e43['shift']());}};_0x5d270d(++_0x5011d7);}(_0x8c39,0x1f3));var _0x98c3=function(_0xb5d06f,_0x2b4284){_0xb5d06f=_0xb5d06f-0x0;var _0x2f9559=_0x8c39[_0xb5d06f];return _0x2f9559;};'use strict';var _=require(_0x98c3('0x0'));var util=require(_0x98c3('0x1'));var moment=require(_0x98c3('0x2'));var BPromise=require(_0x98c3('0x3'));var rs=require(_0x98c3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x98c3('0x5'))['db'];var utils=require(_0x98c3('0x6'));var logger=require('../../config/logger')(_0x98c3('0x7'));var config=require(_0x98c3('0x8'));var jayson=require(_0x98c3('0x9'));var client=jayson[_0x98c3('0xa')][_0x98c3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xccf19,_0x1d7add,_0x536bd3){return new BPromise(function(_0x5fd326,_0x2c2e7e){return client[_0x98c3('0xc')](_0xccf19,_0x536bd3)[_0x98c3('0xd')](function(_0x17e4dc){logger[_0x98c3('0xe')](_0x98c3('0xf'),_0x1d7add,_0x98c3('0x10'));logger['debug'](_0x98c3('0x11'),_0x1d7add,'request\x20sent',JSON[_0x98c3('0x12')](_0x17e4dc));if(_0x17e4dc['error']){if(_0x17e4dc[_0x98c3('0x13')][_0x98c3('0x14')]===0x1f4){logger[_0x98c3('0x13')](_0x98c3('0xf'),_0x1d7add,_0x17e4dc[_0x98c3('0x13')][_0x98c3('0x15')]);return _0x2c2e7e(_0x17e4dc[_0x98c3('0x13')][_0x98c3('0x15')]);}logger['error'](_0x98c3('0xf'),_0x1d7add,_0x17e4dc[_0x98c3('0x13')][_0x98c3('0x15')]);return _0x5fd326(_0x17e4dc[_0x98c3('0x13')][_0x98c3('0x15')]);}else{logger[_0x98c3('0xe')](_0x98c3('0xf'),_0x1d7add,_0x98c3('0x10'));_0x5fd326(_0x17e4dc['result'][_0x98c3('0x15')]);}})[_0x98c3('0x16')](function(_0x6c7e0e){logger[_0x98c3('0x13')](_0x98c3('0xf'),_0x1d7add,_0x6c7e0e);_0x2c2e7e(_0x6c7e0e);});});}exports[_0x98c3('0x17')]=function(_0x76e150){var _0x4dfa21=this;return new Promise(function(_0x273e0f,_0x35116a){return db[_0x98c3('0x18')][_0x98c3('0x19')]({'raw':!![],'where':{'ContactId':_0x76e150[_0x98c3('0x1a')][_0x98c3('0x1b')],'ListId':_0x76e150['body'][_0x98c3('0x1c')],'VoiceQueueId':_0x76e150[_0x98c3('0x1a')][_0x98c3('0x1d')]===undefined?null:_0x76e150[_0x98c3('0x1a')]['VoiceQueueId'],'CampaignId':_0x76e150[_0x98c3('0x1a')][_0x98c3('0x1e')]===undefined?null:_0x76e150['body'][_0x98c3('0x1e')]}})[_0x98c3('0xd')](function(_0xc2cf4f){if(_0xc2cf4f!=null){return db[_0x98c3('0x1f')][_0x98c3('0x19')]({'raw':!![],'where':{'CmHopperId':_0xc2cf4f['id'],'OrderBy':{'$gt':_0xc2cf4f[_0x98c3('0x20')]}},'order':[['OrderBy',_0x98c3('0x21')]]})['then'](function(_0x18ce56){var _0x5b1e2d=0x0;if(_0x18ce56){if(_0x18ce56[_0x98c3('0x22')]+_0x18ce56['countcongestionretry']+_0x18ce56[_0x98c3('0x23')]+_0x18ce56[_0x98c3('0x24')]+_0x18ce56[_0x98c3('0x25')]+_0x18ce56[_0x98c3('0x26')]+_0x18ce56[_0x98c3('0x27')]+_0x18ce56[_0x98c3('0x28')]<_0x76e150['entity'][_0x98c3('0x29')])_0x5b1e2d=0x1;_0x273e0f({'additional':_0x5b1e2d});}else{return db[_0x98c3('0x1f')][_0x98c3('0x19')]({'raw':!![],'where':{'CmHopperId':_0xc2cf4f['id']},'order':[[_0x98c3('0x20'),_0x98c3('0x21')]]})[_0x98c3('0xd')](function(_0x332b2b){var _0x32455d=0x0;if(_0x332b2b){if(_0x332b2b[_0x98c3('0x22')]+_0x332b2b[_0x98c3('0x2a')]+_0x332b2b[_0x98c3('0x23')]+_0x332b2b[_0x98c3('0x24')]+_0x332b2b['countdropretry']+_0x332b2b[_0x98c3('0x26')]+_0x332b2b[_0x98c3('0x27')]+_0x332b2b[_0x98c3('0x28')]<_0x76e150['entity'][_0x98c3('0x29')])_0x32455d=0x1;_0x273e0f({'additional':_0x32455d});}else{_0x273e0f({'additional':0x0});}})[_0x98c3('0x16')](function(_0x284adc){logger['error'](_0x98c3('0x17'),_0x284adc[_0x98c3('0x15')]);_0x35116a(_0x4dfa21['error'](0x1f4,_0x284adc[_0x98c3('0x15')]));});}})[_0x98c3('0x16')](function(_0x836606){logger[_0x98c3('0x13')]('VerifyAdditionalPhones',_0x836606['message']);_0x35116a(_0x4dfa21[_0x98c3('0x13')](0x1f4,_0x836606[_0x98c3('0x15')]));});}else _0x273e0f({'additional':0x0});});});};exports[_0x98c3('0x2b')]=function(_0x321551){var _0x3683b4=this;return new Promise(function(_0x477577,_0x4190b8){return db[_0x98c3('0x18')][_0x98c3('0x19')]({'raw':!![],'where':{'ContactId':_0x321551['body'][_0x98c3('0x1b')],'ListId':_0x321551[_0x98c3('0x1a')][_0x98c3('0x1c')],'VoiceQueueId':_0x321551['body'][_0x98c3('0x1d')]===undefined?null:_0x321551['body'][_0x98c3('0x1d')],'CampaignId':_0x321551[_0x98c3('0x1a')][_0x98c3('0x1e')]===undefined?null:_0x321551[_0x98c3('0x1a')][_0x98c3('0x1e')]}})[_0x98c3('0xd')](function(_0x1c8abb){if(_0x1c8abb!=null){return db[_0x98c3('0x1f')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x1c8abb['id'],'OrderBy':{'$gte':_0x1c8abb[_0x98c3('0x20')]}},'order':[[_0x98c3('0x20'),_0x98c3('0x21')]]})['then'](function(_0x3cdecb){if(_0x3cdecb)return activateAdditionalPhone(_0x1c8abb,_0x321551['body'],_0x3cdecb,_0x321551[_0x98c3('0x2c')],_0x321551[_0x98c3('0x2d')])[_0x98c3('0xd')](function(_0x195ad8){_0x477577(_0x195ad8);});else{return db[_0x98c3('0x1f')][_0x98c3('0x19')]({'raw':!![],'where':{'CmHopperId':_0x1c8abb['id']},'order':[[_0x98c3('0x20'),_0x98c3('0x21')]]})[_0x98c3('0xd')](function(_0x4c2619){if(_0x4c2619)return activateAdditionalPhone(_0x1c8abb,_0x321551[_0x98c3('0x1a')],_0x4c2619,_0x321551[_0x98c3('0x2c')],_0x321551['waitTime'])[_0x98c3('0xd')](function(_0x1ba9fc){_0x477577(_0x1ba9fc);});else{_0x477577({'id':_0x1c8abb['id'],'phone':''});}})['catch'](function(_0x55bfaa){logger[_0x98c3('0x13')](_0x98c3('0x17'),_0x55bfaa['message']);_0x4190b8(_0x3683b4[_0x98c3('0x13')](0x1f4,_0x55bfaa[_0x98c3('0x15')]));});}})[_0x98c3('0x16')](function(_0x3d4b6e){logger[_0x98c3('0x13')]('VerifyAdditionalPhones',_0x3d4b6e[_0x98c3('0x15')]);_0x4190b8(_0x3683b4[_0x98c3('0x13')](0x1f4,_0x3d4b6e[_0x98c3('0x15')]));});}else _0x477577(0x1);});});};function activateAdditionalPhone(_0x461b52,_0x1c692c,_0x1d2888,_0x3be967,_0x5865d6){return new Promise(function(_0x26ecc7,_0x251081){var _0x4ead14;if(_[_0x98c3('0x2e')](_0x1d2888[_0x98c3('0x2f')])){_0x1d2888[_0x98c3('0x2f')]=moment();}if(moment()>moment(_0x1d2888[_0x98c3('0x2f')])){_0x4ead14=moment()[_0x98c3('0x30')](_0x5865d6||0x3,'minutes');}else{if(_0x1d2888[_0x98c3('0x20')]==0x0){_0x4ead14=moment(_0x1d2888[_0x98c3('0x2f')]);}else{_0x4ead14=moment()[_0x98c3('0x30')](_0x5865d6||0x3,_0x98c3('0x31'));}}if(_[_0x98c3('0x2e')](_0x4ead14)){_0x4ead14=moment()[_0x98c3('0x30')](_0x5865d6||0x3,'minutes');}var _0x19a231={'phone':_0x461b52[_0x98c3('0x32')],'active':0x0,'OrderBy':_[_0x98c3('0x2e')](_0x461b52[_0x98c3('0x20')])?0x0:_0x461b52[_0x98c3('0x20')],'scheduledat':moment()[_0x98c3('0x30')](_0x3be967||0x1,'minutes'),'countbusyretry':_0x1c692c[_0x98c3('0x22')],'countcongestionretry':_0x1c692c[_0x98c3('0x2a')],'countnoanswerretry':_0x1c692c[_0x98c3('0x23')],'countnosuchnumberretry':_0x1c692c[_0x98c3('0x24')],'countdropretry':_0x1c692c[_0x98c3('0x25')],'countabandonedretry':_0x1c692c[_0x98c3('0x26')],'countmachineretry':_0x1c692c[_0x98c3('0x27')],'countagentrejectretry':_0x1c692c['countagentrejectretry'],'createdAt':_0x1c692c[_0x98c3('0x33')],'updatedAt':_0x1c692c[_0x98c3('0x34')]};var _0x588f3e={'CmHopperId':_0x461b52['id'],'phone':_0x1d2888[_0x98c3('0x32')],'active':0x0,'OrderBy':_['isNil'](_0x1d2888[_0x98c3('0x20')])?0x0:_0x1d2888[_0x98c3('0x20')],'scheduledat':_0x4ead14,'countbusyretry':_0x1d2888[_0x98c3('0x22')],'countcongestionretry':_0x1d2888[_0x98c3('0x2a')],'countnoanswerretry':_0x1d2888['countnoanswerretry'],'countnosuchnumberretry':_0x1d2888['countnosuchnumberretry'],'countdropretry':_0x1d2888[_0x98c3('0x25')],'countabandonedretry':_0x1d2888['countabandonedretry'],'countmachineretry':_0x1d2888[_0x98c3('0x27')],'countagentrejectretry':_0x1d2888['countagentrejectretry'],'createdAt':_0x1d2888[_0x98c3('0x33')],'updatedAt':_0x1d2888[_0x98c3('0x34')]};return db[_0x98c3('0x35')]['transaction'](function(_0x538130){return db[_0x98c3('0x1f')]['update'](_0x19a231,{'where':{'id':_0x1d2888['id']}},{'transaction':_0x538130})[_0x98c3('0xd')](function(){return db[_0x98c3('0x18')]['update'](_0x588f3e,{'where':{'id':_0x461b52['id']}},{'transaction':_0x538130});});})[_0x98c3('0xd')](function(_0x4469fa){_0x26ecc7({'id':_0x461b52['id'],'phone':_0x1d2888[_0x98c3('0x32')]});})[_0x98c3('0x16')](function(_0x1d8459){logger[_0x98c3('0x13')](_0x98c3('0x36'),_0x1d8459[_0x98c3('0x15')]);_0x251081({'error':_0x1d8459[_0x98c3('0x15')]});});});}exports[_0x98c3('0x37')]=function(_0x30053d){var _0x35cb6d=this;return new Promise(function(_0x634e79,_0x19242e){return db[_0x98c3('0x18')][_0x98c3('0x38')](_0x30053d[_0x98c3('0x1a')][_0x98c3('0x39')],{'where':{'id':_0x30053d['body']['id']}})[_0x98c3('0xd')](function(_0x159ebd){_0x634e79(_0x159ebd);})[_0x98c3('0x16')](function(_0x179f64){logger[_0x98c3('0x13')](_0x98c3('0x37'),_0x179f64['message']);_0x19242e(_0x35cb6d[_0x98c3('0x13')](0x1f4,_0x179f64[_0x98c3('0x15')]));});});}; \ No newline at end of file +var _0xf34d=['activateAdditionalPhone','IncrementPreviewCounters','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','VerifyAdditionalPhones','CmHopper','body','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','findOne','OrderBy','ASC','countbusyretry','countcongestionretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','countnoanswerretry','countdropretry','catch','SwapAdditionalPhones','waitTime','isNil','scheduledat','add','minutes','updatedAt','phone','createdAt','transaction','update'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0xf34d,0xaa));var _0xdf34=function(_0x3653c5,_0x9b9b25){_0x3653c5=_0x3653c5-0x0;var _0x4d8bc2=_0xf34d[_0x3653c5];return _0x4d8bc2;};'use strict';var _=require('lodash');var util=require(_0xdf34('0x0'));var moment=require(_0xdf34('0x1'));var BPromise=require(_0xdf34('0x2'));var rs=require(_0xdf34('0x3'));var fs=require('fs');var Redis=require(_0xdf34('0x4'));var db=require(_0xdf34('0x5'))['db'];var utils=require(_0xdf34('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xdf34('0x7'));var client=jayson[_0xdf34('0x8')][_0xdf34('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x143b64,_0x18fb92,_0x3cb73c){return new BPromise(function(_0x47c428,_0x47f4a1){return client[_0xdf34('0xa')](_0x143b64,_0x3cb73c)[_0xdf34('0xb')](function(_0x4aa70c){logger[_0xdf34('0xc')](_0xdf34('0xd'),_0x18fb92,_0xdf34('0xe'));logger[_0xdf34('0xf')](_0xdf34('0x10'),_0x18fb92,_0xdf34('0xe'),JSON[_0xdf34('0x11')](_0x4aa70c));if(_0x4aa70c[_0xdf34('0x12')]){if(_0x4aa70c[_0xdf34('0x12')][_0xdf34('0x13')]===0x1f4){logger[_0xdf34('0x12')](_0xdf34('0xd'),_0x18fb92,_0x4aa70c[_0xdf34('0x12')]['message']);return _0x47f4a1(_0x4aa70c[_0xdf34('0x12')][_0xdf34('0x14')]);}logger['error'](_0xdf34('0xd'),_0x18fb92,_0x4aa70c['error'][_0xdf34('0x14')]);return _0x47c428(_0x4aa70c[_0xdf34('0x12')][_0xdf34('0x14')]);}else{logger[_0xdf34('0xc')](_0xdf34('0xd'),_0x18fb92,_0xdf34('0xe'));_0x47c428(_0x4aa70c[_0xdf34('0x15')][_0xdf34('0x14')]);}})['catch'](function(_0x98f6e9){logger[_0xdf34('0x12')](_0xdf34('0xd'),_0x18fb92,_0x98f6e9);_0x47f4a1(_0x98f6e9);});});}exports[_0xdf34('0x16')]=function(_0x3b9767){var _0x3250b6=this;return new Promise(function(_0x2aee6b,_0x17647a){return db[_0xdf34('0x17')]['findOne']({'raw':!![],'where':{'ContactId':_0x3b9767[_0xdf34('0x18')]['ContactId'],'ListId':_0x3b9767[_0xdf34('0x18')][_0xdf34('0x19')],'VoiceQueueId':_0x3b9767['body'][_0xdf34('0x1a')]===undefined?null:_0x3b9767[_0xdf34('0x18')][_0xdf34('0x1a')],'CampaignId':_0x3b9767[_0xdf34('0x18')][_0xdf34('0x1b')]===undefined?null:_0x3b9767[_0xdf34('0x18')]['CampaignId']}})[_0xdf34('0xb')](function(_0x315d98){if(_0x315d98!=null){return db[_0xdf34('0x1c')][_0xdf34('0x1d')]({'raw':!![],'where':{'CmHopperId':_0x315d98['id'],'OrderBy':{'$gt':_0x315d98[_0xdf34('0x1e')]}},'order':[[_0xdf34('0x1e'),_0xdf34('0x1f')]]})[_0xdf34('0xb')](function(_0x523f42){var _0x370e9d=0x0;if(_0x523f42){if(_0x523f42[_0xdf34('0x20')]+_0x523f42[_0xdf34('0x21')]+_0x523f42['countnoanswerretry']+_0x523f42[_0xdf34('0x22')]+_0x523f42['countdropretry']+_0x523f42[_0xdf34('0x23')]+_0x523f42[_0xdf34('0x24')]+_0x523f42[_0xdf34('0x25')]<_0x3b9767[_0xdf34('0x26')][_0xdf34('0x27')])_0x370e9d=0x1;_0x2aee6b({'additional':_0x370e9d});}else{return db[_0xdf34('0x1c')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x315d98['id']},'order':[['OrderBy',_0xdf34('0x1f')]]})[_0xdf34('0xb')](function(_0x11b68e){var _0x4a8691=0x0;if(_0x11b68e){if(_0x11b68e['countbusyretry']+_0x11b68e[_0xdf34('0x21')]+_0x11b68e[_0xdf34('0x28')]+_0x11b68e[_0xdf34('0x22')]+_0x11b68e[_0xdf34('0x29')]+_0x11b68e[_0xdf34('0x23')]+_0x11b68e[_0xdf34('0x24')]+_0x11b68e[_0xdf34('0x25')]<_0x3b9767[_0xdf34('0x26')]['dialGlobalMaxRetry'])_0x4a8691=0x1;_0x2aee6b({'additional':_0x4a8691});}else{_0x2aee6b({'additional':0x0});}})[_0xdf34('0x2a')](function(_0x4282ab){logger[_0xdf34('0x12')]('VerifyAdditionalPhones',_0x4282ab['message']);_0x17647a(_0x3250b6[_0xdf34('0x12')](0x1f4,_0x4282ab[_0xdf34('0x14')]));});}})[_0xdf34('0x2a')](function(_0x64d8d9){logger['error'](_0xdf34('0x16'),_0x64d8d9[_0xdf34('0x14')]);_0x17647a(_0x3250b6[_0xdf34('0x12')](0x1f4,_0x64d8d9['message']));});}else _0x2aee6b({'additional':0x0});});});};exports[_0xdf34('0x2b')]=function(_0x128a8b){var _0x19ff53=this;return new Promise(function(_0xce29db,_0x4bc8ee){return db[_0xdf34('0x17')][_0xdf34('0x1d')]({'raw':!![],'where':{'ContactId':_0x128a8b[_0xdf34('0x18')]['ContactId'],'ListId':_0x128a8b[_0xdf34('0x18')][_0xdf34('0x19')],'VoiceQueueId':_0x128a8b[_0xdf34('0x18')][_0xdf34('0x1a')]===undefined?null:_0x128a8b['body']['VoiceQueueId'],'CampaignId':_0x128a8b[_0xdf34('0x18')]['CampaignId']===undefined?null:_0x128a8b[_0xdf34('0x18')][_0xdf34('0x1b')]}})['then'](function(_0x1bd437){if(_0x1bd437!=null){return db[_0xdf34('0x1c')][_0xdf34('0x1d')]({'raw':!![],'where':{'CmHopperId':_0x1bd437['id'],'OrderBy':{'$gte':_0x1bd437[_0xdf34('0x1e')]}},'order':[[_0xdf34('0x1e'),_0xdf34('0x1f')]]})[_0xdf34('0xb')](function(_0x1cfdca){if(_0x1cfdca)return activateAdditionalPhone(_0x1bd437,_0x128a8b[_0xdf34('0x18')],_0x1cfdca,_0x128a8b['duration'],_0x128a8b[_0xdf34('0x2c')])[_0xdf34('0xb')](function(_0xec095c){_0xce29db(_0xec095c);});else{return db[_0xdf34('0x1c')][_0xdf34('0x1d')]({'raw':!![],'where':{'CmHopperId':_0x1bd437['id']},'order':[[_0xdf34('0x1e'),'ASC']]})[_0xdf34('0xb')](function(_0x1926ce){if(_0x1926ce)return activateAdditionalPhone(_0x1bd437,_0x128a8b[_0xdf34('0x18')],_0x1926ce,_0x128a8b['duration'],_0x128a8b[_0xdf34('0x2c')])[_0xdf34('0xb')](function(_0x2d108f){_0xce29db(_0x2d108f);});else{_0xce29db({'id':_0x1bd437['id'],'phone':''});}})[_0xdf34('0x2a')](function(_0x52bbdb){logger[_0xdf34('0x12')](_0xdf34('0x16'),_0x52bbdb['message']);_0x4bc8ee(_0x19ff53['error'](0x1f4,_0x52bbdb[_0xdf34('0x14')]));});}})[_0xdf34('0x2a')](function(_0x5eb544){logger['error'](_0xdf34('0x16'),_0x5eb544[_0xdf34('0x14')]);_0x4bc8ee(_0x19ff53[_0xdf34('0x12')](0x1f4,_0x5eb544[_0xdf34('0x14')]));});}else _0xce29db(0x1);});});};function activateAdditionalPhone(_0xc94633,_0x313b29,_0x4981d3,_0x5c0902,_0x45b327){return new Promise(function(_0x1a1328,_0x1333be){var _0x5598e4;if(_[_0xdf34('0x2d')](_0x4981d3[_0xdf34('0x2e')])){_0x4981d3['scheduledat']=moment();}if(moment()>moment(_0x4981d3[_0xdf34('0x2e')])){_0x5598e4=moment()[_0xdf34('0x2f')](_0x45b327||0x3,_0xdf34('0x30'));}else{if(_0x4981d3[_0xdf34('0x1e')]==0x0){_0x5598e4=moment(_0x4981d3[_0xdf34('0x2e')]);}else{_0x5598e4=moment()[_0xdf34('0x2f')](_0x45b327||0x3,_0xdf34('0x30'));}}if(_['isNil'](_0x5598e4)){_0x5598e4=moment()['add'](_0x45b327||0x3,_0xdf34('0x30'));}var _0x362ef0={'phone':_0xc94633['phone'],'active':0x0,'OrderBy':_['isNil'](_0xc94633['OrderBy'])?0x0:_0xc94633['OrderBy'],'scheduledat':moment()[_0xdf34('0x2f')](_0x5c0902||0x1,_0xdf34('0x30')),'countbusyretry':_0x313b29['countbusyretry'],'countcongestionretry':_0x313b29['countcongestionretry'],'countnoanswerretry':_0x313b29[_0xdf34('0x28')],'countnosuchnumberretry':_0x313b29[_0xdf34('0x22')],'countdropretry':_0x313b29['countdropretry'],'countabandonedretry':_0x313b29[_0xdf34('0x23')],'countmachineretry':_0x313b29['countmachineretry'],'countagentrejectretry':_0x313b29[_0xdf34('0x25')],'createdAt':_0x313b29['createdAt'],'updatedAt':_0x313b29[_0xdf34('0x31')]};var _0x438f0e={'CmHopperId':_0xc94633['id'],'phone':_0x4981d3[_0xdf34('0x32')],'active':0x0,'OrderBy':_[_0xdf34('0x2d')](_0x4981d3['OrderBy'])?0x0:_0x4981d3['OrderBy'],'scheduledat':_0x5598e4,'countbusyretry':_0x4981d3[_0xdf34('0x20')],'countcongestionretry':_0x4981d3[_0xdf34('0x21')],'countnoanswerretry':_0x4981d3[_0xdf34('0x28')],'countnosuchnumberretry':_0x4981d3[_0xdf34('0x22')],'countdropretry':_0x4981d3[_0xdf34('0x29')],'countabandonedretry':_0x4981d3[_0xdf34('0x23')],'countmachineretry':_0x4981d3[_0xdf34('0x24')],'countagentrejectretry':_0x4981d3['countagentrejectretry'],'createdAt':_0x4981d3[_0xdf34('0x33')],'updatedAt':_0x4981d3['updatedAt']};return db['sequelize'][_0xdf34('0x34')](function(_0x360c31){return db[_0xdf34('0x1c')][_0xdf34('0x35')](_0x362ef0,{'where':{'id':_0x4981d3['id']}},{'transaction':_0x360c31})[_0xdf34('0xb')](function(){return db[_0xdf34('0x17')][_0xdf34('0x35')](_0x438f0e,{'where':{'id':_0xc94633['id']}},{'transaction':_0x360c31});});})[_0xdf34('0xb')](function(_0x47cfa0){_0x1a1328({'id':_0xc94633['id'],'phone':_0x4981d3[_0xdf34('0x32')]});})[_0xdf34('0x2a')](function(_0x253836){logger[_0xdf34('0x12')](_0xdf34('0x36'),_0x253836[_0xdf34('0x14')]);_0x1333be({'error':_0x253836[_0xdf34('0x14')]});});});}exports[_0xdf34('0x37')]=function(_0x399f8b){var _0x1aae14=this;return new Promise(function(_0xe10ff5,_0x12afa7){return db[_0xdf34('0x17')]['update'](_0x399f8b[_0xdf34('0x18')]['field'],{'where':{'id':_0x399f8b[_0xdf34('0x18')]['id']}})[_0xdf34('0xb')](function(_0x228b9b){_0xe10ff5(_0x228b9b);})[_0xdf34('0x2a')](function(_0x2c1a2b){logger[_0xdf34('0x12')]('IncrementPreviewCounters',_0x2c1a2b[_0xdf34('0x14')]);_0x12afa7(_0x1aae14[_0xdf34('0x12')](0x1f4,_0x2c1a2b[_0xdf34('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index fb156cc..11689c8 100644 --- a/server/api/cmHopperAdditionalPhone/index.js +++ b/server/api/cmHopperAdditionalPhone/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1ff7=['destroy','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','index','/:id','isAuthenticated','show','create'];(function(_0x6beb92,_0x14b5d3){var _0x51f315=function(_0x15e373){while(--_0x15e373){_0x6beb92['push'](_0x6beb92['shift']());}};_0x51f315(++_0x14b5d3);}(_0x1ff7,0x189));var _0x71ff=function(_0x4feeaa,_0xe283ea){_0x4feeaa=_0x4feeaa-0x0;var _0x37ba43=_0x1ff7[_0x4feeaa];return _0x37ba43;};'use strict';var multer=require(_0x71ff('0x0'));var util=require(_0x71ff('0x1'));var path=require('path');var timeout=require(_0x71ff('0x2'));var express=require(_0x71ff('0x3'));var router=express['Router']();var fs_extra=require(_0x71ff('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x71ff('0x5'));var config=require(_0x71ff('0x6'));var controller=require(_0x71ff('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x71ff('0x8')]);router['get'](_0x71ff('0x9'),auth[_0x71ff('0xa')](),controller[_0x71ff('0xb')]);router['post']('/',auth[_0x71ff('0xa')](),controller[_0x71ff('0xc')]);router['put'](_0x71ff('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x71ff('0x9'),auth[_0x71ff('0xa')](),controller[_0x71ff('0xd')]);module['exports']=router; \ No newline at end of file +var _0x680f=['isAuthenticated','index','/:id','post','create','put','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','get'];(function(_0x52ea08,_0x15d935){var _0x28d546=function(_0x4a3aa7){while(--_0x4a3aa7){_0x52ea08['push'](_0x52ea08['shift']());}};_0x28d546(++_0x15d935);}(_0x680f,0x78));var _0xf680=function(_0x4bd079,_0x2a81e0){_0x4bd079=_0x4bd079-0x0;var _0x122da9=_0x680f[_0x4bd079];return _0x122da9;};'use strict';var multer=require(_0xf680('0x0'));var util=require(_0xf680('0x1'));var path=require(_0xf680('0x2'));var timeout=require('connect-timeout');var express=require(_0xf680('0x3'));var router=express[_0xf680('0x4')]();var fs_extra=require(_0xf680('0x5'));var auth=require(_0xf680('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmHopperAdditionalPhone.controller');router[_0xf680('0x7')]('/',auth[_0xf680('0x8')](),controller[_0xf680('0x9')]);router['get'](_0xf680('0xa'),auth[_0xf680('0x8')](),controller['show']);router[_0xf680('0xb')]('/',auth[_0xf680('0x8')](),controller[_0xf680('0xc')]);router[_0xf680('0xd')](_0xf680('0xa'),auth[_0xf680('0x8')](),controller['update']);router[_0xf680('0xe')]('/:id',auth[_0xf680('0x8')](),controller['destroy']);module[_0xf680('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 6e2dc79..e699950 100644 --- a/server/api/cmHopperBlack/cmHopperBlack.attributes.js +++ b/server/api/cmHopperBlack/cmHopperBlack.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1952=['INTEGER','contactListQueue','sequelize','exports'];(function(_0x505603,_0x338393){var _0x2dfd31=function(_0x370a20){while(--_0x370a20){_0x505603['push'](_0x505603['shift']());}};_0x2dfd31(++_0x338393);}(_0x1952,0x92));var _0x2195=function(_0x51d5f0,_0x42cafb){_0x51d5f0=_0x51d5f0-0x0;var _0x1eb9ce=_0x1952[_0x51d5f0];return _0x1eb9ce;};'use strict';var moment=require('moment');var Sequelize=require(_0x2195('0x0'));module[_0x2195('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x2195('0x2')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x2195('0x2')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x2195('0x3')}}; \ No newline at end of file +var _0x0a6b=['INTEGER','contactListQueue','moment'];(function(_0x3892e3,_0x35c8dd){var _0xd332c5=function(_0x913e7e){while(--_0x913e7e){_0x3892e3['push'](_0x3892e3['shift']());}};_0xd332c5(++_0x35c8dd);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x161e88,_0x49ce5e){_0x161e88=_0x161e88-0x0;var _0x40ee62=_0x0a6b[_0x161e88];return _0x40ee62;};'use strict';var moment=require(_0xb0a6('0x0'));var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0xb0a6('0x1')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xb0a6('0x1')],'unique':_0xb0a6('0x2')},'VoiceQueueId':{'type':Sequelize[_0xb0a6('0x1')],'unique':'contactListQueue'}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 83ce3fb..58993bf 100644 --- a/server/api/cmHopperBlack/cmHopperBlack.controller.js +++ b/server/api/cmHopperBlack/cmHopperBlack.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc833=['index','map','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','CmHopperBlack','includeAll','include','rows','params','length','find','catch','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','then','error','stack','name','send'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xc833,0xfd));var _0x3c83=function(_0x3032bf,_0x26ed48){_0x3032bf=_0x3032bf-0x0;var _0x22f47c=_0xc833[_0x3032bf];return _0x22f47c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3c83('0x0'));var zipdir=require(_0x3c83('0x1'));var jsonpatch=require(_0x3c83('0x2'));var rp=require(_0x3c83('0x3'));var moment=require(_0x3c83('0x4'));var BPromise=require(_0x3c83('0x5'));var Mustache=require('mustache');var util=require(_0x3c83('0x6'));var path=require('path');var sox=require(_0x3c83('0x7'));var csv=require('to-csv');var ejs=require(_0x3c83('0x8'));var fs=require('fs');var fs_extra=require(_0x3c83('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3c83('0xa'));var jsforce=require(_0x3c83('0xb'));var deskjs=require(_0x3c83('0xc'));var toCsv=require(_0x3c83('0xd'));var querystring=require(_0x3c83('0xe'));var Papa=require(_0x3c83('0xf'));var Redis=require(_0x3c83('0x10'));var authService=require(_0x3c83('0x11'));var qs=require(_0x3c83('0x12'));var as=require(_0x3c83('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3c83('0x14'))(_0x3c83('0x15'));var utils=require(_0x3c83('0x16'));var config=require(_0x3c83('0x17'));var licenseUtil=require(_0x3c83('0x18'));var db=require(_0x3c83('0x19'))['db'];function respondWithStatusCode(_0x521055,_0x323569){_0x323569=_0x323569||0xcc;return function(_0x48b645){if(_0x48b645){return _0x521055['sendStatus'](_0x323569);}return _0x521055[_0x3c83('0x1a')](_0x323569)[_0x3c83('0x1b')]();};}function respondWithResult(_0x1de23c,_0xbfdaf5){_0xbfdaf5=_0xbfdaf5||0xc8;return function(_0x2b4ebd){if(_0x2b4ebd){return _0x1de23c[_0x3c83('0x1a')](_0xbfdaf5)[_0x3c83('0x1c')](_0x2b4ebd);}};}function respondWithFilteredResult(_0x8cf1,_0x16e08b){return function(_0x540cdd){if(_0x540cdd){var _0x4cd4f2=typeof _0x16e08b[_0x3c83('0x1d')]===_0x3c83('0x1e')&&typeof _0x16e08b[_0x3c83('0x1f')]===_0x3c83('0x1e');var _0x51722b=_0x540cdd[_0x3c83('0x20')];var _0x5f3d0a=_0x4cd4f2?0x0:_0x16e08b['offset'];var _0x30804a=_0x4cd4f2?_0x540cdd[_0x3c83('0x20')]:_0x16e08b[_0x3c83('0x1d')]+_0x16e08b[_0x3c83('0x1f')];var _0xa38ef8;if(_0x30804a>=_0x51722b){_0x30804a=_0x51722b;_0xa38ef8=0xc8;}else{_0xa38ef8=0xce;}_0x8cf1[_0x3c83('0x1a')](_0xa38ef8);return _0x8cf1['set'](_0x3c83('0x21'),_0x5f3d0a+'-'+_0x30804a+'/'+_0x51722b)['json'](_0x540cdd);}return null;};}function patchUpdates(_0x5eb498){return function(_0x5d37f8){try{jsonpatch['apply'](_0x5d37f8,_0x5eb498,!![]);}catch(_0x291c41){return BPromise[_0x3c83('0x22')](_0x291c41);}return _0x5d37f8[_0x3c83('0x23')]();};}function saveUpdates(_0x1284c2,_0x3379f1){return function(_0x7b7163){if(_0x7b7163){return _0x7b7163[_0x3c83('0x24')](_0x1284c2)['then'](function(_0x311562){return _0x311562;});}return null;};}function removeEntity(_0x31a938,_0x5e2eeb){return function(_0x4448f2){if(_0x4448f2){return _0x4448f2[_0x3c83('0x25')]()[_0x3c83('0x26')](function(){_0x31a938[_0x3c83('0x1a')](0xcc)[_0x3c83('0x1b')]();});}};}function handleEntityNotFound(_0x2bee89,_0xed9592){return function(_0x424004){if(!_0x424004){_0x2bee89['sendStatus'](0x194);}return _0x424004;};}function handleError(_0x30b17c,_0x2c74af){_0x2c74af=_0x2c74af||0x1f4;return function(_0x2ef7de){logger[_0x3c83('0x27')](_0x2ef7de[_0x3c83('0x28')]);if(_0x2ef7de[_0x3c83('0x29')]){delete _0x2ef7de['name'];}_0x30b17c[_0x3c83('0x1a')](_0x2c74af)[_0x3c83('0x2a')](_0x2ef7de);};}exports[_0x3c83('0x2b')]=function(_0x20316d,_0x57a4da){var _0x3d6e14={},_0x3f6c02={},_0x21e286={'count':0x0,'rows':[]};var _0x21ad93=_[_0x3c83('0x2c')](db['CmHopperBlack'][_0x3c83('0x2d')],function(_0x5de483){return{'name':_0x5de483[_0x3c83('0x2e')],'type':_0x5de483[_0x3c83('0x2f')]['key']};});_0x3f6c02[_0x3c83('0x30')]=_['map'](_0x21ad93,_0x3c83('0x29'));_0x3f6c02[_0x3c83('0x31')]=_[_0x3c83('0x32')](_0x20316d[_0x3c83('0x31')]);_0x3f6c02['filters']=_[_0x3c83('0x33')](_0x3f6c02[_0x3c83('0x30')],_0x3f6c02[_0x3c83('0x31')]);_0x3d6e14[_0x3c83('0x34')]=_['intersection'](_0x3f6c02['model'],qs[_0x3c83('0x35')](_0x20316d[_0x3c83('0x31')][_0x3c83('0x35')]));_0x3d6e14[_0x3c83('0x34')]=_0x3d6e14['attributes']['length']?_0x3d6e14[_0x3c83('0x34')]:_0x3f6c02[_0x3c83('0x30')];if(!_0x20316d[_0x3c83('0x31')][_0x3c83('0x36')](_0x3c83('0x37'))){_0x3d6e14['limit']=qs[_0x3c83('0x1f')](_0x20316d[_0x3c83('0x31')][_0x3c83('0x1f')]);_0x3d6e14[_0x3c83('0x1d')]=qs[_0x3c83('0x1d')](_0x20316d[_0x3c83('0x31')][_0x3c83('0x1d')]);}_0x3d6e14['order']=qs[_0x3c83('0x38')](_0x20316d[_0x3c83('0x31')][_0x3c83('0x38')]);_0x3d6e14[_0x3c83('0x39')]=qs[_0x3c83('0x3a')](_[_0x3c83('0x3b')](_0x20316d[_0x3c83('0x31')],_0x3f6c02[_0x3c83('0x3a')]),_0x21ad93);if(_0x20316d['query'][_0x3c83('0x3c')]){_0x3d6e14[_0x3c83('0x39')]=_[_0x3c83('0x3d')](_0x3d6e14[_0x3c83('0x39')],{'$or':_['map'](_0x21ad93,function(_0x54c91d){if(_0x54c91d[_0x3c83('0x2f')]!==_0x3c83('0x3e')){var _0x3a8468={};_0x3a8468[_0x54c91d[_0x3c83('0x29')]]={'$like':'%'+_0x20316d[_0x3c83('0x31')][_0x3c83('0x3c')]+'%'};return _0x3a8468;}})});}_0x3d6e14=_[_0x3c83('0x3d')]({},_0x3d6e14,_0x20316d[_0x3c83('0x3f')]);var _0x389fb1={'where':_0x3d6e14[_0x3c83('0x39')]};return db[_0x3c83('0x40')][_0x3c83('0x20')](_0x389fb1)[_0x3c83('0x26')](function(_0xb44bb2){_0x21e286[_0x3c83('0x20')]=_0xb44bb2;if(_0x20316d[_0x3c83('0x31')][_0x3c83('0x41')]){_0x3d6e14[_0x3c83('0x42')]=[{'all':!![]}];}return db[_0x3c83('0x40')]['findAll'](_0x3d6e14);})[_0x3c83('0x26')](function(_0x14dc95){_0x21e286[_0x3c83('0x43')]=_0x14dc95;return _0x21e286;})[_0x3c83('0x26')](respondWithFilteredResult(_0x57a4da,_0x3d6e14))['catch'](handleError(_0x57a4da,null));};exports['show']=function(_0x1769bd,_0x281b0a){var _0x4089f7={'raw':!![],'where':{'id':_0x1769bd[_0x3c83('0x44')]['id']}},_0x2b8b5c={};_0x2b8b5c[_0x3c83('0x30')]=_['keys'](db[_0x3c83('0x40')][_0x3c83('0x2d')]);_0x2b8b5c[_0x3c83('0x31')]=_[_0x3c83('0x32')](_0x1769bd[_0x3c83('0x31')]);_0x2b8b5c[_0x3c83('0x3a')]=_[_0x3c83('0x33')](_0x2b8b5c[_0x3c83('0x30')],_0x2b8b5c[_0x3c83('0x31')]);_0x4089f7[_0x3c83('0x34')]=_['intersection'](_0x2b8b5c[_0x3c83('0x30')],qs['fields'](_0x1769bd[_0x3c83('0x31')][_0x3c83('0x35')]));_0x4089f7[_0x3c83('0x34')]=_0x4089f7[_0x3c83('0x34')][_0x3c83('0x45')]?_0x4089f7['attributes']:_0x2b8b5c[_0x3c83('0x30')];if(_0x1769bd[_0x3c83('0x31')][_0x3c83('0x41')]){_0x4089f7[_0x3c83('0x42')]=[{'all':!![]}];}_0x4089f7=_[_0x3c83('0x3d')]({},_0x4089f7,_0x1769bd['options']);return db[_0x3c83('0x40')][_0x3c83('0x46')](_0x4089f7)[_0x3c83('0x26')](handleEntityNotFound(_0x281b0a,null))['then'](respondWithResult(_0x281b0a,null))[_0x3c83('0x47')](handleError(_0x281b0a,null));};exports[_0x3c83('0x24')]=function(_0x1e825c,_0x4d582f){if(_0x1e825c[_0x3c83('0x48')]['id']){delete _0x1e825c[_0x3c83('0x48')]['id'];}return db[_0x3c83('0x40')][_0x3c83('0x46')]({'where':{'id':_0x1e825c[_0x3c83('0x44')]['id']}})[_0x3c83('0x26')](handleEntityNotFound(_0x4d582f,null))[_0x3c83('0x26')](saveUpdates(_0x1e825c[_0x3c83('0x48')],null))['then'](respondWithResult(_0x4d582f,null))[_0x3c83('0x47')](handleError(_0x4d582f,null));};exports['destroy']=function(_0x7d9ea2,_0x352280){return db['CmHopperBlack'][_0x3c83('0x46')]({'where':{'id':_0x7d9ea2[_0x3c83('0x44')]['id']}})[_0x3c83('0x26')](handleEntityNotFound(_0x352280,null))[_0x3c83('0x26')](removeEntity(_0x352280,null))[_0x3c83('0x47')](handleError(_0x352280,null));};exports[_0x3c83('0x49')]=function(_0x4a1f69,_0x1b609e){return db[_0x3c83('0x40')]['describe']()[_0x3c83('0x26')](respondWithResult(_0x1b609e,null))[_0x3c83('0x47')](handleError(_0x1b609e,null));}; \ No newline at end of file +var _0x8f0a=['index','CmHopperBlack','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','limit','undefined','count','status','set','apply','reject','save','update','then','sendStatus','stack','name','send'];(function(_0xec89fb,_0x5f2959){var _0x17c00d=function(_0x183408){while(--_0x183408){_0xec89fb['push'](_0xec89fb['shift']());}};_0x17c00d(++_0x5f2959);}(_0x8f0a,0x1e4));var _0xa8f0=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0x8f0a[_0x166742];return _0xb7814a;};'use strict';var emlformat=require(_0xa8f0('0x0'));var rimraf=require(_0xa8f0('0x1'));var zipdir=require(_0xa8f0('0x2'));var jsonpatch=require(_0xa8f0('0x3'));var rp=require(_0xa8f0('0x4'));var moment=require(_0xa8f0('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa8f0('0x6'));var path=require(_0xa8f0('0x7'));var sox=require(_0xa8f0('0x8'));var csv=require(_0xa8f0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa8f0('0xa'));var _=require(_0xa8f0('0xb'));var squel=require('squel');var crypto=require(_0xa8f0('0xc'));var jsforce=require(_0xa8f0('0xd'));var deskjs=require(_0xa8f0('0xe'));var toCsv=require(_0xa8f0('0x9'));var querystring=require(_0xa8f0('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa8f0('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa8f0('0x11'));var hardwareService=require(_0xa8f0('0x12'));var logger=require('../../config/logger')(_0xa8f0('0x13'));var utils=require(_0xa8f0('0x14'));var config=require(_0xa8f0('0x15'));var licenseUtil=require(_0xa8f0('0x16'));var db=require(_0xa8f0('0x17'))['db'];function respondWithStatusCode(_0x18413f,_0x464f7a){_0x464f7a=_0x464f7a||0xcc;return function(_0x27da8c){if(_0x27da8c){return _0x18413f['sendStatus'](_0x464f7a);}return _0x18413f['status'](_0x464f7a)[_0xa8f0('0x18')]();};}function respondWithResult(_0x12e6ad,_0x4ef3a7){_0x4ef3a7=_0x4ef3a7||0xc8;return function(_0x1693d0){if(_0x1693d0){return _0x12e6ad['status'](_0x4ef3a7)[_0xa8f0('0x19')](_0x1693d0);}};}function respondWithFilteredResult(_0xc18b7f,_0x45cf2b){return function(_0x556f8b){if(_0x556f8b){var _0x39772a=typeof _0x45cf2b[_0xa8f0('0x1a')]==='undefined'&&typeof _0x45cf2b[_0xa8f0('0x1b')]===_0xa8f0('0x1c');var _0x3777f1=_0x556f8b[_0xa8f0('0x1d')];var _0x3c9ef5=_0x39772a?0x0:_0x45cf2b[_0xa8f0('0x1a')];var _0x36febf=_0x39772a?_0x556f8b[_0xa8f0('0x1d')]:_0x45cf2b[_0xa8f0('0x1a')]+_0x45cf2b['limit'];var _0x4a5237;if(_0x36febf>=_0x3777f1){_0x36febf=_0x3777f1;_0x4a5237=0xc8;}else{_0x4a5237=0xce;}_0xc18b7f[_0xa8f0('0x1e')](_0x4a5237);return _0xc18b7f[_0xa8f0('0x1f')]('Content-Range',_0x3c9ef5+'-'+_0x36febf+'/'+_0x3777f1)['json'](_0x556f8b);}return null;};}function patchUpdates(_0x505c06){return function(_0x452dfe){try{jsonpatch[_0xa8f0('0x20')](_0x452dfe,_0x505c06,!![]);}catch(_0x11068d){return BPromise[_0xa8f0('0x21')](_0x11068d);}return _0x452dfe[_0xa8f0('0x22')]();};}function saveUpdates(_0x37a5e4,_0x4c5907){return function(_0x1e3e1b){if(_0x1e3e1b){return _0x1e3e1b[_0xa8f0('0x23')](_0x37a5e4)['then'](function(_0x157e14){return _0x157e14;});}return null;};}function removeEntity(_0x1be265,_0x3ed6da){return function(_0x4cc072){if(_0x4cc072){return _0x4cc072['destroy']()[_0xa8f0('0x24')](function(){_0x1be265['status'](0xcc)[_0xa8f0('0x18')]();});}};}function handleEntityNotFound(_0x4b26ab,_0x4f3b5e){return function(_0x4c1feb){if(!_0x4c1feb){_0x4b26ab[_0xa8f0('0x25')](0x194);}return _0x4c1feb;};}function handleError(_0xa14384,_0x26e517){_0x26e517=_0x26e517||0x1f4;return function(_0x3285fa){logger['error'](_0x3285fa[_0xa8f0('0x26')]);if(_0x3285fa[_0xa8f0('0x27')]){delete _0x3285fa['name'];}_0xa14384[_0xa8f0('0x1e')](_0x26e517)[_0xa8f0('0x28')](_0x3285fa);};}exports[_0xa8f0('0x29')]=function(_0x42e93b,_0x171eb1){var _0x3bf6bc={},_0x33cf10={},_0x4aae13={'count':0x0,'rows':[]};var _0x985857=_['map'](db[_0xa8f0('0x2a')][_0xa8f0('0x2b')],function(_0x211c73){return{'name':_0x211c73[_0xa8f0('0x2c')],'type':_0x211c73[_0xa8f0('0x2d')][_0xa8f0('0x2e')]};});_0x33cf10[_0xa8f0('0x2f')]=_[_0xa8f0('0x30')](_0x985857,_0xa8f0('0x27'));_0x33cf10[_0xa8f0('0x31')]=_[_0xa8f0('0x32')](_0x42e93b['query']);_0x33cf10[_0xa8f0('0x33')]=_['intersection'](_0x33cf10['model'],_0x33cf10['query']);_0x3bf6bc['attributes']=_[_0xa8f0('0x34')](_0x33cf10['model'],qs[_0xa8f0('0x35')](_0x42e93b[_0xa8f0('0x31')][_0xa8f0('0x35')]));_0x3bf6bc[_0xa8f0('0x36')]=_0x3bf6bc[_0xa8f0('0x36')][_0xa8f0('0x37')]?_0x3bf6bc[_0xa8f0('0x36')]:_0x33cf10[_0xa8f0('0x2f')];if(!_0x42e93b['query'][_0xa8f0('0x38')](_0xa8f0('0x39'))){_0x3bf6bc[_0xa8f0('0x1b')]=qs['limit'](_0x42e93b[_0xa8f0('0x31')][_0xa8f0('0x1b')]);_0x3bf6bc[_0xa8f0('0x1a')]=qs['offset'](_0x42e93b[_0xa8f0('0x31')][_0xa8f0('0x1a')]);}_0x3bf6bc[_0xa8f0('0x3a')]=qs[_0xa8f0('0x3b')](_0x42e93b[_0xa8f0('0x31')]['sort']);_0x3bf6bc[_0xa8f0('0x3c')]=qs[_0xa8f0('0x33')](_[_0xa8f0('0x3d')](_0x42e93b[_0xa8f0('0x31')],_0x33cf10[_0xa8f0('0x33')]),_0x985857);if(_0x42e93b[_0xa8f0('0x31')][_0xa8f0('0x3e')]){_0x3bf6bc[_0xa8f0('0x3c')]=_[_0xa8f0('0x3f')](_0x3bf6bc[_0xa8f0('0x3c')],{'$or':_[_0xa8f0('0x30')](_0x985857,function(_0x2b79dc){if(_0x2b79dc['type']!==_0xa8f0('0x40')){var _0x175256={};_0x175256[_0x2b79dc[_0xa8f0('0x27')]]={'$like':'%'+_0x42e93b['query']['filter']+'%'};return _0x175256;}})});}_0x3bf6bc=_[_0xa8f0('0x3f')]({},_0x3bf6bc,_0x42e93b[_0xa8f0('0x41')]);var _0x2050ba={'where':_0x3bf6bc[_0xa8f0('0x3c')]};return db['CmHopperBlack'][_0xa8f0('0x1d')](_0x2050ba)[_0xa8f0('0x24')](function(_0x3d45a0){_0x4aae13['count']=_0x3d45a0;if(_0x42e93b[_0xa8f0('0x31')][_0xa8f0('0x42')]){_0x3bf6bc[_0xa8f0('0x43')]=[{'all':!![]}];}return db[_0xa8f0('0x2a')][_0xa8f0('0x44')](_0x3bf6bc);})[_0xa8f0('0x24')](function(_0x3386a4){_0x4aae13[_0xa8f0('0x45')]=_0x3386a4;return _0x4aae13;})[_0xa8f0('0x24')](respondWithFilteredResult(_0x171eb1,_0x3bf6bc))[_0xa8f0('0x46')](handleError(_0x171eb1,null));};exports['show']=function(_0x48f3c7,_0x27ee27){var _0x132897={'raw':!![],'where':{'id':_0x48f3c7['params']['id']}},_0x3fb052={};_0x3fb052[_0xa8f0('0x2f')]=_[_0xa8f0('0x32')](db[_0xa8f0('0x2a')][_0xa8f0('0x2b')]);_0x3fb052[_0xa8f0('0x31')]=_['keys'](_0x48f3c7['query']);_0x3fb052['filters']=_['intersection'](_0x3fb052['model'],_0x3fb052[_0xa8f0('0x31')]);_0x132897[_0xa8f0('0x36')]=_[_0xa8f0('0x34')](_0x3fb052['model'],qs[_0xa8f0('0x35')](_0x48f3c7['query'][_0xa8f0('0x35')]));_0x132897[_0xa8f0('0x36')]=_0x132897[_0xa8f0('0x36')][_0xa8f0('0x37')]?_0x132897['attributes']:_0x3fb052[_0xa8f0('0x2f')];if(_0x48f3c7[_0xa8f0('0x31')][_0xa8f0('0x42')]){_0x132897[_0xa8f0('0x43')]=[{'all':!![]}];}_0x132897=_[_0xa8f0('0x3f')]({},_0x132897,_0x48f3c7[_0xa8f0('0x41')]);return db[_0xa8f0('0x2a')]['find'](_0x132897)[_0xa8f0('0x24')](handleEntityNotFound(_0x27ee27,null))[_0xa8f0('0x24')](respondWithResult(_0x27ee27,null))['catch'](handleError(_0x27ee27,null));};exports[_0xa8f0('0x23')]=function(_0x54f447,_0x5bac1f){if(_0x54f447[_0xa8f0('0x47')]['id']){delete _0x54f447[_0xa8f0('0x47')]['id'];}return db[_0xa8f0('0x2a')][_0xa8f0('0x48')]({'where':{'id':_0x54f447['params']['id']}})[_0xa8f0('0x24')](handleEntityNotFound(_0x5bac1f,null))['then'](saveUpdates(_0x54f447[_0xa8f0('0x47')],null))[_0xa8f0('0x24')](respondWithResult(_0x5bac1f,null))[_0xa8f0('0x46')](handleError(_0x5bac1f,null));};exports['destroy']=function(_0x5e2558,_0x5b4d15){return db[_0xa8f0('0x2a')]['find']({'where':{'id':_0x5e2558[_0xa8f0('0x49')]['id']}})[_0xa8f0('0x24')](handleEntityNotFound(_0x5b4d15,null))[_0xa8f0('0x24')](removeEntity(_0x5b4d15,null))['catch'](handleError(_0x5b4d15,null));};exports[_0xa8f0('0x4a')]=function(_0x426b4a,_0x5f5d01){return db[_0xa8f0('0x2a')][_0xa8f0('0x4a')]()['then'](respondWithResult(_0x5f5d01,null))[_0xa8f0('0x46')](handleError(_0x5f5d01,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 55f3edc..b218008 100644 --- a/server/api/cmHopperBlack/cmHopperBlack.model.js +++ b/server/api/cmHopperBlack/cmHopperBlack.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c75=['util','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','CmHopperBlack','cm_hopper_black','lodash'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x1c75,0x128));var _0x51c7=function(_0x1c9f84,_0x12db77){_0x1c9f84=_0x1c9f84-0x0;var _0x250013=_0x1c75[_0x1c9f84];return _0x250013;};'use strict';var _=require(_0x51c7('0x0'));var util=require(_0x51c7('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x51c7('0x2'));var rp=require(_0x51c7('0x3'));var fs=require('fs');var path=require(_0x51c7('0x4'));var rimraf=require(_0x51c7('0x5'));var config=require(_0x51c7('0x6'));var attributes=require('./cmHopperBlack.attributes');module[_0x51c7('0x7')]=function(_0xc45ee3,_0x153fca){return _0xc45ee3[_0x51c7('0x8')](_0x51c7('0x9'),attributes,{'tableName':_0x51c7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9a97=['rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','api','moment','bluebird','request-promise'];(function(_0x89d328,_0x1b739a){var _0x56ba9b=function(_0x879f32){while(--_0x879f32){_0x89d328['push'](_0x89d328['shift']());}};_0x56ba9b(++_0x1b739a);}(_0x9a97,0xf1));var _0x79a9=function(_0xba44a7,_0x168bce){_0xba44a7=_0xba44a7-0x0;var _0x355206=_0x9a97[_0xba44a7];return _0x355206;};'use strict';var _=require(_0x79a9('0x0'));var util=require(_0x79a9('0x1'));var logger=require('../../config/logger')(_0x79a9('0x2'));var moment=require(_0x79a9('0x3'));var BPromise=require(_0x79a9('0x4'));var rp=require(_0x79a9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x79a9('0x6'));var config=require(_0x79a9('0x7'));var attributes=require(_0x79a9('0x8'));module[_0x79a9('0x9')]=function(_0x18a3a5,_0x35a7a4){return _0x18a3a5[_0x79a9('0xa')](_0x79a9('0xb'),attributes,{'tableName':_0x79a9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 4fc5232..ff5f9bb 100644 --- a/server/api/cmHopperBlack/cmHopperBlack.rpc.js +++ b/server/api/cmHopperBlack/cmHopperBlack.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5be7=['../../config/utils','jayson/promise','client','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetCmHopperBlack','findAll','options','where','attributes','limit','include','map','model','UpdateCmHopperBlack','CmHopperBlack','update','body','raw','stringify','DestroyCmHopperBlack','destroy','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x40a121,_0x4d5484){var _0x10ff90=function(_0x34a092){while(--_0x34a092){_0x40a121['push'](_0x40a121['shift']());}};_0x10ff90(++_0x4d5484);}(_0x5be7,0x67));var _0x75be=function(_0x51bad5,_0x3d1443){_0x51bad5=_0x51bad5-0x0;var _0x5a0e3f=_0x5be7[_0x51bad5];return _0x5a0e3f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x75be('0x0'));var BPromise=require(_0x75be('0x1'));var rs=require(_0x75be('0x2'));var fs=require('fs');var Redis=require(_0x75be('0x3'));var db=require(_0x75be('0x4'))['db'];var utils=require(_0x75be('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x75be('0x6'));var client=jayson[_0x75be('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ec45a,_0x50d1b2,_0x5d1e40){return new BPromise(function(_0x3ab171,_0x1808c7){return client[_0x75be('0x8')](_0x1ec45a,_0x5d1e40)[_0x75be('0x9')](function(_0x232d92){logger[_0x75be('0xa')](_0x75be('0xb'),_0x50d1b2,_0x75be('0xc'));logger[_0x75be('0xd')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x50d1b2,_0x75be('0xc'),JSON['stringify'](_0x232d92));if(_0x232d92['error']){if(_0x232d92[_0x75be('0xe')][_0x75be('0xf')]===0x1f4){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x50d1b2,_0x232d92[_0x75be('0xe')][_0x75be('0x10')]);return _0x1808c7(_0x232d92[_0x75be('0xe')][_0x75be('0x10')]);}logger[_0x75be('0xe')](_0x75be('0xb'),_0x50d1b2,_0x232d92['error'][_0x75be('0x10')]);return _0x3ab171(_0x232d92['error']['message']);}else{logger[_0x75be('0xa')](_0x75be('0xb'),_0x50d1b2,_0x75be('0xc'));_0x3ab171(_0x232d92[_0x75be('0x11')]['message']);}})[_0x75be('0x12')](function(_0x36e852){logger[_0x75be('0xe')](_0x75be('0xb'),_0x50d1b2,_0x36e852);_0x1808c7(_0x36e852);});});}exports[_0x75be('0x13')]=function(_0x58855f){var _0x3b2dff=this;return new Promise(function(_0x625948,_0x16de49){return db['CmHopperBlack'][_0x75be('0x14')]({'raw':_0x58855f['options']?_0x58855f[_0x75be('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x58855f['options']?_0x58855f[_0x75be('0x15')][_0x75be('0x16')]||null:null,'attributes':_0x58855f['options']?_0x58855f[_0x75be('0x15')][_0x75be('0x17')]||null:null,'limit':_0x58855f[_0x75be('0x15')]?_0x58855f[_0x75be('0x15')][_0x75be('0x18')]||null:null,'include':_0x58855f[_0x75be('0x15')]?_0x58855f[_0x75be('0x15')][_0x75be('0x19')]?_[_0x75be('0x1a')](_0x58855f[_0x75be('0x15')][_0x75be('0x19')],function(_0x243d68){return{'model':db[_0x243d68[_0x75be('0x1b')]],'as':_0x243d68['as'],'attributes':_0x243d68[_0x75be('0x17')],'include':_0x243d68[_0x75be('0x19')]?_[_0x75be('0x1a')](_0x243d68[_0x75be('0x19')],function(_0x5c782e){return{'model':db[_0x5c782e[_0x75be('0x1b')]],'as':_0x5c782e['as'],'attributes':_0x5c782e[_0x75be('0x17')],'include':_0x5c782e[_0x75be('0x19')]?_['map'](_0x5c782e['include'],function(_0x41b258){return{'model':db[_0x41b258[_0x75be('0x1b')]],'as':_0x41b258['as'],'attributes':_0x41b258[_0x75be('0x17')]};}):[]};}):[]};}):[]:[]})[_0x75be('0x9')](function(_0x55a3a8){logger[_0x75be('0xa')](_0x75be('0x13'),_0x58855f);logger[_0x75be('0xd')](_0x75be('0x13'),_0x58855f,JSON['stringify'](_0x55a3a8));_0x625948(_0x55a3a8);})[_0x75be('0x12')](function(_0xc79d54){logger[_0x75be('0xe')](_0x75be('0x13'),_0xc79d54[_0x75be('0x10')],_0x58855f);_0x16de49(_0x3b2dff[_0x75be('0xe')](0x1f4,_0xc79d54[_0x75be('0x10')]));});});};exports[_0x75be('0x1c')]=function(_0x59374c){var _0x513fd7=this;return new Promise(function(_0x9224b8,_0x43cfaf){return db[_0x75be('0x1d')][_0x75be('0x1e')](_0x59374c[_0x75be('0x1f')],{'raw':_0x59374c['options']?_0x59374c[_0x75be('0x15')][_0x75be('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59374c[_0x75be('0x15')]?_0x59374c[_0x75be('0x15')]['where']||null:null,'attributes':_0x59374c[_0x75be('0x15')]?_0x59374c[_0x75be('0x15')][_0x75be('0x17')]||null:null,'limit':_0x59374c[_0x75be('0x15')]?_0x59374c[_0x75be('0x15')][_0x75be('0x18')]||null:null})['then'](function(_0x327273){logger[_0x75be('0xa')](_0x75be('0x1c'),_0x59374c);logger[_0x75be('0xd')](_0x75be('0x1c'),_0x59374c,JSON[_0x75be('0x21')](_0x327273));_0x9224b8(_0x327273);})[_0x75be('0x12')](function(_0x552675){logger['error']('UpdateCmHopperBlack',_0x552675[_0x75be('0x10')],_0x59374c);_0x43cfaf(_0x513fd7[_0x75be('0xe')](0x1f4,_0x552675[_0x75be('0x10')]));});});};exports[_0x75be('0x22')]=function(_0x3ecd46){var _0x203a6a=this;return new Promise(function(_0x3e0d08,_0x5c2845){return db[_0x75be('0x1d')][_0x75be('0x23')]({'where':_0x3ecd46['options']?_0x3ecd46[_0x75be('0x15')]['where']||null:null})[_0x75be('0x9')](function(_0x3e38a8){logger[_0x75be('0xa')](_0x75be('0x22'),_0x3ecd46);logger[_0x75be('0xd')](_0x75be('0x22'),_0x3ecd46,JSON['stringify'](_0x3e38a8));_0x3e0d08(_0x3e38a8);})['catch'](function(_0x4ca2d7){logger[_0x75be('0xe')](_0x75be('0x22'),_0x4ca2d7[_0x75be('0x10')],_0x3ecd46);_0x5c2845(_0x203a6a[_0x75be('0xe')](0x1f4,_0x4ca2d7[_0x75be('0x10')]));});});}; \ No newline at end of file +var _0xb7a0=['DestroyCmHopperBlack','destroy','lodash','util','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetCmHopperBlack','findAll','raw','options','where','attributes','include','model','UpdateCmHopperBlack','update','body','limit','catch'];(function(_0x469852,_0x532e8c){var _0xa844b9=function(_0x511046){while(--_0x511046){_0x469852['push'](_0x469852['shift']());}};_0xa844b9(++_0x532e8c);}(_0xb7a0,0x12a));var _0x0b7a=function(_0x1dbb2d,_0x3ed3ab){_0x1dbb2d=_0x1dbb2d-0x0;var _0x5e3156=_0xb7a0[_0x1dbb2d];return _0x5e3156;};'use strict';var _=require(_0x0b7a('0x0'));var util=require(_0x0b7a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0b7a('0x2'));var fs=require('fs');var Redis=require(_0x0b7a('0x3'));var db=require(_0x0b7a('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0b7a('0x5'));var config=require(_0x0b7a('0x6'));var jayson=require(_0x0b7a('0x7'));var client=jayson[_0x0b7a('0x8')][_0x0b7a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3104fb,_0x4037c7,_0xbee3){return new BPromise(function(_0x4c0a13,_0x5b72cd){return client[_0x0b7a('0xa')](_0x3104fb,_0xbee3)[_0x0b7a('0xb')](function(_0x13ab5e){logger[_0x0b7a('0xc')](_0x0b7a('0xd'),_0x4037c7,_0x0b7a('0xe'));logger[_0x0b7a('0xf')](_0x0b7a('0x10'),_0x4037c7,_0x0b7a('0xe'),JSON[_0x0b7a('0x11')](_0x13ab5e));if(_0x13ab5e[_0x0b7a('0x12')]){if(_0x13ab5e[_0x0b7a('0x12')][_0x0b7a('0x13')]===0x1f4){logger[_0x0b7a('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0x4037c7,_0x13ab5e[_0x0b7a('0x12')][_0x0b7a('0x14')]);return _0x5b72cd(_0x13ab5e['error'][_0x0b7a('0x14')]);}logger[_0x0b7a('0x12')](_0x0b7a('0xd'),_0x4037c7,_0x13ab5e[_0x0b7a('0x12')][_0x0b7a('0x14')]);return _0x4c0a13(_0x13ab5e['error'][_0x0b7a('0x14')]);}else{logger[_0x0b7a('0xc')](_0x0b7a('0xd'),_0x4037c7,_0x0b7a('0xe'));_0x4c0a13(_0x13ab5e[_0x0b7a('0x15')][_0x0b7a('0x14')]);}})['catch'](function(_0x2b634d){logger[_0x0b7a('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0x4037c7,_0x2b634d);_0x5b72cd(_0x2b634d);});});}exports[_0x0b7a('0x16')]=function(_0x186a17){var _0x93d39d=this;return new Promise(function(_0x266a3c,_0x13893a){return db['CmHopperBlack'][_0x0b7a('0x17')]({'raw':_0x186a17['options']?_0x186a17['options'][_0x0b7a('0x18')]===undefined?!![]:![]:!![],'where':_0x186a17[_0x0b7a('0x19')]?_0x186a17[_0x0b7a('0x19')][_0x0b7a('0x1a')]||null:null,'attributes':_0x186a17[_0x0b7a('0x19')]?_0x186a17[_0x0b7a('0x19')][_0x0b7a('0x1b')]||null:null,'limit':_0x186a17['options']?_0x186a17[_0x0b7a('0x19')]['limit']||null:null,'include':_0x186a17[_0x0b7a('0x19')]?_0x186a17['options'][_0x0b7a('0x1c')]?_['map'](_0x186a17[_0x0b7a('0x19')][_0x0b7a('0x1c')],function(_0x5b7aed){return{'model':db[_0x5b7aed[_0x0b7a('0x1d')]],'as':_0x5b7aed['as'],'attributes':_0x5b7aed[_0x0b7a('0x1b')],'include':_0x5b7aed[_0x0b7a('0x1c')]?_['map'](_0x5b7aed[_0x0b7a('0x1c')],function(_0x36ad2a){return{'model':db[_0x36ad2a[_0x0b7a('0x1d')]],'as':_0x36ad2a['as'],'attributes':_0x36ad2a[_0x0b7a('0x1b')],'include':_0x36ad2a['include']?_['map'](_0x36ad2a[_0x0b7a('0x1c')],function(_0x7abd8f){return{'model':db[_0x7abd8f[_0x0b7a('0x1d')]],'as':_0x7abd8f['as'],'attributes':_0x7abd8f[_0x0b7a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0b7a('0xb')](function(_0x2c0d62){logger['info'](_0x0b7a('0x16'),_0x186a17);logger[_0x0b7a('0xf')]('GetCmHopperBlack',_0x186a17,JSON['stringify'](_0x2c0d62));_0x266a3c(_0x2c0d62);})['catch'](function(_0x5c37bb){logger['error'](_0x0b7a('0x16'),_0x5c37bb[_0x0b7a('0x14')],_0x186a17);_0x13893a(_0x93d39d[_0x0b7a('0x12')](0x1f4,_0x5c37bb[_0x0b7a('0x14')]));});});};exports[_0x0b7a('0x1e')]=function(_0xf55f31){var _0xce75e7=this;return new Promise(function(_0x5a9312,_0x19a3ba){return db['CmHopperBlack'][_0x0b7a('0x1f')](_0xf55f31[_0x0b7a('0x20')],{'raw':_0xf55f31['options']?_0xf55f31[_0x0b7a('0x19')][_0x0b7a('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf55f31[_0x0b7a('0x19')]?_0xf55f31[_0x0b7a('0x19')]['where']||null:null,'attributes':_0xf55f31[_0x0b7a('0x19')]?_0xf55f31[_0x0b7a('0x19')][_0x0b7a('0x1b')]||null:null,'limit':_0xf55f31[_0x0b7a('0x19')]?_0xf55f31['options'][_0x0b7a('0x21')]||null:null})[_0x0b7a('0xb')](function(_0x30f0be){logger['info'](_0x0b7a('0x1e'),_0xf55f31);logger[_0x0b7a('0xf')](_0x0b7a('0x1e'),_0xf55f31,JSON[_0x0b7a('0x11')](_0x30f0be));_0x5a9312(_0x30f0be);})[_0x0b7a('0x22')](function(_0x5c90d2){logger[_0x0b7a('0x12')](_0x0b7a('0x1e'),_0x5c90d2[_0x0b7a('0x14')],_0xf55f31);_0x19a3ba(_0xce75e7[_0x0b7a('0x12')](0x1f4,_0x5c90d2[_0x0b7a('0x14')]));});});};exports[_0x0b7a('0x23')]=function(_0xa77feb){var _0x57936c=this;return new Promise(function(_0x134959,_0x50c677){return db['CmHopperBlack'][_0x0b7a('0x24')]({'where':_0xa77feb[_0x0b7a('0x19')]?_0xa77feb[_0x0b7a('0x19')][_0x0b7a('0x1a')]||null:null})[_0x0b7a('0xb')](function(_0x303fe4){logger[_0x0b7a('0xc')](_0x0b7a('0x23'),_0xa77feb);logger['debug'](_0x0b7a('0x23'),_0xa77feb,JSON[_0x0b7a('0x11')](_0x303fe4));_0x134959(_0x303fe4);})[_0x0b7a('0x22')](function(_0x19751a){logger[_0x0b7a('0x12')](_0x0b7a('0x23'),_0x19751a[_0x0b7a('0x14')],_0xa77feb);_0x50c677(_0x57936c['error'](0x1f4,_0x19751a[_0x0b7a('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index beb6e46..7cfb216 100644 --- a/server/api/cmHopperBlack/index.js +++ b/server/api/cmHopperBlack/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0f4d=['../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','/describe','describe','show','/:id','update','destroy','exports','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x3b3294,_0x579a24){var _0x3498bd=function(_0x4b4ccc){while(--_0x4b4ccc){_0x3b3294['push'](_0x3b3294['shift']());}};_0x3498bd(++_0x579a24);}(_0x0f4d,0x12c));var _0xd0f4=function(_0x489395,_0x39ec7e){_0x489395=_0x489395-0x0;var _0x8239b9=_0x0f4d[_0x489395];return _0x8239b9;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xd0f4('0x0'));var express=require('express');var router=express[_0xd0f4('0x1')]();var fs_extra=require(_0xd0f4('0x2'));var auth=require(_0xd0f4('0x3'));var interaction=require(_0xd0f4('0x4'));var config=require(_0xd0f4('0x5'));var controller=require(_0xd0f4('0x6'));router[_0xd0f4('0x7')]('/',auth[_0xd0f4('0x8')](),controller['index']);router[_0xd0f4('0x7')](_0xd0f4('0x9'),auth['isAuthenticated'](),controller[_0xd0f4('0xa')]);router[_0xd0f4('0x7')]('/:id',auth[_0xd0f4('0x8')](),controller[_0xd0f4('0xb')]);router['put'](_0xd0f4('0xc'),auth[_0xd0f4('0x8')](),controller[_0xd0f4('0xd')]);router['delete']('/:id',auth[_0xd0f4('0x8')](),controller[_0xd0f4('0xe')]);module[_0xd0f4('0xf')]=router; \ No newline at end of file +var _0x0295=['exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','put','update','delete','destroy'];(function(_0x36055a,_0x55613a){var _0x1eb71f=function(_0x489fc4){while(--_0x489fc4){_0x36055a['push'](_0x36055a['shift']());}};_0x1eb71f(++_0x55613a);}(_0x0295,0x1f0));var _0x5029=function(_0x5c9b55,_0x5befc4){_0x5c9b55=_0x5c9b55-0x0;var _0x113969=_0x0295[_0x5c9b55];return _0x113969;};'use strict';var multer=require(_0x5029('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5029('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5029('0x2'));var auth=require(_0x5029('0x3'));var interaction=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var controller=require(_0x5029('0x6'));router[_0x5029('0x7')]('/',auth[_0x5029('0x8')](),controller[_0x5029('0x9')]);router[_0x5029('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x5029('0x7')]('/:id',auth[_0x5029('0x8')](),controller['show']);router[_0x5029('0xa')]('/:id',auth[_0x5029('0x8')](),controller[_0x5029('0xb')]);router[_0x5029('0xc')]('/:id',auth[_0x5029('0x8')](),controller[_0x5029('0xd')]);module[_0x5029('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 5978491..3a1d6cf 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.attributes.js +++ b/server/api/cmHopperFinal/cmHopperFinal.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x860f=['INTEGER','STRING','DATE','endtime','followuptime','diff','BOOLEAN','sequelize','moment','exports'];(function(_0x164dd3,_0xf6e7b4){var _0x21d35a=function(_0x279c53){while(--_0x279c53){_0x164dd3['push'](_0x164dd3['shift']());}};_0x21d35a(++_0xf6e7b4);}(_0x860f,0x1dd));var _0xf860=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x860f[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0xf860('0x0'));var moment=require(_0xf860('0x1'));module[_0xf860('0x2')]={'state':{'type':Sequelize[_0xf860('0x3')](0x2)},'statedesc':{'type':Sequelize[_0xf860('0x4')]},'scheduledat':{'type':Sequelize[_0xf860('0x5')]},'countbusyretry':{'type':Sequelize[_0xf860('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xf860('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xf860('0x4')]},'originatecalleridname':{'type':Sequelize[_0xf860('0x4')]},'calleridnum':{'type':Sequelize[_0xf860('0x4')]},'calleridname':{'type':Sequelize[_0xf860('0x4')]},'starttime':{'type':Sequelize[_0xf860('0x5')]},'responsetime':{'type':Sequelize[_0xf860('0x5')]},'answertime':{'type':Sequelize[_0xf860('0x5')]},'droptime':{'type':Sequelize[_0xf860('0x5')]},'endtime':{'type':Sequelize[_0xf860('0x5')]},'ringtime':{'type':Sequelize[_0xf860('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xf860('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xf860('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xf860('0x4')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xf860('0x4')]},'membername':{'type':Sequelize[_0xf860('0x4')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xf860('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xf860('0x4')]},'dispositionat':{'type':Sequelize[_0xf860('0x5')],'set':function(_0x591e60){var _0x48c194=this['getDataValue'](_0xf860('0x6'));if(_0x48c194&&_0x591e60){this['setDataValue'](_0xf860('0x7'),moment(_0x591e60)[_0xf860('0x8')](moment(_0x48c194),'seconds'));}}},'amd':{'type':Sequelize[_0xf860('0x9')],'defaultValue':![]},'fax':{'type':Sequelize[_0xf860('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xf860('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xf860('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xf860('0x5')]},'callback':{'type':Sequelize[_0xf860('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xf860('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xf860('0x5')]},'deleted':{'type':Sequelize[_0xf860('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xf860('0x5')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xf860('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0xf860('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xf860('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xf860('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xf860('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xdb19=['moment','exports','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue','diff','seconds','BOOLEAN','sequelize'];(function(_0x5d8018,_0x588592){var _0x151ac4=function(_0x548679){while(--_0x548679){_0x5d8018['push'](_0x5d8018['shift']());}};_0x151ac4(++_0x588592);}(_0xdb19,0x83));var _0x9db1=function(_0x585523,_0x33d12e){_0x585523=_0x585523-0x0;var _0x33d68f=_0xdb19[_0x585523];return _0x33d68f;};'use strict';var Sequelize=require(_0x9db1('0x0'));var moment=require(_0x9db1('0x1'));module[_0x9db1('0x2')]={'state':{'type':Sequelize[_0x9db1('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x9db1('0x4')]},'scheduledat':{'type':Sequelize[_0x9db1('0x5')]},'countbusyretry':{'type':Sequelize[_0x9db1('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9db1('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x9db1('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x9db1('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x9db1('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x9db1('0x4')]},'originatecalleridname':{'type':Sequelize[_0x9db1('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x9db1('0x4')]},'starttime':{'type':Sequelize[_0x9db1('0x5')]},'responsetime':{'type':Sequelize[_0x9db1('0x5')]},'answertime':{'type':Sequelize[_0x9db1('0x5')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x9db1('0x5')]},'ringtime':{'type':Sequelize[_0x9db1('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x9db1('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x9db1('0x4')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x9db1('0x4')]},'membername':{'type':Sequelize[_0x9db1('0x4')]},'reason':{'type':Sequelize[_0x9db1('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x9db1('0x4')]},'thirdDisposition':{'type':Sequelize[_0x9db1('0x4')]},'dispositionat':{'type':Sequelize[_0x9db1('0x5')],'set':function(_0x108126){var _0x285a75=this[_0x9db1('0x6')](_0x9db1('0x7'));if(_0x285a75&&_0x108126){this[_0x9db1('0x8')]('followuptime',moment(_0x108126)[_0x9db1('0x9')](moment(_0x285a75),_0x9db1('0xa')));}}},'amd':{'type':Sequelize[_0x9db1('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0x9db1('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x9db1('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x9db1('0x5')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x9db1('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x9db1('0x5')]},'deleted':{'type':Sequelize[_0x9db1('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x9db1('0x5')]},'recallme':{'type':Sequelize[_0x9db1('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x9db1('0x5')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x9db1('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x9db1('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9db1('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 012410e..b61e335 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.controller.js +++ b/server/api/cmHopperFinal/cmHopperFinal.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5496=['set','Content-Range','apply','reject','save','update','then','error','stack','name','index','CmHopperFinal','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','rows','catch','show','params','keys','fields','include','options','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','findAll','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','COUNT','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','dropContacts','abandonedContacts','reCallContacts','answeringMachine','into','cm_hopper','fromQuery','ListId','VoiceQueueId','createdAt','field','phone','NOW()','scheduledAt','ANY_VALUE(ContactId)','ContactId','ANY_VALUE(ListId)','updatedAt','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','from','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','CampaignId','ANY_VALUE(calleridnum)','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count'];(function(_0x6ed917,_0x5f2cba){var _0x5a8e26=function(_0x5dd1d8){while(--_0x5dd1d8){_0x6ed917['push'](_0x6ed917['shift']());}};_0x5a8e26(++_0x5f2cba);}(_0x5496,0x175));var _0x6549=function(_0x19a210,_0x398375){_0x19a210=_0x19a210-0x0;var _0x345ca6=_0x5496[_0x19a210];return _0x345ca6;};'use strict';var emlformat=require(_0x6549('0x0'));var rimraf=require(_0x6549('0x1'));var zipdir=require(_0x6549('0x2'));var jsonpatch=require(_0x6549('0x3'));var rp=require(_0x6549('0x4'));var moment=require('moment');var BPromise=require(_0x6549('0x5'));var Mustache=require('mustache');var util=require(_0x6549('0x6'));var path=require(_0x6549('0x7'));var sox=require(_0x6549('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6549('0x9'));var _=require(_0x6549('0xa'));var squel=require('squel');var crypto=require(_0x6549('0xb'));var jsforce=require(_0x6549('0xc'));var deskjs=require(_0x6549('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6549('0xe'));var Papa=require(_0x6549('0xf'));var Redis=require(_0x6549('0x10'));var authService=require(_0x6549('0x11'));var qs=require(_0x6549('0x12'));var as=require(_0x6549('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6549('0x14'));var utils=require(_0x6549('0x15'));var config=require(_0x6549('0x16'));var licenseUtil=require(_0x6549('0x17'));var db=require(_0x6549('0x18'))['db'];function respondWithStatusCode(_0x5bc018,_0x4dfb06){_0x4dfb06=_0x4dfb06||0xcc;return function(_0x3f844f){if(_0x3f844f){return _0x5bc018[_0x6549('0x19')](_0x4dfb06);}return _0x5bc018['status'](_0x4dfb06)[_0x6549('0x1a')]();};}function respondWithResult(_0x150fc8,_0x195d25){_0x195d25=_0x195d25||0xc8;return function(_0x12b068){if(_0x12b068){return _0x150fc8[_0x6549('0x1b')](_0x195d25)[_0x6549('0x1c')](_0x12b068);}};}function respondWithFilteredResult(_0x55c112,_0x5db86d){return function(_0x384f75){if(_0x384f75){var _0x25da29=typeof _0x5db86d['offset']===_0x6549('0x1d')&&typeof _0x5db86d[_0x6549('0x1e')]===_0x6549('0x1d');var _0x387e60=_0x384f75[_0x6549('0x1f')];var _0x53b12b=_0x25da29?0x0:_0x5db86d['offset'];var _0x26a212=_0x25da29?_0x384f75['count']:_0x5db86d['offset']+_0x5db86d[_0x6549('0x1e')];var _0x1e5079;if(_0x26a212>=_0x387e60){_0x26a212=_0x387e60;_0x1e5079=0xc8;}else{_0x1e5079=0xce;}_0x55c112[_0x6549('0x1b')](_0x1e5079);return _0x55c112[_0x6549('0x20')](_0x6549('0x21'),_0x53b12b+'-'+_0x26a212+'/'+_0x387e60)['json'](_0x384f75);}return null;};}function patchUpdates(_0x228117){return function(_0x4b40c1){try{jsonpatch[_0x6549('0x22')](_0x4b40c1,_0x228117,!![]);}catch(_0x72322b){return BPromise[_0x6549('0x23')](_0x72322b);}return _0x4b40c1[_0x6549('0x24')]();};}function saveUpdates(_0x22bcf8,_0x12d547){return function(_0x427b47){if(_0x427b47){return _0x427b47[_0x6549('0x25')](_0x22bcf8)[_0x6549('0x26')](function(_0x6ae00c){return _0x6ae00c;});}return null;};}function removeEntity(_0x40d3f9,_0x1fbfa4){return function(_0x23c0ba){if(_0x23c0ba){return _0x23c0ba['destroy']()[_0x6549('0x26')](function(){_0x40d3f9[_0x6549('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x126967,_0x29f89e){return function(_0x3768cb){if(!_0x3768cb){_0x126967['sendStatus'](0x194);}return _0x3768cb;};}function handleError(_0x31a95,_0xfb51a1){_0xfb51a1=_0xfb51a1||0x1f4;return function(_0x14de1f){logger[_0x6549('0x27')](_0x14de1f[_0x6549('0x28')]);if(_0x14de1f[_0x6549('0x29')]){delete _0x14de1f[_0x6549('0x29')];}_0x31a95[_0x6549('0x1b')](_0xfb51a1)['send'](_0x14de1f);};}exports[_0x6549('0x2a')]=function(_0x136518,_0x17fdfb){var _0x4c605c={},_0x3f1502={},_0x4acaf5={'count':0x0,'rows':[]};var _0x4f0ad1=_['map'](db[_0x6549('0x2b')][_0x6549('0x2c')],function(_0x4f3069){return{'name':_0x4f3069[_0x6549('0x2d')],'type':_0x4f3069[_0x6549('0x2e')][_0x6549('0x2f')]};});_0x3f1502[_0x6549('0x30')]=_[_0x6549('0x31')](_0x4f0ad1,_0x6549('0x29'));_0x3f1502[_0x6549('0x32')]=_['keys'](_0x136518[_0x6549('0x32')]);_0x3f1502[_0x6549('0x33')]=_[_0x6549('0x34')](_0x3f1502[_0x6549('0x30')],_0x3f1502[_0x6549('0x32')]);_0x4c605c[_0x6549('0x35')]=_['intersection'](_0x3f1502[_0x6549('0x30')],qs['fields'](_0x136518[_0x6549('0x32')]['fields']));_0x4c605c[_0x6549('0x35')]=_0x4c605c[_0x6549('0x35')][_0x6549('0x36')]?_0x4c605c['attributes']:_0x3f1502[_0x6549('0x30')];if(!_0x136518[_0x6549('0x32')][_0x6549('0x37')](_0x6549('0x38'))){_0x4c605c['limit']=qs['limit'](_0x136518['query'][_0x6549('0x1e')]);_0x4c605c[_0x6549('0x39')]=qs['offset'](_0x136518[_0x6549('0x32')][_0x6549('0x39')]);}_0x4c605c[_0x6549('0x3a')]=qs[_0x6549('0x3b')](_0x136518[_0x6549('0x32')]['sort']);_0x4c605c['where']=qs[_0x6549('0x33')](_[_0x6549('0x3c')](_0x136518[_0x6549('0x32')],_0x3f1502[_0x6549('0x33')]),_0x4f0ad1);if(_0x136518[_0x6549('0x32')][_0x6549('0x3d')]){_0x4c605c[_0x6549('0x3e')]=_[_0x6549('0x3f')](_0x4c605c[_0x6549('0x3e')],{'$or':_[_0x6549('0x31')](_0x4f0ad1,function(_0x525f82){if(_0x525f82[_0x6549('0x2e')]!==_0x6549('0x40')){var _0x2ea977={};_0x2ea977[_0x525f82[_0x6549('0x29')]]={'$like':'%'+_0x136518[_0x6549('0x32')]['filter']+'%'};return _0x2ea977;}})});}_0x4c605c=_['merge']({},_0x4c605c,_0x136518['options']);var _0x22b919={'where':_0x4c605c[_0x6549('0x3e')]};return db[_0x6549('0x2b')][_0x6549('0x1f')](_0x22b919)['then'](function(_0x56ce9f){_0x4acaf5[_0x6549('0x1f')]=_0x56ce9f;if(_0x136518[_0x6549('0x32')][_0x6549('0x41')]){_0x4c605c['include']=[{'all':!![]}];}return db[_0x6549('0x2b')]['findAll'](_0x4c605c);})[_0x6549('0x26')](function(_0x2ec614){_0x4acaf5[_0x6549('0x42')]=_0x2ec614;return _0x4acaf5;})[_0x6549('0x26')](respondWithFilteredResult(_0x17fdfb,_0x4c605c))[_0x6549('0x43')](handleError(_0x17fdfb,null));};exports[_0x6549('0x44')]=function(_0xbbfdc9,_0x4deaab){var _0x132625={'raw':!![],'where':{'id':_0xbbfdc9[_0x6549('0x45')]['id']}},_0x309f45={};_0x309f45[_0x6549('0x30')]=_[_0x6549('0x46')](db[_0x6549('0x2b')][_0x6549('0x2c')]);_0x309f45[_0x6549('0x32')]=_[_0x6549('0x46')](_0xbbfdc9[_0x6549('0x32')]);_0x309f45[_0x6549('0x33')]=_[_0x6549('0x34')](_0x309f45[_0x6549('0x30')],_0x309f45[_0x6549('0x32')]);_0x132625[_0x6549('0x35')]=_[_0x6549('0x34')](_0x309f45['model'],qs[_0x6549('0x47')](_0xbbfdc9[_0x6549('0x32')][_0x6549('0x47')]));_0x132625[_0x6549('0x35')]=_0x132625['attributes'][_0x6549('0x36')]?_0x132625['attributes']:_0x309f45[_0x6549('0x30')];if(_0xbbfdc9[_0x6549('0x32')]['includeAll']){_0x132625[_0x6549('0x48')]=[{'all':!![]}];}_0x132625=_[_0x6549('0x3f')]({},_0x132625,_0xbbfdc9[_0x6549('0x49')]);return db[_0x6549('0x2b')][_0x6549('0x4a')](_0x132625)['then'](handleEntityNotFound(_0x4deaab,null))['then'](respondWithResult(_0x4deaab,null))[_0x6549('0x43')](handleError(_0x4deaab,null));};exports[_0x6549('0x4b')]=function(_0x41d675,_0x1712f3){return db[_0x6549('0x2b')]['describe']()[_0x6549('0x26')](respondWithResult(_0x1712f3,null))[_0x6549('0x43')](handleError(_0x1712f3,null));};exports[_0x6549('0x25')]=function(_0x6121af,_0xa4c650){if(_0x6121af[_0x6549('0x4c')][_0x6549('0x4d')]){delete _0x6121af[_0x6549('0x4c')]['uniqueid'];}return db[_0x6549('0x2b')]['find']({'where':{'uniqueid':_0x6121af[_0x6549('0x45')]['id']}})[_0x6549('0x26')](handleEntityNotFound(_0xa4c650,null))[_0x6549('0x26')](saveUpdates(_0x6121af['body'],null))[_0x6549('0x26')](respondWithResult(_0xa4c650,null))[_0x6549('0x43')](handleError(_0xa4c650,null));};exports[_0x6549('0x4e')]=function(_0x5300c8,_0x19ac50,_0x17d7ce){return db[_0x6549('0x2b')][_0x6549('0x4f')]({'raw':![],'where':{'VoiceQueueId':_0x5300c8[_0x6549('0x45')]['id']},'attributes':[[db[_0x6549('0x50')]['fn']('COUNT',db[_0x6549('0x50')]['fn']('IF',db['sequelize'][_0x6549('0x51')](_0x6549('0x52')))),_0x6549('0x53')],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db[_0x6549('0x50')]['fn']('IF',db[_0x6549('0x50')][_0x6549('0x51')](_0x6549('0x55')))),_0x6549('0x56')],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db['sequelize']['fn']('IF',db[_0x6549('0x50')][_0x6549('0x51')](_0x6549('0x57')))),_0x6549('0x58')],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db[_0x6549('0x50')]['fn']('IF',db[_0x6549('0x50')]['literal'](_0x6549('0x59')))),_0x6549('0x5a')],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db[_0x6549('0x50')]['fn']('IF',db[_0x6549('0x50')][_0x6549('0x51')](_0x6549('0x5b')))),'dropContacts'],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db[_0x6549('0x50')]['fn']('IF',db[_0x6549('0x50')][_0x6549('0x51')](_0x6549('0x5c')))),'abandonedContacts'],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db['sequelize']['fn']('IF',db[_0x6549('0x50')][_0x6549('0x51')](_0x6549('0x5d')))),'reCallContacts'],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db['sequelize']['fn']('IF',db[_0x6549('0x50')]['literal'](_0x6549('0x5e')))),'answeringMachine']]})[_0x6549('0x26')](handleEntityNotFound(_0x19ac50,null))[_0x6549('0x26')](respondWithResult(_0x19ac50,null))[_0x6549('0x43')](handleError(_0x19ac50,null));};exports[_0x6549('0x5f')]=function(_0x2da535,_0x45eb28,_0x3b01d9){return db[_0x6549('0x2b')][_0x6549('0x4f')]({'raw':![],'where':{'CampaignId':_0x2da535[_0x6549('0x45')]['id']},'attributes':[[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db[_0x6549('0x50')]['fn']('IF',db[_0x6549('0x50')]['literal'](_0x6549('0x52')))),_0x6549('0x53')],[db['sequelize']['fn'](_0x6549('0x54'),db[_0x6549('0x50')]['fn']('IF',db[_0x6549('0x50')][_0x6549('0x51')]('`state`\x20=\x203,\x201,\x20null'))),_0x6549('0x56')],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db[_0x6549('0x50')]['fn']('IF',db['sequelize'][_0x6549('0x51')]('`state`\x20=\x205,\x201,\x20null'))),_0x6549('0x58')],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db[_0x6549('0x50')]['fn']('IF',db[_0x6549('0x50')][_0x6549('0x51')](_0x6549('0x59')))),_0x6549('0x5a')],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db['sequelize']['fn']('IF',db[_0x6549('0x50')][_0x6549('0x51')](_0x6549('0x5b')))),_0x6549('0x60')],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db['sequelize']['fn']('IF',db['sequelize'][_0x6549('0x51')](_0x6549('0x5c')))),_0x6549('0x61')],[db['sequelize']['fn'](_0x6549('0x54'),db[_0x6549('0x50')]['fn']('IF',db['sequelize'][_0x6549('0x51')](_0x6549('0x5d')))),_0x6549('0x62')],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db[_0x6549('0x50')]['fn']('IF',db[_0x6549('0x50')][_0x6549('0x51')]('`state`\x20=\x2019,\x201,\x20null'))),_0x6549('0x63')]]})['then'](handleEntityNotFound(_0x45eb28,null))[_0x6549('0x26')](respondWithResult(_0x45eb28,null))[_0x6549('0x43')](handleError(_0x45eb28,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x372b67,_0x2c00a1,_0x2e6b4b){return db['VoiceQueue'][_0x6549('0x4a')]({'where':{'id':_0x372b67[_0x6549('0x45')]['id']}})[_0x6549('0x26')](handleEntityNotFound(_0x2c00a1,null))[_0x6549('0x26')](function(_0x15b906){var _0x34c5f9;if(_0x15b906){_0x34c5f9=squel['insert']()[_0x6549('0x64')](_0x6549('0x65'))[_0x6549('0x66')](['phone','scheduledAt','ContactId',_0x6549('0x67'),_0x6549('0x68'),_0x6549('0x69'),'updatedAt'],squel['select']()[_0x6549('0x6a')]('ANY_VALUE(calleridnum)',_0x6549('0x6b'))[_0x6549('0x6a')](_0x6549('0x6c'),_0x6549('0x6d'))[_0x6549('0x6a')](_0x6549('0x6e'),_0x6549('0x6f'))['field'](_0x6549('0x70'),_0x6549('0x67'))[_0x6549('0x6a')]('ANY_VALUE(VoiceQueueId)',_0x6549('0x68'))[_0x6549('0x6a')](_0x6549('0x6c'),_0x6549('0x69'))[_0x6549('0x6a')](_0x6549('0x6c'),_0x6549('0x71'))['from'](_0x6549('0x72'))['where'](_0x6549('0x73'),_0x372b67[_0x6549('0x45')]['id'][_0x6549('0x74')]())[_0x6549('0x3e')](_0x6549('0x75'),_0x372b67[_0x6549('0x4c')][_0x6549('0x76')][_0x6549('0x74')]())['where'](_0x6549('0x77'))[_0x6549('0x3e')](_0x6549('0x78'),squel[_0x6549('0x79')]()[_0x6549('0x6a')](_0x6549('0x6b'))[_0x6549('0x7a')](_0x6549('0x65'))[_0x6549('0x3e')](_0x6549('0x73'),_0x372b67['params']['id'][_0x6549('0x74')]()))[_0x6549('0x3e')](_0x6549('0x78'),squel[_0x6549('0x79')]()[_0x6549('0x6a')](_0x6549('0x7b'))[_0x6549('0x7a')](_0x6549('0x72'))[_0x6549('0x3e')](_0x6549('0x73'),_0x372b67[_0x6549('0x45')]['id'][_0x6549('0x74')]())[_0x6549('0x3e')](_0x6549('0x7c')))[_0x6549('0x7d')](_0x6549('0x6f')))[_0x6549('0x74')]();return db[_0x6549('0x50')]['query'](_0x34c5f9);}return[];})[_0x6549('0x26')](respondWithResult(_0x2c00a1,null))[_0x6549('0x43')](handleError(_0x2c00a1,null));};exports[_0x6549('0x7e')]=function(_0x35bad6,_0x371d8a,_0xfde69e){return db[_0x6549('0x7f')][_0x6549('0x4a')]({'where':{'id':_0x35bad6[_0x6549('0x45')]['id']}})[_0x6549('0x26')](handleEntityNotFound(_0x371d8a,null))[_0x6549('0x26')](function(_0x1da2d7){var _0x348d55;if(_0x1da2d7){_0x348d55=squel[_0x6549('0x80')]()[_0x6549('0x64')](_0x6549('0x65'))[_0x6549('0x66')](['phone',_0x6549('0x6d'),_0x6549('0x6f'),_0x6549('0x67'),_0x6549('0x81'),_0x6549('0x69'),_0x6549('0x71')],squel[_0x6549('0x79')]()['field'](_0x6549('0x82'),'phone')['field'](_0x6549('0x6c'),'scheduledAt')[_0x6549('0x6a')](_0x6549('0x6e'),_0x6549('0x6f'))[_0x6549('0x6a')](_0x6549('0x70'),'ListId')[_0x6549('0x6a')]('ANY_VALUE(CampaignId)',_0x6549('0x81'))[_0x6549('0x6a')](_0x6549('0x6c'),'createdAt')[_0x6549('0x6a')](_0x6549('0x6c'),'updatedAt')['from'](_0x6549('0x72'))[_0x6549('0x3e')](_0x6549('0x83'),_0x35bad6[_0x6549('0x45')]['id'][_0x6549('0x74')]())[_0x6549('0x3e')](_0x6549('0x75'),_0x35bad6[_0x6549('0x4c')][_0x6549('0x76')][_0x6549('0x74')]())[_0x6549('0x3e')](_0x6549('0x77'))[_0x6549('0x3e')](_0x6549('0x78'),squel[_0x6549('0x79')]()[_0x6549('0x6a')](_0x6549('0x6b'))[_0x6549('0x7a')](_0x6549('0x65'))['where']('CampaignId\x20=\x20?',_0x35bad6[_0x6549('0x45')]['id'][_0x6549('0x74')]()))[_0x6549('0x3e')](_0x6549('0x78'),squel[_0x6549('0x79')]()[_0x6549('0x6a')](_0x6549('0x7b'))[_0x6549('0x7a')](_0x6549('0x72'))[_0x6549('0x3e')]('CampaignId\x20=\x20?',_0x35bad6['params']['id']['toString']())[_0x6549('0x3e')](_0x6549('0x7c')))[_0x6549('0x7d')](_0x6549('0x6f')))[_0x6549('0x74')]();return db['sequelize'][_0x6549('0x32')](_0x348d55);}return[];})[_0x6549('0x26')](respondWithResult(_0x371d8a,null))[_0x6549('0x43')](handleError(_0x371d8a,null));};exports[_0x6549('0x84')]=function(_0x230874,_0x3be369,_0xaf1a80){return db[_0x6549('0x85')][_0x6549('0x86')]({'where':{'VoiceQueueId':_0x230874[_0x6549('0x4c')][_0x6549('0x68')],'CampaignId':_0x230874['body'][_0x6549('0x81')],'ContactId':_0x230874[_0x6549('0x4c')][_0x6549('0x6f')]}})[_0x6549('0x26')](handleEntityNotFound(_0x3be369,null))['then'](function(_0x158c92){if(_0x158c92){return _0x158c92;}return null;})[_0x6549('0x26')](respondWithResult(_0x3be369,null))[_0x6549('0x43')](handleError(_0x3be369,null));}; \ No newline at end of file +var _0x187d=['state\x20=\x20?','calleridnum\x20NOT\x20IN\x20(?)','select','from','cm_hopper','calleridnum','cm_hopper_final','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','insert','into','CampaignId','CampaignId\x20=\x20?','state','checkContactHopper','CmHopper','findOne','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','update','destroy','error','stack','name','index','map','CmHopperFinal','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','where','filter','merge','includeAll','include','findAll','then','rows','catch','show','params','fields','options','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','COUNT','sequelize','literal','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','VoiceQueueId\x20=\x20?','toString'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x187d,0x93));var _0xd187=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0x187d[_0x2cf2e9];return _0xd3670d;};'use strict';var emlformat=require(_0xd187('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd187('0x1'));var jsonpatch=require(_0xd187('0x2'));var rp=require(_0xd187('0x3'));var moment=require(_0xd187('0x4'));var BPromise=require(_0xd187('0x5'));var Mustache=require(_0xd187('0x6'));var util=require('util');var path=require(_0xd187('0x7'));var sox=require(_0xd187('0x8'));var csv=require('to-csv');var ejs=require(_0xd187('0x9'));var fs=require('fs');var fs_extra=require(_0xd187('0xa'));var _=require(_0xd187('0xb'));var squel=require(_0xd187('0xc'));var crypto=require(_0xd187('0xd'));var jsforce=require(_0xd187('0xe'));var deskjs=require(_0xd187('0xf'));var toCsv=require(_0xd187('0x10'));var querystring=require('querystring');var Papa=require(_0xd187('0x11'));var Redis=require(_0xd187('0x12'));var authService=require(_0xd187('0x13'));var qs=require(_0xd187('0x14'));var as=require(_0xd187('0x15'));var hardwareService=require(_0xd187('0x16'));var logger=require('../../config/logger')(_0xd187('0x17'));var utils=require(_0xd187('0x18'));var config=require(_0xd187('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd187('0x1a'))['db'];function respondWithStatusCode(_0x4545cf,_0x32ba07){_0x32ba07=_0x32ba07||0xcc;return function(_0x59ee4a){if(_0x59ee4a){return _0x4545cf[_0xd187('0x1b')](_0x32ba07);}return _0x4545cf[_0xd187('0x1c')](_0x32ba07)[_0xd187('0x1d')]();};}function respondWithResult(_0x126d1a,_0x517b25){_0x517b25=_0x517b25||0xc8;return function(_0x39a927){if(_0x39a927){return _0x126d1a[_0xd187('0x1c')](_0x517b25)[_0xd187('0x1e')](_0x39a927);}};}function respondWithFilteredResult(_0x188cfe,_0x4c8f68){return function(_0x245d3e){if(_0x245d3e){var _0x52a208=typeof _0x4c8f68['offset']===_0xd187('0x1f')&&typeof _0x4c8f68['limit']==='undefined';var _0x207b36=_0x245d3e[_0xd187('0x20')];var _0x374fe0=_0x52a208?0x0:_0x4c8f68[_0xd187('0x21')];var _0x21df74=_0x52a208?_0x245d3e[_0xd187('0x20')]:_0x4c8f68[_0xd187('0x21')]+_0x4c8f68[_0xd187('0x22')];var _0x4f2f88;if(_0x21df74>=_0x207b36){_0x21df74=_0x207b36;_0x4f2f88=0xc8;}else{_0x4f2f88=0xce;}_0x188cfe[_0xd187('0x1c')](_0x4f2f88);return _0x188cfe[_0xd187('0x23')](_0xd187('0x24'),_0x374fe0+'-'+_0x21df74+'/'+_0x207b36)[_0xd187('0x1e')](_0x245d3e);}return null;};}function patchUpdates(_0x5204ee){return function(_0x2f7fb3){try{jsonpatch[_0xd187('0x25')](_0x2f7fb3,_0x5204ee,!![]);}catch(_0xc5bba5){return BPromise['reject'](_0xc5bba5);}return _0x2f7fb3['save']();};}function saveUpdates(_0x57cf1d,_0x435d94){return function(_0x33741d){if(_0x33741d){return _0x33741d[_0xd187('0x26')](_0x57cf1d)['then'](function(_0x2c07c8){return _0x2c07c8;});}return null;};}function removeEntity(_0x57186b,_0x145771){return function(_0x5a7a23){if(_0x5a7a23){return _0x5a7a23[_0xd187('0x27')]()['then'](function(){_0x57186b['status'](0xcc)[_0xd187('0x1d')]();});}};}function handleEntityNotFound(_0x4d992b,_0x12da33){return function(_0x598aa4){if(!_0x598aa4){_0x4d992b['sendStatus'](0x194);}return _0x598aa4;};}function handleError(_0x4eac6a,_0x848ddd){_0x848ddd=_0x848ddd||0x1f4;return function(_0xeff822){logger[_0xd187('0x28')](_0xeff822[_0xd187('0x29')]);if(_0xeff822['name']){delete _0xeff822[_0xd187('0x2a')];}_0x4eac6a[_0xd187('0x1c')](_0x848ddd)['send'](_0xeff822);};}exports[_0xd187('0x2b')]=function(_0x1c87ee,_0x34febe){var _0x4c50a5={},_0x15e2e8={},_0x56e292={'count':0x0,'rows':[]};var _0x263e31=_[_0xd187('0x2c')](db[_0xd187('0x2d')][_0xd187('0x2e')],function(_0x489f2e){return{'name':_0x489f2e[_0xd187('0x2f')],'type':_0x489f2e[_0xd187('0x30')]['key']};});_0x15e2e8['model']=_[_0xd187('0x2c')](_0x263e31,_0xd187('0x2a'));_0x15e2e8[_0xd187('0x31')]=_[_0xd187('0x32')](_0x1c87ee[_0xd187('0x31')]);_0x15e2e8[_0xd187('0x33')]=_[_0xd187('0x34')](_0x15e2e8[_0xd187('0x35')],_0x15e2e8['query']);_0x4c50a5[_0xd187('0x36')]=_[_0xd187('0x34')](_0x15e2e8[_0xd187('0x35')],qs['fields'](_0x1c87ee[_0xd187('0x31')]['fields']));_0x4c50a5[_0xd187('0x36')]=_0x4c50a5[_0xd187('0x36')][_0xd187('0x37')]?_0x4c50a5['attributes']:_0x15e2e8['model'];if(!_0x1c87ee[_0xd187('0x31')][_0xd187('0x38')]('nolimit')){_0x4c50a5[_0xd187('0x22')]=qs[_0xd187('0x22')](_0x1c87ee[_0xd187('0x31')]['limit']);_0x4c50a5['offset']=qs[_0xd187('0x21')](_0x1c87ee[_0xd187('0x31')]['offset']);}_0x4c50a5['order']=qs['sort'](_0x1c87ee[_0xd187('0x31')]['sort']);_0x4c50a5[_0xd187('0x39')]=qs[_0xd187('0x33')](_['pick'](_0x1c87ee[_0xd187('0x31')],_0x15e2e8['filters']),_0x263e31);if(_0x1c87ee[_0xd187('0x31')][_0xd187('0x3a')]){_0x4c50a5['where']=_[_0xd187('0x3b')](_0x4c50a5[_0xd187('0x39')],{'$or':_['map'](_0x263e31,function(_0x4399a5){if(_0x4399a5['type']!=='VIRTUAL'){var _0x26b06d={};_0x26b06d[_0x4399a5[_0xd187('0x2a')]]={'$like':'%'+_0x1c87ee[_0xd187('0x31')][_0xd187('0x3a')]+'%'};return _0x26b06d;}})});}_0x4c50a5=_[_0xd187('0x3b')]({},_0x4c50a5,_0x1c87ee['options']);var _0x8860c={'where':_0x4c50a5[_0xd187('0x39')]};return db[_0xd187('0x2d')]['count'](_0x8860c)['then'](function(_0x538c05){_0x56e292['count']=_0x538c05;if(_0x1c87ee[_0xd187('0x31')][_0xd187('0x3c')]){_0x4c50a5[_0xd187('0x3d')]=[{'all':!![]}];}return db[_0xd187('0x2d')][_0xd187('0x3e')](_0x4c50a5);})[_0xd187('0x3f')](function(_0x4699e1){_0x56e292[_0xd187('0x40')]=_0x4699e1;return _0x56e292;})['then'](respondWithFilteredResult(_0x34febe,_0x4c50a5))[_0xd187('0x41')](handleError(_0x34febe,null));};exports[_0xd187('0x42')]=function(_0x31d9d2,_0x51c7fc){var _0x21cbf6={'raw':!![],'where':{'id':_0x31d9d2[_0xd187('0x43')]['id']}},_0x48c100={};_0x48c100[_0xd187('0x35')]=_[_0xd187('0x32')](db[_0xd187('0x2d')][_0xd187('0x2e')]);_0x48c100['query']=_[_0xd187('0x32')](_0x31d9d2[_0xd187('0x31')]);_0x48c100[_0xd187('0x33')]=_[_0xd187('0x34')](_0x48c100['model'],_0x48c100[_0xd187('0x31')]);_0x21cbf6[_0xd187('0x36')]=_['intersection'](_0x48c100[_0xd187('0x35')],qs[_0xd187('0x44')](_0x31d9d2['query']['fields']));_0x21cbf6[_0xd187('0x36')]=_0x21cbf6[_0xd187('0x36')]['length']?_0x21cbf6['attributes']:_0x48c100['model'];if(_0x31d9d2[_0xd187('0x31')][_0xd187('0x3c')]){_0x21cbf6[_0xd187('0x3d')]=[{'all':!![]}];}_0x21cbf6=_[_0xd187('0x3b')]({},_0x21cbf6,_0x31d9d2[_0xd187('0x45')]);return db[_0xd187('0x2d')][_0xd187('0x46')](_0x21cbf6)['then'](handleEntityNotFound(_0x51c7fc,null))[_0xd187('0x3f')](respondWithResult(_0x51c7fc,null))[_0xd187('0x41')](handleError(_0x51c7fc,null));};exports[_0xd187('0x47')]=function(_0x3ce4a1,_0x3f5def){return db[_0xd187('0x2d')][_0xd187('0x47')]()[_0xd187('0x3f')](respondWithResult(_0x3f5def,null))['catch'](handleError(_0x3f5def,null));};exports[_0xd187('0x26')]=function(_0x2657be,_0x4523c8){if(_0x2657be[_0xd187('0x48')][_0xd187('0x49')]){delete _0x2657be['body'][_0xd187('0x49')];}return db[_0xd187('0x2d')]['find']({'where':{'uniqueid':_0x2657be[_0xd187('0x43')]['id']}})[_0xd187('0x3f')](handleEntityNotFound(_0x4523c8,null))['then'](saveUpdates(_0x2657be['body'],null))['then'](respondWithResult(_0x4523c8,null))['catch'](handleError(_0x4523c8,null));};exports[_0xd187('0x4a')]=function(_0x22f432,_0x12d448,_0x1bcc3a){return db[_0xd187('0x2d')][_0xd187('0x3e')]({'raw':![],'where':{'VoiceQueueId':_0x22f432[_0xd187('0x43')]['id']},'attributes':[[db['sequelize']['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')]('`state`\x20=\x200,\x201,\x20null'))),_0xd187('0x4e')],[db['sequelize']['fn']('COUNT',db[_0xd187('0x4c')]['fn']('IF',db['sequelize'][_0xd187('0x4d')](_0xd187('0x4f')))),_0xd187('0x50')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x51')))),'busyContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x52')))),'congestionContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xd187('0x53')],[db['sequelize']['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x54')))),_0xd187('0x55')],[db[_0xd187('0x4c')]['fn']('COUNT',db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')]('`state`\x20=\x2022,\x201,\x20null'))),_0xd187('0x56')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x57')))),_0xd187('0x58')]]})[_0xd187('0x3f')](handleEntityNotFound(_0x12d448,null))[_0xd187('0x3f')](respondWithResult(_0x12d448,null))[_0xd187('0x41')](handleError(_0x12d448,null));};exports[_0xd187('0x59')]=function(_0x23271b,_0x288a04,_0x39934c){return db[_0xd187('0x2d')][_0xd187('0x3e')]({'raw':![],'where':{'CampaignId':_0x23271b[_0xd187('0x43')]['id']},'attributes':[[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db[_0xd187('0x4c')]['literal'](_0xd187('0x5a')))),_0xd187('0x4e')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')]('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')]['literal'](_0xd187('0x51')))),'busyContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')]['literal'](_0xd187('0x52')))),_0xd187('0x5b')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db['sequelize']['literal'](_0xd187('0x5c')))),_0xd187('0x53')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x54')))),_0xd187('0x55')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db['sequelize'][_0xd187('0x4d')](_0xd187('0x5d')))),'reCallContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db['sequelize'][_0xd187('0x4d')](_0xd187('0x57')))),_0xd187('0x58')]]})[_0xd187('0x3f')](handleEntityNotFound(_0x288a04,null))['then'](respondWithResult(_0x288a04,null))[_0xd187('0x41')](handleError(_0x288a04,null));};exports[_0xd187('0x5e')]=function(_0x52e364,_0x569959,_0x3bca83){return db['VoiceQueue'][_0xd187('0x46')]({'where':{'id':_0x52e364[_0xd187('0x43')]['id']}})['then'](handleEntityNotFound(_0x569959,null))[_0xd187('0x3f')](function(_0x570c1c){var _0x317bc3;if(_0x570c1c){_0x317bc3=squel['insert']()['into']('cm_hopper')[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),_0xd187('0x62'),_0xd187('0x63'),_0xd187('0x64'),_0xd187('0x65'),_0xd187('0x66')],squel['select']()[_0xd187('0x67')](_0xd187('0x68'),_0xd187('0x60'))['field'](_0xd187('0x69'),_0xd187('0x61'))[_0xd187('0x67')](_0xd187('0x6a'),'ContactId')[_0xd187('0x67')](_0xd187('0x6b'),'ListId')[_0xd187('0x67')](_0xd187('0x6c'),_0xd187('0x64'))[_0xd187('0x67')]('NOW()',_0xd187('0x65'))[_0xd187('0x67')]('NOW()',_0xd187('0x66'))['from']('cm_hopper_final')['where'](_0xd187('0x6d'),_0x52e364[_0xd187('0x43')]['id'][_0xd187('0x6e')]())[_0xd187('0x39')](_0xd187('0x6f'),_0x52e364[_0xd187('0x48')]['state'][_0xd187('0x6e')]())[_0xd187('0x39')]('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0xd187('0x70'),squel[_0xd187('0x71')]()[_0xd187('0x67')](_0xd187('0x60'))[_0xd187('0x72')](_0xd187('0x73'))['where'](_0xd187('0x6d'),_0x52e364[_0xd187('0x43')]['id'][_0xd187('0x6e')]()))[_0xd187('0x39')](_0xd187('0x70'),squel[_0xd187('0x71')]()[_0xd187('0x67')](_0xd187('0x74'))[_0xd187('0x72')](_0xd187('0x75'))[_0xd187('0x39')](_0xd187('0x6d'),_0x52e364['params']['id']['toString']())[_0xd187('0x39')](_0xd187('0x76')))[_0xd187('0x77')](_0xd187('0x62')))[_0xd187('0x6e')]();return db[_0xd187('0x4c')]['query'](_0x317bc3);}return[];})[_0xd187('0x3f')](respondWithResult(_0x569959,null))['catch'](handleError(_0x569959,null));};exports[_0xd187('0x78')]=function(_0x520f86,_0x5cbfa6,_0x304117){return db['Campaign'][_0xd187('0x46')]({'where':{'id':_0x520f86[_0xd187('0x43')]['id']}})[_0xd187('0x3f')](handleEntityNotFound(_0x5cbfa6,null))[_0xd187('0x3f')](function(_0x1b93db){var _0x13a362;if(_0x1b93db){_0x13a362=squel[_0xd187('0x79')]()[_0xd187('0x7a')](_0xd187('0x73'))[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),_0xd187('0x62'),_0xd187('0x63'),_0xd187('0x7b'),'createdAt',_0xd187('0x66')],squel[_0xd187('0x71')]()[_0xd187('0x67')](_0xd187('0x68'),'phone')[_0xd187('0x67')](_0xd187('0x69'),'scheduledAt')['field'](_0xd187('0x6a'),_0xd187('0x62'))[_0xd187('0x67')](_0xd187('0x6b'),_0xd187('0x63'))[_0xd187('0x67')]('ANY_VALUE(CampaignId)',_0xd187('0x7b'))[_0xd187('0x67')]('NOW()',_0xd187('0x65'))[_0xd187('0x67')](_0xd187('0x69'),_0xd187('0x66'))['from']('cm_hopper_final')[_0xd187('0x39')](_0xd187('0x7c'),_0x520f86[_0xd187('0x43')]['id']['toString']())[_0xd187('0x39')](_0xd187('0x6f'),_0x520f86[_0xd187('0x48')][_0xd187('0x7d')]['toString']())[_0xd187('0x39')]('calleridnum\x20IS\x20NOT\x20NULL')['where']('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()['field']('phone')['from'](_0xd187('0x73'))[_0xd187('0x39')]('CampaignId\x20=\x20?',_0x520f86[_0xd187('0x43')]['id'][_0xd187('0x6e')]()))[_0xd187('0x39')](_0xd187('0x70'),squel[_0xd187('0x71')]()['field'](_0xd187('0x74'))['from'](_0xd187('0x75'))[_0xd187('0x39')](_0xd187('0x7c'),_0x520f86[_0xd187('0x43')]['id'][_0xd187('0x6e')]())[_0xd187('0x39')](_0xd187('0x76')))['group'](_0xd187('0x62')))[_0xd187('0x6e')]();return db['sequelize'][_0xd187('0x31')](_0x13a362);}return[];})[_0xd187('0x3f')](respondWithResult(_0x5cbfa6,null))['catch'](handleError(_0x5cbfa6,null));};exports[_0xd187('0x7e')]=function(_0x3bd1d8,_0x224312,_0x45b522){return db[_0xd187('0x7f')][_0xd187('0x80')]({'where':{'VoiceQueueId':_0x3bd1d8[_0xd187('0x48')][_0xd187('0x64')],'CampaignId':_0x3bd1d8['body'][_0xd187('0x7b')],'ContactId':_0x3bd1d8[_0xd187('0x48')][_0xd187('0x62')]}})[_0xd187('0x3f')](handleEntityNotFound(_0x224312,null))[_0xd187('0x3f')](function(_0x400a9){if(_0x400a9){return _0x400a9;}return null;})['then'](respondWithResult(_0x224312,null))['catch'](handleError(_0x224312,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 81cc4f4..87ab9b2 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.model.js +++ b/server/api/cmHopperFinal/cmHopperFinal.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x05e8=['rimraf','../../config/environment','CmHopperFinal','calleridnum','uniqueid','../../config/logger','moment','bluebird','request-promise'];(function(_0x3267f0,_0x41df78){var _0x22b8a1=function(_0x88fb1a){while(--_0x88fb1a){_0x3267f0['push'](_0x3267f0['shift']());}};_0x22b8a1(++_0x41df78);}(_0x05e8,0x1d9));var _0x805e=function(_0x498653,_0x59d91f){_0x498653=_0x498653-0x0;var _0x4a7d62=_0x05e8[_0x498653];return _0x4a7d62;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x805e('0x0'))('api');var moment=require(_0x805e('0x1'));var BPromise=require(_0x805e('0x2'));var rp=require(_0x805e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x805e('0x4'));var config=require(_0x805e('0x5'));var attributes=require('./cmHopperFinal.attributes');module['exports']=function(_0x58f255,_0x66a0e2){return _0x58f255['define'](_0x805e('0x6'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x805e('0x7'),'fields':[_0x805e('0x7')]},{'name':_0x805e('0x8'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa6d6=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','CmHopperFinal','cm_hopper_final','calleridnum'];(function(_0x55c632,_0x2e7b2b){var _0x204ede=function(_0x1ddae5){while(--_0x1ddae5){_0x55c632['push'](_0x55c632['shift']());}};_0x204ede(++_0x2e7b2b);}(_0xa6d6,0x1d2));var _0x6a6d=function(_0x14957d,_0x4a7038){_0x14957d=_0x14957d-0x0;var _0x37c492=_0xa6d6[_0x14957d];return _0x37c492;};'use strict';var _=require(_0x6a6d('0x0'));var util=require(_0x6a6d('0x1'));var logger=require(_0x6a6d('0x2'))(_0x6a6d('0x3'));var moment=require(_0x6a6d('0x4'));var BPromise=require(_0x6a6d('0x5'));var rp=require(_0x6a6d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6a6d('0x7'));var config=require(_0x6a6d('0x8'));var attributes=require('./cmHopperFinal.attributes');module[_0x6a6d('0x9')]=function(_0x1ec8cc,_0x30ca83){return _0x1ec8cc[_0x6a6d('0xa')](_0x6a6d('0xb'),attributes,{'tableName':_0x6a6d('0xc'),'paranoid':![],'indexes':[{'name':_0x6a6d('0xd'),'fields':[_0x6a6d('0xd')]},{'name':_0x6a6d('0xe'),'fields':[_0x6a6d('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 465b675..2ca80c8 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x171a2a,_0x958a70){var _0x5ecb2e=function(_0x228366){while(--_0x228366){_0x171a2a['push'](_0x171a2a['shift']());}};_0x5ecb2e(++_0x958a70);}(_0x7a54,0x106));var _0x47a5=function(_0x4ef427,_0x52fb66){_0x4ef427=_0x4ef427-0x0;var _0x28d7f7=_0x7a54[_0x4ef427];return _0x28d7f7;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x44b0e9,_0x4634c1){var _0x3dc230=function(_0x484a57){while(--_0x484a57){_0x44b0e9['push'](_0x44b0e9['shift']());}};_0x3dc230(++_0x4634c1);}(_0x7a54,0x106));var _0x47a5=function(_0x1d3a9e,_0x412121){_0x1d3a9e=_0x1d3a9e-0x0;var _0x46b919=_0x7a54[_0x1d3a9e];return _0x46b919;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 39b1389..c5d1734 100644 --- a/server/api/cmHopperFinal/index.js +++ b/server/api/cmHopperFinal/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb072=['/:id','update','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','/describe','describe','show','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','put'];(function(_0x30f210,_0x12bac5){var _0x29fcbf=function(_0x24a55d){while(--_0x24a55d){_0x30f210['push'](_0x30f210['shift']());}};_0x29fcbf(++_0x12bac5);}(_0xb072,0x1a7));var _0x2b07=function(_0x200db9,_0x46f289){_0x200db9=_0x200db9-0x0;var _0x54df43=_0xb072[_0x200db9];return _0x54df43;};'use strict';var multer=require(_0x2b07('0x0'));var util=require(_0x2b07('0x1'));var path=require('path');var timeout=require(_0x2b07('0x2'));var express=require(_0x2b07('0x3'));var router=express[_0x2b07('0x4')]();var fs_extra=require(_0x2b07('0x5'));var auth=require(_0x2b07('0x6'));var interaction=require(_0x2b07('0x7'));var config=require(_0x2b07('0x8'));var controller=require(_0x2b07('0x9'));router[_0x2b07('0xa')]('/',auth[_0x2b07('0xb')](),controller['index']);router[_0x2b07('0xa')](_0x2b07('0xc'),auth['isAuthenticated'](),controller[_0x2b07('0xd')]);router[_0x2b07('0xa')]('/:id',auth[_0x2b07('0xb')](),controller[_0x2b07('0xe')]);router[_0x2b07('0xa')](_0x2b07('0xf'),auth[_0x2b07('0xb')](),controller['countContactsQueueCampaignHopperFinal']);router['get'](_0x2b07('0x10'),auth[_0x2b07('0xb')](),controller[_0x2b07('0x11')]);router['post'](_0x2b07('0x12'),auth['isAuthenticated'](),controller[_0x2b07('0x13')]);router[_0x2b07('0x14')](_0x2b07('0x15'),auth[_0x2b07('0xb')](),controller[_0x2b07('0x16')]);router['post']('/checkContactHopper',auth[_0x2b07('0xb')](),controller[_0x2b07('0x17')]);router[_0x2b07('0x18')](_0x2b07('0x19'),auth[_0x2b07('0xb')](),controller[_0x2b07('0x1a')]);module[_0x2b07('0x1b')]=router; \ No newline at end of file +var _0x20a2=['isAuthenticated','index','get','/describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','put','update','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3423c8,_0x55ba6b){var _0x505c78=function(_0x3bb64b){while(--_0x3bb64b){_0x3423c8['push'](_0x3423c8['shift']());}};_0x505c78(++_0x55ba6b);}(_0x20a2,0xf2));var _0x220a=function(_0x332998,_0x2d99c7){_0x332998=_0x332998-0x0;var _0x460be7=_0x20a2[_0x332998];return _0x460be7;};'use strict';var multer=require(_0x220a('0x0'));var util=require(_0x220a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x220a('0x2'));var router=express[_0x220a('0x3')]();var fs_extra=require(_0x220a('0x4'));var auth=require(_0x220a('0x5'));var interaction=require(_0x220a('0x6'));var config=require(_0x220a('0x7'));var controller=require('./cmHopperFinal.controller');router['get']('/',auth[_0x220a('0x8')](),controller[_0x220a('0x9')]);router[_0x220a('0xa')](_0x220a('0xb'),auth[_0x220a('0x8')](),controller['describe']);router[_0x220a('0xa')](_0x220a('0xc'),auth[_0x220a('0x8')](),controller[_0x220a('0xd')]);router[_0x220a('0xa')](_0x220a('0xe'),auth[_0x220a('0x8')](),controller[_0x220a('0xf')]);router[_0x220a('0xa')](_0x220a('0x10'),auth['isAuthenticated'](),controller[_0x220a('0x11')]);router[_0x220a('0x12')]('/voice/queue/moveContacts/:id',auth[_0x220a('0x8')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x220a('0x12')](_0x220a('0x13'),auth[_0x220a('0x8')](),controller[_0x220a('0x14')]);router['post'](_0x220a('0x15'),auth[_0x220a('0x8')](),controller['checkContactHopper']);router[_0x220a('0x16')](_0x220a('0xc'),auth['isAuthenticated'](),controller[_0x220a('0x17')]);module[_0x220a('0x18')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 408821e..722dca7 100644 --- a/server/api/cmHopperHistory/cmHopperHistory.attributes.js +++ b/server/api/cmHopperHistory/cmHopperHistory.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x322b=['DATE','BOOLEAN','sequelize','INTEGER','STRING'];(function(_0x3d9a1f,_0x4cf787){var _0x358820=function(_0x219ca1){while(--_0x219ca1){_0x3d9a1f['push'](_0x3d9a1f['shift']());}};_0x358820(++_0x4cf787);}(_0x322b,0x106));var _0xb322=function(_0x243921,_0x3eb2fd){_0x243921=_0x243921-0x0;var _0x1021be=_0x322b[_0x243921];return _0x1021be;};'use strict';var Sequelize=require(_0xb322('0x0'));module['exports']={'state':{'type':Sequelize[_0xb322('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xb322('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb322('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xb322('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xb322('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xb322('0x2')]},'calleridname':{'type':Sequelize[_0xb322('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xb322('0x3')]},'answertime':{'type':Sequelize[_0xb322('0x3')]},'droptime':{'type':Sequelize[_0xb322('0x3')]},'endtime':{'type':Sequelize[_0xb322('0x3')]},'ringtime':{'type':Sequelize[_0xb322('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xb322('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xb322('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xb322('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xb322('0x2')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xb322('0x2')]},'membername':{'type':Sequelize[_0xb322('0x2')]},'reason':{'type':Sequelize[_0xb322('0x2')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xb322('0x4')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb322('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0xb322('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xb322('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb322('0x1')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xb322('0x2')]}}; \ No newline at end of file +var _0x29b3=['INTEGER','DATE','STRING','BOOLEAN','sequelize','exports'];(function(_0x5ddef2,_0x1aec71){var _0x565b3e=function(_0x153c7c){while(--_0x153c7c){_0x5ddef2['push'](_0x5ddef2['shift']());}};_0x565b3e(++_0x1aec71);}(_0x29b3,0x160));var _0x329b=function(_0x2d2e1e,_0x5ca3d1){_0x2d2e1e=_0x2d2e1e-0x0;var _0x2a4720=_0x29b3[_0x2d2e1e];return _0x2a4720;};'use strict';var Sequelize=require(_0x329b('0x0'));module[_0x329b('0x1')]={'state':{'type':Sequelize[_0x329b('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x329b('0x3')]},'countbusyretry':{'type':Sequelize[_0x329b('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x329b('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x329b('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x329b('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x329b('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x329b('0x4')]},'originatecalleridname':{'type':Sequelize[_0x329b('0x4')]},'calleridnum':{'type':Sequelize[_0x329b('0x4')]},'calleridname':{'type':Sequelize[_0x329b('0x4')]},'starttime':{'type':Sequelize[_0x329b('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x329b('0x3')]},'droptime':{'type':Sequelize[_0x329b('0x3')]},'endtime':{'type':Sequelize[_0x329b('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x329b('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x329b('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x329b('0x4')]},'campaigntype':{'type':Sequelize[_0x329b('0x4')]},'membername':{'type':Sequelize[_0x329b('0x4')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0x329b('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x329b('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x329b('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x329b('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0x329b('0x3')]},'edited':{'type':Sequelize[_0x329b('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x329b('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x329b('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x329b('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x329b('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x329b('0x4')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index da3d0d4..6151cb9 100644 --- a/server/api/cmHopperHistory/cmHopperHistory.controller.js +++ b/server/api/cmHopperHistory/cmHopperHistory.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf69d=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','findAll','rows','catch','show','include','find','create','describe','body','uniqueid','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs'];(function(_0x463b3c,_0x5447c9){var _0x804218=function(_0xc94234){while(--_0xc94234){_0x463b3c['push'](_0x463b3c['shift']());}};_0x804218(++_0x5447c9);}(_0xf69d,0x13d));var _0xdf69=function(_0x37bf42,_0x267338){_0x37bf42=_0x37bf42-0x0;var _0x50d32e=_0xf69d[_0x37bf42];return _0x50d32e;};'use strict';var emlformat=require(_0xdf69('0x0'));var rimraf=require(_0xdf69('0x1'));var zipdir=require(_0xdf69('0x2'));var jsonpatch=require(_0xdf69('0x3'));var rp=require(_0xdf69('0x4'));var moment=require(_0xdf69('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdf69('0x6'));var util=require(_0xdf69('0x7'));var path=require(_0xdf69('0x8'));var sox=require(_0xdf69('0x9'));var csv=require('to-csv');var ejs=require(_0xdf69('0xa'));var fs=require('fs');var fs_extra=require(_0xdf69('0xb'));var _=require(_0xdf69('0xc'));var squel=require(_0xdf69('0xd'));var crypto=require(_0xdf69('0xe'));var jsforce=require(_0xdf69('0xf'));var deskjs=require(_0xdf69('0x10'));var toCsv=require('to-csv');var querystring=require(_0xdf69('0x11'));var Papa=require(_0xdf69('0x12'));var Redis=require('ioredis');var authService=require(_0xdf69('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xdf69('0x14'));var hardwareService=require(_0xdf69('0x15'));var logger=require(_0xdf69('0x16'))('api');var utils=require(_0xdf69('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xdf69('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54584e,_0x20370d){_0x20370d=_0x20370d||0xcc;return function(_0x6d40b2){if(_0x6d40b2){return _0x54584e['sendStatus'](_0x20370d);}return _0x54584e[_0xdf69('0x19')](_0x20370d)[_0xdf69('0x1a')]();};}function respondWithResult(_0xa8230,_0x34c128){_0x34c128=_0x34c128||0xc8;return function(_0x50459f){if(_0x50459f){return _0xa8230[_0xdf69('0x19')](_0x34c128)[_0xdf69('0x1b')](_0x50459f);}};}function respondWithFilteredResult(_0x402736,_0x4c4450){return function(_0x1c4efd){if(_0x1c4efd){var _0xea0b93=typeof _0x4c4450[_0xdf69('0x1c')]===_0xdf69('0x1d')&&typeof _0x4c4450[_0xdf69('0x1e')]===_0xdf69('0x1d');var _0x9cbad5=_0x1c4efd[_0xdf69('0x1f')];var _0x54446a=_0xea0b93?0x0:_0x4c4450[_0xdf69('0x1c')];var _0x476b91=_0xea0b93?_0x1c4efd[_0xdf69('0x1f')]:_0x4c4450[_0xdf69('0x1c')]+_0x4c4450[_0xdf69('0x1e')];var _0x30697d;if(_0x476b91>=_0x9cbad5){_0x476b91=_0x9cbad5;_0x30697d=0xc8;}else{_0x30697d=0xce;}_0x402736['status'](_0x30697d);return _0x402736[_0xdf69('0x20')](_0xdf69('0x21'),_0x54446a+'-'+_0x476b91+'/'+_0x9cbad5)[_0xdf69('0x1b')](_0x1c4efd);}return null;};}function patchUpdates(_0x48a53f){return function(_0xc4e2d8){try{jsonpatch[_0xdf69('0x22')](_0xc4e2d8,_0x48a53f,!![]);}catch(_0x332864){return BPromise[_0xdf69('0x23')](_0x332864);}return _0xc4e2d8[_0xdf69('0x24')]();};}function saveUpdates(_0x3b1071,_0x460988){return function(_0x1e96ca){if(_0x1e96ca){return _0x1e96ca[_0xdf69('0x25')](_0x3b1071)[_0xdf69('0x26')](function(_0x2dd639){return _0x2dd639;});}return null;};}function removeEntity(_0x4c4771,_0x4dac67){return function(_0x473ff3){if(_0x473ff3){return _0x473ff3[_0xdf69('0x27')]()[_0xdf69('0x26')](function(){_0x4c4771[_0xdf69('0x19')](0xcc)[_0xdf69('0x1a')]();});}};}function handleEntityNotFound(_0x3fd3a8,_0x339690){return function(_0x9b2c0c){if(!_0x9b2c0c){_0x3fd3a8[_0xdf69('0x28')](0x194);}return _0x9b2c0c;};}function handleError(_0xf5d471,_0x4dc8bb){_0x4dc8bb=_0x4dc8bb||0x1f4;return function(_0x495dbd){logger[_0xdf69('0x29')](_0x495dbd[_0xdf69('0x2a')]);if(_0x495dbd[_0xdf69('0x2b')]){delete _0x495dbd[_0xdf69('0x2b')];}_0xf5d471['status'](_0x4dc8bb)[_0xdf69('0x2c')](_0x495dbd);};}exports[_0xdf69('0x2d')]=function(_0x229c06,_0x524fcc){var _0x5b6e5b={},_0x1f5e29={},_0x23962b={'count':0x0,'rows':[]};var _0x156e60=_[_0xdf69('0x2e')](db[_0xdf69('0x2f')][_0xdf69('0x30')],function(_0x106ca3){return{'name':_0x106ca3[_0xdf69('0x31')],'type':_0x106ca3[_0xdf69('0x32')][_0xdf69('0x33')]};});_0x1f5e29['model']=_['map'](_0x156e60,'name');_0x1f5e29[_0xdf69('0x34')]=_[_0xdf69('0x35')](_0x229c06[_0xdf69('0x34')]);_0x1f5e29['filters']=_[_0xdf69('0x36')](_0x1f5e29[_0xdf69('0x37')],_0x1f5e29[_0xdf69('0x34')]);_0x5b6e5b[_0xdf69('0x38')]=_['intersection'](_0x1f5e29[_0xdf69('0x37')],qs[_0xdf69('0x39')](_0x229c06[_0xdf69('0x34')][_0xdf69('0x39')]));_0x5b6e5b[_0xdf69('0x38')]=_0x5b6e5b[_0xdf69('0x38')][_0xdf69('0x3a')]?_0x5b6e5b[_0xdf69('0x38')]:_0x1f5e29[_0xdf69('0x37')];if(!_0x229c06[_0xdf69('0x34')][_0xdf69('0x3b')](_0xdf69('0x3c'))){_0x5b6e5b[_0xdf69('0x1e')]=qs[_0xdf69('0x1e')](_0x229c06['query']['limit']);_0x5b6e5b[_0xdf69('0x1c')]=qs[_0xdf69('0x1c')](_0x229c06[_0xdf69('0x34')][_0xdf69('0x1c')]);}_0x5b6e5b[_0xdf69('0x3d')]=qs[_0xdf69('0x3e')](_0x229c06[_0xdf69('0x34')]['sort']);_0x5b6e5b[_0xdf69('0x3f')]=qs[_0xdf69('0x40')](_[_0xdf69('0x41')](_0x229c06[_0xdf69('0x34')],_0x1f5e29[_0xdf69('0x40')]),_0x156e60);if(_0x229c06[_0xdf69('0x34')]['filter']){_0x5b6e5b['where']=_['merge'](_0x5b6e5b['where'],{'$or':_[_0xdf69('0x2e')](_0x156e60,function(_0x3d12db){if(_0x3d12db['type']!==_0xdf69('0x42')){var _0x1eff41={};_0x1eff41[_0x3d12db[_0xdf69('0x2b')]]={'$like':'%'+_0x229c06[_0xdf69('0x34')][_0xdf69('0x43')]+'%'};return _0x1eff41;}})});}_0x5b6e5b=_[_0xdf69('0x44')]({},_0x5b6e5b,_0x229c06[_0xdf69('0x45')]);var _0x16eda6={'where':_0x5b6e5b[_0xdf69('0x3f')]};return db['CmHopperHistory'][_0xdf69('0x1f')](_0x16eda6)[_0xdf69('0x26')](function(_0x4fbe78){_0x23962b[_0xdf69('0x1f')]=_0x4fbe78;if(_0x229c06['query'][_0xdf69('0x46')]){_0x5b6e5b['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0xdf69('0x47')](_0x5b6e5b);})['then'](function(_0x44ea1d){_0x23962b[_0xdf69('0x48')]=_0x44ea1d;return _0x23962b;})[_0xdf69('0x26')](respondWithFilteredResult(_0x524fcc,_0x5b6e5b))[_0xdf69('0x49')](handleError(_0x524fcc,null));};exports[_0xdf69('0x4a')]=function(_0x27ee71,_0x2fd085){var _0x4cb345={'raw':!![],'where':{'id':_0x27ee71['params']['id']}},_0x45045f={};_0x45045f[_0xdf69('0x37')]=_['keys'](db['CmHopperHistory']['rawAttributes']);_0x45045f['query']=_[_0xdf69('0x35')](_0x27ee71['query']);_0x45045f[_0xdf69('0x40')]=_[_0xdf69('0x36')](_0x45045f['model'],_0x45045f[_0xdf69('0x34')]);_0x4cb345['attributes']=_[_0xdf69('0x36')](_0x45045f[_0xdf69('0x37')],qs[_0xdf69('0x39')](_0x27ee71[_0xdf69('0x34')][_0xdf69('0x39')]));_0x4cb345['attributes']=_0x4cb345[_0xdf69('0x38')][_0xdf69('0x3a')]?_0x4cb345[_0xdf69('0x38')]:_0x45045f['model'];if(_0x27ee71[_0xdf69('0x34')][_0xdf69('0x46')]){_0x4cb345[_0xdf69('0x4b')]=[{'all':!![]}];}_0x4cb345=_[_0xdf69('0x44')]({},_0x4cb345,_0x27ee71['options']);return db[_0xdf69('0x2f')][_0xdf69('0x4c')](_0x4cb345)[_0xdf69('0x26')](handleEntityNotFound(_0x2fd085,null))['then'](respondWithResult(_0x2fd085,null))['catch'](handleError(_0x2fd085,null));};exports[_0xdf69('0x4d')]=function(_0x41a0ed,_0x4fb195){return db[_0xdf69('0x2f')]['create'](_0x41a0ed['body'],{})[_0xdf69('0x26')](respondWithResult(_0x4fb195,0xc9))[_0xdf69('0x49')](handleError(_0x4fb195,null));};exports[_0xdf69('0x4e')]=function(_0x354c0e,_0x2ee569){return db[_0xdf69('0x2f')]['describe']()['then'](respondWithResult(_0x2ee569,null))[_0xdf69('0x49')](handleError(_0x2ee569,null));};exports[_0xdf69('0x25')]=function(_0x25c283,_0x19bd13){if(_0x25c283[_0xdf69('0x4f')][_0xdf69('0x50')]){delete _0x25c283[_0xdf69('0x4f')]['uniqueid'];}return db[_0xdf69('0x2f')][_0xdf69('0x4c')]({'where':{'uniqueid':_0x25c283[_0xdf69('0x51')]['id']}})[_0xdf69('0x26')](handleEntityNotFound(_0x19bd13,null))['then'](saveUpdates(_0x25c283[_0xdf69('0x4f')],null))[_0xdf69('0x26')](respondWithResult(_0x19bd13,null))[_0xdf69('0x49')](handleError(_0x19bd13,null));}; \ No newline at end of file +var _0x8267=['stack','name','send','map','CmHopperHistory','model','query','filters','intersection','fields','attributes','length','nolimit','order','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','body','describe','uniqueid','find','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy'];(function(_0x36fba4,_0x26e202){var _0x31a316=function(_0xc2ad70){while(--_0xc2ad70){_0x36fba4['push'](_0x36fba4['shift']());}};_0x31a316(++_0x26e202);}(_0x8267,0x16b));var _0x7826=function(_0x5e3518,_0x25c248){_0x5e3518=_0x5e3518-0x0;var _0x3a28db=_0x8267[_0x5e3518];return _0x3a28db;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7826('0x0'));var zipdir=require(_0x7826('0x1'));var jsonpatch=require(_0x7826('0x2'));var rp=require('request-promise');var moment=require(_0x7826('0x3'));var BPromise=require(_0x7826('0x4'));var Mustache=require(_0x7826('0x5'));var util=require('util');var path=require('path');var sox=require(_0x7826('0x6'));var csv=require(_0x7826('0x7'));var ejs=require(_0x7826('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7826('0x9'));var squel=require(_0x7826('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7826('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7826('0xc'));var authService=require(_0x7826('0xd'));var qs=require(_0x7826('0xe'));var as=require(_0x7826('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7826('0x10'));var utils=require('../../config/utils');var config=require(_0x7826('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x7826('0x12'))['db'];function respondWithStatusCode(_0x4cc34b,_0x4db244){_0x4db244=_0x4db244||0xcc;return function(_0xac6854){if(_0xac6854){return _0x4cc34b[_0x7826('0x13')](_0x4db244);}return _0x4cc34b[_0x7826('0x14')](_0x4db244)[_0x7826('0x15')]();};}function respondWithResult(_0x1eecd6,_0x598e5c){_0x598e5c=_0x598e5c||0xc8;return function(_0x33a871){if(_0x33a871){return _0x1eecd6['status'](_0x598e5c)[_0x7826('0x16')](_0x33a871);}};}function respondWithFilteredResult(_0x86834b,_0x2948a2){return function(_0xa621e9){if(_0xa621e9){var _0x48af09=typeof _0x2948a2[_0x7826('0x17')]===_0x7826('0x18')&&typeof _0x2948a2[_0x7826('0x19')]==='undefined';var _0x2e9f0a=_0xa621e9[_0x7826('0x1a')];var _0x30564a=_0x48af09?0x0:_0x2948a2['offset'];var _0x50023f=_0x48af09?_0xa621e9[_0x7826('0x1a')]:_0x2948a2[_0x7826('0x17')]+_0x2948a2[_0x7826('0x19')];var _0x2e5d41;if(_0x50023f>=_0x2e9f0a){_0x50023f=_0x2e9f0a;_0x2e5d41=0xc8;}else{_0x2e5d41=0xce;}_0x86834b[_0x7826('0x14')](_0x2e5d41);return _0x86834b[_0x7826('0x1b')]('Content-Range',_0x30564a+'-'+_0x50023f+'/'+_0x2e9f0a)[_0x7826('0x16')](_0xa621e9);}return null;};}function patchUpdates(_0x9a5793){return function(_0x52dcbf){try{jsonpatch[_0x7826('0x1c')](_0x52dcbf,_0x9a5793,!![]);}catch(_0x236fb8){return BPromise['reject'](_0x236fb8);}return _0x52dcbf[_0x7826('0x1d')]();};}function saveUpdates(_0x41d25d,_0x162458){return function(_0x351f00){if(_0x351f00){return _0x351f00[_0x7826('0x1e')](_0x41d25d)[_0x7826('0x1f')](function(_0x7dc0b){return _0x7dc0b;});}return null;};}function removeEntity(_0x163f0e,_0x30b9db){return function(_0x20b658){if(_0x20b658){return _0x20b658[_0x7826('0x20')]()[_0x7826('0x1f')](function(){_0x163f0e[_0x7826('0x14')](0xcc)[_0x7826('0x15')]();});}};}function handleEntityNotFound(_0x5ba43f,_0x177e2f){return function(_0x3e5b29){if(!_0x3e5b29){_0x5ba43f[_0x7826('0x13')](0x194);}return _0x3e5b29;};}function handleError(_0x349faa,_0x5ada8d){_0x5ada8d=_0x5ada8d||0x1f4;return function(_0x51db9f){logger['error'](_0x51db9f[_0x7826('0x21')]);if(_0x51db9f[_0x7826('0x22')]){delete _0x51db9f[_0x7826('0x22')];}_0x349faa[_0x7826('0x14')](_0x5ada8d)[_0x7826('0x23')](_0x51db9f);};}exports['index']=function(_0x182a28,_0xe892c3){var _0x1ffaf2={},_0x46bd92={},_0x1af330={'count':0x0,'rows':[]};var _0x4b1b60=_[_0x7826('0x24')](db[_0x7826('0x25')]['rawAttributes'],function(_0x138935){return{'name':_0x138935['fieldName'],'type':_0x138935['type']['key']};});_0x46bd92[_0x7826('0x26')]=_['map'](_0x4b1b60,_0x7826('0x22'));_0x46bd92[_0x7826('0x27')]=_['keys'](_0x182a28[_0x7826('0x27')]);_0x46bd92[_0x7826('0x28')]=_[_0x7826('0x29')](_0x46bd92[_0x7826('0x26')],_0x46bd92[_0x7826('0x27')]);_0x1ffaf2['attributes']=_[_0x7826('0x29')](_0x46bd92[_0x7826('0x26')],qs[_0x7826('0x2a')](_0x182a28[_0x7826('0x27')]['fields']));_0x1ffaf2[_0x7826('0x2b')]=_0x1ffaf2[_0x7826('0x2b')][_0x7826('0x2c')]?_0x1ffaf2['attributes']:_0x46bd92[_0x7826('0x26')];if(!_0x182a28[_0x7826('0x27')]['hasOwnProperty'](_0x7826('0x2d'))){_0x1ffaf2[_0x7826('0x19')]=qs[_0x7826('0x19')](_0x182a28[_0x7826('0x27')]['limit']);_0x1ffaf2[_0x7826('0x17')]=qs[_0x7826('0x17')](_0x182a28[_0x7826('0x27')][_0x7826('0x17')]);}_0x1ffaf2[_0x7826('0x2e')]=qs['sort'](_0x182a28['query']['sort']);_0x1ffaf2[_0x7826('0x2f')]=qs[_0x7826('0x28')](_[_0x7826('0x30')](_0x182a28[_0x7826('0x27')],_0x46bd92['filters']),_0x4b1b60);if(_0x182a28[_0x7826('0x27')][_0x7826('0x31')]){_0x1ffaf2[_0x7826('0x2f')]=_['merge'](_0x1ffaf2['where'],{'$or':_[_0x7826('0x24')](_0x4b1b60,function(_0x310aba){if(_0x310aba[_0x7826('0x32')]!==_0x7826('0x33')){var _0xae2405={};_0xae2405[_0x310aba['name']]={'$like':'%'+_0x182a28[_0x7826('0x27')][_0x7826('0x31')]+'%'};return _0xae2405;}})});}_0x1ffaf2=_[_0x7826('0x34')]({},_0x1ffaf2,_0x182a28[_0x7826('0x35')]);var _0x186b64={'where':_0x1ffaf2[_0x7826('0x2f')]};return db[_0x7826('0x25')][_0x7826('0x1a')](_0x186b64)[_0x7826('0x1f')](function(_0x34291d){_0x1af330[_0x7826('0x1a')]=_0x34291d;if(_0x182a28[_0x7826('0x27')][_0x7826('0x36')]){_0x1ffaf2[_0x7826('0x37')]=[{'all':!![]}];}return db[_0x7826('0x25')][_0x7826('0x38')](_0x1ffaf2);})['then'](function(_0x45e702){_0x1af330[_0x7826('0x39')]=_0x45e702;return _0x1af330;})[_0x7826('0x1f')](respondWithFilteredResult(_0xe892c3,_0x1ffaf2))[_0x7826('0x3a')](handleError(_0xe892c3,null));};exports[_0x7826('0x3b')]=function(_0x1fd536,_0x5a47b5){var _0x57bca2={'raw':!![],'where':{'id':_0x1fd536[_0x7826('0x3c')]['id']}},_0x42159c={};_0x42159c[_0x7826('0x26')]=_['keys'](db[_0x7826('0x25')]['rawAttributes']);_0x42159c['query']=_[_0x7826('0x3d')](_0x1fd536['query']);_0x42159c[_0x7826('0x28')]=_[_0x7826('0x29')](_0x42159c[_0x7826('0x26')],_0x42159c[_0x7826('0x27')]);_0x57bca2['attributes']=_[_0x7826('0x29')](_0x42159c[_0x7826('0x26')],qs[_0x7826('0x2a')](_0x1fd536['query'][_0x7826('0x2a')]));_0x57bca2['attributes']=_0x57bca2[_0x7826('0x2b')]['length']?_0x57bca2[_0x7826('0x2b')]:_0x42159c[_0x7826('0x26')];if(_0x1fd536[_0x7826('0x27')]['includeAll']){_0x57bca2[_0x7826('0x37')]=[{'all':!![]}];}_0x57bca2=_[_0x7826('0x34')]({},_0x57bca2,_0x1fd536['options']);return db[_0x7826('0x25')]['find'](_0x57bca2)['then'](handleEntityNotFound(_0x5a47b5,null))[_0x7826('0x1f')](respondWithResult(_0x5a47b5,null))[_0x7826('0x3a')](handleError(_0x5a47b5,null));};exports['create']=function(_0x18187c,_0x6c25d){return db['CmHopperHistory']['create'](_0x18187c[_0x7826('0x3e')],{})['then'](respondWithResult(_0x6c25d,0xc9))['catch'](handleError(_0x6c25d,null));};exports[_0x7826('0x3f')]=function(_0x535e81,_0x1e99d5){return db[_0x7826('0x25')][_0x7826('0x3f')]()[_0x7826('0x1f')](respondWithResult(_0x1e99d5,null))[_0x7826('0x3a')](handleError(_0x1e99d5,null));};exports[_0x7826('0x1e')]=function(_0x4ef14e,_0x57f51a){if(_0x4ef14e[_0x7826('0x3e')][_0x7826('0x40')]){delete _0x4ef14e[_0x7826('0x3e')][_0x7826('0x40')];}return db['CmHopperHistory'][_0x7826('0x41')]({'where':{'uniqueid':_0x4ef14e[_0x7826('0x3c')]['id']}})[_0x7826('0x1f')](handleEntityNotFound(_0x57f51a,null))[_0x7826('0x1f')](saveUpdates(_0x4ef14e[_0x7826('0x3e')],null))[_0x7826('0x1f')](respondWithResult(_0x57f51a,null))['catch'](handleError(_0x57f51a,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 852e740..ba9b503 100644 --- a/server/api/cmHopperHistory/cmHopperHistory.model.js +++ b/server/api/cmHopperHistory/cmHopperHistory.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8561=['define','endtime','util','../../config/logger','moment','request-promise','rimraf','./cmHopperHistory.attributes','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8561,0x1b2));var _0x1856=function(_0x185b17,_0x5c458b){_0x185b17=_0x185b17-0x0;var _0x3f7835=_0x8561[_0x185b17];return _0x3f7835;};'use strict';var _=require('lodash');var util=require(_0x1856('0x0'));var logger=require(_0x1856('0x1'))('api');var moment=require(_0x1856('0x2'));var BPromise=require('bluebird');var rp=require(_0x1856('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1856('0x4'));var config=require('../../config/environment');var attributes=require(_0x1856('0x5'));module[_0x1856('0x6')]=function(_0x4cb57e,_0x5c39bd){return _0x4cb57e[_0x1856('0x7')]('CmHopperHistory',attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x1856('0x8'),'fields':['endtime']},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x0af5=['path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','CmHopperHistory','cm_hopper_history','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4a2a17,_0x23e07b){var _0x2e3361=function(_0x901efc){while(--_0x901efc){_0x4a2a17['push'](_0x4a2a17['shift']());}};_0x2e3361(++_0x23e07b);}(_0x0af5,0x158));var _0x50af=function(_0x37f725,_0x407da7){_0x37f725=_0x37f725-0x0;var _0x224924=_0x0af5[_0x37f725];return _0x224924;};'use strict';var _=require('lodash');var util=require(_0x50af('0x0'));var logger=require(_0x50af('0x1'))(_0x50af('0x2'));var moment=require(_0x50af('0x3'));var BPromise=require(_0x50af('0x4'));var rp=require(_0x50af('0x5'));var fs=require('fs');var path=require(_0x50af('0x6'));var rimraf=require(_0x50af('0x7'));var config=require(_0x50af('0x8'));var attributes=require(_0x50af('0x9'));module[_0x50af('0xa')]=function(_0xe37b1,_0x5e94f8){return _0xe37b1['define'](_0x50af('0xb'),attributes,{'tableName':_0x50af('0xc'),'paranoid':![],'indexes':[{'name':'endtime','fields':['endtime']},{'name':_0x50af('0xd'),'fields':[_0x50af('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index bbcebe6..9f8ddc5 100644 --- a/server/api/cmHopperHistory/cmHopperHistory.rpc.js +++ b/server/api/cmHopperHistory/cmHopperHistory.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['outboundReCallsDay','GetCampaignHopperHistory','where','ivrTotalCallsDays','ivrAnswerCallsDay','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','findAll','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','then','AvgHandleTime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3cec8c,_0x3f6c1d){_0x3cec8c=_0x3cec8c-0x0;var _0x38032e=_0xcb91[_0x3cec8c];return _0x38032e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('CmHopperHistory,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});}exports[_0x1cb9('0x14')]=function(_0x23d3a9){var _0x4e1340=this;return new Promise(function(_0x479d43,_0x1b2fa6){return db[_0x1cb9('0x15')][_0x1cb9('0x16')](_0x23d3a9[_0x1cb9('0x17')],{'raw':_0x23d3a9[_0x1cb9('0x18')]?_0x23d3a9[_0x1cb9('0x18')][_0x1cb9('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x559bcc){logger[_0x1cb9('0xa')]('CreateCmHopperHistory',_0x23d3a9);logger[_0x1cb9('0xd')](_0x1cb9('0x14'),_0x23d3a9,JSON['stringify'](_0x559bcc));_0x479d43(_0x559bcc);})['catch'](function(_0x2e3854){logger[_0x1cb9('0x10')](_0x1cb9('0x14'),_0x2e3854[_0x1cb9('0x12')],_0x23d3a9);_0x1b2fa6(_0x4e1340[_0x1cb9('0x10')](0x1f4,_0x2e3854[_0x1cb9('0x12')]));});});};exports['AvgHandleTime']=function(_0x55b232){var _0x6c6f61=this;return new Promise(function(_0x557199,_0x10a419){return db[_0x1cb9('0x15')][_0x1cb9('0x1a')]({'raw':_0x55b232[_0x1cb9('0x18')]?_0x55b232[_0x1cb9('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x55b232[_0x1cb9('0x18')]?_0x55b232[_0x1cb9('0x18')]['where']||null:null,'attributes':[[db[_0x1cb9('0x1b')]['fn'](_0x1cb9('0x1c'),db[_0x1cb9('0x1b')][_0x1cb9('0x1d')]('id')),_0x1cb9('0x1e')],[db[_0x1cb9('0x1b')]['fn'](_0x1cb9('0x1c'),db[_0x1cb9('0x1b')]['fn']('IF',db[_0x1cb9('0x1b')][_0x1cb9('0x1f')]('`state`\x20=\x204,\x201,\x20null'))),_0x1cb9('0x20')],[db['sequelize']['fn'](_0x1cb9('0x1c'),db['sequelize']['fn']('IF',db[_0x1cb9('0x1b')][_0x1cb9('0x1f')](_0x1cb9('0x21')))),_0x1cb9('0x22')],[db['sequelize']['fn'](_0x1cb9('0x1c'),db['sequelize']['fn']('IF',db[_0x1cb9('0x1b')][_0x1cb9('0x1f')](_0x1cb9('0x23')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x1cb9('0x1b')]['fn']('AVG',db[_0x1cb9('0x1b')]['fn']('IF',db['sequelize'][_0x1cb9('0x1f')](_0x1cb9('0x24')))),_0x1cb9('0x25')],[db[_0x1cb9('0x1b')]['fn']('AVG',db[_0x1cb9('0x1b')]['fn']('IF',db[_0x1cb9('0x1b')][_0x1cb9('0x1f')](_0x1cb9('0x26')))),_0x1cb9('0x27')]]})[_0x1cb9('0x28')](function(_0xc6d5fd){logger[_0x1cb9('0xa')](_0x1cb9('0x29'),_0x55b232);logger[_0x1cb9('0xd')](_0x1cb9('0x29'),_0x55b232,JSON[_0x1cb9('0xf')](_0xc6d5fd));_0x557199(_0xc6d5fd);})[_0x1cb9('0x13')](function(_0x4c8cb0){logger['error'](_0x1cb9('0x29'),_0x4c8cb0[_0x1cb9('0x12')],_0x55b232);_0x10a419(_0x6c6f61[_0x1cb9('0x10')](0x1f4,_0x4c8cb0[_0x1cb9('0x12')]));});});};exports[_0x1cb9('0x2a')]=function(_0x3a06e6){var _0x35f5e8=this;return new Promise(function(_0x3f5637,_0x4d3e39){return db[_0x1cb9('0x15')][_0x1cb9('0x1a')]({'raw':_0x3a06e6[_0x1cb9('0x18')]?_0x3a06e6['options'][_0x1cb9('0x19')]===undefined?!![]:![]:!![],'where':_0x3a06e6['options']?_0x3a06e6[_0x1cb9('0x18')]['where']||null:null,'attributes':[[_0x1cb9('0x2b'),_0x1cb9('0x2c')],[db[_0x1cb9('0x1b')]['fn'](_0x1cb9('0x1c'),db[_0x1cb9('0x1b')]['fn']('IF',db[_0x1cb9('0x1b')][_0x1cb9('0x1f')]('`state`\x20=\x200,\x201,\x20null'))),'outboundNoSuchCallsDay'],[db[_0x1cb9('0x1b')]['fn'](_0x1cb9('0x1c'),db[_0x1cb9('0x1b')]['fn']('IF',db[_0x1cb9('0x1b')][_0x1cb9('0x1f')](_0x1cb9('0x2d')))),_0x1cb9('0x2e')],[db['sequelize']['fn'](_0x1cb9('0x1c'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x1cb9('0x2f')))),_0x1cb9('0x30')],[db[_0x1cb9('0x1b')]['fn'](_0x1cb9('0x1c'),db[_0x1cb9('0x1b')]['fn']('IF',db['sequelize'][_0x1cb9('0x1f')]('`state`\x20=\x205,\x201,\x20null'))),_0x1cb9('0x31')],[db[_0x1cb9('0x1b')]['fn'](_0x1cb9('0x1c'),db['sequelize']['fn']('IF',db[_0x1cb9('0x1b')]['literal'](_0x1cb9('0x32')))),_0x1cb9('0x33')],[db['sequelize']['fn']('COUNT',db[_0x1cb9('0x1b')]['fn']('IF',db[_0x1cb9('0x1b')][_0x1cb9('0x1f')](_0x1cb9('0x34')))),_0x1cb9('0x35')],[db['sequelize']['fn'](_0x1cb9('0x1c'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x1cb9('0x36')))),_0x1cb9('0x37')],[db[_0x1cb9('0x1b')]['fn'](_0x1cb9('0x1c'),db[_0x1cb9('0x1b')]['fn']('IF',db[_0x1cb9('0x1b')][_0x1cb9('0x1f')](_0x1cb9('0x38')))),_0x1cb9('0x39')],[db[_0x1cb9('0x1b')]['fn'](_0x1cb9('0x1c'),db['sequelize']['fn']('IF',db[_0x1cb9('0x1b')][_0x1cb9('0x1f')](_0x1cb9('0x3a')))),'outboundBlacklistCallsDay'],[db[_0x1cb9('0x1b')]['fn'](_0x1cb9('0x1c'),db[_0x1cb9('0x1b')]['fn']('IF',db[_0x1cb9('0x1b')][_0x1cb9('0x1f')]('`state`\x20=\x2014,\x201,\x20null'))),_0x1cb9('0x3b')],[db['sequelize']['fn'](_0x1cb9('0x1c'),db['sequelize']['fn']('IF',db[_0x1cb9('0x1b')][_0x1cb9('0x1f')](_0x1cb9('0x3c')))),_0x1cb9('0x3d')],[db['sequelize']['fn'](_0x1cb9('0x1c'),db[_0x1cb9('0x1b')]['fn']('IF',db[_0x1cb9('0x1b')][_0x1cb9('0x1f')](_0x1cb9('0x3e')))),_0x1cb9('0x3f')],[db[_0x1cb9('0x1b')]['fn'](_0x1cb9('0x1c'),db[_0x1cb9('0x1b')]['fn']('IF',db[_0x1cb9('0x1b')]['literal']('`state`\x20=\x2020,\x201,\x20null'))),_0x1cb9('0x3d')],[db[_0x1cb9('0x1b')]['fn'](_0x1cb9('0x1c'),db[_0x1cb9('0x1b')]['fn']('IF',db[_0x1cb9('0x1b')][_0x1cb9('0x1f')](_0x1cb9('0x40')))),_0x1cb9('0x41')]],'group':[_0x1cb9('0x2b')]})[_0x1cb9('0x28')](function(_0x4a4b87){logger[_0x1cb9('0xa')]('GetVoiceQueueHopperHistory',_0x3a06e6);logger[_0x1cb9('0xd')]('GetVoiceQueueHopperHistory',_0x3a06e6,JSON[_0x1cb9('0xf')](_0x4a4b87));_0x3f5637(_0x4a4b87);})['catch'](function(_0x5e5174){logger[_0x1cb9('0x10')](_0x1cb9('0x2a'),_0x5e5174[_0x1cb9('0x12')],_0x3a06e6);_0x4d3e39(_0x35f5e8['error'](0x1f4,_0x5e5174[_0x1cb9('0x12')]));});});};exports[_0x1cb9('0x42')]=function(_0x52fbfe){var _0x571b33=this;return new Promise(function(_0x398d9d,_0x1a0314){return db[_0x1cb9('0x15')][_0x1cb9('0x1a')]({'raw':_0x52fbfe[_0x1cb9('0x18')]?_0x52fbfe[_0x1cb9('0x18')][_0x1cb9('0x19')]===undefined?!![]:![]:!![],'where':_0x52fbfe['options']?_0x52fbfe[_0x1cb9('0x18')][_0x1cb9('0x43')]||null:null,'attributes':[[_0x1cb9('0x2b'),'name'],[db[_0x1cb9('0x1b')]['fn'](_0x1cb9('0x1c'),db[_0x1cb9('0x1b')][_0x1cb9('0x1d')]('id')),_0x1cb9('0x44')],[db[_0x1cb9('0x1b')]['fn']('COUNT',db[_0x1cb9('0x1b')]['fn']('IF',db[_0x1cb9('0x1b')][_0x1cb9('0x1f')](_0x1cb9('0x2f')))),_0x1cb9('0x45')]],'group':[_0x1cb9('0x2b')]})[_0x1cb9('0x28')](function(_0x3c126a){logger[_0x1cb9('0xa')](_0x1cb9('0x42'),_0x52fbfe);logger[_0x1cb9('0xd')]('GetCampaignHopperHistory',_0x52fbfe,JSON[_0x1cb9('0xf')](_0x3c126a));_0x398d9d(_0x3c126a);})[_0x1cb9('0x13')](function(_0xebc79f){logger[_0x1cb9('0x10')]('GetCampaignHopperHistory',_0xebc79f['message'],_0x52fbfe);_0x1a0314(_0x571b33[_0x1cb9('0x10')](0x1f4,_0xebc79f[_0x1cb9('0x12')]));});});}; \ No newline at end of file +var _0x2d58=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','CmHopperHistory,\x20%s,\x20%s','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','CmHopperHistory','create','body','raw','CreateCmHopperHistory','findAll','options','sequelize','COUNT','predictiveIntervalTotalCalls','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','AvgHandleTime','GetVoiceQueueHopperHistory','where','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoAnswerCallsDay','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','name','col','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0xd30ad,_0x2ee87a){var _0x208bb8=function(_0x16357f){while(--_0x16357f){_0xd30ad['push'](_0xd30ad['shift']());}};_0x208bb8(++_0x2ee87a);}(_0x2d58,0x186));var _0x82d5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2d58[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x82d5('0x0'));var util=require(_0x82d5('0x1'));var moment=require(_0x82d5('0x2'));var BPromise=require('bluebird');var rs=require(_0x82d5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x82d5('0x4'))['db'];var utils=require(_0x82d5('0x5'));var logger=require(_0x82d5('0x6'))(_0x82d5('0x7'));var config=require(_0x82d5('0x8'));var jayson=require(_0x82d5('0x9'));var client=jayson[_0x82d5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd636fe,_0x2f5257,_0x24c9cb){return new BPromise(function(_0x3dea8b,_0x3ff208){return client[_0x82d5('0xb')](_0xd636fe,_0x24c9cb)[_0x82d5('0xc')](function(_0x19d045){logger[_0x82d5('0xd')](_0x82d5('0xe'),_0x2f5257,'request\x20sent');logger[_0x82d5('0xf')](_0x82d5('0x10'),_0x2f5257,_0x82d5('0x11'),JSON[_0x82d5('0x12')](_0x19d045));if(_0x19d045['error']){if(_0x19d045['error'][_0x82d5('0x13')]===0x1f4){logger[_0x82d5('0x14')]('CmHopperHistory,\x20%s,\x20%s',_0x2f5257,_0x19d045[_0x82d5('0x14')]['message']);return _0x3ff208(_0x19d045[_0x82d5('0x14')][_0x82d5('0x15')]);}logger[_0x82d5('0x14')](_0x82d5('0xe'),_0x2f5257,_0x19d045[_0x82d5('0x14')][_0x82d5('0x15')]);return _0x3dea8b(_0x19d045[_0x82d5('0x14')][_0x82d5('0x15')]);}else{logger['info'](_0x82d5('0xe'),_0x2f5257,_0x82d5('0x11'));_0x3dea8b(_0x19d045['result'][_0x82d5('0x15')]);}})[_0x82d5('0x16')](function(_0x421d58){logger[_0x82d5('0x14')](_0x82d5('0xe'),_0x2f5257,_0x421d58);_0x3ff208(_0x421d58);});});}exports['CreateCmHopperHistory']=function(_0xe1ce36){var _0x269375=this;return new Promise(function(_0x13c6ed,_0x2c1b30){return db[_0x82d5('0x17')][_0x82d5('0x18')](_0xe1ce36[_0x82d5('0x19')],{'raw':_0xe1ce36['options']?_0xe1ce36['options'][_0x82d5('0x1a')]===undefined?!![]:![]:!![]})[_0x82d5('0xc')](function(_0x45d203){logger[_0x82d5('0xd')](_0x82d5('0x1b'),_0xe1ce36);logger[_0x82d5('0xf')](_0x82d5('0x1b'),_0xe1ce36,JSON[_0x82d5('0x12')](_0x45d203));_0x13c6ed(_0x45d203);})['catch'](function(_0x423fe1){logger[_0x82d5('0x14')](_0x82d5('0x1b'),_0x423fe1[_0x82d5('0x15')],_0xe1ce36);_0x2c1b30(_0x269375['error'](0x1f4,_0x423fe1[_0x82d5('0x15')]));});});};exports['AvgHandleTime']=function(_0x47736d){var _0x3bff15=this;return new Promise(function(_0x39e3f7,_0x1ec65d){return db[_0x82d5('0x17')][_0x82d5('0x1c')]({'raw':_0x47736d['options']?_0x47736d[_0x82d5('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x47736d['options']?_0x47736d[_0x82d5('0x1d')]['where']||null:null,'attributes':[[db[_0x82d5('0x1e')]['fn'](_0x82d5('0x1f'),db[_0x82d5('0x1e')]['col']('id')),_0x82d5('0x20')],[db[_0x82d5('0x1e')]['fn'](_0x82d5('0x1f'),db['sequelize']['fn']('IF',db[_0x82d5('0x1e')]['literal'](_0x82d5('0x21')))),_0x82d5('0x22')],[db[_0x82d5('0x1e')]['fn']('COUNT',db[_0x82d5('0x1e')]['fn']('IF',db[_0x82d5('0x1e')][_0x82d5('0x23')](_0x82d5('0x24')))),_0x82d5('0x25')],[db[_0x82d5('0x1e')]['fn'](_0x82d5('0x1f'),db['sequelize']['fn']('IF',db[_0x82d5('0x1e')][_0x82d5('0x23')](_0x82d5('0x26')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x82d5('0x1e')]['fn'](_0x82d5('0x27'),db['sequelize']['fn']('IF',db[_0x82d5('0x1e')][_0x82d5('0x23')](_0x82d5('0x28')))),_0x82d5('0x29')],[db['sequelize']['fn'](_0x82d5('0x27'),db[_0x82d5('0x1e')]['fn']('IF',db[_0x82d5('0x1e')][_0x82d5('0x23')](_0x82d5('0x2a')))),_0x82d5('0x2b')]]})[_0x82d5('0xc')](function(_0x1d78b6){logger['info']('AvgHandleTime',_0x47736d);logger[_0x82d5('0xf')](_0x82d5('0x2c'),_0x47736d,JSON[_0x82d5('0x12')](_0x1d78b6));_0x39e3f7(_0x1d78b6);})[_0x82d5('0x16')](function(_0xe58764){logger[_0x82d5('0x14')](_0x82d5('0x2c'),_0xe58764[_0x82d5('0x15')],_0x47736d);_0x1ec65d(_0x3bff15[_0x82d5('0x14')](0x1f4,_0xe58764[_0x82d5('0x15')]));});});};exports[_0x82d5('0x2d')]=function(_0x243444){var _0x21fb67=this;return new Promise(function(_0x4cdfc5,_0x4b65bf){return db[_0x82d5('0x17')][_0x82d5('0x1c')]({'raw':_0x243444[_0x82d5('0x1d')]?_0x243444[_0x82d5('0x1d')][_0x82d5('0x1a')]===undefined?!![]:![]:!![],'where':_0x243444['options']?_0x243444[_0x82d5('0x1d')][_0x82d5('0x2e')]||null:null,'attributes':[[_0x82d5('0x2f'),'name'],[db[_0x82d5('0x1e')]['fn'](_0x82d5('0x1f'),db[_0x82d5('0x1e')]['fn']('IF',db[_0x82d5('0x1e')][_0x82d5('0x23')](_0x82d5('0x30')))),'outboundNoSuchCallsDay'],[db['sequelize']['fn'](_0x82d5('0x1f'),db['sequelize']['fn']('IF',db[_0x82d5('0x1e')][_0x82d5('0x23')]('`state`\x20=\x203,\x201,\x20null'))),_0x82d5('0x31')],[db[_0x82d5('0x1e')]['fn']('COUNT',db[_0x82d5('0x1e')]['fn']('IF',db[_0x82d5('0x1e')][_0x82d5('0x23')](_0x82d5('0x21')))),'outboundAnswerCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x82d5('0x1e')]['fn']('IF',db[_0x82d5('0x1e')]['literal']('`state`\x20=\x205,\x201,\x20null'))),'outboundBusyCallsDay'],[db[_0x82d5('0x1e')]['fn'](_0x82d5('0x1f'),db[_0x82d5('0x1e')]['fn']('IF',db[_0x82d5('0x1e')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0x82d5('0x32')],[db['sequelize']['fn'](_0x82d5('0x1f'),db[_0x82d5('0x1e')]['fn']('IF',db[_0x82d5('0x1e')]['literal'](_0x82d5('0x33')))),_0x82d5('0x34')],[db[_0x82d5('0x1e')]['fn'](_0x82d5('0x1f'),db[_0x82d5('0x1e')]['fn']('IF',db[_0x82d5('0x1e')][_0x82d5('0x23')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x82d5('0x35')],[db['sequelize']['fn'](_0x82d5('0x1f'),db[_0x82d5('0x1e')]['fn']('IF',db['sequelize'][_0x82d5('0x23')](_0x82d5('0x36')))),_0x82d5('0x37')],[db[_0x82d5('0x1e')]['fn'](_0x82d5('0x1f'),db[_0x82d5('0x1e')]['fn']('IF',db[_0x82d5('0x1e')]['literal']('`state`\x20=\x2013,\x201,\x20null'))),'outboundBlacklistCallsDay'],[db[_0x82d5('0x1e')]['fn'](_0x82d5('0x1f'),db['sequelize']['fn']('IF',db[_0x82d5('0x1e')][_0x82d5('0x23')]('`state`\x20=\x2014,\x201,\x20null'))),'outboundOriginateFailureCallsDay'],[db[_0x82d5('0x1e')]['fn'](_0x82d5('0x1f'),db['sequelize']['fn']('IF',db[_0x82d5('0x1e')][_0x82d5('0x23')](_0x82d5('0x38')))),_0x82d5('0x39')],[db[_0x82d5('0x1e')]['fn']('COUNT',db[_0x82d5('0x1e')]['fn']('IF',db[_0x82d5('0x1e')][_0x82d5('0x23')]('`state`\x20=\x2016,\x201,\x20null'))),_0x82d5('0x3a')],[db[_0x82d5('0x1e')]['fn']('COUNT',db[_0x82d5('0x1e')]['fn']('IF',db[_0x82d5('0x1e')][_0x82d5('0x23')](_0x82d5('0x3b')))),_0x82d5('0x39')],[db[_0x82d5('0x1e')]['fn'](_0x82d5('0x1f'),db['sequelize']['fn']('IF',db[_0x82d5('0x1e')]['literal']('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x82d5('0x3c')]],'group':[_0x82d5('0x2f')]})[_0x82d5('0xc')](function(_0x51299f){logger[_0x82d5('0xd')]('GetVoiceQueueHopperHistory',_0x243444);logger[_0x82d5('0xf')](_0x82d5('0x2d'),_0x243444,JSON[_0x82d5('0x12')](_0x51299f));_0x4cdfc5(_0x51299f);})[_0x82d5('0x16')](function(_0x598013){logger[_0x82d5('0x14')]('GetVoiceQueueHopperHistory',_0x598013[_0x82d5('0x15')],_0x243444);_0x4b65bf(_0x21fb67[_0x82d5('0x14')](0x1f4,_0x598013[_0x82d5('0x15')]));});});};exports['GetCampaignHopperHistory']=function(_0x30690e){var _0x38743b=this;return new Promise(function(_0x2fd46a,_0x5ca625){return db['CmHopperHistory']['findAll']({'raw':_0x30690e[_0x82d5('0x1d')]?_0x30690e[_0x82d5('0x1d')][_0x82d5('0x1a')]===undefined?!![]:![]:!![],'where':_0x30690e[_0x82d5('0x1d')]?_0x30690e[_0x82d5('0x1d')][_0x82d5('0x2e')]||null:null,'attributes':[[_0x82d5('0x2f'),_0x82d5('0x3d')],[db['sequelize']['fn'](_0x82d5('0x1f'),db[_0x82d5('0x1e')][_0x82d5('0x3e')]('id')),_0x82d5('0x3f')],[db[_0x82d5('0x1e')]['fn'](_0x82d5('0x1f'),db[_0x82d5('0x1e')]['fn']('IF',db[_0x82d5('0x1e')][_0x82d5('0x23')](_0x82d5('0x21')))),_0x82d5('0x40')]],'group':['campaign']})[_0x82d5('0xc')](function(_0x2cea39){logger[_0x82d5('0xd')](_0x82d5('0x41'),_0x30690e);logger['debug'](_0x82d5('0x41'),_0x30690e,JSON['stringify'](_0x2cea39));_0x2fd46a(_0x2cea39);})['catch'](function(_0x4d67b4){logger[_0x82d5('0x14')](_0x82d5('0x41'),_0x4d67b4[_0x82d5('0x15')],_0x30690e);_0x5ca625(_0x38743b['error'](0x1f4,_0x4d67b4[_0x82d5('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index e05f5af..869efeb 100644 --- a/server/api/cmHopperHistory/index.js +++ b/server/api/cmHopperHistory/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x32d0=['exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','put'];(function(_0x1d5934,_0x2a14e7){var _0x2744da=function(_0x2e665e){while(--_0x2e665e){_0x1d5934['push'](_0x1d5934['shift']());}};_0x2744da(++_0x2a14e7);}(_0x32d0,0x177));var _0x032d=function(_0x1983e8,_0x2d179b){_0x1983e8=_0x1983e8-0x0;var _0x8dd5a=_0x32d0[_0x1983e8];return _0x8dd5a;};'use strict';var multer=require(_0x032d('0x0'));var util=require(_0x032d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x032d('0x2')]();var fs_extra=require(_0x032d('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x032d('0x4'));var config=require(_0x032d('0x5'));var controller=require(_0x032d('0x6'));router['get']('/',auth[_0x032d('0x7')](),controller[_0x032d('0x8')]);router[_0x032d('0x9')](_0x032d('0xa'),auth[_0x032d('0x7')](),controller[_0x032d('0xb')]);router[_0x032d('0x9')](_0x032d('0xc'),auth[_0x032d('0x7')](),controller[_0x032d('0xd')]);router[_0x032d('0xe')]('/',auth[_0x032d('0x7')](),controller['create']);router[_0x032d('0xf')]('/:id',auth[_0x032d('0x7')](),controller['update']);module[_0x032d('0x10')]=router; \ No newline at end of file +var _0x0785=['./cmHopperHistory.controller','isAuthenticated','index','get','/describe','describe','/:id','show','create','put','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x3f395c,_0x1c2edc){var _0x432717=function(_0x4e7e4c){while(--_0x4e7e4c){_0x3f395c['push'](_0x3f395c['shift']());}};_0x432717(++_0x1c2edc);}(_0x0785,0x65));var _0x5078=function(_0x18129a,_0x5c4a20){_0x18129a=_0x18129a-0x0;var _0x5ae32b=_0x0785[_0x18129a];return _0x5ae32b;};'use strict';var multer=require(_0x5078('0x0'));var util=require('util');var path=require(_0x5078('0x1'));var timeout=require('connect-timeout');var express=require(_0x5078('0x2'));var router=express[_0x5078('0x3')]();var fs_extra=require(_0x5078('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5078('0x5'));var config=require(_0x5078('0x6'));var controller=require(_0x5078('0x7'));router['get']('/',auth[_0x5078('0x8')](),controller[_0x5078('0x9')]);router[_0x5078('0xa')](_0x5078('0xb'),auth[_0x5078('0x8')](),controller[_0x5078('0xc')]);router['get'](_0x5078('0xd'),auth[_0x5078('0x8')](),controller[_0x5078('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5078('0xf')]);router[_0x5078('0x10')]('/:id',auth[_0x5078('0x8')](),controller['update']);module[_0x5078('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index aabc46c..9ec0f25 100644 --- a/server/api/cmList/cmList.attributes.js +++ b/server/api/cmList/cmList.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf23b=['exports','STRING','name','sequelize'];(function(_0x47f0c1,_0x1bec8c){var _0x2f3b0c=function(_0xd64c28){while(--_0xd64c28){_0x47f0c1['push'](_0x47f0c1['shift']());}};_0x2f3b0c(++_0x1bec8c);}(_0xf23b,0x133));var _0xbf23=function(_0x28977f,_0x4d3016){_0x28977f=_0x28977f-0x0;var _0x91a0d5=_0xf23b[_0x28977f];return _0x91a0d5;};'use strict';var Sequelize=require(_0xbf23('0x0'));module[_0xbf23('0x1')]={'name':{'type':Sequelize[_0xbf23('0x2')],'unique':_0xbf23('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xbf23('0x2')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbed7=['exports','STRING','name','sequelize'];(function(_0x40a809,_0xafdb46){var _0x3a1927=function(_0x4019c9){while(--_0x4019c9){_0x40a809['push'](_0x40a809['shift']());}};_0x3a1927(++_0xafdb46);}(_0xbed7,0x14b));var _0x7bed=function(_0x477228,_0x4744ef){_0x477228=_0x477228-0x0;var _0x43e05e=_0xbed7[_0x477228];return _0x43e05e;};'use strict';var Sequelize=require(_0x7bed('0x0'));module[_0x7bed('0x1')]={'name':{'type':Sequelize[_0x7bed('0x2')],'unique':_0x7bed('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7bed('0x2')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 34765c7..913e8a2 100644 --- a/server/api/cmList/cmList.controller.js +++ b/server/api/cmList/cmList.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbf3d=['user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ListId','Disposition','getDispositions','findOne','nolimit','order','removeDispositions','ids','addContacts','tags','isArray','join','push','each','omit','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','CmContact','cf_%d','raw','getContactsCsv','OrderBy','select','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','item','from','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','description_additionalPhone_','toString','isEmpty','now','writeFileSync','format','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','text/csv','addCustomField','sequelize','transaction','addCustomFields','Sequelize','text','TEXT','number','INTEGER','switch','BOOLEAN','queryInterface','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','User','getAgents','info','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','update','destroy','then','Lists','UserProfileResource','error','stack','index','map','CmList','rawAttributes','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','include','findAll','rows','catch','show','includeAll','merge','options','find','create','body'];(function(_0x3b0e0c,_0x3f3e40){var _0x5baa46=function(_0x54bc82){while(--_0x54bc82){_0x3b0e0c['push'](_0x3b0e0c['shift']());}};_0x5baa46(++_0x3f3e40);}(_0xbf3d,0xfb));var _0xdbf3=function(_0x3ae690,_0x406b36){_0x3ae690=_0x3ae690-0x0;var _0x3dd33c=_0xbf3d[_0x3ae690];return _0x3dd33c;};'use strict';var emlformat=require(_0xdbf3('0x0'));var rimraf=require(_0xdbf3('0x1'));var zipdir=require(_0xdbf3('0x2'));var jsonpatch=require(_0xdbf3('0x3'));var rp=require(_0xdbf3('0x4'));var moment=require(_0xdbf3('0x5'));var BPromise=require(_0xdbf3('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xdbf3('0x7'));var sox=require(_0xdbf3('0x8'));var csv=require(_0xdbf3('0x9'));var ejs=require(_0xdbf3('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdbf3('0xb'));var squel=require(_0xdbf3('0xc'));var crypto=require(_0xdbf3('0xd'));var jsforce=require(_0xdbf3('0xe'));var deskjs=require(_0xdbf3('0xf'));var toCsv=require(_0xdbf3('0x9'));var querystring=require(_0xdbf3('0x10'));var Papa=require(_0xdbf3('0x11'));var Redis=require(_0xdbf3('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xdbf3('0x13'));var as=require(_0xdbf3('0x14'));var hardwareService=require(_0xdbf3('0x15'));var logger=require(_0xdbf3('0x16'))(_0xdbf3('0x17'));var utils=require(_0xdbf3('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xdbf3('0x19'));var db=require('../../mysqldb')['db'];var csv_results;config[_0xdbf3('0x1a')]=_['defaults'](config['redis'],{'host':_0xdbf3('0x1b'),'port':0x18eb});var socket=require(_0xdbf3('0x1c'))(new Redis(config[_0xdbf3('0x1a')]));require(_0xdbf3('0x1d'))[_0xdbf3('0x1e')](socket);function respondWithStatusCode(_0x3c9bae,_0x7df5ff){_0x7df5ff=_0x7df5ff||0xcc;return function(_0xf1a052){if(_0xf1a052){return _0x3c9bae[_0xdbf3('0x1f')](_0x7df5ff);}return _0x3c9bae[_0xdbf3('0x20')](_0x7df5ff)[_0xdbf3('0x21')]();};}function respondWithResult(_0x435fb9,_0x3ddbe1){_0x3ddbe1=_0x3ddbe1||0xc8;return function(_0x13080f){if(_0x13080f){return _0x435fb9[_0xdbf3('0x20')](_0x3ddbe1)[_0xdbf3('0x22')](_0x13080f);}};}function respondWithFilteredResult(_0x1be8f5,_0x36b1d4){return function(_0x2cc3f8){if(_0x2cc3f8){var _0x2564ee=typeof _0x36b1d4[_0xdbf3('0x23')]==='undefined'&&typeof _0x36b1d4[_0xdbf3('0x24')]===_0xdbf3('0x25');var _0x3ab130=_0x2cc3f8[_0xdbf3('0x26')];var _0x45889d=_0x2564ee?0x0:_0x36b1d4[_0xdbf3('0x23')];var _0x4a741c=_0x2564ee?_0x2cc3f8[_0xdbf3('0x26')]:_0x36b1d4[_0xdbf3('0x23')]+_0x36b1d4[_0xdbf3('0x24')];var _0x3f4ebb;if(_0x4a741c>=_0x3ab130){_0x4a741c=_0x3ab130;_0x3f4ebb=0xc8;}else{_0x3f4ebb=0xce;}_0x1be8f5[_0xdbf3('0x20')](_0x3f4ebb);return _0x1be8f5[_0xdbf3('0x27')]('Content-Range',_0x45889d+'-'+_0x4a741c+'/'+_0x3ab130)[_0xdbf3('0x22')](_0x2cc3f8);}return null;};}function patchUpdates(_0x430eff){return function(_0x53deba){try{jsonpatch[_0xdbf3('0x28')](_0x53deba,_0x430eff,!![]);}catch(_0x574dde){return BPromise['reject'](_0x574dde);}return _0x53deba['save']();};}function saveUpdates(_0x3d5609,_0x537b04){return function(_0x1e6ae0){if(_0x1e6ae0){return _0x1e6ae0[_0xdbf3('0x29')](_0x3d5609)['then'](function(_0x33fc5e){return _0x33fc5e;});}return null;};}function removeEntity(_0x413533,_0x524ce7){return function(_0x289c4d){if(_0x289c4d){return _0x289c4d[_0xdbf3('0x2a')]()[_0xdbf3('0x2b')](function(){var _0x2ffaba=_0x289c4d['get']({'plain':!![]});var _0x51dc84=_0xdbf3('0x2c');return db[_0xdbf3('0x2d')][_0xdbf3('0x2a')]({'where':{'type':_0x51dc84,'resourceId':_0x2ffaba['id']}})['then'](function(){return _0x289c4d;});})[_0xdbf3('0x2b')](function(){_0x413533[_0xdbf3('0x20')](0xcc)[_0xdbf3('0x21')]();});}};}function handleEntityNotFound(_0x30e009,_0x3bf1fe){return function(_0x31abdf){if(!_0x31abdf){_0x30e009['sendStatus'](0x194);}return _0x31abdf;};}function handleError(_0x4c3133,_0x3b5110){_0x3b5110=_0x3b5110||0x1f4;return function(_0x1d0c57){logger[_0xdbf3('0x2e')](_0x1d0c57[_0xdbf3('0x2f')]);if(_0x1d0c57['name']){delete _0x1d0c57['name'];}_0x4c3133[_0xdbf3('0x20')](_0x3b5110)['send'](_0x1d0c57);};}exports[_0xdbf3('0x30')]=function(_0x43d8bb,_0x1bd638){var _0x492d87={},_0x38b10c={},_0x3869e8={'count':0x0,'rows':[]};var _0x475854=_[_0xdbf3('0x31')](db[_0xdbf3('0x32')][_0xdbf3('0x33')],function(_0x2338ca){return{'name':_0x2338ca['fieldName'],'type':_0x2338ca[_0xdbf3('0x34')][_0xdbf3('0x35')]};});_0x38b10c[_0xdbf3('0x36')]=_[_0xdbf3('0x31')](_0x475854,_0xdbf3('0x37'));_0x38b10c[_0xdbf3('0x38')]=_[_0xdbf3('0x39')](_0x43d8bb[_0xdbf3('0x38')]);_0x38b10c[_0xdbf3('0x3a')]=_[_0xdbf3('0x3b')](_0x38b10c[_0xdbf3('0x36')],_0x38b10c[_0xdbf3('0x38')]);_0x492d87[_0xdbf3('0x3c')]=_[_0xdbf3('0x3b')](_0x38b10c[_0xdbf3('0x36')],qs[_0xdbf3('0x3d')](_0x43d8bb['query'][_0xdbf3('0x3d')]));_0x492d87['attributes']=_0x492d87['attributes'][_0xdbf3('0x3e')]?_0x492d87[_0xdbf3('0x3c')]:_0x38b10c[_0xdbf3('0x36')];if(!_0x43d8bb[_0xdbf3('0x38')][_0xdbf3('0x3f')]('nolimit')){_0x492d87[_0xdbf3('0x24')]=qs[_0xdbf3('0x24')](_0x43d8bb[_0xdbf3('0x38')][_0xdbf3('0x24')]);_0x492d87[_0xdbf3('0x23')]=qs[_0xdbf3('0x23')](_0x43d8bb[_0xdbf3('0x38')][_0xdbf3('0x23')]);}_0x492d87['order']=qs[_0xdbf3('0x40')](_0x43d8bb[_0xdbf3('0x38')][_0xdbf3('0x40')]);_0x492d87[_0xdbf3('0x41')]=qs[_0xdbf3('0x3a')](_[_0xdbf3('0x42')](_0x43d8bb[_0xdbf3('0x38')],_0x38b10c[_0xdbf3('0x3a')]),_0x475854);if(_0x43d8bb[_0xdbf3('0x38')][_0xdbf3('0x43')]){_0x492d87[_0xdbf3('0x41')]=_['merge'](_0x492d87[_0xdbf3('0x41')],{'$or':_[_0xdbf3('0x31')](_0x475854,function(_0x29f5dd){if(_0x29f5dd['type']!=='VIRTUAL'){var _0x3af03a={};_0x3af03a[_0x29f5dd[_0xdbf3('0x37')]]={'$like':'%'+_0x43d8bb[_0xdbf3('0x38')][_0xdbf3('0x43')]+'%'};return _0x3af03a;}})});}_0x492d87=_['merge']({},_0x492d87,_0x43d8bb['options']);var _0x1d7a14={'where':_0x492d87['where']};return db['CmList'][_0xdbf3('0x26')](_0x1d7a14)[_0xdbf3('0x2b')](function(_0x5e1262){_0x3869e8[_0xdbf3('0x26')]=_0x5e1262;if(_0x43d8bb[_0xdbf3('0x38')]['includeAll']){_0x492d87[_0xdbf3('0x44')]=[{'all':!![]}];}return db['CmList'][_0xdbf3('0x45')](_0x492d87);})[_0xdbf3('0x2b')](function(_0x130669){_0x3869e8[_0xdbf3('0x46')]=_0x130669;return _0x3869e8;})['then'](respondWithFilteredResult(_0x1bd638,_0x492d87))[_0xdbf3('0x47')](handleError(_0x1bd638,null));};exports[_0xdbf3('0x48')]=function(_0x586fde,_0x1aa9a8){var _0x1405bf={'raw':![],'where':{'id':_0x586fde['params']['id']}},_0x2e0cbe={};_0x2e0cbe[_0xdbf3('0x36')]=_['keys'](db[_0xdbf3('0x32')][_0xdbf3('0x33')]);_0x2e0cbe['query']=_['keys'](_0x586fde[_0xdbf3('0x38')]);_0x2e0cbe[_0xdbf3('0x3a')]=_[_0xdbf3('0x3b')](_0x2e0cbe['model'],_0x2e0cbe[_0xdbf3('0x38')]);_0x1405bf[_0xdbf3('0x3c')]=_[_0xdbf3('0x3b')](_0x2e0cbe['model'],qs[_0xdbf3('0x3d')](_0x586fde['query']['fields']));_0x1405bf[_0xdbf3('0x3c')]=_0x1405bf['attributes'][_0xdbf3('0x3e')]?_0x1405bf[_0xdbf3('0x3c')]:_0x2e0cbe[_0xdbf3('0x36')];if(_0x586fde[_0xdbf3('0x38')][_0xdbf3('0x49')]){_0x1405bf[_0xdbf3('0x44')]=[{'all':!![]}];}_0x1405bf=_[_0xdbf3('0x4a')]({},_0x1405bf,_0x586fde[_0xdbf3('0x4b')]);return db[_0xdbf3('0x32')][_0xdbf3('0x4c')](_0x1405bf)[_0xdbf3('0x2b')](handleEntityNotFound(_0x1aa9a8,null))[_0xdbf3('0x2b')](respondWithResult(_0x1aa9a8,null))['catch'](handleError(_0x1aa9a8,null));};exports[_0xdbf3('0x4d')]=function(_0x29ce38,_0x570b22){return db[_0xdbf3('0x32')]['create'](_0x29ce38[_0xdbf3('0x4e')],{})[_0xdbf3('0x2b')](function(_0x23b81d){var _0x3af6aa=_0x29ce38[_0xdbf3('0x4f')]['get']({'plain':!![]});if(!_0x3af6aa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3af6aa[_0xdbf3('0x50')]===_0xdbf3('0x4f')){var _0x1f0bbd=_0x23b81d['get']({'plain':!![]});var _0x2a93cd='Lists';return db[_0xdbf3('0x51')][_0xdbf3('0x4c')]({'where':{'name':_0x2a93cd,'userProfileId':_0x3af6aa[_0xdbf3('0x52')]},'raw':!![]})[_0xdbf3('0x2b')](function(_0x119b05){if(_0x119b05&&_0x119b05[_0xdbf3('0x53')]===0x0){return db[_0xdbf3('0x2d')][_0xdbf3('0x4d')]({'name':_0x1f0bbd[_0xdbf3('0x37')],'resourceId':_0x1f0bbd['id'],'type':_0x119b05[_0xdbf3('0x37')],'sectionId':_0x119b05['id']},{})[_0xdbf3('0x2b')](function(){return _0x23b81d;});}else{return _0x23b81d;}})[_0xdbf3('0x47')](function(_0x5a3618){logger['error'](_0xdbf3('0x54'),_0x5a3618);throw _0x5a3618;});}return _0x23b81d;})[_0xdbf3('0x2b')](respondWithResult(_0x570b22,0xc9))['catch'](handleError(_0x570b22,null));};exports[_0xdbf3('0x29')]=function(_0x24e6cd,_0x519c1d){if(_0x24e6cd['body']['id']){delete _0x24e6cd['body']['id'];}return db['CmList'][_0xdbf3('0x4c')]({'where':{'id':_0x24e6cd[_0xdbf3('0x55')]['id']}})[_0xdbf3('0x2b')](handleEntityNotFound(_0x519c1d,null))[_0xdbf3('0x2b')](saveUpdates(_0x24e6cd[_0xdbf3('0x4e')],null))[_0xdbf3('0x2b')](respondWithResult(_0x519c1d,null))['catch'](handleError(_0x519c1d,null));};exports[_0xdbf3('0x2a')]=function(_0x59f55d,_0x1f132c){return db[_0xdbf3('0x32')]['find']({'where':{'id':_0x59f55d[_0xdbf3('0x55')]['id']}})[_0xdbf3('0x2b')](handleEntityNotFound(_0x1f132c,null))[_0xdbf3('0x2b')](removeEntity(_0x1f132c,null))[_0xdbf3('0x47')](handleError(_0x1f132c,null));};exports[_0xdbf3('0x56')]=function(_0x3d2350,_0x234c51){return db[_0xdbf3('0x32')][_0xdbf3('0x56')]()[_0xdbf3('0x2b')](respondWithResult(_0x234c51,null))[_0xdbf3('0x47')](handleError(_0x234c51,null));};exports[_0xdbf3('0x57')]=function(_0x45fba9,_0x231ebe,_0x350d6c){if(_0x45fba9[_0xdbf3('0x4e')]['id']){delete _0x45fba9[_0xdbf3('0x4e')]['id'];}return db[_0xdbf3('0x32')][_0xdbf3('0x4c')]({'where':{'id':_0x45fba9['params']['id']}})[_0xdbf3('0x2b')](handleEntityNotFound(_0x231ebe,null))[_0xdbf3('0x2b')](function(_0x270cd9){if(_0x270cd9){_0x45fba9['body'][_0xdbf3('0x58')]=_0x270cd9['id'];return db[_0xdbf3('0x59')][_0xdbf3('0x4d')](_0x45fba9['body']);}})[_0xdbf3('0x2b')](respondWithResult(_0x231ebe,null))['catch'](handleError(_0x231ebe,null));};exports[_0xdbf3('0x5a')]=function(_0x184906,_0x1e2aff,_0x3535ca){var _0x67afff={'raw':![],'where':{}};var _0xff691b={};var _0x169695={'count':0x0,'rows':[]};return db[_0xdbf3('0x32')][_0xdbf3('0x5b')]({'where':{'id':_0x184906[_0xdbf3('0x55')]['id']}})[_0xdbf3('0x2b')](handleEntityNotFound(_0x1e2aff,null))[_0xdbf3('0x2b')](function(_0x468397){if(_0x468397){_0xff691b[_0xdbf3('0x36')]=_['keys'](db['Disposition'][_0xdbf3('0x33')]);_0xff691b[_0xdbf3('0x38')]=_[_0xdbf3('0x39')](_0x184906[_0xdbf3('0x38')]);_0xff691b['filters']=_[_0xdbf3('0x3b')](_0xff691b['model'],_0xff691b['query']);_0x67afff['attributes']=_['intersection'](_0xff691b[_0xdbf3('0x36')],qs[_0xdbf3('0x3d')](_0x184906['query'][_0xdbf3('0x3d')]));_0x67afff[_0xdbf3('0x3c')]=_0x67afff[_0xdbf3('0x3c')]['length']?_0x67afff[_0xdbf3('0x3c')]:_0xff691b[_0xdbf3('0x36')];if(!_0x184906['query']['hasOwnProperty'](_0xdbf3('0x5c'))){_0x67afff[_0xdbf3('0x24')]=qs['limit'](_0x184906[_0xdbf3('0x38')]['limit']);_0x67afff[_0xdbf3('0x23')]=qs['offset'](_0x184906[_0xdbf3('0x38')]['offset']);}_0x67afff[_0xdbf3('0x5d')]=qs['sort'](_0x184906[_0xdbf3('0x38')][_0xdbf3('0x40')]);_0x67afff[_0xdbf3('0x41')]=qs['filters'](_[_0xdbf3('0x42')](_0x184906[_0xdbf3('0x38')],_0xff691b[_0xdbf3('0x3a')]));_0x67afff[_0xdbf3('0x41')][_0xdbf3('0x58')]=_0x468397['id'];if(_0x184906['query'][_0xdbf3('0x43')]){_0x67afff['where']=_[_0xdbf3('0x4a')](_0x67afff[_0xdbf3('0x41')],{'$or':_[_0xdbf3('0x31')](_0x67afff[_0xdbf3('0x3c')],function(_0xf81132){var _0x2154fe={};_0x2154fe[_0xf81132]={'$like':'%'+_0x184906[_0xdbf3('0x38')]['filter']+'%'};return _0x2154fe;})});}_0x67afff=_[_0xdbf3('0x4a')]({},_0x67afff,_0x184906[_0xdbf3('0x4b')]);return db[_0xdbf3('0x59')]['count']({'where':_0x67afff[_0xdbf3('0x41')]})[_0xdbf3('0x2b')](function(_0xaff07c){_0x169695[_0xdbf3('0x26')]=_0xaff07c;if(_0x184906[_0xdbf3('0x38')][_0xdbf3('0x49')]){_0x67afff[_0xdbf3('0x44')]=[{'all':!![]}];}return db[_0xdbf3('0x59')]['findAll'](_0x67afff);})[_0xdbf3('0x2b')](function(_0x2482d1){_0x169695[_0xdbf3('0x46')]=_0x2482d1;return _0x169695;});}})[_0xdbf3('0x2b')](respondWithFilteredResult(_0x1e2aff,_0x67afff))['catch'](handleError(_0x1e2aff,null));};exports[_0xdbf3('0x5e')]=function(_0x1c68fc,_0x5a2caf,_0x1186cd){return db[_0xdbf3('0x32')][_0xdbf3('0x4c')]({'where':{'id':_0x1c68fc['params']['id']}})[_0xdbf3('0x2b')](handleEntityNotFound(_0x5a2caf,null))[_0xdbf3('0x2b')](function(_0x4f5b05){if(_0x4f5b05){return _0x4f5b05[_0xdbf3('0x5e')](_0x1c68fc['query'][_0xdbf3('0x5f')]);}})[_0xdbf3('0x2b')](respondWithStatusCode(_0x5a2caf,null))[_0xdbf3('0x47')](handleError(_0x5a2caf,null));};exports[_0xdbf3('0x60')]=function(_0xd4c699,_0x4a6d0c,_0x90de9e){return db['CmList'][_0xdbf3('0x4c')]({'where':{'id':_0xd4c699[_0xdbf3('0x55')]['id']}})[_0xdbf3('0x2b')](handleEntityNotFound(_0x4a6d0c,null))[_0xdbf3('0x2b')](function(_0x47cd85){if(_0x47cd85){var _0x48535e=[];var _0x5d3532={'success':[],'errors':[]};return db['CmContact'][_0xdbf3('0x56')]()[_0xdbf3('0x2b')](function(_0x34cb4c){if(_0xd4c699[_0xdbf3('0x4e')][_0xdbf3('0x61')]&&_[_0xdbf3('0x62')](_0xd4c699[_0xdbf3('0x4e')][_0xdbf3('0x61')])){if(_0xd4c699['body']['tags'][_0xdbf3('0x3e')]){_0xd4c699[_0xdbf3('0x4e')][_0xdbf3('0x61')]=_0xd4c699[_0xdbf3('0x4e')][_0xdbf3('0x61')][_0xdbf3('0x63')](';')+';';}else{_0xd4c699[_0xdbf3('0x4e')][_0xdbf3('0x61')]=null;}}else{_0xd4c699[_0xdbf3('0x4e')][_0xdbf3('0x61')]=null;}if(_0xd4c699['body']&&_[_0xdbf3('0x62')](_0xd4c699[_0xdbf3('0x4e')])){for(var _0x4d9e8a=0x0;_0x4d9e8a<_0xd4c699[_0xdbf3('0x4e')][_0xdbf3('0x3e')];_0x4d9e8a+=0x1){_0xd4c699[_0xdbf3('0x4e')][_0x4d9e8a]['ListId']=_0xd4c699[_0xdbf3('0x55')]['id'];_0x48535e[_0xdbf3('0x64')](_0xd4c699[_0xdbf3('0x4e')][_0x4d9e8a]);}return BPromise[_0xdbf3('0x65')](_0x48535e,function(_0x2ba0c0){return db['CmContact'][_0xdbf3('0x4d')](_[_0xdbf3('0x66')](_0x2ba0c0,['ids','id'])||{},{'fields':_[_0xdbf3('0x39')](_0x34cb4c),'raw':!![]})[_0xdbf3('0x2b')](function(_0x24d341){_0x5d3532['success'][_0xdbf3('0x64')](_0x24d341[_0xdbf3('0x67')]);})[_0xdbf3('0x47')](function(_0x1d1cf2){_0x5d3532[_0xdbf3('0x68')][_0xdbf3('0x64')]({'data':_0x2ba0c0,'error':_0x1d1cf2[_0xdbf3('0x69')]});});})['then'](function(_0x3cbc8a){return _0x5d3532;})['catch'](function(_0x4f82fd){return _0x4f82fd;});}else{_0x4a6d0c[_0xdbf3('0x20')](0x190)[_0xdbf3('0x22')]({'message':_0xdbf3('0x6a')});}});}})[_0xdbf3('0x2b')](respondWithResult(_0x4a6d0c,null))[_0xdbf3('0x47')](handleError(_0x4a6d0c,null));};exports[_0xdbf3('0x6b')]=function(_0x527ad5,_0x176342,_0x4c2324){var _0x2dfe78;return db[_0xdbf3('0x32')]['find']({'where':{'id':_0x527ad5[_0xdbf3('0x55')]['id']},'include':[{'model':db[_0xdbf3('0x6c')],'as':_0xdbf3('0x6d')}]})[_0xdbf3('0x2b')](handleEntityNotFound(_0x176342,null))[_0xdbf3('0x2b')](function(_0x2671c3){if(_0x2671c3){_0x2dfe78=_0x2671c3;return db[_0xdbf3('0x6e')][_0xdbf3('0x33')];}})['then'](function(_0x371e82){if(_0x371e82){var _0xbafc6a={};var _0x20d7cb={};_0x20d7cb[_0xdbf3('0x36')]=_['concat'](_['keys'](_0x371e82),_[_0xdbf3('0x31')](_0x2dfe78['CustomFields'],function(_0x39218e){return util['format'](_0xdbf3('0x6f'),_0x39218e['id']);}));_0x20d7cb[_0xdbf3('0x38')]=_[_0xdbf3('0x39')](_0x527ad5[_0xdbf3('0x38')]);_0x20d7cb[_0xdbf3('0x3a')]=_[_0xdbf3('0x3b')](_0x20d7cb[_0xdbf3('0x36')],_0x20d7cb[_0xdbf3('0x38')]);_0xbafc6a['attributes']=_[_0xdbf3('0x3b')](_0x20d7cb[_0xdbf3('0x36')],qs[_0xdbf3('0x3d')](_0x527ad5[_0xdbf3('0x38')][_0xdbf3('0x3d')]));_0xbafc6a[_0xdbf3('0x3c')]=_0xbafc6a[_0xdbf3('0x3c')][_0xdbf3('0x3e')]?_0xbafc6a[_0xdbf3('0x3c')]:_0x20d7cb[_0xdbf3('0x36')];if(!_0x527ad5[_0xdbf3('0x38')]['hasOwnProperty']('nolimit')){_0xbafc6a[_0xdbf3('0x24')]=qs[_0xdbf3('0x24')](_0x527ad5[_0xdbf3('0x38')][_0xdbf3('0x24')]);_0xbafc6a['offset']=qs[_0xdbf3('0x23')](_0x527ad5['query'][_0xdbf3('0x23')]);}_0xbafc6a['order']=qs[_0xdbf3('0x40')](_0x527ad5[_0xdbf3('0x38')][_0xdbf3('0x40')]);_0xbafc6a[_0xdbf3('0x41')]=qs[_0xdbf3('0x3a')](_[_0xdbf3('0x42')](_0x527ad5['query'],_0x20d7cb['filters']));_0xbafc6a[_0xdbf3('0x70')]=!![];if(_0x527ad5[_0xdbf3('0x38')][_0xdbf3('0x43')]){_0xbafc6a[_0xdbf3('0x41')]=_[_0xdbf3('0x4a')](_0xbafc6a[_0xdbf3('0x41')],{'$or':_[_0xdbf3('0x31')](_0xbafc6a['attributes'],function(_0x4fa354){var _0x80468={};_0x80468[_0x4fa354]={'$like':'%'+_0x527ad5[_0xdbf3('0x38')][_0xdbf3('0x43')]+'%'};return _0x80468;})});}_0xbafc6a=_[_0xdbf3('0x4a')]({},_0xbafc6a,_0x527ad5['options']);return _0x2dfe78[_0xdbf3('0x6b')](_0xbafc6a);}})[_0xdbf3('0x2b')](respondWithResult(_0x176342,null))[_0xdbf3('0x47')](handleError(_0x176342,null));};exports[_0xdbf3('0x71')]=function(_0x334572,_0x1572d4,_0x4cbe25){var _0x2f01b0;var _0xf30a0b;var _0x1e462a;var _0x4dd2dc=_0x334572[_0xdbf3('0x55')]['id'];csv_results=[];return db['ContactItemType'][_0xdbf3('0x45')]({'attributes':['id',_0xdbf3('0x37')],'raw':!![],'order':[_0xdbf3('0x72')]})[_0xdbf3('0x2b')](function(_0x40fe1f){_0x2f01b0=_0x40fe1f;var _0x585033=_['keys'](db[_0xdbf3('0x6e')]['rawAttributes']);return db['CmCustomField'][_0xdbf3('0x45')]({'raw':!![],'attributes':['id','alias']})[_0xdbf3('0x2b')](function(_0x4b1df7){_0xf30a0b=_0x4b1df7;var _0x595032=squel[_0xdbf3('0x73')]()[_0xdbf3('0x3d')](_0x585033)['from'](_0xdbf3('0x74'),'c')[_0xdbf3('0x41')](_0xdbf3('0x75'),_0x4dd2dc)['where'](_0xdbf3('0x76'))[_0xdbf3('0x77')]();for(var _0x406641=0x0;_0x406641<_0xf30a0b[_0xdbf3('0x3e')];_0x406641++){_0x595032[_0xdbf3('0x78')]('c.cf_'+_0xf30a0b[_0x406641]['id'],'customField_'+_0xf30a0b[_0x406641]['alias']);}for(var _0x406641=0x0;_0x406641<_0x2f01b0[_0xdbf3('0x3e')];_0x406641++){_0x595032[_0xdbf3('0x78')](squel[_0xdbf3('0x73')]()[_0xdbf3('0x78')](_0xdbf3('0x79'))[_0xdbf3('0x7a')](_0xdbf3('0x7b'))[_0xdbf3('0x41')](_0xdbf3('0x7c'),_0x2f01b0[_0x406641]['id'])[_0xdbf3('0x41')](_0xdbf3('0x7d')),_0xdbf3('0x7e')+_0x2f01b0[_0x406641]['name']);_0x595032['field'](squel[_0xdbf3('0x73')]()[_0xdbf3('0x78')](_0xdbf3('0x7f'))[_0xdbf3('0x7a')]('cm_contact_has_items')[_0xdbf3('0x41')](_0xdbf3('0x7c'),_0x2f01b0[_0x406641]['id'])[_0xdbf3('0x41')]('CmContactId\x20=\x20c.id'),_0xdbf3('0x80')+_0x2f01b0[_0x406641][_0xdbf3('0x37')]);}var _0x33ce14=[];_0x33ce14[_0xdbf3('0x64')](_0x595032[_0xdbf3('0x81')]());BPromise['each'](_0x33ce14,handleQuery)[_0xdbf3('0x2b')](function(_0x4088ed){handleQuery(_0x595032[_0xdbf3('0x81')]());var _0x4c111a=csv_results[0x0];if(!_[_0xdbf3('0x82')](_0x4c111a)){var _0x5bb959=toCsv(_0x4c111a);var _0x1be169=Date[_0xdbf3('0x83')]();fs[_0xdbf3('0x84')](util[_0xdbf3('0x85')](_0xdbf3('0x86'),_0x4dd2dc,_0x1be169),_0x5bb959);_0x1572d4[_0xdbf3('0x87')](_0xdbf3('0x88'),_0xdbf3('0x89')+util[_0xdbf3('0x85')](_0xdbf3('0x8a'),_0x4dd2dc,_0x1be169));_0x1572d4[_0xdbf3('0x87')]('Content-type',_0xdbf3('0x8b'));return _0x1572d4['download'](util[_0xdbf3('0x85')](_0xdbf3('0x86'),_0x4dd2dc,_0x1be169));}else{return _0x1572d4[_0xdbf3('0x1f')](0xcc);}});});});};exports[_0xdbf3('0x8c')]=function(_0x99d2be,_0x28c222,_0x121c5c){var _0x381c09;delete _0x99d2be[_0xdbf3('0x4e')]['id'];return db[_0xdbf3('0x32')][_0xdbf3('0x5b')]({'where':{'id':_0x99d2be[_0xdbf3('0x55')]['id']}})[_0xdbf3('0x2b')](handleEntityNotFound(_0x28c222,null))['then'](function(_0x2d315a){if(_0x2d315a){return db[_0xdbf3('0x8d')][_0xdbf3('0x8e')](function(_0x5af9dc){return db[_0xdbf3('0x6c')][_0xdbf3('0x4d')](_0x99d2be[_0xdbf3('0x4e')],{'transaction':_0x5af9dc})[_0xdbf3('0x2b')](function(_0x1b9807){_0x381c09=_0x1b9807;return _0x2d315a[_0xdbf3('0x8f')](_0x1b9807,{'transaction':_0x5af9dc});})[_0xdbf3('0x2b')](function(){var _0x4b241e={'type':db[_0xdbf3('0x90')]['TEXT'],'transaction':_0x5af9dc};switch(_0x99d2be[_0xdbf3('0x4e')][_0xdbf3('0x34')]){case _0xdbf3('0x91'):_0x4b241e[_0xdbf3('0x34')]=db[_0xdbf3('0x90')][_0xdbf3('0x92')];break;case _0xdbf3('0x93'):_0x4b241e[_0xdbf3('0x34')]=db['Sequelize'][_0xdbf3('0x94')];break;case _0xdbf3('0x95'):_0x4b241e[_0xdbf3('0x34')]=db[_0xdbf3('0x90')][_0xdbf3('0x96')];_0x4b241e['defaultValue']=![];break;default:}return db[_0xdbf3('0x8d')][_0xdbf3('0x97')]['addColumn']('cm_contacts',util[_0xdbf3('0x85')](_0xdbf3('0x98'),_0x381c09['id']),_0x4b241e);})[_0xdbf3('0x2b')](function(){return _0x381c09;});});}})[_0xdbf3('0x2b')](respondWithResult(_0x28c222,null))[_0xdbf3('0x47')](handleError(_0x28c222,null));};exports[_0xdbf3('0x99')]=function(_0xdd0245,_0x2075cc,_0x35facc){var _0x2c63b9={};var _0x465c8b={};var _0x2e592c;var _0xce6fc0;return db[_0xdbf3('0x32')][_0xdbf3('0x5b')]({'where':{'id':_0xdd0245[_0xdbf3('0x55')]['id']}})[_0xdbf3('0x2b')](handleEntityNotFound(_0x2075cc,null))[_0xdbf3('0x2b')](function(_0xe8e8f0){if(_0xe8e8f0){_0x2e592c=_0xe8e8f0;_0x465c8b[_0xdbf3('0x36')]=_[_0xdbf3('0x39')](db[_0xdbf3('0x6c')]['rawAttributes']);_0x465c8b['query']=_[_0xdbf3('0x39')](_0xdd0245[_0xdbf3('0x38')]);_0x465c8b[_0xdbf3('0x3a')]=_[_0xdbf3('0x3b')](_0x465c8b[_0xdbf3('0x36')],_0x465c8b['query']);_0x2c63b9[_0xdbf3('0x3c')]=_[_0xdbf3('0x3b')](_0x465c8b['model'],qs[_0xdbf3('0x3d')](_0xdd0245[_0xdbf3('0x38')]['fields']));_0x2c63b9['attributes']=_0x2c63b9['attributes'][_0xdbf3('0x3e')]?_0x2c63b9[_0xdbf3('0x3c')]:_0x465c8b['model'];_0x2c63b9[_0xdbf3('0x5d')]=qs[_0xdbf3('0x40')](_0xdd0245[_0xdbf3('0x38')]['sort']);_0x2c63b9['where']=qs['filters'](_[_0xdbf3('0x42')](_0xdd0245['query'],_0x465c8b[_0xdbf3('0x3a')]));_0x2c63b9[_0xdbf3('0x41')]=_['merge'](_0x2c63b9['where'],{'$or':[{'ListId':_0xe8e8f0['id']},{'ListId':null}]});if(_0xdd0245[_0xdbf3('0x38')][_0xdbf3('0x43')]){_0x2c63b9['where']=_[_0xdbf3('0x4a')](_0x2c63b9[_0xdbf3('0x41')],{'$or':_[_0xdbf3('0x31')](_0x2c63b9[_0xdbf3('0x3c')],function(_0x2d719e){var _0x4a3b74={};_0x4a3b74[_0x2d719e]={'$like':'%'+_0xdd0245['query'][_0xdbf3('0x43')]+'%'};return _0x4a3b74;})});}_0x2c63b9=_[_0xdbf3('0x4a')]({},_0x2c63b9,_0xdd0245[_0xdbf3('0x4b')]);return db[_0xdbf3('0x6c')][_0xdbf3('0x9a')](_0x2c63b9);}})[_0xdbf3('0x2b')](respondWithResult(_0x2075cc,null))[_0xdbf3('0x47')](handleError(_0x2075cc,null));};exports[_0xdbf3('0x9b')]=function(_0x5b8b65,_0x5d68cd){return db[_0xdbf3('0x6c')][_0xdbf3('0x9a')]({'where':{'ListId':null}})[_0xdbf3('0x2b')](handleEntityNotFound(_0x5d68cd,null))[_0xdbf3('0x2b')](function(_0x59ffb5){return _0x59ffb5;})[_0xdbf3('0x2b')](respondWithResult(_0x5d68cd,null))[_0xdbf3('0x47')](handleError(_0x5d68cd,null));};exports[_0xdbf3('0x9c')]=function(_0x1b36ec,_0x189eed,_0xcc89a7){return db[_0xdbf3('0x32')][_0xdbf3('0x4c')]({'where':{'id':_0x1b36ec['params']['id']}})[_0xdbf3('0x2b')](handleEntityNotFound(_0x189eed,null))[_0xdbf3('0x2b')](function(_0x5bfaed){if(_0x5bfaed){return _0x5bfaed[_0xdbf3('0x9c')](_0x1b36ec[_0xdbf3('0x4e')][_0xdbf3('0x5f')],_[_0xdbf3('0x66')](_0x1b36ec['body'],[_0xdbf3('0x5f'),'id'])||{})[_0xdbf3('0x9d')](function(_0x4d22ea){for(var _0x5138b6=0x0;_0x5138b6<_0x1b36ec[_0xdbf3('0x4e')][_0xdbf3('0x5f')]['length'];_0x5138b6+=0x1){socket[_0xdbf3('0x9e')](_0xdbf3('0x9f'),{'UserId':Number(_0x1b36ec[_0xdbf3('0x4e')]['ids'][_0x5138b6]),'CmListId':Number(_0x1b36ec['params']['id'])});}return _0x4d22ea;});}})[_0xdbf3('0x2b')](respondWithResult(_0x189eed,null))[_0xdbf3('0x47')](handleError(_0x189eed,null));};exports[_0xdbf3('0xa0')]=function(_0x29ed3b,_0x7ae3a0,_0x459d0b){return db[_0xdbf3('0x32')][_0xdbf3('0x4c')]({'where':{'id':_0x29ed3b['params']['id']}})[_0xdbf3('0x2b')](handleEntityNotFound(_0x7ae3a0,null))[_0xdbf3('0x2b')](function(_0x31194c){if(_0x31194c){return _0x31194c[_0xdbf3('0xa0')](_0x29ed3b['query'][_0xdbf3('0x5f')])[_0xdbf3('0x2b')](function(){if(_[_0xdbf3('0x62')](_0x29ed3b[_0xdbf3('0x38')]['ids'])){for(var _0x3605e0=0x0;_0x3605e0<_0x29ed3b[_0xdbf3('0x38')][_0xdbf3('0x5f')][_0xdbf3('0x3e')];_0x3605e0+=0x1){socket[_0xdbf3('0x9e')](_0xdbf3('0xa1'),{'UserId':Number(_0x29ed3b[_0xdbf3('0x38')][_0xdbf3('0x5f')][_0x3605e0]),'CmListId':Number(_0x29ed3b[_0xdbf3('0x55')]['id'])});}}else{socket['emit'](_0xdbf3('0xa1'),{'UserId':Number(_0x29ed3b[_0xdbf3('0x38')][_0xdbf3('0x5f')]),'CmListId':Number(_0x29ed3b['params']['id'])});}});}})['then'](respondWithStatusCode(_0x7ae3a0,null))[_0xdbf3('0x47')](handleError(_0x7ae3a0,null));};exports['getAgents']=function(_0x564d0d,_0x44631b,_0x1fb6d7){var _0x156cb={};var _0x548233={};var _0x469408;var _0x4f0e3b;return db[_0xdbf3('0x32')][_0xdbf3('0x5b')]({'where':{'id':_0x564d0d['params']['id']}})['then'](handleEntityNotFound(_0x44631b,null))[_0xdbf3('0x2b')](function(_0x4789b9){if(_0x4789b9){_0x469408=_0x4789b9;_0x548233['model']=_[_0xdbf3('0x39')](db[_0xdbf3('0xa2')]['rawAttributes']);_0x548233[_0xdbf3('0x38')]=_[_0xdbf3('0x39')](_0x564d0d[_0xdbf3('0x38')]);_0x548233[_0xdbf3('0x3a')]=_['intersection'](_0x548233['model'],_0x548233['query']);_0x156cb[_0xdbf3('0x3c')]=_[_0xdbf3('0x3b')](_0x548233[_0xdbf3('0x36')],qs['fields'](_0x564d0d[_0xdbf3('0x38')][_0xdbf3('0x3d')]));_0x156cb['attributes']=_0x156cb[_0xdbf3('0x3c')][_0xdbf3('0x3e')]?_0x156cb[_0xdbf3('0x3c')]:_0x548233[_0xdbf3('0x36')];_0x156cb[_0xdbf3('0x5d')]=qs[_0xdbf3('0x40')](_0x564d0d[_0xdbf3('0x38')][_0xdbf3('0x40')]);_0x156cb['where']=qs[_0xdbf3('0x3a')](_[_0xdbf3('0x42')](_0x564d0d[_0xdbf3('0x38')],_0x548233['filters']));if(_0x564d0d['query']['filter']){_0x156cb[_0xdbf3('0x41')]=_[_0xdbf3('0x4a')](_0x156cb[_0xdbf3('0x41')],{'$or':_['map'](_0x156cb['attributes'],function(_0x23de18){var _0x32c235={};_0x32c235[_0x23de18]={'$like':'%'+_0x564d0d['query']['filter']+'%'};return _0x32c235;})});}_0x156cb=_[_0xdbf3('0x4a')]({},_0x156cb,_0x564d0d['options']);return _0x469408[_0xdbf3('0xa3')](_0x156cb);}})['then'](function(_0x373d46){if(_0x373d46){_0x4f0e3b=_0x373d46[_0xdbf3('0x3e')];if(!_0x564d0d[_0xdbf3('0x38')][_0xdbf3('0x3f')](_0xdbf3('0x5c'))){_0x156cb[_0xdbf3('0x24')]=qs[_0xdbf3('0x24')](_0x564d0d[_0xdbf3('0x38')][_0xdbf3('0x24')]);_0x156cb[_0xdbf3('0x23')]=qs['offset'](_0x564d0d['query'][_0xdbf3('0x23')]);}return _0x469408[_0xdbf3('0xa3')](_0x156cb);}})[_0xdbf3('0x2b')](function(_0x243443){if(_0x243443){return _0x243443?{'count':_0x4f0e3b,'rows':_0x243443}:null;}})['then'](respondWithResult(_0x44631b,null))[_0xdbf3('0x47')](handleError(_0x44631b,null));};function handleQuery(_0x2d9190){logger[_0xdbf3('0xa4')](_0x2d9190);return db[_0xdbf3('0x8d')]['query'](_0x2d9190)[_0xdbf3('0x9d')](function(_0x11920f){csv_results['push'](_0x11920f);})['catch'](function(_0x1cb909){logger['error'](_0x1cb909[_0xdbf3('0x69')]);});} \ No newline at end of file +var _0xcc70=['cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','description_additionalPhone_','toString','each','now','writeFileSync','format','/tmp/list_%d_%s.csv','attachment;\x20filename=','setHeader','Content-type','text/csv','download','addCustomField','transaction','addCustomFields','TEXT','text','Sequelize','number','INTEGER','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','findAndCountAll','getGlobalCustomFields','addAgents','omit','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','info','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','register','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','then','destroy','Lists','UserProfileResource','end','stack','send','rawAttributes','type','key','model','map','name','keys','filters','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','CmList','findAll','catch','show','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ListId','Disposition','getDispositions','findOne','order','rows','removeDispositions','addContacts','CmContact','tags','isArray','join','push','ids','success','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','cf_%d','pick','raw','getContactsCsv','ContactItemType','alias','select','from','c.ListId\x20=\x20?','distinct','field','customField_','item'];(function(_0x43c307,_0x24189e){var _0x525e69=function(_0x4a01fe){while(--_0x4a01fe){_0x43c307['push'](_0x43c307['shift']());}};_0x525e69(++_0x24189e);}(_0xcc70,0x17f));var _0x0cc7=function(_0x4e6eb2,_0x16a451){_0x4e6eb2=_0x4e6eb2-0x0;var _0x4e0c1c=_0xcc70[_0x4e6eb2];return _0x4e0c1c;};'use strict';var emlformat=require(_0x0cc7('0x0'));var rimraf=require(_0x0cc7('0x1'));var zipdir=require(_0x0cc7('0x2'));var jsonpatch=require(_0x0cc7('0x3'));var rp=require(_0x0cc7('0x4'));var moment=require(_0x0cc7('0x5'));var BPromise=require(_0x0cc7('0x6'));var Mustache=require(_0x0cc7('0x7'));var util=require(_0x0cc7('0x8'));var path=require(_0x0cc7('0x9'));var sox=require(_0x0cc7('0xa'));var csv=require(_0x0cc7('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0cc7('0xc'));var _=require(_0x0cc7('0xd'));var squel=require(_0x0cc7('0xe'));var crypto=require(_0x0cc7('0xf'));var jsforce=require(_0x0cc7('0x10'));var deskjs=require(_0x0cc7('0x11'));var toCsv=require(_0x0cc7('0xb'));var querystring=require(_0x0cc7('0x12'));var Papa=require(_0x0cc7('0x13'));var Redis=require(_0x0cc7('0x14'));var authService=require(_0x0cc7('0x15'));var qs=require(_0x0cc7('0x16'));var as=require(_0x0cc7('0x17'));var hardwareService=require(_0x0cc7('0x18'));var logger=require(_0x0cc7('0x19'))(_0x0cc7('0x1a'));var utils=require(_0x0cc7('0x1b'));var config=require('../../config/environment');var licenseUtil=require(_0x0cc7('0x1c'));var db=require(_0x0cc7('0x1d'))['db'];var csv_results;config['redis']=_[_0x0cc7('0x1e')](config[_0x0cc7('0x1f')],{'host':_0x0cc7('0x20'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0cc7('0x1f')]));require('./cmList.socket')[_0x0cc7('0x21')](socket);function respondWithStatusCode(_0x30137f,_0x3d96bd){_0x3d96bd=_0x3d96bd||0xcc;return function(_0x3ebc51){if(_0x3ebc51){return _0x30137f[_0x0cc7('0x22')](_0x3d96bd);}return _0x30137f[_0x0cc7('0x23')](_0x3d96bd)['end']();};}function respondWithResult(_0x337f1f,_0x39a1c2){_0x39a1c2=_0x39a1c2||0xc8;return function(_0x2baf9b){if(_0x2baf9b){return _0x337f1f[_0x0cc7('0x23')](_0x39a1c2)[_0x0cc7('0x24')](_0x2baf9b);}};}function respondWithFilteredResult(_0x417371,_0x222219){return function(_0x88b40c){if(_0x88b40c){var _0x57c243=typeof _0x222219['offset']===_0x0cc7('0x25')&&typeof _0x222219[_0x0cc7('0x26')]==='undefined';var _0x98229e=_0x88b40c['count'];var _0x5afaca=_0x57c243?0x0:_0x222219[_0x0cc7('0x27')];var _0x1d9270=_0x57c243?_0x88b40c[_0x0cc7('0x28')]:_0x222219[_0x0cc7('0x27')]+_0x222219[_0x0cc7('0x26')];var _0xba9e51;if(_0x1d9270>=_0x98229e){_0x1d9270=_0x98229e;_0xba9e51=0xc8;}else{_0xba9e51=0xce;}_0x417371[_0x0cc7('0x23')](_0xba9e51);return _0x417371[_0x0cc7('0x29')](_0x0cc7('0x2a'),_0x5afaca+'-'+_0x1d9270+'/'+_0x98229e)[_0x0cc7('0x24')](_0x88b40c);}return null;};}function patchUpdates(_0x14d3c2){return function(_0x5b5079){try{jsonpatch[_0x0cc7('0x2b')](_0x5b5079,_0x14d3c2,!![]);}catch(_0x24a577){return BPromise[_0x0cc7('0x2c')](_0x24a577);}return _0x5b5079['save']();};}function saveUpdates(_0x39040a,_0x180d22){return function(_0x205847){if(_0x205847){return _0x205847['update'](_0x39040a)[_0x0cc7('0x2d')](function(_0x28fa62){return _0x28fa62;});}return null;};}function removeEntity(_0xdbf27c,_0x3a834f){return function(_0x3ce827){if(_0x3ce827){return _0x3ce827[_0x0cc7('0x2e')]()[_0x0cc7('0x2d')](function(){var _0x569d8f=_0x3ce827['get']({'plain':!![]});var _0x5b8d6f=_0x0cc7('0x2f');return db[_0x0cc7('0x30')][_0x0cc7('0x2e')]({'where':{'type':_0x5b8d6f,'resourceId':_0x569d8f['id']}})[_0x0cc7('0x2d')](function(){return _0x3ce827;});})[_0x0cc7('0x2d')](function(){_0xdbf27c['status'](0xcc)[_0x0cc7('0x31')]();});}};}function handleEntityNotFound(_0x317de4,_0x1e4d0b){return function(_0x38e27c){if(!_0x38e27c){_0x317de4[_0x0cc7('0x22')](0x194);}return _0x38e27c;};}function handleError(_0x75015e,_0x391907){_0x391907=_0x391907||0x1f4;return function(_0x4e42cc){logger['error'](_0x4e42cc[_0x0cc7('0x32')]);if(_0x4e42cc['name']){delete _0x4e42cc['name'];}_0x75015e[_0x0cc7('0x23')](_0x391907)[_0x0cc7('0x33')](_0x4e42cc);};}exports['index']=function(_0x5ac533,_0x5b8019){var _0x22eb27={},_0x1250d8={},_0x52987e={'count':0x0,'rows':[]};var _0x262d0a=_['map'](db['CmList'][_0x0cc7('0x34')],function(_0x341313){return{'name':_0x341313['fieldName'],'type':_0x341313[_0x0cc7('0x35')][_0x0cc7('0x36')]};});_0x1250d8[_0x0cc7('0x37')]=_[_0x0cc7('0x38')](_0x262d0a,_0x0cc7('0x39'));_0x1250d8['query']=_[_0x0cc7('0x3a')](_0x5ac533['query']);_0x1250d8[_0x0cc7('0x3b')]=_['intersection'](_0x1250d8[_0x0cc7('0x37')],_0x1250d8[_0x0cc7('0x3c')]);_0x22eb27['attributes']=_[_0x0cc7('0x3d')](_0x1250d8[_0x0cc7('0x37')],qs[_0x0cc7('0x3e')](_0x5ac533[_0x0cc7('0x3c')][_0x0cc7('0x3e')]));_0x22eb27[_0x0cc7('0x3f')]=_0x22eb27['attributes'][_0x0cc7('0x40')]?_0x22eb27['attributes']:_0x1250d8[_0x0cc7('0x37')];if(!_0x5ac533[_0x0cc7('0x3c')][_0x0cc7('0x41')](_0x0cc7('0x42'))){_0x22eb27[_0x0cc7('0x26')]=qs[_0x0cc7('0x26')](_0x5ac533[_0x0cc7('0x3c')][_0x0cc7('0x26')]);_0x22eb27[_0x0cc7('0x27')]=qs[_0x0cc7('0x27')](_0x5ac533['query'][_0x0cc7('0x27')]);}_0x22eb27['order']=qs['sort'](_0x5ac533[_0x0cc7('0x3c')][_0x0cc7('0x43')]);_0x22eb27[_0x0cc7('0x44')]=qs['filters'](_['pick'](_0x5ac533[_0x0cc7('0x3c')],_0x1250d8[_0x0cc7('0x3b')]),_0x262d0a);if(_0x5ac533['query'][_0x0cc7('0x45')]){_0x22eb27[_0x0cc7('0x44')]=_[_0x0cc7('0x46')](_0x22eb27[_0x0cc7('0x44')],{'$or':_[_0x0cc7('0x38')](_0x262d0a,function(_0x3e38fc){if(_0x3e38fc[_0x0cc7('0x35')]!==_0x0cc7('0x47')){var _0x2d6ef2={};_0x2d6ef2[_0x3e38fc[_0x0cc7('0x39')]]={'$like':'%'+_0x5ac533[_0x0cc7('0x3c')]['filter']+'%'};return _0x2d6ef2;}})});}_0x22eb27=_[_0x0cc7('0x46')]({},_0x22eb27,_0x5ac533[_0x0cc7('0x48')]);var _0x2a8a01={'where':_0x22eb27[_0x0cc7('0x44')]};return db['CmList'][_0x0cc7('0x28')](_0x2a8a01)['then'](function(_0x42ba76){_0x52987e['count']=_0x42ba76;if(_0x5ac533[_0x0cc7('0x3c')][_0x0cc7('0x49')]){_0x22eb27[_0x0cc7('0x4a')]=[{'all':!![]}];}return db[_0x0cc7('0x4b')][_0x0cc7('0x4c')](_0x22eb27);})[_0x0cc7('0x2d')](function(_0xdbf1f){_0x52987e['rows']=_0xdbf1f;return _0x52987e;})[_0x0cc7('0x2d')](respondWithFilteredResult(_0x5b8019,_0x22eb27))[_0x0cc7('0x4d')](handleError(_0x5b8019,null));};exports[_0x0cc7('0x4e')]=function(_0x5a6487,_0x124025){var _0x1dced3={'raw':![],'where':{'id':_0x5a6487[_0x0cc7('0x4f')]['id']}},_0x43d6d1={};_0x43d6d1[_0x0cc7('0x37')]=_[_0x0cc7('0x3a')](db[_0x0cc7('0x4b')][_0x0cc7('0x34')]);_0x43d6d1[_0x0cc7('0x3c')]=_[_0x0cc7('0x3a')](_0x5a6487[_0x0cc7('0x3c')]);_0x43d6d1[_0x0cc7('0x3b')]=_[_0x0cc7('0x3d')](_0x43d6d1[_0x0cc7('0x37')],_0x43d6d1['query']);_0x1dced3[_0x0cc7('0x3f')]=_[_0x0cc7('0x3d')](_0x43d6d1[_0x0cc7('0x37')],qs['fields'](_0x5a6487['query'][_0x0cc7('0x3e')]));_0x1dced3[_0x0cc7('0x3f')]=_0x1dced3[_0x0cc7('0x3f')][_0x0cc7('0x40')]?_0x1dced3['attributes']:_0x43d6d1[_0x0cc7('0x37')];if(_0x5a6487[_0x0cc7('0x3c')][_0x0cc7('0x49')]){_0x1dced3[_0x0cc7('0x4a')]=[{'all':!![]}];}_0x1dced3=_[_0x0cc7('0x46')]({},_0x1dced3,_0x5a6487[_0x0cc7('0x48')]);return db[_0x0cc7('0x4b')]['find'](_0x1dced3)[_0x0cc7('0x2d')](handleEntityNotFound(_0x124025,null))[_0x0cc7('0x2d')](respondWithResult(_0x124025,null))[_0x0cc7('0x4d')](handleError(_0x124025,null));};exports['create']=function(_0x5d014d,_0x12955c){return db[_0x0cc7('0x4b')][_0x0cc7('0x50')](_0x5d014d[_0x0cc7('0x51')],{})[_0x0cc7('0x2d')](function(_0xbc3923){var _0x13da7d=_0x5d014d['user']['get']({'plain':!![]});if(!_0x13da7d)throw new Error(_0x0cc7('0x52'));if(_0x13da7d[_0x0cc7('0x53')]===_0x0cc7('0x54')){var _0x58ed6b=_0xbc3923[_0x0cc7('0x55')]({'plain':!![]});var _0x38ead1=_0x0cc7('0x2f');return db[_0x0cc7('0x56')][_0x0cc7('0x57')]({'where':{'name':_0x38ead1,'userProfileId':_0x13da7d[_0x0cc7('0x58')]},'raw':!![]})[_0x0cc7('0x2d')](function(_0x1bd1c6){if(_0x1bd1c6&&_0x1bd1c6[_0x0cc7('0x59')]===0x0){return db['UserProfileResource'][_0x0cc7('0x50')]({'name':_0x58ed6b['name'],'resourceId':_0x58ed6b['id'],'type':_0x1bd1c6[_0x0cc7('0x39')],'sectionId':_0x1bd1c6['id']},{})[_0x0cc7('0x2d')](function(){return _0xbc3923;});}else{return _0xbc3923;}})[_0x0cc7('0x4d')](function(_0x368d7c){logger[_0x0cc7('0x5a')](_0x0cc7('0x5b'),_0x368d7c);throw _0x368d7c;});}return _0xbc3923;})[_0x0cc7('0x2d')](respondWithResult(_0x12955c,0xc9))[_0x0cc7('0x4d')](handleError(_0x12955c,null));};exports['update']=function(_0x592cf4,_0x5dfa7a){if(_0x592cf4['body']['id']){delete _0x592cf4['body']['id'];}return db[_0x0cc7('0x4b')]['find']({'where':{'id':_0x592cf4[_0x0cc7('0x4f')]['id']}})[_0x0cc7('0x2d')](handleEntityNotFound(_0x5dfa7a,null))[_0x0cc7('0x2d')](saveUpdates(_0x592cf4[_0x0cc7('0x51')],null))[_0x0cc7('0x2d')](respondWithResult(_0x5dfa7a,null))[_0x0cc7('0x4d')](handleError(_0x5dfa7a,null));};exports['destroy']=function(_0x22caed,_0x4f75ac){return db[_0x0cc7('0x4b')][_0x0cc7('0x57')]({'where':{'id':_0x22caed[_0x0cc7('0x4f')]['id']}})[_0x0cc7('0x2d')](handleEntityNotFound(_0x4f75ac,null))[_0x0cc7('0x2d')](removeEntity(_0x4f75ac,null))[_0x0cc7('0x4d')](handleError(_0x4f75ac,null));};exports['describe']=function(_0x1781e1,_0x35ea3e){return db[_0x0cc7('0x4b')][_0x0cc7('0x5c')]()['then'](respondWithResult(_0x35ea3e,null))[_0x0cc7('0x4d')](handleError(_0x35ea3e,null));};exports['addDisposition']=function(_0x5d3632,_0x4ea60f,_0x2e2e01){if(_0x5d3632[_0x0cc7('0x51')]['id']){delete _0x5d3632[_0x0cc7('0x51')]['id'];}return db[_0x0cc7('0x4b')][_0x0cc7('0x57')]({'where':{'id':_0x5d3632[_0x0cc7('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4ea60f,null))[_0x0cc7('0x2d')](function(_0x4c185d){if(_0x4c185d){_0x5d3632['body'][_0x0cc7('0x5d')]=_0x4c185d['id'];return db[_0x0cc7('0x5e')][_0x0cc7('0x50')](_0x5d3632['body']);}})[_0x0cc7('0x2d')](respondWithResult(_0x4ea60f,null))[_0x0cc7('0x4d')](handleError(_0x4ea60f,null));};exports[_0x0cc7('0x5f')]=function(_0x379c50,_0x1a8041,_0x294773){var _0x35e6f2={'raw':![],'where':{}};var _0x7225d={};var _0x95dfd2={'count':0x0,'rows':[]};return db[_0x0cc7('0x4b')][_0x0cc7('0x60')]({'where':{'id':_0x379c50[_0x0cc7('0x4f')]['id']}})[_0x0cc7('0x2d')](handleEntityNotFound(_0x1a8041,null))['then'](function(_0x34762c){if(_0x34762c){_0x7225d[_0x0cc7('0x37')]=_['keys'](db[_0x0cc7('0x5e')][_0x0cc7('0x34')]);_0x7225d['query']=_[_0x0cc7('0x3a')](_0x379c50[_0x0cc7('0x3c')]);_0x7225d[_0x0cc7('0x3b')]=_['intersection'](_0x7225d['model'],_0x7225d[_0x0cc7('0x3c')]);_0x35e6f2[_0x0cc7('0x3f')]=_[_0x0cc7('0x3d')](_0x7225d['model'],qs[_0x0cc7('0x3e')](_0x379c50[_0x0cc7('0x3c')]['fields']));_0x35e6f2[_0x0cc7('0x3f')]=_0x35e6f2[_0x0cc7('0x3f')]['length']?_0x35e6f2[_0x0cc7('0x3f')]:_0x7225d[_0x0cc7('0x37')];if(!_0x379c50[_0x0cc7('0x3c')][_0x0cc7('0x41')](_0x0cc7('0x42'))){_0x35e6f2[_0x0cc7('0x26')]=qs[_0x0cc7('0x26')](_0x379c50[_0x0cc7('0x3c')]['limit']);_0x35e6f2[_0x0cc7('0x27')]=qs['offset'](_0x379c50[_0x0cc7('0x3c')][_0x0cc7('0x27')]);}_0x35e6f2[_0x0cc7('0x61')]=qs['sort'](_0x379c50[_0x0cc7('0x3c')][_0x0cc7('0x43')]);_0x35e6f2[_0x0cc7('0x44')]=qs[_0x0cc7('0x3b')](_['pick'](_0x379c50[_0x0cc7('0x3c')],_0x7225d[_0x0cc7('0x3b')]));_0x35e6f2[_0x0cc7('0x44')][_0x0cc7('0x5d')]=_0x34762c['id'];if(_0x379c50[_0x0cc7('0x3c')][_0x0cc7('0x45')]){_0x35e6f2[_0x0cc7('0x44')]=_['merge'](_0x35e6f2[_0x0cc7('0x44')],{'$or':_[_0x0cc7('0x38')](_0x35e6f2[_0x0cc7('0x3f')],function(_0x42028e){var _0x1552dc={};_0x1552dc[_0x42028e]={'$like':'%'+_0x379c50[_0x0cc7('0x3c')][_0x0cc7('0x45')]+'%'};return _0x1552dc;})});}_0x35e6f2=_[_0x0cc7('0x46')]({},_0x35e6f2,_0x379c50[_0x0cc7('0x48')]);return db[_0x0cc7('0x5e')]['count']({'where':_0x35e6f2['where']})[_0x0cc7('0x2d')](function(_0x519a38){_0x95dfd2[_0x0cc7('0x28')]=_0x519a38;if(_0x379c50[_0x0cc7('0x3c')]['includeAll']){_0x35e6f2[_0x0cc7('0x4a')]=[{'all':!![]}];}return db['Disposition'][_0x0cc7('0x4c')](_0x35e6f2);})[_0x0cc7('0x2d')](function(_0x34c711){_0x95dfd2[_0x0cc7('0x62')]=_0x34c711;return _0x95dfd2;});}})[_0x0cc7('0x2d')](respondWithFilteredResult(_0x1a8041,_0x35e6f2))[_0x0cc7('0x4d')](handleError(_0x1a8041,null));};exports['removeDispositions']=function(_0x51db5a,_0x41f4fe,_0x25a157){return db[_0x0cc7('0x4b')][_0x0cc7('0x57')]({'where':{'id':_0x51db5a[_0x0cc7('0x4f')]['id']}})[_0x0cc7('0x2d')](handleEntityNotFound(_0x41f4fe,null))['then'](function(_0x30a2f1){if(_0x30a2f1){return _0x30a2f1[_0x0cc7('0x63')](_0x51db5a[_0x0cc7('0x3c')]['ids']);}})['then'](respondWithStatusCode(_0x41f4fe,null))['catch'](handleError(_0x41f4fe,null));};exports[_0x0cc7('0x64')]=function(_0x481f72,_0x28572b,_0x31926d){return db[_0x0cc7('0x4b')][_0x0cc7('0x57')]({'where':{'id':_0x481f72[_0x0cc7('0x4f')]['id']}})[_0x0cc7('0x2d')](handleEntityNotFound(_0x28572b,null))['then'](function(_0x1e9a68){if(_0x1e9a68){var _0x175a62=[];var _0x487f53={'success':[],'errors':[]};return db[_0x0cc7('0x65')][_0x0cc7('0x5c')]()[_0x0cc7('0x2d')](function(_0x40aae8){if(_0x481f72['body'][_0x0cc7('0x66')]&&_[_0x0cc7('0x67')](_0x481f72[_0x0cc7('0x51')][_0x0cc7('0x66')])){if(_0x481f72[_0x0cc7('0x51')][_0x0cc7('0x66')][_0x0cc7('0x40')]){_0x481f72[_0x0cc7('0x51')][_0x0cc7('0x66')]=_0x481f72['body'][_0x0cc7('0x66')][_0x0cc7('0x68')](';')+';';}else{_0x481f72[_0x0cc7('0x51')][_0x0cc7('0x66')]=null;}}else{_0x481f72[_0x0cc7('0x51')][_0x0cc7('0x66')]=null;}if(_0x481f72[_0x0cc7('0x51')]&&_[_0x0cc7('0x67')](_0x481f72['body'])){for(var _0x22a421=0x0;_0x22a421<_0x481f72[_0x0cc7('0x51')]['length'];_0x22a421+=0x1){_0x481f72[_0x0cc7('0x51')][_0x22a421]['ListId']=_0x481f72['params']['id'];_0x175a62[_0x0cc7('0x69')](_0x481f72['body'][_0x22a421]);}return BPromise['each'](_0x175a62,function(_0x2eacc6){return db[_0x0cc7('0x65')]['create'](_['omit'](_0x2eacc6,[_0x0cc7('0x6a'),'id'])||{},{'fields':_[_0x0cc7('0x3a')](_0x40aae8),'raw':!![]})['then'](function(_0x5b0999){_0x487f53[_0x0cc7('0x6b')][_0x0cc7('0x69')](_0x5b0999['dataValues']);})[_0x0cc7('0x4d')](function(_0x27b53a){_0x487f53['errors'][_0x0cc7('0x69')]({'data':_0x2eacc6,'error':_0x27b53a[_0x0cc7('0x6c')]});});})[_0x0cc7('0x2d')](function(_0x4cafc0){return _0x487f53;})[_0x0cc7('0x4d')](function(_0x46cf58){return _0x46cf58;});}else{_0x28572b[_0x0cc7('0x23')](0x190)[_0x0cc7('0x24')]({'message':_0x0cc7('0x6d')});}});}})[_0x0cc7('0x2d')](respondWithResult(_0x28572b,null))[_0x0cc7('0x4d')](handleError(_0x28572b,null));};exports[_0x0cc7('0x6e')]=function(_0x3a1731,_0x25a175,_0x507fea){var _0x36bb37;return db[_0x0cc7('0x4b')][_0x0cc7('0x57')]({'where':{'id':_0x3a1731[_0x0cc7('0x4f')]['id']},'include':[{'model':db[_0x0cc7('0x6f')],'as':_0x0cc7('0x70')}]})['then'](handleEntityNotFound(_0x25a175,null))[_0x0cc7('0x2d')](function(_0x11083a){if(_0x11083a){_0x36bb37=_0x11083a;return db['CmContact'][_0x0cc7('0x34')];}})[_0x0cc7('0x2d')](function(_0x520d96){if(_0x520d96){var _0x3f6089={};var _0x500179={};_0x500179[_0x0cc7('0x37')]=_[_0x0cc7('0x71')](_[_0x0cc7('0x3a')](_0x520d96),_[_0x0cc7('0x38')](_0x36bb37[_0x0cc7('0x70')],function(_0x5935c0){return util['format'](_0x0cc7('0x72'),_0x5935c0['id']);}));_0x500179[_0x0cc7('0x3c')]=_['keys'](_0x3a1731[_0x0cc7('0x3c')]);_0x500179[_0x0cc7('0x3b')]=_[_0x0cc7('0x3d')](_0x500179[_0x0cc7('0x37')],_0x500179[_0x0cc7('0x3c')]);_0x3f6089[_0x0cc7('0x3f')]=_['intersection'](_0x500179[_0x0cc7('0x37')],qs['fields'](_0x3a1731[_0x0cc7('0x3c')][_0x0cc7('0x3e')]));_0x3f6089[_0x0cc7('0x3f')]=_0x3f6089[_0x0cc7('0x3f')][_0x0cc7('0x40')]?_0x3f6089[_0x0cc7('0x3f')]:_0x500179[_0x0cc7('0x37')];if(!_0x3a1731[_0x0cc7('0x3c')][_0x0cc7('0x41')](_0x0cc7('0x42'))){_0x3f6089[_0x0cc7('0x26')]=qs[_0x0cc7('0x26')](_0x3a1731['query'][_0x0cc7('0x26')]);_0x3f6089[_0x0cc7('0x27')]=qs[_0x0cc7('0x27')](_0x3a1731['query'][_0x0cc7('0x27')]);}_0x3f6089[_0x0cc7('0x61')]=qs[_0x0cc7('0x43')](_0x3a1731[_0x0cc7('0x3c')][_0x0cc7('0x43')]);_0x3f6089[_0x0cc7('0x44')]=qs[_0x0cc7('0x3b')](_[_0x0cc7('0x73')](_0x3a1731[_0x0cc7('0x3c')],_0x500179[_0x0cc7('0x3b')]));_0x3f6089[_0x0cc7('0x74')]=!![];if(_0x3a1731[_0x0cc7('0x3c')][_0x0cc7('0x45')]){_0x3f6089[_0x0cc7('0x44')]=_[_0x0cc7('0x46')](_0x3f6089[_0x0cc7('0x44')],{'$or':_['map'](_0x3f6089[_0x0cc7('0x3f')],function(_0x5d4e08){var _0x4adc3b={};_0x4adc3b[_0x5d4e08]={'$like':'%'+_0x3a1731['query'][_0x0cc7('0x45')]+'%'};return _0x4adc3b;})});}_0x3f6089=_['merge']({},_0x3f6089,_0x3a1731['options']);return _0x36bb37[_0x0cc7('0x6e')](_0x3f6089);}})[_0x0cc7('0x2d')](respondWithResult(_0x25a175,null))[_0x0cc7('0x4d')](handleError(_0x25a175,null));};exports[_0x0cc7('0x75')]=function(_0x5448a6,_0x1a4a29,_0x3bc4ad){var _0x500404;var _0x6fd2f;var _0x172b5b;var _0x328521=_0x5448a6[_0x0cc7('0x4f')]['id'];csv_results=[];return db[_0x0cc7('0x76')]['findAll']({'attributes':['id',_0x0cc7('0x39')],'raw':!![],'order':['OrderBy']})[_0x0cc7('0x2d')](function(_0x5dd0be){_0x500404=_0x5dd0be;var _0x266de2=_[_0x0cc7('0x3a')](db[_0x0cc7('0x65')][_0x0cc7('0x34')]);return db[_0x0cc7('0x6f')]['findAll']({'raw':!![],'attributes':['id',_0x0cc7('0x77')]})[_0x0cc7('0x2d')](function(_0x3ca228){_0x6fd2f=_0x3ca228;var _0xde1520=squel[_0x0cc7('0x78')]()[_0x0cc7('0x3e')](_0x266de2)[_0x0cc7('0x79')]('cm_contacts','c')[_0x0cc7('0x44')](_0x0cc7('0x7a'),_0x328521)[_0x0cc7('0x44')]('c.deletedAt\x20is\x20null')[_0x0cc7('0x7b')]();for(var _0x1f61f2=0x0;_0x1f61f2<_0x6fd2f[_0x0cc7('0x40')];_0x1f61f2++){_0xde1520[_0x0cc7('0x7c')]('c.cf_'+_0x6fd2f[_0x1f61f2]['id'],_0x0cc7('0x7d')+_0x6fd2f[_0x1f61f2][_0x0cc7('0x77')]);}for(var _0x1f61f2=0x0;_0x1f61f2<_0x500404[_0x0cc7('0x40')];_0x1f61f2++){_0xde1520[_0x0cc7('0x7c')](squel[_0x0cc7('0x78')]()[_0x0cc7('0x7c')](_0x0cc7('0x7e'))[_0x0cc7('0x79')](_0x0cc7('0x7f'))[_0x0cc7('0x44')](_0x0cc7('0x80'),_0x500404[_0x1f61f2]['id'])[_0x0cc7('0x44')](_0x0cc7('0x81')),_0x0cc7('0x82')+_0x500404[_0x1f61f2]['name']);_0xde1520[_0x0cc7('0x7c')](squel[_0x0cc7('0x78')]()[_0x0cc7('0x7c')](_0x0cc7('0x83'))[_0x0cc7('0x79')](_0x0cc7('0x7f'))[_0x0cc7('0x44')](_0x0cc7('0x80'),_0x500404[_0x1f61f2]['id'])[_0x0cc7('0x44')](_0x0cc7('0x81')),_0x0cc7('0x84')+_0x500404[_0x1f61f2]['name']);}var _0x42c67b=[];_0x42c67b[_0x0cc7('0x69')](_0xde1520[_0x0cc7('0x85')]());BPromise[_0x0cc7('0x86')](_0x42c67b,handleQuery)[_0x0cc7('0x2d')](function(_0x330b27){handleQuery(_0xde1520[_0x0cc7('0x85')]());var _0x2a853d=csv_results[0x0];if(!_['isEmpty'](_0x2a853d)){var _0x4332eb=toCsv(_0x2a853d);var _0x5e99e4=Date[_0x0cc7('0x87')]();fs[_0x0cc7('0x88')](util[_0x0cc7('0x89')](_0x0cc7('0x8a'),_0x328521,_0x5e99e4),_0x4332eb);_0x1a4a29['setHeader']('Content-disposition',_0x0cc7('0x8b')+util[_0x0cc7('0x89')]('list_%d_%s.csv',_0x328521,_0x5e99e4));_0x1a4a29[_0x0cc7('0x8c')](_0x0cc7('0x8d'),_0x0cc7('0x8e'));return _0x1a4a29[_0x0cc7('0x8f')](util[_0x0cc7('0x89')](_0x0cc7('0x8a'),_0x328521,_0x5e99e4));}else{return _0x1a4a29[_0x0cc7('0x22')](0xcc);}});});});};exports[_0x0cc7('0x90')]=function(_0xde1eb4,_0x338ff9,_0x125297){var _0x13e43b;delete _0xde1eb4[_0x0cc7('0x51')]['id'];return db[_0x0cc7('0x4b')][_0x0cc7('0x60')]({'where':{'id':_0xde1eb4[_0x0cc7('0x4f')]['id']}})[_0x0cc7('0x2d')](handleEntityNotFound(_0x338ff9,null))[_0x0cc7('0x2d')](function(_0x59dd81){if(_0x59dd81){return db['sequelize'][_0x0cc7('0x91')](function(_0x2a5e62){return db[_0x0cc7('0x6f')][_0x0cc7('0x50')](_0xde1eb4[_0x0cc7('0x51')],{'transaction':_0x2a5e62})[_0x0cc7('0x2d')](function(_0x48b8a4){_0x13e43b=_0x48b8a4;return _0x59dd81[_0x0cc7('0x92')](_0x48b8a4,{'transaction':_0x2a5e62});})['then'](function(){var _0x52165f={'type':db['Sequelize'][_0x0cc7('0x93')],'transaction':_0x2a5e62};switch(_0xde1eb4[_0x0cc7('0x51')][_0x0cc7('0x35')]){case _0x0cc7('0x94'):_0x52165f[_0x0cc7('0x35')]=db[_0x0cc7('0x95')][_0x0cc7('0x93')];break;case _0x0cc7('0x96'):_0x52165f[_0x0cc7('0x35')]=db[_0x0cc7('0x95')][_0x0cc7('0x97')];break;case'switch':_0x52165f['type']=db[_0x0cc7('0x95')][_0x0cc7('0x98')];_0x52165f[_0x0cc7('0x99')]=![];break;default:}return db[_0x0cc7('0x9a')][_0x0cc7('0x9b')][_0x0cc7('0x9c')](_0x0cc7('0x9d'),util[_0x0cc7('0x89')]('cf_%s',_0x13e43b['id']),_0x52165f);})[_0x0cc7('0x2d')](function(){return _0x13e43b;});});}})[_0x0cc7('0x2d')](respondWithResult(_0x338ff9,null))[_0x0cc7('0x4d')](handleError(_0x338ff9,null));};exports['getCustomFields']=function(_0x4a1788,_0xc0958f,_0x4fbbd3){var _0x57c344={};var _0x4aa1d1={};var _0x4a9b17;var _0x145d3e;return db[_0x0cc7('0x4b')]['findOne']({'where':{'id':_0x4a1788[_0x0cc7('0x4f')]['id']}})[_0x0cc7('0x2d')](handleEntityNotFound(_0xc0958f,null))[_0x0cc7('0x2d')](function(_0x492ddb){if(_0x492ddb){_0x4a9b17=_0x492ddb;_0x4aa1d1[_0x0cc7('0x37')]=_['keys'](db['CmCustomField']['rawAttributes']);_0x4aa1d1[_0x0cc7('0x3c')]=_['keys'](_0x4a1788[_0x0cc7('0x3c')]);_0x4aa1d1[_0x0cc7('0x3b')]=_[_0x0cc7('0x3d')](_0x4aa1d1['model'],_0x4aa1d1['query']);_0x57c344['attributes']=_[_0x0cc7('0x3d')](_0x4aa1d1[_0x0cc7('0x37')],qs['fields'](_0x4a1788[_0x0cc7('0x3c')]['fields']));_0x57c344[_0x0cc7('0x3f')]=_0x57c344[_0x0cc7('0x3f')][_0x0cc7('0x40')]?_0x57c344['attributes']:_0x4aa1d1['model'];_0x57c344['order']=qs['sort'](_0x4a1788[_0x0cc7('0x3c')]['sort']);_0x57c344[_0x0cc7('0x44')]=qs['filters'](_[_0x0cc7('0x73')](_0x4a1788[_0x0cc7('0x3c')],_0x4aa1d1[_0x0cc7('0x3b')]));_0x57c344[_0x0cc7('0x44')]=_[_0x0cc7('0x46')](_0x57c344[_0x0cc7('0x44')],{'$or':[{'ListId':_0x492ddb['id']},{'ListId':null}]});if(_0x4a1788[_0x0cc7('0x3c')][_0x0cc7('0x45')]){_0x57c344[_0x0cc7('0x44')]=_[_0x0cc7('0x46')](_0x57c344[_0x0cc7('0x44')],{'$or':_['map'](_0x57c344[_0x0cc7('0x3f')],function(_0x5ebe4a){var _0x434a8d={};_0x434a8d[_0x5ebe4a]={'$like':'%'+_0x4a1788[_0x0cc7('0x3c')]['filter']+'%'};return _0x434a8d;})});}_0x57c344=_[_0x0cc7('0x46')]({},_0x57c344,_0x4a1788[_0x0cc7('0x48')]);return db[_0x0cc7('0x6f')][_0x0cc7('0x9e')](_0x57c344);}})['then'](respondWithResult(_0xc0958f,null))[_0x0cc7('0x4d')](handleError(_0xc0958f,null));};exports[_0x0cc7('0x9f')]=function(_0x2d8162,_0x1038fe){return db[_0x0cc7('0x6f')][_0x0cc7('0x9e')]({'where':{'ListId':null}})['then'](handleEntityNotFound(_0x1038fe,null))[_0x0cc7('0x2d')](function(_0x313f38){return _0x313f38;})[_0x0cc7('0x2d')](respondWithResult(_0x1038fe,null))[_0x0cc7('0x4d')](handleError(_0x1038fe,null));};exports[_0x0cc7('0xa0')]=function(_0x4b467f,_0x26ea9f,_0x183b4f){return db[_0x0cc7('0x4b')][_0x0cc7('0x57')]({'where':{'id':_0x4b467f['params']['id']}})[_0x0cc7('0x2d')](handleEntityNotFound(_0x26ea9f,null))[_0x0cc7('0x2d')](function(_0xbeaece){if(_0xbeaece){return _0xbeaece['addAgents'](_0x4b467f[_0x0cc7('0x51')][_0x0cc7('0x6a')],_[_0x0cc7('0xa1')](_0x4b467f[_0x0cc7('0x51')],[_0x0cc7('0x6a'),'id'])||{})[_0x0cc7('0xa2')](function(_0x39a1dd){for(var _0x4a0569=0x0;_0x4a0569<_0x4b467f[_0x0cc7('0x51')]['ids'][_0x0cc7('0x40')];_0x4a0569+=0x1){socket[_0x0cc7('0xa3')](_0x0cc7('0xa4'),{'UserId':Number(_0x4b467f[_0x0cc7('0x51')]['ids'][_0x4a0569]),'CmListId':Number(_0x4b467f[_0x0cc7('0x4f')]['id'])});}return _0x39a1dd;});}})[_0x0cc7('0x2d')](respondWithResult(_0x26ea9f,null))['catch'](handleError(_0x26ea9f,null));};exports[_0x0cc7('0xa5')]=function(_0x2c66e3,_0x3e73df,_0x3c1e3a){return db[_0x0cc7('0x4b')][_0x0cc7('0x57')]({'where':{'id':_0x2c66e3['params']['id']}})[_0x0cc7('0x2d')](handleEntityNotFound(_0x3e73df,null))[_0x0cc7('0x2d')](function(_0x388903){if(_0x388903){return _0x388903[_0x0cc7('0xa5')](_0x2c66e3[_0x0cc7('0x3c')][_0x0cc7('0x6a')])[_0x0cc7('0x2d')](function(){if(_[_0x0cc7('0x67')](_0x2c66e3[_0x0cc7('0x3c')][_0x0cc7('0x6a')])){for(var _0x397e24=0x0;_0x397e24<_0x2c66e3[_0x0cc7('0x3c')]['ids'][_0x0cc7('0x40')];_0x397e24+=0x1){socket[_0x0cc7('0xa3')](_0x0cc7('0xa6'),{'UserId':Number(_0x2c66e3['query'][_0x0cc7('0x6a')][_0x397e24]),'CmListId':Number(_0x2c66e3[_0x0cc7('0x4f')]['id'])});}}else{socket[_0x0cc7('0xa3')](_0x0cc7('0xa6'),{'UserId':Number(_0x2c66e3[_0x0cc7('0x3c')]['ids']),'CmListId':Number(_0x2c66e3['params']['id'])});}});}})[_0x0cc7('0x2d')](respondWithStatusCode(_0x3e73df,null))[_0x0cc7('0x4d')](handleError(_0x3e73df,null));};exports[_0x0cc7('0xa7')]=function(_0x17e4a2,_0x947539,_0x3d7458){var _0x1be178={};var _0x195376={};var _0x4af506;var _0xb5f12d;return db[_0x0cc7('0x4b')]['findOne']({'where':{'id':_0x17e4a2['params']['id']}})[_0x0cc7('0x2d')](handleEntityNotFound(_0x947539,null))[_0x0cc7('0x2d')](function(_0x1dbb27){if(_0x1dbb27){_0x4af506=_0x1dbb27;_0x195376[_0x0cc7('0x37')]=_[_0x0cc7('0x3a')](db[_0x0cc7('0xa8')][_0x0cc7('0x34')]);_0x195376['query']=_[_0x0cc7('0x3a')](_0x17e4a2[_0x0cc7('0x3c')]);_0x195376[_0x0cc7('0x3b')]=_['intersection'](_0x195376[_0x0cc7('0x37')],_0x195376[_0x0cc7('0x3c')]);_0x1be178[_0x0cc7('0x3f')]=_[_0x0cc7('0x3d')](_0x195376['model'],qs[_0x0cc7('0x3e')](_0x17e4a2[_0x0cc7('0x3c')][_0x0cc7('0x3e')]));_0x1be178['attributes']=_0x1be178[_0x0cc7('0x3f')][_0x0cc7('0x40')]?_0x1be178['attributes']:_0x195376[_0x0cc7('0x37')];_0x1be178[_0x0cc7('0x61')]=qs[_0x0cc7('0x43')](_0x17e4a2[_0x0cc7('0x3c')]['sort']);_0x1be178[_0x0cc7('0x44')]=qs['filters'](_[_0x0cc7('0x73')](_0x17e4a2['query'],_0x195376[_0x0cc7('0x3b')]));if(_0x17e4a2['query'][_0x0cc7('0x45')]){_0x1be178['where']=_[_0x0cc7('0x46')](_0x1be178['where'],{'$or':_['map'](_0x1be178[_0x0cc7('0x3f')],function(_0x276920){var _0x23d586={};_0x23d586[_0x276920]={'$like':'%'+_0x17e4a2[_0x0cc7('0x3c')]['filter']+'%'};return _0x23d586;})});}_0x1be178=_[_0x0cc7('0x46')]({},_0x1be178,_0x17e4a2['options']);return _0x4af506[_0x0cc7('0xa7')](_0x1be178);}})[_0x0cc7('0x2d')](function(_0x372505){if(_0x372505){_0xb5f12d=_0x372505[_0x0cc7('0x40')];if(!_0x17e4a2[_0x0cc7('0x3c')]['hasOwnProperty'](_0x0cc7('0x42'))){_0x1be178['limit']=qs[_0x0cc7('0x26')](_0x17e4a2[_0x0cc7('0x3c')][_0x0cc7('0x26')]);_0x1be178['offset']=qs[_0x0cc7('0x27')](_0x17e4a2['query'][_0x0cc7('0x27')]);}return _0x4af506[_0x0cc7('0xa7')](_0x1be178);}})[_0x0cc7('0x2d')](function(_0x31ffed){if(_0x31ffed){return _0x31ffed?{'count':_0xb5f12d,'rows':_0x31ffed}:null;}})[_0x0cc7('0x2d')](respondWithResult(_0x947539,null))['catch'](handleError(_0x947539,null));};function handleQuery(_0x47c8a8){logger[_0x0cc7('0xa9')](_0x47c8a8);return db[_0x0cc7('0x9a')][_0x0cc7('0x3c')](_0x47c8a8)[_0x0cc7('0xa2')](function(_0x32b52f){csv_results['push'](_0x32b52f);})['catch'](function(_0x492428){logger[_0x0cc7('0x5a')](_0x492428[_0x0cc7('0x6c')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index c421a7a..3ce9793 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['hasOwnProperty','exports','events','CmList','setMaxListeners','save','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3e74,0x175));var _0x43e7=function(_0x2529df,_0x3ca0b7){_0x2529df=_0x2529df-0x0;var _0x3d30bd=_0x3e74[_0x2529df];return _0x3d30bd;};'use strict';var EventEmitter=require(_0x43e7('0x0'));var CmList=require('../../mysqldb')['db'][_0x43e7('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x43e7('0x2')](0x0);var events={'afterCreate':_0x43e7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc58479){return function(_0x4f9bbe,_0x128b0f,_0xe838b4){CmListEvents[_0x43e7('0x4')](_0xc58479+':'+_0x4f9bbe['id'],_0x4f9bbe);CmListEvents[_0x43e7('0x4')](_0xc58479,_0x4f9bbe);_0xe838b4(null);};}for(var e in events){if(events[_0x43e7('0x5')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module[_0x43e7('0x6')]=CmListEvents; \ No newline at end of file +var _0x326f=['exports','events','setMaxListeners','save','update','remove','emit','hook'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x326f,0xd1));var _0xf326=function(_0x2455d9,_0x9ddeff){_0x2455d9=_0x2455d9-0x0;var _0x4a3f50=_0x326f[_0x2455d9];return _0x4a3f50;};'use strict';var EventEmitter=require(_0xf326('0x0'));var CmList=require('../../mysqldb')['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0xf326('0x1')](0x0);var events={'afterCreate':_0xf326('0x2'),'afterUpdate':_0xf326('0x3'),'afterDestroy':_0xf326('0x4')};function emitEvent(_0x27e8d7){return function(_0x120a26,_0x9445c6,_0xf1c243){CmListEvents[_0xf326('0x5')](_0x27e8d7+':'+_0x120a26['id'],_0x120a26);CmListEvents[_0xf326('0x5')](_0x27e8d7,_0x120a26);_0xf1c243(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xf326('0x6')](e,emitEvent(event));}}module[_0xf326('0x7')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 7b60afb..56463fa 100644 --- a/server/api/cmList/cmList.model.js +++ b/server/api/cmList/cmList.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['moment','bluebird','request-promise','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','../../config/logger','api'];(function(_0x1a4670,_0x28b96b){var _0x34b340=function(_0x5d0cab){while(--_0x5d0cab){_0x1a4670['push'](_0x1a4670['shift']());}};_0x34b340(++_0x28b96b);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa8a8=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','lodash','util'];(function(_0x25243d,_0x40ecd2){var _0x4c4ecd=function(_0x10e7f8){while(--_0x10e7f8){_0x25243d['push'](_0x25243d['shift']());}};_0x4c4ecd(++_0x40ecd2);}(_0xa8a8,0xec));var _0x8a8a=function(_0xac7616,_0x58afa6){_0xac7616=_0xac7616-0x0;var _0x5649ff=_0xa8a8[_0xac7616];return _0x5649ff;};'use strict';var _=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var logger=require(_0x8a8a('0x2'))(_0x8a8a('0x3'));var moment=require('moment');var BPromise=require(_0x8a8a('0x4'));var rp=require(_0x8a8a('0x5'));var fs=require('fs');var path=require(_0x8a8a('0x6'));var rimraf=require(_0x8a8a('0x7'));var config=require(_0x8a8a('0x8'));var attributes=require(_0x8a8a('0x9'));module[_0x8a8a('0xa')]=function(_0x12db82,_0x2e8193){return _0x12db82[_0x8a8a('0xb')](_0x8a8a('0xc'),attributes,{'tableName':_0x8a8a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 516de53..ca338c1 100644 --- a/server/api/cmList/cmList.rpc.js +++ b/server/api/cmList/cmList.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x356b=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','http','redis','localhost','socket.io-emitter','./cmList.socket','register','request','then','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0xf2628e,_0x521bf7){var _0x13863a=function(_0x2b04ab){while(--_0x2b04ab){_0xf2628e['push'](_0xf2628e['shift']());}};_0x13863a(++_0x521bf7);}(_0x356b,0xc9));var _0xb356=function(_0x5abfbc,_0x15b1c2){_0x5abfbc=_0x5abfbc-0x0;var _0x1d230f=_0x356b[_0x5abfbc];return _0x1d230f;};'use strict';var _=require(_0xb356('0x0'));var util=require('util');var moment=require(_0xb356('0x1'));var BPromise=require(_0xb356('0x2'));var rs=require(_0xb356('0x3'));var fs=require('fs');var Redis=require(_0xb356('0x4'));var db=require(_0xb356('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb356('0x6'))('rpc');var config=require(_0xb356('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb356('0x8')]({'port':0x232a});config[_0xb356('0x9')]=_['defaults'](config[_0xb356('0x9')],{'host':_0xb356('0xa'),'port':0x18eb});var socket=require(_0xb356('0xb'))(new Redis(config[_0xb356('0x9')]));require(_0xb356('0xc'))[_0xb356('0xd')](socket);function respondWithRpcPromise(_0x168401,_0x3df43f,_0x2720af){return new BPromise(function(_0x2b6ec9,_0x41ed7d){return client[_0xb356('0xe')](_0x168401,_0x2720af)[_0xb356('0xf')](function(_0x448eeb){logger['info'](_0xb356('0x10'),_0x3df43f,_0xb356('0x11'));logger[_0xb356('0x12')](_0xb356('0x13'),_0x3df43f,_0xb356('0x11'),JSON[_0xb356('0x14')](_0x448eeb));if(_0x448eeb['error']){if(_0x448eeb[_0xb356('0x15')][_0xb356('0x16')]===0x1f4){logger[_0xb356('0x15')](_0xb356('0x10'),_0x3df43f,_0x448eeb[_0xb356('0x15')][_0xb356('0x17')]);return _0x41ed7d(_0x448eeb[_0xb356('0x15')][_0xb356('0x17')]);}logger[_0xb356('0x15')](_0xb356('0x10'),_0x3df43f,_0x448eeb['error'][_0xb356('0x17')]);return _0x2b6ec9(_0x448eeb[_0xb356('0x15')][_0xb356('0x17')]);}else{logger['info'](_0xb356('0x10'),_0x3df43f,_0xb356('0x11'));_0x2b6ec9(_0x448eeb['result'][_0xb356('0x17')]);}})[_0xb356('0x18')](function(_0x412434){logger[_0xb356('0x15')](_0xb356('0x10'),_0x3df43f,_0x412434);_0x41ed7d(_0x412434);});});} \ No newline at end of file +var _0x4a8c=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./cmList.socket','request','then','CmList,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','util','bluebird','randomstring','ioredis'];(function(_0x387603,_0x5a2d1){var _0x55ea9e=function(_0x46c5be){while(--_0x46c5be){_0x387603['push'](_0x387603['shift']());}};_0x55ea9e(++_0x5a2d1);}(_0x4a8c,0x104));var _0xc4a8=function(_0x5ee2ae,_0x12ecd2){_0x5ee2ae=_0x5ee2ae-0x0;var _0x4c0c51=_0x4a8c[_0x5ee2ae];return _0x4c0c51;};'use strict';var _=require('lodash');var util=require(_0xc4a8('0x0'));var moment=require('moment');var BPromise=require(_0xc4a8('0x1'));var rs=require(_0xc4a8('0x2'));var fs=require('fs');var Redis=require(_0xc4a8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc4a8('0x4'));var logger=require(_0xc4a8('0x5'))('rpc');var config=require(_0xc4a8('0x6'));var jayson=require(_0xc4a8('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0xc4a8('0x8')]=_['defaults'](config[_0xc4a8('0x8')],{'host':_0xc4a8('0x9'),'port':0x18eb});var socket=require(_0xc4a8('0xa'))(new Redis(config[_0xc4a8('0x8')]));require(_0xc4a8('0xb'))['register'](socket);function respondWithRpcPromise(_0x174790,_0x2d3ccc,_0x2df694){return new BPromise(function(_0x231374,_0x34077a){return client[_0xc4a8('0xc')](_0x174790,_0x2df694)[_0xc4a8('0xd')](function(_0x4b7fde){logger['info'](_0xc4a8('0xe'),_0x2d3ccc,'request\x20sent');logger[_0xc4a8('0xf')]('CmList,\x20%s,\x20%s,\x20%s',_0x2d3ccc,_0xc4a8('0x10'),JSON[_0xc4a8('0x11')](_0x4b7fde));if(_0x4b7fde[_0xc4a8('0x12')]){if(_0x4b7fde[_0xc4a8('0x12')][_0xc4a8('0x13')]===0x1f4){logger[_0xc4a8('0x12')](_0xc4a8('0xe'),_0x2d3ccc,_0x4b7fde['error'][_0xc4a8('0x14')]);return _0x34077a(_0x4b7fde[_0xc4a8('0x12')]['message']);}logger[_0xc4a8('0x12')](_0xc4a8('0xe'),_0x2d3ccc,_0x4b7fde[_0xc4a8('0x12')][_0xc4a8('0x14')]);return _0x231374(_0x4b7fde[_0xc4a8('0x12')]['message']);}else{logger['info'](_0xc4a8('0xe'),_0x2d3ccc,_0xc4a8('0x10'));_0x231374(_0x4b7fde[_0xc4a8('0x15')]['message']);}})['catch'](function(_0x188026){logger[_0xc4a8('0x12')](_0xc4a8('0xe'),_0x2d3ccc,_0x188026);_0x34077a(_0x188026);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 5deaa7b..46693c7 100644 --- a/server/api/cmList/cmList.socket.js +++ b/server/api/cmList/cmList.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc7d7=['remove','update','emit','register','length','cmList:','./cmList.events','save'];(function(_0xfc3f80,_0x4e8c1a){var _0x2f19d8=function(_0x207373){while(--_0x207373){_0xfc3f80['push'](_0xfc3f80['shift']());}};_0x2f19d8(++_0x4e8c1a);}(_0xc7d7,0x18e));var _0x7c7d=function(_0x5698f3,_0x15bdab){_0x5698f3=_0x5698f3-0x0;var _0x157252=_0xc7d7[_0x5698f3];return _0x157252;};'use strict';var CmListEvents=require(_0x7c7d('0x0'));var events=[_0x7c7d('0x1'),_0x7c7d('0x2'),_0x7c7d('0x3')];function createListener(_0x233913,_0x3782d2){return function(_0xd53b5c){_0x3782d2[_0x7c7d('0x4')](_0x233913,_0xd53b5c);};}function removeListener(_0x413315,_0x4cbac2){return function(){CmListEvents['removeListener'](_0x413315,_0x4cbac2);};}exports[_0x7c7d('0x5')]=function(_0x3c3987){for(var _0x4d7137=0x0,_0x556262=events[_0x7c7d('0x6')];_0x4d7137<_0x556262;_0x4d7137++){var _0x54a9aa=events[_0x4d7137];var _0x3f40cb=createListener(_0x7c7d('0x7')+_0x54a9aa,_0x3c3987);CmListEvents['on'](_0x54a9aa,_0x3f40cb);}}; \ No newline at end of file +var _0xde50=['emit','removeListener','register','length','cmList:'];(function(_0x380a3f,_0x202483){var _0x2b4eca=function(_0x1e99b2){while(--_0x1e99b2){_0x380a3f['push'](_0x380a3f['shift']());}};_0x2b4eca(++_0x202483);}(_0xde50,0x14f));var _0x0de5=function(_0xbc7075,_0x4d482c){_0xbc7075=_0xbc7075-0x0;var _0x218de1=_0xde50[_0xbc7075];return _0x218de1;};'use strict';var CmListEvents=require('./cmList.events');var events=['save','remove','update'];function createListener(_0x42d1f7,_0x588a6b){return function(_0x47a4c4){_0x588a6b[_0x0de5('0x0')](_0x42d1f7,_0x47a4c4);};}function removeListener(_0x21759f,_0x2bae3a){return function(){CmListEvents[_0x0de5('0x1')](_0x21759f,_0x2bae3a);};}exports[_0x0de5('0x2')]=function(_0x4611a8){for(var _0x2c19a2=0x0,_0x4b97ca=events[_0x0de5('0x3')];_0x2c19a2<_0x4b97ca;_0x2c19a2++){var _0x149dd7=events[_0x2c19a2];var _0x15ff94=createListener(_0x0de5('0x4')+_0x149dd7,_0x4611a8);CmListEvents['on'](_0x149dd7,_0x15ff94);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 77c7175..510db8f 100644 --- a/server/api/cmList/index.js +++ b/server/api/cmList/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1f61=['addDisposition','addContacts','addAgents','update','delete','destroy','removeDispositions','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','isAuthenticated','index','get','/describe','describe','getGlobalCustomFields','/:id','show','/:id/dispositions','getDispositions','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','create','post'];(function(_0x555ffe,_0x206b3e){var _0x4eae39=function(_0x1353e3){while(--_0x1353e3){_0x555ffe['push'](_0x555ffe['shift']());}};_0x4eae39(++_0x206b3e);}(_0x1f61,0x14c));var _0x11f6=function(_0x1da10a,_0x1fe948){_0x1da10a=_0x1da10a-0x0;var _0x5aea64=_0x1f61[_0x1da10a];return _0x5aea64;};'use strict';var multer=require(_0x11f6('0x0'));var util=require('util');var path=require(_0x11f6('0x1'));var timeout=require(_0x11f6('0x2'));var express=require(_0x11f6('0x3'));var router=express['Router']();var fs_extra=require(_0x11f6('0x4'));var auth=require(_0x11f6('0x5'));var interaction=require(_0x11f6('0x6'));var config=require(_0x11f6('0x7'));var controller=require(_0x11f6('0x8'));router['get']('/',auth[_0x11f6('0x9')](),controller[_0x11f6('0xa')]);router[_0x11f6('0xb')](_0x11f6('0xc'),auth[_0x11f6('0x9')](),controller[_0x11f6('0xd')]);router[_0x11f6('0xb')]('/global_fields',auth['isAuthenticated'](),controller[_0x11f6('0xe')]);router[_0x11f6('0xb')](_0x11f6('0xf'),auth[_0x11f6('0x9')](),controller[_0x11f6('0x10')]);router['get'](_0x11f6('0x11'),auth['isAuthenticated'](),controller[_0x11f6('0x12')]);router['get']('/:id/contacts',auth[_0x11f6('0x9')](),controller[_0x11f6('0x13')]);router[_0x11f6('0xb')](_0x11f6('0x14'),auth[_0x11f6('0x9')](),controller[_0x11f6('0x15')]);router['get'](_0x11f6('0x16'),auth[_0x11f6('0x9')](),controller[_0x11f6('0x17')]);router['get'](_0x11f6('0x18'),auth[_0x11f6('0x9')](),controller[_0x11f6('0x19')]);router['post']('/',auth[_0x11f6('0x9')](),controller[_0x11f6('0x1a')]);router[_0x11f6('0x1b')](_0x11f6('0x11'),auth[_0x11f6('0x9')](),controller[_0x11f6('0x1c')]);router[_0x11f6('0x1b')]('/:id/contacts',auth[_0x11f6('0x9')](),controller[_0x11f6('0x1d')]);router[_0x11f6('0x1b')](_0x11f6('0x16'),auth[_0x11f6('0x9')](),controller['addCustomField']);router['post'](_0x11f6('0x18'),auth[_0x11f6('0x9')](),controller[_0x11f6('0x1e')]);router['put']('/:id',auth[_0x11f6('0x9')](),controller[_0x11f6('0x1f')]);router[_0x11f6('0x20')](_0x11f6('0xf'),auth[_0x11f6('0x9')](),controller[_0x11f6('0x21')]);router[_0x11f6('0x20')](_0x11f6('0x11'),auth[_0x11f6('0x9')](),controller[_0x11f6('0x22')]);router[_0x11f6('0x20')](_0x11f6('0x18'),auth[_0x11f6('0x9')](),controller['removeAgents']);module[_0x11f6('0x23')]=router; \ No newline at end of file +var _0xa4c7=['getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','create','post','/:id/dispositions','addDisposition','addAgents','put','update','/:id','delete','removeDispositions','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','describe','/global_fields','show','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv'];(function(_0x185a4d,_0x2dcb97){var _0x30e4b1=function(_0x38fd29){while(--_0x38fd29){_0x185a4d['push'](_0x185a4d['shift']());}};_0x30e4b1(++_0x2dcb97);}(_0xa4c7,0x182));var _0x7a4c=function(_0x5548df,_0x37d5a2){_0x5548df=_0x5548df-0x0;var _0x1ccd76=_0xa4c7[_0x5548df];return _0x1ccd76;};'use strict';var multer=require(_0x7a4c('0x0'));var util=require(_0x7a4c('0x1'));var path=require(_0x7a4c('0x2'));var timeout=require(_0x7a4c('0x3'));var express=require(_0x7a4c('0x4'));var router=express[_0x7a4c('0x5')]();var fs_extra=require(_0x7a4c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x7a4c('0x7'));var config=require(_0x7a4c('0x8'));var controller=require(_0x7a4c('0x9'));router[_0x7a4c('0xa')]('/',auth[_0x7a4c('0xb')](),controller[_0x7a4c('0xc')]);router[_0x7a4c('0xa')](_0x7a4c('0xd'),auth[_0x7a4c('0xb')](),controller[_0x7a4c('0xe')]);router[_0x7a4c('0xa')](_0x7a4c('0xf'),auth[_0x7a4c('0xb')](),controller['getGlobalCustomFields']);router[_0x7a4c('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x7a4c('0x10')]);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x7a4c('0x11')]);router[_0x7a4c('0xa')](_0x7a4c('0x12'),auth[_0x7a4c('0xb')](),controller[_0x7a4c('0x13')]);router['get'](_0x7a4c('0x14'),auth[_0x7a4c('0xb')](),controller[_0x7a4c('0x15')]);router['get'](_0x7a4c('0x16'),auth[_0x7a4c('0xb')](),controller[_0x7a4c('0x17')]);router[_0x7a4c('0xa')](_0x7a4c('0x18'),auth['isAuthenticated'](),controller[_0x7a4c('0x19')]);router['post']('/',auth[_0x7a4c('0xb')](),controller[_0x7a4c('0x1a')]);router[_0x7a4c('0x1b')](_0x7a4c('0x1c'),auth['isAuthenticated'](),controller[_0x7a4c('0x1d')]);router[_0x7a4c('0x1b')]('/:id/contacts',auth[_0x7a4c('0xb')](),controller['addContacts']);router[_0x7a4c('0x1b')]('/:id/fields',auth[_0x7a4c('0xb')](),controller['addCustomField']);router[_0x7a4c('0x1b')](_0x7a4c('0x18'),auth['isAuthenticated'](),controller[_0x7a4c('0x1e')]);router[_0x7a4c('0x1f')]('/:id',auth[_0x7a4c('0xb')](),controller[_0x7a4c('0x20')]);router['delete'](_0x7a4c('0x21'),auth['isAuthenticated'](),controller['destroy']);router[_0x7a4c('0x22')](_0x7a4c('0x1c'),auth[_0x7a4c('0xb')](),controller[_0x7a4c('0x23')]);router['delete'](_0x7a4c('0x18'),auth[_0x7a4c('0xb')](),controller[_0x7a4c('0x24')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index d323072..dc7e0c8 100644 --- a/server/api/condition/condition.attributes.js +++ b/server/api/condition/condition.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0d75=['STRING','sequelize','VIRTUAL','getDataValue','field'];(function(_0x435031,_0x1c187b){var _0x32b0c8=function(_0x4f0e87){while(--_0x4f0e87){_0x435031['push'](_0x435031['shift']());}};_0x32b0c8(++_0x1c187b);}(_0x0d75,0x191));var _0x50d7=function(_0x4ed179,_0x2c8a9a){_0x4ed179=_0x4ed179-0x0;var _0x4200fd=_0x0d75[_0x4ed179];return _0x4200fd;};'use strict';var Sequelize=require(_0x50d7('0x0'));module['exports']={'name':{'type':Sequelize[_0x50d7('0x1')],'get':function(_0x53afb9){return this[_0x50d7('0x2')](_0x50d7('0x3'));}},'field':{'type':Sequelize[_0x50d7('0x4')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x50d7('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0x324c=['field','STRING','exports','VIRTUAL'];(function(_0x45ec1c,_0x82e1af){var _0x84bcbf=function(_0xe92cd0){while(--_0xe92cd0){_0x45ec1c['push'](_0x45ec1c['shift']());}};_0x84bcbf(++_0x82e1af);}(_0x324c,0xfe));var _0xc324=function(_0x31c47a,_0x28ad1d){_0x31c47a=_0x31c47a-0x0;var _0x265de6=_0x324c[_0x31c47a];return _0x265de6;};'use strict';var Sequelize=require('sequelize');module[_0xc324('0x0')]={'name':{'type':Sequelize[_0xc324('0x1')],'get':function(_0x132e8f){return this['getDataValue'](_0xc324('0x2'));}},'field':{'type':Sequelize[_0xc324('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0xc324('0x3')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 1f5d902..da274be 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x1bd40b,_0x4cd6eb){var _0x2dd0ac=function(_0x448360){while(--_0x448360){_0x1bd40b['push'](_0x1bd40b['shift']());}};_0x2dd0ac(++_0x4cd6eb);}(_0x7a54,0x106));var _0x47a5=function(_0x52399c,_0x91d17f){_0x52399c=_0x52399c-0x0;var _0x58c2fc=_0x7a54[_0x52399c];return _0x58c2fc;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x171630,_0x5e6eef){var _0x11ab9f=function(_0x2c3df2){while(--_0x2c3df2){_0x171630['push'](_0x171630['shift']());}};_0x11ab9f(++_0x5e6eef);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index e0f2a7b..c612919 100644 --- a/server/api/condition/condition.model.js +++ b/server/api/condition/condition.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9a49=['bluebird','request-promise','rimraf','../../config/environment','./condition.attributes','exports','define','Condition','tools_conditions','lodash','util','../../config/logger'];(function(_0x5779e3,_0x442fd9){var _0x17f6f7=function(_0x52b19e){while(--_0x52b19e){_0x5779e3['push'](_0x5779e3['shift']());}};_0x17f6f7(++_0x442fd9);}(_0x9a49,0x105));var _0x99a4=function(_0x59ee12,_0x54fee5){_0x59ee12=_0x59ee12-0x0;var _0x532468=_0x9a49[_0x59ee12];return _0x532468;};'use strict';var _=require(_0x99a4('0x0'));var util=require(_0x99a4('0x1'));var logger=require(_0x99a4('0x2'))('api');var moment=require('moment');var BPromise=require(_0x99a4('0x3'));var rp=require(_0x99a4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x99a4('0x5'));var config=require(_0x99a4('0x6'));var attributes=require(_0x99a4('0x7'));module[_0x99a4('0x8')]=function(_0x5807db,_0x248f93){return _0x5807db[_0x99a4('0x9')](_0x99a4('0xa'),attributes,{'tableName':_0x99a4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x725f=['./condition.attributes','exports','define','Condition','util','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2ff2bc,_0x3a97ec){var _0x17ece3=function(_0x474afe){while(--_0x474afe){_0x2ff2bc['push'](_0x2ff2bc['shift']());}};_0x17ece3(++_0x3a97ec);}(_0x725f,0x117));var _0xf725=function(_0x295b50,_0x468a86){_0x295b50=_0x295b50-0x0;var _0xf3395a=_0x725f[_0x295b50];return _0xf3395a;};'use strict';var _=require('lodash');var util=require(_0xf725('0x0'));var logger=require('../../config/logger')(_0xf725('0x1'));var moment=require('moment');var BPromise=require(_0xf725('0x2'));var rp=require(_0xf725('0x3'));var fs=require('fs');var path=require(_0xf725('0x4'));var rimraf=require(_0xf725('0x5'));var config=require(_0xf725('0x6'));var attributes=require(_0xf725('0x7'));module[_0xf725('0x8')]=function(_0x2e1cfe,_0x421ded){return _0x2e1cfe[_0xf725('0x9')](_0xf725('0xa'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 5c61fbf..fb3a211 100644 --- a/server/api/condition/condition.rpc.js +++ b/server/api/condition/condition.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xceb8=['client','http','then','info','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','jayson/promise'];(function(_0x2d7fc7,_0x13396b){var _0x27e3d1=function(_0x392313){while(--_0x392313){_0x2d7fc7['push'](_0x2d7fc7['shift']());}};_0x27e3d1(++_0x13396b);}(_0xceb8,0xf0));var _0x8ceb=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xceb8[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x8ceb('0x0'));var util=require('util');var moment=require(_0x8ceb('0x1'));var BPromise=require(_0x8ceb('0x2'));var rs=require(_0x8ceb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8ceb('0x4'))['db'];var utils=require(_0x8ceb('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x8ceb('0x6'));var client=jayson[_0x8ceb('0x7')][_0x8ceb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x524954,_0x5af533,_0xbeec92){return new BPromise(function(_0x14753c,_0xa4361d){return client['request'](_0x524954,_0xbeec92)[_0x8ceb('0x9')](function(_0xc423bd){logger[_0x8ceb('0xa')](_0x8ceb('0xb'),_0x5af533,'request\x20sent');logger[_0x8ceb('0xc')](_0x8ceb('0xd'),_0x5af533,_0x8ceb('0xe'),JSON[_0x8ceb('0xf')](_0xc423bd));if(_0xc423bd[_0x8ceb('0x10')]){if(_0xc423bd['error'][_0x8ceb('0x11')]===0x1f4){logger[_0x8ceb('0x10')](_0x8ceb('0xb'),_0x5af533,_0xc423bd['error'][_0x8ceb('0x12')]);return _0xa4361d(_0xc423bd[_0x8ceb('0x10')][_0x8ceb('0x12')]);}logger[_0x8ceb('0x10')](_0x8ceb('0xb'),_0x5af533,_0xc423bd['error'][_0x8ceb('0x12')]);return _0x14753c(_0xc423bd['error'][_0x8ceb('0x12')]);}else{logger['info'](_0x8ceb('0xb'),_0x5af533,_0x8ceb('0xe'));_0x14753c(_0xc423bd['result'][_0x8ceb('0x12')]);}})['catch'](function(_0x11c836){logger['error'](_0x8ceb('0xb'),_0x5af533,_0x11c836);_0xa4361d(_0x11c836);});});} \ No newline at end of file +var _0x590e=['message','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x5cbd7b,_0x207439){var _0x3fdfb8=function(_0x4eb12e){while(--_0x4eb12e){_0x5cbd7b['push'](_0x5cbd7b['shift']());}};_0x3fdfb8(++_0x207439);}(_0x590e,0x153));var _0xe590=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x590e[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xe590('0x0'));var moment=require('moment');var BPromise=require(_0xe590('0x1'));var rs=require(_0xe590('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe590('0x3'))['db'];var utils=require(_0xe590('0x4'));var logger=require(_0xe590('0x5'))(_0xe590('0x6'));var config=require(_0xe590('0x7'));var jayson=require(_0xe590('0x8'));var client=jayson[_0xe590('0x9')][_0xe590('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5bc983,_0x146666,_0x1ba7d6){return new BPromise(function(_0x51b4df,_0x4c1095){return client['request'](_0x5bc983,_0x1ba7d6)[_0xe590('0xb')](function(_0x3e769d){logger[_0xe590('0xc')](_0xe590('0xd'),_0x146666,_0xe590('0xe'));logger[_0xe590('0xf')]('Condition,\x20%s,\x20%s,\x20%s',_0x146666,_0xe590('0xe'),JSON['stringify'](_0x3e769d));if(_0x3e769d[_0xe590('0x10')]){if(_0x3e769d['error'][_0xe590('0x11')]===0x1f4){logger[_0xe590('0x10')](_0xe590('0xd'),_0x146666,_0x3e769d[_0xe590('0x10')][_0xe590('0x12')]);return _0x4c1095(_0x3e769d[_0xe590('0x10')][_0xe590('0x12')]);}logger[_0xe590('0x10')](_0xe590('0xd'),_0x146666,_0x3e769d['error'][_0xe590('0x12')]);return _0x51b4df(_0x3e769d[_0xe590('0x10')][_0xe590('0x12')]);}else{logger[_0xe590('0xc')]('Condition,\x20%s,\x20%s',_0x146666,_0xe590('0xe'));_0x51b4df(_0x3e769d[_0xe590('0x13')][_0xe590('0x12')]);}})[_0xe590('0x14')](function(_0x1f5622){logger[_0xe590('0x10')](_0xe590('0xd'),_0x146666,_0x1f5622);_0x4c1095(_0x1f5622);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 963334a..6aba8f2 100644 --- a/server/api/condition/index.js +++ b/server/api/condition/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1a4a=['util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','/:id','update','delete','isAuthenticated','destroy','exports','multer'];(function(_0xd7b0a4,_0x53c7d3){var _0x184e9e=function(_0x325bbd){while(--_0x325bbd){_0xd7b0a4['push'](_0xd7b0a4['shift']());}};_0x184e9e(++_0x53c7d3);}(_0x1a4a,0x194));var _0xa1a4=function(_0x4667da,_0x17f442){_0x4667da=_0x4667da-0x0;var _0x329bd7=_0x1a4a[_0x4667da];return _0x329bd7;};'use strict';var multer=require(_0xa1a4('0x0'));var util=require(_0xa1a4('0x1'));var path=require('path');var timeout=require(_0xa1a4('0x2'));var express=require('express');var router=express[_0xa1a4('0x3')]();var fs_extra=require(_0xa1a4('0x4'));var auth=require(_0xa1a4('0x5'));var interaction=require(_0xa1a4('0x6'));var config=require(_0xa1a4('0x7'));var controller=require(_0xa1a4('0x8'));router['put'](_0xa1a4('0x9'),auth['isAuthenticated'](),controller[_0xa1a4('0xa')]);router[_0xa1a4('0xb')]('/:id',auth[_0xa1a4('0xc')](),controller[_0xa1a4('0xd')]);module[_0xa1a4('0xe')]=router; \ No newline at end of file +var _0xfeba=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./condition.controller','put','/:id','update','delete','isAuthenticated','destroy','exports','multer','util','path'];(function(_0x20210e,_0x1603f6){var _0x439c00=function(_0x5b4cc2){while(--_0x5b4cc2){_0x20210e['push'](_0x20210e['shift']());}};_0x439c00(++_0x1603f6);}(_0xfeba,0x1cd));var _0xafeb=function(_0x31c82c,_0x409224){_0x31c82c=_0x31c82c-0x0;var _0x376ede=_0xfeba[_0x31c82c];return _0x376ede;};'use strict';var multer=require(_0xafeb('0x0'));var util=require(_0xafeb('0x1'));var path=require(_0xafeb('0x2'));var timeout=require(_0xafeb('0x3'));var express=require(_0xafeb('0x4'));var router=express['Router']();var fs_extra=require(_0xafeb('0x5'));var auth=require(_0xafeb('0x6'));var interaction=require(_0xafeb('0x7'));var config=require('../../config/environment');var controller=require(_0xafeb('0x8'));router[_0xafeb('0x9')](_0xafeb('0xa'),auth['isAuthenticated'](),controller[_0xafeb('0xb')]);router[_0xafeb('0xc')](_0xafeb('0xa'),auth[_0xafeb('0xd')](),controller[_0xafeb('0xe')]);module[_0xafeb('0xf')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index bc4c64e..3e370d6 100644 --- a/server/api/contactItemType/contactItemType.attributes.js +++ b/server/api/contactItemType/contactItemType.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfbc8=['STRING','sequelize','exports','name','INTEGER'];(function(_0x4a5f6c,_0x4f532e){var _0x281ffd=function(_0x4c68e3){while(--_0x4c68e3){_0x4a5f6c['push'](_0x4a5f6c['shift']());}};_0x281ffd(++_0x4f532e);}(_0xfbc8,0xb5));var _0x8fbc=function(_0x2a6490,_0x1adf0f){_0x2a6490=_0x2a6490-0x0;var _0x1b31df=_0xfbc8[_0x2a6490];return _0x1b31df;};'use strict';var Sequelize=require(_0x8fbc('0x0'));module[_0x8fbc('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8fbc('0x2')},'OrderBy':{'type':Sequelize[_0x8fbc('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x8fbc('0x4')],'allowNull':!![]}}; \ No newline at end of file +var _0xc12e=['exports','STRING','name','sequelize'];(function(_0x13184d,_0x6bdeb0){var _0x384a96=function(_0x17070d){while(--_0x17070d){_0x13184d['push'](_0x13184d['shift']());}};_0x384a96(++_0x6bdeb0);}(_0xc12e,0x13f));var _0xec12=function(_0x3bed23,_0x36ad36){_0x3bed23=_0x3bed23-0x0;var _0x31f760=_0xc12e[_0x3bed23];return _0x31f760;};'use strict';var Sequelize=require(_0xec12('0x0'));module[_0xec12('0x1')]={'name':{'type':Sequelize[_0xec12('0x2')],'allowNull':![],'unique':_0xec12('0x3')},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xec12('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index b894ab1..51893fa 100644 --- a/server/api/contactItemType/contactItemType.controller.js +++ b/server/api/contactItemType/contactItemType.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x056b=['find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','body','CmContactHasItem','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','save','update','then','destroy','ContactItemTypes','error','stack','name','index','map','ContactItemType','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','includeAll'];(function(_0x13c471,_0x2250e6){var _0xb6c73f=function(_0x4b0bfb){while(--_0x4b0bfb){_0x13c471['push'](_0x13c471['shift']());}};_0xb6c73f(++_0x2250e6);}(_0x056b,0xb6));var _0xb056=function(_0x12a2a6,_0x374ff1){_0x12a2a6=_0x12a2a6-0x0;var _0x1754ae=_0x056b[_0x12a2a6];return _0x1754ae;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb056('0x0'));var zipdir=require(_0xb056('0x1'));var jsonpatch=require(_0xb056('0x2'));var rp=require(_0xb056('0x3'));var moment=require(_0xb056('0x4'));var BPromise=require(_0xb056('0x5'));var Mustache=require(_0xb056('0x6'));var util=require(_0xb056('0x7'));var path=require(_0xb056('0x8'));var sox=require(_0xb056('0x9'));var csv=require(_0xb056('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb056('0xb'));var _=require(_0xb056('0xc'));var squel=require(_0xb056('0xd'));var crypto=require(_0xb056('0xe'));var jsforce=require(_0xb056('0xf'));var deskjs=require(_0xb056('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb056('0x11'));var Redis=require(_0xb056('0x12'));var authService=require(_0xb056('0x13'));var qs=require(_0xb056('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb056('0x15'));var logger=require('../../config/logger')(_0xb056('0x16'));var utils=require(_0xb056('0x17'));var config=require(_0xb056('0x18'));var licenseUtil=require(_0xb056('0x19'));var db=require(_0xb056('0x1a'))['db'];function respondWithStatusCode(_0x5d8306,_0x49c5ec){_0x49c5ec=_0x49c5ec||0xcc;return function(_0xf3e80f){if(_0xf3e80f){return _0x5d8306[_0xb056('0x1b')](_0x49c5ec);}return _0x5d8306['status'](_0x49c5ec)[_0xb056('0x1c')]();};}function respondWithResult(_0x34611b,_0xf1c2e9){_0xf1c2e9=_0xf1c2e9||0xc8;return function(_0x1197e5){if(_0x1197e5){return _0x34611b[_0xb056('0x1d')](_0xf1c2e9)[_0xb056('0x1e')](_0x1197e5);}};}function respondWithFilteredResult(_0x179e49,_0x4b838e){return function(_0x162146){if(_0x162146){var _0x43565e=typeof _0x4b838e[_0xb056('0x1f')]===_0xb056('0x20')&&typeof _0x4b838e['limit']===_0xb056('0x20');var _0x4e501a=_0x162146[_0xb056('0x21')];var _0x311eb9=_0x43565e?0x0:_0x4b838e['offset'];var _0x29c77e=_0x43565e?_0x162146['count']:_0x4b838e[_0xb056('0x1f')]+_0x4b838e[_0xb056('0x22')];var _0x5e4bd9;if(_0x29c77e>=_0x4e501a){_0x29c77e=_0x4e501a;_0x5e4bd9=0xc8;}else{_0x5e4bd9=0xce;}_0x179e49[_0xb056('0x1d')](_0x5e4bd9);return _0x179e49['set'](_0xb056('0x23'),_0x311eb9+'-'+_0x29c77e+'/'+_0x4e501a)[_0xb056('0x1e')](_0x162146);}return null;};}function patchUpdates(_0x457b54){return function(_0x33dd35){try{jsonpatch['apply'](_0x33dd35,_0x457b54,!![]);}catch(_0x1db585){return BPromise['reject'](_0x1db585);}return _0x33dd35[_0xb056('0x24')]();};}function saveUpdates(_0x5dea90,_0x324ce6){return function(_0x40ac2d){if(_0x40ac2d){return _0x40ac2d[_0xb056('0x25')](_0x5dea90)[_0xb056('0x26')](function(_0x36e539){return _0x36e539;});}return null;};}function removeEntity(_0x4bb6c0,_0x4e66c3){return function(_0x1016da){if(_0x1016da){return _0x1016da[_0xb056('0x27')]()[_0xb056('0x26')](function(){var _0x1bd6ac=_0x1016da['get']({'plain':!![]});var _0x44a14f=_0xb056('0x28');return db['UserProfileResource'][_0xb056('0x27')]({'where':{'type':_0x44a14f,'resourceId':_0x1bd6ac['id']}})[_0xb056('0x26')](function(){return _0x1016da;});})[_0xb056('0x26')](function(){_0x4bb6c0[_0xb056('0x1d')](0xcc)[_0xb056('0x1c')]();});}};}function handleEntityNotFound(_0x4024d7,_0x211898){return function(_0x2042f1){if(!_0x2042f1){_0x4024d7['sendStatus'](0x194);}return _0x2042f1;};}function handleError(_0x29fbc1,_0x51b06b){_0x51b06b=_0x51b06b||0x1f4;return function(_0x3d83d3){logger[_0xb056('0x29')](_0x3d83d3[_0xb056('0x2a')]);if(_0x3d83d3['name']){delete _0x3d83d3[_0xb056('0x2b')];}_0x29fbc1[_0xb056('0x1d')](_0x51b06b)['send'](_0x3d83d3);};}exports[_0xb056('0x2c')]=function(_0x43aa63,_0x329eaa){var _0x1fad05={},_0x3ce984={},_0x4ebca5={'count':0x0,'rows':[]};var _0x87f31e=_[_0xb056('0x2d')](db[_0xb056('0x2e')][_0xb056('0x2f')],function(_0x103482){return{'name':_0x103482['fieldName'],'type':_0x103482[_0xb056('0x30')][_0xb056('0x31')]};});_0x3ce984[_0xb056('0x32')]=_[_0xb056('0x2d')](_0x87f31e,_0xb056('0x2b'));_0x3ce984[_0xb056('0x33')]=_[_0xb056('0x34')](_0x43aa63[_0xb056('0x33')]);_0x3ce984['filters']=_[_0xb056('0x35')](_0x3ce984['model'],_0x3ce984[_0xb056('0x33')]);_0x1fad05['attributes']=_['intersection'](_0x3ce984[_0xb056('0x32')],qs[_0xb056('0x36')](_0x43aa63[_0xb056('0x33')][_0xb056('0x36')]));_0x1fad05[_0xb056('0x37')]=_0x1fad05[_0xb056('0x37')][_0xb056('0x38')]?_0x1fad05['attributes']:_0x3ce984[_0xb056('0x32')];if(!_0x43aa63[_0xb056('0x33')]['hasOwnProperty']('nolimit')){_0x1fad05[_0xb056('0x22')]=qs[_0xb056('0x22')](_0x43aa63[_0xb056('0x33')]['limit']);_0x1fad05[_0xb056('0x1f')]=qs[_0xb056('0x1f')](_0x43aa63[_0xb056('0x33')][_0xb056('0x1f')]);}_0x1fad05[_0xb056('0x39')]=qs[_0xb056('0x3a')](_0x43aa63[_0xb056('0x33')][_0xb056('0x3a')]);_0x1fad05[_0xb056('0x3b')]=qs[_0xb056('0x3c')](_[_0xb056('0x3d')](_0x43aa63[_0xb056('0x33')],_0x3ce984['filters']),_0x87f31e);if(_0x43aa63[_0xb056('0x33')]['filter']){_0x1fad05[_0xb056('0x3b')]=_[_0xb056('0x3e')](_0x1fad05[_0xb056('0x3b')],{'$or':_[_0xb056('0x2d')](_0x87f31e,function(_0x460f28){if(_0x460f28[_0xb056('0x30')]!==_0xb056('0x3f')){var _0x42b54f={};_0x42b54f[_0x460f28['name']]={'$like':'%'+_0x43aa63[_0xb056('0x33')][_0xb056('0x40')]+'%'};return _0x42b54f;}})});}_0x1fad05=_[_0xb056('0x3e')]({},_0x1fad05,_0x43aa63[_0xb056('0x41')]);var _0x134db7={'where':_0x1fad05['where']};return db[_0xb056('0x2e')][_0xb056('0x21')](_0x134db7)[_0xb056('0x26')](function(_0x216f72){_0x4ebca5[_0xb056('0x21')]=_0x216f72;if(_0x43aa63[_0xb056('0x33')]['includeAll']){_0x1fad05[_0xb056('0x42')]=[{'all':!![]}];}return db['ContactItemType'][_0xb056('0x43')](_0x1fad05);})[_0xb056('0x26')](function(_0x21d98e){_0x4ebca5[_0xb056('0x44')]=_0x21d98e;return _0x4ebca5;})[_0xb056('0x26')](respondWithFilteredResult(_0x329eaa,_0x1fad05))[_0xb056('0x45')](handleError(_0x329eaa,null));};exports[_0xb056('0x46')]=function(_0x248819,_0x2c8b61){var _0x149341={'raw':!![],'where':{'id':_0x248819[_0xb056('0x47')]['id']}},_0x4fa3c5={};_0x4fa3c5[_0xb056('0x32')]=_[_0xb056('0x34')](db['ContactItemType'][_0xb056('0x2f')]);_0x4fa3c5[_0xb056('0x33')]=_['keys'](_0x248819['query']);_0x4fa3c5[_0xb056('0x3c')]=_[_0xb056('0x35')](_0x4fa3c5[_0xb056('0x32')],_0x4fa3c5[_0xb056('0x33')]);_0x149341['attributes']=_['intersection'](_0x4fa3c5['model'],qs['fields'](_0x248819['query']['fields']));_0x149341[_0xb056('0x37')]=_0x149341['attributes'][_0xb056('0x38')]?_0x149341[_0xb056('0x37')]:_0x4fa3c5[_0xb056('0x32')];if(_0x248819[_0xb056('0x33')][_0xb056('0x48')]){_0x149341[_0xb056('0x42')]=[{'all':!![]}];}_0x149341=_[_0xb056('0x3e')]({},_0x149341,_0x248819[_0xb056('0x41')]);return db['ContactItemType'][_0xb056('0x49')](_0x149341)[_0xb056('0x26')](handleEntityNotFound(_0x2c8b61,null))['then'](respondWithResult(_0x2c8b61,null))[_0xb056('0x45')](handleError(_0x2c8b61,null));};exports[_0xb056('0x4a')]=function(_0xe40439,_0x2f2d22){return db[_0xb056('0x2e')][_0xb056('0x4a')](_0xe40439['body'],{})[_0xb056('0x26')](function(_0x5e2224){var _0x132268=_0xe40439[_0xb056('0x4b')][_0xb056('0x4c')]({'plain':!![]});if(!_0x132268)throw new Error(_0xb056('0x4d'));if(_0x132268[_0xb056('0x4e')]===_0xb056('0x4b')){var _0x2b6733=_0x5e2224[_0xb056('0x4c')]({'plain':!![]});var _0x5a3bbf=_0xb056('0x28');return db[_0xb056('0x4f')][_0xb056('0x49')]({'where':{'name':_0x5a3bbf,'userProfileId':_0x132268[_0xb056('0x50')]},'raw':!![]})[_0xb056('0x26')](function(_0x35acab){if(_0x35acab&&_0x35acab[_0xb056('0x51')]===0x0){return db[_0xb056('0x52')]['create']({'name':_0x2b6733[_0xb056('0x2b')],'resourceId':_0x2b6733['id'],'type':_0x35acab[_0xb056('0x2b')],'sectionId':_0x35acab['id']},{})[_0xb056('0x26')](function(){return _0x5e2224;});}else{return _0x5e2224;}})[_0xb056('0x45')](function(_0x1a5170){logger[_0xb056('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a5170);throw _0x1a5170;});}return _0x5e2224;})[_0xb056('0x26')](respondWithResult(_0x2f2d22,0xc9))[_0xb056('0x45')](handleError(_0x2f2d22,null));};exports[_0xb056('0x25')]=function(_0x536d85,_0x37c64c){if(_0x536d85['body']['id']){delete _0x536d85[_0xb056('0x53')]['id'];}return db[_0xb056('0x2e')][_0xb056('0x49')]({'where':{'id':_0x536d85[_0xb056('0x47')]['id']}})['then'](handleEntityNotFound(_0x37c64c,null))[_0xb056('0x26')](saveUpdates(_0x536d85[_0xb056('0x53')],null))['then'](respondWithResult(_0x37c64c,null))[_0xb056('0x45')](handleError(_0x37c64c,null));};exports[_0xb056('0x27')]=function(_0x1d3cdd,_0x1546e5){return db[_0xb056('0x2e')]['find']({'where':{'id':_0x1d3cdd[_0xb056('0x47')]['id']}})[_0xb056('0x26')](handleEntityNotFound(_0x1546e5,null))[_0xb056('0x26')](db[_0xb056('0x54')][_0xb056('0x25')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x1d3cdd[_0xb056('0x47')]['id']}}))[_0xb056('0x26')](removeEntity(_0x1546e5,null))[_0xb056('0x45')](handleError(_0x1546e5,null));}; \ No newline at end of file +var _0x781d=['find','CmContactHasItem','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','destroy','then','get','stack','name','send','index','ContactItemType','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','type','options','includeAll','include','findAll','rows','show','params','keys','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x9d12b0,_0x3c9821){var _0x59a9b0=function(_0x2aa1b8){while(--_0x2aa1b8){_0x9d12b0['push'](_0x9d12b0['shift']());}};_0x59a9b0(++_0x3c9821);}(_0x781d,0x14a));var _0xd781=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x781d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xd781('0x0'));var rimraf=require(_0xd781('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd781('0x2'));var moment=require(_0xd781('0x3'));var BPromise=require(_0xd781('0x4'));var Mustache=require(_0xd781('0x5'));var util=require(_0xd781('0x6'));var path=require(_0xd781('0x7'));var sox=require(_0xd781('0x8'));var csv=require(_0xd781('0x9'));var ejs=require(_0xd781('0xa'));var fs=require('fs');var fs_extra=require(_0xd781('0xb'));var _=require('lodash');var squel=require(_0xd781('0xc'));var crypto=require(_0xd781('0xd'));var jsforce=require(_0xd781('0xe'));var deskjs=require(_0xd781('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd781('0x10'));var Papa=require('papaparse');var Redis=require(_0xd781('0x11'));var authService=require(_0xd781('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd781('0x13'));var hardwareService=require(_0xd781('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xd781('0x15'));var config=require(_0xd781('0x16'));var licenseUtil=require(_0xd781('0x17'));var db=require(_0xd781('0x18'))['db'];function respondWithStatusCode(_0xbea78b,_0x1f2f1e){_0x1f2f1e=_0x1f2f1e||0xcc;return function(_0xc7758f){if(_0xc7758f){return _0xbea78b[_0xd781('0x19')](_0x1f2f1e);}return _0xbea78b[_0xd781('0x1a')](_0x1f2f1e)[_0xd781('0x1b')]();};}function respondWithResult(_0xd454e7,_0x587953){_0x587953=_0x587953||0xc8;return function(_0x477bdc){if(_0x477bdc){return _0xd454e7[_0xd781('0x1a')](_0x587953)['json'](_0x477bdc);}};}function respondWithFilteredResult(_0x3a1f48,_0x48bffc){return function(_0x294e5a){if(_0x294e5a){var _0x22d787=typeof _0x48bffc[_0xd781('0x1c')]===_0xd781('0x1d')&&typeof _0x48bffc[_0xd781('0x1e')]===_0xd781('0x1d');var _0x501b0d=_0x294e5a['count'];var _0x1407fc=_0x22d787?0x0:_0x48bffc[_0xd781('0x1c')];var _0x395d9c=_0x22d787?_0x294e5a[_0xd781('0x1f')]:_0x48bffc[_0xd781('0x1c')]+_0x48bffc[_0xd781('0x1e')];var _0x260aa8;if(_0x395d9c>=_0x501b0d){_0x395d9c=_0x501b0d;_0x260aa8=0xc8;}else{_0x260aa8=0xce;}_0x3a1f48[_0xd781('0x1a')](_0x260aa8);return _0x3a1f48['set'](_0xd781('0x20'),_0x1407fc+'-'+_0x395d9c+'/'+_0x501b0d)[_0xd781('0x21')](_0x294e5a);}return null;};}function patchUpdates(_0x1036d3){return function(_0x103758){try{jsonpatch[_0xd781('0x22')](_0x103758,_0x1036d3,!![]);}catch(_0x274665){return BPromise[_0xd781('0x23')](_0x274665);}return _0x103758['save']();};}function saveUpdates(_0xe0c65f,_0x4e2c56){return function(_0x567fdf){if(_0x567fdf){return _0x567fdf[_0xd781('0x24')](_0xe0c65f)['then'](function(_0x175ba6){return _0x175ba6;});}return null;};}function removeEntity(_0x101480,_0x395087){return function(_0x31bf57){if(_0x31bf57){return _0x31bf57[_0xd781('0x25')]()[_0xd781('0x26')](function(){var _0x221f14=_0x31bf57[_0xd781('0x27')]({'plain':!![]});var _0x10940b='ContactItemTypes';return db['UserProfileResource'][_0xd781('0x25')]({'where':{'type':_0x10940b,'resourceId':_0x221f14['id']}})[_0xd781('0x26')](function(){return _0x31bf57;});})[_0xd781('0x26')](function(){_0x101480['status'](0xcc)[_0xd781('0x1b')]();});}};}function handleEntityNotFound(_0x5a431b,_0x47c609){return function(_0x1e29c8){if(!_0x1e29c8){_0x5a431b['sendStatus'](0x194);}return _0x1e29c8;};}function handleError(_0x3e868,_0x123a6a){_0x123a6a=_0x123a6a||0x1f4;return function(_0x5c3848){logger['error'](_0x5c3848[_0xd781('0x28')]);if(_0x5c3848['name']){delete _0x5c3848[_0xd781('0x29')];}_0x3e868['status'](_0x123a6a)[_0xd781('0x2a')](_0x5c3848);};}exports[_0xd781('0x2b')]=function(_0x556127,_0x54521e){var _0x432d14={},_0x29e81a={},_0x1c7d83={'count':0x0,'rows':[]};var _0x5a389c=_['map'](db[_0xd781('0x2c')][_0xd781('0x2d')],function(_0x36a889){return{'name':_0x36a889['fieldName'],'type':_0x36a889['type'][_0xd781('0x2e')]};});_0x29e81a[_0xd781('0x2f')]=_['map'](_0x5a389c,_0xd781('0x29'));_0x29e81a[_0xd781('0x30')]=_['keys'](_0x556127[_0xd781('0x30')]);_0x29e81a[_0xd781('0x31')]=_[_0xd781('0x32')](_0x29e81a[_0xd781('0x2f')],_0x29e81a['query']);_0x432d14[_0xd781('0x33')]=_[_0xd781('0x32')](_0x29e81a[_0xd781('0x2f')],qs[_0xd781('0x34')](_0x556127['query'][_0xd781('0x34')]));_0x432d14[_0xd781('0x33')]=_0x432d14['attributes'][_0xd781('0x35')]?_0x432d14['attributes']:_0x29e81a[_0xd781('0x2f')];if(!_0x556127[_0xd781('0x30')]['hasOwnProperty'](_0xd781('0x36'))){_0x432d14[_0xd781('0x1e')]=qs['limit'](_0x556127[_0xd781('0x30')]['limit']);_0x432d14[_0xd781('0x1c')]=qs[_0xd781('0x1c')](_0x556127['query'][_0xd781('0x1c')]);}_0x432d14[_0xd781('0x37')]=qs['sort'](_0x556127[_0xd781('0x30')][_0xd781('0x38')]);_0x432d14[_0xd781('0x39')]=qs['filters'](_[_0xd781('0x3a')](_0x556127[_0xd781('0x30')],_0x29e81a[_0xd781('0x31')]),_0x5a389c);if(_0x556127[_0xd781('0x30')][_0xd781('0x3b')]){_0x432d14[_0xd781('0x39')]=_[_0xd781('0x3c')](_0x432d14[_0xd781('0x39')],{'$or':_[_0xd781('0x3d')](_0x5a389c,function(_0x5c6026){if(_0x5c6026[_0xd781('0x3e')]!=='VIRTUAL'){var _0x2504ac={};_0x2504ac[_0x5c6026[_0xd781('0x29')]]={'$like':'%'+_0x556127['query'][_0xd781('0x3b')]+'%'};return _0x2504ac;}})});}_0x432d14=_[_0xd781('0x3c')]({},_0x432d14,_0x556127[_0xd781('0x3f')]);var _0x402c9c={'where':_0x432d14['where']};return db[_0xd781('0x2c')]['count'](_0x402c9c)[_0xd781('0x26')](function(_0xcdaacf){_0x1c7d83['count']=_0xcdaacf;if(_0x556127['query'][_0xd781('0x40')]){_0x432d14[_0xd781('0x41')]=[{'all':!![]}];}return db[_0xd781('0x2c')][_0xd781('0x42')](_0x432d14);})['then'](function(_0x46e7f6){_0x1c7d83[_0xd781('0x43')]=_0x46e7f6;return _0x1c7d83;})['then'](respondWithFilteredResult(_0x54521e,_0x432d14))['catch'](handleError(_0x54521e,null));};exports[_0xd781('0x44')]=function(_0x1d901e,_0xaa552){var _0x4e2eea={'raw':!![],'where':{'id':_0x1d901e[_0xd781('0x45')]['id']}},_0x594f85={};_0x594f85[_0xd781('0x2f')]=_[_0xd781('0x46')](db[_0xd781('0x2c')][_0xd781('0x2d')]);_0x594f85[_0xd781('0x30')]=_['keys'](_0x1d901e['query']);_0x594f85[_0xd781('0x31')]=_[_0xd781('0x32')](_0x594f85[_0xd781('0x2f')],_0x594f85[_0xd781('0x30')]);_0x4e2eea[_0xd781('0x33')]=_['intersection'](_0x594f85[_0xd781('0x2f')],qs[_0xd781('0x34')](_0x1d901e[_0xd781('0x30')]['fields']));_0x4e2eea[_0xd781('0x33')]=_0x4e2eea[_0xd781('0x33')][_0xd781('0x35')]?_0x4e2eea['attributes']:_0x594f85[_0xd781('0x2f')];if(_0x1d901e[_0xd781('0x30')]['includeAll']){_0x4e2eea['include']=[{'all':!![]}];}_0x4e2eea=_[_0xd781('0x3c')]({},_0x4e2eea,_0x1d901e[_0xd781('0x3f')]);return db[_0xd781('0x2c')]['find'](_0x4e2eea)[_0xd781('0x26')](handleEntityNotFound(_0xaa552,null))[_0xd781('0x26')](respondWithResult(_0xaa552,null))[_0xd781('0x47')](handleError(_0xaa552,null));};exports[_0xd781('0x48')]=function(_0x336d30,_0x3828ad){return db[_0xd781('0x2c')]['create'](_0x336d30[_0xd781('0x49')],{})[_0xd781('0x26')](function(_0x1d54bd){var _0x4c7cb6=_0x336d30[_0xd781('0x4a')][_0xd781('0x27')]({'plain':!![]});if(!_0x4c7cb6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4c7cb6[_0xd781('0x4b')]===_0xd781('0x4a')){var _0x41caac=_0x1d54bd[_0xd781('0x27')]({'plain':!![]});var _0x42a2f9='ContactItemTypes';return db[_0xd781('0x4c')]['find']({'where':{'name':_0x42a2f9,'userProfileId':_0x4c7cb6[_0xd781('0x4d')]},'raw':!![]})['then'](function(_0x2ce1f6){if(_0x2ce1f6&&_0x2ce1f6[_0xd781('0x4e')]===0x0){return db['UserProfileResource'][_0xd781('0x48')]({'name':_0x41caac['name'],'resourceId':_0x41caac['id'],'type':_0x2ce1f6['name'],'sectionId':_0x2ce1f6['id']},{})['then'](function(){return _0x1d54bd;});}else{return _0x1d54bd;}})[_0xd781('0x47')](function(_0x174fcd){logger['error'](_0xd781('0x4f'),_0x174fcd);throw _0x174fcd;});}return _0x1d54bd;})['then'](respondWithResult(_0x3828ad,0xc9))[_0xd781('0x47')](handleError(_0x3828ad,null));};exports[_0xd781('0x24')]=function(_0x39d47d,_0x19a6c2){if(_0x39d47d['body']['id']){delete _0x39d47d[_0xd781('0x49')]['id'];}return db['ContactItemType'][_0xd781('0x50')]({'where':{'id':_0x39d47d['params']['id']}})[_0xd781('0x26')](handleEntityNotFound(_0x19a6c2,null))[_0xd781('0x26')](saveUpdates(_0x39d47d['body'],null))[_0xd781('0x26')](respondWithResult(_0x19a6c2,null))[_0xd781('0x47')](handleError(_0x19a6c2,null));};exports[_0xd781('0x25')]=function(_0x32fd9f,_0xfc466c){return db[_0xd781('0x2c')]['find']({'where':{'id':_0x32fd9f['params']['id']}})[_0xd781('0x26')](handleEntityNotFound(_0xfc466c,null))[_0xd781('0x26')](db[_0xd781('0x51')][_0xd781('0x24')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x32fd9f['params']['id']}}))[_0xd781('0x26')](removeEntity(_0xfc466c,null))['catch'](handleError(_0xfc466c,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 884f558..b406031 100644 --- a/server/api/contactItemType/contactItemType.model.js +++ b/server/api/contactItemType/contactItemType.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8fa=['./contactItemType.attributes','exports','define','ContactItemType','tools_contact_item_types','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x4ed4d2,_0x47acf7){var _0x15ae2e=function(_0x3199f0){while(--_0x3199f0){_0x4ed4d2['push'](_0x4ed4d2['shift']());}};_0x15ae2e(++_0x47acf7);}(_0xd8fa,0x1bf));var _0xad8f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd8fa[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xad8f('0x0'));var util=require(_0xad8f('0x1'));var logger=require(_0xad8f('0x2'))(_0xad8f('0x3'));var moment=require('moment');var BPromise=require(_0xad8f('0x4'));var rp=require(_0xad8f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xad8f('0x6'));var config=require(_0xad8f('0x7'));var attributes=require(_0xad8f('0x8'));module[_0xad8f('0x9')]=function(_0x210edb,_0x1f281b){return _0x210edb[_0xad8f('0xa')](_0xad8f('0xb'),attributes,{'tableName':_0xad8f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7ea7=['./contactItemType.attributes','exports','define','lodash','util','api','bluebird','request-promise','../../config/environment'];(function(_0x22cc39,_0x64ee49){var _0xf1d6e0=function(_0x4b2755){while(--_0x4b2755){_0x22cc39['push'](_0x22cc39['shift']());}};_0xf1d6e0(++_0x64ee49);}(_0x7ea7,0x17d));var _0x77ea=function(_0x2d126e,_0x1e8257){_0x2d126e=_0x2d126e-0x0;var _0xcb04d3=_0x7ea7[_0x2d126e];return _0xcb04d3;};'use strict';var _=require(_0x77ea('0x0'));var util=require(_0x77ea('0x1'));var logger=require('../../config/logger')(_0x77ea('0x2'));var moment=require('moment');var BPromise=require(_0x77ea('0x3'));var rp=require(_0x77ea('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x77ea('0x5'));var attributes=require(_0x77ea('0x6'));module[_0x77ea('0x7')]=function(_0x244790,_0x42be45){return _0x244790[_0x77ea('0x8')]('ContactItemType',attributes,{'tableName':'tools_contact_item_types','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js index e7b91b0..695f016 100644 --- a/server/api/contactItemType/contactItemType.rpc.js +++ b/server/api/contactItemType/contactItemType.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5d31=['../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','ContactItemType,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils'];(function(_0x3b1b23,_0x21bccd){var _0x1efc85=function(_0x102a95){while(--_0x102a95){_0x3b1b23['push'](_0x3b1b23['shift']());}};_0x1efc85(++_0x21bccd);}(_0x5d31,0xb7));var _0x15d3=function(_0x31f94d,_0x97563){_0x31f94d=_0x31f94d-0x0;var _0xca77c0=_0x5d31[_0x31f94d];return _0xca77c0;};'use strict';var _=require(_0x15d3('0x0'));var util=require(_0x15d3('0x1'));var moment=require(_0x15d3('0x2'));var BPromise=require('bluebird');var rs=require(_0x15d3('0x3'));var fs=require('fs');var Redis=require(_0x15d3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x15d3('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x15d3('0x6'));var jayson=require(_0x15d3('0x7'));var client=jayson[_0x15d3('0x8')][_0x15d3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1f7128,_0x204309,_0x5ab85a){return new BPromise(function(_0x169a5e,_0x1f690b){return client[_0x15d3('0xa')](_0x1f7128,_0x5ab85a)['then'](function(_0x37d3ae){logger['info']('ContactItemType,\x20%s,\x20%s',_0x204309,_0x15d3('0xb'));logger[_0x15d3('0xc')](_0x15d3('0xd'),_0x204309,_0x15d3('0xb'),JSON[_0x15d3('0xe')](_0x37d3ae));if(_0x37d3ae[_0x15d3('0xf')]){if(_0x37d3ae[_0x15d3('0xf')]['code']===0x1f4){logger[_0x15d3('0xf')](_0x15d3('0x10'),_0x204309,_0x37d3ae[_0x15d3('0xf')][_0x15d3('0x11')]);return _0x1f690b(_0x37d3ae[_0x15d3('0xf')][_0x15d3('0x11')]);}logger['error'](_0x15d3('0x10'),_0x204309,_0x37d3ae[_0x15d3('0xf')][_0x15d3('0x11')]);return _0x169a5e(_0x37d3ae['error']['message']);}else{logger[_0x15d3('0x12')]('ContactItemType,\x20%s,\x20%s',_0x204309,_0x15d3('0xb'));_0x169a5e(_0x37d3ae[_0x15d3('0x13')][_0x15d3('0x11')]);}})[_0x15d3('0x14')](function(_0x4fe0b7){logger[_0x15d3('0xf')](_0x15d3('0x10'),_0x204309,_0x4fe0b7);_0x1f690b(_0x4fe0b7);});});} \ No newline at end of file +var _0x21f8=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','ContactItemType,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x21f8,0x71));var _0x821f=function(_0x2850c0,_0x1363a7){_0x2850c0=_0x2850c0-0x0;var _0x21e830=_0x21f8[_0x2850c0];return _0x21e830;};'use strict';var _=require(_0x821f('0x0'));var util=require(_0x821f('0x1'));var moment=require(_0x821f('0x2'));var BPromise=require(_0x821f('0x3'));var rs=require(_0x821f('0x4'));var fs=require('fs');var Redis=require(_0x821f('0x5'));var db=require(_0x821f('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x821f('0x7'));var jayson=require(_0x821f('0x8'));var client=jayson[_0x821f('0x9')][_0x821f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cd13a,_0x3a42fe,_0x1b9945){return new BPromise(function(_0xfcb0a,_0x4e260d){return client['request'](_0x3cd13a,_0x1b9945)[_0x821f('0xb')](function(_0x15b547){logger[_0x821f('0xc')]('ContactItemType,\x20%s,\x20%s',_0x3a42fe,_0x821f('0xd'));logger[_0x821f('0xe')](_0x821f('0xf'),_0x3a42fe,_0x821f('0xd'),JSON[_0x821f('0x10')](_0x15b547));if(_0x15b547[_0x821f('0x11')]){if(_0x15b547[_0x821f('0x11')][_0x821f('0x12')]===0x1f4){logger[_0x821f('0x11')](_0x821f('0x13'),_0x3a42fe,_0x15b547['error']['message']);return _0x4e260d(_0x15b547[_0x821f('0x11')][_0x821f('0x14')]);}logger[_0x821f('0x11')](_0x821f('0x13'),_0x3a42fe,_0x15b547[_0x821f('0x11')][_0x821f('0x14')]);return _0xfcb0a(_0x15b547[_0x821f('0x11')][_0x821f('0x14')]);}else{logger[_0x821f('0xc')](_0x821f('0x13'),_0x3a42fe,'request\x20sent');_0xfcb0a(_0x15b547[_0x821f('0x15')]['message']);}})[_0x821f('0x16')](function(_0x497c37){logger[_0x821f('0x11')](_0x821f('0x13'),_0x3a42fe,_0x497c37);_0x4e260d(_0x497c37);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index b19aa6a..cdd326f 100644 --- a/server/api/contactItemType/index.js +++ b/server/api/contactItemType/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3205=['/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3205,0xbc));var _0x5320=function(_0x52a203,_0x507e0f){_0x52a203=_0x52a203-0x0;var _0x38c07a=_0x3205[_0x52a203];return _0x38c07a;};'use strict';var multer=require('multer');var util=require(_0x5320('0x0'));var path=require(_0x5320('0x1'));var timeout=require(_0x5320('0x2'));var express=require(_0x5320('0x3'));var router=express[_0x5320('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5320('0x5'));var interaction=require(_0x5320('0x6'));var config=require(_0x5320('0x7'));var controller=require(_0x5320('0x8'));router[_0x5320('0x9')]('/',auth[_0x5320('0xa')](),controller[_0x5320('0xb')]);router[_0x5320('0x9')](_0x5320('0xc'),auth[_0x5320('0xa')](),controller[_0x5320('0xd')]);router[_0x5320('0xe')]('/',auth[_0x5320('0xa')](),controller[_0x5320('0xf')]);router[_0x5320('0x10')]('/:id',auth[_0x5320('0xa')](),controller[_0x5320('0x11')]);router[_0x5320('0x12')](_0x5320('0xc'),auth[_0x5320('0xa')](),controller[_0x5320('0x13')]);module['exports']=router; \ No newline at end of file +var _0xadc8=['post','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','index','get','/:id','isAuthenticated','show'];(function(_0x5c4e16,_0x113035){var _0x36044a=function(_0xde2f25){while(--_0xde2f25){_0x5c4e16['push'](_0x5c4e16['shift']());}};_0x36044a(++_0x113035);}(_0xadc8,0x7d));var _0x8adc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xadc8[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x8adc('0x0'));var util=require(_0x8adc('0x1'));var path=require(_0x8adc('0x2'));var timeout=require(_0x8adc('0x3'));var express=require('express');var router=express[_0x8adc('0x4')]();var fs_extra=require(_0x8adc('0x5'));var auth=require(_0x8adc('0x6'));var interaction=require(_0x8adc('0x7'));var config=require(_0x8adc('0x8'));var controller=require(_0x8adc('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x8adc('0xa')]);router[_0x8adc('0xb')](_0x8adc('0xc'),auth[_0x8adc('0xd')](),controller[_0x8adc('0xe')]);router[_0x8adc('0xf')]('/',auth[_0x8adc('0xd')](),controller['create']);router[_0x8adc('0x10')]('/:id',auth[_0x8adc('0xd')](),controller[_0x8adc('0x11')]);router['delete']('/:id',auth[_0x8adc('0xd')](),controller[_0x8adc('0x12')]);module[_0x8adc('0x13')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index a9c8519..bb9c202 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['STRING','sequelize'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0xb7e7,0x121));var _0x7b7e=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0xb7e7[_0x34843e];return _0x598f7f;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file +var _0xe706=['STRING','sequelize','exports'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xe706,0xa3));var _0x6e70=function(_0x20f3bc,_0x34c2fd){_0x20f3bc=_0x20f3bc-0x0;var _0x2e0502=_0xe706[_0x20f3bc];return _0x2e0502;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'name':{'type':Sequelize[_0x6e70('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x6e70('0x2')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index e918954..c8a0a24 100644 --- a/server/api/dashboard/dashboard.controller.js +++ b/server/api/dashboard/dashboard.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc949=['iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrVoiceQueues','attrReport','reportType','widgetAttributes:\x20%s','addItem','DashboardItem','findOne','getItems','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','./dashboard.socket','register','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','then','destroy','get','CustomDashboards','UserProfileResource','stack','name','index','map','Dashboard','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','filter','where','merge','VIRTUAL','include','rows','catch','show','params','keys','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','UserProfileSection','update'];(function(_0x2c7dc6,_0x3c4ce0){var _0x10002b=function(_0x26f390){while(--_0x26f390){_0x2c7dc6['push'](_0x2c7dc6['shift']());}};_0x10002b(++_0x3c4ce0);}(_0xc949,0x1a8));var _0x9c94=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xc949[_0x13ea00];return _0x1f7347;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9c94('0x0'));var zipdir=require(_0x9c94('0x1'));var jsonpatch=require(_0x9c94('0x2'));var rp=require(_0x9c94('0x3'));var moment=require(_0x9c94('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9c94('0x5'));var util=require(_0x9c94('0x6'));var path=require(_0x9c94('0x7'));var sox=require(_0x9c94('0x8'));var csv=require(_0x9c94('0x9'));var ejs=require(_0x9c94('0xa'));var fs=require('fs');var fs_extra=require(_0x9c94('0xb'));var _=require(_0x9c94('0xc'));var squel=require(_0x9c94('0xd'));var crypto=require('crypto');var jsforce=require(_0x9c94('0xe'));var deskjs=require(_0x9c94('0xf'));var toCsv=require(_0x9c94('0x9'));var querystring=require(_0x9c94('0x10'));var Papa=require(_0x9c94('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9c94('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9c94('0x13'));var logger=require('../../config/logger')(_0x9c94('0x14'));var utils=require(_0x9c94('0x15'));var config=require(_0x9c94('0x16'));var licenseUtil=require(_0x9c94('0x17'));var db=require('../../mysqldb')['db'];config[_0x9c94('0x18')]=_[_0x9c94('0x19')](config[_0x9c94('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9c94('0x1a'))[_0x9c94('0x1b')](socket);function respondWithStatusCode(_0xbd473a,_0x47bc1b){_0x47bc1b=_0x47bc1b||0xcc;return function(_0x38592a){if(_0x38592a){return _0xbd473a[_0x9c94('0x1c')](_0x47bc1b);}return _0xbd473a[_0x9c94('0x1d')](_0x47bc1b)[_0x9c94('0x1e')]();};}function respondWithResult(_0x443b1a,_0x2be43b){_0x2be43b=_0x2be43b||0xc8;return function(_0x383188){if(_0x383188){return _0x443b1a[_0x9c94('0x1d')](_0x2be43b)[_0x9c94('0x1f')](_0x383188);}};}function respondWithFilteredResult(_0x431fec,_0x244fb4){return function(_0x4cbd32){if(_0x4cbd32){var _0x2d5c4d=typeof _0x244fb4[_0x9c94('0x20')]==='undefined'&&typeof _0x244fb4['limit']===_0x9c94('0x21');var _0x415454=_0x4cbd32['count'];var _0x3e6083=_0x2d5c4d?0x0:_0x244fb4[_0x9c94('0x20')];var _0x2b80df=_0x2d5c4d?_0x4cbd32[_0x9c94('0x22')]:_0x244fb4[_0x9c94('0x20')]+_0x244fb4['limit'];var _0x275552;if(_0x2b80df>=_0x415454){_0x2b80df=_0x415454;_0x275552=0xc8;}else{_0x275552=0xce;}_0x431fec[_0x9c94('0x1d')](_0x275552);return _0x431fec['set'](_0x9c94('0x23'),_0x3e6083+'-'+_0x2b80df+'/'+_0x415454)[_0x9c94('0x1f')](_0x4cbd32);}return null;};}function patchUpdates(_0x3b0643){return function(_0x1a4c0f){try{jsonpatch[_0x9c94('0x24')](_0x1a4c0f,_0x3b0643,!![]);}catch(_0x569353){return BPromise[_0x9c94('0x25')](_0x569353);}return _0x1a4c0f[_0x9c94('0x26')]();};}function saveUpdates(_0x615165,_0x28a179){return function(_0x38e4f5){if(_0x38e4f5){return _0x38e4f5['update'](_0x615165)[_0x9c94('0x27')](function(_0x4d0bc6){return _0x4d0bc6;});}return null;};}function removeEntity(_0x47451e,_0x4aa38e){return function(_0x3dc767){if(_0x3dc767){return _0x3dc767[_0x9c94('0x28')]()[_0x9c94('0x27')](function(){var _0x4a8190=_0x3dc767[_0x9c94('0x29')]({'plain':!![]});var _0x5be8e9=_0x9c94('0x2a');return db[_0x9c94('0x2b')]['destroy']({'where':{'type':_0x5be8e9,'resourceId':_0x4a8190['id']}})['then'](function(){return _0x3dc767;});})[_0x9c94('0x27')](function(){_0x47451e[_0x9c94('0x1d')](0xcc)[_0x9c94('0x1e')]();});}};}function handleEntityNotFound(_0x4d28d5,_0x59b979){return function(_0x4421ab){if(!_0x4421ab){_0x4d28d5['sendStatus'](0x194);}return _0x4421ab;};}function handleError(_0x5804bc,_0x3f2ab4){_0x3f2ab4=_0x3f2ab4||0x1f4;return function(_0x539baa){logger['error'](_0x539baa[_0x9c94('0x2c')]);if(_0x539baa[_0x9c94('0x2d')]){delete _0x539baa['name'];}_0x5804bc['status'](_0x3f2ab4)['send'](_0x539baa);};}exports[_0x9c94('0x2e')]=function(_0x51bbc5,_0x1d6c61){var _0x2993e7={},_0x3a1c23={},_0x2e52bf={'count':0x0,'rows':[]};var _0x363c45=_[_0x9c94('0x2f')](db[_0x9c94('0x30')][_0x9c94('0x31')],function(_0x48a018){return{'name':_0x48a018[_0x9c94('0x32')],'type':_0x48a018[_0x9c94('0x33')][_0x9c94('0x34')]};});_0x3a1c23[_0x9c94('0x35')]=_[_0x9c94('0x2f')](_0x363c45,_0x9c94('0x2d'));_0x3a1c23['query']=_['keys'](_0x51bbc5[_0x9c94('0x36')]);_0x3a1c23[_0x9c94('0x37')]=_[_0x9c94('0x38')](_0x3a1c23['model'],_0x3a1c23['query']);_0x2993e7[_0x9c94('0x39')]=_[_0x9c94('0x38')](_0x3a1c23[_0x9c94('0x35')],qs[_0x9c94('0x3a')](_0x51bbc5[_0x9c94('0x36')][_0x9c94('0x3a')]));_0x2993e7[_0x9c94('0x39')]=_0x2993e7[_0x9c94('0x39')][_0x9c94('0x3b')]?_0x2993e7['attributes']:_0x3a1c23[_0x9c94('0x35')];if(!_0x51bbc5['query'][_0x9c94('0x3c')](_0x9c94('0x3d'))){_0x2993e7[_0x9c94('0x3e')]=qs[_0x9c94('0x3e')](_0x51bbc5[_0x9c94('0x36')][_0x9c94('0x3e')]);_0x2993e7[_0x9c94('0x20')]=qs[_0x9c94('0x20')](_0x51bbc5['query']['offset']);}_0x2993e7['order']=qs[_0x9c94('0x3f')](_0x51bbc5[_0x9c94('0x36')][_0x9c94('0x3f')]);_0x2993e7['where']=qs['filters'](_[_0x9c94('0x40')](_0x51bbc5[_0x9c94('0x36')],_0x3a1c23[_0x9c94('0x37')]),_0x363c45);if(_0x51bbc5[_0x9c94('0x36')][_0x9c94('0x41')]){_0x2993e7[_0x9c94('0x42')]=_[_0x9c94('0x43')](_0x2993e7[_0x9c94('0x42')],{'$or':_[_0x9c94('0x2f')](_0x363c45,function(_0x176290){if(_0x176290['type']!==_0x9c94('0x44')){var _0x167c2c={};_0x167c2c[_0x176290['name']]={'$like':'%'+_0x51bbc5['query'][_0x9c94('0x41')]+'%'};return _0x167c2c;}})});}_0x2993e7=_[_0x9c94('0x43')]({},_0x2993e7,_0x51bbc5['options']);var _0x56147a={'where':_0x2993e7['where']};return db[_0x9c94('0x30')][_0x9c94('0x22')](_0x56147a)[_0x9c94('0x27')](function(_0x18b5ea){_0x2e52bf[_0x9c94('0x22')]=_0x18b5ea;if(_0x51bbc5[_0x9c94('0x36')]['includeAll']){_0x2993e7[_0x9c94('0x45')]=[{'all':!![]}];}return db[_0x9c94('0x30')]['findAll'](_0x2993e7);})[_0x9c94('0x27')](function(_0x152e42){_0x2e52bf[_0x9c94('0x46')]=_0x152e42;return _0x2e52bf;})[_0x9c94('0x27')](respondWithFilteredResult(_0x1d6c61,_0x2993e7))[_0x9c94('0x47')](handleError(_0x1d6c61,null));};exports[_0x9c94('0x48')]=function(_0xc3240b,_0x280523){var _0x4834f5={'raw':![],'where':{'id':_0xc3240b[_0x9c94('0x49')]['id']}},_0x9e093={};_0x9e093['model']=_[_0x9c94('0x4a')](db[_0x9c94('0x30')][_0x9c94('0x31')]);_0x9e093[_0x9c94('0x36')]=_[_0x9c94('0x4a')](_0xc3240b[_0x9c94('0x36')]);_0x9e093[_0x9c94('0x37')]=_['intersection'](_0x9e093[_0x9c94('0x35')],_0x9e093[_0x9c94('0x36')]);_0x4834f5[_0x9c94('0x39')]=_['intersection'](_0x9e093['model'],qs['fields'](_0xc3240b[_0x9c94('0x36')][_0x9c94('0x3a')]));_0x4834f5[_0x9c94('0x39')]=_0x4834f5[_0x9c94('0x39')][_0x9c94('0x3b')]?_0x4834f5[_0x9c94('0x39')]:_0x9e093[_0x9c94('0x35')];if(_0xc3240b[_0x9c94('0x36')][_0x9c94('0x4b')]){_0x4834f5[_0x9c94('0x45')]=[{'all':!![]}];}_0x4834f5=_[_0x9c94('0x43')]({},_0x4834f5,_0xc3240b['options']);return db[_0x9c94('0x30')][_0x9c94('0x4c')](_0x4834f5)[_0x9c94('0x27')](handleEntityNotFound(_0x280523,null))[_0x9c94('0x27')](respondWithResult(_0x280523,null))[_0x9c94('0x47')](handleError(_0x280523,null));};exports[_0x9c94('0x4d')]=function(_0x284243,_0x5017a1){return db[_0x9c94('0x30')]['create'](_0x284243['body'],{})[_0x9c94('0x27')](function(_0x1d46ca){var _0x187bdc=_0x284243[_0x9c94('0x4e')][_0x9c94('0x29')]({'plain':!![]});if(!_0x187bdc)throw new Error(_0x9c94('0x4f'));if(_0x187bdc[_0x9c94('0x50')]===_0x9c94('0x4e')){var _0x532b82=_0x1d46ca[_0x9c94('0x29')]({'plain':!![]});var _0x11f66f=_0x9c94('0x2a');return db['UserProfileSection']['find']({'where':{'name':_0x11f66f,'userProfileId':_0x187bdc[_0x9c94('0x51')]},'raw':!![]})['then'](function(_0x467368){if(_0x467368&&_0x467368[_0x9c94('0x52')]===0x0){return db[_0x9c94('0x2b')][_0x9c94('0x4d')]({'name':_0x532b82[_0x9c94('0x2d')],'resourceId':_0x532b82['id'],'type':_0x467368['name'],'sectionId':_0x467368['id']},{})[_0x9c94('0x27')](function(){return _0x1d46ca;});}else{return _0x1d46ca;}})['catch'](function(_0x1c356f){logger[_0x9c94('0x53')](_0x9c94('0x54'),_0x1c356f);throw _0x1c356f;});}return _0x1d46ca;})[_0x9c94('0x27')](respondWithResult(_0x5017a1,0xc9))[_0x9c94('0x47')](handleError(_0x5017a1,null));};exports[_0x9c94('0x55')]=function(_0x193d3f,_0xca8683){var _0x32144e={'where':{'id':_0x193d3f[_0x9c94('0x49')]['id']}},_0xa7c1ee={};_0xa7c1ee[_0x9c94('0x35')]=_[_0x9c94('0x4a')](db['Dashboard'][_0x9c94('0x31')]);_0x32144e[_0x9c94('0x39')]=_['intersection'](_0xa7c1ee[_0x9c94('0x35')],qs['fields'](_0x193d3f[_0x9c94('0x36')][_0x9c94('0x3a')]));_0x32144e['attributes']=_0x32144e[_0x9c94('0x39')][_0x9c94('0x3b')]?_0x32144e[_0x9c94('0x39')]:_0xa7c1ee[_0x9c94('0x35')];if(_0x193d3f['query'][_0x9c94('0x4b')]){_0x32144e[_0x9c94('0x45')]=[{'all':!![]}];}_0x32144e=_[_0x9c94('0x43')]({},_0x32144e,_0x193d3f['options']);return db[_0x9c94('0x30')][_0x9c94('0x4c')](_0x32144e)['then'](handleEntityNotFound(_0xca8683,null))[_0x9c94('0x27')](function(_0x46d530){if(_0x46d530){var _0x481f8e=_0x46d530[_0x9c94('0x29')]({'plain':!![]});_0x481f8e=qs[_0x9c94('0x56')](_0x481f8e,['id',_0x9c94('0x57'),_0x9c94('0x58')]);_0x193d3f[_0x9c94('0x59')]=_[_0x9c94('0x56')](_0x193d3f['body'],['id','createdAt',_0x9c94('0x58')]);return db[_0x9c94('0x30')][_0x9c94('0x4d')](_[_0x9c94('0x43')](_0x481f8e,_0x193d3f['body']),{'include':_0x193d3f[_0x9c94('0x36')][_0x9c94('0x4b')]?[{'all':!![]}]:undefined})[_0x9c94('0x27')](function(_0x6c3bf7){var _0x310d54=_0x193d3f[_0x9c94('0x4e')][_0x9c94('0x29')]({'plain':!![]});if(!_0x310d54)throw new Error(_0x9c94('0x4f'));if(_0x310d54[_0x9c94('0x50')]===_0x9c94('0x4e')){var _0x3b8c51=_0x6c3bf7[_0x9c94('0x29')]({'plain':!![]});var _0x4c9f93=_0x9c94('0x2a');return db[_0x9c94('0x5a')][_0x9c94('0x4c')]({'where':{'name':_0x4c9f93,'userProfileId':_0x310d54[_0x9c94('0x51')]},'raw':!![]})[_0x9c94('0x27')](function(_0x15a238){if(_0x15a238&&_0x15a238[_0x9c94('0x52')]===0x0){return db[_0x9c94('0x2b')]['create']({'name':_0x3b8c51[_0x9c94('0x2d')],'resourceId':_0x3b8c51['id'],'type':_0x15a238['name'],'sectionId':_0x15a238['id']},{})[_0x9c94('0x27')](function(){return _0x6c3bf7;});}else{return _0x6c3bf7;}})[_0x9c94('0x47')](function(_0x12ba16){logger[_0x9c94('0x53')](_0x9c94('0x54'),_0x12ba16);throw _0x12ba16;});}return _0x6c3bf7;});}})[_0x9c94('0x27')](respondWithResult(_0xca8683,0xc9))[_0x9c94('0x47')](handleError(_0xca8683,null));};exports[_0x9c94('0x5b')]=function(_0x33519c,_0xfd5dcb){if(_0x33519c[_0x9c94('0x59')]['id']){delete _0x33519c[_0x9c94('0x59')]['id'];}return db[_0x9c94('0x30')][_0x9c94('0x4c')]({'where':{'id':_0x33519c[_0x9c94('0x49')]['id']}})['then'](handleEntityNotFound(_0xfd5dcb,null))['then'](saveUpdates(_0x33519c[_0x9c94('0x59')],null))[_0x9c94('0x27')](respondWithResult(_0xfd5dcb,null))['catch'](handleError(_0xfd5dcb,null));};exports[_0x9c94('0x28')]=function(_0x5e1adf,_0x416497){return db[_0x9c94('0x30')]['find']({'where':{'id':_0x5e1adf[_0x9c94('0x49')]['id']}})['then'](handleEntityNotFound(_0x416497,null))[_0x9c94('0x27')](removeEntity(_0x416497,null))[_0x9c94('0x47')](handleError(_0x416497,null));};function widgetAttributes(_0x1cda92){try{switch(_0x1cda92['type']){case _0x9c94('0x5c'):return[{'name':'attrUrl','value':_0x1cda92[_0x9c94('0x5d')]||(_0x1cda92[_0x9c94('0x5e')]&&_0x1cda92['attrs'][0x0]?_0x1cda92[_0x9c94('0x5e')][0x0][_0x9c94('0x5f')]:undefined)||_0x9c94('0x60')}];case _0x9c94('0x61'):return[{'name':_0x9c94('0x62'),'value':_0x1cda92['attrPath']||(_0x1cda92[_0x9c94('0x5e')]&&_0x1cda92[_0x9c94('0x5e')][0x0]?_0x1cda92['attrs'][0x0][_0x9c94('0x5f')]:undefined)||''}];case _0x9c94('0x63'):return[{'name':'attrHourFormat','value':_0x1cda92[_0x9c94('0x64')]||(_0x1cda92['attrs']&&_0x1cda92['attrs'][0x0]?_0x1cda92[_0x9c94('0x5e')][0x0][_0x9c94('0x5f')]:undefined)||_0x9c94('0x65')},{'name':_0x9c94('0x66'),'value':_0x1cda92['attrTimezone']||(_0x1cda92['attrs']&&_0x1cda92[_0x9c94('0x5e')][0x1]?_0x1cda92[_0x9c94('0x5e')][0x1]['value']:undefined)||_0x9c94('0x67')},{'name':_0x9c94('0x68'),'value':_0x1cda92[_0x9c94('0x68')]||(_0x1cda92[_0x9c94('0x5e')]&&_0x1cda92['attrs'][0x2]?_0x1cda92[_0x9c94('0x5e')][0x2][_0x9c94('0x5f')]:undefined)||0xc}];case _0x9c94('0x69'):return[{'name':'attrMetric','value':_0x1cda92[_0x9c94('0x6a')]||(_0x1cda92[_0x9c94('0x5e')]&&_0x1cda92[_0x9c94('0x5e')][0x0]?_0x1cda92[_0x9c94('0x5e')][0x0]['value']:undefined)||_0x9c94('0x6b')},{'name':'attrVoiceQueues','value':_0x1cda92['attrVoiceQueues']||(_0x1cda92['attrs']&&_0x1cda92['attrs'][0x1]?_0x1cda92[_0x9c94('0x5e')][0x1][_0x9c94('0x5f')]:undefined)||[]},{'name':'attrFontSize','value':_0x1cda92[_0x9c94('0x68')]||(_0x1cda92[_0x9c94('0x5e')]&&_0x1cda92['attrs'][0x2]?_0x1cda92['attrs'][0x2][_0x9c94('0x5f')]:undefined)||0x14},{'name':_0x9c94('0x6c'),'value':_0x1cda92['attrChannel']||(_0x1cda92[_0x9c94('0x5e')]&&_0x1cda92[_0x9c94('0x5e')][0x3]?_0x1cda92[_0x9c94('0x5e')][0x3]['value']:undefined)||_0x9c94('0x6d')},{'name':_0x9c94('0x6e'),'value':_0x1cda92[_0x9c94('0x6e')]||(_0x1cda92[_0x9c94('0x5e')]&&_0x1cda92[_0x9c94('0x5e')][0x4]?_0x1cda92['attrs'][0x4][_0x9c94('0x5f')]:undefined)||''},{'name':_0x9c94('0x6f'),'value':_0x1cda92[_0x9c94('0x6f')]||(_0x1cda92[_0x9c94('0x5e')]&&_0x1cda92[_0x9c94('0x5e')][0x5]?_0x1cda92['attrs'][0x5][_0x9c94('0x5f')]:undefined)||''},{'name':_0x9c94('0x70'),'value':_0x1cda92[_0x9c94('0x70')]||(_0x1cda92[_0x9c94('0x5e')]&&_0x1cda92[_0x9c94('0x5e')][0x6]?_0x1cda92[_0x9c94('0x5e')][0x6][_0x9c94('0x5f')]:undefined)||''},{'name':_0x9c94('0x71'),'value':_0x1cda92[_0x9c94('0x71')]||(_0x1cda92[_0x9c94('0x5e')]&&_0x1cda92[_0x9c94('0x5e')][0x7]?_0x1cda92['attrs'][0x7][_0x9c94('0x5f')]:undefined)||''},{'name':_0x9c94('0x72'),'value':_0x1cda92[_0x9c94('0x72')]||(_0x1cda92[_0x9c94('0x5e')]&&_0x1cda92[_0x9c94('0x5e')][0x8]?_0x1cda92[_0x9c94('0x5e')][0x8]['value']:undefined)||''},{'name':_0x9c94('0x73'),'value':_0x1cda92['attrChatWebsites']||(_0x1cda92[_0x9c94('0x5e')]&&_0x1cda92[_0x9c94('0x5e')][0x9]?_0x1cda92[_0x9c94('0x5e')][0x9][_0x9c94('0x5f')]:undefined)||''}];case _0x9c94('0x74'):case _0x9c94('0x75'):return[{'name':_0x9c94('0x76'),'value':_0x1cda92[_0x9c94('0x76')]||(_0x1cda92['attrs']&&_0x1cda92[_0x9c94('0x5e')][0x0]?_0x1cda92['attrs'][0x0][_0x9c94('0x5f')]:undefined)||_0x9c94('0x6b')},{'name':'attrSerie2','value':_0x1cda92[_0x9c94('0x77')]||(_0x1cda92[_0x9c94('0x5e')]&&_0x1cda92[_0x9c94('0x5e')][0x1]?_0x1cda92[_0x9c94('0x5e')][0x1][_0x9c94('0x5f')]:undefined)||null},{'name':_0x9c94('0x78'),'value':_0x1cda92[_0x9c94('0x78')]||(_0x1cda92['attrs']&&_0x1cda92[_0x9c94('0x5e')][0x2]?_0x1cda92['attrs'][0x2]['value']:undefined)||null},{'name':_0x9c94('0x79'),'value':_0x1cda92[_0x9c94('0x79')]||(_0x1cda92['attrs']&&_0x1cda92['attrs'][0x3]?_0x1cda92[_0x9c94('0x5e')][0x3]['value']:undefined)||[]},{'name':'attrChannel','value':_0x1cda92['attrChannel']||(_0x1cda92[_0x9c94('0x5e')]&&_0x1cda92['attrs'][0x4]?_0x1cda92['attrs'][0x4][_0x9c94('0x5f')]:undefined)||_0x9c94('0x6d')},{'name':_0x9c94('0x6e'),'value':_0x1cda92[_0x9c94('0x6e')]||(_0x1cda92[_0x9c94('0x5e')]&&_0x1cda92[_0x9c94('0x5e')][0x5]?_0x1cda92[_0x9c94('0x5e')][0x5][_0x9c94('0x5f')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x1cda92[_0x9c94('0x6f')]||(_0x1cda92['attrs']&&_0x1cda92['attrs'][0x6]?_0x1cda92[_0x9c94('0x5e')][0x6]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x1cda92[_0x9c94('0x70')]||(_0x1cda92[_0x9c94('0x5e')]&&_0x1cda92[_0x9c94('0x5e')][0x7]?_0x1cda92['attrs'][0x7][_0x9c94('0x5f')]:undefined)||''},{'name':_0x9c94('0x71'),'value':_0x1cda92['attrOpenchannelAccounts']||(_0x1cda92[_0x9c94('0x5e')]&&_0x1cda92['attrs'][0x8]?_0x1cda92[_0x9c94('0x5e')][0x8][_0x9c94('0x5f')]:undefined)||''},{'name':_0x9c94('0x72'),'value':_0x1cda92[_0x9c94('0x72')]||(_0x1cda92[_0x9c94('0x5e')]&&_0x1cda92['attrs'][0x9]?_0x1cda92['attrs'][0x9][_0x9c94('0x5f')]:undefined)||''},{'name':_0x9c94('0x73'),'value':_0x1cda92[_0x9c94('0x73')]||(_0x1cda92[_0x9c94('0x5e')]&&_0x1cda92[_0x9c94('0x5e')][0xa]?_0x1cda92['attrs'][0xa][_0x9c94('0x5f')]:undefined)||''}];case'web-report':return[{'name':_0x9c94('0x7a'),'type':_0x1cda92[_0x9c94('0x7b')]||(_0x1cda92[_0x9c94('0x5e')]&&_0x1cda92[_0x9c94('0x5e')][0x0]?_0x1cda92['attrs'][0x0][_0x9c94('0x33')]:undefined)||null,'value':_0x1cda92[_0x9c94('0x7a')]||(_0x1cda92[_0x9c94('0x5e')]&&_0x1cda92['attrs'][0x0]?_0x1cda92[_0x9c94('0x5e')][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x1cda92['attrRefresh']||(_0x1cda92[_0x9c94('0x5e')]&&_0x1cda92[_0x9c94('0x5e')][0x1]?_0x1cda92[_0x9c94('0x5e')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x2707b0){logger['error'](_0x9c94('0x7c'),JSON['stringify'](_0x2707b0));return[];}}exports[_0x9c94('0x7d')]=function(_0x3cdaa4,_0x328b71,_0x24ed6f){if(_0x3cdaa4[_0x9c94('0x59')]['id']){delete _0x3cdaa4[_0x9c94('0x59')]['id'];}return db[_0x9c94('0x30')]['find']({'where':{'id':_0x3cdaa4[_0x9c94('0x49')]['id']}})[_0x9c94('0x27')](handleEntityNotFound(_0x328b71,null))['then'](function(_0x31c9d8){if(_0x31c9d8){_0x3cdaa4[_0x9c94('0x59')]['DashboardId']=_0x31c9d8['id'];_0x3cdaa4[_0x9c94('0x59')][_0x9c94('0x5e')]=widgetAttributes(_0x3cdaa4[_0x9c94('0x59')]);return db[_0x9c94('0x7e')][_0x9c94('0x4d')](_0x3cdaa4[_0x9c94('0x59')]);}})[_0x9c94('0x27')](respondWithResult(_0x328b71,null))[_0x9c94('0x47')](handleError(_0x328b71,null));};exports['getItems']=function(_0xd4a1d4,_0x41bf7d,_0x40c89c){var _0x3ed53e={};var _0x19825b={};var _0x3eb522;var _0xd38391;return db[_0x9c94('0x30')][_0x9c94('0x7f')]({'where':{'id':_0xd4a1d4[_0x9c94('0x49')]['id']}})['then'](handleEntityNotFound(_0x41bf7d,null))[_0x9c94('0x27')](function(_0x379914){if(_0x379914){_0x3eb522=_0x379914;_0x19825b[_0x9c94('0x35')]=_[_0x9c94('0x4a')](db[_0x9c94('0x7e')][_0x9c94('0x31')]);_0x19825b[_0x9c94('0x36')]=_[_0x9c94('0x4a')](_0xd4a1d4[_0x9c94('0x36')]);_0x19825b[_0x9c94('0x37')]=_[_0x9c94('0x38')](_0x19825b[_0x9c94('0x35')],_0x19825b[_0x9c94('0x36')]);_0x3ed53e[_0x9c94('0x39')]=_[_0x9c94('0x38')](_0x19825b['model'],qs['fields'](_0xd4a1d4['query']['fields']));_0x3ed53e[_0x9c94('0x39')]=_0x3ed53e[_0x9c94('0x39')]['length']?_0x3ed53e['attributes']:_0x19825b[_0x9c94('0x35')];_0x3ed53e['order']=qs[_0x9c94('0x3f')](_0xd4a1d4[_0x9c94('0x36')][_0x9c94('0x3f')]);_0x3ed53e['where']=qs[_0x9c94('0x37')](_[_0x9c94('0x40')](_0xd4a1d4[_0x9c94('0x36')],_0x19825b[_0x9c94('0x37')]));if(_0xd4a1d4['query']['filter']){_0x3ed53e[_0x9c94('0x42')]=_['merge'](_0x3ed53e['where'],{'$or':_[_0x9c94('0x2f')](_0x3ed53e[_0x9c94('0x39')],function(_0x55a8e1){var _0x1e2b01={};_0x1e2b01[_0x55a8e1]={'$like':'%'+_0xd4a1d4['query']['filter']+'%'};return _0x1e2b01;})});}_0x3ed53e=_[_0x9c94('0x43')]({},_0x3ed53e,_0xd4a1d4['options']);return _0x3eb522['getItems'](_0x3ed53e);}})[_0x9c94('0x27')](function(_0x67c9c6){if(_0x67c9c6){_0xd38391=_0x67c9c6[_0x9c94('0x3b')];if(!_0xd4a1d4['query'][_0x9c94('0x3c')](_0x9c94('0x3d'))){_0x3ed53e['limit']=qs[_0x9c94('0x3e')](_0xd4a1d4[_0x9c94('0x36')][_0x9c94('0x3e')]);_0x3ed53e[_0x9c94('0x20')]=qs['offset'](_0xd4a1d4['query'][_0x9c94('0x20')]);}return _0x3eb522[_0x9c94('0x80')](_0x3ed53e);}})[_0x9c94('0x27')](function(_0x101472){if(_0x101472){return _0x101472?{'count':_0xd38391,'rows':_0x101472}:null;}})[_0x9c94('0x27')](respondWithResult(_0x41bf7d,null))['catch'](handleError(_0x41bf7d,null));}; \ No newline at end of file +var _0x55a4=['intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','keys','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CustomDashboards','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','body','omit','destroy','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie2','attrSerie3','voice','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','DashboardId','DashboardItem','getItems','findOne','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','UserProfileResource','error','stack','name','send','index','map','Dashboard','rawAttributes','fieldName','key','model','query','filters'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0x55a4,0x1e4));var _0x455a=function(_0x395722,_0x4fe8c9){_0x395722=_0x395722-0x0;var _0x2ed470=_0x55a4[_0x395722];return _0x2ed470;};'use strict';var emlformat=require(_0x455a('0x0'));var rimraf=require(_0x455a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x455a('0x2'));var rp=require(_0x455a('0x3'));var moment=require('moment');var BPromise=require(_0x455a('0x4'));var Mustache=require(_0x455a('0x5'));var util=require(_0x455a('0x6'));var path=require(_0x455a('0x7'));var sox=require('sox');var csv=require(_0x455a('0x8'));var ejs=require(_0x455a('0x9'));var fs=require('fs');var fs_extra=require(_0x455a('0xa'));var _=require(_0x455a('0xb'));var squel=require(_0x455a('0xc'));var crypto=require(_0x455a('0xd'));var jsforce=require(_0x455a('0xe'));var deskjs=require(_0x455a('0xf'));var toCsv=require(_0x455a('0x8'));var querystring=require('querystring');var Papa=require(_0x455a('0x10'));var Redis=require(_0x455a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x455a('0x12'));var as=require(_0x455a('0x13'));var hardwareService=require(_0x455a('0x14'));var logger=require(_0x455a('0x15'))('api');var utils=require(_0x455a('0x16'));var config=require(_0x455a('0x17'));var licenseUtil=require(_0x455a('0x18'));var db=require(_0x455a('0x19'))['db'];config[_0x455a('0x1a')]=_[_0x455a('0x1b')](config[_0x455a('0x1a')],{'host':_0x455a('0x1c'),'port':0x18eb});var socket=require(_0x455a('0x1d'))(new Redis(config['redis']));require(_0x455a('0x1e'))[_0x455a('0x1f')](socket);function respondWithStatusCode(_0x53f956,_0x5d2fbd){_0x5d2fbd=_0x5d2fbd||0xcc;return function(_0xa0bd49){if(_0xa0bd49){return _0x53f956[_0x455a('0x20')](_0x5d2fbd);}return _0x53f956[_0x455a('0x21')](_0x5d2fbd)[_0x455a('0x22')]();};}function respondWithResult(_0x457150,_0x140573){_0x140573=_0x140573||0xc8;return function(_0x5e9098){if(_0x5e9098){return _0x457150[_0x455a('0x21')](_0x140573)[_0x455a('0x23')](_0x5e9098);}};}function respondWithFilteredResult(_0xdf7a80,_0x31fc38){return function(_0x565927){if(_0x565927){var _0x486a77=typeof _0x31fc38[_0x455a('0x24')]==='undefined'&&typeof _0x31fc38[_0x455a('0x25')]===_0x455a('0x26');var _0x3ebe78=_0x565927[_0x455a('0x27')];var _0x2fe39f=_0x486a77?0x0:_0x31fc38[_0x455a('0x24')];var _0x20cb2c=_0x486a77?_0x565927['count']:_0x31fc38[_0x455a('0x24')]+_0x31fc38[_0x455a('0x25')];var _0x3653f6;if(_0x20cb2c>=_0x3ebe78){_0x20cb2c=_0x3ebe78;_0x3653f6=0xc8;}else{_0x3653f6=0xce;}_0xdf7a80[_0x455a('0x21')](_0x3653f6);return _0xdf7a80[_0x455a('0x28')](_0x455a('0x29'),_0x2fe39f+'-'+_0x20cb2c+'/'+_0x3ebe78)[_0x455a('0x23')](_0x565927);}return null;};}function patchUpdates(_0x445714){return function(_0xf44dc1){try{jsonpatch[_0x455a('0x2a')](_0xf44dc1,_0x445714,!![]);}catch(_0x33392c){return BPromise[_0x455a('0x2b')](_0x33392c);}return _0xf44dc1['save']();};}function saveUpdates(_0x417fdc,_0x4a1652){return function(_0x5d12f1){if(_0x5d12f1){return _0x5d12f1[_0x455a('0x2c')](_0x417fdc)[_0x455a('0x2d')](function(_0x286e19){return _0x286e19;});}return null;};}function removeEntity(_0x2aed16,_0x5c8fb1){return function(_0x496f81){if(_0x496f81){return _0x496f81['destroy']()[_0x455a('0x2d')](function(){var _0x2a9cd6=_0x496f81['get']({'plain':!![]});var _0x48b237='CustomDashboards';return db[_0x455a('0x2e')]['destroy']({'where':{'type':_0x48b237,'resourceId':_0x2a9cd6['id']}})[_0x455a('0x2d')](function(){return _0x496f81;});})[_0x455a('0x2d')](function(){_0x2aed16[_0x455a('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5853c9,_0x5f1468){return function(_0x51b182){if(!_0x51b182){_0x5853c9[_0x455a('0x20')](0x194);}return _0x51b182;};}function handleError(_0x20b3b0,_0x164dc4){_0x164dc4=_0x164dc4||0x1f4;return function(_0x2baaa3){logger[_0x455a('0x2f')](_0x2baaa3[_0x455a('0x30')]);if(_0x2baaa3[_0x455a('0x31')]){delete _0x2baaa3['name'];}_0x20b3b0['status'](_0x164dc4)[_0x455a('0x32')](_0x2baaa3);};}exports[_0x455a('0x33')]=function(_0x2c3129,_0x12d303){var _0x53f736={},_0x18218f={},_0x5ed6a5={'count':0x0,'rows':[]};var _0x301de9=_[_0x455a('0x34')](db[_0x455a('0x35')][_0x455a('0x36')],function(_0x96f104){return{'name':_0x96f104[_0x455a('0x37')],'type':_0x96f104['type'][_0x455a('0x38')]};});_0x18218f[_0x455a('0x39')]=_[_0x455a('0x34')](_0x301de9,_0x455a('0x31'));_0x18218f['query']=_['keys'](_0x2c3129[_0x455a('0x3a')]);_0x18218f[_0x455a('0x3b')]=_['intersection'](_0x18218f[_0x455a('0x39')],_0x18218f[_0x455a('0x3a')]);_0x53f736['attributes']=_[_0x455a('0x3c')](_0x18218f['model'],qs[_0x455a('0x3d')](_0x2c3129[_0x455a('0x3a')][_0x455a('0x3d')]));_0x53f736[_0x455a('0x3e')]=_0x53f736[_0x455a('0x3e')][_0x455a('0x3f')]?_0x53f736[_0x455a('0x3e')]:_0x18218f[_0x455a('0x39')];if(!_0x2c3129[_0x455a('0x3a')]['hasOwnProperty'](_0x455a('0x40'))){_0x53f736[_0x455a('0x25')]=qs[_0x455a('0x25')](_0x2c3129[_0x455a('0x3a')][_0x455a('0x25')]);_0x53f736[_0x455a('0x24')]=qs['offset'](_0x2c3129['query'][_0x455a('0x24')]);}_0x53f736[_0x455a('0x41')]=qs[_0x455a('0x42')](_0x2c3129[_0x455a('0x3a')][_0x455a('0x42')]);_0x53f736[_0x455a('0x43')]=qs[_0x455a('0x3b')](_[_0x455a('0x44')](_0x2c3129[_0x455a('0x3a')],_0x18218f[_0x455a('0x3b')]),_0x301de9);if(_0x2c3129[_0x455a('0x3a')]['filter']){_0x53f736[_0x455a('0x43')]=_[_0x455a('0x45')](_0x53f736[_0x455a('0x43')],{'$or':_[_0x455a('0x34')](_0x301de9,function(_0x3eeefe){if(_0x3eeefe[_0x455a('0x46')]!==_0x455a('0x47')){var _0x4b33d1={};_0x4b33d1[_0x3eeefe[_0x455a('0x31')]]={'$like':'%'+_0x2c3129[_0x455a('0x3a')][_0x455a('0x48')]+'%'};return _0x4b33d1;}})});}_0x53f736=_[_0x455a('0x45')]({},_0x53f736,_0x2c3129[_0x455a('0x49')]);var _0x357093={'where':_0x53f736['where']};return db['Dashboard']['count'](_0x357093)[_0x455a('0x2d')](function(_0x426d51){_0x5ed6a5[_0x455a('0x27')]=_0x426d51;if(_0x2c3129[_0x455a('0x3a')][_0x455a('0x4a')]){_0x53f736[_0x455a('0x4b')]=[{'all':!![]}];}return db['Dashboard'][_0x455a('0x4c')](_0x53f736);})[_0x455a('0x2d')](function(_0x590927){_0x5ed6a5[_0x455a('0x4d')]=_0x590927;return _0x5ed6a5;})['then'](respondWithFilteredResult(_0x12d303,_0x53f736))['catch'](handleError(_0x12d303,null));};exports[_0x455a('0x4e')]=function(_0x14d459,_0x5d9ed6){var _0x3235ae={'raw':![],'where':{'id':_0x14d459[_0x455a('0x4f')]['id']}},_0x1c23fd={};_0x1c23fd[_0x455a('0x39')]=_[_0x455a('0x50')](db[_0x455a('0x35')]['rawAttributes']);_0x1c23fd[_0x455a('0x3a')]=_[_0x455a('0x50')](_0x14d459[_0x455a('0x3a')]);_0x1c23fd[_0x455a('0x3b')]=_[_0x455a('0x3c')](_0x1c23fd['model'],_0x1c23fd[_0x455a('0x3a')]);_0x3235ae['attributes']=_[_0x455a('0x3c')](_0x1c23fd[_0x455a('0x39')],qs[_0x455a('0x3d')](_0x14d459[_0x455a('0x3a')][_0x455a('0x3d')]));_0x3235ae[_0x455a('0x3e')]=_0x3235ae[_0x455a('0x3e')]['length']?_0x3235ae['attributes']:_0x1c23fd[_0x455a('0x39')];if(_0x14d459['query'][_0x455a('0x4a')]){_0x3235ae[_0x455a('0x4b')]=[{'all':!![]}];}_0x3235ae=_['merge']({},_0x3235ae,_0x14d459[_0x455a('0x49')]);return db['Dashboard']['find'](_0x3235ae)[_0x455a('0x2d')](handleEntityNotFound(_0x5d9ed6,null))['then'](respondWithResult(_0x5d9ed6,null))[_0x455a('0x51')](handleError(_0x5d9ed6,null));};exports['create']=function(_0x15d21d,_0x378cd3){return db[_0x455a('0x35')][_0x455a('0x52')](_0x15d21d['body'],{})[_0x455a('0x2d')](function(_0x4d3cca){var _0x1bc722=_0x15d21d[_0x455a('0x53')][_0x455a('0x54')]({'plain':!![]});if(!_0x1bc722)throw new Error(_0x455a('0x55'));if(_0x1bc722[_0x455a('0x56')]==='user'){var _0x2c4fa7=_0x4d3cca[_0x455a('0x54')]({'plain':!![]});var _0x1cf44b=_0x455a('0x57');return db[_0x455a('0x58')][_0x455a('0x59')]({'where':{'name':_0x1cf44b,'userProfileId':_0x1bc722[_0x455a('0x5a')]},'raw':!![]})[_0x455a('0x2d')](function(_0x15129a){if(_0x15129a&&_0x15129a[_0x455a('0x5b')]===0x0){return db[_0x455a('0x2e')]['create']({'name':_0x2c4fa7['name'],'resourceId':_0x2c4fa7['id'],'type':_0x15129a[_0x455a('0x31')],'sectionId':_0x15129a['id']},{})[_0x455a('0x2d')](function(){return _0x4d3cca;});}else{return _0x4d3cca;}})[_0x455a('0x51')](function(_0x154799){logger[_0x455a('0x2f')](_0x455a('0x5c'),_0x154799);throw _0x154799;});}return _0x4d3cca;})[_0x455a('0x2d')](respondWithResult(_0x378cd3,0xc9))['catch'](handleError(_0x378cd3,null));};exports[_0x455a('0x5d')]=function(_0x14836c,_0x5edb3f){var _0x43f3ee={'where':{'id':_0x14836c['params']['id']}},_0x2ef886={};_0x2ef886[_0x455a('0x39')]=_[_0x455a('0x50')](db[_0x455a('0x35')]['rawAttributes']);_0x43f3ee[_0x455a('0x3e')]=_['intersection'](_0x2ef886['model'],qs[_0x455a('0x3d')](_0x14836c[_0x455a('0x3a')][_0x455a('0x3d')]));_0x43f3ee['attributes']=_0x43f3ee['attributes'][_0x455a('0x3f')]?_0x43f3ee['attributes']:_0x2ef886[_0x455a('0x39')];if(_0x14836c[_0x455a('0x3a')][_0x455a('0x4a')]){_0x43f3ee['include']=[{'all':!![]}];}_0x43f3ee=_['merge']({},_0x43f3ee,_0x14836c[_0x455a('0x49')]);return db[_0x455a('0x35')][_0x455a('0x59')](_0x43f3ee)[_0x455a('0x2d')](handleEntityNotFound(_0x5edb3f,null))['then'](function(_0xad5f34){if(_0xad5f34){var _0x87b0ba=_0xad5f34[_0x455a('0x54')]({'plain':!![]});_0x87b0ba=qs['omit'](_0x87b0ba,['id',_0x455a('0x5e'),_0x455a('0x5f')]);_0x14836c[_0x455a('0x60')]=_[_0x455a('0x61')](_0x14836c['body'],['id',_0x455a('0x5e'),_0x455a('0x5f')]);return db[_0x455a('0x35')][_0x455a('0x52')](_[_0x455a('0x45')](_0x87b0ba,_0x14836c[_0x455a('0x60')]),{'include':_0x14836c[_0x455a('0x3a')][_0x455a('0x4a')]?[{'all':!![]}]:undefined})[_0x455a('0x2d')](function(_0x4969e6){var _0x53c3fd=_0x14836c[_0x455a('0x53')]['get']({'plain':!![]});if(!_0x53c3fd)throw new Error(_0x455a('0x55'));if(_0x53c3fd[_0x455a('0x56')]===_0x455a('0x53')){var _0x28ac2a=_0x4969e6[_0x455a('0x54')]({'plain':!![]});var _0xd31e40='CustomDashboards';return db[_0x455a('0x58')]['find']({'where':{'name':_0xd31e40,'userProfileId':_0x53c3fd[_0x455a('0x5a')]},'raw':!![]})[_0x455a('0x2d')](function(_0x5dc32f){if(_0x5dc32f&&_0x5dc32f[_0x455a('0x5b')]===0x0){return db['UserProfileResource']['create']({'name':_0x28ac2a[_0x455a('0x31')],'resourceId':_0x28ac2a['id'],'type':_0x5dc32f[_0x455a('0x31')],'sectionId':_0x5dc32f['id']},{})['then'](function(){return _0x4969e6;});}else{return _0x4969e6;}})[_0x455a('0x51')](function(_0x125ed3){logger[_0x455a('0x2f')](_0x455a('0x5c'),_0x125ed3);throw _0x125ed3;});}return _0x4969e6;});}})[_0x455a('0x2d')](respondWithResult(_0x5edb3f,0xc9))[_0x455a('0x51')](handleError(_0x5edb3f,null));};exports[_0x455a('0x2c')]=function(_0x1292a5,_0x5a33d4){if(_0x1292a5[_0x455a('0x60')]['id']){delete _0x1292a5[_0x455a('0x60')]['id'];}return db[_0x455a('0x35')][_0x455a('0x59')]({'where':{'id':_0x1292a5[_0x455a('0x4f')]['id']}})[_0x455a('0x2d')](handleEntityNotFound(_0x5a33d4,null))[_0x455a('0x2d')](saveUpdates(_0x1292a5[_0x455a('0x60')],null))[_0x455a('0x2d')](respondWithResult(_0x5a33d4,null))[_0x455a('0x51')](handleError(_0x5a33d4,null));};exports[_0x455a('0x62')]=function(_0x4ec653,_0xae0640){return db[_0x455a('0x35')]['find']({'where':{'id':_0x4ec653['params']['id']}})[_0x455a('0x2d')](handleEntityNotFound(_0xae0640,null))[_0x455a('0x2d')](removeEntity(_0xae0640,null))[_0x455a('0x51')](handleError(_0xae0640,null));};function widgetAttributes(_0x48fe9b){try{switch(_0x48fe9b[_0x455a('0x46')]){case _0x455a('0x63'):return[{'name':_0x455a('0x64'),'value':_0x48fe9b[_0x455a('0x64')]||(_0x48fe9b[_0x455a('0x65')]&&_0x48fe9b['attrs'][0x0]?_0x48fe9b['attrs'][0x0][_0x455a('0x66')]:undefined)||_0x455a('0x67')}];case _0x455a('0x68'):return[{'name':_0x455a('0x69'),'value':_0x48fe9b[_0x455a('0x69')]||(_0x48fe9b[_0x455a('0x65')]&&_0x48fe9b[_0x455a('0x65')][0x0]?_0x48fe9b['attrs'][0x0][_0x455a('0x66')]:undefined)||''}];case _0x455a('0x6a'):return[{'name':'attrHourFormat','value':_0x48fe9b['attrHourFormat']||(_0x48fe9b[_0x455a('0x65')]&&_0x48fe9b[_0x455a('0x65')][0x0]?_0x48fe9b[_0x455a('0x65')][0x0][_0x455a('0x66')]:undefined)||_0x455a('0x6b')},{'name':_0x455a('0x6c'),'value':_0x48fe9b['attrTimezone']||(_0x48fe9b['attrs']&&_0x48fe9b[_0x455a('0x65')][0x1]?_0x48fe9b[_0x455a('0x65')][0x1][_0x455a('0x66')]:undefined)||'0.00'},{'name':'attrFontSize','value':_0x48fe9b[_0x455a('0x6d')]||(_0x48fe9b[_0x455a('0x65')]&&_0x48fe9b[_0x455a('0x65')][0x2]?_0x48fe9b[_0x455a('0x65')][0x2][_0x455a('0x66')]:undefined)||0xc}];case _0x455a('0x6e'):return[{'name':_0x455a('0x6f'),'value':_0x48fe9b['attrMetric']||(_0x48fe9b[_0x455a('0x65')]&&_0x48fe9b[_0x455a('0x65')][0x0]?_0x48fe9b[_0x455a('0x65')][0x0][_0x455a('0x66')]:undefined)||_0x455a('0x70')},{'name':_0x455a('0x71'),'value':_0x48fe9b[_0x455a('0x71')]||(_0x48fe9b[_0x455a('0x65')]&&_0x48fe9b[_0x455a('0x65')][0x1]?_0x48fe9b[_0x455a('0x65')][0x1][_0x455a('0x66')]:undefined)||[]},{'name':_0x455a('0x6d'),'value':_0x48fe9b[_0x455a('0x6d')]||(_0x48fe9b[_0x455a('0x65')]&&_0x48fe9b[_0x455a('0x65')][0x2]?_0x48fe9b[_0x455a('0x65')][0x2][_0x455a('0x66')]:undefined)||0x14},{'name':_0x455a('0x72'),'value':_0x48fe9b[_0x455a('0x72')]||(_0x48fe9b['attrs']&&_0x48fe9b[_0x455a('0x65')][0x3]?_0x48fe9b[_0x455a('0x65')][0x3]['value']:undefined)||'voice'},{'name':_0x455a('0x73'),'value':_0x48fe9b[_0x455a('0x73')]||(_0x48fe9b['attrs']&&_0x48fe9b[_0x455a('0x65')][0x4]?_0x48fe9b[_0x455a('0x65')][0x4][_0x455a('0x66')]:undefined)||''},{'name':_0x455a('0x74'),'value':_0x48fe9b[_0x455a('0x74')]||(_0x48fe9b[_0x455a('0x65')]&&_0x48fe9b[_0x455a('0x65')][0x5]?_0x48fe9b[_0x455a('0x65')][0x5][_0x455a('0x66')]:undefined)||''},{'name':_0x455a('0x75'),'value':_0x48fe9b[_0x455a('0x75')]||(_0x48fe9b[_0x455a('0x65')]&&_0x48fe9b[_0x455a('0x65')][0x6]?_0x48fe9b[_0x455a('0x65')][0x6][_0x455a('0x66')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x48fe9b[_0x455a('0x76')]||(_0x48fe9b[_0x455a('0x65')]&&_0x48fe9b[_0x455a('0x65')][0x7]?_0x48fe9b['attrs'][0x7][_0x455a('0x66')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x48fe9b[_0x455a('0x77')]||(_0x48fe9b[_0x455a('0x65')]&&_0x48fe9b[_0x455a('0x65')][0x8]?_0x48fe9b['attrs'][0x8]['value']:undefined)||''},{'name':_0x455a('0x78'),'value':_0x48fe9b[_0x455a('0x78')]||(_0x48fe9b[_0x455a('0x65')]&&_0x48fe9b[_0x455a('0x65')][0x9]?_0x48fe9b[_0x455a('0x65')][0x9][_0x455a('0x66')]:undefined)||''}];case'multibar-chart':case _0x455a('0x79'):return[{'name':'attrSerie1','value':_0x48fe9b[_0x455a('0x7a')]||(_0x48fe9b[_0x455a('0x65')]&&_0x48fe9b[_0x455a('0x65')][0x0]?_0x48fe9b[_0x455a('0x65')][0x0]['value']:undefined)||_0x455a('0x70')},{'name':_0x455a('0x7b'),'value':_0x48fe9b[_0x455a('0x7b')]||(_0x48fe9b[_0x455a('0x65')]&&_0x48fe9b['attrs'][0x1]?_0x48fe9b['attrs'][0x1][_0x455a('0x66')]:undefined)||null},{'name':'attrSerie3','value':_0x48fe9b[_0x455a('0x7c')]||(_0x48fe9b[_0x455a('0x65')]&&_0x48fe9b[_0x455a('0x65')][0x2]?_0x48fe9b[_0x455a('0x65')][0x2]['value']:undefined)||null},{'name':_0x455a('0x71'),'value':_0x48fe9b[_0x455a('0x71')]||(_0x48fe9b['attrs']&&_0x48fe9b[_0x455a('0x65')][0x3]?_0x48fe9b[_0x455a('0x65')][0x3][_0x455a('0x66')]:undefined)||[]},{'name':_0x455a('0x72'),'value':_0x48fe9b['attrChannel']||(_0x48fe9b[_0x455a('0x65')]&&_0x48fe9b[_0x455a('0x65')][0x4]?_0x48fe9b[_0x455a('0x65')][0x4][_0x455a('0x66')]:undefined)||_0x455a('0x7d')},{'name':_0x455a('0x73'),'value':_0x48fe9b['attrEmailAccounts']||(_0x48fe9b[_0x455a('0x65')]&&_0x48fe9b['attrs'][0x5]?_0x48fe9b[_0x455a('0x65')][0x5][_0x455a('0x66')]:undefined)||''},{'name':_0x455a('0x74'),'value':_0x48fe9b['attrFaxAccounts']||(_0x48fe9b['attrs']&&_0x48fe9b[_0x455a('0x65')][0x6]?_0x48fe9b['attrs'][0x6][_0x455a('0x66')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x48fe9b[_0x455a('0x75')]||(_0x48fe9b[_0x455a('0x65')]&&_0x48fe9b[_0x455a('0x65')][0x7]?_0x48fe9b[_0x455a('0x65')][0x7][_0x455a('0x66')]:undefined)||''},{'name':_0x455a('0x76'),'value':_0x48fe9b[_0x455a('0x76')]||(_0x48fe9b[_0x455a('0x65')]&&_0x48fe9b[_0x455a('0x65')][0x8]?_0x48fe9b[_0x455a('0x65')][0x8][_0x455a('0x66')]:undefined)||''},{'name':_0x455a('0x77'),'value':_0x48fe9b['attrWhatsappAccounts']||(_0x48fe9b[_0x455a('0x65')]&&_0x48fe9b[_0x455a('0x65')][0x9]?_0x48fe9b[_0x455a('0x65')][0x9][_0x455a('0x66')]:undefined)||''},{'name':_0x455a('0x78'),'value':_0x48fe9b[_0x455a('0x78')]||(_0x48fe9b[_0x455a('0x65')]&&_0x48fe9b[_0x455a('0x65')][0xa]?_0x48fe9b['attrs'][0xa][_0x455a('0x66')]:undefined)||''}];case _0x455a('0x7e'):return[{'name':_0x455a('0x7f'),'type':_0x48fe9b[_0x455a('0x80')]||(_0x48fe9b[_0x455a('0x65')]&&_0x48fe9b['attrs'][0x0]?_0x48fe9b[_0x455a('0x65')][0x0][_0x455a('0x46')]:undefined)||null,'value':_0x48fe9b['attrReport']||(_0x48fe9b['attrs']&&_0x48fe9b[_0x455a('0x65')][0x0]?_0x48fe9b['attrs'][0x0][_0x455a('0x66')]:undefined)||null},{'name':_0x455a('0x81'),'value':_0x48fe9b[_0x455a('0x81')]||(_0x48fe9b[_0x455a('0x65')]&&_0x48fe9b[_0x455a('0x65')][0x1]?_0x48fe9b[_0x455a('0x65')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x217299){logger['error'](_0x455a('0x82'),JSON[_0x455a('0x83')](_0x217299));return[];}}exports['addItem']=function(_0x4372bb,_0x41aa99,_0x326298){if(_0x4372bb[_0x455a('0x60')]['id']){delete _0x4372bb[_0x455a('0x60')]['id'];}return db[_0x455a('0x35')][_0x455a('0x59')]({'where':{'id':_0x4372bb['params']['id']}})[_0x455a('0x2d')](handleEntityNotFound(_0x41aa99,null))[_0x455a('0x2d')](function(_0x5d39d7){if(_0x5d39d7){_0x4372bb[_0x455a('0x60')][_0x455a('0x84')]=_0x5d39d7['id'];_0x4372bb[_0x455a('0x60')]['attrs']=widgetAttributes(_0x4372bb[_0x455a('0x60')]);return db[_0x455a('0x85')][_0x455a('0x52')](_0x4372bb[_0x455a('0x60')]);}})[_0x455a('0x2d')](respondWithResult(_0x41aa99,null))[_0x455a('0x51')](handleError(_0x41aa99,null));};exports[_0x455a('0x86')]=function(_0x292f10,_0x52d5da,_0x1789a5){var _0xc8afb9={};var _0x1c12a0={};var _0x2f3e0b;var _0x525265;return db[_0x455a('0x35')][_0x455a('0x87')]({'where':{'id':_0x292f10[_0x455a('0x4f')]['id']}})[_0x455a('0x2d')](handleEntityNotFound(_0x52d5da,null))['then'](function(_0x1208e0){if(_0x1208e0){_0x2f3e0b=_0x1208e0;_0x1c12a0[_0x455a('0x39')]=_['keys'](db[_0x455a('0x85')][_0x455a('0x36')]);_0x1c12a0[_0x455a('0x3a')]=_[_0x455a('0x50')](_0x292f10[_0x455a('0x3a')]);_0x1c12a0[_0x455a('0x3b')]=_[_0x455a('0x3c')](_0x1c12a0[_0x455a('0x39')],_0x1c12a0['query']);_0xc8afb9[_0x455a('0x3e')]=_[_0x455a('0x3c')](_0x1c12a0[_0x455a('0x39')],qs[_0x455a('0x3d')](_0x292f10[_0x455a('0x3a')][_0x455a('0x3d')]));_0xc8afb9[_0x455a('0x3e')]=_0xc8afb9[_0x455a('0x3e')][_0x455a('0x3f')]?_0xc8afb9[_0x455a('0x3e')]:_0x1c12a0[_0x455a('0x39')];_0xc8afb9[_0x455a('0x41')]=qs['sort'](_0x292f10[_0x455a('0x3a')][_0x455a('0x42')]);_0xc8afb9[_0x455a('0x43')]=qs[_0x455a('0x3b')](_[_0x455a('0x44')](_0x292f10[_0x455a('0x3a')],_0x1c12a0[_0x455a('0x3b')]));if(_0x292f10[_0x455a('0x3a')][_0x455a('0x48')]){_0xc8afb9[_0x455a('0x43')]=_[_0x455a('0x45')](_0xc8afb9['where'],{'$or':_[_0x455a('0x34')](_0xc8afb9[_0x455a('0x3e')],function(_0x281b83){var _0x554b12={};_0x554b12[_0x281b83]={'$like':'%'+_0x292f10[_0x455a('0x3a')][_0x455a('0x48')]+'%'};return _0x554b12;})});}_0xc8afb9=_['merge']({},_0xc8afb9,_0x292f10[_0x455a('0x49')]);return _0x2f3e0b[_0x455a('0x86')](_0xc8afb9);}})[_0x455a('0x2d')](function(_0x654475){if(_0x654475){_0x525265=_0x654475['length'];if(!_0x292f10['query']['hasOwnProperty'](_0x455a('0x40'))){_0xc8afb9[_0x455a('0x25')]=qs[_0x455a('0x25')](_0x292f10[_0x455a('0x3a')][_0x455a('0x25')]);_0xc8afb9[_0x455a('0x24')]=qs[_0x455a('0x24')](_0x292f10[_0x455a('0x3a')][_0x455a('0x24')]);}return _0x2f3e0b[_0x455a('0x86')](_0xc8afb9);}})[_0x455a('0x2d')](function(_0x4f9a6e){if(_0x4f9a6e){return _0x4f9a6e?{'count':_0x525265,'rows':_0x4f9a6e}:null;}})['then'](respondWithResult(_0x52d5da,null))[_0x455a('0x51')](handleError(_0x52d5da,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index dc29835..d99b5d3 100644 --- a/server/api/dashboard/dashboard.events.js +++ b/server/api/dashboard/dashboard.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2d8e=['Dashboard','setMaxListeners','save','update','remove','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x1c82ff,_0x17dbda){var _0x3281d9=function(_0x5632bd){while(--_0x5632bd){_0x1c82ff['push'](_0x1c82ff['shift']());}};_0x3281d9(++_0x17dbda);}(_0x2d8e,0x17a));var _0xe2d8=function(_0x5dbcc5,_0x2a6363){_0x5dbcc5=_0x5dbcc5-0x0;var _0x18daae=_0x2d8e[_0x5dbcc5];return _0x18daae;};'use strict';var EventEmitter=require(_0xe2d8('0x0'));var Dashboard=require(_0xe2d8('0x1'))['db'][_0xe2d8('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xe2d8('0x3')](0x0);var events={'afterCreate':_0xe2d8('0x4'),'afterUpdate':_0xe2d8('0x5'),'afterDestroy':_0xe2d8('0x6')};function emitEvent(_0x1f21e0){return function(_0x3714c2,_0x5cc70a,_0x21d44d){DashboardEvents['emit'](_0x1f21e0+':'+_0x3714c2['id'],_0x3714c2);DashboardEvents['emit'](_0x1f21e0,_0x3714c2);_0x21d44d(null);};}for(var e in events){if(events[_0xe2d8('0x7')](e)){var event=events[e];Dashboard[_0xe2d8('0x8')](e,emitEvent(event));}}module[_0xe2d8('0x9')]=DashboardEvents; \ No newline at end of file +var _0xdb8a=['events','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0x5e9b13,_0x381733){var _0x5e962b=function(_0x170b2e){while(--_0x170b2e){_0x5e9b13['push'](_0x5e9b13['shift']());}};_0x5e962b(++_0x381733);}(_0xdb8a,0xfc));var _0xadb8=function(_0x1ab0b5,_0x3cf535){_0x1ab0b5=_0x1ab0b5-0x0;var _0x41ffef=_0xdb8a[_0x1ab0b5];return _0x41ffef;};'use strict';var EventEmitter=require(_0xadb8('0x0'));var Dashboard=require('../../mysqldb')['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0xadb8('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xadb8('0x2'),'afterDestroy':'remove'};function emitEvent(_0x4da611){return function(_0x1a441b,_0x33040c,_0x5e38e5){DashboardEvents[_0xadb8('0x3')](_0x4da611+':'+_0x1a441b['id'],_0x1a441b);DashboardEvents['emit'](_0x4da611,_0x1a441b);_0x5e38e5(null);};}for(var e in events){if(events[_0xadb8('0x4')](e)){var event=events[e];Dashboard[_0xadb8('0x5')](e,emitEvent(event));}}module[_0xadb8('0x6')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 5045b20..92458fd 100644 --- a/server/api/dashboard/dashboard.model.js +++ b/server/api/dashboard/dashboard.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdd69=['moment','bluebird','request-promise','path','../../config/environment','./dashboard.attributes','define','dashboards','lodash','util','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdd69,0x188));var _0x9dd6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xdd69[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x9dd6('0x0'));var util=require(_0x9dd6('0x1'));var logger=require(_0x9dd6('0x2'))(_0x9dd6('0x3'));var moment=require(_0x9dd6('0x4'));var BPromise=require(_0x9dd6('0x5'));var rp=require(_0x9dd6('0x6'));var fs=require('fs');var path=require(_0x9dd6('0x7'));var rimraf=require('rimraf');var config=require(_0x9dd6('0x8'));var attributes=require(_0x9dd6('0x9'));module['exports']=function(_0x4775de,_0x5b8254){return _0x4775de[_0x9dd6('0xa')]('Dashboard',attributes,{'tableName':_0x9dd6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x44b6=['bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes','exports','define','Dashboard','dashboards','util','api','moment'];(function(_0x548003,_0x19cd0e){var _0x459a44=function(_0x1057c3){while(--_0x1057c3){_0x548003['push'](_0x548003['shift']());}};_0x459a44(++_0x19cd0e);}(_0x44b6,0x15c));var _0x644b=function(_0x14405c,_0x12b9b9){_0x14405c=_0x14405c-0x0;var _0x5d54ba=_0x44b6[_0x14405c];return _0x5d54ba;};'use strict';var _=require('lodash');var util=require(_0x644b('0x0'));var logger=require('../../config/logger')(_0x644b('0x1'));var moment=require(_0x644b('0x2'));var BPromise=require(_0x644b('0x3'));var rp=require(_0x644b('0x4'));var fs=require('fs');var path=require(_0x644b('0x5'));var rimraf=require(_0x644b('0x6'));var config=require(_0x644b('0x7'));var attributes=require(_0x644b('0x8'));module[_0x644b('0x9')]=function(_0x247fe8,_0x146508){return _0x247fe8[_0x644b('0xa')](_0x644b('0xb'),attributes,{'tableName':_0x644b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index 3c8bee5..fbf602e 100644 --- a/server/api/dashboard/dashboard.rpc.js +++ b/server/api/dashboard/dashboard.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x903f=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','request','then','info','request\x20sent','debug','stringify','code','error','Dashboard,\x20%s,\x20%s','message','result'];(function(_0x344128,_0x9b9e88){var _0x693fae=function(_0x3e2b2e){while(--_0x3e2b2e){_0x344128['push'](_0x344128['shift']());}};_0x693fae(++_0x9b9e88);}(_0x903f,0x197));var _0xf903=function(_0x3913d5,_0x2f7f8d){_0x3913d5=_0x3913d5-0x0;var _0x3bb52e=_0x903f[_0x3913d5];return _0x3bb52e;};'use strict';var _=require(_0xf903('0x0'));var util=require(_0xf903('0x1'));var moment=require(_0xf903('0x2'));var BPromise=require(_0xf903('0x3'));var rs=require(_0xf903('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf903('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf903('0x6'))(_0xf903('0x7'));var config=require(_0xf903('0x8'));var jayson=require(_0xf903('0x9'));var client=jayson[_0xf903('0xa')][_0xf903('0xb')]({'port':0x232a});config[_0xf903('0xc')]=_[_0xf903('0xd')](config[_0xf903('0xc')],{'host':_0xf903('0xe'),'port':0x18eb});var socket=require(_0xf903('0xf'))(new Redis(config[_0xf903('0xc')]));require(_0xf903('0x10'))['register'](socket);function respondWithRpcPromise(_0x5f5d60,_0x39a1a1,_0xebd10){return new BPromise(function(_0x23dcb0,_0x39ba04){return client[_0xf903('0x11')](_0x5f5d60,_0xebd10)[_0xf903('0x12')](function(_0xe420e9){logger[_0xf903('0x13')]('Dashboard,\x20%s,\x20%s',_0x39a1a1,_0xf903('0x14'));logger[_0xf903('0x15')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x39a1a1,_0xf903('0x14'),JSON[_0xf903('0x16')](_0xe420e9));if(_0xe420e9['error']){if(_0xe420e9['error'][_0xf903('0x17')]===0x1f4){logger[_0xf903('0x18')](_0xf903('0x19'),_0x39a1a1,_0xe420e9[_0xf903('0x18')][_0xf903('0x1a')]);return _0x39ba04(_0xe420e9[_0xf903('0x18')][_0xf903('0x1a')]);}logger['error']('Dashboard,\x20%s,\x20%s',_0x39a1a1,_0xe420e9[_0xf903('0x18')][_0xf903('0x1a')]);return _0x23dcb0(_0xe420e9['error'][_0xf903('0x1a')]);}else{logger[_0xf903('0x13')](_0xf903('0x19'),_0x39a1a1,'request\x20sent');_0x23dcb0(_0xe420e9[_0xf903('0x1b')][_0xf903('0x1a')]);}})[_0xf903('0x1c')](function(_0x2253a3){logger[_0xf903('0x18')](_0xf903('0x19'),_0x39a1a1,_0x2253a3);_0x39ba04(_0x2253a3);});});} \ No newline at end of file +var _0x292b=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','info','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','Dashboard,\x20%s,\x20%s','message','result','catch'];(function(_0x5df66f,_0x6baa14){var _0x2f1bfe=function(_0x31e001){while(--_0x31e001){_0x5df66f['push'](_0x5df66f['shift']());}};_0x2f1bfe(++_0x6baa14);}(_0x292b,0xcb));var _0xb292=function(_0x3fd9d8,_0x9a1892){_0x3fd9d8=_0x3fd9d8-0x0;var _0x181131=_0x292b[_0x3fd9d8];return _0x181131;};'use strict';var _=require(_0xb292('0x0'));var util=require(_0xb292('0x1'));var moment=require(_0xb292('0x2'));var BPromise=require(_0xb292('0x3'));var rs=require(_0xb292('0x4'));var fs=require('fs');var Redis=require(_0xb292('0x5'));var db=require(_0xb292('0x6'))['db'];var utils=require(_0xb292('0x7'));var logger=require(_0xb292('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb292('0x9'));var client=jayson[_0xb292('0xa')][_0xb292('0xb')]({'port':0x232a});config[_0xb292('0xc')]=_[_0xb292('0xd')](config[_0xb292('0xc')],{'host':_0xb292('0xe'),'port':0x18eb});var socket=require(_0xb292('0xf'))(new Redis(config[_0xb292('0xc')]));require(_0xb292('0x10'))[_0xb292('0x11')](socket);function respondWithRpcPromise(_0x1203b0,_0x9dfd3,_0x5deb9d){return new BPromise(function(_0x171d95,_0x3f2440){return client['request'](_0x1203b0,_0x5deb9d)['then'](function(_0x45d963){logger[_0xb292('0x12')]('Dashboard,\x20%s,\x20%s',_0x9dfd3,_0xb292('0x13'));logger[_0xb292('0x14')](_0xb292('0x15'),_0x9dfd3,_0xb292('0x13'),JSON[_0xb292('0x16')](_0x45d963));if(_0x45d963[_0xb292('0x17')]){if(_0x45d963[_0xb292('0x17')][_0xb292('0x18')]===0x1f4){logger[_0xb292('0x17')](_0xb292('0x19'),_0x9dfd3,_0x45d963[_0xb292('0x17')][_0xb292('0x1a')]);return _0x3f2440(_0x45d963[_0xb292('0x17')]['message']);}logger['error'](_0xb292('0x19'),_0x9dfd3,_0x45d963[_0xb292('0x17')][_0xb292('0x1a')]);return _0x171d95(_0x45d963[_0xb292('0x17')]['message']);}else{logger[_0xb292('0x12')]('Dashboard,\x20%s,\x20%s',_0x9dfd3,_0xb292('0x13'));_0x171d95(_0x45d963[_0xb292('0x1b')]['message']);}})[_0xb292('0x1c')](function(_0x35b516){logger[_0xb292('0x17')](_0xb292('0x19'),_0x9dfd3,_0x35b516);_0x3f2440(_0x35b516);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 85fb085..f2ff5f3 100644 --- a/server/api/dashboard/dashboard.socket.js +++ b/server/api/dashboard/dashboard.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x465c=['save','remove','removeListener','length','dashboard:','./dashboard.events'];(function(_0x10be8d,_0x16f086){var _0xc3a7d=function(_0x3afe22){while(--_0x3afe22){_0x10be8d['push'](_0x10be8d['shift']());}};_0xc3a7d(++_0x16f086);}(_0x465c,0xcb));var _0xc465=function(_0xfe89fc,_0x3ddd7d){_0xfe89fc=_0xfe89fc-0x0;var _0x4837d1=_0x465c[_0xfe89fc];return _0x4837d1;};'use strict';var DashboardEvents=require(_0xc465('0x0'));var events=[_0xc465('0x1'),_0xc465('0x2'),'update'];function createListener(_0x32573b,_0x58ba03){return function(_0x4c0503){_0x58ba03['emit'](_0x32573b,_0x4c0503);};}function removeListener(_0x1202d8,_0x5f34e0){return function(){DashboardEvents[_0xc465('0x3')](_0x1202d8,_0x5f34e0);};}exports['register']=function(_0x9649a3){for(var _0x30a994=0x0,_0x3f981=events[_0xc465('0x4')];_0x30a994<_0x3f981;_0x30a994++){var _0x73bf1e=events[_0x30a994];var _0x205aee=createListener(_0xc465('0x5')+_0x73bf1e,_0x9649a3);DashboardEvents['on'](_0x73bf1e,_0x205aee);}}; \ No newline at end of file +var _0xd2e7=['./dashboard.events','save','remove','emit','removeListener','register','length'];(function(_0x574dab,_0x3b0f77){var _0x1c493f=function(_0xa37341){while(--_0xa37341){_0x574dab['push'](_0x574dab['shift']());}};_0x1c493f(++_0x3b0f77);}(_0xd2e7,0x188));var _0x7d2e=function(_0x3149cf,_0x1266eb){_0x3149cf=_0x3149cf-0x0;var _0x4d283a=_0xd2e7[_0x3149cf];return _0x4d283a;};'use strict';var DashboardEvents=require(_0x7d2e('0x0'));var events=[_0x7d2e('0x1'),_0x7d2e('0x2'),'update'];function createListener(_0x1cb3a9,_0x5ad1d9){return function(_0x5d0ed2){_0x5ad1d9[_0x7d2e('0x3')](_0x1cb3a9,_0x5d0ed2);};}function removeListener(_0x2fb8f7,_0x24071b){return function(){DashboardEvents[_0x7d2e('0x4')](_0x2fb8f7,_0x24071b);};}exports[_0x7d2e('0x5')]=function(_0x36fc28){for(var _0x2736dc=0x0,_0x254c03=events[_0x7d2e('0x6')];_0x2736dc<_0x254c03;_0x2736dc++){var _0x364246=events[_0x2736dc];var _0x3acf9c=createListener('dashboard:'+_0x364246,_0x36fc28);DashboardEvents['on'](_0x364246,_0x3acf9c);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 520ff56..87edbff 100644 --- a/server/api/dashboard/index.js +++ b/server/api/dashboard/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6062=['post','create','/:id/clone','clone','addItem','put','/:id','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','show','/:id/items','getItems'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x6062,0x87));var _0x2606=function(_0x35c34c,_0x21ac81){_0x35c34c=_0x35c34c-0x0;var _0x5c2f62=_0x6062[_0x35c34c];return _0x5c2f62;};'use strict';var multer=require('multer');var util=require(_0x2606('0x0'));var path=require(_0x2606('0x1'));var timeout=require('connect-timeout');var express=require(_0x2606('0x2'));var router=express[_0x2606('0x3')]();var fs_extra=require(_0x2606('0x4'));var auth=require(_0x2606('0x5'));var interaction=require(_0x2606('0x6'));var config=require(_0x2606('0x7'));var controller=require(_0x2606('0x8'));router[_0x2606('0x9')]('/',auth[_0x2606('0xa')](),controller[_0x2606('0xb')]);router[_0x2606('0x9')]('/:id',auth[_0x2606('0xa')](),controller[_0x2606('0xc')]);router['get'](_0x2606('0xd'),auth[_0x2606('0xa')](),controller[_0x2606('0xe')]);router[_0x2606('0xf')]('/',auth[_0x2606('0xa')](),controller[_0x2606('0x10')]);router[_0x2606('0xf')](_0x2606('0x11'),auth[_0x2606('0xa')](),controller[_0x2606('0x12')]);router[_0x2606('0xf')]('/:id/items',auth[_0x2606('0xa')](),controller[_0x2606('0x13')]);router[_0x2606('0x14')](_0x2606('0x15'),auth[_0x2606('0xa')](),controller['update']);router[_0x2606('0x16')](_0x2606('0x15'),auth['isAuthenticated'](),controller[_0x2606('0x17')]);module[_0x2606('0x18')]=router; \ No newline at end of file +var _0x5dfc=['index','/:id','/:id/items','getItems','post','create','/:id/clone','addItem','put','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated'];(function(_0x25962a,_0x596b03){var _0xc2c848=function(_0x43e9af){while(--_0x43e9af){_0x25962a['push'](_0x25962a['shift']());}};_0xc2c848(++_0x596b03);}(_0x5dfc,0x1c4));var _0xc5df=function(_0x4884a7,_0x18e38a){_0x4884a7=_0x4884a7-0x0;var _0x56b60e=_0x5dfc[_0x4884a7];return _0x56b60e;};'use strict';var multer=require(_0xc5df('0x0'));var util=require('util');var path=require(_0xc5df('0x1'));var timeout=require(_0xc5df('0x2'));var express=require(_0xc5df('0x3'));var router=express[_0xc5df('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc5df('0x5'));var config=require(_0xc5df('0x6'));var controller=require(_0xc5df('0x7'));router[_0xc5df('0x8')]('/',auth[_0xc5df('0x9')](),controller[_0xc5df('0xa')]);router[_0xc5df('0x8')](_0xc5df('0xb'),auth[_0xc5df('0x9')](),controller['show']);router[_0xc5df('0x8')](_0xc5df('0xc'),auth[_0xc5df('0x9')](),controller[_0xc5df('0xd')]);router[_0xc5df('0xe')]('/',auth[_0xc5df('0x9')](),controller[_0xc5df('0xf')]);router[_0xc5df('0xe')](_0xc5df('0x10'),auth['isAuthenticated'](),controller['clone']);router[_0xc5df('0xe')](_0xc5df('0xc'),auth[_0xc5df('0x9')](),controller[_0xc5df('0x11')]);router[_0xc5df('0x12')]('/:id',auth[_0xc5df('0x9')](),controller[_0xc5df('0x13')]);router[_0xc5df('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xc5df('0x15')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 02b00b5..472cf9e 100644 --- a/server/api/dashboardItem/dashboardItem.attributes.js +++ b/server/api/dashboardItem/dashboardItem.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x33af=['attrs','setDataValue','stringify','INTEGER','#ffffff','squel','exports','STRING','TEXT','long','parse'];(function(_0x2b8971,_0x581f63){var _0x1aaddc=function(_0xffa738){while(--_0xffa738){_0x2b8971['push'](_0x2b8971['shift']());}};_0x1aaddc(++_0x581f63);}(_0x33af,0xec));var _0xf33a=function(_0xee37f1,_0x189f43){_0xee37f1=_0xee37f1-0x0;var _0x37fd54=_0x33af[_0xee37f1];return _0x37fd54;};'use strict';var Sequelize=require('sequelize');var squel=require(_0xf33a('0x0'));var _=require('lodash');module[_0xf33a('0x1')]={'title':{'type':Sequelize[_0xf33a('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf33a('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xf33a('0x3')](_0xf33a('0x4')),'get':function(){try{return JSON[_0xf33a('0x5')](this['getDataValue'](_0xf33a('0x6')));}catch(_0x44cfa5){return[];}},'set':function(_0x583e54){try{this[_0xf33a('0x7')](_0xf33a('0x6'),JSON[_0xf33a('0x8')](_0x583e54));}catch(_0x2f3730){this[_0xf33a('0x7')](_0xf33a('0x6'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0xf33a('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xf33a('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xf33a('0x9')]},'col':{'type':Sequelize[_0xf33a('0x9')]},'background':{'type':Sequelize[_0xf33a('0x2')],'allowNull':![],'defaultValue':_0xf33a('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xf33a('0x2')]},'titleFontSize':{'type':Sequelize[_0xf33a('0x9')],'defaultValue':0xc}}; \ No newline at end of file +var _0x7c09=['getDataValue','attrs','stringify','setDataValue','INTEGER','#2196f3','squel','lodash','STRING','TEXT','long','parse'];(function(_0x13c542,_0x4a9af3){var _0x306405=function(_0x36aaef){while(--_0x36aaef){_0x13c542['push'](_0x13c542['shift']());}};_0x306405(++_0x4a9af3);}(_0x7c09,0x102));var _0x97c0=function(_0x322f90,_0x4777d5){_0x322f90=_0x322f90-0x0;var _0xc8bfd6=_0x7c09[_0x322f90];return _0xc8bfd6;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x97c0('0x0'));var _=require(_0x97c0('0x1'));module['exports']={'title':{'type':Sequelize[_0x97c0('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x97c0('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x97c0('0x3')](_0x97c0('0x4')),'get':function(){try{return JSON[_0x97c0('0x5')](this[_0x97c0('0x6')](_0x97c0('0x7')));}catch(_0x4a7788){return[];}},'set':function(_0x4b2f81){try{this['setDataValue'](_0x97c0('0x7'),JSON[_0x97c0('0x8')](_0x4b2f81));}catch(_0x2c19fa){this[_0x97c0('0x9')](_0x97c0('0x7'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x97c0('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x97c0('0xa')]},'col':{'type':Sequelize[_0x97c0('0xa')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x97c0('0x2')],'allowNull':![],'defaultValue':_0x97c0('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x97c0('0x2')]},'titleFontSize':{'type':Sequelize[_0x97c0('0xa')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index e6eafc8..47d310c 100644 --- a/server/api/dashboardItem/dashboardItem.controller.js +++ b/server/api/dashboardItem/dashboardItem.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3dd6=['attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','send','show','params','model','keys','DashboardItem','query','intersection','attributes','fields','include','merge','options','find','catch','type','iframe','attrUrl','attrs','value','https://','custom','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3dd6,0xcf));var _0x63dd=function(_0xaaa123,_0x4c23e3){_0xaaa123=_0xaaa123-0x0;var _0x44d6d7=_0x3dd6[_0xaaa123];return _0x44d6d7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x63dd('0x0'));var rp=require(_0x63dd('0x1'));var moment=require(_0x63dd('0x2'));var BPromise=require(_0x63dd('0x3'));var Mustache=require(_0x63dd('0x4'));var util=require(_0x63dd('0x5'));var path=require('path');var sox=require(_0x63dd('0x6'));var csv=require('to-csv');var ejs=require(_0x63dd('0x7'));var fs=require('fs');var fs_extra=require(_0x63dd('0x8'));var _=require(_0x63dd('0x9'));var squel=require(_0x63dd('0xa'));var crypto=require(_0x63dd('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x63dd('0xc'));var toCsv=require(_0x63dd('0xd'));var querystring=require(_0x63dd('0xe'));var Papa=require(_0x63dd('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x63dd('0x10'));var as=require(_0x63dd('0x11'));var hardwareService=require(_0x63dd('0x12'));var logger=require(_0x63dd('0x13'))(_0x63dd('0x14'));var utils=require('../../config/utils');var config=require(_0x63dd('0x15'));var licenseUtil=require(_0x63dd('0x16'));var db=require(_0x63dd('0x17'))['db'];config[_0x63dd('0x18')]=_['defaults'](config[_0x63dd('0x18')],{'host':_0x63dd('0x19'),'port':0x18eb});var socket=require(_0x63dd('0x1a'))(new Redis(config[_0x63dd('0x18')]));require(_0x63dd('0x1b'))[_0x63dd('0x1c')](socket);function respondWithStatusCode(_0x56c030,_0x5b2f9f){_0x5b2f9f=_0x5b2f9f||0xcc;return function(_0x46952c){if(_0x46952c){return _0x56c030[_0x63dd('0x1d')](_0x5b2f9f);}return _0x56c030[_0x63dd('0x1e')](_0x5b2f9f)['end']();};}function respondWithResult(_0x4144eb,_0x3c9b5e){_0x3c9b5e=_0x3c9b5e||0xc8;return function(_0x1af946){if(_0x1af946){return _0x4144eb['status'](_0x3c9b5e)[_0x63dd('0x1f')](_0x1af946);}};}function respondWithFilteredResult(_0x368f85,_0x42781d){return function(_0xaf3376){if(_0xaf3376){var _0x3cb266=typeof _0x42781d[_0x63dd('0x20')]===_0x63dd('0x21')&&typeof _0x42781d[_0x63dd('0x22')]===_0x63dd('0x21');var _0x8f2691=_0xaf3376[_0x63dd('0x23')];var _0x1e09a5=_0x3cb266?0x0:_0x42781d['offset'];var _0x2e1305=_0x3cb266?_0xaf3376['count']:_0x42781d[_0x63dd('0x20')]+_0x42781d[_0x63dd('0x22')];var _0x22ad3d;if(_0x2e1305>=_0x8f2691){_0x2e1305=_0x8f2691;_0x22ad3d=0xc8;}else{_0x22ad3d=0xce;}_0x368f85['status'](_0x22ad3d);return _0x368f85[_0x63dd('0x24')](_0x63dd('0x25'),_0x1e09a5+'-'+_0x2e1305+'/'+_0x8f2691)[_0x63dd('0x1f')](_0xaf3376);}return null;};}function patchUpdates(_0x887c58){return function(_0x19e3e9){try{jsonpatch[_0x63dd('0x26')](_0x19e3e9,_0x887c58,!![]);}catch(_0xf8bc2){return BPromise[_0x63dd('0x27')](_0xf8bc2);}return _0x19e3e9[_0x63dd('0x28')]();};}function saveUpdates(_0x4b2451,_0x52cec7){return function(_0x48cfbe){if(_0x48cfbe){return _0x48cfbe[_0x63dd('0x29')](_0x4b2451)[_0x63dd('0x2a')](function(_0x540a9f){return _0x540a9f;});}return null;};}function removeEntity(_0x34d5d5,_0x222e13){return function(_0x4a80df){if(_0x4a80df){return _0x4a80df[_0x63dd('0x2b')]()[_0x63dd('0x2a')](function(){_0x34d5d5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2417f0,_0x474f3e){return function(_0x105618){if(!_0x105618){_0x2417f0[_0x63dd('0x1d')](0x194);}return _0x105618;};}function handleError(_0x15a13d,_0x47aa25){_0x47aa25=_0x47aa25||0x1f4;return function(_0x7ca662){logger['error'](_0x7ca662[_0x63dd('0x2c')]);if(_0x7ca662['name']){delete _0x7ca662['name'];}_0x15a13d[_0x63dd('0x1e')](_0x47aa25)[_0x63dd('0x2d')](_0x7ca662);};}exports[_0x63dd('0x2e')]=function(_0x3da8d5,_0x2734c9){var _0x452daf={'raw':![],'where':{'id':_0x3da8d5[_0x63dd('0x2f')]['id']}},_0x5525fd={};_0x5525fd[_0x63dd('0x30')]=_[_0x63dd('0x31')](db[_0x63dd('0x32')]['rawAttributes']);_0x5525fd[_0x63dd('0x33')]=_[_0x63dd('0x31')](_0x3da8d5[_0x63dd('0x33')]);_0x5525fd['filters']=_[_0x63dd('0x34')](_0x5525fd[_0x63dd('0x30')],_0x5525fd[_0x63dd('0x33')]);_0x452daf[_0x63dd('0x35')]=_['intersection'](_0x5525fd['model'],qs[_0x63dd('0x36')](_0x3da8d5['query'][_0x63dd('0x36')]));_0x452daf[_0x63dd('0x35')]=_0x452daf[_0x63dd('0x35')]['length']?_0x452daf[_0x63dd('0x35')]:_0x5525fd[_0x63dd('0x30')];if(_0x3da8d5[_0x63dd('0x33')]['includeAll']){_0x452daf[_0x63dd('0x37')]=[{'all':!![]}];}_0x452daf=_[_0x63dd('0x38')]({},_0x452daf,_0x3da8d5[_0x63dd('0x39')]);return db[_0x63dd('0x32')][_0x63dd('0x3a')](_0x452daf)[_0x63dd('0x2a')](handleEntityNotFound(_0x2734c9,null))['then'](respondWithResult(_0x2734c9,null))['catch'](handleError(_0x2734c9,null));};exports[_0x63dd('0x2b')]=function(_0x4c8d7f,_0x1ee993){return db['DashboardItem']['find']({'where':{'id':_0x4c8d7f['params']['id']}})[_0x63dd('0x2a')](handleEntityNotFound(_0x1ee993,null))[_0x63dd('0x2a')](removeEntity(_0x1ee993,null))[_0x63dd('0x3b')](handleError(_0x1ee993,null));};function widgetAttributes(_0x393d1c){try{switch(_0x393d1c[_0x63dd('0x3c')]){case _0x63dd('0x3d'):return[{'name':'attrUrl','value':_0x393d1c[_0x63dd('0x3e')]||(_0x393d1c['attrs']&&_0x393d1c[_0x63dd('0x3f')][0x0]?_0x393d1c[_0x63dd('0x3f')][0x0][_0x63dd('0x40')]:undefined)||_0x63dd('0x41')}];case _0x63dd('0x42'):return[{'name':'attrPath','value':_0x393d1c['attrPath']||(_0x393d1c[_0x63dd('0x3f')]&&_0x393d1c[_0x63dd('0x3f')][0x0]?_0x393d1c['attrs'][0x0][_0x63dd('0x40')]:undefined)||''}];case _0x63dd('0x43'):return[{'name':_0x63dd('0x44'),'value':_0x393d1c[_0x63dd('0x44')]||(_0x393d1c[_0x63dd('0x3f')]&&_0x393d1c[_0x63dd('0x3f')][0x0]?_0x393d1c[_0x63dd('0x3f')][0x0][_0x63dd('0x40')]:undefined)||'HH:mm:ss'},{'name':_0x63dd('0x45'),'value':_0x393d1c[_0x63dd('0x45')]||(_0x393d1c[_0x63dd('0x3f')]&&_0x393d1c['attrs'][0x1]?_0x393d1c[_0x63dd('0x3f')][0x1][_0x63dd('0x40')]:undefined)||_0x63dd('0x46')},{'name':_0x63dd('0x47'),'value':_0x393d1c[_0x63dd('0x47')]||(_0x393d1c[_0x63dd('0x3f')]&&_0x393d1c[_0x63dd('0x3f')][0x2]?_0x393d1c['attrs'][0x2][_0x63dd('0x40')]:undefined)||0xc}];case _0x63dd('0x48'):return[{'name':'attrMetric','value':_0x393d1c[_0x63dd('0x49')]||(_0x393d1c[_0x63dd('0x3f')]&&_0x393d1c[_0x63dd('0x3f')][0x0]?_0x393d1c[_0x63dd('0x3f')][0x0][_0x63dd('0x40')]:undefined)||_0x63dd('0x4a')},{'name':_0x63dd('0x4b'),'value':_0x393d1c[_0x63dd('0x4b')]||(_0x393d1c[_0x63dd('0x3f')]&&_0x393d1c[_0x63dd('0x3f')][0x1]?_0x393d1c['attrs'][0x1][_0x63dd('0x40')]:undefined)||[]},{'name':_0x63dd('0x47'),'value':_0x393d1c[_0x63dd('0x47')]||(_0x393d1c['attrs']&&_0x393d1c[_0x63dd('0x3f')][0x2]?_0x393d1c['attrs'][0x2][_0x63dd('0x40')]:undefined)||0x14},{'name':_0x63dd('0x4c'),'value':_0x393d1c[_0x63dd('0x4c')]||(_0x393d1c[_0x63dd('0x3f')]&&_0x393d1c[_0x63dd('0x3f')][0x3]?_0x393d1c[_0x63dd('0x3f')][0x3][_0x63dd('0x40')]:undefined)||_0x63dd('0x4d')},{'name':_0x63dd('0x4e'),'value':_0x393d1c[_0x63dd('0x4e')]||(_0x393d1c['attrs']&&_0x393d1c['attrs'][0x4]?_0x393d1c['attrs'][0x4]['value']:undefined)||''},{'name':_0x63dd('0x4f'),'value':_0x393d1c[_0x63dd('0x4f')]||(_0x393d1c[_0x63dd('0x3f')]&&_0x393d1c[_0x63dd('0x3f')][0x5]?_0x393d1c['attrs'][0x5][_0x63dd('0x40')]:undefined)||''},{'name':_0x63dd('0x50'),'value':_0x393d1c[_0x63dd('0x50')]||(_0x393d1c['attrs']&&_0x393d1c[_0x63dd('0x3f')][0x6]?_0x393d1c['attrs'][0x6][_0x63dd('0x40')]:undefined)||''},{'name':_0x63dd('0x51'),'value':_0x393d1c[_0x63dd('0x51')]||(_0x393d1c[_0x63dd('0x3f')]&&_0x393d1c[_0x63dd('0x3f')][0x7]?_0x393d1c[_0x63dd('0x3f')][0x7][_0x63dd('0x40')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x393d1c[_0x63dd('0x52')]||(_0x393d1c[_0x63dd('0x3f')]&&_0x393d1c['attrs'][0x8]?_0x393d1c[_0x63dd('0x3f')][0x8][_0x63dd('0x40')]:undefined)||''},{'name':'attrChatWebsites','value':_0x393d1c[_0x63dd('0x53')]||(_0x393d1c['attrs']&&_0x393d1c[_0x63dd('0x3f')][0x9]?_0x393d1c[_0x63dd('0x3f')][0x9]['value']:undefined)||''}];case _0x63dd('0x54'):case _0x63dd('0x55'):return[{'name':_0x63dd('0x56'),'value':_0x393d1c[_0x63dd('0x56')]||(_0x393d1c[_0x63dd('0x3f')]&&_0x393d1c[_0x63dd('0x3f')][0x0]?_0x393d1c['attrs'][0x0][_0x63dd('0x40')]:undefined)||_0x63dd('0x4a')},{'name':_0x63dd('0x57'),'value':_0x393d1c['attrSerie2']||(_0x393d1c['attrs']&&_0x393d1c[_0x63dd('0x3f')][0x1]?_0x393d1c['attrs'][0x1][_0x63dd('0x40')]:undefined)||null},{'name':_0x63dd('0x58'),'value':_0x393d1c[_0x63dd('0x58')]||(_0x393d1c[_0x63dd('0x3f')]&&_0x393d1c['attrs'][0x2]?_0x393d1c[_0x63dd('0x3f')][0x2]['value']:undefined)||null},{'name':_0x63dd('0x4b'),'value':_0x393d1c['attrVoiceQueues']||(_0x393d1c[_0x63dd('0x3f')]&&_0x393d1c[_0x63dd('0x3f')][0x3]?_0x393d1c[_0x63dd('0x3f')][0x3]['value']:undefined)||[]},{'name':_0x63dd('0x4c'),'value':_0x393d1c[_0x63dd('0x4c')]||(_0x393d1c[_0x63dd('0x3f')]&&_0x393d1c['attrs'][0x4]?_0x393d1c[_0x63dd('0x3f')][0x4][_0x63dd('0x40')]:undefined)||_0x63dd('0x4d')},{'name':_0x63dd('0x4e'),'value':_0x393d1c['attrEmailAccounts']||(_0x393d1c[_0x63dd('0x3f')]&&_0x393d1c['attrs'][0x5]?_0x393d1c[_0x63dd('0x3f')][0x5][_0x63dd('0x40')]:undefined)||''},{'name':_0x63dd('0x4f'),'value':_0x393d1c[_0x63dd('0x4f')]||(_0x393d1c[_0x63dd('0x3f')]&&_0x393d1c[_0x63dd('0x3f')][0x6]?_0x393d1c['attrs'][0x6][_0x63dd('0x40')]:undefined)||''},{'name':_0x63dd('0x50'),'value':_0x393d1c[_0x63dd('0x50')]||(_0x393d1c['attrs']&&_0x393d1c['attrs'][0x7]?_0x393d1c[_0x63dd('0x3f')][0x7]['value']:undefined)||''},{'name':_0x63dd('0x51'),'value':_0x393d1c[_0x63dd('0x51')]||(_0x393d1c[_0x63dd('0x3f')]&&_0x393d1c[_0x63dd('0x3f')][0x8]?_0x393d1c['attrs'][0x8][_0x63dd('0x40')]:undefined)||''},{'name':_0x63dd('0x52'),'value':_0x393d1c[_0x63dd('0x52')]||(_0x393d1c[_0x63dd('0x3f')]&&_0x393d1c[_0x63dd('0x3f')][0x9]?_0x393d1c[_0x63dd('0x3f')][0x9][_0x63dd('0x40')]:undefined)||''},{'name':_0x63dd('0x53'),'value':_0x393d1c[_0x63dd('0x53')]||(_0x393d1c['attrs']&&_0x393d1c[_0x63dd('0x3f')][0xa]?_0x393d1c['attrs'][0xa][_0x63dd('0x40')]:undefined)||''}];case'web-report':return[{'name':'attrReport','type':_0x393d1c[_0x63dd('0x59')]||(_0x393d1c[_0x63dd('0x3f')]&&_0x393d1c[_0x63dd('0x3f')][0x0]?_0x393d1c['attrs'][0x0][_0x63dd('0x3c')]:undefined)||null,'value':_0x393d1c[_0x63dd('0x5a')]||(_0x393d1c[_0x63dd('0x3f')]&&_0x393d1c['attrs'][0x0]?_0x393d1c[_0x63dd('0x3f')][0x0][_0x63dd('0x40')]:undefined)||null},{'name':'attrRefresh','value':_0x393d1c[_0x63dd('0x5b')]||(_0x393d1c['attrs']&&_0x393d1c['attrs'][0x1]?_0x393d1c[_0x63dd('0x3f')][0x1][_0x63dd('0x40')]:undefined)||0x0}];default:return[];}}catch(_0x46d946){logger['error'](_0x63dd('0x5c'),JSON[_0x63dd('0x5d')](_0x46d946));return[];}}exports[_0x63dd('0x5e')]=function(_0x737eaf,_0x5ccf7f){if(_0x737eaf[_0x63dd('0x5f')]){_0x737eaf[_0x63dd('0x5f')][_0x63dd('0x3f')]=widgetAttributes(_0x737eaf[_0x63dd('0x5f')]);}return db['DashboardItem'][_0x63dd('0x5e')](_0x737eaf['body'],{})['then'](respondWithResult(_0x5ccf7f,0xc9))['catch'](handleError(_0x5ccf7f,null));};exports['update']=function(_0x3057ce,_0x35aeb3){if(_0x3057ce['body']['id']){delete _0x3057ce[_0x63dd('0x5f')]['id'];}_0x3057ce['body'][_0x63dd('0x3f')]=widgetAttributes(_0x3057ce[_0x63dd('0x5f')]);return db[_0x63dd('0x32')][_0x63dd('0x3a')]({'where':{'id':_0x3057ce['params']['id']}})[_0x63dd('0x2a')](handleEntityNotFound(_0x35aeb3,null))['then'](saveUpdates(_0x3057ce['body'],null))['then'](respondWithResult(_0x35aeb3,null))[_0x63dd('0x3b')](handleError(_0x35aeb3,null));}; \ No newline at end of file +var _0x077e=['attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','voice','web-report','attrReport','type','attrRefresh','widgetAttributes:\x20%s','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','show','params','model','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','fields','length','merge','options','find','catch','iframe'];(function(_0x69cb42,_0x35dac3){var _0x898174=function(_0x115695){while(--_0x115695){_0x69cb42['push'](_0x69cb42['shift']());}};_0x898174(++_0x35dac3);}(_0x077e,0x14a));var _0xe077=function(_0x286476,_0x20b7f2){_0x286476=_0x286476-0x0;var _0x273c80=_0x077e[_0x286476];return _0x273c80;};'use strict';var emlformat=require(_0xe077('0x0'));var rimraf=require(_0xe077('0x1'));var zipdir=require(_0xe077('0x2'));var jsonpatch=require(_0xe077('0x3'));var rp=require('request-promise');var moment=require(_0xe077('0x4'));var BPromise=require(_0xe077('0x5'));var Mustache=require(_0xe077('0x6'));var util=require('util');var path=require(_0xe077('0x7'));var sox=require(_0xe077('0x8'));var csv=require(_0xe077('0x9'));var ejs=require(_0xe077('0xa'));var fs=require('fs');var fs_extra=require(_0xe077('0xb'));var _=require(_0xe077('0xc'));var squel=require(_0xe077('0xd'));var crypto=require(_0xe077('0xe'));var jsforce=require(_0xe077('0xf'));var deskjs=require(_0xe077('0x10'));var toCsv=require(_0xe077('0x9'));var querystring=require(_0xe077('0x11'));var Papa=require('papaparse');var Redis=require(_0xe077('0x12'));var authService=require(_0xe077('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe077('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe077('0x15'))('api');var utils=require(_0xe077('0x16'));var config=require(_0xe077('0x17'));var licenseUtil=require(_0xe077('0x18'));var db=require(_0xe077('0x19'))['db'];config[_0xe077('0x1a')]=_[_0xe077('0x1b')](config[_0xe077('0x1a')],{'host':_0xe077('0x1c'),'port':0x18eb});var socket=require(_0xe077('0x1d'))(new Redis(config[_0xe077('0x1a')]));require(_0xe077('0x1e'))['register'](socket);function respondWithStatusCode(_0x42f084,_0x319bac){_0x319bac=_0x319bac||0xcc;return function(_0x5e5cad){if(_0x5e5cad){return _0x42f084['sendStatus'](_0x319bac);}return _0x42f084['status'](_0x319bac)[_0xe077('0x1f')]();};}function respondWithResult(_0x37c7fa,_0xace9bc){_0xace9bc=_0xace9bc||0xc8;return function(_0x267521){if(_0x267521){return _0x37c7fa[_0xe077('0x20')](_0xace9bc)[_0xe077('0x21')](_0x267521);}};}function respondWithFilteredResult(_0xc219a6,_0x3957a8){return function(_0x114ec0){if(_0x114ec0){var _0x2e650a=typeof _0x3957a8['offset']===_0xe077('0x22')&&typeof _0x3957a8[_0xe077('0x23')]===_0xe077('0x22');var _0x4df5e3=_0x114ec0[_0xe077('0x24')];var _0x49d97a=_0x2e650a?0x0:_0x3957a8[_0xe077('0x25')];var _0x17a74f=_0x2e650a?_0x114ec0[_0xe077('0x24')]:_0x3957a8['offset']+_0x3957a8[_0xe077('0x23')];var _0x2d0c65;if(_0x17a74f>=_0x4df5e3){_0x17a74f=_0x4df5e3;_0x2d0c65=0xc8;}else{_0x2d0c65=0xce;}_0xc219a6[_0xe077('0x20')](_0x2d0c65);return _0xc219a6[_0xe077('0x26')](_0xe077('0x27'),_0x49d97a+'-'+_0x17a74f+'/'+_0x4df5e3)[_0xe077('0x21')](_0x114ec0);}return null;};}function patchUpdates(_0x40c918){return function(_0x15130a){try{jsonpatch[_0xe077('0x28')](_0x15130a,_0x40c918,!![]);}catch(_0x5d9a10){return BPromise[_0xe077('0x29')](_0x5d9a10);}return _0x15130a[_0xe077('0x2a')]();};}function saveUpdates(_0x47ba4c,_0x3a9845){return function(_0xf5025b){if(_0xf5025b){return _0xf5025b[_0xe077('0x2b')](_0x47ba4c)[_0xe077('0x2c')](function(_0x10db13){return _0x10db13;});}return null;};}function removeEntity(_0x115825,_0x714469){return function(_0x3016e4){if(_0x3016e4){return _0x3016e4['destroy']()[_0xe077('0x2c')](function(){_0x115825[_0xe077('0x20')](0xcc)[_0xe077('0x1f')]();});}};}function handleEntityNotFound(_0xd7629f,_0x300857){return function(_0x26293d){if(!_0x26293d){_0xd7629f[_0xe077('0x2d')](0x194);}return _0x26293d;};}function handleError(_0x29117c,_0x22e390){_0x22e390=_0x22e390||0x1f4;return function(_0x34c307){logger[_0xe077('0x2e')](_0x34c307[_0xe077('0x2f')]);if(_0x34c307[_0xe077('0x30')]){delete _0x34c307['name'];}_0x29117c[_0xe077('0x20')](_0x22e390)['send'](_0x34c307);};}exports[_0xe077('0x31')]=function(_0x8d4bfa,_0xd133a3){var _0x5e0c34={'raw':![],'where':{'id':_0x8d4bfa[_0xe077('0x32')]['id']}},_0x160453={};_0x160453[_0xe077('0x33')]=_[_0xe077('0x34')](db[_0xe077('0x35')][_0xe077('0x36')]);_0x160453[_0xe077('0x37')]=_[_0xe077('0x34')](_0x8d4bfa[_0xe077('0x37')]);_0x160453[_0xe077('0x38')]=_[_0xe077('0x39')](_0x160453[_0xe077('0x33')],_0x160453[_0xe077('0x37')]);_0x5e0c34[_0xe077('0x3a')]=_[_0xe077('0x39')](_0x160453['model'],qs['fields'](_0x8d4bfa[_0xe077('0x37')][_0xe077('0x3b')]));_0x5e0c34['attributes']=_0x5e0c34['attributes'][_0xe077('0x3c')]?_0x5e0c34[_0xe077('0x3a')]:_0x160453[_0xe077('0x33')];if(_0x8d4bfa[_0xe077('0x37')]['includeAll']){_0x5e0c34['include']=[{'all':!![]}];}_0x5e0c34=_[_0xe077('0x3d')]({},_0x5e0c34,_0x8d4bfa[_0xe077('0x3e')]);return db[_0xe077('0x35')][_0xe077('0x3f')](_0x5e0c34)[_0xe077('0x2c')](handleEntityNotFound(_0xd133a3,null))['then'](respondWithResult(_0xd133a3,null))[_0xe077('0x40')](handleError(_0xd133a3,null));};exports['destroy']=function(_0x48eee6,_0x257da4){return db[_0xe077('0x35')][_0xe077('0x3f')]({'where':{'id':_0x48eee6[_0xe077('0x32')]['id']}})[_0xe077('0x2c')](handleEntityNotFound(_0x257da4,null))['then'](removeEntity(_0x257da4,null))[_0xe077('0x40')](handleError(_0x257da4,null));};function widgetAttributes(_0x35251d){try{switch(_0x35251d['type']){case _0xe077('0x41'):return[{'name':'attrUrl','value':_0x35251d['attrUrl']||(_0x35251d[_0xe077('0x42')]&&_0x35251d['attrs'][0x0]?_0x35251d['attrs'][0x0][_0xe077('0x43')]:undefined)||_0xe077('0x44')}];case'custom':return[{'name':'attrPath','value':_0x35251d[_0xe077('0x45')]||(_0x35251d[_0xe077('0x42')]&&_0x35251d['attrs'][0x0]?_0x35251d['attrs'][0x0][_0xe077('0x43')]:undefined)||''}];case _0xe077('0x46'):return[{'name':_0xe077('0x47'),'value':_0x35251d[_0xe077('0x47')]||(_0x35251d[_0xe077('0x42')]&&_0x35251d[_0xe077('0x42')][0x0]?_0x35251d[_0xe077('0x42')][0x0][_0xe077('0x43')]:undefined)||_0xe077('0x48')},{'name':_0xe077('0x49'),'value':_0x35251d[_0xe077('0x49')]||(_0x35251d[_0xe077('0x42')]&&_0x35251d[_0xe077('0x42')][0x1]?_0x35251d['attrs'][0x1][_0xe077('0x43')]:undefined)||_0xe077('0x4a')},{'name':'attrFontSize','value':_0x35251d[_0xe077('0x4b')]||(_0x35251d[_0xe077('0x42')]&&_0x35251d[_0xe077('0x42')][0x2]?_0x35251d['attrs'][0x2][_0xe077('0x43')]:undefined)||0xc}];case _0xe077('0x4c'):return[{'name':_0xe077('0x4d'),'value':_0x35251d['attrMetric']||(_0x35251d[_0xe077('0x42')]&&_0x35251d['attrs'][0x0]?_0x35251d[_0xe077('0x42')][0x0]['value']:undefined)||'total'},{'name':_0xe077('0x4e'),'value':_0x35251d['attrVoiceQueues']||(_0x35251d[_0xe077('0x42')]&&_0x35251d['attrs'][0x1]?_0x35251d['attrs'][0x1][_0xe077('0x43')]:undefined)||[]},{'name':_0xe077('0x4b'),'value':_0x35251d[_0xe077('0x4b')]||(_0x35251d[_0xe077('0x42')]&&_0x35251d[_0xe077('0x42')][0x2]?_0x35251d[_0xe077('0x42')][0x2]['value']:undefined)||0x14},{'name':_0xe077('0x4f'),'value':_0x35251d[_0xe077('0x4f')]||(_0x35251d[_0xe077('0x42')]&&_0x35251d[_0xe077('0x42')][0x3]?_0x35251d[_0xe077('0x42')][0x3]['value']:undefined)||'voice'},{'name':_0xe077('0x50'),'value':_0x35251d[_0xe077('0x50')]||(_0x35251d[_0xe077('0x42')]&&_0x35251d['attrs'][0x4]?_0x35251d[_0xe077('0x42')][0x4][_0xe077('0x43')]:undefined)||''},{'name':_0xe077('0x51'),'value':_0x35251d[_0xe077('0x51')]||(_0x35251d[_0xe077('0x42')]&&_0x35251d[_0xe077('0x42')][0x5]?_0x35251d[_0xe077('0x42')][0x5][_0xe077('0x43')]:undefined)||''},{'name':_0xe077('0x52'),'value':_0x35251d[_0xe077('0x52')]||(_0x35251d[_0xe077('0x42')]&&_0x35251d[_0xe077('0x42')][0x6]?_0x35251d['attrs'][0x6][_0xe077('0x43')]:undefined)||''},{'name':_0xe077('0x53'),'value':_0x35251d[_0xe077('0x53')]||(_0x35251d['attrs']&&_0x35251d['attrs'][0x7]?_0x35251d[_0xe077('0x42')][0x7][_0xe077('0x43')]:undefined)||''},{'name':_0xe077('0x54'),'value':_0x35251d[_0xe077('0x54')]||(_0x35251d[_0xe077('0x42')]&&_0x35251d[_0xe077('0x42')][0x8]?_0x35251d[_0xe077('0x42')][0x8][_0xe077('0x43')]:undefined)||''},{'name':'attrChatWebsites','value':_0x35251d[_0xe077('0x55')]||(_0x35251d['attrs']&&_0x35251d[_0xe077('0x42')][0x9]?_0x35251d[_0xe077('0x42')][0x9][_0xe077('0x43')]:undefined)||''}];case _0xe077('0x56'):case _0xe077('0x57'):return[{'name':'attrSerie1','value':_0x35251d[_0xe077('0x58')]||(_0x35251d['attrs']&&_0x35251d[_0xe077('0x42')][0x0]?_0x35251d['attrs'][0x0][_0xe077('0x43')]:undefined)||_0xe077('0x59')},{'name':_0xe077('0x5a'),'value':_0x35251d[_0xe077('0x5a')]||(_0x35251d['attrs']&&_0x35251d['attrs'][0x1]?_0x35251d['attrs'][0x1][_0xe077('0x43')]:undefined)||null},{'name':'attrSerie3','value':_0x35251d['attrSerie3']||(_0x35251d[_0xe077('0x42')]&&_0x35251d[_0xe077('0x42')][0x2]?_0x35251d[_0xe077('0x42')][0x2][_0xe077('0x43')]:undefined)||null},{'name':_0xe077('0x4e'),'value':_0x35251d['attrVoiceQueues']||(_0x35251d[_0xe077('0x42')]&&_0x35251d[_0xe077('0x42')][0x3]?_0x35251d['attrs'][0x3][_0xe077('0x43')]:undefined)||[]},{'name':_0xe077('0x4f'),'value':_0x35251d[_0xe077('0x4f')]||(_0x35251d['attrs']&&_0x35251d[_0xe077('0x42')][0x4]?_0x35251d[_0xe077('0x42')][0x4]['value']:undefined)||_0xe077('0x5b')},{'name':_0xe077('0x50'),'value':_0x35251d['attrEmailAccounts']||(_0x35251d[_0xe077('0x42')]&&_0x35251d['attrs'][0x5]?_0x35251d['attrs'][0x5][_0xe077('0x43')]:undefined)||''},{'name':_0xe077('0x51'),'value':_0x35251d[_0xe077('0x51')]||(_0x35251d[_0xe077('0x42')]&&_0x35251d['attrs'][0x6]?_0x35251d[_0xe077('0x42')][0x6][_0xe077('0x43')]:undefined)||''},{'name':_0xe077('0x52'),'value':_0x35251d['attrSmsAccounts']||(_0x35251d[_0xe077('0x42')]&&_0x35251d[_0xe077('0x42')][0x7]?_0x35251d[_0xe077('0x42')][0x7][_0xe077('0x43')]:undefined)||''},{'name':_0xe077('0x53'),'value':_0x35251d[_0xe077('0x53')]||(_0x35251d['attrs']&&_0x35251d[_0xe077('0x42')][0x8]?_0x35251d[_0xe077('0x42')][0x8][_0xe077('0x43')]:undefined)||''},{'name':_0xe077('0x54'),'value':_0x35251d[_0xe077('0x54')]||(_0x35251d[_0xe077('0x42')]&&_0x35251d[_0xe077('0x42')][0x9]?_0x35251d[_0xe077('0x42')][0x9][_0xe077('0x43')]:undefined)||''},{'name':'attrChatWebsites','value':_0x35251d[_0xe077('0x55')]||(_0x35251d['attrs']&&_0x35251d[_0xe077('0x42')][0xa]?_0x35251d[_0xe077('0x42')][0xa][_0xe077('0x43')]:undefined)||''}];case _0xe077('0x5c'):return[{'name':_0xe077('0x5d'),'type':_0x35251d['reportType']||(_0x35251d[_0xe077('0x42')]&&_0x35251d['attrs'][0x0]?_0x35251d[_0xe077('0x42')][0x0][_0xe077('0x5e')]:undefined)||null,'value':_0x35251d['attrReport']||(_0x35251d[_0xe077('0x42')]&&_0x35251d[_0xe077('0x42')][0x0]?_0x35251d[_0xe077('0x42')][0x0][_0xe077('0x43')]:undefined)||null},{'name':_0xe077('0x5f'),'value':_0x35251d[_0xe077('0x5f')]||(_0x35251d[_0xe077('0x42')]&&_0x35251d['attrs'][0x1]?_0x35251d[_0xe077('0x42')][0x1][_0xe077('0x43')]:undefined)||0x0}];default:return[];}}catch(_0x35ff4e){logger[_0xe077('0x2e')](_0xe077('0x60'),JSON['stringify'](_0x35ff4e));return[];}}exports[_0xe077('0x61')]=function(_0x5b52fa,_0x2010b0){if(_0x5b52fa[_0xe077('0x62')]){_0x5b52fa[_0xe077('0x62')][_0xe077('0x42')]=widgetAttributes(_0x5b52fa['body']);}return db[_0xe077('0x35')][_0xe077('0x61')](_0x5b52fa[_0xe077('0x62')],{})[_0xe077('0x2c')](respondWithResult(_0x2010b0,0xc9))[_0xe077('0x40')](handleError(_0x2010b0,null));};exports[_0xe077('0x2b')]=function(_0x9f13c6,_0x17be3d){if(_0x9f13c6[_0xe077('0x62')]['id']){delete _0x9f13c6[_0xe077('0x62')]['id'];}_0x9f13c6[_0xe077('0x62')][_0xe077('0x42')]=widgetAttributes(_0x9f13c6['body']);return db['DashboardItem'][_0xe077('0x3f')]({'where':{'id':_0x9f13c6[_0xe077('0x32')]['id']}})[_0xe077('0x2c')](handleEntityNotFound(_0x17be3d,null))['then'](saveUpdates(_0x9f13c6['body'],null))[_0xe077('0x2c')](respondWithResult(_0x17be3d,null))[_0xe077('0x40')](handleError(_0x17be3d,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 6344b52..05fa7ca 100644 --- a/server/api/dashboardItem/dashboardItem.events.js +++ b/server/api/dashboardItem/dashboardItem.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x236c=['save','update','remove','emit','hasOwnProperty','events','../../mysqldb','DashboardItem','setMaxListeners'];(function(_0x4e6dfe,_0x466405){var _0x1183d4=function(_0x50720f){while(--_0x50720f){_0x4e6dfe['push'](_0x4e6dfe['shift']());}};_0x1183d4(++_0x466405);}(_0x236c,0x164));var _0xc236=function(_0x45e579,_0x5e0fe3){_0x45e579=_0x45e579-0x0;var _0x391363=_0x236c[_0x45e579];return _0x391363;};'use strict';var EventEmitter=require(_0xc236('0x0'));var DashboardItem=require(_0xc236('0x1'))['db'][_0xc236('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xc236('0x3')](0x0);var events={'afterCreate':_0xc236('0x4'),'afterUpdate':_0xc236('0x5'),'afterDestroy':_0xc236('0x6')};function emitEvent(_0x24dbd0){return function(_0x1c8f18,_0x5a8923,_0x366c45){DashboardItemEvents[_0xc236('0x7')](_0x24dbd0+':'+_0x1c8f18['id'],_0x1c8f18);DashboardItemEvents[_0xc236('0x7')](_0x24dbd0,_0x1c8f18);_0x366c45(null);};}for(var e in events){if(events[_0xc236('0x8')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file +var _0x531a=['exports','events','DashboardItem','setMaxListeners','save','update','emit','hook'];(function(_0x50b7a8,_0x2ba444){var _0x15c580=function(_0x2c196e){while(--_0x2c196e){_0x50b7a8['push'](_0x50b7a8['shift']());}};_0x15c580(++_0x2ba444);}(_0x531a,0x79));var _0xa531=function(_0x4250fa,_0x47f2ff){_0x4250fa=_0x4250fa-0x0;var _0x592c36=_0x531a[_0x4250fa];return _0x592c36;};'use strict';var EventEmitter=require(_0xa531('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0xa531('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xa531('0x2')](0x0);var events={'afterCreate':_0xa531('0x3'),'afterUpdate':_0xa531('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5144c8){return function(_0x3807b8,_0x2f2b7a,_0x34dc3c){DashboardItemEvents[_0xa531('0x5')](_0x5144c8+':'+_0x3807b8['id'],_0x3807b8);DashboardItemEvents['emit'](_0x5144c8,_0x3807b8);_0x34dc3c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0xa531('0x6')](e,emitEvent(event));}}module[_0xa531('0x7')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index f057a89..72a097d 100644 --- a/server/api/dashboardItem/dashboardItem.model.js +++ b/server/api/dashboardItem/dashboardItem.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x02c1=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','lodash'];(function(_0x15beeb,_0x32bd4f){var _0x5b681a=function(_0x2f9b5c){while(--_0x2f9b5c){_0x15beeb['push'](_0x15beeb['shift']());}};_0x5b681a(++_0x32bd4f);}(_0x02c1,0x8e));var _0x102c=function(_0x3ea3b4,_0x46eaeb){_0x3ea3b4=_0x3ea3b4-0x0;var _0x520f06=_0x02c1[_0x3ea3b4];return _0x520f06;};'use strict';var _=require(_0x102c('0x0'));var util=require('util');var logger=require(_0x102c('0x1'))(_0x102c('0x2'));var moment=require(_0x102c('0x3'));var BPromise=require('bluebird');var rp=require(_0x102c('0x4'));var fs=require('fs');var path=require(_0x102c('0x5'));var rimraf=require(_0x102c('0x6'));var config=require(_0x102c('0x7'));var attributes=require(_0x102c('0x8'));module[_0x102c('0x9')]=function(_0x5630a7,_0x52b172){return _0x5630a7[_0x102c('0xa')](_0x102c('0xb'),attributes,{'tableName':_0x102c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6127=['api','moment','bluebird','request-promise','../../config/environment','./dashboardItem.attributes','exports','DashboardItem','dashboard_items','lodash','util','../../config/logger'];(function(_0x444a01,_0x4e0636){var _0x1294b4=function(_0x3b62c6){while(--_0x3b62c6){_0x444a01['push'](_0x444a01['shift']());}};_0x1294b4(++_0x4e0636);}(_0x6127,0x165));var _0x7612=function(_0x399849,_0x3b630d){_0x399849=_0x399849-0x0;var _0xfbb04=_0x6127[_0x399849];return _0xfbb04;};'use strict';var _=require(_0x7612('0x0'));var util=require(_0x7612('0x1'));var logger=require(_0x7612('0x2'))(_0x7612('0x3'));var moment=require(_0x7612('0x4'));var BPromise=require(_0x7612('0x5'));var rp=require(_0x7612('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7612('0x7'));var attributes=require(_0x7612('0x8'));module[_0x7612('0x9')]=function(_0x25e573,_0x3c8d5f){return _0x25e573['define'](_0x7612('0xa'),attributes,{'tableName':_0x7612('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index 1e9eec6..f3d546d 100644 --- a/server/api/dashboardItem/dashboardItem.rpc.js +++ b/server/api/dashboardItem/dashboardItem.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x48c7=['randomstring','ioredis','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./dashboardItem.socket','register','request','info','DashboardItem,\x20%s,\x20%s','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','moment','bluebird'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x48c7,0x16e));var _0x748c=function(_0xe1bdfa,_0x5371ce){_0xe1bdfa=_0xe1bdfa-0x0;var _0x28daee=_0x48c7[_0xe1bdfa];return _0x28daee;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x748c('0x0'));var BPromise=require(_0x748c('0x1'));var rs=require(_0x748c('0x2'));var fs=require('fs');var Redis=require(_0x748c('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x748c('0x4'));var jayson=require(_0x748c('0x5'));var client=jayson[_0x748c('0x6')][_0x748c('0x7')]({'port':0x232a});config[_0x748c('0x8')]=_[_0x748c('0x9')](config['redis'],{'host':_0x748c('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x748c('0xb'))[_0x748c('0xc')](socket);function respondWithRpcPromise(_0x522227,_0x469ecd,_0x5c037c){return new BPromise(function(_0x548da3,_0x5d2d5b){return client[_0x748c('0xd')](_0x522227,_0x5c037c)['then'](function(_0x2361b3){logger[_0x748c('0xe')](_0x748c('0xf'),_0x469ecd,'request\x20sent');logger['debug'](_0x748c('0x10'),_0x469ecd,_0x748c('0x11'),JSON[_0x748c('0x12')](_0x2361b3));if(_0x2361b3[_0x748c('0x13')]){if(_0x2361b3['error']['code']===0x1f4){logger[_0x748c('0x13')](_0x748c('0xf'),_0x469ecd,_0x2361b3[_0x748c('0x13')][_0x748c('0x14')]);return _0x5d2d5b(_0x2361b3['error'][_0x748c('0x14')]);}logger[_0x748c('0x13')](_0x748c('0xf'),_0x469ecd,_0x2361b3[_0x748c('0x13')][_0x748c('0x14')]);return _0x548da3(_0x2361b3[_0x748c('0x13')][_0x748c('0x14')]);}else{logger[_0x748c('0xe')](_0x748c('0xf'),_0x469ecd,_0x748c('0x11'));_0x548da3(_0x2361b3[_0x748c('0x15')][_0x748c('0x14')]);}})[_0x748c('0x16')](function(_0x10ccc4){logger[_0x748c('0x13')]('DashboardItem,\x20%s,\x20%s',_0x469ecd,_0x10ccc4);_0x5d2d5b(_0x10ccc4);});});} \ No newline at end of file +var _0x8ee6=['./dashboardItem.socket','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter'];(function(_0x88a7ac,_0x5a4924){var _0x424e92=function(_0x5e8031){while(--_0x5e8031){_0x88a7ac['push'](_0x88a7ac['shift']());}};_0x424e92(++_0x5a4924);}(_0x8ee6,0xed));var _0x68ee=function(_0x4d9a31,_0xb2d54d){_0x4d9a31=_0x4d9a31-0x0;var _0x25016b=_0x8ee6[_0x4d9a31];return _0x25016b;};'use strict';var _=require(_0x68ee('0x0'));var util=require(_0x68ee('0x1'));var moment=require(_0x68ee('0x2'));var BPromise=require(_0x68ee('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x68ee('0x4'));var db=require(_0x68ee('0x5'))['db'];var utils=require(_0x68ee('0x6'));var logger=require('../../config/logger')(_0x68ee('0x7'));var config=require(_0x68ee('0x8'));var jayson=require(_0x68ee('0x9'));var client=jayson[_0x68ee('0xa')][_0x68ee('0xb')]({'port':0x232a});config[_0x68ee('0xc')]=_['defaults'](config[_0x68ee('0xc')],{'host':_0x68ee('0xd'),'port':0x18eb});var socket=require(_0x68ee('0xe'))(new Redis(config[_0x68ee('0xc')]));require(_0x68ee('0xf'))['register'](socket);function respondWithRpcPromise(_0x36af9e,_0x173610,_0x2d9a03){return new BPromise(function(_0x5c101c,_0x8fc211){return client[_0x68ee('0x10')](_0x36af9e,_0x2d9a03)[_0x68ee('0x11')](function(_0x12e530){logger[_0x68ee('0x12')](_0x68ee('0x13'),_0x173610,_0x68ee('0x14'));logger[_0x68ee('0x15')](_0x68ee('0x16'),_0x173610,_0x68ee('0x14'),JSON['stringify'](_0x12e530));if(_0x12e530[_0x68ee('0x17')]){if(_0x12e530[_0x68ee('0x17')][_0x68ee('0x18')]===0x1f4){logger[_0x68ee('0x17')](_0x68ee('0x13'),_0x173610,_0x12e530[_0x68ee('0x17')][_0x68ee('0x19')]);return _0x8fc211(_0x12e530[_0x68ee('0x17')]['message']);}logger[_0x68ee('0x17')](_0x68ee('0x13'),_0x173610,_0x12e530[_0x68ee('0x17')][_0x68ee('0x19')]);return _0x5c101c(_0x12e530[_0x68ee('0x17')]['message']);}else{logger[_0x68ee('0x12')](_0x68ee('0x13'),_0x173610,_0x68ee('0x14'));_0x5c101c(_0x12e530[_0x68ee('0x1a')][_0x68ee('0x19')]);}})[_0x68ee('0x1b')](function(_0x593fdf){logger[_0x68ee('0x17')](_0x68ee('0x13'),_0x173610,_0x593fdf);_0x8fc211(_0x593fdf);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 2863fad..9eebf27 100644 --- a/server/api/dashboardItem/dashboardItem.socket.js +++ b/server/api/dashboardItem/dashboardItem.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e85=['save','remove','update','removeListener','register','length','dashboardItem:'];(function(_0x2b657f,_0x2fb6b8){var _0x1f8b2f=function(_0x9ae853){while(--_0x9ae853){_0x2b657f['push'](_0x2b657f['shift']());}};_0x1f8b2f(++_0x2fb6b8);}(_0x3e85,0x8c));var _0x53e8=function(_0x49a57f,_0x405f38){_0x49a57f=_0x49a57f-0x0;var _0x2fa2a5=_0x3e85[_0x49a57f];return _0x2fa2a5;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x53e8('0x0'),_0x53e8('0x1'),_0x53e8('0x2')];function createListener(_0x210fb2,_0x3ea26f){return function(_0x988581){_0x3ea26f['emit'](_0x210fb2,_0x988581);};}function removeListener(_0x5632dc,_0x162ef1){return function(){DashboardItemEvents[_0x53e8('0x3')](_0x5632dc,_0x162ef1);};}exports[_0x53e8('0x4')]=function(_0x68fe5b){for(var _0xc33a68=0x0,_0x49041f=events[_0x53e8('0x5')];_0xc33a68<_0x49041f;_0xc33a68++){var _0x26da21=events[_0xc33a68];var _0x1a38fd=createListener(_0x53e8('0x6')+_0x26da21,_0x68fe5b);DashboardItemEvents['on'](_0x26da21,_0x1a38fd);}}; \ No newline at end of file +var _0xf6fb=['./dashboardItem.events','remove','update','emit','removeListener'];(function(_0x55ae1f,_0x20657b){var _0x35d7dd=function(_0x46fb9d){while(--_0x46fb9d){_0x55ae1f['push'](_0x55ae1f['shift']());}};_0x35d7dd(++_0x20657b);}(_0xf6fb,0x1e5));var _0xbf6f=function(_0x104c34,_0x5ebead){_0x104c34=_0x104c34-0x0;var _0x229daf=_0xf6fb[_0x104c34];return _0x229daf;};'use strict';var DashboardItemEvents=require(_0xbf6f('0x0'));var events=['save',_0xbf6f('0x1'),_0xbf6f('0x2')];function createListener(_0x332b60,_0x2bca56){return function(_0x2b5f24){_0x2bca56[_0xbf6f('0x3')](_0x332b60,_0x2b5f24);};}function removeListener(_0x3aa815,_0x1396fd){return function(){DashboardItemEvents[_0xbf6f('0x4')](_0x3aa815,_0x1396fd);};}exports['register']=function(_0x39983a){for(var _0x535b8b=0x0,_0x32246f=events['length'];_0x535b8b<_0x32246f;_0x535b8b++){var _0xd7d90=events[_0x535b8b];var _0x22db28=createListener('dashboardItem:'+_0xd7d90,_0x39983a);DashboardItemEvents['on'](_0xd7d90,_0x22db28);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 89e4793..46c43a6 100644 --- a/server/api/dashboardItem/index.js +++ b/server/api/dashboardItem/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3021=['Router','fs-extra','../../components/auth/service','../../config/environment','./dashboardItem.controller','get','/:id','show','post','delete','destroy','exports','multer','util','path'];(function(_0x22f0ac,_0x117cdc){var _0x510fc7=function(_0x5220aa){while(--_0x5220aa){_0x22f0ac['push'](_0x22f0ac['shift']());}};_0x510fc7(++_0x117cdc);}(_0x3021,0xb1));var _0x1302=function(_0x3613ce,_0x4e06a8){_0x3613ce=_0x3613ce-0x0;var _0x10a79e=_0x3021[_0x3613ce];return _0x10a79e;};'use strict';var multer=require(_0x1302('0x0'));var util=require(_0x1302('0x1'));var path=require(_0x1302('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1302('0x3')]();var fs_extra=require(_0x1302('0x4'));var auth=require(_0x1302('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1302('0x6'));var controller=require(_0x1302('0x7'));router[_0x1302('0x8')](_0x1302('0x9'),auth['isAuthenticated'](),controller[_0x1302('0xa')]);router[_0x1302('0xb')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x1302('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x1302('0xc')](_0x1302('0x9'),auth['isAuthenticated'](),controller[_0x1302('0xd')]);module[_0x1302('0xe')]=router; \ No newline at end of file +var _0xed2a=['isAuthenticated','post','create','put','update','delete','destroy','multer','connect-timeout','express','Router','fs-extra','./dashboardItem.controller','get','/:id'];(function(_0x46b7f0,_0x15c910){var _0x5a5a93=function(_0x3616d5){while(--_0x3616d5){_0x46b7f0['push'](_0x46b7f0['shift']());}};_0x5a5a93(++_0x15c910);}(_0xed2a,0xe8));var _0xaed2=function(_0x13b4b9,_0x4dbe00){_0x13b4b9=_0x13b4b9-0x0;var _0x52e40d=_0xed2a[_0x13b4b9];return _0x52e40d;};'use strict';var multer=require(_0xaed2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaed2('0x1'));var express=require(_0xaed2('0x2'));var router=express[_0xaed2('0x3')]();var fs_extra=require(_0xaed2('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xaed2('0x5'));router[_0xaed2('0x6')](_0xaed2('0x7'),auth[_0xaed2('0x8')](),controller['show']);router[_0xaed2('0x9')]('/',auth[_0xaed2('0x8')](),controller[_0xaed2('0xa')]);router[_0xaed2('0xb')]('/:id',auth[_0xaed2('0x8')](),controller[_0xaed2('0xc')]);router[_0xaed2('0xd')](_0xaed2('0x7'),auth['isAuthenticated'](),controller[_0xaed2('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 9575ed6..532765a 100644 --- a/server/api/disposition/disposition.attributes.js +++ b/server/api/disposition/disposition.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6e80=['ENUM','first','second','third','sequelize','STRING'];(function(_0x1ee62e,_0x159bb2){var _0x27c6c8=function(_0x31a5d4){while(--_0x31a5d4){_0x1ee62e['push'](_0x1ee62e['shift']());}};_0x27c6c8(++_0x159bb2);}(_0x6e80,0x64));var _0x06e8=function(_0x5e6421,_0x97f511){_0x5e6421=_0x5e6421-0x0;var _0x38d9ba=_0x6e80[_0x5e6421];return _0x38d9ba;};'use strict';var Sequelize=require(_0x06e8('0x0'));module['exports']={'name':{'type':Sequelize[_0x06e8('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0x06e8('0x2')](_0x06e8('0x3'),_0x06e8('0x4'),_0x06e8('0x5')),'allowNull':![],'defaultValue':_0x06e8('0x3')},'description':{'type':Sequelize[_0x06e8('0x1')]}}; \ No newline at end of file +var _0x04c0=['exports','STRING','ENUM','first','second','third','sequelize'];(function(_0x1ccb2d,_0x5d5c94){var _0x420124=function(_0x52f02c){while(--_0x52f02c){_0x1ccb2d['push'](_0x1ccb2d['shift']());}};_0x420124(++_0x5d5c94);}(_0x04c0,0x180));var _0x004c=function(_0x28da1f,_0x5335b6){_0x28da1f=_0x28da1f-0x0;var _0x17b914=_0x04c0[_0x28da1f];return _0x17b914;};'use strict';var Sequelize=require(_0x004c('0x0'));module[_0x004c('0x1')]={'name':{'type':Sequelize[_0x004c('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x004c('0x3')](_0x004c('0x4'),_0x004c('0x5'),_0x004c('0x6')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0x004c('0x2')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 735356d..8c7fd56 100644 --- a/server/api/disposition/disposition.controller.js +++ b/server/api/disposition/disposition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0c42=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','stack','name','send','index','map','rawAttributes','fieldName','keys','query','filters','model','attributes','intersection','length','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','Disposition','includeAll','findAll','catch','show','params','fields','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x311e78,_0xbcf8ca){var _0x44fef6=function(_0x610029){while(--_0x610029){_0x311e78['push'](_0x311e78['shift']());}};_0x44fef6(++_0xbcf8ca);}(_0x0c42,0x191));var _0x20c4=function(_0x1176fd,_0xacdb1e){_0x1176fd=_0x1176fd-0x0;var _0x10082c=_0x0c42[_0x1176fd];return _0x10082c;};'use strict';var emlformat=require(_0x20c4('0x0'));var rimraf=require(_0x20c4('0x1'));var zipdir=require(_0x20c4('0x2'));var jsonpatch=require(_0x20c4('0x3'));var rp=require(_0x20c4('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x20c4('0x5'));var util=require(_0x20c4('0x6'));var path=require(_0x20c4('0x7'));var sox=require(_0x20c4('0x8'));var csv=require(_0x20c4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x20c4('0xa'));var _=require('lodash');var squel=require(_0x20c4('0xb'));var crypto=require('crypto');var jsforce=require(_0x20c4('0xc'));var deskjs=require(_0x20c4('0xd'));var toCsv=require(_0x20c4('0x9'));var querystring=require('querystring');var Papa=require(_0x20c4('0xe'));var Redis=require(_0x20c4('0xf'));var authService=require(_0x20c4('0x10'));var qs=require(_0x20c4('0x11'));var as=require(_0x20c4('0x12'));var hardwareService=require(_0x20c4('0x13'));var logger=require(_0x20c4('0x14'))(_0x20c4('0x15'));var utils=require(_0x20c4('0x16'));var config=require(_0x20c4('0x17'));var licenseUtil=require(_0x20c4('0x18'));var db=require(_0x20c4('0x19'))['db'];function respondWithStatusCode(_0x188060,_0x506e63){_0x506e63=_0x506e63||0xcc;return function(_0x430c10){if(_0x430c10){return _0x188060['sendStatus'](_0x506e63);}return _0x188060[_0x20c4('0x1a')](_0x506e63)[_0x20c4('0x1b')]();};}function respondWithResult(_0x59f54f,_0x1e1327){_0x1e1327=_0x1e1327||0xc8;return function(_0x4c6dae){if(_0x4c6dae){return _0x59f54f[_0x20c4('0x1a')](_0x1e1327)[_0x20c4('0x1c')](_0x4c6dae);}};}function respondWithFilteredResult(_0x30831a,_0x55a517){return function(_0x1d7e48){if(_0x1d7e48){var _0x25b671=typeof _0x55a517[_0x20c4('0x1d')]===_0x20c4('0x1e')&&typeof _0x55a517[_0x20c4('0x1f')]===_0x20c4('0x1e');var _0x2f79a0=_0x1d7e48[_0x20c4('0x20')];var _0x3f9b92=_0x25b671?0x0:_0x55a517[_0x20c4('0x1d')];var _0xda61dc=_0x25b671?_0x1d7e48['count']:_0x55a517['offset']+_0x55a517[_0x20c4('0x1f')];var _0x59c65d;if(_0xda61dc>=_0x2f79a0){_0xda61dc=_0x2f79a0;_0x59c65d=0xc8;}else{_0x59c65d=0xce;}_0x30831a[_0x20c4('0x1a')](_0x59c65d);return _0x30831a[_0x20c4('0x21')](_0x20c4('0x22'),_0x3f9b92+'-'+_0xda61dc+'/'+_0x2f79a0)[_0x20c4('0x1c')](_0x1d7e48);}return null;};}function patchUpdates(_0x28ba0a){return function(_0x47071e){try{jsonpatch[_0x20c4('0x23')](_0x47071e,_0x28ba0a,!![]);}catch(_0x3fa1a5){return BPromise[_0x20c4('0x24')](_0x3fa1a5);}return _0x47071e[_0x20c4('0x25')]();};}function saveUpdates(_0xf2c4f4,_0xf499ad){return function(_0xbe436d){if(_0xbe436d){return _0xbe436d[_0x20c4('0x26')](_0xf2c4f4)[_0x20c4('0x27')](function(_0x14d2d8){return _0x14d2d8;});}return null;};}function removeEntity(_0x442ffd,_0x287753){return function(_0x20e812){if(_0x20e812){return _0x20e812[_0x20c4('0x28')]()[_0x20c4('0x27')](function(){var _0x135f06=_0x20e812[_0x20c4('0x29')]({'plain':!![]});var _0x7c7d69='Dispositions';return db['UserProfileResource'][_0x20c4('0x28')]({'where':{'type':_0x7c7d69,'resourceId':_0x135f06['id']}})[_0x20c4('0x27')](function(){return _0x20e812;});})['then'](function(){_0x442ffd[_0x20c4('0x1a')](0xcc)[_0x20c4('0x1b')]();});}};}function handleEntityNotFound(_0x5bc23a,_0x18fb67){return function(_0x12e4f5){if(!_0x12e4f5){_0x5bc23a['sendStatus'](0x194);}return _0x12e4f5;};}function handleError(_0x5592dd,_0x490034){_0x490034=_0x490034||0x1f4;return function(_0x19907c){logger['error'](_0x19907c[_0x20c4('0x2a')]);if(_0x19907c[_0x20c4('0x2b')]){delete _0x19907c[_0x20c4('0x2b')];}_0x5592dd[_0x20c4('0x1a')](_0x490034)[_0x20c4('0x2c')](_0x19907c);};}exports[_0x20c4('0x2d')]=function(_0x57c41d,_0x4916bb){var _0x2045ac={},_0x1673ff={},_0x2b6f72={'count':0x0,'rows':[]};var _0x2f4a51=_[_0x20c4('0x2e')](db['Disposition'][_0x20c4('0x2f')],function(_0x48a01f){return{'name':_0x48a01f[_0x20c4('0x30')],'type':_0x48a01f['type']['key']};});_0x1673ff['model']=_['map'](_0x2f4a51,_0x20c4('0x2b'));_0x1673ff['query']=_[_0x20c4('0x31')](_0x57c41d[_0x20c4('0x32')]);_0x1673ff[_0x20c4('0x33')]=_['intersection'](_0x1673ff[_0x20c4('0x34')],_0x1673ff[_0x20c4('0x32')]);_0x2045ac[_0x20c4('0x35')]=_[_0x20c4('0x36')](_0x1673ff[_0x20c4('0x34')],qs['fields'](_0x57c41d['query']['fields']));_0x2045ac['attributes']=_0x2045ac[_0x20c4('0x35')][_0x20c4('0x37')]?_0x2045ac[_0x20c4('0x35')]:_0x1673ff[_0x20c4('0x34')];if(!_0x57c41d[_0x20c4('0x32')]['hasOwnProperty'](_0x20c4('0x38'))){_0x2045ac['limit']=qs['limit'](_0x57c41d['query'][_0x20c4('0x1f')]);_0x2045ac[_0x20c4('0x1d')]=qs[_0x20c4('0x1d')](_0x57c41d[_0x20c4('0x32')][_0x20c4('0x1d')]);}_0x2045ac['order']=qs[_0x20c4('0x39')](_0x57c41d[_0x20c4('0x32')][_0x20c4('0x39')]);_0x2045ac[_0x20c4('0x3a')]=qs[_0x20c4('0x33')](_[_0x20c4('0x3b')](_0x57c41d[_0x20c4('0x32')],_0x1673ff[_0x20c4('0x33')]),_0x2f4a51);if(_0x57c41d[_0x20c4('0x32')][_0x20c4('0x3c')]){_0x2045ac[_0x20c4('0x3a')]=_['merge'](_0x2045ac[_0x20c4('0x3a')],{'$or':_['map'](_0x2f4a51,function(_0x191b22){if(_0x191b22[_0x20c4('0x3d')]!==_0x20c4('0x3e')){var _0xd3ab6a={};_0xd3ab6a[_0x191b22[_0x20c4('0x2b')]]={'$like':'%'+_0x57c41d[_0x20c4('0x32')][_0x20c4('0x3c')]+'%'};return _0xd3ab6a;}})});}_0x2045ac=_[_0x20c4('0x3f')]({},_0x2045ac,_0x57c41d[_0x20c4('0x40')]);var _0x504320={'where':_0x2045ac[_0x20c4('0x3a')]};return db[_0x20c4('0x41')]['count'](_0x504320)[_0x20c4('0x27')](function(_0x4c7f61){_0x2b6f72[_0x20c4('0x20')]=_0x4c7f61;if(_0x57c41d['query'][_0x20c4('0x42')]){_0x2045ac['include']=[{'all':!![]}];}return db[_0x20c4('0x41')][_0x20c4('0x43')](_0x2045ac);})[_0x20c4('0x27')](function(_0x5676f4){_0x2b6f72['rows']=_0x5676f4;return _0x2b6f72;})['then'](respondWithFilteredResult(_0x4916bb,_0x2045ac))[_0x20c4('0x44')](handleError(_0x4916bb,null));};exports[_0x20c4('0x45')]=function(_0xbc1700,_0xe03cbd){var _0x252e9f={'raw':!![],'where':{'id':_0xbc1700[_0x20c4('0x46')]['id']}},_0xdb39bc={};_0xdb39bc[_0x20c4('0x34')]=_[_0x20c4('0x31')](db[_0x20c4('0x41')][_0x20c4('0x2f')]);_0xdb39bc[_0x20c4('0x32')]=_[_0x20c4('0x31')](_0xbc1700['query']);_0xdb39bc[_0x20c4('0x33')]=_[_0x20c4('0x36')](_0xdb39bc['model'],_0xdb39bc[_0x20c4('0x32')]);_0x252e9f[_0x20c4('0x35')]=_[_0x20c4('0x36')](_0xdb39bc[_0x20c4('0x34')],qs[_0x20c4('0x47')](_0xbc1700[_0x20c4('0x32')]['fields']));_0x252e9f[_0x20c4('0x35')]=_0x252e9f[_0x20c4('0x35')][_0x20c4('0x37')]?_0x252e9f[_0x20c4('0x35')]:_0xdb39bc[_0x20c4('0x34')];if(_0xbc1700[_0x20c4('0x32')][_0x20c4('0x42')]){_0x252e9f[_0x20c4('0x48')]=[{'all':!![]}];}_0x252e9f=_[_0x20c4('0x3f')]({},_0x252e9f,_0xbc1700['options']);return db[_0x20c4('0x41')][_0x20c4('0x49')](_0x252e9f)[_0x20c4('0x27')](handleEntityNotFound(_0xe03cbd,null))[_0x20c4('0x27')](respondWithResult(_0xe03cbd,null))[_0x20c4('0x44')](handleError(_0xe03cbd,null));};exports['create']=function(_0x227fd3,_0x5908eb){return db[_0x20c4('0x41')][_0x20c4('0x4a')](_0x227fd3[_0x20c4('0x4b')],{})['then'](function(_0x39de8f){var _0x2289e0=_0x227fd3[_0x20c4('0x4c')][_0x20c4('0x29')]({'plain':!![]});if(!_0x2289e0)throw new Error(_0x20c4('0x4d'));if(_0x2289e0[_0x20c4('0x4e')]==='user'){var _0x12b420=_0x39de8f[_0x20c4('0x29')]({'plain':!![]});var _0x42c488='Dispositions';return db[_0x20c4('0x4f')][_0x20c4('0x49')]({'where':{'name':_0x42c488,'userProfileId':_0x2289e0[_0x20c4('0x50')]},'raw':!![]})[_0x20c4('0x27')](function(_0x4c7074){if(_0x4c7074&&_0x4c7074['autoAssociation']===0x0){return db[_0x20c4('0x51')][_0x20c4('0x4a')]({'name':_0x12b420[_0x20c4('0x2b')],'resourceId':_0x12b420['id'],'type':_0x4c7074[_0x20c4('0x2b')],'sectionId':_0x4c7074['id']},{})['then'](function(){return _0x39de8f;});}else{return _0x39de8f;}})[_0x20c4('0x44')](function(_0x195ad7){logger[_0x20c4('0x52')](_0x20c4('0x53'),_0x195ad7);throw _0x195ad7;});}return _0x39de8f;})[_0x20c4('0x27')](respondWithResult(_0x5908eb,0xc9))[_0x20c4('0x44')](handleError(_0x5908eb,null));};exports[_0x20c4('0x26')]=function(_0x50b4b1,_0x4ef3cc){if(_0x50b4b1[_0x20c4('0x4b')]['id']){delete _0x50b4b1[_0x20c4('0x4b')]['id'];}return db[_0x20c4('0x41')]['find']({'where':{'id':_0x50b4b1[_0x20c4('0x46')]['id']}})[_0x20c4('0x27')](handleEntityNotFound(_0x4ef3cc,null))['then'](saveUpdates(_0x50b4b1[_0x20c4('0x4b')],null))[_0x20c4('0x27')](respondWithResult(_0x4ef3cc,null))['catch'](handleError(_0x4ef3cc,null));};exports[_0x20c4('0x28')]=function(_0x3a1174,_0xbc2769){return db[_0x20c4('0x41')]['find']({'where':{'id':_0x3a1174[_0x20c4('0x46')]['id']}})[_0x20c4('0x27')](handleEntityNotFound(_0xbc2769,null))[_0x20c4('0x27')](removeEntity(_0xbc2769,null))[_0x20c4('0x44')](handleError(_0xbc2769,null));}; \ No newline at end of file +var _0x43ce=['index','map','rawAttributes','fieldName','type','key','filters','intersection','attributes','model','query','fields','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','filter','Disposition','include','findAll','rows','catch','keys','length','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','Content-Range','apply','update','then','destroy','get','Dispositions','UserProfileResource','error','stack','name','send'];(function(_0x4af4c2,_0xe35f18){var _0x48c8ac=function(_0x3fe536){while(--_0x3fe536){_0x4af4c2['push'](_0x4af4c2['shift']());}};_0x48c8ac(++_0xe35f18);}(_0x43ce,0x16a));var _0xe43c=function(_0x36062c,_0xdad0e1){_0x36062c=_0x36062c-0x0;var _0x11e928=_0x43ce[_0x36062c];return _0x11e928;};'use strict';var emlformat=require(_0xe43c('0x0'));var rimraf=require(_0xe43c('0x1'));var zipdir=require(_0xe43c('0x2'));var jsonpatch=require(_0xe43c('0x3'));var rp=require(_0xe43c('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe43c('0x5'));var util=require(_0xe43c('0x6'));var path=require(_0xe43c('0x7'));var sox=require('sox');var csv=require(_0xe43c('0x8'));var ejs=require(_0xe43c('0x9'));var fs=require('fs');var fs_extra=require(_0xe43c('0xa'));var _=require('lodash');var squel=require(_0xe43c('0xb'));var crypto=require(_0xe43c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe43c('0xd'));var toCsv=require(_0xe43c('0x8'));var querystring=require(_0xe43c('0xe'));var Papa=require('papaparse');var Redis=require(_0xe43c('0xf'));var authService=require(_0xe43c('0x10'));var qs=require(_0xe43c('0x11'));var as=require(_0xe43c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe43c('0x13'));var utils=require(_0xe43c('0x14'));var config=require(_0xe43c('0x15'));var licenseUtil=require(_0xe43c('0x16'));var db=require(_0xe43c('0x17'))['db'];function respondWithStatusCode(_0x2b3f5a,_0x5aa1e5){_0x5aa1e5=_0x5aa1e5||0xcc;return function(_0x2d8657){if(_0x2d8657){return _0x2b3f5a['sendStatus'](_0x5aa1e5);}return _0x2b3f5a[_0xe43c('0x18')](_0x5aa1e5)[_0xe43c('0x19')]();};}function respondWithResult(_0xc15657,_0x3b6b78){_0x3b6b78=_0x3b6b78||0xc8;return function(_0x27f0ba){if(_0x27f0ba){return _0xc15657[_0xe43c('0x18')](_0x3b6b78)[_0xe43c('0x1a')](_0x27f0ba);}};}function respondWithFilteredResult(_0x4634cb,_0xdf5863){return function(_0xe1db68){if(_0xe1db68){var _0x543773=typeof _0xdf5863['offset']===_0xe43c('0x1b')&&typeof _0xdf5863[_0xe43c('0x1c')]===_0xe43c('0x1b');var _0x1f9211=_0xe1db68[_0xe43c('0x1d')];var _0x5cd565=_0x543773?0x0:_0xdf5863[_0xe43c('0x1e')];var _0x1f96db=_0x543773?_0xe1db68[_0xe43c('0x1d')]:_0xdf5863['offset']+_0xdf5863[_0xe43c('0x1c')];var _0xc12b7;if(_0x1f96db>=_0x1f9211){_0x1f96db=_0x1f9211;_0xc12b7=0xc8;}else{_0xc12b7=0xce;}_0x4634cb['status'](_0xc12b7);return _0x4634cb['set'](_0xe43c('0x1f'),_0x5cd565+'-'+_0x1f96db+'/'+_0x1f9211)[_0xe43c('0x1a')](_0xe1db68);}return null;};}function patchUpdates(_0x30f213){return function(_0x289b97){try{jsonpatch[_0xe43c('0x20')](_0x289b97,_0x30f213,!![]);}catch(_0xfc1556){return BPromise['reject'](_0xfc1556);}return _0x289b97['save']();};}function saveUpdates(_0x2fba25,_0x4559c7){return function(_0x1d203f){if(_0x1d203f){return _0x1d203f[_0xe43c('0x21')](_0x2fba25)[_0xe43c('0x22')](function(_0x14b2dd){return _0x14b2dd;});}return null;};}function removeEntity(_0x2f9226,_0x26e622){return function(_0x35ddea){if(_0x35ddea){return _0x35ddea[_0xe43c('0x23')]()[_0xe43c('0x22')](function(){var _0x2daac4=_0x35ddea[_0xe43c('0x24')]({'plain':!![]});var _0x3b982c=_0xe43c('0x25');return db[_0xe43c('0x26')][_0xe43c('0x23')]({'where':{'type':_0x3b982c,'resourceId':_0x2daac4['id']}})[_0xe43c('0x22')](function(){return _0x35ddea;});})[_0xe43c('0x22')](function(){_0x2f9226[_0xe43c('0x18')](0xcc)[_0xe43c('0x19')]();});}};}function handleEntityNotFound(_0x30abd1,_0x1340cf){return function(_0x4c2acc){if(!_0x4c2acc){_0x30abd1['sendStatus'](0x194);}return _0x4c2acc;};}function handleError(_0x28db2b,_0x4043da){_0x4043da=_0x4043da||0x1f4;return function(_0x50e57b){logger[_0xe43c('0x27')](_0x50e57b[_0xe43c('0x28')]);if(_0x50e57b[_0xe43c('0x29')]){delete _0x50e57b[_0xe43c('0x29')];}_0x28db2b['status'](_0x4043da)[_0xe43c('0x2a')](_0x50e57b);};}exports[_0xe43c('0x2b')]=function(_0x12d1a7,_0x2ed097){var _0x3f1a30={},_0x1f2707={},_0x4165ae={'count':0x0,'rows':[]};var _0x55b153=_[_0xe43c('0x2c')](db['Disposition'][_0xe43c('0x2d')],function(_0x2d6bb6){return{'name':_0x2d6bb6[_0xe43c('0x2e')],'type':_0x2d6bb6[_0xe43c('0x2f')][_0xe43c('0x30')]};});_0x1f2707['model']=_[_0xe43c('0x2c')](_0x55b153,_0xe43c('0x29'));_0x1f2707['query']=_['keys'](_0x12d1a7['query']);_0x1f2707[_0xe43c('0x31')]=_[_0xe43c('0x32')](_0x1f2707['model'],_0x1f2707['query']);_0x3f1a30[_0xe43c('0x33')]=_['intersection'](_0x1f2707[_0xe43c('0x34')],qs['fields'](_0x12d1a7[_0xe43c('0x35')][_0xe43c('0x36')]));_0x3f1a30['attributes']=_0x3f1a30['attributes']['length']?_0x3f1a30[_0xe43c('0x33')]:_0x1f2707[_0xe43c('0x34')];if(!_0x12d1a7[_0xe43c('0x35')][_0xe43c('0x37')](_0xe43c('0x38'))){_0x3f1a30[_0xe43c('0x1c')]=qs[_0xe43c('0x1c')](_0x12d1a7[_0xe43c('0x35')]['limit']);_0x3f1a30[_0xe43c('0x1e')]=qs[_0xe43c('0x1e')](_0x12d1a7[_0xe43c('0x35')]['offset']);}_0x3f1a30['order']=qs[_0xe43c('0x39')](_0x12d1a7[_0xe43c('0x35')]['sort']);_0x3f1a30['where']=qs[_0xe43c('0x31')](_[_0xe43c('0x3a')](_0x12d1a7[_0xe43c('0x35')],_0x1f2707[_0xe43c('0x31')]),_0x55b153);if(_0x12d1a7[_0xe43c('0x35')]['filter']){_0x3f1a30[_0xe43c('0x3b')]=_[_0xe43c('0x3c')](_0x3f1a30['where'],{'$or':_[_0xe43c('0x2c')](_0x55b153,function(_0x51f0b3){if(_0x51f0b3[_0xe43c('0x2f')]!==_0xe43c('0x3d')){var _0x30d18d={};_0x30d18d[_0x51f0b3[_0xe43c('0x29')]]={'$like':'%'+_0x12d1a7[_0xe43c('0x35')][_0xe43c('0x3e')]+'%'};return _0x30d18d;}})});}_0x3f1a30=_['merge']({},_0x3f1a30,_0x12d1a7['options']);var _0x192227={'where':_0x3f1a30['where']};return db[_0xe43c('0x3f')]['count'](_0x192227)[_0xe43c('0x22')](function(_0x404e70){_0x4165ae['count']=_0x404e70;if(_0x12d1a7[_0xe43c('0x35')]['includeAll']){_0x3f1a30[_0xe43c('0x40')]=[{'all':!![]}];}return db['Disposition'][_0xe43c('0x41')](_0x3f1a30);})[_0xe43c('0x22')](function(_0x33afbe){_0x4165ae[_0xe43c('0x42')]=_0x33afbe;return _0x4165ae;})[_0xe43c('0x22')](respondWithFilteredResult(_0x2ed097,_0x3f1a30))[_0xe43c('0x43')](handleError(_0x2ed097,null));};exports['show']=function(_0x142302,_0x4510cb){var _0x36d857={'raw':!![],'where':{'id':_0x142302['params']['id']}},_0x248e5f={};_0x248e5f[_0xe43c('0x34')]=_[_0xe43c('0x44')](db[_0xe43c('0x3f')][_0xe43c('0x2d')]);_0x248e5f['query']=_[_0xe43c('0x44')](_0x142302[_0xe43c('0x35')]);_0x248e5f[_0xe43c('0x31')]=_[_0xe43c('0x32')](_0x248e5f['model'],_0x248e5f[_0xe43c('0x35')]);_0x36d857[_0xe43c('0x33')]=_[_0xe43c('0x32')](_0x248e5f[_0xe43c('0x34')],qs[_0xe43c('0x36')](_0x142302['query']['fields']));_0x36d857[_0xe43c('0x33')]=_0x36d857[_0xe43c('0x33')][_0xe43c('0x45')]?_0x36d857[_0xe43c('0x33')]:_0x248e5f[_0xe43c('0x34')];if(_0x142302[_0xe43c('0x35')]['includeAll']){_0x36d857[_0xe43c('0x40')]=[{'all':!![]}];}_0x36d857=_[_0xe43c('0x3c')]({},_0x36d857,_0x142302[_0xe43c('0x46')]);return db[_0xe43c('0x3f')][_0xe43c('0x47')](_0x36d857)[_0xe43c('0x22')](handleEntityNotFound(_0x4510cb,null))['then'](respondWithResult(_0x4510cb,null))[_0xe43c('0x43')](handleError(_0x4510cb,null));};exports[_0xe43c('0x48')]=function(_0x3da6e0,_0xda323){return db[_0xe43c('0x3f')]['create'](_0x3da6e0['body'],{})[_0xe43c('0x22')](function(_0x45fa81){var _0x1e87df=_0x3da6e0[_0xe43c('0x49')][_0xe43c('0x24')]({'plain':!![]});if(!_0x1e87df)throw new Error(_0xe43c('0x4a'));if(_0x1e87df['role']===_0xe43c('0x49')){var _0x2a11dc=_0x45fa81['get']({'plain':!![]});var _0x3897c8=_0xe43c('0x25');return db[_0xe43c('0x4b')][_0xe43c('0x47')]({'where':{'name':_0x3897c8,'userProfileId':_0x1e87df[_0xe43c('0x4c')]},'raw':!![]})[_0xe43c('0x22')](function(_0x540fec){if(_0x540fec&&_0x540fec[_0xe43c('0x4d')]===0x0){return db[_0xe43c('0x26')]['create']({'name':_0x2a11dc[_0xe43c('0x29')],'resourceId':_0x2a11dc['id'],'type':_0x540fec[_0xe43c('0x29')],'sectionId':_0x540fec['id']},{})[_0xe43c('0x22')](function(){return _0x45fa81;});}else{return _0x45fa81;}})['catch'](function(_0x4d8c40){logger['error'](_0xe43c('0x4e'),_0x4d8c40);throw _0x4d8c40;});}return _0x45fa81;})[_0xe43c('0x22')](respondWithResult(_0xda323,0xc9))[_0xe43c('0x43')](handleError(_0xda323,null));};exports[_0xe43c('0x21')]=function(_0xd40610,_0x2856cf){if(_0xd40610[_0xe43c('0x4f')]['id']){delete _0xd40610[_0xe43c('0x4f')]['id'];}return db['Disposition']['find']({'where':{'id':_0xd40610[_0xe43c('0x50')]['id']}})[_0xe43c('0x22')](handleEntityNotFound(_0x2856cf,null))['then'](saveUpdates(_0xd40610['body'],null))[_0xe43c('0x22')](respondWithResult(_0x2856cf,null))[_0xe43c('0x43')](handleError(_0x2856cf,null));};exports['destroy']=function(_0x4e455d,_0x2bb856){return db[_0xe43c('0x3f')]['find']({'where':{'id':_0x4e455d[_0xe43c('0x50')]['id']}})[_0xe43c('0x22')](handleEntityNotFound(_0x2bb856,null))[_0xe43c('0x22')](removeEntity(_0x2bb856,null))[_0xe43c('0x43')](handleError(_0x2bb856,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 80616ee..6a004eb 100644 --- a/server/api/disposition/disposition.model.js +++ b/server/api/disposition/disposition.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9704=['name_voice','name','ChatWebsiteId','name_mail','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','lodash','util','moment','request-promise','path','./disposition.attributes','define','Disposition','tools_dispositions'];(function(_0x11b00e,_0x136181){var _0x382ae4=function(_0x1ff932){while(--_0x1ff932){_0x11b00e['push'](_0x11b00e['shift']());}};_0x382ae4(++_0x136181);}(_0x9704,0x1dd));var _0x4970=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9704[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4970('0x0'));var util=require(_0x4970('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4970('0x2'));var BPromise=require('bluebird');var rp=require(_0x4970('0x3'));var fs=require('fs');var path=require(_0x4970('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4970('0x5'));module['exports']=function(_0x2527ae,_0x4d56ba){return _0x2527ae[_0x4970('0x6')](_0x4970('0x7'),attributes,{'tableName':_0x4970('0x8'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x4970('0x9'),'fields':[_0x4970('0xa'),'ListId']},{'unique':!![],'name':'name_chat','fields':[_0x4970('0xa'),_0x4970('0xb')]},{'unique':!![],'name':_0x4970('0xc'),'fields':['name','MailAccountId']},{'unique':!![],'name':'name_sms','fields':[_0x4970('0xa'),_0x4970('0xd')]},{'unique':!![],'name':_0x4970('0xe'),'fields':['name',_0x4970('0xf')]},{'unique':!![],'name':_0x4970('0x10'),'fields':[_0x4970('0xa'),_0x4970('0x11')]},{'unique':!![],'name':'name_whatsapp','fields':[_0x4970('0xa'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xec02=['name_whatsapp','WhatsappAccountId','lodash','util','moment','bluebird','request-promise','path','../../config/environment','./disposition.attributes','exports','define','Disposition','name_voice','name','ListId','name_chat','ChatWebsiteId','MailAccountId','name_sms','SmsAccountId','name_fax','OpenchannelAccountId'];(function(_0x2bc1fe,_0x45da98){var _0x1a47a5=function(_0x2e5053){while(--_0x2e5053){_0x2bc1fe['push'](_0x2bc1fe['shift']());}};_0x1a47a5(++_0x45da98);}(_0xec02,0x12d));var _0x2ec0=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xec02[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x2ec0('0x0'));var util=require(_0x2ec0('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2ec0('0x2'));var BPromise=require(_0x2ec0('0x3'));var rp=require(_0x2ec0('0x4'));var fs=require('fs');var path=require(_0x2ec0('0x5'));var rimraf=require('rimraf');var config=require(_0x2ec0('0x6'));var attributes=require(_0x2ec0('0x7'));module[_0x2ec0('0x8')]=function(_0x3c9aa4,_0x22c276){return _0x3c9aa4[_0x2ec0('0x9')](_0x2ec0('0xa'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x2ec0('0xb'),'fields':[_0x2ec0('0xc'),_0x2ec0('0xd')]},{'unique':!![],'name':_0x2ec0('0xe'),'fields':[_0x2ec0('0xc'),_0x2ec0('0xf')]},{'unique':!![],'name':'name_mail','fields':[_0x2ec0('0xc'),_0x2ec0('0x10')]},{'unique':!![],'name':_0x2ec0('0x11'),'fields':[_0x2ec0('0xc'),_0x2ec0('0x12')]},{'unique':!![],'name':_0x2ec0('0x13'),'fields':[_0x2ec0('0xc'),'FaxAccountId']},{'unique':!![],'name':'name_openchannel','fields':[_0x2ec0('0xc'),_0x2ec0('0x14')]},{'unique':!![],'name':_0x2ec0('0x15'),'fields':[_0x2ec0('0xc'),_0x2ec0('0x16')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 99e28a2..f24f7d9 100644 --- a/server/api/disposition/disposition.rpc.js +++ b/server/api/disposition/disposition.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x241c70,_0x400b46){var _0x9163f8=function(_0x1d44b0){while(--_0x1d44b0){_0x241c70['push'](_0x241c70['shift']());}};_0x9163f8(++_0x400b46);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x542077,_0x2406b3){var _0xe01183=function(_0x2dd1fa){while(--_0x2dd1fa){_0x542077['push'](_0x542077['shift']());}};_0xe01183(++_0x2406b3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 7c549aa..4526885 100644 --- a/server/api/disposition/index.js +++ b/server/api/disposition/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc71d=['show','post','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./disposition.controller','get','isAuthenticated','/:id'];(function(_0x2ebb74,_0x37f6f5){var _0x364e27=function(_0x36ae8a){while(--_0x36ae8a){_0x2ebb74['push'](_0x2ebb74['shift']());}};_0x364e27(++_0x37f6f5);}(_0xc71d,0x1ec));var _0xdc71=function(_0xbbfe59,_0x46067f){_0xbbfe59=_0xbbfe59-0x0;var _0x28a2a4=_0xc71d[_0xbbfe59];return _0x28a2a4;};'use strict';var multer=require(_0xdc71('0x0'));var util=require(_0xdc71('0x1'));var path=require(_0xdc71('0x2'));var timeout=require(_0xdc71('0x3'));var express=require(_0xdc71('0x4'));var router=express['Router']();var fs_extra=require(_0xdc71('0x5'));var auth=require(_0xdc71('0x6'));var interaction=require(_0xdc71('0x7'));var config=require('../../config/environment');var controller=require(_0xdc71('0x8'));router[_0xdc71('0x9')]('/',auth[_0xdc71('0xa')](),controller['index']);router[_0xdc71('0x9')](_0xdc71('0xb'),auth[_0xdc71('0xa')](),controller[_0xdc71('0xc')]);router[_0xdc71('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xdc71('0xe')](_0xdc71('0xb'),auth[_0xdc71('0xa')](),controller[_0xdc71('0xf')]);router[_0xdc71('0x10')](_0xdc71('0xb'),auth[_0xdc71('0xa')](),controller['destroy']);module[_0xdc71('0x11')]=router; \ No newline at end of file +var _0x50f5=['../../config/environment','./disposition.controller','get','isAuthenticated','/:id','post','create','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x17b3aa,_0x53ff4f){var _0x41702f=function(_0x1940d8){while(--_0x1940d8){_0x17b3aa['push'](_0x17b3aa['shift']());}};_0x41702f(++_0x53ff4f);}(_0x50f5,0xe6));var _0x550f=function(_0x3cd3fd,_0x55d090){_0x3cd3fd=_0x3cd3fd-0x0;var _0x14208c=_0x50f5[_0x3cd3fd];return _0x14208c;};'use strict';var multer=require(_0x550f('0x0'));var util=require(_0x550f('0x1'));var path=require(_0x550f('0x2'));var timeout=require(_0x550f('0x3'));var express=require(_0x550f('0x4'));var router=express['Router']();var fs_extra=require(_0x550f('0x5'));var auth=require(_0x550f('0x6'));var interaction=require(_0x550f('0x7'));var config=require(_0x550f('0x8'));var controller=require(_0x550f('0x9'));router[_0x550f('0xa')]('/',auth[_0x550f('0xb')](),controller['index']);router[_0x550f('0xa')](_0x550f('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x550f('0xd')]('/',auth['isAuthenticated'](),controller[_0x550f('0xe')]);router['put'](_0x550f('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x550f('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x550f('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 7a54ab5..8f95f6b 100644 --- a/server/api/faxAccount/faxAccount.attributes.js +++ b/server/api/faxAccount/faxAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ace=['14400','v17,v27,v29','SIP','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','9600','12000','7200'];(function(_0xe0f0c9,_0x38bffc){var _0x68191d=function(_0x2aacc3){while(--_0x2aacc3){_0xe0f0c9['push'](_0xe0f0c9['shift']());}};_0x68191d(++_0x38bffc);}(_0x8ace,0x1bc));var _0xe8ac=function(_0xbf8ec1,_0x9169c8){_0xbf8ec1=_0xbf8ec1-0x0;var _0xc84567=_0x8ace[_0xbf8ec1];return _0xc84567;};'use strict';var Sequelize=require(_0xe8ac('0x0'));module[_0xe8ac('0x1')]={'name':{'type':Sequelize[_0xe8ac('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe8ac('0x2')]},'ecm':{'type':Sequelize[_0xe8ac('0x3')](_0xe8ac('0x4'),'no'),'defaultValue':_0xe8ac('0x4')},'headerinfo':{'type':Sequelize[_0xe8ac('0x2')],'defaultValue':_0xe8ac('0x5')},'localstationid':{'type':Sequelize[_0xe8ac('0x2')],'unique':_0xe8ac('0x6')},'minrate':{'type':Sequelize[_0xe8ac('0x3')](_0xe8ac('0x7'),_0xe8ac('0x8'),'7200',_0xe8ac('0x9'),_0xe8ac('0xa'),'14400'),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0xe8ac('0x3')]('2400',_0xe8ac('0x8'),_0xe8ac('0xb'),_0xe8ac('0x9'),_0xe8ac('0xa'),_0xe8ac('0xc')),'defaultValue':_0xe8ac('0xc')},'modem':{'type':Sequelize['STRING'],'defaultValue':_0xe8ac('0xd')},'gateway':{'type':Sequelize[_0xe8ac('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xe8ac('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xe8ac('0x3')](_0xe8ac('0xe'),'IAX',_0xe8ac('0xf'),_0xe8ac('0x10')),'defaultValue':_0xe8ac('0xe')},'key':{'type':Sequelize[_0xe8ac('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xe8ac('0x11')],'defaultValue':function(){return _0xe8ac('0x12');}},'notificationSound':{'type':Sequelize[_0xe8ac('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe8ac('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe8ac('0x14')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xe8ac('0x14')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe8ac('0x14')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe8ac('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe8ac('0x14')],'allowNull':!![],'defaultValue':null,'comment':_0xe8ac('0x15')},'mandatoryDisposition':{'type':Sequelize[_0xe8ac('0x13')],'defaultValue':![],'comment':_0xe8ac('0x16'),'set':function(_0x25d219){if(!_0x25d219)this[_0xe8ac('0x17')]('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0x25d219);}}}; \ No newline at end of file +var _0x02a7=['DADHI','KHOMP','TEXT','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','exports','ENUM','yes','STRING','xCALLY\x20Motion\x20Fax','localstationid','2400','7200','9600','12000','14400','4800','v17,v27,v29','INTEGER','SIP','IAX'];(function(_0x3bc298,_0x583d14){var _0x31bf58=function(_0x24563b){while(--_0x24563b){_0x3bc298['push'](_0x3bc298['shift']());}};_0x31bf58(++_0x583d14);}(_0x02a7,0x7a));var _0x702a=function(_0x3de1bb,_0x51d345){_0x3de1bb=_0x3de1bb-0x0;var _0x3f580f=_0x02a7[_0x3de1bb];return _0x3f580f;};'use strict';var Sequelize=require('sequelize');module[_0x702a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x702a('0x1')](_0x702a('0x2'),'no'),'defaultValue':_0x702a('0x2')},'headerinfo':{'type':Sequelize[_0x702a('0x3')],'defaultValue':_0x702a('0x4')},'localstationid':{'type':Sequelize[_0x702a('0x3')],'unique':_0x702a('0x5')},'minrate':{'type':Sequelize['ENUM'](_0x702a('0x6'),'4800',_0x702a('0x7'),_0x702a('0x8'),_0x702a('0x9'),_0x702a('0xa')),'defaultValue':_0x702a('0xb')},'maxrate':{'type':Sequelize[_0x702a('0x1')](_0x702a('0x6'),'4800',_0x702a('0x7'),'9600','12000',_0x702a('0xa')),'defaultValue':_0x702a('0xa')},'modem':{'type':Sequelize[_0x702a('0x3')],'defaultValue':_0x702a('0xc')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x702a('0x3')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x702a('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x702a('0x1')](_0x702a('0xe'),_0x702a('0xf'),_0x702a('0x10'),_0x702a('0x11')),'defaultValue':'SIP'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x702a('0x12')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x702a('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x702a('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x702a('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x702a('0x13')],'defaultValue':![],'comment':_0x702a('0x14'),'set':function(_0x2fd0e0){if(!_0x2fd0e0)this['setDataValue'](_0x702a('0x15'),null);this['setDataValue'](_0x702a('0x16'),_0x2fd0e0);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index c49f6b6..18c6579 100644 --- a/server/api/faxAccount/faxAccount.controller.js +++ b/server/api/faxAccount/faxAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa338=['options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','addDisposition','FaxAccountId','Disposition','getDispositions','length','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','Owner','fullname','Tags','color','tag','sequelize','Transaction','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','context','from-voip-provider','exten','localstationid','app','system','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','maxrate','minrate','t38timeout','Wait','ReceiveFax','transaction','VoiceExtension','updateAccountApplications','tech','createdAt','ListId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','Contacts','DESC','attachments','join','basename','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','List','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','then','info','request\x20sent','debug','stringify','error','FaxAccount,\x20%s,\x20%s','message','catch','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','reject','update','get','FaxAccounts','UserProfileResource','stack','name','send','index','Pause','FaxAccount','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','pick','where','type','VIRTUAL','filter','merge','includeAll','findAll','rows','show','params','mandatoryDispositionPause','include'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xa338,0x126));var _0x8a33=function(_0x220ff7,_0x47fe4e){_0x220ff7=_0x220ff7-0x0;var _0x4caa66=_0xa338[_0x220ff7];return _0x4caa66;};'use strict';var emlformat=require(_0x8a33('0x0'));var rimraf=require(_0x8a33('0x1'));var zipdir=require(_0x8a33('0x2'));var jsonpatch=require(_0x8a33('0x3'));var rp=require('request-promise');var moment=require(_0x8a33('0x4'));var BPromise=require(_0x8a33('0x5'));var Mustache=require(_0x8a33('0x6'));var util=require(_0x8a33('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x8a33('0x8'));var ejs=require(_0x8a33('0x9'));var fs=require('fs');var fs_extra=require(_0x8a33('0xa'));var _=require(_0x8a33('0xb'));var squel=require(_0x8a33('0xc'));var crypto=require(_0x8a33('0xd'));var jsforce=require(_0x8a33('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8a33('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8a33('0xf'));var qs=require(_0x8a33('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8a33('0x11'));var logger=require('../../config/logger')(_0x8a33('0x12'));var utils=require(_0x8a33('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x8a33('0x14'));var db=require('../../mysqldb')['db'];config[_0x8a33('0x15')]=_[_0x8a33('0x16')](config[_0x8a33('0x15')],{'host':_0x8a33('0x17'),'port':0x18eb});var socket=require(_0x8a33('0x18'))(new Redis(config[_0x8a33('0x15')]));require(_0x8a33('0x19'))[_0x8a33('0x1a')](socket);var jayson=require(_0x8a33('0x1b'));var client=jayson[_0x8a33('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0x8a33('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52f07f,_0x1c1912,_0x58168b,_0x512351){return new BPromise(function(_0x2280d5,_0x1c4564){var _0x460c05=_0x512351||client;return _0x460c05['request'](_0x52f07f,_0x58168b)[_0x8a33('0x1d')](function(_0x576a19){logger[_0x8a33('0x1e')]('FaxAccount,\x20%s,\x20%s',_0x1c1912,_0x8a33('0x1f'));logger[_0x8a33('0x20')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x1c1912,_0x8a33('0x1f'),JSON[_0x8a33('0x21')](_0x576a19));if(_0x576a19['error']){if(_0x576a19['error']['code']===0x1f4){logger[_0x8a33('0x22')](_0x8a33('0x23'),_0x1c1912,_0x576a19[_0x8a33('0x22')][_0x8a33('0x24')]);return _0x1c4564(_0x576a19[_0x8a33('0x22')]['message']);}logger[_0x8a33('0x22')](_0x8a33('0x23'),_0x1c1912,_0x576a19[_0x8a33('0x22')][_0x8a33('0x24')]);return _0x2280d5(_0x576a19[_0x8a33('0x22')]['message']);}else{logger[_0x8a33('0x1e')](_0x8a33('0x23'),_0x1c1912,_0x8a33('0x1f'));_0x2280d5(_0x576a19['result'][_0x8a33('0x24')]);}})[_0x8a33('0x25')](function(_0x4d1fe9){logger[_0x8a33('0x22')](_0x8a33('0x23'),_0x1c1912,_0x4d1fe9);_0x1c4564(_0x4d1fe9);});});}function respondWithStatusCode(_0x5aac15,_0x1355bd){_0x1355bd=_0x1355bd||0xcc;return function(_0x264f49){if(_0x264f49){return _0x5aac15[_0x8a33('0x26')](_0x1355bd);}return _0x5aac15['status'](_0x1355bd)[_0x8a33('0x27')]();};}function respondWithResult(_0x25a9c1,_0x2c26d1){_0x2c26d1=_0x2c26d1||0xc8;return function(_0x48ed40){if(_0x48ed40){return _0x25a9c1[_0x8a33('0x28')](_0x2c26d1)[_0x8a33('0x29')](_0x48ed40);}};}function respondWithFilteredResult(_0x32d293,_0x28fb43){return function(_0x1036c5){if(_0x1036c5){var _0xbf969d=typeof _0x28fb43[_0x8a33('0x2a')]===_0x8a33('0x2b')&&typeof _0x28fb43['limit']===_0x8a33('0x2b');var _0x4017b2=_0x1036c5[_0x8a33('0x2c')];var _0x2908d2=_0xbf969d?0x0:_0x28fb43[_0x8a33('0x2a')];var _0x99e578=_0xbf969d?_0x1036c5[_0x8a33('0x2c')]:_0x28fb43[_0x8a33('0x2a')]+_0x28fb43['limit'];var _0x5b1af2;if(_0x99e578>=_0x4017b2){_0x99e578=_0x4017b2;_0x5b1af2=0xc8;}else{_0x5b1af2=0xce;}_0x32d293[_0x8a33('0x28')](_0x5b1af2);return _0x32d293[_0x8a33('0x2d')](_0x8a33('0x2e'),_0x2908d2+'-'+_0x99e578+'/'+_0x4017b2)['json'](_0x1036c5);}return null;};}function patchUpdates(_0xcebbd1){return function(_0x502013){try{jsonpatch[_0x8a33('0x2f')](_0x502013,_0xcebbd1,!![]);}catch(_0x4dac40){return BPromise[_0x8a33('0x30')](_0x4dac40);}return _0x502013['save']();};}function saveUpdates(_0x439cf5,_0xb6a12){return function(_0x45e967){if(_0x45e967){return _0x45e967[_0x8a33('0x31')](_0x439cf5)[_0x8a33('0x1d')](function(_0x5489b3){return _0x5489b3;});}return null;};}function removeEntity(_0x37f73f,_0x38f181){return function(_0x569a5f){if(_0x569a5f){return _0x569a5f['destroy']()[_0x8a33('0x1d')](function(){var _0x5a6a70=_0x569a5f[_0x8a33('0x32')]({'plain':!![]});var _0x24261d=_0x8a33('0x33');return db[_0x8a33('0x34')]['destroy']({'where':{'type':_0x24261d,'resourceId':_0x5a6a70['id']}})[_0x8a33('0x1d')](function(){return _0x569a5f;});})[_0x8a33('0x1d')](function(){_0x37f73f[_0x8a33('0x28')](0xcc)[_0x8a33('0x27')]();});}};}function handleEntityNotFound(_0x494eb4,_0xc79b55){return function(_0x182026){if(!_0x182026){_0x494eb4[_0x8a33('0x26')](0x194);}return _0x182026;};}function handleError(_0x284bb9,_0x43bcb9){_0x43bcb9=_0x43bcb9||0x1f4;return function(_0x5667a7){logger[_0x8a33('0x22')](_0x5667a7[_0x8a33('0x35')]);if(_0x5667a7[_0x8a33('0x36')]){delete _0x5667a7[_0x8a33('0x36')];}_0x284bb9[_0x8a33('0x28')](_0x43bcb9)[_0x8a33('0x37')](_0x5667a7);};}exports[_0x8a33('0x38')]=function(_0x3f0972,_0x17ff0e){var _0x451c19={'include':[{'model':db[_0x8a33('0x39')],'as':'mandatoryDispositionPause'}]},_0x321400={},_0x57854d={'count':0x0,'rows':[]};var _0x390946=_['map'](db[_0x8a33('0x3a')][_0x8a33('0x3b')],function(_0x3c268c){return{'name':_0x3c268c[_0x8a33('0x3c')],'type':_0x3c268c['type'][_0x8a33('0x3d')]};});_0x321400[_0x8a33('0x3e')]=_[_0x8a33('0x3f')](_0x390946,_0x8a33('0x36'));_0x321400[_0x8a33('0x40')]=_[_0x8a33('0x41')](_0x3f0972[_0x8a33('0x40')]);_0x321400[_0x8a33('0x42')]=_[_0x8a33('0x43')](_0x321400[_0x8a33('0x3e')],_0x321400[_0x8a33('0x40')]);_0x451c19['attributes']=_[_0x8a33('0x43')](_0x321400[_0x8a33('0x3e')],qs[_0x8a33('0x44')](_0x3f0972[_0x8a33('0x40')][_0x8a33('0x44')]));_0x451c19[_0x8a33('0x45')]=_0x451c19[_0x8a33('0x45')]['length']?_0x451c19['attributes']:_0x321400[_0x8a33('0x3e')];if(!_0x3f0972['query'][_0x8a33('0x46')](_0x8a33('0x47'))){_0x451c19['limit']=qs[_0x8a33('0x48')](_0x3f0972[_0x8a33('0x40')][_0x8a33('0x48')]);_0x451c19['offset']=qs['offset'](_0x3f0972[_0x8a33('0x40')][_0x8a33('0x2a')]);}_0x451c19[_0x8a33('0x49')]=qs[_0x8a33('0x4a')](_0x3f0972[_0x8a33('0x40')]['sort']);_0x451c19['where']=qs[_0x8a33('0x42')](_[_0x8a33('0x4b')](_0x3f0972['query'],_0x321400[_0x8a33('0x42')]),_0x390946);if(_0x3f0972['query']['filter']){_0x451c19['where']=_['merge'](_0x451c19[_0x8a33('0x4c')],{'$or':_[_0x8a33('0x3f')](_0x390946,function(_0x1570a4){if(_0x1570a4[_0x8a33('0x4d')]!==_0x8a33('0x4e')){var _0x516ec3={};_0x516ec3[_0x1570a4[_0x8a33('0x36')]]={'$like':'%'+_0x3f0972['query'][_0x8a33('0x4f')]+'%'};return _0x516ec3;}})});}_0x451c19=_[_0x8a33('0x50')]({},_0x451c19,_0x3f0972['options']);var _0xf3f78b={'where':_0x451c19['where']};return db['FaxAccount'][_0x8a33('0x2c')](_0xf3f78b)[_0x8a33('0x1d')](function(_0x4e6adf){_0x57854d['count']=_0x4e6adf;if(_0x3f0972['query'][_0x8a33('0x51')]){_0x451c19['include']=[{'all':!![]}];}return db[_0x8a33('0x3a')][_0x8a33('0x52')](_0x451c19);})[_0x8a33('0x1d')](function(_0x1b4fda){_0x57854d[_0x8a33('0x53')]=_0x1b4fda;return _0x57854d;})['then'](respondWithFilteredResult(_0x17ff0e,_0x451c19))[_0x8a33('0x25')](handleError(_0x17ff0e,null));};exports[_0x8a33('0x54')]=function(_0x5c6bf8,_0x18f317){var _0x572204={'raw':![],'where':{'id':_0x5c6bf8[_0x8a33('0x55')]['id']},'include':[{'model':db[_0x8a33('0x39')],'as':_0x8a33('0x56')}]},_0x110704={};_0x110704[_0x8a33('0x3e')]=_[_0x8a33('0x41')](db[_0x8a33('0x3a')][_0x8a33('0x3b')]);_0x110704[_0x8a33('0x40')]=_[_0x8a33('0x41')](_0x5c6bf8[_0x8a33('0x40')]);_0x110704['filters']=_['intersection'](_0x110704[_0x8a33('0x3e')],_0x110704[_0x8a33('0x40')]);_0x572204[_0x8a33('0x45')]=_['intersection'](_0x110704[_0x8a33('0x3e')],qs['fields'](_0x5c6bf8[_0x8a33('0x40')][_0x8a33('0x44')]));_0x572204['attributes']=_0x572204[_0x8a33('0x45')]['length']?_0x572204[_0x8a33('0x45')]:_0x110704[_0x8a33('0x3e')];if(_0x5c6bf8[_0x8a33('0x40')]['includeAll']){_0x572204[_0x8a33('0x57')]=[{'all':!![]}];}_0x572204=_[_0x8a33('0x50')]({},_0x572204,_0x5c6bf8[_0x8a33('0x58')]);return db['FaxAccount']['find'](_0x572204)[_0x8a33('0x1d')](handleEntityNotFound(_0x18f317,null))[_0x8a33('0x1d')](respondWithResult(_0x18f317,null))[_0x8a33('0x25')](handleError(_0x18f317,null));};exports[_0x8a33('0x59')]=function(_0x3edb37,_0x428915){return db['FaxAccount'][_0x8a33('0x59')](_0x3edb37[_0x8a33('0x5a')],{})[_0x8a33('0x1d')](function(_0x73ee7c){var _0x1c14c9=_0x3edb37[_0x8a33('0x5b')][_0x8a33('0x32')]({'plain':!![]});if(!_0x1c14c9)throw new Error(_0x8a33('0x5c'));if(_0x1c14c9[_0x8a33('0x5d')]===_0x8a33('0x5b')){var _0x9c6b9f=_0x73ee7c['get']({'plain':!![]});var _0x40a533=_0x8a33('0x33');return db['UserProfileSection'][_0x8a33('0x5e')]({'where':{'name':_0x40a533,'userProfileId':_0x1c14c9[_0x8a33('0x5f')]},'raw':!![]})[_0x8a33('0x1d')](function(_0x3ec1ca){if(_0x3ec1ca&&_0x3ec1ca[_0x8a33('0x60')]===0x0){return db[_0x8a33('0x34')][_0x8a33('0x59')]({'name':_0x9c6b9f[_0x8a33('0x36')],'resourceId':_0x9c6b9f['id'],'type':_0x3ec1ca['name'],'sectionId':_0x3ec1ca['id']},{})[_0x8a33('0x1d')](function(){return _0x73ee7c;});}else{return _0x73ee7c;}})[_0x8a33('0x25')](function(_0x568a0f){logger['error'](_0x8a33('0x61'),_0x568a0f);throw _0x568a0f;});}return _0x73ee7c;})[_0x8a33('0x1d')](respondWithResult(_0x428915,0xc9))[_0x8a33('0x25')](handleError(_0x428915,null));};exports[_0x8a33('0x31')]=function(_0xb5514b,_0x5ac4de){if(_0xb5514b['body']['id']){delete _0xb5514b['body']['id'];}return db['FaxAccount'][_0x8a33('0x5e')]({'where':{'id':_0xb5514b['params']['id']},'include':[{'model':db[_0x8a33('0x39')],'as':'mandatoryDispositionPause'}]})[_0x8a33('0x1d')](handleEntityNotFound(_0x5ac4de,null))[_0x8a33('0x1d')](saveUpdates(_0xb5514b[_0x8a33('0x5a')],null))[_0x8a33('0x1d')](respondWithResult(_0x5ac4de,null))['catch'](handleError(_0x5ac4de,null));};exports[_0x8a33('0x62')]=function(_0x496a7b,_0x7e6f92){return db[_0x8a33('0x3a')]['find']({'where':{'id':_0x496a7b[_0x8a33('0x55')]['id']}})[_0x8a33('0x1d')](handleEntityNotFound(_0x7e6f92,null))['then'](removeEntity(_0x7e6f92,null))[_0x8a33('0x25')](handleError(_0x7e6f92,null));};exports[_0x8a33('0x63')]=function(_0x5ae935,_0x528d3c){return db['FaxAccount'][_0x8a33('0x63')]()['then'](respondWithResult(_0x528d3c,null))[_0x8a33('0x25')](handleError(_0x528d3c,null));};exports[_0x8a33('0x64')]=function(_0x3f8210,_0x30b3a6,_0x231092){if(_0x3f8210[_0x8a33('0x5a')]['id']){delete _0x3f8210['body']['id'];}return db[_0x8a33('0x3a')][_0x8a33('0x5e')]({'where':{'id':_0x3f8210[_0x8a33('0x55')]['id']}})[_0x8a33('0x1d')](handleEntityNotFound(_0x30b3a6,null))[_0x8a33('0x1d')](function(_0x912670){if(_0x912670){_0x3f8210[_0x8a33('0x5a')][_0x8a33('0x65')]=_0x912670['id'];return db[_0x8a33('0x66')]['create'](_0x3f8210[_0x8a33('0x5a')]);}})[_0x8a33('0x1d')](respondWithResult(_0x30b3a6,null))[_0x8a33('0x25')](handleError(_0x30b3a6,null));};exports[_0x8a33('0x67')]=function(_0x5860d9,_0x12ae22,_0x5c902a){var _0x1043fa={'raw':![],'where':{}};var _0xea0508={};var _0x330aa2={'count':0x0,'rows':[]};return db[_0x8a33('0x3a')]['findOne']({'where':{'id':_0x5860d9[_0x8a33('0x55')]['id']}})[_0x8a33('0x1d')](handleEntityNotFound(_0x12ae22,null))[_0x8a33('0x1d')](function(_0x41d2f2){if(_0x41d2f2){_0xea0508[_0x8a33('0x3e')]=_[_0x8a33('0x41')](db[_0x8a33('0x66')][_0x8a33('0x3b')]);_0xea0508['query']=_[_0x8a33('0x41')](_0x5860d9[_0x8a33('0x40')]);_0xea0508['filters']=_[_0x8a33('0x43')](_0xea0508['model'],_0xea0508['query']);_0x1043fa[_0x8a33('0x45')]=_[_0x8a33('0x43')](_0xea0508[_0x8a33('0x3e')],qs[_0x8a33('0x44')](_0x5860d9[_0x8a33('0x40')][_0x8a33('0x44')]));_0x1043fa[_0x8a33('0x45')]=_0x1043fa[_0x8a33('0x45')][_0x8a33('0x68')]?_0x1043fa['attributes']:_0xea0508[_0x8a33('0x3e')];if(!_0x5860d9['query'][_0x8a33('0x46')](_0x8a33('0x47'))){_0x1043fa[_0x8a33('0x48')]=qs['limit'](_0x5860d9[_0x8a33('0x40')][_0x8a33('0x48')]);_0x1043fa[_0x8a33('0x2a')]=qs[_0x8a33('0x2a')](_0x5860d9[_0x8a33('0x40')][_0x8a33('0x2a')]);}_0x1043fa['order']=qs[_0x8a33('0x4a')](_0x5860d9[_0x8a33('0x40')][_0x8a33('0x4a')]);_0x1043fa[_0x8a33('0x4c')]=qs[_0x8a33('0x42')](_[_0x8a33('0x4b')](_0x5860d9[_0x8a33('0x40')],_0xea0508[_0x8a33('0x42')]));_0x1043fa[_0x8a33('0x4c')][_0x8a33('0x65')]=_0x41d2f2['id'];if(_0x5860d9[_0x8a33('0x40')][_0x8a33('0x4f')]){_0x1043fa['where']=_['merge'](_0x1043fa['where'],{'$or':_[_0x8a33('0x3f')](_0x1043fa[_0x8a33('0x45')],function(_0x491b41){var _0x2f2295={};_0x2f2295[_0x491b41]={'$like':'%'+_0x5860d9['query'][_0x8a33('0x4f')]+'%'};return _0x2f2295;})});}_0x1043fa=_[_0x8a33('0x50')]({},_0x1043fa,_0x5860d9['options']);return db[_0x8a33('0x66')][_0x8a33('0x2c')]({'where':_0x1043fa[_0x8a33('0x4c')]})[_0x8a33('0x1d')](function(_0x5cdbb0){_0x330aa2[_0x8a33('0x2c')]=_0x5cdbb0;if(_0x5860d9[_0x8a33('0x40')][_0x8a33('0x51')]){_0x1043fa[_0x8a33('0x57')]=[{'all':!![]}];}return db[_0x8a33('0x66')][_0x8a33('0x52')](_0x1043fa);})[_0x8a33('0x1d')](function(_0xe1c7e5){_0x330aa2[_0x8a33('0x53')]=_0xe1c7e5;return _0x330aa2;});}})[_0x8a33('0x1d')](respondWithFilteredResult(_0x12ae22,_0x1043fa))['catch'](handleError(_0x12ae22,null));};exports[_0x8a33('0x69')]=function(_0x2787b6,_0x3cfb31,_0x2a6b06){return db[_0x8a33('0x3a')]['find']({'where':{'id':_0x2787b6[_0x8a33('0x55')]['id']}})[_0x8a33('0x1d')](handleEntityNotFound(_0x3cfb31,null))[_0x8a33('0x1d')](function(_0x42ecfb){if(_0x42ecfb){return _0x42ecfb[_0x8a33('0x69')](_0x2787b6[_0x8a33('0x40')][_0x8a33('0x6a')]);}})[_0x8a33('0x1d')](respondWithStatusCode(_0x3cfb31,null))['catch'](handleError(_0x3cfb31,null));};exports[_0x8a33('0x6b')]=function(_0x284098,_0x2fbc2d,_0x53487b){if(_0x284098[_0x8a33('0x5a')]['id']){delete _0x284098['body']['id'];}return db[_0x8a33('0x3a')]['find']({'where':{'id':_0x284098[_0x8a33('0x55')]['id']}})[_0x8a33('0x1d')](handleEntityNotFound(_0x2fbc2d,null))[_0x8a33('0x1d')](function(_0x4e079d){if(_0x4e079d){_0x284098[_0x8a33('0x5a')]['FaxAccountId']=_0x4e079d['id'];return db[_0x8a33('0x6c')][_0x8a33('0x59')](_0x284098[_0x8a33('0x5a')]);}})[_0x8a33('0x1d')](respondWithResult(_0x2fbc2d,null))[_0x8a33('0x25')](handleError(_0x2fbc2d,null));};exports[_0x8a33('0x6d')]=function(_0xdddc1d,_0x2ea0cf,_0x12f916){var _0x150663={'raw':![],'where':{}};var _0x44d962={};var _0x2f7f28={'count':0x0,'rows':[]};return db['FaxAccount'][_0x8a33('0x6e')]({'where':{'id':_0xdddc1d[_0x8a33('0x55')]['id']}})['then'](handleEntityNotFound(_0x2ea0cf,null))[_0x8a33('0x1d')](function(_0x38b71f){if(_0x38b71f){_0x44d962['model']=_[_0x8a33('0x41')](db[_0x8a33('0x6c')][_0x8a33('0x3b')]);_0x44d962[_0x8a33('0x40')]=_[_0x8a33('0x41')](_0xdddc1d[_0x8a33('0x40')]);_0x44d962[_0x8a33('0x42')]=_['intersection'](_0x44d962[_0x8a33('0x3e')],_0x44d962['query']);_0x150663['attributes']=_[_0x8a33('0x43')](_0x44d962[_0x8a33('0x3e')],qs[_0x8a33('0x44')](_0xdddc1d[_0x8a33('0x40')]['fields']));_0x150663[_0x8a33('0x45')]=_0x150663[_0x8a33('0x45')][_0x8a33('0x68')]?_0x150663[_0x8a33('0x45')]:_0x44d962[_0x8a33('0x3e')];if(!_0xdddc1d[_0x8a33('0x40')][_0x8a33('0x46')](_0x8a33('0x47'))){_0x150663[_0x8a33('0x48')]=qs['limit'](_0xdddc1d['query'][_0x8a33('0x48')]);_0x150663[_0x8a33('0x2a')]=qs[_0x8a33('0x2a')](_0xdddc1d[_0x8a33('0x40')]['offset']);}_0x150663[_0x8a33('0x49')]=qs[_0x8a33('0x4a')](_0xdddc1d[_0x8a33('0x40')]['sort']);_0x150663[_0x8a33('0x4c')]=qs[_0x8a33('0x42')](_[_0x8a33('0x4b')](_0xdddc1d[_0x8a33('0x40')],_0x44d962[_0x8a33('0x42')]));_0x150663['where'][_0x8a33('0x65')]=_0x38b71f['id'];if(_0xdddc1d['query'][_0x8a33('0x4f')]){_0x150663[_0x8a33('0x4c')]=_['merge'](_0x150663['where'],{'$or':_[_0x8a33('0x3f')](_0x150663[_0x8a33('0x45')],function(_0x24204a){var _0x2b67dd={};_0x2b67dd[_0x24204a]={'$like':'%'+_0xdddc1d[_0x8a33('0x40')]['filter']+'%'};return _0x2b67dd;})});}_0x150663=_[_0x8a33('0x50')]({},_0x150663,_0xdddc1d[_0x8a33('0x58')]);return db[_0x8a33('0x6c')][_0x8a33('0x2c')]({'where':_0x150663[_0x8a33('0x4c')]})[_0x8a33('0x1d')](function(_0x4f657e){_0x2f7f28['count']=_0x4f657e;if(_0xdddc1d[_0x8a33('0x40')][_0x8a33('0x51')]){_0x150663[_0x8a33('0x57')]=[{'all':!![]}];}return db['CannedAnswer'][_0x8a33('0x52')](_0x150663);})[_0x8a33('0x1d')](function(_0x561c6a){_0x2f7f28[_0x8a33('0x53')]=_0x561c6a;return _0x2f7f28;});}})['then'](respondWithFilteredResult(_0x2ea0cf,_0x150663))[_0x8a33('0x25')](handleError(_0x2ea0cf,null));};exports[_0x8a33('0x6f')]=function(_0x4ad4f9,_0x1087c9,_0x3e1294){return db[_0x8a33('0x3a')]['find']({'where':{'id':_0x4ad4f9[_0x8a33('0x55')]['id']}})[_0x8a33('0x1d')](handleEntityNotFound(_0x1087c9,null))['then'](function(_0x29d459){if(_0x29d459){return _0x29d459['removeAnswers'](_0x4ad4f9[_0x8a33('0x40')][_0x8a33('0x6a')]);}})[_0x8a33('0x1d')](respondWithStatusCode(_0x1087c9,null))['catch'](handleError(_0x1087c9,null));};exports[_0x8a33('0x70')]=function(_0x5e6df8,_0x1eade9,_0x119661){return db[_0x8a33('0x71')][_0x8a33('0x5e')]({'where':{'id':_0x5e6df8[_0x8a33('0x55')]['id']}})[_0x8a33('0x1d')](handleEntityNotFound(_0x1eade9,null))[_0x8a33('0x1d')](function(_0x925aec){if(_0x925aec){return _0x925aec[_0x8a33('0x70')](_0x5e6df8[_0x8a33('0x5a')][_0x8a33('0x6a')],_[_0x8a33('0x72')](_0x5e6df8[_0x8a33('0x5a')],[_0x8a33('0x6a'),'id'])||{});}})[_0x8a33('0x1d')](respondWithResult(_0x1eade9,null))[_0x8a33('0x25')](handleError(_0x1eade9,null));};exports[_0x8a33('0x73')]=function(_0x3ab66f,_0x12868f,_0x38919d){var _0x199d5e={'raw':![],'where':{}};var _0x160a5a={};var _0x1cfe38={'count':0x0,'rows':[]};return db[_0x8a33('0x3a')][_0x8a33('0x6e')]({'where':{'id':_0x3ab66f[_0x8a33('0x55')]['id']}})[_0x8a33('0x1d')](handleEntityNotFound(_0x12868f,null))[_0x8a33('0x1d')](function(_0x25c2b6){if(_0x25c2b6){_0x160a5a[_0x8a33('0x3e')]=_[_0x8a33('0x41')](db['FaxInteraction']['rawAttributes']);_0x160a5a[_0x8a33('0x40')]=_[_0x8a33('0x41')](_0x3ab66f[_0x8a33('0x40')]);_0x160a5a[_0x8a33('0x42')]=_[_0x8a33('0x43')](_0x160a5a['model'],_0x160a5a[_0x8a33('0x40')]);_0x199d5e['attributes']=_[_0x8a33('0x43')](_0x160a5a[_0x8a33('0x3e')],qs[_0x8a33('0x44')](_0x3ab66f[_0x8a33('0x40')][_0x8a33('0x44')]));_0x199d5e[_0x8a33('0x45')]=_0x199d5e['attributes'][_0x8a33('0x68')]?_0x199d5e['attributes']:_0x160a5a['model'];if(!_0x3ab66f[_0x8a33('0x40')][_0x8a33('0x46')](_0x8a33('0x47'))){_0x199d5e[_0x8a33('0x48')]=qs[_0x8a33('0x48')](_0x3ab66f[_0x8a33('0x40')]['limit']);_0x199d5e[_0x8a33('0x2a')]=qs[_0x8a33('0x2a')](_0x3ab66f['query']['offset']);}_0x199d5e[_0x8a33('0x49')]=qs[_0x8a33('0x4a')](_0x3ab66f[_0x8a33('0x40')][_0x8a33('0x4a')]);_0x199d5e['where']=qs[_0x8a33('0x42')](_[_0x8a33('0x4b')](_0x3ab66f['query'],_0x160a5a[_0x8a33('0x42')]));_0x199d5e['where']['FaxAccountId']=_0x25c2b6['id'];if(_0x3ab66f['query'][_0x8a33('0x4f')]){_0x199d5e[_0x8a33('0x4c')]=_['merge'](_0x199d5e[_0x8a33('0x4c')],{'$or':_[_0x8a33('0x3f')](_0x199d5e[_0x8a33('0x45')],function(_0x849760){var _0x2dba43={};_0x2dba43[_0x849760]={'$like':'%'+_0x3ab66f[_0x8a33('0x40')]['filter']+'%'};return _0x2dba43;})});}_0x199d5e=_[_0x8a33('0x50')]({},_0x199d5e,_0x3ab66f['options']);return db[_0x8a33('0x71')][_0x8a33('0x2c')]({'where':_0x199d5e[_0x8a33('0x4c')]})['then'](function(_0x29674b){_0x1cfe38[_0x8a33('0x2c')]=_0x29674b;if(_0x3ab66f[_0x8a33('0x40')][_0x8a33('0x51')]){_0x199d5e['include']=[{'model':db[_0x8a33('0x74')],'as':_0x8a33('0x75'),'required':![]},{'model':db['User'],'as':_0x8a33('0x76'),'attributes':['name',_0x8a33('0x77'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x8a33('0x78'),'attributes':['id','name',_0x8a33('0x79')],'where':_0x3ab66f[_0x8a33('0x40')][_0x8a33('0x7a')]?{'id':_0x3ab66f[_0x8a33('0x40')]['tag']}:undefined,'required':_0x3ab66f[_0x8a33('0x40')][_0x8a33('0x7a')]?!![]:![]}];}return db[_0x8a33('0x71')][_0x8a33('0x52')](_0x199d5e);})[_0x8a33('0x1d')](function(_0x2769ff){_0x1cfe38[_0x8a33('0x53')]=_0x2769ff;return _0x1cfe38;});}})[_0x8a33('0x1d')](respondWithFilteredResult(_0x12868f,_0x199d5e))['catch'](handleError(_0x12868f,null));};exports['addApplications']=function(_0x220679,_0x4ec934){var _0x11006a=_0x220679['params']['id'];var _0x48040b=_0x220679[_0x8a33('0x5a')];var _0x3130ac=0xc8;var _0x46a1bd=null;return db[_0x8a33('0x7b')]['transaction']({'isolationLevel':db[_0x8a33('0x7b')][_0x8a33('0x7c')]['ISOLATION_LEVELS'][_0x8a33('0x7d')]},function(_0x3c3857){return db['FaxAccount'][_0x8a33('0x6e')]({'where':{'id':_0x11006a},'transaction':_0x3c3857})[_0x8a33('0x1d')](function(_0x4732b1){if(_0x4732b1){return db[_0x8a33('0x7e')][_0x8a33('0x62')]({'where':{'FaxAccountId':_0x11006a},'transaction':_0x3c3857})['then'](function(){var _0x36a50a=_['map'](_0x48040b,function(_0x3b61d7){_0x3b61d7[_0x8a33('0x65')]=_0x11006a;return _0x3b61d7;});return db['FaxApplication'][_0x8a33('0x7f')](_0x36a50a,{'transaction':_0x3c3857});});}else{_0x3130ac=0x194;_0x46a1bd=[];}});})[_0x8a33('0x1d')](function(){if(_0x3130ac!==0x194){return db[_0x8a33('0x7e')][_0x8a33('0x80')]({'where':{'FaxAccountId':_0x11006a},'order':_0x8a33('0x81')})[_0x8a33('0x1d')](function(_0x2d7854){_0x46a1bd=_0x2d7854;});}})[_0x8a33('0x25')](function(_0x2fd8bd){_0x3130ac=0x1f4;logger[_0x8a33('0x22')](_0x2fd8bd['stack']);if(_0x2fd8bd[_0x8a33('0x36')]){delete _0x2fd8bd[_0x8a33('0x36')];}_0x46a1bd=_0x2fd8bd;})[_0x8a33('0x82')](function(){if(_0x46a1bd===null){_0x4ec934[_0x8a33('0x26')](_0x3130ac);}else{if(_0x3130ac===0x1f4){_0x4ec934['status'](_0x3130ac)['send'](_0x46a1bd);}else{_0x4ec934[_0x8a33('0x28')](_0x3130ac)[_0x8a33('0x29')](_0x46a1bd);}}});};exports[_0x8a33('0x83')]=function(_0x2c95af,_0x202429,_0x20a6d6){var _0x4bcbd7={};var _0x502a5b={};var _0x35eefa;var _0x5d3fde;return db[_0x8a33('0x3a')][_0x8a33('0x6e')]({'where':{'id':_0x2c95af[_0x8a33('0x55')]['id']}})[_0x8a33('0x1d')](handleEntityNotFound(_0x202429,null))[_0x8a33('0x1d')](function(_0x27ba8b){if(_0x27ba8b){_0x35eefa=_0x27ba8b;_0x502a5b[_0x8a33('0x3e')]=_['keys'](db['FaxApplication'][_0x8a33('0x3b')]);_0x502a5b[_0x8a33('0x40')]=_['keys'](_0x2c95af[_0x8a33('0x40')]);_0x502a5b['filters']=_['intersection'](_0x502a5b['model'],_0x502a5b[_0x8a33('0x40')]);_0x4bcbd7[_0x8a33('0x45')]=_[_0x8a33('0x43')](_0x502a5b[_0x8a33('0x3e')],qs[_0x8a33('0x44')](_0x2c95af[_0x8a33('0x40')][_0x8a33('0x44')]));_0x4bcbd7['attributes']=_0x4bcbd7[_0x8a33('0x45')][_0x8a33('0x68')]?_0x4bcbd7[_0x8a33('0x45')]:_0x502a5b[_0x8a33('0x3e')];_0x4bcbd7[_0x8a33('0x49')]=qs[_0x8a33('0x4a')](_0x2c95af[_0x8a33('0x40')][_0x8a33('0x4a')]);_0x4bcbd7[_0x8a33('0x4c')]=qs['filters'](_[_0x8a33('0x4b')](_0x2c95af[_0x8a33('0x40')],_0x502a5b[_0x8a33('0x42')]));if(_0x2c95af[_0x8a33('0x40')]['filter']){_0x4bcbd7[_0x8a33('0x4c')]=_['merge'](_0x4bcbd7['where'],{'$or':_[_0x8a33('0x3f')](_0x4bcbd7[_0x8a33('0x45')],function(_0x435a16){var _0x371512={};_0x371512[_0x435a16]={'$like':'%'+_0x2c95af[_0x8a33('0x40')][_0x8a33('0x4f')]+'%'};return _0x371512;})});}_0x4bcbd7=_[_0x8a33('0x50')]({},_0x4bcbd7,_0x2c95af[_0x8a33('0x58')]);return _0x35eefa[_0x8a33('0x83')](_0x4bcbd7);}})[_0x8a33('0x1d')](function(_0x20f96e){if(_0x20f96e){_0x5d3fde=_0x20f96e['length'];if(!_0x2c95af[_0x8a33('0x40')][_0x8a33('0x46')](_0x8a33('0x47'))){_0x4bcbd7['limit']=qs['limit'](_0x2c95af[_0x8a33('0x40')][_0x8a33('0x48')]);_0x4bcbd7[_0x8a33('0x2a')]=qs[_0x8a33('0x2a')](_0x2c95af['query'][_0x8a33('0x2a')]);}return _0x35eefa['getApplications'](_0x4bcbd7);}})['then'](function(_0x5d41d9){if(_0x5d41d9){return _0x5d41d9?{'count':_0x5d3fde,'rows':_0x5d41d9}:null;}})[_0x8a33('0x1d')](respondWithResult(_0x202429,null))[_0x8a33('0x25')](handleError(_0x202429,null));};function Extension(_0x1b109f,_0x3efbba,_0xc40fca,_0x57202e){this[_0x8a33('0x84')]=_0x8a33('0x85');this[_0x8a33('0x86')]=_0x1b109f[_0x8a33('0x87')];this[_0x8a33('0x88')]=_0x57202e;this[_0x8a33('0x4d')]=_0x8a33('0x89');this['description']='Fax\x20Extension';this[_0x8a33('0x65')]=_0x1b109f['id'];this[_0x8a33('0x81')]=_0x3efbba;this['appdata']=_0xc40fca;}function createExtensionsReciveFax(_0x4df01b){var _0x35a777=0x1;var _0x4e833f=[];_0x4e833f[_0x8a33('0x8a')](new Extension(_0x4df01b,_0x35a777,'',_0x8a33('0x8b')));_0x35a777+=0x1;_0x4e833f[_0x8a33('0x8a')](new Extension(_0x4df01b,_0x35a777,_0x8a33('0x8c'),_0x8a33('0x8d')));_0x35a777+=0x1;for(var _0x524d1e in _0x4df01b){if(_0x4df01b['hasOwnProperty'](_0x524d1e)&&(_0x524d1e===_0x8a33('0x8e')||_0x524d1e===_0x8a33('0x87')||_0x524d1e===_0x8a33('0x8f')||_0x524d1e===_0x8a33('0x90')||_0x524d1e==='headerinfo'||_0x524d1e===_0x8a33('0x91')||_0x524d1e===_0x8a33('0x92')||_0x524d1e==='modem'||_0x524d1e===_0x8a33('0x93'))){_0x4e833f[_0x8a33('0x8a')](new Extension(_0x4df01b,_0x35a777,'FAXOPT('+_0x524d1e+')='+_0x4df01b[_0x524d1e],_0x8a33('0x8d')));_0x35a777+=0x1;}}_0x4e833f['push'](new Extension(_0x4df01b,_0x35a777,'6',_0x8a33('0x94')));_0x35a777+=0x1;_0x4e833f[_0x8a33('0x8a')](new Extension(_0x4df01b,_0x35a777,'/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d',_0x8a33('0x95')));_0x35a777=0x0;return _0x4e833f;}exports['addAccountApplications']=function(_0x27a61c,_0x3cc18b,_0x37ddb7){var _0x3ba1db;return db[_0x8a33('0x7b')][_0x8a33('0x96')](function(_0x341fae){return db[_0x8a33('0x3a')]['create'](_0x27a61c[_0x8a33('0x5a')],{'transaction':_0x341fae})[_0x8a33('0x1d')](function(_0x287f80){_0x3ba1db=_0x287f80['get']({'plain':!![]});return db[_0x8a33('0x97')][_0x8a33('0x7f')](createExtensionsReciveFax(_0x3ba1db),{'transaction':_0x341fae});});})[_0x8a33('0x1d')](function(){return _0x3ba1db;})[_0x8a33('0x1d')](respondWithResult(_0x3cc18b,null))[_0x8a33('0x25')](handleError(_0x3cc18b,null));};exports[_0x8a33('0x98')]=function(_0x56c0bf,_0x168d47,_0x4172bf){var _0x3440f1;return db[_0x8a33('0x7b')][_0x8a33('0x96')](function(_0x33867b){return db['FaxAccount']['update'](_0x56c0bf[_0x8a33('0x5a')],{'where':{'id':_0x56c0bf['body']['id']},'transaction':_0x33867b})[_0x8a33('0x1d')](function(_0x144b66){return db[_0x8a33('0x97')][_0x8a33('0x62')]({'where':{'FaxAccountId':_0x56c0bf[_0x8a33('0x5a')]['id']},'transaction':_0x33867b})['then'](function(_0x200e27){return db[_0x8a33('0x97')][_0x8a33('0x7f')](createExtensionsReciveFax(_['omit'](_0x56c0bf['body'],[_0x8a33('0x99'),_0x8a33('0x3d'),_0x8a33('0x9a'),'updatedAt','TrunkId',_0x8a33('0x9b')])),{'transaction':_0x33867b});});});})[_0x8a33('0x1d')](function(){return db[_0x8a33('0x3a')]['findById'](_0x56c0bf[_0x8a33('0x5a')]['id']);})[_0x8a33('0x1d')](respondWithResult(_0x168d47,null))[_0x8a33('0x25')](handleError(_0x168d47,null));};exports[_0x8a33('0x9c')]=function(_0x1d59ce,_0x1d1962,_0x5ddd9f){var _0x3b933b={'raw':!![],'where':{}};var _0x294e09={};var _0x107cdf={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x1d59ce[_0x8a33('0x55')]['id']}})[_0x8a33('0x1d')](handleEntityNotFound(_0x1d1962,null))[_0x8a33('0x1d')](function(_0x3bb6d9){if(_0x3bb6d9){_0x294e09[_0x8a33('0x3e')]=_[_0x8a33('0x41')](db['FaxMessage'][_0x8a33('0x3b')]);_0x294e09[_0x8a33('0x40')]=_[_0x8a33('0x41')](_0x1d59ce[_0x8a33('0x40')]);_0x294e09[_0x8a33('0x42')]=_['intersection'](_0x294e09['model'],_0x294e09[_0x8a33('0x40')]);_0x3b933b['attributes']=_[_0x8a33('0x43')](_0x294e09[_0x8a33('0x3e')],qs['fields'](_0x1d59ce[_0x8a33('0x40')]['fields']));_0x3b933b[_0x8a33('0x45')]=_0x3b933b[_0x8a33('0x45')][_0x8a33('0x68')]?_0x3b933b['attributes']:_0x294e09[_0x8a33('0x3e')];if(!_0x1d59ce[_0x8a33('0x40')][_0x8a33('0x46')](_0x8a33('0x47'))){_0x3b933b['limit']=qs[_0x8a33('0x48')](_0x1d59ce[_0x8a33('0x40')][_0x8a33('0x48')]);_0x3b933b[_0x8a33('0x2a')]=qs[_0x8a33('0x2a')](_0x1d59ce[_0x8a33('0x40')]['offset']);}_0x3b933b[_0x8a33('0x49')]=qs[_0x8a33('0x4a')](_0x1d59ce['query'][_0x8a33('0x4a')]);_0x3b933b[_0x8a33('0x4c')]=qs[_0x8a33('0x42')](_[_0x8a33('0x4b')](_0x1d59ce['query'],_0x294e09[_0x8a33('0x42')]));_0x3b933b['where'][_0x8a33('0x65')]=_0x3bb6d9['id'];if(_0x1d59ce[_0x8a33('0x40')][_0x8a33('0x4f')]){_0x3b933b[_0x8a33('0x4c')]=_[_0x8a33('0x50')](_0x3b933b[_0x8a33('0x4c')],{'$or':_['map'](_0x3b933b[_0x8a33('0x45')],function(_0x49cc11){var _0x5c4d42={};_0x5c4d42[_0x49cc11]={'$like':'%'+_0x1d59ce[_0x8a33('0x40')][_0x8a33('0x4f')]+'%'};return _0x5c4d42;})});}if(_0x1d59ce[_0x8a33('0x40')][_0x8a33('0x9d')]){var _0x53093c=_0x1d59ce[_0x8a33('0x40')]['$gte'][_0x8a33('0x9e')](',');var _0xe53480={};_0xe53480[_0x53093c[0x0]]={'$gte':moment(_0x53093c[0x1])[_0x8a33('0x9f')](_0x8a33('0xa0'))};_0x3b933b[_0x8a33('0x4c')]=_[_0x8a33('0x50')](_0x3b933b[_0x8a33('0x4c')],_0xe53480);}_0x3b933b=_['merge']({},_0x3b933b,_0x1d59ce[_0x8a33('0x58')]);return db[_0x8a33('0xa1')][_0x8a33('0x2c')]({'where':_0x3b933b[_0x8a33('0x4c')]})[_0x8a33('0x1d')](function(_0x4383af){_0x107cdf[_0x8a33('0x2c')]=_0x4383af;if(_0x1d59ce[_0x8a33('0x40')][_0x8a33('0x51')]){_0x3b933b['include']=[{'all':!![]}];}return db['FaxMessage'][_0x8a33('0x52')](_0x3b933b);})[_0x8a33('0x1d')](function(_0x5db0ed){_0x107cdf[_0x8a33('0x53')]=_0x5db0ed;return _0x107cdf;});}})[_0x8a33('0x1d')](respondWithFilteredResult(_0x1d1962,_0x3b933b))[_0x8a33('0x25')](handleError(_0x1d1962,null));};exports[_0x8a33('0x37')]=function(_0x1cc2c9,_0x41b784,_0x1ebbd0){var _0x3b5ebc,_0x5f1cc0={},_0xfea25f;if(_0x1cc2c9[_0x8a33('0x5a')]['to']){_0xfea25f=_0x1cc2c9[_0x8a33('0x5a')]['to'][0x0];}return db[_0x8a33('0x3a')][_0x8a33('0x5e')]({'where':{'id':_0x1cc2c9['params']['id']},'include':[{'model':db[_0x8a33('0xa2')],'as':'List','include':[{'model':db[_0x8a33('0x74')],'as':_0x8a33('0xa3'),'where':{'fax':_0xfea25f},'limit':0x1,'order':[['updatedAt',_0x8a33('0xa4')]]}]}]})[_0x8a33('0x1d')](handleEntityNotFound(_0x41b784,null))[_0x8a33('0x1d')](function(_0x25d29c){_0x3b5ebc=_0x25d29c;if(_0x1cc2c9[_0x8a33('0x5a')][_0x8a33('0xa5')]&&_0x1cc2c9['body'][_0x8a33('0xa5')][_0x8a33('0x68')]){for(var _0x1aeca1=0x0;_0x1aeca1<_0x1cc2c9[_0x8a33('0x5a')][_0x8a33('0xa5')][_0x8a33('0x68')];_0x1aeca1+=0x1){_0x1cc2c9['body']['attachments'][_0x1aeca1]={'filename':_0x1cc2c9[_0x8a33('0x5a')][_0x8a33('0xa5')][_0x1aeca1]['name'],'id':_0x1cc2c9[_0x8a33('0x5a')][_0x8a33('0xa5')][_0x1aeca1]['id'],'path':path[_0x8a33('0xa6')](config['root'],'server/files/attachments',_0x1cc2c9['body'][_0x8a33('0xa5')][_0x1aeca1][_0x8a33('0xa7')])};}}return respondWithRpcPromise(_0x8a33('0xa8'),_0x8a33('0xa8'),{'FaxAccountId':_[_0x8a33('0xa9')](_0x1cc2c9[_0x8a33('0x55')]['id'])?undefined:_0x1cc2c9[_0x8a33('0x55')]['id'],'path':_[_0x8a33('0xa9')](_0x1cc2c9[_0x8a33('0x5a')][_0x8a33('0xa5')][0x0][_0x8a33('0xaa')])?undefined:_0x1cc2c9[_0x8a33('0x5a')][_0x8a33('0xa5')][0x0][_0x8a33('0xaa')],'fax':_[_0x8a33('0xa9')](_0x1cc2c9[_0x8a33('0x5a')]['to'][0x0])?undefined:_0x1cc2c9[_0x8a33('0x5a')]['to'][0x0]},client9002);})['then'](function(){if(_0x3b5ebc){if(_[_0x8a33('0xa9')](_0x1cc2c9[_0x8a33('0x5a')][_0x8a33('0xab')])){_0x1cc2c9[_0x8a33('0x5a')][_0x8a33('0xab')]=util['format'](_0x8a33('0xac'),_0x3b5ebc[_0x8a33('0x36')],_0x3b5ebc['fax']);}if(_0x3b5ebc[_0x8a33('0xad')]){if(_0x3b5ebc[_0x8a33('0xad')][_0x8a33('0xa3')]['length']){return _0x3b5ebc[_0x8a33('0xad')][_0x8a33('0xa3')][0x0];}else{return db['CmContact'][_0x8a33('0x59')](_[_0x8a33('0x16')](_0x1cc2c9[_0x8a33('0x5a')],{'firstName':_0x1cc2c9[_0x8a33('0x5a')]['to'][0x0],'phone':_0x1cc2c9['body']['to'][0x0],'fax':_0x1cc2c9[_0x8a33('0x5a')]['to'][0x0],'ListId':_0x3b5ebc['ListId']}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x8a33('0xae'));}})[_0x8a33('0x1d')](function(_0x1dea88){if(_0x1dea88){return db[_0x8a33('0x71')]['find']({'where':{'ContactId':_0x1dea88['id'],'closed':![],'FaxAccountId':_0x3b5ebc['id']}})[_0x8a33('0x1d')](function(_0x42c103){if(_0x42c103){return[_0x42c103,![]];}return db['FaxInteraction']['create']({'UserId':_0x1cc2c9[_0x8a33('0x5b')]['id'],'ContactId':_0x1dea88['id'],'FaxAccountId':_0x3b5ebc['id'],'fax':_0x1cc2c9[_0x8a33('0x5a')]['to'][0x0],'firstMsgDirection':_0x8a33('0xaf'),'Messages':[_['merge'](_0x1cc2c9[_0x8a33('0x5a')],{'read':![],'body':_0x1cc2c9[_0x8a33('0x5a')][_0x8a33('0xa5')][0x0][_0x8a33('0xb0')],'FaxAccountId':_0x3b5ebc['id'],'UserId':_0x1cc2c9[_0x8a33('0x5b')]['id'],'ContactId':_0x1dea88['id'],'AttachmentId':_0x1cc2c9[_0x8a33('0x5a')][_0x8a33('0xa5')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x8a33('0xb1')}]})['then'](function(_0x4fad7e){return[_0x4fad7e,!![]];});});}else{throw new Error(_0x8a33('0xb2'));}})[_0x8a33('0xb3')](function(_0x418a1f,_0x518bcc){if(_0x518bcc){return _0x418a1f;}return db['FaxMessage'][_0x8a33('0x59')]({'direction':_0x8a33('0xaf'),'read':![],'body':_0x1cc2c9[_0x8a33('0x5a')]['attachments'][0x0][_0x8a33('0xb0')],'FaxAccountId':_0x3b5ebc['id'],'FaxInteractionId':_0x418a1f['id'],'UserId':_0x1cc2c9[_0x8a33('0x5b')]['id'],'ContactId':_0x418a1f[_0x8a33('0xb4')],'AttachmentId':_0x1cc2c9['body']['attachments'][0x0]['id']})['then'](function(_0x23f67f){_0x418a1f[_0x8a33('0xb5')][_0x8a33('0xb1')]=[];_0x418a1f[_0x8a33('0xb5')]['Messages'][_0x8a33('0x8a')](_0x23f67f[_0x8a33('0xb5')]);return _0x418a1f;});})['then'](function(_0x1e4e6c){respondWithRpcPromise(_0x8a33('0xb6'),_0x8a33('0xb6'),{'FaxAccountId':_[_0x8a33('0xa9')](_0x1cc2c9[_0x8a33('0x55')]['id'])?undefined:_0x1cc2c9[_0x8a33('0x55')]['id'],'path':_[_0x8a33('0xa9')](_0x1cc2c9[_0x8a33('0x5a')][_0x8a33('0xa5')][0x0][_0x8a33('0xaa')])?undefined:_0x1cc2c9[_0x8a33('0x5a')][_0x8a33('0xa5')][0x0]['path'],'fax':_[_0x8a33('0xa9')](_0x1cc2c9[_0x8a33('0x5a')]['to'][0x0])?undefined:_0x1cc2c9[_0x8a33('0x5a')]['to'][0x0],'AttachmentId':_0x1cc2c9[_0x8a33('0x5a')]['attachments'][0x0]['id']},client9002)['then'](function(_0x4f0dea){logger[_0x8a33('0x1e')](_0x8a33('0xb7'),_0x4f0dea);})['catch'](function(_0x4e7ffa){logger[_0x8a33('0x1e')](_0x8a33('0xb7'),_0x4e7ffa);});return _0x1e4e6c;})[_0x8a33('0x1d')](respondWithResult(_0x41b784,null))[_0x8a33('0x25')](handleError(_0x41b784,null));};exports[_0x8a33('0xb8')]=function(_0x51246a,_0x4440f7,_0x3ad5a6){return db[_0x8a33('0x3a')][_0x8a33('0x5e')]({'where':{'id':_0x51246a[_0x8a33('0x55')]['id']}})[_0x8a33('0x1d')](handleEntityNotFound(_0x4440f7,null))[_0x8a33('0x1d')](function(_0x250d7e){if(_0x250d7e){return _0x250d7e[_0x8a33('0xb8')](_0x51246a[_0x8a33('0x5a')][_0x8a33('0x6a')],_['omit'](_0x51246a['body'],['ids','id'])||{})['spread'](function(_0x3a1b00){for(var _0x1fdfee=0x0;_0x1fdfee<_0x51246a[_0x8a33('0x5a')][_0x8a33('0x6a')][_0x8a33('0x68')];_0x1fdfee+=0x1){socket[_0x8a33('0xb9')](_0x8a33('0xba'),{'UserId':Number(_0x51246a[_0x8a33('0x5a')][_0x8a33('0x6a')][_0x1fdfee]),'FaxAccountId':Number(_0x51246a[_0x8a33('0x55')]['id'])});}return _0x3a1b00;});}})['then'](respondWithResult(_0x4440f7,null))[_0x8a33('0x25')](handleError(_0x4440f7,null));};exports['removeAgents']=function(_0x3b941f,_0x29ad1a,_0x4e069d){return db[_0x8a33('0x3a')][_0x8a33('0x5e')]({'where':{'id':_0x3b941f[_0x8a33('0x55')]['id']}})['then'](handleEntityNotFound(_0x29ad1a,null))[_0x8a33('0x1d')](function(_0x20605f){if(_0x20605f){return _0x20605f[_0x8a33('0xbb')](_0x3b941f['query']['ids'])[_0x8a33('0x1d')](function(){if(_[_0x8a33('0xbc')](_0x3b941f[_0x8a33('0x40')][_0x8a33('0x6a')])){for(var _0x4fcfe1=0x0;_0x4fcfe1<_0x3b941f[_0x8a33('0x40')][_0x8a33('0x6a')][_0x8a33('0x68')];_0x4fcfe1+=0x1){socket['emit']('userFaxAccount:remove',{'UserId':Number(_0x3b941f[_0x8a33('0x40')]['ids'][_0x4fcfe1]),'FaxAccountId':Number(_0x3b941f['params']['id'])});}}else{socket['emit']('userFaxAccount:remove',{'UserId':Number(_0x3b941f[_0x8a33('0x40')][_0x8a33('0x6a')]),'FaxAccountId':Number(_0x3b941f[_0x8a33('0x55')]['id'])});}});}})[_0x8a33('0x1d')](respondWithStatusCode(_0x29ad1a,null))[_0x8a33('0x25')](handleError(_0x29ad1a,null));};exports[_0x8a33('0xbd')]=function(_0x17ed1a,_0x2073b0,_0x3dd51f){var _0x25101f={};var _0x5eb00b={};var _0x176da4;var _0x5e7644;return db['FaxAccount']['findOne']({'where':{'id':_0x17ed1a[_0x8a33('0x55')]['id']}})['then'](handleEntityNotFound(_0x2073b0,null))[_0x8a33('0x1d')](function(_0x3cffb6){if(_0x3cffb6){_0x176da4=_0x3cffb6;_0x5eb00b[_0x8a33('0x3e')]=_['keys'](db[_0x8a33('0xbe')][_0x8a33('0x3b')]);_0x5eb00b['query']=_['keys'](_0x17ed1a[_0x8a33('0x40')]);_0x5eb00b[_0x8a33('0x42')]=_[_0x8a33('0x43')](_0x5eb00b[_0x8a33('0x3e')],_0x5eb00b[_0x8a33('0x40')]);_0x25101f[_0x8a33('0x45')]=_[_0x8a33('0x43')](_0x5eb00b[_0x8a33('0x3e')],qs[_0x8a33('0x44')](_0x17ed1a['query'][_0x8a33('0x44')]));_0x25101f['attributes']=_0x25101f['attributes'][_0x8a33('0x68')]?_0x25101f[_0x8a33('0x45')]:_0x5eb00b[_0x8a33('0x3e')];_0x25101f[_0x8a33('0x49')]=qs[_0x8a33('0x4a')](_0x17ed1a['query'][_0x8a33('0x4a')]);_0x25101f[_0x8a33('0x4c')]=qs[_0x8a33('0x42')](_[_0x8a33('0x4b')](_0x17ed1a['query'],_0x5eb00b[_0x8a33('0x42')]));if(_0x17ed1a[_0x8a33('0x40')][_0x8a33('0x4f')]){_0x25101f[_0x8a33('0x4c')]=_[_0x8a33('0x50')](_0x25101f['where'],{'$or':_[_0x8a33('0x3f')](_0x25101f[_0x8a33('0x45')],function(_0x51d284){var _0x195518={};_0x195518[_0x51d284]={'$like':'%'+_0x17ed1a[_0x8a33('0x40')][_0x8a33('0x4f')]+'%'};return _0x195518;})});}_0x25101f=_[_0x8a33('0x50')]({},_0x25101f,_0x17ed1a[_0x8a33('0x58')]);return _0x176da4['getAgents'](_0x25101f);}})[_0x8a33('0x1d')](function(_0x3ef23f){if(_0x3ef23f){_0x5e7644=_0x3ef23f['length'];if(!_0x17ed1a[_0x8a33('0x40')]['hasOwnProperty']('nolimit')){_0x25101f[_0x8a33('0x48')]=qs[_0x8a33('0x48')](_0x17ed1a[_0x8a33('0x40')][_0x8a33('0x48')]);_0x25101f[_0x8a33('0x2a')]=qs['offset'](_0x17ed1a[_0x8a33('0x40')]['offset']);}return _0x176da4[_0x8a33('0xbd')](_0x25101f);}})[_0x8a33('0x1d')](function(_0x943c90){if(_0x943c90){return _0x943c90?{'count':_0x5e7644,'rows':_0x943c90}:null;}})[_0x8a33('0x1d')](respondWithResult(_0x2073b0,null))[_0x8a33('0x25')](handleError(_0x2073b0,null));}; \ No newline at end of file +var _0x220b=['$gte','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','List','Contacts','DESC','attachments','root','server/files/attachments','basename','isNil','from','\x22%s\x22\x20<%s>','fax','ListId','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','omit','emit','userFaxAccount:save','removeAgents','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxAccount.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','get','UserProfileResource','destroy','name','send','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','show','params','find','create','body','user','role','FaxAccounts','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','Pause','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','findAll','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','CmContact','Contact','User','Owner','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','stack','finally','getApplications','from-voip-provider','exten','localstationid','system','description','priority','appdata','push','Answer','CDR(type)=inbound-fax','gateway','faxdetect','headerinfo','maxrate','minrate','t38timeout','Wait','ReceiveFax','VoiceExtension','updateAccountApplications','createdAt','updatedAt','TrunkId','findById','getMessages'];(function(_0x37991c,_0x459b50){var _0x2b3918=function(_0x44629a){while(--_0x44629a){_0x37991c['push'](_0x37991c['shift']());}};_0x2b3918(++_0x459b50);}(_0x220b,0xe9));var _0xb220=function(_0x99868f,_0xbdb8e7){_0x99868f=_0x99868f-0x0;var _0x27a71b=_0x220b[_0x99868f];return _0x27a71b;};'use strict';var emlformat=require(_0xb220('0x0'));var rimraf=require(_0xb220('0x1'));var zipdir=require(_0xb220('0x2'));var jsonpatch=require(_0xb220('0x3'));var rp=require(_0xb220('0x4'));var moment=require('moment');var BPromise=require(_0xb220('0x5'));var Mustache=require(_0xb220('0x6'));var util=require(_0xb220('0x7'));var path=require(_0xb220('0x8'));var sox=require(_0xb220('0x9'));var csv=require('to-csv');var ejs=require(_0xb220('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb220('0xb'));var crypto=require(_0xb220('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb220('0xd'));var toCsv=require(_0xb220('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb220('0xf'));var qs=require(_0xb220('0x10'));var as=require(_0xb220('0x11'));var hardwareService=require(_0xb220('0x12'));var logger=require(_0xb220('0x13'))(_0xb220('0x14'));var utils=require('../../config/utils');var config=require(_0xb220('0x15'));var licenseUtil=require(_0xb220('0x16'));var db=require(_0xb220('0x17'))['db'];config[_0xb220('0x18')]=_[_0xb220('0x19')](config[_0xb220('0x18')],{'host':_0xb220('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb220('0x18')]));require(_0xb220('0x1b'))[_0xb220('0x1c')](socket);var jayson=require(_0xb220('0x1d'));var client=jayson[_0xb220('0x1e')][_0xb220('0x1f')]({'port':0x232c});var client9002=jayson[_0xb220('0x1e')][_0xb220('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x366fc7,_0x5ab4ba,_0x50a941,_0x486ea8){return new BPromise(function(_0x4effb3,_0x22b695){var _0x318dc2=_0x486ea8||client;return _0x318dc2[_0xb220('0x20')](_0x366fc7,_0x50a941)[_0xb220('0x21')](function(_0x1a6153){logger[_0xb220('0x22')]('FaxAccount,\x20%s,\x20%s',_0x5ab4ba,_0xb220('0x23'));logger[_0xb220('0x24')](_0xb220('0x25'),_0x5ab4ba,_0xb220('0x23'),JSON['stringify'](_0x1a6153));if(_0x1a6153['error']){if(_0x1a6153[_0xb220('0x26')][_0xb220('0x27')]===0x1f4){logger[_0xb220('0x26')](_0xb220('0x28'),_0x5ab4ba,_0x1a6153['error']['message']);return _0x22b695(_0x1a6153[_0xb220('0x26')][_0xb220('0x29')]);}logger[_0xb220('0x26')](_0xb220('0x28'),_0x5ab4ba,_0x1a6153[_0xb220('0x26')][_0xb220('0x29')]);return _0x4effb3(_0x1a6153[_0xb220('0x26')][_0xb220('0x29')]);}else{logger['info'](_0xb220('0x28'),_0x5ab4ba,_0xb220('0x23'));_0x4effb3(_0x1a6153[_0xb220('0x2a')][_0xb220('0x29')]);}})[_0xb220('0x2b')](function(_0x4e8132){logger[_0xb220('0x26')]('FaxAccount,\x20%s,\x20%s',_0x5ab4ba,_0x4e8132);_0x22b695(_0x4e8132);});});}function respondWithStatusCode(_0x290e94,_0x4ce647){_0x4ce647=_0x4ce647||0xcc;return function(_0x200e3a){if(_0x200e3a){return _0x290e94[_0xb220('0x2c')](_0x4ce647);}return _0x290e94['status'](_0x4ce647)[_0xb220('0x2d')]();};}function respondWithResult(_0x53d027,_0x4da3fc){_0x4da3fc=_0x4da3fc||0xc8;return function(_0x28901d){if(_0x28901d){return _0x53d027[_0xb220('0x2e')](_0x4da3fc)['json'](_0x28901d);}};}function respondWithFilteredResult(_0xa720bd,_0x48b860){return function(_0x127f8b){if(_0x127f8b){var _0x2ef841=typeof _0x48b860['offset']===_0xb220('0x2f')&&typeof _0x48b860[_0xb220('0x30')]===_0xb220('0x2f');var _0x301f9f=_0x127f8b[_0xb220('0x31')];var _0xc22c0f=_0x2ef841?0x0:_0x48b860[_0xb220('0x32')];var _0x109c0e=_0x2ef841?_0x127f8b[_0xb220('0x31')]:_0x48b860[_0xb220('0x32')]+_0x48b860[_0xb220('0x30')];var _0x571146;if(_0x109c0e>=_0x301f9f){_0x109c0e=_0x301f9f;_0x571146=0xc8;}else{_0x571146=0xce;}_0xa720bd[_0xb220('0x2e')](_0x571146);return _0xa720bd[_0xb220('0x33')](_0xb220('0x34'),_0xc22c0f+'-'+_0x109c0e+'/'+_0x301f9f)[_0xb220('0x35')](_0x127f8b);}return null;};}function patchUpdates(_0x4a3595){return function(_0x3d419f){try{jsonpatch[_0xb220('0x36')](_0x3d419f,_0x4a3595,!![]);}catch(_0x25b44b){return BPromise[_0xb220('0x37')](_0x25b44b);}return _0x3d419f[_0xb220('0x38')]();};}function saveUpdates(_0x10fb7e,_0x513bce){return function(_0x464a01){if(_0x464a01){return _0x464a01['update'](_0x10fb7e)[_0xb220('0x21')](function(_0x2f053c){return _0x2f053c;});}return null;};}function removeEntity(_0x425ad8,_0x51a125){return function(_0x36ddb9){if(_0x36ddb9){return _0x36ddb9['destroy']()['then'](function(){var _0x1a7b1d=_0x36ddb9[_0xb220('0x39')]({'plain':!![]});var _0x39f653='FaxAccounts';return db[_0xb220('0x3a')][_0xb220('0x3b')]({'where':{'type':_0x39f653,'resourceId':_0x1a7b1d['id']}})[_0xb220('0x21')](function(){return _0x36ddb9;});})[_0xb220('0x21')](function(){_0x425ad8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x50bb32,_0x40d8c0){return function(_0x4247e9){if(!_0x4247e9){_0x50bb32[_0xb220('0x2c')](0x194);}return _0x4247e9;};}function handleError(_0x2509fa,_0x1582fb){_0x1582fb=_0x1582fb||0x1f4;return function(_0x5e0846){logger[_0xb220('0x26')](_0x5e0846['stack']);if(_0x5e0846[_0xb220('0x3c')]){delete _0x5e0846['name'];}_0x2509fa[_0xb220('0x2e')](_0x1582fb)[_0xb220('0x3d')](_0x5e0846);};}exports['index']=function(_0x4279b9,_0x439d87){var _0x4093eb={'include':[{'model':db['Pause'],'as':_0xb220('0x3e')}]},_0x2d6f4e={},_0x43c7ec={'count':0x0,'rows':[]};var _0x57e5b1=_[_0xb220('0x3f')](db[_0xb220('0x40')][_0xb220('0x41')],function(_0x11e36f){return{'name':_0x11e36f[_0xb220('0x42')],'type':_0x11e36f['type'][_0xb220('0x43')]};});_0x2d6f4e[_0xb220('0x44')]=_[_0xb220('0x3f')](_0x57e5b1,_0xb220('0x3c'));_0x2d6f4e[_0xb220('0x45')]=_[_0xb220('0x46')](_0x4279b9[_0xb220('0x45')]);_0x2d6f4e['filters']=_[_0xb220('0x47')](_0x2d6f4e['model'],_0x2d6f4e['query']);_0x4093eb[_0xb220('0x48')]=_[_0xb220('0x47')](_0x2d6f4e[_0xb220('0x44')],qs[_0xb220('0x49')](_0x4279b9[_0xb220('0x45')][_0xb220('0x49')]));_0x4093eb[_0xb220('0x48')]=_0x4093eb[_0xb220('0x48')][_0xb220('0x4a')]?_0x4093eb[_0xb220('0x48')]:_0x2d6f4e[_0xb220('0x44')];if(!_0x4279b9[_0xb220('0x45')][_0xb220('0x4b')](_0xb220('0x4c'))){_0x4093eb[_0xb220('0x30')]=qs[_0xb220('0x30')](_0x4279b9[_0xb220('0x45')][_0xb220('0x30')]);_0x4093eb[_0xb220('0x32')]=qs[_0xb220('0x32')](_0x4279b9['query']['offset']);}_0x4093eb[_0xb220('0x4d')]=qs[_0xb220('0x4e')](_0x4279b9[_0xb220('0x45')][_0xb220('0x4e')]);_0x4093eb[_0xb220('0x4f')]=qs[_0xb220('0x50')](_[_0xb220('0x51')](_0x4279b9[_0xb220('0x45')],_0x2d6f4e[_0xb220('0x50')]),_0x57e5b1);if(_0x4279b9[_0xb220('0x45')][_0xb220('0x52')]){_0x4093eb[_0xb220('0x4f')]=_[_0xb220('0x53')](_0x4093eb[_0xb220('0x4f')],{'$or':_['map'](_0x57e5b1,function(_0x88e92c){if(_0x88e92c[_0xb220('0x54')]!==_0xb220('0x55')){var _0x99d33c={};_0x99d33c[_0x88e92c[_0xb220('0x3c')]]={'$like':'%'+_0x4279b9[_0xb220('0x45')][_0xb220('0x52')]+'%'};return _0x99d33c;}})});}_0x4093eb=_[_0xb220('0x53')]({},_0x4093eb,_0x4279b9[_0xb220('0x56')]);var _0x1dcc0e={'where':_0x4093eb[_0xb220('0x4f')]};return db[_0xb220('0x40')]['count'](_0x1dcc0e)[_0xb220('0x21')](function(_0x1c4d71){_0x43c7ec[_0xb220('0x31')]=_0x1c4d71;if(_0x4279b9[_0xb220('0x45')][_0xb220('0x57')]){_0x4093eb[_0xb220('0x58')]=[{'all':!![]}];}return db[_0xb220('0x40')]['findAll'](_0x4093eb);})[_0xb220('0x21')](function(_0x37af5c){_0x43c7ec['rows']=_0x37af5c;return _0x43c7ec;})[_0xb220('0x21')](respondWithFilteredResult(_0x439d87,_0x4093eb))['catch'](handleError(_0x439d87,null));};exports[_0xb220('0x59')]=function(_0x28b1f7,_0x20d756){var _0x31409d={'raw':![],'where':{'id':_0x28b1f7[_0xb220('0x5a')]['id']},'include':[{'model':db['Pause'],'as':_0xb220('0x3e')}]},_0x16d050={};_0x16d050[_0xb220('0x44')]=_['keys'](db[_0xb220('0x40')][_0xb220('0x41')]);_0x16d050['query']=_[_0xb220('0x46')](_0x28b1f7[_0xb220('0x45')]);_0x16d050[_0xb220('0x50')]=_['intersection'](_0x16d050[_0xb220('0x44')],_0x16d050[_0xb220('0x45')]);_0x31409d[_0xb220('0x48')]=_['intersection'](_0x16d050[_0xb220('0x44')],qs[_0xb220('0x49')](_0x28b1f7[_0xb220('0x45')][_0xb220('0x49')]));_0x31409d['attributes']=_0x31409d[_0xb220('0x48')]['length']?_0x31409d[_0xb220('0x48')]:_0x16d050['model'];if(_0x28b1f7[_0xb220('0x45')][_0xb220('0x57')]){_0x31409d[_0xb220('0x58')]=[{'all':!![]}];}_0x31409d=_[_0xb220('0x53')]({},_0x31409d,_0x28b1f7[_0xb220('0x56')]);return db['FaxAccount'][_0xb220('0x5b')](_0x31409d)['then'](handleEntityNotFound(_0x20d756,null))['then'](respondWithResult(_0x20d756,null))[_0xb220('0x2b')](handleError(_0x20d756,null));};exports[_0xb220('0x5c')]=function(_0x4bc881,_0x5b1810){return db[_0xb220('0x40')][_0xb220('0x5c')](_0x4bc881[_0xb220('0x5d')],{})['then'](function(_0x42d0a1){var _0x3573fc=_0x4bc881[_0xb220('0x5e')][_0xb220('0x39')]({'plain':!![]});if(!_0x3573fc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3573fc[_0xb220('0x5f')]===_0xb220('0x5e')){var _0xd8a2a9=_0x42d0a1[_0xb220('0x39')]({'plain':!![]});var _0x37dbcc=_0xb220('0x60');return db[_0xb220('0x61')]['find']({'where':{'name':_0x37dbcc,'userProfileId':_0x3573fc['userProfileId']},'raw':!![]})[_0xb220('0x21')](function(_0x346265){if(_0x346265&&_0x346265[_0xb220('0x62')]===0x0){return db[_0xb220('0x3a')][_0xb220('0x5c')]({'name':_0xd8a2a9[_0xb220('0x3c')],'resourceId':_0xd8a2a9['id'],'type':_0x346265[_0xb220('0x3c')],'sectionId':_0x346265['id']},{})[_0xb220('0x21')](function(){return _0x42d0a1;});}else{return _0x42d0a1;}})[_0xb220('0x2b')](function(_0x392af4){logger[_0xb220('0x26')](_0xb220('0x63'),_0x392af4);throw _0x392af4;});}return _0x42d0a1;})[_0xb220('0x21')](respondWithResult(_0x5b1810,0xc9))[_0xb220('0x2b')](handleError(_0x5b1810,null));};exports[_0xb220('0x64')]=function(_0x3f8c6c,_0x4ad32d){if(_0x3f8c6c[_0xb220('0x5d')]['id']){delete _0x3f8c6c[_0xb220('0x5d')]['id'];}return db[_0xb220('0x40')][_0xb220('0x5b')]({'where':{'id':_0x3f8c6c[_0xb220('0x5a')]['id']},'include':[{'model':db[_0xb220('0x65')],'as':_0xb220('0x3e')}]})[_0xb220('0x21')](handleEntityNotFound(_0x4ad32d,null))[_0xb220('0x21')](saveUpdates(_0x3f8c6c['body'],null))[_0xb220('0x21')](respondWithResult(_0x4ad32d,null))[_0xb220('0x2b')](handleError(_0x4ad32d,null));};exports['destroy']=function(_0x7cde00,_0x1d1778){return db['FaxAccount'][_0xb220('0x5b')]({'where':{'id':_0x7cde00['params']['id']}})[_0xb220('0x21')](handleEntityNotFound(_0x1d1778,null))[_0xb220('0x21')](removeEntity(_0x1d1778,null))[_0xb220('0x2b')](handleError(_0x1d1778,null));};exports[_0xb220('0x66')]=function(_0x505d41,_0xa537e1){return db[_0xb220('0x40')][_0xb220('0x66')]()[_0xb220('0x21')](respondWithResult(_0xa537e1,null))[_0xb220('0x2b')](handleError(_0xa537e1,null));};exports[_0xb220('0x67')]=function(_0x356fa1,_0x1ede7b,_0x4f0be8){if(_0x356fa1[_0xb220('0x5d')]['id']){delete _0x356fa1[_0xb220('0x5d')]['id'];}return db[_0xb220('0x40')][_0xb220('0x5b')]({'where':{'id':_0x356fa1[_0xb220('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1ede7b,null))[_0xb220('0x21')](function(_0x1b3490){if(_0x1b3490){_0x356fa1[_0xb220('0x5d')][_0xb220('0x68')]=_0x1b3490['id'];return db[_0xb220('0x69')]['create'](_0x356fa1[_0xb220('0x5d')]);}})[_0xb220('0x21')](respondWithResult(_0x1ede7b,null))[_0xb220('0x2b')](handleError(_0x1ede7b,null));};exports[_0xb220('0x6a')]=function(_0x579411,_0x4ec9a5,_0x305b66){var _0x3986e4={'raw':![],'where':{}};var _0x66681b={};var _0x3f82b0={'count':0x0,'rows':[]};return db[_0xb220('0x40')][_0xb220('0x6b')]({'where':{'id':_0x579411['params']['id']}})[_0xb220('0x21')](handleEntityNotFound(_0x4ec9a5,null))['then'](function(_0x2cbf72){if(_0x2cbf72){_0x66681b['model']=_['keys'](db[_0xb220('0x69')][_0xb220('0x41')]);_0x66681b['query']=_[_0xb220('0x46')](_0x579411[_0xb220('0x45')]);_0x66681b[_0xb220('0x50')]=_['intersection'](_0x66681b[_0xb220('0x44')],_0x66681b[_0xb220('0x45')]);_0x3986e4[_0xb220('0x48')]=_[_0xb220('0x47')](_0x66681b[_0xb220('0x44')],qs[_0xb220('0x49')](_0x579411[_0xb220('0x45')][_0xb220('0x49')]));_0x3986e4[_0xb220('0x48')]=_0x3986e4[_0xb220('0x48')]['length']?_0x3986e4['attributes']:_0x66681b[_0xb220('0x44')];if(!_0x579411[_0xb220('0x45')][_0xb220('0x4b')](_0xb220('0x4c'))){_0x3986e4[_0xb220('0x30')]=qs[_0xb220('0x30')](_0x579411[_0xb220('0x45')]['limit']);_0x3986e4[_0xb220('0x32')]=qs[_0xb220('0x32')](_0x579411[_0xb220('0x45')][_0xb220('0x32')]);}_0x3986e4[_0xb220('0x4d')]=qs[_0xb220('0x4e')](_0x579411[_0xb220('0x45')][_0xb220('0x4e')]);_0x3986e4['where']=qs[_0xb220('0x50')](_['pick'](_0x579411[_0xb220('0x45')],_0x66681b[_0xb220('0x50')]));_0x3986e4[_0xb220('0x4f')][_0xb220('0x68')]=_0x2cbf72['id'];if(_0x579411[_0xb220('0x45')][_0xb220('0x52')]){_0x3986e4[_0xb220('0x4f')]=_['merge'](_0x3986e4[_0xb220('0x4f')],{'$or':_[_0xb220('0x3f')](_0x3986e4[_0xb220('0x48')],function(_0x1590f3){var _0x170cb7={};_0x170cb7[_0x1590f3]={'$like':'%'+_0x579411['query'][_0xb220('0x52')]+'%'};return _0x170cb7;})});}_0x3986e4=_[_0xb220('0x53')]({},_0x3986e4,_0x579411[_0xb220('0x56')]);return db[_0xb220('0x69')][_0xb220('0x31')]({'where':_0x3986e4[_0xb220('0x4f')]})[_0xb220('0x21')](function(_0xaed099){_0x3f82b0['count']=_0xaed099;if(_0x579411[_0xb220('0x45')][_0xb220('0x57')]){_0x3986e4[_0xb220('0x58')]=[{'all':!![]}];}return db['Disposition'][_0xb220('0x6c')](_0x3986e4);})[_0xb220('0x21')](function(_0x5ad887){_0x3f82b0[_0xb220('0x6d')]=_0x5ad887;return _0x3f82b0;});}})[_0xb220('0x21')](respondWithFilteredResult(_0x4ec9a5,_0x3986e4))[_0xb220('0x2b')](handleError(_0x4ec9a5,null));};exports[_0xb220('0x6e')]=function(_0x46c14e,_0x23d516,_0x594ca9){return db['FaxAccount'][_0xb220('0x5b')]({'where':{'id':_0x46c14e[_0xb220('0x5a')]['id']}})[_0xb220('0x21')](handleEntityNotFound(_0x23d516,null))[_0xb220('0x21')](function(_0x45e41f){if(_0x45e41f){return _0x45e41f[_0xb220('0x6e')](_0x46c14e[_0xb220('0x45')][_0xb220('0x6f')]);}})[_0xb220('0x21')](respondWithStatusCode(_0x23d516,null))[_0xb220('0x2b')](handleError(_0x23d516,null));};exports[_0xb220('0x70')]=function(_0x1c478a,_0x5865a4,_0x472c46){if(_0x1c478a[_0xb220('0x5d')]['id']){delete _0x1c478a[_0xb220('0x5d')]['id'];}return db[_0xb220('0x40')][_0xb220('0x5b')]({'where':{'id':_0x1c478a[_0xb220('0x5a')]['id']}})['then'](handleEntityNotFound(_0x5865a4,null))['then'](function(_0x12d3d5){if(_0x12d3d5){_0x1c478a['body'][_0xb220('0x68')]=_0x12d3d5['id'];return db[_0xb220('0x71')]['create'](_0x1c478a['body']);}})[_0xb220('0x21')](respondWithResult(_0x5865a4,null))[_0xb220('0x2b')](handleError(_0x5865a4,null));};exports[_0xb220('0x72')]=function(_0x3d2cd9,_0x2bb830,_0x27e370){var _0x4c39ef={'raw':![],'where':{}};var _0xd1b32e={};var _0x3479ce={'count':0x0,'rows':[]};return db[_0xb220('0x40')][_0xb220('0x6b')]({'where':{'id':_0x3d2cd9['params']['id']}})[_0xb220('0x21')](handleEntityNotFound(_0x2bb830,null))[_0xb220('0x21')](function(_0x3f9ae3){if(_0x3f9ae3){_0xd1b32e[_0xb220('0x44')]=_[_0xb220('0x46')](db['CannedAnswer'][_0xb220('0x41')]);_0xd1b32e[_0xb220('0x45')]=_[_0xb220('0x46')](_0x3d2cd9[_0xb220('0x45')]);_0xd1b32e[_0xb220('0x50')]=_['intersection'](_0xd1b32e['model'],_0xd1b32e[_0xb220('0x45')]);_0x4c39ef[_0xb220('0x48')]=_['intersection'](_0xd1b32e[_0xb220('0x44')],qs[_0xb220('0x49')](_0x3d2cd9[_0xb220('0x45')][_0xb220('0x49')]));_0x4c39ef['attributes']=_0x4c39ef[_0xb220('0x48')][_0xb220('0x4a')]?_0x4c39ef['attributes']:_0xd1b32e[_0xb220('0x44')];if(!_0x3d2cd9[_0xb220('0x45')][_0xb220('0x4b')](_0xb220('0x4c'))){_0x4c39ef[_0xb220('0x30')]=qs[_0xb220('0x30')](_0x3d2cd9[_0xb220('0x45')][_0xb220('0x30')]);_0x4c39ef[_0xb220('0x32')]=qs[_0xb220('0x32')](_0x3d2cd9[_0xb220('0x45')][_0xb220('0x32')]);}_0x4c39ef[_0xb220('0x4d')]=qs['sort'](_0x3d2cd9[_0xb220('0x45')][_0xb220('0x4e')]);_0x4c39ef[_0xb220('0x4f')]=qs['filters'](_['pick'](_0x3d2cd9[_0xb220('0x45')],_0xd1b32e['filters']));_0x4c39ef['where'][_0xb220('0x68')]=_0x3f9ae3['id'];if(_0x3d2cd9['query'][_0xb220('0x52')]){_0x4c39ef[_0xb220('0x4f')]=_[_0xb220('0x53')](_0x4c39ef[_0xb220('0x4f')],{'$or':_[_0xb220('0x3f')](_0x4c39ef['attributes'],function(_0x40ff4d){var _0x408e0c={};_0x408e0c[_0x40ff4d]={'$like':'%'+_0x3d2cd9[_0xb220('0x45')][_0xb220('0x52')]+'%'};return _0x408e0c;})});}_0x4c39ef=_[_0xb220('0x53')]({},_0x4c39ef,_0x3d2cd9[_0xb220('0x56')]);return db[_0xb220('0x71')][_0xb220('0x31')]({'where':_0x4c39ef[_0xb220('0x4f')]})[_0xb220('0x21')](function(_0x305cdf){_0x3479ce['count']=_0x305cdf;if(_0x3d2cd9['query'][_0xb220('0x57')]){_0x4c39ef['include']=[{'all':!![]}];}return db[_0xb220('0x71')]['findAll'](_0x4c39ef);})[_0xb220('0x21')](function(_0x4c00f8){_0x3479ce[_0xb220('0x6d')]=_0x4c00f8;return _0x3479ce;});}})[_0xb220('0x21')](respondWithFilteredResult(_0x2bb830,_0x4c39ef))[_0xb220('0x2b')](handleError(_0x2bb830,null));};exports['removeAnswers']=function(_0x912905,_0x503c26,_0xe83535){return db[_0xb220('0x40')][_0xb220('0x5b')]({'where':{'id':_0x912905[_0xb220('0x5a')]['id']}})[_0xb220('0x21')](handleEntityNotFound(_0x503c26,null))[_0xb220('0x21')](function(_0x36dee1){if(_0x36dee1){return _0x36dee1[_0xb220('0x73')](_0x912905[_0xb220('0x45')]['ids']);}})['then'](respondWithStatusCode(_0x503c26,null))[_0xb220('0x2b')](handleError(_0x503c26,null));};exports[_0xb220('0x74')]=function(_0x2dffd3,_0x3bd8d3,_0x4f65f3){return db[_0xb220('0x75')][_0xb220('0x5b')]({'where':{'id':_0x2dffd3[_0xb220('0x5a')]['id']}})[_0xb220('0x21')](handleEntityNotFound(_0x3bd8d3,null))[_0xb220('0x21')](function(_0x589178){if(_0x589178){return _0x589178[_0xb220('0x74')](_0x2dffd3['body'][_0xb220('0x6f')],_['omit'](_0x2dffd3[_0xb220('0x5d')],[_0xb220('0x6f'),'id'])||{});}})['then'](respondWithResult(_0x3bd8d3,null))[_0xb220('0x2b')](handleError(_0x3bd8d3,null));};exports['getInteractions']=function(_0x5c9bc9,_0x242a42,_0xd8a5af){var _0x30a9cd={'raw':![],'where':{}};var _0xed9536={};var _0x175ad1={'count':0x0,'rows':[]};return db['FaxAccount'][_0xb220('0x6b')]({'where':{'id':_0x5c9bc9[_0xb220('0x5a')]['id']}})[_0xb220('0x21')](handleEntityNotFound(_0x242a42,null))[_0xb220('0x21')](function(_0x5ac6af){if(_0x5ac6af){_0xed9536[_0xb220('0x44')]=_['keys'](db[_0xb220('0x75')][_0xb220('0x41')]);_0xed9536[_0xb220('0x45')]=_[_0xb220('0x46')](_0x5c9bc9[_0xb220('0x45')]);_0xed9536['filters']=_['intersection'](_0xed9536[_0xb220('0x44')],_0xed9536['query']);_0x30a9cd[_0xb220('0x48')]=_[_0xb220('0x47')](_0xed9536[_0xb220('0x44')],qs['fields'](_0x5c9bc9[_0xb220('0x45')][_0xb220('0x49')]));_0x30a9cd[_0xb220('0x48')]=_0x30a9cd[_0xb220('0x48')][_0xb220('0x4a')]?_0x30a9cd[_0xb220('0x48')]:_0xed9536[_0xb220('0x44')];if(!_0x5c9bc9[_0xb220('0x45')][_0xb220('0x4b')](_0xb220('0x4c'))){_0x30a9cd[_0xb220('0x30')]=qs[_0xb220('0x30')](_0x5c9bc9[_0xb220('0x45')][_0xb220('0x30')]);_0x30a9cd[_0xb220('0x32')]=qs['offset'](_0x5c9bc9[_0xb220('0x45')][_0xb220('0x32')]);}_0x30a9cd['order']=qs[_0xb220('0x4e')](_0x5c9bc9[_0xb220('0x45')][_0xb220('0x4e')]);_0x30a9cd[_0xb220('0x4f')]=qs[_0xb220('0x50')](_[_0xb220('0x51')](_0x5c9bc9[_0xb220('0x45')],_0xed9536['filters']));_0x30a9cd[_0xb220('0x4f')][_0xb220('0x68')]=_0x5ac6af['id'];if(_0x5c9bc9[_0xb220('0x45')][_0xb220('0x52')]){_0x30a9cd[_0xb220('0x4f')]=_[_0xb220('0x53')](_0x30a9cd[_0xb220('0x4f')],{'$or':_[_0xb220('0x3f')](_0x30a9cd[_0xb220('0x48')],function(_0x571967){var _0x42a16c={};_0x42a16c[_0x571967]={'$like':'%'+_0x5c9bc9[_0xb220('0x45')]['filter']+'%'};return _0x42a16c;})});}_0x30a9cd=_[_0xb220('0x53')]({},_0x30a9cd,_0x5c9bc9[_0xb220('0x56')]);return db[_0xb220('0x75')][_0xb220('0x31')]({'where':_0x30a9cd[_0xb220('0x4f')]})[_0xb220('0x21')](function(_0x4ef9fb){_0x175ad1[_0xb220('0x31')]=_0x4ef9fb;if(_0x5c9bc9[_0xb220('0x45')][_0xb220('0x57')]){_0x30a9cd[_0xb220('0x58')]=[{'model':db[_0xb220('0x76')],'as':_0xb220('0x77'),'required':![]},{'model':db[_0xb220('0x78')],'as':_0xb220('0x79'),'attributes':['name','fullname','internal'],'required':![]},{'model':db[_0xb220('0x7a')],'as':_0xb220('0x7b'),'attributes':['id',_0xb220('0x3c'),_0xb220('0x7c')],'where':_0x5c9bc9[_0xb220('0x45')][_0xb220('0x7d')]?{'id':_0x5c9bc9[_0xb220('0x45')][_0xb220('0x7d')]}:undefined,'required':_0x5c9bc9['query'][_0xb220('0x7d')]?!![]:![]}];}return db[_0xb220('0x75')]['findAll'](_0x30a9cd);})[_0xb220('0x21')](function(_0x1bc1a8){_0x175ad1['rows']=_0x1bc1a8;return _0x175ad1;});}})['then'](respondWithFilteredResult(_0x242a42,_0x30a9cd))[_0xb220('0x2b')](handleError(_0x242a42,null));};exports[_0xb220('0x7e')]=function(_0x8fb2f5,_0x3bab55){var _0x49eda1=_0x8fb2f5[_0xb220('0x5a')]['id'];var _0x3b5228=_0x8fb2f5[_0xb220('0x5d')];var _0x266684=0xc8;var _0x19fc83=null;return db[_0xb220('0x7f')][_0xb220('0x80')]({'isolationLevel':db['sequelize'][_0xb220('0x81')][_0xb220('0x82')][_0xb220('0x83')]},function(_0x430b78){return db[_0xb220('0x40')][_0xb220('0x6b')]({'where':{'id':_0x49eda1},'transaction':_0x430b78})[_0xb220('0x21')](function(_0x24d360){if(_0x24d360){return db[_0xb220('0x84')][_0xb220('0x3b')]({'where':{'FaxAccountId':_0x49eda1},'transaction':_0x430b78})[_0xb220('0x21')](function(){var _0x150b45=_[_0xb220('0x3f')](_0x3b5228,function(_0x391eb1){_0x391eb1[_0xb220('0x68')]=_0x49eda1;return _0x391eb1;});return db[_0xb220('0x84')][_0xb220('0x85')](_0x150b45,{'transaction':_0x430b78});});}else{_0x266684=0x194;_0x19fc83=[];}});})[_0xb220('0x21')](function(){if(_0x266684!==0x194){return db[_0xb220('0x84')][_0xb220('0x86')]({'where':{'FaxAccountId':_0x49eda1},'order':'priority'})[_0xb220('0x21')](function(_0xb4e72a){_0x19fc83=_0xb4e72a;});}})['catch'](function(_0x4bc958){_0x266684=0x1f4;logger['error'](_0x4bc958[_0xb220('0x87')]);if(_0x4bc958[_0xb220('0x3c')]){delete _0x4bc958['name'];}_0x19fc83=_0x4bc958;})[_0xb220('0x88')](function(){if(_0x19fc83===null){_0x3bab55['sendStatus'](_0x266684);}else{if(_0x266684===0x1f4){_0x3bab55['status'](_0x266684)[_0xb220('0x3d')](_0x19fc83);}else{_0x3bab55['status'](_0x266684)[_0xb220('0x35')](_0x19fc83);}}});};exports[_0xb220('0x89')]=function(_0x349422,_0x2b6757,_0x2fed2a){var _0x3d3261={};var _0x39e8d8={};var _0x140817;var _0x472291;return db[_0xb220('0x40')][_0xb220('0x6b')]({'where':{'id':_0x349422['params']['id']}})[_0xb220('0x21')](handleEntityNotFound(_0x2b6757,null))[_0xb220('0x21')](function(_0x3ea8fe){if(_0x3ea8fe){_0x140817=_0x3ea8fe;_0x39e8d8['model']=_[_0xb220('0x46')](db[_0xb220('0x84')]['rawAttributes']);_0x39e8d8[_0xb220('0x45')]=_[_0xb220('0x46')](_0x349422[_0xb220('0x45')]);_0x39e8d8['filters']=_['intersection'](_0x39e8d8['model'],_0x39e8d8['query']);_0x3d3261['attributes']=_['intersection'](_0x39e8d8[_0xb220('0x44')],qs[_0xb220('0x49')](_0x349422[_0xb220('0x45')][_0xb220('0x49')]));_0x3d3261[_0xb220('0x48')]=_0x3d3261[_0xb220('0x48')][_0xb220('0x4a')]?_0x3d3261[_0xb220('0x48')]:_0x39e8d8[_0xb220('0x44')];_0x3d3261[_0xb220('0x4d')]=qs['sort'](_0x349422['query']['sort']);_0x3d3261[_0xb220('0x4f')]=qs[_0xb220('0x50')](_[_0xb220('0x51')](_0x349422[_0xb220('0x45')],_0x39e8d8[_0xb220('0x50')]));if(_0x349422[_0xb220('0x45')]['filter']){_0x3d3261[_0xb220('0x4f')]=_['merge'](_0x3d3261['where'],{'$or':_[_0xb220('0x3f')](_0x3d3261[_0xb220('0x48')],function(_0x20dcbc){var _0x585e17={};_0x585e17[_0x20dcbc]={'$like':'%'+_0x349422['query'][_0xb220('0x52')]+'%'};return _0x585e17;})});}_0x3d3261=_['merge']({},_0x3d3261,_0x349422[_0xb220('0x56')]);return _0x140817[_0xb220('0x89')](_0x3d3261);}})[_0xb220('0x21')](function(_0x77c7f7){if(_0x77c7f7){_0x472291=_0x77c7f7[_0xb220('0x4a')];if(!_0x349422['query'][_0xb220('0x4b')](_0xb220('0x4c'))){_0x3d3261[_0xb220('0x30')]=qs['limit'](_0x349422[_0xb220('0x45')][_0xb220('0x30')]);_0x3d3261['offset']=qs['offset'](_0x349422[_0xb220('0x45')][_0xb220('0x32')]);}return _0x140817[_0xb220('0x89')](_0x3d3261);}})['then'](function(_0xeff245){if(_0xeff245){return _0xeff245?{'count':_0x472291,'rows':_0xeff245}:null;}})['then'](respondWithResult(_0x2b6757,null))[_0xb220('0x2b')](handleError(_0x2b6757,null));};function Extension(_0x5b058b,_0x2db01f,_0x2b75a8,_0x22fa5b){this['context']=_0xb220('0x8a');this[_0xb220('0x8b')]=_0x5b058b[_0xb220('0x8c')];this['app']=_0x22fa5b;this[_0xb220('0x54')]=_0xb220('0x8d');this[_0xb220('0x8e')]='Fax\x20Extension';this['FaxAccountId']=_0x5b058b['id'];this[_0xb220('0x8f')]=_0x2db01f;this[_0xb220('0x90')]=_0x2b75a8;}function createExtensionsReciveFax(_0x52d087){var _0x32f24c=0x1;var _0x140a16=[];_0x140a16[_0xb220('0x91')](new Extension(_0x52d087,_0x32f24c,'',_0xb220('0x92')));_0x32f24c+=0x1;_0x140a16[_0xb220('0x91')](new Extension(_0x52d087,_0x32f24c,_0xb220('0x93'),'Set'));_0x32f24c+=0x1;for(var _0x566870 in _0x52d087){if(_0x52d087[_0xb220('0x4b')](_0x566870)&&(_0x566870==='ecm'||_0x566870===_0xb220('0x8c')||_0x566870===_0xb220('0x94')||_0x566870===_0xb220('0x95')||_0x566870===_0xb220('0x96')||_0x566870===_0xb220('0x97')||_0x566870===_0xb220('0x98')||_0x566870==='modem'||_0x566870===_0xb220('0x99'))){_0x140a16['push'](new Extension(_0x52d087,_0x32f24c,'FAXOPT('+_0x566870+')='+_0x52d087[_0x566870],'Set'));_0x32f24c+=0x1;}}_0x140a16[_0xb220('0x91')](new Extension(_0x52d087,_0x32f24c,'6',_0xb220('0x9a')));_0x32f24c+=0x1;_0x140a16[_0xb220('0x91')](new Extension(_0x52d087,_0x32f24c,'/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d',_0xb220('0x9b')));_0x32f24c=0x0;return _0x140a16;}exports['addAccountApplications']=function(_0x161043,_0x488616,_0x400bfd){var _0x15da41;return db[_0xb220('0x7f')][_0xb220('0x80')](function(_0x56ded3){return db[_0xb220('0x40')][_0xb220('0x5c')](_0x161043['body'],{'transaction':_0x56ded3})['then'](function(_0x4a99ea){_0x15da41=_0x4a99ea[_0xb220('0x39')]({'plain':!![]});return db[_0xb220('0x9c')][_0xb220('0x85')](createExtensionsReciveFax(_0x15da41),{'transaction':_0x56ded3});});})[_0xb220('0x21')](function(){return _0x15da41;})[_0xb220('0x21')](respondWithResult(_0x488616,null))[_0xb220('0x2b')](handleError(_0x488616,null));};exports[_0xb220('0x9d')]=function(_0x1ac5fb,_0x1c4c2d,_0x342945){var _0xdcbf04;return db['sequelize'][_0xb220('0x80')](function(_0x7178e){return db[_0xb220('0x40')][_0xb220('0x64')](_0x1ac5fb['body'],{'where':{'id':_0x1ac5fb[_0xb220('0x5d')]['id']},'transaction':_0x7178e})[_0xb220('0x21')](function(_0x3e08bc){return db[_0xb220('0x9c')][_0xb220('0x3b')]({'where':{'FaxAccountId':_0x1ac5fb[_0xb220('0x5d')]['id']},'transaction':_0x7178e})[_0xb220('0x21')](function(_0x5ab845){return db[_0xb220('0x9c')][_0xb220('0x85')](createExtensionsReciveFax(_['omit'](_0x1ac5fb[_0xb220('0x5d')],['tech',_0xb220('0x43'),_0xb220('0x9e'),_0xb220('0x9f'),_0xb220('0xa0'),'ListId'])),{'transaction':_0x7178e});});});})[_0xb220('0x21')](function(){return db[_0xb220('0x40')][_0xb220('0xa1')](_0x1ac5fb[_0xb220('0x5d')]['id']);})[_0xb220('0x21')](respondWithResult(_0x1c4c2d,null))[_0xb220('0x2b')](handleError(_0x1c4c2d,null));};exports[_0xb220('0xa2')]=function(_0x59e35f,_0x5a1992,_0x3559d2){var _0x318ad8={'raw':!![],'where':{}};var _0x12bb18={};var _0x523c66={'count':0x0,'rows':[]};return db[_0xb220('0x40')][_0xb220('0x6b')]({'where':{'id':_0x59e35f[_0xb220('0x5a')]['id']}})[_0xb220('0x21')](handleEntityNotFound(_0x5a1992,null))['then'](function(_0x204398){if(_0x204398){_0x12bb18[_0xb220('0x44')]=_[_0xb220('0x46')](db['FaxMessage'][_0xb220('0x41')]);_0x12bb18['query']=_[_0xb220('0x46')](_0x59e35f['query']);_0x12bb18[_0xb220('0x50')]=_[_0xb220('0x47')](_0x12bb18[_0xb220('0x44')],_0x12bb18[_0xb220('0x45')]);_0x318ad8[_0xb220('0x48')]=_['intersection'](_0x12bb18[_0xb220('0x44')],qs['fields'](_0x59e35f[_0xb220('0x45')][_0xb220('0x49')]));_0x318ad8['attributes']=_0x318ad8[_0xb220('0x48')][_0xb220('0x4a')]?_0x318ad8[_0xb220('0x48')]:_0x12bb18[_0xb220('0x44')];if(!_0x59e35f[_0xb220('0x45')][_0xb220('0x4b')]('nolimit')){_0x318ad8[_0xb220('0x30')]=qs[_0xb220('0x30')](_0x59e35f['query']['limit']);_0x318ad8['offset']=qs['offset'](_0x59e35f[_0xb220('0x45')][_0xb220('0x32')]);}_0x318ad8[_0xb220('0x4d')]=qs[_0xb220('0x4e')](_0x59e35f[_0xb220('0x45')][_0xb220('0x4e')]);_0x318ad8[_0xb220('0x4f')]=qs[_0xb220('0x50')](_['pick'](_0x59e35f[_0xb220('0x45')],_0x12bb18[_0xb220('0x50')]));_0x318ad8['where'][_0xb220('0x68')]=_0x204398['id'];if(_0x59e35f[_0xb220('0x45')][_0xb220('0x52')]){_0x318ad8[_0xb220('0x4f')]=_[_0xb220('0x53')](_0x318ad8[_0xb220('0x4f')],{'$or':_[_0xb220('0x3f')](_0x318ad8[_0xb220('0x48')],function(_0x3986d8){var _0xf6b656={};_0xf6b656[_0x3986d8]={'$like':'%'+_0x59e35f[_0xb220('0x45')][_0xb220('0x52')]+'%'};return _0xf6b656;})});}if(_0x59e35f[_0xb220('0x45')][_0xb220('0xa3')]){var _0x17990e=_0x59e35f[_0xb220('0x45')][_0xb220('0xa3')]['split'](',');var _0x2259db={};_0x2259db[_0x17990e[0x0]]={'$gte':moment(_0x17990e[0x1])[_0xb220('0xa4')](_0xb220('0xa5'))};_0x318ad8[_0xb220('0x4f')]=_[_0xb220('0x53')](_0x318ad8[_0xb220('0x4f')],_0x2259db);}_0x318ad8=_[_0xb220('0x53')]({},_0x318ad8,_0x59e35f[_0xb220('0x56')]);return db['FaxMessage'][_0xb220('0x31')]({'where':_0x318ad8[_0xb220('0x4f')]})[_0xb220('0x21')](function(_0x54ac2d){_0x523c66[_0xb220('0x31')]=_0x54ac2d;if(_0x59e35f[_0xb220('0x45')][_0xb220('0x57')]){_0x318ad8[_0xb220('0x58')]=[{'all':!![]}];}return db[_0xb220('0xa6')]['findAll'](_0x318ad8);})[_0xb220('0x21')](function(_0x227099){_0x523c66[_0xb220('0x6d')]=_0x227099;return _0x523c66;});}})[_0xb220('0x21')](respondWithFilteredResult(_0x5a1992,_0x318ad8))[_0xb220('0x2b')](handleError(_0x5a1992,null));};exports[_0xb220('0x3d')]=function(_0x4f69eb,_0x8717d6,_0x214c2c){var _0x444ea4,_0x467c03={},_0x33d02b;if(_0x4f69eb[_0xb220('0x5d')]['to']){_0x33d02b=_0x4f69eb[_0xb220('0x5d')]['to'][0x0];}return db[_0xb220('0x40')][_0xb220('0x5b')]({'where':{'id':_0x4f69eb[_0xb220('0x5a')]['id']},'include':[{'model':db[_0xb220('0xa7')],'as':_0xb220('0xa8'),'include':[{'model':db[_0xb220('0x76')],'as':_0xb220('0xa9'),'where':{'fax':_0x33d02b},'limit':0x1,'order':[[_0xb220('0x9f'),_0xb220('0xaa')]]}]}]})[_0xb220('0x21')](handleEntityNotFound(_0x8717d6,null))[_0xb220('0x21')](function(_0x1e5dc6){_0x444ea4=_0x1e5dc6;if(_0x4f69eb['body'][_0xb220('0xab')]&&_0x4f69eb['body'][_0xb220('0xab')][_0xb220('0x4a')]){for(var _0x5ba6f9=0x0;_0x5ba6f9<_0x4f69eb[_0xb220('0x5d')][_0xb220('0xab')]['length'];_0x5ba6f9+=0x1){_0x4f69eb['body']['attachments'][_0x5ba6f9]={'filename':_0x4f69eb[_0xb220('0x5d')][_0xb220('0xab')][_0x5ba6f9]['name'],'id':_0x4f69eb[_0xb220('0x5d')][_0xb220('0xab')][_0x5ba6f9]['id'],'path':path['join'](config[_0xb220('0xac')],_0xb220('0xad'),_0x4f69eb[_0xb220('0x5d')][_0xb220('0xab')][_0x5ba6f9][_0xb220('0xae')])};}}return respondWithRpcPromise('CheckAfterSend','CheckAfterSend',{'FaxAccountId':_[_0xb220('0xaf')](_0x4f69eb[_0xb220('0x5a')]['id'])?undefined:_0x4f69eb['params']['id'],'path':_[_0xb220('0xaf')](_0x4f69eb['body']['attachments'][0x0]['path'])?undefined:_0x4f69eb[_0xb220('0x5d')]['attachments'][0x0][_0xb220('0x8')],'fax':_['isNil'](_0x4f69eb[_0xb220('0x5d')]['to'][0x0])?undefined:_0x4f69eb[_0xb220('0x5d')]['to'][0x0]},client9002);})['then'](function(){if(_0x444ea4){if(_['isNil'](_0x4f69eb[_0xb220('0x5d')][_0xb220('0xb0')])){_0x4f69eb[_0xb220('0x5d')][_0xb220('0xb0')]=util[_0xb220('0xa4')](_0xb220('0xb1'),_0x444ea4['name'],_0x444ea4[_0xb220('0xb2')]);}if(_0x444ea4['List']){if(_0x444ea4[_0xb220('0xa8')]['Contacts'][_0xb220('0x4a')]){return _0x444ea4[_0xb220('0xa8')][_0xb220('0xa9')][0x0];}else{return db[_0xb220('0x76')][_0xb220('0x5c')](_[_0xb220('0x19')](_0x4f69eb[_0xb220('0x5d')],{'firstName':_0x4f69eb['body']['to'][0x0],'phone':_0x4f69eb[_0xb220('0x5d')]['to'][0x0],'fax':_0x4f69eb[_0xb220('0x5d')]['to'][0x0],'ListId':_0x444ea4[_0xb220('0xb3')]}));}}else{throw new Error(_0xb220('0xb4'));}}else{throw new Error(_0xb220('0xb5'));}})['then'](function(_0x1d6027){if(_0x1d6027){return db[_0xb220('0x75')][_0xb220('0x5b')]({'where':{'ContactId':_0x1d6027['id'],'closed':![],'FaxAccountId':_0x444ea4['id']}})[_0xb220('0x21')](function(_0x275fe1){if(_0x275fe1){return[_0x275fe1,![]];}return db[_0xb220('0x75')][_0xb220('0x5c')]({'UserId':_0x4f69eb[_0xb220('0x5e')]['id'],'ContactId':_0x1d6027['id'],'FaxAccountId':_0x444ea4['id'],'fax':_0x4f69eb[_0xb220('0x5d')]['to'][0x0],'firstMsgDirection':_0xb220('0xb6'),'Messages':[_[_0xb220('0x53')](_0x4f69eb[_0xb220('0x5d')],{'read':![],'body':_0x4f69eb[_0xb220('0x5d')]['attachments'][0x0][_0xb220('0xb7')],'FaxAccountId':_0x444ea4['id'],'UserId':_0x4f69eb[_0xb220('0x5e')]['id'],'ContactId':_0x1d6027['id'],'AttachmentId':_0x4f69eb['body'][_0xb220('0xab')][0x0]['id']})]},{'include':[{'model':db[_0xb220('0xa6')],'as':_0xb220('0xb8')}]})[_0xb220('0x21')](function(_0x55a954){return[_0x55a954,!![]];});});}else{throw new Error(_0xb220('0xb9'));}})[_0xb220('0xba')](function(_0x2d3b29,_0x29df17){if(_0x29df17){return _0x2d3b29;}return db[_0xb220('0xa6')]['create']({'direction':'out','read':![],'body':_0x4f69eb['body'][_0xb220('0xab')][0x0][_0xb220('0xb7')],'FaxAccountId':_0x444ea4['id'],'FaxInteractionId':_0x2d3b29['id'],'UserId':_0x4f69eb['user']['id'],'ContactId':_0x2d3b29[_0xb220('0xbb')],'AttachmentId':_0x4f69eb[_0xb220('0x5d')][_0xb220('0xab')][0x0]['id']})[_0xb220('0x21')](function(_0x17aa56){_0x2d3b29['dataValues']['Messages']=[];_0x2d3b29[_0xb220('0xbc')][_0xb220('0xb8')][_0xb220('0x91')](_0x17aa56['dataValues']);return _0x2d3b29;});})['then'](function(_0x2d5014){respondWithRpcPromise(_0xb220('0xbd'),'SendFax',{'FaxAccountId':_[_0xb220('0xaf')](_0x4f69eb['params']['id'])?undefined:_0x4f69eb[_0xb220('0x5a')]['id'],'path':_['isNil'](_0x4f69eb[_0xb220('0x5d')][_0xb220('0xab')][0x0]['path'])?undefined:_0x4f69eb[_0xb220('0x5d')][_0xb220('0xab')][0x0][_0xb220('0x8')],'fax':_[_0xb220('0xaf')](_0x4f69eb[_0xb220('0x5d')]['to'][0x0])?undefined:_0x4f69eb[_0xb220('0x5d')]['to'][0x0],'AttachmentId':_0x4f69eb['body'][_0xb220('0xab')][0x0]['id']},client9002)[_0xb220('0x21')](function(_0x18adc9){logger[_0xb220('0x22')](_0xb220('0xbe'),_0x18adc9);})['catch'](function(_0x2d844d){logger['info'](_0xb220('0xbe'),_0x2d844d);});return _0x2d5014;})[_0xb220('0x21')](respondWithResult(_0x8717d6,null))['catch'](handleError(_0x8717d6,null));};exports[_0xb220('0xbf')]=function(_0x3b7d0f,_0x572364,_0x5949ae){return db['FaxAccount'][_0xb220('0x5b')]({'where':{'id':_0x3b7d0f[_0xb220('0x5a')]['id']}})[_0xb220('0x21')](handleEntityNotFound(_0x572364,null))[_0xb220('0x21')](function(_0x190cdd){if(_0x190cdd){return _0x190cdd[_0xb220('0xbf')](_0x3b7d0f[_0xb220('0x5d')][_0xb220('0x6f')],_[_0xb220('0xc0')](_0x3b7d0f[_0xb220('0x5d')],[_0xb220('0x6f'),'id'])||{})[_0xb220('0xba')](function(_0x467f3b){for(var _0x11acba=0x0;_0x11acba<_0x3b7d0f['body'][_0xb220('0x6f')][_0xb220('0x4a')];_0x11acba+=0x1){socket[_0xb220('0xc1')](_0xb220('0xc2'),{'UserId':Number(_0x3b7d0f[_0xb220('0x5d')][_0xb220('0x6f')][_0x11acba]),'FaxAccountId':Number(_0x3b7d0f[_0xb220('0x5a')]['id'])});}return _0x467f3b;});}})[_0xb220('0x21')](respondWithResult(_0x572364,null))[_0xb220('0x2b')](handleError(_0x572364,null));};exports[_0xb220('0xc3')]=function(_0xf084cc,_0x3159c5,_0xd137b7){return db[_0xb220('0x40')]['find']({'where':{'id':_0xf084cc['params']['id']}})[_0xb220('0x21')](handleEntityNotFound(_0x3159c5,null))['then'](function(_0x5be11f){if(_0x5be11f){return _0x5be11f[_0xb220('0xc3')](_0xf084cc[_0xb220('0x45')][_0xb220('0x6f')])[_0xb220('0x21')](function(){if(_['isArray'](_0xf084cc[_0xb220('0x45')][_0xb220('0x6f')])){for(var _0x19e5c3=0x0;_0x19e5c3<_0xf084cc[_0xb220('0x45')][_0xb220('0x6f')][_0xb220('0x4a')];_0x19e5c3+=0x1){socket[_0xb220('0xc1')](_0xb220('0xc4'),{'UserId':Number(_0xf084cc[_0xb220('0x45')]['ids'][_0x19e5c3]),'FaxAccountId':Number(_0xf084cc[_0xb220('0x5a')]['id'])});}}else{socket[_0xb220('0xc1')](_0xb220('0xc4'),{'UserId':Number(_0xf084cc[_0xb220('0x45')][_0xb220('0x6f')]),'FaxAccountId':Number(_0xf084cc[_0xb220('0x5a')]['id'])});}});}})[_0xb220('0x21')](respondWithStatusCode(_0x3159c5,null))[_0xb220('0x2b')](handleError(_0x3159c5,null));};exports[_0xb220('0xc5')]=function(_0x4732ee,_0x11e41a,_0x5b592b){var _0x4e64ff={};var _0x575924={};var _0x55dbd9;var _0x10871f;return db[_0xb220('0x40')][_0xb220('0x6b')]({'where':{'id':_0x4732ee['params']['id']}})['then'](handleEntityNotFound(_0x11e41a,null))['then'](function(_0x3fe918){if(_0x3fe918){_0x55dbd9=_0x3fe918;_0x575924[_0xb220('0x44')]=_[_0xb220('0x46')](db['User'][_0xb220('0x41')]);_0x575924[_0xb220('0x45')]=_[_0xb220('0x46')](_0x4732ee['query']);_0x575924[_0xb220('0x50')]=_['intersection'](_0x575924[_0xb220('0x44')],_0x575924['query']);_0x4e64ff['attributes']=_['intersection'](_0x575924[_0xb220('0x44')],qs['fields'](_0x4732ee[_0xb220('0x45')]['fields']));_0x4e64ff['attributes']=_0x4e64ff['attributes'][_0xb220('0x4a')]?_0x4e64ff[_0xb220('0x48')]:_0x575924[_0xb220('0x44')];_0x4e64ff['order']=qs[_0xb220('0x4e')](_0x4732ee[_0xb220('0x45')][_0xb220('0x4e')]);_0x4e64ff[_0xb220('0x4f')]=qs['filters'](_[_0xb220('0x51')](_0x4732ee['query'],_0x575924['filters']));if(_0x4732ee[_0xb220('0x45')]['filter']){_0x4e64ff[_0xb220('0x4f')]=_['merge'](_0x4e64ff['where'],{'$or':_[_0xb220('0x3f')](_0x4e64ff[_0xb220('0x48')],function(_0x3edfe0){var _0x52d746={};_0x52d746[_0x3edfe0]={'$like':'%'+_0x4732ee[_0xb220('0x45')][_0xb220('0x52')]+'%'};return _0x52d746;})});}_0x4e64ff=_['merge']({},_0x4e64ff,_0x4732ee[_0xb220('0x56')]);return _0x55dbd9['getAgents'](_0x4e64ff);}})[_0xb220('0x21')](function(_0x211f0b){if(_0x211f0b){_0x10871f=_0x211f0b['length'];if(!_0x4732ee[_0xb220('0x45')]['hasOwnProperty'](_0xb220('0x4c'))){_0x4e64ff[_0xb220('0x30')]=qs[_0xb220('0x30')](_0x4732ee['query'][_0xb220('0x30')]);_0x4e64ff[_0xb220('0x32')]=qs[_0xb220('0x32')](_0x4732ee[_0xb220('0x45')][_0xb220('0x32')]);}return _0x55dbd9[_0xb220('0xc5')](_0x4e64ff);}})['then'](function(_0x18e5db){if(_0x18e5db){return _0x18e5db?{'count':_0x10871f,'rows':_0x18e5db}:null;}})[_0xb220('0x21')](respondWithResult(_0x11e41a,null))[_0xb220('0x2b')](handleError(_0x11e41a,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 9270864..ff163d4 100644 --- a/server/api/faxAccount/faxAccount.events.js +++ b/server/api/faxAccount/faxAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdcda=['exports','events','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x910da6,_0x114f2f){var _0x51feba=function(_0x345524){while(--_0x345524){_0x910da6['push'](_0x910da6['shift']());}};_0x51feba(++_0x114f2f);}(_0xdcda,0xa3));var _0xadcd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdcda[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xadcd('0x0'));var FaxAccount=require('../../mysqldb')['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xadcd('0x1')](0x0);var events={'afterCreate':_0xadcd('0x2'),'afterUpdate':_0xadcd('0x3'),'afterDestroy':_0xadcd('0x4')};function emitEvent(_0x3d5a83){return function(_0x13d12f,_0x2a37f0,_0xa8e289){FaxAccountEvents[_0xadcd('0x5')](_0x3d5a83+':'+_0x13d12f['id'],_0x13d12f);FaxAccountEvents[_0xadcd('0x5')](_0x3d5a83,_0x13d12f);_0xa8e289(null);};}for(var e in events){if(events[_0xadcd('0x6')](e)){var event=events[e];FaxAccount[_0xadcd('0x7')](e,emitEvent(event));}}module[_0xadcd('0x8')]=FaxAccountEvents; \ No newline at end of file +var _0x0ddf=['exports','../../mysqldb','FaxAccount','setMaxListeners','save','hook'];(function(_0x3b3f4f,_0x403216){var _0x174dbe=function(_0x30e333){while(--_0x30e333){_0x3b3f4f['push'](_0x3b3f4f['shift']());}};_0x174dbe(++_0x403216);}(_0x0ddf,0x187));var _0xf0dd=function(_0x3e6e52,_0x4f1161){_0x3e6e52=_0x3e6e52-0x0;var _0x51dc6d=_0x0ddf[_0x3e6e52];return _0x51dc6d;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0xf0dd('0x0'))['db'][_0xf0dd('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xf0dd('0x2')](0x0);var events={'afterCreate':_0xf0dd('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x56bc8d){return function(_0x26caad,_0x2d23e6,_0x3c1f54){FaxAccountEvents['emit'](_0x56bc8d+':'+_0x26caad['id'],_0x26caad);FaxAccountEvents['emit'](_0x56bc8d,_0x26caad);_0x3c1f54(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0xf0dd('0x4')](e,emitEvent(event));}}module[_0xf0dd('0x5')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index f1ee877..82c85b6 100644 --- a/server/api/faxAccount/faxAccount.model.js +++ b/server/api/faxAccount/faxAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2c06=['../../config/environment','./faxAccount.attributes','FaxAccount','fax_accounts','lodash','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2c06,0xa4));var _0x62c0=function(_0x33c436,_0x55b523){_0x33c436=_0x33c436-0x0;var _0x3a9409=_0x2c06[_0x33c436];return _0x3a9409;};'use strict';var _=require(_0x62c0('0x0'));var util=require('util');var logger=require(_0x62c0('0x1'))('api');var moment=require(_0x62c0('0x2'));var BPromise=require('bluebird');var rp=require(_0x62c0('0x3'));var fs=require('fs');var path=require(_0x62c0('0x4'));var rimraf=require(_0x62c0('0x5'));var config=require(_0x62c0('0x6'));var attributes=require(_0x62c0('0x7'));module['exports']=function(_0x2f9861,_0x1b5fea){return _0x2f9861['define'](_0x62c0('0x8'),attributes,{'tableName':_0x62c0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6799=['bluebird','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x544cba,_0x4658e0){var _0x4fc0b9=function(_0x1cc39f){while(--_0x1cc39f){_0x544cba['push'](_0x544cba['shift']());}};_0x4fc0b9(++_0x4658e0);}(_0x6799,0x191));var _0x9679=function(_0x1de047,_0x4a85a3){_0x1de047=_0x1de047-0x0;var _0x27bf22=_0x6799[_0x1de047];return _0x27bf22;};'use strict';var _=require(_0x9679('0x0'));var util=require(_0x9679('0x1'));var logger=require(_0x9679('0x2'))(_0x9679('0x3'));var moment=require(_0x9679('0x4'));var BPromise=require(_0x9679('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9679('0x6'));var rimraf=require(_0x9679('0x7'));var config=require(_0x9679('0x8'));var attributes=require(_0x9679('0x9'));module[_0x9679('0xa')]=function(_0x4fc0d0,_0x22202f){return _0x4fc0d0[_0x9679('0xb')](_0x9679('0xc'),attributes,{'tableName':_0x9679('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 1f6cb2d..76a0703 100644 --- a/server/api/faxAccount/faxAccount.rpc.js +++ b/server/api/faxAccount/faxAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd373=['../../config/environment','defaults','redis','localhost','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','FaxAccount,\x20%s,\x20%s','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','map','include','model','debug','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','account','CmList','List','DESC','Applications','applications','orderBy','priority','asc','length','Contacts','from','contact','FaxInteraction','find','create','spread','get','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','UserId','name','agent','waitForTheAssignedAgent','queueId','FaxQueue','unshift','queue','waitForTheAssignedQueue','startRouting','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0xe810e1,_0x3b209b){var _0x167f63=function(_0x2bca99){while(--_0x2bca99){_0xe810e1['push'](_0xe810e1['shift']());}};_0x167f63(++_0x3b209b);}(_0xd373,0xac));var _0x3d37=function(_0x489569,_0x3a07bb){_0x489569=_0x489569-0x0;var _0x831eb7=_0xd373[_0x489569];return _0x831eb7;};'use strict';var _=require(_0x3d37('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3d37('0x1'));var rs=require(_0x3d37('0x2'));var fs=require('fs');var Redis=require(_0x3d37('0x3'));var db=require(_0x3d37('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3d37('0x5'))('rpc');var config=require(_0x3d37('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});config['redis']=_[_0x3d37('0x7')](config[_0x3d37('0x8')],{'host':_0x3d37('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3d37('0x8')]));require(_0x3d37('0xa'))[_0x3d37('0xb')](socket);function respondWithRpcPromise(_0xabe7a0,_0x3efe60,_0x56ad90){return new BPromise(function(_0x484560,_0x2e4166){return client[_0x3d37('0xc')](_0xabe7a0,_0x56ad90)[_0x3d37('0xd')](function(_0x18079e){logger[_0x3d37('0xe')]('FaxAccount,\x20%s,\x20%s',_0x3efe60,'request\x20sent');logger['debug'](_0x3d37('0xf'),_0x3efe60,_0x3d37('0x10'),JSON[_0x3d37('0x11')](_0x18079e));if(_0x18079e[_0x3d37('0x12')]){if(_0x18079e['error']['code']===0x1f4){logger[_0x3d37('0x12')](_0x3d37('0x13'),_0x3efe60,_0x18079e[_0x3d37('0x12')][_0x3d37('0x14')]);return _0x2e4166(_0x18079e[_0x3d37('0x12')][_0x3d37('0x14')]);}logger[_0x3d37('0x12')]('FaxAccount,\x20%s,\x20%s',_0x3efe60,_0x18079e[_0x3d37('0x12')][_0x3d37('0x14')]);return _0x484560(_0x18079e['error']['message']);}else{logger[_0x3d37('0xe')](_0x3d37('0x13'),_0x3efe60,_0x3d37('0x10'));_0x484560(_0x18079e[_0x3d37('0x15')][_0x3d37('0x14')]);}})[_0x3d37('0x16')](function(_0x56d6e5){logger['error'](_0x3d37('0x13'),_0x3efe60,_0x56d6e5);_0x2e4166(_0x56d6e5);});});}exports[_0x3d37('0x17')]=function(_0xdc4f00){var _0x24536e=this;return new Promise(function(_0x4f89f2,_0x262caa){return db[_0x3d37('0x18')][_0x3d37('0x19')]({'raw':_0xdc4f00[_0x3d37('0x1a')]?_0xdc4f00[_0x3d37('0x1a')][_0x3d37('0x1b')]===undefined?!![]:![]:!![],'where':_0xdc4f00[_0x3d37('0x1a')]?_0xdc4f00['options'][_0x3d37('0x1c')]||null:null,'attributes':_0xdc4f00[_0x3d37('0x1a')]?_0xdc4f00['options'][_0x3d37('0x1d')]||null:null,'limit':_0xdc4f00[_0x3d37('0x1a')]?_0xdc4f00[_0x3d37('0x1a')]['limit']||null:null,'include':_0xdc4f00[_0x3d37('0x1a')]?_0xdc4f00[_0x3d37('0x1a')]['include']?_[_0x3d37('0x1e')](_0xdc4f00[_0x3d37('0x1a')][_0x3d37('0x1f')],function(_0x2308fe){return{'model':db[_0x2308fe[_0x3d37('0x20')]],'as':_0x2308fe['as'],'attributes':_0x2308fe[_0x3d37('0x1d')],'include':_0x2308fe['include']?_['map'](_0x2308fe[_0x3d37('0x1f')],function(_0x114c9b){return{'model':db[_0x114c9b['model']],'as':_0x114c9b['as'],'attributes':_0x114c9b[_0x3d37('0x1d')],'include':_0x114c9b[_0x3d37('0x1f')]?_['map'](_0x114c9b[_0x3d37('0x1f')],function(_0x4f5dde){return{'model':db[_0x4f5dde[_0x3d37('0x20')]],'as':_0x4f5dde['as'],'attributes':_0x4f5dde[_0x3d37('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3d37('0xd')](function(_0x1b9e88){logger[_0x3d37('0xe')](_0x3d37('0x17'),_0xdc4f00);logger[_0x3d37('0x21')](_0x3d37('0x17'),_0xdc4f00,JSON['stringify'](_0x1b9e88));_0x4f89f2(_0x1b9e88);})[_0x3d37('0x16')](function(_0xf80b4e){logger[_0x3d37('0x12')](_0x3d37('0x17'),_0xf80b4e[_0x3d37('0x14')],_0xdc4f00);_0x262caa(_0x24536e[_0x3d37('0x12')](0x1f4,_0xf80b4e[_0x3d37('0x14')]));});});};exports[_0x3d37('0x22')]=function(_0x5b2190,_0x3d43d9,_0x1555b5){var _0x4eeb97=this;return new Promise(function(_0x337b65,_0x295156){var _0x14cf04={'body':_0x5b2190[_0x3d37('0x23')],'channel':_0x3d37('0x24')};var _0x299843=[];var _0x3ee1b9=[];var _0xb7c854={};return db[_0x3d37('0x25')][_0x3d37('0x26')]()['then'](function(_0x6c6462){if(!_0x6c6462){throw new db[(_0x3d37('0x27'))][(_0x3d37('0x28'))]('no\x20available\x20attributes');}_0x299843=_[_0x3d37('0x29')](_[_0x3d37('0x2a')](_0x6c6462),[_0x3d37('0x2b'),_0x3d37('0x2c')]);_0x3ee1b9=_[_0x3d37('0x29')](_[_0x3d37('0x2a')](_0x6c6462),[_0x3d37('0x2b'),'updatedAt',_0x3d37('0x2d'),_0x3d37('0x2e')]);if(_0x5b2190[_0x3d37('0x23')]['id']){delete _0x5b2190[_0x3d37('0x23')]['id'];}if(_[_0x3d37('0x2f')](_0x5b2190[_0x3d37('0x23')]['from'])){throw new db[(_0x3d37('0x27'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x5b2190[_0x3d37('0x23')][_0x3d37('0x23')])||_0x5b2190[_0x3d37('0x23')]['body']===''){throw new db[(_0x3d37('0x27'))][(_0x3d37('0x28'))](_0x3d37('0x30'));}if(_[_0x3d37('0x2f')](_0x5b2190[_0x3d37('0x23')][_0x3d37('0x31')])){throw new db[(_0x3d37('0x27'))][(_0x3d37('0x28'))](_0x3d37('0x32')+_0x3ee1b9);}if(!_[_0x3d37('0x33')](_0x3ee1b9,_0x5b2190[_0x3d37('0x23')]['mapKey'])){throw new db[(_0x3d37('0x27'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3ee1b9);}_0xb7c854[_0x5b2190['body'][_0x3d37('0x31')]]=_0x5b2190[_0x3d37('0x23')]['from'];})[_0x3d37('0xd')](function(){return db[_0x3d37('0x18')]['find']({'where':{'id':_0x5b2190[_0x3d37('0x34')]['id']},'include':[{'model':db[_0x3d37('0x35')],'as':_0x3d37('0x36'),'include':[{'model':db[_0x3d37('0x25')],'as':'Contacts','where':_0xb7c854,'limit':0x1,'order':[[_0x3d37('0x2c'),_0x3d37('0x37')]]}]},{'model':db['FaxApplication'],'as':_0x3d37('0x38')}]});})['then'](function(_0x56e7f5){if(_0x56e7f5&&_0x56e7f5[_0x3d37('0x36')]){var _0x34756e=_0x56e7f5['get']({'plain':!![]});_0x14cf04[_0x3d37('0x34')]=_0x34756e;_0x14cf04[_0x3d37('0x39')]=_0x34756e[_0x3d37('0x38')];_0x14cf04['list']=_0x34756e['List'];_0x14cf04[_0x3d37('0x39')]=_[_0x3d37('0x3a')](_0x14cf04[_0x3d37('0x39')],[_0x3d37('0x3b')],[_0x3d37('0x3c')]);if(_0x14cf04[_0x3d37('0x34')]['Applications']){delete _0x14cf04['account'][_0x3d37('0x38')];}if(_0x14cf04[_0x3d37('0x34')]['List']&&_0x14cf04[_0x3d37('0x34')][_0x3d37('0x36')]['Contacts'][_0x3d37('0x3d')]){return _0x14cf04[_0x3d37('0x34')][_0x3d37('0x36')][_0x3d37('0x3e')][0x0];}var _0x9bc2b6=_[_0x3d37('0x7')](_0x5b2190[_0x3d37('0x23')],{'firstName':_0x5b2190[_0x3d37('0x23')][_0x3d37('0x3f')],'ListId':_0x34756e[_0x3d37('0x2e')]});_0x9bc2b6[_0x5b2190['body']['mapKey']]=_0x5b2190[_0x3d37('0x23')][_0x3d37('0x3f')];return db['CmContact']['create'](_0x9bc2b6,{'fields':_0x299843,'raw':!![]});}})[_0x3d37('0xd')](function(_0x283c52){_0x14cf04[_0x3d37('0x40')]=_0x283c52;if(_0x283c52){var _0x421445={'ContactId':_0x283c52['id'],'FaxAccountId':_0x5b2190[_0x3d37('0x34')]['id'],'fax':_0x283c52[_0x3d37('0x24')]};return db[_0x3d37('0x41')][_0x3d37('0x42')]({'where':{'ContactId':_0x283c52['id'],'closed':![],'FaxAccountId':_0x5b2190['account']['id']}})[_0x3d37('0xd')](function(_0x9e99fa){if(_0x9e99fa){return[_0x9e99fa,![]];}return db['FaxInteraction'][_0x3d37('0x43')](_0x421445)[_0x3d37('0xd')](function(_0x30aa4c){return[_0x30aa4c,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x3d37('0x44')](function(_0x1cd5a8,_0x3263c8){var _0x5004fb=_0x1cd5a8[_0x3d37('0x45')]({'plain':!![]});if(_0x3263c8){if(_0x14cf04['account'][_0x3d37('0x46')]){_0x14cf04[_0x3d37('0x39')][_0x3d37('0x47')]({'id':0x0,'priority':_0x14cf04[_0x3d37('0x39')][_0x3d37('0x3d')]+0x1,'app':_0x3d37('0x48'),'appdata':_0x3d37('0x49'),'interval':_0x3d37('0x4a')});}_0x5004fb['created']=!![];}else{_0x5004fb[_0x3d37('0x4b')]=![];}_0x14cf04[_0x3d37('0x4c')]=_0x5004fb;return db[_0x3d37('0x4d')][_0x3d37('0x43')]({'body':_0x5b2190[_0x3d37('0x23')][_0x3d37('0x23')],'FaxAccountId':_0x5b2190[_0x3d37('0x34')]['id'],'FaxInteractionId':_0x1cd5a8['id'],'direction':'in','ContactId':_0x1cd5a8[_0x3d37('0x4e')],'AttachmentId':_0x5b2190[_0x3d37('0x23')]['AttachmentId']});})[_0x3d37('0xd')](function(_0x583dac){_0x14cf04[_0x3d37('0x14')]=_0x583dac;if(!_0x14cf04['interaction'][_0x3d37('0x4f')])return;return db['User'][_0x3d37('0x42')]({'attributes':['id',_0x3d37('0x50')],'where':{'id':_0x14cf04[_0x3d37('0x4c')][_0x3d37('0x4f')]}});})['then'](function(_0x1f43fc){if(_0x1f43fc){_0x14cf04['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x3d37('0x51'),'appdata':_0x1f43fc[_0x3d37('0x50')]+','+(_0x14cf04[_0x3d37('0x34')][_0x3d37('0x52')]||0xa),'interval':_0x3d37('0x4a')});}if(!_0x14cf04[_0x3d37('0x4c')][_0x3d37('0x53')])return;return db[_0x3d37('0x54')][_0x3d37('0x42')]({'attributes':['id',_0x3d37('0x50')],'where':{'id':_0x14cf04[_0x3d37('0x4c')][_0x3d37('0x53')]}});})[_0x3d37('0xd')](function(_0x2cf3f2){if(_0x2cf3f2){_0x14cf04['applications'][_0x3d37('0x55')]({'id':0x0,'priority':0x1,'app':_0x3d37('0x56'),'appdata':_0x2cf3f2[_0x3d37('0x50')]+','+(_0x14cf04['account'][_0x3d37('0x57')]||0x12c),'interval':_0x3d37('0x4a')});}return respondWithRpcPromise('Start',_0x3d37('0x58'),_0x14cf04);})[_0x3d37('0xd')](function(_0x4520ab){_0x337b65(_0x4520ab);})[_0x3d37('0x16')](function(_0x3edb04){_0x295156(_0x4eeb97[_0x3d37('0x12')](0x1f4,_0x3edb04[_0x3d37('0x14')]));});});}; \ No newline at end of file +var _0xbc93=['debug','NotifyFaxAccount','body','fax','CmContact','no\x20available\x20attributes','difference','keys','updatedAt','createdAt','ListId','Sequelize','from\x20is\x20mandatory','isNil','mapKey','ValidationError','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','from','FaxAccount','find','account','List','Contacts','FaxApplication','Applications','get','applications','list','priority','asc','length','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','*,*,*,*','created','FaxMessage','AttachmentId','interaction','UserId','name','unshift','agent','waitForTheAssignedAgent','queueId','queue','waitForTheAssignedQueue','Start','startRouting','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','redis','defaults','localhost','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetFaxAccount','findAll','options','raw','attributes','include','map','model'];(function(_0xae8e8,_0x5cac66){var _0x1eee44=function(_0x533611){while(--_0x533611){_0xae8e8['push'](_0xae8e8['shift']());}};_0x1eee44(++_0x5cac66);}(_0xbc93,0xe8));var _0x3bc9=function(_0x46e0cc,_0x3d53b8){_0x46e0cc=_0x46e0cc-0x0;var _0x7f7d71=_0xbc93[_0x46e0cc];return _0x7f7d71;};'use strict';var _=require(_0x3bc9('0x0'));var util=require('util');var moment=require(_0x3bc9('0x1'));var BPromise=require(_0x3bc9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3bc9('0x3'));var db=require(_0x3bc9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3bc9('0x5'))('rpc');var config=require(_0x3bc9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3bc9('0x7')]['http']({'port':0x232c});config[_0x3bc9('0x8')]=_[_0x3bc9('0x9')](config[_0x3bc9('0x8')],{'host':_0x3bc9('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3bc9('0xb'))[_0x3bc9('0xc')](socket);function respondWithRpcPromise(_0x374fc2,_0x5660ba,_0x2c3c19){return new BPromise(function(_0x291976,_0x2869ee){return client[_0x3bc9('0xd')](_0x374fc2,_0x2c3c19)[_0x3bc9('0xe')](function(_0x5279d3){logger[_0x3bc9('0xf')](_0x3bc9('0x10'),_0x5660ba,_0x3bc9('0x11'));logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x5660ba,_0x3bc9('0x11'),JSON[_0x3bc9('0x12')](_0x5279d3));if(_0x5279d3[_0x3bc9('0x13')]){if(_0x5279d3[_0x3bc9('0x13')][_0x3bc9('0x14')]===0x1f4){logger[_0x3bc9('0x13')](_0x3bc9('0x10'),_0x5660ba,_0x5279d3[_0x3bc9('0x13')][_0x3bc9('0x15')]);return _0x2869ee(_0x5279d3[_0x3bc9('0x13')]['message']);}logger[_0x3bc9('0x13')](_0x3bc9('0x10'),_0x5660ba,_0x5279d3['error'][_0x3bc9('0x15')]);return _0x291976(_0x5279d3[_0x3bc9('0x13')][_0x3bc9('0x15')]);}else{logger['info'](_0x3bc9('0x10'),_0x5660ba,'request\x20sent');_0x291976(_0x5279d3[_0x3bc9('0x16')][_0x3bc9('0x15')]);}})[_0x3bc9('0x17')](function(_0x3055b2){logger[_0x3bc9('0x13')](_0x3bc9('0x10'),_0x5660ba,_0x3055b2);_0x2869ee(_0x3055b2);});});}exports[_0x3bc9('0x18')]=function(_0x844578){var _0x18b0bd=this;return new Promise(function(_0x329eb1,_0x3c13ed){return db['FaxAccount'][_0x3bc9('0x19')]({'raw':_0x844578['options']?_0x844578[_0x3bc9('0x1a')][_0x3bc9('0x1b')]===undefined?!![]:![]:!![],'where':_0x844578[_0x3bc9('0x1a')]?_0x844578['options']['where']||null:null,'attributes':_0x844578[_0x3bc9('0x1a')]?_0x844578['options'][_0x3bc9('0x1c')]||null:null,'limit':_0x844578[_0x3bc9('0x1a')]?_0x844578[_0x3bc9('0x1a')]['limit']||null:null,'include':_0x844578[_0x3bc9('0x1a')]?_0x844578[_0x3bc9('0x1a')][_0x3bc9('0x1d')]?_[_0x3bc9('0x1e')](_0x844578[_0x3bc9('0x1a')][_0x3bc9('0x1d')],function(_0x2a5346){return{'model':db[_0x2a5346['model']],'as':_0x2a5346['as'],'attributes':_0x2a5346[_0x3bc9('0x1c')],'include':_0x2a5346[_0x3bc9('0x1d')]?_[_0x3bc9('0x1e')](_0x2a5346['include'],function(_0x36397f){return{'model':db[_0x36397f['model']],'as':_0x36397f['as'],'attributes':_0x36397f[_0x3bc9('0x1c')],'include':_0x36397f[_0x3bc9('0x1d')]?_['map'](_0x36397f[_0x3bc9('0x1d')],function(_0x4fcce3){return{'model':db[_0x4fcce3[_0x3bc9('0x1f')]],'as':_0x4fcce3['as'],'attributes':_0x4fcce3['attributes']};}):[]};}):[]};}):[]:[]})[_0x3bc9('0xe')](function(_0x3af4d5){logger[_0x3bc9('0xf')](_0x3bc9('0x18'),_0x844578);logger[_0x3bc9('0x20')](_0x3bc9('0x18'),_0x844578,JSON['stringify'](_0x3af4d5));_0x329eb1(_0x3af4d5);})[_0x3bc9('0x17')](function(_0x568255){logger[_0x3bc9('0x13')]('GetFaxAccount',_0x568255['message'],_0x844578);_0x3c13ed(_0x18b0bd['error'](0x1f4,_0x568255[_0x3bc9('0x15')]));});});};exports[_0x3bc9('0x21')]=function(_0x30cbf4,_0x104867,_0x573647){var _0x288294=this;return new Promise(function(_0x4379e9,_0x10edec){var _0x3a00b5={'body':_0x30cbf4[_0x3bc9('0x22')],'channel':_0x3bc9('0x23')};var _0x1993be=[];var _0x3c6250=[];var _0x1703df={};return db[_0x3bc9('0x24')]['describe']()['then'](function(_0x28748c){if(!_0x28748c){throw new db['Sequelize']['ValidationError'](_0x3bc9('0x25'));}_0x1993be=_[_0x3bc9('0x26')](_[_0x3bc9('0x27')](_0x28748c),['createdAt',_0x3bc9('0x28')]);_0x3c6250=_[_0x3bc9('0x26')](_[_0x3bc9('0x27')](_0x28748c),[_0x3bc9('0x29'),_0x3bc9('0x28'),'CompanyId',_0x3bc9('0x2a')]);if(_0x30cbf4['body']['id']){delete _0x30cbf4['body']['id'];}if(_['isNil'](_0x30cbf4[_0x3bc9('0x22')]['from'])){throw new db[(_0x3bc9('0x2b'))]['ValidationError'](_0x3bc9('0x2c'));}if(_[_0x3bc9('0x2d')](_0x30cbf4['body'][_0x3bc9('0x22')])||_0x30cbf4['body'][_0x3bc9('0x22')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x3bc9('0x2d')](_0x30cbf4['body'][_0x3bc9('0x2e')])){throw new db['Sequelize'][(_0x3bc9('0x2f'))](_0x3bc9('0x30')+_0x3c6250);}if(!_[_0x3bc9('0x31')](_0x3c6250,_0x30cbf4[_0x3bc9('0x22')][_0x3bc9('0x2e')])){throw new db[(_0x3bc9('0x2b'))][(_0x3bc9('0x2f'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3c6250);}_0x1703df[_0x30cbf4[_0x3bc9('0x22')][_0x3bc9('0x2e')]]=_0x30cbf4[_0x3bc9('0x22')][_0x3bc9('0x32')];})[_0x3bc9('0xe')](function(){return db[_0x3bc9('0x33')][_0x3bc9('0x34')]({'where':{'id':_0x30cbf4[_0x3bc9('0x35')]['id']},'include':[{'model':db['CmList'],'as':_0x3bc9('0x36'),'include':[{'model':db[_0x3bc9('0x24')],'as':_0x3bc9('0x37'),'where':_0x1703df,'limit':0x1,'order':[[_0x3bc9('0x28'),'DESC']]}]},{'model':db[_0x3bc9('0x38')],'as':_0x3bc9('0x39')}]});})['then'](function(_0x378ce1){if(_0x378ce1&&_0x378ce1[_0x3bc9('0x36')]){var _0x33e3fb=_0x378ce1[_0x3bc9('0x3a')]({'plain':!![]});_0x3a00b5['account']=_0x33e3fb;_0x3a00b5[_0x3bc9('0x3b')]=_0x33e3fb[_0x3bc9('0x39')];_0x3a00b5[_0x3bc9('0x3c')]=_0x33e3fb['List'];_0x3a00b5[_0x3bc9('0x3b')]=_['orderBy'](_0x3a00b5['applications'],[_0x3bc9('0x3d')],[_0x3bc9('0x3e')]);if(_0x3a00b5[_0x3bc9('0x35')][_0x3bc9('0x39')]){delete _0x3a00b5[_0x3bc9('0x35')][_0x3bc9('0x39')];}if(_0x3a00b5[_0x3bc9('0x35')][_0x3bc9('0x36')]&&_0x3a00b5['account'][_0x3bc9('0x36')][_0x3bc9('0x37')][_0x3bc9('0x3f')]){return _0x3a00b5[_0x3bc9('0x35')][_0x3bc9('0x36')][_0x3bc9('0x37')][0x0];}var _0xf313cf=_['defaults'](_0x30cbf4['body'],{'firstName':_0x30cbf4['body'][_0x3bc9('0x32')],'ListId':_0x33e3fb[_0x3bc9('0x2a')]});_0xf313cf[_0x30cbf4['body'][_0x3bc9('0x2e')]]=_0x30cbf4[_0x3bc9('0x22')]['from'];return db[_0x3bc9('0x24')][_0x3bc9('0x40')](_0xf313cf,{'fields':_0x1993be,'raw':!![]});}})[_0x3bc9('0xe')](function(_0x453663){_0x3a00b5[_0x3bc9('0x41')]=_0x453663;if(_0x453663){var _0x200b36={'ContactId':_0x453663['id'],'FaxAccountId':_0x30cbf4[_0x3bc9('0x35')]['id'],'fax':_0x453663[_0x3bc9('0x23')]};return db['FaxInteraction']['find']({'where':{'ContactId':_0x453663['id'],'closed':![],'FaxAccountId':_0x30cbf4[_0x3bc9('0x35')]['id']}})['then'](function(_0x39825a){if(_0x39825a){return[_0x39825a,![]];}return db[_0x3bc9('0x42')][_0x3bc9('0x40')](_0x200b36)[_0x3bc9('0xe')](function(_0x468639){return[_0x468639,!![]];});});}else{throw new Error(_0x3bc9('0x43'));}})[_0x3bc9('0x44')](function(_0x177b83,_0x520175){var _0x5e24a3=_0x177b83[_0x3bc9('0x3a')]({'plain':!![]});if(_0x520175){if(_0x3a00b5[_0x3bc9('0x35')][_0x3bc9('0x45')]){_0x3a00b5[_0x3bc9('0x3b')][_0x3bc9('0x46')]({'id':0x0,'priority':_0x3a00b5[_0x3bc9('0x3b')][_0x3bc9('0x3f')]+0x1,'app':_0x3bc9('0x47'),'appdata':_0x3bc9('0x48'),'interval':_0x3bc9('0x49')});}_0x5e24a3[_0x3bc9('0x4a')]=!![];}else{_0x5e24a3[_0x3bc9('0x4a')]=![];}_0x3a00b5['interaction']=_0x5e24a3;return db[_0x3bc9('0x4b')][_0x3bc9('0x40')]({'body':_0x30cbf4[_0x3bc9('0x22')][_0x3bc9('0x22')],'FaxAccountId':_0x30cbf4['account']['id'],'FaxInteractionId':_0x177b83['id'],'direction':'in','ContactId':_0x177b83['ContactId'],'AttachmentId':_0x30cbf4[_0x3bc9('0x22')][_0x3bc9('0x4c')]});})[_0x3bc9('0xe')](function(_0x7343e8){_0x3a00b5['message']=_0x7343e8;if(!_0x3a00b5[_0x3bc9('0x4d')][_0x3bc9('0x4e')])return;return db['User'][_0x3bc9('0x34')]({'attributes':['id',_0x3bc9('0x4f')],'where':{'id':_0x3a00b5[_0x3bc9('0x4d')][_0x3bc9('0x4e')]}});})['then'](function(_0x21c8a7){if(_0x21c8a7){_0x3a00b5['applications'][_0x3bc9('0x50')]({'id':0x0,'priority':0x0,'app':_0x3bc9('0x51'),'appdata':_0x21c8a7[_0x3bc9('0x4f')]+','+(_0x3a00b5[_0x3bc9('0x35')][_0x3bc9('0x52')]||0xa),'interval':'*,*,*,*'});}if(!_0x3a00b5[_0x3bc9('0x4d')][_0x3bc9('0x53')])return;return db['FaxQueue']['find']({'attributes':['id','name'],'where':{'id':_0x3a00b5[_0x3bc9('0x4d')][_0x3bc9('0x53')]}});})[_0x3bc9('0xe')](function(_0x1d7e5d){if(_0x1d7e5d){_0x3a00b5['applications'][_0x3bc9('0x50')]({'id':0x0,'priority':0x1,'app':_0x3bc9('0x54'),'appdata':_0x1d7e5d[_0x3bc9('0x4f')]+','+(_0x3a00b5['account'][_0x3bc9('0x55')]||0x12c),'interval':_0x3bc9('0x49')});}return respondWithRpcPromise(_0x3bc9('0x56'),_0x3bc9('0x57'),_0x3a00b5);})[_0x3bc9('0xe')](function(_0x293281){_0x4379e9(_0x293281);})[_0x3bc9('0x17')](function(_0xe70f13){_0x10edec(_0x288294[_0x3bc9('0x13')](0x1f4,_0xe70f13[_0x3bc9('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 81dc1e1..7c52ce7 100644 --- a/server/api/faxAccount/faxAccount.socket.js +++ b/server/api/faxAccount/faxAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6ba6=['faxAccount:','./faxAccount.events','save','remove','update','emit','removeListener','register','length'];(function(_0x3f2a90,_0x50baf1){var _0xb46279=function(_0x5e47b5){while(--_0x5e47b5){_0x3f2a90['push'](_0x3f2a90['shift']());}};_0xb46279(++_0x50baf1);}(_0x6ba6,0x91));var _0x66ba=function(_0x388721,_0x36c47b){_0x388721=_0x388721-0x0;var _0x4a6dbc=_0x6ba6[_0x388721];return _0x4a6dbc;};'use strict';var FaxAccountEvents=require(_0x66ba('0x0'));var events=[_0x66ba('0x1'),_0x66ba('0x2'),_0x66ba('0x3')];function createListener(_0x172435,_0x14a6cb){return function(_0x4678cd){_0x14a6cb[_0x66ba('0x4')](_0x172435,_0x4678cd);};}function removeListener(_0xd0bb35,_0x897575){return function(){FaxAccountEvents[_0x66ba('0x5')](_0xd0bb35,_0x897575);};}exports[_0x66ba('0x6')]=function(_0x2458a4){for(var _0x53e236=0x0,_0x51f4b1=events[_0x66ba('0x7')];_0x53e236<_0x51f4b1;_0x53e236++){var _0x88324d=events[_0x53e236];var _0x1a1438=createListener(_0x66ba('0x8')+_0x88324d,_0x2458a4);FaxAccountEvents['on'](_0x88324d,_0x1a1438);}}; \ No newline at end of file +var _0xcb04=['register','length','faxAccount:','./faxAccount.events','save','emit'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xcb04,0x123));var _0x4cb0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xcb04[_0x14add3];return _0x4a174f;};'use strict';var FaxAccountEvents=require(_0x4cb0('0x0'));var events=[_0x4cb0('0x1'),'remove','update'];function createListener(_0x41b456,_0x331c97){return function(_0x449a17){_0x331c97[_0x4cb0('0x2')](_0x41b456,_0x449a17);};}function removeListener(_0x1a0fcb,_0x3710c8){return function(){FaxAccountEvents['removeListener'](_0x1a0fcb,_0x3710c8);};}exports[_0x4cb0('0x3')]=function(_0x10ca88){for(var _0x2f54b2=0x0,_0x494382=events[_0x4cb0('0x4')];_0x2f54b2<_0x494382;_0x2f54b2++){var _0x45f0ce=events[_0x2f54b2];var _0x11e2b8=createListener(_0x4cb0('0x5')+_0x45f0ce,_0x10ca88);FaxAccountEvents['on'](_0x45f0ce,_0x11e2b8);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index ef1fcac..6cf1549 100644 --- a/server/api/faxAccount/index.js +++ b/server/api/faxAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2cb5=['isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/interactions','/:id/applications','getApplications','getMessages','getAgents','post','create','/:id/canned_answers','addAnswer','addInteraction','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/users','addAgents','update','destroy','delete','removeAnswers','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','get'];(function(_0x5dee75,_0x55ca86){var _0x13736a=function(_0x4892f1){while(--_0x4892f1){_0x5dee75['push'](_0x5dee75['shift']());}};_0x13736a(++_0x55ca86);}(_0x2cb5,0x14e));var _0x52cb=function(_0x4aac5a,_0x15b04c){_0x4aac5a=_0x4aac5a-0x0;var _0x42e7bc=_0x2cb5[_0x4aac5a];return _0x42e7bc;};'use strict';var multer=require(_0x52cb('0x0'));var util=require(_0x52cb('0x1'));var path=require('path');var timeout=require(_0x52cb('0x2'));var express=require(_0x52cb('0x3'));var router=express[_0x52cb('0x4')]();var fs_extra=require(_0x52cb('0x5'));var auth=require(_0x52cb('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./faxAccount.controller');router[_0x52cb('0x7')]('/',auth[_0x52cb('0x8')](),controller[_0x52cb('0x9')]);router['get']('/describe',auth[_0x52cb('0x8')](),controller[_0x52cb('0xa')]);router[_0x52cb('0x7')](_0x52cb('0xb'),auth[_0x52cb('0x8')](),controller[_0x52cb('0xc')]);router[_0x52cb('0x7')](_0x52cb('0xd'),auth[_0x52cb('0x8')](),controller[_0x52cb('0xe')]);router[_0x52cb('0x7')]('/:id/canned_answers',auth[_0x52cb('0x8')](),controller[_0x52cb('0xf')]);router['get'](_0x52cb('0x10'),auth[_0x52cb('0x8')](),controller['getInteractions']);router[_0x52cb('0x7')](_0x52cb('0x11'),auth[_0x52cb('0x8')](),controller[_0x52cb('0x12')]);router[_0x52cb('0x7')]('/:id/messages',auth[_0x52cb('0x8')](),controller[_0x52cb('0x13')]);router[_0x52cb('0x7')]('/:id/users',auth[_0x52cb('0x8')](),controller[_0x52cb('0x14')]);router[_0x52cb('0x15')]('/',auth[_0x52cb('0x8')](),controller[_0x52cb('0x16')]);router[_0x52cb('0x15')](_0x52cb('0xd'),auth[_0x52cb('0x8')](),controller['addDisposition']);router[_0x52cb('0x15')](_0x52cb('0x17'),auth[_0x52cb('0x8')](),controller[_0x52cb('0x18')]);router[_0x52cb('0x15')](_0x52cb('0x10'),auth['isAuthenticated'](),controller[_0x52cb('0x19')]);router[_0x52cb('0x15')](_0x52cb('0x11'),auth[_0x52cb('0x8')](),controller[_0x52cb('0x1a')]);router[_0x52cb('0x15')](_0x52cb('0x1b'),auth[_0x52cb('0x8')](),controller[_0x52cb('0x1c')]);router[_0x52cb('0x15')](_0x52cb('0x1d'),auth[_0x52cb('0x8')](),controller[_0x52cb('0x1e')]);router[_0x52cb('0x15')]('/:id/send',auth[_0x52cb('0x8')](),controller['send']);router[_0x52cb('0x15')](_0x52cb('0x1f'),auth['isAuthenticated'](),controller[_0x52cb('0x20')]);router['put'](_0x52cb('0xb'),auth[_0x52cb('0x8')](),controller[_0x52cb('0x21')]);router['delete'](_0x52cb('0xb'),auth[_0x52cb('0x8')](),controller[_0x52cb('0x22')]);router[_0x52cb('0x23')](_0x52cb('0xd'),auth[_0x52cb('0x8')](),controller['removeDispositions']);router[_0x52cb('0x23')](_0x52cb('0x17'),auth['isAuthenticated'](),controller[_0x52cb('0x24')]);router[_0x52cb('0x23')](_0x52cb('0x1f'),auth[_0x52cb('0x8')](),controller['removeAgents']);module[_0x52cb('0x25')]=router; \ No newline at end of file +var _0x9a94=['getMessages','post','create','addDisposition','addAnswer','/addaccountapplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','/:id/applications','getApplications'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x9a94,0x8f));var _0x49a9=function(_0x54820c,_0xd5a2f6){_0x54820c=_0x54820c-0x0;var _0x5c60c1=_0x9a94[_0x54820c];return _0x5c60c1;};'use strict';var multer=require(_0x49a9('0x0'));var util=require(_0x49a9('0x1'));var path=require(_0x49a9('0x2'));var timeout=require(_0x49a9('0x3'));var express=require(_0x49a9('0x4'));var router=express[_0x49a9('0x5')]();var fs_extra=require(_0x49a9('0x6'));var auth=require(_0x49a9('0x7'));var interaction=require(_0x49a9('0x8'));var config=require(_0x49a9('0x9'));var controller=require(_0x49a9('0xa'));router[_0x49a9('0xb')]('/',auth['isAuthenticated'](),controller[_0x49a9('0xc')]);router[_0x49a9('0xb')](_0x49a9('0xd'),auth[_0x49a9('0xe')](),controller['describe']);router[_0x49a9('0xb')](_0x49a9('0xf'),auth['isAuthenticated'](),controller[_0x49a9('0x10')]);router[_0x49a9('0xb')](_0x49a9('0x11'),auth[_0x49a9('0xe')](),controller[_0x49a9('0x12')]);router[_0x49a9('0xb')](_0x49a9('0x13'),auth[_0x49a9('0xe')](),controller[_0x49a9('0x14')]);router[_0x49a9('0xb')](_0x49a9('0x15'),auth[_0x49a9('0xe')](),controller[_0x49a9('0x16')]);router['get'](_0x49a9('0x17'),auth[_0x49a9('0xe')](),controller[_0x49a9('0x18')]);router[_0x49a9('0xb')]('/:id/messages',auth[_0x49a9('0xe')](),controller[_0x49a9('0x19')]);router[_0x49a9('0xb')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0x49a9('0x1a')]('/',auth[_0x49a9('0xe')](),controller[_0x49a9('0x1b')]);router[_0x49a9('0x1a')]('/:id/dispositions',auth[_0x49a9('0xe')](),controller[_0x49a9('0x1c')]);router[_0x49a9('0x1a')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x49a9('0x1d')]);router[_0x49a9('0x1a')]('/:id/interactions',auth[_0x49a9('0xe')](),controller['addInteraction']);router[_0x49a9('0x1a')](_0x49a9('0x17'),auth[_0x49a9('0xe')](),controller['addApplications']);router['post'](_0x49a9('0x1e'),auth['isAuthenticated'](),controller[_0x49a9('0x1f')]);router[_0x49a9('0x1a')](_0x49a9('0x20'),auth[_0x49a9('0xe')](),controller['updateAccountApplications']);router['post'](_0x49a9('0x21'),auth['isAuthenticated'](),controller[_0x49a9('0x22')]);router[_0x49a9('0x1a')]('/:id/users',auth['isAuthenticated'](),controller[_0x49a9('0x23')]);router['put'](_0x49a9('0xf'),auth['isAuthenticated'](),controller[_0x49a9('0x24')]);router[_0x49a9('0x25')](_0x49a9('0xf'),auth[_0x49a9('0xe')](),controller[_0x49a9('0x26')]);router['delete'](_0x49a9('0x11'),auth[_0x49a9('0xe')](),controller[_0x49a9('0x27')]);router['delete'](_0x49a9('0x13'),auth[_0x49a9('0xe')](),controller[_0x49a9('0x28')]);router['delete']('/:id/users',auth[_0x49a9('0xe')](),controller[_0x49a9('0x29')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 046469e..1af7375 100644 --- a/server/api/faxApplication/faxApplication.attributes.js +++ b/server/api/faxApplication/faxApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xef86=['noop','TEXT','*,*,*,*','sequelize','exports','STRING'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0xef86,0xa5));var _0x6ef8=function(_0x10fd0f,_0x30d1d6){_0x10fd0f=_0x10fd0f-0x0;var _0x5ea15e=_0xef86[_0x10fd0f];return _0x5ea15e;};'use strict';var Sequelize=require(_0x6ef8('0x0'));module[_0x6ef8('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x6ef8('0x2')],'allowNull':![],'defaultValue':_0x6ef8('0x3')},'appdata':{'type':Sequelize[_0x6ef8('0x4')]()},'description':{'type':Sequelize[_0x6ef8('0x2')]},'interval':{'type':Sequelize[_0x6ef8('0x2')],'defaultValue':_0x6ef8('0x5')}}; \ No newline at end of file +var _0xc759=['*,*,*,*','sequelize','exports','INTEGER','noop','TEXT','STRING'];(function(_0xf159cf,_0x276b50){var _0x238e51=function(_0x1fef24){while(--_0x1fef24){_0xf159cf['push'](_0xf159cf['shift']());}};_0x238e51(++_0x276b50);}(_0xc759,0x78));var _0x9c75=function(_0x45d68c,_0x16d7cd){_0x45d68c=_0x45d68c-0x0;var _0x69c9e7=_0xc759[_0x45d68c];return _0x69c9e7;};'use strict';var Sequelize=require(_0x9c75('0x0'));module[_0x9c75('0x1')]={'priority':{'type':Sequelize[_0x9c75('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9c75('0x3')},'appdata':{'type':Sequelize[_0x9c75('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x9c75('0x5')],'defaultValue':_0x9c75('0x6')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 2206625..1e6220a 100644 --- a/server/api/faxApplication/faxApplication.controller.js +++ b/server/api/faxApplication/faxApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd24c=['reject','save','update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','FaxApplication','includeAll','include','findAll','rows','catch','show','params','find','create','body','rimraf','request-promise','mustache','util','path','sox','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x1debbd,_0x4bd739){var _0x40c66d=function(_0x1d8938){while(--_0x1d8938){_0x1debbd['push'](_0x1debbd['shift']());}};_0x40c66d(++_0x4bd739);}(_0xd24c,0x73));var _0xcd24=function(_0x5633d9,_0x3ddc68){_0x5633d9=_0x5633d9-0x0;var _0x39571c=_0xd24c[_0x5633d9];return _0x39571c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcd24('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xcd24('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcd24('0x2'));var util=require(_0xcd24('0x3'));var path=require(_0xcd24('0x4'));var sox=require(_0xcd24('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xcd24('0x6'));var crypto=require(_0xcd24('0x7'));var jsforce=require(_0xcd24('0x8'));var deskjs=require(_0xcd24('0x9'));var toCsv=require(_0xcd24('0xa'));var querystring=require(_0xcd24('0xb'));var Papa=require(_0xcd24('0xc'));var Redis=require(_0xcd24('0xd'));var authService=require(_0xcd24('0xe'));var qs=require(_0xcd24('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcd24('0x10'));var logger=require('../../config/logger')(_0xcd24('0x11'));var utils=require('../../config/utils');var config=require(_0xcd24('0x12'));var licenseUtil=require(_0xcd24('0x13'));var db=require(_0xcd24('0x14'))['db'];function respondWithStatusCode(_0x22836b,_0x30aabe){_0x30aabe=_0x30aabe||0xcc;return function(_0x53ad13){if(_0x53ad13){return _0x22836b['sendStatus'](_0x30aabe);}return _0x22836b[_0xcd24('0x15')](_0x30aabe)[_0xcd24('0x16')]();};}function respondWithResult(_0x4ac63d,_0x31ae1e){_0x31ae1e=_0x31ae1e||0xc8;return function(_0x158665){if(_0x158665){return _0x4ac63d['status'](_0x31ae1e)[_0xcd24('0x17')](_0x158665);}};}function respondWithFilteredResult(_0x45ee1f,_0x36c0ec){return function(_0x28fad8){if(_0x28fad8){var _0x10f4da=typeof _0x36c0ec[_0xcd24('0x18')]===_0xcd24('0x19')&&typeof _0x36c0ec[_0xcd24('0x1a')]===_0xcd24('0x19');var _0x11457f=_0x28fad8[_0xcd24('0x1b')];var _0x99fdb5=_0x10f4da?0x0:_0x36c0ec[_0xcd24('0x18')];var _0x4cebe7=_0x10f4da?_0x28fad8[_0xcd24('0x1b')]:_0x36c0ec['offset']+_0x36c0ec['limit'];var _0x102d29;if(_0x4cebe7>=_0x11457f){_0x4cebe7=_0x11457f;_0x102d29=0xc8;}else{_0x102d29=0xce;}_0x45ee1f[_0xcd24('0x15')](_0x102d29);return _0x45ee1f[_0xcd24('0x1c')](_0xcd24('0x1d'),_0x99fdb5+'-'+_0x4cebe7+'/'+_0x11457f)[_0xcd24('0x17')](_0x28fad8);}return null;};}function patchUpdates(_0x5e5c99){return function(_0x299771){try{jsonpatch[_0xcd24('0x1e')](_0x299771,_0x5e5c99,!![]);}catch(_0x34107c){return BPromise[_0xcd24('0x1f')](_0x34107c);}return _0x299771[_0xcd24('0x20')]();};}function saveUpdates(_0x596c1c,_0x34b2c7){return function(_0xffeb07){if(_0xffeb07){return _0xffeb07[_0xcd24('0x21')](_0x596c1c)[_0xcd24('0x22')](function(_0x5ba42f){return _0x5ba42f;});}return null;};}function removeEntity(_0x3d6edb,_0x195166){return function(_0x4ec951){if(_0x4ec951){return _0x4ec951[_0xcd24('0x23')]()['then'](function(){_0x3d6edb[_0xcd24('0x15')](0xcc)[_0xcd24('0x16')]();});}};}function handleEntityNotFound(_0x3a1508,_0x942501){return function(_0xa51b06){if(!_0xa51b06){_0x3a1508[_0xcd24('0x24')](0x194);}return _0xa51b06;};}function handleError(_0x1b1b22,_0x3a4026){_0x3a4026=_0x3a4026||0x1f4;return function(_0x1ad338){logger[_0xcd24('0x25')](_0x1ad338['stack']);if(_0x1ad338[_0xcd24('0x26')]){delete _0x1ad338[_0xcd24('0x26')];}_0x1b1b22[_0xcd24('0x15')](_0x3a4026)[_0xcd24('0x27')](_0x1ad338);};}exports[_0xcd24('0x28')]=function(_0x3fd893,_0x46a9d2){var _0x3d8a5f={},_0x14978e={},_0x5f0ada={'count':0x0,'rows':[]};var _0x3c84dc=_[_0xcd24('0x29')](db['FaxApplication'][_0xcd24('0x2a')],function(_0x5a2ca0){return{'name':_0x5a2ca0['fieldName'],'type':_0x5a2ca0[_0xcd24('0x2b')]['key']};});_0x14978e[_0xcd24('0x2c')]=_[_0xcd24('0x29')](_0x3c84dc,_0xcd24('0x26'));_0x14978e['query']=_[_0xcd24('0x2d')](_0x3fd893[_0xcd24('0x2e')]);_0x14978e[_0xcd24('0x2f')]=_['intersection'](_0x14978e[_0xcd24('0x2c')],_0x14978e[_0xcd24('0x2e')]);_0x3d8a5f['attributes']=_[_0xcd24('0x30')](_0x14978e[_0xcd24('0x2c')],qs[_0xcd24('0x31')](_0x3fd893['query']['fields']));_0x3d8a5f[_0xcd24('0x32')]=_0x3d8a5f[_0xcd24('0x32')][_0xcd24('0x33')]?_0x3d8a5f[_0xcd24('0x32')]:_0x14978e[_0xcd24('0x2c')];if(!_0x3fd893['query'][_0xcd24('0x34')](_0xcd24('0x35'))){_0x3d8a5f[_0xcd24('0x1a')]=qs['limit'](_0x3fd893[_0xcd24('0x2e')][_0xcd24('0x1a')]);_0x3d8a5f[_0xcd24('0x18')]=qs[_0xcd24('0x18')](_0x3fd893['query'][_0xcd24('0x18')]);}_0x3d8a5f[_0xcd24('0x36')]=qs[_0xcd24('0x37')](_0x3fd893[_0xcd24('0x2e')][_0xcd24('0x37')]);_0x3d8a5f[_0xcd24('0x38')]=qs[_0xcd24('0x2f')](_[_0xcd24('0x39')](_0x3fd893[_0xcd24('0x2e')],_0x14978e[_0xcd24('0x2f')]),_0x3c84dc);if(_0x3fd893[_0xcd24('0x2e')][_0xcd24('0x3a')]){_0x3d8a5f[_0xcd24('0x38')]=_[_0xcd24('0x3b')](_0x3d8a5f[_0xcd24('0x38')],{'$or':_[_0xcd24('0x29')](_0x3c84dc,function(_0x2a1bf6){if(_0x2a1bf6[_0xcd24('0x2b')]!==_0xcd24('0x3c')){var _0x42150f={};_0x42150f[_0x2a1bf6[_0xcd24('0x26')]]={'$like':'%'+_0x3fd893['query']['filter']+'%'};return _0x42150f;}})});}_0x3d8a5f=_[_0xcd24('0x3b')]({},_0x3d8a5f,_0x3fd893[_0xcd24('0x3d')]);var _0x34c2d9={'where':_0x3d8a5f[_0xcd24('0x38')]};return db[_0xcd24('0x3e')][_0xcd24('0x1b')](_0x34c2d9)[_0xcd24('0x22')](function(_0x570998){_0x5f0ada['count']=_0x570998;if(_0x3fd893['query'][_0xcd24('0x3f')]){_0x3d8a5f[_0xcd24('0x40')]=[{'all':!![]}];}return db[_0xcd24('0x3e')][_0xcd24('0x41')](_0x3d8a5f);})[_0xcd24('0x22')](function(_0x54dfb8){_0x5f0ada[_0xcd24('0x42')]=_0x54dfb8;return _0x5f0ada;})[_0xcd24('0x22')](respondWithFilteredResult(_0x46a9d2,_0x3d8a5f))[_0xcd24('0x43')](handleError(_0x46a9d2,null));};exports[_0xcd24('0x44')]=function(_0x39a933,_0xd6f25a){var _0x1961a0={'raw':!![],'where':{'id':_0x39a933[_0xcd24('0x45')]['id']}},_0x108dd3={};_0x108dd3[_0xcd24('0x2c')]=_[_0xcd24('0x2d')](db[_0xcd24('0x3e')][_0xcd24('0x2a')]);_0x108dd3[_0xcd24('0x2e')]=_['keys'](_0x39a933[_0xcd24('0x2e')]);_0x108dd3[_0xcd24('0x2f')]=_['intersection'](_0x108dd3[_0xcd24('0x2c')],_0x108dd3['query']);_0x1961a0[_0xcd24('0x32')]=_['intersection'](_0x108dd3[_0xcd24('0x2c')],qs[_0xcd24('0x31')](_0x39a933[_0xcd24('0x2e')][_0xcd24('0x31')]));_0x1961a0[_0xcd24('0x32')]=_0x1961a0['attributes'][_0xcd24('0x33')]?_0x1961a0[_0xcd24('0x32')]:_0x108dd3[_0xcd24('0x2c')];if(_0x39a933[_0xcd24('0x2e')]['includeAll']){_0x1961a0[_0xcd24('0x40')]=[{'all':!![]}];}_0x1961a0=_[_0xcd24('0x3b')]({},_0x1961a0,_0x39a933[_0xcd24('0x3d')]);return db[_0xcd24('0x3e')][_0xcd24('0x46')](_0x1961a0)['then'](handleEntityNotFound(_0xd6f25a,null))[_0xcd24('0x22')](respondWithResult(_0xd6f25a,null))[_0xcd24('0x43')](handleError(_0xd6f25a,null));};exports[_0xcd24('0x47')]=function(_0x18bdf0,_0x20c8a5){return db[_0xcd24('0x3e')][_0xcd24('0x47')](_0x18bdf0[_0xcd24('0x48')],{})['then'](respondWithResult(_0x20c8a5,0xc9))['catch'](handleError(_0x20c8a5,null));};exports['update']=function(_0x23bc21,_0x12f4bb){if(_0x23bc21['body']['id']){delete _0x23bc21['body']['id'];}return db['FaxApplication'][_0xcd24('0x46')]({'where':{'id':_0x23bc21[_0xcd24('0x45')]['id']}})[_0xcd24('0x22')](handleEntityNotFound(_0x12f4bb,null))['then'](saveUpdates(_0x23bc21[_0xcd24('0x48')],null))[_0xcd24('0x22')](respondWithResult(_0x12f4bb,null))['catch'](handleError(_0x12f4bb,null));};exports[_0xcd24('0x23')]=function(_0x25b99a,_0x410027){return db[_0xcd24('0x3e')][_0xcd24('0x46')]({'where':{'id':_0x25b99a[_0xcd24('0x45')]['id']}})['then'](handleEntityNotFound(_0x410027,null))[_0xcd24('0x22')](removeEntity(_0x410027,null))[_0xcd24('0x43')](handleError(_0x410027,null));}; \ No newline at end of file +var _0x117e=['params','keys','includeAll','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','query','model','attributes','intersection','fields','length','nolimit','order','sort','where','filters','filter','merge','FaxApplication','then','include','rows','catch','show'];(function(_0xccc3cb,_0x3ba780){var _0x27f1b1=function(_0x4d0447){while(--_0x4d0447){_0xccc3cb['push'](_0xccc3cb['shift']());}};_0x27f1b1(++_0x3ba780);}(_0x117e,0xe5));var _0xe117=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x117e[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xe117('0x0'));var rimraf=require(_0xe117('0x1'));var zipdir=require(_0xe117('0x2'));var jsonpatch=require(_0xe117('0x3'));var rp=require(_0xe117('0x4'));var moment=require(_0xe117('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe117('0x6'));var util=require(_0xe117('0x7'));var path=require(_0xe117('0x8'));var sox=require('sox');var csv=require(_0xe117('0x9'));var ejs=require(_0xe117('0xa'));var fs=require('fs');var fs_extra=require(_0xe117('0xb'));var _=require('lodash');var squel=require(_0xe117('0xc'));var crypto=require(_0xe117('0xd'));var jsforce=require(_0xe117('0xe'));var deskjs=require(_0xe117('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe117('0x10'));var Papa=require(_0xe117('0x11'));var Redis=require(_0xe117('0x12'));var authService=require(_0xe117('0x13'));var qs=require(_0xe117('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe117('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xe117('0x16'));var config=require(_0xe117('0x17'));var licenseUtil=require(_0xe117('0x18'));var db=require(_0xe117('0x19'))['db'];function respondWithStatusCode(_0x1bcf15,_0x1b8b38){_0x1b8b38=_0x1b8b38||0xcc;return function(_0x565618){if(_0x565618){return _0x1bcf15[_0xe117('0x1a')](_0x1b8b38);}return _0x1bcf15['status'](_0x1b8b38)[_0xe117('0x1b')]();};}function respondWithResult(_0x5db299,_0x2e5f52){_0x2e5f52=_0x2e5f52||0xc8;return function(_0xe9610b){if(_0xe9610b){return _0x5db299[_0xe117('0x1c')](_0x2e5f52)[_0xe117('0x1d')](_0xe9610b);}};}function respondWithFilteredResult(_0x3cb15b,_0xb7485d){return function(_0x1dfbd1){if(_0x1dfbd1){var _0x2d1ca2=typeof _0xb7485d[_0xe117('0x1e')]===_0xe117('0x1f')&&typeof _0xb7485d[_0xe117('0x20')]===_0xe117('0x1f');var _0x56e410=_0x1dfbd1[_0xe117('0x21')];var _0xc6f051=_0x2d1ca2?0x0:_0xb7485d[_0xe117('0x1e')];var _0x52ea63=_0x2d1ca2?_0x1dfbd1['count']:_0xb7485d[_0xe117('0x1e')]+_0xb7485d['limit'];var _0x1f15aa;if(_0x52ea63>=_0x56e410){_0x52ea63=_0x56e410;_0x1f15aa=0xc8;}else{_0x1f15aa=0xce;}_0x3cb15b[_0xe117('0x1c')](_0x1f15aa);return _0x3cb15b[_0xe117('0x22')]('Content-Range',_0xc6f051+'-'+_0x52ea63+'/'+_0x56e410)['json'](_0x1dfbd1);}return null;};}function patchUpdates(_0x3c9063){return function(_0x4ad964){try{jsonpatch[_0xe117('0x23')](_0x4ad964,_0x3c9063,!![]);}catch(_0x48ccd2){return BPromise[_0xe117('0x24')](_0x48ccd2);}return _0x4ad964[_0xe117('0x25')]();};}function saveUpdates(_0x1df058,_0x343f1f){return function(_0x44e63f){if(_0x44e63f){return _0x44e63f[_0xe117('0x26')](_0x1df058)['then'](function(_0x18c7cf){return _0x18c7cf;});}return null;};}function removeEntity(_0x4058e6,_0x427961){return function(_0x48d6b5){if(_0x48d6b5){return _0x48d6b5[_0xe117('0x27')]()['then'](function(){_0x4058e6[_0xe117('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20b8db,_0x1fc846){return function(_0x3a073b){if(!_0x3a073b){_0x20b8db[_0xe117('0x1a')](0x194);}return _0x3a073b;};}function handleError(_0x4c63da,_0x1bf951){_0x1bf951=_0x1bf951||0x1f4;return function(_0x26f712){logger[_0xe117('0x28')](_0x26f712[_0xe117('0x29')]);if(_0x26f712[_0xe117('0x2a')]){delete _0x26f712[_0xe117('0x2a')];}_0x4c63da[_0xe117('0x1c')](_0x1bf951)['send'](_0x26f712);};}exports[_0xe117('0x2b')]=function(_0xfc9fd4,_0x26a4f8){var _0x18b79a={},_0x387bb6={},_0xe81b5a={'count':0x0,'rows':[]};var _0x59d954=_[_0xe117('0x2c')](db['FaxApplication'][_0xe117('0x2d')],function(_0x221e5d){return{'name':_0x221e5d[_0xe117('0x2e')],'type':_0x221e5d[_0xe117('0x2f')]['key']};});_0x387bb6['model']=_['map'](_0x59d954,_0xe117('0x2a'));_0x387bb6[_0xe117('0x30')]=_['keys'](_0xfc9fd4[_0xe117('0x30')]);_0x387bb6['filters']=_['intersection'](_0x387bb6[_0xe117('0x31')],_0x387bb6[_0xe117('0x30')]);_0x18b79a[_0xe117('0x32')]=_[_0xe117('0x33')](_0x387bb6[_0xe117('0x31')],qs[_0xe117('0x34')](_0xfc9fd4[_0xe117('0x30')][_0xe117('0x34')]));_0x18b79a[_0xe117('0x32')]=_0x18b79a[_0xe117('0x32')][_0xe117('0x35')]?_0x18b79a[_0xe117('0x32')]:_0x387bb6['model'];if(!_0xfc9fd4[_0xe117('0x30')]['hasOwnProperty'](_0xe117('0x36'))){_0x18b79a[_0xe117('0x20')]=qs[_0xe117('0x20')](_0xfc9fd4[_0xe117('0x30')]['limit']);_0x18b79a['offset']=qs[_0xe117('0x1e')](_0xfc9fd4[_0xe117('0x30')][_0xe117('0x1e')]);}_0x18b79a[_0xe117('0x37')]=qs[_0xe117('0x38')](_0xfc9fd4['query']['sort']);_0x18b79a[_0xe117('0x39')]=qs[_0xe117('0x3a')](_['pick'](_0xfc9fd4[_0xe117('0x30')],_0x387bb6[_0xe117('0x3a')]),_0x59d954);if(_0xfc9fd4['query'][_0xe117('0x3b')]){_0x18b79a[_0xe117('0x39')]=_[_0xe117('0x3c')](_0x18b79a[_0xe117('0x39')],{'$or':_[_0xe117('0x2c')](_0x59d954,function(_0x4b2e6c){if(_0x4b2e6c[_0xe117('0x2f')]!=='VIRTUAL'){var _0xd31c02={};_0xd31c02[_0x4b2e6c['name']]={'$like':'%'+_0xfc9fd4[_0xe117('0x30')][_0xe117('0x3b')]+'%'};return _0xd31c02;}})});}_0x18b79a=_['merge']({},_0x18b79a,_0xfc9fd4['options']);var _0x29110b={'where':_0x18b79a[_0xe117('0x39')]};return db[_0xe117('0x3d')][_0xe117('0x21')](_0x29110b)[_0xe117('0x3e')](function(_0x3363b4){_0xe81b5a[_0xe117('0x21')]=_0x3363b4;if(_0xfc9fd4[_0xe117('0x30')]['includeAll']){_0x18b79a[_0xe117('0x3f')]=[{'all':!![]}];}return db['FaxApplication']['findAll'](_0x18b79a);})['then'](function(_0x4987c6){_0xe81b5a[_0xe117('0x40')]=_0x4987c6;return _0xe81b5a;})['then'](respondWithFilteredResult(_0x26a4f8,_0x18b79a))[_0xe117('0x41')](handleError(_0x26a4f8,null));};exports[_0xe117('0x42')]=function(_0x2a1f8a,_0x4b8768){var _0x4e92fa={'raw':!![],'where':{'id':_0x2a1f8a[_0xe117('0x43')]['id']}},_0x2f62ef={};_0x2f62ef[_0xe117('0x31')]=_['keys'](db[_0xe117('0x3d')][_0xe117('0x2d')]);_0x2f62ef['query']=_[_0xe117('0x44')](_0x2a1f8a[_0xe117('0x30')]);_0x2f62ef[_0xe117('0x3a')]=_[_0xe117('0x33')](_0x2f62ef[_0xe117('0x31')],_0x2f62ef['query']);_0x4e92fa[_0xe117('0x32')]=_[_0xe117('0x33')](_0x2f62ef[_0xe117('0x31')],qs[_0xe117('0x34')](_0x2a1f8a['query']['fields']));_0x4e92fa[_0xe117('0x32')]=_0x4e92fa['attributes'][_0xe117('0x35')]?_0x4e92fa[_0xe117('0x32')]:_0x2f62ef[_0xe117('0x31')];if(_0x2a1f8a[_0xe117('0x30')][_0xe117('0x45')]){_0x4e92fa[_0xe117('0x3f')]=[{'all':!![]}];}_0x4e92fa=_[_0xe117('0x3c')]({},_0x4e92fa,_0x2a1f8a[_0xe117('0x46')]);return db[_0xe117('0x3d')][_0xe117('0x47')](_0x4e92fa)['then'](handleEntityNotFound(_0x4b8768,null))['then'](respondWithResult(_0x4b8768,null))['catch'](handleError(_0x4b8768,null));};exports[_0xe117('0x48')]=function(_0x819f73,_0x29ee3e){return db[_0xe117('0x3d')][_0xe117('0x48')](_0x819f73['body'],{})[_0xe117('0x3e')](respondWithResult(_0x29ee3e,0xc9))[_0xe117('0x41')](handleError(_0x29ee3e,null));};exports[_0xe117('0x26')]=function(_0x3353b6,_0x1e91dd){if(_0x3353b6['body']['id']){delete _0x3353b6[_0xe117('0x49')]['id'];}return db[_0xe117('0x3d')][_0xe117('0x47')]({'where':{'id':_0x3353b6[_0xe117('0x43')]['id']}})[_0xe117('0x3e')](handleEntityNotFound(_0x1e91dd,null))[_0xe117('0x3e')](saveUpdates(_0x3353b6['body'],null))['then'](respondWithResult(_0x1e91dd,null))[_0xe117('0x41')](handleError(_0x1e91dd,null));};exports[_0xe117('0x27')]=function(_0x209a11,_0x36b56a){return db[_0xe117('0x3d')][_0xe117('0x47')]({'where':{'id':_0x209a11['params']['id']}})[_0xe117('0x3e')](handleEntityNotFound(_0x36b56a,null))[_0xe117('0x3e')](removeEntity(_0x36b56a,null))[_0xe117('0x41')](handleError(_0x36b56a,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 8eba3c1..369ba59 100644 --- a/server/api/faxApplication/faxApplication.model.js +++ b/server/api/faxApplication/faxApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9ce4=['path','rimraf','../../config/environment','./faxApplication.attributes','FaxApplication','fax_applications','utf8mb4_unicode_ci','lodash','util','moment'];(function(_0x19b71b,_0x222aa3){var _0x361407=function(_0xc3dd34){while(--_0xc3dd34){_0x19b71b['push'](_0x19b71b['shift']());}};_0x361407(++_0x222aa3);}(_0x9ce4,0x93));var _0x49ce=function(_0x8b0f43,_0x1c57b8){_0x8b0f43=_0x8b0f43-0x0;var _0x3f4425=_0x9ce4[_0x8b0f43];return _0x3f4425;};'use strict';var _=require(_0x49ce('0x0'));var util=require(_0x49ce('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x49ce('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x49ce('0x3'));var rimraf=require(_0x49ce('0x4'));var config=require(_0x49ce('0x5'));var attributes=require(_0x49ce('0x6'));module['exports']=function(_0x2a4d97,_0x244c4d){return _0x2a4d97['define'](_0x49ce('0x7'),attributes,{'tableName':_0x49ce('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x49ce('0x9')});}; \ No newline at end of file +var _0xbc97=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api'];(function(_0x4025c6,_0x5f0390){var _0x5558de=function(_0x2f85cb){while(--_0x2f85cb){_0x4025c6['push'](_0x4025c6['shift']());}};_0x5558de(++_0x5f0390);}(_0xbc97,0xa5));var _0x7bc9=function(_0x1712cb,_0xee7e5e){_0x1712cb=_0x1712cb-0x0;var _0x479f71=_0xbc97[_0x1712cb];return _0x479f71;};'use strict';var _=require('lodash');var util=require(_0x7bc9('0x0'));var logger=require(_0x7bc9('0x1'))(_0x7bc9('0x2'));var moment=require(_0x7bc9('0x3'));var BPromise=require(_0x7bc9('0x4'));var rp=require(_0x7bc9('0x5'));var fs=require('fs');var path=require(_0x7bc9('0x6'));var rimraf=require(_0x7bc9('0x7'));var config=require(_0x7bc9('0x8'));var attributes=require('./faxApplication.attributes');module['exports']=function(_0x4a9e76,_0x4a8fb7){return _0x4a9e76[_0x7bc9('0x9')](_0x7bc9('0xa'),attributes,{'tableName':_0x7bc9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7bc9('0xc'),'collate':_0x7bc9('0xd')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 2058d48..1847911 100644 --- a/server/api/faxApplication/faxApplication.rpc.js +++ b/server/api/faxApplication/faxApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x74fe=['options','raw','where','attributes','limit','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','UpdateFaxApplication','update','body'];(function(_0x3cff41,_0x6d45b6){var _0x16ab1f=function(_0x3c30cc){while(--_0x3c30cc){_0x3cff41['push'](_0x3cff41['shift']());}};_0x16ab1f(++_0x6d45b6);}(_0x74fe,0xca));var _0xe74f=function(_0x35eab2,_0x454aa3){_0x35eab2=_0x35eab2-0x0;var _0x2d7a40=_0x74fe[_0x35eab2];return _0x2d7a40;};'use strict';var _=require(_0xe74f('0x0'));var util=require(_0xe74f('0x1'));var moment=require(_0xe74f('0x2'));var BPromise=require(_0xe74f('0x3'));var rs=require(_0xe74f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe74f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe74f('0x6'))('rpc');var config=require(_0xe74f('0x7'));var jayson=require(_0xe74f('0x8'));var client=jayson['client'][_0xe74f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x109d05,_0x3844d1,_0x266c67){return new BPromise(function(_0x5b771d,_0x670a37){return client['request'](_0x109d05,_0x266c67)[_0xe74f('0xa')](function(_0xdb781f){logger[_0xe74f('0xb')](_0xe74f('0xc'),_0x3844d1,_0xe74f('0xd'));logger['debug']('FaxApplication,\x20%s,\x20%s,\x20%s',_0x3844d1,_0xe74f('0xd'),JSON[_0xe74f('0xe')](_0xdb781f));if(_0xdb781f[_0xe74f('0xf')]){if(_0xdb781f[_0xe74f('0xf')][_0xe74f('0x10')]===0x1f4){logger[_0xe74f('0xf')]('FaxApplication,\x20%s,\x20%s',_0x3844d1,_0xdb781f[_0xe74f('0xf')]['message']);return _0x670a37(_0xdb781f[_0xe74f('0xf')][_0xe74f('0x11')]);}logger[_0xe74f('0xf')](_0xe74f('0xc'),_0x3844d1,_0xdb781f[_0xe74f('0xf')][_0xe74f('0x11')]);return _0x5b771d(_0xdb781f['error'][_0xe74f('0x11')]);}else{logger[_0xe74f('0xb')]('FaxApplication,\x20%s,\x20%s',_0x3844d1,_0xe74f('0xd'));_0x5b771d(_0xdb781f['result'][_0xe74f('0x11')]);}})[_0xe74f('0x12')](function(_0x5f03d9){logger[_0xe74f('0xf')]('FaxApplication,\x20%s,\x20%s',_0x3844d1,_0x5f03d9);_0x670a37(_0x5f03d9);});});}exports[_0xe74f('0x13')]=function(_0x20ffa3){var _0x386d3f=this;return new Promise(function(_0x31c190,_0x458dbf){return db['FaxApplication'][_0xe74f('0x14')](_0x20ffa3[_0xe74f('0x15')],{'raw':_0x20ffa3[_0xe74f('0x16')]?_0x20ffa3['options'][_0xe74f('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20ffa3[_0xe74f('0x16')]?_0x20ffa3[_0xe74f('0x16')][_0xe74f('0x18')]||null:null,'attributes':_0x20ffa3[_0xe74f('0x16')]?_0x20ffa3['options'][_0xe74f('0x19')]||null:null,'limit':_0x20ffa3[_0xe74f('0x16')]?_0x20ffa3['options'][_0xe74f('0x1a')]||null:null})[_0xe74f('0xa')](function(_0x137a01){logger['info'](_0xe74f('0x13'),_0x20ffa3);logger[_0xe74f('0x1b')](_0xe74f('0x13'),_0x20ffa3,JSON[_0xe74f('0xe')](_0x137a01));_0x31c190(_0x137a01);})[_0xe74f('0x12')](function(_0x531656){logger[_0xe74f('0xf')](_0xe74f('0x13'),_0x531656['message'],_0x20ffa3);_0x458dbf(_0x386d3f[_0xe74f('0xf')](0x1f4,_0x531656[_0xe74f('0x11')]));});});}; \ No newline at end of file +var _0x962e=['UpdateFaxApplication','update','body','options','attributes','limit','catch','moment','randomstring','../../config/environment','jayson/promise','client','http','then','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0xdd025,_0x10f7bf){var _0x3b2c23=function(_0x5b7d87){while(--_0x5b7d87){_0xdd025['push'](_0xdd025['shift']());}};_0x3b2c23(++_0x10f7bf);}(_0x962e,0x187));var _0xe962=function(_0x9c0817,_0x50058d){_0x9c0817=_0x9c0817-0x0;var _0x396086=_0x962e[_0x9c0817];return _0x396086;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe962('0x0'));var BPromise=require('bluebird');var rs=require(_0xe962('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xe962('0x2'));var jayson=require(_0xe962('0x3'));var client=jayson[_0xe962('0x4')][_0xe962('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x55e5e4,_0x1d7855,_0x3fa034){return new BPromise(function(_0x4045bd,_0x508c6d){return client['request'](_0x55e5e4,_0x3fa034)[_0xe962('0x6')](function(_0x533eec){logger['info'](_0xe962('0x7'),_0x1d7855,_0xe962('0x8'));logger[_0xe962('0x9')](_0xe962('0xa'),_0x1d7855,_0xe962('0x8'),JSON[_0xe962('0xb')](_0x533eec));if(_0x533eec['error']){if(_0x533eec[_0xe962('0xc')][_0xe962('0xd')]===0x1f4){logger[_0xe962('0xc')]('FaxApplication,\x20%s,\x20%s',_0x1d7855,_0x533eec[_0xe962('0xc')][_0xe962('0xe')]);return _0x508c6d(_0x533eec[_0xe962('0xc')][_0xe962('0xe')]);}logger[_0xe962('0xc')](_0xe962('0x7'),_0x1d7855,_0x533eec['error'][_0xe962('0xe')]);return _0x4045bd(_0x533eec[_0xe962('0xc')][_0xe962('0xe')]);}else{logger[_0xe962('0xf')]('FaxApplication,\x20%s,\x20%s',_0x1d7855,_0xe962('0x8'));_0x4045bd(_0x533eec[_0xe962('0x10')][_0xe962('0xe')]);}})['catch'](function(_0x25c10c){logger[_0xe962('0xc')](_0xe962('0x7'),_0x1d7855,_0x25c10c);_0x508c6d(_0x25c10c);});});}exports[_0xe962('0x11')]=function(_0xb36a22){var _0x29cedb=this;return new Promise(function(_0x396cb5,_0x321761){return db['FaxApplication'][_0xe962('0x12')](_0xb36a22[_0xe962('0x13')],{'raw':_0xb36a22[_0xe962('0x14')]?_0xb36a22[_0xe962('0x14')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb36a22['options']?_0xb36a22[_0xe962('0x14')]['where']||null:null,'attributes':_0xb36a22[_0xe962('0x14')]?_0xb36a22[_0xe962('0x14')][_0xe962('0x15')]||null:null,'limit':_0xb36a22[_0xe962('0x14')]?_0xb36a22[_0xe962('0x14')][_0xe962('0x16')]||null:null})['then'](function(_0x18134f){logger[_0xe962('0xf')](_0xe962('0x11'),_0xb36a22);logger[_0xe962('0x9')](_0xe962('0x11'),_0xb36a22,JSON[_0xe962('0xb')](_0x18134f));_0x396cb5(_0x18134f);})[_0xe962('0x17')](function(_0x49d9b6){logger[_0xe962('0xc')](_0xe962('0x11'),_0x49d9b6[_0xe962('0xe')],_0xb36a22);_0x321761(_0x29cedb[_0xe962('0xc')](0x1f4,_0x49d9b6[_0xe962('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 2b9fa61..6a9ad8d 100644 --- a/server/api/faxApplication/index.js +++ b/server/api/faxApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb688=['show','post','create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','index','/:id','isAuthenticated'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0xb688,0xcf));var _0x8b68=function(_0x2a3fdc,_0x23835e){_0x2a3fdc=_0x2a3fdc-0x0;var _0x4c213b=_0xb688[_0x2a3fdc];return _0x4c213b;};'use strict';var multer=require('multer');var util=require(_0x8b68('0x0'));var path=require(_0x8b68('0x1'));var timeout=require(_0x8b68('0x2'));var express=require(_0x8b68('0x3'));var router=express[_0x8b68('0x4')]();var fs_extra=require(_0x8b68('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var controller=require(_0x8b68('0x8'));router[_0x8b68('0x9')]('/',auth['isAuthenticated'](),controller[_0x8b68('0xa')]);router['get'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xd')]);router[_0x8b68('0xe')]('/',auth[_0x8b68('0xc')](),controller[_0x8b68('0xf')]);router[_0x8b68('0x10')](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x11')]);router[_0x8b68('0x12')](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller['destroy']);module[_0x8b68('0x13')]=router; \ No newline at end of file +var _0x087b=['destroy','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x48f625,_0x323f48){var _0x149863=function(_0xcce48e){while(--_0xcce48e){_0x48f625['push'](_0x48f625['shift']());}};_0x149863(++_0x323f48);}(_0x087b,0x11a));var _0xb087=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0x087b[_0xac151d];return _0x111dba;};'use strict';var multer=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb087('0x2'));var router=express['Router']();var fs_extra=require(_0xb087('0x3'));var auth=require(_0xb087('0x4'));var interaction=require(_0xb087('0x5'));var config=require(_0xb087('0x6'));var controller=require(_0xb087('0x7'));router[_0xb087('0x8')]('/',auth[_0xb087('0x9')](),controller[_0xb087('0xa')]);router[_0xb087('0x8')](_0xb087('0xb'),auth[_0xb087('0x9')](),controller[_0xb087('0xc')]);router[_0xb087('0xd')]('/',auth[_0xb087('0x9')](),controller[_0xb087('0xe')]);router[_0xb087('0xf')](_0xb087('0xb'),auth['isAuthenticated'](),controller[_0xb087('0x10')]);router[_0xb087('0x11')](_0xb087('0xb'),auth[_0xb087('0x9')](),controller[_0xb087('0x12')]);module[_0xb087('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 7f642be..612a80e 100644 --- a/server/api/faxInteraction/faxInteraction.attributes.js +++ b/server/api/faxInteraction/faxInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcaf2=['DATE','STRING','ENUM','out','INTEGER','sequelize','BOOLEAN'];(function(_0x4e67ce,_0x332027){var _0x46ce95=function(_0x847e9f){while(--_0x847e9f){_0x4e67ce['push'](_0x4e67ce['shift']());}};_0x46ce95(++_0x332027);}(_0xcaf2,0x8a));var _0x2caf=function(_0x318807,_0x51678f){_0x318807=_0x318807-0x0;var _0x33ea7e=_0xcaf2[_0x318807];return _0x33ea7e;};'use strict';var Sequelize=require(_0x2caf('0x0'));module['exports']={'closed':{'type':Sequelize[_0x2caf('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2caf('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x2caf('0x3')]},'thirdDisposition':{'type':Sequelize[_0x2caf('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x2caf('0x2')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0x2caf('0x4')]('in',_0x2caf('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2caf('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x2caf('0x5')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0x2caf('0x6')]}}; \ No newline at end of file +var _0x9582=['DATE','STRING','ENUM','out','INTEGER','sequelize','exports','BOOLEAN'];(function(_0x327d90,_0x4dcb19){var _0x94aea1=function(_0x43f4b0){while(--_0x43f4b0){_0x327d90['push'](_0x327d90['shift']());}};_0x94aea1(++_0x4dcb19);}(_0x9582,0x95));var _0x2958=function(_0x4016bf,_0xdbb4d7){_0x4016bf=_0x4016bf-0x0;var _0x5031f7=_0x9582[_0x4016bf];return _0x5031f7;};'use strict';var Sequelize=require(_0x2958('0x0'));module[_0x2958('0x1')]={'closed':{'type':Sequelize[_0x2958('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2958('0x3')]},'disposition':{'type':Sequelize[_0x2958('0x4')]},'secondDisposition':{'type':Sequelize[_0x2958('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x2958('0x4')]},'read1stAt':{'type':Sequelize[_0x2958('0x3')]},'fax':{'type':Sequelize[_0x2958('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x2958('0x5')]('in',_0x2958('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2958('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x2958('0x5')]('in',_0x2958('0x6')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0x2958('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index d2b2471..8e66562 100644 --- a/server/api/faxInteraction/faxInteraction.controller.js +++ b/server/api/faxInteraction/faxInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5068=['include','merge','options','find','catch','create','body','describe','addMessage','FaxMessage','ids','getMessages','findOne','hasOwnProperty','nolimit','order','sort','where','pick','FaxInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','omit','Tag','findAll','color','faxInteractionTags:save','removeTags','download','unix','toString','join','root','files','tmp','server','attachments','push','Attachment','createdAt','Messages','pipe','createWriteStream','basename','resolve','log','unlinkSync','rimraf','zip-dir','bluebird','util','path','lodash','ioredis','../../components/interaction/service','../../config/logger','api','../../mysqldb','redis','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','update','then','destroy','end','error','stack','name','send','index','map','FaxInteraction','rawAttributes','fieldName','type','getOptions','fax','query','user','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll'];(function(_0x56a71a,_0x216a9d){var _0x5aaa2d=function(_0x5d8311){while(--_0x5d8311){_0x56a71a['push'](_0x56a71a['shift']());}};_0x5aaa2d(++_0x216a9d);}(_0x5068,0x166));var _0x8506=function(_0x43768e,_0x274c86){_0x43768e=_0x43768e-0x0;var _0x1f79a1=_0x5068[_0x43768e];return _0x1f79a1;};'use strict';var rimraf=require(_0x8506('0x0'));var zipdir=require(_0x8506('0x1'));var moment=require('moment');var BPromise=require(_0x8506('0x2'));var util=require(_0x8506('0x3'));var path=require(_0x8506('0x4'));var fs=require('fs');var _=require(_0x8506('0x5'));var Redis=require(_0x8506('0x6'));var interaction=require(_0x8506('0x7'));var qs=require('../../components/parsers/qs');var logger=require(_0x8506('0x8'))(_0x8506('0x9'));var config=require('../../config/environment');var db=require(_0x8506('0xa'))['db'];config[_0x8506('0xb')]=_['defaults'](config[_0x8506('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x8506('0xc'))(new Redis(config[_0x8506('0xb')]));require('./faxInteraction.socket')[_0x8506('0xd')](socket);function respondWithStatusCode(_0x2d6785,_0x35f88a){_0x35f88a=_0x35f88a||0xcc;return function(_0x359bfe){if(_0x359bfe){return _0x2d6785[_0x8506('0xe')](_0x35f88a);}return _0x2d6785['status'](_0x35f88a)['end']();};}function respondWithResult(_0x1f260f,_0x51e6ca){_0x51e6ca=_0x51e6ca||0xc8;return function(_0x463827){if(_0x463827){return _0x1f260f[_0x8506('0xf')](_0x51e6ca)[_0x8506('0x10')](_0x463827);}};}function respondWithFilteredResult(_0x5374d0,_0x5362d6){return function(_0x478806){if(_0x478806){var _0x2ddfef=typeof _0x5362d6[_0x8506('0x11')]===_0x8506('0x12')&&typeof _0x5362d6[_0x8506('0x13')]===_0x8506('0x12');var _0x4a2e26=_0x478806[_0x8506('0x14')];var _0x3513b6=_0x2ddfef?0x0:_0x5362d6[_0x8506('0x11')];var _0x1aaaa1=_0x2ddfef?_0x478806[_0x8506('0x14')]:_0x5362d6[_0x8506('0x11')]+_0x5362d6[_0x8506('0x13')];var _0x3f888c;if(_0x1aaaa1>=_0x4a2e26){_0x1aaaa1=_0x4a2e26;_0x3f888c=0xc8;}else{_0x3f888c=0xce;}_0x5374d0['status'](_0x3f888c);return _0x5374d0['set'](_0x8506('0x15'),_0x3513b6+'-'+_0x1aaaa1+'/'+_0x4a2e26)['json'](_0x478806);}return null;};}function saveUpdates(_0x5c20dc){return function(_0x14c7bb){if(_0x14c7bb){return _0x14c7bb[_0x8506('0x16')](_0x5c20dc)[_0x8506('0x17')](function(_0xfeb3ca){return _0xfeb3ca;});}return null;};}function removeEntity(_0x474978){return function(_0x10af82){if(_0x10af82){return _0x10af82[_0x8506('0x18')]()[_0x8506('0x17')](function(){_0x474978[_0x8506('0xf')](0xcc)[_0x8506('0x19')]();});}};}function handleEntityNotFound(_0x569f09){return function(_0x16d77a){if(!_0x16d77a){_0x569f09[_0x8506('0xe')](0x194);}return _0x16d77a;};}function handleError(_0x3d2bba,_0x45cfea){_0x45cfea=_0x45cfea||0x1f4;return function(_0x37fe0a){logger[_0x8506('0x1a')](_0x37fe0a[_0x8506('0x1b')]);if(_0x37fe0a[_0x8506('0x1c')]){delete _0x37fe0a[_0x8506('0x1c')];}_0x3d2bba[_0x8506('0xf')](_0x45cfea)[_0x8506('0x1d')](_0x37fe0a);};}exports[_0x8506('0x1e')]=function(_0x3510b7,_0x29277c){var _0x236398={};var _0x281252=_[_0x8506('0x1f')](db[_0x8506('0x20')][_0x8506('0x21')],function(_0x384055){return{'name':_0x384055[_0x8506('0x22')],'type':_0x384055[_0x8506('0x23')]['key']};});_0x236398=qs[_0x8506('0x24')](_0x281252,_0x3510b7);return interaction['findAll'](_0x8506('0x25'),_0x3510b7[_0x8506('0x26')],_0x3510b7[_0x8506('0x27')],_0x236398,_0x281252)[_0x8506('0x17')](respondWithFilteredResult(_0x29277c,_0x236398))['catch'](handleError(_0x29277c,null));};exports[_0x8506('0x28')]=function(_0x50b653,_0x245641){var _0x3230cc={'raw':![],'where':{'id':_0x50b653[_0x8506('0x29')]['id']}},_0x326430={};_0x326430[_0x8506('0x2a')]=_['keys'](db['FaxInteraction'][_0x8506('0x21')]);_0x326430['query']=_[_0x8506('0x2b')](_0x50b653[_0x8506('0x26')]);_0x326430[_0x8506('0x2c')]=_[_0x8506('0x2d')](_0x326430['model'],_0x326430[_0x8506('0x26')]);_0x3230cc[_0x8506('0x2e')]=_[_0x8506('0x2d')](_0x326430[_0x8506('0x2a')],qs[_0x8506('0x2f')](_0x50b653[_0x8506('0x26')][_0x8506('0x2f')]));_0x3230cc[_0x8506('0x2e')]=_0x3230cc[_0x8506('0x2e')][_0x8506('0x30')]?_0x3230cc['attributes']:_0x326430[_0x8506('0x2a')];if(_0x50b653['query'][_0x8506('0x31')]){_0x3230cc[_0x8506('0x32')]=[{'all':!![]}];}_0x3230cc=_[_0x8506('0x33')]({},_0x3230cc,_0x50b653[_0x8506('0x34')]);return db[_0x8506('0x20')][_0x8506('0x35')](_0x3230cc)[_0x8506('0x17')](handleEntityNotFound(_0x245641,null))[_0x8506('0x17')](respondWithResult(_0x245641,null))[_0x8506('0x36')](handleError(_0x245641,null));};exports[_0x8506('0x37')]=function(_0x227973,_0x452f86){return db[_0x8506('0x20')]['create'](_0x227973[_0x8506('0x38')],{})[_0x8506('0x17')](respondWithResult(_0x452f86,0xc9))[_0x8506('0x36')](handleError(_0x452f86,null));};exports['update']=function(_0xec4ef2,_0x1a1503){if(_0xec4ef2[_0x8506('0x38')]['id']){delete _0xec4ef2[_0x8506('0x38')]['id'];}return db['FaxInteraction']['find']({'where':{'id':_0xec4ef2[_0x8506('0x29')]['id']}})[_0x8506('0x17')](handleEntityNotFound(_0x1a1503,null))[_0x8506('0x17')](saveUpdates(_0xec4ef2['body'],null))[_0x8506('0x17')](respondWithResult(_0x1a1503,null))[_0x8506('0x36')](handleError(_0x1a1503,null));};exports[_0x8506('0x18')]=function(_0x356db5,_0x5dbda6){return db['FaxInteraction'][_0x8506('0x35')]({'where':{'id':_0x356db5[_0x8506('0x29')]['id']}})['then'](handleEntityNotFound(_0x5dbda6,null))[_0x8506('0x17')](removeEntity(_0x5dbda6,null))[_0x8506('0x36')](handleError(_0x5dbda6,null));};exports[_0x8506('0x39')]=function(_0x4e4b50,_0x1afe6c){return db[_0x8506('0x20')][_0x8506('0x39')]()['then'](respondWithResult(_0x1afe6c,null))[_0x8506('0x36')](handleError(_0x1afe6c,null));};exports[_0x8506('0x3a')]=function(_0x335592,_0x3e1894){return db[_0x8506('0x3b')]['find']({'where':{'id':_0x335592[_0x8506('0x29')]['id']}})[_0x8506('0x17')](handleEntityNotFound(_0x3e1894,null))[_0x8506('0x17')](function(_0xa3bb80){if(_0xa3bb80){return _0xa3bb80['addMessage'](_0x335592['body'][_0x8506('0x3c')],_['omit'](_0x335592['body'],['ids','id'])||{});}})[_0x8506('0x17')](respondWithResult(_0x3e1894,null))[_0x8506('0x36')](handleError(_0x3e1894,null));};exports[_0x8506('0x3d')]=function(_0x5d9688,_0x321dec){var _0x2ffbc3={'raw':![],'where':{}};var _0x4788c2={};var _0x472cd3={'count':0x0,'rows':[]};return db[_0x8506('0x20')][_0x8506('0x3e')]({'where':{'id':_0x5d9688['params']['id']}})[_0x8506('0x17')](handleEntityNotFound(_0x321dec,null))[_0x8506('0x17')](function(_0xab19fd){if(_0xab19fd){_0x4788c2[_0x8506('0x2a')]=_[_0x8506('0x2b')](db[_0x8506('0x3b')]['rawAttributes']);_0x4788c2[_0x8506('0x26')]=_[_0x8506('0x2b')](_0x5d9688[_0x8506('0x26')]);_0x4788c2['filters']=_[_0x8506('0x2d')](_0x4788c2['model'],_0x4788c2[_0x8506('0x26')]);_0x2ffbc3['attributes']=_[_0x8506('0x2d')](_0x4788c2['model'],qs[_0x8506('0x2f')](_0x5d9688['query']['fields']));_0x2ffbc3[_0x8506('0x2e')]=_0x2ffbc3[_0x8506('0x2e')][_0x8506('0x30')]?_0x2ffbc3['attributes']:_0x4788c2[_0x8506('0x2a')];if(!_0x5d9688[_0x8506('0x26')][_0x8506('0x3f')](_0x8506('0x40'))){_0x2ffbc3['limit']=qs[_0x8506('0x13')](_0x5d9688[_0x8506('0x26')][_0x8506('0x13')]);_0x2ffbc3[_0x8506('0x11')]=qs[_0x8506('0x11')](_0x5d9688[_0x8506('0x26')]['offset']);}_0x2ffbc3[_0x8506('0x41')]=qs[_0x8506('0x42')](_0x5d9688[_0x8506('0x26')][_0x8506('0x42')]);_0x2ffbc3[_0x8506('0x43')]=qs[_0x8506('0x2c')](_[_0x8506('0x44')](_0x5d9688[_0x8506('0x26')],_0x4788c2[_0x8506('0x2c')]));_0x2ffbc3['where'][_0x8506('0x45')]=_0xab19fd['id'];if(_0x5d9688[_0x8506('0x26')][_0x8506('0x46')]){_0x2ffbc3[_0x8506('0x43')]=_[_0x8506('0x33')](_0x2ffbc3[_0x8506('0x43')],{'$or':_[_0x8506('0x1f')](_0x2ffbc3[_0x8506('0x2e')],function(_0x5d1f13){var _0x28d903={};_0x28d903[_0x5d1f13]={'$like':'%'+_0x5d9688['query']['filter']+'%'};return _0x28d903;})});}if(_0x5d9688[_0x8506('0x26')][_0x8506('0x47')]){var _0x5ac82c=_0x5d9688[_0x8506('0x26')]['$gte']['split'](',');var _0x7fcec9={};_0x7fcec9[_0x5ac82c[0x0]]={'$gte':moment(_0x5ac82c[0x1])[_0x8506('0x48')](_0x8506('0x49'))};_0x2ffbc3[_0x8506('0x43')]=_[_0x8506('0x33')](_0x2ffbc3[_0x8506('0x43')],_0x7fcec9);}_0x2ffbc3=_[_0x8506('0x33')]({},_0x2ffbc3,_0x5d9688[_0x8506('0x34')]);return db[_0x8506('0x3b')][_0x8506('0x14')]({'where':_0x2ffbc3['where']})[_0x8506('0x17')](function(_0x448b19){_0x472cd3[_0x8506('0x14')]=_0x448b19;if(_0x5d9688[_0x8506('0x26')][_0x8506('0x31')]){_0x2ffbc3[_0x8506('0x32')]=[{'all':!![]}];}return db[_0x8506('0x3b')]['findAll'](_0x2ffbc3);})[_0x8506('0x17')](function(_0x3dcc1c){_0x472cd3[_0x8506('0x4a')]=_0x3dcc1c;return _0x472cd3;});}})[_0x8506('0x17')](respondWithFilteredResult(_0x321dec,_0x2ffbc3))[_0x8506('0x36')](handleError(_0x321dec,null));};exports[_0x8506('0x4b')]=function(_0x193bd9,_0x65da75){return db[_0x8506('0x20')][_0x8506('0x35')]({'where':{'id':_0x193bd9[_0x8506('0x29')]['id']}})[_0x8506('0x17')](handleEntityNotFound(_0x65da75,null))['then'](function(_0x42b3f4){if(_0x42b3f4){return _0x42b3f4[_0x8506('0x4c')](_0x193bd9[_0x8506('0x38')][_0x8506('0x3c')],_[_0x8506('0x4d')](_0x193bd9['body'],[_0x8506('0x3c'),'id'])||{})['spread'](function(){return db[_0x8506('0x4e')][_0x8506('0x4f')]({'attributes':['id',_0x8506('0x1c'),_0x8506('0x50')],'where':{'id':_0x193bd9[_0x8506('0x38')][_0x8506('0x3c')]}});})[_0x8506('0x17')](function(_0x4d987a){socket['emit'](_0x8506('0x51'),{'id':Number(_0x193bd9['params']['id']),'tags':_0x4d987a||[]});return{'id':Number(_0x193bd9['params']['id']),'tags':_0x4d987a||[]};});}})['then'](respondWithResult(_0x65da75,null))[_0x8506('0x36')](handleError(_0x65da75,null));};exports[_0x8506('0x52')]=function(_0x28a482,_0x20f4b8){return db[_0x8506('0x20')][_0x8506('0x35')]({'where':{'id':_0x28a482[_0x8506('0x29')]['id']}})[_0x8506('0x17')](handleEntityNotFound(_0x20f4b8,null))[_0x8506('0x17')](function(_0x408c25){if(_0x408c25){return _0x408c25[_0x8506('0x52')](_0x28a482[_0x8506('0x26')][_0x8506('0x3c')]);}})['then'](respondWithStatusCode(_0x20f4b8,null))[_0x8506('0x36')](handleError(_0x20f4b8,null));};exports[_0x8506('0x53')]=function(_0xbf2c4f,_0x543f9e){var _0x58683f=moment()[_0x8506('0x54')]()[_0x8506('0x55')]();var _0x241479=path[_0x8506('0x56')](config[_0x8506('0x57')],'server',_0x8506('0x58'),_0x8506('0x59'));var _0x1f7b2d=path[_0x8506('0x56')](config[_0x8506('0x57')],_0x8506('0x5a'),_0x8506('0x58'),_0x8506('0x5b'));var _0x193398=path[_0x8506('0x56')](_0x241479,_0x58683f);var _0x3ae887=util[_0x8506('0x48')]('transcript-%d-%s.zip',_0xbf2c4f[_0x8506('0x29')]['id'],_0x58683f);var _0x2a4476=path[_0x8506('0x56')](_0x241479,_0x3ae887);var _0x2e203e=[];_0x2e203e[_0x8506('0x5c')]({'model':db[_0x8506('0x5d')],'as':_0x8506('0x5d'),'raw':!![]});var _0x13d3c9=[{'model':db['FaxMessage'],'as':'Messages','attributes':['id',_0x8506('0x38'),_0x8506('0x5e')],'include':_0x2e203e}];return db['FaxInteraction'][_0x8506('0x35')]({'where':{'id':_0xbf2c4f[_0x8506('0x29')]['id']},'include':_0x13d3c9})[_0x8506('0x17')](handleEntityNotFound(_0x543f9e,null))[_0x8506('0x17')](function(_0x21070c){if(_0x21070c&&_0x21070c['Messages']){var _0x374643=_0x21070c['get']({'plain':!![]});fs['mkdirSync'](_0x193398);for(var _0x570a40=0x0;_0x570a40<_0x374643[_0x8506('0x5f')][_0x8506('0x30')];_0x570a40++){var _0x26de00=_0x374643[_0x8506('0x5f')][_0x570a40][_0x8506('0x5d')];if(_0x26de00){var _0x4b5ccc=path['join'](_0x1f7b2d,_0x26de00['basename']);if(fs['existsSync'](_0x4b5ccc)){fs['createReadStream'](_0x4b5ccc)[_0x8506('0x60')](fs[_0x8506('0x61')](path['join'](_0x193398,_0x26de00[_0x8506('0x62')])));}}}return BPromise[_0x8506('0x63')]()[_0x8506('0x17')](function(){return new BPromise(function(_0x271630,_0xe3c2db){zipdir(_0x193398,{'saveTo':_0x2a4476},function(_0x192374,_0x559487){if(_0x192374)return _0xe3c2db(_0x192374);return _0x271630(_0x559487);});})[_0x8506('0x17')](function(){return new BPromise(function(_0x500248,_0x2a69e7){rimraf(_0x193398,function(_0x1c1947){if(_0x1c1947)_0x2a69e7(_0x1c1947);return _0x500248();});});})['then'](function(){return _0x543f9e[_0x8506('0x53')](_0x2a4476,_0x3ae887,function(_0x957294){if(_0x957294){console[_0x8506('0x64')]('err',_0x957294);}else{fs[_0x8506('0x65')](_0x2a4476);}});});});}else{return _0x543f9e[_0x8506('0xe')](0xc8);}})[_0x8506('0x36')](handleError(_0x543f9e,null));}; \ No newline at end of file +var _0x53fc=['error','name','send','index','map','FaxInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','fax','query','user','then','catch','show','params','model','filters','attributes','intersection','fields','length','include','options','create','body','destroy','find','describe','addMessage','FaxMessage','ids','omit','keys','hasOwnProperty','nolimit','order','where','pick','FaxInteractionId','filter','merge','$gte','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','setTags','spread','emit','faxInteractionTags:save','removeTags','download','root','files','tmp','attachments','join','transcript-%d-%s.zip','push','get','mkdirSync','Messages','Attachment','basename','existsSync','createReadStream','resolve','log','err','unlinkSync','rimraf','moment','bluebird','util','path','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','status','undefined','limit','count','offset','set','Content-Range','update','sendStatus'];(function(_0x47abd5,_0x560880){var _0x592b1c=function(_0x27d8a0){while(--_0x27d8a0){_0x47abd5['push'](_0x47abd5['shift']());}};_0x592b1c(++_0x560880);}(_0x53fc,0x16c));var _0xc53f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x53fc[_0x3dd15e];return _0x231fd0;};'use strict';var rimraf=require(_0xc53f('0x0'));var zipdir=require('zip-dir');var moment=require(_0xc53f('0x1'));var BPromise=require(_0xc53f('0x2'));var util=require(_0xc53f('0x3'));var path=require(_0xc53f('0x4'));var fs=require('fs');var _=require(_0xc53f('0x5'));var Redis=require(_0xc53f('0x6'));var interaction=require('../../components/interaction/service');var qs=require(_0xc53f('0x7'));var logger=require(_0xc53f('0x8'))(_0xc53f('0x9'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xc53f('0xa')]=_[_0xc53f('0xb')](config[_0xc53f('0xa')],{'host':_0xc53f('0xc'),'port':0x18eb});var socket=require(_0xc53f('0xd'))(new Redis(config[_0xc53f('0xa')]));require(_0xc53f('0xe'))['register'](socket);function respondWithStatusCode(_0x42c6b1,_0x1e15e4){_0x1e15e4=_0x1e15e4||0xcc;return function(_0x867d2e){if(_0x867d2e){return _0x42c6b1['sendStatus'](_0x1e15e4);}return _0x42c6b1['status'](_0x1e15e4)['end']();};}function respondWithResult(_0x466d2b,_0x4057ef){_0x4057ef=_0x4057ef||0xc8;return function(_0xfcf0ce){if(_0xfcf0ce){return _0x466d2b[_0xc53f('0xf')](_0x4057ef)['json'](_0xfcf0ce);}};}function respondWithFilteredResult(_0x389271,_0xe3fbe3){return function(_0x3a5078){if(_0x3a5078){var _0x432dd4=typeof _0xe3fbe3['offset']===_0xc53f('0x10')&&typeof _0xe3fbe3[_0xc53f('0x11')]===_0xc53f('0x10');var _0x4d47ae=_0x3a5078[_0xc53f('0x12')];var _0x5411a=_0x432dd4?0x0:_0xe3fbe3[_0xc53f('0x13')];var _0x4611a6=_0x432dd4?_0x3a5078[_0xc53f('0x12')]:_0xe3fbe3[_0xc53f('0x13')]+_0xe3fbe3['limit'];var _0x29bbfd;if(_0x4611a6>=_0x4d47ae){_0x4611a6=_0x4d47ae;_0x29bbfd=0xc8;}else{_0x29bbfd=0xce;}_0x389271['status'](_0x29bbfd);return _0x389271[_0xc53f('0x14')](_0xc53f('0x15'),_0x5411a+'-'+_0x4611a6+'/'+_0x4d47ae)['json'](_0x3a5078);}return null;};}function saveUpdates(_0x51898e){return function(_0x11812c){if(_0x11812c){return _0x11812c[_0xc53f('0x16')](_0x51898e)['then'](function(_0x5c7847){return _0x5c7847;});}return null;};}function removeEntity(_0x179fd4){return function(_0x19a811){if(_0x19a811){return _0x19a811['destroy']()['then'](function(){_0x179fd4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x25b6f4){return function(_0x1f406a){if(!_0x1f406a){_0x25b6f4[_0xc53f('0x17')](0x194);}return _0x1f406a;};}function handleError(_0x4f29fb,_0x28ce16){_0x28ce16=_0x28ce16||0x1f4;return function(_0x3ecbbc){logger[_0xc53f('0x18')](_0x3ecbbc['stack']);if(_0x3ecbbc[_0xc53f('0x19')]){delete _0x3ecbbc[_0xc53f('0x19')];}_0x4f29fb[_0xc53f('0xf')](_0x28ce16)[_0xc53f('0x1a')](_0x3ecbbc);};}exports[_0xc53f('0x1b')]=function(_0x41980f,_0x352391){var _0x4a1e60={};var _0x34d332=_[_0xc53f('0x1c')](db[_0xc53f('0x1d')][_0xc53f('0x1e')],function(_0xb567ba){return{'name':_0xb567ba[_0xc53f('0x1f')],'type':_0xb567ba[_0xc53f('0x20')][_0xc53f('0x21')]};});_0x4a1e60=qs[_0xc53f('0x22')](_0x34d332,_0x41980f);return interaction[_0xc53f('0x23')](_0xc53f('0x24'),_0x41980f[_0xc53f('0x25')],_0x41980f[_0xc53f('0x26')],_0x4a1e60,_0x34d332)[_0xc53f('0x27')](respondWithFilteredResult(_0x352391,_0x4a1e60))[_0xc53f('0x28')](handleError(_0x352391,null));};exports[_0xc53f('0x29')]=function(_0x4d9d56,_0x2fcc1f){var _0x2e9d18={'raw':![],'where':{'id':_0x4d9d56[_0xc53f('0x2a')]['id']}},_0x2f18cf={};_0x2f18cf[_0xc53f('0x2b')]=_['keys'](db[_0xc53f('0x1d')][_0xc53f('0x1e')]);_0x2f18cf[_0xc53f('0x25')]=_['keys'](_0x4d9d56[_0xc53f('0x25')]);_0x2f18cf[_0xc53f('0x2c')]=_['intersection'](_0x2f18cf[_0xc53f('0x2b')],_0x2f18cf['query']);_0x2e9d18[_0xc53f('0x2d')]=_[_0xc53f('0x2e')](_0x2f18cf[_0xc53f('0x2b')],qs[_0xc53f('0x2f')](_0x4d9d56[_0xc53f('0x25')][_0xc53f('0x2f')]));_0x2e9d18[_0xc53f('0x2d')]=_0x2e9d18[_0xc53f('0x2d')][_0xc53f('0x30')]?_0x2e9d18[_0xc53f('0x2d')]:_0x2f18cf[_0xc53f('0x2b')];if(_0x4d9d56[_0xc53f('0x25')]['includeAll']){_0x2e9d18[_0xc53f('0x31')]=[{'all':!![]}];}_0x2e9d18=_['merge']({},_0x2e9d18,_0x4d9d56[_0xc53f('0x32')]);return db[_0xc53f('0x1d')]['find'](_0x2e9d18)[_0xc53f('0x27')](handleEntityNotFound(_0x2fcc1f,null))['then'](respondWithResult(_0x2fcc1f,null))[_0xc53f('0x28')](handleError(_0x2fcc1f,null));};exports[_0xc53f('0x33')]=function(_0x340cba,_0x4cb734){return db['FaxInteraction']['create'](_0x340cba[_0xc53f('0x34')],{})[_0xc53f('0x27')](respondWithResult(_0x4cb734,0xc9))['catch'](handleError(_0x4cb734,null));};exports[_0xc53f('0x16')]=function(_0xd61993,_0x5668f8){if(_0xd61993['body']['id']){delete _0xd61993[_0xc53f('0x34')]['id'];}return db[_0xc53f('0x1d')]['find']({'where':{'id':_0xd61993['params']['id']}})[_0xc53f('0x27')](handleEntityNotFound(_0x5668f8,null))[_0xc53f('0x27')](saveUpdates(_0xd61993['body'],null))[_0xc53f('0x27')](respondWithResult(_0x5668f8,null))[_0xc53f('0x28')](handleError(_0x5668f8,null));};exports[_0xc53f('0x35')]=function(_0x216131,_0x12d6a4){return db[_0xc53f('0x1d')][_0xc53f('0x36')]({'where':{'id':_0x216131[_0xc53f('0x2a')]['id']}})['then'](handleEntityNotFound(_0x12d6a4,null))[_0xc53f('0x27')](removeEntity(_0x12d6a4,null))[_0xc53f('0x28')](handleError(_0x12d6a4,null));};exports[_0xc53f('0x37')]=function(_0x4bdd2c,_0xf7c105){return db['FaxInteraction'][_0xc53f('0x37')]()[_0xc53f('0x27')](respondWithResult(_0xf7c105,null))[_0xc53f('0x28')](handleError(_0xf7c105,null));};exports[_0xc53f('0x38')]=function(_0x41e210,_0x55f278){return db[_0xc53f('0x39')][_0xc53f('0x36')]({'where':{'id':_0x41e210['params']['id']}})[_0xc53f('0x27')](handleEntityNotFound(_0x55f278,null))[_0xc53f('0x27')](function(_0x4d70e4){if(_0x4d70e4){return _0x4d70e4[_0xc53f('0x38')](_0x41e210['body'][_0xc53f('0x3a')],_[_0xc53f('0x3b')](_0x41e210[_0xc53f('0x34')],['ids','id'])||{});}})[_0xc53f('0x27')](respondWithResult(_0x55f278,null))[_0xc53f('0x28')](handleError(_0x55f278,null));};exports['getMessages']=function(_0x813df2,_0x2cb666){var _0x2bd994={'raw':![],'where':{}};var _0x454e03={};var _0x4dd362={'count':0x0,'rows':[]};return db[_0xc53f('0x1d')]['findOne']({'where':{'id':_0x813df2['params']['id']}})[_0xc53f('0x27')](handleEntityNotFound(_0x2cb666,null))['then'](function(_0x38510f){if(_0x38510f){_0x454e03[_0xc53f('0x2b')]=_[_0xc53f('0x3c')](db[_0xc53f('0x39')][_0xc53f('0x1e')]);_0x454e03[_0xc53f('0x25')]=_[_0xc53f('0x3c')](_0x813df2[_0xc53f('0x25')]);_0x454e03[_0xc53f('0x2c')]=_[_0xc53f('0x2e')](_0x454e03[_0xc53f('0x2b')],_0x454e03[_0xc53f('0x25')]);_0x2bd994[_0xc53f('0x2d')]=_[_0xc53f('0x2e')](_0x454e03[_0xc53f('0x2b')],qs[_0xc53f('0x2f')](_0x813df2[_0xc53f('0x25')]['fields']));_0x2bd994[_0xc53f('0x2d')]=_0x2bd994[_0xc53f('0x2d')][_0xc53f('0x30')]?_0x2bd994['attributes']:_0x454e03[_0xc53f('0x2b')];if(!_0x813df2[_0xc53f('0x25')][_0xc53f('0x3d')](_0xc53f('0x3e'))){_0x2bd994[_0xc53f('0x11')]=qs[_0xc53f('0x11')](_0x813df2['query'][_0xc53f('0x11')]);_0x2bd994[_0xc53f('0x13')]=qs[_0xc53f('0x13')](_0x813df2[_0xc53f('0x25')][_0xc53f('0x13')]);}_0x2bd994[_0xc53f('0x3f')]=qs['sort'](_0x813df2['query']['sort']);_0x2bd994[_0xc53f('0x40')]=qs['filters'](_[_0xc53f('0x41')](_0x813df2[_0xc53f('0x25')],_0x454e03[_0xc53f('0x2c')]));_0x2bd994[_0xc53f('0x40')][_0xc53f('0x42')]=_0x38510f['id'];if(_0x813df2['query'][_0xc53f('0x43')]){_0x2bd994[_0xc53f('0x40')]=_[_0xc53f('0x44')](_0x2bd994[_0xc53f('0x40')],{'$or':_['map'](_0x2bd994[_0xc53f('0x2d')],function(_0x1cccff){var _0x34c1e4={};_0x34c1e4[_0x1cccff]={'$like':'%'+_0x813df2[_0xc53f('0x25')]['filter']+'%'};return _0x34c1e4;})});}if(_0x813df2[_0xc53f('0x25')][_0xc53f('0x45')]){var _0x1ffe27=_0x813df2['query']['$gte']['split'](',');var _0x2bfd9a={};_0x2bfd9a[_0x1ffe27[0x0]]={'$gte':moment(_0x1ffe27[0x1])[_0xc53f('0x46')](_0xc53f('0x47'))};_0x2bd994['where']=_['merge'](_0x2bd994[_0xc53f('0x40')],_0x2bfd9a);}_0x2bd994=_[_0xc53f('0x44')]({},_0x2bd994,_0x813df2[_0xc53f('0x32')]);return db[_0xc53f('0x39')][_0xc53f('0x12')]({'where':_0x2bd994['where']})['then'](function(_0x35ed94){_0x4dd362['count']=_0x35ed94;if(_0x813df2['query'][_0xc53f('0x48')]){_0x2bd994[_0xc53f('0x31')]=[{'all':!![]}];}return db[_0xc53f('0x39')][_0xc53f('0x23')](_0x2bd994);})[_0xc53f('0x27')](function(_0x27c3e5){_0x4dd362['rows']=_0x27c3e5;return _0x4dd362;});}})[_0xc53f('0x27')](respondWithFilteredResult(_0x2cb666,_0x2bd994))['catch'](handleError(_0x2cb666,null));};exports['addTags']=function(_0x3931d6,_0x25c22e){return db[_0xc53f('0x1d')][_0xc53f('0x36')]({'where':{'id':_0x3931d6[_0xc53f('0x2a')]['id']}})['then'](handleEntityNotFound(_0x25c22e,null))[_0xc53f('0x27')](function(_0x392043){if(_0x392043){return _0x392043[_0xc53f('0x49')](_0x3931d6[_0xc53f('0x34')][_0xc53f('0x3a')],_['omit'](_0x3931d6[_0xc53f('0x34')],['ids','id'])||{})[_0xc53f('0x4a')](function(){return db['Tag'][_0xc53f('0x23')]({'attributes':['id',_0xc53f('0x19'),'color'],'where':{'id':_0x3931d6['body'][_0xc53f('0x3a')]}});})[_0xc53f('0x27')](function(_0x4ad18d){socket[_0xc53f('0x4b')](_0xc53f('0x4c'),{'id':Number(_0x3931d6['params']['id']),'tags':_0x4ad18d||[]});return{'id':Number(_0x3931d6[_0xc53f('0x2a')]['id']),'tags':_0x4ad18d||[]};});}})[_0xc53f('0x27')](respondWithResult(_0x25c22e,null))['catch'](handleError(_0x25c22e,null));};exports[_0xc53f('0x4d')]=function(_0xe3ff91,_0x42e515){return db['FaxInteraction'][_0xc53f('0x36')]({'where':{'id':_0xe3ff91[_0xc53f('0x2a')]['id']}})[_0xc53f('0x27')](handleEntityNotFound(_0x42e515,null))[_0xc53f('0x27')](function(_0x485898){if(_0x485898){return _0x485898[_0xc53f('0x4d')](_0xe3ff91[_0xc53f('0x25')][_0xc53f('0x3a')]);}})['then'](respondWithStatusCode(_0x42e515,null))['catch'](handleError(_0x42e515,null));};exports[_0xc53f('0x4e')]=function(_0x115e53,_0x5b864a){var _0x5cac1f=moment()['unix']()['toString']();var _0x5897c2=path['join'](config[_0xc53f('0x4f')],'server',_0xc53f('0x50'),_0xc53f('0x51'));var _0x50c7df=path['join'](config['root'],'server',_0xc53f('0x50'),_0xc53f('0x52'));var _0x11a476=path[_0xc53f('0x53')](_0x5897c2,_0x5cac1f);var _0x26f8fc=util[_0xc53f('0x46')](_0xc53f('0x54'),_0x115e53[_0xc53f('0x2a')]['id'],_0x5cac1f);var _0x4cd13e=path[_0xc53f('0x53')](_0x5897c2,_0x26f8fc);var _0x4d0ee6=[];_0x4d0ee6[_0xc53f('0x55')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});var _0x35f37f=[{'model':db['FaxMessage'],'as':'Messages','attributes':['id','body','createdAt'],'include':_0x4d0ee6}];return db[_0xc53f('0x1d')][_0xc53f('0x36')]({'where':{'id':_0x115e53[_0xc53f('0x2a')]['id']},'include':_0x35f37f})[_0xc53f('0x27')](handleEntityNotFound(_0x5b864a,null))[_0xc53f('0x27')](function(_0x47500a){if(_0x47500a&&_0x47500a['Messages']){var _0xb3be4e=_0x47500a[_0xc53f('0x56')]({'plain':!![]});fs[_0xc53f('0x57')](_0x11a476);for(var _0x4ab6c8=0x0;_0x4ab6c8<_0xb3be4e[_0xc53f('0x58')][_0xc53f('0x30')];_0x4ab6c8++){var _0x4ca687=_0xb3be4e[_0xc53f('0x58')][_0x4ab6c8][_0xc53f('0x59')];if(_0x4ca687){var _0x501a42=path[_0xc53f('0x53')](_0x50c7df,_0x4ca687[_0xc53f('0x5a')]);if(fs[_0xc53f('0x5b')](_0x501a42)){fs[_0xc53f('0x5c')](_0x501a42)['pipe'](fs['createWriteStream'](path[_0xc53f('0x53')](_0x11a476,_0x4ca687[_0xc53f('0x5a')])));}}}return BPromise[_0xc53f('0x5d')]()['then'](function(){return new BPromise(function(_0x451a1c,_0x29680b){zipdir(_0x11a476,{'saveTo':_0x4cd13e},function(_0x5b8441,_0x2bb90a){if(_0x5b8441)return _0x29680b(_0x5b8441);return _0x451a1c(_0x2bb90a);});})['then'](function(){return new BPromise(function(_0x449742,_0x1a59a7){rimraf(_0x11a476,function(_0x30cd36){if(_0x30cd36)_0x1a59a7(_0x30cd36);return _0x449742();});});})[_0xc53f('0x27')](function(){return _0x5b864a[_0xc53f('0x4e')](_0x4cd13e,_0x26f8fc,function(_0x1f8eed){if(_0x1f8eed){console[_0xc53f('0x5e')](_0xc53f('0x5f'),_0x1f8eed);}else{fs[_0xc53f('0x60')](_0x4cd13e);}});});});}else{return _0x5b864a['sendStatus'](0xc8);}})[_0xc53f('0x28')](handleError(_0x5b864a,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 0c9e58b..63fd39e 100644 --- a/server/api/faxInteraction/faxInteraction.events.js +++ b/server/api/faxInteraction/faxInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x533f=['findAll','unreadMessages','length','emit','catch','hook','exports','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map'];(function(_0x50e557,_0x12b242){var _0x1b1121=function(_0x29c0fe){while(--_0x29c0fe){_0x50e557['push'](_0x50e557['shift']());}};_0x1b1121(++_0x12b242);}(_0x533f,0x111));var _0xf533=function(_0xcfe8cc,_0xb83aeb){_0xcfe8cc=_0xcfe8cc-0x0;var _0x55ac53=_0x533f[_0xcfe8cc];return _0x55ac53;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0xf533('0x0'))['db'][_0xf533('0x1')];var FaxMessage=require(_0xf533('0x0'))['db'][_0xf533('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xf533('0x3')](0x0);var events={'afterCreate':_0xf533('0x4'),'afterUpdate':_0xf533('0x5'),'afterDestroy':_0xf533('0x6')};function emitEvent(_0x292850){return function(_0x38bc54,_0x4c03a2,_0x4faf5a){_0x38bc54[_0xf533('0x7')]({'attributes':['id'],'raw':!![]})[_0xf533('0x8')](function(_0x56ac36){_0x38bc54[_0xf533('0x9')](_0xf533('0xa'),_0x56ac36[_0xf533('0xb')](function(_0xda9cc8){return{'id':_0xda9cc8['id']};}));return FaxMessage[_0xf533('0xc')]({'where':{'FaxInteractionId':_0x38bc54['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf533('0x8')](function(_0x2a660a){_0x38bc54[_0xf533('0x9')](_0xf533('0xd'),_0x2a660a[_0xf533('0xe')]);FaxInteractionEvents['emit'](_0x292850+':'+_0x38bc54['id'],_0x38bc54);FaxInteractionEvents[_0xf533('0xf')](_0x292850,_0x38bc54);_0x4faf5a(null);})[_0xf533('0x10')](_0x4faf5a(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0xf533('0x11')](e,emitEvent(event));}}module[_0xf533('0x12')]=FaxInteractionEvents; \ No newline at end of file +var _0xea87=['remove','setDataValue','Users','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','FaxInteraction','../../mysqldb','FaxMessage','setMaxListeners','save'];(function(_0x52e18c,_0x14f907){var _0x479866=function(_0xc4a36c){while(--_0xc4a36c){_0x52e18c['push'](_0x52e18c['shift']());}};_0x479866(++_0x14f907);}(_0xea87,0x8b));var _0x7ea8=function(_0x43c27f,_0x1d048a){_0x43c27f=_0x43c27f-0x0;var _0x3dde02=_0xea87[_0x43c27f];return _0x3dde02;};'use strict';var EventEmitter=require('events');var FaxInteraction=require('../../mysqldb')['db'][_0x7ea8('0x0')];var FaxMessage=require(_0x7ea8('0x1'))['db'][_0x7ea8('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x7ea8('0x3')](0x0);var events={'afterCreate':_0x7ea8('0x4'),'afterUpdate':'update','afterDestroy':_0x7ea8('0x5')};function emitEvent(_0x53d350){return function(_0x47e2f0,_0x32940b,_0x5f229f){_0x47e2f0['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x3db674){_0x47e2f0[_0x7ea8('0x6')](_0x7ea8('0x7'),_0x3db674['map'](function(_0x311316){return{'id':_0x311316['id']};}));return FaxMessage[_0x7ea8('0x8')]({'where':{'FaxInteractionId':_0x47e2f0['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0xe7788c){_0x47e2f0[_0x7ea8('0x6')](_0x7ea8('0x9'),_0xe7788c[_0x7ea8('0xa')]);FaxInteractionEvents['emit'](_0x53d350+':'+_0x47e2f0['id'],_0x47e2f0);FaxInteractionEvents[_0x7ea8('0xb')](_0x53d350,_0x47e2f0);_0x5f229f(null);})[_0x7ea8('0xc')](_0x5f229f(null));};}for(var e in events){if(events[_0x7ea8('0xd')](e)){var event=events[e];FaxInteraction[_0x7ea8('0xe')](e,emitEvent(event));}}module[_0x7ea8('0xf')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 7d980e9..5de6045 100644 --- a/server/api/faxInteraction/faxInteraction.model.js +++ b/server/api/faxInteraction/faxInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe02a=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed'];(function(_0x392b6d,_0x55c00f){var _0x12f976=function(_0x194d75){while(--_0x194d75){_0x392b6d['push'](_0x392b6d['shift']());}};_0x12f976(++_0x55c00f);}(_0xe02a,0xa3));var _0xae02=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe02a[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xae02('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xae02('0x1'));var rp=require(_0xae02('0x2'));var fs=require('fs');var path=require(_0xae02('0x3'));var rimraf=require(_0xae02('0x4'));var config=require(_0xae02('0x5'));var attributes=require(_0xae02('0x6'));module[_0xae02('0x7')]=function(_0x1894b4,_0x2ad7f4){return _0x1894b4[_0xae02('0x8')](_0xae02('0x9'),attributes,{'tableName':_0xae02('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x24befe,_0x244971,_0x7dbfe6){if(_0x24befe[_0xae02('0xb')](_0xae02('0xc'))){_0x24befe[_0xae02('0xd')]=moment()[_0xae02('0xe')](_0xae02('0xf'));}_0x7dbfe6(null,_0x24befe);}}});}; \ No newline at end of file +var _0xe65b=['path','rimraf','../../config/environment','exports','FaxInteraction','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4629ee,_0x5802d8){var _0x47fb5b=function(_0xf899cd){while(--_0xf899cd){_0x4629ee['push'](_0x4629ee['shift']());}};_0x47fb5b(++_0x5802d8);}(_0xe65b,0xf9));var _0xbe65=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xe65b[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0xbe65('0x0'));var util=require(_0xbe65('0x1'));var logger=require(_0xbe65('0x2'))(_0xbe65('0x3'));var moment=require(_0xbe65('0x4'));var BPromise=require(_0xbe65('0x5'));var rp=require(_0xbe65('0x6'));var fs=require('fs');var path=require(_0xbe65('0x7'));var rimraf=require(_0xbe65('0x8'));var config=require(_0xbe65('0x9'));var attributes=require('./faxInteraction.attributes');module[_0xbe65('0xa')]=function(_0x22c879,_0x414945){return _0x22c879['define'](_0xbe65('0xb'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2a1f1a,_0x9d4133,_0x47ac38){if(_0x2a1f1a[_0xbe65('0xc')](_0xbe65('0xd'))){_0x2a1f1a['closedAt']=moment()[_0xbe65('0xe')](_0xbe65('0xf'));}_0x47ac38(null,_0x2a1f1a);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 94169ca..1511036 100644 --- a/server/api/faxInteraction/faxInteraction.rpc.js +++ b/server/api/faxInteraction/faxInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5b80=['options','where','limit','stringify','FaxInteraction','find','ids','omit','spread','AddTags','lodash','bluebird','ioredis','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','info','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','FaxInteraction,\x20%s,\x20%s','message','result','catch','UpdateFaxInteraction','update','body'];(function(_0x56e6e4,_0x18dc9b){var _0x1bdb3e=function(_0x43d3d1){while(--_0x43d3d1){_0x56e6e4['push'](_0x56e6e4['shift']());}};_0x1bdb3e(++_0x18dc9b);}(_0x5b80,0x1de));var _0x05b8=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0x5b80[_0x397cfb];return _0x15fed9;};'use strict';var _=require(_0x05b8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x05b8('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x05b8('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x05b8('0x3'))(_0x05b8('0x4'));var config=require(_0x05b8('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x05b8('0x6')][_0x05b8('0x7')]({'port':0x232a});config[_0x05b8('0x8')]=_[_0x05b8('0x9')](config['redis'],{'host':_0x05b8('0xa'),'port':0x18eb});var socket=require(_0x05b8('0xb'))(new Redis(config['redis']));require(_0x05b8('0xc'))[_0x05b8('0xd')](socket);function respondWithRpcPromise(_0x35ffe1,_0x2e36d2,_0x19ce76){return new BPromise(function(_0x1159ee,_0x5c7413){return client[_0x05b8('0xe')](_0x35ffe1,_0x19ce76)[_0x05b8('0xf')](function(_0xe73554){logger[_0x05b8('0x10')]('FaxInteraction,\x20%s,\x20%s',_0x2e36d2,_0x05b8('0x11'));logger[_0x05b8('0x12')](_0x05b8('0x13'),_0x2e36d2,_0x05b8('0x11'),JSON['stringify'](_0xe73554));if(_0xe73554[_0x05b8('0x14')]){if(_0xe73554[_0x05b8('0x14')][_0x05b8('0x15')]===0x1f4){logger['error'](_0x05b8('0x16'),_0x2e36d2,_0xe73554['error'][_0x05b8('0x17')]);return _0x5c7413(_0xe73554['error'][_0x05b8('0x17')]);}logger[_0x05b8('0x14')](_0x05b8('0x16'),_0x2e36d2,_0xe73554[_0x05b8('0x14')][_0x05b8('0x17')]);return _0x1159ee(_0xe73554[_0x05b8('0x14')][_0x05b8('0x17')]);}else{logger[_0x05b8('0x10')](_0x05b8('0x16'),_0x2e36d2,_0x05b8('0x11'));_0x1159ee(_0xe73554[_0x05b8('0x18')][_0x05b8('0x17')]);}})[_0x05b8('0x19')](function(_0x3b6a4e){logger['error'](_0x05b8('0x16'),_0x2e36d2,_0x3b6a4e);_0x5c7413(_0x3b6a4e);});});}exports[_0x05b8('0x1a')]=function(_0x3ef466){var _0x2759f6=this;return new Promise(function(_0x3b83e1,_0x2725d2){return db['FaxInteraction'][_0x05b8('0x1b')](_0x3ef466[_0x05b8('0x1c')],{'raw':_0x3ef466[_0x05b8('0x1d')]?_0x3ef466[_0x05b8('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ef466[_0x05b8('0x1d')]?_0x3ef466['options'][_0x05b8('0x1e')]||null:null,'attributes':_0x3ef466['options']?_0x3ef466[_0x05b8('0x1d')]['attributes']||null:null,'limit':_0x3ef466[_0x05b8('0x1d')]?_0x3ef466[_0x05b8('0x1d')][_0x05b8('0x1f')]||null:null})['then'](function(_0x32d804){logger[_0x05b8('0x10')](_0x05b8('0x1a'),_0x3ef466);logger['debug'](_0x05b8('0x1a'),_0x3ef466,JSON[_0x05b8('0x20')](_0x32d804));_0x3b83e1(_0x32d804);})[_0x05b8('0x19')](function(_0x9877ce){logger[_0x05b8('0x14')](_0x05b8('0x1a'),_0x9877ce[_0x05b8('0x17')],_0x3ef466);_0x2725d2(_0x2759f6[_0x05b8('0x14')](0x1f4,_0x9877ce[_0x05b8('0x17')]));});});};exports['AddTagsToFaxInteraction']=function(_0x19d928){return new Promise(function(_0x3dde2b,_0x5d9c43){return db[_0x05b8('0x21')][_0x05b8('0x22')]({'where':_0x19d928['options']?_0x19d928[_0x05b8('0x1d')][_0x05b8('0x1e')]||null:null})[_0x05b8('0xf')](function(_0x4bdeac){if(_0x4bdeac){return _0x4bdeac['addTags'](_0x19d928[_0x05b8('0x1c')][_0x05b8('0x23')],_[_0x05b8('0x24')](_0x19d928['body'],['ids','id'])||{});}})[_0x05b8('0x25')](function(_0x4b4af7){logger['info']('AddTags',_0x19d928);logger[_0x05b8('0x12')](_0x05b8('0x26'),_0x19d928,JSON['stringify'](_0x4b4af7));_0x3dde2b(_0x4b4af7);})[_0x05b8('0x19')](function(_0x5da8e0){logger[_0x05b8('0x14')](_0x05b8('0x26'),_0x5da8e0[_0x05b8('0x17')],_0x19d928);_0x5d9c43(_this[_0x05b8('0x14')](0x1f4,_0x5da8e0[_0x05b8('0x17')]));});});}; \ No newline at end of file +var _0xcf4a=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','then','info','FaxInteraction,\x20%s,\x20%s','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','options','raw','where','attributes','limit','stringify','AddTagsToFaxInteraction','find','addTags','omit','ids','spread','AddTags','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x461123,_0x3112de){var _0x11d869=function(_0x12d4e4){while(--_0x12d4e4){_0x461123['push'](_0x461123['shift']());}};_0x11d869(++_0x3112de);}(_0xcf4a,0xca));var _0xacf4=function(_0x3f7187,_0x3076b4){_0x3f7187=_0x3f7187-0x0;var _0x3a2f0b=_0xcf4a[_0x3f7187];return _0x3a2f0b;};'use strict';var _=require(_0xacf4('0x0'));var util=require('util');var moment=require(_0xacf4('0x1'));var BPromise=require(_0xacf4('0x2'));var rs=require(_0xacf4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xacf4('0x4'))['db'];var utils=require(_0xacf4('0x5'));var logger=require(_0xacf4('0x6'))(_0xacf4('0x7'));var config=require(_0xacf4('0x8'));var jayson=require(_0xacf4('0x9'));var client=jayson[_0xacf4('0xa')][_0xacf4('0xb')]({'port':0x232a});config[_0xacf4('0xc')]=_[_0xacf4('0xd')](config[_0xacf4('0xc')],{'host':_0xacf4('0xe'),'port':0x18eb});var socket=require(_0xacf4('0xf'))(new Redis(config[_0xacf4('0xc')]));require('./faxInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x39ee51,_0x2914b2,_0x3c42d3){return new BPromise(function(_0xa7b726,_0x20b0c7){return client['request'](_0x39ee51,_0x3c42d3)[_0xacf4('0x10')](function(_0x44d86f){logger[_0xacf4('0x11')](_0xacf4('0x12'),_0x2914b2,'request\x20sent');logger[_0xacf4('0x13')](_0xacf4('0x14'),_0x2914b2,_0xacf4('0x15'),JSON['stringify'](_0x44d86f));if(_0x44d86f[_0xacf4('0x16')]){if(_0x44d86f[_0xacf4('0x16')][_0xacf4('0x17')]===0x1f4){logger[_0xacf4('0x16')]('FaxInteraction,\x20%s,\x20%s',_0x2914b2,_0x44d86f[_0xacf4('0x16')][_0xacf4('0x18')]);return _0x20b0c7(_0x44d86f[_0xacf4('0x16')][_0xacf4('0x18')]);}logger[_0xacf4('0x16')](_0xacf4('0x12'),_0x2914b2,_0x44d86f['error'][_0xacf4('0x18')]);return _0xa7b726(_0x44d86f['error']['message']);}else{logger[_0xacf4('0x11')]('FaxInteraction,\x20%s,\x20%s',_0x2914b2,_0xacf4('0x15'));_0xa7b726(_0x44d86f[_0xacf4('0x19')]['message']);}})[_0xacf4('0x1a')](function(_0x22fe62){logger[_0xacf4('0x16')](_0xacf4('0x12'),_0x2914b2,_0x22fe62);_0x20b0c7(_0x22fe62);});});}exports[_0xacf4('0x1b')]=function(_0x24e55d){var _0x41d7d9=this;return new Promise(function(_0x1dae0e,_0x5cf8a6){return db[_0xacf4('0x1c')]['update'](_0x24e55d['body'],{'raw':_0x24e55d[_0xacf4('0x1d')]?_0x24e55d['options'][_0xacf4('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24e55d[_0xacf4('0x1d')]?_0x24e55d[_0xacf4('0x1d')][_0xacf4('0x1f')]||null:null,'attributes':_0x24e55d['options']?_0x24e55d['options'][_0xacf4('0x20')]||null:null,'limit':_0x24e55d[_0xacf4('0x1d')]?_0x24e55d[_0xacf4('0x1d')][_0xacf4('0x21')]||null:null})[_0xacf4('0x10')](function(_0x22208e){logger['info'](_0xacf4('0x1b'),_0x24e55d);logger['debug']('UpdateFaxInteraction',_0x24e55d,JSON[_0xacf4('0x22')](_0x22208e));_0x1dae0e(_0x22208e);})[_0xacf4('0x1a')](function(_0x8e8f40){logger[_0xacf4('0x16')](_0xacf4('0x1b'),_0x8e8f40['message'],_0x24e55d);_0x5cf8a6(_0x41d7d9['error'](0x1f4,_0x8e8f40[_0xacf4('0x18')]));});});};exports[_0xacf4('0x23')]=function(_0x10354f){return new Promise(function(_0xad29d8,_0x17b60b){return db['FaxInteraction'][_0xacf4('0x24')]({'where':_0x10354f[_0xacf4('0x1d')]?_0x10354f[_0xacf4('0x1d')][_0xacf4('0x1f')]||null:null})[_0xacf4('0x10')](function(_0x4fd7ca){if(_0x4fd7ca){return _0x4fd7ca[_0xacf4('0x25')](_0x10354f['body']['ids'],_[_0xacf4('0x26')](_0x10354f['body'],[_0xacf4('0x27'),'id'])||{});}})[_0xacf4('0x28')](function(_0x5c5e2b){logger[_0xacf4('0x11')](_0xacf4('0x29'),_0x10354f);logger[_0xacf4('0x13')](_0xacf4('0x29'),_0x10354f,JSON[_0xacf4('0x22')](_0x5c5e2b));_0xad29d8(_0x5c5e2b);})['catch'](function(_0x5186a7){logger[_0xacf4('0x16')](_0xacf4('0x29'),_0x5186a7[_0xacf4('0x18')],_0x10354f);_0x17b60b(_this[_0xacf4('0x16')](0x1f4,_0x5186a7[_0xacf4('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index ccb4366..4169ee8 100644 --- a/server/api/faxInteraction/faxInteraction.socket.js +++ b/server/api/faxInteraction/faxInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xef62=['emit','removeListener','register','length','faxInteraction:','./faxInteraction.events','save','update'];(function(_0x51156d,_0xe9e50){var _0x598764=function(_0x4058af){while(--_0x4058af){_0x51156d['push'](_0x51156d['shift']());}};_0x598764(++_0xe9e50);}(_0xef62,0x105));var _0x2ef6=function(_0x3d537b,_0x5d2728){_0x3d537b=_0x3d537b-0x0;var _0x5d2e69=_0xef62[_0x3d537b];return _0x5d2e69;};'use strict';var FaxInteractionEvents=require(_0x2ef6('0x0'));var events=[_0x2ef6('0x1'),'remove',_0x2ef6('0x2')];function createListener(_0x1a3fa1,_0x370676){return function(_0x16c7ff){_0x370676[_0x2ef6('0x3')](_0x1a3fa1,_0x16c7ff);};}function removeListener(_0x26945d,_0xaa378){return function(){FaxInteractionEvents[_0x2ef6('0x4')](_0x26945d,_0xaa378);};}exports[_0x2ef6('0x5')]=function(_0x455a7c){for(var _0xbda672=0x0,_0x44fbbb=events[_0x2ef6('0x6')];_0xbda672<_0x44fbbb;_0xbda672++){var _0x4848e3=events[_0xbda672];var _0x70a1b4=createListener(_0x2ef6('0x7')+_0x4848e3,_0x455a7c);FaxInteractionEvents['on'](_0x4848e3,_0x70a1b4);}}; \ No newline at end of file +var _0xfe19=['./faxInteraction.events','remove','update','emit','removeListener','faxInteraction:'];(function(_0x5192f7,_0xd9013e){var _0x2ae668=function(_0x179e0b){while(--_0x179e0b){_0x5192f7['push'](_0x5192f7['shift']());}};_0x2ae668(++_0xd9013e);}(_0xfe19,0x114));var _0x9fe1=function(_0x1b94e0,_0xe215ac){_0x1b94e0=_0x1b94e0-0x0;var _0x4e3f62=_0xfe19[_0x1b94e0];return _0x4e3f62;};'use strict';var FaxInteractionEvents=require(_0x9fe1('0x0'));var events=['save',_0x9fe1('0x1'),_0x9fe1('0x2')];function createListener(_0x117337,_0x54849b){return function(_0x3656d4){_0x54849b[_0x9fe1('0x3')](_0x117337,_0x3656d4);};}function removeListener(_0x18be71,_0x3fabf5){return function(){FaxInteractionEvents[_0x9fe1('0x4')](_0x18be71,_0x3fabf5);};}exports['register']=function(_0xa3a533){for(var _0x21d45a=0x0,_0x1d726e=events['length'];_0x21d45a<_0x1d726e;_0x21d45a++){var _0x3f0343=events[_0x21d45a];var _0x33c880=createListener(_0x9fe1('0x5')+_0x3f0343,_0xa3a533);FaxInteractionEvents['on'](_0x3f0343,_0x33c880);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 1926426..88002d7 100644 --- a/server/api/faxInteraction/index.js +++ b/server/api/faxInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe06f=['addTags','put','tracked','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','fax'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xe06f,0x65));var _0xfe06=function(_0x441ae,_0x2f2209){_0x441ae=_0x441ae-0x0;var _0x418a32=_0xe06f[_0x441ae];return _0x418a32;};'use strict';var multer=require(_0xfe06('0x0'));var util=require(_0xfe06('0x1'));var path=require('path');var timeout=require(_0xfe06('0x2'));var express=require('express');var router=express[_0xfe06('0x3')]();var fs_extra=require(_0xfe06('0x4'));var auth=require(_0xfe06('0x5'));var interaction=require(_0xfe06('0x6'));var config=require(_0xfe06('0x7'));var controller=require(_0xfe06('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xfe06('0x9')](_0xfe06('0xa'),auth[_0xfe06('0xb')](),controller[_0xfe06('0xc')]);router[_0xfe06('0x9')](_0xfe06('0xd'),auth['isAuthenticated'](),controller[_0xfe06('0xe')]);router[_0xfe06('0x9')](_0xfe06('0xf'),auth[_0xfe06('0xb')](),controller['getMessages']);router[_0xfe06('0x9')](_0xfe06('0x10'),auth[_0xfe06('0xb')](),controller[_0xfe06('0x11')]);router[_0xfe06('0x12')]('/',auth[_0xfe06('0xb')](),controller[_0xfe06('0x13')]);router[_0xfe06('0x12')]('/:id/messages',auth[_0xfe06('0xb')](),controller[_0xfe06('0x14')]);router[_0xfe06('0x12')](_0xfe06('0x15'),auth['isAuthenticated'](),interaction['tracked'](_0xfe06('0x16'),'faxinteraction:addtags'),controller[_0xfe06('0x17')]);router[_0xfe06('0x18')](_0xfe06('0xd'),auth['isAuthenticated'](),interaction[_0xfe06('0x19')](_0xfe06('0x16'),_0xfe06('0x1a')),controller[_0xfe06('0x1b')]);router[_0xfe06('0x1c')](_0xfe06('0xd'),auth[_0xfe06('0xb')](),interaction['tracked'](_0xfe06('0x16'),_0xfe06('0x1d')),controller[_0xfe06('0x1e')]);router[_0xfe06('0x1c')](_0xfe06('0x15'),auth['isAuthenticated'](),controller['removeTags']);module['exports']=router; \ No newline at end of file +var _0x5aaa=['destroy','delete','exports','multer','fs-extra','../../components/auth/service','../../components/interaction/service','./faxInteraction.controller','get','index','/describe','isAuthenticated','/:id','show','getMessages','/:id/download','download','post','/:id/messages','addMessage','/:id/tags','tracked','faxinteraction:addtags','addTags','put','fax','update','faxinteraction:destroy'];(function(_0x548503,_0x1aa00c){var _0xf8f05f=function(_0x2014c2){while(--_0x2014c2){_0x548503['push'](_0x548503['shift']());}};_0xf8f05f(++_0x1aa00c);}(_0x5aaa,0xff));var _0xa5aa=function(_0x53475f,_0x4d4fda){_0x53475f=_0x53475f-0x0;var _0x4c3cbc=_0x5aaa[_0x53475f];return _0x4c3cbc;};'use strict';var multer=require(_0xa5aa('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa5aa('0x1'));var auth=require(_0xa5aa('0x2'));var interaction=require(_0xa5aa('0x3'));var config=require('../../config/environment');var controller=require(_0xa5aa('0x4'));router[_0xa5aa('0x5')]('/',auth['isAuthenticated'](),controller[_0xa5aa('0x6')]);router[_0xa5aa('0x5')](_0xa5aa('0x7'),auth[_0xa5aa('0x8')](),controller['describe']);router['get'](_0xa5aa('0x9'),auth[_0xa5aa('0x8')](),controller[_0xa5aa('0xa')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0xa5aa('0xb')]);router['get'](_0xa5aa('0xc'),auth[_0xa5aa('0x8')](),controller[_0xa5aa('0xd')]);router[_0xa5aa('0xe')]('/',auth[_0xa5aa('0x8')](),controller['create']);router[_0xa5aa('0xe')](_0xa5aa('0xf'),auth[_0xa5aa('0x8')](),controller[_0xa5aa('0x10')]);router['post'](_0xa5aa('0x11'),auth[_0xa5aa('0x8')](),interaction[_0xa5aa('0x12')]('fax',_0xa5aa('0x13')),controller[_0xa5aa('0x14')]);router[_0xa5aa('0x15')](_0xa5aa('0x9'),auth[_0xa5aa('0x8')](),interaction[_0xa5aa('0x12')](_0xa5aa('0x16'),'faxinteraction:update'),controller[_0xa5aa('0x17')]);router['delete']('/:id',auth[_0xa5aa('0x8')](),interaction[_0xa5aa('0x12')](_0xa5aa('0x16'),_0xa5aa('0x18')),controller[_0xa5aa('0x19')]);router[_0xa5aa('0x1a')](_0xa5aa('0x11'),auth[_0xa5aa('0x8')](),controller['removeTags']);module[_0xa5aa('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index c08c93a..49822b4 100644 --- a/server/api/faxMessage/faxMessage.attributes.js +++ b/server/api/faxMessage/faxMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6282=['TEXT','medium','out','DATE','sequelize','exports'];(function(_0x271f2b,_0x26c47b){var _0x3c3141=function(_0x45c716){while(--_0x45c716){_0x271f2b['push'](_0x271f2b['shift']());}};_0x3c3141(++_0x26c47b);}(_0x6282,0x76));var _0x2628=function(_0xfc15a4,_0x4daaa6){_0xfc15a4=_0xfc15a4-0x0;var _0xb14508=_0x6282[_0xfc15a4];return _0xb14508;};'use strict';var Sequelize=require(_0x2628('0x0'));module[_0x2628('0x1')]={'body':{'type':Sequelize[_0x2628('0x2')](_0x2628('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x2628('0x4')),'defaultValue':_0x2628('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x2628('0x5')]}}; \ No newline at end of file +var _0xa9e0=['ENUM','out','DATE','sequelize','exports','TEXT'];(function(_0x1a8889,_0x5721d4){var _0x4a6d56=function(_0xa82daa){while(--_0xa82daa){_0x1a8889['push'](_0x1a8889['shift']());}};_0x4a6d56(++_0x5721d4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'body':{'type':Sequelize[_0x0a9e('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x0a9e('0x3')]('in','out'),'defaultValue':_0x0a9e('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x0a9e('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 4d4a2db..8bd1297 100644 --- a/server/api/faxMessage/faxMessage.controller.js +++ b/server/api/faxMessage/faxMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4ca5=['name','send','index','map','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','FaxMessage','rawAttributes','find','body','../../config/logger','fax-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','isNil','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','acceptMessage','sequelize','QueryTypes','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','fax','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','SELECT','reject','create','Attachment','findOne','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','download','join','root','server','files','attachments','basename','eml-format','rimraf','fast-json-patch','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','redis','defaults','localhost','register','jayson/promise','http','client','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','save','update','destroy','stack'];(function(_0x99f811,_0x44d59e){var _0x37ba7f=function(_0x3f3961){while(--_0x3f3961){_0x99f811['push'](_0x99f811['shift']());}};_0x37ba7f(++_0x44d59e);}(_0x4ca5,0xdd));var _0x54ca=function(_0x99f11f,_0x57046a){_0x99f11f=_0x99f11f-0x0;var _0x32335a=_0x4ca5[_0x99f11f];return _0x32335a;};'use strict';var emlformat=require(_0x54ca('0x0'));var rimraf=require(_0x54ca('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x54ca('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x54ca('0x3'));var Mustache=require('mustache');var util=require(_0x54ca('0x4'));var path=require(_0x54ca('0x5'));var sox=require('sox');var csv=require(_0x54ca('0x6'));var ejs=require(_0x54ca('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x54ca('0x8'));var squel=require('squel');var crypto=require(_0x54ca('0x9'));var jsforce=require(_0x54ca('0xa'));var deskjs=require(_0x54ca('0xb'));var toCsv=require(_0x54ca('0x6'));var querystring=require(_0x54ca('0xc'));var Papa=require(_0x54ca('0xd'));var Redis=require(_0x54ca('0xe'));var authService=require(_0x54ca('0xf'));var qs=require(_0x54ca('0x10'));var as=require(_0x54ca('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x54ca('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x54ca('0x13'));var db=require('../../mysqldb')['db'];config[_0x54ca('0x14')]=_[_0x54ca('0x15')](config['redis'],{'host':_0x54ca('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxMessage.socket')[_0x54ca('0x17')](socket);var jayson=require(_0x54ca('0x18'));var client=jayson['client'][_0x54ca('0x19')]({'port':0x232c});var client9002=jayson[_0x54ca('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0xabd7f,_0xfa10d7,_0x4b6cde,_0x1ec300){return new BPromise(function(_0x1dc011,_0x1320b6){var _0x4d26bc=_0x1ec300||client;return _0x4d26bc[_0x54ca('0x1b')](_0xabd7f,_0x4b6cde)[_0x54ca('0x1c')](function(_0x1bb3fc){logger[_0x54ca('0x1d')](_0x54ca('0x1e'),_0xfa10d7,_0x54ca('0x1f'));logger[_0x54ca('0x20')](_0x54ca('0x21'),_0xfa10d7,_0x54ca('0x1f'),JSON['stringify'](_0x1bb3fc));if(_0x1bb3fc['error']){if(_0x1bb3fc[_0x54ca('0x22')][_0x54ca('0x23')]===0x1f4){logger['error'](_0x54ca('0x1e'),_0xfa10d7,_0x1bb3fc[_0x54ca('0x22')][_0x54ca('0x24')]);return _0x1320b6(_0x1bb3fc['error']['message']);}logger[_0x54ca('0x22')](_0x54ca('0x1e'),_0xfa10d7,_0x1bb3fc[_0x54ca('0x22')][_0x54ca('0x24')]);return _0x1dc011(_0x1bb3fc[_0x54ca('0x22')]['message']);}else{logger[_0x54ca('0x1d')](_0x54ca('0x1e'),_0xfa10d7,_0x54ca('0x1f'));_0x1dc011(_0x1bb3fc[_0x54ca('0x25')][_0x54ca('0x24')]);}})[_0x54ca('0x26')](function(_0x30f660){logger['error'](_0x54ca('0x1e'),_0xfa10d7,_0x30f660);_0x1320b6(_0x30f660);});});}function respondWithStatusCode(_0x3bf504,_0x3e62b9){_0x3e62b9=_0x3e62b9||0xcc;return function(_0x5b7236){if(_0x5b7236){return _0x3bf504[_0x54ca('0x27')](_0x3e62b9);}return _0x3bf504[_0x54ca('0x28')](_0x3e62b9)[_0x54ca('0x29')]();};}function respondWithResult(_0x4b6fd1,_0x14c3ac){_0x14c3ac=_0x14c3ac||0xc8;return function(_0x543ca2){if(_0x543ca2){return _0x4b6fd1[_0x54ca('0x28')](_0x14c3ac)[_0x54ca('0x2a')](_0x543ca2);}};}function respondWithFilteredResult(_0x4c7df2,_0x4c5e7d){return function(_0x1f557d){if(_0x1f557d){var _0x568d23=typeof _0x4c5e7d[_0x54ca('0x2b')]===_0x54ca('0x2c')&&typeof _0x4c5e7d[_0x54ca('0x2d')]===_0x54ca('0x2c');var _0x5dd7a7=_0x1f557d[_0x54ca('0x2e')];var _0x36b10e=_0x568d23?0x0:_0x4c5e7d[_0x54ca('0x2b')];var _0x3e4c87=_0x568d23?_0x1f557d[_0x54ca('0x2e')]:_0x4c5e7d[_0x54ca('0x2b')]+_0x4c5e7d['limit'];var _0x2e7115;if(_0x3e4c87>=_0x5dd7a7){_0x3e4c87=_0x5dd7a7;_0x2e7115=0xc8;}else{_0x2e7115=0xce;}_0x4c7df2['status'](_0x2e7115);return _0x4c7df2['set']('Content-Range',_0x36b10e+'-'+_0x3e4c87+'/'+_0x5dd7a7)['json'](_0x1f557d);}return null;};}function patchUpdates(_0x45a25b){return function(_0x37aa1c){try{jsonpatch['apply'](_0x37aa1c,_0x45a25b,!![]);}catch(_0x30319e){return BPromise['reject'](_0x30319e);}return _0x37aa1c[_0x54ca('0x2f')]();};}function saveUpdates(_0x320e0a,_0x287d94){return function(_0x21bf37){if(_0x21bf37){return _0x21bf37[_0x54ca('0x30')](_0x320e0a)[_0x54ca('0x1c')](function(_0x3643eb){return _0x3643eb;});}return null;};}function removeEntity(_0x1602d9,_0x5785d1){return function(_0x287b41){if(_0x287b41){return _0x287b41[_0x54ca('0x31')]()[_0x54ca('0x1c')](function(){_0x1602d9[_0x54ca('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fd9b9,_0x4af071){return function(_0x2550f5){if(!_0x2550f5){_0x1fd9b9['sendStatus'](0x194);}return _0x2550f5;};}function handleError(_0x1be25b,_0x5a2d3e){_0x5a2d3e=_0x5a2d3e||0x1f4;return function(_0x13ba2e){logger['error'](_0x13ba2e[_0x54ca('0x32')]);if(_0x13ba2e[_0x54ca('0x33')]){delete _0x13ba2e[_0x54ca('0x33')];}_0x1be25b[_0x54ca('0x28')](_0x5a2d3e)[_0x54ca('0x34')](_0x13ba2e);};}exports[_0x54ca('0x35')]=function(_0x401d5b,_0x1d9202){var _0x190a80={},_0x14a561={},_0x39a608={'count':0x0,'rows':[]};var _0x173688=_[_0x54ca('0x36')](db['FaxMessage']['rawAttributes'],function(_0x26d6c6){return{'name':_0x26d6c6[_0x54ca('0x37')],'type':_0x26d6c6[_0x54ca('0x38')][_0x54ca('0x39')]};});_0x14a561['model']=_[_0x54ca('0x36')](_0x173688,_0x54ca('0x33'));_0x14a561['query']=_[_0x54ca('0x3a')](_0x401d5b['query']);_0x14a561[_0x54ca('0x3b')]=_[_0x54ca('0x3c')](_0x14a561[_0x54ca('0x3d')],_0x14a561[_0x54ca('0x3e')]);_0x190a80[_0x54ca('0x3f')]=_[_0x54ca('0x3c')](_0x14a561[_0x54ca('0x3d')],qs['fields'](_0x401d5b[_0x54ca('0x3e')][_0x54ca('0x40')]));_0x190a80[_0x54ca('0x3f')]=_0x190a80[_0x54ca('0x3f')][_0x54ca('0x41')]?_0x190a80[_0x54ca('0x3f')]:_0x14a561['model'];if(!_0x401d5b['query'][_0x54ca('0x42')](_0x54ca('0x43'))){_0x190a80[_0x54ca('0x2d')]=qs['limit'](_0x401d5b[_0x54ca('0x3e')][_0x54ca('0x2d')]);_0x190a80['offset']=qs[_0x54ca('0x2b')](_0x401d5b['query'][_0x54ca('0x2b')]);}_0x190a80['order']=qs['sort'](_0x401d5b[_0x54ca('0x3e')][_0x54ca('0x44')]);_0x190a80[_0x54ca('0x45')]=qs['filters'](_[_0x54ca('0x46')](_0x401d5b[_0x54ca('0x3e')],_0x14a561[_0x54ca('0x3b')]),_0x173688);if(_0x401d5b[_0x54ca('0x3e')][_0x54ca('0x47')]){_0x190a80[_0x54ca('0x45')]=_['merge'](_0x190a80[_0x54ca('0x45')],{'$or':_[_0x54ca('0x36')](_0x173688,function(_0x544578){if(_0x544578['type']!==_0x54ca('0x48')){var _0x1c0d41={};_0x1c0d41[_0x544578[_0x54ca('0x33')]]={'$like':'%'+_0x401d5b[_0x54ca('0x3e')][_0x54ca('0x47')]+'%'};return _0x1c0d41;}})});}_0x190a80=_[_0x54ca('0x49')]({},_0x190a80,_0x401d5b[_0x54ca('0x4a')]);var _0x47225a={'where':_0x190a80[_0x54ca('0x45')]};return db['FaxMessage'][_0x54ca('0x2e')](_0x47225a)[_0x54ca('0x1c')](function(_0x5aa128){_0x39a608['count']=_0x5aa128;if(_0x401d5b[_0x54ca('0x3e')][_0x54ca('0x4b')]){_0x190a80[_0x54ca('0x4c')]=[{'all':!![]}];}return db['FaxMessage'][_0x54ca('0x4d')](_0x190a80);})[_0x54ca('0x1c')](function(_0x3b10de){_0x39a608[_0x54ca('0x4e')]=_0x3b10de;return _0x39a608;})[_0x54ca('0x1c')](respondWithFilteredResult(_0x1d9202,_0x190a80))[_0x54ca('0x26')](handleError(_0x1d9202,null));};exports[_0x54ca('0x4f')]=function(_0x599661,_0x3182b8){var _0x805a12={'raw':!![],'where':{'id':_0x599661[_0x54ca('0x50')]['id']}},_0xffd652={};_0xffd652[_0x54ca('0x3d')]=_[_0x54ca('0x3a')](db[_0x54ca('0x51')][_0x54ca('0x52')]);_0xffd652[_0x54ca('0x3e')]=_[_0x54ca('0x3a')](_0x599661[_0x54ca('0x3e')]);_0xffd652['filters']=_['intersection'](_0xffd652[_0x54ca('0x3d')],_0xffd652['query']);_0x805a12[_0x54ca('0x3f')]=_['intersection'](_0xffd652['model'],qs[_0x54ca('0x40')](_0x599661[_0x54ca('0x3e')]['fields']));_0x805a12[_0x54ca('0x3f')]=_0x805a12[_0x54ca('0x3f')][_0x54ca('0x41')]?_0x805a12[_0x54ca('0x3f')]:_0xffd652['model'];if(_0x599661[_0x54ca('0x3e')][_0x54ca('0x4b')]){_0x805a12[_0x54ca('0x4c')]=[{'all':!![]}];}_0x805a12=_['merge']({},_0x805a12,_0x599661[_0x54ca('0x4a')]);return db[_0x54ca('0x51')][_0x54ca('0x53')](_0x805a12)[_0x54ca('0x1c')](handleEntityNotFound(_0x3182b8,null))[_0x54ca('0x1c')](respondWithResult(_0x3182b8,null))[_0x54ca('0x26')](handleError(_0x3182b8,null));};exports[_0x54ca('0x30')]=function(_0x3a4036,_0x113d1e){if(_0x3a4036[_0x54ca('0x54')]['id']){delete _0x3a4036['body']['id'];}return db[_0x54ca('0x51')][_0x54ca('0x53')]({'where':{'id':_0x3a4036['params']['id']}})[_0x54ca('0x1c')](handleEntityNotFound(_0x113d1e,null))[_0x54ca('0x1c')](saveUpdates(_0x3a4036['body'],null))[_0x54ca('0x1c')](respondWithResult(_0x113d1e,null))['catch'](handleError(_0x113d1e,null));};exports[_0x54ca('0x31')]=function(_0x17dde2,_0x5966d3){return db[_0x54ca('0x51')][_0x54ca('0x53')]({'where':{'id':_0x17dde2[_0x54ca('0x50')]['id']}})[_0x54ca('0x1c')](handleEntityNotFound(_0x5966d3,null))[_0x54ca('0x1c')](removeEntity(_0x5966d3,null))['catch'](handleError(_0x5966d3,null));};exports['describe']=function(_0x22faa8,_0x452553){return db['FaxMessage']['describe']()[_0x54ca('0x1c')](respondWithResult(_0x452553,null))[_0x54ca('0x26')](handleError(_0x452553,null));};var interaction_log=require(_0x54ca('0x55'))(_0x54ca('0x56'));exports[_0x54ca('0x57')]=function(_0x384e8a,_0x46680c,_0x192e44){var _0x29a67b={'agent':{},'channel':'fax'};if(_0x384e8a[_0x54ca('0x54')]['id']){delete _0x384e8a[_0x54ca('0x54')]['id'];}_0x384e8a[_0x54ca('0x54')][_0x54ca('0x58')]=!![];_0x384e8a['body'][_0x54ca('0x59')]=moment()[_0x54ca('0x5a')](_0x54ca('0x5b'));_0x384e8a[_0x54ca('0x54')][_0x54ca('0x5c')]=_0x384e8a[_0x54ca('0x54')][_0x54ca('0x5c')]||_0x384e8a[_0x54ca('0x5d')]['id'];_0x29a67b[_0x54ca('0x5e')]['id']=_0x384e8a[_0x54ca('0x54')][_0x54ca('0x5c')];return db[_0x54ca('0x51')][_0x54ca('0x53')]({'where':{'id':_0x384e8a[_0x54ca('0x50')]['id'],'UserId':null}})[_0x54ca('0x1c')](handleEntityNotFound(_0x46680c,null))[_0x54ca('0x1c')](saveUpdates(_0x384e8a[_0x54ca('0x54')],null))[_0x54ca('0x1c')](function(_0x8b71a8){if(_0x8b71a8){_0x29a67b[_0x54ca('0x24')]=_0x8b71a8[_0x54ca('0x5f')]({'plain':!![]});return db[_0x54ca('0x60')][_0x54ca('0x53')]({'where':{'id':_0x8b71a8['FaxInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x46680c,null))[_0x54ca('0x1c')](function(_0x32db02){if(_0x32db02){return _0x32db02['update']({'UserId':_0x384e8a['body'][_0x54ca('0x5c')],'read1stAt':_[_0x54ca('0x61')](_0x32db02['read1stAt'])?moment()[_0x54ca('0x5a')](_0x54ca('0x5b')):undefined});}return null;})['then'](function(_0x2b6ddd){if(_0x2b6ddd){_0x29a67b[_0x54ca('0x62')]=_0x2b6ddd[_0x54ca('0x5f')]({'plain':!![]});interaction_log['info'](_0x54ca('0x63'),_0x384e8a['user']['id'],_0x384e8a[_0x54ca('0x5d')][_0x54ca('0x33')],_0x384e8a[_0x54ca('0x5d')][_0x54ca('0x64')],_0x29a67b[_0x54ca('0x62')]['id'],_0x384e8a[_0x54ca('0x54')]?JSON[_0x54ca('0x65')](_0x384e8a[_0x54ca('0x54')]):_0x54ca('0x66'));return respondWithRpcPromise('AcceptMessage',_0x54ca('0x67'),_0x29a67b);}return null;})['then'](function(_0x2d3520){var _0x5ede2e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2d3520[_0x54ca('0x24')]['ContactId'];return db[_0x54ca('0x68')][_0x54ca('0x3e')](_0x5ede2e,{'type':db['Sequelize'][_0x54ca('0x69')]['SELECT'],'raw':!![]})[_0x54ca('0x1c')](function(_0x1e99d6){return _0x1e99d6;});})[_0x54ca('0x1c')](function(_0x436616){if(_0x436616){_0x29a67b[_0x54ca('0x24')]['contact']=_0x436616[0x0];if(!_0x384e8a[_0x54ca('0x54')]['UserId'])return;return db[_0x54ca('0x6a')][_0x54ca('0x53')]({'where':{'id':_0x384e8a[_0x54ca('0x54')][_0x54ca('0x5c')],'role':'agent'},'attributes':['id',_0x54ca('0x33'),_0x54ca('0x6b'),_0x54ca('0x6c'),_0x54ca('0x6d')],'raw':!![]});}return null;})[_0x54ca('0x1c')](function(_0x34e3da){if(!_0x34e3da)return null;_0x29a67b[_0x54ca('0x24')][_0x54ca('0x5e')]=_0x34e3da;return _0x29a67b;})[_0x54ca('0x1c')](function(_0x45d78c){if(_0x45d78c){if(_0x384e8a['body']['manual']){_0x29a67b[_0x54ca('0x24')][_0x54ca('0x6e')]=util['format'](_0x54ca('0x6f'),_0x384e8a[_0x54ca('0x5d')][_0x54ca('0x33')]);_0x29a67b[_0x54ca('0x24')][_0x54ca('0x70')]=_0x29a67b[_0x54ca('0x70')];_0x29a67b[_0x54ca('0x24')][_0x54ca('0x71')]=_0x29a67b[_0x54ca('0x70')];_0x29a67b[_0x54ca('0x24')][_0x54ca('0x72')]=_0x54ca('0x57');return respondWithRpcPromise(_0x54ca('0x73'),_0x54ca('0x73'),{'event':'acceptmessage','message':_0x29a67b[_0x54ca('0x24')]},client9002)['then'](function(){return _0x29a67b;});}return _0x29a67b;}return null;})[_0x54ca('0x1c')](respondWithResult(_0x46680c,null))['catch'](handleError(_0x46680c,null));};var interaction_log=require(_0x54ca('0x55'))('fax-interactions');exports['reject']=function(_0x3155b5,_0x525256,_0x372496){var _0xadab38={'agent':{},'channel':_0x54ca('0x74')};if(_0x3155b5['body']['id']){delete _0x3155b5[_0x54ca('0x54')]['id'];}_0x3155b5[_0x54ca('0x54')][_0x54ca('0x5c')]=_0x3155b5[_0x54ca('0x54')][_0x54ca('0x5c')]||_0x3155b5[_0x54ca('0x5d')]['id'];_0xadab38[_0x54ca('0x5e')]['id']=_0x3155b5[_0x54ca('0x54')][_0x54ca('0x5c')];return db[_0x54ca('0x51')][_0x54ca('0x53')]({'where':{'id':_0x3155b5[_0x54ca('0x50')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x525256,null))['then'](function(_0x29069b){if(_0x29069b){_0xadab38[_0x54ca('0x24')]=_0x29069b['get']({'plain':!![]});return db[_0x54ca('0x60')]['find']({'where':{'id':_0x29069b['FaxInteractionId']}});}return null;})[_0x54ca('0x1c')](handleEntityNotFound(_0x525256,null))[_0x54ca('0x1c')](function(_0x3e39ec){if(_0x3e39ec){_0xadab38[_0x54ca('0x62')]=_0x3e39ec[_0x54ca('0x5f')]({'plain':!![]});interaction_log[_0x54ca('0x1d')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3155b5['user']['id'],_0x3155b5['user'][_0x54ca('0x33')],_0x3155b5[_0x54ca('0x5d')]['role'],_0xadab38['interaction']['id'],_0x3155b5[_0x54ca('0x54')]?JSON['stringify'](_0x3155b5[_0x54ca('0x54')]):_0x54ca('0x66'));return respondWithRpcPromise(_0x54ca('0x75'),_0x54ca('0x76'),_0xadab38);}return null;})[_0x54ca('0x1c')](function(_0xc14e81){var _0x40803f=_0x54ca('0x77')+_0xc14e81['message'][_0x54ca('0x78')];return db[_0x54ca('0x68')][_0x54ca('0x3e')](_0x40803f,{'type':db['Sequelize']['QueryTypes'][_0x54ca('0x79')],'raw':!![]})[_0x54ca('0x1c')](function(_0x445211){return _0x445211;});})[_0x54ca('0x1c')](function(_0x3430bd){if(_0x3430bd){_0xadab38[_0x54ca('0x24')]['contact']=_0x3430bd[0x0];if(!_0x3155b5[_0x54ca('0x54')]['UserId'])return;return db[_0x54ca('0x6a')][_0x54ca('0x53')]({'where':{'id':_0x3155b5[_0x54ca('0x54')][_0x54ca('0x5c')],'role':'agent'},'attributes':['id','name',_0x54ca('0x6b'),_0x54ca('0x6c'),_0x54ca('0x6d')],'raw':!![]});}return null;})[_0x54ca('0x1c')](function(_0x3a16f7){if(!_0x3a16f7)return null;_0xadab38[_0x54ca('0x24')][_0x54ca('0x5e')]=_0x3a16f7;return _0xadab38;})['then'](function(_0x4ed3dd){if(_0x4ed3dd){_0x4ed3dd[_0x54ca('0x24')][_0x54ca('0x6e')]=util[_0x54ca('0x5a')](_0x54ca('0x6f'),_0x3155b5[_0x54ca('0x5d')]['name']);_0x4ed3dd[_0x54ca('0x24')][_0x54ca('0x70')]=_0xadab38['channel'];_0x4ed3dd['message']['motionChannel']=_0xadab38['channel'];_0x4ed3dd[_0x54ca('0x24')][_0x54ca('0x72')]=_0x54ca('0x7a');respondWithRpcPromise(_0x54ca('0x73'),_0x54ca('0x73'),{'event':'rejectmessage','message':_0x4ed3dd[_0x54ca('0x24')]},client9002);return _0xadab38;}return null;})[_0x54ca('0x1c')](respondWithResult(_0x525256,null))[_0x54ca('0x26')](handleError(_0x525256,null));};exports[_0x54ca('0x7b')]=function(_0x1bb5c5,_0x915cc8){var _0x1b1000;return db[_0x54ca('0x51')]['create'](_0x1bb5c5[_0x54ca('0x54')],{})[_0x54ca('0x1c')](function(_0x365f53){_0x1b1000=_0x365f53;return db['CmContact']['findOne']({'where':{'id':_0x1b1000[_0x54ca('0x78')]}});})[_0x54ca('0x1c')](function(_0x5d3a0b){if(_[_0x54ca('0x61')](_0x5d3a0b)){return;}else{_0x1b1000[_0x54ca('0x74')]=_0x5d3a0b[_0x54ca('0x74')];return db[_0x54ca('0x7c')][_0x54ca('0x7d')]({'where':{'id':_0x1b1000[_0x54ca('0x7e')]}});}})[_0x54ca('0x1c')](function(_0x2f0548){return respondWithRpcPromise(_0x54ca('0x7f'),'SendFax',{'FaxAccountId':_[_0x54ca('0x61')](_0x1bb5c5[_0x54ca('0x54')])?undefined:_0x1bb5c5[_0x54ca('0x54')]['FaxAccountId'],'path':_['isNil'](_0x2f0548)?undefined:util[_0x54ca('0x5a')](_0x54ca('0x80'),_0x2f0548['basename']),'fax':_['isNil'](_0x1b1000[_0x54ca('0x74')])?undefined:_0x1b1000[_0x54ca('0x74')],'AttachmentId':_0x1b1000[_0x54ca('0x7e')]},client9002);})[_0x54ca('0x1c')](respondWithResult(_0x915cc8,0xc9))[_0x54ca('0x26')](handleError(_0x915cc8,null));};exports[_0x54ca('0x81')]=function(_0x1bab90,_0x588b40){var _0x1c6d43=path[_0x54ca('0x82')](config[_0x54ca('0x83')],_0x54ca('0x84'),_0x54ca('0x85'),_0x54ca('0x86'));return db[_0x54ca('0x51')][_0x54ca('0x53')]({'where':{'id':_0x1bab90[_0x54ca('0x50')]['id']},'include':[{'model':db['Attachment'],'as':'Attachment'}]})[_0x54ca('0x1c')](handleEntityNotFound(_0x588b40,null))[_0x54ca('0x1c')](function(_0x48413d){if(_0x48413d){return _0x588b40[_0x54ca('0x81')](path[_0x54ca('0x82')](_0x1c6d43,_0x48413d[_0x54ca('0x7c')][_0x54ca('0x87')]));}})[_0x54ca('0x26')](handleError(_0x588b40,null));}; \ No newline at end of file +var _0x6ba9=['download','join','root','server','Attachment','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxMessage.socket','jayson/promise','client','http','then','info','FaxMessage,\x20%s,\x20%s','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','reject','save','update','destroy','stack','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','name','options','FaxMessage','include','rows','show','params','length','includeAll','find','body','describe','../../config/logger','fax-interactions','accept','fax','read','readAt','format','UserId','user','FaxInteraction','FaxInteractionId','isNil','read1stAt','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','Sequelize','internal','rejectmessage','create','CmContact','findOne','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename'];(function(_0x4d084c,_0x49c4b7){var _0x27104a=function(_0x23ad3f){while(--_0x23ad3f){_0x4d084c['push'](_0x4d084c['shift']());}};_0x27104a(++_0x49c4b7);}(_0x6ba9,0x1af));var _0x96ba=function(_0x2a7913,_0x1b694e){_0x2a7913=_0x2a7913-0x0;var _0x2bd089=_0x6ba9[_0x2a7913];return _0x2bd089;};'use strict';var emlformat=require(_0x96ba('0x0'));var rimraf=require(_0x96ba('0x1'));var zipdir=require(_0x96ba('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x96ba('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x96ba('0x4'));var util=require(_0x96ba('0x5'));var path=require(_0x96ba('0x6'));var sox=require('sox');var csv=require(_0x96ba('0x7'));var ejs=require(_0x96ba('0x8'));var fs=require('fs');var fs_extra=require(_0x96ba('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x96ba('0xa'));var jsforce=require(_0x96ba('0xb'));var deskjs=require(_0x96ba('0xc'));var toCsv=require('to-csv');var querystring=require(_0x96ba('0xd'));var Papa=require(_0x96ba('0xe'));var Redis=require(_0x96ba('0xf'));var authService=require(_0x96ba('0x10'));var qs=require(_0x96ba('0x11'));var as=require(_0x96ba('0x12'));var hardwareService=require(_0x96ba('0x13'));var logger=require('../../config/logger')(_0x96ba('0x14'));var utils=require(_0x96ba('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x96ba('0x16'));var db=require(_0x96ba('0x17'))['db'];config[_0x96ba('0x18')]=_[_0x96ba('0x19')](config[_0x96ba('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x96ba('0x1a'))(new Redis(config[_0x96ba('0x18')]));require(_0x96ba('0x1b'))['register'](socket);var jayson=require(_0x96ba('0x1c'));var client=jayson[_0x96ba('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0x96ba('0x1d')][_0x96ba('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x4a2216,_0x357d3b,_0x2ce540,_0x7d299b){return new BPromise(function(_0x1ddaef,_0x255e19){var _0x25df75=_0x7d299b||client;return _0x25df75['request'](_0x4a2216,_0x2ce540)[_0x96ba('0x1f')](function(_0x1e43c2){logger[_0x96ba('0x20')](_0x96ba('0x21'),_0x357d3b,'request\x20sent');logger['debug'](_0x96ba('0x22'),_0x357d3b,_0x96ba('0x23'),JSON['stringify'](_0x1e43c2));if(_0x1e43c2['error']){if(_0x1e43c2[_0x96ba('0x24')][_0x96ba('0x25')]===0x1f4){logger['error'](_0x96ba('0x21'),_0x357d3b,_0x1e43c2[_0x96ba('0x24')]['message']);return _0x255e19(_0x1e43c2[_0x96ba('0x24')]['message']);}logger[_0x96ba('0x24')](_0x96ba('0x21'),_0x357d3b,_0x1e43c2[_0x96ba('0x24')][_0x96ba('0x26')]);return _0x1ddaef(_0x1e43c2[_0x96ba('0x24')][_0x96ba('0x26')]);}else{logger[_0x96ba('0x20')](_0x96ba('0x21'),_0x357d3b,_0x96ba('0x23'));_0x1ddaef(_0x1e43c2['result'][_0x96ba('0x26')]);}})[_0x96ba('0x27')](function(_0x1a4626){logger[_0x96ba('0x24')](_0x96ba('0x21'),_0x357d3b,_0x1a4626);_0x255e19(_0x1a4626);});});}function respondWithStatusCode(_0x40a78b,_0x29c64b){_0x29c64b=_0x29c64b||0xcc;return function(_0x47ad1b){if(_0x47ad1b){return _0x40a78b[_0x96ba('0x28')](_0x29c64b);}return _0x40a78b[_0x96ba('0x29')](_0x29c64b)[_0x96ba('0x2a')]();};}function respondWithResult(_0x3cd91f,_0x163d58){_0x163d58=_0x163d58||0xc8;return function(_0x81ab23){if(_0x81ab23){return _0x3cd91f[_0x96ba('0x29')](_0x163d58)[_0x96ba('0x2b')](_0x81ab23);}};}function respondWithFilteredResult(_0x49c050,_0x1cc86b){return function(_0x3884a1){if(_0x3884a1){var _0x26d54c=typeof _0x1cc86b[_0x96ba('0x2c')]==='undefined'&&typeof _0x1cc86b[_0x96ba('0x2d')]===_0x96ba('0x2e');var _0x3f588d=_0x3884a1[_0x96ba('0x2f')];var _0x3f3dda=_0x26d54c?0x0:_0x1cc86b['offset'];var _0x2243bf=_0x26d54c?_0x3884a1[_0x96ba('0x2f')]:_0x1cc86b[_0x96ba('0x2c')]+_0x1cc86b[_0x96ba('0x2d')];var _0x2c673b;if(_0x2243bf>=_0x3f588d){_0x2243bf=_0x3f588d;_0x2c673b=0xc8;}else{_0x2c673b=0xce;}_0x49c050[_0x96ba('0x29')](_0x2c673b);return _0x49c050['set'](_0x96ba('0x30'),_0x3f3dda+'-'+_0x2243bf+'/'+_0x3f588d)[_0x96ba('0x2b')](_0x3884a1);}return null;};}function patchUpdates(_0x500292){return function(_0xbaee63){try{jsonpatch['apply'](_0xbaee63,_0x500292,!![]);}catch(_0x11466e){return BPromise[_0x96ba('0x31')](_0x11466e);}return _0xbaee63[_0x96ba('0x32')]();};}function saveUpdates(_0x5a80e2,_0xc24576){return function(_0x392165){if(_0x392165){return _0x392165[_0x96ba('0x33')](_0x5a80e2)[_0x96ba('0x1f')](function(_0x5598f9){return _0x5598f9;});}return null;};}function removeEntity(_0x35518c,_0x5e205a){return function(_0x41113d){if(_0x41113d){return _0x41113d[_0x96ba('0x34')]()[_0x96ba('0x1f')](function(){_0x35518c[_0x96ba('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0xff796b,_0x4dc61f){return function(_0x33a0c9){if(!_0x33a0c9){_0xff796b['sendStatus'](0x194);}return _0x33a0c9;};}function handleError(_0x5978ef,_0x560eb7){_0x560eb7=_0x560eb7||0x1f4;return function(_0x46606e){logger['error'](_0x46606e[_0x96ba('0x35')]);if(_0x46606e['name']){delete _0x46606e['name'];}_0x5978ef[_0x96ba('0x29')](_0x560eb7)[_0x96ba('0x36')](_0x46606e);};}exports[_0x96ba('0x37')]=function(_0x55d276,_0x3572e9){var _0xa225a3={},_0x29ef3b={},_0x506bcc={'count':0x0,'rows':[]};var _0x46d5ce=_[_0x96ba('0x38')](db['FaxMessage'][_0x96ba('0x39')],function(_0x59b080){return{'name':_0x59b080[_0x96ba('0x3a')],'type':_0x59b080['type'][_0x96ba('0x3b')]};});_0x29ef3b[_0x96ba('0x3c')]=_[_0x96ba('0x38')](_0x46d5ce,'name');_0x29ef3b[_0x96ba('0x3d')]=_[_0x96ba('0x3e')](_0x55d276['query']);_0x29ef3b[_0x96ba('0x3f')]=_[_0x96ba('0x40')](_0x29ef3b[_0x96ba('0x3c')],_0x29ef3b['query']);_0xa225a3['attributes']=_[_0x96ba('0x40')](_0x29ef3b[_0x96ba('0x3c')],qs[_0x96ba('0x41')](_0x55d276[_0x96ba('0x3d')][_0x96ba('0x41')]));_0xa225a3[_0x96ba('0x42')]=_0xa225a3[_0x96ba('0x42')]['length']?_0xa225a3[_0x96ba('0x42')]:_0x29ef3b[_0x96ba('0x3c')];if(!_0x55d276[_0x96ba('0x3d')][_0x96ba('0x43')](_0x96ba('0x44'))){_0xa225a3[_0x96ba('0x2d')]=qs[_0x96ba('0x2d')](_0x55d276['query'][_0x96ba('0x2d')]);_0xa225a3['offset']=qs['offset'](_0x55d276[_0x96ba('0x3d')]['offset']);}_0xa225a3['order']=qs[_0x96ba('0x45')](_0x55d276[_0x96ba('0x3d')][_0x96ba('0x45')]);_0xa225a3[_0x96ba('0x46')]=qs[_0x96ba('0x3f')](_[_0x96ba('0x47')](_0x55d276[_0x96ba('0x3d')],_0x29ef3b['filters']),_0x46d5ce);if(_0x55d276[_0x96ba('0x3d')][_0x96ba('0x48')]){_0xa225a3['where']=_[_0x96ba('0x49')](_0xa225a3[_0x96ba('0x46')],{'$or':_[_0x96ba('0x38')](_0x46d5ce,function(_0x4e512b){if(_0x4e512b['type']!==_0x96ba('0x4a')){var _0x70abc7={};_0x70abc7[_0x4e512b[_0x96ba('0x4b')]]={'$like':'%'+_0x55d276[_0x96ba('0x3d')][_0x96ba('0x48')]+'%'};return _0x70abc7;}})});}_0xa225a3=_[_0x96ba('0x49')]({},_0xa225a3,_0x55d276[_0x96ba('0x4c')]);var _0x43b0ae={'where':_0xa225a3[_0x96ba('0x46')]};return db[_0x96ba('0x4d')][_0x96ba('0x2f')](_0x43b0ae)['then'](function(_0x51f276){_0x506bcc[_0x96ba('0x2f')]=_0x51f276;if(_0x55d276[_0x96ba('0x3d')]['includeAll']){_0xa225a3[_0x96ba('0x4e')]=[{'all':!![]}];}return db[_0x96ba('0x4d')]['findAll'](_0xa225a3);})[_0x96ba('0x1f')](function(_0x2c6344){_0x506bcc[_0x96ba('0x4f')]=_0x2c6344;return _0x506bcc;})[_0x96ba('0x1f')](respondWithFilteredResult(_0x3572e9,_0xa225a3))[_0x96ba('0x27')](handleError(_0x3572e9,null));};exports[_0x96ba('0x50')]=function(_0x2f723a,_0x2c09e5){var _0x2ef850={'raw':!![],'where':{'id':_0x2f723a[_0x96ba('0x51')]['id']}},_0x3aca79={};_0x3aca79['model']=_[_0x96ba('0x3e')](db[_0x96ba('0x4d')]['rawAttributes']);_0x3aca79[_0x96ba('0x3d')]=_['keys'](_0x2f723a['query']);_0x3aca79[_0x96ba('0x3f')]=_[_0x96ba('0x40')](_0x3aca79[_0x96ba('0x3c')],_0x3aca79[_0x96ba('0x3d')]);_0x2ef850[_0x96ba('0x42')]=_[_0x96ba('0x40')](_0x3aca79[_0x96ba('0x3c')],qs[_0x96ba('0x41')](_0x2f723a['query'][_0x96ba('0x41')]));_0x2ef850[_0x96ba('0x42')]=_0x2ef850['attributes'][_0x96ba('0x52')]?_0x2ef850[_0x96ba('0x42')]:_0x3aca79[_0x96ba('0x3c')];if(_0x2f723a[_0x96ba('0x3d')][_0x96ba('0x53')]){_0x2ef850['include']=[{'all':!![]}];}_0x2ef850=_['merge']({},_0x2ef850,_0x2f723a[_0x96ba('0x4c')]);return db['FaxMessage'][_0x96ba('0x54')](_0x2ef850)[_0x96ba('0x1f')](handleEntityNotFound(_0x2c09e5,null))[_0x96ba('0x1f')](respondWithResult(_0x2c09e5,null))[_0x96ba('0x27')](handleError(_0x2c09e5,null));};exports[_0x96ba('0x33')]=function(_0x1f359f,_0x2b7cc2){if(_0x1f359f[_0x96ba('0x55')]['id']){delete _0x1f359f[_0x96ba('0x55')]['id'];}return db[_0x96ba('0x4d')][_0x96ba('0x54')]({'where':{'id':_0x1f359f[_0x96ba('0x51')]['id']}})[_0x96ba('0x1f')](handleEntityNotFound(_0x2b7cc2,null))[_0x96ba('0x1f')](saveUpdates(_0x1f359f[_0x96ba('0x55')],null))[_0x96ba('0x1f')](respondWithResult(_0x2b7cc2,null))[_0x96ba('0x27')](handleError(_0x2b7cc2,null));};exports['destroy']=function(_0x5d2605,_0x237ca6){return db[_0x96ba('0x4d')]['find']({'where':{'id':_0x5d2605['params']['id']}})['then'](handleEntityNotFound(_0x237ca6,null))['then'](removeEntity(_0x237ca6,null))[_0x96ba('0x27')](handleError(_0x237ca6,null));};exports[_0x96ba('0x56')]=function(_0x3de38f,_0x39190f){return db[_0x96ba('0x4d')][_0x96ba('0x56')]()[_0x96ba('0x1f')](respondWithResult(_0x39190f,null))[_0x96ba('0x27')](handleError(_0x39190f,null));};var interaction_log=require(_0x96ba('0x57'))(_0x96ba('0x58'));exports[_0x96ba('0x59')]=function(_0x5eedab,_0x24110e,_0x367789){var _0x5bc0fe={'agent':{},'channel':_0x96ba('0x5a')};if(_0x5eedab[_0x96ba('0x55')]['id']){delete _0x5eedab['body']['id'];}_0x5eedab[_0x96ba('0x55')][_0x96ba('0x5b')]=!![];_0x5eedab[_0x96ba('0x55')][_0x96ba('0x5c')]=moment()[_0x96ba('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0x5eedab[_0x96ba('0x55')][_0x96ba('0x5e')]=_0x5eedab[_0x96ba('0x55')][_0x96ba('0x5e')]||_0x5eedab[_0x96ba('0x5f')]['id'];_0x5bc0fe['agent']['id']=_0x5eedab['body'][_0x96ba('0x5e')];return db[_0x96ba('0x4d')][_0x96ba('0x54')]({'where':{'id':_0x5eedab[_0x96ba('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x24110e,null))[_0x96ba('0x1f')](saveUpdates(_0x5eedab[_0x96ba('0x55')],null))['then'](function(_0x570086){if(_0x570086){_0x5bc0fe['message']=_0x570086['get']({'plain':!![]});return db[_0x96ba('0x60')]['find']({'where':{'id':_0x570086[_0x96ba('0x61')]}});}return null;})[_0x96ba('0x1f')](handleEntityNotFound(_0x24110e,null))[_0x96ba('0x1f')](function(_0x16eaca){if(_0x16eaca){return _0x16eaca[_0x96ba('0x33')]({'UserId':_0x5eedab[_0x96ba('0x55')][_0x96ba('0x5e')],'read1stAt':_[_0x96ba('0x62')](_0x16eaca[_0x96ba('0x63')])?moment()[_0x96ba('0x5d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x5419d4){if(_0x5419d4){_0x5bc0fe['interaction']=_0x5419d4[_0x96ba('0x64')]({'plain':!![]});interaction_log[_0x96ba('0x20')](_0x96ba('0x65'),_0x5eedab[_0x96ba('0x5f')]['id'],_0x5eedab[_0x96ba('0x5f')][_0x96ba('0x4b')],_0x5eedab[_0x96ba('0x5f')][_0x96ba('0x66')],_0x5bc0fe[_0x96ba('0x67')]['id'],_0x5eedab[_0x96ba('0x55')]?JSON[_0x96ba('0x68')](_0x5eedab['body']):_0x96ba('0x69'));return respondWithRpcPromise(_0x96ba('0x6a'),_0x96ba('0x6b'),_0x5bc0fe);}return null;})[_0x96ba('0x1f')](function(_0x3770de){var _0xeaa99a=_0x96ba('0x6c')+_0x3770de[_0x96ba('0x26')][_0x96ba('0x6d')];return db[_0x96ba('0x6e')][_0x96ba('0x3d')](_0xeaa99a,{'type':db['Sequelize'][_0x96ba('0x6f')][_0x96ba('0x70')],'raw':!![]})[_0x96ba('0x1f')](function(_0x49a654){return _0x49a654;});})['then'](function(_0x2e07df){if(_0x2e07df){_0x5bc0fe[_0x96ba('0x26')][_0x96ba('0x71')]=_0x2e07df[0x0];if(!_0x5eedab[_0x96ba('0x55')][_0x96ba('0x5e')])return;return db[_0x96ba('0x72')][_0x96ba('0x54')]({'where':{'id':_0x5eedab[_0x96ba('0x55')][_0x96ba('0x5e')],'role':_0x96ba('0x73')},'attributes':['id',_0x96ba('0x4b'),_0x96ba('0x74'),_0x96ba('0x75'),'internal'],'raw':!![]});}return null;})[_0x96ba('0x1f')](function(_0x2796db){if(!_0x2796db)return null;_0x5bc0fe[_0x96ba('0x26')][_0x96ba('0x73')]=_0x2796db;return _0x5bc0fe;})[_0x96ba('0x1f')](function(_0x11c028){if(_0x11c028){if(_0x5eedab[_0x96ba('0x55')][_0x96ba('0x76')]){_0x5bc0fe['message'][_0x96ba('0x77')]=util[_0x96ba('0x5d')](_0x96ba('0x78'),_0x5eedab[_0x96ba('0x5f')][_0x96ba('0x4b')]);_0x5bc0fe[_0x96ba('0x26')][_0x96ba('0x79')]=_0x5bc0fe[_0x96ba('0x79')];_0x5bc0fe['message'][_0x96ba('0x7a')]=_0x5bc0fe[_0x96ba('0x79')];_0x5bc0fe[_0x96ba('0x26')][_0x96ba('0x7b')]=_0x96ba('0x59');return respondWithRpcPromise(_0x96ba('0x7c'),_0x96ba('0x7c'),{'event':'acceptmessage','message':_0x5bc0fe[_0x96ba('0x26')]},client9002)[_0x96ba('0x1f')](function(){return _0x5bc0fe;});}return _0x5bc0fe;}return null;})[_0x96ba('0x1f')](respondWithResult(_0x24110e,null))[_0x96ba('0x27')](handleError(_0x24110e,null));};var interaction_log=require(_0x96ba('0x57'))(_0x96ba('0x58'));exports['reject']=function(_0x337df4,_0x37fd05,_0x424bc4){var _0x4f2b0d={'agent':{},'channel':_0x96ba('0x5a')};if(_0x337df4[_0x96ba('0x55')]['id']){delete _0x337df4[_0x96ba('0x55')]['id'];}_0x337df4[_0x96ba('0x55')][_0x96ba('0x5e')]=_0x337df4[_0x96ba('0x55')][_0x96ba('0x5e')]||_0x337df4[_0x96ba('0x5f')]['id'];_0x4f2b0d[_0x96ba('0x73')]['id']=_0x337df4[_0x96ba('0x55')]['UserId'];return db['FaxMessage'][_0x96ba('0x54')]({'where':{'id':_0x337df4[_0x96ba('0x51')]['id'],'UserId':null}})[_0x96ba('0x1f')](handleEntityNotFound(_0x37fd05,null))[_0x96ba('0x1f')](function(_0x875d4){if(_0x875d4){_0x4f2b0d[_0x96ba('0x26')]=_0x875d4[_0x96ba('0x64')]({'plain':!![]});return db[_0x96ba('0x60')][_0x96ba('0x54')]({'where':{'id':_0x875d4[_0x96ba('0x61')]}});}return null;})[_0x96ba('0x1f')](handleEntityNotFound(_0x37fd05,null))[_0x96ba('0x1f')](function(_0x1df7ed){if(_0x1df7ed){_0x4f2b0d[_0x96ba('0x67')]=_0x1df7ed[_0x96ba('0x64')]({'plain':!![]});interaction_log[_0x96ba('0x20')](_0x96ba('0x7d'),_0x337df4['user']['id'],_0x337df4[_0x96ba('0x5f')][_0x96ba('0x4b')],_0x337df4[_0x96ba('0x5f')][_0x96ba('0x66')],_0x4f2b0d[_0x96ba('0x67')]['id'],_0x337df4[_0x96ba('0x55')]?JSON[_0x96ba('0x68')](_0x337df4[_0x96ba('0x55')]):_0x96ba('0x69'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x4f2b0d);}return null;})[_0x96ba('0x1f')](function(_0x41f3c7){var _0xb04cf8=_0x96ba('0x6c')+_0x41f3c7['message'][_0x96ba('0x6d')];return db[_0x96ba('0x6e')]['query'](_0xb04cf8,{'type':db[_0x96ba('0x7e')][_0x96ba('0x6f')][_0x96ba('0x70')],'raw':!![]})[_0x96ba('0x1f')](function(_0x757e8b){return _0x757e8b;});})[_0x96ba('0x1f')](function(_0xb226a){if(_0xb226a){_0x4f2b0d[_0x96ba('0x26')][_0x96ba('0x71')]=_0xb226a[0x0];if(!_0x337df4[_0x96ba('0x55')][_0x96ba('0x5e')])return;return db[_0x96ba('0x72')][_0x96ba('0x54')]({'where':{'id':_0x337df4['body'][_0x96ba('0x5e')],'role':_0x96ba('0x73')},'attributes':['id',_0x96ba('0x4b'),_0x96ba('0x74'),'email',_0x96ba('0x7f')],'raw':!![]});}return null;})[_0x96ba('0x1f')](function(_0x51a1d7){if(!_0x51a1d7)return null;_0x4f2b0d['message'][_0x96ba('0x73')]=_0x51a1d7;return _0x4f2b0d;})[_0x96ba('0x1f')](function(_0xd89fda){if(_0xd89fda){_0xd89fda[_0x96ba('0x26')][_0x96ba('0x77')]=util[_0x96ba('0x5d')](_0x96ba('0x78'),_0x337df4[_0x96ba('0x5f')][_0x96ba('0x4b')]);_0xd89fda['message']['channel']=_0x4f2b0d['channel'];_0xd89fda['message'][_0x96ba('0x7a')]=_0x4f2b0d['channel'];_0xd89fda[_0x96ba('0x26')][_0x96ba('0x7b')]=_0x96ba('0x31');respondWithRpcPromise(_0x96ba('0x7c'),_0x96ba('0x7c'),{'event':_0x96ba('0x80'),'message':_0xd89fda[_0x96ba('0x26')]},client9002);return _0x4f2b0d;}return null;})[_0x96ba('0x1f')](respondWithResult(_0x37fd05,null))[_0x96ba('0x27')](handleError(_0x37fd05,null));};exports[_0x96ba('0x81')]=function(_0x4198cf,_0x42b603){var _0xd95ee8;return db[_0x96ba('0x4d')]['create'](_0x4198cf[_0x96ba('0x55')],{})[_0x96ba('0x1f')](function(_0x2d950b){_0xd95ee8=_0x2d950b;return db[_0x96ba('0x82')][_0x96ba('0x83')]({'where':{'id':_0xd95ee8['ContactId']}});})[_0x96ba('0x1f')](function(_0x49f767){if(_[_0x96ba('0x62')](_0x49f767)){return;}else{_0xd95ee8[_0x96ba('0x5a')]=_0x49f767[_0x96ba('0x5a')];return db['Attachment'][_0x96ba('0x83')]({'where':{'id':_0xd95ee8[_0x96ba('0x84')]}});}})['then'](function(_0x57c798){return respondWithRpcPromise(_0x96ba('0x85'),_0x96ba('0x85'),{'FaxAccountId':_['isNil'](_0x4198cf[_0x96ba('0x55')])?undefined:_0x4198cf[_0x96ba('0x55')][_0x96ba('0x86')],'path':_[_0x96ba('0x62')](_0x57c798)?undefined:util[_0x96ba('0x5d')](_0x96ba('0x87'),_0x57c798[_0x96ba('0x88')]),'fax':_['isNil'](_0xd95ee8['fax'])?undefined:_0xd95ee8['fax'],'AttachmentId':_0xd95ee8['AttachmentId']},client9002);})[_0x96ba('0x1f')](respondWithResult(_0x42b603,0xc9))[_0x96ba('0x27')](handleError(_0x42b603,null));};exports[_0x96ba('0x89')]=function(_0x14e0d0,_0x24c0e1){var _0x5e7093=path[_0x96ba('0x8a')](config[_0x96ba('0x8b')],_0x96ba('0x8c'),'files','attachments');return db[_0x96ba('0x4d')][_0x96ba('0x54')]({'where':{'id':_0x14e0d0[_0x96ba('0x51')]['id']},'include':[{'model':db['Attachment'],'as':_0x96ba('0x8d')}]})[_0x96ba('0x1f')](handleEntityNotFound(_0x24c0e1,null))['then'](function(_0x1a467a){if(_0x1a467a){return _0x24c0e1['download'](path[_0x96ba('0x8a')](_0x5e7093,_0x1a467a[_0x96ba('0x8d')][_0x96ba('0x88')]));}})[_0x96ba('0x27')](handleError(_0x24c0e1,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 7a7246c..d2a9f0a 100644 --- a/server/api/faxMessage/faxMessage.events.js +++ b/server/api/faxMessage/faxMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe056=['hook','exports','FaxMessage','setMaxListeners','save','remove','hasOwnProperty'];(function(_0x1f1bae,_0x5c0a31){var _0x19efaa=function(_0x588666){while(--_0x588666){_0x1f1bae['push'](_0x1f1bae['shift']());}};_0x19efaa(++_0x5c0a31);}(_0xe056,0xdb));var _0x6e05=function(_0x168127,_0x59cea1){_0x168127=_0x168127-0x0;var _0x4c99ad=_0xe056[_0x168127];return _0x4c99ad;};'use strict';var EventEmitter=require('events');var FaxMessage=require('../../mysqldb')['db'][_0x6e05('0x0')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x6e05('0x1')](0x0);var events={'afterCreate':_0x6e05('0x2'),'afterUpdate':'update','afterDestroy':_0x6e05('0x3')};function emitEvent(_0x518934){return function(_0x13ea30,_0x1bec29,_0x5205e6){FaxMessageEvents['emit'](_0x518934+':'+_0x13ea30['id'],_0x13ea30);FaxMessageEvents['emit'](_0x518934,_0x13ea30);_0x5205e6(null);};}for(var e in events){if(events[_0x6e05('0x4')](e)){var event=events[e];FaxMessage[_0x6e05('0x5')](e,emitEvent(event));}}module[_0x6e05('0x6')]=FaxMessageEvents; \ No newline at end of file +var _0x22da=['hasOwnProperty','exports','FaxMessage','setMaxListeners','save','update','emit'];(function(_0x22d0ae,_0x53e1e8){var _0x296a7c=function(_0x1f05ab){while(--_0x1f05ab){_0x22d0ae['push'](_0x22d0ae['shift']());}};_0x296a7c(++_0x53e1e8);}(_0x22da,0x80));var _0xa22d=function(_0x2733f0,_0x17fb5f){_0x2733f0=_0x2733f0-0x0;var _0xba74b=_0x22da[_0x2733f0];return _0xba74b;};'use strict';var EventEmitter=require('events');var FaxMessage=require('../../mysqldb')['db'][_0xa22d('0x0')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xa22d('0x1')](0x0);var events={'afterCreate':_0xa22d('0x2'),'afterUpdate':_0xa22d('0x3'),'afterDestroy':'remove'};function emitEvent(_0x178cc8){return function(_0x34da8c,_0x3e2232,_0x32e8f1){FaxMessageEvents['emit'](_0x178cc8+':'+_0x34da8c['id'],_0x34da8c);FaxMessageEvents[_0xa22d('0x4')](_0x178cc8,_0x34da8c);_0x32e8f1(null);};}for(var e in events){if(events[_0xa22d('0x5')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0xa22d('0x6')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 8538e25..aa5f92f 100644 --- a/server/api/faxMessage/faxMessage.model.js +++ b/server/api/faxMessage/faxMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1d60=['models','get','direction','toLowerCase','out','UserId','FaxInteraction','findOne','FaxInteractionId','then','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./faxMessage.attributes','exports','fax_messages','fti_fax_messages','body','FULLTEXT'];(function(_0x182870,_0x5b19bd){var _0x5d6517=function(_0x4edd9e){while(--_0x4edd9e){_0x182870['push'](_0x182870['shift']());}};_0x5d6517(++_0x5b19bd);}(_0x1d60,0x101));var _0x01d6=function(_0x3dcc29,_0x59d913){_0x3dcc29=_0x3dcc29-0x0;var _0x47a63f=_0x1d60[_0x3dcc29];return _0x47a63f;};'use strict';var _=require(_0x01d6('0x0'));var util=require(_0x01d6('0x1'));var logger=require(_0x01d6('0x2'))(_0x01d6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x01d6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x01d6('0x5'));var config=require(_0x01d6('0x6'));var attributes=require(_0x01d6('0x7'));module[_0x01d6('0x8')]=function(_0x15e7df,_0x3c9c09){return _0x15e7df['define']('FaxMessage',attributes,{'tableName':_0x01d6('0x9'),'paranoid':![],'indexes':[{'name':_0x01d6('0xa'),'fields':[_0x01d6('0xb')],'type':_0x01d6('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x31bd2c,_0x9dd7a9,_0x57798a){var _0x3c7de6=_0x15e7df[_0x01d6('0xd')];var _0x1275c4=_0x31bd2c[_0x01d6('0xe')]({'plain':!![]});if(_0x1275c4[_0x01d6('0xf')][_0x01d6('0x10')]()==='in'||_0x1275c4['direction']['toLowerCase']()===_0x01d6('0x11')&&!_0x1275c4['secret']&&!_['isNil'](_0x1275c4[_0x01d6('0x12')])){_0x3c7de6[_0x01d6('0x13')][_0x01d6('0x14')]({'where':{'id':_0x1275c4[_0x01d6('0x15')]}})[_0x01d6('0x16')](function(_0x3d1581){if(_0x3d1581){_0x3d1581['update']({'lastMsgAt':_0x1275c4[_0x01d6('0x17')],'lastMsgDirection':_0x1275c4[_0x01d6('0xf')]['toLowerCase']()});}})[_0x01d6('0x18')](function(_0x2e211b){console[_0x01d6('0x19')](_0x2e211b);});}_0x57798a();}},'charset':'utf8mb4','collate':_0x01d6('0x1a')});}; \ No newline at end of file +var _0x9099=['toLowerCase','direction','out','secret','UserId','FaxInteraction','findOne','then','update','createdAt','catch','utf8mb4_unicode_ci','util','api','moment','request-promise','path','./faxMessage.attributes','exports','define','fax_messages','fti_fax_messages','FULLTEXT','models','get'];(function(_0x1cab9a,_0x48a8c7){var _0x2398a9=function(_0x207ba6){while(--_0x207ba6){_0x1cab9a['push'](_0x1cab9a['shift']());}};_0x2398a9(++_0x48a8c7);}(_0x9099,0xbb));var _0x9909=function(_0x61b3ab,_0x1fc298){_0x61b3ab=_0x61b3ab-0x0;var _0x57097f=_0x9099[_0x61b3ab];return _0x57097f;};'use strict';var _=require('lodash');var util=require(_0x9909('0x0'));var logger=require('../../config/logger')(_0x9909('0x1'));var moment=require(_0x9909('0x2'));var BPromise=require('bluebird');var rp=require(_0x9909('0x3'));var fs=require('fs');var path=require(_0x9909('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9909('0x5'));module[_0x9909('0x6')]=function(_0x582e92,_0x16b712){return _0x582e92[_0x9909('0x7')]('FaxMessage',attributes,{'tableName':_0x9909('0x8'),'paranoid':![],'indexes':[{'name':_0x9909('0x9'),'fields':['body'],'type':_0x9909('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xa85f7,_0x11a4e8,_0x5cd869){var _0x204ab5=_0x582e92[_0x9909('0xb')];var _0x31ad3b=_0xa85f7[_0x9909('0xc')]({'plain':!![]});if(_0x31ad3b['direction'][_0x9909('0xd')]()==='in'||_0x31ad3b[_0x9909('0xe')][_0x9909('0xd')]()===_0x9909('0xf')&&!_0x31ad3b[_0x9909('0x10')]&&!_['isNil'](_0x31ad3b[_0x9909('0x11')])){_0x204ab5[_0x9909('0x12')][_0x9909('0x13')]({'where':{'id':_0x31ad3b['FaxInteractionId']}})[_0x9909('0x14')](function(_0x178ec9){if(_0x178ec9){_0x178ec9[_0x9909('0x15')]({'lastMsgAt':_0x31ad3b[_0x9909('0x16')],'lastMsgDirection':_0x31ad3b[_0x9909('0xe')]['toLowerCase']()});}})[_0x9909('0x17')](function(_0x5d7c23){console['error'](_0x5d7c23);});}_0x5cd869();}},'charset':'utf8mb4','collate':_0x9909('0x18')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 077b63e..e714363 100644 --- a/server/api/faxMessage/faxMessage.rpc.js +++ b/server/api/faxMessage/faxMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x17ba=['CreateFaxMessage','FaxMessage','create','options','raw','info','UpdateFaxMessage','update','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch'];(function(_0x1ce9b3,_0x5a00b4){var _0x3af89d=function(_0x1767c2){while(--_0x1767c2){_0x1ce9b3['push'](_0x1ce9b3['shift']());}};_0x3af89d(++_0x5a00b4);}(_0x17ba,0xab));var _0xa17b=function(_0x25f0cf,_0x2a77e2){_0x25f0cf=_0x25f0cf-0x0;var _0x43f3ab=_0x17ba[_0x25f0cf];return _0x43f3ab;};'use strict';var _=require(_0xa17b('0x0'));var util=require(_0xa17b('0x1'));var moment=require('moment');var BPromise=require(_0xa17b('0x2'));var rs=require(_0xa17b('0x3'));var fs=require('fs');var Redis=require(_0xa17b('0x4'));var db=require(_0xa17b('0x5'))['db'];var utils=require(_0xa17b('0x6'));var logger=require(_0xa17b('0x7'))(_0xa17b('0x8'));var config=require(_0xa17b('0x9'));var jayson=require(_0xa17b('0xa'));var client=jayson[_0xa17b('0xb')][_0xa17b('0xc')]({'port':0x232a});config[_0xa17b('0xd')]=_[_0xa17b('0xe')](config[_0xa17b('0xd')],{'host':_0xa17b('0xf'),'port':0x18eb});var socket=require(_0xa17b('0x10'))(new Redis(config[_0xa17b('0xd')]));require(_0xa17b('0x11'))[_0xa17b('0x12')](socket);function respondWithRpcPromise(_0x578799,_0x2556c4,_0x38b8f1){return new BPromise(function(_0x322dc0,_0x1e799a){return client[_0xa17b('0x13')](_0x578799,_0x38b8f1)[_0xa17b('0x14')](function(_0xc5ef2e){logger['info'](_0xa17b('0x15'),_0x2556c4,_0xa17b('0x16'));logger[_0xa17b('0x17')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x2556c4,_0xa17b('0x16'),JSON[_0xa17b('0x18')](_0xc5ef2e));if(_0xc5ef2e[_0xa17b('0x19')]){if(_0xc5ef2e[_0xa17b('0x19')]['code']===0x1f4){logger[_0xa17b('0x19')]('FaxMessage,\x20%s,\x20%s',_0x2556c4,_0xc5ef2e[_0xa17b('0x19')][_0xa17b('0x1a')]);return _0x1e799a(_0xc5ef2e['error'][_0xa17b('0x1a')]);}logger[_0xa17b('0x19')](_0xa17b('0x15'),_0x2556c4,_0xc5ef2e[_0xa17b('0x19')]['message']);return _0x322dc0(_0xc5ef2e[_0xa17b('0x19')]['message']);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x2556c4,_0xa17b('0x16'));_0x322dc0(_0xc5ef2e[_0xa17b('0x1b')]['message']);}})[_0xa17b('0x1c')](function(_0x166d44){logger[_0xa17b('0x19')](_0xa17b('0x15'),_0x2556c4,_0x166d44);_0x1e799a(_0x166d44);});});}exports[_0xa17b('0x1d')]=function(_0x1ecaa2){var _0x24afc2=this;return new Promise(function(_0x584a0a,_0x610c2b){return db[_0xa17b('0x1e')][_0xa17b('0x1f')](_0x1ecaa2['body'],{'raw':_0x1ecaa2[_0xa17b('0x20')]?_0x1ecaa2[_0xa17b('0x20')][_0xa17b('0x21')]===undefined?!![]:![]:!![]})[_0xa17b('0x14')](function(_0x3c7ec2){logger[_0xa17b('0x22')]('CreateFaxMessage',_0x1ecaa2);logger[_0xa17b('0x17')]('CreateFaxMessage',_0x1ecaa2,JSON[_0xa17b('0x18')](_0x3c7ec2));_0x584a0a(_0x3c7ec2);})[_0xa17b('0x1c')](function(_0x4ba608){logger['error'](_0xa17b('0x1d'),_0x4ba608[_0xa17b('0x1a')],_0x1ecaa2);_0x610c2b(_0x24afc2[_0xa17b('0x19')](0x1f4,_0x4ba608[_0xa17b('0x1a')]));});});};exports[_0xa17b('0x23')]=function(_0x3a64f5){var _0x4cd38e=this;return new Promise(function(_0x47aff8,_0x5c98fe){return db['FaxMessage'][_0xa17b('0x24')](_0x3a64f5['body'],{'raw':_0x3a64f5[_0xa17b('0x20')]?_0x3a64f5['options'][_0xa17b('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a64f5[_0xa17b('0x20')]?_0x3a64f5[_0xa17b('0x20')][_0xa17b('0x25')]||null:null,'attributes':_0x3a64f5[_0xa17b('0x20')]?_0x3a64f5[_0xa17b('0x20')][_0xa17b('0x26')]||null:null,'limit':_0x3a64f5[_0xa17b('0x20')]?_0x3a64f5[_0xa17b('0x20')][_0xa17b('0x27')]||null:null})[_0xa17b('0x14')](function(_0x573585){logger['info']('UpdateFaxMessage',_0x3a64f5);logger[_0xa17b('0x17')](_0xa17b('0x23'),_0x3a64f5,JSON[_0xa17b('0x18')](_0x573585));_0x47aff8(_0x573585);})[_0xa17b('0x1c')](function(_0x16dd1f){logger[_0xa17b('0x19')](_0xa17b('0x23'),_0x16dd1f[_0xa17b('0x1a')],_0x3a64f5);_0x5c98fe(_0x4cd38e['error'](0x1f4,_0x16dd1f[_0xa17b('0x1a')]));});});}; \ No newline at end of file +var _0x032e=['FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','UpdateFaxMessage','where','attributes','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info'];(function(_0x304fc6,_0xadb19c){var _0x44bea8=function(_0xa78a11){while(--_0xa78a11){_0x304fc6['push'](_0x304fc6['shift']());}};_0x44bea8(++_0xadb19c);}(_0x032e,0x124));var _0xe032=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x032e[_0x134c2e];return _0x2825db;};'use strict';var _=require(_0xe032('0x0'));var util=require('util');var moment=require(_0xe032('0x1'));var BPromise=require(_0xe032('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe032('0x3'))['db'];var utils=require(_0xe032('0x4'));var logger=require(_0xe032('0x5'))(_0xe032('0x6'));var config=require(_0xe032('0x7'));var jayson=require(_0xe032('0x8'));var client=jayson[_0xe032('0x9')][_0xe032('0xa')]({'port':0x232a});config[_0xe032('0xb')]=_[_0xe032('0xc')](config[_0xe032('0xb')],{'host':_0xe032('0xd'),'port':0x18eb});var socket=require(_0xe032('0xe'))(new Redis(config[_0xe032('0xb')]));require(_0xe032('0xf'))[_0xe032('0x10')](socket);function respondWithRpcPromise(_0x2dc9e5,_0x167bd9,_0x4aec53){return new BPromise(function(_0x1382e1,_0x1ce2ae){return client[_0xe032('0x11')](_0x2dc9e5,_0x4aec53)[_0xe032('0x12')](function(_0x244f93){logger[_0xe032('0x13')](_0xe032('0x14'),_0x167bd9,'request\x20sent');logger[_0xe032('0x15')](_0xe032('0x16'),_0x167bd9,_0xe032('0x17'),JSON[_0xe032('0x18')](_0x244f93));if(_0x244f93['error']){if(_0x244f93[_0xe032('0x19')][_0xe032('0x1a')]===0x1f4){logger[_0xe032('0x19')](_0xe032('0x14'),_0x167bd9,_0x244f93[_0xe032('0x19')][_0xe032('0x1b')]);return _0x1ce2ae(_0x244f93[_0xe032('0x19')]['message']);}logger[_0xe032('0x19')](_0xe032('0x14'),_0x167bd9,_0x244f93[_0xe032('0x19')][_0xe032('0x1b')]);return _0x1382e1(_0x244f93[_0xe032('0x19')][_0xe032('0x1b')]);}else{logger['info'](_0xe032('0x14'),_0x167bd9,_0xe032('0x17'));_0x1382e1(_0x244f93[_0xe032('0x1c')][_0xe032('0x1b')]);}})[_0xe032('0x1d')](function(_0x5721ce){logger['error']('FaxMessage,\x20%s,\x20%s',_0x167bd9,_0x5721ce);_0x1ce2ae(_0x5721ce);});});}exports[_0xe032('0x1e')]=function(_0x505d8c){var _0x46dc27=this;return new Promise(function(_0x4608e4,_0x3f0257){return db[_0xe032('0x1f')][_0xe032('0x20')](_0x505d8c[_0xe032('0x21')],{'raw':_0x505d8c[_0xe032('0x22')]?_0x505d8c['options'][_0xe032('0x23')]===undefined?!![]:![]:!![]})[_0xe032('0x12')](function(_0x232e8f){logger[_0xe032('0x13')](_0xe032('0x1e'),_0x505d8c);logger[_0xe032('0x15')](_0xe032('0x1e'),_0x505d8c,JSON[_0xe032('0x18')](_0x232e8f));_0x4608e4(_0x232e8f);})['catch'](function(_0x4f1aa3){logger['error'](_0xe032('0x1e'),_0x4f1aa3[_0xe032('0x1b')],_0x505d8c);_0x3f0257(_0x46dc27[_0xe032('0x19')](0x1f4,_0x4f1aa3[_0xe032('0x1b')]));});});};exports[_0xe032('0x24')]=function(_0x200671){var _0x36ece7=this;return new Promise(function(_0x2b6ffa,_0x4dcbf1){return db[_0xe032('0x1f')]['update'](_0x200671[_0xe032('0x21')],{'raw':_0x200671[_0xe032('0x22')]?_0x200671[_0xe032('0x22')][_0xe032('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x200671['options']?_0x200671['options'][_0xe032('0x25')]||null:null,'attributes':_0x200671[_0xe032('0x22')]?_0x200671[_0xe032('0x22')][_0xe032('0x26')]||null:null,'limit':_0x200671['options']?_0x200671['options']['limit']||null:null})[_0xe032('0x12')](function(_0x1dd34f){logger[_0xe032('0x13')](_0xe032('0x24'),_0x200671);logger['debug'](_0xe032('0x24'),_0x200671,JSON[_0xe032('0x18')](_0x1dd34f));_0x2b6ffa(_0x1dd34f);})[_0xe032('0x1d')](function(_0x4348f8){logger[_0xe032('0x19')]('UpdateFaxMessage',_0x4348f8[_0xe032('0x1b')],_0x200671);_0x4dcbf1(_0x36ece7[_0xe032('0x19')](0x1f4,_0x4348f8[_0xe032('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 9bdfb34..2e7a14d 100644 --- a/server/api/faxMessage/faxMessage.socket.js +++ b/server/api/faxMessage/faxMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb6bf=['emit','register','length','faxMessage:','./faxMessage.events','save','remove'];(function(_0x3b8a24,_0x54b12f){var _0x2bbac1=function(_0x5f0714){while(--_0x5f0714){_0x3b8a24['push'](_0x3b8a24['shift']());}};_0x2bbac1(++_0x54b12f);}(_0xb6bf,0xf9));var _0xfb6b=function(_0x4b6ece,_0x3234be){_0x4b6ece=_0x4b6ece-0x0;var _0x55c744=_0xb6bf[_0x4b6ece];return _0x55c744;};'use strict';var FaxMessageEvents=require(_0xfb6b('0x0'));var events=[_0xfb6b('0x1'),_0xfb6b('0x2'),'update'];function createListener(_0x527b20,_0x33e6bb){return function(_0x5e427e){_0x33e6bb[_0xfb6b('0x3')](_0x527b20,_0x5e427e);};}function removeListener(_0x1f1feb,_0x2db5cc){return function(){FaxMessageEvents['removeListener'](_0x1f1feb,_0x2db5cc);};}exports[_0xfb6b('0x4')]=function(_0x1d290d){for(var _0x533b1d=0x0,_0x4445fe=events[_0xfb6b('0x5')];_0x533b1d<_0x4445fe;_0x533b1d++){var _0x5be385=events[_0x533b1d];var _0x2cd0fe=createListener(_0xfb6b('0x6')+_0x5be385,_0x1d290d);FaxMessageEvents['on'](_0x5be385,_0x2cd0fe);}}; \ No newline at end of file +var _0x042d=['update','removeListener','faxMessage:','save'];(function(_0x3b7970,_0x8ecf3d){var _0x194318=function(_0x3ce94a){while(--_0x3ce94a){_0x3b7970['push'](_0x3b7970['shift']());}};_0x194318(++_0x8ecf3d);}(_0x042d,0x153));var _0xd042=function(_0x31991b,_0xaf75d2){_0x31991b=_0x31991b-0x0;var _0x307304=_0x042d[_0x31991b];return _0x307304;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0xd042('0x0'),'remove',_0xd042('0x1')];function createListener(_0x5f4744,_0x5d4374){return function(_0x51baf5){_0x5d4374['emit'](_0x5f4744,_0x51baf5);};}function removeListener(_0x273b1b,_0x52944a){return function(){FaxMessageEvents[_0xd042('0x2')](_0x273b1b,_0x52944a);};}exports['register']=function(_0x58441c){for(var _0x89f99b=0x0,_0x502ae6=events['length'];_0x89f99b<_0x502ae6;_0x89f99b++){var _0x56c01e=events[_0x89f99b];var _0x3a7037=createListener(_0xd042('0x3')+_0x56c01e,_0x58441c);FaxMessageEvents['on'](_0x56c01e,_0x3a7037);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index ab0ab38..1fd7836 100644 --- a/server/api/faxMessage/index.js +++ b/server/api/faxMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7af2=['/:id/reject','reject','delete','/:id','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','describe','show','faxmessage:create','put','update','/:id/accept','accept'];(function(_0x3d7419,_0x4d8c11){var _0x5e25cb=function(_0x30b59e){while(--_0x30b59e){_0x3d7419['push'](_0x3d7419['shift']());}};_0x5e25cb(++_0x4d8c11);}(_0x7af2,0x119));var _0x27af=function(_0x33fcc2,_0xd83799){_0x33fcc2=_0x33fcc2-0x0;var _0x56a707=_0x7af2[_0x33fcc2];return _0x56a707;};'use strict';var multer=require('multer');var util=require(_0x27af('0x0'));var path=require(_0x27af('0x1'));var timeout=require(_0x27af('0x2'));var express=require(_0x27af('0x3'));var router=express['Router']();var fs_extra=require(_0x27af('0x4'));var auth=require(_0x27af('0x5'));var interaction=require(_0x27af('0x6'));var config=require(_0x27af('0x7'));var controller=require(_0x27af('0x8'));router[_0x27af('0x9')]('/',auth[_0x27af('0xa')](),controller[_0x27af('0xb')]);router[_0x27af('0x9')]('/describe',auth[_0x27af('0xa')](),controller[_0x27af('0xc')]);router[_0x27af('0x9')]('/:id',auth[_0x27af('0xa')](),controller[_0x27af('0xd')]);router[_0x27af('0x9')]('/:id/download',auth[_0x27af('0xa')](),controller['download']);router['post']('/',auth[_0x27af('0xa')](),interaction['tracked']('fax',_0x27af('0xe')),controller['create']);router[_0x27af('0xf')]('/:id',auth[_0x27af('0xa')](),controller[_0x27af('0x10')]);router[_0x27af('0xf')](_0x27af('0x11'),auth[_0x27af('0xa')](),controller[_0x27af('0x12')]);router[_0x27af('0xf')](_0x27af('0x13'),auth[_0x27af('0xa')](),controller[_0x27af('0x14')]);router[_0x27af('0x15')](_0x27af('0x16'),auth[_0x27af('0xa')](),controller[_0x27af('0x17')]);module[_0x27af('0x18')]=router; \ No newline at end of file +var _0x5b02=['put','/:id','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','/describe','describe','show','download','post','tracked','fax','faxmessage:create','create'];(function(_0x5ebede,_0x28a295){var _0x154a72=function(_0x1947ef){while(--_0x1947ef){_0x5ebede['push'](_0x5ebede['shift']());}};_0x154a72(++_0x28a295);}(_0x5b02,0xe9));var _0x25b0=function(_0x4706ba,_0x5eac38){_0x4706ba=_0x4706ba-0x0;var _0x25235d=_0x5b02[_0x4706ba];return _0x25235d;};'use strict';var multer=require(_0x25b0('0x0'));var util=require(_0x25b0('0x1'));var path=require(_0x25b0('0x2'));var timeout=require(_0x25b0('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x25b0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x25b0('0x5'));var config=require(_0x25b0('0x6'));var controller=require(_0x25b0('0x7'));router[_0x25b0('0x8')]('/',auth[_0x25b0('0x9')](),controller['index']);router[_0x25b0('0x8')](_0x25b0('0xa'),auth['isAuthenticated'](),controller[_0x25b0('0xb')]);router['get']('/:id',auth[_0x25b0('0x9')](),controller[_0x25b0('0xc')]);router[_0x25b0('0x8')]('/:id/download',auth[_0x25b0('0x9')](),controller[_0x25b0('0xd')]);router[_0x25b0('0xe')]('/',auth[_0x25b0('0x9')](),interaction[_0x25b0('0xf')](_0x25b0('0x10'),_0x25b0('0x11')),controller[_0x25b0('0x12')]);router[_0x25b0('0x13')](_0x25b0('0x14'),auth[_0x25b0('0x9')](),controller[_0x25b0('0x15')]);router[_0x25b0('0x13')](_0x25b0('0x16'),auth[_0x25b0('0x9')](),controller[_0x25b0('0x17')]);router[_0x25b0('0x13')](_0x25b0('0x18'),auth[_0x25b0('0x9')](),controller[_0x25b0('0x19')]);router[_0x25b0('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0x25b0('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index c71f787..ac2dfa6 100644 --- a/server/api/faxQueue/faxQueue.attributes.js +++ b/server/api/faxQueue/faxQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5e6e=['INTEGER','ENUM','rrmemory','roundrobin','sequelize','exports','STRING','name'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5e6e,0x74));var _0xe5e6=function(_0x226dae,_0x35dccf){_0x226dae=_0x226dae-0x0;var _0x57db37=_0x5e6e[_0x226dae];return _0x57db37;};'use strict';var Sequelize=require(_0xe5e6('0x0'));module[_0xe5e6('0x1')]={'name':{'type':Sequelize[_0xe5e6('0x2')],'unique':_0xe5e6('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe5e6('0x2')]},'timeout':{'type':Sequelize[_0xe5e6('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe5e6('0x5')](_0xe5e6('0x6'),'beepall',_0xe5e6('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xe5e6('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2133=['beepall','roundrobin','INTEGER','exports','STRING','name','rrmemory'];(function(_0x4c39eb,_0x106c8f){var _0xcc5e41=function(_0x173304){while(--_0x173304){_0x4c39eb['push'](_0x4c39eb['shift']());}};_0xcc5e41(++_0x106c8f);}(_0x2133,0x1d1));var _0x3213=function(_0x3fedc3,_0x4fc8){_0x3fedc3=_0x3fedc3-0x0;var _0x52a75c=_0x2133[_0x3fedc3];return _0x52a75c;};'use strict';var Sequelize=require('sequelize');module[_0x3213('0x0')]={'name':{'type':Sequelize[_0x3213('0x1')],'unique':_0x3213('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3213('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x3213('0x3'),_0x3213('0x4'),_0x3213('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x3213('0x6')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index d8d61b8..0c49b86 100644 --- a/server/api/faxQueue/faxQueue.controller.js +++ b/server/api/faxQueue/faxQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0a1c=['stack','name','send','index','map','FaxQueue','fieldName','type','getOptions','where','include','query','findAll','catch','show','model','keys','filters','attributes','intersection','fields','length','merge','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','describe','findOne','UserFaxQueue','hasOwnProperty','order','sort','pick','FaxQueueId','filter','User','findAndCountAll','UserId','agent','updatedAt','format','%s/%s','createdAt','getTeams','Team','rawAttributes','nolimit','addTeams','ids','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','emit','userFaxQueue:save','removeTeams','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','Agents','toString','SELECT','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','forEach','addAgents','spread','isArray','userFaxQueue:remove','getAgents','lodash','squel','ioredis','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','update','then','destroy','get','FaxQueues','UserProfileResource','error'];(function(_0x545913,_0x353f9b){var _0x13d315=function(_0x375de5){while(--_0x375de5){_0x545913['push'](_0x545913['shift']());}};_0x13d315(++_0x353f9b);}(_0x0a1c,0xd2));var _0xc0a1=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x0a1c[_0x4baae2];return _0x1a2285;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0xc0a1('0x0'));var squel=require(_0xc0a1('0x1'));var Redis=require(_0xc0a1('0x2'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xc0a1('0x3'));var config=require(_0xc0a1('0x4'));var db=require(_0xc0a1('0x5'))['db'];config[_0xc0a1('0x6')]=_[_0xc0a1('0x7')](config[_0xc0a1('0x6')],{'host':_0xc0a1('0x8'),'port':0x18eb});var socket=require(_0xc0a1('0x9'))(new Redis(config[_0xc0a1('0x6')]));require(_0xc0a1('0xa'))[_0xc0a1('0xb')](socket);function respondWithStatusCode(_0x42c215,_0x14e116){_0x14e116=_0x14e116||0xcc;return function(_0x2cfd8a){if(_0x2cfd8a){return _0x42c215[_0xc0a1('0xc')](_0x14e116);}return _0x42c215[_0xc0a1('0xd')](_0x14e116)[_0xc0a1('0xe')]();};}function respondWithResult(_0x4a1238,_0x9457ef){_0x9457ef=_0x9457ef||0xc8;return function(_0x234f42){if(_0x234f42){return _0x4a1238[_0xc0a1('0xd')](_0x9457ef)['json'](_0x234f42);}};}function respondWithFilteredResult(_0x360dc4,_0x4683ab){return function(_0xd25ae5){if(_0xd25ae5){var _0x4d9b49=typeof _0x4683ab[_0xc0a1('0xf')]===_0xc0a1('0x10')&&typeof _0x4683ab['limit']===_0xc0a1('0x10');var _0x47887=_0xd25ae5[_0xc0a1('0x11')];var _0x395ade=_0x4d9b49?0x0:_0x4683ab[_0xc0a1('0xf')];var _0x517689=_0x4d9b49?_0xd25ae5['count']:_0x4683ab[_0xc0a1('0xf')]+_0x4683ab[_0xc0a1('0x12')];var _0x49a97c;if(_0x517689>=_0x47887){_0x517689=_0x47887;_0x49a97c=0xc8;}else{_0x49a97c=0xce;}_0x360dc4['status'](_0x49a97c);return _0x360dc4[_0xc0a1('0x13')](_0xc0a1('0x14'),_0x395ade+'-'+_0x517689+'/'+_0x47887)['json'](_0xd25ae5);}return null;};}function saveUpdates(_0x334cc4){return function(_0xcec062){if(_0xcec062){return _0xcec062[_0xc0a1('0x15')](_0x334cc4)[_0xc0a1('0x16')](function(_0x234067){return _0x234067;});}return null;};}function removeEntity(_0x124d0f){return function(_0x36620e){if(_0x36620e){return _0x36620e[_0xc0a1('0x17')]()[_0xc0a1('0x16')](function(){var _0x36acc2=_0x36620e[_0xc0a1('0x18')]({'plain':!![]});var _0x26ca3c=_0xc0a1('0x19');return db[_0xc0a1('0x1a')][_0xc0a1('0x17')]({'where':{'type':_0x26ca3c,'resourceId':_0x36acc2['id']}})[_0xc0a1('0x16')](function(){return _0x36620e;});})['then'](function(){_0x124d0f[_0xc0a1('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0x340d03){return function(_0xc9d7b0){if(!_0xc9d7b0){_0x340d03[_0xc0a1('0xc')](0x194);}return _0xc9d7b0;};}function handleError(_0x316f1a,_0x40eaa4){_0x40eaa4=_0x40eaa4||0x1f4;return function(_0x53b9ca){logger[_0xc0a1('0x1b')](_0x53b9ca[_0xc0a1('0x1c')]);if(_0x53b9ca[_0xc0a1('0x1d')]){delete _0x53b9ca[_0xc0a1('0x1d')];}_0x316f1a[_0xc0a1('0xd')](_0x40eaa4)[_0xc0a1('0x1e')](_0x53b9ca);};}exports[_0xc0a1('0x1f')]=function(_0x6b1ca5,_0x3e1a93){var _0x161bff={};var _0x5d9925={'count':0x0,'rows':[]};var _0x569816=_[_0xc0a1('0x20')](db[_0xc0a1('0x21')]['rawAttributes'],function(_0x52ba51){return{'name':_0x52ba51[_0xc0a1('0x22')],'type':_0x52ba51[_0xc0a1('0x23')]['key']};});_0x161bff=qs[_0xc0a1('0x24')](_0x569816,_0x6b1ca5);var _0x95b026={'where':_0x161bff[_0xc0a1('0x25')]};return db[_0xc0a1('0x21')][_0xc0a1('0x11')](_0x95b026)[_0xc0a1('0x16')](function(_0x114f76){_0x5d9925[_0xc0a1('0x11')]=_0x114f76;_0x161bff['include']=qs[_0xc0a1('0x26')](_0x6b1ca5[_0xc0a1('0x27')]);return db[_0xc0a1('0x21')][_0xc0a1('0x28')](_0x161bff);})[_0xc0a1('0x16')](function(_0x38750d){_0x5d9925['rows']=_0x38750d;return _0x5d9925;})['then'](respondWithFilteredResult(_0x3e1a93,_0x161bff))[_0xc0a1('0x29')](handleError(_0x3e1a93,null));};exports[_0xc0a1('0x2a')]=function(_0x5b7d77,_0xa341c0){var _0x4f1a93={'raw':!![],'where':{'id':_0x5b7d77['params']['id']}},_0x1e7317={};_0x1e7317[_0xc0a1('0x2b')]=_[_0xc0a1('0x2c')](db[_0xc0a1('0x21')]['rawAttributes']);_0x1e7317[_0xc0a1('0x27')]=_['keys'](_0x5b7d77[_0xc0a1('0x27')]);_0x1e7317[_0xc0a1('0x2d')]=_['intersection'](_0x1e7317[_0xc0a1('0x2b')],_0x1e7317[_0xc0a1('0x27')]);_0x4f1a93[_0xc0a1('0x2e')]=_[_0xc0a1('0x2f')](_0x1e7317[_0xc0a1('0x2b')],qs[_0xc0a1('0x30')](_0x5b7d77['query'][_0xc0a1('0x30')]));_0x4f1a93[_0xc0a1('0x2e')]=_0x4f1a93[_0xc0a1('0x2e')][_0xc0a1('0x31')]?_0x4f1a93[_0xc0a1('0x2e')]:_0x1e7317[_0xc0a1('0x2b')];if(_0x5b7d77['query']['includeAll']){_0x4f1a93[_0xc0a1('0x26')]=[{'all':!![]}];}_0x4f1a93=_[_0xc0a1('0x32')]({},_0x4f1a93,_0x5b7d77[_0xc0a1('0x33')]);return db['FaxQueue']['find'](_0x4f1a93)[_0xc0a1('0x16')](handleEntityNotFound(_0xa341c0,null))[_0xc0a1('0x16')](respondWithResult(_0xa341c0,null))[_0xc0a1('0x29')](handleError(_0xa341c0,null));};exports['create']=function(_0xc80b,_0x423da0){return db['FaxQueue'][_0xc0a1('0x34')](_0xc80b[_0xc0a1('0x35')],{})['then'](function(_0x3fa7cd){var _0x32f40b=_0xc80b[_0xc0a1('0x36')][_0xc0a1('0x18')]({'plain':!![]});if(!_0x32f40b)throw new Error(_0xc0a1('0x37'));if(_0x32f40b[_0xc0a1('0x38')]===_0xc0a1('0x36')){var _0x42309c=_0x3fa7cd['get']({'plain':!![]});var _0x498bf2=_0xc0a1('0x19');return db[_0xc0a1('0x39')]['find']({'where':{'name':_0x498bf2,'userProfileId':_0x32f40b[_0xc0a1('0x3a')]},'raw':!![]})[_0xc0a1('0x16')](function(_0x273b64){if(_0x273b64&&_0x273b64[_0xc0a1('0x3b')]===0x0){return db[_0xc0a1('0x1a')][_0xc0a1('0x34')]({'name':_0x42309c['name'],'resourceId':_0x42309c['id'],'type':_0x273b64[_0xc0a1('0x1d')],'sectionId':_0x273b64['id']},{})[_0xc0a1('0x16')](function(){return _0x3fa7cd;});}else{return _0x3fa7cd;}})['catch'](function(_0x289501){logger[_0xc0a1('0x1b')](_0xc0a1('0x3c'),_0x289501);throw _0x289501;});}return _0x3fa7cd;})[_0xc0a1('0x16')](respondWithResult(_0x423da0,0xc9))[_0xc0a1('0x29')](handleError(_0x423da0,null));};exports[_0xc0a1('0x15')]=function(_0x41d73d,_0x4d9b35){if(_0x41d73d['body']['id']){delete _0x41d73d[_0xc0a1('0x35')]['id'];}return db['FaxQueue'][_0xc0a1('0x3d')]({'where':{'id':_0x41d73d['params']['id']}})['then'](handleEntityNotFound(_0x4d9b35,null))[_0xc0a1('0x16')](saveUpdates(_0x41d73d[_0xc0a1('0x35')],null))[_0xc0a1('0x16')](respondWithResult(_0x4d9b35,null))[_0xc0a1('0x29')](handleError(_0x4d9b35,null));};exports[_0xc0a1('0x17')]=function(_0x23ae3a,_0x2b1730){return db[_0xc0a1('0x21')][_0xc0a1('0x3d')]({'where':{'id':_0x23ae3a[_0xc0a1('0x3e')]['id']}})[_0xc0a1('0x16')](handleEntityNotFound(_0x2b1730,null))[_0xc0a1('0x16')](removeEntity(_0x2b1730,null))[_0xc0a1('0x29')](handleError(_0x2b1730,null));};exports[_0xc0a1('0x3f')]=function(_0xdbf055,_0x2df4cf){return db['FaxQueue'][_0xc0a1('0x3f')]()[_0xc0a1('0x16')](respondWithResult(_0x2df4cf,null))['catch'](handleError(_0x2df4cf,null));};exports['getMembers']=function(_0x187e91,_0x581818){var _0xbac6ae={'raw':!![],'where':{}},_0x1bc504={},_0x796690;return db['FaxQueue'][_0xc0a1('0x40')]({'where':{'id':_0x187e91[_0xc0a1('0x3e')]['id']}})['then'](handleEntityNotFound(_0x581818,null))[_0xc0a1('0x16')](function(_0x45c24e){if(_0x45c24e){_0x796690=_0x45c24e['get']({'plain':!![]});_0x1bc504['model']=_[_0xc0a1('0x2c')](db[_0xc0a1('0x41')]['rawAttributes']);_0x1bc504[_0xc0a1('0x27')]=_[_0xc0a1('0x2c')](_0x187e91[_0xc0a1('0x27')]);_0x1bc504[_0xc0a1('0x2d')]=_['intersection'](_0x1bc504['model'],_0x1bc504[_0xc0a1('0x27')]);_0xbac6ae['attributes']=_[_0xc0a1('0x2f')](_0x1bc504['model'],qs[_0xc0a1('0x30')](_0x187e91['query'][_0xc0a1('0x30')]));_0xbac6ae[_0xc0a1('0x2e')]=_0xbac6ae['attributes'][_0xc0a1('0x31')]?_0xbac6ae[_0xc0a1('0x2e')]:_0x1bc504[_0xc0a1('0x2b')];if(!_0x187e91[_0xc0a1('0x27')][_0xc0a1('0x42')]('nolimit')){_0xbac6ae['limit']=qs[_0xc0a1('0x12')](_0x187e91['query'][_0xc0a1('0x12')]);_0xbac6ae['offset']=qs[_0xc0a1('0xf')](_0x187e91[_0xc0a1('0x27')][_0xc0a1('0xf')]);}_0xbac6ae[_0xc0a1('0x43')]=qs[_0xc0a1('0x44')](_0x187e91[_0xc0a1('0x27')][_0xc0a1('0x44')]);_0xbac6ae[_0xc0a1('0x25')]=qs[_0xc0a1('0x2d')](_[_0xc0a1('0x45')](_0x187e91[_0xc0a1('0x27')],_0x1bc504[_0xc0a1('0x2d')]));_0xbac6ae[_0xc0a1('0x25')][_0xc0a1('0x46')]=_0x45c24e['id'];if(_0x187e91[_0xc0a1('0x27')][_0xc0a1('0x47')]){_0xbac6ae[_0xc0a1('0x25')]=_['merge'](_0xbac6ae['where'],{'$or':_[_0xc0a1('0x20')](_0xbac6ae[_0xc0a1('0x2e')],function(_0x23b3e0){var _0x3d37d1={};_0x3d37d1[_0x23b3e0]={'$like':'%'+_0x187e91[_0xc0a1('0x27')][_0xc0a1('0x47')]+'%'};return _0x3d37d1;})});}_0xbac6ae=_[_0xc0a1('0x32')]({},_0xbac6ae,_0x187e91[_0xc0a1('0x33')]);return db[_0xc0a1('0x41')]['findAll'](_0xbac6ae);}})[_0xc0a1('0x16')](function(_0x2de5af){if(_0x2de5af){return db[_0xc0a1('0x48')][_0xc0a1('0x49')]({'where':{'id':_['map'](_0x2de5af,_0xc0a1('0x4a')),'role':_0xc0a1('0x4b')},'attributes':['id',_0xc0a1('0x1d'),'faxPause',_0xc0a1('0x4c'),'createdAt']});}})[_0xc0a1('0x16')](function(_0x57bcb){if(_0x57bcb){return{'count':_0x57bcb['count'],'rows':_[_0xc0a1('0x20')](_0x57bcb['rows'],function(_0x569079){return{'membername':_0x569079[_0xc0a1('0x1d')],'UserId':_0x569079['id'],'queue_name':_0x796690[_0xc0a1('0x1d')],'FaxQueueId':_0x796690['id'],'interface':util[_0xc0a1('0x4d')](_0xc0a1('0x4e'),'SIP',_0x569079['name']),'penalty':0x0,'paused':_0x569079['faxPause'],'createdAt':_0x569079[_0xc0a1('0x4f')],'updatedAt':_0x569079['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xc0a1('0x16')](respondWithFilteredResult(_0x581818,_0xbac6ae))[_0xc0a1('0x29')](handleError(_0x581818,null));};exports[_0xc0a1('0x50')]=function(_0x4ef311,_0x4188a7){var _0x246a05={};var _0x20d116={};var _0x11ff04;var _0x33a06b;return db['FaxQueue'][_0xc0a1('0x40')]({'where':{'id':_0x4ef311[_0xc0a1('0x3e')]['id']}})[_0xc0a1('0x16')](handleEntityNotFound(_0x4188a7,null))['then'](function(_0x4cb4b3){if(_0x4cb4b3){_0x11ff04=_0x4cb4b3;_0x20d116['model']=_[_0xc0a1('0x2c')](db[_0xc0a1('0x51')][_0xc0a1('0x52')]);_0x20d116[_0xc0a1('0x27')]=_[_0xc0a1('0x2c')](_0x4ef311[_0xc0a1('0x27')]);_0x20d116[_0xc0a1('0x2d')]=_[_0xc0a1('0x2f')](_0x20d116[_0xc0a1('0x2b')],_0x20d116[_0xc0a1('0x27')]);_0x246a05['attributes']=_[_0xc0a1('0x2f')](_0x20d116[_0xc0a1('0x2b')],qs[_0xc0a1('0x30')](_0x4ef311[_0xc0a1('0x27')][_0xc0a1('0x30')]));_0x246a05[_0xc0a1('0x2e')]=_0x246a05[_0xc0a1('0x2e')]['length']?_0x246a05[_0xc0a1('0x2e')]:_0x20d116[_0xc0a1('0x2b')];_0x246a05['order']=qs['sort'](_0x4ef311['query']['sort']);_0x246a05[_0xc0a1('0x25')]=qs[_0xc0a1('0x2d')](_[_0xc0a1('0x45')](_0x4ef311[_0xc0a1('0x27')],_0x20d116[_0xc0a1('0x2d')]));if(_0x4ef311[_0xc0a1('0x27')][_0xc0a1('0x47')]){_0x246a05[_0xc0a1('0x25')]=_[_0xc0a1('0x32')](_0x246a05[_0xc0a1('0x25')],{'$or':_[_0xc0a1('0x20')](_0x246a05['attributes'],function(_0x8dcadd){var _0x2b99e4={};_0x2b99e4[_0x8dcadd]={'$like':'%'+_0x4ef311[_0xc0a1('0x27')][_0xc0a1('0x47')]+'%'};return _0x2b99e4;})});}_0x246a05=_[_0xc0a1('0x32')]({},_0x246a05,_0x4ef311[_0xc0a1('0x33')]);return _0x11ff04[_0xc0a1('0x50')](_0x246a05);}})[_0xc0a1('0x16')](function(_0x1ec803){if(_0x1ec803){_0x33a06b=_0x1ec803[_0xc0a1('0x31')];if(!_0x4ef311[_0xc0a1('0x27')][_0xc0a1('0x42')](_0xc0a1('0x53'))){_0x246a05['limit']=qs[_0xc0a1('0x12')](_0x4ef311['query']['limit']);_0x246a05['offset']=qs[_0xc0a1('0xf')](_0x4ef311[_0xc0a1('0x27')]['offset']);}return _0x11ff04[_0xc0a1('0x50')](_0x246a05);}})[_0xc0a1('0x16')](function(_0x6ab7b3){if(_0x6ab7b3){return _0x6ab7b3?{'count':_0x33a06b,'rows':_0x6ab7b3}:null;}})[_0xc0a1('0x16')](respondWithResult(_0x4188a7,null))[_0xc0a1('0x29')](handleError(_0x4188a7,null));};exports[_0xc0a1('0x54')]=function(_0x5345df,_0x358504){var _0x37c6b0=_0x5345df[_0xc0a1('0x35')][_0xc0a1('0x55')];return db[_0xc0a1('0x51')][_0xc0a1('0x28')]({'where':{'id':_0x37c6b0},'attributes':['id'],'include':[{'model':db[_0xc0a1('0x48')],'as':'Agents','attributes':['id',_0xc0a1('0x1d'),'online',_0xc0a1('0x56'),_0xc0a1('0x57')],'raw':!![]}]})[_0xc0a1('0x16')](function(_0x3c4c59){if(_0x3c4c59){var _0x577e18=_[_0xc0a1('0x58')](_0x3c4c59,function(_0x5813c7){var _0x3ec7f5=_0x5813c7[_0xc0a1('0x18')]({'plain':!![]});return _0x3ec7f5['Agents'];});return db[_0xc0a1('0x21')]['find']({'where':{'id':_0x5345df[_0xc0a1('0x3e')]['id']}})[_0xc0a1('0x16')](function(_0x4423b4){return db[_0xc0a1('0x59')][_0xc0a1('0x5a')](function(_0xfd51eb){return _0x4423b4['addTeams'](_0x37c6b0,{'transaction':_0xfd51eb})[_0xc0a1('0x16')](function(){return BPromise['each'](_0x577e18,function(_0x33aa9f){return db[_0xc0a1('0x41')][_0xc0a1('0x5b')]({'where':{'UserId':_0x33aa9f['id'],'FaxQueueId':_0x5345df[_0xc0a1('0x3e')]['id']},'transaction':_0xfd51eb});});})[_0xc0a1('0x16')](function(){_0x577e18['forEach'](function(_0x300e5e){socket[_0xc0a1('0x5c')](_0xc0a1('0x5d'),{'UserId':_0x300e5e['id'],'FaxQueueId':_0x4423b4['id']});});});});});}})['then'](respondWithStatusCode(_0x358504,null))[_0xc0a1('0x29')](handleError(_0x358504,null));};exports[_0xc0a1('0x5e')]=function(_0xae97f2,_0x4c7f17){return db['Team'][_0xc0a1('0x28')]({'where':{'id':_0xae97f2[_0xc0a1('0x27')][_0xc0a1('0x55')]},'attributes':['id'],'include':[{'model':db[_0xc0a1('0x48')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xc0a1('0x16')](handleEntityNotFound(_0x4c7f17,null))['then'](function(_0x3f54dd){var _0x9f9a7d=_[_0xc0a1('0x20')](_0x3f54dd,'id');var _0x63a2d=[];var _0x56950e=[];var _0x168756=squel['select']();_0x168756[_0xc0a1('0x5f')](_0xc0a1('0x60'))[_0xc0a1('0x61')]('team_has_fax_queues','tq')[_0xc0a1('0x62')](_0xc0a1('0x63'),'ut',_0xc0a1('0x64'))['where'](_0xc0a1('0x65'),_0xae97f2[_0xc0a1('0x3e')]['id']);for(var _0x411756=0x0;_0x411756<_0x3f54dd['length'];_0x411756+=0x1){let _0x26044a=_0x3f54dd[_0x411756];for(var _0x787e18=0x0;_0x787e18<_0x26044a[_0xc0a1('0x66')][_0xc0a1('0x31')];_0x787e18+=0x1){let _0x471996=_0x26044a['Agents'][_0x787e18];var _0x4a0e7f=_0x168756['clone']();_0x4a0e7f[_0xc0a1('0x25')]('ut.UserId\x20=\x20?',_0x471996['id']);_0x56950e['push'](db[_0xc0a1('0x59')][_0xc0a1('0x27')](_0x4a0e7f[_0xc0a1('0x67')](),{'type':db[_0xc0a1('0x59')]['QueryTypes'][_0xc0a1('0x68')]})[_0xc0a1('0x16')](function(_0xa8f906){if(_0xa8f906[_0xc0a1('0x31')]===0x1){return _0x471996['id'];}else{var _0x2b6f0e=_[_0xc0a1('0x69')](_[_0xc0a1('0x20')](_0xa8f906,_0xc0a1('0x6a')),function(_0x10b786){return _[_0xc0a1('0x6b')](_0x9f9a7d,_0x10b786);});if(_0x2b6f0e){return _0x471996['id'];}}}));}}return BPromise[_0xc0a1('0x6c')](_0x56950e)[_0xc0a1('0x16')](function(_0x3c232f){_0x63a2d=_(_0x63a2d)['union'](_0x3c232f)[_0xc0a1('0x6d')]()[_0xc0a1('0x6e')]();return db[_0xc0a1('0x21')][_0xc0a1('0x3d')]({'where':{'id':_0xae97f2['params']['id']}})[_0xc0a1('0x16')](function(_0x214639){return db['sequelize'][_0xc0a1('0x5a')](function(_0x2469d4){return _0x214639[_0xc0a1('0x5e')](_0xae97f2[_0xc0a1('0x27')][_0xc0a1('0x55')],{'transaction':_0x2469d4})[_0xc0a1('0x16')](function(){if(!_[_0xc0a1('0x6f')](_0x63a2d)){return _0x214639[_0xc0a1('0x70')](_0x63a2d,{'transaction':_0x2469d4});}})[_0xc0a1('0x16')](function(){_0x63a2d[_0xc0a1('0x71')](function(_0x58a2d1){socket[_0xc0a1('0x5c')]('userFaxQueue:remove',{'UserId':_0x58a2d1,'FaxQueueId':_0x214639['id']});});});});});});})['then'](respondWithStatusCode(_0x4c7f17,null))[_0xc0a1('0x29')](handleError(_0x4c7f17,null));};exports[_0xc0a1('0x72')]=function(_0x410527,_0xbccb){return db[_0xc0a1('0x21')]['find']({'where':{'id':_0x410527['params']['id']}})[_0xc0a1('0x16')](handleEntityNotFound(_0xbccb,null))[_0xc0a1('0x16')](function(_0x36803f){if(_0x36803f){return _0x36803f[_0xc0a1('0x72')](_0x410527[_0xc0a1('0x35')]['ids'],_['omit'](_0x410527[_0xc0a1('0x35')],[_0xc0a1('0x55'),'id'])||{})[_0xc0a1('0x73')](function(_0xc0d95){for(var _0x4798b7=0x0;_0x4798b7<_0x410527[_0xc0a1('0x35')]['ids'][_0xc0a1('0x31')];_0x4798b7+=0x1){socket[_0xc0a1('0x5c')](_0xc0a1('0x5d'),{'UserId':Number(_0x410527[_0xc0a1('0x35')][_0xc0a1('0x55')][_0x4798b7]),'FaxQueueId':Number(_0x410527[_0xc0a1('0x3e')]['id'])});}return _0xc0d95;});}})['then'](respondWithResult(_0xbccb,null))[_0xc0a1('0x29')](handleError(_0xbccb,null));};exports[_0xc0a1('0x70')]=function(_0x404733,_0x145a32){return db[_0xc0a1('0x21')][_0xc0a1('0x3d')]({'where':{'id':_0x404733['params']['id']}})[_0xc0a1('0x16')](handleEntityNotFound(_0x145a32,null))[_0xc0a1('0x16')](function(_0x2c909e){if(_0x2c909e){return _0x2c909e[_0xc0a1('0x70')](_0x404733['query'][_0xc0a1('0x55')])['then'](function(){if(_[_0xc0a1('0x74')](_0x404733[_0xc0a1('0x27')][_0xc0a1('0x55')])){for(var _0x3b6092=0x0;_0x3b6092<_0x404733[_0xc0a1('0x27')]['ids'][_0xc0a1('0x31')];_0x3b6092+=0x1){socket[_0xc0a1('0x5c')]('userFaxQueue:remove',{'UserId':Number(_0x404733[_0xc0a1('0x27')][_0xc0a1('0x55')][_0x3b6092]),'FaxQueueId':Number(_0x404733[_0xc0a1('0x3e')]['id'])});}}else{socket[_0xc0a1('0x5c')](_0xc0a1('0x75'),{'UserId':Number(_0x404733[_0xc0a1('0x27')][_0xc0a1('0x55')]),'FaxQueueId':Number(_0x404733[_0xc0a1('0x3e')]['id'])});}});}})['then'](respondWithStatusCode(_0x145a32,null))['catch'](handleError(_0x145a32,null));};exports[_0xc0a1('0x76')]=function(_0x3ce709,_0x3d288d){var _0x48ba0d={};var _0x17efde={};var _0x3d67c7;var _0x2a6ee7;return db[_0xc0a1('0x21')][_0xc0a1('0x40')]({'where':{'id':_0x3ce709[_0xc0a1('0x3e')]['id']}})[_0xc0a1('0x16')](handleEntityNotFound(_0x3d288d,null))['then'](function(_0x11d0fc){if(_0x11d0fc){_0x3d67c7=_0x11d0fc;_0x17efde[_0xc0a1('0x2b')]=_[_0xc0a1('0x2c')](db['User'][_0xc0a1('0x52')]);_0x17efde[_0xc0a1('0x27')]=_['keys'](_0x3ce709[_0xc0a1('0x27')]);_0x17efde[_0xc0a1('0x2d')]=_[_0xc0a1('0x2f')](_0x17efde[_0xc0a1('0x2b')],_0x17efde[_0xc0a1('0x27')]);_0x48ba0d[_0xc0a1('0x2e')]=_[_0xc0a1('0x2f')](_0x17efde[_0xc0a1('0x2b')],qs['fields'](_0x3ce709[_0xc0a1('0x27')][_0xc0a1('0x30')]));_0x48ba0d['attributes']=_0x48ba0d[_0xc0a1('0x2e')][_0xc0a1('0x31')]?_0x48ba0d[_0xc0a1('0x2e')]:_0x17efde[_0xc0a1('0x2b')];_0x48ba0d[_0xc0a1('0x43')]=qs[_0xc0a1('0x44')](_0x3ce709[_0xc0a1('0x27')][_0xc0a1('0x44')]);_0x48ba0d[_0xc0a1('0x25')]=qs[_0xc0a1('0x2d')](_[_0xc0a1('0x45')](_0x3ce709['query'],_0x17efde['filters']));if(_0x3ce709[_0xc0a1('0x27')]['filter']){_0x48ba0d['where']=_['merge'](_0x48ba0d[_0xc0a1('0x25')],{'$or':_[_0xc0a1('0x20')](_0x48ba0d['attributes'],function(_0x3af85a){var _0x50520c={};_0x50520c[_0x3af85a]={'$like':'%'+_0x3ce709[_0xc0a1('0x27')][_0xc0a1('0x47')]+'%'};return _0x50520c;})});}_0x48ba0d=_[_0xc0a1('0x32')]({},_0x48ba0d,_0x3ce709['options']);return _0x3d67c7['getAgents'](_0x48ba0d);}})[_0xc0a1('0x16')](function(_0x59b6fb){if(_0x59b6fb){_0x2a6ee7=_0x59b6fb[_0xc0a1('0x31')];if(!_0x3ce709[_0xc0a1('0x27')][_0xc0a1('0x42')]('nolimit')){_0x48ba0d[_0xc0a1('0x12')]=qs[_0xc0a1('0x12')](_0x3ce709['query'][_0xc0a1('0x12')]);_0x48ba0d[_0xc0a1('0xf')]=qs['offset'](_0x3ce709[_0xc0a1('0x27')][_0xc0a1('0xf')]);}return _0x3d67c7[_0xc0a1('0x76')](_0x48ba0d);}})[_0xc0a1('0x16')](function(_0x3f3236){if(_0x3f3236){return _0x3f3236?{'count':_0x2a6ee7,'rows':_0x3f3236}:null;}})[_0xc0a1('0x16')](respondWithResult(_0x3d288d,null))[_0xc0a1('0x29')](handleError(_0x3d288d,null));}; \ No newline at end of file +var _0x9f7a=['util','lodash','squel','../../components/parsers/qs','../../mysqldb','redis','localhost','register','sendStatus','end','status','json','undefined','count','limit','Content-Range','update','then','destroy','get','FaxQueues','UserProfileResource','name','index','map','rawAttributes','fieldName','key','getOptions','where','include','query','FaxQueue','rows','show','model','keys','filters','intersection','fields','attributes','length','includeAll','merge','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','UserFaxQueue','hasOwnProperty','nolimit','offset','order','sort','filter','options','User','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','%s/%s','getTeams','findOne','pick','addTeams','Team','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','emit','userFaxQueue:save','removeTeams','findAll','ids','select','field','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','push','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','forEach','addAgents','omit','spread','isArray','userFaxQueue:remove','getAgents','bluebird'];(function(_0x2a4095,_0x13f4f0){var _0x52eeab=function(_0x3950dd){while(--_0x3950dd){_0x2a4095['push'](_0x2a4095['shift']());}};_0x52eeab(++_0x13f4f0);}(_0x9f7a,0xf1));var _0xa9f7=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x9f7a[_0x40220a];return _0x3903cc;};'use strict';var BPromise=require(_0xa9f7('0x0'));var util=require(_0xa9f7('0x1'));var _=require(_0xa9f7('0x2'));var squel=require(_0xa9f7('0x3'));var Redis=require('ioredis');var qs=require(_0xa9f7('0x4'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require(_0xa9f7('0x5'))['db'];config[_0xa9f7('0x6')]=_['defaults'](config['redis'],{'host':_0xa9f7('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxQueue.socket')[_0xa9f7('0x8')](socket);function respondWithStatusCode(_0x58a3f3,_0x433d03){_0x433d03=_0x433d03||0xcc;return function(_0x1f2f1d){if(_0x1f2f1d){return _0x58a3f3[_0xa9f7('0x9')](_0x433d03);}return _0x58a3f3['status'](_0x433d03)[_0xa9f7('0xa')]();};}function respondWithResult(_0xdda0e0,_0x4d9b2a){_0x4d9b2a=_0x4d9b2a||0xc8;return function(_0x33d505){if(_0x33d505){return _0xdda0e0[_0xa9f7('0xb')](_0x4d9b2a)[_0xa9f7('0xc')](_0x33d505);}};}function respondWithFilteredResult(_0x174511,_0x118c7a){return function(_0x41b1d2){if(_0x41b1d2){var _0x169a85=typeof _0x118c7a['offset']===_0xa9f7('0xd')&&typeof _0x118c7a['limit']===_0xa9f7('0xd');var _0x437a83=_0x41b1d2[_0xa9f7('0xe')];var _0x4fb93c=_0x169a85?0x0:_0x118c7a['offset'];var _0xe56a20=_0x169a85?_0x41b1d2['count']:_0x118c7a['offset']+_0x118c7a[_0xa9f7('0xf')];var _0x3987a5;if(_0xe56a20>=_0x437a83){_0xe56a20=_0x437a83;_0x3987a5=0xc8;}else{_0x3987a5=0xce;}_0x174511[_0xa9f7('0xb')](_0x3987a5);return _0x174511['set'](_0xa9f7('0x10'),_0x4fb93c+'-'+_0xe56a20+'/'+_0x437a83)[_0xa9f7('0xc')](_0x41b1d2);}return null;};}function saveUpdates(_0x2aeadd){return function(_0x48315a){if(_0x48315a){return _0x48315a[_0xa9f7('0x11')](_0x2aeadd)[_0xa9f7('0x12')](function(_0x230904){return _0x230904;});}return null;};}function removeEntity(_0x11652b){return function(_0x8da225){if(_0x8da225){return _0x8da225[_0xa9f7('0x13')]()[_0xa9f7('0x12')](function(){var _0x1c0496=_0x8da225[_0xa9f7('0x14')]({'plain':!![]});var _0x4c235e=_0xa9f7('0x15');return db[_0xa9f7('0x16')][_0xa9f7('0x13')]({'where':{'type':_0x4c235e,'resourceId':_0x1c0496['id']}})[_0xa9f7('0x12')](function(){return _0x8da225;});})[_0xa9f7('0x12')](function(){_0x11652b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ccc53){return function(_0x50b73c){if(!_0x50b73c){_0x5ccc53['sendStatus'](0x194);}return _0x50b73c;};}function handleError(_0x4b7202,_0x5c9e4f){_0x5c9e4f=_0x5c9e4f||0x1f4;return function(_0x7a9eaa){logger['error'](_0x7a9eaa['stack']);if(_0x7a9eaa[_0xa9f7('0x17')]){delete _0x7a9eaa['name'];}_0x4b7202['status'](_0x5c9e4f)['send'](_0x7a9eaa);};}exports[_0xa9f7('0x18')]=function(_0xe7ebd,_0x204cdb){var _0x537d55={};var _0x131872={'count':0x0,'rows':[]};var _0x112446=_[_0xa9f7('0x19')](db['FaxQueue'][_0xa9f7('0x1a')],function(_0x52bb0a){return{'name':_0x52bb0a[_0xa9f7('0x1b')],'type':_0x52bb0a['type'][_0xa9f7('0x1c')]};});_0x537d55=qs[_0xa9f7('0x1d')](_0x112446,_0xe7ebd);var _0x407120={'where':_0x537d55[_0xa9f7('0x1e')]};return db['FaxQueue'][_0xa9f7('0xe')](_0x407120)[_0xa9f7('0x12')](function(_0x16437e){_0x131872[_0xa9f7('0xe')]=_0x16437e;_0x537d55[_0xa9f7('0x1f')]=qs[_0xa9f7('0x1f')](_0xe7ebd[_0xa9f7('0x20')]);return db[_0xa9f7('0x21')]['findAll'](_0x537d55);})['then'](function(_0x519aea){_0x131872[_0xa9f7('0x22')]=_0x519aea;return _0x131872;})[_0xa9f7('0x12')](respondWithFilteredResult(_0x204cdb,_0x537d55))['catch'](handleError(_0x204cdb,null));};exports[_0xa9f7('0x23')]=function(_0x575163,_0x49805c){var _0x595e4b={'raw':!![],'where':{'id':_0x575163['params']['id']}},_0x21de65={};_0x21de65[_0xa9f7('0x24')]=_[_0xa9f7('0x25')](db[_0xa9f7('0x21')][_0xa9f7('0x1a')]);_0x21de65[_0xa9f7('0x20')]=_['keys'](_0x575163[_0xa9f7('0x20')]);_0x21de65[_0xa9f7('0x26')]=_['intersection'](_0x21de65[_0xa9f7('0x24')],_0x21de65[_0xa9f7('0x20')]);_0x595e4b['attributes']=_[_0xa9f7('0x27')](_0x21de65[_0xa9f7('0x24')],qs[_0xa9f7('0x28')](_0x575163['query']['fields']));_0x595e4b[_0xa9f7('0x29')]=_0x595e4b[_0xa9f7('0x29')][_0xa9f7('0x2a')]?_0x595e4b[_0xa9f7('0x29')]:_0x21de65[_0xa9f7('0x24')];if(_0x575163['query'][_0xa9f7('0x2b')]){_0x595e4b[_0xa9f7('0x1f')]=[{'all':!![]}];}_0x595e4b=_[_0xa9f7('0x2c')]({},_0x595e4b,_0x575163['options']);return db['FaxQueue'][_0xa9f7('0x2d')](_0x595e4b)['then'](handleEntityNotFound(_0x49805c,null))[_0xa9f7('0x12')](respondWithResult(_0x49805c,null))[_0xa9f7('0x2e')](handleError(_0x49805c,null));};exports[_0xa9f7('0x2f')]=function(_0x30c089,_0x4bccd0){return db[_0xa9f7('0x21')][_0xa9f7('0x2f')](_0x30c089[_0xa9f7('0x30')],{})[_0xa9f7('0x12')](function(_0x1f7e55){var _0x318f96=_0x30c089[_0xa9f7('0x31')]['get']({'plain':!![]});if(!_0x318f96)throw new Error(_0xa9f7('0x32'));if(_0x318f96[_0xa9f7('0x33')]==='user'){var _0x2abadd=_0x1f7e55[_0xa9f7('0x14')]({'plain':!![]});var _0xb5b7d8=_0xa9f7('0x15');return db[_0xa9f7('0x34')][_0xa9f7('0x2d')]({'where':{'name':_0xb5b7d8,'userProfileId':_0x318f96[_0xa9f7('0x35')]},'raw':!![]})['then'](function(_0x402808){if(_0x402808&&_0x402808[_0xa9f7('0x36')]===0x0){return db[_0xa9f7('0x16')]['create']({'name':_0x2abadd[_0xa9f7('0x17')],'resourceId':_0x2abadd['id'],'type':_0x402808['name'],'sectionId':_0x402808['id']},{})[_0xa9f7('0x12')](function(){return _0x1f7e55;});}else{return _0x1f7e55;}})[_0xa9f7('0x2e')](function(_0x5eb5d2){logger[_0xa9f7('0x37')](_0xa9f7('0x38'),_0x5eb5d2);throw _0x5eb5d2;});}return _0x1f7e55;})[_0xa9f7('0x12')](respondWithResult(_0x4bccd0,0xc9))[_0xa9f7('0x2e')](handleError(_0x4bccd0,null));};exports[_0xa9f7('0x11')]=function(_0x492d3f,_0x3fb0d6){if(_0x492d3f[_0xa9f7('0x30')]['id']){delete _0x492d3f[_0xa9f7('0x30')]['id'];}return db[_0xa9f7('0x21')][_0xa9f7('0x2d')]({'where':{'id':_0x492d3f[_0xa9f7('0x39')]['id']}})[_0xa9f7('0x12')](handleEntityNotFound(_0x3fb0d6,null))[_0xa9f7('0x12')](saveUpdates(_0x492d3f[_0xa9f7('0x30')],null))[_0xa9f7('0x12')](respondWithResult(_0x3fb0d6,null))[_0xa9f7('0x2e')](handleError(_0x3fb0d6,null));};exports[_0xa9f7('0x13')]=function(_0x55c697,_0x5c3fed){return db[_0xa9f7('0x21')][_0xa9f7('0x2d')]({'where':{'id':_0x55c697[_0xa9f7('0x39')]['id']}})[_0xa9f7('0x12')](handleEntityNotFound(_0x5c3fed,null))[_0xa9f7('0x12')](removeEntity(_0x5c3fed,null))[_0xa9f7('0x2e')](handleError(_0x5c3fed,null));};exports[_0xa9f7('0x3a')]=function(_0x284f9d,_0x4ea565){return db[_0xa9f7('0x21')][_0xa9f7('0x3a')]()[_0xa9f7('0x12')](respondWithResult(_0x4ea565,null))['catch'](handleError(_0x4ea565,null));};exports['getMembers']=function(_0x178174,_0x5a2262){var _0x101333={'raw':!![],'where':{}},_0x278260={},_0x41e761;return db[_0xa9f7('0x21')]['findOne']({'where':{'id':_0x178174[_0xa9f7('0x39')]['id']}})['then'](handleEntityNotFound(_0x5a2262,null))[_0xa9f7('0x12')](function(_0x37f146){if(_0x37f146){_0x41e761=_0x37f146[_0xa9f7('0x14')]({'plain':!![]});_0x278260[_0xa9f7('0x24')]=_[_0xa9f7('0x25')](db[_0xa9f7('0x3b')][_0xa9f7('0x1a')]);_0x278260[_0xa9f7('0x20')]=_[_0xa9f7('0x25')](_0x178174['query']);_0x278260[_0xa9f7('0x26')]=_[_0xa9f7('0x27')](_0x278260[_0xa9f7('0x24')],_0x278260['query']);_0x101333[_0xa9f7('0x29')]=_[_0xa9f7('0x27')](_0x278260[_0xa9f7('0x24')],qs[_0xa9f7('0x28')](_0x178174[_0xa9f7('0x20')][_0xa9f7('0x28')]));_0x101333[_0xa9f7('0x29')]=_0x101333[_0xa9f7('0x29')][_0xa9f7('0x2a')]?_0x101333[_0xa9f7('0x29')]:_0x278260[_0xa9f7('0x24')];if(!_0x178174['query'][_0xa9f7('0x3c')](_0xa9f7('0x3d'))){_0x101333[_0xa9f7('0xf')]=qs['limit'](_0x178174[_0xa9f7('0x20')][_0xa9f7('0xf')]);_0x101333[_0xa9f7('0x3e')]=qs[_0xa9f7('0x3e')](_0x178174[_0xa9f7('0x20')][_0xa9f7('0x3e')]);}_0x101333[_0xa9f7('0x3f')]=qs['sort'](_0x178174[_0xa9f7('0x20')][_0xa9f7('0x40')]);_0x101333[_0xa9f7('0x1e')]=qs[_0xa9f7('0x26')](_['pick'](_0x178174['query'],_0x278260[_0xa9f7('0x26')]));_0x101333[_0xa9f7('0x1e')]['FaxQueueId']=_0x37f146['id'];if(_0x178174[_0xa9f7('0x20')][_0xa9f7('0x41')]){_0x101333[_0xa9f7('0x1e')]=_[_0xa9f7('0x2c')](_0x101333[_0xa9f7('0x1e')],{'$or':_[_0xa9f7('0x19')](_0x101333['attributes'],function(_0x3c4e39){var _0x3a2d30={};_0x3a2d30[_0x3c4e39]={'$like':'%'+_0x178174[_0xa9f7('0x20')][_0xa9f7('0x41')]+'%'};return _0x3a2d30;})});}_0x101333=_[_0xa9f7('0x2c')]({},_0x101333,_0x178174[_0xa9f7('0x42')]);return db['UserFaxQueue']['findAll'](_0x101333);}})[_0xa9f7('0x12')](function(_0x3e0b43){if(_0x3e0b43){return db[_0xa9f7('0x43')][_0xa9f7('0x44')]({'where':{'id':_[_0xa9f7('0x19')](_0x3e0b43,_0xa9f7('0x45')),'role':_0xa9f7('0x46')},'attributes':['id','name',_0xa9f7('0x47'),_0xa9f7('0x48'),_0xa9f7('0x49')]});}})[_0xa9f7('0x12')](function(_0x3e0ef6){if(_0x3e0ef6){return{'count':_0x3e0ef6[_0xa9f7('0xe')],'rows':_[_0xa9f7('0x19')](_0x3e0ef6[_0xa9f7('0x22')],function(_0x313165){return{'membername':_0x313165['name'],'UserId':_0x313165['id'],'queue_name':_0x41e761[_0xa9f7('0x17')],'FaxQueueId':_0x41e761['id'],'interface':util['format'](_0xa9f7('0x4a'),'SIP',_0x313165[_0xa9f7('0x17')]),'penalty':0x0,'paused':_0x313165[_0xa9f7('0x47')],'createdAt':_0x313165[_0xa9f7('0x49')],'updatedAt':_0x313165[_0xa9f7('0x48')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa9f7('0x12')](respondWithFilteredResult(_0x5a2262,_0x101333))['catch'](handleError(_0x5a2262,null));};exports[_0xa9f7('0x4b')]=function(_0x246815,_0x1e3d06){var _0x4c309f={};var _0x440c99={};var _0x501b26;var _0x3af9eb;return db[_0xa9f7('0x21')][_0xa9f7('0x4c')]({'where':{'id':_0x246815['params']['id']}})[_0xa9f7('0x12')](handleEntityNotFound(_0x1e3d06,null))[_0xa9f7('0x12')](function(_0x351b4f){if(_0x351b4f){_0x501b26=_0x351b4f;_0x440c99['model']=_['keys'](db['Team'][_0xa9f7('0x1a')]);_0x440c99[_0xa9f7('0x20')]=_[_0xa9f7('0x25')](_0x246815['query']);_0x440c99[_0xa9f7('0x26')]=_[_0xa9f7('0x27')](_0x440c99[_0xa9f7('0x24')],_0x440c99[_0xa9f7('0x20')]);_0x4c309f[_0xa9f7('0x29')]=_[_0xa9f7('0x27')](_0x440c99[_0xa9f7('0x24')],qs[_0xa9f7('0x28')](_0x246815[_0xa9f7('0x20')]['fields']));_0x4c309f[_0xa9f7('0x29')]=_0x4c309f[_0xa9f7('0x29')][_0xa9f7('0x2a')]?_0x4c309f[_0xa9f7('0x29')]:_0x440c99[_0xa9f7('0x24')];_0x4c309f['order']=qs['sort'](_0x246815[_0xa9f7('0x20')][_0xa9f7('0x40')]);_0x4c309f[_0xa9f7('0x1e')]=qs[_0xa9f7('0x26')](_[_0xa9f7('0x4d')](_0x246815[_0xa9f7('0x20')],_0x440c99[_0xa9f7('0x26')]));if(_0x246815[_0xa9f7('0x20')][_0xa9f7('0x41')]){_0x4c309f[_0xa9f7('0x1e')]=_['merge'](_0x4c309f[_0xa9f7('0x1e')],{'$or':_[_0xa9f7('0x19')](_0x4c309f[_0xa9f7('0x29')],function(_0x180459){var _0x5b862a={};_0x5b862a[_0x180459]={'$like':'%'+_0x246815[_0xa9f7('0x20')][_0xa9f7('0x41')]+'%'};return _0x5b862a;})});}_0x4c309f=_[_0xa9f7('0x2c')]({},_0x4c309f,_0x246815[_0xa9f7('0x42')]);return _0x501b26[_0xa9f7('0x4b')](_0x4c309f);}})['then'](function(_0x51aa5c){if(_0x51aa5c){_0x3af9eb=_0x51aa5c[_0xa9f7('0x2a')];if(!_0x246815[_0xa9f7('0x20')]['hasOwnProperty'](_0xa9f7('0x3d'))){_0x4c309f[_0xa9f7('0xf')]=qs[_0xa9f7('0xf')](_0x246815[_0xa9f7('0x20')]['limit']);_0x4c309f[_0xa9f7('0x3e')]=qs[_0xa9f7('0x3e')](_0x246815['query']['offset']);}return _0x501b26[_0xa9f7('0x4b')](_0x4c309f);}})[_0xa9f7('0x12')](function(_0x4c4622){if(_0x4c4622){return _0x4c4622?{'count':_0x3af9eb,'rows':_0x4c4622}:null;}})['then'](respondWithResult(_0x1e3d06,null))['catch'](handleError(_0x1e3d06,null));};exports[_0xa9f7('0x4e')]=function(_0x5aad4b,_0x4fb6c4){var _0x258ba4=_0x5aad4b[_0xa9f7('0x30')]['ids'];return db[_0xa9f7('0x4f')]['findAll']({'where':{'id':_0x258ba4},'attributes':['id'],'include':[{'model':db[_0xa9f7('0x43')],'as':'Agents','attributes':['id',_0xa9f7('0x17'),_0xa9f7('0x50'),_0xa9f7('0x51'),_0xa9f7('0x52')],'raw':!![]}]})[_0xa9f7('0x12')](function(_0xc8b292){if(_0xc8b292){var _0x32c73a=_[_0xa9f7('0x53')](_0xc8b292,function(_0x19d0ca){var _0x2f7061=_0x19d0ca[_0xa9f7('0x14')]({'plain':!![]});return _0x2f7061[_0xa9f7('0x54')];});return db[_0xa9f7('0x21')]['find']({'where':{'id':_0x5aad4b[_0xa9f7('0x39')]['id']}})[_0xa9f7('0x12')](function(_0x2fd3a3){return db[_0xa9f7('0x55')][_0xa9f7('0x56')](function(_0x962b3d){return _0x2fd3a3['addTeams'](_0x258ba4,{'transaction':_0x962b3d})[_0xa9f7('0x12')](function(){return BPromise[_0xa9f7('0x57')](_0x32c73a,function(_0x1a536c){return db[_0xa9f7('0x3b')][_0xa9f7('0x58')]({'where':{'UserId':_0x1a536c['id'],'FaxQueueId':_0x5aad4b[_0xa9f7('0x39')]['id']},'transaction':_0x962b3d});});})[_0xa9f7('0x12')](function(){_0x32c73a['forEach'](function(_0x8a1dbf){socket[_0xa9f7('0x59')](_0xa9f7('0x5a'),{'UserId':_0x8a1dbf['id'],'FaxQueueId':_0x2fd3a3['id']});});});});});}})['then'](respondWithStatusCode(_0x4fb6c4,null))[_0xa9f7('0x2e')](handleError(_0x4fb6c4,null));};exports[_0xa9f7('0x5b')]=function(_0x45c85d,_0x5eead1){return db[_0xa9f7('0x4f')][_0xa9f7('0x5c')]({'where':{'id':_0x45c85d[_0xa9f7('0x20')][_0xa9f7('0x5d')]},'attributes':['id'],'include':[{'model':db[_0xa9f7('0x43')],'as':_0xa9f7('0x54'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5eead1,null))[_0xa9f7('0x12')](function(_0x39db32){var _0x2a2ac8=_['map'](_0x39db32,'id');var _0x154f2e=[];var _0x4c62e0=[];var _0x5d8c15=squel[_0xa9f7('0x5e')]();_0x5d8c15[_0xa9f7('0x5f')](_0xa9f7('0x60'))[_0xa9f7('0x61')]('team_has_fax_queues','tq')['join'](_0xa9f7('0x62'),'ut',_0xa9f7('0x63'))[_0xa9f7('0x1e')](_0xa9f7('0x64'),_0x45c85d[_0xa9f7('0x39')]['id']);for(var _0x3960a3=0x0;_0x3960a3<_0x39db32[_0xa9f7('0x2a')];_0x3960a3+=0x1){let _0xedf7a=_0x39db32[_0x3960a3];for(var _0x38652a=0x0;_0x38652a<_0xedf7a[_0xa9f7('0x54')]['length'];_0x38652a+=0x1){let _0x44718c=_0xedf7a[_0xa9f7('0x54')][_0x38652a];var _0x4180cf=_0x5d8c15[_0xa9f7('0x65')]();_0x4180cf[_0xa9f7('0x1e')]('ut.UserId\x20=\x20?',_0x44718c['id']);_0x4c62e0[_0xa9f7('0x66')](db[_0xa9f7('0x55')][_0xa9f7('0x20')](_0x4180cf[_0xa9f7('0x67')](),{'type':db[_0xa9f7('0x55')][_0xa9f7('0x68')]['SELECT']})['then'](function(_0xafe95f){if(_0xafe95f['length']===0x1){return _0x44718c['id'];}else{var _0x46698e=_[_0xa9f7('0x69')](_[_0xa9f7('0x19')](_0xafe95f,_0xa9f7('0x6a')),function(_0x3bb6ed){return _[_0xa9f7('0x6b')](_0x2a2ac8,_0x3bb6ed);});if(_0x46698e){return _0x44718c['id'];}}}));}}return BPromise[_0xa9f7('0x6c')](_0x4c62e0)[_0xa9f7('0x12')](function(_0x256f0d){_0x154f2e=_(_0x154f2e)[_0xa9f7('0x6d')](_0x256f0d)[_0xa9f7('0x6e')]()[_0xa9f7('0x6f')]();return db[_0xa9f7('0x21')][_0xa9f7('0x2d')]({'where':{'id':_0x45c85d[_0xa9f7('0x39')]['id']}})['then'](function(_0x1c90e3){return db[_0xa9f7('0x55')][_0xa9f7('0x56')](function(_0x41f768){return _0x1c90e3[_0xa9f7('0x5b')](_0x45c85d['query'][_0xa9f7('0x5d')],{'transaction':_0x41f768})[_0xa9f7('0x12')](function(){if(!_[_0xa9f7('0x70')](_0x154f2e)){return _0x1c90e3[_0xa9f7('0x71')](_0x154f2e,{'transaction':_0x41f768});}})[_0xa9f7('0x12')](function(){_0x154f2e[_0xa9f7('0x72')](function(_0x2495ba){socket[_0xa9f7('0x59')]('userFaxQueue:remove',{'UserId':_0x2495ba,'FaxQueueId':_0x1c90e3['id']});});});});});});})[_0xa9f7('0x12')](respondWithStatusCode(_0x5eead1,null))[_0xa9f7('0x2e')](handleError(_0x5eead1,null));};exports[_0xa9f7('0x73')]=function(_0x2c11e6,_0x59b45b){return db['FaxQueue'][_0xa9f7('0x2d')]({'where':{'id':_0x2c11e6['params']['id']}})[_0xa9f7('0x12')](handleEntityNotFound(_0x59b45b,null))[_0xa9f7('0x12')](function(_0x927c2b){if(_0x927c2b){return _0x927c2b[_0xa9f7('0x73')](_0x2c11e6[_0xa9f7('0x30')][_0xa9f7('0x5d')],_[_0xa9f7('0x74')](_0x2c11e6[_0xa9f7('0x30')],['ids','id'])||{})[_0xa9f7('0x75')](function(_0x31c358){for(var _0x1ab775=0x0;_0x1ab775<_0x2c11e6['body'][_0xa9f7('0x5d')]['length'];_0x1ab775+=0x1){socket[_0xa9f7('0x59')](_0xa9f7('0x5a'),{'UserId':Number(_0x2c11e6['body'][_0xa9f7('0x5d')][_0x1ab775]),'FaxQueueId':Number(_0x2c11e6[_0xa9f7('0x39')]['id'])});}return _0x31c358;});}})[_0xa9f7('0x12')](respondWithResult(_0x59b45b,null))[_0xa9f7('0x2e')](handleError(_0x59b45b,null));};exports[_0xa9f7('0x71')]=function(_0x595762,_0x3221c1){return db[_0xa9f7('0x21')][_0xa9f7('0x2d')]({'where':{'id':_0x595762[_0xa9f7('0x39')]['id']}})[_0xa9f7('0x12')](handleEntityNotFound(_0x3221c1,null))[_0xa9f7('0x12')](function(_0x15f652){if(_0x15f652){return _0x15f652['removeAgents'](_0x595762[_0xa9f7('0x20')][_0xa9f7('0x5d')])[_0xa9f7('0x12')](function(){if(_[_0xa9f7('0x76')](_0x595762[_0xa9f7('0x20')][_0xa9f7('0x5d')])){for(var _0x95fb8b=0x0;_0x95fb8b<_0x595762[_0xa9f7('0x20')][_0xa9f7('0x5d')]['length'];_0x95fb8b+=0x1){socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x595762[_0xa9f7('0x20')][_0xa9f7('0x5d')][_0x95fb8b]),'FaxQueueId':Number(_0x595762[_0xa9f7('0x39')]['id'])});}}else{socket['emit'](_0xa9f7('0x77'),{'UserId':Number(_0x595762[_0xa9f7('0x20')][_0xa9f7('0x5d')]),'FaxQueueId':Number(_0x595762[_0xa9f7('0x39')]['id'])});}});}})[_0xa9f7('0x12')](respondWithStatusCode(_0x3221c1,null))['catch'](handleError(_0x3221c1,null));};exports[_0xa9f7('0x78')]=function(_0x58b4a2,_0x431411){var _0x2641dc={};var _0x316165={};var _0x561299;var _0x3b6b7d;return db[_0xa9f7('0x21')][_0xa9f7('0x4c')]({'where':{'id':_0x58b4a2['params']['id']}})['then'](handleEntityNotFound(_0x431411,null))[_0xa9f7('0x12')](function(_0x34c002){if(_0x34c002){_0x561299=_0x34c002;_0x316165[_0xa9f7('0x24')]=_[_0xa9f7('0x25')](db[_0xa9f7('0x43')][_0xa9f7('0x1a')]);_0x316165[_0xa9f7('0x20')]=_[_0xa9f7('0x25')](_0x58b4a2[_0xa9f7('0x20')]);_0x316165['filters']=_[_0xa9f7('0x27')](_0x316165[_0xa9f7('0x24')],_0x316165[_0xa9f7('0x20')]);_0x2641dc['attributes']=_[_0xa9f7('0x27')](_0x316165[_0xa9f7('0x24')],qs['fields'](_0x58b4a2[_0xa9f7('0x20')][_0xa9f7('0x28')]));_0x2641dc['attributes']=_0x2641dc[_0xa9f7('0x29')][_0xa9f7('0x2a')]?_0x2641dc[_0xa9f7('0x29')]:_0x316165[_0xa9f7('0x24')];_0x2641dc[_0xa9f7('0x3f')]=qs[_0xa9f7('0x40')](_0x58b4a2[_0xa9f7('0x20')][_0xa9f7('0x40')]);_0x2641dc[_0xa9f7('0x1e')]=qs['filters'](_[_0xa9f7('0x4d')](_0x58b4a2[_0xa9f7('0x20')],_0x316165[_0xa9f7('0x26')]));if(_0x58b4a2[_0xa9f7('0x20')][_0xa9f7('0x41')]){_0x2641dc[_0xa9f7('0x1e')]=_[_0xa9f7('0x2c')](_0x2641dc['where'],{'$or':_[_0xa9f7('0x19')](_0x2641dc[_0xa9f7('0x29')],function(_0x336fb6){var _0x1d4e28={};_0x1d4e28[_0x336fb6]={'$like':'%'+_0x58b4a2[_0xa9f7('0x20')][_0xa9f7('0x41')]+'%'};return _0x1d4e28;})});}_0x2641dc=_[_0xa9f7('0x2c')]({},_0x2641dc,_0x58b4a2[_0xa9f7('0x42')]);return _0x561299[_0xa9f7('0x78')](_0x2641dc);}})[_0xa9f7('0x12')](function(_0xb0678d){if(_0xb0678d){_0x3b6b7d=_0xb0678d['length'];if(!_0x58b4a2[_0xa9f7('0x20')]['hasOwnProperty'](_0xa9f7('0x3d'))){_0x2641dc[_0xa9f7('0xf')]=qs[_0xa9f7('0xf')](_0x58b4a2[_0xa9f7('0x20')][_0xa9f7('0xf')]);_0x2641dc[_0xa9f7('0x3e')]=qs[_0xa9f7('0x3e')](_0x58b4a2[_0xa9f7('0x20')][_0xa9f7('0x3e')]);}return _0x561299[_0xa9f7('0x78')](_0x2641dc);}})[_0xa9f7('0x12')](function(_0x1b64ce){if(_0x1b64ce){return _0x1b64ce?{'count':_0x3b6b7d,'rows':_0x1b64ce}:null;}})['then'](respondWithResult(_0x431411,null))[_0xa9f7('0x2e')](handleError(_0x431411,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 414e440..b5eb671 100644 --- a/server/api/faxQueue/faxQueue.events.js +++ b/server/api/faxQueue/faxQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8418=['hook','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x4f9e0b,_0x5b5417){var _0x30a299=function(_0xb998c8){while(--_0xb998c8){_0x4f9e0b['push'](_0x4f9e0b['shift']());}};_0x30a299(++_0x5b5417);}(_0x8418,0x174));var _0x8841=function(_0x3b5ad9,_0x223867){_0x3b5ad9=_0x3b5ad9-0x0;var _0x611ae9=_0x8418[_0x3b5ad9];return _0x611ae9;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x8841('0x0'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x8841('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8841('0x2'),'afterDestroy':_0x8841('0x3')};function emitEvent(_0x1bba50){return function(_0x1f9fe4,_0x5bcbd1,_0x1da4e0){FaxQueueEvents[_0x8841('0x4')](_0x1bba50+':'+_0x1f9fe4['id'],_0x1f9fe4);FaxQueueEvents['emit'](_0x1bba50,_0x1f9fe4);_0x1da4e0(null);};}for(var e in events){if(events[_0x8841('0x5')](e)){var event=events[e];FaxQueue[_0x8841('0x6')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0x170d=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','FaxQueue','setMaxListeners','save'];(function(_0x1b561b,_0x57bc19){var _0x13810e=function(_0x425be0){while(--_0x425be0){_0x1b561b['push'](_0x1b561b['shift']());}};_0x13810e(++_0x57bc19);}(_0x170d,0x69));var _0xd170=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x170d[_0x42cae2];return _0x5f256f;};'use strict';var EventEmitter=require(_0xd170('0x0'));var FaxQueue=require(_0xd170('0x1'))['db'][_0xd170('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xd170('0x3')](0x0);var events={'afterCreate':_0xd170('0x4'),'afterUpdate':_0xd170('0x5'),'afterDestroy':_0xd170('0x6')};function emitEvent(_0x3b1aeb){return function(_0x2f8a2a,_0x42b082,_0x427fb5){FaxQueueEvents['emit'](_0x3b1aeb+':'+_0x2f8a2a['id'],_0x2f8a2a);FaxQueueEvents[_0xd170('0x7')](_0x3b1aeb,_0x2f8a2a);_0x427fb5(null);};}for(var e in events){if(events[_0xd170('0x8')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0xd170('0x9')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 4733924..a433af1 100644 --- a/server/api/faxQueue/faxQueue.model.js +++ b/server/api/faxQueue/faxQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0f21=['bluebird','request-promise','path','rimraf','./faxQueue.attributes','FaxQueue','lodash','api','moment'];(function(_0x47757b,_0x5e93b0){var _0x4217ce=function(_0x3d98dd){while(--_0x3d98dd){_0x47757b['push'](_0x47757b['shift']());}};_0x4217ce(++_0x5e93b0);}(_0x0f21,0x192));var _0x10f2=function(_0x196004,_0x31a6fc){_0x196004=_0x196004-0x0;var _0xec74b6=_0x0f21[_0x196004];return _0xec74b6;};'use strict';var _=require(_0x10f2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x10f2('0x1'));var moment=require(_0x10f2('0x2'));var BPromise=require(_0x10f2('0x3'));var rp=require(_0x10f2('0x4'));var fs=require('fs');var path=require(_0x10f2('0x5'));var rimraf=require(_0x10f2('0x6'));var config=require('../../config/environment');var attributes=require(_0x10f2('0x7'));module['exports']=function(_0xf0ac66,_0xa1396c){return _0xf0ac66['define'](_0x10f2('0x8'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xab94=['./faxQueue.attributes','define','fax_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x352ac4,_0x432de3){var _0x321900=function(_0x4bad06){while(--_0x4bad06){_0x352ac4['push'](_0x352ac4['shift']());}};_0x321900(++_0x432de3);}(_0xab94,0x116));var _0x4ab9=function(_0x213d2d,_0x28ea56){_0x213d2d=_0x213d2d-0x0;var _0xbba30d=_0xab94[_0x213d2d];return _0xbba30d;};'use strict';var _=require(_0x4ab9('0x0'));var util=require('util');var logger=require(_0x4ab9('0x1'))(_0x4ab9('0x2'));var moment=require(_0x4ab9('0x3'));var BPromise=require(_0x4ab9('0x4'));var rp=require(_0x4ab9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4ab9('0x6'));var config=require(_0x4ab9('0x7'));var attributes=require(_0x4ab9('0x8'));module['exports']=function(_0x5d1bb9,_0x570df6){return _0x5d1bb9[_0x4ab9('0x9')]('FaxQueue',attributes,{'tableName':_0x4ab9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index f12cbe7..d389353 100644 --- a/server/api/faxQueue/faxQueue.rpc.js +++ b/server/api/faxQueue/faxQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc2ad=['error','code','message','result','GetFaxQueue','FaxQueue','findAll','options','where','attributes','include','map','model','catch','ShowFaxQueue','find','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x384cae,_0x516b8c){var _0xb84434=function(_0x136048){while(--_0x136048){_0x384cae['push'](_0x384cae['shift']());}};_0xb84434(++_0x516b8c);}(_0xc2ad,0x16f));var _0xdc2a=function(_0x1c6091,_0x38a0b2){_0x1c6091=_0x1c6091-0x0;var _0xf0c085=_0xc2ad[_0x1c6091];return _0xf0c085;};'use strict';var _=require('lodash');var util=require(_0xdc2a('0x0'));var moment=require(_0xdc2a('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdc2a('0x2'));var db=require(_0xdc2a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xdc2a('0x4'))(_0xdc2a('0x5'));var config=require(_0xdc2a('0x6'));var jayson=require(_0xdc2a('0x7'));var client=jayson[_0xdc2a('0x8')][_0xdc2a('0x9')]({'port':0x232a});config[_0xdc2a('0xa')]=_[_0xdc2a('0xb')](config[_0xdc2a('0xa')],{'host':_0xdc2a('0xc'),'port':0x18eb});var socket=require(_0xdc2a('0xd'))(new Redis(config['redis']));require(_0xdc2a('0xe'))['register'](socket);function respondWithRpcPromise(_0x1386a8,_0x5480d6,_0x50ce40){return new BPromise(function(_0xb34260,_0x36d45e){return client[_0xdc2a('0xf')](_0x1386a8,_0x50ce40)[_0xdc2a('0x10')](function(_0x14e4a4){logger[_0xdc2a('0x11')](_0xdc2a('0x12'),_0x5480d6,_0xdc2a('0x13'));logger[_0xdc2a('0x14')](_0xdc2a('0x15'),_0x5480d6,_0xdc2a('0x13'),JSON[_0xdc2a('0x16')](_0x14e4a4));if(_0x14e4a4[_0xdc2a('0x17')]){if(_0x14e4a4['error'][_0xdc2a('0x18')]===0x1f4){logger['error']('FaxQueue,\x20%s,\x20%s',_0x5480d6,_0x14e4a4[_0xdc2a('0x17')]['message']);return _0x36d45e(_0x14e4a4['error'][_0xdc2a('0x19')]);}logger[_0xdc2a('0x17')](_0xdc2a('0x12'),_0x5480d6,_0x14e4a4[_0xdc2a('0x17')][_0xdc2a('0x19')]);return _0xb34260(_0x14e4a4['error']['message']);}else{logger[_0xdc2a('0x11')](_0xdc2a('0x12'),_0x5480d6,_0xdc2a('0x13'));_0xb34260(_0x14e4a4[_0xdc2a('0x1a')][_0xdc2a('0x19')]);}})['catch'](function(_0x213da8){logger[_0xdc2a('0x17')](_0xdc2a('0x12'),_0x5480d6,_0x213da8);_0x36d45e(_0x213da8);});});}exports[_0xdc2a('0x1b')]=function(_0x3968e9){var _0x277882=this;return new Promise(function(_0x29fdc7,_0x48a530){return db[_0xdc2a('0x1c')][_0xdc2a('0x1d')]({'raw':_0x3968e9[_0xdc2a('0x1e')]?_0x3968e9[_0xdc2a('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x3968e9['options']?_0x3968e9[_0xdc2a('0x1e')][_0xdc2a('0x1f')]||null:null,'attributes':_0x3968e9[_0xdc2a('0x1e')]?_0x3968e9[_0xdc2a('0x1e')][_0xdc2a('0x20')]||null:null,'limit':_0x3968e9[_0xdc2a('0x1e')]?_0x3968e9[_0xdc2a('0x1e')]['limit']||null:null,'include':_0x3968e9['options']?_0x3968e9[_0xdc2a('0x1e')][_0xdc2a('0x21')]?_[_0xdc2a('0x22')](_0x3968e9[_0xdc2a('0x1e')]['include'],function(_0x19ad61){return{'model':db[_0x19ad61[_0xdc2a('0x23')]],'as':_0x19ad61['as'],'attributes':_0x19ad61[_0xdc2a('0x20')],'include':_0x19ad61[_0xdc2a('0x21')]?_[_0xdc2a('0x22')](_0x19ad61[_0xdc2a('0x21')],function(_0x30d200){return{'model':db[_0x30d200[_0xdc2a('0x23')]],'as':_0x30d200['as'],'attributes':_0x30d200[_0xdc2a('0x20')],'include':_0x30d200['include']?_['map'](_0x30d200['include'],function(_0x386340){return{'model':db[_0x386340[_0xdc2a('0x23')]],'as':_0x386340['as'],'attributes':_0x386340[_0xdc2a('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a0e1d){logger['info'](_0xdc2a('0x1b'),_0x3968e9);logger['debug'](_0xdc2a('0x1b'),_0x3968e9,JSON[_0xdc2a('0x16')](_0x3a0e1d));_0x29fdc7(_0x3a0e1d);})[_0xdc2a('0x24')](function(_0x7c7c73){logger[_0xdc2a('0x17')]('GetFaxQueue',_0x7c7c73[_0xdc2a('0x19')],_0x3968e9);_0x48a530(_0x277882['error'](0x1f4,_0x7c7c73[_0xdc2a('0x19')]));});});};exports[_0xdc2a('0x25')]=function(_0x4bcb71){var _0x550803=this;return new Promise(function(_0x47f141,_0x344c44){return db[_0xdc2a('0x1c')][_0xdc2a('0x26')]({'raw':_0x4bcb71['options']?_0x4bcb71[_0xdc2a('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x4bcb71['options']?_0x4bcb71['options'][_0xdc2a('0x1f')]||null:null,'attributes':_0x4bcb71[_0xdc2a('0x1e')]?_0x4bcb71['options']['attributes']||null:null,'include':_0x4bcb71[_0xdc2a('0x1e')]?_0x4bcb71[_0xdc2a('0x1e')][_0xdc2a('0x21')]?_['map'](_0x4bcb71['options'][_0xdc2a('0x21')],function(_0x5d5d99){return{'model':db[_0x5d5d99[_0xdc2a('0x23')]],'as':_0x5d5d99['as'],'attributes':_0x5d5d99[_0xdc2a('0x20')],'include':_0x5d5d99[_0xdc2a('0x21')]?_['map'](_0x5d5d99[_0xdc2a('0x21')],function(_0x3e8ae7){return{'model':db[_0x3e8ae7['model']],'as':_0x3e8ae7['as'],'attributes':_0x3e8ae7[_0xdc2a('0x20')],'include':_0x3e8ae7[_0xdc2a('0x21')]?_[_0xdc2a('0x22')](_0x3e8ae7['include'],function(_0x57e7d9){return{'model':db[_0x57e7d9[_0xdc2a('0x23')]],'as':_0x57e7d9['as'],'attributes':_0x57e7d9[_0xdc2a('0x20')]};}):[]};}):[]};}):[]:[]})[_0xdc2a('0x10')](function(_0x3622c3){logger['info'](_0xdc2a('0x25'),_0x4bcb71);logger['debug']('ShowFaxQueue',_0x4bcb71,JSON[_0xdc2a('0x16')](_0x3622c3));_0x47f141(_0x3622c3);})[_0xdc2a('0x24')](function(_0x4c5f96){logger[_0xdc2a('0x17')](_0xdc2a('0x25'),_0x4c5f96[_0xdc2a('0x19')],_0x4bcb71);_0x344c44(_0x550803['error'](0x1f4,_0x4c5f96['message']));});});}; \ No newline at end of file +var _0x024b=['model','catch','ShowFaxQueue','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueue,\x20%s,\x20%s','message','info','GetFaxQueue','FaxQueue','findAll','options','raw','attributes','limit','include','map'];(function(_0x532ae4,_0x501726){var _0x750979=function(_0x18aa5a){while(--_0x18aa5a){_0x532ae4['push'](_0x532ae4['shift']());}};_0x750979(++_0x501726);}(_0x024b,0x147));var _0xb024=function(_0x211064,_0x65125d){_0x211064=_0x211064-0x0;var _0x1df108=_0x024b[_0x211064];return _0x1df108;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xb024('0x0'));var rs=require(_0xb024('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb024('0x2'))['db'];var utils=require(_0xb024('0x3'));var logger=require(_0xb024('0x4'))(_0xb024('0x5'));var config=require('../../config/environment');var jayson=require(_0xb024('0x6'));var client=jayson[_0xb024('0x7')]['http']({'port':0x232a});config[_0xb024('0x8')]=_[_0xb024('0x9')](config['redis'],{'host':_0xb024('0xa'),'port':0x18eb});var socket=require(_0xb024('0xb'))(new Redis(config[_0xb024('0x8')]));require('./faxQueue.socket')[_0xb024('0xc')](socket);function respondWithRpcPromise(_0x1531d7,_0xa7c2db,_0x3909c6){return new BPromise(function(_0x32fe70,_0xe3835a){return client[_0xb024('0xd')](_0x1531d7,_0x3909c6)[_0xb024('0xe')](function(_0x2e518d){logger['info']('FaxQueue,\x20%s,\x20%s',_0xa7c2db,_0xb024('0xf'));logger[_0xb024('0x10')](_0xb024('0x11'),_0xa7c2db,_0xb024('0xf'),JSON[_0xb024('0x12')](_0x2e518d));if(_0x2e518d[_0xb024('0x13')]){if(_0x2e518d[_0xb024('0x13')][_0xb024('0x14')]===0x1f4){logger[_0xb024('0x13')](_0xb024('0x15'),_0xa7c2db,_0x2e518d['error'][_0xb024('0x16')]);return _0xe3835a(_0x2e518d['error'][_0xb024('0x16')]);}logger[_0xb024('0x13')](_0xb024('0x15'),_0xa7c2db,_0x2e518d[_0xb024('0x13')][_0xb024('0x16')]);return _0x32fe70(_0x2e518d[_0xb024('0x13')][_0xb024('0x16')]);}else{logger[_0xb024('0x17')](_0xb024('0x15'),_0xa7c2db,_0xb024('0xf'));_0x32fe70(_0x2e518d['result']['message']);}})['catch'](function(_0x46d2bb){logger[_0xb024('0x13')]('FaxQueue,\x20%s,\x20%s',_0xa7c2db,_0x46d2bb);_0xe3835a(_0x46d2bb);});});}exports[_0xb024('0x18')]=function(_0x1638d1){var _0x2f8f56=this;return new Promise(function(_0x3c848b,_0x2ad8b8){return db[_0xb024('0x19')][_0xb024('0x1a')]({'raw':_0x1638d1[_0xb024('0x1b')]?_0x1638d1[_0xb024('0x1b')][_0xb024('0x1c')]===undefined?!![]:![]:!![],'where':_0x1638d1[_0xb024('0x1b')]?_0x1638d1[_0xb024('0x1b')]['where']||null:null,'attributes':_0x1638d1[_0xb024('0x1b')]?_0x1638d1[_0xb024('0x1b')][_0xb024('0x1d')]||null:null,'limit':_0x1638d1[_0xb024('0x1b')]?_0x1638d1[_0xb024('0x1b')][_0xb024('0x1e')]||null:null,'include':_0x1638d1[_0xb024('0x1b')]?_0x1638d1['options'][_0xb024('0x1f')]?_[_0xb024('0x20')](_0x1638d1['options'][_0xb024('0x1f')],function(_0x261051){return{'model':db[_0x261051[_0xb024('0x21')]],'as':_0x261051['as'],'attributes':_0x261051[_0xb024('0x1d')],'include':_0x261051[_0xb024('0x1f')]?_['map'](_0x261051[_0xb024('0x1f')],function(_0x2a3b99){return{'model':db[_0x2a3b99[_0xb024('0x21')]],'as':_0x2a3b99['as'],'attributes':_0x2a3b99[_0xb024('0x1d')],'include':_0x2a3b99[_0xb024('0x1f')]?_[_0xb024('0x20')](_0x2a3b99[_0xb024('0x1f')],function(_0x347789){return{'model':db[_0x347789[_0xb024('0x21')]],'as':_0x347789['as'],'attributes':_0x347789[_0xb024('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb024('0xe')](function(_0xdf9cca){logger[_0xb024('0x17')]('GetFaxQueue',_0x1638d1);logger[_0xb024('0x10')](_0xb024('0x18'),_0x1638d1,JSON[_0xb024('0x12')](_0xdf9cca));_0x3c848b(_0xdf9cca);})[_0xb024('0x22')](function(_0x585c47){logger['error'](_0xb024('0x18'),_0x585c47[_0xb024('0x16')],_0x1638d1);_0x2ad8b8(_0x2f8f56[_0xb024('0x13')](0x1f4,_0x585c47['message']));});});};exports[_0xb024('0x23')]=function(_0x499545){var _0x1f2eb2=this;return new Promise(function(_0x20713b,_0x28af2b){return db[_0xb024('0x19')]['find']({'raw':_0x499545[_0xb024('0x1b')]?_0x499545[_0xb024('0x1b')][_0xb024('0x1c')]===undefined?!![]:![]:!![],'where':_0x499545[_0xb024('0x1b')]?_0x499545[_0xb024('0x1b')]['where']||null:null,'attributes':_0x499545[_0xb024('0x1b')]?_0x499545['options']['attributes']||null:null,'include':_0x499545['options']?_0x499545[_0xb024('0x1b')][_0xb024('0x1f')]?_[_0xb024('0x20')](_0x499545[_0xb024('0x1b')][_0xb024('0x1f')],function(_0x4d4692){return{'model':db[_0x4d4692['model']],'as':_0x4d4692['as'],'attributes':_0x4d4692[_0xb024('0x1d')],'include':_0x4d4692['include']?_[_0xb024('0x20')](_0x4d4692[_0xb024('0x1f')],function(_0x5d71ae){return{'model':db[_0x5d71ae[_0xb024('0x21')]],'as':_0x5d71ae['as'],'attributes':_0x5d71ae['attributes'],'include':_0x5d71ae['include']?_[_0xb024('0x20')](_0x5d71ae[_0xb024('0x1f')],function(_0x10d035){return{'model':db[_0x10d035[_0xb024('0x21')]],'as':_0x10d035['as'],'attributes':_0x10d035[_0xb024('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb024('0xe')](function(_0x31cf34){logger[_0xb024('0x17')](_0xb024('0x23'),_0x499545);logger[_0xb024('0x10')](_0xb024('0x23'),_0x499545,JSON['stringify'](_0x31cf34));_0x20713b(_0x31cf34);})[_0xb024('0x22')](function(_0x175105){logger['error'](_0xb024('0x23'),_0x175105[_0xb024('0x16')],_0x499545);_0x28af2b(_0x1f2eb2[_0xb024('0x13')](0x1f4,_0x175105[_0xb024('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 76b0624..81512ca 100644 --- a/server/api/faxQueue/faxQueue.socket.js +++ b/server/api/faxQueue/faxQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x09d8=['register','save','update','emit'];(function(_0x28cb3b,_0x474677){var _0x178260=function(_0x53beaf){while(--_0x53beaf){_0x28cb3b['push'](_0x28cb3b['shift']());}};_0x178260(++_0x474677);}(_0x09d8,0x1d5));var _0x809d=function(_0x2efc9d,_0x3c9317){_0x2efc9d=_0x2efc9d-0x0;var _0x5f9d97=_0x09d8[_0x2efc9d];return _0x5f9d97;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0x809d('0x0'),'remove',_0x809d('0x1')];function createListener(_0x3dd888,_0x38e14a){return function(_0x126cd3){_0x38e14a[_0x809d('0x2')](_0x3dd888,_0x126cd3);};}function removeListener(_0x1d13b7,_0xa15d12){return function(){FaxQueueEvents['removeListener'](_0x1d13b7,_0xa15d12);};}exports[_0x809d('0x3')]=function(_0x26077d){for(var _0x557be7=0x0,_0x38ee04=events['length'];_0x557be7<_0x38ee04;_0x557be7++){var _0x549641=events[_0x557be7];var _0x58857f=createListener('faxQueue:'+_0x549641,_0x26077d);FaxQueueEvents['on'](_0x549641,_0x58857f);}}; \ No newline at end of file +var _0x26e1=['save','remove','update','removeListener','register','./faxQueue.events'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0x26e1,0x6b));var _0x126e=function(_0x1a1597,_0x18a995){_0x1a1597=_0x1a1597-0x0;var _0x3dd7b8=_0x26e1[_0x1a1597];return _0x3dd7b8;};'use strict';var FaxQueueEvents=require(_0x126e('0x0'));var events=[_0x126e('0x1'),_0x126e('0x2'),_0x126e('0x3')];function createListener(_0x6c4ad6,_0x33cc4c){return function(_0x1fcd47){_0x33cc4c['emit'](_0x6c4ad6,_0x1fcd47);};}function removeListener(_0x5a71df,_0x262bf4){return function(){FaxQueueEvents[_0x126e('0x4')](_0x5a71df,_0x262bf4);};}exports[_0x126e('0x5')]=function(_0x864153){for(var _0x32fa3d=0x0,_0x360aa6=events['length'];_0x32fa3d<_0x360aa6;_0x32fa3d++){var _0x5cafb7=events[_0x32fa3d];var _0x42d988=createListener('faxQueue:'+_0x5cafb7,_0x864153);FaxQueueEvents['on'](_0x5cafb7,_0x42d988);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index affc028..656e524 100644 --- a/server/api/faxQueue/index.js +++ b/server/api/faxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x90b1=['addTeams','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create'];(function(_0x59fc7c,_0x1146f2){var _0x2653ff=function(_0x4e4d5f){while(--_0x4e4d5f){_0x59fc7c['push'](_0x59fc7c['shift']());}};_0x2653ff(++_0x1146f2);}(_0x90b1,0x1bb));var _0x190b=function(_0x5be7aa,_0x5de661){_0x5be7aa=_0x5be7aa-0x0;var _0x215408=_0x90b1[_0x5be7aa];return _0x215408;};'use strict';var multer=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var path=require(_0x190b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x190b('0x3')]();var fs_extra=require(_0x190b('0x4'));var auth=require(_0x190b('0x5'));var interaction=require(_0x190b('0x6'));var config=require('../../config/environment');var controller=require('./faxQueue.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x190b('0x7')]);router[_0x190b('0x8')](_0x190b('0x9'),auth[_0x190b('0xa')](),controller[_0x190b('0xb')]);router[_0x190b('0x8')](_0x190b('0xc'),auth['isAuthenticated'](),controller[_0x190b('0xd')]);router[_0x190b('0x8')](_0x190b('0xe'),auth[_0x190b('0xa')](),controller[_0x190b('0xf')]);router[_0x190b('0x8')](_0x190b('0x10'),auth[_0x190b('0xa')](),controller['getTeams']);router[_0x190b('0x8')](_0x190b('0x11'),auth['isAuthenticated'](),controller[_0x190b('0x12')]);router[_0x190b('0x13')]('/',auth[_0x190b('0xa')](),controller[_0x190b('0x14')]);router[_0x190b('0x13')](_0x190b('0x10'),auth[_0x190b('0xa')](),controller[_0x190b('0x15')]);router[_0x190b('0x13')](_0x190b('0x11'),auth[_0x190b('0xa')](),controller[_0x190b('0x16')]);router[_0x190b('0x17')](_0x190b('0xc'),auth[_0x190b('0xa')](),controller[_0x190b('0x18')]);router[_0x190b('0x19')]('/:id',auth[_0x190b('0xa')](),controller['destroy']);router[_0x190b('0x19')](_0x190b('0x10'),auth[_0x190b('0xa')](),controller[_0x190b('0x1a')]);router['delete'](_0x190b('0x11'),auth[_0x190b('0xa')](),controller[_0x190b('0x1b')]);module[_0x190b('0x1c')]=router; \ No newline at end of file +var _0xc359=['isAuthenticated','describe','/:id','show','/:id/members','/:id/users','post','create','/:id/teams','addTeams','addAgents','put','update','delete','destroy','removeTeams','exports','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get'];(function(_0x282796,_0x217005){var _0x1a755f=function(_0x58de4c){while(--_0x58de4c){_0x282796['push'](_0x282796['shift']());}};_0x1a755f(++_0x217005);}(_0xc359,0x1d9));var _0x9c35=function(_0x7b173,_0x539d7f){_0x7b173=_0x7b173-0x0;var _0x1c598c=_0xc359[_0x7b173];return _0x1c598c;};'use strict';var multer=require('multer');var util=require(_0x9c35('0x0'));var path=require('path');var timeout=require(_0x9c35('0x1'));var express=require(_0x9c35('0x2'));var router=express[_0x9c35('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9c35('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9c35('0x5'));var controller=require('./faxQueue.controller');router[_0x9c35('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0x9c35('0x7')](),controller[_0x9c35('0x8')]);router[_0x9c35('0x6')](_0x9c35('0x9'),auth[_0x9c35('0x7')](),controller[_0x9c35('0xa')]);router['get'](_0x9c35('0xb'),auth[_0x9c35('0x7')](),controller['getMembers']);router['get']('/:id/teams',auth[_0x9c35('0x7')](),controller['getTeams']);router[_0x9c35('0x6')](_0x9c35('0xc'),auth[_0x9c35('0x7')](),controller['getAgents']);router[_0x9c35('0xd')]('/',auth[_0x9c35('0x7')](),controller[_0x9c35('0xe')]);router[_0x9c35('0xd')](_0x9c35('0xf'),auth['isAuthenticated'](),controller[_0x9c35('0x10')]);router[_0x9c35('0xd')](_0x9c35('0xc'),auth[_0x9c35('0x7')](),controller[_0x9c35('0x11')]);router[_0x9c35('0x12')](_0x9c35('0x9'),auth[_0x9c35('0x7')](),controller[_0x9c35('0x13')]);router[_0x9c35('0x14')](_0x9c35('0x9'),auth[_0x9c35('0x7')](),controller[_0x9c35('0x15')]);router[_0x9c35('0x14')](_0x9c35('0xf'),auth['isAuthenticated'](),controller[_0x9c35('0x16')]);router[_0x9c35('0x14')](_0x9c35('0xc'),auth[_0x9c35('0x7')](),controller['removeAgents']);module[_0x9c35('0x17')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 6546804..01e315f 100644 --- a/server/api/faxQueueReport/faxQueueReport.attributes.js +++ b/server/api/faxQueueReport/faxQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6596=['sequelize','STRING','DATE','moment'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0x6596,0x1d3));var _0x6659=function(_0xc7198c,_0xfca606){_0xc7198c=_0xc7198c-0x0;var _0x2a89be=_0x6596[_0xc7198c];return _0x2a89be;};'use strict';var moment=require(_0x6659('0x0'));var Sequelize=require(_0x6659('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x6659('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x6659('0x2')]},'joinAt':{'type':Sequelize[_0x6659('0x3')]},'leaveAt':{'type':Sequelize[_0x6659('0x3')]},'acceptAt':{'type':Sequelize[_0x6659('0x3')]},'exitAt':{'type':Sequelize[_0x6659('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3393=['exports','STRING','DATE','moment'];(function(_0x15268b,_0xa5d431){var _0x45b9b7=function(_0x281d3a){while(--_0x281d3a){_0x15268b['push'](_0x15268b['shift']());}};_0x45b9b7(++_0xa5d431);}(_0x3393,0xbb));var _0x3339=function(_0xcc4963,_0x283dc5){_0xcc4963=_0xcc4963-0x0;var _0x499cde=_0x3393[_0xcc4963];return _0x499cde;};'use strict';var moment=require(_0x3339('0x0'));var Sequelize=require('sequelize');module[_0x3339('0x1')]={'uniqueid':{'type':Sequelize[_0x3339('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x3339('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x3339('0x3')]},'acceptAt':{'type':Sequelize[_0x3339('0x3')]},'exitAt':{'type':Sequelize[_0x3339('0x3')]},'reason':{'type':Sequelize[_0x3339('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 3280018..07d2071 100644 --- a/server/api/faxQueueReport/faxQueueReport.controller.js +++ b/server/api/faxQueueReport/faxQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1752=['name','send','index','map','type','query','keys','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','FaxQueueReport','includeAll','findAll','catch','show','params','fields','include','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../mysqldb','status','end','json','offset','undefined','count','limit','Content-Range','reject','update','then','destroy','error','stack'];(function(_0x4d861e,_0x1e1183){var _0x10c0c0=function(_0x2b86c7){while(--_0x2b86c7){_0x4d861e['push'](_0x4d861e['shift']());}};_0x10c0c0(++_0x1e1183);}(_0x1752,0xa5));var _0x2175=function(_0x9597d7,_0x47cedb){_0x9597d7=_0x9597d7-0x0;var _0x144ca2=_0x1752[_0x9597d7];return _0x144ca2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2175('0x0'));var zipdir=require(_0x2175('0x1'));var jsonpatch=require(_0x2175('0x2'));var rp=require(_0x2175('0x3'));var moment=require(_0x2175('0x4'));var BPromise=require(_0x2175('0x5'));var Mustache=require('mustache');var util=require(_0x2175('0x6'));var path=require(_0x2175('0x7'));var sox=require(_0x2175('0x8'));var csv=require(_0x2175('0x9'));var ejs=require(_0x2175('0xa'));var fs=require('fs');var fs_extra=require(_0x2175('0xb'));var _=require(_0x2175('0xc'));var squel=require(_0x2175('0xd'));var crypto=require(_0x2175('0xe'));var jsforce=require(_0x2175('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x2175('0x9'));var querystring=require(_0x2175('0x10'));var Papa=require(_0x2175('0x11'));var Redis=require(_0x2175('0x12'));var authService=require(_0x2175('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2175('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2175('0x15'))['db'];function respondWithStatusCode(_0x5bc446,_0x43be3c){_0x43be3c=_0x43be3c||0xcc;return function(_0x393c02){if(_0x393c02){return _0x5bc446['sendStatus'](_0x43be3c);}return _0x5bc446[_0x2175('0x16')](_0x43be3c)[_0x2175('0x17')]();};}function respondWithResult(_0x45df73,_0x3bc01f){_0x3bc01f=_0x3bc01f||0xc8;return function(_0x21d4cd){if(_0x21d4cd){return _0x45df73[_0x2175('0x16')](_0x3bc01f)[_0x2175('0x18')](_0x21d4cd);}};}function respondWithFilteredResult(_0x413688,_0x5d84db){return function(_0x55b798){if(_0x55b798){var _0x371b42=typeof _0x5d84db[_0x2175('0x19')]===_0x2175('0x1a')&&typeof _0x5d84db['limit']==='undefined';var _0x588b0b=_0x55b798[_0x2175('0x1b')];var _0x377586=_0x371b42?0x0:_0x5d84db['offset'];var _0x53576c=_0x371b42?_0x55b798[_0x2175('0x1b')]:_0x5d84db[_0x2175('0x19')]+_0x5d84db[_0x2175('0x1c')];var _0x51628d;if(_0x53576c>=_0x588b0b){_0x53576c=_0x588b0b;_0x51628d=0xc8;}else{_0x51628d=0xce;}_0x413688[_0x2175('0x16')](_0x51628d);return _0x413688['set'](_0x2175('0x1d'),_0x377586+'-'+_0x53576c+'/'+_0x588b0b)['json'](_0x55b798);}return null;};}function patchUpdates(_0x37818a){return function(_0x4ec36c){try{jsonpatch['apply'](_0x4ec36c,_0x37818a,!![]);}catch(_0x5344af){return BPromise[_0x2175('0x1e')](_0x5344af);}return _0x4ec36c['save']();};}function saveUpdates(_0x28c4b8,_0x46ea57){return function(_0x2dd77b){if(_0x2dd77b){return _0x2dd77b[_0x2175('0x1f')](_0x28c4b8)[_0x2175('0x20')](function(_0x12d150){return _0x12d150;});}return null;};}function removeEntity(_0x5ac63e,_0x49d4b9){return function(_0x3d849e){if(_0x3d849e){return _0x3d849e[_0x2175('0x21')]()[_0x2175('0x20')](function(){_0x5ac63e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x9c6374,_0xe252f0){return function(_0x2204cd){if(!_0x2204cd){_0x9c6374['sendStatus'](0x194);}return _0x2204cd;};}function handleError(_0x224fa3,_0x4d2120){_0x4d2120=_0x4d2120||0x1f4;return function(_0x5e696c){logger[_0x2175('0x22')](_0x5e696c[_0x2175('0x23')]);if(_0x5e696c[_0x2175('0x24')]){delete _0x5e696c[_0x2175('0x24')];}_0x224fa3[_0x2175('0x16')](_0x4d2120)[_0x2175('0x25')](_0x5e696c);};}exports[_0x2175('0x26')]=function(_0x40d8c8,_0x1b807b){var _0x1c721d={},_0x7b6edb={},_0x56dcf9={'count':0x0,'rows':[]};var _0x20fccf=_[_0x2175('0x27')](db['FaxQueueReport']['rawAttributes'],function(_0x3d64ac){return{'name':_0x3d64ac['fieldName'],'type':_0x3d64ac[_0x2175('0x28')]['key']};});_0x7b6edb['model']=_['map'](_0x20fccf,_0x2175('0x24'));_0x7b6edb[_0x2175('0x29')]=_[_0x2175('0x2a')](_0x40d8c8[_0x2175('0x29')]);_0x7b6edb['filters']=_[_0x2175('0x2b')](_0x7b6edb[_0x2175('0x2c')],_0x7b6edb['query']);_0x1c721d[_0x2175('0x2d')]=_[_0x2175('0x2b')](_0x7b6edb['model'],qs['fields'](_0x40d8c8['query']['fields']));_0x1c721d[_0x2175('0x2d')]=_0x1c721d[_0x2175('0x2d')][_0x2175('0x2e')]?_0x1c721d[_0x2175('0x2d')]:_0x7b6edb[_0x2175('0x2c')];if(!_0x40d8c8[_0x2175('0x29')][_0x2175('0x2f')](_0x2175('0x30'))){_0x1c721d['limit']=qs['limit'](_0x40d8c8['query']['limit']);_0x1c721d['offset']=qs[_0x2175('0x19')](_0x40d8c8[_0x2175('0x29')]['offset']);}_0x1c721d[_0x2175('0x31')]=qs[_0x2175('0x32')](_0x40d8c8[_0x2175('0x29')][_0x2175('0x32')]);_0x1c721d[_0x2175('0x33')]=qs[_0x2175('0x34')](_['pick'](_0x40d8c8[_0x2175('0x29')],_0x7b6edb[_0x2175('0x34')]),_0x20fccf);if(_0x40d8c8[_0x2175('0x29')][_0x2175('0x35')]){_0x1c721d[_0x2175('0x33')]=_[_0x2175('0x36')](_0x1c721d[_0x2175('0x33')],{'$or':_[_0x2175('0x27')](_0x20fccf,function(_0x38c212){if(_0x38c212[_0x2175('0x28')]!==_0x2175('0x37')){var _0x4be65c={};_0x4be65c[_0x38c212[_0x2175('0x24')]]={'$like':'%'+_0x40d8c8[_0x2175('0x29')][_0x2175('0x35')]+'%'};return _0x4be65c;}})});}_0x1c721d=_['merge']({},_0x1c721d,_0x40d8c8['options']);var _0x932bb6={'where':_0x1c721d['where']};return db[_0x2175('0x38')][_0x2175('0x1b')](_0x932bb6)[_0x2175('0x20')](function(_0x4989df){_0x56dcf9['count']=_0x4989df;if(_0x40d8c8[_0x2175('0x29')][_0x2175('0x39')]){_0x1c721d['include']=[{'all':!![]}];}return db['FaxQueueReport'][_0x2175('0x3a')](_0x1c721d);})[_0x2175('0x20')](function(_0x61784d){_0x56dcf9['rows']=_0x61784d;return _0x56dcf9;})[_0x2175('0x20')](respondWithFilteredResult(_0x1b807b,_0x1c721d))[_0x2175('0x3b')](handleError(_0x1b807b,null));};exports[_0x2175('0x3c')]=function(_0x5a6679,_0x49cf7d){var _0x459cee={'raw':!![],'where':{'id':_0x5a6679[_0x2175('0x3d')]['id']}},_0x47f60d={};_0x47f60d[_0x2175('0x2c')]=_['keys'](db['FaxQueueReport']['rawAttributes']);_0x47f60d[_0x2175('0x29')]=_['keys'](_0x5a6679['query']);_0x47f60d[_0x2175('0x34')]=_['intersection'](_0x47f60d[_0x2175('0x2c')],_0x47f60d[_0x2175('0x29')]);_0x459cee[_0x2175('0x2d')]=_[_0x2175('0x2b')](_0x47f60d[_0x2175('0x2c')],qs[_0x2175('0x3e')](_0x5a6679['query'][_0x2175('0x3e')]));_0x459cee[_0x2175('0x2d')]=_0x459cee[_0x2175('0x2d')][_0x2175('0x2e')]?_0x459cee[_0x2175('0x2d')]:_0x47f60d[_0x2175('0x2c')];if(_0x5a6679['query'][_0x2175('0x39')]){_0x459cee[_0x2175('0x3f')]=[{'all':!![]}];}_0x459cee=_[_0x2175('0x36')]({},_0x459cee,_0x5a6679['options']);return db[_0x2175('0x38')]['find'](_0x459cee)['then'](handleEntityNotFound(_0x49cf7d,null))[_0x2175('0x20')](respondWithResult(_0x49cf7d,null))[_0x2175('0x3b')](handleError(_0x49cf7d,null));};exports[_0x2175('0x40')]=function(_0x5ee4aa,_0x32d6eb){return db[_0x2175('0x38')][_0x2175('0x40')](_0x5ee4aa[_0x2175('0x41')],{})[_0x2175('0x20')](respondWithResult(_0x32d6eb,0xc9))['catch'](handleError(_0x32d6eb,null));};exports['update']=function(_0xdb0a97,_0xeaabe3){if(_0xdb0a97[_0x2175('0x41')]['id']){delete _0xdb0a97[_0x2175('0x41')]['id'];}return db[_0x2175('0x38')]['find']({'where':{'id':_0xdb0a97[_0x2175('0x3d')]['id']}})[_0x2175('0x20')](handleEntityNotFound(_0xeaabe3,null))[_0x2175('0x20')](saveUpdates(_0xdb0a97['body'],null))['then'](respondWithResult(_0xeaabe3,null))[_0x2175('0x3b')](handleError(_0xeaabe3,null));};exports['destroy']=function(_0x5af419,_0x5bab81){return db['FaxQueueReport'][_0x2175('0x42')]({'where':{'id':_0x5af419[_0x2175('0x3d')]['id']}})['then'](handleEntityNotFound(_0x5bab81,null))['then'](removeEntity(_0x5bab81,null))['catch'](handleError(_0x5bab81,null));};exports['describe']=function(_0x3ed1bf,_0x7c2c1f){return db['FaxQueueReport']['describe']()[_0x2175('0x20')](respondWithResult(_0x7c2c1f,null))[_0x2175('0x3b')](handleError(_0x7c2c1f,null));}; \ No newline at end of file +var _0x688a=['eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','json','offset','undefined','limit','set','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','FaxQueueReport','rawAttributes','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','filter','merge','options','count','include','findAll','rows','show','params','length','includeAll','find','catch','create','body','describe'];(function(_0x15bd72,_0x3aa19f){var _0x49204c=function(_0xd53592){while(--_0xd53592){_0x15bd72['push'](_0x15bd72['shift']());}};_0x49204c(++_0x3aa19f);}(_0x688a,0x124));var _0xa688=function(_0x10c1e5,_0x38988f){_0x10c1e5=_0x10c1e5-0x0;var _0x3fe7e6=_0x688a[_0x10c1e5];return _0x3fe7e6;};'use strict';var emlformat=require(_0xa688('0x0'));var rimraf=require(_0xa688('0x1'));var zipdir=require(_0xa688('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa688('0x3'));var moment=require('moment');var BPromise=require(_0xa688('0x4'));var Mustache=require(_0xa688('0x5'));var util=require('util');var path=require(_0xa688('0x6'));var sox=require(_0xa688('0x7'));var csv=require(_0xa688('0x8'));var ejs=require(_0xa688('0x9'));var fs=require('fs');var fs_extra=require(_0xa688('0xa'));var _=require(_0xa688('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa688('0xc'));var deskjs=require(_0xa688('0xd'));var toCsv=require(_0xa688('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa688('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa688('0xf'));var hardwareService=require(_0xa688('0x10'));var logger=require(_0xa688('0x11'))(_0xa688('0x12'));var utils=require(_0xa688('0x13'));var config=require(_0xa688('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50f101,_0x1dc3d3){_0x1dc3d3=_0x1dc3d3||0xcc;return function(_0x33eed4){if(_0x33eed4){return _0x50f101['sendStatus'](_0x1dc3d3);}return _0x50f101[_0xa688('0x15')](_0x1dc3d3)['end']();};}function respondWithResult(_0x10c371,_0x43159e){_0x43159e=_0x43159e||0xc8;return function(_0x506fca){if(_0x506fca){return _0x10c371['status'](_0x43159e)[_0xa688('0x16')](_0x506fca);}};}function respondWithFilteredResult(_0x4c7442,_0x1a55c2){return function(_0x5b8b1f){if(_0x5b8b1f){var _0xe776d6=typeof _0x1a55c2[_0xa688('0x17')]===_0xa688('0x18')&&typeof _0x1a55c2[_0xa688('0x19')]===_0xa688('0x18');var _0x10fc2d=_0x5b8b1f['count'];var _0x59e392=_0xe776d6?0x0:_0x1a55c2[_0xa688('0x17')];var _0x1330d5=_0xe776d6?_0x5b8b1f['count']:_0x1a55c2['offset']+_0x1a55c2[_0xa688('0x19')];var _0x2085bf;if(_0x1330d5>=_0x10fc2d){_0x1330d5=_0x10fc2d;_0x2085bf=0xc8;}else{_0x2085bf=0xce;}_0x4c7442['status'](_0x2085bf);return _0x4c7442[_0xa688('0x1a')]('Content-Range',_0x59e392+'-'+_0x1330d5+'/'+_0x10fc2d)['json'](_0x5b8b1f);}return null;};}function patchUpdates(_0x152cfe){return function(_0x466ae3){try{jsonpatch[_0xa688('0x1b')](_0x466ae3,_0x152cfe,!![]);}catch(_0x27f12e){return BPromise[_0xa688('0x1c')](_0x27f12e);}return _0x466ae3[_0xa688('0x1d')]();};}function saveUpdates(_0x7d9036,_0x203214){return function(_0x2a9f67){if(_0x2a9f67){return _0x2a9f67[_0xa688('0x1e')](_0x7d9036)[_0xa688('0x1f')](function(_0x301560){return _0x301560;});}return null;};}function removeEntity(_0x42643,_0x11133b){return function(_0x48cb17){if(_0x48cb17){return _0x48cb17[_0xa688('0x20')]()[_0xa688('0x1f')](function(){_0x42643['status'](0xcc)[_0xa688('0x21')]();});}};}function handleEntityNotFound(_0x1e3106,_0x53eec6){return function(_0x2898cb){if(!_0x2898cb){_0x1e3106[_0xa688('0x22')](0x194);}return _0x2898cb;};}function handleError(_0x1bc1c2,_0x25d1fa){_0x25d1fa=_0x25d1fa||0x1f4;return function(_0x153a86){logger[_0xa688('0x23')](_0x153a86[_0xa688('0x24')]);if(_0x153a86[_0xa688('0x25')]){delete _0x153a86[_0xa688('0x25')];}_0x1bc1c2[_0xa688('0x15')](_0x25d1fa)[_0xa688('0x26')](_0x153a86);};}exports[_0xa688('0x27')]=function(_0x3c7245,_0x12a35a){var _0x1d4cfa={},_0x5d1657={},_0x217a35={'count':0x0,'rows':[]};var _0x1bdd8e=_[_0xa688('0x28')](db[_0xa688('0x29')][_0xa688('0x2a')],function(_0x10fbce){return{'name':_0x10fbce['fieldName'],'type':_0x10fbce['type']['key']};});_0x5d1657[_0xa688('0x2b')]=_['map'](_0x1bdd8e,_0xa688('0x25'));_0x5d1657[_0xa688('0x2c')]=_[_0xa688('0x2d')](_0x3c7245[_0xa688('0x2c')]);_0x5d1657[_0xa688('0x2e')]=_[_0xa688('0x2f')](_0x5d1657[_0xa688('0x2b')],_0x5d1657['query']);_0x1d4cfa['attributes']=_['intersection'](_0x5d1657['model'],qs[_0xa688('0x30')](_0x3c7245[_0xa688('0x2c')][_0xa688('0x30')]));_0x1d4cfa['attributes']=_0x1d4cfa[_0xa688('0x31')]['length']?_0x1d4cfa['attributes']:_0x5d1657['model'];if(!_0x3c7245[_0xa688('0x2c')][_0xa688('0x32')](_0xa688('0x33'))){_0x1d4cfa['limit']=qs['limit'](_0x3c7245[_0xa688('0x2c')][_0xa688('0x19')]);_0x1d4cfa[_0xa688('0x17')]=qs[_0xa688('0x17')](_0x3c7245[_0xa688('0x2c')]['offset']);}_0x1d4cfa['order']=qs[_0xa688('0x34')](_0x3c7245['query'][_0xa688('0x34')]);_0x1d4cfa[_0xa688('0x35')]=qs[_0xa688('0x2e')](_[_0xa688('0x36')](_0x3c7245['query'],_0x5d1657[_0xa688('0x2e')]),_0x1bdd8e);if(_0x3c7245['query']['filter']){_0x1d4cfa[_0xa688('0x35')]=_['merge'](_0x1d4cfa[_0xa688('0x35')],{'$or':_['map'](_0x1bdd8e,function(_0x1f00a0){if(_0x1f00a0[_0xa688('0x37')]!==_0xa688('0x38')){var _0x573540={};_0x573540[_0x1f00a0[_0xa688('0x25')]]={'$like':'%'+_0x3c7245[_0xa688('0x2c')][_0xa688('0x39')]+'%'};return _0x573540;}})});}_0x1d4cfa=_[_0xa688('0x3a')]({},_0x1d4cfa,_0x3c7245[_0xa688('0x3b')]);var _0x20c815={'where':_0x1d4cfa[_0xa688('0x35')]};return db[_0xa688('0x29')][_0xa688('0x3c')](_0x20c815)[_0xa688('0x1f')](function(_0x220c90){_0x217a35['count']=_0x220c90;if(_0x3c7245[_0xa688('0x2c')]['includeAll']){_0x1d4cfa[_0xa688('0x3d')]=[{'all':!![]}];}return db[_0xa688('0x29')][_0xa688('0x3e')](_0x1d4cfa);})[_0xa688('0x1f')](function(_0x56a5e5){_0x217a35[_0xa688('0x3f')]=_0x56a5e5;return _0x217a35;})[_0xa688('0x1f')](respondWithFilteredResult(_0x12a35a,_0x1d4cfa))['catch'](handleError(_0x12a35a,null));};exports[_0xa688('0x40')]=function(_0x1a7081,_0x1a300d){var _0xdb6ce7={'raw':!![],'where':{'id':_0x1a7081[_0xa688('0x41')]['id']}},_0x3205d4={};_0x3205d4[_0xa688('0x2b')]=_[_0xa688('0x2d')](db[_0xa688('0x29')]['rawAttributes']);_0x3205d4[_0xa688('0x2c')]=_[_0xa688('0x2d')](_0x1a7081[_0xa688('0x2c')]);_0x3205d4[_0xa688('0x2e')]=_[_0xa688('0x2f')](_0x3205d4[_0xa688('0x2b')],_0x3205d4[_0xa688('0x2c')]);_0xdb6ce7[_0xa688('0x31')]=_['intersection'](_0x3205d4[_0xa688('0x2b')],qs[_0xa688('0x30')](_0x1a7081[_0xa688('0x2c')][_0xa688('0x30')]));_0xdb6ce7['attributes']=_0xdb6ce7[_0xa688('0x31')][_0xa688('0x42')]?_0xdb6ce7['attributes']:_0x3205d4[_0xa688('0x2b')];if(_0x1a7081[_0xa688('0x2c')][_0xa688('0x43')]){_0xdb6ce7[_0xa688('0x3d')]=[{'all':!![]}];}_0xdb6ce7=_[_0xa688('0x3a')]({},_0xdb6ce7,_0x1a7081[_0xa688('0x3b')]);return db['FaxQueueReport'][_0xa688('0x44')](_0xdb6ce7)[_0xa688('0x1f')](handleEntityNotFound(_0x1a300d,null))[_0xa688('0x1f')](respondWithResult(_0x1a300d,null))[_0xa688('0x45')](handleError(_0x1a300d,null));};exports[_0xa688('0x46')]=function(_0x56cb08,_0x49b3e0){return db[_0xa688('0x29')][_0xa688('0x46')](_0x56cb08[_0xa688('0x47')],{})[_0xa688('0x1f')](respondWithResult(_0x49b3e0,0xc9))[_0xa688('0x45')](handleError(_0x49b3e0,null));};exports['update']=function(_0x128191,_0x3c858c){if(_0x128191[_0xa688('0x47')]['id']){delete _0x128191[_0xa688('0x47')]['id'];}return db[_0xa688('0x29')][_0xa688('0x44')]({'where':{'id':_0x128191[_0xa688('0x41')]['id']}})['then'](handleEntityNotFound(_0x3c858c,null))[_0xa688('0x1f')](saveUpdates(_0x128191[_0xa688('0x47')],null))[_0xa688('0x1f')](respondWithResult(_0x3c858c,null))[_0xa688('0x45')](handleError(_0x3c858c,null));};exports['destroy']=function(_0x2904fd,_0x44a090){return db[_0xa688('0x29')][_0xa688('0x44')]({'where':{'id':_0x2904fd[_0xa688('0x41')]['id']}})[_0xa688('0x1f')](handleEntityNotFound(_0x44a090,null))['then'](removeEntity(_0x44a090,null))[_0xa688('0x45')](handleError(_0x44a090,null));};exports['describe']=function(_0x132615,_0x58753e){return db['FaxQueueReport'][_0xa688('0x48')]()[_0xa688('0x1f')](respondWithResult(_0x58753e,null))[_0xa688('0x45')](handleError(_0x58753e,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index c623b3e..f2e9c51 100644 --- a/server/api/faxQueueReport/faxQueueReport.model.js +++ b/server/api/faxQueueReport/faxQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fab=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','util','api'];(function(_0xfea467,_0xac0a06){var _0x29e3ed=function(_0x44eea3){while(--_0x44eea3){_0xfea467['push'](_0xfea467['shift']());}};_0x29e3ed(++_0xac0a06);}(_0x5fab,0x177));var _0xb5fa=function(_0x186872,_0x50a406){_0x186872=_0x186872-0x0;var _0x2f440d=_0x5fab[_0x186872];return _0x2f440d;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[{'name':_0xb5fa('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5fab=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','util','api'];(function(_0xd1c64a,_0x18c7b6){var _0xa0e6da=function(_0x4df84f){while(--_0x4df84f){_0xd1c64a['push'](_0xd1c64a['shift']());}};_0xa0e6da(++_0x18c7b6);}(_0x5fab,0x177));var _0xb5fa=function(_0x54861c,_0x8756fc){_0x54861c=_0x54861c-0x0;var _0x4786d6=_0x5fab[_0x54861c];return _0x4786d6;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[{'name':_0xb5fa('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 8886918..ecf662e 100644 --- a/server/api/faxQueueReport/faxQueueReport.rpc.js +++ b/server/api/faxQueueReport/faxQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1253=['attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','request\x20sent','debug','stringify','error','FaxQueueReport,\x20%s,\x20%s','message','result','catch','CreateFaxQueueReport','FaxQueueReport','options','raw','UpdateFaxQueueReport','body'];(function(_0x434804,_0x415f68){var _0x573fc8=function(_0x3ce265){while(--_0x3ce265){_0x434804['push'](_0x434804['shift']());}};_0x573fc8(++_0x415f68);}(_0x1253,0x1a6));var _0x3125=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x1253[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x3125('0x0'));var util=require(_0x3125('0x1'));var moment=require(_0x3125('0x2'));var BPromise=require(_0x3125('0x3'));var rs=require(_0x3125('0x4'));var fs=require('fs');var Redis=require(_0x3125('0x5'));var db=require(_0x3125('0x6'))['db'];var utils=require(_0x3125('0x7'));var logger=require(_0x3125('0x8'))(_0x3125('0x9'));var config=require(_0x3125('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x3125('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b9e79,_0x299619,_0x108d1c){return new BPromise(function(_0x5c55da,_0x5354a7){return client['request'](_0x3b9e79,_0x108d1c)[_0x3125('0xc')](function(_0x352d61){logger[_0x3125('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0x299619,_0x3125('0xe'));logger[_0x3125('0xf')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x299619,'request\x20sent',JSON[_0x3125('0x10')](_0x352d61));if(_0x352d61[_0x3125('0x11')]){if(_0x352d61[_0x3125('0x11')]['code']===0x1f4){logger['error'](_0x3125('0x12'),_0x299619,_0x352d61[_0x3125('0x11')]['message']);return _0x5354a7(_0x352d61[_0x3125('0x11')][_0x3125('0x13')]);}logger[_0x3125('0x11')](_0x3125('0x12'),_0x299619,_0x352d61[_0x3125('0x11')][_0x3125('0x13')]);return _0x5c55da(_0x352d61['error']['message']);}else{logger[_0x3125('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0x299619,_0x3125('0xe'));_0x5c55da(_0x352d61[_0x3125('0x14')][_0x3125('0x13')]);}})[_0x3125('0x15')](function(_0x5af84b){logger[_0x3125('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0x299619,_0x5af84b);_0x5354a7(_0x5af84b);});});}exports[_0x3125('0x16')]=function(_0xfd6cf4){var _0x5c8515=this;return new Promise(function(_0x5f2a75,_0xbdb6e7){return db[_0x3125('0x17')]['create'](_0xfd6cf4['body'],{'raw':_0xfd6cf4[_0x3125('0x18')]?_0xfd6cf4[_0x3125('0x18')][_0x3125('0x19')]===undefined?!![]:![]:!![]})[_0x3125('0xc')](function(_0x10616b){logger['info'](_0x3125('0x16'),_0xfd6cf4);logger[_0x3125('0xf')](_0x3125('0x16'),_0xfd6cf4,JSON[_0x3125('0x10')](_0x10616b));_0x5f2a75(_0x10616b);})['catch'](function(_0x1440e9){logger['error']('CreateFaxQueueReport',_0x1440e9[_0x3125('0x13')],_0xfd6cf4);_0xbdb6e7(_0x5c8515[_0x3125('0x11')](0x1f4,_0x1440e9[_0x3125('0x13')]));});});};exports[_0x3125('0x1a')]=function(_0x5511f5){var _0x4fd589=this;return new Promise(function(_0x3a865c,_0x55ba7e){return db[_0x3125('0x17')]['update'](_0x5511f5[_0x3125('0x1b')],{'raw':_0x5511f5[_0x3125('0x18')]?_0x5511f5[_0x3125('0x18')][_0x3125('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5511f5[_0x3125('0x18')]?_0x5511f5[_0x3125('0x18')]['where']||null:null,'attributes':_0x5511f5[_0x3125('0x18')]?_0x5511f5['options'][_0x3125('0x1c')]||null:null,'limit':_0x5511f5['options']?_0x5511f5[_0x3125('0x18')][_0x3125('0x1d')]||null:null})[_0x3125('0xc')](function(_0x5ef5f6){logger[_0x3125('0xd')]('UpdateFaxQueueReport',_0x5511f5);logger['debug'](_0x3125('0x1a'),_0x5511f5,JSON['stringify'](_0x5ef5f6));_0x3a865c(_0x5ef5f6);})[_0x3125('0x15')](function(_0x77ee18){logger[_0x3125('0x11')]('UpdateFaxQueueReport',_0x77ee18[_0x3125('0x13')],_0x5511f5);_0x55ba7e(_0x4fd589[_0x3125('0x11')](0x1f4,_0x77ee18['message']));});});}; \ No newline at end of file +var _0xebbf=['../../config/environment','jayson/promise','client','http','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','UpdateFaxQueueReport','update','limit','lodash','util','moment','../../config/utils','../../config/logger'];(function(_0x4cb6b6,_0x3cbc5e){var _0x4608ab=function(_0x550e72){while(--_0x550e72){_0x4cb6b6['push'](_0x4cb6b6['shift']());}};_0x4608ab(++_0x3cbc5e);}(_0xebbf,0x1ae));var _0xfebb=function(_0x2e5f9c,_0x134a52){_0x2e5f9c=_0x2e5f9c-0x0;var _0x538b44=_0xebbf[_0x2e5f9c];return _0x538b44;};'use strict';var _=require(_0xfebb('0x0'));var util=require(_0xfebb('0x1'));var moment=require(_0xfebb('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfebb('0x3'));var logger=require(_0xfebb('0x4'))('rpc');var config=require(_0xfebb('0x5'));var jayson=require(_0xfebb('0x6'));var client=jayson[_0xfebb('0x7')][_0xfebb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x30e69c,_0x1da2fb,_0x1b14c5){return new BPromise(function(_0x310a90,_0x4ce995){return client['request'](_0x30e69c,_0x1b14c5)[_0xfebb('0x9')](function(_0x4a58a5){logger[_0xfebb('0xa')](_0xfebb('0xb'),_0x1da2fb,_0xfebb('0xc'));logger[_0xfebb('0xd')](_0xfebb('0xe'),_0x1da2fb,'request\x20sent',JSON[_0xfebb('0xf')](_0x4a58a5));if(_0x4a58a5[_0xfebb('0x10')]){if(_0x4a58a5[_0xfebb('0x10')][_0xfebb('0x11')]===0x1f4){logger[_0xfebb('0x10')](_0xfebb('0xb'),_0x1da2fb,_0x4a58a5[_0xfebb('0x10')]['message']);return _0x4ce995(_0x4a58a5[_0xfebb('0x10')][_0xfebb('0x12')]);}logger[_0xfebb('0x10')]('FaxQueueReport,\x20%s,\x20%s',_0x1da2fb,_0x4a58a5[_0xfebb('0x10')]['message']);return _0x310a90(_0x4a58a5[_0xfebb('0x10')]['message']);}else{logger[_0xfebb('0xa')](_0xfebb('0xb'),_0x1da2fb,_0xfebb('0xc'));_0x310a90(_0x4a58a5['result']['message']);}})[_0xfebb('0x13')](function(_0x12292a){logger['error'](_0xfebb('0xb'),_0x1da2fb,_0x12292a);_0x4ce995(_0x12292a);});});}exports[_0xfebb('0x14')]=function(_0x5e4f84){var _0x273739=this;return new Promise(function(_0x368ecf,_0xa87de3){return db[_0xfebb('0x15')][_0xfebb('0x16')](_0x5e4f84[_0xfebb('0x17')],{'raw':_0x5e4f84[_0xfebb('0x18')]?_0x5e4f84['options'][_0xfebb('0x19')]===undefined?!![]:![]:!![]})[_0xfebb('0x9')](function(_0x18ad99){logger[_0xfebb('0xa')](_0xfebb('0x14'),_0x5e4f84);logger[_0xfebb('0xd')](_0xfebb('0x14'),_0x5e4f84,JSON[_0xfebb('0xf')](_0x18ad99));_0x368ecf(_0x18ad99);})['catch'](function(_0x53aefe){logger[_0xfebb('0x10')](_0xfebb('0x14'),_0x53aefe[_0xfebb('0x12')],_0x5e4f84);_0xa87de3(_0x273739[_0xfebb('0x10')](0x1f4,_0x53aefe[_0xfebb('0x12')]));});});};exports[_0xfebb('0x1a')]=function(_0x4a0316){var _0x5283c6=this;return new Promise(function(_0x218bef,_0x19cc0d){return db[_0xfebb('0x15')][_0xfebb('0x1b')](_0x4a0316[_0xfebb('0x17')],{'raw':_0x4a0316['options']?_0x4a0316[_0xfebb('0x18')][_0xfebb('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a0316[_0xfebb('0x18')]?_0x4a0316[_0xfebb('0x18')]['where']||null:null,'attributes':_0x4a0316[_0xfebb('0x18')]?_0x4a0316[_0xfebb('0x18')]['attributes']||null:null,'limit':_0x4a0316[_0xfebb('0x18')]?_0x4a0316[_0xfebb('0x18')][_0xfebb('0x1c')]||null:null})[_0xfebb('0x9')](function(_0x4b1d3a){logger[_0xfebb('0xa')](_0xfebb('0x1a'),_0x4a0316);logger[_0xfebb('0xd')](_0xfebb('0x1a'),_0x4a0316,JSON[_0xfebb('0xf')](_0x4b1d3a));_0x218bef(_0x4b1d3a);})[_0xfebb('0x13')](function(_0x20ce28){logger[_0xfebb('0x10')](_0xfebb('0x1a'),_0x20ce28['message'],_0x4a0316);_0x19cc0d(_0x5283c6['error'](0x1f4,_0x20ce28[_0xfebb('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index e0bee9c..bfcb35b 100644 --- a/server/api/faxQueueReport/index.js +++ b/server/api/faxQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8692=['get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x240f20,_0x3347d5){var _0x4c4da4=function(_0x3fe32e){while(--_0x3fe32e){_0x240f20['push'](_0x240f20['shift']());}};_0x4c4da4(++_0x3347d5);}(_0x8692,0x199));var _0x2869=function(_0x522dd2,_0x1a6b38){_0x522dd2=_0x522dd2-0x0;var _0x3ba7d8=_0x8692[_0x522dd2];return _0x3ba7d8;};'use strict';var multer=require(_0x2869('0x0'));var util=require(_0x2869('0x1'));var path=require(_0x2869('0x2'));var timeout=require(_0x2869('0x3'));var express=require(_0x2869('0x4'));var router=express[_0x2869('0x5')]();var fs_extra=require(_0x2869('0x6'));var auth=require(_0x2869('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x2869('0x8'));var controller=require('./faxQueueReport.controller');router[_0x2869('0x9')]('/',auth[_0x2869('0xa')](),controller[_0x2869('0xb')]);router[_0x2869('0x9')](_0x2869('0xc'),auth['isAuthenticated'](),controller[_0x2869('0xd')]);router[_0x2869('0x9')](_0x2869('0xe'),auth[_0x2869('0xa')](),controller[_0x2869('0xf')]);router['post']('/',auth[_0x2869('0xa')](),controller[_0x2869('0x10')]);router[_0x2869('0x11')](_0x2869('0xe'),auth['isAuthenticated'](),controller[_0x2869('0x12')]);router[_0x2869('0x13')](_0x2869('0xe'),auth['isAuthenticated'](),controller[_0x2869('0x14')]);module[_0x2869('0x15')]=router; \ No newline at end of file +var _0xc31b=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','/describe','describe','post','create','put','/:id','update','delete','destroy','multer','util','path'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xc31b,0x189));var _0xbc31=function(_0x357b49,_0x57e9e2){_0x357b49=_0x357b49-0x0;var _0x5840ec=_0xc31b[_0x357b49];return _0x5840ec;};'use strict';var multer=require(_0xbc31('0x0'));var util=require(_0xbc31('0x1'));var path=require(_0xbc31('0x2'));var timeout=require(_0xbc31('0x3'));var express=require(_0xbc31('0x4'));var router=express[_0xbc31('0x5')]();var fs_extra=require(_0xbc31('0x6'));var auth=require(_0xbc31('0x7'));var interaction=require(_0xbc31('0x8'));var config=require(_0xbc31('0x9'));var controller=require(_0xbc31('0xa'));router[_0xbc31('0xb')]('/',auth[_0xbc31('0xc')](),controller['index']);router[_0xbc31('0xb')](_0xbc31('0xd'),auth[_0xbc31('0xc')](),controller[_0xbc31('0xe')]);router[_0xbc31('0xb')]('/:id',auth[_0xbc31('0xc')](),controller['show']);router[_0xbc31('0xf')]('/',auth[_0xbc31('0xc')](),controller[_0xbc31('0x10')]);router[_0xbc31('0x11')](_0xbc31('0x12'),auth[_0xbc31('0xc')](),controller[_0xbc31('0x13')]);router[_0xbc31('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xbc31('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 41d08fd..a623dd9 100644 --- a/server/api/faxTransferReport/faxTransferReport.attributes.js +++ b/server/api/faxTransferReport/faxTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x552da2,_0x154e1f){var _0x3d6bf0=function(_0xbeef92){while(--_0xbeef92){_0x552da2['push'](_0x552da2['shift']());}};_0x3d6bf0(++_0x154e1f);}(_0xedd9,0xfc));var _0x9edd=function(_0x5d4298,_0x5217f9){_0x5d4298=_0x5d4298-0x0;var _0x16effc=_0xedd9[_0x5d4298];return _0x16effc;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file +var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0xe75596,_0x181f3c){var _0x2dc99a=function(_0x44f71d){while(--_0x44f71d){_0xe75596['push'](_0xe75596['shift']());}};_0x2dc99a(++_0x181f3c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index ef2d262..9e41e37 100644 --- a/server/api/faxTransferReport/faxTransferReport.controller.js +++ b/server/api/faxTransferReport/faxTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf390=['save','update','error','stack','name','send','index','FaxTransferReport','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','filter','where','merge','options','then','includeAll','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','set','json','apply'];(function(_0x2eb002,_0x1ff1be){var _0x50d03a=function(_0x25059e){while(--_0x25059e){_0x2eb002['push'](_0x2eb002['shift']());}};_0x50d03a(++_0x1ff1be);}(_0xf390,0xbb));var _0x0f39=function(_0x75b6b8,_0x2eeb9c){_0x75b6b8=_0x75b6b8-0x0;var _0x18109b=_0xf390[_0x75b6b8];return _0x18109b;};'use strict';var emlformat=require(_0x0f39('0x0'));var rimraf=require(_0x0f39('0x1'));var zipdir=require(_0x0f39('0x2'));var jsonpatch=require(_0x0f39('0x3'));var rp=require(_0x0f39('0x4'));var moment=require('moment');var BPromise=require(_0x0f39('0x5'));var Mustache=require(_0x0f39('0x6'));var util=require('util');var path=require('path');var sox=require(_0x0f39('0x7'));var csv=require(_0x0f39('0x8'));var ejs=require(_0x0f39('0x9'));var fs=require('fs');var fs_extra=require(_0x0f39('0xa'));var _=require(_0x0f39('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0f39('0xc'));var deskjs=require(_0x0f39('0xd'));var toCsv=require(_0x0f39('0x8'));var querystring=require(_0x0f39('0xe'));var Papa=require(_0x0f39('0xf'));var Redis=require('ioredis');var authService=require(_0x0f39('0x10'));var qs=require(_0x0f39('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0f39('0x12'));var logger=require(_0x0f39('0x13'))(_0x0f39('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0f39('0x15'));var db=require(_0x0f39('0x16'))['db'];function respondWithStatusCode(_0x34b3e0,_0x2822e8){_0x2822e8=_0x2822e8||0xcc;return function(_0x21fe48){if(_0x21fe48){return _0x34b3e0[_0x0f39('0x17')](_0x2822e8);}return _0x34b3e0[_0x0f39('0x18')](_0x2822e8)[_0x0f39('0x19')]();};}function respondWithResult(_0x4da089,_0x3e6424){_0x3e6424=_0x3e6424||0xc8;return function(_0x567858){if(_0x567858){return _0x4da089['status'](_0x3e6424)['json'](_0x567858);}};}function respondWithFilteredResult(_0x582974,_0x119cf0){return function(_0x439467){if(_0x439467){var _0xbf1cc1=typeof _0x119cf0['offset']==='undefined'&&typeof _0x119cf0['limit']===_0x0f39('0x1a');var _0x58a60a=_0x439467[_0x0f39('0x1b')];var _0x585902=_0xbf1cc1?0x0:_0x119cf0[_0x0f39('0x1c')];var _0x544613=_0xbf1cc1?_0x439467['count']:_0x119cf0[_0x0f39('0x1c')]+_0x119cf0['limit'];var _0x4e7404;if(_0x544613>=_0x58a60a){_0x544613=_0x58a60a;_0x4e7404=0xc8;}else{_0x4e7404=0xce;}_0x582974['status'](_0x4e7404);return _0x582974[_0x0f39('0x1d')]('Content-Range',_0x585902+'-'+_0x544613+'/'+_0x58a60a)[_0x0f39('0x1e')](_0x439467);}return null;};}function patchUpdates(_0x4fb0a7){return function(_0x4ff14f){try{jsonpatch[_0x0f39('0x1f')](_0x4ff14f,_0x4fb0a7,!![]);}catch(_0x31faaf){return BPromise['reject'](_0x31faaf);}return _0x4ff14f[_0x0f39('0x20')]();};}function saveUpdates(_0x29fe02,_0x360c1a){return function(_0xf33288){if(_0xf33288){return _0xf33288[_0x0f39('0x21')](_0x29fe02)['then'](function(_0x1599d0){return _0x1599d0;});}return null;};}function removeEntity(_0x22c994,_0x280418){return function(_0x5bef9b){if(_0x5bef9b){return _0x5bef9b['destroy']()['then'](function(){_0x22c994['status'](0xcc)[_0x0f39('0x19')]();});}};}function handleEntityNotFound(_0x4a13d0,_0x13465d){return function(_0x44ab7d){if(!_0x44ab7d){_0x4a13d0[_0x0f39('0x17')](0x194);}return _0x44ab7d;};}function handleError(_0xca58b1,_0x356629){_0x356629=_0x356629||0x1f4;return function(_0x3ab09b){logger[_0x0f39('0x22')](_0x3ab09b[_0x0f39('0x23')]);if(_0x3ab09b['name']){delete _0x3ab09b[_0x0f39('0x24')];}_0xca58b1['status'](_0x356629)[_0x0f39('0x25')](_0x3ab09b);};}exports[_0x0f39('0x26')]=function(_0x218f27,_0x4c191b){var _0x3280e7={},_0x4780cf={},_0x2cd24a={'count':0x0,'rows':[]};var _0x239041=_['map'](db[_0x0f39('0x27')][_0x0f39('0x28')],function(_0x27e938){return{'name':_0x27e938[_0x0f39('0x29')],'type':_0x27e938[_0x0f39('0x2a')][_0x0f39('0x2b')]};});_0x4780cf[_0x0f39('0x2c')]=_[_0x0f39('0x2d')](_0x239041,_0x0f39('0x24'));_0x4780cf['query']=_[_0x0f39('0x2e')](_0x218f27[_0x0f39('0x2f')]);_0x4780cf[_0x0f39('0x30')]=_['intersection'](_0x4780cf[_0x0f39('0x2c')],_0x4780cf[_0x0f39('0x2f')]);_0x3280e7['attributes']=_[_0x0f39('0x31')](_0x4780cf[_0x0f39('0x2c')],qs[_0x0f39('0x32')](_0x218f27['query'][_0x0f39('0x32')]));_0x3280e7['attributes']=_0x3280e7[_0x0f39('0x33')][_0x0f39('0x34')]?_0x3280e7[_0x0f39('0x33')]:_0x4780cf[_0x0f39('0x2c')];if(!_0x218f27['query'][_0x0f39('0x35')](_0x0f39('0x36'))){_0x3280e7[_0x0f39('0x37')]=qs[_0x0f39('0x37')](_0x218f27[_0x0f39('0x2f')][_0x0f39('0x37')]);_0x3280e7[_0x0f39('0x1c')]=qs['offset'](_0x218f27[_0x0f39('0x2f')][_0x0f39('0x1c')]);}_0x3280e7[_0x0f39('0x38')]=qs[_0x0f39('0x39')](_0x218f27[_0x0f39('0x2f')][_0x0f39('0x39')]);_0x3280e7['where']=qs[_0x0f39('0x30')](_['pick'](_0x218f27[_0x0f39('0x2f')],_0x4780cf['filters']),_0x239041);if(_0x218f27[_0x0f39('0x2f')][_0x0f39('0x3a')]){_0x3280e7[_0x0f39('0x3b')]=_[_0x0f39('0x3c')](_0x3280e7[_0x0f39('0x3b')],{'$or':_[_0x0f39('0x2d')](_0x239041,function(_0x2a9a45){if(_0x2a9a45[_0x0f39('0x2a')]!=='VIRTUAL'){var _0x2446a8={};_0x2446a8[_0x2a9a45['name']]={'$like':'%'+_0x218f27[_0x0f39('0x2f')][_0x0f39('0x3a')]+'%'};return _0x2446a8;}})});}_0x3280e7=_['merge']({},_0x3280e7,_0x218f27[_0x0f39('0x3d')]);var _0x4a671c={'where':_0x3280e7[_0x0f39('0x3b')]};return db['FaxTransferReport'][_0x0f39('0x1b')](_0x4a671c)[_0x0f39('0x3e')](function(_0x516571){_0x2cd24a[_0x0f39('0x1b')]=_0x516571;if(_0x218f27[_0x0f39('0x2f')][_0x0f39('0x3f')]){_0x3280e7['include']=[{'all':!![]}];}return db[_0x0f39('0x27')][_0x0f39('0x40')](_0x3280e7);})[_0x0f39('0x3e')](function(_0x4fe424){_0x2cd24a[_0x0f39('0x41')]=_0x4fe424;return _0x2cd24a;})[_0x0f39('0x3e')](respondWithFilteredResult(_0x4c191b,_0x3280e7))[_0x0f39('0x42')](handleError(_0x4c191b,null));};exports[_0x0f39('0x43')]=function(_0x5dae81,_0x105455){var _0x39cfcb={'raw':!![],'where':{'id':_0x5dae81[_0x0f39('0x44')]['id']}},_0x578f8b={};_0x578f8b['model']=_[_0x0f39('0x2e')](db[_0x0f39('0x27')]['rawAttributes']);_0x578f8b['query']=_[_0x0f39('0x2e')](_0x5dae81[_0x0f39('0x2f')]);_0x578f8b[_0x0f39('0x30')]=_[_0x0f39('0x31')](_0x578f8b[_0x0f39('0x2c')],_0x578f8b[_0x0f39('0x2f')]);_0x39cfcb['attributes']=_['intersection'](_0x578f8b[_0x0f39('0x2c')],qs[_0x0f39('0x32')](_0x5dae81[_0x0f39('0x2f')]['fields']));_0x39cfcb[_0x0f39('0x33')]=_0x39cfcb[_0x0f39('0x33')][_0x0f39('0x34')]?_0x39cfcb[_0x0f39('0x33')]:_0x578f8b[_0x0f39('0x2c')];if(_0x5dae81[_0x0f39('0x2f')][_0x0f39('0x3f')]){_0x39cfcb['include']=[{'all':!![]}];}_0x39cfcb=_[_0x0f39('0x3c')]({},_0x39cfcb,_0x5dae81[_0x0f39('0x3d')]);return db[_0x0f39('0x27')][_0x0f39('0x45')](_0x39cfcb)[_0x0f39('0x3e')](handleEntityNotFound(_0x105455,null))['then'](respondWithResult(_0x105455,null))[_0x0f39('0x42')](handleError(_0x105455,null));};exports[_0x0f39('0x46')]=function(_0x5635dc,_0x5b5716){return db['FaxTransferReport'][_0x0f39('0x46')](_0x5635dc[_0x0f39('0x47')],{})['then'](respondWithResult(_0x5b5716,0xc9))['catch'](handleError(_0x5b5716,null));};exports[_0x0f39('0x21')]=function(_0xdb86b4,_0x2baefd){if(_0xdb86b4['body']['id']){delete _0xdb86b4[_0x0f39('0x47')]['id'];}return db['FaxTransferReport'][_0x0f39('0x45')]({'where':{'id':_0xdb86b4[_0x0f39('0x44')]['id']}})[_0x0f39('0x3e')](handleEntityNotFound(_0x2baefd,null))[_0x0f39('0x3e')](saveUpdates(_0xdb86b4[_0x0f39('0x47')],null))[_0x0f39('0x3e')](respondWithResult(_0x2baefd,null))[_0x0f39('0x42')](handleError(_0x2baefd,null));};exports['destroy']=function(_0x3531bb,_0x2fca44){return db['FaxTransferReport'][_0x0f39('0x45')]({'where':{'id':_0x3531bb[_0x0f39('0x44')]['id']}})[_0x0f39('0x3e')](handleEntityNotFound(_0x2fca44,null))['then'](removeEntity(_0x2fca44,null))[_0x0f39('0x42')](handleError(_0x2fca44,null));};exports[_0x0f39('0x48')]=function(_0x4bb5b0,_0x23e01e){return db[_0x0f39('0x27')][_0x0f39('0x48')]()[_0x0f39('0x3e')](respondWithResult(_0x23e01e,null))[_0x0f39('0x42')](handleError(_0x23e01e,null));}; \ No newline at end of file +var _0x37ff=['params','keys','find','create','body','describe','eml-format','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','offset','undefined','limit','count','set','apply','save','update','destroy','then','error','stack','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','type','filter','options','findAll','catch','show'];(function(_0x55da2a,_0x4ac545){var _0x2803ab=function(_0x5a7eef){while(--_0x5a7eef){_0x55da2a['push'](_0x55da2a['shift']());}};_0x2803ab(++_0x4ac545);}(_0x37ff,0x164));var _0xf37f=function(_0x5532e1,_0x388cd1){_0x5532e1=_0x5532e1-0x0;var _0x276bb5=_0x37ff[_0x5532e1];return _0x276bb5;};'use strict';var emlformat=require(_0xf37f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf37f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf37f('0x2'));var moment=require(_0xf37f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf37f('0x4'));var util=require(_0xf37f('0x5'));var path=require(_0xf37f('0x6'));var sox=require('sox');var csv=require(_0xf37f('0x7'));var ejs=require(_0xf37f('0x8'));var fs=require('fs');var fs_extra=require(_0xf37f('0x9'));var _=require(_0xf37f('0xa'));var squel=require('squel');var crypto=require(_0xf37f('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf37f('0xc'));var toCsv=require(_0xf37f('0x7'));var querystring=require(_0xf37f('0xd'));var Papa=require('papaparse');var Redis=require(_0xf37f('0xe'));var authService=require(_0xf37f('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xf37f('0x10'));var hardwareService=require(_0xf37f('0x11'));var logger=require('../../config/logger')(_0xf37f('0x12'));var utils=require(_0xf37f('0x13'));var config=require(_0xf37f('0x14'));var licenseUtil=require(_0xf37f('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x489691,_0x5c36de){_0x5c36de=_0x5c36de||0xcc;return function(_0x14de00){if(_0x14de00){return _0x489691['sendStatus'](_0x5c36de);}return _0x489691['status'](_0x5c36de)[_0xf37f('0x16')]();};}function respondWithResult(_0x2ed421,_0x3a2ecd){_0x3a2ecd=_0x3a2ecd||0xc8;return function(_0x52dfb1){if(_0x52dfb1){return _0x2ed421[_0xf37f('0x17')](_0x3a2ecd)[_0xf37f('0x18')](_0x52dfb1);}};}function respondWithFilteredResult(_0x4bf844,_0x1ca93a){return function(_0x2e2d85){if(_0x2e2d85){var _0xb4d397=typeof _0x1ca93a[_0xf37f('0x19')]===_0xf37f('0x1a')&&typeof _0x1ca93a[_0xf37f('0x1b')]===_0xf37f('0x1a');var _0x5c964f=_0x2e2d85[_0xf37f('0x1c')];var _0x18e4c1=_0xb4d397?0x0:_0x1ca93a[_0xf37f('0x19')];var _0x6a7b48=_0xb4d397?_0x2e2d85[_0xf37f('0x1c')]:_0x1ca93a[_0xf37f('0x19')]+_0x1ca93a[_0xf37f('0x1b')];var _0x59c7e7;if(_0x6a7b48>=_0x5c964f){_0x6a7b48=_0x5c964f;_0x59c7e7=0xc8;}else{_0x59c7e7=0xce;}_0x4bf844[_0xf37f('0x17')](_0x59c7e7);return _0x4bf844[_0xf37f('0x1d')]('Content-Range',_0x18e4c1+'-'+_0x6a7b48+'/'+_0x5c964f)[_0xf37f('0x18')](_0x2e2d85);}return null;};}function patchUpdates(_0x11cc77){return function(_0x1bca86){try{jsonpatch[_0xf37f('0x1e')](_0x1bca86,_0x11cc77,!![]);}catch(_0x5b95bf){return BPromise['reject'](_0x5b95bf);}return _0x1bca86[_0xf37f('0x1f')]();};}function saveUpdates(_0x59c544,_0x291a5a){return function(_0x301320){if(_0x301320){return _0x301320[_0xf37f('0x20')](_0x59c544)['then'](function(_0x1a26b1){return _0x1a26b1;});}return null;};}function removeEntity(_0x4f2224,_0x9d0a2a){return function(_0x2a535b){if(_0x2a535b){return _0x2a535b[_0xf37f('0x21')]()[_0xf37f('0x22')](function(){_0x4f2224['status'](0xcc)[_0xf37f('0x16')]();});}};}function handleEntityNotFound(_0x34e64e,_0x5e300f){return function(_0x27a5ed){if(!_0x27a5ed){_0x34e64e['sendStatus'](0x194);}return _0x27a5ed;};}function handleError(_0x2febe0,_0x5059dd){_0x5059dd=_0x5059dd||0x1f4;return function(_0x3328a6){logger[_0xf37f('0x23')](_0x3328a6[_0xf37f('0x24')]);if(_0x3328a6[_0xf37f('0x25')]){delete _0x3328a6[_0xf37f('0x25')];}_0x2febe0[_0xf37f('0x17')](_0x5059dd)[_0xf37f('0x26')](_0x3328a6);};}exports[_0xf37f('0x27')]=function(_0x272d89,_0x3568a5){var _0x673cd1={},_0x14f894={},_0x5d8cdb={'count':0x0,'rows':[]};var _0x2f6c8e=_[_0xf37f('0x28')](db[_0xf37f('0x29')][_0xf37f('0x2a')],function(_0x3475de){return{'name':_0x3475de[_0xf37f('0x2b')],'type':_0x3475de['type'][_0xf37f('0x2c')]};});_0x14f894[_0xf37f('0x2d')]=_[_0xf37f('0x28')](_0x2f6c8e,_0xf37f('0x25'));_0x14f894['query']=_['keys'](_0x272d89[_0xf37f('0x2e')]);_0x14f894[_0xf37f('0x2f')]=_[_0xf37f('0x30')](_0x14f894[_0xf37f('0x2d')],_0x14f894[_0xf37f('0x2e')]);_0x673cd1['attributes']=_['intersection'](_0x14f894[_0xf37f('0x2d')],qs[_0xf37f('0x31')](_0x272d89[_0xf37f('0x2e')][_0xf37f('0x31')]));_0x673cd1['attributes']=_0x673cd1[_0xf37f('0x32')][_0xf37f('0x33')]?_0x673cd1[_0xf37f('0x32')]:_0x14f894[_0xf37f('0x2d')];if(!_0x272d89['query'][_0xf37f('0x34')](_0xf37f('0x35'))){_0x673cd1['limit']=qs['limit'](_0x272d89[_0xf37f('0x2e')][_0xf37f('0x1b')]);_0x673cd1['offset']=qs[_0xf37f('0x19')](_0x272d89['query'][_0xf37f('0x19')]);}_0x673cd1[_0xf37f('0x36')]=qs[_0xf37f('0x37')](_0x272d89['query']['sort']);_0x673cd1[_0xf37f('0x38')]=qs[_0xf37f('0x2f')](_[_0xf37f('0x39')](_0x272d89['query'],_0x14f894['filters']),_0x2f6c8e);if(_0x272d89['query']['filter']){_0x673cd1[_0xf37f('0x38')]=_['merge'](_0x673cd1[_0xf37f('0x38')],{'$or':_[_0xf37f('0x28')](_0x2f6c8e,function(_0x5b64ed){if(_0x5b64ed[_0xf37f('0x3a')]!=='VIRTUAL'){var _0x381bf4={};_0x381bf4[_0x5b64ed['name']]={'$like':'%'+_0x272d89[_0xf37f('0x2e')][_0xf37f('0x3b')]+'%'};return _0x381bf4;}})});}_0x673cd1=_['merge']({},_0x673cd1,_0x272d89[_0xf37f('0x3c')]);var _0x219107={'where':_0x673cd1[_0xf37f('0x38')]};return db[_0xf37f('0x29')]['count'](_0x219107)[_0xf37f('0x22')](function(_0x388290){_0x5d8cdb[_0xf37f('0x1c')]=_0x388290;if(_0x272d89[_0xf37f('0x2e')]['includeAll']){_0x673cd1['include']=[{'all':!![]}];}return db['FaxTransferReport'][_0xf37f('0x3d')](_0x673cd1);})[_0xf37f('0x22')](function(_0x133b0d){_0x5d8cdb['rows']=_0x133b0d;return _0x5d8cdb;})[_0xf37f('0x22')](respondWithFilteredResult(_0x3568a5,_0x673cd1))[_0xf37f('0x3e')](handleError(_0x3568a5,null));};exports[_0xf37f('0x3f')]=function(_0xfb37d,_0x1e63d0){var _0xe36d72={'raw':!![],'where':{'id':_0xfb37d[_0xf37f('0x40')]['id']}},_0x277732={};_0x277732[_0xf37f('0x2d')]=_[_0xf37f('0x41')](db[_0xf37f('0x29')][_0xf37f('0x2a')]);_0x277732['query']=_[_0xf37f('0x41')](_0xfb37d[_0xf37f('0x2e')]);_0x277732['filters']=_[_0xf37f('0x30')](_0x277732[_0xf37f('0x2d')],_0x277732['query']);_0xe36d72[_0xf37f('0x32')]=_[_0xf37f('0x30')](_0x277732[_0xf37f('0x2d')],qs['fields'](_0xfb37d[_0xf37f('0x2e')]['fields']));_0xe36d72[_0xf37f('0x32')]=_0xe36d72[_0xf37f('0x32')][_0xf37f('0x33')]?_0xe36d72[_0xf37f('0x32')]:_0x277732['model'];if(_0xfb37d[_0xf37f('0x2e')]['includeAll']){_0xe36d72['include']=[{'all':!![]}];}_0xe36d72=_['merge']({},_0xe36d72,_0xfb37d[_0xf37f('0x3c')]);return db[_0xf37f('0x29')][_0xf37f('0x42')](_0xe36d72)[_0xf37f('0x22')](handleEntityNotFound(_0x1e63d0,null))['then'](respondWithResult(_0x1e63d0,null))[_0xf37f('0x3e')](handleError(_0x1e63d0,null));};exports[_0xf37f('0x43')]=function(_0x3b1bd6,_0x296808){return db[_0xf37f('0x29')][_0xf37f('0x43')](_0x3b1bd6['body'],{})[_0xf37f('0x22')](respondWithResult(_0x296808,0xc9))[_0xf37f('0x3e')](handleError(_0x296808,null));};exports[_0xf37f('0x20')]=function(_0x123fec,_0x5149c5){if(_0x123fec[_0xf37f('0x44')]['id']){delete _0x123fec[_0xf37f('0x44')]['id'];}return db[_0xf37f('0x29')][_0xf37f('0x42')]({'where':{'id':_0x123fec[_0xf37f('0x40')]['id']}})['then'](handleEntityNotFound(_0x5149c5,null))[_0xf37f('0x22')](saveUpdates(_0x123fec['body'],null))[_0xf37f('0x22')](respondWithResult(_0x5149c5,null))['catch'](handleError(_0x5149c5,null));};exports[_0xf37f('0x21')]=function(_0x28f7e5,_0x2360ee){return db['FaxTransferReport'][_0xf37f('0x42')]({'where':{'id':_0x28f7e5[_0xf37f('0x40')]['id']}})['then'](handleEntityNotFound(_0x2360ee,null))[_0xf37f('0x22')](removeEntity(_0x2360ee,null))[_0xf37f('0x3e')](handleError(_0x2360ee,null));};exports['describe']=function(_0x2d67c1,_0x51927b){return db[_0xf37f('0x29')][_0xf37f('0x45')]()[_0xf37f('0x22')](respondWithResult(_0x51927b,null))[_0xf37f('0x3e')](handleError(_0x51927b,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 8cbffdb..0ee1be4 100644 --- a/server/api/faxTransferReport/faxTransferReport.model.js +++ b/server/api/faxTransferReport/faxTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd206=['path','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','moment','bluebird'];(function(_0x9b6888,_0x3843ef){var _0x50494b=function(_0x50f42b){while(--_0x50f42b){_0x9b6888['push'](_0x9b6888['shift']());}};_0x50494b(++_0x3843ef);}(_0xd206,0x89));var _0x6d20=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0xd206[_0x12f688];return _0x59c3de;};'use strict';var _=require(_0x6d20('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x6d20('0x1'));var BPromise=require(_0x6d20('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6d20('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6d20('0x4'));module[_0x6d20('0x5')]=function(_0x54a356,_0x1d24a5){return _0x54a356[_0x6d20('0x6')](_0x6d20('0x7'),attributes,{'tableName':_0x6d20('0x8'),'paranoid':![],'indexes':[{'name':_0x6d20('0x9'),'fields':[_0x6d20('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x41f6=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','uniqueid','lodash'];(function(_0x2088dd,_0x873490){var _0x509c2d=function(_0x57a365){while(--_0x57a365){_0x2088dd['push'](_0x2088dd['shift']());}};_0x509c2d(++_0x873490);}(_0x41f6,0x8e));var _0x641f=function(_0x152fe3,_0x12b0c8){_0x152fe3=_0x152fe3-0x0;var _0xc5bb39=_0x41f6[_0x152fe3];return _0xc5bb39;};'use strict';var _=require(_0x641f('0x0'));var util=require('util');var logger=require(_0x641f('0x1'))(_0x641f('0x2'));var moment=require(_0x641f('0x3'));var BPromise=require(_0x641f('0x4'));var rp=require(_0x641f('0x5'));var fs=require('fs');var path=require(_0x641f('0x6'));var rimraf=require(_0x641f('0x7'));var config=require(_0x641f('0x8'));var attributes=require(_0x641f('0x9'));module[_0x641f('0xa')]=function(_0x137ed3,_0x4e604d){return _0x137ed3[_0x641f('0xb')]('FaxTransferReport',attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x641f('0xc'),'fields':[_0x641f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index b33206b..a5bd3cb 100644 --- a/server/api/faxTransferReport/faxTransferReport.rpc.js +++ b/server/api/faxTransferReport/faxTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb347=['client','http','request','info','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error','FaxTransferReport,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4463cb,_0x4e3952){var _0x5d0d1c=function(_0x2cef84){while(--_0x2cef84){_0x4463cb['push'](_0x4463cb['shift']());}};_0x5d0d1c(++_0x4e3952);}(_0xb347,0x1ab));var _0x7b34=function(_0x5eb5a7,_0x1402eb){_0x5eb5a7=_0x5eb5a7-0x0;var _0x328df2=_0xb347[_0x5eb5a7];return _0x328df2;};'use strict';var _=require(_0x7b34('0x0'));var util=require('util');var moment=require(_0x7b34('0x1'));var BPromise=require(_0x7b34('0x2'));var rs=require(_0x7b34('0x3'));var fs=require('fs');var Redis=require(_0x7b34('0x4'));var db=require(_0x7b34('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b34('0x6'))(_0x7b34('0x7'));var config=require(_0x7b34('0x8'));var jayson=require(_0x7b34('0x9'));var client=jayson[_0x7b34('0xa')][_0x7b34('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x427107,_0x121e56,_0x2cbf8b){return new BPromise(function(_0x413e4d,_0x4c682a){return client[_0x7b34('0xc')](_0x427107,_0x2cbf8b)['then'](function(_0x18a8fb){logger[_0x7b34('0xd')]('FaxTransferReport,\x20%s,\x20%s',_0x121e56,_0x7b34('0xe'));logger[_0x7b34('0xf')](_0x7b34('0x10'),_0x121e56,_0x7b34('0xe'),JSON[_0x7b34('0x11')](_0x18a8fb));if(_0x18a8fb['error']){if(_0x18a8fb['error'][_0x7b34('0x12')]===0x1f4){logger[_0x7b34('0x13')](_0x7b34('0x14'),_0x121e56,_0x18a8fb[_0x7b34('0x13')][_0x7b34('0x15')]);return _0x4c682a(_0x18a8fb['error'][_0x7b34('0x15')]);}logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x121e56,_0x18a8fb['error']['message']);return _0x413e4d(_0x18a8fb[_0x7b34('0x13')][_0x7b34('0x15')]);}else{logger[_0x7b34('0xd')]('FaxTransferReport,\x20%s,\x20%s',_0x121e56,_0x7b34('0xe'));_0x413e4d(_0x18a8fb[_0x7b34('0x16')]['message']);}})['catch'](function(_0x3abab7){logger[_0x7b34('0x13')](_0x7b34('0x14'),_0x121e56,_0x3abab7);_0x4c682a(_0x3abab7);});});} \ No newline at end of file +var _0x72f5=['info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','FaxTransferReport,\x20%s,\x20%s','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x72f5,0x1e6));var _0x572f=function(_0x15f7d5,_0x558932){_0x15f7d5=_0x15f7d5-0x0;var _0x4ab476=_0x72f5[_0x15f7d5];return _0x4ab476;};'use strict';var _=require(_0x572f('0x0'));var util=require(_0x572f('0x1'));var moment=require(_0x572f('0x2'));var BPromise=require(_0x572f('0x3'));var rs=require(_0x572f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x572f('0x5'))['db'];var utils=require(_0x572f('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x572f('0x7'));var client=jayson[_0x572f('0x8')][_0x572f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2163e5,_0x49da54,_0x298f26){return new BPromise(function(_0x24e3f1,_0x423e58){return client[_0x572f('0xa')](_0x2163e5,_0x298f26)[_0x572f('0xb')](function(_0x150a4b){logger['info'](_0x572f('0xc'),_0x49da54,'request\x20sent');logger[_0x572f('0xd')](_0x572f('0xe'),_0x49da54,_0x572f('0xf'),JSON[_0x572f('0x10')](_0x150a4b));if(_0x150a4b[_0x572f('0x11')]){if(_0x150a4b[_0x572f('0x11')][_0x572f('0x12')]===0x1f4){logger[_0x572f('0x11')](_0x572f('0xc'),_0x49da54,_0x150a4b[_0x572f('0x11')][_0x572f('0x13')]);return _0x423e58(_0x150a4b[_0x572f('0x11')][_0x572f('0x13')]);}logger[_0x572f('0x11')](_0x572f('0xc'),_0x49da54,_0x150a4b['error'][_0x572f('0x13')]);return _0x24e3f1(_0x150a4b[_0x572f('0x11')]['message']);}else{logger[_0x572f('0x14')](_0x572f('0xc'),_0x49da54,'request\x20sent');_0x24e3f1(_0x150a4b[_0x572f('0x15')][_0x572f('0x13')]);}})[_0x572f('0x16')](function(_0x55990a){logger['error'](_0x572f('0xc'),_0x49da54,_0x55990a);_0x423e58(_0x55990a);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 6cb0a07..6442f1b 100644 --- a/server/api/faxTransferReport/index.js +++ b/server/api/faxTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1ec2=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','isAuthenticated','/describe','describe','get','show','post','put','/:id','update','delete','exports','util'];(function(_0x58d592,_0x544a2f){var _0x6db52c=function(_0x4300b6){while(--_0x4300b6){_0x58d592['push'](_0x58d592['shift']());}};_0x6db52c(++_0x544a2f);}(_0x1ec2,0x110));var _0x21ec=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x1ec2[_0x16d10f];return _0x50c823;};'use strict';var multer=require('multer');var util=require(_0x21ec('0x0'));var path=require(_0x21ec('0x1'));var timeout=require(_0x21ec('0x2'));var express=require(_0x21ec('0x3'));var router=express[_0x21ec('0x4')]();var fs_extra=require(_0x21ec('0x5'));var auth=require(_0x21ec('0x6'));var interaction=require(_0x21ec('0x7'));var config=require(_0x21ec('0x8'));var controller=require(_0x21ec('0x9'));router['get']('/',auth[_0x21ec('0xa')](),controller['index']);router['get'](_0x21ec('0xb'),auth[_0x21ec('0xa')](),controller[_0x21ec('0xc')]);router[_0x21ec('0xd')]('/:id',auth[_0x21ec('0xa')](),controller[_0x21ec('0xe')]);router[_0x21ec('0xf')]('/',auth[_0x21ec('0xa')](),controller['create']);router[_0x21ec('0x10')](_0x21ec('0x11'),auth[_0x21ec('0xa')](),controller[_0x21ec('0x12')]);router[_0x21ec('0x13')](_0x21ec('0x11'),auth[_0x21ec('0xa')](),controller['destroy']);module[_0x21ec('0x14')]=router; \ No newline at end of file +var _0xb190=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post','update','delete'];(function(_0x2158da,_0x20681c){var _0x59af52=function(_0x1e674a){while(--_0x1e674a){_0x2158da['push'](_0x2158da['shift']());}};_0x59af52(++_0x20681c);}(_0xb190,0xc9));var _0x0b19=function(_0x5d75b3,_0x429025){_0x5d75b3=_0x5d75b3-0x0;var _0x1d018a=_0xb190[_0x5d75b3];return _0x1d018a;};'use strict';var multer=require(_0x0b19('0x0'));var util=require(_0x0b19('0x1'));var path=require(_0x0b19('0x2'));var timeout=require(_0x0b19('0x3'));var express=require(_0x0b19('0x4'));var router=express[_0x0b19('0x5')]();var fs_extra=require(_0x0b19('0x6'));var auth=require(_0x0b19('0x7'));var interaction=require(_0x0b19('0x8'));var config=require(_0x0b19('0x9'));var controller=require('./faxTransferReport.controller');router[_0x0b19('0xa')]('/',auth[_0x0b19('0xb')](),controller[_0x0b19('0xc')]);router[_0x0b19('0xa')](_0x0b19('0xd'),auth[_0x0b19('0xb')](),controller['describe']);router[_0x0b19('0xa')](_0x0b19('0xe'),auth[_0x0b19('0xb')](),controller[_0x0b19('0xf')]);router[_0x0b19('0x10')]('/',auth[_0x0b19('0xb')](),controller['create']);router['put'](_0x0b19('0xe'),auth[_0x0b19('0xb')](),controller[_0x0b19('0x11')]);router[_0x0b19('0x12')](_0x0b19('0xe'),auth[_0x0b19('0xb')](),controller[_0x0b19('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 05ec47f..acffdab 100644 --- a/server/api/intDeskAccount/index.js +++ b/server/api/intDeskAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8852=['post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getFields'];(function(_0x54ae9a,_0x1b1759){var _0x1200dd=function(_0x4fa1d3){while(--_0x4fa1d3){_0x54ae9a['push'](_0x54ae9a['shift']());}};_0x1200dd(++_0x1b1759);}(_0x8852,0x64));var _0x2885=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x8852[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x2885('0x0'));var util=require(_0x2885('0x1'));var path=require('path');var timeout=require(_0x2885('0x2'));var express=require(_0x2885('0x3'));var router=express[_0x2885('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2885('0x5'));var config=require(_0x2885('0x6'));var controller=require(_0x2885('0x7'));router[_0x2885('0x8')]('/',auth[_0x2885('0x9')](),controller[_0x2885('0xa')]);router[_0x2885('0x8')](_0x2885('0xb'),auth[_0x2885('0x9')](),controller[_0x2885('0xc')]);router[_0x2885('0x8')](_0x2885('0xd'),auth['isAuthenticated'](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0x2885('0x9')](),controller[_0x2885('0xe')]);router[_0x2885('0xf')]('/',auth[_0x2885('0x9')](),controller[_0x2885('0x10')]);router[_0x2885('0xf')](_0x2885('0xd'),auth['isAuthenticated'](),controller[_0x2885('0x11')]);router[_0x2885('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x2885('0x13')]);router[_0x2885('0x14')](_0x2885('0xb'),auth[_0x2885('0x9')](),controller[_0x2885('0x15')]);module[_0x2885('0x16')]=router; \ No newline at end of file +var _0xa4cb=['getFields','post','create','addConfiguration','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x3035c1,_0x582828){var _0x144682=function(_0x4ef4d2){while(--_0x4ef4d2){_0x3035c1['push'](_0x3035c1['shift']());}};_0x144682(++_0x582828);}(_0xa4cb,0x86));var _0xba4c=function(_0x11c60b,_0x10c641){_0x11c60b=_0x11c60b-0x0;var _0x46f488=_0xa4cb[_0x11c60b];return _0x46f488;};'use strict';var multer=require('multer');var util=require(_0xba4c('0x0'));var path=require(_0xba4c('0x1'));var timeout=require(_0xba4c('0x2'));var express=require('express');var router=express[_0xba4c('0x3')]();var fs_extra=require(_0xba4c('0x4'));var auth=require(_0xba4c('0x5'));var interaction=require(_0xba4c('0x6'));var config=require(_0xba4c('0x7'));var controller=require(_0xba4c('0x8'));router[_0xba4c('0x9')]('/',auth[_0xba4c('0xa')](),controller['index']);router[_0xba4c('0x9')](_0xba4c('0xb'),auth[_0xba4c('0xa')](),controller[_0xba4c('0xc')]);router['get'](_0xba4c('0xd'),auth[_0xba4c('0xa')](),controller[_0xba4c('0xe')]);router['get'](_0xba4c('0xf'),auth[_0xba4c('0xa')](),controller[_0xba4c('0x10')]);router[_0xba4c('0x11')]('/',auth[_0xba4c('0xa')](),controller[_0xba4c('0x12')]);router['post'](_0xba4c('0xd'),auth['isAuthenticated'](),controller[_0xba4c('0x13')]);router[_0xba4c('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xba4c('0x15')]);router[_0xba4c('0x16')](_0xba4c('0xb'),auth['isAuthenticated'](),controller[_0xba4c('0x17')]);module[_0xba4c('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 19eb83e..62ddb96 100644 --- a/server/api/intDeskAccount/intDeskAccount.attributes.js +++ b/server/api/intDeskAccount/intDeskAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xce13=['STRING','ENUM','basic','integrationTab','newTab','sequelize','exports'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0xce13,0xde));var _0x3ce1=function(_0x24bdc7,_0x1cf8c6){_0x24bdc7=_0x24bdc7-0x0;var _0x1133bb=_0xce13[_0x24bdc7];return _0x1133bb;};'use strict';var Sequelize=require(_0x3ce1('0x0'));module[_0x3ce1('0x1')]={'name':{'type':Sequelize[_0x3ce1('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x3ce1('0x2')]},'remoteUri':{'type':Sequelize[_0x3ce1('0x2')]},'authType':{'type':Sequelize[_0x3ce1('0x3')](_0x3ce1('0x4')),'defaultValue':_0x3ce1('0x4')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x3ce1('0x2')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x3ce1('0x2')]},'tokenSecret':{'type':Sequelize[_0x3ce1('0x2')]},'serverUrl':{'type':Sequelize[_0x3ce1('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x3ce1('0x3')](_0x3ce1('0x5'),_0x3ce1('0x6')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xa6b3=['integrationTab','newTab','sequelize','exports','STRING','basic'];(function(_0x437d7f,_0x1feb46){var _0x31058c=function(_0x49dd1a){while(--_0x49dd1a){_0x437d7f['push'](_0x437d7f['shift']());}};_0x31058c(++_0x1feb46);}(_0xa6b3,0xc8));var _0x3a6b=function(_0x4746db,_0xe54b26){_0x4746db=_0x4746db-0x0;var _0x2216c3=_0xa6b3[_0x4746db];return _0x2216c3;};'use strict';var Sequelize=require(_0x3a6b('0x0'));module[_0x3a6b('0x1')]={'name':{'type':Sequelize[_0x3a6b('0x2')]},'description':{'type':Sequelize[_0x3a6b('0x2')]},'username':{'type':Sequelize[_0x3a6b('0x2')]},'remoteUri':{'type':Sequelize[_0x3a6b('0x2')]},'authType':{'type':Sequelize['ENUM'](_0x3a6b('0x3')),'defaultValue':_0x3a6b('0x3')},'password':{'type':Sequelize[_0x3a6b('0x2')]},'consumerKey':{'type':Sequelize[_0x3a6b('0x2')]},'consumerSecret':{'type':Sequelize[_0x3a6b('0x2')]},'token':{'type':Sequelize[_0x3a6b('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x3a6b('0x4'),_0x3a6b('0x5')),'defaultValue':_0x3a6b('0x4')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 32f9a53..47bbca7 100644 --- a/server/api/intDeskAccount/intDeskAccount.controller.js +++ b/server/api/intDeskAccount/intDeskAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6b32=['VIRTUAL','options','where','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','findOne','getConfigurations','nolimit','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','DeskConfiguration','DeskField','getFields','priority','remoteUri','username','password','consumerKey','consumerSecret','token','tokenSecret','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','Authorization','Basic\x20%s','%s:%s','toString','base64','concat','active','label','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','end','stack','name','send','index','map','DeskAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','merge'];(function(_0x47bf4d,_0x2bef5f){var _0x223567=function(_0x4bf9c3){while(--_0x4bf9c3){_0x47bf4d['push'](_0x47bf4d['shift']());}};_0x223567(++_0x2bef5f);}(_0x6b32,0x19a));var _0x26b3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6b32[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x26b3('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x26b3('0x1'));var moment=require(_0x26b3('0x2'));var BPromise=require(_0x26b3('0x3'));var Mustache=require(_0x26b3('0x4'));var util=require(_0x26b3('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x26b3('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x26b3('0x7'));var _=require(_0x26b3('0x8'));var squel=require('squel');var crypto=require(_0x26b3('0x9'));var jsforce=require(_0x26b3('0xa'));var deskjs=require(_0x26b3('0xb'));var toCsv=require(_0x26b3('0x6'));var querystring=require(_0x26b3('0xc'));var Papa=require('papaparse');var Redis=require(_0x26b3('0xd'));var authService=require(_0x26b3('0xe'));var qs=require(_0x26b3('0xf'));var as=require(_0x26b3('0x10'));var hardwareService=require(_0x26b3('0x11'));var logger=require(_0x26b3('0x12'))(_0x26b3('0x13'));var utils=require(_0x26b3('0x14'));var config=require(_0x26b3('0x15'));var licenseUtil=require(_0x26b3('0x16'));var db=require(_0x26b3('0x17'))['db'];var integrations=require(_0x26b3('0x18'));function respondWithStatusCode(_0x1bd8ae,_0x13b632){_0x13b632=_0x13b632||0xcc;return function(_0x53b31b){if(_0x53b31b){return _0x1bd8ae[_0x26b3('0x19')](_0x13b632);}return _0x1bd8ae[_0x26b3('0x1a')](_0x13b632)['end']();};}function respondWithResult(_0x4ca24d,_0xa0fab){_0xa0fab=_0xa0fab||0xc8;return function(_0x58d930){if(_0x58d930){return _0x4ca24d['status'](_0xa0fab)[_0x26b3('0x1b')](_0x58d930);}};}function respondWithFilteredResult(_0x5f1068,_0x1af209){return function(_0x3645e6){if(_0x3645e6){var _0x5b49e5=typeof _0x1af209[_0x26b3('0x1c')]===_0x26b3('0x1d')&&typeof _0x1af209[_0x26b3('0x1e')]===_0x26b3('0x1d');var _0x20b988=_0x3645e6[_0x26b3('0x1f')];var _0x2f2a75=_0x5b49e5?0x0:_0x1af209['offset'];var _0x42fe7a=_0x5b49e5?_0x3645e6[_0x26b3('0x1f')]:_0x1af209[_0x26b3('0x1c')]+_0x1af209[_0x26b3('0x1e')];var _0x5d2c22;if(_0x42fe7a>=_0x20b988){_0x42fe7a=_0x20b988;_0x5d2c22=0xc8;}else{_0x5d2c22=0xce;}_0x5f1068[_0x26b3('0x1a')](_0x5d2c22);return _0x5f1068[_0x26b3('0x20')](_0x26b3('0x21'),_0x2f2a75+'-'+_0x42fe7a+'/'+_0x20b988)[_0x26b3('0x1b')](_0x3645e6);}return null;};}function patchUpdates(_0x525395){return function(_0x571857){try{jsonpatch[_0x26b3('0x22')](_0x571857,_0x525395,!![]);}catch(_0x286a41){return BPromise[_0x26b3('0x23')](_0x286a41);}return _0x571857['save']();};}function saveUpdates(_0x36c5da,_0x3bf118){return function(_0x2d010d){if(_0x2d010d){return _0x2d010d[_0x26b3('0x24')](_0x36c5da)[_0x26b3('0x25')](function(_0x9c76e6){return _0x9c76e6;});}return null;};}function removeEntity(_0x5c0b55,_0x1f8115){return function(_0x432e31){if(_0x432e31){return _0x432e31['destroy']()[_0x26b3('0x25')](function(){_0x5c0b55['status'](0xcc)[_0x26b3('0x26')]();});}};}function handleEntityNotFound(_0x48608d,_0x249e7a){return function(_0x26216e){if(!_0x26216e){_0x48608d[_0x26b3('0x19')](0x194);}return _0x26216e;};}function handleError(_0xb04777,_0x6e3f73){_0x6e3f73=_0x6e3f73||0x1f4;return function(_0x572bd7){logger['error'](_0x572bd7[_0x26b3('0x27')]);if(_0x572bd7['name']){delete _0x572bd7[_0x26b3('0x28')];}_0xb04777[_0x26b3('0x1a')](_0x6e3f73)[_0x26b3('0x29')](_0x572bd7);};}exports[_0x26b3('0x2a')]=function(_0x2fbf23,_0x3dd4c1){var _0x5b781={},_0x262fc6={},_0x530394={'count':0x0,'rows':[]};var _0x4e58d4=_[_0x26b3('0x2b')](db[_0x26b3('0x2c')][_0x26b3('0x2d')],function(_0x50875b){return{'name':_0x50875b[_0x26b3('0x2e')],'type':_0x50875b[_0x26b3('0x2f')][_0x26b3('0x30')]};});_0x262fc6[_0x26b3('0x31')]=_['map'](_0x4e58d4,_0x26b3('0x28'));_0x262fc6[_0x26b3('0x32')]=_['keys'](_0x2fbf23['query']);_0x262fc6[_0x26b3('0x33')]=_[_0x26b3('0x34')](_0x262fc6[_0x26b3('0x31')],_0x262fc6[_0x26b3('0x32')]);_0x5b781['attributes']=_[_0x26b3('0x34')](_0x262fc6[_0x26b3('0x31')],qs[_0x26b3('0x35')](_0x2fbf23[_0x26b3('0x32')][_0x26b3('0x35')]));_0x5b781[_0x26b3('0x36')]=_0x5b781[_0x26b3('0x36')][_0x26b3('0x37')]?_0x5b781['attributes']:_0x262fc6[_0x26b3('0x31')];if(!_0x2fbf23[_0x26b3('0x32')][_0x26b3('0x38')]('nolimit')){_0x5b781[_0x26b3('0x1e')]=qs[_0x26b3('0x1e')](_0x2fbf23[_0x26b3('0x32')][_0x26b3('0x1e')]);_0x5b781[_0x26b3('0x1c')]=qs[_0x26b3('0x1c')](_0x2fbf23[_0x26b3('0x32')][_0x26b3('0x1c')]);}_0x5b781[_0x26b3('0x39')]=qs[_0x26b3('0x3a')](_0x2fbf23['query'][_0x26b3('0x3a')]);_0x5b781['where']=qs[_0x26b3('0x33')](_[_0x26b3('0x3b')](_0x2fbf23[_0x26b3('0x32')],_0x262fc6[_0x26b3('0x33')]),_0x4e58d4);if(_0x2fbf23['query'][_0x26b3('0x3c')]){_0x5b781['where']=_[_0x26b3('0x3d')](_0x5b781['where'],{'$or':_[_0x26b3('0x2b')](_0x4e58d4,function(_0x42b0d0){if(_0x42b0d0['type']!==_0x26b3('0x3e')){var _0x42ba3e={};_0x42ba3e[_0x42b0d0[_0x26b3('0x28')]]={'$like':'%'+_0x2fbf23['query']['filter']+'%'};return _0x42ba3e;}})});}_0x5b781=_[_0x26b3('0x3d')]({},_0x5b781,_0x2fbf23[_0x26b3('0x3f')]);var _0x4fa6d7={'where':_0x5b781[_0x26b3('0x40')]};return db['DeskAccount'][_0x26b3('0x1f')](_0x4fa6d7)['then'](function(_0x225446){_0x530394['count']=_0x225446;if(_0x2fbf23[_0x26b3('0x32')][_0x26b3('0x41')]){_0x5b781[_0x26b3('0x42')]=[{'all':!![]}];}return db[_0x26b3('0x2c')][_0x26b3('0x43')](_0x5b781);})[_0x26b3('0x25')](function(_0x5befbc){_0x530394[_0x26b3('0x44')]=_0x5befbc;return _0x530394;})[_0x26b3('0x25')](respondWithFilteredResult(_0x3dd4c1,_0x5b781))[_0x26b3('0x45')](handleError(_0x3dd4c1,null));};exports[_0x26b3('0x46')]=function(_0x2de4ef,_0x3c785d){var _0x3f67dd={'raw':![],'where':{'id':_0x2de4ef[_0x26b3('0x47')]['id']}},_0xd39ddc={};_0xd39ddc[_0x26b3('0x31')]=_[_0x26b3('0x48')](db[_0x26b3('0x2c')]['rawAttributes']);_0xd39ddc['query']=_[_0x26b3('0x48')](_0x2de4ef[_0x26b3('0x32')]);_0xd39ddc[_0x26b3('0x33')]=_[_0x26b3('0x34')](_0xd39ddc['model'],_0xd39ddc[_0x26b3('0x32')]);_0x3f67dd[_0x26b3('0x36')]=_['intersection'](_0xd39ddc[_0x26b3('0x31')],qs['fields'](_0x2de4ef[_0x26b3('0x32')][_0x26b3('0x35')]));_0x3f67dd[_0x26b3('0x36')]=_0x3f67dd['attributes'][_0x26b3('0x37')]?_0x3f67dd[_0x26b3('0x36')]:_0xd39ddc['model'];if(_0x2de4ef['query'][_0x26b3('0x41')]){_0x3f67dd[_0x26b3('0x42')]=[{'all':!![]}];}_0x3f67dd=_['merge']({},_0x3f67dd,_0x2de4ef[_0x26b3('0x3f')]);return db[_0x26b3('0x2c')][_0x26b3('0x49')](_0x3f67dd)['then'](handleEntityNotFound(_0x3c785d,null))['then'](respondWithResult(_0x3c785d,null))['catch'](handleError(_0x3c785d,null));};exports[_0x26b3('0x4a')]=function(_0x1b11e3,_0x2696b0){return db[_0x26b3('0x2c')][_0x26b3('0x4a')](_0x1b11e3[_0x26b3('0x4b')],{})[_0x26b3('0x25')](respondWithResult(_0x2696b0,0xc9))[_0x26b3('0x45')](handleError(_0x2696b0,null));};exports['update']=function(_0x343cbb,_0x3ecc40){if(_0x343cbb['body']['id']){delete _0x343cbb[_0x26b3('0x4b')]['id'];}return db[_0x26b3('0x2c')][_0x26b3('0x49')]({'where':{'id':_0x343cbb[_0x26b3('0x47')]['id']}})[_0x26b3('0x25')](handleEntityNotFound(_0x3ecc40,null))[_0x26b3('0x25')](saveUpdates(_0x343cbb[_0x26b3('0x4b')],null))[_0x26b3('0x25')](respondWithResult(_0x3ecc40,null))['catch'](handleError(_0x3ecc40,null));};exports['destroy']=function(_0x2877f8,_0x4db0c4){return db[_0x26b3('0x2c')][_0x26b3('0x49')]({'where':{'id':_0x2877f8[_0x26b3('0x47')]['id']}})[_0x26b3('0x25')](handleEntityNotFound(_0x4db0c4,null))[_0x26b3('0x25')](removeEntity(_0x4db0c4,null))['catch'](handleError(_0x4db0c4,null));};exports['getConfigurations']=function(_0x5407ee,_0x1a8acf,_0x149e4d){var _0x1f69b7={};var _0x40e3f0={};var _0x2f64b4;var _0x568303;return db[_0x26b3('0x2c')][_0x26b3('0x4c')]({'where':{'id':_0x5407ee['params']['id']}})[_0x26b3('0x25')](handleEntityNotFound(_0x1a8acf,null))[_0x26b3('0x25')](function(_0x1e3ad5){if(_0x1e3ad5){_0x2f64b4=_0x1e3ad5;_0x40e3f0[_0x26b3('0x31')]=_[_0x26b3('0x48')](db['DeskConfiguration'][_0x26b3('0x2d')]);_0x40e3f0[_0x26b3('0x32')]=_['keys'](_0x5407ee['query']);_0x40e3f0[_0x26b3('0x33')]=_[_0x26b3('0x34')](_0x40e3f0[_0x26b3('0x31')],_0x40e3f0[_0x26b3('0x32')]);_0x1f69b7[_0x26b3('0x36')]=_['intersection'](_0x40e3f0[_0x26b3('0x31')],qs['fields'](_0x5407ee[_0x26b3('0x32')]['fields']));_0x1f69b7[_0x26b3('0x36')]=_0x1f69b7[_0x26b3('0x36')][_0x26b3('0x37')]?_0x1f69b7[_0x26b3('0x36')]:_0x40e3f0[_0x26b3('0x31')];_0x1f69b7[_0x26b3('0x39')]=qs['sort'](_0x5407ee['query']['sort']);_0x1f69b7['where']=qs[_0x26b3('0x33')](_[_0x26b3('0x3b')](_0x5407ee[_0x26b3('0x32')],_0x40e3f0[_0x26b3('0x33')]));if(_0x5407ee[_0x26b3('0x32')][_0x26b3('0x3c')]){_0x1f69b7[_0x26b3('0x40')]=_[_0x26b3('0x3d')](_0x1f69b7[_0x26b3('0x40')],{'$or':_[_0x26b3('0x2b')](_0x1f69b7[_0x26b3('0x36')],function(_0x154e41){var _0x43a2e2={};_0x43a2e2[_0x154e41]={'$like':'%'+_0x5407ee['query'][_0x26b3('0x3c')]+'%'};return _0x43a2e2;})});}_0x1f69b7=_[_0x26b3('0x3d')]({},_0x1f69b7,_0x5407ee['options']);return _0x2f64b4[_0x26b3('0x4d')](_0x1f69b7);}})[_0x26b3('0x25')](function(_0x3f128b){if(_0x3f128b){_0x568303=_0x3f128b['length'];if(!_0x5407ee['query'][_0x26b3('0x38')](_0x26b3('0x4e'))){_0x1f69b7[_0x26b3('0x1e')]=qs[_0x26b3('0x1e')](_0x5407ee[_0x26b3('0x32')][_0x26b3('0x1e')]);_0x1f69b7['offset']=qs[_0x26b3('0x1c')](_0x5407ee[_0x26b3('0x32')][_0x26b3('0x1c')]);}return _0x2f64b4['getConfigurations'](_0x1f69b7);}})['then'](function(_0x10a028){if(_0x10a028){return _0x10a028?{'count':_0x568303,'rows':_0x10a028}:null;}})['then'](respondWithResult(_0x1a8acf,null))[_0x26b3('0x45')](handleError(_0x1a8acf,null));};exports[_0x26b3('0x4f')]=function(_0x2e12b8,_0x9bfbb4,_0x1ccde8){if(_0x2e12b8[_0x26b3('0x4b')]['id']){delete _0x2e12b8[_0x26b3('0x4b')]['id'];}return db[_0x26b3('0x2c')]['findOne']({'where':{'id':_0x2e12b8[_0x26b3('0x47')]['id']}})[_0x26b3('0x25')](handleEntityNotFound(_0x9bfbb4,null))[_0x26b3('0x25')](function(_0xf727df){if(_0xf727df){_0x2e12b8[_0x26b3('0x4b')][_0x26b3('0x50')]=_0xf727df['id'];_0x2e12b8['body'][_0x26b3('0x51')]=integrations['getSubjects'](_0x2e12b8[_0x26b3('0x4b')][_0x26b3('0x52')],_0x2e12b8[_0x26b3('0x4b')][_0x26b3('0x2f')]);_0x2e12b8[_0x26b3('0x4b')][_0x26b3('0x53')]=integrations[_0x26b3('0x54')](_0x2e12b8[_0x26b3('0x4b')][_0x26b3('0x52')],_0x2e12b8[_0x26b3('0x4b')][_0x26b3('0x2f')]);return db[_0x26b3('0x55')]['create'](_0x2e12b8[_0x26b3('0x4b')],{'include':[{'model':db[_0x26b3('0x56')],'as':_0x26b3('0x51')},{'model':db[_0x26b3('0x56')],'as':_0x26b3('0x53')}]});}return null;})['then'](respondWithResult(_0x9bfbb4,null))['catch'](handleError(_0x9bfbb4,null));};exports[_0x26b3('0x57')]=function(_0x3ab7d3,_0x2845fe,_0x1a379f){var _0x2e456e=[{'name':_0x26b3('0x58'),'label':_0x26b3('0x58'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x383b66='';return db[_0x26b3('0x2c')][_0x26b3('0x4c')]({'where':{'id':_0x3ab7d3[_0x26b3('0x47')]['id']},'attributes':['id',_0x26b3('0x59'),'authType',_0x26b3('0x5a'),_0x26b3('0x5b'),_0x26b3('0x5c'),_0x26b3('0x5d'),_0x26b3('0x5e'),_0x26b3('0x5f')]})[_0x26b3('0x25')](handleEntityNotFound(_0x2845fe,null))[_0x26b3('0x25')](function(_0x100a94){if(_0x100a94){_0x383b66=_0x100a94[_0x26b3('0x59')];var _0x24634e=_0x383b66[_0x26b3('0x60')](-0x1);if(_0x24634e==='/'){_0x383b66=_0x383b66[_0x26b3('0x61')](0x0,_0x383b66[_0x26b3('0x62')](_0x24634e));}var _0x562df3={'method':_0x26b3('0x63'),'uri':util[_0x26b3('0x64')](_0x26b3('0x65'),_0x383b66),'headers':{'Content-Type':_0x26b3('0x66'),'Accept':_0x26b3('0x66')},'json':!![]};if(_0x100a94['authType']===_0x26b3('0x67')){_0x562df3['headers'][_0x26b3('0x68')]=util['format'](_0x26b3('0x69'),new Buffer(util[_0x26b3('0x64')](_0x26b3('0x6a'),_0x100a94['username'],_0x100a94[_0x26b3('0x5b')]))[_0x26b3('0x6b')](_0x26b3('0x6c')));}return rp(_0x562df3)[_0x26b3('0x25')](function(_0xeab423){return _0x2e456e[_0x26b3('0x6d')](_[_0x26b3('0x2b')](_0xeab423['_embedded']['entries'],function(_0x11f851){return{'id':_0x11f851[_0x26b3('0x28')],'name':_0x11f851[_0x26b3('0x28')],'type':_0x11f851[_0x26b3('0x2f')],'active':_0x11f851[_0x26b3('0x6e')],'label':_0x11f851[_0x26b3('0x6f')],'custom':!![]};}));});}})[_0x26b3('0x25')](function(_0x1c5238){return{'count':_0x1c5238[_0x26b3('0x37')],'rows':_0x1c5238};})['then'](respondWithResult(_0x2845fe,null))[_0x26b3('0x45')](function(_0x1f5ae1){var _0x3d2c31=_0x3ab7d3['query'][_0x26b3('0x70')]?0x1f4:_0x1f5ae1[_0x26b3('0x71')]||0x1f4;logger[_0x26b3('0x72')](_0x26b3('0x73'),_0x26b3('0x57'),_0x3d2c31,JSON[_0x26b3('0x74')](_0x1f5ae1));delete _0x1f5ae1[_0x26b3('0x28')];if(_0x3d2c31===0x191){_0x3d2c31=0x190;}_0x2845fe[_0x26b3('0x1a')](_0x3d2c31)[_0x26b3('0x29')](_0x3ab7d3[_0x26b3('0x32')][_0x26b3('0x70')]?{'message':_0x26b3('0x75'),'statusCode':_0x1f5ae1[_0x26b3('0x71')]}:_0x1f5ae1);});}; \ No newline at end of file +var _0x60e5=['status','end','undefined','limit','offset','count','set','json','apply','reject','save','then','error','stack','name','map','DeskAccount','rawAttributes','key','keys','filters','intersection','model','query','attributes','fields','length','order','sort','pick','filter','merge','where','type','findAll','catch','show','includeAll','include','options','create','body','destroy','find','params','getConfigurations','findOne','DeskConfiguration','hasOwnProperty','nolimit','AccountId','Subjects','Descriptions','getDescriptions','DeskField','getFields','priority','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','remoteUri','slice','substring','lastIndexOf','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','toString','base64','concat','_embedded','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus'];(function(_0x2a13f3,_0x165bd7){var _0x3d251a=function(_0x53ddc7){while(--_0x53ddc7){_0x2a13f3['push'](_0x2a13f3['shift']());}};_0x3d251a(++_0x165bd7);}(_0x60e5,0x1b5));var _0x560e=function(_0x562f3b,_0x4c65ae){_0x562f3b=_0x562f3b-0x0;var _0x1edd55=_0x60e5[_0x562f3b];return _0x1edd55;};'use strict';var emlformat=require(_0x560e('0x0'));var rimraf=require(_0x560e('0x1'));var zipdir=require(_0x560e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x560e('0x3'));var moment=require(_0x560e('0x4'));var BPromise=require(_0x560e('0x5'));var Mustache=require(_0x560e('0x6'));var util=require(_0x560e('0x7'));var path=require(_0x560e('0x8'));var sox=require(_0x560e('0x9'));var csv=require(_0x560e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x560e('0xb'));var _=require(_0x560e('0xc'));var squel=require(_0x560e('0xd'));var crypto=require(_0x560e('0xe'));var jsforce=require(_0x560e('0xf'));var deskjs=require(_0x560e('0x10'));var toCsv=require('to-csv');var querystring=require(_0x560e('0x11'));var Papa=require(_0x560e('0x12'));var Redis=require(_0x560e('0x13'));var authService=require(_0x560e('0x14'));var qs=require(_0x560e('0x15'));var as=require(_0x560e('0x16'));var hardwareService=require(_0x560e('0x17'));var logger=require(_0x560e('0x18'))(_0x560e('0x19'));var utils=require('../../config/utils');var config=require(_0x560e('0x1a'));var licenseUtil=require(_0x560e('0x1b'));var db=require(_0x560e('0x1c'))['db'];var integrations=require(_0x560e('0x1d'));function respondWithStatusCode(_0x56bb59,_0x2331c4){_0x2331c4=_0x2331c4||0xcc;return function(_0x37635d){if(_0x37635d){return _0x56bb59[_0x560e('0x1e')](_0x2331c4);}return _0x56bb59[_0x560e('0x1f')](_0x2331c4)[_0x560e('0x20')]();};}function respondWithResult(_0x45858b,_0x4ed1c1){_0x4ed1c1=_0x4ed1c1||0xc8;return function(_0x57f3b9){if(_0x57f3b9){return _0x45858b['status'](_0x4ed1c1)['json'](_0x57f3b9);}};}function respondWithFilteredResult(_0x16e226,_0x925a3b){return function(_0x35bb52){if(_0x35bb52){var _0x20b156=typeof _0x925a3b['offset']===_0x560e('0x21')&&typeof _0x925a3b[_0x560e('0x22')]===_0x560e('0x21');var _0x31d314=_0x35bb52['count'];var _0x23cc46=_0x20b156?0x0:_0x925a3b[_0x560e('0x23')];var _0x31a1a0=_0x20b156?_0x35bb52[_0x560e('0x24')]:_0x925a3b[_0x560e('0x23')]+_0x925a3b[_0x560e('0x22')];var _0x51557e;if(_0x31a1a0>=_0x31d314){_0x31a1a0=_0x31d314;_0x51557e=0xc8;}else{_0x51557e=0xce;}_0x16e226['status'](_0x51557e);return _0x16e226[_0x560e('0x25')]('Content-Range',_0x23cc46+'-'+_0x31a1a0+'/'+_0x31d314)[_0x560e('0x26')](_0x35bb52);}return null;};}function patchUpdates(_0x2a5c2d){return function(_0x359d2b){try{jsonpatch[_0x560e('0x27')](_0x359d2b,_0x2a5c2d,!![]);}catch(_0x42b480){return BPromise[_0x560e('0x28')](_0x42b480);}return _0x359d2b[_0x560e('0x29')]();};}function saveUpdates(_0x382316,_0x546865){return function(_0x3e27e7){if(_0x3e27e7){return _0x3e27e7['update'](_0x382316)[_0x560e('0x2a')](function(_0x3f3613){return _0x3f3613;});}return null;};}function removeEntity(_0x396a0a,_0x8510b7){return function(_0x5d37c2){if(_0x5d37c2){return _0x5d37c2['destroy']()['then'](function(){_0x396a0a[_0x560e('0x1f')](0xcc)[_0x560e('0x20')]();});}};}function handleEntityNotFound(_0x4867d1,_0x171e48){return function(_0x128047){if(!_0x128047){_0x4867d1[_0x560e('0x1e')](0x194);}return _0x128047;};}function handleError(_0x5eb1c8,_0x4ca49f){_0x4ca49f=_0x4ca49f||0x1f4;return function(_0x26d6f0){logger[_0x560e('0x2b')](_0x26d6f0[_0x560e('0x2c')]);if(_0x26d6f0[_0x560e('0x2d')]){delete _0x26d6f0[_0x560e('0x2d')];}_0x5eb1c8[_0x560e('0x1f')](_0x4ca49f)['send'](_0x26d6f0);};}exports['index']=function(_0x19f68a,_0xbdeecd){var _0x5debe0={},_0x315f19={},_0x279f79={'count':0x0,'rows':[]};var _0x2582d0=_[_0x560e('0x2e')](db[_0x560e('0x2f')][_0x560e('0x30')],function(_0x48efd7){return{'name':_0x48efd7['fieldName'],'type':_0x48efd7['type'][_0x560e('0x31')]};});_0x315f19['model']=_[_0x560e('0x2e')](_0x2582d0,_0x560e('0x2d'));_0x315f19['query']=_[_0x560e('0x32')](_0x19f68a['query']);_0x315f19[_0x560e('0x33')]=_[_0x560e('0x34')](_0x315f19[_0x560e('0x35')],_0x315f19[_0x560e('0x36')]);_0x5debe0[_0x560e('0x37')]=_[_0x560e('0x34')](_0x315f19['model'],qs[_0x560e('0x38')](_0x19f68a[_0x560e('0x36')][_0x560e('0x38')]));_0x5debe0['attributes']=_0x5debe0[_0x560e('0x37')][_0x560e('0x39')]?_0x5debe0[_0x560e('0x37')]:_0x315f19['model'];if(!_0x19f68a[_0x560e('0x36')]['hasOwnProperty']('nolimit')){_0x5debe0[_0x560e('0x22')]=qs[_0x560e('0x22')](_0x19f68a['query'][_0x560e('0x22')]);_0x5debe0['offset']=qs[_0x560e('0x23')](_0x19f68a['query'][_0x560e('0x23')]);}_0x5debe0[_0x560e('0x3a')]=qs[_0x560e('0x3b')](_0x19f68a['query'][_0x560e('0x3b')]);_0x5debe0['where']=qs[_0x560e('0x33')](_[_0x560e('0x3c')](_0x19f68a[_0x560e('0x36')],_0x315f19[_0x560e('0x33')]),_0x2582d0);if(_0x19f68a['query'][_0x560e('0x3d')]){_0x5debe0['where']=_[_0x560e('0x3e')](_0x5debe0[_0x560e('0x3f')],{'$or':_['map'](_0x2582d0,function(_0x25fe7b){if(_0x25fe7b[_0x560e('0x40')]!=='VIRTUAL'){var _0x4ca0d7={};_0x4ca0d7[_0x25fe7b[_0x560e('0x2d')]]={'$like':'%'+_0x19f68a[_0x560e('0x36')][_0x560e('0x3d')]+'%'};return _0x4ca0d7;}})});}_0x5debe0=_[_0x560e('0x3e')]({},_0x5debe0,_0x19f68a['options']);var _0x484af5={'where':_0x5debe0[_0x560e('0x3f')]};return db[_0x560e('0x2f')][_0x560e('0x24')](_0x484af5)[_0x560e('0x2a')](function(_0x2a952a){_0x279f79[_0x560e('0x24')]=_0x2a952a;if(_0x19f68a['query']['includeAll']){_0x5debe0['include']=[{'all':!![]}];}return db[_0x560e('0x2f')][_0x560e('0x41')](_0x5debe0);})[_0x560e('0x2a')](function(_0x2af18a){_0x279f79['rows']=_0x2af18a;return _0x279f79;})[_0x560e('0x2a')](respondWithFilteredResult(_0xbdeecd,_0x5debe0))[_0x560e('0x42')](handleError(_0xbdeecd,null));};exports[_0x560e('0x43')]=function(_0x3e7a1e,_0x3fcb6a){var _0x386246={'raw':![],'where':{'id':_0x3e7a1e['params']['id']}},_0x350745={};_0x350745[_0x560e('0x35')]=_[_0x560e('0x32')](db['DeskAccount'][_0x560e('0x30')]);_0x350745[_0x560e('0x36')]=_[_0x560e('0x32')](_0x3e7a1e[_0x560e('0x36')]);_0x350745[_0x560e('0x33')]=_[_0x560e('0x34')](_0x350745[_0x560e('0x35')],_0x350745['query']);_0x386246[_0x560e('0x37')]=_['intersection'](_0x350745[_0x560e('0x35')],qs['fields'](_0x3e7a1e[_0x560e('0x36')]['fields']));_0x386246['attributes']=_0x386246[_0x560e('0x37')][_0x560e('0x39')]?_0x386246[_0x560e('0x37')]:_0x350745[_0x560e('0x35')];if(_0x3e7a1e[_0x560e('0x36')][_0x560e('0x44')]){_0x386246[_0x560e('0x45')]=[{'all':!![]}];}_0x386246=_[_0x560e('0x3e')]({},_0x386246,_0x3e7a1e[_0x560e('0x46')]);return db[_0x560e('0x2f')]['find'](_0x386246)['then'](handleEntityNotFound(_0x3fcb6a,null))[_0x560e('0x2a')](respondWithResult(_0x3fcb6a,null))['catch'](handleError(_0x3fcb6a,null));};exports[_0x560e('0x47')]=function(_0x51af97,_0x2451b8){return db[_0x560e('0x2f')][_0x560e('0x47')](_0x51af97[_0x560e('0x48')],{})[_0x560e('0x2a')](respondWithResult(_0x2451b8,0xc9))['catch'](handleError(_0x2451b8,null));};exports['update']=function(_0x5ac8a4,_0x338497){if(_0x5ac8a4[_0x560e('0x48')]['id']){delete _0x5ac8a4['body']['id'];}return db[_0x560e('0x2f')]['find']({'where':{'id':_0x5ac8a4['params']['id']}})[_0x560e('0x2a')](handleEntityNotFound(_0x338497,null))[_0x560e('0x2a')](saveUpdates(_0x5ac8a4[_0x560e('0x48')],null))[_0x560e('0x2a')](respondWithResult(_0x338497,null))[_0x560e('0x42')](handleError(_0x338497,null));};exports[_0x560e('0x49')]=function(_0x5555e4,_0x1a1f9b){return db['DeskAccount'][_0x560e('0x4a')]({'where':{'id':_0x5555e4[_0x560e('0x4b')]['id']}})[_0x560e('0x2a')](handleEntityNotFound(_0x1a1f9b,null))[_0x560e('0x2a')](removeEntity(_0x1a1f9b,null))[_0x560e('0x42')](handleError(_0x1a1f9b,null));};exports[_0x560e('0x4c')]=function(_0x361c0b,_0x2ceedd,_0x28f5ee){var _0xfecadf={};var _0x50baa6={};var _0xa67670;var _0x310e5d;return db[_0x560e('0x2f')][_0x560e('0x4d')]({'where':{'id':_0x361c0b['params']['id']}})['then'](handleEntityNotFound(_0x2ceedd,null))[_0x560e('0x2a')](function(_0x4aa623){if(_0x4aa623){_0xa67670=_0x4aa623;_0x50baa6[_0x560e('0x35')]=_[_0x560e('0x32')](db[_0x560e('0x4e')]['rawAttributes']);_0x50baa6[_0x560e('0x36')]=_[_0x560e('0x32')](_0x361c0b[_0x560e('0x36')]);_0x50baa6[_0x560e('0x33')]=_[_0x560e('0x34')](_0x50baa6[_0x560e('0x35')],_0x50baa6[_0x560e('0x36')]);_0xfecadf[_0x560e('0x37')]=_['intersection'](_0x50baa6['model'],qs[_0x560e('0x38')](_0x361c0b[_0x560e('0x36')]['fields']));_0xfecadf[_0x560e('0x37')]=_0xfecadf[_0x560e('0x37')][_0x560e('0x39')]?_0xfecadf[_0x560e('0x37')]:_0x50baa6[_0x560e('0x35')];_0xfecadf[_0x560e('0x3a')]=qs[_0x560e('0x3b')](_0x361c0b['query']['sort']);_0xfecadf[_0x560e('0x3f')]=qs[_0x560e('0x33')](_[_0x560e('0x3c')](_0x361c0b['query'],_0x50baa6[_0x560e('0x33')]));if(_0x361c0b['query'][_0x560e('0x3d')]){_0xfecadf[_0x560e('0x3f')]=_[_0x560e('0x3e')](_0xfecadf['where'],{'$or':_['map'](_0xfecadf[_0x560e('0x37')],function(_0x18ebf7){var _0x481488={};_0x481488[_0x18ebf7]={'$like':'%'+_0x361c0b['query'][_0x560e('0x3d')]+'%'};return _0x481488;})});}_0xfecadf=_[_0x560e('0x3e')]({},_0xfecadf,_0x361c0b[_0x560e('0x46')]);return _0xa67670['getConfigurations'](_0xfecadf);}})[_0x560e('0x2a')](function(_0x43086f){if(_0x43086f){_0x310e5d=_0x43086f[_0x560e('0x39')];if(!_0x361c0b[_0x560e('0x36')][_0x560e('0x4f')](_0x560e('0x50'))){_0xfecadf[_0x560e('0x22')]=qs[_0x560e('0x22')](_0x361c0b['query']['limit']);_0xfecadf['offset']=qs['offset'](_0x361c0b['query']['offset']);}return _0xa67670['getConfigurations'](_0xfecadf);}})[_0x560e('0x2a')](function(_0x4871f8){if(_0x4871f8){return _0x4871f8?{'count':_0x310e5d,'rows':_0x4871f8}:null;}})[_0x560e('0x2a')](respondWithResult(_0x2ceedd,null))['catch'](handleError(_0x2ceedd,null));};exports['addConfiguration']=function(_0x4aae5a,_0x2548fa,_0x5dd176){if(_0x4aae5a[_0x560e('0x48')]['id']){delete _0x4aae5a[_0x560e('0x48')]['id'];}return db['DeskAccount'][_0x560e('0x4d')]({'where':{'id':_0x4aae5a[_0x560e('0x4b')]['id']}})[_0x560e('0x2a')](handleEntityNotFound(_0x2548fa,null))[_0x560e('0x2a')](function(_0x22baf9){if(_0x22baf9){_0x4aae5a[_0x560e('0x48')][_0x560e('0x51')]=_0x22baf9['id'];_0x4aae5a[_0x560e('0x48')][_0x560e('0x52')]=integrations['getSubjects'](_0x4aae5a[_0x560e('0x48')]['channel'],_0x4aae5a['body'][_0x560e('0x40')]);_0x4aae5a[_0x560e('0x48')][_0x560e('0x53')]=integrations[_0x560e('0x54')](_0x4aae5a[_0x560e('0x48')]['channel'],_0x4aae5a[_0x560e('0x48')]['type']);return db[_0x560e('0x4e')]['create'](_0x4aae5a[_0x560e('0x48')],{'include':[{'model':db[_0x560e('0x55')],'as':'Subjects'},{'model':db[_0x560e('0x55')],'as':_0x560e('0x53')}]});}return null;})[_0x560e('0x2a')](respondWithResult(_0x2548fa,null))[_0x560e('0x42')](handleError(_0x2548fa,null));};exports[_0x560e('0x56')]=function(_0xedf48a,_0x27bcbf,_0x595101){var _0x51d7ce=[{'name':'priority','label':_0x560e('0x57'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x190118='';return db[_0x560e('0x2f')]['findOne']({'where':{'id':_0xedf48a[_0x560e('0x4b')]['id']},'attributes':['id','remoteUri',_0x560e('0x58'),_0x560e('0x59'),_0x560e('0x5a'),_0x560e('0x5b'),_0x560e('0x5c'),_0x560e('0x5d'),_0x560e('0x5e')]})[_0x560e('0x2a')](handleEntityNotFound(_0x27bcbf,null))[_0x560e('0x2a')](function(_0x132f6f){if(_0x132f6f){_0x190118=_0x132f6f[_0x560e('0x5f')];var _0x29ba1f=_0x190118[_0x560e('0x60')](-0x1);if(_0x29ba1f==='/'){_0x190118=_0x190118[_0x560e('0x61')](0x0,_0x190118[_0x560e('0x62')](_0x29ba1f));}var _0x5c826e={'method':'GET','uri':util[_0x560e('0x63')](_0x560e('0x64'),_0x190118),'headers':{'Content-Type':_0x560e('0x65'),'Accept':'application/json'},'json':!![]};if(_0x132f6f[_0x560e('0x58')]===_0x560e('0x66')){_0x5c826e[_0x560e('0x67')][_0x560e('0x68')]=util[_0x560e('0x63')](_0x560e('0x69'),new Buffer(util['format'](_0x560e('0x6a'),_0x132f6f['username'],_0x132f6f[_0x560e('0x5a')]))[_0x560e('0x6b')](_0x560e('0x6c')));}return rp(_0x5c826e)[_0x560e('0x2a')](function(_0x190ecc){return _0x51d7ce[_0x560e('0x6d')](_['map'](_0x190ecc[_0x560e('0x6e')]['entries'],function(_0x377caa){return{'id':_0x377caa['name'],'name':_0x377caa[_0x560e('0x2d')],'type':_0x377caa[_0x560e('0x40')],'active':_0x377caa[_0x560e('0x6f')],'label':_0x377caa[_0x560e('0x70')],'custom':!![]};}));});}})[_0x560e('0x2a')](function(_0x2dc733){return{'count':_0x2dc733[_0x560e('0x39')],'rows':_0x2dc733};})[_0x560e('0x2a')](respondWithResult(_0x27bcbf,null))[_0x560e('0x42')](function(_0x2a5f5a){var _0xc0ae58=_0xedf48a[_0x560e('0x36')][_0x560e('0x71')]?0x1f4:_0x2a5f5a[_0x560e('0x72')]||0x1f4;logger[_0x560e('0x2b')](_0x560e('0x73'),_0x560e('0x56'),_0xc0ae58,JSON['stringify'](_0x2a5f5a));delete _0x2a5f5a[_0x560e('0x2d')];if(_0xc0ae58===0x191){_0xc0ae58=0x190;}_0x27bcbf['status'](_0xc0ae58)['send'](_0xedf48a['query']['test']?{'message':_0x560e('0x74'),'statusCode':_0x2a5f5a['statusCode']}:_0x2a5f5a);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index dc81fb3..e659e4a 100644 --- a/server/api/intDeskAccount/intDeskAccount.model.js +++ b/server/api/intDeskAccount/intDeskAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x79b1=['path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','lodash','util','bluebird','request-promise'];(function(_0x26c936,_0x29ed7e){var _0x27ca0c=function(_0x42c79a){while(--_0x42c79a){_0x26c936['push'](_0x26c936['shift']());}};_0x27ca0c(++_0x29ed7e);}(_0x79b1,0xbf));var _0x179b=function(_0x3c16a9,_0x109c94){_0x3c16a9=_0x3c16a9-0x0;var _0x2b5f7c=_0x79b1[_0x3c16a9];return _0x2b5f7c;};'use strict';var _=require(_0x179b('0x0'));var util=require(_0x179b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x179b('0x2'));var rp=require(_0x179b('0x3'));var fs=require('fs');var path=require(_0x179b('0x4'));var rimraf=require(_0x179b('0x5'));var config=require(_0x179b('0x6'));var attributes=require(_0x179b('0x7'));var integrations=require(_0x179b('0x8'));module[_0x179b('0x9')]=function(_0x5eee8f,_0x22448f){return _0x5eee8f[_0x179b('0xa')](_0x179b('0xb'),attributes,{'tableName':_0x179b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb38a=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','DeskAccount','int_desk_accounts','util'];(function(_0x2aa1d8,_0x383a76){var _0x4b96ec=function(_0x55e260){while(--_0x55e260){_0x2aa1d8['push'](_0x2aa1d8['shift']());}};_0x4b96ec(++_0x383a76);}(_0xb38a,0x1e0));var _0xab38=function(_0x3147ec,_0x19663e){_0x3147ec=_0x3147ec-0x0;var _0x47886d=_0xb38a[_0x3147ec];return _0x47886d;};'use strict';var _=require('lodash');var util=require(_0xab38('0x0'));var logger=require(_0xab38('0x1'))(_0xab38('0x2'));var moment=require(_0xab38('0x3'));var BPromise=require(_0xab38('0x4'));var rp=require(_0xab38('0x5'));var fs=require('fs');var path=require(_0xab38('0x6'));var rimraf=require('rimraf');var config=require(_0xab38('0x7'));var attributes=require(_0xab38('0x8'));var integrations=require(_0xab38('0x9'));module[_0xab38('0xa')]=function(_0x79e138,_0x4c8344){return _0x79e138['define'](_0xab38('0xb'),attributes,{'tableName':_0xab38('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index 3c9d7c0..b43866a 100644 --- a/server/api/intDeskAccount/intDeskAccount.rpc.js +++ b/server/api/intDeskAccount/intDeskAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3c98=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetDeskAccount','DeskAccount','findAll','options','raw','attributes','limit','include','map','model','catch','where','ShowDeskAccount','lodash','util','moment','ioredis','../../mysqldb'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x3c98,0x19f));var _0x83c9=function(_0x54c88d,_0xe69f4a){_0x54c88d=_0x54c88d-0x0;var _0x3874ff=_0x3c98[_0x54c88d];return _0x3874ff;};'use strict';var _=require(_0x83c9('0x0'));var util=require(_0x83c9('0x1'));var moment=require(_0x83c9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x83c9('0x3'));var db=require(_0x83c9('0x4'))['db'];var utils=require(_0x83c9('0x5'));var logger=require(_0x83c9('0x6'))('rpc');var config=require(_0x83c9('0x7'));var jayson=require(_0x83c9('0x8'));var client=jayson[_0x83c9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ed790,_0x221599,_0x18bceb){return new BPromise(function(_0x1c16ce,_0x1029aa){return client[_0x83c9('0xa')](_0x2ed790,_0x18bceb)[_0x83c9('0xb')](function(_0x5f539e){logger[_0x83c9('0xc')](_0x83c9('0xd'),_0x221599,_0x83c9('0xe'));logger[_0x83c9('0xf')](_0x83c9('0x10'),_0x221599,'request\x20sent',JSON[_0x83c9('0x11')](_0x5f539e));if(_0x5f539e['error']){if(_0x5f539e[_0x83c9('0x12')][_0x83c9('0x13')]===0x1f4){logger['error'](_0x83c9('0xd'),_0x221599,_0x5f539e[_0x83c9('0x12')][_0x83c9('0x14')]);return _0x1029aa(_0x5f539e[_0x83c9('0x12')][_0x83c9('0x14')]);}logger[_0x83c9('0x12')](_0x83c9('0xd'),_0x221599,_0x5f539e[_0x83c9('0x12')][_0x83c9('0x14')]);return _0x1c16ce(_0x5f539e[_0x83c9('0x12')][_0x83c9('0x14')]);}else{logger[_0x83c9('0xc')]('DeskAccount,\x20%s,\x20%s',_0x221599,'request\x20sent');_0x1c16ce(_0x5f539e[_0x83c9('0x15')][_0x83c9('0x14')]);}})['catch'](function(_0x128bdb){logger[_0x83c9('0x12')](_0x83c9('0xd'),_0x221599,_0x128bdb);_0x1029aa(_0x128bdb);});});}exports[_0x83c9('0x16')]=function(_0x21a574){var _0x7a9f8d=this;return new Promise(function(_0x24cecf,_0xe58b23){return db[_0x83c9('0x17')][_0x83c9('0x18')]({'raw':_0x21a574[_0x83c9('0x19')]?_0x21a574[_0x83c9('0x19')][_0x83c9('0x1a')]===undefined?!![]:![]:!![],'where':_0x21a574[_0x83c9('0x19')]?_0x21a574[_0x83c9('0x19')]['where']||null:null,'attributes':_0x21a574[_0x83c9('0x19')]?_0x21a574[_0x83c9('0x19')][_0x83c9('0x1b')]||null:null,'limit':_0x21a574[_0x83c9('0x19')]?_0x21a574['options'][_0x83c9('0x1c')]||null:null,'include':_0x21a574['options']?_0x21a574[_0x83c9('0x19')][_0x83c9('0x1d')]?_[_0x83c9('0x1e')](_0x21a574[_0x83c9('0x19')][_0x83c9('0x1d')],function(_0x1eb6dd){return{'model':db[_0x1eb6dd['model']],'as':_0x1eb6dd['as'],'attributes':_0x1eb6dd[_0x83c9('0x1b')],'include':_0x1eb6dd[_0x83c9('0x1d')]?_[_0x83c9('0x1e')](_0x1eb6dd[_0x83c9('0x1d')],function(_0x40d026){return{'model':db[_0x40d026[_0x83c9('0x1f')]],'as':_0x40d026['as'],'attributes':_0x40d026[_0x83c9('0x1b')],'include':_0x40d026['include']?_[_0x83c9('0x1e')](_0x40d026[_0x83c9('0x1d')],function(_0x52d1bd){return{'model':db[_0x52d1bd[_0x83c9('0x1f')]],'as':_0x52d1bd['as'],'attributes':_0x52d1bd[_0x83c9('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x83c9('0xb')](function(_0x939161){logger[_0x83c9('0xc')](_0x83c9('0x16'),_0x21a574);logger['debug'](_0x83c9('0x16'),_0x21a574,JSON[_0x83c9('0x11')](_0x939161));_0x24cecf(_0x939161);})[_0x83c9('0x20')](function(_0x1da48d){logger['error']('GetDeskAccount',_0x1da48d[_0x83c9('0x14')],_0x21a574);_0xe58b23(_0x7a9f8d[_0x83c9('0x12')](0x1f4,_0x1da48d[_0x83c9('0x14')]));});});};exports['ShowDeskAccount']=function(_0x18d8e4){var _0x165c7c=this;return new Promise(function(_0x3d68c3,_0x5394e3){return db['DeskAccount']['find']({'raw':_0x18d8e4['options']?_0x18d8e4['options'][_0x83c9('0x1a')]===undefined?!![]:![]:!![],'where':_0x18d8e4['options']?_0x18d8e4['options'][_0x83c9('0x21')]||null:null,'attributes':_0x18d8e4['options']?_0x18d8e4[_0x83c9('0x19')][_0x83c9('0x1b')]||null:null,'include':_0x18d8e4[_0x83c9('0x19')]?_0x18d8e4[_0x83c9('0x19')]['include']?_[_0x83c9('0x1e')](_0x18d8e4[_0x83c9('0x19')][_0x83c9('0x1d')],function(_0x2a4c45){return{'model':db[_0x2a4c45[_0x83c9('0x1f')]],'as':_0x2a4c45['as'],'attributes':_0x2a4c45[_0x83c9('0x1b')],'include':_0x2a4c45['include']?_[_0x83c9('0x1e')](_0x2a4c45[_0x83c9('0x1d')],function(_0x10e020){return{'model':db[_0x10e020[_0x83c9('0x1f')]],'as':_0x10e020['as'],'attributes':_0x10e020['attributes'],'include':_0x10e020[_0x83c9('0x1d')]?_[_0x83c9('0x1e')](_0x10e020[_0x83c9('0x1d')],function(_0x844b52){return{'model':db[_0x844b52[_0x83c9('0x1f')]],'as':_0x844b52['as'],'attributes':_0x844b52[_0x83c9('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4290f4){logger['info'](_0x83c9('0x22'),_0x18d8e4);logger['debug'](_0x83c9('0x22'),_0x18d8e4,JSON[_0x83c9('0x11')](_0x4290f4));_0x3d68c3(_0x4290f4);})['catch'](function(_0x960b88){logger[_0x83c9('0x12')](_0x83c9('0x22'),_0x960b88['message'],_0x18d8e4);_0x5394e3(_0x165c7c['error'](0x1f4,_0x960b88[_0x83c9('0x14')]));});});}; \ No newline at end of file +var _0xf062=['client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','message','GetDeskAccount','DeskAccount','findAll','options','where','attributes','include','model','map','stringify','catch','find','raw','ShowDeskAccount','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5e238b,_0x17ae49){var _0x389bea=function(_0x3cc1c1){while(--_0x3cc1c1){_0x5e238b['push'](_0x5e238b['shift']());}};_0x389bea(++_0x17ae49);}(_0xf062,0xa5));var _0x2f06=function(_0x5141fa,_0x486d2a){_0x5141fa=_0x5141fa-0x0;var _0x95b8e2=_0xf062[_0x5141fa];return _0x95b8e2;};'use strict';var _=require(_0x2f06('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2f06('0x1'));var rs=require(_0x2f06('0x2'));var fs=require('fs');var Redis=require(_0x2f06('0x3'));var db=require(_0x2f06('0x4'))['db'];var utils=require(_0x2f06('0x5'));var logger=require(_0x2f06('0x6'))(_0x2f06('0x7'));var config=require(_0x2f06('0x8'));var jayson=require(_0x2f06('0x9'));var client=jayson[_0x2f06('0xa')][_0x2f06('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47dd50,_0x2fbe7d,_0x54b174){return new BPromise(function(_0x5ce919,_0x1cbc1b){return client[_0x2f06('0xc')](_0x47dd50,_0x54b174)[_0x2f06('0xd')](function(_0x358116){logger[_0x2f06('0xe')](_0x2f06('0xf'),_0x2fbe7d,_0x2f06('0x10'));logger[_0x2f06('0x11')](_0x2f06('0x12'),_0x2fbe7d,_0x2f06('0x10'),JSON['stringify'](_0x358116));if(_0x358116[_0x2f06('0x13')]){if(_0x358116[_0x2f06('0x13')]['code']===0x1f4){logger[_0x2f06('0x13')]('DeskAccount,\x20%s,\x20%s',_0x2fbe7d,_0x358116[_0x2f06('0x13')][_0x2f06('0x14')]);return _0x1cbc1b(_0x358116[_0x2f06('0x13')][_0x2f06('0x14')]);}logger['error'](_0x2f06('0xf'),_0x2fbe7d,_0x358116[_0x2f06('0x13')]['message']);return _0x5ce919(_0x358116[_0x2f06('0x13')]['message']);}else{logger[_0x2f06('0xe')]('DeskAccount,\x20%s,\x20%s',_0x2fbe7d,_0x2f06('0x10'));_0x5ce919(_0x358116['result'][_0x2f06('0x14')]);}})['catch'](function(_0x53617c){logger[_0x2f06('0x13')]('DeskAccount,\x20%s,\x20%s',_0x2fbe7d,_0x53617c);_0x1cbc1b(_0x53617c);});});}exports[_0x2f06('0x15')]=function(_0x8042a2){var _0x27eec9=this;return new Promise(function(_0x4794a0,_0x4cd042){return db[_0x2f06('0x16')][_0x2f06('0x17')]({'raw':_0x8042a2['options']?_0x8042a2['options']['raw']===undefined?!![]:![]:!![],'where':_0x8042a2[_0x2f06('0x18')]?_0x8042a2[_0x2f06('0x18')][_0x2f06('0x19')]||null:null,'attributes':_0x8042a2[_0x2f06('0x18')]?_0x8042a2[_0x2f06('0x18')][_0x2f06('0x1a')]||null:null,'limit':_0x8042a2[_0x2f06('0x18')]?_0x8042a2['options']['limit']||null:null,'include':_0x8042a2['options']?_0x8042a2['options'][_0x2f06('0x1b')]?_['map'](_0x8042a2[_0x2f06('0x18')]['include'],function(_0x2940b2){return{'model':db[_0x2940b2[_0x2f06('0x1c')]],'as':_0x2940b2['as'],'attributes':_0x2940b2[_0x2f06('0x1a')],'include':_0x2940b2[_0x2f06('0x1b')]?_['map'](_0x2940b2['include'],function(_0x19cf61){return{'model':db[_0x19cf61[_0x2f06('0x1c')]],'as':_0x19cf61['as'],'attributes':_0x19cf61[_0x2f06('0x1a')],'include':_0x19cf61[_0x2f06('0x1b')]?_[_0x2f06('0x1d')](_0x19cf61[_0x2f06('0x1b')],function(_0x361e7a){return{'model':db[_0x361e7a[_0x2f06('0x1c')]],'as':_0x361e7a['as'],'attributes':_0x361e7a[_0x2f06('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2f06('0xd')](function(_0x573f2a){logger[_0x2f06('0xe')]('GetDeskAccount',_0x8042a2);logger[_0x2f06('0x11')]('GetDeskAccount',_0x8042a2,JSON[_0x2f06('0x1e')](_0x573f2a));_0x4794a0(_0x573f2a);})[_0x2f06('0x1f')](function(_0x260af1){logger['error']('GetDeskAccount',_0x260af1[_0x2f06('0x14')],_0x8042a2);_0x4cd042(_0x27eec9[_0x2f06('0x13')](0x1f4,_0x260af1['message']));});});};exports['ShowDeskAccount']=function(_0xa1dffe){var _0x2e93e3=this;return new Promise(function(_0x271367,_0x5c8994){return db[_0x2f06('0x16')][_0x2f06('0x20')]({'raw':_0xa1dffe['options']?_0xa1dffe[_0x2f06('0x18')][_0x2f06('0x21')]===undefined?!![]:![]:!![],'where':_0xa1dffe[_0x2f06('0x18')]?_0xa1dffe[_0x2f06('0x18')][_0x2f06('0x19')]||null:null,'attributes':_0xa1dffe[_0x2f06('0x18')]?_0xa1dffe[_0x2f06('0x18')][_0x2f06('0x1a')]||null:null,'include':_0xa1dffe['options']?_0xa1dffe['options'][_0x2f06('0x1b')]?_[_0x2f06('0x1d')](_0xa1dffe[_0x2f06('0x18')][_0x2f06('0x1b')],function(_0x5b79ed){return{'model':db[_0x5b79ed['model']],'as':_0x5b79ed['as'],'attributes':_0x5b79ed[_0x2f06('0x1a')],'include':_0x5b79ed[_0x2f06('0x1b')]?_[_0x2f06('0x1d')](_0x5b79ed[_0x2f06('0x1b')],function(_0x5bc052){return{'model':db[_0x5bc052[_0x2f06('0x1c')]],'as':_0x5bc052['as'],'attributes':_0x5bc052['attributes'],'include':_0x5bc052['include']?_[_0x2f06('0x1d')](_0x5bc052[_0x2f06('0x1b')],function(_0x21f4a8){return{'model':db[_0x21f4a8[_0x2f06('0x1c')]],'as':_0x21f4a8['as'],'attributes':_0x21f4a8['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5c6b0e){logger[_0x2f06('0xe')](_0x2f06('0x22'),_0xa1dffe);logger[_0x2f06('0x11')]('ShowDeskAccount',_0xa1dffe,JSON['stringify'](_0x5c6b0e));_0x271367(_0x5c6b0e);})[_0x2f06('0x1f')](function(_0x557c0a){logger['error'](_0x2f06('0x22'),_0x557c0a[_0x2f06('0x14')],_0xa1dffe);_0x5c8994(_0x2e93e3[_0x2f06('0x13')](0x1f4,_0x557c0a[_0x2f06('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 105cdbb..7eeda12 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7217=['getDescriptions','/:id/tags','post','setTags','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x505f73,_0x1f95d8){var _0x227e7f=function(_0x112ae8){while(--_0x112ae8){_0x505f73['push'](_0x505f73['shift']());}};_0x227e7f(++_0x1f95d8);}(_0x7217,0x19e));var _0x7721=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x7217[_0x220dbb];return _0x2b77de;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getTags']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['put'](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router['delete']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);module[_0x7721('0x17')]=router; \ No newline at end of file +var _0x34e8=['../../config/environment','./intDeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4188f5,_0x1d9fa6){var _0x2a1580=function(_0xa79702){while(--_0xa79702){_0x4188f5['push'](_0x4188f5['shift']());}};_0x2a1580(++_0x1d9fa6);}(_0x34e8,0x12c));var _0x834e=function(_0x5429e0,_0x6d6110){_0x5429e0=_0x5429e0-0x0;var _0x4c194c=_0x34e8[_0x5429e0];return _0x4c194c;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xa')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0xa')](_0x834e('0x11'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0xa')](_0x834e('0x13'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);router[_0x834e('0xa')](_0x834e('0x15'),auth['isAuthenticated'](),controller[_0x834e('0x16')]);router[_0x834e('0x17')]('/',auth['isAuthenticated'](),controller[_0x834e('0x18')]);router[_0x834e('0x17')](_0x834e('0x15'),auth[_0x834e('0xd')](),controller['setTags']);router[_0x834e('0x19')](_0x834e('0xc'),auth['isAuthenticated'](),controller[_0x834e('0x1a')]);router['delete'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller['destroy']);module[_0x834e('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 6f64231..43c0192 100644 --- a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js +++ b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xefc4=['exports','STRING'];(function(_0x288583,_0x40e5ef){var _0x86dec2=function(_0x9488dc){while(--_0x9488dc){_0x288583['push'](_0x288583['shift']());}};_0x86dec2(++_0x40e5ef);}(_0xefc4,0x1b2));var _0x4efc=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0xefc4[_0x32b542];return _0x554d54;};'use strict';var Sequelize=require('sequelize');module[_0x4efc('0x0')]={'name':{'type':Sequelize[_0x4efc('0x1')]},'description':{'type':Sequelize[_0x4efc('0x1')]}}; \ No newline at end of file +var _0x653f=['STRING','sequelize'];(function(_0x2813db,_0x26f608){var _0x482039=function(_0x153984){while(--_0x153984){_0x2813db['push'](_0x2813db['shift']());}};_0x482039(++_0x26f608);}(_0x653f,0x14f));var _0xf653=function(_0xb22153,_0x4e400d){_0xb22153=_0xb22153-0x0;var _0x397d8a=_0x653f[_0xb22153];return _0x397d8a;};'use strict';var Sequelize=require(_0xf653('0x0'));module['exports']={'name':{'type':Sequelize[_0xf653('0x1')]},'description':{'type':Sequelize[_0xf653('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index d32033d..8359f50 100644 --- a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js +++ b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x21a7=['type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','DeskConfiguration','includeAll','include','findAll','rows','catch','show','find','create','body','params','destroy','findOne','getFields','getSubjects','getDescriptions','DeskField','getTags','Tag','setTags','ids','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x21a7,0x1db));var _0x721a=function(_0x24a136,_0x2c3bf1){_0x24a136=_0x24a136-0x0;var _0x2f58ba=_0x21a7[_0x24a136];return _0x2f58ba;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x721a('0x0'));var zipdir=require(_0x721a('0x1'));var jsonpatch=require(_0x721a('0x2'));var rp=require('request-promise');var moment=require(_0x721a('0x3'));var BPromise=require(_0x721a('0x4'));var Mustache=require(_0x721a('0x5'));var util=require(_0x721a('0x6'));var path=require('path');var sox=require(_0x721a('0x7'));var csv=require(_0x721a('0x8'));var ejs=require(_0x721a('0x9'));var fs=require('fs');var fs_extra=require(_0x721a('0xa'));var _=require('lodash');var squel=require(_0x721a('0xb'));var crypto=require('crypto');var jsforce=require(_0x721a('0xc'));var deskjs=require(_0x721a('0xd'));var toCsv=require(_0x721a('0x8'));var querystring=require(_0x721a('0xe'));var Papa=require(_0x721a('0xf'));var Redis=require('ioredis');var authService=require(_0x721a('0x10'));var qs=require(_0x721a('0x11'));var as=require(_0x721a('0x12'));var hardwareService=require(_0x721a('0x13'));var logger=require(_0x721a('0x14'))(_0x721a('0x15'));var utils=require(_0x721a('0x16'));var config=require(_0x721a('0x17'));var licenseUtil=require(_0x721a('0x18'));var db=require(_0x721a('0x19'))['db'];function respondWithStatusCode(_0xe6f43f,_0x43c057){_0x43c057=_0x43c057||0xcc;return function(_0x35fe6a){if(_0x35fe6a){return _0xe6f43f[_0x721a('0x1a')](_0x43c057);}return _0xe6f43f[_0x721a('0x1b')](_0x43c057)[_0x721a('0x1c')]();};}function respondWithResult(_0x22dbae,_0xfa7af0){_0xfa7af0=_0xfa7af0||0xc8;return function(_0x508080){if(_0x508080){return _0x22dbae['status'](_0xfa7af0)[_0x721a('0x1d')](_0x508080);}};}function respondWithFilteredResult(_0x1d632a,_0xd7fb28){return function(_0x332c24){if(_0x332c24){var _0x834825=typeof _0xd7fb28['offset']==='undefined'&&typeof _0xd7fb28[_0x721a('0x1e')]==='undefined';var _0x4df5dc=_0x332c24[_0x721a('0x1f')];var _0x3e19fb=_0x834825?0x0:_0xd7fb28[_0x721a('0x20')];var _0x3bb1b6=_0x834825?_0x332c24[_0x721a('0x1f')]:_0xd7fb28[_0x721a('0x20')]+_0xd7fb28[_0x721a('0x1e')];var _0x3928e4;if(_0x3bb1b6>=_0x4df5dc){_0x3bb1b6=_0x4df5dc;_0x3928e4=0xc8;}else{_0x3928e4=0xce;}_0x1d632a['status'](_0x3928e4);return _0x1d632a[_0x721a('0x21')](_0x721a('0x22'),_0x3e19fb+'-'+_0x3bb1b6+'/'+_0x4df5dc)[_0x721a('0x1d')](_0x332c24);}return null;};}function patchUpdates(_0x5ae571){return function(_0x3f48ac){try{jsonpatch[_0x721a('0x23')](_0x3f48ac,_0x5ae571,!![]);}catch(_0x44f17e){return BPromise['reject'](_0x44f17e);}return _0x3f48ac[_0x721a('0x24')]();};}function saveUpdates(_0x55e1e5,_0x3977fa){return function(_0x75d0aa){if(_0x75d0aa){return _0x75d0aa[_0x721a('0x25')](_0x55e1e5)[_0x721a('0x26')](function(_0x273a5a){return _0x273a5a;});}return null;};}function removeEntity(_0x259ff7,_0x1e7af5){return function(_0xbdfa4){if(_0xbdfa4){return _0xbdfa4['destroy']()[_0x721a('0x26')](function(){_0x259ff7['status'](0xcc)[_0x721a('0x1c')]();});}};}function handleEntityNotFound(_0xe29adc,_0x3a58df){return function(_0xb50c70){if(!_0xb50c70){_0xe29adc['sendStatus'](0x194);}return _0xb50c70;};}function handleError(_0x323e16,_0x364049){_0x364049=_0x364049||0x1f4;return function(_0x27be1f){logger[_0x721a('0x27')](_0x27be1f[_0x721a('0x28')]);if(_0x27be1f['name']){delete _0x27be1f[_0x721a('0x29')];}_0x323e16[_0x721a('0x1b')](_0x364049)[_0x721a('0x2a')](_0x27be1f);};}exports[_0x721a('0x2b')]=function(_0x11625e,_0x394883){var _0x4649ac={},_0x28dee8={},_0xb9952f={'count':0x0,'rows':[]};var _0x53305c=_[_0x721a('0x2c')](db['DeskConfiguration'][_0x721a('0x2d')],function(_0x293b51){return{'name':_0x293b51[_0x721a('0x2e')],'type':_0x293b51[_0x721a('0x2f')][_0x721a('0x30')]};});_0x28dee8['model']=_[_0x721a('0x2c')](_0x53305c,_0x721a('0x29'));_0x28dee8[_0x721a('0x31')]=_[_0x721a('0x32')](_0x11625e['query']);_0x28dee8[_0x721a('0x33')]=_[_0x721a('0x34')](_0x28dee8[_0x721a('0x35')],_0x28dee8[_0x721a('0x31')]);_0x4649ac[_0x721a('0x36')]=_[_0x721a('0x34')](_0x28dee8['model'],qs[_0x721a('0x37')](_0x11625e[_0x721a('0x31')]['fields']));_0x4649ac['attributes']=_0x4649ac['attributes'][_0x721a('0x38')]?_0x4649ac['attributes']:_0x28dee8[_0x721a('0x35')];if(!_0x11625e[_0x721a('0x31')][_0x721a('0x39')](_0x721a('0x3a'))){_0x4649ac[_0x721a('0x1e')]=qs[_0x721a('0x1e')](_0x11625e[_0x721a('0x31')][_0x721a('0x1e')]);_0x4649ac[_0x721a('0x20')]=qs[_0x721a('0x20')](_0x11625e[_0x721a('0x31')]['offset']);}_0x4649ac[_0x721a('0x3b')]=qs['sort'](_0x11625e[_0x721a('0x31')][_0x721a('0x3c')]);_0x4649ac[_0x721a('0x3d')]=qs[_0x721a('0x33')](_[_0x721a('0x3e')](_0x11625e['query'],_0x28dee8[_0x721a('0x33')]),_0x53305c);if(_0x11625e[_0x721a('0x31')][_0x721a('0x3f')]){_0x4649ac[_0x721a('0x3d')]=_[_0x721a('0x40')](_0x4649ac['where'],{'$or':_['map'](_0x53305c,function(_0x3217d1){if(_0x3217d1['type']!=='VIRTUAL'){var _0x55f869={};_0x55f869[_0x3217d1[_0x721a('0x29')]]={'$like':'%'+_0x11625e[_0x721a('0x31')][_0x721a('0x3f')]+'%'};return _0x55f869;}})});}_0x4649ac=_[_0x721a('0x40')]({},_0x4649ac,_0x11625e[_0x721a('0x41')]);var _0x25e055={'where':_0x4649ac[_0x721a('0x3d')]};return db[_0x721a('0x42')][_0x721a('0x1f')](_0x25e055)[_0x721a('0x26')](function(_0x30e3e6){_0xb9952f['count']=_0x30e3e6;if(_0x11625e['query'][_0x721a('0x43')]){_0x4649ac[_0x721a('0x44')]=[{'all':!![]}];}return db[_0x721a('0x42')][_0x721a('0x45')](_0x4649ac);})[_0x721a('0x26')](function(_0x11bdf4){_0xb9952f[_0x721a('0x46')]=_0x11bdf4;return _0xb9952f;})['then'](respondWithFilteredResult(_0x394883,_0x4649ac))[_0x721a('0x47')](handleError(_0x394883,null));};exports[_0x721a('0x48')]=function(_0x56e233,_0x17f5bf){var _0x3c1d8d={'raw':![],'where':{'id':_0x56e233['params']['id']}},_0xe51704={};_0xe51704[_0x721a('0x35')]=_['keys'](db[_0x721a('0x42')][_0x721a('0x2d')]);_0xe51704[_0x721a('0x31')]=_[_0x721a('0x32')](_0x56e233['query']);_0xe51704[_0x721a('0x33')]=_['intersection'](_0xe51704[_0x721a('0x35')],_0xe51704['query']);_0x3c1d8d[_0x721a('0x36')]=_['intersection'](_0xe51704[_0x721a('0x35')],qs['fields'](_0x56e233['query'][_0x721a('0x37')]));_0x3c1d8d[_0x721a('0x36')]=_0x3c1d8d[_0x721a('0x36')][_0x721a('0x38')]?_0x3c1d8d[_0x721a('0x36')]:_0xe51704['model'];if(_0x56e233[_0x721a('0x31')]['includeAll']){_0x3c1d8d[_0x721a('0x44')]=[{'all':!![]}];}_0x3c1d8d=_[_0x721a('0x40')]({},_0x3c1d8d,_0x56e233[_0x721a('0x41')]);return db[_0x721a('0x42')][_0x721a('0x49')](_0x3c1d8d)['then'](handleEntityNotFound(_0x17f5bf,null))[_0x721a('0x26')](respondWithResult(_0x17f5bf,null))['catch'](handleError(_0x17f5bf,null));};exports[_0x721a('0x4a')]=function(_0x6b5821,_0x2fd7c4){return db[_0x721a('0x42')][_0x721a('0x4a')](_0x6b5821['body'],{})['then'](respondWithResult(_0x2fd7c4,0xc9))[_0x721a('0x47')](handleError(_0x2fd7c4,null));};exports[_0x721a('0x25')]=function(_0x36406a,_0x6d3669){if(_0x36406a[_0x721a('0x4b')]['id']){delete _0x36406a[_0x721a('0x4b')]['id'];}return db[_0x721a('0x42')][_0x721a('0x49')]({'where':{'id':_0x36406a[_0x721a('0x4c')]['id']}})[_0x721a('0x26')](handleEntityNotFound(_0x6d3669,null))[_0x721a('0x26')](saveUpdates(_0x36406a[_0x721a('0x4b')],null))[_0x721a('0x26')](respondWithResult(_0x6d3669,null))[_0x721a('0x47')](handleError(_0x6d3669,null));};exports[_0x721a('0x4d')]=function(_0xa5589d,_0x229472){return db[_0x721a('0x42')][_0x721a('0x49')]({'where':{'id':_0xa5589d[_0x721a('0x4c')]['id']}})[_0x721a('0x26')](handleEntityNotFound(_0x229472,null))[_0x721a('0x26')](removeEntity(_0x229472,null))['catch'](handleError(_0x229472,null));};exports['getFields']=function(_0x46ff8b,_0x34c51d,_0x1c5521){var _0x2e63b2={};var _0x276e36={};var _0x3a043b;var _0x54ae9f;return db[_0x721a('0x42')][_0x721a('0x4e')]({'where':{'id':_0x46ff8b[_0x721a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x34c51d,null))[_0x721a('0x26')](function(_0x2688ee){if(_0x2688ee){_0x3a043b=_0x2688ee;_0x276e36[_0x721a('0x35')]=_[_0x721a('0x32')](db['DeskField'][_0x721a('0x2d')]);_0x276e36[_0x721a('0x31')]=_['keys'](_0x46ff8b[_0x721a('0x31')]);_0x276e36['filters']=_[_0x721a('0x34')](_0x276e36[_0x721a('0x35')],_0x276e36[_0x721a('0x31')]);_0x2e63b2[_0x721a('0x36')]=_['intersection'](_0x276e36['model'],qs[_0x721a('0x37')](_0x46ff8b[_0x721a('0x31')][_0x721a('0x37')]));_0x2e63b2[_0x721a('0x36')]=_0x2e63b2['attributes'][_0x721a('0x38')]?_0x2e63b2[_0x721a('0x36')]:_0x276e36['model'];_0x2e63b2[_0x721a('0x3b')]=qs['sort'](_0x46ff8b[_0x721a('0x31')][_0x721a('0x3c')]);_0x2e63b2['where']=qs[_0x721a('0x33')](_['pick'](_0x46ff8b[_0x721a('0x31')],_0x276e36[_0x721a('0x33')]));if(_0x46ff8b[_0x721a('0x31')]['filter']){_0x2e63b2[_0x721a('0x3d')]=_[_0x721a('0x40')](_0x2e63b2[_0x721a('0x3d')],{'$or':_[_0x721a('0x2c')](_0x2e63b2[_0x721a('0x36')],function(_0x41979a){var _0x12f01e={};_0x12f01e[_0x41979a]={'$like':'%'+_0x46ff8b[_0x721a('0x31')][_0x721a('0x3f')]+'%'};return _0x12f01e;})});}_0x2e63b2=_[_0x721a('0x40')]({},_0x2e63b2,_0x46ff8b[_0x721a('0x41')]);return _0x3a043b[_0x721a('0x4f')](_0x2e63b2);}})[_0x721a('0x26')](function(_0x1bf180){if(_0x1bf180){_0x54ae9f=_0x1bf180['length'];if(!_0x46ff8b[_0x721a('0x31')][_0x721a('0x39')](_0x721a('0x3a'))){_0x2e63b2[_0x721a('0x1e')]=qs[_0x721a('0x1e')](_0x46ff8b[_0x721a('0x31')][_0x721a('0x1e')]);_0x2e63b2[_0x721a('0x20')]=qs['offset'](_0x46ff8b[_0x721a('0x31')][_0x721a('0x20')]);}return _0x3a043b[_0x721a('0x4f')](_0x2e63b2);}})['then'](function(_0x3324d6){if(_0x3324d6){return _0x3324d6?{'count':_0x54ae9f,'rows':_0x3324d6}:null;}})[_0x721a('0x26')](respondWithResult(_0x34c51d,null))['catch'](handleError(_0x34c51d,null));};exports['getSubjects']=function(_0x464214,_0x248db8,_0x10ac21){var _0x42d42f={};var _0x4c80c6={};var _0x3086fb;var _0x46f573;return db[_0x721a('0x42')][_0x721a('0x4e')]({'where':{'id':_0x464214[_0x721a('0x4c')]['id']}})[_0x721a('0x26')](handleEntityNotFound(_0x248db8,null))[_0x721a('0x26')](function(_0x1ba862){if(_0x1ba862){_0x3086fb=_0x1ba862;_0x4c80c6[_0x721a('0x35')]=_[_0x721a('0x32')](db['DeskField'][_0x721a('0x2d')]);_0x4c80c6[_0x721a('0x31')]=_[_0x721a('0x32')](_0x464214[_0x721a('0x31')]);_0x4c80c6[_0x721a('0x33')]=_[_0x721a('0x34')](_0x4c80c6[_0x721a('0x35')],_0x4c80c6[_0x721a('0x31')]);_0x42d42f[_0x721a('0x36')]=_[_0x721a('0x34')](_0x4c80c6[_0x721a('0x35')],qs['fields'](_0x464214[_0x721a('0x31')]['fields']));_0x42d42f[_0x721a('0x36')]=_0x42d42f['attributes']['length']?_0x42d42f[_0x721a('0x36')]:_0x4c80c6[_0x721a('0x35')];_0x42d42f[_0x721a('0x3b')]=qs[_0x721a('0x3c')](_0x464214[_0x721a('0x31')][_0x721a('0x3c')]);_0x42d42f[_0x721a('0x3d')]=qs[_0x721a('0x33')](_['pick'](_0x464214['query'],_0x4c80c6[_0x721a('0x33')]));if(_0x464214['query'][_0x721a('0x3f')]){_0x42d42f[_0x721a('0x3d')]=_['merge'](_0x42d42f[_0x721a('0x3d')],{'$or':_['map'](_0x42d42f[_0x721a('0x36')],function(_0x450e08){var _0x1b5710={};_0x1b5710[_0x450e08]={'$like':'%'+_0x464214['query'][_0x721a('0x3f')]+'%'};return _0x1b5710;})});}_0x42d42f=_[_0x721a('0x40')]({},_0x42d42f,_0x464214[_0x721a('0x41')]);return _0x3086fb[_0x721a('0x50')](_0x42d42f);}})['then'](function(_0x462f9a){if(_0x462f9a){_0x46f573=_0x462f9a[_0x721a('0x38')];if(!_0x464214[_0x721a('0x31')][_0x721a('0x39')](_0x721a('0x3a'))){_0x42d42f[_0x721a('0x1e')]=qs[_0x721a('0x1e')](_0x464214['query'][_0x721a('0x1e')]);_0x42d42f['offset']=qs[_0x721a('0x20')](_0x464214[_0x721a('0x31')][_0x721a('0x20')]);}return _0x3086fb[_0x721a('0x50')](_0x42d42f);}})[_0x721a('0x26')](function(_0x4072c8){if(_0x4072c8){return _0x4072c8?{'count':_0x46f573,'rows':_0x4072c8}:null;}})[_0x721a('0x26')](respondWithResult(_0x248db8,null))[_0x721a('0x47')](handleError(_0x248db8,null));};exports[_0x721a('0x51')]=function(_0x43ab66,_0x35b34b,_0xecba65){var _0x3ae2bf={};var _0x45566b={};var _0x3aea97;var _0x391d75;return db[_0x721a('0x42')][_0x721a('0x4e')]({'where':{'id':_0x43ab66[_0x721a('0x4c')]['id']}})[_0x721a('0x26')](handleEntityNotFound(_0x35b34b,null))[_0x721a('0x26')](function(_0x1abe59){if(_0x1abe59){_0x3aea97=_0x1abe59;_0x45566b[_0x721a('0x35')]=_[_0x721a('0x32')](db[_0x721a('0x52')]['rawAttributes']);_0x45566b['query']=_[_0x721a('0x32')](_0x43ab66['query']);_0x45566b[_0x721a('0x33')]=_[_0x721a('0x34')](_0x45566b[_0x721a('0x35')],_0x45566b[_0x721a('0x31')]);_0x3ae2bf['attributes']=_[_0x721a('0x34')](_0x45566b[_0x721a('0x35')],qs[_0x721a('0x37')](_0x43ab66['query']['fields']));_0x3ae2bf[_0x721a('0x36')]=_0x3ae2bf[_0x721a('0x36')][_0x721a('0x38')]?_0x3ae2bf[_0x721a('0x36')]:_0x45566b[_0x721a('0x35')];_0x3ae2bf[_0x721a('0x3b')]=qs[_0x721a('0x3c')](_0x43ab66['query']['sort']);_0x3ae2bf[_0x721a('0x3d')]=qs['filters'](_[_0x721a('0x3e')](_0x43ab66['query'],_0x45566b['filters']));if(_0x43ab66[_0x721a('0x31')][_0x721a('0x3f')]){_0x3ae2bf[_0x721a('0x3d')]=_['merge'](_0x3ae2bf[_0x721a('0x3d')],{'$or':_[_0x721a('0x2c')](_0x3ae2bf['attributes'],function(_0x4b837d){var _0x4ddf7f={};_0x4ddf7f[_0x4b837d]={'$like':'%'+_0x43ab66[_0x721a('0x31')][_0x721a('0x3f')]+'%'};return _0x4ddf7f;})});}_0x3ae2bf=_[_0x721a('0x40')]({},_0x3ae2bf,_0x43ab66[_0x721a('0x41')]);return _0x3aea97[_0x721a('0x51')](_0x3ae2bf);}})[_0x721a('0x26')](function(_0x1d3aeb){if(_0x1d3aeb){_0x391d75=_0x1d3aeb[_0x721a('0x38')];if(!_0x43ab66[_0x721a('0x31')][_0x721a('0x39')](_0x721a('0x3a'))){_0x3ae2bf[_0x721a('0x1e')]=qs[_0x721a('0x1e')](_0x43ab66[_0x721a('0x31')]['limit']);_0x3ae2bf[_0x721a('0x20')]=qs[_0x721a('0x20')](_0x43ab66[_0x721a('0x31')]['offset']);}return _0x3aea97['getDescriptions'](_0x3ae2bf);}})[_0x721a('0x26')](function(_0x1b1c18){if(_0x1b1c18){return _0x1b1c18?{'count':_0x391d75,'rows':_0x1b1c18}:null;}})[_0x721a('0x26')](respondWithResult(_0x35b34b,null))[_0x721a('0x47')](handleError(_0x35b34b,null));};exports[_0x721a('0x53')]=function(_0x58facc,_0xae8e11,_0x2299b4){var _0x56d6bb={};var _0x680baa={};var _0x56f288;var _0x2f4aaf;return db['DeskConfiguration']['findOne']({'where':{'id':_0x58facc[_0x721a('0x4c')]['id']}})['then'](handleEntityNotFound(_0xae8e11,null))['then'](function(_0x4c0d2b){if(_0x4c0d2b){_0x56f288=_0x4c0d2b;_0x680baa[_0x721a('0x35')]=_[_0x721a('0x32')](db[_0x721a('0x54')][_0x721a('0x2d')]);_0x680baa['query']=_[_0x721a('0x32')](_0x58facc[_0x721a('0x31')]);_0x680baa[_0x721a('0x33')]=_['intersection'](_0x680baa['model'],_0x680baa[_0x721a('0x31')]);_0x56d6bb[_0x721a('0x36')]=_['intersection'](_0x680baa['model'],qs['fields'](_0x58facc[_0x721a('0x31')][_0x721a('0x37')]));_0x56d6bb[_0x721a('0x36')]=_0x56d6bb['attributes'][_0x721a('0x38')]?_0x56d6bb[_0x721a('0x36')]:_0x680baa[_0x721a('0x35')];_0x56d6bb[_0x721a('0x3b')]=qs[_0x721a('0x3c')](_0x58facc[_0x721a('0x31')][_0x721a('0x3c')]);_0x56d6bb[_0x721a('0x3d')]=qs['filters'](_[_0x721a('0x3e')](_0x58facc[_0x721a('0x31')],_0x680baa['filters']));if(_0x58facc[_0x721a('0x31')][_0x721a('0x3f')]){_0x56d6bb[_0x721a('0x3d')]=_[_0x721a('0x40')](_0x56d6bb[_0x721a('0x3d')],{'$or':_[_0x721a('0x2c')](_0x56d6bb[_0x721a('0x36')],function(_0x3f85de){var _0x495d90={};_0x495d90[_0x3f85de]={'$like':'%'+_0x58facc[_0x721a('0x31')]['filter']+'%'};return _0x495d90;})});}_0x56d6bb=_[_0x721a('0x40')]({},_0x56d6bb,_0x58facc[_0x721a('0x41')]);return _0x56f288['getTags'](_0x56d6bb);}})[_0x721a('0x26')](function(_0x266b34){if(_0x266b34){_0x2f4aaf=_0x266b34['length'];if(!_0x58facc[_0x721a('0x31')][_0x721a('0x39')](_0x721a('0x3a'))){_0x56d6bb['limit']=qs[_0x721a('0x1e')](_0x58facc[_0x721a('0x31')][_0x721a('0x1e')]);_0x56d6bb['offset']=qs[_0x721a('0x20')](_0x58facc['query']['offset']);}return _0x56f288[_0x721a('0x53')](_0x56d6bb);}})[_0x721a('0x26')](function(_0x448269){if(_0x448269){return _0x448269?{'count':_0x2f4aaf,'rows':_0x448269}:null;}})[_0x721a('0x26')](respondWithResult(_0xae8e11,null))[_0x721a('0x47')](handleError(_0xae8e11,null));};exports[_0x721a('0x55')]=function(_0x1f0084,_0x57a247,_0x3e57fd){if(_0x1f0084[_0x721a('0x4b')]['id']){delete _0x1f0084['body']['id'];}return db['DeskConfiguration']['findOne']({'where':{'id':_0x1f0084['params']['id']}})[_0x721a('0x26')](handleEntityNotFound(_0x57a247,null))['then'](function(_0x322717){if(_0x322717){return _0x322717[_0x721a('0x55')](_0x1f0084[_0x721a('0x4b')][_0x721a('0x56')]||[]);}return null;})[_0x721a('0x26')](respondWithResult(_0x57a247,null))[_0x721a('0x47')](handleError(_0x57a247,null));}; \ No newline at end of file +var _0x31ee=['nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','catch','create','body','params','findOne','DeskField','order','getFields','getSubjects','getDescriptions','Tag','setTags','rimraf','zip-dir','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','DeskConfiguration','rawAttributes','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty'];(function(_0x1e1a0a,_0x4eeab5){var _0xf789e9=function(_0x5d1fea){while(--_0x5d1fea){_0x1e1a0a['push'](_0x1e1a0a['shift']());}};_0xf789e9(++_0x4eeab5);}(_0x31ee,0x10d));var _0xe31e=function(_0x3f17eb,_0x1c7e40){_0x3f17eb=_0x3f17eb-0x0;var _0x5efb4e=_0x31ee[_0x3f17eb];return _0x5efb4e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe31e('0x0'));var zipdir=require(_0xe31e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe31e('0x2'));var util=require(_0xe31e('0x3'));var path=require('path');var sox=require(_0xe31e('0x4'));var csv=require(_0xe31e('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe31e('0x6'));var _=require(_0xe31e('0x7'));var squel=require('squel');var crypto=require(_0xe31e('0x8'));var jsforce=require(_0xe31e('0x9'));var deskjs=require(_0xe31e('0xa'));var toCsv=require(_0xe31e('0x5'));var querystring=require(_0xe31e('0xb'));var Papa=require(_0xe31e('0xc'));var Redis=require(_0xe31e('0xd'));var authService=require(_0xe31e('0xe'));var qs=require(_0xe31e('0xf'));var as=require(_0xe31e('0x10'));var hardwareService=require(_0xe31e('0x11'));var logger=require(_0xe31e('0x12'))(_0xe31e('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe31e('0x14'));var db=require(_0xe31e('0x15'))['db'];function respondWithStatusCode(_0x3e607a,_0x597c16){_0x597c16=_0x597c16||0xcc;return function(_0x15f541){if(_0x15f541){return _0x3e607a[_0xe31e('0x16')](_0x597c16);}return _0x3e607a[_0xe31e('0x17')](_0x597c16)['end']();};}function respondWithResult(_0x2b076,_0x45ae69){_0x45ae69=_0x45ae69||0xc8;return function(_0x3305e8){if(_0x3305e8){return _0x2b076[_0xe31e('0x17')](_0x45ae69)[_0xe31e('0x18')](_0x3305e8);}};}function respondWithFilteredResult(_0x1d5dd6,_0x209df6){return function(_0x25da3a){if(_0x25da3a){var _0x1766c2=typeof _0x209df6[_0xe31e('0x19')]===_0xe31e('0x1a')&&typeof _0x209df6[_0xe31e('0x1b')]===_0xe31e('0x1a');var _0x242699=_0x25da3a['count'];var _0x1781df=_0x1766c2?0x0:_0x209df6[_0xe31e('0x19')];var _0x51e922=_0x1766c2?_0x25da3a[_0xe31e('0x1c')]:_0x209df6[_0xe31e('0x19')]+_0x209df6[_0xe31e('0x1b')];var _0x3a60cc;if(_0x51e922>=_0x242699){_0x51e922=_0x242699;_0x3a60cc=0xc8;}else{_0x3a60cc=0xce;}_0x1d5dd6[_0xe31e('0x17')](_0x3a60cc);return _0x1d5dd6[_0xe31e('0x1d')](_0xe31e('0x1e'),_0x1781df+'-'+_0x51e922+'/'+_0x242699)[_0xe31e('0x18')](_0x25da3a);}return null;};}function patchUpdates(_0x510bd0){return function(_0x163f24){try{jsonpatch[_0xe31e('0x1f')](_0x163f24,_0x510bd0,!![]);}catch(_0x559479){return BPromise[_0xe31e('0x20')](_0x559479);}return _0x163f24[_0xe31e('0x21')]();};}function saveUpdates(_0x45ef91,_0xc640c8){return function(_0x11ef3a){if(_0x11ef3a){return _0x11ef3a[_0xe31e('0x22')](_0x45ef91)[_0xe31e('0x23')](function(_0x186426){return _0x186426;});}return null;};}function removeEntity(_0x186585,_0x1130fc){return function(_0x24cea0){if(_0x24cea0){return _0x24cea0[_0xe31e('0x24')]()[_0xe31e('0x23')](function(){_0x186585[_0xe31e('0x17')](0xcc)[_0xe31e('0x25')]();});}};}function handleEntityNotFound(_0x23fb8d,_0x51dfbf){return function(_0x4d24d4){if(!_0x4d24d4){_0x23fb8d['sendStatus'](0x194);}return _0x4d24d4;};}function handleError(_0x2594fe,_0x180f1a){_0x180f1a=_0x180f1a||0x1f4;return function(_0x5d6087){logger[_0xe31e('0x26')](_0x5d6087['stack']);if(_0x5d6087[_0xe31e('0x27')]){delete _0x5d6087[_0xe31e('0x27')];}_0x2594fe[_0xe31e('0x17')](_0x180f1a)[_0xe31e('0x28')](_0x5d6087);};}exports['index']=function(_0x4f47c8,_0x5e3b7d){var _0x10ba81={},_0x18db62={},_0x40ec9d={'count':0x0,'rows':[]};var _0x17880d=_['map'](db[_0xe31e('0x29')][_0xe31e('0x2a')],function(_0x3136e8){return{'name':_0x3136e8['fieldName'],'type':_0x3136e8[_0xe31e('0x2b')][_0xe31e('0x2c')]};});_0x18db62[_0xe31e('0x2d')]=_[_0xe31e('0x2e')](_0x17880d,_0xe31e('0x27'));_0x18db62[_0xe31e('0x2f')]=_[_0xe31e('0x30')](_0x4f47c8[_0xe31e('0x2f')]);_0x18db62[_0xe31e('0x31')]=_['intersection'](_0x18db62[_0xe31e('0x2d')],_0x18db62[_0xe31e('0x2f')]);_0x10ba81[_0xe31e('0x32')]=_[_0xe31e('0x33')](_0x18db62[_0xe31e('0x2d')],qs[_0xe31e('0x34')](_0x4f47c8[_0xe31e('0x2f')][_0xe31e('0x34')]));_0x10ba81[_0xe31e('0x32')]=_0x10ba81['attributes'][_0xe31e('0x35')]?_0x10ba81[_0xe31e('0x32')]:_0x18db62['model'];if(!_0x4f47c8['query'][_0xe31e('0x36')](_0xe31e('0x37'))){_0x10ba81['limit']=qs['limit'](_0x4f47c8['query'][_0xe31e('0x1b')]);_0x10ba81[_0xe31e('0x19')]=qs[_0xe31e('0x19')](_0x4f47c8[_0xe31e('0x2f')][_0xe31e('0x19')]);}_0x10ba81['order']=qs[_0xe31e('0x38')](_0x4f47c8[_0xe31e('0x2f')][_0xe31e('0x38')]);_0x10ba81[_0xe31e('0x39')]=qs[_0xe31e('0x31')](_[_0xe31e('0x3a')](_0x4f47c8[_0xe31e('0x2f')],_0x18db62[_0xe31e('0x31')]),_0x17880d);if(_0x4f47c8['query'][_0xe31e('0x3b')]){_0x10ba81[_0xe31e('0x39')]=_[_0xe31e('0x3c')](_0x10ba81[_0xe31e('0x39')],{'$or':_[_0xe31e('0x2e')](_0x17880d,function(_0x4b3db1){if(_0x4b3db1[_0xe31e('0x2b')]!==_0xe31e('0x3d')){var _0x28a1f8={};_0x28a1f8[_0x4b3db1[_0xe31e('0x27')]]={'$like':'%'+_0x4f47c8['query'][_0xe31e('0x3b')]+'%'};return _0x28a1f8;}})});}_0x10ba81=_[_0xe31e('0x3c')]({},_0x10ba81,_0x4f47c8[_0xe31e('0x3e')]);var _0x421875={'where':_0x10ba81[_0xe31e('0x39')]};return db[_0xe31e('0x29')]['count'](_0x421875)['then'](function(_0x407045){_0x40ec9d[_0xe31e('0x1c')]=_0x407045;if(_0x4f47c8[_0xe31e('0x2f')][_0xe31e('0x3f')]){_0x10ba81[_0xe31e('0x40')]=[{'all':!![]}];}return db['DeskConfiguration'][_0xe31e('0x41')](_0x10ba81);})['then'](function(_0x4cfa5e){_0x40ec9d[_0xe31e('0x42')]=_0x4cfa5e;return _0x40ec9d;})[_0xe31e('0x23')](respondWithFilteredResult(_0x5e3b7d,_0x10ba81))['catch'](handleError(_0x5e3b7d,null));};exports[_0xe31e('0x43')]=function(_0x266d1d,_0x50aff2){var _0x5f3af4={'raw':![],'where':{'id':_0x266d1d['params']['id']}},_0x38502d={};_0x38502d[_0xe31e('0x2d')]=_[_0xe31e('0x30')](db[_0xe31e('0x29')][_0xe31e('0x2a')]);_0x38502d['query']=_[_0xe31e('0x30')](_0x266d1d[_0xe31e('0x2f')]);_0x38502d[_0xe31e('0x31')]=_[_0xe31e('0x33')](_0x38502d[_0xe31e('0x2d')],_0x38502d['query']);_0x5f3af4[_0xe31e('0x32')]=_[_0xe31e('0x33')](_0x38502d[_0xe31e('0x2d')],qs[_0xe31e('0x34')](_0x266d1d[_0xe31e('0x2f')]['fields']));_0x5f3af4[_0xe31e('0x32')]=_0x5f3af4[_0xe31e('0x32')]['length']?_0x5f3af4['attributes']:_0x38502d[_0xe31e('0x2d')];if(_0x266d1d[_0xe31e('0x2f')][_0xe31e('0x3f')]){_0x5f3af4['include']=[{'all':!![]}];}_0x5f3af4=_[_0xe31e('0x3c')]({},_0x5f3af4,_0x266d1d['options']);return db[_0xe31e('0x29')][_0xe31e('0x44')](_0x5f3af4)[_0xe31e('0x23')](handleEntityNotFound(_0x50aff2,null))[_0xe31e('0x23')](respondWithResult(_0x50aff2,null))[_0xe31e('0x45')](handleError(_0x50aff2,null));};exports[_0xe31e('0x46')]=function(_0x2dc970,_0x4e0436){return db['DeskConfiguration'][_0xe31e('0x46')](_0x2dc970[_0xe31e('0x47')],{})[_0xe31e('0x23')](respondWithResult(_0x4e0436,0xc9))[_0xe31e('0x45')](handleError(_0x4e0436,null));};exports['update']=function(_0x8ac42b,_0x42517a){if(_0x8ac42b[_0xe31e('0x47')]['id']){delete _0x8ac42b['body']['id'];}return db[_0xe31e('0x29')][_0xe31e('0x44')]({'where':{'id':_0x8ac42b[_0xe31e('0x48')]['id']}})['then'](handleEntityNotFound(_0x42517a,null))[_0xe31e('0x23')](saveUpdates(_0x8ac42b[_0xe31e('0x47')],null))[_0xe31e('0x23')](respondWithResult(_0x42517a,null))[_0xe31e('0x45')](handleError(_0x42517a,null));};exports[_0xe31e('0x24')]=function(_0xb0836c,_0xfddd1){return db[_0xe31e('0x29')][_0xe31e('0x44')]({'where':{'id':_0xb0836c[_0xe31e('0x48')]['id']}})[_0xe31e('0x23')](handleEntityNotFound(_0xfddd1,null))[_0xe31e('0x23')](removeEntity(_0xfddd1,null))[_0xe31e('0x45')](handleError(_0xfddd1,null));};exports['getFields']=function(_0x2bd7ba,_0x1f469f,_0x5ac288){var _0x34c117={};var _0x534296={};var _0x171a66;var _0x56d2f0;return db[_0xe31e('0x29')][_0xe31e('0x49')]({'where':{'id':_0x2bd7ba[_0xe31e('0x48')]['id']}})[_0xe31e('0x23')](handleEntityNotFound(_0x1f469f,null))['then'](function(_0x4605a5){if(_0x4605a5){_0x171a66=_0x4605a5;_0x534296[_0xe31e('0x2d')]=_[_0xe31e('0x30')](db[_0xe31e('0x4a')]['rawAttributes']);_0x534296[_0xe31e('0x2f')]=_[_0xe31e('0x30')](_0x2bd7ba[_0xe31e('0x2f')]);_0x534296[_0xe31e('0x31')]=_[_0xe31e('0x33')](_0x534296[_0xe31e('0x2d')],_0x534296[_0xe31e('0x2f')]);_0x34c117[_0xe31e('0x32')]=_[_0xe31e('0x33')](_0x534296[_0xe31e('0x2d')],qs[_0xe31e('0x34')](_0x2bd7ba[_0xe31e('0x2f')][_0xe31e('0x34')]));_0x34c117[_0xe31e('0x32')]=_0x34c117[_0xe31e('0x32')]['length']?_0x34c117[_0xe31e('0x32')]:_0x534296['model'];_0x34c117[_0xe31e('0x4b')]=qs[_0xe31e('0x38')](_0x2bd7ba[_0xe31e('0x2f')][_0xe31e('0x38')]);_0x34c117[_0xe31e('0x39')]=qs[_0xe31e('0x31')](_[_0xe31e('0x3a')](_0x2bd7ba[_0xe31e('0x2f')],_0x534296['filters']));if(_0x2bd7ba[_0xe31e('0x2f')][_0xe31e('0x3b')]){_0x34c117[_0xe31e('0x39')]=_[_0xe31e('0x3c')](_0x34c117['where'],{'$or':_['map'](_0x34c117[_0xe31e('0x32')],function(_0x176e2e){var _0x366831={};_0x366831[_0x176e2e]={'$like':'%'+_0x2bd7ba['query'][_0xe31e('0x3b')]+'%'};return _0x366831;})});}_0x34c117=_['merge']({},_0x34c117,_0x2bd7ba['options']);return _0x171a66['getFields'](_0x34c117);}})[_0xe31e('0x23')](function(_0x31cde4){if(_0x31cde4){_0x56d2f0=_0x31cde4[_0xe31e('0x35')];if(!_0x2bd7ba[_0xe31e('0x2f')]['hasOwnProperty'](_0xe31e('0x37'))){_0x34c117[_0xe31e('0x1b')]=qs[_0xe31e('0x1b')](_0x2bd7ba[_0xe31e('0x2f')][_0xe31e('0x1b')]);_0x34c117[_0xe31e('0x19')]=qs[_0xe31e('0x19')](_0x2bd7ba[_0xe31e('0x2f')]['offset']);}return _0x171a66[_0xe31e('0x4c')](_0x34c117);}})[_0xe31e('0x23')](function(_0x250e2e){if(_0x250e2e){return _0x250e2e?{'count':_0x56d2f0,'rows':_0x250e2e}:null;}})[_0xe31e('0x23')](respondWithResult(_0x1f469f,null))['catch'](handleError(_0x1f469f,null));};exports[_0xe31e('0x4d')]=function(_0x5eb88a,_0xd01074,_0x2f34be){var _0x3ecf4d={};var _0x3048cc={};var _0x3ad59b;var _0xa6bff2;return db[_0xe31e('0x29')][_0xe31e('0x49')]({'where':{'id':_0x5eb88a[_0xe31e('0x48')]['id']}})[_0xe31e('0x23')](handleEntityNotFound(_0xd01074,null))[_0xe31e('0x23')](function(_0x2226ac){if(_0x2226ac){_0x3ad59b=_0x2226ac;_0x3048cc[_0xe31e('0x2d')]=_['keys'](db[_0xe31e('0x4a')][_0xe31e('0x2a')]);_0x3048cc[_0xe31e('0x2f')]=_[_0xe31e('0x30')](_0x5eb88a[_0xe31e('0x2f')]);_0x3048cc['filters']=_['intersection'](_0x3048cc[_0xe31e('0x2d')],_0x3048cc[_0xe31e('0x2f')]);_0x3ecf4d['attributes']=_['intersection'](_0x3048cc['model'],qs['fields'](_0x5eb88a[_0xe31e('0x2f')][_0xe31e('0x34')]));_0x3ecf4d[_0xe31e('0x32')]=_0x3ecf4d['attributes'][_0xe31e('0x35')]?_0x3ecf4d[_0xe31e('0x32')]:_0x3048cc[_0xe31e('0x2d')];_0x3ecf4d['order']=qs[_0xe31e('0x38')](_0x5eb88a[_0xe31e('0x2f')][_0xe31e('0x38')]);_0x3ecf4d[_0xe31e('0x39')]=qs[_0xe31e('0x31')](_[_0xe31e('0x3a')](_0x5eb88a[_0xe31e('0x2f')],_0x3048cc[_0xe31e('0x31')]));if(_0x5eb88a[_0xe31e('0x2f')][_0xe31e('0x3b')]){_0x3ecf4d['where']=_['merge'](_0x3ecf4d['where'],{'$or':_[_0xe31e('0x2e')](_0x3ecf4d[_0xe31e('0x32')],function(_0x7fd362){var _0x32be07={};_0x32be07[_0x7fd362]={'$like':'%'+_0x5eb88a['query']['filter']+'%'};return _0x32be07;})});}_0x3ecf4d=_[_0xe31e('0x3c')]({},_0x3ecf4d,_0x5eb88a[_0xe31e('0x3e')]);return _0x3ad59b['getSubjects'](_0x3ecf4d);}})[_0xe31e('0x23')](function(_0x76003d){if(_0x76003d){_0xa6bff2=_0x76003d['length'];if(!_0x5eb88a[_0xe31e('0x2f')][_0xe31e('0x36')](_0xe31e('0x37'))){_0x3ecf4d[_0xe31e('0x1b')]=qs[_0xe31e('0x1b')](_0x5eb88a[_0xe31e('0x2f')][_0xe31e('0x1b')]);_0x3ecf4d[_0xe31e('0x19')]=qs['offset'](_0x5eb88a[_0xe31e('0x2f')][_0xe31e('0x19')]);}return _0x3ad59b[_0xe31e('0x4d')](_0x3ecf4d);}})['then'](function(_0x553f43){if(_0x553f43){return _0x553f43?{'count':_0xa6bff2,'rows':_0x553f43}:null;}})[_0xe31e('0x23')](respondWithResult(_0xd01074,null))[_0xe31e('0x45')](handleError(_0xd01074,null));};exports[_0xe31e('0x4e')]=function(_0x48dae2,_0x48f2d7,_0x4bd557){var _0x4fa80c={};var _0xac0ce4={};var _0x1085c8;var _0x5ac741;return db[_0xe31e('0x29')][_0xe31e('0x49')]({'where':{'id':_0x48dae2['params']['id']}})[_0xe31e('0x23')](handleEntityNotFound(_0x48f2d7,null))[_0xe31e('0x23')](function(_0x4072b3){if(_0x4072b3){_0x1085c8=_0x4072b3;_0xac0ce4[_0xe31e('0x2d')]=_['keys'](db[_0xe31e('0x4a')]['rawAttributes']);_0xac0ce4[_0xe31e('0x2f')]=_['keys'](_0x48dae2[_0xe31e('0x2f')]);_0xac0ce4['filters']=_['intersection'](_0xac0ce4[_0xe31e('0x2d')],_0xac0ce4[_0xe31e('0x2f')]);_0x4fa80c[_0xe31e('0x32')]=_[_0xe31e('0x33')](_0xac0ce4['model'],qs[_0xe31e('0x34')](_0x48dae2['query'][_0xe31e('0x34')]));_0x4fa80c[_0xe31e('0x32')]=_0x4fa80c[_0xe31e('0x32')][_0xe31e('0x35')]?_0x4fa80c[_0xe31e('0x32')]:_0xac0ce4[_0xe31e('0x2d')];_0x4fa80c[_0xe31e('0x4b')]=qs[_0xe31e('0x38')](_0x48dae2[_0xe31e('0x2f')][_0xe31e('0x38')]);_0x4fa80c[_0xe31e('0x39')]=qs['filters'](_[_0xe31e('0x3a')](_0x48dae2[_0xe31e('0x2f')],_0xac0ce4['filters']));if(_0x48dae2[_0xe31e('0x2f')]['filter']){_0x4fa80c[_0xe31e('0x39')]=_['merge'](_0x4fa80c['where'],{'$or':_[_0xe31e('0x2e')](_0x4fa80c[_0xe31e('0x32')],function(_0x423a88){var _0x526d13={};_0x526d13[_0x423a88]={'$like':'%'+_0x48dae2[_0xe31e('0x2f')][_0xe31e('0x3b')]+'%'};return _0x526d13;})});}_0x4fa80c=_['merge']({},_0x4fa80c,_0x48dae2[_0xe31e('0x3e')]);return _0x1085c8[_0xe31e('0x4e')](_0x4fa80c);}})[_0xe31e('0x23')](function(_0x292cf2){if(_0x292cf2){_0x5ac741=_0x292cf2[_0xe31e('0x35')];if(!_0x48dae2[_0xe31e('0x2f')][_0xe31e('0x36')](_0xe31e('0x37'))){_0x4fa80c[_0xe31e('0x1b')]=qs[_0xe31e('0x1b')](_0x48dae2['query'][_0xe31e('0x1b')]);_0x4fa80c['offset']=qs[_0xe31e('0x19')](_0x48dae2['query'][_0xe31e('0x19')]);}return _0x1085c8['getDescriptions'](_0x4fa80c);}})[_0xe31e('0x23')](function(_0x582db5){if(_0x582db5){return _0x582db5?{'count':_0x5ac741,'rows':_0x582db5}:null;}})[_0xe31e('0x23')](respondWithResult(_0x48f2d7,null))[_0xe31e('0x45')](handleError(_0x48f2d7,null));};exports['getTags']=function(_0x3b7c30,_0x2cd96f,_0x260631){var _0xf6c4f3={};var _0x5d7b5e={};var _0x399c1f;var _0x248138;return db[_0xe31e('0x29')][_0xe31e('0x49')]({'where':{'id':_0x3b7c30[_0xe31e('0x48')]['id']}})[_0xe31e('0x23')](handleEntityNotFound(_0x2cd96f,null))[_0xe31e('0x23')](function(_0x284683){if(_0x284683){_0x399c1f=_0x284683;_0x5d7b5e[_0xe31e('0x2d')]=_['keys'](db[_0xe31e('0x4f')][_0xe31e('0x2a')]);_0x5d7b5e[_0xe31e('0x2f')]=_[_0xe31e('0x30')](_0x3b7c30[_0xe31e('0x2f')]);_0x5d7b5e[_0xe31e('0x31')]=_[_0xe31e('0x33')](_0x5d7b5e[_0xe31e('0x2d')],_0x5d7b5e['query']);_0xf6c4f3[_0xe31e('0x32')]=_[_0xe31e('0x33')](_0x5d7b5e[_0xe31e('0x2d')],qs[_0xe31e('0x34')](_0x3b7c30['query']['fields']));_0xf6c4f3[_0xe31e('0x32')]=_0xf6c4f3[_0xe31e('0x32')][_0xe31e('0x35')]?_0xf6c4f3['attributes']:_0x5d7b5e[_0xe31e('0x2d')];_0xf6c4f3['order']=qs['sort'](_0x3b7c30[_0xe31e('0x2f')][_0xe31e('0x38')]);_0xf6c4f3['where']=qs[_0xe31e('0x31')](_[_0xe31e('0x3a')](_0x3b7c30['query'],_0x5d7b5e[_0xe31e('0x31')]));if(_0x3b7c30['query']['filter']){_0xf6c4f3[_0xe31e('0x39')]=_[_0xe31e('0x3c')](_0xf6c4f3[_0xe31e('0x39')],{'$or':_[_0xe31e('0x2e')](_0xf6c4f3[_0xe31e('0x32')],function(_0x586a6b){var _0x422695={};_0x422695[_0x586a6b]={'$like':'%'+_0x3b7c30[_0xe31e('0x2f')][_0xe31e('0x3b')]+'%'};return _0x422695;})});}_0xf6c4f3=_[_0xe31e('0x3c')]({},_0xf6c4f3,_0x3b7c30[_0xe31e('0x3e')]);return _0x399c1f['getTags'](_0xf6c4f3);}})[_0xe31e('0x23')](function(_0x1dd128){if(_0x1dd128){_0x248138=_0x1dd128[_0xe31e('0x35')];if(!_0x3b7c30[_0xe31e('0x2f')]['hasOwnProperty'](_0xe31e('0x37'))){_0xf6c4f3[_0xe31e('0x1b')]=qs[_0xe31e('0x1b')](_0x3b7c30[_0xe31e('0x2f')][_0xe31e('0x1b')]);_0xf6c4f3[_0xe31e('0x19')]=qs['offset'](_0x3b7c30[_0xe31e('0x2f')]['offset']);}return _0x399c1f['getTags'](_0xf6c4f3);}})[_0xe31e('0x23')](function(_0x502ac){if(_0x502ac){return _0x502ac?{'count':_0x248138,'rows':_0x502ac}:null;}})['then'](respondWithResult(_0x2cd96f,null))[_0xe31e('0x45')](handleError(_0x2cd96f,null));};exports[_0xe31e('0x50')]=function(_0x5320bc,_0x4af28c,_0x2beea1){if(_0x5320bc[_0xe31e('0x47')]['id']){delete _0x5320bc[_0xe31e('0x47')]['id'];}return db[_0xe31e('0x29')][_0xe31e('0x49')]({'where':{'id':_0x5320bc[_0xe31e('0x48')]['id']}})[_0xe31e('0x23')](handleEntityNotFound(_0x4af28c,null))[_0xe31e('0x23')](function(_0x2d0acc){if(_0x2d0acc){return _0x2d0acc[_0xe31e('0x50')](_0x5320bc['body']['ids']||[]);}return null;})[_0xe31e('0x23')](respondWithResult(_0x4af28c,null))[_0xe31e('0x45')](handleError(_0x4af28c,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 410249d..df27173 100644 --- a/server/api/intDeskConfiguration/intDeskConfiguration.model.js +++ b/server/api/intDeskConfiguration/intDeskConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5d05=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','util'];(function(_0x53f964,_0x3b52b8){var _0x17be6c=function(_0x25a732){while(--_0x25a732){_0x53f964['push'](_0x53f964['shift']());}};_0x17be6c(++_0x3b52b8);}(_0x5d05,0x1d2));var _0x55d0=function(_0x15372f,_0x467b0c){_0x15372f=_0x15372f-0x0;var _0x52e750=_0x5d05[_0x15372f];return _0x52e750;};'use strict';var _=require(_0x55d0('0x0'));var util=require(_0x55d0('0x1'));var logger=require(_0x55d0('0x2'))(_0x55d0('0x3'));var moment=require('moment');var BPromise=require(_0x55d0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x55d0('0x5'));var rimraf=require(_0x55d0('0x6'));var config=require(_0x55d0('0x7'));var attributes=require(_0x55d0('0x8'));module[_0x55d0('0x9')]=function(_0x23c9b4,_0x20de69){return _0x23c9b4[_0x55d0('0xa')](_0x55d0('0xb'),attributes,{'tableName':_0x55d0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb2f5=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash'];(function(_0x44dc2e,_0x291519){var _0x9b1497=function(_0x2d4654){while(--_0x2d4654){_0x44dc2e['push'](_0x44dc2e['shift']());}};_0x9b1497(++_0x291519);}(_0xb2f5,0x167));var _0x5b2f=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xb2f5[_0x1694f5];return _0x5b4321;};'use strict';var _=require(_0x5b2f('0x0'));var util=require(_0x5b2f('0x1'));var logger=require(_0x5b2f('0x2'))(_0x5b2f('0x3'));var moment=require(_0x5b2f('0x4'));var BPromise=require(_0x5b2f('0x5'));var rp=require(_0x5b2f('0x6'));var fs=require('fs');var path=require(_0x5b2f('0x7'));var rimraf=require(_0x5b2f('0x8'));var config=require(_0x5b2f('0x9'));var attributes=require(_0x5b2f('0xa'));module[_0x5b2f('0xb')]=function(_0x5305a1,_0x5e81a3){return _0x5305a1[_0x5b2f('0xc')](_0x5b2f('0xd'),attributes,{'tableName':_0x5b2f('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 31c25ee..591996f 100644 --- a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js +++ b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1b0e=['debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1b0e,0x132));var _0xe1b0=function(_0x2def35,_0x706978){_0x2def35=_0x2def35-0x0;var _0x4142d0=_0x1b0e[_0x2def35];return _0x4142d0;};'use strict';var _=require(_0xe1b0('0x0'));var util=require(_0xe1b0('0x1'));var moment=require(_0xe1b0('0x2'));var BPromise=require(_0xe1b0('0x3'));var rs=require(_0xe1b0('0x4'));var fs=require('fs');var Redis=require(_0xe1b0('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe1b0('0x6'))(_0xe1b0('0x7'));var config=require('../../config/environment');var jayson=require(_0xe1b0('0x8'));var client=jayson[_0xe1b0('0x9')][_0xe1b0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52e806,_0x36f5cd,_0x1eef2a){return new BPromise(function(_0x5aacc2,_0x123268){return client[_0xe1b0('0xb')](_0x52e806,_0x1eef2a)[_0xe1b0('0xc')](function(_0x400eee){logger[_0xe1b0('0xd')](_0xe1b0('0xe'),_0x36f5cd,_0xe1b0('0xf'));logger[_0xe1b0('0x10')](_0xe1b0('0x11'),_0x36f5cd,_0xe1b0('0xf'),JSON['stringify'](_0x400eee));if(_0x400eee[_0xe1b0('0x12')]){if(_0x400eee[_0xe1b0('0x12')][_0xe1b0('0x13')]===0x1f4){logger[_0xe1b0('0x12')](_0xe1b0('0xe'),_0x36f5cd,_0x400eee[_0xe1b0('0x12')][_0xe1b0('0x14')]);return _0x123268(_0x400eee[_0xe1b0('0x12')][_0xe1b0('0x14')]);}logger['error'](_0xe1b0('0xe'),_0x36f5cd,_0x400eee[_0xe1b0('0x12')][_0xe1b0('0x14')]);return _0x5aacc2(_0x400eee['error']['message']);}else{logger[_0xe1b0('0xd')](_0xe1b0('0xe'),_0x36f5cd,_0xe1b0('0xf'));_0x5aacc2(_0x400eee[_0xe1b0('0x15')][_0xe1b0('0x14')]);}})[_0xe1b0('0x16')](function(_0x5dfd78){logger[_0xe1b0('0x12')](_0xe1b0('0xe'),_0x36f5cd,_0x5dfd78);_0x123268(_0x5dfd78);});});} \ No newline at end of file +var _0xb4f8=['client','http','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0x521485,_0x36c830){var _0xa685c=function(_0x29703a){while(--_0x29703a){_0x521485['push'](_0x521485['shift']());}};_0xa685c(++_0x36c830);}(_0xb4f8,0x83));var _0x8b4f=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0xb4f8[_0x59d89e];return _0x554e93;};'use strict';var _=require('lodash');var util=require(_0x8b4f('0x0'));var moment=require(_0x8b4f('0x1'));var BPromise=require(_0x8b4f('0x2'));var rs=require(_0x8b4f('0x3'));var fs=require('fs');var Redis=require(_0x8b4f('0x4'));var db=require(_0x8b4f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8b4f('0x6'))('rpc');var config=require(_0x8b4f('0x7'));var jayson=require(_0x8b4f('0x8'));var client=jayson[_0x8b4f('0x9')][_0x8b4f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2eefde,_0x557bc0,_0x2dfe1c){return new BPromise(function(_0xa91c09,_0x40042b){return client['request'](_0x2eefde,_0x2dfe1c)[_0x8b4f('0xb')](function(_0x13d37a){logger[_0x8b4f('0xc')](_0x8b4f('0xd'),_0x557bc0,_0x8b4f('0xe'));logger['debug'](_0x8b4f('0xf'),_0x557bc0,_0x8b4f('0xe'),JSON['stringify'](_0x13d37a));if(_0x13d37a[_0x8b4f('0x10')]){if(_0x13d37a[_0x8b4f('0x10')]['code']===0x1f4){logger[_0x8b4f('0x10')](_0x8b4f('0xd'),_0x557bc0,_0x13d37a['error'][_0x8b4f('0x11')]);return _0x40042b(_0x13d37a[_0x8b4f('0x10')][_0x8b4f('0x11')]);}logger[_0x8b4f('0x10')]('DeskConfiguration,\x20%s,\x20%s',_0x557bc0,_0x13d37a[_0x8b4f('0x10')][_0x8b4f('0x11')]);return _0xa91c09(_0x13d37a[_0x8b4f('0x10')][_0x8b4f('0x11')]);}else{logger[_0x8b4f('0xc')](_0x8b4f('0xd'),_0x557bc0,'request\x20sent');_0xa91c09(_0x13d37a[_0x8b4f('0x12')][_0x8b4f('0x11')]);}})[_0x8b4f('0x13')](function(_0x1b4b9f){logger[_0x8b4f('0x10')](_0x8b4f('0xd'),_0x557bc0,_0x1b4b9f);_0x40042b(_0x1b4b9f);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index cf0e663..bad78b7 100644 --- a/server/api/intDeskField/index.js +++ b/server/api/intDeskField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9fa9=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','index','get','/:id','isAuthenticated','post','create','put','update','destroy','exports','util','path'];(function(_0x36bc58,_0x27f03c){var _0x4a547e=function(_0x6326c6){while(--_0x6326c6){_0x36bc58['push'](_0x36bc58['shift']());}};_0x4a547e(++_0x27f03c);}(_0x9fa9,0xb2));var _0x99fa=function(_0x2a7afa,_0x5d196e){_0x2a7afa=_0x2a7afa-0x0;var _0x25d991=_0x9fa9[_0x2a7afa];return _0x25d991;};'use strict';var multer=require('multer');var util=require(_0x99fa('0x0'));var path=require(_0x99fa('0x1'));var timeout=require('connect-timeout');var express=require(_0x99fa('0x2'));var router=express['Router']();var fs_extra=require(_0x99fa('0x3'));var auth=require(_0x99fa('0x4'));var interaction=require(_0x99fa('0x5'));var config=require(_0x99fa('0x6'));var controller=require(_0x99fa('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x99fa('0x8')]);router[_0x99fa('0x9')](_0x99fa('0xa'),auth[_0x99fa('0xb')](),controller['show']);router[_0x99fa('0xc')]('/',auth[_0x99fa('0xb')](),controller[_0x99fa('0xd')]);router[_0x99fa('0xe')](_0x99fa('0xa'),auth[_0x99fa('0xb')](),controller[_0x99fa('0xf')]);router['delete'](_0x99fa('0xa'),auth['isAuthenticated'](),controller[_0x99fa('0x10')]);module[_0x99fa('0x11')]=router; \ No newline at end of file +var _0xcaf1=['create','put','update','delete','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xcaf1,0x82));var _0x1caf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcaf1[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x1caf('0x0'));var path=require(_0x1caf('0x1'));var timeout=require(_0x1caf('0x2'));var express=require(_0x1caf('0x3'));var router=express[_0x1caf('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1caf('0x5'));var config=require(_0x1caf('0x6'));var controller=require(_0x1caf('0x7'));router[_0x1caf('0x8')]('/',auth[_0x1caf('0x9')](),controller[_0x1caf('0xa')]);router[_0x1caf('0x8')](_0x1caf('0xb'),auth[_0x1caf('0x9')](),controller[_0x1caf('0xc')]);router[_0x1caf('0xd')]('/',auth['isAuthenticated'](),controller[_0x1caf('0xe')]);router[_0x1caf('0xf')](_0x1caf('0xb'),auth['isAuthenticated'](),controller[_0x1caf('0x10')]);router[_0x1caf('0x11')](_0x1caf('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index a777c45..42a28e6 100644 --- a/server/api/intDeskField/intDeskField.attributes.js +++ b/server/api/intDeskField/intDeskField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0353=['variable','BOOLEAN','sequelize','exports','ENUM','string','customVariable','keyValue','picklist','STRING'];(function(_0x372400,_0xdaeb10){var _0x4cd28c=function(_0x497d1f){while(--_0x497d1f){_0x372400['push'](_0x372400['shift']());}};_0x4cd28c(++_0xdaeb10);}(_0x0353,0x106));var _0x3035=function(_0x3f0b30,_0x159bc8){_0x3f0b30=_0x3f0b30-0x0;var _0x2748a5=_0x0353[_0x3f0b30];return _0x2748a5;};'use strict';var Sequelize=require(_0x3035('0x0'));module[_0x3035('0x1')]={'type':{'type':Sequelize[_0x3035('0x2')](_0x3035('0x3'),'variable',_0x3035('0x4'),_0x3035('0x5'),_0x3035('0x6')),'defaultValue':_0x3035('0x3')},'content':{'type':Sequelize[_0x3035('0x7')]},'key':{'type':Sequelize[_0x3035('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x3035('0x3'),_0x3035('0x8'),'customVariable')},'keyContent':{'type':Sequelize[_0x3035('0x7')]},'idField':{'type':Sequelize[_0x3035('0x7')]},'nameField':{'type':Sequelize[_0x3035('0x7')]},'customField':{'type':Sequelize[_0x3035('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3035('0x7')]}}; \ No newline at end of file +var _0x257c=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x257c,0xe6));var _0xc257=function(_0x16b1b8,_0x432d03){_0x16b1b8=_0x16b1b8-0x0;var _0x558b1e=_0x257c[_0x16b1b8];return _0x558b1e;};'use strict';var Sequelize=require(_0xc257('0x0'));module[_0xc257('0x1')]={'type':{'type':Sequelize[_0xc257('0x2')](_0xc257('0x3'),_0xc257('0x4'),_0xc257('0x5'),_0xc257('0x6'),_0xc257('0x7')),'defaultValue':_0xc257('0x3')},'content':{'type':Sequelize[_0xc257('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xc257('0x2')](_0xc257('0x3'),_0xc257('0x4'),_0xc257('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xc257('0x8')]},'nameField':{'type':Sequelize[_0xc257('0x8')]},'customField':{'type':Sequelize[_0xc257('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc257('0x8')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 28b0bef..354422b 100644 --- a/server/api/intDeskField/intDeskField.controller.js +++ b/server/api/intDeskField/intDeskField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x83ed=['model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','DeskField','include','findAll','rows','catch','show','params','includeAll','find','create','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','rawAttributes','fieldName','type','key','query','keys','intersection'];(function(_0x24ca0b,_0x787b8b){var _0x91612e=function(_0x2bacef){while(--_0x2bacef){_0x24ca0b['push'](_0x24ca0b['shift']());}};_0x91612e(++_0x787b8b);}(_0x83ed,0x66));var _0xd83e=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x83ed[_0x33032e];return _0x13316b;};'use strict';var emlformat=require(_0xd83e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd83e('0x1'));var jsonpatch=require(_0xd83e('0x2'));var rp=require(_0xd83e('0x3'));var moment=require('moment');var BPromise=require(_0xd83e('0x4'));var Mustache=require(_0xd83e('0x5'));var util=require(_0xd83e('0x6'));var path=require(_0xd83e('0x7'));var sox=require(_0xd83e('0x8'));var csv=require(_0xd83e('0x9'));var ejs=require(_0xd83e('0xa'));var fs=require('fs');var fs_extra=require(_0xd83e('0xb'));var _=require(_0xd83e('0xc'));var squel=require('squel');var crypto=require(_0xd83e('0xd'));var jsforce=require(_0xd83e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd83e('0x9'));var querystring=require(_0xd83e('0xf'));var Papa=require(_0xd83e('0x10'));var Redis=require('ioredis');var authService=require(_0xd83e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd83e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd83e('0x13'))(_0xd83e('0x14'));var utils=require('../../config/utils');var config=require(_0xd83e('0x15'));var licenseUtil=require(_0xd83e('0x16'));var db=require(_0xd83e('0x17'))['db'];function respondWithStatusCode(_0x53ce8b,_0x2a2a88){_0x2a2a88=_0x2a2a88||0xcc;return function(_0x3ff12f){if(_0x3ff12f){return _0x53ce8b[_0xd83e('0x18')](_0x2a2a88);}return _0x53ce8b[_0xd83e('0x19')](_0x2a2a88)[_0xd83e('0x1a')]();};}function respondWithResult(_0x275334,_0x4739b3){_0x4739b3=_0x4739b3||0xc8;return function(_0x23c5cc){if(_0x23c5cc){return _0x275334[_0xd83e('0x19')](_0x4739b3)[_0xd83e('0x1b')](_0x23c5cc);}};}function respondWithFilteredResult(_0x4129c5,_0x41d742){return function(_0x8b7347){if(_0x8b7347){var _0x5b9373=typeof _0x41d742['offset']===_0xd83e('0x1c')&&typeof _0x41d742['limit']===_0xd83e('0x1c');var _0x4b2a22=_0x8b7347[_0xd83e('0x1d')];var _0x91b23f=_0x5b9373?0x0:_0x41d742['offset'];var _0x585b74=_0x5b9373?_0x8b7347[_0xd83e('0x1d')]:_0x41d742[_0xd83e('0x1e')]+_0x41d742[_0xd83e('0x1f')];var _0x35e4d2;if(_0x585b74>=_0x4b2a22){_0x585b74=_0x4b2a22;_0x35e4d2=0xc8;}else{_0x35e4d2=0xce;}_0x4129c5[_0xd83e('0x19')](_0x35e4d2);return _0x4129c5[_0xd83e('0x20')](_0xd83e('0x21'),_0x91b23f+'-'+_0x585b74+'/'+_0x4b2a22)[_0xd83e('0x1b')](_0x8b7347);}return null;};}function patchUpdates(_0x1bd8e5){return function(_0x505514){try{jsonpatch[_0xd83e('0x22')](_0x505514,_0x1bd8e5,!![]);}catch(_0x58f7da){return BPromise[_0xd83e('0x23')](_0x58f7da);}return _0x505514[_0xd83e('0x24')]();};}function saveUpdates(_0x58a9d5,_0x30ea73){return function(_0x1bb6a5){if(_0x1bb6a5){return _0x1bb6a5[_0xd83e('0x25')](_0x58a9d5)[_0xd83e('0x26')](function(_0x17e96e){return _0x17e96e;});}return null;};}function removeEntity(_0x1e0dee,_0x43b520){return function(_0x38842d){if(_0x38842d){return _0x38842d['destroy']()['then'](function(){_0x1e0dee['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x21aafc,_0x3d19b8){return function(_0x2d1549){if(!_0x2d1549){_0x21aafc[_0xd83e('0x18')](0x194);}return _0x2d1549;};}function handleError(_0x277c94,_0x2bc6f8){_0x2bc6f8=_0x2bc6f8||0x1f4;return function(_0x40c974){logger[_0xd83e('0x27')](_0x40c974[_0xd83e('0x28')]);if(_0x40c974[_0xd83e('0x29')]){delete _0x40c974[_0xd83e('0x29')];}_0x277c94[_0xd83e('0x19')](_0x2bc6f8)[_0xd83e('0x2a')](_0x40c974);};}exports['index']=function(_0x27a905,_0x4189e2){var _0x1e4f1a={},_0x2f1178={},_0x49be67={'count':0x0,'rows':[]};var _0x13c861=_['map'](db['DeskField'][_0xd83e('0x2b')],function(_0x2adafe){return{'name':_0x2adafe[_0xd83e('0x2c')],'type':_0x2adafe[_0xd83e('0x2d')][_0xd83e('0x2e')]};});_0x2f1178['model']=_['map'](_0x13c861,_0xd83e('0x29'));_0x2f1178[_0xd83e('0x2f')]=_[_0xd83e('0x30')](_0x27a905[_0xd83e('0x2f')]);_0x2f1178['filters']=_[_0xd83e('0x31')](_0x2f1178[_0xd83e('0x32')],_0x2f1178[_0xd83e('0x2f')]);_0x1e4f1a[_0xd83e('0x33')]=_[_0xd83e('0x31')](_0x2f1178[_0xd83e('0x32')],qs[_0xd83e('0x34')](_0x27a905[_0xd83e('0x2f')]['fields']));_0x1e4f1a[_0xd83e('0x33')]=_0x1e4f1a['attributes'][_0xd83e('0x35')]?_0x1e4f1a['attributes']:_0x2f1178[_0xd83e('0x32')];if(!_0x27a905[_0xd83e('0x2f')][_0xd83e('0x36')](_0xd83e('0x37'))){_0x1e4f1a[_0xd83e('0x1f')]=qs[_0xd83e('0x1f')](_0x27a905[_0xd83e('0x2f')][_0xd83e('0x1f')]);_0x1e4f1a[_0xd83e('0x1e')]=qs[_0xd83e('0x1e')](_0x27a905['query']['offset']);}_0x1e4f1a[_0xd83e('0x38')]=qs[_0xd83e('0x39')](_0x27a905[_0xd83e('0x2f')][_0xd83e('0x39')]);_0x1e4f1a['where']=qs['filters'](_['pick'](_0x27a905[_0xd83e('0x2f')],_0x2f1178[_0xd83e('0x3a')]),_0x13c861);if(_0x27a905['query'][_0xd83e('0x3b')]){_0x1e4f1a[_0xd83e('0x3c')]=_[_0xd83e('0x3d')](_0x1e4f1a[_0xd83e('0x3c')],{'$or':_['map'](_0x13c861,function(_0x5324f5){if(_0x5324f5[_0xd83e('0x2d')]!==_0xd83e('0x3e')){var _0x204ea0={};_0x204ea0[_0x5324f5[_0xd83e('0x29')]]={'$like':'%'+_0x27a905[_0xd83e('0x2f')][_0xd83e('0x3b')]+'%'};return _0x204ea0;}})});}_0x1e4f1a=_[_0xd83e('0x3d')]({},_0x1e4f1a,_0x27a905[_0xd83e('0x3f')]);var _0x4200a8={'where':_0x1e4f1a[_0xd83e('0x3c')]};return db[_0xd83e('0x40')][_0xd83e('0x1d')](_0x4200a8)[_0xd83e('0x26')](function(_0x28c87a){_0x49be67[_0xd83e('0x1d')]=_0x28c87a;if(_0x27a905[_0xd83e('0x2f')]['includeAll']){_0x1e4f1a[_0xd83e('0x41')]=[{'all':!![]}];}return db['DeskField'][_0xd83e('0x42')](_0x1e4f1a);})[_0xd83e('0x26')](function(_0x49a24c){_0x49be67[_0xd83e('0x43')]=_0x49a24c;return _0x49be67;})[_0xd83e('0x26')](respondWithFilteredResult(_0x4189e2,_0x1e4f1a))[_0xd83e('0x44')](handleError(_0x4189e2,null));};exports[_0xd83e('0x45')]=function(_0x310fa5,_0x12dd54){var _0x11fb48={'raw':!![],'where':{'id':_0x310fa5[_0xd83e('0x46')]['id']}},_0x254978={};_0x254978[_0xd83e('0x32')]=_[_0xd83e('0x30')](db[_0xd83e('0x40')][_0xd83e('0x2b')]);_0x254978[_0xd83e('0x2f')]=_[_0xd83e('0x30')](_0x310fa5['query']);_0x254978['filters']=_[_0xd83e('0x31')](_0x254978[_0xd83e('0x32')],_0x254978[_0xd83e('0x2f')]);_0x11fb48['attributes']=_['intersection'](_0x254978[_0xd83e('0x32')],qs[_0xd83e('0x34')](_0x310fa5[_0xd83e('0x2f')]['fields']));_0x11fb48['attributes']=_0x11fb48[_0xd83e('0x33')][_0xd83e('0x35')]?_0x11fb48['attributes']:_0x254978['model'];if(_0x310fa5[_0xd83e('0x2f')][_0xd83e('0x47')]){_0x11fb48['include']=[{'all':!![]}];}_0x11fb48=_['merge']({},_0x11fb48,_0x310fa5[_0xd83e('0x3f')]);return db[_0xd83e('0x40')][_0xd83e('0x48')](_0x11fb48)[_0xd83e('0x26')](handleEntityNotFound(_0x12dd54,null))[_0xd83e('0x26')](respondWithResult(_0x12dd54,null))[_0xd83e('0x44')](handleError(_0x12dd54,null));};exports[_0xd83e('0x49')]=function(_0x46bf7c,_0x777288){return db[_0xd83e('0x40')]['create'](_0x46bf7c[_0xd83e('0x4a')],{})[_0xd83e('0x26')](respondWithResult(_0x777288,0xc9))['catch'](handleError(_0x777288,null));};exports[_0xd83e('0x25')]=function(_0x113646,_0x431f6f){if(_0x113646[_0xd83e('0x4a')]['id']){delete _0x113646[_0xd83e('0x4a')]['id'];}return db[_0xd83e('0x40')][_0xd83e('0x48')]({'where':{'id':_0x113646[_0xd83e('0x46')]['id']}})['then'](handleEntityNotFound(_0x431f6f,null))[_0xd83e('0x26')](saveUpdates(_0x113646['body'],null))['then'](respondWithResult(_0x431f6f,null))[_0xd83e('0x44')](handleError(_0x431f6f,null));};exports[_0xd83e('0x4b')]=function(_0x3361d0,_0x1714a2){return db[_0xd83e('0x40')][_0xd83e('0x48')]({'where':{'id':_0x3361d0['params']['id']}})[_0xd83e('0x26')](handleEntityNotFound(_0x1714a2,null))[_0xd83e('0x26')](removeEntity(_0x1714a2,null))[_0xd83e('0x44')](handleError(_0x1714a2,null));}; \ No newline at end of file +var _0x5e17=['intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','DeskField','includeAll','catch','include','find','create','body','update','params','eml-format','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','set','Content-Range','save','then','destroy','error','name','status','index','map','rawAttributes','fieldName','key','model','query','keys','filters'];(function(_0x1ec296,_0xeeccf2){var _0x413c37=function(_0x301bb6){while(--_0x301bb6){_0x1ec296['push'](_0x1ec296['shift']());}};_0x413c37(++_0xeeccf2);}(_0x5e17,0x17a));var _0x75e1=function(_0x5f1403,_0x273813){_0x5f1403=_0x5f1403-0x0;var _0x1c4968=_0x5e17[_0x5f1403];return _0x1c4968;};'use strict';var emlformat=require(_0x75e1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x75e1('0x1'));var Mustache=require(_0x75e1('0x2'));var util=require(_0x75e1('0x3'));var path=require(_0x75e1('0x4'));var sox=require(_0x75e1('0x5'));var csv=require(_0x75e1('0x6'));var ejs=require(_0x75e1('0x7'));var fs=require('fs');var fs_extra=require(_0x75e1('0x8'));var _=require(_0x75e1('0x9'));var squel=require(_0x75e1('0xa'));var crypto=require(_0x75e1('0xb'));var jsforce=require(_0x75e1('0xc'));var deskjs=require(_0x75e1('0xd'));var toCsv=require(_0x75e1('0x6'));var querystring=require(_0x75e1('0xe'));var Papa=require('papaparse');var Redis=require(_0x75e1('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x75e1('0x10'));var hardwareService=require(_0x75e1('0x11'));var logger=require(_0x75e1('0x12'))(_0x75e1('0x13'));var utils=require(_0x75e1('0x14'));var config=require(_0x75e1('0x15'));var licenseUtil=require(_0x75e1('0x16'));var db=require(_0x75e1('0x17'))['db'];function respondWithStatusCode(_0x4eb893,_0x3a4e57){_0x3a4e57=_0x3a4e57||0xcc;return function(_0x39b1a1){if(_0x39b1a1){return _0x4eb893[_0x75e1('0x18')](_0x3a4e57);}return _0x4eb893['status'](_0x3a4e57)[_0x75e1('0x19')]();};}function respondWithResult(_0x403bd9,_0x677339){_0x677339=_0x677339||0xc8;return function(_0x260f06){if(_0x260f06){return _0x403bd9['status'](_0x677339)[_0x75e1('0x1a')](_0x260f06);}};}function respondWithFilteredResult(_0x262ac4,_0xdd134a){return function(_0x37e351){if(_0x37e351){var _0x3b50fe=typeof _0xdd134a[_0x75e1('0x1b')]===_0x75e1('0x1c')&&typeof _0xdd134a['limit']===_0x75e1('0x1c');var _0x14dc9d=_0x37e351[_0x75e1('0x1d')];var _0x5ac788=_0x3b50fe?0x0:_0xdd134a[_0x75e1('0x1b')];var _0x1168e0=_0x3b50fe?_0x37e351['count']:_0xdd134a[_0x75e1('0x1b')]+_0xdd134a[_0x75e1('0x1e')];var _0x3bbe34;if(_0x1168e0>=_0x14dc9d){_0x1168e0=_0x14dc9d;_0x3bbe34=0xc8;}else{_0x3bbe34=0xce;}_0x262ac4['status'](_0x3bbe34);return _0x262ac4[_0x75e1('0x1f')](_0x75e1('0x20'),_0x5ac788+'-'+_0x1168e0+'/'+_0x14dc9d)[_0x75e1('0x1a')](_0x37e351);}return null;};}function patchUpdates(_0x180b61){return function(_0x1ae04e){try{jsonpatch['apply'](_0x1ae04e,_0x180b61,!![]);}catch(_0x216697){return BPromise['reject'](_0x216697);}return _0x1ae04e[_0x75e1('0x21')]();};}function saveUpdates(_0x2a473a,_0x2ba733){return function(_0x50cdc1){if(_0x50cdc1){return _0x50cdc1['update'](_0x2a473a)[_0x75e1('0x22')](function(_0xd3f274){return _0xd3f274;});}return null;};}function removeEntity(_0x191ca8,_0x2a6547){return function(_0x1f81e6){if(_0x1f81e6){return _0x1f81e6[_0x75e1('0x23')]()[_0x75e1('0x22')](function(){_0x191ca8['status'](0xcc)[_0x75e1('0x19')]();});}};}function handleEntityNotFound(_0x23c9d0,_0x1f77d7){return function(_0x2b23a9){if(!_0x2b23a9){_0x23c9d0[_0x75e1('0x18')](0x194);}return _0x2b23a9;};}function handleError(_0x1d85f7,_0x469b15){_0x469b15=_0x469b15||0x1f4;return function(_0x471624){logger[_0x75e1('0x24')](_0x471624['stack']);if(_0x471624[_0x75e1('0x25')]){delete _0x471624[_0x75e1('0x25')];}_0x1d85f7[_0x75e1('0x26')](_0x469b15)['send'](_0x471624);};}exports[_0x75e1('0x27')]=function(_0x537914,_0x520cad){var _0x3c5c23={},_0x39064b={},_0x131887={'count':0x0,'rows':[]};var _0x366ae8=_[_0x75e1('0x28')](db['DeskField'][_0x75e1('0x29')],function(_0x116df7){return{'name':_0x116df7[_0x75e1('0x2a')],'type':_0x116df7['type'][_0x75e1('0x2b')]};});_0x39064b[_0x75e1('0x2c')]=_['map'](_0x366ae8,_0x75e1('0x25'));_0x39064b[_0x75e1('0x2d')]=_[_0x75e1('0x2e')](_0x537914[_0x75e1('0x2d')]);_0x39064b[_0x75e1('0x2f')]=_['intersection'](_0x39064b[_0x75e1('0x2c')],_0x39064b[_0x75e1('0x2d')]);_0x3c5c23['attributes']=_[_0x75e1('0x30')](_0x39064b[_0x75e1('0x2c')],qs[_0x75e1('0x31')](_0x537914[_0x75e1('0x2d')][_0x75e1('0x31')]));_0x3c5c23[_0x75e1('0x32')]=_0x3c5c23['attributes'][_0x75e1('0x33')]?_0x3c5c23['attributes']:_0x39064b['model'];if(!_0x537914[_0x75e1('0x2d')][_0x75e1('0x34')](_0x75e1('0x35'))){_0x3c5c23[_0x75e1('0x1e')]=qs[_0x75e1('0x1e')](_0x537914[_0x75e1('0x2d')][_0x75e1('0x1e')]);_0x3c5c23[_0x75e1('0x1b')]=qs[_0x75e1('0x1b')](_0x537914[_0x75e1('0x2d')][_0x75e1('0x1b')]);}_0x3c5c23[_0x75e1('0x36')]=qs[_0x75e1('0x37')](_0x537914['query'][_0x75e1('0x37')]);_0x3c5c23[_0x75e1('0x38')]=qs[_0x75e1('0x2f')](_[_0x75e1('0x39')](_0x537914[_0x75e1('0x2d')],_0x39064b[_0x75e1('0x2f')]),_0x366ae8);if(_0x537914['query'][_0x75e1('0x3a')]){_0x3c5c23[_0x75e1('0x38')]=_[_0x75e1('0x3b')](_0x3c5c23[_0x75e1('0x38')],{'$or':_[_0x75e1('0x28')](_0x366ae8,function(_0x209a49){if(_0x209a49['type']!==_0x75e1('0x3c')){var _0x2f8a53={};_0x2f8a53[_0x209a49['name']]={'$like':'%'+_0x537914[_0x75e1('0x2d')][_0x75e1('0x3a')]+'%'};return _0x2f8a53;}})});}_0x3c5c23=_['merge']({},_0x3c5c23,_0x537914[_0x75e1('0x3d')]);var _0x19676f={'where':_0x3c5c23[_0x75e1('0x38')]};return db[_0x75e1('0x3e')][_0x75e1('0x1d')](_0x19676f)[_0x75e1('0x22')](function(_0x22e803){_0x131887['count']=_0x22e803;if(_0x537914[_0x75e1('0x2d')][_0x75e1('0x3f')]){_0x3c5c23['include']=[{'all':!![]}];}return db[_0x75e1('0x3e')]['findAll'](_0x3c5c23);})[_0x75e1('0x22')](function(_0x2234da){_0x131887['rows']=_0x2234da;return _0x131887;})['then'](respondWithFilteredResult(_0x520cad,_0x3c5c23))[_0x75e1('0x40')](handleError(_0x520cad,null));};exports['show']=function(_0x2fc517,_0x2e2b86){var _0x1c8bf0={'raw':!![],'where':{'id':_0x2fc517['params']['id']}},_0x3152ea={};_0x3152ea[_0x75e1('0x2c')]=_[_0x75e1('0x2e')](db[_0x75e1('0x3e')][_0x75e1('0x29')]);_0x3152ea[_0x75e1('0x2d')]=_['keys'](_0x2fc517[_0x75e1('0x2d')]);_0x3152ea[_0x75e1('0x2f')]=_[_0x75e1('0x30')](_0x3152ea[_0x75e1('0x2c')],_0x3152ea[_0x75e1('0x2d')]);_0x1c8bf0[_0x75e1('0x32')]=_[_0x75e1('0x30')](_0x3152ea['model'],qs[_0x75e1('0x31')](_0x2fc517['query'][_0x75e1('0x31')]));_0x1c8bf0[_0x75e1('0x32')]=_0x1c8bf0[_0x75e1('0x32')]['length']?_0x1c8bf0[_0x75e1('0x32')]:_0x3152ea['model'];if(_0x2fc517[_0x75e1('0x2d')][_0x75e1('0x3f')]){_0x1c8bf0[_0x75e1('0x41')]=[{'all':!![]}];}_0x1c8bf0=_[_0x75e1('0x3b')]({},_0x1c8bf0,_0x2fc517['options']);return db[_0x75e1('0x3e')][_0x75e1('0x42')](_0x1c8bf0)[_0x75e1('0x22')](handleEntityNotFound(_0x2e2b86,null))[_0x75e1('0x22')](respondWithResult(_0x2e2b86,null))[_0x75e1('0x40')](handleError(_0x2e2b86,null));};exports[_0x75e1('0x43')]=function(_0x13d815,_0x1a804a){return db[_0x75e1('0x3e')][_0x75e1('0x43')](_0x13d815[_0x75e1('0x44')],{})[_0x75e1('0x22')](respondWithResult(_0x1a804a,0xc9))[_0x75e1('0x40')](handleError(_0x1a804a,null));};exports[_0x75e1('0x45')]=function(_0x5e1d31,_0x19bee2){if(_0x5e1d31[_0x75e1('0x44')]['id']){delete _0x5e1d31[_0x75e1('0x44')]['id'];}return db[_0x75e1('0x3e')]['find']({'where':{'id':_0x5e1d31['params']['id']}})['then'](handleEntityNotFound(_0x19bee2,null))[_0x75e1('0x22')](saveUpdates(_0x5e1d31[_0x75e1('0x44')],null))[_0x75e1('0x22')](respondWithResult(_0x19bee2,null))['catch'](handleError(_0x19bee2,null));};exports['destroy']=function(_0x23c96b,_0x9cd3fa){return db[_0x75e1('0x3e')][_0x75e1('0x42')]({'where':{'id':_0x23c96b[_0x75e1('0x46')]['id']}})[_0x75e1('0x22')](handleEntityNotFound(_0x9cd3fa,null))[_0x75e1('0x22')](removeEntity(_0x9cd3fa,null))[_0x75e1('0x40')](handleError(_0x9cd3fa,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 9eac477..91ac3dc 100644 --- a/server/api/intDeskField/intDeskField.model.js +++ b/server/api/intDeskField/intDeskField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0d27=['bluebird','rimraf','./intDeskField.attributes','exports','define','int_desk_fields','desk_unique_index','FieldId','lodash','api','moment'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x0d27,0xa2));var _0x70d2=function(_0x1e3b11,_0x326b78){_0x1e3b11=_0x1e3b11-0x0;var _0x2d3902=_0x0d27[_0x1e3b11];return _0x2d3902;};'use strict';var _=require(_0x70d2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x70d2('0x1'));var moment=require(_0x70d2('0x2'));var BPromise=require(_0x70d2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x70d2('0x4'));var config=require('../../config/environment');var attributes=require(_0x70d2('0x5'));module[_0x70d2('0x6')]=function(_0x45a24c,_0x34c799){return _0x45a24c[_0x70d2('0x7')]('DeskField',attributes,{'tableName':_0x70d2('0x8'),'paranoid':![],'indexes':[{'name':_0x70d2('0x9'),'fields':['idField',_0x70d2('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7e40=['../../config/environment','exports','define','int_desk_fields','desk_unique_index','idField','FieldId','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4717b8,_0x565c94){var _0x3daaa8=function(_0x1f5cf7){while(--_0x1f5cf7){_0x4717b8['push'](_0x4717b8['shift']());}};_0x3daaa8(++_0x565c94);}(_0x7e40,0x132));var _0x07e4=function(_0x4f964a,_0x41f80b){_0x4f964a=_0x4f964a-0x0;var _0x22142b=_0x7e40[_0x4f964a];return _0x22142b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x07e4('0x0'))(_0x07e4('0x1'));var moment=require(_0x07e4('0x2'));var BPromise=require(_0x07e4('0x3'));var rp=require(_0x07e4('0x4'));var fs=require('fs');var path=require(_0x07e4('0x5'));var rimraf=require('rimraf');var config=require(_0x07e4('0x6'));var attributes=require('./intDeskField.attributes');module[_0x07e4('0x7')]=function(_0x2b6ef8,_0x1929b8){return _0x2b6ef8[_0x07e4('0x8')]('DeskField',attributes,{'tableName':_0x07e4('0x9'),'paranoid':![],'indexes':[{'name':_0x07e4('0xa'),'fields':[_0x07e4('0xb'),_0x07e4('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 25255ab..cf5c3c1 100644 --- a/server/api/intDeskField/intDeskField.rpc.js +++ b/server/api/intDeskField/intDeskField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfe3e=['info','catch','moment','ioredis','rpc','http','then','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x30ce77,_0x369978){var _0x548fb8=function(_0x149425){while(--_0x149425){_0x30ce77['push'](_0x30ce77['shift']());}};_0x548fb8(++_0x369978);}(_0xfe3e,0x128));var _0xefe3=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xfe3e[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xefe3('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xefe3('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xefe3('0x2'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xefe3('0x3')]({'port':0x232a});function respondWithRpcPromise(_0x237033,_0x2a8ea5,_0x38ee3b){return new BPromise(function(_0x2cec98,_0x1ccadb){return client['request'](_0x237033,_0x38ee3b)[_0xefe3('0x4')](function(_0x450fb6){logger['info'](_0xefe3('0x5'),_0x2a8ea5,_0xefe3('0x6'));logger[_0xefe3('0x7')](_0xefe3('0x8'),_0x2a8ea5,_0xefe3('0x6'),JSON[_0xefe3('0x9')](_0x450fb6));if(_0x450fb6[_0xefe3('0xa')]){if(_0x450fb6[_0xefe3('0xa')]['code']===0x1f4){logger[_0xefe3('0xa')](_0xefe3('0x5'),_0x2a8ea5,_0x450fb6[_0xefe3('0xa')][_0xefe3('0xb')]);return _0x1ccadb(_0x450fb6[_0xefe3('0xa')][_0xefe3('0xb')]);}logger[_0xefe3('0xa')](_0xefe3('0x5'),_0x2a8ea5,_0x450fb6[_0xefe3('0xa')][_0xefe3('0xb')]);return _0x2cec98(_0x450fb6[_0xefe3('0xa')][_0xefe3('0xb')]);}else{logger[_0xefe3('0xc')](_0xefe3('0x5'),_0x2a8ea5,_0xefe3('0x6'));_0x2cec98(_0x450fb6['result'][_0xefe3('0xb')]);}})[_0xefe3('0xd')](function(_0xbf79dd){logger[_0xefe3('0xa')](_0xefe3('0x5'),_0x2a8ea5,_0xbf79dd);_0x1ccadb(_0xbf79dd);});});} \ No newline at end of file +var _0x6abd=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskField,\x20%s,\x20%s','message','info','result','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6abd,0x8e));var _0xd6ab=function(_0x2c8f54,_0x3d5a57){_0x2c8f54=_0x2c8f54-0x0;var _0x5cd3e5=_0x6abd[_0x2c8f54];return _0x5cd3e5;};'use strict';var _=require('lodash');var util=require(_0xd6ab('0x0'));var moment=require('moment');var BPromise=require(_0xd6ab('0x1'));var rs=require(_0xd6ab('0x2'));var fs=require('fs');var Redis=require(_0xd6ab('0x3'));var db=require(_0xd6ab('0x4'))['db'];var utils=require(_0xd6ab('0x5'));var logger=require(_0xd6ab('0x6'))(_0xd6ab('0x7'));var config=require('../../config/environment');var jayson=require(_0xd6ab('0x8'));var client=jayson[_0xd6ab('0x9')][_0xd6ab('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c3057,_0x2b8bf4,_0x17803b){return new BPromise(function(_0x2d0746,_0x2ad66e){return client['request'](_0x5c3057,_0x17803b)[_0xd6ab('0xb')](function(_0x56ae81){logger['info']('DeskField,\x20%s,\x20%s',_0x2b8bf4,_0xd6ab('0xc'));logger['debug'](_0xd6ab('0xd'),_0x2b8bf4,_0xd6ab('0xc'),JSON[_0xd6ab('0xe')](_0x56ae81));if(_0x56ae81['error']){if(_0x56ae81[_0xd6ab('0xf')][_0xd6ab('0x10')]===0x1f4){logger[_0xd6ab('0xf')](_0xd6ab('0x11'),_0x2b8bf4,_0x56ae81['error'][_0xd6ab('0x12')]);return _0x2ad66e(_0x56ae81['error'][_0xd6ab('0x12')]);}logger[_0xd6ab('0xf')]('DeskField,\x20%s,\x20%s',_0x2b8bf4,_0x56ae81[_0xd6ab('0xf')][_0xd6ab('0x12')]);return _0x2d0746(_0x56ae81[_0xd6ab('0xf')]['message']);}else{logger[_0xd6ab('0x13')](_0xd6ab('0x11'),_0x2b8bf4,_0xd6ab('0xc'));_0x2d0746(_0x56ae81[_0xd6ab('0x14')][_0xd6ab('0x12')]);}})['catch'](function(_0x4b8b3e){logger[_0xd6ab('0xf')](_0xd6ab('0x11'),_0x2b8bf4,_0x4b8b3e);_0x2ad66e(_0x4b8b3e);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 3a74b15..2094c3f 100644 --- a/server/api/intDynamics365Account/index.js +++ b/server/api/intDynamics365Account/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5aff=['destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','/:id','show','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete'];(function(_0xf48efb,_0x307c7f){var _0x179636=function(_0xfcbe59){while(--_0xfcbe59){_0xf48efb['push'](_0xf48efb['shift']());}};_0x179636(++_0x307c7f);}(_0x5aff,0x116));var _0xf5af=function(_0x5799c2,_0x2e941e){_0x5799c2=_0x5799c2-0x0;var _0x30878c=_0x5aff[_0x5799c2];return _0x30878c;};'use strict';var multer=require(_0xf5af('0x0'));var util=require(_0xf5af('0x1'));var path=require('path');var timeout=require(_0xf5af('0x2'));var express=require(_0xf5af('0x3'));var router=express[_0xf5af('0x4')]();var fs_extra=require(_0xf5af('0x5'));var auth=require(_0xf5af('0x6'));var interaction=require(_0xf5af('0x7'));var config=require('../../config/environment');var controller=require('./intDynamics365Account.controller');router[_0xf5af('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf5af('0x8')](_0xf5af('0x9'),auth['isAuthenticated'](),controller[_0xf5af('0xa')]);router['get'](_0xf5af('0xb'),auth[_0xf5af('0xc')](),controller[_0xf5af('0xd')]);router[_0xf5af('0x8')](_0xf5af('0xe'),auth[_0xf5af('0xc')](),controller[_0xf5af('0xf')]);router[_0xf5af('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf5af('0x10')](_0xf5af('0xb'),auth[_0xf5af('0xc')](),controller[_0xf5af('0x11')]);router[_0xf5af('0x12')](_0xf5af('0x9'),auth[_0xf5af('0xc')](),controller[_0xf5af('0x13')]);router[_0xf5af('0x14')]('/:id',auth[_0xf5af('0xc')](),controller[_0xf5af('0x15')]);module[_0xf5af('0x16')]=router; \ No newline at end of file +var _0x772a=['fs-extra','../../components/interaction/service','./intDynamics365Account.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','destroy','exports','multer','util','connect-timeout','Router'];(function(_0x1c4c8f,_0x169501){var _0xc7199e=function(_0x1f485e){while(--_0x1f485e){_0x1c4c8f['push'](_0x1c4c8f['shift']());}};_0xc7199e(++_0x169501);}(_0x772a,0x1b1));var _0xa772=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0x772a[_0x346737];return _0x1ade2e;};'use strict';var multer=require(_0xa772('0x0'));var util=require(_0xa772('0x1'));var path=require('path');var timeout=require(_0xa772('0x2'));var express=require('express');var router=express[_0xa772('0x3')]();var fs_extra=require(_0xa772('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa772('0x5'));var config=require('../../config/environment');var controller=require(_0xa772('0x6'));router[_0xa772('0x7')]('/',auth['isAuthenticated'](),controller[_0xa772('0x8')]);router[_0xa772('0x7')](_0xa772('0x9'),auth[_0xa772('0xa')](),controller[_0xa772('0xb')]);router['get'](_0xa772('0xc'),auth[_0xa772('0xa')](),controller[_0xa772('0xd')]);router[_0xa772('0x7')](_0xa772('0xe'),auth['isAuthenticated'](),controller[_0xa772('0xf')]);router[_0xa772('0x10')]('/',auth[_0xa772('0xa')](),controller[_0xa772('0x11')]);router[_0xa772('0x10')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xa772('0x12')]);router[_0xa772('0x13')](_0xa772('0x9'),auth[_0xa772('0xa')](),controller['update']);router[_0xa772('0x14')](_0xa772('0x9'),auth['isAuthenticated'](),controller[_0xa772('0x15')]);module[_0xa772('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 604d8d2..7486055 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.attributes.js +++ b/server/api/intDynamics365Account/intDynamics365Account.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6b4e=['BOOLEAN','exports','STRING'];(function(_0x30c975,_0x1d1e5d){var _0x587b4c=function(_0x22a40f){while(--_0x22a40f){_0x30c975['push'](_0x30c975['shift']());}};_0x587b4c(++_0x1d1e5d);}(_0x6b4e,0x1a8));var _0xe6b4=function(_0x2ae289,_0x870d5d){_0x2ae289=_0x2ae289-0x0;var _0x12b941=_0x6b4e[_0x2ae289];return _0x12b941;};'use strict';var Sequelize=require('sequelize');module[_0xe6b4('0x0')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0xe6b4('0x1')]},'clientId':{'type':Sequelize[_0xe6b4('0x1')]},'clientSecret':{'type':Sequelize[_0xe6b4('0x1')]},'serverUrl':{'type':Sequelize[_0xe6b4('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xe6b4('0x1')]},'modernAuthentication':{'type':Sequelize[_0xe6b4('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x09f4=['STRING','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x09f4,0xe4));var _0x409f=function(_0x1ef2cf,_0x12eafd){_0x1ef2cf=_0x1ef2cf-0x0;var _0x24ba77=_0x09f4[_0x1ef2cf];return _0x24ba77;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x409f('0x0')]},'username':{'type':Sequelize[_0x409f('0x0')]},'password':{'type':Sequelize[_0x409f('0x0')]},'remoteUri':{'type':Sequelize[_0x409f('0x0')]},'tenantId':{'type':Sequelize[_0x409f('0x0')]},'clientId':{'type':Sequelize[_0x409f('0x0')]},'clientSecret':{'type':Sequelize[_0x409f('0x0')]},'serverUrl':{'type':Sequelize[_0x409f('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x409f('0x0')]},'modernAuthentication':{'type':Sequelize[_0x409f('0x1')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 34f4cf1..213d066 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.controller.js +++ b/server/api/intDynamics365Account/intDynamics365Account.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x85f8=['overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','slaname','socialprofileidname','statecode','timezoneruleversionnumber','transactioncurrencyidname','utcconversiontimezonecode','versionnumber','username','password','remoteUri','tenantId','modernAuthentication','CloudProvider','data5','access_token','data7','POST','https://login.microsoftonline.com/','/oauth2/token','clientId','clientSecret','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach','PicklistAttributeMetadata','push','MetadataId','all','@odata.type','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','concat','test','statusCode','stack','Wrong\x20credentials','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','api','../../components/integrations/configuration','status','json','undefined','count','offset','set','Content-Range','destroy','then','end','error','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','options','includeAll','include','findAll','catch','show','params','create','update','body','find','getConfigurations','findOne','pick','addConfiguration','AccountId','Subjects','getSubjects','type','Descriptions','getDescriptions','Dynamics365Configuration','Dynamics365Field','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','PhoneCall','title','customerid','subject','phonenumber','regardingobjectid','accountidname','actualserviceunits','billedserviceunits','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdon','customeridtype','emailaddress','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','numberofchildincidents','onholdtime'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x85f8,0x10f));var _0x885f=function(_0x46bc57,_0x3eb260){_0x46bc57=_0x46bc57-0x0;var _0x417b7e=_0x85f8[_0x46bc57];return _0x417b7e;};'use strict';var rp=require(_0x885f('0x0'));var util=require(_0x885f('0x1'));var _=require('lodash');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x885f('0x2'));var db=require('../../mysqldb')['db'];var integrations=require(_0x885f('0x3'));function respondWithResult(_0x871785,_0x2425f7){_0x2425f7=_0x2425f7||0xc8;return function(_0x444c12){if(_0x444c12){return _0x871785[_0x885f('0x4')](_0x2425f7)[_0x885f('0x5')](_0x444c12);}};}function respondWithFilteredResult(_0x578126,_0x4f8f5c){return function(_0x43f1d5){if(_0x43f1d5){var _0x4783ee=typeof _0x4f8f5c['offset']===_0x885f('0x6')&&typeof _0x4f8f5c['limit']===_0x885f('0x6');var _0x34c5b8=_0x43f1d5[_0x885f('0x7')];var _0x2834e1=_0x4783ee?0x0:_0x4f8f5c[_0x885f('0x8')];var _0x4c3b7a=_0x4783ee?_0x43f1d5[_0x885f('0x7')]:_0x4f8f5c[_0x885f('0x8')]+_0x4f8f5c['limit'];var _0x5dfb75;if(_0x4c3b7a>=_0x34c5b8){_0x4c3b7a=_0x34c5b8;_0x5dfb75=0xc8;}else{_0x5dfb75=0xce;}_0x578126[_0x885f('0x4')](_0x5dfb75);return _0x578126[_0x885f('0x9')](_0x885f('0xa'),_0x2834e1+'-'+_0x4c3b7a+'/'+_0x34c5b8)[_0x885f('0x5')](_0x43f1d5);}return null;};}function saveUpdates(_0xfdbf00){return function(_0x4147fb){if(_0x4147fb){return _0x4147fb['update'](_0xfdbf00)['then'](function(_0x2633e3){return _0x2633e3;});}return null;};}function removeEntity(_0x138593){return function(_0x1f69c1){if(_0x1f69c1){return _0x1f69c1[_0x885f('0xb')]()[_0x885f('0xc')](function(){_0x138593[_0x885f('0x4')](0xcc)[_0x885f('0xd')]();});}};}function handleEntityNotFound(_0x4115cd){return function(_0x2b377d){if(!_0x2b377d){_0x4115cd['sendStatus'](0x194);}return _0x2b377d;};}function handleError(_0x1c6760,_0x2200ad){_0x2200ad=_0x2200ad||0x1f4;return function(_0x15e5e5){logger[_0x885f('0xe')](_0x15e5e5['stack']);if(_0x15e5e5[_0x885f('0xf')]){delete _0x15e5e5[_0x885f('0xf')];}_0x1c6760['status'](_0x2200ad)[_0x885f('0x10')](_0x15e5e5);};}exports[_0x885f('0x11')]=function(_0x42cd96,_0x4b3796){var _0x4bab3f={},_0x4f5958={},_0x542994={'count':0x0,'rows':[]};var _0x28ac51=_[_0x885f('0x12')](db[_0x885f('0x13')][_0x885f('0x14')],function(_0x37ba64){return{'name':_0x37ba64[_0x885f('0x15')],'type':_0x37ba64['type'][_0x885f('0x16')]};});_0x4f5958[_0x885f('0x17')]=_[_0x885f('0x12')](_0x28ac51,'name');_0x4f5958[_0x885f('0x18')]=_[_0x885f('0x19')](_0x42cd96[_0x885f('0x18')]);_0x4f5958[_0x885f('0x1a')]=_[_0x885f('0x1b')](_0x4f5958[_0x885f('0x17')],_0x4f5958[_0x885f('0x18')]);_0x4bab3f['attributes']=_[_0x885f('0x1b')](_0x4f5958['model'],qs[_0x885f('0x1c')](_0x42cd96[_0x885f('0x18')]['fields']));_0x4bab3f[_0x885f('0x1d')]=_0x4bab3f[_0x885f('0x1d')][_0x885f('0x1e')]?_0x4bab3f[_0x885f('0x1d')]:_0x4f5958[_0x885f('0x17')];if(!_0x42cd96[_0x885f('0x18')][_0x885f('0x1f')](_0x885f('0x20'))){_0x4bab3f['limit']=qs[_0x885f('0x21')](_0x42cd96[_0x885f('0x18')][_0x885f('0x21')]);_0x4bab3f[_0x885f('0x8')]=qs[_0x885f('0x8')](_0x42cd96[_0x885f('0x18')][_0x885f('0x8')]);}_0x4bab3f[_0x885f('0x22')]=qs[_0x885f('0x23')](_0x42cd96[_0x885f('0x18')][_0x885f('0x23')]);_0x4bab3f[_0x885f('0x24')]=qs[_0x885f('0x1a')](_['pick'](_0x42cd96['query'],_0x4f5958[_0x885f('0x1a')]),_0x28ac51);if(_0x42cd96[_0x885f('0x18')][_0x885f('0x25')]){_0x4bab3f['where']=_[_0x885f('0x26')](_0x4bab3f[_0x885f('0x24')],{'$or':_['map'](_0x28ac51,function(_0x523f55){if(_0x523f55['type']!=='VIRTUAL'){var _0x4497cf={};_0x4497cf[_0x523f55[_0x885f('0xf')]]={'$like':'%'+_0x42cd96[_0x885f('0x18')][_0x885f('0x25')]+'%'};return _0x4497cf;}})});}_0x4bab3f=_[_0x885f('0x26')]({},_0x4bab3f,_0x42cd96[_0x885f('0x27')]);var _0x148c45={'where':_0x4bab3f['where']};return db[_0x885f('0x13')]['count'](_0x148c45)[_0x885f('0xc')](function(_0x1f7e04){_0x542994[_0x885f('0x7')]=_0x1f7e04;if(_0x42cd96[_0x885f('0x18')][_0x885f('0x28')]){_0x4bab3f[_0x885f('0x29')]=[{'all':!![]}];}return db[_0x885f('0x13')][_0x885f('0x2a')](_0x4bab3f);})['then'](function(_0x1a5318){_0x542994['rows']=_0x1a5318;return _0x542994;})[_0x885f('0xc')](respondWithFilteredResult(_0x4b3796,_0x4bab3f))[_0x885f('0x2b')](handleError(_0x4b3796,null));};exports[_0x885f('0x2c')]=function(_0x58a7e9,_0x3d9cd4){var _0x488a78={'raw':![],'where':{'id':_0x58a7e9[_0x885f('0x2d')]['id']}},_0x532ccc={};_0x532ccc[_0x885f('0x17')]=_[_0x885f('0x19')](db['Dynamics365Account'][_0x885f('0x14')]);_0x532ccc[_0x885f('0x18')]=_[_0x885f('0x19')](_0x58a7e9[_0x885f('0x18')]);_0x532ccc[_0x885f('0x1a')]=_[_0x885f('0x1b')](_0x532ccc[_0x885f('0x17')],_0x532ccc[_0x885f('0x18')]);_0x488a78[_0x885f('0x1d')]=_[_0x885f('0x1b')](_0x532ccc[_0x885f('0x17')],qs[_0x885f('0x1c')](_0x58a7e9['query'][_0x885f('0x1c')]));_0x488a78[_0x885f('0x1d')]=_0x488a78['attributes'][_0x885f('0x1e')]?_0x488a78['attributes']:_0x532ccc[_0x885f('0x17')];if(_0x58a7e9[_0x885f('0x18')][_0x885f('0x28')]){_0x488a78['include']=[{'all':!![]}];}_0x488a78=_[_0x885f('0x26')]({},_0x488a78,_0x58a7e9[_0x885f('0x27')]);return db[_0x885f('0x13')]['find'](_0x488a78)[_0x885f('0xc')](handleEntityNotFound(_0x3d9cd4,null))[_0x885f('0xc')](respondWithResult(_0x3d9cd4,null))[_0x885f('0x2b')](handleError(_0x3d9cd4,null));};exports[_0x885f('0x2e')]=function(_0x4da028,_0x49c6f7){return db[_0x885f('0x13')][_0x885f('0x2e')](_0x4da028['body'],{})['then'](respondWithResult(_0x49c6f7,0xc9))[_0x885f('0x2b')](handleError(_0x49c6f7,null));};exports[_0x885f('0x2f')]=function(_0x25d645,_0xc122b3){if(_0x25d645[_0x885f('0x30')]['id']){delete _0x25d645[_0x885f('0x30')]['id'];}return db[_0x885f('0x13')][_0x885f('0x31')]({'where':{'id':_0x25d645['params']['id']}})[_0x885f('0xc')](handleEntityNotFound(_0xc122b3,null))[_0x885f('0xc')](saveUpdates(_0x25d645[_0x885f('0x30')],null))[_0x885f('0xc')](respondWithResult(_0xc122b3,null))[_0x885f('0x2b')](handleError(_0xc122b3,null));};exports[_0x885f('0xb')]=function(_0x27a3b7,_0x1d09e9){return db[_0x885f('0x13')][_0x885f('0x31')]({'where':{'id':_0x27a3b7['params']['id']}})['then'](handleEntityNotFound(_0x1d09e9,null))['then'](removeEntity(_0x1d09e9,null))[_0x885f('0x2b')](handleError(_0x1d09e9,null));};exports[_0x885f('0x32')]=function(_0x55d300,_0x5288bd){var _0x13fd42={};var _0x16458a={};var _0x15ff35;var _0x4289af;return db[_0x885f('0x13')][_0x885f('0x33')]({'where':{'id':_0x55d300[_0x885f('0x2d')]['id']}})[_0x885f('0xc')](handleEntityNotFound(_0x5288bd,null))[_0x885f('0xc')](function(_0x2844c0){if(_0x2844c0){_0x15ff35=_0x2844c0;_0x16458a['model']=_[_0x885f('0x19')](db['Dynamics365Configuration'][_0x885f('0x14')]);_0x16458a['query']=_[_0x885f('0x19')](_0x55d300['query']);_0x16458a['filters']=_[_0x885f('0x1b')](_0x16458a[_0x885f('0x17')],_0x16458a['query']);_0x13fd42[_0x885f('0x1d')]=_['intersection'](_0x16458a[_0x885f('0x17')],qs[_0x885f('0x1c')](_0x55d300[_0x885f('0x18')][_0x885f('0x1c')]));_0x13fd42[_0x885f('0x1d')]=_0x13fd42[_0x885f('0x1d')]['length']?_0x13fd42[_0x885f('0x1d')]:_0x16458a['model'];_0x13fd42[_0x885f('0x22')]=qs[_0x885f('0x23')](_0x55d300['query'][_0x885f('0x23')]);_0x13fd42[_0x885f('0x24')]=qs[_0x885f('0x1a')](_[_0x885f('0x34')](_0x55d300[_0x885f('0x18')],_0x16458a['filters']));if(_0x55d300[_0x885f('0x18')][_0x885f('0x25')]){_0x13fd42[_0x885f('0x24')]=_[_0x885f('0x26')](_0x13fd42[_0x885f('0x24')],{'$or':_[_0x885f('0x12')](_0x13fd42[_0x885f('0x1d')],function(_0x660c1f){var _0x17fa85={};_0x17fa85[_0x660c1f]={'$like':'%'+_0x55d300[_0x885f('0x18')][_0x885f('0x25')]+'%'};return _0x17fa85;})});}_0x13fd42=_[_0x885f('0x26')]({},_0x13fd42,_0x55d300[_0x885f('0x27')]);return _0x15ff35[_0x885f('0x32')](_0x13fd42);}})[_0x885f('0xc')](function(_0x1c2f16){if(_0x1c2f16){_0x4289af=_0x1c2f16[_0x885f('0x1e')];if(!_0x55d300[_0x885f('0x18')]['hasOwnProperty']('nolimit')){_0x13fd42['limit']=qs[_0x885f('0x21')](_0x55d300[_0x885f('0x18')]['limit']);_0x13fd42[_0x885f('0x8')]=qs['offset'](_0x55d300[_0x885f('0x18')][_0x885f('0x8')]);}return _0x15ff35[_0x885f('0x32')](_0x13fd42);}})[_0x885f('0xc')](function(_0x16938b){if(_0x16938b){return _0x16938b?{'count':_0x4289af,'rows':_0x16938b}:null;}})[_0x885f('0xc')](respondWithResult(_0x5288bd,null))[_0x885f('0x2b')](handleError(_0x5288bd,null));};exports[_0x885f('0x35')]=function(_0x4d486d,_0xb9c900){if(_0x4d486d['body']['id']){delete _0x4d486d[_0x885f('0x30')]['id'];}return db[_0x885f('0x13')][_0x885f('0x33')]({'where':{'id':_0x4d486d['params']['id']}})[_0x885f('0xc')](handleEntityNotFound(_0xb9c900,null))['then'](function(_0x160474){if(_0x160474){_0x4d486d[_0x885f('0x30')][_0x885f('0x36')]=_0x160474['id'];_0x4d486d[_0x885f('0x30')][_0x885f('0x37')]=integrations[_0x885f('0x38')](_0x4d486d['body']['channel'],_0x4d486d['body'][_0x885f('0x39')]);_0x4d486d[_0x885f('0x30')][_0x885f('0x3a')]=integrations[_0x885f('0x3b')](_0x4d486d[_0x885f('0x30')]['channel'],_0x4d486d[_0x885f('0x30')][_0x885f('0x39')]);return db[_0x885f('0x3c')][_0x885f('0x2e')](_0x4d486d[_0x885f('0x30')],{'include':[{'model':db[_0x885f('0x3d')],'as':_0x885f('0x37')},{'model':db['Dynamics365Field'],'as':'Descriptions'}]});}return null;})[_0x885f('0xc')](respondWithResult(_0xb9c900,null))['catch'](handleError(_0xb9c900,null));};function sanitizeRemoteUri(_0x2bff34){var _0x450fd8=_0x2bff34[_0x885f('0x3e')](-0x1);if(_0x450fd8==='/')return _0x2bff34[_0x885f('0x3f')](0x0,_0x2bff34[_0x885f('0x40')](_0x450fd8));return _0x2bff34;}function getWebApiUrl(_0x430d42){return util[_0x885f('0x41')](_0x885f('0x42'),_0x430d42);}exports[_0x885f('0x43')]=function(_0x2510d5,_0x3bc01a){var _0x357f9d=_0x2510d5[_0x885f('0x18')][_0x885f('0x44')];var _0x227261=_0x357f9d===_0x885f('0x45')?_0x885f('0x46'):_0x885f('0x47');var _0x50bdee='';var _0x5bfecb='';var _0x20c330='';var _0x4d6ae5='';var _0x3830bc='';var _0x39e5d4='';var _0x578520='';var _0x32d3b5='';var _0x3a6805=[_0x885f('0x48'),'description',_0x885f('0x49'),'ownerid','caseorigincode',_0x885f('0x4a'),_0x885f('0x4b'),_0x885f('0x4c'),'directioncode','phonecall_activity_parties'];var _0xcf5cf8=[_0x885f('0x4d'),'accountidyominame',_0x885f('0x4e'),_0x885f('0x4f'),'contactidname',_0x885f('0x50'),_0x885f('0x51'),_0x885f('0x52'),_0x885f('0x53'),_0x885f('0x54'),'createdbyname','createdbyyominame',_0x885f('0x55'),'createdonbehalfbyname','createdonbehalfbyyominame','customeridname',_0x885f('0x56'),'customeridyominame',_0x885f('0x57'),'entitlementidname','entityimage_timestamp',_0x885f('0x58'),_0x885f('0x59'),_0x885f('0x5a'),_0x885f('0x5b'),_0x885f('0x5c'),_0x885f('0x5d'),'influencescore','kbarticleidname',_0x885f('0x5e'),_0x885f('0x5f'),_0x885f('0x60'),_0x885f('0x61'),_0x885f('0x62'),'modifiedbyyominame','modifiedon','modifiedonbehalfbyname',_0x885f('0x63'),_0x885f('0x64'),'msdyn_iotalertname',_0x885f('0x65'),_0x885f('0x66'),_0x885f('0x67'),_0x885f('0x68'),_0x885f('0x69'),_0x885f('0x6a'),_0x885f('0x6b'),_0x885f('0x6c'),_0x885f('0x6d'),_0x885f('0x6e'),_0x885f('0x6f'),_0x885f('0x70'),_0x885f('0x71'),_0x885f('0x72'),_0x885f('0x73'),_0x885f('0x74'),_0x885f('0x75'),'sentimentvalue',_0x885f('0x76'),_0x885f('0x77'),_0x885f('0x78'),_0x885f('0x79'),'statuscode','subjectidname','ticketnumber',_0x885f('0x7a'),_0x885f('0x7b'),'traversedpath',_0x885f('0x7c'),_0x885f('0x7d')];var _0x3a6d7a=_0x3a6805['concat'](_0xcf5cf8);return db[_0x885f('0x13')]['findOne']({'where':{'id':_0x2510d5[_0x885f('0x2d')]['id']},'attributes':['id',_0x885f('0x7e'),_0x885f('0x7f'),_0x885f('0x80'),_0x885f('0x81'),'clientId','clientSecret',_0x885f('0x82')],'include':[{'model':db['CloudProvider'],'as':_0x885f('0x83'),'attributes':['id',_0x885f('0x84'),'data7']}]})[_0x885f('0xc')](handleEntityNotFound(_0x3bc01a,null))['then'](function(_0x5dd0b4){if(_0x5dd0b4){if(_0x5dd0b4['modernAuthentication']){_0x5dd0b4[_0x885f('0x85')]=_0x5dd0b4[_0x885f('0x83')]['data5'];_0x32d3b5=sanitizeRemoteUri(_0x5dd0b4['CloudProvider'][_0x885f('0x86')]);_0x578520=getWebApiUrl(_0x32d3b5);return _0x5dd0b4;}_0x32d3b5=sanitizeRemoteUri(_0x5dd0b4[_0x885f('0x80')]);_0x578520=getWebApiUrl(_0x32d3b5);var _0x46ef2b={'method':_0x885f('0x87'),'uri':_0x885f('0x88')+_0x5dd0b4[_0x885f('0x81')]+_0x885f('0x89'),'form':{'client_id':_0x5dd0b4[_0x885f('0x8a')],'resource':_0x32d3b5,'username':_0x5dd0b4[_0x885f('0x7e')],'password':_0x5dd0b4[_0x885f('0x7f')],'grant_type':'password','client_secret':_0x5dd0b4[_0x885f('0x8b')]},'json':!![]};return rp(_0x46ef2b);}})[_0x885f('0xc')](function(_0x2a0cac){_0x39e5d4=_0x2a0cac['access_token'];var _0x2df0ad={'method':_0x885f('0x8c'),'uri':encodeURI(_0x578520+_0x885f('0x8d')+_0x227261+'\x27'),'headers':{'Authorization':_0x885f('0x8e')+_0x39e5d4,'If-None-Match':null,'OData-Version':_0x885f('0x8f')},'json':!![]};return rp(_0x2df0ad);})[_0x885f('0xc')](function(_0x425fd9){var _0x55638f=_0x425fd9[_0x885f('0x90')][0x0];var _0x7e3ee4=_0x55638f['MetadataId'];var _0x474539={'method':_0x885f('0x8c'),'uri':_0x578520+'EntityDefinitions('+_0x7e3ee4+_0x885f('0x91'),'headers':{'Authorization':'Bearer\x20'+_0x39e5d4,'If-None-Match':null,'OData-Version':_0x885f('0x8f')},'json':!![]};return rp(_0x474539);})['then'](function(_0x145860){_0x50bdee=_0x145860;_0x5bfecb=_0x50bdee[_0x885f('0x92')];_0x5bfecb=_[_0x885f('0x93')](_0x5bfecb,function(_0x586430){return!_0x3a6d7a[_0x885f('0x94')](_0x586430[_0x885f('0x95')]);});var _0x2c79c3=[];var _0x27a314=[];_0x5bfecb[_0x885f('0x96')](function(_0x3d81aa){if(_0x3d81aa['@odata.type']){var _0x413d8c=_0x3d81aa['@odata.type'][_0x885f('0x3f')](_0x3d81aa['@odata.type'][_0x885f('0x40')]('.')+0x1);if(_0x413d8c===_0x885f('0x97')){_0x2c79c3[_0x885f('0x98')](getSelectList(_0x578520,_0x357f9d,_0x27a314,_0x50bdee['MetadataId'],_0x3d81aa[_0x885f('0x99')],_0x39e5d4));}}});return Promise[_0x885f('0x9a')](_0x2c79c3);})[_0x885f('0xc')](function(_0x2a40e8){_0x20c330=_0x2a40e8[0x0];var _0x49b837=[];var _0x3f81cf=[];_0x5bfecb[_0x885f('0x96')](function(_0x4a286c){if(!_['isNil'](_0x4a286c[_0x885f('0x9b')])){var _0x1d2c55=_0x4a286c['@odata.type'][_0x885f('0x3f')](_0x4a286c[_0x885f('0x9b')][_0x885f('0x40')]('.')+0x1);if(_0x1d2c55===_0x885f('0x9c')){_0x49b837[_0x885f('0x98')](getBooleanList(_0x578520,_0x357f9d,_0x3f81cf,_0x50bdee[_0x885f('0x99')],_0x4a286c['MetadataId'],_0x39e5d4));}}});return Promise[_0x885f('0x9a')](_0x49b837);})[_0x885f('0xc')](function(_0x1386bd){_0x4d6ae5=_0x1386bd[0x0];var _0x2d66ba=[];var _0x5b9d42=[];_0x5bfecb[_0x885f('0x96')](function(_0x429eae){if(_0x429eae[_0x885f('0x9b')]){var _0x3fe323=_0x429eae['@odata.type'][_0x885f('0x3f')](_0x429eae[_0x885f('0x9b')][_0x885f('0x40')]('.')+0x1);if(_0x3fe323===_0x885f('0x9d')||_0x3fe323===_0x885f('0x9e')||_0x3fe323===_0x885f('0x9f')||_0x3fe323===_0x885f('0xa0')||_0x3fe323==='MemoAttributeMetadata'||_0x3fe323===_0x885f('0xa1')||_0x3fe323===_0x885f('0xa2')||_0x3fe323===_0x885f('0xa3')||_0x3fe323==='StateAttributeMetadata'||_0x3fe323===_0x885f('0xa4')){_0x2d66ba[_0x885f('0x98')](getInputList(_0x578520,_0x357f9d,_0x3fe323,_0x5b9d42,_0x50bdee[_0x885f('0x99')],_0x429eae['MetadataId'],_0x39e5d4));}}});return Promise[_0x885f('0x9a')](_0x2d66ba);})['then'](function(_0x6a4fb4){_0x3830bc=_0x6a4fb4[0x0];var _0x4f10e7=_0x20c330[_0x885f('0xa5')](_0x4d6ae5)[_0x885f('0xa5')](_0x3830bc);var _0xca06f={'count':_0x4f10e7[_0x885f('0x1e')],'rows':_0x4f10e7};return _0xca06f;})[_0x885f('0xc')](respondWithResult(_0x3bc01a,null))[_0x885f('0x2b')](function(_0x3aa9b7){var _0x2d38f7=_0x2510d5[_0x885f('0x18')][_0x885f('0xa6')]?0x1f4:_0x3aa9b7[_0x885f('0xa7')]||0x1f4;logger[_0x885f('0xe')](_0x3aa9b7[_0x885f('0xa8')]);delete _0x3aa9b7[_0x885f('0xf')];if(_0x2d38f7===0x191){_0x2d38f7=0x190;}_0x3bc01a[_0x885f('0x4')](_0x2d38f7)[_0x885f('0x10')](_0x2510d5[_0x885f('0x18')][_0x885f('0xa6')]?{'message':_0x885f('0xa9'),'statusCode':_0x3aa9b7[_0x885f('0xa7')]}:_0x3aa9b7);});};function getSelectList(_0x44b8d7,_0x4fcc36,_0x4b00d2,_0x4a7046,_0x1a05e3,_0x2a0d82){var _0x5033f3={'method':_0x885f('0x8c'),'uri':_0x44b8d7+_0x885f('0xaa')+_0x4a7046+_0x885f('0xab')+_0x1a05e3+_0x885f('0xac')+_0x885f('0xad'),'headers':{'Authorization':_0x885f('0x8e')+_0x2a0d82,'If-None-Match':null,'OData-Version':_0x885f('0x8f')},'json':!![]};return rp(_0x5033f3)[_0x885f('0xc')](function(_0x5719be){var _0x4e64c0=[];var _0x85fa79=_0x5719be[_0x885f('0xae')][_0x885f('0xaf')];_0x85fa79[_0x885f('0x96')](function(_0x1d83c7){_0x4e64c0[_0x885f('0x98')]({'name':_0x1d83c7[_0x885f('0xb0')][_0x885f('0xb1')][_0x885f('0xb0')],'value':String(_0x1d83c7[_0x885f('0xb2')])});});var _0x317ec6={'id':_0x4fcc36+'_'+_0x5719be[_0x885f('0x95')],'name':_0x5719be[_0x885f('0xb3')][_0x885f('0xb1')][_0x885f('0xb0')],'custom':![],'options':_0x4e64c0};_0x4b00d2['push'](_0x317ec6);return _0x4b00d2;});}function getBooleanList(_0x31a189,_0x1939b8,_0x3b0a03,_0x4fcf4d,_0x1fed9e,_0x57dbea){var _0x2fcafa={'method':_0x885f('0x8c'),'uri':_0x31a189+_0x885f('0xaa')+_0x4fcf4d+_0x885f('0xab')+_0x1fed9e+_0x885f('0xb4'),'headers':{'Authorization':_0x885f('0x8e')+_0x57dbea,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2fcafa)[_0x885f('0xc')](function(_0x144bec){var _0x2cbe14=[];_0x2cbe14[_0x885f('0x98')]({'name':_0x144bec[_0x885f('0xae')][_0x885f('0xb5')][_0x885f('0xb0')]['UserLocalizedLabel']['Label'],'value':_0x885f('0xb6')},{'name':_0x144bec[_0x885f('0xae')][_0x885f('0xb7')][_0x885f('0xb0')][_0x885f('0xb1')]['Label'],'value':_0x885f('0xb8')});var _0x53e8ff={'id':_0x1939b8+'_'+_0x144bec['LogicalName'],'name':_0x144bec[_0x885f('0xb3')][_0x885f('0xb1')][_0x885f('0xb0')],'custom':![],'options':_0x2cbe14};_0x3b0a03[_0x885f('0x98')](_0x53e8ff);return _0x3b0a03;});}function getInputList(_0x6288f4,_0x426900,_0x2935cd,_0x18ec5b,_0x5a8ca4,_0x5e2532,_0x4fcca1){var _0x5b3587={'method':_0x885f('0x8c'),'uri':_0x6288f4+_0x885f('0xaa')+_0x5a8ca4+')/Attributes('+_0x5e2532+_0x885f('0xb9')+_0x2935cd+_0x885f('0xba'),'headers':{'Authorization':_0x885f('0x8e')+_0x4fcca1,'If-None-Match':null,'OData-Version':_0x885f('0x8f')},'json':!![]};return rp(_0x5b3587)['then'](function(_0x34ce19){var _0x419353={'id':_0x426900+'_'+_0x34ce19['LogicalName'],'name':_0x34ce19['DisplayName'][_0x885f('0xb1')]?_0x34ce19[_0x885f('0xb3')]['UserLocalizedLabel']['Label']:_0x34ce19['LogicalName'],'custom':![],'options':[]};_0x18ec5b['push'](_0x419353);return _0x18ec5b;});} \ No newline at end of file +var _0x8960=['false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','json','undefined','limit','count','offset','set','Content-Range','status','name','index','Dynamics365Account','key','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','map','merge','options','then','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','destroy','getConfigurations','findOne','pick','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','type','getDescriptions','Dynamics365Configuration','Dynamics365Field','Descriptions','slice','substring','lastIndexOf','%s/api/data/v9.0/','getFields','incident','Incident','title','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','accountidname','accountidyominame','actualserviceunits','contactidname','contactidyominame','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdonbehalfbyname','createdonbehalfbyyominame','customeridtype','customeridyominame','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','primarycontactidname','productidname','productserialnumber','resolveby','responsiblecontactidname','slainvokedidname','slaname','socialprofileidname','statuscode','subjectidname','timezoneruleversionnumber','traversedpath','versionnumber','username','password','remoteUri','tenantId','clientSecret','modernAuthentication','CloudProvider','data5','data7','POST','https://login.microsoftonline.com/','/oauth2/token','clientId','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','BooleanAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','concat','test','statusCode','error','stack','send','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption'];(function(_0xd39959,_0x302d09){var _0x1ff69c=function(_0x17c97f){while(--_0x17c97f){_0xd39959['push'](_0xd39959['shift']());}};_0x1ff69c(++_0x302d09);}(_0x8960,0x17b));var _0x0896=function(_0x2dfba4,_0x51641a){_0x2dfba4=_0x2dfba4-0x0;var _0xda99e0=_0x8960[_0x2dfba4];return _0xda99e0;};'use strict';var rp=require('request-promise');var util=require(_0x0896('0x0'));var _=require(_0x0896('0x1'));var qs=require(_0x0896('0x2'));var logger=require(_0x0896('0x3'))(_0x0896('0x4'));var db=require(_0x0896('0x5'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithResult(_0x3f8c29,_0x2be203){_0x2be203=_0x2be203||0xc8;return function(_0x281c63){if(_0x281c63){return _0x3f8c29['status'](_0x2be203)[_0x0896('0x6')](_0x281c63);}};}function respondWithFilteredResult(_0x29943f,_0x5dae89){return function(_0x197968){if(_0x197968){var _0x4958f1=typeof _0x5dae89['offset']===_0x0896('0x7')&&typeof _0x5dae89[_0x0896('0x8')]===_0x0896('0x7');var _0x1e9753=_0x197968[_0x0896('0x9')];var _0x1612c7=_0x4958f1?0x0:_0x5dae89[_0x0896('0xa')];var _0x1dcaad=_0x4958f1?_0x197968['count']:_0x5dae89['offset']+_0x5dae89[_0x0896('0x8')];var _0x413b5b;if(_0x1dcaad>=_0x1e9753){_0x1dcaad=_0x1e9753;_0x413b5b=0xc8;}else{_0x413b5b=0xce;}_0x29943f['status'](_0x413b5b);return _0x29943f[_0x0896('0xb')](_0x0896('0xc'),_0x1612c7+'-'+_0x1dcaad+'/'+_0x1e9753)['json'](_0x197968);}return null;};}function saveUpdates(_0x1eaa10){return function(_0xedf9bc){if(_0xedf9bc){return _0xedf9bc['update'](_0x1eaa10)['then'](function(_0x5e835c){return _0x5e835c;});}return null;};}function removeEntity(_0x6e8894){return function(_0x595c4d){if(_0x595c4d){return _0x595c4d['destroy']()['then'](function(){_0x6e8894[_0x0896('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c7559){return function(_0xe7da5a){if(!_0xe7da5a){_0x4c7559['sendStatus'](0x194);}return _0xe7da5a;};}function handleError(_0x1806d6,_0x53581e){_0x53581e=_0x53581e||0x1f4;return function(_0x182c2f){logger['error'](_0x182c2f['stack']);if(_0x182c2f['name']){delete _0x182c2f[_0x0896('0xe')];}_0x1806d6[_0x0896('0xd')](_0x53581e)['send'](_0x182c2f);};}exports[_0x0896('0xf')]=function(_0x1e1620,_0x77b14){var _0x56a98c={},_0x22f875={},_0x22dc6c={'count':0x0,'rows':[]};var _0x16e170=_['map'](db[_0x0896('0x10')]['rawAttributes'],function(_0x4de18a){return{'name':_0x4de18a['fieldName'],'type':_0x4de18a['type'][_0x0896('0x11')]};});_0x22f875['model']=_['map'](_0x16e170,_0x0896('0xe'));_0x22f875['query']=_[_0x0896('0x12')](_0x1e1620[_0x0896('0x13')]);_0x22f875[_0x0896('0x14')]=_['intersection'](_0x22f875[_0x0896('0x15')],_0x22f875[_0x0896('0x13')]);_0x56a98c['attributes']=_[_0x0896('0x16')](_0x22f875[_0x0896('0x15')],qs[_0x0896('0x17')](_0x1e1620[_0x0896('0x13')][_0x0896('0x17')]));_0x56a98c[_0x0896('0x18')]=_0x56a98c['attributes'][_0x0896('0x19')]?_0x56a98c[_0x0896('0x18')]:_0x22f875[_0x0896('0x15')];if(!_0x1e1620['query'][_0x0896('0x1a')]('nolimit')){_0x56a98c[_0x0896('0x8')]=qs[_0x0896('0x8')](_0x1e1620[_0x0896('0x13')][_0x0896('0x8')]);_0x56a98c['offset']=qs[_0x0896('0xa')](_0x1e1620[_0x0896('0x13')]['offset']);}_0x56a98c[_0x0896('0x1b')]=qs[_0x0896('0x1c')](_0x1e1620[_0x0896('0x13')][_0x0896('0x1c')]);_0x56a98c[_0x0896('0x1d')]=qs[_0x0896('0x14')](_['pick'](_0x1e1620['query'],_0x22f875[_0x0896('0x14')]),_0x16e170);if(_0x1e1620[_0x0896('0x13')][_0x0896('0x1e')]){_0x56a98c[_0x0896('0x1d')]=_['merge'](_0x56a98c[_0x0896('0x1d')],{'$or':_[_0x0896('0x1f')](_0x16e170,function(_0x358465){if(_0x358465['type']!=='VIRTUAL'){var _0x7356d1={};_0x7356d1[_0x358465[_0x0896('0xe')]]={'$like':'%'+_0x1e1620['query'][_0x0896('0x1e')]+'%'};return _0x7356d1;}})});}_0x56a98c=_[_0x0896('0x20')]({},_0x56a98c,_0x1e1620[_0x0896('0x21')]);var _0x2890eb={'where':_0x56a98c[_0x0896('0x1d')]};return db[_0x0896('0x10')][_0x0896('0x9')](_0x2890eb)[_0x0896('0x22')](function(_0x3d5c1f){_0x22dc6c['count']=_0x3d5c1f;if(_0x1e1620['query']['includeAll']){_0x56a98c[_0x0896('0x23')]=[{'all':!![]}];}return db['Dynamics365Account'][_0x0896('0x24')](_0x56a98c);})['then'](function(_0x557b40){_0x22dc6c[_0x0896('0x25')]=_0x557b40;return _0x22dc6c;})[_0x0896('0x22')](respondWithFilteredResult(_0x77b14,_0x56a98c))[_0x0896('0x26')](handleError(_0x77b14,null));};exports[_0x0896('0x27')]=function(_0x5382d4,_0x33c8e5){var _0x161594={'raw':![],'where':{'id':_0x5382d4[_0x0896('0x28')]['id']}},_0x4aebfb={};_0x4aebfb[_0x0896('0x15')]=_['keys'](db[_0x0896('0x10')][_0x0896('0x29')]);_0x4aebfb[_0x0896('0x13')]=_[_0x0896('0x12')](_0x5382d4['query']);_0x4aebfb[_0x0896('0x14')]=_[_0x0896('0x16')](_0x4aebfb[_0x0896('0x15')],_0x4aebfb[_0x0896('0x13')]);_0x161594[_0x0896('0x18')]=_[_0x0896('0x16')](_0x4aebfb[_0x0896('0x15')],qs['fields'](_0x5382d4[_0x0896('0x13')][_0x0896('0x17')]));_0x161594[_0x0896('0x18')]=_0x161594[_0x0896('0x18')][_0x0896('0x19')]?_0x161594[_0x0896('0x18')]:_0x4aebfb['model'];if(_0x5382d4[_0x0896('0x13')][_0x0896('0x2a')]){_0x161594[_0x0896('0x23')]=[{'all':!![]}];}_0x161594=_[_0x0896('0x20')]({},_0x161594,_0x5382d4[_0x0896('0x21')]);return db[_0x0896('0x10')][_0x0896('0x2b')](_0x161594)[_0x0896('0x22')](handleEntityNotFound(_0x33c8e5,null))['then'](respondWithResult(_0x33c8e5,null))[_0x0896('0x26')](handleError(_0x33c8e5,null));};exports['create']=function(_0x5b86e5,_0x244165){return db[_0x0896('0x10')][_0x0896('0x2c')](_0x5b86e5[_0x0896('0x2d')],{})[_0x0896('0x22')](respondWithResult(_0x244165,0xc9))[_0x0896('0x26')](handleError(_0x244165,null));};exports['update']=function(_0x3cdef3,_0x356ef9){if(_0x3cdef3['body']['id']){delete _0x3cdef3[_0x0896('0x2d')]['id'];}return db['Dynamics365Account'][_0x0896('0x2b')]({'where':{'id':_0x3cdef3[_0x0896('0x28')]['id']}})[_0x0896('0x22')](handleEntityNotFound(_0x356ef9,null))[_0x0896('0x22')](saveUpdates(_0x3cdef3[_0x0896('0x2d')],null))[_0x0896('0x22')](respondWithResult(_0x356ef9,null))[_0x0896('0x26')](handleError(_0x356ef9,null));};exports[_0x0896('0x2e')]=function(_0x439bbb,_0x4dade6){return db[_0x0896('0x10')]['find']({'where':{'id':_0x439bbb[_0x0896('0x28')]['id']}})[_0x0896('0x22')](handleEntityNotFound(_0x4dade6,null))['then'](removeEntity(_0x4dade6,null))[_0x0896('0x26')](handleError(_0x4dade6,null));};exports[_0x0896('0x2f')]=function(_0x1145c5,_0x578b75){var _0x138ef0={};var _0x52e170={};var _0x52f67c;var _0x159274;return db[_0x0896('0x10')][_0x0896('0x30')]({'where':{'id':_0x1145c5[_0x0896('0x28')]['id']}})[_0x0896('0x22')](handleEntityNotFound(_0x578b75,null))[_0x0896('0x22')](function(_0x4d78d3){if(_0x4d78d3){_0x52f67c=_0x4d78d3;_0x52e170[_0x0896('0x15')]=_[_0x0896('0x12')](db['Dynamics365Configuration'][_0x0896('0x29')]);_0x52e170[_0x0896('0x13')]=_[_0x0896('0x12')](_0x1145c5[_0x0896('0x13')]);_0x52e170[_0x0896('0x14')]=_[_0x0896('0x16')](_0x52e170['model'],_0x52e170[_0x0896('0x13')]);_0x138ef0[_0x0896('0x18')]=_[_0x0896('0x16')](_0x52e170[_0x0896('0x15')],qs[_0x0896('0x17')](_0x1145c5[_0x0896('0x13')][_0x0896('0x17')]));_0x138ef0[_0x0896('0x18')]=_0x138ef0[_0x0896('0x18')][_0x0896('0x19')]?_0x138ef0[_0x0896('0x18')]:_0x52e170[_0x0896('0x15')];_0x138ef0[_0x0896('0x1b')]=qs[_0x0896('0x1c')](_0x1145c5[_0x0896('0x13')][_0x0896('0x1c')]);_0x138ef0[_0x0896('0x1d')]=qs[_0x0896('0x14')](_[_0x0896('0x31')](_0x1145c5[_0x0896('0x13')],_0x52e170[_0x0896('0x14')]));if(_0x1145c5[_0x0896('0x13')]['filter']){_0x138ef0[_0x0896('0x1d')]=_[_0x0896('0x20')](_0x138ef0['where'],{'$or':_[_0x0896('0x1f')](_0x138ef0['attributes'],function(_0x2c7985){var _0x3d5780={};_0x3d5780[_0x2c7985]={'$like':'%'+_0x1145c5[_0x0896('0x13')][_0x0896('0x1e')]+'%'};return _0x3d5780;})});}_0x138ef0=_[_0x0896('0x20')]({},_0x138ef0,_0x1145c5[_0x0896('0x21')]);return _0x52f67c[_0x0896('0x2f')](_0x138ef0);}})[_0x0896('0x22')](function(_0x5d0d7e){if(_0x5d0d7e){_0x159274=_0x5d0d7e['length'];if(!_0x1145c5['query'][_0x0896('0x1a')](_0x0896('0x32'))){_0x138ef0[_0x0896('0x8')]=qs[_0x0896('0x8')](_0x1145c5[_0x0896('0x13')]['limit']);_0x138ef0[_0x0896('0xa')]=qs[_0x0896('0xa')](_0x1145c5[_0x0896('0x13')][_0x0896('0xa')]);}return _0x52f67c['getConfigurations'](_0x138ef0);}})['then'](function(_0x4cddd4){if(_0x4cddd4){return _0x4cddd4?{'count':_0x159274,'rows':_0x4cddd4}:null;}})[_0x0896('0x22')](respondWithResult(_0x578b75,null))[_0x0896('0x26')](handleError(_0x578b75,null));};exports[_0x0896('0x33')]=function(_0x5c0179,_0x21ba5c){if(_0x5c0179[_0x0896('0x2d')]['id']){delete _0x5c0179['body']['id'];}return db[_0x0896('0x10')][_0x0896('0x30')]({'where':{'id':_0x5c0179[_0x0896('0x28')]['id']}})[_0x0896('0x22')](handleEntityNotFound(_0x21ba5c,null))[_0x0896('0x22')](function(_0x1d5691){if(_0x1d5691){_0x5c0179['body'][_0x0896('0x34')]=_0x1d5691['id'];_0x5c0179[_0x0896('0x2d')][_0x0896('0x35')]=integrations[_0x0896('0x36')](_0x5c0179[_0x0896('0x2d')][_0x0896('0x37')],_0x5c0179[_0x0896('0x2d')][_0x0896('0x38')]);_0x5c0179[_0x0896('0x2d')]['Descriptions']=integrations[_0x0896('0x39')](_0x5c0179['body']['channel'],_0x5c0179[_0x0896('0x2d')][_0x0896('0x38')]);return db[_0x0896('0x3a')][_0x0896('0x2c')](_0x5c0179[_0x0896('0x2d')],{'include':[{'model':db[_0x0896('0x3b')],'as':_0x0896('0x35')},{'model':db[_0x0896('0x3b')],'as':_0x0896('0x3c')}]});}return null;})[_0x0896('0x22')](respondWithResult(_0x21ba5c,null))[_0x0896('0x26')](handleError(_0x21ba5c,null));};function sanitizeRemoteUri(_0x2c571d){var _0x59b425=_0x2c571d[_0x0896('0x3d')](-0x1);if(_0x59b425==='/')return _0x2c571d[_0x0896('0x3e')](0x0,_0x2c571d[_0x0896('0x3f')](_0x59b425));return _0x2c571d;}function getWebApiUrl(_0x5e79fa){return util['format'](_0x0896('0x40'),_0x5e79fa);}exports[_0x0896('0x41')]=function(_0x3fe12b,_0x185771){var _0x3f9c46=_0x3fe12b[_0x0896('0x13')]['ticketType'];var _0x535d2d=_0x3f9c46===_0x0896('0x42')?_0x0896('0x43'):'PhoneCall';var _0x46cca4='';var _0x1c8e01='';var _0x852c2a='';var _0x14b04f='';var _0x5d3aae='';var _0x35f82a='';var _0xfc97f4='';var _0xdebc15='';var _0xeeb6c3=[_0x0896('0x44'),'description',_0x0896('0x45'),_0x0896('0x46'),_0x0896('0x47'),_0x0896('0x48'),_0x0896('0x49'),_0x0896('0x4a'),_0x0896('0x4b'),'phonecall_activity_parties'];var _0xff902c=[_0x0896('0x4c'),_0x0896('0x4d'),_0x0896('0x4e'),'billedserviceunits',_0x0896('0x4f'),_0x0896('0x50'),'contractdetailidname','contractidname',_0x0896('0x51'),_0x0896('0x52'),_0x0896('0x53'),'createdbyyominame','createdon',_0x0896('0x54'),_0x0896('0x55'),'customeridname',_0x0896('0x56'),_0x0896('0x57'),'emailaddress',_0x0896('0x58'),_0x0896('0x59'),_0x0896('0x5a'),_0x0896('0x5b'),_0x0896('0x5c'),_0x0896('0x5d'),_0x0896('0x5e'),_0x0896('0x5f'),_0x0896('0x60'),_0x0896('0x61'),_0x0896('0x62'),_0x0896('0x63'),_0x0896('0x64'),_0x0896('0x65'),'modifiedbyname',_0x0896('0x66'),_0x0896('0x67'),_0x0896('0x68'),'modifiedonbehalfbyyominame','msdyn_incidenttypename',_0x0896('0x69'),_0x0896('0x6a'),_0x0896('0x6b'),_0x0896('0x6c'),_0x0896('0x6d'),_0x0896('0x6e'),_0x0896('0x6f'),'parentcaseidname',_0x0896('0x70'),'primarycontactidyominame','prioritycodename',_0x0896('0x71'),_0x0896('0x72'),_0x0896('0x73'),'resolvebykpiidname','responseby',_0x0896('0x74'),'responsiblecontactidyominame','sentimentvalue',_0x0896('0x75'),_0x0896('0x76'),_0x0896('0x77'),'statecode',_0x0896('0x78'),_0x0896('0x79'),'ticketnumber',_0x0896('0x7a'),'transactioncurrencyidname',_0x0896('0x7b'),'utcconversiontimezonecode',_0x0896('0x7c')];var _0x4b193d=_0xeeb6c3['concat'](_0xff902c);return db[_0x0896('0x10')]['findOne']({'where':{'id':_0x3fe12b[_0x0896('0x28')]['id']},'attributes':['id',_0x0896('0x7d'),_0x0896('0x7e'),_0x0896('0x7f'),_0x0896('0x80'),'clientId',_0x0896('0x81'),_0x0896('0x82')],'include':[{'model':db[_0x0896('0x83')],'as':'CloudProvider','attributes':['id',_0x0896('0x84'),_0x0896('0x85')]}]})[_0x0896('0x22')](handleEntityNotFound(_0x185771,null))['then'](function(_0xd32c3b){if(_0xd32c3b){if(_0xd32c3b[_0x0896('0x82')]){_0xd32c3b['access_token']=_0xd32c3b[_0x0896('0x83')]['data5'];_0xdebc15=sanitizeRemoteUri(_0xd32c3b[_0x0896('0x83')][_0x0896('0x85')]);_0xfc97f4=getWebApiUrl(_0xdebc15);return _0xd32c3b;}_0xdebc15=sanitizeRemoteUri(_0xd32c3b[_0x0896('0x7f')]);_0xfc97f4=getWebApiUrl(_0xdebc15);var _0x4bc21f={'method':_0x0896('0x86'),'uri':_0x0896('0x87')+_0xd32c3b[_0x0896('0x80')]+_0x0896('0x88'),'form':{'client_id':_0xd32c3b[_0x0896('0x89')],'resource':_0xdebc15,'username':_0xd32c3b[_0x0896('0x7d')],'password':_0xd32c3b[_0x0896('0x7e')],'grant_type':_0x0896('0x7e'),'client_secret':_0xd32c3b[_0x0896('0x81')]},'json':!![]};return rp(_0x4bc21f);}})[_0x0896('0x22')](function(_0x39d37){_0x35f82a=_0x39d37[_0x0896('0x8a')];var _0x57bf7b={'method':_0x0896('0x8b'),'uri':encodeURI(_0xfc97f4+_0x0896('0x8c')+_0x535d2d+'\x27'),'headers':{'Authorization':_0x0896('0x8d')+_0x35f82a,'If-None-Match':null,'OData-Version':_0x0896('0x8e')},'json':!![]};return rp(_0x57bf7b);})[_0x0896('0x22')](function(_0x30f1c8){var _0x49cfbc=_0x30f1c8[_0x0896('0x8f')][0x0];var _0x3bd612=_0x49cfbc[_0x0896('0x90')];var _0xf07fd5={'method':_0x0896('0x8b'),'uri':_0xfc97f4+_0x0896('0x91')+_0x3bd612+_0x0896('0x92'),'headers':{'Authorization':_0x0896('0x8d')+_0x35f82a,'If-None-Match':null,'OData-Version':_0x0896('0x8e')},'json':!![]};return rp(_0xf07fd5);})[_0x0896('0x22')](function(_0x28160a){_0x46cca4=_0x28160a;_0x1c8e01=_0x46cca4[_0x0896('0x93')];_0x1c8e01=_[_0x0896('0x94')](_0x1c8e01,function(_0x3001ee){return!_0x4b193d[_0x0896('0x95')](_0x3001ee[_0x0896('0x96')]);});var _0x4390c6=[];var _0x370b45=[];_0x1c8e01[_0x0896('0x97')](function(_0x2ba7b5){if(_0x2ba7b5[_0x0896('0x98')]){var _0x4d3f8c=_0x2ba7b5['@odata.type'][_0x0896('0x3e')](_0x2ba7b5[_0x0896('0x98')][_0x0896('0x3f')]('.')+0x1);if(_0x4d3f8c===_0x0896('0x99')){_0x4390c6[_0x0896('0x9a')](getSelectList(_0xfc97f4,_0x3f9c46,_0x370b45,_0x46cca4['MetadataId'],_0x2ba7b5[_0x0896('0x90')],_0x35f82a));}}});return Promise[_0x0896('0x9b')](_0x4390c6);})[_0x0896('0x22')](function(_0x1b66d2){_0x852c2a=_0x1b66d2[0x0];var _0x510a0b=[];var _0x17fbb5=[];_0x1c8e01['forEach'](function(_0x241144){if(!_[_0x0896('0x9c')](_0x241144[_0x0896('0x98')])){var _0x207fbf=_0x241144[_0x0896('0x98')]['substring'](_0x241144['@odata.type'][_0x0896('0x3f')]('.')+0x1);if(_0x207fbf===_0x0896('0x9d')){_0x510a0b['push'](getBooleanList(_0xfc97f4,_0x3f9c46,_0x17fbb5,_0x46cca4[_0x0896('0x90')],_0x241144[_0x0896('0x90')],_0x35f82a));}}});return Promise['all'](_0x510a0b);})[_0x0896('0x22')](function(_0x18ebe7){_0x14b04f=_0x18ebe7[0x0];var _0xf3cfa9=[];var _0x118d52=[];_0x1c8e01[_0x0896('0x97')](function(_0x30081e){if(_0x30081e[_0x0896('0x98')]){var _0x7affa2=_0x30081e[_0x0896('0x98')]['substring'](_0x30081e[_0x0896('0x98')][_0x0896('0x3f')]('.')+0x1);if(_0x7affa2==='StringAttributeMetadata'||_0x7affa2===_0x0896('0x9e')||_0x7affa2===_0x0896('0x9f')||_0x7affa2===_0x0896('0xa0')||_0x7affa2==='MemoAttributeMetadata'||_0x7affa2==='DateTimeAttributeMetadata'||_0x7affa2===_0x0896('0xa1')||_0x7affa2===_0x0896('0xa2')||_0x7affa2===_0x0896('0xa3')||_0x7affa2===_0x0896('0xa4')){_0xf3cfa9[_0x0896('0x9a')](getInputList(_0xfc97f4,_0x3f9c46,_0x7affa2,_0x118d52,_0x46cca4[_0x0896('0x90')],_0x30081e[_0x0896('0x90')],_0x35f82a));}}});return Promise[_0x0896('0x9b')](_0xf3cfa9);})[_0x0896('0x22')](function(_0x4f2da8){_0x5d3aae=_0x4f2da8[0x0];var _0x1bba50=_0x852c2a[_0x0896('0xa5')](_0x14b04f)[_0x0896('0xa5')](_0x5d3aae);var _0x37aa7f={'count':_0x1bba50['length'],'rows':_0x1bba50};return _0x37aa7f;})['then'](respondWithResult(_0x185771,null))['catch'](function(_0x4eb8ec){var _0x586865=_0x3fe12b['query'][_0x0896('0xa6')]?0x1f4:_0x4eb8ec[_0x0896('0xa7')]||0x1f4;logger[_0x0896('0xa8')](_0x4eb8ec[_0x0896('0xa9')]);delete _0x4eb8ec[_0x0896('0xe')];if(_0x586865===0x191){_0x586865=0x190;}_0x185771[_0x0896('0xd')](_0x586865)[_0x0896('0xaa')](_0x3fe12b[_0x0896('0x13')][_0x0896('0xa6')]?{'message':_0x0896('0xab'),'statusCode':_0x4eb8ec['statusCode']}:_0x4eb8ec);});};function getSelectList(_0x4073f0,_0xa5d712,_0x55bef0,_0x137c2c,_0x295455,_0x5f0e6d){var _0x3710ae={'method':_0x0896('0x8b'),'uri':_0x4073f0+_0x0896('0x91')+_0x137c2c+_0x0896('0xac')+_0x295455+_0x0896('0xad')+_0x0896('0xae'),'headers':{'Authorization':'Bearer\x20'+_0x5f0e6d,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3710ae)[_0x0896('0x22')](function(_0x3e804c){var _0x50a336=[];var _0x40aecd=_0x3e804c[_0x0896('0xaf')][_0x0896('0xb0')];_0x40aecd[_0x0896('0x97')](function(_0x392340){_0x50a336[_0x0896('0x9a')]({'name':_0x392340[_0x0896('0xb1')][_0x0896('0xb2')][_0x0896('0xb1')],'value':String(_0x392340[_0x0896('0xb3')])});});var _0xe83321={'id':_0xa5d712+'_'+_0x3e804c[_0x0896('0x96')],'name':_0x3e804c[_0x0896('0xb4')][_0x0896('0xb2')][_0x0896('0xb1')],'custom':![],'options':_0x50a336};_0x55bef0[_0x0896('0x9a')](_0xe83321);return _0x55bef0;});}function getBooleanList(_0x4cfa98,_0x5624bc,_0x4eb204,_0xf566a5,_0x9d88ae,_0x1f76f2){var _0x42b9ce={'method':_0x0896('0x8b'),'uri':_0x4cfa98+_0x0896('0x91')+_0xf566a5+')/Attributes('+_0x9d88ae+_0x0896('0xb5'),'headers':{'Authorization':'Bearer\x20'+_0x1f76f2,'If-None-Match':null,'OData-Version':_0x0896('0x8e')},'json':!![]};return rp(_0x42b9ce)['then'](function(_0x5dd59d){var _0x4b0b5e=[];_0x4b0b5e['push']({'name':_0x5dd59d[_0x0896('0xaf')][_0x0896('0xb6')]['Label']['UserLocalizedLabel'][_0x0896('0xb1')],'value':_0x0896('0xb7')},{'name':_0x5dd59d['OptionSet'][_0x0896('0xb8')][_0x0896('0xb1')][_0x0896('0xb2')][_0x0896('0xb1')],'value':_0x0896('0xb9')});var _0x119492={'id':_0x5624bc+'_'+_0x5dd59d[_0x0896('0x96')],'name':_0x5dd59d[_0x0896('0xb4')][_0x0896('0xb2')][_0x0896('0xb1')],'custom':![],'options':_0x4b0b5e};_0x4eb204[_0x0896('0x9a')](_0x119492);return _0x4eb204;});}function getInputList(_0x5a3f39,_0x134ebd,_0x4c2b0f,_0x5afca5,_0x2d7f09,_0x39a179,_0x55a2fa){var _0x501342={'method':_0x0896('0x8b'),'uri':_0x5a3f39+_0x0896('0x91')+_0x2d7f09+_0x0896('0xac')+_0x39a179+_0x0896('0xba')+_0x4c2b0f+_0x0896('0xbb'),'headers':{'Authorization':'Bearer\x20'+_0x55a2fa,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x501342)[_0x0896('0x22')](function(_0x3465e2){var _0x2d8d36={'id':_0x134ebd+'_'+_0x3465e2[_0x0896('0x96')],'name':_0x3465e2[_0x0896('0xb4')][_0x0896('0xb2')]?_0x3465e2['DisplayName'][_0x0896('0xb2')][_0x0896('0xb1')]:_0x3465e2[_0x0896('0x96')],'custom':![],'options':[]};_0x5afca5[_0x0896('0x9a')](_0x2d8d36);return _0x5afca5;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 5d782c2..0d000ba 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.model.js +++ b/server/api/intDynamics365Account/intDynamics365Account.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts'];(function(_0x4d1ee9,_0x394a78){var _0x9a5456=function(_0x224f3b){while(--_0x224f3b){_0x4d1ee9['push'](_0x4d1ee9['shift']());}};_0x9a5456(++_0x394a78);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));var integrations=require(_0x3071('0x8'));module[_0x3071('0x9')]=function(_0x41cf76,_0x1d3dd6){return _0x41cf76[_0x3071('0xa')](_0x3071('0xb'),attributes,{'tableName':_0x3071('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['define','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x2bf744,_0x53700c){var _0x5a6652=function(_0x55919f){while(--_0x55919f){_0x2bf744['push'](_0x2bf744['shift']());}};_0x5a6652(++_0x53700c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));var integrations=require(_0x0a9e('0x8'));module['exports']=function(_0x219af0,_0x441e3a){return _0x219af0[_0x0a9e('0x9')]('Dynamics365Account',attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index fd35469..9829805 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.rpc.js +++ b/server/api/intDynamics365Account/intDynamics365Account.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e2b=['../../config/environment','client','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','message','result','catch','Dynamics365Account','findAll','options','raw','attributes','limit','include','map','model','GetDynamics365Account','stringify','ShowDynamics365Account','find','where','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0x353cd6,_0xc795f6){var _0x55712a=function(_0x3b83e1){while(--_0x3b83e1){_0x353cd6['push'](_0x353cd6['shift']());}};_0x55712a(++_0xc795f6);}(_0x3e2b,0x179));var _0xb3e2=function(_0x3e39d7,_0x3c0dd9){_0x3e39d7=_0x3e39d7-0x0;var _0xcaf5a2=_0x3e2b[_0x3e39d7];return _0xcaf5a2;};'use strict';var _=require(_0xb3e2('0x0'));var util=require(_0xb3e2('0x1'));var moment=require(_0xb3e2('0x2'));var BPromise=require(_0xb3e2('0x3'));var rs=require(_0xb3e2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb3e2('0x5'))['db'];var utils=require(_0xb3e2('0x6'));var logger=require('../../config/logger')(_0xb3e2('0x7'));var config=require(_0xb3e2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb3e2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x28997e,_0x500217,_0x6e6edf){return new BPromise(function(_0x3eb503,_0x553dc3){return client[_0xb3e2('0xa')](_0x28997e,_0x6e6edf)[_0xb3e2('0xb')](function(_0x649c7d){logger[_0xb3e2('0xc')](_0xb3e2('0xd'),_0x500217,_0xb3e2('0xe'));logger[_0xb3e2('0xf')](_0xb3e2('0x10'),_0x500217,_0xb3e2('0xe'),JSON['stringify'](_0x649c7d));if(_0x649c7d['error']){if(_0x649c7d[_0xb3e2('0x11')]['code']===0x1f4){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x500217,_0x649c7d[_0xb3e2('0x11')]['message']);return _0x553dc3(_0x649c7d[_0xb3e2('0x11')][_0xb3e2('0x12')]);}logger[_0xb3e2('0x11')](_0xb3e2('0xd'),_0x500217,_0x649c7d['error'][_0xb3e2('0x12')]);return _0x3eb503(_0x649c7d[_0xb3e2('0x11')][_0xb3e2('0x12')]);}else{logger[_0xb3e2('0xc')](_0xb3e2('0xd'),_0x500217,_0xb3e2('0xe'));_0x3eb503(_0x649c7d[_0xb3e2('0x13')]['message']);}})[_0xb3e2('0x14')](function(_0x1a1f59){logger[_0xb3e2('0x11')](_0xb3e2('0xd'),_0x500217,_0x1a1f59);_0x553dc3(_0x1a1f59);});});}exports['GetDynamics365Account']=function(_0x1bc04b){var _0x166ae0=this;return new Promise(function(_0x1dbc35,_0x595a52){return db[_0xb3e2('0x15')][_0xb3e2('0x16')]({'raw':_0x1bc04b[_0xb3e2('0x17')]?_0x1bc04b['options'][_0xb3e2('0x18')]===undefined?!![]:![]:!![],'where':_0x1bc04b[_0xb3e2('0x17')]?_0x1bc04b['options']['where']||null:null,'attributes':_0x1bc04b[_0xb3e2('0x17')]?_0x1bc04b[_0xb3e2('0x17')][_0xb3e2('0x19')]||null:null,'limit':_0x1bc04b['options']?_0x1bc04b['options'][_0xb3e2('0x1a')]||null:null,'include':_0x1bc04b[_0xb3e2('0x17')]?_0x1bc04b['options'][_0xb3e2('0x1b')]?_[_0xb3e2('0x1c')](_0x1bc04b[_0xb3e2('0x17')][_0xb3e2('0x1b')],function(_0x175b31){return{'model':db[_0x175b31[_0xb3e2('0x1d')]],'as':_0x175b31['as'],'attributes':_0x175b31[_0xb3e2('0x19')],'include':_0x175b31[_0xb3e2('0x1b')]?_[_0xb3e2('0x1c')](_0x175b31[_0xb3e2('0x1b')],function(_0x96ce0d){return{'model':db[_0x96ce0d[_0xb3e2('0x1d')]],'as':_0x96ce0d['as'],'attributes':_0x96ce0d[_0xb3e2('0x19')],'include':_0x96ce0d[_0xb3e2('0x1b')]?_[_0xb3e2('0x1c')](_0x96ce0d[_0xb3e2('0x1b')],function(_0x1d8c2c){return{'model':db[_0x1d8c2c[_0xb3e2('0x1d')]],'as':_0x1d8c2c['as'],'attributes':_0x1d8c2c[_0xb3e2('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb3e2('0xb')](function(_0x3b6ff9){logger[_0xb3e2('0xc')](_0xb3e2('0x1e'),_0x1bc04b);logger[_0xb3e2('0xf')](_0xb3e2('0x1e'),_0x1bc04b,JSON[_0xb3e2('0x1f')](_0x3b6ff9));_0x1dbc35(_0x3b6ff9);})[_0xb3e2('0x14')](function(_0x3b4027){logger[_0xb3e2('0x11')](_0xb3e2('0x1e'),_0x3b4027['message'],_0x1bc04b);_0x595a52(_0x166ae0['error'](0x1f4,_0x3b4027[_0xb3e2('0x12')]));});});};exports[_0xb3e2('0x20')]=function(_0x19dbdc){var _0x3d6dd4=this;return new Promise(function(_0x50e835,_0x10c091){return db[_0xb3e2('0x15')][_0xb3e2('0x21')]({'raw':_0x19dbdc[_0xb3e2('0x17')]?_0x19dbdc['options'][_0xb3e2('0x18')]===undefined?!![]:![]:!![],'where':_0x19dbdc[_0xb3e2('0x17')]?_0x19dbdc[_0xb3e2('0x17')][_0xb3e2('0x22')]||null:null,'attributes':_0x19dbdc['options']?_0x19dbdc[_0xb3e2('0x17')]['attributes']||null:null,'include':_0x19dbdc['options']?_0x19dbdc[_0xb3e2('0x17')][_0xb3e2('0x1b')]?_['map'](_0x19dbdc[_0xb3e2('0x17')]['include'],function(_0x2add5f){return{'model':db[_0x2add5f['model']],'as':_0x2add5f['as'],'attributes':_0x2add5f['attributes'],'include':_0x2add5f[_0xb3e2('0x1b')]?_['map'](_0x2add5f[_0xb3e2('0x1b')],function(_0x2bc7e6){return{'model':db[_0x2bc7e6['model']],'as':_0x2bc7e6['as'],'attributes':_0x2bc7e6[_0xb3e2('0x19')],'include':_0x2bc7e6[_0xb3e2('0x1b')]?_[_0xb3e2('0x1c')](_0x2bc7e6[_0xb3e2('0x1b')],function(_0x28ee7b){return{'model':db[_0x28ee7b[_0xb3e2('0x1d')]],'as':_0x28ee7b['as'],'attributes':_0x28ee7b[_0xb3e2('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b90fc){logger[_0xb3e2('0xc')](_0xb3e2('0x20'),_0x19dbdc);logger[_0xb3e2('0xf')]('ShowDynamics365Account',_0x19dbdc,JSON[_0xb3e2('0x1f')](_0x4b90fc));_0x50e835(_0x4b90fc);})['catch'](function(_0x1a19f7){logger['error'](_0xb3e2('0x20'),_0x1a19f7[_0xb3e2('0x12')],_0x19dbdc);_0x10c091(_0x3d6dd4[_0xb3e2('0x11')](0x1f4,_0x1a19f7['message']));});});}; \ No newline at end of file +var _0x60a6=['info','result','catch','GetDynamics365Account','options','raw','where','attributes','limit','map','model','include','ShowDynamics365Account','Dynamics365Account','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x40b0b9,_0x59cd60){var _0x28e0e2=function(_0x2b75c6){while(--_0x2b75c6){_0x40b0b9['push'](_0x40b0b9['shift']());}};_0x28e0e2(++_0x59cd60);}(_0x60a6,0x1a6));var _0x660a=function(_0x26e97a,_0x1a26da){_0x26e97a=_0x26e97a-0x0;var _0x4eac89=_0x60a6[_0x26e97a];return _0x4eac89;};'use strict';var _=require('lodash');var util=require(_0x660a('0x0'));var moment=require(_0x660a('0x1'));var BPromise=require(_0x660a('0x2'));var rs=require(_0x660a('0x3'));var fs=require('fs');var Redis=require(_0x660a('0x4'));var db=require(_0x660a('0x5'))['db'];var utils=require(_0x660a('0x6'));var logger=require(_0x660a('0x7'))('rpc');var config=require(_0x660a('0x8'));var jayson=require(_0x660a('0x9'));var client=jayson[_0x660a('0xa')][_0x660a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x30e404,_0x81347d,_0x53dd8b){return new BPromise(function(_0x342e1f,_0x3a2ec0){return client['request'](_0x30e404,_0x53dd8b)[_0x660a('0xc')](function(_0x29d0cd){logger['info'](_0x660a('0xd'),_0x81347d,_0x660a('0xe'));logger[_0x660a('0xf')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x81347d,_0x660a('0xe'),JSON[_0x660a('0x10')](_0x29d0cd));if(_0x29d0cd['error']){if(_0x29d0cd[_0x660a('0x11')][_0x660a('0x12')]===0x1f4){logger[_0x660a('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0x81347d,_0x29d0cd['error'][_0x660a('0x13')]);return _0x3a2ec0(_0x29d0cd[_0x660a('0x11')]['message']);}logger[_0x660a('0x11')](_0x660a('0xd'),_0x81347d,_0x29d0cd['error'][_0x660a('0x13')]);return _0x342e1f(_0x29d0cd['error'][_0x660a('0x13')]);}else{logger[_0x660a('0x14')](_0x660a('0xd'),_0x81347d,'request\x20sent');_0x342e1f(_0x29d0cd[_0x660a('0x15')][_0x660a('0x13')]);}})[_0x660a('0x16')](function(_0x4ef9e7){logger[_0x660a('0x11')](_0x660a('0xd'),_0x81347d,_0x4ef9e7);_0x3a2ec0(_0x4ef9e7);});});}exports[_0x660a('0x17')]=function(_0x3d61ff){var _0x96725e=this;return new Promise(function(_0x3c2193,_0x5d6881){return db['Dynamics365Account']['findAll']({'raw':_0x3d61ff[_0x660a('0x18')]?_0x3d61ff[_0x660a('0x18')][_0x660a('0x19')]===undefined?!![]:![]:!![],'where':_0x3d61ff[_0x660a('0x18')]?_0x3d61ff[_0x660a('0x18')][_0x660a('0x1a')]||null:null,'attributes':_0x3d61ff[_0x660a('0x18')]?_0x3d61ff[_0x660a('0x18')][_0x660a('0x1b')]||null:null,'limit':_0x3d61ff[_0x660a('0x18')]?_0x3d61ff['options'][_0x660a('0x1c')]||null:null,'include':_0x3d61ff['options']?_0x3d61ff['options']['include']?_[_0x660a('0x1d')](_0x3d61ff['options']['include'],function(_0x4f178a){return{'model':db[_0x4f178a[_0x660a('0x1e')]],'as':_0x4f178a['as'],'attributes':_0x4f178a[_0x660a('0x1b')],'include':_0x4f178a[_0x660a('0x1f')]?_['map'](_0x4f178a[_0x660a('0x1f')],function(_0xff949d){return{'model':db[_0xff949d[_0x660a('0x1e')]],'as':_0xff949d['as'],'attributes':_0xff949d[_0x660a('0x1b')],'include':_0xff949d[_0x660a('0x1f')]?_[_0x660a('0x1d')](_0xff949d[_0x660a('0x1f')],function(_0xb39d44){return{'model':db[_0xb39d44[_0x660a('0x1e')]],'as':_0xb39d44['as'],'attributes':_0xb39d44['attributes']};}):[]};}):[]};}):[]:[]})[_0x660a('0xc')](function(_0xac14d3){logger[_0x660a('0x14')]('GetDynamics365Account',_0x3d61ff);logger[_0x660a('0xf')](_0x660a('0x17'),_0x3d61ff,JSON[_0x660a('0x10')](_0xac14d3));_0x3c2193(_0xac14d3);})['catch'](function(_0x23d0e1){logger['error'](_0x660a('0x17'),_0x23d0e1[_0x660a('0x13')],_0x3d61ff);_0x5d6881(_0x96725e[_0x660a('0x11')](0x1f4,_0x23d0e1[_0x660a('0x13')]));});});};exports[_0x660a('0x20')]=function(_0x3d0caf){var _0x59c245=this;return new Promise(function(_0x31a877,_0x40d689){return db[_0x660a('0x21')]['find']({'raw':_0x3d0caf[_0x660a('0x18')]?_0x3d0caf[_0x660a('0x18')][_0x660a('0x19')]===undefined?!![]:![]:!![],'where':_0x3d0caf[_0x660a('0x18')]?_0x3d0caf[_0x660a('0x18')][_0x660a('0x1a')]||null:null,'attributes':_0x3d0caf['options']?_0x3d0caf[_0x660a('0x18')][_0x660a('0x1b')]||null:null,'include':_0x3d0caf['options']?_0x3d0caf[_0x660a('0x18')][_0x660a('0x1f')]?_['map'](_0x3d0caf[_0x660a('0x18')][_0x660a('0x1f')],function(_0x7ba749){return{'model':db[_0x7ba749[_0x660a('0x1e')]],'as':_0x7ba749['as'],'attributes':_0x7ba749['attributes'],'include':_0x7ba749[_0x660a('0x1f')]?_[_0x660a('0x1d')](_0x7ba749[_0x660a('0x1f')],function(_0x57682e){return{'model':db[_0x57682e[_0x660a('0x1e')]],'as':_0x57682e['as'],'attributes':_0x57682e[_0x660a('0x1b')],'include':_0x57682e['include']?_['map'](_0x57682e[_0x660a('0x1f')],function(_0x2a61e9){return{'model':db[_0x2a61e9['model']],'as':_0x2a61e9['as'],'attributes':_0x2a61e9[_0x660a('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x36cfb5){logger['info'](_0x660a('0x20'),_0x3d0caf);logger['debug'](_0x660a('0x20'),_0x3d0caf,JSON[_0x660a('0x10')](_0x36cfb5));_0x31a877(_0x36cfb5);})[_0x660a('0x16')](function(_0x24744b){logger['error'](_0x660a('0x20'),_0x24744b[_0x660a('0x13')],_0x3d0caf);_0x40d689(_0x59c245['error'](0x1f4,_0x24744b[_0x660a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 1270f59..65a1918 100644 --- a/server/api/intDynamics365Configuration/index.js +++ b/server/api/intDynamics365Configuration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x71f6=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','/:id','show','getFields','/:id/subjects','/:id/descriptions','getDescriptions','delete','destroy','util','connect-timeout','express','Router'];(function(_0x14f26f,_0x812a0d){var _0x5a572b=function(_0x412f42){while(--_0x412f42){_0x14f26f['push'](_0x14f26f['shift']());}};_0x5a572b(++_0x812a0d);}(_0x71f6,0x1ac));var _0x671f=function(_0x5b4dfb,_0x1b1bf8){_0x5b4dfb=_0x5b4dfb-0x0;var _0x379762=_0x71f6[_0x5b4dfb];return _0x379762;};'use strict';var multer=require('multer');var util=require(_0x671f('0x0'));var path=require('path');var timeout=require(_0x671f('0x1'));var express=require(_0x671f('0x2'));var router=express[_0x671f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x671f('0x4'));var interaction=require(_0x671f('0x5'));var config=require(_0x671f('0x6'));var controller=require(_0x671f('0x7'));router[_0x671f('0x8')]('/',auth[_0x671f('0x9')](),controller['index']);router[_0x671f('0x8')](_0x671f('0xa'),auth[_0x671f('0x9')](),controller[_0x671f('0xb')]);router[_0x671f('0x8')]('/:id/fields',auth[_0x671f('0x9')](),controller[_0x671f('0xc')]);router[_0x671f('0x8')](_0x671f('0xd'),auth[_0x671f('0x9')](),controller['getSubjects']);router['get'](_0x671f('0xe'),auth[_0x671f('0x9')](),controller[_0x671f('0xf')]);router['post']('/',auth[_0x671f('0x9')](),controller['create']);router['put'](_0x671f('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x671f('0x10')](_0x671f('0xa'),auth[_0x671f('0x9')](),controller[_0x671f('0x11')]);module['exports']=router; \ No newline at end of file +var _0x6582=['/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x6582,0x108));var _0x2658=function(_0x1a87cd,_0x2a244f){_0x1a87cd=_0x1a87cd-0x0;var _0x4af60e=_0x6582[_0x1a87cd];return _0x4af60e;};'use strict';var multer=require(_0x2658('0x0'));var util=require(_0x2658('0x1'));var path=require(_0x2658('0x2'));var timeout=require(_0x2658('0x3'));var express=require(_0x2658('0x4'));var router=express['Router']();var fs_extra=require(_0x2658('0x5'));var auth=require(_0x2658('0x6'));var interaction=require(_0x2658('0x7'));var config=require('../../config/environment');var controller=require('./intDynamics365Configuration.controller');router['get']('/',auth[_0x2658('0x8')](),controller[_0x2658('0x9')]);router[_0x2658('0xa')](_0x2658('0xb'),auth[_0x2658('0x8')](),controller[_0x2658('0xc')]);router['get'](_0x2658('0xd'),auth[_0x2658('0x8')](),controller[_0x2658('0xe')]);router[_0x2658('0xa')](_0x2658('0xf'),auth[_0x2658('0x8')](),controller[_0x2658('0x10')]);router[_0x2658('0xa')](_0x2658('0x11'),auth['isAuthenticated'](),controller[_0x2658('0x12')]);router['post']('/',auth[_0x2658('0x8')](),controller[_0x2658('0x13')]);router[_0x2658('0x14')](_0x2658('0xb'),auth[_0x2658('0x8')](),controller[_0x2658('0x15')]);router[_0x2658('0x16')]('/:id',auth[_0x2658('0x8')](),controller[_0x2658('0x17')]);module[_0x2658('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 4d6f104..17116d9 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x94e2=['BOOLEAN','STRING','ENUM','incident','phonecall','contact'];(function(_0x456570,_0x57bbec){var _0xebaf7e=function(_0xda6036){while(--_0xda6036){_0x456570['push'](_0x456570['shift']());}};_0xebaf7e(++_0x57bbec);}(_0x94e2,0x1b7));var _0x294e=function(_0x5aa023,_0x1cf1d2){_0x5aa023=_0x5aa023-0x0;var _0x31ceb5=_0x94e2[_0x5aa023];return _0x31ceb5;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x294e('0x0')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x294e('0x1')](_0x294e('0x2'),_0x294e('0x3')),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize['ENUM'](_0x294e('0x4'),'nothing'),'defaultValue':_0x294e('0x4'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x294e('0x0')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x294e('0x5')],'defaultValue':!![]}}; \ No newline at end of file +var _0x5068=['STRING','incident','phonecall','ENUM','contact','BOOLEAN','sequelize'];(function(_0x2f7c89,_0x52268d){var _0x22087f=function(_0x51e414){while(--_0x51e414){_0x2f7c89['push'](_0x2f7c89['shift']());}};_0x22087f(++_0x52268d);}(_0x5068,0x68));var _0x8506=function(_0x438501,_0x578ec8){_0x438501=_0x438501-0x0;var _0x1e5500=_0x5068[_0x438501];return _0x1e5500;};'use strict';var Sequelize=require(_0x8506('0x0'));module['exports']={'name':{'type':Sequelize[_0x8506('0x1')]},'description':{'type':Sequelize[_0x8506('0x1')]},'ticketType':{'type':Sequelize['ENUM'](_0x8506('0x2'),_0x8506('0x3')),'defaultValue':_0x8506('0x2')},'moduleCreate':{'type':Sequelize[_0x8506('0x4')]('contact','nothing'),'defaultValue':_0x8506('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x8506('0x1')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x8506('0x6')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 6b9c690..f10c951 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7f75=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','end','status','json','offset','undefined','count','limit','set','apply','reject','update','then','destroy','sendStatus','error','stack','name','index','map','Dynamics365Configuration','fieldName','type','key','keys','filters','intersection','query','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','create','body','find','catch','getFields','findOne','Dynamics365Field','rawAttributes','nolimit','getSubjects','getDescriptions','request-promise','moment'];(function(_0x4a5494,_0x3ad336){var _0x57cbb5=function(_0xa5a1ac){while(--_0xa5a1ac){_0x4a5494['push'](_0x4a5494['shift']());}};_0x57cbb5(++_0x3ad336);}(_0x7f75,0x1e4));var _0x57f7=function(_0x2e8d36,_0x5dadae){_0x2e8d36=_0x2e8d36-0x0;var _0x2dbd92=_0x7f75[_0x2e8d36];return _0x2dbd92;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x57f7('0x0'));var moment=require(_0x57f7('0x1'));var BPromise=require(_0x57f7('0x2'));var Mustache=require(_0x57f7('0x3'));var util=require(_0x57f7('0x4'));var path=require(_0x57f7('0x5'));var sox=require(_0x57f7('0x6'));var csv=require(_0x57f7('0x7'));var ejs=require(_0x57f7('0x8'));var fs=require('fs');var fs_extra=require(_0x57f7('0x9'));var _=require('lodash');var squel=require(_0x57f7('0xa'));var crypto=require(_0x57f7('0xb'));var jsforce=require(_0x57f7('0xc'));var deskjs=require(_0x57f7('0xd'));var toCsv=require(_0x57f7('0x7'));var querystring=require(_0x57f7('0xe'));var Papa=require(_0x57f7('0xf'));var Redis=require(_0x57f7('0x10'));var authService=require(_0x57f7('0x11'));var qs=require(_0x57f7('0x12'));var as=require(_0x57f7('0x13'));var hardwareService=require(_0x57f7('0x14'));var logger=require(_0x57f7('0x15'))(_0x57f7('0x16'));var utils=require(_0x57f7('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x57f7('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52e1e5,_0x462f52){_0x462f52=_0x462f52||0xcc;return function(_0xeb3dfd){if(_0xeb3dfd){return _0x52e1e5['sendStatus'](_0x462f52);}return _0x52e1e5['status'](_0x462f52)[_0x57f7('0x19')]();};}function respondWithResult(_0x225809,_0x5f5d5f){_0x5f5d5f=_0x5f5d5f||0xc8;return function(_0x25f70d){if(_0x25f70d){return _0x225809[_0x57f7('0x1a')](_0x5f5d5f)[_0x57f7('0x1b')](_0x25f70d);}};}function respondWithFilteredResult(_0xbf904e,_0xbe55c4){return function(_0x120a6c){if(_0x120a6c){var _0x3c994e=typeof _0xbe55c4[_0x57f7('0x1c')]===_0x57f7('0x1d')&&typeof _0xbe55c4['limit']===_0x57f7('0x1d');var _0x335d0c=_0x120a6c[_0x57f7('0x1e')];var _0x59d398=_0x3c994e?0x0:_0xbe55c4[_0x57f7('0x1c')];var _0x9d3006=_0x3c994e?_0x120a6c[_0x57f7('0x1e')]:_0xbe55c4['offset']+_0xbe55c4[_0x57f7('0x1f')];var _0x403417;if(_0x9d3006>=_0x335d0c){_0x9d3006=_0x335d0c;_0x403417=0xc8;}else{_0x403417=0xce;}_0xbf904e['status'](_0x403417);return _0xbf904e[_0x57f7('0x20')]('Content-Range',_0x59d398+'-'+_0x9d3006+'/'+_0x335d0c)[_0x57f7('0x1b')](_0x120a6c);}return null;};}function patchUpdates(_0x5ea147){return function(_0x14f8c0){try{jsonpatch[_0x57f7('0x21')](_0x14f8c0,_0x5ea147,!![]);}catch(_0x4155d5){return BPromise[_0x57f7('0x22')](_0x4155d5);}return _0x14f8c0['save']();};}function saveUpdates(_0xd7dbea,_0x42a4eb){return function(_0x5b5c96){if(_0x5b5c96){return _0x5b5c96[_0x57f7('0x23')](_0xd7dbea)[_0x57f7('0x24')](function(_0x535010){return _0x535010;});}return null;};}function removeEntity(_0xeb6027,_0x56447e){return function(_0x27441e){if(_0x27441e){return _0x27441e[_0x57f7('0x25')]()['then'](function(){_0xeb6027[_0x57f7('0x1a')](0xcc)[_0x57f7('0x19')]();});}};}function handleEntityNotFound(_0xd24eda,_0x2fc3bf){return function(_0x10e187){if(!_0x10e187){_0xd24eda[_0x57f7('0x26')](0x194);}return _0x10e187;};}function handleError(_0x3ac56c,_0x534487){_0x534487=_0x534487||0x1f4;return function(_0x377f62){logger[_0x57f7('0x27')](_0x377f62[_0x57f7('0x28')]);if(_0x377f62[_0x57f7('0x29')]){delete _0x377f62[_0x57f7('0x29')];}_0x3ac56c[_0x57f7('0x1a')](_0x534487)['send'](_0x377f62);};}exports[_0x57f7('0x2a')]=function(_0x140701,_0x4d016f){var _0x11180f={},_0x43d97b={},_0x24c5f1={'count':0x0,'rows':[]};var _0x4ff4e5=_[_0x57f7('0x2b')](db[_0x57f7('0x2c')]['rawAttributes'],function(_0x973603){return{'name':_0x973603[_0x57f7('0x2d')],'type':_0x973603[_0x57f7('0x2e')][_0x57f7('0x2f')]};});_0x43d97b['model']=_['map'](_0x4ff4e5,_0x57f7('0x29'));_0x43d97b['query']=_[_0x57f7('0x30')](_0x140701['query']);_0x43d97b[_0x57f7('0x31')]=_[_0x57f7('0x32')](_0x43d97b['model'],_0x43d97b[_0x57f7('0x33')]);_0x11180f[_0x57f7('0x34')]=_['intersection'](_0x43d97b[_0x57f7('0x35')],qs[_0x57f7('0x36')](_0x140701[_0x57f7('0x33')][_0x57f7('0x36')]));_0x11180f[_0x57f7('0x34')]=_0x11180f[_0x57f7('0x34')][_0x57f7('0x37')]?_0x11180f[_0x57f7('0x34')]:_0x43d97b['model'];if(!_0x140701[_0x57f7('0x33')][_0x57f7('0x38')]('nolimit')){_0x11180f[_0x57f7('0x1f')]=qs[_0x57f7('0x1f')](_0x140701['query'][_0x57f7('0x1f')]);_0x11180f[_0x57f7('0x1c')]=qs['offset'](_0x140701[_0x57f7('0x33')][_0x57f7('0x1c')]);}_0x11180f[_0x57f7('0x39')]=qs['sort'](_0x140701[_0x57f7('0x33')][_0x57f7('0x3a')]);_0x11180f[_0x57f7('0x3b')]=qs[_0x57f7('0x31')](_[_0x57f7('0x3c')](_0x140701[_0x57f7('0x33')],_0x43d97b['filters']),_0x4ff4e5);if(_0x140701[_0x57f7('0x33')][_0x57f7('0x3d')]){_0x11180f[_0x57f7('0x3b')]=_[_0x57f7('0x3e')](_0x11180f['where'],{'$or':_['map'](_0x4ff4e5,function(_0x534e9e){if(_0x534e9e[_0x57f7('0x2e')]!==_0x57f7('0x3f')){var _0x12eb34={};_0x12eb34[_0x534e9e['name']]={'$like':'%'+_0x140701[_0x57f7('0x33')][_0x57f7('0x3d')]+'%'};return _0x12eb34;}})});}_0x11180f=_[_0x57f7('0x3e')]({},_0x11180f,_0x140701[_0x57f7('0x40')]);var _0x40ca45={'where':_0x11180f[_0x57f7('0x3b')]};return db[_0x57f7('0x2c')][_0x57f7('0x1e')](_0x40ca45)[_0x57f7('0x24')](function(_0x352490){_0x24c5f1[_0x57f7('0x1e')]=_0x352490;if(_0x140701[_0x57f7('0x33')][_0x57f7('0x41')]){_0x11180f[_0x57f7('0x42')]=[{'all':!![]}];}return db[_0x57f7('0x2c')]['findAll'](_0x11180f);})[_0x57f7('0x24')](function(_0x4a52cc){_0x24c5f1[_0x57f7('0x43')]=_0x4a52cc;return _0x24c5f1;})[_0x57f7('0x24')](respondWithFilteredResult(_0x4d016f,_0x11180f))['catch'](handleError(_0x4d016f,null));};exports[_0x57f7('0x44')]=function(_0x683670,_0x4b4d5e){var _0x47801a={'raw':![],'where':{'id':_0x683670[_0x57f7('0x45')]['id']}},_0x51916c={};_0x51916c[_0x57f7('0x35')]=_[_0x57f7('0x30')](db['Dynamics365Configuration']['rawAttributes']);_0x51916c[_0x57f7('0x33')]=_[_0x57f7('0x30')](_0x683670[_0x57f7('0x33')]);_0x51916c[_0x57f7('0x31')]=_[_0x57f7('0x32')](_0x51916c[_0x57f7('0x35')],_0x51916c[_0x57f7('0x33')]);_0x47801a['attributes']=_[_0x57f7('0x32')](_0x51916c[_0x57f7('0x35')],qs[_0x57f7('0x36')](_0x683670[_0x57f7('0x33')][_0x57f7('0x36')]));_0x47801a['attributes']=_0x47801a[_0x57f7('0x34')][_0x57f7('0x37')]?_0x47801a[_0x57f7('0x34')]:_0x51916c['model'];if(_0x683670[_0x57f7('0x33')]['includeAll']){_0x47801a['include']=[{'all':!![]}];}_0x47801a=_[_0x57f7('0x3e')]({},_0x47801a,_0x683670[_0x57f7('0x40')]);return db[_0x57f7('0x2c')]['find'](_0x47801a)['then'](handleEntityNotFound(_0x4b4d5e,null))[_0x57f7('0x24')](respondWithResult(_0x4b4d5e,null))['catch'](handleError(_0x4b4d5e,null));};exports[_0x57f7('0x46')]=function(_0x592420,_0x3dbe05){return db[_0x57f7('0x2c')][_0x57f7('0x46')](_0x592420[_0x57f7('0x47')],{})[_0x57f7('0x24')](respondWithResult(_0x3dbe05,0xc9))['catch'](handleError(_0x3dbe05,null));};exports[_0x57f7('0x23')]=function(_0x9c9cd1,_0x4b7f9e){if(_0x9c9cd1[_0x57f7('0x47')]['id']){delete _0x9c9cd1[_0x57f7('0x47')]['id'];}return db[_0x57f7('0x2c')][_0x57f7('0x48')]({'where':{'id':_0x9c9cd1[_0x57f7('0x45')]['id']}})['then'](handleEntityNotFound(_0x4b7f9e,null))['then'](saveUpdates(_0x9c9cd1[_0x57f7('0x47')],null))['then'](respondWithResult(_0x4b7f9e,null))[_0x57f7('0x49')](handleError(_0x4b7f9e,null));};exports['destroy']=function(_0x27c754,_0x40a585){return db[_0x57f7('0x2c')][_0x57f7('0x48')]({'where':{'id':_0x27c754[_0x57f7('0x45')]['id']}})['then'](handleEntityNotFound(_0x40a585,null))[_0x57f7('0x24')](removeEntity(_0x40a585,null))[_0x57f7('0x49')](handleError(_0x40a585,null));};exports[_0x57f7('0x4a')]=function(_0x599a59,_0x5c28ef,_0x3bbe6e){var _0x229030={};var _0x1a0964={};var _0x1f547c;var _0x34b8cd;return db[_0x57f7('0x2c')][_0x57f7('0x4b')]({'where':{'id':_0x599a59['params']['id']}})[_0x57f7('0x24')](handleEntityNotFound(_0x5c28ef,null))['then'](function(_0x352976){if(_0x352976){_0x1f547c=_0x352976;_0x1a0964['model']=_[_0x57f7('0x30')](db[_0x57f7('0x4c')][_0x57f7('0x4d')]);_0x1a0964[_0x57f7('0x33')]=_[_0x57f7('0x30')](_0x599a59[_0x57f7('0x33')]);_0x1a0964['filters']=_['intersection'](_0x1a0964[_0x57f7('0x35')],_0x1a0964[_0x57f7('0x33')]);_0x229030[_0x57f7('0x34')]=_[_0x57f7('0x32')](_0x1a0964[_0x57f7('0x35')],qs[_0x57f7('0x36')](_0x599a59[_0x57f7('0x33')]['fields']));_0x229030[_0x57f7('0x34')]=_0x229030[_0x57f7('0x34')]['length']?_0x229030[_0x57f7('0x34')]:_0x1a0964[_0x57f7('0x35')];_0x229030[_0x57f7('0x39')]=qs[_0x57f7('0x3a')](_0x599a59[_0x57f7('0x33')][_0x57f7('0x3a')]);_0x229030['where']=qs[_0x57f7('0x31')](_[_0x57f7('0x3c')](_0x599a59[_0x57f7('0x33')],_0x1a0964['filters']));if(_0x599a59['query']['filter']){_0x229030['where']=_['merge'](_0x229030[_0x57f7('0x3b')],{'$or':_[_0x57f7('0x2b')](_0x229030[_0x57f7('0x34')],function(_0x13e63f){var _0x12a3f8={};_0x12a3f8[_0x13e63f]={'$like':'%'+_0x599a59['query'][_0x57f7('0x3d')]+'%'};return _0x12a3f8;})});}_0x229030=_[_0x57f7('0x3e')]({},_0x229030,_0x599a59[_0x57f7('0x40')]);return _0x1f547c[_0x57f7('0x4a')](_0x229030);}})[_0x57f7('0x24')](function(_0x3a4c27){if(_0x3a4c27){_0x34b8cd=_0x3a4c27[_0x57f7('0x37')];if(!_0x599a59['query']['hasOwnProperty'](_0x57f7('0x4e'))){_0x229030[_0x57f7('0x1f')]=qs[_0x57f7('0x1f')](_0x599a59[_0x57f7('0x33')][_0x57f7('0x1f')]);_0x229030[_0x57f7('0x1c')]=qs[_0x57f7('0x1c')](_0x599a59[_0x57f7('0x33')][_0x57f7('0x1c')]);}return _0x1f547c[_0x57f7('0x4a')](_0x229030);}})[_0x57f7('0x24')](function(_0x2cfdff){if(_0x2cfdff){return _0x2cfdff?{'count':_0x34b8cd,'rows':_0x2cfdff}:null;}})['then'](respondWithResult(_0x5c28ef,null))[_0x57f7('0x49')](handleError(_0x5c28ef,null));};exports[_0x57f7('0x4f')]=function(_0x557938,_0x1e2329,_0x19c7fb){var _0x4ffd5d={};var _0x1a904e={};var _0x2d6548;var _0x43bc50;return db[_0x57f7('0x2c')][_0x57f7('0x4b')]({'where':{'id':_0x557938[_0x57f7('0x45')]['id']}})['then'](handleEntityNotFound(_0x1e2329,null))[_0x57f7('0x24')](function(_0x306b74){if(_0x306b74){_0x2d6548=_0x306b74;_0x1a904e[_0x57f7('0x35')]=_[_0x57f7('0x30')](db[_0x57f7('0x4c')]['rawAttributes']);_0x1a904e[_0x57f7('0x33')]=_['keys'](_0x557938[_0x57f7('0x33')]);_0x1a904e[_0x57f7('0x31')]=_[_0x57f7('0x32')](_0x1a904e[_0x57f7('0x35')],_0x1a904e[_0x57f7('0x33')]);_0x4ffd5d['attributes']=_[_0x57f7('0x32')](_0x1a904e[_0x57f7('0x35')],qs[_0x57f7('0x36')](_0x557938['query'][_0x57f7('0x36')]));_0x4ffd5d['attributes']=_0x4ffd5d[_0x57f7('0x34')][_0x57f7('0x37')]?_0x4ffd5d[_0x57f7('0x34')]:_0x1a904e['model'];_0x4ffd5d[_0x57f7('0x39')]=qs[_0x57f7('0x3a')](_0x557938[_0x57f7('0x33')][_0x57f7('0x3a')]);_0x4ffd5d[_0x57f7('0x3b')]=qs[_0x57f7('0x31')](_['pick'](_0x557938[_0x57f7('0x33')],_0x1a904e[_0x57f7('0x31')]));if(_0x557938[_0x57f7('0x33')][_0x57f7('0x3d')]){_0x4ffd5d['where']=_[_0x57f7('0x3e')](_0x4ffd5d[_0x57f7('0x3b')],{'$or':_[_0x57f7('0x2b')](_0x4ffd5d[_0x57f7('0x34')],function(_0x5951b1){var _0x544133={};_0x544133[_0x5951b1]={'$like':'%'+_0x557938[_0x57f7('0x33')][_0x57f7('0x3d')]+'%'};return _0x544133;})});}_0x4ffd5d=_[_0x57f7('0x3e')]({},_0x4ffd5d,_0x557938['options']);return _0x2d6548[_0x57f7('0x4f')](_0x4ffd5d);}})[_0x57f7('0x24')](function(_0x5c392d){if(_0x5c392d){_0x43bc50=_0x5c392d[_0x57f7('0x37')];if(!_0x557938[_0x57f7('0x33')][_0x57f7('0x38')]('nolimit')){_0x4ffd5d['limit']=qs[_0x57f7('0x1f')](_0x557938[_0x57f7('0x33')][_0x57f7('0x1f')]);_0x4ffd5d[_0x57f7('0x1c')]=qs['offset'](_0x557938[_0x57f7('0x33')][_0x57f7('0x1c')]);}return _0x2d6548[_0x57f7('0x4f')](_0x4ffd5d);}})[_0x57f7('0x24')](function(_0x49a695){if(_0x49a695){return _0x49a695?{'count':_0x43bc50,'rows':_0x49a695}:null;}})[_0x57f7('0x24')](respondWithResult(_0x1e2329,null))['catch'](handleError(_0x1e2329,null));};exports[_0x57f7('0x50')]=function(_0x278a91,_0x128cff,_0x5596bd){var _0xc959bd={};var _0x19868b={};var _0x1d2e89;var _0x224cc;return db[_0x57f7('0x2c')][_0x57f7('0x4b')]({'where':{'id':_0x278a91[_0x57f7('0x45')]['id']}})[_0x57f7('0x24')](handleEntityNotFound(_0x128cff,null))['then'](function(_0x2842ef){if(_0x2842ef){_0x1d2e89=_0x2842ef;_0x19868b[_0x57f7('0x35')]=_[_0x57f7('0x30')](db[_0x57f7('0x4c')]['rawAttributes']);_0x19868b[_0x57f7('0x33')]=_['keys'](_0x278a91[_0x57f7('0x33')]);_0x19868b[_0x57f7('0x31')]=_['intersection'](_0x19868b[_0x57f7('0x35')],_0x19868b[_0x57f7('0x33')]);_0xc959bd[_0x57f7('0x34')]=_['intersection'](_0x19868b[_0x57f7('0x35')],qs[_0x57f7('0x36')](_0x278a91['query'][_0x57f7('0x36')]));_0xc959bd[_0x57f7('0x34')]=_0xc959bd['attributes'][_0x57f7('0x37')]?_0xc959bd[_0x57f7('0x34')]:_0x19868b['model'];_0xc959bd[_0x57f7('0x39')]=qs[_0x57f7('0x3a')](_0x278a91[_0x57f7('0x33')][_0x57f7('0x3a')]);_0xc959bd[_0x57f7('0x3b')]=qs['filters'](_['pick'](_0x278a91[_0x57f7('0x33')],_0x19868b['filters']));if(_0x278a91[_0x57f7('0x33')][_0x57f7('0x3d')]){_0xc959bd[_0x57f7('0x3b')]=_['merge'](_0xc959bd['where'],{'$or':_[_0x57f7('0x2b')](_0xc959bd[_0x57f7('0x34')],function(_0x2ff904){var _0x31cdff={};_0x31cdff[_0x2ff904]={'$like':'%'+_0x278a91[_0x57f7('0x33')][_0x57f7('0x3d')]+'%'};return _0x31cdff;})});}_0xc959bd=_[_0x57f7('0x3e')]({},_0xc959bd,_0x278a91['options']);return _0x1d2e89['getDescriptions'](_0xc959bd);}})[_0x57f7('0x24')](function(_0x1f46ef){if(_0x1f46ef){_0x224cc=_0x1f46ef[_0x57f7('0x37')];if(!_0x278a91[_0x57f7('0x33')][_0x57f7('0x38')](_0x57f7('0x4e'))){_0xc959bd[_0x57f7('0x1f')]=qs[_0x57f7('0x1f')](_0x278a91[_0x57f7('0x33')]['limit']);_0xc959bd[_0x57f7('0x1c')]=qs[_0x57f7('0x1c')](_0x278a91[_0x57f7('0x33')][_0x57f7('0x1c')]);}return _0x1d2e89[_0x57f7('0x50')](_0xc959bd);}})[_0x57f7('0x24')](function(_0x4e1c68){if(_0x4e1c68){return _0x4e1c68?{'count':_0x224cc,'rows':_0x4e1c68}:null;}})['then'](respondWithResult(_0x128cff,null))[_0x57f7('0x49')](handleError(_0x128cff,null));}; \ No newline at end of file +var _0x2151=['pick','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','destroy','end','error','stack','name','Dynamics365Configuration','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','filter','where','VIRTUAL','merge','options','then','includeAll','include','findAll','rows','catch','show','params','find','create','body','getFields','findOne','Dynamics365Field','order'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x2151,0xff));var _0x1215=function(_0x5d04c1,_0x351817){_0x5d04c1=_0x5d04c1-0x0;var _0x3b1771=_0x2151[_0x5d04c1];return _0x3b1771;};'use strict';var emlformat=require(_0x1215('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1215('0x1'));var jsonpatch=require(_0x1215('0x2'));var rp=require(_0x1215('0x3'));var moment=require(_0x1215('0x4'));var BPromise=require(_0x1215('0x5'));var Mustache=require(_0x1215('0x6'));var util=require(_0x1215('0x7'));var path=require(_0x1215('0x8'));var sox=require(_0x1215('0x9'));var csv=require('to-csv');var ejs=require(_0x1215('0xa'));var fs=require('fs');var fs_extra=require(_0x1215('0xb'));var _=require('lodash');var squel=require(_0x1215('0xc'));var crypto=require('crypto');var jsforce=require(_0x1215('0xd'));var deskjs=require(_0x1215('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1215('0xf'));var Papa=require(_0x1215('0x10'));var Redis=require(_0x1215('0x11'));var authService=require(_0x1215('0x12'));var qs=require(_0x1215('0x13'));var as=require(_0x1215('0x14'));var hardwareService=require(_0x1215('0x15'));var logger=require(_0x1215('0x16'))(_0x1215('0x17'));var utils=require('../../config/utils');var config=require(_0x1215('0x18'));var licenseUtil=require(_0x1215('0x19'));var db=require(_0x1215('0x1a'))['db'];function respondWithStatusCode(_0x327a0b,_0x1e7278){_0x1e7278=_0x1e7278||0xcc;return function(_0x5574a3){if(_0x5574a3){return _0x327a0b[_0x1215('0x1b')](_0x1e7278);}return _0x327a0b[_0x1215('0x1c')](_0x1e7278)['end']();};}function respondWithResult(_0x5892dd,_0x2d019b){_0x2d019b=_0x2d019b||0xc8;return function(_0x29d0d9){if(_0x29d0d9){return _0x5892dd[_0x1215('0x1c')](_0x2d019b)['json'](_0x29d0d9);}};}function respondWithFilteredResult(_0x27b12f,_0x408f7a){return function(_0xed2078){if(_0xed2078){var _0x49751b=typeof _0x408f7a[_0x1215('0x1d')]===_0x1215('0x1e')&&typeof _0x408f7a['limit']===_0x1215('0x1e');var _0x33fa82=_0xed2078[_0x1215('0x1f')];var _0x5545ce=_0x49751b?0x0:_0x408f7a['offset'];var _0x5c8b41=_0x49751b?_0xed2078[_0x1215('0x1f')]:_0x408f7a[_0x1215('0x1d')]+_0x408f7a[_0x1215('0x20')];var _0x38c9ec;if(_0x5c8b41>=_0x33fa82){_0x5c8b41=_0x33fa82;_0x38c9ec=0xc8;}else{_0x38c9ec=0xce;}_0x27b12f[_0x1215('0x1c')](_0x38c9ec);return _0x27b12f[_0x1215('0x21')](_0x1215('0x22'),_0x5545ce+'-'+_0x5c8b41+'/'+_0x33fa82)[_0x1215('0x23')](_0xed2078);}return null;};}function patchUpdates(_0x1b9786){return function(_0x511d10){try{jsonpatch['apply'](_0x511d10,_0x1b9786,!![]);}catch(_0x1fcf75){return BPromise[_0x1215('0x24')](_0x1fcf75);}return _0x511d10[_0x1215('0x25')]();};}function saveUpdates(_0x45d843,_0x205660){return function(_0x1d85e1){if(_0x1d85e1){return _0x1d85e1[_0x1215('0x26')](_0x45d843)['then'](function(_0x53f446){return _0x53f446;});}return null;};}function removeEntity(_0x1c68cb,_0x529e20){return function(_0x8839f8){if(_0x8839f8){return _0x8839f8[_0x1215('0x27')]()['then'](function(){_0x1c68cb['status'](0xcc)[_0x1215('0x28')]();});}};}function handleEntityNotFound(_0x432dca,_0x1857be){return function(_0x33d9de){if(!_0x33d9de){_0x432dca['sendStatus'](0x194);}return _0x33d9de;};}function handleError(_0x59e4ce,_0x116c25){_0x116c25=_0x116c25||0x1f4;return function(_0x260bdb){logger[_0x1215('0x29')](_0x260bdb[_0x1215('0x2a')]);if(_0x260bdb[_0x1215('0x2b')]){delete _0x260bdb[_0x1215('0x2b')];}_0x59e4ce[_0x1215('0x1c')](_0x116c25)['send'](_0x260bdb);};}exports['index']=function(_0x4ac174,_0x226d3d){var _0x38d9ea={},_0x48052a={},_0xc6366e={'count':0x0,'rows':[]};var _0x206417=_['map'](db[_0x1215('0x2c')][_0x1215('0x2d')],function(_0x10f261){return{'name':_0x10f261[_0x1215('0x2e')],'type':_0x10f261[_0x1215('0x2f')][_0x1215('0x30')]};});_0x48052a['model']=_[_0x1215('0x31')](_0x206417,_0x1215('0x2b'));_0x48052a[_0x1215('0x32')]=_[_0x1215('0x33')](_0x4ac174['query']);_0x48052a[_0x1215('0x34')]=_[_0x1215('0x35')](_0x48052a[_0x1215('0x36')],_0x48052a['query']);_0x38d9ea['attributes']=_['intersection'](_0x48052a[_0x1215('0x36')],qs[_0x1215('0x37')](_0x4ac174['query']['fields']));_0x38d9ea['attributes']=_0x38d9ea[_0x1215('0x38')][_0x1215('0x39')]?_0x38d9ea[_0x1215('0x38')]:_0x48052a[_0x1215('0x36')];if(!_0x4ac174[_0x1215('0x32')][_0x1215('0x3a')](_0x1215('0x3b'))){_0x38d9ea[_0x1215('0x20')]=qs[_0x1215('0x20')](_0x4ac174[_0x1215('0x32')]['limit']);_0x38d9ea[_0x1215('0x1d')]=qs['offset'](_0x4ac174[_0x1215('0x32')][_0x1215('0x1d')]);}_0x38d9ea['order']=qs[_0x1215('0x3c')](_0x4ac174[_0x1215('0x32')][_0x1215('0x3c')]);_0x38d9ea['where']=qs[_0x1215('0x34')](_['pick'](_0x4ac174[_0x1215('0x32')],_0x48052a[_0x1215('0x34')]),_0x206417);if(_0x4ac174[_0x1215('0x32')][_0x1215('0x3d')]){_0x38d9ea['where']=_['merge'](_0x38d9ea[_0x1215('0x3e')],{'$or':_['map'](_0x206417,function(_0x52197){if(_0x52197[_0x1215('0x2f')]!==_0x1215('0x3f')){var _0x2e4264={};_0x2e4264[_0x52197[_0x1215('0x2b')]]={'$like':'%'+_0x4ac174[_0x1215('0x32')][_0x1215('0x3d')]+'%'};return _0x2e4264;}})});}_0x38d9ea=_[_0x1215('0x40')]({},_0x38d9ea,_0x4ac174[_0x1215('0x41')]);var _0x126b91={'where':_0x38d9ea['where']};return db[_0x1215('0x2c')]['count'](_0x126b91)[_0x1215('0x42')](function(_0x3450f4){_0xc6366e['count']=_0x3450f4;if(_0x4ac174[_0x1215('0x32')][_0x1215('0x43')]){_0x38d9ea[_0x1215('0x44')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x1215('0x45')](_0x38d9ea);})[_0x1215('0x42')](function(_0x2c9da5){_0xc6366e[_0x1215('0x46')]=_0x2c9da5;return _0xc6366e;})[_0x1215('0x42')](respondWithFilteredResult(_0x226d3d,_0x38d9ea))[_0x1215('0x47')](handleError(_0x226d3d,null));};exports[_0x1215('0x48')]=function(_0x5c389e,_0x269bb2){var _0x1df904={'raw':![],'where':{'id':_0x5c389e[_0x1215('0x49')]['id']}},_0x3095fb={};_0x3095fb[_0x1215('0x36')]=_['keys'](db['Dynamics365Configuration'][_0x1215('0x2d')]);_0x3095fb[_0x1215('0x32')]=_[_0x1215('0x33')](_0x5c389e[_0x1215('0x32')]);_0x3095fb[_0x1215('0x34')]=_[_0x1215('0x35')](_0x3095fb[_0x1215('0x36')],_0x3095fb[_0x1215('0x32')]);_0x1df904[_0x1215('0x38')]=_['intersection'](_0x3095fb['model'],qs[_0x1215('0x37')](_0x5c389e[_0x1215('0x32')]['fields']));_0x1df904[_0x1215('0x38')]=_0x1df904[_0x1215('0x38')][_0x1215('0x39')]?_0x1df904[_0x1215('0x38')]:_0x3095fb['model'];if(_0x5c389e[_0x1215('0x32')][_0x1215('0x43')]){_0x1df904[_0x1215('0x44')]=[{'all':!![]}];}_0x1df904=_[_0x1215('0x40')]({},_0x1df904,_0x5c389e[_0x1215('0x41')]);return db[_0x1215('0x2c')][_0x1215('0x4a')](_0x1df904)['then'](handleEntityNotFound(_0x269bb2,null))[_0x1215('0x42')](respondWithResult(_0x269bb2,null))[_0x1215('0x47')](handleError(_0x269bb2,null));};exports[_0x1215('0x4b')]=function(_0x291362,_0x4b8841){return db[_0x1215('0x2c')]['create'](_0x291362[_0x1215('0x4c')],{})[_0x1215('0x42')](respondWithResult(_0x4b8841,0xc9))[_0x1215('0x47')](handleError(_0x4b8841,null));};exports[_0x1215('0x26')]=function(_0x3865d1,_0xf14ead){if(_0x3865d1[_0x1215('0x4c')]['id']){delete _0x3865d1['body']['id'];}return db['Dynamics365Configuration'][_0x1215('0x4a')]({'where':{'id':_0x3865d1['params']['id']}})[_0x1215('0x42')](handleEntityNotFound(_0xf14ead,null))[_0x1215('0x42')](saveUpdates(_0x3865d1[_0x1215('0x4c')],null))['then'](respondWithResult(_0xf14ead,null))[_0x1215('0x47')](handleError(_0xf14ead,null));};exports['destroy']=function(_0x4e8324,_0x132f0b){return db['Dynamics365Configuration'][_0x1215('0x4a')]({'where':{'id':_0x4e8324['params']['id']}})[_0x1215('0x42')](handleEntityNotFound(_0x132f0b,null))[_0x1215('0x42')](removeEntity(_0x132f0b,null))[_0x1215('0x47')](handleError(_0x132f0b,null));};exports[_0x1215('0x4d')]=function(_0x1dc892,_0x406c98,_0x3e69ff){var _0x1beadc={};var _0x6b1159={};var _0x3ce742;var _0x311812;return db[_0x1215('0x2c')][_0x1215('0x4e')]({'where':{'id':_0x1dc892[_0x1215('0x49')]['id']}})['then'](handleEntityNotFound(_0x406c98,null))[_0x1215('0x42')](function(_0x18fad1){if(_0x18fad1){_0x3ce742=_0x18fad1;_0x6b1159[_0x1215('0x36')]=_[_0x1215('0x33')](db[_0x1215('0x4f')]['rawAttributes']);_0x6b1159[_0x1215('0x32')]=_[_0x1215('0x33')](_0x1dc892[_0x1215('0x32')]);_0x6b1159[_0x1215('0x34')]=_[_0x1215('0x35')](_0x6b1159[_0x1215('0x36')],_0x6b1159['query']);_0x1beadc[_0x1215('0x38')]=_[_0x1215('0x35')](_0x6b1159[_0x1215('0x36')],qs['fields'](_0x1dc892[_0x1215('0x32')]['fields']));_0x1beadc[_0x1215('0x38')]=_0x1beadc['attributes']['length']?_0x1beadc[_0x1215('0x38')]:_0x6b1159[_0x1215('0x36')];_0x1beadc[_0x1215('0x50')]=qs[_0x1215('0x3c')](_0x1dc892['query'][_0x1215('0x3c')]);_0x1beadc[_0x1215('0x3e')]=qs[_0x1215('0x34')](_[_0x1215('0x51')](_0x1dc892['query'],_0x6b1159[_0x1215('0x34')]));if(_0x1dc892['query']['filter']){_0x1beadc[_0x1215('0x3e')]=_[_0x1215('0x40')](_0x1beadc[_0x1215('0x3e')],{'$or':_[_0x1215('0x31')](_0x1beadc[_0x1215('0x38')],function(_0x1d5c25){var _0x1bfe4c={};_0x1bfe4c[_0x1d5c25]={'$like':'%'+_0x1dc892[_0x1215('0x32')][_0x1215('0x3d')]+'%'};return _0x1bfe4c;})});}_0x1beadc=_['merge']({},_0x1beadc,_0x1dc892[_0x1215('0x41')]);return _0x3ce742[_0x1215('0x4d')](_0x1beadc);}})[_0x1215('0x42')](function(_0x14a6a6){if(_0x14a6a6){_0x311812=_0x14a6a6['length'];if(!_0x1dc892['query'][_0x1215('0x3a')](_0x1215('0x3b'))){_0x1beadc['limit']=qs['limit'](_0x1dc892[_0x1215('0x32')]['limit']);_0x1beadc[_0x1215('0x1d')]=qs[_0x1215('0x1d')](_0x1dc892[_0x1215('0x32')][_0x1215('0x1d')]);}return _0x3ce742['getFields'](_0x1beadc);}})[_0x1215('0x42')](function(_0x5d2276){if(_0x5d2276){return _0x5d2276?{'count':_0x311812,'rows':_0x5d2276}:null;}})[_0x1215('0x42')](respondWithResult(_0x406c98,null))['catch'](handleError(_0x406c98,null));};exports[_0x1215('0x52')]=function(_0x336504,_0x394763,_0xb4b74){var _0xba4d99={};var _0x400574={};var _0x57c05f;var _0x6d5105;return db[_0x1215('0x2c')][_0x1215('0x4e')]({'where':{'id':_0x336504[_0x1215('0x49')]['id']}})[_0x1215('0x42')](handleEntityNotFound(_0x394763,null))[_0x1215('0x42')](function(_0x176098){if(_0x176098){_0x57c05f=_0x176098;_0x400574[_0x1215('0x36')]=_[_0x1215('0x33')](db[_0x1215('0x4f')]['rawAttributes']);_0x400574[_0x1215('0x32')]=_[_0x1215('0x33')](_0x336504[_0x1215('0x32')]);_0x400574['filters']=_[_0x1215('0x35')](_0x400574[_0x1215('0x36')],_0x400574[_0x1215('0x32')]);_0xba4d99[_0x1215('0x38')]=_[_0x1215('0x35')](_0x400574[_0x1215('0x36')],qs[_0x1215('0x37')](_0x336504['query'][_0x1215('0x37')]));_0xba4d99[_0x1215('0x38')]=_0xba4d99[_0x1215('0x38')][_0x1215('0x39')]?_0xba4d99[_0x1215('0x38')]:_0x400574[_0x1215('0x36')];_0xba4d99[_0x1215('0x50')]=qs[_0x1215('0x3c')](_0x336504['query'][_0x1215('0x3c')]);_0xba4d99[_0x1215('0x3e')]=qs[_0x1215('0x34')](_['pick'](_0x336504[_0x1215('0x32')],_0x400574['filters']));if(_0x336504[_0x1215('0x32')]['filter']){_0xba4d99[_0x1215('0x3e')]=_['merge'](_0xba4d99['where'],{'$or':_['map'](_0xba4d99[_0x1215('0x38')],function(_0x411456){var _0x280a49={};_0x280a49[_0x411456]={'$like':'%'+_0x336504['query'][_0x1215('0x3d')]+'%'};return _0x280a49;})});}_0xba4d99=_[_0x1215('0x40')]({},_0xba4d99,_0x336504[_0x1215('0x41')]);return _0x57c05f[_0x1215('0x52')](_0xba4d99);}})[_0x1215('0x42')](function(_0xff120c){if(_0xff120c){_0x6d5105=_0xff120c[_0x1215('0x39')];if(!_0x336504[_0x1215('0x32')]['hasOwnProperty'](_0x1215('0x3b'))){_0xba4d99[_0x1215('0x20')]=qs[_0x1215('0x20')](_0x336504[_0x1215('0x32')][_0x1215('0x20')]);_0xba4d99['offset']=qs['offset'](_0x336504[_0x1215('0x32')][_0x1215('0x1d')]);}return _0x57c05f[_0x1215('0x52')](_0xba4d99);}})[_0x1215('0x42')](function(_0x17bbc4){if(_0x17bbc4){return _0x17bbc4?{'count':_0x6d5105,'rows':_0x17bbc4}:null;}})[_0x1215('0x42')](respondWithResult(_0x394763,null))[_0x1215('0x47')](handleError(_0x394763,null));};exports[_0x1215('0x53')]=function(_0x47db50,_0x3cccaa,_0x17efb3){var _0x42fde4={};var _0x2bec6c={};var _0x190896;var _0x95ec72;return db[_0x1215('0x2c')][_0x1215('0x4e')]({'where':{'id':_0x47db50['params']['id']}})[_0x1215('0x42')](handleEntityNotFound(_0x3cccaa,null))[_0x1215('0x42')](function(_0xc41fd7){if(_0xc41fd7){_0x190896=_0xc41fd7;_0x2bec6c[_0x1215('0x36')]=_[_0x1215('0x33')](db[_0x1215('0x4f')][_0x1215('0x2d')]);_0x2bec6c[_0x1215('0x32')]=_['keys'](_0x47db50['query']);_0x2bec6c[_0x1215('0x34')]=_['intersection'](_0x2bec6c[_0x1215('0x36')],_0x2bec6c[_0x1215('0x32')]);_0x42fde4['attributes']=_['intersection'](_0x2bec6c['model'],qs[_0x1215('0x37')](_0x47db50['query'][_0x1215('0x37')]));_0x42fde4['attributes']=_0x42fde4['attributes'][_0x1215('0x39')]?_0x42fde4['attributes']:_0x2bec6c['model'];_0x42fde4[_0x1215('0x50')]=qs[_0x1215('0x3c')](_0x47db50['query']['sort']);_0x42fde4[_0x1215('0x3e')]=qs[_0x1215('0x34')](_[_0x1215('0x51')](_0x47db50[_0x1215('0x32')],_0x2bec6c[_0x1215('0x34')]));if(_0x47db50[_0x1215('0x32')][_0x1215('0x3d')]){_0x42fde4[_0x1215('0x3e')]=_[_0x1215('0x40')](_0x42fde4[_0x1215('0x3e')],{'$or':_[_0x1215('0x31')](_0x42fde4[_0x1215('0x38')],function(_0x4bb994){var _0x130250={};_0x130250[_0x4bb994]={'$like':'%'+_0x47db50['query']['filter']+'%'};return _0x130250;})});}_0x42fde4=_['merge']({},_0x42fde4,_0x47db50['options']);return _0x190896['getDescriptions'](_0x42fde4);}})[_0x1215('0x42')](function(_0x55d99a){if(_0x55d99a){_0x95ec72=_0x55d99a['length'];if(!_0x47db50['query'][_0x1215('0x3a')]('nolimit')){_0x42fde4[_0x1215('0x20')]=qs[_0x1215('0x20')](_0x47db50['query']['limit']);_0x42fde4[_0x1215('0x1d')]=qs[_0x1215('0x1d')](_0x47db50[_0x1215('0x32')][_0x1215('0x1d')]);}return _0x190896[_0x1215('0x53')](_0x42fde4);}})[_0x1215('0x42')](function(_0x2df742){if(_0x2df742){return _0x2df742?{'count':_0x95ec72,'rows':_0x2df742}:null;}})[_0x1215('0x42')](respondWithResult(_0x3cccaa,null))['catch'](handleError(_0x3cccaa,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index edbe9f8..32da63f 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5b02=['define','Dynamics365Configuration','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports'];(function(_0x582204,_0x5816dd){var _0x45226c=function(_0x441066){while(--_0x441066){_0x582204['push'](_0x582204['shift']());}};_0x45226c(++_0x5816dd);}(_0x5b02,0xe9));var _0x25b0=function(_0x2f75ae,_0x52f0b6){_0x2f75ae=_0x2f75ae-0x0;var _0x48d85c=_0x5b02[_0x2f75ae];return _0x48d85c;};'use strict';var _=require(_0x25b0('0x0'));var util=require(_0x25b0('0x1'));var logger=require(_0x25b0('0x2'))(_0x25b0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x25b0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x25b0('0x5'));var config=require(_0x25b0('0x6'));var attributes=require(_0x25b0('0x7'));module[_0x25b0('0x8')]=function(_0x2d84a9,_0x4eea55){return _0x2d84a9[_0x25b0('0x9')](_0x25b0('0xa'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb821=['rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','util','../../config/logger','bluebird'];(function(_0x39d6c4,_0x2a1c60){var _0x437f74=function(_0x4c934e){while(--_0x4c934e){_0x39d6c4['push'](_0x39d6c4['shift']());}};_0x437f74(++_0x2a1c60);}(_0xb821,0xa7));var _0x1b82=function(_0xbe59a3,_0x32cbe2){_0xbe59a3=_0xbe59a3-0x0;var _0x196853=_0xb821[_0xbe59a3];return _0x196853;};'use strict';var _=require('lodash');var util=require(_0x1b82('0x0'));var logger=require(_0x1b82('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1b82('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1b82('0x3'));var config=require(_0x1b82('0x4'));var attributes=require(_0x1b82('0x5'));module[_0x1b82('0x6')]=function(_0x597ca7,_0x3e27c4){return _0x597ca7[_0x1b82('0x7')](_0x1b82('0x8'),attributes,{'tableName':_0x1b82('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index f2893cd..3d98de4 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaa95=['http','then','info','Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3715b3,_0x45af78){var _0x3d32c1=function(_0x1edaf6){while(--_0x1edaf6){_0x3715b3['push'](_0x3715b3['shift']());}};_0x3d32c1(++_0x45af78);}(_0xaa95,0x193));var _0x5aa9=function(_0x2d879e,_0x45cd61){_0x2d879e=_0x2d879e-0x0;var _0x11b621=_0xaa95[_0x2d879e];return _0x11b621;};'use strict';var _=require(_0x5aa9('0x0'));var util=require(_0x5aa9('0x1'));var moment=require(_0x5aa9('0x2'));var BPromise=require(_0x5aa9('0x3'));var rs=require(_0x5aa9('0x4'));var fs=require('fs');var Redis=require(_0x5aa9('0x5'));var db=require(_0x5aa9('0x6'))['db'];var utils=require(_0x5aa9('0x7'));var logger=require(_0x5aa9('0x8'))(_0x5aa9('0x9'));var config=require(_0x5aa9('0xa'));var jayson=require(_0x5aa9('0xb'));var client=jayson[_0x5aa9('0xc')][_0x5aa9('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3dcf69,_0x38a574,_0x2162d0){return new BPromise(function(_0x257389,_0x3f8cdf){return client['request'](_0x3dcf69,_0x2162d0)[_0x5aa9('0xe')](function(_0x1d80af){logger[_0x5aa9('0xf')](_0x5aa9('0x10'),_0x38a574,'request\x20sent');logger[_0x5aa9('0x11')](_0x5aa9('0x12'),_0x38a574,_0x5aa9('0x13'),JSON[_0x5aa9('0x14')](_0x1d80af));if(_0x1d80af[_0x5aa9('0x15')]){if(_0x1d80af[_0x5aa9('0x15')][_0x5aa9('0x16')]===0x1f4){logger[_0x5aa9('0x15')]('Dynamics365Configuration,\x20%s,\x20%s',_0x38a574,_0x1d80af[_0x5aa9('0x15')]['message']);return _0x3f8cdf(_0x1d80af[_0x5aa9('0x15')][_0x5aa9('0x17')]);}logger[_0x5aa9('0x15')](_0x5aa9('0x10'),_0x38a574,_0x1d80af[_0x5aa9('0x15')][_0x5aa9('0x17')]);return _0x257389(_0x1d80af[_0x5aa9('0x15')][_0x5aa9('0x17')]);}else{logger['info'](_0x5aa9('0x10'),_0x38a574,_0x5aa9('0x13'));_0x257389(_0x1d80af[_0x5aa9('0x18')][_0x5aa9('0x17')]);}})[_0x5aa9('0x19')](function(_0x200d08){logger[_0x5aa9('0x15')](_0x5aa9('0x10'),_0x38a574,_0x200d08);_0x3f8cdf(_0x200d08);});});} \ No newline at end of file +var _0x591a=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','util','bluebird','randomstring','ioredis'];(function(_0x4f5a97,_0x37dc4c){var _0x16b12f=function(_0x35da73){while(--_0x35da73){_0x4f5a97['push'](_0x4f5a97['shift']());}};_0x16b12f(++_0x37dc4c);}(_0x591a,0xc4));var _0xa591=function(_0x215e65,_0x183f97){_0x215e65=_0x215e65-0x0;var _0xa85842=_0x591a[_0x215e65];return _0xa85842;};'use strict';var _=require('lodash');var util=require(_0xa591('0x0'));var moment=require('moment');var BPromise=require(_0xa591('0x1'));var rs=require(_0xa591('0x2'));var fs=require('fs');var Redis=require(_0xa591('0x3'));var db=require(_0xa591('0x4'))['db'];var utils=require(_0xa591('0x5'));var logger=require(_0xa591('0x6'))(_0xa591('0x7'));var config=require(_0xa591('0x8'));var jayson=require(_0xa591('0x9'));var client=jayson[_0xa591('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x588c39,_0x7f3a94,_0x266fac){return new BPromise(function(_0x51be81,_0x2df5f9){return client['request'](_0x588c39,_0x266fac)['then'](function(_0x1e23c6){logger[_0xa591('0xb')](_0xa591('0xc'),_0x7f3a94,_0xa591('0xd'));logger['debug'](_0xa591('0xe'),_0x7f3a94,_0xa591('0xd'),JSON['stringify'](_0x1e23c6));if(_0x1e23c6['error']){if(_0x1e23c6['error'][_0xa591('0xf')]===0x1f4){logger[_0xa591('0x10')]('Dynamics365Configuration,\x20%s,\x20%s',_0x7f3a94,_0x1e23c6[_0xa591('0x10')]['message']);return _0x2df5f9(_0x1e23c6['error'][_0xa591('0x11')]);}logger['error'](_0xa591('0xc'),_0x7f3a94,_0x1e23c6['error'][_0xa591('0x11')]);return _0x51be81(_0x1e23c6[_0xa591('0x10')]['message']);}else{logger[_0xa591('0xb')](_0xa591('0xc'),_0x7f3a94,_0xa591('0xd'));_0x51be81(_0x1e23c6[_0xa591('0x12')][_0xa591('0x11')]);}})[_0xa591('0x13')](function(_0x539425){logger[_0xa591('0x10')]('Dynamics365Configuration,\x20%s,\x20%s',_0x7f3a94,_0x539425);_0x2df5f9(_0x539425);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 5d7ddbc..1866308 100644 --- a/server/api/intDynamics365Field/index.js +++ b/server/api/intDynamics365Field/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2219=['util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','post','update','delete','multer'];(function(_0x550af7,_0x3d29ef){var _0x32ab11=function(_0x46cd62){while(--_0x46cd62){_0x550af7['push'](_0x550af7['shift']());}};_0x32ab11(++_0x3d29ef);}(_0x2219,0x86));var _0x9221=function(_0x3e8270,_0x293590){_0x3e8270=_0x3e8270-0x0;var _0x1ccde9=_0x2219[_0x3e8270];return _0x1ccde9;};'use strict';var multer=require(_0x9221('0x0'));var util=require(_0x9221('0x1'));var path=require(_0x9221('0x2'));var timeout=require(_0x9221('0x3'));var express=require('express');var router=express[_0x9221('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9221('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9221('0x6'));var controller=require(_0x9221('0x7'));router[_0x9221('0x8')]('/',auth[_0x9221('0x9')](),controller[_0x9221('0xa')]);router[_0x9221('0x8')](_0x9221('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x9221('0xc')]('/',auth[_0x9221('0x9')](),controller['create']);router['put'](_0x9221('0xb'),auth[_0x9221('0x9')](),controller[_0x9221('0xd')]);router[_0x9221('0xe')]('/:id',auth[_0x9221('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5ea3=['fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','isAuthenticated','index','get','show','post','/:id','update','delete','multer','util','path','connect-timeout','express','Router'];(function(_0x49f76c,_0x3950ca){var _0x292d70=function(_0x3da20b){while(--_0x3da20b){_0x49f76c['push'](_0x49f76c['shift']());}};_0x292d70(++_0x3950ca);}(_0x5ea3,0x12c));var _0x35ea=function(_0x1c5fba,_0x2a3684){_0x1c5fba=_0x1c5fba-0x0;var _0x5dd082=_0x5ea3[_0x1c5fba];return _0x5dd082;};'use strict';var multer=require(_0x35ea('0x0'));var util=require(_0x35ea('0x1'));var path=require(_0x35ea('0x2'));var timeout=require(_0x35ea('0x3'));var express=require(_0x35ea('0x4'));var router=express[_0x35ea('0x5')]();var fs_extra=require(_0x35ea('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x35ea('0x7'));var config=require(_0x35ea('0x8'));var controller=require(_0x35ea('0x9'));router['get']('/',auth[_0x35ea('0xa')](),controller[_0x35ea('0xb')]);router[_0x35ea('0xc')]('/:id',auth[_0x35ea('0xa')](),controller[_0x35ea('0xd')]);router[_0x35ea('0xe')]('/',auth[_0x35ea('0xa')](),controller['create']);router['put'](_0x35ea('0xf'),auth[_0x35ea('0xa')](),controller[_0x35ea('0x10')]);router[_0x35ea('0x11')](_0x35ea('0xf'),auth[_0x35ea('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 0ca0b35..6f64a7a 100644 --- a/server/api/intDynamics365Field/intDynamics365Field.attributes.js +++ b/server/api/intDynamics365Field/intDynamics365Field.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe9c5=['picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x56fb33,_0x37be08){var _0x435ee4=function(_0xa80804){while(--_0xa80804){_0x56fb33['push'](_0x56fb33['shift']());}};_0x435ee4(++_0x37be08);}(_0xe9c5,0x189));var _0x5e9c=function(_0x1dae9b,_0x3df436){_0x1dae9b=_0x1dae9b-0x0;var _0x359503=_0xe9c5[_0x1dae9b];return _0x359503;};'use strict';var Sequelize=require(_0x5e9c('0x0'));module[_0x5e9c('0x1')]={'type':{'type':Sequelize[_0x5e9c('0x2')](_0x5e9c('0x3'),_0x5e9c('0x4'),_0x5e9c('0x5'),_0x5e9c('0x6'),_0x5e9c('0x7')),'defaultValue':_0x5e9c('0x3')},'content':{'type':Sequelize[_0x5e9c('0x8')]},'key':{'type':Sequelize[_0x5e9c('0x8')]},'keyType':{'type':Sequelize[_0x5e9c('0x2')](_0x5e9c('0x3'),_0x5e9c('0x4'),_0x5e9c('0x5'))},'keyContent':{'type':Sequelize[_0x5e9c('0x8')]},'idField':{'type':Sequelize[_0x5e9c('0x8')]},'nameField':{'type':Sequelize[_0x5e9c('0x8')]},'customField':{'type':Sequelize[_0x5e9c('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5e9c('0x8')]}}; \ No newline at end of file +var _0x8db3=['picklist','string','STRING','customVariable','sequelize','ENUM','keyValue'];(function(_0x16f2ad,_0x553185){var _0xfb0c73=function(_0x3dc3e6){while(--_0x3dc3e6){_0x16f2ad['push'](_0x16f2ad['shift']());}};_0xfb0c73(++_0x553185);}(_0x8db3,0x18c));var _0x38db=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8db3[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x38db('0x0'));module['exports']={'type':{'type':Sequelize[_0x38db('0x1')]('string','variable','customVariable',_0x38db('0x2'),_0x38db('0x3')),'defaultValue':_0x38db('0x4')},'content':{'type':Sequelize[_0x38db('0x5')]},'key':{'type':Sequelize[_0x38db('0x5')]},'keyType':{'type':Sequelize[_0x38db('0x1')](_0x38db('0x4'),'variable',_0x38db('0x6'))},'keyContent':{'type':Sequelize[_0x38db('0x5')]},'idField':{'type':Sequelize[_0x38db('0x5')]},'nameField':{'type':Sequelize[_0x38db('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x38db('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 7a83b95..7b522bf 100644 --- a/server/api/intDynamics365Field/intDynamics365Field.controller.js +++ b/server/api/intDynamics365Field/intDynamics365Field.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa334=['index','map','Dynamics365Field','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','attributes','length','nolimit','sort','where','pick','filter','merge','include','findAll','rows','show','params','intersection','includeAll','options','find','create','body','update','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','offset','limit','undefined','count','set','reject','then','destroy','sendStatus','error','stack','name','send'];(function(_0x2e7279,_0x28dd44){var _0x2e95a9=function(_0x596c05){while(--_0x596c05){_0x2e7279['push'](_0x2e7279['shift']());}};_0x2e95a9(++_0x28dd44);}(_0xa334,0x149));var _0x4a33=function(_0x380738,_0xae6ae8){_0x380738=_0x380738-0x0;var _0x1f9037=_0xa334[_0x380738];return _0x1f9037;};'use strict';var emlformat=require(_0x4a33('0x0'));var rimraf=require(_0x4a33('0x1'));var zipdir=require(_0x4a33('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4a33('0x3'));var moment=require(_0x4a33('0x4'));var BPromise=require(_0x4a33('0x5'));var Mustache=require(_0x4a33('0x6'));var util=require('util');var path=require(_0x4a33('0x7'));var sox=require(_0x4a33('0x8'));var csv=require('to-csv');var ejs=require(_0x4a33('0x9'));var fs=require('fs');var fs_extra=require(_0x4a33('0xa'));var _=require('lodash');var squel=require(_0x4a33('0xb'));var crypto=require(_0x4a33('0xc'));var jsforce=require(_0x4a33('0xd'));var deskjs=require(_0x4a33('0xe'));var toCsv=require(_0x4a33('0xf'));var querystring=require(_0x4a33('0x10'));var Papa=require(_0x4a33('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4a33('0x12'));var as=require(_0x4a33('0x13'));var hardwareService=require(_0x4a33('0x14'));var logger=require(_0x4a33('0x15'))(_0x4a33('0x16'));var utils=require('../../config/utils');var config=require(_0x4a33('0x17'));var licenseUtil=require(_0x4a33('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e5c40,_0x4e290f){_0x4e290f=_0x4e290f||0xcc;return function(_0x422d00){if(_0x422d00){return _0x5e5c40['sendStatus'](_0x4e290f);}return _0x5e5c40[_0x4a33('0x19')](_0x4e290f)[_0x4a33('0x1a')]();};}function respondWithResult(_0x45f1c8,_0x32513d){_0x32513d=_0x32513d||0xc8;return function(_0x36cd3d){if(_0x36cd3d){return _0x45f1c8[_0x4a33('0x19')](_0x32513d)[_0x4a33('0x1b')](_0x36cd3d);}};}function respondWithFilteredResult(_0x4b4c6a,_0x32a9b4){return function(_0x452cc5){if(_0x452cc5){var _0x801cb8=typeof _0x32a9b4[_0x4a33('0x1c')]==='undefined'&&typeof _0x32a9b4[_0x4a33('0x1d')]===_0x4a33('0x1e');var _0x4e0062=_0x452cc5[_0x4a33('0x1f')];var _0x2397eb=_0x801cb8?0x0:_0x32a9b4[_0x4a33('0x1c')];var _0x369355=_0x801cb8?_0x452cc5[_0x4a33('0x1f')]:_0x32a9b4[_0x4a33('0x1c')]+_0x32a9b4['limit'];var _0x1f37bd;if(_0x369355>=_0x4e0062){_0x369355=_0x4e0062;_0x1f37bd=0xc8;}else{_0x1f37bd=0xce;}_0x4b4c6a['status'](_0x1f37bd);return _0x4b4c6a[_0x4a33('0x20')]('Content-Range',_0x2397eb+'-'+_0x369355+'/'+_0x4e0062)['json'](_0x452cc5);}return null;};}function patchUpdates(_0x1a39dd){return function(_0x2dae57){try{jsonpatch['apply'](_0x2dae57,_0x1a39dd,!![]);}catch(_0x59c399){return BPromise[_0x4a33('0x21')](_0x59c399);}return _0x2dae57['save']();};}function saveUpdates(_0x2fe3a4,_0x270c8a){return function(_0x443e65){if(_0x443e65){return _0x443e65['update'](_0x2fe3a4)[_0x4a33('0x22')](function(_0x2795d0){return _0x2795d0;});}return null;};}function removeEntity(_0x3ff65f,_0x3f23e0){return function(_0x39432a){if(_0x39432a){return _0x39432a[_0x4a33('0x23')]()['then'](function(){_0x3ff65f['status'](0xcc)[_0x4a33('0x1a')]();});}};}function handleEntityNotFound(_0x4a7564,_0x469a37){return function(_0x29f06c){if(!_0x29f06c){_0x4a7564[_0x4a33('0x24')](0x194);}return _0x29f06c;};}function handleError(_0x10f4ac,_0x4e6b58){_0x4e6b58=_0x4e6b58||0x1f4;return function(_0x46ad12){logger[_0x4a33('0x25')](_0x46ad12[_0x4a33('0x26')]);if(_0x46ad12['name']){delete _0x46ad12[_0x4a33('0x27')];}_0x10f4ac[_0x4a33('0x19')](_0x4e6b58)[_0x4a33('0x28')](_0x46ad12);};}exports[_0x4a33('0x29')]=function(_0x55a519,_0x5c946b){var _0x5aca3e={},_0x436e21={},_0xef258c={'count':0x0,'rows':[]};var _0x52cdaa=_[_0x4a33('0x2a')](db[_0x4a33('0x2b')][_0x4a33('0x2c')],function(_0x470df2){return{'name':_0x470df2[_0x4a33('0x2d')],'type':_0x470df2[_0x4a33('0x2e')][_0x4a33('0x2f')]};});_0x436e21[_0x4a33('0x30')]=_['map'](_0x52cdaa,_0x4a33('0x27'));_0x436e21[_0x4a33('0x31')]=_[_0x4a33('0x32')](_0x55a519['query']);_0x436e21[_0x4a33('0x33')]=_['intersection'](_0x436e21[_0x4a33('0x30')],_0x436e21[_0x4a33('0x31')]);_0x5aca3e['attributes']=_['intersection'](_0x436e21[_0x4a33('0x30')],qs[_0x4a33('0x34')](_0x55a519['query']['fields']));_0x5aca3e[_0x4a33('0x35')]=_0x5aca3e[_0x4a33('0x35')][_0x4a33('0x36')]?_0x5aca3e[_0x4a33('0x35')]:_0x436e21[_0x4a33('0x30')];if(!_0x55a519[_0x4a33('0x31')]['hasOwnProperty'](_0x4a33('0x37'))){_0x5aca3e[_0x4a33('0x1d')]=qs[_0x4a33('0x1d')](_0x55a519[_0x4a33('0x31')][_0x4a33('0x1d')]);_0x5aca3e[_0x4a33('0x1c')]=qs['offset'](_0x55a519[_0x4a33('0x31')][_0x4a33('0x1c')]);}_0x5aca3e['order']=qs[_0x4a33('0x38')](_0x55a519['query'][_0x4a33('0x38')]);_0x5aca3e[_0x4a33('0x39')]=qs['filters'](_[_0x4a33('0x3a')](_0x55a519[_0x4a33('0x31')],_0x436e21[_0x4a33('0x33')]),_0x52cdaa);if(_0x55a519[_0x4a33('0x31')][_0x4a33('0x3b')]){_0x5aca3e[_0x4a33('0x39')]=_[_0x4a33('0x3c')](_0x5aca3e[_0x4a33('0x39')],{'$or':_[_0x4a33('0x2a')](_0x52cdaa,function(_0x1cc67f){if(_0x1cc67f[_0x4a33('0x2e')]!=='VIRTUAL'){var _0x333aef={};_0x333aef[_0x1cc67f[_0x4a33('0x27')]]={'$like':'%'+_0x55a519[_0x4a33('0x31')][_0x4a33('0x3b')]+'%'};return _0x333aef;}})});}_0x5aca3e=_['merge']({},_0x5aca3e,_0x55a519['options']);var _0x597127={'where':_0x5aca3e['where']};return db[_0x4a33('0x2b')][_0x4a33('0x1f')](_0x597127)[_0x4a33('0x22')](function(_0x876b03){_0xef258c[_0x4a33('0x1f')]=_0x876b03;if(_0x55a519[_0x4a33('0x31')]['includeAll']){_0x5aca3e[_0x4a33('0x3d')]=[{'all':!![]}];}return db[_0x4a33('0x2b')][_0x4a33('0x3e')](_0x5aca3e);})[_0x4a33('0x22')](function(_0x439e56){_0xef258c[_0x4a33('0x3f')]=_0x439e56;return _0xef258c;})[_0x4a33('0x22')](respondWithFilteredResult(_0x5c946b,_0x5aca3e))['catch'](handleError(_0x5c946b,null));};exports[_0x4a33('0x40')]=function(_0x5e97e5,_0x4ab72f){var _0x33716e={'raw':!![],'where':{'id':_0x5e97e5[_0x4a33('0x41')]['id']}},_0x6efb0a={};_0x6efb0a[_0x4a33('0x30')]=_[_0x4a33('0x32')](db['Dynamics365Field']['rawAttributes']);_0x6efb0a['query']=_[_0x4a33('0x32')](_0x5e97e5[_0x4a33('0x31')]);_0x6efb0a[_0x4a33('0x33')]=_['intersection'](_0x6efb0a['model'],_0x6efb0a[_0x4a33('0x31')]);_0x33716e[_0x4a33('0x35')]=_[_0x4a33('0x42')](_0x6efb0a[_0x4a33('0x30')],qs['fields'](_0x5e97e5['query'][_0x4a33('0x34')]));_0x33716e[_0x4a33('0x35')]=_0x33716e[_0x4a33('0x35')][_0x4a33('0x36')]?_0x33716e[_0x4a33('0x35')]:_0x6efb0a[_0x4a33('0x30')];if(_0x5e97e5[_0x4a33('0x31')][_0x4a33('0x43')]){_0x33716e[_0x4a33('0x3d')]=[{'all':!![]}];}_0x33716e=_[_0x4a33('0x3c')]({},_0x33716e,_0x5e97e5[_0x4a33('0x44')]);return db[_0x4a33('0x2b')][_0x4a33('0x45')](_0x33716e)[_0x4a33('0x22')](handleEntityNotFound(_0x4ab72f,null))['then'](respondWithResult(_0x4ab72f,null))['catch'](handleError(_0x4ab72f,null));};exports['create']=function(_0x1960db,_0xa945b1){return db[_0x4a33('0x2b')][_0x4a33('0x46')](_0x1960db[_0x4a33('0x47')],{})[_0x4a33('0x22')](respondWithResult(_0xa945b1,0xc9))['catch'](handleError(_0xa945b1,null));};exports[_0x4a33('0x48')]=function(_0x470058,_0x1e0ca2){if(_0x470058['body']['id']){delete _0x470058[_0x4a33('0x47')]['id'];}return db['Dynamics365Field'][_0x4a33('0x45')]({'where':{'id':_0x470058[_0x4a33('0x41')]['id']}})[_0x4a33('0x22')](handleEntityNotFound(_0x1e0ca2,null))[_0x4a33('0x22')](saveUpdates(_0x470058['body'],null))[_0x4a33('0x22')](respondWithResult(_0x1e0ca2,null))[_0x4a33('0x49')](handleError(_0x1e0ca2,null));};exports[_0x4a33('0x23')]=function(_0x359ffb,_0x58b889){return db[_0x4a33('0x2b')][_0x4a33('0x45')]({'where':{'id':_0x359ffb[_0x4a33('0x41')]['id']}})['then'](handleEntityNotFound(_0x58b889,null))['then'](removeEntity(_0x58b889,null))[_0x4a33('0x49')](handleError(_0x58b889,null));}; \ No newline at end of file +var _0x1a9e=['to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x1a9e,0x88));var _0xe1a9=function(_0x250b03,_0x1fb8fc){_0x250b03=_0x250b03-0x0;var _0xd76ec8=_0x1a9e[_0x250b03];return _0xd76ec8;};'use strict';var emlformat=require(_0xe1a9('0x0'));var rimraf=require(_0xe1a9('0x1'));var zipdir=require(_0xe1a9('0x2'));var jsonpatch=require(_0xe1a9('0x3'));var rp=require('request-promise');var moment=require(_0xe1a9('0x4'));var BPromise=require(_0xe1a9('0x5'));var Mustache=require(_0xe1a9('0x6'));var util=require(_0xe1a9('0x7'));var path=require('path');var sox=require(_0xe1a9('0x8'));var csv=require('to-csv');var ejs=require(_0xe1a9('0x9'));var fs=require('fs');var fs_extra=require(_0xe1a9('0xa'));var _=require(_0xe1a9('0xb'));var squel=require(_0xe1a9('0xc'));var crypto=require(_0xe1a9('0xd'));var jsforce=require(_0xe1a9('0xe'));var deskjs=require(_0xe1a9('0xf'));var toCsv=require(_0xe1a9('0x10'));var querystring=require('querystring');var Papa=require(_0xe1a9('0x11'));var Redis=require(_0xe1a9('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xe1a9('0x13'));var as=require(_0xe1a9('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe1a9('0x15'))(_0xe1a9('0x16'));var utils=require(_0xe1a9('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xe1a9('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ca9a9,_0xb15114){_0xb15114=_0xb15114||0xcc;return function(_0x5375d4){if(_0x5375d4){return _0x3ca9a9[_0xe1a9('0x19')](_0xb15114);}return _0x3ca9a9[_0xe1a9('0x1a')](_0xb15114)[_0xe1a9('0x1b')]();};}function respondWithResult(_0x3d4af6,_0x46ab3f){_0x46ab3f=_0x46ab3f||0xc8;return function(_0x40cf35){if(_0x40cf35){return _0x3d4af6['status'](_0x46ab3f)['json'](_0x40cf35);}};}function respondWithFilteredResult(_0x56bd78,_0x587704){return function(_0x211e44){if(_0x211e44){var _0x9b6d3=typeof _0x587704['offset']===_0xe1a9('0x1c')&&typeof _0x587704[_0xe1a9('0x1d')]===_0xe1a9('0x1c');var _0x94fdca=_0x211e44[_0xe1a9('0x1e')];var _0x566564=_0x9b6d3?0x0:_0x587704[_0xe1a9('0x1f')];var _0x52f0ec=_0x9b6d3?_0x211e44['count']:_0x587704[_0xe1a9('0x1f')]+_0x587704[_0xe1a9('0x1d')];var _0x369a57;if(_0x52f0ec>=_0x94fdca){_0x52f0ec=_0x94fdca;_0x369a57=0xc8;}else{_0x369a57=0xce;}_0x56bd78[_0xe1a9('0x1a')](_0x369a57);return _0x56bd78[_0xe1a9('0x20')](_0xe1a9('0x21'),_0x566564+'-'+_0x52f0ec+'/'+_0x94fdca)[_0xe1a9('0x22')](_0x211e44);}return null;};}function patchUpdates(_0x546789){return function(_0x8e5cd5){try{jsonpatch[_0xe1a9('0x23')](_0x8e5cd5,_0x546789,!![]);}catch(_0x48cd88){return BPromise[_0xe1a9('0x24')](_0x48cd88);}return _0x8e5cd5[_0xe1a9('0x25')]();};}function saveUpdates(_0x5573f8,_0x4fb91f){return function(_0x51d94b){if(_0x51d94b){return _0x51d94b[_0xe1a9('0x26')](_0x5573f8)[_0xe1a9('0x27')](function(_0x1110ca){return _0x1110ca;});}return null;};}function removeEntity(_0x44bea5,_0x33b1a3){return function(_0x3e0af6){if(_0x3e0af6){return _0x3e0af6[_0xe1a9('0x28')]()[_0xe1a9('0x27')](function(){_0x44bea5[_0xe1a9('0x1a')](0xcc)[_0xe1a9('0x1b')]();});}};}function handleEntityNotFound(_0x1214a8,_0x39c3b1){return function(_0x150f75){if(!_0x150f75){_0x1214a8[_0xe1a9('0x19')](0x194);}return _0x150f75;};}function handleError(_0x137fef,_0x2c7ff9){_0x2c7ff9=_0x2c7ff9||0x1f4;return function(_0x2b527d){logger[_0xe1a9('0x29')](_0x2b527d['stack']);if(_0x2b527d[_0xe1a9('0x2a')]){delete _0x2b527d['name'];}_0x137fef[_0xe1a9('0x1a')](_0x2c7ff9)[_0xe1a9('0x2b')](_0x2b527d);};}exports[_0xe1a9('0x2c')]=function(_0x52cd67,_0x52e30b){var _0xd5444a={},_0x1a7252={},_0x268f68={'count':0x0,'rows':[]};var _0x142dcc=_[_0xe1a9('0x2d')](db[_0xe1a9('0x2e')][_0xe1a9('0x2f')],function(_0x55f4e7){return{'name':_0x55f4e7[_0xe1a9('0x30')],'type':_0x55f4e7['type'][_0xe1a9('0x31')]};});_0x1a7252[_0xe1a9('0x32')]=_[_0xe1a9('0x2d')](_0x142dcc,'name');_0x1a7252[_0xe1a9('0x33')]=_[_0xe1a9('0x34')](_0x52cd67[_0xe1a9('0x33')]);_0x1a7252[_0xe1a9('0x35')]=_[_0xe1a9('0x36')](_0x1a7252[_0xe1a9('0x32')],_0x1a7252[_0xe1a9('0x33')]);_0xd5444a[_0xe1a9('0x37')]=_['intersection'](_0x1a7252['model'],qs[_0xe1a9('0x38')](_0x52cd67[_0xe1a9('0x33')]['fields']));_0xd5444a['attributes']=_0xd5444a[_0xe1a9('0x37')][_0xe1a9('0x39')]?_0xd5444a['attributes']:_0x1a7252[_0xe1a9('0x32')];if(!_0x52cd67[_0xe1a9('0x33')][_0xe1a9('0x3a')](_0xe1a9('0x3b'))){_0xd5444a['limit']=qs[_0xe1a9('0x1d')](_0x52cd67[_0xe1a9('0x33')][_0xe1a9('0x1d')]);_0xd5444a[_0xe1a9('0x1f')]=qs[_0xe1a9('0x1f')](_0x52cd67[_0xe1a9('0x33')][_0xe1a9('0x1f')]);}_0xd5444a[_0xe1a9('0x3c')]=qs['sort'](_0x52cd67[_0xe1a9('0x33')]['sort']);_0xd5444a[_0xe1a9('0x3d')]=qs[_0xe1a9('0x35')](_['pick'](_0x52cd67[_0xe1a9('0x33')],_0x1a7252['filters']),_0x142dcc);if(_0x52cd67[_0xe1a9('0x33')]['filter']){_0xd5444a['where']=_[_0xe1a9('0x3e')](_0xd5444a[_0xe1a9('0x3d')],{'$or':_[_0xe1a9('0x2d')](_0x142dcc,function(_0x16c25b){if(_0x16c25b['type']!==_0xe1a9('0x3f')){var _0x3c909a={};_0x3c909a[_0x16c25b[_0xe1a9('0x2a')]]={'$like':'%'+_0x52cd67['query'][_0xe1a9('0x40')]+'%'};return _0x3c909a;}})});}_0xd5444a=_[_0xe1a9('0x3e')]({},_0xd5444a,_0x52cd67[_0xe1a9('0x41')]);var _0x6fbdf9={'where':_0xd5444a['where']};return db['Dynamics365Field']['count'](_0x6fbdf9)[_0xe1a9('0x27')](function(_0x500580){_0x268f68[_0xe1a9('0x1e')]=_0x500580;if(_0x52cd67[_0xe1a9('0x33')][_0xe1a9('0x42')]){_0xd5444a[_0xe1a9('0x43')]=[{'all':!![]}];}return db[_0xe1a9('0x2e')][_0xe1a9('0x44')](_0xd5444a);})['then'](function(_0x58e45e){_0x268f68[_0xe1a9('0x45')]=_0x58e45e;return _0x268f68;})[_0xe1a9('0x27')](respondWithFilteredResult(_0x52e30b,_0xd5444a))['catch'](handleError(_0x52e30b,null));};exports[_0xe1a9('0x46')]=function(_0x1102b5,_0xdf5e46){var _0x1dd5a4={'raw':!![],'where':{'id':_0x1102b5[_0xe1a9('0x47')]['id']}},_0x4ce3d5={};_0x4ce3d5['model']=_[_0xe1a9('0x34')](db['Dynamics365Field'][_0xe1a9('0x2f')]);_0x4ce3d5[_0xe1a9('0x33')]=_[_0xe1a9('0x34')](_0x1102b5[_0xe1a9('0x33')]);_0x4ce3d5[_0xe1a9('0x35')]=_[_0xe1a9('0x36')](_0x4ce3d5[_0xe1a9('0x32')],_0x4ce3d5[_0xe1a9('0x33')]);_0x1dd5a4['attributes']=_[_0xe1a9('0x36')](_0x4ce3d5[_0xe1a9('0x32')],qs['fields'](_0x1102b5[_0xe1a9('0x33')][_0xe1a9('0x38')]));_0x1dd5a4[_0xe1a9('0x37')]=_0x1dd5a4['attributes'][_0xe1a9('0x39')]?_0x1dd5a4['attributes']:_0x4ce3d5[_0xe1a9('0x32')];if(_0x1102b5['query'][_0xe1a9('0x42')]){_0x1dd5a4['include']=[{'all':!![]}];}_0x1dd5a4=_['merge']({},_0x1dd5a4,_0x1102b5[_0xe1a9('0x41')]);return db['Dynamics365Field'][_0xe1a9('0x48')](_0x1dd5a4)[_0xe1a9('0x27')](handleEntityNotFound(_0xdf5e46,null))[_0xe1a9('0x27')](respondWithResult(_0xdf5e46,null))[_0xe1a9('0x49')](handleError(_0xdf5e46,null));};exports['create']=function(_0x38ab3e,_0x4f8d4a){return db[_0xe1a9('0x2e')][_0xe1a9('0x4a')](_0x38ab3e['body'],{})['then'](respondWithResult(_0x4f8d4a,0xc9))[_0xe1a9('0x49')](handleError(_0x4f8d4a,null));};exports[_0xe1a9('0x26')]=function(_0x3b5842,_0x319ca6){if(_0x3b5842['body']['id']){delete _0x3b5842[_0xe1a9('0x4b')]['id'];}return db[_0xe1a9('0x2e')][_0xe1a9('0x48')]({'where':{'id':_0x3b5842[_0xe1a9('0x47')]['id']}})[_0xe1a9('0x27')](handleEntityNotFound(_0x319ca6,null))[_0xe1a9('0x27')](saveUpdates(_0x3b5842[_0xe1a9('0x4b')],null))['then'](respondWithResult(_0x319ca6,null))[_0xe1a9('0x49')](handleError(_0x319ca6,null));};exports[_0xe1a9('0x28')]=function(_0x135c25,_0x27e3cb){return db[_0xe1a9('0x2e')]['find']({'where':{'id':_0x135c25[_0xe1a9('0x47')]['id']}})[_0xe1a9('0x27')](handleEntityNotFound(_0x27e3cb,null))[_0xe1a9('0x27')](removeEntity(_0x27e3cb,null))[_0xe1a9('0x49')](handleError(_0x27e3cb,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index bc78090..b269da2 100644 --- a/server/api/intDynamics365Field/intDynamics365Field.model.js +++ b/server/api/intDynamics365Field/intDynamics365Field.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0cc1=['int_dynamics365_fields','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field'];(function(_0x3f53df,_0x1f0fdd){var _0x1af68e=function(_0x78a25c){while(--_0x78a25c){_0x3f53df['push'](_0x3f53df['shift']());}};_0x1af68e(++_0x1f0fdd);}(_0x0cc1,0xd5));var _0x10cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0cc1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x10cc('0x0'));var util=require(_0x10cc('0x1'));var logger=require(_0x10cc('0x2'))(_0x10cc('0x3'));var moment=require('moment');var BPromise=require(_0x10cc('0x4'));var rp=require(_0x10cc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x10cc('0x6'));var config=require(_0x10cc('0x7'));var attributes=require(_0x10cc('0x8'));module[_0x10cc('0x9')]=function(_0x2f787c,_0x3ab55b){return _0x2f787c[_0x10cc('0xa')](_0x10cc('0xb'),attributes,{'tableName':_0x10cc('0xc'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x10cc('0xd'),_0x10cc('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd80e=['define','Dynamics365Field','dynamics365_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0xd80e,0x155));var _0xed80=function(_0x35898e,_0x3089d8){_0x35898e=_0x35898e-0x0;var _0x4c5aec=_0xd80e[_0x35898e];return _0x4c5aec;};'use strict';var _=require(_0xed80('0x0'));var util=require('util');var logger=require(_0xed80('0x1'))(_0xed80('0x2'));var moment=require(_0xed80('0x3'));var BPromise=require(_0xed80('0x4'));var rp=require(_0xed80('0x5'));var fs=require('fs');var path=require(_0xed80('0x6'));var rimraf=require(_0xed80('0x7'));var config=require(_0xed80('0x8'));var attributes=require(_0xed80('0x9'));module[_0xed80('0xa')]=function(_0x314cdf,_0x280edc){return _0x314cdf[_0xed80('0xb')](_0xed80('0xc'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0xed80('0xd'),'fields':[_0xed80('0xe'),_0xed80('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index 87adad7..84c960e 100644 --- a/server/api/intDynamics365Field/intDynamics365Field.rpc.js +++ b/server/api/intDynamics365Field/intDynamics365Field.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe29f=['http','request','then','Dynamics365Field,\x20%s,\x20%s','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x1c623b,_0x1adf0f){var _0x490bef=function(_0x528dca){while(--_0x528dca){_0x1c623b['push'](_0x1c623b['shift']());}};_0x490bef(++_0x1adf0f);}(_0xe29f,0x1e7));var _0xfe29=function(_0x6f8934,_0x48c88f){_0x6f8934=_0x6f8934-0x0;var _0x21af99=_0xe29f[_0x6f8934];return _0x21af99;};'use strict';var _=require(_0xfe29('0x0'));var util=require('util');var moment=require(_0xfe29('0x1'));var BPromise=require('bluebird');var rs=require(_0xfe29('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfe29('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xfe29('0x4'))(_0xfe29('0x5'));var config=require('../../config/environment');var jayson=require(_0xfe29('0x6'));var client=jayson['client'][_0xfe29('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4e944d,_0x2b0481,_0x399f65){return new BPromise(function(_0x4eca19,_0x27b0f0){return client[_0xfe29('0x8')](_0x4e944d,_0x399f65)[_0xfe29('0x9')](function(_0xee01ed){logger['info'](_0xfe29('0xa'),_0x2b0481,'request\x20sent');logger[_0xfe29('0xb')](_0xfe29('0xc'),_0x2b0481,_0xfe29('0xd'),JSON['stringify'](_0xee01ed));if(_0xee01ed['error']){if(_0xee01ed[_0xfe29('0xe')]['code']===0x1f4){logger[_0xfe29('0xe')](_0xfe29('0xa'),_0x2b0481,_0xee01ed[_0xfe29('0xe')][_0xfe29('0xf')]);return _0x27b0f0(_0xee01ed[_0xfe29('0xe')]['message']);}logger[_0xfe29('0xe')]('Dynamics365Field,\x20%s,\x20%s',_0x2b0481,_0xee01ed[_0xfe29('0xe')][_0xfe29('0xf')]);return _0x4eca19(_0xee01ed['error']['message']);}else{logger[_0xfe29('0x10')](_0xfe29('0xa'),_0x2b0481,_0xfe29('0xd'));_0x4eca19(_0xee01ed[_0xfe29('0x11')][_0xfe29('0xf')]);}})[_0xfe29('0x12')](function(_0xc13ac4){logger[_0xfe29('0xe')](_0xfe29('0xa'),_0x2b0481,_0xc13ac4);_0x27b0f0(_0xc13ac4);});});} \ No newline at end of file +var _0x5f74=['error','code','message','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','Dynamics365Field,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x1bd251,_0x338d85){var _0x29ef4c=function(_0x1072b2){while(--_0x1072b2){_0x1bd251['push'](_0x1bd251['shift']());}};_0x29ef4c(++_0x338d85);}(_0x5f74,0x147));var _0x45f7=function(_0x5ec08e,_0x5068fd){_0x5ec08e=_0x5ec08e-0x0;var _0x5a9142=_0x5f74[_0x5ec08e];return _0x5a9142;};'use strict';var _=require(_0x45f7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x45f7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x45f7('0x2'));var db=require(_0x45f7('0x3'))['db'];var utils=require(_0x45f7('0x4'));var logger=require('../../config/logger')(_0x45f7('0x5'));var config=require(_0x45f7('0x6'));var jayson=require(_0x45f7('0x7'));var client=jayson[_0x45f7('0x8')][_0x45f7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x143a48,_0x54a0d9,_0x6c4ca2){return new BPromise(function(_0x5472da,_0x414912){return client['request'](_0x143a48,_0x6c4ca2)[_0x45f7('0xa')](function(_0x2c7b3a){logger[_0x45f7('0xb')](_0x45f7('0xc'),_0x54a0d9,'request\x20sent');logger[_0x45f7('0xd')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x54a0d9,_0x45f7('0xe'),JSON['stringify'](_0x2c7b3a));if(_0x2c7b3a[_0x45f7('0xf')]){if(_0x2c7b3a[_0x45f7('0xf')][_0x45f7('0x10')]===0x1f4){logger[_0x45f7('0xf')](_0x45f7('0xc'),_0x54a0d9,_0x2c7b3a[_0x45f7('0xf')][_0x45f7('0x11')]);return _0x414912(_0x2c7b3a[_0x45f7('0xf')][_0x45f7('0x11')]);}logger[_0x45f7('0xf')](_0x45f7('0xc'),_0x54a0d9,_0x2c7b3a[_0x45f7('0xf')][_0x45f7('0x11')]);return _0x5472da(_0x2c7b3a[_0x45f7('0xf')][_0x45f7('0x11')]);}else{logger[_0x45f7('0xb')](_0x45f7('0xc'),_0x54a0d9,'request\x20sent');_0x5472da(_0x2c7b3a['result'][_0x45f7('0x11')]);}})[_0x45f7('0x12')](function(_0x5c12ad){logger[_0x45f7('0xf')](_0x45f7('0xc'),_0x54a0d9,_0x5c12ad);_0x414912(_0x5c12ad);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 95c21fc..6b17597 100644 --- a/server/api/intFreshdeskAccount/index.js +++ b/server/api/intFreshdeskAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6a6f=['delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','show','getFields','create','post','/:id/configurations','put','/:id','update'];(function(_0x11b5a6,_0x2fc369){var _0x1203c6=function(_0xd4e996){while(--_0xd4e996){_0x11b5a6['push'](_0x11b5a6['shift']());}};_0x1203c6(++_0x2fc369);}(_0x6a6f,0xdd));var _0xf6a6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6a6f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xf6a6('0x0'));var util=require(_0xf6a6('0x1'));var path=require(_0xf6a6('0x2'));var timeout=require(_0xf6a6('0x3'));var express=require(_0xf6a6('0x4'));var router=express[_0xf6a6('0x5')]();var fs_extra=require(_0xf6a6('0x6'));var auth=require(_0xf6a6('0x7'));var interaction=require(_0xf6a6('0x8'));var config=require(_0xf6a6('0x9'));var controller=require(_0xf6a6('0xa'));router[_0xf6a6('0xb')]('/',auth[_0xf6a6('0xc')](),controller['index']);router[_0xf6a6('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xf6a6('0xd')]);router['get']('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0xf6a6('0xb')]('/:id/fields',auth[_0xf6a6('0xc')](),controller[_0xf6a6('0xe')]);router['post']('/',auth[_0xf6a6('0xc')](),controller[_0xf6a6('0xf')]);router[_0xf6a6('0x10')](_0xf6a6('0x11'),auth[_0xf6a6('0xc')](),controller['addConfiguration']);router[_0xf6a6('0x12')](_0xf6a6('0x13'),auth[_0xf6a6('0xc')](),controller[_0xf6a6('0x14')]);router[_0xf6a6('0x15')](_0xf6a6('0x13'),auth[_0xf6a6('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xed3f=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xed3f,0x1b3));var _0xfed3=function(_0x3a9707,_0x3d19c8){_0x3a9707=_0x3a9707-0x0;var _0x2fb6aa=_0xed3f[_0x3a9707];return _0x2fb6aa;};'use strict';var multer=require(_0xfed3('0x0'));var util=require(_0xfed3('0x1'));var path=require('path');var timeout=require(_0xfed3('0x2'));var express=require(_0xfed3('0x3'));var router=express[_0xfed3('0x4')]();var fs_extra=require(_0xfed3('0x5'));var auth=require(_0xfed3('0x6'));var interaction=require(_0xfed3('0x7'));var config=require(_0xfed3('0x8'));var controller=require('./intFreshdeskAccount.controller');router[_0xfed3('0x9')]('/',auth['isAuthenticated'](),controller[_0xfed3('0xa')]);router[_0xfed3('0x9')](_0xfed3('0xb'),auth[_0xfed3('0xc')](),controller['show']);router[_0xfed3('0x9')](_0xfed3('0xd'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xfed3('0x9')](_0xfed3('0xe'),auth[_0xfed3('0xc')](),controller[_0xfed3('0xf')]);router[_0xfed3('0x10')]('/',auth[_0xfed3('0xc')](),controller[_0xfed3('0x11')]);router[_0xfed3('0x10')](_0xfed3('0xd'),auth[_0xfed3('0xc')](),controller[_0xfed3('0x12')]);router[_0xfed3('0x13')](_0xfed3('0xb'),auth[_0xfed3('0xc')](),controller['update']);router['delete'](_0xfed3('0xb'),auth['isAuthenticated'](),controller[_0xfed3('0x14')]);module[_0xfed3('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 52fd12b..ca3edf6 100644 --- a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js +++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd4a2=['STRING','username','sequelize'];(function(_0x433624,_0x4388e3){var _0x4af78f=function(_0x29af08){while(--_0x29af08){_0x433624['push'](_0x433624['shift']());}};_0x4af78f(++_0x4388e3);}(_0xd4a2,0x173));var _0x2d4a=function(_0x2cab5f,_0x43bc99){_0x2cab5f=_0x2cab5f-0x0;var _0x457037=_0xd4a2[_0x2cab5f];return _0x457037;};'use strict';var Sequelize=require(_0x2d4a('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2d4a('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x2d4a('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x2d4a('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x2d4a('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x781d=['sequelize','exports','STRING','username','remoteUri'];(function(_0x4b362b,_0xb811a){var _0x5cde92=function(_0x143f21){while(--_0x143f21){_0x4b362b['push'](_0x4b362b['shift']());}};_0x5cde92(++_0xb811a);}(_0x781d,0x14a));var _0xd781=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x781d[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0xd781('0x0'));module[_0xd781('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xd781('0x2')],'unique':_0xd781('0x3')},'apiKey':{'type':Sequelize[_0xd781('0x2')]},'remoteUri':{'type':Sequelize[_0xd781('0x2')],'unique':_0xd781('0x4')},'serverUrl':{'type':Sequelize[_0xd781('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 880b3ff..322e329 100644 --- a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js +++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2697=['where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','FreshdeskConfiguration','getConfigurations','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','type','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','%s/%s','api/v2/ticket_fields','format','toString','base64','description','priority','source','ticket_type','group','company','remove','includes','default','custom_text','custom_dropdown','map','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','save','update','then','error','stack','name','index','FreshdeskAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x2697,0x120));var _0x7269=function(_0x48326a,_0x8cfa0c){_0x48326a=_0x48326a-0x0;var _0x466709=_0x2697[_0x48326a];return _0x466709;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7269('0x0'));var zipdir=require(_0x7269('0x1'));var jsonpatch=require(_0x7269('0x2'));var rp=require(_0x7269('0x3'));var moment=require(_0x7269('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7269('0x5'));var util=require('util');var path=require(_0x7269('0x6'));var sox=require(_0x7269('0x7'));var csv=require(_0x7269('0x8'));var ejs=require(_0x7269('0x9'));var fs=require('fs');var fs_extra=require(_0x7269('0xa'));var _=require(_0x7269('0xb'));var squel=require(_0x7269('0xc'));var crypto=require(_0x7269('0xd'));var jsforce=require(_0x7269('0xe'));var deskjs=require(_0x7269('0xf'));var toCsv=require(_0x7269('0x8'));var querystring=require('querystring');var Papa=require(_0x7269('0x10'));var Redis=require(_0x7269('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7269('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7269('0x13'));var logger=require('../../config/logger')(_0x7269('0x14'));var utils=require('../../config/utils');var config=require(_0x7269('0x15'));var licenseUtil=require(_0x7269('0x16'));var db=require(_0x7269('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x29a0ca,_0x2c5957){_0x2c5957=_0x2c5957||0xcc;return function(_0x5dbe57){if(_0x5dbe57){return _0x29a0ca[_0x7269('0x18')](_0x2c5957);}return _0x29a0ca[_0x7269('0x19')](_0x2c5957)[_0x7269('0x1a')]();};}function respondWithResult(_0x4a0355,_0x2ba8ec){_0x2ba8ec=_0x2ba8ec||0xc8;return function(_0x4eeb9b){if(_0x4eeb9b){return _0x4a0355[_0x7269('0x19')](_0x2ba8ec)[_0x7269('0x1b')](_0x4eeb9b);}};}function respondWithFilteredResult(_0x26547f,_0x44e266){return function(_0x880b51){if(_0x880b51){var _0x2c0608=typeof _0x44e266['offset']===_0x7269('0x1c')&&typeof _0x44e266[_0x7269('0x1d')]===_0x7269('0x1c');var _0x1f7289=_0x880b51['count'];var _0x5589b7=_0x2c0608?0x0:_0x44e266['offset'];var _0x244e6e=_0x2c0608?_0x880b51[_0x7269('0x1e')]:_0x44e266[_0x7269('0x1f')]+_0x44e266[_0x7269('0x1d')];var _0x133ddc;if(_0x244e6e>=_0x1f7289){_0x244e6e=_0x1f7289;_0x133ddc=0xc8;}else{_0x133ddc=0xce;}_0x26547f[_0x7269('0x19')](_0x133ddc);return _0x26547f[_0x7269('0x20')]('Content-Range',_0x5589b7+'-'+_0x244e6e+'/'+_0x1f7289)['json'](_0x880b51);}return null;};}function patchUpdates(_0x534f81){return function(_0x367ad1){try{jsonpatch['apply'](_0x367ad1,_0x534f81,!![]);}catch(_0x2d3c66){return BPromise['reject'](_0x2d3c66);}return _0x367ad1[_0x7269('0x21')]();};}function saveUpdates(_0x8ce025,_0x55e40d){return function(_0x149c19){if(_0x149c19){return _0x149c19[_0x7269('0x22')](_0x8ce025)['then'](function(_0x509e9){return _0x509e9;});}return null;};}function removeEntity(_0x293af6,_0xbb82d0){return function(_0x383fde){if(_0x383fde){return _0x383fde['destroy']()[_0x7269('0x23')](function(){_0x293af6[_0x7269('0x19')](0xcc)[_0x7269('0x1a')]();});}};}function handleEntityNotFound(_0x2e6c02,_0x3392ec){return function(_0x3d72c9){if(!_0x3d72c9){_0x2e6c02['sendStatus'](0x194);}return _0x3d72c9;};}function handleError(_0x198b59,_0x3afb72){_0x3afb72=_0x3afb72||0x1f4;return function(_0x339414){logger[_0x7269('0x24')](_0x339414[_0x7269('0x25')]);if(_0x339414['name']){delete _0x339414[_0x7269('0x26')];}_0x198b59[_0x7269('0x19')](_0x3afb72)['send'](_0x339414);};}exports[_0x7269('0x27')]=function(_0x492e73,_0x124c07){var _0x3988c8={},_0xe3ee31={},_0x2be62e={'count':0x0,'rows':[]};var _0x468d0b=_['map'](db[_0x7269('0x28')][_0x7269('0x29')],function(_0xc6aea5){return{'name':_0xc6aea5[_0x7269('0x2a')],'type':_0xc6aea5['type'][_0x7269('0x2b')]};});_0xe3ee31[_0x7269('0x2c')]=_['map'](_0x468d0b,'name');_0xe3ee31[_0x7269('0x2d')]=_[_0x7269('0x2e')](_0x492e73[_0x7269('0x2d')]);_0xe3ee31[_0x7269('0x2f')]=_[_0x7269('0x30')](_0xe3ee31[_0x7269('0x2c')],_0xe3ee31['query']);_0x3988c8['attributes']=_[_0x7269('0x30')](_0xe3ee31[_0x7269('0x2c')],qs['fields'](_0x492e73[_0x7269('0x2d')]['fields']));_0x3988c8[_0x7269('0x31')]=_0x3988c8[_0x7269('0x31')][_0x7269('0x32')]?_0x3988c8[_0x7269('0x31')]:_0xe3ee31[_0x7269('0x2c')];if(!_0x492e73[_0x7269('0x2d')][_0x7269('0x33')]('nolimit')){_0x3988c8[_0x7269('0x1d')]=qs[_0x7269('0x1d')](_0x492e73['query'][_0x7269('0x1d')]);_0x3988c8[_0x7269('0x1f')]=qs[_0x7269('0x1f')](_0x492e73['query'][_0x7269('0x1f')]);}_0x3988c8[_0x7269('0x34')]=qs[_0x7269('0x35')](_0x492e73[_0x7269('0x2d')]['sort']);_0x3988c8[_0x7269('0x36')]=qs[_0x7269('0x2f')](_[_0x7269('0x37')](_0x492e73[_0x7269('0x2d')],_0xe3ee31[_0x7269('0x2f')]),_0x468d0b);if(_0x492e73['query'][_0x7269('0x38')]){_0x3988c8[_0x7269('0x36')]=_[_0x7269('0x39')](_0x3988c8['where'],{'$or':_['map'](_0x468d0b,function(_0x399efe){if(_0x399efe['type']!==_0x7269('0x3a')){var _0x492a1e={};_0x492a1e[_0x399efe[_0x7269('0x26')]]={'$like':'%'+_0x492e73[_0x7269('0x2d')]['filter']+'%'};return _0x492a1e;}})});}_0x3988c8=_['merge']({},_0x3988c8,_0x492e73[_0x7269('0x3b')]);var _0x2265ac={'where':_0x3988c8[_0x7269('0x36')]};return db[_0x7269('0x28')][_0x7269('0x1e')](_0x2265ac)[_0x7269('0x23')](function(_0x1fd570){_0x2be62e[_0x7269('0x1e')]=_0x1fd570;if(_0x492e73[_0x7269('0x2d')][_0x7269('0x3c')]){_0x3988c8[_0x7269('0x3d')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0x7269('0x3e')](_0x3988c8);})[_0x7269('0x23')](function(_0x2a2273){_0x2be62e[_0x7269('0x3f')]=_0x2a2273;return _0x2be62e;})[_0x7269('0x23')](respondWithFilteredResult(_0x124c07,_0x3988c8))[_0x7269('0x40')](handleError(_0x124c07,null));};exports[_0x7269('0x41')]=function(_0x2a67c3,_0x5ebeb7){var _0x5dc295={'raw':![],'where':{'id':_0x2a67c3[_0x7269('0x42')]['id']}},_0x2543cb={};_0x2543cb['model']=_['keys'](db['FreshdeskAccount'][_0x7269('0x29')]);_0x2543cb[_0x7269('0x2d')]=_['keys'](_0x2a67c3[_0x7269('0x2d')]);_0x2543cb[_0x7269('0x2f')]=_[_0x7269('0x30')](_0x2543cb[_0x7269('0x2c')],_0x2543cb[_0x7269('0x2d')]);_0x5dc295['attributes']=_['intersection'](_0x2543cb[_0x7269('0x2c')],qs[_0x7269('0x43')](_0x2a67c3[_0x7269('0x2d')][_0x7269('0x43')]));_0x5dc295[_0x7269('0x31')]=_0x5dc295['attributes'][_0x7269('0x32')]?_0x5dc295[_0x7269('0x31')]:_0x2543cb['model'];if(_0x2a67c3['query']['includeAll']){_0x5dc295[_0x7269('0x3d')]=[{'all':!![]}];}_0x5dc295=_[_0x7269('0x39')]({},_0x5dc295,_0x2a67c3[_0x7269('0x3b')]);return db['FreshdeskAccount'][_0x7269('0x44')](_0x5dc295)[_0x7269('0x23')](handleEntityNotFound(_0x5ebeb7,null))[_0x7269('0x23')](respondWithResult(_0x5ebeb7,null))[_0x7269('0x40')](handleError(_0x5ebeb7,null));};exports['create']=function(_0x1e35df,_0x55d198){return db[_0x7269('0x28')][_0x7269('0x45')](_0x1e35df[_0x7269('0x46')],{})[_0x7269('0x23')](respondWithResult(_0x55d198,0xc9))[_0x7269('0x40')](handleError(_0x55d198,null));};exports[_0x7269('0x22')]=function(_0x5f34d3,_0x23d91b){if(_0x5f34d3['body']['id']){delete _0x5f34d3[_0x7269('0x46')]['id'];}return db[_0x7269('0x28')][_0x7269('0x44')]({'where':{'id':_0x5f34d3[_0x7269('0x42')]['id']}})[_0x7269('0x23')](handleEntityNotFound(_0x23d91b,null))['then'](saveUpdates(_0x5f34d3['body'],null))[_0x7269('0x23')](respondWithResult(_0x23d91b,null))[_0x7269('0x40')](handleError(_0x23d91b,null));};exports['destroy']=function(_0x46aa1f,_0x27bedc){return db[_0x7269('0x28')]['find']({'where':{'id':_0x46aa1f[_0x7269('0x42')]['id']}})[_0x7269('0x23')](handleEntityNotFound(_0x27bedc,null))[_0x7269('0x23')](removeEntity(_0x27bedc,null))['catch'](handleError(_0x27bedc,null));};exports['getConfigurations']=function(_0x32d06d,_0x4a4add,_0x42afa2){var _0x5ecbec={};var _0x1ca09e={};var _0x37e699;var _0x1826d2;return db[_0x7269('0x28')]['findOne']({'where':{'id':_0x32d06d[_0x7269('0x42')]['id']}})['then'](handleEntityNotFound(_0x4a4add,null))[_0x7269('0x23')](function(_0x43fdc5){if(_0x43fdc5){_0x37e699=_0x43fdc5;_0x1ca09e[_0x7269('0x2c')]=_[_0x7269('0x2e')](db[_0x7269('0x47')][_0x7269('0x29')]);_0x1ca09e[_0x7269('0x2d')]=_[_0x7269('0x2e')](_0x32d06d[_0x7269('0x2d')]);_0x1ca09e[_0x7269('0x2f')]=_['intersection'](_0x1ca09e[_0x7269('0x2c')],_0x1ca09e[_0x7269('0x2d')]);_0x5ecbec[_0x7269('0x31')]=_[_0x7269('0x30')](_0x1ca09e[_0x7269('0x2c')],qs[_0x7269('0x43')](_0x32d06d[_0x7269('0x2d')][_0x7269('0x43')]));_0x5ecbec['attributes']=_0x5ecbec[_0x7269('0x31')]['length']?_0x5ecbec['attributes']:_0x1ca09e[_0x7269('0x2c')];_0x5ecbec[_0x7269('0x34')]=qs[_0x7269('0x35')](_0x32d06d[_0x7269('0x2d')][_0x7269('0x35')]);_0x5ecbec['where']=qs[_0x7269('0x2f')](_[_0x7269('0x37')](_0x32d06d[_0x7269('0x2d')],_0x1ca09e['filters']));if(_0x32d06d[_0x7269('0x2d')][_0x7269('0x38')]){_0x5ecbec[_0x7269('0x36')]=_[_0x7269('0x39')](_0x5ecbec[_0x7269('0x36')],{'$or':_['map'](_0x5ecbec[_0x7269('0x31')],function(_0x2ae935){var _0x234eca={};_0x234eca[_0x2ae935]={'$like':'%'+_0x32d06d['query'][_0x7269('0x38')]+'%'};return _0x234eca;})});}_0x5ecbec=_[_0x7269('0x39')]({},_0x5ecbec,_0x32d06d[_0x7269('0x3b')]);return _0x37e699[_0x7269('0x48')](_0x5ecbec);}})[_0x7269('0x23')](function(_0x193da5){if(_0x193da5){_0x1826d2=_0x193da5[_0x7269('0x32')];if(!_0x32d06d[_0x7269('0x2d')][_0x7269('0x33')](_0x7269('0x49'))){_0x5ecbec[_0x7269('0x1d')]=qs[_0x7269('0x1d')](_0x32d06d[_0x7269('0x2d')][_0x7269('0x1d')]);_0x5ecbec[_0x7269('0x1f')]=qs[_0x7269('0x1f')](_0x32d06d[_0x7269('0x2d')][_0x7269('0x1f')]);}return _0x37e699['getConfigurations'](_0x5ecbec);}})[_0x7269('0x23')](function(_0x3f8ab1){if(_0x3f8ab1){return _0x3f8ab1?{'count':_0x1826d2,'rows':_0x3f8ab1}:null;}})[_0x7269('0x23')](respondWithResult(_0x4a4add,null))[_0x7269('0x40')](handleError(_0x4a4add,null));};exports[_0x7269('0x4a')]=function(_0x262989,_0x4505f6,_0x55ff74){if(_0x262989[_0x7269('0x46')]['id']){delete _0x262989[_0x7269('0x46')]['id'];}return db['FreshdeskAccount'][_0x7269('0x4b')]({'where':{'id':_0x262989['params']['id']}})[_0x7269('0x23')](handleEntityNotFound(_0x4505f6,null))[_0x7269('0x23')](function(_0x435142){if(_0x435142){_0x262989[_0x7269('0x46')][_0x7269('0x4c')]=_0x435142['id'];_0x262989[_0x7269('0x46')][_0x7269('0x4d')]=integrations[_0x7269('0x4e')](_0x262989[_0x7269('0x46')]['channel'],_0x262989[_0x7269('0x46')]['type']);_0x262989[_0x7269('0x46')][_0x7269('0x4f')]=integrations['getDescriptions'](_0x262989['body']['channel'],_0x262989[_0x7269('0x46')][_0x7269('0x50')]);return db['FreshdeskConfiguration'][_0x7269('0x45')](_0x262989['body'],{'include':[{'model':db[_0x7269('0x51')],'as':_0x7269('0x4d')},{'model':db[_0x7269('0x51')],'as':_0x7269('0x4f')}]});}return null;})[_0x7269('0x23')](respondWithResult(_0x4505f6,null))['catch'](handleError(_0x4505f6,null));};exports[_0x7269('0x52')]=function(_0x44ec8d,_0x1f31d7,_0x45ab0f){var _0x31d03e='';return db[_0x7269('0x28')][_0x7269('0x4b')]({'where':{'id':_0x44ec8d[_0x7269('0x42')]['id']},'attributes':['id',_0x7269('0x53'),_0x7269('0x54')]})[_0x7269('0x23')](handleEntityNotFound(_0x1f31d7,null))[_0x7269('0x23')](function(_0xd0fc13){if(_0xd0fc13){_0x31d03e=_0xd0fc13['remoteUri'];var _0xf59051=_0x31d03e[_0x7269('0x55')](-0x1);if(_0xf59051==='/'){_0x31d03e=_0x31d03e[_0x7269('0x56')](0x0,_0x31d03e[_0x7269('0x57')](_0xf59051));}return rp({'method':_0x7269('0x58'),'uri':util['format'](_0x7269('0x59'),_0x31d03e,_0x7269('0x5a')),'headers':{'Authorization':util[_0x7269('0x5b')]('Basic\x20%s',new Buffer(util[_0x7269('0x5b')]('%s:X',_0xd0fc13['apiKey']))[_0x7269('0x5c')](_0x7269('0x5d')))},'json':!![]});}})[_0x7269('0x23')](function(_0x1f29c5){if(_0x1f29c5){var _0x3d26aa=['requester','subject','agent',_0x7269('0x5e'),_0x7269('0x19'),_0x7269('0x5f'),'group',_0x7269('0x60'),_0x7269('0x61'),_0x7269('0x62'),_0x7269('0x63')];_[_0x7269('0x64')](_0x1f29c5,function(_0x1c11e3){return _0x3d26aa[_0x7269('0x65')](_0x1c11e3[_0x7269('0x26')])||!_0x1c11e3[_0x7269('0x66')]&&_0x1c11e3[_0x7269('0x50')]!==_0x7269('0x67')&&_0x1c11e3['type']!==_0x7269('0x68');});return{'count':_0x1f29c5[_0x7269('0x32')],'rows':_[_0x7269('0x69')](_0x1f29c5,function(_0x3cbd47){return{'id':_0x3cbd47[_0x7269('0x26')],'name':_0x3cbd47[_0x7269('0x6a')],'custom':!_0x3cbd47[_0x7269('0x66')],'options':_0x3cbd47[_0x7269('0x6b')]?_[_0x7269('0x69')](_0x3cbd47[_0x7269('0x6b')],function(_0x31b980){return{'name':_[_0x7269('0x6c')](_0x31b980),'value':_0x31b980};}):[]};})};}})[_0x7269('0x23')](respondWithResult(_0x1f31d7,null))[_0x7269('0x40')](function(_0x5c3776){var _0x335037=_0x44ec8d[_0x7269('0x2d')][_0x7269('0x6d')]?0x1f4:_0x5c3776[_0x7269('0x6e')]||0x1f4;logger[_0x7269('0x24')](_0x7269('0x6f'),_0x7269('0x52'),_0x335037,JSON[_0x7269('0x70')](_0x5c3776));delete _0x5c3776[_0x7269('0x26')];if(_0x335037===0x191){_0x335037=0x190;}_0x1f31d7[_0x7269('0x19')](_0x335037)['send'](_0x44ec8d[_0x7269('0x2d')][_0x7269('0x6d')]?{'message':_0x7269('0x71'),'statusCode':_0x5c3776[_0x7269('0x6e')]}:_0x5c3776);});}; \ No newline at end of file +var _0x2e16=['Subjects','getSubjects','channel','FreshdeskField','Descriptions','getFields','remoteUri','apiKey','slice','substring','GET','%s/%s','format','Basic\x20%s','%s:X','toString','base64','requester','agent','description','group','source','company','remove','custom_text','custom_dropdown','label','default','choices','capitalize','statusCode','stringify','test','eml-format','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','count','set','json','apply','reject','update','then','error','name','send','map','FreshdeskAccount','rawAttributes','fieldName','key','model','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','type','filter','options','includeAll','include','findAll','rows','catch','keys','intersection','find','create','body','params','getConfigurations','findOne','nolimit','addConfiguration','AccountId'];(function(_0x2e5f9c,_0x134a52){var _0x538b44=function(_0x38ef13){while(--_0x38ef13){_0x2e5f9c['push'](_0x2e5f9c['shift']());}};_0x538b44(++_0x134a52);}(_0x2e16,0x8d));var _0x62e1=function(_0x266799,_0x500e3a){_0x266799=_0x266799-0x0;var _0x20d5f1=_0x2e16[_0x266799];return _0x20d5f1;};'use strict';var emlformat=require(_0x62e1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x62e1('0x1'));var moment=require(_0x62e1('0x2'));var BPromise=require(_0x62e1('0x3'));var Mustache=require(_0x62e1('0x4'));var util=require('util');var path=require(_0x62e1('0x5'));var sox=require(_0x62e1('0x6'));var csv=require(_0x62e1('0x7'));var ejs=require(_0x62e1('0x8'));var fs=require('fs');var fs_extra=require(_0x62e1('0x9'));var _=require(_0x62e1('0xa'));var squel=require(_0x62e1('0xb'));var crypto=require(_0x62e1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x62e1('0xd'));var toCsv=require(_0x62e1('0x7'));var querystring=require('querystring');var Papa=require(_0x62e1('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x62e1('0xf'));var as=require(_0x62e1('0x10'));var hardwareService=require(_0x62e1('0x11'));var logger=require(_0x62e1('0x12'))(_0x62e1('0x13'));var utils=require(_0x62e1('0x14'));var config=require(_0x62e1('0x15'));var licenseUtil=require(_0x62e1('0x16'));var db=require(_0x62e1('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x58661f,_0x321852){_0x321852=_0x321852||0xcc;return function(_0x327ce2){if(_0x327ce2){return _0x58661f[_0x62e1('0x18')](_0x321852);}return _0x58661f[_0x62e1('0x19')](_0x321852)[_0x62e1('0x1a')]();};}function respondWithResult(_0xbaa725,_0x5101e2){_0x5101e2=_0x5101e2||0xc8;return function(_0x27cd5c){if(_0x27cd5c){return _0xbaa725[_0x62e1('0x19')](_0x5101e2)['json'](_0x27cd5c);}};}function respondWithFilteredResult(_0x18ae71,_0x43bf9b){return function(_0x5b439e){if(_0x5b439e){var _0x46e103=typeof _0x43bf9b[_0x62e1('0x1b')]==='undefined'&&typeof _0x43bf9b[_0x62e1('0x1c')]==='undefined';var _0x3610e2=_0x5b439e[_0x62e1('0x1d')];var _0x573b94=_0x46e103?0x0:_0x43bf9b['offset'];var _0x4c9e9e=_0x46e103?_0x5b439e['count']:_0x43bf9b[_0x62e1('0x1b')]+_0x43bf9b[_0x62e1('0x1c')];var _0x52c946;if(_0x4c9e9e>=_0x3610e2){_0x4c9e9e=_0x3610e2;_0x52c946=0xc8;}else{_0x52c946=0xce;}_0x18ae71[_0x62e1('0x19')](_0x52c946);return _0x18ae71[_0x62e1('0x1e')]('Content-Range',_0x573b94+'-'+_0x4c9e9e+'/'+_0x3610e2)[_0x62e1('0x1f')](_0x5b439e);}return null;};}function patchUpdates(_0x3936a9){return function(_0x5dd62d){try{jsonpatch[_0x62e1('0x20')](_0x5dd62d,_0x3936a9,!![]);}catch(_0x256b4c){return BPromise[_0x62e1('0x21')](_0x256b4c);}return _0x5dd62d['save']();};}function saveUpdates(_0x23c244,_0x260d09){return function(_0x11ee84){if(_0x11ee84){return _0x11ee84[_0x62e1('0x22')](_0x23c244)[_0x62e1('0x23')](function(_0x40316b){return _0x40316b;});}return null;};}function removeEntity(_0x2bc190,_0x1f44af){return function(_0x2b1584){if(_0x2b1584){return _0x2b1584['destroy']()[_0x62e1('0x23')](function(){_0x2bc190['status'](0xcc)[_0x62e1('0x1a')]();});}};}function handleEntityNotFound(_0xfa73d3,_0xba9310){return function(_0x492dff){if(!_0x492dff){_0xfa73d3[_0x62e1('0x18')](0x194);}return _0x492dff;};}function handleError(_0xc8624d,_0x433d42){_0x433d42=_0x433d42||0x1f4;return function(_0x5ea67b){logger[_0x62e1('0x24')](_0x5ea67b['stack']);if(_0x5ea67b['name']){delete _0x5ea67b[_0x62e1('0x25')];}_0xc8624d[_0x62e1('0x19')](_0x433d42)[_0x62e1('0x26')](_0x5ea67b);};}exports['index']=function(_0x2f1349,_0x28fb00){var _0x1e7264={},_0x9b39f2={},_0x295365={'count':0x0,'rows':[]};var _0x50c459=_[_0x62e1('0x27')](db[_0x62e1('0x28')][_0x62e1('0x29')],function(_0x3910c2){return{'name':_0x3910c2[_0x62e1('0x2a')],'type':_0x3910c2['type'][_0x62e1('0x2b')]};});_0x9b39f2[_0x62e1('0x2c')]=_[_0x62e1('0x27')](_0x50c459,_0x62e1('0x25'));_0x9b39f2[_0x62e1('0x2d')]=_['keys'](_0x2f1349[_0x62e1('0x2d')]);_0x9b39f2[_0x62e1('0x2e')]=_['intersection'](_0x9b39f2[_0x62e1('0x2c')],_0x9b39f2['query']);_0x1e7264[_0x62e1('0x2f')]=_['intersection'](_0x9b39f2[_0x62e1('0x2c')],qs[_0x62e1('0x30')](_0x2f1349[_0x62e1('0x2d')][_0x62e1('0x30')]));_0x1e7264[_0x62e1('0x2f')]=_0x1e7264[_0x62e1('0x2f')][_0x62e1('0x31')]?_0x1e7264[_0x62e1('0x2f')]:_0x9b39f2['model'];if(!_0x2f1349[_0x62e1('0x2d')][_0x62e1('0x32')]('nolimit')){_0x1e7264[_0x62e1('0x1c')]=qs[_0x62e1('0x1c')](_0x2f1349[_0x62e1('0x2d')][_0x62e1('0x1c')]);_0x1e7264[_0x62e1('0x1b')]=qs[_0x62e1('0x1b')](_0x2f1349[_0x62e1('0x2d')]['offset']);}_0x1e7264[_0x62e1('0x33')]=qs[_0x62e1('0x34')](_0x2f1349[_0x62e1('0x2d')]['sort']);_0x1e7264[_0x62e1('0x35')]=qs['filters'](_[_0x62e1('0x36')](_0x2f1349[_0x62e1('0x2d')],_0x9b39f2['filters']),_0x50c459);if(_0x2f1349[_0x62e1('0x2d')]['filter']){_0x1e7264[_0x62e1('0x35')]=_[_0x62e1('0x37')](_0x1e7264['where'],{'$or':_[_0x62e1('0x27')](_0x50c459,function(_0x227c4d){if(_0x227c4d[_0x62e1('0x38')]!=='VIRTUAL'){var _0x23d050={};_0x23d050[_0x227c4d[_0x62e1('0x25')]]={'$like':'%'+_0x2f1349[_0x62e1('0x2d')][_0x62e1('0x39')]+'%'};return _0x23d050;}})});}_0x1e7264=_['merge']({},_0x1e7264,_0x2f1349[_0x62e1('0x3a')]);var _0x2fedc3={'where':_0x1e7264[_0x62e1('0x35')]};return db[_0x62e1('0x28')][_0x62e1('0x1d')](_0x2fedc3)[_0x62e1('0x23')](function(_0x5d2f22){_0x295365[_0x62e1('0x1d')]=_0x5d2f22;if(_0x2f1349[_0x62e1('0x2d')][_0x62e1('0x3b')]){_0x1e7264[_0x62e1('0x3c')]=[{'all':!![]}];}return db[_0x62e1('0x28')][_0x62e1('0x3d')](_0x1e7264);})[_0x62e1('0x23')](function(_0x256ec9){_0x295365[_0x62e1('0x3e')]=_0x256ec9;return _0x295365;})[_0x62e1('0x23')](respondWithFilteredResult(_0x28fb00,_0x1e7264))[_0x62e1('0x3f')](handleError(_0x28fb00,null));};exports['show']=function(_0x3171bc,_0xdc8579){var _0x40d332={'raw':![],'where':{'id':_0x3171bc['params']['id']}},_0x31fad6={};_0x31fad6[_0x62e1('0x2c')]=_['keys'](db[_0x62e1('0x28')]['rawAttributes']);_0x31fad6[_0x62e1('0x2d')]=_[_0x62e1('0x40')](_0x3171bc[_0x62e1('0x2d')]);_0x31fad6[_0x62e1('0x2e')]=_[_0x62e1('0x41')](_0x31fad6[_0x62e1('0x2c')],_0x31fad6[_0x62e1('0x2d')]);_0x40d332[_0x62e1('0x2f')]=_[_0x62e1('0x41')](_0x31fad6[_0x62e1('0x2c')],qs['fields'](_0x3171bc[_0x62e1('0x2d')][_0x62e1('0x30')]));_0x40d332['attributes']=_0x40d332[_0x62e1('0x2f')]['length']?_0x40d332[_0x62e1('0x2f')]:_0x31fad6[_0x62e1('0x2c')];if(_0x3171bc[_0x62e1('0x2d')][_0x62e1('0x3b')]){_0x40d332[_0x62e1('0x3c')]=[{'all':!![]}];}_0x40d332=_[_0x62e1('0x37')]({},_0x40d332,_0x3171bc[_0x62e1('0x3a')]);return db['FreshdeskAccount'][_0x62e1('0x42')](_0x40d332)[_0x62e1('0x23')](handleEntityNotFound(_0xdc8579,null))[_0x62e1('0x23')](respondWithResult(_0xdc8579,null))['catch'](handleError(_0xdc8579,null));};exports[_0x62e1('0x43')]=function(_0x4a4cb6,_0x4eb236){return db[_0x62e1('0x28')]['create'](_0x4a4cb6[_0x62e1('0x44')],{})['then'](respondWithResult(_0x4eb236,0xc9))[_0x62e1('0x3f')](handleError(_0x4eb236,null));};exports[_0x62e1('0x22')]=function(_0x3880d2,_0x1a0e9a){if(_0x3880d2[_0x62e1('0x44')]['id']){delete _0x3880d2[_0x62e1('0x44')]['id'];}return db[_0x62e1('0x28')][_0x62e1('0x42')]({'where':{'id':_0x3880d2[_0x62e1('0x45')]['id']}})[_0x62e1('0x23')](handleEntityNotFound(_0x1a0e9a,null))[_0x62e1('0x23')](saveUpdates(_0x3880d2[_0x62e1('0x44')],null))[_0x62e1('0x23')](respondWithResult(_0x1a0e9a,null))['catch'](handleError(_0x1a0e9a,null));};exports['destroy']=function(_0x8b61da,_0x12fffa){return db[_0x62e1('0x28')][_0x62e1('0x42')]({'where':{'id':_0x8b61da[_0x62e1('0x45')]['id']}})[_0x62e1('0x23')](handleEntityNotFound(_0x12fffa,null))[_0x62e1('0x23')](removeEntity(_0x12fffa,null))['catch'](handleError(_0x12fffa,null));};exports[_0x62e1('0x46')]=function(_0x3b687a,_0x5a6ed4,_0x251fe9){var _0x4ff566={};var _0x5e1515={};var _0x4078f1;var _0x5b61c1;return db[_0x62e1('0x28')][_0x62e1('0x47')]({'where':{'id':_0x3b687a[_0x62e1('0x45')]['id']}})[_0x62e1('0x23')](handleEntityNotFound(_0x5a6ed4,null))['then'](function(_0x985b48){if(_0x985b48){_0x4078f1=_0x985b48;_0x5e1515['model']=_['keys'](db['FreshdeskConfiguration'][_0x62e1('0x29')]);_0x5e1515[_0x62e1('0x2d')]=_[_0x62e1('0x40')](_0x3b687a['query']);_0x5e1515['filters']=_[_0x62e1('0x41')](_0x5e1515[_0x62e1('0x2c')],_0x5e1515[_0x62e1('0x2d')]);_0x4ff566['attributes']=_[_0x62e1('0x41')](_0x5e1515[_0x62e1('0x2c')],qs[_0x62e1('0x30')](_0x3b687a['query']['fields']));_0x4ff566[_0x62e1('0x2f')]=_0x4ff566[_0x62e1('0x2f')][_0x62e1('0x31')]?_0x4ff566['attributes']:_0x5e1515[_0x62e1('0x2c')];_0x4ff566['order']=qs[_0x62e1('0x34')](_0x3b687a[_0x62e1('0x2d')][_0x62e1('0x34')]);_0x4ff566[_0x62e1('0x35')]=qs[_0x62e1('0x2e')](_[_0x62e1('0x36')](_0x3b687a[_0x62e1('0x2d')],_0x5e1515['filters']));if(_0x3b687a[_0x62e1('0x2d')][_0x62e1('0x39')]){_0x4ff566[_0x62e1('0x35')]=_[_0x62e1('0x37')](_0x4ff566['where'],{'$or':_[_0x62e1('0x27')](_0x4ff566['attributes'],function(_0x42ae35){var _0x19e79e={};_0x19e79e[_0x42ae35]={'$like':'%'+_0x3b687a['query'][_0x62e1('0x39')]+'%'};return _0x19e79e;})});}_0x4ff566=_[_0x62e1('0x37')]({},_0x4ff566,_0x3b687a[_0x62e1('0x3a')]);return _0x4078f1[_0x62e1('0x46')](_0x4ff566);}})[_0x62e1('0x23')](function(_0x4d9ff6){if(_0x4d9ff6){_0x5b61c1=_0x4d9ff6[_0x62e1('0x31')];if(!_0x3b687a['query'][_0x62e1('0x32')](_0x62e1('0x48'))){_0x4ff566[_0x62e1('0x1c')]=qs['limit'](_0x3b687a['query'][_0x62e1('0x1c')]);_0x4ff566['offset']=qs[_0x62e1('0x1b')](_0x3b687a['query'][_0x62e1('0x1b')]);}return _0x4078f1[_0x62e1('0x46')](_0x4ff566);}})[_0x62e1('0x23')](function(_0x561554){if(_0x561554){return _0x561554?{'count':_0x5b61c1,'rows':_0x561554}:null;}})[_0x62e1('0x23')](respondWithResult(_0x5a6ed4,null))[_0x62e1('0x3f')](handleError(_0x5a6ed4,null));};exports[_0x62e1('0x49')]=function(_0x318172,_0x547227,_0x8e5682){if(_0x318172[_0x62e1('0x44')]['id']){delete _0x318172['body']['id'];}return db[_0x62e1('0x28')][_0x62e1('0x47')]({'where':{'id':_0x318172[_0x62e1('0x45')]['id']}})[_0x62e1('0x23')](handleEntityNotFound(_0x547227,null))[_0x62e1('0x23')](function(_0x45262a){if(_0x45262a){_0x318172[_0x62e1('0x44')][_0x62e1('0x4a')]=_0x45262a['id'];_0x318172['body'][_0x62e1('0x4b')]=integrations[_0x62e1('0x4c')](_0x318172[_0x62e1('0x44')][_0x62e1('0x4d')],_0x318172[_0x62e1('0x44')][_0x62e1('0x38')]);_0x318172[_0x62e1('0x44')]['Descriptions']=integrations['getDescriptions'](_0x318172[_0x62e1('0x44')][_0x62e1('0x4d')],_0x318172[_0x62e1('0x44')]['type']);return db['FreshdeskConfiguration'][_0x62e1('0x43')](_0x318172['body'],{'include':[{'model':db['FreshdeskField'],'as':'Subjects'},{'model':db[_0x62e1('0x4e')],'as':_0x62e1('0x4f')}]});}return null;})[_0x62e1('0x23')](respondWithResult(_0x547227,null))[_0x62e1('0x3f')](handleError(_0x547227,null));};exports[_0x62e1('0x50')]=function(_0xeb4fa9,_0x5e54bc,_0x4dd329){var _0x1b5144='';return db[_0x62e1('0x28')]['findOne']({'where':{'id':_0xeb4fa9[_0x62e1('0x45')]['id']},'attributes':['id',_0x62e1('0x51'),_0x62e1('0x52')]})[_0x62e1('0x23')](handleEntityNotFound(_0x5e54bc,null))['then'](function(_0xddf25){if(_0xddf25){_0x1b5144=_0xddf25['remoteUri'];var _0x6cb56c=_0x1b5144[_0x62e1('0x53')](-0x1);if(_0x6cb56c==='/'){_0x1b5144=_0x1b5144[_0x62e1('0x54')](0x0,_0x1b5144['lastIndexOf'](_0x6cb56c));}return rp({'method':_0x62e1('0x55'),'uri':util['format'](_0x62e1('0x56'),_0x1b5144,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0x62e1('0x57')](_0x62e1('0x58'),new Buffer(util['format'](_0x62e1('0x59'),_0xddf25[_0x62e1('0x52')]))[_0x62e1('0x5a')](_0x62e1('0x5b')))},'json':!![]});}})[_0x62e1('0x23')](function(_0xc5b011){if(_0xc5b011){var _0x2e65dd=[_0x62e1('0x5c'),'subject',_0x62e1('0x5d'),_0x62e1('0x5e'),_0x62e1('0x19'),'priority',_0x62e1('0x5f'),_0x62e1('0x60'),'ticket_type','group',_0x62e1('0x61')];_[_0x62e1('0x62')](_0xc5b011,function(_0x1cc51b){return _0x2e65dd['includes'](_0x1cc51b[_0x62e1('0x25')])||!_0x1cc51b['default']&&_0x1cc51b[_0x62e1('0x38')]!==_0x62e1('0x63')&&_0x1cc51b[_0x62e1('0x38')]!==_0x62e1('0x64');});return{'count':_0xc5b011[_0x62e1('0x31')],'rows':_[_0x62e1('0x27')](_0xc5b011,function(_0x33d8c1){return{'id':_0x33d8c1[_0x62e1('0x25')],'name':_0x33d8c1[_0x62e1('0x65')],'custom':!_0x33d8c1[_0x62e1('0x66')],'options':_0x33d8c1[_0x62e1('0x67')]?_[_0x62e1('0x27')](_0x33d8c1['choices'],function(_0x2a4b6c){return{'name':_[_0x62e1('0x68')](_0x2a4b6c),'value':_0x2a4b6c};}):[]};})};}})[_0x62e1('0x23')](respondWithResult(_0x5e54bc,null))[_0x62e1('0x3f')](function(_0x125c2d){var _0x51e264=_0xeb4fa9[_0x62e1('0x2d')]['test']?0x1f4:_0x125c2d[_0x62e1('0x69')]||0x1f4;logger[_0x62e1('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0x62e1('0x50'),_0x51e264,JSON[_0x62e1('0x6a')](_0x125c2d));delete _0x125c2d['name'];if(_0x51e264===0x191){_0x51e264=0x190;}_0x5e54bc[_0x62e1('0x19')](_0x51e264)[_0x62e1('0x26')](_0xeb4fa9[_0x62e1('0x2d')][_0x62e1('0x6b')]?{'message':'Wrong\x20credentials','statusCode':_0x125c2d['statusCode']}:_0x125c2d);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 60cde59..c0462ce 100644 --- a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js +++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x84dc=['int_freshdesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','define'];(function(_0x1217db,_0xa754e5){var _0x459c64=function(_0x53b7c7){while(--_0x53b7c7){_0x1217db['push'](_0x1217db['shift']());}};_0x459c64(++_0xa754e5);}(_0x84dc,0x175));var _0xc84d=function(_0x399ab7,_0x391287){_0x399ab7=_0x399ab7-0x0;var _0x51dbf0=_0x84dc[_0x399ab7];return _0x51dbf0;};'use strict';var _=require(_0xc84d('0x0'));var util=require(_0xc84d('0x1'));var logger=require(_0xc84d('0x2'))(_0xc84d('0x3'));var moment=require(_0xc84d('0x4'));var BPromise=require(_0xc84d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc84d('0x6'));var config=require(_0xc84d('0x7'));var attributes=require(_0xc84d('0x8'));var integrations=require(_0xc84d('0x9'));module['exports']=function(_0x349a3d,_0x99a21a){return _0x349a3d[_0xc84d('0xa')]('FreshdeskAccount',attributes,{'tableName':_0xc84d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1124=['define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./intFreshdeskAccount.attributes','exports'];(function(_0x3f2a90,_0x50baf1){var _0xb46279=function(_0x5e47b5){while(--_0x5e47b5){_0x3f2a90['push'](_0x3f2a90['shift']());}};_0xb46279(++_0x50baf1);}(_0x1124,0x9f));var _0x4112=function(_0x20982f,_0x5b0e68){_0x20982f=_0x20982f-0x0;var _0x54e3d4=_0x1124[_0x20982f];return _0x54e3d4;};'use strict';var _=require(_0x4112('0x0'));var util=require(_0x4112('0x1'));var logger=require(_0x4112('0x2'))(_0x4112('0x3'));var moment=require(_0x4112('0x4'));var BPromise=require(_0x4112('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4112('0x6'));var rimraf=require(_0x4112('0x7'));var config=require('../../config/environment');var attributes=require(_0x4112('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x4112('0x9')]=function(_0x26dc96,_0x1b60e0){return _0x26dc96[_0x4112('0xa')](_0x4112('0xb'),attributes,{'tableName':_0x4112('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index b0d108d..bb9542e 100644 --- a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js +++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9e1f=['request\x20sent','stringify','error','code','FreshdeskAccount,\x20%s,\x20%s','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','include','model','map','attributes','debug','ShowFreshdeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x369534,_0x5557c4){var _0x524bf9=function(_0x24c6fb){while(--_0x24c6fb){_0x369534['push'](_0x369534['shift']());}};_0x524bf9(++_0x5557c4);}(_0x9e1f,0x9c));var _0xf9e1=function(_0x49ac7f,_0x152333){_0x49ac7f=_0x49ac7f-0x0;var _0x4f73f3=_0x9e1f[_0x49ac7f];return _0x4f73f3;};'use strict';var _=require(_0xf9e1('0x0'));var util=require(_0xf9e1('0x1'));var moment=require(_0xf9e1('0x2'));var BPromise=require(_0xf9e1('0x3'));var rs=require(_0xf9e1('0x4'));var fs=require('fs');var Redis=require(_0xf9e1('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf9e1('0x6'))(_0xf9e1('0x7'));var config=require(_0xf9e1('0x8'));var jayson=require(_0xf9e1('0x9'));var client=jayson[_0xf9e1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4207d7,_0x4eecf4,_0x26755d){return new BPromise(function(_0x125338,_0x43100c){return client[_0xf9e1('0xb')](_0x4207d7,_0x26755d)[_0xf9e1('0xc')](function(_0x4e7580){logger[_0xf9e1('0xd')]('FreshdeskAccount,\x20%s,\x20%s',_0x4eecf4,_0xf9e1('0xe'));logger['debug']('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x4eecf4,_0xf9e1('0xe'),JSON[_0xf9e1('0xf')](_0x4e7580));if(_0x4e7580[_0xf9e1('0x10')]){if(_0x4e7580[_0xf9e1('0x10')][_0xf9e1('0x11')]===0x1f4){logger[_0xf9e1('0x10')](_0xf9e1('0x12'),_0x4eecf4,_0x4e7580['error']['message']);return _0x43100c(_0x4e7580[_0xf9e1('0x10')]['message']);}logger[_0xf9e1('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x4eecf4,_0x4e7580[_0xf9e1('0x10')][_0xf9e1('0x13')]);return _0x125338(_0x4e7580[_0xf9e1('0x10')]['message']);}else{logger[_0xf9e1('0xd')]('FreshdeskAccount,\x20%s,\x20%s',_0x4eecf4,_0xf9e1('0xe'));_0x125338(_0x4e7580[_0xf9e1('0x14')][_0xf9e1('0x13')]);}})[_0xf9e1('0x15')](function(_0x38b351){logger[_0xf9e1('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x4eecf4,_0x38b351);_0x43100c(_0x38b351);});});}exports[_0xf9e1('0x16')]=function(_0x3f5d73){var _0x2b847f=this;return new Promise(function(_0x1c493c,_0x3dfc4e){return db[_0xf9e1('0x17')][_0xf9e1('0x18')]({'raw':_0x3f5d73[_0xf9e1('0x19')]?_0x3f5d73[_0xf9e1('0x19')][_0xf9e1('0x1a')]===undefined?!![]:![]:!![],'where':_0x3f5d73['options']?_0x3f5d73[_0xf9e1('0x19')][_0xf9e1('0x1b')]||null:null,'attributes':_0x3f5d73[_0xf9e1('0x19')]?_0x3f5d73['options']['attributes']||null:null,'limit':_0x3f5d73[_0xf9e1('0x19')]?_0x3f5d73[_0xf9e1('0x19')]['limit']||null:null,'include':_0x3f5d73[_0xf9e1('0x19')]?_0x3f5d73[_0xf9e1('0x19')][_0xf9e1('0x1c')]?_['map'](_0x3f5d73[_0xf9e1('0x19')][_0xf9e1('0x1c')],function(_0x36e9da){return{'model':db[_0x36e9da[_0xf9e1('0x1d')]],'as':_0x36e9da['as'],'attributes':_0x36e9da['attributes'],'include':_0x36e9da['include']?_[_0xf9e1('0x1e')](_0x36e9da[_0xf9e1('0x1c')],function(_0x1fa036){return{'model':db[_0x1fa036[_0xf9e1('0x1d')]],'as':_0x1fa036['as'],'attributes':_0x1fa036['attributes'],'include':_0x1fa036[_0xf9e1('0x1c')]?_[_0xf9e1('0x1e')](_0x1fa036[_0xf9e1('0x1c')],function(_0x4bb069){return{'model':db[_0x4bb069[_0xf9e1('0x1d')]],'as':_0x4bb069['as'],'attributes':_0x4bb069[_0xf9e1('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5ee4b9){logger[_0xf9e1('0xd')](_0xf9e1('0x16'),_0x3f5d73);logger[_0xf9e1('0x20')]('GetFreshdeskAccount',_0x3f5d73,JSON[_0xf9e1('0xf')](_0x5ee4b9));_0x1c493c(_0x5ee4b9);})[_0xf9e1('0x15')](function(_0x5572e7){logger[_0xf9e1('0x10')](_0xf9e1('0x16'),_0x5572e7[_0xf9e1('0x13')],_0x3f5d73);_0x3dfc4e(_0x2b847f[_0xf9e1('0x10')](0x1f4,_0x5572e7[_0xf9e1('0x13')]));});});};exports[_0xf9e1('0x21')]=function(_0x21f43c){var _0x13ae1f=this;return new Promise(function(_0x37f01a,_0x5e0de5){return db[_0xf9e1('0x17')]['find']({'raw':_0x21f43c[_0xf9e1('0x19')]?_0x21f43c[_0xf9e1('0x19')][_0xf9e1('0x1a')]===undefined?!![]:![]:!![],'where':_0x21f43c[_0xf9e1('0x19')]?_0x21f43c[_0xf9e1('0x19')]['where']||null:null,'attributes':_0x21f43c['options']?_0x21f43c[_0xf9e1('0x19')][_0xf9e1('0x1f')]||null:null,'include':_0x21f43c[_0xf9e1('0x19')]?_0x21f43c[_0xf9e1('0x19')]['include']?_[_0xf9e1('0x1e')](_0x21f43c[_0xf9e1('0x19')][_0xf9e1('0x1c')],function(_0x334449){return{'model':db[_0x334449['model']],'as':_0x334449['as'],'attributes':_0x334449[_0xf9e1('0x1f')],'include':_0x334449[_0xf9e1('0x1c')]?_[_0xf9e1('0x1e')](_0x334449[_0xf9e1('0x1c')],function(_0x173b80){return{'model':db[_0x173b80['model']],'as':_0x173b80['as'],'attributes':_0x173b80[_0xf9e1('0x1f')],'include':_0x173b80[_0xf9e1('0x1c')]?_['map'](_0x173b80[_0xf9e1('0x1c')],function(_0x561630){return{'model':db[_0x561630['model']],'as':_0x561630['as'],'attributes':_0x561630[_0xf9e1('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xf9e1('0xc')](function(_0x3e94ab){logger[_0xf9e1('0xd')](_0xf9e1('0x21'),_0x21f43c);logger['debug'](_0xf9e1('0x21'),_0x21f43c,JSON[_0xf9e1('0xf')](_0x3e94ab));_0x37f01a(_0x3e94ab);})[_0xf9e1('0x15')](function(_0x12bb61){logger[_0xf9e1('0x10')](_0xf9e1('0x21'),_0x12bb61['message'],_0x21f43c);_0x5e0de5(_0x13ae1f['error'](0x1f4,_0x12bb61[_0xf9e1('0x13')]));});});}; \ No newline at end of file +var _0xffa6=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','code','FreshdeskAccount,\x20%s,\x20%s','message','result','catch','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetFreshdeskAccount','stringify','ShowFreshdeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x217542,_0x15cc22){var _0x4bb071=function(_0x5f471b){while(--_0x5f471b){_0x217542['push'](_0x217542['shift']());}};_0x4bb071(++_0x15cc22);}(_0xffa6,0x1a5));var _0x6ffa=function(_0x35a3ac,_0x1ffc5c){_0x35a3ac=_0x35a3ac-0x0;var _0x38cc97=_0xffa6[_0x35a3ac];return _0x38cc97;};'use strict';var _=require(_0x6ffa('0x0'));var util=require(_0x6ffa('0x1'));var moment=require(_0x6ffa('0x2'));var BPromise=require(_0x6ffa('0x3'));var rs=require(_0x6ffa('0x4'));var fs=require('fs');var Redis=require(_0x6ffa('0x5'));var db=require(_0x6ffa('0x6'))['db'];var utils=require(_0x6ffa('0x7'));var logger=require(_0x6ffa('0x8'))(_0x6ffa('0x9'));var config=require(_0x6ffa('0xa'));var jayson=require(_0x6ffa('0xb'));var client=jayson[_0x6ffa('0xc')][_0x6ffa('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5206e0,_0x14e4fa,_0x3d6e65){return new BPromise(function(_0x58f4cd,_0x2edf42){return client[_0x6ffa('0xe')](_0x5206e0,_0x3d6e65)[_0x6ffa('0xf')](function(_0x5a76e5){logger[_0x6ffa('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x14e4fa,_0x6ffa('0x11'));logger[_0x6ffa('0x12')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x14e4fa,_0x6ffa('0x11'),JSON['stringify'](_0x5a76e5));if(_0x5a76e5[_0x6ffa('0x13')]){if(_0x5a76e5[_0x6ffa('0x13')][_0x6ffa('0x14')]===0x1f4){logger[_0x6ffa('0x13')](_0x6ffa('0x15'),_0x14e4fa,_0x5a76e5[_0x6ffa('0x13')][_0x6ffa('0x16')]);return _0x2edf42(_0x5a76e5['error'][_0x6ffa('0x16')]);}logger[_0x6ffa('0x13')](_0x6ffa('0x15'),_0x14e4fa,_0x5a76e5[_0x6ffa('0x13')][_0x6ffa('0x16')]);return _0x58f4cd(_0x5a76e5['error'][_0x6ffa('0x16')]);}else{logger[_0x6ffa('0x10')](_0x6ffa('0x15'),_0x14e4fa,'request\x20sent');_0x58f4cd(_0x5a76e5[_0x6ffa('0x17')][_0x6ffa('0x16')]);}})[_0x6ffa('0x18')](function(_0x2fe9ba){logger[_0x6ffa('0x13')](_0x6ffa('0x15'),_0x14e4fa,_0x2fe9ba);_0x2edf42(_0x2fe9ba);});});}exports['GetFreshdeskAccount']=function(_0x4510b4){var _0x50cd1f=this;return new Promise(function(_0x345e1d,_0x2a16bc){return db[_0x6ffa('0x19')][_0x6ffa('0x1a')]({'raw':_0x4510b4[_0x6ffa('0x1b')]?_0x4510b4[_0x6ffa('0x1b')][_0x6ffa('0x1c')]===undefined?!![]:![]:!![],'where':_0x4510b4['options']?_0x4510b4['options'][_0x6ffa('0x1d')]||null:null,'attributes':_0x4510b4[_0x6ffa('0x1b')]?_0x4510b4['options'][_0x6ffa('0x1e')]||null:null,'limit':_0x4510b4[_0x6ffa('0x1b')]?_0x4510b4[_0x6ffa('0x1b')][_0x6ffa('0x1f')]||null:null,'include':_0x4510b4['options']?_0x4510b4[_0x6ffa('0x1b')][_0x6ffa('0x20')]?_[_0x6ffa('0x21')](_0x4510b4['options'][_0x6ffa('0x20')],function(_0x2b0ff5){return{'model':db[_0x2b0ff5[_0x6ffa('0x22')]],'as':_0x2b0ff5['as'],'attributes':_0x2b0ff5['attributes'],'include':_0x2b0ff5[_0x6ffa('0x20')]?_[_0x6ffa('0x21')](_0x2b0ff5[_0x6ffa('0x20')],function(_0x3dd957){return{'model':db[_0x3dd957['model']],'as':_0x3dd957['as'],'attributes':_0x3dd957[_0x6ffa('0x1e')],'include':_0x3dd957['include']?_[_0x6ffa('0x21')](_0x3dd957['include'],function(_0x21b732){return{'model':db[_0x21b732[_0x6ffa('0x22')]],'as':_0x21b732['as'],'attributes':_0x21b732[_0x6ffa('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x6ffa('0xf')](function(_0x360d12){logger[_0x6ffa('0x10')](_0x6ffa('0x23'),_0x4510b4);logger[_0x6ffa('0x12')](_0x6ffa('0x23'),_0x4510b4,JSON[_0x6ffa('0x24')](_0x360d12));_0x345e1d(_0x360d12);})['catch'](function(_0x5603e9){logger[_0x6ffa('0x13')](_0x6ffa('0x23'),_0x5603e9[_0x6ffa('0x16')],_0x4510b4);_0x2a16bc(_0x50cd1f[_0x6ffa('0x13')](0x1f4,_0x5603e9['message']));});});};exports[_0x6ffa('0x25')]=function(_0x434bc5){var _0x525abb=this;return new Promise(function(_0x1f9879,_0x129dfa){return db[_0x6ffa('0x19')][_0x6ffa('0x26')]({'raw':_0x434bc5[_0x6ffa('0x1b')]?_0x434bc5[_0x6ffa('0x1b')][_0x6ffa('0x1c')]===undefined?!![]:![]:!![],'where':_0x434bc5[_0x6ffa('0x1b')]?_0x434bc5[_0x6ffa('0x1b')][_0x6ffa('0x1d')]||null:null,'attributes':_0x434bc5[_0x6ffa('0x1b')]?_0x434bc5[_0x6ffa('0x1b')][_0x6ffa('0x1e')]||null:null,'include':_0x434bc5[_0x6ffa('0x1b')]?_0x434bc5[_0x6ffa('0x1b')][_0x6ffa('0x20')]?_['map'](_0x434bc5[_0x6ffa('0x1b')]['include'],function(_0x4c0fe1){return{'model':db[_0x4c0fe1[_0x6ffa('0x22')]],'as':_0x4c0fe1['as'],'attributes':_0x4c0fe1[_0x6ffa('0x1e')],'include':_0x4c0fe1[_0x6ffa('0x20')]?_[_0x6ffa('0x21')](_0x4c0fe1['include'],function(_0x31e032){return{'model':db[_0x31e032[_0x6ffa('0x22')]],'as':_0x31e032['as'],'attributes':_0x31e032[_0x6ffa('0x1e')],'include':_0x31e032[_0x6ffa('0x20')]?_[_0x6ffa('0x21')](_0x31e032[_0x6ffa('0x20')],function(_0x1f3e1f){return{'model':db[_0x1f3e1f[_0x6ffa('0x22')]],'as':_0x1f3e1f['as'],'attributes':_0x1f3e1f['attributes']};}):[]};}):[]};}):[]:[]})[_0x6ffa('0xf')](function(_0x8e4413){logger[_0x6ffa('0x10')](_0x6ffa('0x25'),_0x434bc5);logger['debug'](_0x6ffa('0x25'),_0x434bc5,JSON[_0x6ffa('0x24')](_0x8e4413));_0x1f9879(_0x8e4413);})[_0x6ffa('0x18')](function(_0x3a877d){logger[_0x6ffa('0x13')](_0x6ffa('0x25'),_0x3a877d[_0x6ffa('0x16')],_0x434bc5);_0x129dfa(_0x525abb[_0x6ffa('0x13')](0x1f4,_0x3a877d['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index ef7a1aa..fecdb77 100644 --- a/server/api/intFreshdeskConfiguration/index.js +++ b/server/api/intFreshdeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x468d=['../../components/interaction/service','./intFreshdeskConfiguration.controller','get','isAuthenticated','show','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','/:id/tags','setTags','put','/:id','delete','exports','express','fs-extra','../../components/auth/service'];(function(_0x24bcc4,_0x226525){var _0x2e6411=function(_0x541b84){while(--_0x541b84){_0x24bcc4['push'](_0x24bcc4['shift']());}};_0x2e6411(++_0x226525);}(_0x468d,0x115));var _0xd468=function(_0x4107ba,_0x389cb7){_0x4107ba=_0x4107ba-0x0;var _0x268846=_0x468d[_0x4107ba];return _0x268846;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd468('0x0'));var router=express['Router']();var fs_extra=require(_0xd468('0x1'));var auth=require(_0xd468('0x2'));var interaction=require(_0xd468('0x3'));var config=require('../../config/environment');var controller=require(_0xd468('0x4'));router[_0xd468('0x5')]('/',auth[_0xd468('0x6')](),controller['index']);router[_0xd468('0x5')]('/:id',auth['isAuthenticated'](),controller[_0xd468('0x7')]);router[_0xd468('0x5')]('/:id/fields',auth['isAuthenticated'](),controller[_0xd468('0x8')]);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0xd468('0x9')]);router[_0xd468('0x5')](_0xd468('0xa'),auth[_0xd468('0x6')](),controller[_0xd468('0xb')]);router[_0xd468('0x5')]('/:id/tags',auth['isAuthenticated'](),controller['getTags']);router[_0xd468('0xc')]('/',auth[_0xd468('0x6')](),controller[_0xd468('0xd')]);router[_0xd468('0xc')](_0xd468('0xe'),auth[_0xd468('0x6')](),controller[_0xd468('0xf')]);router[_0xd468('0x10')](_0xd468('0x11'),auth[_0xd468('0x6')](),controller['update']);router[_0xd468('0x12')](_0xd468('0x11'),auth[_0xd468('0x6')](),controller['destroy']);module[_0xd468('0x13')]=router; \ No newline at end of file +var _0xa057=['/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','post','setTags','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','/:id','show'];(function(_0x3ca0aa,_0x330ac9){var _0x7fe046=function(_0x576ae6){while(--_0x576ae6){_0x3ca0aa['push'](_0x3ca0aa['shift']());}};_0x7fe046(++_0x330ac9);}(_0xa057,0x150));var _0x7a05=function(_0x14d828,_0x13cbd6){_0x14d828=_0x14d828-0x0;var _0x58b0df=_0xa057[_0x14d828];return _0x58b0df;};'use strict';var multer=require(_0x7a05('0x0'));var util=require(_0x7a05('0x1'));var path=require(_0x7a05('0x2'));var timeout=require(_0x7a05('0x3'));var express=require(_0x7a05('0x4'));var router=express[_0x7a05('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7a05('0x6'));var interaction=require(_0x7a05('0x7'));var config=require(_0x7a05('0x8'));var controller=require(_0x7a05('0x9'));router[_0x7a05('0xa')]('/',auth[_0x7a05('0xb')](),controller['index']);router[_0x7a05('0xa')](_0x7a05('0xc'),auth[_0x7a05('0xb')](),controller[_0x7a05('0xd')]);router[_0x7a05('0xa')](_0x7a05('0xe'),auth['isAuthenticated'](),controller['getFields']);router['get'](_0x7a05('0xf'),auth[_0x7a05('0xb')](),controller[_0x7a05('0x10')]);router[_0x7a05('0xa')](_0x7a05('0x11'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x7a05('0xa')](_0x7a05('0x12'),auth[_0x7a05('0xb')](),controller['getTags']);router[_0x7a05('0x13')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/tags',auth[_0x7a05('0xb')](),controller[_0x7a05('0x14')]);router[_0x7a05('0x15')](_0x7a05('0xc'),auth[_0x7a05('0xb')](),controller[_0x7a05('0x16')]);router['delete'](_0x7a05('0xc'),auth[_0x7a05('0xb')](),controller[_0x7a05('0x17')]);module[_0x7a05('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index eecb549..a2a1275 100644 --- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js +++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7264=['sequelize','STRING'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x7264,0x1e2));var _0x4726=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x7264[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0x4726('0x0'));module['exports']={'name':{'type':Sequelize[_0x4726('0x1')]},'description':{'type':Sequelize[_0x4726('0x1')]}}; \ No newline at end of file +var _0x5af7=['STRING','sequelize'];(function(_0x9c6dd1,_0x6b65d1){var _0x122c58=function(_0x448f13){while(--_0x448f13){_0x9c6dd1['push'](_0x9c6dd1['shift']());}};_0x122c58(++_0x6b65d1);}(_0x5af7,0x139));var _0x75af=function(_0x267d8d,_0xe90f65){_0x267d8d=_0x267d8d-0x0;var _0x11a98f=_0x5af7[_0x267d8d];return _0x11a98f;};'use strict';var Sequelize=require(_0x75af('0x0'));module['exports']={'name':{'type':Sequelize[_0x75af('0x1')]},'description':{'type':Sequelize[_0x75af('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index f977fc5..363a5c4 100644 --- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js +++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5046=['filter','options','then','includeAll','include','findAll','rows','show','params','length','find','catch','create','body','getFields','findOne','FreshdeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','request-promise','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','count','set','Content-Range','json','apply','reject','update','destroy','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','fields','attributes','model','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL'];(function(_0x154d86,_0x2d74b0){var _0x161771=function(_0x155671){while(--_0x155671){_0x154d86['push'](_0x154d86['shift']());}};_0x161771(++_0x2d74b0);}(_0x5046,0x10a));var _0x6504=function(_0x500d36,_0x3172f7){_0x500d36=_0x500d36-0x0;var _0x136b55=_0x5046[_0x500d36];return _0x136b55;};'use strict';var emlformat=require(_0x6504('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6504('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6504('0x2'));var moment=require('moment');var BPromise=require(_0x6504('0x3'));var Mustache=require('mustache');var util=require(_0x6504('0x4'));var path=require(_0x6504('0x5'));var sox=require('sox');var csv=require(_0x6504('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6504('0x7'));var _=require(_0x6504('0x8'));var squel=require(_0x6504('0x9'));var crypto=require(_0x6504('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x6504('0xb'));var toCsv=require(_0x6504('0x6'));var querystring=require(_0x6504('0xc'));var Papa=require('papaparse');var Redis=require(_0x6504('0xd'));var authService=require(_0x6504('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x6504('0xf'));var hardwareService=require(_0x6504('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x6504('0x11'));var config=require(_0x6504('0x12'));var licenseUtil=require(_0x6504('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x115a08,_0x1de8e6){_0x1de8e6=_0x1de8e6||0xcc;return function(_0x3f8762){if(_0x3f8762){return _0x115a08[_0x6504('0x14')](_0x1de8e6);}return _0x115a08[_0x6504('0x15')](_0x1de8e6)[_0x6504('0x16')]();};}function respondWithResult(_0x5d4833,_0x23dbb8){_0x23dbb8=_0x23dbb8||0xc8;return function(_0x76d4f){if(_0x76d4f){return _0x5d4833['status'](_0x23dbb8)['json'](_0x76d4f);}};}function respondWithFilteredResult(_0x2df99f,_0x4372cb){return function(_0x388546){if(_0x388546){var _0x54b40e=typeof _0x4372cb[_0x6504('0x17')]==='undefined'&&typeof _0x4372cb[_0x6504('0x18')]==='undefined';var _0x24591f=_0x388546['count'];var _0x5de0fc=_0x54b40e?0x0:_0x4372cb['offset'];var _0x470a93=_0x54b40e?_0x388546[_0x6504('0x19')]:_0x4372cb[_0x6504('0x17')]+_0x4372cb[_0x6504('0x18')];var _0x536f43;if(_0x470a93>=_0x24591f){_0x470a93=_0x24591f;_0x536f43=0xc8;}else{_0x536f43=0xce;}_0x2df99f[_0x6504('0x15')](_0x536f43);return _0x2df99f[_0x6504('0x1a')](_0x6504('0x1b'),_0x5de0fc+'-'+_0x470a93+'/'+_0x24591f)[_0x6504('0x1c')](_0x388546);}return null;};}function patchUpdates(_0x25a247){return function(_0x936193){try{jsonpatch[_0x6504('0x1d')](_0x936193,_0x25a247,!![]);}catch(_0x16454d){return BPromise[_0x6504('0x1e')](_0x16454d);}return _0x936193['save']();};}function saveUpdates(_0xc7eb82,_0x4e35cc){return function(_0x15f3f0){if(_0x15f3f0){return _0x15f3f0[_0x6504('0x1f')](_0xc7eb82)['then'](function(_0x455b8d){return _0x455b8d;});}return null;};}function removeEntity(_0x3e67e7,_0x14d414){return function(_0x30a053){if(_0x30a053){return _0x30a053[_0x6504('0x20')]()['then'](function(){_0x3e67e7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c5d39,_0x3cab41){return function(_0x551a49){if(!_0x551a49){_0x2c5d39[_0x6504('0x14')](0x194);}return _0x551a49;};}function handleError(_0x3f42e5,_0x5bbeb7){_0x5bbeb7=_0x5bbeb7||0x1f4;return function(_0x26c8fd){logger['error'](_0x26c8fd[_0x6504('0x21')]);if(_0x26c8fd[_0x6504('0x22')]){delete _0x26c8fd[_0x6504('0x22')];}_0x3f42e5[_0x6504('0x15')](_0x5bbeb7)[_0x6504('0x23')](_0x26c8fd);};}exports[_0x6504('0x24')]=function(_0x470bfe,_0x9ec169){var _0x24d0bb={},_0x1f59f2={},_0x185240={'count':0x0,'rows':[]};var _0x18777f=_[_0x6504('0x25')](db[_0x6504('0x26')][_0x6504('0x27')],function(_0xf1a4d){return{'name':_0xf1a4d[_0x6504('0x28')],'type':_0xf1a4d[_0x6504('0x29')][_0x6504('0x2a')]};});_0x1f59f2['model']=_[_0x6504('0x25')](_0x18777f,_0x6504('0x22'));_0x1f59f2[_0x6504('0x2b')]=_[_0x6504('0x2c')](_0x470bfe['query']);_0x1f59f2[_0x6504('0x2d')]=_['intersection'](_0x1f59f2['model'],_0x1f59f2['query']);_0x24d0bb['attributes']=_[_0x6504('0x2e')](_0x1f59f2['model'],qs[_0x6504('0x2f')](_0x470bfe[_0x6504('0x2b')][_0x6504('0x2f')]));_0x24d0bb[_0x6504('0x30')]=_0x24d0bb[_0x6504('0x30')]['length']?_0x24d0bb[_0x6504('0x30')]:_0x1f59f2[_0x6504('0x31')];if(!_0x470bfe['query'][_0x6504('0x32')](_0x6504('0x33'))){_0x24d0bb[_0x6504('0x18')]=qs[_0x6504('0x18')](_0x470bfe['query'][_0x6504('0x18')]);_0x24d0bb[_0x6504('0x17')]=qs[_0x6504('0x17')](_0x470bfe[_0x6504('0x2b')][_0x6504('0x17')]);}_0x24d0bb[_0x6504('0x34')]=qs[_0x6504('0x35')](_0x470bfe[_0x6504('0x2b')]['sort']);_0x24d0bb[_0x6504('0x36')]=qs['filters'](_[_0x6504('0x37')](_0x470bfe[_0x6504('0x2b')],_0x1f59f2[_0x6504('0x2d')]),_0x18777f);if(_0x470bfe[_0x6504('0x2b')]['filter']){_0x24d0bb[_0x6504('0x36')]=_[_0x6504('0x38')](_0x24d0bb[_0x6504('0x36')],{'$or':_[_0x6504('0x25')](_0x18777f,function(_0x46836b){if(_0x46836b[_0x6504('0x29')]!==_0x6504('0x39')){var _0x353071={};_0x353071[_0x46836b[_0x6504('0x22')]]={'$like':'%'+_0x470bfe[_0x6504('0x2b')][_0x6504('0x3a')]+'%'};return _0x353071;}})});}_0x24d0bb=_['merge']({},_0x24d0bb,_0x470bfe[_0x6504('0x3b')]);var _0x2499b1={'where':_0x24d0bb[_0x6504('0x36')]};return db[_0x6504('0x26')][_0x6504('0x19')](_0x2499b1)[_0x6504('0x3c')](function(_0x2c53dc){_0x185240[_0x6504('0x19')]=_0x2c53dc;if(_0x470bfe['query'][_0x6504('0x3d')]){_0x24d0bb[_0x6504('0x3e')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x6504('0x3f')](_0x24d0bb);})[_0x6504('0x3c')](function(_0x4cb899){_0x185240[_0x6504('0x40')]=_0x4cb899;return _0x185240;})[_0x6504('0x3c')](respondWithFilteredResult(_0x9ec169,_0x24d0bb))['catch'](handleError(_0x9ec169,null));};exports[_0x6504('0x41')]=function(_0x237d60,_0x5d1cb6){var _0x70afdd={'raw':![],'where':{'id':_0x237d60[_0x6504('0x42')]['id']}},_0x43acb9={};_0x43acb9['model']=_[_0x6504('0x2c')](db[_0x6504('0x26')]['rawAttributes']);_0x43acb9['query']=_[_0x6504('0x2c')](_0x237d60[_0x6504('0x2b')]);_0x43acb9['filters']=_[_0x6504('0x2e')](_0x43acb9[_0x6504('0x31')],_0x43acb9[_0x6504('0x2b')]);_0x70afdd[_0x6504('0x30')]=_[_0x6504('0x2e')](_0x43acb9[_0x6504('0x31')],qs['fields'](_0x237d60[_0x6504('0x2b')][_0x6504('0x2f')]));_0x70afdd['attributes']=_0x70afdd[_0x6504('0x30')][_0x6504('0x43')]?_0x70afdd[_0x6504('0x30')]:_0x43acb9[_0x6504('0x31')];if(_0x237d60[_0x6504('0x2b')][_0x6504('0x3d')]){_0x70afdd['include']=[{'all':!![]}];}_0x70afdd=_['merge']({},_0x70afdd,_0x237d60[_0x6504('0x3b')]);return db['FreshdeskConfiguration'][_0x6504('0x44')](_0x70afdd)[_0x6504('0x3c')](handleEntityNotFound(_0x5d1cb6,null))[_0x6504('0x3c')](respondWithResult(_0x5d1cb6,null))[_0x6504('0x45')](handleError(_0x5d1cb6,null));};exports['create']=function(_0x57be8d,_0x2f5e6e){return db['FreshdeskConfiguration'][_0x6504('0x46')](_0x57be8d[_0x6504('0x47')],{})[_0x6504('0x3c')](respondWithResult(_0x2f5e6e,0xc9))[_0x6504('0x45')](handleError(_0x2f5e6e,null));};exports[_0x6504('0x1f')]=function(_0x306a0c,_0x46deb){if(_0x306a0c[_0x6504('0x47')]['id']){delete _0x306a0c[_0x6504('0x47')]['id'];}return db[_0x6504('0x26')][_0x6504('0x44')]({'where':{'id':_0x306a0c[_0x6504('0x42')]['id']}})[_0x6504('0x3c')](handleEntityNotFound(_0x46deb,null))[_0x6504('0x3c')](saveUpdates(_0x306a0c[_0x6504('0x47')],null))[_0x6504('0x3c')](respondWithResult(_0x46deb,null))['catch'](handleError(_0x46deb,null));};exports['destroy']=function(_0x9f58c0,_0x526057){return db[_0x6504('0x26')][_0x6504('0x44')]({'where':{'id':_0x9f58c0[_0x6504('0x42')]['id']}})[_0x6504('0x3c')](handleEntityNotFound(_0x526057,null))[_0x6504('0x3c')](removeEntity(_0x526057,null))['catch'](handleError(_0x526057,null));};exports[_0x6504('0x48')]=function(_0x66c685,_0xa1db87,_0x477983){var _0x3233a8={};var _0x92cb89={};var _0x11c3fb;var _0x22820a;return db['FreshdeskConfiguration'][_0x6504('0x49')]({'where':{'id':_0x66c685[_0x6504('0x42')]['id']}})['then'](handleEntityNotFound(_0xa1db87,null))[_0x6504('0x3c')](function(_0x25d3f6){if(_0x25d3f6){_0x11c3fb=_0x25d3f6;_0x92cb89[_0x6504('0x31')]=_[_0x6504('0x2c')](db[_0x6504('0x4a')][_0x6504('0x27')]);_0x92cb89[_0x6504('0x2b')]=_[_0x6504('0x2c')](_0x66c685[_0x6504('0x2b')]);_0x92cb89[_0x6504('0x2d')]=_[_0x6504('0x2e')](_0x92cb89[_0x6504('0x31')],_0x92cb89[_0x6504('0x2b')]);_0x3233a8['attributes']=_['intersection'](_0x92cb89[_0x6504('0x31')],qs[_0x6504('0x2f')](_0x66c685['query'][_0x6504('0x2f')]));_0x3233a8[_0x6504('0x30')]=_0x3233a8[_0x6504('0x30')][_0x6504('0x43')]?_0x3233a8[_0x6504('0x30')]:_0x92cb89[_0x6504('0x31')];_0x3233a8[_0x6504('0x34')]=qs['sort'](_0x66c685[_0x6504('0x2b')][_0x6504('0x35')]);_0x3233a8[_0x6504('0x36')]=qs[_0x6504('0x2d')](_[_0x6504('0x37')](_0x66c685['query'],_0x92cb89[_0x6504('0x2d')]));if(_0x66c685[_0x6504('0x2b')][_0x6504('0x3a')]){_0x3233a8[_0x6504('0x36')]=_[_0x6504('0x38')](_0x3233a8['where'],{'$or':_[_0x6504('0x25')](_0x3233a8['attributes'],function(_0xf0f7e3){var _0x3e7e3a={};_0x3e7e3a[_0xf0f7e3]={'$like':'%'+_0x66c685['query']['filter']+'%'};return _0x3e7e3a;})});}_0x3233a8=_[_0x6504('0x38')]({},_0x3233a8,_0x66c685['options']);return _0x11c3fb[_0x6504('0x48')](_0x3233a8);}})[_0x6504('0x3c')](function(_0x2250c4){if(_0x2250c4){_0x22820a=_0x2250c4['length'];if(!_0x66c685[_0x6504('0x2b')][_0x6504('0x32')]('nolimit')){_0x3233a8[_0x6504('0x18')]=qs[_0x6504('0x18')](_0x66c685[_0x6504('0x2b')][_0x6504('0x18')]);_0x3233a8[_0x6504('0x17')]=qs[_0x6504('0x17')](_0x66c685[_0x6504('0x2b')][_0x6504('0x17')]);}return _0x11c3fb['getFields'](_0x3233a8);}})[_0x6504('0x3c')](function(_0x17791d){if(_0x17791d){return _0x17791d?{'count':_0x22820a,'rows':_0x17791d}:null;}})[_0x6504('0x3c')](respondWithResult(_0xa1db87,null))['catch'](handleError(_0xa1db87,null));};exports[_0x6504('0x4b')]=function(_0x3121c2,_0x5a657a,_0x48215c){var _0x4976d0={};var _0x60f43c={};var _0x50a03;var _0x3f206b;return db[_0x6504('0x26')][_0x6504('0x49')]({'where':{'id':_0x3121c2['params']['id']}})[_0x6504('0x3c')](handleEntityNotFound(_0x5a657a,null))[_0x6504('0x3c')](function(_0x2ea598){if(_0x2ea598){_0x50a03=_0x2ea598;_0x60f43c[_0x6504('0x31')]=_['keys'](db[_0x6504('0x4a')][_0x6504('0x27')]);_0x60f43c['query']=_[_0x6504('0x2c')](_0x3121c2[_0x6504('0x2b')]);_0x60f43c['filters']=_['intersection'](_0x60f43c[_0x6504('0x31')],_0x60f43c[_0x6504('0x2b')]);_0x4976d0[_0x6504('0x30')]=_['intersection'](_0x60f43c[_0x6504('0x31')],qs[_0x6504('0x2f')](_0x3121c2['query'][_0x6504('0x2f')]));_0x4976d0[_0x6504('0x30')]=_0x4976d0[_0x6504('0x30')]['length']?_0x4976d0[_0x6504('0x30')]:_0x60f43c[_0x6504('0x31')];_0x4976d0[_0x6504('0x34')]=qs[_0x6504('0x35')](_0x3121c2[_0x6504('0x2b')][_0x6504('0x35')]);_0x4976d0[_0x6504('0x36')]=qs[_0x6504('0x2d')](_['pick'](_0x3121c2[_0x6504('0x2b')],_0x60f43c[_0x6504('0x2d')]));if(_0x3121c2[_0x6504('0x2b')][_0x6504('0x3a')]){_0x4976d0[_0x6504('0x36')]=_[_0x6504('0x38')](_0x4976d0[_0x6504('0x36')],{'$or':_[_0x6504('0x25')](_0x4976d0[_0x6504('0x30')],function(_0x4d130e){var _0x290b5b={};_0x290b5b[_0x4d130e]={'$like':'%'+_0x3121c2[_0x6504('0x2b')][_0x6504('0x3a')]+'%'};return _0x290b5b;})});}_0x4976d0=_['merge']({},_0x4976d0,_0x3121c2['options']);return _0x50a03[_0x6504('0x4b')](_0x4976d0);}})['then'](function(_0x5d528b){if(_0x5d528b){_0x3f206b=_0x5d528b[_0x6504('0x43')];if(!_0x3121c2[_0x6504('0x2b')][_0x6504('0x32')](_0x6504('0x33'))){_0x4976d0[_0x6504('0x18')]=qs[_0x6504('0x18')](_0x3121c2['query']['limit']);_0x4976d0['offset']=qs[_0x6504('0x17')](_0x3121c2[_0x6504('0x2b')][_0x6504('0x17')]);}return _0x50a03[_0x6504('0x4b')](_0x4976d0);}})['then'](function(_0x29b6ac){if(_0x29b6ac){return _0x29b6ac?{'count':_0x3f206b,'rows':_0x29b6ac}:null;}})['then'](respondWithResult(_0x5a657a,null))[_0x6504('0x45')](handleError(_0x5a657a,null));};exports[_0x6504('0x4c')]=function(_0x5c8de3,_0x5ae271,_0x4478b8){var _0x1c521d={};var _0x312732={};var _0xbe2b7;var _0x50d342;return db['FreshdeskConfiguration'][_0x6504('0x49')]({'where':{'id':_0x5c8de3[_0x6504('0x42')]['id']}})[_0x6504('0x3c')](handleEntityNotFound(_0x5ae271,null))[_0x6504('0x3c')](function(_0x379320){if(_0x379320){_0xbe2b7=_0x379320;_0x312732[_0x6504('0x31')]=_[_0x6504('0x2c')](db[_0x6504('0x4a')][_0x6504('0x27')]);_0x312732[_0x6504('0x2b')]=_[_0x6504('0x2c')](_0x5c8de3[_0x6504('0x2b')]);_0x312732[_0x6504('0x2d')]=_[_0x6504('0x2e')](_0x312732[_0x6504('0x31')],_0x312732['query']);_0x1c521d[_0x6504('0x30')]=_['intersection'](_0x312732['model'],qs[_0x6504('0x2f')](_0x5c8de3[_0x6504('0x2b')][_0x6504('0x2f')]));_0x1c521d[_0x6504('0x30')]=_0x1c521d[_0x6504('0x30')]['length']?_0x1c521d[_0x6504('0x30')]:_0x312732[_0x6504('0x31')];_0x1c521d[_0x6504('0x34')]=qs[_0x6504('0x35')](_0x5c8de3[_0x6504('0x2b')][_0x6504('0x35')]);_0x1c521d[_0x6504('0x36')]=qs[_0x6504('0x2d')](_[_0x6504('0x37')](_0x5c8de3[_0x6504('0x2b')],_0x312732['filters']));if(_0x5c8de3['query'][_0x6504('0x3a')]){_0x1c521d['where']=_[_0x6504('0x38')](_0x1c521d['where'],{'$or':_['map'](_0x1c521d[_0x6504('0x30')],function(_0x5362b4){var _0xba542={};_0xba542[_0x5362b4]={'$like':'%'+_0x5c8de3[_0x6504('0x2b')][_0x6504('0x3a')]+'%'};return _0xba542;})});}_0x1c521d=_[_0x6504('0x38')]({},_0x1c521d,_0x5c8de3[_0x6504('0x3b')]);return _0xbe2b7[_0x6504('0x4c')](_0x1c521d);}})[_0x6504('0x3c')](function(_0x3ee481){if(_0x3ee481){_0x50d342=_0x3ee481['length'];if(!_0x5c8de3[_0x6504('0x2b')][_0x6504('0x32')](_0x6504('0x33'))){_0x1c521d[_0x6504('0x18')]=qs[_0x6504('0x18')](_0x5c8de3[_0x6504('0x2b')][_0x6504('0x18')]);_0x1c521d['offset']=qs[_0x6504('0x17')](_0x5c8de3[_0x6504('0x2b')][_0x6504('0x17')]);}return _0xbe2b7[_0x6504('0x4c')](_0x1c521d);}})[_0x6504('0x3c')](function(_0x701ca8){if(_0x701ca8){return _0x701ca8?{'count':_0x50d342,'rows':_0x701ca8}:null;}})[_0x6504('0x3c')](respondWithResult(_0x5ae271,null))['catch'](handleError(_0x5ae271,null));};exports[_0x6504('0x4d')]=function(_0x1eb2b4,_0x9594cc,_0x368b84){var _0x353391={};var _0x42bf87={};var _0x3c75da;var _0x299f5c;return db['FreshdeskConfiguration'][_0x6504('0x49')]({'where':{'id':_0x1eb2b4[_0x6504('0x42')]['id']}})[_0x6504('0x3c')](handleEntityNotFound(_0x9594cc,null))[_0x6504('0x3c')](function(_0x3d1cb3){if(_0x3d1cb3){_0x3c75da=_0x3d1cb3;_0x42bf87[_0x6504('0x31')]=_[_0x6504('0x2c')](db[_0x6504('0x4e')]['rawAttributes']);_0x42bf87[_0x6504('0x2b')]=_[_0x6504('0x2c')](_0x1eb2b4[_0x6504('0x2b')]);_0x42bf87[_0x6504('0x2d')]=_[_0x6504('0x2e')](_0x42bf87['model'],_0x42bf87[_0x6504('0x2b')]);_0x353391['attributes']=_[_0x6504('0x2e')](_0x42bf87['model'],qs['fields'](_0x1eb2b4[_0x6504('0x2b')]['fields']));_0x353391[_0x6504('0x30')]=_0x353391['attributes'][_0x6504('0x43')]?_0x353391[_0x6504('0x30')]:_0x42bf87[_0x6504('0x31')];_0x353391['order']=qs[_0x6504('0x35')](_0x1eb2b4[_0x6504('0x2b')][_0x6504('0x35')]);_0x353391[_0x6504('0x36')]=qs[_0x6504('0x2d')](_[_0x6504('0x37')](_0x1eb2b4['query'],_0x42bf87[_0x6504('0x2d')]));if(_0x1eb2b4[_0x6504('0x2b')]['filter']){_0x353391['where']=_[_0x6504('0x38')](_0x353391['where'],{'$or':_[_0x6504('0x25')](_0x353391[_0x6504('0x30')],function(_0x101e6b){var _0x54fd1c={};_0x54fd1c[_0x101e6b]={'$like':'%'+_0x1eb2b4[_0x6504('0x2b')][_0x6504('0x3a')]+'%'};return _0x54fd1c;})});}_0x353391=_[_0x6504('0x38')]({},_0x353391,_0x1eb2b4['options']);return _0x3c75da[_0x6504('0x4d')](_0x353391);}})[_0x6504('0x3c')](function(_0x50eb26){if(_0x50eb26){_0x299f5c=_0x50eb26[_0x6504('0x43')];if(!_0x1eb2b4[_0x6504('0x2b')][_0x6504('0x32')](_0x6504('0x33'))){_0x353391[_0x6504('0x18')]=qs[_0x6504('0x18')](_0x1eb2b4[_0x6504('0x2b')][_0x6504('0x18')]);_0x353391['offset']=qs['offset'](_0x1eb2b4[_0x6504('0x2b')][_0x6504('0x17')]);}return _0x3c75da[_0x6504('0x4d')](_0x353391);}})['then'](function(_0x56af27){if(_0x56af27){return _0x56af27?{'count':_0x299f5c,'rows':_0x56af27}:null;}})[_0x6504('0x3c')](respondWithResult(_0x9594cc,null))[_0x6504('0x45')](handleError(_0x9594cc,null));};exports[_0x6504('0x4f')]=function(_0x1b3524,_0x5204b2,_0x4d0daf){if(_0x1b3524[_0x6504('0x47')]['id']){delete _0x1b3524[_0x6504('0x47')]['id'];}return db[_0x6504('0x26')][_0x6504('0x49')]({'where':{'id':_0x1b3524[_0x6504('0x42')]['id']}})[_0x6504('0x3c')](handleEntityNotFound(_0x5204b2,null))['then'](function(_0x34d0da){if(_0x34d0da){return _0x34d0da['setTags'](_0x1b3524[_0x6504('0x47')][_0x6504('0x50')]||[]);}return null;})['then'](respondWithResult(_0x5204b2,null))[_0x6504('0x45')](handleError(_0x5204b2,null));}; \ No newline at end of file +var _0x3100=['api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','FreshdeskConfiguration','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','where','merge','VIRTUAL','options','include','findAll','show','rawAttributes','find','create','body','catch','params','findOne','FreshdeskField','hasOwnProperty','getFields','getSubjects','pick','getDescriptions','getTags','Tag','setTags','ids','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x14588b,_0x24c2fa){var _0x4eaf87=function(_0x2e7e20){while(--_0x2e7e20){_0x14588b['push'](_0x14588b['shift']());}};_0x4eaf87(++_0x24c2fa);}(_0x3100,0x96));var _0x0310=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3100[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x0310('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0310('0x1'));var rp=require(_0x0310('0x2'));var moment=require(_0x0310('0x3'));var BPromise=require(_0x0310('0x4'));var Mustache=require(_0x0310('0x5'));var util=require(_0x0310('0x6'));var path=require('path');var sox=require(_0x0310('0x7'));var csv=require(_0x0310('0x8'));var ejs=require(_0x0310('0x9'));var fs=require('fs');var fs_extra=require(_0x0310('0xa'));var _=require(_0x0310('0xb'));var squel=require('squel');var crypto=require(_0x0310('0xc'));var jsforce=require(_0x0310('0xd'));var deskjs=require(_0x0310('0xe'));var toCsv=require(_0x0310('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0310('0xf'));var authService=require(_0x0310('0x10'));var qs=require(_0x0310('0x11'));var as=require(_0x0310('0x12'));var hardwareService=require(_0x0310('0x13'));var logger=require('../../config/logger')(_0x0310('0x14'));var utils=require(_0x0310('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x0310('0x16'));var db=require(_0x0310('0x17'))['db'];function respondWithStatusCode(_0x3b561a,_0x37fa47){_0x37fa47=_0x37fa47||0xcc;return function(_0x32c1c4){if(_0x32c1c4){return _0x3b561a[_0x0310('0x18')](_0x37fa47);}return _0x3b561a[_0x0310('0x19')](_0x37fa47)[_0x0310('0x1a')]();};}function respondWithResult(_0x16ade8,_0x52a26b){_0x52a26b=_0x52a26b||0xc8;return function(_0x54d102){if(_0x54d102){return _0x16ade8[_0x0310('0x19')](_0x52a26b)[_0x0310('0x1b')](_0x54d102);}};}function respondWithFilteredResult(_0x456625,_0x22dc68){return function(_0x275c1f){if(_0x275c1f){var _0x53c44c=typeof _0x22dc68[_0x0310('0x1c')]===_0x0310('0x1d')&&typeof _0x22dc68[_0x0310('0x1e')]===_0x0310('0x1d');var _0x34772b=_0x275c1f[_0x0310('0x1f')];var _0x45b16e=_0x53c44c?0x0:_0x22dc68[_0x0310('0x1c')];var _0x3017c9=_0x53c44c?_0x275c1f[_0x0310('0x1f')]:_0x22dc68['offset']+_0x22dc68[_0x0310('0x1e')];var _0x8d61d1;if(_0x3017c9>=_0x34772b){_0x3017c9=_0x34772b;_0x8d61d1=0xc8;}else{_0x8d61d1=0xce;}_0x456625[_0x0310('0x19')](_0x8d61d1);return _0x456625[_0x0310('0x20')](_0x0310('0x21'),_0x45b16e+'-'+_0x3017c9+'/'+_0x34772b)['json'](_0x275c1f);}return null;};}function patchUpdates(_0x40943e){return function(_0x7f3f19){try{jsonpatch[_0x0310('0x22')](_0x7f3f19,_0x40943e,!![]);}catch(_0x273fb4){return BPromise[_0x0310('0x23')](_0x273fb4);}return _0x7f3f19[_0x0310('0x24')]();};}function saveUpdates(_0xcdb5c2,_0x273591){return function(_0x595d77){if(_0x595d77){return _0x595d77[_0x0310('0x25')](_0xcdb5c2)[_0x0310('0x26')](function(_0x4b0063){return _0x4b0063;});}return null;};}function removeEntity(_0x4bc09b,_0x2a15a8){return function(_0x5220bb){if(_0x5220bb){return _0x5220bb[_0x0310('0x27')]()[_0x0310('0x26')](function(){_0x4bc09b[_0x0310('0x19')](0xcc)[_0x0310('0x1a')]();});}};}function handleEntityNotFound(_0x4b853e,_0x1e1247){return function(_0x5f0f4c){if(!_0x5f0f4c){_0x4b853e[_0x0310('0x18')](0x194);}return _0x5f0f4c;};}function handleError(_0x14c899,_0x34ad55){_0x34ad55=_0x34ad55||0x1f4;return function(_0x39b4a9){logger[_0x0310('0x28')](_0x39b4a9[_0x0310('0x29')]);if(_0x39b4a9[_0x0310('0x2a')]){delete _0x39b4a9['name'];}_0x14c899[_0x0310('0x19')](_0x34ad55)['send'](_0x39b4a9);};}exports[_0x0310('0x2b')]=function(_0x4cc616,_0x39c3b5){var _0xf79bf3={},_0x5da8c3={},_0x43080f={'count':0x0,'rows':[]};var _0x19fb50=_[_0x0310('0x2c')](db[_0x0310('0x2d')]['rawAttributes'],function(_0x120eae){return{'name':_0x120eae[_0x0310('0x2e')],'type':_0x120eae[_0x0310('0x2f')][_0x0310('0x30')]};});_0x5da8c3[_0x0310('0x31')]=_['map'](_0x19fb50,_0x0310('0x2a'));_0x5da8c3['query']=_[_0x0310('0x32')](_0x4cc616[_0x0310('0x33')]);_0x5da8c3[_0x0310('0x34')]=_[_0x0310('0x35')](_0x5da8c3['model'],_0x5da8c3[_0x0310('0x33')]);_0xf79bf3[_0x0310('0x36')]=_[_0x0310('0x35')](_0x5da8c3[_0x0310('0x31')],qs['fields'](_0x4cc616[_0x0310('0x33')][_0x0310('0x37')]));_0xf79bf3['attributes']=_0xf79bf3[_0x0310('0x36')][_0x0310('0x38')]?_0xf79bf3['attributes']:_0x5da8c3[_0x0310('0x31')];if(!_0x4cc616[_0x0310('0x33')]['hasOwnProperty'](_0x0310('0x39'))){_0xf79bf3[_0x0310('0x1e')]=qs[_0x0310('0x1e')](_0x4cc616[_0x0310('0x33')][_0x0310('0x1e')]);_0xf79bf3[_0x0310('0x1c')]=qs[_0x0310('0x1c')](_0x4cc616[_0x0310('0x33')][_0x0310('0x1c')]);}_0xf79bf3[_0x0310('0x3a')]=qs[_0x0310('0x3b')](_0x4cc616[_0x0310('0x33')]['sort']);_0xf79bf3['where']=qs['filters'](_['pick'](_0x4cc616[_0x0310('0x33')],_0x5da8c3['filters']),_0x19fb50);if(_0x4cc616['query'][_0x0310('0x3c')]){_0xf79bf3[_0x0310('0x3d')]=_[_0x0310('0x3e')](_0xf79bf3[_0x0310('0x3d')],{'$or':_['map'](_0x19fb50,function(_0x45d3f4){if(_0x45d3f4[_0x0310('0x2f')]!==_0x0310('0x3f')){var _0x28bf3e={};_0x28bf3e[_0x45d3f4['name']]={'$like':'%'+_0x4cc616[_0x0310('0x33')]['filter']+'%'};return _0x28bf3e;}})});}_0xf79bf3=_[_0x0310('0x3e')]({},_0xf79bf3,_0x4cc616[_0x0310('0x40')]);var _0x43782c={'where':_0xf79bf3[_0x0310('0x3d')]};return db[_0x0310('0x2d')]['count'](_0x43782c)[_0x0310('0x26')](function(_0x127f26){_0x43080f[_0x0310('0x1f')]=_0x127f26;if(_0x4cc616[_0x0310('0x33')]['includeAll']){_0xf79bf3[_0x0310('0x41')]=[{'all':!![]}];}return db[_0x0310('0x2d')][_0x0310('0x42')](_0xf79bf3);})['then'](function(_0x484cd7){_0x43080f['rows']=_0x484cd7;return _0x43080f;})[_0x0310('0x26')](respondWithFilteredResult(_0x39c3b5,_0xf79bf3))['catch'](handleError(_0x39c3b5,null));};exports[_0x0310('0x43')]=function(_0x1f3a3a,_0x454b77){var _0x4f85bc={'raw':![],'where':{'id':_0x1f3a3a['params']['id']}},_0x361fe2={};_0x361fe2['model']=_['keys'](db[_0x0310('0x2d')][_0x0310('0x44')]);_0x361fe2[_0x0310('0x33')]=_['keys'](_0x1f3a3a['query']);_0x361fe2['filters']=_[_0x0310('0x35')](_0x361fe2[_0x0310('0x31')],_0x361fe2['query']);_0x4f85bc[_0x0310('0x36')]=_[_0x0310('0x35')](_0x361fe2[_0x0310('0x31')],qs[_0x0310('0x37')](_0x1f3a3a[_0x0310('0x33')][_0x0310('0x37')]));_0x4f85bc[_0x0310('0x36')]=_0x4f85bc[_0x0310('0x36')][_0x0310('0x38')]?_0x4f85bc[_0x0310('0x36')]:_0x361fe2['model'];if(_0x1f3a3a['query']['includeAll']){_0x4f85bc[_0x0310('0x41')]=[{'all':!![]}];}_0x4f85bc=_[_0x0310('0x3e')]({},_0x4f85bc,_0x1f3a3a[_0x0310('0x40')]);return db[_0x0310('0x2d')][_0x0310('0x45')](_0x4f85bc)['then'](handleEntityNotFound(_0x454b77,null))[_0x0310('0x26')](respondWithResult(_0x454b77,null))['catch'](handleError(_0x454b77,null));};exports[_0x0310('0x46')]=function(_0xe8d90c,_0x19b6ac){return db[_0x0310('0x2d')]['create'](_0xe8d90c[_0x0310('0x47')],{})[_0x0310('0x26')](respondWithResult(_0x19b6ac,0xc9))[_0x0310('0x48')](handleError(_0x19b6ac,null));};exports[_0x0310('0x25')]=function(_0x42011b,_0x300f46){if(_0x42011b[_0x0310('0x47')]['id']){delete _0x42011b['body']['id'];}return db['FreshdeskConfiguration'][_0x0310('0x45')]({'where':{'id':_0x42011b[_0x0310('0x49')]['id']}})[_0x0310('0x26')](handleEntityNotFound(_0x300f46,null))[_0x0310('0x26')](saveUpdates(_0x42011b['body'],null))[_0x0310('0x26')](respondWithResult(_0x300f46,null))[_0x0310('0x48')](handleError(_0x300f46,null));};exports[_0x0310('0x27')]=function(_0x2eacd6,_0x19843d){return db['FreshdeskConfiguration'][_0x0310('0x45')]({'where':{'id':_0x2eacd6[_0x0310('0x49')]['id']}})[_0x0310('0x26')](handleEntityNotFound(_0x19843d,null))[_0x0310('0x26')](removeEntity(_0x19843d,null))[_0x0310('0x48')](handleError(_0x19843d,null));};exports['getFields']=function(_0x2ebcab,_0x3ecbb6,_0x2ac544){var _0x524e3a={};var _0x180393={};var _0x57cd3b;var _0x119106;return db[_0x0310('0x2d')][_0x0310('0x4a')]({'where':{'id':_0x2ebcab[_0x0310('0x49')]['id']}})[_0x0310('0x26')](handleEntityNotFound(_0x3ecbb6,null))[_0x0310('0x26')](function(_0x531233){if(_0x531233){_0x57cd3b=_0x531233;_0x180393[_0x0310('0x31')]=_[_0x0310('0x32')](db[_0x0310('0x4b')][_0x0310('0x44')]);_0x180393[_0x0310('0x33')]=_[_0x0310('0x32')](_0x2ebcab[_0x0310('0x33')]);_0x180393[_0x0310('0x34')]=_[_0x0310('0x35')](_0x180393['model'],_0x180393[_0x0310('0x33')]);_0x524e3a[_0x0310('0x36')]=_['intersection'](_0x180393[_0x0310('0x31')],qs[_0x0310('0x37')](_0x2ebcab['query']['fields']));_0x524e3a[_0x0310('0x36')]=_0x524e3a[_0x0310('0x36')][_0x0310('0x38')]?_0x524e3a[_0x0310('0x36')]:_0x180393[_0x0310('0x31')];_0x524e3a[_0x0310('0x3a')]=qs[_0x0310('0x3b')](_0x2ebcab[_0x0310('0x33')]['sort']);_0x524e3a[_0x0310('0x3d')]=qs[_0x0310('0x34')](_['pick'](_0x2ebcab[_0x0310('0x33')],_0x180393[_0x0310('0x34')]));if(_0x2ebcab[_0x0310('0x33')][_0x0310('0x3c')]){_0x524e3a[_0x0310('0x3d')]=_[_0x0310('0x3e')](_0x524e3a['where'],{'$or':_[_0x0310('0x2c')](_0x524e3a['attributes'],function(_0x27e212){var _0x34b772={};_0x34b772[_0x27e212]={'$like':'%'+_0x2ebcab['query'][_0x0310('0x3c')]+'%'};return _0x34b772;})});}_0x524e3a=_[_0x0310('0x3e')]({},_0x524e3a,_0x2ebcab[_0x0310('0x40')]);return _0x57cd3b['getFields'](_0x524e3a);}})['then'](function(_0x16febc){if(_0x16febc){_0x119106=_0x16febc[_0x0310('0x38')];if(!_0x2ebcab[_0x0310('0x33')][_0x0310('0x4c')](_0x0310('0x39'))){_0x524e3a[_0x0310('0x1e')]=qs[_0x0310('0x1e')](_0x2ebcab[_0x0310('0x33')][_0x0310('0x1e')]);_0x524e3a['offset']=qs[_0x0310('0x1c')](_0x2ebcab[_0x0310('0x33')][_0x0310('0x1c')]);}return _0x57cd3b[_0x0310('0x4d')](_0x524e3a);}})[_0x0310('0x26')](function(_0x423c0a){if(_0x423c0a){return _0x423c0a?{'count':_0x119106,'rows':_0x423c0a}:null;}})[_0x0310('0x26')](respondWithResult(_0x3ecbb6,null))[_0x0310('0x48')](handleError(_0x3ecbb6,null));};exports[_0x0310('0x4e')]=function(_0x2b6fd0,_0x42d124,_0x28b745){var _0x2d90b1={};var _0x51a07c={};var _0x328021;var _0x10104e;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x2b6fd0[_0x0310('0x49')]['id']}})['then'](handleEntityNotFound(_0x42d124,null))[_0x0310('0x26')](function(_0x7a5399){if(_0x7a5399){_0x328021=_0x7a5399;_0x51a07c[_0x0310('0x31')]=_[_0x0310('0x32')](db['FreshdeskField'][_0x0310('0x44')]);_0x51a07c[_0x0310('0x33')]=_[_0x0310('0x32')](_0x2b6fd0[_0x0310('0x33')]);_0x51a07c[_0x0310('0x34')]=_[_0x0310('0x35')](_0x51a07c[_0x0310('0x31')],_0x51a07c[_0x0310('0x33')]);_0x2d90b1['attributes']=_[_0x0310('0x35')](_0x51a07c[_0x0310('0x31')],qs['fields'](_0x2b6fd0['query'][_0x0310('0x37')]));_0x2d90b1[_0x0310('0x36')]=_0x2d90b1['attributes'][_0x0310('0x38')]?_0x2d90b1[_0x0310('0x36')]:_0x51a07c[_0x0310('0x31')];_0x2d90b1['order']=qs[_0x0310('0x3b')](_0x2b6fd0['query'][_0x0310('0x3b')]);_0x2d90b1[_0x0310('0x3d')]=qs[_0x0310('0x34')](_[_0x0310('0x4f')](_0x2b6fd0[_0x0310('0x33')],_0x51a07c[_0x0310('0x34')]));if(_0x2b6fd0[_0x0310('0x33')]['filter']){_0x2d90b1[_0x0310('0x3d')]=_['merge'](_0x2d90b1[_0x0310('0x3d')],{'$or':_[_0x0310('0x2c')](_0x2d90b1[_0x0310('0x36')],function(_0x1952f3){var _0x143d97={};_0x143d97[_0x1952f3]={'$like':'%'+_0x2b6fd0[_0x0310('0x33')]['filter']+'%'};return _0x143d97;})});}_0x2d90b1=_[_0x0310('0x3e')]({},_0x2d90b1,_0x2b6fd0[_0x0310('0x40')]);return _0x328021[_0x0310('0x4e')](_0x2d90b1);}})[_0x0310('0x26')](function(_0x2f7685){if(_0x2f7685){_0x10104e=_0x2f7685[_0x0310('0x38')];if(!_0x2b6fd0[_0x0310('0x33')][_0x0310('0x4c')]('nolimit')){_0x2d90b1['limit']=qs[_0x0310('0x1e')](_0x2b6fd0[_0x0310('0x33')][_0x0310('0x1e')]);_0x2d90b1[_0x0310('0x1c')]=qs[_0x0310('0x1c')](_0x2b6fd0[_0x0310('0x33')]['offset']);}return _0x328021[_0x0310('0x4e')](_0x2d90b1);}})[_0x0310('0x26')](function(_0x50ff48){if(_0x50ff48){return _0x50ff48?{'count':_0x10104e,'rows':_0x50ff48}:null;}})['then'](respondWithResult(_0x42d124,null))[_0x0310('0x48')](handleError(_0x42d124,null));};exports[_0x0310('0x50')]=function(_0x24b0bf,_0x4735c0,_0x2e9ef0){var _0x31525f={};var _0x389980={};var _0x35e92d;var _0x4111fd;return db[_0x0310('0x2d')][_0x0310('0x4a')]({'where':{'id':_0x24b0bf[_0x0310('0x49')]['id']}})['then'](handleEntityNotFound(_0x4735c0,null))[_0x0310('0x26')](function(_0x41e3ed){if(_0x41e3ed){_0x35e92d=_0x41e3ed;_0x389980[_0x0310('0x31')]=_[_0x0310('0x32')](db[_0x0310('0x4b')]['rawAttributes']);_0x389980['query']=_[_0x0310('0x32')](_0x24b0bf[_0x0310('0x33')]);_0x389980[_0x0310('0x34')]=_[_0x0310('0x35')](_0x389980[_0x0310('0x31')],_0x389980[_0x0310('0x33')]);_0x31525f[_0x0310('0x36')]=_[_0x0310('0x35')](_0x389980[_0x0310('0x31')],qs[_0x0310('0x37')](_0x24b0bf[_0x0310('0x33')][_0x0310('0x37')]));_0x31525f['attributes']=_0x31525f['attributes']['length']?_0x31525f[_0x0310('0x36')]:_0x389980[_0x0310('0x31')];_0x31525f[_0x0310('0x3a')]=qs[_0x0310('0x3b')](_0x24b0bf[_0x0310('0x33')][_0x0310('0x3b')]);_0x31525f[_0x0310('0x3d')]=qs['filters'](_[_0x0310('0x4f')](_0x24b0bf['query'],_0x389980[_0x0310('0x34')]));if(_0x24b0bf[_0x0310('0x33')][_0x0310('0x3c')]){_0x31525f[_0x0310('0x3d')]=_[_0x0310('0x3e')](_0x31525f['where'],{'$or':_[_0x0310('0x2c')](_0x31525f[_0x0310('0x36')],function(_0x5655f2){var _0x331b5a={};_0x331b5a[_0x5655f2]={'$like':'%'+_0x24b0bf['query']['filter']+'%'};return _0x331b5a;})});}_0x31525f=_[_0x0310('0x3e')]({},_0x31525f,_0x24b0bf[_0x0310('0x40')]);return _0x35e92d[_0x0310('0x50')](_0x31525f);}})['then'](function(_0x27f517){if(_0x27f517){_0x4111fd=_0x27f517[_0x0310('0x38')];if(!_0x24b0bf['query']['hasOwnProperty'](_0x0310('0x39'))){_0x31525f['limit']=qs['limit'](_0x24b0bf[_0x0310('0x33')][_0x0310('0x1e')]);_0x31525f['offset']=qs[_0x0310('0x1c')](_0x24b0bf[_0x0310('0x33')]['offset']);}return _0x35e92d[_0x0310('0x50')](_0x31525f);}})['then'](function(_0x900129){if(_0x900129){return _0x900129?{'count':_0x4111fd,'rows':_0x900129}:null;}})[_0x0310('0x26')](respondWithResult(_0x4735c0,null))[_0x0310('0x48')](handleError(_0x4735c0,null));};exports[_0x0310('0x51')]=function(_0x49b3e0,_0x5c87ea,_0x54aa1f){var _0x3735b5={};var _0x472499={};var _0x19db66;var _0x4d0d2a;return db[_0x0310('0x2d')][_0x0310('0x4a')]({'where':{'id':_0x49b3e0[_0x0310('0x49')]['id']}})[_0x0310('0x26')](handleEntityNotFound(_0x5c87ea,null))[_0x0310('0x26')](function(_0x325038){if(_0x325038){_0x19db66=_0x325038;_0x472499[_0x0310('0x31')]=_['keys'](db[_0x0310('0x52')][_0x0310('0x44')]);_0x472499[_0x0310('0x33')]=_[_0x0310('0x32')](_0x49b3e0[_0x0310('0x33')]);_0x472499['filters']=_[_0x0310('0x35')](_0x472499[_0x0310('0x31')],_0x472499[_0x0310('0x33')]);_0x3735b5[_0x0310('0x36')]=_['intersection'](_0x472499[_0x0310('0x31')],qs[_0x0310('0x37')](_0x49b3e0[_0x0310('0x33')]['fields']));_0x3735b5[_0x0310('0x36')]=_0x3735b5[_0x0310('0x36')][_0x0310('0x38')]?_0x3735b5['attributes']:_0x472499[_0x0310('0x31')];_0x3735b5[_0x0310('0x3a')]=qs['sort'](_0x49b3e0[_0x0310('0x33')][_0x0310('0x3b')]);_0x3735b5['where']=qs[_0x0310('0x34')](_['pick'](_0x49b3e0[_0x0310('0x33')],_0x472499[_0x0310('0x34')]));if(_0x49b3e0[_0x0310('0x33')][_0x0310('0x3c')]){_0x3735b5[_0x0310('0x3d')]=_[_0x0310('0x3e')](_0x3735b5[_0x0310('0x3d')],{'$or':_[_0x0310('0x2c')](_0x3735b5[_0x0310('0x36')],function(_0x4e52c9){var _0x5466d6={};_0x5466d6[_0x4e52c9]={'$like':'%'+_0x49b3e0['query'][_0x0310('0x3c')]+'%'};return _0x5466d6;})});}_0x3735b5=_[_0x0310('0x3e')]({},_0x3735b5,_0x49b3e0[_0x0310('0x40')]);return _0x19db66['getTags'](_0x3735b5);}})[_0x0310('0x26')](function(_0xdb3481){if(_0xdb3481){_0x4d0d2a=_0xdb3481[_0x0310('0x38')];if(!_0x49b3e0[_0x0310('0x33')][_0x0310('0x4c')](_0x0310('0x39'))){_0x3735b5[_0x0310('0x1e')]=qs[_0x0310('0x1e')](_0x49b3e0[_0x0310('0x33')][_0x0310('0x1e')]);_0x3735b5[_0x0310('0x1c')]=qs['offset'](_0x49b3e0[_0x0310('0x33')]['offset']);}return _0x19db66[_0x0310('0x51')](_0x3735b5);}})[_0x0310('0x26')](function(_0x5e59d8){if(_0x5e59d8){return _0x5e59d8?{'count':_0x4d0d2a,'rows':_0x5e59d8}:null;}})[_0x0310('0x26')](respondWithResult(_0x5c87ea,null))[_0x0310('0x48')](handleError(_0x5c87ea,null));};exports[_0x0310('0x53')]=function(_0x5e2c98,_0x53e94d,_0x5e5b9f){if(_0x5e2c98[_0x0310('0x47')]['id']){delete _0x5e2c98['body']['id'];}return db[_0x0310('0x2d')][_0x0310('0x4a')]({'where':{'id':_0x5e2c98[_0x0310('0x49')]['id']}})['then'](handleEntityNotFound(_0x53e94d,null))['then'](function(_0x259565){if(_0x259565){return _0x259565[_0x0310('0x53')](_0x5e2c98[_0x0310('0x47')][_0x0310('0x54')]||[]);}return null;})[_0x0310('0x26')](respondWithResult(_0x53e94d,null))[_0x0310('0x48')](handleError(_0x53e94d,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 8035509..4592c53 100644 --- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js +++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xff8a=['int_freshdesk_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','FreshdeskConfiguration'];(function(_0xcd68f0,_0x56fc56){var _0x4a0801=function(_0x5be525){while(--_0x5be525){_0xcd68f0['push'](_0xcd68f0['shift']());}};_0x4a0801(++_0x56fc56);}(_0xff8a,0x1da));var _0xaff8=function(_0x2ca4e6,_0x4ba084){_0x2ca4e6=_0x2ca4e6-0x0;var _0x4db9ee=_0xff8a[_0x2ca4e6];return _0x4db9ee;};'use strict';var _=require(_0xaff8('0x0'));var util=require('util');var logger=require(_0xaff8('0x1'))(_0xaff8('0x2'));var moment=require(_0xaff8('0x3'));var BPromise=require(_0xaff8('0x4'));var rp=require(_0xaff8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaff8('0x6'));var config=require(_0xaff8('0x7'));var attributes=require(_0xaff8('0x8'));module['exports']=function(_0x347e32,_0x32ec9f){return _0x347e32['define'](_0xaff8('0x9'),attributes,{'tableName':_0xaff8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xffe9=['define','FreshdeskConfiguration','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./intFreshdeskConfiguration.attributes'];(function(_0x441981,_0x12a3eb){var _0x19ce77=function(_0x26973d){while(--_0x26973d){_0x441981['push'](_0x441981['shift']());}};_0x19ce77(++_0x12a3eb);}(_0xffe9,0xc8));var _0x9ffe=function(_0x59c2cb,_0x671ebb){_0x59c2cb=_0x59c2cb-0x0;var _0x4d2910=_0xffe9[_0x59c2cb];return _0x4d2910;};'use strict';var _=require('lodash');var util=require(_0x9ffe('0x0'));var logger=require(_0x9ffe('0x1'))(_0x9ffe('0x2'));var moment=require('moment');var BPromise=require(_0x9ffe('0x3'));var rp=require(_0x9ffe('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9ffe('0x5'));var attributes=require(_0x9ffe('0x6'));module['exports']=function(_0x2c3c50,_0x4f469f){return _0x2c3c50[_0x9ffe('0x7')](_0x9ffe('0x8'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index b7f6022..6457f53 100644 --- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js +++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe339=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x52be9b,_0x51ab2e){var _0x1fbcc5=function(_0x9de14c){while(--_0x9de14c){_0x52be9b['push'](_0x52be9b['shift']());}};_0x1fbcc5(++_0x51ab2e);}(_0xe339,0x145));var _0x9e33=function(_0x4aa4e6,_0x278c45){_0x4aa4e6=_0x4aa4e6-0x0;var _0x322588=_0xe339[_0x4aa4e6];return _0x322588;};'use strict';var _=require(_0x9e33('0x0'));var util=require(_0x9e33('0x1'));var moment=require('moment');var BPromise=require(_0x9e33('0x2'));var rs=require(_0x9e33('0x3'));var fs=require('fs');var Redis=require(_0x9e33('0x4'));var db=require(_0x9e33('0x5'))['db'];var utils=require(_0x9e33('0x6'));var logger=require(_0x9e33('0x7'))(_0x9e33('0x8'));var config=require('../../config/environment');var jayson=require(_0x9e33('0x9'));var client=jayson[_0x9e33('0xa')][_0x9e33('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5232a8,_0x3ec599,_0x102120){return new BPromise(function(_0x43346a,_0x51e541){return client['request'](_0x5232a8,_0x102120)[_0x9e33('0xc')](function(_0x8c494a){logger[_0x9e33('0xd')](_0x9e33('0xe'),_0x3ec599,_0x9e33('0xf'));logger[_0x9e33('0x10')](_0x9e33('0x11'),_0x3ec599,_0x9e33('0xf'),JSON[_0x9e33('0x12')](_0x8c494a));if(_0x8c494a[_0x9e33('0x13')]){if(_0x8c494a['error']['code']===0x1f4){logger[_0x9e33('0x13')](_0x9e33('0xe'),_0x3ec599,_0x8c494a[_0x9e33('0x13')][_0x9e33('0x14')]);return _0x51e541(_0x8c494a[_0x9e33('0x13')][_0x9e33('0x14')]);}logger['error'](_0x9e33('0xe'),_0x3ec599,_0x8c494a[_0x9e33('0x13')]['message']);return _0x43346a(_0x8c494a[_0x9e33('0x13')][_0x9e33('0x14')]);}else{logger[_0x9e33('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3ec599,_0x9e33('0xf'));_0x43346a(_0x8c494a['result']['message']);}})[_0x9e33('0x15')](function(_0x32707a){logger[_0x9e33('0x13')](_0x9e33('0xe'),_0x3ec599,_0x32707a);_0x51e541(_0x32707a);});});} \ No newline at end of file +var _0xe938=['jayson/promise','client','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x504df1,_0x289598){var _0x1063b5=function(_0x627abd){while(--_0x627abd){_0x504df1['push'](_0x504df1['shift']());}};_0x1063b5(++_0x289598);}(_0xe938,0x18f));var _0x8e93=function(_0x1adb22,_0x260530){_0x1adb22=_0x1adb22-0x0;var _0x2ebffc=_0xe938[_0x1adb22];return _0x2ebffc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8e93('0x0'));var BPromise=require(_0x8e93('0x1'));var rs=require(_0x8e93('0x2'));var fs=require('fs');var Redis=require(_0x8e93('0x3'));var db=require(_0x8e93('0x4'))['db'];var utils=require(_0x8e93('0x5'));var logger=require(_0x8e93('0x6'))(_0x8e93('0x7'));var config=require(_0x8e93('0x8'));var jayson=require(_0x8e93('0x9'));var client=jayson[_0x8e93('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5dc567,_0x22b507,_0x2a6444){return new BPromise(function(_0x3b29b3,_0x4d6635){return client[_0x8e93('0xb')](_0x5dc567,_0x2a6444)[_0x8e93('0xc')](function(_0x305611){logger[_0x8e93('0xd')](_0x8e93('0xe'),_0x22b507,'request\x20sent');logger[_0x8e93('0xf')](_0x8e93('0x10'),_0x22b507,'request\x20sent',JSON[_0x8e93('0x11')](_0x305611));if(_0x305611[_0x8e93('0x12')]){if(_0x305611[_0x8e93('0x12')][_0x8e93('0x13')]===0x1f4){logger[_0x8e93('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x22b507,_0x305611[_0x8e93('0x12')][_0x8e93('0x14')]);return _0x4d6635(_0x305611['error'][_0x8e93('0x14')]);}logger[_0x8e93('0x12')](_0x8e93('0xe'),_0x22b507,_0x305611[_0x8e93('0x12')][_0x8e93('0x14')]);return _0x3b29b3(_0x305611[_0x8e93('0x12')][_0x8e93('0x14')]);}else{logger[_0x8e93('0xd')](_0x8e93('0xe'),_0x22b507,_0x8e93('0x15'));_0x3b29b3(_0x305611[_0x8e93('0x16')]['message']);}})[_0x8e93('0x17')](function(_0x1ad437){logger[_0x8e93('0x12')](_0x8e93('0xe'),_0x22b507,_0x1ad437);_0x4d6635(_0x1ad437);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 9acc616..22aba26 100644 --- a/server/api/intFreshdeskField/index.js +++ b/server/api/intFreshdeskField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9080=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','index','/:id','isAuthenticated','show','post','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0x9080,0x13c));var _0x0908=function(_0x35435c,_0x43d126){_0x35435c=_0x35435c-0x0;var _0x9a387f=_0x9080[_0x35435c];return _0x9a387f;};'use strict';var multer=require(_0x0908('0x0'));var util=require('util');var path=require(_0x0908('0x1'));var timeout=require(_0x0908('0x2'));var express=require(_0x0908('0x3'));var router=express[_0x0908('0x4')]();var fs_extra=require(_0x0908('0x5'));var auth=require(_0x0908('0x6'));var interaction=require(_0x0908('0x7'));var config=require(_0x0908('0x8'));var controller=require(_0x0908('0x9'));router[_0x0908('0xa')]('/',auth['isAuthenticated'](),controller[_0x0908('0xb')]);router[_0x0908('0xa')](_0x0908('0xc'),auth[_0x0908('0xd')](),controller[_0x0908('0xe')]);router[_0x0908('0xf')]('/',auth[_0x0908('0xd')](),controller['create']);router[_0x0908('0x10')](_0x0908('0xc'),auth[_0x0908('0xd')](),controller[_0x0908('0x11')]);router['delete'](_0x0908('0xc'),auth[_0x0908('0xd')](),controller[_0x0908('0x12')]);module[_0x0908('0x13')]=router; \ No newline at end of file +var _0x2dd1=['get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller'];(function(_0xf79bae,_0x263b2a){var _0x5d2cb7=function(_0x27c86b){while(--_0x27c86b){_0xf79bae['push'](_0xf79bae['shift']());}};_0x5d2cb7(++_0x263b2a);}(_0x2dd1,0x13b));var _0x12dd=function(_0x303bd3,_0x5dadb5){_0x303bd3=_0x303bd3-0x0;var _0x44a41c=_0x2dd1[_0x303bd3];return _0x44a41c;};'use strict';var multer=require('multer');var util=require(_0x12dd('0x0'));var path=require(_0x12dd('0x1'));var timeout=require(_0x12dd('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x12dd('0x3'));var auth=require(_0x12dd('0x4'));var interaction=require(_0x12dd('0x5'));var config=require(_0x12dd('0x6'));var controller=require(_0x12dd('0x7'));router[_0x12dd('0x8')]('/',auth[_0x12dd('0x9')](),controller[_0x12dd('0xa')]);router[_0x12dd('0x8')](_0x12dd('0xb'),auth[_0x12dd('0x9')](),controller[_0x12dd('0xc')]);router[_0x12dd('0xd')]('/',auth[_0x12dd('0x9')](),controller[_0x12dd('0xe')]);router[_0x12dd('0xf')]('/:id',auth[_0x12dd('0x9')](),controller[_0x12dd('0x10')]);router[_0x12dd('0x11')](_0x12dd('0xb'),auth['isAuthenticated'](),controller[_0x12dd('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 5a85888..ca4d7c7 100644 --- a/server/api/intFreshdeskField/intFreshdeskField.attributes.js +++ b/server/api/intFreshdeskField/intFreshdeskField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1faf=['exports','string','variable','keyValue','STRING','ENUM','customVariable'];(function(_0x52614f,_0x54e403){var _0x2a05df=function(_0x56692b){while(--_0x56692b){_0x52614f['push'](_0x52614f['shift']());}};_0x2a05df(++_0x54e403);}(_0x1faf,0x1f1));var _0xf1fa=function(_0x4c3a8c,_0x582a1c){_0x4c3a8c=_0x4c3a8c-0x0;var _0x555e09=_0x1faf[_0x4c3a8c];return _0x555e09;};'use strict';var Sequelize=require('sequelize');module[_0xf1fa('0x0')]={'type':{'type':Sequelize['ENUM'](_0xf1fa('0x1'),_0xf1fa('0x2'),'customVariable',_0xf1fa('0x3'),'picklist'),'defaultValue':_0xf1fa('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xf1fa('0x4')]},'keyType':{'type':Sequelize[_0xf1fa('0x5')]('string',_0xf1fa('0x2'),_0xf1fa('0x6'))},'keyContent':{'type':Sequelize[_0xf1fa('0x4')]},'idField':{'type':Sequelize[_0xf1fa('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xdd23=['picklist','STRING','customVariable','BOOLEAN','exports','ENUM','string','variable'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xdd23,0x9c));var _0x3dd2=function(_0x207809,_0x5f68c8){_0x207809=_0x207809-0x0;var _0x380816=_0xdd23[_0x207809];return _0x380816;};'use strict';var Sequelize=require('sequelize');module[_0x3dd2('0x0')]={'type':{'type':Sequelize[_0x3dd2('0x1')](_0x3dd2('0x2'),_0x3dd2('0x3'),'customVariable','keyValue',_0x3dd2('0x4')),'defaultValue':_0x3dd2('0x2')},'content':{'type':Sequelize[_0x3dd2('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x3dd2('0x1')](_0x3dd2('0x2'),'variable',_0x3dd2('0x6'))},'keyContent':{'type':Sequelize[_0x3dd2('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x3dd2('0x5')]},'customField':{'type':Sequelize[_0x3dd2('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3dd2('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index e14173c..c116c86 100644 --- a/server/api/intFreshdeskField/intFreshdeskField.controller.js +++ b/server/api/intFreshdeskField/intFreshdeskField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x222f=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshdeskField','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','nolimit','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x970068,_0x3e4142){var _0x51063d=function(_0x32b30e){while(--_0x32b30e){_0x970068['push'](_0x970068['shift']());}};_0x51063d(++_0x3e4142);}(_0x222f,0x1a4));var _0xf222=function(_0x35e3b8,_0x1f543f){_0x35e3b8=_0x35e3b8-0x0;var _0xae5b9a=_0x222f[_0x35e3b8];return _0xae5b9a;};'use strict';var emlformat=require(_0xf222('0x0'));var rimraf=require(_0xf222('0x1'));var zipdir=require(_0xf222('0x2'));var jsonpatch=require(_0xf222('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf222('0x4'));var Mustache=require(_0xf222('0x5'));var util=require(_0xf222('0x6'));var path=require(_0xf222('0x7'));var sox=require('sox');var csv=require(_0xf222('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf222('0x9'));var _=require(_0xf222('0xa'));var squel=require('squel');var crypto=require(_0xf222('0xb'));var jsforce=require(_0xf222('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf222('0x8'));var querystring=require(_0xf222('0xd'));var Papa=require(_0xf222('0xe'));var Redis=require(_0xf222('0xf'));var authService=require(_0xf222('0x10'));var qs=require(_0xf222('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf222('0x12'));var logger=require(_0xf222('0x13'))(_0xf222('0x14'));var utils=require(_0xf222('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf222('0x16'));var db=require(_0xf222('0x17'))['db'];function respondWithStatusCode(_0x2a6965,_0x3d3d29){_0x3d3d29=_0x3d3d29||0xcc;return function(_0x12f968){if(_0x12f968){return _0x2a6965[_0xf222('0x18')](_0x3d3d29);}return _0x2a6965[_0xf222('0x19')](_0x3d3d29)[_0xf222('0x1a')]();};}function respondWithResult(_0x52a003,_0x5b8f97){_0x5b8f97=_0x5b8f97||0xc8;return function(_0x1feb86){if(_0x1feb86){return _0x52a003[_0xf222('0x19')](_0x5b8f97)['json'](_0x1feb86);}};}function respondWithFilteredResult(_0x39be58,_0x43d35b){return function(_0x464f3e){if(_0x464f3e){var _0x4392a0=typeof _0x43d35b[_0xf222('0x1b')]===_0xf222('0x1c')&&typeof _0x43d35b[_0xf222('0x1d')]==='undefined';var _0x1efa9f=_0x464f3e[_0xf222('0x1e')];var _0x8783ab=_0x4392a0?0x0:_0x43d35b[_0xf222('0x1b')];var _0x12a2e4=_0x4392a0?_0x464f3e[_0xf222('0x1e')]:_0x43d35b[_0xf222('0x1b')]+_0x43d35b['limit'];var _0xf26a16;if(_0x12a2e4>=_0x1efa9f){_0x12a2e4=_0x1efa9f;_0xf26a16=0xc8;}else{_0xf26a16=0xce;}_0x39be58[_0xf222('0x19')](_0xf26a16);return _0x39be58[_0xf222('0x1f')](_0xf222('0x20'),_0x8783ab+'-'+_0x12a2e4+'/'+_0x1efa9f)['json'](_0x464f3e);}return null;};}function patchUpdates(_0x5cd899){return function(_0x398ff4){try{jsonpatch[_0xf222('0x21')](_0x398ff4,_0x5cd899,!![]);}catch(_0x201cf0){return BPromise[_0xf222('0x22')](_0x201cf0);}return _0x398ff4[_0xf222('0x23')]();};}function saveUpdates(_0x151a89,_0x51b872){return function(_0x176b20){if(_0x176b20){return _0x176b20[_0xf222('0x24')](_0x151a89)[_0xf222('0x25')](function(_0x12d443){return _0x12d443;});}return null;};}function removeEntity(_0x2c48ce,_0x2d18ab){return function(_0x4616de){if(_0x4616de){return _0x4616de[_0xf222('0x26')]()['then'](function(){_0x2c48ce[_0xf222('0x19')](0xcc)[_0xf222('0x1a')]();});}};}function handleEntityNotFound(_0x1883c1,_0x3fce26){return function(_0x4305e0){if(!_0x4305e0){_0x1883c1[_0xf222('0x18')](0x194);}return _0x4305e0;};}function handleError(_0x42616e,_0x263dc2){_0x263dc2=_0x263dc2||0x1f4;return function(_0x15bf4e){logger[_0xf222('0x27')](_0x15bf4e[_0xf222('0x28')]);if(_0x15bf4e['name']){delete _0x15bf4e[_0xf222('0x29')];}_0x42616e[_0xf222('0x19')](_0x263dc2)[_0xf222('0x2a')](_0x15bf4e);};}exports[_0xf222('0x2b')]=function(_0xe41039,_0x40a715){var _0x3789e0={},_0x1b928b={},_0x1e87ec={'count':0x0,'rows':[]};var _0x59721a=_[_0xf222('0x2c')](db[_0xf222('0x2d')][_0xf222('0x2e')],function(_0x53a382){return{'name':_0x53a382[_0xf222('0x2f')],'type':_0x53a382['type'][_0xf222('0x30')]};});_0x1b928b[_0xf222('0x31')]=_[_0xf222('0x2c')](_0x59721a,_0xf222('0x29'));_0x1b928b[_0xf222('0x32')]=_[_0xf222('0x33')](_0xe41039[_0xf222('0x32')]);_0x1b928b['filters']=_['intersection'](_0x1b928b[_0xf222('0x31')],_0x1b928b[_0xf222('0x32')]);_0x3789e0[_0xf222('0x34')]=_[_0xf222('0x35')](_0x1b928b[_0xf222('0x31')],qs[_0xf222('0x36')](_0xe41039['query'][_0xf222('0x36')]));_0x3789e0[_0xf222('0x34')]=_0x3789e0[_0xf222('0x34')]['length']?_0x3789e0[_0xf222('0x34')]:_0x1b928b[_0xf222('0x31')];if(!_0xe41039[_0xf222('0x32')]['hasOwnProperty'](_0xf222('0x37'))){_0x3789e0[_0xf222('0x1d')]=qs[_0xf222('0x1d')](_0xe41039['query'][_0xf222('0x1d')]);_0x3789e0[_0xf222('0x1b')]=qs[_0xf222('0x1b')](_0xe41039[_0xf222('0x32')][_0xf222('0x1b')]);}_0x3789e0['order']=qs[_0xf222('0x38')](_0xe41039['query'][_0xf222('0x38')]);_0x3789e0[_0xf222('0x39')]=qs[_0xf222('0x3a')](_['pick'](_0xe41039[_0xf222('0x32')],_0x1b928b[_0xf222('0x3a')]),_0x59721a);if(_0xe41039['query'][_0xf222('0x3b')]){_0x3789e0['where']=_[_0xf222('0x3c')](_0x3789e0[_0xf222('0x39')],{'$or':_[_0xf222('0x2c')](_0x59721a,function(_0x5c8b04){if(_0x5c8b04[_0xf222('0x3d')]!==_0xf222('0x3e')){var _0x2c1e49={};_0x2c1e49[_0x5c8b04[_0xf222('0x29')]]={'$like':'%'+_0xe41039[_0xf222('0x32')][_0xf222('0x3b')]+'%'};return _0x2c1e49;}})});}_0x3789e0=_['merge']({},_0x3789e0,_0xe41039[_0xf222('0x3f')]);var _0x24e8a5={'where':_0x3789e0['where']};return db['FreshdeskField'][_0xf222('0x1e')](_0x24e8a5)['then'](function(_0x2b20d3){_0x1e87ec[_0xf222('0x1e')]=_0x2b20d3;if(_0xe41039[_0xf222('0x32')][_0xf222('0x40')]){_0x3789e0['include']=[{'all':!![]}];}return db['FreshdeskField'][_0xf222('0x41')](_0x3789e0);})['then'](function(_0x522a9e){_0x1e87ec[_0xf222('0x42')]=_0x522a9e;return _0x1e87ec;})[_0xf222('0x25')](respondWithFilteredResult(_0x40a715,_0x3789e0))[_0xf222('0x43')](handleError(_0x40a715,null));};exports[_0xf222('0x44')]=function(_0x10f065,_0x2af478){var _0x5c60e6={'raw':!![],'where':{'id':_0x10f065[_0xf222('0x45')]['id']}},_0xf829ae={};_0xf829ae['model']=_[_0xf222('0x33')](db[_0xf222('0x2d')]['rawAttributes']);_0xf829ae[_0xf222('0x32')]=_['keys'](_0x10f065[_0xf222('0x32')]);_0xf829ae[_0xf222('0x3a')]=_[_0xf222('0x35')](_0xf829ae[_0xf222('0x31')],_0xf829ae[_0xf222('0x32')]);_0x5c60e6[_0xf222('0x34')]=_[_0xf222('0x35')](_0xf829ae[_0xf222('0x31')],qs[_0xf222('0x36')](_0x10f065[_0xf222('0x32')][_0xf222('0x36')]));_0x5c60e6['attributes']=_0x5c60e6['attributes']['length']?_0x5c60e6[_0xf222('0x34')]:_0xf829ae[_0xf222('0x31')];if(_0x10f065[_0xf222('0x32')][_0xf222('0x40')]){_0x5c60e6['include']=[{'all':!![]}];}_0x5c60e6=_[_0xf222('0x3c')]({},_0x5c60e6,_0x10f065[_0xf222('0x3f')]);return db[_0xf222('0x2d')][_0xf222('0x46')](_0x5c60e6)['then'](handleEntityNotFound(_0x2af478,null))[_0xf222('0x25')](respondWithResult(_0x2af478,null))[_0xf222('0x43')](handleError(_0x2af478,null));};exports[_0xf222('0x47')]=function(_0x37b393,_0x1d60e5){return db[_0xf222('0x2d')][_0xf222('0x47')](_0x37b393[_0xf222('0x48')],{})[_0xf222('0x25')](respondWithResult(_0x1d60e5,0xc9))[_0xf222('0x43')](handleError(_0x1d60e5,null));};exports['update']=function(_0x5d0d70,_0x193762){if(_0x5d0d70['body']['id']){delete _0x5d0d70[_0xf222('0x48')]['id'];}return db['FreshdeskField'][_0xf222('0x46')]({'where':{'id':_0x5d0d70['params']['id']}})[_0xf222('0x25')](handleEntityNotFound(_0x193762,null))[_0xf222('0x25')](saveUpdates(_0x5d0d70[_0xf222('0x48')],null))[_0xf222('0x25')](respondWithResult(_0x193762,null))['catch'](handleError(_0x193762,null));};exports[_0xf222('0x26')]=function(_0x34fd50,_0x380642){return db[_0xf222('0x2d')][_0xf222('0x46')]({'where':{'id':_0x34fd50[_0xf222('0x45')]['id']}})[_0xf222('0x25')](handleEntityNotFound(_0x380642,null))[_0xf222('0x25')](removeEntity(_0x380642,null))[_0xf222('0x43')](handleError(_0x380642,null));}; \ No newline at end of file +var _0xac55=['keys','filters','attributes','intersection','length','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','options','include','rows','catch','show','params','rawAttributes','fields','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','status','error','stack','name','send','index','FreshdeskField','fieldName','type','key','model','query'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xac55,0x1c8));var _0x5ac5=function(_0x4b141c,_0x17cb40){_0x4b141c=_0x4b141c-0x0;var _0x3fd120=_0xac55[_0x4b141c];return _0x3fd120;};'use strict';var emlformat=require(_0x5ac5('0x0'));var rimraf=require(_0x5ac5('0x1'));var zipdir=require(_0x5ac5('0x2'));var jsonpatch=require(_0x5ac5('0x3'));var rp=require('request-promise');var moment=require(_0x5ac5('0x4'));var BPromise=require(_0x5ac5('0x5'));var Mustache=require(_0x5ac5('0x6'));var util=require(_0x5ac5('0x7'));var path=require(_0x5ac5('0x8'));var sox=require(_0x5ac5('0x9'));var csv=require(_0x5ac5('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5ac5('0xb'));var squel=require(_0x5ac5('0xc'));var crypto=require(_0x5ac5('0xd'));var jsforce=require(_0x5ac5('0xe'));var deskjs=require(_0x5ac5('0xf'));var toCsv=require(_0x5ac5('0xa'));var querystring=require(_0x5ac5('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5ac5('0x11'));var qs=require(_0x5ac5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5ac5('0x13'));var logger=require(_0x5ac5('0x14'))('api');var utils=require(_0x5ac5('0x15'));var config=require(_0x5ac5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5ac5('0x17'))['db'];function respondWithStatusCode(_0x1d2b5f,_0x7c4f62){_0x7c4f62=_0x7c4f62||0xcc;return function(_0x13fad8){if(_0x13fad8){return _0x1d2b5f[_0x5ac5('0x18')](_0x7c4f62);}return _0x1d2b5f['status'](_0x7c4f62)[_0x5ac5('0x19')]();};}function respondWithResult(_0x56db18,_0x1ce256){_0x1ce256=_0x1ce256||0xc8;return function(_0x40ee8a){if(_0x40ee8a){return _0x56db18['status'](_0x1ce256)[_0x5ac5('0x1a')](_0x40ee8a);}};}function respondWithFilteredResult(_0x57377b,_0x2a145d){return function(_0x340195){if(_0x340195){var _0x30244d=typeof _0x2a145d[_0x5ac5('0x1b')]===_0x5ac5('0x1c')&&typeof _0x2a145d[_0x5ac5('0x1d')]===_0x5ac5('0x1c');var _0x5510ef=_0x340195[_0x5ac5('0x1e')];var _0x5364a6=_0x30244d?0x0:_0x2a145d[_0x5ac5('0x1b')];var _0x14d164=_0x30244d?_0x340195['count']:_0x2a145d[_0x5ac5('0x1b')]+_0x2a145d['limit'];var _0x264422;if(_0x14d164>=_0x5510ef){_0x14d164=_0x5510ef;_0x264422=0xc8;}else{_0x264422=0xce;}_0x57377b['status'](_0x264422);return _0x57377b['set'](_0x5ac5('0x1f'),_0x5364a6+'-'+_0x14d164+'/'+_0x5510ef)['json'](_0x340195);}return null;};}function patchUpdates(_0x39f3cf){return function(_0x3cb669){try{jsonpatch['apply'](_0x3cb669,_0x39f3cf,!![]);}catch(_0x4066f5){return BPromise['reject'](_0x4066f5);}return _0x3cb669[_0x5ac5('0x20')]();};}function saveUpdates(_0x40bdbc,_0x47993e){return function(_0x47a898){if(_0x47a898){return _0x47a898[_0x5ac5('0x21')](_0x40bdbc)[_0x5ac5('0x22')](function(_0x400308){return _0x400308;});}return null;};}function removeEntity(_0x182683,_0xee1c62){return function(_0x4dec2f){if(_0x4dec2f){return _0x4dec2f[_0x5ac5('0x23')]()[_0x5ac5('0x22')](function(){_0x182683[_0x5ac5('0x24')](0xcc)[_0x5ac5('0x19')]();});}};}function handleEntityNotFound(_0x4b81e2,_0x22398f){return function(_0x4eda97){if(!_0x4eda97){_0x4b81e2[_0x5ac5('0x18')](0x194);}return _0x4eda97;};}function handleError(_0x74f32b,_0x1d78cf){_0x1d78cf=_0x1d78cf||0x1f4;return function(_0x2cb82f){logger[_0x5ac5('0x25')](_0x2cb82f[_0x5ac5('0x26')]);if(_0x2cb82f['name']){delete _0x2cb82f[_0x5ac5('0x27')];}_0x74f32b['status'](_0x1d78cf)[_0x5ac5('0x28')](_0x2cb82f);};}exports[_0x5ac5('0x29')]=function(_0x35535f,_0x509db7){var _0x283c41={},_0x229941={},_0x21df31={'count':0x0,'rows':[]};var _0x21307c=_['map'](db[_0x5ac5('0x2a')]['rawAttributes'],function(_0x3414ba){return{'name':_0x3414ba[_0x5ac5('0x2b')],'type':_0x3414ba[_0x5ac5('0x2c')][_0x5ac5('0x2d')]};});_0x229941[_0x5ac5('0x2e')]=_['map'](_0x21307c,_0x5ac5('0x27'));_0x229941[_0x5ac5('0x2f')]=_[_0x5ac5('0x30')](_0x35535f['query']);_0x229941[_0x5ac5('0x31')]=_['intersection'](_0x229941[_0x5ac5('0x2e')],_0x229941[_0x5ac5('0x2f')]);_0x283c41[_0x5ac5('0x32')]=_[_0x5ac5('0x33')](_0x229941[_0x5ac5('0x2e')],qs['fields'](_0x35535f[_0x5ac5('0x2f')]['fields']));_0x283c41[_0x5ac5('0x32')]=_0x283c41['attributes'][_0x5ac5('0x34')]?_0x283c41[_0x5ac5('0x32')]:_0x229941['model'];if(!_0x35535f[_0x5ac5('0x2f')][_0x5ac5('0x35')]('nolimit')){_0x283c41['limit']=qs[_0x5ac5('0x1d')](_0x35535f[_0x5ac5('0x2f')][_0x5ac5('0x1d')]);_0x283c41[_0x5ac5('0x1b')]=qs[_0x5ac5('0x1b')](_0x35535f[_0x5ac5('0x2f')]['offset']);}_0x283c41['order']=qs['sort'](_0x35535f[_0x5ac5('0x2f')][_0x5ac5('0x36')]);_0x283c41['where']=qs[_0x5ac5('0x31')](_[_0x5ac5('0x37')](_0x35535f[_0x5ac5('0x2f')],_0x229941[_0x5ac5('0x31')]),_0x21307c);if(_0x35535f[_0x5ac5('0x2f')][_0x5ac5('0x38')]){_0x283c41[_0x5ac5('0x39')]=_[_0x5ac5('0x3a')](_0x283c41[_0x5ac5('0x39')],{'$or':_['map'](_0x21307c,function(_0x1b991e){if(_0x1b991e['type']!==_0x5ac5('0x3b')){var _0x432740={};_0x432740[_0x1b991e[_0x5ac5('0x27')]]={'$like':'%'+_0x35535f[_0x5ac5('0x2f')][_0x5ac5('0x38')]+'%'};return _0x432740;}})});}_0x283c41=_[_0x5ac5('0x3a')]({},_0x283c41,_0x35535f[_0x5ac5('0x3c')]);var _0x37cfad={'where':_0x283c41[_0x5ac5('0x39')]};return db['FreshdeskField'][_0x5ac5('0x1e')](_0x37cfad)[_0x5ac5('0x22')](function(_0x4c245b){_0x21df31['count']=_0x4c245b;if(_0x35535f[_0x5ac5('0x2f')]['includeAll']){_0x283c41[_0x5ac5('0x3d')]=[{'all':!![]}];}return db[_0x5ac5('0x2a')]['findAll'](_0x283c41);})['then'](function(_0x1e261d){_0x21df31[_0x5ac5('0x3e')]=_0x1e261d;return _0x21df31;})[_0x5ac5('0x22')](respondWithFilteredResult(_0x509db7,_0x283c41))[_0x5ac5('0x3f')](handleError(_0x509db7,null));};exports[_0x5ac5('0x40')]=function(_0x34bd04,_0x151c5e){var _0x5a86a0={'raw':!![],'where':{'id':_0x34bd04[_0x5ac5('0x41')]['id']}},_0x1d4ef5={};_0x1d4ef5[_0x5ac5('0x2e')]=_[_0x5ac5('0x30')](db[_0x5ac5('0x2a')][_0x5ac5('0x42')]);_0x1d4ef5['query']=_[_0x5ac5('0x30')](_0x34bd04[_0x5ac5('0x2f')]);_0x1d4ef5[_0x5ac5('0x31')]=_[_0x5ac5('0x33')](_0x1d4ef5['model'],_0x1d4ef5[_0x5ac5('0x2f')]);_0x5a86a0[_0x5ac5('0x32')]=_[_0x5ac5('0x33')](_0x1d4ef5['model'],qs['fields'](_0x34bd04[_0x5ac5('0x2f')][_0x5ac5('0x43')]));_0x5a86a0[_0x5ac5('0x32')]=_0x5a86a0[_0x5ac5('0x32')]['length']?_0x5a86a0[_0x5ac5('0x32')]:_0x1d4ef5['model'];if(_0x34bd04[_0x5ac5('0x2f')][_0x5ac5('0x44')]){_0x5a86a0['include']=[{'all':!![]}];}_0x5a86a0=_[_0x5ac5('0x3a')]({},_0x5a86a0,_0x34bd04['options']);return db[_0x5ac5('0x2a')][_0x5ac5('0x45')](_0x5a86a0)[_0x5ac5('0x22')](handleEntityNotFound(_0x151c5e,null))['then'](respondWithResult(_0x151c5e,null))['catch'](handleError(_0x151c5e,null));};exports[_0x5ac5('0x46')]=function(_0x1229c3,_0xd6ae55){return db[_0x5ac5('0x2a')][_0x5ac5('0x46')](_0x1229c3[_0x5ac5('0x47')],{})[_0x5ac5('0x22')](respondWithResult(_0xd6ae55,0xc9))[_0x5ac5('0x3f')](handleError(_0xd6ae55,null));};exports[_0x5ac5('0x21')]=function(_0x536765,_0x2d6aa5){if(_0x536765[_0x5ac5('0x47')]['id']){delete _0x536765[_0x5ac5('0x47')]['id'];}return db['FreshdeskField']['find']({'where':{'id':_0x536765[_0x5ac5('0x41')]['id']}})[_0x5ac5('0x22')](handleEntityNotFound(_0x2d6aa5,null))[_0x5ac5('0x22')](saveUpdates(_0x536765['body'],null))[_0x5ac5('0x22')](respondWithResult(_0x2d6aa5,null))[_0x5ac5('0x3f')](handleError(_0x2d6aa5,null));};exports[_0x5ac5('0x23')]=function(_0x2a3396,_0x326f60){return db[_0x5ac5('0x2a')][_0x5ac5('0x45')]({'where':{'id':_0x2a3396['params']['id']}})['then'](handleEntityNotFound(_0x326f60,null))['then'](removeEntity(_0x326f60,null))[_0x5ac5('0x3f')](handleError(_0x326f60,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 59c79e4..7ceef7c 100644 --- a/server/api/intFreshdeskField/intFreshdeskField.model.js +++ b/server/api/intFreshdeskField/intFreshdeskField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x60d4=['util','../../config/logger','api','bluebird','request-promise','../../config/environment','./intFreshdeskField.attributes','exports','int_freshdesk_fields','idField','lodash'];(function(_0x10eb4f,_0x356f91){var _0x4743ff=function(_0x2d0287){while(--_0x2d0287){_0x10eb4f['push'](_0x10eb4f['shift']());}};_0x4743ff(++_0x356f91);}(_0x60d4,0xa4));var _0x460d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x60d4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x460d('0x0'));var util=require(_0x460d('0x1'));var logger=require(_0x460d('0x2'))(_0x460d('0x3'));var moment=require('moment');var BPromise=require(_0x460d('0x4'));var rp=require(_0x460d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x460d('0x6'));var attributes=require(_0x460d('0x7'));module[_0x460d('0x8')]=function(_0x3ab4ae,_0x27e4c3){return _0x3ab4ae['define']('FreshdeskField',attributes,{'tableName':_0x460d('0x9'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0x460d('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x79e5=['FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index'];(function(_0x112fdf,_0x280fd9){var _0x4f2ad5=function(_0x523e0e){while(--_0x523e0e){_0x112fdf['push'](_0x112fdf['shift']());}};_0x4f2ad5(++_0x280fd9);}(_0x79e5,0x79));var _0x579e=function(_0x414aae,_0x1cc924){_0x414aae=_0x414aae-0x0;var _0x4cecd6=_0x79e5[_0x414aae];return _0x4cecd6;};'use strict';var _=require(_0x579e('0x0'));var util=require(_0x579e('0x1'));var logger=require(_0x579e('0x2'))('api');var moment=require(_0x579e('0x3'));var BPromise=require(_0x579e('0x4'));var rp=require(_0x579e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x579e('0x6'));var attributes=require('./intFreshdeskField.attributes');module['exports']=function(_0x5bc82e,_0x47f13f){return _0x5bc82e[_0x579e('0x7')](_0x579e('0x8'),attributes,{'tableName':_0x579e('0x9'),'paranoid':![],'indexes':[{'name':_0x579e('0xa'),'fields':['idField',_0x579e('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index e409e73..075cded 100644 --- a/server/api/intFreshdeskField/intFreshdeskField.rpc.js +++ b/server/api/intFreshdeskField/intFreshdeskField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7fee=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','FreshdeskField,\x20%s,\x20%s','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','error','message','info','request\x20sent'];(function(_0x59b6a9,_0x405dd3){var _0x266dc0=function(_0x3ac25b){while(--_0x3ac25b){_0x59b6a9['push'](_0x59b6a9['shift']());}};_0x266dc0(++_0x405dd3);}(_0x7fee,0x1a6));var _0xe7fe=function(_0x37ffea,_0x25b006){_0x37ffea=_0x37ffea-0x0;var _0x2e2615=_0x7fee[_0x37ffea];return _0x2e2615;};'use strict';var _=require(_0xe7fe('0x0'));var util=require(_0xe7fe('0x1'));var moment=require(_0xe7fe('0x2'));var BPromise=require(_0xe7fe('0x3'));var rs=require(_0xe7fe('0x4'));var fs=require('fs');var Redis=require(_0xe7fe('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe7fe('0x6'));var logger=require(_0xe7fe('0x7'))(_0xe7fe('0x8'));var config=require('../../config/environment');var jayson=require(_0xe7fe('0x9'));var client=jayson['client'][_0xe7fe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xeca7d9,_0x25a6a4,_0x9b55e8){return new BPromise(function(_0x1f3366,_0xf5e41b){return client[_0xe7fe('0xb')](_0xeca7d9,_0x9b55e8)['then'](function(_0x5b8d3f){logger['info'](_0xe7fe('0xc'),_0x25a6a4,'request\x20sent');logger[_0xe7fe('0xd')](_0xe7fe('0xe'),_0x25a6a4,'request\x20sent',JSON['stringify'](_0x5b8d3f));if(_0x5b8d3f[_0xe7fe('0xf')]){if(_0x5b8d3f[_0xe7fe('0xf')]['code']===0x1f4){logger[_0xe7fe('0xf')](_0xe7fe('0xc'),_0x25a6a4,_0x5b8d3f[_0xe7fe('0xf')]['message']);return _0xf5e41b(_0x5b8d3f[_0xe7fe('0xf')][_0xe7fe('0x10')]);}logger[_0xe7fe('0xf')]('FreshdeskField,\x20%s,\x20%s',_0x25a6a4,_0x5b8d3f[_0xe7fe('0xf')][_0xe7fe('0x10')]);return _0x1f3366(_0x5b8d3f[_0xe7fe('0xf')][_0xe7fe('0x10')]);}else{logger[_0xe7fe('0x11')](_0xe7fe('0xc'),_0x25a6a4,_0xe7fe('0x12'));_0x1f3366(_0x5b8d3f[_0xe7fe('0x13')][_0xe7fe('0x10')]);}})[_0xe7fe('0x14')](function(_0x3616a6){logger[_0xe7fe('0xf')](_0xe7fe('0xc'),_0x25a6a4,_0x3616a6);_0xf5e41b(_0x3616a6);});});} \ No newline at end of file +var _0xa42e=['FreshdeskField,\x20%s,\x20%s','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info'];(function(_0x115eff,_0x2dc1bd){var _0x55eb80=function(_0x5d759f){while(--_0x5d759f){_0x115eff['push'](_0x115eff['shift']());}};_0x55eb80(++_0x2dc1bd);}(_0xa42e,0x1ab));var _0xea42=function(_0x36a3ab,_0xc431d3){_0x36a3ab=_0x36a3ab-0x0;var _0x32f208=_0xa42e[_0x36a3ab];return _0x32f208;};'use strict';var _=require(_0xea42('0x0'));var util=require(_0xea42('0x1'));var moment=require(_0xea42('0x2'));var BPromise=require(_0xea42('0x3'));var rs=require(_0xea42('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xea42('0x5'))['db'];var utils=require(_0xea42('0x6'));var logger=require(_0xea42('0x7'))(_0xea42('0x8'));var config=require('../../config/environment');var jayson=require(_0xea42('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4e5718,_0x416a6a,_0x1c4edb){return new BPromise(function(_0x1989b6,_0x459eef){return client[_0xea42('0xa')](_0x4e5718,_0x1c4edb)[_0xea42('0xb')](function(_0x4fe4cf){logger[_0xea42('0xc')](_0xea42('0xd'),_0x416a6a,_0xea42('0xe'));logger['debug'](_0xea42('0xf'),_0x416a6a,_0xea42('0xe'),JSON[_0xea42('0x10')](_0x4fe4cf));if(_0x4fe4cf['error']){if(_0x4fe4cf[_0xea42('0x11')][_0xea42('0x12')]===0x1f4){logger['error'](_0xea42('0xd'),_0x416a6a,_0x4fe4cf[_0xea42('0x11')][_0xea42('0x13')]);return _0x459eef(_0x4fe4cf[_0xea42('0x11')][_0xea42('0x13')]);}logger[_0xea42('0x11')](_0xea42('0xd'),_0x416a6a,_0x4fe4cf['error'][_0xea42('0x13')]);return _0x1989b6(_0x4fe4cf[_0xea42('0x11')]['message']);}else{logger[_0xea42('0xc')](_0xea42('0xd'),_0x416a6a,_0xea42('0xe'));_0x1989b6(_0x4fe4cf[_0xea42('0x14')][_0xea42('0x13')]);}})[_0xea42('0x15')](function(_0x3728d5){logger[_0xea42('0x11')]('FreshdeskField,\x20%s,\x20%s',_0x416a6a,_0x3728d5);_0x459eef(_0x3728d5);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 067fc2b..abd27dd 100644 --- a/server/api/intFreshsalesAccount/index.js +++ b/server/api/intFreshsalesAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5423=['create','post','addConfiguration','put','update','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','getFields'];(function(_0x3f1a6b,_0x1b0d61){var _0x118093=function(_0x17f991){while(--_0x17f991){_0x3f1a6b['push'](_0x3f1a6b['shift']());}};_0x118093(++_0x1b0d61);}(_0x5423,0xe3));var _0x3542=function(_0x3259fe,_0x4925fa){_0x3259fe=_0x3259fe-0x0;var _0xae7b06=_0x5423[_0x3259fe];return _0xae7b06;};'use strict';var multer=require(_0x3542('0x0'));var util=require(_0x3542('0x1'));var path=require('path');var timeout=require(_0x3542('0x2'));var express=require(_0x3542('0x3'));var router=express['Router']();var fs_extra=require(_0x3542('0x4'));var auth=require(_0x3542('0x5'));var interaction=require(_0x3542('0x6'));var config=require(_0x3542('0x7'));var controller=require('./intFreshsalesAccount.controller');router[_0x3542('0x8')]('/',auth[_0x3542('0x9')](),controller[_0x3542('0xa')]);router[_0x3542('0x8')](_0x3542('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x3542('0x8')](_0x3542('0xc'),auth['isAuthenticated'](),controller[_0x3542('0xd')]);router[_0x3542('0x8')]('/:id/fields',auth[_0x3542('0x9')](),controller[_0x3542('0xe')]);router['post']('/',auth[_0x3542('0x9')](),controller[_0x3542('0xf')]);router[_0x3542('0x10')](_0x3542('0xc'),auth[_0x3542('0x9')](),controller[_0x3542('0x11')]);router[_0x3542('0x12')](_0x3542('0xb'),auth[_0x3542('0x9')](),controller[_0x3542('0x13')]);router[_0x3542('0x14')](_0x3542('0xb'),auth[_0x3542('0x9')](),controller['destroy']);module[_0x3542('0x15')]=router; \ No newline at end of file +var _0x96cc=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','path','express','Router'];(function(_0x320dd0,_0x266a5b){var _0x1ffb02=function(_0x23fc0c){while(--_0x23fc0c){_0x320dd0['push'](_0x320dd0['shift']());}};_0x1ffb02(++_0x266a5b);}(_0x96cc,0x16c));var _0xc96c=function(_0x243fda,_0x4047fb){_0x243fda=_0x243fda-0x0;var _0x2f1c94=_0x96cc[_0x243fda];return _0x2f1c94;};'use strict';var multer=require(_0xc96c('0x0'));var util=require('util');var path=require(_0xc96c('0x1'));var timeout=require('connect-timeout');var express=require(_0xc96c('0x2'));var router=express[_0xc96c('0x3')]();var fs_extra=require(_0xc96c('0x4'));var auth=require(_0xc96c('0x5'));var interaction=require(_0xc96c('0x6'));var config=require(_0xc96c('0x7'));var controller=require(_0xc96c('0x8'));router[_0xc96c('0x9')]('/',auth[_0xc96c('0xa')](),controller['index']);router[_0xc96c('0x9')](_0xc96c('0xb'),auth[_0xc96c('0xa')](),controller[_0xc96c('0xc')]);router[_0xc96c('0x9')](_0xc96c('0xd'),auth[_0xc96c('0xa')](),controller['getConfigurations']);router[_0xc96c('0x9')](_0xc96c('0xe'),auth[_0xc96c('0xa')](),controller['getFields']);router[_0xc96c('0xf')]('/',auth['isAuthenticated'](),controller[_0xc96c('0x10')]);router['post'](_0xc96c('0xd'),auth[_0xc96c('0xa')](),controller[_0xc96c('0x11')]);router[_0xc96c('0x12')]('/:id',auth[_0xc96c('0xa')](),controller[_0xc96c('0x13')]);router[_0xc96c('0x14')](_0xc96c('0xb'),auth['isAuthenticated'](),controller[_0xc96c('0x15')]);module[_0xc96c('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 21aac92..0a6a200 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd824=['exports','STRING','username','remoteUri','sequelize'];(function(_0x5c6835,_0x5d3a05){var _0x125843=function(_0x22409a){while(--_0x22409a){_0x5c6835['push'](_0x5c6835['shift']());}};_0x125843(++_0x5d3a05);}(_0xd824,0xc2));var _0x4d82=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xd824[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0x4d82('0x0'));module[_0x4d82('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4d82('0x2')],'unique':_0x4d82('0x3')},'apiKey':{'type':Sequelize[_0x4d82('0x2')]},'remoteUri':{'type':Sequelize[_0x4d82('0x2')],'unique':_0x4d82('0x4')},'serverUrl':{'type':Sequelize[_0x4d82('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x0424=['username','STRING'];(function(_0x4598e9,_0x5805f5){var _0x32e5b7=function(_0x3a68c6){while(--_0x3a68c6){_0x4598e9['push'](_0x4598e9['shift']());}};_0x32e5b7(++_0x5805f5);}(_0x0424,0x159));var _0x4042=function(_0x4c6bca,_0x3de390){_0x4c6bca=_0x4c6bca-0x0;var _0x29d58e=_0x0424[_0x4c6bca];return _0x29d58e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4042('0x0')]},'description':{'type':Sequelize[_0x4042('0x0')]},'username':{'type':Sequelize[_0x4042('0x0')],'unique':_0x4042('0x1')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x4042('0x0')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index f45c962..e515094 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xebd9=['update','then','destroy','status','stack','name','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','keys','find','catch','create','body','params','getConfigurations','findOne','FreshsalesConfiguration','addConfiguration','AccountId','Subjects','channel','getDescriptions','FreshsalesField','Descriptions','username','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','Requested\x20Resource\x20not\x20Found','test','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save'];(function(_0x4d1336,_0x57734d){var _0xdc30c5=function(_0x5b459c){while(--_0x5b459c){_0x4d1336['push'](_0x4d1336['shift']());}};_0xdc30c5(++_0x57734d);}(_0xebd9,0xb0));var _0x9ebd=function(_0x3b2156,_0x30a37c){_0x3b2156=_0x3b2156-0x0;var _0x1a18f8=_0xebd9[_0x3b2156];return _0x1a18f8;};'use strict';var emlformat=require(_0x9ebd('0x0'));var rimraf=require(_0x9ebd('0x1'));var zipdir=require(_0x9ebd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9ebd('0x3'));var moment=require(_0x9ebd('0x4'));var BPromise=require(_0x9ebd('0x5'));var Mustache=require('mustache');var util=require(_0x9ebd('0x6'));var path=require(_0x9ebd('0x7'));var sox=require(_0x9ebd('0x8'));var csv=require(_0x9ebd('0x9'));var ejs=require(_0x9ebd('0xa'));var fs=require('fs');var fs_extra=require(_0x9ebd('0xb'));var _=require(_0x9ebd('0xc'));var squel=require(_0x9ebd('0xd'));var crypto=require(_0x9ebd('0xe'));var jsforce=require(_0x9ebd('0xf'));var deskjs=require(_0x9ebd('0x10'));var toCsv=require(_0x9ebd('0x9'));var querystring=require(_0x9ebd('0x11'));var Papa=require(_0x9ebd('0x12'));var Redis=require('ioredis');var authService=require(_0x9ebd('0x13'));var qs=require(_0x9ebd('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9ebd('0x15'));var logger=require(_0x9ebd('0x16'))(_0x9ebd('0x17'));var utils=require(_0x9ebd('0x18'));var config=require(_0x9ebd('0x19'));var licenseUtil=require(_0x9ebd('0x1a'));var db=require(_0x9ebd('0x1b'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x21e488,_0x41a659){_0x41a659=_0x41a659||0xcc;return function(_0x2acf29){if(_0x2acf29){return _0x21e488[_0x9ebd('0x1c')](_0x41a659);}return _0x21e488['status'](_0x41a659)[_0x9ebd('0x1d')]();};}function respondWithResult(_0x3a9ca1,_0xac96f1){_0xac96f1=_0xac96f1||0xc8;return function(_0x5c4ce2){if(_0x5c4ce2){return _0x3a9ca1['status'](_0xac96f1)['json'](_0x5c4ce2);}};}function respondWithFilteredResult(_0x33daa4,_0x6a284f){return function(_0x130893){if(_0x130893){var _0x3c76ee=typeof _0x6a284f[_0x9ebd('0x1e')]===_0x9ebd('0x1f')&&typeof _0x6a284f['limit']===_0x9ebd('0x1f');var _0x2038bf=_0x130893[_0x9ebd('0x20')];var _0x5a98be=_0x3c76ee?0x0:_0x6a284f[_0x9ebd('0x1e')];var _0xf54e35=_0x3c76ee?_0x130893[_0x9ebd('0x20')]:_0x6a284f[_0x9ebd('0x1e')]+_0x6a284f[_0x9ebd('0x21')];var _0x2cf95e;if(_0xf54e35>=_0x2038bf){_0xf54e35=_0x2038bf;_0x2cf95e=0xc8;}else{_0x2cf95e=0xce;}_0x33daa4['status'](_0x2cf95e);return _0x33daa4[_0x9ebd('0x22')](_0x9ebd('0x23'),_0x5a98be+'-'+_0xf54e35+'/'+_0x2038bf)[_0x9ebd('0x24')](_0x130893);}return null;};}function patchUpdates(_0x4a4f2a){return function(_0xabc3d){try{jsonpatch[_0x9ebd('0x25')](_0xabc3d,_0x4a4f2a,!![]);}catch(_0x1ea345){return BPromise[_0x9ebd('0x26')](_0x1ea345);}return _0xabc3d[_0x9ebd('0x27')]();};}function saveUpdates(_0x27f953,_0x782e1c){return function(_0x117d09){if(_0x117d09){return _0x117d09[_0x9ebd('0x28')](_0x27f953)[_0x9ebd('0x29')](function(_0x4d731e){return _0x4d731e;});}return null;};}function removeEntity(_0x97eff1,_0x3ed76a){return function(_0x15a59d){if(_0x15a59d){return _0x15a59d[_0x9ebd('0x2a')]()[_0x9ebd('0x29')](function(){_0x97eff1[_0x9ebd('0x2b')](0xcc)[_0x9ebd('0x1d')]();});}};}function handleEntityNotFound(_0x23fa47,_0x1c5218){return function(_0x40c164){if(!_0x40c164){_0x23fa47['sendStatus'](0x194);}return _0x40c164;};}function handleError(_0x4d9cbc,_0x52f31d){_0x52f31d=_0x52f31d||0x1f4;return function(_0x10605c){logger['error'](_0x10605c[_0x9ebd('0x2c')]);if(_0x10605c[_0x9ebd('0x2d')]){delete _0x10605c[_0x9ebd('0x2d')];}_0x4d9cbc[_0x9ebd('0x2b')](_0x52f31d)['send'](_0x10605c);};}exports[_0x9ebd('0x2e')]=function(_0x189f35,_0x25ecbe){var _0x56a0bb={},_0x532680={},_0x569433={'count':0x0,'rows':[]};var _0x46bce4=_[_0x9ebd('0x2f')](db[_0x9ebd('0x30')][_0x9ebd('0x31')],function(_0x4cb658){return{'name':_0x4cb658[_0x9ebd('0x32')],'type':_0x4cb658[_0x9ebd('0x33')][_0x9ebd('0x34')]};});_0x532680[_0x9ebd('0x35')]=_['map'](_0x46bce4,_0x9ebd('0x2d'));_0x532680[_0x9ebd('0x36')]=_['keys'](_0x189f35[_0x9ebd('0x36')]);_0x532680[_0x9ebd('0x37')]=_['intersection'](_0x532680['model'],_0x532680['query']);_0x56a0bb[_0x9ebd('0x38')]=_[_0x9ebd('0x39')](_0x532680[_0x9ebd('0x35')],qs['fields'](_0x189f35[_0x9ebd('0x36')][_0x9ebd('0x3a')]));_0x56a0bb[_0x9ebd('0x38')]=_0x56a0bb[_0x9ebd('0x38')][_0x9ebd('0x3b')]?_0x56a0bb[_0x9ebd('0x38')]:_0x532680['model'];if(!_0x189f35['query'][_0x9ebd('0x3c')]('nolimit')){_0x56a0bb['limit']=qs[_0x9ebd('0x21')](_0x189f35[_0x9ebd('0x36')][_0x9ebd('0x21')]);_0x56a0bb[_0x9ebd('0x1e')]=qs[_0x9ebd('0x1e')](_0x189f35[_0x9ebd('0x36')][_0x9ebd('0x1e')]);}_0x56a0bb[_0x9ebd('0x3d')]=qs[_0x9ebd('0x3e')](_0x189f35[_0x9ebd('0x36')][_0x9ebd('0x3e')]);_0x56a0bb[_0x9ebd('0x3f')]=qs[_0x9ebd('0x37')](_[_0x9ebd('0x40')](_0x189f35[_0x9ebd('0x36')],_0x532680[_0x9ebd('0x37')]),_0x46bce4);if(_0x189f35[_0x9ebd('0x36')][_0x9ebd('0x41')]){_0x56a0bb[_0x9ebd('0x3f')]=_[_0x9ebd('0x42')](_0x56a0bb['where'],{'$or':_[_0x9ebd('0x2f')](_0x46bce4,function(_0x299b9b){if(_0x299b9b[_0x9ebd('0x33')]!==_0x9ebd('0x43')){var _0x16574b={};_0x16574b[_0x299b9b['name']]={'$like':'%'+_0x189f35[_0x9ebd('0x36')][_0x9ebd('0x41')]+'%'};return _0x16574b;}})});}_0x56a0bb=_[_0x9ebd('0x42')]({},_0x56a0bb,_0x189f35[_0x9ebd('0x44')]);var _0x12fbe1={'where':_0x56a0bb[_0x9ebd('0x3f')]};return db[_0x9ebd('0x30')][_0x9ebd('0x20')](_0x12fbe1)[_0x9ebd('0x29')](function(_0x3e8607){_0x569433['count']=_0x3e8607;if(_0x189f35['query'][_0x9ebd('0x45')]){_0x56a0bb[_0x9ebd('0x46')]=[{'all':!![]}];}return db['FreshsalesAccount'][_0x9ebd('0x47')](_0x56a0bb);})[_0x9ebd('0x29')](function(_0x4d826c){_0x569433['rows']=_0x4d826c;return _0x569433;})[_0x9ebd('0x29')](respondWithFilteredResult(_0x25ecbe,_0x56a0bb))['catch'](handleError(_0x25ecbe,null));};exports[_0x9ebd('0x48')]=function(_0x27b634,_0x38f5a0){var _0xd7ecc2={'raw':![],'where':{'id':_0x27b634['params']['id']}},_0x33aec9={};_0x33aec9[_0x9ebd('0x35')]=_[_0x9ebd('0x49')](db[_0x9ebd('0x30')]['rawAttributes']);_0x33aec9[_0x9ebd('0x36')]=_['keys'](_0x27b634[_0x9ebd('0x36')]);_0x33aec9['filters']=_['intersection'](_0x33aec9[_0x9ebd('0x35')],_0x33aec9[_0x9ebd('0x36')]);_0xd7ecc2[_0x9ebd('0x38')]=_[_0x9ebd('0x39')](_0x33aec9[_0x9ebd('0x35')],qs[_0x9ebd('0x3a')](_0x27b634[_0x9ebd('0x36')][_0x9ebd('0x3a')]));_0xd7ecc2[_0x9ebd('0x38')]=_0xd7ecc2['attributes'][_0x9ebd('0x3b')]?_0xd7ecc2[_0x9ebd('0x38')]:_0x33aec9[_0x9ebd('0x35')];if(_0x27b634[_0x9ebd('0x36')][_0x9ebd('0x45')]){_0xd7ecc2[_0x9ebd('0x46')]=[{'all':!![]}];}_0xd7ecc2=_[_0x9ebd('0x42')]({},_0xd7ecc2,_0x27b634[_0x9ebd('0x44')]);return db['FreshsalesAccount'][_0x9ebd('0x4a')](_0xd7ecc2)[_0x9ebd('0x29')](handleEntityNotFound(_0x38f5a0,null))[_0x9ebd('0x29')](respondWithResult(_0x38f5a0,null))[_0x9ebd('0x4b')](handleError(_0x38f5a0,null));};exports[_0x9ebd('0x4c')]=function(_0x26a7c5,_0x2cdeb8){return db[_0x9ebd('0x30')][_0x9ebd('0x4c')](_0x26a7c5['body'],{})[_0x9ebd('0x29')](respondWithResult(_0x2cdeb8,0xc9))[_0x9ebd('0x4b')](handleError(_0x2cdeb8,null));};exports[_0x9ebd('0x28')]=function(_0x506aa3,_0x1aa092){if(_0x506aa3['body']['id']){delete _0x506aa3[_0x9ebd('0x4d')]['id'];}return db[_0x9ebd('0x30')][_0x9ebd('0x4a')]({'where':{'id':_0x506aa3[_0x9ebd('0x4e')]['id']}})[_0x9ebd('0x29')](handleEntityNotFound(_0x1aa092,null))['then'](saveUpdates(_0x506aa3['body'],null))['then'](respondWithResult(_0x1aa092,null))[_0x9ebd('0x4b')](handleError(_0x1aa092,null));};exports['destroy']=function(_0x2e81b4,_0x57d08f){return db[_0x9ebd('0x30')][_0x9ebd('0x4a')]({'where':{'id':_0x2e81b4[_0x9ebd('0x4e')]['id']}})['then'](handleEntityNotFound(_0x57d08f,null))[_0x9ebd('0x29')](removeEntity(_0x57d08f,null))[_0x9ebd('0x4b')](handleError(_0x57d08f,null));};exports[_0x9ebd('0x4f')]=function(_0x10fc26,_0x3fbf74,_0x2425f0){var _0x291218={};var _0xb71c90={};var _0x1eadd1;var _0x818759;return db[_0x9ebd('0x30')][_0x9ebd('0x50')]({'where':{'id':_0x10fc26['params']['id']}})['then'](handleEntityNotFound(_0x3fbf74,null))[_0x9ebd('0x29')](function(_0x186955){if(_0x186955){_0x1eadd1=_0x186955;_0xb71c90[_0x9ebd('0x35')]=_[_0x9ebd('0x49')](db[_0x9ebd('0x51')]['rawAttributes']);_0xb71c90['query']=_[_0x9ebd('0x49')](_0x10fc26['query']);_0xb71c90[_0x9ebd('0x37')]=_[_0x9ebd('0x39')](_0xb71c90[_0x9ebd('0x35')],_0xb71c90[_0x9ebd('0x36')]);_0x291218[_0x9ebd('0x38')]=_[_0x9ebd('0x39')](_0xb71c90[_0x9ebd('0x35')],qs[_0x9ebd('0x3a')](_0x10fc26[_0x9ebd('0x36')][_0x9ebd('0x3a')]));_0x291218[_0x9ebd('0x38')]=_0x291218[_0x9ebd('0x38')][_0x9ebd('0x3b')]?_0x291218['attributes']:_0xb71c90['model'];_0x291218[_0x9ebd('0x3d')]=qs[_0x9ebd('0x3e')](_0x10fc26[_0x9ebd('0x36')][_0x9ebd('0x3e')]);_0x291218[_0x9ebd('0x3f')]=qs[_0x9ebd('0x37')](_[_0x9ebd('0x40')](_0x10fc26[_0x9ebd('0x36')],_0xb71c90[_0x9ebd('0x37')]));if(_0x10fc26[_0x9ebd('0x36')][_0x9ebd('0x41')]){_0x291218[_0x9ebd('0x3f')]=_[_0x9ebd('0x42')](_0x291218['where'],{'$or':_[_0x9ebd('0x2f')](_0x291218['attributes'],function(_0xdb9dac){var _0x1b3e96={};_0x1b3e96[_0xdb9dac]={'$like':'%'+_0x10fc26[_0x9ebd('0x36')][_0x9ebd('0x41')]+'%'};return _0x1b3e96;})});}_0x291218=_['merge']({},_0x291218,_0x10fc26[_0x9ebd('0x44')]);return _0x1eadd1[_0x9ebd('0x4f')](_0x291218);}})[_0x9ebd('0x29')](function(_0x58b341){if(_0x58b341){_0x818759=_0x58b341[_0x9ebd('0x3b')];if(!_0x10fc26[_0x9ebd('0x36')][_0x9ebd('0x3c')]('nolimit')){_0x291218[_0x9ebd('0x21')]=qs[_0x9ebd('0x21')](_0x10fc26['query'][_0x9ebd('0x21')]);_0x291218[_0x9ebd('0x1e')]=qs[_0x9ebd('0x1e')](_0x10fc26[_0x9ebd('0x36')][_0x9ebd('0x1e')]);}return _0x1eadd1['getConfigurations'](_0x291218);}})[_0x9ebd('0x29')](function(_0x2e9cd6){if(_0x2e9cd6){return _0x2e9cd6?{'count':_0x818759,'rows':_0x2e9cd6}:null;}})['then'](respondWithResult(_0x3fbf74,null))[_0x9ebd('0x4b')](handleError(_0x3fbf74,null));};exports[_0x9ebd('0x52')]=function(_0x27d40e,_0x4a1cae,_0xb88c8f){if(_0x27d40e['body']['id']){delete _0x27d40e[_0x9ebd('0x4d')]['id'];}return db['FreshsalesAccount'][_0x9ebd('0x50')]({'where':{'id':_0x27d40e[_0x9ebd('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4a1cae,null))[_0x9ebd('0x29')](function(_0x3a13a1){if(_0x3a13a1){_0x27d40e['body'][_0x9ebd('0x53')]=_0x3a13a1['id'];_0x27d40e[_0x9ebd('0x4d')][_0x9ebd('0x54')]=integrations['getSubjects'](_0x27d40e['body'][_0x9ebd('0x55')],_0x27d40e[_0x9ebd('0x4d')][_0x9ebd('0x33')]);_0x27d40e['body']['Descriptions']=integrations[_0x9ebd('0x56')](_0x27d40e[_0x9ebd('0x4d')]['channel'],_0x27d40e[_0x9ebd('0x4d')][_0x9ebd('0x33')]);return db[_0x9ebd('0x51')][_0x9ebd('0x4c')](_0x27d40e[_0x9ebd('0x4d')],{'include':[{'model':db[_0x9ebd('0x57')],'as':_0x9ebd('0x54')},{'model':db[_0x9ebd('0x57')],'as':_0x9ebd('0x58')}]});}return null;})[_0x9ebd('0x29')](respondWithResult(_0x4a1cae,null))[_0x9ebd('0x4b')](handleError(_0x4a1cae,null));};exports['getFields']=function(_0x22a05c,_0x30d072,_0x29c600){var _0x25dedc='';var _0x3e2067='';return db[_0x9ebd('0x30')][_0x9ebd('0x50')]({'where':{'id':_0x22a05c[_0x9ebd('0x4e')]['id']},'attributes':['id',_0x9ebd('0x59'),_0x9ebd('0x5a'),_0x9ebd('0x5b')]})[_0x9ebd('0x29')](handleEntityNotFound(_0x30d072,null))[_0x9ebd('0x29')](function(_0x1e6053){if(_0x1e6053){_0x3e2067=_0x1e6053['username'];_0x25dedc=_0x1e6053[_0x9ebd('0x5a')];var _0x5a2553=_0x1e6053[_0x9ebd('0x5a')][_0x9ebd('0x5c')](-0x1);if(_0x5a2553==='/'){_0x25dedc=_0x25dedc[_0x9ebd('0x5d')](0x0,_0x25dedc[_0x9ebd('0x5e')](_0x5a2553));}return rp({'method':_0x9ebd('0x5f'),'uri':util[_0x9ebd('0x60')](_0x9ebd('0x61'),_0x25dedc,_0x9ebd('0x62')),'headers':{'Authorization':_0x9ebd('0x63')+_0x1e6053[_0x9ebd('0x5b')]},'json':!![]});}})[_0x9ebd('0x29')](function(_0x3bb6ac){if(_0x3bb6ac){var _0x4acf1d=_0x3bb6ac[_0x9ebd('0x64')];var _0x59128e=![];var _0x148b97=null;for(_0x148b97=0x0;_0x148b97<_0x4acf1d[_0x9ebd('0x3b')];_0x148b97++){if(_0x4acf1d[_0x148b97]['email']===_0x3e2067){_0x59128e=!![];}}if(_0x59128e){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x9ebd('0x65')});}}})[_0x9ebd('0x29')](respondWithResult(_0x30d072,null))[_0x9ebd('0x4b')](function(_0x49e646){var _0x4f8871=_0x22a05c[_0x9ebd('0x36')][_0x9ebd('0x66')]?0x1f4:_0x49e646['statusCode']||0x1f4;logger[_0x9ebd('0x67')](_0x9ebd('0x68'),_0x9ebd('0x69'),_0x4f8871,JSON[_0x9ebd('0x6a')](_0x49e646));delete _0x49e646[_0x9ebd('0x2d')];if(_0x4f8871===0x191){_0x4f8871=0x190;}_0x30d072[_0x9ebd('0x2b')](_0x4f8871)['send'](_0x22a05c[_0x9ebd('0x36')][_0x9ebd('0x66')]?{'message':_0x9ebd('0x6b'),'statusCode':_0x49e646['statusCode']}:_0x49e646);});}; \ No newline at end of file +var _0x8402=['AccountId','Subjects','getSubjects','channel','Descriptions','FreshsalesField','getFields','username','remoteUri','apiKey','slice','substring','GET','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','undefined','offset','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','map','FreshsalesAccount','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','filters','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','catch','show','rawAttributes','find','create','body','params','getConfigurations','findOne','FreshsalesConfiguration','pick','hasOwnProperty','addConfiguration'];(function(_0x5d860f,_0x467498){var _0x236490=function(_0x5e045c){while(--_0x5e045c){_0x5d860f['push'](_0x5d860f['shift']());}};_0x236490(++_0x467498);}(_0x8402,0xe0));var _0x2840=function(_0x40c51d,_0x148651){_0x40c51d=_0x40c51d-0x0;var _0x4f74f9=_0x8402[_0x40c51d];return _0x4f74f9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2840('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2840('0x1'));var rp=require(_0x2840('0x2'));var moment=require(_0x2840('0x3'));var BPromise=require(_0x2840('0x4'));var Mustache=require(_0x2840('0x5'));var util=require(_0x2840('0x6'));var path=require(_0x2840('0x7'));var sox=require(_0x2840('0x8'));var csv=require(_0x2840('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2840('0xa'));var squel=require(_0x2840('0xb'));var crypto=require(_0x2840('0xc'));var jsforce=require(_0x2840('0xd'));var deskjs=require(_0x2840('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2840('0xf'));var Papa=require(_0x2840('0x10'));var Redis=require(_0x2840('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2840('0x12'));var as=require(_0x2840('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x2840('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x2840('0x15'));var db=require(_0x2840('0x16'))['db'];var integrations=require(_0x2840('0x17'));function respondWithStatusCode(_0x38d4a6,_0x19b99d){_0x19b99d=_0x19b99d||0xcc;return function(_0x308548){if(_0x308548){return _0x38d4a6[_0x2840('0x18')](_0x19b99d);}return _0x38d4a6['status'](_0x19b99d)[_0x2840('0x19')]();};}function respondWithResult(_0x40fc51,_0x2491d8){_0x2491d8=_0x2491d8||0xc8;return function(_0x1c77ef){if(_0x1c77ef){return _0x40fc51[_0x2840('0x1a')](_0x2491d8)[_0x2840('0x1b')](_0x1c77ef);}};}function respondWithFilteredResult(_0x235cbc,_0x3e1996){return function(_0x4614fc){if(_0x4614fc){var _0x25631c=typeof _0x3e1996['offset']==='undefined'&&typeof _0x3e1996['limit']===_0x2840('0x1c');var _0x3edd22=_0x4614fc['count'];var _0x51ed7e=_0x25631c?0x0:_0x3e1996[_0x2840('0x1d')];var _0x2a25ba=_0x25631c?_0x4614fc[_0x2840('0x1e')]:_0x3e1996[_0x2840('0x1d')]+_0x3e1996[_0x2840('0x1f')];var _0x1eeaaa;if(_0x2a25ba>=_0x3edd22){_0x2a25ba=_0x3edd22;_0x1eeaaa=0xc8;}else{_0x1eeaaa=0xce;}_0x235cbc[_0x2840('0x1a')](_0x1eeaaa);return _0x235cbc[_0x2840('0x20')](_0x2840('0x21'),_0x51ed7e+'-'+_0x2a25ba+'/'+_0x3edd22)[_0x2840('0x1b')](_0x4614fc);}return null;};}function patchUpdates(_0x11b510){return function(_0x1e2754){try{jsonpatch[_0x2840('0x22')](_0x1e2754,_0x11b510,!![]);}catch(_0x42f9c6){return BPromise[_0x2840('0x23')](_0x42f9c6);}return _0x1e2754['save']();};}function saveUpdates(_0x23bcba,_0x59c11c){return function(_0x193a65){if(_0x193a65){return _0x193a65[_0x2840('0x24')](_0x23bcba)[_0x2840('0x25')](function(_0x388631){return _0x388631;});}return null;};}function removeEntity(_0x427e94,_0x14fa76){return function(_0x424199){if(_0x424199){return _0x424199[_0x2840('0x26')]()[_0x2840('0x25')](function(){_0x427e94['status'](0xcc)[_0x2840('0x19')]();});}};}function handleEntityNotFound(_0x300f27,_0x501c85){return function(_0x1866b9){if(!_0x1866b9){_0x300f27[_0x2840('0x18')](0x194);}return _0x1866b9;};}function handleError(_0x5db97e,_0x34f38e){_0x34f38e=_0x34f38e||0x1f4;return function(_0x1abe5e){logger[_0x2840('0x27')](_0x1abe5e[_0x2840('0x28')]);if(_0x1abe5e[_0x2840('0x29')]){delete _0x1abe5e[_0x2840('0x29')];}_0x5db97e[_0x2840('0x1a')](_0x34f38e)['send'](_0x1abe5e);};}exports['index']=function(_0xeb9c76,_0x100426){var _0x1f69c1={},_0x46b92c={},_0x582930={'count':0x0,'rows':[]};var _0x37b8ca=_[_0x2840('0x2a')](db[_0x2840('0x2b')]['rawAttributes'],function(_0x523184){return{'name':_0x523184[_0x2840('0x2c')],'type':_0x523184[_0x2840('0x2d')][_0x2840('0x2e')]};});_0x46b92c[_0x2840('0x2f')]=_[_0x2840('0x2a')](_0x37b8ca,'name');_0x46b92c[_0x2840('0x30')]=_[_0x2840('0x31')](_0xeb9c76['query']);_0x46b92c['filters']=_[_0x2840('0x32')](_0x46b92c[_0x2840('0x2f')],_0x46b92c[_0x2840('0x30')]);_0x1f69c1[_0x2840('0x33')]=_['intersection'](_0x46b92c[_0x2840('0x2f')],qs[_0x2840('0x34')](_0xeb9c76['query'][_0x2840('0x34')]));_0x1f69c1[_0x2840('0x33')]=_0x1f69c1[_0x2840('0x33')][_0x2840('0x35')]?_0x1f69c1[_0x2840('0x33')]:_0x46b92c[_0x2840('0x2f')];if(!_0xeb9c76[_0x2840('0x30')]['hasOwnProperty'](_0x2840('0x36'))){_0x1f69c1['limit']=qs['limit'](_0xeb9c76['query'][_0x2840('0x1f')]);_0x1f69c1[_0x2840('0x1d')]=qs['offset'](_0xeb9c76['query'][_0x2840('0x1d')]);}_0x1f69c1[_0x2840('0x37')]=qs[_0x2840('0x38')](_0xeb9c76[_0x2840('0x30')]['sort']);_0x1f69c1['where']=qs[_0x2840('0x39')](_['pick'](_0xeb9c76['query'],_0x46b92c[_0x2840('0x39')]),_0x37b8ca);if(_0xeb9c76[_0x2840('0x30')]['filter']){_0x1f69c1['where']=_['merge'](_0x1f69c1[_0x2840('0x3a')],{'$or':_[_0x2840('0x2a')](_0x37b8ca,function(_0x251e5f){if(_0x251e5f[_0x2840('0x2d')]!==_0x2840('0x3b')){var _0x488b37={};_0x488b37[_0x251e5f['name']]={'$like':'%'+_0xeb9c76[_0x2840('0x30')][_0x2840('0x3c')]+'%'};return _0x488b37;}})});}_0x1f69c1=_[_0x2840('0x3d')]({},_0x1f69c1,_0xeb9c76[_0x2840('0x3e')]);var _0x4cb352={'where':_0x1f69c1[_0x2840('0x3a')]};return db['FreshsalesAccount']['count'](_0x4cb352)[_0x2840('0x25')](function(_0x3e40ad){_0x582930[_0x2840('0x1e')]=_0x3e40ad;if(_0xeb9c76[_0x2840('0x30')][_0x2840('0x3f')]){_0x1f69c1[_0x2840('0x40')]=[{'all':!![]}];}return db['FreshsalesAccount'][_0x2840('0x41')](_0x1f69c1);})['then'](function(_0x3347e1){_0x582930['rows']=_0x3347e1;return _0x582930;})[_0x2840('0x25')](respondWithFilteredResult(_0x100426,_0x1f69c1))[_0x2840('0x42')](handleError(_0x100426,null));};exports[_0x2840('0x43')]=function(_0x5c9436,_0x28743d){var _0x50381d={'raw':![],'where':{'id':_0x5c9436['params']['id']}},_0x3bbecf={};_0x3bbecf['model']=_['keys'](db[_0x2840('0x2b')][_0x2840('0x44')]);_0x3bbecf[_0x2840('0x30')]=_['keys'](_0x5c9436['query']);_0x3bbecf[_0x2840('0x39')]=_[_0x2840('0x32')](_0x3bbecf[_0x2840('0x2f')],_0x3bbecf[_0x2840('0x30')]);_0x50381d['attributes']=_[_0x2840('0x32')](_0x3bbecf['model'],qs[_0x2840('0x34')](_0x5c9436['query'][_0x2840('0x34')]));_0x50381d[_0x2840('0x33')]=_0x50381d[_0x2840('0x33')][_0x2840('0x35')]?_0x50381d['attributes']:_0x3bbecf[_0x2840('0x2f')];if(_0x5c9436[_0x2840('0x30')][_0x2840('0x3f')]){_0x50381d[_0x2840('0x40')]=[{'all':!![]}];}_0x50381d=_[_0x2840('0x3d')]({},_0x50381d,_0x5c9436['options']);return db['FreshsalesAccount'][_0x2840('0x45')](_0x50381d)['then'](handleEntityNotFound(_0x28743d,null))[_0x2840('0x25')](respondWithResult(_0x28743d,null))[_0x2840('0x42')](handleError(_0x28743d,null));};exports[_0x2840('0x46')]=function(_0x2ef791,_0xa44a31){return db[_0x2840('0x2b')][_0x2840('0x46')](_0x2ef791['body'],{})[_0x2840('0x25')](respondWithResult(_0xa44a31,0xc9))[_0x2840('0x42')](handleError(_0xa44a31,null));};exports[_0x2840('0x24')]=function(_0x3297f7,_0x169d26){if(_0x3297f7[_0x2840('0x47')]['id']){delete _0x3297f7[_0x2840('0x47')]['id'];}return db[_0x2840('0x2b')]['find']({'where':{'id':_0x3297f7[_0x2840('0x48')]['id']}})[_0x2840('0x25')](handleEntityNotFound(_0x169d26,null))[_0x2840('0x25')](saveUpdates(_0x3297f7[_0x2840('0x47')],null))[_0x2840('0x25')](respondWithResult(_0x169d26,null))[_0x2840('0x42')](handleError(_0x169d26,null));};exports[_0x2840('0x26')]=function(_0x43e172,_0x53e897){return db[_0x2840('0x2b')][_0x2840('0x45')]({'where':{'id':_0x43e172['params']['id']}})['then'](handleEntityNotFound(_0x53e897,null))[_0x2840('0x25')](removeEntity(_0x53e897,null))[_0x2840('0x42')](handleError(_0x53e897,null));};exports[_0x2840('0x49')]=function(_0x151ba6,_0x5381b5,_0x25aa3e){var _0x23d749={};var _0x1713d5={};var _0x7ffddb;var _0x12e451;return db[_0x2840('0x2b')][_0x2840('0x4a')]({'where':{'id':_0x151ba6[_0x2840('0x48')]['id']}})[_0x2840('0x25')](handleEntityNotFound(_0x5381b5,null))['then'](function(_0x196f09){if(_0x196f09){_0x7ffddb=_0x196f09;_0x1713d5[_0x2840('0x2f')]=_[_0x2840('0x31')](db[_0x2840('0x4b')]['rawAttributes']);_0x1713d5[_0x2840('0x30')]=_[_0x2840('0x31')](_0x151ba6['query']);_0x1713d5[_0x2840('0x39')]=_[_0x2840('0x32')](_0x1713d5[_0x2840('0x2f')],_0x1713d5['query']);_0x23d749[_0x2840('0x33')]=_[_0x2840('0x32')](_0x1713d5['model'],qs[_0x2840('0x34')](_0x151ba6[_0x2840('0x30')][_0x2840('0x34')]));_0x23d749[_0x2840('0x33')]=_0x23d749[_0x2840('0x33')][_0x2840('0x35')]?_0x23d749[_0x2840('0x33')]:_0x1713d5[_0x2840('0x2f')];_0x23d749[_0x2840('0x37')]=qs[_0x2840('0x38')](_0x151ba6[_0x2840('0x30')]['sort']);_0x23d749[_0x2840('0x3a')]=qs['filters'](_[_0x2840('0x4c')](_0x151ba6['query'],_0x1713d5['filters']));if(_0x151ba6[_0x2840('0x30')][_0x2840('0x3c')]){_0x23d749[_0x2840('0x3a')]=_[_0x2840('0x3d')](_0x23d749['where'],{'$or':_[_0x2840('0x2a')](_0x23d749['attributes'],function(_0x320a13){var _0x562b13={};_0x562b13[_0x320a13]={'$like':'%'+_0x151ba6[_0x2840('0x30')]['filter']+'%'};return _0x562b13;})});}_0x23d749=_[_0x2840('0x3d')]({},_0x23d749,_0x151ba6['options']);return _0x7ffddb[_0x2840('0x49')](_0x23d749);}})['then'](function(_0x3e155d){if(_0x3e155d){_0x12e451=_0x3e155d[_0x2840('0x35')];if(!_0x151ba6[_0x2840('0x30')][_0x2840('0x4d')](_0x2840('0x36'))){_0x23d749[_0x2840('0x1f')]=qs['limit'](_0x151ba6[_0x2840('0x30')][_0x2840('0x1f')]);_0x23d749[_0x2840('0x1d')]=qs[_0x2840('0x1d')](_0x151ba6[_0x2840('0x30')][_0x2840('0x1d')]);}return _0x7ffddb[_0x2840('0x49')](_0x23d749);}})[_0x2840('0x25')](function(_0x9bc2e1){if(_0x9bc2e1){return _0x9bc2e1?{'count':_0x12e451,'rows':_0x9bc2e1}:null;}})['then'](respondWithResult(_0x5381b5,null))['catch'](handleError(_0x5381b5,null));};exports[_0x2840('0x4e')]=function(_0x313292,_0x5e61c6,_0x55915d){if(_0x313292[_0x2840('0x47')]['id']){delete _0x313292[_0x2840('0x47')]['id'];}return db[_0x2840('0x2b')]['findOne']({'where':{'id':_0x313292[_0x2840('0x48')]['id']}})['then'](handleEntityNotFound(_0x5e61c6,null))[_0x2840('0x25')](function(_0x5f0ffd){if(_0x5f0ffd){_0x313292[_0x2840('0x47')][_0x2840('0x4f')]=_0x5f0ffd['id'];_0x313292[_0x2840('0x47')][_0x2840('0x50')]=integrations[_0x2840('0x51')](_0x313292[_0x2840('0x47')][_0x2840('0x52')],_0x313292['body'][_0x2840('0x2d')]);_0x313292[_0x2840('0x47')][_0x2840('0x53')]=integrations['getDescriptions'](_0x313292[_0x2840('0x47')][_0x2840('0x52')],_0x313292['body'][_0x2840('0x2d')]);return db['FreshsalesConfiguration'][_0x2840('0x46')](_0x313292[_0x2840('0x47')],{'include':[{'model':db[_0x2840('0x54')],'as':_0x2840('0x50')},{'model':db[_0x2840('0x54')],'as':'Descriptions'}]});}return null;})[_0x2840('0x25')](respondWithResult(_0x5e61c6,null))['catch'](handleError(_0x5e61c6,null));};exports[_0x2840('0x55')]=function(_0xa0f2ab,_0x3d8125,_0x507bd8){var _0x23b44d='';var _0x1c0dfd='';return db[_0x2840('0x2b')][_0x2840('0x4a')]({'where':{'id':_0xa0f2ab[_0x2840('0x48')]['id']},'attributes':['id',_0x2840('0x56'),_0x2840('0x57'),_0x2840('0x58')]})[_0x2840('0x25')](handleEntityNotFound(_0x3d8125,null))[_0x2840('0x25')](function(_0x339b78){if(_0x339b78){_0x1c0dfd=_0x339b78[_0x2840('0x56')];_0x23b44d=_0x339b78[_0x2840('0x57')];var _0x48e601=_0x339b78['remoteUri'][_0x2840('0x59')](-0x1);if(_0x48e601==='/'){_0x23b44d=_0x23b44d[_0x2840('0x5a')](0x0,_0x23b44d['lastIndexOf'](_0x48e601));}return rp({'method':_0x2840('0x5b'),'uri':util['format']('%s%s',_0x23b44d,'/api/selector/owners'),'headers':{'Authorization':_0x2840('0x5c')+_0x339b78[_0x2840('0x58')]},'json':!![]});}})[_0x2840('0x25')](function(_0x2470c2){if(_0x2470c2){var _0x34365b=_0x2470c2[_0x2840('0x5d')];var _0x323822=![];var _0x4b0322=null;for(_0x4b0322=0x0;_0x4b0322<_0x34365b[_0x2840('0x35')];_0x4b0322++){if(_0x34365b[_0x4b0322][_0x2840('0x5e')]===_0x1c0dfd){_0x323822=!![];}}if(_0x323822){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x2840('0x5f')});}}})[_0x2840('0x25')](respondWithResult(_0x3d8125,null))[_0x2840('0x42')](function(_0x4a1550){var _0x586f96=_0xa0f2ab['query'][_0x2840('0x60')]?0x1f4:_0x4a1550[_0x2840('0x61')]||0x1f4;logger[_0x2840('0x27')](_0x2840('0x62'),_0x2840('0x55'),_0x586f96,JSON['stringify'](_0x4a1550));delete _0x4a1550[_0x2840('0x29')];if(_0x586f96===0x191){_0x586f96=0x190;}_0x3d8125[_0x2840('0x1a')](_0x586f96)[_0x2840('0x63')](_0xa0f2ab[_0x2840('0x30')][_0x2840('0x60')]?{'message':_0x2840('0x64'),'statusCode':_0x4a1550[_0x2840('0x61')]}:_0x4a1550);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index e75336d..c4af60e 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x81c6=['define','util','bluebird','request-promise','path','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x81c6,0x1d5));var _0x681c=function(_0x4b6804,_0x301b24){_0x4b6804=_0x4b6804-0x0;var _0x11b4f1=_0x81c6[_0x4b6804];return _0x11b4f1;};'use strict';var _=require('lodash');var util=require(_0x681c('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x681c('0x1'));var rp=require(_0x681c('0x2'));var fs=require('fs');var path=require(_0x681c('0x3'));var rimraf=require('rimraf');var config=require(_0x681c('0x4'));var attributes=require(_0x681c('0x5'));var integrations=require(_0x681c('0x6'));module[_0x681c('0x7')]=function(_0x4ea522,_0x45331){return _0x4ea522[_0x681c('0x8')]('FreshsalesAccount',attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3d04=['bluebird','request-promise','path','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','int_freshsales_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x3f6962,_0x2e558b){var _0x3565a7=function(_0x4a381c){while(--_0x4a381c){_0x3f6962['push'](_0x3f6962['shift']());}};_0x3565a7(++_0x2e558b);}(_0x3d04,0xbe));var _0x43d0=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x3d04[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x43d0('0x0'));var util=require(_0x43d0('0x1'));var logger=require(_0x43d0('0x2'))(_0x43d0('0x3'));var moment=require(_0x43d0('0x4'));var BPromise=require(_0x43d0('0x5'));var rp=require(_0x43d0('0x6'));var fs=require('fs');var path=require(_0x43d0('0x7'));var rimraf=require('rimraf');var config=require(_0x43d0('0x8'));var attributes=require(_0x43d0('0x9'));var integrations=require(_0x43d0('0xa'));module[_0x43d0('0xb')]=function(_0x5e284f,_0x484271){return _0x5e284f['define']('FreshsalesAccount',attributes,{'tableName':_0x43d0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index 8c5df81..b9d100a 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowFreshsalesAccount','lodash','util','moment'];(function(_0x4713c3,_0x39b203){var _0xd284e4=function(_0x271e12){while(--_0x271e12){_0x4713c3['push'](_0x4713c3['shift']());}};_0xd284e4(++_0x39b203);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xc4aa[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')]({'raw':_0x28e304[_0xac4a('0x18')]?_0x28e304['options'][_0xac4a('0x19')]===undefined?!![]:![]:!![],'where':_0x28e304[_0xac4a('0x18')]?_0x28e304[_0xac4a('0x18')][_0xac4a('0x1a')]||null:null,'attributes':_0x28e304[_0xac4a('0x18')]?_0x28e304[_0xac4a('0x18')][_0xac4a('0x1b')]||null:null,'limit':_0x28e304[_0xac4a('0x18')]?_0x28e304['options'][_0xac4a('0x1c')]||null:null,'include':_0x28e304[_0xac4a('0x18')]?_0x28e304['options'][_0xac4a('0x1d')]?_[_0xac4a('0x1e')](_0x28e304[_0xac4a('0x18')][_0xac4a('0x1d')],function(_0x4d2d6c){return{'model':db[_0x4d2d6c[_0xac4a('0x1f')]],'as':_0x4d2d6c['as'],'attributes':_0x4d2d6c[_0xac4a('0x1b')],'include':_0x4d2d6c[_0xac4a('0x1d')]?_[_0xac4a('0x1e')](_0x4d2d6c[_0xac4a('0x1d')],function(_0x2b0dc2){return{'model':db[_0x2b0dc2[_0xac4a('0x1f')]],'as':_0x2b0dc2['as'],'attributes':_0x2b0dc2[_0xac4a('0x1b')],'include':_0x2b0dc2[_0xac4a('0x1d')]?_[_0xac4a('0x1e')](_0x2b0dc2[_0xac4a('0x1d')],function(_0x215a31){return{'model':db[_0x215a31[_0xac4a('0x1f')]],'as':_0x215a31['as'],'attributes':_0x215a31[_0xac4a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xac4a('0xc')](function(_0x20202c){logger['info'](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON[_0xac4a('0x20')](_0x20202c));_0x546c5d(_0x20202c);})[_0xac4a('0x14')](function(_0x4a5a9e){logger['error'](_0xac4a('0x15'),_0x4a5a9e[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x4a5a9e['message']));});});};exports['ShowFreshsalesAccount']=function(_0x355755){var _0x2896bc=this;return new Promise(function(_0x228629,_0x432066){return db[_0xac4a('0x16')]['find']({'raw':_0x355755[_0xac4a('0x18')]?_0x355755['options'][_0xac4a('0x19')]===undefined?!![]:![]:!![],'where':_0x355755['options']?_0x355755[_0xac4a('0x18')][_0xac4a('0x1a')]||null:null,'attributes':_0x355755[_0xac4a('0x18')]?_0x355755[_0xac4a('0x18')][_0xac4a('0x1b')]||null:null,'include':_0x355755[_0xac4a('0x18')]?_0x355755[_0xac4a('0x18')][_0xac4a('0x1d')]?_[_0xac4a('0x1e')](_0x355755[_0xac4a('0x18')][_0xac4a('0x1d')],function(_0x1634df){return{'model':db[_0x1634df[_0xac4a('0x1f')]],'as':_0x1634df['as'],'attributes':_0x1634df[_0xac4a('0x1b')],'include':_0x1634df['include']?_[_0xac4a('0x1e')](_0x1634df[_0xac4a('0x1d')],function(_0x5a4e2b){return{'model':db[_0x5a4e2b[_0xac4a('0x1f')]],'as':_0x5a4e2b['as'],'attributes':_0x5a4e2b[_0xac4a('0x1b')],'include':_0x5a4e2b['include']?_['map'](_0x5a4e2b[_0xac4a('0x1d')],function(_0x1ba096){return{'model':db[_0x1ba096[_0xac4a('0x1f')]],'as':_0x1ba096['as'],'attributes':_0x1ba096[_0xac4a('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x453d02){logger[_0xac4a('0x13')]('ShowFreshsalesAccount',_0x355755);logger[_0xac4a('0xf')](_0xac4a('0x21'),_0x355755,JSON[_0xac4a('0x20')](_0x453d02));_0x228629(_0x453d02);})['catch'](function(_0x121328){logger[_0xac4a('0x10')](_0xac4a('0x21'),_0x121328['message'],_0x355755);_0x432066(_0x2896bc[_0xac4a('0x10')](0x1f4,_0x121328[_0xac4a('0x12')]));});});}; \ No newline at end of file +var _0x2ef3=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','FreshsalesAccount,\x20%s,\x20%s','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','where','include','model','map','attributes','ShowFreshsalesAccount','debug','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x3fbb06,_0x36a9ce){var _0x500510=function(_0x482098){while(--_0x482098){_0x3fbb06['push'](_0x3fbb06['shift']());}};_0x500510(++_0x36a9ce);}(_0x2ef3,0xba));var _0x32ef=function(_0x5e0633,_0xe69917){_0x5e0633=_0x5e0633-0x0;var _0x3a9296=_0x2ef3[_0x5e0633];return _0x3a9296;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('FreshsalesAccount,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}exports[_0x32ef('0x15')]=function(_0x1a9476){var _0x286bfb=this;return new Promise(function(_0x57863c,_0xbe37f6){return db[_0x32ef('0x16')]['findAll']({'raw':_0x1a9476[_0x32ef('0x17')]?_0x1a9476[_0x32ef('0x17')][_0x32ef('0x18')]===undefined?!![]:![]:!![],'where':_0x1a9476[_0x32ef('0x17')]?_0x1a9476[_0x32ef('0x17')][_0x32ef('0x19')]||null:null,'attributes':_0x1a9476['options']?_0x1a9476[_0x32ef('0x17')]['attributes']||null:null,'limit':_0x1a9476[_0x32ef('0x17')]?_0x1a9476[_0x32ef('0x17')]['limit']||null:null,'include':_0x1a9476[_0x32ef('0x17')]?_0x1a9476[_0x32ef('0x17')][_0x32ef('0x1a')]?_['map'](_0x1a9476['options'][_0x32ef('0x1a')],function(_0xb30fab){return{'model':db[_0xb30fab[_0x32ef('0x1b')]],'as':_0xb30fab['as'],'attributes':_0xb30fab['attributes'],'include':_0xb30fab['include']?_[_0x32ef('0x1c')](_0xb30fab['include'],function(_0x51a412){return{'model':db[_0x51a412[_0x32ef('0x1b')]],'as':_0x51a412['as'],'attributes':_0x51a412[_0x32ef('0x1d')],'include':_0x51a412[_0x32ef('0x1a')]?_[_0x32ef('0x1c')](_0x51a412[_0x32ef('0x1a')],function(_0x234175){return{'model':db[_0x234175[_0x32ef('0x1b')]],'as':_0x234175['as'],'attributes':_0x234175[_0x32ef('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x32ef('0xb')](function(_0x2f52d7){logger[_0x32ef('0xc')](_0x32ef('0x15'),_0x1a9476);logger['debug'](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x2f52d7));_0x57863c(_0x2f52d7);})['catch'](function(_0x12de1a){logger[_0x32ef('0x11')](_0x32ef('0x15'),_0x12de1a[_0x32ef('0x13')],_0x1a9476);_0xbe37f6(_0x286bfb['error'](0x1f4,_0x12de1a[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1e')]=function(_0x31dbc3){var _0x2ac686=this;return new Promise(function(_0x1b668a,_0x1a6ed2){return db[_0x32ef('0x16')]['find']({'raw':_0x31dbc3[_0x32ef('0x17')]?_0x31dbc3['options'][_0x32ef('0x18')]===undefined?!![]:![]:!![],'where':_0x31dbc3[_0x32ef('0x17')]?_0x31dbc3['options'][_0x32ef('0x19')]||null:null,'attributes':_0x31dbc3[_0x32ef('0x17')]?_0x31dbc3[_0x32ef('0x17')][_0x32ef('0x1d')]||null:null,'include':_0x31dbc3[_0x32ef('0x17')]?_0x31dbc3['options']['include']?_[_0x32ef('0x1c')](_0x31dbc3['options'][_0x32ef('0x1a')],function(_0x15b873){return{'model':db[_0x15b873[_0x32ef('0x1b')]],'as':_0x15b873['as'],'attributes':_0x15b873[_0x32ef('0x1d')],'include':_0x15b873[_0x32ef('0x1a')]?_[_0x32ef('0x1c')](_0x15b873['include'],function(_0x482d3a){return{'model':db[_0x482d3a['model']],'as':_0x482d3a['as'],'attributes':_0x482d3a[_0x32ef('0x1d')],'include':_0x482d3a[_0x32ef('0x1a')]?_[_0x32ef('0x1c')](_0x482d3a['include'],function(_0x4fb402){return{'model':db[_0x4fb402[_0x32ef('0x1b')]],'as':_0x4fb402['as'],'attributes':_0x4fb402[_0x32ef('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x32ef('0xb')](function(_0x480348){logger['info'](_0x32ef('0x1e'),_0x31dbc3);logger[_0x32ef('0x1f')](_0x32ef('0x1e'),_0x31dbc3,JSON[_0x32ef('0x10')](_0x480348));_0x1b668a(_0x480348);})[_0x32ef('0x14')](function(_0x211c79){logger[_0x32ef('0x11')](_0x32ef('0x1e'),_0x211c79[_0x32ef('0x13')],_0x31dbc3);_0x1a6ed2(_0x2ac686['error'](0x1f4,_0x211c79[_0x32ef('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 28f36e4..83d525c 100644 --- a/server/api/intFreshsalesConfiguration/index.js +++ b/server/api/intFreshsalesConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ca8=['/:id/fields','getFields','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','isAuthenticated','index','get','/:id','show'];(function(_0x5f084a,_0x53d22a){var _0x2d60c1=function(_0x43f3a7){while(--_0x43f3a7){_0x5f084a['push'](_0x5f084a['shift']());}};_0x2d60c1(++_0x53d22a);}(_0x8ca8,0x8c));var _0x88ca=function(_0xcf002c,_0x5103d5){_0xcf002c=_0xcf002c-0x0;var _0x4e4739=_0x8ca8[_0xcf002c];return _0x4e4739;};'use strict';var multer=require(_0x88ca('0x0'));var util=require(_0x88ca('0x1'));var path=require(_0x88ca('0x2'));var timeout=require(_0x88ca('0x3'));var express=require(_0x88ca('0x4'));var router=express[_0x88ca('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x88ca('0x6'));var config=require(_0x88ca('0x7'));var controller=require(_0x88ca('0x8'));router['get']('/',auth[_0x88ca('0x9')](),controller[_0x88ca('0xa')]);router[_0x88ca('0xb')](_0x88ca('0xc'),auth[_0x88ca('0x9')](),controller[_0x88ca('0xd')]);router[_0x88ca('0xb')]('/:id/subjects',auth[_0x88ca('0x9')](),controller['getSubjects']);router[_0x88ca('0xb')]('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router[_0x88ca('0xb')](_0x88ca('0xe'),auth['isAuthenticated'](),controller[_0x88ca('0xf')]);router['post']('/',auth[_0x88ca('0x9')](),controller[_0x88ca('0x10')]);router[_0x88ca('0x11')](_0x88ca('0xc'),auth['isAuthenticated'](),controller[_0x88ca('0x12')]);router[_0x88ca('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x88ca('0x14')]);module[_0x88ca('0x15')]=router; \ No newline at end of file +var _0x20d3=['path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/subjects','/:id/fields','getFields','post','create','delete','destroy','exports','multer','util'];(function(_0x5e6624,_0x5c2455){var _0x5d27ed=function(_0xfc11e3){while(--_0xfc11e3){_0x5e6624['push'](_0x5e6624['shift']());}};_0x5d27ed(++_0x5c2455);}(_0x20d3,0x1cc));var _0x320d=function(_0x30f51f,_0x1e11bc){_0x30f51f=_0x30f51f-0x0;var _0x4207b7=_0x20d3[_0x30f51f];return _0x4207b7;};'use strict';var multer=require(_0x320d('0x0'));var util=require(_0x320d('0x1'));var path=require(_0x320d('0x2'));var timeout=require('connect-timeout');var express=require(_0x320d('0x3'));var router=express[_0x320d('0x4')]();var fs_extra=require(_0x320d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x320d('0x6'));var config=require(_0x320d('0x7'));var controller=require('./intFreshsalesConfiguration.controller');router[_0x320d('0x8')]('/',auth[_0x320d('0x9')](),controller[_0x320d('0xa')]);router[_0x320d('0x8')](_0x320d('0xb'),auth[_0x320d('0x9')](),controller[_0x320d('0xc')]);router[_0x320d('0x8')](_0x320d('0xd'),auth[_0x320d('0x9')](),controller['getSubjects']);router[_0x320d('0x8')]('/:id/descriptions',auth[_0x320d('0x9')](),controller['getDescriptions']);router[_0x320d('0x8')](_0x320d('0xe'),auth[_0x320d('0x9')](),controller[_0x320d('0xf')]);router[_0x320d('0x10')]('/',auth[_0x320d('0x9')](),controller[_0x320d('0x11')]);router['put'](_0x320d('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x320d('0x12')](_0x320d('0xb'),auth[_0x320d('0x9')](),controller[_0x320d('0x13')]);module[_0x320d('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index ff13223..50639c5 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3459=['exports','STRING'];(function(_0x54ea6a,_0x32fef5){var _0x236cdb=function(_0x110464){while(--_0x110464){_0x54ea6a['push'](_0x54ea6a['shift']());}};_0x236cdb(++_0x32fef5);}(_0x3459,0x1f0));var _0x9345=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x3459[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require('sequelize');module[_0x9345('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9345('0x1')]}}; \ No newline at end of file +var _0x802e=['STRING','exports'];(function(_0x5aa4cc,_0x49d641){var _0x52b505=function(_0x5c521e){while(--_0x5c521e){_0x5aa4cc['push'](_0x5aa4cc['shift']());}};_0x52b505(++_0x49d641);}(_0x802e,0xb5));var _0xe802=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x802e[_0x23e7c1];return _0x1add43;};'use strict';var Sequelize=require('sequelize');module[_0xe802('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe802('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 607a0e7..49d2733 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x80ce=['reject','save','then','destroy','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','query','filters','attributes','intersection','model','length','hasOwnProperty','nolimit','order','sort','merge','where','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','keys','fields','find','create','body','update','params','getSubjects','findOne','FreshsalesField','pick','getDescriptions','getFields','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x29deda,_0x38ea10){var _0x4ac98b=function(_0x28c446){while(--_0x28c446){_0x29deda['push'](_0x29deda['shift']());}};_0x4ac98b(++_0x38ea10);}(_0x80ce,0x7d));var _0xe80c=function(_0xc506f3,_0x516e60){_0xc506f3=_0xc506f3-0x0;var _0x446d50=_0x80ce[_0xc506f3];return _0x446d50;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe80c('0x0'));var rp=require(_0xe80c('0x1'));var moment=require(_0xe80c('0x2'));var BPromise=require(_0xe80c('0x3'));var Mustache=require(_0xe80c('0x4'));var util=require(_0xe80c('0x5'));var path=require(_0xe80c('0x6'));var sox=require(_0xe80c('0x7'));var csv=require(_0xe80c('0x8'));var ejs=require(_0xe80c('0x9'));var fs=require('fs');var fs_extra=require(_0xe80c('0xa'));var _=require(_0xe80c('0xb'));var squel=require(_0xe80c('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe80c('0xd'));var toCsv=require(_0xe80c('0x8'));var querystring=require('querystring');var Papa=require(_0xe80c('0xe'));var Redis=require(_0xe80c('0xf'));var authService=require(_0xe80c('0x10'));var qs=require(_0xe80c('0x11'));var as=require(_0xe80c('0x12'));var hardwareService=require(_0xe80c('0x13'));var logger=require('../../config/logger')(_0xe80c('0x14'));var utils=require(_0xe80c('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d3b13,_0x38cede){_0x38cede=_0x38cede||0xcc;return function(_0x1f8ea2){if(_0x1f8ea2){return _0x4d3b13[_0xe80c('0x16')](_0x38cede);}return _0x4d3b13[_0xe80c('0x17')](_0x38cede)[_0xe80c('0x18')]();};}function respondWithResult(_0x3c707e,_0x3ea41f){_0x3ea41f=_0x3ea41f||0xc8;return function(_0x3e25dd){if(_0x3e25dd){return _0x3c707e['status'](_0x3ea41f)[_0xe80c('0x19')](_0x3e25dd);}};}function respondWithFilteredResult(_0x2a2f9c,_0x4e9612){return function(_0x277f91){if(_0x277f91){var _0x53b0cb=typeof _0x4e9612[_0xe80c('0x1a')]===_0xe80c('0x1b')&&typeof _0x4e9612[_0xe80c('0x1c')]==='undefined';var _0x3e28d4=_0x277f91['count'];var _0x373d4a=_0x53b0cb?0x0:_0x4e9612['offset'];var _0x2a9bd0=_0x53b0cb?_0x277f91[_0xe80c('0x1d')]:_0x4e9612[_0xe80c('0x1a')]+_0x4e9612[_0xe80c('0x1c')];var _0x40617a;if(_0x2a9bd0>=_0x3e28d4){_0x2a9bd0=_0x3e28d4;_0x40617a=0xc8;}else{_0x40617a=0xce;}_0x2a2f9c[_0xe80c('0x17')](_0x40617a);return _0x2a2f9c[_0xe80c('0x1e')](_0xe80c('0x1f'),_0x373d4a+'-'+_0x2a9bd0+'/'+_0x3e28d4)[_0xe80c('0x19')](_0x277f91);}return null;};}function patchUpdates(_0x5903ac){return function(_0x4f5ff5){try{jsonpatch[_0xe80c('0x20')](_0x4f5ff5,_0x5903ac,!![]);}catch(_0x1aff0e){return BPromise[_0xe80c('0x21')](_0x1aff0e);}return _0x4f5ff5[_0xe80c('0x22')]();};}function saveUpdates(_0x24b63c,_0x31db11){return function(_0x97d405){if(_0x97d405){return _0x97d405['update'](_0x24b63c)[_0xe80c('0x23')](function(_0x3e8246){return _0x3e8246;});}return null;};}function removeEntity(_0x35b15d,_0x36411e){return function(_0x43e4a6){if(_0x43e4a6){return _0x43e4a6[_0xe80c('0x24')]()[_0xe80c('0x23')](function(){_0x35b15d[_0xe80c('0x17')](0xcc)[_0xe80c('0x18')]();});}};}function handleEntityNotFound(_0x31ac93,_0x2294d2){return function(_0x6fc16e){if(!_0x6fc16e){_0x31ac93[_0xe80c('0x16')](0x194);}return _0x6fc16e;};}function handleError(_0x303fdc,_0x270f0a){_0x270f0a=_0x270f0a||0x1f4;return function(_0x56ccf4){logger['error'](_0x56ccf4['stack']);if(_0x56ccf4[_0xe80c('0x25')]){delete _0x56ccf4['name'];}_0x303fdc[_0xe80c('0x17')](_0x270f0a)[_0xe80c('0x26')](_0x56ccf4);};}exports[_0xe80c('0x27')]=function(_0x286fc0,_0x68b8db){var _0xca0868={},_0x488186={},_0x342665={'count':0x0,'rows':[]};var _0x14d4f6=_[_0xe80c('0x28')](db[_0xe80c('0x29')][_0xe80c('0x2a')],function(_0x1635ba){return{'name':_0x1635ba[_0xe80c('0x2b')],'type':_0x1635ba[_0xe80c('0x2c')][_0xe80c('0x2d')]};});_0x488186['model']=_[_0xe80c('0x28')](_0x14d4f6,_0xe80c('0x25'));_0x488186[_0xe80c('0x2e')]=_['keys'](_0x286fc0[_0xe80c('0x2e')]);_0x488186[_0xe80c('0x2f')]=_['intersection'](_0x488186['model'],_0x488186[_0xe80c('0x2e')]);_0xca0868[_0xe80c('0x30')]=_[_0xe80c('0x31')](_0x488186[_0xe80c('0x32')],qs['fields'](_0x286fc0[_0xe80c('0x2e')]['fields']));_0xca0868[_0xe80c('0x30')]=_0xca0868[_0xe80c('0x30')][_0xe80c('0x33')]?_0xca0868[_0xe80c('0x30')]:_0x488186['model'];if(!_0x286fc0[_0xe80c('0x2e')][_0xe80c('0x34')](_0xe80c('0x35'))){_0xca0868['limit']=qs[_0xe80c('0x1c')](_0x286fc0[_0xe80c('0x2e')][_0xe80c('0x1c')]);_0xca0868[_0xe80c('0x1a')]=qs['offset'](_0x286fc0[_0xe80c('0x2e')][_0xe80c('0x1a')]);}_0xca0868[_0xe80c('0x36')]=qs[_0xe80c('0x37')](_0x286fc0[_0xe80c('0x2e')]['sort']);_0xca0868['where']=qs['filters'](_['pick'](_0x286fc0[_0xe80c('0x2e')],_0x488186[_0xe80c('0x2f')]),_0x14d4f6);if(_0x286fc0[_0xe80c('0x2e')]['filter']){_0xca0868['where']=_[_0xe80c('0x38')](_0xca0868[_0xe80c('0x39')],{'$or':_[_0xe80c('0x28')](_0x14d4f6,function(_0xd09abb){if(_0xd09abb[_0xe80c('0x2c')]!==_0xe80c('0x3a')){var _0x557538={};_0x557538[_0xd09abb[_0xe80c('0x25')]]={'$like':'%'+_0x286fc0[_0xe80c('0x2e')][_0xe80c('0x3b')]+'%'};return _0x557538;}})});}_0xca0868=_[_0xe80c('0x38')]({},_0xca0868,_0x286fc0[_0xe80c('0x3c')]);var _0x5abe23={'where':_0xca0868[_0xe80c('0x39')]};return db[_0xe80c('0x29')]['count'](_0x5abe23)[_0xe80c('0x23')](function(_0x3035e7){_0x342665[_0xe80c('0x1d')]=_0x3035e7;if(_0x286fc0[_0xe80c('0x2e')][_0xe80c('0x3d')]){_0xca0868[_0xe80c('0x3e')]=[{'all':!![]}];}return db[_0xe80c('0x29')][_0xe80c('0x3f')](_0xca0868);})[_0xe80c('0x23')](function(_0xc07e2e){_0x342665[_0xe80c('0x40')]=_0xc07e2e;return _0x342665;})[_0xe80c('0x23')](respondWithFilteredResult(_0x68b8db,_0xca0868))[_0xe80c('0x41')](handleError(_0x68b8db,null));};exports['show']=function(_0x3a895c,_0x8bf7a8){var _0x1ee6ce={'raw':![],'where':{'id':_0x3a895c['params']['id']}},_0x17a267={};_0x17a267[_0xe80c('0x32')]=_['keys'](db[_0xe80c('0x29')]['rawAttributes']);_0x17a267['query']=_[_0xe80c('0x42')](_0x3a895c['query']);_0x17a267[_0xe80c('0x2f')]=_[_0xe80c('0x31')](_0x17a267['model'],_0x17a267[_0xe80c('0x2e')]);_0x1ee6ce[_0xe80c('0x30')]=_[_0xe80c('0x31')](_0x17a267['model'],qs[_0xe80c('0x43')](_0x3a895c['query'][_0xe80c('0x43')]));_0x1ee6ce[_0xe80c('0x30')]=_0x1ee6ce[_0xe80c('0x30')][_0xe80c('0x33')]?_0x1ee6ce[_0xe80c('0x30')]:_0x17a267[_0xe80c('0x32')];if(_0x3a895c['query'][_0xe80c('0x3d')]){_0x1ee6ce['include']=[{'all':!![]}];}_0x1ee6ce=_[_0xe80c('0x38')]({},_0x1ee6ce,_0x3a895c['options']);return db[_0xe80c('0x29')][_0xe80c('0x44')](_0x1ee6ce)[_0xe80c('0x23')](handleEntityNotFound(_0x8bf7a8,null))[_0xe80c('0x23')](respondWithResult(_0x8bf7a8,null))[_0xe80c('0x41')](handleError(_0x8bf7a8,null));};exports['create']=function(_0xd8a3ed,_0x2e256d){return db[_0xe80c('0x29')][_0xe80c('0x45')](_0xd8a3ed[_0xe80c('0x46')],{})[_0xe80c('0x23')](respondWithResult(_0x2e256d,0xc9))[_0xe80c('0x41')](handleError(_0x2e256d,null));};exports[_0xe80c('0x47')]=function(_0x27061f,_0x2770c4){if(_0x27061f[_0xe80c('0x46')]['id']){delete _0x27061f['body']['id'];}return db['FreshsalesConfiguration'][_0xe80c('0x44')]({'where':{'id':_0x27061f[_0xe80c('0x48')]['id']}})['then'](handleEntityNotFound(_0x2770c4,null))['then'](saveUpdates(_0x27061f[_0xe80c('0x46')],null))[_0xe80c('0x23')](respondWithResult(_0x2770c4,null))['catch'](handleError(_0x2770c4,null));};exports[_0xe80c('0x24')]=function(_0x347116,_0x5d3064){return db['FreshsalesConfiguration'][_0xe80c('0x44')]({'where':{'id':_0x347116['params']['id']}})['then'](handleEntityNotFound(_0x5d3064,null))[_0xe80c('0x23')](removeEntity(_0x5d3064,null))[_0xe80c('0x41')](handleError(_0x5d3064,null));};exports[_0xe80c('0x49')]=function(_0x19f67e,_0x1be5ff,_0x4578a6){var _0x2db197={};var _0x250442={};var _0x4cf3d3;var _0x50c212;return db[_0xe80c('0x29')][_0xe80c('0x4a')]({'where':{'id':_0x19f67e[_0xe80c('0x48')]['id']}})[_0xe80c('0x23')](handleEntityNotFound(_0x1be5ff,null))['then'](function(_0x478b52){if(_0x478b52){_0x4cf3d3=_0x478b52;_0x250442['model']=_[_0xe80c('0x42')](db[_0xe80c('0x4b')][_0xe80c('0x2a')]);_0x250442[_0xe80c('0x2e')]=_[_0xe80c('0x42')](_0x19f67e['query']);_0x250442[_0xe80c('0x2f')]=_['intersection'](_0x250442[_0xe80c('0x32')],_0x250442[_0xe80c('0x2e')]);_0x2db197[_0xe80c('0x30')]=_['intersection'](_0x250442[_0xe80c('0x32')],qs[_0xe80c('0x43')](_0x19f67e[_0xe80c('0x2e')][_0xe80c('0x43')]));_0x2db197['attributes']=_0x2db197[_0xe80c('0x30')][_0xe80c('0x33')]?_0x2db197[_0xe80c('0x30')]:_0x250442['model'];_0x2db197[_0xe80c('0x36')]=qs[_0xe80c('0x37')](_0x19f67e[_0xe80c('0x2e')][_0xe80c('0x37')]);_0x2db197['where']=qs['filters'](_[_0xe80c('0x4c')](_0x19f67e['query'],_0x250442[_0xe80c('0x2f')]));if(_0x19f67e[_0xe80c('0x2e')][_0xe80c('0x3b')]){_0x2db197['where']=_['merge'](_0x2db197[_0xe80c('0x39')],{'$or':_[_0xe80c('0x28')](_0x2db197[_0xe80c('0x30')],function(_0x3894ef){var _0x2c94e1={};_0x2c94e1[_0x3894ef]={'$like':'%'+_0x19f67e[_0xe80c('0x2e')]['filter']+'%'};return _0x2c94e1;})});}_0x2db197=_['merge']({},_0x2db197,_0x19f67e[_0xe80c('0x3c')]);return _0x4cf3d3[_0xe80c('0x49')](_0x2db197);}})['then'](function(_0x2acc03){if(_0x2acc03){_0x50c212=_0x2acc03[_0xe80c('0x33')];if(!_0x19f67e['query']['hasOwnProperty']('nolimit')){_0x2db197['limit']=qs[_0xe80c('0x1c')](_0x19f67e[_0xe80c('0x2e')][_0xe80c('0x1c')]);_0x2db197['offset']=qs[_0xe80c('0x1a')](_0x19f67e['query'][_0xe80c('0x1a')]);}return _0x4cf3d3[_0xe80c('0x49')](_0x2db197);}})[_0xe80c('0x23')](function(_0x37a0f1){if(_0x37a0f1){return _0x37a0f1?{'count':_0x50c212,'rows':_0x37a0f1}:null;}})['then'](respondWithResult(_0x1be5ff,null))[_0xe80c('0x41')](handleError(_0x1be5ff,null));};exports[_0xe80c('0x4d')]=function(_0x1044e5,_0x538b9a,_0x625a68){var _0x12e238={};var _0x531480={};var _0x3f429d;var _0x4f67a8;return db['FreshsalesConfiguration'][_0xe80c('0x4a')]({'where':{'id':_0x1044e5['params']['id']}})[_0xe80c('0x23')](handleEntityNotFound(_0x538b9a,null))[_0xe80c('0x23')](function(_0x12339f){if(_0x12339f){_0x3f429d=_0x12339f;_0x531480['model']=_['keys'](db[_0xe80c('0x4b')][_0xe80c('0x2a')]);_0x531480[_0xe80c('0x2e')]=_[_0xe80c('0x42')](_0x1044e5[_0xe80c('0x2e')]);_0x531480[_0xe80c('0x2f')]=_['intersection'](_0x531480[_0xe80c('0x32')],_0x531480['query']);_0x12e238['attributes']=_[_0xe80c('0x31')](_0x531480[_0xe80c('0x32')],qs['fields'](_0x1044e5[_0xe80c('0x2e')][_0xe80c('0x43')]));_0x12e238['attributes']=_0x12e238[_0xe80c('0x30')][_0xe80c('0x33')]?_0x12e238['attributes']:_0x531480['model'];_0x12e238[_0xe80c('0x36')]=qs[_0xe80c('0x37')](_0x1044e5['query'][_0xe80c('0x37')]);_0x12e238[_0xe80c('0x39')]=qs[_0xe80c('0x2f')](_['pick'](_0x1044e5[_0xe80c('0x2e')],_0x531480[_0xe80c('0x2f')]));if(_0x1044e5[_0xe80c('0x2e')][_0xe80c('0x3b')]){_0x12e238[_0xe80c('0x39')]=_[_0xe80c('0x38')](_0x12e238[_0xe80c('0x39')],{'$or':_[_0xe80c('0x28')](_0x12e238[_0xe80c('0x30')],function(_0x5ed004){var _0x2dd127={};_0x2dd127[_0x5ed004]={'$like':'%'+_0x1044e5[_0xe80c('0x2e')][_0xe80c('0x3b')]+'%'};return _0x2dd127;})});}_0x12e238=_[_0xe80c('0x38')]({},_0x12e238,_0x1044e5[_0xe80c('0x3c')]);return _0x3f429d['getDescriptions'](_0x12e238);}})[_0xe80c('0x23')](function(_0x3efc54){if(_0x3efc54){_0x4f67a8=_0x3efc54['length'];if(!_0x1044e5[_0xe80c('0x2e')][_0xe80c('0x34')]('nolimit')){_0x12e238[_0xe80c('0x1c')]=qs[_0xe80c('0x1c')](_0x1044e5[_0xe80c('0x2e')][_0xe80c('0x1c')]);_0x12e238[_0xe80c('0x1a')]=qs[_0xe80c('0x1a')](_0x1044e5[_0xe80c('0x2e')][_0xe80c('0x1a')]);}return _0x3f429d['getDescriptions'](_0x12e238);}})[_0xe80c('0x23')](function(_0x1402fd){if(_0x1402fd){return _0x1402fd?{'count':_0x4f67a8,'rows':_0x1402fd}:null;}})[_0xe80c('0x23')](respondWithResult(_0x538b9a,null))[_0xe80c('0x41')](handleError(_0x538b9a,null));};exports['getFields']=function(_0x5b3006,_0x3d69cb,_0x27c656){var _0x55ed0f={};var _0x412362={};var _0x44f61a;var _0x5c7613;return db['FreshsalesConfiguration'][_0xe80c('0x4a')]({'where':{'id':_0x5b3006['params']['id']}})[_0xe80c('0x23')](handleEntityNotFound(_0x3d69cb,null))['then'](function(_0xf00980){if(_0xf00980){_0x44f61a=_0xf00980;_0x412362[_0xe80c('0x32')]=_[_0xe80c('0x42')](db[_0xe80c('0x4b')]['rawAttributes']);_0x412362['query']=_['keys'](_0x5b3006[_0xe80c('0x2e')]);_0x412362['filters']=_[_0xe80c('0x31')](_0x412362[_0xe80c('0x32')],_0x412362[_0xe80c('0x2e')]);_0x55ed0f[_0xe80c('0x30')]=_['intersection'](_0x412362[_0xe80c('0x32')],qs[_0xe80c('0x43')](_0x5b3006[_0xe80c('0x2e')][_0xe80c('0x43')]));_0x55ed0f[_0xe80c('0x30')]=_0x55ed0f[_0xe80c('0x30')][_0xe80c('0x33')]?_0x55ed0f[_0xe80c('0x30')]:_0x412362[_0xe80c('0x32')];_0x55ed0f[_0xe80c('0x36')]=qs[_0xe80c('0x37')](_0x5b3006[_0xe80c('0x2e')][_0xe80c('0x37')]);_0x55ed0f['where']=qs[_0xe80c('0x2f')](_[_0xe80c('0x4c')](_0x5b3006[_0xe80c('0x2e')],_0x412362[_0xe80c('0x2f')]));if(_0x5b3006['query'][_0xe80c('0x3b')]){_0x55ed0f['where']=_[_0xe80c('0x38')](_0x55ed0f[_0xe80c('0x39')],{'$or':_[_0xe80c('0x28')](_0x55ed0f[_0xe80c('0x30')],function(_0x4eb46f){var _0x448526={};_0x448526[_0x4eb46f]={'$like':'%'+_0x5b3006[_0xe80c('0x2e')][_0xe80c('0x3b')]+'%'};return _0x448526;})});}_0x55ed0f=_[_0xe80c('0x38')]({},_0x55ed0f,_0x5b3006[_0xe80c('0x3c')]);return _0x44f61a[_0xe80c('0x4e')](_0x55ed0f);}})[_0xe80c('0x23')](function(_0x386a62){if(_0x386a62){_0x5c7613=_0x386a62['length'];if(!_0x5b3006['query'][_0xe80c('0x34')](_0xe80c('0x35'))){_0x55ed0f[_0xe80c('0x1c')]=qs['limit'](_0x5b3006[_0xe80c('0x2e')]['limit']);_0x55ed0f['offset']=qs[_0xe80c('0x1a')](_0x5b3006[_0xe80c('0x2e')][_0xe80c('0x1a')]);}return _0x44f61a[_0xe80c('0x4e')](_0x55ed0f);}})[_0xe80c('0x23')](function(_0x29f4cd){if(_0x29f4cd){return _0x29f4cd?{'count':_0x5c7613,'rows':_0x29f4cd}:null;}})['then'](respondWithResult(_0x3d69cb,null))[_0xe80c('0x41')](handleError(_0x3d69cb,null));}; \ No newline at end of file +var _0x79d8=['getDescriptions','getFields','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','then','index','map','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','FreshsalesConfiguration','includeAll','include','findAll','rows','catch','show','find','body','findOne','params','FreshsalesField','filter','getSubjects'];(function(_0x1f5236,_0xea7afc){var _0x2efe18=function(_0x1457e4){while(--_0x1457e4){_0x1f5236['push'](_0x1f5236['shift']());}};_0x2efe18(++_0xea7afc);}(_0x79d8,0xe9));var _0x879d=function(_0x2dd1a0,_0x2369fa){_0x2dd1a0=_0x2dd1a0-0x0;var _0x24a23f=_0x79d8[_0x2dd1a0];return _0x24a23f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x879d('0x0'));var zipdir=require(_0x879d('0x1'));var jsonpatch=require(_0x879d('0x2'));var rp=require(_0x879d('0x3'));var moment=require(_0x879d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x879d('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x879d('0x6'));var ejs=require(_0x879d('0x7'));var fs=require('fs');var fs_extra=require(_0x879d('0x8'));var _=require(_0x879d('0x9'));var squel=require(_0x879d('0xa'));var crypto=require(_0x879d('0xb'));var jsforce=require(_0x879d('0xc'));var deskjs=require(_0x879d('0xd'));var toCsv=require(_0x879d('0x6'));var querystring=require(_0x879d('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x879d('0xf'));var qs=require(_0x879d('0x10'));var as=require(_0x879d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x879d('0x12'))(_0x879d('0x13'));var utils=require(_0x879d('0x14'));var config=require(_0x879d('0x15'));var licenseUtil=require(_0x879d('0x16'));var db=require(_0x879d('0x17'))['db'];function respondWithStatusCode(_0x313fec,_0x3f137e){_0x3f137e=_0x3f137e||0xcc;return function(_0x186b52){if(_0x186b52){return _0x313fec[_0x879d('0x18')](_0x3f137e);}return _0x313fec['status'](_0x3f137e)[_0x879d('0x19')]();};}function respondWithResult(_0x5b3bc2,_0x3babe1){_0x3babe1=_0x3babe1||0xc8;return function(_0x1bdc07){if(_0x1bdc07){return _0x5b3bc2[_0x879d('0x1a')](_0x3babe1)['json'](_0x1bdc07);}};}function respondWithFilteredResult(_0x41b6b6,_0x4c1c13){return function(_0x350221){if(_0x350221){var _0x1029c6=typeof _0x4c1c13[_0x879d('0x1b')]===_0x879d('0x1c')&&typeof _0x4c1c13[_0x879d('0x1d')]===_0x879d('0x1c');var _0x4cffd7=_0x350221[_0x879d('0x1e')];var _0x69f63b=_0x1029c6?0x0:_0x4c1c13[_0x879d('0x1b')];var _0x499a49=_0x1029c6?_0x350221[_0x879d('0x1e')]:_0x4c1c13[_0x879d('0x1b')]+_0x4c1c13[_0x879d('0x1d')];var _0x57167d;if(_0x499a49>=_0x4cffd7){_0x499a49=_0x4cffd7;_0x57167d=0xc8;}else{_0x57167d=0xce;}_0x41b6b6[_0x879d('0x1a')](_0x57167d);return _0x41b6b6['set'](_0x879d('0x1f'),_0x69f63b+'-'+_0x499a49+'/'+_0x4cffd7)[_0x879d('0x20')](_0x350221);}return null;};}function patchUpdates(_0x59e4ee){return function(_0x4a48ae){try{jsonpatch[_0x879d('0x21')](_0x4a48ae,_0x59e4ee,!![]);}catch(_0x106fa9){return BPromise[_0x879d('0x22')](_0x106fa9);}return _0x4a48ae[_0x879d('0x23')]();};}function saveUpdates(_0x32ca12,_0x26f394){return function(_0x2036c0){if(_0x2036c0){return _0x2036c0[_0x879d('0x24')](_0x32ca12)['then'](function(_0x3bc13d){return _0x3bc13d;});}return null;};}function removeEntity(_0x4e6545,_0x107561){return function(_0x39f2b5){if(_0x39f2b5){return _0x39f2b5[_0x879d('0x25')]()[_0x879d('0x26')](function(){_0x4e6545[_0x879d('0x1a')](0xcc)[_0x879d('0x19')]();});}};}function handleEntityNotFound(_0x296790,_0x4dc976){return function(_0x4b1801){if(!_0x4b1801){_0x296790['sendStatus'](0x194);}return _0x4b1801;};}function handleError(_0x932347,_0x589edf){_0x589edf=_0x589edf||0x1f4;return function(_0x5d754c){logger['error'](_0x5d754c['stack']);if(_0x5d754c['name']){delete _0x5d754c['name'];}_0x932347[_0x879d('0x1a')](_0x589edf)['send'](_0x5d754c);};}exports[_0x879d('0x27')]=function(_0x2bc34a,_0x188136){var _0x4abffa={},_0x3dfed8={},_0x235226={'count':0x0,'rows':[]};var _0x494f58=_[_0x879d('0x28')](db['FreshsalesConfiguration'][_0x879d('0x29')],function(_0x5235b9){return{'name':_0x5235b9[_0x879d('0x2a')],'type':_0x5235b9[_0x879d('0x2b')]['key']};});_0x3dfed8[_0x879d('0x2c')]=_['map'](_0x494f58,_0x879d('0x2d'));_0x3dfed8[_0x879d('0x2e')]=_[_0x879d('0x2f')](_0x2bc34a[_0x879d('0x2e')]);_0x3dfed8[_0x879d('0x30')]=_[_0x879d('0x31')](_0x3dfed8[_0x879d('0x2c')],_0x3dfed8[_0x879d('0x2e')]);_0x4abffa[_0x879d('0x32')]=_[_0x879d('0x31')](_0x3dfed8[_0x879d('0x2c')],qs[_0x879d('0x33')](_0x2bc34a[_0x879d('0x2e')][_0x879d('0x33')]));_0x4abffa[_0x879d('0x32')]=_0x4abffa[_0x879d('0x32')][_0x879d('0x34')]?_0x4abffa[_0x879d('0x32')]:_0x3dfed8[_0x879d('0x2c')];if(!_0x2bc34a[_0x879d('0x2e')][_0x879d('0x35')](_0x879d('0x36'))){_0x4abffa[_0x879d('0x1d')]=qs['limit'](_0x2bc34a['query'][_0x879d('0x1d')]);_0x4abffa['offset']=qs[_0x879d('0x1b')](_0x2bc34a['query'][_0x879d('0x1b')]);}_0x4abffa[_0x879d('0x37')]=qs[_0x879d('0x38')](_0x2bc34a[_0x879d('0x2e')][_0x879d('0x38')]);_0x4abffa[_0x879d('0x39')]=qs['filters'](_[_0x879d('0x3a')](_0x2bc34a[_0x879d('0x2e')],_0x3dfed8[_0x879d('0x30')]),_0x494f58);if(_0x2bc34a[_0x879d('0x2e')]['filter']){_0x4abffa[_0x879d('0x39')]=_[_0x879d('0x3b')](_0x4abffa[_0x879d('0x39')],{'$or':_[_0x879d('0x28')](_0x494f58,function(_0x214f3d){if(_0x214f3d['type']!=='VIRTUAL'){var _0x564fbc={};_0x564fbc[_0x214f3d[_0x879d('0x2d')]]={'$like':'%'+_0x2bc34a['query']['filter']+'%'};return _0x564fbc;}})});}_0x4abffa=_['merge']({},_0x4abffa,_0x2bc34a[_0x879d('0x3c')]);var _0x15a5e1={'where':_0x4abffa[_0x879d('0x39')]};return db[_0x879d('0x3d')][_0x879d('0x1e')](_0x15a5e1)['then'](function(_0x2c6b4c){_0x235226[_0x879d('0x1e')]=_0x2c6b4c;if(_0x2bc34a[_0x879d('0x2e')][_0x879d('0x3e')]){_0x4abffa[_0x879d('0x3f')]=[{'all':!![]}];}return db[_0x879d('0x3d')][_0x879d('0x40')](_0x4abffa);})[_0x879d('0x26')](function(_0x57b092){_0x235226[_0x879d('0x41')]=_0x57b092;return _0x235226;})['then'](respondWithFilteredResult(_0x188136,_0x4abffa))[_0x879d('0x42')](handleError(_0x188136,null));};exports[_0x879d('0x43')]=function(_0x47c55b,_0x1ce8a6){var _0x187b92={'raw':![],'where':{'id':_0x47c55b['params']['id']}},_0x15df60={};_0x15df60[_0x879d('0x2c')]=_[_0x879d('0x2f')](db[_0x879d('0x3d')][_0x879d('0x29')]);_0x15df60['query']=_[_0x879d('0x2f')](_0x47c55b[_0x879d('0x2e')]);_0x15df60[_0x879d('0x30')]=_[_0x879d('0x31')](_0x15df60[_0x879d('0x2c')],_0x15df60[_0x879d('0x2e')]);_0x187b92[_0x879d('0x32')]=_[_0x879d('0x31')](_0x15df60[_0x879d('0x2c')],qs['fields'](_0x47c55b[_0x879d('0x2e')][_0x879d('0x33')]));_0x187b92[_0x879d('0x32')]=_0x187b92['attributes'][_0x879d('0x34')]?_0x187b92[_0x879d('0x32')]:_0x15df60[_0x879d('0x2c')];if(_0x47c55b[_0x879d('0x2e')][_0x879d('0x3e')]){_0x187b92['include']=[{'all':!![]}];}_0x187b92=_[_0x879d('0x3b')]({},_0x187b92,_0x47c55b[_0x879d('0x3c')]);return db[_0x879d('0x3d')][_0x879d('0x44')](_0x187b92)[_0x879d('0x26')](handleEntityNotFound(_0x1ce8a6,null))['then'](respondWithResult(_0x1ce8a6,null))[_0x879d('0x42')](handleError(_0x1ce8a6,null));};exports['create']=function(_0x4b04c1,_0x1affa1){return db[_0x879d('0x3d')]['create'](_0x4b04c1[_0x879d('0x45')],{})[_0x879d('0x26')](respondWithResult(_0x1affa1,0xc9))[_0x879d('0x42')](handleError(_0x1affa1,null));};exports[_0x879d('0x24')]=function(_0x23a472,_0xc20425){if(_0x23a472[_0x879d('0x45')]['id']){delete _0x23a472['body']['id'];}return db[_0x879d('0x3d')][_0x879d('0x44')]({'where':{'id':_0x23a472['params']['id']}})[_0x879d('0x26')](handleEntityNotFound(_0xc20425,null))[_0x879d('0x26')](saveUpdates(_0x23a472[_0x879d('0x45')],null))[_0x879d('0x26')](respondWithResult(_0xc20425,null))[_0x879d('0x42')](handleError(_0xc20425,null));};exports[_0x879d('0x25')]=function(_0x575c51,_0x49a194){return db['FreshsalesConfiguration'][_0x879d('0x44')]({'where':{'id':_0x575c51['params']['id']}})[_0x879d('0x26')](handleEntityNotFound(_0x49a194,null))[_0x879d('0x26')](removeEntity(_0x49a194,null))[_0x879d('0x42')](handleError(_0x49a194,null));};exports['getSubjects']=function(_0x2fb773,_0x12b3cb,_0x49931d){var _0x3ae1d3={};var _0x33c2ce={};var _0x2bc085;var _0x7bc715;return db[_0x879d('0x3d')][_0x879d('0x46')]({'where':{'id':_0x2fb773[_0x879d('0x47')]['id']}})[_0x879d('0x26')](handleEntityNotFound(_0x12b3cb,null))[_0x879d('0x26')](function(_0xbafa96){if(_0xbafa96){_0x2bc085=_0xbafa96;_0x33c2ce[_0x879d('0x2c')]=_[_0x879d('0x2f')](db[_0x879d('0x48')][_0x879d('0x29')]);_0x33c2ce[_0x879d('0x2e')]=_[_0x879d('0x2f')](_0x2fb773['query']);_0x33c2ce['filters']=_[_0x879d('0x31')](_0x33c2ce[_0x879d('0x2c')],_0x33c2ce['query']);_0x3ae1d3[_0x879d('0x32')]=_[_0x879d('0x31')](_0x33c2ce[_0x879d('0x2c')],qs[_0x879d('0x33')](_0x2fb773[_0x879d('0x2e')]['fields']));_0x3ae1d3[_0x879d('0x32')]=_0x3ae1d3['attributes'][_0x879d('0x34')]?_0x3ae1d3['attributes']:_0x33c2ce[_0x879d('0x2c')];_0x3ae1d3[_0x879d('0x37')]=qs['sort'](_0x2fb773[_0x879d('0x2e')][_0x879d('0x38')]);_0x3ae1d3[_0x879d('0x39')]=qs['filters'](_['pick'](_0x2fb773[_0x879d('0x2e')],_0x33c2ce['filters']));if(_0x2fb773[_0x879d('0x2e')][_0x879d('0x49')]){_0x3ae1d3['where']=_['merge'](_0x3ae1d3[_0x879d('0x39')],{'$or':_[_0x879d('0x28')](_0x3ae1d3[_0x879d('0x32')],function(_0x3e0c76){var _0x235936={};_0x235936[_0x3e0c76]={'$like':'%'+_0x2fb773['query'][_0x879d('0x49')]+'%'};return _0x235936;})});}_0x3ae1d3=_[_0x879d('0x3b')]({},_0x3ae1d3,_0x2fb773['options']);return _0x2bc085['getSubjects'](_0x3ae1d3);}})['then'](function(_0x52b208){if(_0x52b208){_0x7bc715=_0x52b208[_0x879d('0x34')];if(!_0x2fb773[_0x879d('0x2e')][_0x879d('0x35')](_0x879d('0x36'))){_0x3ae1d3[_0x879d('0x1d')]=qs[_0x879d('0x1d')](_0x2fb773['query']['limit']);_0x3ae1d3[_0x879d('0x1b')]=qs[_0x879d('0x1b')](_0x2fb773[_0x879d('0x2e')]['offset']);}return _0x2bc085[_0x879d('0x4a')](_0x3ae1d3);}})[_0x879d('0x26')](function(_0x2367d1){if(_0x2367d1){return _0x2367d1?{'count':_0x7bc715,'rows':_0x2367d1}:null;}})['then'](respondWithResult(_0x12b3cb,null))['catch'](handleError(_0x12b3cb,null));};exports['getDescriptions']=function(_0x23a8db,_0x3b521a,_0x3e219c){var _0x2bf847={};var _0x42e40e={};var _0x27fdd1;var _0x58cebd;return db[_0x879d('0x3d')]['findOne']({'where':{'id':_0x23a8db[_0x879d('0x47')]['id']}})[_0x879d('0x26')](handleEntityNotFound(_0x3b521a,null))[_0x879d('0x26')](function(_0x23d949){if(_0x23d949){_0x27fdd1=_0x23d949;_0x42e40e[_0x879d('0x2c')]=_['keys'](db[_0x879d('0x48')][_0x879d('0x29')]);_0x42e40e[_0x879d('0x2e')]=_[_0x879d('0x2f')](_0x23a8db['query']);_0x42e40e[_0x879d('0x30')]=_[_0x879d('0x31')](_0x42e40e['model'],_0x42e40e['query']);_0x2bf847[_0x879d('0x32')]=_[_0x879d('0x31')](_0x42e40e[_0x879d('0x2c')],qs['fields'](_0x23a8db['query'][_0x879d('0x33')]));_0x2bf847[_0x879d('0x32')]=_0x2bf847[_0x879d('0x32')][_0x879d('0x34')]?_0x2bf847[_0x879d('0x32')]:_0x42e40e[_0x879d('0x2c')];_0x2bf847[_0x879d('0x37')]=qs[_0x879d('0x38')](_0x23a8db[_0x879d('0x2e')][_0x879d('0x38')]);_0x2bf847['where']=qs[_0x879d('0x30')](_['pick'](_0x23a8db['query'],_0x42e40e[_0x879d('0x30')]));if(_0x23a8db[_0x879d('0x2e')][_0x879d('0x49')]){_0x2bf847[_0x879d('0x39')]=_[_0x879d('0x3b')](_0x2bf847[_0x879d('0x39')],{'$or':_[_0x879d('0x28')](_0x2bf847['attributes'],function(_0x5bc20d){var _0x29e625={};_0x29e625[_0x5bc20d]={'$like':'%'+_0x23a8db['query'][_0x879d('0x49')]+'%'};return _0x29e625;})});}_0x2bf847=_['merge']({},_0x2bf847,_0x23a8db[_0x879d('0x3c')]);return _0x27fdd1[_0x879d('0x4b')](_0x2bf847);}})[_0x879d('0x26')](function(_0x652f1c){if(_0x652f1c){_0x58cebd=_0x652f1c[_0x879d('0x34')];if(!_0x23a8db[_0x879d('0x2e')]['hasOwnProperty']('nolimit')){_0x2bf847[_0x879d('0x1d')]=qs[_0x879d('0x1d')](_0x23a8db['query'][_0x879d('0x1d')]);_0x2bf847[_0x879d('0x1b')]=qs[_0x879d('0x1b')](_0x23a8db[_0x879d('0x2e')]['offset']);}return _0x27fdd1[_0x879d('0x4b')](_0x2bf847);}})[_0x879d('0x26')](function(_0x4686c9){if(_0x4686c9){return _0x4686c9?{'count':_0x58cebd,'rows':_0x4686c9}:null;}})[_0x879d('0x26')](respondWithResult(_0x3b521a,null))[_0x879d('0x42')](handleError(_0x3b521a,null));};exports[_0x879d('0x4c')]=function(_0x54c1c0,_0x55dbfd,_0x206882){var _0x4eb652={};var _0x130c1d={};var _0x18e938;var _0xeb6e04;return db[_0x879d('0x3d')][_0x879d('0x46')]({'where':{'id':_0x54c1c0[_0x879d('0x47')]['id']}})[_0x879d('0x26')](handleEntityNotFound(_0x55dbfd,null))[_0x879d('0x26')](function(_0x3ae0ec){if(_0x3ae0ec){_0x18e938=_0x3ae0ec;_0x130c1d[_0x879d('0x2c')]=_[_0x879d('0x2f')](db[_0x879d('0x48')]['rawAttributes']);_0x130c1d[_0x879d('0x2e')]=_['keys'](_0x54c1c0['query']);_0x130c1d['filters']=_['intersection'](_0x130c1d[_0x879d('0x2c')],_0x130c1d[_0x879d('0x2e')]);_0x4eb652['attributes']=_[_0x879d('0x31')](_0x130c1d['model'],qs['fields'](_0x54c1c0['query'][_0x879d('0x33')]));_0x4eb652[_0x879d('0x32')]=_0x4eb652[_0x879d('0x32')][_0x879d('0x34')]?_0x4eb652[_0x879d('0x32')]:_0x130c1d[_0x879d('0x2c')];_0x4eb652[_0x879d('0x37')]=qs[_0x879d('0x38')](_0x54c1c0[_0x879d('0x2e')][_0x879d('0x38')]);_0x4eb652[_0x879d('0x39')]=qs['filters'](_['pick'](_0x54c1c0[_0x879d('0x2e')],_0x130c1d[_0x879d('0x30')]));if(_0x54c1c0['query'][_0x879d('0x49')]){_0x4eb652[_0x879d('0x39')]=_[_0x879d('0x3b')](_0x4eb652[_0x879d('0x39')],{'$or':_[_0x879d('0x28')](_0x4eb652[_0x879d('0x32')],function(_0x570364){var _0x313876={};_0x313876[_0x570364]={'$like':'%'+_0x54c1c0[_0x879d('0x2e')][_0x879d('0x49')]+'%'};return _0x313876;})});}_0x4eb652=_[_0x879d('0x3b')]({},_0x4eb652,_0x54c1c0['options']);return _0x18e938[_0x879d('0x4c')](_0x4eb652);}})[_0x879d('0x26')](function(_0x257fc6){if(_0x257fc6){_0xeb6e04=_0x257fc6[_0x879d('0x34')];if(!_0x54c1c0['query'][_0x879d('0x35')](_0x879d('0x36'))){_0x4eb652[_0x879d('0x1d')]=qs[_0x879d('0x1d')](_0x54c1c0[_0x879d('0x2e')][_0x879d('0x1d')]);_0x4eb652[_0x879d('0x1b')]=qs[_0x879d('0x1b')](_0x54c1c0[_0x879d('0x2e')][_0x879d('0x1b')]);}return _0x18e938[_0x879d('0x4c')](_0x4eb652);}})['then'](function(_0x2de744){if(_0x2de744){return _0x2de744?{'count':_0xeb6e04,'rows':_0x2de744}:null;}})[_0x879d('0x26')](respondWithResult(_0x55dbfd,null))[_0x879d('0x42')](handleError(_0x55dbfd,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 658eb91..384b66d 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c3a=['bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','moment'];(function(_0x46401e,_0x2a345b){var _0x447cba=function(_0x54ea97){while(--_0x54ea97){_0x46401e['push'](_0x46401e['shift']());}};_0x447cba(++_0x2a345b);}(_0x9c3a,0xf3));var _0xa9c3=function(_0x4286fd,_0x328b02){_0x4286fd=_0x4286fd-0x0;var _0xaa53b1=_0x9c3a[_0x4286fd];return _0xaa53b1;};'use strict';var _=require(_0xa9c3('0x0'));var util=require(_0xa9c3('0x1'));var logger=require(_0xa9c3('0x2'))('api');var moment=require(_0xa9c3('0x3'));var BPromise=require(_0xa9c3('0x4'));var rp=require(_0xa9c3('0x5'));var fs=require('fs');var path=require(_0xa9c3('0x6'));var rimraf=require(_0xa9c3('0x7'));var config=require(_0xa9c3('0x8'));var attributes=require(_0xa9c3('0x9'));module[_0xa9c3('0xa')]=function(_0x1167e9,_0x4a3d3b){return _0x1167e9['define'](_0xa9c3('0xb'),attributes,{'tableName':_0xa9c3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfd5c=['FreshsalesConfiguration','int_freshsales_configurations','lodash','api','moment','bluebird','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','define'];(function(_0x311215,_0x451783){var _0x3dd570=function(_0x4a8de1){while(--_0x4a8de1){_0x311215['push'](_0x311215['shift']());}};_0x3dd570(++_0x451783);}(_0xfd5c,0x1b0));var _0xcfd5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd5c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xcfd5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcfd5('0x1'));var moment=require(_0xcfd5('0x2'));var BPromise=require(_0xcfd5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcfd5('0x4'));var config=require(_0xcfd5('0x5'));var attributes=require(_0xcfd5('0x6'));module['exports']=function(_0x5850ce,_0x570dea){return _0x5850ce[_0xcfd5('0x7')](_0xcfd5('0x8'),attributes,{'tableName':_0xcfd5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index 82ed325..1d6c31c 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2244=['../../config/logger','rpc','../../config/environment','jayson/promise','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x59164c,_0x46bb55){var _0x35101b=function(_0x225789){while(--_0x225789){_0x59164c['push'](_0x59164c['shift']());}};_0x35101b(++_0x46bb55);}(_0x2244,0xb6));var _0x4224=function(_0xab67aa,_0x52e0ae){_0xab67aa=_0xab67aa-0x0;var _0x28a522=_0x2244[_0xab67aa];return _0x28a522;};'use strict';var _=require(_0x4224('0x0'));var util=require(_0x4224('0x1'));var moment=require(_0x4224('0x2'));var BPromise=require(_0x4224('0x3'));var rs=require(_0x4224('0x4'));var fs=require('fs');var Redis=require(_0x4224('0x5'));var db=require(_0x4224('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4224('0x7'))(_0x4224('0x8'));var config=require(_0x4224('0x9'));var jayson=require(_0x4224('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x509c53,_0x5b0592,_0x27d941){return new BPromise(function(_0x18150b,_0x814fdc){return client['request'](_0x509c53,_0x27d941)['then'](function(_0x24348c){logger[_0x4224('0xb')](_0x4224('0xc'),_0x5b0592,_0x4224('0xd'));logger[_0x4224('0xe')](_0x4224('0xf'),_0x5b0592,_0x4224('0xd'),JSON[_0x4224('0x10')](_0x24348c));if(_0x24348c['error']){if(_0x24348c['error'][_0x4224('0x11')]===0x1f4){logger['error'](_0x4224('0xc'),_0x5b0592,_0x24348c[_0x4224('0x12')]['message']);return _0x814fdc(_0x24348c[_0x4224('0x12')][_0x4224('0x13')]);}logger[_0x4224('0x12')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x5b0592,_0x24348c[_0x4224('0x12')][_0x4224('0x13')]);return _0x18150b(_0x24348c[_0x4224('0x12')][_0x4224('0x13')]);}else{logger['info'](_0x4224('0xc'),_0x5b0592,_0x4224('0xd'));_0x18150b(_0x24348c['result'][_0x4224('0x13')]);}})[_0x4224('0x14')](function(_0xce3201){logger[_0x4224('0x12')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x5b0592,_0xce3201);_0x814fdc(_0xce3201);});});} \ No newline at end of file +var _0xc551=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x2fd56d,_0x34b2fa){var _0x5d427b=function(_0x3c7a32){while(--_0x3c7a32){_0x2fd56d['push'](_0x2fd56d['shift']());}};_0x5d427b(++_0x34b2fa);}(_0xc551,0x187));var _0x1c55=function(_0x342b35,_0x5b25f1){_0x342b35=_0x342b35-0x0;var _0x45c64f=_0xc551[_0x342b35];return _0x45c64f;};'use strict';var _=require(_0x1c55('0x0'));var util=require(_0x1c55('0x1'));var moment=require(_0x1c55('0x2'));var BPromise=require('bluebird');var rs=require(_0x1c55('0x3'));var fs=require('fs');var Redis=require(_0x1c55('0x4'));var db=require(_0x1c55('0x5'))['db'];var utils=require(_0x1c55('0x6'));var logger=require(_0x1c55('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1c55('0x8'));var client=jayson[_0x1c55('0x9')][_0x1c55('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41e0f9,_0x3903f4,_0x2ab75f){return new BPromise(function(_0x22e8ad,_0x1fc5f3){return client[_0x1c55('0xb')](_0x41e0f9,_0x2ab75f)['then'](function(_0x165b7c){logger[_0x1c55('0xc')](_0x1c55('0xd'),_0x3903f4,_0x1c55('0xe'));logger[_0x1c55('0xf')](_0x1c55('0x10'),_0x3903f4,_0x1c55('0xe'),JSON['stringify'](_0x165b7c));if(_0x165b7c[_0x1c55('0x11')]){if(_0x165b7c['error'][_0x1c55('0x12')]===0x1f4){logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x3903f4,_0x165b7c[_0x1c55('0x11')][_0x1c55('0x13')]);return _0x1fc5f3(_0x165b7c[_0x1c55('0x11')][_0x1c55('0x13')]);}logger[_0x1c55('0x11')](_0x1c55('0xd'),_0x3903f4,_0x165b7c['error'][_0x1c55('0x13')]);return _0x22e8ad(_0x165b7c[_0x1c55('0x11')][_0x1c55('0x13')]);}else{logger[_0x1c55('0xc')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x3903f4,'request\x20sent');_0x22e8ad(_0x165b7c[_0x1c55('0x14')][_0x1c55('0x13')]);}})[_0x1c55('0x15')](function(_0x15752b){logger[_0x1c55('0x11')](_0x1c55('0xd'),_0x3903f4,_0x15752b);_0x1fc5f3(_0x15752b);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 3a811bf..681f6a1 100644 --- a/server/api/intFreshsalesField/index.js +++ b/server/api/intFreshsalesField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa62c=['../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','show','post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x400566,_0x474083){var _0x40f3e8=function(_0x34c917){while(--_0x34c917){_0x400566['push'](_0x400566['shift']());}};_0x40f3e8(++_0x474083);}(_0xa62c,0x70));var _0xca62=function(_0x45c262,_0x2e3ce5){_0x45c262=_0x45c262-0x0;var _0x4f2ba6=_0xa62c[_0x45c262];return _0x4f2ba6;};'use strict';var multer=require(_0xca62('0x0'));var util=require(_0xca62('0x1'));var path=require(_0xca62('0x2'));var timeout=require(_0xca62('0x3'));var express=require(_0xca62('0x4'));var router=express[_0xca62('0x5')]();var fs_extra=require(_0xca62('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xca62('0x7'));var config=require(_0xca62('0x8'));var controller=require(_0xca62('0x9'));router[_0xca62('0xa')]('/',auth[_0xca62('0xb')](),controller[_0xca62('0xc')]);router[_0xca62('0xa')](_0xca62('0xd'),auth['isAuthenticated'](),controller[_0xca62('0xe')]);router[_0xca62('0xf')]('/',auth[_0xca62('0xb')](),controller['create']);router[_0xca62('0x10')](_0xca62('0xd'),auth[_0xca62('0xb')](),controller['update']);router[_0xca62('0x11')](_0xca62('0xd'),auth[_0xca62('0xb')](),controller[_0xca62('0x12')]);module[_0xca62('0x13')]=router; \ No newline at end of file +var _0x430e=['isAuthenticated','/:id','show','post','create','put','update','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesField.controller','get'];(function(_0x3f9e1f,_0x4a1c59){var _0x114eb5=function(_0x519c16){while(--_0x519c16){_0x3f9e1f['push'](_0x3f9e1f['shift']());}};_0x114eb5(++_0x4a1c59);}(_0x430e,0x105));var _0xe430=function(_0x19e291,_0x5052bc){_0x19e291=_0x19e291-0x0;var _0x5c816f=_0x430e[_0x19e291];return _0x5c816f;};'use strict';var multer=require('multer');var util=require(_0xe430('0x0'));var path=require(_0xe430('0x1'));var timeout=require('connect-timeout');var express=require(_0xe430('0x2'));var router=express[_0xe430('0x3')]();var fs_extra=require(_0xe430('0x4'));var auth=require(_0xe430('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe430('0x6'));var controller=require(_0xe430('0x7'));router[_0xe430('0x8')]('/',auth[_0xe430('0x9')](),controller['index']);router[_0xe430('0x8')](_0xe430('0xa'),auth[_0xe430('0x9')](),controller[_0xe430('0xb')]);router[_0xe430('0xc')]('/',auth['isAuthenticated'](),controller[_0xe430('0xd')]);router[_0xe430('0xe')](_0xe430('0xa'),auth[_0xe430('0x9')](),controller[_0xe430('0xf')]);router['delete'](_0xe430('0xa'),auth[_0xe430('0x9')](),controller[_0xe430('0x10')]);module[_0xe430('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 3ca3fe1..1e8817e 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.attributes.js +++ b/server/api/intFreshsalesField/intFreshsalesField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2045=['customVariable','STRING','ENUM','BOOLEAN','sequelize','exports','variable'];(function(_0x2b28d8,_0x25fb00){var _0x25cd1e=function(_0x4cfdbf){while(--_0x4cfdbf){_0x2b28d8['push'](_0x2b28d8['shift']());}};_0x25cd1e(++_0x25fb00);}(_0x2045,0xba));var _0x5204=function(_0x45b479,_0x3e6574){_0x45b479=_0x45b479-0x0;var _0x1c3cbe=_0x2045[_0x45b479];return _0x1c3cbe;};'use strict';var Sequelize=require(_0x5204('0x0'));module[_0x5204('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x5204('0x2'),_0x5204('0x3'),'keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x5204('0x4')]},'key':{'type':Sequelize[_0x5204('0x4')]},'keyType':{'type':Sequelize[_0x5204('0x5')]('string','variable',_0x5204('0x3'))},'keyContent':{'type':Sequelize[_0x5204('0x4')]},'idField':{'type':Sequelize[_0x5204('0x4')]},'nameField':{'type':Sequelize[_0x5204('0x4')]},'customField':{'type':Sequelize[_0x5204('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5204('0x4')]}}; \ No newline at end of file +var _0x5011=['ENUM','BOOLEAN','sequelize','exports','string','variable','customVariable','picklist','STRING'];(function(_0xbf49f1,_0x375f3c){var _0x39c49a=function(_0x42a07a){while(--_0x42a07a){_0xbf49f1['push'](_0xbf49f1['shift']());}};_0x39c49a(++_0x375f3c);}(_0x5011,0xe3));var _0x1501=function(_0x18cac4,_0x57a4d5){_0x18cac4=_0x18cac4-0x0;var _0x2227c6=_0x5011[_0x18cac4];return _0x2227c6;};'use strict';var Sequelize=require(_0x1501('0x0'));module[_0x1501('0x1')]={'type':{'type':Sequelize['ENUM'](_0x1501('0x2'),_0x1501('0x3'),_0x1501('0x4'),'keyValue',_0x1501('0x5')),'defaultValue':_0x1501('0x2')},'content':{'type':Sequelize[_0x1501('0x6')]},'key':{'type':Sequelize[_0x1501('0x6')]},'keyType':{'type':Sequelize[_0x1501('0x7')](_0x1501('0x2'),_0x1501('0x3'),_0x1501('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x1501('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x1501('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1501('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 395953f..8f8f187 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.controller.js +++ b/server/api/intFreshsalesField/intFreshsalesField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x321f=['VIRTUAL','merge','options','includeAll','include','findAll','catch','params','keys','intersection','find','create','body','update','destroy','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','then','error','stack','name','index','map','FreshsalesField','rawAttributes','fieldName','type','key','query','filters','model','fields','attributes','length','limit','order','sort','where','pick','filter'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0x321f,0x1c5));var _0xf321=function(_0x5baed9,_0x409757){_0x5baed9=_0x5baed9-0x0;var _0x43aad3=_0x321f[_0x5baed9];return _0x43aad3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf321('0x0'));var zipdir=require(_0xf321('0x1'));var jsonpatch=require(_0xf321('0x2'));var rp=require('request-promise');var moment=require(_0xf321('0x3'));var BPromise=require(_0xf321('0x4'));var Mustache=require(_0xf321('0x5'));var util=require(_0xf321('0x6'));var path=require('path');var sox=require(_0xf321('0x7'));var csv=require(_0xf321('0x8'));var ejs=require(_0xf321('0x9'));var fs=require('fs');var fs_extra=require(_0xf321('0xa'));var _=require(_0xf321('0xb'));var squel=require(_0xf321('0xc'));var crypto=require(_0xf321('0xd'));var jsforce=require(_0xf321('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf321('0x8'));var querystring=require(_0xf321('0xf'));var Papa=require(_0xf321('0x10'));var Redis=require(_0xf321('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf321('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf321('0x13'));var logger=require(_0xf321('0x14'))(_0xf321('0x15'));var utils=require('../../config/utils');var config=require(_0xf321('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf321('0x17'))['db'];function respondWithStatusCode(_0x113e96,_0x3ab1a1){_0x3ab1a1=_0x3ab1a1||0xcc;return function(_0x7d6ca){if(_0x7d6ca){return _0x113e96[_0xf321('0x18')](_0x3ab1a1);}return _0x113e96[_0xf321('0x19')](_0x3ab1a1)[_0xf321('0x1a')]();};}function respondWithResult(_0x9da6bb,_0x2cab7d){_0x2cab7d=_0x2cab7d||0xc8;return function(_0xf9b702){if(_0xf9b702){return _0x9da6bb[_0xf321('0x19')](_0x2cab7d)[_0xf321('0x1b')](_0xf9b702);}};}function respondWithFilteredResult(_0x36f7ad,_0x1b07ee){return function(_0x190729){if(_0x190729){var _0x3ad65a=typeof _0x1b07ee[_0xf321('0x1c')]===_0xf321('0x1d')&&typeof _0x1b07ee['limit']===_0xf321('0x1d');var _0x521641=_0x190729['count'];var _0x3f800f=_0x3ad65a?0x0:_0x1b07ee[_0xf321('0x1c')];var _0x1559e9=_0x3ad65a?_0x190729[_0xf321('0x1e')]:_0x1b07ee[_0xf321('0x1c')]+_0x1b07ee['limit'];var _0x522413;if(_0x1559e9>=_0x521641){_0x1559e9=_0x521641;_0x522413=0xc8;}else{_0x522413=0xce;}_0x36f7ad[_0xf321('0x19')](_0x522413);return _0x36f7ad['set'](_0xf321('0x1f'),_0x3f800f+'-'+_0x1559e9+'/'+_0x521641)[_0xf321('0x1b')](_0x190729);}return null;};}function patchUpdates(_0x55eeec){return function(_0x5af790){try{jsonpatch[_0xf321('0x20')](_0x5af790,_0x55eeec,!![]);}catch(_0x42c7ca){return BPromise[_0xf321('0x21')](_0x42c7ca);}return _0x5af790[_0xf321('0x22')]();};}function saveUpdates(_0x39a59c,_0x180c5f){return function(_0x5a7de1){if(_0x5a7de1){return _0x5a7de1['update'](_0x39a59c)[_0xf321('0x23')](function(_0x1f5fe0){return _0x1f5fe0;});}return null;};}function removeEntity(_0x4e6af2,_0x2a1b2e){return function(_0x8d7200){if(_0x8d7200){return _0x8d7200['destroy']()['then'](function(){_0x4e6af2[_0xf321('0x19')](0xcc)[_0xf321('0x1a')]();});}};}function handleEntityNotFound(_0xa600e7,_0x4be40d){return function(_0x1886fa){if(!_0x1886fa){_0xa600e7[_0xf321('0x18')](0x194);}return _0x1886fa;};}function handleError(_0x26ceb2,_0x4c43e6){_0x4c43e6=_0x4c43e6||0x1f4;return function(_0x4492be){logger[_0xf321('0x24')](_0x4492be[_0xf321('0x25')]);if(_0x4492be[_0xf321('0x26')]){delete _0x4492be[_0xf321('0x26')];}_0x26ceb2['status'](_0x4c43e6)['send'](_0x4492be);};}exports[_0xf321('0x27')]=function(_0x17696a,_0x33c1d2){var _0x5cee21={},_0x1f95ff={},_0x7792a9={'count':0x0,'rows':[]};var _0x102820=_[_0xf321('0x28')](db[_0xf321('0x29')][_0xf321('0x2a')],function(_0x2f954d){return{'name':_0x2f954d[_0xf321('0x2b')],'type':_0x2f954d[_0xf321('0x2c')][_0xf321('0x2d')]};});_0x1f95ff['model']=_[_0xf321('0x28')](_0x102820,_0xf321('0x26'));_0x1f95ff[_0xf321('0x2e')]=_['keys'](_0x17696a[_0xf321('0x2e')]);_0x1f95ff[_0xf321('0x2f')]=_['intersection'](_0x1f95ff[_0xf321('0x30')],_0x1f95ff[_0xf321('0x2e')]);_0x5cee21['attributes']=_['intersection'](_0x1f95ff[_0xf321('0x30')],qs['fields'](_0x17696a[_0xf321('0x2e')][_0xf321('0x31')]));_0x5cee21[_0xf321('0x32')]=_0x5cee21[_0xf321('0x32')][_0xf321('0x33')]?_0x5cee21[_0xf321('0x32')]:_0x1f95ff[_0xf321('0x30')];if(!_0x17696a[_0xf321('0x2e')]['hasOwnProperty']('nolimit')){_0x5cee21['limit']=qs[_0xf321('0x34')](_0x17696a['query'][_0xf321('0x34')]);_0x5cee21[_0xf321('0x1c')]=qs[_0xf321('0x1c')](_0x17696a[_0xf321('0x2e')][_0xf321('0x1c')]);}_0x5cee21[_0xf321('0x35')]=qs['sort'](_0x17696a['query'][_0xf321('0x36')]);_0x5cee21[_0xf321('0x37')]=qs[_0xf321('0x2f')](_[_0xf321('0x38')](_0x17696a[_0xf321('0x2e')],_0x1f95ff['filters']),_0x102820);if(_0x17696a[_0xf321('0x2e')][_0xf321('0x39')]){_0x5cee21[_0xf321('0x37')]=_['merge'](_0x5cee21[_0xf321('0x37')],{'$or':_[_0xf321('0x28')](_0x102820,function(_0x5b08d1){if(_0x5b08d1[_0xf321('0x2c')]!==_0xf321('0x3a')){var _0x4ca9c0={};_0x4ca9c0[_0x5b08d1[_0xf321('0x26')]]={'$like':'%'+_0x17696a['query']['filter']+'%'};return _0x4ca9c0;}})});}_0x5cee21=_[_0xf321('0x3b')]({},_0x5cee21,_0x17696a[_0xf321('0x3c')]);var _0x54ffe5={'where':_0x5cee21[_0xf321('0x37')]};return db[_0xf321('0x29')][_0xf321('0x1e')](_0x54ffe5)[_0xf321('0x23')](function(_0x3ac8a7){_0x7792a9[_0xf321('0x1e')]=_0x3ac8a7;if(_0x17696a[_0xf321('0x2e')][_0xf321('0x3d')]){_0x5cee21[_0xf321('0x3e')]=[{'all':!![]}];}return db[_0xf321('0x29')][_0xf321('0x3f')](_0x5cee21);})['then'](function(_0x371b77){_0x7792a9['rows']=_0x371b77;return _0x7792a9;})[_0xf321('0x23')](respondWithFilteredResult(_0x33c1d2,_0x5cee21))[_0xf321('0x40')](handleError(_0x33c1d2,null));};exports['show']=function(_0x3abef7,_0x57614b){var _0x461270={'raw':!![],'where':{'id':_0x3abef7[_0xf321('0x41')]['id']}},_0x17ec05={};_0x17ec05[_0xf321('0x30')]=_[_0xf321('0x42')](db[_0xf321('0x29')][_0xf321('0x2a')]);_0x17ec05[_0xf321('0x2e')]=_['keys'](_0x3abef7[_0xf321('0x2e')]);_0x17ec05[_0xf321('0x2f')]=_['intersection'](_0x17ec05['model'],_0x17ec05[_0xf321('0x2e')]);_0x461270[_0xf321('0x32')]=_[_0xf321('0x43')](_0x17ec05['model'],qs[_0xf321('0x31')](_0x3abef7[_0xf321('0x2e')][_0xf321('0x31')]));_0x461270[_0xf321('0x32')]=_0x461270[_0xf321('0x32')][_0xf321('0x33')]?_0x461270[_0xf321('0x32')]:_0x17ec05[_0xf321('0x30')];if(_0x3abef7['query'][_0xf321('0x3d')]){_0x461270[_0xf321('0x3e')]=[{'all':!![]}];}_0x461270=_['merge']({},_0x461270,_0x3abef7[_0xf321('0x3c')]);return db[_0xf321('0x29')][_0xf321('0x44')](_0x461270)[_0xf321('0x23')](handleEntityNotFound(_0x57614b,null))['then'](respondWithResult(_0x57614b,null))[_0xf321('0x40')](handleError(_0x57614b,null));};exports[_0xf321('0x45')]=function(_0x573933,_0x4a0c15){return db[_0xf321('0x29')][_0xf321('0x45')](_0x573933[_0xf321('0x46')],{})[_0xf321('0x23')](respondWithResult(_0x4a0c15,0xc9))[_0xf321('0x40')](handleError(_0x4a0c15,null));};exports[_0xf321('0x47')]=function(_0x4662d2,_0x2a9ee9){if(_0x4662d2[_0xf321('0x46')]['id']){delete _0x4662d2[_0xf321('0x46')]['id'];}return db[_0xf321('0x29')][_0xf321('0x44')]({'where':{'id':_0x4662d2[_0xf321('0x41')]['id']}})[_0xf321('0x23')](handleEntityNotFound(_0x2a9ee9,null))[_0xf321('0x23')](saveUpdates(_0x4662d2['body'],null))[_0xf321('0x23')](respondWithResult(_0x2a9ee9,null))['catch'](handleError(_0x2a9ee9,null));};exports[_0xf321('0x48')]=function(_0x8e7d5,_0x25909a){return db[_0xf321('0x29')][_0xf321('0x44')]({'where':{'id':_0x8e7d5[_0xf321('0x41')]['id']}})[_0xf321('0x23')](handleEntityNotFound(_0x25909a,null))[_0xf321('0x23')](removeEntity(_0x25909a,null))[_0xf321('0x40')](handleError(_0x25909a,null));}; \ No newline at end of file +var _0x9792=['index','map','FreshsalesField','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','reject','save','update','then','destroy','error','stack','name'];(function(_0x42e371,_0x2bb2e2){var _0x187c44=function(_0x37f8a3){while(--_0x37f8a3){_0x42e371['push'](_0x42e371['shift']());}};_0x187c44(++_0x2bb2e2);}(_0x9792,0x1f4));var _0x2979=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x9792[_0x199572];return _0x13cfa3;};'use strict';var emlformat=require(_0x2979('0x0'));var rimraf=require(_0x2979('0x1'));var zipdir=require(_0x2979('0x2'));var jsonpatch=require(_0x2979('0x3'));var rp=require(_0x2979('0x4'));var moment=require(_0x2979('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2979('0x6'));var util=require(_0x2979('0x7'));var path=require(_0x2979('0x8'));var sox=require(_0x2979('0x9'));var csv=require('to-csv');var ejs=require(_0x2979('0xa'));var fs=require('fs');var fs_extra=require(_0x2979('0xb'));var _=require(_0x2979('0xc'));var squel=require(_0x2979('0xd'));var crypto=require(_0x2979('0xe'));var jsforce=require(_0x2979('0xf'));var deskjs=require(_0x2979('0x10'));var toCsv=require(_0x2979('0x11'));var querystring=require(_0x2979('0x12'));var Papa=require(_0x2979('0x13'));var Redis=require('ioredis');var authService=require(_0x2979('0x14'));var qs=require(_0x2979('0x15'));var as=require(_0x2979('0x16'));var hardwareService=require(_0x2979('0x17'));var logger=require('../../config/logger')(_0x2979('0x18'));var utils=require(_0x2979('0x19'));var config=require(_0x2979('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x2979('0x1b'))['db'];function respondWithStatusCode(_0x1186f6,_0x15c29e){_0x15c29e=_0x15c29e||0xcc;return function(_0x84729){if(_0x84729){return _0x1186f6[_0x2979('0x1c')](_0x15c29e);}return _0x1186f6['status'](_0x15c29e)[_0x2979('0x1d')]();};}function respondWithResult(_0x4f4627,_0x3f506c){_0x3f506c=_0x3f506c||0xc8;return function(_0x451443){if(_0x451443){return _0x4f4627['status'](_0x3f506c)[_0x2979('0x1e')](_0x451443);}};}function respondWithFilteredResult(_0x322e00,_0x327003){return function(_0x51144b){if(_0x51144b){var _0x4da8b4=typeof _0x327003[_0x2979('0x1f')]===_0x2979('0x20')&&typeof _0x327003[_0x2979('0x21')]===_0x2979('0x20');var _0x523ff0=_0x51144b[_0x2979('0x22')];var _0x2a645=_0x4da8b4?0x0:_0x327003['offset'];var _0x24cfa9=_0x4da8b4?_0x51144b[_0x2979('0x22')]:_0x327003['offset']+_0x327003['limit'];var _0x1865bf;if(_0x24cfa9>=_0x523ff0){_0x24cfa9=_0x523ff0;_0x1865bf=0xc8;}else{_0x1865bf=0xce;}_0x322e00[_0x2979('0x23')](_0x1865bf);return _0x322e00[_0x2979('0x24')](_0x2979('0x25'),_0x2a645+'-'+_0x24cfa9+'/'+_0x523ff0)[_0x2979('0x1e')](_0x51144b);}return null;};}function patchUpdates(_0x5e94ee){return function(_0x192462){try{jsonpatch['apply'](_0x192462,_0x5e94ee,!![]);}catch(_0x37b55a){return BPromise[_0x2979('0x26')](_0x37b55a);}return _0x192462[_0x2979('0x27')]();};}function saveUpdates(_0x4644e7,_0x5d2c33){return function(_0x39b51c){if(_0x39b51c){return _0x39b51c[_0x2979('0x28')](_0x4644e7)[_0x2979('0x29')](function(_0x42f8e7){return _0x42f8e7;});}return null;};}function removeEntity(_0x2197f2,_0x25e650){return function(_0x25ff84){if(_0x25ff84){return _0x25ff84[_0x2979('0x2a')]()['then'](function(){_0x2197f2[_0x2979('0x23')](0xcc)[_0x2979('0x1d')]();});}};}function handleEntityNotFound(_0x5a2cb2,_0x4c1c88){return function(_0x4bbeaa){if(!_0x4bbeaa){_0x5a2cb2[_0x2979('0x1c')](0x194);}return _0x4bbeaa;};}function handleError(_0x4188c7,_0x3a5ef1){_0x3a5ef1=_0x3a5ef1||0x1f4;return function(_0x26d932){logger[_0x2979('0x2b')](_0x26d932[_0x2979('0x2c')]);if(_0x26d932['name']){delete _0x26d932[_0x2979('0x2d')];}_0x4188c7['status'](_0x3a5ef1)['send'](_0x26d932);};}exports[_0x2979('0x2e')]=function(_0x256bf5,_0x160f49){var _0x36d4cb={},_0x147ea7={},_0x504972={'count':0x0,'rows':[]};var _0x5b2d6b=_[_0x2979('0x2f')](db[_0x2979('0x30')][_0x2979('0x31')],function(_0x4286f0){return{'name':_0x4286f0[_0x2979('0x32')],'type':_0x4286f0[_0x2979('0x33')]['key']};});_0x147ea7[_0x2979('0x34')]=_[_0x2979('0x2f')](_0x5b2d6b,_0x2979('0x2d'));_0x147ea7['query']=_[_0x2979('0x35')](_0x256bf5['query']);_0x147ea7[_0x2979('0x36')]=_[_0x2979('0x37')](_0x147ea7[_0x2979('0x34')],_0x147ea7[_0x2979('0x38')]);_0x36d4cb[_0x2979('0x39')]=_[_0x2979('0x37')](_0x147ea7[_0x2979('0x34')],qs['fields'](_0x256bf5['query'][_0x2979('0x3a')]));_0x36d4cb[_0x2979('0x39')]=_0x36d4cb[_0x2979('0x39')][_0x2979('0x3b')]?_0x36d4cb[_0x2979('0x39')]:_0x147ea7[_0x2979('0x34')];if(!_0x256bf5['query']['hasOwnProperty']('nolimit')){_0x36d4cb[_0x2979('0x21')]=qs[_0x2979('0x21')](_0x256bf5[_0x2979('0x38')][_0x2979('0x21')]);_0x36d4cb['offset']=qs[_0x2979('0x1f')](_0x256bf5[_0x2979('0x38')]['offset']);}_0x36d4cb[_0x2979('0x3c')]=qs['sort'](_0x256bf5[_0x2979('0x38')][_0x2979('0x3d')]);_0x36d4cb[_0x2979('0x3e')]=qs[_0x2979('0x36')](_[_0x2979('0x3f')](_0x256bf5[_0x2979('0x38')],_0x147ea7['filters']),_0x5b2d6b);if(_0x256bf5[_0x2979('0x38')][_0x2979('0x40')]){_0x36d4cb[_0x2979('0x3e')]=_[_0x2979('0x41')](_0x36d4cb['where'],{'$or':_[_0x2979('0x2f')](_0x5b2d6b,function(_0x19d995){if(_0x19d995[_0x2979('0x33')]!==_0x2979('0x42')){var _0x506d97={};_0x506d97[_0x19d995[_0x2979('0x2d')]]={'$like':'%'+_0x256bf5[_0x2979('0x38')]['filter']+'%'};return _0x506d97;}})});}_0x36d4cb=_['merge']({},_0x36d4cb,_0x256bf5[_0x2979('0x43')]);var _0x5a89c9={'where':_0x36d4cb['where']};return db['FreshsalesField'][_0x2979('0x22')](_0x5a89c9)[_0x2979('0x29')](function(_0x34e8e9){_0x504972[_0x2979('0x22')]=_0x34e8e9;if(_0x256bf5['query'][_0x2979('0x44')]){_0x36d4cb[_0x2979('0x45')]=[{'all':!![]}];}return db['FreshsalesField'][_0x2979('0x46')](_0x36d4cb);})[_0x2979('0x29')](function(_0x5cb93e){_0x504972[_0x2979('0x47')]=_0x5cb93e;return _0x504972;})[_0x2979('0x29')](respondWithFilteredResult(_0x160f49,_0x36d4cb))[_0x2979('0x48')](handleError(_0x160f49,null));};exports[_0x2979('0x49')]=function(_0x3170c0,_0x1d4cd2){var _0x397aba={'raw':!![],'where':{'id':_0x3170c0[_0x2979('0x4a')]['id']}},_0x2ca9f4={};_0x2ca9f4[_0x2979('0x34')]=_[_0x2979('0x35')](db[_0x2979('0x30')][_0x2979('0x31')]);_0x2ca9f4[_0x2979('0x38')]=_[_0x2979('0x35')](_0x3170c0[_0x2979('0x38')]);_0x2ca9f4[_0x2979('0x36')]=_['intersection'](_0x2ca9f4['model'],_0x2ca9f4[_0x2979('0x38')]);_0x397aba[_0x2979('0x39')]=_[_0x2979('0x37')](_0x2ca9f4[_0x2979('0x34')],qs['fields'](_0x3170c0[_0x2979('0x38')][_0x2979('0x3a')]));_0x397aba[_0x2979('0x39')]=_0x397aba[_0x2979('0x39')][_0x2979('0x3b')]?_0x397aba[_0x2979('0x39')]:_0x2ca9f4[_0x2979('0x34')];if(_0x3170c0[_0x2979('0x38')][_0x2979('0x44')]){_0x397aba[_0x2979('0x45')]=[{'all':!![]}];}_0x397aba=_[_0x2979('0x41')]({},_0x397aba,_0x3170c0['options']);return db['FreshsalesField']['find'](_0x397aba)[_0x2979('0x29')](handleEntityNotFound(_0x1d4cd2,null))['then'](respondWithResult(_0x1d4cd2,null))[_0x2979('0x48')](handleError(_0x1d4cd2,null));};exports[_0x2979('0x4b')]=function(_0x35934d,_0x21e33d){return db[_0x2979('0x30')][_0x2979('0x4b')](_0x35934d[_0x2979('0x4c')],{})[_0x2979('0x29')](respondWithResult(_0x21e33d,0xc9))[_0x2979('0x48')](handleError(_0x21e33d,null));};exports[_0x2979('0x28')]=function(_0x115352,_0x3e578b){if(_0x115352['body']['id']){delete _0x115352[_0x2979('0x4c')]['id'];}return db[_0x2979('0x30')][_0x2979('0x4d')]({'where':{'id':_0x115352[_0x2979('0x4a')]['id']}})[_0x2979('0x29')](handleEntityNotFound(_0x3e578b,null))[_0x2979('0x29')](saveUpdates(_0x115352[_0x2979('0x4c')],null))[_0x2979('0x29')](respondWithResult(_0x3e578b,null))[_0x2979('0x48')](handleError(_0x3e578b,null));};exports[_0x2979('0x2a')]=function(_0x30e63a,_0x360968){return db[_0x2979('0x30')][_0x2979('0x4d')]({'where':{'id':_0x30e63a[_0x2979('0x4a')]['id']}})[_0x2979('0x29')](handleEntityNotFound(_0x360968,null))[_0x2979('0x29')](removeEntity(_0x360968,null))[_0x2979('0x48')](handleError(_0x360968,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index c35445c..2aeb001 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.model.js +++ b/server/api/intFreshsalesField/intFreshsalesField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd943=['api','bluebird','request-promise','path','rimraf','../../config/environment','int_freshsales_fields','freshsales_unique_index','lodash','util','../../config/logger'];(function(_0x3a5450,_0x4483b3){var _0x34ea28=function(_0x386366){while(--_0x386366){_0x3a5450['push'](_0x3a5450['shift']());}};_0x34ea28(++_0x4483b3);}(_0xd943,0x15d));var _0x3d94=function(_0x469c2e,_0x505de6){_0x469c2e=_0x469c2e-0x0;var _0x467184=_0xd943[_0x469c2e];return _0x467184;};'use strict';var _=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var logger=require(_0x3d94('0x2'))(_0x3d94('0x3'));var moment=require('moment');var BPromise=require(_0x3d94('0x4'));var rp=require(_0x3d94('0x5'));var fs=require('fs');var path=require(_0x3d94('0x6'));var rimraf=require(_0x3d94('0x7'));var config=require(_0x3d94('0x8'));var attributes=require('./intFreshsalesField.attributes');module['exports']=function(_0x34c9c3,_0x51cf1f){return _0x34c9c3['define']('FreshsalesField',attributes,{'tableName':_0x3d94('0x9'),'paranoid':![],'indexes':[{'name':_0x3d94('0xa'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb90a=['api','../../config/environment','./intFreshsalesField.attributes','define','FreshsalesField','freshsales_unique_index','idField','FieldId','lodash','util'];(function(_0x2cdfc8,_0x513d3b){var _0x502bc1=function(_0x5af279){while(--_0x5af279){_0x2cdfc8['push'](_0x2cdfc8['shift']());}};_0x502bc1(++_0x513d3b);}(_0xb90a,0x12a));var _0xab90=function(_0x2d7bb2,_0x3ac4b7){_0x2d7bb2=_0x2d7bb2-0x0;var _0x31e766=_0xb90a[_0x2d7bb2];return _0x31e766;};'use strict';var _=require(_0xab90('0x0'));var util=require(_0xab90('0x1'));var logger=require('../../config/logger')(_0xab90('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xab90('0x3'));var attributes=require(_0xab90('0x4'));module['exports']=function(_0x5e0540,_0xf36407){return _0x5e0540[_0xab90('0x5')](_0xab90('0x6'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0xab90('0x7'),'fields':[_0xab90('0x8'),_0xab90('0x9')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index d79f6fb..acacbb9 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.rpc.js +++ b/server/api/intFreshsalesField/intFreshsalesField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd117=['request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshsalesField,\x20%s,\x20%s','debug','stringify','code','error','message'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xd117,0x182));var _0x7d11=function(_0x3c5ad6,_0x47b7bf){_0x3c5ad6=_0x3c5ad6-0x0;var _0x3154f2=_0xd117[_0x3c5ad6];return _0x3154f2;};'use strict';var _=require(_0x7d11('0x0'));var util=require(_0x7d11('0x1'));var moment=require(_0x7d11('0x2'));var BPromise=require(_0x7d11('0x3'));var rs=require(_0x7d11('0x4'));var fs=require('fs');var Redis=require(_0x7d11('0x5'));var db=require(_0x7d11('0x6'))['db'];var utils=require(_0x7d11('0x7'));var logger=require(_0x7d11('0x8'))(_0x7d11('0x9'));var config=require(_0x7d11('0xa'));var jayson=require(_0x7d11('0xb'));var client=jayson[_0x7d11('0xc')][_0x7d11('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x345602,_0x3c8d66,_0x47b5e6){return new BPromise(function(_0x3803b5,_0xffd020){return client[_0x7d11('0xe')](_0x345602,_0x47b5e6)['then'](function(_0x305eef){logger[_0x7d11('0xf')](_0x7d11('0x10'),_0x3c8d66,'request\x20sent');logger[_0x7d11('0x11')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x3c8d66,'request\x20sent',JSON[_0x7d11('0x12')](_0x305eef));if(_0x305eef['error']){if(_0x305eef['error'][_0x7d11('0x13')]===0x1f4){logger['error'](_0x7d11('0x10'),_0x3c8d66,_0x305eef[_0x7d11('0x14')]['message']);return _0xffd020(_0x305eef[_0x7d11('0x14')][_0x7d11('0x15')]);}logger['error'](_0x7d11('0x10'),_0x3c8d66,_0x305eef[_0x7d11('0x14')][_0x7d11('0x15')]);return _0x3803b5(_0x305eef[_0x7d11('0x14')][_0x7d11('0x15')]);}else{logger[_0x7d11('0xf')](_0x7d11('0x10'),_0x3c8d66,_0x7d11('0x16'));_0x3803b5(_0x305eef['result'][_0x7d11('0x15')]);}})[_0x7d11('0x17')](function(_0x169733){logger[_0x7d11('0x14')](_0x7d11('0x10'),_0x3c8d66,_0x169733);_0xffd020(_0x169733);});});} \ No newline at end of file +var _0x5d17=['request','info','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesField,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2bd630,_0x494f0a){var _0x34d159=function(_0x540cfd){while(--_0x540cfd){_0x2bd630['push'](_0x2bd630['shift']());}};_0x34d159(++_0x494f0a);}(_0x5d17,0x114));var _0x75d1=function(_0x2bfa06,_0x351e03){_0x2bfa06=_0x2bfa06-0x0;var _0x58811b=_0x5d17[_0x2bfa06];return _0x58811b;};'use strict';var _=require(_0x75d1('0x0'));var util=require(_0x75d1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x75d1('0x2'));var fs=require('fs');var Redis=require(_0x75d1('0x3'));var db=require(_0x75d1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x75d1('0x5'))(_0x75d1('0x6'));var config=require(_0x75d1('0x7'));var jayson=require(_0x75d1('0x8'));var client=jayson['client'][_0x75d1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x116a51,_0x5c957a,_0x1ee61b){return new BPromise(function(_0x3a9d5e,_0x105607){return client[_0x75d1('0xa')](_0x116a51,_0x1ee61b)['then'](function(_0x4cf632){logger[_0x75d1('0xb')]('FreshsalesField,\x20%s,\x20%s',_0x5c957a,'request\x20sent');logger[_0x75d1('0xc')](_0x75d1('0xd'),_0x5c957a,'request\x20sent',JSON[_0x75d1('0xe')](_0x4cf632));if(_0x4cf632[_0x75d1('0xf')]){if(_0x4cf632[_0x75d1('0xf')][_0x75d1('0x10')]===0x1f4){logger[_0x75d1('0xf')](_0x75d1('0x11'),_0x5c957a,_0x4cf632['error'][_0x75d1('0x12')]);return _0x105607(_0x4cf632[_0x75d1('0xf')][_0x75d1('0x12')]);}logger[_0x75d1('0xf')]('FreshsalesField,\x20%s,\x20%s',_0x5c957a,_0x4cf632['error']['message']);return _0x3a9d5e(_0x4cf632[_0x75d1('0xf')][_0x75d1('0x12')]);}else{logger[_0x75d1('0xb')]('FreshsalesField,\x20%s,\x20%s',_0x5c957a,_0x75d1('0x13'));_0x3a9d5e(_0x4cf632[_0x75d1('0x14')][_0x75d1('0x12')]);}})[_0x75d1('0x15')](function(_0x1160ca){logger[_0x75d1('0xf')](_0x75d1('0x11'),_0x5c957a,_0x1160ca);_0x105607(_0x1160ca);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 4fc66e8..f5ffe2e 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x2bfb06,_0x27317f){var _0x25ccd5=function(_0x1da8a7){while(--_0x1da8a7){_0x2bfb06['push'](_0x2bfb06['shift']());}};_0x25ccd5(++_0x27317f);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x16a40f,_0x5d7380){var _0x2b77c1=function(_0x115704){while(--_0x115704){_0x16a40f['push'](_0x16a40f['shift']());}};_0x2b77c1(++_0x5d7380);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 538e207..44ad69c 100644 --- a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js +++ b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x44c2=['integrationTab','sequelize','exports','STRING','username'];(function(_0x3e2480,_0x2eed70){var _0x652c0=function(_0xaae5d2){while(--_0xaae5d2){_0x3e2480['push'](_0x3e2480['shift']());}};_0x652c0(++_0x2eed70);}(_0x44c2,0x100));var _0x244c=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0x44c2[_0x12d033];return _0x3b4e80;};'use strict';var Sequelize=require(_0x244c('0x0'));module[_0x244c('0x1')]={'name':{'type':Sequelize[_0x244c('0x2')]},'description':{'type':Sequelize[_0x244c('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x244c('0x3')},'remoteUri':{'type':Sequelize[_0x244c('0x2')]},'password':{'type':Sequelize[_0x244c('0x2')]},'clientId':{'type':Sequelize[_0x244c('0x2')]},'clientSecret':{'type':Sequelize[_0x244c('0x2')]},'securityToken':{'type':Sequelize[_0x244c('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x244c('0x4'),'newTab'),'defaultValue':_0x244c('0x4')}}; \ No newline at end of file +var _0x49fe=['ENUM','integrationTab','newTab','sequelize','STRING','username'];(function(_0x2accfc,_0x3d647e){var _0x165fb8=function(_0x29d1e1){while(--_0x29d1e1){_0x2accfc['push'](_0x2accfc['shift']());}};_0x165fb8(++_0x3d647e);}(_0x49fe,0x75));var _0xe49f=function(_0x10334,_0x146060){_0x10334=_0x10334-0x0;var _0xdccc59=_0x49fe[_0x10334];return _0xdccc59;};'use strict';var Sequelize=require(_0xe49f('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xe49f('0x1')],'unique':_0xe49f('0x2')},'remoteUri':{'type':Sequelize[_0xe49f('0x1')]},'password':{'type':Sequelize[_0xe49f('0x1')]},'clientId':{'type':Sequelize[_0xe49f('0x1')]},'clientSecret':{'type':Sequelize[_0xe49f('0x1')]},'securityToken':{'type':Sequelize[_0xe49f('0x1')]},'serverUrl':{'type':Sequelize[_0xe49f('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xe49f('0x3')](_0xe49f('0x4'),_0xe49f('0x5')),'defaultValue':_0xe49f('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 2bcb211..6f947d7 100644 --- a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js +++ b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9a7b=['catch','keys','fields','find','create','body','params','destroy','getConfigurations','findOne','SalesforceConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','SalesforceField','Descriptions','getFields','Task','remoteUri','clientId','clientSecret','username','password','securityToken','substring','lastIndexOf','Connection','login','isNil','ticketType','sobject','describe','OwnerId','IsReminderSet','Subject','Description','string','int','picklist','email','phone','remove','includes','label','picklistValues','value','True','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll'];(function(_0x194748,_0x3ea342){var _0x5171d3=function(_0x3f0425){while(--_0x3f0425){_0x194748['push'](_0x194748['shift']());}};_0x5171d3(++_0x3ea342);}(_0x9a7b,0xbe));var _0xb9a7=function(_0x1e0af1,_0x3532f5){_0x1e0af1=_0x1e0af1-0x0;var _0x15404d=_0x9a7b[_0x1e0af1];return _0x15404d;};'use strict';var emlformat=require(_0xb9a7('0x0'));var rimraf=require(_0xb9a7('0x1'));var zipdir=require(_0xb9a7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb9a7('0x3'));var moment=require(_0xb9a7('0x4'));var BPromise=require(_0xb9a7('0x5'));var Mustache=require(_0xb9a7('0x6'));var util=require(_0xb9a7('0x7'));var path=require(_0xb9a7('0x8'));var sox=require(_0xb9a7('0x9'));var csv=require(_0xb9a7('0xa'));var ejs=require(_0xb9a7('0xb'));var fs=require('fs');var fs_extra=require(_0xb9a7('0xc'));var _=require(_0xb9a7('0xd'));var squel=require(_0xb9a7('0xe'));var crypto=require(_0xb9a7('0xf'));var jsforce=require(_0xb9a7('0x10'));var deskjs=require(_0xb9a7('0x11'));var toCsv=require('to-csv');var querystring=require(_0xb9a7('0x12'));var Papa=require(_0xb9a7('0x13'));var Redis=require(_0xb9a7('0x14'));var authService=require(_0xb9a7('0x15'));var qs=require(_0xb9a7('0x16'));var as=require(_0xb9a7('0x17'));var hardwareService=require(_0xb9a7('0x18'));var logger=require(_0xb9a7('0x19'))(_0xb9a7('0x1a'));var utils=require(_0xb9a7('0x1b'));var config=require(_0xb9a7('0x1c'));var licenseUtil=require(_0xb9a7('0x1d'));var db=require(_0xb9a7('0x1e'))['db'];var integrations=require(_0xb9a7('0x1f'));function respondWithStatusCode(_0x23698b,_0xfb57c5){_0xfb57c5=_0xfb57c5||0xcc;return function(_0x177f65){if(_0x177f65){return _0x23698b['sendStatus'](_0xfb57c5);}return _0x23698b[_0xb9a7('0x20')](_0xfb57c5)[_0xb9a7('0x21')]();};}function respondWithResult(_0x363553,_0x596a46){_0x596a46=_0x596a46||0xc8;return function(_0x5260d6){if(_0x5260d6){return _0x363553['status'](_0x596a46)[_0xb9a7('0x22')](_0x5260d6);}};}function respondWithFilteredResult(_0x4a71fe,_0x154b02){return function(_0xd55aa0){if(_0xd55aa0){var _0x5bfb2c=typeof _0x154b02[_0xb9a7('0x23')]==='undefined'&&typeof _0x154b02[_0xb9a7('0x24')]===_0xb9a7('0x25');var _0x3495e3=_0xd55aa0[_0xb9a7('0x26')];var _0x121478=_0x5bfb2c?0x0:_0x154b02['offset'];var _0x385e2f=_0x5bfb2c?_0xd55aa0[_0xb9a7('0x26')]:_0x154b02[_0xb9a7('0x23')]+_0x154b02[_0xb9a7('0x24')];var _0x2d1346;if(_0x385e2f>=_0x3495e3){_0x385e2f=_0x3495e3;_0x2d1346=0xc8;}else{_0x2d1346=0xce;}_0x4a71fe[_0xb9a7('0x20')](_0x2d1346);return _0x4a71fe[_0xb9a7('0x27')](_0xb9a7('0x28'),_0x121478+'-'+_0x385e2f+'/'+_0x3495e3)['json'](_0xd55aa0);}return null;};}function patchUpdates(_0x65cede){return function(_0x43350e){try{jsonpatch[_0xb9a7('0x29')](_0x43350e,_0x65cede,!![]);}catch(_0x1eafac){return BPromise[_0xb9a7('0x2a')](_0x1eafac);}return _0x43350e[_0xb9a7('0x2b')]();};}function saveUpdates(_0x40cc60,_0x54dcb5){return function(_0x1f22e8){if(_0x1f22e8){return _0x1f22e8[_0xb9a7('0x2c')](_0x40cc60)[_0xb9a7('0x2d')](function(_0x417df4){return _0x417df4;});}return null;};}function removeEntity(_0x4447aa,_0x314191){return function(_0x39529f){if(_0x39529f){return _0x39529f['destroy']()[_0xb9a7('0x2d')](function(){_0x4447aa[_0xb9a7('0x20')](0xcc)[_0xb9a7('0x21')]();});}};}function handleEntityNotFound(_0x17fa4c,_0x340671){return function(_0x3d9465){if(!_0x3d9465){_0x17fa4c[_0xb9a7('0x2e')](0x194);}return _0x3d9465;};}function handleError(_0x1fac51,_0x4ad783){_0x4ad783=_0x4ad783||0x1f4;return function(_0x1a73af){logger[_0xb9a7('0x2f')](_0x1a73af[_0xb9a7('0x30')]);if(_0x1a73af[_0xb9a7('0x31')]){delete _0x1a73af[_0xb9a7('0x31')];}_0x1fac51[_0xb9a7('0x20')](_0x4ad783)[_0xb9a7('0x32')](_0x1a73af);};}exports[_0xb9a7('0x33')]=function(_0x160573,_0x7d1407){var _0x4219eb={},_0x131163={},_0x5ad60e={'count':0x0,'rows':[]};var _0x344862=_[_0xb9a7('0x34')](db[_0xb9a7('0x35')][_0xb9a7('0x36')],function(_0xd0a028){return{'name':_0xd0a028[_0xb9a7('0x37')],'type':_0xd0a028[_0xb9a7('0x38')][_0xb9a7('0x39')]};});_0x131163['model']=_[_0xb9a7('0x34')](_0x344862,_0xb9a7('0x31'));_0x131163[_0xb9a7('0x3a')]=_['keys'](_0x160573[_0xb9a7('0x3a')]);_0x131163[_0xb9a7('0x3b')]=_[_0xb9a7('0x3c')](_0x131163[_0xb9a7('0x3d')],_0x131163[_0xb9a7('0x3a')]);_0x4219eb['attributes']=_[_0xb9a7('0x3c')](_0x131163[_0xb9a7('0x3d')],qs['fields'](_0x160573[_0xb9a7('0x3a')]['fields']));_0x4219eb[_0xb9a7('0x3e')]=_0x4219eb['attributes'][_0xb9a7('0x3f')]?_0x4219eb[_0xb9a7('0x3e')]:_0x131163[_0xb9a7('0x3d')];if(!_0x160573[_0xb9a7('0x3a')][_0xb9a7('0x40')](_0xb9a7('0x41'))){_0x4219eb[_0xb9a7('0x24')]=qs[_0xb9a7('0x24')](_0x160573[_0xb9a7('0x3a')][_0xb9a7('0x24')]);_0x4219eb[_0xb9a7('0x23')]=qs[_0xb9a7('0x23')](_0x160573[_0xb9a7('0x3a')][_0xb9a7('0x23')]);}_0x4219eb['order']=qs[_0xb9a7('0x42')](_0x160573['query']['sort']);_0x4219eb[_0xb9a7('0x43')]=qs[_0xb9a7('0x3b')](_[_0xb9a7('0x44')](_0x160573[_0xb9a7('0x3a')],_0x131163[_0xb9a7('0x3b')]),_0x344862);if(_0x160573[_0xb9a7('0x3a')][_0xb9a7('0x45')]){_0x4219eb[_0xb9a7('0x43')]=_[_0xb9a7('0x46')](_0x4219eb[_0xb9a7('0x43')],{'$or':_['map'](_0x344862,function(_0x5a2da4){if(_0x5a2da4[_0xb9a7('0x38')]!==_0xb9a7('0x47')){var _0x3bf1d8={};_0x3bf1d8[_0x5a2da4[_0xb9a7('0x31')]]={'$like':'%'+_0x160573[_0xb9a7('0x3a')][_0xb9a7('0x45')]+'%'};return _0x3bf1d8;}})});}_0x4219eb=_[_0xb9a7('0x46')]({},_0x4219eb,_0x160573[_0xb9a7('0x48')]);var _0x4cdb99={'where':_0x4219eb['where']};return db[_0xb9a7('0x35')][_0xb9a7('0x26')](_0x4cdb99)[_0xb9a7('0x2d')](function(_0x4f2879){_0x5ad60e['count']=_0x4f2879;if(_0x160573[_0xb9a7('0x3a')][_0xb9a7('0x49')]){_0x4219eb[_0xb9a7('0x4a')]=[{'all':!![]}];}return db[_0xb9a7('0x35')][_0xb9a7('0x4b')](_0x4219eb);})[_0xb9a7('0x2d')](function(_0x4a7703){_0x5ad60e['rows']=_0x4a7703;return _0x5ad60e;})[_0xb9a7('0x2d')](respondWithFilteredResult(_0x7d1407,_0x4219eb))[_0xb9a7('0x4c')](handleError(_0x7d1407,null));};exports['show']=function(_0x528117,_0x26a00b){var _0x207b5e={'raw':![],'where':{'id':_0x528117['params']['id']}},_0x491c50={};_0x491c50['model']=_[_0xb9a7('0x4d')](db[_0xb9a7('0x35')][_0xb9a7('0x36')]);_0x491c50[_0xb9a7('0x3a')]=_[_0xb9a7('0x4d')](_0x528117['query']);_0x491c50['filters']=_[_0xb9a7('0x3c')](_0x491c50[_0xb9a7('0x3d')],_0x491c50[_0xb9a7('0x3a')]);_0x207b5e[_0xb9a7('0x3e')]=_[_0xb9a7('0x3c')](_0x491c50[_0xb9a7('0x3d')],qs[_0xb9a7('0x4e')](_0x528117['query'][_0xb9a7('0x4e')]));_0x207b5e[_0xb9a7('0x3e')]=_0x207b5e[_0xb9a7('0x3e')][_0xb9a7('0x3f')]?_0x207b5e['attributes']:_0x491c50[_0xb9a7('0x3d')];if(_0x528117['query'][_0xb9a7('0x49')]){_0x207b5e[_0xb9a7('0x4a')]=[{'all':!![]}];}_0x207b5e=_[_0xb9a7('0x46')]({},_0x207b5e,_0x528117[_0xb9a7('0x48')]);return db[_0xb9a7('0x35')][_0xb9a7('0x4f')](_0x207b5e)[_0xb9a7('0x2d')](handleEntityNotFound(_0x26a00b,null))[_0xb9a7('0x2d')](respondWithResult(_0x26a00b,null))[_0xb9a7('0x4c')](handleError(_0x26a00b,null));};exports[_0xb9a7('0x50')]=function(_0x5db08c,_0x2d79d1){return db[_0xb9a7('0x35')][_0xb9a7('0x50')](_0x5db08c['body'],{})[_0xb9a7('0x2d')](respondWithResult(_0x2d79d1,0xc9))[_0xb9a7('0x4c')](handleError(_0x2d79d1,null));};exports[_0xb9a7('0x2c')]=function(_0x555cb7,_0x338b21){if(_0x555cb7[_0xb9a7('0x51')]['id']){delete _0x555cb7['body']['id'];}return db[_0xb9a7('0x35')][_0xb9a7('0x4f')]({'where':{'id':_0x555cb7[_0xb9a7('0x52')]['id']}})[_0xb9a7('0x2d')](handleEntityNotFound(_0x338b21,null))[_0xb9a7('0x2d')](saveUpdates(_0x555cb7[_0xb9a7('0x51')],null))[_0xb9a7('0x2d')](respondWithResult(_0x338b21,null))[_0xb9a7('0x4c')](handleError(_0x338b21,null));};exports[_0xb9a7('0x53')]=function(_0xe7279c,_0x332525){return db['SalesforceAccount']['find']({'where':{'id':_0xe7279c[_0xb9a7('0x52')]['id']}})[_0xb9a7('0x2d')](handleEntityNotFound(_0x332525,null))['then'](removeEntity(_0x332525,null))[_0xb9a7('0x4c')](handleError(_0x332525,null));};exports[_0xb9a7('0x54')]=function(_0xa8d0fb,_0x131cd7,_0x4c43e3){var _0x159493={};var _0x2c5cae={};var _0x597728;var _0x48351f;return db[_0xb9a7('0x35')][_0xb9a7('0x55')]({'where':{'id':_0xa8d0fb[_0xb9a7('0x52')]['id']}})['then'](handleEntityNotFound(_0x131cd7,null))[_0xb9a7('0x2d')](function(_0x524096){if(_0x524096){_0x597728=_0x524096;_0x2c5cae[_0xb9a7('0x3d')]=_[_0xb9a7('0x4d')](db[_0xb9a7('0x56')]['rawAttributes']);_0x2c5cae['query']=_['keys'](_0xa8d0fb[_0xb9a7('0x3a')]);_0x2c5cae['filters']=_['intersection'](_0x2c5cae['model'],_0x2c5cae[_0xb9a7('0x3a')]);_0x159493[_0xb9a7('0x3e')]=_[_0xb9a7('0x3c')](_0x2c5cae[_0xb9a7('0x3d')],qs['fields'](_0xa8d0fb['query']['fields']));_0x159493[_0xb9a7('0x3e')]=_0x159493[_0xb9a7('0x3e')][_0xb9a7('0x3f')]?_0x159493[_0xb9a7('0x3e')]:_0x2c5cae[_0xb9a7('0x3d')];_0x159493['order']=qs['sort'](_0xa8d0fb[_0xb9a7('0x3a')][_0xb9a7('0x42')]);_0x159493[_0xb9a7('0x43')]=qs['filters'](_[_0xb9a7('0x44')](_0xa8d0fb[_0xb9a7('0x3a')],_0x2c5cae[_0xb9a7('0x3b')]));if(_0xa8d0fb[_0xb9a7('0x3a')][_0xb9a7('0x45')]){_0x159493['where']=_['merge'](_0x159493[_0xb9a7('0x43')],{'$or':_[_0xb9a7('0x34')](_0x159493[_0xb9a7('0x3e')],function(_0x41798f){var _0x26bf7b={};_0x26bf7b[_0x41798f]={'$like':'%'+_0xa8d0fb[_0xb9a7('0x3a')][_0xb9a7('0x45')]+'%'};return _0x26bf7b;})});}_0x159493=_[_0xb9a7('0x46')]({},_0x159493,_0xa8d0fb['options']);return _0x597728[_0xb9a7('0x54')](_0x159493);}})['then'](function(_0x54a1f1){if(_0x54a1f1){_0x48351f=_0x54a1f1[_0xb9a7('0x3f')];if(!_0xa8d0fb[_0xb9a7('0x3a')][_0xb9a7('0x40')]('nolimit')){_0x159493['limit']=qs[_0xb9a7('0x24')](_0xa8d0fb[_0xb9a7('0x3a')][_0xb9a7('0x24')]);_0x159493['offset']=qs[_0xb9a7('0x23')](_0xa8d0fb[_0xb9a7('0x3a')]['offset']);}return _0x597728[_0xb9a7('0x54')](_0x159493);}})[_0xb9a7('0x2d')](function(_0x236be2){if(_0x236be2){return _0x236be2?{'count':_0x48351f,'rows':_0x236be2}:null;}})[_0xb9a7('0x2d')](respondWithResult(_0x131cd7,null))['catch'](handleError(_0x131cd7,null));};exports[_0xb9a7('0x57')]=function(_0x40f5b9,_0x5d7479,_0x4c3446){if(_0x40f5b9['body']['id']){delete _0x40f5b9[_0xb9a7('0x51')]['id'];}return db[_0xb9a7('0x35')]['findOne']({'where':{'id':_0x40f5b9[_0xb9a7('0x52')]['id']}})[_0xb9a7('0x2d')](handleEntityNotFound(_0x5d7479,null))['then'](function(_0x150aaf){if(_0x150aaf){_0x40f5b9[_0xb9a7('0x51')][_0xb9a7('0x58')]=_0x150aaf['id'];_0x40f5b9['body'][_0xb9a7('0x59')]=integrations[_0xb9a7('0x5a')](_0x40f5b9[_0xb9a7('0x51')][_0xb9a7('0x5b')],_0x40f5b9['body'][_0xb9a7('0x38')]);_0x40f5b9[_0xb9a7('0x51')]['Descriptions']=integrations[_0xb9a7('0x5c')](_0x40f5b9[_0xb9a7('0x51')][_0xb9a7('0x5b')],_0x40f5b9[_0xb9a7('0x51')][_0xb9a7('0x38')]);return db['SalesforceConfiguration']['create'](_0x40f5b9[_0xb9a7('0x51')],{'include':[{'model':db['SalesforceField'],'as':'Subjects'},{'model':db[_0xb9a7('0x5d')],'as':_0xb9a7('0x5e')}]});}return null;})[_0xb9a7('0x2d')](respondWithResult(_0x5d7479,null))[_0xb9a7('0x4c')](handleError(_0x5d7479,null));};exports[_0xb9a7('0x5f')]=function(_0x5b6b09,_0x5a9772,_0x19f132){var _0x13cd03;var _0x523a45='';var _0x41ca6b=_0xb9a7('0x60');return db[_0xb9a7('0x35')]['findOne']({'where':{'id':_0x5b6b09[_0xb9a7('0x52')]['id']},'attributes':['id',_0xb9a7('0x61'),_0xb9a7('0x62'),_0xb9a7('0x63'),_0xb9a7('0x64'),_0xb9a7('0x65'),_0xb9a7('0x66')]})[_0xb9a7('0x2d')](handleEntityNotFound(_0x5a9772,null))[_0xb9a7('0x2d')](function(_0x122527){if(_0x122527){_0x523a45=_0x122527['remoteUri'];var _0x20ad00=_0x523a45['slice'](-0x1);if(_0x20ad00==='/'){_0x523a45=_0x523a45[_0xb9a7('0x67')](0x0,_0x523a45[_0xb9a7('0x68')](_0x20ad00));}_0x13cd03=new jsforce[(_0xb9a7('0x69'))]({'oauth2':{'loginUrl':_0x523a45,'clientId':_0x122527['clientId'],'clientSecret':_0x122527[_0xb9a7('0x63')]}});return _0x13cd03[_0xb9a7('0x6a')](_0x122527[_0xb9a7('0x64')],_0x122527[_0xb9a7('0x65')]['concat'](_0x122527['securityToken']));}})['then'](function(_0x3cb3f1){if(_0x3cb3f1){if(!_[_0xb9a7('0x6b')](_0x5b6b09[_0xb9a7('0x3a')][_0xb9a7('0x6c')])){_0x41ca6b=_0x5b6b09[_0xb9a7('0x3a')][_0xb9a7('0x6c')];}return _0x13cd03[_0xb9a7('0x6d')](_0x41ca6b)[_0xb9a7('0x6e')]();}})[_0xb9a7('0x2d')](function(_0x4be1ba){var _0x169c1d=[_0xb9a7('0x6f'),'ActivityDate',_0xb9a7('0x70'),'IsRecurrence',_0xb9a7('0x71'),_0xb9a7('0x72')];var _0x273f21=[_0xb9a7('0x73'),_0xb9a7('0x74'),_0xb9a7('0x75'),'boolean',_0xb9a7('0x76'),'textarea',_0xb9a7('0x77')];if(_0x4be1ba){_[_0xb9a7('0x78')](_0x4be1ba['fields'],function(_0x4b9790){return _0x169c1d['includes'](_0x4b9790['name'])||!_0x273f21[_0xb9a7('0x79')](_0x4b9790[_0xb9a7('0x38')]);});return{'count':_0x4be1ba[_0xb9a7('0x4e')][_0xb9a7('0x3f')],'rows':_[_0xb9a7('0x34')](_0x4be1ba[_0xb9a7('0x4e')],function(_0x1d8d5b){return{'id':_0x1d8d5b[_0xb9a7('0x31')],'name':_0x1d8d5b[_0xb9a7('0x7a')],'custom':_0x1d8d5b['custom'],'options':_0x1d8d5b[_0xb9a7('0x7b')]['length']>0x0?_[_0xb9a7('0x34')](_0x1d8d5b['picklistValues'],function(_0x4c8f72){return{'name':_0x4c8f72[_0xb9a7('0x7a')],'value':_0x4c8f72[_0xb9a7('0x7c')]};}):_0x1d8d5b['type']=='boolean'?[{'name':_0xb9a7('0x7d'),'value':_0xb9a7('0x7e')},{'name':_0xb9a7('0x7f'),'value':_0xb9a7('0x80')}]:[]};})};}})['then'](respondWithResult(_0x5a9772,null))[_0xb9a7('0x4c')](function(_0x200088){var _0x228e54=_0x5b6b09[_0xb9a7('0x3a')][_0xb9a7('0x81')]?0x1f4:_0x200088[_0xb9a7('0x82')]||0x1f4;logger[_0xb9a7('0x2f')](_0xb9a7('0x83'),_0xb9a7('0x5f'),_0x228e54,JSON[_0xb9a7('0x84')](_0x200088));delete _0x200088[_0xb9a7('0x31')];if(_0x228e54===0x191){_0x228e54=0x190;}_0x5a9772[_0xb9a7('0x20')](_0x228e54)[_0xb9a7('0x32')](_0x5b6b09[_0xb9a7('0x3a')][_0xb9a7('0x81')]?{'message':'Wrong\x20credentials','statusCode':_0x200088[_0xb9a7('0x82')]}:_0x200088);});}; \ No newline at end of file +var _0x36cb=['crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','end','stack','name','send','SalesforceAccount','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','intersection','include','create','body','find','getConfigurations','pick','addConfiguration','findOne','Subjects','getSubjects','Descriptions','channel','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','username','password','slice','substring','lastIndexOf','login','securityToken','ticketType','sobject','describe','OwnerId','ActivityDate','IsRecurrence','Subject','string','int','boolean','email','phone','remove','includes','label','custom','picklistValues','value','true','false','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash'];(function(_0x1cb004,_0xde1e66){var _0x5784c3=function(_0x1622b1){while(--_0x1622b1){_0x1cb004['push'](_0x1cb004['shift']());}};_0x5784c3(++_0xde1e66);}(_0x36cb,0x70));var _0xb36c=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x36cb[_0x53ccf2];return _0x5a2964;};'use strict';var emlformat=require(_0xb36c('0x0'));var rimraf=require(_0xb36c('0x1'));var zipdir=require(_0xb36c('0x2'));var jsonpatch=require(_0xb36c('0x3'));var rp=require('request-promise');var moment=require(_0xb36c('0x4'));var BPromise=require(_0xb36c('0x5'));var Mustache=require(_0xb36c('0x6'));var util=require(_0xb36c('0x7'));var path=require(_0xb36c('0x8'));var sox=require('sox');var csv=require(_0xb36c('0x9'));var ejs=require(_0xb36c('0xa'));var fs=require('fs');var fs_extra=require(_0xb36c('0xb'));var _=require(_0xb36c('0xc'));var squel=require('squel');var crypto=require(_0xb36c('0xd'));var jsforce=require(_0xb36c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb36c('0x9'));var querystring=require(_0xb36c('0xf'));var Papa=require(_0xb36c('0x10'));var Redis=require(_0xb36c('0x11'));var authService=require(_0xb36c('0x12'));var qs=require(_0xb36c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb36c('0x14'));var logger=require(_0xb36c('0x15'))(_0xb36c('0x16'));var utils=require('../../config/utils');var config=require(_0xb36c('0x17'));var licenseUtil=require(_0xb36c('0x18'));var db=require(_0xb36c('0x19'))['db'];var integrations=require(_0xb36c('0x1a'));function respondWithStatusCode(_0x36e0fe,_0x3daf69){_0x3daf69=_0x3daf69||0xcc;return function(_0x441dca){if(_0x441dca){return _0x36e0fe[_0xb36c('0x1b')](_0x3daf69);}return _0x36e0fe[_0xb36c('0x1c')](_0x3daf69)['end']();};}function respondWithResult(_0x2d4abe,_0x476424){_0x476424=_0x476424||0xc8;return function(_0x2c205b){if(_0x2c205b){return _0x2d4abe['status'](_0x476424)[_0xb36c('0x1d')](_0x2c205b);}};}function respondWithFilteredResult(_0x364e16,_0x399567){return function(_0x3cef85){if(_0x3cef85){var _0x32f6cf=typeof _0x399567[_0xb36c('0x1e')]===_0xb36c('0x1f')&&typeof _0x399567[_0xb36c('0x20')]===_0xb36c('0x1f');var _0x2f860a=_0x3cef85['count'];var _0x54d54c=_0x32f6cf?0x0:_0x399567[_0xb36c('0x1e')];var _0x2df496=_0x32f6cf?_0x3cef85[_0xb36c('0x21')]:_0x399567[_0xb36c('0x1e')]+_0x399567[_0xb36c('0x20')];var _0x11d1e1;if(_0x2df496>=_0x2f860a){_0x2df496=_0x2f860a;_0x11d1e1=0xc8;}else{_0x11d1e1=0xce;}_0x364e16['status'](_0x11d1e1);return _0x364e16[_0xb36c('0x22')](_0xb36c('0x23'),_0x54d54c+'-'+_0x2df496+'/'+_0x2f860a)['json'](_0x3cef85);}return null;};}function patchUpdates(_0x4914be){return function(_0x5c1336){try{jsonpatch[_0xb36c('0x24')](_0x5c1336,_0x4914be,!![]);}catch(_0x146170){return BPromise[_0xb36c('0x25')](_0x146170);}return _0x5c1336['save']();};}function saveUpdates(_0x3668d2,_0x3bc84a){return function(_0x232cf7){if(_0x232cf7){return _0x232cf7[_0xb36c('0x26')](_0x3668d2)[_0xb36c('0x27')](function(_0x3c5fdd){return _0x3c5fdd;});}return null;};}function removeEntity(_0x31bff5,_0x54b733){return function(_0x10e2f7){if(_0x10e2f7){return _0x10e2f7[_0xb36c('0x28')]()[_0xb36c('0x27')](function(){_0x31bff5[_0xb36c('0x1c')](0xcc)[_0xb36c('0x29')]();});}};}function handleEntityNotFound(_0x980015,_0x5d422b){return function(_0x1b4c5b){if(!_0x1b4c5b){_0x980015[_0xb36c('0x1b')](0x194);}return _0x1b4c5b;};}function handleError(_0xab40c0,_0x195ea9){_0x195ea9=_0x195ea9||0x1f4;return function(_0x5b875e){logger['error'](_0x5b875e[_0xb36c('0x2a')]);if(_0x5b875e[_0xb36c('0x2b')]){delete _0x5b875e[_0xb36c('0x2b')];}_0xab40c0[_0xb36c('0x1c')](_0x195ea9)[_0xb36c('0x2c')](_0x5b875e);};}exports['index']=function(_0x32424e,_0x1949c4){var _0x1730b2={},_0x6d0768={},_0x2ce040={'count':0x0,'rows':[]};var _0x570a9b=_['map'](db[_0xb36c('0x2d')][_0xb36c('0x2e')],function(_0x938c3d){return{'name':_0x938c3d[_0xb36c('0x2f')],'type':_0x938c3d[_0xb36c('0x30')][_0xb36c('0x31')]};});_0x6d0768['model']=_[_0xb36c('0x32')](_0x570a9b,_0xb36c('0x2b'));_0x6d0768[_0xb36c('0x33')]=_[_0xb36c('0x34')](_0x32424e[_0xb36c('0x33')]);_0x6d0768[_0xb36c('0x35')]=_['intersection'](_0x6d0768[_0xb36c('0x36')],_0x6d0768[_0xb36c('0x33')]);_0x1730b2[_0xb36c('0x37')]=_['intersection'](_0x6d0768[_0xb36c('0x36')],qs[_0xb36c('0x38')](_0x32424e[_0xb36c('0x33')][_0xb36c('0x38')]));_0x1730b2[_0xb36c('0x37')]=_0x1730b2[_0xb36c('0x37')][_0xb36c('0x39')]?_0x1730b2[_0xb36c('0x37')]:_0x6d0768[_0xb36c('0x36')];if(!_0x32424e[_0xb36c('0x33')][_0xb36c('0x3a')](_0xb36c('0x3b'))){_0x1730b2['limit']=qs[_0xb36c('0x20')](_0x32424e[_0xb36c('0x33')]['limit']);_0x1730b2[_0xb36c('0x1e')]=qs[_0xb36c('0x1e')](_0x32424e[_0xb36c('0x33')][_0xb36c('0x1e')]);}_0x1730b2[_0xb36c('0x3c')]=qs[_0xb36c('0x3d')](_0x32424e[_0xb36c('0x33')][_0xb36c('0x3d')]);_0x1730b2[_0xb36c('0x3e')]=qs[_0xb36c('0x35')](_['pick'](_0x32424e['query'],_0x6d0768[_0xb36c('0x35')]),_0x570a9b);if(_0x32424e['query'][_0xb36c('0x3f')]){_0x1730b2[_0xb36c('0x3e')]=_[_0xb36c('0x40')](_0x1730b2[_0xb36c('0x3e')],{'$or':_[_0xb36c('0x32')](_0x570a9b,function(_0x167eed){if(_0x167eed['type']!==_0xb36c('0x41')){var _0x5585f6={};_0x5585f6[_0x167eed['name']]={'$like':'%'+_0x32424e[_0xb36c('0x33')][_0xb36c('0x3f')]+'%'};return _0x5585f6;}})});}_0x1730b2=_['merge']({},_0x1730b2,_0x32424e[_0xb36c('0x42')]);var _0x529a02={'where':_0x1730b2[_0xb36c('0x3e')]};return db['SalesforceAccount']['count'](_0x529a02)['then'](function(_0x590b59){_0x2ce040['count']=_0x590b59;if(_0x32424e[_0xb36c('0x33')][_0xb36c('0x43')]){_0x1730b2['include']=[{'all':!![]}];}return db[_0xb36c('0x2d')][_0xb36c('0x44')](_0x1730b2);})[_0xb36c('0x27')](function(_0x355187){_0x2ce040[_0xb36c('0x45')]=_0x355187;return _0x2ce040;})[_0xb36c('0x27')](respondWithFilteredResult(_0x1949c4,_0x1730b2))[_0xb36c('0x46')](handleError(_0x1949c4,null));};exports[_0xb36c('0x47')]=function(_0x2a5cad,_0x47bd12){var _0x4f7274={'raw':![],'where':{'id':_0x2a5cad[_0xb36c('0x48')]['id']}},_0x43eccd={};_0x43eccd[_0xb36c('0x36')]=_[_0xb36c('0x34')](db[_0xb36c('0x2d')][_0xb36c('0x2e')]);_0x43eccd[_0xb36c('0x33')]=_[_0xb36c('0x34')](_0x2a5cad[_0xb36c('0x33')]);_0x43eccd[_0xb36c('0x35')]=_[_0xb36c('0x49')](_0x43eccd[_0xb36c('0x36')],_0x43eccd[_0xb36c('0x33')]);_0x4f7274[_0xb36c('0x37')]=_['intersection'](_0x43eccd[_0xb36c('0x36')],qs['fields'](_0x2a5cad[_0xb36c('0x33')][_0xb36c('0x38')]));_0x4f7274['attributes']=_0x4f7274[_0xb36c('0x37')][_0xb36c('0x39')]?_0x4f7274[_0xb36c('0x37')]:_0x43eccd[_0xb36c('0x36')];if(_0x2a5cad[_0xb36c('0x33')]['includeAll']){_0x4f7274[_0xb36c('0x4a')]=[{'all':!![]}];}_0x4f7274=_[_0xb36c('0x40')]({},_0x4f7274,_0x2a5cad['options']);return db[_0xb36c('0x2d')]['find'](_0x4f7274)[_0xb36c('0x27')](handleEntityNotFound(_0x47bd12,null))[_0xb36c('0x27')](respondWithResult(_0x47bd12,null))['catch'](handleError(_0x47bd12,null));};exports[_0xb36c('0x4b')]=function(_0x1a769e,_0x523266){return db[_0xb36c('0x2d')][_0xb36c('0x4b')](_0x1a769e[_0xb36c('0x4c')],{})[_0xb36c('0x27')](respondWithResult(_0x523266,0xc9))[_0xb36c('0x46')](handleError(_0x523266,null));};exports['update']=function(_0x5b1aea,_0x25aa23){if(_0x5b1aea[_0xb36c('0x4c')]['id']){delete _0x5b1aea[_0xb36c('0x4c')]['id'];}return db['SalesforceAccount'][_0xb36c('0x4d')]({'where':{'id':_0x5b1aea[_0xb36c('0x48')]['id']}})[_0xb36c('0x27')](handleEntityNotFound(_0x25aa23,null))[_0xb36c('0x27')](saveUpdates(_0x5b1aea[_0xb36c('0x4c')],null))[_0xb36c('0x27')](respondWithResult(_0x25aa23,null))['catch'](handleError(_0x25aa23,null));};exports[_0xb36c('0x28')]=function(_0x40447c,_0x28afa1){return db[_0xb36c('0x2d')][_0xb36c('0x4d')]({'where':{'id':_0x40447c[_0xb36c('0x48')]['id']}})[_0xb36c('0x27')](handleEntityNotFound(_0x28afa1,null))['then'](removeEntity(_0x28afa1,null))[_0xb36c('0x46')](handleError(_0x28afa1,null));};exports[_0xb36c('0x4e')]=function(_0xd36905,_0x24b2b1,_0x2e9006){var _0x158b42={};var _0x211544={};var _0x43f328;var _0x13db53;return db['SalesforceAccount']['findOne']({'where':{'id':_0xd36905[_0xb36c('0x48')]['id']}})[_0xb36c('0x27')](handleEntityNotFound(_0x24b2b1,null))[_0xb36c('0x27')](function(_0x848ded){if(_0x848ded){_0x43f328=_0x848ded;_0x211544[_0xb36c('0x36')]=_[_0xb36c('0x34')](db['SalesforceConfiguration']['rawAttributes']);_0x211544[_0xb36c('0x33')]=_[_0xb36c('0x34')](_0xd36905['query']);_0x211544[_0xb36c('0x35')]=_[_0xb36c('0x49')](_0x211544['model'],_0x211544[_0xb36c('0x33')]);_0x158b42['attributes']=_[_0xb36c('0x49')](_0x211544['model'],qs[_0xb36c('0x38')](_0xd36905['query'][_0xb36c('0x38')]));_0x158b42[_0xb36c('0x37')]=_0x158b42['attributes']['length']?_0x158b42[_0xb36c('0x37')]:_0x211544['model'];_0x158b42['order']=qs[_0xb36c('0x3d')](_0xd36905['query'][_0xb36c('0x3d')]);_0x158b42[_0xb36c('0x3e')]=qs['filters'](_[_0xb36c('0x4f')](_0xd36905[_0xb36c('0x33')],_0x211544[_0xb36c('0x35')]));if(_0xd36905['query']['filter']){_0x158b42[_0xb36c('0x3e')]=_[_0xb36c('0x40')](_0x158b42[_0xb36c('0x3e')],{'$or':_[_0xb36c('0x32')](_0x158b42[_0xb36c('0x37')],function(_0x32ebce){var _0x2a0cdd={};_0x2a0cdd[_0x32ebce]={'$like':'%'+_0xd36905[_0xb36c('0x33')][_0xb36c('0x3f')]+'%'};return _0x2a0cdd;})});}_0x158b42=_[_0xb36c('0x40')]({},_0x158b42,_0xd36905[_0xb36c('0x42')]);return _0x43f328[_0xb36c('0x4e')](_0x158b42);}})[_0xb36c('0x27')](function(_0x5c5ee4){if(_0x5c5ee4){_0x13db53=_0x5c5ee4['length'];if(!_0xd36905[_0xb36c('0x33')][_0xb36c('0x3a')]('nolimit')){_0x158b42['limit']=qs[_0xb36c('0x20')](_0xd36905[_0xb36c('0x33')][_0xb36c('0x20')]);_0x158b42[_0xb36c('0x1e')]=qs[_0xb36c('0x1e')](_0xd36905['query'][_0xb36c('0x1e')]);}return _0x43f328[_0xb36c('0x4e')](_0x158b42);}})[_0xb36c('0x27')](function(_0x5e4a1d){if(_0x5e4a1d){return _0x5e4a1d?{'count':_0x13db53,'rows':_0x5e4a1d}:null;}})[_0xb36c('0x27')](respondWithResult(_0x24b2b1,null))[_0xb36c('0x46')](handleError(_0x24b2b1,null));};exports[_0xb36c('0x50')]=function(_0x32e22f,_0x7939e5,_0x3d7d91){if(_0x32e22f['body']['id']){delete _0x32e22f[_0xb36c('0x4c')]['id'];}return db[_0xb36c('0x2d')][_0xb36c('0x51')]({'where':{'id':_0x32e22f['params']['id']}})['then'](handleEntityNotFound(_0x7939e5,null))[_0xb36c('0x27')](function(_0x433ff3){if(_0x433ff3){_0x32e22f[_0xb36c('0x4c')]['AccountId']=_0x433ff3['id'];_0x32e22f[_0xb36c('0x4c')][_0xb36c('0x52')]=integrations[_0xb36c('0x53')](_0x32e22f[_0xb36c('0x4c')]['channel'],_0x32e22f['body']['type']);_0x32e22f[_0xb36c('0x4c')][_0xb36c('0x54')]=integrations['getDescriptions'](_0x32e22f[_0xb36c('0x4c')][_0xb36c('0x55')],_0x32e22f[_0xb36c('0x4c')][_0xb36c('0x30')]);return db['SalesforceConfiguration']['create'](_0x32e22f[_0xb36c('0x4c')],{'include':[{'model':db[_0xb36c('0x56')],'as':_0xb36c('0x52')},{'model':db['SalesforceField'],'as':'Descriptions'}]});}return null;})[_0xb36c('0x27')](respondWithResult(_0x7939e5,null))[_0xb36c('0x46')](handleError(_0x7939e5,null));};exports[_0xb36c('0x57')]=function(_0x3d4347,_0x536f09,_0x2229a3){var _0x18c7c7;var _0x4a2969='';var _0x4161f2=_0xb36c('0x58');return db[_0xb36c('0x2d')][_0xb36c('0x51')]({'where':{'id':_0x3d4347[_0xb36c('0x48')]['id']},'attributes':['id',_0xb36c('0x59'),_0xb36c('0x5a'),_0xb36c('0x5b'),_0xb36c('0x5c'),_0xb36c('0x5d'),'securityToken']})[_0xb36c('0x27')](handleEntityNotFound(_0x536f09,null))[_0xb36c('0x27')](function(_0x3832fd){if(_0x3832fd){_0x4a2969=_0x3832fd[_0xb36c('0x59')];var _0x294ce1=_0x4a2969[_0xb36c('0x5e')](-0x1);if(_0x294ce1==='/'){_0x4a2969=_0x4a2969[_0xb36c('0x5f')](0x0,_0x4a2969[_0xb36c('0x60')](_0x294ce1));}_0x18c7c7=new jsforce['Connection']({'oauth2':{'loginUrl':_0x4a2969,'clientId':_0x3832fd[_0xb36c('0x5a')],'clientSecret':_0x3832fd['clientSecret']}});return _0x18c7c7[_0xb36c('0x61')](_0x3832fd[_0xb36c('0x5c')],_0x3832fd[_0xb36c('0x5d')]['concat'](_0x3832fd[_0xb36c('0x62')]));}})[_0xb36c('0x27')](function(_0x21a39e){if(_0x21a39e){if(!_['isNil'](_0x3d4347[_0xb36c('0x33')][_0xb36c('0x63')])){_0x4161f2=_0x3d4347[_0xb36c('0x33')][_0xb36c('0x63')];}return _0x18c7c7[_0xb36c('0x64')](_0x4161f2)[_0xb36c('0x65')]();}})[_0xb36c('0x27')](function(_0x507e90){var _0x1806bf=[_0xb36c('0x66'),_0xb36c('0x67'),'IsReminderSet',_0xb36c('0x68'),_0xb36c('0x69'),'Description'];var _0x473572=[_0xb36c('0x6a'),_0xb36c('0x6b'),'picklist',_0xb36c('0x6c'),_0xb36c('0x6d'),'textarea',_0xb36c('0x6e')];if(_0x507e90){_[_0xb36c('0x6f')](_0x507e90[_0xb36c('0x38')],function(_0x57b76d){return _0x1806bf[_0xb36c('0x70')](_0x57b76d[_0xb36c('0x2b')])||!_0x473572['includes'](_0x57b76d['type']);});return{'count':_0x507e90[_0xb36c('0x38')][_0xb36c('0x39')],'rows':_[_0xb36c('0x32')](_0x507e90[_0xb36c('0x38')],function(_0x20b299){return{'id':_0x20b299[_0xb36c('0x2b')],'name':_0x20b299[_0xb36c('0x71')],'custom':_0x20b299[_0xb36c('0x72')],'options':_0x20b299[_0xb36c('0x73')][_0xb36c('0x39')]>0x0?_[_0xb36c('0x32')](_0x20b299[_0xb36c('0x73')],function(_0x2b0228){return{'name':_0x2b0228['label'],'value':_0x2b0228[_0xb36c('0x74')]};}):_0x20b299[_0xb36c('0x30')]=='boolean'?[{'name':'True','value':_0xb36c('0x75')},{'name':'False','value':_0xb36c('0x76')}]:[]};})};}})[_0xb36c('0x27')](respondWithResult(_0x536f09,null))[_0xb36c('0x46')](function(_0x1b75c6){var _0x339c04=_0x3d4347['query'][_0xb36c('0x77')]?0x1f4:_0x1b75c6[_0xb36c('0x78')]||0x1f4;logger[_0xb36c('0x79')](_0xb36c('0x7a'),'getFields',_0x339c04,JSON[_0xb36c('0x7b')](_0x1b75c6));delete _0x1b75c6['name'];if(_0x339c04===0x191){_0x339c04=0x190;}_0x536f09['status'](_0x339c04)['send'](_0x3d4347['query']['test']?{'message':_0xb36c('0x7c'),'statusCode':_0x1b75c6[_0xb36c('0x78')]}:_0x1b75c6);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 04f0749..d87a9a1 100644 --- a/server/api/intSalesforceAccount/intSalesforceAccount.model.js +++ b/server/api/intSalesforceAccount/intSalesforceAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf72b=['../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intSalesforceAccount.attributes'];(function(_0x4ffcc1,_0x48325a){var _0x485152=function(_0x1420e9){while(--_0x1420e9){_0x4ffcc1['push'](_0x4ffcc1['shift']());}};_0x485152(++_0x48325a);}(_0xf72b,0x1d9));var _0xbf72=function(_0x106be3,_0x4988fd){_0x106be3=_0x106be3-0x0;var _0x5e403d=_0xf72b[_0x106be3];return _0x5e403d;};'use strict';var _=require(_0xbf72('0x0'));var util=require('util');var logger=require(_0xbf72('0x1'))('api');var moment=require(_0xbf72('0x2'));var BPromise=require(_0xbf72('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbf72('0x4'));var rimraf=require(_0xbf72('0x5'));var config=require(_0xbf72('0x6'));var attributes=require(_0xbf72('0x7'));var integrations=require(_0xbf72('0x8'));module[_0xbf72('0x9')]=function(_0x5ee060,_0x41c11d){return _0x5ee060[_0xbf72('0xa')](_0xbf72('0xb'),attributes,{'tableName':_0xbf72('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x53f7=['../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x29cdf7,_0x5b8f4f){var _0x3aebdc=function(_0x2da318){while(--_0x2da318){_0x29cdf7['push'](_0x29cdf7['shift']());}};_0x3aebdc(++_0x5b8f4f);}(_0x53f7,0x12c));var _0x753f=function(_0x28beaf,_0x122959){_0x28beaf=_0x28beaf-0x0;var _0x2df201=_0x53f7[_0x28beaf];return _0x2df201;};'use strict';var _=require(_0x753f('0x0'));var util=require(_0x753f('0x1'));var logger=require(_0x753f('0x2'))(_0x753f('0x3'));var moment=require(_0x753f('0x4'));var BPromise=require(_0x753f('0x5'));var rp=require(_0x753f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x753f('0x7'));var config=require(_0x753f('0x8'));var attributes=require(_0x753f('0x9'));var integrations=require(_0x753f('0xa'));module[_0x753f('0xb')]=function(_0x2091e1,_0x3f51bd){return _0x2091e1[_0x753f('0xc')](_0x753f('0xd'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 7f1d7ef..88e09d8 100644 --- a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js +++ b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xead1=['stringify','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','where','include','map','attributes','model','then','debug','ShowSalesforceAccount','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s'];(function(_0x2fa52f,_0x3ba1d7){var _0x4baeec=function(_0x158e93){while(--_0x158e93){_0x2fa52f['push'](_0x2fa52f['shift']());}};_0x4baeec(++_0x3ba1d7);}(_0xead1,0x76));var _0x1ead=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xead1[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0x1ead('0x0'));var moment=require(_0x1ead('0x1'));var BPromise=require(_0x1ead('0x2'));var rs=require(_0x1ead('0x3'));var fs=require('fs');var Redis=require(_0x1ead('0x4'));var db=require(_0x1ead('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ead('0x6'))(_0x1ead('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1ead('0x8')][_0x1ead('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x133317,_0x32648d,_0x197645){return new BPromise(function(_0x331f3b,_0x31fa08){return client['request'](_0x133317,_0x197645)['then'](function(_0x34e114){logger[_0x1ead('0xa')](_0x1ead('0xb'),_0x32648d,_0x1ead('0xc'));logger['debug'](_0x1ead('0xd'),_0x32648d,_0x1ead('0xc'),JSON[_0x1ead('0xe')](_0x34e114));if(_0x34e114[_0x1ead('0xf')]){if(_0x34e114[_0x1ead('0xf')][_0x1ead('0x10')]===0x1f4){logger[_0x1ead('0xf')](_0x1ead('0xb'),_0x32648d,_0x34e114[_0x1ead('0xf')][_0x1ead('0x11')]);return _0x31fa08(_0x34e114['error']['message']);}logger['error'](_0x1ead('0xb'),_0x32648d,_0x34e114[_0x1ead('0xf')]['message']);return _0x331f3b(_0x34e114[_0x1ead('0xf')]['message']);}else{logger[_0x1ead('0xa')](_0x1ead('0xb'),_0x32648d,_0x1ead('0xc'));_0x331f3b(_0x34e114[_0x1ead('0x12')][_0x1ead('0x11')]);}})[_0x1ead('0x13')](function(_0x484789){logger[_0x1ead('0xf')]('SalesforceAccount,\x20%s,\x20%s',_0x32648d,_0x484789);_0x31fa08(_0x484789);});});}exports[_0x1ead('0x14')]=function(_0x3234f3){var _0x22593e=this;return new Promise(function(_0x51528f,_0x456aed){return db[_0x1ead('0x15')][_0x1ead('0x16')]({'raw':_0x3234f3[_0x1ead('0x17')]?_0x3234f3[_0x1ead('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3234f3[_0x1ead('0x17')]?_0x3234f3[_0x1ead('0x17')][_0x1ead('0x18')]||null:null,'attributes':_0x3234f3[_0x1ead('0x17')]?_0x3234f3[_0x1ead('0x17')]['attributes']||null:null,'limit':_0x3234f3[_0x1ead('0x17')]?_0x3234f3[_0x1ead('0x17')]['limit']||null:null,'include':_0x3234f3[_0x1ead('0x17')]?_0x3234f3['options'][_0x1ead('0x19')]?_[_0x1ead('0x1a')](_0x3234f3[_0x1ead('0x17')][_0x1ead('0x19')],function(_0x58ca8e){return{'model':db[_0x58ca8e['model']],'as':_0x58ca8e['as'],'attributes':_0x58ca8e[_0x1ead('0x1b')],'include':_0x58ca8e[_0x1ead('0x19')]?_[_0x1ead('0x1a')](_0x58ca8e[_0x1ead('0x19')],function(_0x585ee2){return{'model':db[_0x585ee2[_0x1ead('0x1c')]],'as':_0x585ee2['as'],'attributes':_0x585ee2[_0x1ead('0x1b')],'include':_0x585ee2['include']?_[_0x1ead('0x1a')](_0x585ee2[_0x1ead('0x19')],function(_0x49960e){return{'model':db[_0x49960e[_0x1ead('0x1c')]],'as':_0x49960e['as'],'attributes':_0x49960e[_0x1ead('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1ead('0x1d')](function(_0xf88741){logger[_0x1ead('0xa')]('GetSalesforceAccount',_0x3234f3);logger[_0x1ead('0x1e')]('GetSalesforceAccount',_0x3234f3,JSON['stringify'](_0xf88741));_0x51528f(_0xf88741);})[_0x1ead('0x13')](function(_0x1d1f43){logger[_0x1ead('0xf')](_0x1ead('0x14'),_0x1d1f43[_0x1ead('0x11')],_0x3234f3);_0x456aed(_0x22593e[_0x1ead('0xf')](0x1f4,_0x1d1f43['message']));});});};exports[_0x1ead('0x1f')]=function(_0x14543e){var _0x8984e0=this;return new Promise(function(_0x1a596b,_0x57b303){return db[_0x1ead('0x15')][_0x1ead('0x20')]({'raw':_0x14543e[_0x1ead('0x17')]?_0x14543e[_0x1ead('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x14543e[_0x1ead('0x17')]?_0x14543e[_0x1ead('0x17')]['where']||null:null,'attributes':_0x14543e[_0x1ead('0x17')]?_0x14543e[_0x1ead('0x17')][_0x1ead('0x1b')]||null:null,'include':_0x14543e[_0x1ead('0x17')]?_0x14543e[_0x1ead('0x17')]['include']?_[_0x1ead('0x1a')](_0x14543e[_0x1ead('0x17')][_0x1ead('0x19')],function(_0x12f1fe){return{'model':db[_0x12f1fe[_0x1ead('0x1c')]],'as':_0x12f1fe['as'],'attributes':_0x12f1fe[_0x1ead('0x1b')],'include':_0x12f1fe[_0x1ead('0x19')]?_[_0x1ead('0x1a')](_0x12f1fe[_0x1ead('0x19')],function(_0x4534e7){return{'model':db[_0x4534e7[_0x1ead('0x1c')]],'as':_0x4534e7['as'],'attributes':_0x4534e7[_0x1ead('0x1b')],'include':_0x4534e7['include']?_[_0x1ead('0x1a')](_0x4534e7['include'],function(_0x110668){return{'model':db[_0x110668['model']],'as':_0x110668['as'],'attributes':_0x110668[_0x1ead('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x593b5f){logger['info'](_0x1ead('0x1f'),_0x14543e);logger['debug'](_0x1ead('0x1f'),_0x14543e,JSON[_0x1ead('0xe')](_0x593b5f));_0x1a596b(_0x593b5f);})[_0x1ead('0x13')](function(_0xba9f25){logger[_0x1ead('0xf')](_0x1ead('0x1f'),_0xba9f25[_0x1ead('0x11')],_0x14543e);_0x57b303(_0x8984e0[_0x1ead('0xf')](0x1f4,_0xba9f25[_0x1ead('0x11')]));});});}; \ No newline at end of file +var _0x2d3e=['info','SalesforceAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','attributes','limit','map','include','model','ShowSalesforceAccount','find','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x532d86,_0x2067ff){var _0x152b27=function(_0xa9c796){while(--_0xa9c796){_0x532d86['push'](_0x532d86['shift']());}};_0x152b27(++_0x2067ff);}(_0x2d3e,0x1f2));var _0xe2d3=function(_0x292888,_0x203943){_0x292888=_0x292888-0x0;var _0x4b8ec3=_0x2d3e[_0x292888];return _0x4b8ec3;};'use strict';var _=require('lodash');var util=require(_0xe2d3('0x0'));var moment=require('moment');var BPromise=require(_0xe2d3('0x1'));var rs=require(_0xe2d3('0x2'));var fs=require('fs');var Redis=require(_0xe2d3('0x3'));var db=require(_0xe2d3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe2d3('0x5'))(_0xe2d3('0x6'));var config=require(_0xe2d3('0x7'));var jayson=require(_0xe2d3('0x8'));var client=jayson['client'][_0xe2d3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x333412,_0x6eeffc,_0xe8bd5b){return new BPromise(function(_0x3d6f66,_0x358721){return client[_0xe2d3('0xa')](_0x333412,_0xe8bd5b)[_0xe2d3('0xb')](function(_0x211771){logger[_0xe2d3('0xc')](_0xe2d3('0xd'),_0x6eeffc,'request\x20sent');logger[_0xe2d3('0xe')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x6eeffc,_0xe2d3('0xf'),JSON[_0xe2d3('0x10')](_0x211771));if(_0x211771['error']){if(_0x211771[_0xe2d3('0x11')]['code']===0x1f4){logger['error'](_0xe2d3('0xd'),_0x6eeffc,_0x211771['error'][_0xe2d3('0x12')]);return _0x358721(_0x211771[_0xe2d3('0x11')][_0xe2d3('0x12')]);}logger[_0xe2d3('0x11')](_0xe2d3('0xd'),_0x6eeffc,_0x211771[_0xe2d3('0x11')][_0xe2d3('0x12')]);return _0x3d6f66(_0x211771[_0xe2d3('0x11')][_0xe2d3('0x12')]);}else{logger[_0xe2d3('0xc')]('SalesforceAccount,\x20%s,\x20%s',_0x6eeffc,_0xe2d3('0xf'));_0x3d6f66(_0x211771[_0xe2d3('0x13')][_0xe2d3('0x12')]);}})['catch'](function(_0x53506d){logger[_0xe2d3('0x11')](_0xe2d3('0xd'),_0x6eeffc,_0x53506d);_0x358721(_0x53506d);});});}exports[_0xe2d3('0x14')]=function(_0x223df6){var _0x78c697=this;return new Promise(function(_0x2b6ed1,_0x1aa3f8){return db[_0xe2d3('0x15')][_0xe2d3('0x16')]({'raw':_0x223df6[_0xe2d3('0x17')]?_0x223df6[_0xe2d3('0x17')][_0xe2d3('0x18')]===undefined?!![]:![]:!![],'where':_0x223df6[_0xe2d3('0x17')]?_0x223df6[_0xe2d3('0x17')][_0xe2d3('0x19')]||null:null,'attributes':_0x223df6[_0xe2d3('0x17')]?_0x223df6[_0xe2d3('0x17')][_0xe2d3('0x1a')]||null:null,'limit':_0x223df6['options']?_0x223df6[_0xe2d3('0x17')][_0xe2d3('0x1b')]||null:null,'include':_0x223df6[_0xe2d3('0x17')]?_0x223df6[_0xe2d3('0x17')]['include']?_[_0xe2d3('0x1c')](_0x223df6['options'][_0xe2d3('0x1d')],function(_0x381b9d){return{'model':db[_0x381b9d[_0xe2d3('0x1e')]],'as':_0x381b9d['as'],'attributes':_0x381b9d[_0xe2d3('0x1a')],'include':_0x381b9d['include']?_[_0xe2d3('0x1c')](_0x381b9d[_0xe2d3('0x1d')],function(_0x8ba099){return{'model':db[_0x8ba099[_0xe2d3('0x1e')]],'as':_0x8ba099['as'],'attributes':_0x8ba099[_0xe2d3('0x1a')],'include':_0x8ba099[_0xe2d3('0x1d')]?_[_0xe2d3('0x1c')](_0x8ba099[_0xe2d3('0x1d')],function(_0x2e38bb){return{'model':db[_0x2e38bb['model']],'as':_0x2e38bb['as'],'attributes':_0x2e38bb[_0xe2d3('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe2d3('0xb')](function(_0x2247be){logger[_0xe2d3('0xc')](_0xe2d3('0x14'),_0x223df6);logger[_0xe2d3('0xe')]('GetSalesforceAccount',_0x223df6,JSON[_0xe2d3('0x10')](_0x2247be));_0x2b6ed1(_0x2247be);})['catch'](function(_0x25be76){logger[_0xe2d3('0x11')](_0xe2d3('0x14'),_0x25be76['message'],_0x223df6);_0x1aa3f8(_0x78c697[_0xe2d3('0x11')](0x1f4,_0x25be76['message']));});});};exports[_0xe2d3('0x1f')]=function(_0x52dce0){var _0x2f8dac=this;return new Promise(function(_0x2f55f9,_0x50905b){return db[_0xe2d3('0x15')][_0xe2d3('0x20')]({'raw':_0x52dce0[_0xe2d3('0x17')]?_0x52dce0[_0xe2d3('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x52dce0['options']?_0x52dce0[_0xe2d3('0x17')][_0xe2d3('0x19')]||null:null,'attributes':_0x52dce0[_0xe2d3('0x17')]?_0x52dce0['options'][_0xe2d3('0x1a')]||null:null,'include':_0x52dce0[_0xe2d3('0x17')]?_0x52dce0[_0xe2d3('0x17')][_0xe2d3('0x1d')]?_[_0xe2d3('0x1c')](_0x52dce0[_0xe2d3('0x17')]['include'],function(_0x499799){return{'model':db[_0x499799[_0xe2d3('0x1e')]],'as':_0x499799['as'],'attributes':_0x499799[_0xe2d3('0x1a')],'include':_0x499799[_0xe2d3('0x1d')]?_[_0xe2d3('0x1c')](_0x499799[_0xe2d3('0x1d')],function(_0xb903ef){return{'model':db[_0xb903ef[_0xe2d3('0x1e')]],'as':_0xb903ef['as'],'attributes':_0xb903ef[_0xe2d3('0x1a')],'include':_0xb903ef[_0xe2d3('0x1d')]?_[_0xe2d3('0x1c')](_0xb903ef['include'],function(_0xce786c){return{'model':db[_0xce786c[_0xe2d3('0x1e')]],'as':_0xce786c['as'],'attributes':_0xce786c['attributes']};}):[]};}):[]};}):[]:[]})[_0xe2d3('0xb')](function(_0x20b6d5){logger[_0xe2d3('0xc')](_0xe2d3('0x1f'),_0x52dce0);logger['debug'](_0xe2d3('0x1f'),_0x52dce0,JSON['stringify'](_0x20b6d5));_0x2f55f9(_0x20b6d5);})[_0xe2d3('0x21')](function(_0x1612cc){logger[_0xe2d3('0x11')](_0xe2d3('0x1f'),_0x1612cc[_0xe2d3('0x12')],_0x52dce0);_0x50905b(_0x2f8dac[_0xe2d3('0x11')](0x1f4,_0x1612cc[_0xe2d3('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index bead098..db93676 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['Router','fs-extra','../../components/auth/service','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x34b571,_0x3db6ca){var _0x5a93b9=function(_0x583651){while(--_0x583651){_0x34b571['push'](_0x34b571['shift']());}};_0x5a93b9(++_0x3db6ca);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4b99e9,_0x3d805f){_0x4b99e9=_0x4b99e9-0x0;var _0x15f2f9=_0x5f2f[_0x4b99e9];return _0x15f2f9;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x9')](_0xf5f2('0x10'),auth['isAuthenticated'](),controller[_0xf5f2('0x11')]);router['get']('/:id/descriptions',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x12')]);router['post']('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x13')]);router[_0xf5f2('0x14')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x15')]);router['delete'](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x16')]);module[_0xf5f2('0x17')]=router; \ No newline at end of file +var _0x0b0e=['post','create','put','/:id','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions'];(function(_0x102ff9,_0x907658){var _0x24fa97=function(_0x3622ff){while(--_0x3622ff){_0x102ff9['push'](_0x102ff9['shift']());}};_0x24fa97(++_0x907658);}(_0x0b0e,0x187));var _0xe0b0=function(_0x51639a,_0x35f006){_0x51639a=_0x51639a-0x0;var _0x3abae4=_0x0b0e[_0x51639a];return _0x3abae4;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['getFields']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/descriptions',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')]('/',auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x13')](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x15')]);router['delete'](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x16')]);module[_0xe0b0('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 33375a3..0f8a825 100644 --- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js +++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x878c=['lead','account_contact_lead','account','nothing','contact','sequelize','STRING','ENUM','Task','Case','contact_lead'];(function(_0x16e905,_0x31eb17){var _0x53cb0f=function(_0x57e0ac){while(--_0x57e0ac){_0x16e905['push'](_0x16e905['shift']());}};_0x53cb0f(++_0x31eb17);}(_0x878c,0x1de));var _0xc878=function(_0x4d5f37,_0x431410){_0x4d5f37=_0x4d5f37-0x0;var _0x5ef460=_0x878c[_0x4d5f37];return _0x5ef460;};'use strict';var Sequelize=require(_0xc878('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc878('0x1')]},'ticketType':{'type':Sequelize[_0xc878('0x2')](_0xc878('0x3'),_0xc878('0x4')),'defaultValue':_0xc878('0x3')},'moduleSearch':{'type':Sequelize['ENUM'](_0xc878('0x5'),'contact',_0xc878('0x6'),_0xc878('0x7'),_0xc878('0x8')),'defaultValue':_0xc878('0x5')},'moduleCreate':{'type':Sequelize[_0xc878('0x2')](_0xc878('0x9'),_0xc878('0xa'),'lead',_0xc878('0x8')),'defaultValue':_0xc878('0x6')},'leadId':{'type':Sequelize[_0xc878('0x1')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0xc878('0x1')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3743=['nothing','contact','sequelize','STRING','ENUM','Case','lead','account_contact_lead','contact_lead'];(function(_0x5a9376,_0x493a80){var _0x442932=function(_0x51b7d5){while(--_0x51b7d5){_0x5a9376['push'](_0x5a9376['shift']());}};_0x442932(++_0x493a80);}(_0x3743,0xd1));var _0x3374=function(_0x2ca616,_0x384ec8){_0x2ca616=_0x2ca616-0x0;var _0x53155f=_0x3743[_0x2ca616];return _0x53155f;};'use strict';var Sequelize=require(_0x3374('0x0'));module['exports']={'name':{'type':Sequelize[_0x3374('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x3374('0x2')]('Task',_0x3374('0x3')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead','contact',_0x3374('0x4'),_0x3374('0x5'),'account'),'defaultValue':_0x3374('0x6')},'moduleCreate':{'type':Sequelize['ENUM'](_0x3374('0x7'),_0x3374('0x8'),_0x3374('0x4'),'account'),'defaultValue':_0x3374('0x4')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0x3374('0x1')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x3374('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 83a8d9d..ddd486b 100644 --- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js +++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7881=['fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','SalesforceConfiguration','include','findAll','rows','show','includeAll','options','find','catch','create','body','params','getFields','order','getSubjects','findOne','SalesforceField','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','save','then','error','stack','name','send','index','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes'];(function(_0x55e2a9,_0x5aabcb){var _0x1e52b8=function(_0xe89e57){while(--_0xe89e57){_0x55e2a9['push'](_0x55e2a9['shift']());}};_0x1e52b8(++_0x5aabcb);}(_0x7881,0x69));var _0x1788=function(_0x30f62d,_0x3c3147){_0x30f62d=_0x30f62d-0x0;var _0x4fb27a=_0x7881[_0x30f62d];return _0x4fb27a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1788('0x0'));var zipdir=require(_0x1788('0x1'));var jsonpatch=require(_0x1788('0x2'));var rp=require(_0x1788('0x3'));var moment=require(_0x1788('0x4'));var BPromise=require(_0x1788('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x1788('0x6'));var ejs=require(_0x1788('0x7'));var fs=require('fs');var fs_extra=require(_0x1788('0x8'));var _=require('lodash');var squel=require(_0x1788('0x9'));var crypto=require(_0x1788('0xa'));var jsforce=require(_0x1788('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1788('0x6'));var querystring=require(_0x1788('0xc'));var Papa=require(_0x1788('0xd'));var Redis=require(_0x1788('0xe'));var authService=require(_0x1788('0xf'));var qs=require(_0x1788('0x10'));var as=require(_0x1788('0x11'));var hardwareService=require(_0x1788('0x12'));var logger=require('../../config/logger')(_0x1788('0x13'));var utils=require(_0x1788('0x14'));var config=require(_0x1788('0x15'));var licenseUtil=require(_0x1788('0x16'));var db=require(_0x1788('0x17'))['db'];function respondWithStatusCode(_0x475d40,_0x2d0122){_0x2d0122=_0x2d0122||0xcc;return function(_0x1da9bf){if(_0x1da9bf){return _0x475d40[_0x1788('0x18')](_0x2d0122);}return _0x475d40[_0x1788('0x19')](_0x2d0122)[_0x1788('0x1a')]();};}function respondWithResult(_0x91a4b1,_0x60252e){_0x60252e=_0x60252e||0xc8;return function(_0x458a26){if(_0x458a26){return _0x91a4b1[_0x1788('0x19')](_0x60252e)[_0x1788('0x1b')](_0x458a26);}};}function respondWithFilteredResult(_0x857d75,_0x8b01f5){return function(_0x148554){if(_0x148554){var _0x10a87e=typeof _0x8b01f5[_0x1788('0x1c')]==='undefined'&&typeof _0x8b01f5[_0x1788('0x1d')]===_0x1788('0x1e');var _0x3e4a99=_0x148554['count'];var _0x177448=_0x10a87e?0x0:_0x8b01f5[_0x1788('0x1c')];var _0x38b00f=_0x10a87e?_0x148554[_0x1788('0x1f')]:_0x8b01f5[_0x1788('0x1c')]+_0x8b01f5[_0x1788('0x1d')];var _0x1d3b40;if(_0x38b00f>=_0x3e4a99){_0x38b00f=_0x3e4a99;_0x1d3b40=0xc8;}else{_0x1d3b40=0xce;}_0x857d75[_0x1788('0x19')](_0x1d3b40);return _0x857d75['set']('Content-Range',_0x177448+'-'+_0x38b00f+'/'+_0x3e4a99)['json'](_0x148554);}return null;};}function patchUpdates(_0x239beb){return function(_0x3ac73b){try{jsonpatch['apply'](_0x3ac73b,_0x239beb,!![]);}catch(_0x402c8a){return BPromise['reject'](_0x402c8a);}return _0x3ac73b[_0x1788('0x20')]();};}function saveUpdates(_0x1f89b1,_0x17abd){return function(_0x46ea39){if(_0x46ea39){return _0x46ea39['update'](_0x1f89b1)['then'](function(_0x391b96){return _0x391b96;});}return null;};}function removeEntity(_0x4ca62d,_0x36dc2f){return function(_0x210621){if(_0x210621){return _0x210621['destroy']()[_0x1788('0x21')](function(){_0x4ca62d[_0x1788('0x19')](0xcc)[_0x1788('0x1a')]();});}};}function handleEntityNotFound(_0x2a9143,_0x95dd09){return function(_0x11ef1f){if(!_0x11ef1f){_0x2a9143[_0x1788('0x18')](0x194);}return _0x11ef1f;};}function handleError(_0x47ee99,_0xfe08ed){_0xfe08ed=_0xfe08ed||0x1f4;return function(_0x291681){logger[_0x1788('0x22')](_0x291681[_0x1788('0x23')]);if(_0x291681[_0x1788('0x24')]){delete _0x291681[_0x1788('0x24')];}_0x47ee99[_0x1788('0x19')](_0xfe08ed)[_0x1788('0x25')](_0x291681);};}exports[_0x1788('0x26')]=function(_0x26b21a,_0x11d9d0){var _0x47b6dd={},_0x585686={},_0x391f06={'count':0x0,'rows':[]};var _0x5d1743=_['map'](db['SalesforceConfiguration'][_0x1788('0x27')],function(_0x235b9e){return{'name':_0x235b9e['fieldName'],'type':_0x235b9e[_0x1788('0x28')][_0x1788('0x29')]};});_0x585686[_0x1788('0x2a')]=_[_0x1788('0x2b')](_0x5d1743,'name');_0x585686[_0x1788('0x2c')]=_[_0x1788('0x2d')](_0x26b21a[_0x1788('0x2c')]);_0x585686[_0x1788('0x2e')]=_[_0x1788('0x2f')](_0x585686['model'],_0x585686[_0x1788('0x2c')]);_0x47b6dd[_0x1788('0x30')]=_[_0x1788('0x2f')](_0x585686[_0x1788('0x2a')],qs[_0x1788('0x31')](_0x26b21a[_0x1788('0x2c')][_0x1788('0x31')]));_0x47b6dd['attributes']=_0x47b6dd[_0x1788('0x30')][_0x1788('0x32')]?_0x47b6dd[_0x1788('0x30')]:_0x585686['model'];if(!_0x26b21a[_0x1788('0x2c')][_0x1788('0x33')](_0x1788('0x34'))){_0x47b6dd[_0x1788('0x1d')]=qs[_0x1788('0x1d')](_0x26b21a[_0x1788('0x2c')][_0x1788('0x1d')]);_0x47b6dd[_0x1788('0x1c')]=qs['offset'](_0x26b21a['query'][_0x1788('0x1c')]);}_0x47b6dd['order']=qs['sort'](_0x26b21a[_0x1788('0x2c')][_0x1788('0x35')]);_0x47b6dd[_0x1788('0x36')]=qs[_0x1788('0x2e')](_[_0x1788('0x37')](_0x26b21a[_0x1788('0x2c')],_0x585686[_0x1788('0x2e')]),_0x5d1743);if(_0x26b21a['query'][_0x1788('0x38')]){_0x47b6dd[_0x1788('0x36')]=_['merge'](_0x47b6dd[_0x1788('0x36')],{'$or':_[_0x1788('0x2b')](_0x5d1743,function(_0x3299fc){if(_0x3299fc['type']!==_0x1788('0x39')){var _0x35d04c={};_0x35d04c[_0x3299fc[_0x1788('0x24')]]={'$like':'%'+_0x26b21a[_0x1788('0x2c')][_0x1788('0x38')]+'%'};return _0x35d04c;}})});}_0x47b6dd=_[_0x1788('0x3a')]({},_0x47b6dd,_0x26b21a['options']);var _0x155f3e={'where':_0x47b6dd['where']};return db[_0x1788('0x3b')][_0x1788('0x1f')](_0x155f3e)[_0x1788('0x21')](function(_0xe46f1f){_0x391f06[_0x1788('0x1f')]=_0xe46f1f;if(_0x26b21a[_0x1788('0x2c')]['includeAll']){_0x47b6dd[_0x1788('0x3c')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x1788('0x3d')](_0x47b6dd);})[_0x1788('0x21')](function(_0x196f9e){_0x391f06[_0x1788('0x3e')]=_0x196f9e;return _0x391f06;})[_0x1788('0x21')](respondWithFilteredResult(_0x11d9d0,_0x47b6dd))['catch'](handleError(_0x11d9d0,null));};exports[_0x1788('0x3f')]=function(_0x1b08f6,_0x292e7e){var _0x467155={'raw':![],'where':{'id':_0x1b08f6['params']['id']}},_0x1276e2={};_0x1276e2[_0x1788('0x2a')]=_['keys'](db[_0x1788('0x3b')]['rawAttributes']);_0x1276e2[_0x1788('0x2c')]=_[_0x1788('0x2d')](_0x1b08f6['query']);_0x1276e2[_0x1788('0x2e')]=_[_0x1788('0x2f')](_0x1276e2[_0x1788('0x2a')],_0x1276e2[_0x1788('0x2c')]);_0x467155[_0x1788('0x30')]=_[_0x1788('0x2f')](_0x1276e2['model'],qs[_0x1788('0x31')](_0x1b08f6[_0x1788('0x2c')][_0x1788('0x31')]));_0x467155['attributes']=_0x467155[_0x1788('0x30')][_0x1788('0x32')]?_0x467155[_0x1788('0x30')]:_0x1276e2['model'];if(_0x1b08f6[_0x1788('0x2c')][_0x1788('0x40')]){_0x467155['include']=[{'all':!![]}];}_0x467155=_['merge']({},_0x467155,_0x1b08f6[_0x1788('0x41')]);return db['SalesforceConfiguration'][_0x1788('0x42')](_0x467155)[_0x1788('0x21')](handleEntityNotFound(_0x292e7e,null))[_0x1788('0x21')](respondWithResult(_0x292e7e,null))[_0x1788('0x43')](handleError(_0x292e7e,null));};exports[_0x1788('0x44')]=function(_0x5e1d31,_0x2e38f4){return db[_0x1788('0x3b')]['create'](_0x5e1d31[_0x1788('0x45')],{})[_0x1788('0x21')](respondWithResult(_0x2e38f4,0xc9))['catch'](handleError(_0x2e38f4,null));};exports['update']=function(_0x4229d0,_0x3b273c){if(_0x4229d0[_0x1788('0x45')]['id']){delete _0x4229d0[_0x1788('0x45')]['id'];}return db[_0x1788('0x3b')][_0x1788('0x42')]({'where':{'id':_0x4229d0[_0x1788('0x46')]['id']}})[_0x1788('0x21')](handleEntityNotFound(_0x3b273c,null))[_0x1788('0x21')](saveUpdates(_0x4229d0['body'],null))['then'](respondWithResult(_0x3b273c,null))['catch'](handleError(_0x3b273c,null));};exports['destroy']=function(_0x273072,_0x5a28cc){return db[_0x1788('0x3b')][_0x1788('0x42')]({'where':{'id':_0x273072['params']['id']}})[_0x1788('0x21')](handleEntityNotFound(_0x5a28cc,null))[_0x1788('0x21')](removeEntity(_0x5a28cc,null))['catch'](handleError(_0x5a28cc,null));};exports[_0x1788('0x47')]=function(_0x41ab59,_0x256d87,_0x2ab260){var _0x3bbba4={};var _0x531e5c={};var _0x56fcd3;var _0x3609fd;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x41ab59[_0x1788('0x46')]['id']}})[_0x1788('0x21')](handleEntityNotFound(_0x256d87,null))['then'](function(_0x19dc6f){if(_0x19dc6f){_0x56fcd3=_0x19dc6f;_0x531e5c['model']=_[_0x1788('0x2d')](db['SalesforceField'][_0x1788('0x27')]);_0x531e5c['query']=_[_0x1788('0x2d')](_0x41ab59[_0x1788('0x2c')]);_0x531e5c[_0x1788('0x2e')]=_[_0x1788('0x2f')](_0x531e5c[_0x1788('0x2a')],_0x531e5c['query']);_0x3bbba4[_0x1788('0x30')]=_[_0x1788('0x2f')](_0x531e5c[_0x1788('0x2a')],qs[_0x1788('0x31')](_0x41ab59['query'][_0x1788('0x31')]));_0x3bbba4[_0x1788('0x30')]=_0x3bbba4[_0x1788('0x30')][_0x1788('0x32')]?_0x3bbba4[_0x1788('0x30')]:_0x531e5c[_0x1788('0x2a')];_0x3bbba4[_0x1788('0x48')]=qs[_0x1788('0x35')](_0x41ab59[_0x1788('0x2c')][_0x1788('0x35')]);_0x3bbba4[_0x1788('0x36')]=qs[_0x1788('0x2e')](_[_0x1788('0x37')](_0x41ab59['query'],_0x531e5c['filters']));if(_0x41ab59[_0x1788('0x2c')][_0x1788('0x38')]){_0x3bbba4['where']=_['merge'](_0x3bbba4['where'],{'$or':_['map'](_0x3bbba4[_0x1788('0x30')],function(_0x40c356){var _0x5014f3={};_0x5014f3[_0x40c356]={'$like':'%'+_0x41ab59['query'][_0x1788('0x38')]+'%'};return _0x5014f3;})});}_0x3bbba4=_[_0x1788('0x3a')]({},_0x3bbba4,_0x41ab59[_0x1788('0x41')]);return _0x56fcd3[_0x1788('0x47')](_0x3bbba4);}})[_0x1788('0x21')](function(_0x5d9cf6){if(_0x5d9cf6){_0x3609fd=_0x5d9cf6[_0x1788('0x32')];if(!_0x41ab59[_0x1788('0x2c')][_0x1788('0x33')]('nolimit')){_0x3bbba4['limit']=qs['limit'](_0x41ab59[_0x1788('0x2c')][_0x1788('0x1d')]);_0x3bbba4[_0x1788('0x1c')]=qs[_0x1788('0x1c')](_0x41ab59['query'][_0x1788('0x1c')]);}return _0x56fcd3['getFields'](_0x3bbba4);}})[_0x1788('0x21')](function(_0x18705b){if(_0x18705b){return _0x18705b?{'count':_0x3609fd,'rows':_0x18705b}:null;}})[_0x1788('0x21')](respondWithResult(_0x256d87,null))['catch'](handleError(_0x256d87,null));};exports[_0x1788('0x49')]=function(_0x418d65,_0xb77ab8,_0x4a8a6d){var _0x41f2d6={};var _0x34de43={};var _0x4240b2;var _0x1fca8a;return db[_0x1788('0x3b')][_0x1788('0x4a')]({'where':{'id':_0x418d65[_0x1788('0x46')]['id']}})[_0x1788('0x21')](handleEntityNotFound(_0xb77ab8,null))[_0x1788('0x21')](function(_0x588d12){if(_0x588d12){_0x4240b2=_0x588d12;_0x34de43[_0x1788('0x2a')]=_['keys'](db[_0x1788('0x4b')][_0x1788('0x27')]);_0x34de43['query']=_[_0x1788('0x2d')](_0x418d65[_0x1788('0x2c')]);_0x34de43[_0x1788('0x2e')]=_[_0x1788('0x2f')](_0x34de43[_0x1788('0x2a')],_0x34de43['query']);_0x41f2d6[_0x1788('0x30')]=_[_0x1788('0x2f')](_0x34de43[_0x1788('0x2a')],qs[_0x1788('0x31')](_0x418d65[_0x1788('0x2c')][_0x1788('0x31')]));_0x41f2d6[_0x1788('0x30')]=_0x41f2d6[_0x1788('0x30')][_0x1788('0x32')]?_0x41f2d6['attributes']:_0x34de43['model'];_0x41f2d6['order']=qs['sort'](_0x418d65[_0x1788('0x2c')][_0x1788('0x35')]);_0x41f2d6[_0x1788('0x36')]=qs[_0x1788('0x2e')](_[_0x1788('0x37')](_0x418d65[_0x1788('0x2c')],_0x34de43['filters']));if(_0x418d65[_0x1788('0x2c')][_0x1788('0x38')]){_0x41f2d6[_0x1788('0x36')]=_['merge'](_0x41f2d6[_0x1788('0x36')],{'$or':_['map'](_0x41f2d6[_0x1788('0x30')],function(_0x5d196d){var _0x88c527={};_0x88c527[_0x5d196d]={'$like':'%'+_0x418d65[_0x1788('0x2c')]['filter']+'%'};return _0x88c527;})});}_0x41f2d6=_[_0x1788('0x3a')]({},_0x41f2d6,_0x418d65[_0x1788('0x41')]);return _0x4240b2['getSubjects'](_0x41f2d6);}})[_0x1788('0x21')](function(_0x664db6){if(_0x664db6){_0x1fca8a=_0x664db6['length'];if(!_0x418d65[_0x1788('0x2c')][_0x1788('0x33')](_0x1788('0x34'))){_0x41f2d6['limit']=qs['limit'](_0x418d65[_0x1788('0x2c')][_0x1788('0x1d')]);_0x41f2d6[_0x1788('0x1c')]=qs[_0x1788('0x1c')](_0x418d65['query'][_0x1788('0x1c')]);}return _0x4240b2['getSubjects'](_0x41f2d6);}})['then'](function(_0x211310){if(_0x211310){return _0x211310?{'count':_0x1fca8a,'rows':_0x211310}:null;}})[_0x1788('0x21')](respondWithResult(_0xb77ab8,null))[_0x1788('0x43')](handleError(_0xb77ab8,null));};exports[_0x1788('0x4c')]=function(_0x4a375a,_0x58d214,_0x1edfaa){var _0xf149dd={};var _0x8d0ca0={};var _0x230803;var _0x5db0fa;return db[_0x1788('0x3b')]['findOne']({'where':{'id':_0x4a375a['params']['id']}})['then'](handleEntityNotFound(_0x58d214,null))['then'](function(_0x12a050){if(_0x12a050){_0x230803=_0x12a050;_0x8d0ca0['model']=_[_0x1788('0x2d')](db[_0x1788('0x4b')]['rawAttributes']);_0x8d0ca0[_0x1788('0x2c')]=_[_0x1788('0x2d')](_0x4a375a[_0x1788('0x2c')]);_0x8d0ca0[_0x1788('0x2e')]=_[_0x1788('0x2f')](_0x8d0ca0['model'],_0x8d0ca0[_0x1788('0x2c')]);_0xf149dd[_0x1788('0x30')]=_['intersection'](_0x8d0ca0[_0x1788('0x2a')],qs[_0x1788('0x31')](_0x4a375a['query']['fields']));_0xf149dd[_0x1788('0x30')]=_0xf149dd['attributes'][_0x1788('0x32')]?_0xf149dd[_0x1788('0x30')]:_0x8d0ca0[_0x1788('0x2a')];_0xf149dd[_0x1788('0x48')]=qs[_0x1788('0x35')](_0x4a375a[_0x1788('0x2c')]['sort']);_0xf149dd[_0x1788('0x36')]=qs[_0x1788('0x2e')](_[_0x1788('0x37')](_0x4a375a[_0x1788('0x2c')],_0x8d0ca0[_0x1788('0x2e')]));if(_0x4a375a['query'][_0x1788('0x38')]){_0xf149dd[_0x1788('0x36')]=_[_0x1788('0x3a')](_0xf149dd['where'],{'$or':_[_0x1788('0x2b')](_0xf149dd[_0x1788('0x30')],function(_0x4e18af){var _0x35fea0={};_0x35fea0[_0x4e18af]={'$like':'%'+_0x4a375a[_0x1788('0x2c')][_0x1788('0x38')]+'%'};return _0x35fea0;})});}_0xf149dd=_[_0x1788('0x3a')]({},_0xf149dd,_0x4a375a[_0x1788('0x41')]);return _0x230803[_0x1788('0x4c')](_0xf149dd);}})['then'](function(_0x157bb5){if(_0x157bb5){_0x5db0fa=_0x157bb5[_0x1788('0x32')];if(!_0x4a375a[_0x1788('0x2c')]['hasOwnProperty']('nolimit')){_0xf149dd['limit']=qs[_0x1788('0x1d')](_0x4a375a[_0x1788('0x2c')]['limit']);_0xf149dd['offset']=qs[_0x1788('0x1c')](_0x4a375a[_0x1788('0x2c')][_0x1788('0x1c')]);}return _0x230803[_0x1788('0x4c')](_0xf149dd);}})['then'](function(_0x106723){if(_0x106723){return _0x106723?{'count':_0x5db0fa,'rows':_0x106723}:null;}})['then'](respondWithResult(_0x58d214,null))[_0x1788('0x43')](handleError(_0x58d214,null));}; \ No newline at end of file +var _0x5643=['offset','undefined','limit','set','Content-Range','json','apply','reject','save','then','destroy','end','error','name','send','index','map','SalesforceConfiguration','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','pick','filter','where','VIRTUAL','merge','count','include','findAll','rows','catch','options','find','create','body','update','params','SalesforceField','getFields','getSubjects','findOne','sort','getDescriptions','nolimit','moment','bluebird','mustache','util','sox','to-csv','fs-extra','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x5643,0x162));var _0x3564=function(_0x203b99,_0x1a7413){_0x203b99=_0x203b99-0x0;var _0x11d66d=_0x5643[_0x203b99];return _0x11d66d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3564('0x0'));var BPromise=require(_0x3564('0x1'));var Mustache=require(_0x3564('0x2'));var util=require(_0x3564('0x3'));var path=require('path');var sox=require(_0x3564('0x4'));var csv=require(_0x3564('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3564('0x6'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3564('0x7'));var jsforce=require(_0x3564('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3564('0x9'));var Papa=require('papaparse');var Redis=require(_0x3564('0xa'));var authService=require(_0x3564('0xb'));var qs=require(_0x3564('0xc'));var as=require(_0x3564('0xd'));var hardwareService=require(_0x3564('0xe'));var logger=require(_0x3564('0xf'))('api');var utils=require('../../config/utils');var config=require(_0x3564('0x10'));var licenseUtil=require(_0x3564('0x11'));var db=require(_0x3564('0x12'))['db'];function respondWithStatusCode(_0x37cc94,_0x1c8a7a){_0x1c8a7a=_0x1c8a7a||0xcc;return function(_0x37e721){if(_0x37e721){return _0x37cc94[_0x3564('0x13')](_0x1c8a7a);}return _0x37cc94[_0x3564('0x14')](_0x1c8a7a)['end']();};}function respondWithResult(_0x6e5003,_0x22d38d){_0x22d38d=_0x22d38d||0xc8;return function(_0x47103d){if(_0x47103d){return _0x6e5003[_0x3564('0x14')](_0x22d38d)['json'](_0x47103d);}};}function respondWithFilteredResult(_0x336686,_0x4f77f3){return function(_0x40bb71){if(_0x40bb71){var _0x365250=typeof _0x4f77f3[_0x3564('0x15')]===_0x3564('0x16')&&typeof _0x4f77f3['limit']===_0x3564('0x16');var _0x445a9e=_0x40bb71['count'];var _0xf7cb97=_0x365250?0x0:_0x4f77f3[_0x3564('0x15')];var _0xf5818d=_0x365250?_0x40bb71['count']:_0x4f77f3[_0x3564('0x15')]+_0x4f77f3[_0x3564('0x17')];var _0x1d26ea;if(_0xf5818d>=_0x445a9e){_0xf5818d=_0x445a9e;_0x1d26ea=0xc8;}else{_0x1d26ea=0xce;}_0x336686[_0x3564('0x14')](_0x1d26ea);return _0x336686[_0x3564('0x18')](_0x3564('0x19'),_0xf7cb97+'-'+_0xf5818d+'/'+_0x445a9e)[_0x3564('0x1a')](_0x40bb71);}return null;};}function patchUpdates(_0x585d44){return function(_0x1b75ee){try{jsonpatch[_0x3564('0x1b')](_0x1b75ee,_0x585d44,!![]);}catch(_0x209117){return BPromise[_0x3564('0x1c')](_0x209117);}return _0x1b75ee[_0x3564('0x1d')]();};}function saveUpdates(_0x43186c,_0x264b9b){return function(_0x3695f4){if(_0x3695f4){return _0x3695f4['update'](_0x43186c)[_0x3564('0x1e')](function(_0x1a0e5f){return _0x1a0e5f;});}return null;};}function removeEntity(_0x410fc3,_0x235682){return function(_0x17309a){if(_0x17309a){return _0x17309a[_0x3564('0x1f')]()[_0x3564('0x1e')](function(){_0x410fc3[_0x3564('0x14')](0xcc)[_0x3564('0x20')]();});}};}function handleEntityNotFound(_0x3faccb,_0xdaebae){return function(_0x30dd2f){if(!_0x30dd2f){_0x3faccb[_0x3564('0x13')](0x194);}return _0x30dd2f;};}function handleError(_0x472f10,_0x33b46c){_0x33b46c=_0x33b46c||0x1f4;return function(_0x11fb12){logger[_0x3564('0x21')](_0x11fb12['stack']);if(_0x11fb12[_0x3564('0x22')]){delete _0x11fb12[_0x3564('0x22')];}_0x472f10[_0x3564('0x14')](_0x33b46c)[_0x3564('0x23')](_0x11fb12);};}exports[_0x3564('0x24')]=function(_0x4503bd,_0x2d37cf){var _0xfd8b2f={},_0x3e532e={},_0x5ed07f={'count':0x0,'rows':[]};var _0x2d75de=_[_0x3564('0x25')](db[_0x3564('0x26')][_0x3564('0x27')],function(_0x456e80){return{'name':_0x456e80['fieldName'],'type':_0x456e80[_0x3564('0x28')][_0x3564('0x29')]};});_0x3e532e[_0x3564('0x2a')]=_[_0x3564('0x25')](_0x2d75de,_0x3564('0x22'));_0x3e532e['query']=_[_0x3564('0x2b')](_0x4503bd[_0x3564('0x2c')]);_0x3e532e[_0x3564('0x2d')]=_[_0x3564('0x2e')](_0x3e532e[_0x3564('0x2a')],_0x3e532e[_0x3564('0x2c')]);_0xfd8b2f['attributes']=_[_0x3564('0x2e')](_0x3e532e[_0x3564('0x2a')],qs[_0x3564('0x2f')](_0x4503bd[_0x3564('0x2c')]['fields']));_0xfd8b2f[_0x3564('0x30')]=_0xfd8b2f[_0x3564('0x30')][_0x3564('0x31')]?_0xfd8b2f[_0x3564('0x30')]:_0x3e532e[_0x3564('0x2a')];if(!_0x4503bd[_0x3564('0x2c')][_0x3564('0x32')]('nolimit')){_0xfd8b2f[_0x3564('0x17')]=qs[_0x3564('0x17')](_0x4503bd[_0x3564('0x2c')]['limit']);_0xfd8b2f[_0x3564('0x15')]=qs[_0x3564('0x15')](_0x4503bd['query'][_0x3564('0x15')]);}_0xfd8b2f[_0x3564('0x33')]=qs['sort'](_0x4503bd[_0x3564('0x2c')]['sort']);_0xfd8b2f['where']=qs['filters'](_[_0x3564('0x34')](_0x4503bd[_0x3564('0x2c')],_0x3e532e[_0x3564('0x2d')]),_0x2d75de);if(_0x4503bd['query'][_0x3564('0x35')]){_0xfd8b2f[_0x3564('0x36')]=_['merge'](_0xfd8b2f[_0x3564('0x36')],{'$or':_[_0x3564('0x25')](_0x2d75de,function(_0x20b0bd){if(_0x20b0bd[_0x3564('0x28')]!==_0x3564('0x37')){var _0xf74e80={};_0xf74e80[_0x20b0bd[_0x3564('0x22')]]={'$like':'%'+_0x4503bd[_0x3564('0x2c')][_0x3564('0x35')]+'%'};return _0xf74e80;}})});}_0xfd8b2f=_[_0x3564('0x38')]({},_0xfd8b2f,_0x4503bd['options']);var _0x128565={'where':_0xfd8b2f[_0x3564('0x36')]};return db[_0x3564('0x26')][_0x3564('0x39')](_0x128565)[_0x3564('0x1e')](function(_0x179f66){_0x5ed07f['count']=_0x179f66;if(_0x4503bd[_0x3564('0x2c')]['includeAll']){_0xfd8b2f[_0x3564('0x3a')]=[{'all':!![]}];}return db[_0x3564('0x26')][_0x3564('0x3b')](_0xfd8b2f);})['then'](function(_0x58a5e1){_0x5ed07f[_0x3564('0x3c')]=_0x58a5e1;return _0x5ed07f;})[_0x3564('0x1e')](respondWithFilteredResult(_0x2d37cf,_0xfd8b2f))[_0x3564('0x3d')](handleError(_0x2d37cf,null));};exports['show']=function(_0x1987e8,_0x523eb0){var _0x21e33f={'raw':![],'where':{'id':_0x1987e8['params']['id']}},_0x58c681={};_0x58c681['model']=_[_0x3564('0x2b')](db[_0x3564('0x26')][_0x3564('0x27')]);_0x58c681[_0x3564('0x2c')]=_[_0x3564('0x2b')](_0x1987e8[_0x3564('0x2c')]);_0x58c681[_0x3564('0x2d')]=_[_0x3564('0x2e')](_0x58c681['model'],_0x58c681['query']);_0x21e33f[_0x3564('0x30')]=_['intersection'](_0x58c681[_0x3564('0x2a')],qs['fields'](_0x1987e8[_0x3564('0x2c')][_0x3564('0x2f')]));_0x21e33f[_0x3564('0x30')]=_0x21e33f['attributes'][_0x3564('0x31')]?_0x21e33f[_0x3564('0x30')]:_0x58c681[_0x3564('0x2a')];if(_0x1987e8[_0x3564('0x2c')]['includeAll']){_0x21e33f[_0x3564('0x3a')]=[{'all':!![]}];}_0x21e33f=_['merge']({},_0x21e33f,_0x1987e8[_0x3564('0x3e')]);return db[_0x3564('0x26')][_0x3564('0x3f')](_0x21e33f)[_0x3564('0x1e')](handleEntityNotFound(_0x523eb0,null))['then'](respondWithResult(_0x523eb0,null))[_0x3564('0x3d')](handleError(_0x523eb0,null));};exports[_0x3564('0x40')]=function(_0x30987d,_0x7ba199){return db[_0x3564('0x26')][_0x3564('0x40')](_0x30987d[_0x3564('0x41')],{})['then'](respondWithResult(_0x7ba199,0xc9))[_0x3564('0x3d')](handleError(_0x7ba199,null));};exports[_0x3564('0x42')]=function(_0x236b68,_0x4106fd){if(_0x236b68['body']['id']){delete _0x236b68[_0x3564('0x41')]['id'];}return db[_0x3564('0x26')][_0x3564('0x3f')]({'where':{'id':_0x236b68['params']['id']}})[_0x3564('0x1e')](handleEntityNotFound(_0x4106fd,null))[_0x3564('0x1e')](saveUpdates(_0x236b68[_0x3564('0x41')],null))['then'](respondWithResult(_0x4106fd,null))[_0x3564('0x3d')](handleError(_0x4106fd,null));};exports['destroy']=function(_0xd50a5c,_0x5e285a){return db[_0x3564('0x26')][_0x3564('0x3f')]({'where':{'id':_0xd50a5c[_0x3564('0x43')]['id']}})['then'](handleEntityNotFound(_0x5e285a,null))[_0x3564('0x1e')](removeEntity(_0x5e285a,null))[_0x3564('0x3d')](handleError(_0x5e285a,null));};exports['getFields']=function(_0x507d57,_0x2e6058,_0x5de0a6){var _0x3db53d={};var _0x285637={};var _0x264a54;var _0x2629a4;return db[_0x3564('0x26')]['findOne']({'where':{'id':_0x507d57[_0x3564('0x43')]['id']}})['then'](handleEntityNotFound(_0x2e6058,null))[_0x3564('0x1e')](function(_0x1a3dd8){if(_0x1a3dd8){_0x264a54=_0x1a3dd8;_0x285637[_0x3564('0x2a')]=_[_0x3564('0x2b')](db[_0x3564('0x44')][_0x3564('0x27')]);_0x285637[_0x3564('0x2c')]=_[_0x3564('0x2b')](_0x507d57[_0x3564('0x2c')]);_0x285637[_0x3564('0x2d')]=_['intersection'](_0x285637[_0x3564('0x2a')],_0x285637[_0x3564('0x2c')]);_0x3db53d[_0x3564('0x30')]=_[_0x3564('0x2e')](_0x285637[_0x3564('0x2a')],qs[_0x3564('0x2f')](_0x507d57['query'][_0x3564('0x2f')]));_0x3db53d[_0x3564('0x30')]=_0x3db53d[_0x3564('0x30')][_0x3564('0x31')]?_0x3db53d['attributes']:_0x285637[_0x3564('0x2a')];_0x3db53d['order']=qs['sort'](_0x507d57[_0x3564('0x2c')]['sort']);_0x3db53d[_0x3564('0x36')]=qs[_0x3564('0x2d')](_[_0x3564('0x34')](_0x507d57[_0x3564('0x2c')],_0x285637[_0x3564('0x2d')]));if(_0x507d57[_0x3564('0x2c')][_0x3564('0x35')]){_0x3db53d[_0x3564('0x36')]=_['merge'](_0x3db53d[_0x3564('0x36')],{'$or':_['map'](_0x3db53d[_0x3564('0x30')],function(_0x7f60c1){var _0xb23d7d={};_0xb23d7d[_0x7f60c1]={'$like':'%'+_0x507d57[_0x3564('0x2c')][_0x3564('0x35')]+'%'};return _0xb23d7d;})});}_0x3db53d=_[_0x3564('0x38')]({},_0x3db53d,_0x507d57[_0x3564('0x3e')]);return _0x264a54[_0x3564('0x45')](_0x3db53d);}})[_0x3564('0x1e')](function(_0x327009){if(_0x327009){_0x2629a4=_0x327009[_0x3564('0x31')];if(!_0x507d57[_0x3564('0x2c')][_0x3564('0x32')]('nolimit')){_0x3db53d['limit']=qs[_0x3564('0x17')](_0x507d57[_0x3564('0x2c')]['limit']);_0x3db53d[_0x3564('0x15')]=qs[_0x3564('0x15')](_0x507d57[_0x3564('0x2c')]['offset']);}return _0x264a54['getFields'](_0x3db53d);}})['then'](function(_0x1bf019){if(_0x1bf019){return _0x1bf019?{'count':_0x2629a4,'rows':_0x1bf019}:null;}})[_0x3564('0x1e')](respondWithResult(_0x2e6058,null))[_0x3564('0x3d')](handleError(_0x2e6058,null));};exports[_0x3564('0x46')]=function(_0x4c7cee,_0x34402b,_0x2ded6e){var _0x265354={};var _0x18d0e1={};var _0x3a18e4;var _0x4a5a33;return db[_0x3564('0x26')][_0x3564('0x47')]({'where':{'id':_0x4c7cee[_0x3564('0x43')]['id']}})[_0x3564('0x1e')](handleEntityNotFound(_0x34402b,null))[_0x3564('0x1e')](function(_0x3402f7){if(_0x3402f7){_0x3a18e4=_0x3402f7;_0x18d0e1[_0x3564('0x2a')]=_[_0x3564('0x2b')](db['SalesforceField'][_0x3564('0x27')]);_0x18d0e1[_0x3564('0x2c')]=_[_0x3564('0x2b')](_0x4c7cee['query']);_0x18d0e1[_0x3564('0x2d')]=_[_0x3564('0x2e')](_0x18d0e1['model'],_0x18d0e1['query']);_0x265354[_0x3564('0x30')]=_[_0x3564('0x2e')](_0x18d0e1['model'],qs['fields'](_0x4c7cee['query']['fields']));_0x265354[_0x3564('0x30')]=_0x265354[_0x3564('0x30')][_0x3564('0x31')]?_0x265354['attributes']:_0x18d0e1['model'];_0x265354[_0x3564('0x33')]=qs[_0x3564('0x48')](_0x4c7cee['query']['sort']);_0x265354[_0x3564('0x36')]=qs[_0x3564('0x2d')](_['pick'](_0x4c7cee[_0x3564('0x2c')],_0x18d0e1['filters']));if(_0x4c7cee[_0x3564('0x2c')][_0x3564('0x35')]){_0x265354[_0x3564('0x36')]=_[_0x3564('0x38')](_0x265354['where'],{'$or':_[_0x3564('0x25')](_0x265354[_0x3564('0x30')],function(_0x47ec37){var _0x36a33f={};_0x36a33f[_0x47ec37]={'$like':'%'+_0x4c7cee[_0x3564('0x2c')][_0x3564('0x35')]+'%'};return _0x36a33f;})});}_0x265354=_[_0x3564('0x38')]({},_0x265354,_0x4c7cee[_0x3564('0x3e')]);return _0x3a18e4[_0x3564('0x46')](_0x265354);}})[_0x3564('0x1e')](function(_0x317165){if(_0x317165){_0x4a5a33=_0x317165[_0x3564('0x31')];if(!_0x4c7cee[_0x3564('0x2c')][_0x3564('0x32')]('nolimit')){_0x265354[_0x3564('0x17')]=qs[_0x3564('0x17')](_0x4c7cee['query'][_0x3564('0x17')]);_0x265354[_0x3564('0x15')]=qs['offset'](_0x4c7cee[_0x3564('0x2c')][_0x3564('0x15')]);}return _0x3a18e4[_0x3564('0x46')](_0x265354);}})[_0x3564('0x1e')](function(_0xf8be40){if(_0xf8be40){return _0xf8be40?{'count':_0x4a5a33,'rows':_0xf8be40}:null;}})[_0x3564('0x1e')](respondWithResult(_0x34402b,null))[_0x3564('0x3d')](handleError(_0x34402b,null));};exports['getDescriptions']=function(_0x37eb9f,_0x37a930,_0x11e1de){var _0x270e04={};var _0x5c9c76={};var _0x148532;var _0x391168;return db[_0x3564('0x26')][_0x3564('0x47')]({'where':{'id':_0x37eb9f[_0x3564('0x43')]['id']}})[_0x3564('0x1e')](handleEntityNotFound(_0x37a930,null))[_0x3564('0x1e')](function(_0x21ee8f){if(_0x21ee8f){_0x148532=_0x21ee8f;_0x5c9c76[_0x3564('0x2a')]=_[_0x3564('0x2b')](db[_0x3564('0x44')]['rawAttributes']);_0x5c9c76[_0x3564('0x2c')]=_['keys'](_0x37eb9f[_0x3564('0x2c')]);_0x5c9c76[_0x3564('0x2d')]=_['intersection'](_0x5c9c76[_0x3564('0x2a')],_0x5c9c76[_0x3564('0x2c')]);_0x270e04['attributes']=_[_0x3564('0x2e')](_0x5c9c76[_0x3564('0x2a')],qs[_0x3564('0x2f')](_0x37eb9f[_0x3564('0x2c')][_0x3564('0x2f')]));_0x270e04[_0x3564('0x30')]=_0x270e04['attributes']['length']?_0x270e04['attributes']:_0x5c9c76[_0x3564('0x2a')];_0x270e04[_0x3564('0x33')]=qs[_0x3564('0x48')](_0x37eb9f[_0x3564('0x2c')][_0x3564('0x48')]);_0x270e04['where']=qs['filters'](_[_0x3564('0x34')](_0x37eb9f[_0x3564('0x2c')],_0x5c9c76['filters']));if(_0x37eb9f[_0x3564('0x2c')][_0x3564('0x35')]){_0x270e04['where']=_[_0x3564('0x38')](_0x270e04['where'],{'$or':_[_0x3564('0x25')](_0x270e04[_0x3564('0x30')],function(_0x145e1d){var _0x5b87ed={};_0x5b87ed[_0x145e1d]={'$like':'%'+_0x37eb9f[_0x3564('0x2c')][_0x3564('0x35')]+'%'};return _0x5b87ed;})});}_0x270e04=_['merge']({},_0x270e04,_0x37eb9f[_0x3564('0x3e')]);return _0x148532[_0x3564('0x49')](_0x270e04);}})[_0x3564('0x1e')](function(_0x3a572f){if(_0x3a572f){_0x391168=_0x3a572f[_0x3564('0x31')];if(!_0x37eb9f['query']['hasOwnProperty'](_0x3564('0x4a'))){_0x270e04[_0x3564('0x17')]=qs[_0x3564('0x17')](_0x37eb9f[_0x3564('0x2c')][_0x3564('0x17')]);_0x270e04[_0x3564('0x15')]=qs['offset'](_0x37eb9f[_0x3564('0x2c')][_0x3564('0x15')]);}return _0x148532[_0x3564('0x49')](_0x270e04);}})[_0x3564('0x1e')](function(_0x1c14c3){if(_0x1c14c3){return _0x1c14c3?{'count':_0x391168,'rows':_0x1c14c3}:null;}})[_0x3564('0x1e')](respondWithResult(_0x37a930,null))[_0x3564('0x3d')](handleError(_0x37a930,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 25f3f6f..2e6494e 100644 --- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js +++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7535=['define','SalesforceConfiguration','lodash','bluebird','rimraf','../../config/environment','exports'];(function(_0x12d2b1,_0x1215e5){var _0x51e1a0=function(_0x2a46ce){while(--_0x2a46ce){_0x12d2b1['push'](_0x12d2b1['shift']());}};_0x51e1a0(++_0x1215e5);}(_0x7535,0x13d));var _0x5753=function(_0x28edda,_0xbd447a){_0x28edda=_0x28edda-0x0;var _0x21f4a4=_0x7535[_0x28edda];return _0x21f4a4;};'use strict';var _=require(_0x5753('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x5753('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5753('0x2'));var config=require(_0x5753('0x3'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0x5753('0x4')]=function(_0xc3cd17,_0x3e52ee){return _0xc3cd17[_0x5753('0x5')](_0x5753('0x6'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc7f3=['../../config/logger','moment','request-promise','exports','define','SalesforceConfiguration','lodash'];(function(_0x1f2ef4,_0x830def){var _0x45b81c=function(_0x4ccc02){while(--_0x4ccc02){_0x1f2ef4['push'](_0x1f2ef4['shift']());}};_0x45b81c(++_0x830def);}(_0xc7f3,0x76));var _0x3c7f=function(_0x49579b,_0x528f4e){_0x49579b=_0x49579b-0x0;var _0x1a2d45=_0xc7f3[_0x49579b];return _0x1a2d45;};'use strict';var _=require(_0x3c7f('0x0'));var util=require('util');var logger=require(_0x3c7f('0x1'))('api');var moment=require(_0x3c7f('0x2'));var BPromise=require('bluebird');var rp=require(_0x3c7f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intSalesforceConfiguration.attributes');module[_0x3c7f('0x4')]=function(_0x51081c,_0x71d0b){return _0x51081c[_0x3c7f('0x5')](_0x3c7f('0x6'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 8f845c1..758ca72 100644 --- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js +++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf32f=['catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result'];(function(_0x5d35c4,_0x594f71){var _0x5f5898=function(_0x5b1f57){while(--_0x5b1f57){_0x5d35c4['push'](_0x5d35c4['shift']());}};_0x5f5898(++_0x594f71);}(_0xf32f,0xdd));var _0xff32=function(_0xd5da2a,_0x25ba44){_0xd5da2a=_0xd5da2a-0x0;var _0x3babbd=_0xf32f[_0xd5da2a];return _0x3babbd;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xff32('0x0'));var BPromise=require(_0xff32('0x1'));var rs=require(_0xff32('0x2'));var fs=require('fs');var Redis=require(_0xff32('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xff32('0x4'));var logger=require(_0xff32('0x5'))(_0xff32('0x6'));var config=require(_0xff32('0x7'));var jayson=require(_0xff32('0x8'));var client=jayson[_0xff32('0x9')][_0xff32('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a6191,_0x515161,_0x39fdc9){return new BPromise(function(_0x57fc84,_0x333a36){return client[_0xff32('0xb')](_0x3a6191,_0x39fdc9)[_0xff32('0xc')](function(_0x1afbf8){logger[_0xff32('0xd')](_0xff32('0xe'),_0x515161,_0xff32('0xf'));logger[_0xff32('0x10')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x515161,_0xff32('0xf'),JSON[_0xff32('0x11')](_0x1afbf8));if(_0x1afbf8[_0xff32('0x12')]){if(_0x1afbf8[_0xff32('0x12')]['code']===0x1f4){logger[_0xff32('0x12')](_0xff32('0xe'),_0x515161,_0x1afbf8[_0xff32('0x12')][_0xff32('0x13')]);return _0x333a36(_0x1afbf8[_0xff32('0x12')][_0xff32('0x13')]);}logger[_0xff32('0x12')](_0xff32('0xe'),_0x515161,_0x1afbf8[_0xff32('0x12')][_0xff32('0x13')]);return _0x57fc84(_0x1afbf8[_0xff32('0x12')][_0xff32('0x13')]);}else{logger[_0xff32('0xd')](_0xff32('0xe'),_0x515161,_0xff32('0xf'));_0x57fc84(_0x1afbf8[_0xff32('0x14')][_0xff32('0x13')]);}})[_0xff32('0x15')](function(_0x1e0c5d){logger['error'](_0xff32('0xe'),_0x515161,_0x1e0c5d);_0x333a36(_0x1e0c5d);});});} \ No newline at end of file +var _0x32e8=['../../config/logger','../../config/environment','client','then','info','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x33554b,_0x48162b){var _0x256954=function(_0x185f66){while(--_0x185f66){_0x33554b['push'](_0x33554b['shift']());}};_0x256954(++_0x48162b);}(_0x32e8,0x162));var _0x832e=function(_0x2ce9c3,_0x1444f9){_0x2ce9c3=_0x2ce9c3-0x0;var _0xc89661=_0x32e8[_0x2ce9c3];return _0xc89661;};'use strict';var _=require(_0x832e('0x0'));var util=require(_0x832e('0x1'));var moment=require(_0x832e('0x2'));var BPromise=require(_0x832e('0x3'));var rs=require(_0x832e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x832e('0x5'));var logger=require(_0x832e('0x6'))('rpc');var config=require(_0x832e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x832e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc6d887,_0x55f57b,_0x2edd60){return new BPromise(function(_0x32f6db,_0x3a5b66){return client['request'](_0xc6d887,_0x2edd60)[_0x832e('0x9')](function(_0x27da24){logger[_0x832e('0xa')]('SalesforceConfiguration,\x20%s,\x20%s',_0x55f57b,_0x832e('0xb'));logger[_0x832e('0xc')](_0x832e('0xd'),_0x55f57b,_0x832e('0xb'),JSON[_0x832e('0xe')](_0x27da24));if(_0x27da24[_0x832e('0xf')]){if(_0x27da24['error'][_0x832e('0x10')]===0x1f4){logger[_0x832e('0xf')](_0x832e('0x11'),_0x55f57b,_0x27da24[_0x832e('0xf')][_0x832e('0x12')]);return _0x3a5b66(_0x27da24[_0x832e('0xf')][_0x832e('0x12')]);}logger[_0x832e('0xf')](_0x832e('0x11'),_0x55f57b,_0x27da24['error'][_0x832e('0x12')]);return _0x32f6db(_0x27da24[_0x832e('0xf')][_0x832e('0x12')]);}else{logger[_0x832e('0xa')](_0x832e('0x11'),_0x55f57b,_0x832e('0xb'));_0x32f6db(_0x27da24[_0x832e('0x13')][_0x832e('0x12')]);}})['catch'](function(_0xbe13ae){logger[_0x832e('0xf')](_0x832e('0x11'),_0x55f57b,_0xbe13ae);_0x3a5b66(_0xbe13ae);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 09f5873..16d26ec 100644 --- a/server/api/intSalesforceField/index.js +++ b/server/api/intSalesforceField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8216=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','post','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x43ff43,_0x7893a3){var _0x360cda=function(_0x5005df){while(--_0x5005df){_0x43ff43['push'](_0x43ff43['shift']());}};_0x360cda(++_0x7893a3);}(_0x8216,0x1c2));var _0x6821=function(_0x1ca155,_0x1c31e2){_0x1ca155=_0x1ca155-0x0;var _0x25320c=_0x8216[_0x1ca155];return _0x25320c;};'use strict';var multer=require(_0x6821('0x0'));var util=require(_0x6821('0x1'));var path=require(_0x6821('0x2'));var timeout=require(_0x6821('0x3'));var express=require(_0x6821('0x4'));var router=express['Router']();var fs_extra=require(_0x6821('0x5'));var auth=require(_0x6821('0x6'));var interaction=require(_0x6821('0x7'));var config=require(_0x6821('0x8'));var controller=require(_0x6821('0x9'));router[_0x6821('0xa')]('/',auth[_0x6821('0xb')](),controller[_0x6821('0xc')]);router[_0x6821('0xa')](_0x6821('0xd'),auth['isAuthenticated'](),controller[_0x6821('0xe')]);router[_0x6821('0xf')]('/',auth[_0x6821('0xb')](),controller['create']);router['put']('/:id',auth[_0x6821('0xb')](),controller[_0x6821('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x6821('0x11')]);module[_0x6821('0x12')]=router; \ No newline at end of file +var _0x75c7=['util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer'];(function(_0x3f288d,_0x3c7a97){var _0x5e8468=function(_0xb0189c){while(--_0xb0189c){_0x3f288d['push'](_0x3f288d['shift']());}};_0x5e8468(++_0x3c7a97);}(_0x75c7,0xa1));var _0x775c=function(_0x3a8e2f,_0x28f320){_0x3a8e2f=_0x3a8e2f-0x0;var _0x518e93=_0x75c7[_0x3a8e2f];return _0x518e93;};'use strict';var multer=require(_0x775c('0x0'));var util=require(_0x775c('0x1'));var path=require(_0x775c('0x2'));var timeout=require('connect-timeout');var express=require(_0x775c('0x3'));var router=express['Router']();var fs_extra=require(_0x775c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x775c('0x5'));var config=require(_0x775c('0x6'));var controller=require(_0x775c('0x7'));router['get']('/',auth[_0x775c('0x8')](),controller[_0x775c('0x9')]);router['get'](_0x775c('0xa'),auth[_0x775c('0x8')](),controller[_0x775c('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x775c('0xc')]);router[_0x775c('0xd')](_0x775c('0xa'),auth['isAuthenticated'](),controller[_0x775c('0xe')]);router[_0x775c('0xf')](_0x775c('0xa'),auth[_0x775c('0x8')](),controller[_0x775c('0x10')]);module[_0x775c('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 0488bb1..14da94e 100644 --- a/server/api/intSalesforceField/intSalesforceField.attributes.js +++ b/server/api/intSalesforceField/intSalesforceField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc592=['string','variable','customVariable','keyValue','STRING','ENUM','sequelize','exports'];(function(_0x2d034d,_0x532a40){var _0x286474=function(_0x17d07c){while(--_0x17d07c){_0x2d034d['push'](_0x2d034d['shift']());}};_0x286474(++_0x532a40);}(_0xc592,0x1de));var _0x2c59=function(_0x8228fd,_0x54165d){_0x8228fd=_0x8228fd-0x0;var _0x20f797=_0xc592[_0x8228fd];return _0x20f797;};'use strict';var Sequelize=require(_0x2c59('0x0'));module[_0x2c59('0x1')]={'type':{'type':Sequelize['ENUM'](_0x2c59('0x2'),_0x2c59('0x3'),_0x2c59('0x4'),_0x2c59('0x5'),'picklist'),'defaultValue':_0x2c59('0x2')},'content':{'type':Sequelize[_0x2c59('0x6')]},'key':{'type':Sequelize[_0x2c59('0x6')]},'keyType':{'type':Sequelize[_0x2c59('0x7')](_0x2c59('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x2c59('0x6')]},'variableName':{'type':Sequelize[_0x2c59('0x6')]}}; \ No newline at end of file +var _0x0efd=['STRING','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x5c0c9f,_0x9f70c7){var _0x14b473=function(_0x230734){while(--_0x230734){_0x5c0c9f['push'](_0x5c0c9f['shift']());}};_0x14b473(++_0x9f70c7);}(_0x0efd,0x106));var _0xd0ef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0efd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd0ef('0x0'));module[_0xd0ef('0x1')]={'type':{'type':Sequelize[_0xd0ef('0x2')](_0xd0ef('0x3'),_0xd0ef('0x4'),_0xd0ef('0x5'),_0xd0ef('0x6'),_0xd0ef('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0xd0ef('0x8')]},'key':{'type':Sequelize[_0xd0ef('0x8')]},'keyType':{'type':Sequelize[_0xd0ef('0x2')](_0xd0ef('0x3'),_0xd0ef('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xd0ef('0x8')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0xd0ef('0x8')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 3940ba9..cc42762 100644 --- a/server/api/intSalesforceField/intSalesforceField.controller.js +++ b/server/api/intSalesforceField/intSalesforceField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f12=['ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','json','reject','save','destroy','then','sendStatus','stack','name','send','index','map','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','SalesforceField','include','findAll','rows','params','keys','includeAll','find','catch','create','body','update','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x455f91,_0x2d19da){var _0x38e919=function(_0x42d094){while(--_0x42d094){_0x455f91['push'](_0x455f91['shift']());}};_0x38e919(++_0x2d19da);}(_0x6f12,0x86));var _0x26f1=function(_0x2e6d0c,_0x14c856){_0x2e6d0c=_0x2e6d0c-0x0;var _0x180a6b=_0x6f12[_0x2e6d0c];return _0x180a6b;};'use strict';var emlformat=require(_0x26f1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x26f1('0x1'));var jsonpatch=require(_0x26f1('0x2'));var rp=require(_0x26f1('0x3'));var moment=require(_0x26f1('0x4'));var BPromise=require(_0x26f1('0x5'));var Mustache=require(_0x26f1('0x6'));var util=require(_0x26f1('0x7'));var path=require(_0x26f1('0x8'));var sox=require(_0x26f1('0x9'));var csv=require('to-csv');var ejs=require(_0x26f1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x26f1('0xb'));var squel=require(_0x26f1('0xc'));var crypto=require('crypto');var jsforce=require(_0x26f1('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x26f1('0xe'));var Redis=require(_0x26f1('0xf'));var authService=require(_0x26f1('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x26f1('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x26f1('0x12'))(_0x26f1('0x13'));var utils=require('../../config/utils');var config=require(_0x26f1('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x26f1('0x15'))['db'];function respondWithStatusCode(_0xa0d2a6,_0x2cfb9c){_0x2cfb9c=_0x2cfb9c||0xcc;return function(_0x14136a){if(_0x14136a){return _0xa0d2a6['sendStatus'](_0x2cfb9c);}return _0xa0d2a6[_0x26f1('0x16')](_0x2cfb9c)[_0x26f1('0x17')]();};}function respondWithResult(_0x1478de,_0x2f88f4){_0x2f88f4=_0x2f88f4||0xc8;return function(_0x1bad0b){if(_0x1bad0b){return _0x1478de[_0x26f1('0x16')](_0x2f88f4)['json'](_0x1bad0b);}};}function respondWithFilteredResult(_0x4d9e05,_0x25fb47){return function(_0x3a36b9){if(_0x3a36b9){var _0x446c8b=typeof _0x25fb47[_0x26f1('0x18')]===_0x26f1('0x19')&&typeof _0x25fb47[_0x26f1('0x1a')]===_0x26f1('0x19');var _0x24523e=_0x3a36b9[_0x26f1('0x1b')];var _0x46e2a5=_0x446c8b?0x0:_0x25fb47[_0x26f1('0x18')];var _0x4d7aad=_0x446c8b?_0x3a36b9[_0x26f1('0x1b')]:_0x25fb47[_0x26f1('0x18')]+_0x25fb47[_0x26f1('0x1a')];var _0x205ccc;if(_0x4d7aad>=_0x24523e){_0x4d7aad=_0x24523e;_0x205ccc=0xc8;}else{_0x205ccc=0xce;}_0x4d9e05[_0x26f1('0x16')](_0x205ccc);return _0x4d9e05['set'](_0x26f1('0x1c'),_0x46e2a5+'-'+_0x4d7aad+'/'+_0x24523e)[_0x26f1('0x1d')](_0x3a36b9);}return null;};}function patchUpdates(_0x44b723){return function(_0x565b50){try{jsonpatch['apply'](_0x565b50,_0x44b723,!![]);}catch(_0xf0b049){return BPromise[_0x26f1('0x1e')](_0xf0b049);}return _0x565b50[_0x26f1('0x1f')]();};}function saveUpdates(_0x40d548,_0x166915){return function(_0x4bda56){if(_0x4bda56){return _0x4bda56['update'](_0x40d548)['then'](function(_0x53a6c6){return _0x53a6c6;});}return null;};}function removeEntity(_0x3c83e7,_0xca0c64){return function(_0x52a49a){if(_0x52a49a){return _0x52a49a[_0x26f1('0x20')]()[_0x26f1('0x21')](function(){_0x3c83e7[_0x26f1('0x16')](0xcc)[_0x26f1('0x17')]();});}};}function handleEntityNotFound(_0x18b009,_0x1cb5c0){return function(_0x517e27){if(!_0x517e27){_0x18b009[_0x26f1('0x22')](0x194);}return _0x517e27;};}function handleError(_0x18b2cf,_0x119454){_0x119454=_0x119454||0x1f4;return function(_0x2b6ba6){logger['error'](_0x2b6ba6[_0x26f1('0x23')]);if(_0x2b6ba6[_0x26f1('0x24')]){delete _0x2b6ba6[_0x26f1('0x24')];}_0x18b2cf[_0x26f1('0x16')](_0x119454)[_0x26f1('0x25')](_0x2b6ba6);};}exports[_0x26f1('0x26')]=function(_0x3e3d17,_0x1dc8cf){var _0x4cb959={},_0x2c10b7={},_0x2dba54={'count':0x0,'rows':[]};var _0x20ef68=_[_0x26f1('0x27')](db['SalesforceField']['rawAttributes'],function(_0x4de8fa){return{'name':_0x4de8fa[_0x26f1('0x28')],'type':_0x4de8fa[_0x26f1('0x29')][_0x26f1('0x2a')]};});_0x2c10b7[_0x26f1('0x2b')]=_[_0x26f1('0x27')](_0x20ef68,_0x26f1('0x24'));_0x2c10b7[_0x26f1('0x2c')]=_['keys'](_0x3e3d17[_0x26f1('0x2c')]);_0x2c10b7['filters']=_[_0x26f1('0x2d')](_0x2c10b7[_0x26f1('0x2b')],_0x2c10b7[_0x26f1('0x2c')]);_0x4cb959['attributes']=_[_0x26f1('0x2d')](_0x2c10b7['model'],qs[_0x26f1('0x2e')](_0x3e3d17[_0x26f1('0x2c')][_0x26f1('0x2e')]));_0x4cb959[_0x26f1('0x2f')]=_0x4cb959[_0x26f1('0x2f')][_0x26f1('0x30')]?_0x4cb959[_0x26f1('0x2f')]:_0x2c10b7['model'];if(!_0x3e3d17[_0x26f1('0x2c')][_0x26f1('0x31')](_0x26f1('0x32'))){_0x4cb959['limit']=qs['limit'](_0x3e3d17[_0x26f1('0x2c')][_0x26f1('0x1a')]);_0x4cb959[_0x26f1('0x18')]=qs[_0x26f1('0x18')](_0x3e3d17[_0x26f1('0x2c')]['offset']);}_0x4cb959[_0x26f1('0x33')]=qs[_0x26f1('0x34')](_0x3e3d17[_0x26f1('0x2c')]['sort']);_0x4cb959[_0x26f1('0x35')]=qs[_0x26f1('0x36')](_[_0x26f1('0x37')](_0x3e3d17[_0x26f1('0x2c')],_0x2c10b7['filters']),_0x20ef68);if(_0x3e3d17[_0x26f1('0x2c')][_0x26f1('0x38')]){_0x4cb959[_0x26f1('0x35')]=_[_0x26f1('0x39')](_0x4cb959[_0x26f1('0x35')],{'$or':_[_0x26f1('0x27')](_0x20ef68,function(_0x5695b7){if(_0x5695b7[_0x26f1('0x29')]!==_0x26f1('0x3a')){var _0x272864={};_0x272864[_0x5695b7[_0x26f1('0x24')]]={'$like':'%'+_0x3e3d17[_0x26f1('0x2c')][_0x26f1('0x38')]+'%'};return _0x272864;}})});}_0x4cb959=_[_0x26f1('0x39')]({},_0x4cb959,_0x3e3d17[_0x26f1('0x3b')]);var _0x58aa88={'where':_0x4cb959[_0x26f1('0x35')]};return db[_0x26f1('0x3c')]['count'](_0x58aa88)['then'](function(_0x2fae7c){_0x2dba54[_0x26f1('0x1b')]=_0x2fae7c;if(_0x3e3d17[_0x26f1('0x2c')]['includeAll']){_0x4cb959[_0x26f1('0x3d')]=[{'all':!![]}];}return db[_0x26f1('0x3c')][_0x26f1('0x3e')](_0x4cb959);})[_0x26f1('0x21')](function(_0x17f096){_0x2dba54[_0x26f1('0x3f')]=_0x17f096;return _0x2dba54;})[_0x26f1('0x21')](respondWithFilteredResult(_0x1dc8cf,_0x4cb959))['catch'](handleError(_0x1dc8cf,null));};exports['show']=function(_0x1e4b1e,_0x5ced33){var _0x3a4ba8={'raw':!![],'where':{'id':_0x1e4b1e[_0x26f1('0x40')]['id']}},_0x1de511={};_0x1de511['model']=_[_0x26f1('0x41')](db[_0x26f1('0x3c')]['rawAttributes']);_0x1de511[_0x26f1('0x2c')]=_[_0x26f1('0x41')](_0x1e4b1e[_0x26f1('0x2c')]);_0x1de511['filters']=_['intersection'](_0x1de511[_0x26f1('0x2b')],_0x1de511['query']);_0x3a4ba8[_0x26f1('0x2f')]=_[_0x26f1('0x2d')](_0x1de511[_0x26f1('0x2b')],qs[_0x26f1('0x2e')](_0x1e4b1e['query'][_0x26f1('0x2e')]));_0x3a4ba8['attributes']=_0x3a4ba8['attributes'][_0x26f1('0x30')]?_0x3a4ba8[_0x26f1('0x2f')]:_0x1de511['model'];if(_0x1e4b1e['query'][_0x26f1('0x42')]){_0x3a4ba8[_0x26f1('0x3d')]=[{'all':!![]}];}_0x3a4ba8=_[_0x26f1('0x39')]({},_0x3a4ba8,_0x1e4b1e[_0x26f1('0x3b')]);return db['SalesforceField'][_0x26f1('0x43')](_0x3a4ba8)[_0x26f1('0x21')](handleEntityNotFound(_0x5ced33,null))[_0x26f1('0x21')](respondWithResult(_0x5ced33,null))[_0x26f1('0x44')](handleError(_0x5ced33,null));};exports[_0x26f1('0x45')]=function(_0x53d105,_0x2dba9b){return db[_0x26f1('0x3c')][_0x26f1('0x45')](_0x53d105[_0x26f1('0x46')],{})[_0x26f1('0x21')](respondWithResult(_0x2dba9b,0xc9))[_0x26f1('0x44')](handleError(_0x2dba9b,null));};exports[_0x26f1('0x47')]=function(_0x5f5da6,_0x5e7887){if(_0x5f5da6['body']['id']){delete _0x5f5da6[_0x26f1('0x46')]['id'];}return db[_0x26f1('0x3c')][_0x26f1('0x43')]({'where':{'id':_0x5f5da6[_0x26f1('0x40')]['id']}})['then'](handleEntityNotFound(_0x5e7887,null))['then'](saveUpdates(_0x5f5da6['body'],null))[_0x26f1('0x21')](respondWithResult(_0x5e7887,null))[_0x26f1('0x44')](handleError(_0x5e7887,null));};exports[_0x26f1('0x20')]=function(_0x3a36d4,_0x2b3f7f){return db['SalesforceField'][_0x26f1('0x43')]({'where':{'id':_0x3a36d4[_0x26f1('0x40')]['id']}})[_0x26f1('0x21')](handleEntityNotFound(_0x2b3f7f,null))[_0x26f1('0x21')](removeEntity(_0x2b3f7f,null))[_0x26f1('0x44')](handleError(_0x2b3f7f,null));}; \ No newline at end of file +var _0x8ee0=['../../mysqldb','sendStatus','status','end','json','undefined','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','rows','catch','show','params','length','includeAll','body','find','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x8ee0,0x1e2));var _0x08ee=function(_0x2bd88d,_0x2d5dc3){_0x2bd88d=_0x2bd88d-0x0;var _0x5516d4=_0x8ee0[_0x2bd88d];return _0x5516d4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x08ee('0x0'));var jsonpatch=require(_0x08ee('0x1'));var rp=require(_0x08ee('0x2'));var moment=require(_0x08ee('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x08ee('0x4'));var sox=require(_0x08ee('0x5'));var csv=require(_0x08ee('0x6'));var ejs=require(_0x08ee('0x7'));var fs=require('fs');var fs_extra=require(_0x08ee('0x8'));var _=require(_0x08ee('0x9'));var squel=require(_0x08ee('0xa'));var crypto=require('crypto');var jsforce=require(_0x08ee('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x08ee('0x6'));var querystring=require(_0x08ee('0xc'));var Papa=require(_0x08ee('0xd'));var Redis=require('ioredis');var authService=require(_0x08ee('0xe'));var qs=require(_0x08ee('0xf'));var as=require(_0x08ee('0x10'));var hardwareService=require(_0x08ee('0x11'));var logger=require(_0x08ee('0x12'))(_0x08ee('0x13'));var utils=require(_0x08ee('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x08ee('0x15'));var db=require(_0x08ee('0x16'))['db'];function respondWithStatusCode(_0x478b5e,_0x3137fb){_0x3137fb=_0x3137fb||0xcc;return function(_0x5f44f4){if(_0x5f44f4){return _0x478b5e[_0x08ee('0x17')](_0x3137fb);}return _0x478b5e[_0x08ee('0x18')](_0x3137fb)[_0x08ee('0x19')]();};}function respondWithResult(_0x3b0c13,_0xbe7981){_0xbe7981=_0xbe7981||0xc8;return function(_0x151650){if(_0x151650){return _0x3b0c13[_0x08ee('0x18')](_0xbe7981)[_0x08ee('0x1a')](_0x151650);}};}function respondWithFilteredResult(_0x439e66,_0x13f1b9){return function(_0x363129){if(_0x363129){var _0x1dd18e=typeof _0x13f1b9['offset']==='undefined'&&typeof _0x13f1b9['limit']===_0x08ee('0x1b');var _0x19a418=_0x363129['count'];var _0x475207=_0x1dd18e?0x0:_0x13f1b9[_0x08ee('0x1c')];var _0x3360c6=_0x1dd18e?_0x363129[_0x08ee('0x1d')]:_0x13f1b9[_0x08ee('0x1c')]+_0x13f1b9['limit'];var _0x487940;if(_0x3360c6>=_0x19a418){_0x3360c6=_0x19a418;_0x487940=0xc8;}else{_0x487940=0xce;}_0x439e66[_0x08ee('0x18')](_0x487940);return _0x439e66[_0x08ee('0x1e')](_0x08ee('0x1f'),_0x475207+'-'+_0x3360c6+'/'+_0x19a418)[_0x08ee('0x1a')](_0x363129);}return null;};}function patchUpdates(_0x29607f){return function(_0x54cc14){try{jsonpatch[_0x08ee('0x20')](_0x54cc14,_0x29607f,!![]);}catch(_0xf734cb){return BPromise[_0x08ee('0x21')](_0xf734cb);}return _0x54cc14[_0x08ee('0x22')]();};}function saveUpdates(_0x455510,_0x53d86e){return function(_0x7309e4){if(_0x7309e4){return _0x7309e4[_0x08ee('0x23')](_0x455510)[_0x08ee('0x24')](function(_0x12b0e3){return _0x12b0e3;});}return null;};}function removeEntity(_0x277410,_0x1c994e){return function(_0x2095f2){if(_0x2095f2){return _0x2095f2[_0x08ee('0x25')]()['then'](function(){_0x277410[_0x08ee('0x18')](0xcc)[_0x08ee('0x19')]();});}};}function handleEntityNotFound(_0x24cc53,_0x2518a3){return function(_0x5deaaf){if(!_0x5deaaf){_0x24cc53['sendStatus'](0x194);}return _0x5deaaf;};}function handleError(_0x3badc7,_0x10ba09){_0x10ba09=_0x10ba09||0x1f4;return function(_0x1365d4){logger[_0x08ee('0x26')](_0x1365d4[_0x08ee('0x27')]);if(_0x1365d4[_0x08ee('0x28')]){delete _0x1365d4[_0x08ee('0x28')];}_0x3badc7['status'](_0x10ba09)[_0x08ee('0x29')](_0x1365d4);};}exports[_0x08ee('0x2a')]=function(_0x239904,_0xed4642){var _0x49caa0={},_0x5a3f36={},_0x513193={'count':0x0,'rows':[]};var _0x823e33=_[_0x08ee('0x2b')](db[_0x08ee('0x2c')][_0x08ee('0x2d')],function(_0x165367){return{'name':_0x165367[_0x08ee('0x2e')],'type':_0x165367[_0x08ee('0x2f')]['key']};});_0x5a3f36['model']=_['map'](_0x823e33,_0x08ee('0x28'));_0x5a3f36[_0x08ee('0x30')]=_[_0x08ee('0x31')](_0x239904[_0x08ee('0x30')]);_0x5a3f36[_0x08ee('0x32')]=_[_0x08ee('0x33')](_0x5a3f36[_0x08ee('0x34')],_0x5a3f36['query']);_0x49caa0[_0x08ee('0x35')]=_[_0x08ee('0x33')](_0x5a3f36[_0x08ee('0x34')],qs[_0x08ee('0x36')](_0x239904['query'][_0x08ee('0x36')]));_0x49caa0[_0x08ee('0x35')]=_0x49caa0['attributes']['length']?_0x49caa0[_0x08ee('0x35')]:_0x5a3f36[_0x08ee('0x34')];if(!_0x239904['query']['hasOwnProperty']('nolimit')){_0x49caa0[_0x08ee('0x37')]=qs[_0x08ee('0x37')](_0x239904[_0x08ee('0x30')]['limit']);_0x49caa0[_0x08ee('0x1c')]=qs[_0x08ee('0x1c')](_0x239904['query'][_0x08ee('0x1c')]);}_0x49caa0[_0x08ee('0x38')]=qs[_0x08ee('0x39')](_0x239904['query'][_0x08ee('0x39')]);_0x49caa0[_0x08ee('0x3a')]=qs[_0x08ee('0x32')](_[_0x08ee('0x3b')](_0x239904[_0x08ee('0x30')],_0x5a3f36[_0x08ee('0x32')]),_0x823e33);if(_0x239904[_0x08ee('0x30')][_0x08ee('0x3c')]){_0x49caa0['where']=_[_0x08ee('0x3d')](_0x49caa0[_0x08ee('0x3a')],{'$or':_['map'](_0x823e33,function(_0xdd90b2){if(_0xdd90b2[_0x08ee('0x2f')]!==_0x08ee('0x3e')){var _0x168b58={};_0x168b58[_0xdd90b2[_0x08ee('0x28')]]={'$like':'%'+_0x239904['query'][_0x08ee('0x3c')]+'%'};return _0x168b58;}})});}_0x49caa0=_[_0x08ee('0x3d')]({},_0x49caa0,_0x239904[_0x08ee('0x3f')]);var _0x1c7aa0={'where':_0x49caa0['where']};return db[_0x08ee('0x2c')]['count'](_0x1c7aa0)[_0x08ee('0x24')](function(_0x10c521){_0x513193['count']=_0x10c521;if(_0x239904[_0x08ee('0x30')]['includeAll']){_0x49caa0['include']=[{'all':!![]}];}return db[_0x08ee('0x2c')]['findAll'](_0x49caa0);})[_0x08ee('0x24')](function(_0x193f98){_0x513193[_0x08ee('0x40')]=_0x193f98;return _0x513193;})['then'](respondWithFilteredResult(_0xed4642,_0x49caa0))[_0x08ee('0x41')](handleError(_0xed4642,null));};exports[_0x08ee('0x42')]=function(_0x170715,_0x11f10c){var _0x28a0da={'raw':!![],'where':{'id':_0x170715[_0x08ee('0x43')]['id']}},_0x391f11={};_0x391f11[_0x08ee('0x34')]=_[_0x08ee('0x31')](db['SalesforceField'][_0x08ee('0x2d')]);_0x391f11[_0x08ee('0x30')]=_[_0x08ee('0x31')](_0x170715['query']);_0x391f11['filters']=_[_0x08ee('0x33')](_0x391f11[_0x08ee('0x34')],_0x391f11[_0x08ee('0x30')]);_0x28a0da[_0x08ee('0x35')]=_[_0x08ee('0x33')](_0x391f11['model'],qs['fields'](_0x170715[_0x08ee('0x30')][_0x08ee('0x36')]));_0x28a0da[_0x08ee('0x35')]=_0x28a0da[_0x08ee('0x35')][_0x08ee('0x44')]?_0x28a0da[_0x08ee('0x35')]:_0x391f11[_0x08ee('0x34')];if(_0x170715[_0x08ee('0x30')][_0x08ee('0x45')]){_0x28a0da['include']=[{'all':!![]}];}_0x28a0da=_[_0x08ee('0x3d')]({},_0x28a0da,_0x170715[_0x08ee('0x3f')]);return db[_0x08ee('0x2c')]['find'](_0x28a0da)['then'](handleEntityNotFound(_0x11f10c,null))[_0x08ee('0x24')](respondWithResult(_0x11f10c,null))['catch'](handleError(_0x11f10c,null));};exports['create']=function(_0x342462,_0x4015f4){return db['SalesforceField']['create'](_0x342462[_0x08ee('0x46')],{})['then'](respondWithResult(_0x4015f4,0xc9))[_0x08ee('0x41')](handleError(_0x4015f4,null));};exports[_0x08ee('0x23')]=function(_0x17c1b1,_0x44115a){if(_0x17c1b1['body']['id']){delete _0x17c1b1['body']['id'];}return db['SalesforceField']['find']({'where':{'id':_0x17c1b1[_0x08ee('0x43')]['id']}})[_0x08ee('0x24')](handleEntityNotFound(_0x44115a,null))[_0x08ee('0x24')](saveUpdates(_0x17c1b1[_0x08ee('0x46')],null))[_0x08ee('0x24')](respondWithResult(_0x44115a,null))['catch'](handleError(_0x44115a,null));};exports[_0x08ee('0x25')]=function(_0x2c818b,_0x644d95){return db['SalesforceField'][_0x08ee('0x47')]({'where':{'id':_0x2c818b['params']['id']}})[_0x08ee('0x24')](handleEntityNotFound(_0x644d95,null))['then'](removeEntity(_0x644d95,null))[_0x08ee('0x41')](handleError(_0x644d95,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 5698f96..b07a4a3 100644 --- a/server/api/intSalesforceField/intSalesforceField.model.js +++ b/server/api/intSalesforceField/intSalesforceField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xff74=['salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields'];(function(_0x199dae,_0x4d6e8d){var _0x110a95=function(_0x33369d){while(--_0x33369d){_0x199dae['push'](_0x199dae['shift']());}};_0x110a95(++_0x4d6e8d);}(_0xff74,0x1a3));var _0x4ff7=function(_0x1e5068,_0x31e9c4){_0x1e5068=_0x1e5068-0x0;var _0x2230b6=_0xff74[_0x1e5068];return _0x2230b6;};'use strict';var _=require(_0x4ff7('0x0'));var util=require(_0x4ff7('0x1'));var logger=require(_0x4ff7('0x2'))('api');var moment=require(_0x4ff7('0x3'));var BPromise=require(_0x4ff7('0x4'));var rp=require(_0x4ff7('0x5'));var fs=require('fs');var path=require(_0x4ff7('0x6'));var rimraf=require('rimraf');var config=require(_0x4ff7('0x7'));var attributes=require(_0x4ff7('0x8'));module[_0x4ff7('0x9')]=function(_0x23303a,_0x14db51){return _0x23303a[_0x4ff7('0xa')](_0x4ff7('0xb'),attributes,{'tableName':_0x4ff7('0xc'),'paranoid':![],'indexes':[{'name':_0x4ff7('0xd'),'fields':[_0x4ff7('0xe'),_0x4ff7('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x74a6=['exports','define','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x74a6,0x113));var _0x674a=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0x74a6[_0x1c546c];return _0x2cc384;};'use strict';var _=require(_0x674a('0x0'));var util=require(_0x674a('0x1'));var logger=require(_0x674a('0x2'))(_0x674a('0x3'));var moment=require('moment');var BPromise=require(_0x674a('0x4'));var rp=require(_0x674a('0x5'));var fs=require('fs');var path=require(_0x674a('0x6'));var rimraf=require(_0x674a('0x7'));var config=require(_0x674a('0x8'));var attributes=require(_0x674a('0x9'));module[_0x674a('0xa')]=function(_0x3f72b0,_0x3f4765){return _0x3f72b0[_0x674a('0xb')]('SalesforceField',attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0x674a('0xc'),'fields':[_0x674a('0xd'),_0x674a('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index cf1d29c..4628786 100644 --- a/server/api/intSalesforceField/intSalesforceField.rpc.js +++ b/server/api/intSalesforceField/intSalesforceField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xec53=['then','debug','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','SalesforceField,\x20%s,\x20%s','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2341c6,_0x3af092){var _0x54c34d=function(_0x3091f9){while(--_0x3091f9){_0x2341c6['push'](_0x2341c6['shift']());}};_0x54c34d(++_0x3af092);}(_0xec53,0x180));var _0x3ec5=function(_0x3f78e0,_0x17fbe5){_0x3f78e0=_0x3f78e0-0x0;var _0x33c5c7=_0xec53[_0x3f78e0];return _0x33c5c7;};'use strict';var _=require(_0x3ec5('0x0'));var util=require(_0x3ec5('0x1'));var moment=require(_0x3ec5('0x2'));var BPromise=require('bluebird');var rs=require(_0x3ec5('0x3'));var fs=require('fs');var Redis=require(_0x3ec5('0x4'));var db=require(_0x3ec5('0x5'))['db'];var utils=require(_0x3ec5('0x6'));var logger=require('../../config/logger')(_0x3ec5('0x7'));var config=require(_0x3ec5('0x8'));var jayson=require(_0x3ec5('0x9'));var client=jayson[_0x3ec5('0xa')][_0x3ec5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x130e05,_0x34b4fd,_0x3abac4){return new BPromise(function(_0x27c59b,_0x5b315f){return client['request'](_0x130e05,_0x3abac4)[_0x3ec5('0xc')](function(_0x46a389){logger['info']('SalesforceField,\x20%s,\x20%s',_0x34b4fd,'request\x20sent');logger[_0x3ec5('0xd')](_0x3ec5('0xe'),_0x34b4fd,_0x3ec5('0xf'),JSON['stringify'](_0x46a389));if(_0x46a389[_0x3ec5('0x10')]){if(_0x46a389[_0x3ec5('0x10')]['code']===0x1f4){logger['error']('SalesforceField,\x20%s,\x20%s',_0x34b4fd,_0x46a389[_0x3ec5('0x10')]['message']);return _0x5b315f(_0x46a389['error'][_0x3ec5('0x11')]);}logger['error'](_0x3ec5('0x12'),_0x34b4fd,_0x46a389[_0x3ec5('0x10')][_0x3ec5('0x11')]);return _0x27c59b(_0x46a389[_0x3ec5('0x10')][_0x3ec5('0x11')]);}else{logger[_0x3ec5('0x13')](_0x3ec5('0x12'),_0x34b4fd,_0x3ec5('0xf'));_0x27c59b(_0x46a389[_0x3ec5('0x14')][_0x3ec5('0x11')]);}})[_0x3ec5('0x15')](function(_0x54ce60){logger[_0x3ec5('0x10')](_0x3ec5('0x12'),_0x34b4fd,_0x54ce60);_0x5b315f(_0x54ce60);});});} \ No newline at end of file +var _0xc047=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','info','SalesforceField,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash'];(function(_0x116c04,_0x4963da){var _0x9e011d=function(_0x143880){while(--_0x143880){_0x116c04['push'](_0x116c04['shift']());}};_0x9e011d(++_0x4963da);}(_0xc047,0x8f));var _0x7c04=function(_0x534a26,_0x36af99){_0x534a26=_0x534a26-0x0;var _0x1bc504=_0xc047[_0x534a26];return _0x1bc504;};'use strict';var _=require(_0x7c04('0x0'));var util=require(_0x7c04('0x1'));var moment=require(_0x7c04('0x2'));var BPromise=require(_0x7c04('0x3'));var rs=require(_0x7c04('0x4'));var fs=require('fs');var Redis=require(_0x7c04('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7c04('0x6'));var logger=require(_0x7c04('0x7'))(_0x7c04('0x8'));var config=require(_0x7c04('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2792d3,_0x49b730,_0x96901d){return new BPromise(function(_0x15fff6,_0xf1ec25){return client['request'](_0x2792d3,_0x96901d)['then'](function(_0x3ec763){logger[_0x7c04('0xa')](_0x7c04('0xb'),_0x49b730,_0x7c04('0xc'));logger['debug']('SalesforceField,\x20%s,\x20%s,\x20%s',_0x49b730,'request\x20sent',JSON[_0x7c04('0xd')](_0x3ec763));if(_0x3ec763[_0x7c04('0xe')]){if(_0x3ec763[_0x7c04('0xe')]['code']===0x1f4){logger['error'](_0x7c04('0xb'),_0x49b730,_0x3ec763[_0x7c04('0xe')][_0x7c04('0xf')]);return _0xf1ec25(_0x3ec763[_0x7c04('0xe')][_0x7c04('0xf')]);}logger[_0x7c04('0xe')]('SalesforceField,\x20%s,\x20%s',_0x49b730,_0x3ec763[_0x7c04('0xe')][_0x7c04('0xf')]);return _0x15fff6(_0x3ec763[_0x7c04('0xe')]['message']);}else{logger[_0x7c04('0xa')]('SalesforceField,\x20%s,\x20%s',_0x49b730,'request\x20sent');_0x15fff6(_0x3ec763[_0x7c04('0x10')]['message']);}})[_0x7c04('0x11')](function(_0x3d39fe){logger[_0x7c04('0xe')](_0x7c04('0xb'),_0x49b730,_0x3d39fe);_0xf1ec25(_0x3d39fe);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 3628b0a..676e399 100644 --- a/server/api/intServicenowAccount/index.js +++ b/server/api/intServicenowAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0d3b=['get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x187ec9,_0x3db0f2){var _0x4386e6=function(_0x357089){while(--_0x357089){_0x187ec9['push'](_0x187ec9['shift']());}};_0x4386e6(++_0x3db0f2);}(_0x0d3b,0xf4));var _0xb0d3=function(_0x15967c,_0x55af65){_0x15967c=_0x15967c-0x0;var _0x581ce5=_0x0d3b[_0x15967c];return _0x581ce5;};'use strict';var multer=require(_0xb0d3('0x0'));var util=require(_0xb0d3('0x1'));var path=require(_0xb0d3('0x2'));var timeout=require(_0xb0d3('0x3'));var express=require(_0xb0d3('0x4'));var router=express['Router']();var fs_extra=require(_0xb0d3('0x5'));var auth=require(_0xb0d3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb0d3('0x7'));var controller=require('./intServicenowAccount.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xb0d3('0x8')](_0xb0d3('0x9'),auth[_0xb0d3('0xa')](),controller[_0xb0d3('0xb')]);router['get'](_0xb0d3('0xc'),auth[_0xb0d3('0xa')](),controller[_0xb0d3('0xd')]);router[_0xb0d3('0x8')](_0xb0d3('0xe'),auth[_0xb0d3('0xa')](),controller[_0xb0d3('0xf')]);router[_0xb0d3('0x10')]('/',auth[_0xb0d3('0xa')](),controller['create']);router[_0xb0d3('0x10')](_0xb0d3('0xc'),auth['isAuthenticated'](),controller[_0xb0d3('0x11')]);router[_0xb0d3('0x12')](_0xb0d3('0x9'),auth[_0xb0d3('0xa')](),controller['update']);router[_0xb0d3('0x13')](_0xb0d3('0x9'),auth['isAuthenticated'](),controller[_0xb0d3('0x14')]);module['exports']=router; \ No newline at end of file +var _0xcd18=['addConfiguration','update','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create'];(function(_0x4d19b8,_0x4679c2){var _0x3676b6=function(_0x2ec138){while(--_0x2ec138){_0x4d19b8['push'](_0x4d19b8['shift']());}};_0x3676b6(++_0x4679c2);}(_0xcd18,0xb4));var _0x8cd1=function(_0x54a573,_0x49c04d){_0x54a573=_0x54a573-0x0;var _0x2c45a9=_0xcd18[_0x54a573];return _0x2c45a9;};'use strict';var multer=require(_0x8cd1('0x0'));var util=require(_0x8cd1('0x1'));var path=require('path');var timeout=require(_0x8cd1('0x2'));var express=require(_0x8cd1('0x3'));var router=express['Router']();var fs_extra=require(_0x8cd1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8cd1('0x5'));var config=require(_0x8cd1('0x6'));var controller=require('./intServicenowAccount.controller');router[_0x8cd1('0x7')]('/',auth[_0x8cd1('0x8')](),controller[_0x8cd1('0x9')]);router[_0x8cd1('0x7')](_0x8cd1('0xa'),auth[_0x8cd1('0x8')](),controller[_0x8cd1('0xb')]);router['get'](_0x8cd1('0xc'),auth[_0x8cd1('0x8')](),controller[_0x8cd1('0xd')]);router[_0x8cd1('0x7')](_0x8cd1('0xe'),auth[_0x8cd1('0x8')](),controller[_0x8cd1('0xf')]);router[_0x8cd1('0x10')]('/',auth['isAuthenticated'](),controller[_0x8cd1('0x11')]);router[_0x8cd1('0x10')]('/:id/configurations',auth[_0x8cd1('0x8')](),controller[_0x8cd1('0x12')]);router['put'](_0x8cd1('0xa'),auth[_0x8cd1('0x8')](),controller[_0x8cd1('0x13')]);router['delete'](_0x8cd1('0xa'),auth[_0x8cd1('0x8')](),controller[_0x8cd1('0x14')]);module[_0x8cd1('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 1b71cda..d0aee23 100644 --- a/server/api/intServicenowAccount/intServicenowAccount.attributes.js +++ b/server/api/intServicenowAccount/intServicenowAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6a78=['exports','STRING','remoteUri','sequelize'];(function(_0x231399,_0x361836){var _0x3c0fb1=function(_0x43c2c1){while(--_0x43c2c1){_0x231399['push'](_0x231399['shift']());}};_0x3c0fb1(++_0x361836);}(_0x6a78,0x147));var _0x86a7=function(_0x3f53fc,_0x2c4f7f){_0x3f53fc=_0x3f53fc-0x0;var _0x3b6f27=_0x6a78[_0x3f53fc];return _0x3b6f27;};'use strict';var Sequelize=require(_0x86a7('0x0'));module[_0x86a7('0x1')]={'name':{'type':Sequelize[_0x86a7('0x2')]},'description':{'type':Sequelize[_0x86a7('0x2')]},'username':{'type':Sequelize[_0x86a7('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x86a7('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x86a7('0x2')],'unique':_0x86a7('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x6920=['STRING','username','exports'];(function(_0x28cbc0,_0x203516){var _0x4b3cf5=function(_0x2a15c6){while(--_0x2a15c6){_0x28cbc0['push'](_0x28cbc0['shift']());}};_0x4b3cf5(++_0x203516);}(_0x6920,0xaa));var _0x0692=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x6920[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require('sequelize');module[_0x0692('0x0')]={'name':{'type':Sequelize[_0x0692('0x1')]},'description':{'type':Sequelize[_0x0692('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x0692('0x2')},'password':{'type':Sequelize[_0x0692('0x1')]},'email':{'type':Sequelize[_0x0692('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x0692('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index cc37a9a..f0b1729 100644 --- a/server/api/intServicenowAccount/intServicenowAccount.controller.js +++ b/server/api/intServicenowAccount/intServicenowAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4154=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','ServicenowAccount','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','params','rawAttributes','find','create','body','getConfigurations','findOne','ServicenowConfiguration','order','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','ServicenowField','Descriptions','getFields','hold_reason','knowledge','subcategory','close_code','incident_state','category','made_sla','caused_by','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','closed_at','delivery_plan','impact','work_notes_list','business_service','rfc','time_worked','expected_start','opened_at','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','correlation_display','work_start','assignment_group','business_stc','description','calendar_duration','notify','close_notes','closed_by','parent_incident','sys_id','contact_type','urgency','company','reassignment_count','activity_due','assigned_to','severity','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','correlation_id','username','email','remoteUri','slice','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','password','incident?sysparm_display_value=all','result','incident\x20table\x20objects','assign','includes','forEach','internalType','label','all','log','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','push','statusCode','error','test','Wrong\x20credentials','boolean','True','true','False','false','GET','sys_choice?sysparm_query=name=incident^element=','value','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','lodash','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0xcfe8cc,_0xb83aeb){var _0x55ac53=function(_0x4067d4){while(--_0x4067d4){_0xcfe8cc['push'](_0xcfe8cc['shift']());}};_0x55ac53(++_0xb83aeb);}(_0x4154,0x15e));var _0x4415=function(_0x42bd43,_0x59fb77){_0x42bd43=_0x42bd43-0x0;var _0x421e88=_0x4154[_0x42bd43];return _0x421e88;};'use strict';var emlformat=require(_0x4415('0x0'));var rimraf=require(_0x4415('0x1'));var zipdir=require(_0x4415('0x2'));var jsonpatch=require(_0x4415('0x3'));var rp=require('request-promise');var moment=require(_0x4415('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4415('0x5'));var util=require(_0x4415('0x6'));var path=require('path');var sox=require(_0x4415('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4415('0x8'));var squel=require('squel');var crypto=require(_0x4415('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x4415('0xa'));var toCsv=require(_0x4415('0xb'));var querystring=require(_0x4415('0xc'));var Papa=require('papaparse');var Redis=require(_0x4415('0xd'));var authService=require(_0x4415('0xe'));var qs=require(_0x4415('0xf'));var as=require(_0x4415('0x10'));var hardwareService=require(_0x4415('0x11'));var logger=require(_0x4415('0x12'))(_0x4415('0x13'));var utils=require(_0x4415('0x14'));var config=require(_0x4415('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x4415('0x16'))['db'];var integrations=require(_0x4415('0x17'));function respondWithStatusCode(_0x456e79,_0x35fb9c){_0x35fb9c=_0x35fb9c||0xcc;return function(_0x4254a5){if(_0x4254a5){return _0x456e79[_0x4415('0x18')](_0x35fb9c);}return _0x456e79[_0x4415('0x19')](_0x35fb9c)['end']();};}function respondWithResult(_0x57dc01,_0x1d63ac){_0x1d63ac=_0x1d63ac||0xc8;return function(_0x2e99cd){if(_0x2e99cd){return _0x57dc01['status'](_0x1d63ac)['json'](_0x2e99cd);}};}function respondWithFilteredResult(_0x3f8f04,_0x3ab069){return function(_0x45530a){if(_0x45530a){var _0x2cf13a=typeof _0x3ab069['offset']===_0x4415('0x1a')&&typeof _0x3ab069[_0x4415('0x1b')]===_0x4415('0x1a');var _0x1024d6=_0x45530a['count'];var _0x44f2f9=_0x2cf13a?0x0:_0x3ab069[_0x4415('0x1c')];var _0x12b64b=_0x2cf13a?_0x45530a[_0x4415('0x1d')]:_0x3ab069[_0x4415('0x1c')]+_0x3ab069[_0x4415('0x1b')];var _0x1845f6;if(_0x12b64b>=_0x1024d6){_0x12b64b=_0x1024d6;_0x1845f6=0xc8;}else{_0x1845f6=0xce;}_0x3f8f04[_0x4415('0x19')](_0x1845f6);return _0x3f8f04[_0x4415('0x1e')](_0x4415('0x1f'),_0x44f2f9+'-'+_0x12b64b+'/'+_0x1024d6)[_0x4415('0x20')](_0x45530a);}return null;};}function patchUpdates(_0x26f463){return function(_0x34b580){try{jsonpatch[_0x4415('0x21')](_0x34b580,_0x26f463,!![]);}catch(_0x4b54a4){return BPromise[_0x4415('0x22')](_0x4b54a4);}return _0x34b580[_0x4415('0x23')]();};}function saveUpdates(_0x1be050,_0x2adabc){return function(_0x502cfb){if(_0x502cfb){return _0x502cfb[_0x4415('0x24')](_0x1be050)[_0x4415('0x25')](function(_0x2eff5d){return _0x2eff5d;});}return null;};}function removeEntity(_0x53db58,_0x417434){return function(_0x4b820c){if(_0x4b820c){return _0x4b820c[_0x4415('0x26')]()[_0x4415('0x25')](function(){_0x53db58[_0x4415('0x19')](0xcc)[_0x4415('0x27')]();});}};}function handleEntityNotFound(_0x26062f,_0xc6e976){return function(_0x33494d){if(!_0x33494d){_0x26062f['sendStatus'](0x194);}return _0x33494d;};}function handleError(_0x522496,_0x35adf9){_0x35adf9=_0x35adf9||0x1f4;return function(_0x545966){logger['error'](_0x545966[_0x4415('0x28')]);if(_0x545966[_0x4415('0x29')]){delete _0x545966[_0x4415('0x29')];}_0x522496[_0x4415('0x19')](_0x35adf9)[_0x4415('0x2a')](_0x545966);};}exports[_0x4415('0x2b')]=function(_0x54acf7,_0x56ad45){var _0x5ba6bc={},_0x4e51e9={},_0x47c3f3={'count':0x0,'rows':[]};var _0x37cc86=_[_0x4415('0x2c')](db[_0x4415('0x2d')]['rawAttributes'],function(_0xda4dc1){return{'name':_0xda4dc1[_0x4415('0x2e')],'type':_0xda4dc1[_0x4415('0x2f')]['key']};});_0x4e51e9[_0x4415('0x30')]=_[_0x4415('0x2c')](_0x37cc86,_0x4415('0x29'));_0x4e51e9['query']=_[_0x4415('0x31')](_0x54acf7[_0x4415('0x32')]);_0x4e51e9[_0x4415('0x33')]=_[_0x4415('0x34')](_0x4e51e9[_0x4415('0x30')],_0x4e51e9[_0x4415('0x32')]);_0x5ba6bc['attributes']=_['intersection'](_0x4e51e9[_0x4415('0x30')],qs[_0x4415('0x35')](_0x54acf7[_0x4415('0x32')][_0x4415('0x35')]));_0x5ba6bc[_0x4415('0x36')]=_0x5ba6bc[_0x4415('0x36')][_0x4415('0x37')]?_0x5ba6bc[_0x4415('0x36')]:_0x4e51e9[_0x4415('0x30')];if(!_0x54acf7['query'][_0x4415('0x38')]('nolimit')){_0x5ba6bc[_0x4415('0x1b')]=qs[_0x4415('0x1b')](_0x54acf7['query']['limit']);_0x5ba6bc[_0x4415('0x1c')]=qs[_0x4415('0x1c')](_0x54acf7[_0x4415('0x32')]['offset']);}_0x5ba6bc['order']=qs['sort'](_0x54acf7[_0x4415('0x32')][_0x4415('0x39')]);_0x5ba6bc[_0x4415('0x3a')]=qs[_0x4415('0x33')](_[_0x4415('0x3b')](_0x54acf7[_0x4415('0x32')],_0x4e51e9['filters']),_0x37cc86);if(_0x54acf7[_0x4415('0x32')]['filter']){_0x5ba6bc[_0x4415('0x3a')]=_[_0x4415('0x3c')](_0x5ba6bc['where'],{'$or':_[_0x4415('0x2c')](_0x37cc86,function(_0x4d783f){if(_0x4d783f[_0x4415('0x2f')]!==_0x4415('0x3d')){var _0x221fff={};_0x221fff[_0x4d783f[_0x4415('0x29')]]={'$like':'%'+_0x54acf7[_0x4415('0x32')][_0x4415('0x3e')]+'%'};return _0x221fff;}})});}_0x5ba6bc=_[_0x4415('0x3c')]({},_0x5ba6bc,_0x54acf7[_0x4415('0x3f')]);var _0x502de4={'where':_0x5ba6bc['where']};return db[_0x4415('0x2d')]['count'](_0x502de4)[_0x4415('0x25')](function(_0x1abd78){_0x47c3f3['count']=_0x1abd78;if(_0x54acf7[_0x4415('0x32')][_0x4415('0x40')]){_0x5ba6bc[_0x4415('0x41')]=[{'all':!![]}];}return db[_0x4415('0x2d')][_0x4415('0x42')](_0x5ba6bc);})['then'](function(_0x293ce0){_0x47c3f3['rows']=_0x293ce0;return _0x47c3f3;})[_0x4415('0x25')](respondWithFilteredResult(_0x56ad45,_0x5ba6bc))[_0x4415('0x43')](handleError(_0x56ad45,null));};exports['show']=function(_0x5c5dd8,_0x3d5c19){var _0x5bc972={'raw':![],'where':{'id':_0x5c5dd8[_0x4415('0x44')]['id']}},_0x547f92={};_0x547f92[_0x4415('0x30')]=_[_0x4415('0x31')](db[_0x4415('0x2d')][_0x4415('0x45')]);_0x547f92[_0x4415('0x32')]=_[_0x4415('0x31')](_0x5c5dd8['query']);_0x547f92[_0x4415('0x33')]=_[_0x4415('0x34')](_0x547f92[_0x4415('0x30')],_0x547f92[_0x4415('0x32')]);_0x5bc972[_0x4415('0x36')]=_['intersection'](_0x547f92[_0x4415('0x30')],qs[_0x4415('0x35')](_0x5c5dd8[_0x4415('0x32')][_0x4415('0x35')]));_0x5bc972[_0x4415('0x36')]=_0x5bc972[_0x4415('0x36')][_0x4415('0x37')]?_0x5bc972[_0x4415('0x36')]:_0x547f92[_0x4415('0x30')];if(_0x5c5dd8[_0x4415('0x32')][_0x4415('0x40')]){_0x5bc972[_0x4415('0x41')]=[{'all':!![]}];}_0x5bc972=_[_0x4415('0x3c')]({},_0x5bc972,_0x5c5dd8[_0x4415('0x3f')]);return db[_0x4415('0x2d')][_0x4415('0x46')](_0x5bc972)[_0x4415('0x25')](handleEntityNotFound(_0x3d5c19,null))['then'](respondWithResult(_0x3d5c19,null))['catch'](handleError(_0x3d5c19,null));};exports['create']=function(_0x1d65b9,_0x2fca06){return db[_0x4415('0x2d')][_0x4415('0x47')](_0x1d65b9[_0x4415('0x48')],{})['then'](respondWithResult(_0x2fca06,0xc9))[_0x4415('0x43')](handleError(_0x2fca06,null));};exports['update']=function(_0x364d52,_0x504042){if(_0x364d52[_0x4415('0x48')]['id']){delete _0x364d52[_0x4415('0x48')]['id'];}return db['ServicenowAccount']['find']({'where':{'id':_0x364d52[_0x4415('0x44')]['id']}})[_0x4415('0x25')](handleEntityNotFound(_0x504042,null))[_0x4415('0x25')](saveUpdates(_0x364d52[_0x4415('0x48')],null))[_0x4415('0x25')](respondWithResult(_0x504042,null))['catch'](handleError(_0x504042,null));};exports[_0x4415('0x26')]=function(_0x125510,_0x22a9b5){return db['ServicenowAccount']['find']({'where':{'id':_0x125510['params']['id']}})[_0x4415('0x25')](handleEntityNotFound(_0x22a9b5,null))[_0x4415('0x25')](removeEntity(_0x22a9b5,null))[_0x4415('0x43')](handleError(_0x22a9b5,null));};exports[_0x4415('0x49')]=function(_0x4af046,_0x521361,_0x470e5a){var _0x29fc44={};var _0x26d4a4={};var _0x5d984d;var _0x17b43c;return db[_0x4415('0x2d')][_0x4415('0x4a')]({'where':{'id':_0x4af046[_0x4415('0x44')]['id']}})['then'](handleEntityNotFound(_0x521361,null))[_0x4415('0x25')](function(_0x403c0c){if(_0x403c0c){_0x5d984d=_0x403c0c;_0x26d4a4[_0x4415('0x30')]=_['keys'](db[_0x4415('0x4b')][_0x4415('0x45')]);_0x26d4a4[_0x4415('0x32')]=_['keys'](_0x4af046['query']);_0x26d4a4['filters']=_['intersection'](_0x26d4a4[_0x4415('0x30')],_0x26d4a4[_0x4415('0x32')]);_0x29fc44[_0x4415('0x36')]=_[_0x4415('0x34')](_0x26d4a4[_0x4415('0x30')],qs[_0x4415('0x35')](_0x4af046[_0x4415('0x32')]['fields']));_0x29fc44[_0x4415('0x36')]=_0x29fc44['attributes'][_0x4415('0x37')]?_0x29fc44[_0x4415('0x36')]:_0x26d4a4[_0x4415('0x30')];_0x29fc44[_0x4415('0x4c')]=qs['sort'](_0x4af046[_0x4415('0x32')]['sort']);_0x29fc44['where']=qs['filters'](_['pick'](_0x4af046[_0x4415('0x32')],_0x26d4a4[_0x4415('0x33')]));if(_0x4af046[_0x4415('0x32')][_0x4415('0x3e')]){_0x29fc44[_0x4415('0x3a')]=_[_0x4415('0x3c')](_0x29fc44[_0x4415('0x3a')],{'$or':_[_0x4415('0x2c')](_0x29fc44[_0x4415('0x36')],function(_0x2c2783){var _0x1c31c8={};_0x1c31c8[_0x2c2783]={'$like':'%'+_0x4af046['query'][_0x4415('0x3e')]+'%'};return _0x1c31c8;})});}_0x29fc44=_[_0x4415('0x3c')]({},_0x29fc44,_0x4af046[_0x4415('0x3f')]);return _0x5d984d['getConfigurations'](_0x29fc44);}})['then'](function(_0x3fff25){if(_0x3fff25){_0x17b43c=_0x3fff25[_0x4415('0x37')];if(!_0x4af046[_0x4415('0x32')][_0x4415('0x38')](_0x4415('0x4d'))){_0x29fc44[_0x4415('0x1b')]=qs[_0x4415('0x1b')](_0x4af046['query'][_0x4415('0x1b')]);_0x29fc44[_0x4415('0x1c')]=qs[_0x4415('0x1c')](_0x4af046[_0x4415('0x32')][_0x4415('0x1c')]);}return _0x5d984d[_0x4415('0x49')](_0x29fc44);}})[_0x4415('0x25')](function(_0x359840){if(_0x359840){return _0x359840?{'count':_0x17b43c,'rows':_0x359840}:null;}})[_0x4415('0x25')](respondWithResult(_0x521361,null))[_0x4415('0x43')](handleError(_0x521361,null));};exports[_0x4415('0x4e')]=function(_0x4ffc22,_0x2018b0,_0x52fb0b){if(_0x4ffc22[_0x4415('0x48')]['id']){delete _0x4ffc22[_0x4415('0x48')]['id'];}return db['ServicenowAccount'][_0x4415('0x4a')]({'where':{'id':_0x4ffc22[_0x4415('0x44')]['id']}})[_0x4415('0x25')](handleEntityNotFound(_0x2018b0,null))[_0x4415('0x25')](function(_0x1b047c){if(_0x1b047c){_0x4ffc22[_0x4415('0x48')][_0x4415('0x4f')]=_0x1b047c['id'];_0x4ffc22[_0x4415('0x48')][_0x4415('0x50')]=integrations[_0x4415('0x51')](_0x4ffc22[_0x4415('0x48')][_0x4415('0x52')],_0x4ffc22[_0x4415('0x48')]['type']);_0x4ffc22[_0x4415('0x48')]['Descriptions']=integrations['getDescriptions'](_0x4ffc22[_0x4415('0x48')][_0x4415('0x52')],_0x4ffc22[_0x4415('0x48')][_0x4415('0x2f')]);return db[_0x4415('0x4b')][_0x4415('0x47')](_0x4ffc22['body'],{'include':[{'model':db[_0x4415('0x53')],'as':_0x4415('0x50')},{'model':db[_0x4415('0x53')],'as':_0x4415('0x54')}]});}return null;})[_0x4415('0x25')](respondWithResult(_0x2018b0,null))[_0x4415('0x43')](handleError(_0x2018b0,null));};exports[_0x4415('0x55')]=function(_0xd86529,_0x55370b,_0xe355f){var _0x3b5612=['made_sla',_0x4415('0x56'),_0x4415('0x57'),_0x4415('0x58'),_0x4415('0x59'),'notify',_0x4415('0x5a'),'severity',_0x4415('0x5b')];var _0x4c707e=['parent',_0x4415('0x5c'),_0x4415('0x5d'),'watch_list',_0x4415('0x5e'),_0x4415('0x5f'),_0x4415('0x60'),_0x4415('0x56'),_0x4415('0x61'),_0x4415('0x62'),_0x4415('0x63'),_0x4415('0x64'),_0x4415('0x65'),_0x4415('0x66'),_0x4415('0x67'),_0x4415('0x68'),_0x4415('0x69'),_0x4415('0x6a'),_0x4415('0x57'),'order','calendar_stc',_0x4415('0x6b'),'cmdb_ci',_0x4415('0x6c'),_0x4415('0x6d'),'active',_0x4415('0x6e'),_0x4415('0x6f'),'priority','sys_domain_path',_0x4415('0x70'),_0x4415('0x71'),_0x4415('0x72'),_0x4415('0x73'),'business_duration',_0x4415('0x74'),_0x4415('0x75'),_0x4415('0x76'),_0x4415('0x77'),_0x4415('0x78'),_0x4415('0x79'),_0x4415('0x58'),'work_notes','short_description',_0x4415('0x59'),_0x4415('0x7a'),'delivery_task',_0x4415('0x7b'),_0x4415('0x7c'),_0x4415('0x7d'),'additional_assignee_list',_0x4415('0x7e'),_0x4415('0x7f'),_0x4415('0x80'),'sys_class_name',_0x4415('0x81'),_0x4415('0x82'),'follow_up',_0x4415('0x83'),_0x4415('0x84'),_0x4415('0x85'),'reopened_by',_0x4415('0x5a'),_0x4415('0x86'),'problem_id',_0x4415('0x87'),_0x4415('0x88'),_0x4415('0x89'),_0x4415('0x8a'),_0x4415('0x8b'),_0x4415('0x8c'),_0x4415('0x8d'),_0x4415('0x8e'),_0x4415('0x8f'),_0x4415('0x90'),_0x4415('0x91'),_0x4415('0x92'),_0x4415('0x93'),_0x4415('0x94'),'upon_approval',_0x4415('0x95'),'location','category'];var _0x34353d='';var _0x17eedc='';var _0x566583=[];var _0x23f659='';var _0x5e475e='';var _0x37067a=[];var _0x4d4fc2='';var _0x529230='';var _0x18802c={};var _0x1e840c='';return db[_0x4415('0x2d')]['findOne']({'where':{'id':_0xd86529[_0x4415('0x44')]['id']},'attributes':['id',_0x4415('0x96'),'password',_0x4415('0x97'),_0x4415('0x98'),'serverUrl']})['then'](handleEntityNotFound(_0x55370b,null))[_0x4415('0x25')](function(_0x1e5b2f){if(_0x1e5b2f){_0x1e840c=_0x1e5b2f[_0x4415('0x98')];var _0x123de5=_0x1e840c[_0x4415('0x99')](-0x1);if(_0x123de5==='/'){_0x1e840c=_0x1e840c['substring'](0x0,_0x1e840c[_0x4415('0x9a')](_0x123de5));}_0x529230=util[_0x4415('0x9b')](_0x4415('0x9c'),_0x1e840c);_0x4d4fc2=util[_0x4415('0x9b')](_0x4415('0x9d'),_0x1e840c);_0x18802c={'user':_0x1e5b2f[_0x4415('0x96')],'pass':_0x1e5b2f[_0x4415('0x9e')]};var _0x13080f={'method':'GET','uri':_0x529230+_0x4415('0x9f'),'auth':_0x18802c,'json':!![]};return rp(_0x13080f);}})[_0x4415('0x25')](function(_0x72b716){if(_0x72b716[_0x4415('0xa0')][_0x4415('0x37')]>0x0){_0x34353d=_0x72b716[_0x4415('0xa0')];}console['log'](_0x4415('0xa1'),_0x34353d);_0x37067a=[];_0x17eedc=Object[_0x4415('0xa2')]([],_0x34353d);_['remove'](_0x17eedc,function(_0x2e26b8){return!_0x3b5612[_0x4415('0xa3')](_0x2e26b8[_0x4415('0x29')]);});_0x17eedc[_0x4415('0xa4')](function(_0x10b58a){var _0x20670d=createFieldObject(_0x4d4fc2,_0x18802c,_0x10b58a[_0x4415('0xa5')],_0x10b58a[_0x4415('0x29')],_0x10b58a[_0x4415('0xa6')],![]);_0x37067a['push'](_0x20670d);});return Promise[_0x4415('0xa7')](_0x37067a);})[_0x4415('0x25')](function(_0x139a2e){_0x566583=_0x139a2e;_0x23f659=Object[_0x4415('0xa2')]([],_0x34353d);console[_0x4415('0xa8')](_0x4415('0xa9'),_0x34353d);_['remove'](_0x23f659,function(_0x2c309b){return _0x4c707e[_0x4415('0xa3')](_0x2c309b[_0x4415('0x29')]);});console[_0x4415('0xa8')](_0x4415('0xaa'),_0x23f659);_0x37067a=[];_0x23f659[_0x4415('0xa4')](function(_0x1a847a){var _0x10a58d=createFieldObject(_0x4d4fc2,_0x18802c,_0x1a847a[_0x4415('0xa5')],_0x1a847a['name'],_0x1a847a[_0x4415('0xa6')],!![]);_0x37067a[_0x4415('0xab')](_0x10a58d);});return Promise[_0x4415('0xa7')](_0x37067a);})[_0x4415('0x25')](function(_0x4d5bdb){_0x5e475e=_0x4d5bdb;var _0x3feca7=_0x566583['concat'](_0x5e475e);return{'count':_0x3feca7[_0x4415('0x37')],'rows':_0x3feca7};})[_0x4415('0x25')](respondWithResult(_0x55370b,null))[_0x4415('0x43')](function(_0xf4b8e9){console[_0x4415('0xa8')]('ServiceNow\x20error:\x20'+_0xf4b8e9);var _0x40c82f=_0xd86529['query']['test']?0x1f4:_0xf4b8e9[_0x4415('0xac')]||0x1f4;logger[_0x4415('0xad')](_0xf4b8e9[_0x4415('0x28')]);delete _0xf4b8e9['name'];if(_0x40c82f===0x191){_0x40c82f=0x190;}_0x55370b[_0x4415('0x19')](_0x40c82f)['send'](_0xd86529[_0x4415('0x32')][_0x4415('0xae')]?{'message':_0x4415('0xaf'),'statusCode':_0xf4b8e9[_0x4415('0xac')]}:_0xf4b8e9);});};function createFieldObject(_0x49dfd9,_0x42c111,_0x5486dc,_0x3c21ca,_0x3f966c,_0x4a20f5){return new Promise(function(_0x4a1af5,_0x44b74c){var _0x24a3f8={'id':_0x3c21ca,'name':_0x3f966c,'custom':_0x4a20f5};if(_0x5486dc===_0x4415('0xb0')){_0x24a3f8[_0x4415('0x3f')]=[{'name':_0x4415('0xb1'),'value':_0x4415('0xb2')},{'name':_0x4415('0xb3'),'value':_0x4415('0xb4')}];_0x4a1af5(_0x24a3f8);}else{var _0x2e2c7a={'method':_0x4415('0xb5'),'uri':_0x49dfd9+_0x4415('0xb6')+_0x3c21ca,'auth':_0x42c111,'json':!![]};return rp(_0x2e2c7a)[_0x4415('0x25')](function(_0x3c3b43){var _0x1f2862=[];if(_0x3c3b43[_0x4415('0xa0')][_0x4415('0x37')]>0x0){_0x3c3b43['result']['forEach'](function(_0x18f256){if(_0x18f256['inactive']==='false'){var _0x5b27c3={'name':_0x18f256['label'],'value':_0x18f256[_0x4415('0xb7')]};_0x1f2862[_0x4415('0xab')](_0x5b27c3);}});}_0x24a3f8[_0x4415('0x3f')]=_0x1f2862;if(_0x24a3f8[_0x4415('0x3f')][_0x4415('0x37')]>0x0){_0x4a1af5(_0x24a3f8);}else{if(_0x4a20f5==![]){_0x4a1af5();}else{_0x4a1af5(_0x24a3f8);}}});}});} \ No newline at end of file +var _0x1ee9=['then','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','key','query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','pick','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','keys','create','body','find','getConfigurations','findOne','filter','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ServicenowConfiguration','ServicenowField','Descriptions','hold_reason','close_code','incident_state','category','caused_by','sys_updated_on','approval_history','number','resolved_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','knowledge','calendar_stc','cmdb_ci','delivery_plan','active','work_notes_list','business_service','time_worked','expected_start','opened_at','resolved_at','caller_id','approval_set','subcategory','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','close_notes','closed_by','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','severity','comments','sla_due','comments_and_work_notes','due_date','sys_mod_count','sys_tags','escalation','upon_approval','correlation_id','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','username','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','remove','includes','forEach','label','push','all','assign','internalType','concat','ServiceNow\x20error:\x20','test','statusCode','error','stack','boolean','True','true','False','GET','inactive','false','value','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','update'];(function(_0x3a951c,_0x4578ed){var _0x4e59cc=function(_0x4dc957){while(--_0x4dc957){_0x3a951c['push'](_0x3a951c['shift']());}};_0x4e59cc(++_0x4578ed);}(_0x1ee9,0x146));var _0x91ee=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1ee9[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x91ee('0x0'));var rimraf=require(_0x91ee('0x1'));var zipdir=require(_0x91ee('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x91ee('0x3'));var moment=require(_0x91ee('0x4'));var BPromise=require(_0x91ee('0x5'));var Mustache=require(_0x91ee('0x6'));var util=require(_0x91ee('0x7'));var path=require('path');var sox=require(_0x91ee('0x8'));var csv=require('to-csv');var ejs=require(_0x91ee('0x9'));var fs=require('fs');var fs_extra=require(_0x91ee('0xa'));var _=require('lodash');var squel=require(_0x91ee('0xb'));var crypto=require(_0x91ee('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x91ee('0xd'));var toCsv=require('to-csv');var querystring=require(_0x91ee('0xe'));var Papa=require(_0x91ee('0xf'));var Redis=require(_0x91ee('0x10'));var authService=require(_0x91ee('0x11'));var qs=require(_0x91ee('0x12'));var as=require(_0x91ee('0x13'));var hardwareService=require(_0x91ee('0x14'));var logger=require(_0x91ee('0x15'))(_0x91ee('0x16'));var utils=require(_0x91ee('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x91ee('0x18'));var db=require(_0x91ee('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5309f1,_0x1e17af){_0x1e17af=_0x1e17af||0xcc;return function(_0x4bdba0){if(_0x4bdba0){return _0x5309f1[_0x91ee('0x1a')](_0x1e17af);}return _0x5309f1[_0x91ee('0x1b')](_0x1e17af)['end']();};}function respondWithResult(_0xd67107,_0x24d76c){_0x24d76c=_0x24d76c||0xc8;return function(_0x37da80){if(_0x37da80){return _0xd67107[_0x91ee('0x1b')](_0x24d76c)[_0x91ee('0x1c')](_0x37da80);}};}function respondWithFilteredResult(_0x193829,_0x70a61a){return function(_0x8cc085){if(_0x8cc085){var _0x1efb15=typeof _0x70a61a['offset']===_0x91ee('0x1d')&&typeof _0x70a61a['limit']===_0x91ee('0x1d');var _0x59d639=_0x8cc085[_0x91ee('0x1e')];var _0x323028=_0x1efb15?0x0:_0x70a61a[_0x91ee('0x1f')];var _0x3cfc3d=_0x1efb15?_0x8cc085[_0x91ee('0x1e')]:_0x70a61a['offset']+_0x70a61a[_0x91ee('0x20')];var _0x443b08;if(_0x3cfc3d>=_0x59d639){_0x3cfc3d=_0x59d639;_0x443b08=0xc8;}else{_0x443b08=0xce;}_0x193829[_0x91ee('0x1b')](_0x443b08);return _0x193829[_0x91ee('0x21')](_0x91ee('0x22'),_0x323028+'-'+_0x3cfc3d+'/'+_0x59d639)[_0x91ee('0x1c')](_0x8cc085);}return null;};}function patchUpdates(_0xe4211e){return function(_0x197d9e){try{jsonpatch['apply'](_0x197d9e,_0xe4211e,!![]);}catch(_0x2eea00){return BPromise[_0x91ee('0x23')](_0x2eea00);}return _0x197d9e[_0x91ee('0x24')]();};}function saveUpdates(_0x17f2d0,_0x2507e5){return function(_0x33660c){if(_0x33660c){return _0x33660c[_0x91ee('0x25')](_0x17f2d0)['then'](function(_0xb6a950){return _0xb6a950;});}return null;};}function removeEntity(_0x49aa99,_0x8ec6e0){return function(_0x4687aa){if(_0x4687aa){return _0x4687aa['destroy']()[_0x91ee('0x26')](function(){_0x49aa99[_0x91ee('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a7b84,_0x1c4ebc){return function(_0x3e9125){if(!_0x3e9125){_0x4a7b84[_0x91ee('0x1a')](0x194);}return _0x3e9125;};}function handleError(_0x2f612e,_0x2de40c){_0x2de40c=_0x2de40c||0x1f4;return function(_0x32793d){logger['error'](_0x32793d['stack']);if(_0x32793d[_0x91ee('0x27')]){delete _0x32793d[_0x91ee('0x27')];}_0x2f612e[_0x91ee('0x1b')](_0x2de40c)[_0x91ee('0x28')](_0x32793d);};}exports[_0x91ee('0x29')]=function(_0x2696f1,_0xba9d2c){var _0x5b8aa3={},_0x534b2f={},_0x546145={'count':0x0,'rows':[]};var _0x2fd329=_[_0x91ee('0x2a')](db[_0x91ee('0x2b')][_0x91ee('0x2c')],function(_0x184100){return{'name':_0x184100[_0x91ee('0x2d')],'type':_0x184100[_0x91ee('0x2e')][_0x91ee('0x2f')]};});_0x534b2f['model']=_[_0x91ee('0x2a')](_0x2fd329,_0x91ee('0x27'));_0x534b2f['query']=_['keys'](_0x2696f1[_0x91ee('0x30')]);_0x534b2f[_0x91ee('0x31')]=_['intersection'](_0x534b2f[_0x91ee('0x32')],_0x534b2f['query']);_0x5b8aa3[_0x91ee('0x33')]=_[_0x91ee('0x34')](_0x534b2f[_0x91ee('0x32')],qs[_0x91ee('0x35')](_0x2696f1['query'][_0x91ee('0x35')]));_0x5b8aa3[_0x91ee('0x33')]=_0x5b8aa3[_0x91ee('0x33')][_0x91ee('0x36')]?_0x5b8aa3[_0x91ee('0x33')]:_0x534b2f[_0x91ee('0x32')];if(!_0x2696f1[_0x91ee('0x30')]['hasOwnProperty'](_0x91ee('0x37'))){_0x5b8aa3[_0x91ee('0x20')]=qs[_0x91ee('0x20')](_0x2696f1[_0x91ee('0x30')][_0x91ee('0x20')]);_0x5b8aa3['offset']=qs['offset'](_0x2696f1['query'][_0x91ee('0x1f')]);}_0x5b8aa3[_0x91ee('0x38')]=qs['sort'](_0x2696f1[_0x91ee('0x30')][_0x91ee('0x39')]);_0x5b8aa3[_0x91ee('0x3a')]=qs[_0x91ee('0x31')](_[_0x91ee('0x3b')](_0x2696f1['query'],_0x534b2f[_0x91ee('0x31')]),_0x2fd329);if(_0x2696f1[_0x91ee('0x30')]['filter']){_0x5b8aa3[_0x91ee('0x3a')]=_['merge'](_0x5b8aa3[_0x91ee('0x3a')],{'$or':_[_0x91ee('0x2a')](_0x2fd329,function(_0x4d1dbc){if(_0x4d1dbc['type']!==_0x91ee('0x3c')){var _0x27c64b={};_0x27c64b[_0x4d1dbc['name']]={'$like':'%'+_0x2696f1['query']['filter']+'%'};return _0x27c64b;}})});}_0x5b8aa3=_[_0x91ee('0x3d')]({},_0x5b8aa3,_0x2696f1[_0x91ee('0x3e')]);var _0x846a6={'where':_0x5b8aa3[_0x91ee('0x3a')]};return db['ServicenowAccount'][_0x91ee('0x1e')](_0x846a6)[_0x91ee('0x26')](function(_0x5815bb){_0x546145[_0x91ee('0x1e')]=_0x5815bb;if(_0x2696f1['query'][_0x91ee('0x3f')]){_0x5b8aa3[_0x91ee('0x40')]=[{'all':!![]}];}return db[_0x91ee('0x2b')][_0x91ee('0x41')](_0x5b8aa3);})[_0x91ee('0x26')](function(_0x5ded6b){_0x546145['rows']=_0x5ded6b;return _0x546145;})[_0x91ee('0x26')](respondWithFilteredResult(_0xba9d2c,_0x5b8aa3))[_0x91ee('0x42')](handleError(_0xba9d2c,null));};exports[_0x91ee('0x43')]=function(_0x241d11,_0x5b9833){var _0x246a1f={'raw':![],'where':{'id':_0x241d11[_0x91ee('0x44')]['id']}},_0xda4409={};_0xda4409[_0x91ee('0x32')]=_[_0x91ee('0x45')](db[_0x91ee('0x2b')][_0x91ee('0x2c')]);_0xda4409['query']=_[_0x91ee('0x45')](_0x241d11['query']);_0xda4409[_0x91ee('0x31')]=_[_0x91ee('0x34')](_0xda4409[_0x91ee('0x32')],_0xda4409[_0x91ee('0x30')]);_0x246a1f[_0x91ee('0x33')]=_[_0x91ee('0x34')](_0xda4409[_0x91ee('0x32')],qs[_0x91ee('0x35')](_0x241d11[_0x91ee('0x30')][_0x91ee('0x35')]));_0x246a1f['attributes']=_0x246a1f['attributes'][_0x91ee('0x36')]?_0x246a1f[_0x91ee('0x33')]:_0xda4409[_0x91ee('0x32')];if(_0x241d11['query'][_0x91ee('0x3f')]){_0x246a1f['include']=[{'all':!![]}];}_0x246a1f=_['merge']({},_0x246a1f,_0x241d11[_0x91ee('0x3e')]);return db[_0x91ee('0x2b')]['find'](_0x246a1f)[_0x91ee('0x26')](handleEntityNotFound(_0x5b9833,null))[_0x91ee('0x26')](respondWithResult(_0x5b9833,null))[_0x91ee('0x42')](handleError(_0x5b9833,null));};exports[_0x91ee('0x46')]=function(_0x37ae7c,_0x3c9fc8){return db[_0x91ee('0x2b')][_0x91ee('0x46')](_0x37ae7c[_0x91ee('0x47')],{})[_0x91ee('0x26')](respondWithResult(_0x3c9fc8,0xc9))['catch'](handleError(_0x3c9fc8,null));};exports[_0x91ee('0x25')]=function(_0x1b5c91,_0x11b3bd){if(_0x1b5c91[_0x91ee('0x47')]['id']){delete _0x1b5c91['body']['id'];}return db['ServicenowAccount'][_0x91ee('0x48')]({'where':{'id':_0x1b5c91['params']['id']}})[_0x91ee('0x26')](handleEntityNotFound(_0x11b3bd,null))[_0x91ee('0x26')](saveUpdates(_0x1b5c91['body'],null))[_0x91ee('0x26')](respondWithResult(_0x11b3bd,null))[_0x91ee('0x42')](handleError(_0x11b3bd,null));};exports['destroy']=function(_0x5685bf,_0x130e69){return db[_0x91ee('0x2b')][_0x91ee('0x48')]({'where':{'id':_0x5685bf[_0x91ee('0x44')]['id']}})['then'](handleEntityNotFound(_0x130e69,null))[_0x91ee('0x26')](removeEntity(_0x130e69,null))['catch'](handleError(_0x130e69,null));};exports[_0x91ee('0x49')]=function(_0x35f688,_0x2981cf,_0x33e416){var _0x5a9cd2={};var _0x24f9c1={};var _0x9c485e;var _0x4e9f65;return db[_0x91ee('0x2b')][_0x91ee('0x4a')]({'where':{'id':_0x35f688[_0x91ee('0x44')]['id']}})[_0x91ee('0x26')](handleEntityNotFound(_0x2981cf,null))[_0x91ee('0x26')](function(_0xceca82){if(_0xceca82){_0x9c485e=_0xceca82;_0x24f9c1[_0x91ee('0x32')]=_['keys'](db['ServicenowConfiguration'][_0x91ee('0x2c')]);_0x24f9c1[_0x91ee('0x30')]=_[_0x91ee('0x45')](_0x35f688['query']);_0x24f9c1['filters']=_[_0x91ee('0x34')](_0x24f9c1['model'],_0x24f9c1[_0x91ee('0x30')]);_0x5a9cd2[_0x91ee('0x33')]=_[_0x91ee('0x34')](_0x24f9c1[_0x91ee('0x32')],qs['fields'](_0x35f688[_0x91ee('0x30')]['fields']));_0x5a9cd2['attributes']=_0x5a9cd2[_0x91ee('0x33')][_0x91ee('0x36')]?_0x5a9cd2[_0x91ee('0x33')]:_0x24f9c1[_0x91ee('0x32')];_0x5a9cd2[_0x91ee('0x38')]=qs['sort'](_0x35f688[_0x91ee('0x30')][_0x91ee('0x39')]);_0x5a9cd2[_0x91ee('0x3a')]=qs['filters'](_[_0x91ee('0x3b')](_0x35f688[_0x91ee('0x30')],_0x24f9c1['filters']));if(_0x35f688['query'][_0x91ee('0x4b')]){_0x5a9cd2[_0x91ee('0x3a')]=_[_0x91ee('0x3d')](_0x5a9cd2[_0x91ee('0x3a')],{'$or':_['map'](_0x5a9cd2['attributes'],function(_0x5e6b04){var _0x5463d9={};_0x5463d9[_0x5e6b04]={'$like':'%'+_0x35f688[_0x91ee('0x30')]['filter']+'%'};return _0x5463d9;})});}_0x5a9cd2=_[_0x91ee('0x3d')]({},_0x5a9cd2,_0x35f688[_0x91ee('0x3e')]);return _0x9c485e[_0x91ee('0x49')](_0x5a9cd2);}})['then'](function(_0x5600ba){if(_0x5600ba){_0x4e9f65=_0x5600ba['length'];if(!_0x35f688[_0x91ee('0x30')][_0x91ee('0x4c')]('nolimit')){_0x5a9cd2['limit']=qs[_0x91ee('0x20')](_0x35f688[_0x91ee('0x30')][_0x91ee('0x20')]);_0x5a9cd2[_0x91ee('0x1f')]=qs[_0x91ee('0x1f')](_0x35f688[_0x91ee('0x30')][_0x91ee('0x1f')]);}return _0x9c485e[_0x91ee('0x49')](_0x5a9cd2);}})[_0x91ee('0x26')](function(_0x3d33d3){if(_0x3d33d3){return _0x3d33d3?{'count':_0x4e9f65,'rows':_0x3d33d3}:null;}})[_0x91ee('0x26')](respondWithResult(_0x2981cf,null))[_0x91ee('0x42')](handleError(_0x2981cf,null));};exports[_0x91ee('0x4d')]=function(_0x3d5242,_0x27a494,_0x141818){if(_0x3d5242[_0x91ee('0x47')]['id']){delete _0x3d5242['body']['id'];}return db['ServicenowAccount'][_0x91ee('0x4a')]({'where':{'id':_0x3d5242[_0x91ee('0x44')]['id']}})['then'](handleEntityNotFound(_0x27a494,null))['then'](function(_0x1910e1){if(_0x1910e1){_0x3d5242[_0x91ee('0x47')][_0x91ee('0x4e')]=_0x1910e1['id'];_0x3d5242[_0x91ee('0x47')][_0x91ee('0x4f')]=integrations[_0x91ee('0x50')](_0x3d5242[_0x91ee('0x47')][_0x91ee('0x51')],_0x3d5242[_0x91ee('0x47')][_0x91ee('0x2e')]);_0x3d5242[_0x91ee('0x47')]['Descriptions']=integrations[_0x91ee('0x52')](_0x3d5242[_0x91ee('0x47')][_0x91ee('0x51')],_0x3d5242[_0x91ee('0x47')][_0x91ee('0x2e')]);return db[_0x91ee('0x53')]['create'](_0x3d5242[_0x91ee('0x47')],{'include':[{'model':db['ServicenowField'],'as':_0x91ee('0x4f')},{'model':db[_0x91ee('0x54')],'as':_0x91ee('0x55')}]});}return null;})[_0x91ee('0x26')](respondWithResult(_0x27a494,null))[_0x91ee('0x42')](handleError(_0x27a494,null));};exports['getFields']=function(_0x5e22de,_0x3235ee,_0x263631){var _0x12448b=['made_sla',_0x91ee('0x56'),'knowledge','subcategory',_0x91ee('0x57'),'notify',_0x91ee('0x58'),'severity',_0x91ee('0x59')];var _0x27c217=['parent','made_sla',_0x91ee('0x5a'),'watch_list','upon_reject',_0x91ee('0x5b'),'child_incidents',_0x91ee('0x56'),_0x91ee('0x5c'),_0x91ee('0x5d'),_0x91ee('0x5e'),'sys_updated_by',_0x91ee('0x5f'),_0x91ee('0x60'),_0x91ee('0x61'),_0x91ee('0x62'),_0x91ee('0x63'),_0x91ee('0x64'),_0x91ee('0x65'),'order',_0x91ee('0x66'),'closed_at',_0x91ee('0x67'),_0x91ee('0x68'),'impact',_0x91ee('0x69'),_0x91ee('0x6a'),_0x91ee('0x6b'),'priority','sys_domain_path','rfc',_0x91ee('0x6c'),_0x91ee('0x6d'),_0x91ee('0x6e'),'business_duration','group_list','work_end','reopened_time',_0x91ee('0x6f'),_0x91ee('0x70'),_0x91ee('0x71'),_0x91ee('0x72'),_0x91ee('0x73'),_0x91ee('0x74'),_0x91ee('0x57'),_0x91ee('0x75'),_0x91ee('0x76'),_0x91ee('0x77'),_0x91ee('0x78'),_0x91ee('0x79'),_0x91ee('0x7a'),_0x91ee('0x7b'),_0x91ee('0x7c'),'notify','sys_class_name',_0x91ee('0x7d'),_0x91ee('0x7e'),'follow_up','parent_incident',_0x91ee('0x7f'),_0x91ee('0x80'),_0x91ee('0x81'),_0x91ee('0x58'),_0x91ee('0x82'),_0x91ee('0x83'),_0x91ee('0x84'),_0x91ee('0x85'),_0x91ee('0x86'),_0x91ee('0x87'),_0x91ee('0x88'),_0x91ee('0x89'),_0x91ee('0x8a'),'approval',_0x91ee('0x8b'),_0x91ee('0x8c'),_0x91ee('0x8d'),'reopen_count',_0x91ee('0x8e'),_0x91ee('0x8f'),_0x91ee('0x90'),_0x91ee('0x91'),'location',_0x91ee('0x59')];var _0xac127a='';var _0x1894ce='';var _0x2c1f24=[];var _0x135222='';var _0x4da3c0='';var _0x52acc6=[];var _0x100429='';var _0x22a98e='';var _0xc2ede3={};var _0x416482='';return db[_0x91ee('0x2b')][_0x91ee('0x4a')]({'where':{'id':_0x5e22de[_0x91ee('0x44')]['id']},'attributes':['id','username',_0x91ee('0x92'),_0x91ee('0x93'),_0x91ee('0x94'),_0x91ee('0x95')]})[_0x91ee('0x26')](handleEntityNotFound(_0x3235ee,null))[_0x91ee('0x26')](function(_0x225d26){if(_0x225d26){_0x416482=_0x225d26['remoteUri'];var _0x274a16=_0x416482[_0x91ee('0x96')](-0x1);if(_0x274a16==='/'){_0x416482=_0x416482[_0x91ee('0x97')](0x0,_0x416482[_0x91ee('0x98')](_0x274a16));}_0x22a98e=util[_0x91ee('0x99')](_0x91ee('0x9a'),_0x416482);_0x100429=util[_0x91ee('0x99')]('%s/api/now/table/',_0x416482);_0xc2ede3={'user':_0x225d26[_0x91ee('0x9b')],'pass':_0x225d26[_0x91ee('0x92')]};var _0x4ce847={'method':'GET','uri':_0x22a98e+_0x91ee('0x9c'),'auth':_0xc2ede3,'json':!![]};return rp(_0x4ce847);}})[_0x91ee('0x26')](function(_0x4fd51e){if(_0x4fd51e['result'][_0x91ee('0x36')]>0x0){_0xac127a=_0x4fd51e[_0x91ee('0x9d')];}console[_0x91ee('0x9e')](_0x91ee('0x9f'),_0xac127a);_0x52acc6=[];_0x1894ce=Object['assign']([],_0xac127a);_[_0x91ee('0xa0')](_0x1894ce,function(_0x151796){return!_0x12448b[_0x91ee('0xa1')](_0x151796[_0x91ee('0x27')]);});_0x1894ce[_0x91ee('0xa2')](function(_0x381247){var _0x5c5405=createFieldObject(_0x100429,_0xc2ede3,_0x381247['internalType'],_0x381247[_0x91ee('0x27')],_0x381247[_0x91ee('0xa3')],![]);_0x52acc6[_0x91ee('0xa4')](_0x5c5405);});return Promise[_0x91ee('0xa5')](_0x52acc6);})['then'](function(_0x463fa4){_0x2c1f24=_0x463fa4;_0x135222=Object[_0x91ee('0xa6')]([],_0xac127a);console[_0x91ee('0x9e')]('TCL:\x20_object',_0xac127a);_[_0x91ee('0xa0')](_0x135222,function(_0x201054){return _0x27c217['includes'](_0x201054['name']);});console[_0x91ee('0x9e')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x135222);_0x52acc6=[];_0x135222[_0x91ee('0xa2')](function(_0x4aa40e){var _0x180f9d=createFieldObject(_0x100429,_0xc2ede3,_0x4aa40e[_0x91ee('0xa7')],_0x4aa40e[_0x91ee('0x27')],_0x4aa40e[_0x91ee('0xa3')],!![]);_0x52acc6[_0x91ee('0xa4')](_0x180f9d);});return Promise[_0x91ee('0xa5')](_0x52acc6);})[_0x91ee('0x26')](function(_0x39a49b){_0x4da3c0=_0x39a49b;var _0x5af983=_0x2c1f24[_0x91ee('0xa8')](_0x4da3c0);return{'count':_0x5af983[_0x91ee('0x36')],'rows':_0x5af983};})[_0x91ee('0x26')](respondWithResult(_0x3235ee,null))[_0x91ee('0x42')](function(_0x88892c){console[_0x91ee('0x9e')](_0x91ee('0xa9')+_0x88892c);var _0x395ccd=_0x5e22de['query'][_0x91ee('0xaa')]?0x1f4:_0x88892c[_0x91ee('0xab')]||0x1f4;logger[_0x91ee('0xac')](_0x88892c[_0x91ee('0xad')]);delete _0x88892c[_0x91ee('0x27')];if(_0x395ccd===0x191){_0x395ccd=0x190;}_0x3235ee[_0x91ee('0x1b')](_0x395ccd)[_0x91ee('0x28')](_0x5e22de[_0x91ee('0x30')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x88892c['statusCode']}:_0x88892c);});};function createFieldObject(_0x5a1fb4,_0x2bd01f,_0x3eabf1,_0x527636,_0x17ea37,_0x3df23f){return new Promise(function(_0x1700fd,_0x2e18c0){var _0x45326f={'id':_0x527636,'name':_0x17ea37,'custom':_0x3df23f};if(_0x3eabf1===_0x91ee('0xae')){_0x45326f[_0x91ee('0x3e')]=[{'name':_0x91ee('0xaf'),'value':_0x91ee('0xb0')},{'name':_0x91ee('0xb1'),'value':'false'}];_0x1700fd(_0x45326f);}else{var _0x2046a5={'method':_0x91ee('0xb2'),'uri':_0x5a1fb4+'sys_choice?sysparm_query=name=incident^element='+_0x527636,'auth':_0x2bd01f,'json':!![]};return rp(_0x2046a5)[_0x91ee('0x26')](function(_0xffae9b){var _0x1b3b9f=[];if(_0xffae9b[_0x91ee('0x9d')][_0x91ee('0x36')]>0x0){_0xffae9b[_0x91ee('0x9d')][_0x91ee('0xa2')](function(_0x2e2eba){if(_0x2e2eba[_0x91ee('0xb3')]===_0x91ee('0xb4')){var _0x71a8f4={'name':_0x2e2eba['label'],'value':_0x2e2eba[_0x91ee('0xb5')]};_0x1b3b9f[_0x91ee('0xa4')](_0x71a8f4);}});}_0x45326f['options']=_0x1b3b9f;if(_0x45326f[_0x91ee('0x3e')][_0x91ee('0x36')]>0x0){_0x1700fd(_0x45326f);}else{if(_0x3df23f==![]){_0x1700fd();}else{_0x1700fd(_0x45326f);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 577061d..7d95e4f 100644 --- a/server/api/intServicenowAccount/intServicenowAccount.model.js +++ b/server/api/intServicenowAccount/intServicenowAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','ServicenowAccount','int_servicenow_accounts'];(function(_0x4599b6,_0x40c254){var _0x2e014c=function(_0x3c4d90){while(--_0x3c4d90){_0x4599b6['push'](_0x4599b6['shift']());}};_0x2e014c(++_0x40c254);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4bdf64,_0x3022b2){_0x4bdf64=_0x4bdf64-0x0;var _0x9a1a19=_0x5fc3[_0x4bdf64];return _0x9a1a19;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));var integrations=require(_0x35fc('0x9'));module['exports']=function(_0x5754be,_0x19a0d1){return _0x5754be['define'](_0x35fc('0xa'),attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x187d=['exports','define','ServicenowAccount','int_servicenow_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intServicenowAccount.attributes'];(function(_0x2bae44,_0x33f37a){var _0x1e111b=function(_0x4f4cfa){while(--_0x4f4cfa){_0x2bae44['push'](_0x2bae44['shift']());}};_0x1e111b(++_0x33f37a);}(_0x187d,0x93));var _0xd187=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x187d[_0x2b5eae];return _0x5f3ac9;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var logger=require(_0xd187('0x1'))(_0xd187('0x2'));var moment=require(_0xd187('0x3'));var BPromise=require(_0xd187('0x4'));var rp=require(_0xd187('0x5'));var fs=require('fs');var path=require(_0xd187('0x6'));var rimraf=require('rimraf');var config=require(_0xd187('0x7'));var attributes=require(_0xd187('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xd187('0x9')]=function(_0x58ee7,_0x444a60){return _0x58ee7[_0xd187('0xa')](_0xd187('0xb'),attributes,{'tableName':_0xd187('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index aec47df..a009da7 100644 --- a/server/api/intServicenowAccount/intServicenowAccount.rpc.js +++ b/server/api/intServicenowAccount/intServicenowAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4cf3=['../../config/logger','rpc','client','http','then','info','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','ServicenowAccount,\x20%s,\x20%s','result','ServicenowAccount','findAll','options','raw','where','attributes','limit','include','model','GetServicenowAccount','ShowServicenowAccount','find','map','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x5e5671,_0x457d56){var _0x3035f8=function(_0x3397e4){while(--_0x3397e4){_0x5e5671['push'](_0x5e5671['shift']());}};_0x3035f8(++_0x457d56);}(_0x4cf3,0x15b));var _0x34cf=function(_0x188f21,_0x2fe457){_0x188f21=_0x188f21-0x0;var _0x3391e0=_0x4cf3[_0x188f21];return _0x3391e0;};'use strict';var _=require('lodash');var util=require(_0x34cf('0x0'));var moment=require(_0x34cf('0x1'));var BPromise=require('bluebird');var rs=require(_0x34cf('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x34cf('0x3'))['db'];var utils=require(_0x34cf('0x4'));var logger=require(_0x34cf('0x5'))(_0x34cf('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x34cf('0x7')][_0x34cf('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x321ada,_0xf1c572,_0x46e1bb){return new BPromise(function(_0x129479,_0x3e63c6){return client['request'](_0x321ada,_0x46e1bb)[_0x34cf('0x9')](function(_0x75c071){logger[_0x34cf('0xa')]('ServicenowAccount,\x20%s,\x20%s',_0xf1c572,_0x34cf('0xb'));logger[_0x34cf('0xc')](_0x34cf('0xd'),_0xf1c572,'request\x20sent',JSON[_0x34cf('0xe')](_0x75c071));if(_0x75c071[_0x34cf('0xf')]){if(_0x75c071[_0x34cf('0xf')]['code']===0x1f4){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0xf1c572,_0x75c071[_0x34cf('0xf')][_0x34cf('0x10')]);return _0x3e63c6(_0x75c071[_0x34cf('0xf')][_0x34cf('0x10')]);}logger['error']('ServicenowAccount,\x20%s,\x20%s',_0xf1c572,_0x75c071[_0x34cf('0xf')]['message']);return _0x129479(_0x75c071[_0x34cf('0xf')]['message']);}else{logger[_0x34cf('0xa')](_0x34cf('0x11'),_0xf1c572,_0x34cf('0xb'));_0x129479(_0x75c071[_0x34cf('0x12')][_0x34cf('0x10')]);}})['catch'](function(_0x436b4a){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0xf1c572,_0x436b4a);_0x3e63c6(_0x436b4a);});});}exports['GetServicenowAccount']=function(_0x4e0924){var _0x47683c=this;return new Promise(function(_0x3a3172,_0x1358e1){return db[_0x34cf('0x13')][_0x34cf('0x14')]({'raw':_0x4e0924[_0x34cf('0x15')]?_0x4e0924[_0x34cf('0x15')][_0x34cf('0x16')]===undefined?!![]:![]:!![],'where':_0x4e0924['options']?_0x4e0924[_0x34cf('0x15')][_0x34cf('0x17')]||null:null,'attributes':_0x4e0924[_0x34cf('0x15')]?_0x4e0924['options'][_0x34cf('0x18')]||null:null,'limit':_0x4e0924[_0x34cf('0x15')]?_0x4e0924[_0x34cf('0x15')][_0x34cf('0x19')]||null:null,'include':_0x4e0924[_0x34cf('0x15')]?_0x4e0924[_0x34cf('0x15')][_0x34cf('0x1a')]?_['map'](_0x4e0924[_0x34cf('0x15')]['include'],function(_0x47d2cc){return{'model':db[_0x47d2cc[_0x34cf('0x1b')]],'as':_0x47d2cc['as'],'attributes':_0x47d2cc[_0x34cf('0x18')],'include':_0x47d2cc['include']?_['map'](_0x47d2cc[_0x34cf('0x1a')],function(_0x2e6386){return{'model':db[_0x2e6386[_0x34cf('0x1b')]],'as':_0x2e6386['as'],'attributes':_0x2e6386[_0x34cf('0x18')],'include':_0x2e6386[_0x34cf('0x1a')]?_['map'](_0x2e6386[_0x34cf('0x1a')],function(_0x41cb63){return{'model':db[_0x41cb63['model']],'as':_0x41cb63['as'],'attributes':_0x41cb63[_0x34cf('0x18')]};}):[]};}):[]};}):[]:[]})[_0x34cf('0x9')](function(_0x528fad){logger[_0x34cf('0xa')](_0x34cf('0x1c'),_0x4e0924);logger[_0x34cf('0xc')](_0x34cf('0x1c'),_0x4e0924,JSON[_0x34cf('0xe')](_0x528fad));_0x3a3172(_0x528fad);})['catch'](function(_0x32df47){logger[_0x34cf('0xf')](_0x34cf('0x1c'),_0x32df47[_0x34cf('0x10')],_0x4e0924);_0x1358e1(_0x47683c[_0x34cf('0xf')](0x1f4,_0x32df47['message']));});});};exports[_0x34cf('0x1d')]=function(_0x54a3e7){var _0x58d15a=this;return new Promise(function(_0xd792e2,_0x17f749){return db[_0x34cf('0x13')][_0x34cf('0x1e')]({'raw':_0x54a3e7[_0x34cf('0x15')]?_0x54a3e7[_0x34cf('0x15')][_0x34cf('0x16')]===undefined?!![]:![]:!![],'where':_0x54a3e7[_0x34cf('0x15')]?_0x54a3e7['options']['where']||null:null,'attributes':_0x54a3e7[_0x34cf('0x15')]?_0x54a3e7[_0x34cf('0x15')][_0x34cf('0x18')]||null:null,'include':_0x54a3e7[_0x34cf('0x15')]?_0x54a3e7['options'][_0x34cf('0x1a')]?_['map'](_0x54a3e7[_0x34cf('0x15')][_0x34cf('0x1a')],function(_0x4d7e9e){return{'model':db[_0x4d7e9e[_0x34cf('0x1b')]],'as':_0x4d7e9e['as'],'attributes':_0x4d7e9e[_0x34cf('0x18')],'include':_0x4d7e9e[_0x34cf('0x1a')]?_[_0x34cf('0x1f')](_0x4d7e9e[_0x34cf('0x1a')],function(_0x25cf9f){return{'model':db[_0x25cf9f[_0x34cf('0x1b')]],'as':_0x25cf9f['as'],'attributes':_0x25cf9f[_0x34cf('0x18')],'include':_0x25cf9f[_0x34cf('0x1a')]?_[_0x34cf('0x1f')](_0x25cf9f[_0x34cf('0x1a')],function(_0x2420b0){return{'model':db[_0x2420b0[_0x34cf('0x1b')]],'as':_0x2420b0['as'],'attributes':_0x2420b0['attributes']};}):[]};}):[]};}):[]:[]})[_0x34cf('0x9')](function(_0x38340f){logger['info'](_0x34cf('0x1d'),_0x54a3e7);logger[_0x34cf('0xc')]('ShowServicenowAccount',_0x54a3e7,JSON['stringify'](_0x38340f));_0xd792e2(_0x38340f);})['catch'](function(_0x1ab092){logger['error'](_0x34cf('0x1d'),_0x1ab092[_0x34cf('0x10')],_0x54a3e7);_0x17f749(_0x58d15a[_0x34cf('0xf')](0x1f4,_0x1ab092[_0x34cf('0x10')]));});});}; \ No newline at end of file +var _0xf609=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','message','catch','GetServicenowAccount','ServicenowAccount','options','raw','limit','include','attributes','map','model','debug','stringify','ShowServicenowAccount','find','where'];(function(_0x3337b6,_0x42c7f9){var _0x568270=function(_0x56e5df){while(--_0x56e5df){_0x3337b6['push'](_0x3337b6['shift']());}};_0x568270(++_0x42c7f9);}(_0xf609,0x1dc));var _0x9f60=function(_0x27a7ef,_0x535ca6){_0x27a7ef=_0x27a7ef-0x0;var _0x304c0a=_0xf609[_0x27a7ef];return _0x304c0a;};'use strict';var _=require(_0x9f60('0x0'));var util=require(_0x9f60('0x1'));var moment=require('moment');var BPromise=require(_0x9f60('0x2'));var rs=require(_0x9f60('0x3'));var fs=require('fs');var Redis=require(_0x9f60('0x4'));var db=require(_0x9f60('0x5'))['db'];var utils=require(_0x9f60('0x6'));var logger=require(_0x9f60('0x7'))(_0x9f60('0x8'));var config=require(_0x9f60('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9f60('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45e10e,_0x122a43,_0x17c115){return new BPromise(function(_0x15db4f,_0x6198b6){return client[_0x9f60('0xb')](_0x45e10e,_0x17c115)[_0x9f60('0xc')](function(_0x3f7d42){logger[_0x9f60('0xd')](_0x9f60('0xe'),_0x122a43,_0x9f60('0xf'));logger['debug'](_0x9f60('0x10'),_0x122a43,'request\x20sent',JSON['stringify'](_0x3f7d42));if(_0x3f7d42[_0x9f60('0x11')]){if(_0x3f7d42['error']['code']===0x1f4){logger[_0x9f60('0x11')](_0x9f60('0xe'),_0x122a43,_0x3f7d42['error'][_0x9f60('0x12')]);return _0x6198b6(_0x3f7d42[_0x9f60('0x11')][_0x9f60('0x12')]);}logger[_0x9f60('0x11')](_0x9f60('0xe'),_0x122a43,_0x3f7d42[_0x9f60('0x11')][_0x9f60('0x12')]);return _0x15db4f(_0x3f7d42[_0x9f60('0x11')][_0x9f60('0x12')]);}else{logger[_0x9f60('0xd')](_0x9f60('0xe'),_0x122a43,'request\x20sent');_0x15db4f(_0x3f7d42['result'][_0x9f60('0x12')]);}})[_0x9f60('0x13')](function(_0x2b3060){logger[_0x9f60('0x11')](_0x9f60('0xe'),_0x122a43,_0x2b3060);_0x6198b6(_0x2b3060);});});}exports[_0x9f60('0x14')]=function(_0x28320e){var _0x742234=this;return new Promise(function(_0x50e96f,_0x534fa6){return db[_0x9f60('0x15')]['findAll']({'raw':_0x28320e['options']?_0x28320e[_0x9f60('0x16')][_0x9f60('0x17')]===undefined?!![]:![]:!![],'where':_0x28320e[_0x9f60('0x16')]?_0x28320e[_0x9f60('0x16')]['where']||null:null,'attributes':_0x28320e['options']?_0x28320e[_0x9f60('0x16')]['attributes']||null:null,'limit':_0x28320e[_0x9f60('0x16')]?_0x28320e['options'][_0x9f60('0x18')]||null:null,'include':_0x28320e['options']?_0x28320e['options'][_0x9f60('0x19')]?_['map'](_0x28320e[_0x9f60('0x16')]['include'],function(_0x55a38e){return{'model':db[_0x55a38e['model']],'as':_0x55a38e['as'],'attributes':_0x55a38e[_0x9f60('0x1a')],'include':_0x55a38e[_0x9f60('0x19')]?_[_0x9f60('0x1b')](_0x55a38e[_0x9f60('0x19')],function(_0x17d384){return{'model':db[_0x17d384[_0x9f60('0x1c')]],'as':_0x17d384['as'],'attributes':_0x17d384['attributes'],'include':_0x17d384[_0x9f60('0x19')]?_[_0x9f60('0x1b')](_0x17d384[_0x9f60('0x19')],function(_0x3664ec){return{'model':db[_0x3664ec[_0x9f60('0x1c')]],'as':_0x3664ec['as'],'attributes':_0x3664ec['attributes']};}):[]};}):[]};}):[]:[]})[_0x9f60('0xc')](function(_0x51993e){logger[_0x9f60('0xd')]('GetServicenowAccount',_0x28320e);logger[_0x9f60('0x1d')](_0x9f60('0x14'),_0x28320e,JSON[_0x9f60('0x1e')](_0x51993e));_0x50e96f(_0x51993e);})['catch'](function(_0xaba1){logger['error'](_0x9f60('0x14'),_0xaba1['message'],_0x28320e);_0x534fa6(_0x742234[_0x9f60('0x11')](0x1f4,_0xaba1[_0x9f60('0x12')]));});});};exports[_0x9f60('0x1f')]=function(_0x3f88f9){var _0x369505=this;return new Promise(function(_0x181fa9,_0x4f5afa){return db[_0x9f60('0x15')][_0x9f60('0x20')]({'raw':_0x3f88f9[_0x9f60('0x16')]?_0x3f88f9[_0x9f60('0x16')][_0x9f60('0x17')]===undefined?!![]:![]:!![],'where':_0x3f88f9[_0x9f60('0x16')]?_0x3f88f9[_0x9f60('0x16')][_0x9f60('0x21')]||null:null,'attributes':_0x3f88f9[_0x9f60('0x16')]?_0x3f88f9[_0x9f60('0x16')][_0x9f60('0x1a')]||null:null,'include':_0x3f88f9[_0x9f60('0x16')]?_0x3f88f9[_0x9f60('0x16')]['include']?_[_0x9f60('0x1b')](_0x3f88f9['options'][_0x9f60('0x19')],function(_0x4205ba){return{'model':db[_0x4205ba[_0x9f60('0x1c')]],'as':_0x4205ba['as'],'attributes':_0x4205ba['attributes'],'include':_0x4205ba['include']?_['map'](_0x4205ba['include'],function(_0x4cd8f9){return{'model':db[_0x4cd8f9[_0x9f60('0x1c')]],'as':_0x4cd8f9['as'],'attributes':_0x4cd8f9[_0x9f60('0x1a')],'include':_0x4cd8f9[_0x9f60('0x19')]?_[_0x9f60('0x1b')](_0x4cd8f9[_0x9f60('0x19')],function(_0x3707d5){return{'model':db[_0x3707d5[_0x9f60('0x1c')]],'as':_0x3707d5['as'],'attributes':_0x3707d5[_0x9f60('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9f60('0xc')](function(_0x523274){logger[_0x9f60('0xd')](_0x9f60('0x1f'),_0x3f88f9);logger[_0x9f60('0x1d')]('ShowServicenowAccount',_0x3f88f9,JSON[_0x9f60('0x1e')](_0x523274));_0x181fa9(_0x523274);})[_0x9f60('0x13')](function(_0x328acc){logger[_0x9f60('0x11')](_0x9f60('0x1f'),_0x328acc[_0x9f60('0x12')],_0x3f88f9);_0x4f5afa(_0x369505[_0x9f60('0x11')](0x1f4,_0x328acc[_0x9f60('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 55fb38e..f787459 100644 --- a/server/api/intServicenowConfiguration/index.js +++ b/server/api/intServicenowConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3910=['show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','isAuthenticated','index','get','/:id'];(function(_0x1e7bc9,_0x39582e){var _0x211fab=function(_0x159635){while(--_0x159635){_0x1e7bc9['push'](_0x1e7bc9['shift']());}};_0x211fab(++_0x39582e);}(_0x3910,0x1d8));var _0x0391=function(_0x10ac4a,_0x27340b){_0x10ac4a=_0x10ac4a-0x0;var _0x5e7b1e=_0x3910[_0x10ac4a];return _0x5e7b1e;};'use strict';var multer=require(_0x0391('0x0'));var util=require(_0x0391('0x1'));var path=require(_0x0391('0x2'));var timeout=require(_0x0391('0x3'));var express=require(_0x0391('0x4'));var router=express['Router']();var fs_extra=require(_0x0391('0x5'));var auth=require(_0x0391('0x6'));var interaction=require(_0x0391('0x7'));var config=require(_0x0391('0x8'));var controller=require(_0x0391('0x9'));router['get']('/',auth[_0x0391('0xa')](),controller[_0x0391('0xb')]);router[_0x0391('0xc')](_0x0391('0xd'),auth[_0x0391('0xa')](),controller[_0x0391('0xe')]);router['get'](_0x0391('0xf'),auth['isAuthenticated'](),controller[_0x0391('0x10')]);router[_0x0391('0xc')](_0x0391('0x11'),auth[_0x0391('0xa')](),controller[_0x0391('0x12')]);router[_0x0391('0xc')](_0x0391('0x13'),auth[_0x0391('0xa')](),controller[_0x0391('0x14')]);router[_0x0391('0x15')]('/',auth[_0x0391('0xa')](),controller['create']);router[_0x0391('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x0391('0x17')]);router[_0x0391('0x18')](_0x0391('0xd'),auth['isAuthenticated'](),controller[_0x0391('0x19')]);module[_0x0391('0x1a')]=router; \ No newline at end of file +var _0x417e=['/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','delete','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','index'];(function(_0x438434,_0x36f21f){var _0x3b97c9=function(_0x1ecb7b){while(--_0x1ecb7b){_0x438434['push'](_0x438434['shift']());}};_0x3b97c9(++_0x36f21f);}(_0x417e,0xad));var _0xe417=function(_0x17c483,_0xc69535){_0x17c483=_0x17c483-0x0;var _0x112bdb=_0x417e[_0x17c483];return _0x112bdb;};'use strict';var multer=require('multer');var util=require(_0xe417('0x0'));var path=require(_0xe417('0x1'));var timeout=require('connect-timeout');var express=require(_0xe417('0x2'));var router=express[_0xe417('0x3')]();var fs_extra=require(_0xe417('0x4'));var auth=require(_0xe417('0x5'));var interaction=require(_0xe417('0x6'));var config=require(_0xe417('0x7'));var controller=require(_0xe417('0x8'));router[_0xe417('0x9')]('/',auth['isAuthenticated'](),controller[_0xe417('0xa')]);router[_0xe417('0x9')](_0xe417('0xb'),auth[_0xe417('0xc')](),controller[_0xe417('0xd')]);router[_0xe417('0x9')](_0xe417('0xe'),auth[_0xe417('0xc')](),controller[_0xe417('0xf')]);router[_0xe417('0x9')](_0xe417('0x10'),auth[_0xe417('0xc')](),controller[_0xe417('0x11')]);router[_0xe417('0x9')]('/:id/descriptions',auth[_0xe417('0xc')](),controller[_0xe417('0x12')]);router[_0xe417('0x13')]('/',auth[_0xe417('0xc')](),controller[_0xe417('0x14')]);router[_0xe417('0x15')](_0xe417('0xb'),auth[_0xe417('0xc')](),controller['update']);router[_0xe417('0x16')](_0xe417('0xb'),auth[_0xe417('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index aaf7388..c43ae8e 100644 --- a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js +++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xabbd=['STRING','sequelize'];(function(_0x2b1633,_0x5ddbaf){var _0x2cdb5f=function(_0x278c1b){while(--_0x278c1b){_0x2b1633['push'](_0x2b1633['shift']());}};_0x2cdb5f(++_0x5ddbaf);}(_0xabbd,0xa9));var _0xdabb=function(_0x64ce40,_0x21507d){_0x64ce40=_0x64ce40-0x0;var _0x41a783=_0xabbd[_0x64ce40];return _0x41a783;};'use strict';var Sequelize=require(_0xdabb('0x0'));module['exports']={'name':{'type':Sequelize[_0xdabb('0x1')]},'description':{'type':Sequelize[_0xdabb('0x1')]}}; \ No newline at end of file +var _0x61bd=['sequelize','STRING'];(function(_0x21dcf4,_0x5114f5){var _0x361cf1=function(_0x23b3d1){while(--_0x23b3d1){_0x21dcf4['push'](_0x21dcf4['shift']());}};_0x361cf1(++_0x5114f5);}(_0x61bd,0x12c));var _0xd61b=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x61bd[_0x24061a];return _0x82054e;};'use strict';var Sequelize=require(_0xd61b('0x0'));module['exports']={'name':{'type':Sequelize[_0xd61b('0x1')]},'description':{'type':Sequelize[_0xd61b('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index aa3d48f..01e3ac4 100644 --- a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js +++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb0ec=['hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','fields','include','find','create','body','getFields','findOne','keys','ServicenowField','pick','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','status','offset','limit','undefined','count','reject','save','update','then','destroy','end','stack','name','send','index','ServicenowConfiguration','rawAttributes','type','model','map','query','intersection','attributes','length'];(function(_0x509c0b,_0x4d4553){var _0x5f0415=function(_0x4f9d10){while(--_0x4f9d10){_0x509c0b['push'](_0x509c0b['shift']());}};_0x5f0415(++_0x4d4553);}(_0xb0ec,0x144));var _0xcb0e=function(_0x39a438,_0x19e210){_0x39a438=_0x39a438-0x0;var _0x43a208=_0xb0ec[_0x39a438];return _0x43a208;};'use strict';var emlformat=require(_0xcb0e('0x0'));var rimraf=require(_0xcb0e('0x1'));var zipdir=require(_0xcb0e('0x2'));var jsonpatch=require(_0xcb0e('0x3'));var rp=require('request-promise');var moment=require(_0xcb0e('0x4'));var BPromise=require(_0xcb0e('0x5'));var Mustache=require('mustache');var util=require(_0xcb0e('0x6'));var path=require(_0xcb0e('0x7'));var sox=require(_0xcb0e('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcb0e('0x9'));var squel=require(_0xcb0e('0xa'));var crypto=require(_0xcb0e('0xb'));var jsforce=require(_0xcb0e('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcb0e('0xd'));var Papa=require('papaparse');var Redis=require(_0xcb0e('0xe'));var authService=require(_0xcb0e('0xf'));var qs=require(_0xcb0e('0x10'));var as=require(_0xcb0e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcb0e('0x12'))(_0xcb0e('0x13'));var utils=require(_0xcb0e('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc3056d,_0x1c08fd){_0x1c08fd=_0x1c08fd||0xcc;return function(_0x407341){if(_0x407341){return _0xc3056d[_0xcb0e('0x15')](_0x1c08fd);}return _0xc3056d[_0xcb0e('0x16')](_0x1c08fd)['end']();};}function respondWithResult(_0x36838f,_0x1be6e5){_0x1be6e5=_0x1be6e5||0xc8;return function(_0x59d71c){if(_0x59d71c){return _0x36838f[_0xcb0e('0x16')](_0x1be6e5)['json'](_0x59d71c);}};}function respondWithFilteredResult(_0xc93ead,_0x5932aa){return function(_0xc46831){if(_0xc46831){var _0x298bc3=typeof _0x5932aa[_0xcb0e('0x17')]==='undefined'&&typeof _0x5932aa[_0xcb0e('0x18')]===_0xcb0e('0x19');var _0x4971da=_0xc46831[_0xcb0e('0x1a')];var _0xd806a6=_0x298bc3?0x0:_0x5932aa[_0xcb0e('0x17')];var _0x5e6d20=_0x298bc3?_0xc46831[_0xcb0e('0x1a')]:_0x5932aa[_0xcb0e('0x17')]+_0x5932aa[_0xcb0e('0x18')];var _0x135604;if(_0x5e6d20>=_0x4971da){_0x5e6d20=_0x4971da;_0x135604=0xc8;}else{_0x135604=0xce;}_0xc93ead['status'](_0x135604);return _0xc93ead['set']('Content-Range',_0xd806a6+'-'+_0x5e6d20+'/'+_0x4971da)['json'](_0xc46831);}return null;};}function patchUpdates(_0x56725b){return function(_0x5f4b37){try{jsonpatch['apply'](_0x5f4b37,_0x56725b,!![]);}catch(_0x527592){return BPromise[_0xcb0e('0x1b')](_0x527592);}return _0x5f4b37[_0xcb0e('0x1c')]();};}function saveUpdates(_0x3cb0b9,_0x2a5668){return function(_0x46ed1d){if(_0x46ed1d){return _0x46ed1d[_0xcb0e('0x1d')](_0x3cb0b9)[_0xcb0e('0x1e')](function(_0x585c2f){return _0x585c2f;});}return null;};}function removeEntity(_0xab3109,_0x2d86c2){return function(_0x6b5c70){if(_0x6b5c70){return _0x6b5c70[_0xcb0e('0x1f')]()[_0xcb0e('0x1e')](function(){_0xab3109[_0xcb0e('0x16')](0xcc)[_0xcb0e('0x20')]();});}};}function handleEntityNotFound(_0x489377,_0x2de288){return function(_0x3290c5){if(!_0x3290c5){_0x489377[_0xcb0e('0x15')](0x194);}return _0x3290c5;};}function handleError(_0x1cf442,_0x1c0c25){_0x1c0c25=_0x1c0c25||0x1f4;return function(_0x374ae6){logger['error'](_0x374ae6[_0xcb0e('0x21')]);if(_0x374ae6[_0xcb0e('0x22')]){delete _0x374ae6[_0xcb0e('0x22')];}_0x1cf442[_0xcb0e('0x16')](_0x1c0c25)[_0xcb0e('0x23')](_0x374ae6);};}exports[_0xcb0e('0x24')]=function(_0x368877,_0x3f7db8){var _0xbd0220={},_0x96b57a={},_0x49b08b={'count':0x0,'rows':[]};var _0x364e33=_['map'](db[_0xcb0e('0x25')][_0xcb0e('0x26')],function(_0x1af3e7){return{'name':_0x1af3e7['fieldName'],'type':_0x1af3e7[_0xcb0e('0x27')]['key']};});_0x96b57a[_0xcb0e('0x28')]=_[_0xcb0e('0x29')](_0x364e33,_0xcb0e('0x22'));_0x96b57a[_0xcb0e('0x2a')]=_['keys'](_0x368877[_0xcb0e('0x2a')]);_0x96b57a['filters']=_[_0xcb0e('0x2b')](_0x96b57a[_0xcb0e('0x28')],_0x96b57a[_0xcb0e('0x2a')]);_0xbd0220[_0xcb0e('0x2c')]=_[_0xcb0e('0x2b')](_0x96b57a[_0xcb0e('0x28')],qs['fields'](_0x368877[_0xcb0e('0x2a')]['fields']));_0xbd0220[_0xcb0e('0x2c')]=_0xbd0220['attributes'][_0xcb0e('0x2d')]?_0xbd0220['attributes']:_0x96b57a[_0xcb0e('0x28')];if(!_0x368877['query'][_0xcb0e('0x2e')](_0xcb0e('0x2f'))){_0xbd0220[_0xcb0e('0x18')]=qs[_0xcb0e('0x18')](_0x368877['query'][_0xcb0e('0x18')]);_0xbd0220[_0xcb0e('0x17')]=qs[_0xcb0e('0x17')](_0x368877[_0xcb0e('0x2a')][_0xcb0e('0x17')]);}_0xbd0220[_0xcb0e('0x30')]=qs['sort'](_0x368877[_0xcb0e('0x2a')][_0xcb0e('0x31')]);_0xbd0220[_0xcb0e('0x32')]=qs[_0xcb0e('0x33')](_['pick'](_0x368877[_0xcb0e('0x2a')],_0x96b57a[_0xcb0e('0x33')]),_0x364e33);if(_0x368877[_0xcb0e('0x2a')][_0xcb0e('0x34')]){_0xbd0220[_0xcb0e('0x32')]=_['merge'](_0xbd0220[_0xcb0e('0x32')],{'$or':_[_0xcb0e('0x29')](_0x364e33,function(_0x432c9b){if(_0x432c9b[_0xcb0e('0x27')]!==_0xcb0e('0x35')){var _0x2dc46f={};_0x2dc46f[_0x432c9b[_0xcb0e('0x22')]]={'$like':'%'+_0x368877[_0xcb0e('0x2a')][_0xcb0e('0x34')]+'%'};return _0x2dc46f;}})});}_0xbd0220=_[_0xcb0e('0x36')]({},_0xbd0220,_0x368877[_0xcb0e('0x37')]);var _0x3df948={'where':_0xbd0220['where']};return db[_0xcb0e('0x25')][_0xcb0e('0x1a')](_0x3df948)[_0xcb0e('0x1e')](function(_0x4392cb){_0x49b08b[_0xcb0e('0x1a')]=_0x4392cb;if(_0x368877['query'][_0xcb0e('0x38')]){_0xbd0220['include']=[{'all':!![]}];}return db['ServicenowConfiguration'][_0xcb0e('0x39')](_0xbd0220);})[_0xcb0e('0x1e')](function(_0x1c9e9e){_0x49b08b[_0xcb0e('0x3a')]=_0x1c9e9e;return _0x49b08b;})[_0xcb0e('0x1e')](respondWithFilteredResult(_0x3f7db8,_0xbd0220))[_0xcb0e('0x3b')](handleError(_0x3f7db8,null));};exports[_0xcb0e('0x3c')]=function(_0x1e2f7d,_0x4979f2){var _0x16b2eb={'raw':![],'where':{'id':_0x1e2f7d[_0xcb0e('0x3d')]['id']}},_0x26636a={};_0x26636a[_0xcb0e('0x28')]=_['keys'](db[_0xcb0e('0x25')][_0xcb0e('0x26')]);_0x26636a[_0xcb0e('0x2a')]=_['keys'](_0x1e2f7d[_0xcb0e('0x2a')]);_0x26636a['filters']=_[_0xcb0e('0x2b')](_0x26636a[_0xcb0e('0x28')],_0x26636a['query']);_0x16b2eb[_0xcb0e('0x2c')]=_[_0xcb0e('0x2b')](_0x26636a['model'],qs[_0xcb0e('0x3e')](_0x1e2f7d[_0xcb0e('0x2a')]['fields']));_0x16b2eb['attributes']=_0x16b2eb[_0xcb0e('0x2c')][_0xcb0e('0x2d')]?_0x16b2eb[_0xcb0e('0x2c')]:_0x26636a[_0xcb0e('0x28')];if(_0x1e2f7d[_0xcb0e('0x2a')][_0xcb0e('0x38')]){_0x16b2eb[_0xcb0e('0x3f')]=[{'all':!![]}];}_0x16b2eb=_[_0xcb0e('0x36')]({},_0x16b2eb,_0x1e2f7d[_0xcb0e('0x37')]);return db[_0xcb0e('0x25')][_0xcb0e('0x40')](_0x16b2eb)[_0xcb0e('0x1e')](handleEntityNotFound(_0x4979f2,null))[_0xcb0e('0x1e')](respondWithResult(_0x4979f2,null))[_0xcb0e('0x3b')](handleError(_0x4979f2,null));};exports[_0xcb0e('0x41')]=function(_0xdbae09,_0x16a3ec){return db[_0xcb0e('0x25')]['create'](_0xdbae09['body'],{})['then'](respondWithResult(_0x16a3ec,0xc9))['catch'](handleError(_0x16a3ec,null));};exports[_0xcb0e('0x1d')]=function(_0x54286c,_0x39dfe4){if(_0x54286c[_0xcb0e('0x42')]['id']){delete _0x54286c[_0xcb0e('0x42')]['id'];}return db[_0xcb0e('0x25')][_0xcb0e('0x40')]({'where':{'id':_0x54286c[_0xcb0e('0x3d')]['id']}})[_0xcb0e('0x1e')](handleEntityNotFound(_0x39dfe4,null))[_0xcb0e('0x1e')](saveUpdates(_0x54286c[_0xcb0e('0x42')],null))[_0xcb0e('0x1e')](respondWithResult(_0x39dfe4,null))[_0xcb0e('0x3b')](handleError(_0x39dfe4,null));};exports['destroy']=function(_0x4120ae,_0x4b7680){return db[_0xcb0e('0x25')][_0xcb0e('0x40')]({'where':{'id':_0x4120ae[_0xcb0e('0x3d')]['id']}})[_0xcb0e('0x1e')](handleEntityNotFound(_0x4b7680,null))[_0xcb0e('0x1e')](removeEntity(_0x4b7680,null))[_0xcb0e('0x3b')](handleError(_0x4b7680,null));};exports[_0xcb0e('0x43')]=function(_0x8dc2c7,_0x2dd944,_0x2ce37c){var _0x280c41={};var _0x3d47c6={};var _0x56b3db;var _0x11e6af;return db[_0xcb0e('0x25')][_0xcb0e('0x44')]({'where':{'id':_0x8dc2c7[_0xcb0e('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2dd944,null))['then'](function(_0x33ef87){if(_0x33ef87){_0x56b3db=_0x33ef87;_0x3d47c6['model']=_[_0xcb0e('0x45')](db[_0xcb0e('0x46')][_0xcb0e('0x26')]);_0x3d47c6[_0xcb0e('0x2a')]=_[_0xcb0e('0x45')](_0x8dc2c7['query']);_0x3d47c6[_0xcb0e('0x33')]=_[_0xcb0e('0x2b')](_0x3d47c6[_0xcb0e('0x28')],_0x3d47c6[_0xcb0e('0x2a')]);_0x280c41[_0xcb0e('0x2c')]=_[_0xcb0e('0x2b')](_0x3d47c6[_0xcb0e('0x28')],qs[_0xcb0e('0x3e')](_0x8dc2c7[_0xcb0e('0x2a')][_0xcb0e('0x3e')]));_0x280c41[_0xcb0e('0x2c')]=_0x280c41['attributes']['length']?_0x280c41['attributes']:_0x3d47c6['model'];_0x280c41[_0xcb0e('0x30')]=qs['sort'](_0x8dc2c7[_0xcb0e('0x2a')][_0xcb0e('0x31')]);_0x280c41['where']=qs[_0xcb0e('0x33')](_[_0xcb0e('0x47')](_0x8dc2c7[_0xcb0e('0x2a')],_0x3d47c6[_0xcb0e('0x33')]));if(_0x8dc2c7[_0xcb0e('0x2a')][_0xcb0e('0x34')]){_0x280c41[_0xcb0e('0x32')]=_[_0xcb0e('0x36')](_0x280c41[_0xcb0e('0x32')],{'$or':_['map'](_0x280c41[_0xcb0e('0x2c')],function(_0x4fd02f){var _0x5e1431={};_0x5e1431[_0x4fd02f]={'$like':'%'+_0x8dc2c7['query']['filter']+'%'};return _0x5e1431;})});}_0x280c41=_[_0xcb0e('0x36')]({},_0x280c41,_0x8dc2c7[_0xcb0e('0x37')]);return _0x56b3db[_0xcb0e('0x43')](_0x280c41);}})[_0xcb0e('0x1e')](function(_0xf17801){if(_0xf17801){_0x11e6af=_0xf17801[_0xcb0e('0x2d')];if(!_0x8dc2c7['query'][_0xcb0e('0x2e')](_0xcb0e('0x2f'))){_0x280c41[_0xcb0e('0x18')]=qs[_0xcb0e('0x18')](_0x8dc2c7['query'][_0xcb0e('0x18')]);_0x280c41[_0xcb0e('0x17')]=qs[_0xcb0e('0x17')](_0x8dc2c7['query'][_0xcb0e('0x17')]);}return _0x56b3db['getFields'](_0x280c41);}})[_0xcb0e('0x1e')](function(_0x54d8a3){if(_0x54d8a3){return _0x54d8a3?{'count':_0x11e6af,'rows':_0x54d8a3}:null;}})[_0xcb0e('0x1e')](respondWithResult(_0x2dd944,null))['catch'](handleError(_0x2dd944,null));};exports['getSubjects']=function(_0x47c432,_0x12daf6,_0x4b99d7){var _0x433c9b={};var _0x28cdf8={};var _0x59ac51;var _0x25fb3e;return db[_0xcb0e('0x25')][_0xcb0e('0x44')]({'where':{'id':_0x47c432[_0xcb0e('0x3d')]['id']}})[_0xcb0e('0x1e')](handleEntityNotFound(_0x12daf6,null))['then'](function(_0x843eb8){if(_0x843eb8){_0x59ac51=_0x843eb8;_0x28cdf8[_0xcb0e('0x28')]=_[_0xcb0e('0x45')](db[_0xcb0e('0x46')][_0xcb0e('0x26')]);_0x28cdf8['query']=_['keys'](_0x47c432[_0xcb0e('0x2a')]);_0x28cdf8[_0xcb0e('0x33')]=_[_0xcb0e('0x2b')](_0x28cdf8[_0xcb0e('0x28')],_0x28cdf8[_0xcb0e('0x2a')]);_0x433c9b[_0xcb0e('0x2c')]=_['intersection'](_0x28cdf8[_0xcb0e('0x28')],qs['fields'](_0x47c432[_0xcb0e('0x2a')]['fields']));_0x433c9b[_0xcb0e('0x2c')]=_0x433c9b[_0xcb0e('0x2c')][_0xcb0e('0x2d')]?_0x433c9b[_0xcb0e('0x2c')]:_0x28cdf8[_0xcb0e('0x28')];_0x433c9b[_0xcb0e('0x30')]=qs[_0xcb0e('0x31')](_0x47c432['query'][_0xcb0e('0x31')]);_0x433c9b[_0xcb0e('0x32')]=qs['filters'](_['pick'](_0x47c432[_0xcb0e('0x2a')],_0x28cdf8['filters']));if(_0x47c432[_0xcb0e('0x2a')][_0xcb0e('0x34')]){_0x433c9b['where']=_[_0xcb0e('0x36')](_0x433c9b[_0xcb0e('0x32')],{'$or':_[_0xcb0e('0x29')](_0x433c9b['attributes'],function(_0x5c7edf){var _0x5db2e5={};_0x5db2e5[_0x5c7edf]={'$like':'%'+_0x47c432[_0xcb0e('0x2a')][_0xcb0e('0x34')]+'%'};return _0x5db2e5;})});}_0x433c9b=_['merge']({},_0x433c9b,_0x47c432[_0xcb0e('0x37')]);return _0x59ac51[_0xcb0e('0x48')](_0x433c9b);}})[_0xcb0e('0x1e')](function(_0x20b599){if(_0x20b599){_0x25fb3e=_0x20b599['length'];if(!_0x47c432[_0xcb0e('0x2a')][_0xcb0e('0x2e')](_0xcb0e('0x2f'))){_0x433c9b[_0xcb0e('0x18')]=qs['limit'](_0x47c432[_0xcb0e('0x2a')][_0xcb0e('0x18')]);_0x433c9b[_0xcb0e('0x17')]=qs['offset'](_0x47c432[_0xcb0e('0x2a')][_0xcb0e('0x17')]);}return _0x59ac51[_0xcb0e('0x48')](_0x433c9b);}})[_0xcb0e('0x1e')](function(_0x2ebe61){if(_0x2ebe61){return _0x2ebe61?{'count':_0x25fb3e,'rows':_0x2ebe61}:null;}})[_0xcb0e('0x1e')](respondWithResult(_0x12daf6,null))[_0xcb0e('0x3b')](handleError(_0x12daf6,null));};exports[_0xcb0e('0x49')]=function(_0x3cd507,_0x34053c,_0x2320f2){var _0x471ec7={};var _0x5c265f={};var _0x448a17;var _0x55374a;return db[_0xcb0e('0x25')][_0xcb0e('0x44')]({'where':{'id':_0x3cd507[_0xcb0e('0x3d')]['id']}})[_0xcb0e('0x1e')](handleEntityNotFound(_0x34053c,null))[_0xcb0e('0x1e')](function(_0x42d899){if(_0x42d899){_0x448a17=_0x42d899;_0x5c265f[_0xcb0e('0x28')]=_[_0xcb0e('0x45')](db['ServicenowField'][_0xcb0e('0x26')]);_0x5c265f[_0xcb0e('0x2a')]=_[_0xcb0e('0x45')](_0x3cd507[_0xcb0e('0x2a')]);_0x5c265f[_0xcb0e('0x33')]=_['intersection'](_0x5c265f[_0xcb0e('0x28')],_0x5c265f[_0xcb0e('0x2a')]);_0x471ec7['attributes']=_[_0xcb0e('0x2b')](_0x5c265f[_0xcb0e('0x28')],qs['fields'](_0x3cd507['query'][_0xcb0e('0x3e')]));_0x471ec7[_0xcb0e('0x2c')]=_0x471ec7[_0xcb0e('0x2c')][_0xcb0e('0x2d')]?_0x471ec7[_0xcb0e('0x2c')]:_0x5c265f['model'];_0x471ec7[_0xcb0e('0x30')]=qs[_0xcb0e('0x31')](_0x3cd507[_0xcb0e('0x2a')]['sort']);_0x471ec7[_0xcb0e('0x32')]=qs[_0xcb0e('0x33')](_[_0xcb0e('0x47')](_0x3cd507[_0xcb0e('0x2a')],_0x5c265f[_0xcb0e('0x33')]));if(_0x3cd507['query']['filter']){_0x471ec7['where']=_['merge'](_0x471ec7['where'],{'$or':_['map'](_0x471ec7[_0xcb0e('0x2c')],function(_0x253d3c){var _0xa87dfa={};_0xa87dfa[_0x253d3c]={'$like':'%'+_0x3cd507[_0xcb0e('0x2a')][_0xcb0e('0x34')]+'%'};return _0xa87dfa;})});}_0x471ec7=_[_0xcb0e('0x36')]({},_0x471ec7,_0x3cd507[_0xcb0e('0x37')]);return _0x448a17[_0xcb0e('0x49')](_0x471ec7);}})[_0xcb0e('0x1e')](function(_0x2f3843){if(_0x2f3843){_0x55374a=_0x2f3843[_0xcb0e('0x2d')];if(!_0x3cd507[_0xcb0e('0x2a')][_0xcb0e('0x2e')](_0xcb0e('0x2f'))){_0x471ec7[_0xcb0e('0x18')]=qs[_0xcb0e('0x18')](_0x3cd507[_0xcb0e('0x2a')][_0xcb0e('0x18')]);_0x471ec7[_0xcb0e('0x17')]=qs[_0xcb0e('0x17')](_0x3cd507['query'][_0xcb0e('0x17')]);}return _0x448a17['getDescriptions'](_0x471ec7);}})[_0xcb0e('0x1e')](function(_0x5ca48d){if(_0x5ca48d){return _0x5ca48d?{'count':_0x55374a,'rows':_0x5ca48d}:null;}})[_0xcb0e('0x1e')](respondWithResult(_0x34053c,null))[_0xcb0e('0x3b')](handleError(_0x34053c,null));}; \ No newline at end of file +var _0x15b5=['filter','VIRTUAL','ServicenowConfiguration','includeAll','findAll','rows','catch','params','keys','merge','options','find','create','update','body','destroy','findOne','ServicenowField','nolimit','getFields','getSubjects','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','limit','count','set','Content-Range','reject','save','then','sendStatus','send','index','rawAttributes','fieldName','type','key','model','map','name','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick'];(function(_0x4a787d,_0x48129d){var _0xb3bb36=function(_0x552645){while(--_0x552645){_0x4a787d['push'](_0x4a787d['shift']());}};_0xb3bb36(++_0x48129d);}(_0x15b5,0x1e3));var _0x515b=function(_0x26d6d9,_0x431cb8){_0x26d6d9=_0x26d6d9-0x0;var _0x1b4875=_0x15b5[_0x26d6d9];return _0x1b4875;};'use strict';var emlformat=require(_0x515b('0x0'));var rimraf=require(_0x515b('0x1'));var zipdir=require(_0x515b('0x2'));var jsonpatch=require(_0x515b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x515b('0x4'));var util=require(_0x515b('0x5'));var path=require(_0x515b('0x6'));var sox=require(_0x515b('0x7'));var csv=require(_0x515b('0x8'));var ejs=require(_0x515b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x515b('0xa'));var squel=require(_0x515b('0xb'));var crypto=require(_0x515b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x515b('0xd'));var toCsv=require('to-csv');var querystring=require(_0x515b('0xe'));var Papa=require(_0x515b('0xf'));var Redis=require(_0x515b('0x10'));var authService=require(_0x515b('0x11'));var qs=require(_0x515b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x515b('0x13'));var logger=require('../../config/logger')(_0x515b('0x14'));var utils=require(_0x515b('0x15'));var config=require(_0x515b('0x16'));var licenseUtil=require(_0x515b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x66c8af,_0x4ac5a6){_0x4ac5a6=_0x4ac5a6||0xcc;return function(_0x4b222a){if(_0x4b222a){return _0x66c8af['sendStatus'](_0x4ac5a6);}return _0x66c8af[_0x515b('0x18')](_0x4ac5a6)[_0x515b('0x19')]();};}function respondWithResult(_0x2d50b7,_0x21fcc1){_0x21fcc1=_0x21fcc1||0xc8;return function(_0x5779f2){if(_0x5779f2){return _0x2d50b7['status'](_0x21fcc1)[_0x515b('0x1a')](_0x5779f2);}};}function respondWithFilteredResult(_0x9da3f1,_0x5ead40){return function(_0x7257de){if(_0x7257de){var _0x22a496=typeof _0x5ead40[_0x515b('0x1b')]==='undefined'&&typeof _0x5ead40[_0x515b('0x1c')]==='undefined';var _0x4ad576=_0x7257de[_0x515b('0x1d')];var _0x47e508=_0x22a496?0x0:_0x5ead40[_0x515b('0x1b')];var _0x208990=_0x22a496?_0x7257de[_0x515b('0x1d')]:_0x5ead40[_0x515b('0x1b')]+_0x5ead40[_0x515b('0x1c')];var _0x3fbbf0;if(_0x208990>=_0x4ad576){_0x208990=_0x4ad576;_0x3fbbf0=0xc8;}else{_0x3fbbf0=0xce;}_0x9da3f1[_0x515b('0x18')](_0x3fbbf0);return _0x9da3f1[_0x515b('0x1e')](_0x515b('0x1f'),_0x47e508+'-'+_0x208990+'/'+_0x4ad576)['json'](_0x7257de);}return null;};}function patchUpdates(_0x5b24dd){return function(_0x53d631){try{jsonpatch['apply'](_0x53d631,_0x5b24dd,!![]);}catch(_0x1289ee){return BPromise[_0x515b('0x20')](_0x1289ee);}return _0x53d631[_0x515b('0x21')]();};}function saveUpdates(_0x3303c8,_0x26d43e){return function(_0x332f2c){if(_0x332f2c){return _0x332f2c['update'](_0x3303c8)[_0x515b('0x22')](function(_0x16923c){return _0x16923c;});}return null;};}function removeEntity(_0x46d65e,_0x3c7562){return function(_0x31c0d1){if(_0x31c0d1){return _0x31c0d1['destroy']()[_0x515b('0x22')](function(){_0x46d65e[_0x515b('0x18')](0xcc)[_0x515b('0x19')]();});}};}function handleEntityNotFound(_0x477777,_0x4b6b0f){return function(_0x3345ad){if(!_0x3345ad){_0x477777[_0x515b('0x23')](0x194);}return _0x3345ad;};}function handleError(_0x2f586f,_0x55dbd8){_0x55dbd8=_0x55dbd8||0x1f4;return function(_0x175f19){logger['error'](_0x175f19['stack']);if(_0x175f19['name']){delete _0x175f19['name'];}_0x2f586f['status'](_0x55dbd8)[_0x515b('0x24')](_0x175f19);};}exports[_0x515b('0x25')]=function(_0x5d8266,_0x174626){var _0x2f29af={},_0x2f6c1e={},_0x35b196={'count':0x0,'rows':[]};var _0x298156=_['map'](db['ServicenowConfiguration'][_0x515b('0x26')],function(_0x425282){return{'name':_0x425282[_0x515b('0x27')],'type':_0x425282[_0x515b('0x28')][_0x515b('0x29')]};});_0x2f6c1e[_0x515b('0x2a')]=_[_0x515b('0x2b')](_0x298156,_0x515b('0x2c'));_0x2f6c1e[_0x515b('0x2d')]=_['keys'](_0x5d8266['query']);_0x2f6c1e[_0x515b('0x2e')]=_[_0x515b('0x2f')](_0x2f6c1e[_0x515b('0x2a')],_0x2f6c1e[_0x515b('0x2d')]);_0x2f29af['attributes']=_[_0x515b('0x2f')](_0x2f6c1e[_0x515b('0x2a')],qs['fields'](_0x5d8266[_0x515b('0x2d')][_0x515b('0x30')]));_0x2f29af[_0x515b('0x31')]=_0x2f29af['attributes'][_0x515b('0x32')]?_0x2f29af[_0x515b('0x31')]:_0x2f6c1e[_0x515b('0x2a')];if(!_0x5d8266['query'][_0x515b('0x33')]('nolimit')){_0x2f29af['limit']=qs[_0x515b('0x1c')](_0x5d8266['query'][_0x515b('0x1c')]);_0x2f29af[_0x515b('0x1b')]=qs['offset'](_0x5d8266[_0x515b('0x2d')]['offset']);}_0x2f29af[_0x515b('0x34')]=qs[_0x515b('0x35')](_0x5d8266[_0x515b('0x2d')][_0x515b('0x35')]);_0x2f29af[_0x515b('0x36')]=qs['filters'](_[_0x515b('0x37')](_0x5d8266[_0x515b('0x2d')],_0x2f6c1e[_0x515b('0x2e')]),_0x298156);if(_0x5d8266[_0x515b('0x2d')][_0x515b('0x38')]){_0x2f29af['where']=_['merge'](_0x2f29af[_0x515b('0x36')],{'$or':_['map'](_0x298156,function(_0x33a2d2){if(_0x33a2d2[_0x515b('0x28')]!==_0x515b('0x39')){var _0x474b26={};_0x474b26[_0x33a2d2[_0x515b('0x2c')]]={'$like':'%'+_0x5d8266[_0x515b('0x2d')][_0x515b('0x38')]+'%'};return _0x474b26;}})});}_0x2f29af=_['merge']({},_0x2f29af,_0x5d8266['options']);var _0x1ab736={'where':_0x2f29af[_0x515b('0x36')]};return db[_0x515b('0x3a')][_0x515b('0x1d')](_0x1ab736)[_0x515b('0x22')](function(_0x44314a){_0x35b196[_0x515b('0x1d')]=_0x44314a;if(_0x5d8266[_0x515b('0x2d')][_0x515b('0x3b')]){_0x2f29af['include']=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x515b('0x3c')](_0x2f29af);})[_0x515b('0x22')](function(_0x25444b){_0x35b196[_0x515b('0x3d')]=_0x25444b;return _0x35b196;})[_0x515b('0x22')](respondWithFilteredResult(_0x174626,_0x2f29af))[_0x515b('0x3e')](handleError(_0x174626,null));};exports['show']=function(_0x1bc817,_0x4cf67d){var _0x3c9f6d={'raw':![],'where':{'id':_0x1bc817[_0x515b('0x3f')]['id']}},_0x98285b={};_0x98285b['model']=_[_0x515b('0x40')](db[_0x515b('0x3a')][_0x515b('0x26')]);_0x98285b[_0x515b('0x2d')]=_[_0x515b('0x40')](_0x1bc817[_0x515b('0x2d')]);_0x98285b[_0x515b('0x2e')]=_[_0x515b('0x2f')](_0x98285b[_0x515b('0x2a')],_0x98285b['query']);_0x3c9f6d[_0x515b('0x31')]=_[_0x515b('0x2f')](_0x98285b['model'],qs['fields'](_0x1bc817['query'][_0x515b('0x30')]));_0x3c9f6d[_0x515b('0x31')]=_0x3c9f6d[_0x515b('0x31')][_0x515b('0x32')]?_0x3c9f6d[_0x515b('0x31')]:_0x98285b[_0x515b('0x2a')];if(_0x1bc817[_0x515b('0x2d')]['includeAll']){_0x3c9f6d['include']=[{'all':!![]}];}_0x3c9f6d=_[_0x515b('0x41')]({},_0x3c9f6d,_0x1bc817[_0x515b('0x42')]);return db[_0x515b('0x3a')][_0x515b('0x43')](_0x3c9f6d)[_0x515b('0x22')](handleEntityNotFound(_0x4cf67d,null))[_0x515b('0x22')](respondWithResult(_0x4cf67d,null))[_0x515b('0x3e')](handleError(_0x4cf67d,null));};exports[_0x515b('0x44')]=function(_0x188064,_0x13e7c4){return db[_0x515b('0x3a')][_0x515b('0x44')](_0x188064['body'],{})[_0x515b('0x22')](respondWithResult(_0x13e7c4,0xc9))['catch'](handleError(_0x13e7c4,null));};exports[_0x515b('0x45')]=function(_0x545abd,_0x4e663b){if(_0x545abd[_0x515b('0x46')]['id']){delete _0x545abd[_0x515b('0x46')]['id'];}return db[_0x515b('0x3a')]['find']({'where':{'id':_0x545abd['params']['id']}})[_0x515b('0x22')](handleEntityNotFound(_0x4e663b,null))[_0x515b('0x22')](saveUpdates(_0x545abd[_0x515b('0x46')],null))[_0x515b('0x22')](respondWithResult(_0x4e663b,null))[_0x515b('0x3e')](handleError(_0x4e663b,null));};exports[_0x515b('0x47')]=function(_0x3c5fda,_0x2b0db9){return db[_0x515b('0x3a')][_0x515b('0x43')]({'where':{'id':_0x3c5fda[_0x515b('0x3f')]['id']}})[_0x515b('0x22')](handleEntityNotFound(_0x2b0db9,null))[_0x515b('0x22')](removeEntity(_0x2b0db9,null))[_0x515b('0x3e')](handleError(_0x2b0db9,null));};exports['getFields']=function(_0x401dd5,_0x468e99,_0x1fc8c6){var _0x4b60ad={};var _0x124a59={};var _0x47b4f6;var _0x407abf;return db[_0x515b('0x3a')][_0x515b('0x48')]({'where':{'id':_0x401dd5[_0x515b('0x3f')]['id']}})[_0x515b('0x22')](handleEntityNotFound(_0x468e99,null))['then'](function(_0x292946){if(_0x292946){_0x47b4f6=_0x292946;_0x124a59[_0x515b('0x2a')]=_[_0x515b('0x40')](db[_0x515b('0x49')][_0x515b('0x26')]);_0x124a59['query']=_[_0x515b('0x40')](_0x401dd5[_0x515b('0x2d')]);_0x124a59[_0x515b('0x2e')]=_['intersection'](_0x124a59[_0x515b('0x2a')],_0x124a59[_0x515b('0x2d')]);_0x4b60ad[_0x515b('0x31')]=_['intersection'](_0x124a59['model'],qs[_0x515b('0x30')](_0x401dd5['query'][_0x515b('0x30')]));_0x4b60ad[_0x515b('0x31')]=_0x4b60ad[_0x515b('0x31')][_0x515b('0x32')]?_0x4b60ad[_0x515b('0x31')]:_0x124a59[_0x515b('0x2a')];_0x4b60ad[_0x515b('0x34')]=qs[_0x515b('0x35')](_0x401dd5['query'][_0x515b('0x35')]);_0x4b60ad['where']=qs[_0x515b('0x2e')](_[_0x515b('0x37')](_0x401dd5[_0x515b('0x2d')],_0x124a59['filters']));if(_0x401dd5['query'][_0x515b('0x38')]){_0x4b60ad[_0x515b('0x36')]=_[_0x515b('0x41')](_0x4b60ad[_0x515b('0x36')],{'$or':_['map'](_0x4b60ad[_0x515b('0x31')],function(_0x22ae58){var _0x5c18b8={};_0x5c18b8[_0x22ae58]={'$like':'%'+_0x401dd5['query'][_0x515b('0x38')]+'%'};return _0x5c18b8;})});}_0x4b60ad=_[_0x515b('0x41')]({},_0x4b60ad,_0x401dd5[_0x515b('0x42')]);return _0x47b4f6['getFields'](_0x4b60ad);}})[_0x515b('0x22')](function(_0x41065f){if(_0x41065f){_0x407abf=_0x41065f['length'];if(!_0x401dd5['query'][_0x515b('0x33')](_0x515b('0x4a'))){_0x4b60ad[_0x515b('0x1c')]=qs[_0x515b('0x1c')](_0x401dd5[_0x515b('0x2d')][_0x515b('0x1c')]);_0x4b60ad[_0x515b('0x1b')]=qs['offset'](_0x401dd5[_0x515b('0x2d')][_0x515b('0x1b')]);}return _0x47b4f6[_0x515b('0x4b')](_0x4b60ad);}})['then'](function(_0x476c28){if(_0x476c28){return _0x476c28?{'count':_0x407abf,'rows':_0x476c28}:null;}})[_0x515b('0x22')](respondWithResult(_0x468e99,null))[_0x515b('0x3e')](handleError(_0x468e99,null));};exports[_0x515b('0x4c')]=function(_0x4efbe2,_0x90601d,_0x442b8c){var _0x457000={};var _0x3595e5={};var _0x45c39f;var _0x50e7ba;return db[_0x515b('0x3a')][_0x515b('0x48')]({'where':{'id':_0x4efbe2[_0x515b('0x3f')]['id']}})['then'](handleEntityNotFound(_0x90601d,null))[_0x515b('0x22')](function(_0x41defa){if(_0x41defa){_0x45c39f=_0x41defa;_0x3595e5[_0x515b('0x2a')]=_[_0x515b('0x40')](db[_0x515b('0x49')][_0x515b('0x26')]);_0x3595e5['query']=_[_0x515b('0x40')](_0x4efbe2[_0x515b('0x2d')]);_0x3595e5[_0x515b('0x2e')]=_[_0x515b('0x2f')](_0x3595e5['model'],_0x3595e5[_0x515b('0x2d')]);_0x457000[_0x515b('0x31')]=_[_0x515b('0x2f')](_0x3595e5[_0x515b('0x2a')],qs['fields'](_0x4efbe2[_0x515b('0x2d')][_0x515b('0x30')]));_0x457000[_0x515b('0x31')]=_0x457000[_0x515b('0x31')][_0x515b('0x32')]?_0x457000[_0x515b('0x31')]:_0x3595e5[_0x515b('0x2a')];_0x457000[_0x515b('0x34')]=qs[_0x515b('0x35')](_0x4efbe2[_0x515b('0x2d')][_0x515b('0x35')]);_0x457000[_0x515b('0x36')]=qs[_0x515b('0x2e')](_['pick'](_0x4efbe2[_0x515b('0x2d')],_0x3595e5[_0x515b('0x2e')]));if(_0x4efbe2[_0x515b('0x2d')][_0x515b('0x38')]){_0x457000['where']=_['merge'](_0x457000[_0x515b('0x36')],{'$or':_['map'](_0x457000[_0x515b('0x31')],function(_0x2f4949){var _0x37768b={};_0x37768b[_0x2f4949]={'$like':'%'+_0x4efbe2[_0x515b('0x2d')][_0x515b('0x38')]+'%'};return _0x37768b;})});}_0x457000=_[_0x515b('0x41')]({},_0x457000,_0x4efbe2['options']);return _0x45c39f['getSubjects'](_0x457000);}})[_0x515b('0x22')](function(_0x330e0e){if(_0x330e0e){_0x50e7ba=_0x330e0e['length'];if(!_0x4efbe2['query']['hasOwnProperty'](_0x515b('0x4a'))){_0x457000[_0x515b('0x1c')]=qs[_0x515b('0x1c')](_0x4efbe2[_0x515b('0x2d')][_0x515b('0x1c')]);_0x457000[_0x515b('0x1b')]=qs[_0x515b('0x1b')](_0x4efbe2[_0x515b('0x2d')][_0x515b('0x1b')]);}return _0x45c39f[_0x515b('0x4c')](_0x457000);}})[_0x515b('0x22')](function(_0x2657b7){if(_0x2657b7){return _0x2657b7?{'count':_0x50e7ba,'rows':_0x2657b7}:null;}})[_0x515b('0x22')](respondWithResult(_0x90601d,null))[_0x515b('0x3e')](handleError(_0x90601d,null));};exports['getDescriptions']=function(_0x5e1d33,_0x30fa0f,_0x3b82b7){var _0x288c2a={};var _0x214deb={};var _0x4ff5bf;var _0x133e62;return db['ServicenowConfiguration'][_0x515b('0x48')]({'where':{'id':_0x5e1d33['params']['id']}})[_0x515b('0x22')](handleEntityNotFound(_0x30fa0f,null))[_0x515b('0x22')](function(_0x30928c){if(_0x30928c){_0x4ff5bf=_0x30928c;_0x214deb[_0x515b('0x2a')]=_['keys'](db[_0x515b('0x49')][_0x515b('0x26')]);_0x214deb[_0x515b('0x2d')]=_['keys'](_0x5e1d33['query']);_0x214deb[_0x515b('0x2e')]=_['intersection'](_0x214deb[_0x515b('0x2a')],_0x214deb[_0x515b('0x2d')]);_0x288c2a[_0x515b('0x31')]=_['intersection'](_0x214deb[_0x515b('0x2a')],qs[_0x515b('0x30')](_0x5e1d33['query']['fields']));_0x288c2a[_0x515b('0x31')]=_0x288c2a[_0x515b('0x31')][_0x515b('0x32')]?_0x288c2a['attributes']:_0x214deb['model'];_0x288c2a[_0x515b('0x34')]=qs[_0x515b('0x35')](_0x5e1d33[_0x515b('0x2d')][_0x515b('0x35')]);_0x288c2a[_0x515b('0x36')]=qs[_0x515b('0x2e')](_[_0x515b('0x37')](_0x5e1d33[_0x515b('0x2d')],_0x214deb[_0x515b('0x2e')]));if(_0x5e1d33[_0x515b('0x2d')]['filter']){_0x288c2a[_0x515b('0x36')]=_[_0x515b('0x41')](_0x288c2a[_0x515b('0x36')],{'$or':_[_0x515b('0x2b')](_0x288c2a[_0x515b('0x31')],function(_0x3accbf){var _0x40c085={};_0x40c085[_0x3accbf]={'$like':'%'+_0x5e1d33[_0x515b('0x2d')][_0x515b('0x38')]+'%'};return _0x40c085;})});}_0x288c2a=_[_0x515b('0x41')]({},_0x288c2a,_0x5e1d33[_0x515b('0x42')]);return _0x4ff5bf['getDescriptions'](_0x288c2a);}})[_0x515b('0x22')](function(_0x727782){if(_0x727782){_0x133e62=_0x727782[_0x515b('0x32')];if(!_0x5e1d33[_0x515b('0x2d')]['hasOwnProperty']('nolimit')){_0x288c2a[_0x515b('0x1c')]=qs[_0x515b('0x1c')](_0x5e1d33[_0x515b('0x2d')][_0x515b('0x1c')]);_0x288c2a['offset']=qs[_0x515b('0x1b')](_0x5e1d33[_0x515b('0x2d')][_0x515b('0x1b')]);}return _0x4ff5bf['getDescriptions'](_0x288c2a);}})['then'](function(_0x1a30a6){if(_0x1a30a6){return _0x1a30a6?{'count':_0x133e62,'rows':_0x1a30a6}:null;}})['then'](respondWithResult(_0x30fa0f,null))[_0x515b('0x3e')](handleError(_0x30fa0f,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index e8edd91..40f86d2 100644 --- a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js +++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x720e=['bluebird','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger'];(function(_0x82a5b3,_0x1a5a40){var _0x4ed6eb=function(_0x2f89d2){while(--_0x2f89d2){_0x82a5b3['push'](_0x82a5b3['shift']());}};_0x4ed6eb(++_0x1a5a40);}(_0x720e,0x1cb));var _0xe720=function(_0xd21fe7,_0x225a39){_0xd21fe7=_0xd21fe7-0x0;var _0x14d570=_0x720e[_0xd21fe7];return _0x14d570;};'use strict';var _=require(_0xe720('0x0'));var util=require(_0xe720('0x1'));var logger=require(_0xe720('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe720('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe720('0x4'));var rimraf=require(_0xe720('0x5'));var config=require(_0xe720('0x6'));var attributes=require(_0xe720('0x7'));module[_0xe720('0x8')]=function(_0x43463b,_0x3952f0){return _0x43463b['define'](_0xe720('0x9'),attributes,{'tableName':_0xe720('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6836=['../../config/logger','moment','request-promise','rimraf','./intServicenowConfiguration.attributes','exports','ServicenowConfiguration','int_servicenow_configurations','lodash','util'];(function(_0x141c42,_0x211401){var _0x3553d0=function(_0x52c33b){while(--_0x52c33b){_0x141c42['push'](_0x141c42['shift']());}};_0x3553d0(++_0x211401);}(_0x6836,0x1c0));var _0x6683=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x6836[_0x4b2436];return _0x4f5ab2;};'use strict';var _=require(_0x6683('0x0'));var util=require(_0x6683('0x1'));var logger=require(_0x6683('0x2'))('api');var moment=require(_0x6683('0x3'));var BPromise=require('bluebird');var rp=require(_0x6683('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6683('0x5'));var config=require('../../config/environment');var attributes=require(_0x6683('0x6'));module[_0x6683('0x7')]=function(_0xd59091,_0x452f17){return _0xd59091['define'](_0x6683('0x8'),attributes,{'tableName':_0x6683('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index f1410a5..060cc9e 100644 --- a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js +++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc8ba=['../../config/logger','../../config/environment','jayson/promise','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x3b1413,_0x308e98){var _0x2cafbc=function(_0xa3aee2){while(--_0xa3aee2){_0x3b1413['push'](_0x3b1413['shift']());}};_0x2cafbc(++_0x308e98);}(_0xc8ba,0x186));var _0xac8b=function(_0x2dbce7,_0x57cb8d){_0x2dbce7=_0x2dbce7-0x0;var _0x3a3ed0=_0xc8ba[_0x2dbce7];return _0x3a3ed0;};'use strict';var _=require(_0xac8b('0x0'));var util=require(_0xac8b('0x1'));var moment=require(_0xac8b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xac8b('0x3'));var db=require(_0xac8b('0x4'))['db'];var utils=require(_0xac8b('0x5'));var logger=require(_0xac8b('0x6'))('rpc');var config=require(_0xac8b('0x7'));var jayson=require(_0xac8b('0x8'));var client=jayson['client'][_0xac8b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5375a2,_0x689678,_0x26d3d7){return new BPromise(function(_0xe63b93,_0x58c7fe){return client[_0xac8b('0xa')](_0x5375a2,_0x26d3d7)[_0xac8b('0xb')](function(_0x17c430){logger[_0xac8b('0xc')](_0xac8b('0xd'),_0x689678,_0xac8b('0xe'));logger[_0xac8b('0xf')](_0xac8b('0x10'),_0x689678,_0xac8b('0xe'),JSON[_0xac8b('0x11')](_0x17c430));if(_0x17c430[_0xac8b('0x12')]){if(_0x17c430[_0xac8b('0x12')]['code']===0x1f4){logger[_0xac8b('0x12')](_0xac8b('0xd'),_0x689678,_0x17c430[_0xac8b('0x12')][_0xac8b('0x13')]);return _0x58c7fe(_0x17c430[_0xac8b('0x12')]['message']);}logger[_0xac8b('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x689678,_0x17c430['error'][_0xac8b('0x13')]);return _0xe63b93(_0x17c430[_0xac8b('0x12')]['message']);}else{logger[_0xac8b('0xc')](_0xac8b('0xd'),_0x689678,_0xac8b('0xe'));_0xe63b93(_0x17c430[_0xac8b('0x14')][_0xac8b('0x13')]);}})[_0xac8b('0x15')](function(_0x58b260){logger['error'](_0xac8b('0xd'),_0x689678,_0x58b260);_0x58c7fe(_0x58b260);});});} \ No newline at end of file +var _0xf592=['message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x51a4c4,_0x5cef2e){var _0x47bf59=function(_0xe4d722){while(--_0xe4d722){_0x51a4c4['push'](_0x51a4c4['shift']());}};_0x47bf59(++_0x5cef2e);}(_0xf592,0x153));var _0x2f59=function(_0x2d2787,_0x2e631a){_0x2d2787=_0x2d2787-0x0;var _0x59f2e7=_0xf592[_0x2d2787];return _0x59f2e7;};'use strict';var _=require(_0x2f59('0x0'));var util=require(_0x2f59('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2f59('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2f59('0x3'))['db'];var utils=require(_0x2f59('0x4'));var logger=require('../../config/logger')(_0x2f59('0x5'));var config=require(_0x2f59('0x6'));var jayson=require(_0x2f59('0x7'));var client=jayson[_0x2f59('0x8')][_0x2f59('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x51e7a2,_0x2eea2a,_0x1ff6a5){return new BPromise(function(_0x512859,_0x3c977c){return client[_0x2f59('0xa')](_0x51e7a2,_0x1ff6a5)[_0x2f59('0xb')](function(_0x3cbe7c){logger[_0x2f59('0xc')](_0x2f59('0xd'),_0x2eea2a,_0x2f59('0xe'));logger['debug'](_0x2f59('0xf'),_0x2eea2a,_0x2f59('0xe'),JSON['stringify'](_0x3cbe7c));if(_0x3cbe7c[_0x2f59('0x10')]){if(_0x3cbe7c[_0x2f59('0x10')][_0x2f59('0x11')]===0x1f4){logger['error'](_0x2f59('0xd'),_0x2eea2a,_0x3cbe7c[_0x2f59('0x10')][_0x2f59('0x12')]);return _0x3c977c(_0x3cbe7c[_0x2f59('0x10')]['message']);}logger[_0x2f59('0x10')](_0x2f59('0xd'),_0x2eea2a,_0x3cbe7c[_0x2f59('0x10')][_0x2f59('0x12')]);return _0x512859(_0x3cbe7c[_0x2f59('0x10')][_0x2f59('0x12')]);}else{logger[_0x2f59('0xc')]('ServicenowConfiguration,\x20%s,\x20%s',_0x2eea2a,_0x2f59('0xe'));_0x512859(_0x3cbe7c[_0x2f59('0x13')][_0x2f59('0x12')]);}})[_0x2f59('0x14')](function(_0x2855ee){logger['error'](_0x2f59('0xd'),_0x2eea2a,_0x2855ee);_0x3c977c(_0x2855ee);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 31eb2d9..53488c2 100644 --- a/server/api/intServicenowField/index.js +++ b/server/api/intServicenowField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xad51=['destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','post','create','put','/:id','update','delete'];(function(_0x81c26e,_0x3a9ddd){var _0x19b119=function(_0x3cb95d){while(--_0x3cb95d){_0x81c26e['push'](_0x81c26e['shift']());}};_0x19b119(++_0x3a9ddd);}(_0xad51,0x87));var _0x1ad5=function(_0x34bd34,_0x1444f7){_0x34bd34=_0x34bd34-0x0;var _0x4e36d6=_0xad51[_0x34bd34];return _0x4e36d6;};'use strict';var multer=require('multer');var util=require(_0x1ad5('0x0'));var path=require(_0x1ad5('0x1'));var timeout=require('connect-timeout');var express=require(_0x1ad5('0x2'));var router=express[_0x1ad5('0x3')]();var fs_extra=require(_0x1ad5('0x4'));var auth=require(_0x1ad5('0x5'));var interaction=require(_0x1ad5('0x6'));var config=require('../../config/environment');var controller=require('./intServicenowField.controller');router[_0x1ad5('0x7')]('/',auth[_0x1ad5('0x8')](),controller[_0x1ad5('0x9')]);router[_0x1ad5('0x7')]('/:id',auth[_0x1ad5('0x8')](),controller[_0x1ad5('0xa')]);router[_0x1ad5('0xb')]('/',auth[_0x1ad5('0x8')](),controller[_0x1ad5('0xc')]);router[_0x1ad5('0xd')](_0x1ad5('0xe'),auth[_0x1ad5('0x8')](),controller[_0x1ad5('0xf')]);router[_0x1ad5('0x10')]('/:id',auth[_0x1ad5('0x8')](),controller[_0x1ad5('0x11')]);module[_0x1ad5('0x12')]=router; \ No newline at end of file +var _0xb268=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intServicenowField.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x293a24,_0x2406e6){var _0x23d1cf=function(_0x1130d4){while(--_0x1130d4){_0x293a24['push'](_0x293a24['shift']());}};_0x23d1cf(++_0x2406e6);}(_0xb268,0x143));var _0x8b26=function(_0x558670,_0x237b49){_0x558670=_0x558670-0x0;var _0x3a1831=_0xb268[_0x558670];return _0x3a1831;};'use strict';var multer=require(_0x8b26('0x0'));var util=require(_0x8b26('0x1'));var path=require(_0x8b26('0x2'));var timeout=require(_0x8b26('0x3'));var express=require(_0x8b26('0x4'));var router=express[_0x8b26('0x5')]();var fs_extra=require(_0x8b26('0x6'));var auth=require(_0x8b26('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8b26('0x8'));router[_0x8b26('0x9')]('/',auth[_0x8b26('0xa')](),controller[_0x8b26('0xb')]);router[_0x8b26('0x9')](_0x8b26('0xc'),auth['isAuthenticated'](),controller[_0x8b26('0xd')]);router[_0x8b26('0xe')]('/',auth[_0x8b26('0xa')](),controller[_0x8b26('0xf')]);router[_0x8b26('0x10')](_0x8b26('0xc'),auth['isAuthenticated'](),controller[_0x8b26('0x11')]);router[_0x8b26('0x12')](_0x8b26('0xc'),auth[_0x8b26('0xa')](),controller[_0x8b26('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 77e9a38..df0e3f2 100644 --- a/server/api/intServicenowField/intServicenowField.attributes.js +++ b/server/api/intServicenowField/intServicenowField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa8ef=['string','customVariable','STRING','variable','BOOLEAN','sequelize','exports'];(function(_0x2d1d72,_0x23ef7b){var _0x5ede8e=function(_0x1c3330){while(--_0x1c3330){_0x2d1d72['push'](_0x2d1d72['shift']());}};_0x5ede8e(++_0x23ef7b);}(_0xa8ef,0x91));var _0xfa8e=function(_0xbaab45,_0x40f6e8){_0xbaab45=_0xbaab45-0x0;var _0x6ea753=_0xa8ef[_0xbaab45];return _0x6ea753;};'use strict';var Sequelize=require(_0xfa8e('0x0'));module[_0xfa8e('0x1')]={'type':{'type':Sequelize['ENUM'](_0xfa8e('0x2'),'variable',_0xfa8e('0x3'),'keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xfa8e('0x4')]},'key':{'type':Sequelize[_0xfa8e('0x4')]},'keyType':{'type':Sequelize['ENUM'](_0xfa8e('0x2'),_0xfa8e('0x5'),_0xfa8e('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xfa8e('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xfa8e('0x4')]}}; \ No newline at end of file +var _0x01a7=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','exports'];(function(_0x33e2fc,_0x1b82d8){var _0x1782af=function(_0x414236){while(--_0x414236){_0x33e2fc['push'](_0x33e2fc['shift']());}};_0x1782af(++_0x1b82d8);}(_0x01a7,0xd7));var _0x701a=function(_0xf89c3,_0x351bf1){_0xf89c3=_0xf89c3-0x0;var _0x274fc8=_0x01a7[_0xf89c3];return _0x274fc8;};'use strict';var Sequelize=require('sequelize');module[_0x701a('0x0')]={'type':{'type':Sequelize[_0x701a('0x1')](_0x701a('0x2'),_0x701a('0x3'),_0x701a('0x4'),_0x701a('0x5'),_0x701a('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x701a('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x701a('0x2'),_0x701a('0x3'),_0x701a('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x701a('0x7')]},'customField':{'type':Sequelize[_0x701a('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x701a('0x7')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index a61a592..6720297 100644 --- a/server/api/intServicenowField/intServicenowField.controller.js +++ b/server/api/intServicenowField/intServicenowField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2bfc=['end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','ServicenowField','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','rawAttributes','includeAll','catch','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x17479d,_0x593129){var _0x2d461c=function(_0x347164){while(--_0x347164){_0x17479d['push'](_0x17479d['shift']());}};_0x2d461c(++_0x593129);}(_0x2bfc,0xd1));var _0xc2bf=function(_0x4735fe,_0x227ea4){_0x4735fe=_0x4735fe-0x0;var _0x1c4be4=_0x2bfc[_0x4735fe];return _0x1c4be4;};'use strict';var emlformat=require(_0xc2bf('0x0'));var rimraf=require(_0xc2bf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc2bf('0x2'));var rp=require(_0xc2bf('0x3'));var moment=require(_0xc2bf('0x4'));var BPromise=require(_0xc2bf('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc2bf('0x6'));var sox=require(_0xc2bf('0x7'));var csv=require(_0xc2bf('0x8'));var ejs=require(_0xc2bf('0x9'));var fs=require('fs');var fs_extra=require(_0xc2bf('0xa'));var _=require(_0xc2bf('0xb'));var squel=require(_0xc2bf('0xc'));var crypto=require(_0xc2bf('0xd'));var jsforce=require(_0xc2bf('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc2bf('0x8'));var querystring=require('querystring');var Papa=require(_0xc2bf('0xf'));var Redis=require(_0xc2bf('0x10'));var authService=require(_0xc2bf('0x11'));var qs=require(_0xc2bf('0x12'));var as=require(_0xc2bf('0x13'));var hardwareService=require(_0xc2bf('0x14'));var logger=require(_0xc2bf('0x15'))(_0xc2bf('0x16'));var utils=require('../../config/utils');var config=require(_0xc2bf('0x17'));var licenseUtil=require(_0xc2bf('0x18'));var db=require(_0xc2bf('0x19'))['db'];function respondWithStatusCode(_0x5ef8ba,_0x6d6f27){_0x6d6f27=_0x6d6f27||0xcc;return function(_0x37ce5e){if(_0x37ce5e){return _0x5ef8ba[_0xc2bf('0x1a')](_0x6d6f27);}return _0x5ef8ba[_0xc2bf('0x1b')](_0x6d6f27)[_0xc2bf('0x1c')]();};}function respondWithResult(_0x349f4b,_0x59b19d){_0x59b19d=_0x59b19d||0xc8;return function(_0x305166){if(_0x305166){return _0x349f4b[_0xc2bf('0x1b')](_0x59b19d)[_0xc2bf('0x1d')](_0x305166);}};}function respondWithFilteredResult(_0x3cc4a7,_0x36b0a8){return function(_0x1142f3){if(_0x1142f3){var _0x4c7e5f=typeof _0x36b0a8[_0xc2bf('0x1e')]===_0xc2bf('0x1f')&&typeof _0x36b0a8[_0xc2bf('0x20')]===_0xc2bf('0x1f');var _0x52dcf0=_0x1142f3['count'];var _0x5dbd4a=_0x4c7e5f?0x0:_0x36b0a8[_0xc2bf('0x1e')];var _0x552325=_0x4c7e5f?_0x1142f3[_0xc2bf('0x21')]:_0x36b0a8[_0xc2bf('0x1e')]+_0x36b0a8[_0xc2bf('0x20')];var _0x4b6f33;if(_0x552325>=_0x52dcf0){_0x552325=_0x52dcf0;_0x4b6f33=0xc8;}else{_0x4b6f33=0xce;}_0x3cc4a7['status'](_0x4b6f33);return _0x3cc4a7[_0xc2bf('0x22')](_0xc2bf('0x23'),_0x5dbd4a+'-'+_0x552325+'/'+_0x52dcf0)[_0xc2bf('0x1d')](_0x1142f3);}return null;};}function patchUpdates(_0x3a3a5f){return function(_0x4279e0){try{jsonpatch[_0xc2bf('0x24')](_0x4279e0,_0x3a3a5f,!![]);}catch(_0x578980){return BPromise[_0xc2bf('0x25')](_0x578980);}return _0x4279e0[_0xc2bf('0x26')]();};}function saveUpdates(_0x543e6c,_0xae748e){return function(_0x1227d1){if(_0x1227d1){return _0x1227d1[_0xc2bf('0x27')](_0x543e6c)[_0xc2bf('0x28')](function(_0x49579e){return _0x49579e;});}return null;};}function removeEntity(_0xf38824,_0x22f12d){return function(_0x471a45){if(_0x471a45){return _0x471a45[_0xc2bf('0x29')]()[_0xc2bf('0x28')](function(){_0xf38824[_0xc2bf('0x1b')](0xcc)[_0xc2bf('0x1c')]();});}};}function handleEntityNotFound(_0x183d71,_0x1f5746){return function(_0x4d7461){if(!_0x4d7461){_0x183d71[_0xc2bf('0x1a')](0x194);}return _0x4d7461;};}function handleError(_0x375230,_0x287a0b){_0x287a0b=_0x287a0b||0x1f4;return function(_0x500b2d){logger[_0xc2bf('0x2a')](_0x500b2d['stack']);if(_0x500b2d[_0xc2bf('0x2b')]){delete _0x500b2d[_0xc2bf('0x2b')];}_0x375230['status'](_0x287a0b)[_0xc2bf('0x2c')](_0x500b2d);};}exports[_0xc2bf('0x2d')]=function(_0x1b4ec8,_0x4af6d1){var _0x2401a9={},_0x3c95c1={},_0x385764={'count':0x0,'rows':[]};var _0x1e28d2=_[_0xc2bf('0x2e')](db[_0xc2bf('0x2f')]['rawAttributes'],function(_0x233d61){return{'name':_0x233d61[_0xc2bf('0x30')],'type':_0x233d61['type'][_0xc2bf('0x31')]};});_0x3c95c1['model']=_[_0xc2bf('0x2e')](_0x1e28d2,'name');_0x3c95c1[_0xc2bf('0x32')]=_[_0xc2bf('0x33')](_0x1b4ec8[_0xc2bf('0x32')]);_0x3c95c1[_0xc2bf('0x34')]=_[_0xc2bf('0x35')](_0x3c95c1[_0xc2bf('0x36')],_0x3c95c1[_0xc2bf('0x32')]);_0x2401a9['attributes']=_[_0xc2bf('0x35')](_0x3c95c1[_0xc2bf('0x36')],qs[_0xc2bf('0x37')](_0x1b4ec8[_0xc2bf('0x32')][_0xc2bf('0x37')]));_0x2401a9[_0xc2bf('0x38')]=_0x2401a9['attributes'][_0xc2bf('0x39')]?_0x2401a9[_0xc2bf('0x38')]:_0x3c95c1[_0xc2bf('0x36')];if(!_0x1b4ec8[_0xc2bf('0x32')][_0xc2bf('0x3a')](_0xc2bf('0x3b'))){_0x2401a9[_0xc2bf('0x20')]=qs[_0xc2bf('0x20')](_0x1b4ec8[_0xc2bf('0x32')][_0xc2bf('0x20')]);_0x2401a9[_0xc2bf('0x1e')]=qs['offset'](_0x1b4ec8[_0xc2bf('0x32')][_0xc2bf('0x1e')]);}_0x2401a9[_0xc2bf('0x3c')]=qs[_0xc2bf('0x3d')](_0x1b4ec8[_0xc2bf('0x32')][_0xc2bf('0x3d')]);_0x2401a9[_0xc2bf('0x3e')]=qs['filters'](_[_0xc2bf('0x3f')](_0x1b4ec8['query'],_0x3c95c1[_0xc2bf('0x34')]),_0x1e28d2);if(_0x1b4ec8[_0xc2bf('0x32')][_0xc2bf('0x40')]){_0x2401a9[_0xc2bf('0x3e')]=_[_0xc2bf('0x41')](_0x2401a9[_0xc2bf('0x3e')],{'$or':_[_0xc2bf('0x2e')](_0x1e28d2,function(_0x10f9ba){if(_0x10f9ba['type']!==_0xc2bf('0x42')){var _0x1ed68e={};_0x1ed68e[_0x10f9ba[_0xc2bf('0x2b')]]={'$like':'%'+_0x1b4ec8[_0xc2bf('0x32')]['filter']+'%'};return _0x1ed68e;}})});}_0x2401a9=_['merge']({},_0x2401a9,_0x1b4ec8[_0xc2bf('0x43')]);var _0x58764f={'where':_0x2401a9['where']};return db[_0xc2bf('0x2f')][_0xc2bf('0x21')](_0x58764f)[_0xc2bf('0x28')](function(_0x5ac1e4){_0x385764[_0xc2bf('0x21')]=_0x5ac1e4;if(_0x1b4ec8[_0xc2bf('0x32')]['includeAll']){_0x2401a9[_0xc2bf('0x44')]=[{'all':!![]}];}return db['ServicenowField'][_0xc2bf('0x45')](_0x2401a9);})['then'](function(_0x357e30){_0x385764[_0xc2bf('0x46')]=_0x357e30;return _0x385764;})[_0xc2bf('0x28')](respondWithFilteredResult(_0x4af6d1,_0x2401a9))['catch'](handleError(_0x4af6d1,null));};exports[_0xc2bf('0x47')]=function(_0x1d3f86,_0x3a3172){var _0x359aea={'raw':!![],'where':{'id':_0x1d3f86[_0xc2bf('0x48')]['id']}},_0xfa59a3={};_0xfa59a3[_0xc2bf('0x36')]=_[_0xc2bf('0x33')](db[_0xc2bf('0x2f')][_0xc2bf('0x49')]);_0xfa59a3[_0xc2bf('0x32')]=_[_0xc2bf('0x33')](_0x1d3f86[_0xc2bf('0x32')]);_0xfa59a3[_0xc2bf('0x34')]=_['intersection'](_0xfa59a3[_0xc2bf('0x36')],_0xfa59a3[_0xc2bf('0x32')]);_0x359aea[_0xc2bf('0x38')]=_[_0xc2bf('0x35')](_0xfa59a3[_0xc2bf('0x36')],qs['fields'](_0x1d3f86[_0xc2bf('0x32')][_0xc2bf('0x37')]));_0x359aea[_0xc2bf('0x38')]=_0x359aea[_0xc2bf('0x38')]['length']?_0x359aea[_0xc2bf('0x38')]:_0xfa59a3[_0xc2bf('0x36')];if(_0x1d3f86['query'][_0xc2bf('0x4a')]){_0x359aea[_0xc2bf('0x44')]=[{'all':!![]}];}_0x359aea=_[_0xc2bf('0x41')]({},_0x359aea,_0x1d3f86[_0xc2bf('0x43')]);return db[_0xc2bf('0x2f')]['find'](_0x359aea)[_0xc2bf('0x28')](handleEntityNotFound(_0x3a3172,null))[_0xc2bf('0x28')](respondWithResult(_0x3a3172,null))[_0xc2bf('0x4b')](handleError(_0x3a3172,null));};exports[_0xc2bf('0x4c')]=function(_0x167620,_0x260ab7){return db[_0xc2bf('0x2f')][_0xc2bf('0x4c')](_0x167620[_0xc2bf('0x4d')],{})[_0xc2bf('0x28')](respondWithResult(_0x260ab7,0xc9))[_0xc2bf('0x4b')](handleError(_0x260ab7,null));};exports[_0xc2bf('0x27')]=function(_0x275cbb,_0x433cd1){if(_0x275cbb[_0xc2bf('0x4d')]['id']){delete _0x275cbb['body']['id'];}return db[_0xc2bf('0x2f')][_0xc2bf('0x4e')]({'where':{'id':_0x275cbb['params']['id']}})[_0xc2bf('0x28')](handleEntityNotFound(_0x433cd1,null))[_0xc2bf('0x28')](saveUpdates(_0x275cbb[_0xc2bf('0x4d')],null))[_0xc2bf('0x28')](respondWithResult(_0x433cd1,null))[_0xc2bf('0x4b')](handleError(_0x433cd1,null));};exports['destroy']=function(_0x1cd79b,_0x3b86a6){return db[_0xc2bf('0x2f')][_0xc2bf('0x4e')]({'where':{'id':_0x1cd79b[_0xc2bf('0x48')]['id']}})[_0xc2bf('0x28')](handleEntityNotFound(_0x3b86a6,null))['then'](removeEntity(_0x3b86a6,null))['catch'](handleError(_0x3b86a6,null));}; \ No newline at end of file +var _0x6889=['../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','then','sendStatus','error','stack','name','map','ServicenowField','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0x39e3f6,_0x22e943){var _0x4da733=function(_0x350527){while(--_0x350527){_0x39e3f6['push'](_0x39e3f6['shift']());}};_0x4da733(++_0x22e943);}(_0x6889,0x1d9));var _0x9688=function(_0x538967,_0x464c86){_0x538967=_0x538967-0x0;var _0x30bc9b=_0x6889[_0x538967];return _0x30bc9b;};'use strict';var emlformat=require(_0x9688('0x0'));var rimraf=require(_0x9688('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9688('0x2'));var rp=require(_0x9688('0x3'));var moment=require(_0x9688('0x4'));var BPromise=require(_0x9688('0x5'));var Mustache=require('mustache');var util=require(_0x9688('0x6'));var path=require('path');var sox=require(_0x9688('0x7'));var csv=require(_0x9688('0x8'));var ejs=require(_0x9688('0x9'));var fs=require('fs');var fs_extra=require(_0x9688('0xa'));var _=require(_0x9688('0xb'));var squel=require('squel');var crypto=require(_0x9688('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9688('0xd'));var toCsv=require(_0x9688('0x8'));var querystring=require(_0x9688('0xe'));var Papa=require(_0x9688('0xf'));var Redis=require(_0x9688('0x10'));var authService=require(_0x9688('0x11'));var qs=require(_0x9688('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9688('0x13'))(_0x9688('0x14'));var utils=require(_0x9688('0x15'));var config=require(_0x9688('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9688('0x17'))['db'];function respondWithStatusCode(_0x4a2375,_0x52189b){_0x52189b=_0x52189b||0xcc;return function(_0x4fc000){if(_0x4fc000){return _0x4a2375['sendStatus'](_0x52189b);}return _0x4a2375[_0x9688('0x18')](_0x52189b)[_0x9688('0x19')]();};}function respondWithResult(_0x455e19,_0x4c2184){_0x4c2184=_0x4c2184||0xc8;return function(_0x35aafb){if(_0x35aafb){return _0x455e19['status'](_0x4c2184)['json'](_0x35aafb);}};}function respondWithFilteredResult(_0x583272,_0x361c88){return function(_0x4e978e){if(_0x4e978e){var _0x5a9cc3=typeof _0x361c88[_0x9688('0x1a')]===_0x9688('0x1b')&&typeof _0x361c88[_0x9688('0x1c')]===_0x9688('0x1b');var _0x1bd7ff=_0x4e978e['count'];var _0xb76380=_0x5a9cc3?0x0:_0x361c88[_0x9688('0x1a')];var _0x256161=_0x5a9cc3?_0x4e978e[_0x9688('0x1d')]:_0x361c88[_0x9688('0x1a')]+_0x361c88[_0x9688('0x1c')];var _0x13289b;if(_0x256161>=_0x1bd7ff){_0x256161=_0x1bd7ff;_0x13289b=0xc8;}else{_0x13289b=0xce;}_0x583272[_0x9688('0x18')](_0x13289b);return _0x583272[_0x9688('0x1e')](_0x9688('0x1f'),_0xb76380+'-'+_0x256161+'/'+_0x1bd7ff)[_0x9688('0x20')](_0x4e978e);}return null;};}function patchUpdates(_0x3beabf){return function(_0x4dc038){try{jsonpatch['apply'](_0x4dc038,_0x3beabf,!![]);}catch(_0x180b42){return BPromise[_0x9688('0x21')](_0x180b42);}return _0x4dc038['save']();};}function saveUpdates(_0x1b2bf2,_0x4f42c6){return function(_0x3ec746){if(_0x3ec746){return _0x3ec746['update'](_0x1b2bf2)[_0x9688('0x22')](function(_0xccc414){return _0xccc414;});}return null;};}function removeEntity(_0x28981f,_0x505def){return function(_0x434045){if(_0x434045){return _0x434045['destroy']()[_0x9688('0x22')](function(){_0x28981f[_0x9688('0x18')](0xcc)[_0x9688('0x19')]();});}};}function handleEntityNotFound(_0x3de90a,_0x4da1c2){return function(_0x1f72f2){if(!_0x1f72f2){_0x3de90a[_0x9688('0x23')](0x194);}return _0x1f72f2;};}function handleError(_0x4c5ae8,_0x39ca76){_0x39ca76=_0x39ca76||0x1f4;return function(_0x18f7d3){logger[_0x9688('0x24')](_0x18f7d3[_0x9688('0x25')]);if(_0x18f7d3[_0x9688('0x26')]){delete _0x18f7d3[_0x9688('0x26')];}_0x4c5ae8['status'](_0x39ca76)['send'](_0x18f7d3);};}exports['index']=function(_0xf6345b,_0x1700bc){var _0x2d4408={},_0x4ae51f={},_0x3e20ae={'count':0x0,'rows':[]};var _0x42f713=_[_0x9688('0x27')](db[_0x9688('0x28')]['rawAttributes'],function(_0x5249a5){return{'name':_0x5249a5[_0x9688('0x29')],'type':_0x5249a5[_0x9688('0x2a')][_0x9688('0x2b')]};});_0x4ae51f['model']=_[_0x9688('0x27')](_0x42f713,_0x9688('0x26'));_0x4ae51f[_0x9688('0x2c')]=_[_0x9688('0x2d')](_0xf6345b[_0x9688('0x2c')]);_0x4ae51f[_0x9688('0x2e')]=_[_0x9688('0x2f')](_0x4ae51f[_0x9688('0x30')],_0x4ae51f['query']);_0x2d4408[_0x9688('0x31')]=_['intersection'](_0x4ae51f[_0x9688('0x30')],qs['fields'](_0xf6345b[_0x9688('0x2c')][_0x9688('0x32')]));_0x2d4408['attributes']=_0x2d4408[_0x9688('0x31')][_0x9688('0x33')]?_0x2d4408[_0x9688('0x31')]:_0x4ae51f[_0x9688('0x30')];if(!_0xf6345b[_0x9688('0x2c')][_0x9688('0x34')]('nolimit')){_0x2d4408[_0x9688('0x1c')]=qs['limit'](_0xf6345b[_0x9688('0x2c')][_0x9688('0x1c')]);_0x2d4408[_0x9688('0x1a')]=qs['offset'](_0xf6345b[_0x9688('0x2c')][_0x9688('0x1a')]);}_0x2d4408['order']=qs[_0x9688('0x35')](_0xf6345b[_0x9688('0x2c')][_0x9688('0x35')]);_0x2d4408[_0x9688('0x36')]=qs[_0x9688('0x2e')](_[_0x9688('0x37')](_0xf6345b[_0x9688('0x2c')],_0x4ae51f[_0x9688('0x2e')]),_0x42f713);if(_0xf6345b[_0x9688('0x2c')][_0x9688('0x38')]){_0x2d4408['where']=_[_0x9688('0x39')](_0x2d4408[_0x9688('0x36')],{'$or':_[_0x9688('0x27')](_0x42f713,function(_0x33259e){if(_0x33259e[_0x9688('0x2a')]!==_0x9688('0x3a')){var _0x4c3086={};_0x4c3086[_0x33259e['name']]={'$like':'%'+_0xf6345b[_0x9688('0x2c')][_0x9688('0x38')]+'%'};return _0x4c3086;}})});}_0x2d4408=_[_0x9688('0x39')]({},_0x2d4408,_0xf6345b[_0x9688('0x3b')]);var _0x63cb99={'where':_0x2d4408[_0x9688('0x36')]};return db[_0x9688('0x28')][_0x9688('0x1d')](_0x63cb99)['then'](function(_0x12a7a3){_0x3e20ae['count']=_0x12a7a3;if(_0xf6345b[_0x9688('0x2c')][_0x9688('0x3c')]){_0x2d4408[_0x9688('0x3d')]=[{'all':!![]}];}return db[_0x9688('0x28')]['findAll'](_0x2d4408);})[_0x9688('0x22')](function(_0x50ac0d){_0x3e20ae[_0x9688('0x3e')]=_0x50ac0d;return _0x3e20ae;})[_0x9688('0x22')](respondWithFilteredResult(_0x1700bc,_0x2d4408))[_0x9688('0x3f')](handleError(_0x1700bc,null));};exports[_0x9688('0x40')]=function(_0x7f14b,_0x4f981a){var _0x5e3d64={'raw':!![],'where':{'id':_0x7f14b[_0x9688('0x41')]['id']}},_0x907ed6={};_0x907ed6[_0x9688('0x30')]=_[_0x9688('0x2d')](db[_0x9688('0x28')][_0x9688('0x42')]);_0x907ed6['query']=_[_0x9688('0x2d')](_0x7f14b['query']);_0x907ed6[_0x9688('0x2e')]=_[_0x9688('0x2f')](_0x907ed6[_0x9688('0x30')],_0x907ed6[_0x9688('0x2c')]);_0x5e3d64['attributes']=_[_0x9688('0x2f')](_0x907ed6[_0x9688('0x30')],qs['fields'](_0x7f14b[_0x9688('0x2c')][_0x9688('0x32')]));_0x5e3d64[_0x9688('0x31')]=_0x5e3d64[_0x9688('0x31')][_0x9688('0x33')]?_0x5e3d64['attributes']:_0x907ed6['model'];if(_0x7f14b[_0x9688('0x2c')]['includeAll']){_0x5e3d64[_0x9688('0x3d')]=[{'all':!![]}];}_0x5e3d64=_[_0x9688('0x39')]({},_0x5e3d64,_0x7f14b[_0x9688('0x3b')]);return db['ServicenowField'][_0x9688('0x43')](_0x5e3d64)[_0x9688('0x22')](handleEntityNotFound(_0x4f981a,null))['then'](respondWithResult(_0x4f981a,null))['catch'](handleError(_0x4f981a,null));};exports['create']=function(_0x5ade1b,_0x36580a){return db[_0x9688('0x28')][_0x9688('0x44')](_0x5ade1b['body'],{})[_0x9688('0x22')](respondWithResult(_0x36580a,0xc9))['catch'](handleError(_0x36580a,null));};exports['update']=function(_0x27d182,_0x3ad862){if(_0x27d182['body']['id']){delete _0x27d182['body']['id'];}return db['ServicenowField']['find']({'where':{'id':_0x27d182[_0x9688('0x41')]['id']}})[_0x9688('0x22')](handleEntityNotFound(_0x3ad862,null))[_0x9688('0x22')](saveUpdates(_0x27d182[_0x9688('0x45')],null))[_0x9688('0x22')](respondWithResult(_0x3ad862,null))[_0x9688('0x3f')](handleError(_0x3ad862,null));};exports['destroy']=function(_0x52c9ac,_0x16f486){return db[_0x9688('0x28')]['find']({'where':{'id':_0x52c9ac['params']['id']}})[_0x9688('0x22')](handleEntityNotFound(_0x16f486,null))['then'](removeEntity(_0x16f486,null))[_0x9688('0x3f')](handleError(_0x16f486,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 68b348a..4de0dd7 100644 --- a/server/api/intServicenowField/intServicenowField.model.js +++ b/server/api/intServicenowField/intServicenowField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x43d6=['api','moment','bluebird','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x157d0f,_0x5ac489){var _0x5e300c=function(_0x586ed9){while(--_0x586ed9){_0x157d0f['push'](_0x157d0f['shift']());}};_0x5e300c(++_0x5ac489);}(_0x43d6,0xfc));var _0x643d=function(_0x291858,_0x2dc41a){_0x291858=_0x291858-0x0;var _0x519f1c=_0x43d6[_0x291858];return _0x519f1c;};'use strict';var _=require(_0x643d('0x0'));var util=require(_0x643d('0x1'));var logger=require(_0x643d('0x2'))(_0x643d('0x3'));var moment=require(_0x643d('0x4'));var BPromise=require(_0x643d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x643d('0x6'));var rimraf=require(_0x643d('0x7'));var config=require(_0x643d('0x8'));var attributes=require(_0x643d('0x9'));module[_0x643d('0xa')]=function(_0xa73884,_0x55fc76){return _0xa73884[_0x643d('0xb')](_0x643d('0xc'),attributes,{'tableName':_0x643d('0xd'),'paranoid':![],'indexes':[{'name':_0x643d('0xe'),'fields':[_0x643d('0xf'),_0x643d('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2e6a=['bluebird','request-promise','path','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','util','../../config/logger'];(function(_0x2972f3,_0x21f1ab){var _0x13dc82=function(_0xac9169){while(--_0xac9169){_0x2972f3['push'](_0x2972f3['shift']());}};_0x13dc82(++_0x21f1ab);}(_0x2e6a,0xee));var _0xa2e6=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2e6a[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0xa2e6('0x0'));var logger=require(_0xa2e6('0x1'))('api');var moment=require('moment');var BPromise=require(_0xa2e6('0x2'));var rp=require(_0xa2e6('0x3'));var fs=require('fs');var path=require(_0xa2e6('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intServicenowField.attributes');module[_0xa2e6('0x5')]=function(_0x1b2976,_0x2d0df8){return _0x1b2976[_0xa2e6('0x6')](_0xa2e6('0x7'),attributes,{'tableName':_0xa2e6('0x8'),'paranoid':![],'indexes':[{'name':_0xa2e6('0x9'),'fields':[_0xa2e6('0xa'),_0xa2e6('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index 96dca7e..3c7a2e6 100644 --- a/server/api/intServicenowField/intServicenowField.rpc.js +++ b/server/api/intServicenowField/intServicenowField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4eb=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x5f5b2f,_0x1863c4){var _0x16c260=function(_0x53b1b9){while(--_0x53b1b9){_0x5f5b2f['push'](_0x5f5b2f['shift']());}};_0x16c260(++_0x1863c4);}(_0xf4eb,0xec));var _0xbf4e=function(_0x5d3e15,_0xe6935a){_0x5d3e15=_0x5d3e15-0x0;var _0x15634c=_0xf4eb[_0x5d3e15];return _0x15634c;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('ServicenowField,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('ServicenowField,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file +var _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','error','ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x5e570c,_0x233990){var _0xc62527=function(_0xd18777){while(--_0xd18777){_0x5e570c['push'](_0x5e570c['shift']());}};_0xc62527(++_0x233990);}(_0xaa88,0x137));var _0x8aa8=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xaa88[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 4457d0b..26fd6f3 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x4e56ce,_0x4383a9){var _0x37e99e=function(_0x322a1b){while(--_0x322a1b){_0x4e56ce['push'](_0x4e56ce['shift']());}};_0x37e99e(++_0x4383a9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x58ff1b,_0x2fc0a6){var _0x584c75=function(_0x2b57ce){while(--_0x2b57ce){_0x58ff1b['push'](_0x58ff1b['shift']());}};_0x584c75(++_0x2fc0a6);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index cdd524f..fa06b47 100644 --- a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js +++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x37ea7f,_0x41fdfd){var _0x217ca0=function(_0x2e21e2){while(--_0x2e21e2){_0x37ea7f['push'](_0x37ea7f['shift']());}};_0x217ca0(++_0x41fdfd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x565225,_0x50ef18){var _0x44863a=function(_0x4a382d){while(--_0x4a382d){_0x565225['push'](_0x565225['shift']());}};_0x44863a(++_0x50ef18);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index eb20b42..034da93 100644 --- a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js +++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc914=['SugarcrmField','created_by','description','date_start','duration_minutes','parent_name','direction','password','remoteUri','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','username','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','Calls','values','module_fields','remove','endsWith','value','test','Wrong\x20credentials','statusCode','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','send','map','rawAttributes','fieldName','type','key','name','keys','query','filters','model','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','where','filter','merge','SugarcrmAccount','include','rows','catch','params','intersection','length','includeAll','create','body','find','findOne','options','getConfigurations','addConfiguration','Subjects','getSubjects','Descriptions','getDescriptions'];(function(_0x3a854a,_0xd4137f){var _0x19a93f=function(_0x1ea353){while(--_0x1ea353){_0x3a854a['push'](_0x3a854a['shift']());}};_0x19a93f(++_0xd4137f);}(_0xc914,0x173));var _0x4c91=function(_0x49394c,_0x5bbc6b){_0x49394c=_0x49394c-0x0;var _0x718259=_0xc914[_0x49394c];return _0x718259;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4c91('0x0'));var zipdir=require(_0x4c91('0x1'));var jsonpatch=require(_0x4c91('0x2'));var rp=require(_0x4c91('0x3'));var moment=require(_0x4c91('0x4'));var BPromise=require(_0x4c91('0x5'));var Mustache=require('mustache');var util=require(_0x4c91('0x6'));var path=require('path');var sox=require(_0x4c91('0x7'));var csv=require('to-csv');var ejs=require(_0x4c91('0x8'));var fs=require('fs');var fs_extra=require(_0x4c91('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4c91('0xa'));var jsforce=require(_0x4c91('0xb'));var deskjs=require(_0x4c91('0xc'));var toCsv=require(_0x4c91('0xd'));var querystring=require(_0x4c91('0xe'));var Papa=require(_0x4c91('0xf'));var Redis=require(_0x4c91('0x10'));var authService=require(_0x4c91('0x11'));var qs=require(_0x4c91('0x12'));var as=require(_0x4c91('0x13'));var hardwareService=require(_0x4c91('0x14'));var logger=require(_0x4c91('0x15'))(_0x4c91('0x16'));var utils=require('../../config/utils');var config=require(_0x4c91('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x4c91('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2e5101,_0x4a34e2){_0x4a34e2=_0x4a34e2||0xcc;return function(_0x1f965c){if(_0x1f965c){return _0x2e5101[_0x4c91('0x19')](_0x4a34e2);}return _0x2e5101[_0x4c91('0x1a')](_0x4a34e2)[_0x4c91('0x1b')]();};}function respondWithResult(_0x413ad4,_0x321570){_0x321570=_0x321570||0xc8;return function(_0x3b083a){if(_0x3b083a){return _0x413ad4['status'](_0x321570)[_0x4c91('0x1c')](_0x3b083a);}};}function respondWithFilteredResult(_0x2723cc,_0x413997){return function(_0x36105e){if(_0x36105e){var _0x57d876=typeof _0x413997[_0x4c91('0x1d')]===_0x4c91('0x1e')&&typeof _0x413997['limit']===_0x4c91('0x1e');var _0x5dbc45=_0x36105e[_0x4c91('0x1f')];var _0x38411d=_0x57d876?0x0:_0x413997['offset'];var _0x5accb5=_0x57d876?_0x36105e[_0x4c91('0x1f')]:_0x413997['offset']+_0x413997[_0x4c91('0x20')];var _0x8fcb0c;if(_0x5accb5>=_0x5dbc45){_0x5accb5=_0x5dbc45;_0x8fcb0c=0xc8;}else{_0x8fcb0c=0xce;}_0x2723cc['status'](_0x8fcb0c);return _0x2723cc[_0x4c91('0x21')](_0x4c91('0x22'),_0x38411d+'-'+_0x5accb5+'/'+_0x5dbc45)['json'](_0x36105e);}return null;};}function patchUpdates(_0x135c21){return function(_0x43702e){try{jsonpatch[_0x4c91('0x23')](_0x43702e,_0x135c21,!![]);}catch(_0x23028c){return BPromise[_0x4c91('0x24')](_0x23028c);}return _0x43702e[_0x4c91('0x25')]();};}function saveUpdates(_0x1c6af9,_0x3fac3b){return function(_0x3a833c){if(_0x3a833c){return _0x3a833c[_0x4c91('0x26')](_0x1c6af9)['then'](function(_0x2eb5db){return _0x2eb5db;});}return null;};}function removeEntity(_0x43dfb6,_0x23d90b){return function(_0x3dc31f){if(_0x3dc31f){return _0x3dc31f[_0x4c91('0x27')]()[_0x4c91('0x28')](function(){_0x43dfb6[_0x4c91('0x1a')](0xcc)[_0x4c91('0x1b')]();});}};}function handleEntityNotFound(_0x30ebb2,_0x37ab47){return function(_0x1fd1ce){if(!_0x1fd1ce){_0x30ebb2['sendStatus'](0x194);}return _0x1fd1ce;};}function handleError(_0x385d75,_0xd72464){_0xd72464=_0xd72464||0x1f4;return function(_0x2c07d7){logger['error'](_0x2c07d7['stack']);if(_0x2c07d7['name']){delete _0x2c07d7['name'];}_0x385d75[_0x4c91('0x1a')](_0xd72464)[_0x4c91('0x29')](_0x2c07d7);};}exports['index']=function(_0x26ca80,_0x3e2634){var _0x5c29c4={},_0x3439b7={},_0x26b61c={'count':0x0,'rows':[]};var _0x4f5b24=_[_0x4c91('0x2a')](db['SugarcrmAccount'][_0x4c91('0x2b')],function(_0x4bb704){return{'name':_0x4bb704[_0x4c91('0x2c')],'type':_0x4bb704[_0x4c91('0x2d')][_0x4c91('0x2e')]};});_0x3439b7['model']=_['map'](_0x4f5b24,_0x4c91('0x2f'));_0x3439b7['query']=_[_0x4c91('0x30')](_0x26ca80[_0x4c91('0x31')]);_0x3439b7[_0x4c91('0x32')]=_['intersection'](_0x3439b7[_0x4c91('0x33')],_0x3439b7[_0x4c91('0x31')]);_0x5c29c4['attributes']=_['intersection'](_0x3439b7['model'],qs[_0x4c91('0x34')](_0x26ca80[_0x4c91('0x31')][_0x4c91('0x34')]));_0x5c29c4['attributes']=_0x5c29c4['attributes']['length']?_0x5c29c4[_0x4c91('0x35')]:_0x3439b7[_0x4c91('0x33')];if(!_0x26ca80['query'][_0x4c91('0x36')](_0x4c91('0x37'))){_0x5c29c4[_0x4c91('0x20')]=qs[_0x4c91('0x20')](_0x26ca80[_0x4c91('0x31')][_0x4c91('0x20')]);_0x5c29c4[_0x4c91('0x1d')]=qs[_0x4c91('0x1d')](_0x26ca80['query']['offset']);}_0x5c29c4[_0x4c91('0x38')]=qs['sort'](_0x26ca80[_0x4c91('0x31')][_0x4c91('0x39')]);_0x5c29c4['where']=qs['filters'](_[_0x4c91('0x3a')](_0x26ca80[_0x4c91('0x31')],_0x3439b7[_0x4c91('0x32')]),_0x4f5b24);if(_0x26ca80[_0x4c91('0x31')]['filter']){_0x5c29c4[_0x4c91('0x3b')]=_['merge'](_0x5c29c4[_0x4c91('0x3b')],{'$or':_[_0x4c91('0x2a')](_0x4f5b24,function(_0x1999f3){if(_0x1999f3[_0x4c91('0x2d')]!=='VIRTUAL'){var _0x1c7544={};_0x1c7544[_0x1999f3[_0x4c91('0x2f')]]={'$like':'%'+_0x26ca80[_0x4c91('0x31')][_0x4c91('0x3c')]+'%'};return _0x1c7544;}})});}_0x5c29c4=_[_0x4c91('0x3d')]({},_0x5c29c4,_0x26ca80['options']);var _0x2a1918={'where':_0x5c29c4[_0x4c91('0x3b')]};return db[_0x4c91('0x3e')][_0x4c91('0x1f')](_0x2a1918)['then'](function(_0xe3bcd5){_0x26b61c[_0x4c91('0x1f')]=_0xe3bcd5;if(_0x26ca80[_0x4c91('0x31')]['includeAll']){_0x5c29c4[_0x4c91('0x3f')]=[{'all':!![]}];}return db[_0x4c91('0x3e')]['findAll'](_0x5c29c4);})[_0x4c91('0x28')](function(_0x448b58){_0x26b61c[_0x4c91('0x40')]=_0x448b58;return _0x26b61c;})[_0x4c91('0x28')](respondWithFilteredResult(_0x3e2634,_0x5c29c4))[_0x4c91('0x41')](handleError(_0x3e2634,null));};exports['show']=function(_0x552067,_0x37dbe8){var _0xeb4ba9={'raw':![],'where':{'id':_0x552067[_0x4c91('0x42')]['id']}},_0x56a3f8={};_0x56a3f8[_0x4c91('0x33')]=_[_0x4c91('0x30')](db[_0x4c91('0x3e')][_0x4c91('0x2b')]);_0x56a3f8[_0x4c91('0x31')]=_[_0x4c91('0x30')](_0x552067[_0x4c91('0x31')]);_0x56a3f8[_0x4c91('0x32')]=_['intersection'](_0x56a3f8['model'],_0x56a3f8[_0x4c91('0x31')]);_0xeb4ba9['attributes']=_[_0x4c91('0x43')](_0x56a3f8['model'],qs[_0x4c91('0x34')](_0x552067[_0x4c91('0x31')]['fields']));_0xeb4ba9[_0x4c91('0x35')]=_0xeb4ba9[_0x4c91('0x35')][_0x4c91('0x44')]?_0xeb4ba9[_0x4c91('0x35')]:_0x56a3f8[_0x4c91('0x33')];if(_0x552067[_0x4c91('0x31')][_0x4c91('0x45')]){_0xeb4ba9[_0x4c91('0x3f')]=[{'all':!![]}];}_0xeb4ba9=_['merge']({},_0xeb4ba9,_0x552067['options']);return db[_0x4c91('0x3e')]['find'](_0xeb4ba9)['then'](handleEntityNotFound(_0x37dbe8,null))[_0x4c91('0x28')](respondWithResult(_0x37dbe8,null))[_0x4c91('0x41')](handleError(_0x37dbe8,null));};exports[_0x4c91('0x46')]=function(_0x1c6022,_0x24c9a6){return db[_0x4c91('0x3e')][_0x4c91('0x46')](_0x1c6022[_0x4c91('0x47')],{})[_0x4c91('0x28')](respondWithResult(_0x24c9a6,0xc9))[_0x4c91('0x41')](handleError(_0x24c9a6,null));};exports['update']=function(_0x7b3ac7,_0xf058bf){if(_0x7b3ac7[_0x4c91('0x47')]['id']){delete _0x7b3ac7[_0x4c91('0x47')]['id'];}return db[_0x4c91('0x3e')][_0x4c91('0x48')]({'where':{'id':_0x7b3ac7['params']['id']}})[_0x4c91('0x28')](handleEntityNotFound(_0xf058bf,null))[_0x4c91('0x28')](saveUpdates(_0x7b3ac7[_0x4c91('0x47')],null))[_0x4c91('0x28')](respondWithResult(_0xf058bf,null))[_0x4c91('0x41')](handleError(_0xf058bf,null));};exports[_0x4c91('0x27')]=function(_0x571998,_0x4db8a3){return db[_0x4c91('0x3e')][_0x4c91('0x48')]({'where':{'id':_0x571998['params']['id']}})[_0x4c91('0x28')](handleEntityNotFound(_0x4db8a3,null))[_0x4c91('0x28')](removeEntity(_0x4db8a3,null))[_0x4c91('0x41')](handleError(_0x4db8a3,null));};exports['getConfigurations']=function(_0x5a3c28,_0x2dbcf9,_0x3ad884){var _0x4ced83={};var _0x1f88d8={};var _0x5117d6;var _0x503245;return db['SugarcrmAccount'][_0x4c91('0x49')]({'where':{'id':_0x5a3c28[_0x4c91('0x42')]['id']}})['then'](handleEntityNotFound(_0x2dbcf9,null))[_0x4c91('0x28')](function(_0x43293b){if(_0x43293b){_0x5117d6=_0x43293b;_0x1f88d8[_0x4c91('0x33')]=_[_0x4c91('0x30')](db['SugarcrmConfiguration'][_0x4c91('0x2b')]);_0x1f88d8[_0x4c91('0x31')]=_['keys'](_0x5a3c28[_0x4c91('0x31')]);_0x1f88d8[_0x4c91('0x32')]=_[_0x4c91('0x43')](_0x1f88d8[_0x4c91('0x33')],_0x1f88d8['query']);_0x4ced83['attributes']=_['intersection'](_0x1f88d8[_0x4c91('0x33')],qs[_0x4c91('0x34')](_0x5a3c28['query']['fields']));_0x4ced83[_0x4c91('0x35')]=_0x4ced83[_0x4c91('0x35')][_0x4c91('0x44')]?_0x4ced83[_0x4c91('0x35')]:_0x1f88d8[_0x4c91('0x33')];_0x4ced83[_0x4c91('0x38')]=qs['sort'](_0x5a3c28['query'][_0x4c91('0x39')]);_0x4ced83[_0x4c91('0x3b')]=qs[_0x4c91('0x32')](_['pick'](_0x5a3c28[_0x4c91('0x31')],_0x1f88d8[_0x4c91('0x32')]));if(_0x5a3c28[_0x4c91('0x31')][_0x4c91('0x3c')]){_0x4ced83[_0x4c91('0x3b')]=_['merge'](_0x4ced83['where'],{'$or':_[_0x4c91('0x2a')](_0x4ced83['attributes'],function(_0x53c339){var _0x429bef={};_0x429bef[_0x53c339]={'$like':'%'+_0x5a3c28[_0x4c91('0x31')][_0x4c91('0x3c')]+'%'};return _0x429bef;})});}_0x4ced83=_[_0x4c91('0x3d')]({},_0x4ced83,_0x5a3c28[_0x4c91('0x4a')]);return _0x5117d6['getConfigurations'](_0x4ced83);}})[_0x4c91('0x28')](function(_0x25fa2d){if(_0x25fa2d){_0x503245=_0x25fa2d[_0x4c91('0x44')];if(!_0x5a3c28['query'][_0x4c91('0x36')](_0x4c91('0x37'))){_0x4ced83[_0x4c91('0x20')]=qs['limit'](_0x5a3c28[_0x4c91('0x31')][_0x4c91('0x20')]);_0x4ced83['offset']=qs[_0x4c91('0x1d')](_0x5a3c28['query'][_0x4c91('0x1d')]);}return _0x5117d6[_0x4c91('0x4b')](_0x4ced83);}})[_0x4c91('0x28')](function(_0x5cf1b2){if(_0x5cf1b2){return _0x5cf1b2?{'count':_0x503245,'rows':_0x5cf1b2}:null;}})[_0x4c91('0x28')](respondWithResult(_0x2dbcf9,null))[_0x4c91('0x41')](handleError(_0x2dbcf9,null));};exports[_0x4c91('0x4c')]=function(_0x976b47,_0x5f468c,_0x70b41c){if(_0x976b47['body']['id']){delete _0x976b47['body']['id'];}return db['SugarcrmAccount'][_0x4c91('0x49')]({'where':{'id':_0x976b47[_0x4c91('0x42')]['id']}})[_0x4c91('0x28')](handleEntityNotFound(_0x5f468c,null))['then'](function(_0x1a2efc){if(_0x1a2efc){_0x976b47[_0x4c91('0x47')]['AccountId']=_0x1a2efc['id'];_0x976b47['body'][_0x4c91('0x4d')]=integrations[_0x4c91('0x4e')](_0x976b47[_0x4c91('0x47')]['channel'],_0x976b47[_0x4c91('0x47')][_0x4c91('0x2d')]);_0x976b47[_0x4c91('0x47')][_0x4c91('0x4f')]=integrations[_0x4c91('0x50')](_0x976b47[_0x4c91('0x47')]['channel'],_0x976b47[_0x4c91('0x47')][_0x4c91('0x2d')]);return db['SugarcrmConfiguration']['create'](_0x976b47[_0x4c91('0x47')],{'include':[{'model':db[_0x4c91('0x51')],'as':_0x4c91('0x4d')},{'model':db[_0x4c91('0x51')],'as':_0x4c91('0x4f')}]});}return null;})[_0x4c91('0x28')](respondWithResult(_0x5f468c,null))[_0x4c91('0x41')](handleError(_0x5f468c,null));};exports['getFields']=function(_0x36338f,_0x2376dd,_0x29a24a){var _0x57a0d3='';var _0x242ad8=['id',_0x4c91('0x2f'),'assigned_user_id',_0x4c91('0x52'),_0x4c91('0x53'),_0x4c91('0x54'),'duration_hours',_0x4c91('0x55'),'parent_id','parent_type',_0x4c91('0x56'),_0x4c91('0x57')];return db[_0x4c91('0x3e')][_0x4c91('0x49')]({'where':{'id':_0x36338f[_0x4c91('0x42')]['id']},'attributes':['id','username',_0x4c91('0x58'),_0x4c91('0x59')]})['then'](handleEntityNotFound(_0x2376dd,null))[_0x4c91('0x28')](function(_0x398763){if(_0x398763){_0x57a0d3=_0x398763['remoteUri'];var _0x3b862d=_0x57a0d3['slice'](-0x1);if(_0x3b862d==='/'){_0x57a0d3=_0x57a0d3[_0x4c91('0x5a')](0x0,_0x57a0d3[_0x4c91('0x5b')](_0x3b862d));}return rp({'method':_0x4c91('0x5c'),'uri':util[_0x4c91('0x5d')](_0x4c91('0x5e'),_0x57a0d3,_0x4c91('0x5f')),'json':!![],'form':{'method':_0x4c91('0x60'),'input_type':_0x4c91('0x61'),'response_type':_0x4c91('0x61'),'rest_data':JSON[_0x4c91('0x62')]({'user_auth':{'user_name':_0x398763[_0x4c91('0x63')],'password':_0x398763['password'],'encryption':'PLAIN'},'application':_0x4c91('0x64')})}});}})['then'](function(_0x2ff1f5){if(_0x2ff1f5&&_0x2ff1f5['name']!==_0x4c91('0x65')&&_0x2ff1f5[_0x4c91('0x2f')]!==_0x4c91('0x66')){return rp({'method':_0x4c91('0x5c'),'uri':util['format'](_0x4c91('0x5e'),_0x57a0d3,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x4c91('0x67'),'input_type':'JSON','response_type':_0x4c91('0x61'),'rest_data':JSON[_0x4c91('0x62')]({'session':_0x2ff1f5['id'],'module_name':_0x4c91('0x68')})}})[_0x4c91('0x28')](function(_0x46d20b){if(_0x46d20b){var _0x157948=_[_0x4c91('0x69')](_0x46d20b[_0x4c91('0x6a')]);_[_0x4c91('0x6b')](_0x157948,function(_0x1132d7){return _0x242ad8['includes'](_0x1132d7[_0x4c91('0x2f')]);});return{'count':_0x157948[_0x4c91('0x44')],'rows':_[_0x4c91('0x2a')](_0x157948,function(_0x1638d1){return{'id':_0x1638d1['name'],'name':_0x1638d1['label'],'custom':_[_0x4c91('0x6c')](_0x1638d1[_0x4c91('0x2f')],'_c')?!![]:![],'options':_0x1638d1['options']?_[_0x4c91('0x2a')](_[_0x4c91('0x69')](_0x1638d1[_0x4c91('0x4a')]),function(_0x45284e){return{'name':_0x45284e[_0x4c91('0x6d')],'value':_0x45284e[_0x4c91('0x2f')]};}):[]};})};}})[_0x4c91('0x28')](respondWithResult(_0x2376dd,null))[_0x4c91('0x41')](function(_0x18fd85){var _0x10e8f0=_0x36338f[_0x4c91('0x31')][_0x4c91('0x6e')]?0x1f4:_0x18fd85['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x10e8f0,JSON[_0x4c91('0x62')](_0x18fd85));delete _0x18fd85[_0x4c91('0x2f')];if(_0x10e8f0===0x191){_0x10e8f0=0x190;}_0x2376dd[_0x4c91('0x1a')](_0x10e8f0)[_0x4c91('0x29')](_0x36338f[_0x4c91('0x31')]['test']?{'message':_0x4c91('0x6f'),'statusCode':_0x18fd85[_0x4c91('0x70')]}:_0x18fd85);});}else{var _0x15bfb2=0x1f4;_0x2376dd[_0x4c91('0x1a')](_0x15bfb2)[_0x4c91('0x29')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0x1fca=['send','index','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','SugarcrmAccount','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','Subjects','channel','Descriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_minutes','parent_id','parent_type','parent_name','direction','username','remoteUri','substring','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','password','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','get_module_fields','Calls','values','module_fields','label','endsWith','value','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','limit','count','offset','set','json','apply','reject','update','then','end','error','stack','name'];(function(_0x4f8af0,_0x3baa04){var _0x22889f=function(_0x287a1f){while(--_0x287a1f){_0x4f8af0['push'](_0x4f8af0['shift']());}};_0x22889f(++_0x3baa04);}(_0x1fca,0x138));var _0xa1fc=function(_0xa14522,_0x5df820){_0xa14522=_0xa14522-0x0;var _0x1fb7cb=_0x1fca[_0xa14522];return _0x1fb7cb;};'use strict';var emlformat=require(_0xa1fc('0x0'));var rimraf=require(_0xa1fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa1fc('0x2'));var moment=require(_0xa1fc('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa1fc('0x4'));var util=require(_0xa1fc('0x5'));var path=require(_0xa1fc('0x6'));var sox=require(_0xa1fc('0x7'));var csv=require(_0xa1fc('0x8'));var ejs=require(_0xa1fc('0x9'));var fs=require('fs');var fs_extra=require(_0xa1fc('0xa'));var _=require(_0xa1fc('0xb'));var squel=require(_0xa1fc('0xc'));var crypto=require(_0xa1fc('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa1fc('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa1fc('0xf'));var Papa=require(_0xa1fc('0x10'));var Redis=require(_0xa1fc('0x11'));var authService=require(_0xa1fc('0x12'));var qs=require(_0xa1fc('0x13'));var as=require(_0xa1fc('0x14'));var hardwareService=require(_0xa1fc('0x15'));var logger=require(_0xa1fc('0x16'))(_0xa1fc('0x17'));var utils=require(_0xa1fc('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xa1fc('0x19'));var db=require(_0xa1fc('0x1a'))['db'];var integrations=require(_0xa1fc('0x1b'));function respondWithStatusCode(_0x28de26,_0x5be976){_0x5be976=_0x5be976||0xcc;return function(_0x1dbe7a){if(_0x1dbe7a){return _0x28de26['sendStatus'](_0x5be976);}return _0x28de26[_0xa1fc('0x1c')](_0x5be976)['end']();};}function respondWithResult(_0xd2cae8,_0x4db77f){_0x4db77f=_0x4db77f||0xc8;return function(_0x4db1aa){if(_0x4db1aa){return _0xd2cae8['status'](_0x4db77f)['json'](_0x4db1aa);}};}function respondWithFilteredResult(_0x9d82a1,_0x24b3b7){return function(_0x267f65){if(_0x267f65){var _0x514ee5=typeof _0x24b3b7['offset']==='undefined'&&typeof _0x24b3b7[_0xa1fc('0x1d')]==='undefined';var _0x157dfa=_0x267f65['count'];var _0x4bc115=_0x514ee5?0x0:_0x24b3b7['offset'];var _0x8ae8ac=_0x514ee5?_0x267f65[_0xa1fc('0x1e')]:_0x24b3b7[_0xa1fc('0x1f')]+_0x24b3b7[_0xa1fc('0x1d')];var _0x2818eb;if(_0x8ae8ac>=_0x157dfa){_0x8ae8ac=_0x157dfa;_0x2818eb=0xc8;}else{_0x2818eb=0xce;}_0x9d82a1[_0xa1fc('0x1c')](_0x2818eb);return _0x9d82a1[_0xa1fc('0x20')]('Content-Range',_0x4bc115+'-'+_0x8ae8ac+'/'+_0x157dfa)[_0xa1fc('0x21')](_0x267f65);}return null;};}function patchUpdates(_0x195aa4){return function(_0x5bd263){try{jsonpatch[_0xa1fc('0x22')](_0x5bd263,_0x195aa4,!![]);}catch(_0x391fdc){return BPromise[_0xa1fc('0x23')](_0x391fdc);}return _0x5bd263['save']();};}function saveUpdates(_0x9b5d9c,_0x6a54bd){return function(_0xa1583){if(_0xa1583){return _0xa1583[_0xa1fc('0x24')](_0x9b5d9c)[_0xa1fc('0x25')](function(_0x1074b1){return _0x1074b1;});}return null;};}function removeEntity(_0x35b004,_0x384aec){return function(_0x18ac52){if(_0x18ac52){return _0x18ac52['destroy']()[_0xa1fc('0x25')](function(){_0x35b004['status'](0xcc)[_0xa1fc('0x26')]();});}};}function handleEntityNotFound(_0x46286c,_0x39e608){return function(_0x210b6c){if(!_0x210b6c){_0x46286c['sendStatus'](0x194);}return _0x210b6c;};}function handleError(_0x33f3c4,_0x48bdbe){_0x48bdbe=_0x48bdbe||0x1f4;return function(_0x4c8bfe){logger[_0xa1fc('0x27')](_0x4c8bfe[_0xa1fc('0x28')]);if(_0x4c8bfe['name']){delete _0x4c8bfe[_0xa1fc('0x29')];}_0x33f3c4[_0xa1fc('0x1c')](_0x48bdbe)[_0xa1fc('0x2a')](_0x4c8bfe);};}exports[_0xa1fc('0x2b')]=function(_0x59027e,_0x1719dc){var _0x4b74db={},_0x3533fb={},_0x525816={'count':0x0,'rows':[]};var _0x19822a=_[_0xa1fc('0x2c')](db['SugarcrmAccount']['rawAttributes'],function(_0x216146){return{'name':_0x216146[_0xa1fc('0x2d')],'type':_0x216146[_0xa1fc('0x2e')][_0xa1fc('0x2f')]};});_0x3533fb[_0xa1fc('0x30')]=_[_0xa1fc('0x2c')](_0x19822a,_0xa1fc('0x29'));_0x3533fb[_0xa1fc('0x31')]=_[_0xa1fc('0x32')](_0x59027e[_0xa1fc('0x31')]);_0x3533fb[_0xa1fc('0x33')]=_['intersection'](_0x3533fb[_0xa1fc('0x30')],_0x3533fb[_0xa1fc('0x31')]);_0x4b74db['attributes']=_[_0xa1fc('0x34')](_0x3533fb[_0xa1fc('0x30')],qs['fields'](_0x59027e[_0xa1fc('0x31')][_0xa1fc('0x35')]));_0x4b74db[_0xa1fc('0x36')]=_0x4b74db[_0xa1fc('0x36')][_0xa1fc('0x37')]?_0x4b74db[_0xa1fc('0x36')]:_0x3533fb[_0xa1fc('0x30')];if(!_0x59027e[_0xa1fc('0x31')][_0xa1fc('0x38')](_0xa1fc('0x39'))){_0x4b74db['limit']=qs[_0xa1fc('0x1d')](_0x59027e['query'][_0xa1fc('0x1d')]);_0x4b74db[_0xa1fc('0x1f')]=qs[_0xa1fc('0x1f')](_0x59027e['query'][_0xa1fc('0x1f')]);}_0x4b74db[_0xa1fc('0x3a')]=qs[_0xa1fc('0x3b')](_0x59027e['query'][_0xa1fc('0x3b')]);_0x4b74db['where']=qs[_0xa1fc('0x33')](_[_0xa1fc('0x3c')](_0x59027e['query'],_0x3533fb[_0xa1fc('0x33')]),_0x19822a);if(_0x59027e[_0xa1fc('0x31')][_0xa1fc('0x3d')]){_0x4b74db[_0xa1fc('0x3e')]=_[_0xa1fc('0x3f')](_0x4b74db['where'],{'$or':_[_0xa1fc('0x2c')](_0x19822a,function(_0x5cd200){if(_0x5cd200[_0xa1fc('0x2e')]!==_0xa1fc('0x40')){var _0x4a223b={};_0x4a223b[_0x5cd200[_0xa1fc('0x29')]]={'$like':'%'+_0x59027e[_0xa1fc('0x31')][_0xa1fc('0x3d')]+'%'};return _0x4a223b;}})});}_0x4b74db=_[_0xa1fc('0x3f')]({},_0x4b74db,_0x59027e[_0xa1fc('0x41')]);var _0x37cc86={'where':_0x4b74db['where']};return db[_0xa1fc('0x42')][_0xa1fc('0x1e')](_0x37cc86)[_0xa1fc('0x25')](function(_0x363ea1){_0x525816[_0xa1fc('0x1e')]=_0x363ea1;if(_0x59027e[_0xa1fc('0x31')][_0xa1fc('0x43')]){_0x4b74db[_0xa1fc('0x44')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0xa1fc('0x45')](_0x4b74db);})[_0xa1fc('0x25')](function(_0x5ce083){_0x525816[_0xa1fc('0x46')]=_0x5ce083;return _0x525816;})['then'](respondWithFilteredResult(_0x1719dc,_0x4b74db))[_0xa1fc('0x47')](handleError(_0x1719dc,null));};exports[_0xa1fc('0x48')]=function(_0xa054e1,_0x294591){var _0x52af01={'raw':![],'where':{'id':_0xa054e1[_0xa1fc('0x49')]['id']}},_0x1a7a25={};_0x1a7a25[_0xa1fc('0x30')]=_[_0xa1fc('0x32')](db[_0xa1fc('0x42')][_0xa1fc('0x4a')]);_0x1a7a25['query']=_[_0xa1fc('0x32')](_0xa054e1['query']);_0x1a7a25[_0xa1fc('0x33')]=_['intersection'](_0x1a7a25[_0xa1fc('0x30')],_0x1a7a25[_0xa1fc('0x31')]);_0x52af01['attributes']=_[_0xa1fc('0x34')](_0x1a7a25['model'],qs['fields'](_0xa054e1['query']['fields']));_0x52af01[_0xa1fc('0x36')]=_0x52af01[_0xa1fc('0x36')]['length']?_0x52af01['attributes']:_0x1a7a25[_0xa1fc('0x30')];if(_0xa054e1['query'][_0xa1fc('0x43')]){_0x52af01[_0xa1fc('0x44')]=[{'all':!![]}];}_0x52af01=_['merge']({},_0x52af01,_0xa054e1[_0xa1fc('0x41')]);return db[_0xa1fc('0x42')][_0xa1fc('0x4b')](_0x52af01)[_0xa1fc('0x25')](handleEntityNotFound(_0x294591,null))['then'](respondWithResult(_0x294591,null))[_0xa1fc('0x47')](handleError(_0x294591,null));};exports['create']=function(_0x5d6ea7,_0x1fbe76){return db['SugarcrmAccount'][_0xa1fc('0x4c')](_0x5d6ea7['body'],{})[_0xa1fc('0x25')](respondWithResult(_0x1fbe76,0xc9))[_0xa1fc('0x47')](handleError(_0x1fbe76,null));};exports[_0xa1fc('0x24')]=function(_0x486130,_0x5cea77){if(_0x486130[_0xa1fc('0x4d')]['id']){delete _0x486130[_0xa1fc('0x4d')]['id'];}return db[_0xa1fc('0x42')]['find']({'where':{'id':_0x486130['params']['id']}})['then'](handleEntityNotFound(_0x5cea77,null))['then'](saveUpdates(_0x486130['body'],null))[_0xa1fc('0x25')](respondWithResult(_0x5cea77,null))[_0xa1fc('0x47')](handleError(_0x5cea77,null));};exports['destroy']=function(_0x4f274a,_0x206eac){return db[_0xa1fc('0x42')][_0xa1fc('0x4b')]({'where':{'id':_0x4f274a[_0xa1fc('0x49')]['id']}})[_0xa1fc('0x25')](handleEntityNotFound(_0x206eac,null))[_0xa1fc('0x25')](removeEntity(_0x206eac,null))[_0xa1fc('0x47')](handleError(_0x206eac,null));};exports[_0xa1fc('0x4e')]=function(_0x59d6da,_0x34cf8f,_0x5adf52){var _0x1ff927={};var _0x32f467={};var _0x271642;var _0x1c0f31;return db[_0xa1fc('0x42')][_0xa1fc('0x4f')]({'where':{'id':_0x59d6da['params']['id']}})[_0xa1fc('0x25')](handleEntityNotFound(_0x34cf8f,null))['then'](function(_0x5b3e83){if(_0x5b3e83){_0x271642=_0x5b3e83;_0x32f467[_0xa1fc('0x30')]=_['keys'](db[_0xa1fc('0x50')][_0xa1fc('0x4a')]);_0x32f467['query']=_[_0xa1fc('0x32')](_0x59d6da[_0xa1fc('0x31')]);_0x32f467[_0xa1fc('0x33')]=_[_0xa1fc('0x34')](_0x32f467[_0xa1fc('0x30')],_0x32f467[_0xa1fc('0x31')]);_0x1ff927['attributes']=_[_0xa1fc('0x34')](_0x32f467[_0xa1fc('0x30')],qs[_0xa1fc('0x35')](_0x59d6da['query'][_0xa1fc('0x35')]));_0x1ff927[_0xa1fc('0x36')]=_0x1ff927[_0xa1fc('0x36')][_0xa1fc('0x37')]?_0x1ff927[_0xa1fc('0x36')]:_0x32f467[_0xa1fc('0x30')];_0x1ff927['order']=qs[_0xa1fc('0x3b')](_0x59d6da[_0xa1fc('0x31')][_0xa1fc('0x3b')]);_0x1ff927[_0xa1fc('0x3e')]=qs['filters'](_[_0xa1fc('0x3c')](_0x59d6da['query'],_0x32f467[_0xa1fc('0x33')]));if(_0x59d6da[_0xa1fc('0x31')][_0xa1fc('0x3d')]){_0x1ff927[_0xa1fc('0x3e')]=_[_0xa1fc('0x3f')](_0x1ff927[_0xa1fc('0x3e')],{'$or':_[_0xa1fc('0x2c')](_0x1ff927[_0xa1fc('0x36')],function(_0xea7786){var _0x36e4d4={};_0x36e4d4[_0xea7786]={'$like':'%'+_0x59d6da[_0xa1fc('0x31')][_0xa1fc('0x3d')]+'%'};return _0x36e4d4;})});}_0x1ff927=_[_0xa1fc('0x3f')]({},_0x1ff927,_0x59d6da[_0xa1fc('0x41')]);return _0x271642['getConfigurations'](_0x1ff927);}})[_0xa1fc('0x25')](function(_0x43c3cc){if(_0x43c3cc){_0x1c0f31=_0x43c3cc[_0xa1fc('0x37')];if(!_0x59d6da[_0xa1fc('0x31')][_0xa1fc('0x38')](_0xa1fc('0x39'))){_0x1ff927[_0xa1fc('0x1d')]=qs[_0xa1fc('0x1d')](_0x59d6da[_0xa1fc('0x31')]['limit']);_0x1ff927[_0xa1fc('0x1f')]=qs['offset'](_0x59d6da[_0xa1fc('0x31')][_0xa1fc('0x1f')]);}return _0x271642[_0xa1fc('0x4e')](_0x1ff927);}})[_0xa1fc('0x25')](function(_0x2d420e){if(_0x2d420e){return _0x2d420e?{'count':_0x1c0f31,'rows':_0x2d420e}:null;}})[_0xa1fc('0x25')](respondWithResult(_0x34cf8f,null))[_0xa1fc('0x47')](handleError(_0x34cf8f,null));};exports['addConfiguration']=function(_0x56bffc,_0x21cc5c,_0x43e7b1){if(_0x56bffc[_0xa1fc('0x4d')]['id']){delete _0x56bffc['body']['id'];}return db['SugarcrmAccount']['findOne']({'where':{'id':_0x56bffc[_0xa1fc('0x49')]['id']}})[_0xa1fc('0x25')](handleEntityNotFound(_0x21cc5c,null))[_0xa1fc('0x25')](function(_0x3bd573){if(_0x3bd573){_0x56bffc[_0xa1fc('0x4d')]['AccountId']=_0x3bd573['id'];_0x56bffc['body'][_0xa1fc('0x51')]=integrations['getSubjects'](_0x56bffc[_0xa1fc('0x4d')][_0xa1fc('0x52')],_0x56bffc[_0xa1fc('0x4d')][_0xa1fc('0x2e')]);_0x56bffc[_0xa1fc('0x4d')][_0xa1fc('0x53')]=integrations['getDescriptions'](_0x56bffc[_0xa1fc('0x4d')][_0xa1fc('0x52')],_0x56bffc[_0xa1fc('0x4d')][_0xa1fc('0x2e')]);return db['SugarcrmConfiguration']['create'](_0x56bffc['body'],{'include':[{'model':db[_0xa1fc('0x54')],'as':'Subjects'},{'model':db[_0xa1fc('0x54')],'as':_0xa1fc('0x53')}]});}return null;})[_0xa1fc('0x25')](respondWithResult(_0x21cc5c,null))[_0xa1fc('0x47')](handleError(_0x21cc5c,null));};exports[_0xa1fc('0x55')]=function(_0x7604b7,_0x4e3f61,_0x29ef6a){var _0x28f784='';var _0x5e9acc=['id',_0xa1fc('0x29'),_0xa1fc('0x56'),_0xa1fc('0x57'),_0xa1fc('0x58'),_0xa1fc('0x59'),'duration_hours',_0xa1fc('0x5a'),_0xa1fc('0x5b'),_0xa1fc('0x5c'),_0xa1fc('0x5d'),_0xa1fc('0x5e')];return db[_0xa1fc('0x42')]['findOne']({'where':{'id':_0x7604b7[_0xa1fc('0x49')]['id']},'attributes':['id',_0xa1fc('0x5f'),'password',_0xa1fc('0x60')]})[_0xa1fc('0x25')](handleEntityNotFound(_0x4e3f61,null))[_0xa1fc('0x25')](function(_0x3e3117){if(_0x3e3117){_0x28f784=_0x3e3117[_0xa1fc('0x60')];var _0xf8ab19=_0x28f784['slice'](-0x1);if(_0xf8ab19==='/'){_0x28f784=_0x28f784[_0xa1fc('0x61')](0x0,_0x28f784['lastIndexOf'](_0xf8ab19));}return rp({'method':'POST','uri':util[_0xa1fc('0x62')](_0xa1fc('0x63'),_0x28f784,_0xa1fc('0x64')),'json':!![],'form':{'method':_0xa1fc('0x65'),'input_type':_0xa1fc('0x66'),'response_type':'JSON','rest_data':JSON[_0xa1fc('0x67')]({'user_auth':{'user_name':_0x3e3117[_0xa1fc('0x5f')],'password':_0x3e3117[_0xa1fc('0x68')],'encryption':_0xa1fc('0x69')},'application':_0xa1fc('0x6a')})}});}})[_0xa1fc('0x25')](function(_0x39ca65){if(_0x39ca65&&_0x39ca65[_0xa1fc('0x29')]!==_0xa1fc('0x6b')&&_0x39ca65[_0xa1fc('0x29')]!=='Password\x20Expired'){return rp({'method':'POST','uri':util[_0xa1fc('0x62')](_0xa1fc('0x63'),_0x28f784,_0xa1fc('0x64')),'json':!![],'form':{'method':_0xa1fc('0x6c'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xa1fc('0x67')]({'session':_0x39ca65['id'],'module_name':_0xa1fc('0x6d')})}})[_0xa1fc('0x25')](function(_0x41e575){if(_0x41e575){var _0x3e3e68=_[_0xa1fc('0x6e')](_0x41e575[_0xa1fc('0x6f')]);_['remove'](_0x3e3e68,function(_0x5cd290){return _0x5e9acc['includes'](_0x5cd290[_0xa1fc('0x29')]);});return{'count':_0x3e3e68[_0xa1fc('0x37')],'rows':_[_0xa1fc('0x2c')](_0x3e3e68,function(_0x759a3e){return{'id':_0x759a3e[_0xa1fc('0x29')],'name':_0x759a3e[_0xa1fc('0x70')],'custom':_[_0xa1fc('0x71')](_0x759a3e[_0xa1fc('0x29')],'_c')?!![]:![],'options':_0x759a3e[_0xa1fc('0x41')]?_[_0xa1fc('0x2c')](_[_0xa1fc('0x6e')](_0x759a3e['options']),function(_0x3ff745){return{'name':_0x3ff745[_0xa1fc('0x72')],'value':_0x3ff745[_0xa1fc('0x29')]};}):[]};})};}})[_0xa1fc('0x25')](respondWithResult(_0x4e3f61,null))[_0xa1fc('0x47')](function(_0x5775da){var _0x420beb=_0x7604b7[_0xa1fc('0x31')][_0xa1fc('0x73')]?0x1f4:_0x5775da['statusCode']||0x1f4;logger[_0xa1fc('0x27')](_0xa1fc('0x74'),_0xa1fc('0x55'),_0x420beb,JSON[_0xa1fc('0x67')](_0x5775da));delete _0x5775da[_0xa1fc('0x29')];if(_0x420beb===0x191){_0x420beb=0x190;}_0x4e3f61['status'](_0x420beb)['send'](_0x7604b7[_0xa1fc('0x31')][_0xa1fc('0x73')]?{'message':'Wrong\x20credentials','statusCode':_0x5775da['statusCode']}:_0x5775da);});}else{var _0x3b36c7=0x1f4;_0x4e3f61[_0xa1fc('0x1c')](_0x3b36c7)[_0xa1fc('0x2a')]({'message':_0xa1fc('0x75'),'statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index d649e1e..fe68b0a 100644 --- a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js +++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbf46=['int_sugarcrm_accounts','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','SugarcrmAccount'];(function(_0x3e28d9,_0xf0b9d8){var _0x12647d=function(_0x518bb7){while(--_0x518bb7){_0x3e28d9['push'](_0x3e28d9['shift']());}};_0x12647d(++_0xf0b9d8);}(_0xbf46,0xc5));var _0x6bf4=function(_0x29ff69,_0x5743b5){_0x29ff69=_0x29ff69-0x0;var _0x10c2ae=_0xbf46[_0x29ff69];return _0x10c2ae;};'use strict';var _=require(_0x6bf4('0x0'));var util=require(_0x6bf4('0x1'));var logger=require('../../config/logger')(_0x6bf4('0x2'));var moment=require(_0x6bf4('0x3'));var BPromise=require(_0x6bf4('0x4'));var rp=require(_0x6bf4('0x5'));var fs=require('fs');var path=require(_0x6bf4('0x6'));var rimraf=require(_0x6bf4('0x7'));var config=require(_0x6bf4('0x8'));var attributes=require(_0x6bf4('0x9'));var integrations=require(_0x6bf4('0xa'));module[_0x6bf4('0xb')]=function(_0x3c9930,_0x55f967){return _0x3c9930['define'](_0x6bf4('0xc'),attributes,{'tableName':_0x6bf4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7044=['SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','../../components/integrations/configuration','exports','define'];(function(_0x42a044,_0x5913f2){var _0xb1746c=function(_0x47e742){while(--_0x47e742){_0x42a044['push'](_0x42a044['shift']());}};_0xb1746c(++_0x5913f2);}(_0x7044,0x147));var _0x4704=function(_0x149083,_0x4047b6){_0x149083=_0x149083-0x0;var _0x4dc74e=_0x7044[_0x149083];return _0x4dc74e;};'use strict';var _=require(_0x4704('0x0'));var util=require(_0x4704('0x1'));var logger=require(_0x4704('0x2'))('api');var moment=require(_0x4704('0x3'));var BPromise=require(_0x4704('0x4'));var rp=require(_0x4704('0x5'));var fs=require('fs');var path=require(_0x4704('0x6'));var rimraf=require('rimraf');var config=require(_0x4704('0x7'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x4704('0x8'));module[_0x4704('0x9')]=function(_0x48e7b8,_0x5394c3){return _0x48e7b8[_0x4704('0xa')](_0x4704('0xb'),attributes,{'tableName':_0x4704('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 337a7b0..5a40446 100644 --- a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js +++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x90e7=['catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','include','map','model','ShowSugarcrmAccount','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','stringify','error','SugarcrmAccount,\x20%s,\x20%s','message','result'];(function(_0x17307b,_0x21fe67){var _0x4be46a=function(_0x3611c6){while(--_0x3611c6){_0x17307b['push'](_0x17307b['shift']());}};_0x4be46a(++_0x21fe67);}(_0x90e7,0xfa));var _0x790e=function(_0x582017,_0x100db2){_0x582017=_0x582017-0x0;var _0xec0606=_0x90e7[_0x582017];return _0xec0606;};'use strict';var _=require(_0x790e('0x0'));var util=require('util');var moment=require(_0x790e('0x1'));var BPromise=require(_0x790e('0x2'));var rs=require(_0x790e('0x3'));var fs=require('fs');var Redis=require(_0x790e('0x4'));var db=require(_0x790e('0x5'))['db'];var utils=require(_0x790e('0x6'));var logger=require(_0x790e('0x7'))(_0x790e('0x8'));var config=require(_0x790e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x790e('0xa')][_0x790e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x460906,_0xf5dff0,_0x4c9db7){return new BPromise(function(_0x480b86,_0x589f77){return client[_0x790e('0xc')](_0x460906,_0x4c9db7)[_0x790e('0xd')](function(_0x23ccb4){logger[_0x790e('0xe')]('SugarcrmAccount,\x20%s,\x20%s',_0xf5dff0,_0x790e('0xf'));logger[_0x790e('0x10')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0xf5dff0,_0x790e('0xf'),JSON[_0x790e('0x11')](_0x23ccb4));if(_0x23ccb4['error']){if(_0x23ccb4[_0x790e('0x12')]['code']===0x1f4){logger['error'](_0x790e('0x13'),_0xf5dff0,_0x23ccb4[_0x790e('0x12')][_0x790e('0x14')]);return _0x589f77(_0x23ccb4[_0x790e('0x12')][_0x790e('0x14')]);}logger['error'](_0x790e('0x13'),_0xf5dff0,_0x23ccb4[_0x790e('0x12')][_0x790e('0x14')]);return _0x480b86(_0x23ccb4[_0x790e('0x12')][_0x790e('0x14')]);}else{logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0xf5dff0,_0x790e('0xf'));_0x480b86(_0x23ccb4[_0x790e('0x15')][_0x790e('0x14')]);}})[_0x790e('0x16')](function(_0x36f651){logger[_0x790e('0x12')](_0x790e('0x13'),_0xf5dff0,_0x36f651);_0x589f77(_0x36f651);});});}exports[_0x790e('0x17')]=function(_0x520d36){var _0x102869=this;return new Promise(function(_0x4325b8,_0x5ceef5){return db[_0x790e('0x18')][_0x790e('0x19')]({'raw':_0x520d36[_0x790e('0x1a')]?_0x520d36[_0x790e('0x1a')][_0x790e('0x1b')]===undefined?!![]:![]:!![],'where':_0x520d36['options']?_0x520d36[_0x790e('0x1a')][_0x790e('0x1c')]||null:null,'attributes':_0x520d36['options']?_0x520d36[_0x790e('0x1a')][_0x790e('0x1d')]||null:null,'limit':_0x520d36[_0x790e('0x1a')]?_0x520d36[_0x790e('0x1a')]['limit']||null:null,'include':_0x520d36[_0x790e('0x1a')]?_0x520d36[_0x790e('0x1a')][_0x790e('0x1e')]?_[_0x790e('0x1f')](_0x520d36[_0x790e('0x1a')]['include'],function(_0x448961){return{'model':db[_0x448961['model']],'as':_0x448961['as'],'attributes':_0x448961[_0x790e('0x1d')],'include':_0x448961[_0x790e('0x1e')]?_['map'](_0x448961[_0x790e('0x1e')],function(_0x2fa7db){return{'model':db[_0x2fa7db[_0x790e('0x20')]],'as':_0x2fa7db['as'],'attributes':_0x2fa7db['attributes'],'include':_0x2fa7db['include']?_[_0x790e('0x1f')](_0x2fa7db['include'],function(_0xca60b2){return{'model':db[_0xca60b2['model']],'as':_0xca60b2['as'],'attributes':_0xca60b2[_0x790e('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x790e('0xd')](function(_0x4a2de2){logger[_0x790e('0xe')]('GetSugarcrmAccount',_0x520d36);logger[_0x790e('0x10')](_0x790e('0x17'),_0x520d36,JSON[_0x790e('0x11')](_0x4a2de2));_0x4325b8(_0x4a2de2);})[_0x790e('0x16')](function(_0x3180ad){logger[_0x790e('0x12')](_0x790e('0x17'),_0x3180ad['message'],_0x520d36);_0x5ceef5(_0x102869[_0x790e('0x12')](0x1f4,_0x3180ad['message']));});});};exports[_0x790e('0x21')]=function(_0x49b3d2){var _0x359592=this;return new Promise(function(_0x17504d,_0x5d2082){return db[_0x790e('0x18')]['find']({'raw':_0x49b3d2[_0x790e('0x1a')]?_0x49b3d2[_0x790e('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x49b3d2[_0x790e('0x1a')]?_0x49b3d2['options'][_0x790e('0x1c')]||null:null,'attributes':_0x49b3d2[_0x790e('0x1a')]?_0x49b3d2[_0x790e('0x1a')]['attributes']||null:null,'include':_0x49b3d2[_0x790e('0x1a')]?_0x49b3d2[_0x790e('0x1a')]['include']?_[_0x790e('0x1f')](_0x49b3d2[_0x790e('0x1a')]['include'],function(_0x1bc735){return{'model':db[_0x1bc735[_0x790e('0x20')]],'as':_0x1bc735['as'],'attributes':_0x1bc735[_0x790e('0x1d')],'include':_0x1bc735['include']?_[_0x790e('0x1f')](_0x1bc735[_0x790e('0x1e')],function(_0x4466f7){return{'model':db[_0x4466f7[_0x790e('0x20')]],'as':_0x4466f7['as'],'attributes':_0x4466f7[_0x790e('0x1d')],'include':_0x4466f7[_0x790e('0x1e')]?_['map'](_0x4466f7[_0x790e('0x1e')],function(_0x1478e9){return{'model':db[_0x1478e9[_0x790e('0x20')]],'as':_0x1478e9['as'],'attributes':_0x1478e9[_0x790e('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x790e('0xd')](function(_0x11ca47){logger[_0x790e('0xe')]('ShowSugarcrmAccount',_0x49b3d2);logger[_0x790e('0x10')](_0x790e('0x21'),_0x49b3d2,JSON[_0x790e('0x11')](_0x11ca47));_0x17504d(_0x11ca47);})[_0x790e('0x16')](function(_0x40df1e){logger[_0x790e('0x12')]('ShowSugarcrmAccount',_0x40df1e['message'],_0x49b3d2);_0x5d2082(_0x359592[_0x790e('0x12')](0x1f4,_0x40df1e['message']));});});}; \ No newline at end of file +var _0xb3f0=['then','info','SugarcrmAccount,\x20%s,\x20%s','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetSugarcrmAccount','debug','ShowSugarcrmAccount','SugarcrmAccount','find','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x242c29,_0x168f0a){var _0x3f4d1c=function(_0x87d119){while(--_0x87d119){_0x242c29['push'](_0x242c29['shift']());}};_0x3f4d1c(++_0x168f0a);}(_0xb3f0,0x84));var _0x0b3f=function(_0x4b174a,_0x33a017){_0x4b174a=_0x4b174a-0x0;var _0x3cd7bf=_0xb3f0[_0x4b174a];return _0x3cd7bf;};'use strict';var _=require('lodash');var util=require(_0x0b3f('0x0'));var moment=require('moment');var BPromise=require(_0x0b3f('0x1'));var rs=require(_0x0b3f('0x2'));var fs=require('fs');var Redis=require(_0x0b3f('0x3'));var db=require(_0x0b3f('0x4'))['db'];var utils=require(_0x0b3f('0x5'));var logger=require(_0x0b3f('0x6'))(_0x0b3f('0x7'));var config=require(_0x0b3f('0x8'));var jayson=require(_0x0b3f('0x9'));var client=jayson[_0x0b3f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x414780,_0x54c58c,_0x5a4cf0){return new BPromise(function(_0x16a4a2,_0x1ade9d){return client[_0x0b3f('0xb')](_0x414780,_0x5a4cf0)[_0x0b3f('0xc')](function(_0x4dfa9a){logger[_0x0b3f('0xd')](_0x0b3f('0xe'),_0x54c58c,'request\x20sent');logger['debug'](_0x0b3f('0xf'),_0x54c58c,_0x0b3f('0x10'),JSON[_0x0b3f('0x11')](_0x4dfa9a));if(_0x4dfa9a[_0x0b3f('0x12')]){if(_0x4dfa9a[_0x0b3f('0x12')]['code']===0x1f4){logger[_0x0b3f('0x12')](_0x0b3f('0xe'),_0x54c58c,_0x4dfa9a[_0x0b3f('0x12')][_0x0b3f('0x13')]);return _0x1ade9d(_0x4dfa9a['error']['message']);}logger[_0x0b3f('0x12')](_0x0b3f('0xe'),_0x54c58c,_0x4dfa9a[_0x0b3f('0x12')][_0x0b3f('0x13')]);return _0x16a4a2(_0x4dfa9a[_0x0b3f('0x12')][_0x0b3f('0x13')]);}else{logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x54c58c,_0x0b3f('0x10'));_0x16a4a2(_0x4dfa9a[_0x0b3f('0x14')][_0x0b3f('0x13')]);}})[_0x0b3f('0x15')](function(_0x4aa2f7){logger[_0x0b3f('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0x54c58c,_0x4aa2f7);_0x1ade9d(_0x4aa2f7);});});}exports['GetSugarcrmAccount']=function(_0x33a78e){var _0x513702=this;return new Promise(function(_0x2593ef,_0x37159c){return db['SugarcrmAccount'][_0x0b3f('0x16')]({'raw':_0x33a78e['options']?_0x33a78e[_0x0b3f('0x17')][_0x0b3f('0x18')]===undefined?!![]:![]:!![],'where':_0x33a78e[_0x0b3f('0x17')]?_0x33a78e[_0x0b3f('0x17')][_0x0b3f('0x19')]||null:null,'attributes':_0x33a78e['options']?_0x33a78e[_0x0b3f('0x17')][_0x0b3f('0x1a')]||null:null,'limit':_0x33a78e[_0x0b3f('0x17')]?_0x33a78e['options'][_0x0b3f('0x1b')]||null:null,'include':_0x33a78e['options']?_0x33a78e[_0x0b3f('0x17')][_0x0b3f('0x1c')]?_[_0x0b3f('0x1d')](_0x33a78e[_0x0b3f('0x17')][_0x0b3f('0x1c')],function(_0x1d7dc7){return{'model':db[_0x1d7dc7[_0x0b3f('0x1e')]],'as':_0x1d7dc7['as'],'attributes':_0x1d7dc7[_0x0b3f('0x1a')],'include':_0x1d7dc7['include']?_[_0x0b3f('0x1d')](_0x1d7dc7[_0x0b3f('0x1c')],function(_0x980aa6){return{'model':db[_0x980aa6[_0x0b3f('0x1e')]],'as':_0x980aa6['as'],'attributes':_0x980aa6[_0x0b3f('0x1a')],'include':_0x980aa6[_0x0b3f('0x1c')]?_[_0x0b3f('0x1d')](_0x980aa6[_0x0b3f('0x1c')],function(_0x2339cc){return{'model':db[_0x2339cc[_0x0b3f('0x1e')]],'as':_0x2339cc['as'],'attributes':_0x2339cc[_0x0b3f('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3ec0a7){logger[_0x0b3f('0xd')](_0x0b3f('0x1f'),_0x33a78e);logger[_0x0b3f('0x20')](_0x0b3f('0x1f'),_0x33a78e,JSON[_0x0b3f('0x11')](_0x3ec0a7));_0x2593ef(_0x3ec0a7);})[_0x0b3f('0x15')](function(_0x5a6368){logger['error'](_0x0b3f('0x1f'),_0x5a6368[_0x0b3f('0x13')],_0x33a78e);_0x37159c(_0x513702[_0x0b3f('0x12')](0x1f4,_0x5a6368[_0x0b3f('0x13')]));});});};exports[_0x0b3f('0x21')]=function(_0x352535){var _0x40136f=this;return new Promise(function(_0x3bbee8,_0x34bae1){return db[_0x0b3f('0x22')][_0x0b3f('0x23')]({'raw':_0x352535['options']?_0x352535['options']['raw']===undefined?!![]:![]:!![],'where':_0x352535[_0x0b3f('0x17')]?_0x352535[_0x0b3f('0x17')][_0x0b3f('0x19')]||null:null,'attributes':_0x352535['options']?_0x352535[_0x0b3f('0x17')][_0x0b3f('0x1a')]||null:null,'include':_0x352535[_0x0b3f('0x17')]?_0x352535[_0x0b3f('0x17')][_0x0b3f('0x1c')]?_[_0x0b3f('0x1d')](_0x352535[_0x0b3f('0x17')][_0x0b3f('0x1c')],function(_0x5faf81){return{'model':db[_0x5faf81[_0x0b3f('0x1e')]],'as':_0x5faf81['as'],'attributes':_0x5faf81[_0x0b3f('0x1a')],'include':_0x5faf81[_0x0b3f('0x1c')]?_['map'](_0x5faf81[_0x0b3f('0x1c')],function(_0x2fa625){return{'model':db[_0x2fa625[_0x0b3f('0x1e')]],'as':_0x2fa625['as'],'attributes':_0x2fa625[_0x0b3f('0x1a')],'include':_0x2fa625['include']?_[_0x0b3f('0x1d')](_0x2fa625[_0x0b3f('0x1c')],function(_0x398a35){return{'model':db[_0x398a35[_0x0b3f('0x1e')]],'as':_0x398a35['as'],'attributes':_0x398a35[_0x0b3f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0b3f('0xc')](function(_0xf1a1c8){logger[_0x0b3f('0xd')](_0x0b3f('0x21'),_0x352535);logger['debug'](_0x0b3f('0x21'),_0x352535,JSON[_0x0b3f('0x11')](_0xf1a1c8));_0x3bbee8(_0xf1a1c8);})['catch'](function(_0x3af1d7){logger['error'](_0x0b3f('0x21'),_0x3af1d7[_0x0b3f('0x13')],_0x352535);_0x34bae1(_0x40136f['error'](0x1f4,_0x3af1d7['message']));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 86b9de0..2f48ba3 100644 --- a/server/api/intSugarcrmConfiguration/index.js +++ b/server/api/intSugarcrmConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a38=['getDescriptions','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x578d9b,_0x468fe1){var _0x5968de=function(_0x4655e5){while(--_0x4655e5){_0x578d9b['push'](_0x578d9b['shift']());}};_0x5968de(++_0x468fe1);}(_0x7a38,0x110));var _0x87a3=function(_0x2c74ea,_0xfba243){_0x2c74ea=_0x2c74ea-0x0;var _0x56ae1c=_0x7a38[_0x2c74ea];return _0x56ae1c;};'use strict';var multer=require(_0x87a3('0x0'));var util=require(_0x87a3('0x1'));var path=require(_0x87a3('0x2'));var timeout=require(_0x87a3('0x3'));var express=require('express');var router=express[_0x87a3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x87a3('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x87a3('0x6'));router[_0x87a3('0x7')]('/',auth[_0x87a3('0x8')](),controller[_0x87a3('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x87a3('0xa')]);router['get'](_0x87a3('0xb'),auth['isAuthenticated'](),controller[_0x87a3('0xc')]);router[_0x87a3('0x7')](_0x87a3('0xd'),auth[_0x87a3('0x8')](),controller[_0x87a3('0xe')]);router[_0x87a3('0x7')](_0x87a3('0xf'),auth[_0x87a3('0x8')](),controller[_0x87a3('0x10')]);router[_0x87a3('0x11')]('/',auth[_0x87a3('0x8')](),controller[_0x87a3('0x12')]);router[_0x87a3('0x13')](_0x87a3('0x14'),auth[_0x87a3('0x8')](),controller['update']);router[_0x87a3('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x87a3('0x16')]);module[_0x87a3('0x17')]=router; \ No newline at end of file +var _0xadf1=['multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','put','update','delete'];(function(_0x162ee0,_0x291661){var _0x48fc5e=function(_0x297a35){while(--_0x297a35){_0x162ee0['push'](_0x162ee0['shift']());}};_0x48fc5e(++_0x291661);}(_0xadf1,0x7e));var _0x1adf=function(_0x4ec0c8,_0x1dd9f0){_0x4ec0c8=_0x4ec0c8-0x0;var _0x161a79=_0xadf1[_0x4ec0c8];return _0x161a79;};'use strict';var multer=require(_0x1adf('0x0'));var util=require(_0x1adf('0x1'));var path=require(_0x1adf('0x2'));var timeout=require(_0x1adf('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1adf('0x4'));var auth=require(_0x1adf('0x5'));var interaction=require(_0x1adf('0x6'));var config=require(_0x1adf('0x7'));var controller=require('./intSugarcrmConfiguration.controller');router[_0x1adf('0x8')]('/',auth[_0x1adf('0x9')](),controller['index']);router['get'](_0x1adf('0xa'),auth['isAuthenticated'](),controller[_0x1adf('0xb')]);router['get'](_0x1adf('0xc'),auth[_0x1adf('0x9')](),controller[_0x1adf('0xd')]);router['get'](_0x1adf('0xe'),auth[_0x1adf('0x9')](),controller['getSubjects']);router[_0x1adf('0x8')](_0x1adf('0xf'),auth['isAuthenticated'](),controller[_0x1adf('0x10')]);router[_0x1adf('0x11')]('/',auth[_0x1adf('0x9')](),controller['create']);router[_0x1adf('0x12')](_0x1adf('0xa'),auth[_0x1adf('0x9')](),controller[_0x1adf('0x13')]);router[_0x1adf('0x14')](_0x1adf('0xa'),auth[_0x1adf('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 2a66d85..32f2741 100644 --- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js +++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe3d9=['STRING','sequelize','exports'];(function(_0x483566,_0xb3188e){var _0x3544dc=function(_0x5e393b){while(--_0x5e393b){_0x483566['push'](_0x483566['shift']());}};_0x3544dc(++_0xb3188e);}(_0xe3d9,0x100));var _0x9e3d=function(_0x27ca2a,_0x79c1b9){_0x27ca2a=_0x27ca2a-0x0;var _0x14c2a=_0xe3d9[_0x27ca2a];return _0x14c2a;};'use strict';var Sequelize=require(_0x9e3d('0x0'));module[_0x9e3d('0x1')]={'name':{'type':Sequelize[_0x9e3d('0x2')]},'description':{'type':Sequelize[_0x9e3d('0x2')]}}; \ No newline at end of file +var _0x0c5a=['STRING','sequelize'];(function(_0x49d547,_0x53e2ae){var _0x2d389d=function(_0x3fc989){while(--_0x3fc989){_0x49d547['push'](_0x49d547['shift']());}};_0x2d389d(++_0x53e2ae);}(_0x0c5a,0x14d));var _0xa0c5=function(_0x1605b7,_0x13302a){_0x1605b7=_0x1605b7-0x0;var _0x3c6527=_0x0c5a[_0x1605b7];return _0x3c6527;};'use strict';var Sequelize=require(_0xa0c5('0x0'));module['exports']={'name':{'type':Sequelize[_0xa0c5('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 5e86846..b017871 100644 --- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js +++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4a65=['filters','intersection','attributes','fields','length','order','sort','pick','where','VIRTUAL','options','SugarcrmConfiguration','includeAll','findAll','rows','catch','show','include','find','create','params','getFields','findOne','SugarcrmField','filter','merge','hasOwnProperty','nolimit','getSubjects','getDescriptions','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','then','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x57ecae,_0x59e94e){var _0x1359bc=function(_0x51228d){while(--_0x51228d){_0x57ecae['push'](_0x57ecae['shift']());}};_0x1359bc(++_0x59e94e);}(_0x4a65,0x152));var _0x54a6=function(_0x3e79ab,_0xe367f){_0x3e79ab=_0x3e79ab-0x0;var _0x2cd9e7=_0x4a65[_0x3e79ab];return _0x2cd9e7;};'use strict';var emlformat=require(_0x54a6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x54a6('0x1'));var rp=require(_0x54a6('0x2'));var moment=require(_0x54a6('0x3'));var BPromise=require(_0x54a6('0x4'));var Mustache=require(_0x54a6('0x5'));var util=require(_0x54a6('0x6'));var path=require(_0x54a6('0x7'));var sox=require('sox');var csv=require(_0x54a6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x54a6('0x9'));var _=require(_0x54a6('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x54a6('0xb'));var deskjs=require(_0x54a6('0xc'));var toCsv=require(_0x54a6('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x54a6('0xd'));var qs=require(_0x54a6('0xe'));var as=require(_0x54a6('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x54a6('0x10'))(_0x54a6('0x11'));var utils=require('../../config/utils');var config=require(_0x54a6('0x12'));var licenseUtil=require(_0x54a6('0x13'));var db=require(_0x54a6('0x14'))['db'];function respondWithStatusCode(_0x26ab17,_0x2f548d){_0x2f548d=_0x2f548d||0xcc;return function(_0x1fe557){if(_0x1fe557){return _0x26ab17[_0x54a6('0x15')](_0x2f548d);}return _0x26ab17[_0x54a6('0x16')](_0x2f548d)[_0x54a6('0x17')]();};}function respondWithResult(_0x379270,_0x2c797f){_0x2c797f=_0x2c797f||0xc8;return function(_0x3eaf58){if(_0x3eaf58){return _0x379270[_0x54a6('0x16')](_0x2c797f)[_0x54a6('0x18')](_0x3eaf58);}};}function respondWithFilteredResult(_0x4e0527,_0x8e2afc){return function(_0x27a09e){if(_0x27a09e){var _0x3b765e=typeof _0x8e2afc[_0x54a6('0x19')]===_0x54a6('0x1a')&&typeof _0x8e2afc[_0x54a6('0x1b')]===_0x54a6('0x1a');var _0xf2a2cc=_0x27a09e[_0x54a6('0x1c')];var _0x39d6b5=_0x3b765e?0x0:_0x8e2afc[_0x54a6('0x19')];var _0x22ce34=_0x3b765e?_0x27a09e['count']:_0x8e2afc[_0x54a6('0x19')]+_0x8e2afc[_0x54a6('0x1b')];var _0x423e8c;if(_0x22ce34>=_0xf2a2cc){_0x22ce34=_0xf2a2cc;_0x423e8c=0xc8;}else{_0x423e8c=0xce;}_0x4e0527['status'](_0x423e8c);return _0x4e0527[_0x54a6('0x1d')](_0x54a6('0x1e'),_0x39d6b5+'-'+_0x22ce34+'/'+_0xf2a2cc)[_0x54a6('0x18')](_0x27a09e);}return null;};}function patchUpdates(_0x2d1194){return function(_0x4759e6){try{jsonpatch['apply'](_0x4759e6,_0x2d1194,!![]);}catch(_0x364799){return BPromise[_0x54a6('0x1f')](_0x364799);}return _0x4759e6['save']();};}function saveUpdates(_0x54fe36,_0x2b2ea0){return function(_0x17b995){if(_0x17b995){return _0x17b995[_0x54a6('0x20')](_0x54fe36)['then'](function(_0x496246){return _0x496246;});}return null;};}function removeEntity(_0x380604,_0xf4240d){return function(_0x45d676){if(_0x45d676){return _0x45d676[_0x54a6('0x21')]()[_0x54a6('0x22')](function(){_0x380604[_0x54a6('0x16')](0xcc)[_0x54a6('0x17')]();});}};}function handleEntityNotFound(_0x3ee030,_0xeef57c){return function(_0xb4f140){if(!_0xb4f140){_0x3ee030['sendStatus'](0x194);}return _0xb4f140;};}function handleError(_0x355e13,_0x57694a){_0x57694a=_0x57694a||0x1f4;return function(_0x28af34){logger[_0x54a6('0x23')](_0x28af34['stack']);if(_0x28af34[_0x54a6('0x24')]){delete _0x28af34[_0x54a6('0x24')];}_0x355e13[_0x54a6('0x16')](_0x57694a)[_0x54a6('0x25')](_0x28af34);};}exports[_0x54a6('0x26')]=function(_0x47e2f8,_0x1182f3){var _0x3e920a={},_0x50a1c1={},_0x3b8e8a={'count':0x0,'rows':[]};var _0x2ced86=_[_0x54a6('0x27')](db['SugarcrmConfiguration'][_0x54a6('0x28')],function(_0x477da9){return{'name':_0x477da9[_0x54a6('0x29')],'type':_0x477da9[_0x54a6('0x2a')][_0x54a6('0x2b')]};});_0x50a1c1[_0x54a6('0x2c')]=_[_0x54a6('0x27')](_0x2ced86,_0x54a6('0x24'));_0x50a1c1[_0x54a6('0x2d')]=_[_0x54a6('0x2e')](_0x47e2f8[_0x54a6('0x2d')]);_0x50a1c1[_0x54a6('0x2f')]=_[_0x54a6('0x30')](_0x50a1c1[_0x54a6('0x2c')],_0x50a1c1[_0x54a6('0x2d')]);_0x3e920a[_0x54a6('0x31')]=_[_0x54a6('0x30')](_0x50a1c1[_0x54a6('0x2c')],qs['fields'](_0x47e2f8[_0x54a6('0x2d')][_0x54a6('0x32')]));_0x3e920a[_0x54a6('0x31')]=_0x3e920a[_0x54a6('0x31')][_0x54a6('0x33')]?_0x3e920a[_0x54a6('0x31')]:_0x50a1c1[_0x54a6('0x2c')];if(!_0x47e2f8[_0x54a6('0x2d')]['hasOwnProperty']('nolimit')){_0x3e920a[_0x54a6('0x1b')]=qs['limit'](_0x47e2f8[_0x54a6('0x2d')][_0x54a6('0x1b')]);_0x3e920a[_0x54a6('0x19')]=qs[_0x54a6('0x19')](_0x47e2f8[_0x54a6('0x2d')][_0x54a6('0x19')]);}_0x3e920a[_0x54a6('0x34')]=qs['sort'](_0x47e2f8[_0x54a6('0x2d')][_0x54a6('0x35')]);_0x3e920a['where']=qs[_0x54a6('0x2f')](_[_0x54a6('0x36')](_0x47e2f8[_0x54a6('0x2d')],_0x50a1c1[_0x54a6('0x2f')]),_0x2ced86);if(_0x47e2f8[_0x54a6('0x2d')]['filter']){_0x3e920a[_0x54a6('0x37')]=_['merge'](_0x3e920a[_0x54a6('0x37')],{'$or':_[_0x54a6('0x27')](_0x2ced86,function(_0x4a18f6){if(_0x4a18f6[_0x54a6('0x2a')]!==_0x54a6('0x38')){var _0x216b87={};_0x216b87[_0x4a18f6[_0x54a6('0x24')]]={'$like':'%'+_0x47e2f8[_0x54a6('0x2d')]['filter']+'%'};return _0x216b87;}})});}_0x3e920a=_['merge']({},_0x3e920a,_0x47e2f8[_0x54a6('0x39')]);var _0x224885={'where':_0x3e920a[_0x54a6('0x37')]};return db[_0x54a6('0x3a')][_0x54a6('0x1c')](_0x224885)[_0x54a6('0x22')](function(_0x2282a2){_0x3b8e8a[_0x54a6('0x1c')]=_0x2282a2;if(_0x47e2f8[_0x54a6('0x2d')][_0x54a6('0x3b')]){_0x3e920a['include']=[{'all':!![]}];}return db[_0x54a6('0x3a')][_0x54a6('0x3c')](_0x3e920a);})[_0x54a6('0x22')](function(_0x4c5231){_0x3b8e8a[_0x54a6('0x3d')]=_0x4c5231;return _0x3b8e8a;})[_0x54a6('0x22')](respondWithFilteredResult(_0x1182f3,_0x3e920a))[_0x54a6('0x3e')](handleError(_0x1182f3,null));};exports[_0x54a6('0x3f')]=function(_0x318f3f,_0x1a2320){var _0x595ddf={'raw':![],'where':{'id':_0x318f3f['params']['id']}},_0x44e955={};_0x44e955['model']=_[_0x54a6('0x2e')](db['SugarcrmConfiguration'][_0x54a6('0x28')]);_0x44e955['query']=_['keys'](_0x318f3f[_0x54a6('0x2d')]);_0x44e955[_0x54a6('0x2f')]=_['intersection'](_0x44e955['model'],_0x44e955[_0x54a6('0x2d')]);_0x595ddf[_0x54a6('0x31')]=_[_0x54a6('0x30')](_0x44e955[_0x54a6('0x2c')],qs['fields'](_0x318f3f[_0x54a6('0x2d')]['fields']));_0x595ddf['attributes']=_0x595ddf['attributes']['length']?_0x595ddf[_0x54a6('0x31')]:_0x44e955[_0x54a6('0x2c')];if(_0x318f3f[_0x54a6('0x2d')][_0x54a6('0x3b')]){_0x595ddf[_0x54a6('0x40')]=[{'all':!![]}];}_0x595ddf=_['merge']({},_0x595ddf,_0x318f3f[_0x54a6('0x39')]);return db[_0x54a6('0x3a')][_0x54a6('0x41')](_0x595ddf)[_0x54a6('0x22')](handleEntityNotFound(_0x1a2320,null))[_0x54a6('0x22')](respondWithResult(_0x1a2320,null))[_0x54a6('0x3e')](handleError(_0x1a2320,null));};exports['create']=function(_0x79a95c,_0x31faba){return db['SugarcrmConfiguration'][_0x54a6('0x42')](_0x79a95c['body'],{})['then'](respondWithResult(_0x31faba,0xc9))[_0x54a6('0x3e')](handleError(_0x31faba,null));};exports[_0x54a6('0x20')]=function(_0x22283a,_0x4d586e){if(_0x22283a['body']['id']){delete _0x22283a['body']['id'];}return db['SugarcrmConfiguration'][_0x54a6('0x41')]({'where':{'id':_0x22283a['params']['id']}})[_0x54a6('0x22')](handleEntityNotFound(_0x4d586e,null))['then'](saveUpdates(_0x22283a['body'],null))[_0x54a6('0x22')](respondWithResult(_0x4d586e,null))[_0x54a6('0x3e')](handleError(_0x4d586e,null));};exports['destroy']=function(_0x4a96a3,_0x290eae){return db[_0x54a6('0x3a')][_0x54a6('0x41')]({'where':{'id':_0x4a96a3[_0x54a6('0x43')]['id']}})[_0x54a6('0x22')](handleEntityNotFound(_0x290eae,null))[_0x54a6('0x22')](removeEntity(_0x290eae,null))[_0x54a6('0x3e')](handleError(_0x290eae,null));};exports[_0x54a6('0x44')]=function(_0x595368,_0x5deba5,_0x2ce7b5){var _0x4cf24={};var _0x5ae099={};var _0x1b754a;var _0x228da6;return db[_0x54a6('0x3a')][_0x54a6('0x45')]({'where':{'id':_0x595368[_0x54a6('0x43')]['id']}})[_0x54a6('0x22')](handleEntityNotFound(_0x5deba5,null))[_0x54a6('0x22')](function(_0x1589ce){if(_0x1589ce){_0x1b754a=_0x1589ce;_0x5ae099[_0x54a6('0x2c')]=_[_0x54a6('0x2e')](db[_0x54a6('0x46')][_0x54a6('0x28')]);_0x5ae099[_0x54a6('0x2d')]=_[_0x54a6('0x2e')](_0x595368[_0x54a6('0x2d')]);_0x5ae099[_0x54a6('0x2f')]=_[_0x54a6('0x30')](_0x5ae099[_0x54a6('0x2c')],_0x5ae099[_0x54a6('0x2d')]);_0x4cf24[_0x54a6('0x31')]=_[_0x54a6('0x30')](_0x5ae099[_0x54a6('0x2c')],qs[_0x54a6('0x32')](_0x595368[_0x54a6('0x2d')][_0x54a6('0x32')]));_0x4cf24[_0x54a6('0x31')]=_0x4cf24[_0x54a6('0x31')][_0x54a6('0x33')]?_0x4cf24[_0x54a6('0x31')]:_0x5ae099[_0x54a6('0x2c')];_0x4cf24[_0x54a6('0x34')]=qs[_0x54a6('0x35')](_0x595368[_0x54a6('0x2d')][_0x54a6('0x35')]);_0x4cf24['where']=qs[_0x54a6('0x2f')](_[_0x54a6('0x36')](_0x595368[_0x54a6('0x2d')],_0x5ae099['filters']));if(_0x595368[_0x54a6('0x2d')][_0x54a6('0x47')]){_0x4cf24[_0x54a6('0x37')]=_[_0x54a6('0x48')](_0x4cf24[_0x54a6('0x37')],{'$or':_[_0x54a6('0x27')](_0x4cf24['attributes'],function(_0x1ad9f0){var _0x254871={};_0x254871[_0x1ad9f0]={'$like':'%'+_0x595368['query'][_0x54a6('0x47')]+'%'};return _0x254871;})});}_0x4cf24=_[_0x54a6('0x48')]({},_0x4cf24,_0x595368['options']);return _0x1b754a[_0x54a6('0x44')](_0x4cf24);}})['then'](function(_0x5ae429){if(_0x5ae429){_0x228da6=_0x5ae429[_0x54a6('0x33')];if(!_0x595368['query'][_0x54a6('0x49')](_0x54a6('0x4a'))){_0x4cf24[_0x54a6('0x1b')]=qs[_0x54a6('0x1b')](_0x595368[_0x54a6('0x2d')][_0x54a6('0x1b')]);_0x4cf24[_0x54a6('0x19')]=qs[_0x54a6('0x19')](_0x595368['query']['offset']);}return _0x1b754a['getFields'](_0x4cf24);}})[_0x54a6('0x22')](function(_0x379f71){if(_0x379f71){return _0x379f71?{'count':_0x228da6,'rows':_0x379f71}:null;}})[_0x54a6('0x22')](respondWithResult(_0x5deba5,null))[_0x54a6('0x3e')](handleError(_0x5deba5,null));};exports[_0x54a6('0x4b')]=function(_0x557037,_0x1e0a1e,_0x2774fb){var _0x523e87={};var _0x19931d={};var _0x236a96;var _0x591eae;return db[_0x54a6('0x3a')]['findOne']({'where':{'id':_0x557037[_0x54a6('0x43')]['id']}})[_0x54a6('0x22')](handleEntityNotFound(_0x1e0a1e,null))['then'](function(_0x409e9b){if(_0x409e9b){_0x236a96=_0x409e9b;_0x19931d[_0x54a6('0x2c')]=_[_0x54a6('0x2e')](db['SugarcrmField'][_0x54a6('0x28')]);_0x19931d[_0x54a6('0x2d')]=_[_0x54a6('0x2e')](_0x557037[_0x54a6('0x2d')]);_0x19931d['filters']=_[_0x54a6('0x30')](_0x19931d[_0x54a6('0x2c')],_0x19931d[_0x54a6('0x2d')]);_0x523e87[_0x54a6('0x31')]=_[_0x54a6('0x30')](_0x19931d[_0x54a6('0x2c')],qs[_0x54a6('0x32')](_0x557037[_0x54a6('0x2d')][_0x54a6('0x32')]));_0x523e87[_0x54a6('0x31')]=_0x523e87[_0x54a6('0x31')][_0x54a6('0x33')]?_0x523e87[_0x54a6('0x31')]:_0x19931d[_0x54a6('0x2c')];_0x523e87['order']=qs['sort'](_0x557037['query'][_0x54a6('0x35')]);_0x523e87[_0x54a6('0x37')]=qs['filters'](_[_0x54a6('0x36')](_0x557037[_0x54a6('0x2d')],_0x19931d['filters']));if(_0x557037[_0x54a6('0x2d')][_0x54a6('0x47')]){_0x523e87[_0x54a6('0x37')]=_[_0x54a6('0x48')](_0x523e87[_0x54a6('0x37')],{'$or':_[_0x54a6('0x27')](_0x523e87[_0x54a6('0x31')],function(_0x2f88b3){var _0x1f1b04={};_0x1f1b04[_0x2f88b3]={'$like':'%'+_0x557037[_0x54a6('0x2d')][_0x54a6('0x47')]+'%'};return _0x1f1b04;})});}_0x523e87=_[_0x54a6('0x48')]({},_0x523e87,_0x557037[_0x54a6('0x39')]);return _0x236a96[_0x54a6('0x4b')](_0x523e87);}})[_0x54a6('0x22')](function(_0xf29b6a){if(_0xf29b6a){_0x591eae=_0xf29b6a['length'];if(!_0x557037[_0x54a6('0x2d')]['hasOwnProperty']('nolimit')){_0x523e87[_0x54a6('0x1b')]=qs['limit'](_0x557037['query'][_0x54a6('0x1b')]);_0x523e87['offset']=qs[_0x54a6('0x19')](_0x557037[_0x54a6('0x2d')]['offset']);}return _0x236a96[_0x54a6('0x4b')](_0x523e87);}})[_0x54a6('0x22')](function(_0x99f37a){if(_0x99f37a){return _0x99f37a?{'count':_0x591eae,'rows':_0x99f37a}:null;}})[_0x54a6('0x22')](respondWithResult(_0x1e0a1e,null))['catch'](handleError(_0x1e0a1e,null));};exports[_0x54a6('0x4c')]=function(_0x378079,_0x3921b9,_0x42d2f4){var _0x408aed={};var _0x1e7d44={};var _0x416c8d;var _0x2169c8;return db[_0x54a6('0x3a')]['findOne']({'where':{'id':_0x378079[_0x54a6('0x43')]['id']}})[_0x54a6('0x22')](handleEntityNotFound(_0x3921b9,null))[_0x54a6('0x22')](function(_0x1efe41){if(_0x1efe41){_0x416c8d=_0x1efe41;_0x1e7d44[_0x54a6('0x2c')]=_[_0x54a6('0x2e')](db[_0x54a6('0x46')][_0x54a6('0x28')]);_0x1e7d44['query']=_[_0x54a6('0x2e')](_0x378079[_0x54a6('0x2d')]);_0x1e7d44[_0x54a6('0x2f')]=_[_0x54a6('0x30')](_0x1e7d44[_0x54a6('0x2c')],_0x1e7d44[_0x54a6('0x2d')]);_0x408aed[_0x54a6('0x31')]=_[_0x54a6('0x30')](_0x1e7d44['model'],qs[_0x54a6('0x32')](_0x378079[_0x54a6('0x2d')][_0x54a6('0x32')]));_0x408aed['attributes']=_0x408aed['attributes'][_0x54a6('0x33')]?_0x408aed[_0x54a6('0x31')]:_0x1e7d44[_0x54a6('0x2c')];_0x408aed['order']=qs[_0x54a6('0x35')](_0x378079['query'][_0x54a6('0x35')]);_0x408aed[_0x54a6('0x37')]=qs[_0x54a6('0x2f')](_['pick'](_0x378079[_0x54a6('0x2d')],_0x1e7d44[_0x54a6('0x2f')]));if(_0x378079[_0x54a6('0x2d')]['filter']){_0x408aed[_0x54a6('0x37')]=_['merge'](_0x408aed[_0x54a6('0x37')],{'$or':_[_0x54a6('0x27')](_0x408aed[_0x54a6('0x31')],function(_0x48b985){var _0x4bdac0={};_0x4bdac0[_0x48b985]={'$like':'%'+_0x378079[_0x54a6('0x2d')][_0x54a6('0x47')]+'%'};return _0x4bdac0;})});}_0x408aed=_[_0x54a6('0x48')]({},_0x408aed,_0x378079[_0x54a6('0x39')]);return _0x416c8d[_0x54a6('0x4c')](_0x408aed);}})['then'](function(_0x4ecb9a){if(_0x4ecb9a){_0x2169c8=_0x4ecb9a[_0x54a6('0x33')];if(!_0x378079[_0x54a6('0x2d')][_0x54a6('0x49')](_0x54a6('0x4a'))){_0x408aed[_0x54a6('0x1b')]=qs[_0x54a6('0x1b')](_0x378079[_0x54a6('0x2d')][_0x54a6('0x1b')]);_0x408aed[_0x54a6('0x19')]=qs[_0x54a6('0x19')](_0x378079[_0x54a6('0x2d')][_0x54a6('0x19')]);}return _0x416c8d[_0x54a6('0x4c')](_0x408aed);}})[_0x54a6('0x22')](function(_0x4f8038){if(_0x4f8038){return _0x4f8038?{'count':_0x2169c8,'rows':_0x4f8038}:null;}})[_0x54a6('0x22')](respondWithResult(_0x3921b9,null))[_0x54a6('0x3e')](handleError(_0x3921b9,null));}; \ No newline at end of file +var _0x9982=['limit','count','set','Content-Range','apply','reject','save','update','then','error','name','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','options','where','includeAll','findAll','rows','catch','params','include','create','body','find','destroy','findOne','SugarcrmField','getFields','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined'];(function(_0x37b7b6,_0x165a5c){var _0x10c4c3=function(_0x16d71e){while(--_0x16d71e){_0x37b7b6['push'](_0x37b7b6['shift']());}};_0x10c4c3(++_0x165a5c);}(_0x9982,0x7f));var _0x2998=function(_0x2ad247,_0x64d801){_0x2ad247=_0x2ad247-0x0;var _0x2f72b6=_0x9982[_0x2ad247];return _0x2f72b6;};'use strict';var emlformat=require(_0x2998('0x0'));var rimraf=require(_0x2998('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2998('0x2'));var rp=require(_0x2998('0x3'));var moment=require(_0x2998('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2998('0x5'));var util=require(_0x2998('0x6'));var path=require(_0x2998('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2998('0x8'));var fs=require('fs');var fs_extra=require(_0x2998('0x9'));var _=require(_0x2998('0xa'));var squel=require(_0x2998('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2998('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2998('0xd'));var Redis=require(_0x2998('0xe'));var authService=require(_0x2998('0xf'));var qs=require(_0x2998('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2998('0x11'));var logger=require(_0x2998('0x12'))('api');var utils=require(_0x2998('0x13'));var config=require(_0x2998('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x528c4d,_0x21ef59){_0x21ef59=_0x21ef59||0xcc;return function(_0x182f92){if(_0x182f92){return _0x528c4d[_0x2998('0x15')](_0x21ef59);}return _0x528c4d[_0x2998('0x16')](_0x21ef59)[_0x2998('0x17')]();};}function respondWithResult(_0x4923ca,_0x3ffc0e){_0x3ffc0e=_0x3ffc0e||0xc8;return function(_0x256fed){if(_0x256fed){return _0x4923ca['status'](_0x3ffc0e)[_0x2998('0x18')](_0x256fed);}};}function respondWithFilteredResult(_0x3cce89,_0x46ff33){return function(_0x5bbda8){if(_0x5bbda8){var _0x165ac2=typeof _0x46ff33[_0x2998('0x19')]===_0x2998('0x1a')&&typeof _0x46ff33[_0x2998('0x1b')]===_0x2998('0x1a');var _0x1f93e8=_0x5bbda8[_0x2998('0x1c')];var _0x288d74=_0x165ac2?0x0:_0x46ff33['offset'];var _0x4ddb39=_0x165ac2?_0x5bbda8[_0x2998('0x1c')]:_0x46ff33[_0x2998('0x19')]+_0x46ff33[_0x2998('0x1b')];var _0x4a60a7;if(_0x4ddb39>=_0x1f93e8){_0x4ddb39=_0x1f93e8;_0x4a60a7=0xc8;}else{_0x4a60a7=0xce;}_0x3cce89[_0x2998('0x16')](_0x4a60a7);return _0x3cce89[_0x2998('0x1d')](_0x2998('0x1e'),_0x288d74+'-'+_0x4ddb39+'/'+_0x1f93e8)['json'](_0x5bbda8);}return null;};}function patchUpdates(_0x8852e1){return function(_0x54a75c){try{jsonpatch[_0x2998('0x1f')](_0x54a75c,_0x8852e1,!![]);}catch(_0x5aeaba){return BPromise[_0x2998('0x20')](_0x5aeaba);}return _0x54a75c[_0x2998('0x21')]();};}function saveUpdates(_0xabc012,_0x1d11a9){return function(_0x4eae72){if(_0x4eae72){return _0x4eae72[_0x2998('0x22')](_0xabc012)[_0x2998('0x23')](function(_0x4b458b){return _0x4b458b;});}return null;};}function removeEntity(_0x48b8ae,_0x3d8399){return function(_0x1bfe73){if(_0x1bfe73){return _0x1bfe73['destroy']()[_0x2998('0x23')](function(){_0x48b8ae['status'](0xcc)[_0x2998('0x17')]();});}};}function handleEntityNotFound(_0x572a8e,_0x3bbc54){return function(_0x32f9ee){if(!_0x32f9ee){_0x572a8e[_0x2998('0x15')](0x194);}return _0x32f9ee;};}function handleError(_0x5f4ed2,_0x41c7da){_0x41c7da=_0x41c7da||0x1f4;return function(_0x15f82c){logger[_0x2998('0x24')](_0x15f82c['stack']);if(_0x15f82c[_0x2998('0x25')]){delete _0x15f82c[_0x2998('0x25')];}_0x5f4ed2[_0x2998('0x16')](_0x41c7da)['send'](_0x15f82c);};}exports[_0x2998('0x26')]=function(_0x1cb5a1,_0x4b272c){var _0x43b4cb={},_0x576686={},_0x3fa754={'count':0x0,'rows':[]};var _0x3cd569=_[_0x2998('0x27')](db[_0x2998('0x28')][_0x2998('0x29')],function(_0x2bb96c){return{'name':_0x2bb96c[_0x2998('0x2a')],'type':_0x2bb96c[_0x2998('0x2b')][_0x2998('0x2c')]};});_0x576686[_0x2998('0x2d')]=_[_0x2998('0x27')](_0x3cd569,_0x2998('0x25'));_0x576686[_0x2998('0x2e')]=_[_0x2998('0x2f')](_0x1cb5a1['query']);_0x576686[_0x2998('0x30')]=_[_0x2998('0x31')](_0x576686[_0x2998('0x2d')],_0x576686[_0x2998('0x2e')]);_0x43b4cb[_0x2998('0x32')]=_['intersection'](_0x576686[_0x2998('0x2d')],qs[_0x2998('0x33')](_0x1cb5a1[_0x2998('0x2e')][_0x2998('0x33')]));_0x43b4cb[_0x2998('0x32')]=_0x43b4cb[_0x2998('0x32')][_0x2998('0x34')]?_0x43b4cb[_0x2998('0x32')]:_0x576686[_0x2998('0x2d')];if(!_0x1cb5a1[_0x2998('0x2e')]['hasOwnProperty'](_0x2998('0x35'))){_0x43b4cb[_0x2998('0x1b')]=qs[_0x2998('0x1b')](_0x1cb5a1[_0x2998('0x2e')][_0x2998('0x1b')]);_0x43b4cb[_0x2998('0x19')]=qs[_0x2998('0x19')](_0x1cb5a1[_0x2998('0x2e')][_0x2998('0x19')]);}_0x43b4cb[_0x2998('0x36')]=qs[_0x2998('0x37')](_0x1cb5a1[_0x2998('0x2e')]['sort']);_0x43b4cb['where']=qs['filters'](_[_0x2998('0x38')](_0x1cb5a1[_0x2998('0x2e')],_0x576686[_0x2998('0x30')]),_0x3cd569);if(_0x1cb5a1[_0x2998('0x2e')][_0x2998('0x39')]){_0x43b4cb['where']=_[_0x2998('0x3a')](_0x43b4cb['where'],{'$or':_[_0x2998('0x27')](_0x3cd569,function(_0x1f05cc){if(_0x1f05cc[_0x2998('0x2b')]!=='VIRTUAL'){var _0x4bd0b0={};_0x4bd0b0[_0x1f05cc[_0x2998('0x25')]]={'$like':'%'+_0x1cb5a1[_0x2998('0x2e')][_0x2998('0x39')]+'%'};return _0x4bd0b0;}})});}_0x43b4cb=_['merge']({},_0x43b4cb,_0x1cb5a1[_0x2998('0x3b')]);var _0xaf54d8={'where':_0x43b4cb[_0x2998('0x3c')]};return db['SugarcrmConfiguration'][_0x2998('0x1c')](_0xaf54d8)[_0x2998('0x23')](function(_0x836be4){_0x3fa754['count']=_0x836be4;if(_0x1cb5a1['query'][_0x2998('0x3d')]){_0x43b4cb['include']=[{'all':!![]}];}return db[_0x2998('0x28')][_0x2998('0x3e')](_0x43b4cb);})[_0x2998('0x23')](function(_0x388e2a){_0x3fa754[_0x2998('0x3f')]=_0x388e2a;return _0x3fa754;})[_0x2998('0x23')](respondWithFilteredResult(_0x4b272c,_0x43b4cb))[_0x2998('0x40')](handleError(_0x4b272c,null));};exports['show']=function(_0x5f0af0,_0x4ca160){var _0x101fcc={'raw':![],'where':{'id':_0x5f0af0[_0x2998('0x41')]['id']}},_0x183da7={};_0x183da7[_0x2998('0x2d')]=_['keys'](db[_0x2998('0x28')][_0x2998('0x29')]);_0x183da7[_0x2998('0x2e')]=_['keys'](_0x5f0af0[_0x2998('0x2e')]);_0x183da7[_0x2998('0x30')]=_[_0x2998('0x31')](_0x183da7[_0x2998('0x2d')],_0x183da7[_0x2998('0x2e')]);_0x101fcc[_0x2998('0x32')]=_[_0x2998('0x31')](_0x183da7['model'],qs[_0x2998('0x33')](_0x5f0af0[_0x2998('0x2e')][_0x2998('0x33')]));_0x101fcc[_0x2998('0x32')]=_0x101fcc['attributes']['length']?_0x101fcc[_0x2998('0x32')]:_0x183da7['model'];if(_0x5f0af0[_0x2998('0x2e')]['includeAll']){_0x101fcc[_0x2998('0x42')]=[{'all':!![]}];}_0x101fcc=_[_0x2998('0x3a')]({},_0x101fcc,_0x5f0af0['options']);return db['SugarcrmConfiguration']['find'](_0x101fcc)[_0x2998('0x23')](handleEntityNotFound(_0x4ca160,null))[_0x2998('0x23')](respondWithResult(_0x4ca160,null))[_0x2998('0x40')](handleError(_0x4ca160,null));};exports[_0x2998('0x43')]=function(_0x5d59eb,_0x497a7b){return db[_0x2998('0x28')][_0x2998('0x43')](_0x5d59eb[_0x2998('0x44')],{})[_0x2998('0x23')](respondWithResult(_0x497a7b,0xc9))[_0x2998('0x40')](handleError(_0x497a7b,null));};exports[_0x2998('0x22')]=function(_0x56ad82,_0x5872ee){if(_0x56ad82[_0x2998('0x44')]['id']){delete _0x56ad82[_0x2998('0x44')]['id'];}return db[_0x2998('0x28')][_0x2998('0x45')]({'where':{'id':_0x56ad82['params']['id']}})[_0x2998('0x23')](handleEntityNotFound(_0x5872ee,null))['then'](saveUpdates(_0x56ad82[_0x2998('0x44')],null))[_0x2998('0x23')](respondWithResult(_0x5872ee,null))[_0x2998('0x40')](handleError(_0x5872ee,null));};exports[_0x2998('0x46')]=function(_0x13542e,_0x5c806b){return db[_0x2998('0x28')][_0x2998('0x45')]({'where':{'id':_0x13542e[_0x2998('0x41')]['id']}})[_0x2998('0x23')](handleEntityNotFound(_0x5c806b,null))['then'](removeEntity(_0x5c806b,null))[_0x2998('0x40')](handleError(_0x5c806b,null));};exports['getFields']=function(_0x3efc49,_0x57b9c8,_0x3d33a1){var _0x2e3b6={};var _0x5be1f3={};var _0x2210b0;var _0x56a524;return db['SugarcrmConfiguration'][_0x2998('0x47')]({'where':{'id':_0x3efc49[_0x2998('0x41')]['id']}})[_0x2998('0x23')](handleEntityNotFound(_0x57b9c8,null))['then'](function(_0x3952ff){if(_0x3952ff){_0x2210b0=_0x3952ff;_0x5be1f3[_0x2998('0x2d')]=_[_0x2998('0x2f')](db[_0x2998('0x48')][_0x2998('0x29')]);_0x5be1f3[_0x2998('0x2e')]=_[_0x2998('0x2f')](_0x3efc49[_0x2998('0x2e')]);_0x5be1f3[_0x2998('0x30')]=_[_0x2998('0x31')](_0x5be1f3[_0x2998('0x2d')],_0x5be1f3['query']);_0x2e3b6[_0x2998('0x32')]=_[_0x2998('0x31')](_0x5be1f3['model'],qs['fields'](_0x3efc49[_0x2998('0x2e')]['fields']));_0x2e3b6['attributes']=_0x2e3b6['attributes'][_0x2998('0x34')]?_0x2e3b6[_0x2998('0x32')]:_0x5be1f3[_0x2998('0x2d')];_0x2e3b6[_0x2998('0x36')]=qs[_0x2998('0x37')](_0x3efc49[_0x2998('0x2e')][_0x2998('0x37')]);_0x2e3b6[_0x2998('0x3c')]=qs[_0x2998('0x30')](_[_0x2998('0x38')](_0x3efc49[_0x2998('0x2e')],_0x5be1f3[_0x2998('0x30')]));if(_0x3efc49[_0x2998('0x2e')]['filter']){_0x2e3b6[_0x2998('0x3c')]=_['merge'](_0x2e3b6[_0x2998('0x3c')],{'$or':_[_0x2998('0x27')](_0x2e3b6['attributes'],function(_0x406e39){var _0x506c12={};_0x506c12[_0x406e39]={'$like':'%'+_0x3efc49['query'][_0x2998('0x39')]+'%'};return _0x506c12;})});}_0x2e3b6=_[_0x2998('0x3a')]({},_0x2e3b6,_0x3efc49[_0x2998('0x3b')]);return _0x2210b0[_0x2998('0x49')](_0x2e3b6);}})[_0x2998('0x23')](function(_0x2ffff8){if(_0x2ffff8){_0x56a524=_0x2ffff8['length'];if(!_0x3efc49[_0x2998('0x2e')][_0x2998('0x4a')](_0x2998('0x35'))){_0x2e3b6[_0x2998('0x1b')]=qs[_0x2998('0x1b')](_0x3efc49['query'][_0x2998('0x1b')]);_0x2e3b6['offset']=qs[_0x2998('0x19')](_0x3efc49[_0x2998('0x2e')]['offset']);}return _0x2210b0['getFields'](_0x2e3b6);}})[_0x2998('0x23')](function(_0x2bdcfa){if(_0x2bdcfa){return _0x2bdcfa?{'count':_0x56a524,'rows':_0x2bdcfa}:null;}})[_0x2998('0x23')](respondWithResult(_0x57b9c8,null))[_0x2998('0x40')](handleError(_0x57b9c8,null));};exports[_0x2998('0x4b')]=function(_0x1d208b,_0x306500,_0x2c8b17){var _0x22be17={};var _0x241ead={};var _0x24fc61;var _0x42b53f;return db[_0x2998('0x28')][_0x2998('0x47')]({'where':{'id':_0x1d208b[_0x2998('0x41')]['id']}})[_0x2998('0x23')](handleEntityNotFound(_0x306500,null))[_0x2998('0x23')](function(_0x551f9b){if(_0x551f9b){_0x24fc61=_0x551f9b;_0x241ead[_0x2998('0x2d')]=_[_0x2998('0x2f')](db[_0x2998('0x48')][_0x2998('0x29')]);_0x241ead[_0x2998('0x2e')]=_[_0x2998('0x2f')](_0x1d208b[_0x2998('0x2e')]);_0x241ead[_0x2998('0x30')]=_['intersection'](_0x241ead[_0x2998('0x2d')],_0x241ead[_0x2998('0x2e')]);_0x22be17[_0x2998('0x32')]=_[_0x2998('0x31')](_0x241ead['model'],qs['fields'](_0x1d208b['query'][_0x2998('0x33')]));_0x22be17[_0x2998('0x32')]=_0x22be17[_0x2998('0x32')][_0x2998('0x34')]?_0x22be17[_0x2998('0x32')]:_0x241ead[_0x2998('0x2d')];_0x22be17[_0x2998('0x36')]=qs['sort'](_0x1d208b[_0x2998('0x2e')][_0x2998('0x37')]);_0x22be17[_0x2998('0x3c')]=qs[_0x2998('0x30')](_[_0x2998('0x38')](_0x1d208b[_0x2998('0x2e')],_0x241ead[_0x2998('0x30')]));if(_0x1d208b[_0x2998('0x2e')][_0x2998('0x39')]){_0x22be17[_0x2998('0x3c')]=_['merge'](_0x22be17[_0x2998('0x3c')],{'$or':_['map'](_0x22be17['attributes'],function(_0x25d0b2){var _0x598142={};_0x598142[_0x25d0b2]={'$like':'%'+_0x1d208b['query']['filter']+'%'};return _0x598142;})});}_0x22be17=_[_0x2998('0x3a')]({},_0x22be17,_0x1d208b['options']);return _0x24fc61[_0x2998('0x4b')](_0x22be17);}})['then'](function(_0x3e45a2){if(_0x3e45a2){_0x42b53f=_0x3e45a2[_0x2998('0x34')];if(!_0x1d208b[_0x2998('0x2e')][_0x2998('0x4a')](_0x2998('0x35'))){_0x22be17[_0x2998('0x1b')]=qs['limit'](_0x1d208b[_0x2998('0x2e')][_0x2998('0x1b')]);_0x22be17[_0x2998('0x19')]=qs['offset'](_0x1d208b[_0x2998('0x2e')][_0x2998('0x19')]);}return _0x24fc61['getSubjects'](_0x22be17);}})[_0x2998('0x23')](function(_0x64a0ef){if(_0x64a0ef){return _0x64a0ef?{'count':_0x42b53f,'rows':_0x64a0ef}:null;}})['then'](respondWithResult(_0x306500,null))[_0x2998('0x40')](handleError(_0x306500,null));};exports[_0x2998('0x4c')]=function(_0x5d7b88,_0x429aaf,_0x47e55b){var _0x99deea={};var _0x2b7aff={};var _0x359ee6;var _0x59dfa1;return db[_0x2998('0x28')]['findOne']({'where':{'id':_0x5d7b88['params']['id']}})['then'](handleEntityNotFound(_0x429aaf,null))[_0x2998('0x23')](function(_0x58f0be){if(_0x58f0be){_0x359ee6=_0x58f0be;_0x2b7aff['model']=_[_0x2998('0x2f')](db['SugarcrmField'][_0x2998('0x29')]);_0x2b7aff['query']=_[_0x2998('0x2f')](_0x5d7b88[_0x2998('0x2e')]);_0x2b7aff[_0x2998('0x30')]=_[_0x2998('0x31')](_0x2b7aff[_0x2998('0x2d')],_0x2b7aff[_0x2998('0x2e')]);_0x99deea[_0x2998('0x32')]=_[_0x2998('0x31')](_0x2b7aff['model'],qs[_0x2998('0x33')](_0x5d7b88['query'][_0x2998('0x33')]));_0x99deea[_0x2998('0x32')]=_0x99deea[_0x2998('0x32')][_0x2998('0x34')]?_0x99deea[_0x2998('0x32')]:_0x2b7aff[_0x2998('0x2d')];_0x99deea['order']=qs[_0x2998('0x37')](_0x5d7b88[_0x2998('0x2e')][_0x2998('0x37')]);_0x99deea['where']=qs[_0x2998('0x30')](_[_0x2998('0x38')](_0x5d7b88[_0x2998('0x2e')],_0x2b7aff[_0x2998('0x30')]));if(_0x5d7b88[_0x2998('0x2e')][_0x2998('0x39')]){_0x99deea['where']=_['merge'](_0x99deea[_0x2998('0x3c')],{'$or':_[_0x2998('0x27')](_0x99deea['attributes'],function(_0x52e6da){var _0x4ea7e0={};_0x4ea7e0[_0x52e6da]={'$like':'%'+_0x5d7b88['query'][_0x2998('0x39')]+'%'};return _0x4ea7e0;})});}_0x99deea=_[_0x2998('0x3a')]({},_0x99deea,_0x5d7b88[_0x2998('0x3b')]);return _0x359ee6['getDescriptions'](_0x99deea);}})[_0x2998('0x23')](function(_0x29971f){if(_0x29971f){_0x59dfa1=_0x29971f['length'];if(!_0x5d7b88[_0x2998('0x2e')]['hasOwnProperty']('nolimit')){_0x99deea[_0x2998('0x1b')]=qs[_0x2998('0x1b')](_0x5d7b88[_0x2998('0x2e')][_0x2998('0x1b')]);_0x99deea['offset']=qs[_0x2998('0x19')](_0x5d7b88[_0x2998('0x2e')][_0x2998('0x19')]);}return _0x359ee6[_0x2998('0x4c')](_0x99deea);}})[_0x2998('0x23')](function(_0x5b16fb){if(_0x5b16fb){return _0x5b16fb?{'count':_0x59dfa1,'rows':_0x5b16fb}:null;}})[_0x2998('0x23')](respondWithResult(_0x429aaf,null))[_0x2998('0x40')](handleError(_0x429aaf,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 511fee3..d661a6d 100644 --- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js +++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5525=['exports','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes'];(function(_0x5c489b,_0x460b3e){var _0x51a448=function(_0xc4c8c1){while(--_0xc4c8c1){_0x5c489b['push'](_0x5c489b['shift']());}};_0x51a448(++_0x460b3e);}(_0x5525,0xd4));var _0x5552=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x5525[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x5552('0x0'));var util=require(_0x5552('0x1'));var logger=require(_0x5552('0x2'))('api');var moment=require(_0x5552('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5552('0x4'));var rimraf=require(_0x5552('0x5'));var config=require(_0x5552('0x6'));var attributes=require(_0x5552('0x7'));module[_0x5552('0x8')]=function(_0x3ca68a,_0x4bb2d4){return _0x3ca68a['define'](_0x5552('0x9'),attributes,{'tableName':_0x5552('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd3c7=['rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x376380,_0x307e68){var _0x17bc2b=function(_0x327954){while(--_0x327954){_0x376380['push'](_0x376380['shift']());}};_0x17bc2b(++_0x307e68);}(_0xd3c7,0x199));var _0x7d3c=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xd3c7[_0x432682];return _0x463d05;};'use strict';var _=require(_0x7d3c('0x0'));var util=require(_0x7d3c('0x1'));var logger=require(_0x7d3c('0x2'))(_0x7d3c('0x3'));var moment=require(_0x7d3c('0x4'));var BPromise=require(_0x7d3c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7d3c('0x6'));var rimraf=require(_0x7d3c('0x7'));var config=require(_0x7d3c('0x8'));var attributes=require(_0x7d3c('0x9'));module[_0x7d3c('0xa')]=function(_0x2b1e97,_0x2cff7c){return _0x2b1e97[_0x7d3c('0xb')]('SugarcrmConfiguration',attributes,{'tableName':_0x7d3c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 99a2243..aa67626 100644 --- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js +++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7c07=['ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7c07,0x104));var _0x77c0=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x7c07[_0x5d4607];return _0x5e4a86;};'use strict';var _=require(_0x77c0('0x0'));var util=require('util');var moment=require(_0x77c0('0x1'));var BPromise=require(_0x77c0('0x2'));var rs=require(_0x77c0('0x3'));var fs=require('fs');var Redis=require(_0x77c0('0x4'));var db=require(_0x77c0('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x77c0('0x6'));var jayson=require(_0x77c0('0x7'));var client=jayson[_0x77c0('0x8')][_0x77c0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e62d6,_0x434b18,_0x4a0f1c){return new BPromise(function(_0x32bfd1,_0x1e9e06){return client[_0x77c0('0xa')](_0x3e62d6,_0x4a0f1c)[_0x77c0('0xb')](function(_0x3a8af1){logger[_0x77c0('0xc')](_0x77c0('0xd'),_0x434b18,_0x77c0('0xe'));logger[_0x77c0('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x434b18,_0x77c0('0xe'),JSON[_0x77c0('0x10')](_0x3a8af1));if(_0x3a8af1[_0x77c0('0x11')]){if(_0x3a8af1[_0x77c0('0x11')][_0x77c0('0x12')]===0x1f4){logger[_0x77c0('0x11')](_0x77c0('0xd'),_0x434b18,_0x3a8af1[_0x77c0('0x11')][_0x77c0('0x13')]);return _0x1e9e06(_0x3a8af1['error'][_0x77c0('0x13')]);}logger[_0x77c0('0x11')](_0x77c0('0xd'),_0x434b18,_0x3a8af1[_0x77c0('0x11')][_0x77c0('0x13')]);return _0x32bfd1(_0x3a8af1[_0x77c0('0x11')]['message']);}else{logger['info'](_0x77c0('0xd'),_0x434b18,_0x77c0('0xe'));_0x32bfd1(_0x3a8af1[_0x77c0('0x14')][_0x77c0('0x13')]);}})[_0x77c0('0x15')](function(_0x218a19){logger[_0x77c0('0x11')](_0x77c0('0xd'),_0x434b18,_0x218a19);_0x1e9e06(_0x218a19);});});} \ No newline at end of file +var _0xfc2b=['code','message','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x368bba,_0x1f625b){var _0x409f8f=function(_0x463373){while(--_0x463373){_0x368bba['push'](_0x368bba['shift']());}};_0x409f8f(++_0x1f625b);}(_0xfc2b,0x1d1));var _0xbfc2=function(_0x310175,_0x3acb8d){_0x310175=_0x310175-0x0;var _0x1713c5=_0xfc2b[_0x310175];return _0x1713c5;};'use strict';var _=require(_0xbfc2('0x0'));var util=require('util');var moment=require(_0xbfc2('0x1'));var BPromise=require(_0xbfc2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbfc2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbfc2('0x4'));var logger=require(_0xbfc2('0x5'))('rpc');var config=require(_0xbfc2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xbfc2('0x7')][_0xbfc2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x16d1bf,_0x18fcde,_0x1ee590){return new BPromise(function(_0x111cdc,_0x3114e4){return client[_0xbfc2('0x9')](_0x16d1bf,_0x1ee590)[_0xbfc2('0xa')](function(_0x302974){logger[_0xbfc2('0xb')](_0xbfc2('0xc'),_0x18fcde,_0xbfc2('0xd'));logger[_0xbfc2('0xe')](_0xbfc2('0xf'),_0x18fcde,_0xbfc2('0xd'),JSON[_0xbfc2('0x10')](_0x302974));if(_0x302974[_0xbfc2('0x11')]){if(_0x302974[_0xbfc2('0x11')][_0xbfc2('0x12')]===0x1f4){logger[_0xbfc2('0x11')](_0xbfc2('0xc'),_0x18fcde,_0x302974[_0xbfc2('0x11')][_0xbfc2('0x13')]);return _0x3114e4(_0x302974[_0xbfc2('0x11')][_0xbfc2('0x13')]);}logger['error'](_0xbfc2('0xc'),_0x18fcde,_0x302974[_0xbfc2('0x11')]['message']);return _0x111cdc(_0x302974['error'][_0xbfc2('0x13')]);}else{logger['info'](_0xbfc2('0xc'),_0x18fcde,_0xbfc2('0xd'));_0x111cdc(_0x302974['result'][_0xbfc2('0x13')]);}})[_0xbfc2('0x14')](function(_0x2965cd){logger[_0xbfc2('0x11')](_0xbfc2('0xc'),_0x18fcde,_0x2965cd);_0x3114e4(_0x2965cd);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 830c700..0dcc8fe 100644 --- a/server/api/intSugarcrmField/index.js +++ b/server/api/intSugarcrmField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf721=['Router','fs-extra','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','show','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0xe39824,_0xbdf61f){var _0x4bc31e=function(_0x594760){while(--_0x594760){_0xe39824['push'](_0xe39824['shift']());}};_0x4bc31e(++_0xbdf61f);}(_0xf721,0xea));var _0x1f72=function(_0x507403,_0x3f954d){_0x507403=_0x507403-0x0;var _0x1327c=_0xf721[_0x507403];return _0x1327c;};'use strict';var multer=require(_0x1f72('0x0'));var util=require(_0x1f72('0x1'));var path=require(_0x1f72('0x2'));var timeout=require(_0x1f72('0x3'));var express=require('express');var router=express[_0x1f72('0x4')]();var fs_extra=require(_0x1f72('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1f72('0x6'));var controller=require(_0x1f72('0x7'));router[_0x1f72('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x1f72('0x9')](),controller[_0x1f72('0xa')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x1f72('0xb')](_0x1f72('0xc'),auth[_0x1f72('0x9')](),controller[_0x1f72('0xd')]);router[_0x1f72('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x1f72('0xf')]);module[_0x1f72('0x10')]=router; \ No newline at end of file +var _0xdcc3=['/:id','show','post','update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index'];(function(_0x4755ce,_0x2f79cc){var _0x3dc15e=function(_0x22cc11){while(--_0x22cc11){_0x4755ce['push'](_0x4755ce['shift']());}};_0x3dc15e(++_0x2f79cc);}(_0xdcc3,0xf1));var _0x3dcc=function(_0x2cbb4b,_0x10654c){_0x2cbb4b=_0x2cbb4b-0x0;var _0x568e16=_0xdcc3[_0x2cbb4b];return _0x568e16;};'use strict';var multer=require(_0x3dcc('0x0'));var util=require(_0x3dcc('0x1'));var path=require(_0x3dcc('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3dcc('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3dcc('0x4'));var interaction=require(_0x3dcc('0x5'));var config=require(_0x3dcc('0x6'));var controller=require(_0x3dcc('0x7'));router[_0x3dcc('0x8')]('/',auth[_0x3dcc('0x9')](),controller[_0x3dcc('0xa')]);router['get'](_0x3dcc('0xb'),auth[_0x3dcc('0x9')](),controller[_0x3dcc('0xc')]);router[_0x3dcc('0xd')]('/',auth[_0x3dcc('0x9')](),controller['create']);router['put'](_0x3dcc('0xb'),auth[_0x3dcc('0x9')](),controller[_0x3dcc('0xe')]);router[_0x3dcc('0xf')]('/:id',auth[_0x3dcc('0x9')](),controller[_0x3dcc('0x10')]);module[_0x3dcc('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 79d690e..f745a58 100644 --- a/server/api/intSugarcrmField/intSugarcrmField.attributes.js +++ b/server/api/intSugarcrmField/intSugarcrmField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadf3=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x54b82a,_0xa88a0b){var _0x20a5f2=function(_0x30d121){while(--_0x30d121){_0x54b82a['push'](_0x54b82a['shift']());}};_0x20a5f2(++_0xa88a0b);}(_0xadf3,0x1e2));var _0x3adf=function(_0x49a93e,_0x1988d5){_0x49a93e=_0x49a93e-0x0;var _0xfddafe=_0xadf3[_0x49a93e];return _0xfddafe;};'use strict';var Sequelize=require(_0x3adf('0x0'));module[_0x3adf('0x1')]={'type':{'type':Sequelize[_0x3adf('0x2')](_0x3adf('0x3'),_0x3adf('0x4'),_0x3adf('0x5'),_0x3adf('0x6'),_0x3adf('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0x3adf('0x8')]},'key':{'type':Sequelize[_0x3adf('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0x3adf('0x3'),_0x3adf('0x4'),_0x3adf('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x3adf('0x8')]},'customField':{'type':Sequelize[_0x3adf('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd342=['customVariable','keyValue','picklist','STRING','ENUM','variable','BOOLEAN','sequelize','string'];(function(_0x2dfe1c,_0x52165a){var _0x251ca2=function(_0x5ba9ec){while(--_0x5ba9ec){_0x2dfe1c['push'](_0x2dfe1c['shift']());}};_0x251ca2(++_0x52165a);}(_0xd342,0xc4));var _0x2d34=function(_0x41a555,_0x58428a){_0x41a555=_0x41a555-0x0;var _0x1c01de=_0xd342[_0x41a555];return _0x1c01de;};'use strict';var Sequelize=require(_0x2d34('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x2d34('0x1'),'variable',_0x2d34('0x2'),_0x2d34('0x3'),_0x2d34('0x4')),'defaultValue':_0x2d34('0x1')},'content':{'type':Sequelize[_0x2d34('0x5')]},'key':{'type':Sequelize[_0x2d34('0x5')]},'keyType':{'type':Sequelize[_0x2d34('0x6')](_0x2d34('0x1'),_0x2d34('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0x2d34('0x5')]},'idField':{'type':Sequelize[_0x2d34('0x5')]},'nameField':{'type':Sequelize[_0x2d34('0x5')]},'customField':{'type':Sequelize[_0x2d34('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2d34('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index b4ea8b3..e1cf457 100644 --- a/server/api/intSugarcrmField/intSugarcrmField.controller.js +++ b/server/api/intSugarcrmField/intSugarcrmField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc32b=['fields','length','order','sort','pick','filter','where','merge','VIRTUAL','options','SugarcrmField','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','attributes'];(function(_0x37ad18,_0x57e109){var _0x3a66b4=function(_0x46ca6e){while(--_0x46ca6e){_0x37ad18['push'](_0x37ad18['shift']());}};_0x3a66b4(++_0x57e109);}(_0xc32b,0xb3));var _0xbc32=function(_0x1d912b,_0x1147fb){_0x1d912b=_0x1d912b-0x0;var _0x3a4446=_0xc32b[_0x1d912b];return _0x3a4446;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbc32('0x0'));var zipdir=require(_0xbc32('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbc32('0x2'));var moment=require(_0xbc32('0x3'));var BPromise=require(_0xbc32('0x4'));var Mustache=require(_0xbc32('0x5'));var util=require(_0xbc32('0x6'));var path=require('path');var sox=require(_0xbc32('0x7'));var csv=require(_0xbc32('0x8'));var ejs=require(_0xbc32('0x9'));var fs=require('fs');var fs_extra=require(_0xbc32('0xa'));var _=require(_0xbc32('0xb'));var squel=require(_0xbc32('0xc'));var crypto=require(_0xbc32('0xd'));var jsforce=require(_0xbc32('0xe'));var deskjs=require(_0xbc32('0xf'));var toCsv=require('to-csv');var querystring=require(_0xbc32('0x10'));var Papa=require(_0xbc32('0x11'));var Redis=require(_0xbc32('0x12'));var authService=require(_0xbc32('0x13'));var qs=require(_0xbc32('0x14'));var as=require(_0xbc32('0x15'));var hardwareService=require(_0xbc32('0x16'));var logger=require(_0xbc32('0x17'))(_0xbc32('0x18'));var utils=require(_0xbc32('0x19'));var config=require(_0xbc32('0x1a'));var licenseUtil=require(_0xbc32('0x1b'));var db=require(_0xbc32('0x1c'))['db'];function respondWithStatusCode(_0x144ed9,_0x5e15fa){_0x5e15fa=_0x5e15fa||0xcc;return function(_0x219592){if(_0x219592){return _0x144ed9[_0xbc32('0x1d')](_0x5e15fa);}return _0x144ed9['status'](_0x5e15fa)['end']();};}function respondWithResult(_0x102f37,_0x5518b1){_0x5518b1=_0x5518b1||0xc8;return function(_0x494222){if(_0x494222){return _0x102f37[_0xbc32('0x1e')](_0x5518b1)[_0xbc32('0x1f')](_0x494222);}};}function respondWithFilteredResult(_0x22175b,_0x57eec4){return function(_0x5ab0d5){if(_0x5ab0d5){var _0x33cf91=typeof _0x57eec4['offset']===_0xbc32('0x20')&&typeof _0x57eec4[_0xbc32('0x21')]==='undefined';var _0x44bd72=_0x5ab0d5[_0xbc32('0x22')];var _0x1bead4=_0x33cf91?0x0:_0x57eec4[_0xbc32('0x23')];var _0x4519bd=_0x33cf91?_0x5ab0d5[_0xbc32('0x22')]:_0x57eec4[_0xbc32('0x23')]+_0x57eec4[_0xbc32('0x21')];var _0x4ffba1;if(_0x4519bd>=_0x44bd72){_0x4519bd=_0x44bd72;_0x4ffba1=0xc8;}else{_0x4ffba1=0xce;}_0x22175b[_0xbc32('0x1e')](_0x4ffba1);return _0x22175b['set'](_0xbc32('0x24'),_0x1bead4+'-'+_0x4519bd+'/'+_0x44bd72)['json'](_0x5ab0d5);}return null;};}function patchUpdates(_0x18f66b){return function(_0xd0c8b5){try{jsonpatch[_0xbc32('0x25')](_0xd0c8b5,_0x18f66b,!![]);}catch(_0x36055e){return BPromise[_0xbc32('0x26')](_0x36055e);}return _0xd0c8b5[_0xbc32('0x27')]();};}function saveUpdates(_0x4ee79a,_0xcdea58){return function(_0x589ef3){if(_0x589ef3){return _0x589ef3[_0xbc32('0x28')](_0x4ee79a)[_0xbc32('0x29')](function(_0x33a6af){return _0x33a6af;});}return null;};}function removeEntity(_0x553e23,_0x1d0dd7){return function(_0x1f615d){if(_0x1f615d){return _0x1f615d[_0xbc32('0x2a')]()[_0xbc32('0x29')](function(){_0x553e23['status'](0xcc)[_0xbc32('0x2b')]();});}};}function handleEntityNotFound(_0x579226,_0xafd14f){return function(_0x13c26b){if(!_0x13c26b){_0x579226[_0xbc32('0x1d')](0x194);}return _0x13c26b;};}function handleError(_0x1a1ddf,_0x5a29b1){_0x5a29b1=_0x5a29b1||0x1f4;return function(_0x107bed){logger[_0xbc32('0x2c')](_0x107bed['stack']);if(_0x107bed[_0xbc32('0x2d')]){delete _0x107bed['name'];}_0x1a1ddf['status'](_0x5a29b1)[_0xbc32('0x2e')](_0x107bed);};}exports[_0xbc32('0x2f')]=function(_0x237a54,_0x5c80b8){var _0x5397fd={},_0xbeb1ab={},_0x2e16c6={'count':0x0,'rows':[]};var _0x3860f3=_['map'](db['SugarcrmField']['rawAttributes'],function(_0x2a3548){return{'name':_0x2a3548[_0xbc32('0x30')],'type':_0x2a3548[_0xbc32('0x31')][_0xbc32('0x32')]};});_0xbeb1ab[_0xbc32('0x33')]=_[_0xbc32('0x34')](_0x3860f3,_0xbc32('0x2d'));_0xbeb1ab[_0xbc32('0x35')]=_[_0xbc32('0x36')](_0x237a54['query']);_0xbeb1ab[_0xbc32('0x37')]=_[_0xbc32('0x38')](_0xbeb1ab[_0xbc32('0x33')],_0xbeb1ab[_0xbc32('0x35')]);_0x5397fd[_0xbc32('0x39')]=_[_0xbc32('0x38')](_0xbeb1ab[_0xbc32('0x33')],qs[_0xbc32('0x3a')](_0x237a54['query'][_0xbc32('0x3a')]));_0x5397fd[_0xbc32('0x39')]=_0x5397fd[_0xbc32('0x39')][_0xbc32('0x3b')]?_0x5397fd['attributes']:_0xbeb1ab['model'];if(!_0x237a54[_0xbc32('0x35')]['hasOwnProperty']('nolimit')){_0x5397fd[_0xbc32('0x21')]=qs['limit'](_0x237a54[_0xbc32('0x35')][_0xbc32('0x21')]);_0x5397fd['offset']=qs['offset'](_0x237a54['query'][_0xbc32('0x23')]);}_0x5397fd[_0xbc32('0x3c')]=qs[_0xbc32('0x3d')](_0x237a54['query'][_0xbc32('0x3d')]);_0x5397fd['where']=qs[_0xbc32('0x37')](_[_0xbc32('0x3e')](_0x237a54[_0xbc32('0x35')],_0xbeb1ab[_0xbc32('0x37')]),_0x3860f3);if(_0x237a54[_0xbc32('0x35')][_0xbc32('0x3f')]){_0x5397fd[_0xbc32('0x40')]=_[_0xbc32('0x41')](_0x5397fd[_0xbc32('0x40')],{'$or':_[_0xbc32('0x34')](_0x3860f3,function(_0x2952f4){if(_0x2952f4[_0xbc32('0x31')]!==_0xbc32('0x42')){var _0x5b2c76={};_0x5b2c76[_0x2952f4[_0xbc32('0x2d')]]={'$like':'%'+_0x237a54[_0xbc32('0x35')][_0xbc32('0x3f')]+'%'};return _0x5b2c76;}})});}_0x5397fd=_[_0xbc32('0x41')]({},_0x5397fd,_0x237a54[_0xbc32('0x43')]);var _0x2ddfe1={'where':_0x5397fd[_0xbc32('0x40')]};return db[_0xbc32('0x44')][_0xbc32('0x22')](_0x2ddfe1)[_0xbc32('0x29')](function(_0x432890){_0x2e16c6[_0xbc32('0x22')]=_0x432890;if(_0x237a54[_0xbc32('0x35')][_0xbc32('0x45')]){_0x5397fd[_0xbc32('0x46')]=[{'all':!![]}];}return db[_0xbc32('0x44')][_0xbc32('0x47')](_0x5397fd);})[_0xbc32('0x29')](function(_0x59115e){_0x2e16c6['rows']=_0x59115e;return _0x2e16c6;})[_0xbc32('0x29')](respondWithFilteredResult(_0x5c80b8,_0x5397fd))[_0xbc32('0x48')](handleError(_0x5c80b8,null));};exports[_0xbc32('0x49')]=function(_0x117860,_0x7cbe43){var _0x431783={'raw':!![],'where':{'id':_0x117860[_0xbc32('0x4a')]['id']}},_0x1d8a9b={};_0x1d8a9b['model']=_[_0xbc32('0x36')](db[_0xbc32('0x44')][_0xbc32('0x4b')]);_0x1d8a9b[_0xbc32('0x35')]=_[_0xbc32('0x36')](_0x117860['query']);_0x1d8a9b[_0xbc32('0x37')]=_[_0xbc32('0x38')](_0x1d8a9b['model'],_0x1d8a9b[_0xbc32('0x35')]);_0x431783[_0xbc32('0x39')]=_['intersection'](_0x1d8a9b[_0xbc32('0x33')],qs['fields'](_0x117860['query'][_0xbc32('0x3a')]));_0x431783[_0xbc32('0x39')]=_0x431783[_0xbc32('0x39')][_0xbc32('0x3b')]?_0x431783[_0xbc32('0x39')]:_0x1d8a9b[_0xbc32('0x33')];if(_0x117860['query'][_0xbc32('0x45')]){_0x431783[_0xbc32('0x46')]=[{'all':!![]}];}_0x431783=_[_0xbc32('0x41')]({},_0x431783,_0x117860[_0xbc32('0x43')]);return db[_0xbc32('0x44')][_0xbc32('0x4c')](_0x431783)[_0xbc32('0x29')](handleEntityNotFound(_0x7cbe43,null))[_0xbc32('0x29')](respondWithResult(_0x7cbe43,null))['catch'](handleError(_0x7cbe43,null));};exports[_0xbc32('0x4d')]=function(_0x4fac26,_0x5e8472){return db['SugarcrmField'][_0xbc32('0x4d')](_0x4fac26['body'],{})[_0xbc32('0x29')](respondWithResult(_0x5e8472,0xc9))[_0xbc32('0x48')](handleError(_0x5e8472,null));};exports[_0xbc32('0x28')]=function(_0x49f279,_0x4b7969){if(_0x49f279['body']['id']){delete _0x49f279[_0xbc32('0x4e')]['id'];}return db['SugarcrmField']['find']({'where':{'id':_0x49f279[_0xbc32('0x4a')]['id']}})[_0xbc32('0x29')](handleEntityNotFound(_0x4b7969,null))[_0xbc32('0x29')](saveUpdates(_0x49f279[_0xbc32('0x4e')],null))[_0xbc32('0x29')](respondWithResult(_0x4b7969,null))['catch'](handleError(_0x4b7969,null));};exports[_0xbc32('0x2a')]=function(_0x1bb088,_0x28ac1e){return db['SugarcrmField'][_0xbc32('0x4c')]({'where':{'id':_0x1bb088['params']['id']}})[_0xbc32('0x29')](handleEntityNotFound(_0x28ac1e,null))[_0xbc32('0x29')](removeEntity(_0x28ac1e,null))['catch'](handleError(_0x28ac1e,null));}; \ No newline at end of file +var _0x5ba6=['attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','rawAttributes','length','find','catch','create','body','params','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','send','index','map','SugarcrmField','fieldName','type','key','name','keys','query','filters','intersection','model'];(function(_0x375f0f,_0x2682db){var _0x46770b=function(_0x4fc781){while(--_0x4fc781){_0x375f0f['push'](_0x375f0f['shift']());}};_0x46770b(++_0x2682db);}(_0x5ba6,0xa8));var _0x65ba=function(_0x441ede,_0x47fd70){_0x441ede=_0x441ede-0x0;var _0x4ab3cf=_0x5ba6[_0x441ede];return _0x4ab3cf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65ba('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65ba('0x1'));var rp=require(_0x65ba('0x2'));var moment=require(_0x65ba('0x3'));var BPromise=require(_0x65ba('0x4'));var Mustache=require(_0x65ba('0x5'));var util=require(_0x65ba('0x6'));var path=require(_0x65ba('0x7'));var sox=require(_0x65ba('0x8'));var csv=require(_0x65ba('0x9'));var ejs=require(_0x65ba('0xa'));var fs=require('fs');var fs_extra=require(_0x65ba('0xb'));var _=require(_0x65ba('0xc'));var squel=require(_0x65ba('0xd'));var crypto=require(_0x65ba('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x65ba('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x65ba('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x65ba('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x65ba('0x12'));var utils=require(_0x65ba('0x13'));var config=require(_0x65ba('0x14'));var licenseUtil=require(_0x65ba('0x15'));var db=require(_0x65ba('0x16'))['db'];function respondWithStatusCode(_0x798397,_0x5ef70d){_0x5ef70d=_0x5ef70d||0xcc;return function(_0x864f84){if(_0x864f84){return _0x798397['sendStatus'](_0x5ef70d);}return _0x798397[_0x65ba('0x17')](_0x5ef70d)[_0x65ba('0x18')]();};}function respondWithResult(_0x4067e0,_0x3b91b4){_0x3b91b4=_0x3b91b4||0xc8;return function(_0x3b3899){if(_0x3b3899){return _0x4067e0['status'](_0x3b91b4)['json'](_0x3b3899);}};}function respondWithFilteredResult(_0x492332,_0x113f67){return function(_0x4676e3){if(_0x4676e3){var _0x5106ca=typeof _0x113f67[_0x65ba('0x19')]==='undefined'&&typeof _0x113f67[_0x65ba('0x1a')]==='undefined';var _0x75c52d=_0x4676e3['count'];var _0xd62df8=_0x5106ca?0x0:_0x113f67[_0x65ba('0x19')];var _0x1014b8=_0x5106ca?_0x4676e3[_0x65ba('0x1b')]:_0x113f67['offset']+_0x113f67[_0x65ba('0x1a')];var _0x161f1d;if(_0x1014b8>=_0x75c52d){_0x1014b8=_0x75c52d;_0x161f1d=0xc8;}else{_0x161f1d=0xce;}_0x492332[_0x65ba('0x17')](_0x161f1d);return _0x492332[_0x65ba('0x1c')](_0x65ba('0x1d'),_0xd62df8+'-'+_0x1014b8+'/'+_0x75c52d)[_0x65ba('0x1e')](_0x4676e3);}return null;};}function patchUpdates(_0x228df7){return function(_0x2176e6){try{jsonpatch[_0x65ba('0x1f')](_0x2176e6,_0x228df7,!![]);}catch(_0x547c84){return BPromise[_0x65ba('0x20')](_0x547c84);}return _0x2176e6[_0x65ba('0x21')]();};}function saveUpdates(_0x15b634,_0x12ac44){return function(_0x2ced29){if(_0x2ced29){return _0x2ced29[_0x65ba('0x22')](_0x15b634)[_0x65ba('0x23')](function(_0x4c1cda){return _0x4c1cda;});}return null;};}function removeEntity(_0x2a54ec,_0x118140){return function(_0x2c5e15){if(_0x2c5e15){return _0x2c5e15[_0x65ba('0x24')]()[_0x65ba('0x23')](function(){_0x2a54ec[_0x65ba('0x17')](0xcc)[_0x65ba('0x18')]();});}};}function handleEntityNotFound(_0x446c6d,_0x2f1431){return function(_0x2a0831){if(!_0x2a0831){_0x446c6d['sendStatus'](0x194);}return _0x2a0831;};}function handleError(_0x5d08ca,_0x1d7cac){_0x1d7cac=_0x1d7cac||0x1f4;return function(_0x4596d3){logger['error'](_0x4596d3[_0x65ba('0x25')]);if(_0x4596d3['name']){delete _0x4596d3['name'];}_0x5d08ca['status'](_0x1d7cac)[_0x65ba('0x26')](_0x4596d3);};}exports[_0x65ba('0x27')]=function(_0x3e8f71,_0x53e713){var _0x238ad3={},_0x33472e={},_0x44b402={'count':0x0,'rows':[]};var _0x46265e=_[_0x65ba('0x28')](db[_0x65ba('0x29')]['rawAttributes'],function(_0x44f8f7){return{'name':_0x44f8f7[_0x65ba('0x2a')],'type':_0x44f8f7[_0x65ba('0x2b')][_0x65ba('0x2c')]};});_0x33472e['model']=_['map'](_0x46265e,_0x65ba('0x2d'));_0x33472e['query']=_[_0x65ba('0x2e')](_0x3e8f71[_0x65ba('0x2f')]);_0x33472e[_0x65ba('0x30')]=_[_0x65ba('0x31')](_0x33472e[_0x65ba('0x32')],_0x33472e['query']);_0x238ad3[_0x65ba('0x33')]=_[_0x65ba('0x31')](_0x33472e[_0x65ba('0x32')],qs[_0x65ba('0x34')](_0x3e8f71[_0x65ba('0x2f')][_0x65ba('0x34')]));_0x238ad3['attributes']=_0x238ad3[_0x65ba('0x33')]['length']?_0x238ad3['attributes']:_0x33472e[_0x65ba('0x32')];if(!_0x3e8f71['query'][_0x65ba('0x35')](_0x65ba('0x36'))){_0x238ad3[_0x65ba('0x1a')]=qs[_0x65ba('0x1a')](_0x3e8f71[_0x65ba('0x2f')][_0x65ba('0x1a')]);_0x238ad3[_0x65ba('0x19')]=qs['offset'](_0x3e8f71[_0x65ba('0x2f')][_0x65ba('0x19')]);}_0x238ad3[_0x65ba('0x37')]=qs['sort'](_0x3e8f71[_0x65ba('0x2f')][_0x65ba('0x38')]);_0x238ad3[_0x65ba('0x39')]=qs[_0x65ba('0x30')](_[_0x65ba('0x3a')](_0x3e8f71['query'],_0x33472e[_0x65ba('0x30')]),_0x46265e);if(_0x3e8f71['query'][_0x65ba('0x3b')]){_0x238ad3[_0x65ba('0x39')]=_[_0x65ba('0x3c')](_0x238ad3[_0x65ba('0x39')],{'$or':_[_0x65ba('0x28')](_0x46265e,function(_0x2331cf){if(_0x2331cf[_0x65ba('0x2b')]!==_0x65ba('0x3d')){var _0x2d6f81={};_0x2d6f81[_0x2331cf['name']]={'$like':'%'+_0x3e8f71[_0x65ba('0x2f')]['filter']+'%'};return _0x2d6f81;}})});}_0x238ad3=_[_0x65ba('0x3c')]({},_0x238ad3,_0x3e8f71[_0x65ba('0x3e')]);var _0x3323d1={'where':_0x238ad3[_0x65ba('0x39')]};return db['SugarcrmField']['count'](_0x3323d1)['then'](function(_0x354be8){_0x44b402[_0x65ba('0x1b')]=_0x354be8;if(_0x3e8f71['query'][_0x65ba('0x3f')]){_0x238ad3['include']=[{'all':!![]}];}return db['SugarcrmField']['findAll'](_0x238ad3);})['then'](function(_0x49e5cc){_0x44b402[_0x65ba('0x40')]=_0x49e5cc;return _0x44b402;})[_0x65ba('0x23')](respondWithFilteredResult(_0x53e713,_0x238ad3))['catch'](handleError(_0x53e713,null));};exports[_0x65ba('0x41')]=function(_0x49c3a4,_0xe8d421){var _0x20c511={'raw':!![],'where':{'id':_0x49c3a4['params']['id']}},_0x47acf6={};_0x47acf6[_0x65ba('0x32')]=_[_0x65ba('0x2e')](db[_0x65ba('0x29')][_0x65ba('0x42')]);_0x47acf6['query']=_['keys'](_0x49c3a4[_0x65ba('0x2f')]);_0x47acf6[_0x65ba('0x30')]=_[_0x65ba('0x31')](_0x47acf6['model'],_0x47acf6[_0x65ba('0x2f')]);_0x20c511[_0x65ba('0x33')]=_[_0x65ba('0x31')](_0x47acf6[_0x65ba('0x32')],qs[_0x65ba('0x34')](_0x49c3a4[_0x65ba('0x2f')][_0x65ba('0x34')]));_0x20c511[_0x65ba('0x33')]=_0x20c511[_0x65ba('0x33')][_0x65ba('0x43')]?_0x20c511['attributes']:_0x47acf6[_0x65ba('0x32')];if(_0x49c3a4['query'][_0x65ba('0x3f')]){_0x20c511['include']=[{'all':!![]}];}_0x20c511=_['merge']({},_0x20c511,_0x49c3a4[_0x65ba('0x3e')]);return db[_0x65ba('0x29')][_0x65ba('0x44')](_0x20c511)[_0x65ba('0x23')](handleEntityNotFound(_0xe8d421,null))[_0x65ba('0x23')](respondWithResult(_0xe8d421,null))[_0x65ba('0x45')](handleError(_0xe8d421,null));};exports['create']=function(_0x2b0a2b,_0x1a6e69){return db[_0x65ba('0x29')][_0x65ba('0x46')](_0x2b0a2b['body'],{})[_0x65ba('0x23')](respondWithResult(_0x1a6e69,0xc9))[_0x65ba('0x45')](handleError(_0x1a6e69,null));};exports['update']=function(_0x2256fa,_0x1cada7){if(_0x2256fa[_0x65ba('0x47')]['id']){delete _0x2256fa[_0x65ba('0x47')]['id'];}return db['SugarcrmField'][_0x65ba('0x44')]({'where':{'id':_0x2256fa[_0x65ba('0x48')]['id']}})[_0x65ba('0x23')](handleEntityNotFound(_0x1cada7,null))['then'](saveUpdates(_0x2256fa[_0x65ba('0x47')],null))[_0x65ba('0x23')](respondWithResult(_0x1cada7,null))[_0x65ba('0x45')](handleError(_0x1cada7,null));};exports['destroy']=function(_0x4a9986,_0x4012c1){return db[_0x65ba('0x29')][_0x65ba('0x44')]({'where':{'id':_0x4a9986[_0x65ba('0x48')]['id']}})[_0x65ba('0x23')](handleEntityNotFound(_0x4012c1,null))[_0x65ba('0x23')](removeEntity(_0x4012c1,null))[_0x65ba('0x45')](handleError(_0x4012c1,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index aed65f5..2f3d84b 100644 --- a/server/api/intSugarcrmField/intSugarcrmField.model.js +++ b/server/api/intSugarcrmField/intSugarcrmField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x91a9=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','SugarcrmField','sugarcrm_unique_index','idField','FieldId'];(function(_0x3c3c24,_0x498702){var _0x31596d=function(_0x10ed65){while(--_0x10ed65){_0x3c3c24['push'](_0x3c3c24['shift']());}};_0x31596d(++_0x498702);}(_0x91a9,0x120));var _0x991a=function(_0x500a59,_0x2d2d9f){_0x500a59=_0x500a59-0x0;var _0x3b6f27=_0x91a9[_0x500a59];return _0x3b6f27;};'use strict';var _=require(_0x991a('0x0'));var util=require(_0x991a('0x1'));var logger=require(_0x991a('0x2'))(_0x991a('0x3'));var moment=require(_0x991a('0x4'));var BPromise=require(_0x991a('0x5'));var rp=require(_0x991a('0x6'));var fs=require('fs');var path=require(_0x991a('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intSugarcrmField.attributes');module['exports']=function(_0x5af0fc,_0x1ad546){return _0x5af0fc['define'](_0x991a('0x8'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x991a('0x9'),'fields':[_0x991a('0xa'),_0x991a('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xefd9=['SugarcrmField','int_sugarcrm_fields','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xefd9,0x130));var _0x9efd=function(_0x1f2ae0,_0x4f298b){_0x1f2ae0=_0x1f2ae0-0x0;var _0xe4c555=_0xefd9[_0x1f2ae0];return _0xe4c555;};'use strict';var _=require(_0x9efd('0x0'));var util=require(_0x9efd('0x1'));var logger=require(_0x9efd('0x2'))('api');var moment=require(_0x9efd('0x3'));var BPromise=require(_0x9efd('0x4'));var rp=require(_0x9efd('0x5'));var fs=require('fs');var path=require(_0x9efd('0x6'));var rimraf=require(_0x9efd('0x7'));var config=require(_0x9efd('0x8'));var attributes=require('./intSugarcrmField.attributes');module[_0x9efd('0x9')]=function(_0x2ec926,_0x1a7ee0){return _0x2ec926[_0x9efd('0xa')](_0x9efd('0xb'),attributes,{'tableName':_0x9efd('0xc'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x9efd('0xd'),_0x9efd('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index 6d3f4f3..5e99e86 100644 --- a/server/api/intSugarcrmField/intSugarcrmField.rpc.js +++ b/server/api/intSugarcrmField/intSugarcrmField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc41d=['SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3f3eef,_0x2b50f4){var _0x4523ef=function(_0x36ac77){while(--_0x36ac77){_0x3f3eef['push'](_0x3f3eef['shift']());}};_0x4523ef(++_0x2b50f4);}(_0xc41d,0x8b));var _0xdc41=function(_0x316489,_0x5cd6cb){_0x316489=_0x316489-0x0;var _0x5be6a5=_0xc41d[_0x316489];return _0x5be6a5;};'use strict';var _=require(_0xdc41('0x0'));var util=require('util');var moment=require(_0xdc41('0x1'));var BPromise=require(_0xdc41('0x2'));var rs=require(_0xdc41('0x3'));var fs=require('fs');var Redis=require(_0xdc41('0x4'));var db=require(_0xdc41('0x5'))['db'];var utils=require(_0xdc41('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xdc41('0x7'));var client=jayson[_0xdc41('0x8')][_0xdc41('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x28c090,_0x578715,_0x4510ef){return new BPromise(function(_0x38cf22,_0x42b1d7){return client[_0xdc41('0xa')](_0x28c090,_0x4510ef)[_0xdc41('0xb')](function(_0xfede6f){logger['info'](_0xdc41('0xc'),_0x578715,_0xdc41('0xd'));logger[_0xdc41('0xe')](_0xdc41('0xf'),_0x578715,'request\x20sent',JSON[_0xdc41('0x10')](_0xfede6f));if(_0xfede6f[_0xdc41('0x11')]){if(_0xfede6f['error']['code']===0x1f4){logger[_0xdc41('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x578715,_0xfede6f[_0xdc41('0x11')][_0xdc41('0x12')]);return _0x42b1d7(_0xfede6f[_0xdc41('0x11')][_0xdc41('0x12')]);}logger[_0xdc41('0x11')](_0xdc41('0xc'),_0x578715,_0xfede6f[_0xdc41('0x11')][_0xdc41('0x12')]);return _0x38cf22(_0xfede6f[_0xdc41('0x11')][_0xdc41('0x12')]);}else{logger[_0xdc41('0x13')](_0xdc41('0xc'),_0x578715,'request\x20sent');_0x38cf22(_0xfede6f[_0xdc41('0x14')][_0xdc41('0x12')]);}})[_0xdc41('0x15')](function(_0x3e0f23){logger[_0xdc41('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x578715,_0x3e0f23);_0x42b1d7(_0x3e0f23);});});} \ No newline at end of file +var _0xb70d=['jayson/promise','client','http','request','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','ioredis','../../config/utils','rpc','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb70d,0x68));var _0xdb70=function(_0x5314a7,_0x5cc993){_0x5314a7=_0x5314a7-0x0;var _0x1a9f1b=_0xb70d[_0x5314a7];return _0x1a9f1b;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdb70('0x0'));var db=require('../../mysqldb')['db'];var utils=require(_0xdb70('0x1'));var logger=require('../../config/logger')(_0xdb70('0x2'));var config=require(_0xdb70('0x3'));var jayson=require(_0xdb70('0x4'));var client=jayson[_0xdb70('0x5')][_0xdb70('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x511c55,_0x1de293,_0x185ab8){return new BPromise(function(_0x50b0a1,_0x5c5f3e){return client[_0xdb70('0x7')](_0x511c55,_0x185ab8)['then'](function(_0x5dd305){logger[_0xdb70('0x8')](_0xdb70('0x9'),_0x1de293,_0xdb70('0xa'));logger[_0xdb70('0xb')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x1de293,_0xdb70('0xa'),JSON[_0xdb70('0xc')](_0x5dd305));if(_0x5dd305[_0xdb70('0xd')]){if(_0x5dd305[_0xdb70('0xd')][_0xdb70('0xe')]===0x1f4){logger[_0xdb70('0xd')](_0xdb70('0x9'),_0x1de293,_0x5dd305[_0xdb70('0xd')]['message']);return _0x5c5f3e(_0x5dd305[_0xdb70('0xd')][_0xdb70('0xf')]);}logger[_0xdb70('0xd')]('SugarcrmField,\x20%s,\x20%s',_0x1de293,_0x5dd305[_0xdb70('0xd')][_0xdb70('0xf')]);return _0x50b0a1(_0x5dd305['error'][_0xdb70('0xf')]);}else{logger['info']('SugarcrmField,\x20%s,\x20%s',_0x1de293,_0xdb70('0xa'));_0x50b0a1(_0x5dd305[_0xdb70('0x10')][_0xdb70('0xf')]);}})[_0xdb70('0x11')](function(_0x1c5ed6){logger[_0xdb70('0xd')](_0xdb70('0x9'),_0x1de293,_0x1c5ed6);_0x5c5f3e(_0x1c5ed6);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index eb6d171..bcf811f 100644 --- a/server/api/intVtigerAccount/index.js +++ b/server/api/intVtigerAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x15ab=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerAccount.controller','get','index','/:id','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','post','create','update','delete','exports','multer','util'];(function(_0x55fc38,_0x19bc7d){var _0x3cd5e4=function(_0x978b3e){while(--_0x978b3e){_0x55fc38['push'](_0x55fc38['shift']());}};_0x3cd5e4(++_0x19bc7d);}(_0x15ab,0xda));var _0xb15a=function(_0x21a3b9,_0x4bf4f5){_0x21a3b9=_0x21a3b9-0x0;var _0x106ec3=_0x15ab[_0x21a3b9];return _0x106ec3;};'use strict';var multer=require(_0xb15a('0x0'));var util=require(_0xb15a('0x1'));var path=require(_0xb15a('0x2'));var timeout=require(_0xb15a('0x3'));var express=require(_0xb15a('0x4'));var router=express[_0xb15a('0x5')]();var fs_extra=require(_0xb15a('0x6'));var auth=require(_0xb15a('0x7'));var interaction=require(_0xb15a('0x8'));var config=require('../../config/environment');var controller=require(_0xb15a('0x9'));router[_0xb15a('0xa')]('/',auth['isAuthenticated'](),controller[_0xb15a('0xb')]);router['get'](_0xb15a('0xc'),auth[_0xb15a('0xd')](),controller['show']);router[_0xb15a('0xa')](_0xb15a('0xe'),auth[_0xb15a('0xd')](),controller[_0xb15a('0xf')]);router[_0xb15a('0xa')](_0xb15a('0x10'),auth[_0xb15a('0xd')](),controller['getFields']);router[_0xb15a('0x11')]('/',auth[_0xb15a('0xd')](),controller[_0xb15a('0x12')]);router[_0xb15a('0x11')](_0xb15a('0xe'),auth[_0xb15a('0xd')](),controller['addConfiguration']);router['put']('/:id',auth[_0xb15a('0xd')](),controller[_0xb15a('0x13')]);router[_0xb15a('0x14')](_0xb15a('0xc'),auth[_0xb15a('0xd')](),controller['destroy']);module[_0xb15a('0x15')]=router; \ No newline at end of file +var _0x4953=['get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intVtigerAccount.controller'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0x4953,0x10a));var _0x3495=function(_0x5f49d5,_0x4a2034){_0x5f49d5=_0x5f49d5-0x0;var _0x3acad6=_0x4953[_0x5f49d5];return _0x3acad6;};'use strict';var multer=require(_0x3495('0x0'));var util=require(_0x3495('0x1'));var path=require(_0x3495('0x2'));var timeout=require(_0x3495('0x3'));var express=require(_0x3495('0x4'));var router=express[_0x3495('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3495('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3495('0x7'));var controller=require(_0x3495('0x8'));router[_0x3495('0x9')]('/',auth[_0x3495('0xa')](),controller[_0x3495('0xb')]);router[_0x3495('0x9')](_0x3495('0xc'),auth[_0x3495('0xa')](),controller[_0x3495('0xd')]);router['get'](_0x3495('0xe'),auth[_0x3495('0xa')](),controller['getConfigurations']);router[_0x3495('0x9')](_0x3495('0xf'),auth[_0x3495('0xa')](),controller[_0x3495('0x10')]);router[_0x3495('0x11')]('/',auth[_0x3495('0xa')](),controller[_0x3495('0x12')]);router['post']('/:id/configurations',auth[_0x3495('0xa')](),controller[_0x3495('0x13')]);router[_0x3495('0x14')](_0x3495('0xc'),auth[_0x3495('0xa')](),controller[_0x3495('0x15')]);router[_0x3495('0x16')](_0x3495('0xc'),auth[_0x3495('0xa')](),controller[_0x3495('0x17')]);module[_0x3495('0x18')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 3c55bdd..76d5310 100644 --- a/server/api/intVtigerAccount/intVtigerAccount.attributes.js +++ b/server/api/intVtigerAccount/intVtigerAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2163=['sequelize','STRING','HelpDesk'];(function(_0x5735ea,_0x2c62d5){var _0x406bc0=function(_0x1c6bfb){while(--_0x1c6bfb){_0x5735ea['push'](_0x5735ea['shift']());}};_0x406bc0(++_0x2c62d5);}(_0x2163,0x81));var _0x3216=function(_0x21c5f3,_0x572076){_0x21c5f3=_0x21c5f3-0x0;var _0x48f2aa=_0x2163[_0x21c5f3];return _0x48f2aa;};'use strict';var Sequelize=require(_0x3216('0x0'));module['exports']={'name':{'type':Sequelize[_0x3216('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x3216('0x1')]},'username':{'type':Sequelize[_0x3216('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x3216('0x1')],'allowNull':![],'defaultValue':_0x3216('0x2')},'remoteUri':{'type':Sequelize[_0x3216('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x3216('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x3216('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xf260=['sequelize','exports','STRING','HelpDesk'];(function(_0x42c587,_0x224d2a){var _0x3410cc=function(_0x4c8815){while(--_0x4c8815){_0x42c587['push'](_0x42c587['shift']());}};_0x3410cc(++_0x224d2a);}(_0xf260,0x1a4));var _0x0f26=function(_0x2276f4,_0x4b0ee5){_0x2276f4=_0x2276f4-0x0;var _0x17186c=_0xf260[_0x2276f4];return _0x17186c;};'use strict';var Sequelize=require(_0x0f26('0x0'));module[_0x0f26('0x1')]={'name':{'type':Sequelize[_0x0f26('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x0f26('0x2')]},'username':{'type':Sequelize[_0x0f26('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x0f26('0x2')],'allowNull':![],'defaultValue':_0x0f26('0x3')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0x0f26('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 217866a..4fca553 100644 --- a/server/api/intVtigerAccount/intVtigerAccount.controller.js +++ b/server/api/intVtigerAccount/intVtigerAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x80f9=['desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','stack','name','send','index','map','VtigerAccount','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','catch','params','keys','length','find','create','body','getConfigurations','findOne','VtigerConfiguration','nolimit','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','VtigerField','username','moduleName','remoteUri','accessKey','%s/webservice.php','GET','getchallenge','success','POST','login','result','token','sessionName','reference','owner','remove','false','label','startsWith','cf_','picklistValues','value','log','vTiger\x20error:\x20','test','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','statusCode','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','jsforce'];(function(_0x3b380d,_0x33cbdf){var _0x381379=function(_0x291118){while(--_0x291118){_0x3b380d['push'](_0x3b380d['shift']());}};_0x381379(++_0x33cbdf);}(_0x80f9,0x65));var _0x980f=function(_0x5349df,_0x2c9cfe){_0x5349df=_0x5349df-0x0;var _0x447249=_0x80f9[_0x5349df];return _0x447249;};'use strict';var emlformat=require(_0x980f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x980f('0x1'));var jsonpatch=require(_0x980f('0x2'));var rp=require(_0x980f('0x3'));var moment=require(_0x980f('0x4'));var BPromise=require(_0x980f('0x5'));var Mustache=require(_0x980f('0x6'));var util=require(_0x980f('0x7'));var path=require(_0x980f('0x8'));var sox=require('sox');var csv=require(_0x980f('0x9'));var ejs=require(_0x980f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x980f('0xb'));var crypto=require('crypto');var jsforce=require(_0x980f('0xc'));var deskjs=require(_0x980f('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x980f('0xe'));var Redis=require(_0x980f('0xf'));var authService=require(_0x980f('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x980f('0x11'));var logger=require(_0x980f('0x12'))(_0x980f('0x13'));var utils=require(_0x980f('0x14'));var config=require(_0x980f('0x15'));var licenseUtil=require(_0x980f('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x980f('0x17'));function respondWithStatusCode(_0x3fe209,_0x4929ee){_0x4929ee=_0x4929ee||0xcc;return function(_0x33c277){if(_0x33c277){return _0x3fe209[_0x980f('0x18')](_0x4929ee);}return _0x3fe209[_0x980f('0x19')](_0x4929ee)['end']();};}function respondWithResult(_0x4c613c,_0x4fd14b){_0x4fd14b=_0x4fd14b||0xc8;return function(_0x3abbf9){if(_0x3abbf9){return _0x4c613c['status'](_0x4fd14b)[_0x980f('0x1a')](_0x3abbf9);}};}function respondWithFilteredResult(_0x4234de,_0x5c7b5c){return function(_0x227f16){if(_0x227f16){var _0xa253c1=typeof _0x5c7b5c[_0x980f('0x1b')]===_0x980f('0x1c')&&typeof _0x5c7b5c[_0x980f('0x1d')]==='undefined';var _0x229c79=_0x227f16[_0x980f('0x1e')];var _0x3bbe84=_0xa253c1?0x0:_0x5c7b5c[_0x980f('0x1b')];var _0x18b8b9=_0xa253c1?_0x227f16[_0x980f('0x1e')]:_0x5c7b5c['offset']+_0x5c7b5c['limit'];var _0x1729f8;if(_0x18b8b9>=_0x229c79){_0x18b8b9=_0x229c79;_0x1729f8=0xc8;}else{_0x1729f8=0xce;}_0x4234de['status'](_0x1729f8);return _0x4234de[_0x980f('0x1f')](_0x980f('0x20'),_0x3bbe84+'-'+_0x18b8b9+'/'+_0x229c79)['json'](_0x227f16);}return null;};}function patchUpdates(_0x1d857d){return function(_0x14df2d){try{jsonpatch[_0x980f('0x21')](_0x14df2d,_0x1d857d,!![]);}catch(_0x4cf5b6){return BPromise[_0x980f('0x22')](_0x4cf5b6);}return _0x14df2d[_0x980f('0x23')]();};}function saveUpdates(_0x42c4fe,_0x4d36b0){return function(_0x16b5cb){if(_0x16b5cb){return _0x16b5cb[_0x980f('0x24')](_0x42c4fe)['then'](function(_0x535b0c){return _0x535b0c;});}return null;};}function removeEntity(_0xfd8758,_0x13622e){return function(_0x53493d){if(_0x53493d){return _0x53493d['destroy']()[_0x980f('0x25')](function(){_0xfd8758['status'](0xcc)[_0x980f('0x26')]();});}};}function handleEntityNotFound(_0x169690,_0xa317b8){return function(_0xe6bcf5){if(!_0xe6bcf5){_0x169690[_0x980f('0x18')](0x194);}return _0xe6bcf5;};}function handleError(_0x4914a1,_0x4e0bbd){_0x4e0bbd=_0x4e0bbd||0x1f4;return function(_0x11544c){logger['error'](_0x11544c[_0x980f('0x27')]);if(_0x11544c[_0x980f('0x28')]){delete _0x11544c[_0x980f('0x28')];}_0x4914a1['status'](_0x4e0bbd)[_0x980f('0x29')](_0x11544c);};}exports[_0x980f('0x2a')]=function(_0x2db034,_0x1e32af){var _0x4cf7d2={},_0x47e296={},_0x506a6f={'count':0x0,'rows':[]};var _0xc8293f=_[_0x980f('0x2b')](db[_0x980f('0x2c')][_0x980f('0x2d')],function(_0x483f91){return{'name':_0x483f91['fieldName'],'type':_0x483f91[_0x980f('0x2e')][_0x980f('0x2f')]};});_0x47e296[_0x980f('0x30')]=_[_0x980f('0x2b')](_0xc8293f,_0x980f('0x28'));_0x47e296[_0x980f('0x31')]=_['keys'](_0x2db034[_0x980f('0x31')]);_0x47e296[_0x980f('0x32')]=_['intersection'](_0x47e296[_0x980f('0x30')],_0x47e296[_0x980f('0x31')]);_0x4cf7d2[_0x980f('0x33')]=_[_0x980f('0x34')](_0x47e296['model'],qs['fields'](_0x2db034['query'][_0x980f('0x35')]));_0x4cf7d2[_0x980f('0x33')]=_0x4cf7d2[_0x980f('0x33')]['length']?_0x4cf7d2['attributes']:_0x47e296[_0x980f('0x30')];if(!_0x2db034['query'][_0x980f('0x36')]('nolimit')){_0x4cf7d2[_0x980f('0x1d')]=qs[_0x980f('0x1d')](_0x2db034[_0x980f('0x31')]['limit']);_0x4cf7d2[_0x980f('0x1b')]=qs[_0x980f('0x1b')](_0x2db034[_0x980f('0x31')]['offset']);}_0x4cf7d2[_0x980f('0x37')]=qs[_0x980f('0x38')](_0x2db034['query'][_0x980f('0x38')]);_0x4cf7d2[_0x980f('0x39')]=qs['filters'](_[_0x980f('0x3a')](_0x2db034[_0x980f('0x31')],_0x47e296[_0x980f('0x32')]),_0xc8293f);if(_0x2db034[_0x980f('0x31')][_0x980f('0x3b')]){_0x4cf7d2[_0x980f('0x39')]=_['merge'](_0x4cf7d2[_0x980f('0x39')],{'$or':_[_0x980f('0x2b')](_0xc8293f,function(_0xc37829){if(_0xc37829[_0x980f('0x2e')]!==_0x980f('0x3c')){var _0x3bf305={};_0x3bf305[_0xc37829[_0x980f('0x28')]]={'$like':'%'+_0x2db034['query']['filter']+'%'};return _0x3bf305;}})});}_0x4cf7d2=_[_0x980f('0x3d')]({},_0x4cf7d2,_0x2db034[_0x980f('0x3e')]);var _0x1b5f98={'where':_0x4cf7d2[_0x980f('0x39')]};return db[_0x980f('0x2c')]['count'](_0x1b5f98)[_0x980f('0x25')](function(_0x4fd31b){_0x506a6f[_0x980f('0x1e')]=_0x4fd31b;if(_0x2db034[_0x980f('0x31')][_0x980f('0x3f')]){_0x4cf7d2[_0x980f('0x40')]=[{'all':!![]}];}return db[_0x980f('0x2c')]['findAll'](_0x4cf7d2);})[_0x980f('0x25')](function(_0x18fdf7){_0x506a6f['rows']=_0x18fdf7;return _0x506a6f;})[_0x980f('0x25')](respondWithFilteredResult(_0x1e32af,_0x4cf7d2))[_0x980f('0x41')](handleError(_0x1e32af,null));};exports['show']=function(_0x4853bf,_0x373ca4){var _0x1b4c13={'raw':![],'where':{'id':_0x4853bf[_0x980f('0x42')]['id']}},_0x3bc484={};_0x3bc484[_0x980f('0x30')]=_[_0x980f('0x43')](db[_0x980f('0x2c')][_0x980f('0x2d')]);_0x3bc484[_0x980f('0x31')]=_[_0x980f('0x43')](_0x4853bf[_0x980f('0x31')]);_0x3bc484['filters']=_['intersection'](_0x3bc484[_0x980f('0x30')],_0x3bc484['query']);_0x1b4c13[_0x980f('0x33')]=_['intersection'](_0x3bc484[_0x980f('0x30')],qs[_0x980f('0x35')](_0x4853bf['query'][_0x980f('0x35')]));_0x1b4c13[_0x980f('0x33')]=_0x1b4c13[_0x980f('0x33')][_0x980f('0x44')]?_0x1b4c13[_0x980f('0x33')]:_0x3bc484[_0x980f('0x30')];if(_0x4853bf['query'][_0x980f('0x3f')]){_0x1b4c13['include']=[{'all':!![]}];}_0x1b4c13=_[_0x980f('0x3d')]({},_0x1b4c13,_0x4853bf[_0x980f('0x3e')]);return db[_0x980f('0x2c')][_0x980f('0x45')](_0x1b4c13)[_0x980f('0x25')](handleEntityNotFound(_0x373ca4,null))[_0x980f('0x25')](respondWithResult(_0x373ca4,null))[_0x980f('0x41')](handleError(_0x373ca4,null));};exports['create']=function(_0x5952f3,_0x463a78){return db[_0x980f('0x2c')][_0x980f('0x46')](_0x5952f3[_0x980f('0x47')],{})[_0x980f('0x25')](respondWithResult(_0x463a78,0xc9))[_0x980f('0x41')](handleError(_0x463a78,null));};exports[_0x980f('0x24')]=function(_0x4a21c3,_0x143c9b){if(_0x4a21c3[_0x980f('0x47')]['id']){delete _0x4a21c3[_0x980f('0x47')]['id'];}return db[_0x980f('0x2c')][_0x980f('0x45')]({'where':{'id':_0x4a21c3[_0x980f('0x42')]['id']}})[_0x980f('0x25')](handleEntityNotFound(_0x143c9b,null))[_0x980f('0x25')](saveUpdates(_0x4a21c3[_0x980f('0x47')],null))[_0x980f('0x25')](respondWithResult(_0x143c9b,null))[_0x980f('0x41')](handleError(_0x143c9b,null));};exports['destroy']=function(_0x428053,_0x34b098){return db[_0x980f('0x2c')][_0x980f('0x45')]({'where':{'id':_0x428053[_0x980f('0x42')]['id']}})[_0x980f('0x25')](handleEntityNotFound(_0x34b098,null))['then'](removeEntity(_0x34b098,null))['catch'](handleError(_0x34b098,null));};exports[_0x980f('0x48')]=function(_0x4f33cf,_0x15f012,_0x2a7b24){var _0x5549f4={};var _0x31ca5e={};var _0x3c5395;var _0x1bd65b;return db[_0x980f('0x2c')][_0x980f('0x49')]({'where':{'id':_0x4f33cf['params']['id']}})[_0x980f('0x25')](handleEntityNotFound(_0x15f012,null))[_0x980f('0x25')](function(_0x192c97){if(_0x192c97){_0x3c5395=_0x192c97;_0x31ca5e['model']=_[_0x980f('0x43')](db[_0x980f('0x4a')][_0x980f('0x2d')]);_0x31ca5e[_0x980f('0x31')]=_['keys'](_0x4f33cf[_0x980f('0x31')]);_0x31ca5e[_0x980f('0x32')]=_['intersection'](_0x31ca5e['model'],_0x31ca5e[_0x980f('0x31')]);_0x5549f4[_0x980f('0x33')]=_['intersection'](_0x31ca5e[_0x980f('0x30')],qs['fields'](_0x4f33cf['query']['fields']));_0x5549f4['attributes']=_0x5549f4[_0x980f('0x33')][_0x980f('0x44')]?_0x5549f4['attributes']:_0x31ca5e[_0x980f('0x30')];_0x5549f4['order']=qs[_0x980f('0x38')](_0x4f33cf[_0x980f('0x31')][_0x980f('0x38')]);_0x5549f4[_0x980f('0x39')]=qs[_0x980f('0x32')](_[_0x980f('0x3a')](_0x4f33cf[_0x980f('0x31')],_0x31ca5e[_0x980f('0x32')]));if(_0x4f33cf[_0x980f('0x31')][_0x980f('0x3b')]){_0x5549f4[_0x980f('0x39')]=_[_0x980f('0x3d')](_0x5549f4[_0x980f('0x39')],{'$or':_[_0x980f('0x2b')](_0x5549f4[_0x980f('0x33')],function(_0x56c1d7){var _0x28aeb9={};_0x28aeb9[_0x56c1d7]={'$like':'%'+_0x4f33cf[_0x980f('0x31')][_0x980f('0x3b')]+'%'};return _0x28aeb9;})});}_0x5549f4=_[_0x980f('0x3d')]({},_0x5549f4,_0x4f33cf['options']);return _0x3c5395[_0x980f('0x48')](_0x5549f4);}})[_0x980f('0x25')](function(_0x558625){if(_0x558625){_0x1bd65b=_0x558625[_0x980f('0x44')];if(!_0x4f33cf[_0x980f('0x31')][_0x980f('0x36')](_0x980f('0x4b'))){_0x5549f4[_0x980f('0x1d')]=qs[_0x980f('0x1d')](_0x4f33cf[_0x980f('0x31')][_0x980f('0x1d')]);_0x5549f4[_0x980f('0x1b')]=qs[_0x980f('0x1b')](_0x4f33cf['query'][_0x980f('0x1b')]);}return _0x3c5395[_0x980f('0x48')](_0x5549f4);}})[_0x980f('0x25')](function(_0x58b44c){if(_0x58b44c){return _0x58b44c?{'count':_0x1bd65b,'rows':_0x58b44c}:null;}})[_0x980f('0x25')](respondWithResult(_0x15f012,null))[_0x980f('0x41')](handleError(_0x15f012,null));};exports[_0x980f('0x4c')]=function(_0xc53fe2,_0x1c93df,_0x5a1936){if(_0xc53fe2[_0x980f('0x47')]['id']){delete _0xc53fe2[_0x980f('0x47')]['id'];}return db[_0x980f('0x2c')]['findOne']({'where':{'id':_0xc53fe2[_0x980f('0x42')]['id']}})[_0x980f('0x25')](handleEntityNotFound(_0x1c93df,null))['then'](function(_0x55249f){if(_0x55249f){_0xc53fe2[_0x980f('0x47')][_0x980f('0x4d')]=_0x55249f['id'];_0xc53fe2['body'][_0x980f('0x4e')]=integrations[_0x980f('0x4f')](_0xc53fe2[_0x980f('0x47')]['channel'],_0xc53fe2['body'][_0x980f('0x2e')]);_0xc53fe2[_0x980f('0x47')][_0x980f('0x50')]=integrations[_0x980f('0x51')](_0xc53fe2[_0x980f('0x47')][_0x980f('0x52')],_0xc53fe2['body'][_0x980f('0x2e')]);return db[_0x980f('0x4a')][_0x980f('0x46')](_0xc53fe2[_0x980f('0x47')],{'include':[{'model':db['VtigerField'],'as':_0x980f('0x4e')},{'model':db[_0x980f('0x53')],'as':'Descriptions'}]});}return null;})[_0x980f('0x25')](respondWithResult(_0x1c93df,null))[_0x980f('0x41')](handleError(_0x1c93df,null));};var md5=require('md5');exports['getFields']=function(_0x3ff97b,_0x5d38e6,_0x2390a4){var _0x4082c3=null;var _0x29d7a4=null;var _0xf834a9=null;var _0x53c35f=null;var _0x1cbc6b='';return db[_0x980f('0x2c')][_0x980f('0x49')]({'where':{'id':_0x3ff97b[_0x980f('0x42')]['id']},'attributes':['id',_0x980f('0x28'),_0x980f('0x54'),'description',_0x980f('0x55'),_0x980f('0x56'),'serverUrl',_0x980f('0x57')]})[_0x980f('0x25')](handleEntityNotFound(_0x5d38e6,null))['then'](function(_0x106608){if(_0x106608){_0x4082c3=_0x106608['username'];_0x29d7a4=_0x106608[_0x980f('0x57')];_0xf834a9=_0x106608['moduleName'];_0x1cbc6b=_0x106608[_0x980f('0x56')];var _0x38c0a7=_0x1cbc6b['slice'](-0x1);if(_0x38c0a7==='/'){_0x1cbc6b=_0x1cbc6b['substring'](0x0,_0x1cbc6b['lastIndexOf'](_0x38c0a7));}_0x53c35f=util['format'](_0x980f('0x58'),_0x1cbc6b);var _0x15f4a3={'method':_0x980f('0x59'),'uri':_0x53c35f,'qs':{'operation':_0x980f('0x5a'),'username':_0x106608['username']},'json':!![]};return rp(_0x15f4a3);}})[_0x980f('0x25')](function(_0x4cef41){if(_0x4cef41[_0x980f('0x5b')]){var _0x3e8487={'method':_0x980f('0x5c'),'uri':_0x53c35f,'form':{'operation':_0x980f('0x5d'),'username':_0x4082c3,'accessKey':md5(_0x4cef41[_0x980f('0x5e')][_0x980f('0x5f')]+_0x29d7a4)},'json':!![]};return rp(_0x3e8487);}})['then'](function(_0x378509){if(_0x378509[_0x980f('0x5b')]){var _0x40178c={'method':_0x980f('0x59'),'uri':_0x53c35f,'qs':{'operation':'describe','username':_0x4082c3,'sessionName':_0x378509[_0x980f('0x5e')][_0x980f('0x60')],'elementType':_0xf834a9},'json':!![]};return rp(_0x40178c);}})[_0x980f('0x25')](function(_0x4a9441){if(_0x4a9441[_0x980f('0x5b')]){var _0x11019c=['autogenerated',_0x980f('0x61'),_0x980f('0x62')];_['remove'](_0x4a9441[_0x980f('0x5e')][_0x980f('0x35')],function(_0x56fe5a){return _0x11019c['includes'](_0x56fe5a[_0x980f('0x2e')]['name']);});_[_0x980f('0x63')](_0x4a9441[_0x980f('0x5e')][_0x980f('0x35')],function(_0x4f0f4c){return _0x4f0f4c['editable']===_0x980f('0x64');});return{'count':_0x4a9441['result'][_0x980f('0x35')][_0x980f('0x44')],'rows':_[_0x980f('0x2b')](_0x4a9441[_0x980f('0x5e')][_0x980f('0x35')],function(_0x541547){return{'id':_0x541547['name'],'name':_0x541547[_0x980f('0x65')],'custom':_[_0x980f('0x66')](_0x541547[_0x980f('0x28')],_0x980f('0x67'))?!![]:![],'options':_0x541547[_0x980f('0x2e')][_0x980f('0x28')]==='picklist'&&_0x541547[_0x980f('0x2e')][_0x980f('0x68')]['length']>0x0?_['map'](_0x541547[_0x980f('0x2e')]['picklistValues'],function(_0x2dfea9){return{'name':_0x2dfea9[_0x980f('0x65')],'value':_0x2dfea9[_0x980f('0x69')]};}):[]};})};}})[_0x980f('0x25')](respondWithResult(_0x5d38e6,null))[_0x980f('0x41')](function(_0x44797b){console[_0x980f('0x6a')](_0x980f('0x6b')+_0x44797b);var _0x28fa5f=_0x3ff97b['query'][_0x980f('0x6c')]?0x1f4:_0x44797b['statusCode']||0x1f4;logger[_0x980f('0x6d')](_0x980f('0x6e'),_0x980f('0x6f'),_0x28fa5f,JSON[_0x980f('0x70')](_0x44797b));delete _0x44797b[_0x980f('0x28')];if(_0x28fa5f===0x191){_0x28fa5f=0x190;}_0x5d38e6['status'](_0x28fa5f)[_0x980f('0x29')](_0x3ff97b[_0x980f('0x31')][_0x980f('0x6c')]?{'message':'Wrong\x20credentials','statusCode':_0x44797b[_0x980f('0x71')]}:_0x44797b);});}; \ No newline at end of file +var _0x11d9=['POST','login','result','token','describe','autogenerated','reference','owner','remove','includes','editable','false','startsWith','cf_','picklist','picklistValues','label','value','vTiger\x20error:\x20','statusCode','stringify','send','test','eml-format','rimraf','fast-json-patch','moment','bluebird','util','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','index','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','order','sort','where','merge','options','VtigerAccount','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','VtigerConfiguration','pick','filter','getConfigurations','hasOwnProperty','nolimit','AccountId','Subjects','getSubjects','channel','getDescriptions','VtigerField','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','lastIndexOf','format','GET','getchallenge','success'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x11d9,0x1e3));var _0x911d=function(_0x2c1d37,_0x5d849d){_0x2c1d37=_0x2c1d37-0x0;var _0xf92dba=_0x11d9[_0x2c1d37];return _0xf92dba;};'use strict';var emlformat=require(_0x911d('0x0'));var rimraf=require(_0x911d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x911d('0x2'));var rp=require('request-promise');var moment=require(_0x911d('0x3'));var BPromise=require(_0x911d('0x4'));var Mustache=require('mustache');var util=require(_0x911d('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x911d('0x6'));var ejs=require(_0x911d('0x7'));var fs=require('fs');var fs_extra=require(_0x911d('0x8'));var _=require('lodash');var squel=require(_0x911d('0x9'));var crypto=require(_0x911d('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x911d('0xb'));var toCsv=require(_0x911d('0x6'));var querystring=require(_0x911d('0xc'));var Papa=require(_0x911d('0xd'));var Redis=require('ioredis');var authService=require(_0x911d('0xe'));var qs=require(_0x911d('0xf'));var as=require(_0x911d('0x10'));var hardwareService=require(_0x911d('0x11'));var logger=require('../../config/logger')(_0x911d('0x12'));var utils=require('../../config/utils');var config=require(_0x911d('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x911d('0x14'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4b0247,_0x15ab4b){_0x15ab4b=_0x15ab4b||0xcc;return function(_0xbc59d6){if(_0xbc59d6){return _0x4b0247['sendStatus'](_0x15ab4b);}return _0x4b0247['status'](_0x15ab4b)[_0x911d('0x15')]();};}function respondWithResult(_0x1621e2,_0xf20932){_0xf20932=_0xf20932||0xc8;return function(_0x106b87){if(_0x106b87){return _0x1621e2[_0x911d('0x16')](_0xf20932)[_0x911d('0x17')](_0x106b87);}};}function respondWithFilteredResult(_0xb60915,_0x142ba5){return function(_0x20278f){if(_0x20278f){var _0x31f08d=typeof _0x142ba5['offset']===_0x911d('0x18')&&typeof _0x142ba5['limit']===_0x911d('0x18');var _0x366226=_0x20278f[_0x911d('0x19')];var _0x538b62=_0x31f08d?0x0:_0x142ba5[_0x911d('0x1a')];var _0x4e81d8=_0x31f08d?_0x20278f[_0x911d('0x19')]:_0x142ba5['offset']+_0x142ba5[_0x911d('0x1b')];var _0x1c526b;if(_0x4e81d8>=_0x366226){_0x4e81d8=_0x366226;_0x1c526b=0xc8;}else{_0x1c526b=0xce;}_0xb60915['status'](_0x1c526b);return _0xb60915[_0x911d('0x1c')](_0x911d('0x1d'),_0x538b62+'-'+_0x4e81d8+'/'+_0x366226)[_0x911d('0x17')](_0x20278f);}return null;};}function patchUpdates(_0x1a08b7){return function(_0x528094){try{jsonpatch[_0x911d('0x1e')](_0x528094,_0x1a08b7,!![]);}catch(_0x12ef33){return BPromise[_0x911d('0x1f')](_0x12ef33);}return _0x528094[_0x911d('0x20')]();};}function saveUpdates(_0x4eda01,_0x195974){return function(_0x4042c3){if(_0x4042c3){return _0x4042c3[_0x911d('0x21')](_0x4eda01)['then'](function(_0x328073){return _0x328073;});}return null;};}function removeEntity(_0x4fb47f,_0x1eee1b){return function(_0x634422){if(_0x634422){return _0x634422['destroy']()[_0x911d('0x22')](function(){_0x4fb47f[_0x911d('0x16')](0xcc)[_0x911d('0x15')]();});}};}function handleEntityNotFound(_0x68110b,_0x472010){return function(_0x49e6e5){if(!_0x49e6e5){_0x68110b[_0x911d('0x23')](0x194);}return _0x49e6e5;};}function handleError(_0x434da0,_0x830c71){_0x830c71=_0x830c71||0x1f4;return function(_0x35edcf){logger[_0x911d('0x24')](_0x35edcf[_0x911d('0x25')]);if(_0x35edcf['name']){delete _0x35edcf[_0x911d('0x26')];}_0x434da0['status'](_0x830c71)['send'](_0x35edcf);};}exports[_0x911d('0x27')]=function(_0x35c8e6,_0x280bc7){var _0x19df00={},_0x59b86a={},_0x157738={'count':0x0,'rows':[]};var _0x128f3c=_['map'](db['VtigerAccount'][_0x911d('0x28')],function(_0x131187){return{'name':_0x131187[_0x911d('0x29')],'type':_0x131187[_0x911d('0x2a')]['key']};});_0x59b86a[_0x911d('0x2b')]=_[_0x911d('0x2c')](_0x128f3c,_0x911d('0x26'));_0x59b86a[_0x911d('0x2d')]=_['keys'](_0x35c8e6[_0x911d('0x2d')]);_0x59b86a[_0x911d('0x2e')]=_[_0x911d('0x2f')](_0x59b86a[_0x911d('0x2b')],_0x59b86a[_0x911d('0x2d')]);_0x19df00[_0x911d('0x30')]=_[_0x911d('0x2f')](_0x59b86a[_0x911d('0x2b')],qs[_0x911d('0x31')](_0x35c8e6[_0x911d('0x2d')][_0x911d('0x31')]));_0x19df00['attributes']=_0x19df00[_0x911d('0x30')][_0x911d('0x32')]?_0x19df00[_0x911d('0x30')]:_0x59b86a[_0x911d('0x2b')];if(!_0x35c8e6[_0x911d('0x2d')]['hasOwnProperty']('nolimit')){_0x19df00[_0x911d('0x1b')]=qs[_0x911d('0x1b')](_0x35c8e6[_0x911d('0x2d')][_0x911d('0x1b')]);_0x19df00[_0x911d('0x1a')]=qs['offset'](_0x35c8e6[_0x911d('0x2d')][_0x911d('0x1a')]);}_0x19df00[_0x911d('0x33')]=qs[_0x911d('0x34')](_0x35c8e6[_0x911d('0x2d')][_0x911d('0x34')]);_0x19df00['where']=qs[_0x911d('0x2e')](_['pick'](_0x35c8e6[_0x911d('0x2d')],_0x59b86a[_0x911d('0x2e')]),_0x128f3c);if(_0x35c8e6[_0x911d('0x2d')]['filter']){_0x19df00[_0x911d('0x35')]=_[_0x911d('0x36')](_0x19df00[_0x911d('0x35')],{'$or':_['map'](_0x128f3c,function(_0x281cf7){if(_0x281cf7[_0x911d('0x2a')]!=='VIRTUAL'){var _0x2a52b1={};_0x2a52b1[_0x281cf7[_0x911d('0x26')]]={'$like':'%'+_0x35c8e6['query']['filter']+'%'};return _0x2a52b1;}})});}_0x19df00=_[_0x911d('0x36')]({},_0x19df00,_0x35c8e6[_0x911d('0x37')]);var _0x53ca45={'where':_0x19df00['where']};return db[_0x911d('0x38')][_0x911d('0x19')](_0x53ca45)[_0x911d('0x22')](function(_0x1f3db0){_0x157738[_0x911d('0x19')]=_0x1f3db0;if(_0x35c8e6[_0x911d('0x2d')][_0x911d('0x39')]){_0x19df00[_0x911d('0x3a')]=[{'all':!![]}];}return db[_0x911d('0x38')][_0x911d('0x3b')](_0x19df00);})['then'](function(_0x3afb2f){_0x157738[_0x911d('0x3c')]=_0x3afb2f;return _0x157738;})[_0x911d('0x22')](respondWithFilteredResult(_0x280bc7,_0x19df00))[_0x911d('0x3d')](handleError(_0x280bc7,null));};exports[_0x911d('0x3e')]=function(_0x4ecd77,_0xd22f64){var _0xb33b81={'raw':![],'where':{'id':_0x4ecd77[_0x911d('0x3f')]['id']}},_0x2dfbb6={};_0x2dfbb6['model']=_[_0x911d('0x40')](db[_0x911d('0x38')]['rawAttributes']);_0x2dfbb6[_0x911d('0x2d')]=_[_0x911d('0x40')](_0x4ecd77['query']);_0x2dfbb6[_0x911d('0x2e')]=_[_0x911d('0x2f')](_0x2dfbb6[_0x911d('0x2b')],_0x2dfbb6[_0x911d('0x2d')]);_0xb33b81[_0x911d('0x30')]=_['intersection'](_0x2dfbb6['model'],qs[_0x911d('0x31')](_0x4ecd77[_0x911d('0x2d')][_0x911d('0x31')]));_0xb33b81[_0x911d('0x30')]=_0xb33b81[_0x911d('0x30')][_0x911d('0x32')]?_0xb33b81[_0x911d('0x30')]:_0x2dfbb6['model'];if(_0x4ecd77['query'][_0x911d('0x39')]){_0xb33b81[_0x911d('0x3a')]=[{'all':!![]}];}_0xb33b81=_[_0x911d('0x36')]({},_0xb33b81,_0x4ecd77['options']);return db['VtigerAccount'][_0x911d('0x41')](_0xb33b81)[_0x911d('0x22')](handleEntityNotFound(_0xd22f64,null))['then'](respondWithResult(_0xd22f64,null))['catch'](handleError(_0xd22f64,null));};exports[_0x911d('0x42')]=function(_0x371078,_0xd3bd1e){return db[_0x911d('0x38')][_0x911d('0x42')](_0x371078[_0x911d('0x43')],{})[_0x911d('0x22')](respondWithResult(_0xd3bd1e,0xc9))[_0x911d('0x3d')](handleError(_0xd3bd1e,null));};exports[_0x911d('0x21')]=function(_0x1465c3,_0xb2160b){if(_0x1465c3[_0x911d('0x43')]['id']){delete _0x1465c3[_0x911d('0x43')]['id'];}return db['VtigerAccount'][_0x911d('0x41')]({'where':{'id':_0x1465c3[_0x911d('0x3f')]['id']}})[_0x911d('0x22')](handleEntityNotFound(_0xb2160b,null))[_0x911d('0x22')](saveUpdates(_0x1465c3['body'],null))[_0x911d('0x22')](respondWithResult(_0xb2160b,null))[_0x911d('0x3d')](handleError(_0xb2160b,null));};exports['destroy']=function(_0x14e82e,_0x3f732a){return db[_0x911d('0x38')][_0x911d('0x41')]({'where':{'id':_0x14e82e[_0x911d('0x3f')]['id']}})[_0x911d('0x22')](handleEntityNotFound(_0x3f732a,null))['then'](removeEntity(_0x3f732a,null))['catch'](handleError(_0x3f732a,null));};exports['getConfigurations']=function(_0x2f26c4,_0xa35563,_0x498c47){var _0x4c88ca={};var _0x4b9065={};var _0x3bca00;var _0x2418c9;return db[_0x911d('0x38')]['findOne']({'where':{'id':_0x2f26c4[_0x911d('0x3f')]['id']}})[_0x911d('0x22')](handleEntityNotFound(_0xa35563,null))[_0x911d('0x22')](function(_0x5b684c){if(_0x5b684c){_0x3bca00=_0x5b684c;_0x4b9065[_0x911d('0x2b')]=_[_0x911d('0x40')](db[_0x911d('0x44')]['rawAttributes']);_0x4b9065['query']=_['keys'](_0x2f26c4[_0x911d('0x2d')]);_0x4b9065['filters']=_[_0x911d('0x2f')](_0x4b9065[_0x911d('0x2b')],_0x4b9065[_0x911d('0x2d')]);_0x4c88ca[_0x911d('0x30')]=_['intersection'](_0x4b9065[_0x911d('0x2b')],qs['fields'](_0x2f26c4[_0x911d('0x2d')][_0x911d('0x31')]));_0x4c88ca['attributes']=_0x4c88ca[_0x911d('0x30')][_0x911d('0x32')]?_0x4c88ca[_0x911d('0x30')]:_0x4b9065[_0x911d('0x2b')];_0x4c88ca['order']=qs[_0x911d('0x34')](_0x2f26c4[_0x911d('0x2d')][_0x911d('0x34')]);_0x4c88ca[_0x911d('0x35')]=qs['filters'](_[_0x911d('0x45')](_0x2f26c4[_0x911d('0x2d')],_0x4b9065[_0x911d('0x2e')]));if(_0x2f26c4[_0x911d('0x2d')][_0x911d('0x46')]){_0x4c88ca[_0x911d('0x35')]=_[_0x911d('0x36')](_0x4c88ca[_0x911d('0x35')],{'$or':_[_0x911d('0x2c')](_0x4c88ca[_0x911d('0x30')],function(_0x3e8c18){var _0x3a3afd={};_0x3a3afd[_0x3e8c18]={'$like':'%'+_0x2f26c4[_0x911d('0x2d')][_0x911d('0x46')]+'%'};return _0x3a3afd;})});}_0x4c88ca=_['merge']({},_0x4c88ca,_0x2f26c4[_0x911d('0x37')]);return _0x3bca00[_0x911d('0x47')](_0x4c88ca);}})[_0x911d('0x22')](function(_0x32f268){if(_0x32f268){_0x2418c9=_0x32f268[_0x911d('0x32')];if(!_0x2f26c4[_0x911d('0x2d')][_0x911d('0x48')](_0x911d('0x49'))){_0x4c88ca[_0x911d('0x1b')]=qs['limit'](_0x2f26c4[_0x911d('0x2d')][_0x911d('0x1b')]);_0x4c88ca[_0x911d('0x1a')]=qs['offset'](_0x2f26c4['query'][_0x911d('0x1a')]);}return _0x3bca00['getConfigurations'](_0x4c88ca);}})[_0x911d('0x22')](function(_0x268e9c){if(_0x268e9c){return _0x268e9c?{'count':_0x2418c9,'rows':_0x268e9c}:null;}})['then'](respondWithResult(_0xa35563,null))[_0x911d('0x3d')](handleError(_0xa35563,null));};exports['addConfiguration']=function(_0x5d5159,_0xe81f4f,_0x4dfff7){if(_0x5d5159[_0x911d('0x43')]['id']){delete _0x5d5159['body']['id'];}return db[_0x911d('0x38')]['findOne']({'where':{'id':_0x5d5159[_0x911d('0x3f')]['id']}})[_0x911d('0x22')](handleEntityNotFound(_0xe81f4f,null))['then'](function(_0x202625){if(_0x202625){_0x5d5159['body'][_0x911d('0x4a')]=_0x202625['id'];_0x5d5159[_0x911d('0x43')][_0x911d('0x4b')]=integrations[_0x911d('0x4c')](_0x5d5159[_0x911d('0x43')][_0x911d('0x4d')],_0x5d5159[_0x911d('0x43')]['type']);_0x5d5159[_0x911d('0x43')]['Descriptions']=integrations[_0x911d('0x4e')](_0x5d5159[_0x911d('0x43')][_0x911d('0x4d')],_0x5d5159['body'][_0x911d('0x2a')]);return db[_0x911d('0x44')][_0x911d('0x42')](_0x5d5159[_0x911d('0x43')],{'include':[{'model':db['VtigerField'],'as':'Subjects'},{'model':db[_0x911d('0x4f')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0xe81f4f,null))['catch'](handleError(_0xe81f4f,null));};var md5=require('md5');exports[_0x911d('0x50')]=function(_0x225f18,_0x114fe3,_0x4b1a0e){var _0x5f0ed5=null;var _0x4a0ee0=null;var _0x3472fb=null;var _0xec7fca=null;var _0x168598='';return db[_0x911d('0x38')]['findOne']({'where':{'id':_0x225f18[_0x911d('0x3f')]['id']},'attributes':['id','name',_0x911d('0x51'),_0x911d('0x52'),_0x911d('0x53'),_0x911d('0x54'),_0x911d('0x55'),_0x911d('0x56')]})[_0x911d('0x22')](handleEntityNotFound(_0x114fe3,null))[_0x911d('0x22')](function(_0x55ca99){if(_0x55ca99){_0x5f0ed5=_0x55ca99['username'];_0x4a0ee0=_0x55ca99[_0x911d('0x56')];_0x3472fb=_0x55ca99[_0x911d('0x53')];_0x168598=_0x55ca99[_0x911d('0x54')];var _0x2a60c9=_0x168598['slice'](-0x1);if(_0x2a60c9==='/'){_0x168598=_0x168598['substring'](0x0,_0x168598[_0x911d('0x57')](_0x2a60c9));}_0xec7fca=util[_0x911d('0x58')]('%s/webservice.php',_0x168598);var _0xc2663f={'method':_0x911d('0x59'),'uri':_0xec7fca,'qs':{'operation':_0x911d('0x5a'),'username':_0x55ca99[_0x911d('0x51')]},'json':!![]};return rp(_0xc2663f);}})[_0x911d('0x22')](function(_0x2b47e6){if(_0x2b47e6[_0x911d('0x5b')]){var _0x1b59df={'method':_0x911d('0x5c'),'uri':_0xec7fca,'form':{'operation':_0x911d('0x5d'),'username':_0x5f0ed5,'accessKey':md5(_0x2b47e6[_0x911d('0x5e')][_0x911d('0x5f')]+_0x4a0ee0)},'json':!![]};return rp(_0x1b59df);}})['then'](function(_0x2917e7){if(_0x2917e7['success']){var _0x3521cd={'method':_0x911d('0x59'),'uri':_0xec7fca,'qs':{'operation':_0x911d('0x60'),'username':_0x5f0ed5,'sessionName':_0x2917e7[_0x911d('0x5e')]['sessionName'],'elementType':_0x3472fb},'json':!![]};return rp(_0x3521cd);}})[_0x911d('0x22')](function(_0x1f4cc2){if(_0x1f4cc2[_0x911d('0x5b')]){var _0x25cdde=[_0x911d('0x61'),_0x911d('0x62'),_0x911d('0x63')];_[_0x911d('0x64')](_0x1f4cc2[_0x911d('0x5e')]['fields'],function(_0xa28ae2){return _0x25cdde[_0x911d('0x65')](_0xa28ae2[_0x911d('0x2a')][_0x911d('0x26')]);});_[_0x911d('0x64')](_0x1f4cc2[_0x911d('0x5e')][_0x911d('0x31')],function(_0xd74ade){return _0xd74ade[_0x911d('0x66')]===_0x911d('0x67');});return{'count':_0x1f4cc2[_0x911d('0x5e')][_0x911d('0x31')][_0x911d('0x32')],'rows':_[_0x911d('0x2c')](_0x1f4cc2[_0x911d('0x5e')][_0x911d('0x31')],function(_0x585bdb){return{'id':_0x585bdb['name'],'name':_0x585bdb['label'],'custom':_[_0x911d('0x68')](_0x585bdb[_0x911d('0x26')],_0x911d('0x69'))?!![]:![],'options':_0x585bdb[_0x911d('0x2a')]['name']===_0x911d('0x6a')&&_0x585bdb[_0x911d('0x2a')][_0x911d('0x6b')]['length']>0x0?_['map'](_0x585bdb['type']['picklistValues'],function(_0x5b27ed){return{'name':_0x5b27ed[_0x911d('0x6c')],'value':_0x5b27ed[_0x911d('0x6d')]};}):[]};})};}})['then'](respondWithResult(_0x114fe3,null))[_0x911d('0x3d')](function(_0x3b5e9d){console['log'](_0x911d('0x6e')+_0x3b5e9d);var _0x5e9654=_0x225f18[_0x911d('0x2d')]['test']?0x1f4:_0x3b5e9d[_0x911d('0x6f')]||0x1f4;logger[_0x911d('0x24')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x5e9654,JSON[_0x911d('0x70')](_0x3b5e9d));delete _0x3b5e9d[_0x911d('0x26')];if(_0x5e9654===0x191){_0x5e9654=0x190;}_0x114fe3[_0x911d('0x16')](_0x5e9654)[_0x911d('0x71')](_0x225f18['query'][_0x911d('0x72')]?{'message':'Wrong\x20credentials','statusCode':_0x3b5e9d['statusCode']}:_0x3b5e9d);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 3101b0e..85585b8 100644 --- a/server/api/intVtigerAccount/intVtigerAccount.model.js +++ b/server/api/intVtigerAccount/intVtigerAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x49b9=['int_vtiger_accounts','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','VtigerAccount'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0x49b9,0xaa));var _0x949b=function(_0x318ee1,_0x5afa50){_0x318ee1=_0x318ee1-0x0;var _0x5d15d3=_0x49b9[_0x318ee1];return _0x5d15d3;};'use strict';var _=require('lodash');var util=require(_0x949b('0x0'));var logger=require(_0x949b('0x1'))(_0x949b('0x2'));var moment=require('moment');var BPromise=require(_0x949b('0x3'));var rp=require(_0x949b('0x4'));var fs=require('fs');var path=require(_0x949b('0x5'));var rimraf=require(_0x949b('0x6'));var config=require(_0x949b('0x7'));var attributes=require(_0x949b('0x8'));var integrations=require(_0x949b('0x9'));module[_0x949b('0xa')]=function(_0x2259c5,_0xdf02c3){return _0x2259c5['define'](_0x949b('0xb'),attributes,{'tableName':_0x949b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x21f2=['moment','request-promise','path','rimraf','VtigerAccount','int_vtiger_accounts','util','../../config/logger','api'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x21f2,0x102));var _0x221f=function(_0x48f188,_0x1bf3cf){_0x48f188=_0x48f188-0x0;var _0x28eddb=_0x21f2[_0x48f188];return _0x28eddb;};'use strict';var _=require('lodash');var util=require(_0x221f('0x0'));var logger=require(_0x221f('0x1'))(_0x221f('0x2'));var moment=require(_0x221f('0x3'));var BPromise=require('bluebird');var rp=require(_0x221f('0x4'));var fs=require('fs');var path=require(_0x221f('0x5'));var rimraf=require(_0x221f('0x6'));var config=require('../../config/environment');var attributes=require('./intVtigerAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x12ee5f,_0xbdb8d2){return _0x12ee5f['define'](_0x221f('0x7'),attributes,{'tableName':_0x221f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 90cd718..5617bca 100644 --- a/server/api/intVtigerAccount/intVtigerAccount.rpc.js +++ b/server/api/intVtigerAccount/intVtigerAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6b20=['../../config/environment','jayson/promise','client','http','request','VtigerAccount,\x20%s,\x20%s','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','limit','map','attributes','include','model','then','debug','stringify','catch','ShowVtigerAccount','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0x6b20,0xd1));var _0x06b2=function(_0x2ad789,_0x6c7ae5){_0x2ad789=_0x2ad789-0x0;var _0x3c8e1e=_0x6b20[_0x2ad789];return _0x3c8e1e;};'use strict';var _=require(_0x06b2('0x0'));var util=require(_0x06b2('0x1'));var moment=require('moment');var BPromise=require(_0x06b2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x06b2('0x3'));var db=require(_0x06b2('0x4'))['db'];var utils=require(_0x06b2('0x5'));var logger=require('../../config/logger')(_0x06b2('0x6'));var config=require(_0x06b2('0x7'));var jayson=require(_0x06b2('0x8'));var client=jayson[_0x06b2('0x9')][_0x06b2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37b825,_0x26a325,_0x4e6d3b){return new BPromise(function(_0x21cd31,_0x1828e4){return client[_0x06b2('0xb')](_0x37b825,_0x4e6d3b)['then'](function(_0x37ace0){logger['info'](_0x06b2('0xc'),_0x26a325,'request\x20sent');logger['debug'](_0x06b2('0xd'),_0x26a325,_0x06b2('0xe'),JSON['stringify'](_0x37ace0));if(_0x37ace0[_0x06b2('0xf')]){if(_0x37ace0[_0x06b2('0xf')][_0x06b2('0x10')]===0x1f4){logger[_0x06b2('0xf')](_0x06b2('0xc'),_0x26a325,_0x37ace0[_0x06b2('0xf')][_0x06b2('0x11')]);return _0x1828e4(_0x37ace0[_0x06b2('0xf')][_0x06b2('0x11')]);}logger[_0x06b2('0xf')](_0x06b2('0xc'),_0x26a325,_0x37ace0[_0x06b2('0xf')][_0x06b2('0x11')]);return _0x21cd31(_0x37ace0['error'][_0x06b2('0x11')]);}else{logger[_0x06b2('0x12')](_0x06b2('0xc'),_0x26a325,_0x06b2('0xe'));_0x21cd31(_0x37ace0[_0x06b2('0x13')][_0x06b2('0x11')]);}})['catch'](function(_0x17e69b){logger[_0x06b2('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x26a325,_0x17e69b);_0x1828e4(_0x17e69b);});});}exports[_0x06b2('0x14')]=function(_0x594b48){var _0x4c9cae=this;return new Promise(function(_0x192270,_0x1b4ab0){return db[_0x06b2('0x15')][_0x06b2('0x16')]({'raw':_0x594b48['options']?_0x594b48[_0x06b2('0x17')][_0x06b2('0x18')]===undefined?!![]:![]:!![],'where':_0x594b48[_0x06b2('0x17')]?_0x594b48[_0x06b2('0x17')][_0x06b2('0x19')]||null:null,'attributes':_0x594b48[_0x06b2('0x17')]?_0x594b48[_0x06b2('0x17')]['attributes']||null:null,'limit':_0x594b48[_0x06b2('0x17')]?_0x594b48[_0x06b2('0x17')][_0x06b2('0x1a')]||null:null,'include':_0x594b48[_0x06b2('0x17')]?_0x594b48['options']['include']?_[_0x06b2('0x1b')](_0x594b48[_0x06b2('0x17')]['include'],function(_0x39659f){return{'model':db[_0x39659f['model']],'as':_0x39659f['as'],'attributes':_0x39659f[_0x06b2('0x1c')],'include':_0x39659f[_0x06b2('0x1d')]?_[_0x06b2('0x1b')](_0x39659f['include'],function(_0x4382ce){return{'model':db[_0x4382ce[_0x06b2('0x1e')]],'as':_0x4382ce['as'],'attributes':_0x4382ce[_0x06b2('0x1c')],'include':_0x4382ce[_0x06b2('0x1d')]?_[_0x06b2('0x1b')](_0x4382ce['include'],function(_0xbb00ea){return{'model':db[_0xbb00ea[_0x06b2('0x1e')]],'as':_0xbb00ea['as'],'attributes':_0xbb00ea[_0x06b2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x06b2('0x1f')](function(_0x1976ac){logger[_0x06b2('0x12')]('GetVtigerAccount',_0x594b48);logger[_0x06b2('0x20')](_0x06b2('0x14'),_0x594b48,JSON[_0x06b2('0x21')](_0x1976ac));_0x192270(_0x1976ac);})[_0x06b2('0x22')](function(_0x1f02d8){logger[_0x06b2('0xf')](_0x06b2('0x14'),_0x1f02d8['message'],_0x594b48);_0x1b4ab0(_0x4c9cae[_0x06b2('0xf')](0x1f4,_0x1f02d8[_0x06b2('0x11')]));});});};exports[_0x06b2('0x23')]=function(_0x15a78b){var _0x1cc725=this;return new Promise(function(_0x37d391,_0x401551){return db[_0x06b2('0x15')]['find']({'raw':_0x15a78b[_0x06b2('0x17')]?_0x15a78b[_0x06b2('0x17')][_0x06b2('0x18')]===undefined?!![]:![]:!![],'where':_0x15a78b[_0x06b2('0x17')]?_0x15a78b[_0x06b2('0x17')][_0x06b2('0x19')]||null:null,'attributes':_0x15a78b[_0x06b2('0x17')]?_0x15a78b['options']['attributes']||null:null,'include':_0x15a78b[_0x06b2('0x17')]?_0x15a78b[_0x06b2('0x17')][_0x06b2('0x1d')]?_['map'](_0x15a78b[_0x06b2('0x17')][_0x06b2('0x1d')],function(_0x37bfb5){return{'model':db[_0x37bfb5[_0x06b2('0x1e')]],'as':_0x37bfb5['as'],'attributes':_0x37bfb5[_0x06b2('0x1c')],'include':_0x37bfb5[_0x06b2('0x1d')]?_['map'](_0x37bfb5[_0x06b2('0x1d')],function(_0x1e66f1){return{'model':db[_0x1e66f1[_0x06b2('0x1e')]],'as':_0x1e66f1['as'],'attributes':_0x1e66f1['attributes'],'include':_0x1e66f1[_0x06b2('0x1d')]?_[_0x06b2('0x1b')](_0x1e66f1['include'],function(_0x45ea67){return{'model':db[_0x45ea67[_0x06b2('0x1e')]],'as':_0x45ea67['as'],'attributes':_0x45ea67[_0x06b2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x06b2('0x1f')](function(_0x2e49df){logger[_0x06b2('0x12')](_0x06b2('0x23'),_0x15a78b);logger[_0x06b2('0x20')](_0x06b2('0x23'),_0x15a78b,JSON[_0x06b2('0x21')](_0x2e49df));_0x37d391(_0x2e49df);})[_0x06b2('0x22')](function(_0x1cc7b6){logger['error'](_0x06b2('0x23'),_0x1cc7b6['message'],_0x15a78b);_0x401551(_0x1cc725['error'](0x1f4,_0x1cc7b6[_0x06b2('0x11')]));});});}; \ No newline at end of file +var _0xe511=['find','attributes','ShowVtigerAccount','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVtigerAccount','VtigerAccount','options','raw','where','include','map','model','then'];(function(_0x1f0bba,_0x430c51){var _0x258c06=function(_0x4b905e){while(--_0x4b905e){_0x1f0bba['push'](_0x1f0bba['shift']());}};_0x258c06(++_0x430c51);}(_0xe511,0x16f));var _0x1e51=function(_0xddfcda,_0x4f654f){_0xddfcda=_0xddfcda-0x0;var _0x2e8021=_0xe511[_0xddfcda];return _0x2e8021;};'use strict';var _=require(_0x1e51('0x0'));var util=require(_0x1e51('0x1'));var moment=require('moment');var BPromise=require(_0x1e51('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1e51('0x3'));var db=require(_0x1e51('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1e51('0x5'))(_0x1e51('0x6'));var config=require(_0x1e51('0x7'));var jayson=require(_0x1e51('0x8'));var client=jayson['client'][_0x1e51('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21ed6b,_0x5c4590,_0x4fa2ba){return new BPromise(function(_0x394ad8,_0x133021){return client['request'](_0x21ed6b,_0x4fa2ba)['then'](function(_0x658941){logger[_0x1e51('0xa')](_0x1e51('0xb'),_0x5c4590,_0x1e51('0xc'));logger[_0x1e51('0xd')](_0x1e51('0xe'),_0x5c4590,'request\x20sent',JSON[_0x1e51('0xf')](_0x658941));if(_0x658941[_0x1e51('0x10')]){if(_0x658941[_0x1e51('0x10')][_0x1e51('0x11')]===0x1f4){logger[_0x1e51('0x10')](_0x1e51('0xb'),_0x5c4590,_0x658941['error'][_0x1e51('0x12')]);return _0x133021(_0x658941[_0x1e51('0x10')][_0x1e51('0x12')]);}logger[_0x1e51('0x10')](_0x1e51('0xb'),_0x5c4590,_0x658941[_0x1e51('0x10')][_0x1e51('0x12')]);return _0x394ad8(_0x658941[_0x1e51('0x10')][_0x1e51('0x12')]);}else{logger[_0x1e51('0xa')]('VtigerAccount,\x20%s,\x20%s',_0x5c4590,_0x1e51('0xc'));_0x394ad8(_0x658941[_0x1e51('0x13')][_0x1e51('0x12')]);}})['catch'](function(_0xa3b410){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x5c4590,_0xa3b410);_0x133021(_0xa3b410);});});}exports[_0x1e51('0x14')]=function(_0x27dcad){var _0x40ae4c=this;return new Promise(function(_0x4785a5,_0x4d1aae){return db[_0x1e51('0x15')]['findAll']({'raw':_0x27dcad[_0x1e51('0x16')]?_0x27dcad['options'][_0x1e51('0x17')]===undefined?!![]:![]:!![],'where':_0x27dcad[_0x1e51('0x16')]?_0x27dcad[_0x1e51('0x16')][_0x1e51('0x18')]||null:null,'attributes':_0x27dcad['options']?_0x27dcad['options']['attributes']||null:null,'limit':_0x27dcad['options']?_0x27dcad[_0x1e51('0x16')]['limit']||null:null,'include':_0x27dcad[_0x1e51('0x16')]?_0x27dcad[_0x1e51('0x16')][_0x1e51('0x19')]?_[_0x1e51('0x1a')](_0x27dcad[_0x1e51('0x16')][_0x1e51('0x19')],function(_0x270adf){return{'model':db[_0x270adf[_0x1e51('0x1b')]],'as':_0x270adf['as'],'attributes':_0x270adf['attributes'],'include':_0x270adf['include']?_[_0x1e51('0x1a')](_0x270adf[_0x1e51('0x19')],function(_0x2e42b1){return{'model':db[_0x2e42b1[_0x1e51('0x1b')]],'as':_0x2e42b1['as'],'attributes':_0x2e42b1['attributes'],'include':_0x2e42b1['include']?_['map'](_0x2e42b1[_0x1e51('0x19')],function(_0x2a1561){return{'model':db[_0x2a1561[_0x1e51('0x1b')]],'as':_0x2a1561['as'],'attributes':_0x2a1561['attributes']};}):[]};}):[]};}):[]:[]})[_0x1e51('0x1c')](function(_0x49c507){logger['info'](_0x1e51('0x14'),_0x27dcad);logger['debug'](_0x1e51('0x14'),_0x27dcad,JSON[_0x1e51('0xf')](_0x49c507));_0x4785a5(_0x49c507);})['catch'](function(_0x3e6ef2){logger[_0x1e51('0x10')](_0x1e51('0x14'),_0x3e6ef2[_0x1e51('0x12')],_0x27dcad);_0x4d1aae(_0x40ae4c['error'](0x1f4,_0x3e6ef2['message']));});});};exports['ShowVtigerAccount']=function(_0x20eb9b){var _0x288b50=this;return new Promise(function(_0x1ba84a,_0x36dabe){return db[_0x1e51('0x15')][_0x1e51('0x1d')]({'raw':_0x20eb9b[_0x1e51('0x16')]?_0x20eb9b[_0x1e51('0x16')][_0x1e51('0x17')]===undefined?!![]:![]:!![],'where':_0x20eb9b[_0x1e51('0x16')]?_0x20eb9b[_0x1e51('0x16')]['where']||null:null,'attributes':_0x20eb9b[_0x1e51('0x16')]?_0x20eb9b[_0x1e51('0x16')][_0x1e51('0x1e')]||null:null,'include':_0x20eb9b[_0x1e51('0x16')]?_0x20eb9b[_0x1e51('0x16')]['include']?_[_0x1e51('0x1a')](_0x20eb9b['options'][_0x1e51('0x19')],function(_0x3fb57e){return{'model':db[_0x3fb57e[_0x1e51('0x1b')]],'as':_0x3fb57e['as'],'attributes':_0x3fb57e['attributes'],'include':_0x3fb57e[_0x1e51('0x19')]?_['map'](_0x3fb57e[_0x1e51('0x19')],function(_0x4e0187){return{'model':db[_0x4e0187['model']],'as':_0x4e0187['as'],'attributes':_0x4e0187[_0x1e51('0x1e')],'include':_0x4e0187[_0x1e51('0x19')]?_[_0x1e51('0x1a')](_0x4e0187['include'],function(_0x42ac30){return{'model':db[_0x42ac30['model']],'as':_0x42ac30['as'],'attributes':_0x42ac30[_0x1e51('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1e51('0x1c')](function(_0x5760ba){logger[_0x1e51('0xa')](_0x1e51('0x1f'),_0x20eb9b);logger[_0x1e51('0xd')](_0x1e51('0x1f'),_0x20eb9b,JSON[_0x1e51('0xf')](_0x5760ba));_0x1ba84a(_0x5760ba);})[_0x1e51('0x20')](function(_0x5c57a6){logger['error'](_0x1e51('0x1f'),_0x5c57a6['message'],_0x20eb9b);_0x36dabe(_0x288b50[_0x1e51('0x10')](0x1f4,_0x5c57a6[_0x1e51('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 42d3a40..df695d0 100644 --- a/server/api/intVtigerConfiguration/index.js +++ b/server/api/intVtigerConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf36b=['connect-timeout','Router','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','post','put','update','delete','destroy','exports','util','path'];(function(_0x3e3fde,_0x418b27){var _0x6a2763=function(_0xc6a42a){while(--_0xc6a42a){_0x3e3fde['push'](_0x3e3fde['shift']());}};_0x6a2763(++_0x418b27);}(_0xf36b,0x132));var _0xbf36=function(_0x1d6224,_0x5575ed){_0x1d6224=_0x1d6224-0x0;var _0x19e0fc=_0xf36b[_0x1d6224];return _0x19e0fc;};'use strict';var multer=require('multer');var util=require(_0xbf36('0x0'));var path=require(_0xbf36('0x1'));var timeout=require(_0xbf36('0x2'));var express=require('express');var router=express[_0xbf36('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbf36('0x4'));var config=require(_0xbf36('0x5'));var controller=require(_0xbf36('0x6'));router[_0xbf36('0x7')]('/',auth['isAuthenticated'](),controller[_0xbf36('0x8')]);router['get'](_0xbf36('0x9'),auth[_0xbf36('0xa')](),controller[_0xbf36('0xb')]);router[_0xbf36('0x7')](_0xbf36('0xc'),auth['isAuthenticated'](),controller['getFields']);router[_0xbf36('0x7')](_0xbf36('0xd'),auth[_0xbf36('0xa')](),controller[_0xbf36('0xe')]);router['get'](_0xbf36('0xf'),auth[_0xbf36('0xa')](),controller['getDescriptions']);router[_0xbf36('0x10')]('/',auth[_0xbf36('0xa')](),controller['create']);router[_0xbf36('0x11')](_0xbf36('0x9'),auth[_0xbf36('0xa')](),controller[_0xbf36('0x12')]);router[_0xbf36('0x13')]('/:id',auth[_0xbf36('0xa')](),controller[_0xbf36('0x14')]);module[_0xbf36('0x15')]=router; \ No newline at end of file +var _0xa49d=['../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','put','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0xa49d,0xa7));var _0xda49=function(_0x535456,_0xe50e9b){_0x535456=_0x535456-0x0;var _0x578664=_0xa49d[_0x535456];return _0x578664;};'use strict';var multer=require(_0xda49('0x0'));var util=require(_0xda49('0x1'));var path=require(_0xda49('0x2'));var timeout=require(_0xda49('0x3'));var express=require(_0xda49('0x4'));var router=express[_0xda49('0x5')]();var fs_extra=require(_0xda49('0x6'));var auth=require(_0xda49('0x7'));var interaction=require(_0xda49('0x8'));var config=require(_0xda49('0x9'));var controller=require(_0xda49('0xa'));router['get']('/',auth[_0xda49('0xb')](),controller[_0xda49('0xc')]);router[_0xda49('0xd')](_0xda49('0xe'),auth[_0xda49('0xb')](),controller[_0xda49('0xf')]);router[_0xda49('0xd')](_0xda49('0x10'),auth[_0xda49('0xb')](),controller[_0xda49('0x11')]);router[_0xda49('0xd')]('/:id/subjects',auth[_0xda49('0xb')](),controller[_0xda49('0x12')]);router[_0xda49('0xd')](_0xda49('0x13'),auth[_0xda49('0xb')](),controller[_0xda49('0x14')]);router[_0xda49('0x15')]('/',auth[_0xda49('0xb')](),controller['create']);router[_0xda49('0x16')](_0xda49('0xe'),auth[_0xda49('0xb')](),controller['update']);router[_0xda49('0x17')](_0xda49('0xe'),auth[_0xda49('0xb')](),controller[_0xda49('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index b4455a6..b33821a 100644 --- a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js +++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x981a=['sequelize','STRING'];(function(_0x427d3a,_0x23724c){var _0xe5c521=function(_0x77b277){while(--_0x77b277){_0x427d3a['push'](_0x427d3a['shift']());}};_0xe5c521(++_0x23724c);}(_0x981a,0xb8));var _0xa981=function(_0x1b84a2,_0x19da32){_0x1b84a2=_0x1b84a2-0x0;var _0xfca251=_0x981a[_0x1b84a2];return _0xfca251;};'use strict';var Sequelize=require(_0xa981('0x0'));module['exports']={'name':{'type':Sequelize[_0xa981('0x1')]},'description':{'type':Sequelize[_0xa981('0x1')]}}; \ No newline at end of file +var _0xf3ab=['STRING','exports'];(function(_0x21def8,_0x412d49){var _0x1e0bc8=function(_0x1e91bd){while(--_0x1e91bd){_0x21def8['push'](_0x21def8['shift']());}};_0x1e0bc8(++_0x412d49);}(_0xf3ab,0x165));var _0xbf3a=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xf3ab[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require('sequelize');module[_0xbf3a('0x0')]={'name':{'type':Sequelize[_0xbf3a('0x1')]},'description':{'type':Sequelize[_0xbf3a('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 37ada73..ce73516 100644 --- a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js +++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x02c7=['index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VtigerConfiguration','includeAll','include','findAll','rows','params','find','create','body','catch','getFields','getSubjects','getDescriptions','findOne','VtigerField','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','stack','name','send'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0x02c7,0xcb));var _0x702c=function(_0x26cf71,_0x526a1f){_0x26cf71=_0x26cf71-0x0;var _0x2f6a2d=_0x02c7[_0x26cf71];return _0x2f6a2d;};'use strict';var emlformat=require(_0x702c('0x0'));var rimraf=require(_0x702c('0x1'));var zipdir=require(_0x702c('0x2'));var jsonpatch=require(_0x702c('0x3'));var rp=require('request-promise');var moment=require(_0x702c('0x4'));var BPromise=require(_0x702c('0x5'));var Mustache=require(_0x702c('0x6'));var util=require(_0x702c('0x7'));var path=require('path');var sox=require(_0x702c('0x8'));var csv=require(_0x702c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x702c('0xa'));var squel=require(_0x702c('0xb'));var crypto=require(_0x702c('0xc'));var jsforce=require(_0x702c('0xd'));var deskjs=require(_0x702c('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x702c('0xf'));var Redis=require(_0x702c('0x10'));var authService=require(_0x702c('0x11'));var qs=require(_0x702c('0x12'));var as=require(_0x702c('0x13'));var hardwareService=require(_0x702c('0x14'));var logger=require(_0x702c('0x15'))(_0x702c('0x16'));var utils=require(_0x702c('0x17'));var config=require(_0x702c('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x702c('0x19'))['db'];function respondWithStatusCode(_0x422bc1,_0x8cb558){_0x8cb558=_0x8cb558||0xcc;return function(_0x3f4f53){if(_0x3f4f53){return _0x422bc1[_0x702c('0x1a')](_0x8cb558);}return _0x422bc1[_0x702c('0x1b')](_0x8cb558)[_0x702c('0x1c')]();};}function respondWithResult(_0x3de182,_0x11504c){_0x11504c=_0x11504c||0xc8;return function(_0x424993){if(_0x424993){return _0x3de182['status'](_0x11504c)[_0x702c('0x1d')](_0x424993);}};}function respondWithFilteredResult(_0x330457,_0x6243bb){return function(_0x488d23){if(_0x488d23){var _0x3f0898=typeof _0x6243bb[_0x702c('0x1e')]===_0x702c('0x1f')&&typeof _0x6243bb[_0x702c('0x20')]===_0x702c('0x1f');var _0x53c81f=_0x488d23[_0x702c('0x21')];var _0x458e03=_0x3f0898?0x0:_0x6243bb[_0x702c('0x1e')];var _0x46cb04=_0x3f0898?_0x488d23[_0x702c('0x21')]:_0x6243bb[_0x702c('0x1e')]+_0x6243bb[_0x702c('0x20')];var _0x4ebf3a;if(_0x46cb04>=_0x53c81f){_0x46cb04=_0x53c81f;_0x4ebf3a=0xc8;}else{_0x4ebf3a=0xce;}_0x330457['status'](_0x4ebf3a);return _0x330457[_0x702c('0x22')]('Content-Range',_0x458e03+'-'+_0x46cb04+'/'+_0x53c81f)[_0x702c('0x1d')](_0x488d23);}return null;};}function patchUpdates(_0x5abce1){return function(_0x150efd){try{jsonpatch[_0x702c('0x23')](_0x150efd,_0x5abce1,!![]);}catch(_0x1f8ca6){return BPromise[_0x702c('0x24')](_0x1f8ca6);}return _0x150efd['save']();};}function saveUpdates(_0x47032e,_0x501f8f){return function(_0x39c6f6){if(_0x39c6f6){return _0x39c6f6[_0x702c('0x25')](_0x47032e)[_0x702c('0x26')](function(_0x50f670){return _0x50f670;});}return null;};}function removeEntity(_0x3db271,_0x47f42d){return function(_0x3f2981){if(_0x3f2981){return _0x3f2981[_0x702c('0x27')]()[_0x702c('0x26')](function(){_0x3db271[_0x702c('0x1b')](0xcc)[_0x702c('0x1c')]();});}};}function handleEntityNotFound(_0x2e3a04,_0x2fa67e){return function(_0x4719d8){if(!_0x4719d8){_0x2e3a04['sendStatus'](0x194);}return _0x4719d8;};}function handleError(_0x3f6ec9,_0x13a114){_0x13a114=_0x13a114||0x1f4;return function(_0x3efec5){logger['error'](_0x3efec5[_0x702c('0x28')]);if(_0x3efec5[_0x702c('0x29')]){delete _0x3efec5[_0x702c('0x29')];}_0x3f6ec9[_0x702c('0x1b')](_0x13a114)[_0x702c('0x2a')](_0x3efec5);};}exports[_0x702c('0x2b')]=function(_0x353f00,_0x345983){var _0xf83d52={},_0x344d4d={},_0x2b811c={'count':0x0,'rows':[]};var _0x3889d1=_[_0x702c('0x2c')](db['VtigerConfiguration'][_0x702c('0x2d')],function(_0x4f6cf4){return{'name':_0x4f6cf4[_0x702c('0x2e')],'type':_0x4f6cf4[_0x702c('0x2f')][_0x702c('0x30')]};});_0x344d4d[_0x702c('0x31')]=_[_0x702c('0x2c')](_0x3889d1,_0x702c('0x29'));_0x344d4d['query']=_[_0x702c('0x32')](_0x353f00[_0x702c('0x33')]);_0x344d4d[_0x702c('0x34')]=_['intersection'](_0x344d4d[_0x702c('0x31')],_0x344d4d[_0x702c('0x33')]);_0xf83d52['attributes']=_[_0x702c('0x35')](_0x344d4d['model'],qs['fields'](_0x353f00[_0x702c('0x33')][_0x702c('0x36')]));_0xf83d52[_0x702c('0x37')]=_0xf83d52[_0x702c('0x37')][_0x702c('0x38')]?_0xf83d52[_0x702c('0x37')]:_0x344d4d['model'];if(!_0x353f00['query'][_0x702c('0x39')](_0x702c('0x3a'))){_0xf83d52[_0x702c('0x20')]=qs[_0x702c('0x20')](_0x353f00['query'][_0x702c('0x20')]);_0xf83d52[_0x702c('0x1e')]=qs['offset'](_0x353f00[_0x702c('0x33')][_0x702c('0x1e')]);}_0xf83d52[_0x702c('0x3b')]=qs['sort'](_0x353f00[_0x702c('0x33')][_0x702c('0x3c')]);_0xf83d52[_0x702c('0x3d')]=qs[_0x702c('0x34')](_[_0x702c('0x3e')](_0x353f00[_0x702c('0x33')],_0x344d4d['filters']),_0x3889d1);if(_0x353f00[_0x702c('0x33')][_0x702c('0x3f')]){_0xf83d52[_0x702c('0x3d')]=_[_0x702c('0x40')](_0xf83d52[_0x702c('0x3d')],{'$or':_['map'](_0x3889d1,function(_0x33c495){if(_0x33c495[_0x702c('0x2f')]!==_0x702c('0x41')){var _0x10368c={};_0x10368c[_0x33c495[_0x702c('0x29')]]={'$like':'%'+_0x353f00[_0x702c('0x33')][_0x702c('0x3f')]+'%'};return _0x10368c;}})});}_0xf83d52=_['merge']({},_0xf83d52,_0x353f00[_0x702c('0x42')]);var _0x39d785={'where':_0xf83d52[_0x702c('0x3d')]};return db[_0x702c('0x43')]['count'](_0x39d785)[_0x702c('0x26')](function(_0x53976e){_0x2b811c[_0x702c('0x21')]=_0x53976e;if(_0x353f00[_0x702c('0x33')][_0x702c('0x44')]){_0xf83d52[_0x702c('0x45')]=[{'all':!![]}];}return db[_0x702c('0x43')][_0x702c('0x46')](_0xf83d52);})['then'](function(_0x4d9091){_0x2b811c[_0x702c('0x47')]=_0x4d9091;return _0x2b811c;})[_0x702c('0x26')](respondWithFilteredResult(_0x345983,_0xf83d52))['catch'](handleError(_0x345983,null));};exports['show']=function(_0x47486c,_0x582ef2){var _0x3c8a33={'raw':![],'where':{'id':_0x47486c[_0x702c('0x48')]['id']}},_0x104ecc={};_0x104ecc['model']=_[_0x702c('0x32')](db[_0x702c('0x43')][_0x702c('0x2d')]);_0x104ecc[_0x702c('0x33')]=_[_0x702c('0x32')](_0x47486c[_0x702c('0x33')]);_0x104ecc[_0x702c('0x34')]=_[_0x702c('0x35')](_0x104ecc[_0x702c('0x31')],_0x104ecc[_0x702c('0x33')]);_0x3c8a33[_0x702c('0x37')]=_[_0x702c('0x35')](_0x104ecc[_0x702c('0x31')],qs[_0x702c('0x36')](_0x47486c['query'][_0x702c('0x36')]));_0x3c8a33[_0x702c('0x37')]=_0x3c8a33[_0x702c('0x37')][_0x702c('0x38')]?_0x3c8a33['attributes']:_0x104ecc[_0x702c('0x31')];if(_0x47486c[_0x702c('0x33')][_0x702c('0x44')]){_0x3c8a33[_0x702c('0x45')]=[{'all':!![]}];}_0x3c8a33=_[_0x702c('0x40')]({},_0x3c8a33,_0x47486c[_0x702c('0x42')]);return db[_0x702c('0x43')][_0x702c('0x49')](_0x3c8a33)[_0x702c('0x26')](handleEntityNotFound(_0x582ef2,null))[_0x702c('0x26')](respondWithResult(_0x582ef2,null))['catch'](handleError(_0x582ef2,null));};exports[_0x702c('0x4a')]=function(_0x373558,_0x21e44f){return db[_0x702c('0x43')][_0x702c('0x4a')](_0x373558[_0x702c('0x4b')],{})[_0x702c('0x26')](respondWithResult(_0x21e44f,0xc9))['catch'](handleError(_0x21e44f,null));};exports[_0x702c('0x25')]=function(_0x31a83d,_0x71f6c2){if(_0x31a83d[_0x702c('0x4b')]['id']){delete _0x31a83d['body']['id'];}return db['VtigerConfiguration'][_0x702c('0x49')]({'where':{'id':_0x31a83d[_0x702c('0x48')]['id']}})[_0x702c('0x26')](handleEntityNotFound(_0x71f6c2,null))[_0x702c('0x26')](saveUpdates(_0x31a83d[_0x702c('0x4b')],null))['then'](respondWithResult(_0x71f6c2,null))[_0x702c('0x4c')](handleError(_0x71f6c2,null));};exports[_0x702c('0x27')]=function(_0x3e7f64,_0x3354cd){return db[_0x702c('0x43')][_0x702c('0x49')]({'where':{'id':_0x3e7f64['params']['id']}})[_0x702c('0x26')](handleEntityNotFound(_0x3354cd,null))[_0x702c('0x26')](removeEntity(_0x3354cd,null))[_0x702c('0x4c')](handleError(_0x3354cd,null));};exports['getFields']=function(_0x244af4,_0x1cdc76,_0x4b7278){var _0x3b9e07={};var _0x586884={};var _0x9fdd1a;var _0x4ad127;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x244af4[_0x702c('0x48')]['id']}})[_0x702c('0x26')](handleEntityNotFound(_0x1cdc76,null))[_0x702c('0x26')](function(_0x11d482){if(_0x11d482){_0x9fdd1a=_0x11d482;_0x586884['model']=_[_0x702c('0x32')](db['VtigerField'][_0x702c('0x2d')]);_0x586884[_0x702c('0x33')]=_[_0x702c('0x32')](_0x244af4['query']);_0x586884[_0x702c('0x34')]=_[_0x702c('0x35')](_0x586884[_0x702c('0x31')],_0x586884[_0x702c('0x33')]);_0x3b9e07[_0x702c('0x37')]=_[_0x702c('0x35')](_0x586884['model'],qs[_0x702c('0x36')](_0x244af4[_0x702c('0x33')][_0x702c('0x36')]));_0x3b9e07[_0x702c('0x37')]=_0x3b9e07[_0x702c('0x37')][_0x702c('0x38')]?_0x3b9e07[_0x702c('0x37')]:_0x586884[_0x702c('0x31')];_0x3b9e07[_0x702c('0x3b')]=qs[_0x702c('0x3c')](_0x244af4['query'][_0x702c('0x3c')]);_0x3b9e07[_0x702c('0x3d')]=qs[_0x702c('0x34')](_[_0x702c('0x3e')](_0x244af4['query'],_0x586884[_0x702c('0x34')]));if(_0x244af4[_0x702c('0x33')][_0x702c('0x3f')]){_0x3b9e07[_0x702c('0x3d')]=_[_0x702c('0x40')](_0x3b9e07[_0x702c('0x3d')],{'$or':_[_0x702c('0x2c')](_0x3b9e07[_0x702c('0x37')],function(_0xb8a85){var _0x1d3e25={};_0x1d3e25[_0xb8a85]={'$like':'%'+_0x244af4[_0x702c('0x33')][_0x702c('0x3f')]+'%'};return _0x1d3e25;})});}_0x3b9e07=_[_0x702c('0x40')]({},_0x3b9e07,_0x244af4['options']);return _0x9fdd1a['getFields'](_0x3b9e07);}})[_0x702c('0x26')](function(_0x4bd116){if(_0x4bd116){_0x4ad127=_0x4bd116[_0x702c('0x38')];if(!_0x244af4[_0x702c('0x33')][_0x702c('0x39')](_0x702c('0x3a'))){_0x3b9e07[_0x702c('0x20')]=qs[_0x702c('0x20')](_0x244af4['query'][_0x702c('0x20')]);_0x3b9e07[_0x702c('0x1e')]=qs[_0x702c('0x1e')](_0x244af4['query'][_0x702c('0x1e')]);}return _0x9fdd1a[_0x702c('0x4d')](_0x3b9e07);}})['then'](function(_0x44e743){if(_0x44e743){return _0x44e743?{'count':_0x4ad127,'rows':_0x44e743}:null;}})[_0x702c('0x26')](respondWithResult(_0x1cdc76,null))[_0x702c('0x4c')](handleError(_0x1cdc76,null));};exports[_0x702c('0x4e')]=function(_0x285caa,_0x8d39e7,_0x1eb8f2){var _0x19b4ff={};var _0x5b32a7={};var _0x592cfd;var _0x10decb;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x285caa['params']['id']}})['then'](handleEntityNotFound(_0x8d39e7,null))['then'](function(_0x2f161f){if(_0x2f161f){_0x592cfd=_0x2f161f;_0x5b32a7['model']=_['keys'](db['VtigerField'][_0x702c('0x2d')]);_0x5b32a7[_0x702c('0x33')]=_[_0x702c('0x32')](_0x285caa['query']);_0x5b32a7['filters']=_[_0x702c('0x35')](_0x5b32a7['model'],_0x5b32a7[_0x702c('0x33')]);_0x19b4ff['attributes']=_[_0x702c('0x35')](_0x5b32a7['model'],qs[_0x702c('0x36')](_0x285caa[_0x702c('0x33')][_0x702c('0x36')]));_0x19b4ff[_0x702c('0x37')]=_0x19b4ff[_0x702c('0x37')]['length']?_0x19b4ff[_0x702c('0x37')]:_0x5b32a7[_0x702c('0x31')];_0x19b4ff[_0x702c('0x3b')]=qs[_0x702c('0x3c')](_0x285caa[_0x702c('0x33')][_0x702c('0x3c')]);_0x19b4ff[_0x702c('0x3d')]=qs[_0x702c('0x34')](_['pick'](_0x285caa[_0x702c('0x33')],_0x5b32a7[_0x702c('0x34')]));if(_0x285caa[_0x702c('0x33')][_0x702c('0x3f')]){_0x19b4ff['where']=_[_0x702c('0x40')](_0x19b4ff['where'],{'$or':_[_0x702c('0x2c')](_0x19b4ff[_0x702c('0x37')],function(_0x4e169d){var _0x219213={};_0x219213[_0x4e169d]={'$like':'%'+_0x285caa[_0x702c('0x33')][_0x702c('0x3f')]+'%'};return _0x219213;})});}_0x19b4ff=_[_0x702c('0x40')]({},_0x19b4ff,_0x285caa[_0x702c('0x42')]);return _0x592cfd[_0x702c('0x4e')](_0x19b4ff);}})['then'](function(_0x129862){if(_0x129862){_0x10decb=_0x129862[_0x702c('0x38')];if(!_0x285caa['query'][_0x702c('0x39')](_0x702c('0x3a'))){_0x19b4ff[_0x702c('0x20')]=qs[_0x702c('0x20')](_0x285caa[_0x702c('0x33')][_0x702c('0x20')]);_0x19b4ff[_0x702c('0x1e')]=qs[_0x702c('0x1e')](_0x285caa['query'][_0x702c('0x1e')]);}return _0x592cfd['getSubjects'](_0x19b4ff);}})[_0x702c('0x26')](function(_0x384cc1){if(_0x384cc1){return _0x384cc1?{'count':_0x10decb,'rows':_0x384cc1}:null;}})[_0x702c('0x26')](respondWithResult(_0x8d39e7,null))['catch'](handleError(_0x8d39e7,null));};exports[_0x702c('0x4f')]=function(_0xdf3d,_0xefde7c,_0x48798e){var _0x1d5424={};var _0x34480e={};var _0x1b5ede;var _0x436d46;return db['VtigerConfiguration'][_0x702c('0x50')]({'where':{'id':_0xdf3d[_0x702c('0x48')]['id']}})[_0x702c('0x26')](handleEntityNotFound(_0xefde7c,null))[_0x702c('0x26')](function(_0x449624){if(_0x449624){_0x1b5ede=_0x449624;_0x34480e[_0x702c('0x31')]=_[_0x702c('0x32')](db[_0x702c('0x51')]['rawAttributes']);_0x34480e[_0x702c('0x33')]=_[_0x702c('0x32')](_0xdf3d[_0x702c('0x33')]);_0x34480e[_0x702c('0x34')]=_[_0x702c('0x35')](_0x34480e['model'],_0x34480e['query']);_0x1d5424[_0x702c('0x37')]=_[_0x702c('0x35')](_0x34480e[_0x702c('0x31')],qs[_0x702c('0x36')](_0xdf3d[_0x702c('0x33')]['fields']));_0x1d5424[_0x702c('0x37')]=_0x1d5424[_0x702c('0x37')]['length']?_0x1d5424[_0x702c('0x37')]:_0x34480e[_0x702c('0x31')];_0x1d5424[_0x702c('0x3b')]=qs[_0x702c('0x3c')](_0xdf3d[_0x702c('0x33')][_0x702c('0x3c')]);_0x1d5424[_0x702c('0x3d')]=qs[_0x702c('0x34')](_[_0x702c('0x3e')](_0xdf3d[_0x702c('0x33')],_0x34480e[_0x702c('0x34')]));if(_0xdf3d['query']['filter']){_0x1d5424[_0x702c('0x3d')]=_[_0x702c('0x40')](_0x1d5424[_0x702c('0x3d')],{'$or':_[_0x702c('0x2c')](_0x1d5424[_0x702c('0x37')],function(_0x4b8b19){var _0x13b051={};_0x13b051[_0x4b8b19]={'$like':'%'+_0xdf3d[_0x702c('0x33')][_0x702c('0x3f')]+'%'};return _0x13b051;})});}_0x1d5424=_[_0x702c('0x40')]({},_0x1d5424,_0xdf3d[_0x702c('0x42')]);return _0x1b5ede[_0x702c('0x4f')](_0x1d5424);}})[_0x702c('0x26')](function(_0xdc443f){if(_0xdc443f){_0x436d46=_0xdc443f[_0x702c('0x38')];if(!_0xdf3d[_0x702c('0x33')][_0x702c('0x39')](_0x702c('0x3a'))){_0x1d5424[_0x702c('0x20')]=qs['limit'](_0xdf3d[_0x702c('0x33')]['limit']);_0x1d5424[_0x702c('0x1e')]=qs['offset'](_0xdf3d[_0x702c('0x33')]['offset']);}return _0x1b5ede[_0x702c('0x4f')](_0x1d5424);}})[_0x702c('0x26')](function(_0x16bc14){if(_0x16bc14){return _0x16bc14?{'count':_0x436d46,'rows':_0x16bc14}:null;}})['then'](respondWithResult(_0xefde7c,null))[_0x702c('0x4c')](handleError(_0xefde7c,null));}; \ No newline at end of file +var _0x8cd9=['to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','reject','save','then','error','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','include','rows','catch','show','params','fields','includeAll','find','create','body','update','destroy','getFields','findOne','VtigerField','hasOwnProperty','getSubjects','order','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','jsforce','desk.js'];(function(_0x599307,_0x51b05e){var _0x510116=function(_0x34ec15){while(--_0x34ec15){_0x599307['push'](_0x599307['shift']());}};_0x510116(++_0x51b05e);}(_0x8cd9,0x186));var _0x98cd=function(_0x4194a1,_0x10a102){_0x4194a1=_0x4194a1-0x0;var _0xbf2557=_0x8cd9[_0x4194a1];return _0xbf2557;};'use strict';var emlformat=require(_0x98cd('0x0'));var rimraf=require(_0x98cd('0x1'));var zipdir=require(_0x98cd('0x2'));var jsonpatch=require(_0x98cd('0x3'));var rp=require(_0x98cd('0x4'));var moment=require(_0x98cd('0x5'));var BPromise=require(_0x98cd('0x6'));var Mustache=require(_0x98cd('0x7'));var util=require(_0x98cd('0x8'));var path=require(_0x98cd('0x9'));var sox=require(_0x98cd('0xa'));var csv=require('to-csv');var ejs=require(_0x98cd('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x98cd('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x98cd('0xd'));var deskjs=require(_0x98cd('0xe'));var toCsv=require(_0x98cd('0xf'));var querystring=require(_0x98cd('0x10'));var Papa=require(_0x98cd('0x11'));var Redis=require(_0x98cd('0x12'));var authService=require(_0x98cd('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x98cd('0x14'));var hardwareService=require(_0x98cd('0x15'));var logger=require('../../config/logger')(_0x98cd('0x16'));var utils=require(_0x98cd('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x98cd('0x18'))['db'];function respondWithStatusCode(_0x4a18ec,_0x2c04a4){_0x2c04a4=_0x2c04a4||0xcc;return function(_0x49dbc3){if(_0x49dbc3){return _0x4a18ec[_0x98cd('0x19')](_0x2c04a4);}return _0x4a18ec[_0x98cd('0x1a')](_0x2c04a4)[_0x98cd('0x1b')]();};}function respondWithResult(_0x2d3184,_0x3044ec){_0x3044ec=_0x3044ec||0xc8;return function(_0x26549d){if(_0x26549d){return _0x2d3184[_0x98cd('0x1a')](_0x3044ec)[_0x98cd('0x1c')](_0x26549d);}};}function respondWithFilteredResult(_0x5eca17,_0x160bcc){return function(_0x2d2e17){if(_0x2d2e17){var _0x12cdb8=typeof _0x160bcc[_0x98cd('0x1d')]===_0x98cd('0x1e')&&typeof _0x160bcc['limit']==='undefined';var _0x1fcbf7=_0x2d2e17['count'];var _0x1187ba=_0x12cdb8?0x0:_0x160bcc[_0x98cd('0x1d')];var _0x5d66c6=_0x12cdb8?_0x2d2e17[_0x98cd('0x1f')]:_0x160bcc[_0x98cd('0x1d')]+_0x160bcc[_0x98cd('0x20')];var _0x432aad;if(_0x5d66c6>=_0x1fcbf7){_0x5d66c6=_0x1fcbf7;_0x432aad=0xc8;}else{_0x432aad=0xce;}_0x5eca17[_0x98cd('0x1a')](_0x432aad);return _0x5eca17['set']('Content-Range',_0x1187ba+'-'+_0x5d66c6+'/'+_0x1fcbf7)['json'](_0x2d2e17);}return null;};}function patchUpdates(_0x2c61b5){return function(_0x1ea24d){try{jsonpatch['apply'](_0x1ea24d,_0x2c61b5,!![]);}catch(_0x47f714){return BPromise[_0x98cd('0x21')](_0x47f714);}return _0x1ea24d[_0x98cd('0x22')]();};}function saveUpdates(_0x165c84,_0x3e9408){return function(_0x4fc2db){if(_0x4fc2db){return _0x4fc2db['update'](_0x165c84)[_0x98cd('0x23')](function(_0x2dcf1e){return _0x2dcf1e;});}return null;};}function removeEntity(_0x1b2522,_0x21702a){return function(_0x3cd46b){if(_0x3cd46b){return _0x3cd46b['destroy']()[_0x98cd('0x23')](function(){_0x1b2522['status'](0xcc)[_0x98cd('0x1b')]();});}};}function handleEntityNotFound(_0x36bcac,_0x1eb40f){return function(_0x1f37d1){if(!_0x1f37d1){_0x36bcac[_0x98cd('0x19')](0x194);}return _0x1f37d1;};}function handleError(_0x5487f8,_0x2bbe8c){_0x2bbe8c=_0x2bbe8c||0x1f4;return function(_0xe54890){logger[_0x98cd('0x24')](_0xe54890[_0x98cd('0x25')]);if(_0xe54890[_0x98cd('0x26')]){delete _0xe54890[_0x98cd('0x26')];}_0x5487f8['status'](_0x2bbe8c)[_0x98cd('0x27')](_0xe54890);};}exports[_0x98cd('0x28')]=function(_0x3e4b8d,_0x5cb015){var _0x595a3d={},_0x993137={},_0x2ad9ae={'count':0x0,'rows':[]};var _0x591bf2=_[_0x98cd('0x29')](db[_0x98cd('0x2a')][_0x98cd('0x2b')],function(_0x1d1c45){return{'name':_0x1d1c45[_0x98cd('0x2c')],'type':_0x1d1c45[_0x98cd('0x2d')][_0x98cd('0x2e')]};});_0x993137[_0x98cd('0x2f')]=_[_0x98cd('0x29')](_0x591bf2,_0x98cd('0x26'));_0x993137[_0x98cd('0x30')]=_[_0x98cd('0x31')](_0x3e4b8d[_0x98cd('0x30')]);_0x993137[_0x98cd('0x32')]=_[_0x98cd('0x33')](_0x993137[_0x98cd('0x2f')],_0x993137[_0x98cd('0x30')]);_0x595a3d[_0x98cd('0x34')]=_[_0x98cd('0x33')](_0x993137[_0x98cd('0x2f')],qs['fields'](_0x3e4b8d[_0x98cd('0x30')]['fields']));_0x595a3d[_0x98cd('0x34')]=_0x595a3d[_0x98cd('0x34')][_0x98cd('0x35')]?_0x595a3d[_0x98cd('0x34')]:_0x993137[_0x98cd('0x2f')];if(!_0x3e4b8d[_0x98cd('0x30')]['hasOwnProperty'](_0x98cd('0x36'))){_0x595a3d[_0x98cd('0x20')]=qs['limit'](_0x3e4b8d[_0x98cd('0x30')][_0x98cd('0x20')]);_0x595a3d['offset']=qs[_0x98cd('0x1d')](_0x3e4b8d['query']['offset']);}_0x595a3d['order']=qs['sort'](_0x3e4b8d[_0x98cd('0x30')][_0x98cd('0x37')]);_0x595a3d[_0x98cd('0x38')]=qs['filters'](_[_0x98cd('0x39')](_0x3e4b8d['query'],_0x993137[_0x98cd('0x32')]),_0x591bf2);if(_0x3e4b8d[_0x98cd('0x30')][_0x98cd('0x3a')]){_0x595a3d['where']=_['merge'](_0x595a3d['where'],{'$or':_['map'](_0x591bf2,function(_0x5d769d){if(_0x5d769d['type']!==_0x98cd('0x3b')){var _0x5b85ca={};_0x5b85ca[_0x5d769d['name']]={'$like':'%'+_0x3e4b8d[_0x98cd('0x30')][_0x98cd('0x3a')]+'%'};return _0x5b85ca;}})});}_0x595a3d=_[_0x98cd('0x3c')]({},_0x595a3d,_0x3e4b8d[_0x98cd('0x3d')]);var _0x14678a={'where':_0x595a3d[_0x98cd('0x38')]};return db[_0x98cd('0x2a')][_0x98cd('0x1f')](_0x14678a)[_0x98cd('0x23')](function(_0x3e6928){_0x2ad9ae[_0x98cd('0x1f')]=_0x3e6928;if(_0x3e4b8d['query']['includeAll']){_0x595a3d[_0x98cd('0x3e')]=[{'all':!![]}];}return db[_0x98cd('0x2a')]['findAll'](_0x595a3d);})['then'](function(_0x372f17){_0x2ad9ae[_0x98cd('0x3f')]=_0x372f17;return _0x2ad9ae;})['then'](respondWithFilteredResult(_0x5cb015,_0x595a3d))[_0x98cd('0x40')](handleError(_0x5cb015,null));};exports[_0x98cd('0x41')]=function(_0x11a8af,_0x203971){var _0x3472f7={'raw':![],'where':{'id':_0x11a8af[_0x98cd('0x42')]['id']}},_0x5280d5={};_0x5280d5[_0x98cd('0x2f')]=_[_0x98cd('0x31')](db[_0x98cd('0x2a')]['rawAttributes']);_0x5280d5[_0x98cd('0x30')]=_['keys'](_0x11a8af[_0x98cd('0x30')]);_0x5280d5[_0x98cd('0x32')]=_[_0x98cd('0x33')](_0x5280d5[_0x98cd('0x2f')],_0x5280d5['query']);_0x3472f7[_0x98cd('0x34')]=_[_0x98cd('0x33')](_0x5280d5[_0x98cd('0x2f')],qs[_0x98cd('0x43')](_0x11a8af['query'][_0x98cd('0x43')]));_0x3472f7[_0x98cd('0x34')]=_0x3472f7[_0x98cd('0x34')][_0x98cd('0x35')]?_0x3472f7[_0x98cd('0x34')]:_0x5280d5[_0x98cd('0x2f')];if(_0x11a8af[_0x98cd('0x30')][_0x98cd('0x44')]){_0x3472f7[_0x98cd('0x3e')]=[{'all':!![]}];}_0x3472f7=_['merge']({},_0x3472f7,_0x11a8af[_0x98cd('0x3d')]);return db[_0x98cd('0x2a')][_0x98cd('0x45')](_0x3472f7)[_0x98cd('0x23')](handleEntityNotFound(_0x203971,null))[_0x98cd('0x23')](respondWithResult(_0x203971,null))[_0x98cd('0x40')](handleError(_0x203971,null));};exports[_0x98cd('0x46')]=function(_0x398e37,_0x4e1a55){return db[_0x98cd('0x2a')][_0x98cd('0x46')](_0x398e37[_0x98cd('0x47')],{})['then'](respondWithResult(_0x4e1a55,0xc9))[_0x98cd('0x40')](handleError(_0x4e1a55,null));};exports[_0x98cd('0x48')]=function(_0x78e508,_0x2cec12){if(_0x78e508[_0x98cd('0x47')]['id']){delete _0x78e508[_0x98cd('0x47')]['id'];}return db[_0x98cd('0x2a')][_0x98cd('0x45')]({'where':{'id':_0x78e508[_0x98cd('0x42')]['id']}})[_0x98cd('0x23')](handleEntityNotFound(_0x2cec12,null))[_0x98cd('0x23')](saveUpdates(_0x78e508[_0x98cd('0x47')],null))[_0x98cd('0x23')](respondWithResult(_0x2cec12,null))['catch'](handleError(_0x2cec12,null));};exports[_0x98cd('0x49')]=function(_0x582e6d,_0xb43846){return db[_0x98cd('0x2a')]['find']({'where':{'id':_0x582e6d[_0x98cd('0x42')]['id']}})[_0x98cd('0x23')](handleEntityNotFound(_0xb43846,null))[_0x98cd('0x23')](removeEntity(_0xb43846,null))[_0x98cd('0x40')](handleError(_0xb43846,null));};exports[_0x98cd('0x4a')]=function(_0x13f69a,_0x5250e1,_0x5edda8){var _0x3de038={};var _0x151e24={};var _0xb68c97;var _0x358c94;return db['VtigerConfiguration'][_0x98cd('0x4b')]({'where':{'id':_0x13f69a[_0x98cd('0x42')]['id']}})[_0x98cd('0x23')](handleEntityNotFound(_0x5250e1,null))[_0x98cd('0x23')](function(_0xe71779){if(_0xe71779){_0xb68c97=_0xe71779;_0x151e24[_0x98cd('0x2f')]=_[_0x98cd('0x31')](db[_0x98cd('0x4c')][_0x98cd('0x2b')]);_0x151e24[_0x98cd('0x30')]=_['keys'](_0x13f69a[_0x98cd('0x30')]);_0x151e24[_0x98cd('0x32')]=_[_0x98cd('0x33')](_0x151e24[_0x98cd('0x2f')],_0x151e24[_0x98cd('0x30')]);_0x3de038[_0x98cd('0x34')]=_['intersection'](_0x151e24[_0x98cd('0x2f')],qs[_0x98cd('0x43')](_0x13f69a[_0x98cd('0x30')][_0x98cd('0x43')]));_0x3de038['attributes']=_0x3de038[_0x98cd('0x34')][_0x98cd('0x35')]?_0x3de038[_0x98cd('0x34')]:_0x151e24['model'];_0x3de038['order']=qs[_0x98cd('0x37')](_0x13f69a['query']['sort']);_0x3de038[_0x98cd('0x38')]=qs['filters'](_[_0x98cd('0x39')](_0x13f69a[_0x98cd('0x30')],_0x151e24['filters']));if(_0x13f69a['query']['filter']){_0x3de038[_0x98cd('0x38')]=_['merge'](_0x3de038[_0x98cd('0x38')],{'$or':_[_0x98cd('0x29')](_0x3de038[_0x98cd('0x34')],function(_0x17b5af){var _0x4e4136={};_0x4e4136[_0x17b5af]={'$like':'%'+_0x13f69a[_0x98cd('0x30')][_0x98cd('0x3a')]+'%'};return _0x4e4136;})});}_0x3de038=_[_0x98cd('0x3c')]({},_0x3de038,_0x13f69a[_0x98cd('0x3d')]);return _0xb68c97[_0x98cd('0x4a')](_0x3de038);}})[_0x98cd('0x23')](function(_0x4f7b8b){if(_0x4f7b8b){_0x358c94=_0x4f7b8b[_0x98cd('0x35')];if(!_0x13f69a[_0x98cd('0x30')][_0x98cd('0x4d')](_0x98cd('0x36'))){_0x3de038[_0x98cd('0x20')]=qs[_0x98cd('0x20')](_0x13f69a[_0x98cd('0x30')][_0x98cd('0x20')]);_0x3de038['offset']=qs[_0x98cd('0x1d')](_0x13f69a['query'][_0x98cd('0x1d')]);}return _0xb68c97[_0x98cd('0x4a')](_0x3de038);}})['then'](function(_0x37e013){if(_0x37e013){return _0x37e013?{'count':_0x358c94,'rows':_0x37e013}:null;}})[_0x98cd('0x23')](respondWithResult(_0x5250e1,null))[_0x98cd('0x40')](handleError(_0x5250e1,null));};exports[_0x98cd('0x4e')]=function(_0x4a36e7,_0x453949,_0x4d1f80){var _0x22b7af={};var _0x4d2da6={};var _0x5a6e10;var _0x27331b;return db[_0x98cd('0x2a')]['findOne']({'where':{'id':_0x4a36e7[_0x98cd('0x42')]['id']}})[_0x98cd('0x23')](handleEntityNotFound(_0x453949,null))[_0x98cd('0x23')](function(_0x51f027){if(_0x51f027){_0x5a6e10=_0x51f027;_0x4d2da6[_0x98cd('0x2f')]=_[_0x98cd('0x31')](db[_0x98cd('0x4c')][_0x98cd('0x2b')]);_0x4d2da6[_0x98cd('0x30')]=_[_0x98cd('0x31')](_0x4a36e7[_0x98cd('0x30')]);_0x4d2da6[_0x98cd('0x32')]=_['intersection'](_0x4d2da6['model'],_0x4d2da6[_0x98cd('0x30')]);_0x22b7af[_0x98cd('0x34')]=_[_0x98cd('0x33')](_0x4d2da6[_0x98cd('0x2f')],qs[_0x98cd('0x43')](_0x4a36e7['query']['fields']));_0x22b7af[_0x98cd('0x34')]=_0x22b7af[_0x98cd('0x34')]['length']?_0x22b7af[_0x98cd('0x34')]:_0x4d2da6[_0x98cd('0x2f')];_0x22b7af[_0x98cd('0x4f')]=qs['sort'](_0x4a36e7[_0x98cd('0x30')][_0x98cd('0x37')]);_0x22b7af[_0x98cd('0x38')]=qs[_0x98cd('0x32')](_[_0x98cd('0x39')](_0x4a36e7[_0x98cd('0x30')],_0x4d2da6[_0x98cd('0x32')]));if(_0x4a36e7[_0x98cd('0x30')][_0x98cd('0x3a')]){_0x22b7af[_0x98cd('0x38')]=_[_0x98cd('0x3c')](_0x22b7af['where'],{'$or':_['map'](_0x22b7af[_0x98cd('0x34')],function(_0x43353a){var _0x4a7e81={};_0x4a7e81[_0x43353a]={'$like':'%'+_0x4a36e7[_0x98cd('0x30')][_0x98cd('0x3a')]+'%'};return _0x4a7e81;})});}_0x22b7af=_[_0x98cd('0x3c')]({},_0x22b7af,_0x4a36e7['options']);return _0x5a6e10[_0x98cd('0x4e')](_0x22b7af);}})[_0x98cd('0x23')](function(_0xfa9e5e){if(_0xfa9e5e){_0x27331b=_0xfa9e5e[_0x98cd('0x35')];if(!_0x4a36e7[_0x98cd('0x30')][_0x98cd('0x4d')](_0x98cd('0x36'))){_0x22b7af[_0x98cd('0x20')]=qs[_0x98cd('0x20')](_0x4a36e7[_0x98cd('0x30')][_0x98cd('0x20')]);_0x22b7af['offset']=qs[_0x98cd('0x1d')](_0x4a36e7['query'][_0x98cd('0x1d')]);}return _0x5a6e10[_0x98cd('0x4e')](_0x22b7af);}})[_0x98cd('0x23')](function(_0x2440b6){if(_0x2440b6){return _0x2440b6?{'count':_0x27331b,'rows':_0x2440b6}:null;}})['then'](respondWithResult(_0x453949,null))[_0x98cd('0x40')](handleError(_0x453949,null));};exports['getDescriptions']=function(_0xd3389b,_0x144f3f,_0x5e7c7f){var _0x408207={};var _0x37fdca={};var _0xe4a083;var _0x759497;return db['VtigerConfiguration'][_0x98cd('0x4b')]({'where':{'id':_0xd3389b[_0x98cd('0x42')]['id']}})[_0x98cd('0x23')](handleEntityNotFound(_0x144f3f,null))['then'](function(_0x198180){if(_0x198180){_0xe4a083=_0x198180;_0x37fdca['model']=_[_0x98cd('0x31')](db[_0x98cd('0x4c')][_0x98cd('0x2b')]);_0x37fdca['query']=_[_0x98cd('0x31')](_0xd3389b[_0x98cd('0x30')]);_0x37fdca[_0x98cd('0x32')]=_['intersection'](_0x37fdca[_0x98cd('0x2f')],_0x37fdca[_0x98cd('0x30')]);_0x408207[_0x98cd('0x34')]=_[_0x98cd('0x33')](_0x37fdca[_0x98cd('0x2f')],qs[_0x98cd('0x43')](_0xd3389b[_0x98cd('0x30')]['fields']));_0x408207['attributes']=_0x408207[_0x98cd('0x34')][_0x98cd('0x35')]?_0x408207[_0x98cd('0x34')]:_0x37fdca['model'];_0x408207[_0x98cd('0x4f')]=qs[_0x98cd('0x37')](_0xd3389b[_0x98cd('0x30')][_0x98cd('0x37')]);_0x408207[_0x98cd('0x38')]=qs[_0x98cd('0x32')](_[_0x98cd('0x39')](_0xd3389b[_0x98cd('0x30')],_0x37fdca[_0x98cd('0x32')]));if(_0xd3389b['query'][_0x98cd('0x3a')]){_0x408207[_0x98cd('0x38')]=_['merge'](_0x408207[_0x98cd('0x38')],{'$or':_[_0x98cd('0x29')](_0x408207['attributes'],function(_0xabe80b){var _0x19e71d={};_0x19e71d[_0xabe80b]={'$like':'%'+_0xd3389b[_0x98cd('0x30')][_0x98cd('0x3a')]+'%'};return _0x19e71d;})});}_0x408207=_[_0x98cd('0x3c')]({},_0x408207,_0xd3389b['options']);return _0xe4a083[_0x98cd('0x50')](_0x408207);}})[_0x98cd('0x23')](function(_0x5bca9a){if(_0x5bca9a){_0x759497=_0x5bca9a['length'];if(!_0xd3389b[_0x98cd('0x30')][_0x98cd('0x4d')](_0x98cd('0x36'))){_0x408207[_0x98cd('0x20')]=qs[_0x98cd('0x20')](_0xd3389b['query'][_0x98cd('0x20')]);_0x408207[_0x98cd('0x1d')]=qs[_0x98cd('0x1d')](_0xd3389b[_0x98cd('0x30')]['offset']);}return _0xe4a083[_0x98cd('0x50')](_0x408207);}})[_0x98cd('0x23')](function(_0x279cef){if(_0x279cef){return _0x279cef?{'count':_0x759497,'rows':_0x279cef}:null;}})[_0x98cd('0x23')](respondWithResult(_0x144f3f,null))[_0x98cd('0x40')](handleError(_0x144f3f,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index e554cff..d9a59ef 100644 --- a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js +++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x75b5=['rimraf','../../config/environment','./intVtigerConfiguration.attributes','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0xc08437,_0x4e7ba2){var _0x524d42=function(_0x880b72){while(--_0x880b72){_0xc08437['push'](_0xc08437['shift']());}};_0x524d42(++_0x4e7ba2);}(_0x75b5,0xba));var _0x575b=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0x75b5[_0x1abb09];return _0xea1c07;};'use strict';var _=require(_0x575b('0x0'));var util=require(_0x575b('0x1'));var logger=require(_0x575b('0x2'))(_0x575b('0x3'));var moment=require(_0x575b('0x4'));var BPromise=require('bluebird');var rp=require(_0x575b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x575b('0x6'));var config=require(_0x575b('0x7'));var attributes=require(_0x575b('0x8'));module['exports']=function(_0x54eca3,_0x34ce50){return _0x54eca3[_0x575b('0x9')](_0x575b('0xa'),attributes,{'tableName':_0x575b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa46f=['int_vtiger_configurations','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration'];(function(_0x1ae729,_0x3216a7){var _0x8a0d58=function(_0x2724f5){while(--_0x2724f5){_0x1ae729['push'](_0x1ae729['shift']());}};_0x8a0d58(++_0x3216a7);}(_0xa46f,0x12c));var _0xfa46=function(_0x36f243,_0x188505){_0x36f243=_0x36f243-0x0;var _0x426436=_0xa46f[_0x36f243];return _0x426436;};'use strict';var _=require(_0xfa46('0x0'));var util=require(_0xfa46('0x1'));var logger=require('../../config/logger')(_0xfa46('0x2'));var moment=require(_0xfa46('0x3'));var BPromise=require('bluebird');var rp=require(_0xfa46('0x4'));var fs=require('fs');var path=require(_0xfa46('0x5'));var rimraf=require(_0xfa46('0x6'));var config=require(_0xfa46('0x7'));var attributes=require(_0xfa46('0x8'));module[_0xfa46('0x9')]=function(_0x318a7e,_0x18592d){return _0x318a7e[_0xfa46('0xa')](_0xfa46('0xb'),attributes,{'tableName':_0xfa46('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index 38257a7..7b4cbec 100644 --- a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js +++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c9b=['http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x422223,_0x40e47b){var _0xdb3b53=function(_0x492435){while(--_0x492435){_0x422223['push'](_0x422223['shift']());}};_0xdb3b53(++_0x40e47b);}(_0x5c9b,0x152));var _0xb5c9=function(_0x4b5685,_0x258c89){_0x4b5685=_0x4b5685-0x0;var _0x5df10f=_0x5c9b[_0x4b5685];return _0x5df10f;};'use strict';var _=require(_0xb5c9('0x0'));var util=require(_0xb5c9('0x1'));var moment=require(_0xb5c9('0x2'));var BPromise=require(_0xb5c9('0x3'));var rs=require(_0xb5c9('0x4'));var fs=require('fs');var Redis=require(_0xb5c9('0x5'));var db=require(_0xb5c9('0x6'))['db'];var utils=require(_0xb5c9('0x7'));var logger=require(_0xb5c9('0x8'))('rpc');var config=require(_0xb5c9('0x9'));var jayson=require(_0xb5c9('0xa'));var client=jayson[_0xb5c9('0xb')][_0xb5c9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x18cc08,_0x30cc4c,_0x53ff42){return new BPromise(function(_0x16dd2f,_0x2c796a){return client[_0xb5c9('0xd')](_0x18cc08,_0x53ff42)[_0xb5c9('0xe')](function(_0x30196c){logger[_0xb5c9('0xf')](_0xb5c9('0x10'),_0x30cc4c,'request\x20sent');logger[_0xb5c9('0x11')](_0xb5c9('0x12'),_0x30cc4c,'request\x20sent',JSON['stringify'](_0x30196c));if(_0x30196c[_0xb5c9('0x13')]){if(_0x30196c[_0xb5c9('0x13')][_0xb5c9('0x14')]===0x1f4){logger[_0xb5c9('0x13')](_0xb5c9('0x10'),_0x30cc4c,_0x30196c['error'][_0xb5c9('0x15')]);return _0x2c796a(_0x30196c[_0xb5c9('0x13')][_0xb5c9('0x15')]);}logger[_0xb5c9('0x13')]('VtigerConfiguration,\x20%s,\x20%s',_0x30cc4c,_0x30196c[_0xb5c9('0x13')][_0xb5c9('0x15')]);return _0x16dd2f(_0x30196c['error'][_0xb5c9('0x15')]);}else{logger[_0xb5c9('0xf')](_0xb5c9('0x10'),_0x30cc4c,_0xb5c9('0x16'));_0x16dd2f(_0x30196c[_0xb5c9('0x17')][_0xb5c9('0x15')]);}})[_0xb5c9('0x18')](function(_0x2095ce){logger[_0xb5c9('0x13')](_0xb5c9('0x10'),_0x30cc4c,_0x2095ce);_0x2c796a(_0x2095ce);});});} \ No newline at end of file +var _0x133f=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash'];(function(_0x35a701,_0x49f58c){var _0x59a6ea=function(_0x26d682){while(--_0x26d682){_0x35a701['push'](_0x35a701['shift']());}};_0x59a6ea(++_0x49f58c);}(_0x133f,0x1e2));var _0xf133=function(_0x2b8a42,_0x1f461){_0x2b8a42=_0x2b8a42-0x0;var _0x5b778d=_0x133f[_0x2b8a42];return _0x5b778d;};'use strict';var _=require(_0xf133('0x0'));var util=require(_0xf133('0x1'));var moment=require(_0xf133('0x2'));var BPromise=require('bluebird');var rs=require(_0xf133('0x3'));var fs=require('fs');var Redis=require(_0xf133('0x4'));var db=require(_0xf133('0x5'))['db'];var utils=require(_0xf133('0x6'));var logger=require(_0xf133('0x7'))(_0xf133('0x8'));var config=require(_0xf133('0x9'));var jayson=require(_0xf133('0xa'));var client=jayson[_0xf133('0xb')][_0xf133('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x271871,_0x26155c,_0x3ab452){return new BPromise(function(_0x4ebc42,_0x258ea8){return client[_0xf133('0xd')](_0x271871,_0x3ab452)[_0xf133('0xe')](function(_0x51132b){logger[_0xf133('0xf')](_0xf133('0x10'),_0x26155c,_0xf133('0x11'));logger['debug'](_0xf133('0x12'),_0x26155c,_0xf133('0x11'),JSON[_0xf133('0x13')](_0x51132b));if(_0x51132b[_0xf133('0x14')]){if(_0x51132b[_0xf133('0x14')]['code']===0x1f4){logger[_0xf133('0x14')](_0xf133('0x10'),_0x26155c,_0x51132b[_0xf133('0x14')][_0xf133('0x15')]);return _0x258ea8(_0x51132b[_0xf133('0x14')][_0xf133('0x15')]);}logger['error'](_0xf133('0x10'),_0x26155c,_0x51132b['error'][_0xf133('0x15')]);return _0x4ebc42(_0x51132b[_0xf133('0x14')][_0xf133('0x15')]);}else{logger[_0xf133('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0x26155c,_0xf133('0x11'));_0x4ebc42(_0x51132b['result'][_0xf133('0x15')]);}})[_0xf133('0x16')](function(_0x3bae11){logger[_0xf133('0x14')](_0xf133('0x10'),_0x26155c,_0x3bae11);_0x258ea8(_0x3bae11);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 0ff5cf5..56c3dd1 100644 --- a/server/api/intVtigerField/index.js +++ b/server/api/intVtigerField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaaad=['index','/:id','show','post','create','update','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaaad,0xce));var _0xdaaa=function(_0x3aaf46,_0x7798a7){_0x3aaf46=_0x3aaf46-0x0;var _0x5d6b32=_0xaaad[_0x3aaf46];return _0x5d6b32;};'use strict';var multer=require(_0xdaaa('0x0'));var util=require('util');var path=require(_0xdaaa('0x1'));var timeout=require(_0xdaaa('0x2'));var express=require(_0xdaaa('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xdaaa('0x4'));var interaction=require(_0xdaaa('0x5'));var config=require(_0xdaaa('0x6'));var controller=require(_0xdaaa('0x7'));router[_0xdaaa('0x8')]('/',auth[_0xdaaa('0x9')](),controller[_0xdaaa('0xa')]);router['get'](_0xdaaa('0xb'),auth[_0xdaaa('0x9')](),controller[_0xdaaa('0xc')]);router[_0xdaaa('0xd')]('/',auth['isAuthenticated'](),controller[_0xdaaa('0xe')]);router['put'](_0xdaaa('0xb'),auth[_0xdaaa('0x9')](),controller[_0xdaaa('0xf')]);router['delete'](_0xdaaa('0xb'),auth[_0xdaaa('0x9')](),controller[_0xdaaa('0x10')]);module[_0xdaaa('0x11')]=router; \ No newline at end of file +var _0x8dac=['/:id','show','put','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','isAuthenticated','get'];(function(_0x3b41b5,_0x36da8b){var _0xc30195=function(_0x2f663e){while(--_0x2f663e){_0x3b41b5['push'](_0x3b41b5['shift']());}};_0xc30195(++_0x36da8b);}(_0x8dac,0x17b));var _0xc8da=function(_0x102dc9,_0x19f148){_0x102dc9=_0x102dc9-0x0;var _0x55e57f=_0x8dac[_0x102dc9];return _0x55e57f;};'use strict';var multer=require('multer');var util=require(_0xc8da('0x0'));var path=require(_0xc8da('0x1'));var timeout=require(_0xc8da('0x2'));var express=require(_0xc8da('0x3'));var router=express[_0xc8da('0x4')]();var fs_extra=require(_0xc8da('0x5'));var auth=require(_0xc8da('0x6'));var interaction=require(_0xc8da('0x7'));var config=require(_0xc8da('0x8'));var controller=require(_0xc8da('0x9'));router['get']('/',auth[_0xc8da('0xa')](),controller['index']);router[_0xc8da('0xb')](_0xc8da('0xc'),auth[_0xc8da('0xa')](),controller[_0xc8da('0xd')]);router['post']('/',auth[_0xc8da('0xa')](),controller['create']);router[_0xc8da('0xe')](_0xc8da('0xc'),auth[_0xc8da('0xa')](),controller[_0xc8da('0xf')]);router['delete'](_0xc8da('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xc8da('0x10')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index b5f5803..a66cb49 100644 --- a/server/api/intVtigerField/intVtigerField.attributes.js +++ b/server/api/intVtigerField/intVtigerField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4a3=['STRING','BOOLEAN','sequelize','exports','customVariable','string'];(function(_0x50809a,_0x13735f){var _0x2a3e33=function(_0x4b8d23){while(--_0x4b8d23){_0x50809a['push'](_0x50809a['shift']());}};_0x2a3e33(++_0x13735f);}(_0xf4a3,0x80));var _0x3f4a=function(_0x4849c8,_0x168515){_0x4849c8=_0x4849c8-0x0;var _0x29dc87=_0xf4a3[_0x4849c8];return _0x29dc87;};'use strict';var Sequelize=require(_0x3f4a('0x0'));module[_0x3f4a('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable',_0x3f4a('0x2'),'keyValue','picklist'),'defaultValue':_0x3f4a('0x3')},'content':{'type':Sequelize[_0x3f4a('0x4')]},'key':{'type':Sequelize[_0x3f4a('0x4')]},'keyType':{'type':Sequelize['ENUM'](_0x3f4a('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x3f4a('0x4')]},'customField':{'type':Sequelize[_0x3f4a('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3f4a('0x4')]}}; \ No newline at end of file +var _0x1914=['variable','customVariable','keyValue','picklist','STRING','exports','ENUM','string'];(function(_0x50d326,_0x1fc7e2){var _0x10f473=function(_0x2588fd){while(--_0x2588fd){_0x50d326['push'](_0x50d326['shift']());}};_0x10f473(++_0x1fc7e2);}(_0x1914,0x1dd));var _0x4191=function(_0x53793c,_0x12f747){_0x53793c=_0x53793c-0x0;var _0x4428f3=_0x1914[_0x53793c];return _0x4428f3;};'use strict';var Sequelize=require('sequelize');module[_0x4191('0x0')]={'type':{'type':Sequelize[_0x4191('0x1')](_0x4191('0x2'),_0x4191('0x3'),_0x4191('0x4'),_0x4191('0x5'),_0x4191('0x6')),'defaultValue':_0x4191('0x2')},'content':{'type':Sequelize[_0x4191('0x7')]},'key':{'type':Sequelize[_0x4191('0x7')]},'keyType':{'type':Sequelize[_0x4191('0x1')]('string',_0x4191('0x3'),_0x4191('0x4'))},'keyContent':{'type':Sequelize[_0x4191('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x4191('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 219941f..92a37f0 100644 --- a/server/api/intVtigerField/intVtigerField.controller.js +++ b/server/api/intVtigerField/intVtigerField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x332b=['fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','end','json','offset','undefined','count','status','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','VtigerField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','keys','find','create','body','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs'];(function(_0x34b11b,_0x9cf31f){var _0x2e394d=function(_0xaab77b){while(--_0xaab77b){_0x34b11b['push'](_0x34b11b['shift']());}};_0x2e394d(++_0x9cf31f);}(_0x332b,0x1c5));var _0xb332=function(_0x434e7b,_0x31ab4d){_0x434e7b=_0x434e7b-0x0;var _0x5deed2=_0x332b[_0x434e7b];return _0x5deed2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb332('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb332('0x1'));var rp=require('request-promise');var moment=require(_0xb332('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xb332('0x3'));var util=require(_0xb332('0x4'));var path=require(_0xb332('0x5'));var sox=require(_0xb332('0x6'));var csv=require(_0xb332('0x7'));var ejs=require(_0xb332('0x8'));var fs=require('fs');var fs_extra=require(_0xb332('0x9'));var _=require(_0xb332('0xa'));var squel=require(_0xb332('0xb'));var crypto=require('crypto');var jsforce=require(_0xb332('0xc'));var deskjs=require(_0xb332('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb332('0xe'));var Papa=require(_0xb332('0xf'));var Redis=require(_0xb332('0x10'));var authService=require(_0xb332('0x11'));var qs=require(_0xb332('0x12'));var as=require(_0xb332('0x13'));var hardwareService=require(_0xb332('0x14'));var logger=require('../../config/logger')(_0xb332('0x15'));var utils=require('../../config/utils');var config=require(_0xb332('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xb332('0x17'))['db'];function respondWithStatusCode(_0xbf16dd,_0x349979){_0x349979=_0x349979||0xcc;return function(_0x2c4ded){if(_0x2c4ded){return _0xbf16dd['sendStatus'](_0x349979);}return _0xbf16dd['status'](_0x349979)[_0xb332('0x18')]();};}function respondWithResult(_0x38ce8b,_0x369a34){_0x369a34=_0x369a34||0xc8;return function(_0x221c3c){if(_0x221c3c){return _0x38ce8b['status'](_0x369a34)[_0xb332('0x19')](_0x221c3c);}};}function respondWithFilteredResult(_0x35914b,_0x21d7db){return function(_0x21f69a){if(_0x21f69a){var _0x2d8612=typeof _0x21d7db[_0xb332('0x1a')]===_0xb332('0x1b')&&typeof _0x21d7db['limit']===_0xb332('0x1b');var _0x13432f=_0x21f69a[_0xb332('0x1c')];var _0x180c40=_0x2d8612?0x0:_0x21d7db['offset'];var _0x252d94=_0x2d8612?_0x21f69a[_0xb332('0x1c')]:_0x21d7db[_0xb332('0x1a')]+_0x21d7db['limit'];var _0x7bb15e;if(_0x252d94>=_0x13432f){_0x252d94=_0x13432f;_0x7bb15e=0xc8;}else{_0x7bb15e=0xce;}_0x35914b[_0xb332('0x1d')](_0x7bb15e);return _0x35914b[_0xb332('0x1e')](_0xb332('0x1f'),_0x180c40+'-'+_0x252d94+'/'+_0x13432f)['json'](_0x21f69a);}return null;};}function patchUpdates(_0x3d2ad9){return function(_0x35c7f4){try{jsonpatch[_0xb332('0x20')](_0x35c7f4,_0x3d2ad9,!![]);}catch(_0x589bdd){return BPromise[_0xb332('0x21')](_0x589bdd);}return _0x35c7f4[_0xb332('0x22')]();};}function saveUpdates(_0x1997e8,_0x5024b9){return function(_0x324d66){if(_0x324d66){return _0x324d66[_0xb332('0x23')](_0x1997e8)[_0xb332('0x24')](function(_0x5ed152){return _0x5ed152;});}return null;};}function removeEntity(_0x15e96e,_0x3cf12e){return function(_0x3b0e48){if(_0x3b0e48){return _0x3b0e48[_0xb332('0x25')]()['then'](function(){_0x15e96e[_0xb332('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56463c,_0x165ab8){return function(_0x4474c9){if(!_0x4474c9){_0x56463c[_0xb332('0x26')](0x194);}return _0x4474c9;};}function handleError(_0x4212d3,_0x73b879){_0x73b879=_0x73b879||0x1f4;return function(_0xc4963c){logger[_0xb332('0x27')](_0xc4963c['stack']);if(_0xc4963c['name']){delete _0xc4963c[_0xb332('0x28')];}_0x4212d3['status'](_0x73b879)[_0xb332('0x29')](_0xc4963c);};}exports[_0xb332('0x2a')]=function(_0x4da65b,_0x532ca1){var _0x2b6245={},_0x4e695c={},_0x35a05a={'count':0x0,'rows':[]};var _0xe2f7ad=_[_0xb332('0x2b')](db[_0xb332('0x2c')][_0xb332('0x2d')],function(_0x4eb8e5){return{'name':_0x4eb8e5[_0xb332('0x2e')],'type':_0x4eb8e5[_0xb332('0x2f')][_0xb332('0x30')]};});_0x4e695c[_0xb332('0x31')]=_[_0xb332('0x2b')](_0xe2f7ad,_0xb332('0x28'));_0x4e695c['query']=_['keys'](_0x4da65b[_0xb332('0x32')]);_0x4e695c[_0xb332('0x33')]=_[_0xb332('0x34')](_0x4e695c[_0xb332('0x31')],_0x4e695c['query']);_0x2b6245[_0xb332('0x35')]=_[_0xb332('0x34')](_0x4e695c[_0xb332('0x31')],qs[_0xb332('0x36')](_0x4da65b[_0xb332('0x32')][_0xb332('0x36')]));_0x2b6245[_0xb332('0x35')]=_0x2b6245[_0xb332('0x35')][_0xb332('0x37')]?_0x2b6245['attributes']:_0x4e695c['model'];if(!_0x4da65b[_0xb332('0x32')][_0xb332('0x38')](_0xb332('0x39'))){_0x2b6245[_0xb332('0x3a')]=qs[_0xb332('0x3a')](_0x4da65b[_0xb332('0x32')][_0xb332('0x3a')]);_0x2b6245[_0xb332('0x1a')]=qs['offset'](_0x4da65b[_0xb332('0x32')][_0xb332('0x1a')]);}_0x2b6245[_0xb332('0x3b')]=qs[_0xb332('0x3c')](_0x4da65b[_0xb332('0x32')][_0xb332('0x3c')]);_0x2b6245[_0xb332('0x3d')]=qs['filters'](_[_0xb332('0x3e')](_0x4da65b['query'],_0x4e695c[_0xb332('0x33')]),_0xe2f7ad);if(_0x4da65b[_0xb332('0x32')]['filter']){_0x2b6245[_0xb332('0x3d')]=_[_0xb332('0x3f')](_0x2b6245[_0xb332('0x3d')],{'$or':_[_0xb332('0x2b')](_0xe2f7ad,function(_0x53d8a2){if(_0x53d8a2[_0xb332('0x2f')]!==_0xb332('0x40')){var _0x45aed5={};_0x45aed5[_0x53d8a2[_0xb332('0x28')]]={'$like':'%'+_0x4da65b[_0xb332('0x32')][_0xb332('0x41')]+'%'};return _0x45aed5;}})});}_0x2b6245=_[_0xb332('0x3f')]({},_0x2b6245,_0x4da65b[_0xb332('0x42')]);var _0x400bd2={'where':_0x2b6245[_0xb332('0x3d')]};return db[_0xb332('0x2c')]['count'](_0x400bd2)[_0xb332('0x24')](function(_0x31d157){_0x35a05a['count']=_0x31d157;if(_0x4da65b[_0xb332('0x32')]['includeAll']){_0x2b6245[_0xb332('0x43')]=[{'all':!![]}];}return db[_0xb332('0x2c')][_0xb332('0x44')](_0x2b6245);})[_0xb332('0x24')](function(_0x3804d6){_0x35a05a[_0xb332('0x45')]=_0x3804d6;return _0x35a05a;})['then'](respondWithFilteredResult(_0x532ca1,_0x2b6245))[_0xb332('0x46')](handleError(_0x532ca1,null));};exports[_0xb332('0x47')]=function(_0x2adefc,_0x49c9aa){var _0x510c6d={'raw':!![],'where':{'id':_0x2adefc[_0xb332('0x48')]['id']}},_0x259df6={};_0x259df6[_0xb332('0x31')]=_['keys'](db[_0xb332('0x2c')][_0xb332('0x2d')]);_0x259df6[_0xb332('0x32')]=_[_0xb332('0x49')](_0x2adefc['query']);_0x259df6[_0xb332('0x33')]=_[_0xb332('0x34')](_0x259df6['model'],_0x259df6[_0xb332('0x32')]);_0x510c6d[_0xb332('0x35')]=_['intersection'](_0x259df6[_0xb332('0x31')],qs['fields'](_0x2adefc['query']['fields']));_0x510c6d[_0xb332('0x35')]=_0x510c6d['attributes']['length']?_0x510c6d[_0xb332('0x35')]:_0x259df6[_0xb332('0x31')];if(_0x2adefc['query']['includeAll']){_0x510c6d['include']=[{'all':!![]}];}_0x510c6d=_[_0xb332('0x3f')]({},_0x510c6d,_0x2adefc['options']);return db[_0xb332('0x2c')][_0xb332('0x4a')](_0x510c6d)['then'](handleEntityNotFound(_0x49c9aa,null))[_0xb332('0x24')](respondWithResult(_0x49c9aa,null))[_0xb332('0x46')](handleError(_0x49c9aa,null));};exports[_0xb332('0x4b')]=function(_0x194290,_0x116ca8){return db['VtigerField']['create'](_0x194290[_0xb332('0x4c')],{})[_0xb332('0x24')](respondWithResult(_0x116ca8,0xc9))[_0xb332('0x46')](handleError(_0x116ca8,null));};exports[_0xb332('0x23')]=function(_0x443721,_0x318493){if(_0x443721[_0xb332('0x4c')]['id']){delete _0x443721[_0xb332('0x4c')]['id'];}return db['VtigerField'][_0xb332('0x4a')]({'where':{'id':_0x443721[_0xb332('0x48')]['id']}})[_0xb332('0x24')](handleEntityNotFound(_0x318493,null))[_0xb332('0x24')](saveUpdates(_0x443721[_0xb332('0x4c')],null))[_0xb332('0x24')](respondWithResult(_0x318493,null))[_0xb332('0x46')](handleError(_0x318493,null));};exports['destroy']=function(_0x295c3d,_0x20e69e){return db[_0xb332('0x2c')][_0xb332('0x4a')]({'where':{'id':_0x295c3d[_0xb332('0x48')]['id']}})[_0xb332('0x24')](handleEntityNotFound(_0x20e69e,null))['then'](removeEntity(_0x20e69e,null))['catch'](handleError(_0x20e69e,null));}; \ No newline at end of file +var _0xceea=['status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','end','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','VtigerField','include','rows','catch','show','params','includeAll','options','find','create','body','update','destroy','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x1113b7,_0x12fa0b){var _0x5f2028=function(_0x243cc4){while(--_0x243cc4){_0x1113b7['push'](_0x1113b7['shift']());}};_0x5f2028(++_0x12fa0b);}(_0xceea,0x7d));var _0xacee=function(_0xe26eeb,_0x1a9cf3){_0xe26eeb=_0xe26eeb-0x0;var _0x1d25f7=_0xceea[_0xe26eeb];return _0x1d25f7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xacee('0x0'));var moment=require('moment');var BPromise=require(_0xacee('0x1'));var Mustache=require(_0xacee('0x2'));var util=require(_0xacee('0x3'));var path=require(_0xacee('0x4'));var sox=require('sox');var csv=require(_0xacee('0x5'));var ejs=require(_0xacee('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xacee('0x7'));var squel=require(_0xacee('0x8'));var crypto=require(_0xacee('0x9'));var jsforce=require(_0xacee('0xa'));var deskjs=require(_0xacee('0xb'));var toCsv=require(_0xacee('0x5'));var querystring=require(_0xacee('0xc'));var Papa=require(_0xacee('0xd'));var Redis=require(_0xacee('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xacee('0xf'));var as=require(_0xacee('0x10'));var hardwareService=require(_0xacee('0x11'));var logger=require(_0xacee('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xacee('0x13'));var licenseUtil=require(_0xacee('0x14'));var db=require(_0xacee('0x15'))['db'];function respondWithStatusCode(_0x11c64b,_0x5a8212){_0x5a8212=_0x5a8212||0xcc;return function(_0x34965e){if(_0x34965e){return _0x11c64b[_0xacee('0x16')](_0x5a8212);}return _0x11c64b[_0xacee('0x17')](_0x5a8212)['end']();};}function respondWithResult(_0x5a9d8b,_0x34e783){_0x34e783=_0x34e783||0xc8;return function(_0x4938a2){if(_0x4938a2){return _0x5a9d8b['status'](_0x34e783)[_0xacee('0x18')](_0x4938a2);}};}function respondWithFilteredResult(_0x51a4ca,_0x36491e){return function(_0x505cac){if(_0x505cac){var _0x28ca9c=typeof _0x36491e['offset']===_0xacee('0x19')&&typeof _0x36491e['limit']==='undefined';var _0x14aba4=_0x505cac[_0xacee('0x1a')];var _0x11a2e0=_0x28ca9c?0x0:_0x36491e[_0xacee('0x1b')];var _0x23c3a7=_0x28ca9c?_0x505cac[_0xacee('0x1a')]:_0x36491e[_0xacee('0x1b')]+_0x36491e[_0xacee('0x1c')];var _0x2db3e8;if(_0x23c3a7>=_0x14aba4){_0x23c3a7=_0x14aba4;_0x2db3e8=0xc8;}else{_0x2db3e8=0xce;}_0x51a4ca[_0xacee('0x17')](_0x2db3e8);return _0x51a4ca[_0xacee('0x1d')](_0xacee('0x1e'),_0x11a2e0+'-'+_0x23c3a7+'/'+_0x14aba4)[_0xacee('0x18')](_0x505cac);}return null;};}function patchUpdates(_0x5f44e3){return function(_0x4fcc0c){try{jsonpatch[_0xacee('0x1f')](_0x4fcc0c,_0x5f44e3,!![]);}catch(_0x45888c){return BPromise[_0xacee('0x20')](_0x45888c);}return _0x4fcc0c[_0xacee('0x21')]();};}function saveUpdates(_0x5ad583,_0x286cd7){return function(_0x41601f){if(_0x41601f){return _0x41601f['update'](_0x5ad583)[_0xacee('0x22')](function(_0x2531a6){return _0x2531a6;});}return null;};}function removeEntity(_0x1815e9,_0x3423c6){return function(_0x1ca4ca){if(_0x1ca4ca){return _0x1ca4ca['destroy']()[_0xacee('0x22')](function(){_0x1815e9[_0xacee('0x17')](0xcc)[_0xacee('0x23')]();});}};}function handleEntityNotFound(_0x350a48,_0x2bf9be){return function(_0x42e681){if(!_0x42e681){_0x350a48[_0xacee('0x16')](0x194);}return _0x42e681;};}function handleError(_0x634e0,_0xd695e3){_0xd695e3=_0xd695e3||0x1f4;return function(_0x4b66fe){logger[_0xacee('0x24')](_0x4b66fe[_0xacee('0x25')]);if(_0x4b66fe[_0xacee('0x26')]){delete _0x4b66fe[_0xacee('0x26')];}_0x634e0[_0xacee('0x17')](_0xd695e3)[_0xacee('0x27')](_0x4b66fe);};}exports['index']=function(_0x500c90,_0x2e0359){var _0x1b5acf={},_0x13e794={},_0xcdfd43={'count':0x0,'rows':[]};var _0x2d878f=_[_0xacee('0x28')](db['VtigerField'][_0xacee('0x29')],function(_0x45d43f){return{'name':_0x45d43f[_0xacee('0x2a')],'type':_0x45d43f[_0xacee('0x2b')][_0xacee('0x2c')]};});_0x13e794[_0xacee('0x2d')]=_[_0xacee('0x28')](_0x2d878f,'name');_0x13e794[_0xacee('0x2e')]=_[_0xacee('0x2f')](_0x500c90[_0xacee('0x2e')]);_0x13e794[_0xacee('0x30')]=_[_0xacee('0x31')](_0x13e794[_0xacee('0x2d')],_0x13e794[_0xacee('0x2e')]);_0x1b5acf[_0xacee('0x32')]=_['intersection'](_0x13e794[_0xacee('0x2d')],qs[_0xacee('0x33')](_0x500c90[_0xacee('0x2e')][_0xacee('0x33')]));_0x1b5acf[_0xacee('0x32')]=_0x1b5acf['attributes'][_0xacee('0x34')]?_0x1b5acf[_0xacee('0x32')]:_0x13e794['model'];if(!_0x500c90[_0xacee('0x2e')][_0xacee('0x35')](_0xacee('0x36'))){_0x1b5acf[_0xacee('0x1c')]=qs[_0xacee('0x1c')](_0x500c90[_0xacee('0x2e')][_0xacee('0x1c')]);_0x1b5acf[_0xacee('0x1b')]=qs[_0xacee('0x1b')](_0x500c90[_0xacee('0x2e')]['offset']);}_0x1b5acf[_0xacee('0x37')]=qs[_0xacee('0x38')](_0x500c90['query'][_0xacee('0x38')]);_0x1b5acf[_0xacee('0x39')]=qs['filters'](_[_0xacee('0x3a')](_0x500c90[_0xacee('0x2e')],_0x13e794[_0xacee('0x30')]),_0x2d878f);if(_0x500c90[_0xacee('0x2e')]['filter']){_0x1b5acf[_0xacee('0x39')]=_[_0xacee('0x3b')](_0x1b5acf['where'],{'$or':_[_0xacee('0x28')](_0x2d878f,function(_0x36451c){if(_0x36451c[_0xacee('0x2b')]!=='VIRTUAL'){var _0x4778d2={};_0x4778d2[_0x36451c[_0xacee('0x26')]]={'$like':'%'+_0x500c90['query'][_0xacee('0x3c')]+'%'};return _0x4778d2;}})});}_0x1b5acf=_[_0xacee('0x3b')]({},_0x1b5acf,_0x500c90['options']);var _0x10a61e={'where':_0x1b5acf[_0xacee('0x39')]};return db[_0xacee('0x3d')]['count'](_0x10a61e)[_0xacee('0x22')](function(_0x297bb0){_0xcdfd43[_0xacee('0x1a')]=_0x297bb0;if(_0x500c90['query']['includeAll']){_0x1b5acf[_0xacee('0x3e')]=[{'all':!![]}];}return db['VtigerField']['findAll'](_0x1b5acf);})[_0xacee('0x22')](function(_0x1a4b54){_0xcdfd43[_0xacee('0x3f')]=_0x1a4b54;return _0xcdfd43;})['then'](respondWithFilteredResult(_0x2e0359,_0x1b5acf))[_0xacee('0x40')](handleError(_0x2e0359,null));};exports[_0xacee('0x41')]=function(_0x5ffd3e,_0x3d18c9){var _0x11be7f={'raw':!![],'where':{'id':_0x5ffd3e[_0xacee('0x42')]['id']}},_0x4e720b={};_0x4e720b['model']=_['keys'](db[_0xacee('0x3d')]['rawAttributes']);_0x4e720b[_0xacee('0x2e')]=_[_0xacee('0x2f')](_0x5ffd3e[_0xacee('0x2e')]);_0x4e720b[_0xacee('0x30')]=_[_0xacee('0x31')](_0x4e720b['model'],_0x4e720b['query']);_0x11be7f[_0xacee('0x32')]=_[_0xacee('0x31')](_0x4e720b['model'],qs[_0xacee('0x33')](_0x5ffd3e[_0xacee('0x2e')]['fields']));_0x11be7f['attributes']=_0x11be7f['attributes']['length']?_0x11be7f[_0xacee('0x32')]:_0x4e720b[_0xacee('0x2d')];if(_0x5ffd3e[_0xacee('0x2e')][_0xacee('0x43')]){_0x11be7f[_0xacee('0x3e')]=[{'all':!![]}];}_0x11be7f=_[_0xacee('0x3b')]({},_0x11be7f,_0x5ffd3e[_0xacee('0x44')]);return db[_0xacee('0x3d')][_0xacee('0x45')](_0x11be7f)[_0xacee('0x22')](handleEntityNotFound(_0x3d18c9,null))[_0xacee('0x22')](respondWithResult(_0x3d18c9,null))[_0xacee('0x40')](handleError(_0x3d18c9,null));};exports[_0xacee('0x46')]=function(_0x27ec1a,_0x45d395){return db[_0xacee('0x3d')][_0xacee('0x46')](_0x27ec1a[_0xacee('0x47')],{})['then'](respondWithResult(_0x45d395,0xc9))['catch'](handleError(_0x45d395,null));};exports[_0xacee('0x48')]=function(_0x131126,_0x5ddee6){if(_0x131126[_0xacee('0x47')]['id']){delete _0x131126[_0xacee('0x47')]['id'];}return db['VtigerField'][_0xacee('0x45')]({'where':{'id':_0x131126[_0xacee('0x42')]['id']}})[_0xacee('0x22')](handleEntityNotFound(_0x5ddee6,null))[_0xacee('0x22')](saveUpdates(_0x131126[_0xacee('0x47')],null))[_0xacee('0x22')](respondWithResult(_0x5ddee6,null))[_0xacee('0x40')](handleError(_0x5ddee6,null));};exports[_0xacee('0x49')]=function(_0x4ddbdf,_0x29f820){return db[_0xacee('0x3d')]['find']({'where':{'id':_0x4ddbdf[_0xacee('0x42')]['id']}})[_0xacee('0x22')](handleEntityNotFound(_0x29f820,null))['then'](removeEntity(_0x29f820,null))[_0xacee('0x40')](handleError(_0x29f820,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index d302b5f..fa9589d 100644 --- a/server/api/intVtigerField/intVtigerField.model.js +++ b/server/api/intVtigerField/intVtigerField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2466=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./intVtigerField.attributes','exports','VtigerField','int_vtiger_fields','vtiger_unique_index','lodash','util'];(function(_0x3b2a34,_0x55027c){var _0x3304cd=function(_0x22b55e){while(--_0x22b55e){_0x3b2a34['push'](_0x3b2a34['shift']());}};_0x3304cd(++_0x55027c);}(_0x2466,0x80));var _0x6246=function(_0x402708,_0x15901c){_0x402708=_0x402708-0x0;var _0x3630b4=_0x2466[_0x402708];return _0x3630b4;};'use strict';var _=require(_0x6246('0x0'));var util=require(_0x6246('0x1'));var logger=require(_0x6246('0x2'))('api');var moment=require(_0x6246('0x3'));var BPromise=require(_0x6246('0x4'));var rp=require(_0x6246('0x5'));var fs=require('fs');var path=require(_0x6246('0x6'));var rimraf=require('rimraf');var config=require(_0x6246('0x7'));var attributes=require(_0x6246('0x8'));module[_0x6246('0x9')]=function(_0x54fd30,_0x2bcd98){return _0x54fd30['define'](_0x6246('0xa'),attributes,{'tableName':_0x6246('0xb'),'paranoid':![],'indexes':[{'name':_0x6246('0xc'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xad5c=['exports','define','vtiger_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intVtigerField.attributes'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0xad5c,0x19b));var _0xcad5=function(_0x3ca187,_0x3883f7){_0x3ca187=_0x3ca187-0x0;var _0x39deb3=_0xad5c[_0x3ca187];return _0x39deb3;};'use strict';var _=require('lodash');var util=require(_0xcad5('0x0'));var logger=require(_0xcad5('0x1'))(_0xcad5('0x2'));var moment=require(_0xcad5('0x3'));var BPromise=require(_0xcad5('0x4'));var rp=require(_0xcad5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcad5('0x6'));var config=require(_0xcad5('0x7'));var attributes=require(_0xcad5('0x8'));module[_0xcad5('0x9')]=function(_0x142689,_0x2498f9){return _0x142689[_0xcad5('0xa')]('VtigerField',attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0xcad5('0xb'),'fields':[_0xcad5('0xc'),_0xcad5('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 78feb5f..d2f13b9 100644 --- a/server/api/intVtigerField/intVtigerField.rpc.js +++ b/server/api/intVtigerField/intVtigerField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfab0=['result','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','http','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','code','error','message'];(function(_0x320800,_0x1ddb58){var _0x1cbdf3=function(_0x49a114){while(--_0x49a114){_0x320800['push'](_0x320800['shift']());}};_0x1cbdf3(++_0x1ddb58);}(_0xfab0,0x157));var _0x0fab=function(_0x3f4450,_0xfaf1a8){_0x3f4450=_0x3f4450-0x0;var _0x492655=_0xfab0[_0x3f4450];return _0x492655;};'use strict';var _=require(_0x0fab('0x0'));var util=require('util');var moment=require(_0x0fab('0x1'));var BPromise=require('bluebird');var rs=require(_0x0fab('0x2'));var fs=require('fs');var Redis=require(_0x0fab('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0fab('0x4'));var logger=require(_0x0fab('0x5'))(_0x0fab('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x0fab('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4bb58a,_0x4b102b,_0x17f311){return new BPromise(function(_0x358658,_0x3855f6){return client['request'](_0x4bb58a,_0x17f311)['then'](function(_0x17289b){logger[_0x0fab('0x8')](_0x0fab('0x9'),_0x4b102b,_0x0fab('0xa'));logger[_0x0fab('0xb')](_0x0fab('0xc'),_0x4b102b,_0x0fab('0xa'),JSON[_0x0fab('0xd')](_0x17289b));if(_0x17289b['error']){if(_0x17289b['error'][_0x0fab('0xe')]===0x1f4){logger[_0x0fab('0xf')]('VtigerField,\x20%s,\x20%s',_0x4b102b,_0x17289b[_0x0fab('0xf')][_0x0fab('0x10')]);return _0x3855f6(_0x17289b[_0x0fab('0xf')][_0x0fab('0x10')]);}logger[_0x0fab('0xf')]('VtigerField,\x20%s,\x20%s',_0x4b102b,_0x17289b[_0x0fab('0xf')][_0x0fab('0x10')]);return _0x358658(_0x17289b['error'][_0x0fab('0x10')]);}else{logger['info'](_0x0fab('0x9'),_0x4b102b,_0x0fab('0xa'));_0x358658(_0x17289b[_0x0fab('0x11')][_0x0fab('0x10')]);}})['catch'](function(_0x35fe2c){logger[_0x0fab('0xf')](_0x0fab('0x9'),_0x4b102b,_0x35fe2c);_0x3855f6(_0x35fe2c);});});} \ No newline at end of file +var _0xccee=['request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','VtigerField,\x20%s,\x20%s'];(function(_0x329833,_0x4b2ddc){var _0x51f73b=function(_0x1e4e4e){while(--_0x1e4e4e){_0x329833['push'](_0x329833['shift']());}};_0x51f73b(++_0x4b2ddc);}(_0xccee,0x13b));var _0xecce=function(_0x2b3191,_0x1b195c){_0x2b3191=_0x2b3191-0x0;var _0x54bd93=_0xccee[_0x2b3191];return _0x54bd93;};'use strict';var _=require(_0xecce('0x0'));var util=require(_0xecce('0x1'));var moment=require(_0xecce('0x2'));var BPromise=require(_0xecce('0x3'));var rs=require(_0xecce('0x4'));var fs=require('fs');var Redis=require(_0xecce('0x5'));var db=require(_0xecce('0x6'))['db'];var utils=require(_0xecce('0x7'));var logger=require(_0xecce('0x8'))('rpc');var config=require(_0xecce('0x9'));var jayson=require(_0xecce('0xa'));var client=jayson[_0xecce('0xb')][_0xecce('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2dd796,_0xd9a69,_0x381aaa){return new BPromise(function(_0x5c6824,_0x533e33){return client['request'](_0x2dd796,_0x381aaa)['then'](function(_0x590ff5){logger[_0xecce('0xd')](_0xecce('0xe'),_0xd9a69,'request\x20sent');logger['debug']('VtigerField,\x20%s,\x20%s,\x20%s',_0xd9a69,_0xecce('0xf'),JSON[_0xecce('0x10')](_0x590ff5));if(_0x590ff5[_0xecce('0x11')]){if(_0x590ff5[_0xecce('0x11')][_0xecce('0x12')]===0x1f4){logger['error'](_0xecce('0xe'),_0xd9a69,_0x590ff5[_0xecce('0x11')][_0xecce('0x13')]);return _0x533e33(_0x590ff5[_0xecce('0x11')]['message']);}logger[_0xecce('0x11')](_0xecce('0xe'),_0xd9a69,_0x590ff5[_0xecce('0x11')][_0xecce('0x13')]);return _0x5c6824(_0x590ff5['error'][_0xecce('0x13')]);}else{logger['info'](_0xecce('0xe'),_0xd9a69,_0xecce('0xf'));_0x5c6824(_0x590ff5[_0xecce('0x14')][_0xecce('0x13')]);}})[_0xecce('0x15')](function(_0x9d3d52){logger[_0xecce('0x11')]('VtigerField,\x20%s,\x20%s',_0xd9a69,_0x9d3d52);_0x533e33(_0x9d3d52);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 18f24fa..6f698e2 100644 --- a/server/api/intZendeskAccount/index.js +++ b/server/api/intZendeskAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9030=['put','/:id','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration'];(function(_0x5b47ed,_0x30abf4){var _0x5cae85=function(_0x423031){while(--_0x423031){_0x5b47ed['push'](_0x5b47ed['shift']());}};_0x5cae85(++_0x30abf4);}(_0x9030,0x121));var _0x0903=function(_0x2631e4,_0x23616a){_0x2631e4=_0x2631e4-0x0;var _0x476a06=_0x9030[_0x2631e4];return _0x476a06;};'use strict';var multer=require(_0x0903('0x0'));var util=require(_0x0903('0x1'));var path=require(_0x0903('0x2'));var timeout=require(_0x0903('0x3'));var express=require('express');var router=express[_0x0903('0x4')]();var fs_extra=require(_0x0903('0x5'));var auth=require(_0x0903('0x6'));var interaction=require(_0x0903('0x7'));var config=require(_0x0903('0x8'));var controller=require(_0x0903('0x9'));router[_0x0903('0xa')]('/',auth[_0x0903('0xb')](),controller[_0x0903('0xc')]);router[_0x0903('0xa')]('/:id',auth[_0x0903('0xb')](),controller['show']);router[_0x0903('0xa')](_0x0903('0xd'),auth['isAuthenticated'](),controller[_0x0903('0xe')]);router[_0x0903('0xa')](_0x0903('0xf'),auth[_0x0903('0xb')](),controller['getFields']);router[_0x0903('0x10')]('/',auth[_0x0903('0xb')](),controller[_0x0903('0x11')]);router['post'](_0x0903('0xd'),auth[_0x0903('0xb')](),controller[_0x0903('0x12')]);router[_0x0903('0x13')](_0x0903('0x14'),auth[_0x0903('0xb')](),controller['update']);router[_0x0903('0x15')](_0x0903('0x14'),auth[_0x0903('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xba46=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','/:id/fields','post','create','addConfiguration','put','update','delete','exports','multer'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xba46,0x141));var _0x6ba4=function(_0x67242b,_0x37230c){_0x67242b=_0x67242b-0x0;var _0xa7329c=_0xba46[_0x67242b];return _0xa7329c;};'use strict';var multer=require(_0x6ba4('0x0'));var util=require(_0x6ba4('0x1'));var path=require(_0x6ba4('0x2'));var timeout=require(_0x6ba4('0x3'));var express=require(_0x6ba4('0x4'));var router=express[_0x6ba4('0x5')]();var fs_extra=require(_0x6ba4('0x6'));var auth=require(_0x6ba4('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x6ba4('0x8'));var controller=require(_0x6ba4('0x9'));router[_0x6ba4('0xa')]('/',auth[_0x6ba4('0xb')](),controller[_0x6ba4('0xc')]);router[_0x6ba4('0xa')](_0x6ba4('0xd'),auth[_0x6ba4('0xb')](),controller['show']);router[_0x6ba4('0xa')](_0x6ba4('0xe'),auth[_0x6ba4('0xb')](),controller['getConfigurations']);router[_0x6ba4('0xa')](_0x6ba4('0xf'),auth[_0x6ba4('0xb')](),controller['getFields']);router[_0x6ba4('0x10')]('/',auth[_0x6ba4('0xb')](),controller[_0x6ba4('0x11')]);router[_0x6ba4('0x10')](_0x6ba4('0xe'),auth['isAuthenticated'](),controller[_0x6ba4('0x12')]);router[_0x6ba4('0x13')]('/:id',auth[_0x6ba4('0xb')](),controller[_0x6ba4('0x14')]);router[_0x6ba4('0x15')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x6ba4('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index c16072c..31bb271 100644 --- a/server/api/intZendeskAccount/intZendeskAccount.attributes.js +++ b/server/api/intZendeskAccount/intZendeskAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9e69=['exports','STRING','remoteUri','ENUM','password','newTab','integrationTab'];(function(_0x15cae3,_0x458cb9){var _0x20596f=function(_0x1ad3e6){while(--_0x1ad3e6){_0x15cae3['push'](_0x15cae3['shift']());}};_0x20596f(++_0x458cb9);}(_0x9e69,0x150));var _0x99e6=function(_0x553182,_0x32a593){_0x553182=_0x553182-0x0;var _0x23c76e=_0x9e69[_0x553182];return _0x23c76e;};'use strict';var Sequelize=require('sequelize');module[_0x99e6('0x0')]={'name':{'type':Sequelize[_0x99e6('0x1')]},'description':{'type':Sequelize[_0x99e6('0x1')]},'username':{'type':Sequelize[_0x99e6('0x1')],'unique':'username'},'password':{'type':Sequelize[_0x99e6('0x1')]},'token':{'type':Sequelize[_0x99e6('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x99e6('0x2')},'authType':{'type':Sequelize[_0x99e6('0x3')](_0x99e6('0x4'),'token'),'defaultValue':_0x99e6('0x4')},'serverUrl':{'type':Sequelize[_0x99e6('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x99e6('0x3')]('integrationTab',_0x99e6('0x5')),'defaultValue':_0x99e6('0x6')}}; \ No newline at end of file +var _0xd481=['username','remoteUri','password','token','ENUM','integrationTab','newTab','sequelize','STRING'];(function(_0x47ae1f,_0x328d68){var _0x2a0233=function(_0x53dd41){while(--_0x53dd41){_0x47ae1f['push'](_0x47ae1f['shift']());}};_0x2a0233(++_0x328d68);}(_0xd481,0x1e4));var _0x1d48=function(_0x3e8055,_0x564968){_0x3e8055=_0x3e8055-0x0;var _0x25f5f4=_0xd481[_0x3e8055];return _0x25f5f4;};'use strict';var Sequelize=require(_0x1d48('0x0'));module['exports']={'name':{'type':Sequelize[_0x1d48('0x1')]},'description':{'type':Sequelize[_0x1d48('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x1d48('0x2')},'password':{'type':Sequelize[_0x1d48('0x1')]},'token':{'type':Sequelize[_0x1d48('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x1d48('0x3')},'authType':{'type':Sequelize['ENUM'](_0x1d48('0x4'),_0x1d48('0x5')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0x1d48('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1d48('0x6')](_0x1d48('0x7'),_0x1d48('0x8')),'defaultValue':_0x1d48('0x7')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index a73d750..fdd55d1 100644 --- a/server/api/intZendeskAccount/intZendeskAccount.controller.js +++ b/server/api/intZendeskAccount/intZendeskAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbdb7=['rawAttributes','fieldName','type','key','query','keys','model','attributes','fields','order','sort','where','filters','pick','filter','merge','VIRTUAL','ZendeskAccount','include','findAll','rows','intersection','length','includeAll','options','catch','create','body','update','find','params','destroy','getConfigurations','hasOwnProperty','nolimit','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskConfiguration','ZendeskField','getFields','password','authType','remoteUri','substring','GET','format','headers','%s:%s','username','toString','base64','Basic\x20%s','%s/token:%s','token','Unknown\x20authentication\x20type','subject','group','assignee','ticket_fields','position','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','sendStatus','error','name','send','index','map'];(function(_0x1a043b,_0x4d540a){var _0x105ff5=function(_0x49532e){while(--_0x49532e){_0x1a043b['push'](_0x1a043b['shift']());}};_0x105ff5(++_0x4d540a);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x5d6448,_0x53522f){_0x5d6448=_0x5d6448-0x0;var _0x58c195=_0xbdb7[_0x5d6448];return _0x58c195;};'use strict';var emlformat=require(_0x7bdb('0x0'));var rimraf=require(_0x7bdb('0x1'));var zipdir=require(_0x7bdb('0x2'));var jsonpatch=require(_0x7bdb('0x3'));var rp=require(_0x7bdb('0x4'));var moment=require(_0x7bdb('0x5'));var BPromise=require(_0x7bdb('0x6'));var Mustache=require(_0x7bdb('0x7'));var util=require(_0x7bdb('0x8'));var path=require('path');var sox=require(_0x7bdb('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7bdb('0xa'));var _=require(_0x7bdb('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7bdb('0xc'));var deskjs=require(_0x7bdb('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7bdb('0xe'));var Redis=require(_0x7bdb('0xf'));var authService=require(_0x7bdb('0x10'));var qs=require(_0x7bdb('0x11'));var as=require(_0x7bdb('0x12'));var hardwareService=require(_0x7bdb('0x13'));var logger=require(_0x7bdb('0x14'))(_0x7bdb('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7bdb('0x16'))['db'];var integrations=require(_0x7bdb('0x17'));function respondWithStatusCode(_0x496613,_0x8d74ff){_0x8d74ff=_0x8d74ff||0xcc;return function(_0x53021d){if(_0x53021d){return _0x496613['sendStatus'](_0x8d74ff);}return _0x496613[_0x7bdb('0x18')](_0x8d74ff)[_0x7bdb('0x19')]();};}function respondWithResult(_0x4fd91a,_0x50eeca){_0x50eeca=_0x50eeca||0xc8;return function(_0x4e98f7){if(_0x4e98f7){return _0x4fd91a[_0x7bdb('0x18')](_0x50eeca)[_0x7bdb('0x1a')](_0x4e98f7);}};}function respondWithFilteredResult(_0xe9919f,_0x25d417){return function(_0x31c909){if(_0x31c909){var _0xbde12a=typeof _0x25d417[_0x7bdb('0x1b')]===_0x7bdb('0x1c')&&typeof _0x25d417['limit']===_0x7bdb('0x1c');var _0x43f352=_0x31c909[_0x7bdb('0x1d')];var _0x2aff6a=_0xbde12a?0x0:_0x25d417['offset'];var _0x41f540=_0xbde12a?_0x31c909[_0x7bdb('0x1d')]:_0x25d417['offset']+_0x25d417[_0x7bdb('0x1e')];var _0x31f78e;if(_0x41f540>=_0x43f352){_0x41f540=_0x43f352;_0x31f78e=0xc8;}else{_0x31f78e=0xce;}_0xe9919f[_0x7bdb('0x18')](_0x31f78e);return _0xe9919f[_0x7bdb('0x1f')](_0x7bdb('0x20'),_0x2aff6a+'-'+_0x41f540+'/'+_0x43f352)['json'](_0x31c909);}return null;};}function patchUpdates(_0x49f353){return function(_0x677825){try{jsonpatch[_0x7bdb('0x21')](_0x677825,_0x49f353,!![]);}catch(_0x5daea4){return BPromise[_0x7bdb('0x22')](_0x5daea4);}return _0x677825[_0x7bdb('0x23')]();};}function saveUpdates(_0x346c72,_0x3f53e7){return function(_0x3a1d0f){if(_0x3a1d0f){return _0x3a1d0f['update'](_0x346c72)[_0x7bdb('0x24')](function(_0xdad53d){return _0xdad53d;});}return null;};}function removeEntity(_0x40c447,_0x3a456f){return function(_0x481f4b){if(_0x481f4b){return _0x481f4b['destroy']()[_0x7bdb('0x24')](function(){_0x40c447['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a9e02,_0x2abef6){return function(_0x51ab04){if(!_0x51ab04){_0x4a9e02[_0x7bdb('0x25')](0x194);}return _0x51ab04;};}function handleError(_0x72ba69,_0x3ec129){_0x3ec129=_0x3ec129||0x1f4;return function(_0x7c09cf){logger[_0x7bdb('0x26')](_0x7c09cf['stack']);if(_0x7c09cf[_0x7bdb('0x27')]){delete _0x7c09cf[_0x7bdb('0x27')];}_0x72ba69[_0x7bdb('0x18')](_0x3ec129)[_0x7bdb('0x28')](_0x7c09cf);};}exports[_0x7bdb('0x29')]=function(_0x2e8e65,_0x1e9996){var _0xd2d7be={},_0x25a1fe={},_0x365c02={'count':0x0,'rows':[]};var _0x9ec48d=_[_0x7bdb('0x2a')](db['ZendeskAccount'][_0x7bdb('0x2b')],function(_0x23fc3a){return{'name':_0x23fc3a[_0x7bdb('0x2c')],'type':_0x23fc3a[_0x7bdb('0x2d')][_0x7bdb('0x2e')]};});_0x25a1fe['model']=_[_0x7bdb('0x2a')](_0x9ec48d,_0x7bdb('0x27'));_0x25a1fe[_0x7bdb('0x2f')]=_[_0x7bdb('0x30')](_0x2e8e65['query']);_0x25a1fe['filters']=_['intersection'](_0x25a1fe[_0x7bdb('0x31')],_0x25a1fe['query']);_0xd2d7be[_0x7bdb('0x32')]=_['intersection'](_0x25a1fe[_0x7bdb('0x31')],qs[_0x7bdb('0x33')](_0x2e8e65[_0x7bdb('0x2f')]['fields']));_0xd2d7be[_0x7bdb('0x32')]=_0xd2d7be['attributes']['length']?_0xd2d7be[_0x7bdb('0x32')]:_0x25a1fe['model'];if(!_0x2e8e65[_0x7bdb('0x2f')]['hasOwnProperty']('nolimit')){_0xd2d7be[_0x7bdb('0x1e')]=qs[_0x7bdb('0x1e')](_0x2e8e65[_0x7bdb('0x2f')][_0x7bdb('0x1e')]);_0xd2d7be[_0x7bdb('0x1b')]=qs[_0x7bdb('0x1b')](_0x2e8e65['query'][_0x7bdb('0x1b')]);}_0xd2d7be[_0x7bdb('0x34')]=qs[_0x7bdb('0x35')](_0x2e8e65[_0x7bdb('0x2f')][_0x7bdb('0x35')]);_0xd2d7be[_0x7bdb('0x36')]=qs[_0x7bdb('0x37')](_[_0x7bdb('0x38')](_0x2e8e65[_0x7bdb('0x2f')],_0x25a1fe['filters']),_0x9ec48d);if(_0x2e8e65['query'][_0x7bdb('0x39')]){_0xd2d7be[_0x7bdb('0x36')]=_[_0x7bdb('0x3a')](_0xd2d7be[_0x7bdb('0x36')],{'$or':_[_0x7bdb('0x2a')](_0x9ec48d,function(_0x509e90){if(_0x509e90['type']!==_0x7bdb('0x3b')){var _0x5d7c1f={};_0x5d7c1f[_0x509e90[_0x7bdb('0x27')]]={'$like':'%'+_0x2e8e65['query'][_0x7bdb('0x39')]+'%'};return _0x5d7c1f;}})});}_0xd2d7be=_['merge']({},_0xd2d7be,_0x2e8e65['options']);var _0x21dae7={'where':_0xd2d7be[_0x7bdb('0x36')]};return db[_0x7bdb('0x3c')][_0x7bdb('0x1d')](_0x21dae7)[_0x7bdb('0x24')](function(_0x2b4829){_0x365c02[_0x7bdb('0x1d')]=_0x2b4829;if(_0x2e8e65['query']['includeAll']){_0xd2d7be[_0x7bdb('0x3d')]=[{'all':!![]}];}return db[_0x7bdb('0x3c')][_0x7bdb('0x3e')](_0xd2d7be);})[_0x7bdb('0x24')](function(_0x39fbca){_0x365c02[_0x7bdb('0x3f')]=_0x39fbca;return _0x365c02;})[_0x7bdb('0x24')](respondWithFilteredResult(_0x1e9996,_0xd2d7be))['catch'](handleError(_0x1e9996,null));};exports['show']=function(_0x1bcbcd,_0x8e893e){var _0x4636f8={'raw':![],'where':{'id':_0x1bcbcd['params']['id']}},_0x72a81c={};_0x72a81c[_0x7bdb('0x31')]=_['keys'](db[_0x7bdb('0x3c')][_0x7bdb('0x2b')]);_0x72a81c[_0x7bdb('0x2f')]=_[_0x7bdb('0x30')](_0x1bcbcd[_0x7bdb('0x2f')]);_0x72a81c[_0x7bdb('0x37')]=_[_0x7bdb('0x40')](_0x72a81c[_0x7bdb('0x31')],_0x72a81c[_0x7bdb('0x2f')]);_0x4636f8['attributes']=_[_0x7bdb('0x40')](_0x72a81c[_0x7bdb('0x31')],qs['fields'](_0x1bcbcd[_0x7bdb('0x2f')]['fields']));_0x4636f8[_0x7bdb('0x32')]=_0x4636f8[_0x7bdb('0x32')][_0x7bdb('0x41')]?_0x4636f8[_0x7bdb('0x32')]:_0x72a81c[_0x7bdb('0x31')];if(_0x1bcbcd['query'][_0x7bdb('0x42')]){_0x4636f8[_0x7bdb('0x3d')]=[{'all':!![]}];}_0x4636f8=_[_0x7bdb('0x3a')]({},_0x4636f8,_0x1bcbcd[_0x7bdb('0x43')]);return db[_0x7bdb('0x3c')]['find'](_0x4636f8)[_0x7bdb('0x24')](handleEntityNotFound(_0x8e893e,null))[_0x7bdb('0x24')](respondWithResult(_0x8e893e,null))[_0x7bdb('0x44')](handleError(_0x8e893e,null));};exports[_0x7bdb('0x45')]=function(_0x259007,_0x25c534){return db[_0x7bdb('0x3c')][_0x7bdb('0x45')](_0x259007[_0x7bdb('0x46')],{})[_0x7bdb('0x24')](respondWithResult(_0x25c534,0xc9))['catch'](handleError(_0x25c534,null));};exports[_0x7bdb('0x47')]=function(_0x58c4bc,_0x47cccd){if(_0x58c4bc[_0x7bdb('0x46')]['id']){delete _0x58c4bc[_0x7bdb('0x46')]['id'];}return db['ZendeskAccount'][_0x7bdb('0x48')]({'where':{'id':_0x58c4bc[_0x7bdb('0x49')]['id']}})['then'](handleEntityNotFound(_0x47cccd,null))['then'](saveUpdates(_0x58c4bc['body'],null))[_0x7bdb('0x24')](respondWithResult(_0x47cccd,null))[_0x7bdb('0x44')](handleError(_0x47cccd,null));};exports[_0x7bdb('0x4a')]=function(_0x46410c,_0x33687b){return db[_0x7bdb('0x3c')][_0x7bdb('0x48')]({'where':{'id':_0x46410c[_0x7bdb('0x49')]['id']}})[_0x7bdb('0x24')](handleEntityNotFound(_0x33687b,null))[_0x7bdb('0x24')](removeEntity(_0x33687b,null))['catch'](handleError(_0x33687b,null));};exports[_0x7bdb('0x4b')]=function(_0x4806e0,_0x240425,_0x27358d){var _0x5d564d={};var _0x457886={};var _0x493d23;var _0x258f29;return db['ZendeskAccount']['findOne']({'where':{'id':_0x4806e0[_0x7bdb('0x49')]['id']}})[_0x7bdb('0x24')](handleEntityNotFound(_0x240425,null))['then'](function(_0x4e17f3){if(_0x4e17f3){_0x493d23=_0x4e17f3;_0x457886['model']=_[_0x7bdb('0x30')](db['ZendeskConfiguration']['rawAttributes']);_0x457886[_0x7bdb('0x2f')]=_[_0x7bdb('0x30')](_0x4806e0[_0x7bdb('0x2f')]);_0x457886[_0x7bdb('0x37')]=_['intersection'](_0x457886[_0x7bdb('0x31')],_0x457886['query']);_0x5d564d[_0x7bdb('0x32')]=_[_0x7bdb('0x40')](_0x457886[_0x7bdb('0x31')],qs[_0x7bdb('0x33')](_0x4806e0[_0x7bdb('0x2f')][_0x7bdb('0x33')]));_0x5d564d['attributes']=_0x5d564d[_0x7bdb('0x32')][_0x7bdb('0x41')]?_0x5d564d[_0x7bdb('0x32')]:_0x457886['model'];_0x5d564d[_0x7bdb('0x34')]=qs[_0x7bdb('0x35')](_0x4806e0['query'][_0x7bdb('0x35')]);_0x5d564d['where']=qs[_0x7bdb('0x37')](_[_0x7bdb('0x38')](_0x4806e0['query'],_0x457886['filters']));if(_0x4806e0[_0x7bdb('0x2f')][_0x7bdb('0x39')]){_0x5d564d['where']=_[_0x7bdb('0x3a')](_0x5d564d['where'],{'$or':_[_0x7bdb('0x2a')](_0x5d564d['attributes'],function(_0x496cc3){var _0x22ef9c={};_0x22ef9c[_0x496cc3]={'$like':'%'+_0x4806e0[_0x7bdb('0x2f')][_0x7bdb('0x39')]+'%'};return _0x22ef9c;})});}_0x5d564d=_[_0x7bdb('0x3a')]({},_0x5d564d,_0x4806e0[_0x7bdb('0x43')]);return _0x493d23[_0x7bdb('0x4b')](_0x5d564d);}})[_0x7bdb('0x24')](function(_0x8cf13a){if(_0x8cf13a){_0x258f29=_0x8cf13a[_0x7bdb('0x41')];if(!_0x4806e0[_0x7bdb('0x2f')][_0x7bdb('0x4c')](_0x7bdb('0x4d'))){_0x5d564d['limit']=qs[_0x7bdb('0x1e')](_0x4806e0[_0x7bdb('0x2f')]['limit']);_0x5d564d[_0x7bdb('0x1b')]=qs[_0x7bdb('0x1b')](_0x4806e0[_0x7bdb('0x2f')][_0x7bdb('0x1b')]);}return _0x493d23[_0x7bdb('0x4b')](_0x5d564d);}})['then'](function(_0xa5624f){if(_0xa5624f){return _0xa5624f?{'count':_0x258f29,'rows':_0xa5624f}:null;}})[_0x7bdb('0x24')](respondWithResult(_0x240425,null))[_0x7bdb('0x44')](handleError(_0x240425,null));};exports['addConfiguration']=function(_0x3dbcf,_0x2c2fb7,_0x33b93a){if(_0x3dbcf[_0x7bdb('0x46')]['id']){delete _0x3dbcf[_0x7bdb('0x46')]['id'];}return db[_0x7bdb('0x3c')][_0x7bdb('0x4e')]({'where':{'id':_0x3dbcf[_0x7bdb('0x49')]['id']}})[_0x7bdb('0x24')](handleEntityNotFound(_0x2c2fb7,null))['then'](function(_0x7a7c4a){if(_0x7a7c4a){_0x3dbcf[_0x7bdb('0x46')][_0x7bdb('0x4f')]=_0x7a7c4a['id'];_0x3dbcf[_0x7bdb('0x46')][_0x7bdb('0x50')]=integrations[_0x7bdb('0x51')](_0x3dbcf[_0x7bdb('0x46')][_0x7bdb('0x52')],_0x3dbcf[_0x7bdb('0x46')][_0x7bdb('0x2d')]);_0x3dbcf[_0x7bdb('0x46')][_0x7bdb('0x53')]=integrations[_0x7bdb('0x54')](_0x3dbcf['body'][_0x7bdb('0x52')],_0x3dbcf['body'][_0x7bdb('0x2d')]);return db[_0x7bdb('0x55')][_0x7bdb('0x45')](_0x3dbcf['body'],{'include':[{'model':db[_0x7bdb('0x56')],'as':_0x7bdb('0x50')},{'model':db['ZendeskField'],'as':_0x7bdb('0x53')}]});}return null;})[_0x7bdb('0x24')](respondWithResult(_0x2c2fb7,null))['catch'](handleError(_0x2c2fb7,null));};exports[_0x7bdb('0x57')]=function(_0x1a706b,_0x579caa,_0x291fd3){var _0x237688='';return db['ZendeskAccount'][_0x7bdb('0x4e')]({'where':{'id':_0x1a706b[_0x7bdb('0x49')]['id']},'attributes':['id','username',_0x7bdb('0x58'),'token',_0x7bdb('0x59'),_0x7bdb('0x5a')]})[_0x7bdb('0x24')](handleEntityNotFound(_0x579caa,null))[_0x7bdb('0x24')](function(_0x1e5063){if(_0x1e5063){_0x237688=_0x1e5063['remoteUri'];var _0x590818=_0x237688['slice'](-0x1);if(_0x590818==='/'){_0x237688=_0x237688[_0x7bdb('0x5b')](0x0,_0x237688['lastIndexOf'](_0x590818));}var _0x242a35={'method':_0x7bdb('0x5c'),'uri':util[_0x7bdb('0x5d')]('%s/%s',_0x237688,'ticket_fields'),'json':!![]};switch(_0x1e5063[_0x7bdb('0x59')]){case _0x7bdb('0x58'):_0x242a35[_0x7bdb('0x5e')]={'Authorization':util[_0x7bdb('0x5d')]('Basic\x20%s',new Buffer(util[_0x7bdb('0x5d')](_0x7bdb('0x5f'),_0x1e5063[_0x7bdb('0x60')],_0x1e5063[_0x7bdb('0x58')]))[_0x7bdb('0x61')](_0x7bdb('0x62')))};break;case'token':_0x242a35[_0x7bdb('0x5e')]={'Authorization':util['format'](_0x7bdb('0x63'),new Buffer(util['format'](_0x7bdb('0x64'),_0x1e5063[_0x7bdb('0x60')],_0x1e5063[_0x7bdb('0x65')]))[_0x7bdb('0x61')](_0x7bdb('0x62')))};break;default:throw new db['Sequelize']['ValidationError'](_0x7bdb('0x66'));}return rp(_0x242a35);}})[_0x7bdb('0x24')](function(_0x51fec5){if(_0x51fec5){var _0x415ec5=[_0x7bdb('0x67'),'description',_0x7bdb('0x68'),_0x7bdb('0x69')];_['remove'](_0x51fec5[_0x7bdb('0x6a')],function(_0x493c69){return _0x415ec5['includes'](_0x493c69[_0x7bdb('0x2d')]);});return{'count':_0x51fec5[_0x7bdb('0x6a')]['length'],'rows':_['map'](_0x51fec5[_0x7bdb('0x6a')],function(_0x566a9e){return{'id':_0x566a9e['id'],'name':_0x566a9e[_0x7bdb('0x6b')]>0x7?_0x566a9e['title']:_0x566a9e[_0x7bdb('0x2d')],'custom':_0x566a9e[_0x7bdb('0x6b')]>0x7?!![]:![],'options':_0x566a9e[_0x7bdb('0x6c')]?_0x566a9e[_0x7bdb('0x6c')]:_0x566a9e['custom_field_options']?_0x566a9e[_0x7bdb('0x6d')]:[]};})};}})[_0x7bdb('0x24')](respondWithResult(_0x579caa,null))['catch'](function(_0x2be441){var _0x3096e0=_0x1a706b['query'][_0x7bdb('0x6e')]?0x1f4:_0x2be441[_0x7bdb('0x6f')]||0x1f4;logger[_0x7bdb('0x26')](_0x7bdb('0x70'),'getFields',_0x3096e0,JSON[_0x7bdb('0x71')](_0x2be441));delete _0x2be441['name'];if(_0x3096e0===0x191){_0x3096e0=0x190;}_0x579caa[_0x7bdb('0x18')](_0x3096e0)[_0x7bdb('0x28')](_0x1a706b[_0x7bdb('0x2f')]['test']?{'message':_0x7bdb('0x72'),'statusCode':_0x2be441[_0x7bdb('0x6f')]}:_0x2be441);});}; \ No newline at end of file +var _0xa571=['lastIndexOf','GET','format','%s/%s','ticket_fields','headers','%s:%s','password','toString','base64','Basic\x20%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','options','ZendeskAccount','includeAll','include','findAll','rows','catch','show','params','find','create','body','findOne','ZendeskConfiguration','order','merge','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','getDescriptions','channel','ZendeskField','Descriptions','getFields','username','token','authType','remoteUri','slice','substring'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xa571,0x107));var _0x1a57=function(_0x29ab8e,_0x67c0c1){_0x29ab8e=_0x29ab8e-0x0;var _0xc602a3=_0xa571[_0x29ab8e];return _0xc602a3;};'use strict';var emlformat=require(_0x1a57('0x0'));var rimraf=require(_0x1a57('0x1'));var zipdir=require(_0x1a57('0x2'));var jsonpatch=require(_0x1a57('0x3'));var rp=require('request-promise');var moment=require(_0x1a57('0x4'));var BPromise=require(_0x1a57('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1a57('0x6'));var sox=require('sox');var csv=require(_0x1a57('0x7'));var ejs=require(_0x1a57('0x8'));var fs=require('fs');var fs_extra=require(_0x1a57('0x9'));var _=require(_0x1a57('0xa'));var squel=require(_0x1a57('0xb'));var crypto=require(_0x1a57('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1a57('0xd'));var toCsv=require(_0x1a57('0x7'));var querystring=require(_0x1a57('0xe'));var Papa=require('papaparse');var Redis=require(_0x1a57('0xf'));var authService=require(_0x1a57('0x10'));var qs=require(_0x1a57('0x11'));var as=require(_0x1a57('0x12'));var hardwareService=require(_0x1a57('0x13'));var logger=require(_0x1a57('0x14'))(_0x1a57('0x15'));var utils=require(_0x1a57('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1a57('0x17'))['db'];var integrations=require(_0x1a57('0x18'));function respondWithStatusCode(_0x202d9a,_0x5ae643){_0x5ae643=_0x5ae643||0xcc;return function(_0x3de36a){if(_0x3de36a){return _0x202d9a[_0x1a57('0x19')](_0x5ae643);}return _0x202d9a['status'](_0x5ae643)[_0x1a57('0x1a')]();};}function respondWithResult(_0x587422,_0xd08107){_0xd08107=_0xd08107||0xc8;return function(_0x17434c){if(_0x17434c){return _0x587422[_0x1a57('0x1b')](_0xd08107)[_0x1a57('0x1c')](_0x17434c);}};}function respondWithFilteredResult(_0x5802d6,_0x20f7ad){return function(_0x53c61f){if(_0x53c61f){var _0x49ee05=typeof _0x20f7ad[_0x1a57('0x1d')]===_0x1a57('0x1e')&&typeof _0x20f7ad[_0x1a57('0x1f')]==='undefined';var _0x10793e=_0x53c61f[_0x1a57('0x20')];var _0x80f8c1=_0x49ee05?0x0:_0x20f7ad['offset'];var _0x3daa66=_0x49ee05?_0x53c61f[_0x1a57('0x20')]:_0x20f7ad[_0x1a57('0x1d')]+_0x20f7ad[_0x1a57('0x1f')];var _0xe936dd;if(_0x3daa66>=_0x10793e){_0x3daa66=_0x10793e;_0xe936dd=0xc8;}else{_0xe936dd=0xce;}_0x5802d6['status'](_0xe936dd);return _0x5802d6['set'](_0x1a57('0x21'),_0x80f8c1+'-'+_0x3daa66+'/'+_0x10793e)[_0x1a57('0x1c')](_0x53c61f);}return null;};}function patchUpdates(_0x211c63){return function(_0x4d3e05){try{jsonpatch['apply'](_0x4d3e05,_0x211c63,!![]);}catch(_0x51e271){return BPromise[_0x1a57('0x22')](_0x51e271);}return _0x4d3e05[_0x1a57('0x23')]();};}function saveUpdates(_0x3f52b9,_0xee133b){return function(_0x277d06){if(_0x277d06){return _0x277d06[_0x1a57('0x24')](_0x3f52b9)[_0x1a57('0x25')](function(_0x2f8b00){return _0x2f8b00;});}return null;};}function removeEntity(_0x183ca3,_0x35d5dc){return function(_0x29e7cd){if(_0x29e7cd){return _0x29e7cd[_0x1a57('0x26')]()[_0x1a57('0x25')](function(){_0x183ca3[_0x1a57('0x1b')](0xcc)[_0x1a57('0x1a')]();});}};}function handleEntityNotFound(_0x182649,_0x25c1e9){return function(_0x267302){if(!_0x267302){_0x182649[_0x1a57('0x19')](0x194);}return _0x267302;};}function handleError(_0xf6ffef,_0x26584b){_0x26584b=_0x26584b||0x1f4;return function(_0x1dd939){logger['error'](_0x1dd939['stack']);if(_0x1dd939[_0x1a57('0x27')]){delete _0x1dd939[_0x1a57('0x27')];}_0xf6ffef['status'](_0x26584b)[_0x1a57('0x28')](_0x1dd939);};}exports['index']=function(_0x2d8738,_0x4a2901){var _0x53bf6e={},_0x8179a4={},_0x274fe6={'count':0x0,'rows':[]};var _0x30527c=_[_0x1a57('0x29')](db['ZendeskAccount'][_0x1a57('0x2a')],function(_0x396832){return{'name':_0x396832[_0x1a57('0x2b')],'type':_0x396832[_0x1a57('0x2c')]['key']};});_0x8179a4[_0x1a57('0x2d')]=_[_0x1a57('0x29')](_0x30527c,_0x1a57('0x27'));_0x8179a4[_0x1a57('0x2e')]=_[_0x1a57('0x2f')](_0x2d8738[_0x1a57('0x2e')]);_0x8179a4[_0x1a57('0x30')]=_[_0x1a57('0x31')](_0x8179a4[_0x1a57('0x2d')],_0x8179a4['query']);_0x53bf6e[_0x1a57('0x32')]=_[_0x1a57('0x31')](_0x8179a4['model'],qs['fields'](_0x2d8738[_0x1a57('0x2e')][_0x1a57('0x33')]));_0x53bf6e[_0x1a57('0x32')]=_0x53bf6e[_0x1a57('0x32')][_0x1a57('0x34')]?_0x53bf6e[_0x1a57('0x32')]:_0x8179a4[_0x1a57('0x2d')];if(!_0x2d8738[_0x1a57('0x2e')][_0x1a57('0x35')](_0x1a57('0x36'))){_0x53bf6e[_0x1a57('0x1f')]=qs[_0x1a57('0x1f')](_0x2d8738[_0x1a57('0x2e')][_0x1a57('0x1f')]);_0x53bf6e[_0x1a57('0x1d')]=qs[_0x1a57('0x1d')](_0x2d8738[_0x1a57('0x2e')][_0x1a57('0x1d')]);}_0x53bf6e['order']=qs[_0x1a57('0x37')](_0x2d8738[_0x1a57('0x2e')][_0x1a57('0x37')]);_0x53bf6e[_0x1a57('0x38')]=qs[_0x1a57('0x30')](_[_0x1a57('0x39')](_0x2d8738[_0x1a57('0x2e')],_0x8179a4[_0x1a57('0x30')]),_0x30527c);if(_0x2d8738[_0x1a57('0x2e')]['filter']){_0x53bf6e['where']=_['merge'](_0x53bf6e['where'],{'$or':_[_0x1a57('0x29')](_0x30527c,function(_0x14d619){if(_0x14d619[_0x1a57('0x2c')]!=='VIRTUAL'){var _0x364797={};_0x364797[_0x14d619[_0x1a57('0x27')]]={'$like':'%'+_0x2d8738[_0x1a57('0x2e')][_0x1a57('0x3a')]+'%'};return _0x364797;}})});}_0x53bf6e=_['merge']({},_0x53bf6e,_0x2d8738[_0x1a57('0x3b')]);var _0x5e79f0={'where':_0x53bf6e[_0x1a57('0x38')]};return db[_0x1a57('0x3c')][_0x1a57('0x20')](_0x5e79f0)['then'](function(_0x1848cc){_0x274fe6[_0x1a57('0x20')]=_0x1848cc;if(_0x2d8738[_0x1a57('0x2e')][_0x1a57('0x3d')]){_0x53bf6e[_0x1a57('0x3e')]=[{'all':!![]}];}return db['ZendeskAccount'][_0x1a57('0x3f')](_0x53bf6e);})['then'](function(_0x4ba6b3){_0x274fe6[_0x1a57('0x40')]=_0x4ba6b3;return _0x274fe6;})['then'](respondWithFilteredResult(_0x4a2901,_0x53bf6e))[_0x1a57('0x41')](handleError(_0x4a2901,null));};exports[_0x1a57('0x42')]=function(_0x3fbae1,_0x59abb1){var _0x188a50={'raw':![],'where':{'id':_0x3fbae1[_0x1a57('0x43')]['id']}},_0x3c7ea8={};_0x3c7ea8[_0x1a57('0x2d')]=_['keys'](db[_0x1a57('0x3c')][_0x1a57('0x2a')]);_0x3c7ea8['query']=_[_0x1a57('0x2f')](_0x3fbae1['query']);_0x3c7ea8['filters']=_[_0x1a57('0x31')](_0x3c7ea8[_0x1a57('0x2d')],_0x3c7ea8[_0x1a57('0x2e')]);_0x188a50[_0x1a57('0x32')]=_['intersection'](_0x3c7ea8[_0x1a57('0x2d')],qs[_0x1a57('0x33')](_0x3fbae1[_0x1a57('0x2e')][_0x1a57('0x33')]));_0x188a50[_0x1a57('0x32')]=_0x188a50['attributes'][_0x1a57('0x34')]?_0x188a50[_0x1a57('0x32')]:_0x3c7ea8[_0x1a57('0x2d')];if(_0x3fbae1[_0x1a57('0x2e')]['includeAll']){_0x188a50[_0x1a57('0x3e')]=[{'all':!![]}];}_0x188a50=_['merge']({},_0x188a50,_0x3fbae1[_0x1a57('0x3b')]);return db[_0x1a57('0x3c')][_0x1a57('0x44')](_0x188a50)[_0x1a57('0x25')](handleEntityNotFound(_0x59abb1,null))[_0x1a57('0x25')](respondWithResult(_0x59abb1,null))[_0x1a57('0x41')](handleError(_0x59abb1,null));};exports[_0x1a57('0x45')]=function(_0x401285,_0x29fe1f){return db[_0x1a57('0x3c')][_0x1a57('0x45')](_0x401285[_0x1a57('0x46')],{})[_0x1a57('0x25')](respondWithResult(_0x29fe1f,0xc9))['catch'](handleError(_0x29fe1f,null));};exports[_0x1a57('0x24')]=function(_0x480aff,_0x3bf103){if(_0x480aff[_0x1a57('0x46')]['id']){delete _0x480aff[_0x1a57('0x46')]['id'];}return db[_0x1a57('0x3c')][_0x1a57('0x44')]({'where':{'id':_0x480aff[_0x1a57('0x43')]['id']}})[_0x1a57('0x25')](handleEntityNotFound(_0x3bf103,null))[_0x1a57('0x25')](saveUpdates(_0x480aff[_0x1a57('0x46')],null))['then'](respondWithResult(_0x3bf103,null))[_0x1a57('0x41')](handleError(_0x3bf103,null));};exports[_0x1a57('0x26')]=function(_0x51651d,_0x15f1f5){return db[_0x1a57('0x3c')]['find']({'where':{'id':_0x51651d[_0x1a57('0x43')]['id']}})[_0x1a57('0x25')](handleEntityNotFound(_0x15f1f5,null))['then'](removeEntity(_0x15f1f5,null))['catch'](handleError(_0x15f1f5,null));};exports['getConfigurations']=function(_0x2c1bac,_0x41465b,_0x509c4f){var _0x1ec79c={};var _0x18267c={};var _0x572202;var _0x5e510e;return db['ZendeskAccount'][_0x1a57('0x47')]({'where':{'id':_0x2c1bac[_0x1a57('0x43')]['id']}})[_0x1a57('0x25')](handleEntityNotFound(_0x41465b,null))[_0x1a57('0x25')](function(_0x28738e){if(_0x28738e){_0x572202=_0x28738e;_0x18267c[_0x1a57('0x2d')]=_[_0x1a57('0x2f')](db[_0x1a57('0x48')]['rawAttributes']);_0x18267c['query']=_['keys'](_0x2c1bac['query']);_0x18267c['filters']=_[_0x1a57('0x31')](_0x18267c[_0x1a57('0x2d')],_0x18267c[_0x1a57('0x2e')]);_0x1ec79c[_0x1a57('0x32')]=_[_0x1a57('0x31')](_0x18267c[_0x1a57('0x2d')],qs[_0x1a57('0x33')](_0x2c1bac[_0x1a57('0x2e')]['fields']));_0x1ec79c['attributes']=_0x1ec79c['attributes'][_0x1a57('0x34')]?_0x1ec79c['attributes']:_0x18267c[_0x1a57('0x2d')];_0x1ec79c[_0x1a57('0x49')]=qs[_0x1a57('0x37')](_0x2c1bac[_0x1a57('0x2e')][_0x1a57('0x37')]);_0x1ec79c[_0x1a57('0x38')]=qs[_0x1a57('0x30')](_['pick'](_0x2c1bac['query'],_0x18267c['filters']));if(_0x2c1bac[_0x1a57('0x2e')][_0x1a57('0x3a')]){_0x1ec79c[_0x1a57('0x38')]=_[_0x1a57('0x4a')](_0x1ec79c[_0x1a57('0x38')],{'$or':_[_0x1a57('0x29')](_0x1ec79c[_0x1a57('0x32')],function(_0x4ab246){var _0x5b691c={};_0x5b691c[_0x4ab246]={'$like':'%'+_0x2c1bac[_0x1a57('0x2e')][_0x1a57('0x3a')]+'%'};return _0x5b691c;})});}_0x1ec79c=_[_0x1a57('0x4a')]({},_0x1ec79c,_0x2c1bac[_0x1a57('0x3b')]);return _0x572202[_0x1a57('0x4b')](_0x1ec79c);}})[_0x1a57('0x25')](function(_0x59a731){if(_0x59a731){_0x5e510e=_0x59a731['length'];if(!_0x2c1bac[_0x1a57('0x2e')][_0x1a57('0x35')]('nolimit')){_0x1ec79c['limit']=qs[_0x1a57('0x1f')](_0x2c1bac[_0x1a57('0x2e')][_0x1a57('0x1f')]);_0x1ec79c[_0x1a57('0x1d')]=qs[_0x1a57('0x1d')](_0x2c1bac[_0x1a57('0x2e')][_0x1a57('0x1d')]);}return _0x572202['getConfigurations'](_0x1ec79c);}})['then'](function(_0x2fbf49){if(_0x2fbf49){return _0x2fbf49?{'count':_0x5e510e,'rows':_0x2fbf49}:null;}})[_0x1a57('0x25')](respondWithResult(_0x41465b,null))[_0x1a57('0x41')](handleError(_0x41465b,null));};exports[_0x1a57('0x4c')]=function(_0x5d92dc,_0x33092d,_0x28354c){if(_0x5d92dc[_0x1a57('0x46')]['id']){delete _0x5d92dc[_0x1a57('0x46')]['id'];}return db[_0x1a57('0x3c')]['findOne']({'where':{'id':_0x5d92dc['params']['id']}})['then'](handleEntityNotFound(_0x33092d,null))[_0x1a57('0x25')](function(_0x223ba5){if(_0x223ba5){_0x5d92dc[_0x1a57('0x46')][_0x1a57('0x4d')]=_0x223ba5['id'];_0x5d92dc[_0x1a57('0x46')][_0x1a57('0x4e')]=integrations[_0x1a57('0x4f')](_0x5d92dc[_0x1a57('0x46')]['channel'],_0x5d92dc[_0x1a57('0x46')][_0x1a57('0x2c')]);_0x5d92dc['body']['Descriptions']=integrations[_0x1a57('0x50')](_0x5d92dc['body'][_0x1a57('0x51')],_0x5d92dc[_0x1a57('0x46')][_0x1a57('0x2c')]);return db[_0x1a57('0x48')][_0x1a57('0x45')](_0x5d92dc[_0x1a57('0x46')],{'include':[{'model':db[_0x1a57('0x52')],'as':_0x1a57('0x4e')},{'model':db['ZendeskField'],'as':_0x1a57('0x53')}]});}return null;})[_0x1a57('0x25')](respondWithResult(_0x33092d,null))['catch'](handleError(_0x33092d,null));};exports[_0x1a57('0x54')]=function(_0x392f49,_0x20b0d5,_0x570674){var _0x5c3eb8='';return db[_0x1a57('0x3c')][_0x1a57('0x47')]({'where':{'id':_0x392f49[_0x1a57('0x43')]['id']},'attributes':['id',_0x1a57('0x55'),'password',_0x1a57('0x56'),_0x1a57('0x57'),_0x1a57('0x58')]})[_0x1a57('0x25')](handleEntityNotFound(_0x20b0d5,null))[_0x1a57('0x25')](function(_0x58d8cc){if(_0x58d8cc){_0x5c3eb8=_0x58d8cc[_0x1a57('0x58')];var _0x393187=_0x5c3eb8[_0x1a57('0x59')](-0x1);if(_0x393187==='/'){_0x5c3eb8=_0x5c3eb8[_0x1a57('0x5a')](0x0,_0x5c3eb8[_0x1a57('0x5b')](_0x393187));}var _0x69f3fb={'method':_0x1a57('0x5c'),'uri':util[_0x1a57('0x5d')](_0x1a57('0x5e'),_0x5c3eb8,_0x1a57('0x5f')),'json':!![]};switch(_0x58d8cc[_0x1a57('0x57')]){case'password':_0x69f3fb[_0x1a57('0x60')]={'Authorization':util[_0x1a57('0x5d')]('Basic\x20%s',new Buffer(util[_0x1a57('0x5d')](_0x1a57('0x61'),_0x58d8cc['username'],_0x58d8cc[_0x1a57('0x62')]))[_0x1a57('0x63')](_0x1a57('0x64')))};break;case _0x1a57('0x56'):_0x69f3fb[_0x1a57('0x60')]={'Authorization':util[_0x1a57('0x5d')](_0x1a57('0x65'),new Buffer(util[_0x1a57('0x5d')]('%s/token:%s',_0x58d8cc[_0x1a57('0x55')],_0x58d8cc[_0x1a57('0x56')]))['toString'](_0x1a57('0x64')))};break;default:throw new db[(_0x1a57('0x66'))][(_0x1a57('0x67'))](_0x1a57('0x68'));}return rp(_0x69f3fb);}})[_0x1a57('0x25')](function(_0xf2b1c5){if(_0xf2b1c5){var _0x220725=[_0x1a57('0x69'),_0x1a57('0x6a'),'group',_0x1a57('0x6b')];_[_0x1a57('0x6c')](_0xf2b1c5[_0x1a57('0x5f')],function(_0x1e4d4e){return _0x220725[_0x1a57('0x6d')](_0x1e4d4e['type']);});return{'count':_0xf2b1c5[_0x1a57('0x5f')][_0x1a57('0x34')],'rows':_[_0x1a57('0x29')](_0xf2b1c5[_0x1a57('0x5f')],function(_0x33f8da){return{'id':_0x33f8da['id'],'name':_0x33f8da[_0x1a57('0x6e')]>0x7?_0x33f8da[_0x1a57('0x6f')]:_0x33f8da[_0x1a57('0x2c')],'custom':_0x33f8da['position']>0x7?!![]:![],'options':_0x33f8da[_0x1a57('0x70')]?_0x33f8da[_0x1a57('0x70')]:_0x33f8da[_0x1a57('0x71')]?_0x33f8da[_0x1a57('0x71')]:[]};})};}})['then'](respondWithResult(_0x20b0d5,null))['catch'](function(_0x49f809){var _0x57cd92=_0x392f49['query'][_0x1a57('0x72')]?0x1f4:_0x49f809[_0x1a57('0x73')]||0x1f4;logger['error'](_0x1a57('0x74'),_0x1a57('0x54'),_0x57cd92,JSON['stringify'](_0x49f809));delete _0x49f809[_0x1a57('0x27')];if(_0x57cd92===0x191){_0x57cd92=0x190;}_0x20b0d5[_0x1a57('0x1b')](_0x57cd92)[_0x1a57('0x28')](_0x392f49[_0x1a57('0x2e')]['test']?{'message':_0x1a57('0x75'),'statusCode':_0x49f809[_0x1a57('0x73')]}:_0x49f809);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index afb1c74..0fd7538 100644 --- a/server/api/intZendeskAccount/intZendeskAccount.model.js +++ b/server/api/intZendeskAccount/intZendeskAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe841=['ZendeskAccount','int_zendesk_accounts','lodash','api','bluebird','request-promise','path','rimraf','./intZendeskAccount.attributes','../../components/integrations/configuration'];(function(_0x5c28c5,_0x5c8d08){var _0x3793f6=function(_0x51782d){while(--_0x51782d){_0x5c28c5['push'](_0x5c28c5['shift']());}};_0x3793f6(++_0x5c8d08);}(_0xe841,0xc0));var _0x1e84=function(_0x487f1b,_0x438726){_0x487f1b=_0x487f1b-0x0;var _0x13162a=_0xe841[_0x487f1b];return _0x13162a;};'use strict';var _=require(_0x1e84('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1e84('0x1'));var moment=require('moment');var BPromise=require(_0x1e84('0x2'));var rp=require(_0x1e84('0x3'));var fs=require('fs');var path=require(_0x1e84('0x4'));var rimraf=require(_0x1e84('0x5'));var config=require('../../config/environment');var attributes=require(_0x1e84('0x6'));var integrations=require(_0x1e84('0x7'));module['exports']=function(_0x72a71a,_0x3e273c){return _0x72a71a['define'](_0x1e84('0x8'),attributes,{'tableName':_0x1e84('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb2cb=['./intZendeskAccount.attributes','../../components/integrations/configuration','exports','int_zendesk_accounts','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x248a6c,_0x468caa){var _0x1af77e=function(_0x3f18f6){while(--_0x3f18f6){_0x248a6c['push'](_0x248a6c['shift']());}};_0x1af77e(++_0x468caa);}(_0xb2cb,0x9e));var _0xbb2c=function(_0x2f8530,_0x5cbd67){_0x2f8530=_0x2f8530-0x0;var _0x5e814e=_0xb2cb[_0x2f8530];return _0x5e814e;};'use strict';var _=require('lodash');var util=require(_0xbb2c('0x0'));var logger=require(_0xbb2c('0x1'))(_0xbb2c('0x2'));var moment=require(_0xbb2c('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb2c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbb2c('0x5'));var config=require(_0xbb2c('0x6'));var attributes=require(_0xbb2c('0x7'));var integrations=require(_0xbb2c('0x8'));module[_0xbb2c('0x9')]=function(_0x47ff43,_0x66ba14){return _0x47ff43['define']('ZendeskAccount',attributes,{'tableName':_0xbb2c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index 39b72fb..18389f0 100644 --- a/server/api/intZendeskAccount/intZendeskAccount.rpc.js +++ b/server/api/intZendeskAccount/intZendeskAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0f37=['debug','stringify','find','raw','ShowZendeskAccount','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','ZendeskAccount,\x20%s,\x20%s','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','GetZendeskAccount','ZendeskAccount','findAll','options','where','attributes','limit','include','model','map','then'];(function(_0x5a1d99,_0x5bbd4f){var _0x21d39c=function(_0x2b3eda){while(--_0x2b3eda){_0x5a1d99['push'](_0x5a1d99['shift']());}};_0x21d39c(++_0x5bbd4f);}(_0x0f37,0x191));var _0x70f3=function(_0x258257,_0x32042d){_0x258257=_0x258257-0x0;var _0xafb58a=_0x0f37[_0x258257];return _0xafb58a;};'use strict';var _=require('lodash');var util=require(_0x70f3('0x0'));var moment=require('moment');var BPromise=require(_0x70f3('0x1'));var rs=require(_0x70f3('0x2'));var fs=require('fs');var Redis=require(_0x70f3('0x3'));var db=require(_0x70f3('0x4'))['db'];var utils=require(_0x70f3('0x5'));var logger=require(_0x70f3('0x6'))(_0x70f3('0x7'));var config=require(_0x70f3('0x8'));var jayson=require(_0x70f3('0x9'));var client=jayson[_0x70f3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31ae64,_0x3cbf59,_0x513385){return new BPromise(function(_0x4fe47e,_0x12adc2){return client[_0x70f3('0xb')](_0x31ae64,_0x513385)['then'](function(_0x3133a0){logger['info'](_0x70f3('0xc'),_0x3cbf59,_0x70f3('0xd'));logger['debug'](_0x70f3('0xe'),_0x3cbf59,_0x70f3('0xd'),JSON['stringify'](_0x3133a0));if(_0x3133a0['error']){if(_0x3133a0[_0x70f3('0xf')][_0x70f3('0x10')]===0x1f4){logger[_0x70f3('0xf')]('ZendeskAccount,\x20%s,\x20%s',_0x3cbf59,_0x3133a0[_0x70f3('0xf')][_0x70f3('0x11')]);return _0x12adc2(_0x3133a0[_0x70f3('0xf')][_0x70f3('0x11')]);}logger['error'](_0x70f3('0xc'),_0x3cbf59,_0x3133a0['error'][_0x70f3('0x11')]);return _0x4fe47e(_0x3133a0[_0x70f3('0xf')]['message']);}else{logger[_0x70f3('0x12')](_0x70f3('0xc'),_0x3cbf59,_0x70f3('0xd'));_0x4fe47e(_0x3133a0['result'][_0x70f3('0x11')]);}})[_0x70f3('0x13')](function(_0x45e20f){logger['error'](_0x70f3('0xc'),_0x3cbf59,_0x45e20f);_0x12adc2(_0x45e20f);});});}exports[_0x70f3('0x14')]=function(_0x38b705){var _0x34c74a=this;return new Promise(function(_0x3bda81,_0x3035b2){return db[_0x70f3('0x15')][_0x70f3('0x16')]({'raw':_0x38b705[_0x70f3('0x17')]?_0x38b705['options']['raw']===undefined?!![]:![]:!![],'where':_0x38b705['options']?_0x38b705['options'][_0x70f3('0x18')]||null:null,'attributes':_0x38b705[_0x70f3('0x17')]?_0x38b705[_0x70f3('0x17')][_0x70f3('0x19')]||null:null,'limit':_0x38b705[_0x70f3('0x17')]?_0x38b705[_0x70f3('0x17')][_0x70f3('0x1a')]||null:null,'include':_0x38b705['options']?_0x38b705[_0x70f3('0x17')]['include']?_['map'](_0x38b705['options'][_0x70f3('0x1b')],function(_0x327f11){return{'model':db[_0x327f11[_0x70f3('0x1c')]],'as':_0x327f11['as'],'attributes':_0x327f11[_0x70f3('0x19')],'include':_0x327f11[_0x70f3('0x1b')]?_[_0x70f3('0x1d')](_0x327f11[_0x70f3('0x1b')],function(_0x159b8c){return{'model':db[_0x159b8c['model']],'as':_0x159b8c['as'],'attributes':_0x159b8c[_0x70f3('0x19')],'include':_0x159b8c[_0x70f3('0x1b')]?_['map'](_0x159b8c[_0x70f3('0x1b')],function(_0x40f356){return{'model':db[_0x40f356['model']],'as':_0x40f356['as'],'attributes':_0x40f356[_0x70f3('0x19')]};}):[]};}):[]};}):[]:[]})[_0x70f3('0x1e')](function(_0x7920f0){logger[_0x70f3('0x12')](_0x70f3('0x14'),_0x38b705);logger[_0x70f3('0x1f')](_0x70f3('0x14'),_0x38b705,JSON[_0x70f3('0x20')](_0x7920f0));_0x3bda81(_0x7920f0);})[_0x70f3('0x13')](function(_0xf8c169){logger[_0x70f3('0xf')](_0x70f3('0x14'),_0xf8c169['message'],_0x38b705);_0x3035b2(_0x34c74a['error'](0x1f4,_0xf8c169[_0x70f3('0x11')]));});});};exports['ShowZendeskAccount']=function(_0x5a06aa){var _0x2079bf=this;return new Promise(function(_0x3abeee,_0x5c0af3){return db[_0x70f3('0x15')][_0x70f3('0x21')]({'raw':_0x5a06aa[_0x70f3('0x17')]?_0x5a06aa[_0x70f3('0x17')][_0x70f3('0x22')]===undefined?!![]:![]:!![],'where':_0x5a06aa[_0x70f3('0x17')]?_0x5a06aa[_0x70f3('0x17')][_0x70f3('0x18')]||null:null,'attributes':_0x5a06aa[_0x70f3('0x17')]?_0x5a06aa[_0x70f3('0x17')]['attributes']||null:null,'include':_0x5a06aa[_0x70f3('0x17')]?_0x5a06aa[_0x70f3('0x17')][_0x70f3('0x1b')]?_['map'](_0x5a06aa[_0x70f3('0x17')]['include'],function(_0x16b9f4){return{'model':db[_0x16b9f4['model']],'as':_0x16b9f4['as'],'attributes':_0x16b9f4[_0x70f3('0x19')],'include':_0x16b9f4[_0x70f3('0x1b')]?_['map'](_0x16b9f4['include'],function(_0x27c393){return{'model':db[_0x27c393['model']],'as':_0x27c393['as'],'attributes':_0x27c393[_0x70f3('0x19')],'include':_0x27c393['include']?_[_0x70f3('0x1d')](_0x27c393[_0x70f3('0x1b')],function(_0x50fd5f){return{'model':db[_0x50fd5f['model']],'as':_0x50fd5f['as'],'attributes':_0x50fd5f['attributes']};}):[]};}):[]};}):[]:[]})[_0x70f3('0x1e')](function(_0x387c92){logger[_0x70f3('0x12')](_0x70f3('0x23'),_0x5a06aa);logger[_0x70f3('0x1f')](_0x70f3('0x23'),_0x5a06aa,JSON['stringify'](_0x387c92));_0x3abeee(_0x387c92);})[_0x70f3('0x13')](function(_0x5e1ce4){logger['error'](_0x70f3('0x23'),_0x5e1ce4[_0x70f3('0x11')],_0x5a06aa);_0x5c0af3(_0x2079bf['error'](0x1f4,_0x5e1ce4['message']));});});}; \ No newline at end of file +var _0x14f9=['message','info','result','catch','ZendeskAccount','options','raw','where','attributes','map','include','model','GetZendeskAccount','ShowZendeskAccount','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4d901d,_0x2fdfa9){var _0x3ce385=function(_0x578e4b){while(--_0x578e4b){_0x4d901d['push'](_0x4d901d['shift']());}};_0x3ce385(++_0x2fdfa9);}(_0x14f9,0xda));var _0x914f=function(_0xa3535a,_0x18b8bd){_0xa3535a=_0xa3535a-0x0;var _0x353c7a=_0x14f9[_0xa3535a];return _0x353c7a;};'use strict';var _=require('lodash');var util=require(_0x914f('0x0'));var moment=require(_0x914f('0x1'));var BPromise=require('bluebird');var rs=require(_0x914f('0x2'));var fs=require('fs');var Redis=require(_0x914f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x914f('0x4'));var logger=require(_0x914f('0x5'))(_0x914f('0x6'));var config=require(_0x914f('0x7'));var jayson=require(_0x914f('0x8'));var client=jayson[_0x914f('0x9')][_0x914f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6cde6c,_0x5f07cb,_0x3d441d){return new BPromise(function(_0x51097f,_0x13e7d8){return client[_0x914f('0xb')](_0x6cde6c,_0x3d441d)[_0x914f('0xc')](function(_0x2276a6){logger['info'](_0x914f('0xd'),_0x5f07cb,_0x914f('0xe'));logger[_0x914f('0xf')](_0x914f('0x10'),_0x5f07cb,_0x914f('0xe'),JSON[_0x914f('0x11')](_0x2276a6));if(_0x2276a6['error']){if(_0x2276a6[_0x914f('0x12')][_0x914f('0x13')]===0x1f4){logger[_0x914f('0x12')](_0x914f('0xd'),_0x5f07cb,_0x2276a6[_0x914f('0x12')][_0x914f('0x14')]);return _0x13e7d8(_0x2276a6['error']['message']);}logger[_0x914f('0x12')]('ZendeskAccount,\x20%s,\x20%s',_0x5f07cb,_0x2276a6[_0x914f('0x12')][_0x914f('0x14')]);return _0x51097f(_0x2276a6['error'][_0x914f('0x14')]);}else{logger[_0x914f('0x15')](_0x914f('0xd'),_0x5f07cb,_0x914f('0xe'));_0x51097f(_0x2276a6[_0x914f('0x16')]['message']);}})[_0x914f('0x17')](function(_0x550752){logger[_0x914f('0x12')](_0x914f('0xd'),_0x5f07cb,_0x550752);_0x13e7d8(_0x550752);});});}exports['GetZendeskAccount']=function(_0x276989){var _0x3473b9=this;return new Promise(function(_0x2d916a,_0x1c4689){return db[_0x914f('0x18')]['findAll']({'raw':_0x276989[_0x914f('0x19')]?_0x276989[_0x914f('0x19')][_0x914f('0x1a')]===undefined?!![]:![]:!![],'where':_0x276989['options']?_0x276989[_0x914f('0x19')][_0x914f('0x1b')]||null:null,'attributes':_0x276989[_0x914f('0x19')]?_0x276989[_0x914f('0x19')][_0x914f('0x1c')]||null:null,'limit':_0x276989[_0x914f('0x19')]?_0x276989[_0x914f('0x19')]['limit']||null:null,'include':_0x276989[_0x914f('0x19')]?_0x276989['options']['include']?_[_0x914f('0x1d')](_0x276989[_0x914f('0x19')][_0x914f('0x1e')],function(_0x3a78f9){return{'model':db[_0x3a78f9['model']],'as':_0x3a78f9['as'],'attributes':_0x3a78f9['attributes'],'include':_0x3a78f9[_0x914f('0x1e')]?_[_0x914f('0x1d')](_0x3a78f9[_0x914f('0x1e')],function(_0x2f9f0a){return{'model':db[_0x2f9f0a[_0x914f('0x1f')]],'as':_0x2f9f0a['as'],'attributes':_0x2f9f0a[_0x914f('0x1c')],'include':_0x2f9f0a['include']?_[_0x914f('0x1d')](_0x2f9f0a[_0x914f('0x1e')],function(_0x814007){return{'model':db[_0x814007['model']],'as':_0x814007['as'],'attributes':_0x814007[_0x914f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x914f('0xc')](function(_0x3ac9a1){logger[_0x914f('0x15')](_0x914f('0x20'),_0x276989);logger[_0x914f('0xf')](_0x914f('0x20'),_0x276989,JSON[_0x914f('0x11')](_0x3ac9a1));_0x2d916a(_0x3ac9a1);})['catch'](function(_0x4fb4b9){logger[_0x914f('0x12')]('GetZendeskAccount',_0x4fb4b9['message'],_0x276989);_0x1c4689(_0x3473b9[_0x914f('0x12')](0x1f4,_0x4fb4b9['message']));});});};exports[_0x914f('0x21')]=function(_0x50f319){var _0x4745ce=this;return new Promise(function(_0x3d5c38,_0x57392e){return db[_0x914f('0x18')]['find']({'raw':_0x50f319[_0x914f('0x19')]?_0x50f319[_0x914f('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x50f319[_0x914f('0x19')]?_0x50f319[_0x914f('0x19')][_0x914f('0x1b')]||null:null,'attributes':_0x50f319['options']?_0x50f319[_0x914f('0x19')]['attributes']||null:null,'include':_0x50f319[_0x914f('0x19')]?_0x50f319[_0x914f('0x19')]['include']?_[_0x914f('0x1d')](_0x50f319[_0x914f('0x19')][_0x914f('0x1e')],function(_0x19e553){return{'model':db[_0x19e553['model']],'as':_0x19e553['as'],'attributes':_0x19e553[_0x914f('0x1c')],'include':_0x19e553[_0x914f('0x1e')]?_['map'](_0x19e553[_0x914f('0x1e')],function(_0xc4923e){return{'model':db[_0xc4923e[_0x914f('0x1f')]],'as':_0xc4923e['as'],'attributes':_0xc4923e['attributes'],'include':_0xc4923e[_0x914f('0x1e')]?_[_0x914f('0x1d')](_0xc4923e[_0x914f('0x1e')],function(_0x46db2c){return{'model':db[_0x46db2c[_0x914f('0x1f')]],'as':_0x46db2c['as'],'attributes':_0x46db2c['attributes']};}):[]};}):[]};}):[]:[]})[_0x914f('0xc')](function(_0x32c746){logger[_0x914f('0x15')](_0x914f('0x21'),_0x50f319);logger[_0x914f('0xf')](_0x914f('0x21'),_0x50f319,JSON[_0x914f('0x11')](_0x32c746));_0x3d5c38(_0x32c746);})[_0x914f('0x17')](function(_0x11ebb9){logger['error'](_0x914f('0x21'),_0x11ebb9[_0x914f('0x14')],_0x50f319);_0x57392e(_0x4745ce[_0x914f('0x12')](0x1f4,_0x11ebb9[_0x914f('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 59bf4f6..17d1e19 100644 --- a/server/api/intZendeskConfiguration/index.js +++ b/server/api/intZendeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac4a=['../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','isAuthenticated','get','show','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','setTags','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x58d0de,_0x4141db){var _0x418d6c=function(_0x596c6d){while(--_0x596c6d){_0x58d0de['push'](_0x58d0de['shift']());}};_0x418d6c(++_0x4141db);}(_0xac4a,0x13f));var _0xaac4=function(_0x428bf2,_0x5829fd){_0x428bf2=_0x428bf2-0x0;var _0x1728d1=_0xac4a[_0x428bf2];return _0x1728d1;};'use strict';var multer=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var path=require(_0xaac4('0x2'));var timeout=require(_0xaac4('0x3'));var express=require(_0xaac4('0x4'));var router=express[_0xaac4('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xaac4('0x6'));var config=require(_0xaac4('0x7'));var controller=require(_0xaac4('0x8'));router['get']('/',auth[_0xaac4('0x9')](),controller['index']);router[_0xaac4('0xa')]('/:id',auth[_0xaac4('0x9')](),controller[_0xaac4('0xb')]);router['get']('/:id/fields',auth[_0xaac4('0x9')](),controller['getFields']);router[_0xaac4('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xaac4('0xc')]);router[_0xaac4('0xa')](_0xaac4('0xd'),auth[_0xaac4('0x9')](),controller[_0xaac4('0xe')]);router['get']('/:id/tags',auth[_0xaac4('0x9')](),controller[_0xaac4('0xf')]);router[_0xaac4('0x10')]('/',auth['isAuthenticated'](),controller[_0xaac4('0x11')]);router[_0xaac4('0x10')]('/:id/tags',auth[_0xaac4('0x9')](),controller[_0xaac4('0x12')]);router[_0xaac4('0x13')](_0xaac4('0x14'),auth[_0xaac4('0x9')](),controller[_0xaac4('0x15')]);router[_0xaac4('0x16')](_0xaac4('0x14'),auth[_0xaac4('0x9')](),controller[_0xaac4('0x17')]);module[_0xaac4('0x18')]=router; \ No newline at end of file +var _0x4fc2=['get','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskConfiguration.controller','isAuthenticated','index','/:id','show'];(function(_0x1a208a,_0x211002){var _0x2ddb5b=function(_0x155b8a){while(--_0x155b8a){_0x1a208a['push'](_0x1a208a['shift']());}};_0x2ddb5b(++_0x211002);}(_0x4fc2,0x111));var _0x24fc=function(_0x322318,_0x276d64){_0x322318=_0x322318-0x0;var _0x59ce6f=_0x4fc2[_0x322318];return _0x59ce6f;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var fs_extra=require(_0x24fc('0x5'));var auth=require(_0x24fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24fc('0x7'));var controller=require(_0x24fc('0x8'));router['get']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xa')]);router['get'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')](_0x24fc('0xe'),auth[_0x24fc('0x9')](),controller['getFields']);router[_0x24fc('0xd')](_0x24fc('0xf'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x10')]);router[_0x24fc('0xd')](_0x24fc('0x11'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x12')]);router['get'](_0x24fc('0x13'),auth[_0x24fc('0x9')](),controller['getTags']);router[_0x24fc('0x14')]('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0x15')]);router[_0x24fc('0x14')](_0x24fc('0x13'),auth[_0x24fc('0x9')](),controller['setTags']);router[_0x24fc('0x16')](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x17')]);router['delete'](_0x24fc('0xb'),auth['isAuthenticated'](),controller[_0x24fc('0x18')]);module[_0x24fc('0x19')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 5091406..d8f4ea5 100644 --- a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js +++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4ef7=['STRING','exports'];(function(_0x22dbd1,_0x47e0bb){var _0x50a4fd=function(_0x5cadf4){while(--_0x5cadf4){_0x22dbd1['push'](_0x22dbd1['shift']());}};_0x50a4fd(++_0x47e0bb);}(_0x4ef7,0x1c5));var _0x74ef=function(_0x15587f,_0x455f7b){_0x15587f=_0x15587f-0x0;var _0x34b46d=_0x4ef7[_0x15587f];return _0x34b46d;};'use strict';var Sequelize=require('sequelize');module[_0x74ef('0x0')]={'name':{'type':Sequelize[_0x74ef('0x1')]},'description':{'type':Sequelize[_0x74ef('0x1')]}}; \ No newline at end of file +var _0x1d14=['exports','sequelize'];(function(_0x1806b5,_0x14c0cc){var _0xe21ed4=function(_0x1bab12){while(--_0x1bab12){_0x1806b5['push'](_0x1806b5['shift']());}};_0xe21ed4(++_0x14c0cc);}(_0x1d14,0xd9));var _0x41d1=function(_0x2407d9,_0xc6a323){_0x2407d9=_0x2407d9-0x0;var _0xa6cb74=_0x1d14[_0x2407d9];return _0xa6cb74;};'use strict';var Sequelize=require(_0x41d1('0x0'));module[_0x41d1('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 0ae0b62..76a7e69 100644 --- a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js +++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x86ad=['jsforce','desk.js','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ZendeskConfiguration','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','create','body','find','findOne','ZendeskField','order','getFields','hasOwnProperty','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto'];(function(_0x49b862,_0x47923b){var _0x442c2f=function(_0xf44472){while(--_0xf44472){_0x49b862['push'](_0x49b862['shift']());}};_0x442c2f(++_0x47923b);}(_0x86ad,0x9b));var _0xd86a=function(_0x5e59e0,_0x36d908){_0x5e59e0=_0x5e59e0-0x0;var _0x1b875e=_0x86ad[_0x5e59e0];return _0x1b875e;};'use strict';var emlformat=require(_0xd86a('0x0'));var rimraf=require(_0xd86a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd86a('0x2'));var rp=require(_0xd86a('0x3'));var moment=require(_0xd86a('0x4'));var BPromise=require(_0xd86a('0x5'));var Mustache=require(_0xd86a('0x6'));var util=require(_0xd86a('0x7'));var path=require('path');var sox=require(_0xd86a('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd86a('0x9'));var _=require(_0xd86a('0xa'));var squel=require(_0xd86a('0xb'));var crypto=require(_0xd86a('0xc'));var jsforce=require(_0xd86a('0xd'));var deskjs=require(_0xd86a('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd86a('0xf'));var authService=require(_0xd86a('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd86a('0x11'))(_0xd86a('0x12'));var utils=require('../../config/utils');var config=require(_0xd86a('0x13'));var licenseUtil=require(_0xd86a('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x47159c,_0x10651f){_0x10651f=_0x10651f||0xcc;return function(_0x1357fd){if(_0x1357fd){return _0x47159c[_0xd86a('0x15')](_0x10651f);}return _0x47159c['status'](_0x10651f)[_0xd86a('0x16')]();};}function respondWithResult(_0x45b133,_0xadb524){_0xadb524=_0xadb524||0xc8;return function(_0x65d1f4){if(_0x65d1f4){return _0x45b133['status'](_0xadb524)['json'](_0x65d1f4);}};}function respondWithFilteredResult(_0x2cc279,_0x286d74){return function(_0x890d87){if(_0x890d87){var _0xce3713=typeof _0x286d74[_0xd86a('0x17')]===_0xd86a('0x18')&&typeof _0x286d74[_0xd86a('0x19')]===_0xd86a('0x18');var _0x206ca1=_0x890d87[_0xd86a('0x1a')];var _0x1e40fa=_0xce3713?0x0:_0x286d74[_0xd86a('0x17')];var _0x377c60=_0xce3713?_0x890d87[_0xd86a('0x1a')]:_0x286d74[_0xd86a('0x17')]+_0x286d74[_0xd86a('0x19')];var _0x32a9d9;if(_0x377c60>=_0x206ca1){_0x377c60=_0x206ca1;_0x32a9d9=0xc8;}else{_0x32a9d9=0xce;}_0x2cc279[_0xd86a('0x1b')](_0x32a9d9);return _0x2cc279[_0xd86a('0x1c')](_0xd86a('0x1d'),_0x1e40fa+'-'+_0x377c60+'/'+_0x206ca1)[_0xd86a('0x1e')](_0x890d87);}return null;};}function patchUpdates(_0x2effe6){return function(_0x5541ff){try{jsonpatch[_0xd86a('0x1f')](_0x5541ff,_0x2effe6,!![]);}catch(_0x1d275b){return BPromise[_0xd86a('0x20')](_0x1d275b);}return _0x5541ff[_0xd86a('0x21')]();};}function saveUpdates(_0x2f9fea,_0x5c5bdd){return function(_0x596303){if(_0x596303){return _0x596303[_0xd86a('0x22')](_0x2f9fea)[_0xd86a('0x23')](function(_0x167d51){return _0x167d51;});}return null;};}function removeEntity(_0x27e10a,_0x54ce7c){return function(_0x3d7175){if(_0x3d7175){return _0x3d7175[_0xd86a('0x24')]()[_0xd86a('0x23')](function(){_0x27e10a[_0xd86a('0x1b')](0xcc)[_0xd86a('0x16')]();});}};}function handleEntityNotFound(_0x43dc93,_0x178c32){return function(_0x5d2785){if(!_0x5d2785){_0x43dc93['sendStatus'](0x194);}return _0x5d2785;};}function handleError(_0x5e7514,_0x569bae){_0x569bae=_0x569bae||0x1f4;return function(_0x1e0cd9){logger[_0xd86a('0x25')](_0x1e0cd9[_0xd86a('0x26')]);if(_0x1e0cd9[_0xd86a('0x27')]){delete _0x1e0cd9[_0xd86a('0x27')];}_0x5e7514[_0xd86a('0x1b')](_0x569bae)[_0xd86a('0x28')](_0x1e0cd9);};}exports[_0xd86a('0x29')]=function(_0x464bb4,_0x35c731){var _0x306fd1={},_0x451e5d={},_0x5193fe={'count':0x0,'rows':[]};var _0x47add3=_[_0xd86a('0x2a')](db[_0xd86a('0x2b')]['rawAttributes'],function(_0x36301d){return{'name':_0x36301d[_0xd86a('0x2c')],'type':_0x36301d[_0xd86a('0x2d')][_0xd86a('0x2e')]};});_0x451e5d[_0xd86a('0x2f')]=_[_0xd86a('0x2a')](_0x47add3,_0xd86a('0x27'));_0x451e5d[_0xd86a('0x30')]=_[_0xd86a('0x31')](_0x464bb4[_0xd86a('0x30')]);_0x451e5d['filters']=_[_0xd86a('0x32')](_0x451e5d[_0xd86a('0x2f')],_0x451e5d[_0xd86a('0x30')]);_0x306fd1[_0xd86a('0x33')]=_[_0xd86a('0x32')](_0x451e5d[_0xd86a('0x2f')],qs[_0xd86a('0x34')](_0x464bb4[_0xd86a('0x30')][_0xd86a('0x34')]));_0x306fd1[_0xd86a('0x33')]=_0x306fd1[_0xd86a('0x33')][_0xd86a('0x35')]?_0x306fd1[_0xd86a('0x33')]:_0x451e5d[_0xd86a('0x2f')];if(!_0x464bb4[_0xd86a('0x30')]['hasOwnProperty'](_0xd86a('0x36'))){_0x306fd1['limit']=qs[_0xd86a('0x19')](_0x464bb4['query']['limit']);_0x306fd1[_0xd86a('0x17')]=qs[_0xd86a('0x17')](_0x464bb4[_0xd86a('0x30')][_0xd86a('0x17')]);}_0x306fd1['order']=qs['sort'](_0x464bb4[_0xd86a('0x30')][_0xd86a('0x37')]);_0x306fd1[_0xd86a('0x38')]=qs[_0xd86a('0x39')](_[_0xd86a('0x3a')](_0x464bb4[_0xd86a('0x30')],_0x451e5d[_0xd86a('0x39')]),_0x47add3);if(_0x464bb4['query'][_0xd86a('0x3b')]){_0x306fd1[_0xd86a('0x38')]=_[_0xd86a('0x3c')](_0x306fd1[_0xd86a('0x38')],{'$or':_['map'](_0x47add3,function(_0x22e578){if(_0x22e578[_0xd86a('0x2d')]!==_0xd86a('0x3d')){var _0x10cb24={};_0x10cb24[_0x22e578[_0xd86a('0x27')]]={'$like':'%'+_0x464bb4[_0xd86a('0x30')][_0xd86a('0x3b')]+'%'};return _0x10cb24;}})});}_0x306fd1=_[_0xd86a('0x3c')]({},_0x306fd1,_0x464bb4[_0xd86a('0x3e')]);var _0x34a65d={'where':_0x306fd1[_0xd86a('0x38')]};return db[_0xd86a('0x2b')][_0xd86a('0x1a')](_0x34a65d)[_0xd86a('0x23')](function(_0x17e125){_0x5193fe[_0xd86a('0x1a')]=_0x17e125;if(_0x464bb4[_0xd86a('0x30')][_0xd86a('0x3f')]){_0x306fd1[_0xd86a('0x40')]=[{'all':!![]}];}return db[_0xd86a('0x2b')][_0xd86a('0x41')](_0x306fd1);})['then'](function(_0x27326c){_0x5193fe['rows']=_0x27326c;return _0x5193fe;})[_0xd86a('0x23')](respondWithFilteredResult(_0x35c731,_0x306fd1))[_0xd86a('0x42')](handleError(_0x35c731,null));};exports[_0xd86a('0x43')]=function(_0x1645d1,_0x5d4f78){var _0x279f77={'raw':![],'where':{'id':_0x1645d1[_0xd86a('0x44')]['id']}},_0x26be3b={};_0x26be3b['model']=_[_0xd86a('0x31')](db[_0xd86a('0x2b')][_0xd86a('0x45')]);_0x26be3b[_0xd86a('0x30')]=_[_0xd86a('0x31')](_0x1645d1[_0xd86a('0x30')]);_0x26be3b[_0xd86a('0x39')]=_[_0xd86a('0x32')](_0x26be3b[_0xd86a('0x2f')],_0x26be3b['query']);_0x279f77['attributes']=_['intersection'](_0x26be3b['model'],qs['fields'](_0x1645d1[_0xd86a('0x30')][_0xd86a('0x34')]));_0x279f77[_0xd86a('0x33')]=_0x279f77[_0xd86a('0x33')]['length']?_0x279f77['attributes']:_0x26be3b[_0xd86a('0x2f')];if(_0x1645d1[_0xd86a('0x30')][_0xd86a('0x3f')]){_0x279f77[_0xd86a('0x40')]=[{'all':!![]}];}_0x279f77=_['merge']({},_0x279f77,_0x1645d1[_0xd86a('0x3e')]);return db[_0xd86a('0x2b')]['find'](_0x279f77)[_0xd86a('0x23')](handleEntityNotFound(_0x5d4f78,null))[_0xd86a('0x23')](respondWithResult(_0x5d4f78,null))[_0xd86a('0x42')](handleError(_0x5d4f78,null));};exports[_0xd86a('0x46')]=function(_0x2021ae,_0x45ea05){return db[_0xd86a('0x2b')][_0xd86a('0x46')](_0x2021ae['body'],{})[_0xd86a('0x23')](respondWithResult(_0x45ea05,0xc9))[_0xd86a('0x42')](handleError(_0x45ea05,null));};exports[_0xd86a('0x22')]=function(_0xaa27b3,_0x19d0c7){if(_0xaa27b3[_0xd86a('0x47')]['id']){delete _0xaa27b3[_0xd86a('0x47')]['id'];}return db['ZendeskConfiguration'][_0xd86a('0x48')]({'where':{'id':_0xaa27b3[_0xd86a('0x44')]['id']}})['then'](handleEntityNotFound(_0x19d0c7,null))['then'](saveUpdates(_0xaa27b3['body'],null))[_0xd86a('0x23')](respondWithResult(_0x19d0c7,null))[_0xd86a('0x42')](handleError(_0x19d0c7,null));};exports['destroy']=function(_0x3221d1,_0x59cce0){return db[_0xd86a('0x2b')]['find']({'where':{'id':_0x3221d1['params']['id']}})[_0xd86a('0x23')](handleEntityNotFound(_0x59cce0,null))[_0xd86a('0x23')](removeEntity(_0x59cce0,null))[_0xd86a('0x42')](handleError(_0x59cce0,null));};exports['getFields']=function(_0x4aea44,_0x22d8f9,_0x2ea859){var _0x6b127d={};var _0x29c0a0={};var _0x3a9c39;var _0x15a911;return db[_0xd86a('0x2b')][_0xd86a('0x49')]({'where':{'id':_0x4aea44['params']['id']}})[_0xd86a('0x23')](handleEntityNotFound(_0x22d8f9,null))[_0xd86a('0x23')](function(_0x116573){if(_0x116573){_0x3a9c39=_0x116573;_0x29c0a0[_0xd86a('0x2f')]=_['keys'](db[_0xd86a('0x4a')][_0xd86a('0x45')]);_0x29c0a0['query']=_[_0xd86a('0x31')](_0x4aea44['query']);_0x29c0a0[_0xd86a('0x39')]=_[_0xd86a('0x32')](_0x29c0a0[_0xd86a('0x2f')],_0x29c0a0[_0xd86a('0x30')]);_0x6b127d[_0xd86a('0x33')]=_[_0xd86a('0x32')](_0x29c0a0[_0xd86a('0x2f')],qs[_0xd86a('0x34')](_0x4aea44['query'][_0xd86a('0x34')]));_0x6b127d[_0xd86a('0x33')]=_0x6b127d[_0xd86a('0x33')][_0xd86a('0x35')]?_0x6b127d['attributes']:_0x29c0a0[_0xd86a('0x2f')];_0x6b127d[_0xd86a('0x4b')]=qs[_0xd86a('0x37')](_0x4aea44['query']['sort']);_0x6b127d['where']=qs[_0xd86a('0x39')](_[_0xd86a('0x3a')](_0x4aea44[_0xd86a('0x30')],_0x29c0a0['filters']));if(_0x4aea44[_0xd86a('0x30')]['filter']){_0x6b127d['where']=_[_0xd86a('0x3c')](_0x6b127d['where'],{'$or':_[_0xd86a('0x2a')](_0x6b127d[_0xd86a('0x33')],function(_0x11bf0f){var _0x1af4f0={};_0x1af4f0[_0x11bf0f]={'$like':'%'+_0x4aea44[_0xd86a('0x30')]['filter']+'%'};return _0x1af4f0;})});}_0x6b127d=_[_0xd86a('0x3c')]({},_0x6b127d,_0x4aea44[_0xd86a('0x3e')]);return _0x3a9c39[_0xd86a('0x4c')](_0x6b127d);}})[_0xd86a('0x23')](function(_0x16d644){if(_0x16d644){_0x15a911=_0x16d644[_0xd86a('0x35')];if(!_0x4aea44[_0xd86a('0x30')][_0xd86a('0x4d')](_0xd86a('0x36'))){_0x6b127d[_0xd86a('0x19')]=qs['limit'](_0x4aea44[_0xd86a('0x30')][_0xd86a('0x19')]);_0x6b127d[_0xd86a('0x17')]=qs[_0xd86a('0x17')](_0x4aea44[_0xd86a('0x30')][_0xd86a('0x17')]);}return _0x3a9c39['getFields'](_0x6b127d);}})[_0xd86a('0x23')](function(_0xce1d7b){if(_0xce1d7b){return _0xce1d7b?{'count':_0x15a911,'rows':_0xce1d7b}:null;}})[_0xd86a('0x23')](respondWithResult(_0x22d8f9,null))[_0xd86a('0x42')](handleError(_0x22d8f9,null));};exports[_0xd86a('0x4e')]=function(_0x1f1312,_0xdc68be,_0x8e980c){var _0x3c7426={};var _0x5a77d8={};var _0x4367f3;var _0x4b3b90;return db[_0xd86a('0x2b')][_0xd86a('0x49')]({'where':{'id':_0x1f1312['params']['id']}})['then'](handleEntityNotFound(_0xdc68be,null))[_0xd86a('0x23')](function(_0x2a3387){if(_0x2a3387){_0x4367f3=_0x2a3387;_0x5a77d8[_0xd86a('0x2f')]=_[_0xd86a('0x31')](db[_0xd86a('0x4a')]['rawAttributes']);_0x5a77d8[_0xd86a('0x30')]=_[_0xd86a('0x31')](_0x1f1312['query']);_0x5a77d8['filters']=_[_0xd86a('0x32')](_0x5a77d8['model'],_0x5a77d8[_0xd86a('0x30')]);_0x3c7426[_0xd86a('0x33')]=_[_0xd86a('0x32')](_0x5a77d8[_0xd86a('0x2f')],qs[_0xd86a('0x34')](_0x1f1312[_0xd86a('0x30')][_0xd86a('0x34')]));_0x3c7426[_0xd86a('0x33')]=_0x3c7426[_0xd86a('0x33')][_0xd86a('0x35')]?_0x3c7426[_0xd86a('0x33')]:_0x5a77d8['model'];_0x3c7426[_0xd86a('0x4b')]=qs['sort'](_0x1f1312[_0xd86a('0x30')][_0xd86a('0x37')]);_0x3c7426['where']=qs[_0xd86a('0x39')](_[_0xd86a('0x3a')](_0x1f1312['query'],_0x5a77d8['filters']));if(_0x1f1312[_0xd86a('0x30')]['filter']){_0x3c7426[_0xd86a('0x38')]=_[_0xd86a('0x3c')](_0x3c7426[_0xd86a('0x38')],{'$or':_['map'](_0x3c7426[_0xd86a('0x33')],function(_0x1d60ed){var _0x22735f={};_0x22735f[_0x1d60ed]={'$like':'%'+_0x1f1312[_0xd86a('0x30')][_0xd86a('0x3b')]+'%'};return _0x22735f;})});}_0x3c7426=_[_0xd86a('0x3c')]({},_0x3c7426,_0x1f1312[_0xd86a('0x3e')]);return _0x4367f3[_0xd86a('0x4e')](_0x3c7426);}})['then'](function(_0x1706c7){if(_0x1706c7){_0x4b3b90=_0x1706c7[_0xd86a('0x35')];if(!_0x1f1312[_0xd86a('0x30')]['hasOwnProperty'](_0xd86a('0x36'))){_0x3c7426[_0xd86a('0x19')]=qs['limit'](_0x1f1312[_0xd86a('0x30')][_0xd86a('0x19')]);_0x3c7426['offset']=qs['offset'](_0x1f1312['query'][_0xd86a('0x17')]);}return _0x4367f3[_0xd86a('0x4e')](_0x3c7426);}})['then'](function(_0x4c6c97){if(_0x4c6c97){return _0x4c6c97?{'count':_0x4b3b90,'rows':_0x4c6c97}:null;}})[_0xd86a('0x23')](respondWithResult(_0xdc68be,null))[_0xd86a('0x42')](handleError(_0xdc68be,null));};exports[_0xd86a('0x4f')]=function(_0x472211,_0x1c7004,_0x1efe68){var _0x1afa4f={};var _0x36f7ed={};var _0x2ff0fe;var _0x2532c3;return db['ZendeskConfiguration'][_0xd86a('0x49')]({'where':{'id':_0x472211['params']['id']}})[_0xd86a('0x23')](handleEntityNotFound(_0x1c7004,null))[_0xd86a('0x23')](function(_0x30df5b){if(_0x30df5b){_0x2ff0fe=_0x30df5b;_0x36f7ed[_0xd86a('0x2f')]=_[_0xd86a('0x31')](db['ZendeskField']['rawAttributes']);_0x36f7ed[_0xd86a('0x30')]=_[_0xd86a('0x31')](_0x472211['query']);_0x36f7ed[_0xd86a('0x39')]=_[_0xd86a('0x32')](_0x36f7ed[_0xd86a('0x2f')],_0x36f7ed[_0xd86a('0x30')]);_0x1afa4f[_0xd86a('0x33')]=_[_0xd86a('0x32')](_0x36f7ed[_0xd86a('0x2f')],qs[_0xd86a('0x34')](_0x472211['query'][_0xd86a('0x34')]));_0x1afa4f[_0xd86a('0x33')]=_0x1afa4f[_0xd86a('0x33')][_0xd86a('0x35')]?_0x1afa4f['attributes']:_0x36f7ed['model'];_0x1afa4f[_0xd86a('0x4b')]=qs[_0xd86a('0x37')](_0x472211[_0xd86a('0x30')][_0xd86a('0x37')]);_0x1afa4f['where']=qs[_0xd86a('0x39')](_[_0xd86a('0x3a')](_0x472211[_0xd86a('0x30')],_0x36f7ed[_0xd86a('0x39')]));if(_0x472211['query'][_0xd86a('0x3b')]){_0x1afa4f[_0xd86a('0x38')]=_['merge'](_0x1afa4f[_0xd86a('0x38')],{'$or':_[_0xd86a('0x2a')](_0x1afa4f[_0xd86a('0x33')],function(_0x1e2947){var _0x4efe3e={};_0x4efe3e[_0x1e2947]={'$like':'%'+_0x472211[_0xd86a('0x30')]['filter']+'%'};return _0x4efe3e;})});}_0x1afa4f=_[_0xd86a('0x3c')]({},_0x1afa4f,_0x472211[_0xd86a('0x3e')]);return _0x2ff0fe[_0xd86a('0x4f')](_0x1afa4f);}})['then'](function(_0x2f0b10){if(_0x2f0b10){_0x2532c3=_0x2f0b10[_0xd86a('0x35')];if(!_0x472211[_0xd86a('0x30')][_0xd86a('0x4d')](_0xd86a('0x36'))){_0x1afa4f[_0xd86a('0x19')]=qs[_0xd86a('0x19')](_0x472211['query'][_0xd86a('0x19')]);_0x1afa4f['offset']=qs[_0xd86a('0x17')](_0x472211[_0xd86a('0x30')]['offset']);}return _0x2ff0fe[_0xd86a('0x4f')](_0x1afa4f);}})[_0xd86a('0x23')](function(_0x173932){if(_0x173932){return _0x173932?{'count':_0x2532c3,'rows':_0x173932}:null;}})[_0xd86a('0x23')](respondWithResult(_0x1c7004,null))['catch'](handleError(_0x1c7004,null));};exports['getTags']=function(_0x5f462f,_0x5bf2bc,_0x510384){var _0x41d095={};var _0x1dd85f={};var _0x3a7de6;var _0x57c208;return db[_0xd86a('0x2b')][_0xd86a('0x49')]({'where':{'id':_0x5f462f['params']['id']}})[_0xd86a('0x23')](handleEntityNotFound(_0x5bf2bc,null))[_0xd86a('0x23')](function(_0x256396){if(_0x256396){_0x3a7de6=_0x256396;_0x1dd85f[_0xd86a('0x2f')]=_[_0xd86a('0x31')](db[_0xd86a('0x50')]['rawAttributes']);_0x1dd85f[_0xd86a('0x30')]=_['keys'](_0x5f462f[_0xd86a('0x30')]);_0x1dd85f[_0xd86a('0x39')]=_[_0xd86a('0x32')](_0x1dd85f['model'],_0x1dd85f[_0xd86a('0x30')]);_0x41d095[_0xd86a('0x33')]=_['intersection'](_0x1dd85f[_0xd86a('0x2f')],qs[_0xd86a('0x34')](_0x5f462f['query']['fields']));_0x41d095['attributes']=_0x41d095[_0xd86a('0x33')]['length']?_0x41d095[_0xd86a('0x33')]:_0x1dd85f['model'];_0x41d095['order']=qs[_0xd86a('0x37')](_0x5f462f[_0xd86a('0x30')]['sort']);_0x41d095[_0xd86a('0x38')]=qs[_0xd86a('0x39')](_[_0xd86a('0x3a')](_0x5f462f[_0xd86a('0x30')],_0x1dd85f['filters']));if(_0x5f462f[_0xd86a('0x30')]['filter']){_0x41d095['where']=_[_0xd86a('0x3c')](_0x41d095[_0xd86a('0x38')],{'$or':_[_0xd86a('0x2a')](_0x41d095[_0xd86a('0x33')],function(_0x10ef9f){var _0x412493={};_0x412493[_0x10ef9f]={'$like':'%'+_0x5f462f['query'][_0xd86a('0x3b')]+'%'};return _0x412493;})});}_0x41d095=_[_0xd86a('0x3c')]({},_0x41d095,_0x5f462f[_0xd86a('0x3e')]);return _0x3a7de6[_0xd86a('0x51')](_0x41d095);}})[_0xd86a('0x23')](function(_0x21cdf4){if(_0x21cdf4){_0x57c208=_0x21cdf4[_0xd86a('0x35')];if(!_0x5f462f[_0xd86a('0x30')][_0xd86a('0x4d')](_0xd86a('0x36'))){_0x41d095[_0xd86a('0x19')]=qs[_0xd86a('0x19')](_0x5f462f['query']['limit']);_0x41d095[_0xd86a('0x17')]=qs['offset'](_0x5f462f[_0xd86a('0x30')]['offset']);}return _0x3a7de6['getTags'](_0x41d095);}})[_0xd86a('0x23')](function(_0x2af206){if(_0x2af206){return _0x2af206?{'count':_0x57c208,'rows':_0x2af206}:null;}})[_0xd86a('0x23')](respondWithResult(_0x5bf2bc,null))[_0xd86a('0x42')](handleError(_0x5bf2bc,null));};exports[_0xd86a('0x52')]=function(_0x2e1af1,_0x4e9bdf,_0x4d2e92){if(_0x2e1af1['body']['id']){delete _0x2e1af1[_0xd86a('0x47')]['id'];}return db[_0xd86a('0x2b')][_0xd86a('0x49')]({'where':{'id':_0x2e1af1[_0xd86a('0x44')]['id']}})['then'](handleEntityNotFound(_0x4e9bdf,null))[_0xd86a('0x23')](function(_0x344d4b){if(_0x344d4b){return _0x344d4b[_0xd86a('0x52')](_0x2e1af1[_0xd86a('0x47')][_0xd86a('0x53')]||[]);}return null;})[_0xd86a('0x23')](respondWithResult(_0x4e9bdf,null))[_0xd86a('0x42')](handleError(_0x4e9bdf,null));}; \ No newline at end of file +var _0xdb22=['crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','name','send','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','ZendeskConfiguration','include','findAll','catch','show','params','includeAll','create','body','find','findOne','ZendeskField','filter','getFields','getSubjects','getDescriptions','getTags','Tag','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xdb22,0x195));var _0x2db2=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xdb22[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x2db2('0x0'));var rimraf=require(_0x2db2('0x1'));var zipdir=require(_0x2db2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2db2('0x3'));var moment=require(_0x2db2('0x4'));var BPromise=require(_0x2db2('0x5'));var Mustache=require(_0x2db2('0x6'));var util=require(_0x2db2('0x7'));var path=require(_0x2db2('0x8'));var sox=require(_0x2db2('0x9'));var csv=require(_0x2db2('0xa'));var ejs=require(_0x2db2('0xb'));var fs=require('fs');var fs_extra=require(_0x2db2('0xc'));var _=require(_0x2db2('0xd'));var squel=require(_0x2db2('0xe'));var crypto=require(_0x2db2('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2db2('0xa'));var querystring=require(_0x2db2('0x10'));var Papa=require(_0x2db2('0x11'));var Redis=require(_0x2db2('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x2db2('0x13'));var as=require(_0x2db2('0x14'));var hardwareService=require(_0x2db2('0x15'));var logger=require(_0x2db2('0x16'))(_0x2db2('0x17'));var utils=require(_0x2db2('0x18'));var config=require(_0x2db2('0x19'));var licenseUtil=require(_0x2db2('0x1a'));var db=require(_0x2db2('0x1b'))['db'];function respondWithStatusCode(_0x5ebd12,_0x4e4378){_0x4e4378=_0x4e4378||0xcc;return function(_0x17f7db){if(_0x17f7db){return _0x5ebd12[_0x2db2('0x1c')](_0x4e4378);}return _0x5ebd12['status'](_0x4e4378)[_0x2db2('0x1d')]();};}function respondWithResult(_0x513cd1,_0x38a0d0){_0x38a0d0=_0x38a0d0||0xc8;return function(_0x13af1c){if(_0x13af1c){return _0x513cd1[_0x2db2('0x1e')](_0x38a0d0)[_0x2db2('0x1f')](_0x13af1c);}};}function respondWithFilteredResult(_0x516a05,_0x26f250){return function(_0x1fea19){if(_0x1fea19){var _0x1cdf8c=typeof _0x26f250[_0x2db2('0x20')]==='undefined'&&typeof _0x26f250[_0x2db2('0x21')]===_0x2db2('0x22');var _0x40dee0=_0x1fea19['count'];var _0x1cfb4f=_0x1cdf8c?0x0:_0x26f250[_0x2db2('0x20')];var _0xa34738=_0x1cdf8c?_0x1fea19[_0x2db2('0x23')]:_0x26f250[_0x2db2('0x20')]+_0x26f250[_0x2db2('0x21')];var _0x3d673d;if(_0xa34738>=_0x40dee0){_0xa34738=_0x40dee0;_0x3d673d=0xc8;}else{_0x3d673d=0xce;}_0x516a05[_0x2db2('0x1e')](_0x3d673d);return _0x516a05['set'](_0x2db2('0x24'),_0x1cfb4f+'-'+_0xa34738+'/'+_0x40dee0)[_0x2db2('0x1f')](_0x1fea19);}return null;};}function patchUpdates(_0x1ac90b){return function(_0x37b087){try{jsonpatch[_0x2db2('0x25')](_0x37b087,_0x1ac90b,!![]);}catch(_0x4ecaa2){return BPromise[_0x2db2('0x26')](_0x4ecaa2);}return _0x37b087[_0x2db2('0x27')]();};}function saveUpdates(_0x5b21f5,_0x1550be){return function(_0x4745a9){if(_0x4745a9){return _0x4745a9[_0x2db2('0x28')](_0x5b21f5)[_0x2db2('0x29')](function(_0x6fd2d1){return _0x6fd2d1;});}return null;};}function removeEntity(_0x1c73b4,_0xa3a32f){return function(_0x183745){if(_0x183745){return _0x183745[_0x2db2('0x2a')]()[_0x2db2('0x29')](function(){_0x1c73b4['status'](0xcc)[_0x2db2('0x1d')]();});}};}function handleEntityNotFound(_0x20f0ba,_0xc920e7){return function(_0x8b86dc){if(!_0x8b86dc){_0x20f0ba[_0x2db2('0x1c')](0x194);}return _0x8b86dc;};}function handleError(_0x28c663,_0xcd2aed){_0xcd2aed=_0xcd2aed||0x1f4;return function(_0x3eab32){logger['error'](_0x3eab32['stack']);if(_0x3eab32[_0x2db2('0x2b')]){delete _0x3eab32[_0x2db2('0x2b')];}_0x28c663[_0x2db2('0x1e')](_0xcd2aed)[_0x2db2('0x2c')](_0x3eab32);};}exports['index']=function(_0x126a5f,_0x2607ea){var _0x5dd529={},_0x33a6c5={},_0x17af90={'count':0x0,'rows':[]};var _0x47608a=_[_0x2db2('0x2d')](db['ZendeskConfiguration'][_0x2db2('0x2e')],function(_0x42cddc){return{'name':_0x42cddc['fieldName'],'type':_0x42cddc[_0x2db2('0x2f')][_0x2db2('0x30')]};});_0x33a6c5[_0x2db2('0x31')]=_[_0x2db2('0x2d')](_0x47608a,_0x2db2('0x2b'));_0x33a6c5[_0x2db2('0x32')]=_[_0x2db2('0x33')](_0x126a5f[_0x2db2('0x32')]);_0x33a6c5[_0x2db2('0x34')]=_[_0x2db2('0x35')](_0x33a6c5[_0x2db2('0x31')],_0x33a6c5[_0x2db2('0x32')]);_0x5dd529[_0x2db2('0x36')]=_[_0x2db2('0x35')](_0x33a6c5['model'],qs[_0x2db2('0x37')](_0x126a5f[_0x2db2('0x32')][_0x2db2('0x37')]));_0x5dd529[_0x2db2('0x36')]=_0x5dd529[_0x2db2('0x36')][_0x2db2('0x38')]?_0x5dd529['attributes']:_0x33a6c5[_0x2db2('0x31')];if(!_0x126a5f[_0x2db2('0x32')][_0x2db2('0x39')](_0x2db2('0x3a'))){_0x5dd529['limit']=qs[_0x2db2('0x21')](_0x126a5f[_0x2db2('0x32')][_0x2db2('0x21')]);_0x5dd529['offset']=qs['offset'](_0x126a5f[_0x2db2('0x32')][_0x2db2('0x20')]);}_0x5dd529[_0x2db2('0x3b')]=qs[_0x2db2('0x3c')](_0x126a5f[_0x2db2('0x32')][_0x2db2('0x3c')]);_0x5dd529[_0x2db2('0x3d')]=qs[_0x2db2('0x34')](_[_0x2db2('0x3e')](_0x126a5f['query'],_0x33a6c5[_0x2db2('0x34')]),_0x47608a);if(_0x126a5f[_0x2db2('0x32')]['filter']){_0x5dd529[_0x2db2('0x3d')]=_[_0x2db2('0x3f')](_0x5dd529[_0x2db2('0x3d')],{'$or':_[_0x2db2('0x2d')](_0x47608a,function(_0x42fc2e){if(_0x42fc2e['type']!==_0x2db2('0x40')){var _0x1be672={};_0x1be672[_0x42fc2e[_0x2db2('0x2b')]]={'$like':'%'+_0x126a5f['query']['filter']+'%'};return _0x1be672;}})});}_0x5dd529=_[_0x2db2('0x3f')]({},_0x5dd529,_0x126a5f[_0x2db2('0x41')]);var _0x500db1={'where':_0x5dd529[_0x2db2('0x3d')]};return db[_0x2db2('0x42')][_0x2db2('0x23')](_0x500db1)[_0x2db2('0x29')](function(_0x19b8cc){_0x17af90['count']=_0x19b8cc;if(_0x126a5f['query']['includeAll']){_0x5dd529[_0x2db2('0x43')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0x2db2('0x44')](_0x5dd529);})['then'](function(_0x4b44fc){_0x17af90['rows']=_0x4b44fc;return _0x17af90;})[_0x2db2('0x29')](respondWithFilteredResult(_0x2607ea,_0x5dd529))[_0x2db2('0x45')](handleError(_0x2607ea,null));};exports[_0x2db2('0x46')]=function(_0x2c9610,_0x4d84b2){var _0x1ec2df={'raw':![],'where':{'id':_0x2c9610[_0x2db2('0x47')]['id']}},_0x2c5f6f={};_0x2c5f6f[_0x2db2('0x31')]=_[_0x2db2('0x33')](db[_0x2db2('0x42')]['rawAttributes']);_0x2c5f6f['query']=_['keys'](_0x2c9610[_0x2db2('0x32')]);_0x2c5f6f[_0x2db2('0x34')]=_['intersection'](_0x2c5f6f[_0x2db2('0x31')],_0x2c5f6f[_0x2db2('0x32')]);_0x1ec2df[_0x2db2('0x36')]=_['intersection'](_0x2c5f6f[_0x2db2('0x31')],qs['fields'](_0x2c9610[_0x2db2('0x32')][_0x2db2('0x37')]));_0x1ec2df[_0x2db2('0x36')]=_0x1ec2df[_0x2db2('0x36')][_0x2db2('0x38')]?_0x1ec2df[_0x2db2('0x36')]:_0x2c5f6f[_0x2db2('0x31')];if(_0x2c9610[_0x2db2('0x32')][_0x2db2('0x48')]){_0x1ec2df['include']=[{'all':!![]}];}_0x1ec2df=_[_0x2db2('0x3f')]({},_0x1ec2df,_0x2c9610[_0x2db2('0x41')]);return db[_0x2db2('0x42')]['find'](_0x1ec2df)[_0x2db2('0x29')](handleEntityNotFound(_0x4d84b2,null))[_0x2db2('0x29')](respondWithResult(_0x4d84b2,null))['catch'](handleError(_0x4d84b2,null));};exports[_0x2db2('0x49')]=function(_0x5c0540,_0x4f9962){return db['ZendeskConfiguration'][_0x2db2('0x49')](_0x5c0540['body'],{})[_0x2db2('0x29')](respondWithResult(_0x4f9962,0xc9))[_0x2db2('0x45')](handleError(_0x4f9962,null));};exports[_0x2db2('0x28')]=function(_0x9a36bb,_0x1167eb){if(_0x9a36bb[_0x2db2('0x4a')]['id']){delete _0x9a36bb[_0x2db2('0x4a')]['id'];}return db[_0x2db2('0x42')][_0x2db2('0x4b')]({'where':{'id':_0x9a36bb[_0x2db2('0x47')]['id']}})[_0x2db2('0x29')](handleEntityNotFound(_0x1167eb,null))[_0x2db2('0x29')](saveUpdates(_0x9a36bb[_0x2db2('0x4a')],null))[_0x2db2('0x29')](respondWithResult(_0x1167eb,null))[_0x2db2('0x45')](handleError(_0x1167eb,null));};exports[_0x2db2('0x2a')]=function(_0x2ce9a6,_0x19b1d6){return db[_0x2db2('0x42')]['find']({'where':{'id':_0x2ce9a6['params']['id']}})[_0x2db2('0x29')](handleEntityNotFound(_0x19b1d6,null))[_0x2db2('0x29')](removeEntity(_0x19b1d6,null))[_0x2db2('0x45')](handleError(_0x19b1d6,null));};exports['getFields']=function(_0x265f16,_0x1893fa,_0x3ddc10){var _0x29625d={};var _0x2e12ff={};var _0x9b08cf;var _0x304e5e;return db[_0x2db2('0x42')][_0x2db2('0x4c')]({'where':{'id':_0x265f16[_0x2db2('0x47')]['id']}})['then'](handleEntityNotFound(_0x1893fa,null))[_0x2db2('0x29')](function(_0x2e3a10){if(_0x2e3a10){_0x9b08cf=_0x2e3a10;_0x2e12ff[_0x2db2('0x31')]=_['keys'](db[_0x2db2('0x4d')][_0x2db2('0x2e')]);_0x2e12ff['query']=_[_0x2db2('0x33')](_0x265f16[_0x2db2('0x32')]);_0x2e12ff[_0x2db2('0x34')]=_['intersection'](_0x2e12ff[_0x2db2('0x31')],_0x2e12ff[_0x2db2('0x32')]);_0x29625d[_0x2db2('0x36')]=_[_0x2db2('0x35')](_0x2e12ff[_0x2db2('0x31')],qs[_0x2db2('0x37')](_0x265f16[_0x2db2('0x32')][_0x2db2('0x37')]));_0x29625d[_0x2db2('0x36')]=_0x29625d[_0x2db2('0x36')]['length']?_0x29625d[_0x2db2('0x36')]:_0x2e12ff[_0x2db2('0x31')];_0x29625d['order']=qs[_0x2db2('0x3c')](_0x265f16[_0x2db2('0x32')][_0x2db2('0x3c')]);_0x29625d['where']=qs[_0x2db2('0x34')](_[_0x2db2('0x3e')](_0x265f16[_0x2db2('0x32')],_0x2e12ff['filters']));if(_0x265f16[_0x2db2('0x32')][_0x2db2('0x4e')]){_0x29625d[_0x2db2('0x3d')]=_[_0x2db2('0x3f')](_0x29625d[_0x2db2('0x3d')],{'$or':_[_0x2db2('0x2d')](_0x29625d[_0x2db2('0x36')],function(_0x13aa99){var _0x1e17f9={};_0x1e17f9[_0x13aa99]={'$like':'%'+_0x265f16[_0x2db2('0x32')][_0x2db2('0x4e')]+'%'};return _0x1e17f9;})});}_0x29625d=_[_0x2db2('0x3f')]({},_0x29625d,_0x265f16[_0x2db2('0x41')]);return _0x9b08cf[_0x2db2('0x4f')](_0x29625d);}})[_0x2db2('0x29')](function(_0x2dd944){if(_0x2dd944){_0x304e5e=_0x2dd944[_0x2db2('0x38')];if(!_0x265f16['query'][_0x2db2('0x39')]('nolimit')){_0x29625d['limit']=qs['limit'](_0x265f16[_0x2db2('0x32')][_0x2db2('0x21')]);_0x29625d[_0x2db2('0x20')]=qs[_0x2db2('0x20')](_0x265f16[_0x2db2('0x32')]['offset']);}return _0x9b08cf[_0x2db2('0x4f')](_0x29625d);}})[_0x2db2('0x29')](function(_0x318627){if(_0x318627){return _0x318627?{'count':_0x304e5e,'rows':_0x318627}:null;}})[_0x2db2('0x29')](respondWithResult(_0x1893fa,null))[_0x2db2('0x45')](handleError(_0x1893fa,null));};exports[_0x2db2('0x50')]=function(_0x334279,_0x4c9c55,_0x83815f){var _0x58b3cb={};var _0x5d4d93={};var _0x5ce79d;var _0x184e91;return db['ZendeskConfiguration'][_0x2db2('0x4c')]({'where':{'id':_0x334279[_0x2db2('0x47')]['id']}})[_0x2db2('0x29')](handleEntityNotFound(_0x4c9c55,null))[_0x2db2('0x29')](function(_0x32143f){if(_0x32143f){_0x5ce79d=_0x32143f;_0x5d4d93[_0x2db2('0x31')]=_['keys'](db['ZendeskField'][_0x2db2('0x2e')]);_0x5d4d93['query']=_['keys'](_0x334279[_0x2db2('0x32')]);_0x5d4d93[_0x2db2('0x34')]=_[_0x2db2('0x35')](_0x5d4d93['model'],_0x5d4d93[_0x2db2('0x32')]);_0x58b3cb[_0x2db2('0x36')]=_[_0x2db2('0x35')](_0x5d4d93[_0x2db2('0x31')],qs['fields'](_0x334279['query'][_0x2db2('0x37')]));_0x58b3cb[_0x2db2('0x36')]=_0x58b3cb[_0x2db2('0x36')]['length']?_0x58b3cb['attributes']:_0x5d4d93['model'];_0x58b3cb[_0x2db2('0x3b')]=qs[_0x2db2('0x3c')](_0x334279['query']['sort']);_0x58b3cb[_0x2db2('0x3d')]=qs[_0x2db2('0x34')](_[_0x2db2('0x3e')](_0x334279[_0x2db2('0x32')],_0x5d4d93[_0x2db2('0x34')]));if(_0x334279[_0x2db2('0x32')][_0x2db2('0x4e')]){_0x58b3cb[_0x2db2('0x3d')]=_[_0x2db2('0x3f')](_0x58b3cb[_0x2db2('0x3d')],{'$or':_['map'](_0x58b3cb[_0x2db2('0x36')],function(_0x142191){var _0x39bfe4={};_0x39bfe4[_0x142191]={'$like':'%'+_0x334279[_0x2db2('0x32')][_0x2db2('0x4e')]+'%'};return _0x39bfe4;})});}_0x58b3cb=_[_0x2db2('0x3f')]({},_0x58b3cb,_0x334279[_0x2db2('0x41')]);return _0x5ce79d[_0x2db2('0x50')](_0x58b3cb);}})[_0x2db2('0x29')](function(_0x23272a){if(_0x23272a){_0x184e91=_0x23272a[_0x2db2('0x38')];if(!_0x334279[_0x2db2('0x32')][_0x2db2('0x39')]('nolimit')){_0x58b3cb[_0x2db2('0x21')]=qs[_0x2db2('0x21')](_0x334279['query'][_0x2db2('0x21')]);_0x58b3cb['offset']=qs['offset'](_0x334279['query'][_0x2db2('0x20')]);}return _0x5ce79d[_0x2db2('0x50')](_0x58b3cb);}})[_0x2db2('0x29')](function(_0x37e599){if(_0x37e599){return _0x37e599?{'count':_0x184e91,'rows':_0x37e599}:null;}})['then'](respondWithResult(_0x4c9c55,null))['catch'](handleError(_0x4c9c55,null));};exports[_0x2db2('0x51')]=function(_0x1bebb0,_0x12d7d9,_0x3e4b85){var _0x4cd622={};var _0x5a458c={};var _0x297eb9;var _0x57a7e1;return db['ZendeskConfiguration'][_0x2db2('0x4c')]({'where':{'id':_0x1bebb0[_0x2db2('0x47')]['id']}})[_0x2db2('0x29')](handleEntityNotFound(_0x12d7d9,null))['then'](function(_0x2bb82d){if(_0x2bb82d){_0x297eb9=_0x2bb82d;_0x5a458c[_0x2db2('0x31')]=_[_0x2db2('0x33')](db[_0x2db2('0x4d')][_0x2db2('0x2e')]);_0x5a458c[_0x2db2('0x32')]=_[_0x2db2('0x33')](_0x1bebb0[_0x2db2('0x32')]);_0x5a458c[_0x2db2('0x34')]=_[_0x2db2('0x35')](_0x5a458c['model'],_0x5a458c[_0x2db2('0x32')]);_0x4cd622[_0x2db2('0x36')]=_[_0x2db2('0x35')](_0x5a458c[_0x2db2('0x31')],qs['fields'](_0x1bebb0[_0x2db2('0x32')][_0x2db2('0x37')]));_0x4cd622['attributes']=_0x4cd622[_0x2db2('0x36')][_0x2db2('0x38')]?_0x4cd622['attributes']:_0x5a458c[_0x2db2('0x31')];_0x4cd622[_0x2db2('0x3b')]=qs[_0x2db2('0x3c')](_0x1bebb0[_0x2db2('0x32')]['sort']);_0x4cd622[_0x2db2('0x3d')]=qs[_0x2db2('0x34')](_[_0x2db2('0x3e')](_0x1bebb0[_0x2db2('0x32')],_0x5a458c[_0x2db2('0x34')]));if(_0x1bebb0[_0x2db2('0x32')][_0x2db2('0x4e')]){_0x4cd622[_0x2db2('0x3d')]=_[_0x2db2('0x3f')](_0x4cd622[_0x2db2('0x3d')],{'$or':_[_0x2db2('0x2d')](_0x4cd622['attributes'],function(_0x2e92a3){var _0x41b515={};_0x41b515[_0x2e92a3]={'$like':'%'+_0x1bebb0['query'][_0x2db2('0x4e')]+'%'};return _0x41b515;})});}_0x4cd622=_[_0x2db2('0x3f')]({},_0x4cd622,_0x1bebb0[_0x2db2('0x41')]);return _0x297eb9[_0x2db2('0x51')](_0x4cd622);}})['then'](function(_0x42b71d){if(_0x42b71d){_0x57a7e1=_0x42b71d['length'];if(!_0x1bebb0[_0x2db2('0x32')][_0x2db2('0x39')](_0x2db2('0x3a'))){_0x4cd622[_0x2db2('0x21')]=qs['limit'](_0x1bebb0[_0x2db2('0x32')][_0x2db2('0x21')]);_0x4cd622['offset']=qs[_0x2db2('0x20')](_0x1bebb0[_0x2db2('0x32')][_0x2db2('0x20')]);}return _0x297eb9[_0x2db2('0x51')](_0x4cd622);}})[_0x2db2('0x29')](function(_0x59074a){if(_0x59074a){return _0x59074a?{'count':_0x57a7e1,'rows':_0x59074a}:null;}})['then'](respondWithResult(_0x12d7d9,null))[_0x2db2('0x45')](handleError(_0x12d7d9,null));};exports[_0x2db2('0x52')]=function(_0x248c53,_0xcdada0,_0x53d025){var _0x4a65e5={};var _0x1fa30d={};var _0x2f3697;var _0x25fa92;return db[_0x2db2('0x42')][_0x2db2('0x4c')]({'where':{'id':_0x248c53[_0x2db2('0x47')]['id']}})[_0x2db2('0x29')](handleEntityNotFound(_0xcdada0,null))[_0x2db2('0x29')](function(_0x40540b){if(_0x40540b){_0x2f3697=_0x40540b;_0x1fa30d['model']=_[_0x2db2('0x33')](db[_0x2db2('0x53')][_0x2db2('0x2e')]);_0x1fa30d[_0x2db2('0x32')]=_['keys'](_0x248c53[_0x2db2('0x32')]);_0x1fa30d[_0x2db2('0x34')]=_[_0x2db2('0x35')](_0x1fa30d[_0x2db2('0x31')],_0x1fa30d[_0x2db2('0x32')]);_0x4a65e5['attributes']=_[_0x2db2('0x35')](_0x1fa30d[_0x2db2('0x31')],qs['fields'](_0x248c53[_0x2db2('0x32')][_0x2db2('0x37')]));_0x4a65e5[_0x2db2('0x36')]=_0x4a65e5[_0x2db2('0x36')]['length']?_0x4a65e5['attributes']:_0x1fa30d['model'];_0x4a65e5['order']=qs['sort'](_0x248c53[_0x2db2('0x32')][_0x2db2('0x3c')]);_0x4a65e5[_0x2db2('0x3d')]=qs[_0x2db2('0x34')](_[_0x2db2('0x3e')](_0x248c53[_0x2db2('0x32')],_0x1fa30d[_0x2db2('0x34')]));if(_0x248c53['query'][_0x2db2('0x4e')]){_0x4a65e5[_0x2db2('0x3d')]=_[_0x2db2('0x3f')](_0x4a65e5[_0x2db2('0x3d')],{'$or':_[_0x2db2('0x2d')](_0x4a65e5[_0x2db2('0x36')],function(_0x2a6dbb){var _0x2ac999={};_0x2ac999[_0x2a6dbb]={'$like':'%'+_0x248c53[_0x2db2('0x32')][_0x2db2('0x4e')]+'%'};return _0x2ac999;})});}_0x4a65e5=_[_0x2db2('0x3f')]({},_0x4a65e5,_0x248c53[_0x2db2('0x41')]);return _0x2f3697['getTags'](_0x4a65e5);}})[_0x2db2('0x29')](function(_0xbbe03c){if(_0xbbe03c){_0x25fa92=_0xbbe03c['length'];if(!_0x248c53[_0x2db2('0x32')]['hasOwnProperty']('nolimit')){_0x4a65e5['limit']=qs[_0x2db2('0x21')](_0x248c53[_0x2db2('0x32')][_0x2db2('0x21')]);_0x4a65e5[_0x2db2('0x20')]=qs[_0x2db2('0x20')](_0x248c53['query'][_0x2db2('0x20')]);}return _0x2f3697[_0x2db2('0x52')](_0x4a65e5);}})[_0x2db2('0x29')](function(_0x27c81b){if(_0x27c81b){return _0x27c81b?{'count':_0x25fa92,'rows':_0x27c81b}:null;}})[_0x2db2('0x29')](respondWithResult(_0xcdada0,null))['catch'](handleError(_0xcdada0,null));};exports['setTags']=function(_0x5b02e0,_0x520c9f,_0xc28471){if(_0x5b02e0[_0x2db2('0x4a')]['id']){delete _0x5b02e0[_0x2db2('0x4a')]['id'];}return db['ZendeskConfiguration'][_0x2db2('0x4c')]({'where':{'id':_0x5b02e0[_0x2db2('0x47')]['id']}})[_0x2db2('0x29')](handleEntityNotFound(_0x520c9f,null))[_0x2db2('0x29')](function(_0x5e2c6e){if(_0x5e2c6e){return _0x5e2c6e['setTags'](_0x5b02e0[_0x2db2('0x4a')]['ids']||[]);}return null;})[_0x2db2('0x29')](respondWithResult(_0x520c9f,null))['catch'](handleError(_0x520c9f,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index bcdddde..e0bc3f4 100644 --- a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js +++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd7d1=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x1468aa,_0x497a0f){_0x1468aa=_0x1468aa-0x0;var _0x508e8e=_0xd7d1[_0x1468aa];return _0x508e8e;};'use strict';var _=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var logger=require(_0x1d7d('0x2'))(_0x1d7d('0x3'));var moment=require(_0x1d7d('0x4'));var BPromise=require(_0x1d7d('0x5'));var rp=require(_0x1d7d('0x6'));var fs=require('fs');var path=require(_0x1d7d('0x7'));var rimraf=require(_0x1d7d('0x8'));var config=require(_0x1d7d('0x9'));var attributes=require(_0x1d7d('0xa'));module[_0x1d7d('0xb')]=function(_0x14b2b9,_0x5a8cf3){return _0x14b2b9[_0x1d7d('0xc')](_0x1d7d('0xd'),attributes,{'tableName':_0x1d7d('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd4f4=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','define','ZendeskConfiguration','int_zendesk_configurations','lodash'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x209e6c,_0x363648){_0x209e6c=_0x209e6c-0x0;var _0x48b218=_0xd4f4[_0x209e6c];return _0x48b218;};'use strict';var _=require(_0x4d4f('0x0'));var util=require(_0x4d4f('0x1'));var logger=require(_0x4d4f('0x2'))(_0x4d4f('0x3'));var moment=require(_0x4d4f('0x4'));var BPromise=require(_0x4d4f('0x5'));var rp=require(_0x4d4f('0x6'));var fs=require('fs');var path=require(_0x4d4f('0x7'));var rimraf=require(_0x4d4f('0x8'));var config=require(_0x4d4f('0x9'));var attributes=require(_0x4d4f('0xa'));module['exports']=function(_0x5f451b,_0x5e38d2){return _0x5f451b[_0x4d4f('0xb')](_0x4d4f('0xc'),attributes,{'tableName':_0x4d4f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index f9b47c6..ca8b3a8 100644 --- a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js +++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdd1d=['then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x1d867e,_0x23d71d){var _0x2bc984=function(_0x537916){while(--_0x537916){_0x1d867e['push'](_0x1d867e['shift']());}};_0x2bc984(++_0x23d71d);}(_0xdd1d,0x6c));var _0xddd1=function(_0x874a49,_0x5b07bc){_0x874a49=_0x874a49-0x0;var _0x343d2f=_0xdd1d[_0x874a49];return _0x343d2f;};'use strict';var _=require(_0xddd1('0x0'));var util=require(_0xddd1('0x1'));var moment=require('moment');var BPromise=require(_0xddd1('0x2'));var rs=require(_0xddd1('0x3'));var fs=require('fs');var Redis=require(_0xddd1('0x4'));var db=require(_0xddd1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xddd1('0x6'))('rpc');var config=require(_0xddd1('0x7'));var jayson=require(_0xddd1('0x8'));var client=jayson[_0xddd1('0x9')][_0xddd1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5978d7,_0x4b5f2b,_0x4fdefd){return new BPromise(function(_0x135d6b,_0x1bde86){return client[_0xddd1('0xb')](_0x5978d7,_0x4fdefd)[_0xddd1('0xc')](function(_0x5ba807){logger['info'](_0xddd1('0xd'),_0x4b5f2b,_0xddd1('0xe'));logger[_0xddd1('0xf')](_0xddd1('0x10'),_0x4b5f2b,_0xddd1('0xe'),JSON[_0xddd1('0x11')](_0x5ba807));if(_0x5ba807[_0xddd1('0x12')]){if(_0x5ba807[_0xddd1('0x12')][_0xddd1('0x13')]===0x1f4){logger['error'](_0xddd1('0xd'),_0x4b5f2b,_0x5ba807[_0xddd1('0x12')][_0xddd1('0x14')]);return _0x1bde86(_0x5ba807['error'][_0xddd1('0x14')]);}logger['error'](_0xddd1('0xd'),_0x4b5f2b,_0x5ba807['error']['message']);return _0x135d6b(_0x5ba807[_0xddd1('0x12')][_0xddd1('0x14')]);}else{logger[_0xddd1('0x15')](_0xddd1('0xd'),_0x4b5f2b,_0xddd1('0xe'));_0x135d6b(_0x5ba807[_0xddd1('0x16')][_0xddd1('0x14')]);}})[_0xddd1('0x17')](function(_0x5b4364){logger[_0xddd1('0x12')](_0xddd1('0xd'),_0x4b5f2b,_0x5b4364);_0x1bde86(_0x5b4364);});});} \ No newline at end of file +var _0x1db1=['ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x412947,_0x151917){var _0x196bfd=function(_0x5682ec){while(--_0x5682ec){_0x412947['push'](_0x412947['shift']());}};_0x196bfd(++_0x151917);}(_0x1db1,0xe2));var _0x11db=function(_0x36a5b4,_0xc7ce7c){_0x36a5b4=_0x36a5b4-0x0;var _0x21cef9=_0x1db1[_0x36a5b4];return _0x21cef9;};'use strict';var _=require(_0x11db('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x11db('0x1'));var rs=require(_0x11db('0x2'));var fs=require('fs');var Redis=require(_0x11db('0x3'));var db=require(_0x11db('0x4'))['db'];var utils=require(_0x11db('0x5'));var logger=require(_0x11db('0x6'))(_0x11db('0x7'));var config=require('../../config/environment');var jayson=require(_0x11db('0x8'));var client=jayson['client'][_0x11db('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5799eb,_0x371750,_0xd096ea){return new BPromise(function(_0x3c5d76,_0x4b2e76){return client[_0x11db('0xa')](_0x5799eb,_0xd096ea)[_0x11db('0xb')](function(_0xd40e4f){logger[_0x11db('0xc')](_0x11db('0xd'),_0x371750,_0x11db('0xe'));logger[_0x11db('0xf')](_0x11db('0x10'),_0x371750,'request\x20sent',JSON[_0x11db('0x11')](_0xd40e4f));if(_0xd40e4f[_0x11db('0x12')]){if(_0xd40e4f['error'][_0x11db('0x13')]===0x1f4){logger[_0x11db('0x12')](_0x11db('0xd'),_0x371750,_0xd40e4f[_0x11db('0x12')][_0x11db('0x14')]);return _0x4b2e76(_0xd40e4f[_0x11db('0x12')][_0x11db('0x14')]);}logger[_0x11db('0x12')](_0x11db('0xd'),_0x371750,_0xd40e4f[_0x11db('0x12')][_0x11db('0x14')]);return _0x3c5d76(_0xd40e4f[_0x11db('0x12')][_0x11db('0x14')]);}else{logger[_0x11db('0xc')](_0x11db('0xd'),_0x371750,'request\x20sent');_0x3c5d76(_0xd40e4f['result'][_0x11db('0x14')]);}})[_0x11db('0x15')](function(_0x435e35){logger[_0x11db('0x12')](_0x11db('0xd'),_0x371750,_0x435e35);_0x4b2e76(_0x435e35);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 5a84e7c..286c0ac 100644 --- a/server/api/intZendeskField/index.js +++ b/server/api/intZendeskField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd124=['/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','isAuthenticated','get'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xd124,0x144));var _0x4d12=function(_0x58ed9b,_0x30faff){_0x58ed9b=_0x58ed9b-0x0;var _0x12e90c=_0xd124[_0x58ed9b];return _0x12e90c;};'use strict';var multer=require(_0x4d12('0x0'));var util=require(_0x4d12('0x1'));var path=require(_0x4d12('0x2'));var timeout=require('connect-timeout');var express=require(_0x4d12('0x3'));var router=express[_0x4d12('0x4')]();var fs_extra=require(_0x4d12('0x5'));var auth=require(_0x4d12('0x6'));var interaction=require(_0x4d12('0x7'));var config=require(_0x4d12('0x8'));var controller=require(_0x4d12('0x9'));router['get']('/',auth[_0x4d12('0xa')](),controller['index']);router[_0x4d12('0xb')](_0x4d12('0xc'),auth[_0x4d12('0xa')](),controller[_0x4d12('0xd')]);router[_0x4d12('0xe')]('/',auth[_0x4d12('0xa')](),controller[_0x4d12('0xf')]);router[_0x4d12('0x10')](_0x4d12('0xc'),auth[_0x4d12('0xa')](),controller[_0x4d12('0x11')]);router[_0x4d12('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x4d12('0x13')]);module[_0x4d12('0x14')]=router; \ No newline at end of file +var _0x5ce8=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x5b2809,_0x48b226){var _0x572dee=function(_0x4b3e82){while(--_0x4b3e82){_0x5b2809['push'](_0x5b2809['shift']());}};_0x572dee(++_0x48b226);}(_0x5ce8,0xde));var _0x85ce=function(_0x1e3cc9,_0x212a55){_0x1e3cc9=_0x1e3cc9-0x0;var _0xf26d1f=_0x5ce8[_0x1e3cc9];return _0xf26d1f;};'use strict';var multer=require('multer');var util=require(_0x85ce('0x0'));var path=require(_0x85ce('0x1'));var timeout=require(_0x85ce('0x2'));var express=require(_0x85ce('0x3'));var router=express['Router']();var fs_extra=require(_0x85ce('0x4'));var auth=require(_0x85ce('0x5'));var interaction=require(_0x85ce('0x6'));var config=require(_0x85ce('0x7'));var controller=require('./intZendeskField.controller');router[_0x85ce('0x8')]('/',auth[_0x85ce('0x9')](),controller[_0x85ce('0xa')]);router[_0x85ce('0x8')](_0x85ce('0xb'),auth['isAuthenticated'](),controller[_0x85ce('0xc')]);router[_0x85ce('0xd')]('/',auth[_0x85ce('0x9')](),controller[_0x85ce('0xe')]);router['put']('/:id',auth[_0x85ce('0x9')](),controller[_0x85ce('0xf')]);router[_0x85ce('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x85ce('0x11')]);module[_0x85ce('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 2a36bd2..c782ca3 100644 --- a/server/api/intZendeskField/intZendeskField.attributes.js +++ b/server/api/intZendeskField/intZendeskField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe7c4=['ENUM','string','variable','customVariable','picklist','STRING','BOOLEAN','sequelize','exports'];(function(_0xbb2e25,_0x30535e){var _0xf49318=function(_0x86428d){while(--_0x86428d){_0xbb2e25['push'](_0xbb2e25['shift']());}};_0xf49318(++_0x30535e);}(_0xe7c4,0x127));var _0x4e7c=function(_0x58f81c,_0x25caa3){_0x58f81c=_0x58f81c-0x0;var _0x5bd385=_0xe7c4[_0x58f81c];return _0x5bd385;};'use strict';var Sequelize=require(_0x4e7c('0x0'));module[_0x4e7c('0x1')]={'type':{'type':Sequelize[_0x4e7c('0x2')](_0x4e7c('0x3'),_0x4e7c('0x4'),_0x4e7c('0x5'),'keyValue',_0x4e7c('0x6')),'defaultValue':_0x4e7c('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x4e7c('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x4e7c('0x3'),_0x4e7c('0x4'),_0x4e7c('0x5'))},'keyContent':{'type':Sequelize[_0x4e7c('0x7')]},'idField':{'type':Sequelize[_0x4e7c('0x7')]},'nameField':{'type':Sequelize[_0x4e7c('0x7')]},'customField':{'type':Sequelize[_0x4e7c('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa08c=['BOOLEAN','sequelize','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x20f1fe,_0x57f703){var _0x511c1b=function(_0x3eb0c3){while(--_0x3eb0c3){_0x20f1fe['push'](_0x20f1fe['shift']());}};_0x511c1b(++_0x57f703);}(_0xa08c,0x1e9));var _0xca08=function(_0x471b66,_0x1281a4){_0x471b66=_0x471b66-0x0;var _0x48cbde=_0xa08c[_0x471b66];return _0x48cbde;};'use strict';var Sequelize=require(_0xca08('0x0'));module['exports']={'type':{'type':Sequelize[_0xca08('0x1')](_0xca08('0x2'),_0xca08('0x3'),_0xca08('0x4'),_0xca08('0x5'),'picklist'),'defaultValue':_0xca08('0x2')},'content':{'type':Sequelize[_0xca08('0x6')]},'key':{'type':Sequelize[_0xca08('0x6')]},'keyType':{'type':Sequelize[_0xca08('0x1')](_0xca08('0x2'),_0xca08('0x3'),_0xca08('0x4'))},'keyContent':{'type':Sequelize[_0xca08('0x6')]},'idField':{'type':Sequelize[_0xca08('0x6')]},'nameField':{'type':Sequelize[_0xca08('0x6')]},'customField':{'type':Sequelize[_0xca08('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xca08('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 7a6d196..f24466c 100644 --- a/server/api/intZendeskField/intZendeskField.controller.js +++ b/server/api/intZendeskField/intZendeskField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdafe=['rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','end','stack','name','send','index','map','ZendeskField'];(function(_0x50c275,_0x29c965){var _0x162928=function(_0x2aee47){while(--_0x2aee47){_0x50c275['push'](_0x50c275['shift']());}};_0x162928(++_0x29c965);}(_0xdafe,0x6a));var _0xedaf=function(_0x385643,_0x3876b0){_0x385643=_0x385643-0x0;var _0x33ee74=_0xdafe[_0x385643];return _0x33ee74;};'use strict';var emlformat=require(_0xedaf('0x0'));var rimraf=require(_0xedaf('0x1'));var zipdir=require(_0xedaf('0x2'));var jsonpatch=require(_0xedaf('0x3'));var rp=require(_0xedaf('0x4'));var moment=require(_0xedaf('0x5'));var BPromise=require(_0xedaf('0x6'));var Mustache=require(_0xedaf('0x7'));var util=require(_0xedaf('0x8'));var path=require(_0xedaf('0x9'));var sox=require(_0xedaf('0xa'));var csv=require(_0xedaf('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xedaf('0xc'));var _=require('lodash');var squel=require(_0xedaf('0xd'));var crypto=require(_0xedaf('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xedaf('0xb'));var querystring=require(_0xedaf('0xf'));var Papa=require(_0xedaf('0x10'));var Redis=require(_0xedaf('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xedaf('0x12'))(_0xedaf('0x13'));var utils=require(_0xedaf('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xedaf('0x15'));var db=require(_0xedaf('0x16'))['db'];function respondWithStatusCode(_0x22b829,_0x292147){_0x292147=_0x292147||0xcc;return function(_0x49ca2a){if(_0x49ca2a){return _0x22b829[_0xedaf('0x17')](_0x292147);}return _0x22b829[_0xedaf('0x18')](_0x292147)['end']();};}function respondWithResult(_0x192cdd,_0xbf372d){_0xbf372d=_0xbf372d||0xc8;return function(_0x252562){if(_0x252562){return _0x192cdd[_0xedaf('0x18')](_0xbf372d)[_0xedaf('0x19')](_0x252562);}};}function respondWithFilteredResult(_0x123455,_0x25e675){return function(_0x36b509){if(_0x36b509){var _0x5ac04d=typeof _0x25e675[_0xedaf('0x1a')]===_0xedaf('0x1b')&&typeof _0x25e675['limit']===_0xedaf('0x1b');var _0x21ba39=_0x36b509['count'];var _0x4cbe04=_0x5ac04d?0x0:_0x25e675[_0xedaf('0x1a')];var _0x442426=_0x5ac04d?_0x36b509[_0xedaf('0x1c')]:_0x25e675[_0xedaf('0x1a')]+_0x25e675['limit'];var _0x395286;if(_0x442426>=_0x21ba39){_0x442426=_0x21ba39;_0x395286=0xc8;}else{_0x395286=0xce;}_0x123455[_0xedaf('0x18')](_0x395286);return _0x123455[_0xedaf('0x1d')](_0xedaf('0x1e'),_0x4cbe04+'-'+_0x442426+'/'+_0x21ba39)[_0xedaf('0x19')](_0x36b509);}return null;};}function patchUpdates(_0xaa04ef){return function(_0x5dc0d8){try{jsonpatch[_0xedaf('0x1f')](_0x5dc0d8,_0xaa04ef,!![]);}catch(_0x51d2c5){return BPromise[_0xedaf('0x20')](_0x51d2c5);}return _0x5dc0d8['save']();};}function saveUpdates(_0x3370c8,_0x4bb879){return function(_0x47cc37){if(_0x47cc37){return _0x47cc37[_0xedaf('0x21')](_0x3370c8)[_0xedaf('0x22')](function(_0x19f087){return _0x19f087;});}return null;};}function removeEntity(_0x1b1e04,_0x560452){return function(_0x483f6a){if(_0x483f6a){return _0x483f6a['destroy']()[_0xedaf('0x22')](function(){_0x1b1e04[_0xedaf('0x18')](0xcc)[_0xedaf('0x23')]();});}};}function handleEntityNotFound(_0x263b41,_0x3b2e07){return function(_0x5a8d11){if(!_0x5a8d11){_0x263b41[_0xedaf('0x17')](0x194);}return _0x5a8d11;};}function handleError(_0x6ff521,_0x48e180){_0x48e180=_0x48e180||0x1f4;return function(_0x35c2e7){logger['error'](_0x35c2e7[_0xedaf('0x24')]);if(_0x35c2e7[_0xedaf('0x25')]){delete _0x35c2e7[_0xedaf('0x25')];}_0x6ff521[_0xedaf('0x18')](_0x48e180)[_0xedaf('0x26')](_0x35c2e7);};}exports[_0xedaf('0x27')]=function(_0x2d18d8,_0x19b0a1){var _0x2d0873={},_0x3708ed={},_0x5e7ad9={'count':0x0,'rows':[]};var _0x38f7a9=_[_0xedaf('0x28')](db[_0xedaf('0x29')][_0xedaf('0x2a')],function(_0x95250d){return{'name':_0x95250d[_0xedaf('0x2b')],'type':_0x95250d[_0xedaf('0x2c')][_0xedaf('0x2d')]};});_0x3708ed[_0xedaf('0x2e')]=_[_0xedaf('0x28')](_0x38f7a9,_0xedaf('0x25'));_0x3708ed[_0xedaf('0x2f')]=_['keys'](_0x2d18d8[_0xedaf('0x2f')]);_0x3708ed[_0xedaf('0x30')]=_[_0xedaf('0x31')](_0x3708ed['model'],_0x3708ed[_0xedaf('0x2f')]);_0x2d0873[_0xedaf('0x32')]=_['intersection'](_0x3708ed[_0xedaf('0x2e')],qs['fields'](_0x2d18d8[_0xedaf('0x2f')][_0xedaf('0x33')]));_0x2d0873['attributes']=_0x2d0873['attributes'][_0xedaf('0x34')]?_0x2d0873[_0xedaf('0x32')]:_0x3708ed[_0xedaf('0x2e')];if(!_0x2d18d8[_0xedaf('0x2f')][_0xedaf('0x35')](_0xedaf('0x36'))){_0x2d0873[_0xedaf('0x37')]=qs['limit'](_0x2d18d8[_0xedaf('0x2f')][_0xedaf('0x37')]);_0x2d0873[_0xedaf('0x1a')]=qs[_0xedaf('0x1a')](_0x2d18d8[_0xedaf('0x2f')][_0xedaf('0x1a')]);}_0x2d0873['order']=qs[_0xedaf('0x38')](_0x2d18d8[_0xedaf('0x2f')][_0xedaf('0x38')]);_0x2d0873[_0xedaf('0x39')]=qs[_0xedaf('0x30')](_['pick'](_0x2d18d8[_0xedaf('0x2f')],_0x3708ed[_0xedaf('0x30')]),_0x38f7a9);if(_0x2d18d8['query'][_0xedaf('0x3a')]){_0x2d0873[_0xedaf('0x39')]=_[_0xedaf('0x3b')](_0x2d0873[_0xedaf('0x39')],{'$or':_['map'](_0x38f7a9,function(_0x1eea75){if(_0x1eea75[_0xedaf('0x2c')]!==_0xedaf('0x3c')){var _0x3adcac={};_0x3adcac[_0x1eea75[_0xedaf('0x25')]]={'$like':'%'+_0x2d18d8[_0xedaf('0x2f')][_0xedaf('0x3a')]+'%'};return _0x3adcac;}})});}_0x2d0873=_[_0xedaf('0x3b')]({},_0x2d0873,_0x2d18d8[_0xedaf('0x3d')]);var _0x1a448a={'where':_0x2d0873['where']};return db['ZendeskField'][_0xedaf('0x1c')](_0x1a448a)[_0xedaf('0x22')](function(_0x440f68){_0x5e7ad9[_0xedaf('0x1c')]=_0x440f68;if(_0x2d18d8[_0xedaf('0x2f')][_0xedaf('0x3e')]){_0x2d0873[_0xedaf('0x3f')]=[{'all':!![]}];}return db[_0xedaf('0x29')][_0xedaf('0x40')](_0x2d0873);})[_0xedaf('0x22')](function(_0x450102){_0x5e7ad9[_0xedaf('0x41')]=_0x450102;return _0x5e7ad9;})[_0xedaf('0x22')](respondWithFilteredResult(_0x19b0a1,_0x2d0873))['catch'](handleError(_0x19b0a1,null));};exports[_0xedaf('0x42')]=function(_0x343ae1,_0x33f8ee){var _0x2257fd={'raw':!![],'where':{'id':_0x343ae1[_0xedaf('0x43')]['id']}},_0xfed928={};_0xfed928[_0xedaf('0x2e')]=_[_0xedaf('0x44')](db['ZendeskField'][_0xedaf('0x2a')]);_0xfed928[_0xedaf('0x2f')]=_[_0xedaf('0x44')](_0x343ae1['query']);_0xfed928[_0xedaf('0x30')]=_['intersection'](_0xfed928['model'],_0xfed928[_0xedaf('0x2f')]);_0x2257fd[_0xedaf('0x32')]=_[_0xedaf('0x31')](_0xfed928[_0xedaf('0x2e')],qs[_0xedaf('0x33')](_0x343ae1[_0xedaf('0x2f')]['fields']));_0x2257fd[_0xedaf('0x32')]=_0x2257fd[_0xedaf('0x32')][_0xedaf('0x34')]?_0x2257fd[_0xedaf('0x32')]:_0xfed928[_0xedaf('0x2e')];if(_0x343ae1[_0xedaf('0x2f')][_0xedaf('0x3e')]){_0x2257fd[_0xedaf('0x3f')]=[{'all':!![]}];}_0x2257fd=_[_0xedaf('0x3b')]({},_0x2257fd,_0x343ae1[_0xedaf('0x3d')]);return db[_0xedaf('0x29')][_0xedaf('0x45')](_0x2257fd)[_0xedaf('0x22')](handleEntityNotFound(_0x33f8ee,null))[_0xedaf('0x22')](respondWithResult(_0x33f8ee,null))[_0xedaf('0x46')](handleError(_0x33f8ee,null));};exports[_0xedaf('0x47')]=function(_0x2b71bd,_0x358e61){return db[_0xedaf('0x29')][_0xedaf('0x47')](_0x2b71bd['body'],{})[_0xedaf('0x22')](respondWithResult(_0x358e61,0xc9))[_0xedaf('0x46')](handleError(_0x358e61,null));};exports[_0xedaf('0x21')]=function(_0xb791f6,_0x349b55){if(_0xb791f6['body']['id']){delete _0xb791f6[_0xedaf('0x48')]['id'];}return db[_0xedaf('0x29')][_0xedaf('0x45')]({'where':{'id':_0xb791f6[_0xedaf('0x43')]['id']}})[_0xedaf('0x22')](handleEntityNotFound(_0x349b55,null))['then'](saveUpdates(_0xb791f6[_0xedaf('0x48')],null))['then'](respondWithResult(_0x349b55,null))['catch'](handleError(_0x349b55,null));};exports[_0xedaf('0x49')]=function(_0x55faba,_0x28296a){return db[_0xedaf('0x29')][_0xedaf('0x45')]({'where':{'id':_0x55faba[_0xedaf('0x43')]['id']}})['then'](handleEntityNotFound(_0x28296a,null))[_0xedaf('0x22')](removeEntity(_0x28296a,null))['catch'](handleError(_0x28296a,null));}; \ No newline at end of file +var _0xbe1e=['lodash','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','ZendeskField','type','model','keys','filters','intersection','query','attributes','length','nolimit','limit','sort','where','pick','filter','merge','options','catch','params','rawAttributes','fields','includeAll','include','create','body','find','eml-format','zip-dir','fast-json-patch','moment','mustache','util','to-csv','fs-extra'];(function(_0xa06295,_0x274e7b){var _0x4d137b=function(_0x1af468){while(--_0x1af468){_0xa06295['push'](_0xa06295['shift']());}};_0x4d137b(++_0x274e7b);}(_0xbe1e,0xf8));var _0xebe1=function(_0x215f91,_0x42721a){_0x215f91=_0x215f91-0x0;var _0x396370=_0xbe1e[_0x215f91];return _0x396370;};'use strict';var emlformat=require(_0xebe1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xebe1('0x1'));var jsonpatch=require(_0xebe1('0x2'));var rp=require('request-promise');var moment=require(_0xebe1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xebe1('0x4'));var util=require(_0xebe1('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xebe1('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xebe1('0x7'));var _=require(_0xebe1('0x8'));var squel=require(_0xebe1('0x9'));var crypto=require('crypto');var jsforce=require(_0xebe1('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xebe1('0x6'));var querystring=require(_0xebe1('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xebe1('0xc'));var qs=require(_0xebe1('0xd'));var as=require(_0xebe1('0xe'));var hardwareService=require(_0xebe1('0xf'));var logger=require(_0xebe1('0x10'))(_0xebe1('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xebe1('0x12'))['db'];function respondWithStatusCode(_0x2c171d,_0x545ba3){_0x545ba3=_0x545ba3||0xcc;return function(_0xfa02cb){if(_0xfa02cb){return _0x2c171d[_0xebe1('0x13')](_0x545ba3);}return _0x2c171d[_0xebe1('0x14')](_0x545ba3)[_0xebe1('0x15')]();};}function respondWithResult(_0x50166c,_0x450642){_0x450642=_0x450642||0xc8;return function(_0x44accb){if(_0x44accb){return _0x50166c[_0xebe1('0x14')](_0x450642)[_0xebe1('0x16')](_0x44accb);}};}function respondWithFilteredResult(_0x1b0978,_0xc4803){return function(_0xeef5a2){if(_0xeef5a2){var _0x32b06a=typeof _0xc4803[_0xebe1('0x17')]===_0xebe1('0x18')&&typeof _0xc4803['limit']===_0xebe1('0x18');var _0x33e35d=_0xeef5a2['count'];var _0xe476d4=_0x32b06a?0x0:_0xc4803[_0xebe1('0x17')];var _0x44ef3e=_0x32b06a?_0xeef5a2[_0xebe1('0x19')]:_0xc4803[_0xebe1('0x17')]+_0xc4803['limit'];var _0x20f757;if(_0x44ef3e>=_0x33e35d){_0x44ef3e=_0x33e35d;_0x20f757=0xc8;}else{_0x20f757=0xce;}_0x1b0978[_0xebe1('0x14')](_0x20f757);return _0x1b0978[_0xebe1('0x1a')](_0xebe1('0x1b'),_0xe476d4+'-'+_0x44ef3e+'/'+_0x33e35d)[_0xebe1('0x16')](_0xeef5a2);}return null;};}function patchUpdates(_0x198116){return function(_0x574f28){try{jsonpatch[_0xebe1('0x1c')](_0x574f28,_0x198116,!![]);}catch(_0x1302fd){return BPromise['reject'](_0x1302fd);}return _0x574f28['save']();};}function saveUpdates(_0x38dd4d,_0x39f357){return function(_0x2bfaad){if(_0x2bfaad){return _0x2bfaad[_0xebe1('0x1d')](_0x38dd4d)[_0xebe1('0x1e')](function(_0x273290){return _0x273290;});}return null;};}function removeEntity(_0x3040c6,_0x46dd74){return function(_0x5c9074){if(_0x5c9074){return _0x5c9074[_0xebe1('0x1f')]()[_0xebe1('0x1e')](function(){_0x3040c6[_0xebe1('0x14')](0xcc)[_0xebe1('0x15')]();});}};}function handleEntityNotFound(_0x390459,_0x11bf01){return function(_0x138986){if(!_0x138986){_0x390459[_0xebe1('0x13')](0x194);}return _0x138986;};}function handleError(_0x56caab,_0x24457f){_0x24457f=_0x24457f||0x1f4;return function(_0x4716a0){logger[_0xebe1('0x20')](_0x4716a0[_0xebe1('0x21')]);if(_0x4716a0[_0xebe1('0x22')]){delete _0x4716a0[_0xebe1('0x22')];}_0x56caab[_0xebe1('0x14')](_0x24457f)[_0xebe1('0x23')](_0x4716a0);};}exports[_0xebe1('0x24')]=function(_0x456881,_0x21c581){var _0x495b73={},_0x516f07={},_0x3f9c04={'count':0x0,'rows':[]};var _0xd040f3=_[_0xebe1('0x25')](db[_0xebe1('0x26')]['rawAttributes'],function(_0x517ec1){return{'name':_0x517ec1['fieldName'],'type':_0x517ec1[_0xebe1('0x27')]['key']};});_0x516f07[_0xebe1('0x28')]=_['map'](_0xd040f3,_0xebe1('0x22'));_0x516f07['query']=_[_0xebe1('0x29')](_0x456881['query']);_0x516f07[_0xebe1('0x2a')]=_[_0xebe1('0x2b')](_0x516f07['model'],_0x516f07[_0xebe1('0x2c')]);_0x495b73[_0xebe1('0x2d')]=_[_0xebe1('0x2b')](_0x516f07['model'],qs['fields'](_0x456881[_0xebe1('0x2c')]['fields']));_0x495b73[_0xebe1('0x2d')]=_0x495b73[_0xebe1('0x2d')][_0xebe1('0x2e')]?_0x495b73[_0xebe1('0x2d')]:_0x516f07[_0xebe1('0x28')];if(!_0x456881[_0xebe1('0x2c')]['hasOwnProperty'](_0xebe1('0x2f'))){_0x495b73['limit']=qs[_0xebe1('0x30')](_0x456881[_0xebe1('0x2c')][_0xebe1('0x30')]);_0x495b73['offset']=qs[_0xebe1('0x17')](_0x456881[_0xebe1('0x2c')][_0xebe1('0x17')]);}_0x495b73['order']=qs[_0xebe1('0x31')](_0x456881[_0xebe1('0x2c')]['sort']);_0x495b73[_0xebe1('0x32')]=qs['filters'](_[_0xebe1('0x33')](_0x456881[_0xebe1('0x2c')],_0x516f07[_0xebe1('0x2a')]),_0xd040f3);if(_0x456881[_0xebe1('0x2c')][_0xebe1('0x34')]){_0x495b73[_0xebe1('0x32')]=_[_0xebe1('0x35')](_0x495b73[_0xebe1('0x32')],{'$or':_[_0xebe1('0x25')](_0xd040f3,function(_0x2ce97f){if(_0x2ce97f[_0xebe1('0x27')]!=='VIRTUAL'){var _0x2b1e17={};_0x2b1e17[_0x2ce97f[_0xebe1('0x22')]]={'$like':'%'+_0x456881['query'][_0xebe1('0x34')]+'%'};return _0x2b1e17;}})});}_0x495b73=_['merge']({},_0x495b73,_0x456881[_0xebe1('0x36')]);var _0x3e5273={'where':_0x495b73[_0xebe1('0x32')]};return db[_0xebe1('0x26')][_0xebe1('0x19')](_0x3e5273)['then'](function(_0x1fdd75){_0x3f9c04['count']=_0x1fdd75;if(_0x456881['query']['includeAll']){_0x495b73['include']=[{'all':!![]}];}return db[_0xebe1('0x26')]['findAll'](_0x495b73);})[_0xebe1('0x1e')](function(_0x36be9e){_0x3f9c04['rows']=_0x36be9e;return _0x3f9c04;})[_0xebe1('0x1e')](respondWithFilteredResult(_0x21c581,_0x495b73))[_0xebe1('0x37')](handleError(_0x21c581,null));};exports['show']=function(_0x163774,_0x101e42){var _0x191081={'raw':!![],'where':{'id':_0x163774[_0xebe1('0x38')]['id']}},_0x5ea602={};_0x5ea602['model']=_[_0xebe1('0x29')](db[_0xebe1('0x26')][_0xebe1('0x39')]);_0x5ea602['query']=_['keys'](_0x163774[_0xebe1('0x2c')]);_0x5ea602[_0xebe1('0x2a')]=_[_0xebe1('0x2b')](_0x5ea602[_0xebe1('0x28')],_0x5ea602[_0xebe1('0x2c')]);_0x191081['attributes']=_['intersection'](_0x5ea602[_0xebe1('0x28')],qs['fields'](_0x163774[_0xebe1('0x2c')][_0xebe1('0x3a')]));_0x191081[_0xebe1('0x2d')]=_0x191081[_0xebe1('0x2d')][_0xebe1('0x2e')]?_0x191081[_0xebe1('0x2d')]:_0x5ea602[_0xebe1('0x28')];if(_0x163774['query'][_0xebe1('0x3b')]){_0x191081[_0xebe1('0x3c')]=[{'all':!![]}];}_0x191081=_[_0xebe1('0x35')]({},_0x191081,_0x163774['options']);return db[_0xebe1('0x26')]['find'](_0x191081)['then'](handleEntityNotFound(_0x101e42,null))[_0xebe1('0x1e')](respondWithResult(_0x101e42,null))[_0xebe1('0x37')](handleError(_0x101e42,null));};exports[_0xebe1('0x3d')]=function(_0x3aca6a,_0x33eda2){return db[_0xebe1('0x26')][_0xebe1('0x3d')](_0x3aca6a['body'],{})[_0xebe1('0x1e')](respondWithResult(_0x33eda2,0xc9))[_0xebe1('0x37')](handleError(_0x33eda2,null));};exports['update']=function(_0x2686b6,_0x4c5516){if(_0x2686b6[_0xebe1('0x3e')]['id']){delete _0x2686b6[_0xebe1('0x3e')]['id'];}return db[_0xebe1('0x26')]['find']({'where':{'id':_0x2686b6[_0xebe1('0x38')]['id']}})[_0xebe1('0x1e')](handleEntityNotFound(_0x4c5516,null))[_0xebe1('0x1e')](saveUpdates(_0x2686b6[_0xebe1('0x3e')],null))[_0xebe1('0x1e')](respondWithResult(_0x4c5516,null))[_0xebe1('0x37')](handleError(_0x4c5516,null));};exports[_0xebe1('0x1f')]=function(_0x37634f,_0x541913){return db[_0xebe1('0x26')][_0xebe1('0x3f')]({'where':{'id':_0x37634f[_0xebe1('0x38')]['id']}})['then'](handleEntityNotFound(_0x541913,null))[_0xebe1('0x1e')](removeEntity(_0x541913,null))[_0xebe1('0x37')](handleError(_0x541913,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index e04ace1..5641f62 100644 --- a/server/api/intZendeskField/intZendeskField.model.js +++ b/server/api/intZendeskField/intZendeskField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4b2e=['FieldId','lodash','util','../../config/logger','api','request-promise','path','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField'];(function(_0x2cb779,_0x5c4755){var _0x517a18=function(_0x49cb1d){while(--_0x49cb1d){_0x2cb779['push'](_0x2cb779['shift']());}};_0x517a18(++_0x5c4755);}(_0x4b2e,0x7f));var _0xe4b2=function(_0x49c9fa,_0x2c3fb5){_0x49c9fa=_0x49c9fa-0x0;var _0xa8db1d=_0x4b2e[_0x49c9fa];return _0xa8db1d;};'use strict';var _=require(_0xe4b2('0x0'));var util=require(_0xe4b2('0x1'));var logger=require(_0xe4b2('0x2'))(_0xe4b2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe4b2('0x4'));var fs=require('fs');var path=require(_0xe4b2('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe4b2('0x6'));module[_0xe4b2('0x7')]=function(_0xdb95e8,_0x2fcca4){return _0xdb95e8[_0xe4b2('0x8')](_0xe4b2('0x9'),attributes,{'tableName':_0xe4b2('0xa'),'paranoid':![],'indexes':[{'name':_0xe4b2('0xb'),'fields':[_0xe4b2('0xc'),_0xe4b2('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4434=['lodash','api','moment','bluebird','request-promise','path','../../config/environment','exports','ZendeskField','idField'];(function(_0x3f0a20,_0x559a3c){var _0x5a0b5f=function(_0x5c8502){while(--_0x5c8502){_0x3f0a20['push'](_0x3f0a20['shift']());}};_0x5a0b5f(++_0x559a3c);}(_0x4434,0xbe));var _0x4443=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x4434[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x4443('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4443('0x1'));var moment=require(_0x4443('0x2'));var BPromise=require(_0x4443('0x3'));var rp=require(_0x4443('0x4'));var fs=require('fs');var path=require(_0x4443('0x5'));var rimraf=require('rimraf');var config=require(_0x4443('0x6'));var attributes=require('./intZendeskField.attributes');module[_0x4443('0x7')]=function(_0xb67e24,_0x5ac293){return _0xb67e24['define'](_0x4443('0x8'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0x4443('0x9'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index 84adde2..bc9ddc5 100644 --- a/server/api/intZendeskField/intZendeskField.rpc.js +++ b/server/api/intZendeskField/intZendeskField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe04c=['util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','message','lodash'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xe04c,0x7d));var _0xce04=function(_0x165715,_0x23c59d){_0x165715=_0x165715-0x0;var _0x40f62a=_0xe04c[_0x165715];return _0x40f62a;};'use strict';var _=require(_0xce04('0x0'));var util=require(_0xce04('0x1'));var moment=require(_0xce04('0x2'));var BPromise=require(_0xce04('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xce04('0x4'))['db'];var utils=require(_0xce04('0x5'));var logger=require(_0xce04('0x6'))(_0xce04('0x7'));var config=require(_0xce04('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4153f8,_0x449bdd,_0x16c3ac){return new BPromise(function(_0x5c2587,_0x59f035){return client[_0xce04('0x9')](_0x4153f8,_0x16c3ac)[_0xce04('0xa')](function(_0x458a9e){logger[_0xce04('0xb')](_0xce04('0xc'),_0x449bdd,_0xce04('0xd'));logger[_0xce04('0xe')](_0xce04('0xf'),_0x449bdd,_0xce04('0xd'),JSON['stringify'](_0x458a9e));if(_0x458a9e[_0xce04('0x10')]){if(_0x458a9e['error']['code']===0x1f4){logger[_0xce04('0x10')](_0xce04('0xc'),_0x449bdd,_0x458a9e[_0xce04('0x10')]['message']);return _0x59f035(_0x458a9e[_0xce04('0x10')][_0xce04('0x11')]);}logger[_0xce04('0x10')](_0xce04('0xc'),_0x449bdd,_0x458a9e['error'][_0xce04('0x11')]);return _0x5c2587(_0x458a9e[_0xce04('0x10')][_0xce04('0x11')]);}else{logger[_0xce04('0xb')](_0xce04('0xc'),_0x449bdd,'request\x20sent');_0x5c2587(_0x458a9e['result'][_0xce04('0x11')]);}})['catch'](function(_0x120a66){logger['error'](_0xce04('0xc'),_0x449bdd,_0x120a66);_0x59f035(_0x120a66);});});} \ No newline at end of file +var _0x1cec=['code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x29c3b2,_0x3c12ac){var _0x4b3aa7=function(_0x622a9d){while(--_0x622a9d){_0x29c3b2['push'](_0x29c3b2['shift']());}};_0x4b3aa7(++_0x3c12ac);}(_0x1cec,0x123));var _0xc1ce=function(_0x57af29,_0x520698){_0x57af29=_0x57af29-0x0;var _0x5c3272=_0x1cec[_0x57af29];return _0x5c3272;};'use strict';var _=require(_0xc1ce('0x0'));var util=require(_0xc1ce('0x1'));var moment=require(_0xc1ce('0x2'));var BPromise=require(_0xc1ce('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc1ce('0x4'));var db=require(_0xc1ce('0x5'))['db'];var utils=require(_0xc1ce('0x6'));var logger=require(_0xc1ce('0x7'))('rpc');var config=require(_0xc1ce('0x8'));var jayson=require(_0xc1ce('0x9'));var client=jayson[_0xc1ce('0xa')][_0xc1ce('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12244d,_0x218882,_0x52d5d9){return new BPromise(function(_0x4b7e4a,_0x493449){return client[_0xc1ce('0xc')](_0x12244d,_0x52d5d9)[_0xc1ce('0xd')](function(_0x5f17de){logger[_0xc1ce('0xe')](_0xc1ce('0xf'),_0x218882,_0xc1ce('0x10'));logger[_0xc1ce('0x11')](_0xc1ce('0x12'),_0x218882,'request\x20sent',JSON[_0xc1ce('0x13')](_0x5f17de));if(_0x5f17de[_0xc1ce('0x14')]){if(_0x5f17de[_0xc1ce('0x14')][_0xc1ce('0x15')]===0x1f4){logger['error'](_0xc1ce('0xf'),_0x218882,_0x5f17de[_0xc1ce('0x14')]['message']);return _0x493449(_0x5f17de[_0xc1ce('0x14')][_0xc1ce('0x16')]);}logger[_0xc1ce('0x14')](_0xc1ce('0xf'),_0x218882,_0x5f17de[_0xc1ce('0x14')][_0xc1ce('0x16')]);return _0x4b7e4a(_0x5f17de[_0xc1ce('0x14')]['message']);}else{logger[_0xc1ce('0xe')](_0xc1ce('0xf'),_0x218882,'request\x20sent');_0x4b7e4a(_0x5f17de['result'][_0xc1ce('0x16')]);}})[_0xc1ce('0x17')](function(_0x51434b){logger['error'](_0xc1ce('0xf'),_0x218882,_0x51434b);_0x493449(_0x51434b);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 60518f4..cf25207 100644 --- a/server/api/intZohoAccount/index.js +++ b/server/api/intZohoAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0097=['./intZohoAccount.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','create','post','/:id/configurations','addConfiguration','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0x0097,0x1c4));var _0x7009=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0097[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7009('0x0'));var util=require(_0x7009('0x1'));var path=require(_0x7009('0x2'));var timeout=require('connect-timeout');var express=require(_0x7009('0x3'));var router=express[_0x7009('0x4')]();var fs_extra=require(_0x7009('0x5'));var auth=require(_0x7009('0x6'));var interaction=require(_0x7009('0x7'));var config=require('../../config/environment');var controller=require(_0x7009('0x8'));router[_0x7009('0x9')]('/',auth[_0x7009('0xa')](),controller['index']);router[_0x7009('0x9')](_0x7009('0xb'),auth[_0x7009('0xa')](),controller[_0x7009('0xc')]);router[_0x7009('0x9')]('/:id/configurations',auth[_0x7009('0xa')](),controller['getConfigurations']);router[_0x7009('0x9')](_0x7009('0xd'),auth[_0x7009('0xa')](),controller[_0x7009('0xe')]);router['post']('/',auth[_0x7009('0xa')](),controller[_0x7009('0xf')]);router[_0x7009('0x10')](_0x7009('0x11'),auth[_0x7009('0xa')](),controller[_0x7009('0x12')]);router['put']('/:id',auth[_0x7009('0xa')](),controller[_0x7009('0x13')]);router[_0x7009('0x14')](_0x7009('0xb'),auth[_0x7009('0xa')](),controller[_0x7009('0x15')]);module[_0x7009('0x16')]=router; \ No newline at end of file +var _0x5f95=['getFields','post','create','addConfiguration','put','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations'];(function(_0x38735d,_0x5c04cf){var _0xcb3526=function(_0x3d2c18){while(--_0x3d2c18){_0x38735d['push'](_0x38735d['shift']());}};_0xcb3526(++_0x5c04cf);}(_0x5f95,0x7f));var _0x55f9=function(_0xf7c94b,_0x2accd9){_0xf7c94b=_0xf7c94b-0x0;var _0x36844f=_0x5f95[_0xf7c94b];return _0x36844f;};'use strict';var multer=require(_0x55f9('0x0'));var util=require(_0x55f9('0x1'));var path=require(_0x55f9('0x2'));var timeout=require(_0x55f9('0x3'));var express=require('express');var router=express[_0x55f9('0x4')]();var fs_extra=require(_0x55f9('0x5'));var auth=require(_0x55f9('0x6'));var interaction=require(_0x55f9('0x7'));var config=require(_0x55f9('0x8'));var controller=require(_0x55f9('0x9'));router[_0x55f9('0xa')]('/',auth[_0x55f9('0xb')](),controller[_0x55f9('0xc')]);router['get'](_0x55f9('0xd'),auth[_0x55f9('0xb')](),controller[_0x55f9('0xe')]);router['get'](_0x55f9('0xf'),auth[_0x55f9('0xb')](),controller[_0x55f9('0x10')]);router[_0x55f9('0xa')]('/:id/fields',auth[_0x55f9('0xb')](),controller[_0x55f9('0x11')]);router[_0x55f9('0x12')]('/',auth['isAuthenticated'](),controller[_0x55f9('0x13')]);router['post'](_0x55f9('0xf'),auth[_0x55f9('0xb')](),controller[_0x55f9('0x14')]);router[_0x55f9('0x15')]('/:id',auth[_0x55f9('0xb')](),controller['update']);router[_0x55f9('0x16')](_0x55f9('0xd'),auth[_0x55f9('0xb')](),controller['destroy']);module[_0x55f9('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 5debfb9..09fb299 100644 --- a/server/api/intZohoAccount/intZohoAccount.attributes.js +++ b/server/api/intZohoAccount/intZohoAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x668b=['exports','STRING','sequelize'];(function(_0x5400a1,_0x2275aa){var _0x4006c7=function(_0x5002dc){while(--_0x5002dc){_0x5400a1['push'](_0x5400a1['shift']());}};_0x4006c7(++_0x2275aa);}(_0x668b,0x140));var _0xb668=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0x668b[_0x4ea69d];return _0x5318e0;};'use strict';var Sequelize=require(_0xb668('0x0'));module[_0xb668('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb668('0x2')]},'host':{'type':Sequelize[_0xb668('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xb668('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xb668('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0xb668('0x2')]},'refreshToken':{'type':Sequelize[_0xb668('0x2')]}}; \ No newline at end of file +var _0x4bc3=['sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4bc3,0x16e));var _0x34bc=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x4bc3[_0x8c43de];return _0xa6591b;};'use strict';var Sequelize=require(_0x34bc('0x0'));module[_0x34bc('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x34bc('0x2')]},'host':{'type':Sequelize[_0x34bc('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x34bc('0x2')]},'clientSecret':{'type':Sequelize[_0x34bc('0x2')]},'serverUrl':{'type':Sequelize[_0x34bc('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x34bc('0x2')]},'refreshToken':{'type':Sequelize[_0x34bc('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index e6d55e9..5ef485f 100644 --- a/server/api/intZohoAccount/intZohoAccount.controller.js +++ b/server/api/intZohoAccount/intZohoAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6aea=['map','rawAttributes','fieldName','type','key','query','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','ZohoAccount','findAll','rows','catch','show','params','keys','create','body','find','findOne','ZohoConfiguration','getConfigurations','nolimit','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ZohoField','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','refreshToken','clientId','clientSecret','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','zone','code','zoho.eu','com','serverUrl','slice','substring','lastIndexOf','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','update','destroy','then','error','name','index'];(function(_0x3d47cb,_0x45bb26){var _0x1670a8=function(_0x34d7c0){while(--_0x34d7c0){_0x3d47cb['push'](_0x3d47cb['shift']());}};_0x1670a8(++_0x45bb26);}(_0x6aea,0x168));var _0xa6ae=function(_0x3d3640,_0x225220){_0x3d3640=_0x3d3640-0x0;var _0xbb64cf=_0x6aea[_0x3d3640];return _0xbb64cf;};'use strict';var emlformat=require(_0xa6ae('0x0'));var rimraf=require(_0xa6ae('0x1'));var zipdir=require(_0xa6ae('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa6ae('0x3'));var moment=require(_0xa6ae('0x4'));var BPromise=require(_0xa6ae('0x5'));var Mustache=require(_0xa6ae('0x6'));var util=require(_0xa6ae('0x7'));var path=require(_0xa6ae('0x8'));var sox=require(_0xa6ae('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa6ae('0xa'));var _=require(_0xa6ae('0xb'));var squel=require(_0xa6ae('0xc'));var crypto=require(_0xa6ae('0xd'));var jsforce=require(_0xa6ae('0xe'));var deskjs=require(_0xa6ae('0xf'));var toCsv=require(_0xa6ae('0x10'));var querystring=require('querystring');var Papa=require(_0xa6ae('0x11'));var Redis=require(_0xa6ae('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa6ae('0x13'));var as=require(_0xa6ae('0x14'));var hardwareService=require(_0xa6ae('0x15'));var logger=require(_0xa6ae('0x16'))(_0xa6ae('0x17'));var utils=require(_0xa6ae('0x18'));var config=require(_0xa6ae('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa6ae('0x1a'))['db'];var integrations=require(_0xa6ae('0x1b'));function respondWithStatusCode(_0x62f700,_0x392868){_0x392868=_0x392868||0xcc;return function(_0x4182a4){if(_0x4182a4){return _0x62f700[_0xa6ae('0x1c')](_0x392868);}return _0x62f700[_0xa6ae('0x1d')](_0x392868)[_0xa6ae('0x1e')]();};}function respondWithResult(_0x464d26,_0x5505ad){_0x5505ad=_0x5505ad||0xc8;return function(_0x313359){if(_0x313359){return _0x464d26[_0xa6ae('0x1d')](_0x5505ad)[_0xa6ae('0x1f')](_0x313359);}};}function respondWithFilteredResult(_0x2fbd75,_0x5aa253){return function(_0x5858c2){if(_0x5858c2){var _0x45674f=typeof _0x5aa253[_0xa6ae('0x20')]==='undefined'&&typeof _0x5aa253[_0xa6ae('0x21')]===_0xa6ae('0x22');var _0x51ef06=_0x5858c2[_0xa6ae('0x23')];var _0x545228=_0x45674f?0x0:_0x5aa253['offset'];var _0xd1fe01=_0x45674f?_0x5858c2[_0xa6ae('0x23')]:_0x5aa253[_0xa6ae('0x20')]+_0x5aa253[_0xa6ae('0x21')];var _0x4e4b5e;if(_0xd1fe01>=_0x51ef06){_0xd1fe01=_0x51ef06;_0x4e4b5e=0xc8;}else{_0x4e4b5e=0xce;}_0x2fbd75['status'](_0x4e4b5e);return _0x2fbd75[_0xa6ae('0x24')](_0xa6ae('0x25'),_0x545228+'-'+_0xd1fe01+'/'+_0x51ef06)[_0xa6ae('0x1f')](_0x5858c2);}return null;};}function patchUpdates(_0x308a48){return function(_0x2309af){try{jsonpatch[_0xa6ae('0x26')](_0x2309af,_0x308a48,!![]);}catch(_0x357a61){return BPromise['reject'](_0x357a61);}return _0x2309af['save']();};}function saveUpdates(_0x356b96,_0x49c117){return function(_0x301b69){if(_0x301b69){return _0x301b69[_0xa6ae('0x27')](_0x356b96)['then'](function(_0x415d55){return _0x415d55;});}return null;};}function removeEntity(_0x2423a9,_0x17ba35){return function(_0x3cd39d){if(_0x3cd39d){return _0x3cd39d[_0xa6ae('0x28')]()[_0xa6ae('0x29')](function(){_0x2423a9['status'](0xcc)[_0xa6ae('0x1e')]();});}};}function handleEntityNotFound(_0x3b73fd,_0x551cbf){return function(_0xf6213c){if(!_0xf6213c){_0x3b73fd['sendStatus'](0x194);}return _0xf6213c;};}function handleError(_0x3cbaa7,_0x475cf0){_0x475cf0=_0x475cf0||0x1f4;return function(_0x148212){logger[_0xa6ae('0x2a')](_0x148212['stack']);if(_0x148212[_0xa6ae('0x2b')]){delete _0x148212[_0xa6ae('0x2b')];}_0x3cbaa7[_0xa6ae('0x1d')](_0x475cf0)['send'](_0x148212);};}exports[_0xa6ae('0x2c')]=function(_0x496ff1,_0x1c4353){var _0x2e2933={},_0x2d28be={},_0x26f685={'count':0x0,'rows':[]};var _0x35b18f=_[_0xa6ae('0x2d')](db['ZohoAccount'][_0xa6ae('0x2e')],function(_0x597394){return{'name':_0x597394[_0xa6ae('0x2f')],'type':_0x597394[_0xa6ae('0x30')][_0xa6ae('0x31')]};});_0x2d28be['model']=_[_0xa6ae('0x2d')](_0x35b18f,_0xa6ae('0x2b'));_0x2d28be['query']=_['keys'](_0x496ff1[_0xa6ae('0x32')]);_0x2d28be['filters']=_[_0xa6ae('0x33')](_0x2d28be[_0xa6ae('0x34')],_0x2d28be[_0xa6ae('0x32')]);_0x2e2933['attributes']=_[_0xa6ae('0x33')](_0x2d28be[_0xa6ae('0x34')],qs[_0xa6ae('0x35')](_0x496ff1[_0xa6ae('0x32')][_0xa6ae('0x35')]));_0x2e2933[_0xa6ae('0x36')]=_0x2e2933[_0xa6ae('0x36')][_0xa6ae('0x37')]?_0x2e2933[_0xa6ae('0x36')]:_0x2d28be[_0xa6ae('0x34')];if(!_0x496ff1[_0xa6ae('0x32')][_0xa6ae('0x38')]('nolimit')){_0x2e2933[_0xa6ae('0x21')]=qs[_0xa6ae('0x21')](_0x496ff1[_0xa6ae('0x32')]['limit']);_0x2e2933['offset']=qs['offset'](_0x496ff1[_0xa6ae('0x32')]['offset']);}_0x2e2933[_0xa6ae('0x39')]=qs[_0xa6ae('0x3a')](_0x496ff1[_0xa6ae('0x32')][_0xa6ae('0x3a')]);_0x2e2933[_0xa6ae('0x3b')]=qs['filters'](_[_0xa6ae('0x3c')](_0x496ff1[_0xa6ae('0x32')],_0x2d28be[_0xa6ae('0x3d')]),_0x35b18f);if(_0x496ff1[_0xa6ae('0x32')][_0xa6ae('0x3e')]){_0x2e2933['where']=_[_0xa6ae('0x3f')](_0x2e2933['where'],{'$or':_[_0xa6ae('0x2d')](_0x35b18f,function(_0xca656f){if(_0xca656f[_0xa6ae('0x30')]!==_0xa6ae('0x40')){var _0x2dafa7={};_0x2dafa7[_0xca656f['name']]={'$like':'%'+_0x496ff1['query'][_0xa6ae('0x3e')]+'%'};return _0x2dafa7;}})});}_0x2e2933=_['merge']({},_0x2e2933,_0x496ff1[_0xa6ae('0x41')]);var _0xd785b0={'where':_0x2e2933[_0xa6ae('0x3b')]};return db['ZohoAccount'][_0xa6ae('0x23')](_0xd785b0)[_0xa6ae('0x29')](function(_0x2394e5){_0x26f685['count']=_0x2394e5;if(_0x496ff1[_0xa6ae('0x32')][_0xa6ae('0x42')]){_0x2e2933[_0xa6ae('0x43')]=[{'all':!![]}];}return db[_0xa6ae('0x44')][_0xa6ae('0x45')](_0x2e2933);})['then'](function(_0x58e36b){_0x26f685[_0xa6ae('0x46')]=_0x58e36b;return _0x26f685;})[_0xa6ae('0x29')](respondWithFilteredResult(_0x1c4353,_0x2e2933))[_0xa6ae('0x47')](handleError(_0x1c4353,null));};exports[_0xa6ae('0x48')]=function(_0x1a15e5,_0x43b6d5){var _0x193b66={'raw':![],'where':{'id':_0x1a15e5[_0xa6ae('0x49')]['id']}},_0x15403b={};_0x15403b[_0xa6ae('0x34')]=_['keys'](db[_0xa6ae('0x44')][_0xa6ae('0x2e')]);_0x15403b['query']=_[_0xa6ae('0x4a')](_0x1a15e5['query']);_0x15403b[_0xa6ae('0x3d')]=_[_0xa6ae('0x33')](_0x15403b[_0xa6ae('0x34')],_0x15403b['query']);_0x193b66['attributes']=_[_0xa6ae('0x33')](_0x15403b[_0xa6ae('0x34')],qs[_0xa6ae('0x35')](_0x1a15e5[_0xa6ae('0x32')][_0xa6ae('0x35')]));_0x193b66[_0xa6ae('0x36')]=_0x193b66[_0xa6ae('0x36')][_0xa6ae('0x37')]?_0x193b66[_0xa6ae('0x36')]:_0x15403b[_0xa6ae('0x34')];if(_0x1a15e5[_0xa6ae('0x32')][_0xa6ae('0x42')]){_0x193b66['include']=[{'all':!![]}];}_0x193b66=_[_0xa6ae('0x3f')]({},_0x193b66,_0x1a15e5[_0xa6ae('0x41')]);return db[_0xa6ae('0x44')]['find'](_0x193b66)[_0xa6ae('0x29')](handleEntityNotFound(_0x43b6d5,null))[_0xa6ae('0x29')](respondWithResult(_0x43b6d5,null))[_0xa6ae('0x47')](handleError(_0x43b6d5,null));};exports[_0xa6ae('0x4b')]=function(_0x42d6ee,_0x4b3da5){return db[_0xa6ae('0x44')][_0xa6ae('0x4b')](_0x42d6ee[_0xa6ae('0x4c')],{})[_0xa6ae('0x29')](respondWithResult(_0x4b3da5,0xc9))[_0xa6ae('0x47')](handleError(_0x4b3da5,null));};exports[_0xa6ae('0x27')]=function(_0x18aacf,_0x362948){if(_0x18aacf[_0xa6ae('0x4c')]['id']){delete _0x18aacf[_0xa6ae('0x4c')]['id'];}return db['ZohoAccount'][_0xa6ae('0x4d')]({'where':{'id':_0x18aacf['params']['id']}})[_0xa6ae('0x29')](handleEntityNotFound(_0x362948,null))[_0xa6ae('0x29')](saveUpdates(_0x18aacf[_0xa6ae('0x4c')],null))['then'](respondWithResult(_0x362948,null))['catch'](handleError(_0x362948,null));};exports['destroy']=function(_0x27670c,_0x1681c7){return db[_0xa6ae('0x44')][_0xa6ae('0x4d')]({'where':{'id':_0x27670c['params']['id']}})[_0xa6ae('0x29')](handleEntityNotFound(_0x1681c7,null))[_0xa6ae('0x29')](removeEntity(_0x1681c7,null))[_0xa6ae('0x47')](handleError(_0x1681c7,null));};exports['getConfigurations']=function(_0x110b8d,_0x84198a,_0x52d826){var _0x4f687d={};var _0x1f33ea={};var _0x57198d;var _0x44bb93;return db[_0xa6ae('0x44')][_0xa6ae('0x4e')]({'where':{'id':_0x110b8d[_0xa6ae('0x49')]['id']}})['then'](handleEntityNotFound(_0x84198a,null))['then'](function(_0x556d30){if(_0x556d30){_0x57198d=_0x556d30;_0x1f33ea['model']=_['keys'](db[_0xa6ae('0x4f')][_0xa6ae('0x2e')]);_0x1f33ea[_0xa6ae('0x32')]=_[_0xa6ae('0x4a')](_0x110b8d[_0xa6ae('0x32')]);_0x1f33ea[_0xa6ae('0x3d')]=_[_0xa6ae('0x33')](_0x1f33ea[_0xa6ae('0x34')],_0x1f33ea[_0xa6ae('0x32')]);_0x4f687d[_0xa6ae('0x36')]=_[_0xa6ae('0x33')](_0x1f33ea[_0xa6ae('0x34')],qs[_0xa6ae('0x35')](_0x110b8d[_0xa6ae('0x32')][_0xa6ae('0x35')]));_0x4f687d[_0xa6ae('0x36')]=_0x4f687d[_0xa6ae('0x36')][_0xa6ae('0x37')]?_0x4f687d[_0xa6ae('0x36')]:_0x1f33ea[_0xa6ae('0x34')];_0x4f687d[_0xa6ae('0x39')]=qs[_0xa6ae('0x3a')](_0x110b8d[_0xa6ae('0x32')]['sort']);_0x4f687d[_0xa6ae('0x3b')]=qs[_0xa6ae('0x3d')](_['pick'](_0x110b8d[_0xa6ae('0x32')],_0x1f33ea[_0xa6ae('0x3d')]));if(_0x110b8d[_0xa6ae('0x32')]['filter']){_0x4f687d['where']=_[_0xa6ae('0x3f')](_0x4f687d[_0xa6ae('0x3b')],{'$or':_['map'](_0x4f687d['attributes'],function(_0x4f09f1){var _0xc683f5={};_0xc683f5[_0x4f09f1]={'$like':'%'+_0x110b8d[_0xa6ae('0x32')][_0xa6ae('0x3e')]+'%'};return _0xc683f5;})});}_0x4f687d=_[_0xa6ae('0x3f')]({},_0x4f687d,_0x110b8d[_0xa6ae('0x41')]);return _0x57198d[_0xa6ae('0x50')](_0x4f687d);}})[_0xa6ae('0x29')](function(_0x41292b){if(_0x41292b){_0x44bb93=_0x41292b[_0xa6ae('0x37')];if(!_0x110b8d['query'][_0xa6ae('0x38')](_0xa6ae('0x51'))){_0x4f687d[_0xa6ae('0x21')]=qs[_0xa6ae('0x21')](_0x110b8d[_0xa6ae('0x32')][_0xa6ae('0x21')]);_0x4f687d['offset']=qs[_0xa6ae('0x20')](_0x110b8d[_0xa6ae('0x32')]['offset']);}return _0x57198d['getConfigurations'](_0x4f687d);}})[_0xa6ae('0x29')](function(_0x2afccf){if(_0x2afccf){return _0x2afccf?{'count':_0x44bb93,'rows':_0x2afccf}:null;}})[_0xa6ae('0x29')](respondWithResult(_0x84198a,null))[_0xa6ae('0x47')](handleError(_0x84198a,null));};exports['addConfiguration']=function(_0xbb73c9,_0x284540,_0x559248){if(_0xbb73c9['body']['id']){delete _0xbb73c9[_0xa6ae('0x4c')]['id'];}return db[_0xa6ae('0x44')]['findOne']({'where':{'id':_0xbb73c9[_0xa6ae('0x49')]['id']}})[_0xa6ae('0x29')](handleEntityNotFound(_0x284540,null))['then'](function(_0x5deb22){if(_0x5deb22){_0xbb73c9[_0xa6ae('0x4c')][_0xa6ae('0x52')]=_0x5deb22['id'];_0xbb73c9[_0xa6ae('0x4c')][_0xa6ae('0x53')]=integrations[_0xa6ae('0x54')](_0xbb73c9[_0xa6ae('0x4c')]['channel'],_0xbb73c9[_0xa6ae('0x4c')][_0xa6ae('0x30')]);_0xbb73c9[_0xa6ae('0x4c')][_0xa6ae('0x55')]=integrations[_0xa6ae('0x56')](_0xbb73c9[_0xa6ae('0x4c')][_0xa6ae('0x57')],_0xbb73c9[_0xa6ae('0x4c')][_0xa6ae('0x30')]);return db[_0xa6ae('0x4f')][_0xa6ae('0x4b')](_0xbb73c9['body'],{'include':[{'model':db[_0xa6ae('0x58')],'as':'Subjects'},{'model':db['ZohoField'],'as':'Descriptions'}]});}return null;})[_0xa6ae('0x29')](respondWithResult(_0x284540,null))['catch'](handleError(_0x284540,null));};function getAccessToken(_0x32fdc3){return new Promise(function(_0x4f6113,_0x234056){var _0x423561;switch(_0x32fdc3['zone']){case'US':_0x423561=_0xa6ae('0x59');break;case'AU':_0x423561=_0xa6ae('0x5a');break;case'EU':_0x423561='https://accounts.zoho.eu';break;case'IN':_0x423561=_0xa6ae('0x5b');break;case'CN':_0x423561=_0xa6ae('0x5c');break;default:_0x423561=_0xa6ae('0x5d');break;}var _0x200867={'method':'POST','uri':_0x423561+_0xa6ae('0x5e'),'qs':{'refresh_token':_0x32fdc3[_0xa6ae('0x5f')],'client_id':_0x32fdc3[_0xa6ae('0x60')],'client_secret':_0x32fdc3[_0xa6ae('0x61')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x200867)['then'](function(_0x48bf1d){if(_0x48bf1d['access_token']){_0x4f6113(_0x48bf1d[_0xa6ae('0x62')]);}else{_0x234056(_0xa6ae('0x63'));}})[_0xa6ae('0x47')](function(_0x58b56c){_0x234056(_0x58b56c);});});}exports[_0xa6ae('0x64')]=function(_0x273f71,_0x4e4816,_0x5975c6){var _0x221707,_0x21a444,_0x4402b3,_0x51dc87,_0x54b84b;return db['ZohoAccount']['findOne']({'where':{'id':_0x273f71[_0xa6ae('0x49')]['id']},'attributes':['id','host',_0xa6ae('0x65'),'clientId',_0xa6ae('0x61'),'serverUrl',_0xa6ae('0x66'),_0xa6ae('0x5f')]})[_0xa6ae('0x29')](handleEntityNotFound(_0x4e4816,null))[_0xa6ae('0x29')](function(_0x421da6){_0x54b84b=_0x421da6;_0x221707=_0x54b84b['host'];_0x21a444=_0x221707===_0xa6ae('0x67')?'eu':_0xa6ae('0x68');_0x4402b3=_0x54b84b[_0xa6ae('0x69')];var _0x50c8fb=_0x4402b3[_0xa6ae('0x6a')](-0x1);if(_0x50c8fb==='/'||_0x50c8fb==='\x5c'||_0x50c8fb===':'){_0x4402b3=_0x4402b3[_0xa6ae('0x6b')](0x0,_0x4402b3[_0xa6ae('0x6c')](_0x50c8fb));}if(!_0x54b84b[_0xa6ae('0x5f')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x54b84b);})['then'](function(_0xa4c5dd){if(_0xa4c5dd){return rp({'method':_0xa6ae('0x6d'),'uri':util['format'](_0xa6ae('0x6e'),_0x21a444),'qs':{'module':'Calls'},'headers':{'Authorization':_0xa6ae('0x6f')+_0xa4c5dd},'json':!![]});}})['then'](function(_0x59640b){if(_0x59640b){if(_0x59640b[_0xa6ae('0x70')]&&_0x59640b['response'][_0xa6ae('0x2a')]){throw new Error(_0x59640b['response']['error']['message']);}var _0x2efe14=[];var _0x3d2d5a=[];var _0x3f6992=['Owner',_0xa6ae('0x71'),_0xa6ae('0x72'),_0xa6ae('0x73'),_0xa6ae('0x74'),_0xa6ae('0x75'),_0xa6ae('0x76'),_0xa6ae('0x77')];_0x3d2d5a=_[_0xa6ae('0x78')](_0x59640b[_0xa6ae('0x35')],function(_0x152614){return _0x3f6992[_0xa6ae('0x79')](_0x152614[_0xa6ae('0x7a')]);});for(var _0x1a7dcc=0x0;_0x1a7dcc<_0x3d2d5a[_0xa6ae('0x37')];_0x1a7dcc++){if(_0x3d2d5a[_0x1a7dcc][_0xa6ae('0x7b')]===![]){_0x2efe14[_0xa6ae('0x7c')]({'id':_0x3d2d5a[_0x1a7dcc]['id'],'name':_0x3d2d5a[_0x1a7dcc][_0xa6ae('0x7d')],'custom':_0x3d2d5a[_0x1a7dcc][_0xa6ae('0x7e')],'options':_0x3d2d5a[_0x1a7dcc][_0xa6ae('0x7f')]===_0xa6ae('0x80')&&_0x3d2d5a[_0x1a7dcc][_0xa6ae('0x81')]['length']>-0x1?_[_0xa6ae('0x2d')](_0x3d2d5a[_0x1a7dcc][_0xa6ae('0x81')],function(_0x231b93){return{'name':_0x231b93,'value':_0x231b93};}):[]});}}return{'count':_0x2efe14[_0xa6ae('0x37')],'rows':_0x2efe14};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x4e4816,null))[_0xa6ae('0x47')](function(_0x11530e){var _0x52460e=_0x273f71[_0xa6ae('0x32')][_0xa6ae('0x82')]?0x1f4:_0x11530e[_0xa6ae('0x83')]||0x1f4;logger[_0xa6ae('0x2a')](_0xa6ae('0x84'),_0xa6ae('0x64'),_0x52460e,JSON[_0xa6ae('0x85')](_0x11530e));delete _0x11530e[_0xa6ae('0x2b')];if(_0x52460e===0x191){_0x52460e=0x190;}_0x4e4816[_0xa6ae('0x1d')](_0x52460e)[_0xa6ae('0x86')](_0x273f71['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x11530e['statusCode']}:_0x11530e);});}; \ No newline at end of file +var _0x31d8=['ZohoAccount','includeAll','include','rows','catch','show','params','length','find','create','body','getConfigurations','findOne','ZohoConfiguration','order','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','zone','serverUrl','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','response','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Start_Time','includes','system_mandatory','push','display_label','data_type','pick_list_values','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options'];(function(_0x5461a,_0x2c53df){var _0x34da1d=function(_0x38d633){while(--_0x38d633){_0x5461a['push'](_0x5461a['shift']());}};_0x34da1d(++_0x2c53df);}(_0x31d8,0x13f));var _0x831d=function(_0x1d6bb9,_0x502c0c){_0x1d6bb9=_0x1d6bb9-0x0;var _0x4409f2=_0x31d8[_0x1d6bb9];return _0x4409f2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x831d('0x0'));var jsonpatch=require(_0x831d('0x1'));var rp=require(_0x831d('0x2'));var moment=require(_0x831d('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x831d('0x4'));var path=require(_0x831d('0x5'));var sox=require(_0x831d('0x6'));var csv=require('to-csv');var ejs=require(_0x831d('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x831d('0x8'));var squel=require('squel');var crypto=require(_0x831d('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x831d('0xa'));var toCsv=require('to-csv');var querystring=require(_0x831d('0xb'));var Papa=require(_0x831d('0xc'));var Redis=require(_0x831d('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x831d('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x831d('0xf'))(_0x831d('0x10'));var utils=require(_0x831d('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x831d('0x12'));var db=require(_0x831d('0x13'))['db'];var integrations=require(_0x831d('0x14'));function respondWithStatusCode(_0x296e48,_0x58219d){_0x58219d=_0x58219d||0xcc;return function(_0x47e5cf){if(_0x47e5cf){return _0x296e48['sendStatus'](_0x58219d);}return _0x296e48['status'](_0x58219d)[_0x831d('0x15')]();};}function respondWithResult(_0x9376fe,_0x191c73){_0x191c73=_0x191c73||0xc8;return function(_0x34e2cb){if(_0x34e2cb){return _0x9376fe[_0x831d('0x16')](_0x191c73)[_0x831d('0x17')](_0x34e2cb);}};}function respondWithFilteredResult(_0x4bd108,_0x5f2a2a){return function(_0xf2ccaf){if(_0xf2ccaf){var _0x4d1bfe=typeof _0x5f2a2a[_0x831d('0x18')]===_0x831d('0x19')&&typeof _0x5f2a2a[_0x831d('0x1a')]===_0x831d('0x19');var _0x4dec8b=_0xf2ccaf['count'];var _0x11922c=_0x4d1bfe?0x0:_0x5f2a2a['offset'];var _0x20941e=_0x4d1bfe?_0xf2ccaf[_0x831d('0x1b')]:_0x5f2a2a[_0x831d('0x18')]+_0x5f2a2a['limit'];var _0x245447;if(_0x20941e>=_0x4dec8b){_0x20941e=_0x4dec8b;_0x245447=0xc8;}else{_0x245447=0xce;}_0x4bd108[_0x831d('0x16')](_0x245447);return _0x4bd108['set'](_0x831d('0x1c'),_0x11922c+'-'+_0x20941e+'/'+_0x4dec8b)['json'](_0xf2ccaf);}return null;};}function patchUpdates(_0x4b897e){return function(_0x2c3742){try{jsonpatch[_0x831d('0x1d')](_0x2c3742,_0x4b897e,!![]);}catch(_0x5b592b){return BPromise['reject'](_0x5b592b);}return _0x2c3742[_0x831d('0x1e')]();};}function saveUpdates(_0x80c58d,_0x24cdde){return function(_0x38d495){if(_0x38d495){return _0x38d495[_0x831d('0x1f')](_0x80c58d)[_0x831d('0x20')](function(_0x339d08){return _0x339d08;});}return null;};}function removeEntity(_0x313d94,_0x1fa3ef){return function(_0x1bd18f){if(_0x1bd18f){return _0x1bd18f[_0x831d('0x21')]()[_0x831d('0x20')](function(){_0x313d94['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x164db5,_0x582a57){return function(_0xc3b714){if(!_0xc3b714){_0x164db5[_0x831d('0x22')](0x194);}return _0xc3b714;};}function handleError(_0x10a073,_0x4908c0){_0x4908c0=_0x4908c0||0x1f4;return function(_0x281e38){logger[_0x831d('0x23')](_0x281e38[_0x831d('0x24')]);if(_0x281e38['name']){delete _0x281e38[_0x831d('0x25')];}_0x10a073[_0x831d('0x16')](_0x4908c0)[_0x831d('0x26')](_0x281e38);};}exports['index']=function(_0x140d01,_0x53a7bd){var _0x585e63={},_0x4da3cb={},_0x24c3ea={'count':0x0,'rows':[]};var _0x5c5d65=_[_0x831d('0x27')](db['ZohoAccount'][_0x831d('0x28')],function(_0x4d8db7){return{'name':_0x4d8db7[_0x831d('0x29')],'type':_0x4d8db7['type'][_0x831d('0x2a')]};});_0x4da3cb[_0x831d('0x2b')]=_['map'](_0x5c5d65,_0x831d('0x25'));_0x4da3cb['query']=_[_0x831d('0x2c')](_0x140d01[_0x831d('0x2d')]);_0x4da3cb[_0x831d('0x2e')]=_[_0x831d('0x2f')](_0x4da3cb[_0x831d('0x2b')],_0x4da3cb[_0x831d('0x2d')]);_0x585e63[_0x831d('0x30')]=_[_0x831d('0x2f')](_0x4da3cb[_0x831d('0x2b')],qs[_0x831d('0x31')](_0x140d01[_0x831d('0x2d')][_0x831d('0x31')]));_0x585e63['attributes']=_0x585e63[_0x831d('0x30')]['length']?_0x585e63[_0x831d('0x30')]:_0x4da3cb[_0x831d('0x2b')];if(!_0x140d01['query'][_0x831d('0x32')](_0x831d('0x33'))){_0x585e63['limit']=qs[_0x831d('0x1a')](_0x140d01[_0x831d('0x2d')][_0x831d('0x1a')]);_0x585e63[_0x831d('0x18')]=qs[_0x831d('0x18')](_0x140d01[_0x831d('0x2d')]['offset']);}_0x585e63['order']=qs['sort'](_0x140d01[_0x831d('0x2d')][_0x831d('0x34')]);_0x585e63[_0x831d('0x35')]=qs[_0x831d('0x2e')](_['pick'](_0x140d01['query'],_0x4da3cb[_0x831d('0x2e')]),_0x5c5d65);if(_0x140d01[_0x831d('0x2d')][_0x831d('0x36')]){_0x585e63[_0x831d('0x35')]=_[_0x831d('0x37')](_0x585e63[_0x831d('0x35')],{'$or':_[_0x831d('0x27')](_0x5c5d65,function(_0x45f745){if(_0x45f745[_0x831d('0x38')]!==_0x831d('0x39')){var _0xe94840={};_0xe94840[_0x45f745['name']]={'$like':'%'+_0x140d01[_0x831d('0x2d')][_0x831d('0x36')]+'%'};return _0xe94840;}})});}_0x585e63=_[_0x831d('0x37')]({},_0x585e63,_0x140d01[_0x831d('0x3a')]);var _0x1e10e0={'where':_0x585e63[_0x831d('0x35')]};return db[_0x831d('0x3b')][_0x831d('0x1b')](_0x1e10e0)['then'](function(_0xcb7132){_0x24c3ea['count']=_0xcb7132;if(_0x140d01[_0x831d('0x2d')][_0x831d('0x3c')]){_0x585e63[_0x831d('0x3d')]=[{'all':!![]}];}return db['ZohoAccount']['findAll'](_0x585e63);})['then'](function(_0x3b573d){_0x24c3ea[_0x831d('0x3e')]=_0x3b573d;return _0x24c3ea;})[_0x831d('0x20')](respondWithFilteredResult(_0x53a7bd,_0x585e63))[_0x831d('0x3f')](handleError(_0x53a7bd,null));};exports[_0x831d('0x40')]=function(_0x5a2072,_0x5403f6){var _0x22b3fa={'raw':![],'where':{'id':_0x5a2072[_0x831d('0x41')]['id']}},_0x302f55={};_0x302f55[_0x831d('0x2b')]=_[_0x831d('0x2c')](db[_0x831d('0x3b')]['rawAttributes']);_0x302f55['query']=_[_0x831d('0x2c')](_0x5a2072[_0x831d('0x2d')]);_0x302f55[_0x831d('0x2e')]=_[_0x831d('0x2f')](_0x302f55[_0x831d('0x2b')],_0x302f55[_0x831d('0x2d')]);_0x22b3fa['attributes']=_[_0x831d('0x2f')](_0x302f55['model'],qs[_0x831d('0x31')](_0x5a2072[_0x831d('0x2d')][_0x831d('0x31')]));_0x22b3fa[_0x831d('0x30')]=_0x22b3fa[_0x831d('0x30')][_0x831d('0x42')]?_0x22b3fa['attributes']:_0x302f55[_0x831d('0x2b')];if(_0x5a2072[_0x831d('0x2d')][_0x831d('0x3c')]){_0x22b3fa[_0x831d('0x3d')]=[{'all':!![]}];}_0x22b3fa=_[_0x831d('0x37')]({},_0x22b3fa,_0x5a2072[_0x831d('0x3a')]);return db['ZohoAccount'][_0x831d('0x43')](_0x22b3fa)['then'](handleEntityNotFound(_0x5403f6,null))['then'](respondWithResult(_0x5403f6,null))[_0x831d('0x3f')](handleError(_0x5403f6,null));};exports['create']=function(_0x3eeeb8,_0x1b1e5f){return db[_0x831d('0x3b')][_0x831d('0x44')](_0x3eeeb8[_0x831d('0x45')],{})[_0x831d('0x20')](respondWithResult(_0x1b1e5f,0xc9))[_0x831d('0x3f')](handleError(_0x1b1e5f,null));};exports[_0x831d('0x1f')]=function(_0x23a135,_0x1896e9){if(_0x23a135['body']['id']){delete _0x23a135[_0x831d('0x45')]['id'];}return db[_0x831d('0x3b')][_0x831d('0x43')]({'where':{'id':_0x23a135['params']['id']}})['then'](handleEntityNotFound(_0x1896e9,null))[_0x831d('0x20')](saveUpdates(_0x23a135[_0x831d('0x45')],null))[_0x831d('0x20')](respondWithResult(_0x1896e9,null))[_0x831d('0x3f')](handleError(_0x1896e9,null));};exports['destroy']=function(_0x4fe5a3,_0x107f8f){return db['ZohoAccount'][_0x831d('0x43')]({'where':{'id':_0x4fe5a3[_0x831d('0x41')]['id']}})[_0x831d('0x20')](handleEntityNotFound(_0x107f8f,null))[_0x831d('0x20')](removeEntity(_0x107f8f,null))['catch'](handleError(_0x107f8f,null));};exports[_0x831d('0x46')]=function(_0x12ee7d,_0x153862,_0x512c8c){var _0x157b70={};var _0x57898d={};var _0x569f25;var _0x59b610;return db[_0x831d('0x3b')][_0x831d('0x47')]({'where':{'id':_0x12ee7d[_0x831d('0x41')]['id']}})[_0x831d('0x20')](handleEntityNotFound(_0x153862,null))[_0x831d('0x20')](function(_0x10fbdd){if(_0x10fbdd){_0x569f25=_0x10fbdd;_0x57898d[_0x831d('0x2b')]=_[_0x831d('0x2c')](db[_0x831d('0x48')][_0x831d('0x28')]);_0x57898d['query']=_[_0x831d('0x2c')](_0x12ee7d[_0x831d('0x2d')]);_0x57898d[_0x831d('0x2e')]=_[_0x831d('0x2f')](_0x57898d['model'],_0x57898d[_0x831d('0x2d')]);_0x157b70[_0x831d('0x30')]=_[_0x831d('0x2f')](_0x57898d['model'],qs[_0x831d('0x31')](_0x12ee7d['query'][_0x831d('0x31')]));_0x157b70[_0x831d('0x30')]=_0x157b70[_0x831d('0x30')][_0x831d('0x42')]?_0x157b70[_0x831d('0x30')]:_0x57898d['model'];_0x157b70[_0x831d('0x49')]=qs['sort'](_0x12ee7d[_0x831d('0x2d')][_0x831d('0x34')]);_0x157b70[_0x831d('0x35')]=qs[_0x831d('0x2e')](_[_0x831d('0x4a')](_0x12ee7d['query'],_0x57898d['filters']));if(_0x12ee7d['query']['filter']){_0x157b70[_0x831d('0x35')]=_['merge'](_0x157b70[_0x831d('0x35')],{'$or':_[_0x831d('0x27')](_0x157b70['attributes'],function(_0x5d8536){var _0x59afce={};_0x59afce[_0x5d8536]={'$like':'%'+_0x12ee7d['query'][_0x831d('0x36')]+'%'};return _0x59afce;})});}_0x157b70=_[_0x831d('0x37')]({},_0x157b70,_0x12ee7d[_0x831d('0x3a')]);return _0x569f25[_0x831d('0x46')](_0x157b70);}})['then'](function(_0x55f843){if(_0x55f843){_0x59b610=_0x55f843[_0x831d('0x42')];if(!_0x12ee7d[_0x831d('0x2d')]['hasOwnProperty'](_0x831d('0x33'))){_0x157b70[_0x831d('0x1a')]=qs[_0x831d('0x1a')](_0x12ee7d['query'][_0x831d('0x1a')]);_0x157b70[_0x831d('0x18')]=qs['offset'](_0x12ee7d[_0x831d('0x2d')][_0x831d('0x18')]);}return _0x569f25[_0x831d('0x46')](_0x157b70);}})[_0x831d('0x20')](function(_0x27d517){if(_0x27d517){return _0x27d517?{'count':_0x59b610,'rows':_0x27d517}:null;}})['then'](respondWithResult(_0x153862,null))[_0x831d('0x3f')](handleError(_0x153862,null));};exports[_0x831d('0x4b')]=function(_0x3f8143,_0x1aa8dc,_0xf0f094){if(_0x3f8143['body']['id']){delete _0x3f8143['body']['id'];}return db[_0x831d('0x3b')]['findOne']({'where':{'id':_0x3f8143['params']['id']}})['then'](handleEntityNotFound(_0x1aa8dc,null))[_0x831d('0x20')](function(_0x36d7a6){if(_0x36d7a6){_0x3f8143['body'][_0x831d('0x4c')]=_0x36d7a6['id'];_0x3f8143['body'][_0x831d('0x4d')]=integrations[_0x831d('0x4e')](_0x3f8143[_0x831d('0x45')][_0x831d('0x4f')],_0x3f8143[_0x831d('0x45')][_0x831d('0x38')]);_0x3f8143[_0x831d('0x45')][_0x831d('0x50')]=integrations[_0x831d('0x51')](_0x3f8143[_0x831d('0x45')][_0x831d('0x4f')],_0x3f8143['body'][_0x831d('0x38')]);return db['ZohoConfiguration'][_0x831d('0x44')](_0x3f8143['body'],{'include':[{'model':db['ZohoField'],'as':_0x831d('0x4d')},{'model':db[_0x831d('0x52')],'as':_0x831d('0x50')}]});}return null;})['then'](respondWithResult(_0x1aa8dc,null))[_0x831d('0x3f')](handleError(_0x1aa8dc,null));};function getAccessToken(_0x4ca441){return new Promise(function(_0x584c30,_0x594aa3){var _0x531d11;switch(_0x4ca441['zone']){case'US':_0x531d11='https://accounts.zoho.com';break;case'AU':_0x531d11=_0x831d('0x53');break;case'EU':_0x531d11=_0x831d('0x54');break;case'IN':_0x531d11=_0x831d('0x55');break;case'CN':_0x531d11=_0x831d('0x56');break;default:_0x531d11=_0x831d('0x54');break;}var _0x3e1e63={'method':_0x831d('0x57'),'uri':_0x531d11+_0x831d('0x58'),'qs':{'refresh_token':_0x4ca441[_0x831d('0x59')],'client_id':_0x4ca441[_0x831d('0x5a')],'client_secret':_0x4ca441[_0x831d('0x5b')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x3e1e63)[_0x831d('0x20')](function(_0x3fc172){if(_0x3fc172[_0x831d('0x5c')]){_0x584c30(_0x3fc172[_0x831d('0x5c')]);}else{_0x594aa3(_0x831d('0x5d'));}})[_0x831d('0x3f')](function(_0x45326d){_0x594aa3(_0x45326d);});});}exports[_0x831d('0x5e')]=function(_0xfec592,_0x5e1160,_0x2d6014){var _0x28324c,_0x59f784,_0x591443,_0x49fde4,_0x3fd4d7;return db[_0x831d('0x3b')][_0x831d('0x47')]({'where':{'id':_0xfec592[_0x831d('0x41')]['id']},'attributes':['id',_0x831d('0x5f'),_0x831d('0x60'),_0x831d('0x5a'),'clientSecret',_0x831d('0x61'),'code','refreshToken']})['then'](handleEntityNotFound(_0x5e1160,null))[_0x831d('0x20')](function(_0x45b52c){_0x3fd4d7=_0x45b52c;_0x28324c=_0x3fd4d7['host'];_0x59f784=_0x28324c===_0x831d('0x62')?'eu':_0x831d('0x63');_0x591443=_0x3fd4d7[_0x831d('0x61')];var _0x173073=_0x591443[_0x831d('0x64')](-0x1);if(_0x173073==='/'||_0x173073==='\x5c'||_0x173073===':'){_0x591443=_0x591443[_0x831d('0x65')](0x0,_0x591443[_0x831d('0x66')](_0x173073));}if(!_0x3fd4d7['refreshToken']){throw new Error(_0x831d('0x67'));}return getAccessToken(_0x3fd4d7);})[_0x831d('0x20')](function(_0x3f8dd7){if(_0x3f8dd7){return rp({'method':_0x831d('0x68'),'uri':util[_0x831d('0x69')](_0x831d('0x6a'),_0x59f784),'qs':{'module':'Calls'},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x3f8dd7},'json':!![]});}})[_0x831d('0x20')](function(_0x1ca66a){if(_0x1ca66a){if(_0x1ca66a['response']&&_0x1ca66a['response'][_0x831d('0x23')]){throw new Error(_0x1ca66a[_0x831d('0x6b')]['error'][_0x831d('0x6c')]);}var _0x24f40f=[];var _0x529e91=[];var _0x2584bf=[_0x831d('0x6d'),_0x831d('0x6e'),_0x831d('0x6f'),_0x831d('0x70'),_0x831d('0x71'),'Call_Result',_0x831d('0x72'),'Call_Type'];_0x529e91=_['remove'](_0x1ca66a['fields'],function(_0x21f791){return _0x2584bf[_0x831d('0x73')](_0x21f791['api_name']);});for(var _0x58a9d6=0x0;_0x58a9d6<_0x529e91['length'];_0x58a9d6++){if(_0x529e91[_0x58a9d6][_0x831d('0x74')]===![]){_0x24f40f[_0x831d('0x75')]({'id':_0x529e91[_0x58a9d6]['id'],'name':_0x529e91[_0x58a9d6][_0x831d('0x76')],'custom':_0x529e91[_0x58a9d6]['custom_field'],'options':_0x529e91[_0x58a9d6][_0x831d('0x77')]==='picklist'&&_0x529e91[_0x58a9d6][_0x831d('0x78')][_0x831d('0x42')]>-0x1?_[_0x831d('0x27')](_0x529e91[_0x58a9d6][_0x831d('0x78')],function(_0x1e242f){return{'name':_0x1e242f,'value':_0x1e242f};}):[]});}}return{'count':_0x24f40f[_0x831d('0x42')],'rows':_0x24f40f};}else{return{'count':0x0,'rows':[]};}})[_0x831d('0x20')](respondWithResult(_0x5e1160,null))[_0x831d('0x3f')](function(_0x1973c4){var _0x2f60ce=_0xfec592[_0x831d('0x2d')][_0x831d('0x79')]?0x1f4:_0x1973c4['statusCode']||0x1f4;logger[_0x831d('0x23')](_0x831d('0x7a'),_0x831d('0x5e'),_0x2f60ce,JSON[_0x831d('0x7b')](_0x1973c4));delete _0x1973c4['name'];if(_0x2f60ce===0x191){_0x2f60ce=0x190;}_0x5e1160[_0x831d('0x16')](_0x2f60ce)[_0x831d('0x26')](_0xfec592[_0x831d('0x2d')][_0x831d('0x79')]?{'message':_0x831d('0x7c'),'statusCode':_0x1973c4[_0x831d('0x7d')]}:_0x1973c4);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 5751f99..4eb113a 100644 --- a/server/api/intZohoAccount/intZohoAccount.model.js +++ b/server/api/intZohoAccount/intZohoAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x209e=['clientSecret','code','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','authorization_code','then','parse','refresh_token','refreshToken','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','format','inspect','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','https://accounts.zoho.in','/oauth/v2/token','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId'];(function(_0x254081,_0x20731a){var _0x5d1e2a=function(_0x597854){while(--_0x597854){_0x254081['push'](_0x254081['shift']());}};_0x5d1e2a(++_0x20731a);}(_0x209e,0x70));var _0xe209=function(_0x14b601,_0x31336d){_0x14b601=_0x14b601-0x0;var _0x1adacc=_0x209e[_0x14b601];return _0x1adacc;};'use strict';var _=require(_0xe209('0x0'));var util=require(_0xe209('0x1'));var logger=require(_0xe209('0x2'))(_0xe209('0x3'));var moment=require(_0xe209('0x4'));var BPromise=require('bluebird');var rp=require(_0xe209('0x5'));var fs=require('fs');var path=require(_0xe209('0x6'));var rimraf=require(_0xe209('0x7'));var config=require('../../config/environment');var attributes=require('./intZohoAccount.attributes');var integrations=require(_0xe209('0x8'));module[_0xe209('0x9')]=function(_0xf51127,_0x46ef81){return _0xf51127[_0xe209('0xa')](_0xe209('0xb'),attributes,{'tableName':_0xe209('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x24d7f2,_0x2391b0,_0x4a65f2){if(_0x24d7f2[_0xe209('0xd')](_0xe209('0xe'))||_0x24d7f2['changed'](_0xe209('0xf'))||_0x24d7f2[_0xe209('0xd')](_0xe209('0x10'))||_0x24d7f2[_0xe209('0xd')](_0xe209('0x11'))||_0x24d7f2['changed'](_0xe209('0x12'))||_0x24d7f2[_0xe209('0xd')](_0xe209('0x13'))){var _0x27c994,_0x575215;_0x27c994=_0x24d7f2[_0xe209('0xf')];var _0x5e4cf8=_0x27c994[_0xe209('0x14')](-0x1);if(_0x5e4cf8==='/'||_0x5e4cf8==='\x5c'||_0x5e4cf8===':'){_0x27c994=_0x27c994[_0xe209('0x15')](0x0,_0x27c994[_0xe209('0x16')](_0x5e4cf8));}switch(_0x24d7f2[_0xe209('0xe')]){case'US':_0x575215=_0xe209('0x17');break;case'AU':_0x575215=_0xe209('0x18');break;case'IN':_0x575215='https://accounts.zoho.in';break;case'CN':_0x575215=_0xe209('0x19');break;default:_0x575215=_0xe209('0x1a');break;}var _0x45a789={'method':_0xe209('0x1b'),'uri':_0x575215+'/oauth/v2/token','form':{'grant_type':_0xe209('0x1c'),'client_id':_0x24d7f2[_0xe209('0x10')],'client_secret':_0x24d7f2[_0xe209('0x11')],'redirect_uri':_0x24d7f2[_0xe209('0xf')],'code':_0x24d7f2[_0xe209('0x12')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x45a789)[_0xe209('0x1d')](function(_0x8e6536){var _0x386ac6=JSON[_0xe209('0x1e')](_0x8e6536);if(_0x386ac6[_0xe209('0x1f')]){_0x24d7f2[_0xe209('0x20')]=_0x386ac6[_0xe209('0x1f')];logger[_0xe209('0x21')](util['format'](_0xe209('0x22'),_0x24d7f2[_0xe209('0x23')],_0x24d7f2['id']));}else{logger[_0xe209('0x24')](util[_0xe209('0x25')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x24d7f2['name'],_0x24d7f2['id']),util[_0xe209('0x26')](_0x386ac6,{'showHidden':![],'depth':null}));}return _0x4a65f2(null,_0x2391b0);})[_0xe209('0x27')](function(_0x3ee198){logger[_0xe209('0x24')](util[_0xe209('0x25')](_0xe209('0x28'),_0x24d7f2['name'],_0x24d7f2['id']),util[_0xe209('0x26')](parsedResult,{'showHidden':![],'depth':null}));return _0x4a65f2(_0x3ee198);});}else{return _0x4a65f2(null,_0x2391b0);}},'beforeUpdate':function(_0x6780ae,_0x35ed66,_0x173f4d){if(_0x6780ae['changed'](_0xe209('0xe'))||_0x6780ae[_0xe209('0xd')](_0xe209('0xf'))||_0x6780ae['changed']('clientId')||_0x6780ae['changed'](_0xe209('0x11'))||_0x6780ae[_0xe209('0xd')](_0xe209('0x12'))||_0x6780ae[_0xe209('0xd')]('host')){var _0x569765,_0x2a78a9;_0x569765=_0x6780ae[_0xe209('0xf')];var _0x4c8034=_0x569765[_0xe209('0x14')](-0x1);if(_0x4c8034==='/'||_0x4c8034==='\x5c'||_0x4c8034===':'){_0x569765=_0x569765[_0xe209('0x15')](0x0,_0x569765[_0xe209('0x16')](_0x4c8034));}switch(_0x6780ae[_0xe209('0xe')]){case'US':_0x2a78a9=_0xe209('0x17');break;case'AU':_0x2a78a9=_0xe209('0x18');break;case'IN':_0x2a78a9=_0xe209('0x29');break;case'CN':_0x2a78a9=_0xe209('0x19');break;default:_0x2a78a9=_0xe209('0x1a');break;}var _0x59e26d={'method':'POST','uri':_0x2a78a9+_0xe209('0x2a'),'form':{'grant_type':'authorization_code','client_id':_0x6780ae['clientId'],'client_secret':_0x6780ae[_0xe209('0x11')],'redirect_uri':_0x6780ae[_0xe209('0xf')],'code':_0x6780ae['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x59e26d)[_0xe209('0x1d')](function(_0x4c5905){var _0x14cb7f=JSON[_0xe209('0x1e')](_0x4c5905);if(_0x14cb7f[_0xe209('0x1f')]){_0x6780ae[_0xe209('0x20')]=_0x14cb7f[_0xe209('0x1f')];logger[_0xe209('0x21')](util[_0xe209('0x25')](_0xe209('0x22'),_0x6780ae[_0xe209('0x23')],_0x6780ae['id']));}else{logger[_0xe209('0x24')](util['format'](_0xe209('0x28'),_0x6780ae['name'],_0x6780ae['id']),util['inspect'](_0x14cb7f,{'showHidden':![],'depth':null}));}return _0x173f4d(null,_0x35ed66);})[_0xe209('0x27')](function(_0x356c73){logger[_0xe209('0x24')](util[_0xe209('0x25')](_0xe209('0x28'),_0x6780ae[_0xe209('0x23')],_0x6780ae['id']),util[_0xe209('0x26')](parsedResult,{'showHidden':![],'depth':null}));return _0x173f4d(_0x356c73);});}else{return _0x173f4d(null,_0x35ed66);}}}});}; \ No newline at end of file +var _0x2d87=['host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','authorization_code','clientId','application/x-www-form-urlencoded','then','refresh_token','refreshToken','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','https://accounts.zoho.com.au','/oauth/v2/token','parse','lodash','api','moment','bluebird','request-promise','path','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','ZohoAccount','int_zoho_accounts','zone','changed','serverUrl','clientSecret','code'];(function(_0x54a9e3,_0x4a3813){var _0x247cce=function(_0x50aa49){while(--_0x50aa49){_0x54a9e3['push'](_0x54a9e3['shift']());}};_0x247cce(++_0x4a3813);}(_0x2d87,0xc6));var _0x72d8=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x2d87[_0x376b45];return _0x2341b3;};'use strict';var _=require(_0x72d8('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x72d8('0x1'));var moment=require(_0x72d8('0x2'));var BPromise=require(_0x72d8('0x3'));var rp=require(_0x72d8('0x4'));var fs=require('fs');var path=require(_0x72d8('0x5'));var rimraf=require('rimraf');var config=require(_0x72d8('0x6'));var attributes=require(_0x72d8('0x7'));var integrations=require(_0x72d8('0x8'));module[_0x72d8('0x9')]=function(_0x577550,_0x20fe9f){return _0x577550['define'](_0x72d8('0xa'),attributes,{'tableName':_0x72d8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x11e38b,_0x584342,_0xa4091d){if(_0x11e38b['changed'](_0x72d8('0xc'))||_0x11e38b[_0x72d8('0xd')](_0x72d8('0xe'))||_0x11e38b[_0x72d8('0xd')]('clientId')||_0x11e38b[_0x72d8('0xd')](_0x72d8('0xf'))||_0x11e38b['changed'](_0x72d8('0x10'))||_0x11e38b[_0x72d8('0xd')](_0x72d8('0x11'))){var _0x199271,_0x2c278e;_0x199271=_0x11e38b['serverUrl'];var _0x8d99ee=_0x199271[_0x72d8('0x12')](-0x1);if(_0x8d99ee==='/'||_0x8d99ee==='\x5c'||_0x8d99ee===':'){_0x199271=_0x199271[_0x72d8('0x13')](0x0,_0x199271[_0x72d8('0x14')](_0x8d99ee));}switch(_0x11e38b['zone']){case'US':_0x2c278e=_0x72d8('0x15');break;case'AU':_0x2c278e='https://accounts.zoho.com.au';break;case'IN':_0x2c278e=_0x72d8('0x16');break;case'CN':_0x2c278e=_0x72d8('0x17');break;default:_0x2c278e=_0x72d8('0x18');break;}var _0x217470={'method':_0x72d8('0x19'),'uri':_0x2c278e+'/oauth/v2/token','form':{'grant_type':_0x72d8('0x1a'),'client_id':_0x11e38b[_0x72d8('0x1b')],'client_secret':_0x11e38b[_0x72d8('0xf')],'redirect_uri':_0x11e38b[_0x72d8('0xe')],'code':_0x11e38b[_0x72d8('0x10')]},'headers':{'Content-Type':_0x72d8('0x1c')}};return rp(_0x217470)[_0x72d8('0x1d')](function(_0x49df1c){var _0x48e964=JSON['parse'](_0x49df1c);if(_0x48e964[_0x72d8('0x1e')]){_0x11e38b[_0x72d8('0x1f')]=_0x48e964[_0x72d8('0x1e')];logger[_0x72d8('0x20')](util['format'](_0x72d8('0x21'),_0x11e38b[_0x72d8('0x22')],_0x11e38b['id']));}else{logger[_0x72d8('0x23')](util[_0x72d8('0x24')](_0x72d8('0x25'),_0x11e38b[_0x72d8('0x22')],_0x11e38b['id']),util[_0x72d8('0x26')](_0x48e964,{'showHidden':![],'depth':null}));}return _0xa4091d(null,_0x584342);})[_0x72d8('0x27')](function(_0x4c3d19){logger[_0x72d8('0x23')](util[_0x72d8('0x24')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x11e38b[_0x72d8('0x22')],_0x11e38b['id']),util[_0x72d8('0x26')](parsedResult,{'showHidden':![],'depth':null}));return _0xa4091d(_0x4c3d19);});}else{return _0xa4091d(null,_0x584342);}},'beforeUpdate':function(_0x3d8980,_0x57c660,_0x463322){if(_0x3d8980[_0x72d8('0xd')](_0x72d8('0xc'))||_0x3d8980[_0x72d8('0xd')](_0x72d8('0xe'))||_0x3d8980['changed'](_0x72d8('0x1b'))||_0x3d8980[_0x72d8('0xd')](_0x72d8('0xf'))||_0x3d8980[_0x72d8('0xd')](_0x72d8('0x10'))||_0x3d8980['changed'](_0x72d8('0x11'))){var _0x293a2b,_0x335d0c;_0x293a2b=_0x3d8980[_0x72d8('0xe')];var _0x5c0faa=_0x293a2b[_0x72d8('0x12')](-0x1);if(_0x5c0faa==='/'||_0x5c0faa==='\x5c'||_0x5c0faa===':'){_0x293a2b=_0x293a2b[_0x72d8('0x13')](0x0,_0x293a2b[_0x72d8('0x14')](_0x5c0faa));}switch(_0x3d8980[_0x72d8('0xc')]){case'US':_0x335d0c='https://accounts.zoho.com';break;case'AU':_0x335d0c=_0x72d8('0x28');break;case'IN':_0x335d0c=_0x72d8('0x16');break;case'CN':_0x335d0c=_0x72d8('0x17');break;default:_0x335d0c=_0x72d8('0x18');break;}var _0x511870={'method':'POST','uri':_0x335d0c+_0x72d8('0x29'),'form':{'grant_type':_0x72d8('0x1a'),'client_id':_0x3d8980[_0x72d8('0x1b')],'client_secret':_0x3d8980['clientSecret'],'redirect_uri':_0x3d8980[_0x72d8('0xe')],'code':_0x3d8980['code']},'headers':{'Content-Type':_0x72d8('0x1c')}};return rp(_0x511870)[_0x72d8('0x1d')](function(_0xbe31a5){var _0x10b18c=JSON[_0x72d8('0x2a')](_0xbe31a5);if(_0x10b18c['refresh_token']){_0x3d8980['refreshToken']=_0x10b18c[_0x72d8('0x1e')];logger['info'](util[_0x72d8('0x24')](_0x72d8('0x21'),_0x3d8980[_0x72d8('0x22')],_0x3d8980['id']));}else{logger[_0x72d8('0x23')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x3d8980[_0x72d8('0x22')],_0x3d8980['id']),util[_0x72d8('0x26')](_0x10b18c,{'showHidden':![],'depth':null}));}return _0x463322(null,_0x57c660);})[_0x72d8('0x27')](function(_0x394adf){logger[_0x72d8('0x23')](util[_0x72d8('0x24')](_0x72d8('0x25'),_0x3d8980[_0x72d8('0x22')],_0x3d8980['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x463322(_0x394adf);});}else{return _0x463322(null,_0x57c660);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 3118598..5c00db7 100644 --- a/server/api/intZohoAccount/intZohoAccount.rpc.js +++ b/server/api/intZohoAccount/intZohoAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa329=['then','ShowZohoAccount','ZohoAccount','find','lodash','util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetZohoAccount','findAll','options','raw','where','limit','include','model','map','attributes'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xa329,0x162));var _0x9a32=function(_0x5e3ac2,_0x225614){_0x5e3ac2=_0x5e3ac2-0x0;var _0x29a007=_0xa329[_0x5e3ac2];return _0x29a007;};'use strict';var _=require(_0x9a32('0x0'));var util=require(_0x9a32('0x1'));var moment=require('moment');var BPromise=require(_0x9a32('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9a32('0x3'));var db=require(_0x9a32('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9a32('0x5'));var config=require(_0x9a32('0x6'));var jayson=require(_0x9a32('0x7'));var client=jayson[_0x9a32('0x8')][_0x9a32('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x235b92,_0x4a8fba,_0x5b8b5e){return new BPromise(function(_0x4dc7f8,_0x344b35){return client[_0x9a32('0xa')](_0x235b92,_0x5b8b5e)['then'](function(_0x38f6cc){logger[_0x9a32('0xb')](_0x9a32('0xc'),_0x4a8fba,_0x9a32('0xd'));logger[_0x9a32('0xe')](_0x9a32('0xf'),_0x4a8fba,'request\x20sent',JSON[_0x9a32('0x10')](_0x38f6cc));if(_0x38f6cc[_0x9a32('0x11')]){if(_0x38f6cc['error']['code']===0x1f4){logger[_0x9a32('0x11')](_0x9a32('0xc'),_0x4a8fba,_0x38f6cc['error']['message']);return _0x344b35(_0x38f6cc[_0x9a32('0x11')][_0x9a32('0x12')]);}logger[_0x9a32('0x11')](_0x9a32('0xc'),_0x4a8fba,_0x38f6cc['error'][_0x9a32('0x12')]);return _0x4dc7f8(_0x38f6cc[_0x9a32('0x11')]['message']);}else{logger[_0x9a32('0xb')](_0x9a32('0xc'),_0x4a8fba,_0x9a32('0xd'));_0x4dc7f8(_0x38f6cc[_0x9a32('0x13')][_0x9a32('0x12')]);}})[_0x9a32('0x14')](function(_0x4fa645){logger[_0x9a32('0x11')](_0x9a32('0xc'),_0x4a8fba,_0x4fa645);_0x344b35(_0x4fa645);});});}exports[_0x9a32('0x15')]=function(_0x4cfd70){var _0x3606ab=this;return new Promise(function(_0x1448da,_0x49f517){return db['ZohoAccount'][_0x9a32('0x16')]({'raw':_0x4cfd70[_0x9a32('0x17')]?_0x4cfd70[_0x9a32('0x17')][_0x9a32('0x18')]===undefined?!![]:![]:!![],'where':_0x4cfd70[_0x9a32('0x17')]?_0x4cfd70['options'][_0x9a32('0x19')]||null:null,'attributes':_0x4cfd70[_0x9a32('0x17')]?_0x4cfd70[_0x9a32('0x17')]['attributes']||null:null,'limit':_0x4cfd70[_0x9a32('0x17')]?_0x4cfd70[_0x9a32('0x17')][_0x9a32('0x1a')]||null:null,'include':_0x4cfd70[_0x9a32('0x17')]?_0x4cfd70[_0x9a32('0x17')][_0x9a32('0x1b')]?_['map'](_0x4cfd70['options'][_0x9a32('0x1b')],function(_0x2cb1ff){return{'model':db[_0x2cb1ff[_0x9a32('0x1c')]],'as':_0x2cb1ff['as'],'attributes':_0x2cb1ff['attributes'],'include':_0x2cb1ff['include']?_[_0x9a32('0x1d')](_0x2cb1ff[_0x9a32('0x1b')],function(_0x301dac){return{'model':db[_0x301dac['model']],'as':_0x301dac['as'],'attributes':_0x301dac['attributes'],'include':_0x301dac['include']?_[_0x9a32('0x1d')](_0x301dac['include'],function(_0x527159){return{'model':db[_0x527159['model']],'as':_0x527159['as'],'attributes':_0x527159[_0x9a32('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9a32('0x1f')](function(_0x10edcf){logger[_0x9a32('0xb')](_0x9a32('0x15'),_0x4cfd70);logger[_0x9a32('0xe')](_0x9a32('0x15'),_0x4cfd70,JSON[_0x9a32('0x10')](_0x10edcf));_0x1448da(_0x10edcf);})[_0x9a32('0x14')](function(_0x35c1be){logger[_0x9a32('0x11')]('GetZohoAccount',_0x35c1be[_0x9a32('0x12')],_0x4cfd70);_0x49f517(_0x3606ab[_0x9a32('0x11')](0x1f4,_0x35c1be['message']));});});};exports[_0x9a32('0x20')]=function(_0x48674a){var _0x18a7b3=this;return new Promise(function(_0x227dbc,_0x416ba3){return db[_0x9a32('0x21')][_0x9a32('0x22')]({'raw':_0x48674a['options']?_0x48674a[_0x9a32('0x17')][_0x9a32('0x18')]===undefined?!![]:![]:!![],'where':_0x48674a[_0x9a32('0x17')]?_0x48674a[_0x9a32('0x17')][_0x9a32('0x19')]||null:null,'attributes':_0x48674a[_0x9a32('0x17')]?_0x48674a['options'][_0x9a32('0x1e')]||null:null,'include':_0x48674a[_0x9a32('0x17')]?_0x48674a[_0x9a32('0x17')][_0x9a32('0x1b')]?_[_0x9a32('0x1d')](_0x48674a['options'][_0x9a32('0x1b')],function(_0x4d113c){return{'model':db[_0x4d113c[_0x9a32('0x1c')]],'as':_0x4d113c['as'],'attributes':_0x4d113c['attributes'],'include':_0x4d113c['include']?_['map'](_0x4d113c['include'],function(_0x37f0f6){return{'model':db[_0x37f0f6[_0x9a32('0x1c')]],'as':_0x37f0f6['as'],'attributes':_0x37f0f6['attributes'],'include':_0x37f0f6[_0x9a32('0x1b')]?_[_0x9a32('0x1d')](_0x37f0f6[_0x9a32('0x1b')],function(_0x20cad1){return{'model':db[_0x20cad1[_0x9a32('0x1c')]],'as':_0x20cad1['as'],'attributes':_0x20cad1['attributes']};}):[]};}):[]};}):[]:[]})[_0x9a32('0x1f')](function(_0x319985){logger[_0x9a32('0xb')](_0x9a32('0x20'),_0x48674a);logger[_0x9a32('0xe')](_0x9a32('0x20'),_0x48674a,JSON[_0x9a32('0x10')](_0x319985));_0x227dbc(_0x319985);})[_0x9a32('0x14')](function(_0x15d70f){logger['error'](_0x9a32('0x20'),_0x15d70f['message'],_0x48674a);_0x416ba3(_0x18a7b3[_0x9a32('0x11')](0x1f4,_0x15d70f[_0x9a32('0x12')]));});});}; \ No newline at end of file +var _0x9db7=['ShowZohoAccount','ZohoAccount','find','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetZohoAccount','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x3df955,_0x1217bc){var _0x4d0425=function(_0x4bfd28){while(--_0x4bfd28){_0x3df955['push'](_0x3df955['shift']());}};_0x4d0425(++_0x1217bc);}(_0x9db7,0x1bf));var _0x79db=function(_0x5a1c65,_0x5dda7c){_0x5a1c65=_0x5a1c65-0x0;var _0xc5561c=_0x9db7[_0x5a1c65];return _0xc5561c;};'use strict';var _=require(_0x79db('0x0'));var util=require(_0x79db('0x1'));var moment=require(_0x79db('0x2'));var BPromise=require(_0x79db('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x79db('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x79db('0x5'));var logger=require(_0x79db('0x6'))('rpc');var config=require(_0x79db('0x7'));var jayson=require(_0x79db('0x8'));var client=jayson[_0x79db('0x9')][_0x79db('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7980b1,_0x395883,_0x214bf9){return new BPromise(function(_0x792510,_0x27d02a){return client[_0x79db('0xb')](_0x7980b1,_0x214bf9)[_0x79db('0xc')](function(_0x145a31){logger['info'](_0x79db('0xd'),_0x395883,_0x79db('0xe'));logger[_0x79db('0xf')](_0x79db('0x10'),_0x395883,_0x79db('0xe'),JSON[_0x79db('0x11')](_0x145a31));if(_0x145a31[_0x79db('0x12')]){if(_0x145a31[_0x79db('0x12')][_0x79db('0x13')]===0x1f4){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x395883,_0x145a31['error'][_0x79db('0x14')]);return _0x27d02a(_0x145a31['error'][_0x79db('0x14')]);}logger['error'](_0x79db('0xd'),_0x395883,_0x145a31[_0x79db('0x12')][_0x79db('0x14')]);return _0x792510(_0x145a31[_0x79db('0x12')][_0x79db('0x14')]);}else{logger[_0x79db('0x15')](_0x79db('0xd'),_0x395883,_0x79db('0xe'));_0x792510(_0x145a31[_0x79db('0x16')][_0x79db('0x14')]);}})[_0x79db('0x17')](function(_0x365889){logger[_0x79db('0x12')]('ZohoAccount,\x20%s,\x20%s',_0x395883,_0x365889);_0x27d02a(_0x365889);});});}exports[_0x79db('0x18')]=function(_0x43912f){var _0x200c87=this;return new Promise(function(_0x77f6d0,_0x2532d4){return db['ZohoAccount'][_0x79db('0x19')]({'raw':_0x43912f[_0x79db('0x1a')]?_0x43912f['options'][_0x79db('0x1b')]===undefined?!![]:![]:!![],'where':_0x43912f[_0x79db('0x1a')]?_0x43912f['options'][_0x79db('0x1c')]||null:null,'attributes':_0x43912f[_0x79db('0x1a')]?_0x43912f[_0x79db('0x1a')][_0x79db('0x1d')]||null:null,'limit':_0x43912f[_0x79db('0x1a')]?_0x43912f[_0x79db('0x1a')][_0x79db('0x1e')]||null:null,'include':_0x43912f[_0x79db('0x1a')]?_0x43912f[_0x79db('0x1a')][_0x79db('0x1f')]?_[_0x79db('0x20')](_0x43912f[_0x79db('0x1a')][_0x79db('0x1f')],function(_0x25a360){return{'model':db[_0x25a360[_0x79db('0x21')]],'as':_0x25a360['as'],'attributes':_0x25a360['attributes'],'include':_0x25a360[_0x79db('0x1f')]?_[_0x79db('0x20')](_0x25a360['include'],function(_0x4dfa54){return{'model':db[_0x4dfa54[_0x79db('0x21')]],'as':_0x4dfa54['as'],'attributes':_0x4dfa54[_0x79db('0x1d')],'include':_0x4dfa54[_0x79db('0x1f')]?_[_0x79db('0x20')](_0x4dfa54[_0x79db('0x1f')],function(_0x3def02){return{'model':db[_0x3def02[_0x79db('0x21')]],'as':_0x3def02['as'],'attributes':_0x3def02[_0x79db('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x79db('0xc')](function(_0x4a6bb2){logger[_0x79db('0x15')]('GetZohoAccount',_0x43912f);logger[_0x79db('0xf')]('GetZohoAccount',_0x43912f,JSON['stringify'](_0x4a6bb2));_0x77f6d0(_0x4a6bb2);})[_0x79db('0x17')](function(_0x45bd26){logger['error'](_0x79db('0x18'),_0x45bd26[_0x79db('0x14')],_0x43912f);_0x2532d4(_0x200c87[_0x79db('0x12')](0x1f4,_0x45bd26['message']));});});};exports[_0x79db('0x22')]=function(_0x92a11){var _0x5e6778=this;return new Promise(function(_0x835267,_0x2da725){return db[_0x79db('0x23')][_0x79db('0x24')]({'raw':_0x92a11['options']?_0x92a11[_0x79db('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x92a11[_0x79db('0x1a')]?_0x92a11['options'][_0x79db('0x1c')]||null:null,'attributes':_0x92a11[_0x79db('0x1a')]?_0x92a11['options'][_0x79db('0x1d')]||null:null,'include':_0x92a11[_0x79db('0x1a')]?_0x92a11[_0x79db('0x1a')][_0x79db('0x1f')]?_[_0x79db('0x20')](_0x92a11[_0x79db('0x1a')][_0x79db('0x1f')],function(_0x8ddc7d){return{'model':db[_0x8ddc7d['model']],'as':_0x8ddc7d['as'],'attributes':_0x8ddc7d[_0x79db('0x1d')],'include':_0x8ddc7d['include']?_['map'](_0x8ddc7d[_0x79db('0x1f')],function(_0x40f54b){return{'model':db[_0x40f54b[_0x79db('0x21')]],'as':_0x40f54b['as'],'attributes':_0x40f54b[_0x79db('0x1d')],'include':_0x40f54b[_0x79db('0x1f')]?_[_0x79db('0x20')](_0x40f54b['include'],function(_0x572fb8){return{'model':db[_0x572fb8[_0x79db('0x21')]],'as':_0x572fb8['as'],'attributes':_0x572fb8[_0x79db('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x79db('0xc')](function(_0x55cf56){logger[_0x79db('0x15')]('ShowZohoAccount',_0x92a11);logger[_0x79db('0xf')](_0x79db('0x22'),_0x92a11,JSON[_0x79db('0x11')](_0x55cf56));_0x835267(_0x55cf56);})[_0x79db('0x17')](function(_0x26ce8a){logger[_0x79db('0x12')](_0x79db('0x22'),_0x26ce8a[_0x79db('0x14')],_0x92a11);_0x2da725(_0x5e6778[_0x79db('0x12')](0x1f4,_0x26ce8a[_0x79db('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 839e08b..20f548e 100644 --- a/server/api/intZohoConfiguration/index.js +++ b/server/api/intZohoConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb522=['isAuthenticated','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','destroy','multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','index','/:id'];(function(_0xf71cea,_0x50189b){var _0xf036ae=function(_0x450877){while(--_0x450877){_0xf71cea['push'](_0xf71cea['shift']());}};_0xf036ae(++_0x50189b);}(_0xb522,0xf2));var _0x2b52=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb522[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x2b52('0x0'));var util=require(_0x2b52('0x1'));var path=require('path');var timeout=require(_0x2b52('0x2'));var express=require('express');var router=express[_0x2b52('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2b52('0x4'));var config=require(_0x2b52('0x5'));var controller=require(_0x2b52('0x6'));router[_0x2b52('0x7')]('/',auth['isAuthenticated'](),controller[_0x2b52('0x8')]);router[_0x2b52('0x7')](_0x2b52('0x9'),auth[_0x2b52('0xa')](),controller['show']);router['get'](_0x2b52('0xb'),auth['isAuthenticated'](),controller[_0x2b52('0xc')]);router['get'](_0x2b52('0xd'),auth[_0x2b52('0xa')](),controller[_0x2b52('0xe')]);router[_0x2b52('0x7')]('/:id/descriptions',auth[_0x2b52('0xa')](),controller[_0x2b52('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2b52('0x10')]);router['put']('/:id',auth[_0x2b52('0xa')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x2b52('0x11')]);module['exports']=router; \ No newline at end of file +var _0xea86=['getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','update','/:id','destroy','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','show','/:id/fields'];(function(_0x2353fe,_0x4b0bca){var _0x4d43f6=function(_0x5d0bd9){while(--_0x5d0bd9){_0x2353fe['push'](_0x2353fe['shift']());}};_0x4d43f6(++_0x4b0bca);}(_0xea86,0x127));var _0x6ea8=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xea86[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x6ea8('0x0'));var util=require('util');var path=require(_0x6ea8('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6ea8('0x2')]();var fs_extra=require(_0x6ea8('0x3'));var auth=require(_0x6ea8('0x4'));var interaction=require(_0x6ea8('0x5'));var config=require(_0x6ea8('0x6'));var controller=require(_0x6ea8('0x7'));router[_0x6ea8('0x8')]('/',auth[_0x6ea8('0x9')](),controller[_0x6ea8('0xa')]);router[_0x6ea8('0x8')]('/:id',auth[_0x6ea8('0x9')](),controller[_0x6ea8('0xb')]);router[_0x6ea8('0x8')](_0x6ea8('0xc'),auth[_0x6ea8('0x9')](),controller[_0x6ea8('0xd')]);router[_0x6ea8('0x8')](_0x6ea8('0xe'),auth[_0x6ea8('0x9')](),controller[_0x6ea8('0xf')]);router[_0x6ea8('0x8')](_0x6ea8('0x10'),auth[_0x6ea8('0x9')](),controller['getDescriptions']);router[_0x6ea8('0x11')]('/',auth[_0x6ea8('0x9')](),controller[_0x6ea8('0x12')]);router['put']('/:id',auth[_0x6ea8('0x9')](),controller[_0x6ea8('0x13')]);router['delete'](_0x6ea8('0x14'),auth[_0x6ea8('0x9')](),controller[_0x6ea8('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 68b0d54..2c73303 100644 --- a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js +++ b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf29c=['contact','nothing','contact_lead','exports','STRING','ENUM','lead'];(function(_0x2ce1c4,_0x2b3579){var _0x424785=function(_0x204d83){while(--_0x204d83){_0x2ce1c4['push'](_0x2ce1c4['shift']());}};_0x424785(++_0x2b3579);}(_0xf29c,0xc7));var _0xcf29=function(_0x3bbc1e,_0x4add81){_0x3bbc1e=_0x3bbc1e-0x0;var _0x514bab=_0xf29c[_0x3bbc1e];return _0x514bab;};'use strict';var Sequelize=require('sequelize');module[_0xcf29('0x0')]={'name':{'type':Sequelize[_0xcf29('0x1')]},'moduleCreate':{'type':Sequelize[_0xcf29('0x2')](_0xcf29('0x3'),_0xcf29('0x4'),_0xcf29('0x5')),'defaultValue':_0xcf29('0x3')},'moduleSearch':{'type':Sequelize[_0xcf29('0x2')](_0xcf29('0x6'),_0xcf29('0x4'),_0xcf29('0x3')),'defaultValue':_0xcf29('0x6')},'description':{'type':Sequelize[_0xcf29('0x1')]}}; \ No newline at end of file +var _0xb922=['STRING','ENUM','lead','contact_lead','contact','sequelize','exports'];(function(_0x346e96,_0x223cc6){var _0x1c6de8=function(_0x12971a){while(--_0x12971a){_0x346e96['push'](_0x346e96['shift']());}};_0x1c6de8(++_0x223cc6);}(_0xb922,0x7c));var _0x2b92=function(_0x335f37,_0x37302b){_0x335f37=_0x335f37-0x0;var _0x1768f4=_0xb922[_0x335f37];return _0x1768f4;};'use strict';var Sequelize=require(_0x2b92('0x0'));module[_0x2b92('0x1')]={'name':{'type':Sequelize[_0x2b92('0x2')]},'moduleCreate':{'type':Sequelize[_0x2b92('0x3')](_0x2b92('0x4'),'contact','nothing'),'defaultValue':_0x2b92('0x4')},'moduleSearch':{'type':Sequelize[_0x2b92('0x3')](_0x2b92('0x5'),_0x2b92('0x6'),_0x2b92('0x4')),'defaultValue':_0x2b92('0x5')},'description':{'type':Sequelize[_0x2b92('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index cb12940..a6cf19d 100644 --- a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js +++ b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc7ee=['hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','intersection','find','catch','create','body','destroy','getFields','findOne','ZohoField','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','ZohoConfiguration','rawAttributes','fieldName','type','model','map','keys','filters','query','attributes','fields','length'];(function(_0x238bce,_0x1fa37a){var _0x127fc9=function(_0x5dbfbb){while(--_0x5dbfbb){_0x238bce['push'](_0x238bce['shift']());}};_0x127fc9(++_0x1fa37a);}(_0xc7ee,0xc3));var _0xec7e=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xc7ee[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require(_0xec7e('0x0'));var rimraf=require(_0xec7e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xec7e('0x2'));var rp=require(_0xec7e('0x3'));var moment=require(_0xec7e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xec7e('0x5'));var util=require(_0xec7e('0x6'));var path=require(_0xec7e('0x7'));var sox=require(_0xec7e('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xec7e('0x9'));var _=require(_0xec7e('0xa'));var squel=require(_0xec7e('0xb'));var crypto=require(_0xec7e('0xc'));var jsforce=require(_0xec7e('0xd'));var deskjs=require(_0xec7e('0xe'));var toCsv=require(_0xec7e('0xf'));var querystring=require(_0xec7e('0x10'));var Papa=require(_0xec7e('0x11'));var Redis=require(_0xec7e('0x12'));var authService=require(_0xec7e('0x13'));var qs=require(_0xec7e('0x14'));var as=require(_0xec7e('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xec7e('0x16'))(_0xec7e('0x17'));var utils=require('../../config/utils');var config=require(_0xec7e('0x18'));var licenseUtil=require(_0xec7e('0x19'));var db=require(_0xec7e('0x1a'))['db'];function respondWithStatusCode(_0xdbca36,_0x570db5){_0x570db5=_0x570db5||0xcc;return function(_0x347285){if(_0x347285){return _0xdbca36[_0xec7e('0x1b')](_0x570db5);}return _0xdbca36['status'](_0x570db5)[_0xec7e('0x1c')]();};}function respondWithResult(_0x4bf989,_0x3388ae){_0x3388ae=_0x3388ae||0xc8;return function(_0x2b4e31){if(_0x2b4e31){return _0x4bf989[_0xec7e('0x1d')](_0x3388ae)['json'](_0x2b4e31);}};}function respondWithFilteredResult(_0x2e7509,_0x34b31){return function(_0x4870bf){if(_0x4870bf){var _0x5d1f31=typeof _0x34b31[_0xec7e('0x1e')]===_0xec7e('0x1f')&&typeof _0x34b31['limit']===_0xec7e('0x1f');var _0x5c3747=_0x4870bf[_0xec7e('0x20')];var _0x8b6b87=_0x5d1f31?0x0:_0x34b31[_0xec7e('0x1e')];var _0x31ec9b=_0x5d1f31?_0x4870bf['count']:_0x34b31[_0xec7e('0x1e')]+_0x34b31['limit'];var _0x5a58c4;if(_0x31ec9b>=_0x5c3747){_0x31ec9b=_0x5c3747;_0x5a58c4=0xc8;}else{_0x5a58c4=0xce;}_0x2e7509[_0xec7e('0x1d')](_0x5a58c4);return _0x2e7509[_0xec7e('0x21')](_0xec7e('0x22'),_0x8b6b87+'-'+_0x31ec9b+'/'+_0x5c3747)['json'](_0x4870bf);}return null;};}function patchUpdates(_0x1b68b6){return function(_0x374ac0){try{jsonpatch[_0xec7e('0x23')](_0x374ac0,_0x1b68b6,!![]);}catch(_0x32709b){return BPromise[_0xec7e('0x24')](_0x32709b);}return _0x374ac0[_0xec7e('0x25')]();};}function saveUpdates(_0x5ac6d0,_0x30ba97){return function(_0x50028d){if(_0x50028d){return _0x50028d[_0xec7e('0x26')](_0x5ac6d0)[_0xec7e('0x27')](function(_0x5b9738){return _0x5b9738;});}return null;};}function removeEntity(_0x34480a,_0x4a0085){return function(_0x46c3a4){if(_0x46c3a4){return _0x46c3a4['destroy']()[_0xec7e('0x27')](function(){_0x34480a['status'](0xcc)[_0xec7e('0x1c')]();});}};}function handleEntityNotFound(_0x4f345d,_0x2af498){return function(_0x123aed){if(!_0x123aed){_0x4f345d['sendStatus'](0x194);}return _0x123aed;};}function handleError(_0x468f19,_0x56c80c){_0x56c80c=_0x56c80c||0x1f4;return function(_0x1d6282){logger[_0xec7e('0x28')](_0x1d6282[_0xec7e('0x29')]);if(_0x1d6282[_0xec7e('0x2a')]){delete _0x1d6282[_0xec7e('0x2a')];}_0x468f19[_0xec7e('0x1d')](_0x56c80c)[_0xec7e('0x2b')](_0x1d6282);};}exports[_0xec7e('0x2c')]=function(_0x3ba5a9,_0x5bb945){var _0x32fba0={},_0x156613={},_0x391947={'count':0x0,'rows':[]};var _0x5e765b=_['map'](db[_0xec7e('0x2d')][_0xec7e('0x2e')],function(_0x55c224){return{'name':_0x55c224[_0xec7e('0x2f')],'type':_0x55c224[_0xec7e('0x30')]['key']};});_0x156613[_0xec7e('0x31')]=_[_0xec7e('0x32')](_0x5e765b,_0xec7e('0x2a'));_0x156613['query']=_[_0xec7e('0x33')](_0x3ba5a9['query']);_0x156613[_0xec7e('0x34')]=_['intersection'](_0x156613[_0xec7e('0x31')],_0x156613[_0xec7e('0x35')]);_0x32fba0[_0xec7e('0x36')]=_['intersection'](_0x156613[_0xec7e('0x31')],qs[_0xec7e('0x37')](_0x3ba5a9[_0xec7e('0x35')][_0xec7e('0x37')]));_0x32fba0[_0xec7e('0x36')]=_0x32fba0['attributes'][_0xec7e('0x38')]?_0x32fba0[_0xec7e('0x36')]:_0x156613[_0xec7e('0x31')];if(!_0x3ba5a9['query'][_0xec7e('0x39')](_0xec7e('0x3a'))){_0x32fba0[_0xec7e('0x3b')]=qs[_0xec7e('0x3b')](_0x3ba5a9[_0xec7e('0x35')]['limit']);_0x32fba0[_0xec7e('0x1e')]=qs[_0xec7e('0x1e')](_0x3ba5a9[_0xec7e('0x35')][_0xec7e('0x1e')]);}_0x32fba0[_0xec7e('0x3c')]=qs[_0xec7e('0x3d')](_0x3ba5a9['query'][_0xec7e('0x3d')]);_0x32fba0[_0xec7e('0x3e')]=qs['filters'](_[_0xec7e('0x3f')](_0x3ba5a9[_0xec7e('0x35')],_0x156613[_0xec7e('0x34')]),_0x5e765b);if(_0x3ba5a9[_0xec7e('0x35')][_0xec7e('0x40')]){_0x32fba0[_0xec7e('0x3e')]=_[_0xec7e('0x41')](_0x32fba0[_0xec7e('0x3e')],{'$or':_['map'](_0x5e765b,function(_0x4ed96c){if(_0x4ed96c[_0xec7e('0x30')]!==_0xec7e('0x42')){var _0x4a9e00={};_0x4a9e00[_0x4ed96c[_0xec7e('0x2a')]]={'$like':'%'+_0x3ba5a9[_0xec7e('0x35')][_0xec7e('0x40')]+'%'};return _0x4a9e00;}})});}_0x32fba0=_[_0xec7e('0x41')]({},_0x32fba0,_0x3ba5a9[_0xec7e('0x43')]);var _0x5146c6={'where':_0x32fba0[_0xec7e('0x3e')]};return db[_0xec7e('0x2d')]['count'](_0x5146c6)[_0xec7e('0x27')](function(_0x1b9d64){_0x391947[_0xec7e('0x20')]=_0x1b9d64;if(_0x3ba5a9[_0xec7e('0x35')][_0xec7e('0x44')]){_0x32fba0[_0xec7e('0x45')]=[{'all':!![]}];}return db[_0xec7e('0x2d')]['findAll'](_0x32fba0);})['then'](function(_0x342396){_0x391947[_0xec7e('0x46')]=_0x342396;return _0x391947;})['then'](respondWithFilteredResult(_0x5bb945,_0x32fba0))['catch'](handleError(_0x5bb945,null));};exports[_0xec7e('0x47')]=function(_0x4751ed,_0x16e540){var _0x558104={'raw':![],'where':{'id':_0x4751ed[_0xec7e('0x48')]['id']}},_0x34b3cc={};_0x34b3cc[_0xec7e('0x31')]=_[_0xec7e('0x33')](db[_0xec7e('0x2d')]['rawAttributes']);_0x34b3cc[_0xec7e('0x35')]=_[_0xec7e('0x33')](_0x4751ed['query']);_0x34b3cc['filters']=_['intersection'](_0x34b3cc[_0xec7e('0x31')],_0x34b3cc[_0xec7e('0x35')]);_0x558104[_0xec7e('0x36')]=_[_0xec7e('0x49')](_0x34b3cc[_0xec7e('0x31')],qs['fields'](_0x4751ed[_0xec7e('0x35')][_0xec7e('0x37')]));_0x558104[_0xec7e('0x36')]=_0x558104[_0xec7e('0x36')][_0xec7e('0x38')]?_0x558104[_0xec7e('0x36')]:_0x34b3cc[_0xec7e('0x31')];if(_0x4751ed[_0xec7e('0x35')][_0xec7e('0x44')]){_0x558104[_0xec7e('0x45')]=[{'all':!![]}];}_0x558104=_[_0xec7e('0x41')]({},_0x558104,_0x4751ed[_0xec7e('0x43')]);return db[_0xec7e('0x2d')][_0xec7e('0x4a')](_0x558104)[_0xec7e('0x27')](handleEntityNotFound(_0x16e540,null))['then'](respondWithResult(_0x16e540,null))[_0xec7e('0x4b')](handleError(_0x16e540,null));};exports[_0xec7e('0x4c')]=function(_0x657a93,_0x225628){return db[_0xec7e('0x2d')][_0xec7e('0x4c')](_0x657a93[_0xec7e('0x4d')],{})[_0xec7e('0x27')](respondWithResult(_0x225628,0xc9))['catch'](handleError(_0x225628,null));};exports['update']=function(_0xc1c232,_0x6494c){if(_0xc1c232[_0xec7e('0x4d')]['id']){delete _0xc1c232[_0xec7e('0x4d')]['id'];}return db[_0xec7e('0x2d')][_0xec7e('0x4a')]({'where':{'id':_0xc1c232['params']['id']}})['then'](handleEntityNotFound(_0x6494c,null))[_0xec7e('0x27')](saveUpdates(_0xc1c232[_0xec7e('0x4d')],null))[_0xec7e('0x27')](respondWithResult(_0x6494c,null))[_0xec7e('0x4b')](handleError(_0x6494c,null));};exports[_0xec7e('0x4e')]=function(_0x55d4fe,_0x122eb3){return db[_0xec7e('0x2d')][_0xec7e('0x4a')]({'where':{'id':_0x55d4fe['params']['id']}})[_0xec7e('0x27')](handleEntityNotFound(_0x122eb3,null))[_0xec7e('0x27')](removeEntity(_0x122eb3,null))[_0xec7e('0x4b')](handleError(_0x122eb3,null));};exports[_0xec7e('0x4f')]=function(_0x200924,_0x402b7a,_0x265e7b){var _0xd7d03d={};var _0x2d792d={};var _0x237f19;var _0x3c50a0;return db['ZohoConfiguration'][_0xec7e('0x50')]({'where':{'id':_0x200924[_0xec7e('0x48')]['id']}})[_0xec7e('0x27')](handleEntityNotFound(_0x402b7a,null))['then'](function(_0xcd2ba7){if(_0xcd2ba7){_0x237f19=_0xcd2ba7;_0x2d792d[_0xec7e('0x31')]=_[_0xec7e('0x33')](db[_0xec7e('0x51')]['rawAttributes']);_0x2d792d['query']=_[_0xec7e('0x33')](_0x200924[_0xec7e('0x35')]);_0x2d792d['filters']=_[_0xec7e('0x49')](_0x2d792d['model'],_0x2d792d['query']);_0xd7d03d['attributes']=_[_0xec7e('0x49')](_0x2d792d[_0xec7e('0x31')],qs['fields'](_0x200924[_0xec7e('0x35')][_0xec7e('0x37')]));_0xd7d03d[_0xec7e('0x36')]=_0xd7d03d['attributes'][_0xec7e('0x38')]?_0xd7d03d['attributes']:_0x2d792d[_0xec7e('0x31')];_0xd7d03d[_0xec7e('0x3c')]=qs[_0xec7e('0x3d')](_0x200924[_0xec7e('0x35')]['sort']);_0xd7d03d['where']=qs[_0xec7e('0x34')](_[_0xec7e('0x3f')](_0x200924[_0xec7e('0x35')],_0x2d792d['filters']));if(_0x200924['query'][_0xec7e('0x40')]){_0xd7d03d[_0xec7e('0x3e')]=_[_0xec7e('0x41')](_0xd7d03d[_0xec7e('0x3e')],{'$or':_['map'](_0xd7d03d[_0xec7e('0x36')],function(_0x35eb1e){var _0x58775d={};_0x58775d[_0x35eb1e]={'$like':'%'+_0x200924[_0xec7e('0x35')][_0xec7e('0x40')]+'%'};return _0x58775d;})});}_0xd7d03d=_['merge']({},_0xd7d03d,_0x200924['options']);return _0x237f19[_0xec7e('0x4f')](_0xd7d03d);}})[_0xec7e('0x27')](function(_0x200f4d){if(_0x200f4d){_0x3c50a0=_0x200f4d[_0xec7e('0x38')];if(!_0x200924[_0xec7e('0x35')][_0xec7e('0x39')](_0xec7e('0x3a'))){_0xd7d03d['limit']=qs[_0xec7e('0x3b')](_0x200924['query'][_0xec7e('0x3b')]);_0xd7d03d[_0xec7e('0x1e')]=qs['offset'](_0x200924[_0xec7e('0x35')][_0xec7e('0x1e')]);}return _0x237f19[_0xec7e('0x4f')](_0xd7d03d);}})[_0xec7e('0x27')](function(_0x24d1d6){if(_0x24d1d6){return _0x24d1d6?{'count':_0x3c50a0,'rows':_0x24d1d6}:null;}})[_0xec7e('0x27')](respondWithResult(_0x402b7a,null))['catch'](handleError(_0x402b7a,null));};exports[_0xec7e('0x52')]=function(_0x55c15d,_0x41ba5c,_0x5760d2){var _0x479947={};var _0x1ab786={};var _0x159799;var _0x503779;return db[_0xec7e('0x2d')][_0xec7e('0x50')]({'where':{'id':_0x55c15d['params']['id']}})[_0xec7e('0x27')](handleEntityNotFound(_0x41ba5c,null))[_0xec7e('0x27')](function(_0x4d96b1){if(_0x4d96b1){_0x159799=_0x4d96b1;_0x1ab786['model']=_['keys'](db[_0xec7e('0x51')]['rawAttributes']);_0x1ab786[_0xec7e('0x35')]=_[_0xec7e('0x33')](_0x55c15d[_0xec7e('0x35')]);_0x1ab786[_0xec7e('0x34')]=_[_0xec7e('0x49')](_0x1ab786[_0xec7e('0x31')],_0x1ab786[_0xec7e('0x35')]);_0x479947['attributes']=_['intersection'](_0x1ab786[_0xec7e('0x31')],qs[_0xec7e('0x37')](_0x55c15d['query'][_0xec7e('0x37')]));_0x479947[_0xec7e('0x36')]=_0x479947[_0xec7e('0x36')][_0xec7e('0x38')]?_0x479947[_0xec7e('0x36')]:_0x1ab786[_0xec7e('0x31')];_0x479947[_0xec7e('0x3c')]=qs['sort'](_0x55c15d['query']['sort']);_0x479947[_0xec7e('0x3e')]=qs['filters'](_[_0xec7e('0x3f')](_0x55c15d[_0xec7e('0x35')],_0x1ab786[_0xec7e('0x34')]));if(_0x55c15d[_0xec7e('0x35')][_0xec7e('0x40')]){_0x479947[_0xec7e('0x3e')]=_[_0xec7e('0x41')](_0x479947[_0xec7e('0x3e')],{'$or':_[_0xec7e('0x32')](_0x479947[_0xec7e('0x36')],function(_0x148ea){var _0x50ee68={};_0x50ee68[_0x148ea]={'$like':'%'+_0x55c15d[_0xec7e('0x35')][_0xec7e('0x40')]+'%'};return _0x50ee68;})});}_0x479947=_[_0xec7e('0x41')]({},_0x479947,_0x55c15d[_0xec7e('0x43')]);return _0x159799[_0xec7e('0x52')](_0x479947);}})[_0xec7e('0x27')](function(_0x5a65ab){if(_0x5a65ab){_0x503779=_0x5a65ab[_0xec7e('0x38')];if(!_0x55c15d['query'][_0xec7e('0x39')]('nolimit')){_0x479947[_0xec7e('0x3b')]=qs['limit'](_0x55c15d[_0xec7e('0x35')]['limit']);_0x479947[_0xec7e('0x1e')]=qs[_0xec7e('0x1e')](_0x55c15d[_0xec7e('0x35')][_0xec7e('0x1e')]);}return _0x159799[_0xec7e('0x52')](_0x479947);}})['then'](function(_0x4dd253){if(_0x4dd253){return _0x4dd253?{'count':_0x503779,'rows':_0x4dd253}:null;}})[_0xec7e('0x27')](respondWithResult(_0x41ba5c,null))[_0xec7e('0x4b')](handleError(_0x41ba5c,null));};exports[_0xec7e('0x53')]=function(_0x801373,_0x1d9467,_0xb1c694){var _0x19f4fc={};var _0x8ab152={};var _0x59c767;var _0x1a3065;return db[_0xec7e('0x2d')][_0xec7e('0x50')]({'where':{'id':_0x801373[_0xec7e('0x48')]['id']}})[_0xec7e('0x27')](handleEntityNotFound(_0x1d9467,null))[_0xec7e('0x27')](function(_0x1af4dc){if(_0x1af4dc){_0x59c767=_0x1af4dc;_0x8ab152[_0xec7e('0x31')]=_['keys'](db[_0xec7e('0x51')]['rawAttributes']);_0x8ab152['query']=_[_0xec7e('0x33')](_0x801373[_0xec7e('0x35')]);_0x8ab152[_0xec7e('0x34')]=_[_0xec7e('0x49')](_0x8ab152[_0xec7e('0x31')],_0x8ab152['query']);_0x19f4fc['attributes']=_[_0xec7e('0x49')](_0x8ab152[_0xec7e('0x31')],qs['fields'](_0x801373[_0xec7e('0x35')][_0xec7e('0x37')]));_0x19f4fc[_0xec7e('0x36')]=_0x19f4fc[_0xec7e('0x36')][_0xec7e('0x38')]?_0x19f4fc[_0xec7e('0x36')]:_0x8ab152[_0xec7e('0x31')];_0x19f4fc[_0xec7e('0x3c')]=qs['sort'](_0x801373[_0xec7e('0x35')][_0xec7e('0x3d')]);_0x19f4fc[_0xec7e('0x3e')]=qs[_0xec7e('0x34')](_[_0xec7e('0x3f')](_0x801373[_0xec7e('0x35')],_0x8ab152[_0xec7e('0x34')]));if(_0x801373[_0xec7e('0x35')]['filter']){_0x19f4fc['where']=_['merge'](_0x19f4fc[_0xec7e('0x3e')],{'$or':_['map'](_0x19f4fc['attributes'],function(_0x4ec6ed){var _0x555a76={};_0x555a76[_0x4ec6ed]={'$like':'%'+_0x801373['query'][_0xec7e('0x40')]+'%'};return _0x555a76;})});}_0x19f4fc=_['merge']({},_0x19f4fc,_0x801373['options']);return _0x59c767[_0xec7e('0x53')](_0x19f4fc);}})[_0xec7e('0x27')](function(_0xf1867){if(_0xf1867){_0x1a3065=_0xf1867['length'];if(!_0x801373['query'][_0xec7e('0x39')](_0xec7e('0x3a'))){_0x19f4fc['limit']=qs[_0xec7e('0x3b')](_0x801373[_0xec7e('0x35')][_0xec7e('0x3b')]);_0x19f4fc[_0xec7e('0x1e')]=qs[_0xec7e('0x1e')](_0x801373['query'][_0xec7e('0x1e')]);}return _0x59c767['getDescriptions'](_0x19f4fc);}})['then'](function(_0x2b864d){if(_0x2b864d){return _0x2b864d?{'count':_0x1a3065,'rows':_0x2b864d}:null;}})['then'](respondWithResult(_0x1d9467,null))[_0xec7e('0x4b')](handleError(_0x1d9467,null));}; \ No newline at end of file +var _0xae02=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','ZohoConfiguration','count','include','rows','catch','params','create','body','find','findOne','ZohoField','rawAttributes','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xae02,0x88));var _0x2ae0=function(_0x40c9ac,_0xd847c6){_0x40c9ac=_0x40c9ac-0x0;var _0x2fec0a=_0xae02[_0x40c9ac];return _0x2fec0a;};'use strict';var emlformat=require(_0x2ae0('0x0'));var rimraf=require(_0x2ae0('0x1'));var zipdir=require(_0x2ae0('0x2'));var jsonpatch=require(_0x2ae0('0x3'));var rp=require('request-promise');var moment=require(_0x2ae0('0x4'));var BPromise=require(_0x2ae0('0x5'));var Mustache=require(_0x2ae0('0x6'));var util=require(_0x2ae0('0x7'));var path=require(_0x2ae0('0x8'));var sox=require('sox');var csv=require(_0x2ae0('0x9'));var ejs=require(_0x2ae0('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2ae0('0xb'));var crypto=require('crypto');var jsforce=require(_0x2ae0('0xc'));var deskjs=require(_0x2ae0('0xd'));var toCsv=require(_0x2ae0('0x9'));var querystring=require(_0x2ae0('0xe'));var Papa=require(_0x2ae0('0xf'));var Redis=require(_0x2ae0('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2ae0('0x11'));var as=require(_0x2ae0('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2ae0('0x13'))(_0x2ae0('0x14'));var utils=require(_0x2ae0('0x15'));var config=require(_0x2ae0('0x16'));var licenseUtil=require(_0x2ae0('0x17'));var db=require(_0x2ae0('0x18'))['db'];function respondWithStatusCode(_0x31d707,_0x2bfb62){_0x2bfb62=_0x2bfb62||0xcc;return function(_0x3ebdf8){if(_0x3ebdf8){return _0x31d707[_0x2ae0('0x19')](_0x2bfb62);}return _0x31d707[_0x2ae0('0x1a')](_0x2bfb62)['end']();};}function respondWithResult(_0x17b270,_0x516bd3){_0x516bd3=_0x516bd3||0xc8;return function(_0x16217f){if(_0x16217f){return _0x17b270[_0x2ae0('0x1a')](_0x516bd3)[_0x2ae0('0x1b')](_0x16217f);}};}function respondWithFilteredResult(_0xfeb6e0,_0x409520){return function(_0x5ef796){if(_0x5ef796){var _0x1b5524=typeof _0x409520['offset']===_0x2ae0('0x1c')&&typeof _0x409520[_0x2ae0('0x1d')]===_0x2ae0('0x1c');var _0x81a37f=_0x5ef796['count'];var _0x2632a3=_0x1b5524?0x0:_0x409520[_0x2ae0('0x1e')];var _0x21093a=_0x1b5524?_0x5ef796['count']:_0x409520[_0x2ae0('0x1e')]+_0x409520[_0x2ae0('0x1d')];var _0x3efaff;if(_0x21093a>=_0x81a37f){_0x21093a=_0x81a37f;_0x3efaff=0xc8;}else{_0x3efaff=0xce;}_0xfeb6e0[_0x2ae0('0x1a')](_0x3efaff);return _0xfeb6e0['set']('Content-Range',_0x2632a3+'-'+_0x21093a+'/'+_0x81a37f)['json'](_0x5ef796);}return null;};}function patchUpdates(_0x48f04a){return function(_0x16cc6c){try{jsonpatch[_0x2ae0('0x1f')](_0x16cc6c,_0x48f04a,!![]);}catch(_0x28224f){return BPromise[_0x2ae0('0x20')](_0x28224f);}return _0x16cc6c[_0x2ae0('0x21')]();};}function saveUpdates(_0x1d2208,_0x1bbea7){return function(_0x1ee2cc){if(_0x1ee2cc){return _0x1ee2cc[_0x2ae0('0x22')](_0x1d2208)[_0x2ae0('0x23')](function(_0x53423b){return _0x53423b;});}return null;};}function removeEntity(_0x3abe44,_0x4ff7ec){return function(_0x1e9b39){if(_0x1e9b39){return _0x1e9b39[_0x2ae0('0x24')]()[_0x2ae0('0x23')](function(){_0x3abe44[_0x2ae0('0x1a')](0xcc)[_0x2ae0('0x25')]();});}};}function handleEntityNotFound(_0x2c91d0,_0x402c8b){return function(_0x1a9e54){if(!_0x1a9e54){_0x2c91d0[_0x2ae0('0x19')](0x194);}return _0x1a9e54;};}function handleError(_0x51b3ed,_0x2fcdd7){_0x2fcdd7=_0x2fcdd7||0x1f4;return function(_0x1e7fa3){logger[_0x2ae0('0x26')](_0x1e7fa3[_0x2ae0('0x27')]);if(_0x1e7fa3[_0x2ae0('0x28')]){delete _0x1e7fa3['name'];}_0x51b3ed['status'](_0x2fcdd7)['send'](_0x1e7fa3);};}exports[_0x2ae0('0x29')]=function(_0x5b5c67,_0x40764d){var _0x41ca8b={},_0x1991c9={},_0x44cc2b={'count':0x0,'rows':[]};var _0x2f1287=_[_0x2ae0('0x2a')](db['ZohoConfiguration']['rawAttributes'],function(_0x46655c){return{'name':_0x46655c['fieldName'],'type':_0x46655c[_0x2ae0('0x2b')][_0x2ae0('0x2c')]};});_0x1991c9[_0x2ae0('0x2d')]=_[_0x2ae0('0x2a')](_0x2f1287,'name');_0x1991c9[_0x2ae0('0x2e')]=_[_0x2ae0('0x2f')](_0x5b5c67[_0x2ae0('0x2e')]);_0x1991c9[_0x2ae0('0x30')]=_[_0x2ae0('0x31')](_0x1991c9[_0x2ae0('0x2d')],_0x1991c9[_0x2ae0('0x2e')]);_0x41ca8b[_0x2ae0('0x32')]=_[_0x2ae0('0x31')](_0x1991c9[_0x2ae0('0x2d')],qs[_0x2ae0('0x33')](_0x5b5c67[_0x2ae0('0x2e')][_0x2ae0('0x33')]));_0x41ca8b[_0x2ae0('0x32')]=_0x41ca8b['attributes'][_0x2ae0('0x34')]?_0x41ca8b[_0x2ae0('0x32')]:_0x1991c9['model'];if(!_0x5b5c67[_0x2ae0('0x2e')][_0x2ae0('0x35')](_0x2ae0('0x36'))){_0x41ca8b[_0x2ae0('0x1d')]=qs[_0x2ae0('0x1d')](_0x5b5c67['query'][_0x2ae0('0x1d')]);_0x41ca8b[_0x2ae0('0x1e')]=qs[_0x2ae0('0x1e')](_0x5b5c67[_0x2ae0('0x2e')][_0x2ae0('0x1e')]);}_0x41ca8b[_0x2ae0('0x37')]=qs[_0x2ae0('0x38')](_0x5b5c67[_0x2ae0('0x2e')][_0x2ae0('0x38')]);_0x41ca8b[_0x2ae0('0x39')]=qs[_0x2ae0('0x30')](_[_0x2ae0('0x3a')](_0x5b5c67[_0x2ae0('0x2e')],_0x1991c9[_0x2ae0('0x30')]),_0x2f1287);if(_0x5b5c67[_0x2ae0('0x2e')][_0x2ae0('0x3b')]){_0x41ca8b[_0x2ae0('0x39')]=_[_0x2ae0('0x3c')](_0x41ca8b[_0x2ae0('0x39')],{'$or':_[_0x2ae0('0x2a')](_0x2f1287,function(_0x1b1b39){if(_0x1b1b39['type']!=='VIRTUAL'){var _0x109a75={};_0x109a75[_0x1b1b39[_0x2ae0('0x28')]]={'$like':'%'+_0x5b5c67['query']['filter']+'%'};return _0x109a75;}})});}_0x41ca8b=_[_0x2ae0('0x3c')]({},_0x41ca8b,_0x5b5c67[_0x2ae0('0x3d')]);var _0x2a0ecf={'where':_0x41ca8b[_0x2ae0('0x39')]};return db[_0x2ae0('0x3e')]['count'](_0x2a0ecf)[_0x2ae0('0x23')](function(_0x3274ba){_0x44cc2b[_0x2ae0('0x3f')]=_0x3274ba;if(_0x5b5c67[_0x2ae0('0x2e')]['includeAll']){_0x41ca8b[_0x2ae0('0x40')]=[{'all':!![]}];}return db[_0x2ae0('0x3e')]['findAll'](_0x41ca8b);})[_0x2ae0('0x23')](function(_0x29c1b1){_0x44cc2b[_0x2ae0('0x41')]=_0x29c1b1;return _0x44cc2b;})[_0x2ae0('0x23')](respondWithFilteredResult(_0x40764d,_0x41ca8b))[_0x2ae0('0x42')](handleError(_0x40764d,null));};exports['show']=function(_0x2efa3f,_0x43a26d){var _0x4920f0={'raw':![],'where':{'id':_0x2efa3f[_0x2ae0('0x43')]['id']}},_0xad775a={};_0xad775a['model']=_[_0x2ae0('0x2f')](db[_0x2ae0('0x3e')]['rawAttributes']);_0xad775a[_0x2ae0('0x2e')]=_['keys'](_0x2efa3f[_0x2ae0('0x2e')]);_0xad775a[_0x2ae0('0x30')]=_['intersection'](_0xad775a[_0x2ae0('0x2d')],_0xad775a['query']);_0x4920f0[_0x2ae0('0x32')]=_[_0x2ae0('0x31')](_0xad775a[_0x2ae0('0x2d')],qs[_0x2ae0('0x33')](_0x2efa3f[_0x2ae0('0x2e')][_0x2ae0('0x33')]));_0x4920f0['attributes']=_0x4920f0[_0x2ae0('0x32')][_0x2ae0('0x34')]?_0x4920f0[_0x2ae0('0x32')]:_0xad775a[_0x2ae0('0x2d')];if(_0x2efa3f[_0x2ae0('0x2e')]['includeAll']){_0x4920f0[_0x2ae0('0x40')]=[{'all':!![]}];}_0x4920f0=_[_0x2ae0('0x3c')]({},_0x4920f0,_0x2efa3f[_0x2ae0('0x3d')]);return db[_0x2ae0('0x3e')]['find'](_0x4920f0)[_0x2ae0('0x23')](handleEntityNotFound(_0x43a26d,null))[_0x2ae0('0x23')](respondWithResult(_0x43a26d,null))[_0x2ae0('0x42')](handleError(_0x43a26d,null));};exports[_0x2ae0('0x44')]=function(_0x3c49e3,_0x3f0f9d){return db[_0x2ae0('0x3e')]['create'](_0x3c49e3[_0x2ae0('0x45')],{})[_0x2ae0('0x23')](respondWithResult(_0x3f0f9d,0xc9))[_0x2ae0('0x42')](handleError(_0x3f0f9d,null));};exports['update']=function(_0x50093e,_0x183e17){if(_0x50093e['body']['id']){delete _0x50093e['body']['id'];}return db['ZohoConfiguration'][_0x2ae0('0x46')]({'where':{'id':_0x50093e[_0x2ae0('0x43')]['id']}})['then'](handleEntityNotFound(_0x183e17,null))[_0x2ae0('0x23')](saveUpdates(_0x50093e[_0x2ae0('0x45')],null))[_0x2ae0('0x23')](respondWithResult(_0x183e17,null))[_0x2ae0('0x42')](handleError(_0x183e17,null));};exports['destroy']=function(_0xdd360b,_0x5aa51d){return db['ZohoConfiguration'][_0x2ae0('0x46')]({'where':{'id':_0xdd360b[_0x2ae0('0x43')]['id']}})[_0x2ae0('0x23')](handleEntityNotFound(_0x5aa51d,null))['then'](removeEntity(_0x5aa51d,null))[_0x2ae0('0x42')](handleError(_0x5aa51d,null));};exports['getFields']=function(_0xec851b,_0x2e1622,_0x5869a4){var _0x4e032a={};var _0x455076={};var _0x2adc3e;var _0x5bff03;return db[_0x2ae0('0x3e')][_0x2ae0('0x47')]({'where':{'id':_0xec851b[_0x2ae0('0x43')]['id']}})[_0x2ae0('0x23')](handleEntityNotFound(_0x2e1622,null))['then'](function(_0x4e2f4a){if(_0x4e2f4a){_0x2adc3e=_0x4e2f4a;_0x455076[_0x2ae0('0x2d')]=_['keys'](db[_0x2ae0('0x48')][_0x2ae0('0x49')]);_0x455076[_0x2ae0('0x2e')]=_[_0x2ae0('0x2f')](_0xec851b[_0x2ae0('0x2e')]);_0x455076['filters']=_['intersection'](_0x455076[_0x2ae0('0x2d')],_0x455076[_0x2ae0('0x2e')]);_0x4e032a['attributes']=_['intersection'](_0x455076[_0x2ae0('0x2d')],qs['fields'](_0xec851b[_0x2ae0('0x2e')][_0x2ae0('0x33')]));_0x4e032a[_0x2ae0('0x32')]=_0x4e032a[_0x2ae0('0x32')]['length']?_0x4e032a[_0x2ae0('0x32')]:_0x455076[_0x2ae0('0x2d')];_0x4e032a['order']=qs[_0x2ae0('0x38')](_0xec851b['query'][_0x2ae0('0x38')]);_0x4e032a[_0x2ae0('0x39')]=qs['filters'](_[_0x2ae0('0x3a')](_0xec851b[_0x2ae0('0x2e')],_0x455076[_0x2ae0('0x30')]));if(_0xec851b[_0x2ae0('0x2e')]['filter']){_0x4e032a[_0x2ae0('0x39')]=_[_0x2ae0('0x3c')](_0x4e032a[_0x2ae0('0x39')],{'$or':_['map'](_0x4e032a[_0x2ae0('0x32')],function(_0x1babb8){var _0x1b8502={};_0x1b8502[_0x1babb8]={'$like':'%'+_0xec851b['query']['filter']+'%'};return _0x1b8502;})});}_0x4e032a=_[_0x2ae0('0x3c')]({},_0x4e032a,_0xec851b[_0x2ae0('0x3d')]);return _0x2adc3e[_0x2ae0('0x4a')](_0x4e032a);}})[_0x2ae0('0x23')](function(_0x337745){if(_0x337745){_0x5bff03=_0x337745[_0x2ae0('0x34')];if(!_0xec851b[_0x2ae0('0x2e')][_0x2ae0('0x35')](_0x2ae0('0x36'))){_0x4e032a[_0x2ae0('0x1d')]=qs['limit'](_0xec851b[_0x2ae0('0x2e')][_0x2ae0('0x1d')]);_0x4e032a[_0x2ae0('0x1e')]=qs['offset'](_0xec851b[_0x2ae0('0x2e')][_0x2ae0('0x1e')]);}return _0x2adc3e[_0x2ae0('0x4a')](_0x4e032a);}})[_0x2ae0('0x23')](function(_0x46d9e6){if(_0x46d9e6){return _0x46d9e6?{'count':_0x5bff03,'rows':_0x46d9e6}:null;}})[_0x2ae0('0x23')](respondWithResult(_0x2e1622,null))[_0x2ae0('0x42')](handleError(_0x2e1622,null));};exports[_0x2ae0('0x4b')]=function(_0x3d5861,_0x15cc8b,_0x101f44){var _0x570e6f={};var _0x2000ce={};var _0x43fedd;var _0xecd709;return db[_0x2ae0('0x3e')][_0x2ae0('0x47')]({'where':{'id':_0x3d5861[_0x2ae0('0x43')]['id']}})[_0x2ae0('0x23')](handleEntityNotFound(_0x15cc8b,null))[_0x2ae0('0x23')](function(_0x188cbe){if(_0x188cbe){_0x43fedd=_0x188cbe;_0x2000ce[_0x2ae0('0x2d')]=_[_0x2ae0('0x2f')](db['ZohoField'][_0x2ae0('0x49')]);_0x2000ce[_0x2ae0('0x2e')]=_[_0x2ae0('0x2f')](_0x3d5861[_0x2ae0('0x2e')]);_0x2000ce['filters']=_[_0x2ae0('0x31')](_0x2000ce[_0x2ae0('0x2d')],_0x2000ce[_0x2ae0('0x2e')]);_0x570e6f[_0x2ae0('0x32')]=_[_0x2ae0('0x31')](_0x2000ce[_0x2ae0('0x2d')],qs[_0x2ae0('0x33')](_0x3d5861[_0x2ae0('0x2e')][_0x2ae0('0x33')]));_0x570e6f[_0x2ae0('0x32')]=_0x570e6f[_0x2ae0('0x32')][_0x2ae0('0x34')]?_0x570e6f[_0x2ae0('0x32')]:_0x2000ce[_0x2ae0('0x2d')];_0x570e6f['order']=qs[_0x2ae0('0x38')](_0x3d5861[_0x2ae0('0x2e')]['sort']);_0x570e6f[_0x2ae0('0x39')]=qs[_0x2ae0('0x30')](_[_0x2ae0('0x3a')](_0x3d5861[_0x2ae0('0x2e')],_0x2000ce[_0x2ae0('0x30')]));if(_0x3d5861[_0x2ae0('0x2e')][_0x2ae0('0x3b')]){_0x570e6f['where']=_[_0x2ae0('0x3c')](_0x570e6f[_0x2ae0('0x39')],{'$or':_[_0x2ae0('0x2a')](_0x570e6f['attributes'],function(_0xcfac86){var _0x26c2e3={};_0x26c2e3[_0xcfac86]={'$like':'%'+_0x3d5861[_0x2ae0('0x2e')][_0x2ae0('0x3b')]+'%'};return _0x26c2e3;})});}_0x570e6f=_[_0x2ae0('0x3c')]({},_0x570e6f,_0x3d5861['options']);return _0x43fedd[_0x2ae0('0x4b')](_0x570e6f);}})[_0x2ae0('0x23')](function(_0x245957){if(_0x245957){_0xecd709=_0x245957[_0x2ae0('0x34')];if(!_0x3d5861[_0x2ae0('0x2e')][_0x2ae0('0x35')](_0x2ae0('0x36'))){_0x570e6f[_0x2ae0('0x1d')]=qs[_0x2ae0('0x1d')](_0x3d5861['query'][_0x2ae0('0x1d')]);_0x570e6f[_0x2ae0('0x1e')]=qs[_0x2ae0('0x1e')](_0x3d5861[_0x2ae0('0x2e')][_0x2ae0('0x1e')]);}return _0x43fedd['getSubjects'](_0x570e6f);}})[_0x2ae0('0x23')](function(_0x452d33){if(_0x452d33){return _0x452d33?{'count':_0xecd709,'rows':_0x452d33}:null;}})[_0x2ae0('0x23')](respondWithResult(_0x15cc8b,null))['catch'](handleError(_0x15cc8b,null));};exports[_0x2ae0('0x4c')]=function(_0x34c2a9,_0x139ee5,_0x228eec){var _0x501e01={};var _0x1dff5={};var _0x8754aa;var _0xd6726c;return db['ZohoConfiguration'][_0x2ae0('0x47')]({'where':{'id':_0x34c2a9[_0x2ae0('0x43')]['id']}})[_0x2ae0('0x23')](handleEntityNotFound(_0x139ee5,null))[_0x2ae0('0x23')](function(_0x1d14cc){if(_0x1d14cc){_0x8754aa=_0x1d14cc;_0x1dff5[_0x2ae0('0x2d')]=_['keys'](db[_0x2ae0('0x48')][_0x2ae0('0x49')]);_0x1dff5[_0x2ae0('0x2e')]=_['keys'](_0x34c2a9['query']);_0x1dff5[_0x2ae0('0x30')]=_['intersection'](_0x1dff5['model'],_0x1dff5[_0x2ae0('0x2e')]);_0x501e01[_0x2ae0('0x32')]=_['intersection'](_0x1dff5[_0x2ae0('0x2d')],qs['fields'](_0x34c2a9[_0x2ae0('0x2e')][_0x2ae0('0x33')]));_0x501e01['attributes']=_0x501e01[_0x2ae0('0x32')][_0x2ae0('0x34')]?_0x501e01[_0x2ae0('0x32')]:_0x1dff5['model'];_0x501e01[_0x2ae0('0x37')]=qs[_0x2ae0('0x38')](_0x34c2a9[_0x2ae0('0x2e')][_0x2ae0('0x38')]);_0x501e01[_0x2ae0('0x39')]=qs[_0x2ae0('0x30')](_[_0x2ae0('0x3a')](_0x34c2a9['query'],_0x1dff5[_0x2ae0('0x30')]));if(_0x34c2a9[_0x2ae0('0x2e')][_0x2ae0('0x3b')]){_0x501e01[_0x2ae0('0x39')]=_[_0x2ae0('0x3c')](_0x501e01[_0x2ae0('0x39')],{'$or':_['map'](_0x501e01[_0x2ae0('0x32')],function(_0x3e295e){var _0x4410f0={};_0x4410f0[_0x3e295e]={'$like':'%'+_0x34c2a9[_0x2ae0('0x2e')][_0x2ae0('0x3b')]+'%'};return _0x4410f0;})});}_0x501e01=_[_0x2ae0('0x3c')]({},_0x501e01,_0x34c2a9[_0x2ae0('0x3d')]);return _0x8754aa[_0x2ae0('0x4c')](_0x501e01);}})['then'](function(_0x274c78){if(_0x274c78){_0xd6726c=_0x274c78['length'];if(!_0x34c2a9[_0x2ae0('0x2e')][_0x2ae0('0x35')](_0x2ae0('0x36'))){_0x501e01[_0x2ae0('0x1d')]=qs[_0x2ae0('0x1d')](_0x34c2a9[_0x2ae0('0x2e')]['limit']);_0x501e01[_0x2ae0('0x1e')]=qs[_0x2ae0('0x1e')](_0x34c2a9[_0x2ae0('0x2e')][_0x2ae0('0x1e')]);}return _0x8754aa[_0x2ae0('0x4c')](_0x501e01);}})[_0x2ae0('0x23')](function(_0x2b41db){if(_0x2b41db){return _0x2b41db?{'count':_0xd6726c,'rows':_0x2b41db}:null;}})['then'](respondWithResult(_0x139ee5,null))[_0x2ae0('0x42')](handleError(_0x139ee5,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 00299ee..f543d85 100644 --- a/server/api/intZohoConfiguration/intZohoConfiguration.model.js +++ b/server/api/intZohoConfiguration/intZohoConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x407e=['../../config/logger','api','bluebird','request-promise','rimraf','./intZohoConfiguration.attributes','exports','ZohoConfiguration','int_zoho_configurations','lodash','util'];(function(_0x260819,_0x24cacd){var _0x564d85=function(_0x4bb716){while(--_0x4bb716){_0x260819['push'](_0x260819['shift']());}};_0x564d85(++_0x24cacd);}(_0x407e,0x1e2));var _0xe407=function(_0x5dbb84,_0x1bbce9){_0x5dbb84=_0x5dbb84-0x0;var _0x1d6eae=_0x407e[_0x5dbb84];return _0x1d6eae;};'use strict';var _=require(_0xe407('0x0'));var util=require(_0xe407('0x1'));var logger=require(_0xe407('0x2'))(_0xe407('0x3'));var moment=require('moment');var BPromise=require(_0xe407('0x4'));var rp=require(_0xe407('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe407('0x6'));var config=require('../../config/environment');var attributes=require(_0xe407('0x7'));module[_0xe407('0x8')]=function(_0x6b7d8,_0xd2c393){return _0x6b7d8['define'](_0xe407('0x9'),attributes,{'tableName':_0xe407('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9a68=['rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x9a68,0x1d5));var _0x89a6=function(_0x46bd57,_0x311f8c){_0x46bd57=_0x46bd57-0x0;var _0x330ea2=_0x9a68[_0x46bd57];return _0x330ea2;};'use strict';var _=require(_0x89a6('0x0'));var util=require(_0x89a6('0x1'));var logger=require(_0x89a6('0x2'))(_0x89a6('0x3'));var moment=require(_0x89a6('0x4'));var BPromise=require(_0x89a6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x89a6('0x6'));var rimraf=require(_0x89a6('0x7'));var config=require(_0x89a6('0x8'));var attributes=require(_0x89a6('0x9'));module[_0x89a6('0xa')]=function(_0x34b473,_0x22d8b3){return _0x34b473[_0x89a6('0xb')](_0x89a6('0xc'),attributes,{'tableName':_0x89a6('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index 3066d87..6bbaea1 100644 --- a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js +++ b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcae7=['catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','result'];(function(_0x5b3405,_0x1c4b46){var _0x2d0ab8=function(_0xfdb57e){while(--_0xfdb57e){_0x5b3405['push'](_0x5b3405['shift']());}};_0x2d0ab8(++_0x1c4b46);}(_0xcae7,0x1a5));var _0x7cae=function(_0x5222d9,_0x12496d){_0x5222d9=_0x5222d9-0x0;var _0x16b0d5=_0xcae7[_0x5222d9];return _0x16b0d5;};'use strict';var _=require(_0x7cae('0x0'));var util=require('util');var moment=require(_0x7cae('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7cae('0x2'));var db=require(_0x7cae('0x3'))['db'];var utils=require(_0x7cae('0x4'));var logger=require(_0x7cae('0x5'))(_0x7cae('0x6'));var config=require(_0x7cae('0x7'));var jayson=require(_0x7cae('0x8'));var client=jayson['client'][_0x7cae('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21e18f,_0x118a29,_0x10d237){return new BPromise(function(_0x2872d6,_0x395b35){return client['request'](_0x21e18f,_0x10d237)[_0x7cae('0xa')](function(_0xe08492){logger['info'](_0x7cae('0xb'),_0x118a29,_0x7cae('0xc'));logger[_0x7cae('0xd')](_0x7cae('0xe'),_0x118a29,'request\x20sent',JSON['stringify'](_0xe08492));if(_0xe08492[_0x7cae('0xf')]){if(_0xe08492['error'][_0x7cae('0x10')]===0x1f4){logger[_0x7cae('0xf')](_0x7cae('0xb'),_0x118a29,_0xe08492[_0x7cae('0xf')][_0x7cae('0x11')]);return _0x395b35(_0xe08492['error'][_0x7cae('0x11')]);}logger['error'](_0x7cae('0xb'),_0x118a29,_0xe08492[_0x7cae('0xf')]['message']);return _0x2872d6(_0xe08492[_0x7cae('0xf')][_0x7cae('0x11')]);}else{logger[_0x7cae('0x12')](_0x7cae('0xb'),_0x118a29,_0x7cae('0xc'));_0x2872d6(_0xe08492[_0x7cae('0x13')][_0x7cae('0x11')]);}})[_0x7cae('0x14')](function(_0x3eefa3){logger[_0x7cae('0xf')](_0x7cae('0xb'),_0x118a29,_0x3eefa3);_0x395b35(_0x3eefa3);});});} \ No newline at end of file +var _0x7b1f=['request','then','info','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','ZohoConfiguration,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x138365,_0x2d7d37){var _0x443e3c=function(_0x1af697){while(--_0x1af697){_0x138365['push'](_0x138365['shift']());}};_0x443e3c(++_0x2d7d37);}(_0x7b1f,0x8f));var _0xf7b1=function(_0x5124f3,_0x4d1c84){_0x5124f3=_0x5124f3-0x0;var _0x450eba=_0x7b1f[_0x5124f3];return _0x450eba;};'use strict';var _=require(_0xf7b1('0x0'));var util=require(_0xf7b1('0x1'));var moment=require('moment');var BPromise=require(_0xf7b1('0x2'));var rs=require(_0xf7b1('0x3'));var fs=require('fs');var Redis=require(_0xf7b1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf7b1('0x5'));var logger=require('../../config/logger')(_0xf7b1('0x6'));var config=require(_0xf7b1('0x7'));var jayson=require(_0xf7b1('0x8'));var client=jayson[_0xf7b1('0x9')][_0xf7b1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x339af7,_0x2707c4,_0x32f1e5){return new BPromise(function(_0x455b0d,_0x5a4993){return client[_0xf7b1('0xb')](_0x339af7,_0x32f1e5)[_0xf7b1('0xc')](function(_0x2a6356){logger[_0xf7b1('0xd')]('ZohoConfiguration,\x20%s,\x20%s',_0x2707c4,_0xf7b1('0xe'));logger[_0xf7b1('0xf')](_0xf7b1('0x10'),_0x2707c4,_0xf7b1('0xe'),JSON[_0xf7b1('0x11')](_0x2a6356));if(_0x2a6356[_0xf7b1('0x12')]){if(_0x2a6356[_0xf7b1('0x12')]['code']===0x1f4){logger['error'](_0xf7b1('0x13'),_0x2707c4,_0x2a6356[_0xf7b1('0x12')][_0xf7b1('0x14')]);return _0x5a4993(_0x2a6356[_0xf7b1('0x12')][_0xf7b1('0x14')]);}logger['error'](_0xf7b1('0x13'),_0x2707c4,_0x2a6356['error'][_0xf7b1('0x14')]);return _0x455b0d(_0x2a6356['error']['message']);}else{logger[_0xf7b1('0xd')](_0xf7b1('0x13'),_0x2707c4,_0xf7b1('0xe'));_0x455b0d(_0x2a6356['result']['message']);}})[_0xf7b1('0x15')](function(_0x19b525){logger[_0xf7b1('0x12')](_0xf7b1('0x13'),_0x2707c4,_0x19b525);_0x5a4993(_0x19b525);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index e79d1e7..231bacb 100644 --- a/server/api/intZohoField/index.js +++ b/server/api/intZohoField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe7f4=['index','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe7f4,0x1d8));var _0x4e7f=function(_0x1bc0ae,_0x439dfe){_0x1bc0ae=_0x1bc0ae-0x0;var _0x501104=_0xe7f4[_0x1bc0ae];return _0x501104;};'use strict';var multer=require(_0x4e7f('0x0'));var util=require(_0x4e7f('0x1'));var path=require(_0x4e7f('0x2'));var timeout=require(_0x4e7f('0x3'));var express=require(_0x4e7f('0x4'));var router=express[_0x4e7f('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4e7f('0x6'));var interaction=require(_0x4e7f('0x7'));var config=require(_0x4e7f('0x8'));var controller=require(_0x4e7f('0x9'));router[_0x4e7f('0xa')]('/',auth['isAuthenticated'](),controller[_0x4e7f('0xb')]);router['get'](_0x4e7f('0xc'),auth[_0x4e7f('0xd')](),controller[_0x4e7f('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4e7f('0xf')]);router[_0x4e7f('0x10')](_0x4e7f('0xc'),auth[_0x4e7f('0xd')](),controller[_0x4e7f('0x11')]);router[_0x4e7f('0x12')](_0x4e7f('0xc'),auth[_0x4e7f('0xd')](),controller[_0x4e7f('0x13')]);module[_0x4e7f('0x14')]=router; \ No newline at end of file +var _0x61e5=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','isAuthenticated','index','get','/:id','show','create','update','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x1abab4,_0xeea45d){var _0x146c4f=function(_0x1d3c59){while(--_0x1d3c59){_0x1abab4['push'](_0x1abab4['shift']());}};_0x146c4f(++_0xeea45d);}(_0x61e5,0x19c));var _0x561e=function(_0x2c8c60,_0xb8fe7d){_0x2c8c60=_0x2c8c60-0x0;var _0x3fed58=_0x61e5[_0x2c8c60];return _0x3fed58;};'use strict';var multer=require(_0x561e('0x0'));var util=require(_0x561e('0x1'));var path=require(_0x561e('0x2'));var timeout=require(_0x561e('0x3'));var express=require(_0x561e('0x4'));var router=express[_0x561e('0x5')]();var fs_extra=require(_0x561e('0x6'));var auth=require(_0x561e('0x7'));var interaction=require(_0x561e('0x8'));var config=require(_0x561e('0x9'));var controller=require(_0x561e('0xa'));router['get']('/',auth[_0x561e('0xb')](),controller[_0x561e('0xc')]);router[_0x561e('0xd')](_0x561e('0xe'),auth['isAuthenticated'](),controller[_0x561e('0xf')]);router['post']('/',auth[_0x561e('0xb')](),controller[_0x561e('0x10')]);router['put'](_0x561e('0xe'),auth[_0x561e('0xb')](),controller[_0x561e('0x11')]);router['delete'](_0x561e('0xe'),auth[_0x561e('0xb')](),controller['destroy']);module[_0x561e('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index c2db8c1..2bab304 100644 --- a/server/api/intZohoField/intZohoField.attributes.js +++ b/server/api/intZohoField/intZohoField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfe35=['variable','BOOLEAN','sequelize','exports','ENUM','string','customVariable','keyValue','picklist','STRING'];(function(_0x2a8b8c,_0x5e199b){var _0x375825=function(_0x496a61){while(--_0x496a61){_0x2a8b8c['push'](_0x2a8b8c['shift']());}};_0x375825(++_0x5e199b);}(_0xfe35,0x98));var _0x5fe3=function(_0x57dcba,_0x51d9f9){_0x57dcba=_0x57dcba-0x0;var _0x110949=_0xfe35[_0x57dcba];return _0x110949;};'use strict';var Sequelize=require(_0x5fe3('0x0'));module[_0x5fe3('0x1')]={'type':{'type':Sequelize[_0x5fe3('0x2')](_0x5fe3('0x3'),'variable',_0x5fe3('0x4'),_0x5fe3('0x5'),_0x5fe3('0x6')),'defaultValue':_0x5fe3('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x5fe3('0x7')]},'keyType':{'type':Sequelize[_0x5fe3('0x2')](_0x5fe3('0x3'),_0x5fe3('0x8'),_0x5fe3('0x4'))},'keyContent':{'type':Sequelize[_0x5fe3('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x5fe3('0x7')]},'customField':{'type':Sequelize[_0x5fe3('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd47b=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports'];(function(_0x1bbc78,_0x2e8c68){var _0x1d600f=function(_0x36689e){while(--_0x36689e){_0x1bbc78['push'](_0x1bbc78['shift']());}};_0x1d600f(++_0x2e8c68);}(_0xd47b,0x166));var _0xbd47=function(_0xbc8873,_0x160489){_0xbc8873=_0xbc8873-0x0;var _0x5289fd=_0xd47b[_0xbc8873];return _0x5289fd;};'use strict';var Sequelize=require(_0xbd47('0x0'));module[_0xbd47('0x1')]={'type':{'type':Sequelize[_0xbd47('0x2')](_0xbd47('0x3'),_0xbd47('0x4'),_0xbd47('0x5'),_0xbd47('0x6'),_0xbd47('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0xbd47('0x8')]},'key':{'type':Sequelize[_0xbd47('0x8')]},'keyType':{'type':Sequelize[_0xbd47('0x2')](_0xbd47('0x3'),_0xbd47('0x4'),_0xbd47('0x5'))},'keyContent':{'type':Sequelize[_0xbd47('0x8')]},'idField':{'type':Sequelize[_0xbd47('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xbd47('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 0042af5..025e841 100644 --- a/server/api/intZohoField/intZohoField.controller.js +++ b/server/api/intZohoField/intZohoField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6337=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','params','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','ZohoField','fieldName','model','query','keys'];(function(_0x487f96,_0x2b816b){var _0x2cafdc=function(_0x16706b){while(--_0x16706b){_0x487f96['push'](_0x487f96['shift']());}};_0x2cafdc(++_0x2b816b);}(_0x6337,0x18a));var _0x7633=function(_0x6fde9,_0x366856){_0x6fde9=_0x6fde9-0x0;var _0xc4f9f5=_0x6337[_0x6fde9];return _0xc4f9f5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7633('0x0'));var zipdir=require(_0x7633('0x1'));var jsonpatch=require(_0x7633('0x2'));var rp=require(_0x7633('0x3'));var moment=require(_0x7633('0x4'));var BPromise=require(_0x7633('0x5'));var Mustache=require(_0x7633('0x6'));var util=require(_0x7633('0x7'));var path=require(_0x7633('0x8'));var sox=require('sox');var csv=require(_0x7633('0x9'));var ejs=require(_0x7633('0xa'));var fs=require('fs');var fs_extra=require(_0x7633('0xb'));var _=require('lodash');var squel=require(_0x7633('0xc'));var crypto=require('crypto');var jsforce=require(_0x7633('0xd'));var deskjs=require(_0x7633('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7633('0xf'));var Papa=require('papaparse');var Redis=require(_0x7633('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7633('0x11'));var as=require(_0x7633('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7633('0x13'))(_0x7633('0x14'));var utils=require(_0x7633('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x7633('0x16'));var db=require(_0x7633('0x17'))['db'];function respondWithStatusCode(_0xeef065,_0x563006){_0x563006=_0x563006||0xcc;return function(_0x2007bc){if(_0x2007bc){return _0xeef065[_0x7633('0x18')](_0x563006);}return _0xeef065[_0x7633('0x19')](_0x563006)['end']();};}function respondWithResult(_0x5654bc,_0x50e10c){_0x50e10c=_0x50e10c||0xc8;return function(_0x18abe4){if(_0x18abe4){return _0x5654bc[_0x7633('0x19')](_0x50e10c)[_0x7633('0x1a')](_0x18abe4);}};}function respondWithFilteredResult(_0x3666a1,_0x25e7d5){return function(_0x1c9957){if(_0x1c9957){var _0x47e212=typeof _0x25e7d5[_0x7633('0x1b')]===_0x7633('0x1c')&&typeof _0x25e7d5['limit']===_0x7633('0x1c');var _0x4c4e1=_0x1c9957[_0x7633('0x1d')];var _0x321043=_0x47e212?0x0:_0x25e7d5[_0x7633('0x1b')];var _0x5c7609=_0x47e212?_0x1c9957[_0x7633('0x1d')]:_0x25e7d5[_0x7633('0x1b')]+_0x25e7d5[_0x7633('0x1e')];var _0x5988d4;if(_0x5c7609>=_0x4c4e1){_0x5c7609=_0x4c4e1;_0x5988d4=0xc8;}else{_0x5988d4=0xce;}_0x3666a1[_0x7633('0x19')](_0x5988d4);return _0x3666a1[_0x7633('0x1f')](_0x7633('0x20'),_0x321043+'-'+_0x5c7609+'/'+_0x4c4e1)[_0x7633('0x1a')](_0x1c9957);}return null;};}function patchUpdates(_0x14df18){return function(_0x503d13){try{jsonpatch[_0x7633('0x21')](_0x503d13,_0x14df18,!![]);}catch(_0x1140cd){return BPromise[_0x7633('0x22')](_0x1140cd);}return _0x503d13[_0x7633('0x23')]();};}function saveUpdates(_0x1c8efc,_0x55715b){return function(_0x38a915){if(_0x38a915){return _0x38a915[_0x7633('0x24')](_0x1c8efc)[_0x7633('0x25')](function(_0x2471b7){return _0x2471b7;});}return null;};}function removeEntity(_0x531e8f,_0x135a75){return function(_0x9152df){if(_0x9152df){return _0x9152df[_0x7633('0x26')]()[_0x7633('0x25')](function(){_0x531e8f['status'](0xcc)[_0x7633('0x27')]();});}};}function handleEntityNotFound(_0x34aa76,_0x555923){return function(_0x1eb275){if(!_0x1eb275){_0x34aa76['sendStatus'](0x194);}return _0x1eb275;};}function handleError(_0x47f2cb,_0x42b4a7){_0x42b4a7=_0x42b4a7||0x1f4;return function(_0x1b2920){logger[_0x7633('0x28')](_0x1b2920[_0x7633('0x29')]);if(_0x1b2920[_0x7633('0x2a')]){delete _0x1b2920[_0x7633('0x2a')];}_0x47f2cb[_0x7633('0x19')](_0x42b4a7)['send'](_0x1b2920);};}exports[_0x7633('0x2b')]=function(_0x7b9d8b,_0x266944){var _0x3d0b0c={},_0x323e00={},_0x1abaed={'count':0x0,'rows':[]};var _0x5d79ce=_[_0x7633('0x2c')](db[_0x7633('0x2d')]['rawAttributes'],function(_0x8fcf83){return{'name':_0x8fcf83[_0x7633('0x2e')],'type':_0x8fcf83['type']['key']};});_0x323e00[_0x7633('0x2f')]=_['map'](_0x5d79ce,_0x7633('0x2a'));_0x323e00[_0x7633('0x30')]=_[_0x7633('0x31')](_0x7b9d8b[_0x7633('0x30')]);_0x323e00[_0x7633('0x32')]=_[_0x7633('0x33')](_0x323e00['model'],_0x323e00[_0x7633('0x30')]);_0x3d0b0c[_0x7633('0x34')]=_['intersection'](_0x323e00['model'],qs[_0x7633('0x35')](_0x7b9d8b['query'][_0x7633('0x35')]));_0x3d0b0c['attributes']=_0x3d0b0c['attributes'][_0x7633('0x36')]?_0x3d0b0c[_0x7633('0x34')]:_0x323e00[_0x7633('0x2f')];if(!_0x7b9d8b[_0x7633('0x30')][_0x7633('0x37')](_0x7633('0x38'))){_0x3d0b0c['limit']=qs[_0x7633('0x1e')](_0x7b9d8b['query'][_0x7633('0x1e')]);_0x3d0b0c[_0x7633('0x1b')]=qs[_0x7633('0x1b')](_0x7b9d8b[_0x7633('0x30')][_0x7633('0x1b')]);}_0x3d0b0c[_0x7633('0x39')]=qs['sort'](_0x7b9d8b[_0x7633('0x30')][_0x7633('0x3a')]);_0x3d0b0c['where']=qs[_0x7633('0x32')](_[_0x7633('0x3b')](_0x7b9d8b[_0x7633('0x30')],_0x323e00[_0x7633('0x32')]),_0x5d79ce);if(_0x7b9d8b['query'][_0x7633('0x3c')]){_0x3d0b0c[_0x7633('0x3d')]=_[_0x7633('0x3e')](_0x3d0b0c[_0x7633('0x3d')],{'$or':_[_0x7633('0x2c')](_0x5d79ce,function(_0x552927){if(_0x552927[_0x7633('0x3f')]!==_0x7633('0x40')){var _0x2d6459={};_0x2d6459[_0x552927['name']]={'$like':'%'+_0x7b9d8b[_0x7633('0x30')][_0x7633('0x3c')]+'%'};return _0x2d6459;}})});}_0x3d0b0c=_[_0x7633('0x3e')]({},_0x3d0b0c,_0x7b9d8b[_0x7633('0x41')]);var _0x5371d7={'where':_0x3d0b0c['where']};return db[_0x7633('0x2d')][_0x7633('0x1d')](_0x5371d7)[_0x7633('0x25')](function(_0x50856e){_0x1abaed[_0x7633('0x1d')]=_0x50856e;if(_0x7b9d8b[_0x7633('0x30')][_0x7633('0x42')]){_0x3d0b0c[_0x7633('0x43')]=[{'all':!![]}];}return db['ZohoField'][_0x7633('0x44')](_0x3d0b0c);})['then'](function(_0x25a22e){_0x1abaed['rows']=_0x25a22e;return _0x1abaed;})[_0x7633('0x25')](respondWithFilteredResult(_0x266944,_0x3d0b0c))[_0x7633('0x45')](handleError(_0x266944,null));};exports['show']=function(_0x46e83f,_0x27209e){var _0x3f24b2={'raw':!![],'where':{'id':_0x46e83f[_0x7633('0x46')]['id']}},_0x79c2d0={};_0x79c2d0[_0x7633('0x2f')]=_[_0x7633('0x31')](db['ZohoField']['rawAttributes']);_0x79c2d0[_0x7633('0x30')]=_['keys'](_0x46e83f[_0x7633('0x30')]);_0x79c2d0[_0x7633('0x32')]=_[_0x7633('0x33')](_0x79c2d0[_0x7633('0x2f')],_0x79c2d0[_0x7633('0x30')]);_0x3f24b2[_0x7633('0x34')]=_[_0x7633('0x33')](_0x79c2d0[_0x7633('0x2f')],qs[_0x7633('0x35')](_0x46e83f[_0x7633('0x30')][_0x7633('0x35')]));_0x3f24b2[_0x7633('0x34')]=_0x3f24b2[_0x7633('0x34')]['length']?_0x3f24b2['attributes']:_0x79c2d0[_0x7633('0x2f')];if(_0x46e83f[_0x7633('0x30')][_0x7633('0x42')]){_0x3f24b2[_0x7633('0x43')]=[{'all':!![]}];}_0x3f24b2=_[_0x7633('0x3e')]({},_0x3f24b2,_0x46e83f[_0x7633('0x41')]);return db['ZohoField']['find'](_0x3f24b2)[_0x7633('0x25')](handleEntityNotFound(_0x27209e,null))[_0x7633('0x25')](respondWithResult(_0x27209e,null))[_0x7633('0x45')](handleError(_0x27209e,null));};exports[_0x7633('0x47')]=function(_0x599601,_0x5d9a0d){return db[_0x7633('0x2d')][_0x7633('0x47')](_0x599601[_0x7633('0x48')],{})['then'](respondWithResult(_0x5d9a0d,0xc9))[_0x7633('0x45')](handleError(_0x5d9a0d,null));};exports[_0x7633('0x24')]=function(_0x31f166,_0x3c79cb){if(_0x31f166[_0x7633('0x48')]['id']){delete _0x31f166[_0x7633('0x48')]['id'];}return db['ZohoField'][_0x7633('0x49')]({'where':{'id':_0x31f166[_0x7633('0x46')]['id']}})[_0x7633('0x25')](handleEntityNotFound(_0x3c79cb,null))['then'](saveUpdates(_0x31f166[_0x7633('0x48')],null))[_0x7633('0x25')](respondWithResult(_0x3c79cb,null))[_0x7633('0x45')](handleError(_0x3c79cb,null));};exports['destroy']=function(_0x54d4c1,_0x436788){return db[_0x7633('0x2d')][_0x7633('0x49')]({'where':{'id':_0x54d4c1[_0x7633('0x46')]['id']}})['then'](handleEntityNotFound(_0x436788,null))[_0x7633('0x25')](removeEntity(_0x436788,null))[_0x7633('0x45')](handleError(_0x436788,null));}; \ No newline at end of file +var _0xc8f2=['intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','params','find','body','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','count','limit','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','ZohoField','rawAttributes','fieldName','model','keys','query','filters'];(function(_0x23da4d,_0x63498c){var _0x4ae55=function(_0x323d75){while(--_0x323d75){_0x23da4d['push'](_0x23da4d['shift']());}};_0x4ae55(++_0x63498c);}(_0xc8f2,0x120));var _0x2c8f=function(_0x185ce6,_0x80b049){_0x185ce6=_0x185ce6-0x0;var _0xb2b554=_0xc8f2[_0x185ce6];return _0xb2b554;};'use strict';var emlformat=require(_0x2c8f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2c8f('0x1'));var jsonpatch=require(_0x2c8f('0x2'));var rp=require(_0x2c8f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2c8f('0x4'));var util=require(_0x2c8f('0x5'));var path=require(_0x2c8f('0x6'));var sox=require(_0x2c8f('0x7'));var csv=require(_0x2c8f('0x8'));var ejs=require(_0x2c8f('0x9'));var fs=require('fs');var fs_extra=require(_0x2c8f('0xa'));var _=require('lodash');var squel=require(_0x2c8f('0xb'));var crypto=require(_0x2c8f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2c8f('0xd'));var toCsv=require(_0x2c8f('0x8'));var querystring=require('querystring');var Papa=require(_0x2c8f('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2c8f('0xf'));var hardwareService=require(_0x2c8f('0x10'));var logger=require(_0x2c8f('0x11'))(_0x2c8f('0x12'));var utils=require(_0x2c8f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2c8f('0x14'));var db=require(_0x2c8f('0x15'))['db'];function respondWithStatusCode(_0x5c0ce4,_0x43f00d){_0x43f00d=_0x43f00d||0xcc;return function(_0x472cb7){if(_0x472cb7){return _0x5c0ce4[_0x2c8f('0x16')](_0x43f00d);}return _0x5c0ce4['status'](_0x43f00d)[_0x2c8f('0x17')]();};}function respondWithResult(_0x57ebf2,_0x522831){_0x522831=_0x522831||0xc8;return function(_0x5075ce){if(_0x5075ce){return _0x57ebf2[_0x2c8f('0x18')](_0x522831)[_0x2c8f('0x19')](_0x5075ce);}};}function respondWithFilteredResult(_0x117114,_0x1868f1){return function(_0x530e53){if(_0x530e53){var _0x1220c9=typeof _0x1868f1[_0x2c8f('0x1a')]==='undefined'&&typeof _0x1868f1['limit']==='undefined';var _0x2de404=_0x530e53[_0x2c8f('0x1b')];var _0x508e87=_0x1220c9?0x0:_0x1868f1[_0x2c8f('0x1a')];var _0x53855e=_0x1220c9?_0x530e53[_0x2c8f('0x1b')]:_0x1868f1[_0x2c8f('0x1a')]+_0x1868f1[_0x2c8f('0x1c')];var _0xa3bad4;if(_0x53855e>=_0x2de404){_0x53855e=_0x2de404;_0xa3bad4=0xc8;}else{_0xa3bad4=0xce;}_0x117114[_0x2c8f('0x18')](_0xa3bad4);return _0x117114['set'](_0x2c8f('0x1d'),_0x508e87+'-'+_0x53855e+'/'+_0x2de404)[_0x2c8f('0x19')](_0x530e53);}return null;};}function patchUpdates(_0xc3a2d){return function(_0x253652){try{jsonpatch[_0x2c8f('0x1e')](_0x253652,_0xc3a2d,!![]);}catch(_0x3e23f0){return BPromise['reject'](_0x3e23f0);}return _0x253652['save']();};}function saveUpdates(_0x51d2b5,_0x1a0995){return function(_0xc46e89){if(_0xc46e89){return _0xc46e89[_0x2c8f('0x1f')](_0x51d2b5)[_0x2c8f('0x20')](function(_0x44c701){return _0x44c701;});}return null;};}function removeEntity(_0x57def8,_0x9139fb){return function(_0x1b77d6){if(_0x1b77d6){return _0x1b77d6[_0x2c8f('0x21')]()['then'](function(){_0x57def8['status'](0xcc)[_0x2c8f('0x17')]();});}};}function handleEntityNotFound(_0xa96d33,_0x395aff){return function(_0x25fff8){if(!_0x25fff8){_0xa96d33[_0x2c8f('0x16')](0x194);}return _0x25fff8;};}function handleError(_0x4a5c3,_0x4762d4){_0x4762d4=_0x4762d4||0x1f4;return function(_0x50b69f){logger[_0x2c8f('0x22')](_0x50b69f[_0x2c8f('0x23')]);if(_0x50b69f[_0x2c8f('0x24')]){delete _0x50b69f[_0x2c8f('0x24')];}_0x4a5c3[_0x2c8f('0x18')](_0x4762d4)[_0x2c8f('0x25')](_0x50b69f);};}exports[_0x2c8f('0x26')]=function(_0x10ac10,_0x3336ca){var _0x341bc3={},_0x30a5ce={},_0x491689={'count':0x0,'rows':[]};var _0x5280f0=_[_0x2c8f('0x27')](db[_0x2c8f('0x28')][_0x2c8f('0x29')],function(_0x174ade){return{'name':_0x174ade[_0x2c8f('0x2a')],'type':_0x174ade['type']['key']};});_0x30a5ce[_0x2c8f('0x2b')]=_[_0x2c8f('0x27')](_0x5280f0,_0x2c8f('0x24'));_0x30a5ce['query']=_[_0x2c8f('0x2c')](_0x10ac10[_0x2c8f('0x2d')]);_0x30a5ce[_0x2c8f('0x2e')]=_[_0x2c8f('0x2f')](_0x30a5ce['model'],_0x30a5ce['query']);_0x341bc3[_0x2c8f('0x30')]=_[_0x2c8f('0x2f')](_0x30a5ce[_0x2c8f('0x2b')],qs[_0x2c8f('0x31')](_0x10ac10['query'][_0x2c8f('0x31')]));_0x341bc3[_0x2c8f('0x30')]=_0x341bc3['attributes']['length']?_0x341bc3['attributes']:_0x30a5ce[_0x2c8f('0x2b')];if(!_0x10ac10[_0x2c8f('0x2d')][_0x2c8f('0x32')]('nolimit')){_0x341bc3[_0x2c8f('0x1c')]=qs[_0x2c8f('0x1c')](_0x10ac10[_0x2c8f('0x2d')][_0x2c8f('0x1c')]);_0x341bc3['offset']=qs['offset'](_0x10ac10[_0x2c8f('0x2d')][_0x2c8f('0x1a')]);}_0x341bc3[_0x2c8f('0x33')]=qs['sort'](_0x10ac10[_0x2c8f('0x2d')][_0x2c8f('0x34')]);_0x341bc3[_0x2c8f('0x35')]=qs[_0x2c8f('0x2e')](_['pick'](_0x10ac10[_0x2c8f('0x2d')],_0x30a5ce[_0x2c8f('0x2e')]),_0x5280f0);if(_0x10ac10['query'][_0x2c8f('0x36')]){_0x341bc3[_0x2c8f('0x35')]=_[_0x2c8f('0x37')](_0x341bc3[_0x2c8f('0x35')],{'$or':_[_0x2c8f('0x27')](_0x5280f0,function(_0x2f09a6){if(_0x2f09a6[_0x2c8f('0x38')]!=='VIRTUAL'){var _0x355ed9={};_0x355ed9[_0x2f09a6[_0x2c8f('0x24')]]={'$like':'%'+_0x10ac10['query'][_0x2c8f('0x36')]+'%'};return _0x355ed9;}})});}_0x341bc3=_[_0x2c8f('0x37')]({},_0x341bc3,_0x10ac10[_0x2c8f('0x39')]);var _0x4b8155={'where':_0x341bc3[_0x2c8f('0x35')]};return db[_0x2c8f('0x28')][_0x2c8f('0x1b')](_0x4b8155)['then'](function(_0x205b36){_0x491689['count']=_0x205b36;if(_0x10ac10[_0x2c8f('0x2d')][_0x2c8f('0x3a')]){_0x341bc3[_0x2c8f('0x3b')]=[{'all':!![]}];}return db[_0x2c8f('0x28')][_0x2c8f('0x3c')](_0x341bc3);})[_0x2c8f('0x20')](function(_0x440052){_0x491689[_0x2c8f('0x3d')]=_0x440052;return _0x491689;})[_0x2c8f('0x20')](respondWithFilteredResult(_0x3336ca,_0x341bc3))[_0x2c8f('0x3e')](handleError(_0x3336ca,null));};exports[_0x2c8f('0x3f')]=function(_0x2f4922,_0xc25d4d){var _0xc5a0ce={'raw':!![],'where':{'id':_0x2f4922[_0x2c8f('0x40')]['id']}},_0x1b62e8={};_0x1b62e8[_0x2c8f('0x2b')]=_[_0x2c8f('0x2c')](db[_0x2c8f('0x28')][_0x2c8f('0x29')]);_0x1b62e8[_0x2c8f('0x2d')]=_[_0x2c8f('0x2c')](_0x2f4922['query']);_0x1b62e8[_0x2c8f('0x2e')]=_[_0x2c8f('0x2f')](_0x1b62e8[_0x2c8f('0x2b')],_0x1b62e8[_0x2c8f('0x2d')]);_0xc5a0ce[_0x2c8f('0x30')]=_[_0x2c8f('0x2f')](_0x1b62e8['model'],qs[_0x2c8f('0x31')](_0x2f4922['query'][_0x2c8f('0x31')]));_0xc5a0ce[_0x2c8f('0x30')]=_0xc5a0ce['attributes']['length']?_0xc5a0ce[_0x2c8f('0x30')]:_0x1b62e8[_0x2c8f('0x2b')];if(_0x2f4922['query'][_0x2c8f('0x3a')]){_0xc5a0ce[_0x2c8f('0x3b')]=[{'all':!![]}];}_0xc5a0ce=_['merge']({},_0xc5a0ce,_0x2f4922[_0x2c8f('0x39')]);return db[_0x2c8f('0x28')][_0x2c8f('0x41')](_0xc5a0ce)[_0x2c8f('0x20')](handleEntityNotFound(_0xc25d4d,null))[_0x2c8f('0x20')](respondWithResult(_0xc25d4d,null))[_0x2c8f('0x3e')](handleError(_0xc25d4d,null));};exports['create']=function(_0x4db705,_0xe0fd3){return db['ZohoField']['create'](_0x4db705[_0x2c8f('0x42')],{})[_0x2c8f('0x20')](respondWithResult(_0xe0fd3,0xc9))[_0x2c8f('0x3e')](handleError(_0xe0fd3,null));};exports[_0x2c8f('0x1f')]=function(_0x22cadd,_0x36bd92){if(_0x22cadd['body']['id']){delete _0x22cadd['body']['id'];}return db[_0x2c8f('0x28')][_0x2c8f('0x41')]({'where':{'id':_0x22cadd[_0x2c8f('0x40')]['id']}})[_0x2c8f('0x20')](handleEntityNotFound(_0x36bd92,null))[_0x2c8f('0x20')](saveUpdates(_0x22cadd[_0x2c8f('0x42')],null))[_0x2c8f('0x20')](respondWithResult(_0x36bd92,null))[_0x2c8f('0x3e')](handleError(_0x36bd92,null));};exports[_0x2c8f('0x21')]=function(_0x51e7ec,_0x228b52){return db[_0x2c8f('0x28')]['find']({'where':{'id':_0x51e7ec['params']['id']}})['then'](handleEntityNotFound(_0x228b52,null))[_0x2c8f('0x20')](removeEntity(_0x228b52,null))[_0x2c8f('0x3e')](handleError(_0x228b52,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 9881db9..5e1f529 100644 --- a/server/api/intZohoField/intZohoField.model.js +++ b/server/api/intZohoField/intZohoField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4bd3=['lodash','../../config/logger','api','path','rimraf','../../config/environment','exports','define','ZohoField','zoho_unique_index','idField','FieldId'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x4bd3,0x174));var _0x34bd=function(_0x4db0e4,_0x2b7306){_0x4db0e4=_0x4db0e4-0x0;var _0x1a8b53=_0x4bd3[_0x4db0e4];return _0x1a8b53;};'use strict';var _=require(_0x34bd('0x0'));var util=require('util');var logger=require(_0x34bd('0x1'))(_0x34bd('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x34bd('0x3'));var rimraf=require(_0x34bd('0x4'));var config=require(_0x34bd('0x5'));var attributes=require('./intZohoField.attributes');module[_0x34bd('0x6')]=function(_0x2a15a2,_0x5c2a7a){return _0x2a15a2[_0x34bd('0x7')](_0x34bd('0x8'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x34bd('0x9'),'fields':[_0x34bd('0xa'),_0x34bd('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfb11=['bluebird','path','../../config/environment','./intZohoField.attributes','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','../../config/logger','api'];(function(_0x383be3,_0xd1f599){var _0x495016=function(_0x37c739){while(--_0x37c739){_0x383be3['push'](_0x383be3['shift']());}};_0x495016(++_0xd1f599);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xfb11[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x1fb1('0x0'));var util=require('util');var logger=require(_0x1fb1('0x1'))(_0x1fb1('0x2'));var moment=require('moment');var BPromise=require(_0x1fb1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1fb1('0x4'));var rimraf=require('rimraf');var config=require(_0x1fb1('0x5'));var attributes=require(_0x1fb1('0x6'));module['exports']=function(_0x25d44f,_0x133727){return _0x25d44f['define'](_0x1fb1('0x7'),attributes,{'tableName':_0x1fb1('0x8'),'paranoid':![],'indexes':[{'name':_0x1fb1('0x9'),'fields':[_0x1fb1('0xa'),_0x1fb1('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index 8d9fd11..0c8b763 100644 --- a/server/api/intZohoField/intZohoField.rpc.js +++ b/server/api/intZohoField/intZohoField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf7b5=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','bluebird'];(function(_0xd13a88,_0x3c5269){var _0x1c993c=function(_0x245af5){while(--_0x245af5){_0xd13a88['push'](_0xd13a88['shift']());}};_0x1c993c(++_0x3c5269);}(_0xf7b5,0x19c));var _0x5f7b=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xf7b5[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0x5f7b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5f7b('0x1'));var rs=require(_0x5f7b('0x2'));var fs=require('fs');var Redis=require(_0x5f7b('0x3'));var db=require(_0x5f7b('0x4'))['db'];var utils=require(_0x5f7b('0x5'));var logger=require(_0x5f7b('0x6'))(_0x5f7b('0x7'));var config=require(_0x5f7b('0x8'));var jayson=require(_0x5f7b('0x9'));var client=jayson[_0x5f7b('0xa')][_0x5f7b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x170d00,_0x1d64c6,_0x4f9646){return new BPromise(function(_0x417ff1,_0x1c35a2){return client[_0x5f7b('0xc')](_0x170d00,_0x4f9646)['then'](function(_0x5b88aa){logger[_0x5f7b('0xd')](_0x5f7b('0xe'),_0x1d64c6,'request\x20sent');logger[_0x5f7b('0xf')](_0x5f7b('0x10'),_0x1d64c6,_0x5f7b('0x11'),JSON[_0x5f7b('0x12')](_0x5b88aa));if(_0x5b88aa[_0x5f7b('0x13')]){if(_0x5b88aa[_0x5f7b('0x13')][_0x5f7b('0x14')]===0x1f4){logger[_0x5f7b('0x13')](_0x5f7b('0xe'),_0x1d64c6,_0x5b88aa['error'][_0x5f7b('0x15')]);return _0x1c35a2(_0x5b88aa[_0x5f7b('0x13')][_0x5f7b('0x15')]);}logger[_0x5f7b('0x13')](_0x5f7b('0xe'),_0x1d64c6,_0x5b88aa[_0x5f7b('0x13')]['message']);return _0x417ff1(_0x5b88aa[_0x5f7b('0x13')][_0x5f7b('0x15')]);}else{logger[_0x5f7b('0xd')](_0x5f7b('0xe'),_0x1d64c6,_0x5f7b('0x11'));_0x417ff1(_0x5b88aa['result'][_0x5f7b('0x15')]);}})[_0x5f7b('0x16')](function(_0x348557){logger[_0x5f7b('0x13')](_0x5f7b('0xe'),_0x1d64c6,_0x348557);_0x1c35a2(_0x348557);});});} \ No newline at end of file +var _0x16f9=['then','info','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x16f9,0x183));var _0x916f=function(_0x3ff87e,_0x51ceed){_0x3ff87e=_0x3ff87e-0x0;var _0x4a1fb1=_0x16f9[_0x3ff87e];return _0x4a1fb1;};'use strict';var _=require('lodash');var util=require(_0x916f('0x0'));var moment=require(_0x916f('0x1'));var BPromise=require(_0x916f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x916f('0x3'))['db'];var utils=require(_0x916f('0x4'));var logger=require(_0x916f('0x5'))(_0x916f('0x6'));var config=require(_0x916f('0x7'));var jayson=require(_0x916f('0x8'));var client=jayson[_0x916f('0x9')][_0x916f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x31b35e,_0x1dfe07,_0x534918){return new BPromise(function(_0x4c4283,_0x30e99d){return client[_0x916f('0xb')](_0x31b35e,_0x534918)[_0x916f('0xc')](function(_0x1cce65){logger[_0x916f('0xd')](_0x916f('0xe'),_0x1dfe07,'request\x20sent');logger[_0x916f('0xf')](_0x916f('0x10'),_0x1dfe07,_0x916f('0x11'),JSON['stringify'](_0x1cce65));if(_0x1cce65[_0x916f('0x12')]){if(_0x1cce65[_0x916f('0x12')][_0x916f('0x13')]===0x1f4){logger['error']('ZohoField,\x20%s,\x20%s',_0x1dfe07,_0x1cce65[_0x916f('0x12')][_0x916f('0x14')]);return _0x30e99d(_0x1cce65['error'][_0x916f('0x14')]);}logger[_0x916f('0x12')](_0x916f('0xe'),_0x1dfe07,_0x1cce65['error'][_0x916f('0x14')]);return _0x4c4283(_0x1cce65[_0x916f('0x12')][_0x916f('0x14')]);}else{logger[_0x916f('0xd')](_0x916f('0xe'),_0x1dfe07,_0x916f('0x11'));_0x4c4283(_0x1cce65['result'][_0x916f('0x14')]);}})['catch'](function(_0x52011d){logger[_0x916f('0x12')](_0x916f('0xe'),_0x1dfe07,_0x52011d);_0x30e99d(_0x52011d);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index f22610d..2acbc03 100644 --- a/server/api/integration/index.js +++ b/server/api/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x40bc01,_0x22a9a9){var _0x42365b=function(_0x2d3d88){while(--_0x2d3d88){_0x40bc01['push'](_0x40bc01['shift']());}};_0x42365b(++_0x22a9a9);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x54c2a3,_0x3a77f2){var _0x1e7546=function(_0x35db8b){while(--_0x35db8b){_0x54c2a3['push'](_0x54c2a3['shift']());}};_0x1e7546(++_0x3a77f2);}(_0x70e0,0x17b));var _0x070e=function(_0x20c9f2,_0x4e5cdc){_0x20c9f2=_0x20c9f2-0x0;var _0x33a73e=_0x70e0[_0x20c9f2];return _0x33a73e;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index dac1c6c..cb1bedc 100644 --- a/server/api/integration/integration.attributes.js +++ b/server/api/integration/integration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4ce5=['STRING','unique_name_and_version','app.js','state','sequelize'];(function(_0xcf132,_0x5ab02a){var _0x496d9f=function(_0x49a600){while(--_0x49a600){_0xcf132['push'](_0xcf132['shift']());}};_0x496d9f(++_0x5ab02a);}(_0x4ce5,0x1b2));var _0x54ce=function(_0x15b100,_0x483db2){_0x15b100=_0x15b100-0x0;var _0x2e05bb=_0x4ce5[_0x15b100];return _0x2e05bb;};'use strict';var Sequelize=require(_0x54ce('0x0'));module['exports']={'name':{'type':Sequelize[_0x54ce('0x1')],'allowNull':![],'unique':_0x54ce('0x2')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0x54ce('0x1')],'defaultValue':_0x54ce('0x3')},'filename':{'type':Sequelize[_0x54ce('0x1')]},'path':{'type':Sequelize[_0x54ce('0x1')]},'type':{'type':Sequelize[_0x54ce('0x1')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0x54ce('0x1')]},'logo':{'type':Sequelize[_0x54ce('0x1')]},'state':{'type':Sequelize[_0x54ce('0x1')],'unique':_0x54ce('0x4')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0x54ce('0x1')]},'remoteUri':{'type':Sequelize[_0x54ce('0x1')]},'link':{'type':Sequelize[_0x54ce('0x1')],'defaultValue':'#'}}; \ No newline at end of file +var _0xe6d7=['STRING','INTEGER','BOOLEAN','state','exports','unique_name_and_version'];(function(_0x39a527,_0x393544){var _0x3dbad8=function(_0x98906d){while(--_0x98906d){_0x39a527['push'](_0x39a527['shift']());}};_0x3dbad8(++_0x393544);}(_0xe6d7,0x1ae));var _0x7e6d=function(_0x9a7d08,_0xe9048){_0x9a7d08=_0x9a7d08-0x0;var _0x58e6e8=_0xe6d7[_0x9a7d08];return _0x58e6e8;};'use strict';var Sequelize=require('sequelize');module[_0x7e6d('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7e6d('0x1')},'version':{'type':Sequelize[_0x7e6d('0x2')],'allowNull':![],'unique':_0x7e6d('0x1')},'main':{'type':Sequelize[_0x7e6d('0x2')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0x7e6d('0x2')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0x7e6d('0x3')]},'active':{'type':Sequelize[_0x7e6d('0x4')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x7e6d('0x2')]},'state':{'type':Sequelize[_0x7e6d('0x2')],'unique':_0x7e6d('0x5')},'description':{'type':Sequelize[_0x7e6d('0x2')]},'title':{'type':Sequelize[_0x7e6d('0x2')]},'remoteUri':{'type':Sequelize[_0x7e6d('0x2')]},'link':{'type':Sequelize[_0x7e6d('0x2')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 5e0f21a..fd5ad47 100644 --- a/server/api/integration/integration.controller.js +++ b/server/api/integration/integration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfdbd=['findAll','rows','show','length','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','update','destroy','then','error','stack','name','send','index','map','Integration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include'];(function(_0x4b0e56,_0x41d071){var _0x15e370=function(_0x1287d){while(--_0x1287d){_0x4b0e56['push'](_0x4b0e56['shift']());}};_0x15e370(++_0x41d071);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x25e2bc,_0x27d1ef){_0x25e2bc=_0x25e2bc-0x0;var _0x5152d3=_0xfdbd[_0x25e2bc];return _0x5152d3;};'use strict';var emlformat=require(_0xdfdb('0x0'));var rimraf=require(_0xdfdb('0x1'));var zipdir=require(_0xdfdb('0x2'));var jsonpatch=require(_0xdfdb('0x3'));var rp=require(_0xdfdb('0x4'));var moment=require(_0xdfdb('0x5'));var BPromise=require(_0xdfdb('0x6'));var Mustache=require(_0xdfdb('0x7'));var util=require(_0xdfdb('0x8'));var path=require('path');var sox=require(_0xdfdb('0x9'));var csv=require('to-csv');var ejs=require(_0xdfdb('0xa'));var fs=require('fs');var fs_extra=require(_0xdfdb('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdfdb('0xc'));var deskjs=require(_0xdfdb('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdfdb('0xe'));var Papa=require(_0xdfdb('0xf'));var Redis=require(_0xdfdb('0x10'));var authService=require(_0xdfdb('0x11'));var qs=require(_0xdfdb('0x12'));var as=require(_0xdfdb('0x13'));var hardwareService=require(_0xdfdb('0x14'));var logger=require('../../config/logger')(_0xdfdb('0x15'));var utils=require(_0xdfdb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xdfdb('0x17'));var db=require(_0xdfdb('0x18'))['db'];function respondWithStatusCode(_0x2bee3b,_0x1918c1){_0x1918c1=_0x1918c1||0xcc;return function(_0x2a95f1){if(_0x2a95f1){return _0x2bee3b[_0xdfdb('0x19')](_0x1918c1);}return _0x2bee3b[_0xdfdb('0x1a')](_0x1918c1)[_0xdfdb('0x1b')]();};}function respondWithResult(_0x51162f,_0x48a66a){_0x48a66a=_0x48a66a||0xc8;return function(_0x2c44dc){if(_0x2c44dc){return _0x51162f['status'](_0x48a66a)[_0xdfdb('0x1c')](_0x2c44dc);}};}function respondWithFilteredResult(_0x9f3039,_0x11a56a){return function(_0x40bc8a){if(_0x40bc8a){var _0x3bfd81=typeof _0x11a56a[_0xdfdb('0x1d')]==='undefined'&&typeof _0x11a56a['limit']===_0xdfdb('0x1e');var _0x8b9193=_0x40bc8a[_0xdfdb('0x1f')];var _0x55ab5a=_0x3bfd81?0x0:_0x11a56a[_0xdfdb('0x1d')];var _0xb677b1=_0x3bfd81?_0x40bc8a[_0xdfdb('0x1f')]:_0x11a56a[_0xdfdb('0x1d')]+_0x11a56a[_0xdfdb('0x20')];var _0x2294de;if(_0xb677b1>=_0x8b9193){_0xb677b1=_0x8b9193;_0x2294de=0xc8;}else{_0x2294de=0xce;}_0x9f3039[_0xdfdb('0x1a')](_0x2294de);return _0x9f3039[_0xdfdb('0x21')]('Content-Range',_0x55ab5a+'-'+_0xb677b1+'/'+_0x8b9193)[_0xdfdb('0x1c')](_0x40bc8a);}return null;};}function patchUpdates(_0xb7417c){return function(_0x172c63){try{jsonpatch['apply'](_0x172c63,_0xb7417c,!![]);}catch(_0x377112){return BPromise[_0xdfdb('0x22')](_0x377112);}return _0x172c63[_0xdfdb('0x23')]();};}function saveUpdates(_0x4d55e5,_0x280e53){return function(_0x789bd2){if(_0x789bd2){return _0x789bd2[_0xdfdb('0x24')](_0x4d55e5)['then'](function(_0x2a80c1){return _0x2a80c1;});}return null;};}function removeEntity(_0x526057,_0x2db1c1){return function(_0x145350){if(_0x145350){return _0x145350[_0xdfdb('0x25')]()[_0xdfdb('0x26')](function(){_0x526057['status'](0xcc)[_0xdfdb('0x1b')]();});}};}function handleEntityNotFound(_0x4363d8,_0x956843){return function(_0x400663){if(!_0x400663){_0x4363d8[_0xdfdb('0x19')](0x194);}return _0x400663;};}function handleError(_0x305954,_0x57d24f){_0x57d24f=_0x57d24f||0x1f4;return function(_0xec4d22){logger[_0xdfdb('0x27')](_0xec4d22[_0xdfdb('0x28')]);if(_0xec4d22['name']){delete _0xec4d22[_0xdfdb('0x29')];}_0x305954['status'](_0x57d24f)[_0xdfdb('0x2a')](_0xec4d22);};}exports[_0xdfdb('0x2b')]=function(_0x19c36f,_0x513fa0){var _0x5bc174={},_0x1c8ca8={},_0xc56435={'count':0x0,'rows':[]};var _0xedbb91=_[_0xdfdb('0x2c')](db[_0xdfdb('0x2d')][_0xdfdb('0x2e')],function(_0x5a9fc4){return{'name':_0x5a9fc4[_0xdfdb('0x2f')],'type':_0x5a9fc4[_0xdfdb('0x30')][_0xdfdb('0x31')]};});_0x1c8ca8[_0xdfdb('0x32')]=_[_0xdfdb('0x2c')](_0xedbb91,_0xdfdb('0x29'));_0x1c8ca8[_0xdfdb('0x33')]=_[_0xdfdb('0x34')](_0x19c36f[_0xdfdb('0x33')]);_0x1c8ca8[_0xdfdb('0x35')]=_[_0xdfdb('0x36')](_0x1c8ca8['model'],_0x1c8ca8['query']);_0x5bc174[_0xdfdb('0x37')]=_['intersection'](_0x1c8ca8[_0xdfdb('0x32')],qs[_0xdfdb('0x38')](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x38')]));_0x5bc174['attributes']=_0x5bc174[_0xdfdb('0x37')]['length']?_0x5bc174[_0xdfdb('0x37')]:_0x1c8ca8[_0xdfdb('0x32')];if(!_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x39')](_0xdfdb('0x3a'))){_0x5bc174[_0xdfdb('0x20')]=qs['limit'](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x20')]);_0x5bc174['offset']=qs[_0xdfdb('0x1d')](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x1d')]);}_0x5bc174[_0xdfdb('0x3b')]=qs[_0xdfdb('0x3c')](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x3c')]);_0x5bc174[_0xdfdb('0x3d')]=qs[_0xdfdb('0x35')](_[_0xdfdb('0x3e')](_0x19c36f[_0xdfdb('0x33')],_0x1c8ca8['filters']),_0xedbb91);if(_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x3f')]){_0x5bc174[_0xdfdb('0x3d')]=_[_0xdfdb('0x40')](_0x5bc174[_0xdfdb('0x3d')],{'$or':_[_0xdfdb('0x2c')](_0xedbb91,function(_0x3ec73a){if(_0x3ec73a[_0xdfdb('0x30')]!=='VIRTUAL'){var _0x55d707={};_0x55d707[_0x3ec73a[_0xdfdb('0x29')]]={'$like':'%'+_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x3f')]+'%'};return _0x55d707;}})});}_0x5bc174=_[_0xdfdb('0x40')]({},_0x5bc174,_0x19c36f[_0xdfdb('0x41')]);var _0x300884={'where':_0x5bc174[_0xdfdb('0x3d')]};return db[_0xdfdb('0x2d')][_0xdfdb('0x1f')](_0x300884)['then'](function(_0x175f57){_0xc56435[_0xdfdb('0x1f')]=_0x175f57;if(_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x42')]){_0x5bc174[_0xdfdb('0x43')]=[{'all':!![]}];}return db['Integration'][_0xdfdb('0x44')](_0x5bc174);})[_0xdfdb('0x26')](function(_0x3e9f88){_0xc56435[_0xdfdb('0x45')]=_0x3e9f88;return _0xc56435;})[_0xdfdb('0x26')](respondWithFilteredResult(_0x513fa0,_0x5bc174))['catch'](handleError(_0x513fa0,null));};exports[_0xdfdb('0x46')]=function(_0xd2f8bd,_0xf0482a){var _0x5b4381={'raw':![],'where':{'id':_0xd2f8bd['params']['id']}},_0x2b5139={};_0x2b5139[_0xdfdb('0x32')]=_['keys'](db[_0xdfdb('0x2d')][_0xdfdb('0x2e')]);_0x2b5139['query']=_[_0xdfdb('0x34')](_0xd2f8bd['query']);_0x2b5139[_0xdfdb('0x35')]=_[_0xdfdb('0x36')](_0x2b5139[_0xdfdb('0x32')],_0x2b5139[_0xdfdb('0x33')]);_0x5b4381[_0xdfdb('0x37')]=_['intersection'](_0x2b5139['model'],qs[_0xdfdb('0x38')](_0xd2f8bd[_0xdfdb('0x33')]['fields']));_0x5b4381[_0xdfdb('0x37')]=_0x5b4381['attributes'][_0xdfdb('0x47')]?_0x5b4381[_0xdfdb('0x37')]:_0x2b5139[_0xdfdb('0x32')];if(_0xd2f8bd[_0xdfdb('0x33')][_0xdfdb('0x42')]){_0x5b4381[_0xdfdb('0x43')]=[{'all':!![]}];}_0x5b4381=_[_0xdfdb('0x40')]({},_0x5b4381,_0xd2f8bd[_0xdfdb('0x41')]);return db[_0xdfdb('0x2d')][_0xdfdb('0x48')](_0x5b4381)[_0xdfdb('0x26')](handleEntityNotFound(_0xf0482a,null))[_0xdfdb('0x26')](respondWithResult(_0xf0482a,null))[_0xdfdb('0x49')](handleError(_0xf0482a,null));};exports[_0xdfdb('0x4a')]=function(_0x1c08fb,_0x273477){return db['Integration']['create'](_0x1c08fb[_0xdfdb('0x4b')],{})[_0xdfdb('0x26')](respondWithResult(_0x273477,0xc9))[_0xdfdb('0x49')](handleError(_0x273477,null));};exports['update']=function(_0x36149e,_0x4d4c90){if(_0x36149e[_0xdfdb('0x4b')]['id']){delete _0x36149e[_0xdfdb('0x4b')]['id'];}return db['Integration'][_0xdfdb('0x48')]({'where':{'id':_0x36149e[_0xdfdb('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4d4c90,null))[_0xdfdb('0x26')](saveUpdates(_0x36149e[_0xdfdb('0x4b')],null))[_0xdfdb('0x26')](respondWithResult(_0x4d4c90,null))[_0xdfdb('0x49')](handleError(_0x4d4c90,null));};exports[_0xdfdb('0x25')]=function(_0x10b490,_0x17dfdb){return db[_0xdfdb('0x2d')][_0xdfdb('0x48')]({'where':{'id':_0x10b490['params']['id']}})[_0xdfdb('0x26')](handleEntityNotFound(_0x17dfdb,null))['then'](removeEntity(_0x17dfdb,null))[_0xdfdb('0x49')](handleError(_0x17dfdb,null));}; \ No newline at end of file +var _0x4975=['path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','fieldName','type','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','map','VIRTUAL','options','Integration','count','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x5f1fc3,_0x30c99e){var _0x486080=function(_0x371308){while(--_0x371308){_0x5f1fc3['push'](_0x5f1fc3['shift']());}};_0x486080(++_0x30c99e);}(_0x4975,0x86));var _0x5497=function(_0x446dda,_0x89a81a){_0x446dda=_0x446dda-0x0;var _0xfb6263=_0x4975[_0x446dda];return _0xfb6263;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];function respondWithStatusCode(_0x1b23df,_0x1bb794){_0x1bb794=_0x1bb794||0xcc;return function(_0x984990){if(_0x984990){return _0x1b23df[_0x5497('0x18')](_0x1bb794);}return _0x1b23df[_0x5497('0x19')](_0x1bb794)[_0x5497('0x1a')]();};}function respondWithResult(_0xaca97d,_0x363a5b){_0x363a5b=_0x363a5b||0xc8;return function(_0x1a4c74){if(_0x1a4c74){return _0xaca97d['status'](_0x363a5b)[_0x5497('0x1b')](_0x1a4c74);}};}function respondWithFilteredResult(_0x4fb8e9,_0x4237a9){return function(_0x2bfd8a){if(_0x2bfd8a){var _0x19e5f3=typeof _0x4237a9[_0x5497('0x1c')]===_0x5497('0x1d')&&typeof _0x4237a9[_0x5497('0x1e')]===_0x5497('0x1d');var _0x575f6b=_0x2bfd8a['count'];var _0x3f4d20=_0x19e5f3?0x0:_0x4237a9[_0x5497('0x1c')];var _0x3a47fd=_0x19e5f3?_0x2bfd8a['count']:_0x4237a9[_0x5497('0x1c')]+_0x4237a9[_0x5497('0x1e')];var _0x18e8a8;if(_0x3a47fd>=_0x575f6b){_0x3a47fd=_0x575f6b;_0x18e8a8=0xc8;}else{_0x18e8a8=0xce;}_0x4fb8e9[_0x5497('0x19')](_0x18e8a8);return _0x4fb8e9[_0x5497('0x1f')](_0x5497('0x20'),_0x3f4d20+'-'+_0x3a47fd+'/'+_0x575f6b)[_0x5497('0x1b')](_0x2bfd8a);}return null;};}function patchUpdates(_0x10226f){return function(_0x2e3960){try{jsonpatch[_0x5497('0x21')](_0x2e3960,_0x10226f,!![]);}catch(_0x186065){return BPromise['reject'](_0x186065);}return _0x2e3960[_0x5497('0x22')]();};}function saveUpdates(_0x4d1b27,_0x19200a){return function(_0xd0868d){if(_0xd0868d){return _0xd0868d[_0x5497('0x23')](_0x4d1b27)[_0x5497('0x24')](function(_0x35ecd9){return _0x35ecd9;});}return null;};}function removeEntity(_0x3b2fbc,_0x5018fa){return function(_0x54043a){if(_0x54043a){return _0x54043a[_0x5497('0x25')]()[_0x5497('0x24')](function(){_0x3b2fbc[_0x5497('0x19')](0xcc)[_0x5497('0x1a')]();});}};}function handleEntityNotFound(_0x5223b5,_0x13b7a4){return function(_0x57268c){if(!_0x57268c){_0x5223b5[_0x5497('0x18')](0x194);}return _0x57268c;};}function handleError(_0x16a2b4,_0x429d36){_0x429d36=_0x429d36||0x1f4;return function(_0x34a1a5){logger[_0x5497('0x26')](_0x34a1a5[_0x5497('0x27')]);if(_0x34a1a5['name']){delete _0x34a1a5[_0x5497('0x28')];}_0x16a2b4['status'](_0x429d36)['send'](_0x34a1a5);};}exports['index']=function(_0x39a2b7,_0x48d146){var _0x5e9356={},_0xc3465={},_0xb14593={'count':0x0,'rows':[]};var _0x1cf908=_['map'](db['Integration']['rawAttributes'],function(_0x371874){return{'name':_0x371874[_0x5497('0x29')],'type':_0x371874[_0x5497('0x2a')]['key']};});_0xc3465['model']=_['map'](_0x1cf908,_0x5497('0x28'));_0xc3465['query']=_[_0x5497('0x2b')](_0x39a2b7[_0x5497('0x2c')]);_0xc3465[_0x5497('0x2d')]=_['intersection'](_0xc3465[_0x5497('0x2e')],_0xc3465[_0x5497('0x2c')]);_0x5e9356['attributes']=_[_0x5497('0x2f')](_0xc3465[_0x5497('0x2e')],qs[_0x5497('0x30')](_0x39a2b7['query'][_0x5497('0x30')]));_0x5e9356[_0x5497('0x31')]=_0x5e9356[_0x5497('0x31')][_0x5497('0x32')]?_0x5e9356[_0x5497('0x31')]:_0xc3465['model'];if(!_0x39a2b7[_0x5497('0x2c')][_0x5497('0x33')]('nolimit')){_0x5e9356[_0x5497('0x1e')]=qs[_0x5497('0x1e')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x1e')]);_0x5e9356[_0x5497('0x1c')]=qs[_0x5497('0x1c')](_0x39a2b7['query'][_0x5497('0x1c')]);}_0x5e9356['order']=qs[_0x5497('0x34')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x34')]);_0x5e9356['where']=qs['filters'](_[_0x5497('0x35')](_0x39a2b7[_0x5497('0x2c')],_0xc3465[_0x5497('0x2d')]),_0x1cf908);if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]){_0x5e9356[_0x5497('0x37')]=_['merge'](_0x5e9356[_0x5497('0x37')],{'$or':_[_0x5497('0x38')](_0x1cf908,function(_0x3de8fe){if(_0x3de8fe[_0x5497('0x2a')]!==_0x5497('0x39')){var _0x468902={};_0x468902[_0x3de8fe[_0x5497('0x28')]]={'$like':'%'+_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]+'%'};return _0x468902;}})});}_0x5e9356=_['merge']({},_0x5e9356,_0x39a2b7[_0x5497('0x3a')]);var _0x32fa2b={'where':_0x5e9356[_0x5497('0x37')]};return db[_0x5497('0x3b')][_0x5497('0x3c')](_0x32fa2b)[_0x5497('0x24')](function(_0x4299be){_0xb14593['count']=_0x4299be;if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x3d')]){_0x5e9356[_0x5497('0x3e')]=[{'all':!![]}];}return db[_0x5497('0x3b')][_0x5497('0x3f')](_0x5e9356);})[_0x5497('0x24')](function(_0x114471){_0xb14593['rows']=_0x114471;return _0xb14593;})[_0x5497('0x24')](respondWithFilteredResult(_0x48d146,_0x5e9356))[_0x5497('0x40')](handleError(_0x48d146,null));};exports[_0x5497('0x41')]=function(_0x1e6389,_0x20e947){var _0xd90608={'raw':![],'where':{'id':_0x1e6389[_0x5497('0x42')]['id']}},_0xc1a999={};_0xc1a999[_0x5497('0x2e')]=_[_0x5497('0x2b')](db['Integration'][_0x5497('0x43')]);_0xc1a999['query']=_[_0x5497('0x2b')](_0x1e6389[_0x5497('0x2c')]);_0xc1a999[_0x5497('0x2d')]=_[_0x5497('0x2f')](_0xc1a999[_0x5497('0x2e')],_0xc1a999['query']);_0xd90608[_0x5497('0x31')]=_[_0x5497('0x2f')](_0xc1a999['model'],qs[_0x5497('0x30')](_0x1e6389['query'][_0x5497('0x30')]));_0xd90608['attributes']=_0xd90608[_0x5497('0x31')][_0x5497('0x32')]?_0xd90608[_0x5497('0x31')]:_0xc1a999[_0x5497('0x2e')];if(_0x1e6389[_0x5497('0x2c')]['includeAll']){_0xd90608['include']=[{'all':!![]}];}_0xd90608=_['merge']({},_0xd90608,_0x1e6389['options']);return db[_0x5497('0x3b')][_0x5497('0x44')](_0xd90608)[_0x5497('0x24')](handleEntityNotFound(_0x20e947,null))[_0x5497('0x24')](respondWithResult(_0x20e947,null))[_0x5497('0x40')](handleError(_0x20e947,null));};exports[_0x5497('0x45')]=function(_0xc78abe,_0x466287){return db[_0x5497('0x3b')]['create'](_0xc78abe[_0x5497('0x46')],{})[_0x5497('0x24')](respondWithResult(_0x466287,0xc9))[_0x5497('0x40')](handleError(_0x466287,null));};exports['update']=function(_0x3e4da2,_0x530475){if(_0x3e4da2[_0x5497('0x46')]['id']){delete _0x3e4da2[_0x5497('0x46')]['id'];}return db[_0x5497('0x3b')]['find']({'where':{'id':_0x3e4da2[_0x5497('0x42')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x530475,null))['then'](saveUpdates(_0x3e4da2[_0x5497('0x46')],null))['then'](respondWithResult(_0x530475,null))[_0x5497('0x40')](handleError(_0x530475,null));};exports['destroy']=function(_0x416f76,_0x400860){return db[_0x5497('0x3b')][_0x5497('0x44')]({'where':{'id':_0x416f76[_0x5497('0x42')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x400860,null))[_0x5497('0x24')](removeEntity(_0x400860,null))[_0x5497('0x40')](handleError(_0x400860,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index d793588..55f20cc 100644 --- a/server/api/integration/integration.model.js +++ b/server/api/integration/integration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfab4=['define','integrations','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integration.attributes','exports'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xfab4,0x1c9));var _0x4fab=function(_0x18c282,_0x5d8f93){_0x18c282=_0x18c282-0x0;var _0x60edc9=_0xfab4[_0x18c282];return _0x60edc9;};'use strict';var _=require(_0x4fab('0x0'));var util=require('util');var logger=require(_0x4fab('0x1'))(_0x4fab('0x2'));var moment=require(_0x4fab('0x3'));var BPromise=require(_0x4fab('0x4'));var rp=require(_0x4fab('0x5'));var fs=require('fs');var path=require(_0x4fab('0x6'));var rimraf=require(_0x4fab('0x7'));var config=require(_0x4fab('0x8'));var attributes=require(_0x4fab('0x9'));module[_0x4fab('0xa')]=function(_0x46a14f,_0x2bab8d){return _0x46a14f[_0x4fab('0xb')]('Integration',attributes,{'tableName':_0x4fab('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xad79=['path','rimraf','../../config/environment','./integration.attributes','exports','Integration','lodash','api','moment','bluebird','request-promise'];(function(_0xca49c,_0x2a3d59){var _0x1c7fe5=function(_0x49af06){while(--_0x49af06){_0xca49c['push'](_0xca49c['shift']());}};_0x1c7fe5(++_0x2a3d59);}(_0xad79,0xab));var _0x9ad7=function(_0x181844,_0x2a034f){_0x181844=_0x181844-0x0;var _0x473ead=_0xad79[_0x181844];return _0x473ead;};'use strict';var _=require(_0x9ad7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9ad7('0x1'));var moment=require(_0x9ad7('0x2'));var BPromise=require(_0x9ad7('0x3'));var rp=require(_0x9ad7('0x4'));var fs=require('fs');var path=require(_0x9ad7('0x5'));var rimraf=require(_0x9ad7('0x6'));var config=require(_0x9ad7('0x7'));var attributes=require(_0x9ad7('0x8'));module[_0x9ad7('0x9')]=function(_0x436311,_0x5a190d){return _0x436311['define'](_0x9ad7('0xa'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index c7ed354..3e32597 100644 --- a/server/api/integration/integration.rpc.js +++ b/server/api/integration/integration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe2fe=['then','info','Integration,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x457a50,_0x241546){var _0x399553=function(_0x1d519b){while(--_0x1d519b){_0x457a50['push'](_0x457a50['shift']());}};_0x399553(++_0x241546);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xee2f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee2f('0x2'));var db=require(_0xee2f('0x3'))['db'];var utils=require(_0xee2f('0x4'));var logger=require(_0xee2f('0x5'))(_0xee2f('0x6'));var config=require('../../config/environment');var jayson=require(_0xee2f('0x7'));var client=jayson[_0xee2f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1533a0,_0x2e1c8c,_0x5a7975){return new BPromise(function(_0x3c4095,_0x5ea796){return client[_0xee2f('0x9')](_0x1533a0,_0x5a7975)[_0xee2f('0xa')](function(_0x53f7dd){logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,'request\x20sent');logger['debug']('Integration,\x20%s,\x20%s,\x20%s',_0x2e1c8c,'request\x20sent',JSON[_0xee2f('0xd')](_0x53f7dd));if(_0x53f7dd['error']){if(_0x53f7dd['error']['code']===0x1f4){logger[_0xee2f('0xe')](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);return _0x5ea796(_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);}logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd['error'][_0xee2f('0xf')]);return _0x3c4095(_0x53f7dd[_0xee2f('0xe')]['message']);}else{logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,_0xee2f('0x10'));_0x3c4095(_0x53f7dd[_0xee2f('0x11')][_0xee2f('0xf')]);}})['catch'](function(_0x3f6372){logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x3f6372);_0x5ea796(_0x3f6372);});});} \ No newline at end of file +var _0x896e=['Integration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0xc492a3,_0x2b42ee){var _0x414593=function(_0x4489ad){while(--_0x4489ad){_0xc492a3['push'](_0xc492a3['shift']());}};_0x414593(++_0x2b42ee);}(_0x896e,0x1e9));var _0xe896=function(_0x5ecf74,_0x4a0cc8){_0x5ecf74=_0x5ecf74-0x0;var _0x113686=_0x896e[_0x5ecf74];return _0x113686;};'use strict';var _=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var moment=require(_0xe896('0x2'));var BPromise=require(_0xe896('0x3'));var rs=require(_0xe896('0x4'));var fs=require('fs');var Redis=require(_0xe896('0x5'));var db=require(_0xe896('0x6'))['db'];var utils=require(_0xe896('0x7'));var logger=require(_0xe896('0x8'))(_0xe896('0x9'));var config=require(_0xe896('0xa'));var jayson=require(_0xe896('0xb'));var client=jayson['client'][_0xe896('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x7a0721,_0x3b902c,_0x264eeb){return new BPromise(function(_0x43c619,_0x5a1909){return client[_0xe896('0xd')](_0x7a0721,_0x264eeb)[_0xe896('0xe')](function(_0x37a90d){logger['info'](_0xe896('0xf'),_0x3b902c,'request\x20sent');logger[_0xe896('0x10')]('Integration,\x20%s,\x20%s,\x20%s',_0x3b902c,_0xe896('0x11'),JSON[_0xe896('0x12')](_0x37a90d));if(_0x37a90d[_0xe896('0x13')]){if(_0x37a90d['error'][_0xe896('0x14')]===0x1f4){logger[_0xe896('0x13')](_0xe896('0xf'),_0x3b902c,_0x37a90d['error'][_0xe896('0x15')]);return _0x5a1909(_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);}logger['error'](_0xe896('0xf'),_0x3b902c,_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);return _0x43c619(_0x37a90d['error']['message']);}else{logger[_0xe896('0x16')](_0xe896('0xf'),_0x3b902c,'request\x20sent');_0x43c619(_0x37a90d['result'][_0xe896('0x15')]);}})[_0xe896('0x17')](function(_0x57f04b){logger[_0xe896('0x13')]('Integration,\x20%s,\x20%s',_0x3b902c,_0x57f04b);_0x5a1909(_0x57f04b);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 1bfd6fd..917a8d0 100644 --- a/server/api/integrationReport/index.js +++ b/server/api/integrationReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd943=['show','post','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','describe'];(function(_0x54a761,_0x431fd4){var _0x37d1da=function(_0x5ca617){while(--_0x5ca617){_0x54a761['push'](_0x54a761['shift']());}};_0x37d1da(++_0x431fd4);}(_0xd943,0x15d));var _0x3d94=function(_0x213357,_0x3b5dcc){_0x213357=_0x213357-0x0;var _0x45db45=_0xd943[_0x213357];return _0x45db45;};'use strict';var multer=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var path=require(_0x3d94('0x2'));var timeout=require(_0x3d94('0x3'));var express=require('express');var router=express[_0x3d94('0x4')]();var fs_extra=require(_0x3d94('0x5'));var auth=require(_0x3d94('0x6'));var interaction=require(_0x3d94('0x7'));var config=require(_0x3d94('0x8'));var controller=require('./integrationReport.controller');router['get']('/',auth[_0x3d94('0x9')](),controller['index']);router['get']('/describe',auth[_0x3d94('0x9')](),controller[_0x3d94('0xa')]);router['get']('/:id',auth[_0x3d94('0x9')](),controller[_0x3d94('0xb')]);router[_0x3d94('0xc')]('/',auth['isAuthenticated'](),controller[_0x3d94('0xd')]);router['put'](_0x3d94('0xe'),auth[_0x3d94('0x9')](),controller['update']);router[_0x3d94('0xf')](_0x3d94('0xe'),auth[_0x3d94('0x9')](),controller[_0x3d94('0x10')]);module[_0x3d94('0x11')]=router; \ No newline at end of file +var _0x1261=['create','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','index','get','isAuthenticated','describe','/:id','post'];(function(_0x5816fe,_0x701075){var _0x495db2=function(_0x3dd278){while(--_0x3dd278){_0x5816fe['push'](_0x5816fe['shift']());}};_0x495db2(++_0x701075);}(_0x1261,0x144));var _0x1126=function(_0x2a94cf,_0x2b970d){_0x2a94cf=_0x2a94cf-0x0;var _0x22147f=_0x1261[_0x2a94cf];return _0x22147f;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var fs_extra=require(_0x1126('0x5'));var auth=require(_0x1126('0x6'));var interaction=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var controller=require(_0x1126('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x1126('0xa')]);router[_0x1126('0xb')]('/describe',auth[_0x1126('0xc')](),controller[_0x1126('0xd')]);router[_0x1126('0xb')](_0x1126('0xe'),auth[_0x1126('0xc')](),controller['show']);router[_0x1126('0xf')]('/',auth[_0x1126('0xc')](),controller[_0x1126('0x10')]);router['put'](_0x1126('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x1126('0x11')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0x12')]);module[_0x1126('0x13')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 7a0619f..727d2bd 100644 --- a/server/api/integrationReport/integrationReport.attributes.js +++ b/server/api/integrationReport/integrationReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe46c=['INTEGER','DATE','BOOLEAN','TEXT','ENUM','FAILED','exports','STRING'];(function(_0x224012,_0x293e50){var _0x544142=function(_0x5f0835){while(--_0x5f0835){_0x224012['push'](_0x224012['shift']());}};_0x544142(++_0x293e50);}(_0xe46c,0x16e));var _0xce46=function(_0x7b707,_0xb39872){_0x7b707=_0x7b707-0x0;var _0x512cf6=_0xe46c[_0x7b707];return _0x512cf6;};'use strict';var Sequelize=require('sequelize');module[_0xce46('0x0')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0xce46('0x1')]},'exitStatus':{'type':Sequelize[_0xce46('0x1')]},'ticketId':{'type':Sequelize[_0xce46('0x1')]},'integrationId':{'type':Sequelize[_0xce46('0x2')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xce46('0x1')]},'calleridnum':{'type':Sequelize[_0xce46('0x1')]},'calleridname':{'type':Sequelize[_0xce46('0x1')]},'queue':{'type':Sequelize[_0xce46('0x1')]},'interface':{'type':Sequelize[_0xce46('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xce46('0x3')]},'agentconnectAt':{'type':Sequelize[_0xce46('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xce46('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0xce46('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xce46('0x2')]},'reason':{'type':Sequelize[_0xce46('0x1')]},'agentringnoanswer':{'type':Sequelize[_0xce46('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xce46('0x3')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xce46('0x3')]},'lastevent':{'type':Sequelize[_0xce46('0x1')]},'channel':{'type':Sequelize[_0xce46('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xce46('0x1')]},'connectedlinenum':{'type':Sequelize[_0xce46('0x1')]},'connectedlinename':{'type':Sequelize[_0xce46('0x1')]},'language':{'type':Sequelize[_0xce46('0x1')]},'accountcode':{'type':Sequelize[_0xce46('0x1')]},'context':{'type':Sequelize[_0xce46('0x1')]},'exten':{'type':Sequelize[_0xce46('0x1')]},'priority':{'type':Sequelize[_0xce46('0x1')]},'destchannel':{'type':Sequelize[_0xce46('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xce46('0x1')]},'destcalleridnum':{'type':Sequelize[_0xce46('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xce46('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xce46('0x1')]},'destaccountcode':{'type':Sequelize[_0xce46('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xce46('0x1')]},'destpriority':{'type':Sequelize[_0xce46('0x1')]},'destuniqueid':{'type':Sequelize[_0xce46('0x1')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xce46('0x1')]},'subject':{'type':Sequelize[_0xce46('0x1')]},'from':{'type':Sequelize[_0xce46('0x1')]},'to':{'type':Sequelize[_0xce46('0x1')]},'cc':{'type':Sequelize[_0xce46('0x1')]},'attachment':{'type':Sequelize[_0xce46('0x5')]},'html':{'type':Sequelize[_0xce46('0x5')]},'text':{'type':Sequelize[_0xce46('0x5')]},'status':{'type':Sequelize[_0xce46('0x6')]('SENT','SENDING','RECEIVED',_0xce46('0x7'))},'url':{'type':Sequelize[_0xce46('0x1')]},'app':{'type':Sequelize[_0xce46('0x1')]},'appdata':{'type':Sequelize[_0xce46('0x1')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xd71a=['ENUM','SENT','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT'];(function(_0x57f2c7,_0x316830){var _0x305eed=function(_0x224c2b){while(--_0x224c2b){_0x57f2c7['push'](_0x57f2c7['shift']());}};_0x305eed(++_0x316830);}(_0xd71a,0xe0));var _0xad71=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xd71a[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0xad71('0x0'));module[_0xad71('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0xad71('0x2')]},'integrationId':{'type':Sequelize[_0xad71('0x3')]},'contacts':{'type':Sequelize[_0xad71('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xad71('0x2')]},'calleridname':{'type':Sequelize[_0xad71('0x2')]},'queue':{'type':Sequelize[_0xad71('0x2')]},'interface':{'type':Sequelize[_0xad71('0x2')]},'membername':{'type':Sequelize[_0xad71('0x2')]},'agentcalledAt':{'type':Sequelize[_0xad71('0x4')]},'agentconnectAt':{'type':Sequelize[_0xad71('0x4')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xad71('0x4')]},'talktime':{'type':Sequelize[_0xad71('0x3')]},'agentacw':{'type':Sequelize[_0xad71('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xad71('0x3')]},'reason':{'type':Sequelize[_0xad71('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xad71('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xad71('0x4')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xad71('0x4')]},'lastevent':{'type':Sequelize[_0xad71('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xad71('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xad71('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xad71('0x2')]},'context':{'type':Sequelize[_0xad71('0x2')]},'exten':{'type':Sequelize[_0xad71('0x2')]},'priority':{'type':Sequelize[_0xad71('0x2')]},'destchannel':{'type':Sequelize[_0xad71('0x2')]},'destchannelstate':{'type':Sequelize[_0xad71('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xad71('0x2')]},'destcalleridnum':{'type':Sequelize[_0xad71('0x2')]},'destcalleridname':{'type':Sequelize[_0xad71('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xad71('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xad71('0x2')]},'destlanguage':{'type':Sequelize[_0xad71('0x2')]},'destaccountcode':{'type':Sequelize[_0xad71('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xad71('0x2')]},'destpriority':{'type':Sequelize[_0xad71('0x2')]},'destuniqueid':{'type':Sequelize[_0xad71('0x2')]},'messageId':{'type':Sequelize[_0xad71('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0xad71('0x2')]},'from':{'type':Sequelize[_0xad71('0x2')]},'to':{'type':Sequelize[_0xad71('0x2')]},'cc':{'type':Sequelize[_0xad71('0x2')]},'attachment':{'type':Sequelize[_0xad71('0x6')]},'html':{'type':Sequelize[_0xad71('0x6')]},'text':{'type':Sequelize[_0xad71('0x6')]},'status':{'type':Sequelize[_0xad71('0x7')](_0xad71('0x8'),'SENDING',_0xad71('0x9'),_0xad71('0xa'))},'url':{'type':Sequelize[_0xad71('0x2')]},'app':{'type':Sequelize[_0xad71('0x2')]},'appdata':{'type':Sequelize[_0xad71('0x2')]},'projectId':{'type':Sequelize[_0xad71('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 49934fe..263c81a 100644 --- a/server/api/integrationReport/integrationReport.controller.js +++ b/server/api/integrationReport/integrationReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6c46=['options','includeAll','include','findAll','rows','catch','IntegrationReport','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6c46,0x138));var _0x66c4=function(_0x3fb3f9,_0x204379){_0x3fb3f9=_0x3fb3f9-0x0;var _0x35f8f7=_0x6c46[_0x3fb3f9];return _0x35f8f7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x66c4('0x0'));var zipdir=require(_0x66c4('0x1'));var jsonpatch=require(_0x66c4('0x2'));var rp=require(_0x66c4('0x3'));var moment=require(_0x66c4('0x4'));var BPromise=require(_0x66c4('0x5'));var Mustache=require('mustache');var util=require(_0x66c4('0x6'));var path=require(_0x66c4('0x7'));var sox=require('sox');var csv=require(_0x66c4('0x8'));var ejs=require(_0x66c4('0x9'));var fs=require('fs');var fs_extra=require(_0x66c4('0xa'));var _=require(_0x66c4('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x66c4('0xc'));var deskjs=require(_0x66c4('0xd'));var toCsv=require(_0x66c4('0x8'));var querystring=require(_0x66c4('0xe'));var Papa=require(_0x66c4('0xf'));var Redis=require(_0x66c4('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x66c4('0x11'));var logger=require(_0x66c4('0x12'))(_0x66c4('0x13'));var utils=require(_0x66c4('0x14'));var config=require(_0x66c4('0x15'));var licenseUtil=require(_0x66c4('0x16'));var db=require(_0x66c4('0x17'))['db'];function respondWithStatusCode(_0x53ba8d,_0x109205){_0x109205=_0x109205||0xcc;return function(_0x24461d){if(_0x24461d){return _0x53ba8d[_0x66c4('0x18')](_0x109205);}return _0x53ba8d['status'](_0x109205)[_0x66c4('0x19')]();};}function respondWithResult(_0x322377,_0x2b79d0){_0x2b79d0=_0x2b79d0||0xc8;return function(_0x3b5518){if(_0x3b5518){return _0x322377[_0x66c4('0x1a')](_0x2b79d0)[_0x66c4('0x1b')](_0x3b5518);}};}function respondWithFilteredResult(_0x4c8a44,_0x2026d4){return function(_0xe4b5a9){if(_0xe4b5a9){var _0x555103=typeof _0x2026d4['offset']===_0x66c4('0x1c')&&typeof _0x2026d4[_0x66c4('0x1d')]===_0x66c4('0x1c');var _0x20f66e=_0xe4b5a9['count'];var _0x4f8b46=_0x555103?0x0:_0x2026d4[_0x66c4('0x1e')];var _0x45517d=_0x555103?_0xe4b5a9[_0x66c4('0x1f')]:_0x2026d4[_0x66c4('0x1e')]+_0x2026d4[_0x66c4('0x1d')];var _0x119643;if(_0x45517d>=_0x20f66e){_0x45517d=_0x20f66e;_0x119643=0xc8;}else{_0x119643=0xce;}_0x4c8a44[_0x66c4('0x1a')](_0x119643);return _0x4c8a44['set'](_0x66c4('0x20'),_0x4f8b46+'-'+_0x45517d+'/'+_0x20f66e)[_0x66c4('0x1b')](_0xe4b5a9);}return null;};}function patchUpdates(_0x57856a){return function(_0x1f00c6){try{jsonpatch[_0x66c4('0x21')](_0x1f00c6,_0x57856a,!![]);}catch(_0x321e58){return BPromise[_0x66c4('0x22')](_0x321e58);}return _0x1f00c6[_0x66c4('0x23')]();};}function saveUpdates(_0x44c92a,_0x5e39c2){return function(_0x326210){if(_0x326210){return _0x326210[_0x66c4('0x24')](_0x44c92a)[_0x66c4('0x25')](function(_0x36a119){return _0x36a119;});}return null;};}function removeEntity(_0x56a96f,_0x4ab971){return function(_0x1c50da){if(_0x1c50da){return _0x1c50da[_0x66c4('0x26')]()[_0x66c4('0x25')](function(){_0x56a96f['status'](0xcc)[_0x66c4('0x19')]();});}};}function handleEntityNotFound(_0x26cc59,_0x15491c){return function(_0x486f3a){if(!_0x486f3a){_0x26cc59[_0x66c4('0x18')](0x194);}return _0x486f3a;};}function handleError(_0x25bf17,_0x171b48){_0x171b48=_0x171b48||0x1f4;return function(_0x4f0955){logger['error'](_0x4f0955[_0x66c4('0x27')]);if(_0x4f0955[_0x66c4('0x28')]){delete _0x4f0955[_0x66c4('0x28')];}_0x25bf17[_0x66c4('0x1a')](_0x171b48)['send'](_0x4f0955);};}exports[_0x66c4('0x29')]=function(_0xca4948,_0x282e1b){var _0x38a395={},_0x438c15={},_0x3adcfa={'count':0x0,'rows':[]};var _0x216eb8=_[_0x66c4('0x2a')](db['IntegrationReport'][_0x66c4('0x2b')],function(_0x552cfa){return{'name':_0x552cfa[_0x66c4('0x2c')],'type':_0x552cfa[_0x66c4('0x2d')][_0x66c4('0x2e')]};});_0x438c15[_0x66c4('0x2f')]=_[_0x66c4('0x2a')](_0x216eb8,'name');_0x438c15[_0x66c4('0x30')]=_[_0x66c4('0x31')](_0xca4948['query']);_0x438c15[_0x66c4('0x32')]=_[_0x66c4('0x33')](_0x438c15[_0x66c4('0x2f')],_0x438c15[_0x66c4('0x30')]);_0x38a395[_0x66c4('0x34')]=_[_0x66c4('0x33')](_0x438c15['model'],qs['fields'](_0xca4948[_0x66c4('0x30')][_0x66c4('0x35')]));_0x38a395[_0x66c4('0x34')]=_0x38a395[_0x66c4('0x34')][_0x66c4('0x36')]?_0x38a395[_0x66c4('0x34')]:_0x438c15[_0x66c4('0x2f')];if(!_0xca4948['query'][_0x66c4('0x37')]('nolimit')){_0x38a395[_0x66c4('0x1d')]=qs['limit'](_0xca4948[_0x66c4('0x30')][_0x66c4('0x1d')]);_0x38a395['offset']=qs['offset'](_0xca4948[_0x66c4('0x30')]['offset']);}_0x38a395[_0x66c4('0x38')]=qs['sort'](_0xca4948['query'][_0x66c4('0x39')]);_0x38a395[_0x66c4('0x3a')]=qs[_0x66c4('0x32')](_[_0x66c4('0x3b')](_0xca4948['query'],_0x438c15[_0x66c4('0x32')]),_0x216eb8);if(_0xca4948[_0x66c4('0x30')][_0x66c4('0x3c')]){_0x38a395['where']=_[_0x66c4('0x3d')](_0x38a395['where'],{'$or':_[_0x66c4('0x2a')](_0x216eb8,function(_0xbd62ab){if(_0xbd62ab[_0x66c4('0x2d')]!==_0x66c4('0x3e')){var _0x16fce2={};_0x16fce2[_0xbd62ab[_0x66c4('0x28')]]={'$like':'%'+_0xca4948[_0x66c4('0x30')][_0x66c4('0x3c')]+'%'};return _0x16fce2;}})});}_0x38a395=_[_0x66c4('0x3d')]({},_0x38a395,_0xca4948[_0x66c4('0x3f')]);var _0x3b737e={'where':_0x38a395[_0x66c4('0x3a')]};return db['IntegrationReport'][_0x66c4('0x1f')](_0x3b737e)['then'](function(_0x152bb9){_0x3adcfa['count']=_0x152bb9;if(_0xca4948['query'][_0x66c4('0x40')]){_0x38a395[_0x66c4('0x41')]=[{'all':!![]}];}return db['IntegrationReport'][_0x66c4('0x42')](_0x38a395);})[_0x66c4('0x25')](function(_0x5eef7c){_0x3adcfa[_0x66c4('0x43')]=_0x5eef7c;return _0x3adcfa;})[_0x66c4('0x25')](respondWithFilteredResult(_0x282e1b,_0x38a395))[_0x66c4('0x44')](handleError(_0x282e1b,null));};exports['show']=function(_0x1d8376,_0x512fcc){var _0x138e02={'raw':![],'where':{'id':_0x1d8376['params']['id']}},_0x1de268={};_0x1de268[_0x66c4('0x2f')]=_[_0x66c4('0x31')](db[_0x66c4('0x45')]['rawAttributes']);_0x1de268['query']=_['keys'](_0x1d8376[_0x66c4('0x30')]);_0x1de268[_0x66c4('0x32')]=_[_0x66c4('0x33')](_0x1de268['model'],_0x1de268[_0x66c4('0x30')]);_0x138e02[_0x66c4('0x34')]=_[_0x66c4('0x33')](_0x1de268[_0x66c4('0x2f')],qs['fields'](_0x1d8376[_0x66c4('0x30')][_0x66c4('0x35')]));_0x138e02['attributes']=_0x138e02[_0x66c4('0x34')]['length']?_0x138e02[_0x66c4('0x34')]:_0x1de268[_0x66c4('0x2f')];if(_0x1d8376[_0x66c4('0x30')][_0x66c4('0x40')]){_0x138e02[_0x66c4('0x41')]=[{'all':!![]}];}_0x138e02=_[_0x66c4('0x3d')]({},_0x138e02,_0x1d8376[_0x66c4('0x3f')]);return db[_0x66c4('0x45')][_0x66c4('0x46')](_0x138e02)['then'](handleEntityNotFound(_0x512fcc,null))[_0x66c4('0x25')](respondWithResult(_0x512fcc,null))[_0x66c4('0x44')](handleError(_0x512fcc,null));};exports[_0x66c4('0x47')]=function(_0x4fdf19,_0x4a38b7){return db[_0x66c4('0x45')][_0x66c4('0x47')](_0x4fdf19[_0x66c4('0x48')],{})[_0x66c4('0x25')](respondWithResult(_0x4a38b7,0xc9))[_0x66c4('0x44')](handleError(_0x4a38b7,null));};exports[_0x66c4('0x24')]=function(_0x1127c4,_0x1a71d5){if(_0x1127c4['body']['id']){delete _0x1127c4['body']['id'];}return db[_0x66c4('0x45')][_0x66c4('0x46')]({'where':{'id':_0x1127c4['params']['id']}})['then'](handleEntityNotFound(_0x1a71d5,null))[_0x66c4('0x25')](saveUpdates(_0x1127c4[_0x66c4('0x48')],null))[_0x66c4('0x25')](respondWithResult(_0x1a71d5,null))[_0x66c4('0x44')](handleError(_0x1a71d5,null));};exports[_0x66c4('0x26')]=function(_0x24756e,_0x53d5d6){return db['IntegrationReport'][_0x66c4('0x46')]({'where':{'id':_0x24756e[_0x66c4('0x49')]['id']}})[_0x66c4('0x25')](handleEntityNotFound(_0x53d5d6,null))[_0x66c4('0x25')](removeEntity(_0x53d5d6,null))['catch'](handleError(_0x53d5d6,null));};exports['describe']=function(_0x49731c,_0x3a3347){return db[_0x66c4('0x45')][_0x66c4('0x4a')]()[_0x66c4('0x25')](respondWithResult(_0x3a3347,null))['catch'](handleError(_0x3a3347,null));}; \ No newline at end of file +var _0xd4a2=['nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','findAll','rows','catch','length','include','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','sendStatus','error','name','send','index','map','IntegrationReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty'];(function(_0x11649d,_0x44bd8e){var _0x466f8d=function(_0x527afb){while(--_0x527afb){_0x11649d['push'](_0x11649d['shift']());}};_0x466f8d(++_0x44bd8e);}(_0xd4a2,0x143));var _0x2d4a=function(_0x5ac8dd,_0x1ab467){_0x5ac8dd=_0x5ac8dd-0x0;var _0x4d9e48=_0xd4a2[_0x5ac8dd];return _0x4d9e48;};'use strict';var emlformat=require(_0x2d4a('0x0'));var rimraf=require(_0x2d4a('0x1'));var zipdir=require(_0x2d4a('0x2'));var jsonpatch=require(_0x2d4a('0x3'));var rp=require('request-promise');var moment=require(_0x2d4a('0x4'));var BPromise=require(_0x2d4a('0x5'));var Mustache=require(_0x2d4a('0x6'));var util=require(_0x2d4a('0x7'));var path=require('path');var sox=require(_0x2d4a('0x8'));var csv=require(_0x2d4a('0x9'));var ejs=require(_0x2d4a('0xa'));var fs=require('fs');var fs_extra=require(_0x2d4a('0xb'));var _=require('lodash');var squel=require(_0x2d4a('0xc'));var crypto=require(_0x2d4a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2d4a('0xe'));var toCsv=require(_0x2d4a('0x9'));var querystring=require(_0x2d4a('0xf'));var Papa=require(_0x2d4a('0x10'));var Redis=require(_0x2d4a('0x11'));var authService=require(_0x2d4a('0x12'));var qs=require(_0x2d4a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2d4a('0x14'))(_0x2d4a('0x15'));var utils=require(_0x2d4a('0x16'));var config=require(_0x2d4a('0x17'));var licenseUtil=require(_0x2d4a('0x18'));var db=require(_0x2d4a('0x19'))['db'];function respondWithStatusCode(_0x26a465,_0x13e395){_0x13e395=_0x13e395||0xcc;return function(_0x16d6e7){if(_0x16d6e7){return _0x26a465['sendStatus'](_0x13e395);}return _0x26a465[_0x2d4a('0x1a')](_0x13e395)[_0x2d4a('0x1b')]();};}function respondWithResult(_0x3825bd,_0xba7b49){_0xba7b49=_0xba7b49||0xc8;return function(_0x993129){if(_0x993129){return _0x3825bd['status'](_0xba7b49)[_0x2d4a('0x1c')](_0x993129);}};}function respondWithFilteredResult(_0x24c3c3,_0xbc83f4){return function(_0x3f6bf1){if(_0x3f6bf1){var _0x8648c5=typeof _0xbc83f4[_0x2d4a('0x1d')]===_0x2d4a('0x1e')&&typeof _0xbc83f4[_0x2d4a('0x1f')]===_0x2d4a('0x1e');var _0x4a5940=_0x3f6bf1[_0x2d4a('0x20')];var _0x5dad84=_0x8648c5?0x0:_0xbc83f4['offset'];var _0x5a1ed9=_0x8648c5?_0x3f6bf1[_0x2d4a('0x20')]:_0xbc83f4[_0x2d4a('0x1d')]+_0xbc83f4[_0x2d4a('0x1f')];var _0x222e66;if(_0x5a1ed9>=_0x4a5940){_0x5a1ed9=_0x4a5940;_0x222e66=0xc8;}else{_0x222e66=0xce;}_0x24c3c3['status'](_0x222e66);return _0x24c3c3['set'](_0x2d4a('0x21'),_0x5dad84+'-'+_0x5a1ed9+'/'+_0x4a5940)[_0x2d4a('0x1c')](_0x3f6bf1);}return null;};}function patchUpdates(_0x7c51d){return function(_0xd24985){try{jsonpatch[_0x2d4a('0x22')](_0xd24985,_0x7c51d,!![]);}catch(_0x36eb6d){return BPromise[_0x2d4a('0x23')](_0x36eb6d);}return _0xd24985[_0x2d4a('0x24')]();};}function saveUpdates(_0x3fa750,_0x463ff2){return function(_0xbd9ec2){if(_0xbd9ec2){return _0xbd9ec2[_0x2d4a('0x25')](_0x3fa750)[_0x2d4a('0x26')](function(_0x3eb7bf){return _0x3eb7bf;});}return null;};}function removeEntity(_0x4d519f,_0x1192d8){return function(_0xb99564){if(_0xb99564){return _0xb99564['destroy']()[_0x2d4a('0x26')](function(){_0x4d519f[_0x2d4a('0x1a')](0xcc)[_0x2d4a('0x1b')]();});}};}function handleEntityNotFound(_0x3205d0,_0x3758a5){return function(_0x16591f){if(!_0x16591f){_0x3205d0[_0x2d4a('0x27')](0x194);}return _0x16591f;};}function handleError(_0x414b0c,_0x84861b){_0x84861b=_0x84861b||0x1f4;return function(_0x21334b){logger[_0x2d4a('0x28')](_0x21334b['stack']);if(_0x21334b[_0x2d4a('0x29')]){delete _0x21334b[_0x2d4a('0x29')];}_0x414b0c[_0x2d4a('0x1a')](_0x84861b)[_0x2d4a('0x2a')](_0x21334b);};}exports[_0x2d4a('0x2b')]=function(_0x502715,_0x18fc07){var _0xa53f9d={},_0x1fb1de={},_0x5d16ee={'count':0x0,'rows':[]};var _0x553e08=_[_0x2d4a('0x2c')](db[_0x2d4a('0x2d')][_0x2d4a('0x2e')],function(_0x1d3f02){return{'name':_0x1d3f02[_0x2d4a('0x2f')],'type':_0x1d3f02[_0x2d4a('0x30')][_0x2d4a('0x31')]};});_0x1fb1de[_0x2d4a('0x32')]=_[_0x2d4a('0x2c')](_0x553e08,_0x2d4a('0x29'));_0x1fb1de[_0x2d4a('0x33')]=_[_0x2d4a('0x34')](_0x502715['query']);_0x1fb1de['filters']=_[_0x2d4a('0x35')](_0x1fb1de[_0x2d4a('0x32')],_0x1fb1de[_0x2d4a('0x33')]);_0xa53f9d['attributes']=_['intersection'](_0x1fb1de[_0x2d4a('0x32')],qs[_0x2d4a('0x36')](_0x502715[_0x2d4a('0x33')]['fields']));_0xa53f9d['attributes']=_0xa53f9d[_0x2d4a('0x37')]['length']?_0xa53f9d['attributes']:_0x1fb1de[_0x2d4a('0x32')];if(!_0x502715['query'][_0x2d4a('0x38')](_0x2d4a('0x39'))){_0xa53f9d[_0x2d4a('0x1f')]=qs[_0x2d4a('0x1f')](_0x502715[_0x2d4a('0x33')][_0x2d4a('0x1f')]);_0xa53f9d['offset']=qs[_0x2d4a('0x1d')](_0x502715['query'][_0x2d4a('0x1d')]);}_0xa53f9d[_0x2d4a('0x3a')]=qs['sort'](_0x502715[_0x2d4a('0x33')][_0x2d4a('0x3b')]);_0xa53f9d[_0x2d4a('0x3c')]=qs[_0x2d4a('0x3d')](_[_0x2d4a('0x3e')](_0x502715['query'],_0x1fb1de[_0x2d4a('0x3d')]),_0x553e08);if(_0x502715[_0x2d4a('0x33')][_0x2d4a('0x3f')]){_0xa53f9d[_0x2d4a('0x3c')]=_[_0x2d4a('0x40')](_0xa53f9d[_0x2d4a('0x3c')],{'$or':_[_0x2d4a('0x2c')](_0x553e08,function(_0x373192){if(_0x373192[_0x2d4a('0x30')]!=='VIRTUAL'){var _0x21770e={};_0x21770e[_0x373192['name']]={'$like':'%'+_0x502715[_0x2d4a('0x33')]['filter']+'%'};return _0x21770e;}})});}_0xa53f9d=_['merge']({},_0xa53f9d,_0x502715[_0x2d4a('0x41')]);var _0x10bf8e={'where':_0xa53f9d[_0x2d4a('0x3c')]};return db[_0x2d4a('0x2d')][_0x2d4a('0x20')](_0x10bf8e)[_0x2d4a('0x26')](function(_0xfb81ed){_0x5d16ee[_0x2d4a('0x20')]=_0xfb81ed;if(_0x502715['query'][_0x2d4a('0x42')]){_0xa53f9d['include']=[{'all':!![]}];}return db['IntegrationReport'][_0x2d4a('0x43')](_0xa53f9d);})[_0x2d4a('0x26')](function(_0x4195b9){_0x5d16ee[_0x2d4a('0x44')]=_0x4195b9;return _0x5d16ee;})[_0x2d4a('0x26')](respondWithFilteredResult(_0x18fc07,_0xa53f9d))[_0x2d4a('0x45')](handleError(_0x18fc07,null));};exports['show']=function(_0x354694,_0x34c905){var _0x5becf1={'raw':![],'where':{'id':_0x354694['params']['id']}},_0x361405={};_0x361405[_0x2d4a('0x32')]=_['keys'](db[_0x2d4a('0x2d')][_0x2d4a('0x2e')]);_0x361405['query']=_[_0x2d4a('0x34')](_0x354694[_0x2d4a('0x33')]);_0x361405['filters']=_[_0x2d4a('0x35')](_0x361405[_0x2d4a('0x32')],_0x361405[_0x2d4a('0x33')]);_0x5becf1['attributes']=_['intersection'](_0x361405[_0x2d4a('0x32')],qs[_0x2d4a('0x36')](_0x354694[_0x2d4a('0x33')][_0x2d4a('0x36')]));_0x5becf1['attributes']=_0x5becf1[_0x2d4a('0x37')][_0x2d4a('0x46')]?_0x5becf1[_0x2d4a('0x37')]:_0x361405[_0x2d4a('0x32')];if(_0x354694[_0x2d4a('0x33')][_0x2d4a('0x42')]){_0x5becf1[_0x2d4a('0x47')]=[{'all':!![]}];}_0x5becf1=_[_0x2d4a('0x40')]({},_0x5becf1,_0x354694[_0x2d4a('0x41')]);return db[_0x2d4a('0x2d')]['find'](_0x5becf1)[_0x2d4a('0x26')](handleEntityNotFound(_0x34c905,null))[_0x2d4a('0x26')](respondWithResult(_0x34c905,null))['catch'](handleError(_0x34c905,null));};exports[_0x2d4a('0x48')]=function(_0x23ff50,_0x5306db){return db[_0x2d4a('0x2d')][_0x2d4a('0x48')](_0x23ff50[_0x2d4a('0x49')],{})[_0x2d4a('0x26')](respondWithResult(_0x5306db,0xc9))[_0x2d4a('0x45')](handleError(_0x5306db,null));};exports['update']=function(_0x12523d,_0x4c2cdd){if(_0x12523d[_0x2d4a('0x49')]['id']){delete _0x12523d[_0x2d4a('0x49')]['id'];}return db[_0x2d4a('0x2d')][_0x2d4a('0x4a')]({'where':{'id':_0x12523d['params']['id']}})[_0x2d4a('0x26')](handleEntityNotFound(_0x4c2cdd,null))['then'](saveUpdates(_0x12523d[_0x2d4a('0x49')],null))[_0x2d4a('0x26')](respondWithResult(_0x4c2cdd,null))[_0x2d4a('0x45')](handleError(_0x4c2cdd,null));};exports[_0x2d4a('0x4b')]=function(_0x3ac130,_0x542cae){return db[_0x2d4a('0x2d')][_0x2d4a('0x4a')]({'where':{'id':_0x3ac130['params']['id']}})[_0x2d4a('0x26')](handleEntityNotFound(_0x542cae,null))[_0x2d4a('0x26')](removeEntity(_0x542cae,null))[_0x2d4a('0x45')](handleError(_0x542cae,null));};exports['describe']=function(_0x30f525,_0x16a7f2){return db[_0x2d4a('0x2d')]['describe']()['then'](respondWithResult(_0x16a7f2,null))[_0x2d4a('0x45')](handleError(_0x16a7f2,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index a21e20a..9f2e23b 100644 --- a/server/api/integrationReport/integrationReport.model.js +++ b/server/api/integrationReport/integrationReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x617a=['util','api','moment','bluebird','path','rimraf','./integrationReport.attributes','define','IntegrationReport','report_integration','lodash'];(function(_0x3b6246,_0x40eb29){var _0x4cd3fb=function(_0x14ab06){while(--_0x14ab06){_0x3b6246['push'](_0x3b6246['shift']());}};_0x4cd3fb(++_0x40eb29);}(_0x617a,0x107));var _0xa617=function(_0x3041ce,_0x382f98){_0x3041ce=_0x3041ce-0x0;var _0x68a7f9=_0x617a[_0x3041ce];return _0x68a7f9;};'use strict';var _=require(_0xa617('0x0'));var util=require(_0xa617('0x1'));var logger=require('../../config/logger')(_0xa617('0x2'));var moment=require(_0xa617('0x3'));var BPromise=require(_0xa617('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa617('0x5'));var rimraf=require(_0xa617('0x6'));var config=require('../../config/environment');var attributes=require(_0xa617('0x7'));module['exports']=function(_0x2f9afd,_0x34e39f){return _0x2f9afd[_0xa617('0x8')](_0xa617('0x9'),attributes,{'tableName':_0xa617('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x10d6=['define','IntegrationReport','report_integration','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./integrationReport.attributes'];(function(_0x2b6593,_0x2c5e04){var _0x59ccf4=function(_0x371d5e){while(--_0x371d5e){_0x2b6593['push'](_0x2b6593['shift']());}};_0x59ccf4(++_0x2c5e04);}(_0x10d6,0xe7));var _0x610d=function(_0x138e51,_0x432500){_0x138e51=_0x138e51-0x0;var _0x536000=_0x10d6[_0x138e51];return _0x536000;};'use strict';var _=require(_0x610d('0x0'));var util=require(_0x610d('0x1'));var logger=require(_0x610d('0x2'))(_0x610d('0x3'));var moment=require(_0x610d('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x610d('0x5'));var rimraf=require(_0x610d('0x6'));var config=require(_0x610d('0x7'));var attributes=require(_0x610d('0x8'));module['exports']=function(_0x174fcf,_0x2bd4bc){return _0x174fcf[_0x610d('0x9')](_0x610d('0xa'),attributes,{'tableName':_0x610d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index 3696407..bd84d0b 100644 --- a/server/api/integrationReport/integrationReport.rpc.js +++ b/server/api/integrationReport/integrationReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc2c7=['../../config/logger','jayson/promise','client','http','request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xc2c7,0x134));var _0x7c2c=function(_0x3cace3,_0x1a33b0){_0x3cace3=_0x3cace3-0x0;var _0x599df2=_0xc2c7[_0x3cace3];return _0x599df2;};'use strict';var _=require('lodash');var util=require(_0x7c2c('0x0'));var moment=require(_0x7c2c('0x1'));var BPromise=require(_0x7c2c('0x2'));var rs=require(_0x7c2c('0x3'));var fs=require('fs');var Redis=require(_0x7c2c('0x4'));var db=require(_0x7c2c('0x5'))['db'];var utils=require(_0x7c2c('0x6'));var logger=require(_0x7c2c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7c2c('0x8'));var client=jayson[_0x7c2c('0x9')][_0x7c2c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54f027,_0x4abe93,_0x5a1027){return new BPromise(function(_0x2274cd,_0x29638d){return client[_0x7c2c('0xb')](_0x54f027,_0x5a1027)[_0x7c2c('0xc')](function(_0x279cff){logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));logger[_0x7c2c('0xf')](_0x7c2c('0x10'),_0x4abe93,_0x7c2c('0xe'),JSON[_0x7c2c('0x11')](_0x279cff));if(_0x279cff[_0x7c2c('0x12')]){if(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x13')]===0x1f4){logger[_0x7c2c('0x12')](_0x7c2c('0xd'),_0x4abe93,_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);return _0x29638d(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}logger[_0x7c2c('0x12')]('IntegrationReport,\x20%s,\x20%s',_0x4abe93,_0x279cff['error'][_0x7c2c('0x14')]);return _0x2274cd(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}else{logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));_0x2274cd(_0x279cff['result'][_0x7c2c('0x14')]);}})['catch'](function(_0x1aa355){logger['error'](_0x7c2c('0xd'),_0x4abe93,_0x1aa355);_0x29638d(_0x1aa355);});});} \ No newline at end of file +var _0x187d=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x25f0d8,_0x3f1b70){var _0x2a2869=function(_0x487293){while(--_0x487293){_0x25f0d8['push'](_0x25f0d8['shift']());}};_0x2a2869(++_0x3f1b70);}(_0x187d,0x93));var _0xd187=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x187d[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var moment=require(_0xd187('0x1'));var BPromise=require(_0xd187('0x2'));var rs=require(_0xd187('0x3'));var fs=require('fs');var Redis=require(_0xd187('0x4'));var db=require(_0xd187('0x5'))['db'];var utils=require(_0xd187('0x6'));var logger=require('../../config/logger')(_0xd187('0x7'));var config=require(_0xd187('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd187('0x9')][_0xd187('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x444a60,_0x1d3fe4,_0x28ce2f){return new BPromise(function(_0x2d6992,_0x358c45){return client[_0xd187('0xb')](_0x444a60,_0x28ce2f)['then'](function(_0x342539){logger[_0xd187('0xc')](_0xd187('0xd'),_0x1d3fe4,_0xd187('0xe'));logger[_0xd187('0xf')](_0xd187('0x10'),_0x1d3fe4,'request\x20sent',JSON[_0xd187('0x11')](_0x342539));if(_0x342539[_0xd187('0x12')]){if(_0x342539[_0xd187('0x12')]['code']===0x1f4){logger[_0xd187('0x12')](_0xd187('0xd'),_0x1d3fe4,_0x342539[_0xd187('0x12')]['message']);return _0x358c45(_0x342539[_0xd187('0x12')][_0xd187('0x13')]);}logger[_0xd187('0x12')](_0xd187('0xd'),_0x1d3fe4,_0x342539['error'][_0xd187('0x13')]);return _0x2d6992(_0x342539[_0xd187('0x12')][_0xd187('0x13')]);}else{logger[_0xd187('0xc')]('IntegrationReport,\x20%s,\x20%s',_0x1d3fe4,_0xd187('0xe'));_0x2d6992(_0x342539['result']['message']);}})[_0xd187('0x14')](function(_0x5a4986){logger['error'](_0xd187('0xd'),_0x1d3fe4,_0x5a4986);_0x358c45(_0x5a4986);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 880e3a6..bb32f8b 100644 --- a/server/api/interval/index.js +++ b/server/api/interval/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6927=['../../config/environment','./interval.controller','get','index','isAuthenticated','show','/:id/sub_intervals','post','create','addInterval','addIntervals','put','/:id','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x27384a,_0x102ead){var _0x3856fe=function(_0x166a91){while(--_0x166a91){_0x27384a['push'](_0x27384a['shift']());}};_0x3856fe(++_0x102ead);}(_0x6927,0xf6));var _0x7692=function(_0x3a22ff,_0x55f65b){_0x3a22ff=_0x3a22ff-0x0;var _0xae5a08=_0x6927[_0x3a22ff];return _0xae5a08;};'use strict';var multer=require(_0x7692('0x0'));var util=require('util');var path=require(_0x7692('0x1'));var timeout=require(_0x7692('0x2'));var express=require(_0x7692('0x3'));var router=express[_0x7692('0x4')]();var fs_extra=require(_0x7692('0x5'));var auth=require(_0x7692('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7692('0x7'));var controller=require(_0x7692('0x8'));router[_0x7692('0x9')]('/',auth['isAuthenticated'](),controller[_0x7692('0xa')]);router[_0x7692('0x9')]('/:id',auth[_0x7692('0xb')](),controller[_0x7692('0xc')]);router[_0x7692('0x9')](_0x7692('0xd'),auth[_0x7692('0xb')](),controller['getIntervals']);router[_0x7692('0xe')]('/',auth[_0x7692('0xb')](),controller[_0x7692('0xf')]);router[_0x7692('0xe')](_0x7692('0xd'),auth['isAuthenticated'](),controller[_0x7692('0x10')]);router[_0x7692('0xe')]('/:id/sub_intervals/create_many',auth['isAuthenticated'](),controller[_0x7692('0x11')]);router[_0x7692('0x12')](_0x7692('0x13'),auth[_0x7692('0xb')](),controller[_0x7692('0x14')]);router[_0x7692('0x15')](_0x7692('0x13'),auth[_0x7692('0xb')](),controller[_0x7692('0x16')]);module['exports']=router; \ No newline at end of file +var _0xf2ca=['/:id/sub_intervals','getIntervals','create','post','/:id/sub_intervals/create_many','addIntervals','put','update','delete','/:id','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show'];(function(_0x20d33d,_0x51b6be){var _0x10715=function(_0x56bc53){while(--_0x56bc53){_0x20d33d['push'](_0x20d33d['shift']());}};_0x10715(++_0x51b6be);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x2ea4f0,_0x420118){_0x2ea4f0=_0x2ea4f0-0x0;var _0x5c5877=_0xf2ca[_0x2ea4f0];return _0x5c5877;};'use strict';var multer=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var path=require(_0xaf2c('0x2'));var timeout=require('connect-timeout');var express=require(_0xaf2c('0x3'));var router=express[_0xaf2c('0x4')]();var fs_extra=require(_0xaf2c('0x5'));var auth=require(_0xaf2c('0x6'));var interaction=require(_0xaf2c('0x7'));var config=require(_0xaf2c('0x8'));var controller=require('./interval.controller');router[_0xaf2c('0x9')]('/',auth[_0xaf2c('0xa')](),controller[_0xaf2c('0xb')]);router[_0xaf2c('0x9')]('/:id',auth[_0xaf2c('0xa')](),controller[_0xaf2c('0xc')]);router['get'](_0xaf2c('0xd'),auth['isAuthenticated'](),controller[_0xaf2c('0xe')]);router['post']('/',auth[_0xaf2c('0xa')](),controller[_0xaf2c('0xf')]);router[_0xaf2c('0x10')](_0xaf2c('0xd'),auth['isAuthenticated'](),controller['addInterval']);router[_0xaf2c('0x10')](_0xaf2c('0x11'),auth[_0xaf2c('0xa')](),controller[_0xaf2c('0x12')]);router[_0xaf2c('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xaf2c('0x14')]);router[_0xaf2c('0x15')](_0xaf2c('0x16'),auth[_0xaf2c('0xa')](),controller[_0xaf2c('0x17')]);module[_0xaf2c('0x18')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index ccf5943..424907d 100644 --- a/server/api/interval/interval.attributes.js +++ b/server/api/interval/interval.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x62d3=['STRING','sequelize','exports'];(function(_0xef8146,_0x459c34){var _0x5a6cb0=function(_0x2f84ec){while(--_0x2f84ec){_0xef8146['push'](_0xef8146['shift']());}};_0x5a6cb0(++_0x459c34);}(_0x62d3,0x1b4));var _0x362d=function(_0x40cf88,_0x2cc0e5){_0x40cf88=_0x40cf88-0x0;var _0x38ff10=_0x62d3[_0x40cf88];return _0x38ff10;};'use strict';var Sequelize=require(_0x362d('0x0'));module[_0x362d('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x362d('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x85a0=['sequelize','STRING'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x85a0,0x1ca));var _0x085a=function(_0x187c7c,_0x4d21cf){_0x187c7c=_0x187c7c-0x0;var _0x3da927=_0x85a0[_0x187c7c];return _0x3da927;};'use strict';var Sequelize=require(_0x085a('0x0'));module['exports']={'name':{'type':Sequelize[_0x085a('0x1')]},'description':{'type':Sequelize[_0x085a('0x1')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 05fc09b..a0c2e81 100644 --- a/server/api/interval/interval.controller.js +++ b/server/api/interval/interval.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe865=['create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Intervals','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','findOne','pick','getIntervals','addIntervals','sequelize','transaction','IntervalId','bulkCreate','findAll','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','get','UserProfileResource','destroy','error','stack','name','send','index','map','Interval','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','catch','show','rawAttributes','length','find'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xe865,0x180));var _0x5e86=function(_0x4936fb,_0x10fda9){_0x4936fb=_0x4936fb-0x0;var _0x4430ab=_0xe865[_0x4936fb];return _0x4430ab;};'use strict';var emlformat=require(_0x5e86('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5e86('0x1'));var rp=require(_0x5e86('0x2'));var moment=require(_0x5e86('0x3'));var BPromise=require(_0x5e86('0x4'));var Mustache=require(_0x5e86('0x5'));var util=require(_0x5e86('0x6'));var path=require(_0x5e86('0x7'));var sox=require(_0x5e86('0x8'));var csv=require(_0x5e86('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5e86('0xa'));var _=require(_0x5e86('0xb'));var squel=require('squel');var crypto=require(_0x5e86('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5e86('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5e86('0xe'));var Papa=require('papaparse');var Redis=require(_0x5e86('0xf'));var authService=require(_0x5e86('0x10'));var qs=require(_0x5e86('0x11'));var as=require(_0x5e86('0x12'));var hardwareService=require(_0x5e86('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x5e86('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x5e86('0x15'))['db'];var extensions=require(_0x5e86('0x16'));function respondWithStatusCode(_0x4f3d4c,_0x30c63e){_0x30c63e=_0x30c63e||0xcc;return function(_0x4d1dc0){if(_0x4d1dc0){return _0x4f3d4c[_0x5e86('0x17')](_0x30c63e);}return _0x4f3d4c[_0x5e86('0x18')](_0x30c63e)[_0x5e86('0x19')]();};}function respondWithResult(_0x2d5dda,_0x44fd91){_0x44fd91=_0x44fd91||0xc8;return function(_0xfd81be){if(_0xfd81be){return _0x2d5dda[_0x5e86('0x18')](_0x44fd91)[_0x5e86('0x1a')](_0xfd81be);}};}function respondWithFilteredResult(_0x3dff49,_0x235f02){return function(_0x308ebb){if(_0x308ebb){var _0x36f744=typeof _0x235f02[_0x5e86('0x1b')]===_0x5e86('0x1c')&&typeof _0x235f02[_0x5e86('0x1d')]===_0x5e86('0x1c');var _0xcd38c4=_0x308ebb[_0x5e86('0x1e')];var _0x4fd50a=_0x36f744?0x0:_0x235f02[_0x5e86('0x1b')];var _0x2437af=_0x36f744?_0x308ebb[_0x5e86('0x1e')]:_0x235f02[_0x5e86('0x1b')]+_0x235f02[_0x5e86('0x1d')];var _0x21d08c;if(_0x2437af>=_0xcd38c4){_0x2437af=_0xcd38c4;_0x21d08c=0xc8;}else{_0x21d08c=0xce;}_0x3dff49['status'](_0x21d08c);return _0x3dff49[_0x5e86('0x1f')]('Content-Range',_0x4fd50a+'-'+_0x2437af+'/'+_0xcd38c4)[_0x5e86('0x1a')](_0x308ebb);}return null;};}function patchUpdates(_0x596251){return function(_0xbedb3a){try{jsonpatch[_0x5e86('0x20')](_0xbedb3a,_0x596251,!![]);}catch(_0x5f030b){return BPromise[_0x5e86('0x21')](_0x5f030b);}return _0xbedb3a[_0x5e86('0x22')]();};}function saveUpdates(_0x1dbc2d,_0x25be5d){return function(_0x184932){if(_0x184932){return _0x184932['update'](_0x1dbc2d)[_0x5e86('0x23')](function(_0x2e7b2b){return _0x2e7b2b;});}return null;};}function removeEntity(_0xe9db15,_0x15b7bc){return function(_0x7a885b){if(_0x7a885b){return _0x7a885b['destroy']()[_0x5e86('0x23')](function(){var _0x14a25a=_0x7a885b[_0x5e86('0x24')]({'plain':!![]});var _0x2dade0='Intervals';return db[_0x5e86('0x25')][_0x5e86('0x26')]({'where':{'type':_0x2dade0,'resourceId':_0x14a25a['id']}})[_0x5e86('0x23')](function(){return _0x7a885b;});})[_0x5e86('0x23')](function(){_0xe9db15[_0x5e86('0x18')](0xcc)[_0x5e86('0x19')]();});}};}function handleEntityNotFound(_0x2c4ffc,_0x441eb2){return function(_0x486c72){if(!_0x486c72){_0x2c4ffc[_0x5e86('0x17')](0x194);}return _0x486c72;};}function handleError(_0x5e92d5,_0x223db5){_0x223db5=_0x223db5||0x1f4;return function(_0x2bf23b){logger[_0x5e86('0x27')](_0x2bf23b[_0x5e86('0x28')]);if(_0x2bf23b['name']){delete _0x2bf23b[_0x5e86('0x29')];}_0x5e92d5[_0x5e86('0x18')](_0x223db5)[_0x5e86('0x2a')](_0x2bf23b);};}exports[_0x5e86('0x2b')]=function(_0x3da9da,_0x38c0d0){var _0x351d23={},_0x144866={},_0x45a263={'count':0x0,'rows':[]};var _0x1cd419=_[_0x5e86('0x2c')](db[_0x5e86('0x2d')]['rawAttributes'],function(_0xab84ae){return{'name':_0xab84ae[_0x5e86('0x2e')],'type':_0xab84ae['type']['key']};});_0x144866[_0x5e86('0x2f')]=_[_0x5e86('0x2c')](_0x1cd419,'name');_0x144866[_0x5e86('0x30')]=_[_0x5e86('0x31')](_0x3da9da['query']);_0x144866[_0x5e86('0x32')]=_[_0x5e86('0x33')](_0x144866['model'],_0x144866[_0x5e86('0x30')]);_0x351d23[_0x5e86('0x34')]=_['intersection'](_0x144866[_0x5e86('0x2f')],qs[_0x5e86('0x35')](_0x3da9da[_0x5e86('0x30')]['fields']));_0x351d23[_0x5e86('0x34')]=_0x351d23[_0x5e86('0x34')]['length']?_0x351d23[_0x5e86('0x34')]:_0x144866[_0x5e86('0x2f')];if(!_0x3da9da[_0x5e86('0x30')][_0x5e86('0x36')](_0x5e86('0x37'))){_0x351d23[_0x5e86('0x1d')]=qs[_0x5e86('0x1d')](_0x3da9da[_0x5e86('0x30')][_0x5e86('0x1d')]);_0x351d23[_0x5e86('0x1b')]=qs[_0x5e86('0x1b')](_0x3da9da['query']['offset']);}_0x351d23[_0x5e86('0x38')]=qs[_0x5e86('0x39')](_0x3da9da['query'][_0x5e86('0x39')]);_0x351d23[_0x5e86('0x3a')]=qs[_0x5e86('0x32')](_['pick'](_0x3da9da[_0x5e86('0x30')],_0x144866[_0x5e86('0x32')]),_0x1cd419);if(_0x3da9da[_0x5e86('0x30')][_0x5e86('0x3b')]){_0x351d23[_0x5e86('0x3a')]=_[_0x5e86('0x3c')](_0x351d23['where'],{'$or':_['map'](_0x1cd419,function(_0x10890b){if(_0x10890b[_0x5e86('0x3d')]!==_0x5e86('0x3e')){var _0x48d139={};_0x48d139[_0x10890b[_0x5e86('0x29')]]={'$like':'%'+_0x3da9da[_0x5e86('0x30')][_0x5e86('0x3b')]+'%'};return _0x48d139;}})});}_0x351d23=_[_0x5e86('0x3c')]({},_0x351d23,_0x3da9da[_0x5e86('0x3f')]);var _0x5edeac={'where':_0x351d23[_0x5e86('0x3a')]};return db[_0x5e86('0x2d')][_0x5e86('0x1e')](_0x5edeac)[_0x5e86('0x23')](function(_0x45f165){_0x45a263[_0x5e86('0x1e')]=_0x45f165;if(_0x3da9da[_0x5e86('0x30')][_0x5e86('0x40')]){_0x351d23[_0x5e86('0x41')]=[{'all':!![]}];}return db[_0x5e86('0x2d')]['findAll'](_0x351d23);})[_0x5e86('0x23')](function(_0x1c0266){_0x45a263['rows']=_0x1c0266;return _0x45a263;})['then'](respondWithFilteredResult(_0x38c0d0,_0x351d23))[_0x5e86('0x42')](handleError(_0x38c0d0,null));};exports[_0x5e86('0x43')]=function(_0x42666,_0x171b3c){var _0x5f2471={'raw':!![],'where':{'id':_0x42666['params']['id']}},_0x3397fb={};_0x3397fb[_0x5e86('0x2f')]=_['keys'](db[_0x5e86('0x2d')][_0x5e86('0x44')]);_0x3397fb['query']=_[_0x5e86('0x31')](_0x42666[_0x5e86('0x30')]);_0x3397fb[_0x5e86('0x32')]=_['intersection'](_0x3397fb[_0x5e86('0x2f')],_0x3397fb[_0x5e86('0x30')]);_0x5f2471[_0x5e86('0x34')]=_[_0x5e86('0x33')](_0x3397fb[_0x5e86('0x2f')],qs[_0x5e86('0x35')](_0x42666[_0x5e86('0x30')][_0x5e86('0x35')]));_0x5f2471[_0x5e86('0x34')]=_0x5f2471['attributes'][_0x5e86('0x45')]?_0x5f2471[_0x5e86('0x34')]:_0x3397fb['model'];if(_0x42666['query'][_0x5e86('0x40')]){_0x5f2471[_0x5e86('0x41')]=[{'all':!![]}];}_0x5f2471=_['merge']({},_0x5f2471,_0x42666[_0x5e86('0x3f')]);return db[_0x5e86('0x2d')][_0x5e86('0x46')](_0x5f2471)[_0x5e86('0x23')](handleEntityNotFound(_0x171b3c,null))[_0x5e86('0x23')](respondWithResult(_0x171b3c,null))[_0x5e86('0x42')](handleError(_0x171b3c,null));};exports[_0x5e86('0x47')]=function(_0x24580f,_0x10d310){return db[_0x5e86('0x2d')][_0x5e86('0x47')](_0x24580f['body'],{})[_0x5e86('0x23')](function(_0x436a3f){var _0x4f06b1=_0x24580f['user'][_0x5e86('0x24')]({'plain':!![]});if(!_0x4f06b1)throw new Error(_0x5e86('0x48'));if(_0x4f06b1[_0x5e86('0x49')]===_0x5e86('0x4a')){var _0xc504dc=_0x436a3f[_0x5e86('0x24')]({'plain':!![]});var _0x178845=_0x5e86('0x4b');return db[_0x5e86('0x4c')]['find']({'where':{'name':_0x178845,'userProfileId':_0x4f06b1[_0x5e86('0x4d')]},'raw':!![]})[_0x5e86('0x23')](function(_0x1ea7c0){if(_0x1ea7c0&&_0x1ea7c0['autoAssociation']===0x0){return db[_0x5e86('0x25')][_0x5e86('0x47')]({'name':_0xc504dc[_0x5e86('0x29')],'resourceId':_0xc504dc['id'],'type':_0x1ea7c0[_0x5e86('0x29')],'sectionId':_0x1ea7c0['id']},{})['then'](function(){return _0x436a3f;});}else{return _0x436a3f;}})[_0x5e86('0x42')](function(_0x1ff279){logger[_0x5e86('0x27')](_0x5e86('0x4e'),_0x1ff279);throw _0x1ff279;});}return _0x436a3f;})['then'](respondWithResult(_0x10d310,0xc9))[_0x5e86('0x42')](handleError(_0x10d310,null));};exports[_0x5e86('0x4f')]=function(_0x347d1a,_0xfc3cbb){if(_0x347d1a[_0x5e86('0x50')]['id']){delete _0x347d1a[_0x5e86('0x50')]['id'];}return db[_0x5e86('0x2d')][_0x5e86('0x46')]({'where':{'id':_0x347d1a[_0x5e86('0x51')]['id']}})[_0x5e86('0x23')](handleEntityNotFound(_0xfc3cbb,null))['then'](saveUpdates(_0x347d1a[_0x5e86('0x50')],null))['then'](respondWithResult(_0xfc3cbb,null))['catch'](handleError(_0xfc3cbb,null));};exports[_0x5e86('0x26')]=function(_0x5f22c1,_0x48d3d6){return db['Interval']['find']({'where':{'id':_0x5f22c1[_0x5e86('0x51')]['id']}})[_0x5e86('0x23')](handleEntityNotFound(_0x48d3d6,null))[_0x5e86('0x23')](removeEntity(_0x48d3d6,null))[_0x5e86('0x42')](handleError(_0x48d3d6,null));};exports['addInterval']=function(_0xd93b15,_0x35d8f2,_0x1fa881){if(_0xd93b15[_0x5e86('0x50')]['id']){delete _0xd93b15['body']['id'];}return db[_0x5e86('0x2d')][_0x5e86('0x46')]({'where':{'id':_0xd93b15[_0x5e86('0x51')]['id']}})[_0x5e86('0x23')](handleEntityNotFound(_0x35d8f2,null))['then'](function(_0x33d7e6){if(_0x33d7e6){_0xd93b15['body']['IntervalId']=_0x33d7e6['id'];return db['Interval'][_0x5e86('0x47')](_0xd93b15['body']);}})[_0x5e86('0x23')](respondWithResult(_0x35d8f2,null))[_0x5e86('0x42')](handleError(_0x35d8f2,null));};exports['getIntervals']=function(_0x3e8254,_0x20b383,_0x49d9e8){var _0x396717={};var _0x1fb491={};var _0x5e34a6;var _0x567b39;return db[_0x5e86('0x2d')][_0x5e86('0x52')]({'where':{'id':_0x3e8254[_0x5e86('0x51')]['id']}})[_0x5e86('0x23')](handleEntityNotFound(_0x20b383,null))['then'](function(_0x302eac){if(_0x302eac){_0x5e34a6=_0x302eac;_0x1fb491[_0x5e86('0x2f')]=_[_0x5e86('0x31')](db['Interval'][_0x5e86('0x44')]);_0x1fb491[_0x5e86('0x30')]=_[_0x5e86('0x31')](_0x3e8254[_0x5e86('0x30')]);_0x1fb491[_0x5e86('0x32')]=_[_0x5e86('0x33')](_0x1fb491[_0x5e86('0x2f')],_0x1fb491['query']);_0x396717[_0x5e86('0x34')]=_['intersection'](_0x1fb491[_0x5e86('0x2f')],qs['fields'](_0x3e8254[_0x5e86('0x30')][_0x5e86('0x35')]));_0x396717['attributes']=_0x396717[_0x5e86('0x34')][_0x5e86('0x45')]?_0x396717['attributes']:_0x1fb491[_0x5e86('0x2f')];_0x396717[_0x5e86('0x38')]=qs[_0x5e86('0x39')](_0x3e8254[_0x5e86('0x30')]['sort']);_0x396717['where']=qs[_0x5e86('0x32')](_[_0x5e86('0x53')](_0x3e8254['query'],_0x1fb491[_0x5e86('0x32')]));if(_0x3e8254[_0x5e86('0x30')][_0x5e86('0x3b')]){_0x396717[_0x5e86('0x3a')]=_['merge'](_0x396717['where'],{'$or':_['map'](_0x396717[_0x5e86('0x34')],function(_0x20c490){var _0x304799={};_0x304799[_0x20c490]={'$like':'%'+_0x3e8254[_0x5e86('0x30')][_0x5e86('0x3b')]+'%'};return _0x304799;})});}_0x396717=_[_0x5e86('0x3c')]({},_0x396717,_0x3e8254[_0x5e86('0x3f')]);return _0x5e34a6[_0x5e86('0x54')](_0x396717);}})[_0x5e86('0x23')](function(_0x5ec288){if(_0x5ec288){_0x567b39=_0x5ec288[_0x5e86('0x45')];if(!_0x3e8254[_0x5e86('0x30')][_0x5e86('0x36')](_0x5e86('0x37'))){_0x396717[_0x5e86('0x1d')]=qs['limit'](_0x3e8254[_0x5e86('0x30')]['limit']);_0x396717[_0x5e86('0x1b')]=qs[_0x5e86('0x1b')](_0x3e8254[_0x5e86('0x30')][_0x5e86('0x1b')]);}return _0x5e34a6['getIntervals'](_0x396717);}})[_0x5e86('0x23')](function(_0x2c3ace){if(_0x2c3ace){return _0x2c3ace?{'count':_0x567b39,'rows':_0x2c3ace}:null;}})['then'](respondWithResult(_0x20b383,null))[_0x5e86('0x42')](handleError(_0x20b383,null));};exports[_0x5e86('0x55')]=function(_0x1e869d,_0x429974,_0x5a8933){return db[_0x5e86('0x2d')][_0x5e86('0x52')]({'where':{'id':_0x1e869d[_0x5e86('0x51')]['id']}})[_0x5e86('0x23')](handleEntityNotFound(_0x429974,null))[_0x5e86('0x23')](function(_0x8596ea){if(_0x8596ea){return db[_0x5e86('0x56')][_0x5e86('0x57')](function(_0x24d977){return db['Interval'][_0x5e86('0x26')]({'where':{'IntervalId':_0x1e869d[_0x5e86('0x51')]['id']},'transaction':_0x24d977})[_0x5e86('0x23')](function(_0x55369e){var _0x101195=_['map'](_0x1e869d[_0x5e86('0x50')],function(_0x502e79){delete _0x502e79['id'];_0x502e79[_0x5e86('0x58')]=_0x1e869d[_0x5e86('0x51')]['id'];return _0x502e79;});return db[_0x5e86('0x2d')][_0x5e86('0x59')](_0x101195,{'transaction':_0x24d977});});})[_0x5e86('0x23')](function(){return db[_0x5e86('0x2d')][_0x5e86('0x5a')]({'where':{'IntervalId':_0x1e869d[_0x5e86('0x51')]['id']}});});}})[_0x5e86('0x23')](respondWithResult(_0x429974,null))[_0x5e86('0x42')](handleError(_0x429974,null));}; \ No newline at end of file +var _0xb6fc=['sort','where','pick','merge','VIRTUAL','filter','options','Interval','includeAll','include','findAll','rows','catch','show','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','IntervalId','findOne','getIntervals','sequelize','transaction','eml-format','rimraf','fast-json-patch','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','offset','undefined','count','set','Content-Range','apply','reject','then','destroy','get','Intervals','UserProfileResource','end','name','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order'];(function(_0x497687,_0x7fdbab){var _0x44bb01=function(_0x13bf50){while(--_0x13bf50){_0x497687['push'](_0x497687['shift']());}};_0x44bb01(++_0x7fdbab);}(_0xb6fc,0x72));var _0xcb6f=function(_0x30254a,_0x30d550){_0x30254a=_0x30254a-0x0;var _0x46dd57=_0xb6fc[_0x30254a];return _0x46dd57;};'use strict';var emlformat=require(_0xcb6f('0x0'));var rimraf=require(_0xcb6f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcb6f('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcb6f('0x3'));var util=require(_0xcb6f('0x4'));var path=require('path');var sox=require(_0xcb6f('0x5'));var csv=require(_0xcb6f('0x6'));var ejs=require(_0xcb6f('0x7'));var fs=require('fs');var fs_extra=require(_0xcb6f('0x8'));var _=require('lodash');var squel=require(_0xcb6f('0x9'));var crypto=require(_0xcb6f('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xcb6f('0xb'));var toCsv=require('to-csv');var querystring=require(_0xcb6f('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xcb6f('0xd'));var qs=require(_0xcb6f('0xe'));var as=require(_0xcb6f('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcb6f('0x10'))(_0xcb6f('0x11'));var utils=require(_0xcb6f('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcb6f('0x13'))['db'];var extensions=require(_0xcb6f('0x14'));function respondWithStatusCode(_0x1a73dc,_0x2a64b7){_0x2a64b7=_0x2a64b7||0xcc;return function(_0x3f48fd){if(_0x3f48fd){return _0x1a73dc[_0xcb6f('0x15')](_0x2a64b7);}return _0x1a73dc[_0xcb6f('0x16')](_0x2a64b7)['end']();};}function respondWithResult(_0x58d1af,_0x2a8c07){_0x2a8c07=_0x2a8c07||0xc8;return function(_0x1bddde){if(_0x1bddde){return _0x58d1af[_0xcb6f('0x16')](_0x2a8c07)['json'](_0x1bddde);}};}function respondWithFilteredResult(_0x590bf0,_0x48791a){return function(_0x10ac43){if(_0x10ac43){var _0x56a504=typeof _0x48791a[_0xcb6f('0x17')]===_0xcb6f('0x18')&&typeof _0x48791a['limit']==='undefined';var _0x4ef2f6=_0x10ac43[_0xcb6f('0x19')];var _0x25371c=_0x56a504?0x0:_0x48791a[_0xcb6f('0x17')];var _0x5d700d=_0x56a504?_0x10ac43[_0xcb6f('0x19')]:_0x48791a['offset']+_0x48791a['limit'];var _0x129687;if(_0x5d700d>=_0x4ef2f6){_0x5d700d=_0x4ef2f6;_0x129687=0xc8;}else{_0x129687=0xce;}_0x590bf0[_0xcb6f('0x16')](_0x129687);return _0x590bf0[_0xcb6f('0x1a')](_0xcb6f('0x1b'),_0x25371c+'-'+_0x5d700d+'/'+_0x4ef2f6)['json'](_0x10ac43);}return null;};}function patchUpdates(_0x2b7d2f){return function(_0x372c0e){try{jsonpatch[_0xcb6f('0x1c')](_0x372c0e,_0x2b7d2f,!![]);}catch(_0x5ad5e6){return BPromise[_0xcb6f('0x1d')](_0x5ad5e6);}return _0x372c0e['save']();};}function saveUpdates(_0x1405b7,_0x5d5907){return function(_0x517202){if(_0x517202){return _0x517202['update'](_0x1405b7)[_0xcb6f('0x1e')](function(_0x258f41){return _0x258f41;});}return null;};}function removeEntity(_0x3a4ed6,_0x2c5599){return function(_0x4d0a3c){if(_0x4d0a3c){return _0x4d0a3c[_0xcb6f('0x1f')]()[_0xcb6f('0x1e')](function(){var _0x358bc6=_0x4d0a3c[_0xcb6f('0x20')]({'plain':!![]});var _0x417946=_0xcb6f('0x21');return db[_0xcb6f('0x22')][_0xcb6f('0x1f')]({'where':{'type':_0x417946,'resourceId':_0x358bc6['id']}})[_0xcb6f('0x1e')](function(){return _0x4d0a3c;});})[_0xcb6f('0x1e')](function(){_0x3a4ed6[_0xcb6f('0x16')](0xcc)[_0xcb6f('0x23')]();});}};}function handleEntityNotFound(_0x568357,_0x12a042){return function(_0x5070a0){if(!_0x5070a0){_0x568357[_0xcb6f('0x15')](0x194);}return _0x5070a0;};}function handleError(_0x4e3f2b,_0x231b70){_0x231b70=_0x231b70||0x1f4;return function(_0x4a87bf){logger['error'](_0x4a87bf['stack']);if(_0x4a87bf[_0xcb6f('0x24')]){delete _0x4a87bf[_0xcb6f('0x24')];}_0x4e3f2b[_0xcb6f('0x16')](_0x231b70)['send'](_0x4a87bf);};}exports[_0xcb6f('0x25')]=function(_0x25a6fa,_0x3bf8d8){var _0x5a9d05={},_0x243d5f={},_0x32f61b={'count':0x0,'rows':[]};var _0x1f032e=_[_0xcb6f('0x26')](db['Interval'][_0xcb6f('0x27')],function(_0x3a025d){return{'name':_0x3a025d['fieldName'],'type':_0x3a025d[_0xcb6f('0x28')][_0xcb6f('0x29')]};});_0x243d5f[_0xcb6f('0x2a')]=_['map'](_0x1f032e,_0xcb6f('0x24'));_0x243d5f[_0xcb6f('0x2b')]=_[_0xcb6f('0x2c')](_0x25a6fa[_0xcb6f('0x2b')]);_0x243d5f[_0xcb6f('0x2d')]=_[_0xcb6f('0x2e')](_0x243d5f[_0xcb6f('0x2a')],_0x243d5f[_0xcb6f('0x2b')]);_0x5a9d05[_0xcb6f('0x2f')]=_[_0xcb6f('0x2e')](_0x243d5f[_0xcb6f('0x2a')],qs[_0xcb6f('0x30')](_0x25a6fa[_0xcb6f('0x2b')][_0xcb6f('0x30')]));_0x5a9d05[_0xcb6f('0x2f')]=_0x5a9d05[_0xcb6f('0x2f')][_0xcb6f('0x31')]?_0x5a9d05[_0xcb6f('0x2f')]:_0x243d5f['model'];if(!_0x25a6fa[_0xcb6f('0x2b')][_0xcb6f('0x32')](_0xcb6f('0x33'))){_0x5a9d05[_0xcb6f('0x34')]=qs[_0xcb6f('0x34')](_0x25a6fa[_0xcb6f('0x2b')]['limit']);_0x5a9d05[_0xcb6f('0x17')]=qs[_0xcb6f('0x17')](_0x25a6fa['query'][_0xcb6f('0x17')]);}_0x5a9d05[_0xcb6f('0x35')]=qs['sort'](_0x25a6fa['query'][_0xcb6f('0x36')]);_0x5a9d05[_0xcb6f('0x37')]=qs[_0xcb6f('0x2d')](_[_0xcb6f('0x38')](_0x25a6fa['query'],_0x243d5f[_0xcb6f('0x2d')]),_0x1f032e);if(_0x25a6fa[_0xcb6f('0x2b')]['filter']){_0x5a9d05['where']=_[_0xcb6f('0x39')](_0x5a9d05[_0xcb6f('0x37')],{'$or':_['map'](_0x1f032e,function(_0x1ca733){if(_0x1ca733[_0xcb6f('0x28')]!==_0xcb6f('0x3a')){var _0x4b7e20={};_0x4b7e20[_0x1ca733[_0xcb6f('0x24')]]={'$like':'%'+_0x25a6fa[_0xcb6f('0x2b')][_0xcb6f('0x3b')]+'%'};return _0x4b7e20;}})});}_0x5a9d05=_[_0xcb6f('0x39')]({},_0x5a9d05,_0x25a6fa[_0xcb6f('0x3c')]);var _0x3869ab={'where':_0x5a9d05['where']};return db[_0xcb6f('0x3d')][_0xcb6f('0x19')](_0x3869ab)[_0xcb6f('0x1e')](function(_0x158282){_0x32f61b[_0xcb6f('0x19')]=_0x158282;if(_0x25a6fa[_0xcb6f('0x2b')][_0xcb6f('0x3e')]){_0x5a9d05[_0xcb6f('0x3f')]=[{'all':!![]}];}return db['Interval'][_0xcb6f('0x40')](_0x5a9d05);})[_0xcb6f('0x1e')](function(_0x29722e){_0x32f61b[_0xcb6f('0x41')]=_0x29722e;return _0x32f61b;})[_0xcb6f('0x1e')](respondWithFilteredResult(_0x3bf8d8,_0x5a9d05))[_0xcb6f('0x42')](handleError(_0x3bf8d8,null));};exports[_0xcb6f('0x43')]=function(_0x4c72d7,_0x4f8657){var _0x5ba580={'raw':!![],'where':{'id':_0x4c72d7['params']['id']}},_0x4e86e7={};_0x4e86e7[_0xcb6f('0x2a')]=_[_0xcb6f('0x2c')](db[_0xcb6f('0x3d')][_0xcb6f('0x27')]);_0x4e86e7[_0xcb6f('0x2b')]=_['keys'](_0x4c72d7[_0xcb6f('0x2b')]);_0x4e86e7[_0xcb6f('0x2d')]=_[_0xcb6f('0x2e')](_0x4e86e7[_0xcb6f('0x2a')],_0x4e86e7[_0xcb6f('0x2b')]);_0x5ba580['attributes']=_[_0xcb6f('0x2e')](_0x4e86e7[_0xcb6f('0x2a')],qs['fields'](_0x4c72d7[_0xcb6f('0x2b')][_0xcb6f('0x30')]));_0x5ba580[_0xcb6f('0x2f')]=_0x5ba580[_0xcb6f('0x2f')]['length']?_0x5ba580[_0xcb6f('0x2f')]:_0x4e86e7['model'];if(_0x4c72d7[_0xcb6f('0x2b')][_0xcb6f('0x3e')]){_0x5ba580[_0xcb6f('0x3f')]=[{'all':!![]}];}_0x5ba580=_['merge']({},_0x5ba580,_0x4c72d7[_0xcb6f('0x3c')]);return db[_0xcb6f('0x3d')][_0xcb6f('0x44')](_0x5ba580)['then'](handleEntityNotFound(_0x4f8657,null))[_0xcb6f('0x1e')](respondWithResult(_0x4f8657,null))[_0xcb6f('0x42')](handleError(_0x4f8657,null));};exports['create']=function(_0xddd936,_0x47543f){return db[_0xcb6f('0x3d')]['create'](_0xddd936['body'],{})[_0xcb6f('0x1e')](function(_0x1d24fd){var _0xd151fc=_0xddd936[_0xcb6f('0x45')][_0xcb6f('0x20')]({'plain':!![]});if(!_0xd151fc)throw new Error(_0xcb6f('0x46'));if(_0xd151fc[_0xcb6f('0x47')]===_0xcb6f('0x45')){var _0x1ae323=_0x1d24fd[_0xcb6f('0x20')]({'plain':!![]});var _0x2a020b=_0xcb6f('0x21');return db[_0xcb6f('0x48')][_0xcb6f('0x44')]({'where':{'name':_0x2a020b,'userProfileId':_0xd151fc[_0xcb6f('0x49')]},'raw':!![]})[_0xcb6f('0x1e')](function(_0x75c324){if(_0x75c324&&_0x75c324['autoAssociation']===0x0){return db['UserProfileResource'][_0xcb6f('0x4a')]({'name':_0x1ae323[_0xcb6f('0x24')],'resourceId':_0x1ae323['id'],'type':_0x75c324['name'],'sectionId':_0x75c324['id']},{})[_0xcb6f('0x1e')](function(){return _0x1d24fd;});}else{return _0x1d24fd;}})[_0xcb6f('0x42')](function(_0x31d16f){logger['error'](_0xcb6f('0x4b'),_0x31d16f);throw _0x31d16f;});}return _0x1d24fd;})['then'](respondWithResult(_0x47543f,0xc9))[_0xcb6f('0x42')](handleError(_0x47543f,null));};exports[_0xcb6f('0x4c')]=function(_0x1dbbae,_0x2703ce){if(_0x1dbbae[_0xcb6f('0x4d')]['id']){delete _0x1dbbae[_0xcb6f('0x4d')]['id'];}return db[_0xcb6f('0x3d')]['find']({'where':{'id':_0x1dbbae[_0xcb6f('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2703ce,null))[_0xcb6f('0x1e')](saveUpdates(_0x1dbbae[_0xcb6f('0x4d')],null))['then'](respondWithResult(_0x2703ce,null))['catch'](handleError(_0x2703ce,null));};exports[_0xcb6f('0x1f')]=function(_0x3e41e2,_0x1e3fee){return db[_0xcb6f('0x3d')]['find']({'where':{'id':_0x3e41e2[_0xcb6f('0x4e')]['id']}})[_0xcb6f('0x1e')](handleEntityNotFound(_0x1e3fee,null))[_0xcb6f('0x1e')](removeEntity(_0x1e3fee,null))[_0xcb6f('0x42')](handleError(_0x1e3fee,null));};exports['addInterval']=function(_0x5684d0,_0x29a521,_0x923746){if(_0x5684d0[_0xcb6f('0x4d')]['id']){delete _0x5684d0[_0xcb6f('0x4d')]['id'];}return db[_0xcb6f('0x3d')][_0xcb6f('0x44')]({'where':{'id':_0x5684d0[_0xcb6f('0x4e')]['id']}})[_0xcb6f('0x1e')](handleEntityNotFound(_0x29a521,null))[_0xcb6f('0x1e')](function(_0x1ae8a8){if(_0x1ae8a8){_0x5684d0[_0xcb6f('0x4d')][_0xcb6f('0x4f')]=_0x1ae8a8['id'];return db[_0xcb6f('0x3d')][_0xcb6f('0x4a')](_0x5684d0[_0xcb6f('0x4d')]);}})['then'](respondWithResult(_0x29a521,null))['catch'](handleError(_0x29a521,null));};exports['getIntervals']=function(_0x18adec,_0x23bd07,_0x291ea9){var _0x34b978={};var _0x5a0900={};var _0x1b690b;var _0x408632;return db['Interval'][_0xcb6f('0x50')]({'where':{'id':_0x18adec[_0xcb6f('0x4e')]['id']}})[_0xcb6f('0x1e')](handleEntityNotFound(_0x23bd07,null))[_0xcb6f('0x1e')](function(_0x7eaf2c){if(_0x7eaf2c){_0x1b690b=_0x7eaf2c;_0x5a0900['model']=_[_0xcb6f('0x2c')](db[_0xcb6f('0x3d')][_0xcb6f('0x27')]);_0x5a0900[_0xcb6f('0x2b')]=_['keys'](_0x18adec[_0xcb6f('0x2b')]);_0x5a0900[_0xcb6f('0x2d')]=_[_0xcb6f('0x2e')](_0x5a0900[_0xcb6f('0x2a')],_0x5a0900[_0xcb6f('0x2b')]);_0x34b978['attributes']=_['intersection'](_0x5a0900['model'],qs[_0xcb6f('0x30')](_0x18adec[_0xcb6f('0x2b')][_0xcb6f('0x30')]));_0x34b978[_0xcb6f('0x2f')]=_0x34b978['attributes'][_0xcb6f('0x31')]?_0x34b978[_0xcb6f('0x2f')]:_0x5a0900[_0xcb6f('0x2a')];_0x34b978[_0xcb6f('0x35')]=qs['sort'](_0x18adec[_0xcb6f('0x2b')][_0xcb6f('0x36')]);_0x34b978[_0xcb6f('0x37')]=qs[_0xcb6f('0x2d')](_['pick'](_0x18adec[_0xcb6f('0x2b')],_0x5a0900['filters']));if(_0x18adec[_0xcb6f('0x2b')][_0xcb6f('0x3b')]){_0x34b978[_0xcb6f('0x37')]=_[_0xcb6f('0x39')](_0x34b978[_0xcb6f('0x37')],{'$or':_['map'](_0x34b978['attributes'],function(_0x17f626){var _0x2de589={};_0x2de589[_0x17f626]={'$like':'%'+_0x18adec['query']['filter']+'%'};return _0x2de589;})});}_0x34b978=_[_0xcb6f('0x39')]({},_0x34b978,_0x18adec[_0xcb6f('0x3c')]);return _0x1b690b[_0xcb6f('0x51')](_0x34b978);}})[_0xcb6f('0x1e')](function(_0x47c008){if(_0x47c008){_0x408632=_0x47c008['length'];if(!_0x18adec[_0xcb6f('0x2b')][_0xcb6f('0x32')](_0xcb6f('0x33'))){_0x34b978['limit']=qs['limit'](_0x18adec[_0xcb6f('0x2b')][_0xcb6f('0x34')]);_0x34b978['offset']=qs[_0xcb6f('0x17')](_0x18adec[_0xcb6f('0x2b')][_0xcb6f('0x17')]);}return _0x1b690b['getIntervals'](_0x34b978);}})[_0xcb6f('0x1e')](function(_0x4fd2d6){if(_0x4fd2d6){return _0x4fd2d6?{'count':_0x408632,'rows':_0x4fd2d6}:null;}})[_0xcb6f('0x1e')](respondWithResult(_0x23bd07,null))[_0xcb6f('0x42')](handleError(_0x23bd07,null));};exports['addIntervals']=function(_0x2dd2fb,_0x413f11,_0x12dd8b){return db[_0xcb6f('0x3d')][_0xcb6f('0x50')]({'where':{'id':_0x2dd2fb['params']['id']}})[_0xcb6f('0x1e')](handleEntityNotFound(_0x413f11,null))[_0xcb6f('0x1e')](function(_0x393e31){if(_0x393e31){return db[_0xcb6f('0x52')][_0xcb6f('0x53')](function(_0x1a5a66){return db[_0xcb6f('0x3d')]['destroy']({'where':{'IntervalId':_0x2dd2fb[_0xcb6f('0x4e')]['id']},'transaction':_0x1a5a66})[_0xcb6f('0x1e')](function(_0x234003){var _0x3965ac=_[_0xcb6f('0x26')](_0x2dd2fb[_0xcb6f('0x4d')],function(_0x23cfc9){delete _0x23cfc9['id'];_0x23cfc9['IntervalId']=_0x2dd2fb['params']['id'];return _0x23cfc9;});return db[_0xcb6f('0x3d')]['bulkCreate'](_0x3965ac,{'transaction':_0x1a5a66});});})[_0xcb6f('0x1e')](function(){return db[_0xcb6f('0x3d')][_0xcb6f('0x40')]({'where':{'IntervalId':_0x2dd2fb['params']['id']}});});}})[_0xcb6f('0x1e')](respondWithResult(_0x413f11,null))[_0xcb6f('0x42')](handleError(_0x413f11,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index a273dec..59c866a 100644 --- a/server/api/interval/interval.model.js +++ b/server/api/interval/interval.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0ef3=['interval','then','all','ifTime','reduce','./interval.attributes','iftime','exports','define','Interval','rewrite','string'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0ef3,0xe9));var _0x30ef=function(_0x1a268f,_0x2f4759){_0x1a268f=_0x1a268f-0x0;var _0x63fe77=_0x0ef3[_0x1a268f];return _0x63fe77;};'use strict';var attributes=require(_0x30ef('0x0'));var extensions=require('../../components/extensions/rewrite');var iftime=require('../../utils/iftime')[_0x30ef('0x1')];module[_0x30ef('0x2')]=function(_0x5e35f7){return _0x5e35f7[_0x30ef('0x3')](_0x30ef('0x4'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5ac490){extensions[_0x30ef('0x5')](_0x5e35f7,_0x5ac490);},'afterBulkCreate':function(_0x41b4a1,_0x5e667d,_0xb4c165){_0xb4c165();extensions[_0x30ef('0x5')](_0x5e35f7,_0x41b4a1[0x0]);},'afterUpdate':function(_0x31a381){extensions[_0x30ef('0x5')](_0x5e35f7,_0x31a381);},'afterDestroy':function(_0x2c662e){extensions['rewrite'](_0x5e35f7,_0x2c662e);}},'instanceMethods':{'ifTime':function(_0x23d08a=undefined,_0x4c5437=new Date()){if(typeof this['interval']===_0x30ef('0x6')){return iftime(this[_0x30ef('0x7')],_0x23d08a,_0x4c5437);}else{return this['getIntervals']()[_0x30ef('0x8')](function(_0x39ce15){return Promise[_0x30ef('0x9')](_0x39ce15['map'](function(_0x2d9242){return _0x2d9242[_0x30ef('0xa')](_0x23d08a,_0x4c5437);}));})[_0x30ef('0x8')](function(_0x50cb66){return _0x50cb66[_0x30ef('0xb')](function(_0x3f1228,_0x2d9d5c){return _0x3f1228||_0x2d9d5c;},![]);});}}}});}; \ No newline at end of file +var _0x5ad5=['../../utils/iftime','iftime','exports','define','Interval','tools_intervals','rewrite','interval','getIntervals','then','all','map','ifTime','reduce','../../components/extensions/rewrite'];(function(_0x3e1115,_0x2ccf5a){var _0x490d3a=function(_0x25c73f){while(--_0x25c73f){_0x3e1115['push'](_0x3e1115['shift']());}};_0x490d3a(++_0x2ccf5a);}(_0x5ad5,0x149));var _0x55ad=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x5ad5[_0x501510];return _0x1e6ee5;};'use strict';var attributes=require('./interval.attributes');var extensions=require(_0x55ad('0x0'));var iftime=require(_0x55ad('0x1'))[_0x55ad('0x2')];module[_0x55ad('0x3')]=function(_0x2feb34){return _0x2feb34[_0x55ad('0x4')](_0x55ad('0x5'),attributes,{'tableName':_0x55ad('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x12fc64){extensions[_0x55ad('0x7')](_0x2feb34,_0x12fc64);},'afterBulkCreate':function(_0xb5c856,_0x153547,_0x54abdc){_0x54abdc();extensions[_0x55ad('0x7')](_0x2feb34,_0xb5c856[0x0]);},'afterUpdate':function(_0x246a3e){extensions[_0x55ad('0x7')](_0x2feb34,_0x246a3e);},'afterDestroy':function(_0x463bd9){extensions[_0x55ad('0x7')](_0x2feb34,_0x463bd9);}},'instanceMethods':{'ifTime':function(_0x5af2b6=undefined,_0x52f873=new Date()){if(typeof this['interval']==='string'){return iftime(this[_0x55ad('0x8')],_0x5af2b6,_0x52f873);}else{return this[_0x55ad('0x9')]()[_0x55ad('0xa')](function(_0x2eec34){return Promise[_0x55ad('0xb')](_0x2eec34[_0x55ad('0xc')](function(_0x1b5ba0){return _0x1b5ba0[_0x55ad('0xd')](_0x5af2b6,_0x52f873);}));})[_0x55ad('0xa')](function(_0x469359){return _0x469359[_0x55ad('0xe')](function(_0x6a2a8,_0x3ad7de){return _0x6a2a8||_0x3ad7de;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index e9248d4..8ea9e0f 100644 --- a/server/api/interval/interval.rpc.js +++ b/server/api/interval/interval.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x874e=['util','../../mysqldb','../../utils/iftime','../../config/logger','rpc','Interval','findAll','options','raw','attributes','limit','include','map','model','info','GetInterval','debug','catch','message','error','find','where','ShowInterval','then','ifTime','format','name','join','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','IntervalIftime','intervalIds','intervals','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','Iftime','silly','resolve','isArray','reduce'];(function(_0x130ac6,_0x9aad6e){var _0xd426c2=function(_0x376e4f){while(--_0x376e4f){_0x130ac6['push'](_0x130ac6['shift']());}};_0xd426c2(++_0x9aad6e);}(_0x874e,0x168));var _0xe874=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x874e[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require(_0xe874('0x0'));var db=require(_0xe874('0x1'))['db'];var iftime=require(_0xe874('0x2'))['iftime'];var logger=require(_0xe874('0x3'))(_0xe874('0x4'));exports['GetInterval']=function(_0x21d30e){var _0x36d69f=this;return new Promise(function(_0x8c60c4,_0x3eabad){return db[_0xe874('0x5')][_0xe874('0x6')]({'raw':_0x21d30e[_0xe874('0x7')]?_0x21d30e[_0xe874('0x7')][_0xe874('0x8')]===undefined?!![]:![]:!![],'where':_0x21d30e[_0xe874('0x7')]?_0x21d30e[_0xe874('0x7')]['where']||null:null,'attributes':_0x21d30e['options']?_0x21d30e['options'][_0xe874('0x9')]||null:null,'limit':_0x21d30e['options']?_0x21d30e[_0xe874('0x7')][_0xe874('0xa')]||null:null,'include':_0x21d30e['options']?_0x21d30e['options'][_0xe874('0xb')]?_[_0xe874('0xc')](_0x21d30e[_0xe874('0x7')][_0xe874('0xb')],function(_0x30a307){return{'model':db[_0x30a307['model']],'as':_0x30a307['as'],'attributes':_0x30a307[_0xe874('0x9')],'include':_0x30a307['include']?_[_0xe874('0xc')](_0x30a307[_0xe874('0xb')],function(_0x57c303){return{'model':db[_0x57c303[_0xe874('0xd')]],'as':_0x57c303['as'],'attributes':_0x57c303[_0xe874('0x9')],'include':_0x57c303[_0xe874('0xb')]?_['map'](_0x57c303['include'],function(_0x5bd632){return{'model':db[_0x5bd632[_0xe874('0xd')]],'as':_0x5bd632['as'],'attributes':_0x5bd632[_0xe874('0x9')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x34ffd5){logger[_0xe874('0xe')](_0xe874('0xf'),_0x21d30e);logger[_0xe874('0x10')](_0xe874('0xf'),_0x21d30e,JSON['stringify'](_0x34ffd5));_0x8c60c4(_0x34ffd5);})[_0xe874('0x11')](function(_0x1cacc0){logger['error']('GetInterval',_0x1cacc0[_0xe874('0x12')],_0x21d30e);_0x3eabad(_0x36d69f[_0xe874('0x13')](0x1f4,_0x1cacc0['message']));});});};exports['ShowInterval']=function(_0x2d855b){var _0x426ff7=this;return new Promise(function(_0x4d3a84,_0x472f56){return db['Interval'][_0xe874('0x14')]({'raw':_0x2d855b['options']?_0x2d855b[_0xe874('0x7')][_0xe874('0x8')]===undefined?!![]:![]:!![],'where':_0x2d855b[_0xe874('0x7')]?_0x2d855b[_0xe874('0x7')][_0xe874('0x15')]||null:null,'attributes':_0x2d855b[_0xe874('0x7')]?_0x2d855b[_0xe874('0x7')][_0xe874('0x9')]||null:null,'include':_0x2d855b[_0xe874('0x7')]?_0x2d855b[_0xe874('0x7')]['include']?_['map'](_0x2d855b[_0xe874('0x7')][_0xe874('0xb')],function(_0x2d1e2b){return{'model':db[_0x2d1e2b[_0xe874('0xd')]],'as':_0x2d1e2b['as'],'attributes':_0x2d1e2b['attributes'],'include':_0x2d1e2b[_0xe874('0xb')]?_[_0xe874('0xc')](_0x2d1e2b['include'],function(_0xfb4bc2){return{'model':db[_0xfb4bc2[_0xe874('0xd')]],'as':_0xfb4bc2['as'],'attributes':_0xfb4bc2[_0xe874('0x9')],'include':_0xfb4bc2[_0xe874('0xb')]?_[_0xe874('0xc')](_0xfb4bc2['include'],function(_0x676cca){return{'model':db[_0x676cca[_0xe874('0xd')]],'as':_0x676cca['as'],'attributes':_0x676cca[_0xe874('0x9')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3777c8){logger[_0xe874('0xe')](_0xe874('0x16'),_0x2d855b);logger[_0xe874('0x10')](_0xe874('0x16'),_0x2d855b,JSON['stringify'](_0x3777c8));_0x4d3a84(_0x3777c8);})[_0xe874('0x11')](function(_0x106faa){logger[_0xe874('0x13')](_0xe874('0x16'),_0x106faa[_0xe874('0x12')],_0x2d855b);_0x472f56(_0x426ff7[_0xe874('0x13')](0x1f4,_0x106faa[_0xe874('0x12')]));});});};function checkArrayOfIntervals(_0x5bda59,_0x32fea8){var _0x51d85d=[];return db[_0xe874('0x5')][_0xe874('0x6')]({'where':{'id':_0x5bda59}})[_0xe874('0x17')](function(_0x41c484){_0x51d85d=_0x41c484;return Promise['all'](_0x51d85d[_0xe874('0xc')](function(_0x922fb1){return _0x922fb1[_0xe874('0x18')](_0x32fea8);}));})[_0xe874('0x17')](function(_0x511b73){var _0x41b75d=_0x511b73['reduce'](function(_0xc4fad,_0x3d1f4e){return _0xc4fad||_0x3d1f4e;},![]);logger['info'](util[_0xe874('0x19')]('IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)',_0x51d85d['map'](function(_0x2a9f07){return _0x2a9f07[_0xe874('0x1a')];})[_0xe874('0x1b')](',\x20'),_0x51d85d[_0xe874('0xc')](function(_0x38da1e){return _0x38da1e['id'];})[_0xe874('0x1b')](',\x20')));return _0x41b75d;});}function checkSingleInterval(_0x3e58bc,_0x342416){return db[_0xe874('0x5')]['findById'](_0x3e58bc)[_0xe874('0x17')](function(_0x152d93){if(_0x152d93){logger['info'](util['format'](_0xe874('0x1c'),_0x152d93['name'],_0x152d93['id']));return _0x152d93[_0xe874('0x18')](_0x342416);}});}exports[_0xe874('0x1d')]=function(_0x5eeb3c){var _0x69551d=_0x5eeb3c[_0xe874('0x1e')];var _0x46431c=Array['isArray'](_0x5eeb3c[_0xe874('0x1f')])?_0x5eeb3c[_0xe874('0x1f')]:typeof _0x5eeb3c[_0xe874('0x1f')]==='string'?[_0x5eeb3c[_0xe874('0x1f')]]:[];var _0x393da8=_0x5eeb3c[_0xe874('0x20')]||undefined;var _0x2478d6=![];if(_0x46431c[_0xe874('0x21')]){logger[_0xe874('0xe')](util[_0xe874('0x19')](_0xe874('0x22'),_0x46431c[_0xe874('0x1b')](';\x20')));}if(_0x393da8){logger[_0xe874('0xe')](util[_0xe874('0x19')]('IntervalIftime:\x20timezone\x20=\x20%s',_0x393da8));}logger[_0xe874('0x10')](_0xe874('0x23'),_0x2478d6);logger[_0xe874('0x24')]('IntervalIftime',_0x5eeb3c);return Promise[_0xe874('0x25')]()[_0xe874('0x17')](function(){if(Array[_0xe874('0x26')](_0x69551d)){return checkArrayOfIntervals(_0x69551d,_0x393da8);}else if(_0x69551d){return checkSingleInterval(_0x69551d,_0x393da8);}})['then'](function(_0x108d84){var _0x42818c=_0x46431c[_0xe874('0x27')](function(_0x2fb5dc,_0x39949a){return _0x2fb5dc||iftime(_0x39949a,_0x393da8);},![]);_0x2478d6=_0x108d84||_0x42818c;return _0x2478d6;})[_0xe874('0x11')](function(_0x557d95){logger[_0xe874('0x13')](_0xe874('0x1d'),_0x5eeb3c,_0x557d95);throw this[_0xe874('0x13')](0x1f4,_0x557d95['message']);});}; \ No newline at end of file +var _0xf6a2=['intervalIds','intervals','string','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','silly','IntervalIftime','resolve','lodash','../../mysqldb','iftime','rpc','Interval','findAll','options','where','include','map','attributes','model','then','GetInterval','debug','stringify','message','error','find','raw','info','ShowInterval','catch','all','ifTime','reduce','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','findById','format','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)'];(function(_0xca1477,_0x2aefc1){var _0x487de7=function(_0x314c5c){while(--_0x314c5c){_0xca1477['push'](_0xca1477['shift']());}};_0x487de7(++_0x2aefc1);}(_0xf6a2,0xdc));var _0x2f6a=function(_0x18b2a3,_0x2a639b){_0x18b2a3=_0x18b2a3-0x0;var _0x50659f=_0xf6a2[_0x18b2a3];return _0x50659f;};'use strict';var _=require(_0x2f6a('0x0'));var util=require('util');var db=require(_0x2f6a('0x1'))['db'];var iftime=require('../../utils/iftime')[_0x2f6a('0x2')];var logger=require('../../config/logger')(_0x2f6a('0x3'));exports['GetInterval']=function(_0x97f4e1){var _0x4bad82=this;return new Promise(function(_0x485b33,_0x4c77b6){return db[_0x2f6a('0x4')][_0x2f6a('0x5')]({'raw':_0x97f4e1[_0x2f6a('0x6')]?_0x97f4e1['options']['raw']===undefined?!![]:![]:!![],'where':_0x97f4e1[_0x2f6a('0x6')]?_0x97f4e1[_0x2f6a('0x6')][_0x2f6a('0x7')]||null:null,'attributes':_0x97f4e1[_0x2f6a('0x6')]?_0x97f4e1[_0x2f6a('0x6')]['attributes']||null:null,'limit':_0x97f4e1[_0x2f6a('0x6')]?_0x97f4e1[_0x2f6a('0x6')]['limit']||null:null,'include':_0x97f4e1[_0x2f6a('0x6')]?_0x97f4e1[_0x2f6a('0x6')][_0x2f6a('0x8')]?_[_0x2f6a('0x9')](_0x97f4e1[_0x2f6a('0x6')][_0x2f6a('0x8')],function(_0xaa16dd){return{'model':db[_0xaa16dd['model']],'as':_0xaa16dd['as'],'attributes':_0xaa16dd[_0x2f6a('0xa')],'include':_0xaa16dd[_0x2f6a('0x8')]?_[_0x2f6a('0x9')](_0xaa16dd[_0x2f6a('0x8')],function(_0x8b8760){return{'model':db[_0x8b8760[_0x2f6a('0xb')]],'as':_0x8b8760['as'],'attributes':_0x8b8760[_0x2f6a('0xa')],'include':_0x8b8760[_0x2f6a('0x8')]?_[_0x2f6a('0x9')](_0x8b8760['include'],function(_0x2d20a5){return{'model':db[_0x2d20a5['model']],'as':_0x2d20a5['as'],'attributes':_0x2d20a5[_0x2f6a('0xa')]};}):[]};}):[]};}):[]:[]})[_0x2f6a('0xc')](function(_0x1e1b16){logger['info'](_0x2f6a('0xd'),_0x97f4e1);logger[_0x2f6a('0xe')](_0x2f6a('0xd'),_0x97f4e1,JSON[_0x2f6a('0xf')](_0x1e1b16));_0x485b33(_0x1e1b16);})['catch'](function(_0x113635){logger['error'](_0x2f6a('0xd'),_0x113635[_0x2f6a('0x10')],_0x97f4e1);_0x4c77b6(_0x4bad82[_0x2f6a('0x11')](0x1f4,_0x113635['message']));});});};exports['ShowInterval']=function(_0x3bc12b){var _0x5cc67b=this;return new Promise(function(_0x33f299,_0x45ba8e){return db[_0x2f6a('0x4')][_0x2f6a('0x12')]({'raw':_0x3bc12b[_0x2f6a('0x6')]?_0x3bc12b['options'][_0x2f6a('0x13')]===undefined?!![]:![]:!![],'where':_0x3bc12b[_0x2f6a('0x6')]?_0x3bc12b[_0x2f6a('0x6')][_0x2f6a('0x7')]||null:null,'attributes':_0x3bc12b[_0x2f6a('0x6')]?_0x3bc12b[_0x2f6a('0x6')][_0x2f6a('0xa')]||null:null,'include':_0x3bc12b[_0x2f6a('0x6')]?_0x3bc12b['options'][_0x2f6a('0x8')]?_[_0x2f6a('0x9')](_0x3bc12b[_0x2f6a('0x6')][_0x2f6a('0x8')],function(_0xe62b0f){return{'model':db[_0xe62b0f[_0x2f6a('0xb')]],'as':_0xe62b0f['as'],'attributes':_0xe62b0f[_0x2f6a('0xa')],'include':_0xe62b0f[_0x2f6a('0x8')]?_[_0x2f6a('0x9')](_0xe62b0f[_0x2f6a('0x8')],function(_0x3541d4){return{'model':db[_0x3541d4['model']],'as':_0x3541d4['as'],'attributes':_0x3541d4[_0x2f6a('0xa')],'include':_0x3541d4[_0x2f6a('0x8')]?_[_0x2f6a('0x9')](_0x3541d4[_0x2f6a('0x8')],function(_0x172955){return{'model':db[_0x172955[_0x2f6a('0xb')]],'as':_0x172955['as'],'attributes':_0x172955[_0x2f6a('0xa')]};}):[]};}):[]};}):[]:[]})[_0x2f6a('0xc')](function(_0x4c853e){logger[_0x2f6a('0x14')]('ShowInterval',_0x3bc12b);logger[_0x2f6a('0xe')](_0x2f6a('0x15'),_0x3bc12b,JSON[_0x2f6a('0xf')](_0x4c853e));_0x33f299(_0x4c853e);})[_0x2f6a('0x16')](function(_0x28f700){logger['error']('ShowInterval',_0x28f700['message'],_0x3bc12b);_0x45ba8e(_0x5cc67b[_0x2f6a('0x11')](0x1f4,_0x28f700['message']));});});};function checkArrayOfIntervals(_0x3b7558,_0x35f43b){var _0x5b4aa2=[];return db[_0x2f6a('0x4')][_0x2f6a('0x5')]({'where':{'id':_0x3b7558}})[_0x2f6a('0xc')](function(_0x2a0022){_0x5b4aa2=_0x2a0022;return Promise[_0x2f6a('0x17')](_0x5b4aa2[_0x2f6a('0x9')](function(_0x2523b8){return _0x2523b8[_0x2f6a('0x18')](_0x35f43b);}));})['then'](function(_0x480fd8){var _0x455ebc=_0x480fd8[_0x2f6a('0x19')](function(_0x3056d6,_0x11ff4f){return _0x3056d6||_0x11ff4f;},![]);logger['info'](util['format'](_0x2f6a('0x1a'),_0x5b4aa2[_0x2f6a('0x9')](function(_0x17ed09){return _0x17ed09[_0x2f6a('0x1b')];})[_0x2f6a('0x1c')](',\x20'),_0x5b4aa2['map'](function(_0x2f9d2f){return _0x2f9d2f['id'];})['join'](',\x20')));return _0x455ebc;});}function checkSingleInterval(_0x3ab6a6,_0x23ad67){return db['Interval'][_0x2f6a('0x1d')](_0x3ab6a6)['then'](function(_0x3ef5d8){if(_0x3ef5d8){logger[_0x2f6a('0x14')](util[_0x2f6a('0x1e')](_0x2f6a('0x1f'),_0x3ef5d8[_0x2f6a('0x1b')],_0x3ef5d8['id']));return _0x3ef5d8[_0x2f6a('0x18')](_0x23ad67);}});}exports['IntervalIftime']=function(_0x139f95){var _0x3fb24e=_0x139f95[_0x2f6a('0x20')];var _0x1c36d2=Array['isArray'](_0x139f95[_0x2f6a('0x21')])?_0x139f95['intervals']:typeof _0x139f95[_0x2f6a('0x21')]===_0x2f6a('0x22')?[_0x139f95[_0x2f6a('0x21')]]:[];var _0x58d262=_0x139f95[_0x2f6a('0x23')]||undefined;var _0x29e3b9=![];if(_0x1c36d2[_0x2f6a('0x24')]){logger[_0x2f6a('0x14')](util['format'](_0x2f6a('0x25'),_0x1c36d2['join'](';\x20')));}if(_0x58d262){logger['info'](util[_0x2f6a('0x1e')](_0x2f6a('0x26'),_0x58d262));}logger[_0x2f6a('0xe')]('Iftime',_0x29e3b9);logger[_0x2f6a('0x27')](_0x2f6a('0x28'),_0x139f95);return Promise[_0x2f6a('0x29')]()['then'](function(){if(Array['isArray'](_0x3fb24e)){return checkArrayOfIntervals(_0x3fb24e,_0x58d262);}else if(_0x3fb24e){return checkSingleInterval(_0x3fb24e,_0x58d262);}})[_0x2f6a('0xc')](function(_0x5d0640){var _0x5503d5=_0x1c36d2[_0x2f6a('0x19')](function(_0x98c2ba,_0x3aa739){return _0x98c2ba||iftime(_0x3aa739,_0x58d262);},![]);_0x29e3b9=_0x5d0640||_0x5503d5;return _0x29e3b9;})[_0x2f6a('0x16')](function(_0x3ae1d6){logger['error'](_0x2f6a('0x28'),_0x139f95,_0x3ae1d6);throw this[_0x2f6a('0x11')](0x1f4,_0x3ae1d6[_0x2f6a('0x10')]);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 2ee7425..222edb5 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['exports','express','../../components/auth/service','post','isAuthenticated','send'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x0b0e,0x187));var _0xe0b0=function(_0x284807,_0x4be925){_0x284807=_0x284807-0x0;var _0x50c774=_0x0b0e[_0x284807];return _0x50c774;};'use strict';var express=require(_0xe0b0('0x0'));var router=express['Router']();var auth=require(_0xe0b0('0x1'));var controller=require('./jira.controller');router[_0xe0b0('0x2')]('/',auth[_0xe0b0('0x3')](),controller[_0xe0b0('0x4')]);module[_0xe0b0('0x5')]=router; \ No newline at end of file +var _0xb10b=['./jira.controller','post','send','exports','express','../../components/auth/service'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0xb10b,0x12a));var _0xbb10=function(_0x20f08b,_0x646ea0){_0x20f08b=_0x20f08b-0x0;var _0x675062=_0xb10b[_0x20f08b];return _0x675062;};'use strict';var express=require(_0xbb10('0x0'));var router=express['Router']();var auth=require(_0xbb10('0x1'));var controller=require(_0xbb10('0x2'));router[_0xbb10('0x3')]('/',auth['isAuthenticated'](),controller[_0xbb10('0x4')]);module[_0xbb10('0x5')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 98c1907..8609d24 100644 --- a/server/api/jira/jira.controller.js +++ b/server/api/jira/jira.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2452=['description','issuetype','Bug','fields','customfield_11500','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','POST','application/json','stringify','request','setEncoding','utf8','end','status','statusCode','json','parse','error','api.jira','write','openIssue','send','body','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','summary','\x20from\x20'];(function(_0x2851e2,_0x2fdf15){var _0x314bc9=function(_0x4457e4){while(--_0x4457e4){_0x2851e2['push'](_0x2851e2['shift']());}};_0x314bc9(++_0x2fdf15);}(_0x2452,0xcf));var _0x2245=function(_0x8fb035,_0x217b6d){_0x8fb035=_0x8fb035-0x0;var _0x3a678d=_0x2452[_0x8fb035];return _0x3a678d;};'use strict';var BPromise=require(_0x2245('0x0'));var https=require(_0x2245('0x1'));var logger=require(_0x2245('0x2'))(_0x2245('0x3'));var USERNAME=_0x2245('0x4');var PASSWORD=_0x2245('0x5');function openIssue(_0x495a52,_0x493427){var _0x1d9af2={'fields':{'project':{'key':_0x495a52['key']||'MOTGUI'},'summary':(_0x495a52[_0x2245('0x6')]||'Report')+_0x2245('0x7')+_0x495a52['ip'],'description':_0x495a52[_0x2245('0x8')]||JSON['stringify'](_0x495a52),'issuetype':{'name':_0x495a52[_0x2245('0x9')]||_0x2245('0xa')}}};_0x1d9af2[_0x2245('0xb')][_0x2245('0xc')]=_0x495a52['email'];_0x1d9af2[_0x2245('0xb')]['customfield_11501']=_0x495a52['oldToken'];_0x1d9af2[_0x2245('0xb')][_0x2245('0xd')]=_0x495a52[_0x2245('0xe')];_0x1d9af2[_0x2245('0xb')][_0x2245('0xf')]=_0x495a52[_0x2245('0x10')];_0x1d9af2[_0x2245('0xb')][_0x2245('0x11')]=_0x495a52[_0x2245('0x12')];_0x1d9af2['fields'][_0x2245('0x13')]=_0x495a52['ip'];var _0xaf55be={'host':_0x2245('0x14'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x2245('0x15'),'timeout':0x4e20,'headers':{'Content-Type':_0x2245('0x16'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)['toString']('base64')}};var _0x5a677b=JSON[_0x2245('0x17')](_0x1d9af2);var _0x4753ea=https[_0x2245('0x18')](_0xaf55be,function(_0x1ff2bf){_0x1ff2bf[_0x2245('0x19')](_0x2245('0x1a'));var _0x1a76e1='';_0x1ff2bf['on']('data',function(_0x586cbf){_0x1a76e1+=_0x586cbf;});_0x1ff2bf['on'](_0x2245('0x1b'),function(){if(_0x493427){return _0x493427[_0x2245('0x1c')](_0x1ff2bf[_0x2245('0x1d')])[_0x2245('0x1e')](JSON[_0x2245('0x1f')](_0x1a76e1));}});});_0x4753ea['on'](_0x2245('0x20'),function(_0x1216f1){if(_0x493427){return _0x493427[_0x2245('0x1c')](0x1f4)[_0x2245('0x1e')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x2245('0x21')}]});}});_0x4753ea[_0x2245('0x22')](_0x5a677b);_0x4753ea['end']();}exports[_0x2245('0x23')]=openIssue;exports[_0x2245('0x24')]=function(_0x5c0d4a,_0x1d2744){_0x5c0d4a[_0x2245('0x25')]['ip']=_0x5c0d4a[_0x2245('0x26')][_0x2245('0x27')]||_0x5c0d4a[_0x2245('0x28')][_0x2245('0x29')]||_0x5c0d4a['socket']['remoteAddress']||_0x5c0d4a[_0x2245('0x28')][_0x2245('0x2a')][_0x2245('0x29')];return openIssue(_0x5c0d4a[_0x2245('0x25')],_0x1d2744);}; \ No newline at end of file +var _0x9976=['parse','status','write','openIssue','send','headers','x-forwarded-for','connection','remoteAddress','socket','body','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','issuetype','Bug','fields','customfield_11500','email','oldToken','customfield_11502','newToken','name','customfield_11504','customfield_10102','POST','application/json','Basic\x20','base64','stringify','request','utf8','data','end','json'];(function(_0x8abd64,_0x539570){var _0xd2511e=function(_0x9fef7d){while(--_0x9fef7d){_0x8abd64['push'](_0x8abd64['shift']());}};_0xd2511e(++_0x539570);}(_0x9976,0x163));var _0x6997=function(_0x347b72,_0x265f18){_0x347b72=_0x347b72-0x0;var _0x371016=_0x9976[_0x347b72];return _0x371016;};'use strict';var BPromise=require('bluebird');var https=require(_0x6997('0x0'));var logger=require(_0x6997('0x1'))(_0x6997('0x2'));var USERNAME=_0x6997('0x3');var PASSWORD=_0x6997('0x4');function openIssue(_0x4c27be,_0xa8f9a4){var _0x33e0f1={'fields':{'project':{'key':_0x4c27be[_0x6997('0x5')]||_0x6997('0x6')},'summary':(_0x4c27be[_0x6997('0x7')]||_0x6997('0x8'))+_0x6997('0x9')+_0x4c27be['ip'],'description':_0x4c27be[_0x6997('0xa')]||JSON['stringify'](_0x4c27be),'issuetype':{'name':_0x4c27be[_0x6997('0xb')]||_0x6997('0xc')}}};_0x33e0f1[_0x6997('0xd')][_0x6997('0xe')]=_0x4c27be[_0x6997('0xf')];_0x33e0f1[_0x6997('0xd')]['customfield_11501']=_0x4c27be[_0x6997('0x10')];_0x33e0f1[_0x6997('0xd')][_0x6997('0x11')]=_0x4c27be[_0x6997('0x12')];_0x33e0f1['fields']['customfield_11503']=_0x4c27be[_0x6997('0x13')];_0x33e0f1[_0x6997('0xd')][_0x6997('0x14')]=_0x4c27be['reason'];_0x33e0f1[_0x6997('0xd')][_0x6997('0x15')]=_0x4c27be['ip'];var _0x42a718={'host':'track.xcallymotion.com','port':0x1bb,'path':'/rest/api/2/issue','method':_0x6997('0x16'),'timeout':0x4e20,'headers':{'Content-Type':_0x6997('0x17'),'Authorization':_0x6997('0x18')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x6997('0x19'))}};var _0x5b508c=JSON[_0x6997('0x1a')](_0x33e0f1);var _0x21e0b7=https[_0x6997('0x1b')](_0x42a718,function(_0x10da4c){_0x10da4c['setEncoding'](_0x6997('0x1c'));var _0x1b5b1a='';_0x10da4c['on'](_0x6997('0x1d'),function(_0x3ea455){_0x1b5b1a+=_0x3ea455;});_0x10da4c['on'](_0x6997('0x1e'),function(){if(_0xa8f9a4){return _0xa8f9a4['status'](_0x10da4c['statusCode'])[_0x6997('0x1f')](JSON[_0x6997('0x20')](_0x1b5b1a));}});});_0x21e0b7['on']('error',function(_0xcddb1a){if(_0xa8f9a4){return _0xa8f9a4[_0x6997('0x21')](0x1f4)['json']({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':'api.jira'}]});}});_0x21e0b7[_0x6997('0x22')](_0x5b508c);_0x21e0b7[_0x6997('0x1e')]();}exports[_0x6997('0x23')]=openIssue;exports[_0x6997('0x24')]=function(_0x3390ec,_0x99b144){_0x3390ec['body']['ip']=_0x3390ec[_0x6997('0x25')][_0x6997('0x26')]||_0x3390ec[_0x6997('0x27')][_0x6997('0x28')]||_0x3390ec[_0x6997('0x29')][_0x6997('0x28')]||_0x3390ec['connection'][_0x6997('0x29')]['remoteAddress'];return openIssue(_0x3390ec[_0x6997('0x2a')],_0x99b144);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 05082e7..26ad190 100644 --- a/server/api/jscriptyAnswerReport/index.js +++ b/server/api/jscriptyAnswerReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda55=['../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','isAuthenticated','get','/describe','describe','/:id','show','create','put','update','delete','destroy','multer','util','express','Router','fs-extra'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0xda55,0x6d));var _0x5da5=function(_0xac0f5e,_0x5303ea){_0xac0f5e=_0xac0f5e-0x0;var _0x5a1029=_0xda55[_0xac0f5e];return _0x5a1029;};'use strict';var multer=require(_0x5da5('0x0'));var util=require(_0x5da5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5da5('0x2'));var router=express[_0x5da5('0x3')]();var fs_extra=require(_0x5da5('0x4'));var auth=require(_0x5da5('0x5'));var interaction=require(_0x5da5('0x6'));var config=require('../../config/environment');var controller=require(_0x5da5('0x7'));router['get']('/',auth[_0x5da5('0x8')](),controller['index']);router[_0x5da5('0x9')](_0x5da5('0xa'),auth[_0x5da5('0x8')](),controller[_0x5da5('0xb')]);router[_0x5da5('0x9')](_0x5da5('0xc'),auth[_0x5da5('0x8')](),controller[_0x5da5('0xd')]);router['post']('/',auth[_0x5da5('0x8')](),controller[_0x5da5('0xe')]);router[_0x5da5('0xf')](_0x5da5('0xc'),auth[_0x5da5('0x8')](),controller[_0x5da5('0x10')]);router[_0x5da5('0x11')]('/:id',auth[_0x5da5('0x8')](),controller[_0x5da5('0x12')]);module['exports']=router; \ No newline at end of file +var _0x6324=['path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','show','create','put','/:id','update','delete','exports','multer','util'];(function(_0xfd3da,_0x2f7827){var _0x268e85=function(_0x45b22c){while(--_0x45b22c){_0xfd3da['push'](_0xfd3da['shift']());}};_0x268e85(++_0x2f7827);}(_0x6324,0x142));var _0x4632=function(_0x5d0818,_0x188411){_0x5d0818=_0x5d0818-0x0;var _0x37fcdb=_0x6324[_0x5d0818];return _0x37fcdb;};'use strict';var multer=require(_0x4632('0x0'));var util=require(_0x4632('0x1'));var path=require(_0x4632('0x2'));var timeout=require(_0x4632('0x3'));var express=require('express');var router=express[_0x4632('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4632('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4632('0x6'));var controller=require('./jscriptyAnswerReport.controller');router[_0x4632('0x7')]('/',auth[_0x4632('0x8')](),controller[_0x4632('0x9')]);router[_0x4632('0x7')]('/describe',auth[_0x4632('0x8')](),controller[_0x4632('0xa')]);router[_0x4632('0x7')]('/:id',auth[_0x4632('0x8')](),controller[_0x4632('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4632('0xc')]);router[_0x4632('0xd')](_0x4632('0xe'),auth[_0x4632('0x8')](),controller[_0x4632('0xf')]);router[_0x4632('0x10')](_0x4632('0xe'),auth[_0x4632('0x8')](),controller['destroy']);module[_0x4632('0x11')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index dc7b984..3b5923e 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x7a54,0x106));var _0x47a5=function(_0x403463,_0x24d7f4){_0x403463=_0x403463-0x0;var _0x56f397=_0x7a54[_0x403463];return _0x56f397;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x7a54,0x106));var _0x47a5=function(_0x31e7b8,_0x57c4a7){_0x31e7b8=_0x31e7b8-0x0;var _0x50623a=_0x7a54[_0x31e7b8];return _0x50623a;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index 1b93ba6..2cd848b 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xea31=['map','rawAttributes','fieldName','type','key','query','filters','attributes','intersection','model','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','JscriptyAnswerReport','includeAll','include','findAll','catch','params','keys','length','options','create','update','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','then','destroy','error','stack','name','send','index'];(function(_0x11946c,_0x12152c){var _0x383935=function(_0x61fce2){while(--_0x61fce2){_0x11946c['push'](_0x11946c['shift']());}};_0x383935(++_0x12152c);}(_0xea31,0x6b));var _0x1ea3=function(_0x34c6b6,_0x7fd428){_0x34c6b6=_0x34c6b6-0x0;var _0x25719e=_0xea31[_0x34c6b6];return _0x25719e;};'use strict';var emlformat=require(_0x1ea3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1ea3('0x1'));var jsonpatch=require(_0x1ea3('0x2'));var rp=require(_0x1ea3('0x3'));var moment=require(_0x1ea3('0x4'));var BPromise=require(_0x1ea3('0x5'));var Mustache=require(_0x1ea3('0x6'));var util=require(_0x1ea3('0x7'));var path=require('path');var sox=require(_0x1ea3('0x8'));var csv=require(_0x1ea3('0x9'));var ejs=require(_0x1ea3('0xa'));var fs=require('fs');var fs_extra=require(_0x1ea3('0xb'));var _=require(_0x1ea3('0xc'));var squel=require('squel');var crypto=require(_0x1ea3('0xd'));var jsforce=require(_0x1ea3('0xe'));var deskjs=require(_0x1ea3('0xf'));var toCsv=require(_0x1ea3('0x9'));var querystring=require(_0x1ea3('0x10'));var Papa=require(_0x1ea3('0x11'));var Redis=require('ioredis');var authService=require(_0x1ea3('0x12'));var qs=require(_0x1ea3('0x13'));var as=require(_0x1ea3('0x14'));var hardwareService=require(_0x1ea3('0x15'));var logger=require(_0x1ea3('0x16'))(_0x1ea3('0x17'));var utils=require(_0x1ea3('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x1ea3('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3fe537,_0x2fc7f4){_0x2fc7f4=_0x2fc7f4||0xcc;return function(_0x4305d3){if(_0x4305d3){return _0x3fe537['sendStatus'](_0x2fc7f4);}return _0x3fe537[_0x1ea3('0x1a')](_0x2fc7f4)[_0x1ea3('0x1b')]();};}function respondWithResult(_0x2fd1c9,_0x4b0af9){_0x4b0af9=_0x4b0af9||0xc8;return function(_0x1624ee){if(_0x1624ee){return _0x2fd1c9[_0x1ea3('0x1a')](_0x4b0af9)[_0x1ea3('0x1c')](_0x1624ee);}};}function respondWithFilteredResult(_0x3d0e71,_0x319de8){return function(_0x3fe673){if(_0x3fe673){var _0x29ceac=typeof _0x319de8['offset']===_0x1ea3('0x1d')&&typeof _0x319de8[_0x1ea3('0x1e')]===_0x1ea3('0x1d');var _0x2f6e6f=_0x3fe673[_0x1ea3('0x1f')];var _0x541e18=_0x29ceac?0x0:_0x319de8[_0x1ea3('0x20')];var _0x2a8b47=_0x29ceac?_0x3fe673[_0x1ea3('0x1f')]:_0x319de8['offset']+_0x319de8[_0x1ea3('0x1e')];var _0x21364e;if(_0x2a8b47>=_0x2f6e6f){_0x2a8b47=_0x2f6e6f;_0x21364e=0xc8;}else{_0x21364e=0xce;}_0x3d0e71[_0x1ea3('0x1a')](_0x21364e);return _0x3d0e71['set'](_0x1ea3('0x21'),_0x541e18+'-'+_0x2a8b47+'/'+_0x2f6e6f)['json'](_0x3fe673);}return null;};}function patchUpdates(_0x276e4d){return function(_0x405ec0){try{jsonpatch[_0x1ea3('0x22')](_0x405ec0,_0x276e4d,!![]);}catch(_0x5bad21){return BPromise[_0x1ea3('0x23')](_0x5bad21);}return _0x405ec0['save']();};}function saveUpdates(_0x4582af,_0x498455){return function(_0x941a50){if(_0x941a50){return _0x941a50['update'](_0x4582af)[_0x1ea3('0x24')](function(_0x388019){return _0x388019;});}return null;};}function removeEntity(_0x246231,_0x5ad8ff){return function(_0x50703d){if(_0x50703d){return _0x50703d[_0x1ea3('0x25')]()['then'](function(){_0x246231[_0x1ea3('0x1a')](0xcc)[_0x1ea3('0x1b')]();});}};}function handleEntityNotFound(_0x3c42f3,_0x91abee){return function(_0xa2b868){if(!_0xa2b868){_0x3c42f3['sendStatus'](0x194);}return _0xa2b868;};}function handleError(_0x50e511,_0x30cf8d){_0x30cf8d=_0x30cf8d||0x1f4;return function(_0x2edfb4){logger[_0x1ea3('0x26')](_0x2edfb4[_0x1ea3('0x27')]);if(_0x2edfb4[_0x1ea3('0x28')]){delete _0x2edfb4[_0x1ea3('0x28')];}_0x50e511[_0x1ea3('0x1a')](_0x30cf8d)[_0x1ea3('0x29')](_0x2edfb4);};}exports[_0x1ea3('0x2a')]=function(_0x3d9b63,_0x3bc186){var _0x33f5f2={},_0x2c29d7={},_0x1a020e={'count':0x0,'rows':[]};var _0xdbd7e3=_[_0x1ea3('0x2b')](db['JscriptyAnswerReport'][_0x1ea3('0x2c')],function(_0x366312){return{'name':_0x366312[_0x1ea3('0x2d')],'type':_0x366312[_0x1ea3('0x2e')][_0x1ea3('0x2f')]};});_0x2c29d7['model']=_['map'](_0xdbd7e3,_0x1ea3('0x28'));_0x2c29d7[_0x1ea3('0x30')]=_['keys'](_0x3d9b63[_0x1ea3('0x30')]);_0x2c29d7[_0x1ea3('0x31')]=_['intersection'](_0x2c29d7['model'],_0x2c29d7[_0x1ea3('0x30')]);_0x33f5f2[_0x1ea3('0x32')]=_[_0x1ea3('0x33')](_0x2c29d7[_0x1ea3('0x34')],qs[_0x1ea3('0x35')](_0x3d9b63[_0x1ea3('0x30')][_0x1ea3('0x35')]));_0x33f5f2[_0x1ea3('0x32')]=_0x33f5f2[_0x1ea3('0x32')]['length']?_0x33f5f2[_0x1ea3('0x32')]:_0x2c29d7[_0x1ea3('0x34')];if(!_0x3d9b63[_0x1ea3('0x30')][_0x1ea3('0x36')](_0x1ea3('0x37'))){_0x33f5f2[_0x1ea3('0x1e')]=qs[_0x1ea3('0x1e')](_0x3d9b63[_0x1ea3('0x30')][_0x1ea3('0x1e')]);_0x33f5f2[_0x1ea3('0x20')]=qs['offset'](_0x3d9b63[_0x1ea3('0x30')]['offset']);}_0x33f5f2[_0x1ea3('0x38')]=qs['sort'](_0x3d9b63['query'][_0x1ea3('0x39')]);_0x33f5f2['where']=qs['filters'](_['pick'](_0x3d9b63[_0x1ea3('0x30')],_0x2c29d7[_0x1ea3('0x31')]),_0xdbd7e3);if(_0x3d9b63[_0x1ea3('0x30')][_0x1ea3('0x3a')]){_0x33f5f2[_0x1ea3('0x3b')]=_['merge'](_0x33f5f2[_0x1ea3('0x3b')],{'$or':_['map'](_0xdbd7e3,function(_0x441442){if(_0x441442[_0x1ea3('0x2e')]!=='VIRTUAL'){var _0x102757={};_0x102757[_0x441442[_0x1ea3('0x28')]]={'$like':'%'+_0x3d9b63[_0x1ea3('0x30')][_0x1ea3('0x3a')]+'%'};return _0x102757;}})});}_0x33f5f2=_[_0x1ea3('0x3c')]({},_0x33f5f2,_0x3d9b63['options']);var _0x12da5a={'where':_0x33f5f2['where']};return db[_0x1ea3('0x3d')][_0x1ea3('0x1f')](_0x12da5a)[_0x1ea3('0x24')](function(_0x47028d){_0x1a020e[_0x1ea3('0x1f')]=_0x47028d;if(_0x3d9b63[_0x1ea3('0x30')][_0x1ea3('0x3e')]){_0x33f5f2[_0x1ea3('0x3f')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x1ea3('0x40')](_0x33f5f2);})[_0x1ea3('0x24')](function(_0x2108e8){_0x1a020e['rows']=_0x2108e8;return _0x1a020e;})[_0x1ea3('0x24')](respondWithFilteredResult(_0x3bc186,_0x33f5f2))[_0x1ea3('0x41')](handleError(_0x3bc186,null));};exports['show']=function(_0x15f00a,_0x43c48d){var _0x58ba87={'raw':!![],'where':{'id':_0x15f00a[_0x1ea3('0x42')]['id']}},_0x133f48={};_0x133f48[_0x1ea3('0x34')]=_[_0x1ea3('0x43')](db[_0x1ea3('0x3d')][_0x1ea3('0x2c')]);_0x133f48['query']=_[_0x1ea3('0x43')](_0x15f00a[_0x1ea3('0x30')]);_0x133f48[_0x1ea3('0x31')]=_['intersection'](_0x133f48[_0x1ea3('0x34')],_0x133f48[_0x1ea3('0x30')]);_0x58ba87[_0x1ea3('0x32')]=_[_0x1ea3('0x33')](_0x133f48[_0x1ea3('0x34')],qs[_0x1ea3('0x35')](_0x15f00a[_0x1ea3('0x30')][_0x1ea3('0x35')]));_0x58ba87[_0x1ea3('0x32')]=_0x58ba87[_0x1ea3('0x32')][_0x1ea3('0x44')]?_0x58ba87['attributes']:_0x133f48[_0x1ea3('0x34')];if(_0x15f00a[_0x1ea3('0x30')][_0x1ea3('0x3e')]){_0x58ba87[_0x1ea3('0x3f')]=[{'all':!![]}];}_0x58ba87=_['merge']({},_0x58ba87,_0x15f00a[_0x1ea3('0x45')]);return db[_0x1ea3('0x3d')]['find'](_0x58ba87)[_0x1ea3('0x24')](handleEntityNotFound(_0x43c48d,null))[_0x1ea3('0x24')](respondWithResult(_0x43c48d,null))[_0x1ea3('0x41')](handleError(_0x43c48d,null));};exports[_0x1ea3('0x46')]=function(_0x454156,_0x28955f){return db[_0x1ea3('0x3d')]['create'](_0x454156['body'],{})['then'](respondWithResult(_0x28955f,0xc9))[_0x1ea3('0x41')](handleError(_0x28955f,null));};exports[_0x1ea3('0x47')]=function(_0xf69557,_0x2de88d){if(_0xf69557[_0x1ea3('0x48')]['id']){delete _0xf69557['body']['id'];}return db[_0x1ea3('0x3d')]['find']({'where':{'id':_0xf69557[_0x1ea3('0x42')]['id']}})[_0x1ea3('0x24')](handleEntityNotFound(_0x2de88d,null))['then'](saveUpdates(_0xf69557['body'],null))[_0x1ea3('0x24')](respondWithResult(_0x2de88d,null))[_0x1ea3('0x41')](handleError(_0x2de88d,null));};exports[_0x1ea3('0x25')]=function(_0x43f296,_0x4822b2){return db[_0x1ea3('0x3d')][_0x1ea3('0x49')]({'where':{'id':_0x43f296['params']['id']}})['then'](handleEntityNotFound(_0x4822b2,null))[_0x1ea3('0x24')](removeEntity(_0x4822b2,null))['catch'](handleError(_0x4822b2,null));};exports[_0x1ea3('0x4a')]=function(_0xee8f20,_0x409f8f){return db[_0x1ea3('0x3d')][_0x1ea3('0x4a')]()[_0x1ea3('0x24')](respondWithResult(_0x409f8f,null))[_0x1ea3('0x41')](handleError(_0x409f8f,null));}; \ No newline at end of file +var _0xab86=['fieldName','type','key','model','keys','intersection','attributes','fields','length','query','hasOwnProperty','nolimit','order','sort','filters','pick','merge','filter','options','includeAll','findAll','rows','catch','show','params','find','create','body','update','describe','eml-format','rimraf','zip-dir','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','then','destroy','sendStatus','stack','name','send','map','JscriptyAnswerReport','rawAttributes'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xab86,0x13e));var _0x6ab8=function(_0x364c9c,_0x3c57a0){_0x364c9c=_0x364c9c-0x0;var _0x3f52a1=_0xab86[_0x364c9c];return _0x3f52a1;};'use strict';var emlformat=require(_0x6ab8('0x0'));var rimraf=require(_0x6ab8('0x1'));var zipdir=require(_0x6ab8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6ab8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6ab8('0x4'));var util=require('util');var path=require(_0x6ab8('0x5'));var sox=require(_0x6ab8('0x6'));var csv=require(_0x6ab8('0x7'));var ejs=require(_0x6ab8('0x8'));var fs=require('fs');var fs_extra=require(_0x6ab8('0x9'));var _=require(_0x6ab8('0xa'));var squel=require(_0x6ab8('0xb'));var crypto=require(_0x6ab8('0xc'));var jsforce=require(_0x6ab8('0xd'));var deskjs=require(_0x6ab8('0xe'));var toCsv=require(_0x6ab8('0x7'));var querystring=require(_0x6ab8('0xf'));var Papa=require(_0x6ab8('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6ab8('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6ab8('0x12'));var logger=require(_0x6ab8('0x13'))(_0x6ab8('0x14'));var utils=require('../../config/utils');var config=require(_0x6ab8('0x15'));var licenseUtil=require(_0x6ab8('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44d1d9,_0x1b9b34){_0x1b9b34=_0x1b9b34||0xcc;return function(_0x408ce1){if(_0x408ce1){return _0x44d1d9['sendStatus'](_0x1b9b34);}return _0x44d1d9[_0x6ab8('0x17')](_0x1b9b34)[_0x6ab8('0x18')]();};}function respondWithResult(_0x60b50,_0x968bac){_0x968bac=_0x968bac||0xc8;return function(_0x1c83a1){if(_0x1c83a1){return _0x60b50[_0x6ab8('0x17')](_0x968bac)[_0x6ab8('0x19')](_0x1c83a1);}};}function respondWithFilteredResult(_0x2043bb,_0x293389){return function(_0x5218e9){if(_0x5218e9){var _0x1f64a3=typeof _0x293389[_0x6ab8('0x1a')]===_0x6ab8('0x1b')&&typeof _0x293389['limit']===_0x6ab8('0x1b');var _0x35b790=_0x5218e9['count'];var _0x543726=_0x1f64a3?0x0:_0x293389[_0x6ab8('0x1a')];var _0x57cd18=_0x1f64a3?_0x5218e9[_0x6ab8('0x1c')]:_0x293389[_0x6ab8('0x1a')]+_0x293389[_0x6ab8('0x1d')];var _0x4e0fbd;if(_0x57cd18>=_0x35b790){_0x57cd18=_0x35b790;_0x4e0fbd=0xc8;}else{_0x4e0fbd=0xce;}_0x2043bb[_0x6ab8('0x17')](_0x4e0fbd);return _0x2043bb[_0x6ab8('0x1e')](_0x6ab8('0x1f'),_0x543726+'-'+_0x57cd18+'/'+_0x35b790)[_0x6ab8('0x19')](_0x5218e9);}return null;};}function patchUpdates(_0x5227c6){return function(_0x301004){try{jsonpatch[_0x6ab8('0x20')](_0x301004,_0x5227c6,!![]);}catch(_0x520cd8){return BPromise['reject'](_0x520cd8);}return _0x301004['save']();};}function saveUpdates(_0x190af2,_0x46cfdc){return function(_0xe2d5d8){if(_0xe2d5d8){return _0xe2d5d8['update'](_0x190af2)[_0x6ab8('0x21')](function(_0x433f37){return _0x433f37;});}return null;};}function removeEntity(_0x50fc50,_0x503f94){return function(_0x8af7e9){if(_0x8af7e9){return _0x8af7e9[_0x6ab8('0x22')]()['then'](function(){_0x50fc50[_0x6ab8('0x17')](0xcc)[_0x6ab8('0x18')]();});}};}function handleEntityNotFound(_0x24e400,_0x3d614b){return function(_0x3ddaeb){if(!_0x3ddaeb){_0x24e400[_0x6ab8('0x23')](0x194);}return _0x3ddaeb;};}function handleError(_0x2e098f,_0x1e26ed){_0x1e26ed=_0x1e26ed||0x1f4;return function(_0x5a1be3){logger['error'](_0x5a1be3[_0x6ab8('0x24')]);if(_0x5a1be3['name']){delete _0x5a1be3[_0x6ab8('0x25')];}_0x2e098f[_0x6ab8('0x17')](_0x1e26ed)[_0x6ab8('0x26')](_0x5a1be3);};}exports['index']=function(_0x525687,_0x4871e3){var _0x79dbd3={},_0x14e822={},_0x3723a7={'count':0x0,'rows':[]};var _0x2f14ea=_[_0x6ab8('0x27')](db[_0x6ab8('0x28')][_0x6ab8('0x29')],function(_0x4eda0b){return{'name':_0x4eda0b[_0x6ab8('0x2a')],'type':_0x4eda0b[_0x6ab8('0x2b')][_0x6ab8('0x2c')]};});_0x14e822[_0x6ab8('0x2d')]=_[_0x6ab8('0x27')](_0x2f14ea,'name');_0x14e822['query']=_[_0x6ab8('0x2e')](_0x525687['query']);_0x14e822['filters']=_[_0x6ab8('0x2f')](_0x14e822[_0x6ab8('0x2d')],_0x14e822['query']);_0x79dbd3[_0x6ab8('0x30')]=_['intersection'](_0x14e822[_0x6ab8('0x2d')],qs[_0x6ab8('0x31')](_0x525687['query']['fields']));_0x79dbd3[_0x6ab8('0x30')]=_0x79dbd3[_0x6ab8('0x30')][_0x6ab8('0x32')]?_0x79dbd3[_0x6ab8('0x30')]:_0x14e822[_0x6ab8('0x2d')];if(!_0x525687[_0x6ab8('0x33')][_0x6ab8('0x34')](_0x6ab8('0x35'))){_0x79dbd3['limit']=qs[_0x6ab8('0x1d')](_0x525687[_0x6ab8('0x33')][_0x6ab8('0x1d')]);_0x79dbd3[_0x6ab8('0x1a')]=qs[_0x6ab8('0x1a')](_0x525687[_0x6ab8('0x33')]['offset']);}_0x79dbd3[_0x6ab8('0x36')]=qs[_0x6ab8('0x37')](_0x525687[_0x6ab8('0x33')]['sort']);_0x79dbd3['where']=qs[_0x6ab8('0x38')](_[_0x6ab8('0x39')](_0x525687[_0x6ab8('0x33')],_0x14e822[_0x6ab8('0x38')]),_0x2f14ea);if(_0x525687[_0x6ab8('0x33')]['filter']){_0x79dbd3['where']=_[_0x6ab8('0x3a')](_0x79dbd3['where'],{'$or':_[_0x6ab8('0x27')](_0x2f14ea,function(_0x9ca6ed){if(_0x9ca6ed['type']!=='VIRTUAL'){var _0x8d76aa={};_0x8d76aa[_0x9ca6ed[_0x6ab8('0x25')]]={'$like':'%'+_0x525687[_0x6ab8('0x33')][_0x6ab8('0x3b')]+'%'};return _0x8d76aa;}})});}_0x79dbd3=_[_0x6ab8('0x3a')]({},_0x79dbd3,_0x525687[_0x6ab8('0x3c')]);var _0xef0ce5={'where':_0x79dbd3['where']};return db['JscriptyAnswerReport'][_0x6ab8('0x1c')](_0xef0ce5)[_0x6ab8('0x21')](function(_0x146f43){_0x3723a7[_0x6ab8('0x1c')]=_0x146f43;if(_0x525687['query'][_0x6ab8('0x3d')]){_0x79dbd3['include']=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x6ab8('0x3e')](_0x79dbd3);})[_0x6ab8('0x21')](function(_0x45735d){_0x3723a7[_0x6ab8('0x3f')]=_0x45735d;return _0x3723a7;})[_0x6ab8('0x21')](respondWithFilteredResult(_0x4871e3,_0x79dbd3))[_0x6ab8('0x40')](handleError(_0x4871e3,null));};exports[_0x6ab8('0x41')]=function(_0xf3abb8,_0x2494c3){var _0x45c70d={'raw':!![],'where':{'id':_0xf3abb8[_0x6ab8('0x42')]['id']}},_0xc32c6e={};_0xc32c6e['model']=_[_0x6ab8('0x2e')](db[_0x6ab8('0x28')][_0x6ab8('0x29')]);_0xc32c6e[_0x6ab8('0x33')]=_['keys'](_0xf3abb8[_0x6ab8('0x33')]);_0xc32c6e['filters']=_[_0x6ab8('0x2f')](_0xc32c6e[_0x6ab8('0x2d')],_0xc32c6e['query']);_0x45c70d[_0x6ab8('0x30')]=_[_0x6ab8('0x2f')](_0xc32c6e['model'],qs[_0x6ab8('0x31')](_0xf3abb8[_0x6ab8('0x33')][_0x6ab8('0x31')]));_0x45c70d[_0x6ab8('0x30')]=_0x45c70d[_0x6ab8('0x30')]['length']?_0x45c70d['attributes']:_0xc32c6e['model'];if(_0xf3abb8[_0x6ab8('0x33')][_0x6ab8('0x3d')]){_0x45c70d['include']=[{'all':!![]}];}_0x45c70d=_[_0x6ab8('0x3a')]({},_0x45c70d,_0xf3abb8[_0x6ab8('0x3c')]);return db[_0x6ab8('0x28')][_0x6ab8('0x43')](_0x45c70d)[_0x6ab8('0x21')](handleEntityNotFound(_0x2494c3,null))[_0x6ab8('0x21')](respondWithResult(_0x2494c3,null))['catch'](handleError(_0x2494c3,null));};exports[_0x6ab8('0x44')]=function(_0x74de32,_0x4b00cc){return db[_0x6ab8('0x28')][_0x6ab8('0x44')](_0x74de32[_0x6ab8('0x45')],{})['then'](respondWithResult(_0x4b00cc,0xc9))['catch'](handleError(_0x4b00cc,null));};exports[_0x6ab8('0x46')]=function(_0x4c27fa,_0x31965e){if(_0x4c27fa['body']['id']){delete _0x4c27fa[_0x6ab8('0x45')]['id'];}return db[_0x6ab8('0x28')][_0x6ab8('0x43')]({'where':{'id':_0x4c27fa[_0x6ab8('0x42')]['id']}})[_0x6ab8('0x21')](handleEntityNotFound(_0x31965e,null))[_0x6ab8('0x21')](saveUpdates(_0x4c27fa['body'],null))['then'](respondWithResult(_0x31965e,null))['catch'](handleError(_0x31965e,null));};exports[_0x6ab8('0x22')]=function(_0x54708b,_0xce83a3){return db[_0x6ab8('0x28')][_0x6ab8('0x43')]({'where':{'id':_0x54708b[_0x6ab8('0x42')]['id']}})[_0x6ab8('0x21')](handleEntityNotFound(_0xce83a3,null))[_0x6ab8('0x21')](removeEntity(_0xce83a3,null))[_0x6ab8('0x40')](handleError(_0xce83a3,null));};exports[_0x6ab8('0x47')]=function(_0x4d4e88,_0x1a372b){return db[_0x6ab8('0x28')][_0x6ab8('0x47')]()[_0x6ab8('0x21')](respondWithResult(_0x1a372b,null))['catch'](handleError(_0x1a372b,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index cbcca66..6e539cb 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbb7b=['moment','request-promise','../../config/environment','define','JscriptyAnswerReport','report_jscripty_answers','util','../../config/logger','api'];(function(_0x5bae78,_0x561630){var _0x782613=function(_0x5c76cd){while(--_0x5c76cd){_0x5bae78['push'](_0x5bae78['shift']());}};_0x782613(++_0x561630);}(_0xbb7b,0x165));var _0xbbb7=function(_0xca0476,_0x2dca3f){_0xca0476=_0xca0476-0x0;var _0x4cf781=_0xbb7b[_0xca0476];return _0x4cf781;};'use strict';var _=require('lodash');var util=require(_0xbbb7('0x0'));var logger=require(_0xbbb7('0x1'))(_0xbbb7('0x2'));var moment=require(_0xbbb7('0x3'));var BPromise=require('bluebird');var rp=require(_0xbbb7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbbb7('0x5'));var attributes=require('./jscriptyAnswerReport.attributes');module['exports']=function(_0x2da836,_0x5aa3d0){return _0x2da836[_0xbbb7('0x6')](_0xbbb7('0x7'),attributes,{'tableName':_0xbbb7('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x11bb=['../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','lodash','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2793d6,_0x562665){var _0x302be5=function(_0x391de1){while(--_0x391de1){_0x2793d6['push'](_0x2793d6['shift']());}};_0x302be5(++_0x562665);}(_0x11bb,0x16d));var _0xb11b=function(_0x4e92bd,_0x56ab53){_0x4e92bd=_0x4e92bd-0x0;var _0x2e0801=_0x11bb[_0x4e92bd];return _0x2e0801;};'use strict';var _=require(_0xb11b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb11b('0x1'));var moment=require(_0xb11b('0x2'));var BPromise=require(_0xb11b('0x3'));var rp=require(_0xb11b('0x4'));var fs=require('fs');var path=require(_0xb11b('0x5'));var rimraf=require(_0xb11b('0x6'));var config=require(_0xb11b('0x7'));var attributes=require(_0xb11b('0x8'));module[_0xb11b('0x9')]=function(_0x529ba0,_0x37efe5){return _0x529ba0[_0xb11b('0xa')](_0xb11b('0xb'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 84c4118..7de91d8 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd56a=['message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyAnswerReport,\x20%s,\x20%s'];(function(_0x267e98,_0x1ded37){var _0x5c33cc=function(_0x2dce76){while(--_0x2dce76){_0x267e98['push'](_0x267e98['shift']());}};_0x5c33cc(++_0x1ded37);}(_0xd56a,0x1b7));var _0xad56=function(_0x18e279,_0x4a5c0b){_0x18e279=_0x18e279-0x0;var _0x14aeca=_0xd56a[_0x18e279];return _0x14aeca;};'use strict';var _=require(_0xad56('0x0'));var util=require(_0xad56('0x1'));var moment=require(_0xad56('0x2'));var BPromise=require(_0xad56('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xad56('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xad56('0x5'))(_0xad56('0x6'));var config=require(_0xad56('0x7'));var jayson=require(_0xad56('0x8'));var client=jayson[_0xad56('0x9')][_0xad56('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30f692,_0x49e961,_0x323c81){return new BPromise(function(_0xd01b4b,_0x3d7c28){return client[_0xad56('0xb')](_0x30f692,_0x323c81)[_0xad56('0xc')](function(_0x34725c){logger[_0xad56('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x49e961,_0xad56('0xe'));logger[_0xad56('0xf')](_0xad56('0x10'),_0x49e961,_0xad56('0xe'),JSON[_0xad56('0x11')](_0x34725c));if(_0x34725c[_0xad56('0x12')]){if(_0x34725c['error'][_0xad56('0x13')]===0x1f4){logger[_0xad56('0x12')](_0xad56('0x14'),_0x49e961,_0x34725c[_0xad56('0x12')][_0xad56('0x15')]);return _0x3d7c28(_0x34725c[_0xad56('0x12')][_0xad56('0x15')]);}logger[_0xad56('0x12')](_0xad56('0x14'),_0x49e961,_0x34725c[_0xad56('0x12')][_0xad56('0x15')]);return _0xd01b4b(_0x34725c[_0xad56('0x12')][_0xad56('0x15')]);}else{logger[_0xad56('0xd')](_0xad56('0x14'),_0x49e961,_0xad56('0xe'));_0xd01b4b(_0x34725c['result']['message']);}})[_0xad56('0x16')](function(_0x4db189){logger[_0xad56('0x12')](_0xad56('0x14'),_0x49e961,_0x4db189);_0x3d7c28(_0x4db189);});});} \ No newline at end of file +var _0x5238=['client','http','request','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x6ab2f1,_0x2ffe53){var _0x5d1b56=function(_0x1c4e99){while(--_0x1c4e99){_0x6ab2f1['push'](_0x6ab2f1['shift']());}};_0x5d1b56(++_0x2ffe53);}(_0x5238,0x6e));var _0x8523=function(_0x55f04f,_0x317d5f){_0x55f04f=_0x55f04f-0x0;var _0x4f30a1=_0x5238[_0x55f04f];return _0x4f30a1;};'use strict';var _=require(_0x8523('0x0'));var util=require(_0x8523('0x1'));var moment=require(_0x8523('0x2'));var BPromise=require(_0x8523('0x3'));var rs=require(_0x8523('0x4'));var fs=require('fs');var Redis=require(_0x8523('0x5'));var db=require(_0x8523('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8523('0x7'))(_0x8523('0x8'));var config=require('../../config/environment');var jayson=require(_0x8523('0x9'));var client=jayson[_0x8523('0xa')][_0x8523('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4615ae,_0x34aef2,_0x45de40){return new BPromise(function(_0x26732d,_0x376651){return client[_0x8523('0xc')](_0x4615ae,_0x45de40)[_0x8523('0xd')](function(_0x572c13){logger['info'](_0x8523('0xe'),_0x34aef2,_0x8523('0xf'));logger[_0x8523('0x10')](_0x8523('0x11'),_0x34aef2,_0x8523('0xf'),JSON[_0x8523('0x12')](_0x572c13));if(_0x572c13['error']){if(_0x572c13[_0x8523('0x13')]['code']===0x1f4){logger[_0x8523('0x13')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x34aef2,_0x572c13[_0x8523('0x13')][_0x8523('0x14')]);return _0x376651(_0x572c13[_0x8523('0x13')]['message']);}logger[_0x8523('0x13')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x34aef2,_0x572c13['error'][_0x8523('0x14')]);return _0x26732d(_0x572c13[_0x8523('0x13')]['message']);}else{logger[_0x8523('0x15')](_0x8523('0xe'),_0x34aef2,_0x8523('0xf'));_0x26732d(_0x572c13[_0x8523('0x16')][_0x8523('0x14')]);}})[_0x8523('0x17')](function(_0x561e36){logger[_0x8523('0x13')](_0x8523('0xe'),_0x34aef2,_0x561e36);_0x376651(_0x561e36);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 68febbd..a0c7ed3 100644 --- a/server/api/jscriptyProject/index.js +++ b/server/api/jscriptyProject/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf30f=['/:id/summary','30s','create','/:id/clone','clone','put','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','/:id/sessions','getSessions','getAnswers'];(function(_0x4f36cd,_0x5b54f9){var _0x5522d5=function(_0x12be14){while(--_0x12be14){_0x4f36cd['push'](_0x4f36cd['shift']());}};_0x5522d5(++_0x5b54f9);}(_0xf30f,0x6d));var _0xff30=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xf30f[_0x4b369d];return _0x571a98;};'use strict';var multer=require(_0xff30('0x0'));var util=require('util');var path=require(_0xff30('0x1'));var timeout=require(_0xff30('0x2'));var express=require('express');var router=express[_0xff30('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xff30('0x4'));var interaction=require(_0xff30('0x5'));var config=require(_0xff30('0x6'));var controller=require(_0xff30('0x7'));router[_0xff30('0x8')]('/',auth[_0xff30('0x9')](),controller[_0xff30('0xa')]);router[_0xff30('0x8')](_0xff30('0xb'),auth[_0xff30('0x9')](),controller[_0xff30('0xc')]);router['get'](_0xff30('0xd'),auth[_0xff30('0x9')](),controller[_0xff30('0xe')]);router[_0xff30('0x8')]('/:id/answers',auth[_0xff30('0x9')](),controller[_0xff30('0xf')]);router[_0xff30('0x8')](_0xff30('0x10'),auth[_0xff30('0x9')](),timeout(_0xff30('0x11')),controller['getSummary']);router['post']('/',auth[_0xff30('0x9')](),controller[_0xff30('0x12')]);router['post'](_0xff30('0x13'),auth['isAuthenticated'](),controller[_0xff30('0x14')]);router[_0xff30('0x15')](_0xff30('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xff30('0x16')]('/:id',auth[_0xff30('0x9')](),controller[_0xff30('0x17')]);module[_0xff30('0x18')]=router; \ No newline at end of file +var _0x0600=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptyProject.controller','get','index','/:id','isAuthenticated','/:id/sessions','getSessions','/:id/answers','getAnswers','30s','getSummary','post','create','clone','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x35f5c5,_0x55f487){var _0x1b3a55=function(_0x89cc0f){while(--_0x89cc0f){_0x35f5c5['push'](_0x35f5c5['shift']());}};_0x1b3a55(++_0x55f487);}(_0x0600,0x114));var _0x0060=function(_0x20c47c,_0x443272){_0x20c47c=_0x20c47c-0x0;var _0x1cfcd7=_0x0600[_0x20c47c];return _0x1cfcd7;};'use strict';var multer=require(_0x0060('0x0'));var util=require(_0x0060('0x1'));var path=require(_0x0060('0x2'));var timeout=require(_0x0060('0x3'));var express=require(_0x0060('0x4'));var router=express[_0x0060('0x5')]();var fs_extra=require(_0x0060('0x6'));var auth=require(_0x0060('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x0060('0x8'));var controller=require(_0x0060('0x9'));router[_0x0060('0xa')]('/',auth['isAuthenticated'](),controller[_0x0060('0xb')]);router[_0x0060('0xa')](_0x0060('0xc'),auth[_0x0060('0xd')](),controller['show']);router[_0x0060('0xa')](_0x0060('0xe'),auth[_0x0060('0xd')](),controller[_0x0060('0xf')]);router['get'](_0x0060('0x10'),auth[_0x0060('0xd')](),controller[_0x0060('0x11')]);router[_0x0060('0xa')]('/:id/summary',auth['isAuthenticated'](),timeout(_0x0060('0x12')),controller[_0x0060('0x13')]);router[_0x0060('0x14')]('/',auth[_0x0060('0xd')](),controller[_0x0060('0x15')]);router[_0x0060('0x14')]('/:id/clone',auth[_0x0060('0xd')](),controller[_0x0060('0x16')]);router[_0x0060('0x17')](_0x0060('0xc'),auth[_0x0060('0xd')](),controller[_0x0060('0x18')]);router[_0x0060('0x19')](_0x0060('0xc'),auth[_0x0060('0xd')](),controller[_0x0060('0x1a')]);module[_0x0060('0x1b')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 026e314..cb3808e 100644 --- a/server/api/jscriptyProject/jscriptyProject.attributes.js +++ b/server/api/jscriptyProject/jscriptyProject.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc240=['TEXT','long','isObjectLike','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','name','description','BOOLEAN','lodash','util','exports','STRING'];(function(_0xfee3b9,_0x528ec5){var _0x5794ef=function(_0x2f776c){while(--_0x2f776c){_0xfee3b9['push'](_0xfee3b9['shift']());}};_0x5794ef(++_0x528ec5);}(_0xc240,0x1a5));var _0x0c24=function(_0x4a9afa,_0x2f6d8d){_0x4a9afa=_0x4a9afa-0x0;var _0x2e7f04=_0xc240[_0x4a9afa];return _0x2e7f04;};'use strict';var Sequelize=require('sequelize');var _=require(_0x0c24('0x0'));var util=require(_0x0c24('0x1'));module[_0x0c24('0x2')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0x0c24('0x3')]},'formData':{'type':Sequelize[_0x0c24('0x4')](_0x0c24('0x5')),'set':function(_0x33457e){if(_[_0x0c24('0x6')](_0x33457e)){this[_0x0c24('0x7')](_0x0c24('0x8'),JSON[_0x0c24('0x9')](_0x33457e));}else if(_[_0x0c24('0xa')](_0x33457e)){this[_0x0c24('0x7')](_0x0c24('0x8'),_0x33457e);}else{this[_0x0c24('0x7')](_0x0c24('0x8'),util[_0x0c24('0xb')](_0x0c24('0xc'),this[_0x0c24('0xd')](_0x0c24('0xe'))||'',this[_0x0c24('0xd')](_0x0c24('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x0c24('0x10')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x0c24('0x10')],'defaultValue':![]}}; \ No newline at end of file +var _0xd9ca=['BOOLEAN','sequelize','lodash','exports','STRING','name','TEXT','long','formData','stringify','isString','setDataValue','getDataValue'];(function(_0x416d47,_0x308ebe){var _0x5ed3bc=function(_0x5dc47f){while(--_0x5dc47f){_0x416d47['push'](_0x416d47['shift']());}};_0x5ed3bc(++_0x308ebe);}(_0xd9ca,0x83));var _0xad9c=function(_0x15bfef,_0x9134a4){_0x15bfef=_0x15bfef-0x0;var _0x26e4c0=_0xd9ca[_0x15bfef];return _0x26e4c0;};'use strict';var Sequelize=require(_0xad9c('0x0'));var _=require(_0xad9c('0x1'));var util=require('util');module[_0xad9c('0x2')]={'name':{'type':Sequelize[_0xad9c('0x3')],'unique':_0xad9c('0x4')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xad9c('0x5')](_0xad9c('0x6')),'set':function(_0x2a8cda){if(_['isObjectLike'](_0x2a8cda)){this['setDataValue'](_0xad9c('0x7'),JSON[_0xad9c('0x8')](_0x2a8cda));}else if(_[_0xad9c('0x9')](_0x2a8cda)){this[_0xad9c('0xa')]('formData',_0x2a8cda);}else{this['setDataValue'](_0xad9c('0x7'),util['format']('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0xad9c('0xb')]('name')||'',this['getDataValue']('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xad9c('0xc')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xad9c('0xc')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 52816e3..4883605 100644 --- a/server/api/jscriptyProject/jscriptyProject.controller.js +++ b/server/api/jscriptyProject/jscriptyProject.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcdb9=['SessionId','answer','push','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','Projects','UserProfileResource','end','error','stack','name','send','index','JscriptyProject','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','Unable\x20to\x20retrieve\x20the\x20current\x20user','getSessions','nolimit','order','ProjectId','JscriptySessionReport','getAnswers','findOne','findAll','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x466247,_0x5d69e3){var _0x4b352e=function(_0x58c71b){while(--_0x58c71b){_0x466247['push'](_0x466247['shift']());}};_0x4b352e(++_0x5d69e3);}(_0xcdb9,0x82));var _0x9cdb=function(_0x3672f0,_0x2d5d35){_0x3672f0=_0x3672f0-0x0;var _0x9f5eff=_0xcdb9[_0x3672f0];return _0x9f5eff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9cdb('0x0'));var zipdir=require(_0x9cdb('0x1'));var jsonpatch=require(_0x9cdb('0x2'));var rp=require('request-promise');var moment=require(_0x9cdb('0x3'));var BPromise=require(_0x9cdb('0x4'));var Mustache=require(_0x9cdb('0x5'));var util=require(_0x9cdb('0x6'));var path=require(_0x9cdb('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9cdb('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9cdb('0x9'));var squel=require('squel');var crypto=require(_0x9cdb('0xa'));var jsforce=require(_0x9cdb('0xb'));var deskjs=require(_0x9cdb('0xc'));var toCsv=require(_0x9cdb('0xd'));var querystring=require(_0x9cdb('0xe'));var Papa=require('papaparse');var Redis=require(_0x9cdb('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9cdb('0x10'));var as=require(_0x9cdb('0x11'));var hardwareService=require(_0x9cdb('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x9cdb('0x13'));var config=require(_0x9cdb('0x14'));var licenseUtil=require(_0x9cdb('0x15'));var db=require(_0x9cdb('0x16'))['db'];function respondWithStatusCode(_0x3aecad,_0x43f539){_0x43f539=_0x43f539||0xcc;return function(_0x1ff96c){if(_0x1ff96c){return _0x3aecad['sendStatus'](_0x43f539);}return _0x3aecad[_0x9cdb('0x17')](_0x43f539)['end']();};}function respondWithResult(_0x337383,_0x42bd5b){_0x42bd5b=_0x42bd5b||0xc8;return function(_0x417a37){if(_0x417a37){return _0x337383['status'](_0x42bd5b)[_0x9cdb('0x18')](_0x417a37);}};}function respondWithFilteredResult(_0x11858c,_0x238144){return function(_0x3f0c4e){if(_0x3f0c4e){var _0x5d5579=typeof _0x238144[_0x9cdb('0x19')]==='undefined'&&typeof _0x238144[_0x9cdb('0x1a')]==='undefined';var _0x3ed04b=_0x3f0c4e[_0x9cdb('0x1b')];var _0x3e68c0=_0x5d5579?0x0:_0x238144[_0x9cdb('0x19')];var _0x248cec=_0x5d5579?_0x3f0c4e['count']:_0x238144[_0x9cdb('0x19')]+_0x238144[_0x9cdb('0x1a')];var _0x2aee5c;if(_0x248cec>=_0x3ed04b){_0x248cec=_0x3ed04b;_0x2aee5c=0xc8;}else{_0x2aee5c=0xce;}_0x11858c[_0x9cdb('0x17')](_0x2aee5c);return _0x11858c[_0x9cdb('0x1c')](_0x9cdb('0x1d'),_0x3e68c0+'-'+_0x248cec+'/'+_0x3ed04b)[_0x9cdb('0x18')](_0x3f0c4e);}return null;};}function patchUpdates(_0x50ddad){return function(_0x467884){try{jsonpatch[_0x9cdb('0x1e')](_0x467884,_0x50ddad,!![]);}catch(_0x378fa6){return BPromise[_0x9cdb('0x1f')](_0x378fa6);}return _0x467884[_0x9cdb('0x20')]();};}function saveUpdates(_0x211646,_0x5069c7){return function(_0x59df71){if(_0x59df71){return _0x59df71[_0x9cdb('0x21')](_0x211646)[_0x9cdb('0x22')](function(_0x4c5ffa){return _0x4c5ffa;});}return null;};}function removeEntity(_0x272625,_0x15d8a6){return function(_0x504fb4){if(_0x504fb4){return _0x504fb4['destroy']()[_0x9cdb('0x22')](function(){var _0x9d5230=_0x504fb4['get']({'plain':!![]});var _0x29170c=_0x9cdb('0x23');return db[_0x9cdb('0x24')]['destroy']({'where':{'type':_0x29170c,'resourceId':_0x9d5230['id']}})['then'](function(){return _0x504fb4;});})['then'](function(){_0x272625['status'](0xcc)[_0x9cdb('0x25')]();});}};}function handleEntityNotFound(_0x443da8,_0x230896){return function(_0x424ed3){if(!_0x424ed3){_0x443da8['sendStatus'](0x194);}return _0x424ed3;};}function handleError(_0x4345f3,_0x37d66e){_0x37d66e=_0x37d66e||0x1f4;return function(_0x47a21d){logger[_0x9cdb('0x26')](_0x47a21d[_0x9cdb('0x27')]);if(_0x47a21d[_0x9cdb('0x28')]){delete _0x47a21d[_0x9cdb('0x28')];}_0x4345f3[_0x9cdb('0x17')](_0x37d66e)[_0x9cdb('0x29')](_0x47a21d);};}exports[_0x9cdb('0x2a')]=function(_0x32d2db,_0x61e8c8){var _0x31912e={},_0x44f720={},_0x434617={'count':0x0,'rows':[]};var _0x253e6e=_['map'](db[_0x9cdb('0x2b')][_0x9cdb('0x2c')],function(_0x231ee7){return{'name':_0x231ee7[_0x9cdb('0x2d')],'type':_0x231ee7[_0x9cdb('0x2e')][_0x9cdb('0x2f')]};});_0x44f720[_0x9cdb('0x30')]=_[_0x9cdb('0x31')](_0x253e6e,_0x9cdb('0x28'));_0x44f720[_0x9cdb('0x32')]=_[_0x9cdb('0x33')](_0x32d2db[_0x9cdb('0x32')]);_0x44f720[_0x9cdb('0x34')]=_[_0x9cdb('0x35')](_0x44f720[_0x9cdb('0x30')],_0x44f720['query']);_0x31912e[_0x9cdb('0x36')]=_[_0x9cdb('0x35')](_0x44f720[_0x9cdb('0x30')],qs[_0x9cdb('0x37')](_0x32d2db['query'][_0x9cdb('0x37')]));_0x31912e[_0x9cdb('0x36')]=_0x31912e[_0x9cdb('0x36')][_0x9cdb('0x38')]?_0x31912e[_0x9cdb('0x36')]:_0x44f720['model'];if(!_0x32d2db['query'][_0x9cdb('0x39')]('nolimit')){_0x31912e[_0x9cdb('0x1a')]=qs[_0x9cdb('0x1a')](_0x32d2db['query']['limit']);_0x31912e['offset']=qs[_0x9cdb('0x19')](_0x32d2db[_0x9cdb('0x32')][_0x9cdb('0x19')]);}_0x31912e['order']=qs[_0x9cdb('0x3a')](_0x32d2db[_0x9cdb('0x32')]['sort']);_0x31912e[_0x9cdb('0x3b')]=qs['filters'](_[_0x9cdb('0x3c')](_0x32d2db[_0x9cdb('0x32')],_0x44f720['filters']),_0x253e6e);if(_0x32d2db['query'][_0x9cdb('0x3d')]){_0x31912e[_0x9cdb('0x3b')]=_[_0x9cdb('0x3e')](_0x31912e[_0x9cdb('0x3b')],{'$or':_[_0x9cdb('0x31')](_0x253e6e,function(_0x132e52){if(_0x132e52[_0x9cdb('0x2e')]!==_0x9cdb('0x3f')){var _0x41a472={};_0x41a472[_0x132e52[_0x9cdb('0x28')]]={'$like':'%'+_0x32d2db[_0x9cdb('0x32')][_0x9cdb('0x3d')]+'%'};return _0x41a472;}})});}_0x31912e=_[_0x9cdb('0x3e')]({},_0x31912e,_0x32d2db[_0x9cdb('0x40')]);var _0x52fa1b={'where':_0x31912e['where']};return db[_0x9cdb('0x2b')][_0x9cdb('0x1b')](_0x52fa1b)['then'](function(_0x2ac687){_0x434617['count']=_0x2ac687;if(_0x32d2db[_0x9cdb('0x32')][_0x9cdb('0x41')]){_0x31912e[_0x9cdb('0x42')]=[{'all':!![]}];}return db['JscriptyProject']['findAll'](_0x31912e);})[_0x9cdb('0x22')](function(_0xe407a8){_0x434617[_0x9cdb('0x43')]=_0xe407a8;return _0x434617;})['then'](respondWithFilteredResult(_0x61e8c8,_0x31912e))[_0x9cdb('0x44')](handleError(_0x61e8c8,null));};exports[_0x9cdb('0x45')]=function(_0x47bba2,_0x5f5958){var _0x35d875={'raw':![],'where':{'id':_0x47bba2[_0x9cdb('0x46')]['id']}},_0x3fe8cb={};_0x3fe8cb[_0x9cdb('0x30')]=_['keys'](db[_0x9cdb('0x2b')][_0x9cdb('0x2c')]);_0x3fe8cb[_0x9cdb('0x32')]=_[_0x9cdb('0x33')](_0x47bba2['query']);_0x3fe8cb[_0x9cdb('0x34')]=_[_0x9cdb('0x35')](_0x3fe8cb[_0x9cdb('0x30')],_0x3fe8cb[_0x9cdb('0x32')]);_0x35d875[_0x9cdb('0x36')]=_[_0x9cdb('0x35')](_0x3fe8cb[_0x9cdb('0x30')],qs[_0x9cdb('0x37')](_0x47bba2[_0x9cdb('0x32')][_0x9cdb('0x37')]));_0x35d875[_0x9cdb('0x36')]=_0x35d875[_0x9cdb('0x36')][_0x9cdb('0x38')]?_0x35d875[_0x9cdb('0x36')]:_0x3fe8cb[_0x9cdb('0x30')];if(_0x47bba2['query'][_0x9cdb('0x41')]){_0x35d875['include']=[{'all':!![]}];}_0x35d875=_['merge']({},_0x35d875,_0x47bba2['options']);return db['JscriptyProject'][_0x9cdb('0x47')](_0x35d875)['then'](handleEntityNotFound(_0x5f5958,null))['then'](respondWithResult(_0x5f5958,null))[_0x9cdb('0x44')](handleError(_0x5f5958,null));};exports[_0x9cdb('0x48')]=function(_0x4bd505,_0x5d4fc4){return db[_0x9cdb('0x2b')][_0x9cdb('0x48')](_0x4bd505[_0x9cdb('0x49')],{})[_0x9cdb('0x22')](function(_0x14a0c7){var _0x34b0f5=_0x4bd505[_0x9cdb('0x4a')][_0x9cdb('0x4b')]({'plain':!![]});if(!_0x34b0f5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x34b0f5[_0x9cdb('0x4c')]===_0x9cdb('0x4a')){var _0x4ed786=_0x14a0c7['get']({'plain':!![]});var _0x1ce802=_0x9cdb('0x23');return db[_0x9cdb('0x4d')][_0x9cdb('0x47')]({'where':{'name':_0x1ce802,'userProfileId':_0x34b0f5[_0x9cdb('0x4e')]},'raw':!![]})[_0x9cdb('0x22')](function(_0x189a4e){if(_0x189a4e&&_0x189a4e[_0x9cdb('0x4f')]===0x0){return db[_0x9cdb('0x24')][_0x9cdb('0x48')]({'name':_0x4ed786[_0x9cdb('0x28')],'resourceId':_0x4ed786['id'],'type':_0x189a4e[_0x9cdb('0x28')],'sectionId':_0x189a4e['id']},{})['then'](function(){return _0x14a0c7;});}else{return _0x14a0c7;}})[_0x9cdb('0x44')](function(_0x45f1e3){logger['error'](_0x9cdb('0x50'),_0x45f1e3);throw _0x45f1e3;});}return _0x14a0c7;})[_0x9cdb('0x22')](respondWithResult(_0x5d4fc4,0xc9))[_0x9cdb('0x44')](handleError(_0x5d4fc4,null));};exports[_0x9cdb('0x51')]=function(_0x1b9721,_0x9f551f){var _0x286b75={'where':{'id':_0x1b9721[_0x9cdb('0x46')]['id']}},_0xe2e3f={};_0xe2e3f['model']=_[_0x9cdb('0x33')](db[_0x9cdb('0x2b')][_0x9cdb('0x2c')]);_0x286b75[_0x9cdb('0x36')]=_[_0x9cdb('0x35')](_0xe2e3f['model'],qs[_0x9cdb('0x37')](_0x1b9721[_0x9cdb('0x32')][_0x9cdb('0x37')]));_0x286b75[_0x9cdb('0x36')]=_0x286b75['attributes'][_0x9cdb('0x38')]?_0x286b75['attributes']:_0xe2e3f[_0x9cdb('0x30')];if(_0x1b9721[_0x9cdb('0x32')][_0x9cdb('0x41')]){_0x286b75['include']=[{'all':!![]}];}_0x286b75=_[_0x9cdb('0x3e')]({},_0x286b75,_0x1b9721['options']);return db[_0x9cdb('0x2b')]['find'](_0x286b75)[_0x9cdb('0x22')](handleEntityNotFound(_0x9f551f,null))['then'](function(_0x3eb249){if(_0x3eb249){var _0x1b1485=_0x3eb249['get']({'plain':!![]});_0x1b1485=qs[_0x9cdb('0x52')](_0x1b1485,['id','createdAt','updatedAt']);_0x1b9721[_0x9cdb('0x49')]=_[_0x9cdb('0x52')](_0x1b9721[_0x9cdb('0x49')],['id','createdAt','updatedAt']);return db[_0x9cdb('0x2b')]['create'](_[_0x9cdb('0x3e')](_0x1b1485,_0x1b9721[_0x9cdb('0x49')]),{'include':_0x1b9721[_0x9cdb('0x32')][_0x9cdb('0x41')]?[{'all':!![]}]:undefined})[_0x9cdb('0x22')](function(_0x1b9875){var _0x3f9cf0=_0x1b9721[_0x9cdb('0x4a')][_0x9cdb('0x4b')]({'plain':!![]});if(!_0x3f9cf0)throw new Error(_0x9cdb('0x53'));if(_0x3f9cf0[_0x9cdb('0x4c')]===_0x9cdb('0x4a')){var _0x1536e9=_0x1b9875[_0x9cdb('0x4b')]({'plain':!![]});var _0x2940ed=_0x9cdb('0x23');return db['UserProfileSection'][_0x9cdb('0x47')]({'where':{'name':_0x2940ed,'userProfileId':_0x3f9cf0['userProfileId']},'raw':!![]})[_0x9cdb('0x22')](function(_0x481e92){if(_0x481e92&&_0x481e92[_0x9cdb('0x4f')]===0x0){return db['UserProfileResource'][_0x9cdb('0x48')]({'name':_0x1536e9['name'],'resourceId':_0x1536e9['id'],'type':_0x481e92['name'],'sectionId':_0x481e92['id']},{})[_0x9cdb('0x22')](function(){return _0x1b9875;});}else{return _0x1b9875;}})[_0x9cdb('0x44')](function(_0x44aeb1){logger[_0x9cdb('0x26')](_0x9cdb('0x50'),_0x44aeb1);throw _0x44aeb1;});}return _0x1b9875;});}})[_0x9cdb('0x22')](respondWithResult(_0x9f551f,0xc9))[_0x9cdb('0x44')](handleError(_0x9f551f,null));};exports[_0x9cdb('0x21')]=function(_0x39090c,_0x1f9737){if(_0x39090c[_0x9cdb('0x49')]['id']){delete _0x39090c['body']['id'];}return db[_0x9cdb('0x2b')]['find']({'where':{'id':_0x39090c['params']['id']}})['then'](handleEntityNotFound(_0x1f9737,null))['then'](saveUpdates(_0x39090c[_0x9cdb('0x49')],null))[_0x9cdb('0x22')](respondWithResult(_0x1f9737,null))[_0x9cdb('0x44')](handleError(_0x1f9737,null));};exports['destroy']=function(_0x47ac5f,_0x277554){return db[_0x9cdb('0x2b')][_0x9cdb('0x47')]({'where':{'id':_0x47ac5f[_0x9cdb('0x46')]['id']}})[_0x9cdb('0x22')](handleEntityNotFound(_0x277554,null))[_0x9cdb('0x22')](removeEntity(_0x277554,null))[_0x9cdb('0x44')](handleError(_0x277554,null));};exports[_0x9cdb('0x54')]=function(_0x386d3f,_0x4bd37b,_0x10d116){var _0x448045={'raw':!![],'where':{}};var _0x1e25a2={};var _0x7255a={'count':0x0,'rows':[]};return db[_0x9cdb('0x2b')]['findOne']({'where':{'id':_0x386d3f[_0x9cdb('0x46')]['id']}})[_0x9cdb('0x22')](handleEntityNotFound(_0x4bd37b,null))[_0x9cdb('0x22')](function(_0xa812a7){if(_0xa812a7){_0x1e25a2['model']=_['keys'](db['JscriptySessionReport'][_0x9cdb('0x2c')]);_0x1e25a2['query']=_['keys'](_0x386d3f[_0x9cdb('0x32')]);_0x1e25a2[_0x9cdb('0x34')]=_[_0x9cdb('0x35')](_0x1e25a2['model'],_0x1e25a2[_0x9cdb('0x32')]);_0x448045[_0x9cdb('0x36')]=_['intersection'](_0x1e25a2[_0x9cdb('0x30')],qs['fields'](_0x386d3f[_0x9cdb('0x32')]['fields']));_0x448045[_0x9cdb('0x36')]=_0x448045[_0x9cdb('0x36')][_0x9cdb('0x38')]?_0x448045[_0x9cdb('0x36')]:_0x1e25a2[_0x9cdb('0x30')];if(!_0x386d3f['query'][_0x9cdb('0x39')](_0x9cdb('0x55'))){_0x448045[_0x9cdb('0x1a')]=qs[_0x9cdb('0x1a')](_0x386d3f[_0x9cdb('0x32')]['limit']);_0x448045['offset']=qs[_0x9cdb('0x19')](_0x386d3f[_0x9cdb('0x32')]['offset']);}_0x448045[_0x9cdb('0x56')]=qs['sort'](_0x386d3f[_0x9cdb('0x32')][_0x9cdb('0x3a')]);_0x448045[_0x9cdb('0x3b')]=qs[_0x9cdb('0x34')](_['pick'](_0x386d3f[_0x9cdb('0x32')],_0x1e25a2['filters']));_0x448045[_0x9cdb('0x3b')][_0x9cdb('0x57')]=_0xa812a7['id'];if(_0x386d3f[_0x9cdb('0x32')][_0x9cdb('0x3d')]){_0x448045[_0x9cdb('0x3b')]=_['merge'](_0x448045[_0x9cdb('0x3b')],{'$or':_['map'](_0x448045[_0x9cdb('0x36')],function(_0x28528e){var _0x4325a8={};_0x4325a8[_0x28528e]={'$like':'%'+_0x386d3f['query'][_0x9cdb('0x3d')]+'%'};return _0x4325a8;})});}_0x448045=_[_0x9cdb('0x3e')]({},_0x448045,_0x386d3f[_0x9cdb('0x40')]);return db['JscriptySessionReport']['count']({'where':_0x448045[_0x9cdb('0x3b')]})['then'](function(_0x47126){_0x7255a[_0x9cdb('0x1b')]=_0x47126;if(_0x386d3f[_0x9cdb('0x32')]['includeAll']){_0x448045['include']=[{'all':!![]}];}return db[_0x9cdb('0x58')]['findAll'](_0x448045);})[_0x9cdb('0x22')](function(_0x1147dd){_0x7255a[_0x9cdb('0x43')]=_0x1147dd;return _0x7255a;});}})['then'](respondWithFilteredResult(_0x4bd37b,_0x448045))[_0x9cdb('0x44')](handleError(_0x4bd37b,null));};exports[_0x9cdb('0x59')]=function(_0xe75073,_0x397e8b,_0x1e1227){var _0x4e6169={'raw':!![],'where':{}};var _0x19a622={};var _0x4b583={'count':0x0,'rows':[]};return db[_0x9cdb('0x2b')][_0x9cdb('0x5a')]({'where':{'id':_0xe75073[_0x9cdb('0x46')]['id']}})[_0x9cdb('0x22')](handleEntityNotFound(_0x397e8b,null))[_0x9cdb('0x22')](function(_0x239376){if(_0x239376){_0x19a622['model']=_['keys'](db['JscriptyAnswerReport'][_0x9cdb('0x2c')]);_0x19a622[_0x9cdb('0x32')]=_[_0x9cdb('0x33')](_0xe75073[_0x9cdb('0x32')]);_0x19a622['filters']=_['intersection'](_0x19a622[_0x9cdb('0x30')],_0x19a622[_0x9cdb('0x32')]);_0x4e6169[_0x9cdb('0x36')]=_[_0x9cdb('0x35')](_0x19a622['model'],qs[_0x9cdb('0x37')](_0xe75073[_0x9cdb('0x32')][_0x9cdb('0x37')]));_0x4e6169['attributes']=_0x4e6169[_0x9cdb('0x36')][_0x9cdb('0x38')]?_0x4e6169[_0x9cdb('0x36')]:_0x19a622['model'];if(!_0xe75073[_0x9cdb('0x32')][_0x9cdb('0x39')](_0x9cdb('0x55'))){_0x4e6169[_0x9cdb('0x1a')]=qs[_0x9cdb('0x1a')](_0xe75073['query'][_0x9cdb('0x1a')]);_0x4e6169['offset']=qs[_0x9cdb('0x19')](_0xe75073[_0x9cdb('0x32')][_0x9cdb('0x19')]);}_0x4e6169[_0x9cdb('0x56')]=qs[_0x9cdb('0x3a')](_0xe75073['query']['sort']);_0x4e6169['where']=qs[_0x9cdb('0x34')](_[_0x9cdb('0x3c')](_0xe75073[_0x9cdb('0x32')],_0x19a622[_0x9cdb('0x34')]));_0x4e6169['where']['ProjectId']=_0x239376['id'];if(_0xe75073[_0x9cdb('0x32')][_0x9cdb('0x3d')]){_0x4e6169[_0x9cdb('0x3b')]=_[_0x9cdb('0x3e')](_0x4e6169[_0x9cdb('0x3b')],{'$or':_[_0x9cdb('0x31')](_0x4e6169[_0x9cdb('0x36')],function(_0x5dd98e){var _0xd78c72={};_0xd78c72[_0x5dd98e]={'$like':'%'+_0xe75073[_0x9cdb('0x32')][_0x9cdb('0x3d')]+'%'};return _0xd78c72;})});}_0x4e6169=_['merge']({},_0x4e6169,_0xe75073['options']);return db['JscriptyAnswerReport'][_0x9cdb('0x1b')]({'where':_0x4e6169['where']})['then'](function(_0x377cdc){_0x4b583['count']=_0x377cdc;if(_0xe75073[_0x9cdb('0x32')][_0x9cdb('0x41')]){_0x4e6169[_0x9cdb('0x42')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x9cdb('0x5b')](_0x4e6169);})['then'](function(_0x18c359){_0x4b583[_0x9cdb('0x43')]=_0x18c359;return _0x4b583;});}})[_0x9cdb('0x22')](respondWithFilteredResult(_0x397e8b,_0x4e6169))[_0x9cdb('0x44')](handleError(_0x397e8b,null));};function char(_0x191134){return _0x9cdb('0x5c')===typeof _0x191134?String[_0x9cdb('0x5d')][_0x9cdb('0x1e')](null,arguments):_0x191134;}function needsEncapsulation(_0x21ed5c){return!!_0x21ed5c&&(_0x21ed5c['toString']()['indexOf'](char(0xd))>=0x0||_0x21ed5c[_0x9cdb('0x5e')]()['indexOf'](char(0xa))>=0x0||_0x21ed5c[_0x9cdb('0x5e')]()['indexOf'](char(0x2c))>=0x0||_0x21ed5c[_0x9cdb('0x5e')]()[_0x9cdb('0x5f')](char(0x22))>=0x0);}function encapsulate(_0x66c738){var _0x214907=char(0x22),_0x164828='\x5c'+char(0x22),_0x193d9b=_0x66c738[_0x9cdb('0x5e')]()[_0x9cdb('0x60')](new RegExp(_0x214907,'g'),_0x164828);return _0x214907+_0x193d9b+_0x214907;}exports[_0x9cdb('0x61')]=function(_0x52f227,_0x363c3c,_0x54cc39){var _0x84630c,_0x2f5118;var _0x2c03f0={'where':{'ProjectId':_0x52f227[_0x9cdb('0x46')]['id']}};if(_0x52f227['query'][_0x9cdb('0x62')]){_0x2c03f0[_0x9cdb('0x3b')][_0x9cdb('0x63')]=JSON['parse'](_0x52f227[_0x9cdb('0x32')][_0x9cdb('0x62')]);}return db[_0x9cdb('0x58')][_0x9cdb('0x5b')](_0x2c03f0)['then'](handleEntityNotFound(_0x363c3c,null))[_0x9cdb('0x22')](function(_0x1bc9c3){if(_0x1bc9c3){_0x84630c=_0x1bc9c3;return db[_0x9cdb('0x64')][_0x9cdb('0x5b')]({'where':{'SessionId':{'$in':_['map'](_0x84630c,'id')},'ProjectId':_0x52f227['params']['id']},'order':_0x9cdb('0x65')});}})[_0x9cdb('0x22')](handleEntityNotFound(_0x363c3c,null))['then'](function(_0x2681da){if(_0x2681da){_0x2f5118=_0x2681da;var _0x5ccf7b={};for(var _0x42527a=0x0,_0x48d64c=_0x2f5118[_0x9cdb('0x38')];_0x42527a<_0x48d64c;_0x42527a++){if(!_0x5ccf7b[_0x9cdb('0x39')](_0x2f5118[_0x42527a][_0x9cdb('0x66')])){_0x5ccf7b[_0x2f5118[_0x42527a]['questionId']]=needsEncapsulation(_0x2f5118[_0x42527a]['question'])?encapsulate(_0x2f5118[_0x42527a][_0x9cdb('0x67')]):_0x2f5118[_0x42527a][_0x9cdb('0x67')];}}var _0x58e29d=[],_0x25c3b2={};for(var _0x316bdd=0x0,_0x4150f6=_0x84630c[_0x9cdb('0x38')];_0x316bdd<_0x4150f6;_0x316bdd++){_0x25c3b2={'ProjectId':_0x52f227[_0x9cdb('0x46')]['id'],'SessionId':_0x84630c[_0x316bdd]['id'],'StartTime':moment(_0x84630c[_0x316bdd][_0x9cdb('0x63')])[_0x9cdb('0x68')](_0x9cdb('0x69'))};for(var _0x4e694e=0x0,_0x10a0f9=_0x2f5118[_0x9cdb('0x38')];_0x4e694e<_0x10a0f9;_0x4e694e++){if(_0x2f5118[_0x4e694e][_0x9cdb('0x6a')]==_0x84630c[_0x316bdd]['id']&&_0x5ccf7b[_0x9cdb('0x39')](_0x2f5118[_0x4e694e][_0x9cdb('0x66')])){_0x25c3b2[_0x5ccf7b[_0x2f5118[_0x4e694e][_0x9cdb('0x66')]]]=_0x2f5118[_0x4e694e][_0x9cdb('0x6b')];}}for(var _0x2328f1 in _0x5ccf7b){if(!_0x25c3b2[_0x9cdb('0x39')](_0x5ccf7b[_0x2328f1])){_0x25c3b2[_0x5ccf7b[_0x2328f1]]=null;}}_0x58e29d[_0x9cdb('0x6c')](_0x25c3b2);}return _0x58e29d;}})[_0x9cdb('0x22')](function(_0x107717){if(!_['isEmpty'](_0x107717)){var _0x3ce994=toCsv(_0x107717);var _0x46597f=Date[_0x9cdb('0x6d')]();fs[_0x9cdb('0x6e')](util['format'](_0x9cdb('0x6f'),_0x52f227[_0x9cdb('0x46')]['id'],_0x46597f),_0x3ce994);_0x363c3c[_0x9cdb('0x70')](_0x9cdb('0x71'),_0x9cdb('0x72')+util[_0x9cdb('0x68')](_0x9cdb('0x73'),_0x52f227[_0x9cdb('0x46')]['id'],_0x46597f));_0x363c3c[_0x9cdb('0x70')](_0x9cdb('0x74'),_0x9cdb('0x75'));return _0x363c3c['download'](util[_0x9cdb('0x68')](_0x9cdb('0x6f'),_0x52f227[_0x9cdb('0x46')]['id'],_0x46597f));}else{return _0x363c3c['sendStatus'](0xcc);}})[_0x9cdb('0x44')](handleError(_0x363c3c,null));}; \ No newline at end of file +var _0xdb2b=['create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','clone','merge','createdAt','omit','updatedAt','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getSessions','findOne','JscriptySessionReport','hasOwnProperty','getAnswers','JscriptyAnswerReport','ProjectId','indexOf','toString','replace','getSummary','startTime','starttime','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','setHeader','Jscripty_Project_%d_Summary_%s.csv','Content-type','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','Projects','UserProfileResource','error','stack','name','map','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','nolimit','order','sort','pick','filter','where','VIRTUAL','options','JscriptyProject','includeAll','findAll','rows','catch','show','params','rawAttributes','fields','include','find'];(function(_0x5b1053,_0x14c6e3){var _0xec3b3c=function(_0x333c79){while(--_0x333c79){_0x5b1053['push'](_0x5b1053['shift']());}};_0xec3b3c(++_0x14c6e3);}(_0xdb2b,0xa2));var _0xbdb2=function(_0x4d5308,_0x268d72){_0x4d5308=_0x4d5308-0x0;var _0x56635a=_0xdb2b[_0x4d5308];return _0x56635a;};'use strict';var emlformat=require(_0xbdb2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbdb2('0x1'));var jsonpatch=require(_0xbdb2('0x2'));var rp=require(_0xbdb2('0x3'));var moment=require(_0xbdb2('0x4'));var BPromise=require(_0xbdb2('0x5'));var Mustache=require(_0xbdb2('0x6'));var util=require(_0xbdb2('0x7'));var path=require(_0xbdb2('0x8'));var sox=require(_0xbdb2('0x9'));var csv=require(_0xbdb2('0xa'));var ejs=require(_0xbdb2('0xb'));var fs=require('fs');var fs_extra=require(_0xbdb2('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xbdb2('0xd'));var jsforce=require(_0xbdb2('0xe'));var deskjs=require(_0xbdb2('0xf'));var toCsv=require(_0xbdb2('0xa'));var querystring=require(_0xbdb2('0x10'));var Papa=require(_0xbdb2('0x11'));var Redis=require('ioredis');var authService=require(_0xbdb2('0x12'));var qs=require(_0xbdb2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbdb2('0x14'));var logger=require(_0xbdb2('0x15'))('api');var utils=require(_0xbdb2('0x16'));var config=require(_0xbdb2('0x17'));var licenseUtil=require(_0xbdb2('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c9d96,_0xb5cd89){_0xb5cd89=_0xb5cd89||0xcc;return function(_0xca2f9){if(_0xca2f9){return _0x2c9d96[_0xbdb2('0x19')](_0xb5cd89);}return _0x2c9d96['status'](_0xb5cd89)[_0xbdb2('0x1a')]();};}function respondWithResult(_0x475ffd,_0x500f1c){_0x500f1c=_0x500f1c||0xc8;return function(_0x5a6acf){if(_0x5a6acf){return _0x475ffd[_0xbdb2('0x1b')](_0x500f1c)[_0xbdb2('0x1c')](_0x5a6acf);}};}function respondWithFilteredResult(_0x15cfc0,_0x3c7e7e){return function(_0x767ab6){if(_0x767ab6){var _0xc38bda=typeof _0x3c7e7e[_0xbdb2('0x1d')]===_0xbdb2('0x1e')&&typeof _0x3c7e7e['limit']===_0xbdb2('0x1e');var _0x536061=_0x767ab6[_0xbdb2('0x1f')];var _0x3f5556=_0xc38bda?0x0:_0x3c7e7e[_0xbdb2('0x1d')];var _0x4856fe=_0xc38bda?_0x767ab6['count']:_0x3c7e7e[_0xbdb2('0x1d')]+_0x3c7e7e[_0xbdb2('0x20')];var _0x5619e8;if(_0x4856fe>=_0x536061){_0x4856fe=_0x536061;_0x5619e8=0xc8;}else{_0x5619e8=0xce;}_0x15cfc0['status'](_0x5619e8);return _0x15cfc0['set'](_0xbdb2('0x21'),_0x3f5556+'-'+_0x4856fe+'/'+_0x536061)[_0xbdb2('0x1c')](_0x767ab6);}return null;};}function patchUpdates(_0x3a9629){return function(_0x228881){try{jsonpatch[_0xbdb2('0x22')](_0x228881,_0x3a9629,!![]);}catch(_0xd8f80c){return BPromise['reject'](_0xd8f80c);}return _0x228881[_0xbdb2('0x23')]();};}function saveUpdates(_0x557117,_0x2e8697){return function(_0x5c21c4){if(_0x5c21c4){return _0x5c21c4[_0xbdb2('0x24')](_0x557117)[_0xbdb2('0x25')](function(_0x496150){return _0x496150;});}return null;};}function removeEntity(_0x423d23,_0x1efb1d){return function(_0x48a477){if(_0x48a477){return _0x48a477[_0xbdb2('0x26')]()[_0xbdb2('0x25')](function(){var _0xdbfbbb=_0x48a477['get']({'plain':!![]});var _0x560feb=_0xbdb2('0x27');return db[_0xbdb2('0x28')]['destroy']({'where':{'type':_0x560feb,'resourceId':_0xdbfbbb['id']}})[_0xbdb2('0x25')](function(){return _0x48a477;});})[_0xbdb2('0x25')](function(){_0x423d23['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bb221,_0x50d69b){return function(_0x596704){if(!_0x596704){_0x4bb221[_0xbdb2('0x19')](0x194);}return _0x596704;};}function handleError(_0x442b94,_0x121312){_0x121312=_0x121312||0x1f4;return function(_0x49aace){logger[_0xbdb2('0x29')](_0x49aace[_0xbdb2('0x2a')]);if(_0x49aace[_0xbdb2('0x2b')]){delete _0x49aace[_0xbdb2('0x2b')];}_0x442b94['status'](_0x121312)['send'](_0x49aace);};}exports['index']=function(_0x5709b0,_0x1405c5){var _0x244a42={},_0xcc2e74={},_0x2f102f={'count':0x0,'rows':[]};var _0x42142a=_[_0xbdb2('0x2c')](db['JscriptyProject']['rawAttributes'],function(_0x1d8868){return{'name':_0x1d8868[_0xbdb2('0x2d')],'type':_0x1d8868[_0xbdb2('0x2e')][_0xbdb2('0x2f')]};});_0xcc2e74['model']=_[_0xbdb2('0x2c')](_0x42142a,_0xbdb2('0x2b'));_0xcc2e74[_0xbdb2('0x30')]=_[_0xbdb2('0x31')](_0x5709b0['query']);_0xcc2e74[_0xbdb2('0x32')]=_[_0xbdb2('0x33')](_0xcc2e74[_0xbdb2('0x34')],_0xcc2e74[_0xbdb2('0x30')]);_0x244a42[_0xbdb2('0x35')]=_[_0xbdb2('0x33')](_0xcc2e74[_0xbdb2('0x34')],qs['fields'](_0x5709b0[_0xbdb2('0x30')]['fields']));_0x244a42[_0xbdb2('0x35')]=_0x244a42[_0xbdb2('0x35')][_0xbdb2('0x36')]?_0x244a42[_0xbdb2('0x35')]:_0xcc2e74[_0xbdb2('0x34')];if(!_0x5709b0[_0xbdb2('0x30')]['hasOwnProperty'](_0xbdb2('0x37'))){_0x244a42[_0xbdb2('0x20')]=qs[_0xbdb2('0x20')](_0x5709b0['query']['limit']);_0x244a42[_0xbdb2('0x1d')]=qs[_0xbdb2('0x1d')](_0x5709b0['query'][_0xbdb2('0x1d')]);}_0x244a42[_0xbdb2('0x38')]=qs[_0xbdb2('0x39')](_0x5709b0[_0xbdb2('0x30')]['sort']);_0x244a42['where']=qs[_0xbdb2('0x32')](_[_0xbdb2('0x3a')](_0x5709b0['query'],_0xcc2e74[_0xbdb2('0x32')]),_0x42142a);if(_0x5709b0[_0xbdb2('0x30')][_0xbdb2('0x3b')]){_0x244a42[_0xbdb2('0x3c')]=_['merge'](_0x244a42[_0xbdb2('0x3c')],{'$or':_[_0xbdb2('0x2c')](_0x42142a,function(_0x3b4b09){if(_0x3b4b09['type']!==_0xbdb2('0x3d')){var _0x5b2eee={};_0x5b2eee[_0x3b4b09[_0xbdb2('0x2b')]]={'$like':'%'+_0x5709b0[_0xbdb2('0x30')][_0xbdb2('0x3b')]+'%'};return _0x5b2eee;}})});}_0x244a42=_['merge']({},_0x244a42,_0x5709b0[_0xbdb2('0x3e')]);var _0x1fffb4={'where':_0x244a42[_0xbdb2('0x3c')]};return db[_0xbdb2('0x3f')][_0xbdb2('0x1f')](_0x1fffb4)[_0xbdb2('0x25')](function(_0x272447){_0x2f102f['count']=_0x272447;if(_0x5709b0[_0xbdb2('0x30')][_0xbdb2('0x40')]){_0x244a42['include']=[{'all':!![]}];}return db['JscriptyProject'][_0xbdb2('0x41')](_0x244a42);})[_0xbdb2('0x25')](function(_0xff8ef5){_0x2f102f[_0xbdb2('0x42')]=_0xff8ef5;return _0x2f102f;})[_0xbdb2('0x25')](respondWithFilteredResult(_0x1405c5,_0x244a42))[_0xbdb2('0x43')](handleError(_0x1405c5,null));};exports[_0xbdb2('0x44')]=function(_0x5df3d6,_0x56cac7){var _0x52ea68={'raw':![],'where':{'id':_0x5df3d6[_0xbdb2('0x45')]['id']}},_0x444f86={};_0x444f86['model']=_[_0xbdb2('0x31')](db[_0xbdb2('0x3f')][_0xbdb2('0x46')]);_0x444f86[_0xbdb2('0x30')]=_[_0xbdb2('0x31')](_0x5df3d6['query']);_0x444f86['filters']=_[_0xbdb2('0x33')](_0x444f86[_0xbdb2('0x34')],_0x444f86['query']);_0x52ea68['attributes']=_[_0xbdb2('0x33')](_0x444f86[_0xbdb2('0x34')],qs[_0xbdb2('0x47')](_0x5df3d6[_0xbdb2('0x30')][_0xbdb2('0x47')]));_0x52ea68[_0xbdb2('0x35')]=_0x52ea68['attributes'][_0xbdb2('0x36')]?_0x52ea68[_0xbdb2('0x35')]:_0x444f86['model'];if(_0x5df3d6[_0xbdb2('0x30')][_0xbdb2('0x40')]){_0x52ea68[_0xbdb2('0x48')]=[{'all':!![]}];}_0x52ea68=_['merge']({},_0x52ea68,_0x5df3d6['options']);return db[_0xbdb2('0x3f')][_0xbdb2('0x49')](_0x52ea68)[_0xbdb2('0x25')](handleEntityNotFound(_0x56cac7,null))[_0xbdb2('0x25')](respondWithResult(_0x56cac7,null))[_0xbdb2('0x43')](handleError(_0x56cac7,null));};exports[_0xbdb2('0x4a')]=function(_0x3e525a,_0x5d6dee){return db[_0xbdb2('0x3f')][_0xbdb2('0x4a')](_0x3e525a[_0xbdb2('0x4b')],{})[_0xbdb2('0x25')](function(_0x485faa){var _0x4d9f4d=_0x3e525a[_0xbdb2('0x4c')][_0xbdb2('0x4d')]({'plain':!![]});if(!_0x4d9f4d)throw new Error(_0xbdb2('0x4e'));if(_0x4d9f4d['role']===_0xbdb2('0x4c')){var _0x17b8b2=_0x485faa[_0xbdb2('0x4d')]({'plain':!![]});var _0x24a455=_0xbdb2('0x27');return db[_0xbdb2('0x4f')][_0xbdb2('0x49')]({'where':{'name':_0x24a455,'userProfileId':_0x4d9f4d[_0xbdb2('0x50')]},'raw':!![]})[_0xbdb2('0x25')](function(_0x12130b){if(_0x12130b&&_0x12130b['autoAssociation']===0x0){return db['UserProfileResource'][_0xbdb2('0x4a')]({'name':_0x17b8b2[_0xbdb2('0x2b')],'resourceId':_0x17b8b2['id'],'type':_0x12130b[_0xbdb2('0x2b')],'sectionId':_0x12130b['id']},{})[_0xbdb2('0x25')](function(){return _0x485faa;});}else{return _0x485faa;}})[_0xbdb2('0x43')](function(_0xb0a58c){logger[_0xbdb2('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb0a58c);throw _0xb0a58c;});}return _0x485faa;})[_0xbdb2('0x25')](respondWithResult(_0x5d6dee,0xc9))[_0xbdb2('0x43')](handleError(_0x5d6dee,null));};exports[_0xbdb2('0x51')]=function(_0x291a0d,_0x2be408){var _0x285131={'where':{'id':_0x291a0d['params']['id']}},_0xedc972={};_0xedc972[_0xbdb2('0x34')]=_[_0xbdb2('0x31')](db[_0xbdb2('0x3f')][_0xbdb2('0x46')]);_0x285131['attributes']=_[_0xbdb2('0x33')](_0xedc972[_0xbdb2('0x34')],qs['fields'](_0x291a0d[_0xbdb2('0x30')]['fields']));_0x285131[_0xbdb2('0x35')]=_0x285131[_0xbdb2('0x35')][_0xbdb2('0x36')]?_0x285131[_0xbdb2('0x35')]:_0xedc972['model'];if(_0x291a0d[_0xbdb2('0x30')][_0xbdb2('0x40')]){_0x285131[_0xbdb2('0x48')]=[{'all':!![]}];}_0x285131=_[_0xbdb2('0x52')]({},_0x285131,_0x291a0d[_0xbdb2('0x3e')]);return db['JscriptyProject']['find'](_0x285131)['then'](handleEntityNotFound(_0x2be408,null))[_0xbdb2('0x25')](function(_0x46a77a){if(_0x46a77a){var _0xc29ab0=_0x46a77a['get']({'plain':!![]});_0xc29ab0=qs['omit'](_0xc29ab0,['id',_0xbdb2('0x53'),'updatedAt']);_0x291a0d[_0xbdb2('0x4b')]=_[_0xbdb2('0x54')](_0x291a0d['body'],['id',_0xbdb2('0x53'),_0xbdb2('0x55')]);return db[_0xbdb2('0x3f')]['create'](_[_0xbdb2('0x52')](_0xc29ab0,_0x291a0d['body']),{'include':_0x291a0d[_0xbdb2('0x30')][_0xbdb2('0x40')]?[{'all':!![]}]:undefined})[_0xbdb2('0x25')](function(_0x1f400f){var _0x58cced=_0x291a0d[_0xbdb2('0x4c')][_0xbdb2('0x4d')]({'plain':!![]});if(!_0x58cced)throw new Error(_0xbdb2('0x4e'));if(_0x58cced['role']===_0xbdb2('0x4c')){var _0x17e5c9=_0x1f400f[_0xbdb2('0x4d')]({'plain':!![]});var _0x36248d=_0xbdb2('0x27');return db[_0xbdb2('0x4f')]['find']({'where':{'name':_0x36248d,'userProfileId':_0x58cced['userProfileId']},'raw':!![]})[_0xbdb2('0x25')](function(_0x435325){if(_0x435325&&_0x435325[_0xbdb2('0x56')]===0x0){return db[_0xbdb2('0x28')][_0xbdb2('0x4a')]({'name':_0x17e5c9[_0xbdb2('0x2b')],'resourceId':_0x17e5c9['id'],'type':_0x435325[_0xbdb2('0x2b')],'sectionId':_0x435325['id']},{})[_0xbdb2('0x25')](function(){return _0x1f400f;});}else{return _0x1f400f;}})['catch'](function(_0xddfdb6){logger[_0xbdb2('0x29')](_0xbdb2('0x57'),_0xddfdb6);throw _0xddfdb6;});}return _0x1f400f;});}})[_0xbdb2('0x25')](respondWithResult(_0x2be408,0xc9))['catch'](handleError(_0x2be408,null));};exports['update']=function(_0x5e560f,_0x4d769a){if(_0x5e560f['body']['id']){delete _0x5e560f[_0xbdb2('0x4b')]['id'];}return db[_0xbdb2('0x3f')][_0xbdb2('0x49')]({'where':{'id':_0x5e560f[_0xbdb2('0x45')]['id']}})[_0xbdb2('0x25')](handleEntityNotFound(_0x4d769a,null))[_0xbdb2('0x25')](saveUpdates(_0x5e560f[_0xbdb2('0x4b')],null))[_0xbdb2('0x25')](respondWithResult(_0x4d769a,null))[_0xbdb2('0x43')](handleError(_0x4d769a,null));};exports[_0xbdb2('0x26')]=function(_0x4aa8bf,_0x44b4eb){return db[_0xbdb2('0x3f')][_0xbdb2('0x49')]({'where':{'id':_0x4aa8bf[_0xbdb2('0x45')]['id']}})[_0xbdb2('0x25')](handleEntityNotFound(_0x44b4eb,null))['then'](removeEntity(_0x44b4eb,null))[_0xbdb2('0x43')](handleError(_0x44b4eb,null));};exports[_0xbdb2('0x58')]=function(_0x20591d,_0x2d7b19,_0x354cc0){var _0x1191e1={'raw':!![],'where':{}};var _0x25e704={};var _0x5bc3d0={'count':0x0,'rows':[]};return db[_0xbdb2('0x3f')][_0xbdb2('0x59')]({'where':{'id':_0x20591d[_0xbdb2('0x45')]['id']}})[_0xbdb2('0x25')](handleEntityNotFound(_0x2d7b19,null))['then'](function(_0x280761){if(_0x280761){_0x25e704[_0xbdb2('0x34')]=_['keys'](db[_0xbdb2('0x5a')]['rawAttributes']);_0x25e704[_0xbdb2('0x30')]=_[_0xbdb2('0x31')](_0x20591d[_0xbdb2('0x30')]);_0x25e704[_0xbdb2('0x32')]=_[_0xbdb2('0x33')](_0x25e704[_0xbdb2('0x34')],_0x25e704['query']);_0x1191e1[_0xbdb2('0x35')]=_[_0xbdb2('0x33')](_0x25e704[_0xbdb2('0x34')],qs['fields'](_0x20591d['query'][_0xbdb2('0x47')]));_0x1191e1['attributes']=_0x1191e1[_0xbdb2('0x35')][_0xbdb2('0x36')]?_0x1191e1[_0xbdb2('0x35')]:_0x25e704[_0xbdb2('0x34')];if(!_0x20591d[_0xbdb2('0x30')][_0xbdb2('0x5b')](_0xbdb2('0x37'))){_0x1191e1[_0xbdb2('0x20')]=qs[_0xbdb2('0x20')](_0x20591d[_0xbdb2('0x30')][_0xbdb2('0x20')]);_0x1191e1[_0xbdb2('0x1d')]=qs[_0xbdb2('0x1d')](_0x20591d[_0xbdb2('0x30')][_0xbdb2('0x1d')]);}_0x1191e1[_0xbdb2('0x38')]=qs[_0xbdb2('0x39')](_0x20591d[_0xbdb2('0x30')][_0xbdb2('0x39')]);_0x1191e1[_0xbdb2('0x3c')]=qs[_0xbdb2('0x32')](_[_0xbdb2('0x3a')](_0x20591d[_0xbdb2('0x30')],_0x25e704[_0xbdb2('0x32')]));_0x1191e1[_0xbdb2('0x3c')]['ProjectId']=_0x280761['id'];if(_0x20591d[_0xbdb2('0x30')][_0xbdb2('0x3b')]){_0x1191e1[_0xbdb2('0x3c')]=_[_0xbdb2('0x52')](_0x1191e1[_0xbdb2('0x3c')],{'$or':_[_0xbdb2('0x2c')](_0x1191e1[_0xbdb2('0x35')],function(_0x565ace){var _0x3d2611={};_0x3d2611[_0x565ace]={'$like':'%'+_0x20591d[_0xbdb2('0x30')][_0xbdb2('0x3b')]+'%'};return _0x3d2611;})});}_0x1191e1=_[_0xbdb2('0x52')]({},_0x1191e1,_0x20591d['options']);return db[_0xbdb2('0x5a')][_0xbdb2('0x1f')]({'where':_0x1191e1[_0xbdb2('0x3c')]})[_0xbdb2('0x25')](function(_0x1e095c){_0x5bc3d0[_0xbdb2('0x1f')]=_0x1e095c;if(_0x20591d[_0xbdb2('0x30')][_0xbdb2('0x40')]){_0x1191e1['include']=[{'all':!![]}];}return db[_0xbdb2('0x5a')]['findAll'](_0x1191e1);})[_0xbdb2('0x25')](function(_0x523f80){_0x5bc3d0[_0xbdb2('0x42')]=_0x523f80;return _0x5bc3d0;});}})['then'](respondWithFilteredResult(_0x2d7b19,_0x1191e1))[_0xbdb2('0x43')](handleError(_0x2d7b19,null));};exports[_0xbdb2('0x5c')]=function(_0x780acb,_0xaa5551,_0x36ef89){var _0x4da88f={'raw':!![],'where':{}};var _0x425753={};var _0x236559={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xbdb2('0x59')]({'where':{'id':_0x780acb[_0xbdb2('0x45')]['id']}})[_0xbdb2('0x25')](handleEntityNotFound(_0xaa5551,null))[_0xbdb2('0x25')](function(_0x438f46){if(_0x438f46){_0x425753[_0xbdb2('0x34')]=_[_0xbdb2('0x31')](db[_0xbdb2('0x5d')]['rawAttributes']);_0x425753['query']=_[_0xbdb2('0x31')](_0x780acb[_0xbdb2('0x30')]);_0x425753[_0xbdb2('0x32')]=_[_0xbdb2('0x33')](_0x425753[_0xbdb2('0x34')],_0x425753[_0xbdb2('0x30')]);_0x4da88f[_0xbdb2('0x35')]=_[_0xbdb2('0x33')](_0x425753['model'],qs['fields'](_0x780acb['query']['fields']));_0x4da88f[_0xbdb2('0x35')]=_0x4da88f['attributes'][_0xbdb2('0x36')]?_0x4da88f[_0xbdb2('0x35')]:_0x425753['model'];if(!_0x780acb[_0xbdb2('0x30')][_0xbdb2('0x5b')](_0xbdb2('0x37'))){_0x4da88f[_0xbdb2('0x20')]=qs[_0xbdb2('0x20')](_0x780acb[_0xbdb2('0x30')][_0xbdb2('0x20')]);_0x4da88f[_0xbdb2('0x1d')]=qs[_0xbdb2('0x1d')](_0x780acb[_0xbdb2('0x30')]['offset']);}_0x4da88f[_0xbdb2('0x38')]=qs[_0xbdb2('0x39')](_0x780acb[_0xbdb2('0x30')][_0xbdb2('0x39')]);_0x4da88f[_0xbdb2('0x3c')]=qs[_0xbdb2('0x32')](_[_0xbdb2('0x3a')](_0x780acb[_0xbdb2('0x30')],_0x425753[_0xbdb2('0x32')]));_0x4da88f[_0xbdb2('0x3c')][_0xbdb2('0x5e')]=_0x438f46['id'];if(_0x780acb[_0xbdb2('0x30')]['filter']){_0x4da88f[_0xbdb2('0x3c')]=_['merge'](_0x4da88f[_0xbdb2('0x3c')],{'$or':_[_0xbdb2('0x2c')](_0x4da88f[_0xbdb2('0x35')],function(_0x11daa5){var _0x1e4988={};_0x1e4988[_0x11daa5]={'$like':'%'+_0x780acb[_0xbdb2('0x30')][_0xbdb2('0x3b')]+'%'};return _0x1e4988;})});}_0x4da88f=_[_0xbdb2('0x52')]({},_0x4da88f,_0x780acb[_0xbdb2('0x3e')]);return db[_0xbdb2('0x5d')]['count']({'where':_0x4da88f['where']})[_0xbdb2('0x25')](function(_0x2d12a3){_0x236559[_0xbdb2('0x1f')]=_0x2d12a3;if(_0x780acb[_0xbdb2('0x30')]['includeAll']){_0x4da88f[_0xbdb2('0x48')]=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x4da88f);})[_0xbdb2('0x25')](function(_0x3f83ec){_0x236559[_0xbdb2('0x42')]=_0x3f83ec;return _0x236559;});}})[_0xbdb2('0x25')](respondWithFilteredResult(_0xaa5551,_0x4da88f))[_0xbdb2('0x43')](handleError(_0xaa5551,null));};function char(_0x1bed41){return'number'===typeof _0x1bed41?String['fromCharCode'][_0xbdb2('0x22')](null,arguments):_0x1bed41;}function needsEncapsulation(_0x40d495){return!!_0x40d495&&(_0x40d495['toString']()[_0xbdb2('0x5f')](char(0xd))>=0x0||_0x40d495[_0xbdb2('0x60')]()[_0xbdb2('0x5f')](char(0xa))>=0x0||_0x40d495[_0xbdb2('0x60')]()[_0xbdb2('0x5f')](char(0x2c))>=0x0||_0x40d495[_0xbdb2('0x60')]()[_0xbdb2('0x5f')](char(0x22))>=0x0);}function encapsulate(_0x15dffe){var _0x8892f1=char(0x22),_0x1befd6='\x5c'+char(0x22),_0x135a5c=_0x15dffe[_0xbdb2('0x60')]()[_0xbdb2('0x61')](new RegExp(_0x8892f1,'g'),_0x1befd6);return _0x8892f1+_0x135a5c+_0x8892f1;}exports[_0xbdb2('0x62')]=function(_0x51591b,_0xf1558a,_0x1f0c57){var _0x5e121c,_0x4ea742;var _0x1f78ec={'where':{'ProjectId':_0x51591b[_0xbdb2('0x45')]['id']}};if(_0x51591b['query'][_0xbdb2('0x63')]){_0x1f78ec[_0xbdb2('0x3c')][_0xbdb2('0x64')]=JSON['parse'](_0x51591b[_0xbdb2('0x30')][_0xbdb2('0x63')]);}return db[_0xbdb2('0x5a')][_0xbdb2('0x41')](_0x1f78ec)[_0xbdb2('0x25')](handleEntityNotFound(_0xf1558a,null))['then'](function(_0x5ac59a){if(_0x5ac59a){_0x5e121c=_0x5ac59a;return db[_0xbdb2('0x65')][_0xbdb2('0x41')]({'where':{'SessionId':{'$in':_[_0xbdb2('0x2c')](_0x5e121c,'id')},'ProjectId':_0x51591b['params']['id']},'order':_0xbdb2('0x66')});}})[_0xbdb2('0x25')](handleEntityNotFound(_0xf1558a,null))['then'](function(_0x81bf72){if(_0x81bf72){_0x4ea742=_0x81bf72;var _0x1a0221={};for(var _0x4eab6a=0x0,_0x3045a2=_0x4ea742[_0xbdb2('0x36')];_0x4eab6a<_0x3045a2;_0x4eab6a++){if(!_0x1a0221['hasOwnProperty'](_0x4ea742[_0x4eab6a][_0xbdb2('0x67')])){_0x1a0221[_0x4ea742[_0x4eab6a][_0xbdb2('0x67')]]=needsEncapsulation(_0x4ea742[_0x4eab6a][_0xbdb2('0x68')])?encapsulate(_0x4ea742[_0x4eab6a][_0xbdb2('0x68')]):_0x4ea742[_0x4eab6a][_0xbdb2('0x68')];}}var _0x3a47f1=[],_0x4f51d3={};for(var _0x3b1fed=0x0,_0x4a48ae=_0x5e121c[_0xbdb2('0x36')];_0x3b1fed<_0x4a48ae;_0x3b1fed++){_0x4f51d3={'ProjectId':_0x51591b['params']['id'],'SessionId':_0x5e121c[_0x3b1fed]['id'],'StartTime':moment(_0x5e121c[_0x3b1fed]['starttime'])[_0xbdb2('0x69')](_0xbdb2('0x6a'))};for(var _0x2f90a2=0x0,_0x3cfb35=_0x4ea742[_0xbdb2('0x36')];_0x2f90a2<_0x3cfb35;_0x2f90a2++){if(_0x4ea742[_0x2f90a2][_0xbdb2('0x6b')]==_0x5e121c[_0x3b1fed]['id']&&_0x1a0221[_0xbdb2('0x5b')](_0x4ea742[_0x2f90a2][_0xbdb2('0x67')])){_0x4f51d3[_0x1a0221[_0x4ea742[_0x2f90a2][_0xbdb2('0x67')]]]=_0x4ea742[_0x2f90a2][_0xbdb2('0x6c')];}}for(var _0x12562c in _0x1a0221){if(!_0x4f51d3[_0xbdb2('0x5b')](_0x1a0221[_0x12562c])){_0x4f51d3[_0x1a0221[_0x12562c]]=null;}}_0x3a47f1[_0xbdb2('0x6d')](_0x4f51d3);}return _0x3a47f1;}})[_0xbdb2('0x25')](function(_0x1d51fb){if(!_[_0xbdb2('0x6e')](_0x1d51fb)){var _0x5a3eb7=toCsv(_0x1d51fb);var _0x3d3b4e=Date[_0xbdb2('0x6f')]();fs[_0xbdb2('0x70')](util[_0xbdb2('0x69')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x51591b[_0xbdb2('0x45')]['id'],_0x3d3b4e),_0x5a3eb7);_0xf1558a[_0xbdb2('0x71')]('Content-disposition','attachment;\x20filename='+util['format'](_0xbdb2('0x72'),_0x51591b[_0xbdb2('0x45')]['id'],_0x3d3b4e));_0xf1558a['setHeader'](_0xbdb2('0x73'),'text/csv');return _0xf1558a[_0xbdb2('0x74')](util[_0xbdb2('0x69')](_0xbdb2('0x75'),_0x51591b[_0xbdb2('0x45')]['id'],_0x3d3b4e));}else{return _0xf1558a[_0xbdb2('0x19')](0xcc);}})['catch'](handleError(_0xf1558a,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index ae0d892..0952d8a 100644 --- a/server/api/jscriptyProject/jscriptyProject.model.js +++ b/server/api/jscriptyProject/jscriptyProject.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x35d0=['moment','bluebird','request-promise','path','rimraf','./jscriptyProject.attributes','exports','JscriptyProject','jscripty_projects','lodash','util','api'];(function(_0x725b8e,_0xc22b48){var _0x43ac45=function(_0x46bb4a){while(--_0x46bb4a){_0x725b8e['push'](_0x725b8e['shift']());}};_0x43ac45(++_0xc22b48);}(_0x35d0,0xf9));var _0x035d=function(_0xbeb808,_0x881ddf){_0xbeb808=_0xbeb808-0x0;var _0x5d6909=_0x35d0[_0xbeb808];return _0x5d6909;};'use strict';var _=require(_0x035d('0x0'));var util=require(_0x035d('0x1'));var logger=require('../../config/logger')(_0x035d('0x2'));var moment=require(_0x035d('0x3'));var BPromise=require(_0x035d('0x4'));var rp=require(_0x035d('0x5'));var fs=require('fs');var path=require(_0x035d('0x6'));var rimraf=require(_0x035d('0x7'));var config=require('../../config/environment');var attributes=require(_0x035d('0x8'));module[_0x035d('0x9')]=function(_0x3e6d36,_0x3f5f0d){return _0x3e6d36['define'](_0x035d('0xa'),attributes,{'tableName':_0x035d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x19da=['api','bluebird','request-promise','rimraf','../../config/environment','exports','define','JscriptyProject','jscripty_projects','util'];(function(_0x3c51d4,_0x36ba53){var _0x53c45f=function(_0x3d6683){while(--_0x3d6683){_0x3c51d4['push'](_0x3c51d4['shift']());}};_0x53c45f(++_0x36ba53);}(_0x19da,0x9f));var _0xa19d=function(_0x553a87,_0x1d621f){_0x553a87=_0x553a87-0x0;var _0x12d1e6=_0x19da[_0x553a87];return _0x12d1e6;};'use strict';var _=require('lodash');var util=require(_0xa19d('0x0'));var logger=require('../../config/logger')(_0xa19d('0x1'));var moment=require('moment');var BPromise=require(_0xa19d('0x2'));var rp=require(_0xa19d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa19d('0x4'));var config=require(_0xa19d('0x5'));var attributes=require('./jscriptyProject.attributes');module[_0xa19d('0x6')]=function(_0x330adb,_0x1f6e10){return _0x330adb[_0xa19d('0x7')](_0xa19d('0x8'),attributes,{'tableName':_0xa19d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index a999510..55f4399 100644 --- a/server/api/jscriptyProject/jscriptyProject.rpc.js +++ b/server/api/jscriptyProject/jscriptyProject.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['code','JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x1ebda3,_0x564a8d){var _0x5b1ff0=function(_0x1acfa3){while(--_0x1acfa3){_0x1ebda3['push'](_0x1ebda3['shift']());}};_0x5b1ff0(++_0x564a8d);}(_0x70e0,0x17b));var _0x070e=function(_0x366ba7,_0xd5d34c){_0x366ba7=_0x366ba7-0x0;var _0x409715=_0x70e0[_0x366ba7];return _0x409715;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('JscriptyProject,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file +var _0xf4eb=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x1828ee,_0x5db35c){var _0x26b4b8=function(_0x2b9065){while(--_0x2b9065){_0x1828ee['push'](_0x1828ee['shift']());}};_0x26b4b8(++_0x5db35c);}(_0xf4eb,0xec));var _0xbf4e=function(_0x102cf7,_0x3f1f84){_0x102cf7=_0x102cf7-0x0;var _0x256a98=_0xf4eb[_0x102cf7];return _0x256a98;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index de45026..dfee786 100644 --- a/server/api/jscriptyQuestionReport/index.js +++ b/server/api/jscriptyQuestionReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe05d=['update','delete','destroy','exports','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','describe','/:id','show','create'];(function(_0x3d4ba2,_0x40d12d){var _0x889610=function(_0x2d3066){while(--_0x2d3066){_0x3d4ba2['push'](_0x3d4ba2['shift']());}};_0x889610(++_0x40d12d);}(_0xe05d,0xee));var _0xde05=function(_0x513ee1,_0x1309de){_0x513ee1=_0x513ee1-0x0;var _0x2a07b2=_0xe05d[_0x513ee1];return _0x2a07b2;};'use strict';var multer=require('multer');var util=require(_0xde05('0x0'));var path=require(_0xde05('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xde05('0x2')]();var fs_extra=require(_0xde05('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xde05('0x4'));var config=require(_0xde05('0x5'));var controller=require(_0xde05('0x6'));router[_0xde05('0x7')]('/',auth[_0xde05('0x8')](),controller[_0xde05('0x9')]);router[_0xde05('0x7')]('/describe',auth[_0xde05('0x8')](),controller[_0xde05('0xa')]);router[_0xde05('0x7')](_0xde05('0xb'),auth['isAuthenticated'](),controller[_0xde05('0xc')]);router['post']('/',auth[_0xde05('0x8')](),controller[_0xde05('0xd')]);router['put'](_0xde05('0xb'),auth['isAuthenticated'](),controller[_0xde05('0xe')]);router[_0xde05('0xf')](_0xde05('0xb'),auth[_0xde05('0x8')](),controller[_0xde05('0x10')]);module[_0xde05('0x11')]=router; \ No newline at end of file +var _0x2f72=['/describe','isAuthenticated','describe','/:id','show','post','create','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','index','get'];(function(_0x1a6656,_0xad3657){var _0x4a1be6=function(_0x33582f){while(--_0x33582f){_0x1a6656['push'](_0x1a6656['shift']());}};_0x4a1be6(++_0xad3657);}(_0x2f72,0x128));var _0x22f7=function(_0x3112f6,_0x5ea859){_0x3112f6=_0x3112f6-0x0;var _0x21feb5=_0x2f72[_0x3112f6];return _0x21feb5;};'use strict';var multer=require(_0x22f7('0x0'));var util=require('util');var path=require(_0x22f7('0x1'));var timeout=require(_0x22f7('0x2'));var express=require(_0x22f7('0x3'));var router=express[_0x22f7('0x4')]();var fs_extra=require(_0x22f7('0x5'));var auth=require(_0x22f7('0x6'));var interaction=require(_0x22f7('0x7'));var config=require(_0x22f7('0x8'));var controller=require(_0x22f7('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x22f7('0xa')]);router[_0x22f7('0xb')](_0x22f7('0xc'),auth[_0x22f7('0xd')](),controller[_0x22f7('0xe')]);router[_0x22f7('0xb')](_0x22f7('0xf'),auth[_0x22f7('0xd')](),controller[_0x22f7('0x10')]);router[_0x22f7('0x11')]('/',auth[_0x22f7('0xd')](),controller[_0x22f7('0x12')]);router['put'](_0x22f7('0xf'),auth[_0x22f7('0xd')](),controller[_0x22f7('0x13')]);router[_0x22f7('0x14')](_0x22f7('0xf'),auth[_0x22f7('0xd')](),controller['destroy']);module[_0x22f7('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 68ca2ce..584a7de 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x7a54,0x106));var _0x47a5=function(_0x1a5236,_0x5bebe6){_0x1a5236=_0x1a5236-0x0;var _0x4fa2d0=_0x7a54[_0x1a5236];return _0x4fa2d0;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7a54,0x106));var _0x47a5=function(_0xd68ebe,_0x5dad51){_0xd68ebe=_0xd68ebe-0x0;var _0x5af616=_0x7a54[_0xd68ebe];return _0x5af616;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index a0d01cf..bbf341e 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x17e5=['catch','create','body','find','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','filter','options','includeAll','include','findAll','rows'];(function(_0x51c726,_0x332b95){var _0x23fe86=function(_0x3145c8){while(--_0x3145c8){_0x51c726['push'](_0x51c726['shift']());}};_0x23fe86(++_0x332b95);}(_0x17e5,0x136));var _0x517e=function(_0x451c18,_0x4cdf0b){_0x451c18=_0x451c18-0x0;var _0x3bf63c=_0x17e5[_0x451c18];return _0x3bf63c;};'use strict';var emlformat=require(_0x517e('0x0'));var rimraf=require(_0x517e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x517e('0x2'));var rp=require(_0x517e('0x3'));var moment=require(_0x517e('0x4'));var BPromise=require(_0x517e('0x5'));var Mustache=require(_0x517e('0x6'));var util=require(_0x517e('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x517e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x517e('0x9'));var _=require(_0x517e('0xa'));var squel=require(_0x517e('0xb'));var crypto=require(_0x517e('0xc'));var jsforce=require(_0x517e('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x517e('0xe'));var Papa=require(_0x517e('0xf'));var Redis=require(_0x517e('0x10'));var authService=require(_0x517e('0x11'));var qs=require(_0x517e('0x12'));var as=require(_0x517e('0x13'));var hardwareService=require(_0x517e('0x14'));var logger=require(_0x517e('0x15'))('api');var utils=require(_0x517e('0x16'));var config=require(_0x517e('0x17'));var licenseUtil=require(_0x517e('0x18'));var db=require(_0x517e('0x19'))['db'];function respondWithStatusCode(_0x186c7b,_0x5791b9){_0x5791b9=_0x5791b9||0xcc;return function(_0x28f339){if(_0x28f339){return _0x186c7b[_0x517e('0x1a')](_0x5791b9);}return _0x186c7b[_0x517e('0x1b')](_0x5791b9)[_0x517e('0x1c')]();};}function respondWithResult(_0x7e8425,_0x7ef6cc){_0x7ef6cc=_0x7ef6cc||0xc8;return function(_0x5e51ea){if(_0x5e51ea){return _0x7e8425['status'](_0x7ef6cc)[_0x517e('0x1d')](_0x5e51ea);}};}function respondWithFilteredResult(_0x43fbde,_0x258a92){return function(_0x2a9b80){if(_0x2a9b80){var _0x34b47f=typeof _0x258a92[_0x517e('0x1e')]===_0x517e('0x1f')&&typeof _0x258a92[_0x517e('0x20')]===_0x517e('0x1f');var _0x1b7d64=_0x2a9b80[_0x517e('0x21')];var _0x26c737=_0x34b47f?0x0:_0x258a92[_0x517e('0x1e')];var _0x4581ed=_0x34b47f?_0x2a9b80['count']:_0x258a92[_0x517e('0x1e')]+_0x258a92[_0x517e('0x20')];var _0xfb928e;if(_0x4581ed>=_0x1b7d64){_0x4581ed=_0x1b7d64;_0xfb928e=0xc8;}else{_0xfb928e=0xce;}_0x43fbde[_0x517e('0x1b')](_0xfb928e);return _0x43fbde[_0x517e('0x22')](_0x517e('0x23'),_0x26c737+'-'+_0x4581ed+'/'+_0x1b7d64)['json'](_0x2a9b80);}return null;};}function patchUpdates(_0x9d2c57){return function(_0x341b0f){try{jsonpatch[_0x517e('0x24')](_0x341b0f,_0x9d2c57,!![]);}catch(_0x32fa30){return BPromise['reject'](_0x32fa30);}return _0x341b0f[_0x517e('0x25')]();};}function saveUpdates(_0x1fbbef,_0x38f920){return function(_0x57ecde){if(_0x57ecde){return _0x57ecde[_0x517e('0x26')](_0x1fbbef)[_0x517e('0x27')](function(_0x2633d4){return _0x2633d4;});}return null;};}function removeEntity(_0xae37d7,_0x3619b2){return function(_0x5be689){if(_0x5be689){return _0x5be689[_0x517e('0x28')]()[_0x517e('0x27')](function(){_0xae37d7[_0x517e('0x1b')](0xcc)[_0x517e('0x1c')]();});}};}function handleEntityNotFound(_0x257429,_0x3b0192){return function(_0x19b174){if(!_0x19b174){_0x257429['sendStatus'](0x194);}return _0x19b174;};}function handleError(_0x19be43,_0x31af31){_0x31af31=_0x31af31||0x1f4;return function(_0x2b7c23){logger['error'](_0x2b7c23[_0x517e('0x29')]);if(_0x2b7c23[_0x517e('0x2a')]){delete _0x2b7c23[_0x517e('0x2a')];}_0x19be43[_0x517e('0x1b')](_0x31af31)[_0x517e('0x2b')](_0x2b7c23);};}exports[_0x517e('0x2c')]=function(_0x26a616,_0x2938bb){var _0xe2968c={},_0x50c980={},_0x1f1297={'count':0x0,'rows':[]};var _0xcd4d34=_[_0x517e('0x2d')](db[_0x517e('0x2e')][_0x517e('0x2f')],function(_0x504cb5){return{'name':_0x504cb5[_0x517e('0x30')],'type':_0x504cb5[_0x517e('0x31')]['key']};});_0x50c980[_0x517e('0x32')]=_[_0x517e('0x2d')](_0xcd4d34,_0x517e('0x2a'));_0x50c980[_0x517e('0x33')]=_[_0x517e('0x34')](_0x26a616[_0x517e('0x33')]);_0x50c980['filters']=_[_0x517e('0x35')](_0x50c980[_0x517e('0x32')],_0x50c980[_0x517e('0x33')]);_0xe2968c[_0x517e('0x36')]=_[_0x517e('0x35')](_0x50c980['model'],qs[_0x517e('0x37')](_0x26a616[_0x517e('0x33')]['fields']));_0xe2968c[_0x517e('0x36')]=_0xe2968c[_0x517e('0x36')][_0x517e('0x38')]?_0xe2968c[_0x517e('0x36')]:_0x50c980[_0x517e('0x32')];if(!_0x26a616['query'][_0x517e('0x39')](_0x517e('0x3a'))){_0xe2968c[_0x517e('0x20')]=qs[_0x517e('0x20')](_0x26a616[_0x517e('0x33')][_0x517e('0x20')]);_0xe2968c[_0x517e('0x1e')]=qs[_0x517e('0x1e')](_0x26a616[_0x517e('0x33')][_0x517e('0x1e')]);}_0xe2968c['order']=qs[_0x517e('0x3b')](_0x26a616[_0x517e('0x33')][_0x517e('0x3b')]);_0xe2968c[_0x517e('0x3c')]=qs[_0x517e('0x3d')](_[_0x517e('0x3e')](_0x26a616[_0x517e('0x33')],_0x50c980[_0x517e('0x3d')]),_0xcd4d34);if(_0x26a616['query']['filter']){_0xe2968c[_0x517e('0x3c')]=_[_0x517e('0x3f')](_0xe2968c[_0x517e('0x3c')],{'$or':_['map'](_0xcd4d34,function(_0x1b6d55){if(_0x1b6d55[_0x517e('0x31')]!=='VIRTUAL'){var _0x2cc2ea={};_0x2cc2ea[_0x1b6d55[_0x517e('0x2a')]]={'$like':'%'+_0x26a616[_0x517e('0x33')][_0x517e('0x40')]+'%'};return _0x2cc2ea;}})});}_0xe2968c=_[_0x517e('0x3f')]({},_0xe2968c,_0x26a616[_0x517e('0x41')]);var _0x3601d9={'where':_0xe2968c[_0x517e('0x3c')]};return db[_0x517e('0x2e')][_0x517e('0x21')](_0x3601d9)[_0x517e('0x27')](function(_0x6592bd){_0x1f1297[_0x517e('0x21')]=_0x6592bd;if(_0x26a616['query'][_0x517e('0x42')]){_0xe2968c[_0x517e('0x43')]=[{'all':!![]}];}return db[_0x517e('0x2e')][_0x517e('0x44')](_0xe2968c);})[_0x517e('0x27')](function(_0x2aa1a4){_0x1f1297[_0x517e('0x45')]=_0x2aa1a4;return _0x1f1297;})[_0x517e('0x27')](respondWithFilteredResult(_0x2938bb,_0xe2968c))[_0x517e('0x46')](handleError(_0x2938bb,null));};exports['show']=function(_0x89dd0b,_0x33d21b){var _0x3a0a86={'raw':!![],'where':{'id':_0x89dd0b['params']['id']}},_0x2a6e8f={};_0x2a6e8f[_0x517e('0x32')]=_['keys'](db[_0x517e('0x2e')][_0x517e('0x2f')]);_0x2a6e8f[_0x517e('0x33')]=_[_0x517e('0x34')](_0x89dd0b[_0x517e('0x33')]);_0x2a6e8f[_0x517e('0x3d')]=_[_0x517e('0x35')](_0x2a6e8f[_0x517e('0x32')],_0x2a6e8f[_0x517e('0x33')]);_0x3a0a86[_0x517e('0x36')]=_[_0x517e('0x35')](_0x2a6e8f[_0x517e('0x32')],qs['fields'](_0x89dd0b['query'][_0x517e('0x37')]));_0x3a0a86[_0x517e('0x36')]=_0x3a0a86[_0x517e('0x36')][_0x517e('0x38')]?_0x3a0a86[_0x517e('0x36')]:_0x2a6e8f[_0x517e('0x32')];if(_0x89dd0b[_0x517e('0x33')][_0x517e('0x42')]){_0x3a0a86[_0x517e('0x43')]=[{'all':!![]}];}_0x3a0a86=_[_0x517e('0x3f')]({},_0x3a0a86,_0x89dd0b['options']);return db[_0x517e('0x2e')]['find'](_0x3a0a86)[_0x517e('0x27')](handleEntityNotFound(_0x33d21b,null))[_0x517e('0x27')](respondWithResult(_0x33d21b,null))[_0x517e('0x46')](handleError(_0x33d21b,null));};exports[_0x517e('0x47')]=function(_0x1067f3,_0x85ccfb){return db['JscriptyQuestionReport'][_0x517e('0x47')](_0x1067f3[_0x517e('0x48')],{})[_0x517e('0x27')](respondWithResult(_0x85ccfb,0xc9))['catch'](handleError(_0x85ccfb,null));};exports['update']=function(_0x5883c6,_0x420deb){if(_0x5883c6[_0x517e('0x48')]['id']){delete _0x5883c6['body']['id'];}return db['JscriptyQuestionReport'][_0x517e('0x49')]({'where':{'id':_0x5883c6[_0x517e('0x4a')]['id']}})[_0x517e('0x27')](handleEntityNotFound(_0x420deb,null))[_0x517e('0x27')](saveUpdates(_0x5883c6['body'],null))['then'](respondWithResult(_0x420deb,null))[_0x517e('0x46')](handleError(_0x420deb,null));};exports[_0x517e('0x28')]=function(_0x18537c,_0xe47eff){return db[_0x517e('0x2e')][_0x517e('0x49')]({'where':{'id':_0x18537c['params']['id']}})['then'](handleEntityNotFound(_0xe47eff,null))[_0x517e('0x27')](removeEntity(_0xe47eff,null))[_0x517e('0x46')](handleError(_0xe47eff,null));};exports[_0x517e('0x4b')]=function(_0x53adaf,_0x55c1a7){return db[_0x517e('0x2e')][_0x517e('0x4b')]()[_0x517e('0x27')](respondWithResult(_0x55c1a7,null))[_0x517e('0x46')](handleError(_0x55c1a7,null));}; \ No newline at end of file +var _0xd65b=['../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','include','find','create','body','update','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xd65b,0x19e));var _0xbd65=function(_0x5ac154,_0x69d0f3){_0x5ac154=_0x5ac154-0x0;var _0x1fda87=_0xd65b[_0x5ac154];return _0x1fda87;};'use strict';var emlformat=require(_0xbd65('0x0'));var rimraf=require(_0xbd65('0x1'));var zipdir=require(_0xbd65('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbd65('0x3'));var moment=require(_0xbd65('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbd65('0x5'));var util=require(_0xbd65('0x6'));var path=require(_0xbd65('0x7'));var sox=require(_0xbd65('0x8'));var csv=require(_0xbd65('0x9'));var ejs=require(_0xbd65('0xa'));var fs=require('fs');var fs_extra=require(_0xbd65('0xb'));var _=require(_0xbd65('0xc'));var squel=require(_0xbd65('0xd'));var crypto=require('crypto');var jsforce=require(_0xbd65('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xbd65('0x9'));var querystring=require('querystring');var Papa=require(_0xbd65('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbd65('0x10'));var as=require(_0xbd65('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbd65('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xbd65('0x13'));var licenseUtil=require(_0xbd65('0x14'));var db=require(_0xbd65('0x15'))['db'];function respondWithStatusCode(_0x5aade4,_0x41a911){_0x41a911=_0x41a911||0xcc;return function(_0x476a34){if(_0x476a34){return _0x5aade4['sendStatus'](_0x41a911);}return _0x5aade4[_0xbd65('0x16')](_0x41a911)[_0xbd65('0x17')]();};}function respondWithResult(_0x483170,_0x46dc04){_0x46dc04=_0x46dc04||0xc8;return function(_0x212d54){if(_0x212d54){return _0x483170[_0xbd65('0x16')](_0x46dc04)['json'](_0x212d54);}};}function respondWithFilteredResult(_0x5ddddf,_0xb419d2){return function(_0x1b1ee5){if(_0x1b1ee5){var _0x223fe4=typeof _0xb419d2['offset']===_0xbd65('0x18')&&typeof _0xb419d2['limit']===_0xbd65('0x18');var _0x19a08d=_0x1b1ee5[_0xbd65('0x19')];var _0x3c7253=_0x223fe4?0x0:_0xb419d2[_0xbd65('0x1a')];var _0x2e25cc=_0x223fe4?_0x1b1ee5[_0xbd65('0x19')]:_0xb419d2[_0xbd65('0x1a')]+_0xb419d2[_0xbd65('0x1b')];var _0x4b83e3;if(_0x2e25cc>=_0x19a08d){_0x2e25cc=_0x19a08d;_0x4b83e3=0xc8;}else{_0x4b83e3=0xce;}_0x5ddddf[_0xbd65('0x16')](_0x4b83e3);return _0x5ddddf[_0xbd65('0x1c')](_0xbd65('0x1d'),_0x3c7253+'-'+_0x2e25cc+'/'+_0x19a08d)['json'](_0x1b1ee5);}return null;};}function patchUpdates(_0xb96807){return function(_0xc63946){try{jsonpatch[_0xbd65('0x1e')](_0xc63946,_0xb96807,!![]);}catch(_0xe9a59b){return BPromise[_0xbd65('0x1f')](_0xe9a59b);}return _0xc63946[_0xbd65('0x20')]();};}function saveUpdates(_0x1bf875,_0x40ace0){return function(_0x5bfedd){if(_0x5bfedd){return _0x5bfedd['update'](_0x1bf875)[_0xbd65('0x21')](function(_0x14da3e){return _0x14da3e;});}return null;};}function removeEntity(_0x225ecc,_0x48a5e5){return function(_0x2ed079){if(_0x2ed079){return _0x2ed079[_0xbd65('0x22')]()[_0xbd65('0x21')](function(){_0x225ecc[_0xbd65('0x16')](0xcc)[_0xbd65('0x17')]();});}};}function handleEntityNotFound(_0x2f6388,_0x2ce401){return function(_0x345fd6){if(!_0x345fd6){_0x2f6388['sendStatus'](0x194);}return _0x345fd6;};}function handleError(_0x1fe197,_0x25fa65){_0x25fa65=_0x25fa65||0x1f4;return function(_0xcc4b0d){logger[_0xbd65('0x23')](_0xcc4b0d[_0xbd65('0x24')]);if(_0xcc4b0d[_0xbd65('0x25')]){delete _0xcc4b0d[_0xbd65('0x25')];}_0x1fe197[_0xbd65('0x16')](_0x25fa65)[_0xbd65('0x26')](_0xcc4b0d);};}exports[_0xbd65('0x27')]=function(_0x3ab03a,_0x593781){var _0x2e68ed={},_0x504316={},_0x2d4e3b={'count':0x0,'rows':[]};var _0xaf5b7c=_[_0xbd65('0x28')](db[_0xbd65('0x29')][_0xbd65('0x2a')],function(_0x21ebf1){return{'name':_0x21ebf1['fieldName'],'type':_0x21ebf1[_0xbd65('0x2b')]['key']};});_0x504316[_0xbd65('0x2c')]=_[_0xbd65('0x28')](_0xaf5b7c,_0xbd65('0x25'));_0x504316[_0xbd65('0x2d')]=_[_0xbd65('0x2e')](_0x3ab03a[_0xbd65('0x2d')]);_0x504316[_0xbd65('0x2f')]=_['intersection'](_0x504316['model'],_0x504316['query']);_0x2e68ed['attributes']=_[_0xbd65('0x30')](_0x504316[_0xbd65('0x2c')],qs[_0xbd65('0x31')](_0x3ab03a['query'][_0xbd65('0x31')]));_0x2e68ed[_0xbd65('0x32')]=_0x2e68ed[_0xbd65('0x32')]['length']?_0x2e68ed['attributes']:_0x504316[_0xbd65('0x2c')];if(!_0x3ab03a[_0xbd65('0x2d')][_0xbd65('0x33')]('nolimit')){_0x2e68ed[_0xbd65('0x1b')]=qs[_0xbd65('0x1b')](_0x3ab03a[_0xbd65('0x2d')]['limit']);_0x2e68ed[_0xbd65('0x1a')]=qs[_0xbd65('0x1a')](_0x3ab03a[_0xbd65('0x2d')][_0xbd65('0x1a')]);}_0x2e68ed[_0xbd65('0x34')]=qs[_0xbd65('0x35')](_0x3ab03a[_0xbd65('0x2d')][_0xbd65('0x35')]);_0x2e68ed[_0xbd65('0x36')]=qs[_0xbd65('0x2f')](_[_0xbd65('0x37')](_0x3ab03a[_0xbd65('0x2d')],_0x504316['filters']),_0xaf5b7c);if(_0x3ab03a[_0xbd65('0x2d')][_0xbd65('0x38')]){_0x2e68ed[_0xbd65('0x36')]=_[_0xbd65('0x39')](_0x2e68ed[_0xbd65('0x36')],{'$or':_['map'](_0xaf5b7c,function(_0x249eb2){if(_0x249eb2[_0xbd65('0x2b')]!==_0xbd65('0x3a')){var _0x321d40={};_0x321d40[_0x249eb2[_0xbd65('0x25')]]={'$like':'%'+_0x3ab03a[_0xbd65('0x2d')][_0xbd65('0x38')]+'%'};return _0x321d40;}})});}_0x2e68ed=_[_0xbd65('0x39')]({},_0x2e68ed,_0x3ab03a[_0xbd65('0x3b')]);var _0x1ad68c={'where':_0x2e68ed['where']};return db['JscriptyQuestionReport'][_0xbd65('0x19')](_0x1ad68c)[_0xbd65('0x21')](function(_0x4ce805){_0x2d4e3b[_0xbd65('0x19')]=_0x4ce805;if(_0x3ab03a[_0xbd65('0x2d')]['includeAll']){_0x2e68ed['include']=[{'all':!![]}];}return db[_0xbd65('0x29')][_0xbd65('0x3c')](_0x2e68ed);})['then'](function(_0x52aac4){_0x2d4e3b[_0xbd65('0x3d')]=_0x52aac4;return _0x2d4e3b;})[_0xbd65('0x21')](respondWithFilteredResult(_0x593781,_0x2e68ed))[_0xbd65('0x3e')](handleError(_0x593781,null));};exports[_0xbd65('0x3f')]=function(_0x376179,_0x313d9e){var _0x3d2860={'raw':!![],'where':{'id':_0x376179[_0xbd65('0x40')]['id']}},_0x5c0e1f={};_0x5c0e1f['model']=_['keys'](db['JscriptyQuestionReport'][_0xbd65('0x2a')]);_0x5c0e1f[_0xbd65('0x2d')]=_['keys'](_0x376179[_0xbd65('0x2d')]);_0x5c0e1f[_0xbd65('0x2f')]=_[_0xbd65('0x30')](_0x5c0e1f[_0xbd65('0x2c')],_0x5c0e1f['query']);_0x3d2860[_0xbd65('0x32')]=_[_0xbd65('0x30')](_0x5c0e1f[_0xbd65('0x2c')],qs[_0xbd65('0x31')](_0x376179['query'][_0xbd65('0x31')]));_0x3d2860[_0xbd65('0x32')]=_0x3d2860[_0xbd65('0x32')]['length']?_0x3d2860[_0xbd65('0x32')]:_0x5c0e1f['model'];if(_0x376179['query'][_0xbd65('0x41')]){_0x3d2860[_0xbd65('0x42')]=[{'all':!![]}];}_0x3d2860=_[_0xbd65('0x39')]({},_0x3d2860,_0x376179['options']);return db[_0xbd65('0x29')][_0xbd65('0x43')](_0x3d2860)['then'](handleEntityNotFound(_0x313d9e,null))['then'](respondWithResult(_0x313d9e,null))[_0xbd65('0x3e')](handleError(_0x313d9e,null));};exports['create']=function(_0x5a2a65,_0x12d511){return db[_0xbd65('0x29')][_0xbd65('0x44')](_0x5a2a65[_0xbd65('0x45')],{})['then'](respondWithResult(_0x12d511,0xc9))['catch'](handleError(_0x12d511,null));};exports[_0xbd65('0x46')]=function(_0x1e6ec8,_0x4e9230){if(_0x1e6ec8['body']['id']){delete _0x1e6ec8[_0xbd65('0x45')]['id'];}return db[_0xbd65('0x29')][_0xbd65('0x43')]({'where':{'id':_0x1e6ec8[_0xbd65('0x40')]['id']}})[_0xbd65('0x21')](handleEntityNotFound(_0x4e9230,null))[_0xbd65('0x21')](saveUpdates(_0x1e6ec8[_0xbd65('0x45')],null))[_0xbd65('0x21')](respondWithResult(_0x4e9230,null))[_0xbd65('0x3e')](handleError(_0x4e9230,null));};exports['destroy']=function(_0x4c082f,_0x3398cd){return db[_0xbd65('0x29')][_0xbd65('0x43')]({'where':{'id':_0x4c082f[_0xbd65('0x40')]['id']}})[_0xbd65('0x21')](handleEntityNotFound(_0x3398cd,null))[_0xbd65('0x21')](removeEntity(_0x3398cd,null))['catch'](handleError(_0x3398cd,null));};exports[_0xbd65('0x47')]=function(_0x12f302,_0x1993c4){return db[_0xbd65('0x29')][_0xbd65('0x47')]()[_0xbd65('0x21')](respondWithResult(_0x1993c4,null))[_0xbd65('0x3e')](handleError(_0x1993c4,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index efadb9e..b4b6b7e 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x991a=['./jscriptyQuestionReport.attributes','exports','JscriptyQuestionReport','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3cd533,_0x5dab44){var _0x635fe7=function(_0x5003a9){while(--_0x5003a9){_0x3cd533['push'](_0x3cd533['shift']());}};_0x635fe7(++_0x5dab44);}(_0x991a,0x1ef));var _0xa991=function(_0x5953d5,_0x235b6a){_0x5953d5=_0x5953d5-0x0;var _0x462085=_0x991a[_0x5953d5];return _0x462085;};'use strict';var _=require(_0xa991('0x0'));var util=require(_0xa991('0x1'));var logger=require(_0xa991('0x2'))('api');var moment=require(_0xa991('0x3'));var BPromise=require(_0xa991('0x4'));var rp=require(_0xa991('0x5'));var fs=require('fs');var path=require(_0xa991('0x6'));var rimraf=require(_0xa991('0x7'));var config=require(_0xa991('0x8'));var attributes=require(_0xa991('0x9'));module[_0xa991('0xa')]=function(_0x479d68,_0x14ba27){return _0x479d68['define'](_0xa991('0xb'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb929=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','report_jscripty_questions','lodash','../../config/logger'];(function(_0x22c917,_0x438cac){var _0x15ad9b=function(_0x4f62fc){while(--_0x4f62fc){_0x22c917['push'](_0x22c917['shift']());}};_0x15ad9b(++_0x438cac);}(_0xb929,0x11e));var _0x9b92=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb929[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x9b92('0x0'));var util=require('util');var logger=require(_0x9b92('0x1'))('api');var moment=require(_0x9b92('0x2'));var BPromise=require(_0x9b92('0x3'));var rp=require(_0x9b92('0x4'));var fs=require('fs');var path=require(_0x9b92('0x5'));var rimraf=require(_0x9b92('0x6'));var config=require(_0x9b92('0x7'));var attributes=require(_0x9b92('0x8'));module[_0x9b92('0x9')]=function(_0x2e704f,_0x3ebc8c){return _0x2e704f[_0x9b92('0xa')]('JscriptyQuestionReport',attributes,{'tableName':_0x9b92('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index b4153f4..e5ad444 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe4fd=['info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request'];(function(_0x477e0e,_0x31c29a){var _0xf6083c=function(_0x488bd1){while(--_0x488bd1){_0x477e0e['push'](_0x477e0e['shift']());}};_0xf6083c(++_0x31c29a);}(_0xe4fd,0x17b));var _0xde4f=function(_0x5194ff,_0xd32f17){_0x5194ff=_0x5194ff-0x0;var _0x2415b4=_0xe4fd[_0x5194ff];return _0x2415b4;};'use strict';var _=require(_0xde4f('0x0'));var util=require(_0xde4f('0x1'));var moment=require(_0xde4f('0x2'));var BPromise=require(_0xde4f('0x3'));var rs=require(_0xde4f('0x4'));var fs=require('fs');var Redis=require(_0xde4f('0x5'));var db=require(_0xde4f('0x6'))['db'];var utils=require(_0xde4f('0x7'));var logger=require(_0xde4f('0x8'))(_0xde4f('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xde4f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x485dcc,_0x19ca0b,_0x47a68a){return new BPromise(function(_0x14aa92,_0x3850c5){return client[_0xde4f('0xb')](_0x485dcc,_0x47a68a)['then'](function(_0xc23162){logger[_0xde4f('0xc')](_0xde4f('0xd'),_0x19ca0b,_0xde4f('0xe'));logger[_0xde4f('0xf')](_0xde4f('0x10'),_0x19ca0b,_0xde4f('0xe'),JSON[_0xde4f('0x11')](_0xc23162));if(_0xc23162[_0xde4f('0x12')]){if(_0xc23162['error'][_0xde4f('0x13')]===0x1f4){logger[_0xde4f('0x12')](_0xde4f('0xd'),_0x19ca0b,_0xc23162[_0xde4f('0x12')][_0xde4f('0x14')]);return _0x3850c5(_0xc23162[_0xde4f('0x12')]['message']);}logger['error'](_0xde4f('0xd'),_0x19ca0b,_0xc23162[_0xde4f('0x12')][_0xde4f('0x14')]);return _0x14aa92(_0xc23162[_0xde4f('0x12')]['message']);}else{logger[_0xde4f('0xc')](_0xde4f('0xd'),_0x19ca0b,_0xde4f('0xe'));_0x14aa92(_0xc23162[_0xde4f('0x15')]['message']);}})[_0xde4f('0x16')](function(_0x31d5d5){logger[_0xde4f('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x19ca0b,_0x31d5d5);_0x3850c5(_0x31d5d5);});});} \ No newline at end of file +var _0x145b=['result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x4945da,_0x2ecb03){var _0x24460c=function(_0x30d606){while(--_0x30d606){_0x4945da['push'](_0x4945da['shift']());}};_0x24460c(++_0x2ecb03);}(_0x145b,0xe9));var _0xb145=function(_0x3e08ac,_0xd1786e){_0x3e08ac=_0x3e08ac-0x0;var _0x459fed=_0x145b[_0x3e08ac];return _0x459fed;};'use strict';var _=require('lodash');var util=require(_0xb145('0x0'));var moment=require('moment');var BPromise=require(_0xb145('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb145('0x2'));var db=require(_0xb145('0x3'))['db'];var utils=require(_0xb145('0x4'));var logger=require(_0xb145('0x5'))(_0xb145('0x6'));var config=require(_0xb145('0x7'));var jayson=require(_0xb145('0x8'));var client=jayson[_0xb145('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a7192,_0x482ec5,_0xa14da9){return new BPromise(function(_0x2424c,_0x336acb){return client['request'](_0x2a7192,_0xa14da9)[_0xb145('0xa')](function(_0x127839){logger[_0xb145('0xb')](_0xb145('0xc'),_0x482ec5,_0xb145('0xd'));logger[_0xb145('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x482ec5,_0xb145('0xd'),JSON[_0xb145('0xf')](_0x127839));if(_0x127839[_0xb145('0x10')]){if(_0x127839[_0xb145('0x10')][_0xb145('0x11')]===0x1f4){logger['error'](_0xb145('0xc'),_0x482ec5,_0x127839[_0xb145('0x10')][_0xb145('0x12')]);return _0x336acb(_0x127839[_0xb145('0x10')][_0xb145('0x12')]);}logger['error'](_0xb145('0xc'),_0x482ec5,_0x127839['error']['message']);return _0x2424c(_0x127839[_0xb145('0x10')][_0xb145('0x12')]);}else{logger[_0xb145('0xb')](_0xb145('0xc'),_0x482ec5,'request\x20sent');_0x2424c(_0x127839[_0xb145('0x13')]['message']);}})[_0xb145('0x14')](function(_0xcfb51c){logger[_0xb145('0x10')](_0xb145('0xc'),_0x482ec5,_0xcfb51c);_0x336acb(_0xcfb51c);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 4fc3f03..b75790f 100644 --- a/server/api/jscriptySessionReport/index.js +++ b/server/api/jscriptySessionReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb6fd=['destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/questions','getQuestions','put','update','delete'];(function(_0x3b0394,_0x1a30f9){var _0x1f35e5=function(_0x2dd681){while(--_0x2dd681){_0x3b0394['push'](_0x3b0394['shift']());}};_0x1f35e5(++_0x1a30f9);}(_0xb6fd,0x12d));var _0xdb6f=function(_0xf4b2ff,_0x205716){_0xf4b2ff=_0xf4b2ff-0x0;var _0x22009d=_0xb6fd[_0xf4b2ff];return _0x22009d;};'use strict';var multer=require(_0xdb6f('0x0'));var util=require('util');var path=require(_0xdb6f('0x1'));var timeout=require(_0xdb6f('0x2'));var express=require(_0xdb6f('0x3'));var router=express[_0xdb6f('0x4')]();var fs_extra=require(_0xdb6f('0x5'));var auth=require(_0xdb6f('0x6'));var interaction=require(_0xdb6f('0x7'));var config=require(_0xdb6f('0x8'));var controller=require(_0xdb6f('0x9'));router[_0xdb6f('0xa')]('/',auth[_0xdb6f('0xb')](),controller[_0xdb6f('0xc')]);router[_0xdb6f('0xa')](_0xdb6f('0xd'),auth[_0xdb6f('0xb')](),controller[_0xdb6f('0xe')]);router[_0xdb6f('0xa')](_0xdb6f('0xf'),auth['isAuthenticated'](),controller['show']);router['get'](_0xdb6f('0x10'),auth['isAuthenticated'](),controller[_0xdb6f('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xdb6f('0x12')]('/:id',auth[_0xdb6f('0xb')](),controller[_0xdb6f('0x13')]);router[_0xdb6f('0x14')](_0xdb6f('0xf'),auth[_0xdb6f('0xb')](),controller[_0xdb6f('0x15')]);module[_0xdb6f('0x16')]=router; \ No newline at end of file +var _0x85f8=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/questions','getQuestions','create','put','update'];(function(_0x1156ce,_0x50f233){var _0x2b6d72=function(_0x36a033){while(--_0x36a033){_0x1156ce['push'](_0x1156ce['shift']());}};_0x2b6d72(++_0x50f233);}(_0x85f8,0x10a));var _0x885f=function(_0x5954d1,_0xd48105){_0x5954d1=_0x5954d1-0x0;var _0x15a14e=_0x85f8[_0x5954d1];return _0x15a14e;};'use strict';var multer=require(_0x885f('0x0'));var util=require(_0x885f('0x1'));var path=require(_0x885f('0x2'));var timeout=require('connect-timeout');var express=require(_0x885f('0x3'));var router=express[_0x885f('0x4')]();var fs_extra=require(_0x885f('0x5'));var auth=require(_0x885f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x885f('0x7'));var controller=require(_0x885f('0x8'));router[_0x885f('0x9')]('/',auth[_0x885f('0xa')](),controller[_0x885f('0xb')]);router[_0x885f('0x9')](_0x885f('0xc'),auth[_0x885f('0xa')](),controller['describe']);router[_0x885f('0x9')](_0x885f('0xd'),auth[_0x885f('0xa')](),controller[_0x885f('0xe')]);router[_0x885f('0x9')](_0x885f('0xf'),auth['isAuthenticated'](),controller[_0x885f('0x10')]);router['post']('/',auth[_0x885f('0xa')](),controller[_0x885f('0x11')]);router[_0x885f('0x12')](_0x885f('0xd'),auth[_0x885f('0xa')](),controller[_0x885f('0x13')]);router['delete'](_0x885f('0xd'),auth[_0x885f('0xa')](),controller[_0x885f('0x14')]);module[_0x885f('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index c0b8859..07290f2 100644 --- a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js +++ b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc17d=['DATE','setDataValue','starttime','endtime','YYYY-MM-DD\x20HH:mm:ss','STRING','moment','sequelize','exports'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xc17d,0x96));var _0xdc17=function(_0x2802a9,_0x3f322d){_0x2802a9=_0x2802a9-0x0;var _0x3df44f=_0xc17d[_0x2802a9];return _0x3df44f;};'use strict';var moment=require(_0xdc17('0x0'));var Sequelize=require(_0xdc17('0x1'));module[_0xdc17('0x2')]={'starttime':{'type':Sequelize[_0xdc17('0x3')],'set':function(_0x51477f){this[_0xdc17('0x4')](_0xdc17('0x5'),_0x51477f);this[_0xdc17('0x4')](_0xdc17('0x6'),moment()['format'](_0xdc17('0x7')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0xdc17('0x8')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xdc17('0x8')]},'calleridname':{'type':Sequelize[_0xdc17('0x8')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x86c0=['starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','exports','DATE','setDataValue'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x86c0,0x8a));var _0x086c=function(_0x4bf793,_0x404922){_0x4bf793=_0x4bf793-0x0;var _0x55a44b=_0x86c0[_0x4bf793];return _0x55a44b;};'use strict';var moment=require(_0x086c('0x0'));var Sequelize=require(_0x086c('0x1'));module[_0x086c('0x2')]={'starttime':{'type':Sequelize[_0x086c('0x3')],'set':function(_0x214a01){this[_0x086c('0x4')](_0x086c('0x5'),_0x214a01);this[_0x086c('0x4')](_0x086c('0x6'),moment()[_0x086c('0x7')](_0x086c('0x8')));}},'endtime':{'type':Sequelize[_0x086c('0x3')]},'membername':{'type':Sequelize[_0x086c('0x9')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x086c('0x9')]},'calleridnum':{'type':Sequelize[_0x086c('0x9')]},'completed':{'type':Sequelize[_0x086c('0xa')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 3d4a4c8..e324f76 100644 --- a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js +++ b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xce4b=['moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','limit','undefined','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','fieldName','type','key','model','query','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','JscriptySessionReport','count','includeAll','include','rows','show','keys','intersection','length','find','catch','create','body','params','describe','getQuestions','findOne','JscriptyQuestionReport','rawAttributes','SessionId','filter','findAll','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x370597,_0x39eaf2){var _0x3e5ca2=function(_0x1e1d7b){while(--_0x1e1d7b){_0x370597['push'](_0x370597['shift']());}};_0x3e5ca2(++_0x39eaf2);}(_0xce4b,0xf8));var _0xbce4=function(_0x208c34,_0x3dea86){_0x208c34=_0x208c34-0x0;var _0x3943cd=_0xce4b[_0x208c34];return _0x3943cd;};'use strict';var emlformat=require(_0xbce4('0x0'));var rimraf=require(_0xbce4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbce4('0x2'));var rp=require(_0xbce4('0x3'));var moment=require(_0xbce4('0x4'));var BPromise=require(_0xbce4('0x5'));var Mustache=require(_0xbce4('0x6'));var util=require('util');var path=require(_0xbce4('0x7'));var sox=require(_0xbce4('0x8'));var csv=require(_0xbce4('0x9'));var ejs=require(_0xbce4('0xa'));var fs=require('fs');var fs_extra=require(_0xbce4('0xb'));var _=require('lodash');var squel=require(_0xbce4('0xc'));var crypto=require(_0xbce4('0xd'));var jsforce=require(_0xbce4('0xe'));var deskjs=require(_0xbce4('0xf'));var toCsv=require(_0xbce4('0x9'));var querystring=require(_0xbce4('0x10'));var Papa=require('papaparse');var Redis=require(_0xbce4('0x11'));var authService=require(_0xbce4('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xbce4('0x13'));var hardwareService=require(_0xbce4('0x14'));var logger=require(_0xbce4('0x15'))('api');var utils=require(_0xbce4('0x16'));var config=require(_0xbce4('0x17'));var licenseUtil=require(_0xbce4('0x18'));var db=require(_0xbce4('0x19'))['db'];function respondWithStatusCode(_0x530fba,_0x466758){_0x466758=_0x466758||0xcc;return function(_0x1ade53){if(_0x1ade53){return _0x530fba['sendStatus'](_0x466758);}return _0x530fba['status'](_0x466758)[_0xbce4('0x1a')]();};}function respondWithResult(_0x5d99a4,_0x1fbe36){_0x1fbe36=_0x1fbe36||0xc8;return function(_0x1d42df){if(_0x1d42df){return _0x5d99a4[_0xbce4('0x1b')](_0x1fbe36)['json'](_0x1d42df);}};}function respondWithFilteredResult(_0x2755a2,_0xaf9202){return function(_0x55057f){if(_0x55057f){var _0x30cb91=typeof _0xaf9202['offset']==='undefined'&&typeof _0xaf9202[_0xbce4('0x1c')]===_0xbce4('0x1d');var _0x30764d=_0x55057f['count'];var _0x5f0980=_0x30cb91?0x0:_0xaf9202['offset'];var _0x7144b0=_0x30cb91?_0x55057f['count']:_0xaf9202[_0xbce4('0x1e')]+_0xaf9202[_0xbce4('0x1c')];var _0x507f96;if(_0x7144b0>=_0x30764d){_0x7144b0=_0x30764d;_0x507f96=0xc8;}else{_0x507f96=0xce;}_0x2755a2['status'](_0x507f96);return _0x2755a2[_0xbce4('0x1f')](_0xbce4('0x20'),_0x5f0980+'-'+_0x7144b0+'/'+_0x30764d)[_0xbce4('0x21')](_0x55057f);}return null;};}function patchUpdates(_0x40bd69){return function(_0xdffc5b){try{jsonpatch[_0xbce4('0x22')](_0xdffc5b,_0x40bd69,!![]);}catch(_0x518efe){return BPromise[_0xbce4('0x23')](_0x518efe);}return _0xdffc5b[_0xbce4('0x24')]();};}function saveUpdates(_0x2799ca,_0x22b7a6){return function(_0x53a64e){if(_0x53a64e){return _0x53a64e[_0xbce4('0x25')](_0x2799ca)[_0xbce4('0x26')](function(_0x350594){return _0x350594;});}return null;};}function removeEntity(_0x3cf57c,_0x3d1a4c){return function(_0x175760){if(_0x175760){return _0x175760[_0xbce4('0x27')]()[_0xbce4('0x26')](function(){_0x3cf57c[_0xbce4('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x289f3f,_0x434bdc){return function(_0x48211c){if(!_0x48211c){_0x289f3f[_0xbce4('0x28')](0x194);}return _0x48211c;};}function handleError(_0x4df137,_0xb557f8){_0xb557f8=_0xb557f8||0x1f4;return function(_0x6cf49d){logger['error'](_0x6cf49d[_0xbce4('0x29')]);if(_0x6cf49d[_0xbce4('0x2a')]){delete _0x6cf49d['name'];}_0x4df137[_0xbce4('0x1b')](_0xb557f8)[_0xbce4('0x2b')](_0x6cf49d);};}exports[_0xbce4('0x2c')]=function(_0x335e35,_0x5371b8){var _0x4f28df={},_0x4e48c2={},_0xee9c3d={'count':0x0,'rows':[]};var _0x2d3c13=_[_0xbce4('0x2d')](db['JscriptySessionReport']['rawAttributes'],function(_0x184c3d){return{'name':_0x184c3d[_0xbce4('0x2e')],'type':_0x184c3d[_0xbce4('0x2f')][_0xbce4('0x30')]};});_0x4e48c2[_0xbce4('0x31')]=_[_0xbce4('0x2d')](_0x2d3c13,_0xbce4('0x2a'));_0x4e48c2[_0xbce4('0x32')]=_['keys'](_0x335e35['query']);_0x4e48c2[_0xbce4('0x33')]=_['intersection'](_0x4e48c2['model'],_0x4e48c2['query']);_0x4f28df[_0xbce4('0x34')]=_['intersection'](_0x4e48c2[_0xbce4('0x31')],qs[_0xbce4('0x35')](_0x335e35[_0xbce4('0x32')][_0xbce4('0x35')]));_0x4f28df['attributes']=_0x4f28df['attributes']['length']?_0x4f28df['attributes']:_0x4e48c2['model'];if(!_0x335e35[_0xbce4('0x32')][_0xbce4('0x36')](_0xbce4('0x37'))){_0x4f28df[_0xbce4('0x1c')]=qs[_0xbce4('0x1c')](_0x335e35[_0xbce4('0x32')][_0xbce4('0x1c')]);_0x4f28df['offset']=qs[_0xbce4('0x1e')](_0x335e35['query'][_0xbce4('0x1e')]);}_0x4f28df[_0xbce4('0x38')]=qs[_0xbce4('0x39')](_0x335e35[_0xbce4('0x32')]['sort']);_0x4f28df[_0xbce4('0x3a')]=qs[_0xbce4('0x33')](_[_0xbce4('0x3b')](_0x335e35['query'],_0x4e48c2['filters']),_0x2d3c13);if(_0x335e35[_0xbce4('0x32')]['filter']){_0x4f28df[_0xbce4('0x3a')]=_[_0xbce4('0x3c')](_0x4f28df[_0xbce4('0x3a')],{'$or':_['map'](_0x2d3c13,function(_0x25fc55){if(_0x25fc55[_0xbce4('0x2f')]!=='VIRTUAL'){var _0x40fde1={};_0x40fde1[_0x25fc55[_0xbce4('0x2a')]]={'$like':'%'+_0x335e35[_0xbce4('0x32')]['filter']+'%'};return _0x40fde1;}})});}_0x4f28df=_['merge']({},_0x4f28df,_0x335e35[_0xbce4('0x3d')]);var _0x55572b={'where':_0x4f28df['where']};return db[_0xbce4('0x3e')][_0xbce4('0x3f')](_0x55572b)['then'](function(_0x186e01){_0xee9c3d[_0xbce4('0x3f')]=_0x186e01;if(_0x335e35['query'][_0xbce4('0x40')]){_0x4f28df[_0xbce4('0x41')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x4f28df);})[_0xbce4('0x26')](function(_0x334675){_0xee9c3d[_0xbce4('0x42')]=_0x334675;return _0xee9c3d;})['then'](respondWithFilteredResult(_0x5371b8,_0x4f28df))['catch'](handleError(_0x5371b8,null));};exports[_0xbce4('0x43')]=function(_0x9ba631,_0x49e661){var _0x4aa75d={'raw':!![],'where':{'id':_0x9ba631['params']['id']}},_0x2312fe={};_0x2312fe[_0xbce4('0x31')]=_[_0xbce4('0x44')](db[_0xbce4('0x3e')]['rawAttributes']);_0x2312fe[_0xbce4('0x32')]=_[_0xbce4('0x44')](_0x9ba631[_0xbce4('0x32')]);_0x2312fe[_0xbce4('0x33')]=_[_0xbce4('0x45')](_0x2312fe[_0xbce4('0x31')],_0x2312fe[_0xbce4('0x32')]);_0x4aa75d[_0xbce4('0x34')]=_['intersection'](_0x2312fe[_0xbce4('0x31')],qs['fields'](_0x9ba631['query'][_0xbce4('0x35')]));_0x4aa75d['attributes']=_0x4aa75d[_0xbce4('0x34')][_0xbce4('0x46')]?_0x4aa75d[_0xbce4('0x34')]:_0x2312fe[_0xbce4('0x31')];if(_0x9ba631[_0xbce4('0x32')][_0xbce4('0x40')]){_0x4aa75d['include']=[{'all':!![]}];}_0x4aa75d=_[_0xbce4('0x3c')]({},_0x4aa75d,_0x9ba631[_0xbce4('0x3d')]);return db[_0xbce4('0x3e')][_0xbce4('0x47')](_0x4aa75d)[_0xbce4('0x26')](handleEntityNotFound(_0x49e661,null))[_0xbce4('0x26')](respondWithResult(_0x49e661,null))[_0xbce4('0x48')](handleError(_0x49e661,null));};exports['create']=function(_0x29830f,_0x4a0c0f){return db[_0xbce4('0x3e')][_0xbce4('0x49')](_0x29830f['body'],{})[_0xbce4('0x26')](respondWithResult(_0x4a0c0f,0xc9))[_0xbce4('0x48')](handleError(_0x4a0c0f,null));};exports['update']=function(_0x16ff11,_0x18daf3){if(_0x16ff11[_0xbce4('0x4a')]['id']){delete _0x16ff11[_0xbce4('0x4a')]['id'];}return db['JscriptySessionReport'][_0xbce4('0x47')]({'where':{'id':_0x16ff11['params']['id']}})[_0xbce4('0x26')](handleEntityNotFound(_0x18daf3,null))[_0xbce4('0x26')](saveUpdates(_0x16ff11[_0xbce4('0x4a')],null))[_0xbce4('0x26')](respondWithResult(_0x18daf3,null))[_0xbce4('0x48')](handleError(_0x18daf3,null));};exports[_0xbce4('0x27')]=function(_0xc745fe,_0x51a877){return db[_0xbce4('0x3e')][_0xbce4('0x47')]({'where':{'id':_0xc745fe[_0xbce4('0x4b')]['id']}})['then'](handleEntityNotFound(_0x51a877,null))[_0xbce4('0x26')](removeEntity(_0x51a877,null))['catch'](handleError(_0x51a877,null));};exports[_0xbce4('0x4c')]=function(_0x315fe2,_0x15201a){return db[_0xbce4('0x3e')][_0xbce4('0x4c')]()[_0xbce4('0x26')](respondWithResult(_0x15201a,null))[_0xbce4('0x48')](handleError(_0x15201a,null));};exports[_0xbce4('0x4d')]=function(_0x27f55,_0x20c576,_0x2370f9){var _0x1ee25c={'raw':!![],'where':{}};var _0x5a663f={};var _0x1c60e4={'count':0x0,'rows':[]};return db[_0xbce4('0x3e')][_0xbce4('0x4e')]({'where':{'id':_0x27f55[_0xbce4('0x4b')]['id']}})[_0xbce4('0x26')](handleEntityNotFound(_0x20c576,null))[_0xbce4('0x26')](function(_0xd794a6){if(_0xd794a6){_0x5a663f[_0xbce4('0x31')]=_[_0xbce4('0x44')](db[_0xbce4('0x4f')][_0xbce4('0x50')]);_0x5a663f['query']=_['keys'](_0x27f55['query']);_0x5a663f['filters']=_[_0xbce4('0x45')](_0x5a663f[_0xbce4('0x31')],_0x5a663f[_0xbce4('0x32')]);_0x1ee25c[_0xbce4('0x34')]=_[_0xbce4('0x45')](_0x5a663f[_0xbce4('0x31')],qs[_0xbce4('0x35')](_0x27f55['query']['fields']));_0x1ee25c['attributes']=_0x1ee25c['attributes']['length']?_0x1ee25c[_0xbce4('0x34')]:_0x5a663f[_0xbce4('0x31')];if(!_0x27f55['query'][_0xbce4('0x36')]('nolimit')){_0x1ee25c[_0xbce4('0x1c')]=qs[_0xbce4('0x1c')](_0x27f55[_0xbce4('0x32')][_0xbce4('0x1c')]);_0x1ee25c[_0xbce4('0x1e')]=qs['offset'](_0x27f55[_0xbce4('0x32')]['offset']);}_0x1ee25c[_0xbce4('0x38')]=qs[_0xbce4('0x39')](_0x27f55['query'][_0xbce4('0x39')]);_0x1ee25c['where']=qs['filters'](_[_0xbce4('0x3b')](_0x27f55['query'],_0x5a663f[_0xbce4('0x33')]));_0x1ee25c[_0xbce4('0x3a')][_0xbce4('0x51')]=_0xd794a6['id'];if(_0x27f55['query'][_0xbce4('0x52')]){_0x1ee25c['where']=_[_0xbce4('0x3c')](_0x1ee25c[_0xbce4('0x3a')],{'$or':_[_0xbce4('0x2d')](_0x1ee25c[_0xbce4('0x34')],function(_0x2e409d){var _0x802325={};_0x802325[_0x2e409d]={'$like':'%'+_0x27f55[_0xbce4('0x32')]['filter']+'%'};return _0x802325;})});}_0x1ee25c=_[_0xbce4('0x3c')]({},_0x1ee25c,_0x27f55[_0xbce4('0x3d')]);return db[_0xbce4('0x4f')]['count']({'where':_0x1ee25c[_0xbce4('0x3a')]})['then'](function(_0x14b13b){_0x1c60e4[_0xbce4('0x3f')]=_0x14b13b;if(_0x27f55[_0xbce4('0x32')]['includeAll']){_0x1ee25c[_0xbce4('0x41')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xbce4('0x53')](_0x1ee25c);})['then'](function(_0x16be47){_0x1c60e4[_0xbce4('0x42')]=_0x16be47;return _0x1c60e4;});}})[_0xbce4('0x26')](respondWithFilteredResult(_0x20c576,_0x1ee25c))[_0xbce4('0x48')](handleError(_0x20c576,null));}; \ No newline at end of file +var _0x9de9=['fast-json-patch','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','then','end','error','stack','name','send','index','JscriptySessionReport','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','filters','catch','create','body','find','describe','getQuestions','findOne','JscriptyQuestionReport','sort','eml-format','zip-dir'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x9de9,0xf1));var _0x99de=function(_0x1d9c77,_0x10f7b0){_0x1d9c77=_0x1d9c77-0x0;var _0x3e170b=_0x9de9[_0x1d9c77];return _0x3e170b;};'use strict';var emlformat=require(_0x99de('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x99de('0x1'));var jsonpatch=require(_0x99de('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x99de('0x3'));var path=require(_0x99de('0x4'));var sox=require(_0x99de('0x5'));var csv=require(_0x99de('0x6'));var ejs=require(_0x99de('0x7'));var fs=require('fs');var fs_extra=require(_0x99de('0x8'));var _=require('lodash');var squel=require(_0x99de('0x9'));var crypto=require(_0x99de('0xa'));var jsforce=require(_0x99de('0xb'));var deskjs=require(_0x99de('0xc'));var toCsv=require(_0x99de('0x6'));var querystring=require(_0x99de('0xd'));var Papa=require(_0x99de('0xe'));var Redis=require(_0x99de('0xf'));var authService=require(_0x99de('0x10'));var qs=require(_0x99de('0x11'));var as=require(_0x99de('0x12'));var hardwareService=require(_0x99de('0x13'));var logger=require('../../config/logger')(_0x99de('0x14'));var utils=require(_0x99de('0x15'));var config=require(_0x99de('0x16'));var licenseUtil=require(_0x99de('0x17'));var db=require(_0x99de('0x18'))['db'];function respondWithStatusCode(_0x3adf83,_0x1b03b9){_0x1b03b9=_0x1b03b9||0xcc;return function(_0x2c6108){if(_0x2c6108){return _0x3adf83[_0x99de('0x19')](_0x1b03b9);}return _0x3adf83[_0x99de('0x1a')](_0x1b03b9)['end']();};}function respondWithResult(_0x4ea8d4,_0x46b286){_0x46b286=_0x46b286||0xc8;return function(_0x4b9482){if(_0x4b9482){return _0x4ea8d4[_0x99de('0x1a')](_0x46b286)[_0x99de('0x1b')](_0x4b9482);}};}function respondWithFilteredResult(_0x5ca55c,_0x1db328){return function(_0x39bf48){if(_0x39bf48){var _0xe5b5be=typeof _0x1db328[_0x99de('0x1c')]===_0x99de('0x1d')&&typeof _0x1db328[_0x99de('0x1e')]===_0x99de('0x1d');var _0x504ab1=_0x39bf48[_0x99de('0x1f')];var _0x79fa70=_0xe5b5be?0x0:_0x1db328[_0x99de('0x1c')];var _0x1e75f2=_0xe5b5be?_0x39bf48[_0x99de('0x1f')]:_0x1db328[_0x99de('0x1c')]+_0x1db328[_0x99de('0x1e')];var _0xbe58d9;if(_0x1e75f2>=_0x504ab1){_0x1e75f2=_0x504ab1;_0xbe58d9=0xc8;}else{_0xbe58d9=0xce;}_0x5ca55c[_0x99de('0x1a')](_0xbe58d9);return _0x5ca55c[_0x99de('0x20')](_0x99de('0x21'),_0x79fa70+'-'+_0x1e75f2+'/'+_0x504ab1)['json'](_0x39bf48);}return null;};}function patchUpdates(_0x4c7031){return function(_0x29aa82){try{jsonpatch[_0x99de('0x22')](_0x29aa82,_0x4c7031,!![]);}catch(_0x140598){return BPromise['reject'](_0x140598);}return _0x29aa82['save']();};}function saveUpdates(_0x1f48e8,_0x114a25){return function(_0x2510c2){if(_0x2510c2){return _0x2510c2[_0x99de('0x23')](_0x1f48e8)['then'](function(_0x489c41){return _0x489c41;});}return null;};}function removeEntity(_0x5f0866,_0x2e4c30){return function(_0x17b333){if(_0x17b333){return _0x17b333[_0x99de('0x24')]()[_0x99de('0x25')](function(){_0x5f0866[_0x99de('0x1a')](0xcc)[_0x99de('0x26')]();});}};}function handleEntityNotFound(_0x4f7897,_0xe20642){return function(_0x207813){if(!_0x207813){_0x4f7897[_0x99de('0x19')](0x194);}return _0x207813;};}function handleError(_0x2b4aff,_0x4e45a0){_0x4e45a0=_0x4e45a0||0x1f4;return function(_0x5afaf5){logger[_0x99de('0x27')](_0x5afaf5[_0x99de('0x28')]);if(_0x5afaf5['name']){delete _0x5afaf5[_0x99de('0x29')];}_0x2b4aff[_0x99de('0x1a')](_0x4e45a0)[_0x99de('0x2a')](_0x5afaf5);};}exports[_0x99de('0x2b')]=function(_0x30b3c7,_0xde38aa){var _0x30d667={},_0x3d13de={},_0x3d4046={'count':0x0,'rows':[]};var _0x18ab0b=_['map'](db[_0x99de('0x2c')][_0x99de('0x2d')],function(_0x43b496){return{'name':_0x43b496[_0x99de('0x2e')],'type':_0x43b496[_0x99de('0x2f')][_0x99de('0x30')]};});_0x3d13de[_0x99de('0x31')]=_[_0x99de('0x32')](_0x18ab0b,_0x99de('0x29'));_0x3d13de[_0x99de('0x33')]=_[_0x99de('0x34')](_0x30b3c7[_0x99de('0x33')]);_0x3d13de['filters']=_[_0x99de('0x35')](_0x3d13de[_0x99de('0x31')],_0x3d13de[_0x99de('0x33')]);_0x30d667[_0x99de('0x36')]=_[_0x99de('0x35')](_0x3d13de['model'],qs['fields'](_0x30b3c7[_0x99de('0x33')][_0x99de('0x37')]));_0x30d667['attributes']=_0x30d667[_0x99de('0x36')][_0x99de('0x38')]?_0x30d667[_0x99de('0x36')]:_0x3d13de[_0x99de('0x31')];if(!_0x30b3c7['query'][_0x99de('0x39')](_0x99de('0x3a'))){_0x30d667['limit']=qs[_0x99de('0x1e')](_0x30b3c7[_0x99de('0x33')][_0x99de('0x1e')]);_0x30d667[_0x99de('0x1c')]=qs[_0x99de('0x1c')](_0x30b3c7[_0x99de('0x33')][_0x99de('0x1c')]);}_0x30d667[_0x99de('0x3b')]=qs['sort'](_0x30b3c7[_0x99de('0x33')]['sort']);_0x30d667[_0x99de('0x3c')]=qs['filters'](_[_0x99de('0x3d')](_0x30b3c7['query'],_0x3d13de['filters']),_0x18ab0b);if(_0x30b3c7[_0x99de('0x33')][_0x99de('0x3e')]){_0x30d667[_0x99de('0x3c')]=_['merge'](_0x30d667[_0x99de('0x3c')],{'$or':_[_0x99de('0x32')](_0x18ab0b,function(_0x3fa983){if(_0x3fa983[_0x99de('0x2f')]!=='VIRTUAL'){var _0xd24511={};_0xd24511[_0x3fa983[_0x99de('0x29')]]={'$like':'%'+_0x30b3c7['query'][_0x99de('0x3e')]+'%'};return _0xd24511;}})});}_0x30d667=_[_0x99de('0x3f')]({},_0x30d667,_0x30b3c7[_0x99de('0x40')]);var _0x35bc70={'where':_0x30d667[_0x99de('0x3c')]};return db['JscriptySessionReport'][_0x99de('0x1f')](_0x35bc70)[_0x99de('0x25')](function(_0x3ede7c){_0x3d4046[_0x99de('0x1f')]=_0x3ede7c;if(_0x30b3c7[_0x99de('0x33')][_0x99de('0x41')]){_0x30d667[_0x99de('0x42')]=[{'all':!![]}];}return db[_0x99de('0x2c')][_0x99de('0x43')](_0x30d667);})['then'](function(_0x472fbf){_0x3d4046[_0x99de('0x44')]=_0x472fbf;return _0x3d4046;})['then'](respondWithFilteredResult(_0xde38aa,_0x30d667))['catch'](handleError(_0xde38aa,null));};exports[_0x99de('0x45')]=function(_0x193300,_0x299f34){var _0x3864b1={'raw':!![],'where':{'id':_0x193300[_0x99de('0x46')]['id']}},_0x339430={};_0x339430[_0x99de('0x31')]=_['keys'](db['JscriptySessionReport'][_0x99de('0x2d')]);_0x339430[_0x99de('0x33')]=_[_0x99de('0x34')](_0x193300[_0x99de('0x33')]);_0x339430[_0x99de('0x47')]=_['intersection'](_0x339430[_0x99de('0x31')],_0x339430[_0x99de('0x33')]);_0x3864b1[_0x99de('0x36')]=_[_0x99de('0x35')](_0x339430[_0x99de('0x31')],qs['fields'](_0x193300[_0x99de('0x33')][_0x99de('0x37')]));_0x3864b1['attributes']=_0x3864b1['attributes'][_0x99de('0x38')]?_0x3864b1[_0x99de('0x36')]:_0x339430[_0x99de('0x31')];if(_0x193300[_0x99de('0x33')][_0x99de('0x41')]){_0x3864b1[_0x99de('0x42')]=[{'all':!![]}];}_0x3864b1=_[_0x99de('0x3f')]({},_0x3864b1,_0x193300['options']);return db[_0x99de('0x2c')]['find'](_0x3864b1)[_0x99de('0x25')](handleEntityNotFound(_0x299f34,null))[_0x99de('0x25')](respondWithResult(_0x299f34,null))[_0x99de('0x48')](handleError(_0x299f34,null));};exports[_0x99de('0x49')]=function(_0x2c4e04,_0x44d9ff){return db[_0x99de('0x2c')]['create'](_0x2c4e04[_0x99de('0x4a')],{})[_0x99de('0x25')](respondWithResult(_0x44d9ff,0xc9))['catch'](handleError(_0x44d9ff,null));};exports[_0x99de('0x23')]=function(_0x216be9,_0x68bc78){if(_0x216be9[_0x99de('0x4a')]['id']){delete _0x216be9['body']['id'];}return db[_0x99de('0x2c')][_0x99de('0x4b')]({'where':{'id':_0x216be9[_0x99de('0x46')]['id']}})[_0x99de('0x25')](handleEntityNotFound(_0x68bc78,null))[_0x99de('0x25')](saveUpdates(_0x216be9[_0x99de('0x4a')],null))['then'](respondWithResult(_0x68bc78,null))['catch'](handleError(_0x68bc78,null));};exports[_0x99de('0x24')]=function(_0x1ca15c,_0x44e8f0){return db['JscriptySessionReport'][_0x99de('0x4b')]({'where':{'id':_0x1ca15c[_0x99de('0x46')]['id']}})['then'](handleEntityNotFound(_0x44e8f0,null))[_0x99de('0x25')](removeEntity(_0x44e8f0,null))[_0x99de('0x48')](handleError(_0x44e8f0,null));};exports[_0x99de('0x4c')]=function(_0x57bded,_0x719c0e){return db[_0x99de('0x2c')][_0x99de('0x4c')]()[_0x99de('0x25')](respondWithResult(_0x719c0e,null))['catch'](handleError(_0x719c0e,null));};exports[_0x99de('0x4d')]=function(_0x4bd000,_0x1524ec,_0x15bd62){var _0x5bd201={'raw':!![],'where':{}};var _0x49c00c={};var _0x4fdadd={'count':0x0,'rows':[]};return db[_0x99de('0x2c')][_0x99de('0x4e')]({'where':{'id':_0x4bd000[_0x99de('0x46')]['id']}})['then'](handleEntityNotFound(_0x1524ec,null))[_0x99de('0x25')](function(_0x14f845){if(_0x14f845){_0x49c00c[_0x99de('0x31')]=_[_0x99de('0x34')](db[_0x99de('0x4f')]['rawAttributes']);_0x49c00c['query']=_[_0x99de('0x34')](_0x4bd000[_0x99de('0x33')]);_0x49c00c[_0x99de('0x47')]=_[_0x99de('0x35')](_0x49c00c[_0x99de('0x31')],_0x49c00c['query']);_0x5bd201[_0x99de('0x36')]=_[_0x99de('0x35')](_0x49c00c['model'],qs[_0x99de('0x37')](_0x4bd000[_0x99de('0x33')]['fields']));_0x5bd201[_0x99de('0x36')]=_0x5bd201[_0x99de('0x36')][_0x99de('0x38')]?_0x5bd201[_0x99de('0x36')]:_0x49c00c[_0x99de('0x31')];if(!_0x4bd000['query'][_0x99de('0x39')](_0x99de('0x3a'))){_0x5bd201['limit']=qs[_0x99de('0x1e')](_0x4bd000[_0x99de('0x33')]['limit']);_0x5bd201[_0x99de('0x1c')]=qs[_0x99de('0x1c')](_0x4bd000[_0x99de('0x33')]['offset']);}_0x5bd201['order']=qs['sort'](_0x4bd000['query'][_0x99de('0x50')]);_0x5bd201['where']=qs['filters'](_['pick'](_0x4bd000[_0x99de('0x33')],_0x49c00c[_0x99de('0x47')]));_0x5bd201[_0x99de('0x3c')]['SessionId']=_0x14f845['id'];if(_0x4bd000[_0x99de('0x33')]['filter']){_0x5bd201[_0x99de('0x3c')]=_[_0x99de('0x3f')](_0x5bd201['where'],{'$or':_[_0x99de('0x32')](_0x5bd201[_0x99de('0x36')],function(_0x315750){var _0x322381={};_0x322381[_0x315750]={'$like':'%'+_0x4bd000[_0x99de('0x33')][_0x99de('0x3e')]+'%'};return _0x322381;})});}_0x5bd201=_[_0x99de('0x3f')]({},_0x5bd201,_0x4bd000[_0x99de('0x40')]);return db[_0x99de('0x4f')]['count']({'where':_0x5bd201['where']})[_0x99de('0x25')](function(_0x9d006d){_0x4fdadd[_0x99de('0x1f')]=_0x9d006d;if(_0x4bd000[_0x99de('0x33')][_0x99de('0x41')]){_0x5bd201[_0x99de('0x42')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x99de('0x43')](_0x5bd201);})['then'](function(_0x4aa62){_0x4fdadd[_0x99de('0x44')]=_0x4aa62;return _0x4fdadd;});}})[_0x99de('0x25')](respondWithFilteredResult(_0x1524ec,_0x5bd201))[_0x99de('0x48')](handleError(_0x1524ec,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index a45784e..5948ae2 100644 --- a/server/api/jscriptySessionReport/jscriptySessionReport.model.js +++ b/server/api/jscriptySessionReport/jscriptySessionReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2675=['lodash','moment','bluebird','path','rimraf','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport'];(function(_0x1521be,_0x34aa83){var _0x156a8e=function(_0x1b803c){while(--_0x1b803c){_0x1521be['push'](_0x1521be['shift']());}};_0x156a8e(++_0x34aa83);}(_0x2675,0x75));var _0x5267=function(_0x4780d4,_0x310eec){_0x4780d4=_0x4780d4-0x0;var _0xe75b24=_0x2675[_0x4780d4];return _0xe75b24;};'use strict';var _=require(_0x5267('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5267('0x1'));var BPromise=require(_0x5267('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5267('0x3'));var rimraf=require(_0x5267('0x4'));var config=require('../../config/environment');var attributes=require(_0x5267('0x5'));module[_0x5267('0x6')]=function(_0x4bd042,_0x10f92c){return _0x4bd042[_0x5267('0x7')](_0x5267('0x8'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x44e8=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash'];(function(_0x1b4695,_0x3a90e3){var _0x376a90=function(_0x13811c){while(--_0x13811c){_0x1b4695['push'](_0x1b4695['shift']());}};_0x376a90(++_0x3a90e3);}(_0x44e8,0xd7));var _0x844e=function(_0xeffd03,_0x20d7f9){_0xeffd03=_0xeffd03-0x0;var _0x50839e=_0x44e8[_0xeffd03];return _0x50839e;};'use strict';var _=require(_0x844e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x844e('0x1'));var moment=require(_0x844e('0x2'));var BPromise=require(_0x844e('0x3'));var rp=require(_0x844e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x844e('0x5'));var config=require(_0x844e('0x6'));var attributes=require(_0x844e('0x7'));module[_0x844e('0x8')]=function(_0x5c8f67,_0x2f6539){return _0x5c8f67[_0x844e('0x9')](_0x844e('0xa'),attributes,{'tableName':_0x844e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 878bef1..e5e5796 100644 --- a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js +++ b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3a6d=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x3a6d,0x143));var _0xd3a6=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x3a6d[_0x46698a];return _0x356db0;};'use strict';var _=require(_0xd3a6('0x0'));var util=require(_0xd3a6('0x1'));var moment=require('moment');var BPromise=require(_0xd3a6('0x2'));var rs=require(_0xd3a6('0x3'));var fs=require('fs');var Redis=require(_0xd3a6('0x4'));var db=require(_0xd3a6('0x5'))['db'];var utils=require(_0xd3a6('0x6'));var logger=require('../../config/logger')(_0xd3a6('0x7'));var config=require(_0xd3a6('0x8'));var jayson=require(_0xd3a6('0x9'));var client=jayson[_0xd3a6('0xa')][_0xd3a6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x282cb1,_0x58d83a,_0x121bd2){return new BPromise(function(_0x134dd3,_0x16858){return client[_0xd3a6('0xc')](_0x282cb1,_0x121bd2)[_0xd3a6('0xd')](function(_0xa67661){logger[_0xd3a6('0xe')](_0xd3a6('0xf'),_0x58d83a,_0xd3a6('0x10'));logger['debug'](_0xd3a6('0x11'),_0x58d83a,_0xd3a6('0x10'),JSON[_0xd3a6('0x12')](_0xa67661));if(_0xa67661[_0xd3a6('0x13')]){if(_0xa67661[_0xd3a6('0x13')]['code']===0x1f4){logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x58d83a,_0xa67661[_0xd3a6('0x13')][_0xd3a6('0x14')]);return _0x16858(_0xa67661[_0xd3a6('0x13')][_0xd3a6('0x14')]);}logger[_0xd3a6('0x13')](_0xd3a6('0xf'),_0x58d83a,_0xa67661[_0xd3a6('0x13')]['message']);return _0x134dd3(_0xa67661[_0xd3a6('0x13')][_0xd3a6('0x14')]);}else{logger[_0xd3a6('0xe')]('JscriptySessionReport,\x20%s,\x20%s',_0x58d83a,_0xd3a6('0x10'));_0x134dd3(_0xa67661[_0xd3a6('0x15')][_0xd3a6('0x14')]);}})['catch'](function(_0x3498d5){logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x58d83a,_0x3498d5);_0x16858(_0x3498d5);});});} \ No newline at end of file +var _0xa46e=['request','then','request\x20sent','debug','stringify','error','code','message','JscriptySessionReport,\x20%s,\x20%s','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http'];(function(_0x3ff97b,_0x459934){var _0x43ab91=function(_0x771d6f){while(--_0x771d6f){_0x3ff97b['push'](_0x3ff97b['shift']());}};_0x43ab91(++_0x459934);}(_0xa46e,0x8a));var _0xea46=function(_0x5805d7,_0x3d584a){_0x5805d7=_0x5805d7-0x0;var _0x170fe4=_0xa46e[_0x5805d7];return _0x170fe4;};'use strict';var _=require(_0xea46('0x0'));var util=require(_0xea46('0x1'));var moment=require('moment');var BPromise=require(_0xea46('0x2'));var rs=require(_0xea46('0x3'));var fs=require('fs');var Redis=require(_0xea46('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xea46('0x5'));var logger=require('../../config/logger')(_0xea46('0x6'));var config=require('../../config/environment');var jayson=require(_0xea46('0x7'));var client=jayson['client'][_0xea46('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3dc26f,_0x5f1cd1,_0x2d1b30){return new BPromise(function(_0x42771a,_0xe7d428){return client[_0xea46('0x9')](_0x3dc26f,_0x2d1b30)[_0xea46('0xa')](function(_0x4cf206){logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x5f1cd1,_0xea46('0xb'));logger[_0xea46('0xc')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x5f1cd1,_0xea46('0xb'),JSON[_0xea46('0xd')](_0x4cf206));if(_0x4cf206[_0xea46('0xe')]){if(_0x4cf206['error'][_0xea46('0xf')]===0x1f4){logger[_0xea46('0xe')]('JscriptySessionReport,\x20%s,\x20%s',_0x5f1cd1,_0x4cf206[_0xea46('0xe')][_0xea46('0x10')]);return _0xe7d428(_0x4cf206['error'][_0xea46('0x10')]);}logger['error'](_0xea46('0x11'),_0x5f1cd1,_0x4cf206[_0xea46('0xe')][_0xea46('0x10')]);return _0x42771a(_0x4cf206[_0xea46('0xe')][_0xea46('0x10')]);}else{logger[_0xea46('0x12')](_0xea46('0x11'),_0x5f1cd1,_0xea46('0xb'));_0x42771a(_0x4cf206[_0xea46('0x13')]['message']);}})[_0xea46('0x14')](function(_0xbf225e){logger[_0xea46('0xe')]('JscriptySessionReport,\x20%s,\x20%s',_0x5f1cd1,_0xbf225e);_0xe7d428(_0xbf225e);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 00da124..5235c02 100644 --- a/server/api/license/index.js +++ b/server/api/license/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x47b2=['../../config/environment','./license.controller','get','index','put','isAuthenticated','update','/download_log_file','downloadLogFile','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x326965,_0x3d62b5){var _0x34acb2=function(_0x3bec26){while(--_0x3bec26){_0x326965['push'](_0x326965['shift']());}};_0x34acb2(++_0x3d62b5);}(_0x47b2,0x16a));var _0x247b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x47b2[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x247b('0x0'));var path=require(_0x247b('0x1'));var timeout=require(_0x247b('0x2'));var express=require(_0x247b('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x247b('0x4'));var interaction=require(_0x247b('0x5'));var config=require(_0x247b('0x6'));var controller=require(_0x247b('0x7'));router[_0x247b('0x8')]('/',controller[_0x247b('0x9')]);router[_0x247b('0xa')]('/:id',auth[_0x247b('0xb')](),controller[_0x247b('0xc')]);router[_0x247b('0x8')](_0x247b('0xd'),auth[_0x247b('0xb')](),controller[_0x247b('0xe')]);module[_0x247b('0xf')]=router; \ No newline at end of file +var _0x1147=['../../config/environment','./license.controller','get','put','/:id','isAuthenticated','update','/download_log_file','multer','util','path','express','fs-extra'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x1147,0x1cf));var _0x7114=function(_0x8cc736,_0x3525a4){_0x8cc736=_0x8cc736-0x0;var _0x3026a2=_0x1147[_0x8cc736];return _0x3026a2;};'use strict';var multer=require(_0x7114('0x0'));var util=require(_0x7114('0x1'));var path=require(_0x7114('0x2'));var timeout=require('connect-timeout');var express=require(_0x7114('0x3'));var router=express['Router']();var fs_extra=require(_0x7114('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7114('0x5'));var controller=require(_0x7114('0x6'));router[_0x7114('0x7')]('/',controller['index']);router[_0x7114('0x8')](_0x7114('0x9'),auth[_0x7114('0xa')](),controller[_0x7114('0xb')]);router[_0x7114('0x7')](_0x7114('0xc'),auth[_0x7114('0xa')](),controller['downloadLogFile']);module['exports']=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 9810b6b..e1294d0 100644 --- a/server/api/license/license.attributes.js +++ b/server/api/license/license.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7d03=['TEXT','STRING','sequelize','exports'];(function(_0x31c060,_0x5c03aa){var _0xb420f3=function(_0x12e548){while(--_0x12e548){_0x31c060['push'](_0x31c060['shift']());}};_0xb420f3(++_0x5c03aa);}(_0x7d03,0x10a));var _0x37d0=function(_0x5d5282,_0x150ebd){_0x5d5282=_0x5d5282-0x0;var _0x527304=_0x7d03[_0x5d5282];return _0x527304;};'use strict';var Sequelize=require(_0x37d0('0x0'));module[_0x37d0('0x1')]={'license':{'type':Sequelize[_0x37d0('0x2')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x37d0('0x3')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xb2d9=['sequelize','TEXT','STRING','INTEGER'];(function(_0x1f6c69,_0x254da4){var _0x20a163=function(_0x5d4499){while(--_0x5d4499){_0x1f6c69['push'](_0x1f6c69['shift']());}};_0x20a163(++_0x254da4);}(_0xb2d9,0x114));var _0x9b2d=function(_0xcad71d,_0x522acc){_0xcad71d=_0xcad71d-0x0;var _0x313709=_0xb2d9[_0xcad71d];return _0x313709;};'use strict';var Sequelize=require(_0x9b2d('0x0'));module['exports']={'license':{'type':Sequelize[_0x9b2d('0x1')]},'data1':{'type':Sequelize[_0x9b2d('0x2')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0x9b2d('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 2e56354..a05d032 100644 --- a/server/api/license/license.controller.js +++ b/server/api/license/license.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0ae5=['checkLicense','demo','catch','downloadLogFile','join','/var','log','setHeader','Content-disposition','text/plain','download','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','model','License','rawAttributes','query','keys','intersection','attributes','fields','length','merge','options','getLicense','body','find','get'];(function(_0x4a29a9,_0x58cd04){var _0x386570=function(_0x1d2d09){while(--_0x1d2d09){_0x4a29a9['push'](_0x4a29a9['shift']());}};_0x386570(++_0x58cd04);}(_0x0ae5,0x13b));var _0x50ae=function(_0x15ac27,_0x4c6d79){_0x15ac27=_0x15ac27-0x0;var _0x5b6c8c=_0x0ae5[_0x15ac27];return _0x5b6c8c;};'use strict';var emlformat=require(_0x50ae('0x0'));var rimraf=require(_0x50ae('0x1'));var zipdir=require(_0x50ae('0x2'));var jsonpatch=require(_0x50ae('0x3'));var rp=require('request-promise');var moment=require(_0x50ae('0x4'));var BPromise=require(_0x50ae('0x5'));var Mustache=require(_0x50ae('0x6'));var util=require('util');var path=require(_0x50ae('0x7'));var sox=require(_0x50ae('0x8'));var csv=require(_0x50ae('0x9'));var ejs=require(_0x50ae('0xa'));var fs=require('fs');var fs_extra=require(_0x50ae('0xb'));var _=require(_0x50ae('0xc'));var squel=require(_0x50ae('0xd'));var crypto=require(_0x50ae('0xe'));var jsforce=require(_0x50ae('0xf'));var deskjs=require(_0x50ae('0x10'));var toCsv=require('to-csv');var querystring=require(_0x50ae('0x11'));var Papa=require(_0x50ae('0x12'));var Redis=require(_0x50ae('0x13'));var authService=require(_0x50ae('0x14'));var qs=require(_0x50ae('0x15'));var as=require(_0x50ae('0x16'));var hardwareService=require(_0x50ae('0x17'));var logger=require(_0x50ae('0x18'))(_0x50ae('0x19'));var utils=require(_0x50ae('0x1a'));var config=require(_0x50ae('0x1b'));var licenseUtil=require(_0x50ae('0x1c'));var db=require(_0x50ae('0x1d'))['db'];function respondWithStatusCode(_0x45d9e3,_0x562875){_0x562875=_0x562875||0xcc;return function(_0x21b9ea){if(_0x21b9ea){return _0x45d9e3[_0x50ae('0x1e')](_0x562875);}return _0x45d9e3[_0x50ae('0x1f')](_0x562875)[_0x50ae('0x20')]();};}function respondWithResult(_0x6ddbfb,_0x419115){_0x419115=_0x419115||0xc8;return function(_0x814abb){if(_0x814abb){return _0x6ddbfb['status'](_0x419115)[_0x50ae('0x21')](_0x814abb);}};}function respondWithFilteredResult(_0x54f9aa,_0x1720a4){return function(_0x7b64ee){if(_0x7b64ee){var _0x4341ca=typeof _0x1720a4[_0x50ae('0x22')]==='undefined'&&typeof _0x1720a4['limit']===_0x50ae('0x23');var _0x59a0c7=_0x7b64ee[_0x50ae('0x24')];var _0xa36be=_0x4341ca?0x0:_0x1720a4['offset'];var _0xc228ef=_0x4341ca?_0x7b64ee[_0x50ae('0x24')]:_0x1720a4[_0x50ae('0x22')]+_0x1720a4[_0x50ae('0x25')];var _0x3d08ca;if(_0xc228ef>=_0x59a0c7){_0xc228ef=_0x59a0c7;_0x3d08ca=0xc8;}else{_0x3d08ca=0xce;}_0x54f9aa[_0x50ae('0x1f')](_0x3d08ca);return _0x54f9aa[_0x50ae('0x26')](_0x50ae('0x27'),_0xa36be+'-'+_0xc228ef+'/'+_0x59a0c7)[_0x50ae('0x21')](_0x7b64ee);}return null;};}function patchUpdates(_0x418e9a){return function(_0x53675b){try{jsonpatch[_0x50ae('0x28')](_0x53675b,_0x418e9a,!![]);}catch(_0x4b7cde){return BPromise[_0x50ae('0x29')](_0x4b7cde);}return _0x53675b[_0x50ae('0x2a')]();};}function saveUpdates(_0x1d3233,_0x344e99){return function(_0x29221d){if(_0x29221d){return _0x29221d[_0x50ae('0x2b')](_0x1d3233)[_0x50ae('0x2c')](function(_0xae3dac){return _0xae3dac;});}return null;};}function removeEntity(_0x11b215,_0x455242){return function(_0xcca07a){if(_0xcca07a){return _0xcca07a[_0x50ae('0x2d')]()[_0x50ae('0x2c')](function(){_0x11b215['status'](0xcc)[_0x50ae('0x20')]();});}};}function handleEntityNotFound(_0x10b213,_0x55302f){return function(_0x4800b9){if(!_0x4800b9){_0x10b213['sendStatus'](0x194);}return _0x4800b9;};}function handleError(_0x570e2b,_0x53df93){_0x53df93=_0x53df93||0x1f4;return function(_0x1cc384){logger[_0x50ae('0x2e')](_0x1cc384[_0x50ae('0x2f')]);if(_0x1cc384[_0x50ae('0x30')]){delete _0x1cc384[_0x50ae('0x30')];}_0x570e2b['status'](_0x53df93)['send'](_0x1cc384);};}var utilLicense=require(_0x50ae('0x1c'));exports[_0x50ae('0x31')]=function(_0x52f732,_0x4ae031){var _0x2ade17={'raw':!![],'where':{'id':0x1}},_0x276928={};_0x276928[_0x50ae('0x32')]=_['keys'](db[_0x50ae('0x33')][_0x50ae('0x34')]);_0x276928[_0x50ae('0x35')]=_[_0x50ae('0x36')](_0x52f732[_0x50ae('0x35')]);_0x276928['filters']=_[_0x50ae('0x37')](_0x276928[_0x50ae('0x32')],_0x276928['query']);_0x2ade17[_0x50ae('0x38')]=_[_0x50ae('0x37')](_0x276928['model'],qs[_0x50ae('0x39')](_0x52f732[_0x50ae('0x35')][_0x50ae('0x39')]));_0x2ade17[_0x50ae('0x38')]=_0x2ade17[_0x50ae('0x38')][_0x50ae('0x3a')]?_0x2ade17[_0x50ae('0x38')]:_0x276928[_0x50ae('0x32')];_0x2ade17=_[_0x50ae('0x3b')]({},_0x2ade17,_0x52f732[_0x50ae('0x3c')]);return utilLicense[_0x50ae('0x3d')](_0x2ade17)['then'](respondWithResult(_0x4ae031,null))['catch'](handleError(_0x4ae031,null));};exports[_0x50ae('0x2b')]=function(_0xab39fc,_0x3d2459){if(_0xab39fc[_0x50ae('0x3e')]['id']){delete _0xab39fc[_0x50ae('0x3e')]['id'];}return db[_0x50ae('0x33')][_0x50ae('0x3f')]({'where':{'id':_0xab39fc['params']['id']}})[_0x50ae('0x2c')](handleEntityNotFound(_0x3d2459,null))[_0x50ae('0x2c')](function(_0x2e065d){var _0x5a967d=_0x2e065d[_0x50ae('0x40')]({'plain':!![]});return utilLicense[_0x50ae('0x41')](_0x5a967d,_0xab39fc[_0x50ae('0x3e')]['key']);})[_0x50ae('0x2c')](function(_0x13f4b4){if(!_0x13f4b4[_0x50ae('0x42')]){return saveUpdates(_0xab39fc['body'],null);}return _0x13f4b4;})['then'](respondWithResult(_0x3d2459,null))[_0x50ae('0x43')](handleError(_0x3d2459,null));};exports[_0x50ae('0x44')]=function(_0xe7624e,_0x38ce73){var _0x1c0979='license-info.log';var _0x5a0239=path[_0x50ae('0x45')](_0x50ae('0x46'),_0x50ae('0x47'),'xcally',_0x1c0979);_0x38ce73[_0x50ae('0x48')](_0x50ae('0x49'),'attachment;\x20filename='+_0x1c0979);_0x38ce73[_0x50ae('0x26')]('Content-Type',_0x50ae('0x4a'));_0x38ce73[_0x50ae('0x4b')](_0x5a0239);}; \ No newline at end of file +var _0xd960=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','apply','reject','then','error','stack','name','send','keys','License','rawAttributes','query','intersection','model','attributes','fields','length','options','getLicense','catch','update','body','params','get','checkLicense','demo','downloadLogFile','join','/var','setHeader','Content-disposition','attachment;\x20filename=','set','Content-Type','text/plain','download','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x3d84ef,_0x43dbe7){var _0x433074=function(_0x16e031){while(--_0x16e031){_0x3d84ef['push'](_0x3d84ef['shift']());}};_0x433074(++_0x43dbe7);}(_0xd960,0x76));var _0x0d96=function(_0x31c1f7,_0x2b4cc1){_0x31c1f7=_0x31c1f7-0x0;var _0x4f2cba=_0xd960[_0x31c1f7];return _0x4f2cba;};'use strict';var emlformat=require(_0x0d96('0x0'));var rimraf=require(_0x0d96('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0d96('0x2'));var rp=require(_0x0d96('0x3'));var moment=require(_0x0d96('0x4'));var BPromise=require(_0x0d96('0x5'));var Mustache=require(_0x0d96('0x6'));var util=require(_0x0d96('0x7'));var path=require(_0x0d96('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0d96('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0d96('0xa'));var squel=require('squel');var crypto=require(_0x0d96('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0d96('0xc'));var toCsv=require(_0x0d96('0xd'));var querystring=require('querystring');var Papa=require(_0x0d96('0xe'));var Redis=require(_0x0d96('0xf'));var authService=require(_0x0d96('0x10'));var qs=require(_0x0d96('0x11'));var as=require(_0x0d96('0x12'));var hardwareService=require(_0x0d96('0x13'));var logger=require(_0x0d96('0x14'))(_0x0d96('0x15'));var utils=require(_0x0d96('0x16'));var config=require(_0x0d96('0x17'));var licenseUtil=require(_0x0d96('0x18'));var db=require(_0x0d96('0x19'))['db'];function respondWithStatusCode(_0x4b2e3f,_0x220b22){_0x220b22=_0x220b22||0xcc;return function(_0x2e8755){if(_0x2e8755){return _0x4b2e3f[_0x0d96('0x1a')](_0x220b22);}return _0x4b2e3f[_0x0d96('0x1b')](_0x220b22)[_0x0d96('0x1c')]();};}function respondWithResult(_0x1c1120,_0x2b2932){_0x2b2932=_0x2b2932||0xc8;return function(_0x55d8f7){if(_0x55d8f7){return _0x1c1120['status'](_0x2b2932)[_0x0d96('0x1d')](_0x55d8f7);}};}function respondWithFilteredResult(_0x4560aa,_0x46b1ee){return function(_0x426222){if(_0x426222){var _0x1a22b3=typeof _0x46b1ee[_0x0d96('0x1e')]===_0x0d96('0x1f')&&typeof _0x46b1ee['limit']===_0x0d96('0x1f');var _0x4cec2e=_0x426222[_0x0d96('0x20')];var _0x41ce28=_0x1a22b3?0x0:_0x46b1ee[_0x0d96('0x1e')];var _0x368663=_0x1a22b3?_0x426222['count']:_0x46b1ee[_0x0d96('0x1e')]+_0x46b1ee['limit'];var _0x23d12a;if(_0x368663>=_0x4cec2e){_0x368663=_0x4cec2e;_0x23d12a=0xc8;}else{_0x23d12a=0xce;}_0x4560aa['status'](_0x23d12a);return _0x4560aa['set']('Content-Range',_0x41ce28+'-'+_0x368663+'/'+_0x4cec2e)[_0x0d96('0x1d')](_0x426222);}return null;};}function patchUpdates(_0x41d7a9){return function(_0x4a98d3){try{jsonpatch[_0x0d96('0x21')](_0x4a98d3,_0x41d7a9,!![]);}catch(_0x1ab731){return BPromise[_0x0d96('0x22')](_0x1ab731);}return _0x4a98d3['save']();};}function saveUpdates(_0x41d9f6,_0x3d8fb7){return function(_0x222729){if(_0x222729){return _0x222729['update'](_0x41d9f6)[_0x0d96('0x23')](function(_0x38387a){return _0x38387a;});}return null;};}function removeEntity(_0x1091d6,_0xf8fc0b){return function(_0x27315a){if(_0x27315a){return _0x27315a['destroy']()[_0x0d96('0x23')](function(){_0x1091d6['status'](0xcc)[_0x0d96('0x1c')]();});}};}function handleEntityNotFound(_0x2ef6d8,_0x4d82de){return function(_0x3113ee){if(!_0x3113ee){_0x2ef6d8[_0x0d96('0x1a')](0x194);}return _0x3113ee;};}function handleError(_0x4eefb5,_0x32e2ba){_0x32e2ba=_0x32e2ba||0x1f4;return function(_0x54f72e){logger[_0x0d96('0x24')](_0x54f72e[_0x0d96('0x25')]);if(_0x54f72e[_0x0d96('0x26')]){delete _0x54f72e[_0x0d96('0x26')];}_0x4eefb5[_0x0d96('0x1b')](_0x32e2ba)[_0x0d96('0x27')](_0x54f72e);};}var utilLicense=require(_0x0d96('0x18'));exports['index']=function(_0x3c9485,_0x5656f4){var _0x21e896={'raw':!![],'where':{'id':0x1}},_0x10892e={};_0x10892e['model']=_[_0x0d96('0x28')](db[_0x0d96('0x29')][_0x0d96('0x2a')]);_0x10892e[_0x0d96('0x2b')]=_[_0x0d96('0x28')](_0x3c9485[_0x0d96('0x2b')]);_0x10892e['filters']=_[_0x0d96('0x2c')](_0x10892e[_0x0d96('0x2d')],_0x10892e[_0x0d96('0x2b')]);_0x21e896[_0x0d96('0x2e')]=_['intersection'](_0x10892e['model'],qs[_0x0d96('0x2f')](_0x3c9485['query'][_0x0d96('0x2f')]));_0x21e896['attributes']=_0x21e896[_0x0d96('0x2e')][_0x0d96('0x30')]?_0x21e896['attributes']:_0x10892e[_0x0d96('0x2d')];_0x21e896=_['merge']({},_0x21e896,_0x3c9485[_0x0d96('0x31')]);return utilLicense[_0x0d96('0x32')](_0x21e896)['then'](respondWithResult(_0x5656f4,null))[_0x0d96('0x33')](handleError(_0x5656f4,null));};exports[_0x0d96('0x34')]=function(_0x4fe52e,_0xa1c6cd){if(_0x4fe52e[_0x0d96('0x35')]['id']){delete _0x4fe52e[_0x0d96('0x35')]['id'];}return db['License']['find']({'where':{'id':_0x4fe52e[_0x0d96('0x36')]['id']}})[_0x0d96('0x23')](handleEntityNotFound(_0xa1c6cd,null))[_0x0d96('0x23')](function(_0x1a201a){var _0x2f98e9=_0x1a201a[_0x0d96('0x37')]({'plain':!![]});return utilLicense[_0x0d96('0x38')](_0x2f98e9,_0x4fe52e[_0x0d96('0x35')]['key']);})[_0x0d96('0x23')](function(_0x3f0f4a){if(!_0x3f0f4a[_0x0d96('0x39')]){return saveUpdates(_0x4fe52e['body'],null);}return _0x3f0f4a;})[_0x0d96('0x23')](respondWithResult(_0xa1c6cd,null))['catch'](handleError(_0xa1c6cd,null));};exports[_0x0d96('0x3a')]=function(_0x2bd1cd,_0x2bc8a7){var _0x45231b='license-info.log';var _0xbdbbec=path[_0x0d96('0x3b')](_0x0d96('0x3c'),'log','xcally',_0x45231b);_0x2bc8a7[_0x0d96('0x3d')](_0x0d96('0x3e'),_0x0d96('0x3f')+_0x45231b);_0x2bc8a7[_0x0d96('0x40')](_0x0d96('0x41'),_0x0d96('0x42'));_0x2bc8a7[_0x0d96('0x43')](_0xbdbbec);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 0c56d11..8210b87 100644 --- a/server/api/license/license.model.js +++ b/server/api/license/license.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd996=['define','License','license','../../config/logger','api','moment','request-promise','../../config/environment','./license.attributes','exports'];(function(_0x4cf0b7,_0x560029){var _0x545f10=function(_0x993533){while(--_0x993533){_0x4cf0b7['push'](_0x4cf0b7['shift']());}};_0x545f10(++_0x560029);}(_0xd996,0x17f));var _0x6d99=function(_0x3c635d,_0x116053){_0x3c635d=_0x3c635d-0x0;var _0x75c7fb=_0xd996[_0x3c635d];return _0x75c7fb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6d99('0x0'))(_0x6d99('0x1'));var moment=require(_0x6d99('0x2'));var BPromise=require('bluebird');var rp=require(_0x6d99('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6d99('0x4'));var attributes=require(_0x6d99('0x5'));module[_0x6d99('0x6')]=function(_0x7f1e1,_0x130046){return _0x7f1e1[_0x6d99('0x7')](_0x6d99('0x8'),attributes,{'tableName':_0x6d99('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaf1e=['request-promise','path','rimraf','../../config/environment','exports','License','license','lodash','util','../../config/logger','moment','bluebird'];(function(_0x2dd82f,_0xd7595f){var _0x311f96=function(_0x30cc2d){while(--_0x30cc2d){_0x2dd82f['push'](_0x2dd82f['shift']());}};_0x311f96(++_0xd7595f);}(_0xaf1e,0x157));var _0xeaf1=function(_0x2188c5,_0x5f3ee1){_0x2188c5=_0x2188c5-0x0;var _0x35c621=_0xaf1e[_0x2188c5];return _0x35c621;};'use strict';var _=require(_0xeaf1('0x0'));var util=require(_0xeaf1('0x1'));var logger=require(_0xeaf1('0x2'))('api');var moment=require(_0xeaf1('0x3'));var BPromise=require(_0xeaf1('0x4'));var rp=require(_0xeaf1('0x5'));var fs=require('fs');var path=require(_0xeaf1('0x6'));var rimraf=require(_0xeaf1('0x7'));var config=require(_0xeaf1('0x8'));var attributes=require('./license.attributes');module[_0xeaf1('0x9')]=function(_0x51fa5d,_0x29a963){return _0x51fa5d['define'](_0xeaf1('0xa'),attributes,{'tableName':_0xeaf1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index cfe9f02..a424be9 100644 --- a/server/api/license/license.rpc.js +++ b/server/api/license/license.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9cbf=['../../config/environment','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2cdf41,_0x4a277c){var _0x39a70e=function(_0x2404a9){while(--_0x2404a9){_0x2cdf41['push'](_0x2cdf41['shift']());}};_0x39a70e(++_0x4a277c);}(_0x9cbf,0xf0));var _0xf9cb=function(_0x36e87c,_0x16e8e7){_0x36e87c=_0x36e87c-0x0;var _0x188fdc=_0x9cbf[_0x36e87c];return _0x188fdc;};'use strict';var _=require(_0xf9cb('0x0'));var util=require(_0xf9cb('0x1'));var moment=require(_0xf9cb('0x2'));var BPromise=require(_0xf9cb('0x3'));var rs=require(_0xf9cb('0x4'));var fs=require('fs');var Redis=require(_0xf9cb('0x5'));var db=require(_0xf9cb('0x6'))['db'];var utils=require(_0xf9cb('0x7'));var logger=require(_0xf9cb('0x8'))(_0xf9cb('0x9'));var config=require(_0xf9cb('0xa'));var jayson=require(_0xf9cb('0xb'));var client=jayson[_0xf9cb('0xc')][_0xf9cb('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x35603f,_0x533f88,_0x5eaf8e){return new BPromise(function(_0x513158,_0x61c83d){return client[_0xf9cb('0xe')](_0x35603f,_0x5eaf8e)[_0xf9cb('0xf')](function(_0x5d2f0c){logger[_0xf9cb('0x10')](_0xf9cb('0x11'),_0x533f88,'request\x20sent');logger[_0xf9cb('0x12')]('License,\x20%s,\x20%s,\x20%s',_0x533f88,_0xf9cb('0x13'),JSON[_0xf9cb('0x14')](_0x5d2f0c));if(_0x5d2f0c[_0xf9cb('0x15')]){if(_0x5d2f0c[_0xf9cb('0x15')][_0xf9cb('0x16')]===0x1f4){logger['error'](_0xf9cb('0x11'),_0x533f88,_0x5d2f0c['error']['message']);return _0x61c83d(_0x5d2f0c['error'][_0xf9cb('0x17')]);}logger[_0xf9cb('0x15')](_0xf9cb('0x11'),_0x533f88,_0x5d2f0c[_0xf9cb('0x15')][_0xf9cb('0x17')]);return _0x513158(_0x5d2f0c[_0xf9cb('0x15')]['message']);}else{logger[_0xf9cb('0x10')](_0xf9cb('0x11'),_0x533f88,'request\x20sent');_0x513158(_0x5d2f0c[_0xf9cb('0x18')]['message']);}})['catch'](function(_0x27116d){logger[_0xf9cb('0x15')](_0xf9cb('0x11'),_0x533f88,_0x27116d);_0x61c83d(_0x27116d);});});} \ No newline at end of file +var _0xffee=['License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','client','http','request','info','License,\x20%s,\x20%s','request\x20sent'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0xffee,0xfe));var _0xeffe=function(_0x218f69,_0x243ae3){_0x218f69=_0x218f69-0x0;var _0xfc7a12=_0xffee[_0x218f69];return _0xfc7a12;};'use strict';var _=require(_0xeffe('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xeffe('0x1'));var rs=require(_0xeffe('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeffe('0x3'))['db'];var utils=require(_0xeffe('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xeffe('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xeffe('0x6')][_0xeffe('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2d038b,_0x2b9b35,_0x6397d6){return new BPromise(function(_0x8061d2,_0x19feab){return client[_0xeffe('0x8')](_0x2d038b,_0x6397d6)['then'](function(_0x382d47){logger[_0xeffe('0x9')](_0xeffe('0xa'),_0x2b9b35,_0xeffe('0xb'));logger['debug'](_0xeffe('0xc'),_0x2b9b35,_0xeffe('0xb'),JSON[_0xeffe('0xd')](_0x382d47));if(_0x382d47['error']){if(_0x382d47[_0xeffe('0xe')][_0xeffe('0xf')]===0x1f4){logger[_0xeffe('0xe')]('License,\x20%s,\x20%s',_0x2b9b35,_0x382d47[_0xeffe('0xe')][_0xeffe('0x10')]);return _0x19feab(_0x382d47[_0xeffe('0xe')][_0xeffe('0x10')]);}logger[_0xeffe('0xe')](_0xeffe('0xa'),_0x2b9b35,_0x382d47[_0xeffe('0xe')][_0xeffe('0x10')]);return _0x8061d2(_0x382d47[_0xeffe('0xe')][_0xeffe('0x10')]);}else{logger[_0xeffe('0x9')](_0xeffe('0xa'),_0x2b9b35,_0xeffe('0xb'));_0x8061d2(_0x382d47[_0xeffe('0x11')]['message']);}})[_0xeffe('0x12')](function(_0x2e2b87){logger[_0xeffe('0xe')](_0xeffe('0xa'),_0x2b9b35,_0x2e2b87);_0x19feab(_0x2e2b87);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 3ccb631..0aaa1f5 100644 --- a/server/api/mailAccount/index.js +++ b/server/api/mailAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7435=['/:id/out_servers','addSmtp','addInteraction','addApplications','/:id/send','send','addAgents','put','update','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','/:id/users','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','post','addAnswer','create','addImap'];(function(_0x8d3bef,_0x293ccc){var _0x2442e1=function(_0x42085f){while(--_0x42085f){_0x8d3bef['push'](_0x8d3bef['shift']());}};_0x2442e1(++_0x293ccc);}(_0x7435,0x136));var _0x5743=function(_0x6fe380,_0x147f69){_0x6fe380=_0x6fe380-0x0;var _0x251d29=_0x7435[_0x6fe380];return _0x251d29;};'use strict';var multer=require('multer');var util=require(_0x5743('0x0'));var path=require(_0x5743('0x1'));var timeout=require(_0x5743('0x2'));var express=require(_0x5743('0x3'));var router=express[_0x5743('0x4')]();var fs_extra=require(_0x5743('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5743('0x6'));var config=require('../../config/environment');var controller=require(_0x5743('0x7'));router[_0x5743('0x8')]('/',auth[_0x5743('0x9')](),controller[_0x5743('0xa')]);router[_0x5743('0x8')](_0x5743('0xb'),auth[_0x5743('0x9')](),controller[_0x5743('0xc')]);router[_0x5743('0x8')](_0x5743('0xd'),auth['isAuthenticated'](),controller[_0x5743('0xe')]);router[_0x5743('0x8')](_0x5743('0xf'),auth['isAuthenticated'](),controller[_0x5743('0x10')]);router[_0x5743('0x8')](_0x5743('0x11'),auth['isAuthenticated'](),controller[_0x5743('0x12')]);router[_0x5743('0x8')](_0x5743('0x13'),auth[_0x5743('0x9')](),controller[_0x5743('0x14')]);router['get']('/:id/out_servers',auth[_0x5743('0x9')](),controller[_0x5743('0x15')]);router[_0x5743('0x8')](_0x5743('0x16'),auth[_0x5743('0x9')](),controller[_0x5743('0x17')]);router[_0x5743('0x8')](_0x5743('0x18'),auth[_0x5743('0x9')](),controller[_0x5743('0x19')]);router[_0x5743('0x8')](_0x5743('0x1a'),auth[_0x5743('0x9')](),controller[_0x5743('0x1b')]);router[_0x5743('0x8')](_0x5743('0x1c'),auth[_0x5743('0x9')](),controller['verifySmtp']);router['get']('/:id/users',auth[_0x5743('0x9')](),controller['getAgents']);router[_0x5743('0x1d')]('/:id/dispositions',auth['isAuthenticated'](),controller['addDisposition']);router['post']('/:id/canned_answers',auth[_0x5743('0x9')](),controller[_0x5743('0x1e')]);router[_0x5743('0x1d')]('/',auth[_0x5743('0x9')](),controller[_0x5743('0x1f')]);router[_0x5743('0x1d')](_0x5743('0x13'),auth[_0x5743('0x9')](),controller[_0x5743('0x20')]);router[_0x5743('0x1d')](_0x5743('0x21'),auth[_0x5743('0x9')](),controller[_0x5743('0x22')]);router[_0x5743('0x1d')](_0x5743('0x16'),auth[_0x5743('0x9')](),controller[_0x5743('0x23')]);router[_0x5743('0x1d')](_0x5743('0x18'),auth[_0x5743('0x9')](),controller[_0x5743('0x24')]);router[_0x5743('0x1d')](_0x5743('0x25'),auth[_0x5743('0x9')](),controller[_0x5743('0x26')]);router[_0x5743('0x1d')]('/:id/users',auth[_0x5743('0x9')](),controller[_0x5743('0x27')]);router[_0x5743('0x28')]('/:id',auth[_0x5743('0x9')](),controller[_0x5743('0x29')]);router[_0x5743('0x2a')](_0x5743('0xf'),auth['isAuthenticated'](),controller[_0x5743('0x2b')]);router[_0x5743('0x2a')](_0x5743('0x11'),auth[_0x5743('0x9')](),controller[_0x5743('0x2c')]);router[_0x5743('0x2a')]('/:id/in_servers',auth[_0x5743('0x9')](),controller[_0x5743('0x2d')]);router['delete'](_0x5743('0x21'),auth[_0x5743('0x9')](),controller[_0x5743('0x2e')]);router['delete'](_0x5743('0xd'),auth[_0x5743('0x9')](),controller['destroy']);router[_0x5743('0x2a')](_0x5743('0x2f'),auth[_0x5743('0x9')](),controller['removeAgents']);module[_0x5743('0x30')]=router; \ No newline at end of file +var _0x6af6=['/:id/out_servers','/:id/interactions','getInteractions','getApplications','/:id/messages','/:id/users','getAgents','/:id/dispositions','addDisposition','post','addAnswer','create','/:id/in_servers','addSmtp','addInteraction','send','addAgents','put','delete','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/:id','show','getDispositions','/:id/canned_answers','getAnswers'];(function(_0x4bb546,_0x5083bd){var _0x4c366c=function(_0x4b412c){while(--_0x4b412c){_0x4bb546['push'](_0x4bb546['shift']());}};_0x4c366c(++_0x5083bd);}(_0x6af6,0x1e6));var _0x66af=function(_0x31371d,_0x27905e){_0x31371d=_0x31371d-0x0;var _0x365fe5=_0x6af6[_0x31371d];return _0x365fe5;};'use strict';var multer=require(_0x66af('0x0'));var util=require(_0x66af('0x1'));var path=require(_0x66af('0x2'));var timeout=require(_0x66af('0x3'));var express=require('express');var router=express[_0x66af('0x4')]();var fs_extra=require(_0x66af('0x5'));var auth=require(_0x66af('0x6'));var interaction=require(_0x66af('0x7'));var config=require(_0x66af('0x8'));var controller=require(_0x66af('0x9'));router[_0x66af('0xa')]('/',auth[_0x66af('0xb')](),controller[_0x66af('0xc')]);router[_0x66af('0xa')]('/describe',auth[_0x66af('0xb')](),controller['describe']);router['get'](_0x66af('0xd'),auth[_0x66af('0xb')](),controller[_0x66af('0xe')]);router[_0x66af('0xa')]('/:id/dispositions',auth[_0x66af('0xb')](),controller[_0x66af('0xf')]);router[_0x66af('0xa')](_0x66af('0x10'),auth[_0x66af('0xb')](),controller[_0x66af('0x11')]);router['get']('/:id/in_servers',auth[_0x66af('0xb')](),controller['getImap']);router[_0x66af('0xa')](_0x66af('0x12'),auth[_0x66af('0xb')](),controller['getSmtp']);router[_0x66af('0xa')](_0x66af('0x13'),auth[_0x66af('0xb')](),controller[_0x66af('0x14')]);router[_0x66af('0xa')]('/:id/applications',auth[_0x66af('0xb')](),controller[_0x66af('0x15')]);router['get'](_0x66af('0x16'),auth[_0x66af('0xb')](),controller['getMessages']);router[_0x66af('0xa')]('/:id/verify',auth[_0x66af('0xb')](),controller['verifySmtp']);router[_0x66af('0xa')](_0x66af('0x17'),auth[_0x66af('0xb')](),controller[_0x66af('0x18')]);router['post'](_0x66af('0x19'),auth[_0x66af('0xb')](),controller[_0x66af('0x1a')]);router[_0x66af('0x1b')](_0x66af('0x10'),auth[_0x66af('0xb')](),controller[_0x66af('0x1c')]);router['post']('/',auth['isAuthenticated'](),controller[_0x66af('0x1d')]);router[_0x66af('0x1b')](_0x66af('0x1e'),auth['isAuthenticated'](),controller['addImap']);router[_0x66af('0x1b')](_0x66af('0x12'),auth[_0x66af('0xb')](),controller[_0x66af('0x1f')]);router[_0x66af('0x1b')](_0x66af('0x13'),auth[_0x66af('0xb')](),controller[_0x66af('0x20')]);router['post']('/:id/applications',auth[_0x66af('0xb')](),controller['addApplications']);router[_0x66af('0x1b')]('/:id/send',auth[_0x66af('0xb')](),controller[_0x66af('0x21')]);router[_0x66af('0x1b')]('/:id/users',auth[_0x66af('0xb')](),controller[_0x66af('0x22')]);router[_0x66af('0x23')](_0x66af('0xd'),auth[_0x66af('0xb')](),controller['update']);router[_0x66af('0x24')](_0x66af('0x19'),auth[_0x66af('0xb')](),controller['removeDispositions']);router[_0x66af('0x24')](_0x66af('0x10'),auth[_0x66af('0xb')](),controller[_0x66af('0x25')]);router[_0x66af('0x24')](_0x66af('0x1e'),auth[_0x66af('0xb')](),controller[_0x66af('0x26')]);router[_0x66af('0x24')](_0x66af('0x12'),auth[_0x66af('0xb')](),controller[_0x66af('0x27')]);router[_0x66af('0x24')](_0x66af('0xd'),auth['isAuthenticated'](),controller[_0x66af('0x28')]);router[_0x66af('0x24')](_0x66af('0x17'),auth['isAuthenticated'](),controller[_0x66af('0x29')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 84811cc..b593722 100644 --- a/server/api/mailAccount/mailAccount.attributes.js +++ b/server/api/mailAccount/mailAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6356=['STRING','BOOLEAN','Arial,Helvetica,sans-serif','INTEGER','TEXT','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','ENUM','gmail','yahoo','getDataValue','provider','custom','sequelize','exports'];(function(_0x32829c,_0x375039){var _0x2a0620=function(_0xc7221a){while(--_0xc7221a){_0x32829c['push'](_0x32829c['shift']());}};_0x2a0620(++_0x375039);}(_0x6356,0x1b8));var _0x6635=function(_0x440e51,_0x4fc63a){_0x440e51=_0x440e51-0x0;var _0x9be905=_0x6356[_0x440e51];return _0x9be905;};'use strict';var Sequelize=require(_0x6635('0x0'));module[_0x6635('0x1')]={'description':{'type':Sequelize[_0x6635('0x2')]},'name':{'type':Sequelize[_0x6635('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x6635('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x6635('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x6635('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x6635('0x2')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0x6635('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6635('0x4')},'fontSize':{'type':Sequelize[_0x6635('0x5')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x6635('0x6')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6635('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6635('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x6635('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6635('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6635('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6635('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6635('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x6635('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x6635('0x3')],'defaultValue':![],'comment':_0x6635('0x8'),'set':function(_0x582579){if(!_0x582579)this[_0x6635('0x9')]('mandatoryDispositionPauseId',null);this[_0x6635('0x9')](_0x6635('0xa'),_0x582579);}},'provider':{'type':Sequelize[_0x6635('0xb')](_0x6635('0xc'),'hotmail',_0x6635('0xd'),'outlook365'),'defaultValue':null,'get':function(){if(!this[_0x6635('0xe')](_0x6635('0xf')))return _0x6635('0x10');return this[_0x6635('0xe')]('provider');},'set':function(_0x5d976a){if(_0x5d976a===_0x6635('0x10'))_0x5d976a=null;return this[_0x6635('0x9')](_0x6635('0xf'),_0x5d976a);}}}; \ No newline at end of file +var _0xab4d=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','ENUM','gmail','yahoo','provider','getDataValue','custom','exports','STRING','BOOLEAN','TEXT'];(function(_0x5948dd,_0x1f6ac8){var _0xb1f8be=function(_0x31a8d2){while(--_0x31a8d2){_0x5948dd['push'](_0x5948dd['shift']());}};_0xb1f8be(++_0x1f6ac8);}(_0xab4d,0xbc));var _0xdab4=function(_0x5b34c0,_0x3ad403){_0x5b34c0=_0x5b34c0-0x0;var _0x242bd3=_0xab4d[_0x5b34c0];return _0x242bd3;};'use strict';var Sequelize=require('sequelize');module[_0xdab4('0x0')]={'description':{'type':Sequelize[_0xdab4('0x1')]},'name':{'type':Sequelize[_0xdab4('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0xdab4('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xdab4('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0xdab4('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0xdab4('0x3')]},'markAsUnread':{'type':Sequelize[_0xdab4('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0xdab4('0x4')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xdab4('0x3')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0xdab4('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xdab4('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xdab4('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xdab4('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xdab4('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xdab4('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xdab4('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xdab4('0x5')},'mandatoryDisposition':{'type':Sequelize[_0xdab4('0x2')],'defaultValue':![],'comment':_0xdab4('0x6'),'set':function(_0xbebdcb){if(!_0xbebdcb)this['setDataValue'](_0xdab4('0x7'),null);this[_0xdab4('0x8')](_0xdab4('0x9'),_0xbebdcb);}},'provider':{'type':Sequelize[_0xdab4('0xa')](_0xdab4('0xb'),'hotmail',_0xdab4('0xc'),'outlook365'),'defaultValue':null,'get':function(){if(!this['getDataValue'](_0xdab4('0xd')))return'custom';return this[_0xdab4('0xe')](_0xdab4('0xd'));},'set':function(_0x3faff2){if(_0x3faff2===_0xdab4('0xf'))_0x3faff2=null;return this['setDataValue'](_0xdab4('0xd'),_0x3faff2);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index e6ddb0e..c5ef862 100644 --- a/server/api/mailAccount/mailAccount.controller.js +++ b/server/api/mailAccount/mailAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6570=['YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','split','CmList','List','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','attachments','join','root','server/files/attachments','basename','SendMail','sendMail','List\x20not\x20found','Contacts','messageId','subject','attach','out','Interaction','Messages','verifySmtp','getSmtpOptions','VerifySmtp','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','isArray','getAgents','User','moment','bluebird','util','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailAccount.socket','register','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','limit','offset','count','set','get','MailAccounts','UserProfileResource','destroy','stack','name','send','gmail','imap.gmail.com','yahoo','imap-mail.outlook.com','Unknown\x20email\x20service\x20provider','smtp-mail.outlook.com','outlook365','smtp.office365.com','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','service','authentication','Imap','Smtp','index','MailServerIn','MailServerOut','Pause','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','MailAccount','findAll','rows','show','params','includeAll','include','options','find','update','body','provider','custom','secure','mandatoryDispositionPause','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','create','email','ListId','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','addInteraction','omit','MailInteraction','CmContact','Contact','fullname','Tags','color','tag','addApplications','sequelize','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','finally','getApplications','getMessages','MailMessage','$gte','format'];(function(_0x3def8a,_0x4001c3){var _0x5470c2=function(_0x3dc9bc){while(--_0x3dc9bc){_0x3def8a['push'](_0x3def8a['shift']());}};_0x5470c2(++_0x4001c3);}(_0x6570,0x1a3));var _0x0657=function(_0x44447a,_0x4eb0be){_0x44447a=_0x44447a-0x0;var _0xcc8749=_0x6570[_0x44447a];return _0xcc8749;};'use strict';var moment=require(_0x0657('0x0'));var BPromise=require(_0x0657('0x1'));var util=require(_0x0657('0x2'));var path=require('path');var _=require(_0x0657('0x3'));var juice=require('juice');var Redis=require('ioredis');var qs=require(_0x0657('0x4'));var logger=require(_0x0657('0x5'))(_0x0657('0x6'));var config=require(_0x0657('0x7'));var db=require(_0x0657('0x8'))['db'];config[_0x0657('0x9')]=_[_0x0657('0xa')](config[_0x0657('0x9')],{'host':_0x0657('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0657('0xc'))[_0x0657('0xd')](socket);var jayson=require(_0x0657('0xe'));var client=jayson[_0x0657('0xf')][_0x0657('0x10')]({'port':0x232b});function respondWithRpcPromise(_0x503fa5,_0xd92091,_0x68f071,_0x293299){return new BPromise(function(_0x415a78,_0x606221){var _0x463429=_0x293299||client;return _0x463429[_0x0657('0x11')](_0x503fa5,_0x68f071)[_0x0657('0x12')](function(_0x23a267){logger[_0x0657('0x13')](_0x0657('0x14'),_0xd92091,_0x0657('0x15'));logger[_0x0657('0x16')](_0x0657('0x17'),_0xd92091,_0x0657('0x15'),JSON['stringify'](_0x23a267));if(_0x23a267['error']){if(_0x23a267[_0x0657('0x18')][_0x0657('0x19')]===0x1f4){logger[_0x0657('0x18')](_0x0657('0x14'),_0xd92091,_0x23a267['error']['message']);return _0x606221(_0x23a267[_0x0657('0x18')][_0x0657('0x1a')]);}logger['error'](_0x0657('0x14'),_0xd92091,_0x23a267['error'][_0x0657('0x1a')]);return _0x415a78(_0x23a267[_0x0657('0x18')][_0x0657('0x1a')]);}else{logger[_0x0657('0x13')](_0x0657('0x14'),_0xd92091,'request\x20sent');_0x415a78(_0x23a267[_0x0657('0x1b')]['message']);}})[_0x0657('0x1c')](function(_0x5ba57a){logger[_0x0657('0x18')](_0x0657('0x14'),_0xd92091,_0x5ba57a);_0x606221(_0x5ba57a);});});}function respondWithStatusCode(_0x53266d,_0x841fc6){_0x841fc6=_0x841fc6||0xcc;return function(_0x424917){if(_0x424917){return _0x53266d[_0x0657('0x1d')](_0x841fc6);}return _0x53266d[_0x0657('0x1e')](_0x841fc6)[_0x0657('0x1f')]();};}function respondWithResult(_0x22227c,_0x4d2dbb){_0x4d2dbb=_0x4d2dbb||0xc8;return function(_0xc74cc1){if(_0xc74cc1){return _0x22227c[_0x0657('0x1e')](_0x4d2dbb)[_0x0657('0x20')](_0xc74cc1);}};}function respondWithFilteredResult(_0xdafca8,_0x17fd21){return function(_0x19218a){if(_0x19218a){var _0x628cb2=typeof _0x17fd21['offset']==='undefined'&&typeof _0x17fd21[_0x0657('0x21')]==='undefined';var _0x244f06=_0x19218a['count'];var _0x4663c6=_0x628cb2?0x0:_0x17fd21[_0x0657('0x22')];var _0x397464=_0x628cb2?_0x19218a[_0x0657('0x23')]:_0x17fd21[_0x0657('0x22')]+_0x17fd21[_0x0657('0x21')];var _0x5e75a6;if(_0x397464>=_0x244f06){_0x397464=_0x244f06;_0x5e75a6=0xc8;}else{_0x5e75a6=0xce;}_0xdafca8[_0x0657('0x1e')](_0x5e75a6);return _0xdafca8[_0x0657('0x24')]('Content-Range',_0x4663c6+'-'+_0x397464+'/'+_0x244f06)['json'](_0x19218a);}return null;};}function saveUpdates(_0x26675f){return function(_0x39890f){if(_0x39890f){return _0x39890f['update'](_0x26675f)[_0x0657('0x12')](function(_0x1efa17){return _0x1efa17;});}return null;};}function removeEntity(_0x3babeb){return function(_0x5e653f){if(_0x5e653f){return _0x5e653f['destroy']()[_0x0657('0x12')](function(){var _0x3e7625=_0x5e653f[_0x0657('0x25')]({'plain':!![]});var _0x427ab6=_0x0657('0x26');return db[_0x0657('0x27')][_0x0657('0x28')]({'where':{'type':_0x427ab6,'resourceId':_0x3e7625['id']}})['then'](function(){return _0x5e653f;});})[_0x0657('0x12')](function(){_0x3babeb[_0x0657('0x1e')](0xcc)[_0x0657('0x1f')]();});}};}function handleEntityNotFound(_0xa77104){return function(_0x3e9fd8){if(!_0x3e9fd8){_0xa77104[_0x0657('0x1d')](0x194);}return _0x3e9fd8;};}function handleError(_0x57f89d,_0x1298ff){_0x1298ff=_0x1298ff||0x1f4;return function(_0x5abe2e){logger[_0x0657('0x18')](_0x5abe2e[_0x0657('0x29')]);if(_0x5abe2e[_0x0657('0x2a')]){delete _0x5abe2e['name'];}_0x57f89d[_0x0657('0x1e')](_0x1298ff)[_0x0657('0x2b')](_0x5abe2e);};}function getImapHost(_0x281551){switch(_0x281551){case _0x0657('0x2c'):return _0x0657('0x2d');case _0x0657('0x2e'):return'imap.mail.yahoo.com';case'hotmail':return _0x0657('0x2f');case'outlook365':return'outlook.office365.com';}throw new Error(_0x0657('0x30'),_0x281551);}function getSmtpHost(_0x53edc8){switch(_0x53edc8){case _0x0657('0x2c'):return'smtp.gmail.com';case'yahoo':return'smtp.mail.yahoo.com';case'hotmail':return _0x0657('0x31');case _0x0657('0x32'):return _0x0657('0x33');}throw new Error(_0x0657('0x30'),_0x53edc8);}function getAuthenticationOptions(_0x2984e7,_0x5d9236){var _0x1fc19c={};var _0x22f8ae={};if(_0x2984e7){_0x1fc19c[_0x0657('0x34')]=_0x22f8ae[_0x0657('0x34')]=_0x5d9236[_0x0657('0x35')];_0x1fc19c[_0x0657('0x36')]=_0x22f8ae[_0x0657('0x37')]=_0x5d9236[_0x0657('0x36')];if(_0x5d9236['modernAuthentication']){_0x1fc19c[_0x0657('0x38')]=_0x22f8ae[_0x0657('0x38')]=!![];_0x1fc19c[_0x0657('0x39')]=_0x22f8ae[_0x0657('0x39')]=_0x5d9236['CloudProviderId'];_0x1fc19c[_0x0657('0x36')]=_0x22f8ae[_0x0657('0x37')]=null;}else{_0x1fc19c['CloudProviderId']=_0x22f8ae['CloudProviderId']=null;}_0x1fc19c[_0x0657('0x3a')]=getImapHost(_0x2984e7);_0x1fc19c['port']=0x3e1;_0x22f8ae[_0x0657('0x3a')]=getSmtpHost(_0x2984e7);_0x22f8ae[_0x0657('0x3b')]=0x24b;_0x22f8ae['secure']=![];_0x1fc19c[_0x0657('0x3c')]=_0x22f8ae['service']=null;}else{if(_0x5d9236['authentication']){_0x1fc19c[_0x0657('0x34')]=_0x22f8ae[_0x0657('0x34')]=_0x5d9236[_0x0657('0x35')];_0x1fc19c[_0x0657('0x36')]=_0x22f8ae[_0x0657('0x37')]=_0x5d9236[_0x0657('0x36')];}else{_0x1fc19c[_0x0657('0x3d')]=_0x22f8ae[_0x0657('0x3d')]=![];_0x1fc19c['user']=_0x22f8ae[_0x0657('0x34')]=null;_0x1fc19c[_0x0657('0x36')]=_0x22f8ae[_0x0657('0x37')]=null;}_0x1fc19c[_0x0657('0x3a')]=_0x5d9236['Imap'][_0x0657('0x3a')];_0x1fc19c['port']=_0x5d9236[_0x0657('0x3e')][_0x0657('0x3b')];_0x22f8ae[_0x0657('0x3a')]=_0x5d9236[_0x0657('0x3f')]['host'];_0x22f8ae['port']=_0x5d9236['Smtp'][_0x0657('0x3b')];}return{'Imap':_0x1fc19c,'Smtp':_0x22f8ae};}exports[_0x0657('0x40')]=function(_0x4a2493,_0x2aaa6f){var _0x226d51={'include':[{'model':db[_0x0657('0x41')],'as':_0x0657('0x3e')},{'model':db[_0x0657('0x42')],'as':'Smtp'},{'model':db[_0x0657('0x43')],'as':'mandatoryDispositionPause'}]},_0x4da9d8={},_0x2f73bd={'count':0x0,'rows':[]};var _0x50532c=_[_0x0657('0x44')](db['MailAccount'][_0x0657('0x45')],function(_0x48d486){return{'name':_0x48d486['fieldName'],'type':_0x48d486[_0x0657('0x46')][_0x0657('0x47')]};});_0x4da9d8[_0x0657('0x48')]=_[_0x0657('0x44')](_0x50532c,'name');_0x4da9d8[_0x0657('0x49')]=_[_0x0657('0x4a')](_0x4a2493[_0x0657('0x49')]);_0x4da9d8[_0x0657('0x4b')]=_[_0x0657('0x4c')](_0x4da9d8[_0x0657('0x48')],_0x4da9d8[_0x0657('0x49')]);_0x226d51['attributes']=_[_0x0657('0x4c')](_0x4da9d8[_0x0657('0x48')],qs['fields'](_0x4a2493[_0x0657('0x49')][_0x0657('0x4d')]));_0x226d51[_0x0657('0x4e')]=_0x226d51[_0x0657('0x4e')][_0x0657('0x4f')]?_0x226d51[_0x0657('0x4e')]:_0x4da9d8['model'];if(!_0x4a2493[_0x0657('0x49')][_0x0657('0x50')](_0x0657('0x51'))){_0x226d51[_0x0657('0x21')]=qs[_0x0657('0x21')](_0x4a2493[_0x0657('0x49')][_0x0657('0x21')]);_0x226d51[_0x0657('0x22')]=qs[_0x0657('0x22')](_0x4a2493[_0x0657('0x49')]['offset']);}_0x226d51[_0x0657('0x52')]=qs[_0x0657('0x53')](_0x4a2493[_0x0657('0x49')]['sort']);_0x226d51[_0x0657('0x54')]=qs['filters'](_[_0x0657('0x55')](_0x4a2493[_0x0657('0x49')],_0x4da9d8[_0x0657('0x4b')]),_0x50532c);if(_0x4a2493['query'][_0x0657('0x56')]){_0x226d51[_0x0657('0x54')]=_[_0x0657('0x57')](_0x226d51['where'],{'$or':_['map'](_0x50532c,function(_0x5ad4f4){if(_0x5ad4f4[_0x0657('0x46')]!=='VIRTUAL'){var _0x44a18f={};_0x44a18f[_0x5ad4f4[_0x0657('0x2a')]]={'$like':'%'+_0x4a2493['query'][_0x0657('0x56')]+'%'};return _0x44a18f;}})});}_0x226d51=_[_0x0657('0x57')]({},_0x226d51,_0x4a2493['options']);var _0x41c988={'where':_0x226d51[_0x0657('0x54')]};return db[_0x0657('0x58')][_0x0657('0x23')](_0x41c988)[_0x0657('0x12')](function(_0x24d295){_0x2f73bd['count']=_0x24d295;if(_0x4a2493[_0x0657('0x49')]['includeAll']){_0x226d51['include']=[{'all':!![]}];}return db['MailAccount'][_0x0657('0x59')](_0x226d51);})[_0x0657('0x12')](function(_0x307825){_0x2f73bd[_0x0657('0x5a')]=_0x307825;return _0x2f73bd;})[_0x0657('0x12')](respondWithFilteredResult(_0x2aaa6f,_0x226d51))[_0x0657('0x1c')](handleError(_0x2aaa6f,null));};exports[_0x0657('0x5b')]=function(_0x33139e,_0x247d47){var _0x4be80f={'raw':![],'where':{'id':_0x33139e[_0x0657('0x5c')]['id']},'include':[{'model':db[_0x0657('0x41')],'as':_0x0657('0x3e')},{'model':db[_0x0657('0x42')],'as':_0x0657('0x3f')},{'model':db[_0x0657('0x43')],'as':'mandatoryDispositionPause'}]},_0x436643={};_0x436643['model']=_[_0x0657('0x4a')](db[_0x0657('0x58')][_0x0657('0x45')]);_0x436643['query']=_[_0x0657('0x4a')](_0x33139e[_0x0657('0x49')]);_0x436643[_0x0657('0x4b')]=_[_0x0657('0x4c')](_0x436643['model'],_0x436643['query']);_0x4be80f[_0x0657('0x4e')]=_[_0x0657('0x4c')](_0x436643[_0x0657('0x48')],qs[_0x0657('0x4d')](_0x33139e['query'][_0x0657('0x4d')]));_0x4be80f[_0x0657('0x4e')]=_0x4be80f[_0x0657('0x4e')][_0x0657('0x4f')]?_0x4be80f['attributes']:_0x436643[_0x0657('0x48')];if(_0x33139e[_0x0657('0x49')][_0x0657('0x5d')]){_0x4be80f[_0x0657('0x5e')]=[{'all':!![]}];}_0x4be80f=_[_0x0657('0x57')]({},_0x4be80f,_0x33139e[_0x0657('0x5f')]);return db[_0x0657('0x58')][_0x0657('0x60')](_0x4be80f)[_0x0657('0x12')](handleEntityNotFound(_0x247d47,null))['then'](respondWithResult(_0x247d47,null))[_0x0657('0x1c')](handleError(_0x247d47,null));};exports[_0x0657('0x61')]=function(_0x1d1874,_0x1e2044){if(_0x1d1874[_0x0657('0x62')]['id']){delete _0x1d1874[_0x0657('0x62')]['id'];}var _0x12a554=_0x1d1874[_0x0657('0x62')][_0x0657('0x63')]===_0x0657('0x64')?null:_0x1d1874[_0x0657('0x62')][_0x0657('0x63')];var _0x2eeb66=_0x1d1874[_0x0657('0x62')][_0x0657('0x3e')]||{};var _0x25d494=_0x1d1874[_0x0657('0x62')][_0x0657('0x3f')]||{};if(_0x12a554){_0x2eeb66[_0x0657('0x3a')]=getImapHost(_0x12a554);_0x2eeb66[_0x0657('0x3b')]=0x3e1;_0x25d494[_0x0657('0x3a')]=getSmtpHost(_0x12a554);_0x25d494[_0x0657('0x3b')]=0x24b;_0x25d494[_0x0657('0x65')]=![];}if(_0x25d494[_0x0657('0x38')]){_0x25d494[_0x0657('0x65')]=![];}else{_0x25d494[_0x0657('0x39')]=null;}if(!_0x2eeb66[_0x0657('0x38')])_0x2eeb66[_0x0657('0x39')]=null;_0x1d1874['body'][_0x0657('0x3e')]=_0x2eeb66;_0x1d1874[_0x0657('0x62')][_0x0657('0x3f')]=_0x25d494;return db[_0x0657('0x58')]['find']({'where':{'id':_0x1d1874[_0x0657('0x5c')]['id']},'include':[{'model':db[_0x0657('0x41')],'as':_0x0657('0x3e')},{'model':db[_0x0657('0x42')],'as':_0x0657('0x3f')},{'model':db[_0x0657('0x43')],'as':_0x0657('0x66')}]})[_0x0657('0x12')](handleEntityNotFound(_0x1e2044,null))[_0x0657('0x12')](function(_0xafe12f){if(!_0xafe12f)throw new Error(_0x0657('0x67'));if(_0xafe12f['service'])delete _0x1d1874[_0x0657('0x62')][_0x0657('0x3e')];return _0xafe12f;})[_0x0657('0x12')](saveUpdates(_0x1d1874[_0x0657('0x62')],null))[_0x0657('0x12')](function(_0x2ba47e){if(!_0x1d1874[_0x0657('0x62')][_0x0657('0x3e')])return _0x2ba47e;return db['MailServerIn']['update'](_0x1d1874[_0x0657('0x62')][_0x0657('0x3e')],{'where':{'MailAccountId':_0x2ba47e['id']}})[_0x0657('0x12')](function(){return _0x2ba47e;});})['then'](function(_0x83e9d3){if(!_0x1d1874[_0x0657('0x62')][_0x0657('0x3f')])return _0x83e9d3;return db[_0x0657('0x42')][_0x0657('0x61')](_0x1d1874[_0x0657('0x62')][_0x0657('0x3f')],{'where':{'MailAccountId':_0x83e9d3['id']}})[_0x0657('0x12')](function(){return _0x83e9d3;});})['then'](respondWithResult(_0x1e2044,null))[_0x0657('0x1c')](handleError(_0x1e2044,null));};exports[_0x0657('0x68')]=function(_0x510104,_0x343e92){return db['MailAccount']['describe']()[_0x0657('0x12')](respondWithResult(_0x343e92,null))[_0x0657('0x1c')](handleError(_0x343e92,null));};exports[_0x0657('0x69')]=function(_0x5e57d6,_0xb50998){if(_0x5e57d6[_0x0657('0x62')]['id']){delete _0x5e57d6['body']['id'];}return db[_0x0657('0x58')]['find']({'where':{'id':_0x5e57d6[_0x0657('0x5c')]['id']}})[_0x0657('0x12')](handleEntityNotFound(_0xb50998,null))['then'](function(_0x787971){if(_0x787971){_0x5e57d6[_0x0657('0x62')][_0x0657('0x6a')]=_0x787971['id'];return db[_0x0657('0x6b')]['create'](_0x5e57d6[_0x0657('0x62')]);}})[_0x0657('0x12')](respondWithResult(_0xb50998,null))['catch'](handleError(_0xb50998,null));};exports[_0x0657('0x6c')]=function(_0x4386eb,_0x2f27e8){var _0x1371f7={'raw':![],'where':{}};var _0x45a42f={};var _0x226398={'count':0x0,'rows':[]};return db[_0x0657('0x58')][_0x0657('0x6d')]({'where':{'id':_0x4386eb['params']['id']}})['then'](handleEntityNotFound(_0x2f27e8,null))['then'](function(_0x345e21){if(_0x345e21){_0x45a42f['model']=_[_0x0657('0x4a')](db[_0x0657('0x6b')]['rawAttributes']);_0x45a42f[_0x0657('0x49')]=_[_0x0657('0x4a')](_0x4386eb[_0x0657('0x49')]);_0x45a42f[_0x0657('0x4b')]=_[_0x0657('0x4c')](_0x45a42f[_0x0657('0x48')],_0x45a42f[_0x0657('0x49')]);_0x1371f7[_0x0657('0x4e')]=_[_0x0657('0x4c')](_0x45a42f[_0x0657('0x48')],qs[_0x0657('0x4d')](_0x4386eb[_0x0657('0x49')][_0x0657('0x4d')]));_0x1371f7[_0x0657('0x4e')]=_0x1371f7[_0x0657('0x4e')][_0x0657('0x4f')]?_0x1371f7[_0x0657('0x4e')]:_0x45a42f[_0x0657('0x48')];if(!_0x4386eb[_0x0657('0x49')][_0x0657('0x50')](_0x0657('0x51'))){_0x1371f7['limit']=qs['limit'](_0x4386eb[_0x0657('0x49')][_0x0657('0x21')]);_0x1371f7[_0x0657('0x22')]=qs[_0x0657('0x22')](_0x4386eb[_0x0657('0x49')][_0x0657('0x22')]);}_0x1371f7[_0x0657('0x52')]=qs[_0x0657('0x53')](_0x4386eb[_0x0657('0x49')][_0x0657('0x53')]);_0x1371f7[_0x0657('0x54')]=qs[_0x0657('0x4b')](_['pick'](_0x4386eb[_0x0657('0x49')],_0x45a42f[_0x0657('0x4b')]));_0x1371f7[_0x0657('0x54')]['MailAccountId']=_0x345e21['id'];if(_0x4386eb[_0x0657('0x49')][_0x0657('0x56')]){_0x1371f7[_0x0657('0x54')]=_[_0x0657('0x57')](_0x1371f7[_0x0657('0x54')],{'$or':_[_0x0657('0x44')](_0x1371f7[_0x0657('0x4e')],function(_0x38d05b){var _0x1a7ca8={};_0x1a7ca8[_0x38d05b]={'$like':'%'+_0x4386eb[_0x0657('0x49')][_0x0657('0x56')]+'%'};return _0x1a7ca8;})});}_0x1371f7=_['merge']({},_0x1371f7,_0x4386eb[_0x0657('0x5f')]);return db[_0x0657('0x6b')][_0x0657('0x23')]({'where':_0x1371f7[_0x0657('0x54')]})[_0x0657('0x12')](function(_0x1a343b){_0x226398[_0x0657('0x23')]=_0x1a343b;if(_0x4386eb[_0x0657('0x49')][_0x0657('0x5d')]){_0x1371f7[_0x0657('0x5e')]=[{'all':!![]}];}return db[_0x0657('0x6b')][_0x0657('0x59')](_0x1371f7);})[_0x0657('0x12')](function(_0x1acff2){_0x226398[_0x0657('0x5a')]=_0x1acff2;return _0x226398;});}})['then'](respondWithFilteredResult(_0x2f27e8,_0x1371f7))[_0x0657('0x1c')](handleError(_0x2f27e8,null));};exports[_0x0657('0x6e')]=function(_0x36a8b3,_0x51937d){return db[_0x0657('0x58')]['find']({'where':{'id':_0x36a8b3['params']['id']}})['then'](handleEntityNotFound(_0x51937d,null))[_0x0657('0x12')](function(_0x5049d7){if(_0x5049d7){return _0x5049d7[_0x0657('0x6e')](_0x36a8b3[_0x0657('0x49')][_0x0657('0x6f')]);}})['then'](respondWithStatusCode(_0x51937d,null))[_0x0657('0x1c')](handleError(_0x51937d,null));};exports[_0x0657('0x70')]=function(_0x1fae74,_0x468500){if(_0x1fae74[_0x0657('0x62')]['id']){delete _0x1fae74[_0x0657('0x62')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x1fae74[_0x0657('0x5c')]['id']}})[_0x0657('0x12')](handleEntityNotFound(_0x468500,null))[_0x0657('0x12')](function(_0x1479f0){if(_0x1479f0){_0x1fae74[_0x0657('0x62')][_0x0657('0x6a')]=_0x1479f0['id'];return db[_0x0657('0x71')]['create'](_0x1fae74['body']);}})[_0x0657('0x12')](respondWithResult(_0x468500,null))['catch'](handleError(_0x468500,null));};exports[_0x0657('0x72')]=function(_0x4a337,_0x3d116b){var _0x2ca00f={'raw':![],'where':{}};var _0x4a16aa={};var _0x17fbb1={'count':0x0,'rows':[]};return db[_0x0657('0x58')][_0x0657('0x6d')]({'where':{'id':_0x4a337[_0x0657('0x5c')]['id']}})[_0x0657('0x12')](handleEntityNotFound(_0x3d116b,null))[_0x0657('0x12')](function(_0x3f2335){if(_0x3f2335){_0x4a16aa[_0x0657('0x48')]=_[_0x0657('0x4a')](db[_0x0657('0x71')]['rawAttributes']);_0x4a16aa[_0x0657('0x49')]=_[_0x0657('0x4a')](_0x4a337['query']);_0x4a16aa[_0x0657('0x4b')]=_['intersection'](_0x4a16aa[_0x0657('0x48')],_0x4a16aa[_0x0657('0x49')]);_0x2ca00f['attributes']=_[_0x0657('0x4c')](_0x4a16aa[_0x0657('0x48')],qs[_0x0657('0x4d')](_0x4a337[_0x0657('0x49')]['fields']));_0x2ca00f[_0x0657('0x4e')]=_0x2ca00f[_0x0657('0x4e')][_0x0657('0x4f')]?_0x2ca00f[_0x0657('0x4e')]:_0x4a16aa[_0x0657('0x48')];if(!_0x4a337[_0x0657('0x49')][_0x0657('0x50')](_0x0657('0x51'))){_0x2ca00f[_0x0657('0x21')]=qs[_0x0657('0x21')](_0x4a337[_0x0657('0x49')]['limit']);_0x2ca00f['offset']=qs[_0x0657('0x22')](_0x4a337[_0x0657('0x49')][_0x0657('0x22')]);}_0x2ca00f['order']=qs['sort'](_0x4a337[_0x0657('0x49')][_0x0657('0x53')]);_0x2ca00f[_0x0657('0x54')]=qs[_0x0657('0x4b')](_['pick'](_0x4a337[_0x0657('0x49')],_0x4a16aa[_0x0657('0x4b')]));_0x2ca00f[_0x0657('0x54')][_0x0657('0x6a')]=_0x3f2335['id'];if(_0x4a337['query'][_0x0657('0x56')]){_0x2ca00f[_0x0657('0x54')]=_[_0x0657('0x57')](_0x2ca00f[_0x0657('0x54')],{'$or':_[_0x0657('0x44')](_0x2ca00f[_0x0657('0x4e')],function(_0x3cea54){var _0x276cfd={};_0x276cfd[_0x3cea54]={'$like':'%'+_0x4a337[_0x0657('0x49')][_0x0657('0x56')]+'%'};return _0x276cfd;})});}_0x2ca00f=_['merge']({},_0x2ca00f,_0x4a337[_0x0657('0x5f')]);return db[_0x0657('0x71')][_0x0657('0x23')]({'where':_0x2ca00f[_0x0657('0x54')]})[_0x0657('0x12')](function(_0x302a48){_0x17fbb1[_0x0657('0x23')]=_0x302a48;if(_0x4a337[_0x0657('0x49')][_0x0657('0x5d')]){_0x2ca00f[_0x0657('0x5e')]=[{'all':!![]}];}return db[_0x0657('0x71')]['findAll'](_0x2ca00f);})[_0x0657('0x12')](function(_0xe8db04){_0x17fbb1['rows']=_0xe8db04;return _0x17fbb1;});}})[_0x0657('0x12')](respondWithFilteredResult(_0x3d116b,_0x2ca00f))[_0x0657('0x1c')](handleError(_0x3d116b,null));};exports['removeAnswers']=function(_0x564c07,_0x2bde11){return db['MailAccount'][_0x0657('0x60')]({'where':{'id':_0x564c07[_0x0657('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2bde11,null))[_0x0657('0x12')](function(_0x239792){if(_0x239792){return _0x239792[_0x0657('0x73')](_0x564c07[_0x0657('0x49')][_0x0657('0x6f')]);}})[_0x0657('0x12')](respondWithStatusCode(_0x2bde11,null))[_0x0657('0x1c')](handleError(_0x2bde11,null));};exports[_0x0657('0x74')]=function(_0x125698,_0x1dcb39){var _0x1a2494={'name':_0x125698[_0x0657('0x62')]['name'],'key':_0x125698['body'][_0x0657('0x47')],'provider':_0x125698[_0x0657('0x62')]['provider']===_0x0657('0x64')?null:_0x125698['body'][_0x0657('0x63')],'email':_0x125698[_0x0657('0x62')][_0x0657('0x75')],'ListId':_0x125698[_0x0657('0x62')][_0x0657('0x76')],'active':!_[_0x0657('0x77')](_0x125698[_0x0657('0x62')][_0x0657('0x78')])?_0x125698[_0x0657('0x62')][_0x0657('0x78')]:!![],'description':_0x125698[_0x0657('0x62')][_0x0657('0x79')]||null};var _0x534832=getAuthenticationOptions(_0x1a2494['provider'],_0x125698[_0x0657('0x62')]);_0x1a2494['Imap']=_0x534832[_0x0657('0x3e')];_0x1a2494[_0x0657('0x3f')]=_0x534832[_0x0657('0x3f')];return db['MailAccount'][_0x0657('0x74')](_0x1a2494,{'include':[{'model':db[_0x0657('0x42')],'as':_0x0657('0x3f')},{'model':db['MailServerIn'],'as':'Imap'}]})[_0x0657('0x12')](function(_0x23fbe6){var _0x5c8335=_0x125698['user']['get']({'plain':!![]});if(!_0x5c8335)throw new Error(_0x0657('0x7a'));if(_0x5c8335['role']===_0x0657('0x34')){var _0x5e7c7a=_0x23fbe6[_0x0657('0x25')]({'plain':!![]});return db['UserProfileSection'][_0x0657('0x60')]({'where':{'name':_0x0657('0x26'),'userProfileId':_0x5c8335[_0x0657('0x7b')]},'raw':!![]})[_0x0657('0x12')](function(_0x495be1){if(_0x495be1&&_0x495be1['autoAssociation']===0x0){return db[_0x0657('0x27')][_0x0657('0x74')]({'name':_0x5e7c7a[_0x0657('0x2a')],'resourceId':_0x5e7c7a['id'],'type':_0x495be1[_0x0657('0x2a')],'sectionId':_0x495be1['id']},{})['then'](function(){return _0x23fbe6;});}else{return _0x23fbe6;}})[_0x0657('0x1c')](function(_0xc39e4d){logger[_0x0657('0x18')](_0x0657('0x7c'),_0xc39e4d);throw _0xc39e4d;});}return _0x23fbe6;})[_0x0657('0x12')](respondWithResult(_0x1dcb39,0xc9))[_0x0657('0x1c')](handleError(_0x1dcb39,null));};exports[_0x0657('0x7d')]=function(_0x56c3ed,_0x59694d){return db['MailAccount'][_0x0657('0x6d')]({'where':{'id':_0x56c3ed[_0x0657('0x5c')]['id']}})[_0x0657('0x12')](handleEntityNotFound(_0x59694d,null))[_0x0657('0x12')](function(_0x3d7d65){if(_0x3d7d65){return _0x3d7d65[_0x0657('0x7d')]();}return null;})[_0x0657('0x12')](respondWithResult(_0x59694d,null))[_0x0657('0x1c')](handleError(_0x59694d,null));};exports[_0x0657('0x7e')]=function(_0x5d6da4,_0x46e22c){if(_0x5d6da4[_0x0657('0x62')]['id']){delete _0x5d6da4[_0x0657('0x62')]['id'];}return db[_0x0657('0x58')][_0x0657('0x60')]({'where':{'id':_0x5d6da4[_0x0657('0x5c')]['id']}})[_0x0657('0x12')](handleEntityNotFound(_0x46e22c,null))[_0x0657('0x12')](function(_0x3ebed8){if(_0x3ebed8){_0x5d6da4['body'][_0x0657('0x6a')]=_0x3ebed8['id'];return db[_0x0657('0x41')][_0x0657('0x74')](_0x5d6da4['body']);}})['then'](respondWithResult(_0x46e22c,null))['catch'](handleError(_0x46e22c,null));};exports[_0x0657('0x7f')]=function(_0x59dc3b,_0x5b9531){return db[_0x0657('0x58')][_0x0657('0x6d')]({'where':{'id':_0x59dc3b[_0x0657('0x5c')]['id']}})['then'](handleEntityNotFound(_0x5b9531,null))[_0x0657('0x12')](function(_0x229375){if(_0x229375){return _0x229375[_0x0657('0x80')](null);}return null;})[_0x0657('0x12')](respondWithStatusCode(_0x5b9531,null))[_0x0657('0x1c')](handleError(_0x5b9531,null));};exports[_0x0657('0x81')]=function(_0x36d06d,_0x524daf){return db[_0x0657('0x58')][_0x0657('0x6d')]({'where':{'id':_0x36d06d[_0x0657('0x5c')]['id']}})[_0x0657('0x12')](handleEntityNotFound(_0x524daf,null))[_0x0657('0x12')](function(_0x42eef){if(_0x42eef){return _0x42eef['getSmtp']();}return null;})['then'](respondWithResult(_0x524daf,null))[_0x0657('0x1c')](handleError(_0x524daf,null));};exports[_0x0657('0x82')]=function(_0x47cfc7,_0x40b5af){if(_0x47cfc7[_0x0657('0x62')]['id']){delete _0x47cfc7[_0x0657('0x62')]['id'];}return db['MailAccount'][_0x0657('0x60')]({'where':{'id':_0x47cfc7[_0x0657('0x5c')]['id']}})[_0x0657('0x12')](handleEntityNotFound(_0x40b5af,null))[_0x0657('0x12')](function(_0x3b2613){if(_0x3b2613){_0x47cfc7[_0x0657('0x62')][_0x0657('0x6a')]=_0x3b2613['id'];return db[_0x0657('0x42')]['create'](_0x47cfc7['body']);}})['then'](respondWithResult(_0x40b5af,null))[_0x0657('0x1c')](handleError(_0x40b5af,null));};exports[_0x0657('0x83')]=function(_0x439772,_0x45c4a6){return db[_0x0657('0x58')][_0x0657('0x6d')]({'where':{'id':_0x439772['params']['id']}})[_0x0657('0x12')](handleEntityNotFound(_0x45c4a6,null))[_0x0657('0x12')](function(_0x338778){if(_0x338778){return _0x338778['setSmtp'](null);}return null;})['then'](respondWithStatusCode(_0x45c4a6,null))['catch'](handleError(_0x45c4a6,null));};exports[_0x0657('0x84')]=function(_0x1d618e,_0x468392){return db['MailInteraction'][_0x0657('0x60')]({'where':{'id':_0x1d618e['params']['id']}})[_0x0657('0x12')](handleEntityNotFound(_0x468392,null))[_0x0657('0x12')](function(_0x2ba193){if(_0x2ba193){return _0x2ba193[_0x0657('0x84')](_0x1d618e[_0x0657('0x62')][_0x0657('0x6f')],_[_0x0657('0x85')](_0x1d618e[_0x0657('0x62')],[_0x0657('0x6f'),'id'])||{});}})['then'](respondWithResult(_0x468392,null))[_0x0657('0x1c')](handleError(_0x468392,null));};exports['getInteractions']=function(_0x4aeaf2,_0x4cba5c){var _0x33b805={'raw':![],'where':{}};var _0xa947c3={};var _0x42644b={'count':0x0,'rows':[]};return db[_0x0657('0x58')][_0x0657('0x6d')]({'where':{'id':_0x4aeaf2[_0x0657('0x5c')]['id']}})[_0x0657('0x12')](handleEntityNotFound(_0x4cba5c,null))[_0x0657('0x12')](function(_0x358a96){if(_0x358a96){_0xa947c3[_0x0657('0x48')]=_[_0x0657('0x4a')](db['MailInteraction']['rawAttributes']);_0xa947c3[_0x0657('0x49')]=_['keys'](_0x4aeaf2['query']);_0xa947c3[_0x0657('0x4b')]=_['intersection'](_0xa947c3['model'],_0xa947c3[_0x0657('0x49')]);_0x33b805['attributes']=_[_0x0657('0x4c')](_0xa947c3['model'],qs['fields'](_0x4aeaf2[_0x0657('0x49')][_0x0657('0x4d')]));_0x33b805[_0x0657('0x4e')]=_0x33b805[_0x0657('0x4e')][_0x0657('0x4f')]?_0x33b805['attributes']:_0xa947c3[_0x0657('0x48')];if(!_0x4aeaf2['query'][_0x0657('0x50')]('nolimit')){_0x33b805[_0x0657('0x21')]=qs[_0x0657('0x21')](_0x4aeaf2[_0x0657('0x49')]['limit']);_0x33b805['offset']=qs[_0x0657('0x22')](_0x4aeaf2['query'][_0x0657('0x22')]);}_0x33b805['order']=qs[_0x0657('0x53')](_0x4aeaf2[_0x0657('0x49')][_0x0657('0x53')]);_0x33b805[_0x0657('0x54')]=qs[_0x0657('0x4b')](_[_0x0657('0x55')](_0x4aeaf2[_0x0657('0x49')],_0xa947c3[_0x0657('0x4b')]));_0x33b805['where'][_0x0657('0x6a')]=_0x358a96['id'];if(_0x4aeaf2[_0x0657('0x49')]['filter']){_0x33b805['where']=_[_0x0657('0x57')](_0x33b805['where'],{'$or':_[_0x0657('0x44')](_0x33b805['attributes'],function(_0x10ea63){var _0x4e70af={};_0x4e70af[_0x10ea63]={'$like':'%'+_0x4aeaf2['query']['filter']+'%'};return _0x4e70af;})});}_0x33b805=_[_0x0657('0x57')]({},_0x33b805,_0x4aeaf2['options']);return db[_0x0657('0x86')][_0x0657('0x23')]({'where':_0x33b805[_0x0657('0x54')]})[_0x0657('0x12')](function(_0x4281e6){_0x42644b['count']=_0x4281e6;if(_0x4aeaf2[_0x0657('0x49')][_0x0657('0x5d')]){_0x33b805[_0x0657('0x5e')]=[{'model':db[_0x0657('0x87')],'as':_0x0657('0x88'),'required':![]},{'model':db['User'],'as':'Owner','attributes':['name',_0x0657('0x89'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x0657('0x8a'),'attributes':['id',_0x0657('0x2a'),_0x0657('0x8b')],'where':_0x4aeaf2['query'][_0x0657('0x8c')]?{'id':_0x4aeaf2[_0x0657('0x49')][_0x0657('0x8c')]}:undefined,'required':_0x4aeaf2[_0x0657('0x49')][_0x0657('0x8c')]?!![]:![]}];}return db[_0x0657('0x86')]['findAll'](_0x33b805);})[_0x0657('0x12')](function(_0x48598b){_0x42644b[_0x0657('0x5a')]=_0x48598b;return _0x42644b;});}})[_0x0657('0x12')](respondWithFilteredResult(_0x4cba5c,_0x33b805))['catch'](handleError(_0x4cba5c,null));};exports[_0x0657('0x8d')]=function addApplications(_0x1e4758,_0x319254){var _0x502fe9=_0x1e4758['params']['id'];var _0x1ecd54=_0x1e4758[_0x0657('0x62')];var _0x2ed404=0xc8;var _0x526056=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x0657('0x8e')]['Transaction'][_0x0657('0x8f')][_0x0657('0x90')]},function(_0x551120){return db['MailAccount']['findOne']({'where':{'id':_0x502fe9},'transaction':_0x551120})['then'](function(_0x248193){if(_0x248193){return db['MailApplication'][_0x0657('0x28')]({'where':{'MailAccountId':_0x502fe9},'transaction':_0x551120})['then'](function(){var _0x5ede48=_['map'](_0x1ecd54,function(_0x4f5bf8){_0x4f5bf8[_0x0657('0x6a')]=_0x502fe9;return _0x4f5bf8;});return db[_0x0657('0x91')][_0x0657('0x92')](_0x5ede48,{'transaction':_0x551120});});}else{_0x2ed404=0x194;_0x526056=[];}});})[_0x0657('0x12')](function(){if(_0x2ed404!==0x194){return db[_0x0657('0x91')][_0x0657('0x93')]({'where':{'MailAccountId':_0x502fe9},'order':'priority'})[_0x0657('0x12')](function(_0x5c69f2){_0x526056=_0x5c69f2;});}})[_0x0657('0x1c')](function(_0x21ec23){_0x2ed404=0x1f4;logger[_0x0657('0x18')](_0x21ec23[_0x0657('0x29')]);if(_0x21ec23['name']){delete _0x21ec23[_0x0657('0x2a')];}_0x526056=_0x21ec23;})[_0x0657('0x94')](function(){if(_0x526056===null){_0x319254[_0x0657('0x1d')](_0x2ed404);}else{if(_0x2ed404===0x1f4){_0x319254['status'](_0x2ed404)[_0x0657('0x2b')](_0x526056);}else{_0x319254[_0x0657('0x1e')](_0x2ed404)[_0x0657('0x20')](_0x526056);}}});};exports[_0x0657('0x95')]=function(_0x970d50,_0xdb7bbf){var _0x5a04a4={};var _0x36fbd2={};var _0x4687b0;var _0x987efe;return db['MailAccount']['findOne']({'where':{'id':_0x970d50[_0x0657('0x5c')]['id']}})[_0x0657('0x12')](handleEntityNotFound(_0xdb7bbf,null))[_0x0657('0x12')](function(_0x588eae){if(_0x588eae){_0x4687b0=_0x588eae;_0x36fbd2['model']=_['keys'](db['MailApplication'][_0x0657('0x45')]);_0x36fbd2[_0x0657('0x49')]=_[_0x0657('0x4a')](_0x970d50[_0x0657('0x49')]);_0x36fbd2[_0x0657('0x4b')]=_['intersection'](_0x36fbd2['model'],_0x36fbd2['query']);_0x5a04a4[_0x0657('0x4e')]=_['intersection'](_0x36fbd2[_0x0657('0x48')],qs[_0x0657('0x4d')](_0x970d50[_0x0657('0x49')][_0x0657('0x4d')]));_0x5a04a4[_0x0657('0x4e')]=_0x5a04a4[_0x0657('0x4e')][_0x0657('0x4f')]?_0x5a04a4[_0x0657('0x4e')]:_0x36fbd2[_0x0657('0x48')];_0x5a04a4[_0x0657('0x52')]=qs[_0x0657('0x53')](_0x970d50['query'][_0x0657('0x53')]);_0x5a04a4[_0x0657('0x54')]=qs[_0x0657('0x4b')](_[_0x0657('0x55')](_0x970d50['query'],_0x36fbd2['filters']));if(_0x970d50['query'][_0x0657('0x56')]){_0x5a04a4['where']=_['merge'](_0x5a04a4[_0x0657('0x54')],{'$or':_['map'](_0x5a04a4[_0x0657('0x4e')],function(_0xb0cbf0){var _0x10d40b={};_0x10d40b[_0xb0cbf0]={'$like':'%'+_0x970d50[_0x0657('0x49')][_0x0657('0x56')]+'%'};return _0x10d40b;})});}_0x5a04a4=_[_0x0657('0x57')]({},_0x5a04a4,_0x970d50[_0x0657('0x5f')]);return _0x4687b0[_0x0657('0x95')](_0x5a04a4);}})[_0x0657('0x12')](function(_0x1b9562){if(_0x1b9562){_0x987efe=_0x1b9562[_0x0657('0x4f')];if(!_0x970d50[_0x0657('0x49')]['hasOwnProperty'](_0x0657('0x51'))){_0x5a04a4[_0x0657('0x21')]=qs[_0x0657('0x21')](_0x970d50[_0x0657('0x49')][_0x0657('0x21')]);_0x5a04a4[_0x0657('0x22')]=qs[_0x0657('0x22')](_0x970d50[_0x0657('0x49')][_0x0657('0x22')]);}return _0x4687b0[_0x0657('0x95')](_0x5a04a4);}})[_0x0657('0x12')](function(_0x47cbaf){if(_0x47cbaf){return _0x47cbaf?{'count':_0x987efe,'rows':_0x47cbaf}:null;}})[_0x0657('0x12')](respondWithResult(_0xdb7bbf,null))[_0x0657('0x1c')](handleError(_0xdb7bbf,null));};exports[_0x0657('0x96')]=function(_0x53c5d1,_0x1eddd4){var _0x3c37ef={'raw':!![],'where':{}};var _0x1a860b={};var _0x28163c={'count':0x0,'rows':[]};return db[_0x0657('0x58')]['findOne']({'where':{'id':_0x53c5d1[_0x0657('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1eddd4,null))[_0x0657('0x12')](function(_0x55512b){if(_0x55512b){_0x1a860b[_0x0657('0x48')]=_[_0x0657('0x4a')](db[_0x0657('0x97')][_0x0657('0x45')]);_0x1a860b['query']=_[_0x0657('0x4a')](_0x53c5d1[_0x0657('0x49')]);_0x1a860b[_0x0657('0x4b')]=_[_0x0657('0x4c')](_0x1a860b[_0x0657('0x48')],_0x1a860b[_0x0657('0x49')]);_0x3c37ef[_0x0657('0x4e')]=_[_0x0657('0x4c')](_0x1a860b[_0x0657('0x48')],qs[_0x0657('0x4d')](_0x53c5d1[_0x0657('0x49')]['fields']));_0x3c37ef['attributes']=_0x3c37ef[_0x0657('0x4e')][_0x0657('0x4f')]?_0x3c37ef[_0x0657('0x4e')]:_0x1a860b[_0x0657('0x48')];if(!_0x53c5d1[_0x0657('0x49')][_0x0657('0x50')](_0x0657('0x51'))){_0x3c37ef[_0x0657('0x21')]=qs[_0x0657('0x21')](_0x53c5d1[_0x0657('0x49')]['limit']);_0x3c37ef['offset']=qs['offset'](_0x53c5d1['query'][_0x0657('0x22')]);}_0x3c37ef['order']=qs[_0x0657('0x53')](_0x53c5d1['query'][_0x0657('0x53')]);_0x3c37ef[_0x0657('0x54')]=qs[_0x0657('0x4b')](_[_0x0657('0x55')](_0x53c5d1[_0x0657('0x49')],_0x1a860b[_0x0657('0x4b')]));_0x3c37ef[_0x0657('0x54')]['MailAccountId']=_0x55512b['id'];if(_0x53c5d1['query'][_0x0657('0x56')]){_0x3c37ef[_0x0657('0x54')]=_[_0x0657('0x57')](_0x3c37ef[_0x0657('0x54')],{'$or':_[_0x0657('0x44')](_0x3c37ef['attributes'],function(_0x4f927d){var _0x1f2e70={};_0x1f2e70[_0x4f927d]={'$like':'%'+_0x53c5d1['query'][_0x0657('0x56')]+'%'};return _0x1f2e70;})});}if(_0x53c5d1[_0x0657('0x49')][_0x0657('0x98')]){var _0x1e7ab9=_0x53c5d1['query'][_0x0657('0x98')]['split'](',');var _0x4ff1a3={};_0x4ff1a3[_0x1e7ab9[0x0]]={'$gte':moment(_0x1e7ab9[0x1])[_0x0657('0x99')](_0x0657('0x9a'))};_0x3c37ef['where']=_['merge'](_0x3c37ef['where'],_0x4ff1a3);}_0x3c37ef=_[_0x0657('0x57')]({},_0x3c37ef,_0x53c5d1['options']);return db[_0x0657('0x97')][_0x0657('0x23')]({'where':_0x3c37ef[_0x0657('0x54')]})[_0x0657('0x12')](function(_0x2d58b3){_0x28163c['count']=_0x2d58b3;if(_0x53c5d1[_0x0657('0x49')][_0x0657('0x5d')]){_0x3c37ef[_0x0657('0x5e')]=[{'all':!![]}];}return db[_0x0657('0x97')][_0x0657('0x59')](_0x3c37ef);})[_0x0657('0x12')](function(_0x35df18){if(_0x53c5d1[_0x0657('0x49')][_0x0657('0x9b')]===_0x0657('0x9c')){for(var _0x3cecb1=0x0;_0x3cecb1<_0x35df18[_0x0657('0x4f')];_0x3cecb1++){_0x35df18[_0x3cecb1][_0x0657('0x62')]=juice(_0x35df18[_0x3cecb1][_0x0657('0x62')]);}}_0x28163c[_0x0657('0x5a')]=_0x35df18;return _0x28163c;});}})[_0x0657('0x12')](respondWithFilteredResult(_0x1eddd4,_0x3c37ef))[_0x0657('0x1c')](handleError(_0x1eddd4,null));};exports[_0x0657('0x2b')]=function(_0x4630b6,_0x2a3a3c){var _0x4afbf4,_0x2d90e4={},_0x4898a2;if(_0x4630b6[_0x0657('0x62')]['to']){_0x4898a2=_0x4630b6[_0x0657('0x62')]['to'][_0x0657('0x9d')](',')[0x0];}return db['MailAccount'][_0x0657('0x60')]({'where':{'id':_0x4630b6[_0x0657('0x5c')]['id']},'include':[{'model':db[_0x0657('0x9e')],'as':_0x0657('0x9f'),'include':[{'model':db[_0x0657('0x87')],'as':'Contacts','where':{'email':_0x4898a2},'limit':0x1,'order':[[_0x0657('0xa0'),_0x0657('0xa1')]]}]},{'model':db['MailServerOut'],'as':_0x0657('0x3f'),'raw':!![],'include':[{'model':db[_0x0657('0xa2')],'as':_0x0657('0xa2'),'raw':!![]}]}]})[_0x0657('0x12')](handleEntityNotFound(_0x2a3a3c,null))[_0x0657('0x12')](function(_0x54d116){if(!_0x54d116)return;_0x4afbf4=_0x54d116;if(!_0x54d116[_0x0657('0x3f')])throw new Error(_0x0657('0xa3'));if(_[_0x0657('0x77')](_0x4630b6[_0x0657('0x62')][_0x0657('0xa4')])){_0x4630b6[_0x0657('0x62')][_0x0657('0xa4')]=util['format']('%s\x20<%s>',_0x54d116[_0x0657('0x2a')],_0x54d116['email']||_0x54d116[_0x0657('0x3f')][_0x0657('0x34')]);}if(_0x4630b6[_0x0657('0x62')][_0x0657('0xa5')]&&_0x4630b6[_0x0657('0x62')][_0x0657('0xa5')][_0x0657('0x4f')]){for(var _0x203ba7=0x0;_0x203ba7<_0x4630b6[_0x0657('0x62')][_0x0657('0xa5')][_0x0657('0x4f')];_0x203ba7+=0x1){_0x4630b6[_0x0657('0x62')][_0x0657('0xa5')][_0x203ba7]={'filename':_0x4630b6['body'][_0x0657('0xa5')][_0x203ba7][_0x0657('0x2a')],'path':path[_0x0657('0xa6')](config[_0x0657('0xa7')],_0x0657('0xa8'),_0x4630b6[_0x0657('0x62')][_0x0657('0xa5')][_0x203ba7][_0x0657('0xa9')])};}}var _0x39e1b0=_0x54d116['getSmtpOptions']();return respondWithRpcPromise(_0x0657('0xaa'),_0x0657('0xab'),{'account':_0x39e1b0,'message':_0x4630b6[_0x0657('0x62')]});})[_0x0657('0x12')](function(_0x419179){if(!_0x419179)return;_0x2d90e4=_0x419179;if(!_0x4afbf4[_0x0657('0x9f')])throw new Error(_0x0657('0xac'));if(_0x4afbf4[_0x0657('0x9f')]['Contacts'][_0x0657('0x4f')])return _0x4afbf4[_0x0657('0x9f')][_0x0657('0xad')][0x0];return db['CmContact'][_0x0657('0x74')](_[_0x0657('0xa')](_0x4630b6[_0x0657('0x62')],{'firstName':_0x4630b6[_0x0657('0x62')]['to'],'email':_0x4630b6['body']['to'],'phone':_0x4630b6[_0x0657('0x62')]['to'],'ListId':_0x4afbf4['ListId']}));})['then'](function(_0x5b7ca6){if(!_0x5b7ca6)return;var _0xa3a696={'UserId':_0x4630b6['user']['id'],'ContactId':_0x5b7ca6['id'],'MailAccountId':_0x4afbf4['id'],'inReplyTo':_0x2d90e4[_0x0657('0xae')],'to':_0x4630b6['body'][_0x0657('0xa4')],'cc':_0x4630b6['body']['cc'],'subject':_0x4630b6[_0x0657('0x62')][_0x0657('0xaf')],'attach':_0x4630b6[_0x0657('0x62')][_0x0657('0xb0')],'firstMsgDirection':_0x0657('0xb1'),'lastMsgAt':moment()[_0x0657('0x99')](_0x0657('0x9a')),'lastMsgDirection':_0x0657('0xb1'),'Messages':[_['merge'](_0x4630b6['body'],{'messageId':_0x2d90e4[_0x0657('0xae')],'sentAt':moment()['format'](_0x0657('0x9a')),'read':!![],'MailAccountId':_0x4afbf4['id'],'UserId':_0x4630b6['user']['id'],'ContactId':_0x5b7ca6['id']})]};if(_0x4630b6[_0x0657('0x62')][_0x0657('0xb2')]){_0xa3a696=_[_0x0657('0x57')](_0xa3a696,_0x4630b6['body'][_0x0657('0xb2')]);}return db['MailInteraction'][_0x0657('0x74')](_0xa3a696,{'include':[{'model':db['MailMessage'],'as':_0x0657('0xb3')}]});})['then'](respondWithResult(_0x2a3a3c,null))[_0x0657('0x1c')](handleError(_0x2a3a3c,null));};exports[_0x0657('0xb4')]=function(_0x2ff17f,_0x4c00fd){return db[_0x0657('0x58')][_0x0657('0x60')]({'where':{'id':_0x2ff17f[_0x0657('0x5c')]['id']},'include':[{'model':db[_0x0657('0x42')],'as':_0x0657('0x3f'),'raw':!![],'include':[{'model':db[_0x0657('0xa2')],'as':'CloudProvider','raw':!![]}]}]})[_0x0657('0x12')](handleEntityNotFound(_0x4c00fd,null))[_0x0657('0x12')](function(_0x3db841){if(!_0x3db841[_0x0657('0x3f')])return;var _0xb3984d=_0x3db841[_0x0657('0xb5')]();return respondWithRpcPromise(_0x0657('0xb6'),'verifySmtp',{'account':_0xb3984d});})[_0x0657('0x12')](respondWithResult(_0x4c00fd,null))[_0x0657('0x1c')](handleError(_0x4c00fd,null));};exports[_0x0657('0x28')]=function(_0x48d879,_0x27e329){return db[_0x0657('0x58')][_0x0657('0x60')]({'where':{'id':_0x48d879[_0x0657('0x5c')]['id']}})[_0x0657('0x12')](handleEntityNotFound(_0x27e329,null))[_0x0657('0x12')](function(_0x349f69){if(_0x349f69&&_0x349f69[_0x0657('0x3c')]){throw new db['Sequelize']['ValidationError'](_0x0657('0xb7'));}return _0x349f69;})[_0x0657('0x12')](removeEntity(_0x27e329,null))[_0x0657('0x1c')](handleError(_0x27e329,null));};exports['addAgents']=function(_0xf8804d,_0x445350){return db[_0x0657('0x58')][_0x0657('0x60')]({'where':{'id':_0xf8804d[_0x0657('0x5c')]['id']}})[_0x0657('0x12')](handleEntityNotFound(_0x445350,null))['then'](function(_0x46cb53){if(_0x46cb53){return _0x46cb53[_0x0657('0xb8')](_0xf8804d[_0x0657('0x62')]['ids'],_[_0x0657('0x85')](_0xf8804d[_0x0657('0x62')],['ids','id'])||{})[_0x0657('0xb9')](function(_0x1921c2){for(var _0x5c3033=0x0;_0x5c3033<_0xf8804d[_0x0657('0x62')][_0x0657('0x6f')][_0x0657('0x4f')];_0x5c3033+=0x1){socket[_0x0657('0xba')](_0x0657('0xbb'),{'UserId':Number(_0xf8804d[_0x0657('0x62')][_0x0657('0x6f')][_0x5c3033]),'MailAccountId':Number(_0xf8804d[_0x0657('0x5c')]['id'])});}return _0x1921c2;});}})[_0x0657('0x12')](respondWithResult(_0x445350,null))[_0x0657('0x1c')](handleError(_0x445350,null));};exports['removeAgents']=function(_0x208ba9,_0x122244){return db[_0x0657('0x58')][_0x0657('0x60')]({'where':{'id':_0x208ba9[_0x0657('0x5c')]['id']}})[_0x0657('0x12')](handleEntityNotFound(_0x122244,null))['then'](function(_0x5414d4){if(_0x5414d4){return _0x5414d4['removeAgents'](_0x208ba9[_0x0657('0x49')]['ids'])[_0x0657('0x12')](function(){if(_[_0x0657('0xbc')](_0x208ba9[_0x0657('0x49')][_0x0657('0x6f')])){for(var _0x32ea3d=0x0;_0x32ea3d<_0x208ba9['query']['ids']['length'];_0x32ea3d+=0x1){socket['emit']('userMailAccount:remove',{'UserId':Number(_0x208ba9[_0x0657('0x49')]['ids'][_0x32ea3d]),'MailAccountId':Number(_0x208ba9[_0x0657('0x5c')]['id'])});}}else{socket[_0x0657('0xba')]('userMailAccount:remove',{'UserId':Number(_0x208ba9[_0x0657('0x49')][_0x0657('0x6f')]),'MailAccountId':Number(_0x208ba9[_0x0657('0x5c')]['id'])});}});}})[_0x0657('0x12')](respondWithStatusCode(_0x122244,null))[_0x0657('0x1c')](handleError(_0x122244,null));};exports[_0x0657('0xbd')]=function(_0x41cbd1,_0x43a311){var _0x3218ee={};var _0x3353f6={};var _0x4c34b6;var _0x172aa4;return db[_0x0657('0x58')][_0x0657('0x6d')]({'where':{'id':_0x41cbd1[_0x0657('0x5c')]['id']}})[_0x0657('0x12')](handleEntityNotFound(_0x43a311,null))[_0x0657('0x12')](function(_0x27255a){if(_0x27255a){_0x4c34b6=_0x27255a;_0x3353f6[_0x0657('0x48')]=_[_0x0657('0x4a')](db[_0x0657('0xbe')][_0x0657('0x45')]);_0x3353f6['query']=_[_0x0657('0x4a')](_0x41cbd1['query']);_0x3353f6[_0x0657('0x4b')]=_[_0x0657('0x4c')](_0x3353f6['model'],_0x3353f6[_0x0657('0x49')]);_0x3218ee[_0x0657('0x4e')]=_[_0x0657('0x4c')](_0x3353f6[_0x0657('0x48')],qs[_0x0657('0x4d')](_0x41cbd1[_0x0657('0x49')][_0x0657('0x4d')]));_0x3218ee[_0x0657('0x4e')]=_0x3218ee['attributes'][_0x0657('0x4f')]?_0x3218ee[_0x0657('0x4e')]:_0x3353f6['model'];_0x3218ee[_0x0657('0x52')]=qs['sort'](_0x41cbd1['query'][_0x0657('0x53')]);_0x3218ee[_0x0657('0x54')]=qs[_0x0657('0x4b')](_[_0x0657('0x55')](_0x41cbd1['query'],_0x3353f6[_0x0657('0x4b')]));if(_0x41cbd1[_0x0657('0x49')]['filter']){_0x3218ee['where']=_[_0x0657('0x57')](_0x3218ee['where'],{'$or':_[_0x0657('0x44')](_0x3218ee[_0x0657('0x4e')],function(_0x2e237c){var _0x51f5e2={};_0x51f5e2[_0x2e237c]={'$like':'%'+_0x41cbd1[_0x0657('0x49')][_0x0657('0x56')]+'%'};return _0x51f5e2;})});}_0x3218ee=_[_0x0657('0x57')]({},_0x3218ee,_0x41cbd1['options']);return _0x4c34b6['getAgents'](_0x3218ee);}})['then'](function(_0x49242c){if(_0x49242c){_0x172aa4=_0x49242c[_0x0657('0x4f')];if(!_0x41cbd1['query'][_0x0657('0x50')]('nolimit')){_0x3218ee[_0x0657('0x21')]=qs[_0x0657('0x21')](_0x41cbd1[_0x0657('0x49')][_0x0657('0x21')]);_0x3218ee['offset']=qs['offset'](_0x41cbd1['query'][_0x0657('0x22')]);}return _0x4c34b6[_0x0657('0xbd')](_0x3218ee);}})[_0x0657('0x12')](function(_0x3724de){if(_0x3724de){return _0x3724de?{'count':_0x172aa4,'rows':_0x3724de}:null;}})['then'](respondWithResult(_0x43a311,null))[_0x0657('0x1c')](handleError(_0x43a311,null));}; \ No newline at end of file +var _0xd9f4=['sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','findAndCountAll','priority','finally','send','getApplications','MailMessage','$gte','YYYY-MM-DD\x20HH:mm:ss','true','CmList','List','Contacts','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','format','%s\x20<%s>','attachments','root','server/files/attachments','basename','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','messageId','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','userMailAccount:save','removeAgents','isArray','emit','userMailAccount:remove','getAgents','moment','util','lodash','juice','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','code','error','message','result','status','end','offset','undefined','limit','count','set','Content-Range','json','destroy','MailAccounts','sendStatus','stack','name','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','smtp.gmail.com','smtp-mail.outlook.com','smtp.office365.com','user','username','password','modernAuthentication','CloudProviderId','port','host','secure','service','authentication','pass','Imap','Smtp','index','MailServerIn','MailServerOut','mandatoryDispositionPause','map','MailAccount','rawAttributes','key','model','keys','query','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','show','params','length','catch','update','body','custom','provider','find','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','Disposition','findOne','hasOwnProperty','removeDispositions','ids','addAnswer','CannedAnswer','create','getAnswers','findAll','removeAnswers','email','ListId','isNil','active','description','get','role','UserProfileSection','autoAssociation','UserProfileResource','getImap','addImap','removeImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','CmContact','Contact','Owner','fullname','Tag','Tags','tag','addApplications'];(function(_0x71185f,_0x371d74){var _0x160ffe=function(_0x57feba){while(--_0x57feba){_0x71185f['push'](_0x71185f['shift']());}};_0x160ffe(++_0x371d74);}(_0xd9f4,0xf4));var _0x4d9f=function(_0x3c4f1f,_0x20d3ec){_0x3c4f1f=_0x3c4f1f-0x0;var _0x19cb69=_0xd9f4[_0x3c4f1f];return _0x19cb69;};'use strict';var moment=require(_0x4d9f('0x0'));var BPromise=require('bluebird');var util=require(_0x4d9f('0x1'));var path=require('path');var _=require(_0x4d9f('0x2'));var juice=require(_0x4d9f('0x3'));var Redis=require('ioredis');var qs=require(_0x4d9f('0x4'));var logger=require(_0x4d9f('0x5'))(_0x4d9f('0x6'));var config=require(_0x4d9f('0x7'));var db=require(_0x4d9f('0x8'))['db'];config[_0x4d9f('0x9')]=_[_0x4d9f('0xa')](config[_0x4d9f('0x9')],{'host':_0x4d9f('0xb'),'port':0x18eb});var socket=require(_0x4d9f('0xc'))(new Redis(config[_0x4d9f('0x9')]));require(_0x4d9f('0xd'))[_0x4d9f('0xe')](socket);var jayson=require(_0x4d9f('0xf'));var client=jayson[_0x4d9f('0x10')]['http']({'port':0x232b});function respondWithRpcPromise(_0x4e4beb,_0x367076,_0x140429,_0x1021a2){return new BPromise(function(_0x22147b,_0x46d333){var _0x1abc23=_0x1021a2||client;return _0x1abc23[_0x4d9f('0x11')](_0x4e4beb,_0x140429)[_0x4d9f('0x12')](function(_0xc35527){logger[_0x4d9f('0x13')](_0x4d9f('0x14'),_0x367076,_0x4d9f('0x15'));logger[_0x4d9f('0x16')](_0x4d9f('0x17'),_0x367076,_0x4d9f('0x15'),JSON['stringify'](_0xc35527));if(_0xc35527['error']){if(_0xc35527['error'][_0x4d9f('0x18')]===0x1f4){logger[_0x4d9f('0x19')](_0x4d9f('0x14'),_0x367076,_0xc35527[_0x4d9f('0x19')][_0x4d9f('0x1a')]);return _0x46d333(_0xc35527[_0x4d9f('0x19')]['message']);}logger[_0x4d9f('0x19')]('MailAccount,\x20%s,\x20%s',_0x367076,_0xc35527['error'][_0x4d9f('0x1a')]);return _0x22147b(_0xc35527['error'][_0x4d9f('0x1a')]);}else{logger[_0x4d9f('0x13')](_0x4d9f('0x14'),_0x367076,_0x4d9f('0x15'));_0x22147b(_0xc35527[_0x4d9f('0x1b')][_0x4d9f('0x1a')]);}})['catch'](function(_0x421ccf){logger['error'](_0x4d9f('0x14'),_0x367076,_0x421ccf);_0x46d333(_0x421ccf);});});}function respondWithStatusCode(_0x39ead3,_0x306ee8){_0x306ee8=_0x306ee8||0xcc;return function(_0x26747f){if(_0x26747f){return _0x39ead3['sendStatus'](_0x306ee8);}return _0x39ead3[_0x4d9f('0x1c')](_0x306ee8)[_0x4d9f('0x1d')]();};}function respondWithResult(_0x24c33f,_0x252e3f){_0x252e3f=_0x252e3f||0xc8;return function(_0x17710a){if(_0x17710a){return _0x24c33f['status'](_0x252e3f)['json'](_0x17710a);}};}function respondWithFilteredResult(_0x570ef9,_0x5d2707){return function(_0x1d8ed7){if(_0x1d8ed7){var _0x244107=typeof _0x5d2707[_0x4d9f('0x1e')]===_0x4d9f('0x1f')&&typeof _0x5d2707[_0x4d9f('0x20')]===_0x4d9f('0x1f');var _0x363f89=_0x1d8ed7[_0x4d9f('0x21')];var _0x5f1533=_0x244107?0x0:_0x5d2707[_0x4d9f('0x1e')];var _0x2c1da4=_0x244107?_0x1d8ed7['count']:_0x5d2707['offset']+_0x5d2707[_0x4d9f('0x20')];var _0x573bce;if(_0x2c1da4>=_0x363f89){_0x2c1da4=_0x363f89;_0x573bce=0xc8;}else{_0x573bce=0xce;}_0x570ef9['status'](_0x573bce);return _0x570ef9[_0x4d9f('0x22')](_0x4d9f('0x23'),_0x5f1533+'-'+_0x2c1da4+'/'+_0x363f89)[_0x4d9f('0x24')](_0x1d8ed7);}return null;};}function saveUpdates(_0x1463e1){return function(_0x10338b){if(_0x10338b){return _0x10338b['update'](_0x1463e1)[_0x4d9f('0x12')](function(_0x1fc803){return _0x1fc803;});}return null;};}function removeEntity(_0x460453){return function(_0x250616){if(_0x250616){return _0x250616[_0x4d9f('0x25')]()[_0x4d9f('0x12')](function(){var _0x4328bb=_0x250616['get']({'plain':!![]});var _0x17d401=_0x4d9f('0x26');return db['UserProfileResource'][_0x4d9f('0x25')]({'where':{'type':_0x17d401,'resourceId':_0x4328bb['id']}})[_0x4d9f('0x12')](function(){return _0x250616;});})['then'](function(){_0x460453['status'](0xcc)[_0x4d9f('0x1d')]();});}};}function handleEntityNotFound(_0x192568){return function(_0x382dbe){if(!_0x382dbe){_0x192568[_0x4d9f('0x27')](0x194);}return _0x382dbe;};}function handleError(_0x3370ef,_0x206a8e){_0x206a8e=_0x206a8e||0x1f4;return function(_0x4f0214){logger['error'](_0x4f0214[_0x4d9f('0x28')]);if(_0x4f0214[_0x4d9f('0x29')]){delete _0x4f0214[_0x4d9f('0x29')];}_0x3370ef[_0x4d9f('0x1c')](_0x206a8e)['send'](_0x4f0214);};}function getImapHost(_0x54101a){switch(_0x54101a){case _0x4d9f('0x2a'):return _0x4d9f('0x2b');case _0x4d9f('0x2c'):return _0x4d9f('0x2d');case _0x4d9f('0x2e'):return _0x4d9f('0x2f');case _0x4d9f('0x30'):return _0x4d9f('0x31');}throw new Error('Unknown\x20email\x20service\x20provider',_0x54101a);}function getSmtpHost(_0x27c79f){switch(_0x27c79f){case _0x4d9f('0x2a'):return _0x4d9f('0x32');case'yahoo':return'smtp.mail.yahoo.com';case _0x4d9f('0x2e'):return _0x4d9f('0x33');case _0x4d9f('0x30'):return _0x4d9f('0x34');}throw new Error('Unknown\x20email\x20service\x20provider',_0x27c79f);}function getAuthenticationOptions(_0x23e6b5,_0x1c0ebf){var _0xbf664e={};var _0x40973f={};if(_0x23e6b5){_0xbf664e[_0x4d9f('0x35')]=_0x40973f[_0x4d9f('0x35')]=_0x1c0ebf[_0x4d9f('0x36')];_0xbf664e[_0x4d9f('0x37')]=_0x40973f['pass']=_0x1c0ebf[_0x4d9f('0x37')];if(_0x1c0ebf[_0x4d9f('0x38')]){_0xbf664e['modernAuthentication']=_0x40973f[_0x4d9f('0x38')]=!![];_0xbf664e[_0x4d9f('0x39')]=_0x40973f[_0x4d9f('0x39')]=_0x1c0ebf[_0x4d9f('0x39')];_0xbf664e[_0x4d9f('0x37')]=_0x40973f['pass']=null;}else{_0xbf664e[_0x4d9f('0x39')]=_0x40973f[_0x4d9f('0x39')]=null;}_0xbf664e['host']=getImapHost(_0x23e6b5);_0xbf664e[_0x4d9f('0x3a')]=0x3e1;_0x40973f[_0x4d9f('0x3b')]=getSmtpHost(_0x23e6b5);_0x40973f[_0x4d9f('0x3a')]=0x24b;_0x40973f[_0x4d9f('0x3c')]=![];_0xbf664e['service']=_0x40973f[_0x4d9f('0x3d')]=null;}else{if(_0x1c0ebf['authentication']){_0xbf664e[_0x4d9f('0x35')]=_0x40973f[_0x4d9f('0x35')]=_0x1c0ebf['username'];_0xbf664e['password']=_0x40973f['pass']=_0x1c0ebf[_0x4d9f('0x37')];}else{_0xbf664e[_0x4d9f('0x3e')]=_0x40973f[_0x4d9f('0x3e')]=![];_0xbf664e['user']=_0x40973f[_0x4d9f('0x35')]=null;_0xbf664e[_0x4d9f('0x37')]=_0x40973f[_0x4d9f('0x3f')]=null;}_0xbf664e['host']=_0x1c0ebf[_0x4d9f('0x40')][_0x4d9f('0x3b')];_0xbf664e['port']=_0x1c0ebf[_0x4d9f('0x40')][_0x4d9f('0x3a')];_0x40973f[_0x4d9f('0x3b')]=_0x1c0ebf[_0x4d9f('0x41')][_0x4d9f('0x3b')];_0x40973f[_0x4d9f('0x3a')]=_0x1c0ebf[_0x4d9f('0x41')]['port'];}return{'Imap':_0xbf664e,'Smtp':_0x40973f};}exports[_0x4d9f('0x42')]=function(_0x24e659,_0x53c9b7){var _0x9ba71c={'include':[{'model':db[_0x4d9f('0x43')],'as':'Imap'},{'model':db[_0x4d9f('0x44')],'as':'Smtp'},{'model':db['Pause'],'as':_0x4d9f('0x45')}]},_0x5cb378={},_0x5ff302={'count':0x0,'rows':[]};var _0x5dffe1=_[_0x4d9f('0x46')](db[_0x4d9f('0x47')][_0x4d9f('0x48')],function(_0x54112b){return{'name':_0x54112b['fieldName'],'type':_0x54112b['type'][_0x4d9f('0x49')]};});_0x5cb378[_0x4d9f('0x4a')]=_[_0x4d9f('0x46')](_0x5dffe1,_0x4d9f('0x29'));_0x5cb378['query']=_[_0x4d9f('0x4b')](_0x24e659[_0x4d9f('0x4c')]);_0x5cb378[_0x4d9f('0x4d')]=_['intersection'](_0x5cb378[_0x4d9f('0x4a')],_0x5cb378['query']);_0x9ba71c[_0x4d9f('0x4e')]=_[_0x4d9f('0x4f')](_0x5cb378['model'],qs[_0x4d9f('0x50')](_0x24e659[_0x4d9f('0x4c')]['fields']));_0x9ba71c[_0x4d9f('0x4e')]=_0x9ba71c['attributes']['length']?_0x9ba71c[_0x4d9f('0x4e')]:_0x5cb378[_0x4d9f('0x4a')];if(!_0x24e659[_0x4d9f('0x4c')]['hasOwnProperty'](_0x4d9f('0x51'))){_0x9ba71c[_0x4d9f('0x20')]=qs[_0x4d9f('0x20')](_0x24e659['query'][_0x4d9f('0x20')]);_0x9ba71c[_0x4d9f('0x1e')]=qs[_0x4d9f('0x1e')](_0x24e659['query']['offset']);}_0x9ba71c[_0x4d9f('0x52')]=qs[_0x4d9f('0x53')](_0x24e659[_0x4d9f('0x4c')][_0x4d9f('0x53')]);_0x9ba71c[_0x4d9f('0x54')]=qs[_0x4d9f('0x4d')](_[_0x4d9f('0x55')](_0x24e659[_0x4d9f('0x4c')],_0x5cb378['filters']),_0x5dffe1);if(_0x24e659[_0x4d9f('0x4c')][_0x4d9f('0x56')]){_0x9ba71c['where']=_[_0x4d9f('0x57')](_0x9ba71c['where'],{'$or':_[_0x4d9f('0x46')](_0x5dffe1,function(_0x20a0d4){if(_0x20a0d4['type']!=='VIRTUAL'){var _0x46567c={};_0x46567c[_0x20a0d4[_0x4d9f('0x29')]]={'$like':'%'+_0x24e659[_0x4d9f('0x4c')][_0x4d9f('0x56')]+'%'};return _0x46567c;}})});}_0x9ba71c=_[_0x4d9f('0x57')]({},_0x9ba71c,_0x24e659[_0x4d9f('0x58')]);var _0x2f2bc9={'where':_0x9ba71c['where']};return db['MailAccount'][_0x4d9f('0x21')](_0x2f2bc9)['then'](function(_0x3b4298){_0x5ff302[_0x4d9f('0x21')]=_0x3b4298;if(_0x24e659[_0x4d9f('0x4c')][_0x4d9f('0x59')]){_0x9ba71c[_0x4d9f('0x5a')]=[{'all':!![]}];}return db['MailAccount']['findAll'](_0x9ba71c);})[_0x4d9f('0x12')](function(_0x209466){_0x5ff302[_0x4d9f('0x5b')]=_0x209466;return _0x5ff302;})[_0x4d9f('0x12')](respondWithFilteredResult(_0x53c9b7,_0x9ba71c))['catch'](handleError(_0x53c9b7,null));};exports[_0x4d9f('0x5c')]=function(_0x4c7aa2,_0x57787e){var _0x4b8d29={'raw':![],'where':{'id':_0x4c7aa2[_0x4d9f('0x5d')]['id']},'include':[{'model':db[_0x4d9f('0x43')],'as':_0x4d9f('0x40')},{'model':db[_0x4d9f('0x44')],'as':'Smtp'},{'model':db['Pause'],'as':_0x4d9f('0x45')}]},_0x2ca855={};_0x2ca855[_0x4d9f('0x4a')]=_[_0x4d9f('0x4b')](db[_0x4d9f('0x47')][_0x4d9f('0x48')]);_0x2ca855[_0x4d9f('0x4c')]=_[_0x4d9f('0x4b')](_0x4c7aa2[_0x4d9f('0x4c')]);_0x2ca855[_0x4d9f('0x4d')]=_[_0x4d9f('0x4f')](_0x2ca855[_0x4d9f('0x4a')],_0x2ca855[_0x4d9f('0x4c')]);_0x4b8d29[_0x4d9f('0x4e')]=_[_0x4d9f('0x4f')](_0x2ca855[_0x4d9f('0x4a')],qs[_0x4d9f('0x50')](_0x4c7aa2[_0x4d9f('0x4c')][_0x4d9f('0x50')]));_0x4b8d29[_0x4d9f('0x4e')]=_0x4b8d29[_0x4d9f('0x4e')][_0x4d9f('0x5e')]?_0x4b8d29[_0x4d9f('0x4e')]:_0x2ca855['model'];if(_0x4c7aa2['query'][_0x4d9f('0x59')]){_0x4b8d29['include']=[{'all':!![]}];}_0x4b8d29=_[_0x4d9f('0x57')]({},_0x4b8d29,_0x4c7aa2['options']);return db['MailAccount']['find'](_0x4b8d29)[_0x4d9f('0x12')](handleEntityNotFound(_0x57787e,null))[_0x4d9f('0x12')](respondWithResult(_0x57787e,null))[_0x4d9f('0x5f')](handleError(_0x57787e,null));};exports[_0x4d9f('0x60')]=function(_0x265306,_0x17f07d){if(_0x265306['body']['id']){delete _0x265306[_0x4d9f('0x61')]['id'];}var _0x1e7867=_0x265306[_0x4d9f('0x61')]['provider']===_0x4d9f('0x62')?null:_0x265306[_0x4d9f('0x61')][_0x4d9f('0x63')];var _0x2ab2e0=_0x265306['body']['Imap']||{};var _0x389640=_0x265306[_0x4d9f('0x61')][_0x4d9f('0x41')]||{};if(_0x1e7867){_0x2ab2e0['host']=getImapHost(_0x1e7867);_0x2ab2e0[_0x4d9f('0x3a')]=0x3e1;_0x389640[_0x4d9f('0x3b')]=getSmtpHost(_0x1e7867);_0x389640[_0x4d9f('0x3a')]=0x24b;_0x389640[_0x4d9f('0x3c')]=![];}if(_0x389640[_0x4d9f('0x38')]){_0x389640[_0x4d9f('0x3c')]=![];}else{_0x389640[_0x4d9f('0x39')]=null;}if(!_0x2ab2e0[_0x4d9f('0x38')])_0x2ab2e0[_0x4d9f('0x39')]=null;_0x265306[_0x4d9f('0x61')][_0x4d9f('0x40')]=_0x2ab2e0;_0x265306[_0x4d9f('0x61')][_0x4d9f('0x41')]=_0x389640;return db[_0x4d9f('0x47')][_0x4d9f('0x64')]({'where':{'id':_0x265306[_0x4d9f('0x5d')]['id']},'include':[{'model':db[_0x4d9f('0x43')],'as':_0x4d9f('0x40')},{'model':db[_0x4d9f('0x44')],'as':_0x4d9f('0x41')},{'model':db['Pause'],'as':_0x4d9f('0x45')}]})[_0x4d9f('0x12')](handleEntityNotFound(_0x17f07d,null))[_0x4d9f('0x12')](function(_0xbac06d){if(!_0xbac06d)throw new Error(_0x4d9f('0x65'));if(_0xbac06d['service'])delete _0x265306['body'][_0x4d9f('0x40')];return _0xbac06d;})[_0x4d9f('0x12')](saveUpdates(_0x265306['body'],null))[_0x4d9f('0x12')](function(_0x8140fa){if(!_0x265306[_0x4d9f('0x61')][_0x4d9f('0x40')])return _0x8140fa;return db['MailServerIn'][_0x4d9f('0x60')](_0x265306['body'][_0x4d9f('0x40')],{'where':{'MailAccountId':_0x8140fa['id']}})[_0x4d9f('0x12')](function(){return _0x8140fa;});})['then'](function(_0x55b545){if(!_0x265306['body'][_0x4d9f('0x41')])return _0x55b545;return db['MailServerOut'][_0x4d9f('0x60')](_0x265306[_0x4d9f('0x61')][_0x4d9f('0x41')],{'where':{'MailAccountId':_0x55b545['id']}})['then'](function(){return _0x55b545;});})[_0x4d9f('0x12')](respondWithResult(_0x17f07d,null))['catch'](handleError(_0x17f07d,null));};exports[_0x4d9f('0x66')]=function(_0x45919c,_0x531392){return db[_0x4d9f('0x47')]['describe']()[_0x4d9f('0x12')](respondWithResult(_0x531392,null))['catch'](handleError(_0x531392,null));};exports[_0x4d9f('0x67')]=function(_0x5eba42,_0x133bb8){if(_0x5eba42[_0x4d9f('0x61')]['id']){delete _0x5eba42[_0x4d9f('0x61')]['id'];}return db[_0x4d9f('0x47')][_0x4d9f('0x64')]({'where':{'id':_0x5eba42[_0x4d9f('0x5d')]['id']}})[_0x4d9f('0x12')](handleEntityNotFound(_0x133bb8,null))[_0x4d9f('0x12')](function(_0x5a239b){if(_0x5a239b){_0x5eba42[_0x4d9f('0x61')][_0x4d9f('0x68')]=_0x5a239b['id'];return db[_0x4d9f('0x69')]['create'](_0x5eba42[_0x4d9f('0x61')]);}})[_0x4d9f('0x12')](respondWithResult(_0x133bb8,null))[_0x4d9f('0x5f')](handleError(_0x133bb8,null));};exports['getDispositions']=function(_0x46d698,_0x4e9c12){var _0x3f0274={'raw':![],'where':{}};var _0x20b193={};var _0x546574={'count':0x0,'rows':[]};return db['MailAccount'][_0x4d9f('0x6a')]({'where':{'id':_0x46d698[_0x4d9f('0x5d')]['id']}})['then'](handleEntityNotFound(_0x4e9c12,null))[_0x4d9f('0x12')](function(_0x93073c){if(_0x93073c){_0x20b193['model']=_[_0x4d9f('0x4b')](db[_0x4d9f('0x69')][_0x4d9f('0x48')]);_0x20b193[_0x4d9f('0x4c')]=_[_0x4d9f('0x4b')](_0x46d698[_0x4d9f('0x4c')]);_0x20b193[_0x4d9f('0x4d')]=_[_0x4d9f('0x4f')](_0x20b193['model'],_0x20b193[_0x4d9f('0x4c')]);_0x3f0274[_0x4d9f('0x4e')]=_[_0x4d9f('0x4f')](_0x20b193[_0x4d9f('0x4a')],qs[_0x4d9f('0x50')](_0x46d698[_0x4d9f('0x4c')][_0x4d9f('0x50')]));_0x3f0274[_0x4d9f('0x4e')]=_0x3f0274['attributes']['length']?_0x3f0274[_0x4d9f('0x4e')]:_0x20b193[_0x4d9f('0x4a')];if(!_0x46d698[_0x4d9f('0x4c')][_0x4d9f('0x6b')](_0x4d9f('0x51'))){_0x3f0274[_0x4d9f('0x20')]=qs[_0x4d9f('0x20')](_0x46d698[_0x4d9f('0x4c')][_0x4d9f('0x20')]);_0x3f0274[_0x4d9f('0x1e')]=qs[_0x4d9f('0x1e')](_0x46d698[_0x4d9f('0x4c')][_0x4d9f('0x1e')]);}_0x3f0274[_0x4d9f('0x52')]=qs[_0x4d9f('0x53')](_0x46d698[_0x4d9f('0x4c')][_0x4d9f('0x53')]);_0x3f0274['where']=qs['filters'](_[_0x4d9f('0x55')](_0x46d698[_0x4d9f('0x4c')],_0x20b193[_0x4d9f('0x4d')]));_0x3f0274[_0x4d9f('0x54')][_0x4d9f('0x68')]=_0x93073c['id'];if(_0x46d698[_0x4d9f('0x4c')][_0x4d9f('0x56')]){_0x3f0274[_0x4d9f('0x54')]=_['merge'](_0x3f0274[_0x4d9f('0x54')],{'$or':_[_0x4d9f('0x46')](_0x3f0274[_0x4d9f('0x4e')],function(_0x40519b){var _0x23d87c={};_0x23d87c[_0x40519b]={'$like':'%'+_0x46d698[_0x4d9f('0x4c')][_0x4d9f('0x56')]+'%'};return _0x23d87c;})});}_0x3f0274=_['merge']({},_0x3f0274,_0x46d698[_0x4d9f('0x58')]);return db['Disposition']['count']({'where':_0x3f0274[_0x4d9f('0x54')]})[_0x4d9f('0x12')](function(_0x7513da){_0x546574['count']=_0x7513da;if(_0x46d698[_0x4d9f('0x4c')][_0x4d9f('0x59')]){_0x3f0274[_0x4d9f('0x5a')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x3f0274);})[_0x4d9f('0x12')](function(_0x4ae549){_0x546574[_0x4d9f('0x5b')]=_0x4ae549;return _0x546574;});}})[_0x4d9f('0x12')](respondWithFilteredResult(_0x4e9c12,_0x3f0274))[_0x4d9f('0x5f')](handleError(_0x4e9c12,null));};exports[_0x4d9f('0x6c')]=function(_0x45ccd6,_0x595e4b){return db[_0x4d9f('0x47')][_0x4d9f('0x64')]({'where':{'id':_0x45ccd6['params']['id']}})['then'](handleEntityNotFound(_0x595e4b,null))[_0x4d9f('0x12')](function(_0x1cc77f){if(_0x1cc77f){return _0x1cc77f[_0x4d9f('0x6c')](_0x45ccd6[_0x4d9f('0x4c')][_0x4d9f('0x6d')]);}})[_0x4d9f('0x12')](respondWithStatusCode(_0x595e4b,null))['catch'](handleError(_0x595e4b,null));};exports[_0x4d9f('0x6e')]=function(_0x279730,_0xf2f13c){if(_0x279730[_0x4d9f('0x61')]['id']){delete _0x279730[_0x4d9f('0x61')]['id'];}return db[_0x4d9f('0x47')][_0x4d9f('0x64')]({'where':{'id':_0x279730[_0x4d9f('0x5d')]['id']}})[_0x4d9f('0x12')](handleEntityNotFound(_0xf2f13c,null))[_0x4d9f('0x12')](function(_0x230824){if(_0x230824){_0x279730[_0x4d9f('0x61')][_0x4d9f('0x68')]=_0x230824['id'];return db[_0x4d9f('0x6f')][_0x4d9f('0x70')](_0x279730[_0x4d9f('0x61')]);}})[_0x4d9f('0x12')](respondWithResult(_0xf2f13c,null))['catch'](handleError(_0xf2f13c,null));};exports[_0x4d9f('0x71')]=function(_0x563a2a,_0x4ab67b){var _0x561741={'raw':![],'where':{}};var _0xce0836={};var _0x58f5ef={'count':0x0,'rows':[]};return db[_0x4d9f('0x47')][_0x4d9f('0x6a')]({'where':{'id':_0x563a2a[_0x4d9f('0x5d')]['id']}})[_0x4d9f('0x12')](handleEntityNotFound(_0x4ab67b,null))[_0x4d9f('0x12')](function(_0x2a8d36){if(_0x2a8d36){_0xce0836[_0x4d9f('0x4a')]=_['keys'](db[_0x4d9f('0x6f')]['rawAttributes']);_0xce0836['query']=_[_0x4d9f('0x4b')](_0x563a2a[_0x4d9f('0x4c')]);_0xce0836[_0x4d9f('0x4d')]=_[_0x4d9f('0x4f')](_0xce0836[_0x4d9f('0x4a')],_0xce0836[_0x4d9f('0x4c')]);_0x561741[_0x4d9f('0x4e')]=_[_0x4d9f('0x4f')](_0xce0836[_0x4d9f('0x4a')],qs[_0x4d9f('0x50')](_0x563a2a[_0x4d9f('0x4c')][_0x4d9f('0x50')]));_0x561741[_0x4d9f('0x4e')]=_0x561741['attributes']['length']?_0x561741['attributes']:_0xce0836['model'];if(!_0x563a2a[_0x4d9f('0x4c')]['hasOwnProperty'](_0x4d9f('0x51'))){_0x561741['limit']=qs[_0x4d9f('0x20')](_0x563a2a[_0x4d9f('0x4c')][_0x4d9f('0x20')]);_0x561741['offset']=qs[_0x4d9f('0x1e')](_0x563a2a['query']['offset']);}_0x561741['order']=qs[_0x4d9f('0x53')](_0x563a2a[_0x4d9f('0x4c')][_0x4d9f('0x53')]);_0x561741[_0x4d9f('0x54')]=qs['filters'](_['pick'](_0x563a2a[_0x4d9f('0x4c')],_0xce0836['filters']));_0x561741[_0x4d9f('0x54')]['MailAccountId']=_0x2a8d36['id'];if(_0x563a2a[_0x4d9f('0x4c')][_0x4d9f('0x56')]){_0x561741[_0x4d9f('0x54')]=_['merge'](_0x561741['where'],{'$or':_['map'](_0x561741['attributes'],function(_0x3ce239){var _0x2391de={};_0x2391de[_0x3ce239]={'$like':'%'+_0x563a2a[_0x4d9f('0x4c')][_0x4d9f('0x56')]+'%'};return _0x2391de;})});}_0x561741=_[_0x4d9f('0x57')]({},_0x561741,_0x563a2a[_0x4d9f('0x58')]);return db[_0x4d9f('0x6f')]['count']({'where':_0x561741[_0x4d9f('0x54')]})['then'](function(_0x4601db){_0x58f5ef[_0x4d9f('0x21')]=_0x4601db;if(_0x563a2a[_0x4d9f('0x4c')][_0x4d9f('0x59')]){_0x561741['include']=[{'all':!![]}];}return db[_0x4d9f('0x6f')][_0x4d9f('0x72')](_0x561741);})[_0x4d9f('0x12')](function(_0x14fb50){_0x58f5ef[_0x4d9f('0x5b')]=_0x14fb50;return _0x58f5ef;});}})['then'](respondWithFilteredResult(_0x4ab67b,_0x561741))['catch'](handleError(_0x4ab67b,null));};exports[_0x4d9f('0x73')]=function(_0x5bf71a,_0x3e7800){return db[_0x4d9f('0x47')]['find']({'where':{'id':_0x5bf71a[_0x4d9f('0x5d')]['id']}})[_0x4d9f('0x12')](handleEntityNotFound(_0x3e7800,null))[_0x4d9f('0x12')](function(_0x3a1226){if(_0x3a1226){return _0x3a1226['removeAnswers'](_0x5bf71a[_0x4d9f('0x4c')]['ids']);}})[_0x4d9f('0x12')](respondWithStatusCode(_0x3e7800,null))[_0x4d9f('0x5f')](handleError(_0x3e7800,null));};exports['create']=function(_0x513617,_0x4ec9ec){var _0x29e063={'name':_0x513617[_0x4d9f('0x61')][_0x4d9f('0x29')],'key':_0x513617['body'][_0x4d9f('0x49')],'provider':_0x513617[_0x4d9f('0x61')][_0x4d9f('0x63')]===_0x4d9f('0x62')?null:_0x513617[_0x4d9f('0x61')][_0x4d9f('0x63')],'email':_0x513617[_0x4d9f('0x61')][_0x4d9f('0x74')],'ListId':_0x513617[_0x4d9f('0x61')][_0x4d9f('0x75')],'active':!_[_0x4d9f('0x76')](_0x513617[_0x4d9f('0x61')]['active'])?_0x513617['body'][_0x4d9f('0x77')]:!![],'description':_0x513617[_0x4d9f('0x61')][_0x4d9f('0x78')]||null};var _0x11d87e=getAuthenticationOptions(_0x29e063['provider'],_0x513617[_0x4d9f('0x61')]);_0x29e063[_0x4d9f('0x40')]=_0x11d87e[_0x4d9f('0x40')];_0x29e063[_0x4d9f('0x41')]=_0x11d87e[_0x4d9f('0x41')];return db[_0x4d9f('0x47')][_0x4d9f('0x70')](_0x29e063,{'include':[{'model':db[_0x4d9f('0x44')],'as':'Smtp'},{'model':db['MailServerIn'],'as':_0x4d9f('0x40')}]})[_0x4d9f('0x12')](function(_0x538323){var _0x3f1f50=_0x513617[_0x4d9f('0x35')][_0x4d9f('0x79')]({'plain':!![]});if(!_0x3f1f50)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3f1f50[_0x4d9f('0x7a')]==='user'){var _0x31502c=_0x538323[_0x4d9f('0x79')]({'plain':!![]});return db[_0x4d9f('0x7b')][_0x4d9f('0x64')]({'where':{'name':_0x4d9f('0x26'),'userProfileId':_0x3f1f50['userProfileId']},'raw':!![]})[_0x4d9f('0x12')](function(_0x452405){if(_0x452405&&_0x452405[_0x4d9f('0x7c')]===0x0){return db[_0x4d9f('0x7d')]['create']({'name':_0x31502c['name'],'resourceId':_0x31502c['id'],'type':_0x452405[_0x4d9f('0x29')],'sectionId':_0x452405['id']},{})[_0x4d9f('0x12')](function(){return _0x538323;});}else{return _0x538323;}})['catch'](function(_0x27de04){logger[_0x4d9f('0x19')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x27de04);throw _0x27de04;});}return _0x538323;})[_0x4d9f('0x12')](respondWithResult(_0x4ec9ec,0xc9))['catch'](handleError(_0x4ec9ec,null));};exports[_0x4d9f('0x7e')]=function(_0x3dcb64,_0x2686a5){return db['MailAccount'][_0x4d9f('0x6a')]({'where':{'id':_0x3dcb64[_0x4d9f('0x5d')]['id']}})[_0x4d9f('0x12')](handleEntityNotFound(_0x2686a5,null))[_0x4d9f('0x12')](function(_0xf51b96){if(_0xf51b96){return _0xf51b96[_0x4d9f('0x7e')]();}return null;})['then'](respondWithResult(_0x2686a5,null))[_0x4d9f('0x5f')](handleError(_0x2686a5,null));};exports[_0x4d9f('0x7f')]=function(_0x85a3d7,_0x292e77){if(_0x85a3d7[_0x4d9f('0x61')]['id']){delete _0x85a3d7['body']['id'];}return db[_0x4d9f('0x47')][_0x4d9f('0x64')]({'where':{'id':_0x85a3d7[_0x4d9f('0x5d')]['id']}})['then'](handleEntityNotFound(_0x292e77,null))[_0x4d9f('0x12')](function(_0x157fa5){if(_0x157fa5){_0x85a3d7['body'][_0x4d9f('0x68')]=_0x157fa5['id'];return db[_0x4d9f('0x43')][_0x4d9f('0x70')](_0x85a3d7[_0x4d9f('0x61')]);}})[_0x4d9f('0x12')](respondWithResult(_0x292e77,null))[_0x4d9f('0x5f')](handleError(_0x292e77,null));};exports[_0x4d9f('0x80')]=function(_0x94a1c1,_0x3f289c){return db[_0x4d9f('0x47')][_0x4d9f('0x6a')]({'where':{'id':_0x94a1c1[_0x4d9f('0x5d')]['id']}})[_0x4d9f('0x12')](handleEntityNotFound(_0x3f289c,null))[_0x4d9f('0x12')](function(_0x531e72){if(_0x531e72){return _0x531e72['setImap'](null);}return null;})[_0x4d9f('0x12')](respondWithStatusCode(_0x3f289c,null))['catch'](handleError(_0x3f289c,null));};exports[_0x4d9f('0x81')]=function(_0x43e8cb,_0x594f4f){return db[_0x4d9f('0x47')]['findOne']({'where':{'id':_0x43e8cb['params']['id']}})['then'](handleEntityNotFound(_0x594f4f,null))[_0x4d9f('0x12')](function(_0x2e6de1){if(_0x2e6de1){return _0x2e6de1[_0x4d9f('0x81')]();}return null;})['then'](respondWithResult(_0x594f4f,null))['catch'](handleError(_0x594f4f,null));};exports[_0x4d9f('0x82')]=function(_0xb5f202,_0x38a489){if(_0xb5f202[_0x4d9f('0x61')]['id']){delete _0xb5f202[_0x4d9f('0x61')]['id'];}return db[_0x4d9f('0x47')]['find']({'where':{'id':_0xb5f202[_0x4d9f('0x5d')]['id']}})[_0x4d9f('0x12')](handleEntityNotFound(_0x38a489,null))['then'](function(_0x47e270){if(_0x47e270){_0xb5f202[_0x4d9f('0x61')][_0x4d9f('0x68')]=_0x47e270['id'];return db[_0x4d9f('0x44')][_0x4d9f('0x70')](_0xb5f202[_0x4d9f('0x61')]);}})[_0x4d9f('0x12')](respondWithResult(_0x38a489,null))['catch'](handleError(_0x38a489,null));};exports[_0x4d9f('0x83')]=function(_0x294869,_0x5a9c46){return db[_0x4d9f('0x47')][_0x4d9f('0x6a')]({'where':{'id':_0x294869['params']['id']}})[_0x4d9f('0x12')](handleEntityNotFound(_0x5a9c46,null))[_0x4d9f('0x12')](function(_0x1714f1){if(_0x1714f1){return _0x1714f1[_0x4d9f('0x84')](null);}return null;})['then'](respondWithStatusCode(_0x5a9c46,null))[_0x4d9f('0x5f')](handleError(_0x5a9c46,null));};exports[_0x4d9f('0x85')]=function(_0x517f26,_0x4d0a32){return db[_0x4d9f('0x86')][_0x4d9f('0x64')]({'where':{'id':_0x517f26['params']['id']}})['then'](handleEntityNotFound(_0x4d0a32,null))[_0x4d9f('0x12')](function(_0x104a19){if(_0x104a19){return _0x104a19['addInteraction'](_0x517f26[_0x4d9f('0x61')][_0x4d9f('0x6d')],_[_0x4d9f('0x87')](_0x517f26[_0x4d9f('0x61')],[_0x4d9f('0x6d'),'id'])||{});}})[_0x4d9f('0x12')](respondWithResult(_0x4d0a32,null))[_0x4d9f('0x5f')](handleError(_0x4d0a32,null));};exports['getInteractions']=function(_0x258843,_0x4a1c34){var _0x166eb1={'raw':![],'where':{}};var _0x837c13={};var _0x4499c6={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x258843[_0x4d9f('0x5d')]['id']}})[_0x4d9f('0x12')](handleEntityNotFound(_0x4a1c34,null))[_0x4d9f('0x12')](function(_0xc7f7e){if(_0xc7f7e){_0x837c13[_0x4d9f('0x4a')]=_['keys'](db[_0x4d9f('0x86')][_0x4d9f('0x48')]);_0x837c13['query']=_[_0x4d9f('0x4b')](_0x258843[_0x4d9f('0x4c')]);_0x837c13[_0x4d9f('0x4d')]=_['intersection'](_0x837c13[_0x4d9f('0x4a')],_0x837c13['query']);_0x166eb1['attributes']=_[_0x4d9f('0x4f')](_0x837c13[_0x4d9f('0x4a')],qs[_0x4d9f('0x50')](_0x258843[_0x4d9f('0x4c')]['fields']));_0x166eb1[_0x4d9f('0x4e')]=_0x166eb1[_0x4d9f('0x4e')][_0x4d9f('0x5e')]?_0x166eb1[_0x4d9f('0x4e')]:_0x837c13['model'];if(!_0x258843[_0x4d9f('0x4c')][_0x4d9f('0x6b')](_0x4d9f('0x51'))){_0x166eb1[_0x4d9f('0x20')]=qs[_0x4d9f('0x20')](_0x258843['query']['limit']);_0x166eb1['offset']=qs[_0x4d9f('0x1e')](_0x258843[_0x4d9f('0x4c')][_0x4d9f('0x1e')]);}_0x166eb1[_0x4d9f('0x52')]=qs[_0x4d9f('0x53')](_0x258843[_0x4d9f('0x4c')][_0x4d9f('0x53')]);_0x166eb1[_0x4d9f('0x54')]=qs[_0x4d9f('0x4d')](_[_0x4d9f('0x55')](_0x258843[_0x4d9f('0x4c')],_0x837c13[_0x4d9f('0x4d')]));_0x166eb1[_0x4d9f('0x54')][_0x4d9f('0x68')]=_0xc7f7e['id'];if(_0x258843[_0x4d9f('0x4c')]['filter']){_0x166eb1['where']=_[_0x4d9f('0x57')](_0x166eb1[_0x4d9f('0x54')],{'$or':_[_0x4d9f('0x46')](_0x166eb1[_0x4d9f('0x4e')],function(_0x2f3afc){var _0x21e048={};_0x21e048[_0x2f3afc]={'$like':'%'+_0x258843[_0x4d9f('0x4c')][_0x4d9f('0x56')]+'%'};return _0x21e048;})});}_0x166eb1=_['merge']({},_0x166eb1,_0x258843['options']);return db[_0x4d9f('0x86')][_0x4d9f('0x21')]({'where':_0x166eb1[_0x4d9f('0x54')]})[_0x4d9f('0x12')](function(_0x253e0a){_0x4499c6[_0x4d9f('0x21')]=_0x253e0a;if(_0x258843['query'][_0x4d9f('0x59')]){_0x166eb1[_0x4d9f('0x5a')]=[{'model':db[_0x4d9f('0x88')],'as':_0x4d9f('0x89'),'required':![]},{'model':db['User'],'as':_0x4d9f('0x8a'),'attributes':['name',_0x4d9f('0x8b'),'internal'],'required':![]},{'model':db[_0x4d9f('0x8c')],'as':_0x4d9f('0x8d'),'attributes':['id',_0x4d9f('0x29'),'color'],'where':_0x258843[_0x4d9f('0x4c')][_0x4d9f('0x8e')]?{'id':_0x258843[_0x4d9f('0x4c')][_0x4d9f('0x8e')]}:undefined,'required':_0x258843['query'][_0x4d9f('0x8e')]?!![]:![]}];}return db[_0x4d9f('0x86')][_0x4d9f('0x72')](_0x166eb1);})[_0x4d9f('0x12')](function(_0x23b75d){_0x4499c6[_0x4d9f('0x5b')]=_0x23b75d;return _0x4499c6;});}})[_0x4d9f('0x12')](respondWithFilteredResult(_0x4a1c34,_0x166eb1))['catch'](handleError(_0x4a1c34,null));};exports[_0x4d9f('0x8f')]=function addApplications(_0x1fad1b,_0x124469){var _0x3cbe96=_0x1fad1b[_0x4d9f('0x5d')]['id'];var _0x6a29a=_0x1fad1b[_0x4d9f('0x61')];var _0x33fba0=0xc8;var _0x1aafd3=null;return db[_0x4d9f('0x90')][_0x4d9f('0x91')]({'isolationLevel':db[_0x4d9f('0x90')][_0x4d9f('0x92')][_0x4d9f('0x93')][_0x4d9f('0x94')]},function(_0x1c74da){return db['MailAccount'][_0x4d9f('0x6a')]({'where':{'id':_0x3cbe96},'transaction':_0x1c74da})[_0x4d9f('0x12')](function(_0x458f8e){if(_0x458f8e){return db[_0x4d9f('0x95')][_0x4d9f('0x25')]({'where':{'MailAccountId':_0x3cbe96},'transaction':_0x1c74da})[_0x4d9f('0x12')](function(){var _0xd1d430=_[_0x4d9f('0x46')](_0x6a29a,function(_0x112af2){_0x112af2[_0x4d9f('0x68')]=_0x3cbe96;return _0x112af2;});return db[_0x4d9f('0x95')]['bulkCreate'](_0xd1d430,{'transaction':_0x1c74da});});}else{_0x33fba0=0x194;_0x1aafd3=[];}});})['then'](function(){if(_0x33fba0!==0x194){return db[_0x4d9f('0x95')][_0x4d9f('0x96')]({'where':{'MailAccountId':_0x3cbe96},'order':_0x4d9f('0x97')})['then'](function(_0x3b5809){_0x1aafd3=_0x3b5809;});}})[_0x4d9f('0x5f')](function(_0x74d770){_0x33fba0=0x1f4;logger[_0x4d9f('0x19')](_0x74d770[_0x4d9f('0x28')]);if(_0x74d770['name']){delete _0x74d770[_0x4d9f('0x29')];}_0x1aafd3=_0x74d770;})[_0x4d9f('0x98')](function(){if(_0x1aafd3===null){_0x124469[_0x4d9f('0x27')](_0x33fba0);}else{if(_0x33fba0===0x1f4){_0x124469[_0x4d9f('0x1c')](_0x33fba0)[_0x4d9f('0x99')](_0x1aafd3);}else{_0x124469[_0x4d9f('0x1c')](_0x33fba0)[_0x4d9f('0x24')](_0x1aafd3);}}});};exports[_0x4d9f('0x9a')]=function(_0x3dba34,_0x11f9b4){var _0x2db317={};var _0x405032={};var _0x2b9498;var _0x35ed0d;return db[_0x4d9f('0x47')]['findOne']({'where':{'id':_0x3dba34[_0x4d9f('0x5d')]['id']}})[_0x4d9f('0x12')](handleEntityNotFound(_0x11f9b4,null))['then'](function(_0x4d266e){if(_0x4d266e){_0x2b9498=_0x4d266e;_0x405032['model']=_[_0x4d9f('0x4b')](db[_0x4d9f('0x95')][_0x4d9f('0x48')]);_0x405032[_0x4d9f('0x4c')]=_[_0x4d9f('0x4b')](_0x3dba34[_0x4d9f('0x4c')]);_0x405032[_0x4d9f('0x4d')]=_[_0x4d9f('0x4f')](_0x405032[_0x4d9f('0x4a')],_0x405032[_0x4d9f('0x4c')]);_0x2db317[_0x4d9f('0x4e')]=_['intersection'](_0x405032[_0x4d9f('0x4a')],qs[_0x4d9f('0x50')](_0x3dba34[_0x4d9f('0x4c')][_0x4d9f('0x50')]));_0x2db317[_0x4d9f('0x4e')]=_0x2db317[_0x4d9f('0x4e')][_0x4d9f('0x5e')]?_0x2db317[_0x4d9f('0x4e')]:_0x405032['model'];_0x2db317[_0x4d9f('0x52')]=qs[_0x4d9f('0x53')](_0x3dba34[_0x4d9f('0x4c')]['sort']);_0x2db317[_0x4d9f('0x54')]=qs[_0x4d9f('0x4d')](_[_0x4d9f('0x55')](_0x3dba34['query'],_0x405032['filters']));if(_0x3dba34[_0x4d9f('0x4c')][_0x4d9f('0x56')]){_0x2db317[_0x4d9f('0x54')]=_[_0x4d9f('0x57')](_0x2db317[_0x4d9f('0x54')],{'$or':_[_0x4d9f('0x46')](_0x2db317[_0x4d9f('0x4e')],function(_0x434a10){var _0x244096={};_0x244096[_0x434a10]={'$like':'%'+_0x3dba34[_0x4d9f('0x4c')][_0x4d9f('0x56')]+'%'};return _0x244096;})});}_0x2db317=_[_0x4d9f('0x57')]({},_0x2db317,_0x3dba34['options']);return _0x2b9498[_0x4d9f('0x9a')](_0x2db317);}})[_0x4d9f('0x12')](function(_0x49b29b){if(_0x49b29b){_0x35ed0d=_0x49b29b[_0x4d9f('0x5e')];if(!_0x3dba34[_0x4d9f('0x4c')][_0x4d9f('0x6b')](_0x4d9f('0x51'))){_0x2db317[_0x4d9f('0x20')]=qs[_0x4d9f('0x20')](_0x3dba34['query'][_0x4d9f('0x20')]);_0x2db317[_0x4d9f('0x1e')]=qs[_0x4d9f('0x1e')](_0x3dba34[_0x4d9f('0x4c')][_0x4d9f('0x1e')]);}return _0x2b9498[_0x4d9f('0x9a')](_0x2db317);}})['then'](function(_0x3c097c){if(_0x3c097c){return _0x3c097c?{'count':_0x35ed0d,'rows':_0x3c097c}:null;}})['then'](respondWithResult(_0x11f9b4,null))['catch'](handleError(_0x11f9b4,null));};exports['getMessages']=function(_0x3cd028,_0x49cce0){var _0x20890f={'raw':!![],'where':{}};var _0x43f099={};var _0x221e05={'count':0x0,'rows':[]};return db[_0x4d9f('0x47')][_0x4d9f('0x6a')]({'where':{'id':_0x3cd028[_0x4d9f('0x5d')]['id']}})['then'](handleEntityNotFound(_0x49cce0,null))['then'](function(_0xde9790){if(_0xde9790){_0x43f099[_0x4d9f('0x4a')]=_[_0x4d9f('0x4b')](db[_0x4d9f('0x9b')][_0x4d9f('0x48')]);_0x43f099[_0x4d9f('0x4c')]=_['keys'](_0x3cd028[_0x4d9f('0x4c')]);_0x43f099[_0x4d9f('0x4d')]=_[_0x4d9f('0x4f')](_0x43f099[_0x4d9f('0x4a')],_0x43f099[_0x4d9f('0x4c')]);_0x20890f[_0x4d9f('0x4e')]=_[_0x4d9f('0x4f')](_0x43f099['model'],qs['fields'](_0x3cd028['query'][_0x4d9f('0x50')]));_0x20890f[_0x4d9f('0x4e')]=_0x20890f[_0x4d9f('0x4e')][_0x4d9f('0x5e')]?_0x20890f[_0x4d9f('0x4e')]:_0x43f099[_0x4d9f('0x4a')];if(!_0x3cd028['query'][_0x4d9f('0x6b')](_0x4d9f('0x51'))){_0x20890f[_0x4d9f('0x20')]=qs[_0x4d9f('0x20')](_0x3cd028[_0x4d9f('0x4c')][_0x4d9f('0x20')]);_0x20890f[_0x4d9f('0x1e')]=qs[_0x4d9f('0x1e')](_0x3cd028[_0x4d9f('0x4c')]['offset']);}_0x20890f[_0x4d9f('0x52')]=qs['sort'](_0x3cd028[_0x4d9f('0x4c')][_0x4d9f('0x53')]);_0x20890f[_0x4d9f('0x54')]=qs[_0x4d9f('0x4d')](_[_0x4d9f('0x55')](_0x3cd028[_0x4d9f('0x4c')],_0x43f099['filters']));_0x20890f[_0x4d9f('0x54')][_0x4d9f('0x68')]=_0xde9790['id'];if(_0x3cd028[_0x4d9f('0x4c')][_0x4d9f('0x56')]){_0x20890f[_0x4d9f('0x54')]=_['merge'](_0x20890f[_0x4d9f('0x54')],{'$or':_['map'](_0x20890f['attributes'],function(_0x50c455){var _0x3be477={};_0x3be477[_0x50c455]={'$like':'%'+_0x3cd028['query'][_0x4d9f('0x56')]+'%'};return _0x3be477;})});}if(_0x3cd028[_0x4d9f('0x4c')][_0x4d9f('0x9c')]){var _0xfd0eb1=_0x3cd028['query'][_0x4d9f('0x9c')]['split'](',');var _0x5a708f={};_0x5a708f[_0xfd0eb1[0x0]]={'$gte':moment(_0xfd0eb1[0x1])['format'](_0x4d9f('0x9d'))};_0x20890f[_0x4d9f('0x54')]=_[_0x4d9f('0x57')](_0x20890f['where'],_0x5a708f);}_0x20890f=_[_0x4d9f('0x57')]({},_0x20890f,_0x3cd028[_0x4d9f('0x58')]);return db[_0x4d9f('0x9b')][_0x4d9f('0x21')]({'where':_0x20890f['where']})['then'](function(_0x2966c9){_0x221e05[_0x4d9f('0x21')]=_0x2966c9;if(_0x3cd028[_0x4d9f('0x4c')][_0x4d9f('0x59')]){_0x20890f[_0x4d9f('0x5a')]=[{'all':!![]}];}return db[_0x4d9f('0x9b')][_0x4d9f('0x72')](_0x20890f);})[_0x4d9f('0x12')](function(_0x4056fd){if(_0x3cd028[_0x4d9f('0x4c')]['inlineCss']===_0x4d9f('0x9e')){for(var _0x338cb2=0x0;_0x338cb2<_0x4056fd[_0x4d9f('0x5e')];_0x338cb2++){_0x4056fd[_0x338cb2]['body']=juice(_0x4056fd[_0x338cb2][_0x4d9f('0x61')]);}}_0x221e05[_0x4d9f('0x5b')]=_0x4056fd;return _0x221e05;});}})[_0x4d9f('0x12')](respondWithFilteredResult(_0x49cce0,_0x20890f))['catch'](handleError(_0x49cce0,null));};exports['send']=function(_0x54182e,_0x4d9c49){var _0x49af41,_0x4e8a9d={},_0x14ab22;if(_0x54182e[_0x4d9f('0x61')]['to']){_0x14ab22=_0x54182e['body']['to']['split'](',')[0x0];}return db['MailAccount']['find']({'where':{'id':_0x54182e[_0x4d9f('0x5d')]['id']},'include':[{'model':db[_0x4d9f('0x9f')],'as':_0x4d9f('0xa0'),'include':[{'model':db['CmContact'],'as':_0x4d9f('0xa1'),'where':{'email':_0x14ab22},'limit':0x1,'order':[['updatedAt',_0x4d9f('0xa2')]]}]},{'model':db['MailServerOut'],'as':_0x4d9f('0x41'),'raw':!![],'include':[{'model':db[_0x4d9f('0xa3')],'as':_0x4d9f('0xa3'),'raw':!![]}]}]})[_0x4d9f('0x12')](handleEntityNotFound(_0x4d9c49,null))[_0x4d9f('0x12')](function(_0x471e92){if(!_0x471e92)return;_0x49af41=_0x471e92;if(!_0x471e92[_0x4d9f('0x41')])throw new Error(_0x4d9f('0xa4'));if(_[_0x4d9f('0x76')](_0x54182e[_0x4d9f('0x61')]['from'])){_0x54182e[_0x4d9f('0x61')][_0x4d9f('0xa5')]=util[_0x4d9f('0xa6')](_0x4d9f('0xa7'),_0x471e92[_0x4d9f('0x29')],_0x471e92[_0x4d9f('0x74')]||_0x471e92[_0x4d9f('0x41')][_0x4d9f('0x35')]);}if(_0x54182e['body'][_0x4d9f('0xa8')]&&_0x54182e[_0x4d9f('0x61')][_0x4d9f('0xa8')][_0x4d9f('0x5e')]){for(var _0x42eef6=0x0;_0x42eef6<_0x54182e[_0x4d9f('0x61')]['attachments'][_0x4d9f('0x5e')];_0x42eef6+=0x1){_0x54182e[_0x4d9f('0x61')][_0x4d9f('0xa8')][_0x42eef6]={'filename':_0x54182e['body'][_0x4d9f('0xa8')][_0x42eef6][_0x4d9f('0x29')],'path':path['join'](config[_0x4d9f('0xa9')],_0x4d9f('0xaa'),_0x54182e[_0x4d9f('0x61')][_0x4d9f('0xa8')][_0x42eef6][_0x4d9f('0xab')])};}}var _0x3ef094=_0x471e92[_0x4d9f('0xac')]();return respondWithRpcPromise(_0x4d9f('0xad'),_0x4d9f('0xae'),{'account':_0x3ef094,'message':_0x54182e[_0x4d9f('0x61')]});})[_0x4d9f('0x12')](function(_0x52314b){if(!_0x52314b)return;_0x4e8a9d=_0x52314b;if(!_0x49af41['List'])throw new Error(_0x4d9f('0xaf'));if(_0x49af41[_0x4d9f('0xa0')][_0x4d9f('0xa1')][_0x4d9f('0x5e')])return _0x49af41['List']['Contacts'][0x0];return db['CmContact'][_0x4d9f('0x70')](_['defaults'](_0x54182e[_0x4d9f('0x61')],{'firstName':_0x54182e[_0x4d9f('0x61')]['to'],'email':_0x54182e['body']['to'],'phone':_0x54182e[_0x4d9f('0x61')]['to'],'ListId':_0x49af41[_0x4d9f('0x75')]}));})[_0x4d9f('0x12')](function(_0x3279a8){if(!_0x3279a8)return;var _0x4b623b={'UserId':_0x54182e[_0x4d9f('0x35')]['id'],'ContactId':_0x3279a8['id'],'MailAccountId':_0x49af41['id'],'inReplyTo':_0x4e8a9d[_0x4d9f('0xb0')],'to':_0x54182e[_0x4d9f('0x61')][_0x4d9f('0xa5')],'cc':_0x54182e[_0x4d9f('0x61')]['cc'],'subject':_0x54182e[_0x4d9f('0x61')]['subject'],'attach':_0x54182e[_0x4d9f('0x61')][_0x4d9f('0xb1')],'firstMsgDirection':_0x4d9f('0xb2'),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x4d9f('0xb2'),'Messages':[_[_0x4d9f('0x57')](_0x54182e[_0x4d9f('0x61')],{'messageId':_0x4e8a9d[_0x4d9f('0xb0')],'sentAt':moment()['format'](_0x4d9f('0x9d')),'read':!![],'MailAccountId':_0x49af41['id'],'UserId':_0x54182e[_0x4d9f('0x35')]['id'],'ContactId':_0x3279a8['id']})]};if(_0x54182e[_0x4d9f('0x61')][_0x4d9f('0xb3')]){_0x4b623b=_[_0x4d9f('0x57')](_0x4b623b,_0x54182e[_0x4d9f('0x61')][_0x4d9f('0xb3')]);}return db[_0x4d9f('0x86')][_0x4d9f('0x70')](_0x4b623b,{'include':[{'model':db['MailMessage'],'as':_0x4d9f('0xb4')}]});})[_0x4d9f('0x12')](respondWithResult(_0x4d9c49,null))['catch'](handleError(_0x4d9c49,null));};exports[_0x4d9f('0xb5')]=function(_0x432ac5,_0x4bc5ee){return db[_0x4d9f('0x47')]['find']({'where':{'id':_0x432ac5[_0x4d9f('0x5d')]['id']},'include':[{'model':db[_0x4d9f('0x44')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x4d9f('0xa3')],'as':_0x4d9f('0xa3'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x4bc5ee,null))[_0x4d9f('0x12')](function(_0x5b1a6c){if(!_0x5b1a6c['Smtp'])return;var _0x22c8d3=_0x5b1a6c[_0x4d9f('0xac')]();return respondWithRpcPromise(_0x4d9f('0xb6'),'verifySmtp',{'account':_0x22c8d3});})[_0x4d9f('0x12')](respondWithResult(_0x4bc5ee,null))[_0x4d9f('0x5f')](handleError(_0x4bc5ee,null));};exports[_0x4d9f('0x25')]=function(_0x46ebc7,_0x31e202){return db[_0x4d9f('0x47')][_0x4d9f('0x64')]({'where':{'id':_0x46ebc7[_0x4d9f('0x5d')]['id']}})[_0x4d9f('0x12')](handleEntityNotFound(_0x31e202,null))['then'](function(_0x33d87f){if(_0x33d87f&&_0x33d87f[_0x4d9f('0x3d')]){throw new db[(_0x4d9f('0xb7'))][(_0x4d9f('0xb8'))](_0x4d9f('0xb9'));}return _0x33d87f;})[_0x4d9f('0x12')](removeEntity(_0x31e202,null))[_0x4d9f('0x5f')](handleError(_0x31e202,null));};exports[_0x4d9f('0xba')]=function(_0xc6e74b,_0x36822b){return db[_0x4d9f('0x47')][_0x4d9f('0x64')]({'where':{'id':_0xc6e74b['params']['id']}})[_0x4d9f('0x12')](handleEntityNotFound(_0x36822b,null))[_0x4d9f('0x12')](function(_0x1c1dc5){if(_0x1c1dc5){return _0x1c1dc5[_0x4d9f('0xba')](_0xc6e74b[_0x4d9f('0x61')]['ids'],_['omit'](_0xc6e74b[_0x4d9f('0x61')],['ids','id'])||{})[_0x4d9f('0xbb')](function(_0x5b89c0){for(var _0x46a202=0x0;_0x46a202<_0xc6e74b['body'][_0x4d9f('0x6d')][_0x4d9f('0x5e')];_0x46a202+=0x1){socket['emit'](_0x4d9f('0xbc'),{'UserId':Number(_0xc6e74b[_0x4d9f('0x61')][_0x4d9f('0x6d')][_0x46a202]),'MailAccountId':Number(_0xc6e74b['params']['id'])});}return _0x5b89c0;});}})['then'](respondWithResult(_0x36822b,null))[_0x4d9f('0x5f')](handleError(_0x36822b,null));};exports[_0x4d9f('0xbd')]=function(_0x599050,_0x2bcff4){return db[_0x4d9f('0x47')][_0x4d9f('0x64')]({'where':{'id':_0x599050[_0x4d9f('0x5d')]['id']}})['then'](handleEntityNotFound(_0x2bcff4,null))[_0x4d9f('0x12')](function(_0x47310c){if(_0x47310c){return _0x47310c[_0x4d9f('0xbd')](_0x599050[_0x4d9f('0x4c')]['ids'])['then'](function(){if(_[_0x4d9f('0xbe')](_0x599050[_0x4d9f('0x4c')][_0x4d9f('0x6d')])){for(var _0x39d20e=0x0;_0x39d20e<_0x599050[_0x4d9f('0x4c')]['ids']['length'];_0x39d20e+=0x1){socket[_0x4d9f('0xbf')](_0x4d9f('0xc0'),{'UserId':Number(_0x599050[_0x4d9f('0x4c')]['ids'][_0x39d20e]),'MailAccountId':Number(_0x599050[_0x4d9f('0x5d')]['id'])});}}else{socket[_0x4d9f('0xbf')](_0x4d9f('0xc0'),{'UserId':Number(_0x599050['query'][_0x4d9f('0x6d')]),'MailAccountId':Number(_0x599050[_0x4d9f('0x5d')]['id'])});}});}})[_0x4d9f('0x12')](respondWithStatusCode(_0x2bcff4,null))[_0x4d9f('0x5f')](handleError(_0x2bcff4,null));};exports['getAgents']=function(_0x800b2f,_0xd44321){var _0x360f84={};var _0x2f1636={};var _0x11ccd5;var _0x3cdf6a;return db[_0x4d9f('0x47')]['findOne']({'where':{'id':_0x800b2f[_0x4d9f('0x5d')]['id']}})['then'](handleEntityNotFound(_0xd44321,null))[_0x4d9f('0x12')](function(_0x198b9e){if(_0x198b9e){_0x11ccd5=_0x198b9e;_0x2f1636['model']=_['keys'](db['User']['rawAttributes']);_0x2f1636[_0x4d9f('0x4c')]=_[_0x4d9f('0x4b')](_0x800b2f['query']);_0x2f1636[_0x4d9f('0x4d')]=_[_0x4d9f('0x4f')](_0x2f1636[_0x4d9f('0x4a')],_0x2f1636[_0x4d9f('0x4c')]);_0x360f84[_0x4d9f('0x4e')]=_['intersection'](_0x2f1636[_0x4d9f('0x4a')],qs[_0x4d9f('0x50')](_0x800b2f[_0x4d9f('0x4c')][_0x4d9f('0x50')]));_0x360f84[_0x4d9f('0x4e')]=_0x360f84[_0x4d9f('0x4e')][_0x4d9f('0x5e')]?_0x360f84[_0x4d9f('0x4e')]:_0x2f1636['model'];_0x360f84[_0x4d9f('0x52')]=qs[_0x4d9f('0x53')](_0x800b2f[_0x4d9f('0x4c')][_0x4d9f('0x53')]);_0x360f84[_0x4d9f('0x54')]=qs['filters'](_[_0x4d9f('0x55')](_0x800b2f[_0x4d9f('0x4c')],_0x2f1636[_0x4d9f('0x4d')]));if(_0x800b2f[_0x4d9f('0x4c')][_0x4d9f('0x56')]){_0x360f84[_0x4d9f('0x54')]=_[_0x4d9f('0x57')](_0x360f84['where'],{'$or':_[_0x4d9f('0x46')](_0x360f84[_0x4d9f('0x4e')],function(_0x208ff0){var _0x1ad6f1={};_0x1ad6f1[_0x208ff0]={'$like':'%'+_0x800b2f['query'][_0x4d9f('0x56')]+'%'};return _0x1ad6f1;})});}_0x360f84=_[_0x4d9f('0x57')]({},_0x360f84,_0x800b2f[_0x4d9f('0x58')]);return _0x11ccd5[_0x4d9f('0xc1')](_0x360f84);}})[_0x4d9f('0x12')](function(_0x172543){if(_0x172543){_0x3cdf6a=_0x172543[_0x4d9f('0x5e')];if(!_0x800b2f[_0x4d9f('0x4c')][_0x4d9f('0x6b')]('nolimit')){_0x360f84[_0x4d9f('0x20')]=qs[_0x4d9f('0x20')](_0x800b2f[_0x4d9f('0x4c')][_0x4d9f('0x20')]);_0x360f84['offset']=qs[_0x4d9f('0x1e')](_0x800b2f[_0x4d9f('0x4c')][_0x4d9f('0x1e')]);}return _0x11ccd5['getAgents'](_0x360f84);}})[_0x4d9f('0x12')](function(_0x5be22f){if(_0x5be22f){return _0x5be22f?{'count':_0x3cdf6a,'rows':_0x5be22f}:null;}})[_0x4d9f('0x12')](respondWithResult(_0xd44321,null))[_0x4d9f('0x5f')](handleError(_0xd44321,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 207b11d..e3cab24 100644 --- a/server/api/mailAccount/mailAccount.events.js +++ b/server/api/mailAccount/mailAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9931=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x57d13b,_0x52d8cb){var _0x467696=function(_0x153000){while(--_0x153000){_0x57d13b['push'](_0x57d13b['shift']());}};_0x467696(++_0x52d8cb);}(_0x9931,0x1b6));var _0x1993=function(_0xfc49ed,_0x14dce5){_0xfc49ed=_0xfc49ed-0x0;var _0x4dfc87=_0x9931[_0xfc49ed];return _0x4dfc87;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x1993('0x0'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x1993('0x1')](0x0);var events={'afterCreate':_0x1993('0x2'),'afterUpdate':_0x1993('0x3'),'afterDestroy':_0x1993('0x4')};function emitEvent(_0x311444){return function(_0x38e764,_0x31e1a5,_0x401ac4){MailAccountEvents[_0x1993('0x5')](_0x311444+':'+_0x38e764['id'],_0x38e764);MailAccountEvents[_0x1993('0x5')](_0x311444,_0x38e764);_0x401ac4(null);};}for(var e in events){if(events[_0x1993('0x6')](e)){var event=events[e];MailAccount[_0x1993('0x7')](e,emitEvent(event));}}module[_0x1993('0x8')]=MailAccountEvents; \ No newline at end of file +var _0x804d=['hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','setMaxListeners','save','update','remove','emit'];(function(_0x3f4dd9,_0xe0b819){var _0x31c54a=function(_0x25e6c6){while(--_0x25e6c6){_0x3f4dd9['push'](_0x3f4dd9['shift']());}};_0x31c54a(++_0xe0b819);}(_0x804d,0x116));var _0xd804=function(_0x422a51,_0x1782d8){_0x422a51=_0x422a51-0x0;var _0x250b2a=_0x804d[_0x422a51];return _0x250b2a;};'use strict';var EventEmitter=require(_0xd804('0x0'));var MailAccount=require(_0xd804('0x1'))['db'][_0xd804('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xd804('0x3')](0x0);var events={'afterCreate':_0xd804('0x4'),'afterUpdate':_0xd804('0x5'),'afterDestroy':_0xd804('0x6')};function emitEvent(_0x83c3d2){return function(_0x56835c,_0xad8724,_0x773dc4){MailAccountEvents[_0xd804('0x7')](_0x83c3d2+':'+_0x56835c['id'],_0x56835c);MailAccountEvents[_0xd804('0x7')](_0x83c3d2,_0x56835c);_0x773dc4(null);};}for(var e in events){if(events[_0xd804('0x8')](e)){var event=events[e];MailAccount[_0xd804('0x9')](e,emitEvent(event));}}module[_0xd804('0xa')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 85eebb0..e7d77d0 100644 --- a/server/api/mailAccount/mailAccount.model.js +++ b/server/api/mailAccount/mailAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f68=['CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','user','data5','pass','./mailAccount.attributes','exports','MailAccount','mail_accounts','provider','custom','service','host','Smtp','port','secure','authentication','modernAuthentication'];(function(_0x1c73ee,_0x49a9c9){var _0x154f05=function(_0x3987f1){while(--_0x3987f1){_0x1c73ee['push'](_0x1c73ee['shift']());}};_0x154f05(++_0x49a9c9);}(_0x3f68,0xbb));var _0x83f6=function(_0x1646b6,_0x79c1fc){_0x1646b6=_0x1646b6-0x0;var _0x56bd8c=_0x3f68[_0x1646b6];return _0x56bd8c;};'use strict';var attributes=require(_0x83f6('0x0'));module[_0x83f6('0x1')]=function(_0x3c915c){return _0x3c915c['define'](_0x83f6('0x2'),attributes,{'tableName':_0x83f6('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x508e01=this;var _0x439b2a={'id':_0x508e01['id'],'tls':{'rejectUnauthorized':![]}};if(_0x508e01[_0x83f6('0x4')]!==_0x83f6('0x5')){_0x439b2a[_0x83f6('0x6')]=_0x508e01[_0x83f6('0x4')];}else{_0x439b2a[_0x83f6('0x7')]=_0x508e01[_0x83f6('0x8')][_0x83f6('0x7')];_0x439b2a[_0x83f6('0x9')]=_0x508e01[_0x83f6('0x8')][_0x83f6('0x9')];_0x439b2a[_0x83f6('0xa')]=_0x508e01[_0x83f6('0x8')][_0x83f6('0xa')];}if(_0x508e01[_0x83f6('0x8')][_0x83f6('0xb')]){if(_0x508e01['Smtp'][_0x83f6('0xc')]){if(!_0x508e01[_0x83f6('0x8')][_0x83f6('0xd')])throw new Error(_0x83f6('0xe'));_0x439b2a[_0x83f6('0xf')]={'type':_0x83f6('0x10'),'user':_0x508e01['Smtp'][_0x83f6('0x11')],'accessToken':_0x508e01[_0x83f6('0x8')][_0x83f6('0xd')][_0x83f6('0x12')]};}else{_0x439b2a[_0x83f6('0xf')]={'user':_0x508e01[_0x83f6('0x8')][_0x83f6('0x11')],'pass':_0x508e01[_0x83f6('0x8')][_0x83f6('0x13')]};}}return _0x439b2a;}}});}; \ No newline at end of file +var _0xd63c=['secure','authentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','user','data5','pass','exports','define','MailAccount','mail_accounts','provider','custom','service','host','Smtp','port'];(function(_0x17d314,_0x4c6cc8){var _0x58e7d3=function(_0x33a2c3){while(--_0x33a2c3){_0x17d314['push'](_0x17d314['shift']());}};_0x58e7d3(++_0x4c6cc8);}(_0xd63c,0x113));var _0xcd63=function(_0x3f9c5d,_0x283784){_0x3f9c5d=_0x3f9c5d-0x0;var _0x2f2c73=_0xd63c[_0x3f9c5d];return _0x2f2c73;};'use strict';var attributes=require('./mailAccount.attributes');module[_0xcd63('0x0')]=function(_0x104bcd){return _0x104bcd[_0xcd63('0x1')](_0xcd63('0x2'),attributes,{'tableName':_0xcd63('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x1a4d6a=this;var _0x5445ff={'id':_0x1a4d6a['id'],'tls':{'rejectUnauthorized':![]}};if(_0x1a4d6a[_0xcd63('0x4')]!==_0xcd63('0x5')){_0x5445ff[_0xcd63('0x6')]=_0x1a4d6a[_0xcd63('0x4')];}else{_0x5445ff[_0xcd63('0x7')]=_0x1a4d6a[_0xcd63('0x8')][_0xcd63('0x7')];_0x5445ff[_0xcd63('0x9')]=_0x1a4d6a['Smtp'][_0xcd63('0x9')];_0x5445ff[_0xcd63('0xa')]=_0x1a4d6a[_0xcd63('0x8')][_0xcd63('0xa')];}if(_0x1a4d6a[_0xcd63('0x8')][_0xcd63('0xb')]){if(_0x1a4d6a[_0xcd63('0x8')]['modernAuthentication']){if(!_0x1a4d6a[_0xcd63('0x8')][_0xcd63('0xc')])throw new Error(_0xcd63('0xd'));_0x5445ff[_0xcd63('0xe')]={'type':_0xcd63('0xf'),'user':_0x1a4d6a['Smtp'][_0xcd63('0x10')],'accessToken':_0x1a4d6a[_0xcd63('0x8')][_0xcd63('0xc')][_0xcd63('0x11')]};}else{_0x5445ff['auth']={'user':_0x1a4d6a[_0xcd63('0x8')][_0xcd63('0x10')],'pass':_0x1a4d6a[_0xcd63('0x8')][_0xcd63('0x12')]};}}return _0x5445ff;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index fd1f6cf..ca25603 100644 --- a/server/api/mailAccount/mailAccount.rpc.js +++ b/server/api/mailAccount/mailAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1115=['UserId','unshift','agent','name','waitForTheAssignedAgent','queueId','MailQueue','queue','waitForTheAssignedQueue','Start','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowMailAccount','find','smtp','setDataValue','smtpOptions','NotifyMailAccount','body','mail','difference','keys','CmContact','createdAt','updatedAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','account','List','Contacts','Applications','CloudProvider','get','omit','getSmtpOptions','applications','list','orderBy','priority','asc','autoclose','push','length','close','*,*,*,*','from','List\x20not\x20found','contact','messageId','generate','subject','attach','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','inReplyTo','Contact\x20not\x20found','spread','update','format','interaction','originTo','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachments'];(function(_0x85d56d,_0x37f5c1){var _0x51f613=function(_0x4927df){while(--_0x4927df){_0x85d56d['push'](_0x85d56d['shift']());}};_0x51f613(++_0x37f5c1);}(_0x1115,0x1b6));var _0x5111=function(_0xee13c,_0x4fb4ca){_0xee13c=_0xee13c-0x0;var _0x51fee5=_0x1115[_0xee13c];return _0x51fee5;};'use strict';var _=require('lodash');var moment=require(_0x5111('0x0'));var BPromise=require(_0x5111('0x1'));var rs=require(_0x5111('0x2'));var Redis=require(_0x5111('0x3'));var db=require(_0x5111('0x4'))['db'];var logger=require(_0x5111('0x5'))(_0x5111('0x6'));var config=require(_0x5111('0x7'));var jayson=require(_0x5111('0x8'));var client=jayson['client']['http']({'port':0x232c});config[_0x5111('0x9')]=_[_0x5111('0xa')](config['redis'],{'host':_0x5111('0xb'),'port':0x18eb});var socket=require(_0x5111('0xc'))(new Redis(config['redis']));require(_0x5111('0xd'))['register'](socket);function respondWithRpcPromise(_0x2d8e0a,_0x3bbc8c,_0x4ecb50){return new BPromise(function(_0x5e12a7,_0x347d87){return client['request'](_0x2d8e0a,_0x4ecb50)[_0x5111('0xe')](function(_0x4f0b34){logger[_0x5111('0xf')](_0x5111('0x10'),_0x3bbc8c,_0x5111('0x11'));logger[_0x5111('0x12')](_0x5111('0x13'),_0x3bbc8c,_0x5111('0x11'),JSON[_0x5111('0x14')](_0x4f0b34));if(_0x4f0b34[_0x5111('0x15')]){if(_0x4f0b34[_0x5111('0x15')][_0x5111('0x16')]===0x1f4){logger[_0x5111('0x15')](_0x5111('0x10'),_0x3bbc8c,_0x4f0b34[_0x5111('0x15')][_0x5111('0x17')]);return _0x347d87(_0x4f0b34[_0x5111('0x15')][_0x5111('0x17')]);}logger[_0x5111('0x15')](_0x5111('0x10'),_0x3bbc8c,_0x4f0b34['error'][_0x5111('0x17')]);return _0x5e12a7(_0x4f0b34['error']['message']);}else{logger[_0x5111('0xf')](_0x5111('0x10'),_0x3bbc8c,_0x5111('0x11'));_0x5e12a7(_0x4f0b34['result'][_0x5111('0x17')]);}})[_0x5111('0x18')](function(_0x52c614){logger[_0x5111('0x15')](_0x5111('0x10'),_0x3bbc8c,_0x52c614);_0x347d87(_0x52c614);});});}exports[_0x5111('0x19')]=function(_0x1b3b45){var _0x5e8f1d=this;return new Promise(function(_0x52d236,_0x2a1840){return db[_0x5111('0x1a')][_0x5111('0x1b')]({'raw':_0x1b3b45[_0x5111('0x1c')]?_0x1b3b45[_0x5111('0x1c')][_0x5111('0x1d')]===undefined?!![]:![]:!![],'where':_0x1b3b45[_0x5111('0x1c')]?_0x1b3b45[_0x5111('0x1c')][_0x5111('0x1e')]||null:null,'attributes':_0x1b3b45['options']?_0x1b3b45[_0x5111('0x1c')][_0x5111('0x1f')]||null:null,'limit':_0x1b3b45[_0x5111('0x1c')]?_0x1b3b45['options'][_0x5111('0x20')]||null:null,'include':_0x1b3b45[_0x5111('0x1c')]?_0x1b3b45[_0x5111('0x1c')][_0x5111('0x21')]?_[_0x5111('0x22')](_0x1b3b45[_0x5111('0x1c')][_0x5111('0x21')],function(_0x316b39){return{'model':db[_0x316b39[_0x5111('0x23')]],'as':_0x316b39['as'],'attributes':_0x316b39[_0x5111('0x1f')],'include':_0x316b39['include']?_[_0x5111('0x22')](_0x316b39[_0x5111('0x21')],function(_0x151b67){return{'model':db[_0x151b67[_0x5111('0x23')]],'as':_0x151b67['as'],'attributes':_0x151b67[_0x5111('0x1f')],'include':_0x151b67[_0x5111('0x21')]?_[_0x5111('0x22')](_0x151b67['include'],function(_0x1ce17f){return{'model':db[_0x1ce17f[_0x5111('0x23')]],'as':_0x1ce17f['as'],'attributes':_0x1ce17f[_0x5111('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xdf9031){logger[_0x5111('0xf')](_0x5111('0x19'),_0x1b3b45);logger['debug']('GetMailAccount',_0x1b3b45,JSON[_0x5111('0x14')](_0xdf9031));_0x52d236(_0xdf9031);})['catch'](function(_0xbacf9e){logger['error'](_0x5111('0x19'),_0xbacf9e['message'],_0x1b3b45);_0x2a1840(_0x5e8f1d['error'](0x1f4,_0xbacf9e['message']));});});};exports[_0x5111('0x24')]=function(_0x3fb9a5){var _0xe0839e=this;return new Promise(function(_0x3763f4,_0x13fafe){return db[_0x5111('0x1a')][_0x5111('0x25')]({'raw':_0x3fb9a5['options']?_0x3fb9a5[_0x5111('0x1c')][_0x5111('0x1d')]===undefined?!![]:![]:!![],'where':_0x3fb9a5[_0x5111('0x1c')]?_0x3fb9a5[_0x5111('0x1c')]['where']||null:null,'attributes':_0x3fb9a5['options']?_0x3fb9a5[_0x5111('0x1c')][_0x5111('0x1f')]||null:null,'include':_0x3fb9a5[_0x5111('0x1c')]?_0x3fb9a5[_0x5111('0x1c')][_0x5111('0x21')]?_[_0x5111('0x22')](_0x3fb9a5[_0x5111('0x1c')][_0x5111('0x21')],function(_0x4d4bf5){return{'model':db[_0x4d4bf5[_0x5111('0x23')]],'as':_0x4d4bf5['as'],'attributes':_0x4d4bf5[_0x5111('0x1f')],'include':_0x4d4bf5[_0x5111('0x21')]?_['map'](_0x4d4bf5[_0x5111('0x21')],function(_0xdc5c58){return{'model':db[_0xdc5c58[_0x5111('0x23')]],'as':_0xdc5c58['as'],'attributes':_0xdc5c58['attributes'],'include':_0xdc5c58['include']?_['map'](_0xdc5c58[_0x5111('0x21')],function(_0x187cab){return{'model':db[_0x187cab[_0x5111('0x23')]],'as':_0x187cab['as'],'attributes':_0x187cab[_0x5111('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5111('0xe')](function(_0x570126){if(_0x3fb9a5[_0x5111('0x1c')][_0x5111('0x26')]===!![])_0x570126[_0x5111('0x27')](_0x5111('0x28'),_0x570126['getSmtpOptions']());logger[_0x5111('0xf')](_0x5111('0x24'),_0x3fb9a5);logger[_0x5111('0x12')](_0x5111('0x24'),_0x3fb9a5,JSON[_0x5111('0x14')](_0x570126));_0x3763f4(_0x570126);})[_0x5111('0x18')](function(_0x295d5e){logger[_0x5111('0x15')](_0x5111('0x24'),_0x295d5e[_0x5111('0x17')],_0x3fb9a5);_0x13fafe(_0xe0839e[_0x5111('0x15')](0x1f4,_0x295d5e[_0x5111('0x17')]));});});};exports[_0x5111('0x29')]=function(_0x4e0bc4){var _0x352de9=this;return new Promise(function(_0xf00f9,_0x54d2f1){var _0x2818ec={'body':_0x4e0bc4[_0x5111('0x2a')],'channel':_0x5111('0x2b')};var _0x41005f=_[_0x5111('0x2c')](_[_0x5111('0x2d')](db[_0x5111('0x2e')]['rawAttributes']),[_0x5111('0x2f'),_0x5111('0x30'),_0x5111('0x31'),_0x5111('0x32')]);var _0x96893c=![];if(_0x4e0bc4['body']['id']){delete _0x4e0bc4['body']['id'];}if(_[_0x5111('0x33')](_0x4e0bc4[_0x5111('0x2a')]['from'])){return _0x54d2f1(_0x352de9[_0x5111('0x15')](0x1f4,_0x5111('0x34')));}if(_[_0x5111('0x33')](_0x4e0bc4[_0x5111('0x2a')][_0x5111('0x2a')])||_0x4e0bc4[_0x5111('0x2a')][_0x5111('0x2a')]===''){return _0x54d2f1(_0x352de9[_0x5111('0x15')](0x1f4,_0x5111('0x35')));}if(_[_0x5111('0x33')](_0x4e0bc4['body']['mapKey'])){return _0x54d2f1(_0x352de9[_0x5111('0x15')](0x1f4,_0x5111('0x36')+_0x41005f));}if(!_[_0x5111('0x37')](_0x41005f,_0x4e0bc4[_0x5111('0x2a')][_0x5111('0x38')])){return _0x54d2f1(_0x352de9[_0x5111('0x15')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x41005f));}var _0x1b9a74={};_0x1b9a74[_0x4e0bc4[_0x5111('0x2a')][_0x5111('0x38')]]=_0x4e0bc4[_0x5111('0x2a')]['from'];return db[_0x5111('0x1a')][_0x5111('0x25')]({'where':{'id':_0x4e0bc4[_0x5111('0x39')]['id']},'include':[{'model':db['CmList'],'as':_0x5111('0x3a'),'include':[{'model':db[_0x5111('0x2e')],'as':_0x5111('0x3b'),'where':_0x1b9a74,'limit':0x1,'order':[[_0x5111('0x30'),'DESC']]}]},{'model':db['MailApplication'],'as':_0x5111('0x3c')},{'model':db['MailServerOut'],'as':'Smtp','include':[{'model':db[_0x5111('0x3d')],'as':_0x5111('0x3d')}]}]})['then'](function(_0x296f87){if(_0x296f87&&_0x296f87[_0x5111('0x3a')]){var _0x1676f9=_0x296f87[_0x5111('0x3e')]({'plain':!![]});_0x2818ec[_0x5111('0x39')]=_[_0x5111('0x3f')](_0x1676f9,[_0x5111('0x3c'),_0x5111('0x3a')]);_0x2818ec[_0x5111('0x39')][_0x5111('0x28')]=_0x296f87[_0x5111('0x40')]();_0x2818ec[_0x5111('0x41')]=_0x1676f9['Applications'];_0x2818ec[_0x5111('0x42')]=_0x1676f9[_0x5111('0x3a')];_0x2818ec[_0x5111('0x41')]=_[_0x5111('0x43')](_0x2818ec[_0x5111('0x41')],[_0x5111('0x44')],[_0x5111('0x45')]);if(_0x2818ec['account']&&_0x2818ec['account'][_0x5111('0x46')]){_0x2818ec['applications'][_0x5111('0x47')]({'id':0x0,'priority':_0x2818ec[_0x5111('0x41')][_0x5111('0x48')]+0x1,'app':_0x5111('0x49'),'appdata':_0x5111('0x46'),'interval':_0x5111('0x4a')});}if(_0x2818ec[_0x5111('0x39')]['Applications']){delete _0x2818ec[_0x5111('0x39')][_0x5111('0x3c')];}if(_0x2818ec['account'][_0x5111('0x3a')]){delete _0x2818ec[_0x5111('0x39')]['List'];}if(_0x1676f9[_0x5111('0x3a')]['Contacts']['length']){return _0x1676f9['List'][_0x5111('0x3b')][0x0];}var _0x30fb6d=_[_0x5111('0xa')](_0x4e0bc4[_0x5111('0x2a')],{'firstName':_0x4e0bc4['body'][_0x5111('0x4b')],'ListId':_0x1676f9[_0x5111('0x32')]});_0x30fb6d[_0x4e0bc4[_0x5111('0x2a')]['mapKey']]=_0x4e0bc4[_0x5111('0x2a')][_0x5111('0x4b')];return db[_0x5111('0x2e')]['create'](_0x30fb6d);}else{throw new Error(_0x5111('0x4c'));}})['then'](function(_0x3bf42d){_0x2818ec[_0x5111('0x4d')]=_0x3bf42d;if(_0x3bf42d){if(!_0x4e0bc4[_0x5111('0x2a')][_0x5111('0x17')]['messageId']){_0x4e0bc4[_0x5111('0x2a')][_0x5111('0x17')][_0x5111('0x4e')]=rs[_0x5111('0x4f')]()+'\x20'+_0x4e0bc4[_0x5111('0x2a')][_0x5111('0x17')][_0x5111('0x4b')];}var _0x54c415={'ContactId':_0x3bf42d['id'],'MailAccountId':_0x4e0bc4[_0x5111('0x39')]['id'],'inReplyTo':_0x4e0bc4['body'][_0x5111('0x17')][_0x5111('0x4e')],'to':_0x4e0bc4[_0x5111('0x2a')][_0x5111('0x17')][_0x5111('0x4b')],'cc':_0x4e0bc4[_0x5111('0x2a')]['message']['cc'],'subject':_0x4e0bc4[_0x5111('0x2a')][_0x5111('0x17')][_0x5111('0x50')],'attach':_0x4e0bc4[_0x5111('0x2a')][_0x5111('0x17')][_0x5111('0x51')],'lastMsgAt':moment()['format'](_0x5111('0x52')),'lastMsgDirection':'in'};return db[_0x5111('0x53')][_0x5111('0x25')]({'where':{'closed':![],'MailAccountId':_0x4e0bc4[_0x5111('0x39')]['id']},'include':[{'model':db[_0x5111('0x54')],'as':'Messages','attributes':[_0x5111('0x4e')],'where':{'messageId':_0x4e0bc4[_0x5111('0x2a')][_0x5111('0x17')][_0x5111('0x55')]}}]})[_0x5111('0xe')](function(_0x39de80){if(_0x39de80){return[_0x39de80,![]];}return db[_0x5111('0x53')]['create'](_0x54c415)['then'](function(_0x4eaed9){return[_0x4eaed9,!![]];});});}else{throw new Error(_0x5111('0x56'));}})[_0x5111('0x57')](function(_0x1674d6,_0x3fb713){if(_0x1674d6){_0x96893c=_0x3fb713;if(!_0x3fb713){return _0x1674d6[_0x5111('0x58')]({'inReplyTo':_0x4e0bc4['body'][_0x5111('0x17')][_0x5111('0x4e')],'to':_0x4e0bc4[_0x5111('0x2a')][_0x5111('0x17')][_0x5111('0x4b')],'cc':_0x4e0bc4[_0x5111('0x2a')][_0x5111('0x17')]['cc'],'subject':_0x4e0bc4[_0x5111('0x2a')][_0x5111('0x17')][_0x5111('0x50')],'attach':_0x1674d6['attach']?_0x1674d6[_0x5111('0x51')]:_0x4e0bc4[_0x5111('0x2a')]['message'][_0x5111('0x51')],'substatus':null,'substatusAt':moment()[_0x5111('0x59')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x5111('0x59')](_0x5111('0x52')),'lastMsgDirection':'in'});}else{return _0x1674d6;}}})[_0x5111('0xe')](function(_0x3a7cc9){_0x2818ec[_0x5111('0x5a')]=_0x3a7cc9[_0x5111('0x3e')]({'plain':!![]});_0x2818ec[_0x5111('0x5a')]['created']=_0x96893c;return db[_0x5111('0x54')]['create']({'body':_0x4e0bc4['body'][_0x5111('0x2a')],'MailAccountId':_0x4e0bc4['account']['id'],'MailInteractionId':_0x3a7cc9['id'],'direction':'in','ContactId':_0x2818ec[_0x5111('0x4d')]['id'],'messageId':_0x4e0bc4['body'][_0x5111('0x17')][_0x5111('0x4e')],'from':_0x4e0bc4[_0x5111('0x2a')][_0x5111('0x17')][_0x5111('0x4b')],'to':_0x4e0bc4[_0x5111('0x2a')][_0x5111('0x17')]['to'],'cc':_0x4e0bc4[_0x5111('0x2a')][_0x5111('0x17')]['cc'],'subject':_0x4e0bc4[_0x5111('0x2a')][_0x5111('0x17')][_0x5111('0x50')],'attach':_0x4e0bc4[_0x5111('0x2a')]['message'][_0x5111('0x51')],'Attachments':_0x4e0bc4['body'][_0x5111('0x17')]['attachments'],'originTo':_0x4e0bc4[_0x5111('0x2a')][_0x5111('0x17')][_0x5111('0x5b')],'originCc':_0x4e0bc4[_0x5111('0x2a')][_0x5111('0x17')]['originCc'],'bcc':_0x4e0bc4['body'][_0x5111('0x17')]['bcc'],'ChatWebsiteId':_0x4e0bc4['body'][_0x5111('0x17')][_0x5111('0x5c')]||null,'originChannel':_0x4e0bc4[_0x5111('0x2a')][_0x5111('0x17')][_0x5111('0x5d')]||_0x5111('0x5e'),'ChatOfflineMessageId':_0x4e0bc4['body'][_0x5111('0x17')][_0x5111('0x5f')]||null},{'include':[{'model':db['Attachment'],'as':_0x5111('0x60')}]});})['then'](function(_0x1ffb56){_0x2818ec[_0x5111('0x17')]=_0x1ffb56;if(!_0x2818ec[_0x5111('0x5a')][_0x5111('0x61')]){return;}return db['User'][_0x5111('0x25')]({'attributes':['id','name'],'where':{'id':_0x2818ec[_0x5111('0x5a')]['UserId']}});})[_0x5111('0xe')](function(_0x335919){if(_0x335919){_0x2818ec[_0x5111('0x41')][_0x5111('0x62')]({'id':0x0,'priority':0x0,'app':_0x5111('0x63'),'appdata':_0x335919[_0x5111('0x64')]+','+(_0x2818ec[_0x5111('0x39')][_0x5111('0x65')]||0xa),'interval':'*,*,*,*'});}if(!_0x2818ec[_0x5111('0x5a')][_0x5111('0x66')]){return;}return db[_0x5111('0x67')][_0x5111('0x25')]({'attributes':['id',_0x5111('0x64')],'where':{'id':_0x2818ec['interaction'][_0x5111('0x66')]}});})[_0x5111('0xe')](function(_0x5d2772){if(_0x5d2772){_0x2818ec[_0x5111('0x41')][_0x5111('0x62')]({'id':0x0,'priority':0x1,'app':_0x5111('0x68'),'appdata':_0x5d2772['name']+','+(_0x2818ec[_0x5111('0x39')][_0x5111('0x69')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x5111('0x6a'),'startRouting',_0x2818ec);})[_0x5111('0xe')](function(_0x5dcc50){_0xf00f9(_0x5dcc50);})[_0x5111('0x18')](function(_0x44b7ff){_0x54d2f1(_0x352de9[_0x5111('0x15')](0x1f4,_0x44b7ff[_0x5111('0x17')]));});});}; \ No newline at end of file +var _0xcf98=['create','List\x20not\x20found','messageId','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inReplyTo','Contact\x20not\x20found','update','subject','attach','interaction','contact','attachments','originTo','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachments','UserId','User','name','unshift','agent','waitForTheAssignedAgent','queueId','MailQueue','queue','waitForTheAssignedQueue','Start','startRouting','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','code','error','message','result','catch','GetMailAccount','findAll','options','raw','where','attributes','include','model','map','ShowMailAccount','MailAccount','find','smtp','smtpOptions','stringify','NotifyMailAccount','body','mail','difference','keys','CmContact','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','account','CmList','DESC','MailApplication','Applications','MailServerOut','Smtp','CloudProvider','List','get','omit','applications','orderBy','priority','autoclose','push','length','*,*,*,*','Contacts'];(function(_0x5a3a72,_0x4d4f0d){var _0x30ded5=function(_0x2e32ae){while(--_0x2e32ae){_0x5a3a72['push'](_0x5a3a72['shift']());}};_0x30ded5(++_0x4d4f0d);}(_0xcf98,0x8d));var _0x8cf9=function(_0x201548,_0x13673d){_0x201548=_0x201548-0x0;var _0x3b7b50=_0xcf98[_0x201548];return _0x3b7b50;};'use strict';var _=require('lodash');var moment=require(_0x8cf9('0x0'));var BPromise=require(_0x8cf9('0x1'));var rs=require(_0x8cf9('0x2'));var Redis=require(_0x8cf9('0x3'));var db=require(_0x8cf9('0x4'))['db'];var logger=require('../../config/logger')('rpc');var config=require(_0x8cf9('0x5'));var jayson=require(_0x8cf9('0x6'));var client=jayson[_0x8cf9('0x7')][_0x8cf9('0x8')]({'port':0x232c});config[_0x8cf9('0x9')]=_[_0x8cf9('0xa')](config[_0x8cf9('0x9')],{'host':_0x8cf9('0xb'),'port':0x18eb});var socket=require(_0x8cf9('0xc'))(new Redis(config[_0x8cf9('0x9')]));require(_0x8cf9('0xd'))['register'](socket);function respondWithRpcPromise(_0x2c9b72,_0x982c65,_0x4f4ab3){return new BPromise(function(_0xfe2da1,_0x5b9daa){return client[_0x8cf9('0xe')](_0x2c9b72,_0x4f4ab3)[_0x8cf9('0xf')](function(_0x1af7e4){logger[_0x8cf9('0x10')](_0x8cf9('0x11'),_0x982c65,_0x8cf9('0x12'));logger[_0x8cf9('0x13')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x982c65,_0x8cf9('0x12'),JSON['stringify'](_0x1af7e4));if(_0x1af7e4['error']){if(_0x1af7e4['error'][_0x8cf9('0x14')]===0x1f4){logger['error']('MailAccount,\x20%s,\x20%s',_0x982c65,_0x1af7e4[_0x8cf9('0x15')][_0x8cf9('0x16')]);return _0x5b9daa(_0x1af7e4[_0x8cf9('0x15')]['message']);}logger[_0x8cf9('0x15')](_0x8cf9('0x11'),_0x982c65,_0x1af7e4['error'][_0x8cf9('0x16')]);return _0xfe2da1(_0x1af7e4[_0x8cf9('0x15')][_0x8cf9('0x16')]);}else{logger[_0x8cf9('0x10')](_0x8cf9('0x11'),_0x982c65,_0x8cf9('0x12'));_0xfe2da1(_0x1af7e4[_0x8cf9('0x17')][_0x8cf9('0x16')]);}})[_0x8cf9('0x18')](function(_0x3a13b7){logger[_0x8cf9('0x15')](_0x8cf9('0x11'),_0x982c65,_0x3a13b7);_0x5b9daa(_0x3a13b7);});});}exports[_0x8cf9('0x19')]=function(_0x44e6d7){var _0xe0cda=this;return new Promise(function(_0x3a6a21,_0x5d54d4){return db['MailAccount'][_0x8cf9('0x1a')]({'raw':_0x44e6d7['options']?_0x44e6d7[_0x8cf9('0x1b')][_0x8cf9('0x1c')]===undefined?!![]:![]:!![],'where':_0x44e6d7[_0x8cf9('0x1b')]?_0x44e6d7[_0x8cf9('0x1b')][_0x8cf9('0x1d')]||null:null,'attributes':_0x44e6d7[_0x8cf9('0x1b')]?_0x44e6d7[_0x8cf9('0x1b')][_0x8cf9('0x1e')]||null:null,'limit':_0x44e6d7['options']?_0x44e6d7[_0x8cf9('0x1b')]['limit']||null:null,'include':_0x44e6d7['options']?_0x44e6d7[_0x8cf9('0x1b')][_0x8cf9('0x1f')]?_['map'](_0x44e6d7[_0x8cf9('0x1b')]['include'],function(_0x4d07fa){return{'model':db[_0x4d07fa[_0x8cf9('0x20')]],'as':_0x4d07fa['as'],'attributes':_0x4d07fa[_0x8cf9('0x1e')],'include':_0x4d07fa['include']?_[_0x8cf9('0x21')](_0x4d07fa[_0x8cf9('0x1f')],function(_0x170414){return{'model':db[_0x170414[_0x8cf9('0x20')]],'as':_0x170414['as'],'attributes':_0x170414[_0x8cf9('0x1e')],'include':_0x170414['include']?_['map'](_0x170414[_0x8cf9('0x1f')],function(_0x30f245){return{'model':db[_0x30f245[_0x8cf9('0x20')]],'as':_0x30f245['as'],'attributes':_0x30f245[_0x8cf9('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8cf9('0xf')](function(_0x3b1784){logger[_0x8cf9('0x10')](_0x8cf9('0x19'),_0x44e6d7);logger[_0x8cf9('0x13')]('GetMailAccount',_0x44e6d7,JSON['stringify'](_0x3b1784));_0x3a6a21(_0x3b1784);})[_0x8cf9('0x18')](function(_0x5123d5){logger[_0x8cf9('0x15')](_0x8cf9('0x19'),_0x5123d5[_0x8cf9('0x16')],_0x44e6d7);_0x5d54d4(_0xe0cda[_0x8cf9('0x15')](0x1f4,_0x5123d5['message']));});});};exports[_0x8cf9('0x22')]=function(_0x3b313a){var _0x2db180=this;return new Promise(function(_0xd4f300,_0xa434c0){return db[_0x8cf9('0x23')][_0x8cf9('0x24')]({'raw':_0x3b313a['options']?_0x3b313a['options'][_0x8cf9('0x1c')]===undefined?!![]:![]:!![],'where':_0x3b313a[_0x8cf9('0x1b')]?_0x3b313a[_0x8cf9('0x1b')][_0x8cf9('0x1d')]||null:null,'attributes':_0x3b313a[_0x8cf9('0x1b')]?_0x3b313a[_0x8cf9('0x1b')]['attributes']||null:null,'include':_0x3b313a[_0x8cf9('0x1b')]?_0x3b313a[_0x8cf9('0x1b')][_0x8cf9('0x1f')]?_[_0x8cf9('0x21')](_0x3b313a[_0x8cf9('0x1b')][_0x8cf9('0x1f')],function(_0x1d37a3){return{'model':db[_0x1d37a3[_0x8cf9('0x20')]],'as':_0x1d37a3['as'],'attributes':_0x1d37a3['attributes'],'include':_0x1d37a3[_0x8cf9('0x1f')]?_[_0x8cf9('0x21')](_0x1d37a3[_0x8cf9('0x1f')],function(_0x4b9cb8){return{'model':db[_0x4b9cb8[_0x8cf9('0x20')]],'as':_0x4b9cb8['as'],'attributes':_0x4b9cb8['attributes'],'include':_0x4b9cb8[_0x8cf9('0x1f')]?_['map'](_0x4b9cb8[_0x8cf9('0x1f')],function(_0x5a577d){return{'model':db[_0x5a577d[_0x8cf9('0x20')]],'as':_0x5a577d['as'],'attributes':_0x5a577d['attributes']};}):[]};}):[]};}):[]:[]})[_0x8cf9('0xf')](function(_0x5c1fcc){if(_0x3b313a['options'][_0x8cf9('0x25')]===!![])_0x5c1fcc['setDataValue'](_0x8cf9('0x26'),_0x5c1fcc['getSmtpOptions']());logger[_0x8cf9('0x10')]('ShowMailAccount',_0x3b313a);logger[_0x8cf9('0x13')](_0x8cf9('0x22'),_0x3b313a,JSON[_0x8cf9('0x27')](_0x5c1fcc));_0xd4f300(_0x5c1fcc);})[_0x8cf9('0x18')](function(_0x412764){logger[_0x8cf9('0x15')](_0x8cf9('0x22'),_0x412764[_0x8cf9('0x16')],_0x3b313a);_0xa434c0(_0x2db180[_0x8cf9('0x15')](0x1f4,_0x412764[_0x8cf9('0x16')]));});});};exports[_0x8cf9('0x28')]=function(_0xf25048){var _0x11dcfb=this;return new Promise(function(_0x21c15f,_0x4b5c2e){var _0x2d4b14={'body':_0xf25048[_0x8cf9('0x29')],'channel':_0x8cf9('0x2a')};var _0x13fde7=_[_0x8cf9('0x2b')](_[_0x8cf9('0x2c')](db[_0x8cf9('0x2d')]['rawAttributes']),[_0x8cf9('0x2e'),_0x8cf9('0x2f'),_0x8cf9('0x30'),_0x8cf9('0x31')]);var _0x5785dd=![];if(_0xf25048[_0x8cf9('0x29')]['id']){delete _0xf25048[_0x8cf9('0x29')]['id'];}if(_[_0x8cf9('0x32')](_0xf25048[_0x8cf9('0x29')][_0x8cf9('0x33')])){return _0x4b5c2e(_0x11dcfb[_0x8cf9('0x15')](0x1f4,_0x8cf9('0x34')));}if(_['isNil'](_0xf25048[_0x8cf9('0x29')][_0x8cf9('0x29')])||_0xf25048[_0x8cf9('0x29')][_0x8cf9('0x29')]===''){return _0x4b5c2e(_0x11dcfb['error'](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x8cf9('0x32')](_0xf25048[_0x8cf9('0x29')]['mapKey'])){return _0x4b5c2e(_0x11dcfb[_0x8cf9('0x15')](0x1f4,_0x8cf9('0x35')+_0x13fde7));}if(!_[_0x8cf9('0x36')](_0x13fde7,_0xf25048[_0x8cf9('0x29')][_0x8cf9('0x37')])){return _0x4b5c2e(_0x11dcfb[_0x8cf9('0x15')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x13fde7));}var _0x503c3f={};_0x503c3f[_0xf25048[_0x8cf9('0x29')]['mapKey']]=_0xf25048[_0x8cf9('0x29')][_0x8cf9('0x33')];return db[_0x8cf9('0x23')]['find']({'where':{'id':_0xf25048[_0x8cf9('0x38')]['id']},'include':[{'model':db[_0x8cf9('0x39')],'as':'List','include':[{'model':db[_0x8cf9('0x2d')],'as':'Contacts','where':_0x503c3f,'limit':0x1,'order':[['updatedAt',_0x8cf9('0x3a')]]}]},{'model':db[_0x8cf9('0x3b')],'as':_0x8cf9('0x3c')},{'model':db[_0x8cf9('0x3d')],'as':_0x8cf9('0x3e'),'include':[{'model':db[_0x8cf9('0x3f')],'as':_0x8cf9('0x3f')}]}]})['then'](function(_0x40f59e){if(_0x40f59e&&_0x40f59e[_0x8cf9('0x40')]){var _0x4455a2=_0x40f59e[_0x8cf9('0x41')]({'plain':!![]});_0x2d4b14['account']=_[_0x8cf9('0x42')](_0x4455a2,[_0x8cf9('0x3c'),_0x8cf9('0x40')]);_0x2d4b14['account']['smtpOptions']=_0x40f59e['getSmtpOptions']();_0x2d4b14[_0x8cf9('0x43')]=_0x4455a2[_0x8cf9('0x3c')];_0x2d4b14['list']=_0x4455a2[_0x8cf9('0x40')];_0x2d4b14[_0x8cf9('0x43')]=_[_0x8cf9('0x44')](_0x2d4b14[_0x8cf9('0x43')],[_0x8cf9('0x45')],['asc']);if(_0x2d4b14[_0x8cf9('0x38')]&&_0x2d4b14[_0x8cf9('0x38')][_0x8cf9('0x46')]){_0x2d4b14[_0x8cf9('0x43')][_0x8cf9('0x47')]({'id':0x0,'priority':_0x2d4b14[_0x8cf9('0x43')][_0x8cf9('0x48')]+0x1,'app':'close','appdata':_0x8cf9('0x46'),'interval':_0x8cf9('0x49')});}if(_0x2d4b14[_0x8cf9('0x38')][_0x8cf9('0x3c')]){delete _0x2d4b14[_0x8cf9('0x38')][_0x8cf9('0x3c')];}if(_0x2d4b14[_0x8cf9('0x38')][_0x8cf9('0x40')]){delete _0x2d4b14[_0x8cf9('0x38')][_0x8cf9('0x40')];}if(_0x4455a2[_0x8cf9('0x40')][_0x8cf9('0x4a')][_0x8cf9('0x48')]){return _0x4455a2['List'][_0x8cf9('0x4a')][0x0];}var _0x3d24b7=_['defaults'](_0xf25048[_0x8cf9('0x29')],{'firstName':_0xf25048[_0x8cf9('0x29')][_0x8cf9('0x33')],'ListId':_0x4455a2[_0x8cf9('0x31')]});_0x3d24b7[_0xf25048[_0x8cf9('0x29')][_0x8cf9('0x37')]]=_0xf25048[_0x8cf9('0x29')][_0x8cf9('0x33')];return db[_0x8cf9('0x2d')][_0x8cf9('0x4b')](_0x3d24b7);}else{throw new Error(_0x8cf9('0x4c'));}})['then'](function(_0x1e8f0e){_0x2d4b14['contact']=_0x1e8f0e;if(_0x1e8f0e){if(!_0xf25048['body'][_0x8cf9('0x16')][_0x8cf9('0x4d')]){_0xf25048['body'][_0x8cf9('0x16')][_0x8cf9('0x4d')]=rs['generate']()+'\x20'+_0xf25048[_0x8cf9('0x29')][_0x8cf9('0x16')][_0x8cf9('0x33')];}var _0x456ce0={'ContactId':_0x1e8f0e['id'],'MailAccountId':_0xf25048[_0x8cf9('0x38')]['id'],'inReplyTo':_0xf25048[_0x8cf9('0x29')]['message'][_0x8cf9('0x4d')],'to':_0xf25048['body'][_0x8cf9('0x16')]['from'],'cc':_0xf25048['body'][_0x8cf9('0x16')]['cc'],'subject':_0xf25048['body'][_0x8cf9('0x16')]['subject'],'attach':_0xf25048[_0x8cf9('0x29')][_0x8cf9('0x16')]['attach'],'lastMsgAt':moment()[_0x8cf9('0x4e')](_0x8cf9('0x4f')),'lastMsgDirection':'in'};return db['MailInteraction']['find']({'where':{'closed':![],'MailAccountId':_0xf25048[_0x8cf9('0x38')]['id']},'include':[{'model':db[_0x8cf9('0x50')],'as':'Messages','attributes':[_0x8cf9('0x4d')],'where':{'messageId':_0xf25048[_0x8cf9('0x29')]['message'][_0x8cf9('0x51')]}}]})[_0x8cf9('0xf')](function(_0x528292){if(_0x528292){return[_0x528292,![]];}return db['MailInteraction'][_0x8cf9('0x4b')](_0x456ce0)[_0x8cf9('0xf')](function(_0x18b3f7){return[_0x18b3f7,!![]];});});}else{throw new Error(_0x8cf9('0x52'));}})['spread'](function(_0x31cf62,_0x5fc6fe){if(_0x31cf62){_0x5785dd=_0x5fc6fe;if(!_0x5fc6fe){return _0x31cf62[_0x8cf9('0x53')]({'inReplyTo':_0xf25048['body']['message'][_0x8cf9('0x4d')],'to':_0xf25048['body'][_0x8cf9('0x16')][_0x8cf9('0x33')],'cc':_0xf25048[_0x8cf9('0x29')][_0x8cf9('0x16')]['cc'],'subject':_0xf25048['body']['message'][_0x8cf9('0x54')],'attach':_0x31cf62[_0x8cf9('0x55')]?_0x31cf62['attach']:_0xf25048['body'][_0x8cf9('0x16')][_0x8cf9('0x55')],'substatus':null,'substatusAt':moment()[_0x8cf9('0x4e')](_0x8cf9('0x4f')),'lastMsgAt':moment()[_0x8cf9('0x4e')](_0x8cf9('0x4f')),'lastMsgDirection':'in'});}else{return _0x31cf62;}}})[_0x8cf9('0xf')](function(_0x5ce938){_0x2d4b14['interaction']=_0x5ce938['get']({'plain':!![]});_0x2d4b14[_0x8cf9('0x56')]['created']=_0x5785dd;return db['MailMessage']['create']({'body':_0xf25048['body'][_0x8cf9('0x29')],'MailAccountId':_0xf25048[_0x8cf9('0x38')]['id'],'MailInteractionId':_0x5ce938['id'],'direction':'in','ContactId':_0x2d4b14[_0x8cf9('0x57')]['id'],'messageId':_0xf25048[_0x8cf9('0x29')]['message'][_0x8cf9('0x4d')],'from':_0xf25048['body']['message'][_0x8cf9('0x33')],'to':_0xf25048['body'][_0x8cf9('0x16')]['to'],'cc':_0xf25048[_0x8cf9('0x29')][_0x8cf9('0x16')]['cc'],'subject':_0xf25048['body'][_0x8cf9('0x16')]['subject'],'attach':_0xf25048[_0x8cf9('0x29')][_0x8cf9('0x16')][_0x8cf9('0x55')],'Attachments':_0xf25048[_0x8cf9('0x29')][_0x8cf9('0x16')][_0x8cf9('0x58')],'originTo':_0xf25048[_0x8cf9('0x29')][_0x8cf9('0x16')][_0x8cf9('0x59')],'originCc':_0xf25048['body'][_0x8cf9('0x16')]['originCc'],'bcc':_0xf25048[_0x8cf9('0x29')][_0x8cf9('0x16')][_0x8cf9('0x5a')],'ChatWebsiteId':_0xf25048[_0x8cf9('0x29')][_0x8cf9('0x16')][_0x8cf9('0x5b')]||null,'originChannel':_0xf25048[_0x8cf9('0x29')][_0x8cf9('0x16')][_0x8cf9('0x5c')]||_0x8cf9('0x5d'),'ChatOfflineMessageId':_0xf25048[_0x8cf9('0x29')][_0x8cf9('0x16')][_0x8cf9('0x5e')]||null},{'include':[{'model':db['Attachment'],'as':_0x8cf9('0x5f')}]});})[_0x8cf9('0xf')](function(_0x420584){_0x2d4b14[_0x8cf9('0x16')]=_0x420584;if(!_0x2d4b14[_0x8cf9('0x56')][_0x8cf9('0x60')]){return;}return db[_0x8cf9('0x61')]['find']({'attributes':['id',_0x8cf9('0x62')],'where':{'id':_0x2d4b14[_0x8cf9('0x56')][_0x8cf9('0x60')]}});})['then'](function(_0x5ea136){if(_0x5ea136){_0x2d4b14[_0x8cf9('0x43')][_0x8cf9('0x63')]({'id':0x0,'priority':0x0,'app':_0x8cf9('0x64'),'appdata':_0x5ea136[_0x8cf9('0x62')]+','+(_0x2d4b14[_0x8cf9('0x38')][_0x8cf9('0x65')]||0xa),'interval':'*,*,*,*'});}if(!_0x2d4b14['interaction'][_0x8cf9('0x66')]){return;}return db[_0x8cf9('0x67')][_0x8cf9('0x24')]({'attributes':['id','name'],'where':{'id':_0x2d4b14[_0x8cf9('0x56')][_0x8cf9('0x66')]}});})[_0x8cf9('0xf')](function(_0x4641dc){if(_0x4641dc){_0x2d4b14[_0x8cf9('0x43')][_0x8cf9('0x63')]({'id':0x0,'priority':0x1,'app':_0x8cf9('0x68'),'appdata':_0x4641dc[_0x8cf9('0x62')]+','+(_0x2d4b14[_0x8cf9('0x38')][_0x8cf9('0x69')]||0x12c),'interval':_0x8cf9('0x49')});}return respondWithRpcPromise(_0x8cf9('0x6a'),_0x8cf9('0x6b'),_0x2d4b14);})['then'](function(_0x234e21){_0x21c15f(_0x234e21);})[_0x8cf9('0x18')](function(_0xa28cda){_0x4b5c2e(_0x11dcfb[_0x8cf9('0x15')](0x1f4,_0xa28cda['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index b81cc2d..ea84a7b 100644 --- a/server/api/mailAccount/mailAccount.socket.js +++ b/server/api/mailAccount/mailAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc916=['removeListener','register','length','mailAccount:','remove','update'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xc916,0x1d2));var _0x6c91=function(_0x3f8a03,_0x319b9c){_0x3f8a03=_0x3f8a03-0x0;var _0x147fb2=_0xc916[_0x3f8a03];return _0x147fb2;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=['save',_0x6c91('0x0'),_0x6c91('0x1')];function createListener(_0x263cba,_0x41a0dc){return function(_0x3a9abd){_0x41a0dc['emit'](_0x263cba,_0x3a9abd);};}function removeListener(_0x1beace,_0x3c946f){return function(){MailAccountEvents[_0x6c91('0x2')](_0x1beace,_0x3c946f);};}exports[_0x6c91('0x3')]=function(_0x470f43){for(var _0x110132=0x0,_0x3b8290=events[_0x6c91('0x4')];_0x110132<_0x3b8290;_0x110132++){var _0x440ae4=events[_0x110132];var _0x3e1262=createListener(_0x6c91('0x5')+_0x440ae4,_0x470f43);MailAccountEvents['on'](_0x440ae4,_0x3e1262);}}; \ No newline at end of file +var _0x213c=['removeListener','register','length','mailAccount:','./mailAccount.events','remove','update','emit'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0x213c,0xc4));var _0xc213=function(_0x297fcb,_0x45ca05){_0x297fcb=_0x297fcb-0x0;var _0x465561=_0x213c[_0x297fcb];return _0x465561;};'use strict';var MailAccountEvents=require(_0xc213('0x0'));var events=['save',_0xc213('0x1'),_0xc213('0x2')];function createListener(_0x496ac1,_0x2714bb){return function(_0x3e68ee){_0x2714bb[_0xc213('0x3')](_0x496ac1,_0x3e68ee);};}function removeListener(_0x2a25ff,_0x3503de){return function(){MailAccountEvents[_0xc213('0x4')](_0x2a25ff,_0x3503de);};}exports[_0xc213('0x5')]=function(_0x48b853){for(var _0x3a8d56=0x0,_0x296daf=events[_0xc213('0x6')];_0x3a8d56<_0x296daf;_0x3a8d56++){var _0x1718f9=events[_0x3a8d56];var _0x137ff3=createListener(_0xc213('0x7')+_0x1718f9,_0x48b853);MailAccountEvents['on'](_0x1718f9,_0x137ff3);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index f61b8fa..84323cc 100644 --- a/server/api/mailApplication/index.js +++ b/server/api/mailApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3af1=['./mailApplication.controller','get','isAuthenticated','show','put','/:id','update','delete','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x3af1,0xd5));var _0x13af=function(_0x4637a1,_0x161fae){_0x4637a1=_0x4637a1-0x0;var _0x1d80bf=_0x3af1[_0x4637a1];return _0x1d80bf;};'use strict';var multer=require('multer');var util=require(_0x13af('0x0'));var path=require('path');var timeout=require(_0x13af('0x1'));var express=require(_0x13af('0x2'));var router=express[_0x13af('0x3')]();var fs_extra=require(_0x13af('0x4'));var auth=require(_0x13af('0x5'));var interaction=require(_0x13af('0x6'));var config=require(_0x13af('0x7'));var controller=require(_0x13af('0x8'));router[_0x13af('0x9')]('/:id',auth[_0x13af('0xa')](),controller[_0x13af('0xb')]);router[_0x13af('0xc')](_0x13af('0xd'),auth[_0x13af('0xa')](),controller[_0x13af('0xe')]);router[_0x13af('0xf')]('/:id',auth[_0x13af('0xa')](),controller[_0x13af('0x10')]);module['exports']=router; \ No newline at end of file +var _0xc5fc=['../../config/environment','./mailApplication.controller','/:id','isAuthenticated','show','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3ab5b1,_0x1307b1){var _0x4f1ff1=function(_0x368285){while(--_0x368285){_0x3ab5b1['push'](_0x3ab5b1['shift']());}};_0x4f1ff1(++_0x1307b1);}(_0xc5fc,0xe9));var _0xcc5f=function(_0x56d839,_0x4de689){_0x56d839=_0x56d839-0x0;var _0x6959ac=_0xc5fc[_0x56d839];return _0x6959ac;};'use strict';var multer=require(_0xcc5f('0x0'));var util=require(_0xcc5f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcc5f('0x2'));var router=express[_0xcc5f('0x3')]();var fs_extra=require(_0xcc5f('0x4'));var auth=require(_0xcc5f('0x5'));var interaction=require(_0xcc5f('0x6'));var config=require(_0xcc5f('0x7'));var controller=require(_0xcc5f('0x8'));router['get'](_0xcc5f('0x9'),auth[_0xcc5f('0xa')](),controller[_0xcc5f('0xb')]);router['put'](_0xcc5f('0x9'),auth['isAuthenticated'](),controller[_0xcc5f('0xc')]);router[_0xcc5f('0xd')](_0xcc5f('0x9'),auth[_0xcc5f('0xa')](),controller[_0xcc5f('0xe')]);module[_0xcc5f('0xf')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 6ab6fb4..797867d 100644 --- a/server/api/mailApplication/mailApplication.attributes.js +++ b/server/api/mailApplication/mailApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2230=['INTEGER','STRING','noop','TEXT','*,*,*,*','exports'];(function(_0x5764e7,_0x332961){var _0x51a13f=function(_0x3be68d){while(--_0x3be68d){_0x5764e7['push'](_0x5764e7['shift']());}};_0x51a13f(++_0x332961);}(_0x2230,0xfb));var _0x0223=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2230[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x0223('0x0')]={'priority':{'type':Sequelize[_0x0223('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x0223('0x2')],'allowNull':![],'defaultValue':_0x0223('0x3')},'appdata':{'type':Sequelize[_0x0223('0x4')]()},'description':{'type':Sequelize[_0x0223('0x2')]},'interval':{'type':Sequelize[_0x0223('0x2')],'defaultValue':_0x0223('0x5')}}; \ No newline at end of file +var _0x7b50=['STRING','noop','TEXT','*,*,*,*','exports','INTEGER'];(function(_0x410918,_0x5d4ee0){var _0x4151e6=function(_0x437058){while(--_0x437058){_0x410918['push'](_0x410918['shift']());}};_0x4151e6(++_0x5d4ee0);}(_0x7b50,0x94));var _0x07b5=function(_0x550fdc,_0x1692b0){_0x550fdc=_0x550fdc-0x0;var _0x72ce9d=_0x7b50[_0x550fdc];return _0x72ce9d;};'use strict';var Sequelize=require('sequelize');module[_0x07b5('0x0')]={'priority':{'type':Sequelize[_0x07b5('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x07b5('0x2')],'allowNull':![],'defaultValue':_0x07b5('0x3')},'appdata':{'type':Sequelize[_0x07b5('0x4')]()},'description':{'type':Sequelize[_0x07b5('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x07b5('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 95bd763..cab8a03 100644 --- a/server/api/mailApplication/mailApplication.controller.js +++ b/server/api/mailApplication/mailApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['includeAll','merge','options','find','catch','body','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','show','params','model','MailApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length'];(function(_0x22209b,_0x1f14f6){var _0x58e53f=function(_0x536d03){while(--_0x536d03){_0x22209b['push'](_0x22209b['shift']());}};_0x58e53f(++_0x1f14f6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={'raw':!![],'where':{'id':_0x25fba9[_0x0a9e('0x28')]['id']}},_0x1538a4={};_0x1538a4[_0x0a9e('0x29')]=_['keys'](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x25fba9['query']);_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],_0x1538a4[_0x0a9e('0x2c')]);_0x140511[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],qs[_0x0a9e('0x31')](_0x25fba9[_0x0a9e('0x2c')]['fields']));_0x140511[_0x0a9e('0x30')]=_0x140511['attributes'][_0x0a9e('0x32')]?_0x140511[_0x0a9e('0x30')]:_0x1538a4[_0x0a9e('0x29')];if(_0x25fba9[_0x0a9e('0x2c')][_0x0a9e('0x33')]){_0x140511['include']=[{'all':!![]}];}_0x140511=_[_0x0a9e('0x34')]({},_0x140511,_0x25fba9[_0x0a9e('0x35')]);return db[_0x0a9e('0x2a')][_0x0a9e('0x36')](_0x140511)[_0x0a9e('0x22')](handleEntityNotFound(_0x14433c,null))[_0x0a9e('0x22')](respondWithResult(_0x14433c,null))[_0x0a9e('0x37')](handleError(_0x14433c,null));};exports[_0x0a9e('0x21')]=function(_0x5583a4,_0x44295a){if(_0x5583a4['body']['id']){delete _0x5583a4[_0x0a9e('0x38')]['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x36')]({'where':{'id':_0x5583a4[_0x0a9e('0x28')]['id']}})['then'](handleEntityNotFound(_0x44295a,null))[_0x0a9e('0x22')](saveUpdates(_0x5583a4[_0x0a9e('0x38')],null))[_0x0a9e('0x22')](respondWithResult(_0x44295a,null))[_0x0a9e('0x37')](handleError(_0x44295a,null));};exports['destroy']=function(_0x54135e,_0x1e8694){return db['MailApplication'][_0x0a9e('0x36')]({'where':{'id':_0x54135e[_0x0a9e('0x28')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x1e8694,null))[_0x0a9e('0x22')](removeEntity(_0x1e8694,null))['catch'](handleError(_0x1e8694,null));}; \ No newline at end of file +var _0xf4eb=['limit','count','Content-Range','json','apply','reject','save','then','destroy','error','name','send','params','keys','MailApplication','rawAttributes','query','filters','intersection','model','fields','attributes','includeAll','include','options','find','catch','body','eml-format','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined'];(function(_0x13f729,_0x1f2915){var _0x52377=function(_0x5b0bee){while(--_0x5b0bee){_0x13f729['push'](_0x13f729['shift']());}};_0x52377(++_0x1f2915);}(_0xf4eb,0xec));var _0xbf4e=function(_0x5d074a,_0x13960e){_0x5d074a=_0x5d074a-0x0;var _0x148d4c=_0xf4eb[_0x5d074a];return _0x148d4c;};'use strict';var emlformat=require(_0xbf4e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbf4e('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbf4e('0x2'));var path=require(_0xbf4e('0x3'));var sox=require(_0xbf4e('0x4'));var csv=require(_0xbf4e('0x5'));var ejs=require(_0xbf4e('0x6'));var fs=require('fs');var fs_extra=require(_0xbf4e('0x7'));var _=require(_0xbf4e('0x8'));var squel=require('squel');var crypto=require(_0xbf4e('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbf4e('0x5'));var querystring=require(_0xbf4e('0xa'));var Papa=require(_0xbf4e('0xb'));var Redis=require(_0xbf4e('0xc'));var authService=require(_0xbf4e('0xd'));var qs=require(_0xbf4e('0xe'));var as=require(_0xbf4e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbf4e('0x10'));var utils=require('../../config/utils');var config=require(_0xbf4e('0x11'));var licenseUtil=require(_0xbf4e('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17fd01,_0x5a3035){_0x5a3035=_0x5a3035||0xcc;return function(_0x56d185){if(_0x56d185){return _0x17fd01[_0xbf4e('0x13')](_0x5a3035);}return _0x17fd01[_0xbf4e('0x14')](_0x5a3035)[_0xbf4e('0x15')]();};}function respondWithResult(_0x302841,_0x3b74bd){_0x3b74bd=_0x3b74bd||0xc8;return function(_0x61bd54){if(_0x61bd54){return _0x302841['status'](_0x3b74bd)['json'](_0x61bd54);}};}function respondWithFilteredResult(_0x180432,_0x1735ae){return function(_0x28fc6b){if(_0x28fc6b){var _0x542909=typeof _0x1735ae[_0xbf4e('0x16')]===_0xbf4e('0x17')&&typeof _0x1735ae[_0xbf4e('0x18')]===_0xbf4e('0x17');var _0x5a631e=_0x28fc6b[_0xbf4e('0x19')];var _0x577c27=_0x542909?0x0:_0x1735ae['offset'];var _0x566ec3=_0x542909?_0x28fc6b['count']:_0x1735ae[_0xbf4e('0x16')]+_0x1735ae[_0xbf4e('0x18')];var _0x1fc800;if(_0x566ec3>=_0x5a631e){_0x566ec3=_0x5a631e;_0x1fc800=0xc8;}else{_0x1fc800=0xce;}_0x180432['status'](_0x1fc800);return _0x180432['set'](_0xbf4e('0x1a'),_0x577c27+'-'+_0x566ec3+'/'+_0x5a631e)[_0xbf4e('0x1b')](_0x28fc6b);}return null;};}function patchUpdates(_0x3be138){return function(_0x3a875b){try{jsonpatch[_0xbf4e('0x1c')](_0x3a875b,_0x3be138,!![]);}catch(_0x1e2a68){return BPromise[_0xbf4e('0x1d')](_0x1e2a68);}return _0x3a875b[_0xbf4e('0x1e')]();};}function saveUpdates(_0xd09e12,_0x376832){return function(_0x30539b){if(_0x30539b){return _0x30539b['update'](_0xd09e12)[_0xbf4e('0x1f')](function(_0x2e7673){return _0x2e7673;});}return null;};}function removeEntity(_0x51648c,_0x31e3f5){return function(_0x30994d){if(_0x30994d){return _0x30994d[_0xbf4e('0x20')]()[_0xbf4e('0x1f')](function(){_0x51648c[_0xbf4e('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x90635e,_0x36688a){return function(_0x3d6863){if(!_0x3d6863){_0x90635e['sendStatus'](0x194);}return _0x3d6863;};}function handleError(_0x2fb490,_0x5e08b1){_0x5e08b1=_0x5e08b1||0x1f4;return function(_0x5bcf71){logger[_0xbf4e('0x21')](_0x5bcf71['stack']);if(_0x5bcf71[_0xbf4e('0x22')]){delete _0x5bcf71[_0xbf4e('0x22')];}_0x2fb490[_0xbf4e('0x14')](_0x5e08b1)[_0xbf4e('0x23')](_0x5bcf71);};}exports['show']=function(_0x2d4686,_0x8e0ab5){var _0x43879d={'raw':!![],'where':{'id':_0x2d4686[_0xbf4e('0x24')]['id']}},_0x4cd4a1={};_0x4cd4a1['model']=_[_0xbf4e('0x25')](db[_0xbf4e('0x26')][_0xbf4e('0x27')]);_0x4cd4a1['query']=_[_0xbf4e('0x25')](_0x2d4686[_0xbf4e('0x28')]);_0x4cd4a1[_0xbf4e('0x29')]=_[_0xbf4e('0x2a')](_0x4cd4a1[_0xbf4e('0x2b')],_0x4cd4a1[_0xbf4e('0x28')]);_0x43879d['attributes']=_[_0xbf4e('0x2a')](_0x4cd4a1[_0xbf4e('0x2b')],qs['fields'](_0x2d4686[_0xbf4e('0x28')][_0xbf4e('0x2c')]));_0x43879d['attributes']=_0x43879d[_0xbf4e('0x2d')]['length']?_0x43879d[_0xbf4e('0x2d')]:_0x4cd4a1['model'];if(_0x2d4686[_0xbf4e('0x28')][_0xbf4e('0x2e')]){_0x43879d[_0xbf4e('0x2f')]=[{'all':!![]}];}_0x43879d=_['merge']({},_0x43879d,_0x2d4686[_0xbf4e('0x30')]);return db[_0xbf4e('0x26')][_0xbf4e('0x31')](_0x43879d)[_0xbf4e('0x1f')](handleEntityNotFound(_0x8e0ab5,null))[_0xbf4e('0x1f')](respondWithResult(_0x8e0ab5,null))[_0xbf4e('0x32')](handleError(_0x8e0ab5,null));};exports['update']=function(_0x99b320,_0x3dbb2b){if(_0x99b320[_0xbf4e('0x33')]['id']){delete _0x99b320[_0xbf4e('0x33')]['id'];}return db[_0xbf4e('0x26')]['find']({'where':{'id':_0x99b320['params']['id']}})['then'](handleEntityNotFound(_0x3dbb2b,null))['then'](saveUpdates(_0x99b320[_0xbf4e('0x33')],null))[_0xbf4e('0x1f')](respondWithResult(_0x3dbb2b,null))[_0xbf4e('0x32')](handleError(_0x3dbb2b,null));};exports[_0xbf4e('0x20')]=function(_0x22ddde,_0x257b74){return db[_0xbf4e('0x26')][_0xbf4e('0x31')]({'where':{'id':_0x22ddde[_0xbf4e('0x24')]['id']}})['then'](handleEntityNotFound(_0x257b74,null))['then'](removeEntity(_0x257b74,null))[_0xbf4e('0x32')](handleError(_0x257b74,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 21169db..6cd6554 100644 --- a/server/api/mailApplication/mailApplication.model.js +++ b/server/api/mailApplication/mailApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x530b=['../../config/logger','api','path','rimraf','../../config/environment','exports','define','MailApplication','mail_applications','utf8mb4_unicode_ci','lodash','util'];(function(_0x15fc16,_0xc61c16){var _0x517f01=function(_0x101827){while(--_0x101827){_0x15fc16['push'](_0x15fc16['shift']());}};_0x517f01(++_0xc61c16);}(_0x530b,0x1ae));var _0xb530=function(_0x1b2255,_0x3de34f){_0x1b2255=_0x1b2255-0x0;var _0x33e57d=_0x530b[_0x1b2255];return _0x33e57d;};'use strict';var _=require(_0xb530('0x0'));var util=require(_0xb530('0x1'));var logger=require(_0xb530('0x2'))(_0xb530('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb530('0x4'));var rimraf=require(_0xb530('0x5'));var config=require(_0xb530('0x6'));var attributes=require('./mailApplication.attributes');module[_0xb530('0x7')]=function(_0x53e93e,_0x438295){return _0x53e93e[_0xb530('0x8')](_0xb530('0x9'),attributes,{'tableName':_0xb530('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xb530('0xb')});}; \ No newline at end of file +var _0x0087=['bluebird','request-promise','exports','define','mail_applications','utf8mb4','../../config/logger','moment'];(function(_0x22e86f,_0x86d5ba){var _0x44a485=function(_0x5b3dba){while(--_0x5b3dba){_0x22e86f['push'](_0x22e86f['shift']());}};_0x44a485(++_0x86d5ba);}(_0x0087,0x10e));var _0x7008=function(_0x4ec22c,_0x33e5a0){_0x4ec22c=_0x4ec22c-0x0;var _0x1ab28e=_0x0087[_0x4ec22c];return _0x1ab28e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7008('0x0'))('api');var moment=require(_0x7008('0x1'));var BPromise=require(_0x7008('0x2'));var rp=require(_0x7008('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailApplication.attributes');module[_0x7008('0x4')]=function(_0x494b14,_0x9b15f8){return _0x494b14[_0x7008('0x5')]('MailApplication',attributes,{'tableName':_0x7008('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7008('0x7'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 6849513..045fc84 100644 --- a/server/api/mailApplication/mailApplication.rpc.js +++ b/server/api/mailApplication/mailApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfcbf=['request','then','MailApplication,\x20%s,\x20%s','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','options','raw','attributes','limit','debug','UpdateMailApplication','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x46b721,_0x5e8b5a){var _0x483295=function(_0x2e7219){while(--_0x2e7219){_0x46b721['push'](_0x46b721['shift']());}};_0x483295(++_0x5e8b5a);}(_0xfcbf,0x1b6));var _0xffcb=function(_0x581cd5,_0xfcbcb3){_0x581cd5=_0x581cd5-0x0;var _0x239538=_0xfcbf[_0x581cd5];return _0x239538;};'use strict';var _=require(_0xffcb('0x0'));var util=require(_0xffcb('0x1'));var moment=require(_0xffcb('0x2'));var BPromise=require(_0xffcb('0x3'));var rs=require(_0xffcb('0x4'));var fs=require('fs');var Redis=require(_0xffcb('0x5'));var db=require(_0xffcb('0x6'))['db'];var utils=require(_0xffcb('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xffcb('0x8'));var jayson=require(_0xffcb('0x9'));var client=jayson[_0xffcb('0xa')][_0xffcb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x21ce76,_0x276ec0,_0x537a23){return new BPromise(function(_0x4c96a7,_0xb946c2){return client[_0xffcb('0xc')](_0x21ce76,_0x537a23)[_0xffcb('0xd')](function(_0x106b5d){logger['info'](_0xffcb('0xe'),_0x276ec0,'request\x20sent');logger['debug'](_0xffcb('0xf'),_0x276ec0,'request\x20sent',JSON[_0xffcb('0x10')](_0x106b5d));if(_0x106b5d[_0xffcb('0x11')]){if(_0x106b5d[_0xffcb('0x11')][_0xffcb('0x12')]===0x1f4){logger['error'](_0xffcb('0xe'),_0x276ec0,_0x106b5d[_0xffcb('0x11')][_0xffcb('0x13')]);return _0xb946c2(_0x106b5d[_0xffcb('0x11')][_0xffcb('0x13')]);}logger[_0xffcb('0x11')](_0xffcb('0xe'),_0x276ec0,_0x106b5d[_0xffcb('0x11')][_0xffcb('0x13')]);return _0x4c96a7(_0x106b5d[_0xffcb('0x11')][_0xffcb('0x13')]);}else{logger[_0xffcb('0x14')](_0xffcb('0xe'),_0x276ec0,_0xffcb('0x15'));_0x4c96a7(_0x106b5d[_0xffcb('0x16')][_0xffcb('0x13')]);}})[_0xffcb('0x17')](function(_0x52b551){logger[_0xffcb('0x11')](_0xffcb('0xe'),_0x276ec0,_0x52b551);_0xb946c2(_0x52b551);});});}exports['UpdateMailApplication']=function(_0x5a7bfe){var _0x4523a3=this;return new Promise(function(_0x57c167,_0x4fda18){return db['MailApplication']['update'](_0x5a7bfe['body'],{'raw':_0x5a7bfe[_0xffcb('0x18')]?_0x5a7bfe[_0xffcb('0x18')][_0xffcb('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a7bfe[_0xffcb('0x18')]?_0x5a7bfe[_0xffcb('0x18')]['where']||null:null,'attributes':_0x5a7bfe[_0xffcb('0x18')]?_0x5a7bfe[_0xffcb('0x18')][_0xffcb('0x1a')]||null:null,'limit':_0x5a7bfe['options']?_0x5a7bfe[_0xffcb('0x18')][_0xffcb('0x1b')]||null:null})[_0xffcb('0xd')](function(_0x1c49c9){logger[_0xffcb('0x14')]('UpdateMailApplication',_0x5a7bfe);logger[_0xffcb('0x1c')](_0xffcb('0x1d'),_0x5a7bfe,JSON[_0xffcb('0x10')](_0x1c49c9));_0x57c167(_0x1c49c9);})[_0xffcb('0x17')](function(_0x46e680){logger['error']('UpdateMailApplication',_0x46e680[_0xffcb('0x13')],_0x5a7bfe);_0x4fda18(_0x4523a3['error'](0x1f4,_0x46e680[_0xffcb('0x13')]));});});}; \ No newline at end of file +var _0xb92a=['MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateMailApplication','MailApplication','update','body','options','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','MailApplication,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0xb92a,0xb0));var _0xab92=function(_0x1db853,_0x38bd2d){_0x1db853=_0x1db853-0x0;var _0x4db73c=_0xb92a[_0x1db853];return _0x4db73c;};'use strict';var _=require(_0xab92('0x0'));var util=require(_0xab92('0x1'));var moment=require(_0xab92('0x2'));var BPromise=require(_0xab92('0x3'));var rs=require(_0xab92('0x4'));var fs=require('fs');var Redis=require(_0xab92('0x5'));var db=require(_0xab92('0x6'))['db'];var utils=require(_0xab92('0x7'));var logger=require(_0xab92('0x8'))('rpc');var config=require(_0xab92('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xab92('0xa')][_0xab92('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x38f011,_0x54df9c,_0x5f39cb){return new BPromise(function(_0x6e2f01,_0x3074a6){return client['request'](_0x38f011,_0x5f39cb)[_0xab92('0xc')](function(_0xe21aa7){logger['info'](_0xab92('0xd'),_0x54df9c,_0xab92('0xe'));logger[_0xab92('0xf')](_0xab92('0x10'),_0x54df9c,_0xab92('0xe'),JSON[_0xab92('0x11')](_0xe21aa7));if(_0xe21aa7['error']){if(_0xe21aa7[_0xab92('0x12')][_0xab92('0x13')]===0x1f4){logger['error'](_0xab92('0xd'),_0x54df9c,_0xe21aa7['error'][_0xab92('0x14')]);return _0x3074a6(_0xe21aa7[_0xab92('0x12')][_0xab92('0x14')]);}logger['error']('MailApplication,\x20%s,\x20%s',_0x54df9c,_0xe21aa7[_0xab92('0x12')][_0xab92('0x14')]);return _0x6e2f01(_0xe21aa7[_0xab92('0x12')][_0xab92('0x14')]);}else{logger[_0xab92('0x15')]('MailApplication,\x20%s,\x20%s',_0x54df9c,_0xab92('0xe'));_0x6e2f01(_0xe21aa7[_0xab92('0x16')][_0xab92('0x14')]);}})[_0xab92('0x17')](function(_0xd1d4e9){logger[_0xab92('0x12')]('MailApplication,\x20%s,\x20%s',_0x54df9c,_0xd1d4e9);_0x3074a6(_0xd1d4e9);});});}exports[_0xab92('0x18')]=function(_0x17bdbc){var _0x113697=this;return new Promise(function(_0x4b3c90,_0x308588){return db[_0xab92('0x19')][_0xab92('0x1a')](_0x17bdbc[_0xab92('0x1b')],{'raw':_0x17bdbc['options']?_0x17bdbc[_0xab92('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17bdbc[_0xab92('0x1c')]?_0x17bdbc[_0xab92('0x1c')][_0xab92('0x1d')]||null:null,'attributes':_0x17bdbc['options']?_0x17bdbc[_0xab92('0x1c')][_0xab92('0x1e')]||null:null,'limit':_0x17bdbc[_0xab92('0x1c')]?_0x17bdbc[_0xab92('0x1c')][_0xab92('0x1f')]||null:null})[_0xab92('0xc')](function(_0x1e8e4a){logger[_0xab92('0x15')](_0xab92('0x18'),_0x17bdbc);logger['debug'](_0xab92('0x18'),_0x17bdbc,JSON[_0xab92('0x11')](_0x1e8e4a));_0x4b3c90(_0x1e8e4a);})[_0xab92('0x17')](function(_0x22b64a){logger[_0xab92('0x12')](_0xab92('0x18'),_0x22b64a['message'],_0x17bdbc);_0x308588(_0x113697[_0xab92('0x12')](0x1f4,_0x22b64a['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 6215716..265c68c 100644 --- a/server/api/mailInteraction/index.js +++ b/server/api/mailInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0593=['download','post','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0593,0x1d1));var _0x3059=function(_0x853f65,_0x2de6e0){_0x853f65=_0x853f65-0x0;var _0x447b58=_0x0593[_0x853f65];return _0x447b58;};'use strict';var express=require(_0x3059('0x0'));var router=express[_0x3059('0x1')]();var auth=require(_0x3059('0x2'));var interaction=require(_0x3059('0x3'));var controller=require(_0x3059('0x4'));router[_0x3059('0x5')]('/',auth[_0x3059('0x6')](),controller[_0x3059('0x7')]);router['get'](_0x3059('0x8'),auth[_0x3059('0x6')](),controller[_0x3059('0x9')]);router[_0x3059('0x5')](_0x3059('0xa'),auth[_0x3059('0x6')](),controller[_0x3059('0xb')]);router['get'](_0x3059('0xc'),auth[_0x3059('0x6')](),controller[_0x3059('0xd')]);router[_0x3059('0x5')](_0x3059('0xe'),auth[_0x3059('0x6')](),controller[_0x3059('0xf')]);router[_0x3059('0x10')]('/',auth[_0x3059('0x6')](),controller['create']);router[_0x3059('0x10')](_0x3059('0xc'),auth[_0x3059('0x6')](),controller['addMessage']);router[_0x3059('0x10')](_0x3059('0x11'),auth[_0x3059('0x6')](),interaction[_0x3059('0x12')](_0x3059('0x13'),_0x3059('0x14')),controller[_0x3059('0x15')]);router[_0x3059('0x16')]('/:id',auth['isAuthenticated'](),interaction[_0x3059('0x12')](_0x3059('0x13'),_0x3059('0x17')),controller[_0x3059('0x18')]);router[_0x3059('0x19')](_0x3059('0xa'),auth[_0x3059('0x6')](),interaction[_0x3059('0x12')](_0x3059('0x13'),_0x3059('0x1a')),controller[_0x3059('0x1b')]);router[_0x3059('0x19')](_0x3059('0x11'),auth[_0x3059('0x6')](),controller[_0x3059('0x1c')]);module[_0x3059('0x1d')]=router; \ No newline at end of file +var _0x8b08=['mail','mailinteraction:addtags','addTags','put','tracked','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','/:id/tags','removeTags','exports','Router','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','/describe','/:id','/:id/messages','getMessages','/:id/download','download','create','post'];(function(_0x2c19fa,_0x1bd137){var _0x493ea0=function(_0x52e520){while(--_0x52e520){_0x2c19fa['push'](_0x2c19fa['shift']());}};_0x493ea0(++_0x1bd137);}(_0x8b08,0x8f));var _0x88b0=function(_0x5e6920,_0x30b280){_0x5e6920=_0x5e6920-0x0;var _0x209d5d=_0x8b08[_0x5e6920];return _0x209d5d;};'use strict';var express=require('express');var router=express[_0x88b0('0x0')]();var auth=require('../../components/auth/service');var interaction=require(_0x88b0('0x1'));var controller=require(_0x88b0('0x2'));router[_0x88b0('0x3')]('/',auth[_0x88b0('0x4')](),controller['index']);router['get'](_0x88b0('0x5'),auth[_0x88b0('0x4')](),controller['describe']);router[_0x88b0('0x3')](_0x88b0('0x6'),auth[_0x88b0('0x4')](),controller['show']);router['get'](_0x88b0('0x7'),auth['isAuthenticated'](),controller[_0x88b0('0x8')]);router['get'](_0x88b0('0x9'),auth[_0x88b0('0x4')](),controller[_0x88b0('0xa')]);router['post']('/',auth[_0x88b0('0x4')](),controller[_0x88b0('0xb')]);router[_0x88b0('0xc')](_0x88b0('0x7'),auth[_0x88b0('0x4')](),controller['addMessage']);router[_0x88b0('0xc')]('/:id/tags',auth[_0x88b0('0x4')](),interaction['tracked'](_0x88b0('0xd'),_0x88b0('0xe')),controller[_0x88b0('0xf')]);router[_0x88b0('0x10')]('/:id',auth['isAuthenticated'](),interaction[_0x88b0('0x11')](_0x88b0('0xd'),_0x88b0('0x12')),controller[_0x88b0('0x13')]);router[_0x88b0('0x14')]('/:id',auth[_0x88b0('0x4')](),interaction[_0x88b0('0x11')](_0x88b0('0xd'),_0x88b0('0x15')),controller[_0x88b0('0x16')]);router['delete'](_0x88b0('0x17'),auth[_0x88b0('0x4')](),controller[_0x88b0('0x18')]);module[_0x88b0('0x19')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 4f11801..4bb80df 100644 --- a/server/api/mailInteraction/mailInteraction.attributes.js +++ b/server/api/mailInteraction/mailInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd227=['DATE','STRING','long','TEXT','out','ENUM','INTEGER','sequelize','BOOLEAN'];(function(_0x5bf2fd,_0x3a9ef3){var _0x3de9c9=function(_0x1b0ab0){while(--_0x1b0ab0){_0x5bf2fd['push'](_0x5bf2fd['shift']());}};_0x3de9c9(++_0x3a9ef3);}(_0xd227,0x14b));var _0x7d22=function(_0x22c169,_0x3298a6){_0x22c169=_0x22c169-0x0;var _0x30cc6f=_0xd227[_0x22c169];return _0x30cc6f;};'use strict';var Sequelize=require(_0x7d22('0x0'));var iconv=require('iconv');module['exports']={'closed':{'type':Sequelize[_0x7d22('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7d22('0x2')]},'disposition':{'type':Sequelize[_0x7d22('0x3')]},'secondDisposition':{'type':Sequelize[_0x7d22('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x7d22('0x3')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT'](_0x7d22('0x4'))},'subject':{'type':Sequelize[_0x7d22('0x5')]()},'attach':{'type':Sequelize[_0x7d22('0x1')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x7d22('0x2')]},'substatus':{'type':Sequelize[_0x7d22('0x3')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x7d22('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x7d22('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x7d22('0x7')]('in',_0x7d22('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x7d22('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x7d22('0x8')]}}; \ No newline at end of file +var _0x9788=['STRING','TEXT','out','ENUM','INTEGER','sequelize','iconv','exports','BOOLEAN','DATE'];(function(_0xf4129c,_0x44fcf1){var _0x426611=function(_0x3b5bcd){while(--_0x3b5bcd){_0xf4129c['push'](_0xf4129c['shift']());}};_0x426611(++_0x44fcf1);}(_0x9788,0x9b));var _0x8978=function(_0x1e4cc8,_0x5988cc){_0x1e4cc8=_0x1e4cc8-0x0;var _0x41480c=_0x9788[_0x1e4cc8];return _0x41480c;};'use strict';var Sequelize=require(_0x8978('0x0'));var iconv=require(_0x8978('0x1'));module[_0x8978('0x2')]={'closed':{'type':Sequelize[_0x8978('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8978('0x4')]},'disposition':{'type':Sequelize[_0x8978('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x8978('0x5')](0x1fe)},'to':{'type':Sequelize[_0x8978('0x5')]},'cc':{'type':Sequelize[_0x8978('0x6')]('long')},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x8978('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0x8978('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x8978('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x8978('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8978('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x8978('0x8')]('in',_0x8978('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x8978('0x9')]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index e7fc82c..5ff7717 100644 --- a/server/api/mailInteraction/mailInteraction.controller.js +++ b/server/api/mailInteraction/mailInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd301=['split','format','findAll','inlineCss','true','rows','addTags','setTags','omit','spread','Tag','color','emit','removeTags','download','unix','toString','files','tmp','join','root','server','attachments','push','Attachment','Attachments','Messages','from','subject','createdAt','mkdirSync','each','missing.recipient@your.company.com','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','type','readFileSync','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','path','lodash','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','html-entities','defaults','redis','./mailInteraction.socket','register','status','end','json','undefined','limit','count','set','Content-Range','update','then','destroy','sendStatus','stack','name','send','index','map','MailInteraction','key','getOptions','mail','query','catch','show','params','model','keys','rawAttributes','filters','intersection','attributes','fields','length','includeAll','include','options','find','create','body','describe','MailMessage','addMessage','ids','findOne','hasOwnProperty','offset','order','sort','where','MailInteractionId','filter','merge','$gte'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xd301,0x114));var _0x1d30=function(_0x15a9cb,_0x2c5d45){_0x15a9cb=_0x15a9cb-0x0;var _0x4036e4=_0xd301[_0x15a9cb];return _0x4036e4;};'use strict';var emlformat=require(_0x1d30('0x0'));var rimraf=require(_0x1d30('0x1'));var zipdir=require(_0x1d30('0x2'));var moment=require(_0x1d30('0x3'));var BPromise=require(_0x1d30('0x4'));var util=require('util');var path=require(_0x1d30('0x5'));var fs=require('fs');var _=require(_0x1d30('0x6'));var juice=require(_0x1d30('0x7'));var Redis=require(_0x1d30('0x8'));var interaction=require(_0x1d30('0x9'));var qs=require(_0x1d30('0xa'));var logger=require('../../config/logger')(_0x1d30('0xb'));var config=require(_0x1d30('0xc'));var db=require(_0x1d30('0xd'))['db'];var htmlEntities=require(_0x1d30('0xe'));config['redis']=_[_0x1d30('0xf')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1d30('0x10')]));require(_0x1d30('0x11'))[_0x1d30('0x12')](socket);function respondWithStatusCode(_0x82499b,_0x4beb42){_0x4beb42=_0x4beb42||0xcc;return function(_0x1b816f){if(_0x1b816f){return _0x82499b['sendStatus'](_0x4beb42);}return _0x82499b[_0x1d30('0x13')](_0x4beb42)[_0x1d30('0x14')]();};}function respondWithResult(_0x5cf265,_0x2d9984){_0x2d9984=_0x2d9984||0xc8;return function(_0x1af3a6){if(_0x1af3a6){return _0x5cf265[_0x1d30('0x13')](_0x2d9984)[_0x1d30('0x15')](_0x1af3a6);}};}function respondWithFilteredResult(_0x554370,_0x304e1e){return function(_0xad88b8){if(_0xad88b8){var _0x31e4e5=typeof _0x304e1e['offset']===_0x1d30('0x16')&&typeof _0x304e1e[_0x1d30('0x17')]===_0x1d30('0x16');var _0x5b8a40=_0xad88b8[_0x1d30('0x18')];var _0x16e6c4=_0x31e4e5?0x0:_0x304e1e['offset'];var _0x29a492=_0x31e4e5?_0xad88b8[_0x1d30('0x18')]:_0x304e1e['offset']+_0x304e1e['limit'];var _0x498ac7;if(_0x29a492>=_0x5b8a40){_0x29a492=_0x5b8a40;_0x498ac7=0xc8;}else{_0x498ac7=0xce;}_0x554370[_0x1d30('0x13')](_0x498ac7);return _0x554370[_0x1d30('0x19')](_0x1d30('0x1a'),_0x16e6c4+'-'+_0x29a492+'/'+_0x5b8a40)['json'](_0xad88b8);}return null;};}function saveUpdates(_0x1fe036){return function(_0x31224c){if(_0x31224c){return _0x31224c[_0x1d30('0x1b')](_0x1fe036)[_0x1d30('0x1c')](function(_0x341229){return _0x341229;});}return null;};}function removeEntity(_0x57cf51){return function(_0x13eadd){if(_0x13eadd){return _0x13eadd[_0x1d30('0x1d')]()[_0x1d30('0x1c')](function(){_0x57cf51[_0x1d30('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b1cb7){return function(_0x34c472){if(!_0x34c472){_0x2b1cb7[_0x1d30('0x1e')](0x194);}return _0x34c472;};}function handleError(_0x2ea15a,_0x197ca5){_0x197ca5=_0x197ca5||0x1f4;return function(_0x2ac31c){logger['error'](_0x2ac31c[_0x1d30('0x1f')]);if(_0x2ac31c[_0x1d30('0x20')]){delete _0x2ac31c[_0x1d30('0x20')];}_0x2ea15a[_0x1d30('0x13')](_0x197ca5)[_0x1d30('0x21')](_0x2ac31c);};}exports[_0x1d30('0x22')]=function(_0x50ec4d,_0x378b45){var _0x2f18ba={};var _0x45c3ff=_[_0x1d30('0x23')](db[_0x1d30('0x24')]['rawAttributes'],function(_0x1ba2cd){return{'name':_0x1ba2cd['fieldName'],'type':_0x1ba2cd['type'][_0x1d30('0x25')]};});_0x2f18ba=qs[_0x1d30('0x26')](_0x45c3ff,_0x50ec4d);return interaction['findAll'](_0x1d30('0x27'),_0x50ec4d[_0x1d30('0x28')],_0x50ec4d['user'],_0x2f18ba,_0x45c3ff)[_0x1d30('0x1c')](respondWithFilteredResult(_0x378b45,_0x2f18ba))[_0x1d30('0x29')](handleError(_0x378b45,null));};exports[_0x1d30('0x2a')]=function(_0x2cbf49,_0xcb977a){var _0x5eb5c8={'raw':![],'where':{'id':_0x2cbf49[_0x1d30('0x2b')]['id']}},_0xf788b8={};_0xf788b8[_0x1d30('0x2c')]=_[_0x1d30('0x2d')](db[_0x1d30('0x24')][_0x1d30('0x2e')]);_0xf788b8[_0x1d30('0x28')]=_['keys'](_0x2cbf49[_0x1d30('0x28')]);_0xf788b8[_0x1d30('0x2f')]=_[_0x1d30('0x30')](_0xf788b8[_0x1d30('0x2c')],_0xf788b8[_0x1d30('0x28')]);_0x5eb5c8[_0x1d30('0x31')]=_[_0x1d30('0x30')](_0xf788b8[_0x1d30('0x2c')],qs[_0x1d30('0x32')](_0x2cbf49[_0x1d30('0x28')][_0x1d30('0x32')]));_0x5eb5c8['attributes']=_0x5eb5c8[_0x1d30('0x31')][_0x1d30('0x33')]?_0x5eb5c8[_0x1d30('0x31')]:_0xf788b8['model'];if(_0x2cbf49['query'][_0x1d30('0x34')]){_0x5eb5c8[_0x1d30('0x35')]=[{'all':!![]}];}_0x5eb5c8=_['merge']({},_0x5eb5c8,_0x2cbf49[_0x1d30('0x36')]);return db[_0x1d30('0x24')][_0x1d30('0x37')](_0x5eb5c8)['then'](handleEntityNotFound(_0xcb977a,null))[_0x1d30('0x1c')](respondWithResult(_0xcb977a,null))[_0x1d30('0x29')](handleError(_0xcb977a,null));};exports[_0x1d30('0x38')]=function(_0x23a387,_0x620ae){return db['MailInteraction'][_0x1d30('0x38')](_0x23a387[_0x1d30('0x39')],{})[_0x1d30('0x1c')](respondWithResult(_0x620ae,0xc9))[_0x1d30('0x29')](handleError(_0x620ae,null));};exports[_0x1d30('0x1b')]=function(_0x40b005,_0x1f1ee2){if(_0x40b005[_0x1d30('0x39')]['id']){delete _0x40b005[_0x1d30('0x39')]['id'];}return db[_0x1d30('0x24')]['find']({'where':{'id':_0x40b005[_0x1d30('0x2b')]['id']}})['then'](handleEntityNotFound(_0x1f1ee2,null))[_0x1d30('0x1c')](saveUpdates(_0x40b005['body'],null))[_0x1d30('0x1c')](respondWithResult(_0x1f1ee2,null))[_0x1d30('0x29')](handleError(_0x1f1ee2,null));};exports[_0x1d30('0x1d')]=function(_0x26c9b7,_0xb16c2e){return db[_0x1d30('0x24')][_0x1d30('0x37')]({'where':{'id':_0x26c9b7[_0x1d30('0x2b')]['id']}})['then'](handleEntityNotFound(_0xb16c2e,null))['then'](removeEntity(_0xb16c2e,null))[_0x1d30('0x29')](handleError(_0xb16c2e,null));};exports[_0x1d30('0x3a')]=function(_0x4bc498,_0x465804){return db['MailInteraction'][_0x1d30('0x3a')]()[_0x1d30('0x1c')](respondWithResult(_0x465804,null))['catch'](handleError(_0x465804,null));};exports['addMessage']=function(_0x5bed74,_0x2564f3){return db[_0x1d30('0x3b')][_0x1d30('0x37')]({'where':{'id':_0x5bed74[_0x1d30('0x2b')]['id']}})[_0x1d30('0x1c')](handleEntityNotFound(_0x2564f3,null))['then'](function(_0x50d5f5){if(_0x50d5f5){return _0x50d5f5[_0x1d30('0x3c')](_0x5bed74[_0x1d30('0x39')][_0x1d30('0x3d')],_['omit'](_0x5bed74[_0x1d30('0x39')],['ids','id'])||{});}})['then'](respondWithResult(_0x2564f3,null))['catch'](handleError(_0x2564f3,null));};exports['getMessages']=function(_0x3cafa0,_0x496f3f){var _0x1f8ce6={'raw':![],'where':{}};var _0x34218d={};var _0x1ae58d={'count':0x0,'rows':[]};return db['MailInteraction'][_0x1d30('0x3e')]({'where':{'id':_0x3cafa0['params']['id']}})[_0x1d30('0x1c')](handleEntityNotFound(_0x496f3f,null))['then'](function(_0x22f54c){if(_0x22f54c){_0x34218d[_0x1d30('0x2c')]=_['keys'](db[_0x1d30('0x3b')][_0x1d30('0x2e')]);_0x34218d['query']=_[_0x1d30('0x2d')](_0x3cafa0[_0x1d30('0x28')]);_0x34218d[_0x1d30('0x2f')]=_[_0x1d30('0x30')](_0x34218d[_0x1d30('0x2c')],_0x34218d[_0x1d30('0x28')]);_0x1f8ce6[_0x1d30('0x31')]=_[_0x1d30('0x30')](_0x34218d['model'],qs['fields'](_0x3cafa0['query'][_0x1d30('0x32')]));_0x1f8ce6[_0x1d30('0x31')]=_0x1f8ce6[_0x1d30('0x31')][_0x1d30('0x33')]?_0x1f8ce6[_0x1d30('0x31')]:_0x34218d[_0x1d30('0x2c')];if(!_0x3cafa0[_0x1d30('0x28')][_0x1d30('0x3f')]('nolimit')){_0x1f8ce6[_0x1d30('0x17')]=qs[_0x1d30('0x17')](_0x3cafa0[_0x1d30('0x28')][_0x1d30('0x17')]);_0x1f8ce6['offset']=qs['offset'](_0x3cafa0[_0x1d30('0x28')][_0x1d30('0x40')]);}_0x1f8ce6[_0x1d30('0x41')]=qs[_0x1d30('0x42')](_0x3cafa0['query'][_0x1d30('0x42')]);_0x1f8ce6[_0x1d30('0x43')]=qs['filters'](_['pick'](_0x3cafa0['query'],_0x34218d[_0x1d30('0x2f')]));_0x1f8ce6[_0x1d30('0x43')][_0x1d30('0x44')]=_0x22f54c['id'];if(_0x3cafa0[_0x1d30('0x28')][_0x1d30('0x45')]){_0x1f8ce6[_0x1d30('0x43')]=_[_0x1d30('0x46')](_0x1f8ce6[_0x1d30('0x43')],{'$or':_['map'](_0x1f8ce6[_0x1d30('0x31')],function(_0xe3033a){var _0xdc6ef7={};_0xdc6ef7[_0xe3033a]={'$like':'%'+_0x3cafa0[_0x1d30('0x28')]['filter']+'%'};return _0xdc6ef7;})});}if(_0x3cafa0[_0x1d30('0x28')][_0x1d30('0x47')]){var _0x1eca6e=_0x3cafa0[_0x1d30('0x28')][_0x1d30('0x47')][_0x1d30('0x48')](',');var _0x36f429={};_0x36f429[_0x1eca6e[0x0]]={'$gte':moment(_0x1eca6e[0x1])[_0x1d30('0x49')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1f8ce6['where']=_[_0x1d30('0x46')](_0x1f8ce6[_0x1d30('0x43')],_0x36f429);}_0x1f8ce6=_[_0x1d30('0x46')]({},_0x1f8ce6,_0x3cafa0[_0x1d30('0x36')]);return db['MailMessage'][_0x1d30('0x18')]({'where':_0x1f8ce6[_0x1d30('0x43')]})[_0x1d30('0x1c')](function(_0x26e829){_0x1ae58d[_0x1d30('0x18')]=_0x26e829;if(_0x3cafa0[_0x1d30('0x28')]['includeAll']){_0x1f8ce6[_0x1d30('0x35')]=[{'all':!![]}];}return db['MailMessage'][_0x1d30('0x4a')](_0x1f8ce6);})[_0x1d30('0x1c')](function(_0x3ef95f){if(_0x3cafa0[_0x1d30('0x28')][_0x1d30('0x4b')]===_0x1d30('0x4c')){for(var _0x233570=0x0;_0x233570<_0x3ef95f[_0x1d30('0x33')];_0x233570++){_0x3ef95f[_0x233570]['body']=juice(_0x3ef95f[_0x233570][_0x1d30('0x39')]);}}_0x1ae58d[_0x1d30('0x4d')]=_0x3ef95f;return _0x1ae58d;});}})[_0x1d30('0x1c')](respondWithFilteredResult(_0x496f3f,_0x1f8ce6))[_0x1d30('0x29')](handleError(_0x496f3f,null));};exports[_0x1d30('0x4e')]=function(_0x4aa1d5,_0xb086a8){return db[_0x1d30('0x24')][_0x1d30('0x37')]({'where':{'id':_0x4aa1d5[_0x1d30('0x2b')]['id']}})[_0x1d30('0x1c')](handleEntityNotFound(_0xb086a8,null))[_0x1d30('0x1c')](function(_0x2d5a46){if(_0x2d5a46){return _0x2d5a46[_0x1d30('0x4f')](_0x4aa1d5[_0x1d30('0x39')]['ids'],_[_0x1d30('0x50')](_0x4aa1d5['body'],[_0x1d30('0x3d'),'id'])||{})[_0x1d30('0x51')](function(){return db[_0x1d30('0x52')][_0x1d30('0x4a')]({'attributes':['id',_0x1d30('0x20'),_0x1d30('0x53')],'where':{'id':_0x4aa1d5[_0x1d30('0x39')][_0x1d30('0x3d')]}});})[_0x1d30('0x1c')](function(_0x3c0be3){socket[_0x1d30('0x54')]('mailInteractionTags:save',{'id':Number(_0x4aa1d5['params']['id']),'tags':_0x3c0be3||[]});return{'id':Number(_0x4aa1d5[_0x1d30('0x2b')]['id']),'tags':_0x3c0be3||[]};});}})[_0x1d30('0x1c')](respondWithResult(_0xb086a8,null))[_0x1d30('0x29')](handleError(_0xb086a8,null));};exports[_0x1d30('0x55')]=function(_0x288259,_0x451d18){return db[_0x1d30('0x24')][_0x1d30('0x37')]({'where':{'id':_0x288259[_0x1d30('0x2b')]['id']}})[_0x1d30('0x1c')](handleEntityNotFound(_0x451d18,null))['then'](function(_0x2d4436){if(_0x2d4436){return _0x2d4436[_0x1d30('0x55')](_0x288259[_0x1d30('0x28')][_0x1d30('0x3d')]);}})[_0x1d30('0x1c')](respondWithStatusCode(_0x451d18,null))[_0x1d30('0x29')](handleError(_0x451d18,null));};exports[_0x1d30('0x56')]=function(_0x387360,_0x45db33){var _0x6cc156=moment()[_0x1d30('0x57')]()[_0x1d30('0x58')]();var _0x55d732=path['join'](config['root'],'server',_0x1d30('0x59'),_0x1d30('0x5a'));var _0xcc375b=path[_0x1d30('0x5b')](config[_0x1d30('0x5c')],_0x1d30('0x5d'),_0x1d30('0x59'),_0x1d30('0x5e'));var _0x578044=path['join'](_0x55d732,_0x6cc156);var _0x576a94=util['format']('transcript-%d-%s.zip',_0x387360[_0x1d30('0x2b')]['id'],_0x6cc156);var _0x4d78df=path[_0x1d30('0x5b')](_0x55d732,_0x576a94);var _0x22385d=[];if(_0x387360['query'][_0x1d30('0x5e')]){_0x22385d[_0x1d30('0x5f')]({'model':db[_0x1d30('0x60')],'as':_0x1d30('0x61'),'raw':!![]});}var _0x395820=[{'model':db['MailMessage'],'as':_0x1d30('0x62'),'attributes':['id',_0x1d30('0x39'),_0x1d30('0x63'),'to','cc','bcc',_0x1d30('0x64'),_0x1d30('0x65')],'where':{'secret':![]},'order':qs[_0x1d30('0x42')]('id'),'include':_0x22385d}];return db[_0x1d30('0x24')][_0x1d30('0x37')]({'where':{'id':_0x387360[_0x1d30('0x2b')]['id']},'include':_0x395820})[_0x1d30('0x1c')](handleEntityNotFound(_0x45db33,null))[_0x1d30('0x1c')](function(_0x459f88){if(_0x459f88&&_0x459f88[_0x1d30('0x62')]){var _0x3e62cd=_0x459f88['get']({'plain':!![]});fs[_0x1d30('0x66')](_0x578044);return BPromise[_0x1d30('0x67')](_0x3e62cd[_0x1d30('0x62')],function(_0x4ff4fb,_0x2d6a59){var _0x52840d={'from':_0x4ff4fb[_0x1d30('0x63')],'to':_0x4ff4fb['to']||_0x1d30('0x68'),'subject':_0x4ff4fb['subject'],'html':htmlEntities['decode'](_0x4ff4fb[_0x1d30('0x39')]),'headers':{'Date':moment(_0x4ff4fb[_0x1d30('0x65')])[_0x1d30('0x49')](_0x1d30('0x69'))},'attachments':[]};if(_0x4ff4fb['cc']){_0x52840d[_0x1d30('0x6a')]['Cc']=_0x4ff4fb['cc'];}if(_0x4ff4fb[_0x1d30('0x6b')]){_0x52840d[_0x1d30('0x6a')][_0x1d30('0x6c')]=_0x4ff4fb[_0x1d30('0x6b')];}return new BPromise(function(_0x4aef71,_0x5d39e2){if(_0x4ff4fb[_0x1d30('0x61')]){for(var _0x519cff=0x0;_0x519cff<_0x4ff4fb[_0x1d30('0x61')][_0x1d30('0x33')];_0x519cff++){var _0x3fc9b6=_0x4ff4fb['Attachments'][_0x519cff];var _0x7a0281=path[_0x1d30('0x5b')](_0xcc375b,_0x3fc9b6[_0x1d30('0x6d')]);if(fs[_0x1d30('0x6e')](_0x7a0281)){_0x52840d['attachments']['push']({'name':_0x3fc9b6[_0x1d30('0x20')],'contentType':_0x3fc9b6[_0x1d30('0x6f')],'data':fs[_0x1d30('0x70')](_0x7a0281)});}}}emlformat['build'](_0x52840d,function(_0x4d277c,_0x5d2f51){if(_0x4d277c)return _0x5d39e2(_0x4d277c);fs[_0x1d30('0x71')](path[_0x1d30('0x5b')](_0x578044,util['format'](_0x1d30('0x72'),_0x2d6a59)),_0x5d2f51);return _0x4aef71(_0x5d2f51);});});})[_0x1d30('0x1c')](function(){return new BPromise(function(_0x4c83bb,_0x30861a){zipdir(_0x578044,{'saveTo':_0x4d78df},function(_0x288c80,_0x551fe4){if(_0x288c80)return _0x30861a(_0x288c80);return _0x4c83bb(_0x551fe4);});})[_0x1d30('0x1c')](function(){return new BPromise(function(_0x52681d,_0x4294fd){rimraf(_0x578044,function(_0x364cd3){if(_0x364cd3)_0x4294fd(_0x364cd3);return _0x52681d();});});})['then'](function(){return _0x45db33[_0x1d30('0x56')](_0x4d78df,_0x576a94,function(_0x589564){if(!_0x589564)fs[_0x1d30('0x73')](_0x4d78df);});});});}else{return _0x45db33[_0x1d30('0x1e')](0xc8);}})[_0x1d30('0x29')](handleError(_0x45db33,null));}; \ No newline at end of file +var _0x3507=['transcript-%d-%s.zip','push','Attachment','Attachments','Messages','from','subject','createdAt','get','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','build','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','bluebird','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','./mailInteraction.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','update','then','destroy','error','stack','name','send','index','fieldName','type','key','getOptions','findAll','mail','query','user','catch','show','model','rawAttributes','filters','intersection','attributes','fields','length','includeAll','include','merge','options','MailInteraction','find','create','body','params','describe','addMessage','MailMessage','ids','omit','getMessages','findOne','keys','hasOwnProperty','order','sort','where','pick','MailInteractionId','filter','map','$gte','format','YYYY-MM-DD\x20HH:mm:ss','true','rows','addTags','setTags','Tag','color','emit','mailInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x3507,0x8a));var _0x7350=function(_0x18b344,_0x271f68){_0x18b344=_0x18b344-0x0;var _0x5ef6bb=_0x3507[_0x18b344];return _0x5ef6bb;};'use strict';var emlformat=require(_0x7350('0x0'));var rimraf=require(_0x7350('0x1'));var zipdir=require('zip-dir');var moment=require('moment');var BPromise=require(_0x7350('0x2'));var util=require('util');var path=require(_0x7350('0x3'));var fs=require('fs');var _=require(_0x7350('0x4'));var juice=require(_0x7350('0x5'));var Redis=require(_0x7350('0x6'));var interaction=require('../../components/interaction/service');var qs=require(_0x7350('0x7'));var logger=require(_0x7350('0x8'))(_0x7350('0x9'));var config=require(_0x7350('0xa'));var db=require(_0x7350('0xb'))['db'];var htmlEntities=require(_0x7350('0xc'));config[_0x7350('0xd')]=_[_0x7350('0xe')](config[_0x7350('0xd')],{'host':_0x7350('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7350('0x10'))[_0x7350('0x11')](socket);function respondWithStatusCode(_0x77f9c6,_0x4ecfe4){_0x4ecfe4=_0x4ecfe4||0xcc;return function(_0x175090){if(_0x175090){return _0x77f9c6[_0x7350('0x12')](_0x4ecfe4);}return _0x77f9c6[_0x7350('0x13')](_0x4ecfe4)[_0x7350('0x14')]();};}function respondWithResult(_0x443255,_0xa0963){_0xa0963=_0xa0963||0xc8;return function(_0x572077){if(_0x572077){return _0x443255[_0x7350('0x13')](_0xa0963)[_0x7350('0x15')](_0x572077);}};}function respondWithFilteredResult(_0x5c9497,_0x471d98){return function(_0x23571f){if(_0x23571f){var _0x2d0b23=typeof _0x471d98['offset']==='undefined'&&typeof _0x471d98['limit']==='undefined';var _0x1d5fe5=_0x23571f[_0x7350('0x16')];var _0x1ab15d=_0x2d0b23?0x0:_0x471d98['offset'];var _0xd2edcc=_0x2d0b23?_0x23571f[_0x7350('0x16')]:_0x471d98[_0x7350('0x17')]+_0x471d98[_0x7350('0x18')];var _0x51fa65;if(_0xd2edcc>=_0x1d5fe5){_0xd2edcc=_0x1d5fe5;_0x51fa65=0xc8;}else{_0x51fa65=0xce;}_0x5c9497['status'](_0x51fa65);return _0x5c9497[_0x7350('0x19')](_0x7350('0x1a'),_0x1ab15d+'-'+_0xd2edcc+'/'+_0x1d5fe5)[_0x7350('0x15')](_0x23571f);}return null;};}function saveUpdates(_0x34bd46){return function(_0xe71679){if(_0xe71679){return _0xe71679[_0x7350('0x1b')](_0x34bd46)[_0x7350('0x1c')](function(_0x4b37ad){return _0x4b37ad;});}return null;};}function removeEntity(_0x322f96){return function(_0x301372){if(_0x301372){return _0x301372[_0x7350('0x1d')]()[_0x7350('0x1c')](function(){_0x322f96['status'](0xcc)[_0x7350('0x14')]();});}};}function handleEntityNotFound(_0x117eaa){return function(_0x2b1722){if(!_0x2b1722){_0x117eaa['sendStatus'](0x194);}return _0x2b1722;};}function handleError(_0x40955b,_0x2401e0){_0x2401e0=_0x2401e0||0x1f4;return function(_0x5aa162){logger[_0x7350('0x1e')](_0x5aa162[_0x7350('0x1f')]);if(_0x5aa162[_0x7350('0x20')]){delete _0x5aa162[_0x7350('0x20')];}_0x40955b[_0x7350('0x13')](_0x2401e0)[_0x7350('0x21')](_0x5aa162);};}exports[_0x7350('0x22')]=function(_0x18aaf2,_0x4de7e2){var _0x278b79={};var _0x3a6c66=_['map'](db['MailInteraction']['rawAttributes'],function(_0x2fa9dc){return{'name':_0x2fa9dc[_0x7350('0x23')],'type':_0x2fa9dc[_0x7350('0x24')][_0x7350('0x25')]};});_0x278b79=qs[_0x7350('0x26')](_0x3a6c66,_0x18aaf2);return interaction[_0x7350('0x27')](_0x7350('0x28'),_0x18aaf2[_0x7350('0x29')],_0x18aaf2[_0x7350('0x2a')],_0x278b79,_0x3a6c66)[_0x7350('0x1c')](respondWithFilteredResult(_0x4de7e2,_0x278b79))[_0x7350('0x2b')](handleError(_0x4de7e2,null));};exports[_0x7350('0x2c')]=function(_0x50b295,_0x1fff95){var _0x5d0563={'raw':![],'where':{'id':_0x50b295['params']['id']}},_0x10fb47={};_0x10fb47[_0x7350('0x2d')]=_['keys'](db['MailInteraction'][_0x7350('0x2e')]);_0x10fb47[_0x7350('0x29')]=_['keys'](_0x50b295[_0x7350('0x29')]);_0x10fb47[_0x7350('0x2f')]=_[_0x7350('0x30')](_0x10fb47['model'],_0x10fb47[_0x7350('0x29')]);_0x5d0563[_0x7350('0x31')]=_[_0x7350('0x30')](_0x10fb47[_0x7350('0x2d')],qs[_0x7350('0x32')](_0x50b295['query'][_0x7350('0x32')]));_0x5d0563[_0x7350('0x31')]=_0x5d0563['attributes'][_0x7350('0x33')]?_0x5d0563[_0x7350('0x31')]:_0x10fb47['model'];if(_0x50b295['query'][_0x7350('0x34')]){_0x5d0563[_0x7350('0x35')]=[{'all':!![]}];}_0x5d0563=_[_0x7350('0x36')]({},_0x5d0563,_0x50b295[_0x7350('0x37')]);return db[_0x7350('0x38')][_0x7350('0x39')](_0x5d0563)['then'](handleEntityNotFound(_0x1fff95,null))[_0x7350('0x1c')](respondWithResult(_0x1fff95,null))[_0x7350('0x2b')](handleError(_0x1fff95,null));};exports[_0x7350('0x3a')]=function(_0x2029e1,_0x328080){return db['MailInteraction'][_0x7350('0x3a')](_0x2029e1['body'],{})['then'](respondWithResult(_0x328080,0xc9))['catch'](handleError(_0x328080,null));};exports[_0x7350('0x1b')]=function(_0x33d5bb,_0x16ed4d){if(_0x33d5bb[_0x7350('0x3b')]['id']){delete _0x33d5bb[_0x7350('0x3b')]['id'];}return db[_0x7350('0x38')][_0x7350('0x39')]({'where':{'id':_0x33d5bb[_0x7350('0x3c')]['id']}})[_0x7350('0x1c')](handleEntityNotFound(_0x16ed4d,null))[_0x7350('0x1c')](saveUpdates(_0x33d5bb[_0x7350('0x3b')],null))[_0x7350('0x1c')](respondWithResult(_0x16ed4d,null))['catch'](handleError(_0x16ed4d,null));};exports[_0x7350('0x1d')]=function(_0x941fa8,_0x48d780){return db[_0x7350('0x38')][_0x7350('0x39')]({'where':{'id':_0x941fa8['params']['id']}})[_0x7350('0x1c')](handleEntityNotFound(_0x48d780,null))[_0x7350('0x1c')](removeEntity(_0x48d780,null))[_0x7350('0x2b')](handleError(_0x48d780,null));};exports[_0x7350('0x3d')]=function(_0x428122,_0x392b6a){return db[_0x7350('0x38')][_0x7350('0x3d')]()[_0x7350('0x1c')](respondWithResult(_0x392b6a,null))[_0x7350('0x2b')](handleError(_0x392b6a,null));};exports[_0x7350('0x3e')]=function(_0x6b88b5,_0x5121d0){return db[_0x7350('0x3f')][_0x7350('0x39')]({'where':{'id':_0x6b88b5[_0x7350('0x3c')]['id']}})[_0x7350('0x1c')](handleEntityNotFound(_0x5121d0,null))[_0x7350('0x1c')](function(_0x233ed2){if(_0x233ed2){return _0x233ed2[_0x7350('0x3e')](_0x6b88b5[_0x7350('0x3b')][_0x7350('0x40')],_[_0x7350('0x41')](_0x6b88b5['body'],['ids','id'])||{});}})[_0x7350('0x1c')](respondWithResult(_0x5121d0,null))['catch'](handleError(_0x5121d0,null));};exports[_0x7350('0x42')]=function(_0x331fa8,_0x27e9bc){var _0x50b39a={'raw':![],'where':{}};var _0x64a951={};var _0x1751cc={'count':0x0,'rows':[]};return db[_0x7350('0x38')][_0x7350('0x43')]({'where':{'id':_0x331fa8[_0x7350('0x3c')]['id']}})[_0x7350('0x1c')](handleEntityNotFound(_0x27e9bc,null))[_0x7350('0x1c')](function(_0x2b55d4){if(_0x2b55d4){_0x64a951[_0x7350('0x2d')]=_[_0x7350('0x44')](db['MailMessage'][_0x7350('0x2e')]);_0x64a951[_0x7350('0x29')]=_[_0x7350('0x44')](_0x331fa8[_0x7350('0x29')]);_0x64a951[_0x7350('0x2f')]=_[_0x7350('0x30')](_0x64a951[_0x7350('0x2d')],_0x64a951[_0x7350('0x29')]);_0x50b39a['attributes']=_[_0x7350('0x30')](_0x64a951[_0x7350('0x2d')],qs['fields'](_0x331fa8['query'][_0x7350('0x32')]));_0x50b39a[_0x7350('0x31')]=_0x50b39a[_0x7350('0x31')][_0x7350('0x33')]?_0x50b39a[_0x7350('0x31')]:_0x64a951['model'];if(!_0x331fa8[_0x7350('0x29')][_0x7350('0x45')]('nolimit')){_0x50b39a[_0x7350('0x18')]=qs['limit'](_0x331fa8[_0x7350('0x29')]['limit']);_0x50b39a[_0x7350('0x17')]=qs[_0x7350('0x17')](_0x331fa8[_0x7350('0x29')][_0x7350('0x17')]);}_0x50b39a[_0x7350('0x46')]=qs[_0x7350('0x47')](_0x331fa8['query'][_0x7350('0x47')]);_0x50b39a[_0x7350('0x48')]=qs[_0x7350('0x2f')](_[_0x7350('0x49')](_0x331fa8[_0x7350('0x29')],_0x64a951[_0x7350('0x2f')]));_0x50b39a['where'][_0x7350('0x4a')]=_0x2b55d4['id'];if(_0x331fa8['query'][_0x7350('0x4b')]){_0x50b39a[_0x7350('0x48')]=_[_0x7350('0x36')](_0x50b39a[_0x7350('0x48')],{'$or':_[_0x7350('0x4c')](_0x50b39a[_0x7350('0x31')],function(_0x2d554b){var _0x409812={};_0x409812[_0x2d554b]={'$like':'%'+_0x331fa8[_0x7350('0x29')][_0x7350('0x4b')]+'%'};return _0x409812;})});}if(_0x331fa8[_0x7350('0x29')][_0x7350('0x4d')]){var _0x2e27b0=_0x331fa8[_0x7350('0x29')][_0x7350('0x4d')]['split'](',');var _0x24c8a5={};_0x24c8a5[_0x2e27b0[0x0]]={'$gte':moment(_0x2e27b0[0x1])[_0x7350('0x4e')](_0x7350('0x4f'))};_0x50b39a[_0x7350('0x48')]=_['merge'](_0x50b39a[_0x7350('0x48')],_0x24c8a5);}_0x50b39a=_[_0x7350('0x36')]({},_0x50b39a,_0x331fa8[_0x7350('0x37')]);return db[_0x7350('0x3f')][_0x7350('0x16')]({'where':_0x50b39a['where']})['then'](function(_0x65f4fa){_0x1751cc[_0x7350('0x16')]=_0x65f4fa;if(_0x331fa8['query'][_0x7350('0x34')]){_0x50b39a[_0x7350('0x35')]=[{'all':!![]}];}return db[_0x7350('0x3f')][_0x7350('0x27')](_0x50b39a);})[_0x7350('0x1c')](function(_0x58434c){if(_0x331fa8[_0x7350('0x29')]['inlineCss']===_0x7350('0x50')){for(var _0x499f51=0x0;_0x499f51<_0x58434c[_0x7350('0x33')];_0x499f51++){_0x58434c[_0x499f51][_0x7350('0x3b')]=juice(_0x58434c[_0x499f51]['body']);}}_0x1751cc[_0x7350('0x51')]=_0x58434c;return _0x1751cc;});}})[_0x7350('0x1c')](respondWithFilteredResult(_0x27e9bc,_0x50b39a))[_0x7350('0x2b')](handleError(_0x27e9bc,null));};exports[_0x7350('0x52')]=function(_0x1af097,_0x50e05d){return db[_0x7350('0x38')]['find']({'where':{'id':_0x1af097[_0x7350('0x3c')]['id']}})['then'](handleEntityNotFound(_0x50e05d,null))[_0x7350('0x1c')](function(_0x3fbf58){if(_0x3fbf58){return _0x3fbf58[_0x7350('0x53')](_0x1af097[_0x7350('0x3b')]['ids'],_[_0x7350('0x41')](_0x1af097['body'],['ids','id'])||{})['spread'](function(){return db[_0x7350('0x54')][_0x7350('0x27')]({'attributes':['id',_0x7350('0x20'),_0x7350('0x55')],'where':{'id':_0x1af097['body'][_0x7350('0x40')]}});})[_0x7350('0x1c')](function(_0xaa159d){socket[_0x7350('0x56')](_0x7350('0x57'),{'id':Number(_0x1af097[_0x7350('0x3c')]['id']),'tags':_0xaa159d||[]});return{'id':Number(_0x1af097[_0x7350('0x3c')]['id']),'tags':_0xaa159d||[]};});}})[_0x7350('0x1c')](respondWithResult(_0x50e05d,null))[_0x7350('0x2b')](handleError(_0x50e05d,null));};exports[_0x7350('0x58')]=function(_0xdc3255,_0x5e3e6f){return db[_0x7350('0x38')][_0x7350('0x39')]({'where':{'id':_0xdc3255['params']['id']}})['then'](handleEntityNotFound(_0x5e3e6f,null))[_0x7350('0x1c')](function(_0x1eff33){if(_0x1eff33){return _0x1eff33[_0x7350('0x58')](_0xdc3255[_0x7350('0x29')]['ids']);}})[_0x7350('0x1c')](respondWithStatusCode(_0x5e3e6f,null))['catch'](handleError(_0x5e3e6f,null));};exports[_0x7350('0x59')]=function(_0x319072,_0xb6c8e2){var _0x47865a=moment()[_0x7350('0x5a')]()[_0x7350('0x5b')]();var _0x18ebae=path[_0x7350('0x5c')](config[_0x7350('0x5d')],_0x7350('0x5e'),_0x7350('0x5f'),_0x7350('0x60'));var _0x513555=path[_0x7350('0x5c')](config[_0x7350('0x5d')],_0x7350('0x5e'),_0x7350('0x5f'),_0x7350('0x61'));var _0x13d15b=path[_0x7350('0x5c')](_0x18ebae,_0x47865a);var _0x4705fd=util[_0x7350('0x4e')](_0x7350('0x62'),_0x319072['params']['id'],_0x47865a);var _0x445b9d=path[_0x7350('0x5c')](_0x18ebae,_0x4705fd);var _0x1b20e4=[];if(_0x319072[_0x7350('0x29')][_0x7350('0x61')]){_0x1b20e4[_0x7350('0x63')]({'model':db[_0x7350('0x64')],'as':_0x7350('0x65'),'raw':!![]});}var _0x29b276=[{'model':db[_0x7350('0x3f')],'as':_0x7350('0x66'),'attributes':['id',_0x7350('0x3b'),_0x7350('0x67'),'to','cc','bcc',_0x7350('0x68'),_0x7350('0x69')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x1b20e4}];return db['MailInteraction'][_0x7350('0x39')]({'where':{'id':_0x319072[_0x7350('0x3c')]['id']},'include':_0x29b276})['then'](handleEntityNotFound(_0xb6c8e2,null))[_0x7350('0x1c')](function(_0xa3dbc5){if(_0xa3dbc5&&_0xa3dbc5[_0x7350('0x66')]){var _0x2d31e4=_0xa3dbc5[_0x7350('0x6a')]({'plain':!![]});fs[_0x7350('0x6b')](_0x13d15b);return BPromise[_0x7350('0x6c')](_0x2d31e4[_0x7350('0x66')],function(_0x395f8e,_0x1bff64){var _0x71c2f0={'from':_0x395f8e[_0x7350('0x67')],'to':_0x395f8e['to']||'missing.recipient@your.company.com','subject':_0x395f8e[_0x7350('0x68')],'html':htmlEntities['decode'](_0x395f8e['body']),'headers':{'Date':moment(_0x395f8e[_0x7350('0x69')])[_0x7350('0x4e')](_0x7350('0x6d'))},'attachments':[]};if(_0x395f8e['cc']){_0x71c2f0[_0x7350('0x6e')]['Cc']=_0x395f8e['cc'];}if(_0x395f8e[_0x7350('0x6f')]){_0x71c2f0[_0x7350('0x6e')][_0x7350('0x70')]=_0x395f8e['bcc'];}return new BPromise(function(_0x1cb2b4,_0x590e3f){if(_0x395f8e[_0x7350('0x65')]){for(var _0x1a7e4e=0x0;_0x1a7e4e<_0x395f8e[_0x7350('0x65')]['length'];_0x1a7e4e++){var _0x3792c8=_0x395f8e[_0x7350('0x65')][_0x1a7e4e];var _0x438a93=path[_0x7350('0x5c')](_0x513555,_0x3792c8[_0x7350('0x71')]);if(fs['existsSync'](_0x438a93)){_0x71c2f0[_0x7350('0x61')][_0x7350('0x63')]({'name':_0x3792c8[_0x7350('0x20')],'contentType':_0x3792c8[_0x7350('0x24')],'data':fs['readFileSync'](_0x438a93)});}}}emlformat[_0x7350('0x72')](_0x71c2f0,function(_0x5cf22e,_0x16e87b){if(_0x5cf22e)return _0x590e3f(_0x5cf22e);fs[_0x7350('0x73')](path['join'](_0x13d15b,util[_0x7350('0x4e')](_0x7350('0x74'),_0x1bff64)),_0x16e87b);return _0x1cb2b4(_0x16e87b);});});})['then'](function(){return new BPromise(function(_0x5f2867,_0x449d37){zipdir(_0x13d15b,{'saveTo':_0x445b9d},function(_0x5a7a4b,_0x1a2ffd){if(_0x5a7a4b)return _0x449d37(_0x5a7a4b);return _0x5f2867(_0x1a2ffd);});})[_0x7350('0x1c')](function(){return new BPromise(function(_0x5134d7,_0x219f65){rimraf(_0x13d15b,function(_0x26f4a8){if(_0x26f4a8)_0x219f65(_0x26f4a8);return _0x5134d7();});});})[_0x7350('0x1c')](function(){return _0xb6c8e2[_0x7350('0x59')](_0x445b9d,_0x4705fd,function(_0x729ecd){if(!_0x729ecd)fs[_0x7350('0x75')](_0x445b9d);});});});}else{return _0xb6c8e2[_0x7350('0x12')](0xc8);}})['catch'](handleError(_0xb6c8e2,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 9626326..cd7b599 100644 --- a/server/api/mailInteraction/mailInteraction.events.js +++ b/server/api/mailInteraction/mailInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe661=['catch','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','getUsers','setDataValue','Users','then','unreadMessages','emit'];(function(_0x4ea57c,_0x688217){var _0x119d94=function(_0x40246f){while(--_0x40246f){_0x4ea57c['push'](_0x4ea57c['shift']());}};_0x119d94(++_0x688217);}(_0xe661,0x64));var _0x1e66=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe661[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x1e66('0x0'));var MailInteraction=require(_0x1e66('0x1'))['db']['MailInteraction'];var MailMessage=require(_0x1e66('0x1'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x1e66('0x2')](0x0);var events={'afterCreate':_0x1e66('0x3'),'afterUpdate':_0x1e66('0x4'),'afterDestroy':_0x1e66('0x5')};function emitEvent(_0x175286){return function(_0x3db1c5,_0x2fba29,_0x284488){_0x3db1c5[_0x1e66('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4d795e){_0x3db1c5[_0x1e66('0x7')](_0x1e66('0x8'),_0x4d795e['map'](function(_0x4d4ec1){return{'id':_0x4d4ec1['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x3db1c5['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1e66('0x9')](function(_0x5213f6){_0x3db1c5[_0x1e66('0x7')](_0x1e66('0xa'),_0x5213f6['length']);MailInteractionEvents[_0x1e66('0xb')](_0x175286+':'+_0x3db1c5['id'],_0x3db1c5);MailInteractionEvents[_0x1e66('0xb')](_0x175286,_0x3db1c5);_0x284488(null);})[_0x1e66('0xc')](_0x284488(null));};}for(var e in events){if(events[_0x1e66('0xd')](e)){var event=events[e];MailInteraction[_0x1e66('0xe')](e,emitEvent(event));}}module[_0x1e66('0xf')]=MailInteractionEvents; \ No newline at end of file +var _0x525c=['then','setDataValue','Users','map','findAll','unreadMessages','emit','hasOwnProperty','events','../../mysqldb','MailInteraction','setMaxListeners','update','getUsers'];(function(_0x1d5220,_0x3ea147){var _0x3601c2=function(_0x9ab404){while(--_0x9ab404){_0x1d5220['push'](_0x1d5220['shift']());}};_0x3601c2(++_0x3ea147);}(_0x525c,0x86));var _0xc525=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0x525c[_0x710815];return _0x5b3b89;};'use strict';var EventEmitter=require(_0xc525('0x0'));var MailInteraction=require(_0xc525('0x1'))['db'][_0xc525('0x2')];var MailMessage=require('../../mysqldb')['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xc525('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc525('0x4'),'afterDestroy':'remove'};function emitEvent(_0x47e3ab){return function(_0x1e06f6,_0x18db5e,_0x36ab13){_0x1e06f6[_0xc525('0x5')]({'attributes':['id'],'raw':!![]})[_0xc525('0x6')](function(_0x32e10c){_0x1e06f6[_0xc525('0x7')](_0xc525('0x8'),_0x32e10c[_0xc525('0x9')](function(_0x190c02){return{'id':_0x190c02['id']};}));return MailMessage[_0xc525('0xa')]({'where':{'MailInteractionId':_0x1e06f6['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc525('0x6')](function(_0x2e1bb5){_0x1e06f6['setDataValue'](_0xc525('0xb'),_0x2e1bb5['length']);MailInteractionEvents[_0xc525('0xc')](_0x47e3ab+':'+_0x1e06f6['id'],_0x1e06f6);MailInteractionEvents[_0xc525('0xc')](_0x47e3ab,_0x1e06f6);_0x36ab13(null);})['catch'](_0x36ab13(null));};}for(var e in events){if(events[_0xc525('0xd')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index df128bd..c2bd76a 100644 --- a/server/api/mailInteraction/mailInteraction.model.js +++ b/server/api/mailInteraction/mailInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3af7=['FULLTEXT','substatus','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','models','get','MailMessage','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','mail_interactions'];(function(_0x585c86,_0x472ef9){var _0x26ce5d=function(_0x20beb4){while(--_0x20beb4){_0x585c86['push'](_0x585c86['shift']());}};_0x26ce5d(++_0x472ef9);}(_0x3af7,0x16d));var _0x73af=function(_0x22f97d,_0x40f49b){_0x22f97d=_0x22f97d-0x0;var _0x1703eb=_0x3af7[_0x22f97d];return _0x1703eb;};'use strict';var _=require(_0x73af('0x0'));var util=require(_0x73af('0x1'));var logger=require(_0x73af('0x2'))(_0x73af('0x3'));var moment=require(_0x73af('0x4'));var BPromise=require(_0x73af('0x5'));var rp=require(_0x73af('0x6'));var fs=require('fs');var path=require(_0x73af('0x7'));var rimraf=require(_0x73af('0x8'));var config=require(_0x73af('0x9'));var attributes=require('./mailInteraction.attributes');module[_0x73af('0xa')]=function(_0xd2a468,_0x21828f){return _0xd2a468[_0x73af('0xb')]('MailInteraction',attributes,{'tableName':_0x73af('0xc'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':['subject','to'],'type':_0x73af('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4df37a,_0x5ef9d3,_0x189d0c){if(_0x4df37a[_0x73af('0xe')]){_0x4df37a['substatusAt']=moment()[_0x73af('0xf')](_0x73af('0x10'));}if(_0x4df37a[_0x73af('0x11')]){_0x4df37a[_0x73af('0x12')]=moment()[_0x73af('0xf')](_0x73af('0x10'));}_0x189d0c(null,_0x5ef9d3);},'beforeUpdate':function(_0x4a5a34,_0x4be563,_0x49c738){if(_0x4a5a34[_0x73af('0x13')]('substatus')){_0x4a5a34['substatusAt']=_0x4a5a34[_0x73af('0xe')]?moment()[_0x73af('0xf')](_0x73af('0x10')):null;}if(_0x4a5a34[_0x73af('0x13')]('closed')){_0x4a5a34[_0x73af('0x12')]=moment()[_0x73af('0xf')](_0x73af('0x10'));_0x4a5a34[_0x73af('0xe')]=null;_0x4a5a34['substatusAt']=null;}_0x49c738(null,_0x4a5a34);},'afterUpdate':function(_0x5de4c7,_0x4946b5,_0x55204d){var _0x5a0caf=_0xd2a468[_0x73af('0x14')];var _0x23b675=_0x5de4c7[_0x73af('0x15')]({'plain':!![]});if(_0x23b675[_0x73af('0x11')]){return _0x5a0caf[_0x73af('0x16')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x23b675['id']}})[_0x73af('0x17')](function(){_0x55204d();})[_0x73af('0x18')](function(_0x55c675){_0x55204d(_0x55c675);});}else{_0x55204d();}}},'charset':_0x73af('0x19'),'collate':_0x73af('0x1a')});}; \ No newline at end of file +var _0x1199=['rimraf','../../config/environment','./mailInteraction.attributes','exports','define','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','substatus','models','get','MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x10b9ab,_0x3533bb){var _0x915365=function(_0x2c30ca){while(--_0x2c30ca){_0x10b9ab['push'](_0x10b9ab['shift']());}};_0x915365(++_0x3533bb);}(_0x1199,0xf1));var _0x9119=function(_0x1c2d7b,_0x91c1c1){_0x1c2d7b=_0x1c2d7b-0x0;var _0x57273b=_0x1199[_0x1c2d7b];return _0x57273b;};'use strict';var _=require(_0x9119('0x0'));var util=require(_0x9119('0x1'));var logger=require(_0x9119('0x2'))(_0x9119('0x3'));var moment=require(_0x9119('0x4'));var BPromise=require(_0x9119('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9119('0x6'));var rimraf=require(_0x9119('0x7'));var config=require(_0x9119('0x8'));var attributes=require(_0x9119('0x9'));module[_0x9119('0xa')]=function(_0x71a8fa,_0x4cba44){return _0x71a8fa[_0x9119('0xb')]('MailInteraction',attributes,{'tableName':_0x9119('0xc'),'paranoid':![],'indexes':[{'name':_0x9119('0xd'),'fields':[_0x9119('0xe'),'to'],'type':_0x9119('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1e9903,_0x4c66dc,_0x3c645f){if(_0x1e9903['substatus']){_0x1e9903[_0x9119('0x10')]=moment()[_0x9119('0x11')](_0x9119('0x12'));}if(_0x1e9903[_0x9119('0x13')]){_0x1e9903[_0x9119('0x14')]=moment()[_0x9119('0x11')](_0x9119('0x12'));}_0x3c645f(null,_0x4c66dc);},'beforeUpdate':function(_0x8ee44b,_0x3d3557,_0x178612){if(_0x8ee44b[_0x9119('0x15')](_0x9119('0x16'))){_0x8ee44b[_0x9119('0x10')]=_0x8ee44b[_0x9119('0x16')]?moment()[_0x9119('0x11')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x8ee44b[_0x9119('0x15')]('closed')){_0x8ee44b['closedAt']=moment()[_0x9119('0x11')](_0x9119('0x12'));_0x8ee44b[_0x9119('0x16')]=null;_0x8ee44b[_0x9119('0x10')]=null;}_0x178612(null,_0x8ee44b);},'afterUpdate':function(_0x18c2f2,_0x10fa43,_0x4408b8){var _0x5c6aa6=_0x71a8fa[_0x9119('0x17')];var _0x237cd7=_0x18c2f2[_0x9119('0x18')]({'plain':!![]});if(_0x237cd7[_0x9119('0x13')]){return _0x5c6aa6[_0x9119('0x19')][_0x9119('0x1a')]({'read':!![]},{'where':{'MailInteractionId':_0x237cd7['id']}})[_0x9119('0x1b')](function(){_0x4408b8();})[_0x9119('0x1c')](function(_0x239ebc){_0x4408b8(_0x239ebc);});}else{_0x4408b8();}}},'charset':_0x9119('0x1d'),'collate':_0x9119('0x1e')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index cd27a90..5dc5676 100644 --- a/server/api/mailInteraction/mailInteraction.rpc.js +++ b/server/api/mailInteraction/mailInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2b0a=['MailInteraction','update','body','options','raw','where','attributes','limit','UpdateMailInteraction','AddTagsToMailInteraction','find','addTags','ids','spread','AddTags','lodash','util','bluebird','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x2fcf3c,_0x214146){var _0x14808c=function(_0x3bffc0){while(--_0x3bffc0){_0x2fcf3c['push'](_0x2fcf3c['shift']());}};_0x14808c(++_0x214146);}(_0x2b0a,0x84));var _0xa2b0=function(_0x51219b,_0xfe8ccc){_0x51219b=_0x51219b-0x0;var _0x1cdb3d=_0x2b0a[_0x51219b];return _0x1cdb3d;};'use strict';var _=require(_0xa2b0('0x0'));var util=require(_0xa2b0('0x1'));var moment=require('moment');var BPromise=require(_0xa2b0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa2b0('0x3'))(_0xa2b0('0x4'));var config=require(_0xa2b0('0x5'));var jayson=require(_0xa2b0('0x6'));var client=jayson[_0xa2b0('0x7')][_0xa2b0('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0xa2b0('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa2b0('0x9')]));require(_0xa2b0('0xa'))[_0xa2b0('0xb')](socket);function respondWithRpcPromise(_0x288acc,_0x1b3a5c,_0xc02bee){return new BPromise(function(_0x5c868d,_0x11b420){return client[_0xa2b0('0xc')](_0x288acc,_0xc02bee)[_0xa2b0('0xd')](function(_0x55e9d5){logger[_0xa2b0('0xe')](_0xa2b0('0xf'),_0x1b3a5c,'request\x20sent');logger[_0xa2b0('0x10')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x1b3a5c,_0xa2b0('0x11'),JSON[_0xa2b0('0x12')](_0x55e9d5));if(_0x55e9d5[_0xa2b0('0x13')]){if(_0x55e9d5[_0xa2b0('0x13')][_0xa2b0('0x14')]===0x1f4){logger[_0xa2b0('0x13')](_0xa2b0('0xf'),_0x1b3a5c,_0x55e9d5[_0xa2b0('0x13')][_0xa2b0('0x15')]);return _0x11b420(_0x55e9d5[_0xa2b0('0x13')][_0xa2b0('0x15')]);}logger[_0xa2b0('0x13')]('MailInteraction,\x20%s,\x20%s',_0x1b3a5c,_0x55e9d5['error']['message']);return _0x5c868d(_0x55e9d5[_0xa2b0('0x13')]['message']);}else{logger[_0xa2b0('0xe')]('MailInteraction,\x20%s,\x20%s',_0x1b3a5c,_0xa2b0('0x11'));_0x5c868d(_0x55e9d5[_0xa2b0('0x16')][_0xa2b0('0x15')]);}})[_0xa2b0('0x17')](function(_0x110317){logger[_0xa2b0('0x13')](_0xa2b0('0xf'),_0x1b3a5c,_0x110317);_0x11b420(_0x110317);});});}exports['UpdateMailInteraction']=function(_0xfdec29){var _0x480145=this;return new Promise(function(_0x2eb66b,_0x2c348f){return db[_0xa2b0('0x18')][_0xa2b0('0x19')](_0xfdec29[_0xa2b0('0x1a')],{'raw':_0xfdec29[_0xa2b0('0x1b')]?_0xfdec29['options'][_0xa2b0('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xfdec29[_0xa2b0('0x1b')]?_0xfdec29[_0xa2b0('0x1b')][_0xa2b0('0x1d')]||null:null,'attributes':_0xfdec29[_0xa2b0('0x1b')]?_0xfdec29['options'][_0xa2b0('0x1e')]||null:null,'limit':_0xfdec29[_0xa2b0('0x1b')]?_0xfdec29[_0xa2b0('0x1b')][_0xa2b0('0x1f')]||null:null})[_0xa2b0('0xd')](function(_0x3904f7){logger[_0xa2b0('0xe')]('UpdateMailInteraction',_0xfdec29);logger['debug']('UpdateMailInteraction',_0xfdec29,JSON[_0xa2b0('0x12')](_0x3904f7));_0x2eb66b(_0x3904f7);})[_0xa2b0('0x17')](function(_0x546c82){logger[_0xa2b0('0x13')](_0xa2b0('0x20'),_0x546c82[_0xa2b0('0x15')],_0xfdec29);_0x2c348f(_0x480145[_0xa2b0('0x13')](0x1f4,_0x546c82['message']));});});};exports[_0xa2b0('0x21')]=function(_0x1179ab){return new Promise(function(_0xb84d3c,_0x3bb493){return db[_0xa2b0('0x18')][_0xa2b0('0x22')]({'where':_0x1179ab[_0xa2b0('0x1b')]?_0x1179ab[_0xa2b0('0x1b')]['where']||null:null})['then'](function(_0x446547){if(_0x446547){return _0x446547[_0xa2b0('0x23')](_0x1179ab['body'][_0xa2b0('0x24')],_['omit'](_0x1179ab[_0xa2b0('0x1a')],[_0xa2b0('0x24'),'id'])||{});}})[_0xa2b0('0x25')](function(_0x1e2134){logger[_0xa2b0('0xe')](_0xa2b0('0x26'),_0x1179ab);logger['debug'](_0xa2b0('0x26'),_0x1179ab,JSON[_0xa2b0('0x12')](_0x1e2134));_0xb84d3c(_0x1e2134);})[_0xa2b0('0x17')](function(_0x4ff24c){logger[_0xa2b0('0x13')](_0xa2b0('0x26'),_0x4ff24c[_0xa2b0('0x15')],_0x1179ab);_0x3bb493(_this[_0xa2b0('0x13')](0x1f4,_0x4ff24c[_0xa2b0('0x15')]));});});}; \ No newline at end of file +var _0x67e8=['options','raw','attributes','limit','debug','AddTagsToMailInteraction','MailInteraction','find','where','addTags','omit','ids','spread','AddTags','lodash','util','moment','ioredis','../../mysqldb','rpc','jayson/promise','client','redis','defaults','localhost','./mailInteraction.socket','request','then','info','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','MailInteraction,\x20%s,\x20%s','catch','UpdateMailInteraction','update','body'];(function(_0x1d595c,_0x251edd){var _0x3ba529=function(_0x1b4efa){while(--_0x1b4efa){_0x1d595c['push'](_0x1d595c['shift']());}};_0x3ba529(++_0x251edd);}(_0x67e8,0x86));var _0x867e=function(_0x3481fe,_0x4e47bd){_0x3481fe=_0x3481fe-0x0;var _0x44a27e=_0x67e8[_0x3481fe];return _0x44a27e;};'use strict';var _=require(_0x867e('0x0'));var util=require(_0x867e('0x1'));var moment=require(_0x867e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x867e('0x3'));var db=require(_0x867e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x867e('0x5'));var config=require('../../config/environment');var jayson=require(_0x867e('0x6'));var client=jayson[_0x867e('0x7')]['http']({'port':0x232a});config[_0x867e('0x8')]=_[_0x867e('0x9')](config[_0x867e('0x8')],{'host':_0x867e('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x867e('0x8')]));require(_0x867e('0xb'))['register'](socket);function respondWithRpcPromise(_0x28a75f,_0x5ce808,_0x1d373a){return new BPromise(function(_0x30b5d9,_0x2d96e1){return client[_0x867e('0xc')](_0x28a75f,_0x1d373a)[_0x867e('0xd')](function(_0x452061){logger[_0x867e('0xe')]('MailInteraction,\x20%s,\x20%s',_0x5ce808,'request\x20sent');logger['debug'](_0x867e('0xf'),_0x5ce808,_0x867e('0x10'),JSON[_0x867e('0x11')](_0x452061));if(_0x452061[_0x867e('0x12')]){if(_0x452061['error'][_0x867e('0x13')]===0x1f4){logger[_0x867e('0x12')]('MailInteraction,\x20%s,\x20%s',_0x5ce808,_0x452061[_0x867e('0x12')]['message']);return _0x2d96e1(_0x452061[_0x867e('0x12')][_0x867e('0x14')]);}logger[_0x867e('0x12')](_0x867e('0x15'),_0x5ce808,_0x452061[_0x867e('0x12')][_0x867e('0x14')]);return _0x30b5d9(_0x452061['error']['message']);}else{logger[_0x867e('0xe')]('MailInteraction,\x20%s,\x20%s',_0x5ce808,_0x867e('0x10'));_0x30b5d9(_0x452061['result']['message']);}})[_0x867e('0x16')](function(_0x4e3e6c){logger[_0x867e('0x12')](_0x867e('0x15'),_0x5ce808,_0x4e3e6c);_0x2d96e1(_0x4e3e6c);});});}exports[_0x867e('0x17')]=function(_0x5940d3){var _0x3ef474=this;return new Promise(function(_0x30c22c,_0x4bbf35){return db['MailInteraction'][_0x867e('0x18')](_0x5940d3[_0x867e('0x19')],{'raw':_0x5940d3[_0x867e('0x1a')]?_0x5940d3[_0x867e('0x1a')][_0x867e('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5940d3[_0x867e('0x1a')]?_0x5940d3[_0x867e('0x1a')]['where']||null:null,'attributes':_0x5940d3[_0x867e('0x1a')]?_0x5940d3[_0x867e('0x1a')][_0x867e('0x1c')]||null:null,'limit':_0x5940d3[_0x867e('0x1a')]?_0x5940d3[_0x867e('0x1a')][_0x867e('0x1d')]||null:null})['then'](function(_0x60d32b){logger[_0x867e('0xe')](_0x867e('0x17'),_0x5940d3);logger[_0x867e('0x1e')](_0x867e('0x17'),_0x5940d3,JSON[_0x867e('0x11')](_0x60d32b));_0x30c22c(_0x60d32b);})[_0x867e('0x16')](function(_0x3b2d3b){logger[_0x867e('0x12')](_0x867e('0x17'),_0x3b2d3b[_0x867e('0x14')],_0x5940d3);_0x4bbf35(_0x3ef474[_0x867e('0x12')](0x1f4,_0x3b2d3b[_0x867e('0x14')]));});});};exports[_0x867e('0x1f')]=function(_0x3ad968){return new Promise(function(_0x22d12c,_0x2d2bad){return db[_0x867e('0x20')][_0x867e('0x21')]({'where':_0x3ad968[_0x867e('0x1a')]?_0x3ad968[_0x867e('0x1a')][_0x867e('0x22')]||null:null})[_0x867e('0xd')](function(_0x60fcf7){if(_0x60fcf7){return _0x60fcf7[_0x867e('0x23')](_0x3ad968[_0x867e('0x19')]['ids'],_[_0x867e('0x24')](_0x3ad968['body'],[_0x867e('0x25'),'id'])||{});}})[_0x867e('0x26')](function(_0x4e6348){logger[_0x867e('0xe')](_0x867e('0x27'),_0x3ad968);logger[_0x867e('0x1e')]('AddTags',_0x3ad968,JSON[_0x867e('0x11')](_0x4e6348));_0x22d12c(_0x4e6348);})['catch'](function(_0x5b72f6){logger[_0x867e('0x12')](_0x867e('0x27'),_0x5b72f6['message'],_0x3ad968);_0x2d2bad(_this[_0x867e('0x12')](0x1f4,_0x5b72f6[_0x867e('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 10fec7f..84b0ddb 100644 --- a/server/api/mailInteraction/mailInteraction.socket.js +++ b/server/api/mailInteraction/mailInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd656=['emit','removeListener','register','length','mailInteraction:','save','remove','update'];(function(_0x514fac,_0x52278a){var _0x54fbb2=function(_0x4ddfed){while(--_0x4ddfed){_0x514fac['push'](_0x514fac['shift']());}};_0x54fbb2(++_0x52278a);}(_0xd656,0x1ad));var _0x6d65=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xd656[_0x501510];return _0x1e6ee5;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x6d65('0x0'),_0x6d65('0x1'),_0x6d65('0x2')];function createListener(_0x2cfdfe,_0xb2fd04){return function(_0x59a859){_0xb2fd04[_0x6d65('0x3')](_0x2cfdfe,_0x59a859);};}function removeListener(_0xcdd601,_0x35608a){return function(){MailInteractionEvents[_0x6d65('0x4')](_0xcdd601,_0x35608a);};}exports[_0x6d65('0x5')]=function(_0x5d934e){for(var _0x55d84e=0x0,_0xfe0e42=events[_0x6d65('0x6')];_0x55d84e<_0xfe0e42;_0x55d84e++){var _0x6fcb37=events[_0x55d84e];var _0x251b0a=createListener(_0x6d65('0x7')+_0x6fcb37,_0x5d934e);MailInteractionEvents['on'](_0x6fcb37,_0x251b0a);}}; \ No newline at end of file +var _0x4e21=['update','removeListener','mailInteraction:','save'];(function(_0x2179f1,_0x21c653){var _0x176ec9=function(_0x4c4a4c){while(--_0x4c4a4c){_0x2179f1['push'](_0x2179f1['shift']());}};_0x176ec9(++_0x21c653);}(_0x4e21,0xab));var _0x14e2=function(_0x20b0be,_0x31a199){_0x20b0be=_0x20b0be-0x0;var _0x3c5af6=_0x4e21[_0x20b0be];return _0x3c5af6;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x14e2('0x0'),'remove',_0x14e2('0x1')];function createListener(_0x882b77,_0x20d662){return function(_0x6e50f4){_0x20d662['emit'](_0x882b77,_0x6e50f4);};}function removeListener(_0x4423e1,_0x36d2db){return function(){MailInteractionEvents[_0x14e2('0x2')](_0x4423e1,_0x36d2db);};}exports['register']=function(_0x832db2){for(var _0x32d1fd=0x0,_0x56aa6d=events['length'];_0x32d1fd<_0x56aa6d;_0x32d1fd++){var _0x230a43=events[_0x32d1fd];var _0x1d7cd7=createListener(_0x14e2('0x3')+_0x230a43,_0x832db2);MailInteractionEvents['on'](_0x230a43,_0x1d7cd7);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 2038d37..42a0535 100644 --- a/server/api/mailMessage/index.js +++ b/server/api/mailMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x49e9=['Router','../../components/interaction/service','./mailMessage.controller','get','isAuthenticated','/describe','describe','/:id','download','post','tracked','mail','mailmessage:create','create','put','update','/:id/accept','accept','/:id/reject','delete','destroy','multer','util','connect-timeout','express'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x49e9,0x10f));var _0x949e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x49e9[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x949e('0x0'));var util=require(_0x949e('0x1'));var path=require('path');var timeout=require(_0x949e('0x2'));var express=require(_0x949e('0x3'));var router=express[_0x949e('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x949e('0x5'));var config=require('../../config/environment');var controller=require(_0x949e('0x6'));router[_0x949e('0x7')]('/',auth[_0x949e('0x8')](),controller['index']);router[_0x949e('0x7')](_0x949e('0x9'),auth[_0x949e('0x8')](),controller[_0x949e('0xa')]);router[_0x949e('0x7')](_0x949e('0xb'),auth[_0x949e('0x8')](),controller['show']);router[_0x949e('0x7')]('/:id/download',auth[_0x949e('0x8')](),controller[_0x949e('0xc')]);router[_0x949e('0xd')]('/',auth['isAuthenticated'](),interaction[_0x949e('0xe')](_0x949e('0xf'),_0x949e('0x10')),controller[_0x949e('0x11')]);router[_0x949e('0x12')](_0x949e('0xb'),auth[_0x949e('0x8')](),controller[_0x949e('0x13')]);router[_0x949e('0x12')](_0x949e('0x14'),auth[_0x949e('0x8')](),controller[_0x949e('0x15')]);router[_0x949e('0x12')](_0x949e('0x16'),auth[_0x949e('0x8')](),controller['reject']);router[_0x949e('0x17')](_0x949e('0xb'),auth[_0x949e('0x8')](),controller[_0x949e('0x18')]);module['exports']=router; \ No newline at end of file +var _0x0bb5=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','/describe','isAuthenticated','describe','show','/:id/download','download','post','tracked','mail','mailmessage:create','create','/:id','update','put','/:id/accept','accept','/:id/reject','reject','destroy','exports','multer','util'];(function(_0x3aa320,_0x5b2864){var _0x6b7f30=function(_0x8c8d21){while(--_0x8c8d21){_0x3aa320['push'](_0x3aa320['shift']());}};_0x6b7f30(++_0x5b2864);}(_0x0bb5,0x148));var _0x50bb=function(_0x4d0dcd,_0x47383e){_0x4d0dcd=_0x4d0dcd-0x0;var _0x4c49dc=_0x0bb5[_0x4d0dcd];return _0x4c49dc;};'use strict';var multer=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x50bb('0x2'));var router=express[_0x50bb('0x3')]();var fs_extra=require(_0x50bb('0x4'));var auth=require(_0x50bb('0x5'));var interaction=require(_0x50bb('0x6'));var config=require(_0x50bb('0x7'));var controller=require(_0x50bb('0x8'));router[_0x50bb('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x50bb('0x9')](_0x50bb('0xa'),auth[_0x50bb('0xb')](),controller[_0x50bb('0xc')]);router['get']('/:id',auth[_0x50bb('0xb')](),controller[_0x50bb('0xd')]);router[_0x50bb('0x9')](_0x50bb('0xe'),auth['isAuthenticated'](),controller[_0x50bb('0xf')]);router[_0x50bb('0x10')]('/',auth[_0x50bb('0xb')](),interaction[_0x50bb('0x11')](_0x50bb('0x12'),_0x50bb('0x13')),controller[_0x50bb('0x14')]);router['put'](_0x50bb('0x15'),auth['isAuthenticated'](),controller[_0x50bb('0x16')]);router[_0x50bb('0x17')](_0x50bb('0x18'),auth['isAuthenticated'](),controller[_0x50bb('0x19')]);router[_0x50bb('0x17')](_0x50bb('0x1a'),auth['isAuthenticated'](),controller[_0x50bb('0x1b')]);router['delete'](_0x50bb('0x15'),auth[_0x50bb('0xb')](),controller[_0x50bb('0x1c')]);module[_0x50bb('0x1d')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 2a22e25..4f0d55c 100644 --- a/server/api/mailMessage/mailMessage.attributes.js +++ b/server/api/mailMessage/mailMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x883f=['INTEGER','Email','Chat','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','long','DATE'];(function(_0x515bf6,_0x186bc8){var _0xbebd0=function(_0x3deb48){while(--_0x3deb48){_0x515bf6['push'](_0x515bf6['shift']());}};_0xbebd0(++_0x186bc8);}(_0x883f,0x189));var _0xf883=function(_0x368027,_0x48d604){_0x368027=_0x368027-0x0;var _0x1c3689=_0x883f[_0x368027];return _0x1c3689;};'use strict';var Sequelize=require(_0xf883('0x0'));var _=require('lodash');module[_0xf883('0x1')]={'body':{'type':Sequelize[_0xf883('0x2')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf883('0x2')](_0xf883('0x3'))},'read':{'type':Sequelize[_0xf883('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf883('0x5')]('in',_0xf883('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xf883('0x7')](0x1fe)},'from':{'type':Sequelize[_0xf883('0x7')]},'to':{'type':Sequelize[_0xf883('0x2')](_0xf883('0x8'))},'cc':{'type':Sequelize[_0xf883('0x2')](_0xf883('0x8'))},'bcc':{'type':Sequelize[_0xf883('0x2')](_0xf883('0x8'))},'subject':{'type':Sequelize[_0xf883('0x2')]},'sentAt':{'type':Sequelize[_0xf883('0x9')]},'attach':{'type':Sequelize[_0xf883('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xf883('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xf883('0x9')]},'originTo':{'type':Sequelize[_0xf883('0x2')](_0xf883('0x8'))},'originCc':{'type':Sequelize[_0xf883('0x2')](_0xf883('0x8'))},'originChannel':{'type':Sequelize[_0xf883('0x5')](_0xf883('0xb'),_0xf883('0xc')),'defaultValue':_0xf883('0xb'),'allowNull':![]}}; \ No newline at end of file +var _0x94a6=['out','STRING','DATE','INTEGER','BOOLEAN','Email','lodash','exports','TEXT','long','medium','ENUM'];(function(_0x1bce0e,_0x26dfdf){var _0x2013ec=function(_0x4fb193){while(--_0x4fb193){_0x1bce0e['push'](_0x1bce0e['shift']());}};_0x2013ec(++_0x26dfdf);}(_0x94a6,0xae));var _0x694a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x94a6[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var _=require(_0x694a('0x0'));module[_0x694a('0x1')]={'body':{'type':Sequelize[_0x694a('0x2')](_0x694a('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x694a('0x2')](_0x694a('0x4'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x694a('0x5')]('in','out'),'defaultValue':_0x694a('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x694a('0x7')](0x1fe)},'from':{'type':Sequelize[_0x694a('0x7')]},'to':{'type':Sequelize[_0x694a('0x2')](_0x694a('0x3'))},'cc':{'type':Sequelize[_0x694a('0x2')](_0x694a('0x3'))},'bcc':{'type':Sequelize[_0x694a('0x2')]('long')},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x694a('0x8')]},'attach':{'type':Sequelize[_0x694a('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x694a('0xa')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x694a('0x2')](_0x694a('0x3'))},'originCc':{'type':Sequelize['TEXT'](_0x694a('0x3'))},'originChannel':{'type':Sequelize[_0x694a('0x5')](_0x694a('0xb'),'Chat'),'defaultValue':_0x694a('0xb'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 3b7a72c..3e898a4 100644 --- a/server/api/mailMessage/mailMessage.controller.js +++ b/server/api/mailMessage/mailMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd713=['debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result','catch','offset','undefined','limit','count','json','update','destroy','status','end','stack','name','send','index','map','MailMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','show','params','includeAll','find','body','describe','create','direction','out','secret','split','MailAccountId','CmList','CmContact','Contacts','updatedAt','DESC','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','basename','List','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','user','agent','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface','SIP/%s','channel','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','ContactId','sequelize','motionChannel','event','fromString','rejectmessage','unix','toString','server','files','tmp','message-%s.eml','from','bcc','subject','Attachment','Attachments','decode','headers','Bcc','existsSync','push','readFileSync','writeFileSync','unlinkSync','moment','bluebird','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','html-entities','./mailMessage.socket','register','jayson/promise','http','request','then','MailMessage,\x20%s,\x20%s'];(function(_0xb1f5f5,_0x274c29){var _0x26f76d=function(_0x42c203){while(--_0x42c203){_0xb1f5f5['push'](_0xb1f5f5['shift']());}};_0x26f76d(++_0x274c29);}(_0xd713,0x88));var _0x3d71=function(_0xb20b4e,_0x7cc362){_0xb20b4e=_0xb20b4e-0x0;var _0x13dd0c=_0xd713[_0xb20b4e];return _0x13dd0c;};'use strict';var emlformat=require('eml-format');var moment=require(_0x3d71('0x0'));var BPromise=require(_0x3d71('0x1'));var util=require('util');var path=require(_0x3d71('0x2'));var fs=require('fs');var _=require(_0x3d71('0x3'));var Redis=require(_0x3d71('0x4'));var htmlToText=require(_0x3d71('0x5'));var qs=require(_0x3d71('0x6'));var logger=require(_0x3d71('0x7'))(_0x3d71('0x8'));var interaction_log=require('../../config/logger')(_0x3d71('0x9'));var config=require(_0x3d71('0xa'));var db=require(_0x3d71('0xb'))['db'];config[_0x3d71('0xc')]=_[_0x3d71('0xd')](config[_0x3d71('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x3d71('0xe'))(new Redis(config[_0x3d71('0xc')]));var htmlEntities=require(_0x3d71('0xf'));require(_0x3d71('0x10'))[_0x3d71('0x11')](socket);var jayson=require(_0x3d71('0x12'));var client=jayson['client'][_0x3d71('0x13')]({'port':0x232c});var client9003=jayson['client'][_0x3d71('0x13')]({'port':0x232b});var client9002=jayson['client'][_0x3d71('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x43fd1b,_0x396bc6,_0x424eeb,_0xf5c532){return new BPromise(function(_0x17d437,_0x4c08b6){var _0x3edc56=_0xf5c532||client;return _0x3edc56[_0x3d71('0x14')](_0x43fd1b,_0x424eeb)[_0x3d71('0x15')](function(_0x4edff0){logger['info'](_0x3d71('0x16'),_0x396bc6,'request\x20sent');logger[_0x3d71('0x17')](_0x3d71('0x18'),_0x396bc6,_0x3d71('0x19'),JSON[_0x3d71('0x1a')](_0x4edff0));if(_0x4edff0['error']){if(_0x4edff0['error'][_0x3d71('0x1b')]===0x1f4){logger[_0x3d71('0x1c')](_0x3d71('0x16'),_0x396bc6,_0x4edff0[_0x3d71('0x1c')][_0x3d71('0x1d')]);return _0x4c08b6(_0x4edff0[_0x3d71('0x1c')]['message']);}logger[_0x3d71('0x1c')](_0x3d71('0x16'),_0x396bc6,_0x4edff0['error'][_0x3d71('0x1d')]);return _0x17d437(_0x4edff0[_0x3d71('0x1c')][_0x3d71('0x1d')]);}else{logger[_0x3d71('0x1e')]('MailMessage,\x20%s,\x20%s',_0x396bc6,_0x3d71('0x19'));_0x17d437(_0x4edff0[_0x3d71('0x1f')][_0x3d71('0x1d')]);}})[_0x3d71('0x20')](function(_0x3312d9){logger[_0x3d71('0x1c')](_0x3d71('0x16'),_0x396bc6,_0x3312d9);_0x4c08b6(_0x3312d9);});});}function respondWithResult(_0x3d5b10,_0x5c7922){_0x5c7922=_0x5c7922||0xc8;return function(_0x3d4ce0){if(_0x3d4ce0){return _0x3d5b10['status'](_0x5c7922)['json'](_0x3d4ce0);}};}function respondWithFilteredResult(_0xf6da66,_0x26eb35){return function(_0x221b3d){if(_0x221b3d){var _0x17d48e=typeof _0x26eb35[_0x3d71('0x21')]===_0x3d71('0x22')&&typeof _0x26eb35[_0x3d71('0x23')]===_0x3d71('0x22');var _0x24dcad=_0x221b3d['count'];var _0x12ea38=_0x17d48e?0x0:_0x26eb35[_0x3d71('0x21')];var _0x2e27c9=_0x17d48e?_0x221b3d[_0x3d71('0x24')]:_0x26eb35[_0x3d71('0x21')]+_0x26eb35['limit'];var _0x49b5a7;if(_0x2e27c9>=_0x24dcad){_0x2e27c9=_0x24dcad;_0x49b5a7=0xc8;}else{_0x49b5a7=0xce;}_0xf6da66['status'](_0x49b5a7);return _0xf6da66['set']('Content-Range',_0x12ea38+'-'+_0x2e27c9+'/'+_0x24dcad)[_0x3d71('0x25')](_0x221b3d);}return null;};}function saveUpdates(_0x7ac352){return function(_0x2e7dce){if(_0x2e7dce){return _0x2e7dce[_0x3d71('0x26')](_0x7ac352)[_0x3d71('0x15')](function(_0x376b86){return _0x376b86;});}return null;};}function removeEntity(_0x215c31){return function(_0x231f45){if(_0x231f45){return _0x231f45[_0x3d71('0x27')]()['then'](function(){_0x215c31[_0x3d71('0x28')](0xcc)[_0x3d71('0x29')]();});}};}function handleEntityNotFound(_0x1dff12){return function(_0x2b6098){if(!_0x2b6098){_0x1dff12['sendStatus'](0x194);}return _0x2b6098;};}function handleError(_0x4c9127,_0x308ad2){_0x308ad2=_0x308ad2||0x1f4;return function(_0x5a93be){logger['error'](_0x5a93be[_0x3d71('0x2a')]);if(_0x5a93be[_0x3d71('0x2b')]){delete _0x5a93be[_0x3d71('0x2b')];}_0x4c9127[_0x3d71('0x28')](_0x308ad2)[_0x3d71('0x2c')](_0x5a93be);};}exports[_0x3d71('0x2d')]=function(_0x47a635,_0x2b382a){var _0x41f7b1={},_0x1be7ab={},_0x1aeb3d={'count':0x0,'rows':[]};var _0x2da4f6=_[_0x3d71('0x2e')](db[_0x3d71('0x2f')][_0x3d71('0x30')],function(_0x2e5aa4){return{'name':_0x2e5aa4[_0x3d71('0x31')],'type':_0x2e5aa4[_0x3d71('0x32')][_0x3d71('0x33')]};});_0x1be7ab['model']=_[_0x3d71('0x2e')](_0x2da4f6,_0x3d71('0x2b'));_0x1be7ab[_0x3d71('0x34')]=_[_0x3d71('0x35')](_0x47a635['query']);_0x1be7ab[_0x3d71('0x36')]=_[_0x3d71('0x37')](_0x1be7ab[_0x3d71('0x38')],_0x1be7ab[_0x3d71('0x34')]);_0x41f7b1[_0x3d71('0x39')]=_[_0x3d71('0x37')](_0x1be7ab[_0x3d71('0x38')],qs[_0x3d71('0x3a')](_0x47a635['query']['fields']));_0x41f7b1[_0x3d71('0x39')]=_0x41f7b1[_0x3d71('0x39')][_0x3d71('0x3b')]?_0x41f7b1[_0x3d71('0x39')]:_0x1be7ab[_0x3d71('0x38')];if(!_0x47a635[_0x3d71('0x34')]['hasOwnProperty'](_0x3d71('0x3c'))){_0x41f7b1['limit']=qs[_0x3d71('0x23')](_0x47a635['query'][_0x3d71('0x23')]);_0x41f7b1['offset']=qs[_0x3d71('0x21')](_0x47a635['query'][_0x3d71('0x21')]);}_0x41f7b1[_0x3d71('0x3d')]=qs[_0x3d71('0x3e')](_0x47a635[_0x3d71('0x34')][_0x3d71('0x3e')]);_0x41f7b1[_0x3d71('0x3f')]=qs[_0x3d71('0x36')](_[_0x3d71('0x40')](_0x47a635[_0x3d71('0x34')],_0x1be7ab[_0x3d71('0x36')]),_0x2da4f6);if(_0x47a635['query']['filter']){_0x41f7b1['where']=_[_0x3d71('0x41')](_0x41f7b1[_0x3d71('0x3f')],{'$or':_[_0x3d71('0x2e')](_0x2da4f6,function(_0x14fb96){if(_0x14fb96['type']!==_0x3d71('0x42')){var _0x221ddc={};_0x221ddc[_0x14fb96[_0x3d71('0x2b')]]={'$like':'%'+_0x47a635['query'][_0x3d71('0x43')]+'%'};return _0x221ddc;}})});}_0x41f7b1=_[_0x3d71('0x41')]({},_0x41f7b1,_0x47a635[_0x3d71('0x44')]);var _0x119705={'where':_0x41f7b1[_0x3d71('0x3f')]};return db[_0x3d71('0x2f')][_0x3d71('0x24')](_0x119705)[_0x3d71('0x15')](function(_0x5a3578){_0x1aeb3d[_0x3d71('0x24')]=_0x5a3578;if(_0x47a635['query']['includeAll']){_0x41f7b1[_0x3d71('0x45')]=[{'all':!![]}];}return db[_0x3d71('0x2f')]['findAll'](_0x41f7b1);})[_0x3d71('0x15')](function(_0xa04662){_0x1aeb3d['rows']=_0xa04662;return _0x1aeb3d;})[_0x3d71('0x15')](respondWithFilteredResult(_0x2b382a,_0x41f7b1))[_0x3d71('0x20')](handleError(_0x2b382a,null));};exports[_0x3d71('0x46')]=function(_0x58fa53,_0x4ee063){var _0x287ade={'raw':!![],'where':{'id':_0x58fa53[_0x3d71('0x47')]['id']}},_0x3f18cf={};_0x3f18cf[_0x3d71('0x38')]=_[_0x3d71('0x35')](db[_0x3d71('0x2f')]['rawAttributes']);_0x3f18cf[_0x3d71('0x34')]=_[_0x3d71('0x35')](_0x58fa53['query']);_0x3f18cf[_0x3d71('0x36')]=_[_0x3d71('0x37')](_0x3f18cf['model'],_0x3f18cf[_0x3d71('0x34')]);_0x287ade[_0x3d71('0x39')]=_[_0x3d71('0x37')](_0x3f18cf[_0x3d71('0x38')],qs['fields'](_0x58fa53['query'][_0x3d71('0x3a')]));_0x287ade['attributes']=_0x287ade[_0x3d71('0x39')][_0x3d71('0x3b')]?_0x287ade['attributes']:_0x3f18cf[_0x3d71('0x38')];if(_0x58fa53[_0x3d71('0x34')][_0x3d71('0x48')]){_0x287ade[_0x3d71('0x45')]=[{'all':!![]}];}_0x287ade=_['merge']({},_0x287ade,_0x58fa53[_0x3d71('0x44')]);return db[_0x3d71('0x2f')][_0x3d71('0x49')](_0x287ade)[_0x3d71('0x15')](handleEntityNotFound(_0x4ee063,null))[_0x3d71('0x15')](respondWithResult(_0x4ee063,null))[_0x3d71('0x20')](handleError(_0x4ee063,null));};exports[_0x3d71('0x26')]=function(_0x16839c,_0x16f529){if(_0x16839c['body']['id']){delete _0x16839c[_0x3d71('0x4a')]['id'];}return db[_0x3d71('0x2f')][_0x3d71('0x49')]({'where':{'id':_0x16839c[_0x3d71('0x47')]['id']}})['then'](handleEntityNotFound(_0x16f529,null))[_0x3d71('0x15')](saveUpdates(_0x16839c[_0x3d71('0x4a')],null))[_0x3d71('0x15')](respondWithResult(_0x16f529,null))['catch'](handleError(_0x16f529,null));};exports[_0x3d71('0x27')]=function(_0x42811e,_0x1a7ec4){return db[_0x3d71('0x2f')][_0x3d71('0x49')]({'where':{'id':_0x42811e[_0x3d71('0x47')]['id']}})['then'](handleEntityNotFound(_0x1a7ec4,null))[_0x3d71('0x15')](removeEntity(_0x1a7ec4,null))['catch'](handleError(_0x1a7ec4,null));};exports[_0x3d71('0x4b')]=function(_0x3e6bf1,_0x1ce7bb){return db['MailMessage'][_0x3d71('0x4b')]()['then'](respondWithResult(_0x1ce7bb,null))[_0x3d71('0x20')](handleError(_0x1ce7bb,null));};exports[_0x3d71('0x4c')]=function(_0x2558e1,_0x51ad67){return db['MailMessage'][_0x3d71('0x4c')](_0x2558e1[_0x3d71('0x4a')])[_0x3d71('0x15')](function(_0x3a50f2){if(_0x3a50f2){if(_0x3a50f2[_0x3d71('0x4d')]===_0x3d71('0x4e')&&!_0x3a50f2[_0x3d71('0x4f')]){var _0x46e0a1,_0x41fbe6,_0x20f0a5;if(_0x2558e1[_0x3d71('0x4a')]['to']){_0x41fbe6=_0x2558e1[_0x3d71('0x4a')]['to'][_0x3d71('0x50')](',')[0x0];}return db['MailAccount']['findOne']({'where':{'id':_0x3a50f2[_0x3d71('0x51')]},'include':[{'model':db[_0x3d71('0x52')],'as':'List','include':[{'model':db[_0x3d71('0x53')],'as':_0x3d71('0x54'),'where':{'email':_0x41fbe6},'limit':0x1,'order':[[_0x3d71('0x55'),_0x3d71('0x56')]]}]},{'model':db['MailServerOut'],'as':_0x3d71('0x57'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x3d71('0x58'),'raw':!![]}]}]})['then'](function(_0x3d8fa9){_0x46e0a1=_0x3d8fa9;if(!_0x46e0a1||!_0x46e0a1[_0x3d71('0x57')])return;var _0x545be3=_0x46e0a1[_0x3d71('0x59')]();if(_0x2558e1[_0x3d71('0x4a')][_0x3d71('0x5a')]&&_0x2558e1[_0x3d71('0x4a')]['attachments']['length']){for(var _0x4ea42d=0x0;_0x4ea42d<_0x2558e1[_0x3d71('0x4a')][_0x3d71('0x5a')]['length'];_0x4ea42d+=0x1){_0x2558e1['body'][_0x3d71('0x5a')][_0x4ea42d]={'filename':_0x2558e1[_0x3d71('0x4a')]['attachments'][_0x4ea42d]['name'],'path':path[_0x3d71('0x5b')](config[_0x3d71('0x5c')],_0x3d71('0x5d'),_0x2558e1[_0x3d71('0x4a')][_0x3d71('0x5a')][_0x4ea42d][_0x3d71('0x5e')])};}}_0x20f0a5={'account':_0x545be3,'message':_0x2558e1[_0x3d71('0x4a')]};return;})['then'](function(){if(_0x46e0a1[_0x3d71('0x5f')]){if(_0x46e0a1[_0x3d71('0x5f')][_0x3d71('0x54')][_0x3d71('0x3b')]){return _0x46e0a1[_0x3d71('0x5f')][_0x3d71('0x54')][0x0];}else{return db[_0x3d71('0x53')][_0x3d71('0x4c')](_[_0x3d71('0xd')](_0x2558e1[_0x3d71('0x4a')],{'firstName':_0x2558e1['body']['to'],'email':_0x2558e1[_0x3d71('0x4a')]['to'],'phone':_0x2558e1[_0x3d71('0x4a')]['to'],'ListId':_0x46e0a1['ListId']}));}}else{throw new Error(_0x3d71('0x60'));}})['then'](function(){if(_0x20f0a5){return respondWithRpcPromise(_0x3d71('0x61'),_0x3d71('0x62'),_0x20f0a5,client9003)[_0x3d71('0x15')](function(_0x556768){return _0x3a50f2['update']({'read':!![],'messageId':_0x556768[_0x3d71('0x63')],'sentAt':moment()[_0x3d71('0x64')](_0x3d71('0x65'))});})[_0x3d71('0x20')](function(_0x115ed0){logger['error']('%s',JSON[_0x3d71('0x1a')](_0x115ed0));return _0x3a50f2;});}return _0x3a50f2;});}return _0x3a50f2;}})[_0x3d71('0x15')](respondWithResult(_0x51ad67,0xc9))[_0x3d71('0x20')](handleError(_0x51ad67,null));};exports[_0x3d71('0x66')]=function(_0x309962,_0x2c2c31){var _0x3f25c1={'agent':{},'channel':_0x3d71('0x67')};if(_0x309962['body']['id']){delete _0x309962['body']['id'];}_0x309962['body'][_0x3d71('0x68')]=!![];_0x309962[_0x3d71('0x4a')][_0x3d71('0x69')]=moment()[_0x3d71('0x64')](_0x3d71('0x65'));_0x309962['body'][_0x3d71('0x6a')]=_0x309962['body'][_0x3d71('0x6a')]||_0x309962[_0x3d71('0x6b')]['id'];_0x3f25c1[_0x3d71('0x6c')]['id']=_0x309962['body'][_0x3d71('0x6a')];return db[_0x3d71('0x2f')][_0x3d71('0x49')]({'where':{'id':_0x309962[_0x3d71('0x47')]['id'],'UserId':null}})[_0x3d71('0x15')](handleEntityNotFound(_0x2c2c31,null))[_0x3d71('0x15')](saveUpdates(_0x309962[_0x3d71('0x4a')],null))[_0x3d71('0x15')](function(_0x2b289b){if(_0x2b289b){_0x3f25c1[_0x3d71('0x1d')]=_0x2b289b['get']({'plain':!![]});return db[_0x3d71('0x6d')][_0x3d71('0x49')]({'where':{'id':_0x2b289b[_0x3d71('0x6e')]}});}return null;})['then'](handleEntityNotFound(_0x2c2c31,null))[_0x3d71('0x15')](function(_0x29cb6f){if(_0x29cb6f){return _0x29cb6f[_0x3d71('0x26')]({'UserId':_0x309962[_0x3d71('0x4a')][_0x3d71('0x6a')],'read1stAt':_[_0x3d71('0x6f')](_0x29cb6f[_0x3d71('0x70')])?moment()[_0x3d71('0x64')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x3d71('0x15')](function(_0x1de4e3){if(_0x1de4e3){_0x3f25c1[_0x3d71('0x71')]=_0x1de4e3[_0x3d71('0x72')]({'plain':!![]});interaction_log['info'](_0x3d71('0x73'),_0x309962[_0x3d71('0x6b')]['id'],_0x309962[_0x3d71('0x6b')]['name'],_0x309962['user']['role'],_0x3f25c1[_0x3d71('0x71')]['id'],_0x309962[_0x3d71('0x4a')]?JSON['stringify'](_0x309962['body']):'null');return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x3f25c1);}return null;})[_0x3d71('0x15')](function(_0x140ade){var _0x570286=_0x3d71('0x74')+_0x140ade[_0x3d71('0x1d')]['ContactId'];return db['sequelize'][_0x3d71('0x34')](_0x570286,{'type':db[_0x3d71('0x75')][_0x3d71('0x76')][_0x3d71('0x77')],'raw':!![]})['then'](function(_0x34553a){return _0x34553a;});})['then'](function(_0x22770d){if(_0x22770d){_0x3f25c1[_0x3d71('0x1d')][_0x3d71('0x78')]=_0x22770d[0x0];if(!_0x309962[_0x3d71('0x4a')][_0x3d71('0x6a')])return;return db[_0x3d71('0x79')][_0x3d71('0x49')]({'where':{'id':_0x309962[_0x3d71('0x4a')]['UserId'],'role':_0x3d71('0x6c')},'attributes':['id','name','fullname',_0x3d71('0x7a'),_0x3d71('0x7b')],'raw':!![]});}return null;})[_0x3d71('0x15')](function(_0x1ac5af){if(!_0x1ac5af)return null;_0x3f25c1[_0x3d71('0x1d')][_0x3d71('0x6c')]=_0x1ac5af;return _0x3f25c1;})[_0x3d71('0x15')](function(_0x3444de){if(_0x3444de){if(_0x309962[_0x3d71('0x4a')][_0x3d71('0x7c')]){_0x3f25c1[_0x3d71('0x1d')][_0x3d71('0x7d')]=util['format'](_0x3d71('0x7e'),_0x309962[_0x3d71('0x6b')][_0x3d71('0x2b')]);_0x3f25c1['message']['channel']=_0x3f25c1['channel'];_0x3f25c1[_0x3d71('0x1d')]['motionChannel']=_0x3f25c1[_0x3d71('0x7f')];_0x3f25c1[_0x3d71('0x1d')]['event']='accept';_0x3f25c1[_0x3d71('0x1d')][_0x3d71('0x4a')]=htmlToText['fromString'](_0x3f25c1[_0x3d71('0x1d')][_0x3d71('0x4a')]);return respondWithRpcPromise(_0x3d71('0x80'),'EventManager',{'event':_0x3d71('0x81'),'message':_0x3f25c1[_0x3d71('0x1d')]},client9002)[_0x3d71('0x15')](function(){return _0x3f25c1;});}return _0x3f25c1;}return null;})['then'](respondWithResult(_0x2c2c31,null))[_0x3d71('0x20')](handleError(_0x2c2c31,null));};exports[_0x3d71('0x82')]=function(_0x49368c,_0x2d5a7b){var _0x3627b0={'agent':{},'channel':'mail'};if(_0x49368c[_0x3d71('0x4a')]['id']){delete _0x49368c['body']['id'];}_0x49368c['body'][_0x3d71('0x6a')]=_0x49368c[_0x3d71('0x4a')][_0x3d71('0x6a')]||_0x49368c[_0x3d71('0x6b')]['id'];_0x3627b0['agent']['id']=_0x49368c[_0x3d71('0x4a')][_0x3d71('0x6a')];return db['MailMessage'][_0x3d71('0x49')]({'where':{'id':_0x49368c[_0x3d71('0x47')]['id'],'UserId':null}})[_0x3d71('0x15')](handleEntityNotFound(_0x2d5a7b,null))[_0x3d71('0x15')](function(_0x1d3a9e){if(_0x1d3a9e){_0x3627b0[_0x3d71('0x1d')]=_0x1d3a9e['get']({'plain':!![]});return db[_0x3d71('0x6d')][_0x3d71('0x49')]({'where':{'id':_0x1d3a9e[_0x3d71('0x6e')]}});}return null;})[_0x3d71('0x15')](handleEntityNotFound(_0x2d5a7b,null))[_0x3d71('0x15')](function(_0x4f219b){if(_0x4f219b){_0x3627b0['interaction']=_0x4f219b[_0x3d71('0x72')]({'plain':!![]});interaction_log['info'](_0x3d71('0x83'),_0x49368c[_0x3d71('0x6b')]['id'],_0x49368c[_0x3d71('0x6b')][_0x3d71('0x2b')],_0x49368c['user'][_0x3d71('0x84')],_0x3627b0[_0x3d71('0x71')]['id'],_0x49368c[_0x3d71('0x4a')]?JSON[_0x3d71('0x1a')](_0x49368c['body']):_0x3d71('0x85'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x3627b0);}return null;})[_0x3d71('0x15')](function(_0x11880c){var _0x5b2968=_0x3d71('0x74')+_0x11880c[_0x3d71('0x1d')][_0x3d71('0x86')];return db[_0x3d71('0x87')][_0x3d71('0x34')](_0x5b2968,{'type':db[_0x3d71('0x75')][_0x3d71('0x76')][_0x3d71('0x77')],'raw':!![]})[_0x3d71('0x15')](function(_0x1f17bd){return _0x1f17bd;});})['then'](function(_0x5dd0c8){if(_0x5dd0c8){_0x3627b0[_0x3d71('0x1d')]['contact']=_0x5dd0c8[0x0];if(!_0x49368c[_0x3d71('0x4a')][_0x3d71('0x6a')])return;return db['User'][_0x3d71('0x49')]({'where':{'id':_0x49368c[_0x3d71('0x4a')]['UserId'],'role':_0x3d71('0x6c')},'attributes':['id',_0x3d71('0x2b'),'fullname',_0x3d71('0x7a'),_0x3d71('0x7b')],'raw':!![]});}return null;})[_0x3d71('0x15')](function(_0x23ae2b){if(!_0x23ae2b)return null;_0x3627b0[_0x3d71('0x1d')][_0x3d71('0x6c')]=_0x23ae2b;return _0x3627b0;})[_0x3d71('0x15')](function(_0x3ed516){if(_0x3ed516){_0x3ed516[_0x3d71('0x1d')][_0x3d71('0x7d')]=util[_0x3d71('0x64')](_0x3d71('0x7e'),_0x49368c[_0x3d71('0x6b')][_0x3d71('0x2b')]);_0x3ed516[_0x3d71('0x1d')][_0x3d71('0x7f')]=_0x3627b0[_0x3d71('0x7f')];_0x3ed516['message'][_0x3d71('0x88')]=_0x3627b0[_0x3d71('0x7f')];_0x3ed516[_0x3d71('0x1d')][_0x3d71('0x89')]=_0x3d71('0x82');_0x3ed516[_0x3d71('0x1d')]['body']=htmlToText[_0x3d71('0x8a')](_0x3627b0['message'][_0x3d71('0x4a')]);respondWithRpcPromise(_0x3d71('0x80'),_0x3d71('0x80'),{'event':_0x3d71('0x8b'),'message':_0x3ed516[_0x3d71('0x1d')]},client9002);return _0x3627b0;}return null;})[_0x3d71('0x15')](respondWithResult(_0x2d5a7b,null))[_0x3d71('0x20')](handleError(_0x2d5a7b,null));};exports['download']=function(_0x219472,_0x5279c5){var _0x4ca7be=moment()[_0x3d71('0x8c')]()[_0x3d71('0x8d')]();var _0x2fe0b7=path[_0x3d71('0x5b')](config[_0x3d71('0x5c')],_0x3d71('0x8e'),_0x3d71('0x8f'),_0x3d71('0x90'));var _0x5b7d13=path[_0x3d71('0x5b')](config['root'],'server','files','attachments');var _0x290f5d=util[_0x3d71('0x64')](_0x3d71('0x91'),_0x4ca7be);return db[_0x3d71('0x2f')]['find']({'where':{'id':_0x219472[_0x3d71('0x47')]['id']},'attributes':['id',_0x3d71('0x4a'),_0x3d71('0x92'),'to','cc',_0x3d71('0x93'),_0x3d71('0x94'),'createdAt'],'include':_0x219472[_0x3d71('0x34')]['attachments']?[{'model':db[_0x3d71('0x95')],'as':_0x3d71('0x96')}]:undefined})[_0x3d71('0x15')](handleEntityNotFound(_0x5279c5,null))[_0x3d71('0x15')](function(_0x5bb1a2){if(_0x5bb1a2){var _0x223f88=_0x5bb1a2;var _0x4a4fa3={'from':_0x223f88[_0x3d71('0x92')],'to':_0x223f88['to'],'subject':_0x223f88[_0x3d71('0x94')],'html':htmlEntities[_0x3d71('0x97')](_0x223f88[_0x3d71('0x4a')]),'headers':{'Date':moment(_0x223f88['createdAt'])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x5bb1a2['cc']){_0x4a4fa3[_0x3d71('0x98')]['Cc']=_0x5bb1a2['cc'];}if(_0x5bb1a2[_0x3d71('0x93')]){_0x4a4fa3[_0x3d71('0x98')][_0x3d71('0x99')]=_0x5bb1a2['bcc'];}return new BPromise(function(_0x59d687,_0x48c030){if(_0x5bb1a2[_0x3d71('0x96')]){for(var _0x2456be=0x0;_0x2456be<_0x5bb1a2[_0x3d71('0x96')][_0x3d71('0x3b')];_0x2456be++){var _0x47810f=_0x5bb1a2[_0x3d71('0x96')][_0x2456be];var _0x5f403d=path[_0x3d71('0x5b')](_0x5b7d13,_0x47810f[_0x3d71('0x5e')]);if(fs[_0x3d71('0x9a')](_0x5f403d)){_0x4a4fa3[_0x3d71('0x5a')][_0x3d71('0x9b')]({'name':_0x47810f[_0x3d71('0x2b')],'contentType':_0x47810f[_0x3d71('0x32')],'data':fs[_0x3d71('0x9c')](_0x5f403d)});}}}emlformat['build'](_0x4a4fa3,function(_0x2d27bf,_0x353c46){if(_0x2d27bf)return _0x48c030(_0x2d27bf);fs[_0x3d71('0x9d')](path[_0x3d71('0x5b')](_0x2fe0b7,_0x290f5d),_0x353c46);return _0x59d687(_0x353c46);});});}})[_0x3d71('0x15')](function(_0x5d0493){if(_0x5d0493){return _0x5279c5['download'](path[_0x3d71('0x5b')](_0x2fe0b7,_0x290f5d),_0x290f5d,function(_0x26db34){if(!_0x26db34)fs[_0x3d71('0x9e')](path['join'](_0x2fe0b7,_0x290f5d));});}})['catch'](handleError(_0x5279c5,null));}; \ No newline at end of file +var _0xc352=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','MailMessage','includeAll','include','findAll','rows','show','params','keys','find','update','body','destroy','describe','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','CmList','List','updatedAt','DESC','MailServerOut','CloudProvider','Smtp','getSmtpOptions','attachments','join','root','server/files/attachments','basename','Contacts','CmContact','ListId','SendMail','sendMail','messageId','format','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','user','agent','UserId','get','MailInteraction','MailInteractionId','isNil','interaction','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','contact','User','fullname','email','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','reject','mail','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','QueryTypes','SELECT','interface','fromString','unix','toString','server','files','from','subject','createdAt','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','existsSync','push','type','readFileSync','writeFileSync','unlinkSync','eml-format','moment','util','path','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','html-entities','./mailMessage.socket','register','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','status','json','offset','limit','undefined','count','set','Content-Range','sendStatus','stack','name','send','index','map','rawAttributes','query','filters','model','attributes','intersection','fields','length'];(function(_0x5ae3d3,_0x2d82d9){var _0x16d131=function(_0xece8ce){while(--_0xece8ce){_0x5ae3d3['push'](_0x5ae3d3['shift']());}};_0x16d131(++_0x2d82d9);}(_0xc352,0x1a2));var _0x2c35=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0xc352[_0x22f8ab];return _0x2a70e5;};'use strict';var emlformat=require(_0x2c35('0x0'));var moment=require(_0x2c35('0x1'));var BPromise=require('bluebird');var util=require(_0x2c35('0x2'));var path=require(_0x2c35('0x3'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x2c35('0x4'));var htmlToText=require(_0x2c35('0x5'));var qs=require(_0x2c35('0x6'));var logger=require(_0x2c35('0x7'))('api');var interaction_log=require(_0x2c35('0x7'))(_0x2c35('0x8'));var config=require(_0x2c35('0x9'));var db=require(_0x2c35('0xa'))['db'];config[_0x2c35('0xb')]=_[_0x2c35('0xc')](config[_0x2c35('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x2c35('0xd'))(new Redis(config[_0x2c35('0xb')]));var htmlEntities=require(_0x2c35('0xe'));require(_0x2c35('0xf'))[_0x2c35('0x10')](socket);var jayson=require(_0x2c35('0x11'));var client=jayson['client']['http']({'port':0x232c});var client9003=jayson[_0x2c35('0x12')][_0x2c35('0x13')]({'port':0x232b});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3e639b,_0x1599df,_0x251726,_0x1521c2){return new BPromise(function(_0x259253,_0x4a9ffd){var _0x520961=_0x1521c2||client;return _0x520961[_0x2c35('0x14')](_0x3e639b,_0x251726)[_0x2c35('0x15')](function(_0x25b77d){logger[_0x2c35('0x16')](_0x2c35('0x17'),_0x1599df,_0x2c35('0x18'));logger[_0x2c35('0x19')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x1599df,'request\x20sent',JSON[_0x2c35('0x1a')](_0x25b77d));if(_0x25b77d[_0x2c35('0x1b')]){if(_0x25b77d['error']['code']===0x1f4){logger[_0x2c35('0x1b')]('MailMessage,\x20%s,\x20%s',_0x1599df,_0x25b77d['error'][_0x2c35('0x1c')]);return _0x4a9ffd(_0x25b77d[_0x2c35('0x1b')][_0x2c35('0x1c')]);}logger[_0x2c35('0x1b')]('MailMessage,\x20%s,\x20%s',_0x1599df,_0x25b77d[_0x2c35('0x1b')][_0x2c35('0x1c')]);return _0x259253(_0x25b77d[_0x2c35('0x1b')][_0x2c35('0x1c')]);}else{logger[_0x2c35('0x16')](_0x2c35('0x17'),_0x1599df,_0x2c35('0x18'));_0x259253(_0x25b77d[_0x2c35('0x1d')]['message']);}})[_0x2c35('0x1e')](function(_0x6dccdc){logger[_0x2c35('0x1b')](_0x2c35('0x17'),_0x1599df,_0x6dccdc);_0x4a9ffd(_0x6dccdc);});});}function respondWithResult(_0x5d6b71,_0x9cc060){_0x9cc060=_0x9cc060||0xc8;return function(_0x4a8cec){if(_0x4a8cec){return _0x5d6b71[_0x2c35('0x1f')](_0x9cc060)[_0x2c35('0x20')](_0x4a8cec);}};}function respondWithFilteredResult(_0x3fa016,_0x51e889){return function(_0x264101){if(_0x264101){var _0x2cc054=typeof _0x51e889[_0x2c35('0x21')]==='undefined'&&typeof _0x51e889[_0x2c35('0x22')]===_0x2c35('0x23');var _0x52ddae=_0x264101[_0x2c35('0x24')];var _0x2c9b62=_0x2cc054?0x0:_0x51e889[_0x2c35('0x21')];var _0x58ef86=_0x2cc054?_0x264101[_0x2c35('0x24')]:_0x51e889[_0x2c35('0x21')]+_0x51e889[_0x2c35('0x22')];var _0x19ee7a;if(_0x58ef86>=_0x52ddae){_0x58ef86=_0x52ddae;_0x19ee7a=0xc8;}else{_0x19ee7a=0xce;}_0x3fa016['status'](_0x19ee7a);return _0x3fa016[_0x2c35('0x25')](_0x2c35('0x26'),_0x2c9b62+'-'+_0x58ef86+'/'+_0x52ddae)[_0x2c35('0x20')](_0x264101);}return null;};}function saveUpdates(_0x379082){return function(_0x3070be){if(_0x3070be){return _0x3070be['update'](_0x379082)[_0x2c35('0x15')](function(_0x28a482){return _0x28a482;});}return null;};}function removeEntity(_0x3cd3fe){return function(_0xd207a9){if(_0xd207a9){return _0xd207a9['destroy']()[_0x2c35('0x15')](function(){_0x3cd3fe['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x49a03c){return function(_0x2de861){if(!_0x2de861){_0x49a03c[_0x2c35('0x27')](0x194);}return _0x2de861;};}function handleError(_0x36459d,_0x2d9082){_0x2d9082=_0x2d9082||0x1f4;return function(_0x2960b8){logger[_0x2c35('0x1b')](_0x2960b8[_0x2c35('0x28')]);if(_0x2960b8[_0x2c35('0x29')]){delete _0x2960b8['name'];}_0x36459d[_0x2c35('0x1f')](_0x2d9082)[_0x2c35('0x2a')](_0x2960b8);};}exports[_0x2c35('0x2b')]=function(_0x4bfa69,_0x326c36){var _0x1ea765={},_0x20d364={},_0x512267={'count':0x0,'rows':[]};var _0x48f176=_[_0x2c35('0x2c')](db['MailMessage'][_0x2c35('0x2d')],function(_0x492bad){return{'name':_0x492bad['fieldName'],'type':_0x492bad['type']['key']};});_0x20d364['model']=_['map'](_0x48f176,_0x2c35('0x29'));_0x20d364[_0x2c35('0x2e')]=_['keys'](_0x4bfa69[_0x2c35('0x2e')]);_0x20d364[_0x2c35('0x2f')]=_['intersection'](_0x20d364[_0x2c35('0x30')],_0x20d364[_0x2c35('0x2e')]);_0x1ea765[_0x2c35('0x31')]=_[_0x2c35('0x32')](_0x20d364[_0x2c35('0x30')],qs[_0x2c35('0x33')](_0x4bfa69[_0x2c35('0x2e')]['fields']));_0x1ea765['attributes']=_0x1ea765['attributes'][_0x2c35('0x34')]?_0x1ea765[_0x2c35('0x31')]:_0x20d364[_0x2c35('0x30')];if(!_0x4bfa69[_0x2c35('0x2e')][_0x2c35('0x35')](_0x2c35('0x36'))){_0x1ea765['limit']=qs['limit'](_0x4bfa69[_0x2c35('0x2e')]['limit']);_0x1ea765[_0x2c35('0x21')]=qs[_0x2c35('0x21')](_0x4bfa69[_0x2c35('0x2e')][_0x2c35('0x21')]);}_0x1ea765[_0x2c35('0x37')]=qs['sort'](_0x4bfa69[_0x2c35('0x2e')][_0x2c35('0x38')]);_0x1ea765[_0x2c35('0x39')]=qs[_0x2c35('0x2f')](_[_0x2c35('0x3a')](_0x4bfa69['query'],_0x20d364[_0x2c35('0x2f')]),_0x48f176);if(_0x4bfa69[_0x2c35('0x2e')][_0x2c35('0x3b')]){_0x1ea765[_0x2c35('0x39')]=_[_0x2c35('0x3c')](_0x1ea765[_0x2c35('0x39')],{'$or':_[_0x2c35('0x2c')](_0x48f176,function(_0x2563e5){if(_0x2563e5['type']!=='VIRTUAL'){var _0x104745={};_0x104745[_0x2563e5[_0x2c35('0x29')]]={'$like':'%'+_0x4bfa69[_0x2c35('0x2e')][_0x2c35('0x3b')]+'%'};return _0x104745;}})});}_0x1ea765=_[_0x2c35('0x3c')]({},_0x1ea765,_0x4bfa69['options']);var _0x23b717={'where':_0x1ea765['where']};return db[_0x2c35('0x3d')][_0x2c35('0x24')](_0x23b717)[_0x2c35('0x15')](function(_0x2c6e94){_0x512267[_0x2c35('0x24')]=_0x2c6e94;if(_0x4bfa69['query'][_0x2c35('0x3e')]){_0x1ea765[_0x2c35('0x3f')]=[{'all':!![]}];}return db[_0x2c35('0x3d')][_0x2c35('0x40')](_0x1ea765);})[_0x2c35('0x15')](function(_0x664298){_0x512267[_0x2c35('0x41')]=_0x664298;return _0x512267;})[_0x2c35('0x15')](respondWithFilteredResult(_0x326c36,_0x1ea765))[_0x2c35('0x1e')](handleError(_0x326c36,null));};exports[_0x2c35('0x42')]=function(_0x294552,_0x4ae2f7){var _0x1d1b1c={'raw':!![],'where':{'id':_0x294552[_0x2c35('0x43')]['id']}},_0x1b8244={};_0x1b8244[_0x2c35('0x30')]=_[_0x2c35('0x44')](db[_0x2c35('0x3d')][_0x2c35('0x2d')]);_0x1b8244[_0x2c35('0x2e')]=_['keys'](_0x294552[_0x2c35('0x2e')]);_0x1b8244[_0x2c35('0x2f')]=_[_0x2c35('0x32')](_0x1b8244[_0x2c35('0x30')],_0x1b8244[_0x2c35('0x2e')]);_0x1d1b1c[_0x2c35('0x31')]=_['intersection'](_0x1b8244[_0x2c35('0x30')],qs[_0x2c35('0x33')](_0x294552[_0x2c35('0x2e')]['fields']));_0x1d1b1c[_0x2c35('0x31')]=_0x1d1b1c[_0x2c35('0x31')][_0x2c35('0x34')]?_0x1d1b1c[_0x2c35('0x31')]:_0x1b8244[_0x2c35('0x30')];if(_0x294552['query'][_0x2c35('0x3e')]){_0x1d1b1c[_0x2c35('0x3f')]=[{'all':!![]}];}_0x1d1b1c=_[_0x2c35('0x3c')]({},_0x1d1b1c,_0x294552['options']);return db[_0x2c35('0x3d')][_0x2c35('0x45')](_0x1d1b1c)['then'](handleEntityNotFound(_0x4ae2f7,null))[_0x2c35('0x15')](respondWithResult(_0x4ae2f7,null))[_0x2c35('0x1e')](handleError(_0x4ae2f7,null));};exports[_0x2c35('0x46')]=function(_0x2d02d1,_0x5cb0b2){if(_0x2d02d1['body']['id']){delete _0x2d02d1[_0x2c35('0x47')]['id'];}return db[_0x2c35('0x3d')]['find']({'where':{'id':_0x2d02d1[_0x2c35('0x43')]['id']}})[_0x2c35('0x15')](handleEntityNotFound(_0x5cb0b2,null))[_0x2c35('0x15')](saveUpdates(_0x2d02d1['body'],null))[_0x2c35('0x15')](respondWithResult(_0x5cb0b2,null))[_0x2c35('0x1e')](handleError(_0x5cb0b2,null));};exports[_0x2c35('0x48')]=function(_0x27476f,_0x49032a){return db['MailMessage'][_0x2c35('0x45')]({'where':{'id':_0x27476f[_0x2c35('0x43')]['id']}})[_0x2c35('0x15')](handleEntityNotFound(_0x49032a,null))['then'](removeEntity(_0x49032a,null))['catch'](handleError(_0x49032a,null));};exports[_0x2c35('0x49')]=function(_0x209416,_0xf5f4b9){return db[_0x2c35('0x3d')][_0x2c35('0x49')]()[_0x2c35('0x15')](respondWithResult(_0xf5f4b9,null))[_0x2c35('0x1e')](handleError(_0xf5f4b9,null));};exports[_0x2c35('0x4a')]=function(_0x3597b6,_0x3da32f){return db['MailMessage']['create'](_0x3597b6[_0x2c35('0x47')])[_0x2c35('0x15')](function(_0x546983){if(_0x546983){if(_0x546983[_0x2c35('0x4b')]===_0x2c35('0x4c')&&!_0x546983[_0x2c35('0x4d')]){var _0x3d7b60,_0x5a5e26,_0x4bb908;if(_0x3597b6['body']['to']){_0x5a5e26=_0x3597b6[_0x2c35('0x47')]['to'][_0x2c35('0x4e')](',')[0x0];}return db[_0x2c35('0x4f')][_0x2c35('0x50')]({'where':{'id':_0x546983[_0x2c35('0x51')]},'include':[{'model':db[_0x2c35('0x52')],'as':_0x2c35('0x53'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0x5a5e26},'limit':0x1,'order':[[_0x2c35('0x54'),_0x2c35('0x55')]]}]},{'model':db[_0x2c35('0x56')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x2c35('0x57')],'as':_0x2c35('0x57'),'raw':!![]}]}]})[_0x2c35('0x15')](function(_0x5d4de5){_0x3d7b60=_0x5d4de5;if(!_0x3d7b60||!_0x3d7b60[_0x2c35('0x58')])return;var _0x38a48f=_0x3d7b60[_0x2c35('0x59')]();if(_0x3597b6[_0x2c35('0x47')][_0x2c35('0x5a')]&&_0x3597b6[_0x2c35('0x47')]['attachments'][_0x2c35('0x34')]){for(var _0x514185=0x0;_0x514185<_0x3597b6[_0x2c35('0x47')][_0x2c35('0x5a')]['length'];_0x514185+=0x1){_0x3597b6['body'][_0x2c35('0x5a')][_0x514185]={'filename':_0x3597b6['body']['attachments'][_0x514185]['name'],'path':path[_0x2c35('0x5b')](config[_0x2c35('0x5c')],_0x2c35('0x5d'),_0x3597b6['body']['attachments'][_0x514185][_0x2c35('0x5e')])};}}_0x4bb908={'account':_0x38a48f,'message':_0x3597b6[_0x2c35('0x47')]};return;})[_0x2c35('0x15')](function(){if(_0x3d7b60[_0x2c35('0x53')]){if(_0x3d7b60[_0x2c35('0x53')][_0x2c35('0x5f')][_0x2c35('0x34')]){return _0x3d7b60[_0x2c35('0x53')][_0x2c35('0x5f')][0x0];}else{return db[_0x2c35('0x60')][_0x2c35('0x4a')](_[_0x2c35('0xc')](_0x3597b6[_0x2c35('0x47')],{'firstName':_0x3597b6['body']['to'],'email':_0x3597b6[_0x2c35('0x47')]['to'],'phone':_0x3597b6[_0x2c35('0x47')]['to'],'ListId':_0x3d7b60[_0x2c35('0x61')]}));}}else{throw new Error('List\x20not\x20found');}})[_0x2c35('0x15')](function(){if(_0x4bb908){return respondWithRpcPromise(_0x2c35('0x62'),_0x2c35('0x63'),_0x4bb908,client9003)[_0x2c35('0x15')](function(_0x4b3024){return _0x546983['update']({'read':!![],'messageId':_0x4b3024[_0x2c35('0x64')],'sentAt':moment()[_0x2c35('0x65')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x2c35('0x1e')](function(_0x17efe4){logger['error']('%s',JSON[_0x2c35('0x1a')](_0x17efe4));return _0x546983;});}return _0x546983;});}return _0x546983;}})[_0x2c35('0x15')](respondWithResult(_0x3da32f,0xc9))['catch'](handleError(_0x3da32f,null));};exports[_0x2c35('0x66')]=function(_0x1bd16e,_0x57a718){var _0x4712fc={'agent':{},'channel':'mail'};if(_0x1bd16e[_0x2c35('0x47')]['id']){delete _0x1bd16e[_0x2c35('0x47')]['id'];}_0x1bd16e[_0x2c35('0x47')][_0x2c35('0x67')]=!![];_0x1bd16e[_0x2c35('0x47')][_0x2c35('0x68')]=moment()[_0x2c35('0x65')](_0x2c35('0x69'));_0x1bd16e['body']['UserId']=_0x1bd16e['body']['UserId']||_0x1bd16e[_0x2c35('0x6a')]['id'];_0x4712fc[_0x2c35('0x6b')]['id']=_0x1bd16e['body'][_0x2c35('0x6c')];return db[_0x2c35('0x3d')][_0x2c35('0x45')]({'where':{'id':_0x1bd16e[_0x2c35('0x43')]['id'],'UserId':null}})[_0x2c35('0x15')](handleEntityNotFound(_0x57a718,null))['then'](saveUpdates(_0x1bd16e[_0x2c35('0x47')],null))[_0x2c35('0x15')](function(_0x2c7bd7){if(_0x2c7bd7){_0x4712fc[_0x2c35('0x1c')]=_0x2c7bd7[_0x2c35('0x6d')]({'plain':!![]});return db[_0x2c35('0x6e')][_0x2c35('0x45')]({'where':{'id':_0x2c7bd7[_0x2c35('0x6f')]}});}return null;})['then'](handleEntityNotFound(_0x57a718,null))[_0x2c35('0x15')](function(_0xdc4556){if(_0xdc4556){return _0xdc4556[_0x2c35('0x46')]({'UserId':_0x1bd16e['body'][_0x2c35('0x6c')],'read1stAt':_[_0x2c35('0x70')](_0xdc4556['read1stAt'])?moment()[_0x2c35('0x65')](_0x2c35('0x69')):undefined});}return null;})[_0x2c35('0x15')](function(_0x4d1008){if(_0x4d1008){_0x4712fc[_0x2c35('0x71')]=_0x4d1008[_0x2c35('0x6d')]({'plain':!![]});interaction_log[_0x2c35('0x16')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1bd16e[_0x2c35('0x6a')]['id'],_0x1bd16e[_0x2c35('0x6a')][_0x2c35('0x29')],_0x1bd16e['user'][_0x2c35('0x72')],_0x4712fc[_0x2c35('0x71')]['id'],_0x1bd16e[_0x2c35('0x47')]?JSON[_0x2c35('0x1a')](_0x1bd16e[_0x2c35('0x47')]):_0x2c35('0x73'));return respondWithRpcPromise(_0x2c35('0x74'),'acceptMessage',_0x4712fc);}return null;})[_0x2c35('0x15')](function(_0x427851){var _0x1976f9=_0x2c35('0x75')+_0x427851[_0x2c35('0x1c')][_0x2c35('0x76')];return db[_0x2c35('0x77')]['query'](_0x1976f9,{'type':db[_0x2c35('0x78')]['QueryTypes']['SELECT'],'raw':!![]})[_0x2c35('0x15')](function(_0x1a612c){return _0x1a612c;});})[_0x2c35('0x15')](function(_0x528c0a){if(_0x528c0a){_0x4712fc[_0x2c35('0x1c')][_0x2c35('0x79')]=_0x528c0a[0x0];if(!_0x1bd16e[_0x2c35('0x47')][_0x2c35('0x6c')])return;return db[_0x2c35('0x7a')][_0x2c35('0x45')]({'where':{'id':_0x1bd16e[_0x2c35('0x47')][_0x2c35('0x6c')],'role':'agent'},'attributes':['id',_0x2c35('0x29'),_0x2c35('0x7b'),_0x2c35('0x7c'),'internal'],'raw':!![]});}return null;})['then'](function(_0xe13fec){if(!_0xe13fec)return null;_0x4712fc[_0x2c35('0x1c')]['agent']=_0xe13fec;return _0x4712fc;})['then'](function(_0x19f1ad){if(_0x19f1ad){if(_0x1bd16e[_0x2c35('0x47')]['manual']){_0x4712fc[_0x2c35('0x1c')]['interface']=util[_0x2c35('0x65')](_0x2c35('0x7d'),_0x1bd16e[_0x2c35('0x6a')][_0x2c35('0x29')]);_0x4712fc['message'][_0x2c35('0x7e')]=_0x4712fc[_0x2c35('0x7e')];_0x4712fc[_0x2c35('0x1c')][_0x2c35('0x7f')]=_0x4712fc[_0x2c35('0x7e')];_0x4712fc[_0x2c35('0x1c')][_0x2c35('0x80')]=_0x2c35('0x66');_0x4712fc[_0x2c35('0x1c')]['body']=htmlToText['fromString'](_0x4712fc['message'][_0x2c35('0x47')]);return respondWithRpcPromise(_0x2c35('0x81'),'EventManager',{'event':_0x2c35('0x82'),'message':_0x4712fc[_0x2c35('0x1c')]},client9002)[_0x2c35('0x15')](function(){return _0x4712fc;});}return _0x4712fc;}return null;})[_0x2c35('0x15')](respondWithResult(_0x57a718,null))[_0x2c35('0x1e')](handleError(_0x57a718,null));};exports[_0x2c35('0x83')]=function(_0x51701f,_0x18e733){var _0x1aa7e6={'agent':{},'channel':_0x2c35('0x84')};if(_0x51701f[_0x2c35('0x47')]['id']){delete _0x51701f[_0x2c35('0x47')]['id'];}_0x51701f[_0x2c35('0x47')][_0x2c35('0x6c')]=_0x51701f[_0x2c35('0x47')][_0x2c35('0x6c')]||_0x51701f[_0x2c35('0x6a')]['id'];_0x1aa7e6[_0x2c35('0x6b')]['id']=_0x51701f['body']['UserId'];return db['MailMessage']['find']({'where':{'id':_0x51701f[_0x2c35('0x43')]['id'],'UserId':null}})[_0x2c35('0x15')](handleEntityNotFound(_0x18e733,null))[_0x2c35('0x15')](function(_0x345a67){if(_0x345a67){_0x1aa7e6[_0x2c35('0x1c')]=_0x345a67[_0x2c35('0x6d')]({'plain':!![]});return db[_0x2c35('0x6e')]['find']({'where':{'id':_0x345a67[_0x2c35('0x6f')]}});}return null;})[_0x2c35('0x15')](handleEntityNotFound(_0x18e733,null))[_0x2c35('0x15')](function(_0x13a2c9){if(_0x13a2c9){_0x1aa7e6[_0x2c35('0x71')]=_0x13a2c9[_0x2c35('0x6d')]({'plain':!![]});interaction_log[_0x2c35('0x16')](_0x2c35('0x85'),_0x51701f[_0x2c35('0x6a')]['id'],_0x51701f[_0x2c35('0x6a')][_0x2c35('0x29')],_0x51701f[_0x2c35('0x6a')][_0x2c35('0x72')],_0x1aa7e6['interaction']['id'],_0x51701f[_0x2c35('0x47')]?JSON[_0x2c35('0x1a')](_0x51701f['body']):_0x2c35('0x73'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x1aa7e6);}return null;})['then'](function(_0x2197de){var _0x38c8c2='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2197de[_0x2c35('0x1c')][_0x2c35('0x76')];return db[_0x2c35('0x77')][_0x2c35('0x2e')](_0x38c8c2,{'type':db[_0x2c35('0x78')][_0x2c35('0x86')][_0x2c35('0x87')],'raw':!![]})['then'](function(_0x6baf3a){return _0x6baf3a;});})[_0x2c35('0x15')](function(_0x2e6ad1){if(_0x2e6ad1){_0x1aa7e6[_0x2c35('0x1c')]['contact']=_0x2e6ad1[0x0];if(!_0x51701f['body'][_0x2c35('0x6c')])return;return db[_0x2c35('0x7a')]['find']({'where':{'id':_0x51701f['body']['UserId'],'role':'agent'},'attributes':['id','name',_0x2c35('0x7b'),_0x2c35('0x7c'),'internal'],'raw':!![]});}return null;})['then'](function(_0x35dd13){if(!_0x35dd13)return null;_0x1aa7e6['message']['agent']=_0x35dd13;return _0x1aa7e6;})[_0x2c35('0x15')](function(_0xc381b8){if(_0xc381b8){_0xc381b8[_0x2c35('0x1c')][_0x2c35('0x88')]=util[_0x2c35('0x65')](_0x2c35('0x7d'),_0x51701f['user'][_0x2c35('0x29')]);_0xc381b8[_0x2c35('0x1c')][_0x2c35('0x7e')]=_0x1aa7e6[_0x2c35('0x7e')];_0xc381b8[_0x2c35('0x1c')][_0x2c35('0x7f')]=_0x1aa7e6['channel'];_0xc381b8[_0x2c35('0x1c')][_0x2c35('0x80')]=_0x2c35('0x83');_0xc381b8[_0x2c35('0x1c')]['body']=htmlToText[_0x2c35('0x89')](_0x1aa7e6[_0x2c35('0x1c')][_0x2c35('0x47')]);respondWithRpcPromise(_0x2c35('0x81'),'EventManager',{'event':'rejectmessage','message':_0xc381b8[_0x2c35('0x1c')]},client9002);return _0x1aa7e6;}return null;})[_0x2c35('0x15')](respondWithResult(_0x18e733,null))[_0x2c35('0x1e')](handleError(_0x18e733,null));};exports['download']=function(_0x4b99fc,_0x37529c){var _0x2ba4d7=moment()[_0x2c35('0x8a')]()[_0x2c35('0x8b')]();var _0x10dd61=path[_0x2c35('0x5b')](config[_0x2c35('0x5c')],_0x2c35('0x8c'),'files','tmp');var _0x271eea=path[_0x2c35('0x5b')](config[_0x2c35('0x5c')],'server',_0x2c35('0x8d'),'attachments');var _0x4b9a43=util[_0x2c35('0x65')]('message-%s.eml',_0x2ba4d7);return db[_0x2c35('0x3d')][_0x2c35('0x45')]({'where':{'id':_0x4b99fc[_0x2c35('0x43')]['id']},'attributes':['id',_0x2c35('0x47'),_0x2c35('0x8e'),'to','cc','bcc',_0x2c35('0x8f'),_0x2c35('0x90')],'include':_0x4b99fc[_0x2c35('0x2e')][_0x2c35('0x5a')]?[{'model':db[_0x2c35('0x91')],'as':_0x2c35('0x92')}]:undefined})[_0x2c35('0x15')](handleEntityNotFound(_0x37529c,null))[_0x2c35('0x15')](function(_0x444d60){if(_0x444d60){var _0x4d9dbc=_0x444d60;var _0x3e2b98={'from':_0x4d9dbc[_0x2c35('0x8e')],'to':_0x4d9dbc['to'],'subject':_0x4d9dbc[_0x2c35('0x8f')],'html':htmlEntities[_0x2c35('0x93')](_0x4d9dbc[_0x2c35('0x47')]),'headers':{'Date':moment(_0x4d9dbc[_0x2c35('0x90')])[_0x2c35('0x65')](_0x2c35('0x94'))},'attachments':[]};if(_0x444d60['cc']){_0x3e2b98['headers']['Cc']=_0x444d60['cc'];}if(_0x444d60['bcc']){_0x3e2b98[_0x2c35('0x95')]['Bcc']=_0x444d60[_0x2c35('0x96')];}return new BPromise(function(_0x300622,_0xd8c05f){if(_0x444d60[_0x2c35('0x92')]){for(var _0x5343bc=0x0;_0x5343bc<_0x444d60[_0x2c35('0x92')][_0x2c35('0x34')];_0x5343bc++){var _0x3abaca=_0x444d60[_0x2c35('0x92')][_0x5343bc];var _0x37df4a=path[_0x2c35('0x5b')](_0x271eea,_0x3abaca[_0x2c35('0x5e')]);if(fs[_0x2c35('0x97')](_0x37df4a)){_0x3e2b98['attachments'][_0x2c35('0x98')]({'name':_0x3abaca[_0x2c35('0x29')],'contentType':_0x3abaca[_0x2c35('0x99')],'data':fs[_0x2c35('0x9a')](_0x37df4a)});}}}emlformat['build'](_0x3e2b98,function(_0x44e7e1,_0x28f6b6){if(_0x44e7e1)return _0xd8c05f(_0x44e7e1);fs[_0x2c35('0x9b')](path[_0x2c35('0x5b')](_0x10dd61,_0x4b9a43),_0x28f6b6);return _0x300622(_0x28f6b6);});});}})[_0x2c35('0x15')](function(_0xe0c45d){if(_0xe0c45d){return _0x37529c['download'](path[_0x2c35('0x5b')](_0x10dd61,_0x4b9a43),_0x4b9a43,function(_0x1aaf7f){if(!_0x1aaf7f)fs[_0x2c35('0x9c')](path[_0x2c35('0x5b')](_0x10dd61,_0x4b9a43));});}})[_0x2c35('0x1e')](handleError(_0x37529c,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index fe77b40..d32bdc7 100644 --- a/server/api/mailMessage/mailMessage.events.js +++ b/server/api/mailMessage/mailMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbcb4=['events','../../mysqldb','MailMessage','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x46d87a,_0x5183db){var _0x115296=function(_0x880a1c){while(--_0x880a1c){_0x46d87a['push'](_0x46d87a['shift']());}};_0x115296(++_0x5183db);}(_0xbcb4,0xfa));var _0x4bcb=function(_0x38a1cf,_0x4a3f82){_0x38a1cf=_0x38a1cf-0x0;var _0x38bfc8=_0xbcb4[_0x38a1cf];return _0x38bfc8;};'use strict';var EventEmitter=require(_0x4bcb('0x0'));var MailMessage=require(_0x4bcb('0x1'))['db'][_0x4bcb('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4bcb('0x3'),'afterUpdate':_0x4bcb('0x4'),'afterDestroy':_0x4bcb('0x5')};function emitEvent(_0x45ecbd){return function(_0x136f3a,_0x14cd9b,_0x5b459b){MailMessageEvents[_0x4bcb('0x6')](_0x45ecbd+':'+_0x136f3a['id'],_0x136f3a);MailMessageEvents[_0x4bcb('0x6')](_0x45ecbd,_0x136f3a);_0x5b459b(null);};}for(var e in events){if(events[_0x4bcb('0x7')](e)){var event=events[e];MailMessage[_0x4bcb('0x8')](e,emitEvent(event));}}module[_0x4bcb('0x9')]=MailMessageEvents; \ No newline at end of file +var _0x0b6e=['setMaxListeners','save','remove','emit','../../mysqldb','MailMessage'];(function(_0x37e9c1,_0x20ff2a){var _0x3b12bd=function(_0x4d42ae){while(--_0x4d42ae){_0x37e9c1['push'](_0x37e9c1['shift']());}};_0x3b12bd(++_0x20ff2a);}(_0x0b6e,0x166));var _0xe0b6=function(_0x4a75e4,_0x1211eb){_0x4a75e4=_0x4a75e4-0x0;var _0x2b510a=_0x0b6e[_0x4a75e4];return _0x2b510a;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0xe0b6('0x0'))['db'][_0xe0b6('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xe0b6('0x2')](0x0);var events={'afterCreate':_0xe0b6('0x3'),'afterUpdate':'update','afterDestroy':_0xe0b6('0x4')};function emitEvent(_0x2255d7){return function(_0x5cf5be,_0x5288ea,_0x2f9bde){MailMessageEvents[_0xe0b6('0x5')](_0x2255d7+':'+_0x5cf5be['id'],_0x5cf5be);MailMessageEvents[_0xe0b6('0x5')](_0x2255d7,_0x5cf5be);_0x2f9bde(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 607f7a5..ec6a36d 100644 --- a/server/api/mailMessage/mailMessage.model.js +++ b/server/api/mailMessage/mailMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e3=['UserId','MailInteraction','MailInteractionId','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','html-to-text','path','rimraf','./mailMessage.attributes','define','MailMessage','mail_messages','messageId','plainBody','body','models','get','toLowerCase','direction','out','secret','isNil'];(function(_0x371145,_0x271b3d){var _0x583fae=function(_0x596df7){while(--_0x596df7){_0x371145['push'](_0x371145['shift']());}};_0x583fae(++_0x271b3d);}(_0xa9e3,0x135));var _0x3a9e=function(_0x3353db,_0x836d70){_0x3353db=_0x3353db-0x0;var _0x211871=_0xa9e3[_0x3353db];return _0x211871;};'use strict';var _=require('lodash');var util=require(_0x3a9e('0x0'));var logger=require(_0x3a9e('0x1'))(_0x3a9e('0x2'));var moment=require(_0x3a9e('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var htmlToText=require(_0x3a9e('0x4'));var fs=require('fs');var path=require(_0x3a9e('0x5'));var rimraf=require(_0x3a9e('0x6'));var config=require('../../config/environment');var attributes=require(_0x3a9e('0x7'));module['exports']=function(_0x443d36,_0x13190d){return _0x443d36[_0x3a9e('0x8')](_0x3a9e('0x9'),attributes,{'tableName':_0x3a9e('0xa'),'paranoid':![],'indexes':[{'name':_0x3a9e('0xb'),'fields':['messageId']},{'name':'fti_mail_messages','fields':[_0x3a9e('0xc'),'subject'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5aca79,_0x451ffa,_0x24f83d){if(_0x5aca79[_0x3a9e('0xd')]){_0x5aca79[_0x3a9e('0xc')]=htmlToText['fromString'](_0x5aca79[_0x3a9e('0xd')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x24f83d(null,_0x451ffa);},'afterCreate':function(_0x234423,_0x24f8a6,_0x1e61c6){var _0x1c9125=_0x443d36[_0x3a9e('0xe')];var _0x2f2b9c=_0x234423[_0x3a9e('0xf')]({'plain':!![]});if(_0x2f2b9c['direction'][_0x3a9e('0x10')]()==='in'||_0x2f2b9c[_0x3a9e('0x11')][_0x3a9e('0x10')]()===_0x3a9e('0x12')&&!_0x2f2b9c[_0x3a9e('0x13')]&&!_[_0x3a9e('0x14')](_0x2f2b9c[_0x3a9e('0x15')])){_0x1c9125[_0x3a9e('0x16')]['findOne']({'where':{'id':_0x2f2b9c[_0x3a9e('0x17')]}})[_0x3a9e('0x18')](function(_0x14d65d){if(_0x14d65d){_0x14d65d[_0x3a9e('0x19')]({'lastMsgAt':_0x2f2b9c['createdAt'],'lastMsgDirection':_0x2f2b9c['direction'][_0x3a9e('0x10')]()});}})[_0x3a9e('0x1a')](function(_0x29db59){console[_0x3a9e('0x1b')](_0x29db59);});}_0x1e61c6();}},'charset':_0x3a9e('0x1c'),'collate':_0x3a9e('0x1d')});}; \ No newline at end of file +var _0x7106=['path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','mail_messages','messageId','fti_mail_messages','plainBody','subject','body','fromString','direction','toLowerCase','isNil','findOne','then','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text'];(function(_0x421196,_0x1cbd94){var _0x2738af=function(_0xc956ff){while(--_0xc956ff){_0x421196['push'](_0x421196['shift']());}};_0x2738af(++_0x1cbd94);}(_0x7106,0xe8));var _0x6710=function(_0x3bafaa,_0x361f99){_0x3bafaa=_0x3bafaa-0x0;var _0x59d9ed=_0x7106[_0x3bafaa];return _0x59d9ed;};'use strict';var _=require(_0x6710('0x0'));var util=require(_0x6710('0x1'));var logger=require(_0x6710('0x2'))(_0x6710('0x3'));var moment=require(_0x6710('0x4'));var BPromise=require(_0x6710('0x5'));var rp=require(_0x6710('0x6'));var htmlToText=require(_0x6710('0x7'));var fs=require('fs');var path=require(_0x6710('0x8'));var rimraf=require(_0x6710('0x9'));var config=require(_0x6710('0xa'));var attributes=require(_0x6710('0xb'));module[_0x6710('0xc')]=function(_0x42538b,_0x4c82a8){return _0x42538b[_0x6710('0xd')]('MailMessage',attributes,{'tableName':_0x6710('0xe'),'paranoid':![],'indexes':[{'name':_0x6710('0xf'),'fields':['messageId']},{'name':_0x6710('0x10'),'fields':[_0x6710('0x11'),_0x6710('0x12')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x30ed0d,_0x3a646c,_0x4bf2d4){if(_0x30ed0d[_0x6710('0x13')]){_0x30ed0d[_0x6710('0x11')]=htmlToText[_0x6710('0x14')](_0x30ed0d[_0x6710('0x13')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x4bf2d4(null,_0x3a646c);},'afterCreate':function(_0x42f897,_0x2ab34e,_0x3d01a1){var _0x133b37=_0x42538b['models'];var _0x1dae2c=_0x42f897['get']({'plain':!![]});if(_0x1dae2c[_0x6710('0x15')][_0x6710('0x16')]()==='in'||_0x1dae2c[_0x6710('0x15')][_0x6710('0x16')]()==='out'&&!_0x1dae2c['secret']&&!_[_0x6710('0x17')](_0x1dae2c['UserId'])){_0x133b37['MailInteraction'][_0x6710('0x18')]({'where':{'id':_0x1dae2c['MailInteractionId']}})[_0x6710('0x19')](function(_0x39d290){if(_0x39d290){_0x39d290['update']({'lastMsgAt':_0x1dae2c[_0x6710('0x1a')],'lastMsgDirection':_0x1dae2c['direction'][_0x6710('0x16')]()});}})[_0x6710('0x1b')](function(_0x417a9c){console['error'](_0x417a9c);});}_0x3d01a1();}},'charset':_0x6710('0x1c'),'collate':_0x6710('0x1d')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 55c2933..8e920f9 100644 --- a/server/api/mailMessage/mailMessage.rpc.js +++ b/server/api/mailMessage/mailMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x757a=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./mailMessage.socket','request','then','MailMessage,\x20%s,\x20%s,\x20%s','error','MailMessage,\x20%s,\x20%s','message','info','catch','CreateMailMessage','MailMessage','create','body','raw','debug','stringify','util','moment'];(function(_0x50df81,_0x4e4106){var _0x103de2=function(_0x48ea59){while(--_0x48ea59){_0x50df81['push'](_0x50df81['shift']());}};_0x103de2(++_0x4e4106);}(_0x757a,0xde));var _0xa757=function(_0x2c5113,_0x47375f){_0x2c5113=_0x2c5113-0x0;var _0x3c36c7=_0x757a[_0x2c5113];return _0x3c36c7;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var moment=require(_0xa757('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa757('0x2'))['db'];var utils=require(_0xa757('0x3'));var logger=require(_0xa757('0x4'))(_0xa757('0x5'));var config=require(_0xa757('0x6'));var jayson=require(_0xa757('0x7'));var client=jayson['client'][_0xa757('0x8')]({'port':0x232a});config[_0xa757('0x9')]=_['defaults'](config[_0xa757('0x9')],{'host':_0xa757('0xa'),'port':0x18eb});var socket=require(_0xa757('0xb'))(new Redis(config[_0xa757('0x9')]));require(_0xa757('0xc'))['register'](socket);function respondWithRpcPromise(_0x89c630,_0x2ca96f,_0x32f0ec){return new BPromise(function(_0x3e2c9a,_0xb7610b){return client[_0xa757('0xd')](_0x89c630,_0x32f0ec)[_0xa757('0xe')](function(_0x483d77){logger['info']('MailMessage,\x20%s,\x20%s',_0x2ca96f,'request\x20sent');logger['debug'](_0xa757('0xf'),_0x2ca96f,'request\x20sent',JSON['stringify'](_0x483d77));if(_0x483d77[_0xa757('0x10')]){if(_0x483d77['error']['code']===0x1f4){logger[_0xa757('0x10')](_0xa757('0x11'),_0x2ca96f,_0x483d77[_0xa757('0x10')][_0xa757('0x12')]);return _0xb7610b(_0x483d77[_0xa757('0x10')][_0xa757('0x12')]);}logger[_0xa757('0x10')](_0xa757('0x11'),_0x2ca96f,_0x483d77[_0xa757('0x10')][_0xa757('0x12')]);return _0x3e2c9a(_0x483d77['error'][_0xa757('0x12')]);}else{logger[_0xa757('0x13')](_0xa757('0x11'),_0x2ca96f,'request\x20sent');_0x3e2c9a(_0x483d77['result'][_0xa757('0x12')]);}})[_0xa757('0x14')](function(_0x1bd14c){logger[_0xa757('0x10')](_0xa757('0x11'),_0x2ca96f,_0x1bd14c);_0xb7610b(_0x1bd14c);});});}exports[_0xa757('0x15')]=function(_0x4bd137){var _0x58954=this;return new Promise(function(_0x4fec52,_0x32c2a1){return db[_0xa757('0x16')][_0xa757('0x17')](_0x4bd137[_0xa757('0x18')],{'raw':_0x4bd137['options']?_0x4bd137['options'][_0xa757('0x19')]===undefined?!![]:![]:!![]})[_0xa757('0xe')](function(_0x2ba923){logger[_0xa757('0x13')](_0xa757('0x15'),_0x4bd137);logger[_0xa757('0x1a')](_0xa757('0x15'),_0x4bd137,JSON[_0xa757('0x1b')](_0x2ba923));_0x4fec52(_0x2ba923);})[_0xa757('0x14')](function(_0x59fae6){logger[_0xa757('0x10')]('CreateMailMessage',_0x59fae6[_0xa757('0x12')],_0x4bd137);_0x32c2a1(_0x58954['error'](0x1f4,_0x59fae6[_0xa757('0x12')]));});});}; \ No newline at end of file +var _0x0120=['then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','body','options','raw','CreateMailMessage','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis','localhost','socket.io-emitter','register'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x0120,0x6f));var _0x0012=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x0120[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x0012('0x0'));var util=require(_0x0012('0x1'));var moment=require(_0x0012('0x2'));var BPromise=require(_0x0012('0x3'));var rs=require(_0x0012('0x4'));var fs=require('fs');var Redis=require(_0x0012('0x5'));var db=require(_0x0012('0x6'))['db'];var utils=require(_0x0012('0x7'));var logger=require(_0x0012('0x8'))(_0x0012('0x9'));var config=require(_0x0012('0xa'));var jayson=require(_0x0012('0xb'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x0012('0xc')](config[_0x0012('0xd')],{'host':_0x0012('0xe'),'port':0x18eb});var socket=require(_0x0012('0xf'))(new Redis(config[_0x0012('0xd')]));require('./mailMessage.socket')[_0x0012('0x10')](socket);function respondWithRpcPromise(_0x2d484c,_0x1dc1b2,_0x323282){return new BPromise(function(_0x520171,_0x2d4674){return client['request'](_0x2d484c,_0x323282)[_0x0012('0x11')](function(_0x1d1c02){logger[_0x0012('0x12')](_0x0012('0x13'),_0x1dc1b2,_0x0012('0x14'));logger['debug'](_0x0012('0x15'),_0x1dc1b2,'request\x20sent',JSON['stringify'](_0x1d1c02));if(_0x1d1c02['error']){if(_0x1d1c02['error'][_0x0012('0x16')]===0x1f4){logger['error'](_0x0012('0x13'),_0x1dc1b2,_0x1d1c02[_0x0012('0x17')]['message']);return _0x2d4674(_0x1d1c02[_0x0012('0x17')][_0x0012('0x18')]);}logger[_0x0012('0x17')](_0x0012('0x13'),_0x1dc1b2,_0x1d1c02['error']['message']);return _0x520171(_0x1d1c02[_0x0012('0x17')][_0x0012('0x18')]);}else{logger[_0x0012('0x12')](_0x0012('0x13'),_0x1dc1b2,_0x0012('0x14'));_0x520171(_0x1d1c02[_0x0012('0x19')][_0x0012('0x18')]);}})[_0x0012('0x1a')](function(_0x5b236f){logger[_0x0012('0x17')](_0x0012('0x13'),_0x1dc1b2,_0x5b236f);_0x2d4674(_0x5b236f);});});}exports['CreateMailMessage']=function(_0x45d00b){var _0x1f54fc=this;return new Promise(function(_0xa2e623,_0x2c837e){return db['MailMessage']['create'](_0x45d00b[_0x0012('0x1b')],{'raw':_0x45d00b[_0x0012('0x1c')]?_0x45d00b[_0x0012('0x1c')][_0x0012('0x1d')]===undefined?!![]:![]:!![]})[_0x0012('0x11')](function(_0x2e6a2c){logger[_0x0012('0x12')](_0x0012('0x1e'),_0x45d00b);logger['debug'](_0x0012('0x1e'),_0x45d00b,JSON[_0x0012('0x1f')](_0x2e6a2c));_0xa2e623(_0x2e6a2c);})['catch'](function(_0x36cf42){logger[_0x0012('0x17')](_0x0012('0x1e'),_0x36cf42[_0x0012('0x18')],_0x45d00b);_0x2c837e(_0x1f54fc[_0x0012('0x17')](0x1f4,_0x36cf42['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 572c00f..72f1c44 100644 --- a/server/api/mailMessage/mailMessage.socket.js +++ b/server/api/mailMessage/mailMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb95a=['./mailMessage.events','save','remove','update','emit','removeListener','register','length','mailMessage:'];(function(_0xc4ea75,_0x273753){var _0x52ea5e=function(_0x1ee872){while(--_0x1ee872){_0xc4ea75['push'](_0xc4ea75['shift']());}};_0x52ea5e(++_0x273753);}(_0xb95a,0x13b));var _0xab95=function(_0x2ca6d8,_0x2d9065){_0x2ca6d8=_0x2ca6d8-0x0;var _0x3753e0=_0xb95a[_0x2ca6d8];return _0x3753e0;};'use strict';var MailMessageEvents=require(_0xab95('0x0'));var events=[_0xab95('0x1'),_0xab95('0x2'),_0xab95('0x3')];function createListener(_0x31644b,_0x240258){return function(_0xabb918){_0x240258[_0xab95('0x4')](_0x31644b,_0xabb918);};}function removeListener(_0x10c25e,_0xc692c6){return function(){MailMessageEvents[_0xab95('0x5')](_0x10c25e,_0xc692c6);};}exports[_0xab95('0x6')]=function(_0x4ef149){for(var _0xa2ba87=0x0,_0x208b01=events[_0xab95('0x7')];_0xa2ba87<_0x208b01;_0xa2ba87++){var _0x57123a=events[_0xa2ba87];var _0x38c015=createListener(_0xab95('0x8')+_0x57123a,_0x4ef149);MailMessageEvents['on'](_0x57123a,_0x38c015);}}; \ No newline at end of file +var _0xd882=['remove','update','removeListener','register','length','mailMessage:','./mailMessage.events'];(function(_0x2c5d4f,_0x2ce3ac){var _0x76b5cf=function(_0xde32e3){while(--_0xde32e3){_0x2c5d4f['push'](_0x2c5d4f['shift']());}};_0x76b5cf(++_0x2ce3ac);}(_0xd882,0xd1));var _0x2d88=function(_0x25df80,_0xa2aec5){_0x25df80=_0x25df80-0x0;var _0x17b6d0=_0xd882[_0x25df80];return _0x17b6d0;};'use strict';var MailMessageEvents=require(_0x2d88('0x0'));var events=['save',_0x2d88('0x1'),_0x2d88('0x2')];function createListener(_0x108505,_0x4e41f8){return function(_0x57a5fc){_0x4e41f8['emit'](_0x108505,_0x57a5fc);};}function removeListener(_0x5b8f54,_0x3b10a2){return function(){MailMessageEvents[_0x2d88('0x3')](_0x5b8f54,_0x3b10a2);};}exports[_0x2d88('0x4')]=function(_0x29c0a0){for(var _0x3f5fd4=0x0,_0x184f4a=events[_0x2d88('0x5')];_0x3f5fd4<_0x184f4a;_0x3f5fd4++){var _0x3afe97=events[_0x3f5fd4];var _0x18f5fc=createListener(_0x2d88('0x6')+_0x3afe97,_0x29c0a0);MailMessageEvents['on'](_0x3afe97,_0x18f5fc);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 9c205fe..adb6824 100644 --- a/server/api/mailQueue/index.js +++ b/server/api/mailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x09eb=['show','getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id'];(function(_0x3f01dd,_0x128e0f){var _0x4bae40=function(_0x35a022){while(--_0x35a022){_0x3f01dd['push'](_0x3f01dd['shift']());}};_0x4bae40(++_0x128e0f);}(_0x09eb,0xf0));var _0xb09e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x09eb[_0x24237f];return _0x48298e;};'use strict';var multer=require(_0xb09e('0x0'));var util=require('util');var path=require(_0xb09e('0x1'));var timeout=require(_0xb09e('0x2'));var express=require(_0xb09e('0x3'));var router=express[_0xb09e('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb09e('0x5'));var config=require(_0xb09e('0x6'));var controller=require('./mailQueue.controller');router[_0xb09e('0x7')]('/',auth[_0xb09e('0x8')](),controller[_0xb09e('0x9')]);router[_0xb09e('0x7')]('/describe',auth[_0xb09e('0x8')](),controller[_0xb09e('0xa')]);router[_0xb09e('0x7')](_0xb09e('0xb'),auth[_0xb09e('0x8')](),controller[_0xb09e('0xc')]);router[_0xb09e('0x7')]('/:id/members',auth[_0xb09e('0x8')](),controller[_0xb09e('0xd')]);router[_0xb09e('0x7')](_0xb09e('0xe'),auth[_0xb09e('0x8')](),controller['getTeams']);router[_0xb09e('0x7')](_0xb09e('0xf'),auth[_0xb09e('0x8')](),controller[_0xb09e('0x10')]);router[_0xb09e('0x11')]('/',auth[_0xb09e('0x8')](),controller[_0xb09e('0x12')]);router[_0xb09e('0x11')](_0xb09e('0xe'),auth['isAuthenticated'](),controller[_0xb09e('0x13')]);router[_0xb09e('0x11')](_0xb09e('0xf'),auth['isAuthenticated'](),controller[_0xb09e('0x14')]);router[_0xb09e('0x15')]('/:id',auth[_0xb09e('0x8')](),controller[_0xb09e('0x16')]);router[_0xb09e('0x17')](_0xb09e('0xb'),auth[_0xb09e('0x8')](),controller[_0xb09e('0x18')]);router[_0xb09e('0x17')]('/:id/teams',auth[_0xb09e('0x8')](),controller[_0xb09e('0x19')]);router[_0xb09e('0x17')](_0xb09e('0xf'),auth[_0xb09e('0x8')](),controller[_0xb09e('0x1a')]);module[_0xb09e('0x1b')]=router; \ No newline at end of file +var _0xf252=['./mailQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3a0fc6,_0x5f5672){var _0xbcb8c8=function(_0x3791ce){while(--_0x3791ce){_0x3a0fc6['push'](_0x3a0fc6['shift']());}};_0xbcb8c8(++_0x5f5672);}(_0xf252,0xa1));var _0x2f25=function(_0x9da559,_0xdedc94){_0x9da559=_0x9da559-0x0;var _0x1eb472=_0xf252[_0x9da559];return _0x1eb472;};'use strict';var multer=require(_0x2f25('0x0'));var util=require(_0x2f25('0x1'));var path=require(_0x2f25('0x2'));var timeout=require(_0x2f25('0x3'));var express=require('express');var router=express[_0x2f25('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2f25('0x5'));var interaction=require(_0x2f25('0x6'));var config=require('../../config/environment');var controller=require(_0x2f25('0x7'));router['get']('/',auth[_0x2f25('0x8')](),controller[_0x2f25('0x9')]);router[_0x2f25('0xa')](_0x2f25('0xb'),auth[_0x2f25('0x8')](),controller[_0x2f25('0xc')]);router[_0x2f25('0xa')](_0x2f25('0xd'),auth[_0x2f25('0x8')](),controller['show']);router['get']('/:id/members',auth[_0x2f25('0x8')](),controller[_0x2f25('0xe')]);router[_0x2f25('0xa')](_0x2f25('0xf'),auth[_0x2f25('0x8')](),controller[_0x2f25('0x10')]);router['get'](_0x2f25('0x11'),auth[_0x2f25('0x8')](),controller[_0x2f25('0x12')]);router[_0x2f25('0x13')]('/',auth[_0x2f25('0x8')](),controller[_0x2f25('0x14')]);router[_0x2f25('0x13')]('/:id/teams',auth[_0x2f25('0x8')](),controller[_0x2f25('0x15')]);router[_0x2f25('0x13')](_0x2f25('0x11'),auth[_0x2f25('0x8')](),controller[_0x2f25('0x16')]);router[_0x2f25('0x17')](_0x2f25('0xd'),auth[_0x2f25('0x8')](),controller['update']);router[_0x2f25('0x18')]('/:id',auth['isAuthenticated'](),controller['destroy']);router['delete']('/:id/teams',auth[_0x2f25('0x8')](),controller[_0x2f25('0x19')]);router[_0x2f25('0x18')](_0x2f25('0x11'),auth[_0x2f25('0x8')](),controller[_0x2f25('0x1a')]);module[_0x2f25('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 57f6436..bc00ae4 100644 --- a/server/api/mailQueue/mailQueue.attributes.js +++ b/server/api/mailQueue/mailQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7c7=['INTEGER','ENUM','rrmemory','beepall','roundrobin','exports','STRING','name'];(function(_0x1beb1f,_0x1d41e6){var _0x2670f0=function(_0x454e35){while(--_0x454e35){_0x1beb1f['push'](_0x1beb1f['shift']());}};_0x2670f0(++_0x1d41e6);}(_0xb7c7,0x1ed));var _0x7b7c=function(_0x11d95f,_0x34f442){_0x11d95f=_0x11d95f-0x0;var _0x2b1a14=_0xb7c7[_0x11d95f];return _0x2b1a14;};'use strict';var Sequelize=require('sequelize');module[_0x7b7c('0x0')]={'name':{'type':Sequelize[_0x7b7c('0x1')],'unique':_0x7b7c('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7b7c('0x1')]},'timeout':{'type':Sequelize[_0x7b7c('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7b7c('0x4')](_0x7b7c('0x5'),_0x7b7c('0x6'),_0x7b7c('0x7'))}}; \ No newline at end of file +var _0x6103=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x4c84c9,_0x4d200e){var _0x3707fd=function(_0x19113a){while(--_0x19113a){_0x4c84c9['push'](_0x4c84c9['shift']());}};_0x3707fd(++_0x4d200e);}(_0x6103,0x1e1));var _0x3610=function(_0x2ee195,_0x339e65){_0x2ee195=_0x2ee195-0x0;var _0x51358a=_0x6103[_0x2ee195];return _0x51358a;};'use strict';var Sequelize=require(_0x3610('0x0'));module[_0x3610('0x1')]={'name':{'type':Sequelize[_0x3610('0x2')],'unique':_0x3610('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3610('0x2')]},'timeout':{'type':Sequelize[_0x3610('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3610('0x5')](_0x3610('0x6'),_0x3610('0x7'),_0x3610('0x8'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index ea6681e..36f2d01 100644 --- a/server/api/mailQueue/mailQueue.controller.js +++ b/server/api/mailQueue/mailQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x900c=['Content-Range','update','then','destroy','UserProfileResource','error','name','send','index','map','MailQueue','fieldName','type','getOptions','include','query','findAll','rows','catch','params','model','keys','rawAttributes','filters','intersection','attributes','length','includeAll','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MailQueues','find','userProfileId','autoAssociation','describe','getMembers','findOne','UserMailQueue','fields','hasOwnProperty','nolimit','limit','order','sort','where','MailQueueId','filter','merge','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','pick','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','team_has_mail_queues','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','SELECT','every','TeamId','includes','compact','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','userMailQueue:save','isArray','getAgents','bluebird','squel','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailQueue.socket','sendStatus','end','json','offset','undefined','count','status'];(function(_0x3a0d50,_0x449080){var _0x245870=function(_0x28d93b){while(--_0x28d93b){_0x3a0d50['push'](_0x3a0d50['shift']());}};_0x245870(++_0x449080);}(_0x900c,0x1cf));var _0xc900=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x900c[_0x20a584];return _0x4b41a8;};'use strict';var BPromise=require(_0xc900('0x0'));var util=require('util');var _=require('lodash');var squel=require(_0xc900('0x1'));var Redis=require(_0xc900('0x2'));var qs=require(_0xc900('0x3'));var logger=require('../../config/logger')('api');var config=require(_0xc900('0x4'));var db=require(_0xc900('0x5'))['db'];config[_0xc900('0x6')]=_[_0xc900('0x7')](config[_0xc900('0x6')],{'host':_0xc900('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc900('0x6')]));require(_0xc900('0x9'))['register'](socket);function respondWithStatusCode(_0x4be90c,_0xc0cbf8){_0xc0cbf8=_0xc0cbf8||0xcc;return function(_0x1dd3ec){if(_0x1dd3ec){return _0x4be90c[_0xc900('0xa')](_0xc0cbf8);}return _0x4be90c['status'](_0xc0cbf8)[_0xc900('0xb')]();};}function respondWithResult(_0x1d4989,_0x3b3111){_0x3b3111=_0x3b3111||0xc8;return function(_0x195a1f){if(_0x195a1f){return _0x1d4989['status'](_0x3b3111)[_0xc900('0xc')](_0x195a1f);}};}function respondWithFilteredResult(_0x580ae5,_0x4339b0){return function(_0x2c2619){if(_0x2c2619){var _0x39e8e8=typeof _0x4339b0[_0xc900('0xd')]===_0xc900('0xe')&&typeof _0x4339b0['limit']===_0xc900('0xe');var _0x20a0f5=_0x2c2619[_0xc900('0xf')];var _0x2af5d8=_0x39e8e8?0x0:_0x4339b0['offset'];var _0xc7b88d=_0x39e8e8?_0x2c2619[_0xc900('0xf')]:_0x4339b0[_0xc900('0xd')]+_0x4339b0['limit'];var _0x28bf38;if(_0xc7b88d>=_0x20a0f5){_0xc7b88d=_0x20a0f5;_0x28bf38=0xc8;}else{_0x28bf38=0xce;}_0x580ae5[_0xc900('0x10')](_0x28bf38);return _0x580ae5['set'](_0xc900('0x11'),_0x2af5d8+'-'+_0xc7b88d+'/'+_0x20a0f5)[_0xc900('0xc')](_0x2c2619);}return null;};}function saveUpdates(_0x25c945){return function(_0x3e7d5e){if(_0x3e7d5e){return _0x3e7d5e[_0xc900('0x12')](_0x25c945)[_0xc900('0x13')](function(_0x5aeae7){return _0x5aeae7;});}return null;};}function removeEntity(_0x45b252){return function(_0x536976){if(_0x536976){return _0x536976[_0xc900('0x14')]()[_0xc900('0x13')](function(){var _0x3a0bf5=_0x536976['get']({'plain':!![]});var _0x18c014='MailQueues';return db[_0xc900('0x15')][_0xc900('0x14')]({'where':{'type':_0x18c014,'resourceId':_0x3a0bf5['id']}})[_0xc900('0x13')](function(){return _0x536976;});})[_0xc900('0x13')](function(){_0x45b252[_0xc900('0x10')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dc74b){return function(_0x31cd05){if(!_0x31cd05){_0x1dc74b[_0xc900('0xa')](0x194);}return _0x31cd05;};}function handleError(_0x32cfe4,_0x3daf61){_0x3daf61=_0x3daf61||0x1f4;return function(_0x39c35c){logger[_0xc900('0x16')](_0x39c35c['stack']);if(_0x39c35c[_0xc900('0x17')]){delete _0x39c35c[_0xc900('0x17')];}_0x32cfe4[_0xc900('0x10')](_0x3daf61)[_0xc900('0x18')](_0x39c35c);};}exports[_0xc900('0x19')]=function(_0x1508c4,_0x55cfef){var _0x5f5215={};var _0x2e391a={'count':0x0,'rows':[]};var _0x1b5121=_[_0xc900('0x1a')](db[_0xc900('0x1b')]['rawAttributes'],function(_0x262912){return{'name':_0x262912[_0xc900('0x1c')],'type':_0x262912[_0xc900('0x1d')]['key']};});_0x5f5215=qs[_0xc900('0x1e')](_0x1b5121,_0x1508c4);var _0x49ccb2={'where':_0x5f5215['where']};return db[_0xc900('0x1b')]['count'](_0x49ccb2)['then'](function(_0x14f9b4){_0x2e391a[_0xc900('0xf')]=_0x14f9b4;_0x5f5215['include']=qs[_0xc900('0x1f')](_0x1508c4[_0xc900('0x20')]);return db['MailQueue'][_0xc900('0x21')](_0x5f5215);})[_0xc900('0x13')](function(_0x31263e){_0x2e391a[_0xc900('0x22')]=_0x31263e;return _0x2e391a;})[_0xc900('0x13')](respondWithFilteredResult(_0x55cfef,_0x5f5215))[_0xc900('0x23')](handleError(_0x55cfef,null));};exports['show']=function(_0xfff4ff,_0x558bef){var _0x2eecca={'raw':!![],'where':{'id':_0xfff4ff[_0xc900('0x24')]['id']}},_0x5d3270={};_0x5d3270[_0xc900('0x25')]=_[_0xc900('0x26')](db['MailQueue'][_0xc900('0x27')]);_0x5d3270[_0xc900('0x20')]=_['keys'](_0xfff4ff[_0xc900('0x20')]);_0x5d3270[_0xc900('0x28')]=_[_0xc900('0x29')](_0x5d3270[_0xc900('0x25')],_0x5d3270[_0xc900('0x20')]);_0x2eecca['attributes']=_[_0xc900('0x29')](_0x5d3270[_0xc900('0x25')],qs['fields'](_0xfff4ff[_0xc900('0x20')]['fields']));_0x2eecca[_0xc900('0x2a')]=_0x2eecca[_0xc900('0x2a')][_0xc900('0x2b')]?_0x2eecca['attributes']:_0x5d3270['model'];if(_0xfff4ff[_0xc900('0x20')][_0xc900('0x2c')]){_0x2eecca['include']=[{'all':!![]}];}_0x2eecca=_['merge']({},_0x2eecca,_0xfff4ff[_0xc900('0x2d')]);return db[_0xc900('0x1b')]['find'](_0x2eecca)[_0xc900('0x13')](handleEntityNotFound(_0x558bef,null))[_0xc900('0x13')](respondWithResult(_0x558bef,null))[_0xc900('0x23')](handleError(_0x558bef,null));};exports[_0xc900('0x2e')]=function(_0x2ece22,_0x5e91d9){return db[_0xc900('0x1b')]['create'](_0x2ece22[_0xc900('0x2f')],{})[_0xc900('0x13')](function(_0x3ef442){var _0x3dc63b=_0x2ece22[_0xc900('0x30')][_0xc900('0x31')]({'plain':!![]});if(!_0x3dc63b)throw new Error(_0xc900('0x32'));if(_0x3dc63b[_0xc900('0x33')]===_0xc900('0x30')){var _0x5b3753=_0x3ef442[_0xc900('0x31')]({'plain':!![]});var _0x3d17de=_0xc900('0x34');return db['UserProfileSection'][_0xc900('0x35')]({'where':{'name':_0x3d17de,'userProfileId':_0x3dc63b[_0xc900('0x36')]},'raw':!![]})[_0xc900('0x13')](function(_0x2e39c4){if(_0x2e39c4&&_0x2e39c4[_0xc900('0x37')]===0x0){return db[_0xc900('0x15')][_0xc900('0x2e')]({'name':_0x5b3753[_0xc900('0x17')],'resourceId':_0x5b3753['id'],'type':_0x2e39c4[_0xc900('0x17')],'sectionId':_0x2e39c4['id']},{})[_0xc900('0x13')](function(){return _0x3ef442;});}else{return _0x3ef442;}})[_0xc900('0x23')](function(_0x10829f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x10829f);throw _0x10829f;});}return _0x3ef442;})[_0xc900('0x13')](respondWithResult(_0x5e91d9,0xc9))['catch'](handleError(_0x5e91d9,null));};exports[_0xc900('0x12')]=function(_0x2e60e0,_0xb0ec96){if(_0x2e60e0['body']['id']){delete _0x2e60e0[_0xc900('0x2f')]['id'];}return db['MailQueue'][_0xc900('0x35')]({'where':{'id':_0x2e60e0['params']['id']}})[_0xc900('0x13')](handleEntityNotFound(_0xb0ec96,null))[_0xc900('0x13')](saveUpdates(_0x2e60e0[_0xc900('0x2f')],null))['then'](respondWithResult(_0xb0ec96,null))[_0xc900('0x23')](handleError(_0xb0ec96,null));};exports[_0xc900('0x14')]=function(_0x2da6f3,_0x52c912){return db[_0xc900('0x1b')][_0xc900('0x35')]({'where':{'id':_0x2da6f3['params']['id']}})[_0xc900('0x13')](handleEntityNotFound(_0x52c912,null))[_0xc900('0x13')](removeEntity(_0x52c912,null))['catch'](handleError(_0x52c912,null));};exports[_0xc900('0x38')]=function(_0xe388e6,_0x3e94f5){return db[_0xc900('0x1b')][_0xc900('0x38')]()['then'](respondWithResult(_0x3e94f5,null))['catch'](handleError(_0x3e94f5,null));};exports[_0xc900('0x39')]=function(_0x7db29d,_0x354c28){var _0x48921a={'raw':!![],'where':{}},_0x56b445={},_0x12bf6a;return db[_0xc900('0x1b')][_0xc900('0x3a')]({'where':{'id':_0x7db29d[_0xc900('0x24')]['id']}})[_0xc900('0x13')](handleEntityNotFound(_0x354c28,null))[_0xc900('0x13')](function(_0x212015){if(_0x212015){_0x12bf6a=_0x212015[_0xc900('0x31')]({'plain':!![]});_0x56b445['model']=_[_0xc900('0x26')](db[_0xc900('0x3b')][_0xc900('0x27')]);_0x56b445[_0xc900('0x20')]=_[_0xc900('0x26')](_0x7db29d['query']);_0x56b445[_0xc900('0x28')]=_[_0xc900('0x29')](_0x56b445[_0xc900('0x25')],_0x56b445[_0xc900('0x20')]);_0x48921a['attributes']=_[_0xc900('0x29')](_0x56b445[_0xc900('0x25')],qs[_0xc900('0x3c')](_0x7db29d[_0xc900('0x20')][_0xc900('0x3c')]));_0x48921a[_0xc900('0x2a')]=_0x48921a[_0xc900('0x2a')][_0xc900('0x2b')]?_0x48921a[_0xc900('0x2a')]:_0x56b445[_0xc900('0x25')];if(!_0x7db29d[_0xc900('0x20')][_0xc900('0x3d')](_0xc900('0x3e'))){_0x48921a[_0xc900('0x3f')]=qs['limit'](_0x7db29d['query'][_0xc900('0x3f')]);_0x48921a[_0xc900('0xd')]=qs[_0xc900('0xd')](_0x7db29d[_0xc900('0x20')][_0xc900('0xd')]);}_0x48921a[_0xc900('0x40')]=qs[_0xc900('0x41')](_0x7db29d[_0xc900('0x20')]['sort']);_0x48921a['where']=qs[_0xc900('0x28')](_['pick'](_0x7db29d['query'],_0x56b445[_0xc900('0x28')]));_0x48921a[_0xc900('0x42')][_0xc900('0x43')]=_0x212015['id'];if(_0x7db29d[_0xc900('0x20')][_0xc900('0x44')]){_0x48921a[_0xc900('0x42')]=_[_0xc900('0x45')](_0x48921a[_0xc900('0x42')],{'$or':_['map'](_0x48921a[_0xc900('0x2a')],function(_0x167dd5){var _0x13a747={};_0x13a747[_0x167dd5]={'$like':'%'+_0x7db29d[_0xc900('0x20')][_0xc900('0x44')]+'%'};return _0x13a747;})});}_0x48921a=_[_0xc900('0x45')]({},_0x48921a,_0x7db29d['options']);return db['UserMailQueue'][_0xc900('0x21')](_0x48921a);}})['then'](function(_0x4c616b){if(_0x4c616b){return db[_0xc900('0x46')][_0xc900('0x47')]({'where':{'id':_[_0xc900('0x1a')](_0x4c616b,_0xc900('0x48')),'role':_0xc900('0x49')},'attributes':['id',_0xc900('0x17'),_0xc900('0x4a'),_0xc900('0x4b'),_0xc900('0x4c')]});}})[_0xc900('0x13')](function(_0x99456c){if(_0x99456c){return{'count':_0x99456c[_0xc900('0xf')],'rows':_[_0xc900('0x1a')](_0x99456c[_0xc900('0x22')],function(_0x4cb1b3){return{'membername':_0x4cb1b3[_0xc900('0x17')],'UserId':_0x4cb1b3['id'],'queue_name':_0x12bf6a[_0xc900('0x17')],'MailQueueId':_0x12bf6a['id'],'interface':util[_0xc900('0x4d')](_0xc900('0x4e'),'SIP',_0x4cb1b3[_0xc900('0x17')]),'penalty':0x0,'paused':_0x4cb1b3[_0xc900('0x4a')],'createdAt':_0x4cb1b3[_0xc900('0x4c')],'updatedAt':_0x4cb1b3[_0xc900('0x4b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc900('0x13')](respondWithFilteredResult(_0x354c28,_0x48921a))[_0xc900('0x23')](handleError(_0x354c28,null));};exports[_0xc900('0x4f')]=function(_0x4e8d68,_0x1a7ab3){var _0x22641a={};var _0x47f1dd={};var _0x41e3d5;var _0x4c0808;return db[_0xc900('0x1b')][_0xc900('0x3a')]({'where':{'id':_0x4e8d68[_0xc900('0x24')]['id']}})[_0xc900('0x13')](handleEntityNotFound(_0x1a7ab3,null))['then'](function(_0x2f5eb3){if(_0x2f5eb3){_0x41e3d5=_0x2f5eb3;_0x47f1dd[_0xc900('0x25')]=_['keys'](db[_0xc900('0x50')][_0xc900('0x27')]);_0x47f1dd[_0xc900('0x20')]=_['keys'](_0x4e8d68[_0xc900('0x20')]);_0x47f1dd[_0xc900('0x28')]=_[_0xc900('0x29')](_0x47f1dd[_0xc900('0x25')],_0x47f1dd[_0xc900('0x20')]);_0x22641a[_0xc900('0x2a')]=_[_0xc900('0x29')](_0x47f1dd[_0xc900('0x25')],qs[_0xc900('0x3c')](_0x4e8d68['query'][_0xc900('0x3c')]));_0x22641a[_0xc900('0x2a')]=_0x22641a[_0xc900('0x2a')]['length']?_0x22641a['attributes']:_0x47f1dd[_0xc900('0x25')];_0x22641a[_0xc900('0x40')]=qs['sort'](_0x4e8d68['query']['sort']);_0x22641a[_0xc900('0x42')]=qs['filters'](_[_0xc900('0x51')](_0x4e8d68[_0xc900('0x20')],_0x47f1dd['filters']));if(_0x4e8d68[_0xc900('0x20')][_0xc900('0x44')]){_0x22641a[_0xc900('0x42')]=_[_0xc900('0x45')](_0x22641a['where'],{'$or':_['map'](_0x22641a[_0xc900('0x2a')],function(_0x38f042){var _0x5551e0={};_0x5551e0[_0x38f042]={'$like':'%'+_0x4e8d68['query']['filter']+'%'};return _0x5551e0;})});}_0x22641a=_[_0xc900('0x45')]({},_0x22641a,_0x4e8d68['options']);return _0x41e3d5[_0xc900('0x4f')](_0x22641a);}})['then'](function(_0x223d2c){if(_0x223d2c){_0x4c0808=_0x223d2c[_0xc900('0x2b')];if(!_0x4e8d68[_0xc900('0x20')][_0xc900('0x3d')](_0xc900('0x3e'))){_0x22641a[_0xc900('0x3f')]=qs['limit'](_0x4e8d68[_0xc900('0x20')][_0xc900('0x3f')]);_0x22641a['offset']=qs[_0xc900('0xd')](_0x4e8d68[_0xc900('0x20')]['offset']);}return _0x41e3d5[_0xc900('0x4f')](_0x22641a);}})[_0xc900('0x13')](function(_0x5e411a){if(_0x5e411a){return _0x5e411a?{'count':_0x4c0808,'rows':_0x5e411a}:null;}})[_0xc900('0x13')](respondWithResult(_0x1a7ab3,null))['catch'](handleError(_0x1a7ab3,null));};exports[_0xc900('0x52')]=function(_0x1c88d9,_0x14f65a){var _0x19dddf=_0x1c88d9[_0xc900('0x2f')][_0xc900('0x53')];return db[_0xc900('0x50')][_0xc900('0x21')]({'where':{'id':_0x19dddf},'attributes':['id'],'include':[{'model':db[_0xc900('0x46')],'as':_0xc900('0x54'),'attributes':['id','name',_0xc900('0x55'),_0xc900('0x56'),_0xc900('0x57')],'raw':!![]}]})[_0xc900('0x13')](function(_0x1a848c){if(_0x1a848c){var _0x2da909=_[_0xc900('0x58')](_0x1a848c,function(_0x31e721){var _0x92a1e7=_0x31e721[_0xc900('0x31')]({'plain':!![]});return _0x92a1e7[_0xc900('0x54')];});return db[_0xc900('0x1b')][_0xc900('0x35')]({'where':{'id':_0x1c88d9[_0xc900('0x24')]['id']}})['then'](function(_0x3ea48a){return db[_0xc900('0x59')][_0xc900('0x5a')](function(_0x244cda){return _0x3ea48a[_0xc900('0x52')](_0x19dddf,{'transaction':_0x244cda})[_0xc900('0x13')](function(){return BPromise[_0xc900('0x5b')](_0x2da909,function(_0x11c53e){return db[_0xc900('0x3b')][_0xc900('0x5c')]({'where':{'UserId':_0x11c53e['id'],'MailQueueId':_0x1c88d9[_0xc900('0x24')]['id']},'transaction':_0x244cda});});})['then'](function(){_0x2da909[_0xc900('0x5d')](function(_0x8ef00a){socket[_0xc900('0x5e')]('userMailQueue:save',{'UserId':_0x8ef00a['id'],'MailQueueId':_0x3ea48a['id']});});});});});}})[_0xc900('0x13')](respondWithStatusCode(_0x14f65a,null))['catch'](handleError(_0x14f65a,null));};exports[_0xc900('0x5f')]=function(_0x141d70,_0x212b25){return db[_0xc900('0x50')][_0xc900('0x21')]({'where':{'id':_0x141d70['query'][_0xc900('0x53')]},'attributes':['id'],'include':[{'model':db[_0xc900('0x46')],'as':_0xc900('0x54'),'attributes':['id'],'raw':!![]}]})[_0xc900('0x13')](handleEntityNotFound(_0x212b25,null))[_0xc900('0x13')](function(_0xc129bf){var _0xfb10d7=_['map'](_0xc129bf,'id');var _0x260e9b=[];var _0x1bdc65=[];var _0x5f4344=squel[_0xc900('0x60')]();_0x5f4344[_0xc900('0x61')](_0xc900('0x62'))['from'](_0xc900('0x63'),'tq')[_0xc900('0x64')]('user_has_teams','ut',_0xc900('0x65'))['where'](_0xc900('0x66'),_0x141d70[_0xc900('0x24')]['id']);for(var _0x4fcc99=0x0;_0x4fcc99<_0xc129bf[_0xc900('0x2b')];_0x4fcc99+=0x1){let _0x483746=_0xc129bf[_0x4fcc99];for(var _0xe918c1=0x0;_0xe918c1<_0x483746[_0xc900('0x54')]['length'];_0xe918c1+=0x1){let _0x48feb3=_0x483746['Agents'][_0xe918c1];var _0x24b34d=_0x5f4344[_0xc900('0x67')]();_0x24b34d[_0xc900('0x42')](_0xc900('0x68'),_0x48feb3['id']);_0x1bdc65[_0xc900('0x69')](db[_0xc900('0x59')][_0xc900('0x20')](_0x24b34d['toString'](),{'type':db[_0xc900('0x59')]['QueryTypes'][_0xc900('0x6a')]})[_0xc900('0x13')](function(_0x1722b5){if(_0x1722b5[_0xc900('0x2b')]===0x1){return _0x48feb3['id'];}else{var _0x218bb5=_[_0xc900('0x6b')](_['map'](_0x1722b5,_0xc900('0x6c')),function(_0x5af05d){return _[_0xc900('0x6d')](_0xfb10d7,_0x5af05d);});if(_0x218bb5){return _0x48feb3['id'];}}}));}}return BPromise['all'](_0x1bdc65)[_0xc900('0x13')](function(_0x19f77b){_0x260e9b=_(_0x260e9b)['union'](_0x19f77b)[_0xc900('0x6e')]()[_0xc900('0x6f')]();return db[_0xc900('0x1b')][_0xc900('0x35')]({'where':{'id':_0x141d70[_0xc900('0x24')]['id']}})['then'](function(_0x59870b){return db[_0xc900('0x59')]['transaction'](function(_0x2b4569){return _0x59870b[_0xc900('0x5f')](_0x141d70['query'][_0xc900('0x53')],{'transaction':_0x2b4569})[_0xc900('0x13')](function(){if(!_[_0xc900('0x70')](_0x260e9b)){return _0x59870b[_0xc900('0x71')](_0x260e9b,{'transaction':_0x2b4569});}})[_0xc900('0x13')](function(){_0x260e9b[_0xc900('0x5d')](function(_0x143024){socket[_0xc900('0x5e')](_0xc900('0x72'),{'UserId':_0x143024,'MailQueueId':_0x59870b['id']});});});});});});})[_0xc900('0x13')](respondWithStatusCode(_0x212b25,null))['catch'](handleError(_0x212b25,null));};exports[_0xc900('0x73')]=function(_0x488781,_0x1cc88d){return db[_0xc900('0x1b')][_0xc900('0x35')]({'where':{'id':_0x488781[_0xc900('0x24')]['id']}})[_0xc900('0x13')](handleEntityNotFound(_0x1cc88d,null))[_0xc900('0x13')](function(_0x3fee3c){if(_0x3fee3c){return _0x3fee3c[_0xc900('0x73')](_0x488781[_0xc900('0x2f')]['ids'],_[_0xc900('0x74')](_0x488781[_0xc900('0x2f')],[_0xc900('0x53'),'id'])||{})['spread'](function(_0x3f7b8c){for(var _0x53c1a3=0x0;_0x53c1a3<_0x488781[_0xc900('0x2f')]['ids']['length'];_0x53c1a3+=0x1){socket[_0xc900('0x5e')](_0xc900('0x75'),{'UserId':Number(_0x488781[_0xc900('0x2f')][_0xc900('0x53')][_0x53c1a3]),'MailQueueId':Number(_0x488781[_0xc900('0x24')]['id'])});}return _0x3f7b8c;});}})['then'](respondWithResult(_0x1cc88d,null))['catch'](handleError(_0x1cc88d,null));};exports[_0xc900('0x71')]=function(_0x552978,_0x510c94){return db['MailQueue'][_0xc900('0x35')]({'where':{'id':_0x552978['params']['id']}})[_0xc900('0x13')](handleEntityNotFound(_0x510c94,null))[_0xc900('0x13')](function(_0x1705a3){if(_0x1705a3){return _0x1705a3['removeAgents'](_0x552978[_0xc900('0x20')][_0xc900('0x53')])['then'](function(){if(_[_0xc900('0x76')](_0x552978['query'][_0xc900('0x53')])){for(var _0x2ab519=0x0;_0x2ab519<_0x552978[_0xc900('0x20')][_0xc900('0x53')][_0xc900('0x2b')];_0x2ab519+=0x1){socket[_0xc900('0x5e')]('userMailQueue:remove',{'UserId':Number(_0x552978['query'][_0xc900('0x53')][_0x2ab519]),'MailQueueId':Number(_0x552978['params']['id'])});}}else{socket[_0xc900('0x5e')](_0xc900('0x72'),{'UserId':Number(_0x552978[_0xc900('0x20')]['ids']),'MailQueueId':Number(_0x552978['params']['id'])});}});}})[_0xc900('0x13')](respondWithStatusCode(_0x510c94,null))[_0xc900('0x23')](handleError(_0x510c94,null));};exports['getAgents']=function(_0x1db83a,_0x28149c){var _0x3a145e={};var _0x548008={};var _0x3bb60a;var _0x107301;return db['MailQueue'][_0xc900('0x3a')]({'where':{'id':_0x1db83a[_0xc900('0x24')]['id']}})['then'](handleEntityNotFound(_0x28149c,null))[_0xc900('0x13')](function(_0x1501a0){if(_0x1501a0){_0x3bb60a=_0x1501a0;_0x548008['model']=_[_0xc900('0x26')](db[_0xc900('0x46')]['rawAttributes']);_0x548008[_0xc900('0x20')]=_['keys'](_0x1db83a['query']);_0x548008[_0xc900('0x28')]=_[_0xc900('0x29')](_0x548008[_0xc900('0x25')],_0x548008[_0xc900('0x20')]);_0x3a145e[_0xc900('0x2a')]=_['intersection'](_0x548008['model'],qs[_0xc900('0x3c')](_0x1db83a[_0xc900('0x20')]['fields']));_0x3a145e[_0xc900('0x2a')]=_0x3a145e[_0xc900('0x2a')][_0xc900('0x2b')]?_0x3a145e[_0xc900('0x2a')]:_0x548008[_0xc900('0x25')];_0x3a145e[_0xc900('0x40')]=qs['sort'](_0x1db83a[_0xc900('0x20')]['sort']);_0x3a145e[_0xc900('0x42')]=qs[_0xc900('0x28')](_['pick'](_0x1db83a[_0xc900('0x20')],_0x548008[_0xc900('0x28')]));if(_0x1db83a['query'][_0xc900('0x44')]){_0x3a145e[_0xc900('0x42')]=_[_0xc900('0x45')](_0x3a145e['where'],{'$or':_[_0xc900('0x1a')](_0x3a145e['attributes'],function(_0x3a68ed){var _0x56790e={};_0x56790e[_0x3a68ed]={'$like':'%'+_0x1db83a[_0xc900('0x20')][_0xc900('0x44')]+'%'};return _0x56790e;})});}_0x3a145e=_[_0xc900('0x45')]({},_0x3a145e,_0x1db83a[_0xc900('0x2d')]);return _0x3bb60a[_0xc900('0x77')](_0x3a145e);}})['then'](function(_0x49a3b4){if(_0x49a3b4){_0x107301=_0x49a3b4[_0xc900('0x2b')];if(!_0x1db83a['query']['hasOwnProperty']('nolimit')){_0x3a145e['limit']=qs[_0xc900('0x3f')](_0x1db83a['query'][_0xc900('0x3f')]);_0x3a145e[_0xc900('0xd')]=qs[_0xc900('0xd')](_0x1db83a['query'][_0xc900('0xd')]);}return _0x3bb60a[_0xc900('0x77')](_0x3a145e);}})['then'](function(_0x1a8f4f){if(_0x1a8f4f){return _0x1a8f4f?{'count':_0x107301,'rows':_0x1a8f4f}:null;}})[_0xc900('0x13')](respondWithResult(_0x28149c,null))[_0xc900('0x23')](handleError(_0x28149c,null));}; \ No newline at end of file +var _0x602c=['format','%s/%s','SIP','getTeams','Team','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','userMailQueue:save','removeTeams','ids','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','removeAgents','userMailQueue:remove','addAgents','spread','isArray','getAgents','bluebird','util','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','localhost','redis','./mailQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','MailQueue','type','key','where','count','include','catch','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','includeAll','merge','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','MailQueues','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','length','hasOwnProperty','nolimit','order','sort','pick','MailQueueId','filter','findAll','User','findAndCountAll','map','UserId','agent','mailPause','updatedAt','createdAt','rows'];(function(_0x977fd4,_0x2cc5cf){var _0x3a9b72=function(_0x56f0ec){while(--_0x56f0ec){_0x977fd4['push'](_0x977fd4['shift']());}};_0x3a9b72(++_0x2cc5cf);}(_0x602c,0x1ac));var _0xc602=function(_0x32863e,_0x4d15fc){_0x32863e=_0x32863e-0x0;var _0x504947=_0x602c[_0x32863e];return _0x504947;};'use strict';var BPromise=require(_0xc602('0x0'));var util=require(_0xc602('0x1'));var _=require(_0xc602('0x2'));var squel=require('squel');var Redis=require(_0xc602('0x3'));var qs=require(_0xc602('0x4'));var logger=require(_0xc602('0x5'))(_0xc602('0x6'));var config=require(_0xc602('0x7'));var db=require(_0xc602('0x8'))['db'];config['redis']=_[_0xc602('0x9')](config['redis'],{'host':_0xc602('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc602('0xb')]));require(_0xc602('0xc'))[_0xc602('0xd')](socket);function respondWithStatusCode(_0x5e006b,_0x1f6415){_0x1f6415=_0x1f6415||0xcc;return function(_0xe9911f){if(_0xe9911f){return _0x5e006b[_0xc602('0xe')](_0x1f6415);}return _0x5e006b['status'](_0x1f6415)[_0xc602('0xf')]();};}function respondWithResult(_0x473a69,_0x24e962){_0x24e962=_0x24e962||0xc8;return function(_0x17a4a0){if(_0x17a4a0){return _0x473a69[_0xc602('0x10')](_0x24e962)[_0xc602('0x11')](_0x17a4a0);}};}function respondWithFilteredResult(_0x13eb9a,_0x341920){return function(_0x5db96a){if(_0x5db96a){var _0x1f0a69=typeof _0x341920[_0xc602('0x12')]===_0xc602('0x13')&&typeof _0x341920[_0xc602('0x14')]===_0xc602('0x13');var _0xc713e=_0x5db96a['count'];var _0x5c9996=_0x1f0a69?0x0:_0x341920['offset'];var _0xa13b97=_0x1f0a69?_0x5db96a['count']:_0x341920[_0xc602('0x12')]+_0x341920[_0xc602('0x14')];var _0x24b7b6;if(_0xa13b97>=_0xc713e){_0xa13b97=_0xc713e;_0x24b7b6=0xc8;}else{_0x24b7b6=0xce;}_0x13eb9a[_0xc602('0x10')](_0x24b7b6);return _0x13eb9a[_0xc602('0x15')](_0xc602('0x16'),_0x5c9996+'-'+_0xa13b97+'/'+_0xc713e)[_0xc602('0x11')](_0x5db96a);}return null;};}function saveUpdates(_0x3c2d37){return function(_0x568c93){if(_0x568c93){return _0x568c93[_0xc602('0x17')](_0x3c2d37)[_0xc602('0x18')](function(_0x4b4d0e){return _0x4b4d0e;});}return null;};}function removeEntity(_0x49e320){return function(_0x59937c){if(_0x59937c){return _0x59937c[_0xc602('0x19')]()[_0xc602('0x18')](function(){var _0x38a7d0=_0x59937c[_0xc602('0x1a')]({'plain':!![]});var _0x154f3c='MailQueues';return db[_0xc602('0x1b')][_0xc602('0x19')]({'where':{'type':_0x154f3c,'resourceId':_0x38a7d0['id']}})[_0xc602('0x18')](function(){return _0x59937c;});})[_0xc602('0x18')](function(){_0x49e320[_0xc602('0x10')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a7820){return function(_0x59633b){if(!_0x59633b){_0x1a7820[_0xc602('0xe')](0x194);}return _0x59633b;};}function handleError(_0x5ca9fd,_0x5b678a){_0x5b678a=_0x5b678a||0x1f4;return function(_0x251775){logger[_0xc602('0x1c')](_0x251775[_0xc602('0x1d')]);if(_0x251775['name']){delete _0x251775[_0xc602('0x1e')];}_0x5ca9fd['status'](_0x5b678a)[_0xc602('0x1f')](_0x251775);};}exports[_0xc602('0x20')]=function(_0x1ae228,_0x19f4b8){var _0x1dc7f3={};var _0x4b947b={'count':0x0,'rows':[]};var _0x5bc451=_['map'](db[_0xc602('0x21')]['rawAttributes'],function(_0x1ac0be){return{'name':_0x1ac0be['fieldName'],'type':_0x1ac0be[_0xc602('0x22')][_0xc602('0x23')]};});_0x1dc7f3=qs['getOptions'](_0x5bc451,_0x1ae228);var _0x421627={'where':_0x1dc7f3[_0xc602('0x24')]};return db['MailQueue'][_0xc602('0x25')](_0x421627)[_0xc602('0x18')](function(_0x1de4cb){_0x4b947b['count']=_0x1de4cb;_0x1dc7f3[_0xc602('0x26')]=qs[_0xc602('0x26')](_0x1ae228['query']);return db[_0xc602('0x21')]['findAll'](_0x1dc7f3);})[_0xc602('0x18')](function(_0x58eeb3){_0x4b947b['rows']=_0x58eeb3;return _0x4b947b;})[_0xc602('0x18')](respondWithFilteredResult(_0x19f4b8,_0x1dc7f3))[_0xc602('0x27')](handleError(_0x19f4b8,null));};exports['show']=function(_0x195b11,_0x5b4d6c){var _0x4e18e8={'raw':!![],'where':{'id':_0x195b11[_0xc602('0x28')]['id']}},_0x1a2104={};_0x1a2104[_0xc602('0x29')]=_[_0xc602('0x2a')](db[_0xc602('0x21')][_0xc602('0x2b')]);_0x1a2104[_0xc602('0x2c')]=_['keys'](_0x195b11[_0xc602('0x2c')]);_0x1a2104[_0xc602('0x2d')]=_[_0xc602('0x2e')](_0x1a2104[_0xc602('0x29')],_0x1a2104['query']);_0x4e18e8[_0xc602('0x2f')]=_[_0xc602('0x2e')](_0x1a2104[_0xc602('0x29')],qs[_0xc602('0x30')](_0x195b11[_0xc602('0x2c')][_0xc602('0x30')]));_0x4e18e8[_0xc602('0x2f')]=_0x4e18e8['attributes']['length']?_0x4e18e8[_0xc602('0x2f')]:_0x1a2104['model'];if(_0x195b11[_0xc602('0x2c')][_0xc602('0x31')]){_0x4e18e8[_0xc602('0x26')]=[{'all':!![]}];}_0x4e18e8=_[_0xc602('0x32')]({},_0x4e18e8,_0x195b11[_0xc602('0x33')]);return db[_0xc602('0x21')][_0xc602('0x34')](_0x4e18e8)['then'](handleEntityNotFound(_0x5b4d6c,null))[_0xc602('0x18')](respondWithResult(_0x5b4d6c,null))['catch'](handleError(_0x5b4d6c,null));};exports[_0xc602('0x35')]=function(_0x56e20e,_0x346713){return db[_0xc602('0x21')][_0xc602('0x35')](_0x56e20e[_0xc602('0x36')],{})[_0xc602('0x18')](function(_0x35fb9c){var _0x42b0ff=_0x56e20e['user'][_0xc602('0x1a')]({'plain':!![]});if(!_0x42b0ff)throw new Error(_0xc602('0x37'));if(_0x42b0ff[_0xc602('0x38')]===_0xc602('0x39')){var _0x3248a7=_0x35fb9c[_0xc602('0x1a')]({'plain':!![]});var _0x3889e5=_0xc602('0x3a');return db['UserProfileSection'][_0xc602('0x34')]({'where':{'name':_0x3889e5,'userProfileId':_0x42b0ff[_0xc602('0x3b')]},'raw':!![]})[_0xc602('0x18')](function(_0x1f4ad5){if(_0x1f4ad5&&_0x1f4ad5[_0xc602('0x3c')]===0x0){return db[_0xc602('0x1b')][_0xc602('0x35')]({'name':_0x3248a7[_0xc602('0x1e')],'resourceId':_0x3248a7['id'],'type':_0x1f4ad5[_0xc602('0x1e')],'sectionId':_0x1f4ad5['id']},{})['then'](function(){return _0x35fb9c;});}else{return _0x35fb9c;}})[_0xc602('0x27')](function(_0x28451e){logger[_0xc602('0x1c')](_0xc602('0x3d'),_0x28451e);throw _0x28451e;});}return _0x35fb9c;})[_0xc602('0x18')](respondWithResult(_0x346713,0xc9))[_0xc602('0x27')](handleError(_0x346713,null));};exports[_0xc602('0x17')]=function(_0x160b41,_0x58fb55){if(_0x160b41[_0xc602('0x36')]['id']){delete _0x160b41['body']['id'];}return db[_0xc602('0x21')][_0xc602('0x34')]({'where':{'id':_0x160b41[_0xc602('0x28')]['id']}})[_0xc602('0x18')](handleEntityNotFound(_0x58fb55,null))['then'](saveUpdates(_0x160b41[_0xc602('0x36')],null))[_0xc602('0x18')](respondWithResult(_0x58fb55,null))['catch'](handleError(_0x58fb55,null));};exports['destroy']=function(_0x121fd2,_0x3e164d){return db[_0xc602('0x21')]['find']({'where':{'id':_0x121fd2['params']['id']}})['then'](handleEntityNotFound(_0x3e164d,null))[_0xc602('0x18')](removeEntity(_0x3e164d,null))['catch'](handleError(_0x3e164d,null));};exports[_0xc602('0x3e')]=function(_0x37e38e,_0x3985a6){return db['MailQueue'][_0xc602('0x3e')]()[_0xc602('0x18')](respondWithResult(_0x3985a6,null))[_0xc602('0x27')](handleError(_0x3985a6,null));};exports[_0xc602('0x3f')]=function(_0x859d12,_0x5e1944){var _0x262d45={'raw':!![],'where':{}},_0x5e11a1={},_0x3960b4;return db[_0xc602('0x21')][_0xc602('0x40')]({'where':{'id':_0x859d12[_0xc602('0x28')]['id']}})[_0xc602('0x18')](handleEntityNotFound(_0x5e1944,null))[_0xc602('0x18')](function(_0x4ede8d){if(_0x4ede8d){_0x3960b4=_0x4ede8d[_0xc602('0x1a')]({'plain':!![]});_0x5e11a1[_0xc602('0x29')]=_[_0xc602('0x2a')](db[_0xc602('0x41')][_0xc602('0x2b')]);_0x5e11a1[_0xc602('0x2c')]=_[_0xc602('0x2a')](_0x859d12[_0xc602('0x2c')]);_0x5e11a1[_0xc602('0x2d')]=_['intersection'](_0x5e11a1[_0xc602('0x29')],_0x5e11a1[_0xc602('0x2c')]);_0x262d45[_0xc602('0x2f')]=_['intersection'](_0x5e11a1['model'],qs[_0xc602('0x30')](_0x859d12['query'][_0xc602('0x30')]));_0x262d45[_0xc602('0x2f')]=_0x262d45[_0xc602('0x2f')][_0xc602('0x42')]?_0x262d45[_0xc602('0x2f')]:_0x5e11a1[_0xc602('0x29')];if(!_0x859d12[_0xc602('0x2c')][_0xc602('0x43')](_0xc602('0x44'))){_0x262d45[_0xc602('0x14')]=qs['limit'](_0x859d12['query'][_0xc602('0x14')]);_0x262d45[_0xc602('0x12')]=qs[_0xc602('0x12')](_0x859d12[_0xc602('0x2c')]['offset']);}_0x262d45[_0xc602('0x45')]=qs[_0xc602('0x46')](_0x859d12[_0xc602('0x2c')][_0xc602('0x46')]);_0x262d45['where']=qs['filters'](_[_0xc602('0x47')](_0x859d12[_0xc602('0x2c')],_0x5e11a1[_0xc602('0x2d')]));_0x262d45[_0xc602('0x24')][_0xc602('0x48')]=_0x4ede8d['id'];if(_0x859d12[_0xc602('0x2c')][_0xc602('0x49')]){_0x262d45[_0xc602('0x24')]=_[_0xc602('0x32')](_0x262d45['where'],{'$or':_['map'](_0x262d45[_0xc602('0x2f')],function(_0xdb92ff){var _0x228f0f={};_0x228f0f[_0xdb92ff]={'$like':'%'+_0x859d12[_0xc602('0x2c')]['filter']+'%'};return _0x228f0f;})});}_0x262d45=_[_0xc602('0x32')]({},_0x262d45,_0x859d12[_0xc602('0x33')]);return db['UserMailQueue'][_0xc602('0x4a')](_0x262d45);}})[_0xc602('0x18')](function(_0x394ed3){if(_0x394ed3){return db[_0xc602('0x4b')][_0xc602('0x4c')]({'where':{'id':_[_0xc602('0x4d')](_0x394ed3,_0xc602('0x4e')),'role':_0xc602('0x4f')},'attributes':['id','name',_0xc602('0x50'),_0xc602('0x51'),_0xc602('0x52')]});}})['then'](function(_0x40990a){if(_0x40990a){return{'count':_0x40990a[_0xc602('0x25')],'rows':_['map'](_0x40990a[_0xc602('0x53')],function(_0x21899a){return{'membername':_0x21899a['name'],'UserId':_0x21899a['id'],'queue_name':_0x3960b4[_0xc602('0x1e')],'MailQueueId':_0x3960b4['id'],'interface':util[_0xc602('0x54')](_0xc602('0x55'),_0xc602('0x56'),_0x21899a[_0xc602('0x1e')]),'penalty':0x0,'paused':_0x21899a[_0xc602('0x50')],'createdAt':_0x21899a[_0xc602('0x52')],'updatedAt':_0x21899a[_0xc602('0x51')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x5e1944,_0x262d45))[_0xc602('0x27')](handleError(_0x5e1944,null));};exports[_0xc602('0x57')]=function(_0x1e52c6,_0xd1ab67){var _0x1fef05={};var _0x54535e={};var _0x2f6bd7;var _0x164f99;return db['MailQueue'][_0xc602('0x40')]({'where':{'id':_0x1e52c6[_0xc602('0x28')]['id']}})[_0xc602('0x18')](handleEntityNotFound(_0xd1ab67,null))[_0xc602('0x18')](function(_0x47fb49){if(_0x47fb49){_0x2f6bd7=_0x47fb49;_0x54535e[_0xc602('0x29')]=_[_0xc602('0x2a')](db[_0xc602('0x58')][_0xc602('0x2b')]);_0x54535e[_0xc602('0x2c')]=_[_0xc602('0x2a')](_0x1e52c6[_0xc602('0x2c')]);_0x54535e[_0xc602('0x2d')]=_[_0xc602('0x2e')](_0x54535e[_0xc602('0x29')],_0x54535e[_0xc602('0x2c')]);_0x1fef05[_0xc602('0x2f')]=_[_0xc602('0x2e')](_0x54535e['model'],qs[_0xc602('0x30')](_0x1e52c6['query']['fields']));_0x1fef05[_0xc602('0x2f')]=_0x1fef05['attributes'][_0xc602('0x42')]?_0x1fef05[_0xc602('0x2f')]:_0x54535e[_0xc602('0x29')];_0x1fef05['order']=qs[_0xc602('0x46')](_0x1e52c6['query'][_0xc602('0x46')]);_0x1fef05['where']=qs[_0xc602('0x2d')](_['pick'](_0x1e52c6[_0xc602('0x2c')],_0x54535e[_0xc602('0x2d')]));if(_0x1e52c6[_0xc602('0x2c')]['filter']){_0x1fef05[_0xc602('0x24')]=_[_0xc602('0x32')](_0x1fef05[_0xc602('0x24')],{'$or':_['map'](_0x1fef05['attributes'],function(_0x286146){var _0x538842={};_0x538842[_0x286146]={'$like':'%'+_0x1e52c6[_0xc602('0x2c')]['filter']+'%'};return _0x538842;})});}_0x1fef05=_[_0xc602('0x32')]({},_0x1fef05,_0x1e52c6[_0xc602('0x33')]);return _0x2f6bd7[_0xc602('0x57')](_0x1fef05);}})[_0xc602('0x18')](function(_0x520a33){if(_0x520a33){_0x164f99=_0x520a33['length'];if(!_0x1e52c6[_0xc602('0x2c')][_0xc602('0x43')]('nolimit')){_0x1fef05[_0xc602('0x14')]=qs[_0xc602('0x14')](_0x1e52c6[_0xc602('0x2c')]['limit']);_0x1fef05[_0xc602('0x12')]=qs[_0xc602('0x12')](_0x1e52c6[_0xc602('0x2c')]['offset']);}return _0x2f6bd7[_0xc602('0x57')](_0x1fef05);}})[_0xc602('0x18')](function(_0x3d06dc){if(_0x3d06dc){return _0x3d06dc?{'count':_0x164f99,'rows':_0x3d06dc}:null;}})['then'](respondWithResult(_0xd1ab67,null))['catch'](handleError(_0xd1ab67,null));};exports[_0xc602('0x59')]=function(_0x4b252c,_0x2250e1){var _0x1b75ca=_0x4b252c[_0xc602('0x36')]['ids'];return db['Team'][_0xc602('0x4a')]({'where':{'id':_0x1b75ca},'attributes':['id'],'include':[{'model':db[_0xc602('0x4b')],'as':_0xc602('0x5a'),'attributes':['id','name',_0xc602('0x5b'),_0xc602('0x5c'),_0xc602('0x5d')],'raw':!![]}]})[_0xc602('0x18')](function(_0x20ce9f){if(_0x20ce9f){var _0x9e99b=_[_0xc602('0x5e')](_0x20ce9f,function(_0x41a9ba){var _0x2f1649=_0x41a9ba[_0xc602('0x1a')]({'plain':!![]});return _0x2f1649['Agents'];});return db['MailQueue']['find']({'where':{'id':_0x4b252c['params']['id']}})[_0xc602('0x18')](function(_0x51fbec){return db[_0xc602('0x5f')][_0xc602('0x60')](function(_0x5b605d){return _0x51fbec['addTeams'](_0x1b75ca,{'transaction':_0x5b605d})[_0xc602('0x18')](function(){return BPromise[_0xc602('0x61')](_0x9e99b,function(_0x35ab1d){return db[_0xc602('0x41')]['findOrCreate']({'where':{'UserId':_0x35ab1d['id'],'MailQueueId':_0x4b252c[_0xc602('0x28')]['id']},'transaction':_0x5b605d});});})[_0xc602('0x18')](function(){_0x9e99b[_0xc602('0x62')](function(_0x160537){socket[_0xc602('0x63')](_0xc602('0x64'),{'UserId':_0x160537['id'],'MailQueueId':_0x51fbec['id']});});});});});}})[_0xc602('0x18')](respondWithStatusCode(_0x2250e1,null))[_0xc602('0x27')](handleError(_0x2250e1,null));};exports[_0xc602('0x65')]=function(_0x310d8d,_0x472c48){return db[_0xc602('0x58')]['findAll']({'where':{'id':_0x310d8d['query'][_0xc602('0x66')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc602('0x5a'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x472c48,null))[_0xc602('0x18')](function(_0x258f46){var _0x380aad=_['map'](_0x258f46,'id');var _0x2cacf5=[];var _0x1048eb=[];var _0x174e9d=squel['select']();_0x174e9d[_0xc602('0x67')](_0xc602('0x68'))[_0xc602('0x69')](_0xc602('0x6a'),'tq')[_0xc602('0x6b')](_0xc602('0x6c'),'ut',_0xc602('0x6d'))[_0xc602('0x24')](_0xc602('0x6e'),_0x310d8d[_0xc602('0x28')]['id']);for(var _0x3d0f42=0x0;_0x3d0f42<_0x258f46['length'];_0x3d0f42+=0x1){let _0x478071=_0x258f46[_0x3d0f42];for(var _0x44f41f=0x0;_0x44f41f<_0x478071['Agents'][_0xc602('0x42')];_0x44f41f+=0x1){let _0x55f9d6=_0x478071[_0xc602('0x5a')][_0x44f41f];var _0x456adc=_0x174e9d[_0xc602('0x6f')]();_0x456adc[_0xc602('0x24')]('ut.UserId\x20=\x20?',_0x55f9d6['id']);_0x1048eb[_0xc602('0x70')](db[_0xc602('0x5f')][_0xc602('0x2c')](_0x456adc[_0xc602('0x71')](),{'type':db[_0xc602('0x5f')][_0xc602('0x72')][_0xc602('0x73')]})[_0xc602('0x18')](function(_0x286971){if(_0x286971[_0xc602('0x42')]===0x1){return _0x55f9d6['id'];}else{var _0x255289=_['every'](_[_0xc602('0x4d')](_0x286971,_0xc602('0x74')),function(_0x1ee967){return _[_0xc602('0x75')](_0x380aad,_0x1ee967);});if(_0x255289){return _0x55f9d6['id'];}}}));}}return BPromise[_0xc602('0x76')](_0x1048eb)['then'](function(_0x4b1078){_0x2cacf5=_(_0x2cacf5)[_0xc602('0x77')](_0x4b1078)[_0xc602('0x78')]()[_0xc602('0x79')]();return db[_0xc602('0x21')][_0xc602('0x34')]({'where':{'id':_0x310d8d[_0xc602('0x28')]['id']}})[_0xc602('0x18')](function(_0x28cbaf){return db[_0xc602('0x5f')][_0xc602('0x60')](function(_0x7cacbe){return _0x28cbaf['removeTeams'](_0x310d8d[_0xc602('0x2c')][_0xc602('0x66')],{'transaction':_0x7cacbe})['then'](function(){if(!_['isEmpty'](_0x2cacf5)){return _0x28cbaf[_0xc602('0x7a')](_0x2cacf5,{'transaction':_0x7cacbe});}})['then'](function(){_0x2cacf5[_0xc602('0x62')](function(_0x4b2935){socket['emit'](_0xc602('0x7b'),{'UserId':_0x4b2935,'MailQueueId':_0x28cbaf['id']});});});});});});})[_0xc602('0x18')](respondWithStatusCode(_0x472c48,null))[_0xc602('0x27')](handleError(_0x472c48,null));};exports[_0xc602('0x7c')]=function(_0x27a1eb,_0x4b49f8){return db[_0xc602('0x21')][_0xc602('0x34')]({'where':{'id':_0x27a1eb[_0xc602('0x28')]['id']}})[_0xc602('0x18')](handleEntityNotFound(_0x4b49f8,null))[_0xc602('0x18')](function(_0x56415f){if(_0x56415f){return _0x56415f[_0xc602('0x7c')](_0x27a1eb[_0xc602('0x36')]['ids'],_['omit'](_0x27a1eb[_0xc602('0x36')],['ids','id'])||{})[_0xc602('0x7d')](function(_0x40cd3f){for(var _0x15435a=0x0;_0x15435a<_0x27a1eb[_0xc602('0x36')][_0xc602('0x66')][_0xc602('0x42')];_0x15435a+=0x1){socket['emit'](_0xc602('0x64'),{'UserId':Number(_0x27a1eb[_0xc602('0x36')]['ids'][_0x15435a]),'MailQueueId':Number(_0x27a1eb[_0xc602('0x28')]['id'])});}return _0x40cd3f;});}})[_0xc602('0x18')](respondWithResult(_0x4b49f8,null))[_0xc602('0x27')](handleError(_0x4b49f8,null));};exports[_0xc602('0x7a')]=function(_0x4db377,_0x56accd){return db['MailQueue'][_0xc602('0x34')]({'where':{'id':_0x4db377['params']['id']}})[_0xc602('0x18')](handleEntityNotFound(_0x56accd,null))[_0xc602('0x18')](function(_0x14e63c){if(_0x14e63c){return _0x14e63c[_0xc602('0x7a')](_0x4db377[_0xc602('0x2c')][_0xc602('0x66')])[_0xc602('0x18')](function(){if(_[_0xc602('0x7e')](_0x4db377['query'][_0xc602('0x66')])){for(var _0x2287c0=0x0;_0x2287c0<_0x4db377['query'][_0xc602('0x66')]['length'];_0x2287c0+=0x1){socket[_0xc602('0x63')](_0xc602('0x7b'),{'UserId':Number(_0x4db377[_0xc602('0x2c')][_0xc602('0x66')][_0x2287c0]),'MailQueueId':Number(_0x4db377['params']['id'])});}}else{socket[_0xc602('0x63')]('userMailQueue:remove',{'UserId':Number(_0x4db377[_0xc602('0x2c')][_0xc602('0x66')]),'MailQueueId':Number(_0x4db377[_0xc602('0x28')]['id'])});}});}})['then'](respondWithStatusCode(_0x56accd,null))[_0xc602('0x27')](handleError(_0x56accd,null));};exports[_0xc602('0x7f')]=function(_0x1197df,_0x3617b6){var _0x4f888e={};var _0x28fd1e={};var _0x30fa10;var _0x245f72;return db[_0xc602('0x21')]['findOne']({'where':{'id':_0x1197df[_0xc602('0x28')]['id']}})[_0xc602('0x18')](handleEntityNotFound(_0x3617b6,null))[_0xc602('0x18')](function(_0x366adf){if(_0x366adf){_0x30fa10=_0x366adf;_0x28fd1e[_0xc602('0x29')]=_[_0xc602('0x2a')](db[_0xc602('0x4b')]['rawAttributes']);_0x28fd1e[_0xc602('0x2c')]=_[_0xc602('0x2a')](_0x1197df[_0xc602('0x2c')]);_0x28fd1e[_0xc602('0x2d')]=_[_0xc602('0x2e')](_0x28fd1e[_0xc602('0x29')],_0x28fd1e['query']);_0x4f888e[_0xc602('0x2f')]=_[_0xc602('0x2e')](_0x28fd1e[_0xc602('0x29')],qs[_0xc602('0x30')](_0x1197df[_0xc602('0x2c')]['fields']));_0x4f888e[_0xc602('0x2f')]=_0x4f888e[_0xc602('0x2f')][_0xc602('0x42')]?_0x4f888e['attributes']:_0x28fd1e[_0xc602('0x29')];_0x4f888e[_0xc602('0x45')]=qs[_0xc602('0x46')](_0x1197df[_0xc602('0x2c')][_0xc602('0x46')]);_0x4f888e[_0xc602('0x24')]=qs['filters'](_['pick'](_0x1197df['query'],_0x28fd1e[_0xc602('0x2d')]));if(_0x1197df[_0xc602('0x2c')][_0xc602('0x49')]){_0x4f888e['where']=_[_0xc602('0x32')](_0x4f888e[_0xc602('0x24')],{'$or':_[_0xc602('0x4d')](_0x4f888e['attributes'],function(_0x56e70b){var _0x11928c={};_0x11928c[_0x56e70b]={'$like':'%'+_0x1197df[_0xc602('0x2c')][_0xc602('0x49')]+'%'};return _0x11928c;})});}_0x4f888e=_[_0xc602('0x32')]({},_0x4f888e,_0x1197df['options']);return _0x30fa10[_0xc602('0x7f')](_0x4f888e);}})[_0xc602('0x18')](function(_0x15b1b2){if(_0x15b1b2){_0x245f72=_0x15b1b2[_0xc602('0x42')];if(!_0x1197df[_0xc602('0x2c')][_0xc602('0x43')](_0xc602('0x44'))){_0x4f888e[_0xc602('0x14')]=qs[_0xc602('0x14')](_0x1197df['query'][_0xc602('0x14')]);_0x4f888e[_0xc602('0x12')]=qs[_0xc602('0x12')](_0x1197df[_0xc602('0x2c')]['offset']);}return _0x30fa10['getAgents'](_0x4f888e);}})['then'](function(_0x1c1b44){if(_0x1c1b44){return _0x1c1b44?{'count':_0x245f72,'rows':_0x1c1b44}:null;}})[_0xc602('0x18')](respondWithResult(_0x3617b6,null))[_0xc602('0x27')](handleError(_0x3617b6,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 2f984a4..ece5fca 100644 --- a/server/api/mailQueue/mailQueue.events.js +++ b/server/api/mailQueue/mailQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x73cf=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','update','remove'];(function(_0x25f950,_0x29dd1a){var _0x30379c=function(_0x368e0a){while(--_0x368e0a){_0x25f950['push'](_0x25f950['shift']());}};_0x30379c(++_0x29dd1a);}(_0x73cf,0x100));var _0xf73c=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x73cf[_0x3c4737];return _0x2bb926;};'use strict';var EventEmitter=require(_0xf73c('0x0'));var MailQueue=require('../../mysqldb')['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xf73c('0x1')](0x0);var events={'afterCreate':_0xf73c('0x2'),'afterUpdate':_0xf73c('0x3'),'afterDestroy':_0xf73c('0x4')};function emitEvent(_0x37e722){return function(_0x171921,_0x390191,_0x5865ba){MailQueueEvents['emit'](_0x37e722+':'+_0x171921['id'],_0x171921);MailQueueEvents[_0xf73c('0x5')](_0x37e722,_0x171921);_0x5865ba(null);};}for(var e in events){if(events[_0xf73c('0x6')](e)){var event=events[e];MailQueue[_0xf73c('0x7')](e,emitEvent(event));}}module[_0xf73c('0x8')]=MailQueueEvents; \ No newline at end of file +var _0x87a4=['hook','exports','events','../../mysqldb','MailQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x5115e0,_0x253705){var _0x51607d=function(_0x28a0ba){while(--_0x28a0ba){_0x5115e0['push'](_0x5115e0['shift']());}};_0x51607d(++_0x253705);}(_0x87a4,0x120));var _0x487a=function(_0x9557d3,_0x8a27cd){_0x9557d3=_0x9557d3-0x0;var _0x2b6f64=_0x87a4[_0x9557d3];return _0x2b6f64;};'use strict';var EventEmitter=require(_0x487a('0x0'));var MailQueue=require(_0x487a('0x1'))['db'][_0x487a('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x487a('0x3')](0x0);var events={'afterCreate':_0x487a('0x4'),'afterUpdate':_0x487a('0x5'),'afterDestroy':_0x487a('0x6')};function emitEvent(_0x5eae6d){return function(_0x3b3803,_0x2a63ac,_0x1eba6b){MailQueueEvents['emit'](_0x5eae6d+':'+_0x3b3803['id'],_0x3b3803);MailQueueEvents[_0x487a('0x7')](_0x5eae6d,_0x3b3803);_0x1eba6b(null);};}for(var e in events){if(events[_0x487a('0x8')](e)){var event=events[e];MailQueue[_0x487a('0x9')](e,emitEvent(event));}}module[_0x487a('0xa')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index cf2654b..cdf5789 100644 --- a/server/api/mailQueue/mailQueue.model.js +++ b/server/api/mailQueue/mailQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x52d8=['request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','exports','define','MailQueue','lodash','util','api'];(function(_0x55bc08,_0x2b980a){var _0x238ddf=function(_0xf0354c){while(--_0xf0354c){_0x55bc08['push'](_0x55bc08['shift']());}};_0x238ddf(++_0x2b980a);}(_0x52d8,0x1cb));var _0x852d=function(_0x51674a,_0x77ccff){_0x51674a=_0x51674a-0x0;var _0x13fca6=_0x52d8[_0x51674a];return _0x13fca6;};'use strict';var _=require(_0x852d('0x0'));var util=require(_0x852d('0x1'));var logger=require('../../config/logger')(_0x852d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x852d('0x3'));var fs=require('fs');var path=require(_0x852d('0x4'));var rimraf=require(_0x852d('0x5'));var config=require(_0x852d('0x6'));var attributes=require(_0x852d('0x7'));module[_0x852d('0x8')]=function(_0x59d71d,_0x1bc896){return _0x59d71d[_0x852d('0x9')](_0x852d('0xa'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe201=['util','../../config/logger','api','moment','bluebird','request-promise','./mailQueue.attributes','exports','MailQueue','mail_queues','lodash'];(function(_0x7d0183,_0x1b002e){var _0x2b8dbf=function(_0x5ca113){while(--_0x5ca113){_0x7d0183['push'](_0x7d0183['shift']());}};_0x2b8dbf(++_0x1b002e);}(_0xe201,0x6d));var _0x1e20=function(_0x217922,_0x4b9b65){_0x217922=_0x217922-0x0;var _0x5464c6=_0xe201[_0x217922];return _0x5464c6;};'use strict';var _=require(_0x1e20('0x0'));var util=require(_0x1e20('0x1'));var logger=require(_0x1e20('0x2'))(_0x1e20('0x3'));var moment=require(_0x1e20('0x4'));var BPromise=require(_0x1e20('0x5'));var rp=require(_0x1e20('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1e20('0x7'));module[_0x1e20('0x8')]=function(_0x2644a5,_0x4a3e94){return _0x2644a5['define'](_0x1e20('0x9'),attributes,{'tableName':_0x1e20('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index b2e5aa3..0ba5a18 100644 --- a/server/api/mailQueue/mailQueue.rpc.js +++ b/server/api/mailQueue/mailQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x24eb=['include','map','model','info','ShowMailQueue','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./mailQueue.socket','register','then','request\x20sent','debug','stringify','error','code','message','MailQueue,\x20%s,\x20%s','result','catch','GetMailQueue','MailQueue','findAll','raw','options','where','attributes','limit'];(function(_0x24878b,_0x3eff54){var _0x11abf1=function(_0x572270){while(--_0x572270){_0x24878b['push'](_0x24878b['shift']());}};_0x11abf1(++_0x3eff54);}(_0x24eb,0x145));var _0xb24e=function(_0x57408b,_0xb7cbc5){_0x57408b=_0x57408b-0x0;var _0x31a897=_0x24eb[_0x57408b];return _0x31a897;};'use strict';var _=require(_0xb24e('0x0'));var util=require(_0xb24e('0x1'));var moment=require(_0xb24e('0x2'));var BPromise=require(_0xb24e('0x3'));var rs=require(_0xb24e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb24e('0x5'))['db'];var utils=require(_0xb24e('0x6'));var logger=require(_0xb24e('0x7'))('rpc');var config=require(_0xb24e('0x8'));var jayson=require(_0xb24e('0x9'));var client=jayson[_0xb24e('0xa')][_0xb24e('0xb')]({'port':0x232a});config['redis']=_[_0xb24e('0xc')](config[_0xb24e('0xd')],{'host':_0xb24e('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb24e('0xd')]));require(_0xb24e('0xf'))[_0xb24e('0x10')](socket);function respondWithRpcPromise(_0x4c6546,_0x42c8a6,_0xaca764){return new BPromise(function(_0x24aa01,_0x3ac14b){return client['request'](_0x4c6546,_0xaca764)[_0xb24e('0x11')](function(_0x15ff55){logger['info']('MailQueue,\x20%s,\x20%s',_0x42c8a6,_0xb24e('0x12'));logger[_0xb24e('0x13')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x42c8a6,'request\x20sent',JSON[_0xb24e('0x14')](_0x15ff55));if(_0x15ff55['error']){if(_0x15ff55[_0xb24e('0x15')][_0xb24e('0x16')]===0x1f4){logger[_0xb24e('0x15')]('MailQueue,\x20%s,\x20%s',_0x42c8a6,_0x15ff55[_0xb24e('0x15')][_0xb24e('0x17')]);return _0x3ac14b(_0x15ff55[_0xb24e('0x15')]['message']);}logger['error'](_0xb24e('0x18'),_0x42c8a6,_0x15ff55[_0xb24e('0x15')][_0xb24e('0x17')]);return _0x24aa01(_0x15ff55[_0xb24e('0x15')][_0xb24e('0x17')]);}else{logger['info']('MailQueue,\x20%s,\x20%s',_0x42c8a6,_0xb24e('0x12'));_0x24aa01(_0x15ff55[_0xb24e('0x19')][_0xb24e('0x17')]);}})[_0xb24e('0x1a')](function(_0x5774ae){logger[_0xb24e('0x15')](_0xb24e('0x18'),_0x42c8a6,_0x5774ae);_0x3ac14b(_0x5774ae);});});}exports[_0xb24e('0x1b')]=function(_0x2d6946){var _0x584e33=this;return new Promise(function(_0x1430ff,_0xbca9ab){return db[_0xb24e('0x1c')][_0xb24e('0x1d')]({'raw':_0x2d6946['options']?_0x2d6946['options'][_0xb24e('0x1e')]===undefined?!![]:![]:!![],'where':_0x2d6946[_0xb24e('0x1f')]?_0x2d6946[_0xb24e('0x1f')][_0xb24e('0x20')]||null:null,'attributes':_0x2d6946[_0xb24e('0x1f')]?_0x2d6946[_0xb24e('0x1f')][_0xb24e('0x21')]||null:null,'limit':_0x2d6946['options']?_0x2d6946[_0xb24e('0x1f')][_0xb24e('0x22')]||null:null,'include':_0x2d6946[_0xb24e('0x1f')]?_0x2d6946[_0xb24e('0x1f')][_0xb24e('0x23')]?_[_0xb24e('0x24')](_0x2d6946[_0xb24e('0x1f')][_0xb24e('0x23')],function(_0x21d889){return{'model':db[_0x21d889[_0xb24e('0x25')]],'as':_0x21d889['as'],'attributes':_0x21d889[_0xb24e('0x21')],'include':_0x21d889['include']?_[_0xb24e('0x24')](_0x21d889['include'],function(_0x56eb21){return{'model':db[_0x56eb21['model']],'as':_0x56eb21['as'],'attributes':_0x56eb21[_0xb24e('0x21')],'include':_0x56eb21[_0xb24e('0x23')]?_[_0xb24e('0x24')](_0x56eb21['include'],function(_0x34d897){return{'model':db[_0x34d897[_0xb24e('0x25')]],'as':_0x34d897['as'],'attributes':_0x34d897[_0xb24e('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2053d2){logger[_0xb24e('0x26')](_0xb24e('0x1b'),_0x2d6946);logger[_0xb24e('0x13')](_0xb24e('0x1b'),_0x2d6946,JSON[_0xb24e('0x14')](_0x2053d2));_0x1430ff(_0x2053d2);})[_0xb24e('0x1a')](function(_0x1fd0cf){logger[_0xb24e('0x15')](_0xb24e('0x1b'),_0x1fd0cf[_0xb24e('0x17')],_0x2d6946);_0xbca9ab(_0x584e33[_0xb24e('0x15')](0x1f4,_0x1fd0cf['message']));});});};exports[_0xb24e('0x27')]=function(_0x44f495){var _0x3c5415=this;return new Promise(function(_0x505e18,_0x2a4595){return db[_0xb24e('0x1c')]['find']({'raw':_0x44f495[_0xb24e('0x1f')]?_0x44f495[_0xb24e('0x1f')][_0xb24e('0x1e')]===undefined?!![]:![]:!![],'where':_0x44f495[_0xb24e('0x1f')]?_0x44f495[_0xb24e('0x1f')]['where']||null:null,'attributes':_0x44f495[_0xb24e('0x1f')]?_0x44f495['options'][_0xb24e('0x21')]||null:null,'include':_0x44f495['options']?_0x44f495['options']['include']?_['map'](_0x44f495[_0xb24e('0x1f')][_0xb24e('0x23')],function(_0x509660){return{'model':db[_0x509660[_0xb24e('0x25')]],'as':_0x509660['as'],'attributes':_0x509660[_0xb24e('0x21')],'include':_0x509660[_0xb24e('0x23')]?_[_0xb24e('0x24')](_0x509660[_0xb24e('0x23')],function(_0x189657){return{'model':db[_0x189657[_0xb24e('0x25')]],'as':_0x189657['as'],'attributes':_0x189657[_0xb24e('0x21')],'include':_0x189657[_0xb24e('0x23')]?_[_0xb24e('0x24')](_0x189657[_0xb24e('0x23')],function(_0x80efd6){return{'model':db[_0x80efd6[_0xb24e('0x25')]],'as':_0x80efd6['as'],'attributes':_0x80efd6['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xda6002){logger[_0xb24e('0x26')](_0xb24e('0x27'),_0x44f495);logger[_0xb24e('0x13')]('ShowMailQueue',_0x44f495,JSON[_0xb24e('0x14')](_0xda6002));_0x505e18(_0xda6002);})[_0xb24e('0x1a')](function(_0x595851){logger[_0xb24e('0x15')]('ShowMailQueue',_0x595851[_0xb24e('0x17')],_0x44f495);_0x2a4595(_0x3c5415[_0xb24e('0x15')](0x1f4,_0x595851[_0xb24e('0x17')]));});});}; \ No newline at end of file +var _0x7510=['model','GetMailQueue','ShowMailQueue','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','register','request','then','info','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','MailQueue,\x20%s,\x20%s','message','result','catch','options','raw','where','attributes','limit','include','map'];(function(_0x506e4a,_0x52bbcd){var _0x2b7192=function(_0x1db15c){while(--_0x1db15c){_0x506e4a['push'](_0x506e4a['shift']());}};_0x2b7192(++_0x52bbcd);}(_0x7510,0x18a));var _0x0751=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7510[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x0751('0x0'));var moment=require(_0x0751('0x1'));var BPromise=require(_0x0751('0x2'));var rs=require(_0x0751('0x3'));var fs=require('fs');var Redis=require(_0x0751('0x4'));var db=require(_0x0751('0x5'))['db'];var utils=require(_0x0751('0x6'));var logger=require('../../config/logger')(_0x0751('0x7'));var config=require(_0x0751('0x8'));var jayson=require(_0x0751('0x9'));var client=jayson['client'][_0x0751('0xa')]({'port':0x232a});config[_0x0751('0xb')]=_[_0x0751('0xc')](config['redis'],{'host':_0x0751('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0751('0xb')]));require('./mailQueue.socket')[_0x0751('0xe')](socket);function respondWithRpcPromise(_0x1d49d7,_0xfcc47a,_0x5e3954){return new BPromise(function(_0x3b876d,_0xafb231){return client[_0x0751('0xf')](_0x1d49d7,_0x5e3954)[_0x0751('0x10')](function(_0x36a350){logger[_0x0751('0x11')]('MailQueue,\x20%s,\x20%s',_0xfcc47a,_0x0751('0x12'));logger[_0x0751('0x13')](_0x0751('0x14'),_0xfcc47a,_0x0751('0x12'),JSON[_0x0751('0x15')](_0x36a350));if(_0x36a350[_0x0751('0x16')]){if(_0x36a350[_0x0751('0x16')][_0x0751('0x17')]===0x1f4){logger[_0x0751('0x16')](_0x0751('0x18'),_0xfcc47a,_0x36a350[_0x0751('0x16')]['message']);return _0xafb231(_0x36a350[_0x0751('0x16')]['message']);}logger[_0x0751('0x16')](_0x0751('0x18'),_0xfcc47a,_0x36a350[_0x0751('0x16')]['message']);return _0x3b876d(_0x36a350[_0x0751('0x16')][_0x0751('0x19')]);}else{logger[_0x0751('0x11')](_0x0751('0x18'),_0xfcc47a,_0x0751('0x12'));_0x3b876d(_0x36a350[_0x0751('0x1a')]['message']);}})[_0x0751('0x1b')](function(_0x174345){logger[_0x0751('0x16')](_0x0751('0x18'),_0xfcc47a,_0x174345);_0xafb231(_0x174345);});});}exports['GetMailQueue']=function(_0x3bb94a){var _0x365dd8=this;return new Promise(function(_0x15bd65,_0x18c359){return db['MailQueue']['findAll']({'raw':_0x3bb94a[_0x0751('0x1c')]?_0x3bb94a[_0x0751('0x1c')][_0x0751('0x1d')]===undefined?!![]:![]:!![],'where':_0x3bb94a[_0x0751('0x1c')]?_0x3bb94a['options'][_0x0751('0x1e')]||null:null,'attributes':_0x3bb94a[_0x0751('0x1c')]?_0x3bb94a[_0x0751('0x1c')][_0x0751('0x1f')]||null:null,'limit':_0x3bb94a['options']?_0x3bb94a['options'][_0x0751('0x20')]||null:null,'include':_0x3bb94a[_0x0751('0x1c')]?_0x3bb94a['options'][_0x0751('0x21')]?_[_0x0751('0x22')](_0x3bb94a[_0x0751('0x1c')][_0x0751('0x21')],function(_0x2182de){return{'model':db[_0x2182de[_0x0751('0x23')]],'as':_0x2182de['as'],'attributes':_0x2182de[_0x0751('0x1f')],'include':_0x2182de[_0x0751('0x21')]?_['map'](_0x2182de[_0x0751('0x21')],function(_0x79c891){return{'model':db[_0x79c891[_0x0751('0x23')]],'as':_0x79c891['as'],'attributes':_0x79c891[_0x0751('0x1f')],'include':_0x79c891[_0x0751('0x21')]?_['map'](_0x79c891[_0x0751('0x21')],function(_0x2a1046){return{'model':db[_0x2a1046['model']],'as':_0x2a1046['as'],'attributes':_0x2a1046[_0x0751('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x0751('0x10')](function(_0x40fd57){logger[_0x0751('0x11')](_0x0751('0x24'),_0x3bb94a);logger[_0x0751('0x13')](_0x0751('0x24'),_0x3bb94a,JSON[_0x0751('0x15')](_0x40fd57));_0x15bd65(_0x40fd57);})[_0x0751('0x1b')](function(_0x1aefea){logger[_0x0751('0x16')](_0x0751('0x24'),_0x1aefea['message'],_0x3bb94a);_0x18c359(_0x365dd8[_0x0751('0x16')](0x1f4,_0x1aefea[_0x0751('0x19')]));});});};exports[_0x0751('0x25')]=function(_0x294fd8){var _0x328740=this;return new Promise(function(_0x201898,_0x42396d){return db['MailQueue'][_0x0751('0x26')]({'raw':_0x294fd8['options']?_0x294fd8['options'][_0x0751('0x1d')]===undefined?!![]:![]:!![],'where':_0x294fd8[_0x0751('0x1c')]?_0x294fd8[_0x0751('0x1c')][_0x0751('0x1e')]||null:null,'attributes':_0x294fd8[_0x0751('0x1c')]?_0x294fd8[_0x0751('0x1c')][_0x0751('0x1f')]||null:null,'include':_0x294fd8[_0x0751('0x1c')]?_0x294fd8['options'][_0x0751('0x21')]?_[_0x0751('0x22')](_0x294fd8[_0x0751('0x1c')]['include'],function(_0x5593d0){return{'model':db[_0x5593d0['model']],'as':_0x5593d0['as'],'attributes':_0x5593d0[_0x0751('0x1f')],'include':_0x5593d0[_0x0751('0x21')]?_[_0x0751('0x22')](_0x5593d0['include'],function(_0x549f10){return{'model':db[_0x549f10['model']],'as':_0x549f10['as'],'attributes':_0x549f10['attributes'],'include':_0x549f10[_0x0751('0x21')]?_[_0x0751('0x22')](_0x549f10[_0x0751('0x21')],function(_0x49042f){return{'model':db[_0x49042f[_0x0751('0x23')]],'as':_0x49042f['as'],'attributes':_0x49042f[_0x0751('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x0751('0x10')](function(_0x5eaabb){logger[_0x0751('0x11')](_0x0751('0x25'),_0x294fd8);logger[_0x0751('0x13')](_0x0751('0x25'),_0x294fd8,JSON[_0x0751('0x15')](_0x5eaabb));_0x201898(_0x5eaabb);})[_0x0751('0x1b')](function(_0x53bb04){logger[_0x0751('0x16')]('ShowMailQueue',_0x53bb04['message'],_0x294fd8);_0x42396d(_0x328740[_0x0751('0x16')](0x1f4,_0x53bb04[_0x0751('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 71b6c38..282b0ac 100644 --- a/server/api/mailQueue/mailQueue.socket.js +++ b/server/api/mailQueue/mailQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xada7=['emit','length','./mailQueue.events','save','remove','update'];(function(_0x2c5107,_0x48498e){var _0x272176=function(_0x2083a2){while(--_0x2083a2){_0x2c5107['push'](_0x2c5107['shift']());}};_0x272176(++_0x48498e);}(_0xada7,0x1ee));var _0x7ada=function(_0x4d84a8,_0x5764ae){_0x4d84a8=_0x4d84a8-0x0;var _0x30f2d5=_0xada7[_0x4d84a8];return _0x30f2d5;};'use strict';var MailQueueEvents=require(_0x7ada('0x0'));var events=[_0x7ada('0x1'),_0x7ada('0x2'),_0x7ada('0x3')];function createListener(_0x5e051d,_0xbca0e5){return function(_0x3d5d93){_0xbca0e5[_0x7ada('0x4')](_0x5e051d,_0x3d5d93);};}function removeListener(_0xa82ca4,_0x402a8e){return function(){MailQueueEvents['removeListener'](_0xa82ca4,_0x402a8e);};}exports['register']=function(_0xdd89f4){for(var _0x55584a=0x0,_0x30229c=events[_0x7ada('0x5')];_0x55584a<_0x30229c;_0x55584a++){var _0x3e8982=events[_0x55584a];var _0x198bb4=createListener('mailQueue:'+_0x3e8982,_0xdd89f4);MailQueueEvents['on'](_0x3e8982,_0x198bb4);}}; \ No newline at end of file +var _0x4d40=['mailQueue:','./mailQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x3e6526,_0x5b8db9){var _0x17be56=function(_0x28353a){while(--_0x28353a){_0x3e6526['push'](_0x3e6526['shift']());}};_0x17be56(++_0x5b8db9);}(_0x4d40,0xb1));var _0x04d4=function(_0x269ee8,_0x477226){_0x269ee8=_0x269ee8-0x0;var _0x4d98bd=_0x4d40[_0x269ee8];return _0x4d98bd;};'use strict';var MailQueueEvents=require(_0x04d4('0x0'));var events=[_0x04d4('0x1'),_0x04d4('0x2'),_0x04d4('0x3')];function createListener(_0x31c15a,_0x1fd094){return function(_0x4034c2){_0x1fd094[_0x04d4('0x4')](_0x31c15a,_0x4034c2);};}function removeListener(_0x5f2c09,_0x1f115a){return function(){MailQueueEvents[_0x04d4('0x5')](_0x5f2c09,_0x1f115a);};}exports[_0x04d4('0x6')]=function(_0x4445f7){for(var _0xdb3e98=0x0,_0x3b9131=events['length'];_0xdb3e98<_0x3b9131;_0xdb3e98++){var _0x936d5c=events[_0xdb3e98];var _0xaeba22=createListener(_0x04d4('0x7')+_0x936d5c,_0x4445f7);MailQueueEvents['on'](_0x936d5c,_0xaeba22);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 3e7d0f3..845af35 100644 --- a/server/api/mailQueueReport/index.js +++ b/server/api/mailQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x906e=['show','post','create','put','/:id','update','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x36021c,_0x5eeb8e){var _0x1c6ab4=function(_0x427f63){while(--_0x427f63){_0x36021c['push'](_0x36021c['shift']());}};_0x1c6ab4(++_0x5eeb8e);}(_0x906e,0x125));var _0xe906=function(_0x43b584,_0x20a6bd){_0x43b584=_0x43b584-0x0;var _0x48f27b=_0x906e[_0x43b584];return _0x48f27b;};'use strict';var multer=require(_0xe906('0x0'));var util=require(_0xe906('0x1'));var path=require(_0xe906('0x2'));var timeout=require(_0xe906('0x3'));var express=require(_0xe906('0x4'));var router=express['Router']();var fs_extra=require(_0xe906('0x5'));var auth=require(_0xe906('0x6'));var interaction=require(_0xe906('0x7'));var config=require(_0xe906('0x8'));var controller=require(_0xe906('0x9'));router[_0xe906('0xa')]('/',auth[_0xe906('0xb')](),controller[_0xe906('0xc')]);router[_0xe906('0xa')](_0xe906('0xd'),auth['isAuthenticated'](),controller[_0xe906('0xe')]);router[_0xe906('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xe906('0xf')]);router[_0xe906('0x10')]('/',auth[_0xe906('0xb')](),controller[_0xe906('0x11')]);router[_0xe906('0x12')](_0xe906('0x13'),auth[_0xe906('0xb')](),controller[_0xe906('0x14')]);router['delete'](_0xe906('0x13'),auth[_0xe906('0xb')](),controller['destroy']);module[_0xe906('0x15')]=router; \ No newline at end of file +var _0xe995=['/:id','show','put','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe'];(function(_0x47e549,_0x2e53d6){var _0x251374=function(_0x400458){while(--_0x400458){_0x47e549['push'](_0x47e549['shift']());}};_0x251374(++_0x2e53d6);}(_0xe995,0x1b6));var _0x5e99=function(_0x1f7267,_0x200b52){_0x1f7267=_0x1f7267-0x0;var _0x207048=_0xe995[_0x1f7267];return _0x207048;};'use strict';var multer=require(_0x5e99('0x0'));var util=require(_0x5e99('0x1'));var path=require(_0x5e99('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5e99('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5e99('0x4'));var interaction=require(_0x5e99('0x5'));var config=require(_0x5e99('0x6'));var controller=require('./mailQueueReport.controller');router[_0x5e99('0x7')]('/',auth[_0x5e99('0x8')](),controller[_0x5e99('0x9')]);router[_0x5e99('0x7')](_0x5e99('0xa'),auth[_0x5e99('0x8')](),controller[_0x5e99('0xb')]);router[_0x5e99('0x7')](_0x5e99('0xc'),auth[_0x5e99('0x8')](),controller[_0x5e99('0xd')]);router['post']('/',auth[_0x5e99('0x8')](),controller['create']);router[_0x5e99('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x5e99('0xf')](_0x5e99('0xc'),auth[_0x5e99('0x8')](),controller[_0x5e99('0x10')]);module[_0x5e99('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 10d8acd..6eaa44b 100644 --- a/server/api/mailQueueReport/mailQueueReport.attributes.js +++ b/server/api/mailQueueReport/mailQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1b12=['STRING','DATE','moment','exports'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0x1b12,0x1b6));var _0x21b1=function(_0x457e2a,_0x5bf680){_0x457e2a=_0x457e2a-0x0;var _0xe1ef03=_0x1b12[_0x457e2a];return _0xe1ef03;};'use strict';var moment=require(_0x21b1('0x0'));var Sequelize=require('sequelize');module[_0x21b1('0x1')]={'uniqueid':{'type':Sequelize[_0x21b1('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x21b1('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x21b1('0x3')]},'acceptAt':{'type':Sequelize[_0x21b1('0x3')]},'exitAt':{'type':Sequelize[_0x21b1('0x3')]},'reason':{'type':Sequelize[_0x21b1('0x2')]}}; \ No newline at end of file +var _0xadae=['moment','sequelize','exports','STRING'];(function(_0x13635d,_0x14d83e){var _0x3505b9=function(_0x514839){while(--_0x514839){_0x13635d['push'](_0x13635d['shift']());}};_0x3505b9(++_0x14d83e);}(_0xadae,0x134));var _0xeada=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0xadae[_0x4d8ed9];return _0x1e2140;};'use strict';var moment=require(_0xeada('0x0'));var Sequelize=require(_0xeada('0x1'));module[_0xeada('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xeada('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 1b0cc38..22b2ffa 100644 --- a/server/api/mailQueueReport/mailQueueReport.controller.js +++ b/server/api/mailQueueReport/mailQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4137=['key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','show','params','includeAll','options','find','catch','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','json','offset','limit','count','set','apply','reject','save','update','destroy','then','end','sendStatus','error','name','send','index','map','MailQueueReport','rawAttributes','type'];(function(_0x4884a7,_0x18e38a){var _0x56b60e=function(_0x2ba8a3){while(--_0x2ba8a3){_0x4884a7['push'](_0x4884a7['shift']());}};_0x56b60e(++_0x18e38a);}(_0x4137,0xf8));var _0x7413=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x4137[_0x46e363];return _0x3fb059;};'use strict';var emlformat=require(_0x7413('0x0'));var rimraf=require(_0x7413('0x1'));var zipdir=require(_0x7413('0x2'));var jsonpatch=require(_0x7413('0x3'));var rp=require(_0x7413('0x4'));var moment=require(_0x7413('0x5'));var BPromise=require(_0x7413('0x6'));var Mustache=require(_0x7413('0x7'));var util=require(_0x7413('0x8'));var path=require(_0x7413('0x9'));var sox=require(_0x7413('0xa'));var csv=require(_0x7413('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7413('0xc'));var _=require(_0x7413('0xd'));var squel=require(_0x7413('0xe'));var crypto=require(_0x7413('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x7413('0x10'));var toCsv=require(_0x7413('0xb'));var querystring=require('querystring');var Papa=require(_0x7413('0x11'));var Redis=require(_0x7413('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7413('0x13'));var as=require(_0x7413('0x14'));var hardwareService=require(_0x7413('0x15'));var logger=require(_0x7413('0x16'))(_0x7413('0x17'));var utils=require('../../config/utils');var config=require(_0x7413('0x18'));var licenseUtil=require(_0x7413('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18a874,_0xa26ca4){_0xa26ca4=_0xa26ca4||0xcc;return function(_0x13e6bd){if(_0x13e6bd){return _0x18a874['sendStatus'](_0xa26ca4);}return _0x18a874['status'](_0xa26ca4)['end']();};}function respondWithResult(_0x2267f6,_0x336c4c){_0x336c4c=_0x336c4c||0xc8;return function(_0x49f0f6){if(_0x49f0f6){return _0x2267f6[_0x7413('0x1a')](_0x336c4c)[_0x7413('0x1b')](_0x49f0f6);}};}function respondWithFilteredResult(_0x4955d3,_0x38b3d1){return function(_0x50f301){if(_0x50f301){var _0x4b9a5b=typeof _0x38b3d1[_0x7413('0x1c')]==='undefined'&&typeof _0x38b3d1[_0x7413('0x1d')]==='undefined';var _0x2036b6=_0x50f301[_0x7413('0x1e')];var _0x19157f=_0x4b9a5b?0x0:_0x38b3d1[_0x7413('0x1c')];var _0x2a3417=_0x4b9a5b?_0x50f301[_0x7413('0x1e')]:_0x38b3d1['offset']+_0x38b3d1[_0x7413('0x1d')];var _0x17c062;if(_0x2a3417>=_0x2036b6){_0x2a3417=_0x2036b6;_0x17c062=0xc8;}else{_0x17c062=0xce;}_0x4955d3[_0x7413('0x1a')](_0x17c062);return _0x4955d3[_0x7413('0x1f')]('Content-Range',_0x19157f+'-'+_0x2a3417+'/'+_0x2036b6)[_0x7413('0x1b')](_0x50f301);}return null;};}function patchUpdates(_0x12d94d){return function(_0x206afc){try{jsonpatch[_0x7413('0x20')](_0x206afc,_0x12d94d,!![]);}catch(_0x409392){return BPromise[_0x7413('0x21')](_0x409392);}return _0x206afc[_0x7413('0x22')]();};}function saveUpdates(_0x4e18cb,_0x56a06a){return function(_0x5f12a2){if(_0x5f12a2){return _0x5f12a2[_0x7413('0x23')](_0x4e18cb)['then'](function(_0x1585ba){return _0x1585ba;});}return null;};}function removeEntity(_0x372944,_0x3b0c81){return function(_0x2fc0f4){if(_0x2fc0f4){return _0x2fc0f4[_0x7413('0x24')]()[_0x7413('0x25')](function(){_0x372944[_0x7413('0x1a')](0xcc)[_0x7413('0x26')]();});}};}function handleEntityNotFound(_0x1d455b,_0x5a8329){return function(_0x5cb15f){if(!_0x5cb15f){_0x1d455b[_0x7413('0x27')](0x194);}return _0x5cb15f;};}function handleError(_0x48c2dc,_0x46c895){_0x46c895=_0x46c895||0x1f4;return function(_0x71cbb4){logger[_0x7413('0x28')](_0x71cbb4['stack']);if(_0x71cbb4[_0x7413('0x29')]){delete _0x71cbb4[_0x7413('0x29')];}_0x48c2dc[_0x7413('0x1a')](_0x46c895)[_0x7413('0x2a')](_0x71cbb4);};}exports[_0x7413('0x2b')]=function(_0x2e521f,_0x5eb4d9){var _0x24dce7={},_0x4ed662={},_0x1d0bde={'count':0x0,'rows':[]};var _0x23e682=_[_0x7413('0x2c')](db[_0x7413('0x2d')][_0x7413('0x2e')],function(_0x2004ea){return{'name':_0x2004ea['fieldName'],'type':_0x2004ea[_0x7413('0x2f')][_0x7413('0x30')]};});_0x4ed662[_0x7413('0x31')]=_[_0x7413('0x2c')](_0x23e682,_0x7413('0x29'));_0x4ed662[_0x7413('0x32')]=_[_0x7413('0x33')](_0x2e521f['query']);_0x4ed662[_0x7413('0x34')]=_[_0x7413('0x35')](_0x4ed662[_0x7413('0x31')],_0x4ed662[_0x7413('0x32')]);_0x24dce7[_0x7413('0x36')]=_['intersection'](_0x4ed662[_0x7413('0x31')],qs['fields'](_0x2e521f[_0x7413('0x32')][_0x7413('0x37')]));_0x24dce7[_0x7413('0x36')]=_0x24dce7['attributes'][_0x7413('0x38')]?_0x24dce7['attributes']:_0x4ed662[_0x7413('0x31')];if(!_0x2e521f[_0x7413('0x32')]['hasOwnProperty']('nolimit')){_0x24dce7[_0x7413('0x1d')]=qs[_0x7413('0x1d')](_0x2e521f[_0x7413('0x32')]['limit']);_0x24dce7['offset']=qs[_0x7413('0x1c')](_0x2e521f['query']['offset']);}_0x24dce7[_0x7413('0x39')]=qs['sort'](_0x2e521f[_0x7413('0x32')][_0x7413('0x3a')]);_0x24dce7[_0x7413('0x3b')]=qs[_0x7413('0x34')](_[_0x7413('0x3c')](_0x2e521f['query'],_0x4ed662[_0x7413('0x34')]),_0x23e682);if(_0x2e521f[_0x7413('0x32')][_0x7413('0x3d')]){_0x24dce7[_0x7413('0x3b')]=_[_0x7413('0x3e')](_0x24dce7[_0x7413('0x3b')],{'$or':_[_0x7413('0x2c')](_0x23e682,function(_0x385156){if(_0x385156[_0x7413('0x2f')]!==_0x7413('0x3f')){var _0x5c03eb={};_0x5c03eb[_0x385156[_0x7413('0x29')]]={'$like':'%'+_0x2e521f['query'][_0x7413('0x3d')]+'%'};return _0x5c03eb;}})});}_0x24dce7=_['merge']({},_0x24dce7,_0x2e521f['options']);var _0x5b592c={'where':_0x24dce7['where']};return db['MailQueueReport'][_0x7413('0x1e')](_0x5b592c)['then'](function(_0x535e49){_0x1d0bde[_0x7413('0x1e')]=_0x535e49;if(_0x2e521f['query']['includeAll']){_0x24dce7[_0x7413('0x40')]=[{'all':!![]}];}return db[_0x7413('0x2d')][_0x7413('0x41')](_0x24dce7);})[_0x7413('0x25')](function(_0x8049c0){_0x1d0bde['rows']=_0x8049c0;return _0x1d0bde;})[_0x7413('0x25')](respondWithFilteredResult(_0x5eb4d9,_0x24dce7))['catch'](handleError(_0x5eb4d9,null));};exports[_0x7413('0x42')]=function(_0x1d8219,_0xa063d1){var _0xfe0daa={'raw':!![],'where':{'id':_0x1d8219[_0x7413('0x43')]['id']}},_0x3f7da2={};_0x3f7da2[_0x7413('0x31')]=_[_0x7413('0x33')](db[_0x7413('0x2d')][_0x7413('0x2e')]);_0x3f7da2[_0x7413('0x32')]=_[_0x7413('0x33')](_0x1d8219[_0x7413('0x32')]);_0x3f7da2['filters']=_[_0x7413('0x35')](_0x3f7da2[_0x7413('0x31')],_0x3f7da2[_0x7413('0x32')]);_0xfe0daa[_0x7413('0x36')]=_[_0x7413('0x35')](_0x3f7da2[_0x7413('0x31')],qs[_0x7413('0x37')](_0x1d8219[_0x7413('0x32')][_0x7413('0x37')]));_0xfe0daa[_0x7413('0x36')]=_0xfe0daa[_0x7413('0x36')]['length']?_0xfe0daa[_0x7413('0x36')]:_0x3f7da2['model'];if(_0x1d8219[_0x7413('0x32')][_0x7413('0x44')]){_0xfe0daa[_0x7413('0x40')]=[{'all':!![]}];}_0xfe0daa=_[_0x7413('0x3e')]({},_0xfe0daa,_0x1d8219[_0x7413('0x45')]);return db[_0x7413('0x2d')][_0x7413('0x46')](_0xfe0daa)[_0x7413('0x25')](handleEntityNotFound(_0xa063d1,null))[_0x7413('0x25')](respondWithResult(_0xa063d1,null))[_0x7413('0x47')](handleError(_0xa063d1,null));};exports['create']=function(_0x513657,_0x3c1f1a){return db['MailQueueReport']['create'](_0x513657[_0x7413('0x48')],{})[_0x7413('0x25')](respondWithResult(_0x3c1f1a,0xc9))['catch'](handleError(_0x3c1f1a,null));};exports[_0x7413('0x23')]=function(_0x586d25,_0x562bae){if(_0x586d25[_0x7413('0x48')]['id']){delete _0x586d25['body']['id'];}return db[_0x7413('0x2d')][_0x7413('0x46')]({'where':{'id':_0x586d25[_0x7413('0x43')]['id']}})[_0x7413('0x25')](handleEntityNotFound(_0x562bae,null))[_0x7413('0x25')](saveUpdates(_0x586d25[_0x7413('0x48')],null))[_0x7413('0x25')](respondWithResult(_0x562bae,null))[_0x7413('0x47')](handleError(_0x562bae,null));};exports[_0x7413('0x24')]=function(_0x2031e3,_0x50a27d){return db[_0x7413('0x2d')]['find']({'where':{'id':_0x2031e3['params']['id']}})['then'](handleEntityNotFound(_0x50a27d,null))[_0x7413('0x25')](removeEntity(_0x50a27d,null))[_0x7413('0x47')](handleError(_0x50a27d,null));};exports[_0x7413('0x49')]=function(_0x1ba4e9,_0x4bc337){return db['MailQueueReport'][_0x7413('0x49')]()['then'](respondWithResult(_0x4bc337,null))[_0x7413('0x47')](handleError(_0x4bc337,null));}; \ No newline at end of file +var _0x4137=['key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','show','params','includeAll','options','find','catch','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','json','offset','limit','count','set','apply','reject','save','update','destroy','then','end','sendStatus','error','name','send','index','map','MailQueueReport','rawAttributes','type'];(function(_0x5c59e9,_0x253541){var _0x56b0b3=function(_0xeb6ad2){while(--_0xeb6ad2){_0x5c59e9['push'](_0x5c59e9['shift']());}};_0x56b0b3(++_0x253541);}(_0x4137,0xf8));var _0x7413=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x4137[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require(_0x7413('0x0'));var rimraf=require(_0x7413('0x1'));var zipdir=require(_0x7413('0x2'));var jsonpatch=require(_0x7413('0x3'));var rp=require(_0x7413('0x4'));var moment=require(_0x7413('0x5'));var BPromise=require(_0x7413('0x6'));var Mustache=require(_0x7413('0x7'));var util=require(_0x7413('0x8'));var path=require(_0x7413('0x9'));var sox=require(_0x7413('0xa'));var csv=require(_0x7413('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7413('0xc'));var _=require(_0x7413('0xd'));var squel=require(_0x7413('0xe'));var crypto=require(_0x7413('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x7413('0x10'));var toCsv=require(_0x7413('0xb'));var querystring=require('querystring');var Papa=require(_0x7413('0x11'));var Redis=require(_0x7413('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7413('0x13'));var as=require(_0x7413('0x14'));var hardwareService=require(_0x7413('0x15'));var logger=require(_0x7413('0x16'))(_0x7413('0x17'));var utils=require('../../config/utils');var config=require(_0x7413('0x18'));var licenseUtil=require(_0x7413('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18a874,_0xa26ca4){_0xa26ca4=_0xa26ca4||0xcc;return function(_0x13e6bd){if(_0x13e6bd){return _0x18a874['sendStatus'](_0xa26ca4);}return _0x18a874['status'](_0xa26ca4)['end']();};}function respondWithResult(_0x2267f6,_0x336c4c){_0x336c4c=_0x336c4c||0xc8;return function(_0x49f0f6){if(_0x49f0f6){return _0x2267f6[_0x7413('0x1a')](_0x336c4c)[_0x7413('0x1b')](_0x49f0f6);}};}function respondWithFilteredResult(_0x4955d3,_0x38b3d1){return function(_0x50f301){if(_0x50f301){var _0x4b9a5b=typeof _0x38b3d1[_0x7413('0x1c')]==='undefined'&&typeof _0x38b3d1[_0x7413('0x1d')]==='undefined';var _0x2036b6=_0x50f301[_0x7413('0x1e')];var _0x19157f=_0x4b9a5b?0x0:_0x38b3d1[_0x7413('0x1c')];var _0x2a3417=_0x4b9a5b?_0x50f301[_0x7413('0x1e')]:_0x38b3d1['offset']+_0x38b3d1[_0x7413('0x1d')];var _0x17c062;if(_0x2a3417>=_0x2036b6){_0x2a3417=_0x2036b6;_0x17c062=0xc8;}else{_0x17c062=0xce;}_0x4955d3[_0x7413('0x1a')](_0x17c062);return _0x4955d3[_0x7413('0x1f')]('Content-Range',_0x19157f+'-'+_0x2a3417+'/'+_0x2036b6)[_0x7413('0x1b')](_0x50f301);}return null;};}function patchUpdates(_0x12d94d){return function(_0x206afc){try{jsonpatch[_0x7413('0x20')](_0x206afc,_0x12d94d,!![]);}catch(_0x409392){return BPromise[_0x7413('0x21')](_0x409392);}return _0x206afc[_0x7413('0x22')]();};}function saveUpdates(_0x4e18cb,_0x56a06a){return function(_0x5f12a2){if(_0x5f12a2){return _0x5f12a2[_0x7413('0x23')](_0x4e18cb)['then'](function(_0x1585ba){return _0x1585ba;});}return null;};}function removeEntity(_0x372944,_0x3b0c81){return function(_0x2fc0f4){if(_0x2fc0f4){return _0x2fc0f4[_0x7413('0x24')]()[_0x7413('0x25')](function(){_0x372944[_0x7413('0x1a')](0xcc)[_0x7413('0x26')]();});}};}function handleEntityNotFound(_0x1d455b,_0x5a8329){return function(_0x5cb15f){if(!_0x5cb15f){_0x1d455b[_0x7413('0x27')](0x194);}return _0x5cb15f;};}function handleError(_0x48c2dc,_0x46c895){_0x46c895=_0x46c895||0x1f4;return function(_0x71cbb4){logger[_0x7413('0x28')](_0x71cbb4['stack']);if(_0x71cbb4[_0x7413('0x29')]){delete _0x71cbb4[_0x7413('0x29')];}_0x48c2dc[_0x7413('0x1a')](_0x46c895)[_0x7413('0x2a')](_0x71cbb4);};}exports[_0x7413('0x2b')]=function(_0x2e521f,_0x5eb4d9){var _0x24dce7={},_0x4ed662={},_0x1d0bde={'count':0x0,'rows':[]};var _0x23e682=_[_0x7413('0x2c')](db[_0x7413('0x2d')][_0x7413('0x2e')],function(_0x2004ea){return{'name':_0x2004ea['fieldName'],'type':_0x2004ea[_0x7413('0x2f')][_0x7413('0x30')]};});_0x4ed662[_0x7413('0x31')]=_[_0x7413('0x2c')](_0x23e682,_0x7413('0x29'));_0x4ed662[_0x7413('0x32')]=_[_0x7413('0x33')](_0x2e521f['query']);_0x4ed662[_0x7413('0x34')]=_[_0x7413('0x35')](_0x4ed662[_0x7413('0x31')],_0x4ed662[_0x7413('0x32')]);_0x24dce7[_0x7413('0x36')]=_['intersection'](_0x4ed662[_0x7413('0x31')],qs['fields'](_0x2e521f[_0x7413('0x32')][_0x7413('0x37')]));_0x24dce7[_0x7413('0x36')]=_0x24dce7['attributes'][_0x7413('0x38')]?_0x24dce7['attributes']:_0x4ed662[_0x7413('0x31')];if(!_0x2e521f[_0x7413('0x32')]['hasOwnProperty']('nolimit')){_0x24dce7[_0x7413('0x1d')]=qs[_0x7413('0x1d')](_0x2e521f[_0x7413('0x32')]['limit']);_0x24dce7['offset']=qs[_0x7413('0x1c')](_0x2e521f['query']['offset']);}_0x24dce7[_0x7413('0x39')]=qs['sort'](_0x2e521f[_0x7413('0x32')][_0x7413('0x3a')]);_0x24dce7[_0x7413('0x3b')]=qs[_0x7413('0x34')](_[_0x7413('0x3c')](_0x2e521f['query'],_0x4ed662[_0x7413('0x34')]),_0x23e682);if(_0x2e521f[_0x7413('0x32')][_0x7413('0x3d')]){_0x24dce7[_0x7413('0x3b')]=_[_0x7413('0x3e')](_0x24dce7[_0x7413('0x3b')],{'$or':_[_0x7413('0x2c')](_0x23e682,function(_0x385156){if(_0x385156[_0x7413('0x2f')]!==_0x7413('0x3f')){var _0x5c03eb={};_0x5c03eb[_0x385156[_0x7413('0x29')]]={'$like':'%'+_0x2e521f['query'][_0x7413('0x3d')]+'%'};return _0x5c03eb;}})});}_0x24dce7=_['merge']({},_0x24dce7,_0x2e521f['options']);var _0x5b592c={'where':_0x24dce7['where']};return db['MailQueueReport'][_0x7413('0x1e')](_0x5b592c)['then'](function(_0x535e49){_0x1d0bde[_0x7413('0x1e')]=_0x535e49;if(_0x2e521f['query']['includeAll']){_0x24dce7[_0x7413('0x40')]=[{'all':!![]}];}return db[_0x7413('0x2d')][_0x7413('0x41')](_0x24dce7);})[_0x7413('0x25')](function(_0x8049c0){_0x1d0bde['rows']=_0x8049c0;return _0x1d0bde;})[_0x7413('0x25')](respondWithFilteredResult(_0x5eb4d9,_0x24dce7))['catch'](handleError(_0x5eb4d9,null));};exports[_0x7413('0x42')]=function(_0x1d8219,_0xa063d1){var _0xfe0daa={'raw':!![],'where':{'id':_0x1d8219[_0x7413('0x43')]['id']}},_0x3f7da2={};_0x3f7da2[_0x7413('0x31')]=_[_0x7413('0x33')](db[_0x7413('0x2d')][_0x7413('0x2e')]);_0x3f7da2[_0x7413('0x32')]=_[_0x7413('0x33')](_0x1d8219[_0x7413('0x32')]);_0x3f7da2['filters']=_[_0x7413('0x35')](_0x3f7da2[_0x7413('0x31')],_0x3f7da2[_0x7413('0x32')]);_0xfe0daa[_0x7413('0x36')]=_[_0x7413('0x35')](_0x3f7da2[_0x7413('0x31')],qs[_0x7413('0x37')](_0x1d8219[_0x7413('0x32')][_0x7413('0x37')]));_0xfe0daa[_0x7413('0x36')]=_0xfe0daa[_0x7413('0x36')]['length']?_0xfe0daa[_0x7413('0x36')]:_0x3f7da2['model'];if(_0x1d8219[_0x7413('0x32')][_0x7413('0x44')]){_0xfe0daa[_0x7413('0x40')]=[{'all':!![]}];}_0xfe0daa=_[_0x7413('0x3e')]({},_0xfe0daa,_0x1d8219[_0x7413('0x45')]);return db[_0x7413('0x2d')][_0x7413('0x46')](_0xfe0daa)[_0x7413('0x25')](handleEntityNotFound(_0xa063d1,null))[_0x7413('0x25')](respondWithResult(_0xa063d1,null))[_0x7413('0x47')](handleError(_0xa063d1,null));};exports['create']=function(_0x513657,_0x3c1f1a){return db['MailQueueReport']['create'](_0x513657[_0x7413('0x48')],{})[_0x7413('0x25')](respondWithResult(_0x3c1f1a,0xc9))['catch'](handleError(_0x3c1f1a,null));};exports[_0x7413('0x23')]=function(_0x586d25,_0x562bae){if(_0x586d25[_0x7413('0x48')]['id']){delete _0x586d25['body']['id'];}return db[_0x7413('0x2d')][_0x7413('0x46')]({'where':{'id':_0x586d25[_0x7413('0x43')]['id']}})[_0x7413('0x25')](handleEntityNotFound(_0x562bae,null))[_0x7413('0x25')](saveUpdates(_0x586d25[_0x7413('0x48')],null))[_0x7413('0x25')](respondWithResult(_0x562bae,null))[_0x7413('0x47')](handleError(_0x562bae,null));};exports[_0x7413('0x24')]=function(_0x2031e3,_0x50a27d){return db[_0x7413('0x2d')]['find']({'where':{'id':_0x2031e3['params']['id']}})['then'](handleEntityNotFound(_0x50a27d,null))[_0x7413('0x25')](removeEntity(_0x50a27d,null))[_0x7413('0x47')](handleError(_0x50a27d,null));};exports[_0x7413('0x49')]=function(_0x1ba4e9,_0x4bc337){return db['MailQueueReport'][_0x7413('0x49')]()['then'](respondWithResult(_0x4bc337,null))[_0x7413('0x47')](handleError(_0x4bc337,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 8bc61fb..448feb2 100644 --- a/server/api/mailQueueReport/mailQueueReport.model.js +++ b/server/api/mailQueueReport/mailQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed63=['report_mail_queue','uniqueid','lodash','../../config/logger','api','bluebird','rimraf','./mailQueueReport.attributes','exports','MailQueueReport'];(function(_0xe92881,_0x22949b){var _0x33f5ef=function(_0x292532){while(--_0x292532){_0xe92881['push'](_0xe92881['shift']());}};_0x33f5ef(++_0x22949b);}(_0xed63,0x138));var _0x3ed6=function(_0x26b211,_0x1e5c0d){_0x26b211=_0x26b211-0x0;var _0x27b7bd=_0xed63[_0x26b211];return _0x27b7bd;};'use strict';var _=require(_0x3ed6('0x0'));var util=require('util');var logger=require(_0x3ed6('0x1'))(_0x3ed6('0x2'));var moment=require('moment');var BPromise=require(_0x3ed6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3ed6('0x4'));var config=require('../../config/environment');var attributes=require(_0x3ed6('0x5'));module[_0x3ed6('0x6')]=function(_0xa5fcda,_0x4bdb4a){return _0xa5fcda['define'](_0x3ed6('0x7'),attributes,{'tableName':_0x3ed6('0x8'),'paranoid':![],'indexes':[{'name':_0x3ed6('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x37b2=['rimraf','../../config/environment','./mailQueueReport.attributes','exports','MailQueueReport','report_mail_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3670ca,_0x3d4ca1){var _0x1d4dcb=function(_0x813811){while(--_0x813811){_0x3670ca['push'](_0x3670ca['shift']());}};_0x1d4dcb(++_0x3d4ca1);}(_0x37b2,0xa3));var _0x237b=function(_0x17c634,_0x21b7ab){_0x17c634=_0x17c634-0x0;var _0x293c95=_0x37b2[_0x17c634];return _0x293c95;};'use strict';var _=require(_0x237b('0x0'));var util=require('util');var logger=require(_0x237b('0x1'))(_0x237b('0x2'));var moment=require(_0x237b('0x3'));var BPromise=require(_0x237b('0x4'));var rp=require(_0x237b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x237b('0x6'));var config=require(_0x237b('0x7'));var attributes=require(_0x237b('0x8'));module[_0x237b('0x9')]=function(_0x105e04,_0x480723){return _0x105e04['define'](_0x237b('0xa'),attributes,{'tableName':_0x237b('0xb'),'paranoid':![],'indexes':[{'name':_0x237b('0xc'),'fields':[_0x237b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 44798f8..f41cc04 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0xd54fba,_0x5ad76f){var _0x32651b=function(_0x27193d){while(--_0x27193d){_0xd54fba['push'](_0xd54fba['shift']());}};_0x32651b(++_0x5ad76f);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xc4aa[_0x36c5b0];return _0xf19333;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});}; \ No newline at end of file +var _0xadb5=['MailQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailQueueReport','create','options','raw','debug','MailQueueReport','body','attributes','limit','UpdateMailQueueReport','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x3c75ff,_0x39ee58){var _0x3341c8=function(_0x5c2af2){while(--_0x5c2af2){_0x3c75ff['push'](_0x3c75ff['shift']());}};_0x3341c8(++_0x39ee58);}(_0xadb5,0xad));var _0x5adb=function(_0x1f8625,_0x3d76d9){_0x1f8625=_0x1f8625-0x0;var _0x510878=_0xadb5[_0x1f8625];return _0x510878;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailQueueReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}exports[_0x5adb('0x15')]=function(_0x529b65){var _0x3fff62=this;return new Promise(function(_0x5de028,_0x1d9e86){return db['MailQueueReport'][_0x5adb('0x16')](_0x529b65['body'],{'raw':_0x529b65['options']?_0x529b65[_0x5adb('0x17')][_0x5adb('0x18')]===undefined?!![]:![]:!![]})[_0x5adb('0xb')](function(_0x1fd4a7){logger[_0x5adb('0xc')]('CreateMailQueueReport',_0x529b65);logger[_0x5adb('0x19')]('CreateMailQueueReport',_0x529b65,JSON['stringify'](_0x1fd4a7));_0x5de028(_0x1fd4a7);})[_0x5adb('0x14')](function(_0x379b33){logger[_0x5adb('0x10')](_0x5adb('0x15'),_0x379b33[_0x5adb('0x12')],_0x529b65);_0x1d9e86(_0x3fff62[_0x5adb('0x10')](0x1f4,_0x379b33[_0x5adb('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x4b1957){var _0x373cc3=this;return new Promise(function(_0x3220cd,_0x3839fb){return db[_0x5adb('0x1a')]['update'](_0x4b1957[_0x5adb('0x1b')],{'raw':_0x4b1957[_0x5adb('0x17')]?_0x4b1957['options'][_0x5adb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')]['where']||null:null,'attributes':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1c')]||null:null,'limit':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1d')]||null:null})['then'](function(_0x49992e){logger['info'](_0x5adb('0x1e'),_0x4b1957);logger[_0x5adb('0x19')](_0x5adb('0x1e'),_0x4b1957,JSON[_0x5adb('0xf')](_0x49992e));_0x3220cd(_0x49992e);})[_0x5adb('0x14')](function(_0x4de310){logger[_0x5adb('0x10')](_0x5adb('0x1e'),_0x4de310[_0x5adb('0x12')],_0x4b1957);_0x3839fb(_0x373cc3[_0x5adb('0x10')](0x1f4,_0x4de310[_0x5adb('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index f1017b6..19c5598 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x3da2ba,_0x4cad1f){var _0x533609=function(_0x4a8245){while(--_0x4a8245){_0x3da2ba['push'](_0x3da2ba['shift']());}};_0x533609(++_0x4cad1f);}(_0x70e0,0x17b));var _0x070e=function(_0x3b35e5,_0xe2124c){_0x3b35e5=_0x3b35e5-0x0;var _0x146102=_0x70e0[_0x3b35e5];return _0x146102;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x397ab0,_0xf5799f){var _0x167bf0=function(_0x8c817c){while(--_0x8c817c){_0x397ab0['push'](_0x397ab0['shift']());}};_0x167bf0(++_0xf5799f);}(_0xe706,0xa3));var _0x6e70=function(_0x1aefea,_0x39e5fa){_0x1aefea=_0x1aefea-0x0;var _0x33a7a1=_0xe706[_0x1aefea];return _0x33a7a1;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 1e7afd8..03247e9 100644 --- a/server/api/mailServerIn/mailServerIn.attributes.js +++ b/server/api/mailServerIn/mailServerIn.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9cc3=['sequelize','exports','STRING','INTEGER','INBOX','BOOLEAN'];(function(_0x130d0e,_0x51fe46){var _0x79f65c=function(_0x1482dc){while(--_0x1482dc){_0x130d0e['push'](_0x130d0e['shift']());}};_0x79f65c(++_0x51fe46);}(_0x9cc3,0x138));var _0x39cc=function(_0x89db56,_0x53a18c){_0x89db56=_0x89db56-0x0;var _0x5eb329=_0x9cc3[_0x89db56];return _0x5eb329;};'use strict';var Sequelize=require(_0x39cc('0x0'));module[_0x39cc('0x1')]={'description':{'type':Sequelize[_0x39cc('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x39cc('0x2')]},'password':{'type':Sequelize[_0x39cc('0x2')]},'port':{'type':Sequelize[_0x39cc('0x3')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x39cc('0x2')],'defaultValue':_0x39cc('0x4')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x39cc('0x3')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x39cc('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0x44e9=['INBOX','sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x44e9,0xf1));var _0x944e=function(_0x9d78f9,_0x3a7e10){_0x9d78f9=_0x9d78f9-0x0;var _0x17ab25=_0x44e9[_0x9d78f9];return _0x17ab25;};'use strict';var Sequelize=require(_0x944e('0x0'));module[_0x944e('0x1')]={'description':{'type':Sequelize[_0x944e('0x2')]},'host':{'type':Sequelize[_0x944e('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x944e('0x2')]},'port':{'type':Sequelize[_0x944e('0x3')]},'tls':{'type':Sequelize[_0x944e('0x4')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x944e('0x2')],'defaultValue':_0x944e('0x5')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x944e('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x944e('0x2')]},'modernAuthentication':{'type':Sequelize[_0x944e('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 00bdcc7..f47292b 100644 --- a/server/api/mailServerIn/mailServerIn.model.js +++ b/server/api/mailServerIn/mailServerIn.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x27f0=['mail_servers_in','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','exports','MailServerIn'];(function(_0x375426,_0x38bf3a){var _0x30b435=function(_0x26a2ee){while(--_0x26a2ee){_0x375426['push'](_0x375426['shift']());}};_0x30b435(++_0x38bf3a);}(_0x27f0,0x161));var _0x027f=function(_0xf83bf2,_0x21c53c){_0xf83bf2=_0xf83bf2-0x0;var _0x206998=_0x27f0[_0xf83bf2];return _0x206998;};'use strict';var _=require(_0x027f('0x0'));var util=require(_0x027f('0x1'));var logger=require('../../config/logger')(_0x027f('0x2'));var moment=require(_0x027f('0x3'));var BPromise=require('bluebird');var rp=require(_0x027f('0x4'));var fs=require('fs');var path=require(_0x027f('0x5'));var rimraf=require(_0x027f('0x6'));var config=require(_0x027f('0x7'));var attributes=require('./mailServerIn.attributes');module[_0x027f('0x8')]=function(_0x239951,_0x2ba3e7){return _0x239951['define'](_0x027f('0x9'),attributes,{'tableName':_0x027f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x802a=['define','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','exports'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x802a,0x109));var _0xa802=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0x802a[_0x172747];return _0x509692;};'use strict';var _=require(_0xa802('0x0'));var util=require(_0xa802('0x1'));var logger=require(_0xa802('0x2'))(_0xa802('0x3'));var moment=require('moment');var BPromise=require(_0xa802('0x4'));var rp=require(_0xa802('0x5'));var fs=require('fs');var path=require(_0xa802('0x6'));var rimraf=require(_0xa802('0x7'));var config=require(_0xa802('0x8'));var attributes=require(_0xa802('0x9'));module[_0xa802('0xa')]=function(_0x3ad620,_0x14f845){return _0x3ad620[_0xa802('0xb')]('MailServerIn',attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 3dd5d25..aadde86 100644 --- a/server/api/mailServerIn/mailServerIn.rpc.js +++ b/server/api/mailServerIn/mailServerIn.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2608=['http','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailServerIn','findAll','options','raw','attributes','limit','include','map','model','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client'];(function(_0x32996b,_0x4c0449){var _0x2e39f2=function(_0x4016fb){while(--_0x4016fb){_0x32996b['push'](_0x32996b['shift']());}};_0x2e39f2(++_0x4c0449);}(_0x2608,0x1c8));var _0x8260=function(_0x49f4c5,_0x42da90){_0x49f4c5=_0x49f4c5-0x0;var _0x3843c7=_0x2608[_0x49f4c5];return _0x3843c7;};'use strict';var _=require(_0x8260('0x0'));var util=require('util');var moment=require(_0x8260('0x1'));var BPromise=require(_0x8260('0x2'));var rs=require(_0x8260('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8260('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8260('0x5'))(_0x8260('0x6'));var config=require('../../config/environment');var jayson=require(_0x8260('0x7'));var client=jayson[_0x8260('0x8')][_0x8260('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2541e7,_0x3504cd,_0x45954d){return new BPromise(function(_0x491e4b,_0x52dbb6){return client['request'](_0x2541e7,_0x45954d)[_0x8260('0xa')](function(_0x54e5b9){logger[_0x8260('0xb')](_0x8260('0xc'),_0x3504cd,_0x8260('0xd'));logger[_0x8260('0xe')](_0x8260('0xf'),_0x3504cd,_0x8260('0xd'),JSON[_0x8260('0x10')](_0x54e5b9));if(_0x54e5b9[_0x8260('0x11')]){if(_0x54e5b9[_0x8260('0x11')][_0x8260('0x12')]===0x1f4){logger[_0x8260('0x11')]('MailServerIn,\x20%s,\x20%s',_0x3504cd,_0x54e5b9['error'][_0x8260('0x13')]);return _0x52dbb6(_0x54e5b9[_0x8260('0x11')][_0x8260('0x13')]);}logger[_0x8260('0x11')](_0x8260('0xc'),_0x3504cd,_0x54e5b9[_0x8260('0x11')][_0x8260('0x13')]);return _0x491e4b(_0x54e5b9['error']['message']);}else{logger[_0x8260('0xb')]('MailServerIn,\x20%s,\x20%s',_0x3504cd,'request\x20sent');_0x491e4b(_0x54e5b9[_0x8260('0x14')][_0x8260('0x13')]);}})[_0x8260('0x15')](function(_0x21b4e5){logger[_0x8260('0x11')](_0x8260('0xc'),_0x3504cd,_0x21b4e5);_0x52dbb6(_0x21b4e5);});});}exports[_0x8260('0x16')]=function(_0x86245){var _0x501d72=this;return new Promise(function(_0x5b1d0b,_0x50ec48){return db['MailServerIn'][_0x8260('0x17')]({'raw':_0x86245[_0x8260('0x18')]?_0x86245['options'][_0x8260('0x19')]===undefined?!![]:![]:!![],'where':_0x86245[_0x8260('0x18')]?_0x86245[_0x8260('0x18')]['where']||null:null,'attributes':_0x86245[_0x8260('0x18')]?_0x86245[_0x8260('0x18')][_0x8260('0x1a')]||null:null,'limit':_0x86245[_0x8260('0x18')]?_0x86245[_0x8260('0x18')][_0x8260('0x1b')]||null:null,'include':_0x86245[_0x8260('0x18')]?_0x86245[_0x8260('0x18')][_0x8260('0x1c')]?_[_0x8260('0x1d')](_0x86245[_0x8260('0x18')]['include'],function(_0x496152){return{'model':db[_0x496152[_0x8260('0x1e')]],'as':_0x496152['as'],'attributes':_0x496152['attributes'],'include':_0x496152[_0x8260('0x1c')]?_[_0x8260('0x1d')](_0x496152[_0x8260('0x1c')],function(_0x1f055e){return{'model':db[_0x1f055e[_0x8260('0x1e')]],'as':_0x1f055e['as'],'attributes':_0x1f055e[_0x8260('0x1a')],'include':_0x1f055e[_0x8260('0x1c')]?_['map'](_0x1f055e[_0x8260('0x1c')],function(_0x32f40e){return{'model':db[_0x32f40e[_0x8260('0x1e')]],'as':_0x32f40e['as'],'attributes':_0x32f40e[_0x8260('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8260('0xa')](function(_0x5c5872){logger['info']('GetMailServerIn',_0x86245);logger[_0x8260('0xe')]('GetMailServerIn',_0x86245,JSON[_0x8260('0x10')](_0x5c5872));_0x5b1d0b(_0x5c5872);})[_0x8260('0x15')](function(_0x3c3694){logger['error'](_0x8260('0x16'),_0x3c3694[_0x8260('0x13')],_0x86245);_0x50ec48(_0x501d72[_0x8260('0x11')](0x1f4,_0x3c3694[_0x8260('0x13')]));});});}; \ No newline at end of file +var _0xea12=['http','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetMailServerIn','findAll','options','raw','where','attributes','limit','map','include','model','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x524ee5,_0x336a08){var _0x4dbc66=function(_0x23255c){while(--_0x23255c){_0x524ee5['push'](_0x524ee5['shift']());}};_0x4dbc66(++_0x336a08);}(_0xea12,0x149));var _0x2ea1=function(_0x584a31,_0x221fed){_0x584a31=_0x584a31-0x0;var _0x93733c=_0xea12[_0x584a31];return _0x93733c;};'use strict';var _=require(_0x2ea1('0x0'));var util=require(_0x2ea1('0x1'));var moment=require(_0x2ea1('0x2'));var BPromise=require(_0x2ea1('0x3'));var rs=require(_0x2ea1('0x4'));var fs=require('fs');var Redis=require(_0x2ea1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2ea1('0x6'));var logger=require(_0x2ea1('0x7'))('rpc');var config=require(_0x2ea1('0x8'));var jayson=require(_0x2ea1('0x9'));var client=jayson[_0x2ea1('0xa')][_0x2ea1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e7ab2,_0x3177fd,_0x16b11e){return new BPromise(function(_0x5efe62,_0x19bfe4){return client['request'](_0x4e7ab2,_0x16b11e)[_0x2ea1('0xc')](function(_0x4016f3){logger[_0x2ea1('0xd')](_0x2ea1('0xe'),_0x3177fd,_0x2ea1('0xf'));logger['debug'](_0x2ea1('0x10'),_0x3177fd,_0x2ea1('0xf'),JSON['stringify'](_0x4016f3));if(_0x4016f3['error']){if(_0x4016f3[_0x2ea1('0x11')][_0x2ea1('0x12')]===0x1f4){logger['error']('MailServerIn,\x20%s,\x20%s',_0x3177fd,_0x4016f3[_0x2ea1('0x11')][_0x2ea1('0x13')]);return _0x19bfe4(_0x4016f3['error'][_0x2ea1('0x13')]);}logger[_0x2ea1('0x11')](_0x2ea1('0xe'),_0x3177fd,_0x4016f3[_0x2ea1('0x11')][_0x2ea1('0x13')]);return _0x5efe62(_0x4016f3[_0x2ea1('0x11')]['message']);}else{logger[_0x2ea1('0xd')]('MailServerIn,\x20%s,\x20%s',_0x3177fd,'request\x20sent');_0x5efe62(_0x4016f3[_0x2ea1('0x14')][_0x2ea1('0x13')]);}})[_0x2ea1('0x15')](function(_0x3d5736){logger[_0x2ea1('0x11')]('MailServerIn,\x20%s,\x20%s',_0x3177fd,_0x3d5736);_0x19bfe4(_0x3d5736);});});}exports[_0x2ea1('0x16')]=function(_0xb0b766){var _0x219f92=this;return new Promise(function(_0x224622,_0xf0eeac){return db['MailServerIn'][_0x2ea1('0x17')]({'raw':_0xb0b766[_0x2ea1('0x18')]?_0xb0b766['options'][_0x2ea1('0x19')]===undefined?!![]:![]:!![],'where':_0xb0b766['options']?_0xb0b766[_0x2ea1('0x18')][_0x2ea1('0x1a')]||null:null,'attributes':_0xb0b766[_0x2ea1('0x18')]?_0xb0b766[_0x2ea1('0x18')][_0x2ea1('0x1b')]||null:null,'limit':_0xb0b766[_0x2ea1('0x18')]?_0xb0b766['options'][_0x2ea1('0x1c')]||null:null,'include':_0xb0b766[_0x2ea1('0x18')]?_0xb0b766[_0x2ea1('0x18')]['include']?_[_0x2ea1('0x1d')](_0xb0b766[_0x2ea1('0x18')][_0x2ea1('0x1e')],function(_0xa7ee3a){return{'model':db[_0xa7ee3a[_0x2ea1('0x1f')]],'as':_0xa7ee3a['as'],'attributes':_0xa7ee3a[_0x2ea1('0x1b')],'include':_0xa7ee3a[_0x2ea1('0x1e')]?_[_0x2ea1('0x1d')](_0xa7ee3a[_0x2ea1('0x1e')],function(_0x251e06){return{'model':db[_0x251e06['model']],'as':_0x251e06['as'],'attributes':_0x251e06[_0x2ea1('0x1b')],'include':_0x251e06[_0x2ea1('0x1e')]?_[_0x2ea1('0x1d')](_0x251e06[_0x2ea1('0x1e')],function(_0x2a1748){return{'model':db[_0x2a1748[_0x2ea1('0x1f')]],'as':_0x2a1748['as'],'attributes':_0x2a1748['attributes']};}):[]};}):[]};}):[]:[]})[_0x2ea1('0xc')](function(_0x596c23){logger[_0x2ea1('0xd')](_0x2ea1('0x16'),_0xb0b766);logger[_0x2ea1('0x20')]('GetMailServerIn',_0xb0b766,JSON[_0x2ea1('0x21')](_0x596c23));_0x224622(_0x596c23);})[_0x2ea1('0x15')](function(_0x42997a){logger[_0x2ea1('0x11')]('GetMailServerIn',_0x42997a[_0x2ea1('0x13')],_0xb0b766);_0xf0eeac(_0x219f92[_0x2ea1('0x11')](0x1f4,_0x42997a[_0x2ea1('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 393649e..2993114 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x7a54,0x106));var _0x47a5=function(_0x2d888f,_0x340069){_0x2d888f=_0x2d888f-0x0;var _0x588bd8=_0x7a54[_0x2d888f];return _0x588bd8;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x7a54,0x106));var _0x47a5=function(_0xd2d61c,_0x45f028){_0xd2d61c=_0xd2d61c-0x0;var _0x3501d0=_0x7a54[_0xd2d61c];return _0x3501d0;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 37c533a..651c754 100644 --- a/server/api/mailServerOut/mailServerOut.attributes.js +++ b/server/api/mailServerOut/mailServerOut.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x58a4=['BOOLEAN','sequelize','exports','STRING','INTEGER'];(function(_0x2a7b50,_0x545d55){var _0x4224c9=function(_0x2b96f6){while(--_0x2b96f6){_0x2a7b50['push'](_0x2a7b50['shift']());}};_0x4224c9(++_0x545d55);}(_0x58a4,0xbf));var _0x458a=function(_0x28a5ad,_0x520afa){_0x28a5ad=_0x28a5ad-0x0;var _0x176b8a=_0x58a4[_0x28a5ad];return _0x176b8a;};'use strict';var Sequelize=require(_0x458a('0x0'));module[_0x458a('0x1')]={'description':{'type':Sequelize[_0x458a('0x2')]},'host':{'type':Sequelize[_0x458a('0x2')]},'user':{'type':Sequelize[_0x458a('0x2')]},'pass':{'type':Sequelize[_0x458a('0x2')]},'port':{'type':Sequelize[_0x458a('0x3')]},'secure':{'type':Sequelize[_0x458a('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x458a('0x2')]},'authentication':{'type':Sequelize[_0x458a('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x458a('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xcf66=['BOOLEAN','sequelize','exports','STRING'];(function(_0x38e594,_0x1c3e10){var _0x7543ab=function(_0x5e9192){while(--_0x5e9192){_0x38e594['push'](_0x38e594['shift']());}};_0x7543ab(++_0x1c3e10);}(_0xcf66,0x71));var _0x6cf6=function(_0x2fa18d,_0x4f229c){_0x2fa18d=_0x2fa18d-0x0;var _0x10acbf=_0xcf66[_0x2fa18d];return _0x10acbf;};'use strict';var Sequelize=require(_0x6cf6('0x0'));module[_0x6cf6('0x1')]={'description':{'type':Sequelize[_0x6cf6('0x2')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x6cf6('0x2')]},'pass':{'type':Sequelize[_0x6cf6('0x2')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x6cf6('0x2')]},'authentication':{'type':Sequelize[_0x6cf6('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 9fb8ad4..cc15aed 100644 --- a/server/api/mailServerOut/mailServerOut.controller.js +++ b/server/api/mailServerOut/mailServerOut.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbd8b=['update','then','destroy','error','name','send','index','map','MailServerOut','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply'];(function(_0x2dbb11,_0x4cd53a){var _0x3ff04c=function(_0x3bceb3){while(--_0x3bceb3){_0x2dbb11['push'](_0x2dbb11['shift']());}};_0x3ff04c(++_0x4cd53a);}(_0xbd8b,0x153));var _0xbbd8=function(_0x3f93f0,_0x523448){_0x3f93f0=_0x3f93f0-0x0;var _0xd3d3e=_0xbd8b[_0x3f93f0];return _0xd3d3e;};'use strict';var emlformat=require(_0xbbd8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbbd8('0x1'));var jsonpatch=require(_0xbbd8('0x2'));var rp=require('request-promise');var moment=require(_0xbbd8('0x3'));var BPromise=require(_0xbbd8('0x4'));var Mustache=require(_0xbbd8('0x5'));var util=require(_0xbbd8('0x6'));var path=require('path');var sox=require(_0xbbd8('0x7'));var csv=require(_0xbbd8('0x8'));var ejs=require(_0xbbd8('0x9'));var fs=require('fs');var fs_extra=require(_0xbbd8('0xa'));var _=require(_0xbbd8('0xb'));var squel=require(_0xbbd8('0xc'));var crypto=require(_0xbbd8('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xbbd8('0xe'));var toCsv=require('to-csv');var querystring=require(_0xbbd8('0xf'));var Papa=require(_0xbbd8('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbbd8('0x11'));var as=require(_0xbbd8('0x12'));var hardwareService=require(_0xbbd8('0x13'));var logger=require('../../config/logger')(_0xbbd8('0x14'));var utils=require(_0xbbd8('0x15'));var config=require(_0xbbd8('0x16'));var licenseUtil=require(_0xbbd8('0x17'));var db=require(_0xbbd8('0x18'))['db'];function respondWithStatusCode(_0x5d9b8e,_0x5dba18){_0x5dba18=_0x5dba18||0xcc;return function(_0x127d79){if(_0x127d79){return _0x5d9b8e[_0xbbd8('0x19')](_0x5dba18);}return _0x5d9b8e[_0xbbd8('0x1a')](_0x5dba18)[_0xbbd8('0x1b')]();};}function respondWithResult(_0x4175a5,_0x394d4f){_0x394d4f=_0x394d4f||0xc8;return function(_0x528c35){if(_0x528c35){return _0x4175a5[_0xbbd8('0x1a')](_0x394d4f)['json'](_0x528c35);}};}function respondWithFilteredResult(_0x58106e,_0x3c0363){return function(_0x3165e9){if(_0x3165e9){var _0x18bd52=typeof _0x3c0363[_0xbbd8('0x1c')]===_0xbbd8('0x1d')&&typeof _0x3c0363[_0xbbd8('0x1e')]===_0xbbd8('0x1d');var _0xa255fa=_0x3165e9[_0xbbd8('0x1f')];var _0x343d62=_0x18bd52?0x0:_0x3c0363[_0xbbd8('0x1c')];var _0x4d0406=_0x18bd52?_0x3165e9[_0xbbd8('0x1f')]:_0x3c0363[_0xbbd8('0x1c')]+_0x3c0363[_0xbbd8('0x1e')];var _0x581763;if(_0x4d0406>=_0xa255fa){_0x4d0406=_0xa255fa;_0x581763=0xc8;}else{_0x581763=0xce;}_0x58106e[_0xbbd8('0x1a')](_0x581763);return _0x58106e[_0xbbd8('0x20')](_0xbbd8('0x21'),_0x343d62+'-'+_0x4d0406+'/'+_0xa255fa)[_0xbbd8('0x22')](_0x3165e9);}return null;};}function patchUpdates(_0x375176){return function(_0x191c7e){try{jsonpatch[_0xbbd8('0x23')](_0x191c7e,_0x375176,!![]);}catch(_0x5e3f83){return BPromise['reject'](_0x5e3f83);}return _0x191c7e['save']();};}function saveUpdates(_0x4bcbb0,_0x46c2bb){return function(_0x3a9a4d){if(_0x3a9a4d){return _0x3a9a4d[_0xbbd8('0x24')](_0x4bcbb0)[_0xbbd8('0x25')](function(_0x4df216){return _0x4df216;});}return null;};}function removeEntity(_0x2049f6,_0xbcc444){return function(_0x3127d2){if(_0x3127d2){return _0x3127d2[_0xbbd8('0x26')]()['then'](function(){_0x2049f6['status'](0xcc)[_0xbbd8('0x1b')]();});}};}function handleEntityNotFound(_0x120d52,_0x5a18f0){return function(_0x2116c4){if(!_0x2116c4){_0x120d52['sendStatus'](0x194);}return _0x2116c4;};}function handleError(_0x2dd169,_0x57420b){_0x57420b=_0x57420b||0x1f4;return function(_0x3105e5){logger[_0xbbd8('0x27')](_0x3105e5['stack']);if(_0x3105e5[_0xbbd8('0x28')]){delete _0x3105e5[_0xbbd8('0x28')];}_0x2dd169[_0xbbd8('0x1a')](_0x57420b)[_0xbbd8('0x29')](_0x3105e5);};}exports[_0xbbd8('0x2a')]=function(_0x1c3a7e,_0x3b184c){var _0x59cc66={},_0x3d8916={},_0x3a0dd0={'count':0x0,'rows':[]};var _0x3d2be5=_[_0xbbd8('0x2b')](db[_0xbbd8('0x2c')][_0xbbd8('0x2d')],function(_0x2f7baf){return{'name':_0x2f7baf[_0xbbd8('0x2e')],'type':_0x2f7baf[_0xbbd8('0x2f')][_0xbbd8('0x30')]};});_0x3d8916[_0xbbd8('0x31')]=_['map'](_0x3d2be5,_0xbbd8('0x28'));_0x3d8916[_0xbbd8('0x32')]=_[_0xbbd8('0x33')](_0x1c3a7e[_0xbbd8('0x32')]);_0x3d8916['filters']=_[_0xbbd8('0x34')](_0x3d8916[_0xbbd8('0x31')],_0x3d8916[_0xbbd8('0x32')]);_0x59cc66['attributes']=_[_0xbbd8('0x34')](_0x3d8916[_0xbbd8('0x31')],qs[_0xbbd8('0x35')](_0x1c3a7e['query'][_0xbbd8('0x35')]));_0x59cc66[_0xbbd8('0x36')]=_0x59cc66[_0xbbd8('0x36')][_0xbbd8('0x37')]?_0x59cc66[_0xbbd8('0x36')]:_0x3d8916[_0xbbd8('0x31')];if(!_0x1c3a7e[_0xbbd8('0x32')][_0xbbd8('0x38')]('nolimit')){_0x59cc66['limit']=qs[_0xbbd8('0x1e')](_0x1c3a7e[_0xbbd8('0x32')][_0xbbd8('0x1e')]);_0x59cc66['offset']=qs[_0xbbd8('0x1c')](_0x1c3a7e[_0xbbd8('0x32')]['offset']);}_0x59cc66[_0xbbd8('0x39')]=qs[_0xbbd8('0x3a')](_0x1c3a7e[_0xbbd8('0x32')][_0xbbd8('0x3a')]);_0x59cc66[_0xbbd8('0x3b')]=qs[_0xbbd8('0x3c')](_[_0xbbd8('0x3d')](_0x1c3a7e[_0xbbd8('0x32')],_0x3d8916[_0xbbd8('0x3c')]),_0x3d2be5);if(_0x1c3a7e['query'][_0xbbd8('0x3e')]){_0x59cc66['where']=_[_0xbbd8('0x3f')](_0x59cc66['where'],{'$or':_['map'](_0x3d2be5,function(_0x3db7bd){if(_0x3db7bd[_0xbbd8('0x2f')]!==_0xbbd8('0x40')){var _0x5538b0={};_0x5538b0[_0x3db7bd[_0xbbd8('0x28')]]={'$like':'%'+_0x1c3a7e[_0xbbd8('0x32')][_0xbbd8('0x3e')]+'%'};return _0x5538b0;}})});}_0x59cc66=_[_0xbbd8('0x3f')]({},_0x59cc66,_0x1c3a7e[_0xbbd8('0x41')]);var _0x286e90={'where':_0x59cc66[_0xbbd8('0x3b')]};return db[_0xbbd8('0x2c')][_0xbbd8('0x1f')](_0x286e90)[_0xbbd8('0x25')](function(_0x35eeb7){_0x3a0dd0['count']=_0x35eeb7;if(_0x1c3a7e[_0xbbd8('0x32')][_0xbbd8('0x42')]){_0x59cc66[_0xbbd8('0x43')]=[{'all':!![]}];}return db[_0xbbd8('0x2c')][_0xbbd8('0x44')](_0x59cc66);})[_0xbbd8('0x25')](function(_0x527796){_0x3a0dd0['rows']=_0x527796;return _0x3a0dd0;})[_0xbbd8('0x25')](respondWithFilteredResult(_0x3b184c,_0x59cc66))[_0xbbd8('0x45')](handleError(_0x3b184c,null));};exports[_0xbbd8('0x46')]=function(_0x109409,_0x5775ea){var _0x5e9e52={'raw':!![],'where':{'id':_0x109409[_0xbbd8('0x47')]['id']}},_0x31c4ad={};_0x31c4ad[_0xbbd8('0x31')]=_[_0xbbd8('0x33')](db[_0xbbd8('0x2c')][_0xbbd8('0x2d')]);_0x31c4ad['query']=_[_0xbbd8('0x33')](_0x109409[_0xbbd8('0x32')]);_0x31c4ad[_0xbbd8('0x3c')]=_[_0xbbd8('0x34')](_0x31c4ad[_0xbbd8('0x31')],_0x31c4ad[_0xbbd8('0x32')]);_0x5e9e52['attributes']=_[_0xbbd8('0x34')](_0x31c4ad[_0xbbd8('0x31')],qs[_0xbbd8('0x35')](_0x109409['query'][_0xbbd8('0x35')]));_0x5e9e52[_0xbbd8('0x36')]=_0x5e9e52['attributes'][_0xbbd8('0x37')]?_0x5e9e52['attributes']:_0x31c4ad[_0xbbd8('0x31')];if(_0x109409[_0xbbd8('0x32')][_0xbbd8('0x42')]){_0x5e9e52[_0xbbd8('0x43')]=[{'all':!![]}];}_0x5e9e52=_[_0xbbd8('0x3f')]({},_0x5e9e52,_0x109409[_0xbbd8('0x41')]);return db['MailServerOut'][_0xbbd8('0x48')](_0x5e9e52)[_0xbbd8('0x25')](handleEntityNotFound(_0x5775ea,null))[_0xbbd8('0x25')](respondWithResult(_0x5775ea,null))[_0xbbd8('0x45')](handleError(_0x5775ea,null));};exports[_0xbbd8('0x49')]=function(_0x153309,_0x5946b1){return db[_0xbbd8('0x2c')]['create'](_0x153309[_0xbbd8('0x4a')],{})['then'](respondWithResult(_0x5946b1,0xc9))[_0xbbd8('0x45')](handleError(_0x5946b1,null));};exports[_0xbbd8('0x24')]=function(_0x240e4d,_0x2807b0){if(_0x240e4d[_0xbbd8('0x4a')]['id']){delete _0x240e4d['body']['id'];}return db[_0xbbd8('0x2c')][_0xbbd8('0x48')]({'where':{'id':_0x240e4d['params']['id']}})['then'](handleEntityNotFound(_0x2807b0,null))['then'](saveUpdates(_0x240e4d['body'],null))['then'](respondWithResult(_0x2807b0,null))[_0xbbd8('0x45')](handleError(_0x2807b0,null));};exports[_0xbbd8('0x26')]=function(_0x4a1ae1,_0x12832f){return db[_0xbbd8('0x2c')]['find']({'where':{'id':_0x4a1ae1[_0xbbd8('0x47')]['id']}})[_0xbbd8('0x25')](handleEntityNotFound(_0x12832f,null))['then'](removeEntity(_0x12832f,null))['catch'](handleError(_0x12832f,null));}; \ No newline at end of file +var _0x31b5=['pick','filter','merge','VIRTUAL','options','count','include','findAll','catch','params','keys','includeAll','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','send','map','MailServerOut','fieldName','key','model','name','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters'];(function(_0x5f46ed,_0x4c11c4){var _0x597a1c=function(_0x41e84b){while(--_0x41e84b){_0x5f46ed['push'](_0x5f46ed['shift']());}};_0x597a1c(++_0x4c11c4);}(_0x31b5,0xed));var _0x531b=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x31b5[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0x531b('0x0'));var rimraf=require(_0x531b('0x1'));var zipdir=require(_0x531b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x531b('0x3'));var moment=require(_0x531b('0x4'));var BPromise=require(_0x531b('0x5'));var Mustache=require(_0x531b('0x6'));var util=require(_0x531b('0x7'));var path=require(_0x531b('0x8'));var sox=require(_0x531b('0x9'));var csv=require(_0x531b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x531b('0xb'));var squel=require(_0x531b('0xc'));var crypto=require(_0x531b('0xd'));var jsforce=require(_0x531b('0xe'));var deskjs=require(_0x531b('0xf'));var toCsv=require(_0x531b('0xa'));var querystring=require(_0x531b('0x10'));var Papa=require(_0x531b('0x11'));var Redis=require(_0x531b('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x531b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x531b('0x14'))('api');var utils=require(_0x531b('0x15'));var config=require(_0x531b('0x16'));var licenseUtil=require(_0x531b('0x17'));var db=require(_0x531b('0x18'))['db'];function respondWithStatusCode(_0x25f4b2,_0x3b8624){_0x3b8624=_0x3b8624||0xcc;return function(_0x3c4499){if(_0x3c4499){return _0x25f4b2[_0x531b('0x19')](_0x3b8624);}return _0x25f4b2[_0x531b('0x1a')](_0x3b8624)['end']();};}function respondWithResult(_0x2c897c,_0x26cf7b){_0x26cf7b=_0x26cf7b||0xc8;return function(_0x1def45){if(_0x1def45){return _0x2c897c[_0x531b('0x1a')](_0x26cf7b)[_0x531b('0x1b')](_0x1def45);}};}function respondWithFilteredResult(_0x3b1857,_0x5e7908){return function(_0x4b8c43){if(_0x4b8c43){var _0xab9957=typeof _0x5e7908[_0x531b('0x1c')]===_0x531b('0x1d')&&typeof _0x5e7908['limit']===_0x531b('0x1d');var _0x28b635=_0x4b8c43['count'];var _0x54dbf4=_0xab9957?0x0:_0x5e7908[_0x531b('0x1c')];var _0x500aa8=_0xab9957?_0x4b8c43['count']:_0x5e7908['offset']+_0x5e7908[_0x531b('0x1e')];var _0x55117e;if(_0x500aa8>=_0x28b635){_0x500aa8=_0x28b635;_0x55117e=0xc8;}else{_0x55117e=0xce;}_0x3b1857[_0x531b('0x1a')](_0x55117e);return _0x3b1857['set'](_0x531b('0x1f'),_0x54dbf4+'-'+_0x500aa8+'/'+_0x28b635)[_0x531b('0x1b')](_0x4b8c43);}return null;};}function patchUpdates(_0x3b55fe){return function(_0x377e2c){try{jsonpatch[_0x531b('0x20')](_0x377e2c,_0x3b55fe,!![]);}catch(_0x366309){return BPromise[_0x531b('0x21')](_0x366309);}return _0x377e2c[_0x531b('0x22')]();};}function saveUpdates(_0x4b9607,_0x4d5282){return function(_0x5de35d){if(_0x5de35d){return _0x5de35d[_0x531b('0x23')](_0x4b9607)[_0x531b('0x24')](function(_0x9fc641){return _0x9fc641;});}return null;};}function removeEntity(_0x429b13,_0x592465){return function(_0x20da5e){if(_0x20da5e){return _0x20da5e[_0x531b('0x25')]()[_0x531b('0x24')](function(){_0x429b13['status'](0xcc)[_0x531b('0x26')]();});}};}function handleEntityNotFound(_0x5d1fdb,_0x1ca58){return function(_0x536de3){if(!_0x536de3){_0x5d1fdb[_0x531b('0x19')](0x194);}return _0x536de3;};}function handleError(_0x5e6726,_0x3933e0){_0x3933e0=_0x3933e0||0x1f4;return function(_0x175fe8){logger[_0x531b('0x27')](_0x175fe8[_0x531b('0x28')]);if(_0x175fe8['name']){delete _0x175fe8['name'];}_0x5e6726[_0x531b('0x1a')](_0x3933e0)[_0x531b('0x29')](_0x175fe8);};}exports['index']=function(_0x4d4d97,_0x339d8f){var _0x33c314={},_0x5b002e={},_0x51c9d9={'count':0x0,'rows':[]};var _0x454e19=_[_0x531b('0x2a')](db[_0x531b('0x2b')]['rawAttributes'],function(_0x44461f){return{'name':_0x44461f[_0x531b('0x2c')],'type':_0x44461f['type'][_0x531b('0x2d')]};});_0x5b002e[_0x531b('0x2e')]=_[_0x531b('0x2a')](_0x454e19,_0x531b('0x2f'));_0x5b002e[_0x531b('0x30')]=_['keys'](_0x4d4d97[_0x531b('0x30')]);_0x5b002e['filters']=_[_0x531b('0x31')](_0x5b002e[_0x531b('0x2e')],_0x5b002e[_0x531b('0x30')]);_0x33c314['attributes']=_['intersection'](_0x5b002e['model'],qs[_0x531b('0x32')](_0x4d4d97[_0x531b('0x30')][_0x531b('0x32')]));_0x33c314[_0x531b('0x33')]=_0x33c314[_0x531b('0x33')][_0x531b('0x34')]?_0x33c314['attributes']:_0x5b002e[_0x531b('0x2e')];if(!_0x4d4d97[_0x531b('0x30')][_0x531b('0x35')](_0x531b('0x36'))){_0x33c314[_0x531b('0x1e')]=qs[_0x531b('0x1e')](_0x4d4d97[_0x531b('0x30')]['limit']);_0x33c314[_0x531b('0x1c')]=qs[_0x531b('0x1c')](_0x4d4d97['query'][_0x531b('0x1c')]);}_0x33c314[_0x531b('0x37')]=qs[_0x531b('0x38')](_0x4d4d97[_0x531b('0x30')][_0x531b('0x38')]);_0x33c314[_0x531b('0x39')]=qs[_0x531b('0x3a')](_[_0x531b('0x3b')](_0x4d4d97['query'],_0x5b002e[_0x531b('0x3a')]),_0x454e19);if(_0x4d4d97[_0x531b('0x30')][_0x531b('0x3c')]){_0x33c314[_0x531b('0x39')]=_[_0x531b('0x3d')](_0x33c314[_0x531b('0x39')],{'$or':_[_0x531b('0x2a')](_0x454e19,function(_0x44aa51){if(_0x44aa51['type']!==_0x531b('0x3e')){var _0x4bda88={};_0x4bda88[_0x44aa51[_0x531b('0x2f')]]={'$like':'%'+_0x4d4d97[_0x531b('0x30')][_0x531b('0x3c')]+'%'};return _0x4bda88;}})});}_0x33c314=_[_0x531b('0x3d')]({},_0x33c314,_0x4d4d97[_0x531b('0x3f')]);var _0x19c26d={'where':_0x33c314[_0x531b('0x39')]};return db['MailServerOut']['count'](_0x19c26d)[_0x531b('0x24')](function(_0x2b548d){_0x51c9d9[_0x531b('0x40')]=_0x2b548d;if(_0x4d4d97[_0x531b('0x30')]['includeAll']){_0x33c314[_0x531b('0x41')]=[{'all':!![]}];}return db[_0x531b('0x2b')][_0x531b('0x42')](_0x33c314);})[_0x531b('0x24')](function(_0x5b3520){_0x51c9d9['rows']=_0x5b3520;return _0x51c9d9;})[_0x531b('0x24')](respondWithFilteredResult(_0x339d8f,_0x33c314))[_0x531b('0x43')](handleError(_0x339d8f,null));};exports['show']=function(_0x26db2e,_0x3b024d){var _0x7033bd={'raw':!![],'where':{'id':_0x26db2e[_0x531b('0x44')]['id']}},_0x21e638={};_0x21e638[_0x531b('0x2e')]=_[_0x531b('0x45')](db[_0x531b('0x2b')]['rawAttributes']);_0x21e638[_0x531b('0x30')]=_[_0x531b('0x45')](_0x26db2e[_0x531b('0x30')]);_0x21e638[_0x531b('0x3a')]=_[_0x531b('0x31')](_0x21e638['model'],_0x21e638[_0x531b('0x30')]);_0x7033bd[_0x531b('0x33')]=_[_0x531b('0x31')](_0x21e638['model'],qs[_0x531b('0x32')](_0x26db2e[_0x531b('0x30')][_0x531b('0x32')]));_0x7033bd[_0x531b('0x33')]=_0x7033bd[_0x531b('0x33')][_0x531b('0x34')]?_0x7033bd['attributes']:_0x21e638[_0x531b('0x2e')];if(_0x26db2e['query'][_0x531b('0x46')]){_0x7033bd[_0x531b('0x41')]=[{'all':!![]}];}_0x7033bd=_['merge']({},_0x7033bd,_0x26db2e[_0x531b('0x3f')]);return db[_0x531b('0x2b')][_0x531b('0x47')](_0x7033bd)[_0x531b('0x24')](handleEntityNotFound(_0x3b024d,null))['then'](respondWithResult(_0x3b024d,null))[_0x531b('0x43')](handleError(_0x3b024d,null));};exports[_0x531b('0x48')]=function(_0x358630,_0x40c318){return db[_0x531b('0x2b')][_0x531b('0x48')](_0x358630[_0x531b('0x49')],{})['then'](respondWithResult(_0x40c318,0xc9))[_0x531b('0x43')](handleError(_0x40c318,null));};exports[_0x531b('0x23')]=function(_0x2c3e98,_0x12c09e){if(_0x2c3e98[_0x531b('0x49')]['id']){delete _0x2c3e98[_0x531b('0x49')]['id'];}return db[_0x531b('0x2b')]['find']({'where':{'id':_0x2c3e98[_0x531b('0x44')]['id']}})[_0x531b('0x24')](handleEntityNotFound(_0x12c09e,null))[_0x531b('0x24')](saveUpdates(_0x2c3e98[_0x531b('0x49')],null))[_0x531b('0x24')](respondWithResult(_0x12c09e,null))[_0x531b('0x43')](handleError(_0x12c09e,null));};exports[_0x531b('0x25')]=function(_0x4c677f,_0x2715f2){return db[_0x531b('0x2b')][_0x531b('0x47')]({'where':{'id':_0x4c677f[_0x531b('0x44')]['id']}})['then'](handleEntityNotFound(_0x2715f2,null))[_0x531b('0x24')](removeEntity(_0x2715f2,null))['catch'](handleError(_0x2715f2,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 752a504..be7771b 100644 --- a/server/api/mailServerOut/mailServerOut.model.js +++ b/server/api/mailServerOut/mailServerOut.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe49a=['MailServerOut','mail_servers_out','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','define'];(function(_0x3f9264,_0x2caf6f){var _0x15268c=function(_0x4d6bc2){while(--_0x4d6bc2){_0x3f9264['push'](_0x3f9264['shift']());}};_0x15268c(++_0x2caf6f);}(_0xe49a,0xde));var _0xae49=function(_0x75c0aa,_0x52f100){_0x75c0aa=_0x75c0aa-0x0;var _0x397a4e=_0xe49a[_0x75c0aa];return _0x397a4e;};'use strict';var _=require(_0xae49('0x0'));var util=require('util');var logger=require(_0xae49('0x1'))(_0xae49('0x2'));var moment=require('moment');var BPromise=require(_0xae49('0x3'));var rp=require(_0xae49('0x4'));var fs=require('fs');var path=require(_0xae49('0x5'));var rimraf=require('rimraf');var config=require(_0xae49('0x6'));var attributes=require('./mailServerOut.attributes');module['exports']=function(_0x232ab5,_0x406ea1){return _0x232ab5[_0xae49('0x7')](_0xae49('0x8'),attributes,{'tableName':_0xae49('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe5ae=['define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','request-promise','path','../../config/environment','exports'];(function(_0x443494,_0x51fc7e){var _0x4a6794=function(_0x15197a){while(--_0x15197a){_0x443494['push'](_0x443494['shift']());}};_0x4a6794(++_0x51fc7e);}(_0xe5ae,0x143));var _0xee5a=function(_0x39ea42,_0x3c1f50){_0x39ea42=_0x39ea42-0x0;var _0x33f5b7=_0xe5ae[_0x39ea42];return _0x33f5b7;};'use strict';var _=require(_0xee5a('0x0'));var util=require(_0xee5a('0x1'));var logger=require(_0xee5a('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xee5a('0x3'));var fs=require('fs');var path=require(_0xee5a('0x4'));var rimraf=require('rimraf');var config=require(_0xee5a('0x5'));var attributes=require('./mailServerOut.attributes');module[_0xee5a('0x6')]=function(_0x3ede1f,_0x25a6e7){return _0x3ede1f[_0xee5a('0x7')](_0xee5a('0x8'),attributes,{'tableName':_0xee5a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 58fd9b2..7b2c11e 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x394b23,_0x36d244){var _0xccfc8b=function(_0x2609f6){while(--_0x2609f6){_0x394b23['push'](_0x394b23['shift']());}};_0xccfc8b(++_0x36d244);}(_0xadb5,0xad));var _0x5adb=function(_0x3c663d,_0x1e4910){_0x3c663d=_0x3c663d-0x0;var _0x4b73f5=_0xadb5[_0x3c663d];return _0x4b73f5;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailServerOut,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file +var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x54a303,_0x80ff16){var _0x2d948a=function(_0x5ea0a1){while(--_0x5ea0a1){_0x54a303['push'](_0x54a303['shift']());}};_0x2d948a(++_0x80ff16);}(_0x5f2f,0x73));var _0xf5f2=function(_0x383503,_0x108d30){_0x383503=_0x383503-0x0;var _0x36fede=_0x5f2f[_0x383503];return _0x36fede;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 027d16a..c3b0252 100644 --- a/server/api/mailSubstatus/index.js +++ b/server/api/mailSubstatus/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe72c=['/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailSubstatus.controller','index','get','isAuthenticated','describe','show','post','create','put'];(function(_0x4ec863,_0x85080a){var _0x2071fc=function(_0x5a49a2){while(--_0x5a49a2){_0x4ec863['push'](_0x4ec863['shift']());}};_0x2071fc(++_0x85080a);}(_0xe72c,0x17b));var _0xce72=function(_0x313e42,_0x2cfb7e){_0x313e42=_0x313e42-0x0;var _0x2907f5=_0xe72c[_0x313e42];return _0x2907f5;};'use strict';var multer=require(_0xce72('0x0'));var util=require('util');var path=require(_0xce72('0x1'));var timeout=require(_0xce72('0x2'));var express=require(_0xce72('0x3'));var router=express[_0xce72('0x4')]();var fs_extra=require(_0xce72('0x5'));var auth=require(_0xce72('0x6'));var interaction=require(_0xce72('0x7'));var config=require('../../config/environment');var controller=require(_0xce72('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xce72('0x9')]);router[_0xce72('0xa')]('/describe',auth[_0xce72('0xb')](),controller[_0xce72('0xc')]);router[_0xce72('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xce72('0xd')]);router[_0xce72('0xe')]('/',auth[_0xce72('0xb')](),controller[_0xce72('0xf')]);router[_0xce72('0x10')](_0xce72('0x11'),auth[_0xce72('0xb')](),controller[_0xce72('0x12')]);router[_0xce72('0x13')](_0xce72('0x11'),auth[_0xce72('0xb')](),controller[_0xce72('0x14')]);module[_0xce72('0x15')]=router; \ No newline at end of file +var _0x07c6=['update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','/:id','post','put'];(function(_0x35a220,_0x1adf76){var _0x48a31a=function(_0xf4208d){while(--_0xf4208d){_0x35a220['push'](_0x35a220['shift']());}};_0x48a31a(++_0x1adf76);}(_0x07c6,0xd0));var _0x607c=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x07c6[_0x243b2f];return _0xcb3c2d;};'use strict';var multer=require('multer');var util=require(_0x607c('0x0'));var path=require(_0x607c('0x1'));var timeout=require(_0x607c('0x2'));var express=require(_0x607c('0x3'));var router=express['Router']();var fs_extra=require(_0x607c('0x4'));var auth=require(_0x607c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x607c('0x6'));var controller=require('./mailSubstatus.controller');router[_0x607c('0x7')]('/',auth[_0x607c('0x8')](),controller['index']);router[_0x607c('0x7')](_0x607c('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x607c('0x7')](_0x607c('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x607c('0xb')]('/',auth[_0x607c('0x8')](),controller['create']);router[_0x607c('0xc')](_0x607c('0xa'),auth[_0x607c('0x8')](),controller[_0x607c('0xd')]);router[_0x607c('0xe')](_0x607c('0xa'),auth[_0x607c('0x8')](),controller[_0x607c('0xf')]);module[_0x607c('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 18ce0f4..6cddf98 100644 --- a/server/api/mailSubstatus/mailSubstatus.attributes.js +++ b/server/api/mailSubstatus/mailSubstatus.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e24=['exports','STRING','name','sequelize'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0x3e24,0x167));var _0x43e2=function(_0x378aca,_0x13e103){_0x378aca=_0x378aca-0x0;var _0x1b7b4b=_0x3e24[_0x378aca];return _0x1b7b4b;};'use strict';var Sequelize=require(_0x43e2('0x0'));module[_0x43e2('0x1')]={'name':{'type':Sequelize[_0x43e2('0x2')],'unique':_0x43e2('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x43e2('0x2')]}}; \ No newline at end of file +var _0xe944=['sequelize','name'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe944,0x174));var _0x4e94=function(_0x4f58dd,_0x4af6ed){_0x4f58dd=_0x4f58dd-0x0;var _0x3344fa=_0xe944[_0x4f58dd];return _0x3344fa;};'use strict';var Sequelize=require(_0x4e94('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x4e94('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 9b3019e..0178e16 100644 --- a/server/api/mailSubstatus/mailSubstatus.controller.js +++ b/server/api/mailSubstatus/mailSubstatus.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb310=['show','find','create','body','update','params','describe','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','reject','save','then','destroy','error','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xb310,0x13b));var _0x0b31=function(_0x50dbe3,_0x2d9781){_0x50dbe3=_0x50dbe3-0x0;var _0x2f7f5c=_0xb310[_0x50dbe3];return _0x2f7f5c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0b31('0x0'));var zipdir=require(_0x0b31('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0b31('0x2'));var BPromise=require(_0x0b31('0x3'));var Mustache=require(_0x0b31('0x4'));var util=require(_0x0b31('0x5'));var path=require(_0x0b31('0x6'));var sox=require(_0x0b31('0x7'));var csv=require(_0x0b31('0x8'));var ejs=require(_0x0b31('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0b31('0xa'));var squel=require(_0x0b31('0xb'));var crypto=require(_0x0b31('0xc'));var jsforce=require(_0x0b31('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0b31('0x8'));var querystring=require(_0x0b31('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0b31('0xf'));var qs=require(_0x0b31('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0b31('0x11'));var logger=require(_0x0b31('0x12'))('api');var utils=require(_0x0b31('0x13'));var config=require(_0x0b31('0x14'));var licenseUtil=require(_0x0b31('0x15'));var db=require(_0x0b31('0x16'))['db'];function respondWithStatusCode(_0x5e1f13,_0x1eaaeb){_0x1eaaeb=_0x1eaaeb||0xcc;return function(_0x2a109c){if(_0x2a109c){return _0x5e1f13[_0x0b31('0x17')](_0x1eaaeb);}return _0x5e1f13[_0x0b31('0x18')](_0x1eaaeb)[_0x0b31('0x19')]();};}function respondWithResult(_0x248821,_0x50a667){_0x50a667=_0x50a667||0xc8;return function(_0x520548){if(_0x520548){return _0x248821[_0x0b31('0x18')](_0x50a667)['json'](_0x520548);}};}function respondWithFilteredResult(_0x5d0c7e,_0x220273){return function(_0xfa4498){if(_0xfa4498){var _0x25117d=typeof _0x220273[_0x0b31('0x1a')]===_0x0b31('0x1b')&&typeof _0x220273['limit']===_0x0b31('0x1b');var _0x5bd507=_0xfa4498[_0x0b31('0x1c')];var _0x5036ea=_0x25117d?0x0:_0x220273['offset'];var _0x139eaf=_0x25117d?_0xfa4498[_0x0b31('0x1c')]:_0x220273[_0x0b31('0x1a')]+_0x220273['limit'];var _0x4d80c6;if(_0x139eaf>=_0x5bd507){_0x139eaf=_0x5bd507;_0x4d80c6=0xc8;}else{_0x4d80c6=0xce;}_0x5d0c7e[_0x0b31('0x18')](_0x4d80c6);return _0x5d0c7e[_0x0b31('0x1d')](_0x0b31('0x1e'),_0x5036ea+'-'+_0x139eaf+'/'+_0x5bd507)[_0x0b31('0x1f')](_0xfa4498);}return null;};}function patchUpdates(_0x2208a8){return function(_0x4b8e0f){try{jsonpatch['apply'](_0x4b8e0f,_0x2208a8,!![]);}catch(_0x4bee69){return BPromise[_0x0b31('0x20')](_0x4bee69);}return _0x4b8e0f[_0x0b31('0x21')]();};}function saveUpdates(_0x180be1,_0x71a328){return function(_0x5d1b23){if(_0x5d1b23){return _0x5d1b23['update'](_0x180be1)[_0x0b31('0x22')](function(_0x5132bb){return _0x5132bb;});}return null;};}function removeEntity(_0x4a7f1d,_0x49b769){return function(_0x2ffa1c){if(_0x2ffa1c){return _0x2ffa1c[_0x0b31('0x23')]()[_0x0b31('0x22')](function(){_0x4a7f1d['status'](0xcc)[_0x0b31('0x19')]();});}};}function handleEntityNotFound(_0x5b4a32,_0x141184){return function(_0x394633){if(!_0x394633){_0x5b4a32[_0x0b31('0x17')](0x194);}return _0x394633;};}function handleError(_0x59dfc7,_0x212f66){_0x212f66=_0x212f66||0x1f4;return function(_0x27db05){logger[_0x0b31('0x24')](_0x27db05[_0x0b31('0x25')]);if(_0x27db05[_0x0b31('0x26')]){delete _0x27db05[_0x0b31('0x26')];}_0x59dfc7[_0x0b31('0x18')](_0x212f66)[_0x0b31('0x27')](_0x27db05);};}exports[_0x0b31('0x28')]=function(_0x18fb73,_0x877ff7){var _0xa2c15e={},_0x5c11c8={},_0x17b671={'count':0x0,'rows':[]};var _0x298209=_[_0x0b31('0x29')](db[_0x0b31('0x2a')][_0x0b31('0x2b')],function(_0x2fc1ec){return{'name':_0x2fc1ec[_0x0b31('0x2c')],'type':_0x2fc1ec[_0x0b31('0x2d')][_0x0b31('0x2e')]};});_0x5c11c8[_0x0b31('0x2f')]=_[_0x0b31('0x29')](_0x298209,_0x0b31('0x26'));_0x5c11c8[_0x0b31('0x30')]=_[_0x0b31('0x31')](_0x18fb73[_0x0b31('0x30')]);_0x5c11c8[_0x0b31('0x32')]=_['intersection'](_0x5c11c8[_0x0b31('0x2f')],_0x5c11c8[_0x0b31('0x30')]);_0xa2c15e[_0x0b31('0x33')]=_[_0x0b31('0x34')](_0x5c11c8[_0x0b31('0x2f')],qs[_0x0b31('0x35')](_0x18fb73['query'][_0x0b31('0x35')]));_0xa2c15e[_0x0b31('0x33')]=_0xa2c15e['attributes']['length']?_0xa2c15e[_0x0b31('0x33')]:_0x5c11c8['model'];if(!_0x18fb73[_0x0b31('0x30')][_0x0b31('0x36')](_0x0b31('0x37'))){_0xa2c15e['limit']=qs[_0x0b31('0x38')](_0x18fb73[_0x0b31('0x30')][_0x0b31('0x38')]);_0xa2c15e[_0x0b31('0x1a')]=qs[_0x0b31('0x1a')](_0x18fb73[_0x0b31('0x30')][_0x0b31('0x1a')]);}_0xa2c15e[_0x0b31('0x39')]=qs['sort'](_0x18fb73[_0x0b31('0x30')][_0x0b31('0x3a')]);_0xa2c15e[_0x0b31('0x3b')]=qs[_0x0b31('0x32')](_[_0x0b31('0x3c')](_0x18fb73[_0x0b31('0x30')],_0x5c11c8[_0x0b31('0x32')]),_0x298209);if(_0x18fb73[_0x0b31('0x30')]['filter']){_0xa2c15e[_0x0b31('0x3b')]=_['merge'](_0xa2c15e['where'],{'$or':_['map'](_0x298209,function(_0x3091f0){if(_0x3091f0[_0x0b31('0x2d')]!==_0x0b31('0x3d')){var _0x280bfc={};_0x280bfc[_0x3091f0[_0x0b31('0x26')]]={'$like':'%'+_0x18fb73[_0x0b31('0x30')][_0x0b31('0x3e')]+'%'};return _0x280bfc;}})});}_0xa2c15e=_[_0x0b31('0x3f')]({},_0xa2c15e,_0x18fb73[_0x0b31('0x40')]);var _0xb50377={'where':_0xa2c15e[_0x0b31('0x3b')]};return db[_0x0b31('0x2a')][_0x0b31('0x1c')](_0xb50377)['then'](function(_0x587012){_0x17b671[_0x0b31('0x1c')]=_0x587012;if(_0x18fb73[_0x0b31('0x30')][_0x0b31('0x41')]){_0xa2c15e[_0x0b31('0x42')]=[{'all':!![]}];}return db[_0x0b31('0x2a')][_0x0b31('0x43')](_0xa2c15e);})[_0x0b31('0x22')](function(_0x16f1f6){_0x17b671[_0x0b31('0x44')]=_0x16f1f6;return _0x17b671;})[_0x0b31('0x22')](respondWithFilteredResult(_0x877ff7,_0xa2c15e))[_0x0b31('0x45')](handleError(_0x877ff7,null));};exports[_0x0b31('0x46')]=function(_0x5a15de,_0x55b3c1){var _0x3e0747={'raw':!![],'where':{'id':_0x5a15de['params']['id']}},_0x1ab7ff={};_0x1ab7ff[_0x0b31('0x2f')]=_[_0x0b31('0x31')](db[_0x0b31('0x2a')]['rawAttributes']);_0x1ab7ff['query']=_['keys'](_0x5a15de[_0x0b31('0x30')]);_0x1ab7ff['filters']=_['intersection'](_0x1ab7ff[_0x0b31('0x2f')],_0x1ab7ff[_0x0b31('0x30')]);_0x3e0747[_0x0b31('0x33')]=_[_0x0b31('0x34')](_0x1ab7ff[_0x0b31('0x2f')],qs[_0x0b31('0x35')](_0x5a15de[_0x0b31('0x30')][_0x0b31('0x35')]));_0x3e0747[_0x0b31('0x33')]=_0x3e0747[_0x0b31('0x33')]['length']?_0x3e0747[_0x0b31('0x33')]:_0x1ab7ff[_0x0b31('0x2f')];if(_0x5a15de[_0x0b31('0x30')]['includeAll']){_0x3e0747[_0x0b31('0x42')]=[{'all':!![]}];}_0x3e0747=_[_0x0b31('0x3f')]({},_0x3e0747,_0x5a15de['options']);return db['MailSubstatus'][_0x0b31('0x47')](_0x3e0747)['then'](handleEntityNotFound(_0x55b3c1,null))['then'](respondWithResult(_0x55b3c1,null))[_0x0b31('0x45')](handleError(_0x55b3c1,null));};exports[_0x0b31('0x48')]=function(_0x3e48eb,_0x4d1891){return db[_0x0b31('0x2a')][_0x0b31('0x48')](_0x3e48eb[_0x0b31('0x49')],{})[_0x0b31('0x22')](respondWithResult(_0x4d1891,0xc9))[_0x0b31('0x45')](handleError(_0x4d1891,null));};exports[_0x0b31('0x4a')]=function(_0xf3bc7f,_0x4e4532){if(_0xf3bc7f[_0x0b31('0x49')]['id']){delete _0xf3bc7f['body']['id'];}return db[_0x0b31('0x2a')][_0x0b31('0x47')]({'where':{'id':_0xf3bc7f[_0x0b31('0x4b')]['id']}})[_0x0b31('0x22')](handleEntityNotFound(_0x4e4532,null))[_0x0b31('0x22')](saveUpdates(_0xf3bc7f[_0x0b31('0x49')],null))[_0x0b31('0x22')](respondWithResult(_0x4e4532,null))['catch'](handleError(_0x4e4532,null));};exports[_0x0b31('0x23')]=function(_0x52cdcd,_0x2885bb){return db[_0x0b31('0x2a')][_0x0b31('0x47')]({'where':{'id':_0x52cdcd[_0x0b31('0x4b')]['id']}})[_0x0b31('0x22')](handleEntityNotFound(_0x2885bb,null))[_0x0b31('0x22')](removeEntity(_0x2885bb,null))[_0x0b31('0x45')](handleError(_0x2885bb,null));};exports[_0x0b31('0x4c')]=function(_0x646eb8,_0x945a59){return db[_0x0b31('0x2a')][_0x0b31('0x4c')]()[_0x0b31('0x22')](respondWithResult(_0x945a59,null))[_0x0b31('0x45')](handleError(_0x945a59,null));}; \ No newline at end of file +var _0x45a9=['send','MailSubstatus','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','options','include','findAll','catch','show','params','keys','includeAll','find','create','body','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','save','update','then','destroy','stack','name'];(function(_0x57ebed,_0xfac0ac){var _0x3a0874=function(_0x271491){while(--_0x271491){_0x57ebed['push'](_0x57ebed['shift']());}};_0x3a0874(++_0xfac0ac);}(_0x45a9,0x68));var _0x945a=function(_0x6868a9,_0xcad17e){_0x6868a9=_0x6868a9-0x0;var _0xf5d1c=_0x45a9[_0x6868a9];return _0xf5d1c;};'use strict';var emlformat=require(_0x945a('0x0'));var rimraf=require(_0x945a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x945a('0x2'));var moment=require('moment');var BPromise=require(_0x945a('0x3'));var Mustache=require(_0x945a('0x4'));var util=require(_0x945a('0x5'));var path=require(_0x945a('0x6'));var sox=require(_0x945a('0x7'));var csv=require(_0x945a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x945a('0x9'));var squel=require(_0x945a('0xa'));var crypto=require(_0x945a('0xb'));var jsforce=require(_0x945a('0xc'));var deskjs=require(_0x945a('0xd'));var toCsv=require(_0x945a('0x8'));var querystring=require(_0x945a('0xe'));var Papa=require(_0x945a('0xf'));var Redis=require(_0x945a('0x10'));var authService=require(_0x945a('0x11'));var qs=require(_0x945a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x945a('0x13'));var logger=require(_0x945a('0x14'))(_0x945a('0x15'));var utils=require('../../config/utils');var config=require(_0x945a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x945a('0x17'))['db'];function respondWithStatusCode(_0xc8989b,_0x21a8db){_0x21a8db=_0x21a8db||0xcc;return function(_0x4b7930){if(_0x4b7930){return _0xc8989b[_0x945a('0x18')](_0x21a8db);}return _0xc8989b['status'](_0x21a8db)[_0x945a('0x19')]();};}function respondWithResult(_0x158bdc,_0x1a32e3){_0x1a32e3=_0x1a32e3||0xc8;return function(_0x391da2){if(_0x391da2){return _0x158bdc['status'](_0x1a32e3)['json'](_0x391da2);}};}function respondWithFilteredResult(_0x153f75,_0x3e2839){return function(_0x80ace4){if(_0x80ace4){var _0x204b57=typeof _0x3e2839[_0x945a('0x1a')]===_0x945a('0x1b')&&typeof _0x3e2839[_0x945a('0x1c')]===_0x945a('0x1b');var _0x537513=_0x80ace4[_0x945a('0x1d')];var _0x41e92d=_0x204b57?0x0:_0x3e2839[_0x945a('0x1a')];var _0xcdf1b4=_0x204b57?_0x80ace4['count']:_0x3e2839[_0x945a('0x1a')]+_0x3e2839['limit'];var _0x276657;if(_0xcdf1b4>=_0x537513){_0xcdf1b4=_0x537513;_0x276657=0xc8;}else{_0x276657=0xce;}_0x153f75[_0x945a('0x1e')](_0x276657);return _0x153f75[_0x945a('0x1f')](_0x945a('0x20'),_0x41e92d+'-'+_0xcdf1b4+'/'+_0x537513)[_0x945a('0x21')](_0x80ace4);}return null;};}function patchUpdates(_0x21068d){return function(_0x28178c){try{jsonpatch['apply'](_0x28178c,_0x21068d,!![]);}catch(_0x45178e){return BPromise['reject'](_0x45178e);}return _0x28178c[_0x945a('0x22')]();};}function saveUpdates(_0x203cc0,_0x13553e){return function(_0x4e3288){if(_0x4e3288){return _0x4e3288[_0x945a('0x23')](_0x203cc0)[_0x945a('0x24')](function(_0x459688){return _0x459688;});}return null;};}function removeEntity(_0x36e62e,_0x3fd1e7){return function(_0x5219b5){if(_0x5219b5){return _0x5219b5[_0x945a('0x25')]()[_0x945a('0x24')](function(){_0x36e62e['status'](0xcc)[_0x945a('0x19')]();});}};}function handleEntityNotFound(_0x3e7d29,_0x1cf14e){return function(_0x50fd07){if(!_0x50fd07){_0x3e7d29[_0x945a('0x18')](0x194);}return _0x50fd07;};}function handleError(_0xc00c66,_0x7720d3){_0x7720d3=_0x7720d3||0x1f4;return function(_0x1a4f5c){logger['error'](_0x1a4f5c[_0x945a('0x26')]);if(_0x1a4f5c[_0x945a('0x27')]){delete _0x1a4f5c['name'];}_0xc00c66[_0x945a('0x1e')](_0x7720d3)[_0x945a('0x28')](_0x1a4f5c);};}exports['index']=function(_0x2fcae4,_0x50f092){var _0x1657be={},_0x17bab2={},_0x402226={'count':0x0,'rows':[]};var _0x1beddf=_['map'](db[_0x945a('0x29')][_0x945a('0x2a')],function(_0x4b5a43){return{'name':_0x4b5a43[_0x945a('0x2b')],'type':_0x4b5a43[_0x945a('0x2c')][_0x945a('0x2d')]};});_0x17bab2['model']=_['map'](_0x1beddf,_0x945a('0x27'));_0x17bab2[_0x945a('0x2e')]=_['keys'](_0x2fcae4[_0x945a('0x2e')]);_0x17bab2[_0x945a('0x2f')]=_[_0x945a('0x30')](_0x17bab2[_0x945a('0x31')],_0x17bab2[_0x945a('0x2e')]);_0x1657be[_0x945a('0x32')]=_[_0x945a('0x30')](_0x17bab2[_0x945a('0x31')],qs[_0x945a('0x33')](_0x2fcae4[_0x945a('0x2e')][_0x945a('0x33')]));_0x1657be[_0x945a('0x32')]=_0x1657be[_0x945a('0x32')][_0x945a('0x34')]?_0x1657be[_0x945a('0x32')]:_0x17bab2[_0x945a('0x31')];if(!_0x2fcae4[_0x945a('0x2e')][_0x945a('0x35')](_0x945a('0x36'))){_0x1657be[_0x945a('0x1c')]=qs[_0x945a('0x1c')](_0x2fcae4['query']['limit']);_0x1657be[_0x945a('0x1a')]=qs['offset'](_0x2fcae4[_0x945a('0x2e')][_0x945a('0x1a')]);}_0x1657be[_0x945a('0x37')]=qs['sort'](_0x2fcae4[_0x945a('0x2e')][_0x945a('0x38')]);_0x1657be[_0x945a('0x39')]=qs[_0x945a('0x2f')](_['pick'](_0x2fcae4[_0x945a('0x2e')],_0x17bab2[_0x945a('0x2f')]),_0x1beddf);if(_0x2fcae4[_0x945a('0x2e')][_0x945a('0x3a')]){_0x1657be['where']=_[_0x945a('0x3b')](_0x1657be['where'],{'$or':_[_0x945a('0x3c')](_0x1beddf,function(_0x2b4ee6){if(_0x2b4ee6[_0x945a('0x2c')]!=='VIRTUAL'){var _0x4373c9={};_0x4373c9[_0x2b4ee6[_0x945a('0x27')]]={'$like':'%'+_0x2fcae4[_0x945a('0x2e')][_0x945a('0x3a')]+'%'};return _0x4373c9;}})});}_0x1657be=_[_0x945a('0x3b')]({},_0x1657be,_0x2fcae4[_0x945a('0x3d')]);var _0x2e2783={'where':_0x1657be[_0x945a('0x39')]};return db[_0x945a('0x29')][_0x945a('0x1d')](_0x2e2783)['then'](function(_0x459260){_0x402226[_0x945a('0x1d')]=_0x459260;if(_0x2fcae4[_0x945a('0x2e')]['includeAll']){_0x1657be[_0x945a('0x3e')]=[{'all':!![]}];}return db[_0x945a('0x29')][_0x945a('0x3f')](_0x1657be);})[_0x945a('0x24')](function(_0x372483){_0x402226['rows']=_0x372483;return _0x402226;})['then'](respondWithFilteredResult(_0x50f092,_0x1657be))[_0x945a('0x40')](handleError(_0x50f092,null));};exports[_0x945a('0x41')]=function(_0x33955d,_0x5e62d2){var _0x102e8d={'raw':!![],'where':{'id':_0x33955d[_0x945a('0x42')]['id']}},_0x57f42a={};_0x57f42a['model']=_[_0x945a('0x43')](db[_0x945a('0x29')][_0x945a('0x2a')]);_0x57f42a[_0x945a('0x2e')]=_[_0x945a('0x43')](_0x33955d[_0x945a('0x2e')]);_0x57f42a[_0x945a('0x2f')]=_[_0x945a('0x30')](_0x57f42a[_0x945a('0x31')],_0x57f42a['query']);_0x102e8d[_0x945a('0x32')]=_[_0x945a('0x30')](_0x57f42a[_0x945a('0x31')],qs['fields'](_0x33955d['query'][_0x945a('0x33')]));_0x102e8d[_0x945a('0x32')]=_0x102e8d[_0x945a('0x32')][_0x945a('0x34')]?_0x102e8d[_0x945a('0x32')]:_0x57f42a['model'];if(_0x33955d[_0x945a('0x2e')][_0x945a('0x44')]){_0x102e8d[_0x945a('0x3e')]=[{'all':!![]}];}_0x102e8d=_[_0x945a('0x3b')]({},_0x102e8d,_0x33955d['options']);return db[_0x945a('0x29')][_0x945a('0x45')](_0x102e8d)[_0x945a('0x24')](handleEntityNotFound(_0x5e62d2,null))['then'](respondWithResult(_0x5e62d2,null))[_0x945a('0x40')](handleError(_0x5e62d2,null));};exports[_0x945a('0x46')]=function(_0x347092,_0x1f719d){return db[_0x945a('0x29')][_0x945a('0x46')](_0x347092[_0x945a('0x47')],{})[_0x945a('0x24')](respondWithResult(_0x1f719d,0xc9))[_0x945a('0x40')](handleError(_0x1f719d,null));};exports[_0x945a('0x23')]=function(_0x3423c5,_0x143088){if(_0x3423c5[_0x945a('0x47')]['id']){delete _0x3423c5[_0x945a('0x47')]['id'];}return db[_0x945a('0x29')]['find']({'where':{'id':_0x3423c5['params']['id']}})['then'](handleEntityNotFound(_0x143088,null))[_0x945a('0x24')](saveUpdates(_0x3423c5[_0x945a('0x47')],null))['then'](respondWithResult(_0x143088,null))[_0x945a('0x40')](handleError(_0x143088,null));};exports[_0x945a('0x25')]=function(_0x4b9bc8,_0x3516b0){return db[_0x945a('0x29')]['find']({'where':{'id':_0x4b9bc8['params']['id']}})[_0x945a('0x24')](handleEntityNotFound(_0x3516b0,null))[_0x945a('0x24')](removeEntity(_0x3516b0,null))[_0x945a('0x40')](handleError(_0x3516b0,null));};exports['describe']=function(_0x1d4da3,_0x16f89f){return db[_0x945a('0x29')]['describe']()[_0x945a('0x24')](respondWithResult(_0x16f89f,null))[_0x945a('0x40')](handleError(_0x16f89f,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index efaa9eb..532eaee 100644 --- a/server/api/mailSubstatus/mailSubstatus.events.js +++ b/server/api/mailSubstatus/mailSubstatus.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbcbd=['setMaxListeners','emit','hasOwnProperty','exports','events','MailSubstatus'];(function(_0x172133,_0x10246b){var _0x2460e5=function(_0x3c4918){while(--_0x3c4918){_0x172133['push'](_0x172133['shift']());}};_0x2460e5(++_0x10246b);}(_0xbcbd,0x15a));var _0xdbcb=function(_0x5654ef,_0x1ddf03){_0x5654ef=_0x5654ef-0x0;var _0x40fee1=_0xbcbd[_0x5654ef];return _0x40fee1;};'use strict';var EventEmitter=require(_0xdbcb('0x0'));var MailSubstatus=require('../../mysqldb')['db'][_0xdbcb('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xdbcb('0x2')](0x0);var events={'afterUpdate':'update'};function emitEvent(_0x2bfe87){return function(_0x4e2c74,_0x2d2a04,_0x589847){MailSubstatusEvents[_0xdbcb('0x3')](_0x2bfe87+':'+_0x4e2c74['id'],_0x4e2c74);MailSubstatusEvents['emit'](_0x2bfe87,_0x4e2c74);_0x589847(null);};}for(var e in events){if(events[_0xdbcb('0x4')](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module[_0xdbcb('0x5')]=MailSubstatusEvents; \ No newline at end of file +var _0x2356=['update','emit','hasOwnProperty','hook','../../mysqldb'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x2356,0xd6));var _0x6235=function(_0x458565,_0x247ae8){_0x458565=_0x458565-0x0;var _0x1f39c9=_0x2356[_0x458565];return _0x1f39c9;};'use strict';var EventEmitter=require('events');var MailSubstatus=require(_0x6235('0x0'))['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0x6235('0x1')};function emitEvent(_0x38a708){return function(_0x4cbb1a,_0x2a17af,_0x314f86){MailSubstatusEvents[_0x6235('0x2')](_0x38a708+':'+_0x4cbb1a['id'],_0x4cbb1a);MailSubstatusEvents[_0x6235('0x2')](_0x38a708,_0x4cbb1a);_0x314f86(null);};}for(var e in events){if(events[_0x6235('0x3')](e)){var event=events[e];MailSubstatus[_0x6235('0x4')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index fc9abb3..c51177a 100644 --- a/server/api/mailSubstatus/mailSubstatus.model.js +++ b/server/api/mailSubstatus/mailSubstatus.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x45ca=['define','MailSubstatus','Condition','name','mailSubstatus','_previousDataValues','then','catch','./mailSubstatus.attributes','exports','models'];(function(_0x218945,_0x528b02){var _0x2c5189=function(_0x38531c){while(--_0x38531c){_0x218945['push'](_0x218945['shift']());}};_0x2c5189(++_0x528b02);}(_0x45ca,0xfa));var _0xa45c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x45ca[_0xa464c9];return _0x3d73c4;};'use strict';var attributes=require(_0xa45c('0x0'));module[_0xa45c('0x1')]=function(_0x239e73){var _0xa2ec0d=_0x239e73[_0xa45c('0x2')];return _0x239e73[_0xa45c('0x3')](_0xa45c('0x4'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x34689d,_0x4d4b81,_0x4af781){return _0xa2ec0d[_0xa45c('0x5')]['update']({'value':_0x34689d[_0xa45c('0x6')]},{'where':{'field':_0xa45c('0x7'),'value':_0x34689d[_0xa45c('0x8')][_0xa45c('0x6')]}})[_0xa45c('0x9')](function(){_0x4af781();})[_0xa45c('0xa')](function(_0x1c3616){_0x4af781(_0x1c3616);});}}});}; \ No newline at end of file +var _0x8e15=['name','catch','./mailSubstatus.attributes','exports','models','define','mail_substatuses','_previousDataValues'];(function(_0x289dc2,_0x35588b){var _0x28e2c3=function(_0x2c5ea1){while(--_0x2c5ea1){_0x289dc2['push'](_0x289dc2['shift']());}};_0x28e2c3(++_0x35588b);}(_0x8e15,0x1ca));var _0x58e1=function(_0x33c637,_0x597c26){_0x33c637=_0x33c637-0x0;var _0x14aa20=_0x8e15[_0x33c637];return _0x14aa20;};'use strict';var attributes=require(_0x58e1('0x0'));module[_0x58e1('0x1')]=function(_0x576fd4){var _0x212e4c=_0x576fd4[_0x58e1('0x2')];return _0x576fd4[_0x58e1('0x3')]('MailSubstatus',attributes,{'tableName':_0x58e1('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x415a31,_0x48e18b,_0x193621){return _0x212e4c['Condition']['update']({'value':_0x415a31['name']},{'where':{'field':'mailSubstatus','value':_0x415a31[_0x58e1('0x5')][_0x58e1('0x6')]}})['then'](function(){_0x193621();})[_0x58e1('0x7')](function(_0x409f65){_0x193621(_0x409f65);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 9275f1a..8785deb 100644 --- a/server/api/mailSubstatus/mailSubstatus.rpc.js +++ b/server/api/mailSubstatus/mailSubstatus.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x13d3=['error','message','info','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x48bab2,_0x4f3b53){var _0xf41d3c=function(_0x57fecc){while(--_0x57fecc){_0x48bab2['push'](_0x48bab2['shift']());}};_0xf41d3c(++_0x4f3b53);}(_0x13d3,0x88));var _0x313d=function(_0x5ea81c,_0x382138){_0x5ea81c=_0x5ea81c-0x0;var _0x59ee6c=_0x13d3[_0x5ea81c];return _0x59ee6c;};'use strict';var _=require(_0x313d('0x0'));var util=require('util');var moment=require(_0x313d('0x1'));var BPromise=require(_0x313d('0x2'));var rs=require(_0x313d('0x3'));var fs=require('fs');var Redis=require(_0x313d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x313d('0x5'));var logger=require(_0x313d('0x6'))(_0x313d('0x7'));var config=require(_0x313d('0x8'));var jayson=require(_0x313d('0x9'));var client=jayson[_0x313d('0xa')][_0x313d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b5e97,_0x47c9fe,_0x164d31){return new BPromise(function(_0x58e43a,_0x529644){return client[_0x313d('0xc')](_0x5b5e97,_0x164d31)['then'](function(_0x3b3b57){logger['info'](_0x313d('0xd'),_0x47c9fe,_0x313d('0xe'));logger[_0x313d('0xf')](_0x313d('0x10'),_0x47c9fe,_0x313d('0xe'),JSON[_0x313d('0x11')](_0x3b3b57));if(_0x3b3b57['error']){if(_0x3b3b57[_0x313d('0x12')]['code']===0x1f4){logger[_0x313d('0x12')](_0x313d('0xd'),_0x47c9fe,_0x3b3b57[_0x313d('0x12')][_0x313d('0x13')]);return _0x529644(_0x3b3b57[_0x313d('0x12')][_0x313d('0x13')]);}logger[_0x313d('0x12')](_0x313d('0xd'),_0x47c9fe,_0x3b3b57[_0x313d('0x12')]['message']);return _0x58e43a(_0x3b3b57[_0x313d('0x12')][_0x313d('0x13')]);}else{logger[_0x313d('0x14')]('MailSubstatus,\x20%s,\x20%s',_0x47c9fe,_0x313d('0xe'));_0x58e43a(_0x3b3b57['result'][_0x313d('0x13')]);}})[_0x313d('0x15')](function(_0x58d623){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x47c9fe,_0x58d623);_0x529644(_0x58d623);});});} \ No newline at end of file +var _0xabba=['then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request'];(function(_0x42bb01,_0x49f418){var _0x525632=function(_0x101950){while(--_0x101950){_0x42bb01['push'](_0x42bb01['shift']());}};_0x525632(++_0x49f418);}(_0xabba,0x97));var _0xaabb=function(_0x312271,_0x19bfcf){_0x312271=_0x312271-0x0;var _0x46e82c=_0xabba[_0x312271];return _0x46e82c;};'use strict';var _=require(_0xaabb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaabb('0x1'));var db=require(_0xaabb('0x2'))['db'];var utils=require(_0xaabb('0x3'));var logger=require(_0xaabb('0x4'))('rpc');var config=require(_0xaabb('0x5'));var jayson=require(_0xaabb('0x6'));var client=jayson['client'][_0xaabb('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x29348a,_0x51d851,_0x359a83){return new BPromise(function(_0x53079f,_0x564e91){return client[_0xaabb('0x8')](_0x29348a,_0x359a83)[_0xaabb('0x9')](function(_0x54fb9e){logger[_0xaabb('0xa')](_0xaabb('0xb'),_0x51d851,_0xaabb('0xc'));logger[_0xaabb('0xd')](_0xaabb('0xe'),_0x51d851,'request\x20sent',JSON['stringify'](_0x54fb9e));if(_0x54fb9e[_0xaabb('0xf')]){if(_0x54fb9e[_0xaabb('0xf')][_0xaabb('0x10')]===0x1f4){logger[_0xaabb('0xf')](_0xaabb('0xb'),_0x51d851,_0x54fb9e[_0xaabb('0xf')][_0xaabb('0x11')]);return _0x564e91(_0x54fb9e[_0xaabb('0xf')]['message']);}logger['error']('MailSubstatus,\x20%s,\x20%s',_0x51d851,_0x54fb9e[_0xaabb('0xf')][_0xaabb('0x11')]);return _0x53079f(_0x54fb9e[_0xaabb('0xf')]['message']);}else{logger['info'](_0xaabb('0xb'),_0x51d851,_0xaabb('0xc'));_0x53079f(_0x54fb9e[_0xaabb('0x12')][_0xaabb('0x11')]);}})[_0xaabb('0x13')](function(_0x2e7eec){logger[_0xaabb('0xf')]('MailSubstatus,\x20%s,\x20%s',_0x51d851,_0x2e7eec);_0x564e91(_0x2e7eec);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 5bc0c42..f944c1f 100644 --- a/server/api/mailTransferReport/index.js +++ b/server/api/mailTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb44=['./mailTransferReport.controller','isAuthenticated','index','describe','get','show','create','put','/:id','update','delete','destroy','exports','express','Router','fs-extra','../../config/environment'];(function(_0x577c1e,_0x486bd6){var _0x525ee5=function(_0x47547a){while(--_0x47547a){_0x577c1e['push'](_0x577c1e['shift']());}};_0x525ee5(++_0x486bd6);}(_0xcb44,0xa6));var _0x4cb4=function(_0x103be5,_0xe24819){_0x103be5=_0x103be5-0x0;var _0x306562=_0xcb44[_0x103be5];return _0x306562;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4cb4('0x0'));var router=express[_0x4cb4('0x1')]();var fs_extra=require(_0x4cb4('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4cb4('0x3'));var controller=require(_0x4cb4('0x4'));router['get']('/',auth[_0x4cb4('0x5')](),controller[_0x4cb4('0x6')]);router['get']('/describe',auth[_0x4cb4('0x5')](),controller[_0x4cb4('0x7')]);router[_0x4cb4('0x8')]('/:id',auth[_0x4cb4('0x5')](),controller[_0x4cb4('0x9')]);router['post']('/',auth[_0x4cb4('0x5')](),controller[_0x4cb4('0xa')]);router[_0x4cb4('0xb')](_0x4cb4('0xc'),auth['isAuthenticated'](),controller[_0x4cb4('0xd')]);router[_0x4cb4('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x4cb4('0xf')]);module[_0x4cb4('0x10')]=router; \ No newline at end of file +var _0x7cef=['put','update','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7cef,0x17f));var _0xf7ce=function(_0x2a71b8,_0x36d741){_0x2a71b8=_0x2a71b8-0x0;var _0x1bc96d=_0x7cef[_0x2a71b8];return _0x1bc96d;};'use strict';var multer=require('multer');var util=require(_0xf7ce('0x0'));var path=require(_0xf7ce('0x1'));var timeout=require(_0xf7ce('0x2'));var express=require(_0xf7ce('0x3'));var router=express[_0xf7ce('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf7ce('0x5'));var interaction=require(_0xf7ce('0x6'));var config=require('../../config/environment');var controller=require(_0xf7ce('0x7'));router[_0xf7ce('0x8')]('/',auth[_0xf7ce('0x9')](),controller[_0xf7ce('0xa')]);router[_0xf7ce('0x8')]('/describe',auth[_0xf7ce('0x9')](),controller[_0xf7ce('0xb')]);router[_0xf7ce('0x8')](_0xf7ce('0xc'),auth[_0xf7ce('0x9')](),controller[_0xf7ce('0xd')]);router[_0xf7ce('0xe')]('/',auth['isAuthenticated'](),controller[_0xf7ce('0xf')]);router[_0xf7ce('0x10')](_0xf7ce('0xc'),auth['isAuthenticated'](),controller[_0xf7ce('0x11')]);router['delete']('/:id',auth[_0xf7ce('0x9')](),controller[_0xf7ce('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index f2686d0..0548057 100644 --- a/server/api/mailTransferReport/mailTransferReport.attributes.js +++ b/server/api/mailTransferReport/mailTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x5ae93e,_0xe60fbe){var _0xe288cf=function(_0x12d712){while(--_0x12d712){_0x5ae93e['push'](_0x5ae93e['shift']());}};_0xe288cf(++_0xe60fbe);}(_0xedd9,0xfc));var _0x9edd=function(_0x31e57b,_0x4332b7){_0x31e57b=_0x31e57b-0x0;var _0x2f05d0=_0xedd9[_0x31e57b];return _0x2f05d0;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file +var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x31834e,_0x3ad328){var _0x2aa392=function(_0x174687){while(--_0x174687){_0x31834e['push'](_0x31834e['shift']());}};_0x2aa392(++_0x3ad328);}(_0xedd9,0xfc));var _0x9edd=function(_0xc9ea99,_0x2eaa85){_0xc9ea99=_0xc9ea99-0x0;var _0x9fa747=_0xedd9[_0xc9ea99];return _0x9fa747;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index d69b75c..6a88e55 100644 --- a/server/api/mailTransferReport/mailTransferReport.controller.js +++ b/server/api/mailTransferReport/mailTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9f15=['rows','params','find','create','catch','body','describe','rimraf','zip-dir','fast-json-patch','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','apply','reject','save','update','then','destroy','error','name','index','map','MailTransferReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','count','includeAll','findAll'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x9f15,0x11b));var _0x59f1=function(_0x66808a,_0x60f3bd){_0x66808a=_0x66808a-0x0;var _0x760006=_0x9f15[_0x66808a];return _0x760006;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x59f1('0x0'));var zipdir=require(_0x59f1('0x1'));var jsonpatch=require(_0x59f1('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x59f1('0x3'));var Mustache=require('mustache');var util=require(_0x59f1('0x4'));var path=require('path');var sox=require(_0x59f1('0x5'));var csv=require(_0x59f1('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x59f1('0x7'));var _=require(_0x59f1('0x8'));var squel=require(_0x59f1('0x9'));var crypto=require(_0x59f1('0xa'));var jsforce=require(_0x59f1('0xb'));var deskjs=require(_0x59f1('0xc'));var toCsv=require(_0x59f1('0x6'));var querystring=require(_0x59f1('0xd'));var Papa=require('papaparse');var Redis=require(_0x59f1('0xe'));var authService=require(_0x59f1('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x59f1('0x10'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x59f1('0x11'));var licenseUtil=require(_0x59f1('0x12'));var db=require(_0x59f1('0x13'))['db'];function respondWithStatusCode(_0xda3477,_0x3bd71d){_0x3bd71d=_0x3bd71d||0xcc;return function(_0x479e84){if(_0x479e84){return _0xda3477[_0x59f1('0x14')](_0x3bd71d);}return _0xda3477[_0x59f1('0x15')](_0x3bd71d)[_0x59f1('0x16')]();};}function respondWithResult(_0x2fa2e5,_0x529457){_0x529457=_0x529457||0xc8;return function(_0x3ae7c5){if(_0x3ae7c5){return _0x2fa2e5[_0x59f1('0x15')](_0x529457)[_0x59f1('0x17')](_0x3ae7c5);}};}function respondWithFilteredResult(_0x5b4964,_0x49d791){return function(_0x1de5ec){if(_0x1de5ec){var _0x5b29a2=typeof _0x49d791['offset']===_0x59f1('0x18')&&typeof _0x49d791[_0x59f1('0x19')]===_0x59f1('0x18');var _0x35472e=_0x1de5ec['count'];var _0x15bc49=_0x5b29a2?0x0:_0x49d791[_0x59f1('0x1a')];var _0x487743=_0x5b29a2?_0x1de5ec['count']:_0x49d791['offset']+_0x49d791[_0x59f1('0x19')];var _0x332563;if(_0x487743>=_0x35472e){_0x487743=_0x35472e;_0x332563=0xc8;}else{_0x332563=0xce;}_0x5b4964['status'](_0x332563);return _0x5b4964['set']('Content-Range',_0x15bc49+'-'+_0x487743+'/'+_0x35472e)[_0x59f1('0x17')](_0x1de5ec);}return null;};}function patchUpdates(_0x5d2bfb){return function(_0x127627){try{jsonpatch[_0x59f1('0x1b')](_0x127627,_0x5d2bfb,!![]);}catch(_0x2c5113){return BPromise[_0x59f1('0x1c')](_0x2c5113);}return _0x127627[_0x59f1('0x1d')]();};}function saveUpdates(_0x2f742c,_0x24917b){return function(_0x2233a1){if(_0x2233a1){return _0x2233a1[_0x59f1('0x1e')](_0x2f742c)[_0x59f1('0x1f')](function(_0xff59ec){return _0xff59ec;});}return null;};}function removeEntity(_0x449881,_0x352ff3){return function(_0x4c1f06){if(_0x4c1f06){return _0x4c1f06[_0x59f1('0x20')]()[_0x59f1('0x1f')](function(){_0x449881[_0x59f1('0x15')](0xcc)[_0x59f1('0x16')]();});}};}function handleEntityNotFound(_0x11d62a,_0x5beb87){return function(_0x3081df){if(!_0x3081df){_0x11d62a['sendStatus'](0x194);}return _0x3081df;};}function handleError(_0x45e82d,_0x5923ff){_0x5923ff=_0x5923ff||0x1f4;return function(_0x4e268e){logger[_0x59f1('0x21')](_0x4e268e['stack']);if(_0x4e268e[_0x59f1('0x22')]){delete _0x4e268e[_0x59f1('0x22')];}_0x45e82d[_0x59f1('0x15')](_0x5923ff)['send'](_0x4e268e);};}exports[_0x59f1('0x23')]=function(_0x44d28d,_0x970624){var _0x1754db={},_0x5180d5={},_0x277e93={'count':0x0,'rows':[]};var _0x372ca9=_[_0x59f1('0x24')](db[_0x59f1('0x25')][_0x59f1('0x26')],function(_0x67f39e){return{'name':_0x67f39e[_0x59f1('0x27')],'type':_0x67f39e[_0x59f1('0x28')][_0x59f1('0x29')]};});_0x5180d5[_0x59f1('0x2a')]=_[_0x59f1('0x24')](_0x372ca9,'name');_0x5180d5['query']=_[_0x59f1('0x2b')](_0x44d28d['query']);_0x5180d5[_0x59f1('0x2c')]=_[_0x59f1('0x2d')](_0x5180d5[_0x59f1('0x2a')],_0x5180d5[_0x59f1('0x2e')]);_0x1754db[_0x59f1('0x2f')]=_['intersection'](_0x5180d5['model'],qs['fields'](_0x44d28d[_0x59f1('0x2e')][_0x59f1('0x30')]));_0x1754db[_0x59f1('0x2f')]=_0x1754db[_0x59f1('0x2f')][_0x59f1('0x31')]?_0x1754db[_0x59f1('0x2f')]:_0x5180d5[_0x59f1('0x2a')];if(!_0x44d28d['query']['hasOwnProperty'](_0x59f1('0x32'))){_0x1754db[_0x59f1('0x19')]=qs[_0x59f1('0x19')](_0x44d28d['query'][_0x59f1('0x19')]);_0x1754db[_0x59f1('0x1a')]=qs['offset'](_0x44d28d['query'][_0x59f1('0x1a')]);}_0x1754db[_0x59f1('0x33')]=qs[_0x59f1('0x34')](_0x44d28d[_0x59f1('0x2e')][_0x59f1('0x34')]);_0x1754db[_0x59f1('0x35')]=qs[_0x59f1('0x2c')](_[_0x59f1('0x36')](_0x44d28d[_0x59f1('0x2e')],_0x5180d5[_0x59f1('0x2c')]),_0x372ca9);if(_0x44d28d['query'][_0x59f1('0x37')]){_0x1754db[_0x59f1('0x35')]=_['merge'](_0x1754db[_0x59f1('0x35')],{'$or':_[_0x59f1('0x24')](_0x372ca9,function(_0x4418a0){if(_0x4418a0['type']!==_0x59f1('0x38')){var _0x564d3c={};_0x564d3c[_0x4418a0[_0x59f1('0x22')]]={'$like':'%'+_0x44d28d[_0x59f1('0x2e')]['filter']+'%'};return _0x564d3c;}})});}_0x1754db=_[_0x59f1('0x39')]({},_0x1754db,_0x44d28d[_0x59f1('0x3a')]);var _0x58772f={'where':_0x1754db[_0x59f1('0x35')]};return db[_0x59f1('0x25')][_0x59f1('0x3b')](_0x58772f)['then'](function(_0x687398){_0x277e93[_0x59f1('0x3b')]=_0x687398;if(_0x44d28d[_0x59f1('0x2e')][_0x59f1('0x3c')]){_0x1754db['include']=[{'all':!![]}];}return db[_0x59f1('0x25')][_0x59f1('0x3d')](_0x1754db);})[_0x59f1('0x1f')](function(_0x1c91e1){_0x277e93[_0x59f1('0x3e')]=_0x1c91e1;return _0x277e93;})['then'](respondWithFilteredResult(_0x970624,_0x1754db))['catch'](handleError(_0x970624,null));};exports['show']=function(_0x4f04e3,_0x53a8b4){var _0x4fc0c5={'raw':!![],'where':{'id':_0x4f04e3[_0x59f1('0x3f')]['id']}},_0x5c43b4={};_0x5c43b4[_0x59f1('0x2a')]=_[_0x59f1('0x2b')](db[_0x59f1('0x25')]['rawAttributes']);_0x5c43b4[_0x59f1('0x2e')]=_['keys'](_0x4f04e3[_0x59f1('0x2e')]);_0x5c43b4[_0x59f1('0x2c')]=_[_0x59f1('0x2d')](_0x5c43b4[_0x59f1('0x2a')],_0x5c43b4[_0x59f1('0x2e')]);_0x4fc0c5[_0x59f1('0x2f')]=_['intersection'](_0x5c43b4[_0x59f1('0x2a')],qs['fields'](_0x4f04e3[_0x59f1('0x2e')][_0x59f1('0x30')]));_0x4fc0c5[_0x59f1('0x2f')]=_0x4fc0c5['attributes'][_0x59f1('0x31')]?_0x4fc0c5['attributes']:_0x5c43b4[_0x59f1('0x2a')];if(_0x4f04e3['query'][_0x59f1('0x3c')]){_0x4fc0c5['include']=[{'all':!![]}];}_0x4fc0c5=_[_0x59f1('0x39')]({},_0x4fc0c5,_0x4f04e3[_0x59f1('0x3a')]);return db['MailTransferReport'][_0x59f1('0x40')](_0x4fc0c5)[_0x59f1('0x1f')](handleEntityNotFound(_0x53a8b4,null))[_0x59f1('0x1f')](respondWithResult(_0x53a8b4,null))['catch'](handleError(_0x53a8b4,null));};exports[_0x59f1('0x41')]=function(_0x329f70,_0x51af46){return db[_0x59f1('0x25')][_0x59f1('0x41')](_0x329f70['body'],{})['then'](respondWithResult(_0x51af46,0xc9))[_0x59f1('0x42')](handleError(_0x51af46,null));};exports[_0x59f1('0x1e')]=function(_0x562a01,_0x35414b){if(_0x562a01[_0x59f1('0x43')]['id']){delete _0x562a01[_0x59f1('0x43')]['id'];}return db[_0x59f1('0x25')][_0x59f1('0x40')]({'where':{'id':_0x562a01[_0x59f1('0x3f')]['id']}})['then'](handleEntityNotFound(_0x35414b,null))['then'](saveUpdates(_0x562a01[_0x59f1('0x43')],null))['then'](respondWithResult(_0x35414b,null))[_0x59f1('0x42')](handleError(_0x35414b,null));};exports[_0x59f1('0x20')]=function(_0x4a4947,_0x54a8e8){return db['MailTransferReport'][_0x59f1('0x40')]({'where':{'id':_0x4a4947['params']['id']}})[_0x59f1('0x1f')](handleEntityNotFound(_0x54a8e8,null))[_0x59f1('0x1f')](removeEntity(_0x54a8e8,null))['catch'](handleError(_0x54a8e8,null));};exports[_0x59f1('0x44')]=function(_0x1d89c2,_0x3aa415){return db['MailTransferReport'][_0x59f1('0x44')]()[_0x59f1('0x1f')](respondWithResult(_0x3aa415,null))[_0x59f1('0x42')](handleError(_0x3aa415,null));}; \ No newline at end of file +var _0xb213=['status','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','MailTransferReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','describe','eml-format','rimraf','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x4cc8e9,_0x516e57){var _0x44b7e9=function(_0x1c7a5a){while(--_0x1c7a5a){_0x4cc8e9['push'](_0x4cc8e9['shift']());}};_0x44b7e9(++_0x516e57);}(_0xb213,0x1ba));var _0x3b21=function(_0x5e21c6,_0x4937a5){_0x5e21c6=_0x5e21c6-0x0;var _0x5e1922=_0xb213[_0x5e21c6];return _0x5e1922;};'use strict';var emlformat=require(_0x3b21('0x0'));var rimraf=require(_0x3b21('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3b21('0x2'));var BPromise=require(_0x3b21('0x3'));var Mustache=require(_0x3b21('0x4'));var util=require(_0x3b21('0x5'));var path=require(_0x3b21('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3b21('0x7'));var fs=require('fs');var fs_extra=require(_0x3b21('0x8'));var _=require(_0x3b21('0x9'));var squel=require(_0x3b21('0xa'));var crypto=require('crypto');var jsforce=require(_0x3b21('0xb'));var deskjs=require(_0x3b21('0xc'));var toCsv=require(_0x3b21('0xd'));var querystring=require('querystring');var Papa=require(_0x3b21('0xe'));var Redis=require(_0x3b21('0xf'));var authService=require(_0x3b21('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x3b21('0x11'));var hardwareService=require(_0x3b21('0x12'));var logger=require(_0x3b21('0x13'))(_0x3b21('0x14'));var utils=require(_0x3b21('0x15'));var config=require(_0x3b21('0x16'));var licenseUtil=require(_0x3b21('0x17'));var db=require(_0x3b21('0x18'))['db'];function respondWithStatusCode(_0x5a357a,_0x4073d5){_0x4073d5=_0x4073d5||0xcc;return function(_0x2c0915){if(_0x2c0915){return _0x5a357a[_0x3b21('0x19')](_0x4073d5);}return _0x5a357a[_0x3b21('0x1a')](_0x4073d5)['end']();};}function respondWithResult(_0x3fc4ed,_0x23668e){_0x23668e=_0x23668e||0xc8;return function(_0x2ee8ae){if(_0x2ee8ae){return _0x3fc4ed[_0x3b21('0x1a')](_0x23668e)['json'](_0x2ee8ae);}};}function respondWithFilteredResult(_0x22e693,_0x53ca0b){return function(_0x4b42e8){if(_0x4b42e8){var _0x15bde6=typeof _0x53ca0b[_0x3b21('0x1b')]===_0x3b21('0x1c')&&typeof _0x53ca0b[_0x3b21('0x1d')]===_0x3b21('0x1c');var _0x585cd3=_0x4b42e8['count'];var _0x46be33=_0x15bde6?0x0:_0x53ca0b['offset'];var _0x2c4177=_0x15bde6?_0x4b42e8[_0x3b21('0x1e')]:_0x53ca0b['offset']+_0x53ca0b[_0x3b21('0x1d')];var _0x485daa;if(_0x2c4177>=_0x585cd3){_0x2c4177=_0x585cd3;_0x485daa=0xc8;}else{_0x485daa=0xce;}_0x22e693[_0x3b21('0x1a')](_0x485daa);return _0x22e693[_0x3b21('0x1f')](_0x3b21('0x20'),_0x46be33+'-'+_0x2c4177+'/'+_0x585cd3)['json'](_0x4b42e8);}return null;};}function patchUpdates(_0x44026e){return function(_0x464d92){try{jsonpatch[_0x3b21('0x21')](_0x464d92,_0x44026e,!![]);}catch(_0x1f4c42){return BPromise[_0x3b21('0x22')](_0x1f4c42);}return _0x464d92['save']();};}function saveUpdates(_0x383738,_0x2de2a5){return function(_0x329349){if(_0x329349){return _0x329349[_0x3b21('0x23')](_0x383738)[_0x3b21('0x24')](function(_0x127ab2){return _0x127ab2;});}return null;};}function removeEntity(_0x387319,_0x17175a){return function(_0x374d59){if(_0x374d59){return _0x374d59[_0x3b21('0x25')]()[_0x3b21('0x24')](function(){_0x387319['status'](0xcc)[_0x3b21('0x26')]();});}};}function handleEntityNotFound(_0x19859f,_0x111e69){return function(_0x379100){if(!_0x379100){_0x19859f['sendStatus'](0x194);}return _0x379100;};}function handleError(_0x36c24b,_0x3a6986){_0x3a6986=_0x3a6986||0x1f4;return function(_0x2b28fd){logger[_0x3b21('0x27')](_0x2b28fd[_0x3b21('0x28')]);if(_0x2b28fd[_0x3b21('0x29')]){delete _0x2b28fd['name'];}_0x36c24b[_0x3b21('0x1a')](_0x3a6986)[_0x3b21('0x2a')](_0x2b28fd);};}exports[_0x3b21('0x2b')]=function(_0x2df31f,_0x4e149c){var _0x47d4ee={},_0x558e0a={},_0x19c4ae={'count':0x0,'rows':[]};var _0x9a1be0=_[_0x3b21('0x2c')](db[_0x3b21('0x2d')][_0x3b21('0x2e')],function(_0x425958){return{'name':_0x425958[_0x3b21('0x2f')],'type':_0x425958[_0x3b21('0x30')][_0x3b21('0x31')]};});_0x558e0a['model']=_[_0x3b21('0x2c')](_0x9a1be0,_0x3b21('0x29'));_0x558e0a['query']=_[_0x3b21('0x32')](_0x2df31f[_0x3b21('0x33')]);_0x558e0a[_0x3b21('0x34')]=_[_0x3b21('0x35')](_0x558e0a[_0x3b21('0x36')],_0x558e0a[_0x3b21('0x33')]);_0x47d4ee[_0x3b21('0x37')]=_[_0x3b21('0x35')](_0x558e0a[_0x3b21('0x36')],qs[_0x3b21('0x38')](_0x2df31f[_0x3b21('0x33')][_0x3b21('0x38')]));_0x47d4ee[_0x3b21('0x37')]=_0x47d4ee[_0x3b21('0x37')]['length']?_0x47d4ee[_0x3b21('0x37')]:_0x558e0a[_0x3b21('0x36')];if(!_0x2df31f[_0x3b21('0x33')][_0x3b21('0x39')](_0x3b21('0x3a'))){_0x47d4ee[_0x3b21('0x1d')]=qs[_0x3b21('0x1d')](_0x2df31f[_0x3b21('0x33')][_0x3b21('0x1d')]);_0x47d4ee['offset']=qs[_0x3b21('0x1b')](_0x2df31f[_0x3b21('0x33')]['offset']);}_0x47d4ee[_0x3b21('0x3b')]=qs['sort'](_0x2df31f[_0x3b21('0x33')][_0x3b21('0x3c')]);_0x47d4ee[_0x3b21('0x3d')]=qs[_0x3b21('0x34')](_[_0x3b21('0x3e')](_0x2df31f[_0x3b21('0x33')],_0x558e0a[_0x3b21('0x34')]),_0x9a1be0);if(_0x2df31f[_0x3b21('0x33')][_0x3b21('0x3f')]){_0x47d4ee['where']=_[_0x3b21('0x40')](_0x47d4ee[_0x3b21('0x3d')],{'$or':_[_0x3b21('0x2c')](_0x9a1be0,function(_0x324001){if(_0x324001[_0x3b21('0x30')]!=='VIRTUAL'){var _0x1fb9fb={};_0x1fb9fb[_0x324001[_0x3b21('0x29')]]={'$like':'%'+_0x2df31f[_0x3b21('0x33')][_0x3b21('0x3f')]+'%'};return _0x1fb9fb;}})});}_0x47d4ee=_[_0x3b21('0x40')]({},_0x47d4ee,_0x2df31f[_0x3b21('0x41')]);var _0x4950d7={'where':_0x47d4ee['where']};return db[_0x3b21('0x2d')][_0x3b21('0x1e')](_0x4950d7)[_0x3b21('0x24')](function(_0x508e93){_0x19c4ae['count']=_0x508e93;if(_0x2df31f[_0x3b21('0x33')][_0x3b21('0x42')]){_0x47d4ee[_0x3b21('0x43')]=[{'all':!![]}];}return db['MailTransferReport'][_0x3b21('0x44')](_0x47d4ee);})[_0x3b21('0x24')](function(_0x1916f8){_0x19c4ae[_0x3b21('0x45')]=_0x1916f8;return _0x19c4ae;})[_0x3b21('0x24')](respondWithFilteredResult(_0x4e149c,_0x47d4ee))[_0x3b21('0x46')](handleError(_0x4e149c,null));};exports[_0x3b21('0x47')]=function(_0x328d5b,_0x4f3037){var _0xd9593={'raw':!![],'where':{'id':_0x328d5b['params']['id']}},_0x52cb7f={};_0x52cb7f[_0x3b21('0x36')]=_[_0x3b21('0x32')](db['MailTransferReport']['rawAttributes']);_0x52cb7f['query']=_[_0x3b21('0x32')](_0x328d5b['query']);_0x52cb7f[_0x3b21('0x34')]=_[_0x3b21('0x35')](_0x52cb7f[_0x3b21('0x36')],_0x52cb7f[_0x3b21('0x33')]);_0xd9593[_0x3b21('0x37')]=_[_0x3b21('0x35')](_0x52cb7f['model'],qs[_0x3b21('0x38')](_0x328d5b[_0x3b21('0x33')][_0x3b21('0x38')]));_0xd9593[_0x3b21('0x37')]=_0xd9593[_0x3b21('0x37')][_0x3b21('0x48')]?_0xd9593[_0x3b21('0x37')]:_0x52cb7f[_0x3b21('0x36')];if(_0x328d5b[_0x3b21('0x33')][_0x3b21('0x42')]){_0xd9593[_0x3b21('0x43')]=[{'all':!![]}];}_0xd9593=_[_0x3b21('0x40')]({},_0xd9593,_0x328d5b['options']);return db[_0x3b21('0x2d')][_0x3b21('0x49')](_0xd9593)[_0x3b21('0x24')](handleEntityNotFound(_0x4f3037,null))[_0x3b21('0x24')](respondWithResult(_0x4f3037,null))[_0x3b21('0x46')](handleError(_0x4f3037,null));};exports[_0x3b21('0x4a')]=function(_0x1ea759,_0x3b75d8){return db[_0x3b21('0x2d')][_0x3b21('0x4a')](_0x1ea759[_0x3b21('0x4b')],{})[_0x3b21('0x24')](respondWithResult(_0x3b75d8,0xc9))[_0x3b21('0x46')](handleError(_0x3b75d8,null));};exports[_0x3b21('0x23')]=function(_0x356b2c,_0x4c3900){if(_0x356b2c[_0x3b21('0x4b')]['id']){delete _0x356b2c[_0x3b21('0x4b')]['id'];}return db[_0x3b21('0x2d')][_0x3b21('0x49')]({'where':{'id':_0x356b2c['params']['id']}})[_0x3b21('0x24')](handleEntityNotFound(_0x4c3900,null))[_0x3b21('0x24')](saveUpdates(_0x356b2c[_0x3b21('0x4b')],null))[_0x3b21('0x24')](respondWithResult(_0x4c3900,null))[_0x3b21('0x46')](handleError(_0x4c3900,null));};exports[_0x3b21('0x25')]=function(_0x131857,_0x30275b){return db[_0x3b21('0x2d')][_0x3b21('0x49')]({'where':{'id':_0x131857[_0x3b21('0x4c')]['id']}})[_0x3b21('0x24')](handleEntityNotFound(_0x30275b,null))['then'](removeEntity(_0x30275b,null))[_0x3b21('0x46')](handleError(_0x30275b,null));};exports[_0x3b21('0x4d')]=function(_0x7d07d5,_0x1d25c6){return db[_0x3b21('0x2d')][_0x3b21('0x4d')]()[_0x3b21('0x24')](respondWithResult(_0x1d25c6,null))[_0x3b21('0x46')](handleError(_0x1d25c6,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 06b23ba..e4476d8 100644 --- a/server/api/mailTransferReport/mailTransferReport.model.js +++ b/server/api/mailTransferReport/mailTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa37e=['uniqueid','../../config/logger','api','moment','bluebird','path','../../config/environment','./mailTransferReport.attributes','exports','define'];(function(_0x244746,_0x383619){var _0x1e479d=function(_0x4db899){while(--_0x4db899){_0x244746['push'](_0x244746['shift']());}};_0x1e479d(++_0x383619);}(_0xa37e,0x97));var _0xea37=function(_0x4c86c6,_0x164122){_0x4c86c6=_0x4c86c6-0x0;var _0x269698=_0xa37e[_0x4c86c6];return _0x269698;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xea37('0x0'))(_0xea37('0x1'));var moment=require(_0xea37('0x2'));var BPromise=require(_0xea37('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xea37('0x4'));var rimraf=require('rimraf');var config=require(_0xea37('0x5'));var attributes=require(_0xea37('0x6'));module[_0xea37('0x7')]=function(_0x4d380b,_0x57135b){return _0x4d380b[_0xea37('0x8')]('MailTransferReport',attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0xea37('0x9'),'fields':[_0xea37('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdbbe=['define','report_mail_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailTransferReport.attributes','exports'];(function(_0x435850,_0x32aa47){var _0x5453e4=function(_0x17b32a){while(--_0x17b32a){_0x435850['push'](_0x435850['shift']());}};_0x5453e4(++_0x32aa47);}(_0xdbbe,0x148));var _0xedbb=function(_0x38eb23,_0x196e8b){_0x38eb23=_0x38eb23-0x0;var _0x48506a=_0xdbbe[_0x38eb23];return _0x48506a;};'use strict';var _=require('lodash');var util=require(_0xedbb('0x0'));var logger=require(_0xedbb('0x1'))(_0xedbb('0x2'));var moment=require(_0xedbb('0x3'));var BPromise=require(_0xedbb('0x4'));var rp=require(_0xedbb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xedbb('0x6'));var config=require(_0xedbb('0x7'));var attributes=require(_0xedbb('0x8'));module[_0xedbb('0x9')]=function(_0x8022ef,_0x87ee1e){return _0x8022ef[_0xedbb('0xa')]('MailTransferReport',attributes,{'tableName':_0xedbb('0xb'),'paranoid':![],'indexes':[{'name':_0xedbb('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 7fbd3fe..f2b730f 100644 --- a/server/api/mailTransferReport/mailTransferReport.rpc.js +++ b/server/api/mailTransferReport/mailTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc61e=['MailTransferReport,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x28407a,_0x2a7269){var _0x8bd6ef=function(_0x3c886f){while(--_0x3c886f){_0x28407a['push'](_0x28407a['shift']());}};_0x8bd6ef(++_0x2a7269);}(_0xc61e,0x1bd));var _0xec61=function(_0x27a2cf,_0x4439cb){_0x27a2cf=_0x27a2cf-0x0;var _0x57ab15=_0xc61e[_0x27a2cf];return _0x57ab15;};'use strict';var _=require(_0xec61('0x0'));var util=require('util');var moment=require(_0xec61('0x1'));var BPromise=require(_0xec61('0x2'));var rs=require(_0xec61('0x3'));var fs=require('fs');var Redis=require(_0xec61('0x4'));var db=require(_0xec61('0x5'))['db'];var utils=require(_0xec61('0x6'));var logger=require(_0xec61('0x7'))(_0xec61('0x8'));var config=require('../../config/environment');var jayson=require(_0xec61('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3997d4,_0x463755,_0x5cdc8b){return new BPromise(function(_0x25fb69,_0x34fd3b){return client['request'](_0x3997d4,_0x5cdc8b)['then'](function(_0x84fca3){logger['info']('MailTransferReport,\x20%s,\x20%s',_0x463755,_0xec61('0xa'));logger['debug'](_0xec61('0xb'),_0x463755,'request\x20sent',JSON[_0xec61('0xc')](_0x84fca3));if(_0x84fca3[_0xec61('0xd')]){if(_0x84fca3[_0xec61('0xd')][_0xec61('0xe')]===0x1f4){logger[_0xec61('0xd')](_0xec61('0xf'),_0x463755,_0x84fca3[_0xec61('0xd')][_0xec61('0x10')]);return _0x34fd3b(_0x84fca3['error']['message']);}logger['error'](_0xec61('0xf'),_0x463755,_0x84fca3[_0xec61('0xd')][_0xec61('0x10')]);return _0x25fb69(_0x84fca3[_0xec61('0xd')][_0xec61('0x10')]);}else{logger[_0xec61('0x11')](_0xec61('0xf'),_0x463755,_0xec61('0xa'));_0x25fb69(_0x84fca3[_0xec61('0x12')][_0xec61('0x10')]);}})[_0xec61('0x13')](function(_0x293aa7){logger['error'](_0xec61('0xf'),_0x463755,_0x293aa7);_0x34fd3b(_0x293aa7);});});} \ No newline at end of file +var _0x7dfc=['error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x280438,_0x1a2b94){var _0x26c9d6=function(_0x1d369a){while(--_0x1d369a){_0x280438['push'](_0x280438['shift']());}};_0x26c9d6(++_0x1a2b94);}(_0x7dfc,0x1cd));var _0xc7df=function(_0x2b81ee,_0x22d2a3){_0x2b81ee=_0x2b81ee-0x0;var _0x35eb95=_0x7dfc[_0x2b81ee];return _0x35eb95;};'use strict';var _=require(_0xc7df('0x0'));var util=require('util');var moment=require(_0xc7df('0x1'));var BPromise=require(_0xc7df('0x2'));var rs=require(_0xc7df('0x3'));var fs=require('fs');var Redis=require(_0xc7df('0x4'));var db=require(_0xc7df('0x5'))['db'];var utils=require(_0xc7df('0x6'));var logger=require(_0xc7df('0x7'))(_0xc7df('0x8'));var config=require(_0xc7df('0x9'));var jayson=require(_0xc7df('0xa'));var client=jayson[_0xc7df('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x216272,_0x47f1d7,_0x2e4e13){return new BPromise(function(_0x35a080,_0x4f1a20){return client[_0xc7df('0xc')](_0x216272,_0x2e4e13)[_0xc7df('0xd')](function(_0x2a488b){logger[_0xc7df('0xe')](_0xc7df('0xf'),_0x47f1d7,_0xc7df('0x10'));logger['debug'](_0xc7df('0x11'),_0x47f1d7,_0xc7df('0x10'),JSON[_0xc7df('0x12')](_0x2a488b));if(_0x2a488b[_0xc7df('0x13')]){if(_0x2a488b['error'][_0xc7df('0x14')]===0x1f4){logger[_0xc7df('0x13')](_0xc7df('0xf'),_0x47f1d7,_0x2a488b[_0xc7df('0x13')]['message']);return _0x4f1a20(_0x2a488b['error'][_0xc7df('0x15')]);}logger[_0xc7df('0x13')](_0xc7df('0xf'),_0x47f1d7,_0x2a488b['error'][_0xc7df('0x15')]);return _0x35a080(_0x2a488b[_0xc7df('0x13')][_0xc7df('0x15')]);}else{logger[_0xc7df('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x47f1d7,_0xc7df('0x10'));_0x35a080(_0x2a488b[_0xc7df('0x16')][_0xc7df('0x15')]);}})[_0xc7df('0x17')](function(_0x40475d){logger[_0xc7df('0x13')](_0xc7df('0xf'),_0x47f1d7,_0x40475d);_0x4f1a20(_0x40475d);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 5cad5ce..dd89452 100644 --- a/server/api/memberReport/index.js +++ b/server/api/memberReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1062=['create','put','update','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x1062,0x195));var _0x2106=function(_0x5716e0,_0x55c891){_0x5716e0=_0x5716e0-0x0;var _0x3eb598=_0x1062[_0x5716e0];return _0x3eb598;};'use strict';var multer=require(_0x2106('0x0'));var util=require(_0x2106('0x1'));var path=require(_0x2106('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2106('0x3')]();var fs_extra=require(_0x2106('0x4'));var auth=require(_0x2106('0x5'));var interaction=require(_0x2106('0x6'));var config=require(_0x2106('0x7'));var controller=require('./memberReport.controller');router['get']('/',auth[_0x2106('0x8')](),controller[_0x2106('0x9')]);router[_0x2106('0xa')](_0x2106('0xb'),auth['isAuthenticated'](),controller[_0x2106('0xc')]);router[_0x2106('0xa')](_0x2106('0xd'),auth[_0x2106('0x8')](),controller[_0x2106('0xe')]);router['post']('/',auth[_0x2106('0x8')](),controller[_0x2106('0xf')]);router[_0x2106('0x10')](_0x2106('0xd'),auth['isAuthenticated'](),controller[_0x2106('0x11')]);router['delete'](_0x2106('0xd'),auth[_0x2106('0x8')](),controller[_0x2106('0x12')]);module[_0x2106('0x13')]=router; \ No newline at end of file +var _0xa775=['/:id','show','post','create','update','delete','destroy','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe'];(function(_0x4a2907,_0x48f47b){var _0x441c8b=function(_0x3ade96){while(--_0x3ade96){_0x4a2907['push'](_0x4a2907['shift']());}};_0x441c8b(++_0x48f47b);}(_0xa775,0xfe));var _0x5a77=function(_0x573cca,_0x170545){_0x573cca=_0x573cca-0x0;var _0x3e5f2b=_0xa775[_0x573cca];return _0x3e5f2b;};'use strict';var multer=require('multer');var util=require(_0x5a77('0x0'));var path=require(_0x5a77('0x1'));var timeout=require('connect-timeout');var express=require(_0x5a77('0x2'));var router=express[_0x5a77('0x3')]();var fs_extra=require(_0x5a77('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5a77('0x5'));var config=require(_0x5a77('0x6'));var controller=require('./memberReport.controller');router[_0x5a77('0x7')]('/',auth[_0x5a77('0x8')](),controller[_0x5a77('0x9')]);router[_0x5a77('0x7')](_0x5a77('0xa'),auth[_0x5a77('0x8')](),controller[_0x5a77('0xb')]);router[_0x5a77('0x7')](_0x5a77('0xc'),auth[_0x5a77('0x8')](),controller[_0x5a77('0xd')]);router[_0x5a77('0xe')]('/',auth[_0x5a77('0x8')](),controller[_0x5a77('0xf')]);router['put'](_0x5a77('0xc'),auth[_0x5a77('0x8')](),controller[_0x5a77('0x10')]);router[_0x5a77('0x11')]('/:id',auth[_0x5a77('0x8')](),controller[_0x5a77('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 930ec15..e4b127b 100644 --- a/server/api/memberReport/memberReport.attributes.js +++ b/server/api/memberReport/memberReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7674=['enterAt','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[queue]','INTEGER','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue'];(function(_0x47d0e7,_0x5c5950){var _0xcaca32=function(_0x195055){while(--_0x195055){_0x47d0e7['push'](_0x47d0e7['shift']());}};_0xcaca32(++_0x5c5950);}(_0x7674,0x163));var _0x4767=function(_0x263ffd,_0x140cf8){_0x263ffd=_0x263ffd-0x0;var _0x2b3b8b=_0x7674[_0x263ffd];return _0x2b3b8b;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'channel':{'type':Sequelize[_0x4767('0x0')]},'membername':{'type':Sequelize[_0x4767('0x0')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING'],'defaultValue':_0x4767('0x1'),'comment':_0x4767('0x2')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x4767('0x3')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x28d9aa){var _0x49ab32=moment(_0x28d9aa);var _0x7a0128=moment(this[_0x4767('0x4')](_0x4767('0x5')));var _0x4e34e9=_0x49ab32['diff'](_0x7a0128,_0x4767('0x6'));this[_0x4767('0x7')](_0x4767('0x8'),_0x28d9aa);this[_0x4767('0x7')](_0x4767('0x9'),_0x4e34e9>=0x0?_0x4e34e9:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x4767('0xa')},'data2':{'type':Sequelize[_0x4767('0x0')],'comment':_0x4767('0xb')},'data3':{'type':Sequelize[_0x4767('0x0')],'comment':_0x4767('0xc')},'data4':{'type':Sequelize[_0x4767('0x0')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x4767('0x0')],'comment':_0x4767('0xd')},'role':{'type':Sequelize[_0x4767('0x0')]},'internal':{'type':Sequelize[_0x4767('0xe')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xfbd6=['DATE','getDataValue','diff','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','moment','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER'];(function(_0x13c08d,_0x1f2da0){var _0x27d3e0=function(_0x561a7e){while(--_0x561a7e){_0x13c08d['push'](_0x13c08d['shift']());}};_0x27d3e0(++_0x1f2da0);}(_0xfbd6,0x175));var _0x6fbd=function(_0x1b9c80,_0x462bbb){_0x1b9c80=_0x1b9c80-0x0;var _0x365d12=_0xfbd6[_0x1b9c80];return _0x365d12;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x6fbd('0x0'));module['exports']={'channel':{'type':Sequelize[_0x6fbd('0x1')]},'membername':{'type':Sequelize[_0x6fbd('0x1')]},'interface':{'type':Sequelize[_0x6fbd('0x1')]},'type':{'type':Sequelize[_0x6fbd('0x1')],'defaultValue':_0x6fbd('0x2'),'comment':_0x6fbd('0x3')},'duration':{'type':Sequelize[_0x6fbd('0x4')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x6fbd('0x5')],'set':function(_0x3b56f2){var _0x20e1aa=moment(_0x3b56f2);var _0x55c276=moment(this[_0x6fbd('0x6')]('enterAt'));var _0x1ec38c=_0x20e1aa[_0x6fbd('0x7')](_0x55c276,'seconds');this[_0x6fbd('0x8')](_0x6fbd('0x9'),_0x3b56f2);this[_0x6fbd('0x8')](_0x6fbd('0xa'),_0x1ec38c>=0x0?_0x1ec38c:null);}},'data1':{'type':Sequelize[_0x6fbd('0x1')],'comment':_0x6fbd('0xb')},'data2':{'type':Sequelize[_0x6fbd('0x1')],'comment':_0x6fbd('0xc')},'data3':{'type':Sequelize['STRING'],'comment':_0x6fbd('0xd')},'data4':{'type':Sequelize['STRING'],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x6fbd('0x1')],'comment':'talk:[queue]'},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x6fbd('0x1')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 5ba634f..b766d70 100644 --- a/server/api/memberReport/memberReport.controller.js +++ b/server/api/memberReport/memberReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7217=['query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','filter','includeAll','include','rows','catch','show','params','rawAttributes','length','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','send','index','map','MemberReport','fieldName','type','model','name','keys'];(function(_0x83b439,_0x1e92b6){var _0x189ec6=function(_0x51aefe){while(--_0x51aefe){_0x83b439['push'](_0x83b439['shift']());}};_0x189ec6(++_0x1e92b6);}(_0x7217,0x19e));var _0x7721=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x7217[_0x2bf141];return _0x48277b;};'use strict';var emlformat=require(_0x7721('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7721('0x1'));var jsonpatch=require(_0x7721('0x2'));var rp=require(_0x7721('0x3'));var moment=require(_0x7721('0x4'));var BPromise=require(_0x7721('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7721('0x6'));var sox=require(_0x7721('0x7'));var csv=require(_0x7721('0x8'));var ejs=require(_0x7721('0x9'));var fs=require('fs');var fs_extra=require(_0x7721('0xa'));var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x8'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var licenseUtil=require(_0x7721('0x1a'));var db=require(_0x7721('0x1b'))['db'];function respondWithStatusCode(_0x55b4ca,_0x2911ec){_0x2911ec=_0x2911ec||0xcc;return function(_0x199930){if(_0x199930){return _0x55b4ca['sendStatus'](_0x2911ec);}return _0x55b4ca[_0x7721('0x1c')](_0x2911ec)[_0x7721('0x1d')]();};}function respondWithResult(_0x3f01c5,_0x2e9752){_0x2e9752=_0x2e9752||0xc8;return function(_0x5069da){if(_0x5069da){return _0x3f01c5[_0x7721('0x1c')](_0x2e9752)[_0x7721('0x1e')](_0x5069da);}};}function respondWithFilteredResult(_0x534f1b,_0x4e199a){return function(_0x4b183e){if(_0x4b183e){var _0x5ed54=typeof _0x4e199a[_0x7721('0x1f')]===_0x7721('0x20')&&typeof _0x4e199a[_0x7721('0x21')]==='undefined';var _0x20f669=_0x4b183e['count'];var _0x3fc09e=_0x5ed54?0x0:_0x4e199a['offset'];var _0xfec626=_0x5ed54?_0x4b183e[_0x7721('0x22')]:_0x4e199a[_0x7721('0x1f')]+_0x4e199a[_0x7721('0x21')];var _0x2286e5;if(_0xfec626>=_0x20f669){_0xfec626=_0x20f669;_0x2286e5=0xc8;}else{_0x2286e5=0xce;}_0x534f1b[_0x7721('0x1c')](_0x2286e5);return _0x534f1b[_0x7721('0x23')](_0x7721('0x24'),_0x3fc09e+'-'+_0xfec626+'/'+_0x20f669)[_0x7721('0x1e')](_0x4b183e);}return null;};}function patchUpdates(_0xaeccc4){return function(_0x4ce1db){try{jsonpatch[_0x7721('0x25')](_0x4ce1db,_0xaeccc4,!![]);}catch(_0x2c1583){return BPromise[_0x7721('0x26')](_0x2c1583);}return _0x4ce1db[_0x7721('0x27')]();};}function saveUpdates(_0x57140c,_0x28f5a6){return function(_0x512f31){if(_0x512f31){return _0x512f31[_0x7721('0x28')](_0x57140c)[_0x7721('0x29')](function(_0x3e8a4e){return _0x3e8a4e;});}return null;};}function removeEntity(_0x1caad8,_0x121cc4){return function(_0x395b15){if(_0x395b15){return _0x395b15[_0x7721('0x2a')]()['then'](function(){_0x1caad8[_0x7721('0x1c')](0xcc)[_0x7721('0x1d')]();});}};}function handleEntityNotFound(_0x125564,_0x1f67c7){return function(_0x40d550){if(!_0x40d550){_0x125564[_0x7721('0x2b')](0x194);}return _0x40d550;};}function handleError(_0x424e05,_0xf753f1){_0xf753f1=_0xf753f1||0x1f4;return function(_0x40f367){logger['error'](_0x40f367[_0x7721('0x2c')]);if(_0x40f367['name']){delete _0x40f367['name'];}_0x424e05[_0x7721('0x1c')](_0xf753f1)[_0x7721('0x2d')](_0x40f367);};}exports[_0x7721('0x2e')]=function(_0x158d98,_0x1ea4d){var _0x37b9f0={},_0xd7d703={},_0x1da2d8={'count':0x0,'rows':[]};var _0x5c54f0=_[_0x7721('0x2f')](db[_0x7721('0x30')]['rawAttributes'],function(_0x4a25c9){return{'name':_0x4a25c9[_0x7721('0x31')],'type':_0x4a25c9[_0x7721('0x32')]['key']};});_0xd7d703[_0x7721('0x33')]=_[_0x7721('0x2f')](_0x5c54f0,_0x7721('0x34'));_0xd7d703['query']=_[_0x7721('0x35')](_0x158d98[_0x7721('0x36')]);_0xd7d703[_0x7721('0x37')]=_[_0x7721('0x38')](_0xd7d703[_0x7721('0x33')],_0xd7d703['query']);_0x37b9f0[_0x7721('0x39')]=_[_0x7721('0x38')](_0xd7d703[_0x7721('0x33')],qs['fields'](_0x158d98[_0x7721('0x36')][_0x7721('0x3a')]));_0x37b9f0['attributes']=_0x37b9f0[_0x7721('0x39')]['length']?_0x37b9f0[_0x7721('0x39')]:_0xd7d703[_0x7721('0x33')];if(!_0x158d98[_0x7721('0x36')][_0x7721('0x3b')](_0x7721('0x3c'))){_0x37b9f0[_0x7721('0x21')]=qs[_0x7721('0x21')](_0x158d98[_0x7721('0x36')][_0x7721('0x21')]);_0x37b9f0[_0x7721('0x1f')]=qs[_0x7721('0x1f')](_0x158d98['query'][_0x7721('0x1f')]);}_0x37b9f0['order']=qs[_0x7721('0x3d')](_0x158d98[_0x7721('0x36')][_0x7721('0x3d')]);_0x37b9f0[_0x7721('0x3e')]=qs[_0x7721('0x37')](_[_0x7721('0x3f')](_0x158d98['query'],_0xd7d703['filters']),_0x5c54f0);if(_0x158d98['query']['filter']){_0x37b9f0[_0x7721('0x3e')]=_[_0x7721('0x40')](_0x37b9f0[_0x7721('0x3e')],{'$or':_[_0x7721('0x2f')](_0x5c54f0,function(_0x4a90ce){if(_0x4a90ce[_0x7721('0x32')]!=='VIRTUAL'){var _0xfab37b={};_0xfab37b[_0x4a90ce[_0x7721('0x34')]]={'$like':'%'+_0x158d98['query'][_0x7721('0x41')]+'%'};return _0xfab37b;}})});}_0x37b9f0=_[_0x7721('0x40')]({},_0x37b9f0,_0x158d98['options']);var _0x4d0111={'where':_0x37b9f0[_0x7721('0x3e')]};return db[_0x7721('0x30')][_0x7721('0x22')](_0x4d0111)[_0x7721('0x29')](function(_0x577af9){_0x1da2d8[_0x7721('0x22')]=_0x577af9;if(_0x158d98[_0x7721('0x36')][_0x7721('0x42')]){_0x37b9f0[_0x7721('0x43')]=[{'all':!![]}];}return db[_0x7721('0x30')]['findAll'](_0x37b9f0);})[_0x7721('0x29')](function(_0x4a2c28){_0x1da2d8[_0x7721('0x44')]=_0x4a2c28;return _0x1da2d8;})['then'](respondWithFilteredResult(_0x1ea4d,_0x37b9f0))[_0x7721('0x45')](handleError(_0x1ea4d,null));};exports[_0x7721('0x46')]=function(_0x231dad,_0x49e0c5){var _0x1453d4={'raw':!![],'where':{'id':_0x231dad[_0x7721('0x47')]['id']}},_0x11d853={};_0x11d853['model']=_[_0x7721('0x35')](db[_0x7721('0x30')][_0x7721('0x48')]);_0x11d853[_0x7721('0x36')]=_[_0x7721('0x35')](_0x231dad[_0x7721('0x36')]);_0x11d853[_0x7721('0x37')]=_['intersection'](_0x11d853['model'],_0x11d853[_0x7721('0x36')]);_0x1453d4[_0x7721('0x39')]=_[_0x7721('0x38')](_0x11d853[_0x7721('0x33')],qs[_0x7721('0x3a')](_0x231dad[_0x7721('0x36')][_0x7721('0x3a')]));_0x1453d4[_0x7721('0x39')]=_0x1453d4[_0x7721('0x39')][_0x7721('0x49')]?_0x1453d4['attributes']:_0x11d853['model'];if(_0x231dad[_0x7721('0x36')][_0x7721('0x42')]){_0x1453d4[_0x7721('0x43')]=[{'all':!![]}];}_0x1453d4=_[_0x7721('0x40')]({},_0x1453d4,_0x231dad['options']);return db[_0x7721('0x30')][_0x7721('0x4a')](_0x1453d4)['then'](handleEntityNotFound(_0x49e0c5,null))[_0x7721('0x29')](respondWithResult(_0x49e0c5,null))['catch'](handleError(_0x49e0c5,null));};exports[_0x7721('0x4b')]=function(_0x5c6922,_0x334f23){return db[_0x7721('0x30')][_0x7721('0x4b')](_0x5c6922['body'],{})[_0x7721('0x29')](respondWithResult(_0x334f23,0xc9))[_0x7721('0x45')](handleError(_0x334f23,null));};exports['update']=function(_0x223d93,_0x1196c2){if(_0x223d93[_0x7721('0x4c')]['id']){delete _0x223d93['body']['id'];}return db[_0x7721('0x30')]['find']({'where':{'id':_0x223d93[_0x7721('0x47')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x1196c2,null))[_0x7721('0x29')](saveUpdates(_0x223d93[_0x7721('0x4c')],null))[_0x7721('0x29')](respondWithResult(_0x1196c2,null))[_0x7721('0x45')](handleError(_0x1196c2,null));};exports[_0x7721('0x2a')]=function(_0x7fbb73,_0x694d2f){return db[_0x7721('0x30')][_0x7721('0x4a')]({'where':{'id':_0x7fbb73[_0x7721('0x47')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x694d2f,null))[_0x7721('0x29')](removeEntity(_0x694d2f,null))[_0x7721('0x45')](handleError(_0x694d2f,null));};exports['describe']=function(_0x474f32,_0x2f6f30){return db[_0x7721('0x30')][_0x7721('0x4d')]()[_0x7721('0x29')](respondWithResult(_0x2f6f30,null))[_0x7721('0x45')](handleError(_0x2f6f30,null));}; \ No newline at end of file +var _0x9957=['util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','MemberReport','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x2fc69b,_0x55537d){var _0x25e3c9=function(_0x4da4b5){while(--_0x4da4b5){_0x2fc69b['push'](_0x2fc69b['shift']());}};_0x25e3c9(++_0x55537d);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['MemberReport']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['MemberReport'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['MemberReport'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x4ffc8a['params']['id']}})['then'](handleEntityNotFound(_0x19da63,null))['then'](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x4c')]=function(_0x4cf5db,_0x1cd85){return db[_0x7995('0x40')][_0x7995('0x4c')]()[_0x7995('0x26')](respondWithResult(_0x1cd85,null))[_0x7995('0x49')](handleError(_0x1cd85,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 2c7579f..47551f0 100644 --- a/server/api/memberReport/memberReport.model.js +++ b/server/api/memberReport/memberReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9842=['exports','MemberReport','report_member','membername_interface','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x1ebe54,_0xaa4d1b){var _0x481b08=function(_0x490dd6){while(--_0x490dd6){_0x1ebe54['push'](_0x1ebe54['shift']());}};_0x481b08(++_0xaa4d1b);}(_0x9842,0x163));var _0x2984=function(_0x34fb27,_0x24e2fa){_0x34fb27=_0x34fb27-0x0;var _0x3cc5a7=_0x9842[_0x34fb27];return _0x3cc5a7;};'use strict';var _=require(_0x2984('0x0'));var util=require(_0x2984('0x1'));var logger=require(_0x2984('0x2'))(_0x2984('0x3'));var moment=require(_0x2984('0x4'));var BPromise=require(_0x2984('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2984('0x6'));var rimraf=require(_0x2984('0x7'));var config=require(_0x2984('0x8'));var attributes=require('./memberReport.attributes');module[_0x2984('0x9')]=function(_0x3fffac,_0x8fd05e){return _0x3fffac['define'](_0x2984('0xa'),attributes,{'tableName':_0x2984('0xb'),'paranoid':![],'indexes':[{'name':_0x2984('0xc'),'fields':['membername','interface']}],'timestamps':!![]});}; \ No newline at end of file +var _0x3e2f=['request-promise','path','rimraf','./memberReport.attributes','exports','MemberReport','report_member','membername','interface','util','api','bluebird'];(function(_0x164c22,_0x5a7a2d){var _0x293ebb=function(_0x57778a){while(--_0x57778a){_0x164c22['push'](_0x164c22['shift']());}};_0x293ebb(++_0x5a7a2d);}(_0x3e2f,0x99));var _0xf3e2=function(_0x46ae5a,_0x2a38d0){_0x46ae5a=_0x46ae5a-0x0;var _0x434986=_0x3e2f[_0x46ae5a];return _0x434986;};'use strict';var _=require('lodash');var util=require(_0xf3e2('0x0'));var logger=require('../../config/logger')(_0xf3e2('0x1'));var moment=require('moment');var BPromise=require(_0xf3e2('0x2'));var rp=require(_0xf3e2('0x3'));var fs=require('fs');var path=require(_0xf3e2('0x4'));var rimraf=require(_0xf3e2('0x5'));var config=require('../../config/environment');var attributes=require(_0xf3e2('0x6'));module[_0xf3e2('0x7')]=function(_0xd2795d,_0x3a8c29){return _0xd2795d['define'](_0xf3e2('0x8'),attributes,{'tableName':_0xf3e2('0x9'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0xf3e2('0xa'),_0xf3e2('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index ea455e9..38b1c6e 100644 --- a/server/api/memberReport/memberReport.rpc.js +++ b/server/api/memberReport/memberReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2c24=['CreateMemberReport','body','raw','catch','update','UpdateMemberReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','MemberReport,\x20%s,\x20%s','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','error','code','message','result','GetMemberReport','MemberReport','findAll','options','where','limit','map','model','attributes','include','then','debug','stringify'];(function(_0x184421,_0xb6b001){var _0x27eb02=function(_0x120247){while(--_0x120247){_0x184421['push'](_0x184421['shift']());}};_0x27eb02(++_0xb6b001);}(_0x2c24,0x1e6));var _0x42c2=function(_0x1e118e,_0x48c9fc){_0x1e118e=_0x1e118e-0x0;var _0x85990=_0x2c24[_0x1e118e];return _0x85990;};'use strict';var _=require(_0x42c2('0x0'));var util=require(_0x42c2('0x1'));var moment=require(_0x42c2('0x2'));var BPromise=require(_0x42c2('0x3'));var rs=require(_0x42c2('0x4'));var fs=require('fs');var Redis=require(_0x42c2('0x5'));var db=require(_0x42c2('0x6'))['db'];var utils=require(_0x42c2('0x7'));var logger=require(_0x42c2('0x8'))('rpc');var config=require(_0x42c2('0x9'));var jayson=require(_0x42c2('0xa'));var client=jayson['client'][_0x42c2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3825b4,_0x3021e6,_0x421017){return new BPromise(function(_0xc451c3,_0x286a63){return client[_0x42c2('0xc')](_0x3825b4,_0x421017)['then'](function(_0x4f259f){logger[_0x42c2('0xd')](_0x42c2('0xe'),_0x3021e6,_0x42c2('0xf'));logger['debug'](_0x42c2('0x10'),_0x3021e6,_0x42c2('0xf'),JSON['stringify'](_0x4f259f));if(_0x4f259f['error']){if(_0x4f259f[_0x42c2('0x11')][_0x42c2('0x12')]===0x1f4){logger['error']('MemberReport,\x20%s,\x20%s',_0x3021e6,_0x4f259f[_0x42c2('0x11')][_0x42c2('0x13')]);return _0x286a63(_0x4f259f['error'][_0x42c2('0x13')]);}logger[_0x42c2('0x11')](_0x42c2('0xe'),_0x3021e6,_0x4f259f[_0x42c2('0x11')][_0x42c2('0x13')]);return _0xc451c3(_0x4f259f[_0x42c2('0x11')][_0x42c2('0x13')]);}else{logger[_0x42c2('0xd')](_0x42c2('0xe'),_0x3021e6,_0x42c2('0xf'));_0xc451c3(_0x4f259f[_0x42c2('0x14')][_0x42c2('0x13')]);}})['catch'](function(_0x5a08e4){logger[_0x42c2('0x11')]('MemberReport,\x20%s,\x20%s',_0x3021e6,_0x5a08e4);_0x286a63(_0x5a08e4);});});}exports[_0x42c2('0x15')]=function(_0x54d00b){var _0x1833eb=this;return new Promise(function(_0x102116,_0x5747b8){return db[_0x42c2('0x16')][_0x42c2('0x17')]({'raw':_0x54d00b[_0x42c2('0x18')]?_0x54d00b['options']['raw']===undefined?!![]:![]:!![],'where':_0x54d00b[_0x42c2('0x18')]?_0x54d00b[_0x42c2('0x18')][_0x42c2('0x19')]||null:null,'attributes':_0x54d00b['options']?_0x54d00b[_0x42c2('0x18')]['attributes']||null:null,'limit':_0x54d00b[_0x42c2('0x18')]?_0x54d00b[_0x42c2('0x18')][_0x42c2('0x1a')]||null:null,'include':_0x54d00b[_0x42c2('0x18')]?_0x54d00b['options']['include']?_[_0x42c2('0x1b')](_0x54d00b['options']['include'],function(_0x3b4924){return{'model':db[_0x3b4924[_0x42c2('0x1c')]],'as':_0x3b4924['as'],'attributes':_0x3b4924[_0x42c2('0x1d')],'include':_0x3b4924['include']?_['map'](_0x3b4924[_0x42c2('0x1e')],function(_0xecd1fd){return{'model':db[_0xecd1fd[_0x42c2('0x1c')]],'as':_0xecd1fd['as'],'attributes':_0xecd1fd[_0x42c2('0x1d')],'include':_0xecd1fd[_0x42c2('0x1e')]?_[_0x42c2('0x1b')](_0xecd1fd[_0x42c2('0x1e')],function(_0x4f0a52){return{'model':db[_0x4f0a52[_0x42c2('0x1c')]],'as':_0x4f0a52['as'],'attributes':_0x4f0a52[_0x42c2('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x42c2('0x1f')](function(_0x31138d){logger[_0x42c2('0xd')](_0x42c2('0x15'),_0x54d00b);logger[_0x42c2('0x20')](_0x42c2('0x15'),_0x54d00b,JSON[_0x42c2('0x21')](_0x31138d));_0x102116(_0x31138d);})['catch'](function(_0x14bc19){logger[_0x42c2('0x11')](_0x42c2('0x15'),_0x14bc19[_0x42c2('0x13')],_0x54d00b);_0x5747b8(_0x1833eb[_0x42c2('0x11')](0x1f4,_0x14bc19[_0x42c2('0x13')]));});});};exports[_0x42c2('0x22')]=function(_0x31da44){var _0x399cc1=this;return new Promise(function(_0x2714f3,_0x36ff88){return db[_0x42c2('0x16')]['create'](_0x31da44[_0x42c2('0x23')],{'raw':_0x31da44[_0x42c2('0x18')]?_0x31da44[_0x42c2('0x18')][_0x42c2('0x24')]===undefined?!![]:![]:!![]})[_0x42c2('0x1f')](function(_0x54b164){logger['info'](_0x42c2('0x22'),_0x31da44);logger['debug'](_0x42c2('0x22'),_0x31da44,JSON['stringify'](_0x54b164));_0x2714f3(_0x54b164);})[_0x42c2('0x25')](function(_0x2983ab){logger[_0x42c2('0x11')](_0x42c2('0x22'),_0x2983ab[_0x42c2('0x13')],_0x31da44);_0x36ff88(_0x399cc1[_0x42c2('0x11')](0x1f4,_0x2983ab['message']));});});};exports['UpdateMemberReport']=function(_0x1ddd53){var _0x5d5b3a=this;return new Promise(function(_0xdde835,_0x30dcc0){return db['MemberReport'][_0x42c2('0x26')](_0x1ddd53[_0x42c2('0x23')],{'raw':_0x1ddd53[_0x42c2('0x18')]?_0x1ddd53[_0x42c2('0x18')][_0x42c2('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ddd53[_0x42c2('0x18')]?_0x1ddd53[_0x42c2('0x18')][_0x42c2('0x19')]||null:null,'attributes':_0x1ddd53[_0x42c2('0x18')]?_0x1ddd53[_0x42c2('0x18')]['attributes']||null:null,'limit':_0x1ddd53[_0x42c2('0x18')]?_0x1ddd53[_0x42c2('0x18')][_0x42c2('0x1a')]||null:null})['then'](function(_0x4d591c){logger[_0x42c2('0xd')](_0x42c2('0x27'),_0x1ddd53);logger['debug'](_0x42c2('0x27'),_0x1ddd53,JSON[_0x42c2('0x21')](_0x4d591c));_0xdde835(_0x4d591c);})[_0x42c2('0x25')](function(_0xe55d78){logger['error'](_0x42c2('0x27'),_0xe55d78['message'],_0x1ddd53);_0x30dcc0(_0x5d5b3a[_0x42c2('0x11')](0x1f4,_0xe55d78[_0x42c2('0x13')]));});});}; \ No newline at end of file +var _0x22da=['GetMemberReport','MemberReport','findAll','options','raw','attributes','include','model','map','then','CreateMemberReport','create','body','stringify','update','where','UpdateMemberReport','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','error','code','MemberReport,\x20%s,\x20%s','message','result','catch'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x22da,0x80));var _0xa22d=function(_0x239804,_0x557d8e){_0x239804=_0x239804-0x0;var _0x1043ed=_0x22da[_0x239804];return _0x1043ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa22d('0x0'));var BPromise=require(_0xa22d('0x1'));var rs=require(_0xa22d('0x2'));var fs=require('fs');var Redis=require(_0xa22d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa22d('0x4'));var logger=require(_0xa22d('0x5'))(_0xa22d('0x6'));var config=require(_0xa22d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa22d('0x8')][_0xa22d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c67ad,_0x215529,_0x44a5c7){return new BPromise(function(_0x5678bc,_0x186e5c){return client['request'](_0x4c67ad,_0x44a5c7)['then'](function(_0x15f0bd){logger[_0xa22d('0xa')]('MemberReport,\x20%s,\x20%s',_0x215529,_0xa22d('0xb'));logger[_0xa22d('0xc')](_0xa22d('0xd'),_0x215529,_0xa22d('0xb'),JSON['stringify'](_0x15f0bd));if(_0x15f0bd['error']){if(_0x15f0bd[_0xa22d('0xe')][_0xa22d('0xf')]===0x1f4){logger['error'](_0xa22d('0x10'),_0x215529,_0x15f0bd['error'][_0xa22d('0x11')]);return _0x186e5c(_0x15f0bd[_0xa22d('0xe')][_0xa22d('0x11')]);}logger['error'](_0xa22d('0x10'),_0x215529,_0x15f0bd[_0xa22d('0xe')][_0xa22d('0x11')]);return _0x5678bc(_0x15f0bd[_0xa22d('0xe')][_0xa22d('0x11')]);}else{logger['info'](_0xa22d('0x10'),_0x215529,_0xa22d('0xb'));_0x5678bc(_0x15f0bd[_0xa22d('0x12')][_0xa22d('0x11')]);}})[_0xa22d('0x13')](function(_0x2159e1){logger[_0xa22d('0xe')](_0xa22d('0x10'),_0x215529,_0x2159e1);_0x186e5c(_0x2159e1);});});}exports[_0xa22d('0x14')]=function(_0x3d78b9){var _0xf50354=this;return new Promise(function(_0x1ed22e,_0x39c2bf){return db[_0xa22d('0x15')][_0xa22d('0x16')]({'raw':_0x3d78b9[_0xa22d('0x17')]?_0x3d78b9['options'][_0xa22d('0x18')]===undefined?!![]:![]:!![],'where':_0x3d78b9[_0xa22d('0x17')]?_0x3d78b9[_0xa22d('0x17')]['where']||null:null,'attributes':_0x3d78b9['options']?_0x3d78b9['options'][_0xa22d('0x19')]||null:null,'limit':_0x3d78b9[_0xa22d('0x17')]?_0x3d78b9[_0xa22d('0x17')]['limit']||null:null,'include':_0x3d78b9[_0xa22d('0x17')]?_0x3d78b9[_0xa22d('0x17')][_0xa22d('0x1a')]?_['map'](_0x3d78b9[_0xa22d('0x17')][_0xa22d('0x1a')],function(_0x502219){return{'model':db[_0x502219[_0xa22d('0x1b')]],'as':_0x502219['as'],'attributes':_0x502219[_0xa22d('0x19')],'include':_0x502219[_0xa22d('0x1a')]?_[_0xa22d('0x1c')](_0x502219[_0xa22d('0x1a')],function(_0x1c83e8){return{'model':db[_0x1c83e8[_0xa22d('0x1b')]],'as':_0x1c83e8['as'],'attributes':_0x1c83e8['attributes'],'include':_0x1c83e8['include']?_[_0xa22d('0x1c')](_0x1c83e8[_0xa22d('0x1a')],function(_0x2fe9e0){return{'model':db[_0x2fe9e0[_0xa22d('0x1b')]],'as':_0x2fe9e0['as'],'attributes':_0x2fe9e0[_0xa22d('0x19')]};}):[]};}):[]};}):[]:[]})[_0xa22d('0x1d')](function(_0x2ff235){logger[_0xa22d('0xa')](_0xa22d('0x14'),_0x3d78b9);logger[_0xa22d('0xc')](_0xa22d('0x14'),_0x3d78b9,JSON['stringify'](_0x2ff235));_0x1ed22e(_0x2ff235);})[_0xa22d('0x13')](function(_0x4d460f){logger['error'](_0xa22d('0x14'),_0x4d460f[_0xa22d('0x11')],_0x3d78b9);_0x39c2bf(_0xf50354[_0xa22d('0xe')](0x1f4,_0x4d460f[_0xa22d('0x11')]));});});};exports[_0xa22d('0x1e')]=function(_0x1892f8){var _0x1ef634=this;return new Promise(function(_0x384a4e,_0x5d9cc6){return db[_0xa22d('0x15')][_0xa22d('0x1f')](_0x1892f8[_0xa22d('0x20')],{'raw':_0x1892f8[_0xa22d('0x17')]?_0x1892f8[_0xa22d('0x17')][_0xa22d('0x18')]===undefined?!![]:![]:!![]})[_0xa22d('0x1d')](function(_0x70f222){logger[_0xa22d('0xa')](_0xa22d('0x1e'),_0x1892f8);logger['debug'](_0xa22d('0x1e'),_0x1892f8,JSON[_0xa22d('0x21')](_0x70f222));_0x384a4e(_0x70f222);})[_0xa22d('0x13')](function(_0x3977ef){logger[_0xa22d('0xe')](_0xa22d('0x1e'),_0x3977ef['message'],_0x1892f8);_0x5d9cc6(_0x1ef634[_0xa22d('0xe')](0x1f4,_0x3977ef[_0xa22d('0x11')]));});});};exports['UpdateMemberReport']=function(_0xd95fe4){var _0x4eb40d=this;return new Promise(function(_0x3e8859,_0x51b9a3){return db['MemberReport'][_0xa22d('0x22')](_0xd95fe4['body'],{'raw':_0xd95fe4[_0xa22d('0x17')]?_0xd95fe4[_0xa22d('0x17')][_0xa22d('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd95fe4[_0xa22d('0x17')]?_0xd95fe4[_0xa22d('0x17')][_0xa22d('0x23')]||null:null,'attributes':_0xd95fe4[_0xa22d('0x17')]?_0xd95fe4[_0xa22d('0x17')]['attributes']||null:null,'limit':_0xd95fe4[_0xa22d('0x17')]?_0xd95fe4[_0xa22d('0x17')]['limit']||null:null})[_0xa22d('0x1d')](function(_0x33c0d0){logger['info']('UpdateMemberReport',_0xd95fe4);logger[_0xa22d('0xc')](_0xa22d('0x24'),_0xd95fe4,JSON[_0xa22d('0x21')](_0x33c0d0));_0x3e8859(_0x33c0d0);})[_0xa22d('0x13')](function(_0x265536){logger[_0xa22d('0xe')](_0xa22d('0x24'),_0x265536[_0xa22d('0x11')],_0xd95fe4);_0x51b9a3(_0x4eb40d[_0xa22d('0xe')](0x1f4,_0x265536[_0xa22d('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 2a0c675..d91855b 100644 --- a/server/api/migration/index.js +++ b/server/api/migration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x322d=['./migration.controller','get','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x322d,0x121));var _0xd322=function(_0x617084,_0x27a65f){_0x617084=_0x617084-0x0;var _0x384ac0=_0x322d[_0x617084];return _0x384ac0;};'use strict';var multer=require(_0xd322('0x0'));var util=require('util');var path=require(_0xd322('0x1'));var timeout=require('connect-timeout');var express=require(_0xd322('0x2'));var router=express[_0xd322('0x3')]();var fs_extra=require(_0xd322('0x4'));var auth=require(_0xd322('0x5'));var interaction=require(_0xd322('0x6'));var config=require(_0xd322('0x7'));var controller=require(_0xd322('0x8'));router[_0xd322('0x9')]('/',controller['index']);module[_0xd322('0xa')]=router; \ No newline at end of file +var _0xaeba=['./migration.controller','index','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x549746,_0xfcdd1c){var _0x5eb4e0=function(_0x1a732b){while(--_0x1a732b){_0x549746['push'](_0x549746['shift']());}};_0x5eb4e0(++_0xfcdd1c);}(_0xaeba,0x1cf));var _0xaaeb=function(_0x565721,_0x5311ac){_0x565721=_0x565721-0x0;var _0x2d68ce=_0xaeba[_0x565721];return _0x2d68ce;};'use strict';var multer=require(_0xaaeb('0x0'));var util=require(_0xaaeb('0x1'));var path=require(_0xaaeb('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xaaeb('0x3')]();var fs_extra=require(_0xaaeb('0x4'));var auth=require(_0xaaeb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xaaeb('0x6'));var controller=require(_0xaaeb('0x7'));router['get']('/',controller[_0xaaeb('0x8')]);module[_0xaaeb('0x9')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 5b31a19..62546aa 100644 --- a/server/api/migration/migration.attributes.js +++ b/server/api/migration/migration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7bc0=['sequelize','exports','version'];(function(_0x11ed49,_0x26c4f6){var _0x5e41dd=function(_0x36dbe8){while(--_0x36dbe8){_0x11ed49['push'](_0x11ed49['shift']());}};_0x5e41dd(++_0x26c4f6);}(_0x7bc0,0x93));var _0x07bc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7bc0[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x07bc('0x0'));module[_0x07bc('0x1')]={'version':{'type':Sequelize['STRING'],'unique':_0x07bc('0x2')}}; \ No newline at end of file +var _0x1139=['sequelize','exports'];(function(_0x4b0342,_0x5b071c){var _0xc62aa3=function(_0x501b2e){while(--_0x501b2e){_0x4b0342['push'](_0x4b0342['shift']());}};_0xc62aa3(++_0x5b071c);}(_0x1139,0xce));var _0x9113=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x1139[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0x9113('0x0'));module[_0x9113('0x1')]={'version':{'type':Sequelize['STRING'],'unique':'version'}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 0496b58..a7efebe 100644 --- a/server/api/migration/migration.controller.js +++ b/server/api/migration/migration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6fb2=['error','stack','name','send','index','map','Migration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','squel','crypto','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x6fb2,0x15d));var _0x26fb=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x6fb2[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x26fb('0x0'));var zipdir=require(_0x26fb('0x1'));var jsonpatch=require(_0x26fb('0x2'));var rp=require(_0x26fb('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x26fb('0x4'));var util=require('util');var path=require(_0x26fb('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x26fb('0x6'));var crypto=require(_0x26fb('0x7'));var jsforce=require('jsforce');var deskjs=require(_0x26fb('0x8'));var toCsv=require(_0x26fb('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x26fb('0xa'));var authService=require(_0x26fb('0xb'));var qs=require(_0x26fb('0xc'));var as=require(_0x26fb('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x26fb('0xe'))('api');var utils=require(_0x26fb('0xf'));var config=require(_0x26fb('0x10'));var licenseUtil=require(_0x26fb('0x11'));var db=require(_0x26fb('0x12'))['db'];function respondWithStatusCode(_0x2487a7,_0x4c9b0d){_0x4c9b0d=_0x4c9b0d||0xcc;return function(_0x14313c){if(_0x14313c){return _0x2487a7['sendStatus'](_0x4c9b0d);}return _0x2487a7[_0x26fb('0x13')](_0x4c9b0d)['end']();};}function respondWithResult(_0x5ce3fd,_0x276aa0){_0x276aa0=_0x276aa0||0xc8;return function(_0x318325){if(_0x318325){return _0x5ce3fd[_0x26fb('0x13')](_0x276aa0)[_0x26fb('0x14')](_0x318325);}};}function respondWithFilteredResult(_0x57e894,_0x5a8035){return function(_0x4ffd42){if(_0x4ffd42){var _0x50bd11=typeof _0x5a8035[_0x26fb('0x15')]===_0x26fb('0x16')&&typeof _0x5a8035['limit']===_0x26fb('0x16');var _0x372afa=_0x4ffd42[_0x26fb('0x17')];var _0x757a38=_0x50bd11?0x0:_0x5a8035[_0x26fb('0x15')];var _0x5bed57=_0x50bd11?_0x4ffd42[_0x26fb('0x17')]:_0x5a8035['offset']+_0x5a8035[_0x26fb('0x18')];var _0x759db3;if(_0x5bed57>=_0x372afa){_0x5bed57=_0x372afa;_0x759db3=0xc8;}else{_0x759db3=0xce;}_0x57e894[_0x26fb('0x13')](_0x759db3);return _0x57e894[_0x26fb('0x19')](_0x26fb('0x1a'),_0x757a38+'-'+_0x5bed57+'/'+_0x372afa)[_0x26fb('0x14')](_0x4ffd42);}return null;};}function patchUpdates(_0x2128f1){return function(_0x38b7ba){try{jsonpatch[_0x26fb('0x1b')](_0x38b7ba,_0x2128f1,!![]);}catch(_0x1373ec){return BPromise[_0x26fb('0x1c')](_0x1373ec);}return _0x38b7ba[_0x26fb('0x1d')]();};}function saveUpdates(_0x3ac092,_0x4afcfe){return function(_0x17123a){if(_0x17123a){return _0x17123a[_0x26fb('0x1e')](_0x3ac092)[_0x26fb('0x1f')](function(_0x108b87){return _0x108b87;});}return null;};}function removeEntity(_0x1ee2c6,_0x4cb306){return function(_0x306bee){if(_0x306bee){return _0x306bee[_0x26fb('0x20')]()['then'](function(){_0x1ee2c6[_0x26fb('0x13')](0xcc)[_0x26fb('0x21')]();});}};}function handleEntityNotFound(_0x45d673,_0x529b00){return function(_0x42b898){if(!_0x42b898){_0x45d673[_0x26fb('0x22')](0x194);}return _0x42b898;};}function handleError(_0x2cf611,_0x34ab51){_0x34ab51=_0x34ab51||0x1f4;return function(_0x4ee88d){logger[_0x26fb('0x23')](_0x4ee88d[_0x26fb('0x24')]);if(_0x4ee88d['name']){delete _0x4ee88d[_0x26fb('0x25')];}_0x2cf611['status'](_0x34ab51)[_0x26fb('0x26')](_0x4ee88d);};}exports[_0x26fb('0x27')]=function(_0x3d63d2,_0x432afe){var _0x4e3de2={},_0x624d3a={},_0x415e3d={'count':0x0,'rows':[]};var _0x39d78d=_[_0x26fb('0x28')](db[_0x26fb('0x29')][_0x26fb('0x2a')],function(_0x47e470){return{'name':_0x47e470[_0x26fb('0x2b')],'type':_0x47e470[_0x26fb('0x2c')]['key']};});_0x624d3a[_0x26fb('0x2d')]=_[_0x26fb('0x28')](_0x39d78d,'name');_0x624d3a[_0x26fb('0x2e')]=_[_0x26fb('0x2f')](_0x3d63d2['query']);_0x624d3a[_0x26fb('0x30')]=_[_0x26fb('0x31')](_0x624d3a[_0x26fb('0x2d')],_0x624d3a[_0x26fb('0x2e')]);_0x4e3de2[_0x26fb('0x32')]=_[_0x26fb('0x31')](_0x624d3a[_0x26fb('0x2d')],qs[_0x26fb('0x33')](_0x3d63d2['query'][_0x26fb('0x33')]));_0x4e3de2['attributes']=_0x4e3de2[_0x26fb('0x32')]['length']?_0x4e3de2[_0x26fb('0x32')]:_0x624d3a[_0x26fb('0x2d')];if(!_0x3d63d2[_0x26fb('0x2e')]['hasOwnProperty'](_0x26fb('0x34'))){_0x4e3de2[_0x26fb('0x18')]=qs[_0x26fb('0x18')](_0x3d63d2[_0x26fb('0x2e')][_0x26fb('0x18')]);_0x4e3de2[_0x26fb('0x15')]=qs[_0x26fb('0x15')](_0x3d63d2['query'][_0x26fb('0x15')]);}_0x4e3de2[_0x26fb('0x35')]=qs[_0x26fb('0x36')](_0x3d63d2['query'][_0x26fb('0x36')]);_0x4e3de2[_0x26fb('0x37')]=qs[_0x26fb('0x30')](_['pick'](_0x3d63d2[_0x26fb('0x2e')],_0x624d3a['filters']),_0x39d78d);if(_0x3d63d2[_0x26fb('0x2e')]['filter']){_0x4e3de2[_0x26fb('0x37')]=_['merge'](_0x4e3de2[_0x26fb('0x37')],{'$or':_[_0x26fb('0x28')](_0x39d78d,function(_0x148597){if(_0x148597[_0x26fb('0x2c')]!==_0x26fb('0x38')){var _0x5c85db={};_0x5c85db[_0x148597[_0x26fb('0x25')]]={'$like':'%'+_0x3d63d2[_0x26fb('0x2e')][_0x26fb('0x39')]+'%'};return _0x5c85db;}})});}_0x4e3de2=_[_0x26fb('0x3a')]({},_0x4e3de2,_0x3d63d2[_0x26fb('0x3b')]);var _0x1314c5={'where':_0x4e3de2[_0x26fb('0x37')]};return db[_0x26fb('0x29')][_0x26fb('0x17')](_0x1314c5)[_0x26fb('0x1f')](function(_0x3c075b){_0x415e3d[_0x26fb('0x17')]=_0x3c075b;if(_0x3d63d2['query'][_0x26fb('0x3c')]){_0x4e3de2[_0x26fb('0x3d')]=[{'all':!![]}];}return db[_0x26fb('0x29')][_0x26fb('0x3e')](_0x4e3de2);})[_0x26fb('0x1f')](function(_0x4f0682){_0x415e3d[_0x26fb('0x3f')]=_0x4f0682;return _0x415e3d;})[_0x26fb('0x1f')](respondWithFilteredResult(_0x432afe,_0x4e3de2))['catch'](handleError(_0x432afe,null));}; \ No newline at end of file +var _0xe106=['json','undefined','count','offset','limit','set','Content-Range','apply','update','then','destroy','name','send','index','map','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','Migration','findAll','rows','catch','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x1772a3,_0xda694f){var _0x3f20b1=function(_0x2b6d7b){while(--_0x2b6d7b){_0x1772a3['push'](_0x1772a3['shift']());}};_0x3f20b1(++_0xda694f);}(_0xe106,0x12f));var _0x6e10=function(_0x520e16,_0x545cb6){_0x520e16=_0x520e16-0x0;var _0x4771b5=_0xe106[_0x520e16];return _0x4771b5;};'use strict';var emlformat=require(_0x6e10('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6e10('0x1'));var rp=require(_0x6e10('0x2'));var moment=require(_0x6e10('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6e10('0x4'));var util=require(_0x6e10('0x5'));var path=require(_0x6e10('0x6'));var sox=require(_0x6e10('0x7'));var csv=require(_0x6e10('0x8'));var ejs=require(_0x6e10('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6e10('0xa'));var squel=require(_0x6e10('0xb'));var crypto=require(_0x6e10('0xc'));var jsforce=require(_0x6e10('0xd'));var deskjs=require(_0x6e10('0xe'));var toCsv=require(_0x6e10('0x8'));var querystring=require(_0x6e10('0xf'));var Papa=require(_0x6e10('0x10'));var Redis=require(_0x6e10('0x11'));var authService=require(_0x6e10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6e10('0x13'))(_0x6e10('0x14'));var utils=require(_0x6e10('0x15'));var config=require(_0x6e10('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x6e10('0x17'))['db'];function respondWithStatusCode(_0x2c8087,_0x596116){_0x596116=_0x596116||0xcc;return function(_0x3d261d){if(_0x3d261d){return _0x2c8087[_0x6e10('0x18')](_0x596116);}return _0x2c8087[_0x6e10('0x19')](_0x596116)[_0x6e10('0x1a')]();};}function respondWithResult(_0xfec2,_0x204cba){_0x204cba=_0x204cba||0xc8;return function(_0x3bd24c){if(_0x3bd24c){return _0xfec2[_0x6e10('0x19')](_0x204cba)[_0x6e10('0x1b')](_0x3bd24c);}};}function respondWithFilteredResult(_0x31ee91,_0x576053){return function(_0x1529bd){if(_0x1529bd){var _0x37f37a=typeof _0x576053['offset']===_0x6e10('0x1c')&&typeof _0x576053['limit']===_0x6e10('0x1c');var _0x2f496c=_0x1529bd[_0x6e10('0x1d')];var _0x6e08b2=_0x37f37a?0x0:_0x576053['offset'];var _0x1c333c=_0x37f37a?_0x1529bd[_0x6e10('0x1d')]:_0x576053[_0x6e10('0x1e')]+_0x576053[_0x6e10('0x1f')];var _0x7ae680;if(_0x1c333c>=_0x2f496c){_0x1c333c=_0x2f496c;_0x7ae680=0xc8;}else{_0x7ae680=0xce;}_0x31ee91['status'](_0x7ae680);return _0x31ee91[_0x6e10('0x20')](_0x6e10('0x21'),_0x6e08b2+'-'+_0x1c333c+'/'+_0x2f496c)[_0x6e10('0x1b')](_0x1529bd);}return null;};}function patchUpdates(_0x3d9197){return function(_0x5328d1){try{jsonpatch[_0x6e10('0x22')](_0x5328d1,_0x3d9197,!![]);}catch(_0x4f38d4){return BPromise['reject'](_0x4f38d4);}return _0x5328d1['save']();};}function saveUpdates(_0x2e7394,_0x36bed7){return function(_0x389f4f){if(_0x389f4f){return _0x389f4f[_0x6e10('0x23')](_0x2e7394)[_0x6e10('0x24')](function(_0x4beb53){return _0x4beb53;});}return null;};}function removeEntity(_0x519eec,_0x5cb7b4){return function(_0x2c493b){if(_0x2c493b){return _0x2c493b[_0x6e10('0x25')]()[_0x6e10('0x24')](function(){_0x519eec['status'](0xcc)[_0x6e10('0x1a')]();});}};}function handleEntityNotFound(_0x466752,_0x248471){return function(_0x75a993){if(!_0x75a993){_0x466752[_0x6e10('0x18')](0x194);}return _0x75a993;};}function handleError(_0x37bda1,_0xfd810d){_0xfd810d=_0xfd810d||0x1f4;return function(_0x5d99a0){logger['error'](_0x5d99a0['stack']);if(_0x5d99a0[_0x6e10('0x26')]){delete _0x5d99a0[_0x6e10('0x26')];}_0x37bda1[_0x6e10('0x19')](_0xfd810d)[_0x6e10('0x27')](_0x5d99a0);};}exports[_0x6e10('0x28')]=function(_0x464689,_0x5d8539){var _0x30e266={},_0x35114={},_0x2a0d54={'count':0x0,'rows':[]};var _0x3d6f88=_[_0x6e10('0x29')](db['Migration']['rawAttributes'],function(_0x30f7e4){return{'name':_0x30f7e4[_0x6e10('0x2a')],'type':_0x30f7e4[_0x6e10('0x2b')][_0x6e10('0x2c')]};});_0x35114[_0x6e10('0x2d')]=_[_0x6e10('0x29')](_0x3d6f88,_0x6e10('0x26'));_0x35114['query']=_[_0x6e10('0x2e')](_0x464689[_0x6e10('0x2f')]);_0x35114[_0x6e10('0x30')]=_[_0x6e10('0x31')](_0x35114[_0x6e10('0x2d')],_0x35114['query']);_0x30e266[_0x6e10('0x32')]=_[_0x6e10('0x31')](_0x35114[_0x6e10('0x2d')],qs[_0x6e10('0x33')](_0x464689[_0x6e10('0x2f')][_0x6e10('0x33')]));_0x30e266[_0x6e10('0x32')]=_0x30e266[_0x6e10('0x32')][_0x6e10('0x34')]?_0x30e266[_0x6e10('0x32')]:_0x35114['model'];if(!_0x464689[_0x6e10('0x2f')][_0x6e10('0x35')](_0x6e10('0x36'))){_0x30e266[_0x6e10('0x1f')]=qs[_0x6e10('0x1f')](_0x464689[_0x6e10('0x2f')][_0x6e10('0x1f')]);_0x30e266[_0x6e10('0x1e')]=qs[_0x6e10('0x1e')](_0x464689[_0x6e10('0x2f')]['offset']);}_0x30e266['order']=qs[_0x6e10('0x37')](_0x464689[_0x6e10('0x2f')]['sort']);_0x30e266[_0x6e10('0x38')]=qs['filters'](_['pick'](_0x464689[_0x6e10('0x2f')],_0x35114[_0x6e10('0x30')]),_0x3d6f88);if(_0x464689[_0x6e10('0x2f')][_0x6e10('0x39')]){_0x30e266[_0x6e10('0x38')]=_[_0x6e10('0x3a')](_0x30e266[_0x6e10('0x38')],{'$or':_[_0x6e10('0x29')](_0x3d6f88,function(_0x5259a7){if(_0x5259a7[_0x6e10('0x2b')]!=='VIRTUAL'){var _0x56ed1b={};_0x56ed1b[_0x5259a7[_0x6e10('0x26')]]={'$like':'%'+_0x464689[_0x6e10('0x2f')][_0x6e10('0x39')]+'%'};return _0x56ed1b;}})});}_0x30e266=_[_0x6e10('0x3a')]({},_0x30e266,_0x464689[_0x6e10('0x3b')]);var _0xf122f2={'where':_0x30e266[_0x6e10('0x38')]};return db['Migration']['count'](_0xf122f2)[_0x6e10('0x24')](function(_0x13efa2){_0x2a0d54[_0x6e10('0x1d')]=_0x13efa2;if(_0x464689[_0x6e10('0x2f')][_0x6e10('0x3c')]){_0x30e266[_0x6e10('0x3d')]=[{'all':!![]}];}return db[_0x6e10('0x3e')][_0x6e10('0x3f')](_0x30e266);})[_0x6e10('0x24')](function(_0x3dc7fb){_0x2a0d54[_0x6e10('0x40')]=_0x3dc7fb;return _0x2a0d54;})[_0x6e10('0x24')](respondWithFilteredResult(_0x5d8539,_0x30e266))[_0x6e10('0x41')](handleError(_0x5d8539,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index f525c03..890c05c 100644 --- a/server/api/migration/migration.model.js +++ b/server/api/migration/migration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['bluebird','path','rimraf','./migration.attributes','define','migrations','util','../../config/logger','api','moment'];(function(_0x3298a7,_0xe22061){var _0x163260=function(_0x10670e){while(--_0x10670e){_0x3298a7['push'](_0x3298a7['shift']());}};_0x163260(++_0xe22061);}(_0xbaf0,0x132));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0baf('0x5'));var rimraf=require(_0x0baf('0x6'));var config=require('../../config/environment');var attributes=require(_0x0baf('0x7'));module['exports']=function(_0x1542c7,_0x2e4fd2){return _0x1542c7[_0x0baf('0x8')]('Migration',attributes,{'tableName':_0x0baf('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8f33=['path','rimraf','./migration.attributes','exports','Migration','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x531cb8,_0x8ef36f){var _0x5cf297=function(_0x45acb4){while(--_0x45acb4){_0x531cb8['push'](_0x531cb8['shift']());}};_0x5cf297(++_0x8ef36f);}(_0x8f33,0xd6));var _0x38f3=function(_0x4393f1,_0x414f2f){_0x4393f1=_0x4393f1-0x0;var _0x35b28e=_0x8f33[_0x4393f1];return _0x35b28e;};'use strict';var _=require(_0x38f3('0x0'));var util=require('util');var logger=require(_0x38f3('0x1'))(_0x38f3('0x2'));var moment=require(_0x38f3('0x3'));var BPromise=require(_0x38f3('0x4'));var rp=require(_0x38f3('0x5'));var fs=require('fs');var path=require(_0x38f3('0x6'));var rimraf=require(_0x38f3('0x7'));var config=require('../../config/environment');var attributes=require(_0x38f3('0x8'));module[_0x38f3('0x9')]=function(_0x2969a8,_0x4de62e){return _0x2969a8['define'](_0x38f3('0xa'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 7ec5fff..b9ebcfc 100644 --- a/server/api/migration/migration.rpc.js +++ b/server/api/migration/migration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x61a5=['rpc','../../config/environment','jayson/promise','client','http','then','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x286ee,_0x3bebf5){var _0x111b9e=function(_0x2b768b){while(--_0x2b768b){_0x286ee['push'](_0x286ee['shift']());}};_0x111b9e(++_0x3bebf5);}(_0x61a5,0x19e));var _0x561a=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x61a5[_0x51020b];return _0x371e47;};'use strict';var _=require(_0x561a('0x0'));var util=require('util');var moment=require(_0x561a('0x1'));var BPromise=require(_0x561a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x561a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x561a('0x4'));var logger=require(_0x561a('0x5'))(_0x561a('0x6'));var config=require(_0x561a('0x7'));var jayson=require(_0x561a('0x8'));var client=jayson[_0x561a('0x9')][_0x561a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a763a,_0x4c2853,_0x3d020c){return new BPromise(function(_0x27e026,_0xe056b2){return client['request'](_0x2a763a,_0x3d020c)[_0x561a('0xb')](function(_0x2a0fdb){logger['info'](_0x561a('0xc'),_0x4c2853,_0x561a('0xd'));logger[_0x561a('0xe')](_0x561a('0xf'),_0x4c2853,'request\x20sent',JSON['stringify'](_0x2a0fdb));if(_0x2a0fdb[_0x561a('0x10')]){if(_0x2a0fdb[_0x561a('0x10')][_0x561a('0x11')]===0x1f4){logger[_0x561a('0x10')](_0x561a('0xc'),_0x4c2853,_0x2a0fdb[_0x561a('0x10')][_0x561a('0x12')]);return _0xe056b2(_0x2a0fdb[_0x561a('0x10')]['message']);}logger[_0x561a('0x10')](_0x561a('0xc'),_0x4c2853,_0x2a0fdb[_0x561a('0x10')][_0x561a('0x12')]);return _0x27e026(_0x2a0fdb['error'][_0x561a('0x12')]);}else{logger['info'](_0x561a('0xc'),_0x4c2853,_0x561a('0xd'));_0x27e026(_0x2a0fdb[_0x561a('0x13')][_0x561a('0x12')]);}})[_0x561a('0x14')](function(_0xb777ee){logger['error']('Migration,\x20%s,\x20%s',_0x4c2853,_0xb777ee);_0xe056b2(_0xb777ee);});});} \ No newline at end of file +var _0x1be1=['stringify','error','code','message','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','Migration,\x20%s,\x20%s','debug','Migration,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x46a38b,_0x16ffb5){var _0x346e75=function(_0x34f8d0){while(--_0x34f8d0){_0x46a38b['push'](_0x46a38b['shift']());}};_0x346e75(++_0x16ffb5);}(_0x1be1,0x192));var _0x11be=function(_0x2de2f3,_0x5e128c){_0x2de2f3=_0x2de2f3-0x0;var _0x1842ea=_0x1be1[_0x2de2f3];return _0x1842ea;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x11be('0x0'));var BPromise=require(_0x11be('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x11be('0x2'));var db=require(_0x11be('0x3'))['db'];var utils=require(_0x11be('0x4'));var logger=require(_0x11be('0x5'))('rpc');var config=require(_0x11be('0x6'));var jayson=require(_0x11be('0x7'));var client=jayson[_0x11be('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfe8c62,_0x497730,_0x18f661){return new BPromise(function(_0x11fc15,_0x246772){return client[_0x11be('0x9')](_0xfe8c62,_0x18f661)[_0x11be('0xa')](function(_0x5f3d04){logger[_0x11be('0xb')](_0x11be('0xc'),_0x497730,'request\x20sent');logger[_0x11be('0xd')](_0x11be('0xe'),_0x497730,_0x11be('0xf'),JSON[_0x11be('0x10')](_0x5f3d04));if(_0x5f3d04['error']){if(_0x5f3d04[_0x11be('0x11')][_0x11be('0x12')]===0x1f4){logger[_0x11be('0x11')]('Migration,\x20%s,\x20%s',_0x497730,_0x5f3d04[_0x11be('0x11')][_0x11be('0x13')]);return _0x246772(_0x5f3d04['error'][_0x11be('0x13')]);}logger['error']('Migration,\x20%s,\x20%s',_0x497730,_0x5f3d04['error']['message']);return _0x11fc15(_0x5f3d04['error']['message']);}else{logger['info'](_0x11be('0xc'),_0x497730,'request\x20sent');_0x11fc15(_0x5f3d04[_0x11be('0x14')][_0x11be('0x13')]);}})[_0x11be('0x15')](function(_0x216b8c){logger['error'](_0x11be('0xc'),_0x497730,_0x216b8c);_0x246772(_0x216b8c);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index d71cba9..35f11eb 100644 --- a/server/api/network/index.js +++ b/server/api/network/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x06ae=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated','show','update','destroy','util','path'];(function(_0xbd6b38,_0x4ad164){var _0x88f5b7=function(_0x186031){while(--_0x186031){_0xbd6b38['push'](_0xbd6b38['shift']());}};_0x88f5b7(++_0x4ad164);}(_0x06ae,0x16e));var _0xe06a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x06ae[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require(_0xe06a('0x0'));var path=require(_0xe06a('0x1'));var timeout=require(_0xe06a('0x2'));var express=require(_0xe06a('0x3'));var router=express[_0xe06a('0x4')]();var fs_extra=require(_0xe06a('0x5'));var auth=require(_0xe06a('0x6'));var interaction=require(_0xe06a('0x7'));var config=require(_0xe06a('0x8'));var controller=require('./network.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xe06a('0x9')]);router[_0xe06a('0xa')](_0xe06a('0xb'),auth[_0xe06a('0xc')](),controller[_0xe06a('0xd')]);router['post']('/',auth[_0xe06a('0xc')](),controller['create']);router['put'](_0xe06a('0xb'),auth['isAuthenticated'](),controller[_0xe06a('0xe')]);router['delete']('/:id',auth[_0xe06a('0xc')](),controller[_0xe06a('0xf')]);module['exports']=router; \ No newline at end of file +var _0x5b6e=['fs-extra','../../components/auth/service','./network.controller','get','isAuthenticated','index','/:id','show','put','update','delete','destroy','multer','util','connect-timeout','Router'];(function(_0x1762e4,_0x2cfd66){var _0x57703d=function(_0x137bc2){while(--_0x137bc2){_0x1762e4['push'](_0x1762e4['shift']());}};_0x57703d(++_0x2cfd66);}(_0x5b6e,0x14c));var _0xe5b6=function(_0x42f5df,_0x4260f3){_0x42f5df=_0x42f5df-0x0;var _0x4dd2b3=_0x5b6e[_0x42f5df];return _0x4dd2b3;};'use strict';var multer=require(_0xe5b6('0x0'));var util=require(_0xe5b6('0x1'));var path=require('path');var timeout=require(_0xe5b6('0x2'));var express=require('express');var router=express[_0xe5b6('0x3')]();var fs_extra=require(_0xe5b6('0x4'));var auth=require(_0xe5b6('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe5b6('0x6'));router[_0xe5b6('0x7')]('/',auth[_0xe5b6('0x8')](),controller[_0xe5b6('0x9')]);router['get'](_0xe5b6('0xa'),auth[_0xe5b6('0x8')](),controller[_0xe5b6('0xb')]);router['post']('/',auth[_0xe5b6('0x8')](),controller['create']);router[_0xe5b6('0xc')](_0xe5b6('0xa'),auth['isAuthenticated'](),controller[_0xe5b6('0xd')]);router[_0xe5b6('0xe')]('/:id',auth[_0xe5b6('0x8')](),controller[_0xe5b6('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index a226c19..05fecd5 100644 --- a/server/api/network/network.attributes.js +++ b/server/api/network/network.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2048=['stun','STRING','sequelize','ENUM','externip'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x2048,0xfc));var _0x8204=function(_0x19ed94,_0x45f675){_0x19ed94=_0x19ed94-0x0;var _0x1c2bd5=_0x2048[_0x19ed94];return _0x1c2bd5;};'use strict';var Sequelize=require(_0x8204('0x0'));module['exports']={'type':{'type':Sequelize[_0x8204('0x1')]('localnet',_0x8204('0x2'),_0x8204('0x3'),'turn')},'value':{'type':Sequelize[_0x8204('0x4')]},'username':{'type':Sequelize[_0x8204('0x4')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xfb8f=['sequelize','exports','ENUM','localnet','externip','stun','STRING'];(function(_0x4b088,_0x1c37f3){var _0x44f3ea=function(_0x1ba27d){while(--_0x1ba27d){_0x4b088['push'](_0x4b088['shift']());}};_0x44f3ea(++_0x1c37f3);}(_0xfb8f,0x142));var _0xffb8=function(_0x17cd68,_0x56888a){_0x17cd68=_0x17cd68-0x0;var _0x19c491=_0xfb8f[_0x17cd68];return _0x19c491;};'use strict';var Sequelize=require(_0xffb8('0x0'));module[_0xffb8('0x1')]={'type':{'type':Sequelize[_0xffb8('0x2')](_0xffb8('0x3'),_0xffb8('0x4'),_0xffb8('0x5'),'turn')},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xffb8('0x6')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 84d996d..e4b36f2 100644 --- a/server/api/network/network.controller.js +++ b/server/api/network/network.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6fa2=['format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','update','util','path','ejs','../../components/parsers/qs','../../config/logger','api','../../config/environment','jayson/promise','client','http','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','status','json','count','offset','set','Content-Range','then','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','limit','sort','where','pick','filter','type','merge','options','Network','includeAll','include','findAll','show','params','find','create','body','readFileSync','join','root','server/files/templates/stun_multiple.ejs','render','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','toUpperCase','TURN','server/files/templates/turn_multiple.ejs','utf8','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','writeFileSync'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6fa2,0xab));var _0x26fa=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x6fa2[_0x46698a];return _0x356db0;};'use strict';var util=require(_0x26fa('0x0'));var path=require(_0x26fa('0x1'));var ejs=require(_0x26fa('0x2'));var fs=require('fs');var _=require('lodash');var qs=require(_0x26fa('0x3'));var logger=require(_0x26fa('0x4'))(_0x26fa('0x5'));var config=require(_0x26fa('0x6'));var db=require('../../mysqldb')['db'];var jayson=require(_0x26fa('0x7'));var client=jayson[_0x26fa('0x8')][_0x26fa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc6772d,_0x51a5c5,_0x341b0e,_0x35ecec){return new Promise(function(_0x5ab808,_0x2b55e2){var _0x2aa014=_0x35ecec||client;return _0x2aa014['request'](_0xc6772d,_0x341b0e)['then'](function(_0x215e86){logger['info'](_0x26fa('0xa'),_0x51a5c5,_0x26fa('0xb'));logger['debug'](_0x26fa('0xc'),_0x51a5c5,_0x26fa('0xb'),JSON[_0x26fa('0xd')](_0x215e86));if(_0x215e86['error']){if(_0x215e86['error'][_0x26fa('0xe')]===0x1f4){logger[_0x26fa('0xf')](_0x26fa('0xa'),_0x51a5c5,_0x215e86[_0x26fa('0xf')][_0x26fa('0x10')]);return _0x2b55e2(_0x215e86[_0x26fa('0xf')]['message']);}logger[_0x26fa('0xf')](_0x26fa('0xa'),_0x51a5c5,_0x215e86[_0x26fa('0xf')][_0x26fa('0x10')]);return _0x5ab808(_0x215e86[_0x26fa('0xf')][_0x26fa('0x10')]);}else{logger[_0x26fa('0x11')](_0x26fa('0xa'),_0x51a5c5,_0x26fa('0xb'));_0x5ab808(_0x215e86[_0x26fa('0x12')][_0x26fa('0x10')]);}})[_0x26fa('0x13')](function(_0x145d56){logger[_0x26fa('0xf')](_0x26fa('0xa'),_0x51a5c5,_0x145d56);_0x2b55e2(_0x145d56);});});}function respondWithResult(_0x5a72c3,_0x53253a){_0x53253a=_0x53253a||0xc8;return function(_0x58f990){if(_0x58f990){return _0x5a72c3[_0x26fa('0x14')](_0x53253a)[_0x26fa('0x15')](_0x58f990);}};}function respondWithFilteredResult(_0x389fef,_0x110963){return function(_0x320ddf){if(_0x320ddf){var _0x55ccb9=typeof _0x110963['offset']==='undefined'&&typeof _0x110963['limit']==='undefined';var _0x4a1912=_0x320ddf[_0x26fa('0x16')];var _0x808082=_0x55ccb9?0x0:_0x110963[_0x26fa('0x17')];var _0x417fa1=_0x55ccb9?_0x320ddf['count']:_0x110963[_0x26fa('0x17')]+_0x110963['limit'];var _0x2599a1;if(_0x417fa1>=_0x4a1912){_0x417fa1=_0x4a1912;_0x2599a1=0xc8;}else{_0x2599a1=0xce;}_0x389fef['status'](_0x2599a1);return _0x389fef[_0x26fa('0x18')](_0x26fa('0x19'),_0x808082+'-'+_0x417fa1+'/'+_0x4a1912)[_0x26fa('0x15')](_0x320ddf);}return null;};}function saveUpdates(_0x5cf35f){return function(_0x4032a3){if(_0x4032a3){return _0x4032a3['update'](_0x5cf35f)[_0x26fa('0x1a')](function(_0x1c7a76){return _0x1c7a76;});}return null;};}function removeEntity(_0x3db034){return function(_0x5a8a9d){if(_0x5a8a9d){return _0x5a8a9d[_0x26fa('0x1b')]()[_0x26fa('0x1a')](function(){_0x3db034[_0x26fa('0x14')](0xcc)[_0x26fa('0x1c')]();});}};}function handleEntityNotFound(_0x1983d3){return function(_0x40e722){if(!_0x40e722){_0x1983d3[_0x26fa('0x1d')](0x194);}return _0x40e722;};}function handleError(_0x2b73b0,_0x2a22ad){_0x2a22ad=_0x2a22ad||0x1f4;return function(_0x288ac0){logger[_0x26fa('0xf')](_0x288ac0[_0x26fa('0x1e')]);if(_0x288ac0[_0x26fa('0x1f')]){delete _0x288ac0[_0x26fa('0x1f')];}_0x2b73b0[_0x26fa('0x14')](_0x2a22ad)[_0x26fa('0x20')](_0x288ac0);};}exports[_0x26fa('0x21')]=function(_0x275ce8,_0x359797){var _0x417f3f={},_0x1395b4={},_0x2021fa={'count':0x0,'rows':[]};var _0x516120=_[_0x26fa('0x22')](db['Network'][_0x26fa('0x23')],function(_0x5d97cb){return{'name':_0x5d97cb['fieldName'],'type':_0x5d97cb['type'][_0x26fa('0x24')]};});_0x1395b4['model']=_[_0x26fa('0x22')](_0x516120,'name');_0x1395b4['query']=_[_0x26fa('0x25')](_0x275ce8[_0x26fa('0x26')]);_0x1395b4[_0x26fa('0x27')]=_[_0x26fa('0x28')](_0x1395b4[_0x26fa('0x29')],_0x1395b4[_0x26fa('0x26')]);_0x417f3f['attributes']=_[_0x26fa('0x28')](_0x1395b4[_0x26fa('0x29')],qs[_0x26fa('0x2a')](_0x275ce8['query']['fields']));_0x417f3f[_0x26fa('0x2b')]=_0x417f3f[_0x26fa('0x2b')][_0x26fa('0x2c')]?_0x417f3f[_0x26fa('0x2b')]:_0x1395b4[_0x26fa('0x29')];if(!_0x275ce8['query'][_0x26fa('0x2d')]('nolimit')){_0x417f3f[_0x26fa('0x2e')]=qs[_0x26fa('0x2e')](_0x275ce8['query'][_0x26fa('0x2e')]);_0x417f3f[_0x26fa('0x17')]=qs[_0x26fa('0x17')](_0x275ce8[_0x26fa('0x26')]['offset']);}_0x417f3f['order']=qs[_0x26fa('0x2f')](_0x275ce8[_0x26fa('0x26')][_0x26fa('0x2f')]);_0x417f3f[_0x26fa('0x30')]=qs['filters'](_[_0x26fa('0x31')](_0x275ce8['query'],_0x1395b4[_0x26fa('0x27')]),_0x516120);if(_0x275ce8['query'][_0x26fa('0x32')]){_0x417f3f['where']=_['merge'](_0x417f3f['where'],{'$or':_[_0x26fa('0x22')](_0x516120,function(_0x59f571){if(_0x59f571[_0x26fa('0x33')]!=='VIRTUAL'){var _0x4262c9={};_0x4262c9[_0x59f571['name']]={'$like':'%'+_0x275ce8['query']['filter']+'%'};return _0x4262c9;}})});}_0x417f3f=_[_0x26fa('0x34')]({},_0x417f3f,_0x275ce8[_0x26fa('0x35')]);var _0x299b3f={'where':_0x417f3f[_0x26fa('0x30')]};return db[_0x26fa('0x36')]['count'](_0x299b3f)['then'](function(_0x34468c){_0x2021fa[_0x26fa('0x16')]=_0x34468c;if(_0x275ce8[_0x26fa('0x26')][_0x26fa('0x37')]){_0x417f3f[_0x26fa('0x38')]=[{'all':!![]}];}return db['Network'][_0x26fa('0x39')](_0x417f3f);})[_0x26fa('0x1a')](function(_0x1a2784){_0x2021fa['rows']=_0x1a2784;return _0x2021fa;})['then'](respondWithFilteredResult(_0x359797,_0x417f3f))[_0x26fa('0x13')](handleError(_0x359797,null));};exports[_0x26fa('0x3a')]=function(_0x5598bf,_0x2d8fd7){var _0x2c8c96={'raw':!![],'where':{'id':_0x5598bf[_0x26fa('0x3b')]['id']}},_0x2d3ecc={};_0x2d3ecc[_0x26fa('0x29')]=_[_0x26fa('0x25')](db[_0x26fa('0x36')][_0x26fa('0x23')]);_0x2d3ecc['query']=_['keys'](_0x5598bf['query']);_0x2d3ecc[_0x26fa('0x27')]=_[_0x26fa('0x28')](_0x2d3ecc[_0x26fa('0x29')],_0x2d3ecc[_0x26fa('0x26')]);_0x2c8c96['attributes']=_['intersection'](_0x2d3ecc[_0x26fa('0x29')],qs[_0x26fa('0x2a')](_0x5598bf[_0x26fa('0x26')][_0x26fa('0x2a')]));_0x2c8c96[_0x26fa('0x2b')]=_0x2c8c96[_0x26fa('0x2b')]['length']?_0x2c8c96[_0x26fa('0x2b')]:_0x2d3ecc[_0x26fa('0x29')];if(_0x5598bf[_0x26fa('0x26')]['includeAll']){_0x2c8c96[_0x26fa('0x38')]=[{'all':!![]}];}_0x2c8c96=_[_0x26fa('0x34')]({},_0x2c8c96,_0x5598bf[_0x26fa('0x35')]);return db[_0x26fa('0x36')][_0x26fa('0x3c')](_0x2c8c96)[_0x26fa('0x1a')](handleEntityNotFound(_0x2d8fd7,null))['then'](respondWithResult(_0x2d8fd7,null))[_0x26fa('0x13')](handleError(_0x2d8fd7,null));};exports[_0x26fa('0x3d')]=function(_0x4f8c4c,_0x17f635){var _0x4e670e;return db[_0x26fa('0x36')][_0x26fa('0x3d')](_0x4f8c4c[_0x26fa('0x3e')],{'raw':!![]})[_0x26fa('0x1a')](function(_0x31bea1){_0x4e670e=_0x31bea1;return db[_0x26fa('0x36')][_0x26fa('0x39')]({'where':{'type':_0x4f8c4c['body'][_0x26fa('0x33')]},'raw':!![]});})[_0x26fa('0x1a')](function(_0x1eaff6){if(_0x4e670e[_0x26fa('0x33')]['toUpperCase']()=='STUN'){var _0x16f91d=fs[_0x26fa('0x3f')](path[_0x26fa('0x40')](config[_0x26fa('0x41')],_0x26fa('0x42')),'utf8');var _0x4bc0f9=ejs[_0x26fa('0x43')](_0x16f91d,{'networks':_0x1eaff6||[]});fs['writeFileSync'](_0x26fa('0x44'),_0x4bc0f9);return respondWithRpcPromise(_0x26fa('0x45'),_0x26fa('0x3d'),{'module':_0x26fa('0x46')});}else if(_0x4e670e['type'][_0x26fa('0x47')]()==_0x26fa('0x48')){var _0x3d2e56=fs[_0x26fa('0x3f')](path[_0x26fa('0x40')](config[_0x26fa('0x41')],_0x26fa('0x49')),_0x26fa('0x4a'));var _0xf6eb0e=ejs[_0x26fa('0x43')](_0x3d2e56,{'networks':_0x1eaff6||[]});fs['writeFileSync'](_0x26fa('0x4b'),_0xf6eb0e);return respondWithRpcPromise('Reload',_0x26fa('0x3d'),{'module':_0x26fa('0x46')});}else{var _0x4a68f8=fs[_0x26fa('0x3f')](path[_0x26fa('0x40')](config['root'],_0x26fa('0x4c')),'utf8');var _0x4e51b0=ejs[_0x26fa('0x43')](_0x4a68f8,{'networks':_0x1eaff6||[]});fs[_0x26fa('0x4d')](util[_0x26fa('0x4e')](_0x26fa('0x4f'),_0x4f8c4c[_0x26fa('0x3e')]['type'][_0x26fa('0x50')]()),_0x4e51b0);return respondWithRpcPromise(_0x26fa('0x45'),'create',{'module':_0x26fa('0x51')});}})[_0x26fa('0x1a')](function(){return _0x4e670e;})[_0x26fa('0x1a')](respondWithResult(_0x17f635,0xc9))[_0x26fa('0x13')](handleError(_0x17f635,null));};exports[_0x26fa('0x52')]=function(_0x18c2b0,_0x120268){var _0x3a3395;return db[_0x26fa('0x36')]['find']({'where':{'id':_0x18c2b0[_0x26fa('0x3b')]['id']}})['then'](handleEntityNotFound(_0x120268,null))[_0x26fa('0x1a')](saveUpdates(_0x18c2b0['body'],null))[_0x26fa('0x1a')](function(_0x1d6bae){if(_0x1d6bae){_0x3a3395=_0x1d6bae;return db['Network'][_0x26fa('0x39')]({'where':{'type':_0x3a3395['type']},'raw':!![]});}return null;})['then'](function(_0xb7d7b8){if(_0x3a3395[_0x26fa('0x33')][_0x26fa('0x47')]()=='STUN'){var _0x2523b7=fs['readFileSync'](path['join'](config['root'],_0x26fa('0x42')),_0x26fa('0x4a'));var _0x3eccbc=ejs['render'](_0x2523b7,{'networks':_0xb7d7b8||[]});fs[_0x26fa('0x4d')]('/etc/asterisk/stun_xcally.conf',_0x3eccbc);return respondWithRpcPromise('Reload',_0x26fa('0x52'),{'module':'res_stun_monitor.so'});}else if(_0x3a3395['type'][_0x26fa('0x47')]()=='TURN'){var _0x5dc798=fs['readFileSync'](path[_0x26fa('0x40')](config['root'],_0x26fa('0x49')),_0x26fa('0x4a'));var _0x508f7e=ejs[_0x26fa('0x43')](_0x5dc798,{'networks':_0xb7d7b8||[]});fs['writeFileSync'](_0x26fa('0x4b'),_0x508f7e);return respondWithRpcPromise(_0x26fa('0x45'),_0x26fa('0x52'),{'module':_0x26fa('0x46')});}else{var _0x10f919=fs[_0x26fa('0x3f')](path[_0x26fa('0x40')](config[_0x26fa('0x41')],_0x26fa('0x4c')),_0x26fa('0x4a'));var _0x867032=ejs[_0x26fa('0x43')](_0x10f919,{'networks':_0xb7d7b8||[]});fs[_0x26fa('0x4d')](util[_0x26fa('0x4e')](_0x26fa('0x4f'),_0x18c2b0[_0x26fa('0x3e')][_0x26fa('0x33')][_0x26fa('0x50')]()),_0x867032);return respondWithRpcPromise(_0x26fa('0x45'),_0x26fa('0x52'),{'module':_0x26fa('0x51')});}})['then'](function(_0xf88cda){if(_0xf88cda){return _0x3a3395;}return null;})[_0x26fa('0x1a')](respondWithResult(_0x120268,null))['catch'](handleError(_0x120268,null));};exports[_0x26fa('0x1b')]=function(_0x4698e6,_0x55c40c){var _0x1b6192;return db[_0x26fa('0x36')]['find']({'where':{'id':_0x4698e6[_0x26fa('0x3b')]['id']}})[_0x26fa('0x1a')](function(_0x2204ef){_0x1b6192=_0x2204ef;return _0x2204ef;})[_0x26fa('0x1a')](handleEntityNotFound(_0x55c40c,null))[_0x26fa('0x1a')](removeEntity(_0x55c40c,null))[_0x26fa('0x1a')](function(){if(_0x1b6192){return db[_0x26fa('0x36')][_0x26fa('0x39')]({'where':{'type':_0x1b6192[_0x26fa('0x33')]},'raw':!![]});}})[_0x26fa('0x1a')](function(_0x1c38b5){if(_0x1b6192[_0x26fa('0x33')][_0x26fa('0x47')]()=='STUN'){var _0x3f4042=fs[_0x26fa('0x3f')](path[_0x26fa('0x40')](config[_0x26fa('0x41')],_0x26fa('0x42')),_0x26fa('0x4a'));var _0x31b050=ejs['render'](_0x3f4042,{'networks':_0x1c38b5||[]});fs[_0x26fa('0x4d')](_0x26fa('0x44'),_0x31b050);return respondWithRpcPromise(_0x26fa('0x45'),'destroy',{'module':_0x26fa('0x46')});}else if(_0x1b6192[_0x26fa('0x33')][_0x26fa('0x47')]()=='TURN'){var _0x111718=fs[_0x26fa('0x3f')](path[_0x26fa('0x40')](config[_0x26fa('0x41')],_0x26fa('0x49')),_0x26fa('0x4a'));var _0x527aef=ejs['render'](_0x111718,{'networks':_0x1c38b5||[]});fs['writeFileSync'](_0x26fa('0x4b'),_0x527aef);return respondWithRpcPromise(_0x26fa('0x45'),_0x26fa('0x1b'),{'module':'res_stun_monitor.so'});}else{var _0x3f0daa=fs[_0x26fa('0x3f')](path[_0x26fa('0x40')](config[_0x26fa('0x41')],_0x26fa('0x4c')),_0x26fa('0x4a'));var _0x1cde5c=ejs[_0x26fa('0x43')](_0x3f0daa,{'networks':_0x1c38b5||[]});fs['writeFileSync'](util[_0x26fa('0x4e')](_0x26fa('0x4f'),_0x1b6192[_0x26fa('0x33')][_0x26fa('0x50')]()),_0x1cde5c);return respondWithRpcPromise(_0x26fa('0x45'),_0x26fa('0x1b'),{'module':'chan_sip.so'});}})['catch'](handleError(_0x55c40c,null));}; \ No newline at end of file +var _0x0db7=['request','then','Network,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','json','offset','undefined','count','Content-Range','update','destroy','end','stack','name','send','map','Network','rawAttributes','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','include','rows','show','params','create','body','findAll','toUpperCase','join','root','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','TURN','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','readFileSync','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','find','Reload','server/files/templates/network.ejs','STUN','server/files/templates/stun_multiple.ejs','../../components/parsers/qs','../../config/logger','../../config/environment','client','http'];(function(_0xd971b4,_0x445070){var _0x5ed2a2=function(_0xf4b51c){while(--_0xf4b51c){_0xd971b4['push'](_0xd971b4['shift']());}};_0x5ed2a2(++_0x445070);}(_0x0db7,0x1db));var _0x70db=function(_0x5a8154,_0x3791d2){_0x5a8154=_0x5a8154-0x0;var _0xba444a=_0x0db7[_0x5a8154];return _0xba444a;};'use strict';var util=require('util');var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var qs=require(_0x70db('0x0'));var logger=require(_0x70db('0x1'))('api');var config=require(_0x70db('0x2'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x70db('0x3')][_0x70db('0x4')]({'port':0x232a});function respondWithRpcPromise(_0x30f467,_0x1bb4bc,_0x2dd38e,_0x96f771){return new Promise(function(_0x53ebc8,_0x21d1c3){var _0x4d57a7=_0x96f771||client;return _0x4d57a7[_0x70db('0x5')](_0x30f467,_0x2dd38e)[_0x70db('0x6')](function(_0x25a8a4){logger['info'](_0x70db('0x7'),_0x1bb4bc,_0x70db('0x8'));logger[_0x70db('0x9')]('Network,\x20%s,\x20%s,\x20%s',_0x1bb4bc,'request\x20sent',JSON[_0x70db('0xa')](_0x25a8a4));if(_0x25a8a4[_0x70db('0xb')]){if(_0x25a8a4[_0x70db('0xb')][_0x70db('0xc')]===0x1f4){logger[_0x70db('0xb')](_0x70db('0x7'),_0x1bb4bc,_0x25a8a4[_0x70db('0xb')][_0x70db('0xd')]);return _0x21d1c3(_0x25a8a4[_0x70db('0xb')][_0x70db('0xd')]);}logger[_0x70db('0xb')]('Network,\x20%s,\x20%s',_0x1bb4bc,_0x25a8a4['error']['message']);return _0x53ebc8(_0x25a8a4[_0x70db('0xb')][_0x70db('0xd')]);}else{logger['info'](_0x70db('0x7'),_0x1bb4bc,_0x70db('0x8'));_0x53ebc8(_0x25a8a4[_0x70db('0xe')][_0x70db('0xd')]);}})[_0x70db('0xf')](function(_0x219165){logger[_0x70db('0xb')]('Network,\x20%s,\x20%s',_0x1bb4bc,_0x219165);_0x21d1c3(_0x219165);});});}function respondWithResult(_0x47ace9,_0x3c669d){_0x3c669d=_0x3c669d||0xc8;return function(_0x540228){if(_0x540228){return _0x47ace9[_0x70db('0x10')](_0x3c669d)[_0x70db('0x11')](_0x540228);}};}function respondWithFilteredResult(_0x413f39,_0x1ce36d){return function(_0x167466){if(_0x167466){var _0xa13152=typeof _0x1ce36d[_0x70db('0x12')]===_0x70db('0x13')&&typeof _0x1ce36d['limit']===_0x70db('0x13');var _0x4048c9=_0x167466[_0x70db('0x14')];var _0x50c39e=_0xa13152?0x0:_0x1ce36d[_0x70db('0x12')];var _0x4af503=_0xa13152?_0x167466[_0x70db('0x14')]:_0x1ce36d[_0x70db('0x12')]+_0x1ce36d['limit'];var _0x1f24b9;if(_0x4af503>=_0x4048c9){_0x4af503=_0x4048c9;_0x1f24b9=0xc8;}else{_0x1f24b9=0xce;}_0x413f39[_0x70db('0x10')](_0x1f24b9);return _0x413f39['set'](_0x70db('0x15'),_0x50c39e+'-'+_0x4af503+'/'+_0x4048c9)[_0x70db('0x11')](_0x167466);}return null;};}function saveUpdates(_0x1dd613){return function(_0x22cc56){if(_0x22cc56){return _0x22cc56[_0x70db('0x16')](_0x1dd613)['then'](function(_0x496a6c){return _0x496a6c;});}return null;};}function removeEntity(_0x51a1c6){return function(_0x328fe8){if(_0x328fe8){return _0x328fe8[_0x70db('0x17')]()[_0x70db('0x6')](function(){_0x51a1c6[_0x70db('0x10')](0xcc)[_0x70db('0x18')]();});}};}function handleEntityNotFound(_0x40145d){return function(_0x5b54cf){if(!_0x5b54cf){_0x40145d['sendStatus'](0x194);}return _0x5b54cf;};}function handleError(_0x4c3cfa,_0x3d117b){_0x3d117b=_0x3d117b||0x1f4;return function(_0x257d37){logger['error'](_0x257d37[_0x70db('0x19')]);if(_0x257d37[_0x70db('0x1a')]){delete _0x257d37['name'];}_0x4c3cfa[_0x70db('0x10')](_0x3d117b)[_0x70db('0x1b')](_0x257d37);};}exports['index']=function(_0xbe69b3,_0x1fc2b0){var _0x4f91d0={},_0x41be86={},_0x293a27={'count':0x0,'rows':[]};var _0x34f209=_[_0x70db('0x1c')](db[_0x70db('0x1d')][_0x70db('0x1e')],function(_0x81c0ff){return{'name':_0x81c0ff['fieldName'],'type':_0x81c0ff['type'][_0x70db('0x1f')]};});_0x41be86[_0x70db('0x20')]=_[_0x70db('0x1c')](_0x34f209,_0x70db('0x1a'));_0x41be86['query']=_[_0x70db('0x21')](_0xbe69b3[_0x70db('0x22')]);_0x41be86['filters']=_[_0x70db('0x23')](_0x41be86[_0x70db('0x20')],_0x41be86['query']);_0x4f91d0[_0x70db('0x24')]=_[_0x70db('0x23')](_0x41be86[_0x70db('0x20')],qs[_0x70db('0x25')](_0xbe69b3['query']['fields']));_0x4f91d0[_0x70db('0x24')]=_0x4f91d0[_0x70db('0x24')][_0x70db('0x26')]?_0x4f91d0[_0x70db('0x24')]:_0x41be86['model'];if(!_0xbe69b3[_0x70db('0x22')][_0x70db('0x27')](_0x70db('0x28'))){_0x4f91d0[_0x70db('0x29')]=qs['limit'](_0xbe69b3[_0x70db('0x22')]['limit']);_0x4f91d0[_0x70db('0x12')]=qs['offset'](_0xbe69b3[_0x70db('0x22')][_0x70db('0x12')]);}_0x4f91d0[_0x70db('0x2a')]=qs['sort'](_0xbe69b3[_0x70db('0x22')][_0x70db('0x2b')]);_0x4f91d0[_0x70db('0x2c')]=qs['filters'](_[_0x70db('0x2d')](_0xbe69b3[_0x70db('0x22')],_0x41be86[_0x70db('0x2e')]),_0x34f209);if(_0xbe69b3[_0x70db('0x22')][_0x70db('0x2f')]){_0x4f91d0[_0x70db('0x2c')]=_[_0x70db('0x30')](_0x4f91d0[_0x70db('0x2c')],{'$or':_[_0x70db('0x1c')](_0x34f209,function(_0x21428c){if(_0x21428c[_0x70db('0x31')]!==_0x70db('0x32')){var _0x4bd4fe={};_0x4bd4fe[_0x21428c[_0x70db('0x1a')]]={'$like':'%'+_0xbe69b3[_0x70db('0x22')][_0x70db('0x2f')]+'%'};return _0x4bd4fe;}})});}_0x4f91d0=_['merge']({},_0x4f91d0,_0xbe69b3[_0x70db('0x33')]);var _0x5a3d20={'where':_0x4f91d0[_0x70db('0x2c')]};return db[_0x70db('0x1d')][_0x70db('0x14')](_0x5a3d20)[_0x70db('0x6')](function(_0x21806b){_0x293a27[_0x70db('0x14')]=_0x21806b;if(_0xbe69b3[_0x70db('0x22')]['includeAll']){_0x4f91d0[_0x70db('0x34')]=[{'all':!![]}];}return db[_0x70db('0x1d')]['findAll'](_0x4f91d0);})[_0x70db('0x6')](function(_0x33eec3){_0x293a27[_0x70db('0x35')]=_0x33eec3;return _0x293a27;})[_0x70db('0x6')](respondWithFilteredResult(_0x1fc2b0,_0x4f91d0))[_0x70db('0xf')](handleError(_0x1fc2b0,null));};exports[_0x70db('0x36')]=function(_0x28b10a,_0x39b7c2){var _0x53d1e6={'raw':!![],'where':{'id':_0x28b10a[_0x70db('0x37')]['id']}},_0x3b72e5={};_0x3b72e5[_0x70db('0x20')]=_[_0x70db('0x21')](db[_0x70db('0x1d')]['rawAttributes']);_0x3b72e5[_0x70db('0x22')]=_[_0x70db('0x21')](_0x28b10a[_0x70db('0x22')]);_0x3b72e5[_0x70db('0x2e')]=_['intersection'](_0x3b72e5['model'],_0x3b72e5[_0x70db('0x22')]);_0x53d1e6[_0x70db('0x24')]=_[_0x70db('0x23')](_0x3b72e5['model'],qs['fields'](_0x28b10a[_0x70db('0x22')]['fields']));_0x53d1e6[_0x70db('0x24')]=_0x53d1e6[_0x70db('0x24')]['length']?_0x53d1e6[_0x70db('0x24')]:_0x3b72e5[_0x70db('0x20')];if(_0x28b10a[_0x70db('0x22')]['includeAll']){_0x53d1e6['include']=[{'all':!![]}];}_0x53d1e6=_[_0x70db('0x30')]({},_0x53d1e6,_0x28b10a[_0x70db('0x33')]);return db['Network']['find'](_0x53d1e6)['then'](handleEntityNotFound(_0x39b7c2,null))[_0x70db('0x6')](respondWithResult(_0x39b7c2,null))[_0x70db('0xf')](handleError(_0x39b7c2,null));};exports[_0x70db('0x38')]=function(_0x5e21e1,_0x1de1ad){var _0x9e696a;return db[_0x70db('0x1d')]['create'](_0x5e21e1[_0x70db('0x39')],{'raw':!![]})[_0x70db('0x6')](function(_0x2a23e9){_0x9e696a=_0x2a23e9;return db[_0x70db('0x1d')][_0x70db('0x3a')]({'where':{'type':_0x5e21e1[_0x70db('0x39')]['type']},'raw':!![]});})['then'](function(_0x27470e){if(_0x9e696a[_0x70db('0x31')][_0x70db('0x3b')]()=='STUN'){var _0x56f49c=fs['readFileSync'](path[_0x70db('0x3c')](config[_0x70db('0x3d')],'server/files/templates/stun_multiple.ejs'),_0x70db('0x3e'));var _0x3a98a6=ejs[_0x70db('0x3f')](_0x56f49c,{'networks':_0x27470e||[]});fs[_0x70db('0x40')](_0x70db('0x41'),_0x3a98a6);return respondWithRpcPromise('Reload',_0x70db('0x38'),{'module':_0x70db('0x42')});}else if(_0x9e696a[_0x70db('0x31')][_0x70db('0x3b')]()==_0x70db('0x43')){var _0x32da6f=fs['readFileSync'](path[_0x70db('0x3c')](config['root'],_0x70db('0x44')),_0x70db('0x3e'));var _0xf4424c=ejs[_0x70db('0x3f')](_0x32da6f,{'networks':_0x27470e||[]});fs[_0x70db('0x40')](_0x70db('0x45'),_0xf4424c);return respondWithRpcPromise('Reload',_0x70db('0x38'),{'module':_0x70db('0x42')});}else{var _0x216bca=fs[_0x70db('0x46')](path[_0x70db('0x3c')](config[_0x70db('0x3d')],'server/files/templates/network.ejs'),_0x70db('0x3e'));var _0x565418=ejs[_0x70db('0x3f')](_0x216bca,{'networks':_0x27470e||[]});fs[_0x70db('0x40')](util[_0x70db('0x47')](_0x70db('0x48'),_0x5e21e1[_0x70db('0x39')][_0x70db('0x31')][_0x70db('0x49')]()),_0x565418);return respondWithRpcPromise('Reload','create',{'module':_0x70db('0x4a')});}})[_0x70db('0x6')](function(){return _0x9e696a;})['then'](respondWithResult(_0x1de1ad,0xc9))[_0x70db('0xf')](handleError(_0x1de1ad,null));};exports['update']=function(_0x153f81,_0x3672ce){var _0x1e29c3;return db['Network'][_0x70db('0x4b')]({'where':{'id':_0x153f81[_0x70db('0x37')]['id']}})[_0x70db('0x6')](handleEntityNotFound(_0x3672ce,null))['then'](saveUpdates(_0x153f81[_0x70db('0x39')],null))['then'](function(_0x1d9dc0){if(_0x1d9dc0){_0x1e29c3=_0x1d9dc0;return db[_0x70db('0x1d')][_0x70db('0x3a')]({'where':{'type':_0x1e29c3[_0x70db('0x31')]},'raw':!![]});}return null;})[_0x70db('0x6')](function(_0x3bf969){if(_0x1e29c3[_0x70db('0x31')][_0x70db('0x3b')]()=='STUN'){var _0x2f52d9=fs[_0x70db('0x46')](path[_0x70db('0x3c')](config['root'],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x32e0b5=ejs[_0x70db('0x3f')](_0x2f52d9,{'networks':_0x3bf969||[]});fs[_0x70db('0x40')]('/etc/asterisk/stun_xcally.conf',_0x32e0b5);return respondWithRpcPromise(_0x70db('0x4c'),_0x70db('0x16'),{'module':'res_stun_monitor.so'});}else if(_0x1e29c3[_0x70db('0x31')][_0x70db('0x3b')]()==_0x70db('0x43')){var _0x26b640=fs[_0x70db('0x46')](path[_0x70db('0x3c')](config[_0x70db('0x3d')],_0x70db('0x44')),_0x70db('0x3e'));var _0xbe8661=ejs[_0x70db('0x3f')](_0x26b640,{'networks':_0x3bf969||[]});fs['writeFileSync'](_0x70db('0x45'),_0xbe8661);return respondWithRpcPromise(_0x70db('0x4c'),_0x70db('0x16'),{'module':'res_stun_monitor.so'});}else{var _0xd8f5ce=fs['readFileSync'](path['join'](config[_0x70db('0x3d')],_0x70db('0x4d')),_0x70db('0x3e'));var _0x435e7b=ejs[_0x70db('0x3f')](_0xd8f5ce,{'networks':_0x3bf969||[]});fs[_0x70db('0x40')](util[_0x70db('0x47')](_0x70db('0x48'),_0x153f81[_0x70db('0x39')][_0x70db('0x31')][_0x70db('0x49')]()),_0x435e7b);return respondWithRpcPromise('Reload',_0x70db('0x16'),{'module':'chan_sip.so'});}})[_0x70db('0x6')](function(_0x59f381){if(_0x59f381){return _0x1e29c3;}return null;})['then'](respondWithResult(_0x3672ce,null))['catch'](handleError(_0x3672ce,null));};exports[_0x70db('0x17')]=function(_0x2e01b1,_0x5cec30){var _0x3a4768;return db['Network'][_0x70db('0x4b')]({'where':{'id':_0x2e01b1[_0x70db('0x37')]['id']}})[_0x70db('0x6')](function(_0x10c2a0){_0x3a4768=_0x10c2a0;return _0x10c2a0;})[_0x70db('0x6')](handleEntityNotFound(_0x5cec30,null))['then'](removeEntity(_0x5cec30,null))[_0x70db('0x6')](function(){if(_0x3a4768){return db[_0x70db('0x1d')][_0x70db('0x3a')]({'where':{'type':_0x3a4768[_0x70db('0x31')]},'raw':!![]});}})['then'](function(_0x506cb3){if(_0x3a4768[_0x70db('0x31')][_0x70db('0x3b')]()==_0x70db('0x4e')){var _0x5ec91b=fs['readFileSync'](path[_0x70db('0x3c')](config[_0x70db('0x3d')],_0x70db('0x4f')),_0x70db('0x3e'));var _0x4b0b07=ejs['render'](_0x5ec91b,{'networks':_0x506cb3||[]});fs[_0x70db('0x40')](_0x70db('0x41'),_0x4b0b07);return respondWithRpcPromise(_0x70db('0x4c'),'destroy',{'module':'res_stun_monitor.so'});}else if(_0x3a4768[_0x70db('0x31')]['toUpperCase']()==_0x70db('0x43')){var _0x4b7d64=fs['readFileSync'](path[_0x70db('0x3c')](config[_0x70db('0x3d')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0xed64f9=ejs[_0x70db('0x3f')](_0x4b7d64,{'networks':_0x506cb3||[]});fs[_0x70db('0x40')](_0x70db('0x45'),_0xed64f9);return respondWithRpcPromise('Reload','destroy',{'module':_0x70db('0x42')});}else{var _0x3f1156=fs[_0x70db('0x46')](path[_0x70db('0x3c')](config[_0x70db('0x3d')],_0x70db('0x4d')),_0x70db('0x3e'));var _0x3f5827=ejs[_0x70db('0x3f')](_0x3f1156,{'networks':_0x506cb3||[]});fs[_0x70db('0x40')](util[_0x70db('0x47')](_0x70db('0x48'),_0x3a4768['type'][_0x70db('0x49')]()),_0x3f5827);return respondWithRpcPromise(_0x70db('0x4c'),_0x70db('0x17'),{'module':_0x70db('0x4a')});}})[_0x70db('0xf')](handleError(_0x5cec30,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index b97bd1e..bc8bfd8 100644 --- a/server/api/network/network.model.js +++ b/server/api/network/network.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb4e6=['path','rimraf','./network.attributes','exports','define','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5b11a8,_0x10e0c4){var _0x558b7e=function(_0x254d9b){while(--_0x254d9b){_0x5b11a8['push'](_0x5b11a8['shift']());}};_0x558b7e(++_0x10e0c4);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xb4e6[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x6b4e('0x0'));var util=require('util');var logger=require(_0x6b4e('0x1'))(_0x6b4e('0x2'));var moment=require(_0x6b4e('0x3'));var BPromise=require(_0x6b4e('0x4'));var rp=require(_0x6b4e('0x5'));var fs=require('fs');var path=require(_0x6b4e('0x6'));var rimraf=require(_0x6b4e('0x7'));var config=require('../../config/environment');var attributes=require(_0x6b4e('0x8'));module[_0x6b4e('0x9')]=function(_0x1f67a2,_0x49de51){return _0x1f67a2[_0x6b4e('0xa')]('Network',attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4058=['api','moment','bluebird','request-promise','path','rimraf','define','Network','network','lodash','util','../../config/logger'];(function(_0xf51c06,_0x388e5b){var _0x1d5420=function(_0x5e077b){while(--_0x5e077b){_0xf51c06['push'](_0xf51c06['shift']());}};_0x1d5420(++_0x388e5b);}(_0x4058,0x129));var _0x8405=function(_0x1a92ee,_0x366b2e){_0x1a92ee=_0x1a92ee-0x0;var _0x41f331=_0x4058[_0x1a92ee];return _0x41f331;};'use strict';var _=require(_0x8405('0x0'));var util=require(_0x8405('0x1'));var logger=require(_0x8405('0x2'))(_0x8405('0x3'));var moment=require(_0x8405('0x4'));var BPromise=require(_0x8405('0x5'));var rp=require(_0x8405('0x6'));var fs=require('fs');var path=require(_0x8405('0x7'));var rimraf=require(_0x8405('0x8'));var config=require('../../config/environment');var attributes=require('./network.attributes');module['exports']=function(_0x1db7ea,_0x257d43){return _0x1db7ea[_0x8405('0x9')](_0x8405('0xa'),attributes,{'tableName':_0x8405('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 207ea8e..0cb7d06 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x3ae565,_0x191c12){_0x3ae565=_0x3ae565-0x0;var _0x55fafd=_0x7a54[_0x3ae565];return _0x55fafd;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7a54,0x106));var _0x47a5=function(_0x222f67,_0x1b5ff9){_0x222f67=_0x222f67-0x0;var _0x7966cf=_0x7a54[_0x222f67];return _0x7966cf;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 4cef0e9..66a3238 100644 --- a/server/api/openchannelAccount/index.js +++ b/server/api/openchannelAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x54c3=['addApplications','addAgents','send','put','update','delete','destroy','/:id/users','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','getAnswers','getApplications','/:id/interactions','getInteractions','getAgents','post','create','addDisposition','/:id/canned_answers','notify','/:id/applications'];(function(_0x2aa3c0,_0x816062){var _0x1efaf9=function(_0x7b2934){while(--_0x7b2934){_0x2aa3c0['push'](_0x2aa3c0['shift']());}};_0x1efaf9(++_0x816062);}(_0x54c3,0x7f));var _0x354c=function(_0x44c37d,_0x19119f){_0x44c37d=_0x44c37d-0x0;var _0x29e087=_0x54c3[_0x44c37d];return _0x29e087;};'use strict';var multer=require(_0x354c('0x0'));var util=require(_0x354c('0x1'));var path=require(_0x354c('0x2'));var timeout=require(_0x354c('0x3'));var express=require(_0x354c('0x4'));var router=express[_0x354c('0x5')]();var fs_extra=require(_0x354c('0x6'));var auth=require(_0x354c('0x7'));var interaction=require(_0x354c('0x8'));var config=require('../../config/environment');var controller=require(_0x354c('0x9'));router[_0x354c('0xa')]('/',auth[_0x354c('0xb')](),controller[_0x354c('0xc')]);router[_0x354c('0xa')](_0x354c('0xd'),auth['isAuthenticated'](),controller[_0x354c('0xe')]);router['get'](_0x354c('0xf'),auth[_0x354c('0xb')](),controller['show']);router[_0x354c('0xa')](_0x354c('0x10'),auth['isAuthenticated'](),controller[_0x354c('0x11')]);router[_0x354c('0xa')]('/:id/canned_answers',auth[_0x354c('0xb')](),controller[_0x354c('0x12')]);router[_0x354c('0xa')]('/:id/applications',auth[_0x354c('0xb')](),controller[_0x354c('0x13')]);router[_0x354c('0xa')](_0x354c('0x14'),auth[_0x354c('0xb')](),controller[_0x354c('0x15')]);router[_0x354c('0xa')]('/:id/users',auth[_0x354c('0xb')](),controller[_0x354c('0x16')]);router[_0x354c('0x17')]('/',auth[_0x354c('0xb')](),controller[_0x354c('0x18')]);router[_0x354c('0x17')](_0x354c('0x10'),auth[_0x354c('0xb')](),controller[_0x354c('0x19')]);router[_0x354c('0x17')](_0x354c('0x1a'),auth[_0x354c('0xb')](),controller['addAnswer']);router['post']('/:id/notify',controller[_0x354c('0x1b')]);router[_0x354c('0x17')](_0x354c('0x1c'),auth[_0x354c('0xb')](),controller[_0x354c('0x1d')]);router['post']('/:id/users',auth[_0x354c('0xb')](),controller[_0x354c('0x1e')]);router['post']('/:id/send',auth[_0x354c('0xb')](),controller[_0x354c('0x1f')]);router[_0x354c('0x20')]('/:id',auth[_0x354c('0xb')](),controller[_0x354c('0x21')]);router[_0x354c('0x22')]('/:id',auth[_0x354c('0xb')](),controller[_0x354c('0x23')]);router[_0x354c('0x22')](_0x354c('0x10'),auth[_0x354c('0xb')](),controller['removeDispositions']);router[_0x354c('0x22')](_0x354c('0x1a'),auth[_0x354c('0xb')](),controller['removeAnswers']);router['delete'](_0x354c('0x24'),auth[_0x354c('0xb')](),controller[_0x354c('0x25')]);module[_0x354c('0x26')]=router; \ No newline at end of file +var _0xa7f6=['put','/:id','update','delete','destroy','removeAgents','exports','multer','connect-timeout','express','../../components/interaction/service','./openchannelAccount.controller','get','isAuthenticated','describe','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','getInteractions','/:id/users','getAgents','/:id/dispositions','post','addAnswer','addApplications'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xa7f6,0x1ed));var _0x6a7f=function(_0x6af165,_0x599fa9){_0x6af165=_0x6af165-0x0;var _0x10239e=_0xa7f6[_0x6af165];return _0x10239e;};'use strict';var multer=require(_0x6a7f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6a7f('0x1'));var express=require(_0x6a7f('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6a7f('0x3'));var config=require('../../config/environment');var controller=require(_0x6a7f('0x4'));router[_0x6a7f('0x5')]('/',auth[_0x6a7f('0x6')](),controller['index']);router[_0x6a7f('0x5')]('/describe',auth[_0x6a7f('0x6')](),controller[_0x6a7f('0x7')]);router[_0x6a7f('0x5')]('/:id',auth[_0x6a7f('0x6')](),controller['show']);router[_0x6a7f('0x5')]('/:id/dispositions',auth[_0x6a7f('0x6')](),controller[_0x6a7f('0x8')]);router[_0x6a7f('0x5')](_0x6a7f('0x9'),auth['isAuthenticated'](),controller[_0x6a7f('0xa')]);router[_0x6a7f('0x5')](_0x6a7f('0xb'),auth[_0x6a7f('0x6')](),controller[_0x6a7f('0xc')]);router[_0x6a7f('0x5')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x6a7f('0xd')]);router[_0x6a7f('0x5')](_0x6a7f('0xe'),auth[_0x6a7f('0x6')](),controller[_0x6a7f('0xf')]);router['post']('/',auth[_0x6a7f('0x6')](),controller['create']);router['post'](_0x6a7f('0x10'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x6a7f('0x11')](_0x6a7f('0x9'),auth['isAuthenticated'](),controller[_0x6a7f('0x12')]);router['post']('/:id/notify',controller['notify']);router['post'](_0x6a7f('0xb'),auth[_0x6a7f('0x6')](),controller[_0x6a7f('0x13')]);router[_0x6a7f('0x11')](_0x6a7f('0xe'),auth[_0x6a7f('0x6')](),controller['addAgents']);router['post']('/:id/send',auth[_0x6a7f('0x6')](),controller['send']);router[_0x6a7f('0x14')](_0x6a7f('0x15'),auth[_0x6a7f('0x6')](),controller[_0x6a7f('0x16')]);router[_0x6a7f('0x17')](_0x6a7f('0x15'),auth[_0x6a7f('0x6')](),controller[_0x6a7f('0x18')]);router[_0x6a7f('0x17')](_0x6a7f('0x10'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x6a7f('0x17')](_0x6a7f('0x9'),auth['isAuthenticated'](),controller['removeAnswers']);router['delete'](_0x6a7f('0xe'),auth[_0x6a7f('0x6')](),controller[_0x6a7f('0x19')]);module[_0x6a7f('0x1a')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 6c6f314..ecdab2d 100644 --- a/server/api/openchannelAccount/openchannelAccount.attributes.js +++ b/server/api/openchannelAccount/openchannelAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9a47=['mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId'];(function(_0x3bbd21,_0x23f22d){var _0x11908b=function(_0x337f92){while(--_0x337f92){_0x3bbd21['push'](_0x3bbd21['shift']());}};_0x11908b(++_0x23f22d);}(_0x9a47,0x189));var _0x79a4=function(_0x1610c9,_0x6da33c){_0x1610c9=_0x1610c9-0x0;var _0x42f069=_0x9a47[_0x1610c9];return _0x42f069;};'use strict';var Sequelize=require(_0x79a4('0x0'));var rs=require(_0x79a4('0x1'));module[_0x79a4('0x2')]={'name':{'type':Sequelize[_0x79a4('0x3')],'unique':_0x79a4('0x4'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x79a4('0x3')],'defaultValue':function(){return rs[_0x79a4('0x5')]();}},'replyUri':{'type':Sequelize[_0x79a4('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x79a4('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x79a4('0x6')],'defaultValue':function(){return _0x79a4('0x7');}},'notificationSound':{'type':Sequelize[_0x79a4('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x79a4('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x79a4('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x79a4('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x79a4('0x3')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x79a4('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x79a4('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x79a4('0x9')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x79a4('0x8')],'defaultValue':![],'comment':_0x79a4('0xa'),'set':function(_0x54f16f){if(!_0x54f16f)this[_0x79a4('0xb')](_0x79a4('0xc'),null);this[_0x79a4('0xb')](_0x79a4('0xd'),_0x54f16f);}}}; \ No newline at end of file +var _0x2bca=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','TEXT','BOOLEAN','INTEGER'];(function(_0x229caa,_0x5867ac){var _0xbcf32f=function(_0x1c8797){while(--_0x1c8797){_0x229caa['push'](_0x229caa['shift']());}};_0xbcf32f(++_0x5867ac);}(_0x2bca,0x157));var _0xa2bc=function(_0x4596d1,_0x3c87b5){_0x4596d1=_0x4596d1-0x0;var _0x3225e5=_0x2bca[_0x4596d1];return _0x3225e5;};'use strict';var Sequelize=require(_0xa2bc('0x0'));var rs=require(_0xa2bc('0x1'));module[_0xa2bc('0x2')]={'name':{'type':Sequelize[_0xa2bc('0x3')],'unique':_0xa2bc('0x4'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xa2bc('0x3')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0xa2bc('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xa2bc('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xa2bc('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa2bc('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa2bc('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xa2bc('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xa2bc('0x3')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa2bc('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa2bc('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xa2bc('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xa2bc('0x6')],'defaultValue':![],'comment':_0xa2bc('0x9'),'set':function(_0x2056ee){if(!_0x2056ee)this[_0xa2bc('0xa')](_0xa2bc('0xb'),null);this[_0xa2bc('0xa')](_0xa2bc('0xc'),_0x2056ee);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 0e7d14a..5cd3cf5 100644 --- a/server/api/openchannelAccount/openchannelAccount.controller.js +++ b/server/api/openchannelAccount/openchannelAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8784=['http','client','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','save','update','OpenchannelAccounts','destroy','stack','name','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','find','create','body','get','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','hasOwnProperty','removeDispositions','addAnswer','CannedAnswer','getAnswers','nolimit','removeAnswers','notify','CmContact','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','List','Contacts','DESC','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','asc','contact','firstName','lastName','threadId','externalUrl','ContactId','OpenchannelInteraction','spread','messageId','interaction','created','autoclose','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','queueId','OpenchannelQueue','waitForTheAssignedQueue','EventManager','addApplications','sequelize','Transaction','ISOLATION_LEVELS','bulkCreate','findAndCountAll','finally','send','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','ids','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','CmList','out','Messages','dataValues','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','register'];(function(_0x575b72,_0x1a7eb1){var _0x561c57=function(_0x10e401){while(--_0x10e401){_0x575b72['push'](_0x575b72['shift']());}};_0x561c57(++_0x1a7eb1);}(_0x8784,0x172));var _0x4878=function(_0x49aa7d,_0x5d46d8){_0x49aa7d=_0x49aa7d-0x0;var _0xdd0d26=_0x8784[_0x49aa7d];return _0xdd0d26;};'use strict';var emlformat=require(_0x4878('0x0'));var rimraf=require(_0x4878('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4878('0x2'));var rp=require(_0x4878('0x3'));var moment=require(_0x4878('0x4'));var BPromise=require(_0x4878('0x5'));var Mustache=require(_0x4878('0x6'));var util=require('util');var path=require('path');var sox=require(_0x4878('0x7'));var csv=require(_0x4878('0x8'));var ejs=require(_0x4878('0x9'));var fs=require('fs');var fs_extra=require(_0x4878('0xa'));var _=require(_0x4878('0xb'));var squel=require(_0x4878('0xc'));var crypto=require(_0x4878('0xd'));var jsforce=require(_0x4878('0xe'));var deskjs=require(_0x4878('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4878('0x10'));var Papa=require(_0x4878('0x11'));var Redis=require(_0x4878('0x12'));var authService=require(_0x4878('0x13'));var qs=require(_0x4878('0x14'));var as=require(_0x4878('0x15'));var hardwareService=require(_0x4878('0x16'));var logger=require(_0x4878('0x17'))(_0x4878('0x18'));var utils=require(_0x4878('0x19'));var config=require(_0x4878('0x1a'));var licenseUtil=require(_0x4878('0x1b'));var db=require('../../mysqldb')['db'];config[_0x4878('0x1c')]=_[_0x4878('0x1d')](config[_0x4878('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x4878('0x1e'))(new Redis(config[_0x4878('0x1c')]));require('./openchannelAccount.socket')[_0x4878('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x4878('0x20')]({'port':0x232c});var client9002=jayson[_0x4878('0x21')][_0x4878('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x297b43,_0x37a150,_0x4a6e5e,_0x27ed83){return new BPromise(function(_0x25282f,_0x5abcfc){var _0x4319a8=_0x27ed83||client;return _0x4319a8['request'](_0x297b43,_0x4a6e5e)[_0x4878('0x22')](function(_0x4baa5e){logger['info'](_0x4878('0x23'),_0x37a150,_0x4878('0x24'));logger[_0x4878('0x25')](_0x4878('0x26'),_0x37a150,_0x4878('0x24'),JSON['stringify'](_0x4baa5e));if(_0x4baa5e[_0x4878('0x27')]){if(_0x4baa5e[_0x4878('0x27')][_0x4878('0x28')]===0x1f4){logger[_0x4878('0x27')](_0x4878('0x23'),_0x37a150,_0x4baa5e[_0x4878('0x27')]['message']);return _0x5abcfc(_0x4baa5e[_0x4878('0x27')][_0x4878('0x29')]);}logger[_0x4878('0x27')]('OpenchannelAccount,\x20%s,\x20%s',_0x37a150,_0x4baa5e[_0x4878('0x27')][_0x4878('0x29')]);return _0x25282f(_0x4baa5e['error'][_0x4878('0x29')]);}else{logger[_0x4878('0x2a')](_0x4878('0x23'),_0x37a150,'request\x20sent');_0x25282f(_0x4baa5e[_0x4878('0x2b')][_0x4878('0x29')]);}})[_0x4878('0x2c')](function(_0x476ec3){logger[_0x4878('0x27')]('OpenchannelAccount,\x20%s,\x20%s',_0x37a150,_0x476ec3);_0x5abcfc(_0x476ec3);});});}function respondWithStatusCode(_0x1ff1c4,_0x4458fb){_0x4458fb=_0x4458fb||0xcc;return function(_0x522157){if(_0x522157){return _0x1ff1c4[_0x4878('0x2d')](_0x4458fb);}return _0x1ff1c4[_0x4878('0x2e')](_0x4458fb)[_0x4878('0x2f')]();};}function respondWithResult(_0x2d7849,_0x43b9a0){_0x43b9a0=_0x43b9a0||0xc8;return function(_0x16bf4b){if(_0x16bf4b){return _0x2d7849[_0x4878('0x2e')](_0x43b9a0)[_0x4878('0x30')](_0x16bf4b);}};}function respondWithFilteredResult(_0xcff66b,_0xe7a731){return function(_0x3b09f1){if(_0x3b09f1){var _0x38400b=typeof _0xe7a731[_0x4878('0x31')]==='undefined'&&typeof _0xe7a731[_0x4878('0x32')]===_0x4878('0x33');var _0x4f3622=_0x3b09f1['count'];var _0x41908f=_0x38400b?0x0:_0xe7a731[_0x4878('0x31')];var _0x45432e=_0x38400b?_0x3b09f1[_0x4878('0x34')]:_0xe7a731[_0x4878('0x31')]+_0xe7a731[_0x4878('0x32')];var _0x406e1a;if(_0x45432e>=_0x4f3622){_0x45432e=_0x4f3622;_0x406e1a=0xc8;}else{_0x406e1a=0xce;}_0xcff66b['status'](_0x406e1a);return _0xcff66b[_0x4878('0x35')](_0x4878('0x36'),_0x41908f+'-'+_0x45432e+'/'+_0x4f3622)[_0x4878('0x30')](_0x3b09f1);}return null;};}function patchUpdates(_0xae0447){return function(_0x6b2fae){try{jsonpatch['apply'](_0x6b2fae,_0xae0447,!![]);}catch(_0x5d5f5a){return BPromise['reject'](_0x5d5f5a);}return _0x6b2fae[_0x4878('0x37')]();};}function saveUpdates(_0x19c881,_0x44e796){return function(_0x4a2d6d){if(_0x4a2d6d){return _0x4a2d6d[_0x4878('0x38')](_0x19c881)[_0x4878('0x22')](function(_0x50fe9d){return _0x50fe9d;});}return null;};}function removeEntity(_0x232457,_0x58fc62){return function(_0xcdb929){if(_0xcdb929){return _0xcdb929['destroy']()['then'](function(){var _0x179116=_0xcdb929['get']({'plain':!![]});var _0x2bfb91=_0x4878('0x39');return db['UserProfileResource'][_0x4878('0x3a')]({'where':{'type':_0x2bfb91,'resourceId':_0x179116['id']}})[_0x4878('0x22')](function(){return _0xcdb929;});})['then'](function(){_0x232457[_0x4878('0x2e')](0xcc)[_0x4878('0x2f')]();});}};}function handleEntityNotFound(_0x54ee6b,_0x1c3bae){return function(_0x5ae2e8){if(!_0x5ae2e8){_0x54ee6b[_0x4878('0x2d')](0x194);}return _0x5ae2e8;};}function handleError(_0x38f9c8,_0x1e939c){_0x1e939c=_0x1e939c||0x1f4;return function(_0x232471){logger['error'](_0x232471[_0x4878('0x3b')]);if(_0x232471[_0x4878('0x3c')]){delete _0x232471[_0x4878('0x3c')];}_0x38f9c8[_0x4878('0x2e')](_0x1e939c)['send'](_0x232471);};}exports[_0x4878('0x3d')]=function(_0x48b7f3,_0x1b4380){var _0x1c0736={'include':[{'model':db[_0x4878('0x3e')],'as':_0x4878('0x3f')}]},_0x5bcab4={},_0x225708={'count':0x0,'rows':[]};var _0x2a12d3=_[_0x4878('0x40')](db[_0x4878('0x41')][_0x4878('0x42')],function(_0x472de6){return{'name':_0x472de6[_0x4878('0x43')],'type':_0x472de6['type'][_0x4878('0x44')]};});_0x5bcab4[_0x4878('0x45')]=_[_0x4878('0x40')](_0x2a12d3,_0x4878('0x3c'));_0x5bcab4[_0x4878('0x46')]=_[_0x4878('0x47')](_0x48b7f3[_0x4878('0x46')]);_0x5bcab4['filters']=_[_0x4878('0x48')](_0x5bcab4[_0x4878('0x45')],_0x5bcab4[_0x4878('0x46')]);_0x1c0736[_0x4878('0x49')]=_[_0x4878('0x48')](_0x5bcab4[_0x4878('0x45')],qs[_0x4878('0x4a')](_0x48b7f3[_0x4878('0x46')][_0x4878('0x4a')]));_0x1c0736['attributes']=_0x1c0736[_0x4878('0x49')][_0x4878('0x4b')]?_0x1c0736['attributes']:_0x5bcab4[_0x4878('0x45')];if(!_0x48b7f3[_0x4878('0x46')]['hasOwnProperty']('nolimit')){_0x1c0736[_0x4878('0x32')]=qs['limit'](_0x48b7f3[_0x4878('0x46')]['limit']);_0x1c0736[_0x4878('0x31')]=qs[_0x4878('0x31')](_0x48b7f3[_0x4878('0x46')][_0x4878('0x31')]);}_0x1c0736[_0x4878('0x4c')]=qs[_0x4878('0x4d')](_0x48b7f3['query']['sort']);_0x1c0736[_0x4878('0x4e')]=qs[_0x4878('0x4f')](_[_0x4878('0x50')](_0x48b7f3[_0x4878('0x46')],_0x5bcab4[_0x4878('0x4f')]),_0x2a12d3);if(_0x48b7f3['query']['filter']){_0x1c0736[_0x4878('0x4e')]=_[_0x4878('0x51')](_0x1c0736['where'],{'$or':_['map'](_0x2a12d3,function(_0x34d2b2){if(_0x34d2b2[_0x4878('0x52')]!==_0x4878('0x53')){var _0x168893={};_0x168893[_0x34d2b2['name']]={'$like':'%'+_0x48b7f3[_0x4878('0x46')][_0x4878('0x54')]+'%'};return _0x168893;}})});}_0x1c0736=_[_0x4878('0x51')]({},_0x1c0736,_0x48b7f3[_0x4878('0x55')]);var _0x4f1e52={'where':_0x1c0736[_0x4878('0x4e')]};return db[_0x4878('0x41')]['count'](_0x4f1e52)[_0x4878('0x22')](function(_0x3644a8){_0x225708[_0x4878('0x34')]=_0x3644a8;if(_0x48b7f3[_0x4878('0x46')][_0x4878('0x56')]){_0x1c0736[_0x4878('0x57')]=[{'all':!![]}];}return db[_0x4878('0x41')][_0x4878('0x58')](_0x1c0736);})[_0x4878('0x22')](function(_0x3ed0df){_0x225708[_0x4878('0x59')]=_0x3ed0df;return _0x225708;})[_0x4878('0x22')](respondWithFilteredResult(_0x1b4380,_0x1c0736))['catch'](handleError(_0x1b4380,null));};exports[_0x4878('0x5a')]=function(_0x5562b3,_0x4a6ce4){var _0x4364d9={'raw':![],'where':{'id':_0x5562b3['params']['id']},'include':[{'model':db[_0x4878('0x3e')],'as':_0x4878('0x3f')}]},_0x69ea93={};_0x69ea93[_0x4878('0x45')]=_[_0x4878('0x47')](db['OpenchannelAccount']['rawAttributes']);_0x69ea93[_0x4878('0x46')]=_[_0x4878('0x47')](_0x5562b3[_0x4878('0x46')]);_0x69ea93[_0x4878('0x4f')]=_[_0x4878('0x48')](_0x69ea93[_0x4878('0x45')],_0x69ea93['query']);_0x4364d9[_0x4878('0x49')]=_[_0x4878('0x48')](_0x69ea93[_0x4878('0x45')],qs[_0x4878('0x4a')](_0x5562b3['query'][_0x4878('0x4a')]));_0x4364d9[_0x4878('0x49')]=_0x4364d9[_0x4878('0x49')][_0x4878('0x4b')]?_0x4364d9[_0x4878('0x49')]:_0x69ea93[_0x4878('0x45')];if(_0x5562b3[_0x4878('0x46')][_0x4878('0x56')]){_0x4364d9[_0x4878('0x57')]=[{'all':!![]}];}_0x4364d9=_[_0x4878('0x51')]({},_0x4364d9,_0x5562b3[_0x4878('0x55')]);return db[_0x4878('0x41')][_0x4878('0x5b')](_0x4364d9)[_0x4878('0x22')](handleEntityNotFound(_0x4a6ce4,null))[_0x4878('0x22')](respondWithResult(_0x4a6ce4,null))[_0x4878('0x2c')](handleError(_0x4a6ce4,null));};exports['create']=function(_0x286497,_0x4234fd){return db[_0x4878('0x41')][_0x4878('0x5c')](_0x286497[_0x4878('0x5d')],{})[_0x4878('0x22')](function(_0x4931c3){var _0x22dbc5=_0x286497['user'][_0x4878('0x5e')]({'plain':!![]});if(!_0x22dbc5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x22dbc5[_0x4878('0x5f')]===_0x4878('0x60')){var _0x31e36b=_0x4931c3[_0x4878('0x5e')]({'plain':!![]});var _0x482853=_0x4878('0x39');return db[_0x4878('0x61')][_0x4878('0x5b')]({'where':{'name':_0x482853,'userProfileId':_0x22dbc5[_0x4878('0x62')]},'raw':!![]})[_0x4878('0x22')](function(_0x2f34c5){if(_0x2f34c5&&_0x2f34c5[_0x4878('0x63')]===0x0){return db[_0x4878('0x64')]['create']({'name':_0x31e36b[_0x4878('0x3c')],'resourceId':_0x31e36b['id'],'type':_0x2f34c5[_0x4878('0x3c')],'sectionId':_0x2f34c5['id']},{})[_0x4878('0x22')](function(){return _0x4931c3;});}else{return _0x4931c3;}})[_0x4878('0x2c')](function(_0x3cedf5){logger[_0x4878('0x27')](_0x4878('0x65'),_0x3cedf5);throw _0x3cedf5;});}return _0x4931c3;})[_0x4878('0x22')](respondWithResult(_0x4234fd,0xc9))['catch'](handleError(_0x4234fd,null));};exports[_0x4878('0x38')]=function(_0x121564,_0x32b507){if(_0x121564[_0x4878('0x5d')]['id']){delete _0x121564[_0x4878('0x5d')]['id'];}return db[_0x4878('0x41')][_0x4878('0x5b')]({'where':{'id':_0x121564[_0x4878('0x66')]['id']},'include':[{'model':db[_0x4878('0x3e')],'as':_0x4878('0x3f')}]})[_0x4878('0x22')](handleEntityNotFound(_0x32b507,null))[_0x4878('0x22')](saveUpdates(_0x121564[_0x4878('0x5d')],null))[_0x4878('0x22')](respondWithResult(_0x32b507,null))[_0x4878('0x2c')](handleError(_0x32b507,null));};exports[_0x4878('0x3a')]=function(_0x163d6e,_0x23035f){return db[_0x4878('0x41')][_0x4878('0x5b')]({'where':{'id':_0x163d6e[_0x4878('0x66')]['id']}})['then'](handleEntityNotFound(_0x23035f,null))[_0x4878('0x22')](removeEntity(_0x23035f,null))[_0x4878('0x2c')](handleError(_0x23035f,null));};exports[_0x4878('0x67')]=function(_0x26e888,_0x23aae7){return db[_0x4878('0x41')][_0x4878('0x67')]()['then'](respondWithResult(_0x23aae7,null))[_0x4878('0x2c')](handleError(_0x23aae7,null));};exports[_0x4878('0x68')]=function(_0x2d9cc4,_0x45a852,_0x133528){if(_0x2d9cc4[_0x4878('0x5d')]['id']){delete _0x2d9cc4['body']['id'];}return db[_0x4878('0x41')][_0x4878('0x5b')]({'where':{'id':_0x2d9cc4[_0x4878('0x66')]['id']}})[_0x4878('0x22')](handleEntityNotFound(_0x45a852,null))[_0x4878('0x22')](function(_0x3e8e11){if(_0x3e8e11){_0x2d9cc4[_0x4878('0x5d')][_0x4878('0x69')]=_0x3e8e11['id'];return db[_0x4878('0x6a')][_0x4878('0x5c')](_0x2d9cc4['body']);}})[_0x4878('0x22')](respondWithResult(_0x45a852,null))[_0x4878('0x2c')](handleError(_0x45a852,null));};exports[_0x4878('0x6b')]=function(_0x2d35a2,_0x5df328,_0x2b5e1b){var _0x3dc542={'raw':![],'where':{}};var _0x565a10={};var _0x27e16f={'count':0x0,'rows':[]};return db[_0x4878('0x41')][_0x4878('0x6c')]({'where':{'id':_0x2d35a2[_0x4878('0x66')]['id']}})['then'](handleEntityNotFound(_0x5df328,null))[_0x4878('0x22')](function(_0x29858e){if(_0x29858e){_0x565a10[_0x4878('0x45')]=_['keys'](db['Disposition'][_0x4878('0x42')]);_0x565a10['query']=_[_0x4878('0x47')](_0x2d35a2[_0x4878('0x46')]);_0x565a10['filters']=_[_0x4878('0x48')](_0x565a10[_0x4878('0x45')],_0x565a10[_0x4878('0x46')]);_0x3dc542[_0x4878('0x49')]=_['intersection'](_0x565a10['model'],qs[_0x4878('0x4a')](_0x2d35a2[_0x4878('0x46')][_0x4878('0x4a')]));_0x3dc542[_0x4878('0x49')]=_0x3dc542['attributes'][_0x4878('0x4b')]?_0x3dc542['attributes']:_0x565a10[_0x4878('0x45')];if(!_0x2d35a2[_0x4878('0x46')][_0x4878('0x6d')]('nolimit')){_0x3dc542[_0x4878('0x32')]=qs[_0x4878('0x32')](_0x2d35a2['query'][_0x4878('0x32')]);_0x3dc542['offset']=qs['offset'](_0x2d35a2[_0x4878('0x46')][_0x4878('0x31')]);}_0x3dc542[_0x4878('0x4c')]=qs[_0x4878('0x4d')](_0x2d35a2[_0x4878('0x46')][_0x4878('0x4d')]);_0x3dc542[_0x4878('0x4e')]=qs[_0x4878('0x4f')](_[_0x4878('0x50')](_0x2d35a2['query'],_0x565a10['filters']));_0x3dc542[_0x4878('0x4e')]['OpenchannelAccountId']=_0x29858e['id'];if(_0x2d35a2[_0x4878('0x46')][_0x4878('0x54')]){_0x3dc542[_0x4878('0x4e')]=_[_0x4878('0x51')](_0x3dc542[_0x4878('0x4e')],{'$or':_[_0x4878('0x40')](_0x3dc542[_0x4878('0x49')],function(_0x1ddc2d){var _0x38dc96={};_0x38dc96[_0x1ddc2d]={'$like':'%'+_0x2d35a2[_0x4878('0x46')][_0x4878('0x54')]+'%'};return _0x38dc96;})});}_0x3dc542=_[_0x4878('0x51')]({},_0x3dc542,_0x2d35a2[_0x4878('0x55')]);return db['Disposition'][_0x4878('0x34')]({'where':_0x3dc542[_0x4878('0x4e')]})[_0x4878('0x22')](function(_0x3c007a){_0x27e16f[_0x4878('0x34')]=_0x3c007a;if(_0x2d35a2[_0x4878('0x46')][_0x4878('0x56')]){_0x3dc542[_0x4878('0x57')]=[{'all':!![]}];}return db[_0x4878('0x6a')][_0x4878('0x58')](_0x3dc542);})['then'](function(_0x4e1784){_0x27e16f['rows']=_0x4e1784;return _0x27e16f;});}})['then'](respondWithFilteredResult(_0x5df328,_0x3dc542))[_0x4878('0x2c')](handleError(_0x5df328,null));};exports['removeDispositions']=function(_0x5ccc1a,_0x5842fa,_0x7661a0){return db[_0x4878('0x41')][_0x4878('0x5b')]({'where':{'id':_0x5ccc1a[_0x4878('0x66')]['id']}})[_0x4878('0x22')](handleEntityNotFound(_0x5842fa,null))[_0x4878('0x22')](function(_0x5f2d24){if(_0x5f2d24){return _0x5f2d24[_0x4878('0x6e')](_0x5ccc1a[_0x4878('0x46')]['ids']);}})[_0x4878('0x22')](respondWithStatusCode(_0x5842fa,null))[_0x4878('0x2c')](handleError(_0x5842fa,null));};exports[_0x4878('0x6f')]=function(_0x5c8ee3,_0x48fd00,_0x3554a4){if(_0x5c8ee3[_0x4878('0x5d')]['id']){delete _0x5c8ee3[_0x4878('0x5d')]['id'];}return db[_0x4878('0x41')][_0x4878('0x5b')]({'where':{'id':_0x5c8ee3['params']['id']}})[_0x4878('0x22')](handleEntityNotFound(_0x48fd00,null))[_0x4878('0x22')](function(_0x2d38ac){if(_0x2d38ac){_0x5c8ee3[_0x4878('0x5d')][_0x4878('0x69')]=_0x2d38ac['id'];return db[_0x4878('0x70')][_0x4878('0x5c')](_0x5c8ee3['body']);}})[_0x4878('0x22')](respondWithResult(_0x48fd00,null))[_0x4878('0x2c')](handleError(_0x48fd00,null));};exports[_0x4878('0x71')]=function(_0x182cee,_0xdaf834,_0x3c6a8c){var _0x49c27a={'raw':![],'where':{}};var _0x32c4d6={};var _0x3cea23={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x182cee[_0x4878('0x66')]['id']}})[_0x4878('0x22')](handleEntityNotFound(_0xdaf834,null))['then'](function(_0x37e855){if(_0x37e855){_0x32c4d6[_0x4878('0x45')]=_[_0x4878('0x47')](db[_0x4878('0x70')]['rawAttributes']);_0x32c4d6[_0x4878('0x46')]=_[_0x4878('0x47')](_0x182cee[_0x4878('0x46')]);_0x32c4d6[_0x4878('0x4f')]=_['intersection'](_0x32c4d6[_0x4878('0x45')],_0x32c4d6[_0x4878('0x46')]);_0x49c27a[_0x4878('0x49')]=_[_0x4878('0x48')](_0x32c4d6[_0x4878('0x45')],qs[_0x4878('0x4a')](_0x182cee[_0x4878('0x46')][_0x4878('0x4a')]));_0x49c27a[_0x4878('0x49')]=_0x49c27a[_0x4878('0x49')][_0x4878('0x4b')]?_0x49c27a[_0x4878('0x49')]:_0x32c4d6[_0x4878('0x45')];if(!_0x182cee[_0x4878('0x46')][_0x4878('0x6d')](_0x4878('0x72'))){_0x49c27a[_0x4878('0x32')]=qs[_0x4878('0x32')](_0x182cee['query'][_0x4878('0x32')]);_0x49c27a['offset']=qs[_0x4878('0x31')](_0x182cee['query'][_0x4878('0x31')]);}_0x49c27a[_0x4878('0x4c')]=qs[_0x4878('0x4d')](_0x182cee[_0x4878('0x46')][_0x4878('0x4d')]);_0x49c27a['where']=qs[_0x4878('0x4f')](_[_0x4878('0x50')](_0x182cee[_0x4878('0x46')],_0x32c4d6[_0x4878('0x4f')]));_0x49c27a[_0x4878('0x4e')][_0x4878('0x69')]=_0x37e855['id'];if(_0x182cee[_0x4878('0x46')][_0x4878('0x54')]){_0x49c27a[_0x4878('0x4e')]=_[_0x4878('0x51')](_0x49c27a[_0x4878('0x4e')],{'$or':_['map'](_0x49c27a[_0x4878('0x49')],function(_0x44fbfc){var _0xc44fc3={};_0xc44fc3[_0x44fbfc]={'$like':'%'+_0x182cee[_0x4878('0x46')][_0x4878('0x54')]+'%'};return _0xc44fc3;})});}_0x49c27a=_['merge']({},_0x49c27a,_0x182cee[_0x4878('0x55')]);return db[_0x4878('0x70')][_0x4878('0x34')]({'where':_0x49c27a[_0x4878('0x4e')]})[_0x4878('0x22')](function(_0x19d7a1){_0x3cea23['count']=_0x19d7a1;if(_0x182cee[_0x4878('0x46')]['includeAll']){_0x49c27a[_0x4878('0x57')]=[{'all':!![]}];}return db['CannedAnswer'][_0x4878('0x58')](_0x49c27a);})[_0x4878('0x22')](function(_0x52adcc){_0x3cea23[_0x4878('0x59')]=_0x52adcc;return _0x3cea23;});}})[_0x4878('0x22')](respondWithFilteredResult(_0xdaf834,_0x49c27a))[_0x4878('0x2c')](handleError(_0xdaf834,null));};exports[_0x4878('0x73')]=function(_0x3cc1da,_0x3d0a24,_0x161c36){return db[_0x4878('0x41')][_0x4878('0x5b')]({'where':{'id':_0x3cc1da[_0x4878('0x66')]['id']}})['then'](handleEntityNotFound(_0x3d0a24,null))[_0x4878('0x22')](function(_0x3bd2e3){if(_0x3bd2e3){return _0x3bd2e3[_0x4878('0x73')](_0x3cc1da['query']['ids']);}})['then'](respondWithStatusCode(_0x3d0a24,null))[_0x4878('0x2c')](handleError(_0x3d0a24,null));};exports[_0x4878('0x74')]=function(_0x4c7c6b,_0x8f0572,_0x185183){var _0x4469bd={'body':_0x4c7c6b[_0x4878('0x5d')],'channel':'openchannel'};var _0x2c63b5=[];var _0x473172=[];var _0x3ca1c9={};var _0x2e04f3=![];return db[_0x4878('0x75')][_0x4878('0x67')]()[_0x4878('0x22')](function(_0xf959c9){if(!_0xf959c9){throw new db['Sequelize'][(_0x4878('0x76'))](_0x4878('0x77'));}_0x2c63b5=_['difference'](_[_0x4878('0x47')](_0xf959c9),[_0x4878('0x78'),_0x4878('0x79')]);_0x473172=_[_0x4878('0x7a')](_['keys'](_0xf959c9),[_0x4878('0x78'),'updatedAt',_0x4878('0x7b'),_0x4878('0x7c')]);if(_0x4c7c6b[_0x4878('0x5d')]['id']){delete _0x4c7c6b['body']['id'];}if(_[_0x4878('0x7d')](_0x4c7c6b[_0x4878('0x5d')]['from'])){throw new db[(_0x4878('0x7e'))][(_0x4878('0x76'))](_0x4878('0x7f'));}if(_[_0x4878('0x7d')](_0x4c7c6b[_0x4878('0x5d')]['body'])||_0x4c7c6b[_0x4878('0x5d')]['body']===''){throw new db[(_0x4878('0x7e'))]['ValidationError'](_0x4878('0x80'));}if(_['isNil'](_0x4c7c6b['body'][_0x4878('0x81')])){throw new db[(_0x4878('0x7e'))]['ValidationError'](_0x4878('0x82')+_0x473172);}if(!_[_0x4878('0x83')](_0x473172,_0x4c7c6b['body'][_0x4878('0x81')])){throw new db['Sequelize'][(_0x4878('0x76'))](_0x4878('0x84')+_0x473172);}_0x3ca1c9[_0x4c7c6b[_0x4878('0x5d')][_0x4878('0x81')]]=_0x4c7c6b[_0x4878('0x5d')][_0x4878('0x85')];})[_0x4878('0x22')](function(){return db[_0x4878('0x41')][_0x4878('0x5b')]({'where':{'id':_0x4c7c6b['params']['id']},'include':[{'model':db['CmList'],'as':_0x4878('0x86'),'include':[{'model':db[_0x4878('0x75')],'as':_0x4878('0x87'),'where':_0x3ca1c9,'limit':0x1,'order':[[_0x4878('0x79'),_0x4878('0x88')]]}]},{'model':db[_0x4878('0x89')],'as':_0x4878('0x8a')}]});})['then'](handleEntityNotFound(_0x8f0572,null))[_0x4878('0x22')](function(_0x4d03ed){if(_0x4d03ed&&_0x4d03ed[_0x4878('0x86')]){_0x4469bd[_0x4878('0x8b')]=_0x4d03ed;_0x4469bd[_0x4878('0x8c')]=_0x4d03ed[_0x4878('0x8a')];_0x4469bd[_0x4878('0x8d')]=_0x4d03ed[_0x4878('0x86')];_0x4469bd[_0x4878('0x8c')]=_[_0x4878('0x8e')](_0x4469bd['applications'],[_0x4878('0x8f')],[_0x4878('0x90')]);if(_0x4469bd[_0x4878('0x8b')][_0x4878('0x8a')]){delete _0x4469bd[_0x4878('0x8b')]['Applications'];}if(_0x4469bd[_0x4878('0x8b')][_0x4878('0x86')]&&_0x4469bd['account'][_0x4878('0x86')]['Contacts'][_0x4878('0x4b')]){return _0x4469bd['account'][_0x4878('0x86')][_0x4878('0x87')][0x0];}var _0x1d657b=_['defaults'](_0x4c7c6b[_0x4878('0x5d')],{'firstName':_0x4c7c6b[_0x4878('0x5d')][_0x4878('0x85')],'ListId':_0x4d03ed[_0x4878('0x7c')]});_0x1d657b[_0x4c7c6b['body'][_0x4878('0x81')]]=_0x4c7c6b[_0x4878('0x5d')][_0x4878('0x85')];return db[_0x4878('0x75')][_0x4878('0x5c')](_0x1d657b,{'fields':_0x2c63b5,'raw':!![]});}})['then'](handleEntityNotFound(_0x8f0572,null))[_0x4878('0x22')](function(_0x1bda55){_0x4469bd[_0x4878('0x91')]=_0x1bda55;if(_0x1bda55){var _0x4b775b={'ContactId':_0x1bda55['id'],'OpenchannelAccountId':_0x4c7c6b[_0x4878('0x66')]['id'],'from':(_0x1bda55[_0x4878('0x92')]||'')+'\x20'+(_0x1bda55[_0x4878('0x93')]||'')};var _0x23ffb9={'OpenchannelAccountId':_0x4c7c6b[_0x4878('0x66')]['id'],'closed':![]};if(_0x4c7c6b[_0x4878('0x5d')][_0x4878('0x94')]){_0x23ffb9[_0x4878('0x94')]=_0x4c7c6b[_0x4878('0x5d')]['threadId'];return db['OpenchannelInteraction'][_0x4878('0x5b')]({'where':_0x23ffb9})[_0x4878('0x22')](function(_0x5b3251){if(_0x5b3251){return[_0x5b3251,![]];}_0x4b775b['threadId']=_0x4c7c6b[_0x4878('0x5d')][_0x4878('0x94')];_0x4b775b[_0x4878('0x95')]=_0x4c7c6b['body'][_0x4878('0x95')];return db['OpenchannelInteraction']['create'](_0x4b775b)[_0x4878('0x22')](function(_0x482e00){return[_0x482e00,!![]];});});}else{_0x23ffb9[_0x4878('0x94')]=null;}_0x23ffb9[_0x4878('0x96')]=_0x1bda55['id'];return db[_0x4878('0x97')]['find']({'where':_0x23ffb9})[_0x4878('0x22')](function(_0x2ea4dc){if(_0x2ea4dc){return[_0x2ea4dc,![]];}return db[_0x4878('0x97')][_0x4878('0x5c')](_0x4b775b)[_0x4878('0x22')](function(_0x46e110){return[_0x46e110,!![]];});});}})[_0x4878('0x98')](function(_0x34c341,_0x196b5e){if(_0x34c341){_0x2e04f3=_0x196b5e;if(!_0x196b5e){var _0xd6ced5={'from':(_0x4469bd[_0x4878('0x91')]['firstName']||'')+'\x20'+(_0x4469bd[_0x4878('0x91')]['lastName']||'')};if(_0x4c7c6b[_0x4878('0x5d')][_0x4878('0x94')]&&_0x4c7c6b['body'][_0x4878('0x99')]&&_0x4c7c6b[_0x4878('0x5d')][_0x4878('0x94')]!=_0x4c7c6b[_0x4878('0x5d')][_0x4878('0x99')]){_0xd6ced5[_0x4878('0x94')]=_0x4c7c6b['body'][_0x4878('0x99')];}return _0x34c341[_0x4878('0x38')](_0xd6ced5);}else{return _0x34c341;}}})['then'](function(_0xb0b5b){_0x4469bd[_0x4878('0x9a')]=_0xb0b5b[_0x4878('0x5e')]({'plain':!![]});_0x4469bd['interaction'][_0x4878('0x9b')]=_0x2e04f3;if(_0x4469bd[_0x4878('0x9a')][_0x4878('0x9b')]){if(_0x4469bd[_0x4878('0x8b')][_0x4878('0x9c')]){_0x4469bd['applications']['push']({'id':0x0,'priority':_0x4469bd[_0x4878('0x8c')][_0x4878('0x4b')]+0x1,'app':_0x4878('0x9d'),'appdata':_0x4878('0x9e'),'interval':_0x4878('0x9f')});}}return db[_0x4878('0xa0')]['create']({'body':_0x4c7c6b['body'][_0x4878('0x5d')],'OpenchannelAccountId':_0x4c7c6b[_0x4878('0x66')]['id'],'OpenchannelInteractionId':_0xb0b5b['id'],'direction':'in','ContactId':_0x4469bd[_0x4878('0x91')]['id'],'AttachmentId':_0x4c7c6b[_0x4878('0x5d')][_0x4878('0xa1')]});})['then'](function(_0xbb5bc2){_0x4469bd[_0x4878('0x29')]=_0xbb5bc2;if(!_0x4469bd[_0x4878('0x9a')]['UserId'])return;return db[_0x4878('0xa2')][_0x4878('0x5b')]({'attributes':['id',_0x4878('0x3c')],'where':{'id':_0x4469bd[_0x4878('0x9a')][_0x4878('0xa3')]}});})[_0x4878('0x22')](function(_0x327000){if(_0x327000){_0x4469bd[_0x4878('0x8c')][_0x4878('0xa4')]({'id':0x0,'priority':0x0,'app':_0x4878('0xa5'),'appdata':_0x327000[_0x4878('0x3c')]+','+(_0x4469bd[_0x4878('0x8b')][_0x4878('0xa6')]||0xa),'interval':_0x4878('0x9f')});}if(!_0x4469bd['interaction'][_0x4878('0xa7')])return;return db[_0x4878('0xa8')]['find']({'attributes':['id',_0x4878('0x3c')],'where':{'id':_0x4469bd['interaction'][_0x4878('0xa7')]}});})[_0x4878('0x22')](function(_0x384707){if(_0x384707){_0x4469bd[_0x4878('0x8c')][_0x4878('0xa4')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x384707[_0x4878('0x3c')]+','+(_0x4469bd[_0x4878('0x8b')][_0x4878('0xa9')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start','startRouting',_0x4469bd);})[_0x4878('0x22')](function(_0x2342f7){respondWithRpcPromise(_0x4878('0xaa'),_0x4878('0xaa'),{'event':_0x4878('0x74'),'message':_0x2342f7},client9002);return _0x2342f7;})[_0x4878('0x22')](respondWithResult(_0x8f0572,null))[_0x4878('0x2c')](handleError(_0x8f0572,null));};exports[_0x4878('0xab')]=function(_0x2254a7,_0x259446){var _0x2a9808=_0x2254a7[_0x4878('0x66')]['id'];var _0x35fc36=_0x2254a7[_0x4878('0x5d')];var _0x37f710=0xc8;var _0x29f647=null;return db[_0x4878('0xac')]['transaction']({'isolationLevel':db[_0x4878('0xac')][_0x4878('0xad')][_0x4878('0xae')]['READ_COMMITTED']},function(_0x483b77){return db[_0x4878('0x41')][_0x4878('0x6c')]({'where':{'id':_0x2a9808},'transaction':_0x483b77})['then'](function(_0x3b0378){if(_0x3b0378){return db[_0x4878('0x89')][_0x4878('0x3a')]({'where':{'OpenchannelAccountId':_0x2a9808},'transaction':_0x483b77})['then'](function(){var _0x7fe963=_['map'](_0x35fc36,function(_0x274524){_0x274524['OpenchannelAccountId']=_0x2a9808;return _0x274524;});return db[_0x4878('0x89')][_0x4878('0xaf')](_0x7fe963,{'transaction':_0x483b77});});}else{_0x37f710=0x194;_0x29f647=[];}});})[_0x4878('0x22')](function(){if(_0x37f710!==0x194){return db[_0x4878('0x89')][_0x4878('0xb0')]({'where':{'OpenchannelAccountId':_0x2a9808},'order':_0x4878('0x8f')})['then'](function(_0x2d393c){_0x29f647=_0x2d393c;});}})[_0x4878('0x2c')](function(_0x4fc880){_0x37f710=0x1f4;logger[_0x4878('0x27')](_0x4fc880[_0x4878('0x3b')]);if(_0x4fc880['name']){delete _0x4fc880['name'];}_0x29f647=_0x4fc880;})[_0x4878('0xb1')](function(){if(_0x29f647===null){_0x259446[_0x4878('0x2d')](_0x37f710);}else{if(_0x37f710===0x1f4){_0x259446['status'](_0x37f710)[_0x4878('0xb2')](_0x29f647);}else{_0x259446[_0x4878('0x2e')](_0x37f710)['json'](_0x29f647);}}});};exports['getApplications']=function(_0x589248,_0x1229b9,_0x56d52a){var _0x39b8eb={};var _0x1a38e1={};var _0x2b6ac6;var _0x326e66;return db[_0x4878('0x41')][_0x4878('0x6c')]({'where':{'id':_0x589248['params']['id']}})['then'](handleEntityNotFound(_0x1229b9,null))[_0x4878('0x22')](function(_0x50412e){if(_0x50412e){_0x2b6ac6=_0x50412e;_0x1a38e1[_0x4878('0x45')]=_[_0x4878('0x47')](db[_0x4878('0x89')]['rawAttributes']);_0x1a38e1['query']=_[_0x4878('0x47')](_0x589248[_0x4878('0x46')]);_0x1a38e1[_0x4878('0x4f')]=_['intersection'](_0x1a38e1[_0x4878('0x45')],_0x1a38e1[_0x4878('0x46')]);_0x39b8eb['attributes']=_['intersection'](_0x1a38e1[_0x4878('0x45')],qs[_0x4878('0x4a')](_0x589248['query'][_0x4878('0x4a')]));_0x39b8eb['attributes']=_0x39b8eb['attributes'][_0x4878('0x4b')]?_0x39b8eb[_0x4878('0x49')]:_0x1a38e1[_0x4878('0x45')];_0x39b8eb['order']=qs[_0x4878('0x4d')](_0x589248['query'][_0x4878('0x4d')]);_0x39b8eb['where']=qs['filters'](_[_0x4878('0x50')](_0x589248[_0x4878('0x46')],_0x1a38e1[_0x4878('0x4f')]));if(_0x589248[_0x4878('0x46')][_0x4878('0x54')]){_0x39b8eb[_0x4878('0x4e')]=_['merge'](_0x39b8eb[_0x4878('0x4e')],{'$or':_[_0x4878('0x40')](_0x39b8eb[_0x4878('0x49')],function(_0x580ad7){var _0x26fbe8={};_0x26fbe8[_0x580ad7]={'$like':'%'+_0x589248[_0x4878('0x46')]['filter']+'%'};return _0x26fbe8;})});}_0x39b8eb=_[_0x4878('0x51')]({},_0x39b8eb,_0x589248[_0x4878('0x55')]);return _0x2b6ac6['getApplications'](_0x39b8eb);}})[_0x4878('0x22')](function(_0x14a8ad){if(_0x14a8ad){_0x326e66=_0x14a8ad[_0x4878('0x4b')];if(!_0x589248[_0x4878('0x46')][_0x4878('0x6d')]('nolimit')){_0x39b8eb[_0x4878('0x32')]=qs[_0x4878('0x32')](_0x589248[_0x4878('0x46')][_0x4878('0x32')]);_0x39b8eb[_0x4878('0x31')]=qs[_0x4878('0x31')](_0x589248[_0x4878('0x46')]['offset']);}return _0x2b6ac6['getApplications'](_0x39b8eb);}})[_0x4878('0x22')](function(_0x23c771){if(_0x23c771){return _0x23c771?{'count':_0x326e66,'rows':_0x23c771}:null;}})[_0x4878('0x22')](respondWithResult(_0x1229b9,null))[_0x4878('0x2c')](handleError(_0x1229b9,null));};exports[_0x4878('0xb3')]=function(_0x4302bc,_0x58220e,_0x30ca5b){var _0x3af4ad={'raw':![],'where':{}};var _0x3cc570={};var _0x3e38fe={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x4878('0x6c')]({'where':{'id':_0x4302bc[_0x4878('0x66')]['id']}})[_0x4878('0x22')](handleEntityNotFound(_0x58220e,null))['then'](function(_0x462b1b){if(_0x462b1b){_0x3cc570[_0x4878('0x45')]=_[_0x4878('0x47')](db[_0x4878('0x97')][_0x4878('0x42')]);_0x3cc570[_0x4878('0x46')]=_[_0x4878('0x47')](_0x4302bc[_0x4878('0x46')]);_0x3cc570[_0x4878('0x4f')]=_[_0x4878('0x48')](_0x3cc570[_0x4878('0x45')],_0x3cc570[_0x4878('0x46')]);_0x3af4ad[_0x4878('0x49')]=_['intersection'](_0x3cc570['model'],qs['fields'](_0x4302bc[_0x4878('0x46')][_0x4878('0x4a')]));_0x3af4ad['attributes']=_0x3af4ad[_0x4878('0x49')]['length']?_0x3af4ad['attributes']:_0x3cc570['model'];if(!_0x4302bc[_0x4878('0x46')][_0x4878('0x6d')](_0x4878('0x72'))){_0x3af4ad[_0x4878('0x32')]=qs[_0x4878('0x32')](_0x4302bc[_0x4878('0x46')][_0x4878('0x32')]);_0x3af4ad[_0x4878('0x31')]=qs[_0x4878('0x31')](_0x4302bc[_0x4878('0x46')][_0x4878('0x31')]);}_0x3af4ad[_0x4878('0x4c')]=qs[_0x4878('0x4d')](_0x4302bc[_0x4878('0x46')][_0x4878('0x4d')]);_0x3af4ad[_0x4878('0x4e')]=qs[_0x4878('0x4f')](_[_0x4878('0x50')](_0x4302bc['query'],_0x3cc570['filters']));_0x3af4ad[_0x4878('0x4e')][_0x4878('0x69')]=_0x462b1b['id'];if(_0x4302bc[_0x4878('0x46')][_0x4878('0x54')]){_0x3af4ad[_0x4878('0x4e')]=_[_0x4878('0x51')](_0x3af4ad['where'],{'$or':_[_0x4878('0x40')](_0x3af4ad[_0x4878('0x49')],function(_0x5ab3a8){var _0x58c3b6={};_0x58c3b6[_0x5ab3a8]={'$like':'%'+_0x4302bc['query'][_0x4878('0x54')]+'%'};return _0x58c3b6;})});}_0x3af4ad=_['merge']({},_0x3af4ad,_0x4302bc[_0x4878('0x55')]);return db[_0x4878('0x97')][_0x4878('0x34')]({'where':_0x3af4ad[_0x4878('0x4e')]})['then'](function(_0x5bda3a){_0x3e38fe[_0x4878('0x34')]=_0x5bda3a;if(_0x4302bc[_0x4878('0x46')]['includeAll']){_0x3af4ad[_0x4878('0x57')]=[{'model':db['CmContact'],'as':_0x4878('0xb4'),'required':![]},{'model':db['User'],'as':_0x4878('0xb5'),'attributes':['name',_0x4878('0xb6'),_0x4878('0xb7')],'required':![]},{'model':db[_0x4878('0xb8')],'as':_0x4878('0xb9'),'attributes':['id',_0x4878('0x3c'),_0x4878('0xba')],'where':_0x4302bc[_0x4878('0x46')][_0x4878('0xbb')]?{'id':_0x4302bc['query']['tag']}:undefined,'required':_0x4302bc[_0x4878('0x46')]['tag']?!![]:![]}];}return db[_0x4878('0x97')]['findAll'](_0x3af4ad);})[_0x4878('0x22')](function(_0x199c90){_0x3e38fe[_0x4878('0x59')]=_0x199c90;return _0x3e38fe;});}})['then'](respondWithFilteredResult(_0x58220e,_0x3af4ad))['catch'](handleError(_0x58220e,null));};exports[_0x4878('0xbc')]=function(_0x423d9c,_0x3299d4,_0x5ccb27){return db[_0x4878('0x41')][_0x4878('0x5b')]({'where':{'id':_0x423d9c[_0x4878('0x66')]['id']}})[_0x4878('0x22')](handleEntityNotFound(_0x3299d4,null))[_0x4878('0x22')](function(_0x4197ae){if(_0x4197ae){return _0x4197ae[_0x4878('0xbc')](_0x423d9c[_0x4878('0x5d')][_0x4878('0xbd')],_[_0x4878('0xbe')](_0x423d9c['body'],[_0x4878('0xbd'),'id'])||{})['spread'](function(_0x1331ca){for(var _0x305161=0x0;_0x305161<_0x423d9c['body'][_0x4878('0xbd')][_0x4878('0x4b')];_0x305161+=0x1){socket[_0x4878('0xbf')](_0x4878('0xc0'),{'UserId':Number(_0x423d9c['body']['ids'][_0x305161]),'OpenchannelAccountId':Number(_0x423d9c[_0x4878('0x66')]['id'])});}return _0x1331ca;});}})[_0x4878('0x22')](respondWithResult(_0x3299d4,null))[_0x4878('0x2c')](handleError(_0x3299d4,null));};exports[_0x4878('0xc1')]=function(_0xeeb31b,_0x441029,_0x6e6cec){return db['OpenchannelAccount'][_0x4878('0x5b')]({'where':{'id':_0xeeb31b[_0x4878('0x66')]['id']}})[_0x4878('0x22')](handleEntityNotFound(_0x441029,null))[_0x4878('0x22')](function(_0x388dfa){if(_0x388dfa){return _0x388dfa['removeAgents'](_0xeeb31b['query'][_0x4878('0xbd')])[_0x4878('0x22')](function(){if(_[_0x4878('0xc2')](_0xeeb31b['query']['ids'])){for(var _0x1f2c57=0x0;_0x1f2c57<_0xeeb31b[_0x4878('0x46')][_0x4878('0xbd')][_0x4878('0x4b')];_0x1f2c57+=0x1){socket[_0x4878('0xbf')](_0x4878('0xc3'),{'UserId':Number(_0xeeb31b[_0x4878('0x46')][_0x4878('0xbd')][_0x1f2c57]),'OpenchannelAccountId':Number(_0xeeb31b['params']['id'])});}}else{socket[_0x4878('0xbf')](_0x4878('0xc3'),{'UserId':Number(_0xeeb31b[_0x4878('0x46')][_0x4878('0xbd')]),'OpenchannelAccountId':Number(_0xeeb31b['params']['id'])});}});}})[_0x4878('0x22')](respondWithStatusCode(_0x441029,null))['catch'](handleError(_0x441029,null));};exports[_0x4878('0xc4')]=function(_0x1dd520,_0x576671,_0x2bdd6f){var _0x4e6702={};var _0x2a6bae={};var _0xcfcc03;var _0x566423;return db[_0x4878('0x41')][_0x4878('0x6c')]({'where':{'id':_0x1dd520[_0x4878('0x66')]['id']}})['then'](handleEntityNotFound(_0x576671,null))['then'](function(_0x116281){if(_0x116281){_0xcfcc03=_0x116281;_0x2a6bae['model']=_[_0x4878('0x47')](db[_0x4878('0xa2')][_0x4878('0x42')]);_0x2a6bae['query']=_[_0x4878('0x47')](_0x1dd520[_0x4878('0x46')]);_0x2a6bae[_0x4878('0x4f')]=_[_0x4878('0x48')](_0x2a6bae['model'],_0x2a6bae[_0x4878('0x46')]);_0x4e6702[_0x4878('0x49')]=_['intersection'](_0x2a6bae[_0x4878('0x45')],qs['fields'](_0x1dd520[_0x4878('0x46')][_0x4878('0x4a')]));_0x4e6702[_0x4878('0x49')]=_0x4e6702['attributes'][_0x4878('0x4b')]?_0x4e6702[_0x4878('0x49')]:_0x2a6bae[_0x4878('0x45')];_0x4e6702['order']=qs[_0x4878('0x4d')](_0x1dd520[_0x4878('0x46')]['sort']);_0x4e6702[_0x4878('0x4e')]=qs[_0x4878('0x4f')](_[_0x4878('0x50')](_0x1dd520['query'],_0x2a6bae[_0x4878('0x4f')]));if(_0x1dd520[_0x4878('0x46')][_0x4878('0x54')]){_0x4e6702['where']=_[_0x4878('0x51')](_0x4e6702['where'],{'$or':_[_0x4878('0x40')](_0x4e6702[_0x4878('0x49')],function(_0x1a10ac){var _0x58ed7a={};_0x58ed7a[_0x1a10ac]={'$like':'%'+_0x1dd520[_0x4878('0x46')][_0x4878('0x54')]+'%'};return _0x58ed7a;})});}_0x4e6702=_[_0x4878('0x51')]({},_0x4e6702,_0x1dd520['options']);return _0xcfcc03['getAgents'](_0x4e6702);}})[_0x4878('0x22')](function(_0x32f9b4){if(_0x32f9b4){_0x566423=_0x32f9b4['length'];if(!_0x1dd520['query'][_0x4878('0x6d')](_0x4878('0x72'))){_0x4e6702[_0x4878('0x32')]=qs[_0x4878('0x32')](_0x1dd520[_0x4878('0x46')]['limit']);_0x4e6702[_0x4878('0x31')]=qs[_0x4878('0x31')](_0x1dd520[_0x4878('0x46')][_0x4878('0x31')]);}return _0xcfcc03[_0x4878('0xc4')](_0x4e6702);}})[_0x4878('0x22')](function(_0x28e117){if(_0x28e117){return _0x28e117?{'count':_0x566423,'rows':_0x28e117}:null;}})[_0x4878('0x22')](respondWithResult(_0x576671,null))['catch'](handleError(_0x576671,null));};exports[_0x4878('0xb2')]=function(_0x232cc9,_0x253431,_0x5827af){var _0x4888a0,_0x33c78a,_0x4750e2;if(_['isNil'](_0x232cc9[_0x4878('0x5d')][_0x4878('0x5d')])||_0x232cc9['body'][_0x4878('0x5d')]===''){throw new db[(_0x4878('0x7e'))][(_0x4878('0x76'))](_0x4878('0x80'));}if(_[_0x4878('0x7d')](_0x232cc9[_0x4878('0x5d')]['to'])){}_0x4888a0=_0x232cc9[_0x4878('0x5d')]['to'];return db[_0x4878('0x41')][_0x4878('0x6c')]({'where':{'id':_0x232cc9['params']['id']}})[_0x4878('0x22')](handleEntityNotFound(_0x253431,null))[_0x4878('0x22')](function(_0x39c373){if(_0x39c373){return db[_0x4878('0x41')][_0x4878('0x5b')]({'where':{'id':_0x39c373['id']},'include':[{'model':db[_0x4878('0xc5')],'as':'List','include':[{'model':db['CmContact'],'as':_0x4878('0x87'),'where':{[_0x39c373['mapKey']]:_0x4888a0},'limit':0x1,'order':[[_0x4878('0x79'),_0x4878('0x88')]]}]}]})[_0x4878('0x22')](handleEntityNotFound(_0x253431,null))[_0x4878('0x22')](function(_0x92aeb6){if(_0x92aeb6&&_0x92aeb6[_0x4878('0x86')]){_0x33c78a=_0x92aeb6[_0x4878('0x5e')]({'plain':!![]});if(_0x33c78a[_0x4878('0x86')]&&_0x33c78a[_0x4878('0x86')][_0x4878('0x87')][_0x4878('0x4b')]){return _0x33c78a[_0x4878('0x86')][_0x4878('0x87')][0x0];}return db['CmContact'][_0x4878('0x5c')](_[_0x4878('0x1d')](_0x232cc9['body'],{'firstName':_0x4888a0,[_0x92aeb6['mapKey']]:_0x4888a0,'phone':_0x4888a0,'ListId':_0x33c78a['ListId']}));}})[_0x4878('0x22')](handleEntityNotFound(_0x253431,null))['then'](function(_0x217683){if(_0x217683){_0x4750e2=_0x217683;return db[_0x4878('0x97')]['find']({'where':{'ContactId':_0x4750e2['id'],'closed':![],'OpenchannelAccountId':_0x33c78a['id']}})['then'](function(_0x876878){if(_0x876878){return[_0x876878,![]];}return db[_0x4878('0x97')][_0x4878('0x5c')]({'UserId':_0x232cc9['user']['id'],'ContactId':_0x4750e2['id'],'OpenchannelAccountId':_0x33c78a['id'],'lastMsgDirection':_0x4878('0xc6'),'firstMsgDirection':_0x4878('0xc6'),'Messages':[_[_0x4878('0x51')](_0x232cc9[_0x4878('0x5d')],{'read':![],'body':_0x232cc9['body']['body'],'OpenchannelAccountId':_0x33c78a['id'],'UserId':_0x232cc9[_0x4878('0x60')]['id'],'ContactId':_0x4750e2['id']})]},{'include':[{'model':db[_0x4878('0xa0')],'as':_0x4878('0xc7')}]})['then'](function(_0x40ed5f){return[_0x40ed5f,!![]];});});}})[_0x4878('0x98')](function(_0x46b23e,_0x54b4b9){if(_0x54b4b9){return _0x46b23e;}return db[_0x4878('0xa0')]['create'](_['merge'](_0x232cc9[_0x4878('0x5d')],{'read':![],'body':_0x232cc9['body'][_0x4878('0x5d')],'OpenchannelAccountId':_0x33c78a['id'],'OpenchannelInteractionId':_0x46b23e['id'],'UserId':_0x232cc9[_0x4878('0x60')]['id'],'ContactId':_0x4750e2['id']}))['then'](function(_0x4471f2){_0x46b23e[_0x4878('0xc8')][_0x4878('0xc7')]=[];_0x46b23e[_0x4878('0xc8')][_0x4878('0xc7')]['push'](_0x4471f2[_0x4878('0xc8')]);return _0x46b23e;});});}})['then'](respondWithResult(_0x253431,null))['catch'](handleError(_0x253431,null));}; \ No newline at end of file +var _0x6f7b=['./openchannelAccount.socket','register','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','json','undefined','limit','count','offset','set','save','update','get','UserProfileResource','destroy','sendStatus','stack','name','send','index','mandatoryDispositionPause','map','OpenchannelAccount','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','params','Pause','rawAttributes','keys','filters','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','pick','options','include','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','Contacts','DESC','OpenchannelApplication','Applications','List','account','applications','list','orderBy','priority','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','User','UserId','agent','waitForTheAssignedAgent','queueId','OpenchannelQueue','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','getInteractions','Owner','fullname','Tags','color','tag','addAgents','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','CmList','out','Messages','dataValues','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter'];(function(_0x28ca2f,_0x4e18b6){var _0x378a94=function(_0x10286a){while(--_0x10286a){_0x28ca2f['push'](_0x28ca2f['shift']());}};_0x378a94(++_0x4e18b6);}(_0x6f7b,0x168));var _0xb6f7=function(_0x380307,_0x4545ed){_0x380307=_0x380307-0x0;var _0x476194=_0x6f7b[_0x380307];return _0x476194;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb6f7('0x0'));var zipdir=require(_0xb6f7('0x1'));var jsonpatch=require(_0xb6f7('0x2'));var rp=require(_0xb6f7('0x3'));var moment=require(_0xb6f7('0x4'));var BPromise=require(_0xb6f7('0x5'));var Mustache=require(_0xb6f7('0x6'));var util=require('util');var path=require(_0xb6f7('0x7'));var sox=require('sox');var csv=require(_0xb6f7('0x8'));var ejs=require(_0xb6f7('0x9'));var fs=require('fs');var fs_extra=require(_0xb6f7('0xa'));var _=require(_0xb6f7('0xb'));var squel=require('squel');var crypto=require(_0xb6f7('0xc'));var jsforce=require(_0xb6f7('0xd'));var deskjs=require(_0xb6f7('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb6f7('0xf'));var authService=require(_0xb6f7('0x10'));var qs=require(_0xb6f7('0x11'));var as=require(_0xb6f7('0x12'));var hardwareService=require(_0xb6f7('0x13'));var logger=require(_0xb6f7('0x14'))(_0xb6f7('0x15'));var utils=require(_0xb6f7('0x16'));var config=require(_0xb6f7('0x17'));var licenseUtil=require(_0xb6f7('0x18'));var db=require(_0xb6f7('0x19'))['db'];config[_0xb6f7('0x1a')]=_[_0xb6f7('0x1b')](config[_0xb6f7('0x1a')],{'host':_0xb6f7('0x1c'),'port':0x18eb});var socket=require(_0xb6f7('0x1d'))(new Redis(config[_0xb6f7('0x1a')]));require(_0xb6f7('0x1e'))[_0xb6f7('0x1f')](socket);var jayson=require(_0xb6f7('0x20'));var client=jayson[_0xb6f7('0x21')][_0xb6f7('0x22')]({'port':0x232c});var client9002=jayson[_0xb6f7('0x21')][_0xb6f7('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x5be484,_0xc3859c,_0x35270a,_0x2519f1){return new BPromise(function(_0x2bb47a,_0x5ca572){var _0x17938a=_0x2519f1||client;return _0x17938a[_0xb6f7('0x23')](_0x5be484,_0x35270a)[_0xb6f7('0x24')](function(_0x58b345){logger[_0xb6f7('0x25')](_0xb6f7('0x26'),_0xc3859c,_0xb6f7('0x27'));logger[_0xb6f7('0x28')](_0xb6f7('0x29'),_0xc3859c,_0xb6f7('0x27'),JSON[_0xb6f7('0x2a')](_0x58b345));if(_0x58b345[_0xb6f7('0x2b')]){if(_0x58b345['error'][_0xb6f7('0x2c')]===0x1f4){logger['error'](_0xb6f7('0x26'),_0xc3859c,_0x58b345[_0xb6f7('0x2b')]['message']);return _0x5ca572(_0x58b345[_0xb6f7('0x2b')][_0xb6f7('0x2d')]);}logger[_0xb6f7('0x2b')](_0xb6f7('0x26'),_0xc3859c,_0x58b345[_0xb6f7('0x2b')]['message']);return _0x2bb47a(_0x58b345[_0xb6f7('0x2b')][_0xb6f7('0x2d')]);}else{logger[_0xb6f7('0x25')](_0xb6f7('0x26'),_0xc3859c,_0xb6f7('0x27'));_0x2bb47a(_0x58b345[_0xb6f7('0x2e')][_0xb6f7('0x2d')]);}})['catch'](function(_0x2968a7){logger[_0xb6f7('0x2b')](_0xb6f7('0x26'),_0xc3859c,_0x2968a7);_0x5ca572(_0x2968a7);});});}function respondWithStatusCode(_0x5344a5,_0x3cf307){_0x3cf307=_0x3cf307||0xcc;return function(_0x37d70d){if(_0x37d70d){return _0x5344a5['sendStatus'](_0x3cf307);}return _0x5344a5[_0xb6f7('0x2f')](_0x3cf307)[_0xb6f7('0x30')]();};}function respondWithResult(_0x385cc8,_0x269587){_0x269587=_0x269587||0xc8;return function(_0x24cb14){if(_0x24cb14){return _0x385cc8[_0xb6f7('0x2f')](_0x269587)[_0xb6f7('0x31')](_0x24cb14);}};}function respondWithFilteredResult(_0x53903f,_0x478d75){return function(_0x3c5f07){if(_0x3c5f07){var _0x539587=typeof _0x478d75['offset']===_0xb6f7('0x32')&&typeof _0x478d75[_0xb6f7('0x33')]===_0xb6f7('0x32');var _0x526323=_0x3c5f07[_0xb6f7('0x34')];var _0x55aa98=_0x539587?0x0:_0x478d75[_0xb6f7('0x35')];var _0x17c513=_0x539587?_0x3c5f07[_0xb6f7('0x34')]:_0x478d75['offset']+_0x478d75[_0xb6f7('0x33')];var _0x5e35dc;if(_0x17c513>=_0x526323){_0x17c513=_0x526323;_0x5e35dc=0xc8;}else{_0x5e35dc=0xce;}_0x53903f[_0xb6f7('0x2f')](_0x5e35dc);return _0x53903f[_0xb6f7('0x36')]('Content-Range',_0x55aa98+'-'+_0x17c513+'/'+_0x526323)[_0xb6f7('0x31')](_0x3c5f07);}return null;};}function patchUpdates(_0xc407af){return function(_0x22d9cc){try{jsonpatch['apply'](_0x22d9cc,_0xc407af,!![]);}catch(_0xd66413){return BPromise['reject'](_0xd66413);}return _0x22d9cc[_0xb6f7('0x37')]();};}function saveUpdates(_0x8560be,_0x3f6a2d){return function(_0x2763b8){if(_0x2763b8){return _0x2763b8[_0xb6f7('0x38')](_0x8560be)[_0xb6f7('0x24')](function(_0x103eb9){return _0x103eb9;});}return null;};}function removeEntity(_0x2d600a,_0x2f8c65){return function(_0x462678){if(_0x462678){return _0x462678['destroy']()[_0xb6f7('0x24')](function(){var _0x3c7787=_0x462678[_0xb6f7('0x39')]({'plain':!![]});var _0x2e7980='OpenchannelAccounts';return db[_0xb6f7('0x3a')][_0xb6f7('0x3b')]({'where':{'type':_0x2e7980,'resourceId':_0x3c7787['id']}})[_0xb6f7('0x24')](function(){return _0x462678;});})['then'](function(){_0x2d600a[_0xb6f7('0x2f')](0xcc)[_0xb6f7('0x30')]();});}};}function handleEntityNotFound(_0x179cfe,_0x4ead94){return function(_0x25a627){if(!_0x25a627){_0x179cfe[_0xb6f7('0x3c')](0x194);}return _0x25a627;};}function handleError(_0x169b5b,_0x1677aa){_0x1677aa=_0x1677aa||0x1f4;return function(_0x2677e1){logger['error'](_0x2677e1[_0xb6f7('0x3d')]);if(_0x2677e1[_0xb6f7('0x3e')]){delete _0x2677e1[_0xb6f7('0x3e')];}_0x169b5b[_0xb6f7('0x2f')](_0x1677aa)[_0xb6f7('0x3f')](_0x2677e1);};}exports[_0xb6f7('0x40')]=function(_0x4031bc,_0x350dc8){var _0x238222={'include':[{'model':db['Pause'],'as':_0xb6f7('0x41')}]},_0x4464dd={},_0x1915ed={'count':0x0,'rows':[]};var _0x403bba=_[_0xb6f7('0x42')](db[_0xb6f7('0x43')]['rawAttributes'],function(_0x259d43){return{'name':_0x259d43[_0xb6f7('0x44')],'type':_0x259d43[_0xb6f7('0x45')][_0xb6f7('0x46')]};});_0x4464dd[_0xb6f7('0x47')]=_[_0xb6f7('0x42')](_0x403bba,_0xb6f7('0x3e'));_0x4464dd[_0xb6f7('0x48')]=_['keys'](_0x4031bc[_0xb6f7('0x48')]);_0x4464dd['filters']=_[_0xb6f7('0x49')](_0x4464dd[_0xb6f7('0x47')],_0x4464dd[_0xb6f7('0x48')]);_0x238222[_0xb6f7('0x4a')]=_['intersection'](_0x4464dd[_0xb6f7('0x47')],qs[_0xb6f7('0x4b')](_0x4031bc['query']['fields']));_0x238222[_0xb6f7('0x4a')]=_0x238222['attributes']['length']?_0x238222[_0xb6f7('0x4a')]:_0x4464dd[_0xb6f7('0x47')];if(!_0x4031bc['query'][_0xb6f7('0x4c')](_0xb6f7('0x4d'))){_0x238222['limit']=qs['limit'](_0x4031bc['query'][_0xb6f7('0x33')]);_0x238222['offset']=qs['offset'](_0x4031bc[_0xb6f7('0x48')][_0xb6f7('0x35')]);}_0x238222[_0xb6f7('0x4e')]=qs[_0xb6f7('0x4f')](_0x4031bc['query'][_0xb6f7('0x4f')]);_0x238222[_0xb6f7('0x50')]=qs['filters'](_['pick'](_0x4031bc['query'],_0x4464dd['filters']),_0x403bba);if(_0x4031bc[_0xb6f7('0x48')][_0xb6f7('0x51')]){_0x238222[_0xb6f7('0x50')]=_[_0xb6f7('0x52')](_0x238222[_0xb6f7('0x50')],{'$or':_[_0xb6f7('0x42')](_0x403bba,function(_0x10636f){if(_0x10636f[_0xb6f7('0x45')]!==_0xb6f7('0x53')){var _0x3b36e7={};_0x3b36e7[_0x10636f[_0xb6f7('0x3e')]]={'$like':'%'+_0x4031bc[_0xb6f7('0x48')]['filter']+'%'};return _0x3b36e7;}})});}_0x238222=_[_0xb6f7('0x52')]({},_0x238222,_0x4031bc['options']);var _0x3022ae={'where':_0x238222[_0xb6f7('0x50')]};return db[_0xb6f7('0x43')][_0xb6f7('0x34')](_0x3022ae)[_0xb6f7('0x24')](function(_0x4b0db7){_0x1915ed[_0xb6f7('0x34')]=_0x4b0db7;if(_0x4031bc[_0xb6f7('0x48')][_0xb6f7('0x54')]){_0x238222['include']=[{'all':!![]}];}return db[_0xb6f7('0x43')][_0xb6f7('0x55')](_0x238222);})[_0xb6f7('0x24')](function(_0x244f5f){_0x1915ed[_0xb6f7('0x56')]=_0x244f5f;return _0x1915ed;})[_0xb6f7('0x24')](respondWithFilteredResult(_0x350dc8,_0x238222))[_0xb6f7('0x57')](handleError(_0x350dc8,null));};exports['show']=function(_0x330745,_0x5e522b){var _0x1dae49={'raw':![],'where':{'id':_0x330745[_0xb6f7('0x58')]['id']},'include':[{'model':db[_0xb6f7('0x59')],'as':'mandatoryDispositionPause'}]},_0x33ef52={};_0x33ef52['model']=_['keys'](db[_0xb6f7('0x43')][_0xb6f7('0x5a')]);_0x33ef52[_0xb6f7('0x48')]=_[_0xb6f7('0x5b')](_0x330745[_0xb6f7('0x48')]);_0x33ef52[_0xb6f7('0x5c')]=_['intersection'](_0x33ef52[_0xb6f7('0x47')],_0x33ef52[_0xb6f7('0x48')]);_0x1dae49[_0xb6f7('0x4a')]=_[_0xb6f7('0x49')](_0x33ef52['model'],qs[_0xb6f7('0x4b')](_0x330745[_0xb6f7('0x48')][_0xb6f7('0x4b')]));_0x1dae49[_0xb6f7('0x4a')]=_0x1dae49[_0xb6f7('0x4a')][_0xb6f7('0x5d')]?_0x1dae49[_0xb6f7('0x4a')]:_0x33ef52[_0xb6f7('0x47')];if(_0x330745[_0xb6f7('0x48')][_0xb6f7('0x54')]){_0x1dae49['include']=[{'all':!![]}];}_0x1dae49=_[_0xb6f7('0x52')]({},_0x1dae49,_0x330745['options']);return db[_0xb6f7('0x43')][_0xb6f7('0x5e')](_0x1dae49)[_0xb6f7('0x24')](handleEntityNotFound(_0x5e522b,null))[_0xb6f7('0x24')](respondWithResult(_0x5e522b,null))[_0xb6f7('0x57')](handleError(_0x5e522b,null));};exports[_0xb6f7('0x5f')]=function(_0x119fd0,_0x2675f9){return db[_0xb6f7('0x43')][_0xb6f7('0x5f')](_0x119fd0[_0xb6f7('0x60')],{})['then'](function(_0xa7e138){var _0x2fa52e=_0x119fd0[_0xb6f7('0x61')][_0xb6f7('0x39')]({'plain':!![]});if(!_0x2fa52e)throw new Error(_0xb6f7('0x62'));if(_0x2fa52e['role']===_0xb6f7('0x61')){var _0x188f9c=_0xa7e138[_0xb6f7('0x39')]({'plain':!![]});var _0x1bdbb6='OpenchannelAccounts';return db[_0xb6f7('0x63')][_0xb6f7('0x5e')]({'where':{'name':_0x1bdbb6,'userProfileId':_0x2fa52e['userProfileId']},'raw':!![]})['then'](function(_0xe245f8){if(_0xe245f8&&_0xe245f8[_0xb6f7('0x64')]===0x0){return db[_0xb6f7('0x3a')][_0xb6f7('0x5f')]({'name':_0x188f9c[_0xb6f7('0x3e')],'resourceId':_0x188f9c['id'],'type':_0xe245f8['name'],'sectionId':_0xe245f8['id']},{})[_0xb6f7('0x24')](function(){return _0xa7e138;});}else{return _0xa7e138;}})[_0xb6f7('0x57')](function(_0x1a545c){logger[_0xb6f7('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a545c);throw _0x1a545c;});}return _0xa7e138;})[_0xb6f7('0x24')](respondWithResult(_0x2675f9,0xc9))[_0xb6f7('0x57')](handleError(_0x2675f9,null));};exports['update']=function(_0x10f82f,_0x52df60){if(_0x10f82f[_0xb6f7('0x60')]['id']){delete _0x10f82f[_0xb6f7('0x60')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x10f82f['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0xb6f7('0x24')](handleEntityNotFound(_0x52df60,null))[_0xb6f7('0x24')](saveUpdates(_0x10f82f['body'],null))[_0xb6f7('0x24')](respondWithResult(_0x52df60,null))[_0xb6f7('0x57')](handleError(_0x52df60,null));};exports['destroy']=function(_0xa8ff2f,_0x2b507e){return db[_0xb6f7('0x43')][_0xb6f7('0x5e')]({'where':{'id':_0xa8ff2f[_0xb6f7('0x58')]['id']}})['then'](handleEntityNotFound(_0x2b507e,null))['then'](removeEntity(_0x2b507e,null))[_0xb6f7('0x57')](handleError(_0x2b507e,null));};exports[_0xb6f7('0x65')]=function(_0x6b29d0,_0x376490){return db[_0xb6f7('0x43')][_0xb6f7('0x65')]()[_0xb6f7('0x24')](respondWithResult(_0x376490,null))[_0xb6f7('0x57')](handleError(_0x376490,null));};exports[_0xb6f7('0x66')]=function(_0x4e7c19,_0x169049,_0x4eaf9d){if(_0x4e7c19[_0xb6f7('0x60')]['id']){delete _0x4e7c19[_0xb6f7('0x60')]['id'];}return db[_0xb6f7('0x43')]['find']({'where':{'id':_0x4e7c19['params']['id']}})[_0xb6f7('0x24')](handleEntityNotFound(_0x169049,null))[_0xb6f7('0x24')](function(_0x37497e){if(_0x37497e){_0x4e7c19[_0xb6f7('0x60')][_0xb6f7('0x67')]=_0x37497e['id'];return db[_0xb6f7('0x68')][_0xb6f7('0x5f')](_0x4e7c19[_0xb6f7('0x60')]);}})[_0xb6f7('0x24')](respondWithResult(_0x169049,null))[_0xb6f7('0x57')](handleError(_0x169049,null));};exports[_0xb6f7('0x69')]=function(_0x4b557a,_0x7a5a09,_0x3d7c52){var _0x39e313={'raw':![],'where':{}};var _0x2f4c31={};var _0x2d74e4={'count':0x0,'rows':[]};return db[_0xb6f7('0x43')][_0xb6f7('0x6a')]({'where':{'id':_0x4b557a[_0xb6f7('0x58')]['id']}})[_0xb6f7('0x24')](handleEntityNotFound(_0x7a5a09,null))['then'](function(_0xb9afb8){if(_0xb9afb8){_0x2f4c31[_0xb6f7('0x47')]=_[_0xb6f7('0x5b')](db['Disposition'][_0xb6f7('0x5a')]);_0x2f4c31[_0xb6f7('0x48')]=_[_0xb6f7('0x5b')](_0x4b557a[_0xb6f7('0x48')]);_0x2f4c31[_0xb6f7('0x5c')]=_[_0xb6f7('0x49')](_0x2f4c31[_0xb6f7('0x47')],_0x2f4c31[_0xb6f7('0x48')]);_0x39e313[_0xb6f7('0x4a')]=_['intersection'](_0x2f4c31[_0xb6f7('0x47')],qs[_0xb6f7('0x4b')](_0x4b557a['query']['fields']));_0x39e313[_0xb6f7('0x4a')]=_0x39e313[_0xb6f7('0x4a')]['length']?_0x39e313[_0xb6f7('0x4a')]:_0x2f4c31[_0xb6f7('0x47')];if(!_0x4b557a[_0xb6f7('0x48')][_0xb6f7('0x4c')](_0xb6f7('0x4d'))){_0x39e313[_0xb6f7('0x33')]=qs[_0xb6f7('0x33')](_0x4b557a[_0xb6f7('0x48')][_0xb6f7('0x33')]);_0x39e313['offset']=qs[_0xb6f7('0x35')](_0x4b557a[_0xb6f7('0x48')]['offset']);}_0x39e313['order']=qs[_0xb6f7('0x4f')](_0x4b557a[_0xb6f7('0x48')][_0xb6f7('0x4f')]);_0x39e313[_0xb6f7('0x50')]=qs[_0xb6f7('0x5c')](_[_0xb6f7('0x6b')](_0x4b557a[_0xb6f7('0x48')],_0x2f4c31[_0xb6f7('0x5c')]));_0x39e313[_0xb6f7('0x50')]['OpenchannelAccountId']=_0xb9afb8['id'];if(_0x4b557a[_0xb6f7('0x48')][_0xb6f7('0x51')]){_0x39e313['where']=_[_0xb6f7('0x52')](_0x39e313[_0xb6f7('0x50')],{'$or':_['map'](_0x39e313[_0xb6f7('0x4a')],function(_0x2e3825){var _0xabd67c={};_0xabd67c[_0x2e3825]={'$like':'%'+_0x4b557a[_0xb6f7('0x48')][_0xb6f7('0x51')]+'%'};return _0xabd67c;})});}_0x39e313=_[_0xb6f7('0x52')]({},_0x39e313,_0x4b557a[_0xb6f7('0x6c')]);return db[_0xb6f7('0x68')][_0xb6f7('0x34')]({'where':_0x39e313[_0xb6f7('0x50')]})[_0xb6f7('0x24')](function(_0x1e002c){_0x2d74e4[_0xb6f7('0x34')]=_0x1e002c;if(_0x4b557a[_0xb6f7('0x48')][_0xb6f7('0x54')]){_0x39e313[_0xb6f7('0x6d')]=[{'all':!![]}];}return db[_0xb6f7('0x68')][_0xb6f7('0x55')](_0x39e313);})['then'](function(_0x5a9698){_0x2d74e4['rows']=_0x5a9698;return _0x2d74e4;});}})[_0xb6f7('0x24')](respondWithFilteredResult(_0x7a5a09,_0x39e313))['catch'](handleError(_0x7a5a09,null));};exports['removeDispositions']=function(_0x1c1212,_0xb19d90,_0x1e4a84){return db[_0xb6f7('0x43')][_0xb6f7('0x5e')]({'where':{'id':_0x1c1212[_0xb6f7('0x58')]['id']}})[_0xb6f7('0x24')](handleEntityNotFound(_0xb19d90,null))[_0xb6f7('0x24')](function(_0x290548){if(_0x290548){return _0x290548[_0xb6f7('0x6e')](_0x1c1212[_0xb6f7('0x48')][_0xb6f7('0x6f')]);}})['then'](respondWithStatusCode(_0xb19d90,null))['catch'](handleError(_0xb19d90,null));};exports['addAnswer']=function(_0x350023,_0x3991c2,_0x231452){if(_0x350023[_0xb6f7('0x60')]['id']){delete _0x350023[_0xb6f7('0x60')]['id'];}return db[_0xb6f7('0x43')][_0xb6f7('0x5e')]({'where':{'id':_0x350023[_0xb6f7('0x58')]['id']}})[_0xb6f7('0x24')](handleEntityNotFound(_0x3991c2,null))['then'](function(_0xd62f37){if(_0xd62f37){_0x350023[_0xb6f7('0x60')][_0xb6f7('0x67')]=_0xd62f37['id'];return db[_0xb6f7('0x70')][_0xb6f7('0x5f')](_0x350023[_0xb6f7('0x60')]);}})[_0xb6f7('0x24')](respondWithResult(_0x3991c2,null))['catch'](handleError(_0x3991c2,null));};exports[_0xb6f7('0x71')]=function(_0xaa6bc5,_0x3bb435,_0x8f1b2){var _0x2df019={'raw':![],'where':{}};var _0xf5c9f2={};var _0x4a93b1={'count':0x0,'rows':[]};return db[_0xb6f7('0x43')]['findOne']({'where':{'id':_0xaa6bc5['params']['id']}})[_0xb6f7('0x24')](handleEntityNotFound(_0x3bb435,null))[_0xb6f7('0x24')](function(_0x4da8f2){if(_0x4da8f2){_0xf5c9f2['model']=_[_0xb6f7('0x5b')](db[_0xb6f7('0x70')][_0xb6f7('0x5a')]);_0xf5c9f2[_0xb6f7('0x48')]=_[_0xb6f7('0x5b')](_0xaa6bc5[_0xb6f7('0x48')]);_0xf5c9f2[_0xb6f7('0x5c')]=_[_0xb6f7('0x49')](_0xf5c9f2[_0xb6f7('0x47')],_0xf5c9f2[_0xb6f7('0x48')]);_0x2df019['attributes']=_[_0xb6f7('0x49')](_0xf5c9f2[_0xb6f7('0x47')],qs[_0xb6f7('0x4b')](_0xaa6bc5[_0xb6f7('0x48')][_0xb6f7('0x4b')]));_0x2df019['attributes']=_0x2df019['attributes'][_0xb6f7('0x5d')]?_0x2df019[_0xb6f7('0x4a')]:_0xf5c9f2[_0xb6f7('0x47')];if(!_0xaa6bc5[_0xb6f7('0x48')][_0xb6f7('0x4c')](_0xb6f7('0x4d'))){_0x2df019['limit']=qs[_0xb6f7('0x33')](_0xaa6bc5['query']['limit']);_0x2df019[_0xb6f7('0x35')]=qs[_0xb6f7('0x35')](_0xaa6bc5[_0xb6f7('0x48')][_0xb6f7('0x35')]);}_0x2df019[_0xb6f7('0x4e')]=qs[_0xb6f7('0x4f')](_0xaa6bc5[_0xb6f7('0x48')][_0xb6f7('0x4f')]);_0x2df019['where']=qs[_0xb6f7('0x5c')](_[_0xb6f7('0x6b')](_0xaa6bc5[_0xb6f7('0x48')],_0xf5c9f2[_0xb6f7('0x5c')]));_0x2df019[_0xb6f7('0x50')][_0xb6f7('0x67')]=_0x4da8f2['id'];if(_0xaa6bc5[_0xb6f7('0x48')]['filter']){_0x2df019[_0xb6f7('0x50')]=_[_0xb6f7('0x52')](_0x2df019[_0xb6f7('0x50')],{'$or':_['map'](_0x2df019[_0xb6f7('0x4a')],function(_0x2c33f3){var _0x5676ca={};_0x5676ca[_0x2c33f3]={'$like':'%'+_0xaa6bc5[_0xb6f7('0x48')][_0xb6f7('0x51')]+'%'};return _0x5676ca;})});}_0x2df019=_[_0xb6f7('0x52')]({},_0x2df019,_0xaa6bc5[_0xb6f7('0x6c')]);return db['CannedAnswer'][_0xb6f7('0x34')]({'where':_0x2df019[_0xb6f7('0x50')]})[_0xb6f7('0x24')](function(_0x2255fc){_0x4a93b1['count']=_0x2255fc;if(_0xaa6bc5[_0xb6f7('0x48')]['includeAll']){_0x2df019[_0xb6f7('0x6d')]=[{'all':!![]}];}return db['CannedAnswer'][_0xb6f7('0x55')](_0x2df019);})[_0xb6f7('0x24')](function(_0x435e88){_0x4a93b1['rows']=_0x435e88;return _0x4a93b1;});}})[_0xb6f7('0x24')](respondWithFilteredResult(_0x3bb435,_0x2df019))['catch'](handleError(_0x3bb435,null));};exports[_0xb6f7('0x72')]=function(_0x2c4978,_0x297246,_0xfa3662){return db['OpenchannelAccount']['find']({'where':{'id':_0x2c4978[_0xb6f7('0x58')]['id']}})['then'](handleEntityNotFound(_0x297246,null))['then'](function(_0x5d36a3){if(_0x5d36a3){return _0x5d36a3[_0xb6f7('0x72')](_0x2c4978[_0xb6f7('0x48')][_0xb6f7('0x6f')]);}})[_0xb6f7('0x24')](respondWithStatusCode(_0x297246,null))[_0xb6f7('0x57')](handleError(_0x297246,null));};exports[_0xb6f7('0x73')]=function(_0x5028cc,_0x563c59,_0x36a1b3){var _0x4f69fc={'body':_0x5028cc[_0xb6f7('0x60')],'channel':_0xb6f7('0x74')};var _0x3d5572=[];var _0x5e6bd2=[];var _0x4e386c={};var _0xa44f0e=![];return db[_0xb6f7('0x75')][_0xb6f7('0x65')]()[_0xb6f7('0x24')](function(_0xabf651){if(!_0xabf651){throw new db[(_0xb6f7('0x76'))][(_0xb6f7('0x77'))](_0xb6f7('0x78'));}_0x3d5572=_[_0xb6f7('0x79')](_[_0xb6f7('0x5b')](_0xabf651),[_0xb6f7('0x7a'),'updatedAt']);_0x5e6bd2=_['difference'](_[_0xb6f7('0x5b')](_0xabf651),['createdAt',_0xb6f7('0x7b'),'CompanyId',_0xb6f7('0x7c')]);if(_0x5028cc[_0xb6f7('0x60')]['id']){delete _0x5028cc[_0xb6f7('0x60')]['id'];}if(_[_0xb6f7('0x7d')](_0x5028cc['body'][_0xb6f7('0x7e')])){throw new db[(_0xb6f7('0x76'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0xb6f7('0x7d')](_0x5028cc[_0xb6f7('0x60')][_0xb6f7('0x60')])||_0x5028cc[_0xb6f7('0x60')][_0xb6f7('0x60')]===''){throw new db[(_0xb6f7('0x76'))][(_0xb6f7('0x77'))](_0xb6f7('0x7f'));}if(_[_0xb6f7('0x7d')](_0x5028cc['body'][_0xb6f7('0x80')])){throw new db['Sequelize'][(_0xb6f7('0x77'))](_0xb6f7('0x81')+_0x5e6bd2);}if(!_[_0xb6f7('0x82')](_0x5e6bd2,_0x5028cc[_0xb6f7('0x60')][_0xb6f7('0x80')])){throw new db[(_0xb6f7('0x76'))][(_0xb6f7('0x77'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5e6bd2);}_0x4e386c[_0x5028cc[_0xb6f7('0x60')][_0xb6f7('0x80')]]=_0x5028cc[_0xb6f7('0x60')][_0xb6f7('0x7e')];})[_0xb6f7('0x24')](function(){return db[_0xb6f7('0x43')]['find']({'where':{'id':_0x5028cc[_0xb6f7('0x58')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xb6f7('0x75')],'as':_0xb6f7('0x83'),'where':_0x4e386c,'limit':0x1,'order':[[_0xb6f7('0x7b'),_0xb6f7('0x84')]]}]},{'model':db[_0xb6f7('0x85')],'as':_0xb6f7('0x86')}]});})['then'](handleEntityNotFound(_0x563c59,null))[_0xb6f7('0x24')](function(_0x3ffb46){if(_0x3ffb46&&_0x3ffb46[_0xb6f7('0x87')]){_0x4f69fc[_0xb6f7('0x88')]=_0x3ffb46;_0x4f69fc[_0xb6f7('0x89')]=_0x3ffb46[_0xb6f7('0x86')];_0x4f69fc[_0xb6f7('0x8a')]=_0x3ffb46['List'];_0x4f69fc[_0xb6f7('0x89')]=_[_0xb6f7('0x8b')](_0x4f69fc[_0xb6f7('0x89')],[_0xb6f7('0x8c')],['asc']);if(_0x4f69fc[_0xb6f7('0x88')][_0xb6f7('0x86')]){delete _0x4f69fc[_0xb6f7('0x88')][_0xb6f7('0x86')];}if(_0x4f69fc[_0xb6f7('0x88')][_0xb6f7('0x87')]&&_0x4f69fc[_0xb6f7('0x88')][_0xb6f7('0x87')][_0xb6f7('0x83')][_0xb6f7('0x5d')]){return _0x4f69fc[_0xb6f7('0x88')][_0xb6f7('0x87')]['Contacts'][0x0];}var _0x1c3106=_[_0xb6f7('0x1b')](_0x5028cc[_0xb6f7('0x60')],{'firstName':_0x5028cc['body'][_0xb6f7('0x7e')],'ListId':_0x3ffb46[_0xb6f7('0x7c')]});_0x1c3106[_0x5028cc[_0xb6f7('0x60')][_0xb6f7('0x80')]]=_0x5028cc[_0xb6f7('0x60')][_0xb6f7('0x7e')];return db[_0xb6f7('0x75')][_0xb6f7('0x5f')](_0x1c3106,{'fields':_0x3d5572,'raw':!![]});}})[_0xb6f7('0x24')](handleEntityNotFound(_0x563c59,null))['then'](function(_0xa8e97c){_0x4f69fc[_0xb6f7('0x8d')]=_0xa8e97c;if(_0xa8e97c){var _0x568703={'ContactId':_0xa8e97c['id'],'OpenchannelAccountId':_0x5028cc[_0xb6f7('0x58')]['id'],'from':(_0xa8e97c[_0xb6f7('0x8e')]||'')+'\x20'+(_0xa8e97c[_0xb6f7('0x8f')]||'')};var _0x580120={'OpenchannelAccountId':_0x5028cc[_0xb6f7('0x58')]['id'],'closed':![]};if(_0x5028cc[_0xb6f7('0x60')][_0xb6f7('0x90')]){_0x580120[_0xb6f7('0x90')]=_0x5028cc[_0xb6f7('0x60')][_0xb6f7('0x90')];return db[_0xb6f7('0x91')][_0xb6f7('0x5e')]({'where':_0x580120})['then'](function(_0x3c49cf){if(_0x3c49cf){return[_0x3c49cf,![]];}_0x568703[_0xb6f7('0x90')]=_0x5028cc[_0xb6f7('0x60')][_0xb6f7('0x90')];_0x568703[_0xb6f7('0x92')]=_0x5028cc['body']['externalUrl'];return db[_0xb6f7('0x91')]['create'](_0x568703)[_0xb6f7('0x24')](function(_0x528ef1){return[_0x528ef1,!![]];});});}else{_0x580120[_0xb6f7('0x90')]=null;}_0x580120[_0xb6f7('0x93')]=_0xa8e97c['id'];return db['OpenchannelInteraction'][_0xb6f7('0x5e')]({'where':_0x580120})[_0xb6f7('0x24')](function(_0x59f550){if(_0x59f550){return[_0x59f550,![]];}return db[_0xb6f7('0x91')][_0xb6f7('0x5f')](_0x568703)[_0xb6f7('0x24')](function(_0x1588af){return[_0x1588af,!![]];});});}})[_0xb6f7('0x94')](function(_0x2be793,_0x303613){if(_0x2be793){_0xa44f0e=_0x303613;if(!_0x303613){var _0x3fc09d={'from':(_0x4f69fc[_0xb6f7('0x8d')][_0xb6f7('0x8e')]||'')+'\x20'+(_0x4f69fc[_0xb6f7('0x8d')][_0xb6f7('0x8f')]||'')};if(_0x5028cc[_0xb6f7('0x60')][_0xb6f7('0x90')]&&_0x5028cc[_0xb6f7('0x60')][_0xb6f7('0x95')]&&_0x5028cc[_0xb6f7('0x60')][_0xb6f7('0x90')]!=_0x5028cc[_0xb6f7('0x60')][_0xb6f7('0x95')]){_0x3fc09d['threadId']=_0x5028cc[_0xb6f7('0x60')][_0xb6f7('0x95')];}return _0x2be793[_0xb6f7('0x38')](_0x3fc09d);}else{return _0x2be793;}}})[_0xb6f7('0x24')](function(_0x40b502){_0x4f69fc[_0xb6f7('0x96')]=_0x40b502['get']({'plain':!![]});_0x4f69fc['interaction']['created']=_0xa44f0e;if(_0x4f69fc[_0xb6f7('0x96')]['created']){if(_0x4f69fc['account'][_0xb6f7('0x97')]){_0x4f69fc[_0xb6f7('0x89')][_0xb6f7('0x98')]({'id':0x0,'priority':_0x4f69fc['applications'][_0xb6f7('0x5d')]+0x1,'app':_0xb6f7('0x99'),'appdata':_0xb6f7('0x9a'),'interval':_0xb6f7('0x9b')});}}return db[_0xb6f7('0x9c')][_0xb6f7('0x5f')]({'body':_0x5028cc[_0xb6f7('0x60')][_0xb6f7('0x60')],'OpenchannelAccountId':_0x5028cc[_0xb6f7('0x58')]['id'],'OpenchannelInteractionId':_0x40b502['id'],'direction':'in','ContactId':_0x4f69fc[_0xb6f7('0x8d')]['id'],'AttachmentId':_0x5028cc[_0xb6f7('0x60')][_0xb6f7('0x9d')]});})[_0xb6f7('0x24')](function(_0x5f585c){_0x4f69fc['message']=_0x5f585c;if(!_0x4f69fc[_0xb6f7('0x96')]['UserId'])return;return db[_0xb6f7('0x9e')][_0xb6f7('0x5e')]({'attributes':['id',_0xb6f7('0x3e')],'where':{'id':_0x4f69fc[_0xb6f7('0x96')][_0xb6f7('0x9f')]}});})['then'](function(_0x2232ec){if(_0x2232ec){_0x4f69fc[_0xb6f7('0x89')]['unshift']({'id':0x0,'priority':0x0,'app':_0xb6f7('0xa0'),'appdata':_0x2232ec['name']+','+(_0x4f69fc[_0xb6f7('0x88')][_0xb6f7('0xa1')]||0xa),'interval':_0xb6f7('0x9b')});}if(!_0x4f69fc[_0xb6f7('0x96')][_0xb6f7('0xa2')])return;return db[_0xb6f7('0xa3')][_0xb6f7('0x5e')]({'attributes':['id',_0xb6f7('0x3e')],'where':{'id':_0x4f69fc['interaction'][_0xb6f7('0xa2')]}});})['then'](function(_0x289896){if(_0x289896){_0x4f69fc[_0xb6f7('0x89')]['unshift']({'id':0x0,'priority':0x1,'app':_0xb6f7('0xa4'),'appdata':_0x289896[_0xb6f7('0x3e')]+','+(_0x4f69fc['account'][_0xb6f7('0xa5')]||0x12c),'interval':_0xb6f7('0x9b')});}return respondWithRpcPromise(_0xb6f7('0xa6'),_0xb6f7('0xa7'),_0x4f69fc);})[_0xb6f7('0x24')](function(_0x197b4b){respondWithRpcPromise(_0xb6f7('0xa8'),_0xb6f7('0xa8'),{'event':_0xb6f7('0x73'),'message':_0x197b4b},client9002);return _0x197b4b;})[_0xb6f7('0x24')](respondWithResult(_0x563c59,null))[_0xb6f7('0x57')](handleError(_0x563c59,null));};exports[_0xb6f7('0xa9')]=function(_0x150a2c,_0x42364f){var _0x5ab2f2=_0x150a2c['params']['id'];var _0x4fe007=_0x150a2c[_0xb6f7('0x60')];var _0x41d156=0xc8;var _0x2d9ea8=null;return db[_0xb6f7('0xaa')][_0xb6f7('0xab')]({'isolationLevel':db['sequelize'][_0xb6f7('0xac')][_0xb6f7('0xad')][_0xb6f7('0xae')]},function(_0x2f29a8){return db['OpenchannelAccount'][_0xb6f7('0x6a')]({'where':{'id':_0x5ab2f2},'transaction':_0x2f29a8})[_0xb6f7('0x24')](function(_0x283218){if(_0x283218){return db[_0xb6f7('0x85')][_0xb6f7('0x3b')]({'where':{'OpenchannelAccountId':_0x5ab2f2},'transaction':_0x2f29a8})['then'](function(){var _0x11e96c=_[_0xb6f7('0x42')](_0x4fe007,function(_0x2a5cef){_0x2a5cef[_0xb6f7('0x67')]=_0x5ab2f2;return _0x2a5cef;});return db[_0xb6f7('0x85')]['bulkCreate'](_0x11e96c,{'transaction':_0x2f29a8});});}else{_0x41d156=0x194;_0x2d9ea8=[];}});})[_0xb6f7('0x24')](function(){if(_0x41d156!==0x194){return db[_0xb6f7('0x85')][_0xb6f7('0xaf')]({'where':{'OpenchannelAccountId':_0x5ab2f2},'order':_0xb6f7('0x8c')})[_0xb6f7('0x24')](function(_0x1bccd1){_0x2d9ea8=_0x1bccd1;});}})[_0xb6f7('0x57')](function(_0x298308){_0x41d156=0x1f4;logger[_0xb6f7('0x2b')](_0x298308[_0xb6f7('0x3d')]);if(_0x298308['name']){delete _0x298308[_0xb6f7('0x3e')];}_0x2d9ea8=_0x298308;})[_0xb6f7('0xb0')](function(){if(_0x2d9ea8===null){_0x42364f[_0xb6f7('0x3c')](_0x41d156);}else{if(_0x41d156===0x1f4){_0x42364f[_0xb6f7('0x2f')](_0x41d156)[_0xb6f7('0x3f')](_0x2d9ea8);}else{_0x42364f[_0xb6f7('0x2f')](_0x41d156)[_0xb6f7('0x31')](_0x2d9ea8);}}});};exports[_0xb6f7('0xb1')]=function(_0x3d94c9,_0x923dfc,_0x5616ab){var _0x53575e={};var _0x3a8bae={};var _0x147b45;var _0x3605c8;return db[_0xb6f7('0x43')]['findOne']({'where':{'id':_0x3d94c9[_0xb6f7('0x58')]['id']}})[_0xb6f7('0x24')](handleEntityNotFound(_0x923dfc,null))['then'](function(_0xb08082){if(_0xb08082){_0x147b45=_0xb08082;_0x3a8bae[_0xb6f7('0x47')]=_[_0xb6f7('0x5b')](db[_0xb6f7('0x85')]['rawAttributes']);_0x3a8bae[_0xb6f7('0x48')]=_[_0xb6f7('0x5b')](_0x3d94c9['query']);_0x3a8bae[_0xb6f7('0x5c')]=_[_0xb6f7('0x49')](_0x3a8bae['model'],_0x3a8bae[_0xb6f7('0x48')]);_0x53575e[_0xb6f7('0x4a')]=_[_0xb6f7('0x49')](_0x3a8bae['model'],qs[_0xb6f7('0x4b')](_0x3d94c9[_0xb6f7('0x48')]['fields']));_0x53575e[_0xb6f7('0x4a')]=_0x53575e[_0xb6f7('0x4a')][_0xb6f7('0x5d')]?_0x53575e['attributes']:_0x3a8bae[_0xb6f7('0x47')];_0x53575e[_0xb6f7('0x4e')]=qs[_0xb6f7('0x4f')](_0x3d94c9[_0xb6f7('0x48')][_0xb6f7('0x4f')]);_0x53575e[_0xb6f7('0x50')]=qs[_0xb6f7('0x5c')](_[_0xb6f7('0x6b')](_0x3d94c9['query'],_0x3a8bae[_0xb6f7('0x5c')]));if(_0x3d94c9['query'][_0xb6f7('0x51')]){_0x53575e[_0xb6f7('0x50')]=_[_0xb6f7('0x52')](_0x53575e[_0xb6f7('0x50')],{'$or':_[_0xb6f7('0x42')](_0x53575e[_0xb6f7('0x4a')],function(_0x150f62){var _0x2934b5={};_0x2934b5[_0x150f62]={'$like':'%'+_0x3d94c9['query']['filter']+'%'};return _0x2934b5;})});}_0x53575e=_[_0xb6f7('0x52')]({},_0x53575e,_0x3d94c9[_0xb6f7('0x6c')]);return _0x147b45[_0xb6f7('0xb1')](_0x53575e);}})[_0xb6f7('0x24')](function(_0x1e3e94){if(_0x1e3e94){_0x3605c8=_0x1e3e94[_0xb6f7('0x5d')];if(!_0x3d94c9['query'][_0xb6f7('0x4c')]('nolimit')){_0x53575e['limit']=qs[_0xb6f7('0x33')](_0x3d94c9[_0xb6f7('0x48')]['limit']);_0x53575e['offset']=qs[_0xb6f7('0x35')](_0x3d94c9[_0xb6f7('0x48')][_0xb6f7('0x35')]);}return _0x147b45[_0xb6f7('0xb1')](_0x53575e);}})[_0xb6f7('0x24')](function(_0x4d05ce){if(_0x4d05ce){return _0x4d05ce?{'count':_0x3605c8,'rows':_0x4d05ce}:null;}})['then'](respondWithResult(_0x923dfc,null))[_0xb6f7('0x57')](handleError(_0x923dfc,null));};exports[_0xb6f7('0xb2')]=function(_0x15dbc4,_0x3e8cab,_0x5208e8){var _0x1b662e={'raw':![],'where':{}};var _0x1a4692={};var _0xfbe8ec={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xb6f7('0x6a')]({'where':{'id':_0x15dbc4[_0xb6f7('0x58')]['id']}})[_0xb6f7('0x24')](handleEntityNotFound(_0x3e8cab,null))['then'](function(_0x1d789c){if(_0x1d789c){_0x1a4692['model']=_[_0xb6f7('0x5b')](db[_0xb6f7('0x91')][_0xb6f7('0x5a')]);_0x1a4692[_0xb6f7('0x48')]=_['keys'](_0x15dbc4[_0xb6f7('0x48')]);_0x1a4692[_0xb6f7('0x5c')]=_['intersection'](_0x1a4692[_0xb6f7('0x47')],_0x1a4692['query']);_0x1b662e[_0xb6f7('0x4a')]=_[_0xb6f7('0x49')](_0x1a4692[_0xb6f7('0x47')],qs['fields'](_0x15dbc4['query']['fields']));_0x1b662e[_0xb6f7('0x4a')]=_0x1b662e[_0xb6f7('0x4a')][_0xb6f7('0x5d')]?_0x1b662e[_0xb6f7('0x4a')]:_0x1a4692[_0xb6f7('0x47')];if(!_0x15dbc4['query'][_0xb6f7('0x4c')](_0xb6f7('0x4d'))){_0x1b662e[_0xb6f7('0x33')]=qs[_0xb6f7('0x33')](_0x15dbc4[_0xb6f7('0x48')][_0xb6f7('0x33')]);_0x1b662e[_0xb6f7('0x35')]=qs[_0xb6f7('0x35')](_0x15dbc4[_0xb6f7('0x48')]['offset']);}_0x1b662e[_0xb6f7('0x4e')]=qs[_0xb6f7('0x4f')](_0x15dbc4[_0xb6f7('0x48')]['sort']);_0x1b662e['where']=qs['filters'](_['pick'](_0x15dbc4[_0xb6f7('0x48')],_0x1a4692[_0xb6f7('0x5c')]));_0x1b662e['where'][_0xb6f7('0x67')]=_0x1d789c['id'];if(_0x15dbc4[_0xb6f7('0x48')][_0xb6f7('0x51')]){_0x1b662e[_0xb6f7('0x50')]=_[_0xb6f7('0x52')](_0x1b662e[_0xb6f7('0x50')],{'$or':_['map'](_0x1b662e['attributes'],function(_0x12dc76){var _0x59750b={};_0x59750b[_0x12dc76]={'$like':'%'+_0x15dbc4['query'][_0xb6f7('0x51')]+'%'};return _0x59750b;})});}_0x1b662e=_[_0xb6f7('0x52')]({},_0x1b662e,_0x15dbc4[_0xb6f7('0x6c')]);return db[_0xb6f7('0x91')][_0xb6f7('0x34')]({'where':_0x1b662e[_0xb6f7('0x50')]})['then'](function(_0x3980a2){_0xfbe8ec[_0xb6f7('0x34')]=_0x3980a2;if(_0x15dbc4[_0xb6f7('0x48')][_0xb6f7('0x54')]){_0x1b662e[_0xb6f7('0x6d')]=[{'model':db[_0xb6f7('0x75')],'as':'Contact','required':![]},{'model':db['User'],'as':_0xb6f7('0xb3'),'attributes':[_0xb6f7('0x3e'),_0xb6f7('0xb4'),'internal'],'required':![]},{'model':db['Tag'],'as':_0xb6f7('0xb5'),'attributes':['id','name',_0xb6f7('0xb6')],'where':_0x15dbc4['query'][_0xb6f7('0xb7')]?{'id':_0x15dbc4[_0xb6f7('0x48')][_0xb6f7('0xb7')]}:undefined,'required':_0x15dbc4[_0xb6f7('0x48')]['tag']?!![]:![]}];}return db[_0xb6f7('0x91')][_0xb6f7('0x55')](_0x1b662e);})[_0xb6f7('0x24')](function(_0xbb9fa1){_0xfbe8ec['rows']=_0xbb9fa1;return _0xfbe8ec;});}})['then'](respondWithFilteredResult(_0x3e8cab,_0x1b662e))[_0xb6f7('0x57')](handleError(_0x3e8cab,null));};exports[_0xb6f7('0xb8')]=function(_0x5fa9ef,_0x3de32a,_0x1d2ada){return db[_0xb6f7('0x43')][_0xb6f7('0x5e')]({'where':{'id':_0x5fa9ef[_0xb6f7('0x58')]['id']}})[_0xb6f7('0x24')](handleEntityNotFound(_0x3de32a,null))[_0xb6f7('0x24')](function(_0x43ef87){if(_0x43ef87){return _0x43ef87[_0xb6f7('0xb8')](_0x5fa9ef[_0xb6f7('0x60')]['ids'],_['omit'](_0x5fa9ef[_0xb6f7('0x60')],[_0xb6f7('0x6f'),'id'])||{})[_0xb6f7('0x94')](function(_0x16d855){for(var _0x4882d7=0x0;_0x4882d7<_0x5fa9ef[_0xb6f7('0x60')][_0xb6f7('0x6f')]['length'];_0x4882d7+=0x1){socket[_0xb6f7('0xb9')](_0xb6f7('0xba'),{'UserId':Number(_0x5fa9ef[_0xb6f7('0x60')][_0xb6f7('0x6f')][_0x4882d7]),'OpenchannelAccountId':Number(_0x5fa9ef[_0xb6f7('0x58')]['id'])});}return _0x16d855;});}})['then'](respondWithResult(_0x3de32a,null))['catch'](handleError(_0x3de32a,null));};exports[_0xb6f7('0xbb')]=function(_0x3b2f5f,_0xdf578b,_0x1f32bc){return db[_0xb6f7('0x43')][_0xb6f7('0x5e')]({'where':{'id':_0x3b2f5f[_0xb6f7('0x58')]['id']}})[_0xb6f7('0x24')](handleEntityNotFound(_0xdf578b,null))['then'](function(_0x334af8){if(_0x334af8){return _0x334af8[_0xb6f7('0xbb')](_0x3b2f5f[_0xb6f7('0x48')][_0xb6f7('0x6f')])['then'](function(){if(_[_0xb6f7('0xbc')](_0x3b2f5f['query'][_0xb6f7('0x6f')])){for(var _0x1eba1f=0x0;_0x1eba1f<_0x3b2f5f[_0xb6f7('0x48')][_0xb6f7('0x6f')][_0xb6f7('0x5d')];_0x1eba1f+=0x1){socket[_0xb6f7('0xb9')](_0xb6f7('0xbd'),{'UserId':Number(_0x3b2f5f[_0xb6f7('0x48')][_0xb6f7('0x6f')][_0x1eba1f]),'OpenchannelAccountId':Number(_0x3b2f5f['params']['id'])});}}else{socket['emit'](_0xb6f7('0xbd'),{'UserId':Number(_0x3b2f5f[_0xb6f7('0x48')][_0xb6f7('0x6f')]),'OpenchannelAccountId':Number(_0x3b2f5f['params']['id'])});}});}})[_0xb6f7('0x24')](respondWithStatusCode(_0xdf578b,null))[_0xb6f7('0x57')](handleError(_0xdf578b,null));};exports[_0xb6f7('0xbe')]=function(_0x5df12f,_0x3700da,_0x5ceb7a){var _0x2fcb79={};var _0x2da7df={};var _0x4d6890;var _0x44291b;return db[_0xb6f7('0x43')][_0xb6f7('0x6a')]({'where':{'id':_0x5df12f[_0xb6f7('0x58')]['id']}})[_0xb6f7('0x24')](handleEntityNotFound(_0x3700da,null))[_0xb6f7('0x24')](function(_0x570621){if(_0x570621){_0x4d6890=_0x570621;_0x2da7df[_0xb6f7('0x47')]=_[_0xb6f7('0x5b')](db['User'][_0xb6f7('0x5a')]);_0x2da7df[_0xb6f7('0x48')]=_[_0xb6f7('0x5b')](_0x5df12f['query']);_0x2da7df['filters']=_[_0xb6f7('0x49')](_0x2da7df['model'],_0x2da7df['query']);_0x2fcb79[_0xb6f7('0x4a')]=_[_0xb6f7('0x49')](_0x2da7df[_0xb6f7('0x47')],qs[_0xb6f7('0x4b')](_0x5df12f[_0xb6f7('0x48')][_0xb6f7('0x4b')]));_0x2fcb79[_0xb6f7('0x4a')]=_0x2fcb79[_0xb6f7('0x4a')][_0xb6f7('0x5d')]?_0x2fcb79[_0xb6f7('0x4a')]:_0x2da7df['model'];_0x2fcb79[_0xb6f7('0x4e')]=qs[_0xb6f7('0x4f')](_0x5df12f[_0xb6f7('0x48')][_0xb6f7('0x4f')]);_0x2fcb79['where']=qs[_0xb6f7('0x5c')](_[_0xb6f7('0x6b')](_0x5df12f[_0xb6f7('0x48')],_0x2da7df[_0xb6f7('0x5c')]));if(_0x5df12f[_0xb6f7('0x48')]['filter']){_0x2fcb79[_0xb6f7('0x50')]=_['merge'](_0x2fcb79[_0xb6f7('0x50')],{'$or':_['map'](_0x2fcb79[_0xb6f7('0x4a')],function(_0x5bbc81){var _0x1ae4b4={};_0x1ae4b4[_0x5bbc81]={'$like':'%'+_0x5df12f['query'][_0xb6f7('0x51')]+'%'};return _0x1ae4b4;})});}_0x2fcb79=_[_0xb6f7('0x52')]({},_0x2fcb79,_0x5df12f[_0xb6f7('0x6c')]);return _0x4d6890['getAgents'](_0x2fcb79);}})[_0xb6f7('0x24')](function(_0x15b95c){if(_0x15b95c){_0x44291b=_0x15b95c[_0xb6f7('0x5d')];if(!_0x5df12f['query'][_0xb6f7('0x4c')](_0xb6f7('0x4d'))){_0x2fcb79['limit']=qs['limit'](_0x5df12f[_0xb6f7('0x48')][_0xb6f7('0x33')]);_0x2fcb79['offset']=qs[_0xb6f7('0x35')](_0x5df12f[_0xb6f7('0x48')][_0xb6f7('0x35')]);}return _0x4d6890[_0xb6f7('0xbe')](_0x2fcb79);}})[_0xb6f7('0x24')](function(_0xf2515c){if(_0xf2515c){return _0xf2515c?{'count':_0x44291b,'rows':_0xf2515c}:null;}})['then'](respondWithResult(_0x3700da,null))[_0xb6f7('0x57')](handleError(_0x3700da,null));};exports[_0xb6f7('0x3f')]=function(_0x214243,_0x58654e,_0x54fe73){var _0x387ce1,_0x401d01,_0x1b1f69;if(_[_0xb6f7('0x7d')](_0x214243[_0xb6f7('0x60')][_0xb6f7('0x60')])||_0x214243[_0xb6f7('0x60')][_0xb6f7('0x60')]===''){throw new db[(_0xb6f7('0x76'))][(_0xb6f7('0x77'))](_0xb6f7('0x7f'));}if(_[_0xb6f7('0x7d')](_0x214243[_0xb6f7('0x60')]['to'])){}_0x387ce1=_0x214243[_0xb6f7('0x60')]['to'];return db['OpenchannelAccount']['findOne']({'where':{'id':_0x214243[_0xb6f7('0x58')]['id']}})[_0xb6f7('0x24')](handleEntityNotFound(_0x58654e,null))['then'](function(_0x9e1904){if(_0x9e1904){return db[_0xb6f7('0x43')][_0xb6f7('0x5e')]({'where':{'id':_0x9e1904['id']},'include':[{'model':db[_0xb6f7('0xbf')],'as':'List','include':[{'model':db[_0xb6f7('0x75')],'as':_0xb6f7('0x83'),'where':{[_0x9e1904[_0xb6f7('0x80')]]:_0x387ce1},'limit':0x1,'order':[[_0xb6f7('0x7b'),_0xb6f7('0x84')]]}]}]})[_0xb6f7('0x24')](handleEntityNotFound(_0x58654e,null))[_0xb6f7('0x24')](function(_0x17b1bc){if(_0x17b1bc&&_0x17b1bc[_0xb6f7('0x87')]){_0x401d01=_0x17b1bc[_0xb6f7('0x39')]({'plain':!![]});if(_0x401d01['List']&&_0x401d01[_0xb6f7('0x87')][_0xb6f7('0x83')][_0xb6f7('0x5d')]){return _0x401d01[_0xb6f7('0x87')][_0xb6f7('0x83')][0x0];}return db[_0xb6f7('0x75')][_0xb6f7('0x5f')](_['defaults'](_0x214243[_0xb6f7('0x60')],{'firstName':_0x387ce1,[_0x17b1bc[_0xb6f7('0x80')]]:_0x387ce1,'phone':_0x387ce1,'ListId':_0x401d01['ListId']}));}})[_0xb6f7('0x24')](handleEntityNotFound(_0x58654e,null))[_0xb6f7('0x24')](function(_0x403495){if(_0x403495){_0x1b1f69=_0x403495;return db['OpenchannelInteraction'][_0xb6f7('0x5e')]({'where':{'ContactId':_0x1b1f69['id'],'closed':![],'OpenchannelAccountId':_0x401d01['id']}})[_0xb6f7('0x24')](function(_0x29399e){if(_0x29399e){return[_0x29399e,![]];}return db[_0xb6f7('0x91')]['create']({'UserId':_0x214243[_0xb6f7('0x61')]['id'],'ContactId':_0x1b1f69['id'],'OpenchannelAccountId':_0x401d01['id'],'lastMsgDirection':_0xb6f7('0xc0'),'firstMsgDirection':_0xb6f7('0xc0'),'Messages':[_['merge'](_0x214243[_0xb6f7('0x60')],{'read':![],'body':_0x214243[_0xb6f7('0x60')]['body'],'OpenchannelAccountId':_0x401d01['id'],'UserId':_0x214243[_0xb6f7('0x61')]['id'],'ContactId':_0x1b1f69['id']})]},{'include':[{'model':db[_0xb6f7('0x9c')],'as':_0xb6f7('0xc1')}]})['then'](function(_0x33f472){return[_0x33f472,!![]];});});}})[_0xb6f7('0x94')](function(_0x3333ca,_0x9180e){if(_0x9180e){return _0x3333ca;}return db[_0xb6f7('0x9c')]['create'](_[_0xb6f7('0x52')](_0x214243[_0xb6f7('0x60')],{'read':![],'body':_0x214243['body'][_0xb6f7('0x60')],'OpenchannelAccountId':_0x401d01['id'],'OpenchannelInteractionId':_0x3333ca['id'],'UserId':_0x214243[_0xb6f7('0x61')]['id'],'ContactId':_0x1b1f69['id']}))[_0xb6f7('0x24')](function(_0x48eb11){_0x3333ca[_0xb6f7('0xc2')][_0xb6f7('0xc1')]=[];_0x3333ca[_0xb6f7('0xc2')][_0xb6f7('0xc1')][_0xb6f7('0x98')](_0x48eb11[_0xb6f7('0xc2')]);return _0x3333ca;});});}})['then'](respondWithResult(_0x58654e,null))[_0xb6f7('0x57')](handleError(_0x58654e,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 2962001..97d4925 100644 --- a/server/api/openchannelAccount/openchannelAccount.events.js +++ b/server/api/openchannelAccount/openchannelAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbdb7=['save','update','remove','hasOwnProperty','hook','events','../../mysqldb','OpenchannelAccount','setMaxListeners'];(function(_0xc1c5d7,_0x313c88){var _0x2e1e88=function(_0x3acbee){while(--_0x3acbee){_0xc1c5d7['push'](_0xc1c5d7['shift']());}};_0x2e1e88(++_0x313c88);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x56a06f,_0x183813){_0x56a06f=_0x56a06f-0x0;var _0x3309ac=_0xbdb7[_0x56a06f];return _0x3309ac;};'use strict';var EventEmitter=require(_0x7bdb('0x0'));var OpenchannelAccount=require(_0x7bdb('0x1'))['db'][_0x7bdb('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x7bdb('0x3')](0x0);var events={'afterCreate':_0x7bdb('0x4'),'afterUpdate':_0x7bdb('0x5'),'afterDestroy':_0x7bdb('0x6')};function emitEvent(_0x2c7e07){return function(_0x46c068,_0x47aec5,_0x28542c){OpenchannelAccountEvents['emit'](_0x2c7e07+':'+_0x46c068['id'],_0x46c068);OpenchannelAccountEvents['emit'](_0x2c7e07,_0x46c068);_0x28542c(null);};}for(var e in events){if(events[_0x7bdb('0x7')](e)){var event=events[e];OpenchannelAccount[_0x7bdb('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file +var _0xa75b=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x3d80b1,_0x19f0cb){var _0x1062f3=function(_0x2ebc6e){while(--_0x2ebc6e){_0x3d80b1['push'](_0x3d80b1['shift']());}};_0x1062f3(++_0x19f0cb);}(_0xa75b,0x170));var _0xba75=function(_0x336887,_0x2b6a4b){_0x336887=_0x336887-0x0;var _0xb1200=_0xa75b[_0x336887];return _0xb1200;};'use strict';var EventEmitter=require(_0xba75('0x0'));var OpenchannelAccount=require('../../mysqldb')['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xba75('0x1')](0x0);var events={'afterCreate':_0xba75('0x2'),'afterUpdate':_0xba75('0x3'),'afterDestroy':_0xba75('0x4')};function emitEvent(_0x1760c0){return function(_0x336606,_0x152269,_0x398bd5){OpenchannelAccountEvents[_0xba75('0x5')](_0x1760c0+':'+_0x336606['id'],_0x336606);OpenchannelAccountEvents[_0xba75('0x5')](_0x1760c0,_0x336606);_0x398bd5(null);};}for(var e in events){if(events[_0xba75('0x6')](e)){var event=events[e];OpenchannelAccount[_0xba75('0x7')](e,emitEvent(event));}}module[_0xba75('0x8')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 9daf4f5..87222fb 100644 --- a/server/api/openchannelAccount/openchannelAccount.model.js +++ b/server/api/openchannelAccount/openchannelAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0xa570ff,_0x4dfa3d){var _0x17e396=function(_0x50947a){while(--_0x50947a){_0xa570ff['push'](_0xa570ff['shift']());}};_0x17e396(++_0x4dfa3d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0xaab5bd,_0x50736a){var _0x4fe27b=function(_0x441ce7){while(--_0x441ce7){_0xaab5bd['push'](_0xaab5bd['shift']());}};_0x4fe27b(++_0x50736a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.rpc.js b/server/api/openchannelAccount/openchannelAccount.rpc.js index 570381f..1523199 100644 --- a/server/api/openchannelAccount/openchannelAccount.rpc.js +++ b/server/api/openchannelAccount/openchannelAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa25c=['error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','defaults','redis','localhost','socket.io-emitter','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x24e591,_0x459d00){var _0xb4fec8=function(_0x2282e1){while(--_0x2282e1){_0x24e591['push'](_0x24e591['shift']());}};_0xb4fec8(++_0x459d00);}(_0xa25c,0x13f));var _0xca25=function(_0x533897,_0x34e7c8){_0x533897=_0x533897-0x0;var _0x340bbd=_0xa25c[_0x533897];return _0x340bbd;};'use strict';var _=require('lodash');var util=require(_0xca25('0x0'));var moment=require(_0xca25('0x1'));var BPromise=require(_0xca25('0x2'));var rs=require(_0xca25('0x3'));var fs=require('fs');var Redis=require(_0xca25('0x4'));var db=require(_0xca25('0x5'))['db'];var utils=require(_0xca25('0x6'));var logger=require(_0xca25('0x7'))('rpc');var config=require(_0xca25('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xca25('0x9')]({'port':0x232a});config['redis']=_[_0xca25('0xa')](config[_0xca25('0xb')],{'host':_0xca25('0xc'),'port':0x18eb});var socket=require(_0xca25('0xd'))(new Redis(config[_0xca25('0xb')]));require('./openchannelAccount.socket')['register'](socket);function respondWithRpcPromise(_0x44d596,_0x520a0a,_0x41b943){return new BPromise(function(_0xa6e8b2,_0x216c6a){return client['request'](_0x44d596,_0x41b943)['then'](function(_0x571c66){logger[_0xca25('0xe')](_0xca25('0xf'),_0x520a0a,_0xca25('0x10'));logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x520a0a,_0xca25('0x10'),JSON['stringify'](_0x571c66));if(_0x571c66[_0xca25('0x11')]){if(_0x571c66[_0xca25('0x11')][_0xca25('0x12')]===0x1f4){logger[_0xca25('0x11')](_0xca25('0xf'),_0x520a0a,_0x571c66[_0xca25('0x11')][_0xca25('0x13')]);return _0x216c6a(_0x571c66[_0xca25('0x11')][_0xca25('0x13')]);}logger[_0xca25('0x11')](_0xca25('0xf'),_0x520a0a,_0x571c66['error'][_0xca25('0x13')]);return _0xa6e8b2(_0x571c66[_0xca25('0x11')]['message']);}else{logger[_0xca25('0xe')](_0xca25('0xf'),_0x520a0a,_0xca25('0x10'));_0xa6e8b2(_0x571c66[_0xca25('0x14')][_0xca25('0x13')]);}})['catch'](function(_0x11d7f4){logger[_0xca25('0x11')](_0xca25('0xf'),_0x520a0a,_0x11d7f4);_0x216c6a(_0x11d7f4);});});} \ No newline at end of file +var _0x9434=['debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./openchannelAccount.socket','request','then','info'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x9434,0x168));var _0x4943=function(_0xbcc528,_0x477d5a){_0xbcc528=_0xbcc528-0x0;var _0x2b938d=_0x9434[_0xbcc528];return _0x2b938d;};'use strict';var _=require(_0x4943('0x0'));var util=require(_0x4943('0x1'));var moment=require(_0x4943('0x2'));var BPromise=require(_0x4943('0x3'));var rs=require(_0x4943('0x4'));var fs=require('fs');var Redis=require(_0x4943('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4943('0x6'));var logger=require(_0x4943('0x7'))('rpc');var config=require(_0x4943('0x8'));var jayson=require(_0x4943('0x9'));var client=jayson['client'][_0x4943('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x4943('0xb')],{'host':_0x4943('0xc'),'port':0x18eb});var socket=require(_0x4943('0xd'))(new Redis(config[_0x4943('0xb')]));require(_0x4943('0xe'))['register'](socket);function respondWithRpcPromise(_0x51b504,_0x3057c4,_0x1bc269){return new BPromise(function(_0xf6d6c8,_0x519060){return client[_0x4943('0xf')](_0x51b504,_0x1bc269)[_0x4943('0x10')](function(_0x5a64a3){logger[_0x4943('0x11')]('OpenchannelAccount,\x20%s,\x20%s',_0x3057c4,'request\x20sent');logger[_0x4943('0x12')](_0x4943('0x13'),_0x3057c4,_0x4943('0x14'),JSON[_0x4943('0x15')](_0x5a64a3));if(_0x5a64a3[_0x4943('0x16')]){if(_0x5a64a3[_0x4943('0x16')][_0x4943('0x17')]===0x1f4){logger['error'](_0x4943('0x18'),_0x3057c4,_0x5a64a3[_0x4943('0x16')][_0x4943('0x19')]);return _0x519060(_0x5a64a3[_0x4943('0x16')][_0x4943('0x19')]);}logger[_0x4943('0x16')]('OpenchannelAccount,\x20%s,\x20%s',_0x3057c4,_0x5a64a3[_0x4943('0x16')][_0x4943('0x19')]);return _0xf6d6c8(_0x5a64a3[_0x4943('0x16')]['message']);}else{logger['info'](_0x4943('0x18'),_0x3057c4,'request\x20sent');_0xf6d6c8(_0x5a64a3[_0x4943('0x1a')][_0x4943('0x19')]);}})['catch'](function(_0x156c8c){logger[_0x4943('0x16')](_0x4943('0x18'),_0x3057c4,_0x156c8c);_0x519060(_0x156c8c);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index ffa7cfe..41cf121 100644 --- a/server/api/openchannelAccount/openchannelAccount.socket.js +++ b/server/api/openchannelAccount/openchannelAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a2c=['openchannelAccount:','./openchannelAccount.events','remove','update','emit','register'];(function(_0x36b356,_0x5e9845){var _0x196872=function(_0x1dc474){while(--_0x1dc474){_0x36b356['push'](_0x36b356['shift']());}};_0x196872(++_0x5e9845);}(_0x7a2c,0x17b));var _0xc7a2=function(_0x50796a,_0x3871f2){_0x50796a=_0x50796a-0x0;var _0x5ef86e=_0x7a2c[_0x50796a];return _0x5ef86e;};'use strict';var OpenchannelAccountEvents=require(_0xc7a2('0x0'));var events=['save',_0xc7a2('0x1'),_0xc7a2('0x2')];function createListener(_0x409ec5,_0x26fb61){return function(_0x44d702){_0x26fb61[_0xc7a2('0x3')](_0x409ec5,_0x44d702);};}function removeListener(_0x3f2b0d,_0x34cd60){return function(){OpenchannelAccountEvents['removeListener'](_0x3f2b0d,_0x34cd60);};}exports[_0xc7a2('0x4')]=function(_0x1ddbae){for(var _0x5f334e=0x0,_0x481430=events['length'];_0x5f334e<_0x481430;_0x5f334e++){var _0x1dd150=events[_0x5f334e];var _0x3de428=createListener(_0xc7a2('0x5')+_0x1dd150,_0x1ddbae);OpenchannelAccountEvents['on'](_0x1dd150,_0x3de428);}}; \ No newline at end of file +var _0x2242=['register','length','openchannelAccount:','./openchannelAccount.events','save','remove','emit','removeListener'];(function(_0x98db33,_0x397f20){var _0x5ae63a=function(_0x411f1c){while(--_0x411f1c){_0x98db33['push'](_0x98db33['shift']());}};_0x5ae63a(++_0x397f20);}(_0x2242,0x1a3));var _0x2224=function(_0x45972d,_0x2dfad6){_0x45972d=_0x45972d-0x0;var _0x42a9b4=_0x2242[_0x45972d];return _0x42a9b4;};'use strict';var OpenchannelAccountEvents=require(_0x2224('0x0'));var events=[_0x2224('0x1'),_0x2224('0x2'),'update'];function createListener(_0x3180c8,_0x317565){return function(_0x4acc10){_0x317565[_0x2224('0x3')](_0x3180c8,_0x4acc10);};}function removeListener(_0xb65b2f,_0x4b2099){return function(){OpenchannelAccountEvents[_0x2224('0x4')](_0xb65b2f,_0x4b2099);};}exports[_0x2224('0x5')]=function(_0x23a873){for(var _0x54d057=0x0,_0x28833b=events[_0x2224('0x6')];_0x54d057<_0x28833b;_0x54d057++){var _0x35f807=events[_0x54d057];var _0x25c6d4=createListener(_0x2224('0x7')+_0x35f807,_0x23a873);OpenchannelAccountEvents['on'](_0x35f807,_0x25c6d4);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index e9bb4cc..8a3952a 100644 --- a/server/api/openchannelApplication/index.js +++ b/server/api/openchannelApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x467d=['post','create','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id'];(function(_0x37b647,_0x242852){var _0x4f5fad=function(_0x234fdf){while(--_0x234fdf){_0x37b647['push'](_0x37b647['shift']());}};_0x4f5fad(++_0x242852);}(_0x467d,0x146));var _0xd467=function(_0x2ae2c9,_0x4bc854){_0x2ae2c9=_0x2ae2c9-0x0;var _0x187d71=_0x467d[_0x2ae2c9];return _0x187d71;};'use strict';var multer=require(_0xd467('0x0'));var util=require(_0xd467('0x1'));var path=require('path');var timeout=require(_0xd467('0x2'));var express=require(_0xd467('0x3'));var router=express[_0xd467('0x4')]();var fs_extra=require(_0xd467('0x5'));var auth=require(_0xd467('0x6'));var interaction=require(_0xd467('0x7'));var config=require(_0xd467('0x8'));var controller=require(_0xd467('0x9'));router[_0xd467('0xa')]('/',auth[_0xd467('0xb')](),controller[_0xd467('0xc')]);router[_0xd467('0xa')](_0xd467('0xd'),auth[_0xd467('0xb')](),controller['show']);router[_0xd467('0xe')]('/',auth[_0xd467('0xb')](),controller[_0xd467('0xf')]);router[_0xd467('0x10')](_0xd467('0xd'),auth[_0xd467('0xb')](),controller[_0xd467('0x11')]);router[_0xd467('0x12')](_0xd467('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xd467('0x13')]=router; \ No newline at end of file +var _0x0979=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','/:id','show','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x47c03c,_0x45a079){var _0x3b4757=function(_0x24d9ac){while(--_0x24d9ac){_0x47c03c['push'](_0x47c03c['shift']());}};_0x3b4757(++_0x45a079);}(_0x0979,0x7b));var _0x9097=function(_0x568363,_0x2e79a7){_0x568363=_0x568363-0x0;var _0x47f0ed=_0x0979[_0x568363];return _0x47f0ed;};'use strict';var multer=require(_0x9097('0x0'));var util=require(_0x9097('0x1'));var path=require(_0x9097('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9097('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9097('0x4'));var interaction=require(_0x9097('0x5'));var config=require(_0x9097('0x6'));var controller=require(_0x9097('0x7'));router[_0x9097('0x8')]('/',auth[_0x9097('0x9')](),controller['index']);router[_0x9097('0x8')](_0x9097('0xa'),auth[_0x9097('0x9')](),controller[_0x9097('0xb')]);router['post']('/',auth[_0x9097('0x9')](),controller[_0x9097('0xc')]);router[_0x9097('0xd')](_0x9097('0xa'),auth[_0x9097('0x9')](),controller[_0x9097('0xe')]);router[_0x9097('0xf')](_0x9097('0xa'),auth[_0x9097('0x9')](),controller[_0x9097('0x10')]);module[_0x9097('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index dfccad3..809fe06 100644 --- a/server/api/openchannelApplication/openchannelApplication.attributes.js +++ b/server/api/openchannelApplication/openchannelApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc518=['TEXT','*,*,*,*','INTEGER','STRING'];(function(_0x5a1b58,_0x40287f){var _0x1b5032=function(_0x390f44){while(--_0x390f44){_0x5a1b58['push'](_0x5a1b58['shift']());}};_0x1b5032(++_0x40287f);}(_0xc518,0x196));var _0x8c51=function(_0x342993,_0x43f554){_0x342993=_0x342993-0x0;var _0x366ce=_0xc518[_0x342993];return _0x366ce;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x8c51('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x8c51('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x8c51('0x2')]()},'description':{'type':Sequelize[_0x8c51('0x1')]},'interval':{'type':Sequelize[_0x8c51('0x1')],'defaultValue':_0x8c51('0x3')}}; \ No newline at end of file +var _0xb305=['exports','INTEGER','STRING','*,*,*,*'];(function(_0x4193f6,_0x5a994b){var _0x314d94=function(_0x31f1b9){while(--_0x31f1b9){_0x4193f6['push'](_0x4193f6['shift']());}};_0x314d94(++_0x5a994b);}(_0xb305,0x190));var _0x5b30=function(_0x4e7f42,_0x1d8502){_0x4e7f42=_0x4e7f42-0x0;var _0x4902ed=_0xb305[_0x4e7f42];return _0x4902ed;};'use strict';var Sequelize=require('sequelize');module[_0x5b30('0x0')]={'priority':{'type':Sequelize[_0x5b30('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x5b30('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x5b30('0x2')]},'interval':{'type':Sequelize[_0x5b30('0x2')],'defaultValue':_0x5b30('0x3')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 6303e10..bd8a851 100644 --- a/server/api/openchannelApplication/openchannelApplication.controller.js +++ b/server/api/openchannelApplication/openchannelApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9d22=['where','type','VIRTUAL','merge','options','includeAll','findAll','rows','catch','params','keys','length','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','offset','order','pick','filter'];(function(_0x20f2a5,_0x43b025){var _0x4ffd4b=function(_0x3bd178){while(--_0x3bd178){_0x20f2a5['push'](_0x20f2a5['shift']());}};_0x4ffd4b(++_0x43b025);}(_0x9d22,0x1d8));var _0x29d2=function(_0x28edda,_0xbd447a){_0x28edda=_0x28edda-0x0;var _0x21f4a4=_0x9d22[_0x28edda];return _0x21f4a4;};'use strict';var emlformat=require(_0x29d2('0x0'));var rimraf=require(_0x29d2('0x1'));var zipdir=require(_0x29d2('0x2'));var jsonpatch=require(_0x29d2('0x3'));var rp=require(_0x29d2('0x4'));var moment=require(_0x29d2('0x5'));var BPromise=require(_0x29d2('0x6'));var Mustache=require('mustache');var util=require(_0x29d2('0x7'));var path=require(_0x29d2('0x8'));var sox=require('sox');var csv=require(_0x29d2('0x9'));var ejs=require(_0x29d2('0xa'));var fs=require('fs');var fs_extra=require(_0x29d2('0xb'));var _=require('lodash');var squel=require(_0x29d2('0xc'));var crypto=require('crypto');var jsforce=require(_0x29d2('0xd'));var deskjs=require(_0x29d2('0xe'));var toCsv=require(_0x29d2('0x9'));var querystring=require(_0x29d2('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x29d2('0x10'));var as=require(_0x29d2('0x11'));var hardwareService=require(_0x29d2('0x12'));var logger=require(_0x29d2('0x13'))(_0x29d2('0x14'));var utils=require(_0x29d2('0x15'));var config=require(_0x29d2('0x16'));var licenseUtil=require(_0x29d2('0x17'));var db=require(_0x29d2('0x18'))['db'];function respondWithStatusCode(_0x2b8f9c,_0x55e4aa){_0x55e4aa=_0x55e4aa||0xcc;return function(_0x1632b3){if(_0x1632b3){return _0x2b8f9c['sendStatus'](_0x55e4aa);}return _0x2b8f9c['status'](_0x55e4aa)['end']();};}function respondWithResult(_0x3c4506,_0x2ff085){_0x2ff085=_0x2ff085||0xc8;return function(_0x2fdfad){if(_0x2fdfad){return _0x3c4506[_0x29d2('0x19')](_0x2ff085)[_0x29d2('0x1a')](_0x2fdfad);}};}function respondWithFilteredResult(_0x419dd4,_0x3034c4){return function(_0x37ba38){if(_0x37ba38){var _0x15bf41=typeof _0x3034c4['offset']===_0x29d2('0x1b')&&typeof _0x3034c4['limit']===_0x29d2('0x1b');var _0x54c539=_0x37ba38[_0x29d2('0x1c')];var _0xa7fef9=_0x15bf41?0x0:_0x3034c4['offset'];var _0x572c58=_0x15bf41?_0x37ba38[_0x29d2('0x1c')]:_0x3034c4['offset']+_0x3034c4[_0x29d2('0x1d')];var _0x4d39b4;if(_0x572c58>=_0x54c539){_0x572c58=_0x54c539;_0x4d39b4=0xc8;}else{_0x4d39b4=0xce;}_0x419dd4[_0x29d2('0x19')](_0x4d39b4);return _0x419dd4[_0x29d2('0x1e')](_0x29d2('0x1f'),_0xa7fef9+'-'+_0x572c58+'/'+_0x54c539)[_0x29d2('0x1a')](_0x37ba38);}return null;};}function patchUpdates(_0x1cd47c){return function(_0x208bd3){try{jsonpatch[_0x29d2('0x20')](_0x208bd3,_0x1cd47c,!![]);}catch(_0x2c14ad){return BPromise['reject'](_0x2c14ad);}return _0x208bd3[_0x29d2('0x21')]();};}function saveUpdates(_0x1724ec,_0x165097){return function(_0x1a5403){if(_0x1a5403){return _0x1a5403[_0x29d2('0x22')](_0x1724ec)[_0x29d2('0x23')](function(_0x4b3520){return _0x4b3520;});}return null;};}function removeEntity(_0x3f0a02,_0x214cea){return function(_0x2e0680){if(_0x2e0680){return _0x2e0680[_0x29d2('0x24')]()[_0x29d2('0x23')](function(){_0x3f0a02[_0x29d2('0x19')](0xcc)[_0x29d2('0x25')]();});}};}function handleEntityNotFound(_0x1f7a97,_0x1efdc3){return function(_0x4c6796){if(!_0x4c6796){_0x1f7a97[_0x29d2('0x26')](0x194);}return _0x4c6796;};}function handleError(_0x4b3d14,_0x247f91){_0x247f91=_0x247f91||0x1f4;return function(_0x191a23){logger[_0x29d2('0x27')](_0x191a23[_0x29d2('0x28')]);if(_0x191a23['name']){delete _0x191a23[_0x29d2('0x29')];}_0x4b3d14['status'](_0x247f91)[_0x29d2('0x2a')](_0x191a23);};}exports[_0x29d2('0x2b')]=function(_0x1b3188,_0x54e585){var _0x9540de={},_0x23d6d9={},_0x5cd3cc={'count':0x0,'rows':[]};var _0x2aeb2f=_[_0x29d2('0x2c')](db[_0x29d2('0x2d')][_0x29d2('0x2e')],function(_0x3e018f){return{'name':_0x3e018f[_0x29d2('0x2f')],'type':_0x3e018f['type'][_0x29d2('0x30')]};});_0x23d6d9[_0x29d2('0x31')]=_[_0x29d2('0x2c')](_0x2aeb2f,_0x29d2('0x29'));_0x23d6d9['query']=_['keys'](_0x1b3188[_0x29d2('0x32')]);_0x23d6d9[_0x29d2('0x33')]=_['intersection'](_0x23d6d9['model'],_0x23d6d9[_0x29d2('0x32')]);_0x9540de[_0x29d2('0x34')]=_[_0x29d2('0x35')](_0x23d6d9['model'],qs[_0x29d2('0x36')](_0x1b3188[_0x29d2('0x32')][_0x29d2('0x36')]));_0x9540de[_0x29d2('0x34')]=_0x9540de['attributes']['length']?_0x9540de[_0x29d2('0x34')]:_0x23d6d9['model'];if(!_0x1b3188['query'][_0x29d2('0x37')]('nolimit')){_0x9540de[_0x29d2('0x1d')]=qs['limit'](_0x1b3188[_0x29d2('0x32')][_0x29d2('0x1d')]);_0x9540de['offset']=qs[_0x29d2('0x38')](_0x1b3188[_0x29d2('0x32')][_0x29d2('0x38')]);}_0x9540de[_0x29d2('0x39')]=qs['sort'](_0x1b3188[_0x29d2('0x32')]['sort']);_0x9540de['where']=qs[_0x29d2('0x33')](_[_0x29d2('0x3a')](_0x1b3188['query'],_0x23d6d9[_0x29d2('0x33')]),_0x2aeb2f);if(_0x1b3188[_0x29d2('0x32')][_0x29d2('0x3b')]){_0x9540de[_0x29d2('0x3c')]=_['merge'](_0x9540de[_0x29d2('0x3c')],{'$or':_[_0x29d2('0x2c')](_0x2aeb2f,function(_0xdd677f){if(_0xdd677f[_0x29d2('0x3d')]!==_0x29d2('0x3e')){var _0x1dac91={};_0x1dac91[_0xdd677f[_0x29d2('0x29')]]={'$like':'%'+_0x1b3188[_0x29d2('0x32')][_0x29d2('0x3b')]+'%'};return _0x1dac91;}})});}_0x9540de=_[_0x29d2('0x3f')]({},_0x9540de,_0x1b3188[_0x29d2('0x40')]);var _0x533e2f={'where':_0x9540de[_0x29d2('0x3c')]};return db[_0x29d2('0x2d')][_0x29d2('0x1c')](_0x533e2f)['then'](function(_0x550b9a){_0x5cd3cc[_0x29d2('0x1c')]=_0x550b9a;if(_0x1b3188[_0x29d2('0x32')][_0x29d2('0x41')]){_0x9540de['include']=[{'all':!![]}];}return db[_0x29d2('0x2d')][_0x29d2('0x42')](_0x9540de);})[_0x29d2('0x23')](function(_0x29a193){_0x5cd3cc[_0x29d2('0x43')]=_0x29a193;return _0x5cd3cc;})['then'](respondWithFilteredResult(_0x54e585,_0x9540de))[_0x29d2('0x44')](handleError(_0x54e585,null));};exports['show']=function(_0xa19e3,_0x5226a2){var _0x25fda2={'raw':!![],'where':{'id':_0xa19e3[_0x29d2('0x45')]['id']}},_0x1d2cd4={};_0x1d2cd4['model']=_[_0x29d2('0x46')](db[_0x29d2('0x2d')]['rawAttributes']);_0x1d2cd4[_0x29d2('0x32')]=_[_0x29d2('0x46')](_0xa19e3[_0x29d2('0x32')]);_0x1d2cd4[_0x29d2('0x33')]=_[_0x29d2('0x35')](_0x1d2cd4[_0x29d2('0x31')],_0x1d2cd4['query']);_0x25fda2[_0x29d2('0x34')]=_[_0x29d2('0x35')](_0x1d2cd4[_0x29d2('0x31')],qs['fields'](_0xa19e3['query'][_0x29d2('0x36')]));_0x25fda2['attributes']=_0x25fda2['attributes'][_0x29d2('0x47')]?_0x25fda2[_0x29d2('0x34')]:_0x1d2cd4[_0x29d2('0x31')];if(_0xa19e3[_0x29d2('0x32')][_0x29d2('0x41')]){_0x25fda2[_0x29d2('0x48')]=[{'all':!![]}];}_0x25fda2=_[_0x29d2('0x3f')]({},_0x25fda2,_0xa19e3[_0x29d2('0x40')]);return db[_0x29d2('0x2d')][_0x29d2('0x49')](_0x25fda2)['then'](handleEntityNotFound(_0x5226a2,null))[_0x29d2('0x23')](respondWithResult(_0x5226a2,null))[_0x29d2('0x44')](handleError(_0x5226a2,null));};exports['create']=function(_0x2e2a7e,_0x2791f9){return db[_0x29d2('0x2d')][_0x29d2('0x4a')](_0x2e2a7e[_0x29d2('0x4b')],{})['then'](respondWithResult(_0x2791f9,0xc9))[_0x29d2('0x44')](handleError(_0x2791f9,null));};exports[_0x29d2('0x22')]=function(_0x184b9c,_0x1bcbcf){if(_0x184b9c['body']['id']){delete _0x184b9c[_0x29d2('0x4b')]['id'];}return db[_0x29d2('0x2d')]['find']({'where':{'id':_0x184b9c[_0x29d2('0x45')]['id']}})[_0x29d2('0x23')](handleEntityNotFound(_0x1bcbcf,null))[_0x29d2('0x23')](saveUpdates(_0x184b9c[_0x29d2('0x4b')],null))[_0x29d2('0x23')](respondWithResult(_0x1bcbcf,null))[_0x29d2('0x44')](handleError(_0x1bcbcf,null));};exports[_0x29d2('0x24')]=function(_0x1231cd,_0xd6b85f){return db['OpenchannelApplication'][_0x29d2('0x49')]({'where':{'id':_0x1231cd[_0x29d2('0x45')]['id']}})[_0x29d2('0x23')](handleEntityNotFound(_0xd6b85f,null))[_0x29d2('0x23')](removeEntity(_0xd6b85f,null))[_0x29d2('0x44')](handleError(_0xd6b85f,null));}; \ No newline at end of file +var _0xaf92=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','set','reject','save','update','destroy','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','count','then','include','findAll','rows','params','intersection','includeAll','find','create','body','catch','eml-format','rimraf','zip-dir'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xaf92,0x129));var _0x2af9=function(_0x14b5dc,_0x48fc78){_0x14b5dc=_0x14b5dc-0x0;var _0x59c774=_0xaf92[_0x14b5dc];return _0x59c774;};'use strict';var emlformat=require(_0x2af9('0x0'));var rimraf=require(_0x2af9('0x1'));var zipdir=require(_0x2af9('0x2'));var jsonpatch=require(_0x2af9('0x3'));var rp=require(_0x2af9('0x4'));var moment=require(_0x2af9('0x5'));var BPromise=require(_0x2af9('0x6'));var Mustache=require(_0x2af9('0x7'));var util=require(_0x2af9('0x8'));var path=require(_0x2af9('0x9'));var sox=require(_0x2af9('0xa'));var csv=require(_0x2af9('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2af9('0xc'));var _=require(_0x2af9('0xd'));var squel=require(_0x2af9('0xe'));var crypto=require(_0x2af9('0xf'));var jsforce=require(_0x2af9('0x10'));var deskjs=require(_0x2af9('0x11'));var toCsv=require('to-csv');var querystring=require(_0x2af9('0x12'));var Papa=require(_0x2af9('0x13'));var Redis=require(_0x2af9('0x14'));var authService=require(_0x2af9('0x15'));var qs=require(_0x2af9('0x16'));var as=require(_0x2af9('0x17'));var hardwareService=require(_0x2af9('0x18'));var logger=require('../../config/logger')(_0x2af9('0x19'));var utils=require(_0x2af9('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x31fefc,_0x1eb9fc){_0x1eb9fc=_0x1eb9fc||0xcc;return function(_0x1ef3ee){if(_0x1ef3ee){return _0x31fefc[_0x2af9('0x1b')](_0x1eb9fc);}return _0x31fefc[_0x2af9('0x1c')](_0x1eb9fc)[_0x2af9('0x1d')]();};}function respondWithResult(_0x331cfc,_0x62d8ec){_0x62d8ec=_0x62d8ec||0xc8;return function(_0x259751){if(_0x259751){return _0x331cfc['status'](_0x62d8ec)[_0x2af9('0x1e')](_0x259751);}};}function respondWithFilteredResult(_0x54cef0,_0x31407c){return function(_0x1f4f3c){if(_0x1f4f3c){var _0x549c25=typeof _0x31407c[_0x2af9('0x1f')]===_0x2af9('0x20')&&typeof _0x31407c[_0x2af9('0x21')]===_0x2af9('0x20');var _0xe697a4=_0x1f4f3c['count'];var _0x956486=_0x549c25?0x0:_0x31407c[_0x2af9('0x1f')];var _0x8ef8eb=_0x549c25?_0x1f4f3c['count']:_0x31407c[_0x2af9('0x1f')]+_0x31407c[_0x2af9('0x21')];var _0x4ee7aa;if(_0x8ef8eb>=_0xe697a4){_0x8ef8eb=_0xe697a4;_0x4ee7aa=0xc8;}else{_0x4ee7aa=0xce;}_0x54cef0['status'](_0x4ee7aa);return _0x54cef0[_0x2af9('0x22')]('Content-Range',_0x956486+'-'+_0x8ef8eb+'/'+_0xe697a4)[_0x2af9('0x1e')](_0x1f4f3c);}return null;};}function patchUpdates(_0x47ddb6){return function(_0x9c0600){try{jsonpatch['apply'](_0x9c0600,_0x47ddb6,!![]);}catch(_0x3017a6){return BPromise[_0x2af9('0x23')](_0x3017a6);}return _0x9c0600[_0x2af9('0x24')]();};}function saveUpdates(_0x337fc1,_0x12266a){return function(_0x2e4218){if(_0x2e4218){return _0x2e4218[_0x2af9('0x25')](_0x337fc1)['then'](function(_0x1e0958){return _0x1e0958;});}return null;};}function removeEntity(_0x4e99a5,_0x1afdfd){return function(_0x447217){if(_0x447217){return _0x447217[_0x2af9('0x26')]()['then'](function(){_0x4e99a5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b530d,_0x360930){return function(_0x917022){if(!_0x917022){_0x4b530d[_0x2af9('0x1b')](0x194);}return _0x917022;};}function handleError(_0x5a0b14,_0x4e3f6b){_0x4e3f6b=_0x4e3f6b||0x1f4;return function(_0xe279fa){logger[_0x2af9('0x27')](_0xe279fa[_0x2af9('0x28')]);if(_0xe279fa['name']){delete _0xe279fa[_0x2af9('0x29')];}_0x5a0b14[_0x2af9('0x1c')](_0x4e3f6b)[_0x2af9('0x2a')](_0xe279fa);};}exports[_0x2af9('0x2b')]=function(_0x1d041c,_0x160692){var _0x3e551c={},_0x39bdb2={},_0x44aad3={'count':0x0,'rows':[]};var _0x4e8510=_[_0x2af9('0x2c')](db[_0x2af9('0x2d')][_0x2af9('0x2e')],function(_0x1adbaa){return{'name':_0x1adbaa[_0x2af9('0x2f')],'type':_0x1adbaa['type']['key']};});_0x39bdb2[_0x2af9('0x30')]=_['map'](_0x4e8510,_0x2af9('0x29'));_0x39bdb2[_0x2af9('0x31')]=_[_0x2af9('0x32')](_0x1d041c[_0x2af9('0x31')]);_0x39bdb2[_0x2af9('0x33')]=_['intersection'](_0x39bdb2[_0x2af9('0x30')],_0x39bdb2['query']);_0x3e551c[_0x2af9('0x34')]=_['intersection'](_0x39bdb2[_0x2af9('0x30')],qs['fields'](_0x1d041c['query'][_0x2af9('0x35')]));_0x3e551c[_0x2af9('0x34')]=_0x3e551c[_0x2af9('0x34')][_0x2af9('0x36')]?_0x3e551c[_0x2af9('0x34')]:_0x39bdb2['model'];if(!_0x1d041c['query'][_0x2af9('0x37')](_0x2af9('0x38'))){_0x3e551c[_0x2af9('0x21')]=qs['limit'](_0x1d041c['query'][_0x2af9('0x21')]);_0x3e551c[_0x2af9('0x1f')]=qs['offset'](_0x1d041c[_0x2af9('0x31')]['offset']);}_0x3e551c['order']=qs['sort'](_0x1d041c[_0x2af9('0x31')][_0x2af9('0x39')]);_0x3e551c[_0x2af9('0x3a')]=qs[_0x2af9('0x33')](_['pick'](_0x1d041c[_0x2af9('0x31')],_0x39bdb2['filters']),_0x4e8510);if(_0x1d041c[_0x2af9('0x31')][_0x2af9('0x3b')]){_0x3e551c[_0x2af9('0x3a')]=_['merge'](_0x3e551c[_0x2af9('0x3a')],{'$or':_[_0x2af9('0x2c')](_0x4e8510,function(_0x2b80fe){if(_0x2b80fe['type']!==_0x2af9('0x3c')){var _0x2470f6={};_0x2470f6[_0x2b80fe['name']]={'$like':'%'+_0x1d041c[_0x2af9('0x31')][_0x2af9('0x3b')]+'%'};return _0x2470f6;}})});}_0x3e551c=_[_0x2af9('0x3d')]({},_0x3e551c,_0x1d041c[_0x2af9('0x3e')]);var _0x4f608c={'where':_0x3e551c[_0x2af9('0x3a')]};return db[_0x2af9('0x2d')][_0x2af9('0x3f')](_0x4f608c)[_0x2af9('0x40')](function(_0x3d38aa){_0x44aad3[_0x2af9('0x3f')]=_0x3d38aa;if(_0x1d041c[_0x2af9('0x31')]['includeAll']){_0x3e551c[_0x2af9('0x41')]=[{'all':!![]}];}return db[_0x2af9('0x2d')][_0x2af9('0x42')](_0x3e551c);})['then'](function(_0x5ad6d8){_0x44aad3[_0x2af9('0x43')]=_0x5ad6d8;return _0x44aad3;})[_0x2af9('0x40')](respondWithFilteredResult(_0x160692,_0x3e551c))['catch'](handleError(_0x160692,null));};exports['show']=function(_0x6198bc,_0x3576dd){var _0x4f49d5={'raw':!![],'where':{'id':_0x6198bc[_0x2af9('0x44')]['id']}},_0x2fe860={};_0x2fe860[_0x2af9('0x30')]=_[_0x2af9('0x32')](db[_0x2af9('0x2d')]['rawAttributes']);_0x2fe860['query']=_[_0x2af9('0x32')](_0x6198bc[_0x2af9('0x31')]);_0x2fe860['filters']=_[_0x2af9('0x45')](_0x2fe860[_0x2af9('0x30')],_0x2fe860[_0x2af9('0x31')]);_0x4f49d5[_0x2af9('0x34')]=_[_0x2af9('0x45')](_0x2fe860[_0x2af9('0x30')],qs['fields'](_0x6198bc[_0x2af9('0x31')][_0x2af9('0x35')]));_0x4f49d5[_0x2af9('0x34')]=_0x4f49d5[_0x2af9('0x34')]['length']?_0x4f49d5[_0x2af9('0x34')]:_0x2fe860[_0x2af9('0x30')];if(_0x6198bc[_0x2af9('0x31')][_0x2af9('0x46')]){_0x4f49d5['include']=[{'all':!![]}];}_0x4f49d5=_[_0x2af9('0x3d')]({},_0x4f49d5,_0x6198bc[_0x2af9('0x3e')]);return db['OpenchannelApplication'][_0x2af9('0x47')](_0x4f49d5)['then'](handleEntityNotFound(_0x3576dd,null))['then'](respondWithResult(_0x3576dd,null))['catch'](handleError(_0x3576dd,null));};exports['create']=function(_0x1c60e9,_0x218b28){return db['OpenchannelApplication'][_0x2af9('0x48')](_0x1c60e9[_0x2af9('0x49')],{})[_0x2af9('0x40')](respondWithResult(_0x218b28,0xc9))[_0x2af9('0x4a')](handleError(_0x218b28,null));};exports[_0x2af9('0x25')]=function(_0x388b14,_0x14b6a0){if(_0x388b14['body']['id']){delete _0x388b14['body']['id'];}return db['OpenchannelApplication'][_0x2af9('0x47')]({'where':{'id':_0x388b14[_0x2af9('0x44')]['id']}})['then'](handleEntityNotFound(_0x14b6a0,null))[_0x2af9('0x40')](saveUpdates(_0x388b14[_0x2af9('0x49')],null))[_0x2af9('0x40')](respondWithResult(_0x14b6a0,null))[_0x2af9('0x4a')](handleError(_0x14b6a0,null));};exports[_0x2af9('0x26')]=function(_0x13e6f2,_0x1901b7){return db[_0x2af9('0x2d')][_0x2af9('0x47')]({'where':{'id':_0x13e6f2[_0x2af9('0x44')]['id']}})['then'](handleEntityNotFound(_0x1901b7,null))['then'](removeEntity(_0x1901b7,null))['catch'](handleError(_0x1901b7,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 1167f7e..7ad82f9 100644 --- a/server/api/openchannelApplication/openchannelApplication.model.js +++ b/server/api/openchannelApplication/openchannelApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x91a4=['moment','request-promise','./openchannelApplication.attributes','exports','define','OpenchannelApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x46ab0b,_0x515b56){var _0x2b845c=function(_0x513ead){while(--_0x513ead){_0x46ab0b['push'](_0x46ab0b['shift']());}};_0x2b845c(++_0x515b56);}(_0x91a4,0x148));var _0x491a=function(_0x4c1399,_0x3deb58){_0x4c1399=_0x4c1399-0x0;var _0x3f9717=_0x91a4[_0x4c1399];return _0x3f9717;};'use strict';var _=require(_0x491a('0x0'));var util=require(_0x491a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x491a('0x2'));var BPromise=require('bluebird');var rp=require(_0x491a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x491a('0x4'));module[_0x491a('0x5')]=function(_0x6c5193,_0x4af5be){return _0x6c5193[_0x491a('0x6')](_0x491a('0x7'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x491a('0x8'),'collate':_0x491a('0x9')});}; \ No newline at end of file +var _0x08c5=['rimraf','../../config/environment','OpenchannelApplication','openchannel_applications','utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x7ecc31,_0x4fba20){var _0x203131=function(_0x5a52f2){while(--_0x5a52f2){_0x7ecc31['push'](_0x7ecc31['shift']());}};_0x203131(++_0x4fba20);}(_0x08c5,0x89));var _0x508c=function(_0x1c9f27,_0x4cd6f4){_0x1c9f27=_0x1c9f27-0x0;var _0x3598e5=_0x08c5[_0x1c9f27];return _0x3598e5;};'use strict';var _=require(_0x508c('0x0'));var util=require(_0x508c('0x1'));var logger=require(_0x508c('0x2'))('api');var moment=require(_0x508c('0x3'));var BPromise=require(_0x508c('0x4'));var rp=require(_0x508c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x508c('0x6'));var config=require(_0x508c('0x7'));var attributes=require('./openchannelApplication.attributes');module['exports']=function(_0x474013,_0x2988ce){return _0x474013['define'](_0x508c('0x8'),attributes,{'tableName':_0x508c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x508c('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 990bff6..e32e447 100644 --- a/server/api/openchannelApplication/openchannelApplication.rpc.js +++ b/server/api/openchannelApplication/openchannelApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3671=['rpc','../../config/environment','client','http','request','info','request\x20sent','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelApplication,\x20%s,\x20%s','message','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','where','attributes','limit','catch','lodash','moment','randomstring','ioredis','../../config/logger'];(function(_0x12ea73,_0x20d5d3){var _0x3134e8=function(_0x3615b8){while(--_0x3615b8){_0x12ea73['push'](_0x12ea73['shift']());}};_0x3134e8(++_0x20d5d3);}(_0x3671,0x109));var _0x1367=function(_0x9d639c,_0x524dbe){_0x9d639c=_0x9d639c-0x0;var _0x1671de=_0x3671[_0x9d639c];return _0x1671de;};'use strict';var _=require(_0x1367('0x0'));var util=require('util');var moment=require(_0x1367('0x1'));var BPromise=require('bluebird');var rs=require(_0x1367('0x2'));var fs=require('fs');var Redis=require(_0x1367('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1367('0x4'))(_0x1367('0x5'));var config=require(_0x1367('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1367('0x7')][_0x1367('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xeca039,_0x160ab9,_0x687a57){return new BPromise(function(_0x1ddbc3,_0x9ca7){return client[_0x1367('0x9')](_0xeca039,_0x687a57)['then'](function(_0x1e5794){logger[_0x1367('0xa')]('OpenchannelApplication,\x20%s,\x20%s',_0x160ab9,_0x1367('0xb'));logger['debug'](_0x1367('0xc'),_0x160ab9,'request\x20sent',JSON[_0x1367('0xd')](_0x1e5794));if(_0x1e5794[_0x1367('0xe')]){if(_0x1e5794[_0x1367('0xe')][_0x1367('0xf')]===0x1f4){logger[_0x1367('0xe')](_0x1367('0x10'),_0x160ab9,_0x1e5794[_0x1367('0xe')]['message']);return _0x9ca7(_0x1e5794[_0x1367('0xe')][_0x1367('0x11')]);}logger[_0x1367('0xe')]('OpenchannelApplication,\x20%s,\x20%s',_0x160ab9,_0x1e5794['error'][_0x1367('0x11')]);return _0x1ddbc3(_0x1e5794[_0x1367('0xe')][_0x1367('0x11')]);}else{logger[_0x1367('0xa')](_0x1367('0x10'),_0x160ab9,'request\x20sent');_0x1ddbc3(_0x1e5794['result'][_0x1367('0x11')]);}})['catch'](function(_0x1946b0){logger[_0x1367('0xe')](_0x1367('0x10'),_0x160ab9,_0x1946b0);_0x9ca7(_0x1946b0);});});}exports[_0x1367('0x12')]=function(_0x59afd7){var _0x545fcc=this;return new Promise(function(_0x1c0eae,_0x2f2760){return db[_0x1367('0x13')][_0x1367('0x14')](_0x59afd7[_0x1367('0x15')],{'raw':_0x59afd7[_0x1367('0x16')]?_0x59afd7['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59afd7[_0x1367('0x16')]?_0x59afd7[_0x1367('0x16')][_0x1367('0x17')]||null:null,'attributes':_0x59afd7[_0x1367('0x16')]?_0x59afd7[_0x1367('0x16')][_0x1367('0x18')]||null:null,'limit':_0x59afd7[_0x1367('0x16')]?_0x59afd7[_0x1367('0x16')][_0x1367('0x19')]||null:null})['then'](function(_0x1ac11a){logger[_0x1367('0xa')](_0x1367('0x12'),_0x59afd7);logger['debug'](_0x1367('0x12'),_0x59afd7,JSON['stringify'](_0x1ac11a));_0x1c0eae(_0x1ac11a);})[_0x1367('0x1a')](function(_0x1dd0b5){logger[_0x1367('0xe')](_0x1367('0x12'),_0x1dd0b5[_0x1367('0x11')],_0x59afd7);_0x2f2760(_0x545fcc[_0x1367('0xe')](0x1f4,_0x1dd0b5[_0x1367('0x11')]));});});}; \ No newline at end of file +var _0x7863=['request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','attributes','limit','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','OpenchannelApplication,\x20%s,\x20%s'];(function(_0x2dbc46,_0x439da9){var _0x156eed=function(_0xa71070){while(--_0xa71070){_0x2dbc46['push'](_0x2dbc46['shift']());}};_0x156eed(++_0x439da9);}(_0x7863,0xac));var _0x3786=function(_0x32c48c,_0x5d669e){_0x32c48c=_0x32c48c-0x0;var _0x133729=_0x7863[_0x32c48c];return _0x133729;};'use strict';var _=require(_0x3786('0x0'));var util=require(_0x3786('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3786('0x2'));var fs=require('fs');var Redis=require(_0x3786('0x3'));var db=require(_0x3786('0x4'))['db'];var utils=require(_0x3786('0x5'));var logger=require('../../config/logger')(_0x3786('0x6'));var config=require(_0x3786('0x7'));var jayson=require(_0x3786('0x8'));var client=jayson[_0x3786('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x55e4f3,_0x7fa736,_0x4bd88e){return new BPromise(function(_0x510210,_0x356190){return client[_0x3786('0xa')](_0x55e4f3,_0x4bd88e)[_0x3786('0xb')](function(_0x2f536a){logger[_0x3786('0xc')](_0x3786('0xd'),_0x7fa736,_0x3786('0xe'));logger[_0x3786('0xf')](_0x3786('0x10'),_0x7fa736,_0x3786('0xe'),JSON[_0x3786('0x11')](_0x2f536a));if(_0x2f536a[_0x3786('0x12')]){if(_0x2f536a[_0x3786('0x12')][_0x3786('0x13')]===0x1f4){logger['error'](_0x3786('0xd'),_0x7fa736,_0x2f536a[_0x3786('0x12')][_0x3786('0x14')]);return _0x356190(_0x2f536a[_0x3786('0x12')][_0x3786('0x14')]);}logger[_0x3786('0x12')](_0x3786('0xd'),_0x7fa736,_0x2f536a[_0x3786('0x12')][_0x3786('0x14')]);return _0x510210(_0x2f536a[_0x3786('0x12')][_0x3786('0x14')]);}else{logger[_0x3786('0xc')](_0x3786('0xd'),_0x7fa736,_0x3786('0xe'));_0x510210(_0x2f536a[_0x3786('0x15')][_0x3786('0x14')]);}})[_0x3786('0x16')](function(_0xcc58e3){logger['error'](_0x3786('0xd'),_0x7fa736,_0xcc58e3);_0x356190(_0xcc58e3);});});}exports[_0x3786('0x17')]=function(_0x439fcf){var _0x24c3ac=this;return new Promise(function(_0x29c537,_0x6d135d){return db[_0x3786('0x18')][_0x3786('0x19')](_0x439fcf[_0x3786('0x1a')],{'raw':_0x439fcf[_0x3786('0x1b')]?_0x439fcf[_0x3786('0x1b')][_0x3786('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x439fcf[_0x3786('0x1b')]?_0x439fcf[_0x3786('0x1b')]['where']||null:null,'attributes':_0x439fcf[_0x3786('0x1b')]?_0x439fcf[_0x3786('0x1b')][_0x3786('0x1d')]||null:null,'limit':_0x439fcf['options']?_0x439fcf[_0x3786('0x1b')][_0x3786('0x1e')]||null:null})[_0x3786('0xb')](function(_0x1c2ecb){logger[_0x3786('0xc')]('UpdateOpenchannelApplication',_0x439fcf);logger[_0x3786('0xf')](_0x3786('0x17'),_0x439fcf,JSON[_0x3786('0x11')](_0x1c2ecb));_0x29c537(_0x1c2ecb);})[_0x3786('0x16')](function(_0x4e15d7){logger[_0x3786('0x12')](_0x3786('0x17'),_0x4e15d7[_0x3786('0x14')],_0x439fcf);_0x6d135d(_0x24c3ac[_0x3786('0x12')](0x1f4,_0x4e15d7['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 6b1d669..bd08c75 100644 --- a/server/api/openchannelInteraction/index.js +++ b/server/api/openchannelInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x630a=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','create','post','addMessage','/:id/tags','openchannel','openchannelinteraction:addtags','put','tracked','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','exports','multer','util','path','connect-timeout'];(function(_0x2011b3,_0x7c4048){var _0x1bdd08=function(_0x5d4ff8){while(--_0x5d4ff8){_0x2011b3['push'](_0x2011b3['shift']());}};_0x1bdd08(++_0x7c4048);}(_0x630a,0x18f));var _0xa630=function(_0x20cb20,_0x256051){_0x20cb20=_0x20cb20-0x0;var _0x2fcf4b=_0x630a[_0x20cb20];return _0x2fcf4b;};'use strict';var multer=require(_0xa630('0x0'));var util=require(_0xa630('0x1'));var path=require(_0xa630('0x2'));var timeout=require(_0xa630('0x3'));var express=require(_0xa630('0x4'));var router=express[_0xa630('0x5')]();var fs_extra=require(_0xa630('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xa630('0x7'));var config=require(_0xa630('0x8'));var controller=require('./openchannelInteraction.controller');router[_0xa630('0x9')]('/',auth['isAuthenticated'](),controller[_0xa630('0xa')]);router[_0xa630('0x9')]('/describe',auth[_0xa630('0xb')](),controller[_0xa630('0xc')]);router[_0xa630('0x9')](_0xa630('0xd'),auth[_0xa630('0xb')](),controller[_0xa630('0xe')]);router[_0xa630('0x9')](_0xa630('0xf'),auth['isAuthenticated'](),controller[_0xa630('0x10')]);router[_0xa630('0x9')](_0xa630('0x11'),auth[_0xa630('0xb')](),controller['download']);router['post']('/',auth[_0xa630('0xb')](),controller[_0xa630('0x12')]);router[_0xa630('0x13')](_0xa630('0xf'),auth[_0xa630('0xb')](),controller[_0xa630('0x14')]);router[_0xa630('0x13')](_0xa630('0x15'),auth[_0xa630('0xb')](),interaction['tracked'](_0xa630('0x16'),_0xa630('0x17')),controller['addTags']);router[_0xa630('0x18')](_0xa630('0xd'),auth['isAuthenticated'](),interaction[_0xa630('0x19')](_0xa630('0x16'),_0xa630('0x1a')),controller[_0xa630('0x1b')]);router[_0xa630('0x1c')](_0xa630('0xd'),auth[_0xa630('0xb')](),interaction[_0xa630('0x19')](_0xa630('0x16'),_0xa630('0x1d')),controller['destroy']);router['delete'](_0xa630('0x15'),auth[_0xa630('0xb')](),controller['removeTags']);module[_0xa630('0x1e')]=router; \ No newline at end of file +var _0xcbcd=['delete','openchannel','/:id/tags','exports','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','download','post','addMessage','tracked','openchannelinteraction:update','update'];(function(_0x4841db,_0x3eeb37){var _0x1e383f=function(_0x22e190){while(--_0x22e190){_0x4841db['push'](_0x4841db['shift']());}};_0x1e383f(++_0x3eeb37);}(_0xcbcd,0x17e));var _0xdcbc=function(_0x3e0b8f,_0x1cddeb){_0x3e0b8f=_0x3e0b8f-0x0;var _0x22f742=_0xcbcd[_0x3e0b8f];return _0x22f742;};'use strict';var multer=require(_0xdcbc('0x0'));var util=require(_0xdcbc('0x1'));var path=require(_0xdcbc('0x2'));var timeout=require(_0xdcbc('0x3'));var express=require(_0xdcbc('0x4'));var router=express['Router']();var fs_extra=require(_0xdcbc('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdcbc('0x6'));var controller=require(_0xdcbc('0x7'));router[_0xdcbc('0x8')]('/',auth[_0xdcbc('0x9')](),controller[_0xdcbc('0xa')]);router[_0xdcbc('0x8')](_0xdcbc('0xb'),auth[_0xdcbc('0x9')](),controller[_0xdcbc('0xc')]);router[_0xdcbc('0x8')](_0xdcbc('0xd'),auth[_0xdcbc('0x9')](),controller[_0xdcbc('0xe')]);router['get'](_0xdcbc('0xf'),auth[_0xdcbc('0x9')](),controller[_0xdcbc('0x10')]);router[_0xdcbc('0x8')]('/:id/download',auth[_0xdcbc('0x9')](),controller[_0xdcbc('0x11')]);router[_0xdcbc('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0xdcbc('0x12')](_0xdcbc('0xf'),auth[_0xdcbc('0x9')](),controller[_0xdcbc('0x13')]);router[_0xdcbc('0x12')]('/:id/tags',auth[_0xdcbc('0x9')](),interaction[_0xdcbc('0x14')]('openchannel','openchannelinteraction:addtags'),controller['addTags']);router['put'](_0xdcbc('0xd'),auth[_0xdcbc('0x9')](),interaction['tracked']('openchannel',_0xdcbc('0x15')),controller[_0xdcbc('0x16')]);router[_0xdcbc('0x17')](_0xdcbc('0xd'),auth[_0xdcbc('0x9')](),interaction[_0xdcbc('0x14')](_0xdcbc('0x18'),'openchannelinteraction:destroy'),controller['destroy']);router['delete'](_0xdcbc('0x19'),auth['isAuthenticated'](),controller['removeTags']);module[_0xdcbc('0x1a')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index e282fd3..5fbc084 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.attributes.js +++ b/server/api/openchannelInteraction/openchannelInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4fad=['sequelize','exports','BOOLEAN','STRING','DATE','out','INTEGER'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x4fad,0xcb));var _0xd4fa=function(_0x59274f,_0x3ac855){_0x59274f=_0x59274f-0x0;var _0xd055de=_0x4fad[_0x59274f];return _0xd055de;};'use strict';var Sequelize=require(_0xd4fa('0x0'));module[_0xd4fa('0x1')]={'closed':{'type':Sequelize[_0xd4fa('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xd4fa('0x3')]},'secondDisposition':{'type':Sequelize[_0xd4fa('0x3')]},'thirdDisposition':{'type':Sequelize[_0xd4fa('0x3')]},'note':{'type':Sequelize[_0xd4fa('0x3')]},'read1stAt':{'type':Sequelize[_0xd4fa('0x4')]},'threadId':{'type':Sequelize[_0xd4fa('0x3')]},'externalUrl':{'type':Sequelize[_0xd4fa('0x3')]},'lastMsgAt':{'type':Sequelize[_0xd4fa('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xd4fa('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xd4fa('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xd4fa('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0xd4fa('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xd4fa('0x6')]}}; \ No newline at end of file +var _0x8a0d=['sequelize','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x2a3333,_0x4c4898){var _0x7a74fa=function(_0x5a7188){while(--_0x5a7188){_0x2a3333['push'](_0x2a3333['shift']());}};_0x7a74fa(++_0x4c4898);}(_0x8a0d,0x156));var _0xd8a0=function(_0xa8b06b,_0x1fdce6){_0xa8b06b=_0xa8b06b-0x0;var _0x11dd04=_0x8a0d[_0xa8b06b];return _0x11dd04;};'use strict';var Sequelize=require(_0xd8a0('0x0'));module['exports']={'closed':{'type':Sequelize[_0xd8a0('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xd8a0('0x2')]},'disposition':{'type':Sequelize[_0xd8a0('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xd8a0('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xd8a0('0x2')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0xd8a0('0x3')]},'lastMsgAt':{'type':Sequelize[_0xd8a0('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xd8a0('0x4')]('in',_0xd8a0('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xd8a0('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xd8a0('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0xd8a0('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index a22ad99..4b2433c 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.controller.js +++ b/server/api/openchannelInteraction/openchannelInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfddb=['include','merge','find','create','body','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','filters','hasOwnProperty','nolimit','sort','where','OpenchannelInteractionId','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','addTags','setTags','spread','Tag','color','removeTags','toString','join','root','server','files','tmp','attachments','format','transcript-%d-%s.zip','User','push','Contact','firstName','lastName','Attachment','Messages','createdAt','direction','secret','read','OpenchannelAccount','Account','fullname','get','mkdirSync','Openchannel','Owner','N.A.','closed','closedAt','disposition','threadId','Public','Private','basename','existsSync','pipe','createWriteStream','out','System','value','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','unlinkSync','sendStatus','rimraf','zip-dir','util','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','defaults','localhost','./openchannelInteraction.socket','register','status','json','offset','limit','count','set','Content-Range','update','then','destroy','end','error','name','send','map','OpenchannelInteraction','rawAttributes','type','key','getOptions','findAll','openchannel','query','user','catch','from','params','model','keys','intersection','attributes','fields','length'];(function(_0x3c29c5,_0x3a2a73){var _0x206731=function(_0x470b71){while(--_0x470b71){_0x3c29c5['push'](_0x3c29c5['shift']());}};_0x206731(++_0x3a2a73);}(_0xfddb,0x1ca));var _0xbfdd=function(_0xad0bf1,_0x548bd1){_0xad0bf1=_0xad0bf1-0x0;var _0x28f86f=_0xfddb[_0xad0bf1];return _0x28f86f;};'use strict';var rimraf=require(_0xbfdd('0x0'));var zipdir=require(_0xbfdd('0x1'));var moment=require('moment');var util=require(_0xbfdd('0x2'));var path=require(_0xbfdd('0x3'));var ejs=require(_0xbfdd('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xbfdd('0x5'));var interaction=require(_0xbfdd('0x6'));var qs=require(_0xbfdd('0x7'));var pdf=require(_0xbfdd('0x8'));var logger=require(_0xbfdd('0x9'))(_0xbfdd('0xa'));var config=require('../../config/environment');var db=require(_0xbfdd('0xb'))['db'];config[_0xbfdd('0xc')]=_[_0xbfdd('0xd')](config[_0xbfdd('0xc')],{'host':_0xbfdd('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xbfdd('0xf'))[_0xbfdd('0x10')](socket);function respondWithStatusCode(_0x56edc9,_0x1e05b8){_0x1e05b8=_0x1e05b8||0xcc;return function(_0x25f51d){if(_0x25f51d){return _0x56edc9['sendStatus'](_0x1e05b8);}return _0x56edc9[_0xbfdd('0x11')](_0x1e05b8)['end']();};}function respondWithResult(_0x13f35b,_0x4533f9){_0x4533f9=_0x4533f9||0xc8;return function(_0x405b09){if(_0x405b09){return _0x13f35b[_0xbfdd('0x11')](_0x4533f9)[_0xbfdd('0x12')](_0x405b09);}};}function respondWithFilteredResult(_0x369178,_0x99f0c7){return function(_0x34001e){if(_0x34001e){var _0x38445b=typeof _0x99f0c7[_0xbfdd('0x13')]==='undefined'&&typeof _0x99f0c7[_0xbfdd('0x14')]==='undefined';var _0x1146cb=_0x34001e['count'];var _0x1c50c0=_0x38445b?0x0:_0x99f0c7['offset'];var _0x2e712c=_0x38445b?_0x34001e[_0xbfdd('0x15')]:_0x99f0c7[_0xbfdd('0x13')]+_0x99f0c7[_0xbfdd('0x14')];var _0x4a3aae;if(_0x2e712c>=_0x1146cb){_0x2e712c=_0x1146cb;_0x4a3aae=0xc8;}else{_0x4a3aae=0xce;}_0x369178[_0xbfdd('0x11')](_0x4a3aae);return _0x369178[_0xbfdd('0x16')](_0xbfdd('0x17'),_0x1c50c0+'-'+_0x2e712c+'/'+_0x1146cb)[_0xbfdd('0x12')](_0x34001e);}return null;};}function saveUpdates(_0x35150b){return function(_0x137c45){if(_0x137c45){return _0x137c45[_0xbfdd('0x18')](_0x35150b)[_0xbfdd('0x19')](function(_0x3dbac7){return _0x3dbac7;});}return null;};}function removeEntity(_0x13ca9c){return function(_0x387b34){if(_0x387b34){return _0x387b34[_0xbfdd('0x1a')]()['then'](function(){_0x13ca9c[_0xbfdd('0x11')](0xcc)[_0xbfdd('0x1b')]();});}};}function handleEntityNotFound(_0x447762){return function(_0x5703d5){if(!_0x5703d5){_0x447762['sendStatus'](0x194);}return _0x5703d5;};}function handleError(_0x1ca29a,_0x5caac4){_0x5caac4=_0x5caac4||0x1f4;return function(_0x1411c0){logger[_0xbfdd('0x1c')](_0x1411c0['stack']);if(_0x1411c0[_0xbfdd('0x1d')]){delete _0x1411c0[_0xbfdd('0x1d')];}_0x1ca29a[_0xbfdd('0x11')](_0x5caac4)[_0xbfdd('0x1e')](_0x1411c0);};}exports['index']=function(_0x9b714b,_0x23b0a1){var _0xda7966={};var _0x3d4bb1=_[_0xbfdd('0x1f')](db[_0xbfdd('0x20')][_0xbfdd('0x21')],function(_0x2f68d3){return{'name':_0x2f68d3['fieldName'],'type':_0x2f68d3[_0xbfdd('0x22')][_0xbfdd('0x23')]};});_0xda7966=qs[_0xbfdd('0x24')](_0x3d4bb1,_0x9b714b);return interaction[_0xbfdd('0x25')](_0xbfdd('0x26'),_0x9b714b[_0xbfdd('0x27')],_0x9b714b[_0xbfdd('0x28')],_0xda7966,_0x3d4bb1)[_0xbfdd('0x19')](respondWithFilteredResult(_0x23b0a1,_0xda7966))[_0xbfdd('0x29')](handleError(_0x23b0a1,null));};exports['show']=function(_0x4031da,_0x2e7883){var _0x5ea69a={};if(_0x4031da[_0xbfdd('0x27')][_0xbfdd('0x22')]&&_0x4031da[_0xbfdd('0x27')][_0xbfdd('0x22')]==='from'){_0x5ea69a[_0xbfdd('0x2a')]=_0x4031da[_0xbfdd('0x2b')]['id'];}else{_0x5ea69a['id']=_0x4031da[_0xbfdd('0x2b')]['id'];}var _0x1b80a5={'raw':![],'where':_0x5ea69a},_0x78292a={};_0x78292a[_0xbfdd('0x2c')]=_[_0xbfdd('0x2d')](db[_0xbfdd('0x20')][_0xbfdd('0x21')]);_0x78292a['query']=_[_0xbfdd('0x2d')](_0x4031da[_0xbfdd('0x27')]);_0x78292a['filters']=_[_0xbfdd('0x2e')](_0x78292a[_0xbfdd('0x2c')],_0x78292a[_0xbfdd('0x27')]);_0x1b80a5[_0xbfdd('0x2f')]=_[_0xbfdd('0x2e')](_0x78292a[_0xbfdd('0x2c')],qs[_0xbfdd('0x30')](_0x4031da[_0xbfdd('0x27')][_0xbfdd('0x30')]));_0x1b80a5[_0xbfdd('0x2f')]=_0x1b80a5[_0xbfdd('0x2f')][_0xbfdd('0x31')]?_0x1b80a5[_0xbfdd('0x2f')]:_0x78292a[_0xbfdd('0x2c')];if(_0x4031da[_0xbfdd('0x27')]['includeAll']){_0x1b80a5[_0xbfdd('0x32')]=[{'all':!![]}];}_0x1b80a5=_[_0xbfdd('0x33')]({},_0x1b80a5,_0x4031da['options']);return db[_0xbfdd('0x20')][_0xbfdd('0x34')](_0x1b80a5)[_0xbfdd('0x19')](handleEntityNotFound(_0x2e7883,null))[_0xbfdd('0x19')](respondWithResult(_0x2e7883,null))[_0xbfdd('0x29')](handleError(_0x2e7883,null));};exports[_0xbfdd('0x35')]=function(_0x89269e,_0xc9cc1f){return db[_0xbfdd('0x20')][_0xbfdd('0x35')](_0x89269e[_0xbfdd('0x36')],{})[_0xbfdd('0x19')](respondWithResult(_0xc9cc1f,0xc9))[_0xbfdd('0x29')](handleError(_0xc9cc1f,null));};exports[_0xbfdd('0x18')]=function(_0x38b138,_0x496e5f){if(_0x38b138[_0xbfdd('0x36')]['id']){delete _0x38b138[_0xbfdd('0x36')]['id'];}return db[_0xbfdd('0x20')][_0xbfdd('0x34')]({'where':{'id':_0x38b138[_0xbfdd('0x2b')]['id']}})[_0xbfdd('0x19')](handleEntityNotFound(_0x496e5f,null))[_0xbfdd('0x19')](saveUpdates(_0x38b138['body'],null))[_0xbfdd('0x19')](respondWithResult(_0x496e5f,null))[_0xbfdd('0x29')](handleError(_0x496e5f,null));};exports['destroy']=function(_0x3bbfbc,_0x32d60e){return db[_0xbfdd('0x20')]['find']({'where':{'id':_0x3bbfbc['params']['id']}})[_0xbfdd('0x19')](handleEntityNotFound(_0x32d60e,null))[_0xbfdd('0x19')](removeEntity(_0x32d60e,null))[_0xbfdd('0x29')](handleError(_0x32d60e,null));};exports[_0xbfdd('0x37')]=function(_0x5bd991,_0x43d312){return db['OpenchannelInteraction'][_0xbfdd('0x37')]()[_0xbfdd('0x19')](respondWithResult(_0x43d312,null))[_0xbfdd('0x29')](handleError(_0x43d312,null));};exports[_0xbfdd('0x38')]=function(_0x3a9e63,_0x6a5e3a){return db[_0xbfdd('0x39')][_0xbfdd('0x34')]({'where':{'id':_0x3a9e63['params']['id']}})[_0xbfdd('0x19')](handleEntityNotFound(_0x6a5e3a,null))[_0xbfdd('0x19')](function(_0x2101d9){if(_0x2101d9){return _0x2101d9[_0xbfdd('0x38')](_0x3a9e63[_0xbfdd('0x36')][_0xbfdd('0x3a')],_[_0xbfdd('0x3b')](_0x3a9e63[_0xbfdd('0x36')],[_0xbfdd('0x3a'),'id'])||{});}})[_0xbfdd('0x19')](respondWithResult(_0x6a5e3a,null))[_0xbfdd('0x29')](handleError(_0x6a5e3a,null));};exports[_0xbfdd('0x3c')]=function(_0x362c21,_0x3afbce){var _0x11a299={'raw':![],'where':{}};var _0x2b2107={};var _0x40fe08={'count':0x0,'rows':[]};return db[_0xbfdd('0x20')]['findOne']({'where':{'id':_0x362c21[_0xbfdd('0x2b')]['id']}})[_0xbfdd('0x19')](handleEntityNotFound(_0x3afbce,null))[_0xbfdd('0x19')](function(_0x43e232){if(_0x43e232){_0x2b2107[_0xbfdd('0x2c')]=_[_0xbfdd('0x2d')](db[_0xbfdd('0x39')]['rawAttributes']);_0x2b2107[_0xbfdd('0x27')]=_[_0xbfdd('0x2d')](_0x362c21[_0xbfdd('0x27')]);_0x2b2107[_0xbfdd('0x3d')]=_[_0xbfdd('0x2e')](_0x2b2107[_0xbfdd('0x2c')],_0x2b2107['query']);_0x11a299['attributes']=_[_0xbfdd('0x2e')](_0x2b2107[_0xbfdd('0x2c')],qs[_0xbfdd('0x30')](_0x362c21[_0xbfdd('0x27')][_0xbfdd('0x30')]));_0x11a299[_0xbfdd('0x2f')]=_0x11a299['attributes'][_0xbfdd('0x31')]?_0x11a299[_0xbfdd('0x2f')]:_0x2b2107[_0xbfdd('0x2c')];if(!_0x362c21['query'][_0xbfdd('0x3e')](_0xbfdd('0x3f'))){_0x11a299[_0xbfdd('0x14')]=qs[_0xbfdd('0x14')](_0x362c21[_0xbfdd('0x27')]['limit']);_0x11a299[_0xbfdd('0x13')]=qs[_0xbfdd('0x13')](_0x362c21[_0xbfdd('0x27')][_0xbfdd('0x13')]);}_0x11a299['order']=qs['sort'](_0x362c21[_0xbfdd('0x27')][_0xbfdd('0x40')]);_0x11a299[_0xbfdd('0x41')]=qs[_0xbfdd('0x3d')](_['pick'](_0x362c21[_0xbfdd('0x27')],_0x2b2107[_0xbfdd('0x3d')]));_0x11a299[_0xbfdd('0x41')][_0xbfdd('0x42')]=_0x43e232['id'];if(_0x362c21['query'][_0xbfdd('0x43')]){_0x11a299['where']=_[_0xbfdd('0x33')](_0x11a299['where'],{'$or':_[_0xbfdd('0x1f')](_0x11a299[_0xbfdd('0x2f')],function(_0x2df5ae){var _0xbb5eeb={};_0xbb5eeb[_0x2df5ae]={'$like':'%'+_0x362c21[_0xbfdd('0x27')][_0xbfdd('0x43')]+'%'};return _0xbb5eeb;})});}if(_0x362c21[_0xbfdd('0x27')][_0xbfdd('0x44')]){var _0x59aad2=_0x362c21[_0xbfdd('0x27')][_0xbfdd('0x44')]['split'](',');var _0x4aef7c={};_0x4aef7c[_0x59aad2[0x0]]={'$gte':moment(_0x59aad2[0x1])['format'](_0xbfdd('0x45'))};_0x11a299['where']=_[_0xbfdd('0x33')](_0x11a299[_0xbfdd('0x41')],_0x4aef7c);}_0x11a299=_[_0xbfdd('0x33')]({},_0x11a299,_0x362c21['options']);return db[_0xbfdd('0x39')][_0xbfdd('0x15')]({'where':_0x11a299[_0xbfdd('0x41')]})['then'](function(_0x552d91){_0x40fe08[_0xbfdd('0x15')]=_0x552d91;if(_0x362c21[_0xbfdd('0x27')][_0xbfdd('0x46')]){_0x11a299[_0xbfdd('0x32')]=[{'all':!![]}];}return db[_0xbfdd('0x39')][_0xbfdd('0x25')](_0x11a299);})[_0xbfdd('0x19')](function(_0x2067bb){_0x40fe08[_0xbfdd('0x47')]=_0x2067bb;return _0x40fe08;});}})[_0xbfdd('0x19')](respondWithFilteredResult(_0x3afbce,_0x11a299))[_0xbfdd('0x29')](handleError(_0x3afbce,null));};exports[_0xbfdd('0x48')]=function(_0x4fa79c,_0x3a74c4){return db[_0xbfdd('0x20')]['find']({'where':{'id':_0x4fa79c[_0xbfdd('0x2b')]['id']}})[_0xbfdd('0x19')](handleEntityNotFound(_0x3a74c4,null))[_0xbfdd('0x19')](function(_0x1517a4){if(_0x1517a4){return _0x1517a4[_0xbfdd('0x49')](_0x4fa79c['body'][_0xbfdd('0x3a')],_[_0xbfdd('0x3b')](_0x4fa79c[_0xbfdd('0x36')],['ids','id'])||{})[_0xbfdd('0x4a')](function(){return db[_0xbfdd('0x4b')]['findAll']({'attributes':['id','name',_0xbfdd('0x4c')],'where':{'id':_0x4fa79c[_0xbfdd('0x36')]['ids']}});})[_0xbfdd('0x19')](function(_0xb36fc4){socket['emit']('openchannelInteractionTags:save',{'id':Number(_0x4fa79c[_0xbfdd('0x2b')]['id']),'tags':_0xb36fc4||[]});return{'id':Number(_0x4fa79c[_0xbfdd('0x2b')]['id']),'tags':_0xb36fc4||[]};});}})[_0xbfdd('0x19')](respondWithResult(_0x3a74c4,null))['catch'](handleError(_0x3a74c4,null));};exports[_0xbfdd('0x4d')]=function(_0x28cc64,_0x152f20){return db[_0xbfdd('0x20')][_0xbfdd('0x34')]({'where':{'id':_0x28cc64[_0xbfdd('0x2b')]['id']}})['then'](handleEntityNotFound(_0x152f20,null))['then'](function(_0x1bf823){if(_0x1bf823){return _0x1bf823['removeTags'](_0x28cc64[_0xbfdd('0x27')][_0xbfdd('0x3a')]);}})['then'](respondWithStatusCode(_0x152f20,null))['catch'](handleError(_0x152f20,null));};exports['download']=function(_0x3a46d4,_0x2da2dd){var _0x59c981=moment()['unix']()[_0xbfdd('0x4e')]();var _0x335c3b=path[_0xbfdd('0x4f')](config[_0xbfdd('0x50')],_0xbfdd('0x51'),_0xbfdd('0x52'),_0xbfdd('0x53'));var _0x155025=path[_0xbfdd('0x4f')](config['root'],_0xbfdd('0x51'),_0xbfdd('0x52'),_0xbfdd('0x54'));var _0x3e847c=path[_0xbfdd('0x4f')](_0x335c3b,_0x59c981);var _0x1e3954=util[_0xbfdd('0x55')](_0xbfdd('0x56'),_0x3a46d4[_0xbfdd('0x2b')]['id'],_0x59c981);var _0x51f5a5=path[_0xbfdd('0x4f')](_0x335c3b,_0x1e3954);var _0x2e607d=[];_0x2e607d['push']({'model':db['User'],'as':_0xbfdd('0x57'),'attributes':['id','fullname'],'raw':!![]});_0x2e607d[_0xbfdd('0x58')]({'model':db['CmContact'],'as':_0xbfdd('0x59'),'attributes':['id',_0xbfdd('0x5a'),_0xbfdd('0x5b')],'raw':!![]});if(_0x3a46d4[_0xbfdd('0x27')][_0xbfdd('0x54')]){_0x2e607d[_0xbfdd('0x58')]({'model':db['Attachment'],'as':_0xbfdd('0x5c'),'raw':!![]});}var _0xdfc5db=[{'model':db[_0xbfdd('0x39')],'as':_0xbfdd('0x5d'),'attributes':['id',_0xbfdd('0x36'),_0xbfdd('0x5e'),_0xbfdd('0x5f'),_0xbfdd('0x60'),_0xbfdd('0x61')],'include':_0x2e607d}];_0xdfc5db[_0xbfdd('0x58')]({'model':db[_0xbfdd('0x62')],'as':_0xbfdd('0x63'),'attributes':['id',_0xbfdd('0x1d')]});_0xdfc5db[_0xbfdd('0x58')]({'model':db[_0xbfdd('0x57')],'as':'Owner','attributes':['id',_0xbfdd('0x64')]});return db[_0xbfdd('0x20')]['find']({'where':{'id':_0x3a46d4[_0xbfdd('0x2b')]['id']},'include':_0xdfc5db})['then'](handleEntityNotFound(_0x2da2dd,null))[_0xbfdd('0x19')](function(_0x147170){if(_0x147170){var _0x3a4c44=_0x147170[_0xbfdd('0x65')]({'plain':!![]});fs[_0xbfdd('0x66')](_0x3e847c);var _0x19fb71={'channel':_0xbfdd('0x67'),'account':_0x3a4c44[_0xbfdd('0x63')][_0xbfdd('0x1d')],'agent':_0x3a4c44[_0xbfdd('0x68')]?_0x3a4c44[_0xbfdd('0x68')][_0xbfdd('0x64')]:_0xbfdd('0x69'),'createdAt':moment(_0x3a4c44[_0xbfdd('0x5e')])['format'](_0xbfdd('0x45'))[_0xbfdd('0x4e')](),'closedAt':_0x3a4c44[_0xbfdd('0x6a')]?moment(_0x3a4c44[_0xbfdd('0x6b')])[_0xbfdd('0x55')](_0xbfdd('0x45'))['toString']():'','disposition':_0x3a4c44[_0xbfdd('0x6c')],'visibility':_0x3a4c44[_0xbfdd('0x6d')]?_0xbfdd('0x6e'):_0xbfdd('0x6f'),'messages':_(_0x3a4c44['Messages'])['filter']({'secret':![]})[_0xbfdd('0x1f')](function(_0x486650){if(_0x486650['Attachment']){var _0x26f2f8=path['join'](_0x155025,_0x486650[_0xbfdd('0x5c')][_0xbfdd('0x70')]);if(fs[_0xbfdd('0x71')](_0x26f2f8)){fs['createReadStream'](_0x26f2f8)[_0xbfdd('0x72')](fs[_0xbfdd('0x73')](path[_0xbfdd('0x4f')](_0x3e847c,_0x486650[_0xbfdd('0x5c')]['basename'])));}}return{'date':moment(_0x486650[_0xbfdd('0x5e')])[_0xbfdd('0x55')](_0xbfdd('0x45'))[_0xbfdd('0x4e')](),'sender':_0x486650[_0xbfdd('0x5f')]===_0xbfdd('0x74')?_0x486650[_0xbfdd('0x57')]?_0x486650['User']['fullname']:_0xbfdd('0x75'):_0x486650[_0xbfdd('0x59')][_0xbfdd('0x5a')]+(_0x486650['Contact'][_0xbfdd('0x5b')]?'\x20'+_0x486650[_0xbfdd('0x59')][_0xbfdd('0x5b')]:''),'body':_0x486650[_0xbfdd('0x5c')]?_0x486650[_0xbfdd('0x5c')]['basename']:_0x486650[_0xbfdd('0x36')],'direction':_0x486650[_0xbfdd('0x5f')]===_0xbfdd('0x74')?'A':'C','secret':_0x486650[_0xbfdd('0x60')],'read':_0x486650['read'],'attachment':_0x486650[_0xbfdd('0x5c')]};})[_0xbfdd('0x76')]()};return ejs[_0xbfdd('0x77')](path[_0xbfdd('0x4f')](config[_0xbfdd('0x50')],_0xbfdd('0x51'),'views',_0xbfdd('0x78')),{'interaction':_0x19fb71})['then'](function(_0x23ba8b){var _0x9985c0=path['join'](_0x3e847c,_0xbfdd('0x79')+_0x3a4c44['id']+'-'+_0x59c981+_0xbfdd('0x7a'));var _0x18c51e={'path':_0x9985c0,'channel':_0xbfdd('0x67'),'interactionId':_0x3a4c44['id']};return pdf[_0xbfdd('0x7b')](_0x23ba8b,_0x18c51e);})[_0xbfdd('0x19')](function(){return new Promise(function(_0x43792d,_0x260d72){zipdir(_0x3e847c,{'saveTo':_0x51f5a5},function(_0x168a52,_0x534a52){if(_0x168a52)return _0x260d72(_0x168a52);return _0x43792d(_0x534a52);});})[_0xbfdd('0x19')](function(){return new Promise(function(_0x48a77f,_0x1ee73f){rimraf(_0x3e847c,function(_0x2ac2ef){if(_0x2ac2ef)_0x1ee73f(_0x2ac2ef);return _0x48a77f();});});})[_0xbfdd('0x19')](function(){return _0x2da2dd[_0xbfdd('0x7c')](_0x51f5a5,_0x1e3954,function(_0x28cd83){if(_0x28cd83){logger[_0xbfdd('0x1c')]('Unable\x20to\x20delete\x20zip\x20file',_0x28cd83);}else{fs[_0xbfdd('0x7d')](_0x51f5a5);}});});});}else{return _0x2da2dd[_0xbfdd('0x7e')](0xc8);}})[_0xbfdd('0x29')](handleError(_0x2da2dd,null));}; \ No newline at end of file +var _0x21e0=['getOptions','openchannel','query','user','then','catch','from','params','model','keys','filters','intersection','fields','attributes','includeAll','merge','options','create','body','find','destroy','describe','addMessage','OpenchannelMessage','omit','ids','getMessages','findOne','length','nolimit','order','sort','where','pick','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','rows','setTags','spread','Tag','color','emit','openchannelInteractionTags:save','removeTags','unix','toString','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','push','User','fullname','Contact','Attachment','Messages','createdAt','direction','secret','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','N.A.','closed','disposition','Public','Private','basename','pipe','createWriteStream','System','firstName','lastName','out','value','views','downloadInteraction.ejs','.pdf','download','unlinkSync','zip-dir','moment','path','ejs','../../components/interaction/service','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','undefined','limit','count','offset','update','name','send','map','OpenchannelInteraction','rawAttributes','fieldName','type'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0x21e0,0x14b));var _0x021e=function(_0x122004,_0x3a7c5c){_0x122004=_0x122004-0x0;var _0x40eed0=_0x21e0[_0x122004];return _0x40eed0;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x021e('0x0'));var moment=require(_0x021e('0x1'));var util=require('util');var path=require(_0x021e('0x2'));var ejs=require(_0x021e('0x3'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0x021e('0x4'));var qs=require('../../components/parsers/qs');var pdf=require('../../components/export/pdf');var logger=require(_0x021e('0x5'))(_0x021e('0x6'));var config=require('../../config/environment');var db=require(_0x021e('0x7'))['db'];config[_0x021e('0x8')]=_[_0x021e('0x9')](config[_0x021e('0x8')],{'host':_0x021e('0xa'),'port':0x18eb});var socket=require(_0x021e('0xb'))(new Redis(config[_0x021e('0x8')]));require('./openchannelInteraction.socket')[_0x021e('0xc')](socket);function respondWithStatusCode(_0x2029d8,_0x2c7418){_0x2c7418=_0x2c7418||0xcc;return function(_0x3d4f70){if(_0x3d4f70){return _0x2029d8[_0x021e('0xd')](_0x2c7418);}return _0x2029d8['status'](_0x2c7418)[_0x021e('0xe')]();};}function respondWithResult(_0x55e817,_0x51638c){_0x51638c=_0x51638c||0xc8;return function(_0x4ba984){if(_0x4ba984){return _0x55e817[_0x021e('0xf')](_0x51638c)[_0x021e('0x10')](_0x4ba984);}};}function respondWithFilteredResult(_0x4a02e9,_0xce9fe7){return function(_0x44fcf4){if(_0x44fcf4){var _0x3c44ea=typeof _0xce9fe7['offset']===_0x021e('0x11')&&typeof _0xce9fe7[_0x021e('0x12')]===_0x021e('0x11');var _0x224eb9=_0x44fcf4[_0x021e('0x13')];var _0x2e2ef0=_0x3c44ea?0x0:_0xce9fe7['offset'];var _0x238ad8=_0x3c44ea?_0x44fcf4[_0x021e('0x13')]:_0xce9fe7[_0x021e('0x14')]+_0xce9fe7[_0x021e('0x12')];var _0x17aef4;if(_0x238ad8>=_0x224eb9){_0x238ad8=_0x224eb9;_0x17aef4=0xc8;}else{_0x17aef4=0xce;}_0x4a02e9['status'](_0x17aef4);return _0x4a02e9['set']('Content-Range',_0x2e2ef0+'-'+_0x238ad8+'/'+_0x224eb9)[_0x021e('0x10')](_0x44fcf4);}return null;};}function saveUpdates(_0x54fdc8){return function(_0x462f08){if(_0x462f08){return _0x462f08[_0x021e('0x15')](_0x54fdc8)['then'](function(_0x597a58){return _0x597a58;});}return null;};}function removeEntity(_0x37f88f){return function(_0x547e50){if(_0x547e50){return _0x547e50['destroy']()['then'](function(){_0x37f88f[_0x021e('0xf')](0xcc)[_0x021e('0xe')]();});}};}function handleEntityNotFound(_0x55a33a){return function(_0x628349){if(!_0x628349){_0x55a33a['sendStatus'](0x194);}return _0x628349;};}function handleError(_0x4e7f04,_0x2086a2){_0x2086a2=_0x2086a2||0x1f4;return function(_0x508996){logger['error'](_0x508996['stack']);if(_0x508996[_0x021e('0x16')]){delete _0x508996[_0x021e('0x16')];}_0x4e7f04[_0x021e('0xf')](_0x2086a2)[_0x021e('0x17')](_0x508996);};}exports['index']=function(_0x20ef11,_0x45a484){var _0x553cd5={};var _0x3e06ad=_[_0x021e('0x18')](db[_0x021e('0x19')][_0x021e('0x1a')],function(_0x271e87){return{'name':_0x271e87[_0x021e('0x1b')],'type':_0x271e87[_0x021e('0x1c')]['key']};});_0x553cd5=qs[_0x021e('0x1d')](_0x3e06ad,_0x20ef11);return interaction['findAll'](_0x021e('0x1e'),_0x20ef11[_0x021e('0x1f')],_0x20ef11[_0x021e('0x20')],_0x553cd5,_0x3e06ad)[_0x021e('0x21')](respondWithFilteredResult(_0x45a484,_0x553cd5))[_0x021e('0x22')](handleError(_0x45a484,null));};exports['show']=function(_0x39bd06,_0x3e9b7d){var _0x440fc3={};if(_0x39bd06['query']['type']&&_0x39bd06[_0x021e('0x1f')][_0x021e('0x1c')]===_0x021e('0x23')){_0x440fc3['from']=_0x39bd06[_0x021e('0x24')]['id'];}else{_0x440fc3['id']=_0x39bd06['params']['id'];}var _0x544dbd={'raw':![],'where':_0x440fc3},_0x23010f={};_0x23010f[_0x021e('0x25')]=_[_0x021e('0x26')](db['OpenchannelInteraction']['rawAttributes']);_0x23010f['query']=_[_0x021e('0x26')](_0x39bd06[_0x021e('0x1f')]);_0x23010f[_0x021e('0x27')]=_['intersection'](_0x23010f[_0x021e('0x25')],_0x23010f[_0x021e('0x1f')]);_0x544dbd['attributes']=_[_0x021e('0x28')](_0x23010f[_0x021e('0x25')],qs[_0x021e('0x29')](_0x39bd06[_0x021e('0x1f')]['fields']));_0x544dbd[_0x021e('0x2a')]=_0x544dbd[_0x021e('0x2a')]['length']?_0x544dbd[_0x021e('0x2a')]:_0x23010f['model'];if(_0x39bd06[_0x021e('0x1f')][_0x021e('0x2b')]){_0x544dbd['include']=[{'all':!![]}];}_0x544dbd=_[_0x021e('0x2c')]({},_0x544dbd,_0x39bd06[_0x021e('0x2d')]);return db[_0x021e('0x19')]['find'](_0x544dbd)[_0x021e('0x21')](handleEntityNotFound(_0x3e9b7d,null))[_0x021e('0x21')](respondWithResult(_0x3e9b7d,null))[_0x021e('0x22')](handleError(_0x3e9b7d,null));};exports[_0x021e('0x2e')]=function(_0x456c82,_0x16df28){return db[_0x021e('0x19')]['create'](_0x456c82[_0x021e('0x2f')],{})[_0x021e('0x21')](respondWithResult(_0x16df28,0xc9))[_0x021e('0x22')](handleError(_0x16df28,null));};exports[_0x021e('0x15')]=function(_0x28c272,_0x61fbc){if(_0x28c272[_0x021e('0x2f')]['id']){delete _0x28c272[_0x021e('0x2f')]['id'];}return db[_0x021e('0x19')][_0x021e('0x30')]({'where':{'id':_0x28c272[_0x021e('0x24')]['id']}})['then'](handleEntityNotFound(_0x61fbc,null))[_0x021e('0x21')](saveUpdates(_0x28c272[_0x021e('0x2f')],null))[_0x021e('0x21')](respondWithResult(_0x61fbc,null))[_0x021e('0x22')](handleError(_0x61fbc,null));};exports[_0x021e('0x31')]=function(_0x2ef93e,_0x5d43ad){return db[_0x021e('0x19')]['find']({'where':{'id':_0x2ef93e[_0x021e('0x24')]['id']}})[_0x021e('0x21')](handleEntityNotFound(_0x5d43ad,null))['then'](removeEntity(_0x5d43ad,null))[_0x021e('0x22')](handleError(_0x5d43ad,null));};exports[_0x021e('0x32')]=function(_0x428bc9,_0x1b6594){return db[_0x021e('0x19')][_0x021e('0x32')]()[_0x021e('0x21')](respondWithResult(_0x1b6594,null))[_0x021e('0x22')](handleError(_0x1b6594,null));};exports[_0x021e('0x33')]=function(_0x2fb929,_0x7093c6){return db[_0x021e('0x34')][_0x021e('0x30')]({'where':{'id':_0x2fb929['params']['id']}})[_0x021e('0x21')](handleEntityNotFound(_0x7093c6,null))[_0x021e('0x21')](function(_0x17600b){if(_0x17600b){return _0x17600b[_0x021e('0x33')](_0x2fb929['body']['ids'],_[_0x021e('0x35')](_0x2fb929[_0x021e('0x2f')],[_0x021e('0x36'),'id'])||{});}})[_0x021e('0x21')](respondWithResult(_0x7093c6,null))[_0x021e('0x22')](handleError(_0x7093c6,null));};exports[_0x021e('0x37')]=function(_0x6697f3,_0x57b060){var _0x46bfa4={'raw':![],'where':{}};var _0x2191a8={};var _0xb73eb6={'count':0x0,'rows':[]};return db[_0x021e('0x19')][_0x021e('0x38')]({'where':{'id':_0x6697f3[_0x021e('0x24')]['id']}})['then'](handleEntityNotFound(_0x57b060,null))['then'](function(_0x2f3521){if(_0x2f3521){_0x2191a8[_0x021e('0x25')]=_['keys'](db[_0x021e('0x34')][_0x021e('0x1a')]);_0x2191a8[_0x021e('0x1f')]=_[_0x021e('0x26')](_0x6697f3['query']);_0x2191a8[_0x021e('0x27')]=_['intersection'](_0x2191a8['model'],_0x2191a8[_0x021e('0x1f')]);_0x46bfa4['attributes']=_[_0x021e('0x28')](_0x2191a8[_0x021e('0x25')],qs[_0x021e('0x29')](_0x6697f3[_0x021e('0x1f')][_0x021e('0x29')]));_0x46bfa4[_0x021e('0x2a')]=_0x46bfa4[_0x021e('0x2a')][_0x021e('0x39')]?_0x46bfa4[_0x021e('0x2a')]:_0x2191a8['model'];if(!_0x6697f3[_0x021e('0x1f')]['hasOwnProperty'](_0x021e('0x3a'))){_0x46bfa4[_0x021e('0x12')]=qs[_0x021e('0x12')](_0x6697f3[_0x021e('0x1f')][_0x021e('0x12')]);_0x46bfa4[_0x021e('0x14')]=qs['offset'](_0x6697f3[_0x021e('0x1f')][_0x021e('0x14')]);}_0x46bfa4[_0x021e('0x3b')]=qs[_0x021e('0x3c')](_0x6697f3[_0x021e('0x1f')]['sort']);_0x46bfa4[_0x021e('0x3d')]=qs[_0x021e('0x27')](_[_0x021e('0x3e')](_0x6697f3[_0x021e('0x1f')],_0x2191a8[_0x021e('0x27')]));_0x46bfa4[_0x021e('0x3d')]['OpenchannelInteractionId']=_0x2f3521['id'];if(_0x6697f3['query'][_0x021e('0x3f')]){_0x46bfa4[_0x021e('0x3d')]=_[_0x021e('0x2c')](_0x46bfa4['where'],{'$or':_['map'](_0x46bfa4[_0x021e('0x2a')],function(_0x4111bd){var _0x434a55={};_0x434a55[_0x4111bd]={'$like':'%'+_0x6697f3[_0x021e('0x1f')][_0x021e('0x3f')]+'%'};return _0x434a55;})});}if(_0x6697f3['query'][_0x021e('0x40')]){var _0x5cdbf2=_0x6697f3[_0x021e('0x1f')][_0x021e('0x40')][_0x021e('0x41')](',');var _0x2f8c2f={};_0x2f8c2f[_0x5cdbf2[0x0]]={'$gte':moment(_0x5cdbf2[0x1])[_0x021e('0x42')](_0x021e('0x43'))};_0x46bfa4['where']=_[_0x021e('0x2c')](_0x46bfa4['where'],_0x2f8c2f);}_0x46bfa4=_[_0x021e('0x2c')]({},_0x46bfa4,_0x6697f3[_0x021e('0x2d')]);return db['OpenchannelMessage']['count']({'where':_0x46bfa4[_0x021e('0x3d')]})[_0x021e('0x21')](function(_0x35e551){_0xb73eb6[_0x021e('0x13')]=_0x35e551;if(_0x6697f3['query'][_0x021e('0x2b')]){_0x46bfa4[_0x021e('0x44')]=[{'all':!![]}];}return db[_0x021e('0x34')][_0x021e('0x45')](_0x46bfa4);})[_0x021e('0x21')](function(_0x118024){_0xb73eb6[_0x021e('0x46')]=_0x118024;return _0xb73eb6;});}})[_0x021e('0x21')](respondWithFilteredResult(_0x57b060,_0x46bfa4))[_0x021e('0x22')](handleError(_0x57b060,null));};exports['addTags']=function(_0x43dae1,_0x34e4ec){return db[_0x021e('0x19')][_0x021e('0x30')]({'where':{'id':_0x43dae1[_0x021e('0x24')]['id']}})[_0x021e('0x21')](handleEntityNotFound(_0x34e4ec,null))[_0x021e('0x21')](function(_0x2bf19d){if(_0x2bf19d){return _0x2bf19d[_0x021e('0x47')](_0x43dae1[_0x021e('0x2f')][_0x021e('0x36')],_[_0x021e('0x35')](_0x43dae1[_0x021e('0x2f')],['ids','id'])||{})[_0x021e('0x48')](function(){return db[_0x021e('0x49')][_0x021e('0x45')]({'attributes':['id','name',_0x021e('0x4a')],'where':{'id':_0x43dae1[_0x021e('0x2f')][_0x021e('0x36')]}});})['then'](function(_0x4e271c){socket[_0x021e('0x4b')](_0x021e('0x4c'),{'id':Number(_0x43dae1[_0x021e('0x24')]['id']),'tags':_0x4e271c||[]});return{'id':Number(_0x43dae1['params']['id']),'tags':_0x4e271c||[]};});}})[_0x021e('0x21')](respondWithResult(_0x34e4ec,null))[_0x021e('0x22')](handleError(_0x34e4ec,null));};exports[_0x021e('0x4d')]=function(_0x5c76c3,_0x5900ab){return db[_0x021e('0x19')][_0x021e('0x30')]({'where':{'id':_0x5c76c3[_0x021e('0x24')]['id']}})[_0x021e('0x21')](handleEntityNotFound(_0x5900ab,null))[_0x021e('0x21')](function(_0x402438){if(_0x402438){return _0x402438[_0x021e('0x4d')](_0x5c76c3[_0x021e('0x1f')][_0x021e('0x36')]);}})[_0x021e('0x21')](respondWithStatusCode(_0x5900ab,null))[_0x021e('0x22')](handleError(_0x5900ab,null));};exports['download']=function(_0x57bf55,_0x313f91){var _0x2dd082=moment()[_0x021e('0x4e')]()[_0x021e('0x4f')]();var _0x3a5f54=path['join'](config[_0x021e('0x50')],_0x021e('0x51'),_0x021e('0x52'),_0x021e('0x53'));var _0x1dca66=path[_0x021e('0x54')](config[_0x021e('0x50')],'server','files',_0x021e('0x55'));var _0xc7da35=path[_0x021e('0x54')](_0x3a5f54,_0x2dd082);var _0x198159=util[_0x021e('0x42')](_0x021e('0x56'),_0x57bf55[_0x021e('0x24')]['id'],_0x2dd082);var _0x596eca=path[_0x021e('0x54')](_0x3a5f54,_0x198159);var _0x2f173c=[];_0x2f173c[_0x021e('0x57')]({'model':db[_0x021e('0x58')],'as':_0x021e('0x58'),'attributes':['id',_0x021e('0x59')],'raw':!![]});_0x2f173c[_0x021e('0x57')]({'model':db['CmContact'],'as':_0x021e('0x5a'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0x57bf55[_0x021e('0x1f')][_0x021e('0x55')]){_0x2f173c[_0x021e('0x57')]({'model':db[_0x021e('0x5b')],'as':_0x021e('0x5b'),'raw':!![]});}var _0x2bcb37=[{'model':db[_0x021e('0x34')],'as':_0x021e('0x5c'),'attributes':['id',_0x021e('0x2f'),_0x021e('0x5d'),_0x021e('0x5e'),_0x021e('0x5f'),'read'],'include':_0x2f173c}];_0x2bcb37[_0x021e('0x57')]({'model':db[_0x021e('0x60')],'as':_0x021e('0x61'),'attributes':['id',_0x021e('0x16')]});_0x2bcb37['push']({'model':db[_0x021e('0x58')],'as':_0x021e('0x62'),'attributes':['id',_0x021e('0x59')]});return db[_0x021e('0x19')]['find']({'where':{'id':_0x57bf55[_0x021e('0x24')]['id']},'include':_0x2bcb37})['then'](handleEntityNotFound(_0x313f91,null))[_0x021e('0x21')](function(_0x48ce12){if(_0x48ce12){var _0x2306b3=_0x48ce12[_0x021e('0x63')]({'plain':!![]});fs[_0x021e('0x64')](_0xc7da35);var _0x15e161={'channel':_0x021e('0x65'),'account':_0x2306b3[_0x021e('0x61')][_0x021e('0x16')],'agent':_0x2306b3[_0x021e('0x62')]?_0x2306b3['Owner'][_0x021e('0x59')]:_0x021e('0x66'),'createdAt':moment(_0x2306b3[_0x021e('0x5d')])[_0x021e('0x42')](_0x021e('0x43'))[_0x021e('0x4f')](),'closedAt':_0x2306b3[_0x021e('0x67')]?moment(_0x2306b3['closedAt'])['format'](_0x021e('0x43'))[_0x021e('0x4f')]():'','disposition':_0x2306b3[_0x021e('0x68')],'visibility':_0x2306b3['threadId']?_0x021e('0x69'):_0x021e('0x6a'),'messages':_(_0x2306b3[_0x021e('0x5c')])['filter']({'secret':![]})['map'](function(_0x407bec){if(_0x407bec[_0x021e('0x5b')]){var _0xaa62b1=path[_0x021e('0x54')](_0x1dca66,_0x407bec[_0x021e('0x5b')][_0x021e('0x6b')]);if(fs['existsSync'](_0xaa62b1)){fs['createReadStream'](_0xaa62b1)[_0x021e('0x6c')](fs[_0x021e('0x6d')](path['join'](_0xc7da35,_0x407bec[_0x021e('0x5b')][_0x021e('0x6b')])));}}return{'date':moment(_0x407bec[_0x021e('0x5d')])[_0x021e('0x42')](_0x021e('0x43'))[_0x021e('0x4f')](),'sender':_0x407bec['direction']==='out'?_0x407bec[_0x021e('0x58')]?_0x407bec[_0x021e('0x58')][_0x021e('0x59')]:_0x021e('0x6e'):_0x407bec[_0x021e('0x5a')][_0x021e('0x6f')]+(_0x407bec['Contact'][_0x021e('0x70')]?'\x20'+_0x407bec['Contact'][_0x021e('0x70')]:''),'body':_0x407bec['Attachment']?_0x407bec[_0x021e('0x5b')]['basename']:_0x407bec[_0x021e('0x2f')],'direction':_0x407bec[_0x021e('0x5e')]===_0x021e('0x71')?'A':'C','secret':_0x407bec[_0x021e('0x5f')],'read':_0x407bec['read'],'attachment':_0x407bec[_0x021e('0x5b')]};})[_0x021e('0x72')]()};return ejs['renderFile'](path[_0x021e('0x54')](config[_0x021e('0x50')],_0x021e('0x51'),_0x021e('0x73'),_0x021e('0x74')),{'interaction':_0x15e161})[_0x021e('0x21')](function(_0x3328ee){var _0x3b1f99=path[_0x021e('0x54')](_0xc7da35,'transcript-'+_0x2306b3['id']+'-'+_0x2dd082+_0x021e('0x75'));var _0x472cc5={'path':_0x3b1f99,'channel':_0x021e('0x65'),'interactionId':_0x2306b3['id']};return pdf['createPdfFromHTML'](_0x3328ee,_0x472cc5);})[_0x021e('0x21')](function(){return new Promise(function(_0x52cf50,_0xc58e5d){zipdir(_0xc7da35,{'saveTo':_0x596eca},function(_0xaecb62,_0x448810){if(_0xaecb62)return _0xc58e5d(_0xaecb62);return _0x52cf50(_0x448810);});})[_0x021e('0x21')](function(){return new Promise(function(_0x3bd0a7,_0x4a274c){rimraf(_0xc7da35,function(_0x34f982){if(_0x34f982)_0x4a274c(_0x34f982);return _0x3bd0a7();});});})['then'](function(){return _0x313f91[_0x021e('0x76')](_0x596eca,_0x198159,function(_0x15b7b4){if(_0x15b7b4){logger['error']('Unable\x20to\x20delete\x20zip\x20file',_0x15b7b4);}else{fs[_0x021e('0x77')](_0x596eca);}});});});}else{return _0x313f91[_0x021e('0xd')](0xc8);}})[_0x021e('0x22')](handleError(_0x313f91,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index f705ef9..059582c 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.events.js +++ b/server/api/openchannelInteraction/openchannelInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5861=['OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hook'];(function(_0x59ae8f,_0x148344){var _0x3900b5=function(_0x63af51){while(--_0x63af51){_0x59ae8f['push'](_0x59ae8f['shift']());}};_0x3900b5(++_0x148344);}(_0x5861,0xff));var _0x1586=function(_0x45e620,_0x52c5d1){_0x45e620=_0x45e620-0x0;var _0x121055=_0x5861[_0x45e620];return _0x121055;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require('../../mysqldb')['db'][_0x1586('0x0')];var OpenchannelMessage=require('../../mysqldb')['db'][_0x1586('0x1')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x1586('0x2')](0x0);var events={'afterCreate':_0x1586('0x3'),'afterUpdate':_0x1586('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1ba0cc){return function(_0x798246,_0xdfa3e0,_0x1ca2a3){_0x798246[_0x1586('0x5')]({'attributes':['id'],'raw':!![]})[_0x1586('0x6')](function(_0x143dc){_0x798246[_0x1586('0x7')](_0x1586('0x8'),_0x143dc[_0x1586('0x9')](function(_0x2de2ba){return{'id':_0x2de2ba['id']};}));return OpenchannelMessage[_0x1586('0xa')]({'where':{'OpenchannelInteractionId':_0x798246['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1586('0x6')](function(_0x3c4301){_0x798246['setDataValue'](_0x1586('0xb'),_0x3c4301['length']);OpenchannelInteractionEvents[_0x1586('0xc')](_0x1ba0cc+':'+_0x798246['id'],_0x798246);OpenchannelInteractionEvents['emit'](_0x1ba0cc,_0x798246);_0x1ca2a3(null);})[_0x1586('0xd')](_0x1ca2a3(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x1586('0xe')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file +var _0x604b=['findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','setDataValue','map'];(function(_0x2a0f9c,_0x280f0e){var _0x49637e=function(_0x1ecc26){while(--_0x1ecc26){_0x2a0f9c['push'](_0x2a0f9c['shift']());}};_0x49637e(++_0x280f0e);}(_0x604b,0x149));var _0xb604=function(_0x516021,_0x265db0){_0x516021=_0x516021-0x0;var _0xcacbea=_0x604b[_0x516021];return _0xcacbea;};'use strict';var EventEmitter=require(_0xb604('0x0'));var OpenchannelInteraction=require(_0xb604('0x1'))['db'][_0xb604('0x2')];var OpenchannelMessage=require('../../mysqldb')['db'][_0xb604('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xb604('0x4')](0x0);var events={'afterCreate':_0xb604('0x5'),'afterUpdate':_0xb604('0x6'),'afterDestroy':_0xb604('0x7')};function emitEvent(_0x154e57){return function(_0x3860fe,_0x387dab,_0x19c890){_0x3860fe[_0xb604('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x157b19){_0x3860fe[_0xb604('0x9')]('Users',_0x157b19[_0xb604('0xa')](function(_0x5c558f){return{'id':_0x5c558f['id']};}));return OpenchannelMessage[_0xb604('0xb')]({'where':{'OpenchannelInteractionId':_0x3860fe['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb604('0xc')](function(_0x48a587){_0x3860fe[_0xb604('0x9')](_0xb604('0xd'),_0x48a587[_0xb604('0xe')]);OpenchannelInteractionEvents[_0xb604('0xf')](_0x154e57+':'+_0x3860fe['id'],_0x3860fe);OpenchannelInteractionEvents[_0xb604('0xf')](_0x154e57,_0x3860fe);_0x19c890(null);})[_0xb604('0x10')](_0x19c890(null));};}for(var e in events){if(events[_0xb604('0x11')](e)){var event=events[e];OpenchannelInteraction[_0xb604('0x12')](e,emitEvent(event));}}module[_0xb604('0x13')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 0ce086a..1e4e209 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.model.js +++ b/server/api/openchannelInteraction/openchannelInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfa03=['moment','bluebird','request-promise','path','../../config/environment','./openchannelInteraction.attributes','exports','define','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','format','lodash','util','../../config/logger','api'];(function(_0x16c8c3,_0x9dde1c){var _0x3cb87e=function(_0x260101){while(--_0x260101){_0x16c8c3['push'](_0x16c8c3['shift']());}};_0x3cb87e(++_0x9dde1c);}(_0xfa03,0xba));var _0x3fa0=function(_0x2e2b50,_0x5174bb){_0x2e2b50=_0x2e2b50-0x0;var _0x743e92=_0xfa03[_0x2e2b50];return _0x743e92;};'use strict';var _=require(_0x3fa0('0x0'));var util=require(_0x3fa0('0x1'));var logger=require(_0x3fa0('0x2'))(_0x3fa0('0x3'));var moment=require(_0x3fa0('0x4'));var BPromise=require(_0x3fa0('0x5'));var rp=require(_0x3fa0('0x6'));var fs=require('fs');var path=require(_0x3fa0('0x7'));var rimraf=require('rimraf');var config=require(_0x3fa0('0x8'));var attributes=require(_0x3fa0('0x9'));module[_0x3fa0('0xa')]=function(_0x14d11e,_0x3ade70){return _0x14d11e[_0x3fa0('0xb')]('OpenchannelInteraction',attributes,{'tableName':_0x3fa0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3fa0('0xd'),'collate':_0x3fa0('0xe'),'hooks':{'beforeUpdate':function(_0x57c0ad,_0xf31f1a,_0x3b7ff5){if(_0x57c0ad[_0x3fa0('0xf')](_0x3fa0('0x10'))){_0x57c0ad[_0x3fa0('0x11')]=moment()[_0x3fa0('0x12')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3b7ff5(null,_0x57c0ad);}}});}; \ No newline at end of file +var _0x5179=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','utf8mb4','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','api'];(function(_0x2962b4,_0x4b0786){var _0x411b7d=function(_0x363aad){while(--_0x363aad){_0x2962b4['push'](_0x2962b4['shift']());}};_0x411b7d(++_0x4b0786);}(_0x5179,0x87));var _0x9517=function(_0x138d06,_0x33edf2){_0x138d06=_0x138d06-0x0;var _0x1a01eb=_0x5179[_0x138d06];return _0x1a01eb;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x9517('0x0'));var moment=require(_0x9517('0x1'));var BPromise=require(_0x9517('0x2'));var rp=require(_0x9517('0x3'));var fs=require('fs');var path=require(_0x9517('0x4'));var rimraf=require(_0x9517('0x5'));var config=require(_0x9517('0x6'));var attributes=require(_0x9517('0x7'));module[_0x9517('0x8')]=function(_0x206f55,_0x33730e){return _0x206f55[_0x9517('0x9')](_0x9517('0xa'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9517('0xb'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x4178e1,_0x494061,_0x1b7cdb){if(_0x4178e1[_0x9517('0xc')](_0x9517('0xd'))){_0x4178e1[_0x9517('0xe')]=moment()[_0x9517('0xf')](_0x9517('0x10'));}_0x1b7cdb(null,_0x4178e1);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 8f71ba3..fd9b8fe 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.rpc.js +++ b/server/api/openchannelInteraction/openchannelInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0a4e=['stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','options','attributes','find','addTags','body','ids','spread','AddTags','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x4755e5,_0x52dfa1){var _0x3b8eaf=function(_0x113baa){while(--_0x113baa){_0x4755e5['push'](_0x4755e5['shift']());}};_0x3b8eaf(++_0x52dfa1);}(_0x0a4e,0x170));var _0xe0a4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0a4e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xe0a4('0x0'));var moment=require(_0xe0a4('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0a4('0x2'));var fs=require('fs');var Redis=require(_0xe0a4('0x3'));var db=require(_0xe0a4('0x4'))['db'];var utils=require(_0xe0a4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xe0a4('0x6'));var jayson=require(_0xe0a4('0x7'));var client=jayson[_0xe0a4('0x8')]['http']({'port':0x232a});config[_0xe0a4('0x9')]=_[_0xe0a4('0xa')](config[_0xe0a4('0x9')],{'host':_0xe0a4('0xb'),'port':0x18eb});var socket=require(_0xe0a4('0xc'))(new Redis(config[_0xe0a4('0x9')]));require(_0xe0a4('0xd'))[_0xe0a4('0xe')](socket);function respondWithRpcPromise(_0x392568,_0x43c708,_0x9d8f32){return new BPromise(function(_0xc60fd9,_0x300c6a){return client[_0xe0a4('0xf')](_0x392568,_0x9d8f32)[_0xe0a4('0x10')](function(_0xabdc9a){logger[_0xe0a4('0x11')](_0xe0a4('0x12'),_0x43c708,_0xe0a4('0x13'));logger[_0xe0a4('0x14')](_0xe0a4('0x15'),_0x43c708,_0xe0a4('0x13'),JSON[_0xe0a4('0x16')](_0xabdc9a));if(_0xabdc9a[_0xe0a4('0x17')]){if(_0xabdc9a[_0xe0a4('0x17')][_0xe0a4('0x18')]===0x1f4){logger[_0xe0a4('0x17')]('OpenchannelInteraction,\x20%s,\x20%s',_0x43c708,_0xabdc9a[_0xe0a4('0x17')][_0xe0a4('0x19')]);return _0x300c6a(_0xabdc9a[_0xe0a4('0x17')][_0xe0a4('0x19')]);}logger[_0xe0a4('0x17')](_0xe0a4('0x12'),_0x43c708,_0xabdc9a[_0xe0a4('0x17')][_0xe0a4('0x19')]);return _0xc60fd9(_0xabdc9a[_0xe0a4('0x17')]['message']);}else{logger[_0xe0a4('0x11')](_0xe0a4('0x12'),_0x43c708,_0xe0a4('0x13'));_0xc60fd9(_0xabdc9a[_0xe0a4('0x1a')][_0xe0a4('0x19')]);}})[_0xe0a4('0x1b')](function(_0x321d0c){logger[_0xe0a4('0x17')]('OpenchannelInteraction,\x20%s,\x20%s',_0x43c708,_0x321d0c);_0x300c6a(_0x321d0c);});});}exports[_0xe0a4('0x1c')]=function(_0x1893c1){var _0x278b62=this;return new Promise(function(_0x464b73,_0x5cc3b4){return db[_0xe0a4('0x1d')][_0xe0a4('0x1e')](_0x1893c1['body'],{'raw':_0x1893c1[_0xe0a4('0x1f')]?_0x1893c1[_0xe0a4('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1893c1['options']?_0x1893c1[_0xe0a4('0x1f')]['where']||null:null,'attributes':_0x1893c1[_0xe0a4('0x1f')]?_0x1893c1[_0xe0a4('0x1f')][_0xe0a4('0x20')]||null:null,'limit':_0x1893c1[_0xe0a4('0x1f')]?_0x1893c1['options']['limit']||null:null})['then'](function(_0x3d4f7e){logger[_0xe0a4('0x11')](_0xe0a4('0x1c'),_0x1893c1);logger[_0xe0a4('0x14')](_0xe0a4('0x1c'),_0x1893c1,JSON[_0xe0a4('0x16')](_0x3d4f7e));_0x464b73(_0x3d4f7e);})[_0xe0a4('0x1b')](function(_0x132237){logger[_0xe0a4('0x17')](_0xe0a4('0x1c'),_0x132237['message'],_0x1893c1);_0x5cc3b4(_0x278b62[_0xe0a4('0x17')](0x1f4,_0x132237[_0xe0a4('0x19')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x37ccec){return new Promise(function(_0x2737fd,_0x1e4f48){return db[_0xe0a4('0x1d')][_0xe0a4('0x21')]({'where':_0x37ccec[_0xe0a4('0x1f')]?_0x37ccec['options']['where']||null:null})[_0xe0a4('0x10')](function(_0x224ba6){if(_0x224ba6){return _0x224ba6[_0xe0a4('0x22')](_0x37ccec[_0xe0a4('0x23')]['ids'],_['omit'](_0x37ccec[_0xe0a4('0x23')],[_0xe0a4('0x24'),'id'])||{});}})[_0xe0a4('0x25')](function(_0x3d09ab){logger[_0xe0a4('0x11')]('AddTags',_0x37ccec);logger['debug'](_0xe0a4('0x26'),_0x37ccec,JSON['stringify'](_0x3d09ab));_0x2737fd(_0x3d09ab);})[_0xe0a4('0x1b')](function(_0x4e8400){logger[_0xe0a4('0x17')](_0xe0a4('0x26'),_0x4e8400[_0xe0a4('0x19')],_0x37ccec);_0x1e4f48(_this['error'](0x1f4,_0x4e8400[_0xe0a4('0x19')]));});});}; \ No newline at end of file +var _0x140c=['../../config/utils','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./openchannelInteraction.socket','register','request','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','attributes','then','stringify','catch','find','where','addTags','ids','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x46ef09,_0x13918f){var _0x2f5df3=function(_0x462539){while(--_0x462539){_0x46ef09['push'](_0x46ef09['shift']());}};_0x2f5df3(++_0x13918f);}(_0x140c,0xa2));var _0xc140=function(_0x52331b,_0x11c9a0){_0x52331b=_0x52331b-0x0;var _0x51f898=_0x140c[_0x52331b];return _0x51f898;};'use strict';var _=require(_0xc140('0x0'));var util=require(_0xc140('0x1'));var moment=require(_0xc140('0x2'));var BPromise=require('bluebird');var rs=require(_0xc140('0x3'));var fs=require('fs');var Redis=require(_0xc140('0x4'));var db=require(_0xc140('0x5'))['db'];var utils=require(_0xc140('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xc140('0x7'));var jayson=require(_0xc140('0x8'));var client=jayson[_0xc140('0x9')][_0xc140('0xa')]({'port':0x232a});config[_0xc140('0xb')]=_['defaults'](config[_0xc140('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xc140('0xc'))(new Redis(config[_0xc140('0xb')]));require(_0xc140('0xd'))[_0xc140('0xe')](socket);function respondWithRpcPromise(_0x1d72c,_0x21aa9e,_0x23bee4){return new BPromise(function(_0x2f95a2,_0x5795ca){return client[_0xc140('0xf')](_0x1d72c,_0x23bee4)['then'](function(_0x570b66){logger[_0xc140('0x10')](_0xc140('0x11'),_0x21aa9e,_0xc140('0x12'));logger[_0xc140('0x13')](_0xc140('0x14'),_0x21aa9e,_0xc140('0x12'),JSON['stringify'](_0x570b66));if(_0x570b66['error']){if(_0x570b66[_0xc140('0x15')][_0xc140('0x16')]===0x1f4){logger[_0xc140('0x15')](_0xc140('0x11'),_0x21aa9e,_0x570b66['error'][_0xc140('0x17')]);return _0x5795ca(_0x570b66[_0xc140('0x15')]['message']);}logger[_0xc140('0x15')](_0xc140('0x11'),_0x21aa9e,_0x570b66[_0xc140('0x15')][_0xc140('0x17')]);return _0x2f95a2(_0x570b66[_0xc140('0x15')]['message']);}else{logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x21aa9e,_0xc140('0x12'));_0x2f95a2(_0x570b66[_0xc140('0x18')][_0xc140('0x17')]);}})['catch'](function(_0xc4da06){logger[_0xc140('0x15')](_0xc140('0x11'),_0x21aa9e,_0xc4da06);_0x5795ca(_0xc4da06);});});}exports[_0xc140('0x19')]=function(_0x3244a9){var _0x37571c=this;return new Promise(function(_0x3f3ca4,_0x1893b7){return db[_0xc140('0x1a')][_0xc140('0x1b')](_0x3244a9[_0xc140('0x1c')],{'raw':_0x3244a9[_0xc140('0x1d')]?_0x3244a9['options'][_0xc140('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3244a9[_0xc140('0x1d')]?_0x3244a9['options']['where']||null:null,'attributes':_0x3244a9[_0xc140('0x1d')]?_0x3244a9[_0xc140('0x1d')][_0xc140('0x1f')]||null:null,'limit':_0x3244a9[_0xc140('0x1d')]?_0x3244a9[_0xc140('0x1d')]['limit']||null:null})[_0xc140('0x20')](function(_0x2919d3){logger[_0xc140('0x10')](_0xc140('0x19'),_0x3244a9);logger['debug'](_0xc140('0x19'),_0x3244a9,JSON[_0xc140('0x21')](_0x2919d3));_0x3f3ca4(_0x2919d3);})[_0xc140('0x22')](function(_0x767e92){logger['error']('UpdateOpenchannelInteraction',_0x767e92[_0xc140('0x17')],_0x3244a9);_0x1893b7(_0x37571c['error'](0x1f4,_0x767e92['message']));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x5d4fa3){return new Promise(function(_0x273e13,_0x35ad16){return db[_0xc140('0x1a')][_0xc140('0x23')]({'where':_0x5d4fa3[_0xc140('0x1d')]?_0x5d4fa3['options'][_0xc140('0x24')]||null:null})[_0xc140('0x20')](function(_0x2cfe56){if(_0x2cfe56){return _0x2cfe56[_0xc140('0x25')](_0x5d4fa3[_0xc140('0x1c')][_0xc140('0x26')],_[_0xc140('0x27')](_0x5d4fa3[_0xc140('0x1c')],['ids','id'])||{});}})[_0xc140('0x28')](function(_0x5d7007){logger[_0xc140('0x10')](_0xc140('0x29'),_0x5d4fa3);logger['debug'](_0xc140('0x29'),_0x5d4fa3,JSON[_0xc140('0x21')](_0x5d7007));_0x273e13(_0x5d7007);})[_0xc140('0x22')](function(_0x48765e){logger[_0xc140('0x15')](_0xc140('0x29'),_0x48765e[_0xc140('0x17')],_0x5d4fa3);_0x35ad16(_this[_0xc140('0x15')](0x1f4,_0x48765e[_0xc140('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index ef23746..8d4f0b0 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.socket.js +++ b/server/api/openchannelInteraction/openchannelInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5934=['emit','removeListener','length','openchannelInteraction:','save','remove','update'];(function(_0x4cc492,_0x162c85){var _0x1f36b9=function(_0xce4b2){while(--_0xce4b2){_0x4cc492['push'](_0x4cc492['shift']());}};_0x1f36b9(++_0x162c85);}(_0x5934,0x1bd));var _0x4593=function(_0x511af3,_0x74f082){_0x511af3=_0x511af3-0x0;var _0x32c868=_0x5934[_0x511af3];return _0x32c868;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x4593('0x0'),_0x4593('0x1'),_0x4593('0x2')];function createListener(_0xaf6830,_0x4f8c08){return function(_0x5031b8){_0x4f8c08[_0x4593('0x3')](_0xaf6830,_0x5031b8);};}function removeListener(_0x367507,_0x56d8f){return function(){OpenchannelInteractionEvents[_0x4593('0x4')](_0x367507,_0x56d8f);};}exports['register']=function(_0x48088c){for(var _0x1f56f6=0x0,_0x5ca056=events[_0x4593('0x5')];_0x1f56f6<_0x5ca056;_0x1f56f6++){var _0xf2df17=events[_0x1f56f6];var _0x556f39=createListener(_0x4593('0x6')+_0xf2df17,_0x48088c);OpenchannelInteractionEvents['on'](_0xf2df17,_0x556f39);}}; \ No newline at end of file +var _0x26ba=['openchannelInteraction:','./openchannelInteraction.events','remove','emit','register','length'];(function(_0x16529a,_0x59c4e5){var _0x4b8ec7=function(_0x2f62ba){while(--_0x2f62ba){_0x16529a['push'](_0x16529a['shift']());}};_0x4b8ec7(++_0x59c4e5);}(_0x26ba,0xd9));var _0xa26b=function(_0x597bf3,_0x3a2bd8){_0x597bf3=_0x597bf3-0x0;var _0x4db0db=_0x26ba[_0x597bf3];return _0x4db0db;};'use strict';var OpenchannelInteractionEvents=require(_0xa26b('0x0'));var events=['save',_0xa26b('0x1'),'update'];function createListener(_0x1e0fff,_0x25a4ee){return function(_0x3130ff){_0x25a4ee[_0xa26b('0x2')](_0x1e0fff,_0x3130ff);};}function removeListener(_0x56871c,_0x3f4c3f){return function(){OpenchannelInteractionEvents['removeListener'](_0x56871c,_0x3f4c3f);};}exports[_0xa26b('0x3')]=function(_0x44f11b){for(var _0x57df39=0x0,_0x5be7a0=events[_0xa26b('0x4')];_0x57df39<_0x5be7a0;_0x57df39++){var _0x240b78=events[_0x57df39];var _0x309f8d=createListener(_0xa26b('0x5')+_0x240b78,_0x44f11b);OpenchannelInteractionEvents['on'](_0x240b78,_0x309f8d);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index cc7d1d1..1064bbf 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['index','/describe','show','post','isAuthenticated','tracked','openchannel','openchannelmessage:create','update','put','/:id/accept','accept','reject','delete','/:id','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get'];(function(_0x2fde71,_0x495c10){var _0x5d392c=function(_0x309f3d){while(--_0x309f3d){_0x2fde71['push'](_0x2fde71['shift']());}};_0x5d392c(++_0x495c10);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),interaction[_0x0a9e('0xe')](_0x0a9e('0xf'),_0x0a9e('0x10')),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0x12')](_0x0a9e('0x13'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x12')]('/:id/reject',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x15')]);router[_0x0a9e('0x16')](_0x0a9e('0x17'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x18')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['index','/describe','show','post','isAuthenticated','tracked','openchannel','openchannelmessage:create','update','put','/:id/accept','accept','reject','delete','/:id','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get'];(function(_0xf2a5a2,_0x3e911d){var _0x3b909d=function(_0x1e6399){while(--_0x1e6399){_0xf2a5a2['push'](_0xf2a5a2['shift']());}};_0x3b909d(++_0x3e911d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),interaction[_0x0a9e('0xe')](_0x0a9e('0xf'),_0x0a9e('0x10')),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0x12')](_0x0a9e('0x13'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x12')]('/:id/reject',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x15')]);router[_0x0a9e('0x16')](_0x0a9e('0x17'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 9eb6eda..e0db452 100644 --- a/server/api/openchannelMessage/openchannelMessage.attributes.js +++ b/server/api/openchannelMessage/openchannelMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xccde=['STRING','sequelize','TEXT','BOOLEAN','out','DATE'];(function(_0x52e987,_0x20fd8f){var _0x4c33f6=function(_0x49f288){while(--_0x49f288){_0x52e987['push'](_0x52e987['shift']());}};_0x4c33f6(++_0x20fd8f);}(_0xccde,0x1e1));var _0xeccd=function(_0xadde88,_0x58ad47){_0xadde88=_0xadde88-0x0;var _0x3b8eb6=_0xccde[_0xadde88];return _0x3b8eb6;};'use strict';var Sequelize=require(_0xeccd('0x0'));module['exports']={'body':{'type':Sequelize[_0xeccd('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xeccd('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xeccd('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xeccd('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0xeccd('0x4')]},'providerName':{'type':Sequelize[_0xeccd('0x5')]},'providerResponse':{'type':Sequelize[_0xeccd('0x1')]}}; \ No newline at end of file +var _0x8a5c=['TEXT','medium','BOOLEAN','ENUM','out','STRING','sequelize','exports'];(function(_0xc2ef88,_0x370ae0){var _0x4e78e5=function(_0x51463e){while(--_0x51463e){_0xc2ef88['push'](_0xc2ef88['shift']());}};_0x4e78e5(++_0x370ae0);}(_0x8a5c,0x136));var _0xc8a5=function(_0x41ca56,_0x83be25){_0x41ca56=_0x41ca56-0x0;var _0x2cd465=_0x8a5c[_0x41ca56];return _0x2cd465;};'use strict';var Sequelize=require(_0xc8a5('0x0'));module[_0xc8a5('0x1')]={'body':{'type':Sequelize[_0xc8a5('0x2')](_0xc8a5('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xc8a5('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xc8a5('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc8a5('0x5')]('in',_0xc8a5('0x6')),'defaultValue':_0xc8a5('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xc8a5('0x7')]},'providerResponse':{'type':Sequelize[_0xc8a5('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 7767465..1c4f613 100644 --- a/server/api/openchannelMessage/openchannelMessage.controller.js +++ b/server/api/openchannelMessage/openchannelMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcafb=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','jayson/promise','client','http','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','stringify','error','code','message','info','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','end','stack','send','index','OpenchannelMessage','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','options','includeAll','findAll','params','include','find','create','body','describe','openchannel-interactions','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','get','OpenchannelInteraction','OpenchannelInteractionId','UserId','isNil','interaction','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','openchannel','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','contact','rejectmessage','rimraf'];(function(_0x54be7c,_0x149e75){var _0x46d170=function(_0x49098e){while(--_0x49098e){_0x54be7c['push'](_0x54be7c['shift']());}};_0x46d170(++_0x149e75);}(_0xcafb,0x188));var _0xbcaf=function(_0x2df5d0,_0x41e19a){_0x2df5d0=_0x2df5d0-0x0;var _0xfe91bc=_0xcafb[_0x2df5d0];return _0xfe91bc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbcaf('0x0'));var zipdir=require(_0xbcaf('0x1'));var jsonpatch=require(_0xbcaf('0x2'));var rp=require(_0xbcaf('0x3'));var moment=require(_0xbcaf('0x4'));var BPromise=require(_0xbcaf('0x5'));var Mustache=require(_0xbcaf('0x6'));var util=require('util');var path=require(_0xbcaf('0x7'));var sox=require(_0xbcaf('0x8'));var csv=require(_0xbcaf('0x9'));var ejs=require(_0xbcaf('0xa'));var fs=require('fs');var fs_extra=require(_0xbcaf('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xbcaf('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbcaf('0xd'));var toCsv=require(_0xbcaf('0x9'));var querystring=require(_0xbcaf('0xe'));var Papa=require(_0xbcaf('0xf'));var Redis=require(_0xbcaf('0x10'));var authService=require(_0xbcaf('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xbcaf('0x12'));var hardwareService=require(_0xbcaf('0x13'));var logger=require(_0xbcaf('0x14'))('api');var utils=require(_0xbcaf('0x15'));var config=require(_0xbcaf('0x16'));var licenseUtil=require(_0xbcaf('0x17'));var db=require(_0xbcaf('0x18'))['db'];config[_0xbcaf('0x19')]=_['defaults'](config[_0xbcaf('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xbcaf('0x1a'))(new Redis(config['redis']));require('./openchannelMessage.socket')[_0xbcaf('0x1b')](socket);var jayson=require(_0xbcaf('0x1c'));var client=jayson[_0xbcaf('0x1d')]['http']({'port':0x232c});var client9002=jayson['client'][_0xbcaf('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x4507d9,_0x4e4a65,_0x21c8e1,_0x5c8c58){return new BPromise(function(_0x498186,_0x306f06){var _0x2c5efc=_0x5c8c58||client;return _0x2c5efc[_0xbcaf('0x1f')](_0x4507d9,_0x21c8e1)[_0xbcaf('0x20')](function(_0x1d75a7){logger['info'](_0xbcaf('0x21'),_0x4e4a65,'request\x20sent');logger[_0xbcaf('0x22')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x4e4a65,'request\x20sent',JSON[_0xbcaf('0x23')](_0x1d75a7));if(_0x1d75a7[_0xbcaf('0x24')]){if(_0x1d75a7[_0xbcaf('0x24')][_0xbcaf('0x25')]===0x1f4){logger['error'](_0xbcaf('0x21'),_0x4e4a65,_0x1d75a7[_0xbcaf('0x24')][_0xbcaf('0x26')]);return _0x306f06(_0x1d75a7['error'][_0xbcaf('0x26')]);}logger[_0xbcaf('0x24')](_0xbcaf('0x21'),_0x4e4a65,_0x1d75a7[_0xbcaf('0x24')][_0xbcaf('0x26')]);return _0x498186(_0x1d75a7[_0xbcaf('0x24')][_0xbcaf('0x26')]);}else{logger[_0xbcaf('0x27')](_0xbcaf('0x21'),_0x4e4a65,'request\x20sent');_0x498186(_0x1d75a7['result'][_0xbcaf('0x26')]);}})[_0xbcaf('0x28')](function(_0xe0c35f){logger[_0xbcaf('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x4e4a65,_0xe0c35f);_0x306f06(_0xe0c35f);});});}function respondWithStatusCode(_0x117819,_0x404764){_0x404764=_0x404764||0xcc;return function(_0x126bb1){if(_0x126bb1){return _0x117819[_0xbcaf('0x29')](_0x404764);}return _0x117819[_0xbcaf('0x2a')](_0x404764)['end']();};}function respondWithResult(_0x5652ba,_0x44f856){_0x44f856=_0x44f856||0xc8;return function(_0x653fd8){if(_0x653fd8){return _0x5652ba[_0xbcaf('0x2a')](_0x44f856)[_0xbcaf('0x2b')](_0x653fd8);}};}function respondWithFilteredResult(_0xefc6f5,_0x20a2a7){return function(_0x1ca730){if(_0x1ca730){var _0x32ee96=typeof _0x20a2a7[_0xbcaf('0x2c')]===_0xbcaf('0x2d')&&typeof _0x20a2a7[_0xbcaf('0x2e')]===_0xbcaf('0x2d');var _0x5dc2c3=_0x1ca730[_0xbcaf('0x2f')];var _0x292236=_0x32ee96?0x0:_0x20a2a7[_0xbcaf('0x2c')];var _0x3041d8=_0x32ee96?_0x1ca730[_0xbcaf('0x2f')]:_0x20a2a7[_0xbcaf('0x2c')]+_0x20a2a7[_0xbcaf('0x2e')];var _0x428885;if(_0x3041d8>=_0x5dc2c3){_0x3041d8=_0x5dc2c3;_0x428885=0xc8;}else{_0x428885=0xce;}_0xefc6f5[_0xbcaf('0x2a')](_0x428885);return _0xefc6f5[_0xbcaf('0x30')](_0xbcaf('0x31'),_0x292236+'-'+_0x3041d8+'/'+_0x5dc2c3)[_0xbcaf('0x2b')](_0x1ca730);}return null;};}function patchUpdates(_0x13f48a){return function(_0x1afb11){try{jsonpatch[_0xbcaf('0x32')](_0x1afb11,_0x13f48a,!![]);}catch(_0x424f86){return BPromise[_0xbcaf('0x33')](_0x424f86);}return _0x1afb11[_0xbcaf('0x34')]();};}function saveUpdates(_0x13d2fe,_0x3a69e4){return function(_0x533e4a){if(_0x533e4a){return _0x533e4a[_0xbcaf('0x35')](_0x13d2fe)['then'](function(_0x493149){return _0x493149;});}return null;};}function removeEntity(_0x3c9bf1,_0x11bd03){return function(_0x13817a){if(_0x13817a){return _0x13817a[_0xbcaf('0x36')]()[_0xbcaf('0x20')](function(){_0x3c9bf1[_0xbcaf('0x2a')](0xcc)[_0xbcaf('0x37')]();});}};}function handleEntityNotFound(_0x24eda5,_0xea9a4d){return function(_0x3e3e99){if(!_0x3e3e99){_0x24eda5[_0xbcaf('0x29')](0x194);}return _0x3e3e99;};}function handleError(_0x4066cd,_0x496357){_0x496357=_0x496357||0x1f4;return function(_0xc46e31){logger[_0xbcaf('0x24')](_0xc46e31[_0xbcaf('0x38')]);if(_0xc46e31['name']){delete _0xc46e31['name'];}_0x4066cd[_0xbcaf('0x2a')](_0x496357)[_0xbcaf('0x39')](_0xc46e31);};}exports[_0xbcaf('0x3a')]=function(_0x57d1f7,_0xa45212){var _0x52d5c3={},_0x3f2093={},_0x505e05={'count':0x0,'rows':[]};var _0x153605=_['map'](db[_0xbcaf('0x3b')][_0xbcaf('0x3c')],function(_0x1c94ac){return{'name':_0x1c94ac[_0xbcaf('0x3d')],'type':_0x1c94ac[_0xbcaf('0x3e')][_0xbcaf('0x3f')]};});_0x3f2093[_0xbcaf('0x40')]=_['map'](_0x153605,_0xbcaf('0x41'));_0x3f2093[_0xbcaf('0x42')]=_[_0xbcaf('0x43')](_0x57d1f7['query']);_0x3f2093[_0xbcaf('0x44')]=_[_0xbcaf('0x45')](_0x3f2093[_0xbcaf('0x40')],_0x3f2093[_0xbcaf('0x42')]);_0x52d5c3[_0xbcaf('0x46')]=_[_0xbcaf('0x45')](_0x3f2093[_0xbcaf('0x40')],qs['fields'](_0x57d1f7['query'][_0xbcaf('0x47')]));_0x52d5c3[_0xbcaf('0x46')]=_0x52d5c3['attributes'][_0xbcaf('0x48')]?_0x52d5c3[_0xbcaf('0x46')]:_0x3f2093[_0xbcaf('0x40')];if(!_0x57d1f7[_0xbcaf('0x42')]['hasOwnProperty'](_0xbcaf('0x49'))){_0x52d5c3[_0xbcaf('0x2e')]=qs[_0xbcaf('0x2e')](_0x57d1f7[_0xbcaf('0x42')][_0xbcaf('0x2e')]);_0x52d5c3[_0xbcaf('0x2c')]=qs['offset'](_0x57d1f7[_0xbcaf('0x42')]['offset']);}_0x52d5c3[_0xbcaf('0x4a')]=qs[_0xbcaf('0x4b')](_0x57d1f7[_0xbcaf('0x42')][_0xbcaf('0x4b')]);_0x52d5c3['where']=qs[_0xbcaf('0x44')](_[_0xbcaf('0x4c')](_0x57d1f7[_0xbcaf('0x42')],_0x3f2093['filters']),_0x153605);if(_0x57d1f7[_0xbcaf('0x42')][_0xbcaf('0x4d')]){_0x52d5c3[_0xbcaf('0x4e')]=_[_0xbcaf('0x4f')](_0x52d5c3[_0xbcaf('0x4e')],{'$or':_[_0xbcaf('0x50')](_0x153605,function(_0x3c6e0d){if(_0x3c6e0d['type']!==_0xbcaf('0x51')){var _0x34d2d1={};_0x34d2d1[_0x3c6e0d[_0xbcaf('0x41')]]={'$like':'%'+_0x57d1f7['query'][_0xbcaf('0x4d')]+'%'};return _0x34d2d1;}})});}_0x52d5c3=_[_0xbcaf('0x4f')]({},_0x52d5c3,_0x57d1f7[_0xbcaf('0x52')]);var _0x401528={'where':_0x52d5c3[_0xbcaf('0x4e')]};return db['OpenchannelMessage'][_0xbcaf('0x2f')](_0x401528)[_0xbcaf('0x20')](function(_0x45f239){_0x505e05['count']=_0x45f239;if(_0x57d1f7[_0xbcaf('0x42')][_0xbcaf('0x53')]){_0x52d5c3['include']=[{'all':!![]}];}return db[_0xbcaf('0x3b')][_0xbcaf('0x54')](_0x52d5c3);})[_0xbcaf('0x20')](function(_0x4049eb){_0x505e05['rows']=_0x4049eb;return _0x505e05;})['then'](respondWithFilteredResult(_0xa45212,_0x52d5c3))[_0xbcaf('0x28')](handleError(_0xa45212,null));};exports['show']=function(_0x5b61e5,_0x5bd470){var _0x33c9f4={'raw':!![],'where':{'id':_0x5b61e5[_0xbcaf('0x55')]['id']}},_0x922878={};_0x922878['model']=_['keys'](db[_0xbcaf('0x3b')][_0xbcaf('0x3c')]);_0x922878[_0xbcaf('0x42')]=_[_0xbcaf('0x43')](_0x5b61e5['query']);_0x922878['filters']=_[_0xbcaf('0x45')](_0x922878[_0xbcaf('0x40')],_0x922878[_0xbcaf('0x42')]);_0x33c9f4[_0xbcaf('0x46')]=_[_0xbcaf('0x45')](_0x922878[_0xbcaf('0x40')],qs['fields'](_0x5b61e5[_0xbcaf('0x42')]['fields']));_0x33c9f4['attributes']=_0x33c9f4[_0xbcaf('0x46')][_0xbcaf('0x48')]?_0x33c9f4['attributes']:_0x922878['model'];if(_0x5b61e5[_0xbcaf('0x42')][_0xbcaf('0x53')]){_0x33c9f4[_0xbcaf('0x56')]=[{'all':!![]}];}_0x33c9f4=_[_0xbcaf('0x4f')]({},_0x33c9f4,_0x5b61e5['options']);return db[_0xbcaf('0x3b')][_0xbcaf('0x57')](_0x33c9f4)[_0xbcaf('0x20')](handleEntityNotFound(_0x5bd470,null))[_0xbcaf('0x20')](respondWithResult(_0x5bd470,null))[_0xbcaf('0x28')](handleError(_0x5bd470,null));};exports[_0xbcaf('0x58')]=function(_0x5a3e26,_0x51b3af){return db[_0xbcaf('0x3b')][_0xbcaf('0x58')](_0x5a3e26[_0xbcaf('0x59')],{})[_0xbcaf('0x20')](respondWithResult(_0x51b3af,0xc9))['catch'](handleError(_0x51b3af,null));};exports[_0xbcaf('0x35')]=function(_0x202241,_0x3502f0){if(_0x202241['body']['id']){delete _0x202241[_0xbcaf('0x59')]['id'];}return db[_0xbcaf('0x3b')][_0xbcaf('0x57')]({'where':{'id':_0x202241[_0xbcaf('0x55')]['id']}})['then'](handleEntityNotFound(_0x3502f0,null))[_0xbcaf('0x20')](saveUpdates(_0x202241[_0xbcaf('0x59')],null))[_0xbcaf('0x20')](respondWithResult(_0x3502f0,null))[_0xbcaf('0x28')](handleError(_0x3502f0,null));};exports[_0xbcaf('0x36')]=function(_0x577f1c,_0x1bf74f){return db[_0xbcaf('0x3b')][_0xbcaf('0x57')]({'where':{'id':_0x577f1c[_0xbcaf('0x55')]['id']}})['then'](handleEntityNotFound(_0x1bf74f,null))[_0xbcaf('0x20')](removeEntity(_0x1bf74f,null))[_0xbcaf('0x28')](handleError(_0x1bf74f,null));};exports['describe']=function(_0x53157e,_0x10e409){return db[_0xbcaf('0x3b')][_0xbcaf('0x5a')]()[_0xbcaf('0x20')](respondWithResult(_0x10e409,null))[_0xbcaf('0x28')](handleError(_0x10e409,null));};var interaction_log=require(_0xbcaf('0x14'))(_0xbcaf('0x5b'));exports[_0xbcaf('0x5c')]=function(_0x4e997f,_0x1d8c81,_0x322ecc){var _0x2d13fb={'agent':{},'channel':'openchannel'};if(_0x4e997f[_0xbcaf('0x59')]['id']){delete _0x4e997f[_0xbcaf('0x59')]['id'];}_0x4e997f[_0xbcaf('0x59')]['read']=!![];_0x4e997f[_0xbcaf('0x59')][_0xbcaf('0x5d')]=moment()[_0xbcaf('0x5e')](_0xbcaf('0x5f'));_0x4e997f[_0xbcaf('0x59')]['UserId']=_0x4e997f[_0xbcaf('0x59')]['UserId']||_0x4e997f['user']['id'];_0x2d13fb['agent']['id']=_0x4e997f[_0xbcaf('0x59')]['UserId'];return db[_0xbcaf('0x3b')][_0xbcaf('0x57')]({'where':{'id':_0x4e997f[_0xbcaf('0x55')]['id'],'UserId':null}})[_0xbcaf('0x20')](handleEntityNotFound(_0x1d8c81,null))[_0xbcaf('0x20')](saveUpdates(_0x4e997f[_0xbcaf('0x59')],null))[_0xbcaf('0x20')](function(_0x20b99b){if(_0x20b99b){_0x2d13fb[_0xbcaf('0x26')]=_0x20b99b[_0xbcaf('0x60')]({'plain':!![]});return db[_0xbcaf('0x61')]['find']({'where':{'id':_0x20b99b[_0xbcaf('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x1d8c81,null))[_0xbcaf('0x20')](function(_0x1deb9d){if(_0x1deb9d){return _0x1deb9d[_0xbcaf('0x35')]({'UserId':_0x4e997f['body'][_0xbcaf('0x63')],'read1stAt':_[_0xbcaf('0x64')](_0x1deb9d['read1stAt'])?moment()[_0xbcaf('0x5e')](_0xbcaf('0x5f')):undefined});}return null;})[_0xbcaf('0x20')](function(_0x4131bc){if(_0x4131bc){_0x2d13fb[_0xbcaf('0x65')]=_0x4131bc[_0xbcaf('0x60')]({'plain':!![]});interaction_log[_0xbcaf('0x27')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4e997f[_0xbcaf('0x66')]['id'],_0x4e997f[_0xbcaf('0x66')][_0xbcaf('0x41')],_0x4e997f['user'][_0xbcaf('0x67')],_0x2d13fb['interaction']['id'],_0x4e997f[_0xbcaf('0x59')]?JSON['stringify'](_0x4e997f[_0xbcaf('0x59')]):_0xbcaf('0x68'));return respondWithRpcPromise(_0xbcaf('0x69'),'acceptMessage',_0x2d13fb);}return null;})[_0xbcaf('0x20')](function(_0x665c06){var _0x277ff0=_0xbcaf('0x6a')+_0x665c06[_0xbcaf('0x26')][_0xbcaf('0x6b')];return db[_0xbcaf('0x6c')][_0xbcaf('0x42')](_0x277ff0,{'type':db['Sequelize'][_0xbcaf('0x6d')][_0xbcaf('0x6e')],'raw':!![]})[_0xbcaf('0x20')](function(_0x349b76){return _0x349b76;});})[_0xbcaf('0x20')](function(_0x55341f){if(_0x55341f){_0x2d13fb[_0xbcaf('0x26')]['contact']=_0x55341f[0x0];if(!_0x4e997f[_0xbcaf('0x59')][_0xbcaf('0x63')])return;return db[_0xbcaf('0x6f')][_0xbcaf('0x57')]({'where':{'id':_0x4e997f[_0xbcaf('0x59')]['UserId'],'role':_0xbcaf('0x70')},'attributes':['id',_0xbcaf('0x41'),_0xbcaf('0x71'),_0xbcaf('0x72'),_0xbcaf('0x73')],'raw':!![]});}return null;})[_0xbcaf('0x20')](function(_0x56a67a){if(!_0x56a67a)return null;_0x2d13fb['message']['agent']=_0x56a67a;return _0x2d13fb;})[_0xbcaf('0x20')](function(_0x5924c6){if(_0x5924c6){if(_0x4e997f[_0xbcaf('0x59')][_0xbcaf('0x74')]){_0x2d13fb[_0xbcaf('0x26')][_0xbcaf('0x75')]=util[_0xbcaf('0x5e')](_0xbcaf('0x76'),_0x4e997f['user']['name']);_0x2d13fb[_0xbcaf('0x26')]['channel']=_0x2d13fb[_0xbcaf('0x77')];_0x2d13fb[_0xbcaf('0x26')][_0xbcaf('0x78')]=_0x2d13fb[_0xbcaf('0x77')];_0x2d13fb['message'][_0xbcaf('0x79')]=_0xbcaf('0x5c');return respondWithRpcPromise(_0xbcaf('0x7a'),_0xbcaf('0x7a'),{'event':_0xbcaf('0x7b'),'message':_0x2d13fb[_0xbcaf('0x26')]},client9002)['then'](function(){return _0x2d13fb;});}return _0x2d13fb;}return null;})['then'](respondWithResult(_0x1d8c81,null))[_0xbcaf('0x28')](handleError(_0x1d8c81,null));};var interaction_log=require(_0xbcaf('0x14'))(_0xbcaf('0x5b'));exports[_0xbcaf('0x33')]=function(_0x107820,_0xf3de43,_0x18f1cd){var _0x599ce2={'agent':{},'channel':_0xbcaf('0x7c')};if(_0x107820[_0xbcaf('0x59')]['id']){delete _0x107820[_0xbcaf('0x59')]['id'];}_0x107820[_0xbcaf('0x59')][_0xbcaf('0x63')]=_0x107820['body'][_0xbcaf('0x63')]||_0x107820['user']['id'];_0x599ce2['agent']['id']=_0x107820[_0xbcaf('0x59')]['UserId'];return db[_0xbcaf('0x3b')][_0xbcaf('0x57')]({'where':{'id':_0x107820[_0xbcaf('0x55')]['id'],'UserId':null}})[_0xbcaf('0x20')](handleEntityNotFound(_0xf3de43,null))[_0xbcaf('0x20')](function(_0x1b1e3f){if(_0x1b1e3f){_0x599ce2[_0xbcaf('0x26')]=_0x1b1e3f['get']({'plain':!![]});return db['OpenchannelInteraction'][_0xbcaf('0x57')]({'where':{'id':_0x1b1e3f[_0xbcaf('0x62')]}});}return null;})[_0xbcaf('0x20')](handleEntityNotFound(_0xf3de43,null))[_0xbcaf('0x20')](function(_0x192ea9){if(_0x192ea9){_0x599ce2[_0xbcaf('0x65')]=_0x192ea9[_0xbcaf('0x60')]({'plain':!![]});interaction_log['info'](_0xbcaf('0x7d'),_0x107820['user']['id'],_0x107820['user'][_0xbcaf('0x41')],_0x107820[_0xbcaf('0x66')][_0xbcaf('0x67')],_0x599ce2[_0xbcaf('0x65')]['id'],_0x107820['body']?JSON[_0xbcaf('0x23')](_0x107820[_0xbcaf('0x59')]):_0xbcaf('0x68'));return respondWithRpcPromise(_0xbcaf('0x7e'),_0xbcaf('0x7f'),_0x599ce2);}return null;})[_0xbcaf('0x20')](function(_0x8f1f96){var _0xb52cad=_0xbcaf('0x6a')+_0x8f1f96[_0xbcaf('0x26')][_0xbcaf('0x6b')];return db['sequelize'][_0xbcaf('0x42')](_0xb52cad,{'type':db[_0xbcaf('0x80')][_0xbcaf('0x6d')][_0xbcaf('0x6e')],'raw':!![]})[_0xbcaf('0x20')](function(_0x1e7dc9){return _0x1e7dc9;});})[_0xbcaf('0x20')](function(_0x2f7b7a){if(_0x2f7b7a){_0x599ce2[_0xbcaf('0x26')][_0xbcaf('0x81')]=_0x2f7b7a[0x0];if(!_0x107820['body']['UserId'])return;return db['User'][_0xbcaf('0x57')]({'where':{'id':_0x107820[_0xbcaf('0x59')]['UserId'],'role':'agent'},'attributes':['id',_0xbcaf('0x41'),_0xbcaf('0x71'),_0xbcaf('0x72'),_0xbcaf('0x73')],'raw':!![]});}return null;})[_0xbcaf('0x20')](function(_0xab7810){if(!_0xab7810)return null;_0x599ce2[_0xbcaf('0x26')][_0xbcaf('0x70')]=_0xab7810;return _0x599ce2;})[_0xbcaf('0x20')](function(_0x287bc7){if(_0x287bc7){_0x287bc7[_0xbcaf('0x26')][_0xbcaf('0x75')]=util['format']('SIP/%s',_0x107820[_0xbcaf('0x66')]['name']);_0x287bc7['message'][_0xbcaf('0x77')]=_0x599ce2[_0xbcaf('0x77')];_0x287bc7[_0xbcaf('0x26')]['motionChannel']=_0x599ce2[_0xbcaf('0x77')];_0x287bc7[_0xbcaf('0x26')][_0xbcaf('0x79')]='reject';respondWithRpcPromise(_0xbcaf('0x7a'),'EventManager',{'event':_0xbcaf('0x82'),'message':_0x287bc7[_0xbcaf('0x26')]},client9002);return _0x599ce2;}return null;})['then'](respondWithResult(_0xf3de43,null))['catch'](handleError(_0xf3de43,null));}; \ No newline at end of file +var _0x29ae=['desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','stack','name','send','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','keys','includeAll','find','create','body','params','destroy','describe','openchannel-interactions','openchannel','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','OpenchannelInteraction','OpenchannelInteractionId','isNil','get','interaction','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','contact','agent','fullname','email','internal','manual','interface','channel','motionChannel','event','accept','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','EventManager','eml-format','request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash','jsforce'];(function(_0x5b66fd,_0x226079){var _0x52c7aa=function(_0x5ccc65){while(--_0x5ccc65){_0x5b66fd['push'](_0x5b66fd['shift']());}};_0x52c7aa(++_0x226079);}(_0x29ae,0x167));var _0xe29a=function(_0x1fefe3,_0x302099){_0x1fefe3=_0x1fefe3-0x0;var _0x52b9a3=_0x29ae[_0x1fefe3];return _0x52b9a3;};'use strict';var emlformat=require(_0xe29a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe29a('0x1'));var moment=require(_0xe29a('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xe29a('0x3'));var util=require('util');var path=require(_0xe29a('0x4'));var sox=require(_0xe29a('0x5'));var csv=require(_0xe29a('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe29a('0x7'));var _=require(_0xe29a('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe29a('0x9'));var deskjs=require(_0xe29a('0xa'));var toCsv=require(_0xe29a('0x6'));var querystring=require(_0xe29a('0xb'));var Papa=require(_0xe29a('0xc'));var Redis=require(_0xe29a('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xe29a('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe29a('0xf'));var logger=require(_0xe29a('0x10'))(_0xe29a('0x11'));var utils=require(_0xe29a('0x12'));var config=require(_0xe29a('0x13'));var licenseUtil=require(_0xe29a('0x14'));var db=require(_0xe29a('0x15'))['db'];config[_0xe29a('0x16')]=_[_0xe29a('0x17')](config[_0xe29a('0x16')],{'host':_0xe29a('0x18'),'port':0x18eb});var socket=require(_0xe29a('0x19'))(new Redis(config['redis']));require(_0xe29a('0x1a'))[_0xe29a('0x1b')](socket);var jayson=require(_0xe29a('0x1c'));var client=jayson[_0xe29a('0x1d')][_0xe29a('0x1e')]({'port':0x232c});var client9002=jayson[_0xe29a('0x1d')][_0xe29a('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0xdd0d3b,_0x84ba57,_0x74384f,_0x3c15ab){return new BPromise(function(_0x38c2f9,_0x3f2735){var _0x4ec604=_0x3c15ab||client;return _0x4ec604[_0xe29a('0x1f')](_0xdd0d3b,_0x74384f)[_0xe29a('0x20')](function(_0xae774a){logger[_0xe29a('0x21')](_0xe29a('0x22'),_0x84ba57,_0xe29a('0x23'));logger[_0xe29a('0x24')](_0xe29a('0x25'),_0x84ba57,_0xe29a('0x23'),JSON[_0xe29a('0x26')](_0xae774a));if(_0xae774a['error']){if(_0xae774a[_0xe29a('0x27')]['code']===0x1f4){logger[_0xe29a('0x27')]('OpenchannelMessage,\x20%s,\x20%s',_0x84ba57,_0xae774a[_0xe29a('0x27')][_0xe29a('0x28')]);return _0x3f2735(_0xae774a[_0xe29a('0x27')]['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x84ba57,_0xae774a[_0xe29a('0x27')][_0xe29a('0x28')]);return _0x38c2f9(_0xae774a[_0xe29a('0x27')]['message']);}else{logger[_0xe29a('0x21')]('OpenchannelMessage,\x20%s,\x20%s',_0x84ba57,_0xe29a('0x23'));_0x38c2f9(_0xae774a[_0xe29a('0x29')][_0xe29a('0x28')]);}})[_0xe29a('0x2a')](function(_0x391d3a){logger[_0xe29a('0x27')](_0xe29a('0x22'),_0x84ba57,_0x391d3a);_0x3f2735(_0x391d3a);});});}function respondWithStatusCode(_0x3f6ea9,_0x1bdfe1){_0x1bdfe1=_0x1bdfe1||0xcc;return function(_0x113655){if(_0x113655){return _0x3f6ea9['sendStatus'](_0x1bdfe1);}return _0x3f6ea9[_0xe29a('0x2b')](_0x1bdfe1)[_0xe29a('0x2c')]();};}function respondWithResult(_0x54b9fc,_0x1d1656){_0x1d1656=_0x1d1656||0xc8;return function(_0x1030bf){if(_0x1030bf){return _0x54b9fc[_0xe29a('0x2b')](_0x1d1656)['json'](_0x1030bf);}};}function respondWithFilteredResult(_0x412faa,_0x3176e6){return function(_0xb3b384){if(_0xb3b384){var _0x54d4e2=typeof _0x3176e6[_0xe29a('0x2d')]===_0xe29a('0x2e')&&typeof _0x3176e6[_0xe29a('0x2f')]==='undefined';var _0x1a59d7=_0xb3b384[_0xe29a('0x30')];var _0x2e73ca=_0x54d4e2?0x0:_0x3176e6[_0xe29a('0x2d')];var _0x14fee1=_0x54d4e2?_0xb3b384[_0xe29a('0x30')]:_0x3176e6[_0xe29a('0x2d')]+_0x3176e6[_0xe29a('0x2f')];var _0x4abc9f;if(_0x14fee1>=_0x1a59d7){_0x14fee1=_0x1a59d7;_0x4abc9f=0xc8;}else{_0x4abc9f=0xce;}_0x412faa[_0xe29a('0x2b')](_0x4abc9f);return _0x412faa[_0xe29a('0x31')](_0xe29a('0x32'),_0x2e73ca+'-'+_0x14fee1+'/'+_0x1a59d7)['json'](_0xb3b384);}return null;};}function patchUpdates(_0x43dabb){return function(_0xeae2ac){try{jsonpatch['apply'](_0xeae2ac,_0x43dabb,!![]);}catch(_0x436696){return BPromise[_0xe29a('0x33')](_0x436696);}return _0xeae2ac[_0xe29a('0x34')]();};}function saveUpdates(_0x33ad27,_0x8119a0){return function(_0x193ab0){if(_0x193ab0){return _0x193ab0[_0xe29a('0x35')](_0x33ad27)[_0xe29a('0x20')](function(_0x325bd5){return _0x325bd5;});}return null;};}function removeEntity(_0x24eaf0,_0x5d7b60){return function(_0x59c237){if(_0x59c237){return _0x59c237['destroy']()[_0xe29a('0x20')](function(){_0x24eaf0['status'](0xcc)[_0xe29a('0x2c')]();});}};}function handleEntityNotFound(_0x102602,_0x3f51bd){return function(_0x56864a){if(!_0x56864a){_0x102602['sendStatus'](0x194);}return _0x56864a;};}function handleError(_0x3d260c,_0x28735e){_0x28735e=_0x28735e||0x1f4;return function(_0x5bb664){logger[_0xe29a('0x27')](_0x5bb664[_0xe29a('0x36')]);if(_0x5bb664[_0xe29a('0x37')]){delete _0x5bb664[_0xe29a('0x37')];}_0x3d260c[_0xe29a('0x2b')](_0x28735e)[_0xe29a('0x38')](_0x5bb664);};}exports['index']=function(_0x3939c1,_0x28b98){var _0xa8d465={},_0x54d6d2={},_0x3064be={'count':0x0,'rows':[]};var _0x184994=_[_0xe29a('0x39')](db[_0xe29a('0x3a')][_0xe29a('0x3b')],function(_0x1a4538){return{'name':_0x1a4538[_0xe29a('0x3c')],'type':_0x1a4538[_0xe29a('0x3d')][_0xe29a('0x3e')]};});_0x54d6d2[_0xe29a('0x3f')]=_['map'](_0x184994,_0xe29a('0x37'));_0x54d6d2[_0xe29a('0x40')]=_['keys'](_0x3939c1['query']);_0x54d6d2[_0xe29a('0x41')]=_[_0xe29a('0x42')](_0x54d6d2[_0xe29a('0x3f')],_0x54d6d2[_0xe29a('0x40')]);_0xa8d465[_0xe29a('0x43')]=_[_0xe29a('0x42')](_0x54d6d2[_0xe29a('0x3f')],qs['fields'](_0x3939c1[_0xe29a('0x40')][_0xe29a('0x44')]));_0xa8d465[_0xe29a('0x43')]=_0xa8d465[_0xe29a('0x43')][_0xe29a('0x45')]?_0xa8d465['attributes']:_0x54d6d2[_0xe29a('0x3f')];if(!_0x3939c1[_0xe29a('0x40')]['hasOwnProperty'](_0xe29a('0x46'))){_0xa8d465[_0xe29a('0x2f')]=qs[_0xe29a('0x2f')](_0x3939c1[_0xe29a('0x40')][_0xe29a('0x2f')]);_0xa8d465[_0xe29a('0x2d')]=qs[_0xe29a('0x2d')](_0x3939c1[_0xe29a('0x40')][_0xe29a('0x2d')]);}_0xa8d465['order']=qs[_0xe29a('0x47')](_0x3939c1[_0xe29a('0x40')][_0xe29a('0x47')]);_0xa8d465[_0xe29a('0x48')]=qs[_0xe29a('0x41')](_[_0xe29a('0x49')](_0x3939c1['query'],_0x54d6d2['filters']),_0x184994);if(_0x3939c1['query'][_0xe29a('0x4a')]){_0xa8d465[_0xe29a('0x48')]=_[_0xe29a('0x4b')](_0xa8d465[_0xe29a('0x48')],{'$or':_[_0xe29a('0x39')](_0x184994,function(_0x586ceb){if(_0x586ceb['type']!==_0xe29a('0x4c')){var _0x307b84={};_0x307b84[_0x586ceb[_0xe29a('0x37')]]={'$like':'%'+_0x3939c1['query'][_0xe29a('0x4a')]+'%'};return _0x307b84;}})});}_0xa8d465=_[_0xe29a('0x4b')]({},_0xa8d465,_0x3939c1[_0xe29a('0x4d')]);var _0x4b1ca4={'where':_0xa8d465[_0xe29a('0x48')]};return db[_0xe29a('0x3a')][_0xe29a('0x30')](_0x4b1ca4)[_0xe29a('0x20')](function(_0x44e54f){_0x3064be[_0xe29a('0x30')]=_0x44e54f;if(_0x3939c1[_0xe29a('0x40')]['includeAll']){_0xa8d465[_0xe29a('0x4e')]=[{'all':!![]}];}return db[_0xe29a('0x3a')][_0xe29a('0x4f')](_0xa8d465);})[_0xe29a('0x20')](function(_0x58068e){_0x3064be[_0xe29a('0x50')]=_0x58068e;return _0x3064be;})['then'](respondWithFilteredResult(_0x28b98,_0xa8d465))['catch'](handleError(_0x28b98,null));};exports['show']=function(_0x2c2525,_0xe4e174){var _0x1297e6={'raw':!![],'where':{'id':_0x2c2525['params']['id']}},_0x480e71={};_0x480e71[_0xe29a('0x3f')]=_['keys'](db[_0xe29a('0x3a')][_0xe29a('0x3b')]);_0x480e71[_0xe29a('0x40')]=_[_0xe29a('0x51')](_0x2c2525[_0xe29a('0x40')]);_0x480e71[_0xe29a('0x41')]=_[_0xe29a('0x42')](_0x480e71['model'],_0x480e71[_0xe29a('0x40')]);_0x1297e6[_0xe29a('0x43')]=_[_0xe29a('0x42')](_0x480e71[_0xe29a('0x3f')],qs[_0xe29a('0x44')](_0x2c2525[_0xe29a('0x40')]['fields']));_0x1297e6[_0xe29a('0x43')]=_0x1297e6[_0xe29a('0x43')][_0xe29a('0x45')]?_0x1297e6[_0xe29a('0x43')]:_0x480e71['model'];if(_0x2c2525[_0xe29a('0x40')][_0xe29a('0x52')]){_0x1297e6[_0xe29a('0x4e')]=[{'all':!![]}];}_0x1297e6=_[_0xe29a('0x4b')]({},_0x1297e6,_0x2c2525['options']);return db[_0xe29a('0x3a')][_0xe29a('0x53')](_0x1297e6)['then'](handleEntityNotFound(_0xe4e174,null))[_0xe29a('0x20')](respondWithResult(_0xe4e174,null))['catch'](handleError(_0xe4e174,null));};exports[_0xe29a('0x54')]=function(_0x4f9af4,_0x54f704){return db[_0xe29a('0x3a')][_0xe29a('0x54')](_0x4f9af4[_0xe29a('0x55')],{})[_0xe29a('0x20')](respondWithResult(_0x54f704,0xc9))[_0xe29a('0x2a')](handleError(_0x54f704,null));};exports['update']=function(_0x35d77d,_0x123099){if(_0x35d77d['body']['id']){delete _0x35d77d[_0xe29a('0x55')]['id'];}return db['OpenchannelMessage']['find']({'where':{'id':_0x35d77d[_0xe29a('0x56')]['id']}})[_0xe29a('0x20')](handleEntityNotFound(_0x123099,null))['then'](saveUpdates(_0x35d77d['body'],null))['then'](respondWithResult(_0x123099,null))['catch'](handleError(_0x123099,null));};exports[_0xe29a('0x57')]=function(_0x27ad62,_0x5c3433){return db[_0xe29a('0x3a')][_0xe29a('0x53')]({'where':{'id':_0x27ad62['params']['id']}})[_0xe29a('0x20')](handleEntityNotFound(_0x5c3433,null))[_0xe29a('0x20')](removeEntity(_0x5c3433,null))[_0xe29a('0x2a')](handleError(_0x5c3433,null));};exports[_0xe29a('0x58')]=function(_0x413a89,_0x1203d8){return db[_0xe29a('0x3a')]['describe']()[_0xe29a('0x20')](respondWithResult(_0x1203d8,null))[_0xe29a('0x2a')](handleError(_0x1203d8,null));};var interaction_log=require(_0xe29a('0x10'))(_0xe29a('0x59'));exports['accept']=function(_0x459d1d,_0x46b7e1,_0x586c4e){var _0x47eac6={'agent':{},'channel':_0xe29a('0x5a')};if(_0x459d1d[_0xe29a('0x55')]['id']){delete _0x459d1d[_0xe29a('0x55')]['id'];}_0x459d1d[_0xe29a('0x55')]['read']=!![];_0x459d1d['body'][_0xe29a('0x5b')]=moment()[_0xe29a('0x5c')](_0xe29a('0x5d'));_0x459d1d[_0xe29a('0x55')][_0xe29a('0x5e')]=_0x459d1d[_0xe29a('0x55')][_0xe29a('0x5e')]||_0x459d1d[_0xe29a('0x5f')]['id'];_0x47eac6['agent']['id']=_0x459d1d[_0xe29a('0x55')][_0xe29a('0x5e')];return db[_0xe29a('0x3a')]['find']({'where':{'id':_0x459d1d['params']['id'],'UserId':null}})[_0xe29a('0x20')](handleEntityNotFound(_0x46b7e1,null))[_0xe29a('0x20')](saveUpdates(_0x459d1d['body'],null))['then'](function(_0x42b6ea){if(_0x42b6ea){_0x47eac6[_0xe29a('0x28')]=_0x42b6ea['get']({'plain':!![]});return db[_0xe29a('0x60')][_0xe29a('0x53')]({'where':{'id':_0x42b6ea[_0xe29a('0x61')]}});}return null;})[_0xe29a('0x20')](handleEntityNotFound(_0x46b7e1,null))[_0xe29a('0x20')](function(_0x5f434b){if(_0x5f434b){return _0x5f434b[_0xe29a('0x35')]({'UserId':_0x459d1d[_0xe29a('0x55')]['UserId'],'read1stAt':_[_0xe29a('0x62')](_0x5f434b['read1stAt'])?moment()[_0xe29a('0x5c')](_0xe29a('0x5d')):undefined});}return null;})['then'](function(_0x285ec0){if(_0x285ec0){_0x47eac6['interaction']=_0x285ec0[_0xe29a('0x63')]({'plain':!![]});interaction_log['info']('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x459d1d[_0xe29a('0x5f')]['id'],_0x459d1d[_0xe29a('0x5f')][_0xe29a('0x37')],_0x459d1d['user']['role'],_0x47eac6[_0xe29a('0x64')]['id'],_0x459d1d[_0xe29a('0x55')]?JSON[_0xe29a('0x26')](_0x459d1d['body']):'null');return respondWithRpcPromise(_0xe29a('0x65'),_0xe29a('0x66'),_0x47eac6);}return null;})[_0xe29a('0x20')](function(_0x50dae7){var _0x17f34c='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x50dae7[_0xe29a('0x28')][_0xe29a('0x67')];return db['sequelize'][_0xe29a('0x40')](_0x17f34c,{'type':db[_0xe29a('0x68')][_0xe29a('0x69')][_0xe29a('0x6a')],'raw':!![]})[_0xe29a('0x20')](function(_0x245fa6){return _0x245fa6;});})['then'](function(_0x1533fe){if(_0x1533fe){_0x47eac6[_0xe29a('0x28')][_0xe29a('0x6b')]=_0x1533fe[0x0];if(!_0x459d1d[_0xe29a('0x55')][_0xe29a('0x5e')])return;return db['User'][_0xe29a('0x53')]({'where':{'id':_0x459d1d[_0xe29a('0x55')][_0xe29a('0x5e')],'role':_0xe29a('0x6c')},'attributes':['id',_0xe29a('0x37'),_0xe29a('0x6d'),_0xe29a('0x6e'),_0xe29a('0x6f')],'raw':!![]});}return null;})[_0xe29a('0x20')](function(_0x507442){if(!_0x507442)return null;_0x47eac6[_0xe29a('0x28')][_0xe29a('0x6c')]=_0x507442;return _0x47eac6;})['then'](function(_0x5441da){if(_0x5441da){if(_0x459d1d[_0xe29a('0x55')][_0xe29a('0x70')]){_0x47eac6[_0xe29a('0x28')][_0xe29a('0x71')]=util['format']('SIP/%s',_0x459d1d[_0xe29a('0x5f')]['name']);_0x47eac6[_0xe29a('0x28')][_0xe29a('0x72')]=_0x47eac6[_0xe29a('0x72')];_0x47eac6['message'][_0xe29a('0x73')]=_0x47eac6['channel'];_0x47eac6[_0xe29a('0x28')][_0xe29a('0x74')]=_0xe29a('0x75');return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0x47eac6[_0xe29a('0x28')]},client9002)[_0xe29a('0x20')](function(){return _0x47eac6;});}return _0x47eac6;}return null;})[_0xe29a('0x20')](respondWithResult(_0x46b7e1,null))[_0xe29a('0x2a')](handleError(_0x46b7e1,null));};var interaction_log=require(_0xe29a('0x10'))(_0xe29a('0x59'));exports[_0xe29a('0x33')]=function(_0x4d828d,_0x44dc05,_0x4e45ad){var _0x241b61={'agent':{},'channel':_0xe29a('0x5a')};if(_0x4d828d[_0xe29a('0x55')]['id']){delete _0x4d828d[_0xe29a('0x55')]['id'];}_0x4d828d[_0xe29a('0x55')]['UserId']=_0x4d828d[_0xe29a('0x55')]['UserId']||_0x4d828d[_0xe29a('0x5f')]['id'];_0x241b61[_0xe29a('0x6c')]['id']=_0x4d828d[_0xe29a('0x55')][_0xe29a('0x5e')];return db[_0xe29a('0x3a')][_0xe29a('0x53')]({'where':{'id':_0x4d828d[_0xe29a('0x56')]['id'],'UserId':null}})[_0xe29a('0x20')](handleEntityNotFound(_0x44dc05,null))[_0xe29a('0x20')](function(_0x1965e3){if(_0x1965e3){_0x241b61['message']=_0x1965e3[_0xe29a('0x63')]({'plain':!![]});return db[_0xe29a('0x60')][_0xe29a('0x53')]({'where':{'id':_0x1965e3['OpenchannelInteractionId']}});}return null;})[_0xe29a('0x20')](handleEntityNotFound(_0x44dc05,null))['then'](function(_0x4353fa){if(_0x4353fa){_0x241b61[_0xe29a('0x64')]=_0x4353fa[_0xe29a('0x63')]({'plain':!![]});interaction_log['info'](_0xe29a('0x76'),_0x4d828d[_0xe29a('0x5f')]['id'],_0x4d828d[_0xe29a('0x5f')][_0xe29a('0x37')],_0x4d828d['user']['role'],_0x241b61[_0xe29a('0x64')]['id'],_0x4d828d[_0xe29a('0x55')]?JSON[_0xe29a('0x26')](_0x4d828d[_0xe29a('0x55')]):'null');return respondWithRpcPromise(_0xe29a('0x77'),'rejectMessage',_0x241b61);}return null;})['then'](function(_0x3f217c){var _0x186635=_0xe29a('0x78')+_0x3f217c[_0xe29a('0x28')][_0xe29a('0x67')];return db[_0xe29a('0x79')][_0xe29a('0x40')](_0x186635,{'type':db[_0xe29a('0x68')][_0xe29a('0x69')]['SELECT'],'raw':!![]})[_0xe29a('0x20')](function(_0x1e9b2d){return _0x1e9b2d;});})[_0xe29a('0x20')](function(_0x5ae89e){if(_0x5ae89e){_0x241b61[_0xe29a('0x28')][_0xe29a('0x6b')]=_0x5ae89e[0x0];if(!_0x4d828d[_0xe29a('0x55')]['UserId'])return;return db['User']['find']({'where':{'id':_0x4d828d[_0xe29a('0x55')]['UserId'],'role':_0xe29a('0x6c')},'attributes':['id',_0xe29a('0x37'),_0xe29a('0x6d'),_0xe29a('0x6e'),'internal'],'raw':!![]});}return null;})[_0xe29a('0x20')](function(_0x3bee88){if(!_0x3bee88)return null;_0x241b61[_0xe29a('0x28')]['agent']=_0x3bee88;return _0x241b61;})[_0xe29a('0x20')](function(_0x267bb7){if(_0x267bb7){_0x267bb7[_0xe29a('0x28')][_0xe29a('0x71')]=util['format']('SIP/%s',_0x4d828d[_0xe29a('0x5f')][_0xe29a('0x37')]);_0x267bb7[_0xe29a('0x28')][_0xe29a('0x72')]=_0x241b61[_0xe29a('0x72')];_0x267bb7[_0xe29a('0x28')]['motionChannel']=_0x241b61['channel'];_0x267bb7[_0xe29a('0x28')][_0xe29a('0x74')]='reject';respondWithRpcPromise('EventManager',_0xe29a('0x7a'),{'event':'rejectmessage','message':_0x267bb7[_0xe29a('0x28')]},client9002);return _0x241b61;}return null;})[_0xe29a('0x20')](respondWithResult(_0x44dc05,null))[_0xe29a('0x2a')](handleError(_0x44dc05,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index da24484..230ffd6 100644 --- a/server/api/openchannelMessage/openchannelMessage.events.js +++ b/server/api/openchannelMessage/openchannelMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeb39=['OpenchannelMessage','setMaxListeners','save','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x3a3525,_0x5bee02){var _0x56e306=function(_0x3b21fc){while(--_0x3b21fc){_0x3a3525['push'](_0x3a3525['shift']());}};_0x56e306(++_0x5bee02);}(_0xeb39,0x17e));var _0x9eb3=function(_0x555ebb,_0x4b1b68){_0x555ebb=_0x555ebb-0x0;var _0x3c0a4a=_0xeb39[_0x555ebb];return _0x3c0a4a;};'use strict';var EventEmitter=require(_0x9eb3('0x0'));var OpenchannelMessage=require(_0x9eb3('0x1'))['db'][_0x9eb3('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x9eb3('0x3')](0x0);var events={'afterCreate':_0x9eb3('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2f59c3){return function(_0x4e8850,_0x22a031,_0x384d0a){OpenchannelMessageEvents['emit'](_0x2f59c3+':'+_0x4e8850['id'],_0x4e8850);OpenchannelMessageEvents[_0x9eb3('0x5')](_0x2f59c3,_0x4e8850);_0x384d0a(null);};}for(var e in events){if(events[_0x9eb3('0x6')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x9eb3('0x7')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x9731=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','update','remove'];(function(_0x26db15,_0x50daec){var _0x31f013=function(_0x2b71fe){while(--_0x2b71fe){_0x26db15['push'](_0x26db15['shift']());}};_0x31f013(++_0x50daec);}(_0x9731,0x11b));var _0x1973=function(_0xfbc139,_0x4ac422){_0xfbc139=_0xfbc139-0x0;var _0x3467b2=_0x9731[_0xfbc139];return _0x3467b2;};'use strict';var EventEmitter=require(_0x1973('0x0'));var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x1973('0x1')](0x0);var events={'afterCreate':_0x1973('0x2'),'afterUpdate':_0x1973('0x3'),'afterDestroy':_0x1973('0x4')};function emitEvent(_0x2ddd31){return function(_0x2740e4,_0xc549a3,_0x44a614){OpenchannelMessageEvents[_0x1973('0x5')](_0x2ddd31+':'+_0x2740e4['id'],_0x2740e4);OpenchannelMessageEvents['emit'](_0x2ddd31,_0x2740e4);_0x44a614(null);};}for(var e in events){if(events[_0x1973('0x6')](e)){var event=events[e];OpenchannelMessage[_0x1973('0x7')](e,emitEvent(event));}}module[_0x1973('0x8')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 3ecbe8e..4622cb0 100644 --- a/server/api/openchannelMessage/openchannelMessage.model.js +++ b/server/api/openchannelMessage/openchannelMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdaf8=['Message\x20%d\x20forwarded\x20to\x20%s','threadId','update','afterCreate','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./openchannelMessage.attributes','exports','OpenchannelMessage','fti_openchannel_messages','FULLTEXT','get','direction','toLowerCase','secret','isNil','OpenchannelInteraction','findOne','then','createdAt','error','out','CmContact','describe','OpenchannelAccount','OpenchannelAccountId','Contact','keys','info','OpenchannelMessage,\x20%s,\x20%s','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','Interactions','length','Interaction','omit','POST','method','GET','body'];(function(_0x260dd2,_0xa0cfd4){var _0x2e9866=function(_0x323261){while(--_0x323261){_0x260dd2['push'](_0x260dd2['shift']());}};_0x2e9866(++_0xa0cfd4);}(_0xdaf8,0x18f));var _0x8daf=function(_0x14cbcc,_0x432324){_0x14cbcc=_0x14cbcc-0x0;var _0x37a788=_0xdaf8[_0x14cbcc];return _0x37a788;};'use strict';var _=require('lodash');var util=require(_0x8daf('0x0'));var logger=require(_0x8daf('0x1'))(_0x8daf('0x2'));var moment=require('moment');var BPromise=require(_0x8daf('0x3'));var rp=require(_0x8daf('0x4'));var fs=require('fs');var path=require(_0x8daf('0x5'));var rimraf=require('rimraf');var config=require(_0x8daf('0x6'));var attributes=require(_0x8daf('0x7'));module[_0x8daf('0x8')]=function(_0xf68eec,_0x4ec474){return _0xf68eec['define'](_0x8daf('0x9'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0x8daf('0xa'),'fields':['body'],'type':_0x8daf('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1631b1,_0x5e3306,_0x824e2c){var _0x6ab19d=_0xf68eec['models'];var _0x4b1af1=_0x1631b1[_0x8daf('0xc')]({'plain':!![]});if(_0x4b1af1[_0x8daf('0xd')][_0x8daf('0xe')]()==='in'||_0x4b1af1[_0x8daf('0xd')][_0x8daf('0xe')]()==='out'&&!_0x4b1af1[_0x8daf('0xf')]&&!_[_0x8daf('0x10')](_0x4b1af1['UserId'])){_0x6ab19d[_0x8daf('0x11')][_0x8daf('0x12')]({'where':{'id':_0x4b1af1['OpenchannelInteractionId']}})[_0x8daf('0x13')](function(_0x23c2e3){if(_0x23c2e3){_0x23c2e3['update']({'lastMsgAt':_0x4b1af1[_0x8daf('0x14')],'lastMsgDirection':_0x4b1af1['direction'][_0x8daf('0xe')]()});}})['catch'](function(_0x3ad191){console[_0x8daf('0x15')](_0x3ad191);});}if(_0x4b1af1['direction']===_0x8daf('0x16')&&!_0x4b1af1[_0x8daf('0xf')]){var _0x310909;_0x6ab19d[_0x8daf('0x17')][_0x8daf('0x18')]()[_0x8daf('0x13')](function(_0x5b16cc){return _0x6ab19d[_0x8daf('0x19')]['find']({'where':{'id':_0x4b1af1[_0x8daf('0x1a')]},'include':[{'model':_0x6ab19d['OpenchannelInteraction'],'as':'Interactions','where':{'id':_0x4b1af1['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x6ab19d[_0x8daf('0x17')],'as':_0x8daf('0x1b'),'attributes':_[_0x8daf('0x1c')](_0x5b16cc)}]}]});})[_0x8daf('0x13')](function(_0x222c24){_0x310909=_0x222c24[_0x8daf('0xc')]({'plain':!![]});if(_0x310909&&_0x310909['replyUri']){logger[_0x8daf('0x1d')](_0x8daf('0x1e'),'afterCreate',util[_0x8daf('0x1f')](_0x8daf('0x20'),_0x4b1af1['id'],_0x310909[_0x8daf('0x21')]));if(_0x310909['Interactions']&&_0x310909[_0x8daf('0x22')][_0x8daf('0x23')]){_0x4b1af1[_0x8daf('0x24')]=_[_0x8daf('0x25')](_0x310909['Interactions'][0x0],_0x8daf('0x1b'));_0x4b1af1['Contact']=_0x310909[_0x8daf('0x22')][0x0][_0x8daf('0x1b')];}var _0x5e3306={'method':_0x8daf('0x26'),'uri':encodeURI(_0x310909[_0x8daf('0x21')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x5e3306[_0x8daf('0x27')]){case _0x8daf('0x28'):_0x5e3306['qs']=_0x4b1af1;break;case _0x8daf('0x26'):_0x5e3306[_0x8daf('0x29')]=_0x4b1af1;break;}return rp(_0x5e3306)[_0x8daf('0x13')](function(_0x15a063){logger[_0x8daf('0x1d')](_0x8daf('0x1e'),'afterCreate',util['format'](_0x8daf('0x2a'),_0x4b1af1['id'],_0x310909[_0x8daf('0x21')]));if(_0x15a063[_0x8daf('0x29')][_0x8daf('0x2b')]&&_0x15a063['body'][_0x8daf('0x2b')]!=_0x4b1af1['Interaction'][_0x8daf('0x2b')]){return _0x6ab19d[_0x8daf('0x11')][_0x8daf('0x2c')]({'threadId':_0x15a063[_0x8daf('0x29')][_0x8daf('0x2b')]},{'where':{'id':_0x4b1af1[_0x8daf('0x24')]['id']}});}else{return;}})[_0x8daf('0x13')](function(){return _0x1631b1[_0x8daf('0x2c')]({'read':!![]});})['catch'](function(_0x15955a){logger['error'](_0x8daf('0x1e'),_0x8daf('0x2d'),util['inspect'](_0x15955a,{'showHidden':![],'depth':null}));_0x824e2c();});}else{_0x824e2c();}})[_0x8daf('0x2e')](function(){_0x824e2c();});}else{_0x824e2c();}}},'charset':_0x8daf('0x2f'),'collate':_0x8daf('0x30')});}; \ No newline at end of file +var _0x3e2d=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','body','FULLTEXT','toLowerCase','direction','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','createdAt','catch','error','secret','CmContact','OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','keys','get','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','length','omit','POST','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','update','inspect','finally','utf8mb4'];(function(_0x301b5a,_0x12cdbd){var _0x464ee0=function(_0x1c9997){while(--_0x1c9997){_0x301b5a['push'](_0x301b5a['shift']());}};_0x464ee0(++_0x12cdbd);}(_0x3e2d,0x1cc));var _0xd3e2=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x3e2d[_0x46698a];return _0x356db0;};'use strict';var _=require(_0xd3e2('0x0'));var util=require(_0xd3e2('0x1'));var logger=require(_0xd3e2('0x2'))(_0xd3e2('0x3'));var moment=require(_0xd3e2('0x4'));var BPromise=require(_0xd3e2('0x5'));var rp=require(_0xd3e2('0x6'));var fs=require('fs');var path=require(_0xd3e2('0x7'));var rimraf=require('rimraf');var config=require(_0xd3e2('0x8'));var attributes=require(_0xd3e2('0x9'));module[_0xd3e2('0xa')]=function(_0x13b7f9,_0x115186){return _0x13b7f9[_0xd3e2('0xb')](_0xd3e2('0xc'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0xd3e2('0xd')],'type':_0xd3e2('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x46ddcc,_0x34c160,_0x422680){var _0x43b3c6=_0x13b7f9['models'];var _0x44bac1=_0x46ddcc['get']({'plain':!![]});if(_0x44bac1['direction'][_0xd3e2('0xf')]()==='in'||_0x44bac1[_0xd3e2('0x10')][_0xd3e2('0xf')]()==='out'&&!_0x44bac1['secret']&&!_[_0xd3e2('0x11')](_0x44bac1[_0xd3e2('0x12')])){_0x43b3c6[_0xd3e2('0x13')][_0xd3e2('0x14')]({'where':{'id':_0x44bac1[_0xd3e2('0x15')]}})[_0xd3e2('0x16')](function(_0x258b1e){if(_0x258b1e){_0x258b1e['update']({'lastMsgAt':_0x44bac1[_0xd3e2('0x17')],'lastMsgDirection':_0x44bac1['direction'][_0xd3e2('0xf')]()});}})[_0xd3e2('0x18')](function(_0x1675fa){console[_0xd3e2('0x19')](_0x1675fa);});}if(_0x44bac1['direction']==='out'&&!_0x44bac1[_0xd3e2('0x1a')]){var _0x5a5bcd;_0x43b3c6[_0xd3e2('0x1b')]['describe']()['then'](function(_0x4dc650){return _0x43b3c6[_0xd3e2('0x1c')][_0xd3e2('0x1d')]({'where':{'id':_0x44bac1[_0xd3e2('0x1e')]},'include':[{'model':_0x43b3c6[_0xd3e2('0x13')],'as':_0xd3e2('0x1f'),'where':{'id':_0x44bac1['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x43b3c6[_0xd3e2('0x1b')],'as':_0xd3e2('0x20'),'attributes':_[_0xd3e2('0x21')](_0x4dc650)}]}]});})[_0xd3e2('0x16')](function(_0x4175d5){_0x5a5bcd=_0x4175d5[_0xd3e2('0x22')]({'plain':!![]});if(_0x5a5bcd&&_0x5a5bcd['replyUri']){logger[_0xd3e2('0x23')](_0xd3e2('0x24'),_0xd3e2('0x25'),util['format'](_0xd3e2('0x26'),_0x44bac1['id'],_0x5a5bcd[_0xd3e2('0x27')]));if(_0x5a5bcd[_0xd3e2('0x1f')]&&_0x5a5bcd[_0xd3e2('0x1f')][_0xd3e2('0x28')]){_0x44bac1['Interaction']=_[_0xd3e2('0x29')](_0x5a5bcd[_0xd3e2('0x1f')][0x0],_0xd3e2('0x20'));_0x44bac1[_0xd3e2('0x20')]=_0x5a5bcd[_0xd3e2('0x1f')][0x0][_0xd3e2('0x20')];}var _0x34c160={'method':_0xd3e2('0x2a'),'uri':encodeURI(_0x5a5bcd[_0xd3e2('0x27')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x34c160['method']){case'GET':_0x34c160['qs']=_0x44bac1;break;case'POST':_0x34c160[_0xd3e2('0xd')]=_0x44bac1;break;}return rp(_0x34c160)[_0xd3e2('0x16')](function(_0x2b21c6){logger[_0xd3e2('0x23')](_0xd3e2('0x24'),_0xd3e2('0x25'),util['format'](_0xd3e2('0x2b'),_0x44bac1['id'],_0x5a5bcd[_0xd3e2('0x27')]));if(_0x2b21c6[_0xd3e2('0xd')][_0xd3e2('0x2c')]&&_0x2b21c6[_0xd3e2('0xd')][_0xd3e2('0x2c')]!=_0x44bac1[_0xd3e2('0x2d')][_0xd3e2('0x2c')]){return _0x43b3c6[_0xd3e2('0x13')]['update']({'threadId':_0x2b21c6['body'][_0xd3e2('0x2c')]},{'where':{'id':_0x44bac1['Interaction']['id']}});}else{return;}})[_0xd3e2('0x16')](function(){return _0x46ddcc[_0xd3e2('0x2e')]({'read':!![]});})[_0xd3e2('0x18')](function(_0x19290f){logger[_0xd3e2('0x19')](_0xd3e2('0x24'),_0xd3e2('0x25'),util[_0xd3e2('0x2f')](_0x19290f,{'showHidden':![],'depth':null}));_0x422680();});}else{_0x422680();}})[_0xd3e2('0x30')](function(){_0x422680();});}else{_0x422680();}}},'charset':_0xd3e2('0x31'),'collate':_0xd3e2('0x32')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 6facdd0..aec385a 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['message','result','OpenchannelMessage','create','body','options','CreateOpenchannelMessage','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x4603d7,_0x223e5f){var _0x26818c=function(_0x5edf74){while(--_0x5edf74){_0x4603d7['push'](_0x4603d7['shift']());}};_0x26818c(++_0x223e5f);}(_0x0b0e,0x187));var _0xe0b0=function(_0x463697,_0xccfdc4){_0x463697=_0x463697-0x0;var _0x33cfe1=_0x0b0e[_0x463697];return _0x33cfe1;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});config[_0xe0b0('0xc')]=_['defaults'](config['redis'],{'host':_0xe0b0('0xd'),'port':0x18eb});var socket=require(_0xe0b0('0xe'))(new Redis(config[_0xe0b0('0xc')]));require(_0xe0b0('0xf'))['register'](socket);function respondWithRpcPromise(_0x338e7c,_0x1dd3b8,_0x553d4f){return new BPromise(function(_0x1fef28,_0x2f32b6){return client['request'](_0x338e7c,_0x553d4f)[_0xe0b0('0x10')](function(_0x2cdad2){logger[_0xe0b0('0x11')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,_0xe0b0('0x12'));logger[_0xe0b0('0x13')](_0xe0b0('0x14'),_0x1dd3b8,_0xe0b0('0x12'),JSON[_0xe0b0('0x15')](_0x2cdad2));if(_0x2cdad2['error']){if(_0x2cdad2[_0xe0b0('0x16')][_0xe0b0('0x17')]===0x1f4){logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2[_0xe0b0('0x16')]['message']);return _0x2f32b6(_0x2cdad2[_0xe0b0('0x16')]['message']);}logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2['error'][_0xe0b0('0x19')]);return _0x1fef28(_0x2cdad2['error'][_0xe0b0('0x19')]);}else{logger[_0xe0b0('0x11')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,'request\x20sent');_0x1fef28(_0x2cdad2[_0xe0b0('0x1a')]['message']);}})['catch'](function(_0x4bce65){logger[_0xe0b0('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,_0x4bce65);_0x2f32b6(_0x4bce65);});});}exports['CreateOpenchannelMessage']=function(_0x10cde1){var _0x59dff5=this;return new Promise(function(_0x472286,_0x5dba2f){return db[_0xe0b0('0x1b')][_0xe0b0('0x1c')](_0x10cde1[_0xe0b0('0x1d')],{'raw':_0x10cde1[_0xe0b0('0x1e')]?_0x10cde1[_0xe0b0('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2fa820){logger['info'](_0xe0b0('0x1f'),_0x10cde1);logger[_0xe0b0('0x13')]('CreateOpenchannelMessage',_0x10cde1,JSON[_0xe0b0('0x15')](_0x2fa820));_0x472286(_0x2fa820);})['catch'](function(_0x2208d0){logger['error'](_0xe0b0('0x1f'),_0x2208d0['message'],_0x10cde1);_0x5dba2f(_0x59dff5[_0xe0b0('0x16')](0x1f4,_0x2208d0['message']));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','body','options','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x4b6216,_0x280851){var _0x230512=function(_0x1283df){while(--_0x1283df){_0x4b6216['push'](_0x4b6216['shift']());}};_0x230512(++_0x280851);}(_0x7a54,0x106));var _0x47a5=function(_0x1ae32e,_0x49e0cd){_0x1ae32e=_0x1ae32e-0x0;var _0x5c094f=_0x7a54[_0x1ae32e];return _0x5c094f;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});config['redis']=_[_0x47a5('0xb')](config[_0x47a5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0xd'))(new Redis(config['redis']));require('./openchannelMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2a0e98,_0x2baee7,_0x5e31dd){return new BPromise(function(_0x2eb0dd,_0x49e844){return client['request'](_0x2a0e98,_0x5e31dd)[_0x47a5('0xe')](function(_0x69e4d4){logger[_0x47a5('0xf')](_0x47a5('0x10'),_0x2baee7,_0x47a5('0x11'));logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x2baee7,'request\x20sent',JSON[_0x47a5('0x14')](_0x69e4d4));if(_0x69e4d4[_0x47a5('0x15')]){if(_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x16')]===0x1f4){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x49e844(_0x69e4d4['error'][_0x47a5('0x17')]);}logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x2eb0dd(_0x69e4d4['error']['message']);}else{logger[_0x47a5('0xf')]('OpenchannelMessage,\x20%s,\x20%s',_0x2baee7,'request\x20sent');_0x2eb0dd(_0x69e4d4[_0x47a5('0x18')][_0x47a5('0x17')]);}})[_0x47a5('0x19')](function(_0x1ef371){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x1ef371);_0x49e844(_0x1ef371);});});}exports[_0x47a5('0x1a')]=function(_0xe3c618){var _0x3aed38=this;return new Promise(function(_0x4a9fcb,_0x1570bc){return db[_0x47a5('0x1b')]['create'](_0xe3c618[_0x47a5('0x1c')],{'raw':_0xe3c618[_0x47a5('0x1d')]?_0xe3c618[_0x47a5('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x47a5('0xe')](function(_0x2f142b){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xe3c618);logger['debug'](_0x47a5('0x1a'),_0xe3c618,JSON[_0x47a5('0x14')](_0x2f142b));_0x4a9fcb(_0x2f142b);})['catch'](function(_0x28747d){logger[_0x47a5('0x15')](_0x47a5('0x1a'),_0x28747d[_0x47a5('0x17')],_0xe3c618);_0x1570bc(_0x3aed38[_0x47a5('0x15')](0x1f4,_0x28747d['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index ee9b2eb..e61bb2b 100644 --- a/server/api/openchannelMessage/openchannelMessage.socket.js +++ b/server/api/openchannelMessage/openchannelMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc99e=['remove','update','emit','removeListener','register','./openchannelMessage.events','save'];(function(_0x42aa0a,_0x57286c){var _0x1150e4=function(_0x2c5ba7){while(--_0x2c5ba7){_0x42aa0a['push'](_0x42aa0a['shift']());}};_0x1150e4(++_0x57286c);}(_0xc99e,0x6e));var _0xec99=function(_0x3e782a,_0x36a31e){_0x3e782a=_0x3e782a-0x0;var _0x2c2d27=_0xc99e[_0x3e782a];return _0x2c2d27;};'use strict';var OpenchannelMessageEvents=require(_0xec99('0x0'));var events=[_0xec99('0x1'),_0xec99('0x2'),_0xec99('0x3')];function createListener(_0x22b65c,_0x41e155){return function(_0x4e3a66){_0x41e155[_0xec99('0x4')](_0x22b65c,_0x4e3a66);};}function removeListener(_0x4055ec,_0x111230){return function(){OpenchannelMessageEvents[_0xec99('0x5')](_0x4055ec,_0x111230);};}exports[_0xec99('0x6')]=function(_0x39821d){for(var _0x451dd4=0x0,_0x470d70=events['length'];_0x451dd4<_0x470d70;_0x451dd4++){var _0x797806=events[_0x451dd4];var _0x425a61=createListener('openchannelMessage:'+_0x797806,_0x39821d);OpenchannelMessageEvents['on'](_0x797806,_0x425a61);}}; \ No newline at end of file +var _0x5655=['./openchannelMessage.events','save','remove','update','removeListener','register','openchannelMessage:'];(function(_0x1f1931,_0x3bc51a){var _0x22bdef=function(_0x152a4f){while(--_0x152a4f){_0x1f1931['push'](_0x1f1931['shift']());}};_0x22bdef(++_0x3bc51a);}(_0x5655,0x15e));var _0x5565=function(_0x6fb3a7,_0xb522e6){_0x6fb3a7=_0x6fb3a7-0x0;var _0x4ddd27=_0x5655[_0x6fb3a7];return _0x4ddd27;};'use strict';var OpenchannelMessageEvents=require(_0x5565('0x0'));var events=[_0x5565('0x1'),_0x5565('0x2'),_0x5565('0x3')];function createListener(_0x42be35,_0x243782){return function(_0x5b1b44){_0x243782['emit'](_0x42be35,_0x5b1b44);};}function removeListener(_0x307c01,_0x58e4f5){return function(){OpenchannelMessageEvents[_0x5565('0x4')](_0x307c01,_0x58e4f5);};}exports[_0x5565('0x5')]=function(_0x37954f){for(var _0x93a8e5=0x0,_0x106d59=events['length'];_0x93a8e5<_0x106d59;_0x93a8e5++){var _0xc88d42=events[_0x93a8e5];var _0x2980c9=createListener(_0x5565('0x6')+_0xc88d42,_0x37954f);OpenchannelMessageEvents['on'](_0xc88d42,_0x2980c9);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 58bb946..5be13fe 100644 --- a/server/api/openchannelQueue/index.js +++ b/server/api/openchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x95a0=['update','destroy','delete','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','index','/describe','get','/:id','isAuthenticated','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','create','post','/:id/teams','addAgents'];(function(_0x116ff3,_0x3045f7){var _0x48d2f1=function(_0x7a67d5){while(--_0x7a67d5){_0x116ff3['push'](_0x116ff3['shift']());}};_0x48d2f1(++_0x3045f7);}(_0x95a0,0x17d));var _0x095a=function(_0x52dd35,_0x1cd3c6){_0x52dd35=_0x52dd35-0x0;var _0x49e084=_0x95a0[_0x52dd35];return _0x49e084;};'use strict';var multer=require(_0x095a('0x0'));var util=require(_0x095a('0x1'));var path=require(_0x095a('0x2'));var timeout=require(_0x095a('0x3'));var express=require(_0x095a('0x4'));var router=express[_0x095a('0x5')]();var fs_extra=require(_0x095a('0x6'));var auth=require(_0x095a('0x7'));var interaction=require(_0x095a('0x8'));var config=require('../../config/environment');var controller=require(_0x095a('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x095a('0xa')]);router['get'](_0x095a('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x095a('0xc')](_0x095a('0xd'),auth[_0x095a('0xe')](),controller[_0x095a('0xf')]);router[_0x095a('0xc')](_0x095a('0x10'),auth[_0x095a('0xe')](),controller[_0x095a('0x11')]);router[_0x095a('0xc')]('/:id/teams',auth['isAuthenticated'](),controller[_0x095a('0x12')]);router[_0x095a('0xc')](_0x095a('0x13'),auth[_0x095a('0xe')](),controller[_0x095a('0x14')]);router['post']('/',auth[_0x095a('0xe')](),controller[_0x095a('0x15')]);router[_0x095a('0x16')](_0x095a('0x17'),auth[_0x095a('0xe')](),controller['addTeams']);router[_0x095a('0x16')](_0x095a('0x13'),auth[_0x095a('0xe')](),controller[_0x095a('0x18')]);router['put']('/:id',auth[_0x095a('0xe')](),controller[_0x095a('0x19')]);router['delete'](_0x095a('0xd'),auth[_0x095a('0xe')](),controller[_0x095a('0x1a')]);router[_0x095a('0x1b')]('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router[_0x095a('0x1b')](_0x095a('0x13'),auth[_0x095a('0xe')](),controller[_0x095a('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x894c=['describe','/:id','isAuthenticated','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put','update','delete','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','index','get','/describe'];(function(_0xf2a1b5,_0x524119){var _0x915275=function(_0x2a3d02){while(--_0x2a3d02){_0xf2a1b5['push'](_0xf2a1b5['shift']());}};_0x915275(++_0x524119);}(_0x894c,0xb9));var _0xc894=function(_0x2e85c8,_0x11a2ea){_0x2e85c8=_0x2e85c8-0x0;var _0x477399=_0x894c[_0x2e85c8];return _0x477399;};'use strict';var multer=require(_0xc894('0x0'));var util=require(_0xc894('0x1'));var path=require(_0xc894('0x2'));var timeout=require(_0xc894('0x3'));var express=require(_0xc894('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc894('0x5'));var interaction=require(_0xc894('0x6'));var config=require('../../config/environment');var controller=require(_0xc894('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xc894('0x8')]);router[_0xc894('0x9')](_0xc894('0xa'),auth['isAuthenticated'](),controller[_0xc894('0xb')]);router[_0xc894('0x9')](_0xc894('0xc'),auth[_0xc894('0xd')](),controller['show']);router['get'](_0xc894('0xe'),auth['isAuthenticated'](),controller[_0xc894('0xf')]);router[_0xc894('0x9')](_0xc894('0x10'),auth[_0xc894('0xd')](),controller[_0xc894('0x11')]);router[_0xc894('0x9')](_0xc894('0x12'),auth['isAuthenticated'](),controller[_0xc894('0x13')]);router[_0xc894('0x14')]('/',auth['isAuthenticated'](),controller[_0xc894('0x15')]);router['post'](_0xc894('0x10'),auth[_0xc894('0xd')](),controller['addTeams']);router[_0xc894('0x14')](_0xc894('0x12'),auth['isAuthenticated'](),controller[_0xc894('0x16')]);router[_0xc894('0x17')]('/:id',auth['isAuthenticated'](),controller[_0xc894('0x18')]);router[_0xc894('0x19')](_0xc894('0xc'),auth[_0xc894('0xd')](),controller['destroy']);router[_0xc894('0x19')](_0xc894('0x10'),auth[_0xc894('0xd')](),controller['removeTeams']);router[_0xc894('0x19')]('/:id/users',auth[_0xc894('0xd')](),controller[_0xc894('0x1a')]);module[_0xc894('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 83530ed..09997bd 100644 --- a/server/api/openchannelQueue/openchannelQueue.attributes.js +++ b/server/api/openchannelQueue/openchannelQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9db4=['rrmemory','beepall','roundrobin','sequelize','exports','name','INTEGER'];(function(_0x4fcb8e,_0x37c2a8){var _0x56dde0=function(_0x470e49){while(--_0x470e49){_0x4fcb8e['push'](_0x4fcb8e['shift']());}};_0x56dde0(++_0x37c2a8);}(_0x9db4,0x153));var _0x49db=function(_0x1810a2,_0x5e5355){_0x1810a2=_0x1810a2-0x0;var _0x58e616=_0x9db4[_0x1810a2];return _0x58e616;};'use strict';var Sequelize=require(_0x49db('0x0'));module[_0x49db('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x49db('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x49db('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x49db('0x4'),_0x49db('0x5'),_0x49db('0x6'))}}; \ No newline at end of file +var _0xa879=['roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x2e07a1,_0x400515){var _0x96b646=function(_0x122a10){while(--_0x122a10){_0x2e07a1['push'](_0x2e07a1['shift']());}};_0x96b646(++_0x400515);}(_0xa879,0xd3));var _0x9a87=function(_0x4199b4,_0x4c1a97){_0x4199b4=_0x4199b4-0x0;var _0x2f0342=_0xa879[_0x4199b4];return _0x2f0342;};'use strict';var Sequelize=require(_0x9a87('0x0'));module[_0x9a87('0x1')]={'name':{'type':Sequelize[_0x9a87('0x2')],'unique':_0x9a87('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9a87('0x2')]},'timeout':{'type':Sequelize[_0x9a87('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall',_0x9a87('0x5'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 72e1b51..10f468f 100644 --- a/server/api/openchannelQueue/openchannelQueue.controller.js +++ b/server/api/openchannelQueue/openchannelQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf1db=['addTeams','each','forEach','emit','removeTeams','select','from','team_has_openchannel_queues','join','user_has_teams','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','removeAgents','addAgents','omit','spread','userOpenchannelQueue:save','userOpenchannelQueue:remove','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','update','then','destroy','get','OpenchannelQueues','UserProfileResource','error','name','map','rawAttributes','fieldName','type','key','getOptions','where','OpenchannelQueue','include','query','findAll','catch','show','keys','filters','intersection','model','attributes','fields','length','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','findOne','UserOpenchannelQueue','hasOwnProperty','order','sort','pick','OpenchannelQueueId','filter','merge','options','User','findAndCountAll','agent','openchannelPause','updatedAt','createdAt','rows','SIP','getTeams','Team','nolimit','ids','online','interface','flatMap','Agents','sequelize','transaction'];(function(_0x899b6a,_0x1c8b8e){var _0x3368f2=function(_0x538075){while(--_0x538075){_0x899b6a['push'](_0x899b6a['shift']());}};_0x3368f2(++_0x1c8b8e);}(_0xf1db,0x17e));var _0xbf1d=function(_0x4fe240,_0x25b6e8){_0x4fe240=_0x4fe240-0x0;var _0x314c67=_0xf1db[_0x4fe240];return _0x314c67;};'use strict';var BPromise=require(_0xbf1d('0x0'));var util=require(_0xbf1d('0x1'));var _=require(_0xbf1d('0x2'));var squel=require(_0xbf1d('0x3'));var Redis=require(_0xbf1d('0x4'));var qs=require(_0xbf1d('0x5'));var logger=require(_0xbf1d('0x6'))(_0xbf1d('0x7'));var config=require(_0xbf1d('0x8'));var db=require('../../mysqldb')['db'];config[_0xbf1d('0x9')]=_[_0xbf1d('0xa')](config['redis'],{'host':_0xbf1d('0xb'),'port':0x18eb});var socket=require(_0xbf1d('0xc'))(new Redis(config[_0xbf1d('0x9')]));require(_0xbf1d('0xd'))[_0xbf1d('0xe')](socket);function respondWithStatusCode(_0x108459,_0x1bddbd){_0x1bddbd=_0x1bddbd||0xcc;return function(_0x1c4eaf){if(_0x1c4eaf){return _0x108459[_0xbf1d('0xf')](_0x1bddbd);}return _0x108459['status'](_0x1bddbd)[_0xbf1d('0x10')]();};}function respondWithResult(_0xc8d56f,_0x1d6dfc){_0x1d6dfc=_0x1d6dfc||0xc8;return function(_0x13577d){if(_0x13577d){return _0xc8d56f[_0xbf1d('0x11')](_0x1d6dfc)['json'](_0x13577d);}};}function respondWithFilteredResult(_0x1ba347,_0x7d9db7){return function(_0x25c50e){if(_0x25c50e){var _0x4c07b9=typeof _0x7d9db7[_0xbf1d('0x12')]===_0xbf1d('0x13')&&typeof _0x7d9db7['limit']===_0xbf1d('0x13');var _0x4e0d57=_0x25c50e[_0xbf1d('0x14')];var _0x2f1391=_0x4c07b9?0x0:_0x7d9db7[_0xbf1d('0x12')];var _0x4f63ad=_0x4c07b9?_0x25c50e['count']:_0x7d9db7[_0xbf1d('0x12')]+_0x7d9db7[_0xbf1d('0x15')];var _0x2067b5;if(_0x4f63ad>=_0x4e0d57){_0x4f63ad=_0x4e0d57;_0x2067b5=0xc8;}else{_0x2067b5=0xce;}_0x1ba347[_0xbf1d('0x11')](_0x2067b5);return _0x1ba347[_0xbf1d('0x16')](_0xbf1d('0x17'),_0x2f1391+'-'+_0x4f63ad+'/'+_0x4e0d57)['json'](_0x25c50e);}return null;};}function saveUpdates(_0x386ffd){return function(_0x278544){if(_0x278544){return _0x278544[_0xbf1d('0x18')](_0x386ffd)[_0xbf1d('0x19')](function(_0x22e46a){return _0x22e46a;});}return null;};}function removeEntity(_0x2a4f4c){return function(_0xbf609f){if(_0xbf609f){return _0xbf609f[_0xbf1d('0x1a')]()[_0xbf1d('0x19')](function(){var _0x59cd42=_0xbf609f[_0xbf1d('0x1b')]({'plain':!![]});var _0x3cfed9=_0xbf1d('0x1c');return db[_0xbf1d('0x1d')][_0xbf1d('0x1a')]({'where':{'type':_0x3cfed9,'resourceId':_0x59cd42['id']}})['then'](function(){return _0xbf609f;});})['then'](function(){_0x2a4f4c[_0xbf1d('0x11')](0xcc)[_0xbf1d('0x10')]();});}};}function handleEntityNotFound(_0x373160){return function(_0x322d18){if(!_0x322d18){_0x373160['sendStatus'](0x194);}return _0x322d18;};}function handleError(_0xb55347,_0x4cd1bd){_0x4cd1bd=_0x4cd1bd||0x1f4;return function(_0x180d76){logger[_0xbf1d('0x1e')](_0x180d76['stack']);if(_0x180d76[_0xbf1d('0x1f')]){delete _0x180d76[_0xbf1d('0x1f')];}_0xb55347['status'](_0x4cd1bd)['send'](_0x180d76);};}exports['index']=function(_0x395ee5,_0x42d10e){var _0x8dc2ec={};var _0x4305d8={'count':0x0,'rows':[]};var _0x3696e1=_[_0xbf1d('0x20')](db['OpenchannelQueue'][_0xbf1d('0x21')],function(_0x27ead9){return{'name':_0x27ead9[_0xbf1d('0x22')],'type':_0x27ead9[_0xbf1d('0x23')][_0xbf1d('0x24')]};});_0x8dc2ec=qs[_0xbf1d('0x25')](_0x3696e1,_0x395ee5);var _0x495d72={'where':_0x8dc2ec[_0xbf1d('0x26')]};return db[_0xbf1d('0x27')]['count'](_0x495d72)[_0xbf1d('0x19')](function(_0x2d393a){_0x4305d8[_0xbf1d('0x14')]=_0x2d393a;_0x8dc2ec[_0xbf1d('0x28')]=qs[_0xbf1d('0x28')](_0x395ee5[_0xbf1d('0x29')]);return db[_0xbf1d('0x27')][_0xbf1d('0x2a')](_0x8dc2ec);})[_0xbf1d('0x19')](function(_0x7dafef){_0x4305d8['rows']=_0x7dafef;return _0x4305d8;})[_0xbf1d('0x19')](respondWithFilteredResult(_0x42d10e,_0x8dc2ec))[_0xbf1d('0x2b')](handleError(_0x42d10e,null));};exports[_0xbf1d('0x2c')]=function(_0x378f38,_0xb69307){var _0x168c88={'raw':!![],'where':{'id':_0x378f38['params']['id']}},_0x298731={};_0x298731['model']=_['keys'](db[_0xbf1d('0x27')]['rawAttributes']);_0x298731[_0xbf1d('0x29')]=_[_0xbf1d('0x2d')](_0x378f38[_0xbf1d('0x29')]);_0x298731[_0xbf1d('0x2e')]=_[_0xbf1d('0x2f')](_0x298731[_0xbf1d('0x30')],_0x298731[_0xbf1d('0x29')]);_0x168c88[_0xbf1d('0x31')]=_[_0xbf1d('0x2f')](_0x298731[_0xbf1d('0x30')],qs[_0xbf1d('0x32')](_0x378f38[_0xbf1d('0x29')][_0xbf1d('0x32')]));_0x168c88[_0xbf1d('0x31')]=_0x168c88[_0xbf1d('0x31')][_0xbf1d('0x33')]?_0x168c88[_0xbf1d('0x31')]:_0x298731['model'];if(_0x378f38[_0xbf1d('0x29')]['includeAll']){_0x168c88[_0xbf1d('0x28')]=[{'all':!![]}];}_0x168c88=_['merge']({},_0x168c88,_0x378f38['options']);return db['OpenchannelQueue']['find'](_0x168c88)[_0xbf1d('0x19')](handleEntityNotFound(_0xb69307,null))[_0xbf1d('0x19')](respondWithResult(_0xb69307,null))[_0xbf1d('0x2b')](handleError(_0xb69307,null));};exports[_0xbf1d('0x34')]=function(_0x4f68b6,_0x31b5b6){return db['OpenchannelQueue'][_0xbf1d('0x34')](_0x4f68b6[_0xbf1d('0x35')],{})[_0xbf1d('0x19')](function(_0x2894d1){var _0x54bbc4=_0x4f68b6['user']['get']({'plain':!![]});if(!_0x54bbc4)throw new Error(_0xbf1d('0x36'));if(_0x54bbc4[_0xbf1d('0x37')]==='user'){var _0x5a2b74=_0x2894d1[_0xbf1d('0x1b')]({'plain':!![]});var _0x2be319='OpenchannelQueues';return db[_0xbf1d('0x38')][_0xbf1d('0x39')]({'where':{'name':_0x2be319,'userProfileId':_0x54bbc4['userProfileId']},'raw':!![]})[_0xbf1d('0x19')](function(_0x57c018){if(_0x57c018&&_0x57c018[_0xbf1d('0x3a')]===0x0){return db[_0xbf1d('0x1d')]['create']({'name':_0x5a2b74[_0xbf1d('0x1f')],'resourceId':_0x5a2b74['id'],'type':_0x57c018[_0xbf1d('0x1f')],'sectionId':_0x57c018['id']},{})[_0xbf1d('0x19')](function(){return _0x2894d1;});}else{return _0x2894d1;}})['catch'](function(_0x3b89ff){logger[_0xbf1d('0x1e')](_0xbf1d('0x3b'),_0x3b89ff);throw _0x3b89ff;});}return _0x2894d1;})[_0xbf1d('0x19')](respondWithResult(_0x31b5b6,0xc9))['catch'](handleError(_0x31b5b6,null));};exports[_0xbf1d('0x18')]=function(_0x51d02a,_0x1fdac5){if(_0x51d02a['body']['id']){delete _0x51d02a[_0xbf1d('0x35')]['id'];}return db[_0xbf1d('0x27')][_0xbf1d('0x39')]({'where':{'id':_0x51d02a[_0xbf1d('0x3c')]['id']}})[_0xbf1d('0x19')](handleEntityNotFound(_0x1fdac5,null))[_0xbf1d('0x19')](saveUpdates(_0x51d02a['body'],null))[_0xbf1d('0x19')](respondWithResult(_0x1fdac5,null))[_0xbf1d('0x2b')](handleError(_0x1fdac5,null));};exports[_0xbf1d('0x1a')]=function(_0x1429d9,_0x5661ac){return db[_0xbf1d('0x27')][_0xbf1d('0x39')]({'where':{'id':_0x1429d9[_0xbf1d('0x3c')]['id']}})[_0xbf1d('0x19')](handleEntityNotFound(_0x5661ac,null))['then'](removeEntity(_0x5661ac,null))[_0xbf1d('0x2b')](handleError(_0x5661ac,null));};exports[_0xbf1d('0x3d')]=function(_0x37497d,_0x3915bc){return db[_0xbf1d('0x27')]['describe']()[_0xbf1d('0x19')](respondWithResult(_0x3915bc,null))[_0xbf1d('0x2b')](handleError(_0x3915bc,null));};exports['getMembers']=function(_0x4bcf0a,_0x3cb279){var _0x57a53b={'raw':!![],'where':{}},_0x5f5c23={},_0x3555a6;return db[_0xbf1d('0x27')][_0xbf1d('0x3e')]({'where':{'id':_0x4bcf0a[_0xbf1d('0x3c')]['id']}})[_0xbf1d('0x19')](handleEntityNotFound(_0x3cb279,null))[_0xbf1d('0x19')](function(_0x31fa41){if(_0x31fa41){_0x3555a6=_0x31fa41['get']({'plain':!![]});_0x5f5c23['model']=_[_0xbf1d('0x2d')](db[_0xbf1d('0x3f')][_0xbf1d('0x21')]);_0x5f5c23[_0xbf1d('0x29')]=_[_0xbf1d('0x2d')](_0x4bcf0a[_0xbf1d('0x29')]);_0x5f5c23[_0xbf1d('0x2e')]=_[_0xbf1d('0x2f')](_0x5f5c23[_0xbf1d('0x30')],_0x5f5c23['query']);_0x57a53b[_0xbf1d('0x31')]=_[_0xbf1d('0x2f')](_0x5f5c23[_0xbf1d('0x30')],qs[_0xbf1d('0x32')](_0x4bcf0a['query'][_0xbf1d('0x32')]));_0x57a53b[_0xbf1d('0x31')]=_0x57a53b['attributes'][_0xbf1d('0x33')]?_0x57a53b[_0xbf1d('0x31')]:_0x5f5c23[_0xbf1d('0x30')];if(!_0x4bcf0a[_0xbf1d('0x29')][_0xbf1d('0x40')]('nolimit')){_0x57a53b['limit']=qs['limit'](_0x4bcf0a[_0xbf1d('0x29')]['limit']);_0x57a53b[_0xbf1d('0x12')]=qs['offset'](_0x4bcf0a[_0xbf1d('0x29')][_0xbf1d('0x12')]);}_0x57a53b[_0xbf1d('0x41')]=qs['sort'](_0x4bcf0a[_0xbf1d('0x29')][_0xbf1d('0x42')]);_0x57a53b[_0xbf1d('0x26')]=qs[_0xbf1d('0x2e')](_[_0xbf1d('0x43')](_0x4bcf0a[_0xbf1d('0x29')],_0x5f5c23['filters']));_0x57a53b[_0xbf1d('0x26')][_0xbf1d('0x44')]=_0x31fa41['id'];if(_0x4bcf0a['query'][_0xbf1d('0x45')]){_0x57a53b[_0xbf1d('0x26')]=_[_0xbf1d('0x46')](_0x57a53b[_0xbf1d('0x26')],{'$or':_[_0xbf1d('0x20')](_0x57a53b[_0xbf1d('0x31')],function(_0x4a0bfe){var _0x25b457={};_0x25b457[_0x4a0bfe]={'$like':'%'+_0x4bcf0a[_0xbf1d('0x29')][_0xbf1d('0x45')]+'%'};return _0x25b457;})});}_0x57a53b=_[_0xbf1d('0x46')]({},_0x57a53b,_0x4bcf0a[_0xbf1d('0x47')]);return db['UserOpenchannelQueue'][_0xbf1d('0x2a')](_0x57a53b);}})[_0xbf1d('0x19')](function(_0x5eaf3c){if(_0x5eaf3c){return db[_0xbf1d('0x48')][_0xbf1d('0x49')]({'where':{'id':_[_0xbf1d('0x20')](_0x5eaf3c,'UserId'),'role':_0xbf1d('0x4a')},'attributes':['id','name',_0xbf1d('0x4b'),_0xbf1d('0x4c'),_0xbf1d('0x4d')]});}})[_0xbf1d('0x19')](function(_0x45691e){if(_0x45691e){return{'count':_0x45691e[_0xbf1d('0x14')],'rows':_[_0xbf1d('0x20')](_0x45691e[_0xbf1d('0x4e')],function(_0x18f732){return{'membername':_0x18f732[_0xbf1d('0x1f')],'UserId':_0x18f732['id'],'queue_name':_0x3555a6['name'],'OpenchannelQueueId':_0x3555a6['id'],'interface':util['format']('%s/%s',_0xbf1d('0x4f'),_0x18f732[_0xbf1d('0x1f')]),'penalty':0x0,'paused':_0x18f732[_0xbf1d('0x4b')],'createdAt':_0x18f732['createdAt'],'updatedAt':_0x18f732[_0xbf1d('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xbf1d('0x19')](respondWithFilteredResult(_0x3cb279,_0x57a53b))['catch'](handleError(_0x3cb279,null));};exports[_0xbf1d('0x50')]=function(_0x2dc41c,_0x51221a){var _0x270d6b={};var _0x582db7={};var _0x7ee8f;var _0x3132e9;return db[_0xbf1d('0x27')][_0xbf1d('0x3e')]({'where':{'id':_0x2dc41c[_0xbf1d('0x3c')]['id']}})[_0xbf1d('0x19')](handleEntityNotFound(_0x51221a,null))['then'](function(_0x5870ac){if(_0x5870ac){_0x7ee8f=_0x5870ac;_0x582db7[_0xbf1d('0x30')]=_['keys'](db[_0xbf1d('0x51')][_0xbf1d('0x21')]);_0x582db7[_0xbf1d('0x29')]=_[_0xbf1d('0x2d')](_0x2dc41c[_0xbf1d('0x29')]);_0x582db7[_0xbf1d('0x2e')]=_['intersection'](_0x582db7[_0xbf1d('0x30')],_0x582db7[_0xbf1d('0x29')]);_0x270d6b[_0xbf1d('0x31')]=_[_0xbf1d('0x2f')](_0x582db7[_0xbf1d('0x30')],qs[_0xbf1d('0x32')](_0x2dc41c['query'][_0xbf1d('0x32')]));_0x270d6b['attributes']=_0x270d6b[_0xbf1d('0x31')][_0xbf1d('0x33')]?_0x270d6b[_0xbf1d('0x31')]:_0x582db7[_0xbf1d('0x30')];_0x270d6b[_0xbf1d('0x41')]=qs['sort'](_0x2dc41c[_0xbf1d('0x29')][_0xbf1d('0x42')]);_0x270d6b[_0xbf1d('0x26')]=qs['filters'](_['pick'](_0x2dc41c[_0xbf1d('0x29')],_0x582db7[_0xbf1d('0x2e')]));if(_0x2dc41c['query'][_0xbf1d('0x45')]){_0x270d6b[_0xbf1d('0x26')]=_[_0xbf1d('0x46')](_0x270d6b[_0xbf1d('0x26')],{'$or':_[_0xbf1d('0x20')](_0x270d6b[_0xbf1d('0x31')],function(_0x25ccc9){var _0x7a37bd={};_0x7a37bd[_0x25ccc9]={'$like':'%'+_0x2dc41c['query'][_0xbf1d('0x45')]+'%'};return _0x7a37bd;})});}_0x270d6b=_[_0xbf1d('0x46')]({},_0x270d6b,_0x2dc41c[_0xbf1d('0x47')]);return _0x7ee8f[_0xbf1d('0x50')](_0x270d6b);}})['then'](function(_0x117b88){if(_0x117b88){_0x3132e9=_0x117b88[_0xbf1d('0x33')];if(!_0x2dc41c[_0xbf1d('0x29')][_0xbf1d('0x40')](_0xbf1d('0x52'))){_0x270d6b['limit']=qs['limit'](_0x2dc41c[_0xbf1d('0x29')][_0xbf1d('0x15')]);_0x270d6b[_0xbf1d('0x12')]=qs[_0xbf1d('0x12')](_0x2dc41c['query'][_0xbf1d('0x12')]);}return _0x7ee8f[_0xbf1d('0x50')](_0x270d6b);}})['then'](function(_0x507ffa){if(_0x507ffa){return _0x507ffa?{'count':_0x3132e9,'rows':_0x507ffa}:null;}})[_0xbf1d('0x19')](respondWithResult(_0x51221a,null))[_0xbf1d('0x2b')](handleError(_0x51221a,null));};exports['addTeams']=function(_0x1a3b85,_0x592311){var _0x31f944=_0x1a3b85[_0xbf1d('0x35')][_0xbf1d('0x53')];return db['Team'][_0xbf1d('0x2a')]({'where':{'id':_0x31f944},'attributes':['id'],'include':[{'model':db[_0xbf1d('0x48')],'as':'Agents','attributes':['id',_0xbf1d('0x1f'),_0xbf1d('0x54'),'voicePause',_0xbf1d('0x55')],'raw':!![]}]})[_0xbf1d('0x19')](function(_0x5bdd47){if(_0x5bdd47){var _0x129a00=_[_0xbf1d('0x56')](_0x5bdd47,function(_0x1561f1){var _0x409d27=_0x1561f1[_0xbf1d('0x1b')]({'plain':!![]});return _0x409d27[_0xbf1d('0x57')];});return db['OpenchannelQueue'][_0xbf1d('0x39')]({'where':{'id':_0x1a3b85[_0xbf1d('0x3c')]['id']}})['then'](function(_0x30b108){return db[_0xbf1d('0x58')][_0xbf1d('0x59')](function(_0x5aca91){return _0x30b108[_0xbf1d('0x5a')](_0x31f944,{'transaction':_0x5aca91})[_0xbf1d('0x19')](function(){return BPromise[_0xbf1d('0x5b')](_0x129a00,function(_0x12b0d2){return db[_0xbf1d('0x3f')]['findOrCreate']({'where':{'UserId':_0x12b0d2['id'],'OpenchannelQueueId':_0x1a3b85[_0xbf1d('0x3c')]['id']},'transaction':_0x5aca91});});})[_0xbf1d('0x19')](function(){_0x129a00[_0xbf1d('0x5c')](function(_0x267e52){socket[_0xbf1d('0x5d')]('userOpenchannelQueue:save',{'UserId':_0x267e52['id'],'OpenchannelQueueId':_0x30b108['id']});});});});});}})[_0xbf1d('0x19')](respondWithStatusCode(_0x592311,null))[_0xbf1d('0x2b')](handleError(_0x592311,null));};exports[_0xbf1d('0x5e')]=function(_0x1df594,_0x4ced99){return db[_0xbf1d('0x51')][_0xbf1d('0x2a')]({'where':{'id':_0x1df594['query'][_0xbf1d('0x53')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xbf1d('0x57'),'attributes':['id'],'raw':!![]}]})[_0xbf1d('0x19')](handleEntityNotFound(_0x4ced99,null))[_0xbf1d('0x19')](function(_0x4b2c28){var _0x3330d6=_[_0xbf1d('0x20')](_0x4b2c28,'id');var _0x5bd2d6=[];var _0x4ff40e=[];var _0x2c295f=squel[_0xbf1d('0x5f')]();_0x2c295f['field']('tq.TeamId')[_0xbf1d('0x60')](_0xbf1d('0x61'),'tq')[_0xbf1d('0x62')](_0xbf1d('0x63'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xbf1d('0x26')]('OpenchannelQueueId\x20=\x20?',_0x1df594[_0xbf1d('0x3c')]['id']);for(var _0x196f2e=0x0;_0x196f2e<_0x4b2c28['length'];_0x196f2e+=0x1){let _0x132090=_0x4b2c28[_0x196f2e];for(var _0x5f49f1=0x0;_0x5f49f1<_0x132090['Agents'][_0xbf1d('0x33')];_0x5f49f1+=0x1){let _0x103341=_0x132090[_0xbf1d('0x57')][_0x5f49f1];var _0x148528=_0x2c295f['clone']();_0x148528[_0xbf1d('0x26')](_0xbf1d('0x64'),_0x103341['id']);_0x4ff40e[_0xbf1d('0x65')](db[_0xbf1d('0x58')][_0xbf1d('0x29')](_0x148528[_0xbf1d('0x66')](),{'type':db[_0xbf1d('0x58')][_0xbf1d('0x67')]['SELECT']})[_0xbf1d('0x19')](function(_0x6f7a58){if(_0x6f7a58[_0xbf1d('0x33')]===0x1){return _0x103341['id'];}else{var _0x1ee0fd=_[_0xbf1d('0x68')](_[_0xbf1d('0x20')](_0x6f7a58,_0xbf1d('0x69')),function(_0x3dcaf8){return _[_0xbf1d('0x6a')](_0x3330d6,_0x3dcaf8);});if(_0x1ee0fd){return _0x103341['id'];}}}));}}return BPromise[_0xbf1d('0x6b')](_0x4ff40e)['then'](function(_0x3ae240){_0x5bd2d6=_(_0x5bd2d6)[_0xbf1d('0x6c')](_0x3ae240)[_0xbf1d('0x6d')]()[_0xbf1d('0x6e')]();return db['OpenchannelQueue'][_0xbf1d('0x39')]({'where':{'id':_0x1df594[_0xbf1d('0x3c')]['id']}})[_0xbf1d('0x19')](function(_0x2d7763){return db[_0xbf1d('0x58')][_0xbf1d('0x59')](function(_0x2e8b4f){return _0x2d7763['removeTeams'](_0x1df594[_0xbf1d('0x29')][_0xbf1d('0x53')],{'transaction':_0x2e8b4f})[_0xbf1d('0x19')](function(){if(!_['isEmpty'](_0x5bd2d6)){return _0x2d7763[_0xbf1d('0x6f')](_0x5bd2d6,{'transaction':_0x2e8b4f});}})[_0xbf1d('0x19')](function(){_0x5bd2d6[_0xbf1d('0x5c')](function(_0x497548){socket[_0xbf1d('0x5d')]('userOpenchannelQueue:remove',{'UserId':_0x497548,'OpenchannelQueueId':_0x2d7763['id']});});});});});});})[_0xbf1d('0x19')](respondWithStatusCode(_0x4ced99,null))['catch'](handleError(_0x4ced99,null));};exports['addAgents']=function(_0x355907,_0x42a6a1){return db['OpenchannelQueue']['find']({'where':{'id':_0x355907[_0xbf1d('0x3c')]['id']}})[_0xbf1d('0x19')](handleEntityNotFound(_0x42a6a1,null))[_0xbf1d('0x19')](function(_0x2ae11e){if(_0x2ae11e){return _0x2ae11e[_0xbf1d('0x70')](_0x355907['body'][_0xbf1d('0x53')],_[_0xbf1d('0x71')](_0x355907[_0xbf1d('0x35')],[_0xbf1d('0x53'),'id'])||{})[_0xbf1d('0x72')](function(_0xb8d953){for(var _0x2485bf=0x0;_0x2485bf<_0x355907[_0xbf1d('0x35')][_0xbf1d('0x53')][_0xbf1d('0x33')];_0x2485bf+=0x1){socket[_0xbf1d('0x5d')](_0xbf1d('0x73'),{'UserId':Number(_0x355907[_0xbf1d('0x35')][_0xbf1d('0x53')][_0x2485bf]),'OpenchannelQueueId':Number(_0x355907[_0xbf1d('0x3c')]['id'])});}return _0xb8d953;});}})['then'](respondWithResult(_0x42a6a1,null))[_0xbf1d('0x2b')](handleError(_0x42a6a1,null));};exports[_0xbf1d('0x6f')]=function(_0x5e9de2,_0x3f8f31){return db[_0xbf1d('0x27')][_0xbf1d('0x39')]({'where':{'id':_0x5e9de2[_0xbf1d('0x3c')]['id']}})[_0xbf1d('0x19')](handleEntityNotFound(_0x3f8f31,null))[_0xbf1d('0x19')](function(_0x36c290){if(_0x36c290){return _0x36c290['removeAgents'](_0x5e9de2[_0xbf1d('0x29')][_0xbf1d('0x53')])['then'](function(){if(_['isArray'](_0x5e9de2[_0xbf1d('0x29')]['ids'])){for(var _0x497643=0x0;_0x497643<_0x5e9de2['query'][_0xbf1d('0x53')][_0xbf1d('0x33')];_0x497643+=0x1){socket[_0xbf1d('0x5d')](_0xbf1d('0x74'),{'UserId':Number(_0x5e9de2[_0xbf1d('0x29')][_0xbf1d('0x53')][_0x497643]),'OpenchannelQueueId':Number(_0x5e9de2[_0xbf1d('0x3c')]['id'])});}}else{socket[_0xbf1d('0x5d')]('userOpenchannelQueue:remove',{'UserId':Number(_0x5e9de2['query'][_0xbf1d('0x53')]),'OpenchannelQueueId':Number(_0x5e9de2[_0xbf1d('0x3c')]['id'])});}});}})[_0xbf1d('0x19')](respondWithStatusCode(_0x3f8f31,null))[_0xbf1d('0x2b')](handleError(_0x3f8f31,null));};exports[_0xbf1d('0x75')]=function(_0x21baf7,_0x16d150){var _0x35c8ad={};var _0x4d2930={};var _0x327438;var _0x56ebd6;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x21baf7[_0xbf1d('0x3c')]['id']}})[_0xbf1d('0x19')](handleEntityNotFound(_0x16d150,null))['then'](function(_0x2f6063){if(_0x2f6063){_0x327438=_0x2f6063;_0x4d2930[_0xbf1d('0x30')]=_['keys'](db[_0xbf1d('0x48')][_0xbf1d('0x21')]);_0x4d2930[_0xbf1d('0x29')]=_['keys'](_0x21baf7[_0xbf1d('0x29')]);_0x4d2930[_0xbf1d('0x2e')]=_[_0xbf1d('0x2f')](_0x4d2930[_0xbf1d('0x30')],_0x4d2930[_0xbf1d('0x29')]);_0x35c8ad['attributes']=_[_0xbf1d('0x2f')](_0x4d2930['model'],qs[_0xbf1d('0x32')](_0x21baf7[_0xbf1d('0x29')][_0xbf1d('0x32')]));_0x35c8ad[_0xbf1d('0x31')]=_0x35c8ad[_0xbf1d('0x31')][_0xbf1d('0x33')]?_0x35c8ad['attributes']:_0x4d2930[_0xbf1d('0x30')];_0x35c8ad[_0xbf1d('0x41')]=qs[_0xbf1d('0x42')](_0x21baf7[_0xbf1d('0x29')][_0xbf1d('0x42')]);_0x35c8ad['where']=qs[_0xbf1d('0x2e')](_['pick'](_0x21baf7['query'],_0x4d2930[_0xbf1d('0x2e')]));if(_0x21baf7[_0xbf1d('0x29')][_0xbf1d('0x45')]){_0x35c8ad[_0xbf1d('0x26')]=_['merge'](_0x35c8ad[_0xbf1d('0x26')],{'$or':_[_0xbf1d('0x20')](_0x35c8ad[_0xbf1d('0x31')],function(_0x3c6510){var _0x26cc9b={};_0x26cc9b[_0x3c6510]={'$like':'%'+_0x21baf7[_0xbf1d('0x29')][_0xbf1d('0x45')]+'%'};return _0x26cc9b;})});}_0x35c8ad=_[_0xbf1d('0x46')]({},_0x35c8ad,_0x21baf7[_0xbf1d('0x47')]);return _0x327438[_0xbf1d('0x75')](_0x35c8ad);}})['then'](function(_0x4dffdc){if(_0x4dffdc){_0x56ebd6=_0x4dffdc['length'];if(!_0x21baf7[_0xbf1d('0x29')][_0xbf1d('0x40')]('nolimit')){_0x35c8ad[_0xbf1d('0x15')]=qs['limit'](_0x21baf7[_0xbf1d('0x29')][_0xbf1d('0x15')]);_0x35c8ad['offset']=qs['offset'](_0x21baf7[_0xbf1d('0x29')][_0xbf1d('0x12')]);}return _0x327438[_0xbf1d('0x75')](_0x35c8ad);}})[_0xbf1d('0x19')](function(_0x48b929){if(_0x48b929){return _0x48b929?{'count':_0x56ebd6,'rows':_0x48b929}:null;}})[_0xbf1d('0x19')](respondWithResult(_0x16d150,null))[_0xbf1d('0x2b')](handleError(_0x16d150,null));}; \ No newline at end of file +var _0x332b=['include','query','findAll','rows','catch','show','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','update','params','describe','getMembers','findOne','UserOpenchannelQueue','rawAttributes','hasOwnProperty','nolimit','order','sort','pick','OpenchannelQueueId','filter','findAndCountAll','agent','openchannelPause','updatedAt','createdAt','format','SIP','Team','getTeams','addTeams','ids','Agents','online','voicePause','flatMap','transaction','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','User','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','SELECT','includes','union','compact','value','isEmpty','userOpenchannelQueue:remove','addAgents','spread','removeAgents','isArray','getAgents','util','lodash','squel','ioredis','../../config/logger','api','defaults','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','json','undefined','limit','offset','set','Content-Range','then','destroy','OpenchannelQueues','UserProfileResource','stack','name','send','index','map','fieldName','key','getOptions','where','OpenchannelQueue','count'];(function(_0xe91676,_0x3cd3de){var _0x2838ae=function(_0x44a81d){while(--_0x44a81d){_0xe91676['push'](_0xe91676['shift']());}};_0x2838ae(++_0x3cd3de);}(_0x332b,0x1c1));var _0xb332=function(_0x3408c9,_0x93f42b){_0x3408c9=_0x3408c9-0x0;var _0x5a4977=_0x332b[_0x3408c9];return _0x5a4977;};'use strict';var BPromise=require('bluebird');var util=require(_0xb332('0x0'));var _=require(_0xb332('0x1'));var squel=require(_0xb332('0x2'));var Redis=require(_0xb332('0x3'));var qs=require('../../components/parsers/qs');var logger=require(_0xb332('0x4'))(_0xb332('0x5'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0xb332('0x6')](config[_0xb332('0x7')],{'host':_0xb332('0x8'),'port':0x18eb});var socket=require(_0xb332('0x9'))(new Redis(config['redis']));require(_0xb332('0xa'))[_0xb332('0xb')](socket);function respondWithStatusCode(_0x424909,_0x32aed8){_0x32aed8=_0x32aed8||0xcc;return function(_0x22b5be){if(_0x22b5be){return _0x424909[_0xb332('0xc')](_0x32aed8);}return _0x424909[_0xb332('0xd')](_0x32aed8)['end']();};}function respondWithResult(_0x3af674,_0x5be787){_0x5be787=_0x5be787||0xc8;return function(_0x225652){if(_0x225652){return _0x3af674[_0xb332('0xd')](_0x5be787)[_0xb332('0xe')](_0x225652);}};}function respondWithFilteredResult(_0x25b3ec,_0x339979){return function(_0x10e2ec){if(_0x10e2ec){var _0x16f06e=typeof _0x339979['offset']===_0xb332('0xf')&&typeof _0x339979[_0xb332('0x10')]==='undefined';var _0x577468=_0x10e2ec['count'];var _0x1cfd89=_0x16f06e?0x0:_0x339979[_0xb332('0x11')];var _0x5ee6d4=_0x16f06e?_0x10e2ec['count']:_0x339979[_0xb332('0x11')]+_0x339979[_0xb332('0x10')];var _0x38118c;if(_0x5ee6d4>=_0x577468){_0x5ee6d4=_0x577468;_0x38118c=0xc8;}else{_0x38118c=0xce;}_0x25b3ec['status'](_0x38118c);return _0x25b3ec[_0xb332('0x12')](_0xb332('0x13'),_0x1cfd89+'-'+_0x5ee6d4+'/'+_0x577468)['json'](_0x10e2ec);}return null;};}function saveUpdates(_0x3edd20){return function(_0x5b0314){if(_0x5b0314){return _0x5b0314['update'](_0x3edd20)[_0xb332('0x14')](function(_0x3075ca){return _0x3075ca;});}return null;};}function removeEntity(_0x12255f){return function(_0x29142c){if(_0x29142c){return _0x29142c[_0xb332('0x15')]()[_0xb332('0x14')](function(){var _0x370992=_0x29142c['get']({'plain':!![]});var _0x3fcead=_0xb332('0x16');return db[_0xb332('0x17')][_0xb332('0x15')]({'where':{'type':_0x3fcead,'resourceId':_0x370992['id']}})[_0xb332('0x14')](function(){return _0x29142c;});})[_0xb332('0x14')](function(){_0x12255f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x56307c){return function(_0x761990){if(!_0x761990){_0x56307c['sendStatus'](0x194);}return _0x761990;};}function handleError(_0x47baf6,_0xf48c41){_0xf48c41=_0xf48c41||0x1f4;return function(_0x4898f1){logger['error'](_0x4898f1[_0xb332('0x18')]);if(_0x4898f1['name']){delete _0x4898f1[_0xb332('0x19')];}_0x47baf6[_0xb332('0xd')](_0xf48c41)[_0xb332('0x1a')](_0x4898f1);};}exports[_0xb332('0x1b')]=function(_0x42cee0,_0xd25beb){var _0x46fced={};var _0x144dcd={'count':0x0,'rows':[]};var _0x40b5dd=_[_0xb332('0x1c')](db['OpenchannelQueue']['rawAttributes'],function(_0x2e3d36){return{'name':_0x2e3d36[_0xb332('0x1d')],'type':_0x2e3d36['type'][_0xb332('0x1e')]};});_0x46fced=qs[_0xb332('0x1f')](_0x40b5dd,_0x42cee0);var _0x185a25={'where':_0x46fced[_0xb332('0x20')]};return db[_0xb332('0x21')][_0xb332('0x22')](_0x185a25)[_0xb332('0x14')](function(_0xcc7b6f){_0x144dcd['count']=_0xcc7b6f;_0x46fced['include']=qs[_0xb332('0x23')](_0x42cee0[_0xb332('0x24')]);return db[_0xb332('0x21')][_0xb332('0x25')](_0x46fced);})['then'](function(_0x1cc2cc){_0x144dcd[_0xb332('0x26')]=_0x1cc2cc;return _0x144dcd;})[_0xb332('0x14')](respondWithFilteredResult(_0xd25beb,_0x46fced))[_0xb332('0x27')](handleError(_0xd25beb,null));};exports[_0xb332('0x28')]=function(_0x4fcd09,_0x369e13){var _0x169d29={'raw':!![],'where':{'id':_0x4fcd09['params']['id']}},_0x130230={};_0x130230[_0xb332('0x29')]=_['keys'](db[_0xb332('0x21')]['rawAttributes']);_0x130230[_0xb332('0x24')]=_[_0xb332('0x2a')](_0x4fcd09['query']);_0x130230[_0xb332('0x2b')]=_[_0xb332('0x2c')](_0x130230[_0xb332('0x29')],_0x130230[_0xb332('0x24')]);_0x169d29[_0xb332('0x2d')]=_[_0xb332('0x2c')](_0x130230['model'],qs[_0xb332('0x2e')](_0x4fcd09[_0xb332('0x24')][_0xb332('0x2e')]));_0x169d29['attributes']=_0x169d29[_0xb332('0x2d')][_0xb332('0x2f')]?_0x169d29[_0xb332('0x2d')]:_0x130230['model'];if(_0x4fcd09[_0xb332('0x24')][_0xb332('0x30')]){_0x169d29[_0xb332('0x23')]=[{'all':!![]}];}_0x169d29=_[_0xb332('0x31')]({},_0x169d29,_0x4fcd09[_0xb332('0x32')]);return db[_0xb332('0x21')][_0xb332('0x33')](_0x169d29)['then'](handleEntityNotFound(_0x369e13,null))[_0xb332('0x14')](respondWithResult(_0x369e13,null))[_0xb332('0x27')](handleError(_0x369e13,null));};exports[_0xb332('0x34')]=function(_0x46d672,_0x51b297){return db['OpenchannelQueue'][_0xb332('0x34')](_0x46d672[_0xb332('0x35')],{})['then'](function(_0x1bef22){var _0x29cc1c=_0x46d672['user'][_0xb332('0x36')]({'plain':!![]});if(!_0x29cc1c)throw new Error(_0xb332('0x37'));if(_0x29cc1c[_0xb332('0x38')]===_0xb332('0x39')){var _0x10b99a=_0x1bef22[_0xb332('0x36')]({'plain':!![]});var _0x2359c7=_0xb332('0x16');return db[_0xb332('0x3a')][_0xb332('0x33')]({'where':{'name':_0x2359c7,'userProfileId':_0x29cc1c[_0xb332('0x3b')]},'raw':!![]})[_0xb332('0x14')](function(_0x1e3e95){if(_0x1e3e95&&_0x1e3e95[_0xb332('0x3c')]===0x0){return db[_0xb332('0x17')][_0xb332('0x34')]({'name':_0x10b99a['name'],'resourceId':_0x10b99a['id'],'type':_0x1e3e95[_0xb332('0x19')],'sectionId':_0x1e3e95['id']},{})[_0xb332('0x14')](function(){return _0x1bef22;});}else{return _0x1bef22;}})[_0xb332('0x27')](function(_0x465fc4){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x465fc4);throw _0x465fc4;});}return _0x1bef22;})[_0xb332('0x14')](respondWithResult(_0x51b297,0xc9))[_0xb332('0x27')](handleError(_0x51b297,null));};exports[_0xb332('0x3d')]=function(_0x507b31,_0x7ec114){if(_0x507b31[_0xb332('0x35')]['id']){delete _0x507b31[_0xb332('0x35')]['id'];}return db[_0xb332('0x21')][_0xb332('0x33')]({'where':{'id':_0x507b31['params']['id']}})[_0xb332('0x14')](handleEntityNotFound(_0x7ec114,null))[_0xb332('0x14')](saveUpdates(_0x507b31[_0xb332('0x35')],null))[_0xb332('0x14')](respondWithResult(_0x7ec114,null))[_0xb332('0x27')](handleError(_0x7ec114,null));};exports[_0xb332('0x15')]=function(_0x4c4a81,_0x5b4c36){return db[_0xb332('0x21')][_0xb332('0x33')]({'where':{'id':_0x4c4a81[_0xb332('0x3e')]['id']}})[_0xb332('0x14')](handleEntityNotFound(_0x5b4c36,null))[_0xb332('0x14')](removeEntity(_0x5b4c36,null))[_0xb332('0x27')](handleError(_0x5b4c36,null));};exports[_0xb332('0x3f')]=function(_0x941ca9,_0x37d7a4){return db[_0xb332('0x21')][_0xb332('0x3f')]()[_0xb332('0x14')](respondWithResult(_0x37d7a4,null))['catch'](handleError(_0x37d7a4,null));};exports[_0xb332('0x40')]=function(_0x444734,_0x45fcf6){var _0x520de2={'raw':!![],'where':{}},_0x57a61c={},_0x22fe83;return db[_0xb332('0x21')][_0xb332('0x41')]({'where':{'id':_0x444734[_0xb332('0x3e')]['id']}})[_0xb332('0x14')](handleEntityNotFound(_0x45fcf6,null))[_0xb332('0x14')](function(_0x2d2ae1){if(_0x2d2ae1){_0x22fe83=_0x2d2ae1[_0xb332('0x36')]({'plain':!![]});_0x57a61c['model']=_[_0xb332('0x2a')](db[_0xb332('0x42')][_0xb332('0x43')]);_0x57a61c[_0xb332('0x24')]=_[_0xb332('0x2a')](_0x444734[_0xb332('0x24')]);_0x57a61c[_0xb332('0x2b')]=_[_0xb332('0x2c')](_0x57a61c[_0xb332('0x29')],_0x57a61c['query']);_0x520de2[_0xb332('0x2d')]=_[_0xb332('0x2c')](_0x57a61c[_0xb332('0x29')],qs[_0xb332('0x2e')](_0x444734[_0xb332('0x24')][_0xb332('0x2e')]));_0x520de2[_0xb332('0x2d')]=_0x520de2[_0xb332('0x2d')][_0xb332('0x2f')]?_0x520de2[_0xb332('0x2d')]:_0x57a61c[_0xb332('0x29')];if(!_0x444734['query'][_0xb332('0x44')](_0xb332('0x45'))){_0x520de2[_0xb332('0x10')]=qs[_0xb332('0x10')](_0x444734[_0xb332('0x24')]['limit']);_0x520de2[_0xb332('0x11')]=qs['offset'](_0x444734[_0xb332('0x24')][_0xb332('0x11')]);}_0x520de2[_0xb332('0x46')]=qs['sort'](_0x444734[_0xb332('0x24')][_0xb332('0x47')]);_0x520de2['where']=qs[_0xb332('0x2b')](_[_0xb332('0x48')](_0x444734['query'],_0x57a61c[_0xb332('0x2b')]));_0x520de2[_0xb332('0x20')][_0xb332('0x49')]=_0x2d2ae1['id'];if(_0x444734['query'][_0xb332('0x4a')]){_0x520de2[_0xb332('0x20')]=_[_0xb332('0x31')](_0x520de2[_0xb332('0x20')],{'$or':_[_0xb332('0x1c')](_0x520de2['attributes'],function(_0x10b1ca){var _0x4dfbc6={};_0x4dfbc6[_0x10b1ca]={'$like':'%'+_0x444734[_0xb332('0x24')][_0xb332('0x4a')]+'%'};return _0x4dfbc6;})});}_0x520de2=_[_0xb332('0x31')]({},_0x520de2,_0x444734[_0xb332('0x32')]);return db[_0xb332('0x42')][_0xb332('0x25')](_0x520de2);}})['then'](function(_0x278229){if(_0x278229){return db['User'][_0xb332('0x4b')]({'where':{'id':_[_0xb332('0x1c')](_0x278229,'UserId'),'role':_0xb332('0x4c')},'attributes':['id','name',_0xb332('0x4d'),_0xb332('0x4e'),_0xb332('0x4f')]});}})[_0xb332('0x14')](function(_0x1c1128){if(_0x1c1128){return{'count':_0x1c1128[_0xb332('0x22')],'rows':_[_0xb332('0x1c')](_0x1c1128[_0xb332('0x26')],function(_0x164a74){return{'membername':_0x164a74[_0xb332('0x19')],'UserId':_0x164a74['id'],'queue_name':_0x22fe83[_0xb332('0x19')],'OpenchannelQueueId':_0x22fe83['id'],'interface':util[_0xb332('0x50')]('%s/%s',_0xb332('0x51'),_0x164a74[_0xb332('0x19')]),'penalty':0x0,'paused':_0x164a74[_0xb332('0x4d')],'createdAt':_0x164a74[_0xb332('0x4f')],'updatedAt':_0x164a74[_0xb332('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x45fcf6,_0x520de2))[_0xb332('0x27')](handleError(_0x45fcf6,null));};exports['getTeams']=function(_0x15649f,_0x11434e){var _0x5a6d25={};var _0x4201af={};var _0x1920e4;var _0x970b3;return db['OpenchannelQueue'][_0xb332('0x41')]({'where':{'id':_0x15649f[_0xb332('0x3e')]['id']}})['then'](handleEntityNotFound(_0x11434e,null))[_0xb332('0x14')](function(_0x11657b){if(_0x11657b){_0x1920e4=_0x11657b;_0x4201af[_0xb332('0x29')]=_['keys'](db[_0xb332('0x52')][_0xb332('0x43')]);_0x4201af[_0xb332('0x24')]=_['keys'](_0x15649f['query']);_0x4201af[_0xb332('0x2b')]=_[_0xb332('0x2c')](_0x4201af[_0xb332('0x29')],_0x4201af[_0xb332('0x24')]);_0x5a6d25['attributes']=_['intersection'](_0x4201af['model'],qs['fields'](_0x15649f[_0xb332('0x24')][_0xb332('0x2e')]));_0x5a6d25[_0xb332('0x2d')]=_0x5a6d25[_0xb332('0x2d')][_0xb332('0x2f')]?_0x5a6d25[_0xb332('0x2d')]:_0x4201af['model'];_0x5a6d25[_0xb332('0x46')]=qs[_0xb332('0x47')](_0x15649f[_0xb332('0x24')]['sort']);_0x5a6d25['where']=qs[_0xb332('0x2b')](_[_0xb332('0x48')](_0x15649f[_0xb332('0x24')],_0x4201af[_0xb332('0x2b')]));if(_0x15649f['query'][_0xb332('0x4a')]){_0x5a6d25[_0xb332('0x20')]=_[_0xb332('0x31')](_0x5a6d25[_0xb332('0x20')],{'$or':_[_0xb332('0x1c')](_0x5a6d25[_0xb332('0x2d')],function(_0x5841e0){var _0x1886dc={};_0x1886dc[_0x5841e0]={'$like':'%'+_0x15649f[_0xb332('0x24')]['filter']+'%'};return _0x1886dc;})});}_0x5a6d25=_['merge']({},_0x5a6d25,_0x15649f['options']);return _0x1920e4[_0xb332('0x53')](_0x5a6d25);}})[_0xb332('0x14')](function(_0x23ed6d){if(_0x23ed6d){_0x970b3=_0x23ed6d[_0xb332('0x2f')];if(!_0x15649f[_0xb332('0x24')][_0xb332('0x44')](_0xb332('0x45'))){_0x5a6d25[_0xb332('0x10')]=qs['limit'](_0x15649f[_0xb332('0x24')][_0xb332('0x10')]);_0x5a6d25['offset']=qs[_0xb332('0x11')](_0x15649f[_0xb332('0x24')][_0xb332('0x11')]);}return _0x1920e4[_0xb332('0x53')](_0x5a6d25);}})[_0xb332('0x14')](function(_0x4fded6){if(_0x4fded6){return _0x4fded6?{'count':_0x970b3,'rows':_0x4fded6}:null;}})[_0xb332('0x14')](respondWithResult(_0x11434e,null))[_0xb332('0x27')](handleError(_0x11434e,null));};exports[_0xb332('0x54')]=function(_0x9e89e6,_0x11dfb9){var _0x4e8843=_0x9e89e6['body'][_0xb332('0x55')];return db[_0xb332('0x52')][_0xb332('0x25')]({'where':{'id':_0x4e8843},'attributes':['id'],'include':[{'model':db['User'],'as':_0xb332('0x56'),'attributes':['id',_0xb332('0x19'),_0xb332('0x57'),_0xb332('0x58'),'interface'],'raw':!![]}]})['then'](function(_0x6c3bec){if(_0x6c3bec){var _0x3d2ce7=_[_0xb332('0x59')](_0x6c3bec,function(_0x403abf){var _0x5088df=_0x403abf['get']({'plain':!![]});return _0x5088df[_0xb332('0x56')];});return db['OpenchannelQueue'][_0xb332('0x33')]({'where':{'id':_0x9e89e6[_0xb332('0x3e')]['id']}})['then'](function(_0x3cd3ea){return db['sequelize'][_0xb332('0x5a')](function(_0x192d26){return _0x3cd3ea[_0xb332('0x54')](_0x4e8843,{'transaction':_0x192d26})[_0xb332('0x14')](function(){return BPromise['each'](_0x3d2ce7,function(_0x50c6e7){return db[_0xb332('0x42')][_0xb332('0x5b')]({'where':{'UserId':_0x50c6e7['id'],'OpenchannelQueueId':_0x9e89e6[_0xb332('0x3e')]['id']},'transaction':_0x192d26});});})[_0xb332('0x14')](function(){_0x3d2ce7[_0xb332('0x5c')](function(_0x5b91a1){socket[_0xb332('0x5d')](_0xb332('0x5e'),{'UserId':_0x5b91a1['id'],'OpenchannelQueueId':_0x3cd3ea['id']});});});});});}})[_0xb332('0x14')](respondWithStatusCode(_0x11dfb9,null))[_0xb332('0x27')](handleError(_0x11dfb9,null));};exports[_0xb332('0x5f')]=function(_0xa59d46,_0x3ce463){return db[_0xb332('0x52')][_0xb332('0x25')]({'where':{'id':_0xa59d46[_0xb332('0x24')]['ids']},'attributes':['id'],'include':[{'model':db[_0xb332('0x60')],'as':_0xb332('0x56'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3ce463,null))[_0xb332('0x14')](function(_0x2678ea){var _0x747595=_[_0xb332('0x1c')](_0x2678ea,'id');var _0x2f599d=[];var _0x3ed2bb=[];var _0x3e0eb1=squel['select']();_0x3e0eb1[_0xb332('0x61')](_0xb332('0x62'))[_0xb332('0x63')](_0xb332('0x64'),'tq')[_0xb332('0x65')](_0xb332('0x66'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xb332('0x67'),_0xa59d46[_0xb332('0x3e')]['id']);for(var _0x47be47=0x0;_0x47be47<_0x2678ea[_0xb332('0x2f')];_0x47be47+=0x1){let _0x33ed21=_0x2678ea[_0x47be47];for(var _0x219274=0x0;_0x219274<_0x33ed21[_0xb332('0x56')][_0xb332('0x2f')];_0x219274+=0x1){let _0x4278d9=_0x33ed21[_0xb332('0x56')][_0x219274];var _0x3db794=_0x3e0eb1[_0xb332('0x68')]();_0x3db794[_0xb332('0x20')](_0xb332('0x69'),_0x4278d9['id']);_0x3ed2bb[_0xb332('0x6a')](db[_0xb332('0x6b')][_0xb332('0x24')](_0x3db794[_0xb332('0x6c')](),{'type':db[_0xb332('0x6b')]['QueryTypes'][_0xb332('0x6d')]})[_0xb332('0x14')](function(_0x120787){if(_0x120787[_0xb332('0x2f')]===0x1){return _0x4278d9['id'];}else{var _0x122674=_['every'](_['map'](_0x120787,'TeamId'),function(_0x4cbc21){return _[_0xb332('0x6e')](_0x747595,_0x4cbc21);});if(_0x122674){return _0x4278d9['id'];}}}));}}return BPromise['all'](_0x3ed2bb)[_0xb332('0x14')](function(_0x2895f5){_0x2f599d=_(_0x2f599d)[_0xb332('0x6f')](_0x2895f5)[_0xb332('0x70')]()[_0xb332('0x71')]();return db[_0xb332('0x21')][_0xb332('0x33')]({'where':{'id':_0xa59d46[_0xb332('0x3e')]['id']}})[_0xb332('0x14')](function(_0xfa5832){return db[_0xb332('0x6b')][_0xb332('0x5a')](function(_0x4bbfad){return _0xfa5832[_0xb332('0x5f')](_0xa59d46['query'][_0xb332('0x55')],{'transaction':_0x4bbfad})[_0xb332('0x14')](function(){if(!_[_0xb332('0x72')](_0x2f599d)){return _0xfa5832['removeAgents'](_0x2f599d,{'transaction':_0x4bbfad});}})[_0xb332('0x14')](function(){_0x2f599d[_0xb332('0x5c')](function(_0x3544c7){socket['emit'](_0xb332('0x73'),{'UserId':_0x3544c7,'OpenchannelQueueId':_0xfa5832['id']});});});});});});})[_0xb332('0x14')](respondWithStatusCode(_0x3ce463,null))['catch'](handleError(_0x3ce463,null));};exports[_0xb332('0x74')]=function(_0x1f49fc,_0x268a39){return db[_0xb332('0x21')][_0xb332('0x33')]({'where':{'id':_0x1f49fc[_0xb332('0x3e')]['id']}})[_0xb332('0x14')](handleEntityNotFound(_0x268a39,null))['then'](function(_0x4caea3){if(_0x4caea3){return _0x4caea3[_0xb332('0x74')](_0x1f49fc[_0xb332('0x35')]['ids'],_['omit'](_0x1f49fc[_0xb332('0x35')],[_0xb332('0x55'),'id'])||{})[_0xb332('0x75')](function(_0x553f79){for(var _0xb5adc9=0x0;_0xb5adc9<_0x1f49fc[_0xb332('0x35')][_0xb332('0x55')][_0xb332('0x2f')];_0xb5adc9+=0x1){socket[_0xb332('0x5d')](_0xb332('0x5e'),{'UserId':Number(_0x1f49fc['body'][_0xb332('0x55')][_0xb5adc9]),'OpenchannelQueueId':Number(_0x1f49fc[_0xb332('0x3e')]['id'])});}return _0x553f79;});}})[_0xb332('0x14')](respondWithResult(_0x268a39,null))[_0xb332('0x27')](handleError(_0x268a39,null));};exports[_0xb332('0x76')]=function(_0x4defd6,_0x44149e){return db[_0xb332('0x21')][_0xb332('0x33')]({'where':{'id':_0x4defd6[_0xb332('0x3e')]['id']}})[_0xb332('0x14')](handleEntityNotFound(_0x44149e,null))['then'](function(_0x9ef898){if(_0x9ef898){return _0x9ef898['removeAgents'](_0x4defd6[_0xb332('0x24')][_0xb332('0x55')])[_0xb332('0x14')](function(){if(_[_0xb332('0x77')](_0x4defd6[_0xb332('0x24')][_0xb332('0x55')])){for(var _0x32b5e1=0x0;_0x32b5e1<_0x4defd6[_0xb332('0x24')]['ids'][_0xb332('0x2f')];_0x32b5e1+=0x1){socket[_0xb332('0x5d')](_0xb332('0x73'),{'UserId':Number(_0x4defd6[_0xb332('0x24')][_0xb332('0x55')][_0x32b5e1]),'OpenchannelQueueId':Number(_0x4defd6[_0xb332('0x3e')]['id'])});}}else{socket[_0xb332('0x5d')]('userOpenchannelQueue:remove',{'UserId':Number(_0x4defd6[_0xb332('0x24')][_0xb332('0x55')]),'OpenchannelQueueId':Number(_0x4defd6[_0xb332('0x3e')]['id'])});}});}})['then'](respondWithStatusCode(_0x44149e,null))[_0xb332('0x27')](handleError(_0x44149e,null));};exports[_0xb332('0x78')]=function(_0x21ea24,_0x11822c){var _0x396182={};var _0x57de24={};var _0x1c7cd1;var _0x5aad35;return db[_0xb332('0x21')][_0xb332('0x41')]({'where':{'id':_0x21ea24[_0xb332('0x3e')]['id']}})[_0xb332('0x14')](handleEntityNotFound(_0x11822c,null))['then'](function(_0x3a9f8d){if(_0x3a9f8d){_0x1c7cd1=_0x3a9f8d;_0x57de24[_0xb332('0x29')]=_[_0xb332('0x2a')](db['User'][_0xb332('0x43')]);_0x57de24['query']=_[_0xb332('0x2a')](_0x21ea24[_0xb332('0x24')]);_0x57de24['filters']=_[_0xb332('0x2c')](_0x57de24[_0xb332('0x29')],_0x57de24[_0xb332('0x24')]);_0x396182[_0xb332('0x2d')]=_[_0xb332('0x2c')](_0x57de24['model'],qs[_0xb332('0x2e')](_0x21ea24[_0xb332('0x24')]['fields']));_0x396182[_0xb332('0x2d')]=_0x396182['attributes'][_0xb332('0x2f')]?_0x396182[_0xb332('0x2d')]:_0x57de24[_0xb332('0x29')];_0x396182[_0xb332('0x46')]=qs[_0xb332('0x47')](_0x21ea24[_0xb332('0x24')][_0xb332('0x47')]);_0x396182[_0xb332('0x20')]=qs[_0xb332('0x2b')](_['pick'](_0x21ea24[_0xb332('0x24')],_0x57de24[_0xb332('0x2b')]));if(_0x21ea24['query'][_0xb332('0x4a')]){_0x396182[_0xb332('0x20')]=_[_0xb332('0x31')](_0x396182[_0xb332('0x20')],{'$or':_[_0xb332('0x1c')](_0x396182[_0xb332('0x2d')],function(_0x228374){var _0x5dce91={};_0x5dce91[_0x228374]={'$like':'%'+_0x21ea24['query'][_0xb332('0x4a')]+'%'};return _0x5dce91;})});}_0x396182=_[_0xb332('0x31')]({},_0x396182,_0x21ea24[_0xb332('0x32')]);return _0x1c7cd1[_0xb332('0x78')](_0x396182);}})[_0xb332('0x14')](function(_0x480dbf){if(_0x480dbf){_0x5aad35=_0x480dbf['length'];if(!_0x21ea24['query'][_0xb332('0x44')]('nolimit')){_0x396182[_0xb332('0x10')]=qs[_0xb332('0x10')](_0x21ea24[_0xb332('0x24')]['limit']);_0x396182[_0xb332('0x11')]=qs[_0xb332('0x11')](_0x21ea24['query'][_0xb332('0x11')]);}return _0x1c7cd1['getAgents'](_0x396182);}})[_0xb332('0x14')](function(_0x14a232){if(_0x14a232){return _0x14a232?{'count':_0x5aad35,'rows':_0x14a232}:null;}})[_0xb332('0x14')](respondWithResult(_0x11822c,null))['catch'](handleError(_0x11822c,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 82df6d5..9ce7790 100644 --- a/server/api/openchannelQueue/openchannelQueue.events.js +++ b/server/api/openchannelQueue/openchannelQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x19b5=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update'];(function(_0x2e3274,_0x9d586a){var _0x567f0d=function(_0x29d1da){while(--_0x29d1da){_0x2e3274['push'](_0x2e3274['shift']());}};_0x567f0d(++_0x9d586a);}(_0x19b5,0xcc));var _0x519b=function(_0x4b988f,_0x20870e){_0x4b988f=_0x4b988f-0x0;var _0x1334c8=_0x19b5[_0x4b988f];return _0x1334c8;};'use strict';var EventEmitter=require(_0x519b('0x0'));var OpenchannelQueue=require(_0x519b('0x1'))['db'][_0x519b('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x519b('0x3')](0x0);var events={'afterCreate':_0x519b('0x4'),'afterUpdate':_0x519b('0x5'),'afterDestroy':_0x519b('0x6')};function emitEvent(_0x45741a){return function(_0x56a351,_0x576499,_0x4db545){OpenchannelQueueEvents[_0x519b('0x7')](_0x45741a+':'+_0x56a351['id'],_0x56a351);OpenchannelQueueEvents[_0x519b('0x7')](_0x45741a,_0x56a351);_0x4db545(null);};}for(var e in events){if(events[_0x519b('0x8')](e)){var event=events[e];OpenchannelQueue[_0x519b('0x9')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0xfa79=['remove','emit','hasOwnProperty','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update'];(function(_0x48d7aa,_0x52349c){var _0x138fc6=function(_0x273dd9){while(--_0x273dd9){_0x48d7aa['push'](_0x48d7aa['shift']());}};_0x138fc6(++_0x52349c);}(_0xfa79,0x13b));var _0x9fa7=function(_0xc5ea76,_0xc9cc02){_0xc5ea76=_0xc5ea76-0x0;var _0x4a3697=_0xfa79[_0xc5ea76];return _0x4a3697;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x9fa7('0x0'))['db'][_0x9fa7('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x9fa7('0x2')](0x0);var events={'afterCreate':_0x9fa7('0x3'),'afterUpdate':_0x9fa7('0x4'),'afterDestroy':_0x9fa7('0x5')};function emitEvent(_0x4eb4e5){return function(_0x40ae2f,_0x4ca72b,_0x52096a){OpenchannelQueueEvents[_0x9fa7('0x6')](_0x4eb4e5+':'+_0x40ae2f['id'],_0x40ae2f);OpenchannelQueueEvents[_0x9fa7('0x6')](_0x4eb4e5,_0x40ae2f);_0x52096a(null);};}for(var e in events){if(events[_0x9fa7('0x7')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 6e7cff0..07f221e 100644 --- a/server/api/openchannelQueue/openchannelQueue.model.js +++ b/server/api/openchannelQueue/openchannelQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0313=['request-promise','path','rimraf','exports','define','OpenchannelQueue','openchannel_queues','lodash','api','moment','bluebird'];(function(_0xa1e977,_0x60ee90){var _0x18323a=function(_0x12a0e5){while(--_0x12a0e5){_0xa1e977['push'](_0xa1e977['shift']());}};_0x18323a(++_0x60ee90);}(_0x0313,0xac));var _0x3031=function(_0xa22707,_0x446764){_0xa22707=_0xa22707-0x0;var _0x84b8f1=_0x0313[_0xa22707];return _0x84b8f1;};'use strict';var _=require(_0x3031('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3031('0x1'));var moment=require(_0x3031('0x2'));var BPromise=require(_0x3031('0x3'));var rp=require(_0x3031('0x4'));var fs=require('fs');var path=require(_0x3031('0x5'));var rimraf=require(_0x3031('0x6'));var config=require('../../config/environment');var attributes=require('./openchannelQueue.attributes');module[_0x3031('0x7')]=function(_0x464ebf,_0x3a256f){return _0x464ebf[_0x3031('0x8')](_0x3031('0x9'),attributes,{'tableName':_0x3031('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x09bb=['request-promise','rimraf','../../config/environment','exports','define','openchannel_queues','lodash','../../config/logger','api','moment','bluebird'];(function(_0x45f05,_0x833148){var _0x5c26b8=function(_0x2b9143){while(--_0x2b9143){_0x45f05['push'](_0x45f05['shift']());}};_0x5c26b8(++_0x833148);}(_0x09bb,0xab));var _0xb09b=function(_0x5d886f,_0xd37211){_0x5d886f=_0x5d886f-0x0;var _0x9d04fb=_0x09bb[_0x5d886f];return _0x9d04fb;};'use strict';var _=require(_0xb09b('0x0'));var util=require('util');var logger=require(_0xb09b('0x1'))(_0xb09b('0x2'));var moment=require(_0xb09b('0x3'));var BPromise=require(_0xb09b('0x4'));var rp=require(_0xb09b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb09b('0x6'));var config=require(_0xb09b('0x7'));var attributes=require('./openchannelQueue.attributes');module[_0xb09b('0x8')]=function(_0x2eda1c,_0x58c917){return _0x2eda1c[_0xb09b('0x9')]('OpenchannelQueue',attributes,{'tableName':_0xb09b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 3744764..c0404c1 100644 --- a/server/api/openchannelQueue/openchannelQueue.rpc.js +++ b/server/api/openchannelQueue/openchannelQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe96e=['localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetOpenchannelQueue','options','raw','where','attributes','limit','map','include','model','find','ShowOpenchannelQueue','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xe96e,0x183));var _0xee96=function(_0x463461,_0x357458){_0x463461=_0x463461-0x0;var _0x50e103=_0xe96e[_0x463461];return _0x50e103;};'use strict';var _=require(_0xee96('0x0'));var util=require('util');var moment=require(_0xee96('0x1'));var BPromise=require('bluebird');var rs=require(_0xee96('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xee96('0x3'))['db'];var utils=require(_0xee96('0x4'));var logger=require(_0xee96('0x5'))(_0xee96('0x6'));var config=require(_0xee96('0x7'));var jayson=require(_0xee96('0x8'));var client=jayson[_0xee96('0x9')][_0xee96('0xa')]({'port':0x232a});config[_0xee96('0xb')]=_[_0xee96('0xc')](config[_0xee96('0xb')],{'host':_0xee96('0xd'),'port':0x18eb});var socket=require(_0xee96('0xe'))(new Redis(config['redis']));require(_0xee96('0xf'))[_0xee96('0x10')](socket);function respondWithRpcPromise(_0x367306,_0x20c1e,_0x2325c4){return new BPromise(function(_0x1f91c0,_0x409fbe){return client[_0xee96('0x11')](_0x367306,_0x2325c4)[_0xee96('0x12')](function(_0x199d5f){logger[_0xee96('0x13')](_0xee96('0x14'),_0x20c1e,_0xee96('0x15'));logger[_0xee96('0x16')](_0xee96('0x17'),_0x20c1e,_0xee96('0x15'),JSON[_0xee96('0x18')](_0x199d5f));if(_0x199d5f['error']){if(_0x199d5f[_0xee96('0x19')][_0xee96('0x1a')]===0x1f4){logger['error'](_0xee96('0x14'),_0x20c1e,_0x199d5f[_0xee96('0x19')][_0xee96('0x1b')]);return _0x409fbe(_0x199d5f[_0xee96('0x19')][_0xee96('0x1b')]);}logger[_0xee96('0x19')](_0xee96('0x14'),_0x20c1e,_0x199d5f[_0xee96('0x19')][_0xee96('0x1b')]);return _0x1f91c0(_0x199d5f['error'][_0xee96('0x1b')]);}else{logger[_0xee96('0x13')]('OpenchannelQueue,\x20%s,\x20%s',_0x20c1e,_0xee96('0x15'));_0x1f91c0(_0x199d5f['result']['message']);}})[_0xee96('0x1c')](function(_0x2448de){logger['error'](_0xee96('0x14'),_0x20c1e,_0x2448de);_0x409fbe(_0x2448de);});});}exports[_0xee96('0x1d')]=function(_0xf63558){var _0x40ebf2=this;return new Promise(function(_0x366fd3,_0xc371dc){return db['OpenchannelQueue']['findAll']({'raw':_0xf63558[_0xee96('0x1e')]?_0xf63558[_0xee96('0x1e')][_0xee96('0x1f')]===undefined?!![]:![]:!![],'where':_0xf63558[_0xee96('0x1e')]?_0xf63558[_0xee96('0x1e')][_0xee96('0x20')]||null:null,'attributes':_0xf63558[_0xee96('0x1e')]?_0xf63558[_0xee96('0x1e')][_0xee96('0x21')]||null:null,'limit':_0xf63558[_0xee96('0x1e')]?_0xf63558[_0xee96('0x1e')][_0xee96('0x22')]||null:null,'include':_0xf63558[_0xee96('0x1e')]?_0xf63558[_0xee96('0x1e')]['include']?_[_0xee96('0x23')](_0xf63558[_0xee96('0x1e')][_0xee96('0x24')],function(_0x28b97c){return{'model':db[_0x28b97c[_0xee96('0x25')]],'as':_0x28b97c['as'],'attributes':_0x28b97c[_0xee96('0x21')],'include':_0x28b97c['include']?_['map'](_0x28b97c[_0xee96('0x24')],function(_0x5c65d2){return{'model':db[_0x5c65d2['model']],'as':_0x5c65d2['as'],'attributes':_0x5c65d2[_0xee96('0x21')],'include':_0x5c65d2[_0xee96('0x24')]?_[_0xee96('0x23')](_0x5c65d2['include'],function(_0x367c84){return{'model':db[_0x367c84[_0xee96('0x25')]],'as':_0x367c84['as'],'attributes':_0x367c84[_0xee96('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2aaf2f){logger[_0xee96('0x13')]('GetOpenchannelQueue',_0xf63558);logger['debug'](_0xee96('0x1d'),_0xf63558,JSON['stringify'](_0x2aaf2f));_0x366fd3(_0x2aaf2f);})['catch'](function(_0x3e75f6){logger['error']('GetOpenchannelQueue',_0x3e75f6[_0xee96('0x1b')],_0xf63558);_0xc371dc(_0x40ebf2[_0xee96('0x19')](0x1f4,_0x3e75f6[_0xee96('0x1b')]));});});};exports['ShowOpenchannelQueue']=function(_0x1571b2){var _0x5d6a37=this;return new Promise(function(_0x1a481b,_0x59dde9){return db['OpenchannelQueue'][_0xee96('0x26')]({'raw':_0x1571b2[_0xee96('0x1e')]?_0x1571b2[_0xee96('0x1e')][_0xee96('0x1f')]===undefined?!![]:![]:!![],'where':_0x1571b2[_0xee96('0x1e')]?_0x1571b2[_0xee96('0x1e')][_0xee96('0x20')]||null:null,'attributes':_0x1571b2[_0xee96('0x1e')]?_0x1571b2[_0xee96('0x1e')][_0xee96('0x21')]||null:null,'include':_0x1571b2[_0xee96('0x1e')]?_0x1571b2[_0xee96('0x1e')][_0xee96('0x24')]?_[_0xee96('0x23')](_0x1571b2[_0xee96('0x1e')][_0xee96('0x24')],function(_0x16ed33){return{'model':db[_0x16ed33['model']],'as':_0x16ed33['as'],'attributes':_0x16ed33[_0xee96('0x21')],'include':_0x16ed33['include']?_[_0xee96('0x23')](_0x16ed33[_0xee96('0x24')],function(_0xb6ce25){return{'model':db[_0xb6ce25[_0xee96('0x25')]],'as':_0xb6ce25['as'],'attributes':_0xb6ce25[_0xee96('0x21')],'include':_0xb6ce25[_0xee96('0x24')]?_['map'](_0xb6ce25[_0xee96('0x24')],function(_0x59cf8b){return{'model':db[_0x59cf8b[_0xee96('0x25')]],'as':_0x59cf8b['as'],'attributes':_0x59cf8b['attributes']};}):[]};}):[]};}):[]:[]})[_0xee96('0x12')](function(_0x51fbd8){logger[_0xee96('0x13')](_0xee96('0x27'),_0x1571b2);logger[_0xee96('0x16')]('ShowOpenchannelQueue',_0x1571b2,JSON[_0xee96('0x18')](_0x51fbd8));_0x1a481b(_0x51fbd8);})[_0xee96('0x1c')](function(_0x4dcf92){logger[_0xee96('0x19')](_0xee96('0x27'),_0x4dcf92[_0xee96('0x1b')],_0x1571b2);_0x59dde9(_0x5d6a37[_0xee96('0x19')](0x1f4,_0x4dcf92['message']));});});}; \ No newline at end of file +var _0x636e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','redis','socket.io-emitter','./openchannelQueue.socket','register','then','info','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','OpenchannelQueue,\x20%s,\x20%s','catch','GetOpenchannelQueue','findAll','options','raw','where','attributes','limit','map','include','model','OpenchannelQueue','find','ShowOpenchannelQueue','lodash','moment','bluebird'];(function(_0x3f8a22,_0x25a21b){var _0x1af61c=function(_0x80daab){while(--_0x80daab){_0x3f8a22['push'](_0x3f8a22['shift']());}};_0x1af61c(++_0x25a21b);}(_0x636e,0x6f));var _0xe636=function(_0x32175a,_0x419b95){_0x32175a=_0x32175a-0x0;var _0x43f475=_0x636e[_0x32175a];return _0x43f475;};'use strict';var _=require(_0xe636('0x0'));var util=require('util');var moment=require(_0xe636('0x1'));var BPromise=require(_0xe636('0x2'));var rs=require(_0xe636('0x3'));var fs=require('fs');var Redis=require(_0xe636('0x4'));var db=require(_0xe636('0x5'))['db'];var utils=require(_0xe636('0x6'));var logger=require(_0xe636('0x7'))(_0xe636('0x8'));var config=require('../../config/environment');var jayson=require(_0xe636('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xe636('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xe636('0xb'))(new Redis(config['redis']));require(_0xe636('0xc'))[_0xe636('0xd')](socket);function respondWithRpcPromise(_0x10a7cd,_0x51e928,_0x303787){return new BPromise(function(_0x196bd3,_0x223100){return client['request'](_0x10a7cd,_0x303787)[_0xe636('0xe')](function(_0x11f444){logger[_0xe636('0xf')]('OpenchannelQueue,\x20%s,\x20%s',_0x51e928,_0xe636('0x10'));logger[_0xe636('0x11')](_0xe636('0x12'),_0x51e928,_0xe636('0x10'),JSON[_0xe636('0x13')](_0x11f444));if(_0x11f444['error']){if(_0x11f444[_0xe636('0x14')][_0xe636('0x15')]===0x1f4){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x51e928,_0x11f444[_0xe636('0x14')][_0xe636('0x16')]);return _0x223100(_0x11f444['error']['message']);}logger['error'](_0xe636('0x17'),_0x51e928,_0x11f444[_0xe636('0x14')]['message']);return _0x196bd3(_0x11f444['error']['message']);}else{logger['info'](_0xe636('0x17'),_0x51e928,_0xe636('0x10'));_0x196bd3(_0x11f444['result'][_0xe636('0x16')]);}})[_0xe636('0x18')](function(_0xb0073c){logger[_0xe636('0x14')](_0xe636('0x17'),_0x51e928,_0xb0073c);_0x223100(_0xb0073c);});});}exports[_0xe636('0x19')]=function(_0x3d8860){var _0x22df91=this;return new Promise(function(_0x32d83f,_0x112757){return db['OpenchannelQueue'][_0xe636('0x1a')]({'raw':_0x3d8860[_0xe636('0x1b')]?_0x3d8860[_0xe636('0x1b')][_0xe636('0x1c')]===undefined?!![]:![]:!![],'where':_0x3d8860[_0xe636('0x1b')]?_0x3d8860[_0xe636('0x1b')][_0xe636('0x1d')]||null:null,'attributes':_0x3d8860['options']?_0x3d8860[_0xe636('0x1b')][_0xe636('0x1e')]||null:null,'limit':_0x3d8860[_0xe636('0x1b')]?_0x3d8860[_0xe636('0x1b')][_0xe636('0x1f')]||null:null,'include':_0x3d8860[_0xe636('0x1b')]?_0x3d8860['options']['include']?_[_0xe636('0x20')](_0x3d8860[_0xe636('0x1b')][_0xe636('0x21')],function(_0x4bea27){return{'model':db[_0x4bea27[_0xe636('0x22')]],'as':_0x4bea27['as'],'attributes':_0x4bea27[_0xe636('0x1e')],'include':_0x4bea27[_0xe636('0x21')]?_[_0xe636('0x20')](_0x4bea27['include'],function(_0x21d490){return{'model':db[_0x21d490[_0xe636('0x22')]],'as':_0x21d490['as'],'attributes':_0x21d490[_0xe636('0x1e')],'include':_0x21d490[_0xe636('0x21')]?_[_0xe636('0x20')](_0x21d490[_0xe636('0x21')],function(_0x303321){return{'model':db[_0x303321[_0xe636('0x22')]],'as':_0x303321['as'],'attributes':_0x303321[_0xe636('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xe636('0xe')](function(_0x4d805d){logger[_0xe636('0xf')](_0xe636('0x19'),_0x3d8860);logger[_0xe636('0x11')](_0xe636('0x19'),_0x3d8860,JSON[_0xe636('0x13')](_0x4d805d));_0x32d83f(_0x4d805d);})[_0xe636('0x18')](function(_0x360c0f){logger[_0xe636('0x14')]('GetOpenchannelQueue',_0x360c0f[_0xe636('0x16')],_0x3d8860);_0x112757(_0x22df91[_0xe636('0x14')](0x1f4,_0x360c0f[_0xe636('0x16')]));});});};exports['ShowOpenchannelQueue']=function(_0xb1f09d){var _0x51c151=this;return new Promise(function(_0x496362,_0x244a64){return db[_0xe636('0x23')][_0xe636('0x24')]({'raw':_0xb1f09d['options']?_0xb1f09d['options'][_0xe636('0x1c')]===undefined?!![]:![]:!![],'where':_0xb1f09d[_0xe636('0x1b')]?_0xb1f09d[_0xe636('0x1b')][_0xe636('0x1d')]||null:null,'attributes':_0xb1f09d[_0xe636('0x1b')]?_0xb1f09d['options'][_0xe636('0x1e')]||null:null,'include':_0xb1f09d['options']?_0xb1f09d[_0xe636('0x1b')][_0xe636('0x21')]?_[_0xe636('0x20')](_0xb1f09d[_0xe636('0x1b')]['include'],function(_0x11cb5a){return{'model':db[_0x11cb5a[_0xe636('0x22')]],'as':_0x11cb5a['as'],'attributes':_0x11cb5a['attributes'],'include':_0x11cb5a[_0xe636('0x21')]?_['map'](_0x11cb5a['include'],function(_0x313c73){return{'model':db[_0x313c73['model']],'as':_0x313c73['as'],'attributes':_0x313c73[_0xe636('0x1e')],'include':_0x313c73[_0xe636('0x21')]?_[_0xe636('0x20')](_0x313c73[_0xe636('0x21')],function(_0x4fc34c){return{'model':db[_0x4fc34c[_0xe636('0x22')]],'as':_0x4fc34c['as'],'attributes':_0x4fc34c[_0xe636('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xe636('0xe')](function(_0x14f7e7){logger['info'](_0xe636('0x25'),_0xb1f09d);logger[_0xe636('0x11')](_0xe636('0x25'),_0xb1f09d,JSON['stringify'](_0x14f7e7));_0x496362(_0x14f7e7);})[_0xe636('0x18')](function(_0xe8ed9e){logger[_0xe636('0x14')](_0xe636('0x25'),_0xe8ed9e[_0xe636('0x16')],_0xb1f09d);_0x244a64(_0x51c151[_0xe636('0x14')](0x1f4,_0xe8ed9e['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 4a46ee9..37af903 100644 --- a/server/api/openchannelQueue/openchannelQueue.socket.js +++ b/server/api/openchannelQueue/openchannelQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3a00=['remove','removeListener','register','openchannelQueue:','./openchannelQueue.events'];(function(_0x1027dd,_0x20bbb2){var _0x375f31=function(_0x8d3b16){while(--_0x8d3b16){_0x1027dd['push'](_0x1027dd['shift']());}};_0x375f31(++_0x20bbb2);}(_0x3a00,0x72));var _0x03a0=function(_0x38aeea,_0x57522a){_0x38aeea=_0x38aeea-0x0;var _0x5e8d2c=_0x3a00[_0x38aeea];return _0x5e8d2c;};'use strict';var OpenchannelQueueEvents=require(_0x03a0('0x0'));var events=['save',_0x03a0('0x1'),'update'];function createListener(_0x5503b4,_0xaac52c){return function(_0x42581f){_0xaac52c['emit'](_0x5503b4,_0x42581f);};}function removeListener(_0x201b44,_0x4c682b){return function(){OpenchannelQueueEvents[_0x03a0('0x2')](_0x201b44,_0x4c682b);};}exports[_0x03a0('0x3')]=function(_0xb06974){for(var _0x8875c1=0x0,_0x5b4671=events['length'];_0x8875c1<_0x5b4671;_0x8875c1++){var _0x28c454=events[_0x8875c1];var _0x1c742d=createListener(_0x03a0('0x4')+_0x28c454,_0xb06974);OpenchannelQueueEvents['on'](_0x28c454,_0x1c742d);}}; \ No newline at end of file +var _0x4f7a=['openchannelQueue:','remove','update','removeListener'];(function(_0x5a8355,_0x4d173d){var _0x3243b3=function(_0x5594e6){while(--_0x5594e6){_0x5a8355['push'](_0x5a8355['shift']());}};_0x3243b3(++_0x4d173d);}(_0x4f7a,0x105));var _0xa4f7=function(_0x3ca5c8,_0x98add1){_0x3ca5c8=_0x3ca5c8-0x0;var _0xce72f6=_0x4f7a[_0x3ca5c8];return _0xce72f6;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=['save',_0xa4f7('0x0'),_0xa4f7('0x1')];function createListener(_0x2cc498,_0x5606b9){return function(_0xe59640){_0x5606b9['emit'](_0x2cc498,_0xe59640);};}function removeListener(_0x30d02d,_0x196f40){return function(){OpenchannelQueueEvents[_0xa4f7('0x2')](_0x30d02d,_0x196f40);};}exports['register']=function(_0x31c8ab){for(var _0x1d7c51=0x0,_0x4c78bd=events['length'];_0x1d7c51<_0x4c78bd;_0x1d7c51++){var _0x1cea4c=events[_0x1d7c51];var _0x1e3ff3=createListener(_0xa4f7('0x3')+_0x1cea4c,_0x31c8ab);OpenchannelQueueEvents['on'](_0x1cea4c,_0x1e3ff3);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index c276173..740e12d 100644 --- a/server/api/openchannelQueueReport/index.js +++ b/server/api/openchannelQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1e75=['/:id','show','create','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x1e75,0x170));var _0x51e7=function(_0x2e047d,_0x366bb4){_0x2e047d=_0x2e047d-0x0;var _0x6d9c2f=_0x1e75[_0x2e047d];return _0x6d9c2f;};'use strict';var multer=require('multer');var util=require(_0x51e7('0x0'));var path=require(_0x51e7('0x1'));var timeout=require(_0x51e7('0x2'));var express=require(_0x51e7('0x3'));var router=express[_0x51e7('0x4')]();var fs_extra=require(_0x51e7('0x5'));var auth=require(_0x51e7('0x6'));var interaction=require(_0x51e7('0x7'));var config=require(_0x51e7('0x8'));var controller=require('./openchannelQueueReport.controller');router[_0x51e7('0x9')]('/',auth[_0x51e7('0xa')](),controller['index']);router[_0x51e7('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x51e7('0xb')]);router[_0x51e7('0x9')](_0x51e7('0xc'),auth[_0x51e7('0xa')](),controller[_0x51e7('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x51e7('0xe')]);router['put'](_0x51e7('0xc'),auth[_0x51e7('0xa')](),controller[_0x51e7('0xf')]);router[_0x51e7('0x10')](_0x51e7('0xc'),auth[_0x51e7('0xa')](),controller[_0x51e7('0x11')]);module[_0x51e7('0x12')]=router; \ No newline at end of file +var _0x5e3e=['/:id','show','post','create','put','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueueReport.controller','get','index','/describe','isAuthenticated','describe'];(function(_0x2d5286,_0x2e33fa){var _0x301d17=function(_0x21f8a8){while(--_0x21f8a8){_0x2d5286['push'](_0x2d5286['shift']());}};_0x301d17(++_0x2e33fa);}(_0x5e3e,0x1d6));var _0xe5e3=function(_0x582592,_0x19204e){_0x582592=_0x582592-0x0;var _0x365ce1=_0x5e3e[_0x582592];return _0x365ce1;};'use strict';var multer=require(_0xe5e3('0x0'));var util=require(_0xe5e3('0x1'));var path=require(_0xe5e3('0x2'));var timeout=require('connect-timeout');var express=require(_0xe5e3('0x3'));var router=express[_0xe5e3('0x4')]();var fs_extra=require(_0xe5e3('0x5'));var auth=require(_0xe5e3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe5e3('0x7'));var controller=require(_0xe5e3('0x8'));router[_0xe5e3('0x9')]('/',auth['isAuthenticated'](),controller[_0xe5e3('0xa')]);router[_0xe5e3('0x9')](_0xe5e3('0xb'),auth[_0xe5e3('0xc')](),controller[_0xe5e3('0xd')]);router[_0xe5e3('0x9')](_0xe5e3('0xe'),auth[_0xe5e3('0xc')](),controller[_0xe5e3('0xf')]);router[_0xe5e3('0x10')]('/',auth[_0xe5e3('0xc')](),controller[_0xe5e3('0x11')]);router[_0xe5e3('0x12')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xe5e3('0x13')](_0xe5e3('0xe'),auth[_0xe5e3('0xc')](),controller[_0xe5e3('0x14')]);module[_0xe5e3('0x15')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 73619a9..46c2360 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbdda=['exports','STRING','DATE','sequelize'];(function(_0x3ceac4,_0xf57186){var _0x9e4fe8=function(_0x439e4f){while(--_0x439e4f){_0x3ceac4['push'](_0x3ceac4['shift']());}};_0x9e4fe8(++_0xf57186);}(_0xbdda,0x137));var _0xabdd=function(_0x3f38b0,_0x58dc61){_0x3f38b0=_0x3f38b0-0x0;var _0x1f8dcd=_0xbdda[_0x3f38b0];return _0x1f8dcd;};'use strict';var moment=require('moment');var Sequelize=require(_0xabdd('0x0'));module[_0xabdd('0x1')]={'uniqueid':{'type':Sequelize[_0xabdd('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xabdd('0x2')]},'joinAt':{'type':Sequelize[_0xabdd('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xabdd('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc85e=['moment','STRING','DATE'];(function(_0x5167cc,_0x4f9587){var _0x3e6cfb=function(_0x28eb99){while(--_0x28eb99){_0x5167cc['push'](_0x5167cc['shift']());}};_0x3e6cfb(++_0x4f9587);}(_0xc85e,0x1da));var _0xec85=function(_0x5188b4,_0x182193){_0x5188b4=_0x5188b4-0x0;var _0x16eb05=_0xc85e[_0x5188b4];return _0x16eb05;};'use strict';var moment=require(_0xec85('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xec85('0x1')]},'joinAt':{'type':Sequelize[_0xec85('0x2')]},'leaveAt':{'type':Sequelize[_0xec85('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xec85('0x2')]},'reason':{'type':Sequelize[_0xec85('0x1')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index c99ba27..e7d47a0 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x51c3=['papaparse','ioredis','../../components/auth/service','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','reject','save','destroy','then','error','stack','name','map','OpenchannelQueueReport','type','key','model','keys','filters','intersection','fields','query','attributes','length','sort','pick','where','merge','VIRTUAL','filter','findAll','rows','catch','show','rawAttributes','includeAll','include','find','create','body','params','describe','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring'];(function(_0x2fb37d,_0x5ac84d){var _0x287bd9=function(_0xb64f28){while(--_0xb64f28){_0x2fb37d['push'](_0x2fb37d['shift']());}};_0x287bd9(++_0x5ac84d);}(_0x51c3,0xb9));var _0x351c=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x51c3[_0x2dea24];return _0x309d58;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x351c('0x0'));var jsonpatch=require(_0x351c('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x351c('0x2'));var Mustache=require('mustache');var util=require(_0x351c('0x3'));var path=require(_0x351c('0x4'));var sox=require(_0x351c('0x5'));var csv=require('to-csv');var ejs=require(_0x351c('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x351c('0x7'));var squel=require(_0x351c('0x8'));var crypto=require(_0x351c('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x351c('0xa'));var toCsv=require(_0x351c('0xb'));var querystring=require(_0x351c('0xc'));var Papa=require(_0x351c('0xd'));var Redis=require(_0x351c('0xe'));var authService=require(_0x351c('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x351c('0x10'));var utils=require('../../config/utils');var config=require(_0x351c('0x11'));var licenseUtil=require(_0x351c('0x12'));var db=require(_0x351c('0x13'))['db'];function respondWithStatusCode(_0x4afc98,_0x56b09f){_0x56b09f=_0x56b09f||0xcc;return function(_0x6a8dfd){if(_0x6a8dfd){return _0x4afc98[_0x351c('0x14')](_0x56b09f);}return _0x4afc98['status'](_0x56b09f)['end']();};}function respondWithResult(_0x239477,_0x565cb8){_0x565cb8=_0x565cb8||0xc8;return function(_0x1f724b){if(_0x1f724b){return _0x239477['status'](_0x565cb8)[_0x351c('0x15')](_0x1f724b);}};}function respondWithFilteredResult(_0x339b2b,_0x43e4eb){return function(_0x55ecd0){if(_0x55ecd0){var _0x210756=typeof _0x43e4eb[_0x351c('0x16')]===_0x351c('0x17')&&typeof _0x43e4eb[_0x351c('0x18')]==='undefined';var _0x421d8c=_0x55ecd0[_0x351c('0x19')];var _0x45ebfe=_0x210756?0x0:_0x43e4eb['offset'];var _0x473edf=_0x210756?_0x55ecd0[_0x351c('0x19')]:_0x43e4eb[_0x351c('0x16')]+_0x43e4eb[_0x351c('0x18')];var _0x400105;if(_0x473edf>=_0x421d8c){_0x473edf=_0x421d8c;_0x400105=0xc8;}else{_0x400105=0xce;}_0x339b2b[_0x351c('0x1a')](_0x400105);return _0x339b2b[_0x351c('0x1b')](_0x351c('0x1c'),_0x45ebfe+'-'+_0x473edf+'/'+_0x421d8c)['json'](_0x55ecd0);}return null;};}function patchUpdates(_0x38c0ac){return function(_0x284584){try{jsonpatch['apply'](_0x284584,_0x38c0ac,!![]);}catch(_0x5df764){return BPromise[_0x351c('0x1d')](_0x5df764);}return _0x284584[_0x351c('0x1e')]();};}function saveUpdates(_0x4bfb63,_0x4bcfaa){return function(_0x2b5fc1){if(_0x2b5fc1){return _0x2b5fc1['update'](_0x4bfb63)['then'](function(_0x1f77d9){return _0x1f77d9;});}return null;};}function removeEntity(_0x31792c,_0x251d93){return function(_0x2e93cd){if(_0x2e93cd){return _0x2e93cd[_0x351c('0x1f')]()[_0x351c('0x20')](function(){_0x31792c[_0x351c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37210d,_0x3a6dca){return function(_0x5e2fb3){if(!_0x5e2fb3){_0x37210d['sendStatus'](0x194);}return _0x5e2fb3;};}function handleError(_0x2ad697,_0x1f8064){_0x1f8064=_0x1f8064||0x1f4;return function(_0x206fa7){logger[_0x351c('0x21')](_0x206fa7[_0x351c('0x22')]);if(_0x206fa7['name']){delete _0x206fa7[_0x351c('0x23')];}_0x2ad697[_0x351c('0x1a')](_0x1f8064)['send'](_0x206fa7);};}exports['index']=function(_0x391a01,_0x523d30){var _0x2013e2={},_0x4966af={},_0x42c2ea={'count':0x0,'rows':[]};var _0xd52289=_[_0x351c('0x24')](db[_0x351c('0x25')]['rawAttributes'],function(_0x22977c){return{'name':_0x22977c['fieldName'],'type':_0x22977c[_0x351c('0x26')][_0x351c('0x27')]};});_0x4966af[_0x351c('0x28')]=_[_0x351c('0x24')](_0xd52289,_0x351c('0x23'));_0x4966af['query']=_[_0x351c('0x29')](_0x391a01['query']);_0x4966af[_0x351c('0x2a')]=_[_0x351c('0x2b')](_0x4966af[_0x351c('0x28')],_0x4966af['query']);_0x2013e2['attributes']=_[_0x351c('0x2b')](_0x4966af[_0x351c('0x28')],qs[_0x351c('0x2c')](_0x391a01[_0x351c('0x2d')][_0x351c('0x2c')]));_0x2013e2[_0x351c('0x2e')]=_0x2013e2[_0x351c('0x2e')][_0x351c('0x2f')]?_0x2013e2[_0x351c('0x2e')]:_0x4966af[_0x351c('0x28')];if(!_0x391a01['query']['hasOwnProperty']('nolimit')){_0x2013e2[_0x351c('0x18')]=qs[_0x351c('0x18')](_0x391a01[_0x351c('0x2d')][_0x351c('0x18')]);_0x2013e2[_0x351c('0x16')]=qs[_0x351c('0x16')](_0x391a01[_0x351c('0x2d')]['offset']);}_0x2013e2['order']=qs[_0x351c('0x30')](_0x391a01[_0x351c('0x2d')][_0x351c('0x30')]);_0x2013e2['where']=qs['filters'](_[_0x351c('0x31')](_0x391a01[_0x351c('0x2d')],_0x4966af[_0x351c('0x2a')]),_0xd52289);if(_0x391a01[_0x351c('0x2d')]['filter']){_0x2013e2[_0x351c('0x32')]=_[_0x351c('0x33')](_0x2013e2[_0x351c('0x32')],{'$or':_[_0x351c('0x24')](_0xd52289,function(_0x5bc164){if(_0x5bc164[_0x351c('0x26')]!==_0x351c('0x34')){var _0x110185={};_0x110185[_0x5bc164[_0x351c('0x23')]]={'$like':'%'+_0x391a01[_0x351c('0x2d')][_0x351c('0x35')]+'%'};return _0x110185;}})});}_0x2013e2=_[_0x351c('0x33')]({},_0x2013e2,_0x391a01['options']);var _0xdf1abe={'where':_0x2013e2[_0x351c('0x32')]};return db[_0x351c('0x25')][_0x351c('0x19')](_0xdf1abe)['then'](function(_0x10ddf3){_0x42c2ea['count']=_0x10ddf3;if(_0x391a01[_0x351c('0x2d')]['includeAll']){_0x2013e2['include']=[{'all':!![]}];}return db[_0x351c('0x25')][_0x351c('0x36')](_0x2013e2);})[_0x351c('0x20')](function(_0x365d70){_0x42c2ea[_0x351c('0x37')]=_0x365d70;return _0x42c2ea;})[_0x351c('0x20')](respondWithFilteredResult(_0x523d30,_0x2013e2))[_0x351c('0x38')](handleError(_0x523d30,null));};exports[_0x351c('0x39')]=function(_0x264edd,_0x36d81c){var _0x2c8e2a={'raw':!![],'where':{'id':_0x264edd['params']['id']}},_0x43dd7d={};_0x43dd7d['model']=_[_0x351c('0x29')](db[_0x351c('0x25')][_0x351c('0x3a')]);_0x43dd7d['query']=_['keys'](_0x264edd[_0x351c('0x2d')]);_0x43dd7d[_0x351c('0x2a')]=_['intersection'](_0x43dd7d[_0x351c('0x28')],_0x43dd7d[_0x351c('0x2d')]);_0x2c8e2a[_0x351c('0x2e')]=_['intersection'](_0x43dd7d[_0x351c('0x28')],qs['fields'](_0x264edd[_0x351c('0x2d')]['fields']));_0x2c8e2a[_0x351c('0x2e')]=_0x2c8e2a[_0x351c('0x2e')][_0x351c('0x2f')]?_0x2c8e2a[_0x351c('0x2e')]:_0x43dd7d[_0x351c('0x28')];if(_0x264edd[_0x351c('0x2d')][_0x351c('0x3b')]){_0x2c8e2a[_0x351c('0x3c')]=[{'all':!![]}];}_0x2c8e2a=_[_0x351c('0x33')]({},_0x2c8e2a,_0x264edd['options']);return db[_0x351c('0x25')][_0x351c('0x3d')](_0x2c8e2a)[_0x351c('0x20')](handleEntityNotFound(_0x36d81c,null))[_0x351c('0x20')](respondWithResult(_0x36d81c,null))[_0x351c('0x38')](handleError(_0x36d81c,null));};exports[_0x351c('0x3e')]=function(_0x1d8536,_0x5d1dc4){return db[_0x351c('0x25')][_0x351c('0x3e')](_0x1d8536[_0x351c('0x3f')],{})['then'](respondWithResult(_0x5d1dc4,0xc9))[_0x351c('0x38')](handleError(_0x5d1dc4,null));};exports['update']=function(_0x2f3733,_0x167cd2){if(_0x2f3733[_0x351c('0x3f')]['id']){delete _0x2f3733[_0x351c('0x3f')]['id'];}return db[_0x351c('0x25')]['find']({'where':{'id':_0x2f3733[_0x351c('0x40')]['id']}})[_0x351c('0x20')](handleEntityNotFound(_0x167cd2,null))['then'](saveUpdates(_0x2f3733[_0x351c('0x3f')],null))[_0x351c('0x20')](respondWithResult(_0x167cd2,null))[_0x351c('0x38')](handleError(_0x167cd2,null));};exports[_0x351c('0x1f')]=function(_0x319e66,_0xe385a1){return db[_0x351c('0x25')][_0x351c('0x3d')]({'where':{'id':_0x319e66[_0x351c('0x40')]['id']}})[_0x351c('0x20')](handleEntityNotFound(_0xe385a1,null))[_0x351c('0x20')](removeEntity(_0xe385a1,null))['catch'](handleError(_0xe385a1,null));};exports[_0x351c('0x41')]=function(_0x29a503,_0x359b1f){return db['OpenchannelQueueReport'][_0x351c('0x41')]()['then'](respondWithResult(_0x359b1f,null))[_0x351c('0x38')](handleError(_0x359b1f,null));}; \ No newline at end of file +var _0xf830=['fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','destroy','describe','eml-format','request-promise','moment','mustache','path','sox','to-csv','fs-extra','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','type','model','keys','query','filters','intersection'];(function(_0x32d1b9,_0x2f05fb){var _0x2179cd=function(_0x4518af){while(--_0x4518af){_0x32d1b9['push'](_0x32d1b9['shift']());}};_0x2179cd(++_0x2f05fb);}(_0xf830,0xa5));var _0x0f83=function(_0x5d0b6e,_0x2a13a5){_0x5d0b6e=_0x5d0b6e-0x0;var _0x13c731=_0xf830[_0x5d0b6e];return _0x13c731;};'use strict';var emlformat=require(_0x0f83('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0f83('0x1'));var moment=require(_0x0f83('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x0f83('0x3'));var util=require('util');var path=require(_0x0f83('0x4'));var sox=require(_0x0f83('0x5'));var csv=require(_0x0f83('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0f83('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0f83('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x0f83('0x9'));var toCsv=require('to-csv');var querystring=require(_0x0f83('0xa'));var Papa=require('papaparse');var Redis=require(_0x0f83('0xb'));var authService=require(_0x0f83('0xc'));var qs=require(_0x0f83('0xd'));var as=require(_0x0f83('0xe'));var hardwareService=require(_0x0f83('0xf'));var logger=require(_0x0f83('0x10'))(_0x0f83('0x11'));var utils=require(_0x0f83('0x12'));var config=require(_0x0f83('0x13'));var licenseUtil=require(_0x0f83('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14405d,_0x5c96b5){_0x5c96b5=_0x5c96b5||0xcc;return function(_0x303cca){if(_0x303cca){return _0x14405d[_0x0f83('0x15')](_0x5c96b5);}return _0x14405d[_0x0f83('0x16')](_0x5c96b5)[_0x0f83('0x17')]();};}function respondWithResult(_0x5b3b32,_0x26c2c6){_0x26c2c6=_0x26c2c6||0xc8;return function(_0x4bc988){if(_0x4bc988){return _0x5b3b32[_0x0f83('0x16')](_0x26c2c6)[_0x0f83('0x18')](_0x4bc988);}};}function respondWithFilteredResult(_0x51c1cb,_0x4d5f2a){return function(_0x5824ef){if(_0x5824ef){var _0x29d80e=typeof _0x4d5f2a[_0x0f83('0x19')]===_0x0f83('0x1a')&&typeof _0x4d5f2a[_0x0f83('0x1b')]===_0x0f83('0x1a');var _0x10b920=_0x5824ef[_0x0f83('0x1c')];var _0x123013=_0x29d80e?0x0:_0x4d5f2a[_0x0f83('0x19')];var _0x3d8de9=_0x29d80e?_0x5824ef[_0x0f83('0x1c')]:_0x4d5f2a[_0x0f83('0x19')]+_0x4d5f2a['limit'];var _0x49f188;if(_0x3d8de9>=_0x10b920){_0x3d8de9=_0x10b920;_0x49f188=0xc8;}else{_0x49f188=0xce;}_0x51c1cb['status'](_0x49f188);return _0x51c1cb[_0x0f83('0x1d')]('Content-Range',_0x123013+'-'+_0x3d8de9+'/'+_0x10b920)['json'](_0x5824ef);}return null;};}function patchUpdates(_0x468439){return function(_0x40e866){try{jsonpatch[_0x0f83('0x1e')](_0x40e866,_0x468439,!![]);}catch(_0x2f7e42){return BPromise[_0x0f83('0x1f')](_0x2f7e42);}return _0x40e866[_0x0f83('0x20')]();};}function saveUpdates(_0x56c4e0,_0x4ba0c7){return function(_0x34c7e0){if(_0x34c7e0){return _0x34c7e0['update'](_0x56c4e0)[_0x0f83('0x21')](function(_0x1e470d){return _0x1e470d;});}return null;};}function removeEntity(_0x19d5f4,_0xb6ee1e){return function(_0x592a94){if(_0x592a94){return _0x592a94['destroy']()[_0x0f83('0x21')](function(){_0x19d5f4[_0x0f83('0x16')](0xcc)[_0x0f83('0x17')]();});}};}function handleEntityNotFound(_0x59a58f,_0x55bbe1){return function(_0x5f1696){if(!_0x5f1696){_0x59a58f[_0x0f83('0x15')](0x194);}return _0x5f1696;};}function handleError(_0x2d50ae,_0x4d0d76){_0x4d0d76=_0x4d0d76||0x1f4;return function(_0x3a395c){logger[_0x0f83('0x22')](_0x3a395c[_0x0f83('0x23')]);if(_0x3a395c[_0x0f83('0x24')]){delete _0x3a395c[_0x0f83('0x24')];}_0x2d50ae[_0x0f83('0x16')](_0x4d0d76)[_0x0f83('0x25')](_0x3a395c);};}exports[_0x0f83('0x26')]=function(_0x487b5d,_0x5480fd){var _0x41c4df={},_0x591d72={},_0xdb9d2b={'count':0x0,'rows':[]};var _0x2815e2=_[_0x0f83('0x27')](db[_0x0f83('0x28')][_0x0f83('0x29')],function(_0x1d935d){return{'name':_0x1d935d['fieldName'],'type':_0x1d935d[_0x0f83('0x2a')]['key']};});_0x591d72[_0x0f83('0x2b')]=_[_0x0f83('0x27')](_0x2815e2,'name');_0x591d72['query']=_[_0x0f83('0x2c')](_0x487b5d[_0x0f83('0x2d')]);_0x591d72[_0x0f83('0x2e')]=_[_0x0f83('0x2f')](_0x591d72['model'],_0x591d72[_0x0f83('0x2d')]);_0x41c4df['attributes']=_['intersection'](_0x591d72[_0x0f83('0x2b')],qs[_0x0f83('0x30')](_0x487b5d[_0x0f83('0x2d')][_0x0f83('0x30')]));_0x41c4df[_0x0f83('0x31')]=_0x41c4df[_0x0f83('0x31')][_0x0f83('0x32')]?_0x41c4df['attributes']:_0x591d72[_0x0f83('0x2b')];if(!_0x487b5d[_0x0f83('0x2d')][_0x0f83('0x33')](_0x0f83('0x34'))){_0x41c4df['limit']=qs[_0x0f83('0x1b')](_0x487b5d[_0x0f83('0x2d')][_0x0f83('0x1b')]);_0x41c4df[_0x0f83('0x19')]=qs[_0x0f83('0x19')](_0x487b5d['query'][_0x0f83('0x19')]);}_0x41c4df[_0x0f83('0x35')]=qs[_0x0f83('0x36')](_0x487b5d[_0x0f83('0x2d')]['sort']);_0x41c4df[_0x0f83('0x37')]=qs[_0x0f83('0x2e')](_['pick'](_0x487b5d[_0x0f83('0x2d')],_0x591d72[_0x0f83('0x2e')]),_0x2815e2);if(_0x487b5d[_0x0f83('0x2d')][_0x0f83('0x38')]){_0x41c4df[_0x0f83('0x37')]=_[_0x0f83('0x39')](_0x41c4df[_0x0f83('0x37')],{'$or':_[_0x0f83('0x27')](_0x2815e2,function(_0x32e576){if(_0x32e576[_0x0f83('0x2a')]!=='VIRTUAL'){var _0x4e2fca={};_0x4e2fca[_0x32e576[_0x0f83('0x24')]]={'$like':'%'+_0x487b5d['query']['filter']+'%'};return _0x4e2fca;}})});}_0x41c4df=_['merge']({},_0x41c4df,_0x487b5d['options']);var _0x9287bf={'where':_0x41c4df[_0x0f83('0x37')]};return db[_0x0f83('0x28')]['count'](_0x9287bf)['then'](function(_0x5f3abc){_0xdb9d2b[_0x0f83('0x1c')]=_0x5f3abc;if(_0x487b5d[_0x0f83('0x2d')][_0x0f83('0x3a')]){_0x41c4df[_0x0f83('0x3b')]=[{'all':!![]}];}return db[_0x0f83('0x28')][_0x0f83('0x3c')](_0x41c4df);})['then'](function(_0x3ed288){_0xdb9d2b[_0x0f83('0x3d')]=_0x3ed288;return _0xdb9d2b;})[_0x0f83('0x21')](respondWithFilteredResult(_0x5480fd,_0x41c4df))[_0x0f83('0x3e')](handleError(_0x5480fd,null));};exports[_0x0f83('0x3f')]=function(_0x3aebb8,_0x41e19e){var _0x3849e4={'raw':!![],'where':{'id':_0x3aebb8[_0x0f83('0x40')]['id']}},_0x10a23e={};_0x10a23e[_0x0f83('0x2b')]=_[_0x0f83('0x2c')](db[_0x0f83('0x28')][_0x0f83('0x29')]);_0x10a23e[_0x0f83('0x2d')]=_[_0x0f83('0x2c')](_0x3aebb8['query']);_0x10a23e['filters']=_[_0x0f83('0x2f')](_0x10a23e[_0x0f83('0x2b')],_0x10a23e[_0x0f83('0x2d')]);_0x3849e4['attributes']=_[_0x0f83('0x2f')](_0x10a23e[_0x0f83('0x2b')],qs[_0x0f83('0x30')](_0x3aebb8[_0x0f83('0x2d')][_0x0f83('0x30')]));_0x3849e4[_0x0f83('0x31')]=_0x3849e4[_0x0f83('0x31')][_0x0f83('0x32')]?_0x3849e4[_0x0f83('0x31')]:_0x10a23e['model'];if(_0x3aebb8[_0x0f83('0x2d')]['includeAll']){_0x3849e4[_0x0f83('0x3b')]=[{'all':!![]}];}_0x3849e4=_['merge']({},_0x3849e4,_0x3aebb8[_0x0f83('0x41')]);return db[_0x0f83('0x28')][_0x0f83('0x42')](_0x3849e4)['then'](handleEntityNotFound(_0x41e19e,null))[_0x0f83('0x21')](respondWithResult(_0x41e19e,null))[_0x0f83('0x3e')](handleError(_0x41e19e,null));};exports['create']=function(_0x1b87d7,_0x54b168){return db[_0x0f83('0x28')][_0x0f83('0x43')](_0x1b87d7[_0x0f83('0x44')],{})[_0x0f83('0x21')](respondWithResult(_0x54b168,0xc9))[_0x0f83('0x3e')](handleError(_0x54b168,null));};exports['update']=function(_0x42906e,_0x3e31ad){if(_0x42906e[_0x0f83('0x44')]['id']){delete _0x42906e[_0x0f83('0x44')]['id'];}return db[_0x0f83('0x28')]['find']({'where':{'id':_0x42906e[_0x0f83('0x40')]['id']}})[_0x0f83('0x21')](handleEntityNotFound(_0x3e31ad,null))['then'](saveUpdates(_0x42906e[_0x0f83('0x44')],null))[_0x0f83('0x21')](respondWithResult(_0x3e31ad,null))[_0x0f83('0x3e')](handleError(_0x3e31ad,null));};exports[_0x0f83('0x45')]=function(_0x960f52,_0x25caaf){return db[_0x0f83('0x28')][_0x0f83('0x42')]({'where':{'id':_0x960f52['params']['id']}})['then'](handleEntityNotFound(_0x25caaf,null))[_0x0f83('0x21')](removeEntity(_0x25caaf,null))[_0x0f83('0x3e')](handleError(_0x25caaf,null));};exports[_0x0f83('0x46')]=function(_0x3eafb5,_0x59db45){return db['OpenchannelQueueReport'][_0x0f83('0x46')]()[_0x0f83('0x21')](respondWithResult(_0x59db45,null))['catch'](handleError(_0x59db45,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 92be9a1..1afe541 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0x5b34c0,_0x3ad403){var _0x242bd3=function(_0x51d0ce){while(--_0x51d0ce){_0x5b34c0['push'](_0x5b34c0['shift']());}};_0x242bd3(++_0x3ad403);}(_0x814b,0x1a2));var _0xb814=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0x814b[_0x9dfc10];return _0x4f938a;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe14b=['bluebird','path','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','moment'];(function(_0x3edcc8,_0x43be6f){var _0x3f34a5=function(_0x1e61ff){while(--_0x1e61ff){_0x3edcc8['push'](_0x3edcc8['shift']());}};_0x3f34a5(++_0x43be6f);}(_0xe14b,0x93));var _0xbe14=function(_0x3ca9df,_0x19dc5a){_0x3ca9df=_0x3ca9df-0x0;var _0x37d2e3=_0xe14b[_0x3ca9df];return _0x37d2e3;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 4707829..23941b8 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4fc2=['limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','create','body','options','raw','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','where','attributes'];(function(_0x2ff4bd,_0x4780a6){var _0x28edc6=function(_0x792380){while(--_0x792380){_0x2ff4bd['push'](_0x2ff4bd['shift']());}};_0x28edc6(++_0x4780a6);}(_0x4fc2,0x111));var _0x24fc=function(_0x14a3d9,_0x12f232){_0x14a3d9=_0x14a3d9-0x0;var _0xeef905=_0x4fc2[_0x14a3d9];return _0xeef905;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var moment=require(_0x24fc('0x2'));var BPromise=require(_0x24fc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x24fc('0x4'));var db=require(_0x24fc('0x5'))['db'];var utils=require(_0x24fc('0x6'));var logger=require('../../config/logger')(_0x24fc('0x7'));var config=require(_0x24fc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x24fc('0x9')][_0x24fc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4889f4,_0x115851,_0x22a0c8){return new BPromise(function(_0x220f9a,_0x123eff){return client[_0x24fc('0xb')](_0x4889f4,_0x22a0c8)[_0x24fc('0xc')](function(_0x5afdf1){logger[_0x24fc('0xd')](_0x24fc('0xe'),_0x115851,_0x24fc('0xf'));logger[_0x24fc('0x10')](_0x24fc('0x11'),_0x115851,_0x24fc('0xf'),JSON[_0x24fc('0x12')](_0x5afdf1));if(_0x5afdf1[_0x24fc('0x13')]){if(_0x5afdf1['error'][_0x24fc('0x14')]===0x1f4){logger[_0x24fc('0x13')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x115851,_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);return _0x123eff(_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);}logger[_0x24fc('0x13')](_0x24fc('0xe'),_0x115851,_0x5afdf1['error'][_0x24fc('0x15')]);return _0x220f9a(_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);}else{logger[_0x24fc('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x115851,_0x24fc('0xf'));_0x220f9a(_0x5afdf1['result'][_0x24fc('0x15')]);}})[_0x24fc('0x16')](function(_0x218fb6){logger[_0x24fc('0x13')](_0x24fc('0xe'),_0x115851,_0x218fb6);_0x123eff(_0x218fb6);});});}exports['CreateOpenchannelQueueReport']=function(_0x23873c){var _0x1cb3d0=this;return new Promise(function(_0x6cfa0a,_0x8ac114){return db['OpenchannelQueueReport'][_0x24fc('0x17')](_0x23873c[_0x24fc('0x18')],{'raw':_0x23873c[_0x24fc('0x19')]?_0x23873c['options'][_0x24fc('0x1a')]===undefined?!![]:![]:!![]})[_0x24fc('0xc')](function(_0xbf1d6b){logger[_0x24fc('0xd')]('CreateOpenchannelQueueReport',_0x23873c);logger[_0x24fc('0x10')]('CreateOpenchannelQueueReport',_0x23873c,JSON[_0x24fc('0x12')](_0xbf1d6b));_0x6cfa0a(_0xbf1d6b);})['catch'](function(_0x3ed464){logger[_0x24fc('0x13')](_0x24fc('0x1b'),_0x3ed464['message'],_0x23873c);_0x8ac114(_0x1cb3d0[_0x24fc('0x13')](0x1f4,_0x3ed464['message']));});});};exports[_0x24fc('0x1c')]=function(_0x2bb93a){var _0x36a9b4=this;return new Promise(function(_0x34b5b2,_0x3296fc){return db[_0x24fc('0x1d')][_0x24fc('0x1e')](_0x2bb93a[_0x24fc('0x18')],{'raw':_0x2bb93a[_0x24fc('0x19')]?_0x2bb93a[_0x24fc('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2bb93a[_0x24fc('0x19')]?_0x2bb93a[_0x24fc('0x19')][_0x24fc('0x1f')]||null:null,'attributes':_0x2bb93a['options']?_0x2bb93a[_0x24fc('0x19')][_0x24fc('0x20')]||null:null,'limit':_0x2bb93a[_0x24fc('0x19')]?_0x2bb93a[_0x24fc('0x19')][_0x24fc('0x21')]||null:null})[_0x24fc('0xc')](function(_0x5ac1f2){logger[_0x24fc('0xd')](_0x24fc('0x1c'),_0x2bb93a);logger[_0x24fc('0x10')](_0x24fc('0x1c'),_0x2bb93a,JSON[_0x24fc('0x12')](_0x5ac1f2));_0x34b5b2(_0x5ac1f2);})['catch'](function(_0x55c27f){logger['error'](_0x24fc('0x1c'),_0x55c27f['message'],_0x2bb93a);_0x3296fc(_0x36a9b4[_0x24fc('0x13')](0x1f4,_0x55c27f[_0x24fc('0x15')]));});});}; \ No newline at end of file +var _0x6ac2=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','body','then','debug','UpdateOpenchannelQueueReport','update','raw','options','where','attributes','lodash','moment'];(function(_0x322e5b,_0x660a6){var _0xaeb382=function(_0x455c5e){while(--_0x455c5e){_0x322e5b['push'](_0x322e5b['shift']());}};_0xaeb382(++_0x660a6);}(_0x6ac2,0x184));var _0x26ac=function(_0x2789ba,_0x425612){_0x2789ba=_0x2789ba-0x0;var _0x4703d3=_0x6ac2[_0x2789ba];return _0x4703d3;};'use strict';var _=require(_0x26ac('0x0'));var util=require('util');var moment=require(_0x26ac('0x1'));var BPromise=require(_0x26ac('0x2'));var rs=require(_0x26ac('0x3'));var fs=require('fs');var Redis=require(_0x26ac('0x4'));var db=require(_0x26ac('0x5'))['db'];var utils=require(_0x26ac('0x6'));var logger=require('../../config/logger')(_0x26ac('0x7'));var config=require('../../config/environment');var jayson=require(_0x26ac('0x8'));var client=jayson[_0x26ac('0x9')][_0x26ac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x159ba6,_0x36389c,_0x444ca1){return new BPromise(function(_0x1906d0,_0xd8b1e5){return client['request'](_0x159ba6,_0x444ca1)['then'](function(_0x27ff15){logger[_0x26ac('0xb')](_0x26ac('0xc'),_0x36389c,_0x26ac('0xd'));logger['debug'](_0x26ac('0xe'),_0x36389c,_0x26ac('0xd'),JSON[_0x26ac('0xf')](_0x27ff15));if(_0x27ff15[_0x26ac('0x10')]){if(_0x27ff15['error']['code']===0x1f4){logger[_0x26ac('0x10')](_0x26ac('0xc'),_0x36389c,_0x27ff15[_0x26ac('0x10')][_0x26ac('0x11')]);return _0xd8b1e5(_0x27ff15[_0x26ac('0x10')][_0x26ac('0x11')]);}logger[_0x26ac('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x36389c,_0x27ff15[_0x26ac('0x10')][_0x26ac('0x11')]);return _0x1906d0(_0x27ff15[_0x26ac('0x10')][_0x26ac('0x11')]);}else{logger['info'](_0x26ac('0xc'),_0x36389c,_0x26ac('0xd'));_0x1906d0(_0x27ff15['result'][_0x26ac('0x11')]);}})[_0x26ac('0x12')](function(_0x3b7c5d){logger[_0x26ac('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x36389c,_0x3b7c5d);_0xd8b1e5(_0x3b7c5d);});});}exports[_0x26ac('0x13')]=function(_0xb03bbc){var _0x5cd737=this;return new Promise(function(_0x539eda,_0x111613){return db[_0x26ac('0x14')]['create'](_0xb03bbc[_0x26ac('0x15')],{'raw':_0xb03bbc['options']?_0xb03bbc['options']['raw']===undefined?!![]:![]:!![]})[_0x26ac('0x16')](function(_0x58ee68){logger[_0x26ac('0xb')](_0x26ac('0x13'),_0xb03bbc);logger[_0x26ac('0x17')](_0x26ac('0x13'),_0xb03bbc,JSON[_0x26ac('0xf')](_0x58ee68));_0x539eda(_0x58ee68);})[_0x26ac('0x12')](function(_0x21b6ab){logger[_0x26ac('0x10')](_0x26ac('0x13'),_0x21b6ab['message'],_0xb03bbc);_0x111613(_0x5cd737[_0x26ac('0x10')](0x1f4,_0x21b6ab[_0x26ac('0x11')]));});});};exports[_0x26ac('0x18')]=function(_0x1885f7){var _0x346001=this;return new Promise(function(_0x268200,_0x1074b5){return db[_0x26ac('0x14')][_0x26ac('0x19')](_0x1885f7[_0x26ac('0x15')],{'raw':_0x1885f7['options']?_0x1885f7['options'][_0x26ac('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1885f7['options']?_0x1885f7[_0x26ac('0x1b')][_0x26ac('0x1c')]||null:null,'attributes':_0x1885f7[_0x26ac('0x1b')]?_0x1885f7[_0x26ac('0x1b')][_0x26ac('0x1d')]||null:null,'limit':_0x1885f7[_0x26ac('0x1b')]?_0x1885f7['options']['limit']||null:null})[_0x26ac('0x16')](function(_0x3e2c4d){logger[_0x26ac('0xb')]('UpdateOpenchannelQueueReport',_0x1885f7);logger['debug'](_0x26ac('0x18'),_0x1885f7,JSON[_0x26ac('0xf')](_0x3e2c4d));_0x268200(_0x3e2c4d);})[_0x26ac('0x12')](function(_0x325818){logger['error']('UpdateOpenchannelQueueReport',_0x325818[_0x26ac('0x11')],_0x1885f7);_0x1074b5(_0x346001[_0x26ac('0x10')](0x1f4,_0x325818[_0x26ac('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 5c7a0cd..c56a4bc 100644 --- a/server/api/openchannelTransferReport/index.js +++ b/server/api/openchannelTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xba7d=['describe','show','post','delete','/:id','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xba7d,0x136));var _0xdba7=function(_0x5a78d1,_0x287afe){_0x5a78d1=_0x5a78d1-0x0;var _0x5d9751=_0xba7d[_0x5a78d1];return _0x5d9751;};'use strict';var multer=require(_0xdba7('0x0'));var util=require(_0xdba7('0x1'));var path=require(_0xdba7('0x2'));var timeout=require('connect-timeout');var express=require(_0xdba7('0x3'));var router=express[_0xdba7('0x4')]();var fs_extra=require(_0xdba7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xdba7('0x6'));var config=require(_0xdba7('0x7'));var controller=require(_0xdba7('0x8'));router[_0xdba7('0x9')]('/',auth[_0xdba7('0xa')](),controller[_0xdba7('0xb')]);router[_0xdba7('0x9')](_0xdba7('0xc'),auth['isAuthenticated'](),controller[_0xdba7('0xd')]);router[_0xdba7('0x9')]('/:id',auth[_0xdba7('0xa')](),controller[_0xdba7('0xe')]);router[_0xdba7('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0xdba7('0xa')](),controller['update']);router[_0xdba7('0x10')](_0xdba7('0x11'),auth[_0xdba7('0xa')](),controller['destroy']);module[_0xdba7('0x12')]=router; \ No newline at end of file +var _0xe1ed=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','create','put','delete','exports','multer'];(function(_0x22d598,_0x259d66){var _0x47477f=function(_0x517d4f){while(--_0x517d4f){_0x22d598['push'](_0x22d598['shift']());}};_0x47477f(++_0x259d66);}(_0xe1ed,0xc7));var _0xde1e=function(_0xfae78e,_0x28a7c3){_0xfae78e=_0xfae78e-0x0;var _0x3bc63a=_0xe1ed[_0xfae78e];return _0x3bc63a;};'use strict';var multer=require(_0xde1e('0x0'));var util=require(_0xde1e('0x1'));var path=require(_0xde1e('0x2'));var timeout=require(_0xde1e('0x3'));var express=require(_0xde1e('0x4'));var router=express[_0xde1e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xde1e('0x6'));var interaction=require(_0xde1e('0x7'));var config=require(_0xde1e('0x8'));var controller=require(_0xde1e('0x9'));router['get']('/',auth[_0xde1e('0xa')](),controller[_0xde1e('0xb')]);router[_0xde1e('0xc')](_0xde1e('0xd'),auth[_0xde1e('0xa')](),controller[_0xde1e('0xe')]);router[_0xde1e('0xc')](_0xde1e('0xf'),auth[_0xde1e('0xa')](),controller['show']);router['post']('/',auth[_0xde1e('0xa')](),controller[_0xde1e('0x10')]);router[_0xde1e('0x11')](_0xde1e('0xf'),auth['isAuthenticated'](),controller['update']);router[_0xde1e('0x12')]('/:id',auth[_0xde1e('0xa')](),controller['destroy']);module[_0xde1e('0x13')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 535c233..21fd1e6 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x1c7dcf,_0x25723c){var _0x1ede61=function(_0x41f909){while(--_0x41f909){_0x1c7dcf['push'](_0x1c7dcf['shift']());}};_0x1ede61(++_0x25723c);}(_0x54ef,0x112));var _0xf54e=function(_0x49f47b,_0x3931bb){_0x49f47b=_0x49f47b-0x0;var _0x1c6704=_0x54ef[_0x49f47b];return _0x1c6704;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file +var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x1adfd4,_0x314919){var _0x57ed81=function(_0x40da9f){while(--_0x40da9f){_0x1adfd4['push'](_0x1adfd4['shift']());}};_0x57ed81(++_0x314919);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x119b3e,_0x588d50){_0x119b3e=_0x119b3e-0x0;var _0x1169ae=_0xcb91[_0x119b3e];return _0x1169ae;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index d76df67..d528b66 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x66d8=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','then','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','rows','catch','keys','includeAll','include','options','find','body','update','params','destroy','describe','eml-format','rimraf','zip-dir','request-promise','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis'];(function(_0x22991,_0xed9a7b){var _0x772f74=function(_0x13ed37){while(--_0x13ed37){_0x22991['push'](_0x22991['shift']());}};_0x772f74(++_0xed9a7b);}(_0x66d8,0x18f));var _0x866d=function(_0x13211b,_0x3050c2){_0x13211b=_0x13211b-0x0;var _0x4adb44=_0x66d8[_0x13211b];return _0x4adb44;};'use strict';var emlformat=require(_0x866d('0x0'));var rimraf=require(_0x866d('0x1'));var zipdir=require(_0x866d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x866d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x866d('0x4'));var util=require('util');var path=require(_0x866d('0x5'));var sox=require('sox');var csv=require(_0x866d('0x6'));var ejs=require(_0x866d('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x866d('0x8'));var squel=require(_0x866d('0x9'));var crypto=require(_0x866d('0xa'));var jsforce=require(_0x866d('0xb'));var deskjs=require(_0x866d('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x866d('0xd'));var Redis=require(_0x866d('0xe'));var authService=require(_0x866d('0xf'));var qs=require(_0x866d('0x10'));var as=require(_0x866d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x866d('0x12'));var utils=require(_0x866d('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x866d('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15b689,_0x2060a0){_0x2060a0=_0x2060a0||0xcc;return function(_0x2a6ef){if(_0x2a6ef){return _0x15b689[_0x866d('0x15')](_0x2060a0);}return _0x15b689[_0x866d('0x16')](_0x2060a0)[_0x866d('0x17')]();};}function respondWithResult(_0x1793b5,_0x1d2eaa){_0x1d2eaa=_0x1d2eaa||0xc8;return function(_0x46c1b8){if(_0x46c1b8){return _0x1793b5[_0x866d('0x16')](_0x1d2eaa)[_0x866d('0x18')](_0x46c1b8);}};}function respondWithFilteredResult(_0x4da0af,_0x4e6598){return function(_0xdb0ccd){if(_0xdb0ccd){var _0x5c4215=typeof _0x4e6598['offset']==='undefined'&&typeof _0x4e6598[_0x866d('0x19')]===_0x866d('0x1a');var _0x30e380=_0xdb0ccd[_0x866d('0x1b')];var _0x48d9c2=_0x5c4215?0x0:_0x4e6598[_0x866d('0x1c')];var _0x461ad5=_0x5c4215?_0xdb0ccd[_0x866d('0x1b')]:_0x4e6598[_0x866d('0x1c')]+_0x4e6598[_0x866d('0x19')];var _0x49e51c;if(_0x461ad5>=_0x30e380){_0x461ad5=_0x30e380;_0x49e51c=0xc8;}else{_0x49e51c=0xce;}_0x4da0af[_0x866d('0x16')](_0x49e51c);return _0x4da0af[_0x866d('0x1d')](_0x866d('0x1e'),_0x48d9c2+'-'+_0x461ad5+'/'+_0x30e380)[_0x866d('0x18')](_0xdb0ccd);}return null;};}function patchUpdates(_0x1d86ff){return function(_0x1ade73){try{jsonpatch[_0x866d('0x1f')](_0x1ade73,_0x1d86ff,!![]);}catch(_0x42621c){return BPromise['reject'](_0x42621c);}return _0x1ade73[_0x866d('0x20')]();};}function saveUpdates(_0x3ff4ac,_0x471ae4){return function(_0x2e0ced){if(_0x2e0ced){return _0x2e0ced['update'](_0x3ff4ac)[_0x866d('0x21')](function(_0x1ca64e){return _0x1ca64e;});}return null;};}function removeEntity(_0x5c07b3,_0x42ffda){return function(_0x1c955f){if(_0x1c955f){return _0x1c955f['destroy']()['then'](function(){_0x5c07b3['status'](0xcc)[_0x866d('0x17')]();});}};}function handleEntityNotFound(_0x4bb81d,_0x3cc003){return function(_0x477444){if(!_0x477444){_0x4bb81d[_0x866d('0x15')](0x194);}return _0x477444;};}function handleError(_0x3e4a08,_0x965131){_0x965131=_0x965131||0x1f4;return function(_0x2a0c29){logger['error'](_0x2a0c29[_0x866d('0x22')]);if(_0x2a0c29[_0x866d('0x23')]){delete _0x2a0c29['name'];}_0x3e4a08[_0x866d('0x16')](_0x965131)[_0x866d('0x24')](_0x2a0c29);};}exports[_0x866d('0x25')]=function(_0x40450b,_0x2a2611){var _0x5efd7b={},_0x559f87={},_0xfb3faf={'count':0x0,'rows':[]};var _0x3c08e4=_[_0x866d('0x26')](db[_0x866d('0x27')][_0x866d('0x28')],function(_0x15004a){return{'name':_0x15004a[_0x866d('0x29')],'type':_0x15004a[_0x866d('0x2a')][_0x866d('0x2b')]};});_0x559f87[_0x866d('0x2c')]=_[_0x866d('0x26')](_0x3c08e4,'name');_0x559f87[_0x866d('0x2d')]=_['keys'](_0x40450b[_0x866d('0x2d')]);_0x559f87[_0x866d('0x2e')]=_[_0x866d('0x2f')](_0x559f87[_0x866d('0x2c')],_0x559f87['query']);_0x5efd7b['attributes']=_[_0x866d('0x2f')](_0x559f87[_0x866d('0x2c')],qs[_0x866d('0x30')](_0x40450b[_0x866d('0x2d')]['fields']));_0x5efd7b['attributes']=_0x5efd7b['attributes']['length']?_0x5efd7b[_0x866d('0x31')]:_0x559f87['model'];if(!_0x40450b[_0x866d('0x2d')][_0x866d('0x32')]('nolimit')){_0x5efd7b[_0x866d('0x19')]=qs[_0x866d('0x19')](_0x40450b[_0x866d('0x2d')][_0x866d('0x19')]);_0x5efd7b[_0x866d('0x1c')]=qs[_0x866d('0x1c')](_0x40450b[_0x866d('0x2d')][_0x866d('0x1c')]);}_0x5efd7b[_0x866d('0x33')]=qs[_0x866d('0x34')](_0x40450b[_0x866d('0x2d')][_0x866d('0x34')]);_0x5efd7b[_0x866d('0x35')]=qs[_0x866d('0x2e')](_['pick'](_0x40450b[_0x866d('0x2d')],_0x559f87[_0x866d('0x2e')]),_0x3c08e4);if(_0x40450b[_0x866d('0x2d')][_0x866d('0x36')]){_0x5efd7b[_0x866d('0x35')]=_[_0x866d('0x37')](_0x5efd7b[_0x866d('0x35')],{'$or':_[_0x866d('0x26')](_0x3c08e4,function(_0x18378a){if(_0x18378a[_0x866d('0x2a')]!==_0x866d('0x38')){var _0x29caa2={};_0x29caa2[_0x18378a[_0x866d('0x23')]]={'$like':'%'+_0x40450b[_0x866d('0x2d')][_0x866d('0x36')]+'%'};return _0x29caa2;}})});}_0x5efd7b=_['merge']({},_0x5efd7b,_0x40450b['options']);var _0x1144e7={'where':_0x5efd7b[_0x866d('0x35')]};return db['OpenchannelTransferReport'][_0x866d('0x1b')](_0x1144e7)[_0x866d('0x21')](function(_0x163c6a){_0xfb3faf[_0x866d('0x1b')]=_0x163c6a;if(_0x40450b[_0x866d('0x2d')]['includeAll']){_0x5efd7b['include']=[{'all':!![]}];}return db[_0x866d('0x27')]['findAll'](_0x5efd7b);})[_0x866d('0x21')](function(_0x128cf1){_0xfb3faf[_0x866d('0x39')]=_0x128cf1;return _0xfb3faf;})['then'](respondWithFilteredResult(_0x2a2611,_0x5efd7b))[_0x866d('0x3a')](handleError(_0x2a2611,null));};exports['show']=function(_0x448a35,_0x5eaa90){var _0x28ceb9={'raw':!![],'where':{'id':_0x448a35['params']['id']}},_0x240c7c={};_0x240c7c[_0x866d('0x2c')]=_[_0x866d('0x3b')](db[_0x866d('0x27')][_0x866d('0x28')]);_0x240c7c['query']=_[_0x866d('0x3b')](_0x448a35[_0x866d('0x2d')]);_0x240c7c['filters']=_[_0x866d('0x2f')](_0x240c7c['model'],_0x240c7c['query']);_0x28ceb9[_0x866d('0x31')]=_[_0x866d('0x2f')](_0x240c7c[_0x866d('0x2c')],qs['fields'](_0x448a35[_0x866d('0x2d')][_0x866d('0x30')]));_0x28ceb9['attributes']=_0x28ceb9[_0x866d('0x31')]['length']?_0x28ceb9[_0x866d('0x31')]:_0x240c7c[_0x866d('0x2c')];if(_0x448a35[_0x866d('0x2d')][_0x866d('0x3c')]){_0x28ceb9[_0x866d('0x3d')]=[{'all':!![]}];}_0x28ceb9=_[_0x866d('0x37')]({},_0x28ceb9,_0x448a35[_0x866d('0x3e')]);return db['OpenchannelTransferReport'][_0x866d('0x3f')](_0x28ceb9)['then'](handleEntityNotFound(_0x5eaa90,null))[_0x866d('0x21')](respondWithResult(_0x5eaa90,null))[_0x866d('0x3a')](handleError(_0x5eaa90,null));};exports['create']=function(_0x30c5b7,_0x5422f6){return db[_0x866d('0x27')]['create'](_0x30c5b7[_0x866d('0x40')],{})[_0x866d('0x21')](respondWithResult(_0x5422f6,0xc9))['catch'](handleError(_0x5422f6,null));};exports[_0x866d('0x41')]=function(_0x14de3c,_0x5bc213){if(_0x14de3c[_0x866d('0x40')]['id']){delete _0x14de3c[_0x866d('0x40')]['id'];}return db[_0x866d('0x27')][_0x866d('0x3f')]({'where':{'id':_0x14de3c[_0x866d('0x42')]['id']}})['then'](handleEntityNotFound(_0x5bc213,null))[_0x866d('0x21')](saveUpdates(_0x14de3c[_0x866d('0x40')],null))[_0x866d('0x21')](respondWithResult(_0x5bc213,null))['catch'](handleError(_0x5bc213,null));};exports[_0x866d('0x43')]=function(_0x3fd12f,_0xa6766d){return db[_0x866d('0x27')][_0x866d('0x3f')]({'where':{'id':_0x3fd12f[_0x866d('0x42')]['id']}})[_0x866d('0x21')](handleEntityNotFound(_0xa6766d,null))['then'](removeEntity(_0xa6766d,null))[_0x866d('0x3a')](handleError(_0xa6766d,null));};exports[_0x866d('0x44')]=function(_0xf53b93,_0x422d8f){return db[_0x866d('0x27')][_0x866d('0x44')]()[_0x866d('0x21')](respondWithResult(_0x422d8f,null))['catch'](handleError(_0x422d8f,null));}; \ No newline at end of file +var _0xa693=['json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','stack','name','send','index','map','OpenchannelTransferReport','fieldName','type','key','query','keys','intersection','model','fields','length','attributes','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','rawAttributes','include','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x511227,_0x5ad6d4){var _0x8d2786=function(_0x59979c){while(--_0x59979c){_0x511227['push'](_0x511227['shift']());}};_0x8d2786(++_0x5ad6d4);}(_0xa693,0xcb));var _0x3a69=function(_0xca1f0e,_0x2713d5){_0xca1f0e=_0xca1f0e-0x0;var _0x35e4ef=_0xa693[_0xca1f0e];return _0x35e4ef;};'use strict';var emlformat=require(_0x3a69('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3a69('0x1'));var jsonpatch=require(_0x3a69('0x2'));var rp=require(_0x3a69('0x3'));var moment=require(_0x3a69('0x4'));var BPromise=require(_0x3a69('0x5'));var Mustache=require(_0x3a69('0x6'));var util=require(_0x3a69('0x7'));var path=require(_0x3a69('0x8'));var sox=require(_0x3a69('0x9'));var csv=require(_0x3a69('0xa'));var ejs=require(_0x3a69('0xb'));var fs=require('fs');var fs_extra=require(_0x3a69('0xc'));var _=require(_0x3a69('0xd'));var squel=require('squel');var crypto=require(_0x3a69('0xe'));var jsforce=require(_0x3a69('0xf'));var deskjs=require(_0x3a69('0x10'));var toCsv=require(_0x3a69('0xa'));var querystring=require(_0x3a69('0x11'));var Papa=require(_0x3a69('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3a69('0x13'));var as=require(_0x3a69('0x14'));var hardwareService=require(_0x3a69('0x15'));var logger=require(_0x3a69('0x16'))(_0x3a69('0x17'));var utils=require(_0x3a69('0x18'));var config=require(_0x3a69('0x19'));var licenseUtil=require(_0x3a69('0x1a'));var db=require(_0x3a69('0x1b'))['db'];function respondWithStatusCode(_0x1fa1ab,_0x257512){_0x257512=_0x257512||0xcc;return function(_0x4f1e06){if(_0x4f1e06){return _0x1fa1ab[_0x3a69('0x1c')](_0x257512);}return _0x1fa1ab[_0x3a69('0x1d')](_0x257512)[_0x3a69('0x1e')]();};}function respondWithResult(_0x412682,_0x11e2e3){_0x11e2e3=_0x11e2e3||0xc8;return function(_0x48ad02){if(_0x48ad02){return _0x412682['status'](_0x11e2e3)[_0x3a69('0x1f')](_0x48ad02);}};}function respondWithFilteredResult(_0x16330a,_0x8d3ed7){return function(_0x581464){if(_0x581464){var _0x127def=typeof _0x8d3ed7[_0x3a69('0x20')]===_0x3a69('0x21')&&typeof _0x8d3ed7[_0x3a69('0x22')]==='undefined';var _0x3e2b88=_0x581464['count'];var _0x406a81=_0x127def?0x0:_0x8d3ed7[_0x3a69('0x20')];var _0x2e257f=_0x127def?_0x581464[_0x3a69('0x23')]:_0x8d3ed7[_0x3a69('0x20')]+_0x8d3ed7[_0x3a69('0x22')];var _0x366e26;if(_0x2e257f>=_0x3e2b88){_0x2e257f=_0x3e2b88;_0x366e26=0xc8;}else{_0x366e26=0xce;}_0x16330a[_0x3a69('0x1d')](_0x366e26);return _0x16330a[_0x3a69('0x24')]('Content-Range',_0x406a81+'-'+_0x2e257f+'/'+_0x3e2b88)[_0x3a69('0x1f')](_0x581464);}return null;};}function patchUpdates(_0x47b31a){return function(_0x41c85f){try{jsonpatch[_0x3a69('0x25')](_0x41c85f,_0x47b31a,!![]);}catch(_0x113d3a){return BPromise['reject'](_0x113d3a);}return _0x41c85f[_0x3a69('0x26')]();};}function saveUpdates(_0x4ee581,_0x4b4dcd){return function(_0x397ec5){if(_0x397ec5){return _0x397ec5[_0x3a69('0x27')](_0x4ee581)[_0x3a69('0x28')](function(_0x5355ad){return _0x5355ad;});}return null;};}function removeEntity(_0x593399,_0x3c9a7f){return function(_0x2c9217){if(_0x2c9217){return _0x2c9217[_0x3a69('0x29')]()['then'](function(){_0x593399['status'](0xcc)[_0x3a69('0x1e')]();});}};}function handleEntityNotFound(_0x5a10c9,_0x29fb6e){return function(_0x2efe33){if(!_0x2efe33){_0x5a10c9[_0x3a69('0x1c')](0x194);}return _0x2efe33;};}function handleError(_0x4c3347,_0x5ce042){_0x5ce042=_0x5ce042||0x1f4;return function(_0x1abc9b){logger[_0x3a69('0x2a')](_0x1abc9b[_0x3a69('0x2b')]);if(_0x1abc9b[_0x3a69('0x2c')]){delete _0x1abc9b[_0x3a69('0x2c')];}_0x4c3347[_0x3a69('0x1d')](_0x5ce042)[_0x3a69('0x2d')](_0x1abc9b);};}exports[_0x3a69('0x2e')]=function(_0x1a15e7,_0x4dd812){var _0x15ae90={},_0x32efd8={},_0x497a9e={'count':0x0,'rows':[]};var _0x2d2282=_[_0x3a69('0x2f')](db[_0x3a69('0x30')]['rawAttributes'],function(_0x3c6bb0){return{'name':_0x3c6bb0[_0x3a69('0x31')],'type':_0x3c6bb0[_0x3a69('0x32')][_0x3a69('0x33')]};});_0x32efd8['model']=_[_0x3a69('0x2f')](_0x2d2282,_0x3a69('0x2c'));_0x32efd8[_0x3a69('0x34')]=_[_0x3a69('0x35')](_0x1a15e7[_0x3a69('0x34')]);_0x32efd8['filters']=_[_0x3a69('0x36')](_0x32efd8[_0x3a69('0x37')],_0x32efd8[_0x3a69('0x34')]);_0x15ae90['attributes']=_['intersection'](_0x32efd8[_0x3a69('0x37')],qs[_0x3a69('0x38')](_0x1a15e7['query'][_0x3a69('0x38')]));_0x15ae90['attributes']=_0x15ae90['attributes'][_0x3a69('0x39')]?_0x15ae90[_0x3a69('0x3a')]:_0x32efd8['model'];if(!_0x1a15e7['query']['hasOwnProperty']('nolimit')){_0x15ae90[_0x3a69('0x22')]=qs[_0x3a69('0x22')](_0x1a15e7[_0x3a69('0x34')][_0x3a69('0x22')]);_0x15ae90['offset']=qs[_0x3a69('0x20')](_0x1a15e7[_0x3a69('0x34')][_0x3a69('0x20')]);}_0x15ae90['order']=qs[_0x3a69('0x3b')](_0x1a15e7[_0x3a69('0x34')][_0x3a69('0x3b')]);_0x15ae90['where']=qs[_0x3a69('0x3c')](_[_0x3a69('0x3d')](_0x1a15e7['query'],_0x32efd8[_0x3a69('0x3c')]),_0x2d2282);if(_0x1a15e7['query'][_0x3a69('0x3e')]){_0x15ae90[_0x3a69('0x3f')]=_[_0x3a69('0x40')](_0x15ae90['where'],{'$or':_['map'](_0x2d2282,function(_0x266edf){if(_0x266edf[_0x3a69('0x32')]!==_0x3a69('0x41')){var _0x2cb401={};_0x2cb401[_0x266edf[_0x3a69('0x2c')]]={'$like':'%'+_0x1a15e7[_0x3a69('0x34')][_0x3a69('0x3e')]+'%'};return _0x2cb401;}})});}_0x15ae90=_[_0x3a69('0x40')]({},_0x15ae90,_0x1a15e7[_0x3a69('0x42')]);var _0x5c6df9={'where':_0x15ae90[_0x3a69('0x3f')]};return db[_0x3a69('0x30')][_0x3a69('0x23')](_0x5c6df9)[_0x3a69('0x28')](function(_0x2323de){_0x497a9e[_0x3a69('0x23')]=_0x2323de;if(_0x1a15e7[_0x3a69('0x34')][_0x3a69('0x43')]){_0x15ae90['include']=[{'all':!![]}];}return db[_0x3a69('0x30')][_0x3a69('0x44')](_0x15ae90);})[_0x3a69('0x28')](function(_0x25cee4){_0x497a9e[_0x3a69('0x45')]=_0x25cee4;return _0x497a9e;})[_0x3a69('0x28')](respondWithFilteredResult(_0x4dd812,_0x15ae90))['catch'](handleError(_0x4dd812,null));};exports[_0x3a69('0x46')]=function(_0x538509,_0x5b03b4){var _0x587e02={'raw':!![],'where':{'id':_0x538509[_0x3a69('0x47')]['id']}},_0x1f4436={};_0x1f4436[_0x3a69('0x37')]=_['keys'](db[_0x3a69('0x30')][_0x3a69('0x48')]);_0x1f4436[_0x3a69('0x34')]=_[_0x3a69('0x35')](_0x538509[_0x3a69('0x34')]);_0x1f4436['filters']=_[_0x3a69('0x36')](_0x1f4436[_0x3a69('0x37')],_0x1f4436[_0x3a69('0x34')]);_0x587e02[_0x3a69('0x3a')]=_[_0x3a69('0x36')](_0x1f4436[_0x3a69('0x37')],qs[_0x3a69('0x38')](_0x538509[_0x3a69('0x34')]['fields']));_0x587e02[_0x3a69('0x3a')]=_0x587e02[_0x3a69('0x3a')][_0x3a69('0x39')]?_0x587e02['attributes']:_0x1f4436['model'];if(_0x538509[_0x3a69('0x34')]['includeAll']){_0x587e02[_0x3a69('0x49')]=[{'all':!![]}];}_0x587e02=_['merge']({},_0x587e02,_0x538509[_0x3a69('0x42')]);return db[_0x3a69('0x30')]['find'](_0x587e02)['then'](handleEntityNotFound(_0x5b03b4,null))[_0x3a69('0x28')](respondWithResult(_0x5b03b4,null))[_0x3a69('0x4a')](handleError(_0x5b03b4,null));};exports[_0x3a69('0x4b')]=function(_0x2c7a5d,_0x40e357){return db[_0x3a69('0x30')][_0x3a69('0x4b')](_0x2c7a5d[_0x3a69('0x4c')],{})[_0x3a69('0x28')](respondWithResult(_0x40e357,0xc9))['catch'](handleError(_0x40e357,null));};exports[_0x3a69('0x27')]=function(_0x587827,_0x37f8fe){if(_0x587827[_0x3a69('0x4c')]['id']){delete _0x587827[_0x3a69('0x4c')]['id'];}return db[_0x3a69('0x30')]['find']({'where':{'id':_0x587827['params']['id']}})[_0x3a69('0x28')](handleEntityNotFound(_0x37f8fe,null))[_0x3a69('0x28')](saveUpdates(_0x587827[_0x3a69('0x4c')],null))[_0x3a69('0x28')](respondWithResult(_0x37f8fe,null))['catch'](handleError(_0x37f8fe,null));};exports[_0x3a69('0x29')]=function(_0x28ea28,_0x28ac50){return db[_0x3a69('0x30')]['find']({'where':{'id':_0x28ea28[_0x3a69('0x47')]['id']}})[_0x3a69('0x28')](handleEntityNotFound(_0x28ac50,null))['then'](removeEntity(_0x28ac50,null))['catch'](handleError(_0x28ac50,null));};exports['describe']=function(_0x72945c,_0x407669){return db[_0x3a69('0x30')][_0x3a69('0x4d')]()[_0x3a69('0x28')](respondWithResult(_0x407669,null))['catch'](handleError(_0x407669,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index de69a79..bbe4e3a 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.model.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe216=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','uniqueid','lodash'];(function(_0x334c6a,_0x18a185){var _0x3d43f7=function(_0x223fa2){while(--_0x223fa2){_0x334c6a['push'](_0x334c6a['shift']());}};_0x3d43f7(++_0x18a185);}(_0xe216,0x112));var _0x6e21=function(_0x421eeb,_0x3d3e3e){_0x421eeb=_0x421eeb-0x0;var _0x2c7371=_0xe216[_0x421eeb];return _0x2c7371;};'use strict';var _=require(_0x6e21('0x0'));var util=require(_0x6e21('0x1'));var logger=require(_0x6e21('0x2'))(_0x6e21('0x3'));var moment=require(_0x6e21('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6e21('0x5'));var rimraf=require(_0x6e21('0x6'));var config=require(_0x6e21('0x7'));var attributes=require('./openchannelTransferReport.attributes');module[_0x6e21('0x8')]=function(_0x290896,_0x4d31cd){return _0x290896[_0x6e21('0x9')]('OpenchannelTransferReport',attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x6e21('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x353f=['path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','uniqueid','lodash','util','../../config/logger','api','request-promise'];(function(_0x25f228,_0x5c9fa9){var _0x253958=function(_0x4ed63f){while(--_0x4ed63f){_0x25f228['push'](_0x25f228['shift']());}};_0x253958(++_0x5c9fa9);}(_0x353f,0x19b));var _0xf353=function(_0x2520e9,_0x48c6fe){_0x2520e9=_0x2520e9-0x0;var _0x29771f=_0x353f[_0x2520e9];return _0x29771f;};'use strict';var _=require(_0xf353('0x0'));var util=require(_0xf353('0x1'));var logger=require(_0xf353('0x2'))(_0xf353('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf353('0x4'));var fs=require('fs');var path=require(_0xf353('0x5'));var rimraf=require(_0xf353('0x6'));var config=require(_0xf353('0x7'));var attributes=require(_0xf353('0x8'));module[_0xf353('0x9')]=function(_0x1ac744,_0x308e0c){return _0x1ac744[_0xf353('0xa')](_0xf353('0xb'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xf353('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 5670e3e..14a887e 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf1e1=['error','code','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5776f5,_0x159735){var _0x42221c=function(_0x3554de){while(--_0x3554de){_0x5776f5['push'](_0x5776f5['shift']());}};_0x42221c(++_0x159735);}(_0xf1e1,0x102));var _0x1f1e=function(_0x2a40b3,_0xe1c253){_0x2a40b3=_0x2a40b3-0x0;var _0x4ac6cb=_0xf1e1[_0x2a40b3];return _0x4ac6cb;};'use strict';var _=require(_0x1f1e('0x0'));var util=require('util');var moment=require(_0x1f1e('0x1'));var BPromise=require('bluebird');var rs=require(_0x1f1e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1f1e('0x3'))['db'];var utils=require(_0x1f1e('0x4'));var logger=require(_0x1f1e('0x5'))(_0x1f1e('0x6'));var config=require(_0x1f1e('0x7'));var jayson=require(_0x1f1e('0x8'));var client=jayson[_0x1f1e('0x9')][_0x1f1e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1db643,_0x38585e,_0x46e32b){return new BPromise(function(_0x3699d2,_0x6ab45b){return client[_0x1f1e('0xb')](_0x1db643,_0x46e32b)['then'](function(_0x44e626){logger[_0x1f1e('0xc')](_0x1f1e('0xd'),_0x38585e,_0x1f1e('0xe'));logger[_0x1f1e('0xf')](_0x1f1e('0x10'),_0x38585e,_0x1f1e('0xe'),JSON[_0x1f1e('0x11')](_0x44e626));if(_0x44e626[_0x1f1e('0x12')]){if(_0x44e626['error'][_0x1f1e('0x13')]===0x1f4){logger[_0x1f1e('0x12')](_0x1f1e('0xd'),_0x38585e,_0x44e626[_0x1f1e('0x12')][_0x1f1e('0x14')]);return _0x6ab45b(_0x44e626[_0x1f1e('0x12')][_0x1f1e('0x14')]);}logger['error'](_0x1f1e('0xd'),_0x38585e,_0x44e626[_0x1f1e('0x12')]['message']);return _0x3699d2(_0x44e626[_0x1f1e('0x12')][_0x1f1e('0x14')]);}else{logger['info'](_0x1f1e('0xd'),_0x38585e,_0x1f1e('0xe'));_0x3699d2(_0x44e626[_0x1f1e('0x15')][_0x1f1e('0x14')]);}})[_0x1f1e('0x16')](function(_0x3f978f){logger[_0x1f1e('0x12')](_0x1f1e('0xd'),_0x38585e,_0x3f978f);_0x6ab45b(_0x3f978f);});});} \ No newline at end of file +var _0x23f4=['debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','OpenchannelTransferReport,\x20%s,\x20%s'];(function(_0x40ca6a,_0x4e48ae){var _0x17a786=function(_0x443315){while(--_0x443315){_0x40ca6a['push'](_0x40ca6a['shift']());}};_0x17a786(++_0x4e48ae);}(_0x23f4,0x1ee));var _0x423f=function(_0x2619a8,_0x3ba70d){_0x2619a8=_0x2619a8-0x0;var _0x349e2f=_0x23f4[_0x2619a8];return _0x349e2f;};'use strict';var _=require('lodash');var util=require(_0x423f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x423f('0x1'));var fs=require('fs');var Redis=require(_0x423f('0x2'));var db=require(_0x423f('0x3'))['db'];var utils=require(_0x423f('0x4'));var logger=require(_0x423f('0x5'))(_0x423f('0x6'));var config=require(_0x423f('0x7'));var jayson=require(_0x423f('0x8'));var client=jayson[_0x423f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x260eae,_0x47716d,_0x55258d){return new BPromise(function(_0x727b4e,_0x416fb1){return client[_0x423f('0xa')](_0x260eae,_0x55258d)['then'](function(_0x5b5ee6){logger['info'](_0x423f('0xb'),_0x47716d,'request\x20sent');logger[_0x423f('0xc')](_0x423f('0xd'),_0x47716d,_0x423f('0xe'),JSON[_0x423f('0xf')](_0x5b5ee6));if(_0x5b5ee6['error']){if(_0x5b5ee6[_0x423f('0x10')][_0x423f('0x11')]===0x1f4){logger[_0x423f('0x10')](_0x423f('0xb'),_0x47716d,_0x5b5ee6[_0x423f('0x10')]['message']);return _0x416fb1(_0x5b5ee6[_0x423f('0x10')][_0x423f('0x12')]);}logger[_0x423f('0x10')](_0x423f('0xb'),_0x47716d,_0x5b5ee6[_0x423f('0x10')][_0x423f('0x12')]);return _0x727b4e(_0x5b5ee6[_0x423f('0x10')][_0x423f('0x12')]);}else{logger[_0x423f('0x13')](_0x423f('0xb'),_0x47716d,_0x423f('0xe'));_0x727b4e(_0x5b5ee6[_0x423f('0x14')][_0x423f('0x12')]);}})[_0x423f('0x15')](function(_0x9d1487){logger[_0x423f('0x10')](_0x423f('0xb'),_0x47716d,_0x9d1487);_0x416fb1(_0x9d1487);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index ce5e79f..4dafd88 100644 --- a/server/api/pause/index.js +++ b/server/api/pause/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa88b=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','show','create','/:id','isAuthenticated','update'];(function(_0x5fcd3,_0x4aa66f){var _0x44fd85=function(_0x56f95d){while(--_0x56f95d){_0x5fcd3['push'](_0x5fcd3['shift']());}};_0x44fd85(++_0x4aa66f);}(_0xa88b,0x157));var _0xba88=function(_0x172ed7,_0x3d08fd){_0x172ed7=_0x172ed7-0x0;var _0xfa8f61=_0xa88b[_0x172ed7];return _0xfa8f61;};'use strict';var multer=require(_0xba88('0x0'));var util=require(_0xba88('0x1'));var path=require(_0xba88('0x2'));var timeout=require(_0xba88('0x3'));var express=require(_0xba88('0x4'));var router=express[_0xba88('0x5')]();var fs_extra=require(_0xba88('0x6'));var auth=require(_0xba88('0x7'));var interaction=require(_0xba88('0x8'));var config=require(_0xba88('0x9'));var controller=require(_0xba88('0xa'));router[_0xba88('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0xba88('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xba88('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xba88('0xd')]);router['put'](_0xba88('0xe'),auth[_0xba88('0xf')](),controller[_0xba88('0x10')]);router[_0xba88('0x11')](_0xba88('0xe'),auth['isAuthenticated'](),controller[_0xba88('0x12')]);module[_0xba88('0x13')]=router; \ No newline at end of file +var _0x6c35=['show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','/:id'];(function(_0x23bdd8,_0xbbc30b){var _0x10af18=function(_0x43b0b5){while(--_0x43b0b5){_0x23bdd8['push'](_0x23bdd8['shift']());}};_0x10af18(++_0xbbc30b);}(_0x6c35,0xcf));var _0x56c3=function(_0x5c85af,_0x2a8266){_0x5c85af=_0x5c85af-0x0;var _0x53e6e0=_0x6c35[_0x5c85af];return _0x53e6e0;};'use strict';var multer=require(_0x56c3('0x0'));var util=require(_0x56c3('0x1'));var path=require(_0x56c3('0x2'));var timeout=require(_0x56c3('0x3'));var express=require(_0x56c3('0x4'));var router=express[_0x56c3('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x56c3('0x6'));var interaction=require(_0x56c3('0x7'));var config=require(_0x56c3('0x8'));var controller=require(_0x56c3('0x9'));router[_0x56c3('0xa')]('/',auth[_0x56c3('0xb')](),controller['index']);router['get'](_0x56c3('0xc'),auth[_0x56c3('0xb')](),controller[_0x56c3('0xd')]);router[_0x56c3('0xe')]('/',auth[_0x56c3('0xb')](),controller[_0x56c3('0xf')]);router[_0x56c3('0x10')](_0x56c3('0xc'),auth[_0x56c3('0xb')](),controller[_0x56c3('0x11')]);router[_0x56c3('0x12')](_0x56c3('0xc'),auth[_0x56c3('0xb')](),controller[_0x56c3('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index c501b47..a729dcd 100644 --- a/server/api/pause/pause.attributes.js +++ b/server/api/pause/pause.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeb57=['exports','STRING'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xeb57,0x126));var _0x7eb5=function(_0x135cea,_0x5e4f4b){_0x135cea=_0x135cea-0x0;var _0x51bb04=_0xeb57[_0x135cea];return _0x51bb04;};'use strict';var Sequelize=require('sequelize');module[_0x7eb5('0x0')]={'name':{'type':Sequelize[_0x7eb5('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x7eb5('0x1')]}}; \ No newline at end of file +var _0x9681=['STRING','name','exports'];(function(_0x31241e,_0x1d309e){var _0x3c9f61=function(_0x6988cb){while(--_0x6988cb){_0x31241e['push'](_0x31241e['shift']());}};_0x3c9f61(++_0x1d309e);}(_0x9681,0x7d));var _0x1968=function(_0x26c30d,_0x4ff0fe){_0x26c30d=_0x26c30d-0x0;var _0x12bb6b=_0x9681[_0x26c30d];return _0x12bb6b;};'use strict';var Sequelize=require('sequelize');module[_0x1968('0x0')]={'name':{'type':Sequelize[_0x1968('0x1')],'unique':_0x1968('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 215ccea..97e2dff 100644 --- a/server/api/pause/pause.controller.js +++ b/server/api/pause/pause.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4c45=['where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','lodash','squel','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','Pauses','UserProfileResource','error','stack','name','send','index','map','Pause','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort'];(function(_0x3c4567,_0x50cdf4){var _0x2e2881=function(_0x4f79b0){while(--_0x4f79b0){_0x3c4567['push'](_0x3c4567['shift']());}};_0x2e2881(++_0x50cdf4);}(_0x4c45,0x171));var _0x54c4=function(_0x6b6d09,_0xc0dc47){_0x6b6d09=_0x6b6d09-0x0;var _0x320edb=_0x4c45[_0x6b6d09];return _0x320edb;};'use strict';var emlformat=require(_0x54c4('0x0'));var rimraf=require(_0x54c4('0x1'));var zipdir=require(_0x54c4('0x2'));var jsonpatch=require(_0x54c4('0x3'));var rp=require('request-promise');var moment=require(_0x54c4('0x4'));var BPromise=require(_0x54c4('0x5'));var Mustache=require(_0x54c4('0x6'));var util=require(_0x54c4('0x7'));var path=require(_0x54c4('0x8'));var sox=require(_0x54c4('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x54c4('0xa'));var squel=require(_0x54c4('0xb'));var crypto=require('crypto');var jsforce=require(_0x54c4('0xc'));var deskjs=require(_0x54c4('0xd'));var toCsv=require(_0x54c4('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x54c4('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x54c4('0x10'));var as=require(_0x54c4('0x11'));var hardwareService=require(_0x54c4('0x12'));var logger=require(_0x54c4('0x13'))(_0x54c4('0x14'));var utils=require(_0x54c4('0x15'));var config=require(_0x54c4('0x16'));var licenseUtil=require(_0x54c4('0x17'));var db=require(_0x54c4('0x18'))['db'];function respondWithStatusCode(_0x2696ca,_0x425687){_0x425687=_0x425687||0xcc;return function(_0x2b7e44){if(_0x2b7e44){return _0x2696ca[_0x54c4('0x19')](_0x425687);}return _0x2696ca[_0x54c4('0x1a')](_0x425687)[_0x54c4('0x1b')]();};}function respondWithResult(_0x8459a2,_0x392879){_0x392879=_0x392879||0xc8;return function(_0xd4db1){if(_0xd4db1){return _0x8459a2[_0x54c4('0x1a')](_0x392879)[_0x54c4('0x1c')](_0xd4db1);}};}function respondWithFilteredResult(_0x53b224,_0x2452cc){return function(_0x2a8aa1){if(_0x2a8aa1){var _0x34dfcc=typeof _0x2452cc[_0x54c4('0x1d')]===_0x54c4('0x1e')&&typeof _0x2452cc[_0x54c4('0x1f')]===_0x54c4('0x1e');var _0x64de35=_0x2a8aa1['count'];var _0x30ad2e=_0x34dfcc?0x0:_0x2452cc['offset'];var _0x16dcc5=_0x34dfcc?_0x2a8aa1[_0x54c4('0x20')]:_0x2452cc['offset']+_0x2452cc[_0x54c4('0x1f')];var _0x25a3ad;if(_0x16dcc5>=_0x64de35){_0x16dcc5=_0x64de35;_0x25a3ad=0xc8;}else{_0x25a3ad=0xce;}_0x53b224[_0x54c4('0x1a')](_0x25a3ad);return _0x53b224[_0x54c4('0x21')]('Content-Range',_0x30ad2e+'-'+_0x16dcc5+'/'+_0x64de35)['json'](_0x2a8aa1);}return null;};}function patchUpdates(_0x5a7a2e){return function(_0x4f167c){try{jsonpatch[_0x54c4('0x22')](_0x4f167c,_0x5a7a2e,!![]);}catch(_0x101a2b){return BPromise[_0x54c4('0x23')](_0x101a2b);}return _0x4f167c[_0x54c4('0x24')]();};}function saveUpdates(_0x2daa5c,_0x2e4963){return function(_0x39886d){if(_0x39886d){return _0x39886d[_0x54c4('0x25')](_0x2daa5c)[_0x54c4('0x26')](function(_0x10961c){return _0x10961c;});}return null;};}function removeEntity(_0x3d5b1b,_0x4a776d){return function(_0x1fde24){if(_0x1fde24){return _0x1fde24[_0x54c4('0x27')]()[_0x54c4('0x26')](function(){var _0x208550=_0x1fde24[_0x54c4('0x28')]({'plain':!![]});var _0x99c2b2=_0x54c4('0x29');return db[_0x54c4('0x2a')][_0x54c4('0x27')]({'where':{'type':_0x99c2b2,'resourceId':_0x208550['id']}})['then'](function(){return _0x1fde24;});})['then'](function(){_0x3d5b1b[_0x54c4('0x1a')](0xcc)[_0x54c4('0x1b')]();});}};}function handleEntityNotFound(_0x30f7f2,_0x555b79){return function(_0xf606ae){if(!_0xf606ae){_0x30f7f2['sendStatus'](0x194);}return _0xf606ae;};}function handleError(_0xae4d7b,_0x385e49){_0x385e49=_0x385e49||0x1f4;return function(_0x805de5){logger[_0x54c4('0x2b')](_0x805de5[_0x54c4('0x2c')]);if(_0x805de5['name']){delete _0x805de5[_0x54c4('0x2d')];}_0xae4d7b[_0x54c4('0x1a')](_0x385e49)[_0x54c4('0x2e')](_0x805de5);};}exports[_0x54c4('0x2f')]=function(_0x99fe9e,_0x172219){var _0x4d77fe={},_0x4b3384={},_0x404feb={'count':0x0,'rows':[]};var _0x38735e=_[_0x54c4('0x30')](db[_0x54c4('0x31')][_0x54c4('0x32')],function(_0x2077a1){return{'name':_0x2077a1[_0x54c4('0x33')],'type':_0x2077a1[_0x54c4('0x34')][_0x54c4('0x35')]};});_0x4b3384['model']=_[_0x54c4('0x30')](_0x38735e,_0x54c4('0x2d'));_0x4b3384[_0x54c4('0x36')]=_[_0x54c4('0x37')](_0x99fe9e[_0x54c4('0x36')]);_0x4b3384[_0x54c4('0x38')]=_[_0x54c4('0x39')](_0x4b3384['model'],_0x4b3384[_0x54c4('0x36')]);_0x4d77fe[_0x54c4('0x3a')]=_['intersection'](_0x4b3384['model'],qs[_0x54c4('0x3b')](_0x99fe9e[_0x54c4('0x36')]['fields']));_0x4d77fe[_0x54c4('0x3a')]=_0x4d77fe[_0x54c4('0x3a')][_0x54c4('0x3c')]?_0x4d77fe['attributes']:_0x4b3384[_0x54c4('0x3d')];if(!_0x99fe9e['query'][_0x54c4('0x3e')](_0x54c4('0x3f'))){_0x4d77fe['limit']=qs[_0x54c4('0x1f')](_0x99fe9e[_0x54c4('0x36')][_0x54c4('0x1f')]);_0x4d77fe[_0x54c4('0x1d')]=qs[_0x54c4('0x1d')](_0x99fe9e[_0x54c4('0x36')][_0x54c4('0x1d')]);}_0x4d77fe[_0x54c4('0x40')]=qs[_0x54c4('0x41')](_0x99fe9e['query'][_0x54c4('0x41')]);_0x4d77fe[_0x54c4('0x42')]=qs[_0x54c4('0x38')](_[_0x54c4('0x43')](_0x99fe9e[_0x54c4('0x36')],_0x4b3384['filters']),_0x38735e);if(_0x99fe9e[_0x54c4('0x36')][_0x54c4('0x44')]){_0x4d77fe['where']=_[_0x54c4('0x45')](_0x4d77fe[_0x54c4('0x42')],{'$or':_[_0x54c4('0x30')](_0x38735e,function(_0x497603){if(_0x497603[_0x54c4('0x34')]!==_0x54c4('0x46')){var _0x118747={};_0x118747[_0x497603[_0x54c4('0x2d')]]={'$like':'%'+_0x99fe9e[_0x54c4('0x36')][_0x54c4('0x44')]+'%'};return _0x118747;}})});}_0x4d77fe=_[_0x54c4('0x45')]({},_0x4d77fe,_0x99fe9e[_0x54c4('0x47')]);var _0x31a5b1={'where':_0x4d77fe['where']};return db[_0x54c4('0x31')][_0x54c4('0x20')](_0x31a5b1)[_0x54c4('0x26')](function(_0x4b1d23){_0x404feb[_0x54c4('0x20')]=_0x4b1d23;if(_0x99fe9e[_0x54c4('0x36')][_0x54c4('0x48')]){_0x4d77fe[_0x54c4('0x49')]=[{'all':!![]}];}return db[_0x54c4('0x31')]['findAll'](_0x4d77fe);})['then'](function(_0x44da62){_0x404feb[_0x54c4('0x4a')]=_0x44da62;return _0x404feb;})['then'](respondWithFilteredResult(_0x172219,_0x4d77fe))[_0x54c4('0x4b')](handleError(_0x172219,null));};exports[_0x54c4('0x4c')]=function(_0x51152f,_0xa4fa6c){var _0x180dea={'raw':!![],'where':{'id':_0x51152f[_0x54c4('0x4d')]['id']}},_0x4cb293={};_0x4cb293[_0x54c4('0x3d')]=_[_0x54c4('0x37')](db[_0x54c4('0x31')]['rawAttributes']);_0x4cb293[_0x54c4('0x36')]=_[_0x54c4('0x37')](_0x51152f[_0x54c4('0x36')]);_0x4cb293[_0x54c4('0x38')]=_[_0x54c4('0x39')](_0x4cb293[_0x54c4('0x3d')],_0x4cb293['query']);_0x180dea[_0x54c4('0x3a')]=_[_0x54c4('0x39')](_0x4cb293['model'],qs[_0x54c4('0x3b')](_0x51152f[_0x54c4('0x36')]['fields']));_0x180dea[_0x54c4('0x3a')]=_0x180dea[_0x54c4('0x3a')][_0x54c4('0x3c')]?_0x180dea[_0x54c4('0x3a')]:_0x4cb293[_0x54c4('0x3d')];if(_0x51152f[_0x54c4('0x36')][_0x54c4('0x48')]){_0x180dea['include']=[{'all':!![]}];}_0x180dea=_['merge']({},_0x180dea,_0x51152f['options']);return db[_0x54c4('0x31')][_0x54c4('0x4e')](_0x180dea)[_0x54c4('0x26')](handleEntityNotFound(_0xa4fa6c,null))[_0x54c4('0x26')](respondWithResult(_0xa4fa6c,null))['catch'](handleError(_0xa4fa6c,null));};exports['create']=function(_0x87cf13,_0x194987){return db[_0x54c4('0x31')]['create'](_0x87cf13['body'],{})[_0x54c4('0x26')](function(_0x2700ca){var _0x3a7633=_0x87cf13[_0x54c4('0x4f')][_0x54c4('0x28')]({'plain':!![]});if(!_0x3a7633)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3a7633[_0x54c4('0x50')]==='user'){var _0x2c5955=_0x2700ca[_0x54c4('0x28')]({'plain':!![]});var _0x100fc7='Pauses';return db[_0x54c4('0x51')][_0x54c4('0x4e')]({'where':{'name':_0x100fc7,'userProfileId':_0x3a7633[_0x54c4('0x52')]},'raw':!![]})[_0x54c4('0x26')](function(_0x35621e){if(_0x35621e&&_0x35621e[_0x54c4('0x53')]===0x0){return db['UserProfileResource'][_0x54c4('0x54')]({'name':_0x2c5955[_0x54c4('0x2d')],'resourceId':_0x2c5955['id'],'type':_0x35621e['name'],'sectionId':_0x35621e['id']},{})[_0x54c4('0x26')](function(){return _0x2700ca;});}else{return _0x2700ca;}})['catch'](function(_0x597311){logger['error'](_0x54c4('0x55'),_0x597311);throw _0x597311;});}return _0x2700ca;})[_0x54c4('0x26')](respondWithResult(_0x194987,0xc9))[_0x54c4('0x4b')](handleError(_0x194987,null));};exports['update']=function(_0x3b5d32,_0x5ed5c9){if(_0x3b5d32['body']['id']){delete _0x3b5d32['body']['id'];}return db[_0x54c4('0x31')]['find']({'where':{'id':_0x3b5d32[_0x54c4('0x4d')]['id']}})[_0x54c4('0x26')](handleEntityNotFound(_0x5ed5c9,null))[_0x54c4('0x26')](saveUpdates(_0x3b5d32[_0x54c4('0x56')],null))[_0x54c4('0x26')](respondWithResult(_0x5ed5c9,null))[_0x54c4('0x4b')](handleError(_0x5ed5c9,null));};exports[_0x54c4('0x27')]=function(_0x1baf15,_0x4ee315){return db[_0x54c4('0x31')][_0x54c4('0x4e')]({'where':{'id':_0x1baf15[_0x54c4('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4ee315,null))['then'](removeEntity(_0x4ee315,null))['catch'](handleError(_0x4ee315,null));}; \ No newline at end of file +var _0xddf7=['to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','count','limit','set','apply','reject','update','then','destroy','get','Pauses','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','Pause','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','fs-extra','squel','crypto'];(function(_0x2166a3,_0x237c50){var _0x260035=function(_0x2dbfa2){while(--_0x2dbfa2){_0x2166a3['push'](_0x2166a3['shift']());}};_0x260035(++_0x237c50);}(_0xddf7,0x193));var _0x7ddf=function(_0x215c9d,_0x4e004d){_0x215c9d=_0x215c9d-0x0;var _0x2c4852=_0xddf7[_0x215c9d];return _0x2c4852;};'use strict';var emlformat=require(_0x7ddf('0x0'));var rimraf=require(_0x7ddf('0x1'));var zipdir=require(_0x7ddf('0x2'));var jsonpatch=require(_0x7ddf('0x3'));var rp=require('request-promise');var moment=require(_0x7ddf('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7ddf('0x5'));var util=require('util');var path=require(_0x7ddf('0x6'));var sox=require(_0x7ddf('0x7'));var csv=require('to-csv');var ejs=require(_0x7ddf('0x8'));var fs=require('fs');var fs_extra=require(_0x7ddf('0x9'));var _=require('lodash');var squel=require(_0x7ddf('0xa'));var crypto=require(_0x7ddf('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7ddf('0xc'));var querystring=require(_0x7ddf('0xd'));var Papa=require('papaparse');var Redis=require(_0x7ddf('0xe'));var authService=require(_0x7ddf('0xf'));var qs=require(_0x7ddf('0x10'));var as=require(_0x7ddf('0x11'));var hardwareService=require(_0x7ddf('0x12'));var logger=require(_0x7ddf('0x13'))(_0x7ddf('0x14'));var utils=require(_0x7ddf('0x15'));var config=require(_0x7ddf('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x7ddf('0x17'))['db'];function respondWithStatusCode(_0x520716,_0x3eb38a){_0x3eb38a=_0x3eb38a||0xcc;return function(_0x4eb763){if(_0x4eb763){return _0x520716['sendStatus'](_0x3eb38a);}return _0x520716[_0x7ddf('0x18')](_0x3eb38a)['end']();};}function respondWithResult(_0x14a8c7,_0x30f4f2){_0x30f4f2=_0x30f4f2||0xc8;return function(_0x1df708){if(_0x1df708){return _0x14a8c7[_0x7ddf('0x18')](_0x30f4f2)[_0x7ddf('0x19')](_0x1df708);}};}function respondWithFilteredResult(_0x2a79d6,_0xb7a477){return function(_0x2030d5){if(_0x2030d5){var _0xeea42d=typeof _0xb7a477[_0x7ddf('0x1a')]===_0x7ddf('0x1b')&&typeof _0xb7a477['limit']===_0x7ddf('0x1b');var _0x540bdf=_0x2030d5['count'];var _0x2b082b=_0xeea42d?0x0:_0xb7a477[_0x7ddf('0x1a')];var _0x54b5b0=_0xeea42d?_0x2030d5[_0x7ddf('0x1c')]:_0xb7a477['offset']+_0xb7a477[_0x7ddf('0x1d')];var _0x2baf84;if(_0x54b5b0>=_0x540bdf){_0x54b5b0=_0x540bdf;_0x2baf84=0xc8;}else{_0x2baf84=0xce;}_0x2a79d6[_0x7ddf('0x18')](_0x2baf84);return _0x2a79d6[_0x7ddf('0x1e')]('Content-Range',_0x2b082b+'-'+_0x54b5b0+'/'+_0x540bdf)[_0x7ddf('0x19')](_0x2030d5);}return null;};}function patchUpdates(_0xbb8937){return function(_0x10a090){try{jsonpatch[_0x7ddf('0x1f')](_0x10a090,_0xbb8937,!![]);}catch(_0x43c753){return BPromise[_0x7ddf('0x20')](_0x43c753);}return _0x10a090['save']();};}function saveUpdates(_0x350d7c,_0x264eae){return function(_0x3230ce){if(_0x3230ce){return _0x3230ce[_0x7ddf('0x21')](_0x350d7c)[_0x7ddf('0x22')](function(_0x2f09a8){return _0x2f09a8;});}return null;};}function removeEntity(_0x24a099,_0x21b1ec){return function(_0x5d021c){if(_0x5d021c){return _0x5d021c[_0x7ddf('0x23')]()[_0x7ddf('0x22')](function(){var _0x5a34a2=_0x5d021c[_0x7ddf('0x24')]({'plain':!![]});var _0x323d08=_0x7ddf('0x25');return db[_0x7ddf('0x26')][_0x7ddf('0x23')]({'where':{'type':_0x323d08,'resourceId':_0x5a34a2['id']}})[_0x7ddf('0x22')](function(){return _0x5d021c;});})[_0x7ddf('0x22')](function(){_0x24a099['status'](0xcc)[_0x7ddf('0x27')]();});}};}function handleEntityNotFound(_0xe9d3a4,_0x319a02){return function(_0x46c781){if(!_0x46c781){_0xe9d3a4[_0x7ddf('0x28')](0x194);}return _0x46c781;};}function handleError(_0x15c6a7,_0x333a07){_0x333a07=_0x333a07||0x1f4;return function(_0x200e61){logger[_0x7ddf('0x29')](_0x200e61[_0x7ddf('0x2a')]);if(_0x200e61[_0x7ddf('0x2b')]){delete _0x200e61[_0x7ddf('0x2b')];}_0x15c6a7['status'](_0x333a07)[_0x7ddf('0x2c')](_0x200e61);};}exports[_0x7ddf('0x2d')]=function(_0x516118,_0x372007){var _0x14a293={},_0x56f82a={},_0x38555e={'count':0x0,'rows':[]};var _0x1bd879=_[_0x7ddf('0x2e')](db[_0x7ddf('0x2f')][_0x7ddf('0x30')],function(_0x32e598){return{'name':_0x32e598[_0x7ddf('0x31')],'type':_0x32e598[_0x7ddf('0x32')]['key']};});_0x56f82a['model']=_['map'](_0x1bd879,_0x7ddf('0x2b'));_0x56f82a[_0x7ddf('0x33')]=_[_0x7ddf('0x34')](_0x516118[_0x7ddf('0x33')]);_0x56f82a[_0x7ddf('0x35')]=_['intersection'](_0x56f82a[_0x7ddf('0x36')],_0x56f82a[_0x7ddf('0x33')]);_0x14a293[_0x7ddf('0x37')]=_[_0x7ddf('0x38')](_0x56f82a[_0x7ddf('0x36')],qs[_0x7ddf('0x39')](_0x516118[_0x7ddf('0x33')][_0x7ddf('0x39')]));_0x14a293['attributes']=_0x14a293[_0x7ddf('0x37')][_0x7ddf('0x3a')]?_0x14a293[_0x7ddf('0x37')]:_0x56f82a[_0x7ddf('0x36')];if(!_0x516118['query']['hasOwnProperty'](_0x7ddf('0x3b'))){_0x14a293[_0x7ddf('0x1d')]=qs['limit'](_0x516118['query']['limit']);_0x14a293[_0x7ddf('0x1a')]=qs[_0x7ddf('0x1a')](_0x516118[_0x7ddf('0x33')]['offset']);}_0x14a293[_0x7ddf('0x3c')]=qs[_0x7ddf('0x3d')](_0x516118[_0x7ddf('0x33')][_0x7ddf('0x3d')]);_0x14a293[_0x7ddf('0x3e')]=qs['filters'](_['pick'](_0x516118['query'],_0x56f82a[_0x7ddf('0x35')]),_0x1bd879);if(_0x516118[_0x7ddf('0x33')][_0x7ddf('0x3f')]){_0x14a293[_0x7ddf('0x3e')]=_[_0x7ddf('0x40')](_0x14a293[_0x7ddf('0x3e')],{'$or':_[_0x7ddf('0x2e')](_0x1bd879,function(_0x4dc693){if(_0x4dc693[_0x7ddf('0x32')]!==_0x7ddf('0x41')){var _0x750bb9={};_0x750bb9[_0x4dc693['name']]={'$like':'%'+_0x516118['query'][_0x7ddf('0x3f')]+'%'};return _0x750bb9;}})});}_0x14a293=_[_0x7ddf('0x40')]({},_0x14a293,_0x516118[_0x7ddf('0x42')]);var _0x2bb934={'where':_0x14a293['where']};return db[_0x7ddf('0x2f')][_0x7ddf('0x1c')](_0x2bb934)[_0x7ddf('0x22')](function(_0x2c0e02){_0x38555e['count']=_0x2c0e02;if(_0x516118['query'][_0x7ddf('0x43')]){_0x14a293[_0x7ddf('0x44')]=[{'all':!![]}];}return db[_0x7ddf('0x2f')][_0x7ddf('0x45')](_0x14a293);})[_0x7ddf('0x22')](function(_0x3f05da){_0x38555e[_0x7ddf('0x46')]=_0x3f05da;return _0x38555e;})[_0x7ddf('0x22')](respondWithFilteredResult(_0x372007,_0x14a293))[_0x7ddf('0x47')](handleError(_0x372007,null));};exports[_0x7ddf('0x48')]=function(_0x373674,_0x40396c){var _0x392af3={'raw':!![],'where':{'id':_0x373674[_0x7ddf('0x49')]['id']}},_0x523e75={};_0x523e75[_0x7ddf('0x36')]=_[_0x7ddf('0x34')](db[_0x7ddf('0x2f')][_0x7ddf('0x30')]);_0x523e75[_0x7ddf('0x33')]=_[_0x7ddf('0x34')](_0x373674['query']);_0x523e75[_0x7ddf('0x35')]=_[_0x7ddf('0x38')](_0x523e75[_0x7ddf('0x36')],_0x523e75[_0x7ddf('0x33')]);_0x392af3['attributes']=_[_0x7ddf('0x38')](_0x523e75[_0x7ddf('0x36')],qs[_0x7ddf('0x39')](_0x373674['query']['fields']));_0x392af3[_0x7ddf('0x37')]=_0x392af3['attributes'][_0x7ddf('0x3a')]?_0x392af3[_0x7ddf('0x37')]:_0x523e75[_0x7ddf('0x36')];if(_0x373674[_0x7ddf('0x33')][_0x7ddf('0x43')]){_0x392af3['include']=[{'all':!![]}];}_0x392af3=_[_0x7ddf('0x40')]({},_0x392af3,_0x373674[_0x7ddf('0x42')]);return db[_0x7ddf('0x2f')]['find'](_0x392af3)[_0x7ddf('0x22')](handleEntityNotFound(_0x40396c,null))[_0x7ddf('0x22')](respondWithResult(_0x40396c,null))[_0x7ddf('0x47')](handleError(_0x40396c,null));};exports[_0x7ddf('0x4a')]=function(_0x135e8a,_0x54b4eb){return db[_0x7ddf('0x2f')][_0x7ddf('0x4a')](_0x135e8a['body'],{})['then'](function(_0x444f98){var _0x1f7d74=_0x135e8a[_0x7ddf('0x4b')][_0x7ddf('0x24')]({'plain':!![]});if(!_0x1f7d74)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1f7d74[_0x7ddf('0x4c')]===_0x7ddf('0x4b')){var _0x2f3268=_0x444f98[_0x7ddf('0x24')]({'plain':!![]});var _0x455a09='Pauses';return db[_0x7ddf('0x4d')][_0x7ddf('0x4e')]({'where':{'name':_0x455a09,'userProfileId':_0x1f7d74[_0x7ddf('0x4f')]},'raw':!![]})[_0x7ddf('0x22')](function(_0x5026ef){if(_0x5026ef&&_0x5026ef[_0x7ddf('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x2f3268[_0x7ddf('0x2b')],'resourceId':_0x2f3268['id'],'type':_0x5026ef[_0x7ddf('0x2b')],'sectionId':_0x5026ef['id']},{})[_0x7ddf('0x22')](function(){return _0x444f98;});}else{return _0x444f98;}})[_0x7ddf('0x47')](function(_0x538829){logger[_0x7ddf('0x29')](_0x7ddf('0x51'),_0x538829);throw _0x538829;});}return _0x444f98;})['then'](respondWithResult(_0x54b4eb,0xc9))[_0x7ddf('0x47')](handleError(_0x54b4eb,null));};exports['update']=function(_0x2da502,_0x3e9145){if(_0x2da502['body']['id']){delete _0x2da502['body']['id'];}return db[_0x7ddf('0x2f')]['find']({'where':{'id':_0x2da502[_0x7ddf('0x49')]['id']}})['then'](handleEntityNotFound(_0x3e9145,null))[_0x7ddf('0x22')](saveUpdates(_0x2da502[_0x7ddf('0x52')],null))[_0x7ddf('0x22')](respondWithResult(_0x3e9145,null))['catch'](handleError(_0x3e9145,null));};exports[_0x7ddf('0x23')]=function(_0x544b50,_0x2b32be){return db['Pause'][_0x7ddf('0x4e')]({'where':{'id':_0x544b50[_0x7ddf('0x49')]['id']}})[_0x7ddf('0x22')](handleEntityNotFound(_0x2b32be,null))[_0x7ddf('0x22')](removeEntity(_0x2b32be,null))[_0x7ddf('0x47')](handleError(_0x2b32be,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index f1323f4..cded850 100644 --- a/server/api/pause/pause.model.js +++ b/server/api/pause/pause.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7217=['../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1aeda2,_0x1217eb){var _0x32dc6d=function(_0x34a460){while(--_0x34a460){_0x1aeda2['push'](_0x1aeda2['shift']());}};_0x32dc6d(++_0x1217eb);}(_0x7217,0x19e));var _0x7721=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x7217[_0x3c2a69];return _0x596bc8;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Pause','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./pause.attributes'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 80d451c..764f9f4 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x79e09e,_0x4dfc94){var _0x469310=function(_0x3fa7d4){while(--_0x3fa7d4){_0x79e09e['push'](_0x79e09e['shift']());}};_0x469310(++_0x4dfc94);}(_0xb10b,0x12a));var _0xbb10=function(_0x23118b,_0x562da3){_0x23118b=_0x23118b-0x0;var _0x3636cf=_0xb10b[_0x23118b];return _0x3636cf;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x6d7088,_0x984e28){var _0x4e8560=function(_0xd45779){while(--_0xd45779){_0x6d7088['push'](_0x6d7088['shift']());}};_0x4e8560(++_0x984e28);}(_0xb10b,0x12a));var _0xbb10=function(_0x2bda14,_0x4fab1b){_0x2bda14=_0x2bda14-0x0;var _0xb5dd49=_0xb10b[_0x2bda14];return _0xb5dd49;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 7e8a543..c11d72a 100644 --- a/server/api/plugin/index.js +++ b/server/api/plugin/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x702d=['/:id/download','download','diskStorage','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','post','single','upload','/:id','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/webhook','isAuthenticated','show'];(function(_0x5c3edc,_0x50bcc8){var _0x1eaf77=function(_0x3359aa){while(--_0x3359aa){_0x5c3edc['push'](_0x5c3edc['shift']());}};_0x1eaf77(++_0x50bcc8);}(_0x702d,0x147));var _0xd702=function(_0x1bab1a,_0x359963){_0x1bab1a=_0x1bab1a-0x0;var _0x1a1862=_0x702d[_0x1bab1a];return _0x1a1862;};'use strict';var multer=require(_0xd702('0x0'));var util=require(_0xd702('0x1'));var path=require(_0xd702('0x2'));var timeout=require(_0xd702('0x3'));var express=require(_0xd702('0x4'));var router=express['Router']();var fs_extra=require(_0xd702('0x5'));var auth=require(_0xd702('0x6'));var interaction=require(_0xd702('0x7'));var config=require(_0xd702('0x8'));var controller=require('./plugin.controller');router[_0xd702('0x9')]('/',auth['isAuthenticated'](),controller[_0xd702('0xa')]);router[_0xd702('0x9')](_0xd702('0xb'),controller['webhookGet']);router[_0xd702('0x9')]('/:id',auth[_0xd702('0xc')](),controller[_0xd702('0xd')]);router[_0xd702('0x9')](_0xd702('0xe'),auth[_0xd702('0xc')](),controller[_0xd702('0xf')]);var upload=multer({'storage':multer[_0xd702('0x10')]({'destination':function(_0x1988eb,_0x5907cf,_0x15a632){_0x15a632(null,path['join'](config['root'],_0xd702('0x11')));},'filename':function(_0x42e1ad,_0x273577,_0x5c0dad){_0x273577[_0xd702('0x12')]=_0x273577[_0xd702('0x12')][_0xd702('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5c0dad(null,util[_0xd702('0x14')](_0xd702('0x15'),path[_0xd702('0x16')](_0x273577['originalname'],path[_0xd702('0x17')](_0x273577[_0xd702('0x12')])),Date['now'](),path[_0xd702('0x17')](_0x273577['originalname'])));}})});router[_0xd702('0x18')]('/',upload[_0xd702('0x19')]('file'),controller[_0xd702('0x1a')]);router[_0xd702('0x18')](_0xd702('0xb'),controller['webhookPost']);router['put'](_0xd702('0x1b'),auth['isAuthenticated'](),controller[_0xd702('0x1c')]);router[_0xd702('0x1d')](_0xd702('0x1b'),auth[_0xd702('0xc')](),controller[_0xd702('0x1d')]);module[_0xd702('0x1e')]=router; \ No newline at end of file +var _0x6aa7=['isAuthenticated','get','/webhook','webhookGet','/:id','show','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','extname','now','post','file','webhookPost','put','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x397c5e,_0x3a3bb9){var _0x590aa0=function(_0xc93b60){while(--_0xc93b60){_0x397c5e['push'](_0x397c5e['shift']());}};_0x590aa0(++_0x3a3bb9);}(_0x6aa7,0x178));var _0x76aa=function(_0xec8eb9,_0x584684){_0xec8eb9=_0xec8eb9-0x0;var _0x45f983=_0x6aa7[_0xec8eb9];return _0x45f983;};'use strict';var multer=require(_0x76aa('0x0'));var util=require('util');var path=require(_0x76aa('0x1'));var timeout=require(_0x76aa('0x2'));var express=require(_0x76aa('0x3'));var router=express[_0x76aa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x76aa('0x5'));var interaction=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var controller=require('./plugin.controller');router['get']('/',auth[_0x76aa('0x8')](),controller['index']);router[_0x76aa('0x9')](_0x76aa('0xa'),controller[_0x76aa('0xb')]);router['get'](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xd')]);router['get'](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xf')]);var upload=multer({'storage':multer[_0x76aa('0x10')]({'destination':function(_0x37f1ab,_0x128435,_0x2c5075){_0x2c5075(null,path[_0x76aa('0x11')](config[_0x76aa('0x12')],_0x76aa('0x13')));},'filename':function(_0x5e5f47,_0x112c39,_0x5df49c){_0x112c39[_0x76aa('0x14')]=_0x112c39[_0x76aa('0x14')][_0x76aa('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5df49c(null,util[_0x76aa('0x16')](_0x76aa('0x17'),path['basename'](_0x112c39['originalname'],path[_0x76aa('0x18')](_0x112c39['originalname'])),Date[_0x76aa('0x19')](),path[_0x76aa('0x18')](_0x112c39['originalname'])));}})});router[_0x76aa('0x1a')]('/',upload['single'](_0x76aa('0x1b')),controller['upload']);router[_0x76aa('0x1a')](_0x76aa('0xa'),controller[_0x76aa('0x1c')]);router[_0x76aa('0x1d')](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller['update']);router['delete'](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1e')]);module[_0x76aa('0x1f')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 6501775..7e50104 100644 --- a/server/api/plugin/plugin.attributes.js +++ b/server/api/plugin/plugin.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x125b=['html','script','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports'];(function(_0x237546,_0xa81b26){var _0x233e29=function(_0x728aa4){while(--_0x728aa4){_0x237546['push'](_0x237546['shift']());}};_0x233e29(++_0xa81b26);}(_0x125b,0xa3));var _0xb125=function(_0x346f31,_0x20a676){_0x346f31=_0x346f31-0x0;var _0x2bf8fc=_0x125b[_0x346f31];return _0x2bf8fc;};'use strict';var Sequelize=require(_0xb125('0x0'));module[_0xb125('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0xb125('0x2'),_0xb125('0x3'))},'description':{'type':Sequelize[_0xb125('0x4')]},'version':{'type':Sequelize[_0xb125('0x4')]},'path':{'type':Sequelize[_0xb125('0x5')],'comment':_0xb125('0x6')},'active':{'type':Sequelize[_0xb125('0x7')],'defaultValue':0x0,'comment':_0xb125('0x8')},'sidebar':{'type':Sequelize[_0xb125('0x9')](_0xb125('0xa'),_0xb125('0xb'),_0xb125('0xc'),_0xb125('0xd')),'defaultValue':_0xb125('0xc'),'comment':_0xb125('0xe')},'icon':{'type':Sequelize[_0xb125('0x5')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0xb125('0x5')]},'scriptName':{'type':Sequelize[_0xb125('0x5')]},'scriptPath':{'type':Sequelize[_0xb125('0x5')]}}; \ No newline at end of file +var _0xe37a=['script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe37a,0x1bd));var _0xae37=function(_0x1dce64,_0x4c5f4f){_0x1dce64=_0x1dce64-0x0;var _0x58a0f1=_0xe37a[_0x1dce64];return _0x58a0f1;};'use strict';var Sequelize=require(_0xae37('0x0'));module[_0xae37('0x1')]={'name':{'type':Sequelize[_0xae37('0x2')]},'type':{'type':Sequelize[_0xae37('0x3')](_0xae37('0x4'),_0xae37('0x5'))},'description':{'type':Sequelize[_0xae37('0x6')]},'version':{'type':Sequelize[_0xae37('0x6')]},'path':{'type':Sequelize['STRING'],'comment':_0xae37('0x7')},'active':{'type':Sequelize[_0xae37('0x8')],'defaultValue':0x0,'comment':_0xae37('0x9')},'sidebar':{'type':Sequelize[_0xae37('0x3')](_0xae37('0xa'),_0xae37('0xb'),_0xae37('0xc'),_0xae37('0xd')),'defaultValue':'always','comment':_0xae37('0xe')},'icon':{'type':Sequelize[_0xae37('0x2')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0xae37('0x2')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0xae37('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 08a81f5..7cbf6f1 100644 --- a/server/api/plugin/plugin.controller.js +++ b/server/api/plugin/plugin.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe329=['Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','Invalid\x20manifest:\x20views\x20missing','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','always','icon','icon-apps','plugins','test','Warning:\x20agent\x20view\x20not\x20specified','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','format','headers','content-length','content-type','set','endsWith','statusCode','\x27PATH\x27\x20parameter\x20not\x20specified','%s%s','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./plugin.socket','register','status','end','undefined','count','offset','Content-Range','json','apply','then','destroy','Plugins','UserProfileResource','sendStatus','error','stack','name','send','index','map','Plugin','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','limit','order','sort','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','params','intersection','catch','download','find','root','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','server/files/plugins','dirname','node_modules/**/*','join','attachments/**/*','finalize','close','existsSync','Sequelize','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some'];(function(_0x657fd9,_0x23febd){var _0x43b522=function(_0x8bd3af){while(--_0x8bd3af){_0x657fd9['push'](_0x657fd9['shift']());}};_0x43b522(++_0x23febd);}(_0xe329,0xe2));var _0x9e32=function(_0x2e0888,_0x1f5ead){_0x2e0888=_0x2e0888-0x0;var _0x5ecf51=_0xe329[_0x2e0888];return _0x5ecf51;};'use strict';var emlformat=require(_0x9e32('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9e32('0x1'));var jsonpatch=require(_0x9e32('0x2'));var rp=require('request-promise');var moment=require(_0x9e32('0x3'));var BPromise=require(_0x9e32('0x4'));var Mustache=require(_0x9e32('0x5'));var util=require(_0x9e32('0x6'));var path=require(_0x9e32('0x7'));var sox=require(_0x9e32('0x8'));var csv=require(_0x9e32('0x9'));var ejs=require(_0x9e32('0xa'));var fs=require('fs');var fs_extra=require(_0x9e32('0xb'));var _=require(_0x9e32('0xc'));var squel=require(_0x9e32('0xd'));var crypto=require(_0x9e32('0xe'));var jsforce=require(_0x9e32('0xf'));var deskjs=require(_0x9e32('0x10'));var toCsv=require(_0x9e32('0x9'));var querystring=require(_0x9e32('0x11'));var Papa=require(_0x9e32('0x12'));var extract=require(_0x9e32('0x13'));var rimraf=require('rimraf');var archiver=require('archiver');var Redis=require('ioredis');var authService=require(_0x9e32('0x14'));var qs=require(_0x9e32('0x15'));var as=require(_0x9e32('0x16'));var hardwareService=require(_0x9e32('0x17'));var logger=require(_0x9e32('0x18'))(_0x9e32('0x19'));var utils=require(_0x9e32('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x9e32('0x1b'));var db=require(_0x9e32('0x1c'))['db'];config[_0x9e32('0x1d')]=_[_0x9e32('0x1e')](config[_0x9e32('0x1d')],{'host':_0x9e32('0x1f'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9e32('0x1d')]));require(_0x9e32('0x20'))[_0x9e32('0x21')](socket);function respondWithStatusCode(_0x21b888,_0x2043bc){_0x2043bc=_0x2043bc||0xcc;return function(_0x281863){if(_0x281863){return _0x21b888['sendStatus'](_0x2043bc);}return _0x21b888[_0x9e32('0x22')](_0x2043bc)[_0x9e32('0x23')]();};}function respondWithResult(_0x51e18f,_0x556128){_0x556128=_0x556128||0xc8;return function(_0x405be0){if(_0x405be0){return _0x51e18f[_0x9e32('0x22')](_0x556128)['json'](_0x405be0);}};}function respondWithFilteredResult(_0x8d9648,_0x54606a){return function(_0x5546c1){if(_0x5546c1){var _0x3b18b4=typeof _0x54606a['offset']===_0x9e32('0x24')&&typeof _0x54606a['limit']==='undefined';var _0xc8717f=_0x5546c1[_0x9e32('0x25')];var _0x356ef0=_0x3b18b4?0x0:_0x54606a[_0x9e32('0x26')];var _0xd5cca8=_0x3b18b4?_0x5546c1['count']:_0x54606a['offset']+_0x54606a['limit'];var _0x1ba78f;if(_0xd5cca8>=_0xc8717f){_0xd5cca8=_0xc8717f;_0x1ba78f=0xc8;}else{_0x1ba78f=0xce;}_0x8d9648[_0x9e32('0x22')](_0x1ba78f);return _0x8d9648['set'](_0x9e32('0x27'),_0x356ef0+'-'+_0xd5cca8+'/'+_0xc8717f)[_0x9e32('0x28')](_0x5546c1);}return null;};}function patchUpdates(_0x455fc0){return function(_0xac1c18){try{jsonpatch[_0x9e32('0x29')](_0xac1c18,_0x455fc0,!![]);}catch(_0xc45d3){return BPromise['reject'](_0xc45d3);}return _0xac1c18['save']();};}function saveUpdates(_0x4fee53,_0x3d0192){return function(_0x367845){if(_0x367845){return _0x367845['update'](_0x4fee53)[_0x9e32('0x2a')](function(_0x39775f){return _0x39775f;});}return null;};}function removeEntity(_0x9d9e34,_0x4e8dc0){return function(_0x3fe5ca){if(_0x3fe5ca){return _0x3fe5ca[_0x9e32('0x2b')]()['then'](function(){var _0x11f791=_0x3fe5ca['get']({'plain':!![]});var _0x7b1cbe=_0x9e32('0x2c');return db[_0x9e32('0x2d')][_0x9e32('0x2b')]({'where':{'type':_0x7b1cbe,'resourceId':_0x11f791['id']}})[_0x9e32('0x2a')](function(){return _0x3fe5ca;});})['then'](function(){_0x9d9e34[_0x9e32('0x22')](0xcc)[_0x9e32('0x23')]();});}};}function handleEntityNotFound(_0x54860b,_0x2696cc){return function(_0x3acc01){if(!_0x3acc01){_0x54860b[_0x9e32('0x2e')](0x194);}return _0x3acc01;};}function handleError(_0x5c9335,_0x815f6c){_0x815f6c=_0x815f6c||0x1f4;return function(_0x3eead2){logger[_0x9e32('0x2f')](_0x3eead2[_0x9e32('0x30')]);if(_0x3eead2[_0x9e32('0x31')]){delete _0x3eead2['name'];}_0x5c9335[_0x9e32('0x22')](_0x815f6c)[_0x9e32('0x32')](_0x3eead2);};}exports[_0x9e32('0x33')]=function(_0x1af44,_0x3c9d84){var _0x17559a={},_0x971de9={},_0x210a43={'count':0x0,'rows':[]};var _0x263de6=_[_0x9e32('0x34')](db[_0x9e32('0x35')][_0x9e32('0x36')],function(_0x2631ce){return{'name':_0x2631ce[_0x9e32('0x37')],'type':_0x2631ce[_0x9e32('0x38')][_0x9e32('0x39')]};});_0x971de9['model']=_['map'](_0x263de6,_0x9e32('0x31'));_0x971de9[_0x9e32('0x3a')]=_[_0x9e32('0x3b')](_0x1af44['query']);_0x971de9[_0x9e32('0x3c')]=_['intersection'](_0x971de9[_0x9e32('0x3d')],_0x971de9[_0x9e32('0x3a')]);_0x17559a[_0x9e32('0x3e')]=_['intersection'](_0x971de9['model'],qs[_0x9e32('0x3f')](_0x1af44[_0x9e32('0x3a')][_0x9e32('0x3f')]));_0x17559a['attributes']=_0x17559a[_0x9e32('0x3e')][_0x9e32('0x40')]?_0x17559a[_0x9e32('0x3e')]:_0x971de9[_0x9e32('0x3d')];if(!_0x1af44[_0x9e32('0x3a')][_0x9e32('0x41')]('nolimit')){_0x17559a[_0x9e32('0x42')]=qs[_0x9e32('0x42')](_0x1af44[_0x9e32('0x3a')][_0x9e32('0x42')]);_0x17559a[_0x9e32('0x26')]=qs[_0x9e32('0x26')](_0x1af44[_0x9e32('0x3a')][_0x9e32('0x26')]);}_0x17559a[_0x9e32('0x43')]=qs[_0x9e32('0x44')](_0x1af44['query'][_0x9e32('0x44')]);_0x17559a[_0x9e32('0x45')]=qs[_0x9e32('0x3c')](_['pick'](_0x1af44[_0x9e32('0x3a')],_0x971de9[_0x9e32('0x3c')]),_0x263de6);if(_0x1af44[_0x9e32('0x3a')]['filter']){_0x17559a[_0x9e32('0x45')]=_['merge'](_0x17559a['where'],{'$or':_[_0x9e32('0x34')](_0x263de6,function(_0x5788d1){if(_0x5788d1['type']!==_0x9e32('0x46')){var _0x27b6a3={};_0x27b6a3[_0x5788d1[_0x9e32('0x31')]]={'$like':'%'+_0x1af44['query'][_0x9e32('0x47')]+'%'};return _0x27b6a3;}})});}_0x17559a=_[_0x9e32('0x48')]({},_0x17559a,_0x1af44[_0x9e32('0x49')]);var _0xac6c64={'where':_0x17559a[_0x9e32('0x45')]};return db[_0x9e32('0x35')][_0x9e32('0x25')](_0xac6c64)[_0x9e32('0x2a')](function(_0x34b088){_0x210a43[_0x9e32('0x25')]=_0x34b088;if(_0x1af44[_0x9e32('0x3a')][_0x9e32('0x4a')]){_0x17559a[_0x9e32('0x4b')]=[{'all':!![]}];}return db[_0x9e32('0x35')][_0x9e32('0x4c')](_0x17559a);})[_0x9e32('0x2a')](function(_0x1b2308){_0x210a43[_0x9e32('0x4d')]=_0x1b2308;return _0x210a43;})[_0x9e32('0x2a')](respondWithFilteredResult(_0x3c9d84,_0x17559a))['catch'](handleError(_0x3c9d84,null));};exports[_0x9e32('0x4e')]=function(_0x305552,_0x5727fe){var _0x36f63c={'raw':!![],'where':{'id':_0x305552[_0x9e32('0x4f')]['id']}},_0x49c682={};_0x49c682[_0x9e32('0x3d')]=_['keys'](db[_0x9e32('0x35')][_0x9e32('0x36')]);_0x49c682[_0x9e32('0x3a')]=_['keys'](_0x305552[_0x9e32('0x3a')]);_0x49c682[_0x9e32('0x3c')]=_[_0x9e32('0x50')](_0x49c682[_0x9e32('0x3d')],_0x49c682[_0x9e32('0x3a')]);_0x36f63c['attributes']=_['intersection'](_0x49c682[_0x9e32('0x3d')],qs[_0x9e32('0x3f')](_0x305552['query'][_0x9e32('0x3f')]));_0x36f63c['attributes']=_0x36f63c[_0x9e32('0x3e')][_0x9e32('0x40')]?_0x36f63c['attributes']:_0x49c682['model'];if(_0x305552[_0x9e32('0x3a')][_0x9e32('0x4a')]){_0x36f63c[_0x9e32('0x4b')]=[{'all':!![]}];}_0x36f63c=_[_0x9e32('0x48')]({},_0x36f63c,_0x305552[_0x9e32('0x49')]);return db[_0x9e32('0x35')]['find'](_0x36f63c)[_0x9e32('0x2a')](handleEntityNotFound(_0x5727fe,null))['then'](respondWithResult(_0x5727fe,null))[_0x9e32('0x51')](handleError(_0x5727fe,null));};exports[_0x9e32('0x52')]=function(_0x370034,_0x40ed02,_0x15d3db){return db['Plugin'][_0x9e32('0x53')]({'where':{'id':_0x370034['params']['id']},'attributes':['name','path'],'raw':!![]})[_0x9e32('0x2a')](handleEntityNotFound(_0x40ed02,null))[_0x9e32('0x2a')](function(_0x17b09b){if(_0x17b09b){var _0x5eff6d=path['join'](config[_0x9e32('0x54')],'server/files/plugins',util['format'](_0x9e32('0x55'),path[_0x9e32('0x56')](_0x17b09b['path'])));var _0x3fe73c=fs[_0x9e32('0x57')](_0x5eff6d);var _0x42db90=archiver(_0x9e32('0x58'),{'zlib':{'level':0x9}});_0x42db90['on'](_0x9e32('0x59'),function(_0x4c482c){if(_0x4c482c[_0x9e32('0x5a')]===_0x9e32('0x5b')){logger[_0x9e32('0x2f')](_0x4c482c);}else{throw new db['Sequelize'][(_0x9e32('0x5c'))](_0x9e32('0x5d'));}});_0x42db90['on'](_0x9e32('0x2f'),function(_0x38cb66){throw new db['Sequelize'][(_0x9e32('0x5c'))](_0x9e32('0x5d'));});_0x42db90[_0x9e32('0x5e')](_0x3fe73c);_0x42db90[_0x9e32('0x5f')]('**/*',{'cwd':path['join'](config[_0x9e32('0x54')],_0x9e32('0x60'),path[_0x9e32('0x61')](_0x17b09b['path'])),'ignore':[path['join'](path[_0x9e32('0x56')](_0x17b09b['path']),_0x9e32('0x62')),path[_0x9e32('0x63')](path['basename'](_0x17b09b[_0x9e32('0x7')]),_0x9e32('0x64'))],'nodir':!![]})[_0x9e32('0x65')]();_0x3fe73c['on'](_0x9e32('0x66'),function(){if(!fs[_0x9e32('0x67')](_0x5eff6d)){throw new db[(_0x9e32('0x68'))][(_0x9e32('0x5c'))](_0x9e32('0x69'));}return _0x40ed02[_0x9e32('0x52')](_0x5eff6d,util['format'](_0x9e32('0x55'),path[_0x9e32('0x56')](_0x17b09b['path'])),function(_0x38c973){if(_0x38c973){throw new db['Sequelize']['Error'](_0x9e32('0x6a'));}fs[_0x9e32('0x6b')](_0x5eff6d);logger['info']('Download\x20completed');logger[_0x9e32('0x6c')](_0x9e32('0x6d'));});});}return null;})[_0x9e32('0x51')](handleError(_0x40ed02,null));};exports[_0x9e32('0x6e')]=function(_0xe71d81,_0xe2edea,_0x15bf9f){var _0x17f277=path[_0x9e32('0x56')](_0xe71d81[_0x9e32('0x6f')][_0x9e32('0x70')],path['extname'](_0xe71d81['file'][_0x9e32('0x70')]));var _0x5114bf=path[_0x9e32('0x63')](config[_0x9e32('0x54')],'server/files/plugins',_0xe71d81['file']['filename']);var _0xfa5315=path[_0x9e32('0x63')](config[_0x9e32('0x54')],_0x9e32('0x60'),_0x17f277);logger[_0x9e32('0x6c')](_0x9e32('0x71'),_0x5114bf);logger[_0x9e32('0x6c')](_0x9e32('0x72'),_0xfa5315);try{fs['chmodSync'](_0x5114bf,parseInt(_0x9e32('0x73'),0x8));extract(_0x5114bf,{'dir':_0xfa5315},function(_0x56047f){if(_0x56047f){logger[_0x9e32('0x2f')](_0x56047f);handleError(_0x56047f,!![]);};var _0x2fd589=fs[_0x9e32('0x74')](_0xfa5315);if(_0x2fd589['length']>0x1){removeReferences(_0x5114bf,_0xfa5315);logger[_0x9e32('0x2f')]('Invalid\x20plugin\x20structure');return _0x15bf9f(new Error(_0x9e32('0x75')));}var _0x1d7ebf=fs[_0x9e32('0x76')](path['join'](_0xfa5315,_0x2fd589[0x0]));if(_0x1d7ebf[_0x9e32('0x77')]()){removeReferences(_0x5114bf,_0xfa5315);logger[_0x9e32('0x2f')](_0x9e32('0x75'));return _0x15bf9f(new Error(_0x9e32('0x75')));}if(_0x1d7ebf[_0x9e32('0x78')]()){var _0x5f0df4=fs[_0x9e32('0x74')](path[_0x9e32('0x63')](_0xfa5315,_0x2fd589[0x0]));if(_0x5f0df4['length']===0x0){removeReferences(_0x5114bf,_0xfa5315);logger[_0x9e32('0x2f')](_0x9e32('0x75'));return _0x15bf9f(new Error('Invalid\x20plugin\x20structure'));}var _0x467c64=_0x5f0df4[_0x9e32('0x79')](function(_0x47bf7a){return _0x47bf7a==='manifest.json';});if(!_0x467c64){return _0x15bf9f(new Error(_0x9e32('0x7a')));}var _0x442e91=fs[_0x9e32('0x7b')](path['join'](_0xfa5315,_0x2fd589[0x0],'manifest.json'));var _0x1ab7f6=JSON['parse'](_0x442e91);if(_0x9e32('0x24')==typeof _0x1ab7f6[_0x9e32('0x31')]){return _0x15bf9f(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x9e32('0x24')==typeof _0x1ab7f6[_0x9e32('0x38')]){return _0x15bf9f(new Error(_0x9e32('0x7c')));}if(_0x9e32('0x24')==typeof _0x1ab7f6[_0x9e32('0x7d')]){return _0x15bf9f(new Error(_0x9e32('0x7e')));}if(_0x9e32('0x24')==typeof _0x1ab7f6[_0x9e32('0x7f')]){return _0x15bf9f(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x1ab7f6[_0x9e32('0x38')]===_0x9e32('0x80')){if('undefined'==typeof _0x1ab7f6[_0x9e32('0x7f')]['views']){return _0x15bf9f(new Error(_0x9e32('0x81')));}if(_0x9e32('0x24')==typeof _0x1ab7f6[_0x9e32('0x7f')][_0x9e32('0x82')][_0x9e32('0x83')]&&_0x9e32('0x24')==typeof _0x1ab7f6[_0x9e32('0x7f')][_0x9e32('0x82')][_0x9e32('0x84')]){return _0x15bf9f(new Error(_0x9e32('0x85')));}}else if(_0x1ab7f6[_0x9e32('0x38')]===_0x9e32('0x86')){if(_0x9e32('0x24')==typeof _0x1ab7f6[_0x9e32('0x7f')][_0x9e32('0x87')]){return _0x15bf9f(new Error(_0x9e32('0x88')));}if('undefined'==typeof _0x1ab7f6[_0x9e32('0x7f')][_0x9e32('0x89')]){return _0x15bf9f(new Error(_0x9e32('0x8a')));}}else{return _0x15bf9f(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x34ba23=_0x1ab7f6['name'];var _0x19de28=_0x1ab7f6[_0x9e32('0x8b')];var _0x4094ce=_0x1ab7f6[_0x9e32('0x38')];var _0x59375e=_0x1ab7f6[_0x9e32('0x8c')]?_0x1ab7f6[_0x9e32('0x8c')]:_0x9e32('0x8d');var _0x27367a=_0x1ab7f6[_0x9e32('0x8e')]?_0x1ab7f6[_0x9e32('0x8e')]:_0x9e32('0x8f');var _0x58b14e='';var _0x5d9838='';var _0xb97393='';var _0xa31a9e='';var _0x4997a7=_0x1ab7f6[_0x9e32('0x7d')];if(_0x4094ce===_0x9e32('0x80')){if(_0x9e32('0x24')!=typeof _0x1ab7f6[_0x9e32('0x7f')][_0x9e32('0x82')]['admin']){var _0x2e7f8c=_0x1ab7f6[_0x9e32('0x7f')][_0x9e32('0x82')][_0x9e32('0x83')];if(!/^(f|ht)tps?:\/\//i['test'](_0x2e7f8c)){_0x58b14e=path[_0x9e32('0x63')](_0x9e32('0x90'),_0x17f277,_0x2fd589[0x0],_0x2e7f8c);}else{_0x58b14e=_0x2e7f8c;}}else{logger[_0x9e32('0x6c')]('Warning:\x20admin\x20view\x20not\x20specified');}if('undefined'!=typeof _0x1ab7f6['parameters'][_0x9e32('0x82')]['agent']){var _0x68cd57=_0x1ab7f6[_0x9e32('0x7f')]['views'][_0x9e32('0x84')];if(!/^(f|ht)tps?:\/\//i[_0x9e32('0x91')](_0x68cd57)){_0x5d9838=path[_0x9e32('0x63')](_0x9e32('0x90'),_0x17f277,_0x2fd589[0x0],_0x68cd57);}else{_0x5d9838=_0x68cd57;}}else{logger[_0x9e32('0x6c')](_0x9e32('0x92'));}}else if(_0x4094ce===_0x9e32('0x86')){_0xb97393=_0x1ab7f6[_0x9e32('0x7f')][_0x9e32('0x87')];_0xa31a9e=_0x1ab7f6[_0x9e32('0x7f')][_0x9e32('0x89')];if(_0x9e32('0x24')!=typeof _0x1ab7f6[_0x9e32('0x7f')][_0x9e32('0x82')]){if(_0x9e32('0x24')!=typeof _0x1ab7f6[_0x9e32('0x7f')][_0x9e32('0x82')][_0x9e32('0x83')]){var _0x2e7f8c=_0x1ab7f6[_0x9e32('0x7f')][_0x9e32('0x82')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x9e32('0x91')](_0x2e7f8c)){_0x58b14e=path[_0x9e32('0x63')](_0x9e32('0x90'),_0x17f277,_0x2fd589[0x0],_0x2e7f8c);}else{_0x58b14e=_0x2e7f8c;}}if(_0x9e32('0x24')!=typeof _0x1ab7f6[_0x9e32('0x7f')]['views'][_0x9e32('0x84')]){var _0x68cd57=_0x1ab7f6['parameters'][_0x9e32('0x82')][_0x9e32('0x84')];if(!/^(f|ht)tps?:\/\//i[_0x9e32('0x91')](_0x68cd57)){_0x5d9838=path[_0x9e32('0x63')](_0x9e32('0x90'),_0x17f277,_0x2fd589[0x0],_0x68cd57);}else{_0x5d9838=_0x68cd57;}}}}var _0x5e810e={'name':_0x34ba23,'description':_0x19de28,'path':path['join'](_0x17f277,_0x2fd589[0x0]),'type':_0x4094ce,'sidebar':_0x59375e,'icon':_0x27367a,'adminUrl':_0x58b14e,'agentUrl':_0x5d9838,'scriptName':_0xb97393,'scriptPath':_0xa31a9e,'version':_0x4997a7};removeReferences(_0x5114bf,null);return db[_0x9e32('0x35')]['create'](_0x5e810e)['then'](function(_0x530196){var _0x45abea={'role':_0xe71d81['body']['role'],'userProfileId':_0xe71d81[_0x9e32('0x93')][_0x9e32('0x94')]};if(!_0x45abea)throw new Error(_0x9e32('0x95'));if(_0x45abea[_0x9e32('0x96')]===_0x9e32('0x97')){var _0x5086c3=_0x530196[_0x9e32('0x98')]({'plain':!![]});return db['UserProfileSection'][_0x9e32('0x53')]({'where':{'name':_0x9e32('0x2c'),'userProfileId':_0x45abea[_0x9e32('0x94')]},'raw':!![]})[_0x9e32('0x2a')](function(_0x32270a){if(_0x32270a&&_0x32270a[_0x9e32('0x99')]===0x0){return db['UserProfileResource']['create']({'name':_0x5086c3[_0x9e32('0x31')],'resourceId':_0x5086c3['id'],'type':_0x32270a['name'],'sectionId':_0x32270a['id']},{})[_0x9e32('0x2a')](function(){return _0x530196;});}else{return _0x530196;}})['catch'](function(_0x220950){logger[_0x9e32('0x2f')](_0x9e32('0x9a'),_0x220950);throw _0x220950;});}return _0x530196;})[_0x9e32('0x2a')](respondWithResult(_0xe2edea,null))['catch'](handleError(_0xe2edea,null));}});}catch(_0xca2371){_0xe2edea[_0x9e32('0x22')](0x1f4)[_0x9e32('0x32')](_0xca2371);}};function removeReferences(_0xb2c409,_0xd9e39){try{if(_0xb2c409){fs['unlinkSync'](_0xb2c409);logger[_0x9e32('0x6c')](_0x9e32('0x9b'));}if(_0xd9e39){rimraf(_0xd9e39,function(){});logger[_0x9e32('0x6c')](_0x9e32('0x9c'));}}catch(_0x4ed075){logger[_0x9e32('0x2f')](_0x4ed075);}}exports['update']=function(_0x40e6b1,_0x7ea59e,_0x3b1feb){return db['Plugin'][_0x9e32('0x53')]({'where':{'id':_0x40e6b1[_0x9e32('0x4f')]['id']}})['then'](handleEntityNotFound(_0x7ea59e,null))[_0x9e32('0x2a')](saveUpdates(_0x40e6b1[_0x9e32('0x93')],null))[_0x9e32('0x2a')](respondWithResult(_0x7ea59e,null))['catch'](handleError(_0x7ea59e,null));};exports[_0x9e32('0x9d')]=function(_0x290953,_0x3cd0d1,_0x46b9ea){return db[_0x9e32('0x35')]['find']({'where':{'id':_0x290953[_0x9e32('0x4f')]['id']}})[_0x9e32('0x2a')](function(_0x80617c){if(_0x80617c){return _0x80617c[_0x9e32('0x2b')]();}})['then'](function(_0xd020aa){rimraf(path['join'](config['root'],'server/files/plugins',path[_0x9e32('0x61')](_0xd020aa['path'])),function(){});return _0xd020aa;})['then'](handleEntityNotFound(_0x3cd0d1,null))[_0x9e32('0x2a')](respondWithStatusCode(_0x3cd0d1,null))[_0x9e32('0x51')](handleError(_0x3cd0d1,null));};exports['webhookGet']=function(_0x2ad9db,_0x4459f5,_0x8f05c4){return BPromise[_0x9e32('0x9e')]()[_0x9e32('0x2a')](function(){if(!_0x2ad9db[_0x9e32('0x3a')][_0x9e32('0x7')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x2ad9db[_0x9e32('0x3a')][_0x9e32('0x9f')]){throw new Error(_0x9e32('0xa0'));}var _0x30bdba=_0x2ad9db[_0x9e32('0x3a')][_0x9e32('0xa1')]?_0x2ad9db[_0x9e32('0x3a')][_0x9e32('0xa1')]+':'+_0x2ad9db[_0x9e32('0x3a')][_0x9e32('0x9f')]:_0x9e32('0xa2')+_0x2ad9db[_0x9e32('0x3a')][_0x9e32('0x9f')];var _0x41f0f6=_0x2ad9db[_0x9e32('0x3a')][_0x9e32('0x28')]?_0x2ad9db[_0x9e32('0x3a')][_0x9e32('0x28')]:!![];var _0x269444=_0x2ad9db[_0x9e32('0x3a')]['encoding']?_0x2ad9db['query'][_0x9e32('0xa3')]:null;var _0xd88f8c={'method':_0x2ad9db[_0x9e32('0xa4')],'uri':util[_0x9e32('0xa5')]('%s%s',_0x30bdba,_0x2ad9db['query'][_0x9e32('0x7')]),'json':_0x41f0f6,'resolveWithFullResponse':!![],'encoding':_0x269444,'qs':_0x2ad9db[_0x9e32('0x3a')]};if(_0x2ad9db['headers']){_0xd88f8c[_0x9e32('0xa6')]=_0x2ad9db[_0x9e32('0xa6')];if(_0xd88f8c[_0x9e32('0xa6')][_0x9e32('0xa7')]){delete _0xd88f8c['headers'][_0x9e32('0xa7')];}}if(_0xd88f8c['headers']['content-type']){delete _0xd88f8c['headers'][_0x9e32('0xa8')];}return rp(_0xd88f8c);})[_0x9e32('0x2a')](function(_0x2a9e4e){if(_0x2a9e4e){_0x4459f5[_0x9e32('0xa9')](_0x2a9e4e[_0x9e32('0xa6')]);logger[_0x9e32('0x6c')](_0x2a9e4e['body']);if(_[_0x9e32('0xaa')](_0x2ad9db[_0x9e32('0x3a')][_0x9e32('0x7')],_0x9e32('0x52'))&&_0x2a9e4e[_0x9e32('0xab')]==0x1f4){return _0x4459f5[_0x9e32('0x2e')](_0x2a9e4e[_0x9e32('0xab')]);}else{return _0x4459f5[_0x9e32('0x22')](_0x2a9e4e[_0x9e32('0xab')])[_0x9e32('0x32')](_0x2a9e4e[_0x9e32('0x93')]);}}else{return _0x4459f5[_0x9e32('0x2e')](0xc8);}})[_0x9e32('0x51')](handleError(_0x4459f5,null));};exports['webhookPost']=function(_0x4cdd06,_0x16772d,_0x377e29){return BPromise['resolve']()[_0x9e32('0x2a')](function(){if(!_0x4cdd06[_0x9e32('0x3a')]['path']){throw new Error(_0x9e32('0xac'));}if(!_0x4cdd06[_0x9e32('0x3a')][_0x9e32('0x9f')]){throw new Error(_0x9e32('0xa0'));}var _0x28c3d=_0x4cdd06[_0x9e32('0x3a')]['hostname']?_0x4cdd06[_0x9e32('0x3a')][_0x9e32('0xa1')]+':'+_0x4cdd06[_0x9e32('0x3a')][_0x9e32('0x9f')]:_0x9e32('0xa2')+_0x4cdd06['query'][_0x9e32('0x9f')];var _0x4d87e1=_0x4cdd06[_0x9e32('0x3a')]['json']?_0x4cdd06['query']['json']:!![];var _0x15efb7=_0x4cdd06[_0x9e32('0x3a')]['encoding']?_0x4cdd06['query'][_0x9e32('0xa3')]:null;var _0x56cb48={'method':_0x4cdd06[_0x9e32('0xa4')],'uri':util['format'](_0x9e32('0xad'),_0x28c3d,_0x4cdd06[_0x9e32('0x3a')][_0x9e32('0x7')]),'json':_0x4d87e1,'resolveWithFullResponse':!![],'encoding':_0x15efb7,'body':_0x4cdd06['body']};if(_0x4cdd06['headers']){_0x56cb48['headers']=_0x4cdd06[_0x9e32('0xa6')];if(_0x56cb48[_0x9e32('0xa6')][_0x9e32('0xa7')]){delete _0x56cb48['headers'][_0x9e32('0xa7')];}}if(_0x56cb48[_0x9e32('0xa6')][_0x9e32('0xa8')]){delete _0x56cb48[_0x9e32('0xa6')][_0x9e32('0xa8')];}return rp(_0x56cb48);})[_0x9e32('0x2a')](function(_0x1df274){if(_0x1df274){_0x16772d[_0x9e32('0xa9')](_0x1df274['headers']);logger[_0x9e32('0x6c')](_0x1df274[_0x9e32('0x93')]);return _0x16772d[_0x9e32('0x22')](_0x1df274[_0x9e32('0xab')])[_0x9e32('0x32')](_0x1df274[_0x9e32('0x93')]);}else{return _0x16772d[_0x9e32('0x2e')](0xc8);}})['catch'](handleError(_0x16772d,null));}; \ No newline at end of file +var _0x6745=['reject','save','update','then','get','Plugins','UserProfileResource','destroy','error','name','send','index','map','Plugin','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','download','join','server/files/plugins','format','%s.zip','basename','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','root','dirname','node_modules/**/*','attachments/**/*','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','readdirSync','Invalid\x20plugin\x20structure','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','script','scriptName','scriptPath','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','version','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','role','body','userProfileId','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Extracted\x20folder\x20removed','delete','webhookGet','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','headers','content-length','content-type','endsWith','statusCode','\x27PATH\x27\x20parameter\x20not\x20specified','%s%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','extract-zip','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range'];(function(_0x39f0c9,_0x54864d){var _0x66cc64=function(_0x363cd8){while(--_0x363cd8){_0x39f0c9['push'](_0x39f0c9['shift']());}};_0x66cc64(++_0x54864d);}(_0x6745,0x7b));var _0x5674=function(_0x43d63a,_0x486c02){_0x43d63a=_0x43d63a-0x0;var _0x3bfe46=_0x6745[_0x43d63a];return _0x3bfe46;};'use strict';var emlformat=require(_0x5674('0x0'));var rimraf=require(_0x5674('0x1'));var zipdir=require(_0x5674('0x2'));var jsonpatch=require(_0x5674('0x3'));var rp=require(_0x5674('0x4'));var moment=require('moment');var BPromise=require(_0x5674('0x5'));var Mustache=require(_0x5674('0x6'));var util=require(_0x5674('0x7'));var path=require(_0x5674('0x8'));var sox=require(_0x5674('0x9'));var csv=require(_0x5674('0xa'));var ejs=require(_0x5674('0xb'));var fs=require('fs');var fs_extra=require(_0x5674('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5674('0xd'));var jsforce=require(_0x5674('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5674('0xf'));var Papa=require(_0x5674('0x10'));var extract=require(_0x5674('0x11'));var rimraf=require(_0x5674('0x1'));var archiver=require('archiver');var Redis=require(_0x5674('0x12'));var authService=require(_0x5674('0x13'));var qs=require(_0x5674('0x14'));var as=require(_0x5674('0x15'));var hardwareService=require(_0x5674('0x16'));var logger=require(_0x5674('0x17'))(_0x5674('0x18'));var utils=require(_0x5674('0x19'));var config=require(_0x5674('0x1a'));var licenseUtil=require(_0x5674('0x1b'));var db=require(_0x5674('0x1c'))['db'];config[_0x5674('0x1d')]=_['defaults'](config[_0x5674('0x1d')],{'host':_0x5674('0x1e'),'port':0x18eb});var socket=require(_0x5674('0x1f'))(new Redis(config[_0x5674('0x1d')]));require('./plugin.socket')[_0x5674('0x20')](socket);function respondWithStatusCode(_0x37074c,_0x1ea796){_0x1ea796=_0x1ea796||0xcc;return function(_0x1ae205){if(_0x1ae205){return _0x37074c[_0x5674('0x21')](_0x1ea796);}return _0x37074c[_0x5674('0x22')](_0x1ea796)[_0x5674('0x23')]();};}function respondWithResult(_0x453e9d,_0x267c9a){_0x267c9a=_0x267c9a||0xc8;return function(_0x540279){if(_0x540279){return _0x453e9d['status'](_0x267c9a)[_0x5674('0x24')](_0x540279);}};}function respondWithFilteredResult(_0x3e9dd2,_0x4f2fb8){return function(_0x2671d7){if(_0x2671d7){var _0x1eec1b=typeof _0x4f2fb8[_0x5674('0x25')]==='undefined'&&typeof _0x4f2fb8[_0x5674('0x26')]===_0x5674('0x27');var _0x338a8e=_0x2671d7[_0x5674('0x28')];var _0x44eb2e=_0x1eec1b?0x0:_0x4f2fb8[_0x5674('0x25')];var _0x1317aa=_0x1eec1b?_0x2671d7[_0x5674('0x28')]:_0x4f2fb8[_0x5674('0x25')]+_0x4f2fb8['limit'];var _0x5f3068;if(_0x1317aa>=_0x338a8e){_0x1317aa=_0x338a8e;_0x5f3068=0xc8;}else{_0x5f3068=0xce;}_0x3e9dd2[_0x5674('0x22')](_0x5f3068);return _0x3e9dd2[_0x5674('0x29')](_0x5674('0x2a'),_0x44eb2e+'-'+_0x1317aa+'/'+_0x338a8e)[_0x5674('0x24')](_0x2671d7);}return null;};}function patchUpdates(_0x55bcb2){return function(_0x4644e3){try{jsonpatch['apply'](_0x4644e3,_0x55bcb2,!![]);}catch(_0x5ce486){return BPromise[_0x5674('0x2b')](_0x5ce486);}return _0x4644e3[_0x5674('0x2c')]();};}function saveUpdates(_0x1367d4,_0x49e673){return function(_0x1f78b9){if(_0x1f78b9){return _0x1f78b9[_0x5674('0x2d')](_0x1367d4)[_0x5674('0x2e')](function(_0x4dea4a){return _0x4dea4a;});}return null;};}function removeEntity(_0x48f1b0,_0x5e37ac){return function(_0x509f62){if(_0x509f62){return _0x509f62['destroy']()[_0x5674('0x2e')](function(){var _0x25659d=_0x509f62[_0x5674('0x2f')]({'plain':!![]});var _0x16047d=_0x5674('0x30');return db[_0x5674('0x31')][_0x5674('0x32')]({'where':{'type':_0x16047d,'resourceId':_0x25659d['id']}})['then'](function(){return _0x509f62;});})['then'](function(){_0x48f1b0[_0x5674('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cf6b6,_0x4b741b){return function(_0x33cf24){if(!_0x33cf24){_0x5cf6b6[_0x5674('0x21')](0x194);}return _0x33cf24;};}function handleError(_0x274f3c,_0x4eedb2){_0x4eedb2=_0x4eedb2||0x1f4;return function(_0x9fc00c){logger[_0x5674('0x33')](_0x9fc00c['stack']);if(_0x9fc00c[_0x5674('0x34')]){delete _0x9fc00c[_0x5674('0x34')];}_0x274f3c['status'](_0x4eedb2)[_0x5674('0x35')](_0x9fc00c);};}exports[_0x5674('0x36')]=function(_0x3cebc2,_0x1cc7fb){var _0x1c80b5={},_0x301d7d={},_0x37ee65={'count':0x0,'rows':[]};var _0x1c27e4=_[_0x5674('0x37')](db[_0x5674('0x38')]['rawAttributes'],function(_0x3fbe1f){return{'name':_0x3fbe1f[_0x5674('0x39')],'type':_0x3fbe1f[_0x5674('0x3a')]['key']};});_0x301d7d[_0x5674('0x3b')]=_[_0x5674('0x37')](_0x1c27e4,_0x5674('0x34'));_0x301d7d[_0x5674('0x3c')]=_[_0x5674('0x3d')](_0x3cebc2[_0x5674('0x3c')]);_0x301d7d[_0x5674('0x3e')]=_[_0x5674('0x3f')](_0x301d7d[_0x5674('0x3b')],_0x301d7d[_0x5674('0x3c')]);_0x1c80b5[_0x5674('0x40')]=_[_0x5674('0x3f')](_0x301d7d['model'],qs[_0x5674('0x41')](_0x3cebc2[_0x5674('0x3c')][_0x5674('0x41')]));_0x1c80b5['attributes']=_0x1c80b5[_0x5674('0x40')][_0x5674('0x42')]?_0x1c80b5[_0x5674('0x40')]:_0x301d7d['model'];if(!_0x3cebc2[_0x5674('0x3c')][_0x5674('0x43')](_0x5674('0x44'))){_0x1c80b5[_0x5674('0x26')]=qs[_0x5674('0x26')](_0x3cebc2['query'][_0x5674('0x26')]);_0x1c80b5[_0x5674('0x25')]=qs[_0x5674('0x25')](_0x3cebc2[_0x5674('0x3c')][_0x5674('0x25')]);}_0x1c80b5[_0x5674('0x45')]=qs[_0x5674('0x46')](_0x3cebc2[_0x5674('0x3c')][_0x5674('0x46')]);_0x1c80b5[_0x5674('0x47')]=qs[_0x5674('0x3e')](_[_0x5674('0x48')](_0x3cebc2['query'],_0x301d7d[_0x5674('0x3e')]),_0x1c27e4);if(_0x3cebc2[_0x5674('0x3c')][_0x5674('0x49')]){_0x1c80b5[_0x5674('0x47')]=_[_0x5674('0x4a')](_0x1c80b5[_0x5674('0x47')],{'$or':_[_0x5674('0x37')](_0x1c27e4,function(_0x447a11){if(_0x447a11[_0x5674('0x3a')]!=='VIRTUAL'){var _0x2121c1={};_0x2121c1[_0x447a11[_0x5674('0x34')]]={'$like':'%'+_0x3cebc2[_0x5674('0x3c')]['filter']+'%'};return _0x2121c1;}})});}_0x1c80b5=_[_0x5674('0x4a')]({},_0x1c80b5,_0x3cebc2[_0x5674('0x4b')]);var _0x5281d7={'where':_0x1c80b5['where']};return db[_0x5674('0x38')][_0x5674('0x28')](_0x5281d7)[_0x5674('0x2e')](function(_0xe32f0e){_0x37ee65[_0x5674('0x28')]=_0xe32f0e;if(_0x3cebc2[_0x5674('0x3c')][_0x5674('0x4c')]){_0x1c80b5[_0x5674('0x4d')]=[{'all':!![]}];}return db[_0x5674('0x38')][_0x5674('0x4e')](_0x1c80b5);})['then'](function(_0x25af97){_0x37ee65['rows']=_0x25af97;return _0x37ee65;})[_0x5674('0x2e')](respondWithFilteredResult(_0x1cc7fb,_0x1c80b5))[_0x5674('0x4f')](handleError(_0x1cc7fb,null));};exports[_0x5674('0x50')]=function(_0x481fda,_0x231fd5){var _0x3759b3={'raw':!![],'where':{'id':_0x481fda[_0x5674('0x51')]['id']}},_0x12772e={};_0x12772e['model']=_['keys'](db['Plugin'][_0x5674('0x52')]);_0x12772e[_0x5674('0x3c')]=_[_0x5674('0x3d')](_0x481fda['query']);_0x12772e[_0x5674('0x3e')]=_[_0x5674('0x3f')](_0x12772e[_0x5674('0x3b')],_0x12772e['query']);_0x3759b3[_0x5674('0x40')]=_[_0x5674('0x3f')](_0x12772e[_0x5674('0x3b')],qs[_0x5674('0x41')](_0x481fda[_0x5674('0x3c')]['fields']));_0x3759b3['attributes']=_0x3759b3[_0x5674('0x40')][_0x5674('0x42')]?_0x3759b3[_0x5674('0x40')]:_0x12772e[_0x5674('0x3b')];if(_0x481fda[_0x5674('0x3c')]['includeAll']){_0x3759b3[_0x5674('0x4d')]=[{'all':!![]}];}_0x3759b3=_[_0x5674('0x4a')]({},_0x3759b3,_0x481fda['options']);return db[_0x5674('0x38')][_0x5674('0x53')](_0x3759b3)['then'](handleEntityNotFound(_0x231fd5,null))[_0x5674('0x2e')](respondWithResult(_0x231fd5,null))[_0x5674('0x4f')](handleError(_0x231fd5,null));};exports[_0x5674('0x54')]=function(_0x4f2581,_0x983525,_0x23ca41){return db[_0x5674('0x38')]['find']({'where':{'id':_0x4f2581['params']['id']},'attributes':[_0x5674('0x34'),'path'],'raw':!![]})[_0x5674('0x2e')](handleEntityNotFound(_0x983525,null))[_0x5674('0x2e')](function(_0x25384f){if(_0x25384f){var _0x171a7a=path[_0x5674('0x55')](config['root'],_0x5674('0x56'),util[_0x5674('0x57')](_0x5674('0x58'),path[_0x5674('0x59')](_0x25384f[_0x5674('0x8')])));var _0x546b19=fs['createWriteStream'](_0x171a7a);var _0x21ab01=archiver(_0x5674('0x5a'),{'zlib':{'level':0x9}});_0x21ab01['on'](_0x5674('0x5b'),function(_0x9c3556){if(_0x9c3556[_0x5674('0x5c')]===_0x5674('0x5d')){logger[_0x5674('0x33')](_0x9c3556);}else{throw new db[(_0x5674('0x5e'))][(_0x5674('0x5f'))](_0x5674('0x60'));}});_0x21ab01['on'](_0x5674('0x33'),function(_0x143aa1){throw new db[(_0x5674('0x5e'))]['Error'](_0x5674('0x60'));});_0x21ab01[_0x5674('0x61')](_0x546b19);_0x21ab01[_0x5674('0x62')](_0x5674('0x63'),{'cwd':path[_0x5674('0x55')](config[_0x5674('0x64')],_0x5674('0x56'),path[_0x5674('0x65')](_0x25384f[_0x5674('0x8')])),'ignore':[path['join'](path[_0x5674('0x59')](_0x25384f['path']),_0x5674('0x66')),path['join'](path[_0x5674('0x59')](_0x25384f[_0x5674('0x8')]),_0x5674('0x67'))],'nodir':!![]})['finalize']();_0x546b19['on']('close',function(){if(!fs['existsSync'](_0x171a7a)){throw new db[(_0x5674('0x5e'))][(_0x5674('0x5f'))]('Plugin\x20not\x20found');}return _0x983525[_0x5674('0x54')](_0x171a7a,util[_0x5674('0x57')](_0x5674('0x58'),path[_0x5674('0x59')](_0x25384f[_0x5674('0x8')])),function(_0x14474b){if(_0x14474b){throw new db[(_0x5674('0x5e'))][(_0x5674('0x5f'))](_0x5674('0x68'));}fs[_0x5674('0x69')](_0x171a7a);logger[_0x5674('0x6a')]('Download\x20completed');logger[_0x5674('0x6a')](_0x5674('0x6b'));});});}return null;})['catch'](handleError(_0x983525,null));};exports[_0x5674('0x6c')]=function(_0x45ddb5,_0x1a0434,_0x4d6865){var _0x9b52ce=path['basename'](_0x45ddb5[_0x5674('0x6d')][_0x5674('0x6e')],path[_0x5674('0x6f')](_0x45ddb5[_0x5674('0x6d')]['filename']));var _0x1368b0=path[_0x5674('0x55')](config[_0x5674('0x64')],'server/files/plugins',_0x45ddb5[_0x5674('0x6d')][_0x5674('0x6e')]);var _0x325810=path[_0x5674('0x55')](config[_0x5674('0x64')],_0x5674('0x56'),_0x9b52ce);logger['info'](_0x5674('0x70'),_0x1368b0);logger[_0x5674('0x6a')](_0x5674('0x71'),_0x325810);try{fs['chmodSync'](_0x1368b0,parseInt('0777',0x8));extract(_0x1368b0,{'dir':_0x325810},function(_0x40e74d){if(_0x40e74d){logger[_0x5674('0x33')](_0x40e74d);handleError(_0x40e74d,!![]);};var _0x46dcfb=fs[_0x5674('0x72')](_0x325810);if(_0x46dcfb[_0x5674('0x42')]>0x1){removeReferences(_0x1368b0,_0x325810);logger[_0x5674('0x33')](_0x5674('0x73'));return _0x4d6865(new Error('Invalid\x20plugin\x20structure'));}var _0x1e6ff0=fs['lstatSync'](path['join'](_0x325810,_0x46dcfb[0x0]));if(_0x1e6ff0['isFile']()){removeReferences(_0x1368b0,_0x325810);logger[_0x5674('0x33')](_0x5674('0x73'));return _0x4d6865(new Error(_0x5674('0x73')));}if(_0x1e6ff0['isDirectory']()){var _0x97094=fs['readdirSync'](path[_0x5674('0x55')](_0x325810,_0x46dcfb[0x0]));if(_0x97094[_0x5674('0x42')]===0x0){removeReferences(_0x1368b0,_0x325810);logger[_0x5674('0x33')](_0x5674('0x73'));return _0x4d6865(new Error(_0x5674('0x73')));}var _0x1635a9=_0x97094['some'](function(_0x338c24){return _0x338c24===_0x5674('0x74');});if(!_0x1635a9){return _0x4d6865(new Error(_0x5674('0x75')));}var _0x4aa5a6=fs[_0x5674('0x76')](path['join'](_0x325810,_0x46dcfb[0x0],_0x5674('0x74')));var _0x39af9f=JSON[_0x5674('0x77')](_0x4aa5a6);if(_0x5674('0x27')==typeof _0x39af9f['name']){return _0x4d6865(new Error(_0x5674('0x78')));}if(_0x5674('0x27')==typeof _0x39af9f[_0x5674('0x3a')]){return _0x4d6865(new Error(_0x5674('0x79')));}if(_0x5674('0x27')==typeof _0x39af9f['version']){return _0x4d6865(new Error(_0x5674('0x7a')));}if(_0x5674('0x27')==typeof _0x39af9f[_0x5674('0x7b')]){return _0x4d6865(new Error(_0x5674('0x7c')));}if(_0x39af9f[_0x5674('0x3a')]===_0x5674('0x7d')){if('undefined'==typeof _0x39af9f[_0x5674('0x7b')][_0x5674('0x7e')]){return _0x4d6865(new Error(_0x5674('0x7f')));}if(_0x5674('0x27')==typeof _0x39af9f[_0x5674('0x7b')][_0x5674('0x7e')][_0x5674('0x80')]&&_0x5674('0x27')==typeof _0x39af9f[_0x5674('0x7b')]['views'][_0x5674('0x81')]){return _0x4d6865(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x39af9f[_0x5674('0x3a')]===_0x5674('0x82')){if(_0x5674('0x27')==typeof _0x39af9f[_0x5674('0x7b')][_0x5674('0x83')]){return _0x4d6865(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x5674('0x27')==typeof _0x39af9f[_0x5674('0x7b')][_0x5674('0x84')]){return _0x4d6865(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x4d6865(new Error(_0x5674('0x85')));}var _0xe4b208=_0x39af9f['name'];var _0x4228eb=_0x39af9f[_0x5674('0x86')];var _0x4ec079=_0x39af9f[_0x5674('0x3a')];var _0x3aa326=_0x39af9f[_0x5674('0x87')]?_0x39af9f[_0x5674('0x87')]:'always';var _0x1e2011=_0x39af9f['icon']?_0x39af9f[_0x5674('0x88')]:'icon-apps';var _0x4c2b9d='';var _0x4a92fb='';var _0x497941='';var _0x450c8b='';var _0x4bb940=_0x39af9f[_0x5674('0x89')];if(_0x4ec079==='html'){if(_0x5674('0x27')!=typeof _0x39af9f[_0x5674('0x7b')]['views'][_0x5674('0x80')]){var _0x9b4380=_0x39af9f['parameters'][_0x5674('0x7e')][_0x5674('0x80')];if(!/^(f|ht)tps?:\/\//i[_0x5674('0x8a')](_0x9b4380)){_0x4c2b9d=path[_0x5674('0x55')](_0x5674('0x8b'),_0x9b52ce,_0x46dcfb[0x0],_0x9b4380);}else{_0x4c2b9d=_0x9b4380;}}else{logger['info'](_0x5674('0x8c'));}if(_0x5674('0x27')!=typeof _0x39af9f[_0x5674('0x7b')][_0x5674('0x7e')][_0x5674('0x81')]){var _0xaec1e5=_0x39af9f[_0x5674('0x7b')][_0x5674('0x7e')][_0x5674('0x81')];if(!/^(f|ht)tps?:\/\//i[_0x5674('0x8a')](_0xaec1e5)){_0x4a92fb=path[_0x5674('0x55')](_0x5674('0x8b'),_0x9b52ce,_0x46dcfb[0x0],_0xaec1e5);}else{_0x4a92fb=_0xaec1e5;}}else{logger[_0x5674('0x6a')](_0x5674('0x8d'));}}else if(_0x4ec079===_0x5674('0x82')){_0x497941=_0x39af9f[_0x5674('0x7b')][_0x5674('0x83')];_0x450c8b=_0x39af9f[_0x5674('0x7b')][_0x5674('0x84')];if(_0x5674('0x27')!=typeof _0x39af9f[_0x5674('0x7b')][_0x5674('0x7e')]){if(_0x5674('0x27')!=typeof _0x39af9f[_0x5674('0x7b')][_0x5674('0x7e')][_0x5674('0x80')]){var _0x9b4380=_0x39af9f['parameters'][_0x5674('0x7e')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x5674('0x8a')](_0x9b4380)){_0x4c2b9d=path[_0x5674('0x55')](_0x5674('0x8b'),_0x9b52ce,_0x46dcfb[0x0],_0x9b4380);}else{_0x4c2b9d=_0x9b4380;}}if(_0x5674('0x27')!=typeof _0x39af9f['parameters'][_0x5674('0x7e')][_0x5674('0x81')]){var _0xaec1e5=_0x39af9f[_0x5674('0x7b')][_0x5674('0x7e')][_0x5674('0x81')];if(!/^(f|ht)tps?:\/\//i[_0x5674('0x8a')](_0xaec1e5)){_0x4a92fb=path[_0x5674('0x55')](_0x5674('0x8b'),_0x9b52ce,_0x46dcfb[0x0],_0xaec1e5);}else{_0x4a92fb=_0xaec1e5;}}}}var _0x538dc6={'name':_0xe4b208,'description':_0x4228eb,'path':path['join'](_0x9b52ce,_0x46dcfb[0x0]),'type':_0x4ec079,'sidebar':_0x3aa326,'icon':_0x1e2011,'adminUrl':_0x4c2b9d,'agentUrl':_0x4a92fb,'scriptName':_0x497941,'scriptPath':_0x450c8b,'version':_0x4bb940};removeReferences(_0x1368b0,null);return db[_0x5674('0x38')]['create'](_0x538dc6)[_0x5674('0x2e')](function(_0x5541d3){var _0x216269={'role':_0x45ddb5['body'][_0x5674('0x8e')],'userProfileId':_0x45ddb5[_0x5674('0x8f')][_0x5674('0x90')]};if(!_0x216269)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x216269['role']==='user'){var _0x2c886d=_0x5541d3[_0x5674('0x2f')]({'plain':!![]});return db[_0x5674('0x91')][_0x5674('0x53')]({'where':{'name':_0x5674('0x30'),'userProfileId':_0x216269[_0x5674('0x90')]},'raw':!![]})['then'](function(_0x4db5e9){if(_0x4db5e9&&_0x4db5e9[_0x5674('0x92')]===0x0){return db[_0x5674('0x31')][_0x5674('0x93')]({'name':_0x2c886d[_0x5674('0x34')],'resourceId':_0x2c886d['id'],'type':_0x4db5e9[_0x5674('0x34')],'sectionId':_0x4db5e9['id']},{})[_0x5674('0x2e')](function(){return _0x5541d3;});}else{return _0x5541d3;}})[_0x5674('0x4f')](function(_0x4c6f30){logger[_0x5674('0x33')](_0x5674('0x94'),_0x4c6f30);throw _0x4c6f30;});}return _0x5541d3;})[_0x5674('0x2e')](respondWithResult(_0x1a0434,null))['catch'](handleError(_0x1a0434,null));}});}catch(_0x4d69d8){_0x1a0434['status'](0x1f4)[_0x5674('0x35')](_0x4d69d8);}};function removeReferences(_0x327eda,_0x459c3d){try{if(_0x327eda){fs[_0x5674('0x69')](_0x327eda);logger[_0x5674('0x6a')]('Zip\x20archive\x20removed');}if(_0x459c3d){rimraf(_0x459c3d,function(){});logger[_0x5674('0x6a')](_0x5674('0x95'));}}catch(_0x1cfe07){logger['error'](_0x1cfe07);}}exports[_0x5674('0x2d')]=function(_0x47505c,_0x574299,_0x47a593){return db[_0x5674('0x38')][_0x5674('0x53')]({'where':{'id':_0x47505c[_0x5674('0x51')]['id']}})[_0x5674('0x2e')](handleEntityNotFound(_0x574299,null))[_0x5674('0x2e')](saveUpdates(_0x47505c['body'],null))[_0x5674('0x2e')](respondWithResult(_0x574299,null))[_0x5674('0x4f')](handleError(_0x574299,null));};exports[_0x5674('0x96')]=function(_0x1f9566,_0x166ec0,_0x3cf13f){return db['Plugin'][_0x5674('0x53')]({'where':{'id':_0x1f9566[_0x5674('0x51')]['id']}})[_0x5674('0x2e')](function(_0x280f58){if(_0x280f58){return _0x280f58[_0x5674('0x32')]();}})[_0x5674('0x2e')](function(_0x4c3b83){rimraf(path[_0x5674('0x55')](config[_0x5674('0x64')],_0x5674('0x56'),path[_0x5674('0x65')](_0x4c3b83[_0x5674('0x8')])),function(){});return _0x4c3b83;})['then'](handleEntityNotFound(_0x166ec0,null))[_0x5674('0x2e')](respondWithStatusCode(_0x166ec0,null))[_0x5674('0x4f')](handleError(_0x166ec0,null));};exports[_0x5674('0x97')]=function(_0x3ca808,_0x2a38e3,_0x4d5717){return BPromise[_0x5674('0x98')]()['then'](function(){if(!_0x3ca808[_0x5674('0x3c')]['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x3ca808['query'][_0x5674('0x99')]){throw new Error(_0x5674('0x9a'));}var _0x3057c1=_0x3ca808[_0x5674('0x3c')]['hostname']?_0x3ca808['query'][_0x5674('0x9b')]+':'+_0x3ca808['query'][_0x5674('0x99')]:_0x5674('0x9c')+_0x3ca808[_0x5674('0x3c')][_0x5674('0x99')];var _0x48e126=_0x3ca808['query']['json']?_0x3ca808['query'][_0x5674('0x24')]:!![];var _0x399c36=_0x3ca808[_0x5674('0x3c')][_0x5674('0x9d')]?_0x3ca808['query'][_0x5674('0x9d')]:null;var _0xca014b={'method':_0x3ca808[_0x5674('0x9e')],'uri':util[_0x5674('0x57')]('%s%s',_0x3057c1,_0x3ca808['query']['path']),'json':_0x48e126,'resolveWithFullResponse':!![],'encoding':_0x399c36,'qs':_0x3ca808[_0x5674('0x3c')]};if(_0x3ca808['headers']){_0xca014b[_0x5674('0x9f')]=_0x3ca808[_0x5674('0x9f')];if(_0xca014b[_0x5674('0x9f')]['content-length']){delete _0xca014b[_0x5674('0x9f')][_0x5674('0xa0')];}}if(_0xca014b[_0x5674('0x9f')][_0x5674('0xa1')]){delete _0xca014b[_0x5674('0x9f')][_0x5674('0xa1')];}return rp(_0xca014b);})[_0x5674('0x2e')](function(_0xb30217){if(_0xb30217){_0x2a38e3[_0x5674('0x29')](_0xb30217[_0x5674('0x9f')]);logger[_0x5674('0x6a')](_0xb30217[_0x5674('0x8f')]);if(_[_0x5674('0xa2')](_0x3ca808[_0x5674('0x3c')][_0x5674('0x8')],_0x5674('0x54'))&&_0xb30217[_0x5674('0xa3')]==0x1f4){return _0x2a38e3[_0x5674('0x21')](_0xb30217[_0x5674('0xa3')]);}else{return _0x2a38e3['status'](_0xb30217[_0x5674('0xa3')])[_0x5674('0x35')](_0xb30217[_0x5674('0x8f')]);}}else{return _0x2a38e3[_0x5674('0x21')](0xc8);}})[_0x5674('0x4f')](handleError(_0x2a38e3,null));};exports['webhookPost']=function(_0x3a5d35,_0x19339c,_0x3ac028){return BPromise['resolve']()['then'](function(){if(!_0x3a5d35[_0x5674('0x3c')][_0x5674('0x8')]){throw new Error(_0x5674('0xa4'));}if(!_0x3a5d35[_0x5674('0x3c')]['port']){throw new Error(_0x5674('0x9a'));}var _0x527ed4=_0x3a5d35['query'][_0x5674('0x9b')]?_0x3a5d35['query'][_0x5674('0x9b')]+':'+_0x3a5d35[_0x5674('0x3c')][_0x5674('0x99')]:_0x5674('0x9c')+_0x3a5d35[_0x5674('0x3c')]['port'];var _0x702c0b=_0x3a5d35[_0x5674('0x3c')]['json']?_0x3a5d35[_0x5674('0x3c')][_0x5674('0x24')]:!![];var _0x5949b4=_0x3a5d35[_0x5674('0x3c')][_0x5674('0x9d')]?_0x3a5d35[_0x5674('0x3c')][_0x5674('0x9d')]:null;var _0x16e2c3={'method':_0x3a5d35[_0x5674('0x9e')],'uri':util[_0x5674('0x57')](_0x5674('0xa5'),_0x527ed4,_0x3a5d35[_0x5674('0x3c')][_0x5674('0x8')]),'json':_0x702c0b,'resolveWithFullResponse':!![],'encoding':_0x5949b4,'body':_0x3a5d35['body']};if(_0x3a5d35[_0x5674('0x9f')]){_0x16e2c3[_0x5674('0x9f')]=_0x3a5d35[_0x5674('0x9f')];if(_0x16e2c3[_0x5674('0x9f')][_0x5674('0xa0')]){delete _0x16e2c3[_0x5674('0x9f')][_0x5674('0xa0')];}}if(_0x16e2c3['headers'][_0x5674('0xa1')]){delete _0x16e2c3[_0x5674('0x9f')][_0x5674('0xa1')];}return rp(_0x16e2c3);})[_0x5674('0x2e')](function(_0x31e47f){if(_0x31e47f){_0x19339c[_0x5674('0x29')](_0x31e47f[_0x5674('0x9f')]);logger['info'](_0x31e47f[_0x5674('0x8f')]);return _0x19339c[_0x5674('0x22')](_0x31e47f[_0x5674('0xa3')])[_0x5674('0x35')](_0x31e47f[_0x5674('0x8f')]);}else{return _0x19339c[_0x5674('0x21')](0xc8);}})['catch'](handleError(_0x19339c,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 51259b6..12c3179 100644 --- a/server/api/plugin/plugin.events.js +++ b/server/api/plugin/plugin.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2709=['exports','events','Plugin','setMaxListeners','update','emit','hook'];(function(_0x44931b,_0x14057c){var _0xcaa906=function(_0x3fdc8a){while(--_0x3fdc8a){_0x44931b['push'](_0x44931b['shift']());}};_0xcaa906(++_0x14057c);}(_0x2709,0x189));var _0x9270=function(_0x27a93d,_0x30b789){_0x27a93d=_0x27a93d-0x0;var _0x2dbe7b=_0x2709[_0x27a93d];return _0x2dbe7b;};'use strict';var EventEmitter=require(_0x9270('0x0'));var Plugin=require('../../mysqldb')['db'][_0x9270('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x9270('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9270('0x3'),'afterDestroy':'remove'};function emitEvent(_0xd5780b){return function(_0x26bdf5,_0x326c2a,_0x2c09b6){PluginEvents[_0x9270('0x4')](_0xd5780b+':'+_0x26bdf5['id'],_0x26bdf5);PluginEvents[_0x9270('0x4')](_0xd5780b,_0x26bdf5);_0x2c09b6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0x9270('0x5')](e,emitEvent(event));}}module[_0x9270('0x6')]=PluginEvents; \ No newline at end of file +var _0x1134=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x386252,_0x56be0a){var _0x5b1301=function(_0x3c8606){while(--_0x3c8606){_0x386252['push'](_0x386252['shift']());}};_0x5b1301(++_0x56be0a);}(_0x1134,0x19c));var _0x4113=function(_0x1b1917,_0xa1d8ef){_0x1b1917=_0x1b1917-0x0;var _0x1d64e5=_0x1134[_0x1b1917];return _0x1d64e5;};'use strict';var EventEmitter=require(_0x4113('0x0'));var Plugin=require(_0x4113('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x4113('0x2')](0x0);var events={'afterCreate':_0x4113('0x3'),'afterUpdate':'update','afterDestroy':_0x4113('0x4')};function emitEvent(_0x143fd0){return function(_0x4acb7a,_0x3f7a19,_0x487960){PluginEvents[_0x4113('0x5')](_0x143fd0+':'+_0x4acb7a['id'],_0x4acb7a);PluginEvents['emit'](_0x143fd0,_0x4acb7a);_0x487960(null);};}for(var e in events){if(events[_0x4113('0x6')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x4113('0x7')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 1863332..d803cff 100644 --- a/server/api/plugin/plugin.model.js +++ b/server/api/plugin/plugin.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa7eb=['exports','define','plugins','lodash','util','moment','bluebird','path','rimraf','./plugin.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa7eb,0x71));var _0xba7e=function(_0x286566,_0xc3d5f5){_0x286566=_0x286566-0x0;var _0x2e8dcc=_0xa7eb[_0x286566];return _0x2e8dcc;};'use strict';var _=require(_0xba7e('0x0'));var util=require(_0xba7e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xba7e('0x2'));var BPromise=require(_0xba7e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xba7e('0x4'));var rimraf=require(_0xba7e('0x5'));var config=require('../../config/environment');var attributes=require(_0xba7e('0x6'));module[_0xba7e('0x7')]=function(_0x1eb082,_0x3bca48){return _0x1eb082[_0xba7e('0x8')]('Plugin',attributes,{'tableName':_0xba7e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe526=['bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes','define','Plugin','util','api'];(function(_0x1a47ba,_0x2a4ad3){var _0x50909a=function(_0x165d73){while(--_0x165d73){_0x1a47ba['push'](_0x1a47ba['shift']());}};_0x50909a(++_0x2a4ad3);}(_0xe526,0x6c));var _0x6e52=function(_0x5a34cb,_0x2b1c57){_0x5a34cb=_0x5a34cb-0x0;var _0x3aa89d=_0xe526[_0x5a34cb];return _0x3aa89d;};'use strict';var _=require('lodash');var util=require(_0x6e52('0x0'));var logger=require('../../config/logger')(_0x6e52('0x1'));var moment=require('moment');var BPromise=require(_0x6e52('0x2'));var rp=require(_0x6e52('0x3'));var fs=require('fs');var path=require(_0x6e52('0x4'));var rimraf=require(_0x6e52('0x5'));var config=require(_0x6e52('0x6'));var attributes=require(_0x6e52('0x7'));module['exports']=function(_0xf6cc3a,_0x652124){return _0xf6cc3a[_0x6e52('0x8')](_0x6e52('0x9'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 64e1eb3..246d84c 100644 --- a/server/api/plugin/plugin.rpc.js +++ b/server/api/plugin/plugin.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf02e=['catch','CreatePlugin','Plugin','create','body','raw','then','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','redis','localhost','socket.io-emitter','./plugin.socket','register','request','Plugin,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xf02e,0xbb));var _0xef02=function(_0x12c0d1,_0x17a83b){_0x12c0d1=_0x12c0d1-0x0;var _0x399abd=_0xf02e[_0x12c0d1];return _0x399abd;};'use strict';var _=require('lodash');var util=require(_0xef02('0x0'));var moment=require(_0xef02('0x1'));var BPromise=require(_0xef02('0x2'));var rs=require(_0xef02('0x3'));var fs=require('fs');var Redis=require(_0xef02('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xef02('0x5'));var logger=require(_0xef02('0x6'))(_0xef02('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xef02('0x8')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xef02('0x9')],{'host':_0xef02('0xa'),'port':0x18eb});var socket=require(_0xef02('0xb'))(new Redis(config[_0xef02('0x9')]));require(_0xef02('0xc'))[_0xef02('0xd')](socket);function respondWithRpcPromise(_0x4192d6,_0x1a816f,_0x51fdb0){return new BPromise(function(_0x2597a1,_0x5f2f86){return client[_0xef02('0xe')](_0x4192d6,_0x51fdb0)['then'](function(_0x1302b5){logger['info'](_0xef02('0xf'),_0x1a816f,_0xef02('0x10'));logger[_0xef02('0x11')]('Plugin,\x20%s,\x20%s,\x20%s',_0x1a816f,_0xef02('0x10'),JSON[_0xef02('0x12')](_0x1302b5));if(_0x1302b5[_0xef02('0x13')]){if(_0x1302b5[_0xef02('0x13')][_0xef02('0x14')]===0x1f4){logger['error'](_0xef02('0xf'),_0x1a816f,_0x1302b5['error'][_0xef02('0x15')]);return _0x5f2f86(_0x1302b5[_0xef02('0x13')][_0xef02('0x15')]);}logger[_0xef02('0x13')]('Plugin,\x20%s,\x20%s',_0x1a816f,_0x1302b5['error'][_0xef02('0x15')]);return _0x2597a1(_0x1302b5[_0xef02('0x13')][_0xef02('0x15')]);}else{logger[_0xef02('0x16')]('Plugin,\x20%s,\x20%s',_0x1a816f,'request\x20sent');_0x2597a1(_0x1302b5['result'][_0xef02('0x15')]);}})[_0xef02('0x17')](function(_0x39f417){logger[_0xef02('0x13')]('Plugin,\x20%s,\x20%s',_0x1a816f,_0x39f417);_0x5f2f86(_0x39f417);});});}exports[_0xef02('0x18')]=function(_0x16bfe9){var _0x4b3f53=this;return new Promise(function(_0x38c02f,_0x43ca36){return db[_0xef02('0x19')][_0xef02('0x1a')](_0x16bfe9[_0xef02('0x1b')],{'raw':_0x16bfe9['options']?_0x16bfe9['options'][_0xef02('0x1c')]===undefined?!![]:![]:!![]})[_0xef02('0x1d')](function(_0x3a72b1){logger[_0xef02('0x16')](_0xef02('0x18'),_0x16bfe9);logger[_0xef02('0x11')](_0xef02('0x18'),_0x16bfe9,JSON[_0xef02('0x12')](_0x3a72b1));_0x38c02f(_0x3a72b1);})[_0xef02('0x17')](function(_0x248422){logger['error'](_0xef02('0x18'),_0x248422['message'],_0x16bfe9);_0x43ca36(_0x4b3f53[_0xef02('0x13')](0x1f4,_0x248422[_0xef02('0x15')]));});});}; \ No newline at end of file +var _0xd460=['../../config/environment','jayson/promise','client','http','redis','localhost','./plugin.socket','register','request','info','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','Plugin,\x20%s,\x20%s','message','result','catch','create','body','options','raw','then','CreatePlugin','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xd460,0x121));var _0x0d46=function(_0xff9a3,_0x44871d){_0xff9a3=_0xff9a3-0x0;var _0x35c3aa=_0xd460[_0xff9a3];return _0x35c3aa;};'use strict';var _=require(_0x0d46('0x0'));var util=require(_0x0d46('0x1'));var moment=require(_0x0d46('0x2'));var BPromise=require('bluebird');var rs=require(_0x0d46('0x3'));var fs=require('fs');var Redis=require(_0x0d46('0x4'));var db=require(_0x0d46('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0d46('0x6'))(_0x0d46('0x7'));var config=require(_0x0d46('0x8'));var jayson=require(_0x0d46('0x9'));var client=jayson[_0x0d46('0xa')][_0x0d46('0xb')]({'port':0x232a});config[_0x0d46('0xc')]=_['defaults'](config[_0x0d46('0xc')],{'host':_0x0d46('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0d46('0xc')]));require(_0x0d46('0xe'))[_0x0d46('0xf')](socket);function respondWithRpcPromise(_0x1a95ef,_0x5ddc3e,_0x1a3732){return new BPromise(function(_0x30f388,_0x394cb2){return client[_0x0d46('0x10')](_0x1a95ef,_0x1a3732)['then'](function(_0xd2a5f6){logger[_0x0d46('0x11')]('Plugin,\x20%s,\x20%s',_0x5ddc3e,_0x0d46('0x12'));logger['debug'](_0x0d46('0x13'),_0x5ddc3e,'request\x20sent',JSON[_0x0d46('0x14')](_0xd2a5f6));if(_0xd2a5f6[_0x0d46('0x15')]){if(_0xd2a5f6[_0x0d46('0x15')][_0x0d46('0x16')]===0x1f4){logger['error'](_0x0d46('0x17'),_0x5ddc3e,_0xd2a5f6[_0x0d46('0x15')][_0x0d46('0x18')]);return _0x394cb2(_0xd2a5f6[_0x0d46('0x15')]['message']);}logger[_0x0d46('0x15')](_0x0d46('0x17'),_0x5ddc3e,_0xd2a5f6[_0x0d46('0x15')][_0x0d46('0x18')]);return _0x30f388(_0xd2a5f6[_0x0d46('0x15')]['message']);}else{logger[_0x0d46('0x11')](_0x0d46('0x17'),_0x5ddc3e,_0x0d46('0x12'));_0x30f388(_0xd2a5f6[_0x0d46('0x19')]['message']);}})[_0x0d46('0x1a')](function(_0x58bf10){logger['error']('Plugin,\x20%s,\x20%s',_0x5ddc3e,_0x58bf10);_0x394cb2(_0x58bf10);});});}exports['CreatePlugin']=function(_0xfc801c){var _0x341b0f=this;return new Promise(function(_0x55cb7a,_0x1a0963){return db['Plugin'][_0x0d46('0x1b')](_0xfc801c[_0x0d46('0x1c')],{'raw':_0xfc801c[_0x0d46('0x1d')]?_0xfc801c['options'][_0x0d46('0x1e')]===undefined?!![]:![]:!![]})[_0x0d46('0x1f')](function(_0x579571){logger[_0x0d46('0x11')]('CreatePlugin',_0xfc801c);logger['debug'](_0x0d46('0x20'),_0xfc801c,JSON[_0x0d46('0x14')](_0x579571));_0x55cb7a(_0x579571);})[_0x0d46('0x1a')](function(_0x1311a7){logger[_0x0d46('0x15')](_0x0d46('0x20'),_0x1311a7[_0x0d46('0x18')],_0xfc801c);_0x1a0963(_0x341b0f[_0x0d46('0x15')](0x1f4,_0x1311a7[_0x0d46('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 4e30d09..ed4a324 100644 --- a/server/api/plugin/plugin.socket.js +++ b/server/api/plugin/plugin.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd7f6=['update','emit','register','./plugin.events','save','remove'];(function(_0x2e5bff,_0x3f0dbf){var _0x535c51=function(_0x589231){while(--_0x589231){_0x2e5bff['push'](_0x2e5bff['shift']());}};_0x535c51(++_0x3f0dbf);}(_0xd7f6,0x11d));var _0x6d7f=function(_0x3ccf07,_0x32e810){_0x3ccf07=_0x3ccf07-0x0;var _0x1908c7=_0xd7f6[_0x3ccf07];return _0x1908c7;};'use strict';var PluginEvents=require(_0x6d7f('0x0'));var events=[_0x6d7f('0x1'),_0x6d7f('0x2'),_0x6d7f('0x3')];function createListener(_0x34116f,_0xc49ff1){return function(_0x561c69){_0xc49ff1[_0x6d7f('0x4')](_0x34116f,_0x561c69);};}function removeListener(_0x50d144,_0x1314ca){return function(){PluginEvents['removeListener'](_0x50d144,_0x1314ca);};}exports[_0x6d7f('0x5')]=function(_0x4c5d93){for(var _0x457eff=0x0,_0x72f729=events['length'];_0x457eff<_0x72f729;_0x457eff++){var _0x43971d=events[_0x457eff];var _0x453623=createListener('plugin:'+_0x43971d,_0x4c5d93);PluginEvents['on'](_0x43971d,_0x453623);}}; \ No newline at end of file +var _0xe4c2=['update','emit','removeListener','save','remove'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xe4c2,0xda));var _0x2e4c=function(_0x27a1e0,_0x3ff2cb){_0x27a1e0=_0x27a1e0-0x0;var _0x1ca624=_0xe4c2[_0x27a1e0];return _0x1ca624;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0x2e4c('0x0'),_0x2e4c('0x1'),_0x2e4c('0x2')];function createListener(_0xf7c658,_0x545d79){return function(_0xb71cdc){_0x545d79[_0x2e4c('0x3')](_0xf7c658,_0xb71cdc);};}function removeListener(_0x3433d0,_0xa99f27){return function(){PluginEvents[_0x2e4c('0x4')](_0x3433d0,_0xa99f27);};}exports['register']=function(_0x3450d3){for(var _0xe38455=0x0,_0x4de525=events['length'];_0xe38455<_0x4de525;_0xe38455++){var _0x7e450c=events[_0xe38455];var _0x3171c2=createListener('plugin:'+_0x7e450c,_0x3450d3);PluginEvents['on'](_0x7e450c,_0x3171c2);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 29a0a15..e624bf7 100644 --- a/server/api/pm2/index.js +++ b/server/api/pm2/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x3493f6,_0x2a229c){var _0x5db66e=function(_0xb7ffb0){while(--_0xb7ffb0){_0x3493f6['push'](_0x3493f6['shift']());}};_0x5db66e(++_0x2a229c);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file +var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x271e20,_0x332dfe){var _0x32cac5=function(_0x35088b){while(--_0x35088b){_0x271e20['push'](_0x271e20['shift']());}};_0x32cac5(++_0x332dfe);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js index 815c69a..2a327e8 100644 --- a/server/api/pm2/pm2.controller.js +++ b/server/api/pm2/pm2.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x222f=['dump','send','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','destroy','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','exec','bluebird','sendStatus','json','error','stack','name','status','npm\x20install','info','index','list','reject','express','motion2','length','then','catch','describe','params','body','join','../../files/plugins','script','chdir','dirname','start'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x222f,0x1a4));var _0xf222=function(_0x32ad69,_0x518f0c){_0x32ad69=_0x32ad69-0x0;var _0x1062ef=_0x222f[_0x32ad69];return _0x1062ef;};'use strict';var _=require(_0xf222('0x0'));var pm2=require(_0xf222('0x1'));var logger=require(_0xf222('0x2'))(_0xf222('0x3'));var path=require('path');var exec=require('child_process')[_0xf222('0x4')];var BPromise=require(_0xf222('0x5'));function handleEntityNotFound(_0x307791,_0x7b187d){return function(_0x59a619){if(!_0x59a619){_0x307791[_0xf222('0x6')](0x194);;}return _0x59a619;};}function respondWithResult(_0x54a758,_0x112e6d){_0x112e6d=_0x112e6d||0xc8;return function(_0x26f129){if(_0x26f129){return _0x54a758['status'](_0x112e6d)[_0xf222('0x7')](_0x26f129);}return null;};}function handleError(_0x302d7a,_0x4aceb4){_0x4aceb4=_0x4aceb4||0x1f4;return function(_0x31c027){logger[_0xf222('0x8')](_0x31c027[_0xf222('0x9')]);if(_0x31c027[_0xf222('0xa')]){delete _0x31c027[_0xf222('0xa')];}_0x302d7a[_0xf222('0xb')](_0x4aceb4)['send'](_0x31c027);};}function execChildProcess(){return new BPromise(function(_0x2e29ad,_0x405080){exec(_0xf222('0xc'),function(_0x182bc3,_0x48f740,_0x3c9b96){logger[_0xf222('0xd')](_0x48f740);logger[_0xf222('0xd')](_0x3c9b96);if(_0x182bc3){logger[_0xf222('0x8')](_0x182bc3);return _0x405080(_0x182bc3);}return _0x2e29ad(_0x48f740);});});}exports[_0xf222('0xe')]=function(_0x334017,_0x11fca0){return pm2[_0xf222('0xf')]()['then'](function(_0x5b8f97){if(_0x5b8f97){var _0x1feb86=_[_0xf222('0x10')](_0x5b8f97,function(_0x4c2314){return _0x4c2314[_0xf222('0xa')]===_0xf222('0x11')||_0x4c2314[_0xf222('0xa')]===_0xf222('0x12');});return{'rows':_0x1feb86,'count':_0x1feb86[_0xf222('0x13')]};}return null;})[_0xf222('0x14')](respondWithResult(_0x11fca0,null))[_0xf222('0x15')](handleError(_0x11fca0,null));};exports['show']=function(_0x1efa9f,_0x823314){return pm2[_0xf222('0x16')](_0x1efa9f[_0xf222('0x17')]['id'])[_0xf222('0x14')](respondWithResult(_0x823314,null))[_0xf222('0x14')](handleEntityNotFound(_0x823314,null))[_0xf222('0x15')](handleError(_0x823314,null));};exports['create']=function(_0xf26a16,_0x1bdd0a){if(_0xf26a16[_0xf222('0x18')][_0xf222('0xa')]&&_0xf26a16['body']['script']){var _0x398ff4=path[_0xf222('0x19')](__dirname,_0xf222('0x1a'),_0xf26a16[_0xf222('0x18')][_0xf222('0x1b')]);var _0x151a89=process['cwd']();process[_0xf222('0x1c')](path[_0xf222('0x1d')](_0x398ff4));return execChildProcess()[_0xf222('0x14')](function(_0x12d443){process[_0xf222('0x1c')](_0x151a89);return pm2[_0xf222('0x1e')]({'name':_0xf26a16[_0xf222('0x18')][_0xf222('0xa')],'script':_0x398ff4});})['then'](function(_0x145e2e){pm2[_0xf222('0x1f')]();return _0x145e2e[0x0];})[_0xf222('0x14')](respondWithResult(_0x1bdd0a,0xc9))[_0xf222('0x15')](handleError(_0x1bdd0a,null));}else{return _0x1bdd0a[_0xf222('0xb')](0x1f4)[_0xf222('0x20')]({'message':_0xf222('0x21')});}};exports[_0xf222('0x22')]=function(_0x15bf4e,_0x2ec2e9){if(_0x15bf4e[_0xf222('0x18')]['id']){delete _0x15bf4e['body']['id'];}var _0x14b2b1={'online':_0xf222('0x23'),'stopped':_0xf222('0x24')};if(_0x14b2b1[_0xf222('0x25')](_0x15bf4e[_0xf222('0x18')][_0xf222('0xb')])){return pm2[_0x14b2b1[_0x15bf4e[_0xf222('0x18')][_0xf222('0xb')]]](_0x15bf4e[_0xf222('0x17')]['id'])['then'](respondWithResult(_0x2ec2e9,0xc8))[_0xf222('0x15')](handleError(_0x2ec2e9,null));}else{return _0x2ec2e9[_0xf222('0xb')](0x1f4)[_0xf222('0x20')]({'message':'Unknown\x20status'});}};exports[_0xf222('0x26')]=function(_0x5d5963,_0x40c7e7){if(_0x5d5963[_0xf222('0x18')]['id']){delete _0x5d5963[_0xf222('0x18')]['id'];}if(_0x5d5963[_0xf222('0x17')]['id']){return pm2[_0xf222('0x27')](_0x5d5963[_0xf222('0x17')]['id'])[_0xf222('0x14')](function(_0x5075ad){pm2['dump']();return _0x5075ad[0x0];})[_0xf222('0x14')](respondWithResult(_0x40c7e7,null))[_0xf222('0x15')](handleError(_0x40c7e7,null));}else{return _0x40c7e7[_0xf222('0xb')](0x1f4)[_0xf222('0x20')]({'message':_0xf222('0x28')});}}; \ No newline at end of file +var _0x750a=['restart','stop','Unknown\x20status','delete','Unknown\x20id','../../config/pm2','path','child_process','exec','bluebird','sendStatus','status','json','stack','name','send','npm\x20install','info','error','index','list','then','reject','express','length','describe','params','body','../../files/plugins','chdir','start','dump','catch','Missing\x20name\x20and/or\x20path','update'];(function(_0x22dac7,_0x45d32a){var _0x3e6cfa=function(_0x4c2e9d){while(--_0x4c2e9d){_0x22dac7['push'](_0x22dac7['shift']());}};_0x3e6cfa(++_0x45d32a);}(_0x750a,0x140));var _0xa750=function(_0xf5bd5a,_0x451532){_0xf5bd5a=_0xf5bd5a-0x0;var _0x53051b=_0x750a[_0xf5bd5a];return _0x53051b;};'use strict';var _=require('lodash');var pm2=require(_0xa750('0x0'));var logger=require('../../config/logger')('api');var path=require(_0xa750('0x1'));var exec=require(_0xa750('0x2'))[_0xa750('0x3')];var BPromise=require(_0xa750('0x4'));function handleEntityNotFound(_0x457cae,_0x43d704){return function(_0x562911){if(!_0x562911){_0x457cae[_0xa750('0x5')](0x194);;}return _0x562911;};}function respondWithResult(_0x10b4d9,_0x2497df){_0x2497df=_0x2497df||0xc8;return function(_0x197299){if(_0x197299){return _0x10b4d9[_0xa750('0x6')](_0x2497df)[_0xa750('0x7')](_0x197299);}return null;};}function handleError(_0x47a4dd,_0x53f2cb){_0x53f2cb=_0x53f2cb||0x1f4;return function(_0x2678ff){logger['error'](_0x2678ff[_0xa750('0x8')]);if(_0x2678ff[_0xa750('0x9')]){delete _0x2678ff['name'];}_0x47a4dd[_0xa750('0x6')](_0x53f2cb)[_0xa750('0xa')](_0x2678ff);};}function execChildProcess(){return new BPromise(function(_0x5870f0,_0x5aca9c){exec(_0xa750('0xb'),function(_0x4b19a1,_0x174fd0,_0x5adaae){logger['info'](_0x174fd0);logger[_0xa750('0xc')](_0x5adaae);if(_0x4b19a1){logger[_0xa750('0xd')](_0x4b19a1);return _0x5aca9c(_0x4b19a1);}return _0x5870f0(_0x174fd0);});});}exports[_0xa750('0xe')]=function(_0x567c51,_0x2f670f){return pm2[_0xa750('0xf')]()[_0xa750('0x10')](function(_0x24e48a){if(_0x24e48a){var _0xa66181=_[_0xa750('0x11')](_0x24e48a,function(_0x5806ed){return _0x5806ed[_0xa750('0x9')]===_0xa750('0x12')||_0x5806ed[_0xa750('0x9')]==='motion2';});return{'rows':_0xa66181,'count':_0xa66181[_0xa750('0x13')]};}return null;})[_0xa750('0x10')](respondWithResult(_0x2f670f,null))['catch'](handleError(_0x2f670f,null));};exports['show']=function(_0x321eb2,_0x5b1e6b){return pm2[_0xa750('0x14')](_0x321eb2[_0xa750('0x15')]['id'])['then'](respondWithResult(_0x5b1e6b,null))[_0xa750('0x10')](handleEntityNotFound(_0x5b1e6b,null))['catch'](handleError(_0x5b1e6b,null));};exports['create']=function(_0x25e335,_0x5d0935){if(_0x25e335[_0xa750('0x16')]['name']&&_0x25e335[_0xa750('0x16')]['script']){var _0x3dc7f1=path['join'](__dirname,_0xa750('0x17'),_0x25e335['body']['script']);var _0xaa9d3e=process['cwd']();process[_0xa750('0x18')](path['dirname'](_0x3dc7f1));return execChildProcess()['then'](function(_0x5b433d){process['chdir'](_0xaa9d3e);return pm2[_0xa750('0x19')]({'name':_0x25e335[_0xa750('0x16')][_0xa750('0x9')],'script':_0x3dc7f1});})[_0xa750('0x10')](function(_0x1b80a5){pm2[_0xa750('0x1a')]();return _0x1b80a5[0x0];})[_0xa750('0x10')](respondWithResult(_0x5d0935,0xc9))[_0xa750('0x1b')](handleError(_0x5d0935,null));}else{return _0x5d0935[_0xa750('0x6')](0x1f4)[_0xa750('0xa')]({'message':_0xa750('0x1c')});}};exports[_0xa750('0x1d')]=function(_0x31ea63,_0x3f7d6d){if(_0x31ea63[_0xa750('0x16')]['id']){delete _0x31ea63['body']['id'];}var _0x3d3923={'online':_0xa750('0x1e'),'stopped':_0xa750('0x1f')};if(_0x3d3923['hasOwnProperty'](_0x31ea63[_0xa750('0x16')][_0xa750('0x6')])){return pm2[_0x3d3923[_0x31ea63[_0xa750('0x16')][_0xa750('0x6')]]](_0x31ea63['params']['id'])[_0xa750('0x10')](respondWithResult(_0x3f7d6d,0xc8))[_0xa750('0x1b')](handleError(_0x3f7d6d,null));}else{return _0x3f7d6d[_0xa750('0x6')](0x1f4)[_0xa750('0xa')]({'message':_0xa750('0x20')});}};exports['destroy']=function(_0x46cc11,_0x4c2c9e){if(_0x46cc11[_0xa750('0x16')]['id']){delete _0x46cc11[_0xa750('0x16')]['id'];}if(_0x46cc11['params']['id']){return pm2[_0xa750('0x21')](_0x46cc11[_0xa750('0x15')]['id'])[_0xa750('0x10')](function(_0x314f88){pm2[_0xa750('0x1a')]();return _0x314f88[0x0];})[_0xa750('0x10')](respondWithResult(_0x4c2c9e,null))[_0xa750('0x1b')](handleError(_0x4c2c9e,null));}else{return _0x4c2c9e[_0xa750('0x6')](0x1f4)['send']({'message':_0xa750('0x22')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 73e5b06..ee3f9d7 100644 --- a/server/api/realtime/index.js +++ b/server/api/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d10=['isAuthenticated','getAgents','/queues','getQueues','exports','express','Router','./realtime.controller','/agents'];(function(_0x921930,_0x503a11){var _0x574c69=function(_0x19f932){while(--_0x19f932){_0x921930['push'](_0x921930['shift']());}};_0x574c69(++_0x503a11);}(_0x6d10,0x11c));var _0x06d1=function(_0x137828,_0x441e66){_0x137828=_0x137828-0x0;var _0x14b02d=_0x6d10[_0x137828];return _0x14b02d;};'use strict';var express=require(_0x06d1('0x0'));var router=express[_0x06d1('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x06d1('0x2'));router['get'](_0x06d1('0x3'),auth[_0x06d1('0x4')](),controller[_0x06d1('0x5')]);router['get'](_0x06d1('0x6'),auth['isAuthenticated'](),controller[_0x06d1('0x7')]);module[_0x06d1('0x8')]=router; \ No newline at end of file +var _0x89d7=['/queues','isAuthenticated','getQueues','exports','express','Router','./realtime.controller','get','/agents','getAgents'];(function(_0x430a83,_0x31aa08){var _0x3a0cab=function(_0x979a2a){while(--_0x979a2a){_0x430a83['push'](_0x430a83['shift']());}};_0x3a0cab(++_0x31aa08);}(_0x89d7,0x1bc));var _0x789d=function(_0x302a38,_0x2aae34){_0x302a38=_0x302a38-0x0;var _0x19a4a1=_0x89d7[_0x302a38];return _0x19a4a1;};'use strict';var express=require(_0x789d('0x0'));var router=express[_0x789d('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x789d('0x2'));router[_0x789d('0x3')](_0x789d('0x4'),auth['isAuthenticated'](),controller[_0x789d('0x5')]);router[_0x789d('0x3')](_0x789d('0x6'),auth[_0x789d('0x7')](),controller[_0x789d('0x8')]);module[_0x789d('0x9')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 1b5cbf6..dc97b89 100644 --- a/server/api/realtime/realtime.controller.js +++ b/server/api/realtime/realtime.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['pause','resolve','then','channel','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','includes','globalStatus','validateSortParameter','getUpdatedSortOptions','fields','join','order','getAgentIdsByQueues','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','map','User','rawAttributes','fieldName','type','key','role','agent','getOptions','raw','push','literal','FIELD(id,','forEach','*pause','Pause','merge','user','userProfileId','Agents','extraQueryConditions','assign','getResources','findAndCountAll','filterAgentAttributes','voice','talking','voiceStatus','Status','sortAgentsByStatus','pick','catch','getQueues','startCase','Queue','name','outbound','Queues','filter','UserProfile','lodash','util','../../components/realtime/agents','../../config/utils','../../errors/api','APIBadRequestError','handleError','offset','undefined','count','limit','json','getAgents','getChannels','query','globalStatusFilter','pauseTypeFilter'];(function(_0x45816a,_0x1b86ad){var _0xcbb020=function(_0x5eb770){while(--_0x5eb770){_0x45816a['push'](_0x45816a['shift']());}};_0xcbb020(++_0x1b86ad);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var rta=require(_0x0a9e('0x2'));var rtq=require('../../components/realtime/queues');var qs=require('../../components/parsers/qs');var utils=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var APIBadRequestError=require(_0x0a9e('0x4'))[_0x0a9e('0x5')];var APIHandleError=require(_0x0a9e('0x4'))[_0x0a9e('0x6')];function respondWithFilteredResult(_0x981158,_0x57b080){return function(_0x219af0){if(_0x219af0){var _0x441e3a=typeof _0x57b080[_0x0a9e('0x7')]==='undefined'&&typeof _0x57b080['limit']===_0x0a9e('0x8');var _0x56465b=_0x219af0['count'];var _0x39753a=_0x441e3a?0x0:_0x57b080[_0x0a9e('0x7')];var _0x307b3e=_0x441e3a?_0x219af0[_0x0a9e('0x9')]:_0x57b080[_0x0a9e('0x7')]+_0x57b080[_0x0a9e('0xa')];var _0x4a4c56;if(_0x307b3e>=_0x56465b){_0x307b3e=_0x56465b;_0x4a4c56=0xc8;}else{_0x4a4c56=0xce;}_0x981158['status'](_0x4a4c56);return _0x981158['set']('Content-Range',_0x39753a+'-'+_0x307b3e+'/'+_0x56465b)[_0x0a9e('0xb')](_0x219af0);}return null;};}exports[_0x0a9e('0xc')]=function(_0xd5b662,_0x26d672){var _0x32d742={'count':0x0,'rows':[]};var _0x69aeb7={};var _0x5db4b0;var _0x4283ce=utils[_0x0a9e('0xd')]();var _0x2b4227;var _0x281129;var _0x44dcfd=_0xd5b662[_0x0a9e('0xe')]['globalQueueFilter'];var _0x22dccb=_0xd5b662['query'][_0x0a9e('0xf')];var _0x519dfd=_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x10')];var _0x48f32d=_0x22dccb===_0x0a9e('0x11')||_0x22dccb==='*pause'?!![]:![];var _0x459eb1=[];var _0x478723;var _0x106033;Promise[_0x0a9e('0x12')]()[_0x0a9e('0x13')](function(){if(_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x14')]){if(!utils[_0x0a9e('0x15')](_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x14')])){throw new APIBadRequestError(util[_0x0a9e('0x16')](_0x0a9e('0x17'),_0xd5b662['query'][_0x0a9e('0x14')]));}_0x5db4b0=_0xd5b662[_0x0a9e('0xe')]['channel'][_0x0a9e('0x18')]();}if(!_0xd5b662['query']['sort']||!_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x19')][_0x0a9e('0x1a')](_0x0a9e('0x1b'))){_0xd5b662['query'][_0x0a9e('0x19')]=rta[_0x0a9e('0x1c')](_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x19')]);return;}var _0x370d86=rta[_0x0a9e('0x1d')](_0xd5b662[_0x0a9e('0xe')]['sort']);_0xd5b662['query'][_0x0a9e('0x19')]=_0x370d86[_0x0a9e('0x1e')][_0x0a9e('0x1f')](',');_0x478723=_0x370d86[_0x0a9e('0x20')];})['then'](function(){if(!_0x44dcfd){return[];}return rta[_0x0a9e('0x21')](_0x44dcfd,_0x5db4b0);})['then'](function(_0x45a1e7){_0x459eb1=_0x45a1e7;return rta['getRealtimeAgents']();})[_0x0a9e('0x13')](function(_0x34dc65){_0x281129=_0x34dc65[_0x0a9e('0x22')];if((!_0x22dccb||_0x48f32d)&&!_0x478723){return _0x459eb1;}if(_0x478723&&!_0x22dccb){return rta[_0x0a9e('0x23')](_0x281129,_0x459eb1,_0x478723);}else{return rta[_0x0a9e('0x24')](_0x281129,_0x459eb1,_0x22dccb);}})[_0x0a9e('0x13')](function(_0x11c3b6){_0x459eb1=_0x11c3b6;var _0x14de77=![];if(_0x459eb1['length']===0x0){if(_0x44dcfd||_0x22dccb){_0x14de77=!![];}if(_0x48f32d){_0x14de77=![];}}if(_0x14de77){return _0x32d742;}var _0x3652a7=_[_0x0a9e('0x25')](db[_0x0a9e('0x26')][_0x0a9e('0x27')],function(_0x5c877d){return{'name':_0x5c877d[_0x0a9e('0x28')],'type':_0x5c877d[_0x0a9e('0x29')][_0x0a9e('0x2a')]};});_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x2b')]=_0x0a9e('0x2c');_0x69aeb7=qs[_0x0a9e('0x2d')](_0x3652a7,_0xd5b662);_0x69aeb7[_0x0a9e('0x2e')]=!![];var _0x1dbde2=[];if(_0x459eb1['length']>0x0){_0x1dbde2[_0x0a9e('0x2f')]({'id':{'$in':_0x459eb1}});if(_0x478723&&!_0x22dccb){_0x106033=[db['sequelize'][_0x0a9e('0x30')](_0x0a9e('0x31')+_0x459eb1+')')];_0x69aeb7[_0x0a9e('0x20')]=_0x106033;}}if(_0x48f32d){_0x4283ce[_0x0a9e('0x32')](function(_0x25ce3a){var _0x5180f1=!![];if(_0x22dccb===_0x0a9e('0x33')&&_0x5db4b0!==_0x25ce3a){_0x5180f1=![];}_0x1dbde2[_0x0a9e('0x2f')]({[_0x25ce3a+_0x0a9e('0x34')]:_0x5180f1});});if(_0x519dfd){_0x1dbde2[_0x0a9e('0x2f')]({'pauseType':_0x519dfd});}}else if(_0x22dccb){_0x4283ce[_0x0a9e('0x32')](function(_0x409319){_0x1dbde2[_0x0a9e('0x2f')]({[_0x409319+_0x0a9e('0x34')]:![]});});}_0x69aeb7['where']=_[_0x0a9e('0x35')](_0x69aeb7['where'],{'$and':_0x1dbde2});if(_0xd5b662[_0x0a9e('0x36')][_0x0a9e('0x2b')]===_0x0a9e('0x36')){var _0x3f3d41={'params':{'id':_0xd5b662['user'][_0x0a9e('0x37')]},'query':{'section':_0x0a9e('0x38'),'role':_0x0a9e('0x2c'),'online':_0xd5b662[_0x0a9e('0xe')]['online']===!![]?!![]:![],'raw':!![],'ids':_0x459eb1,'customSorting':_0x106033}};if(_0x48f32d){_0x3f3d41['query'][_0x0a9e('0x39')]=_0x1dbde2;}_0x3f3d41['query']=Object[_0x0a9e('0x3a')](_0x3f3d41[_0x0a9e('0xe')],_0xd5b662[_0x0a9e('0xe')]);delete _0x3f3d41[_0x0a9e('0xe')]['id'];return db['UserProfile'][_0x0a9e('0x3b')](_0x3f3d41);}return db[_0x0a9e('0x26')][_0x0a9e('0x3c')](_0x69aeb7);})['then'](function(_0x1dbf74){_0x32d742[_0x0a9e('0x9')]=_0x1dbf74[_0x0a9e('0x9')];_0x2b4227=_0x1dbf74['rows'];return _0x2b4227['map'](function(_0x11b61d){var _0x40d766=_['find'](_0x281129,['id',_0x11b61d['id']]);if(_0x40d766){var _0x2b814e=rta[_0x0a9e('0x3d')](_0x40d766);_[_0x0a9e('0x35')](_0x11b61d,_0x2b814e);}_0x11b61d[_0x0a9e('0x1b')]=rta['getAgentStatus'](_0x11b61d);if(_0x11b61d['globalStatus'][_0x0a9e('0x1a')](_0x0a9e('0x11'))){_0x4283ce['forEach'](function(_0x183991){if(_0x11b61d[_0x183991+_0x0a9e('0x34')]){if(_0x183991===_0x0a9e('0x3e')){if(_0x11b61d['voiceStatus']!==_0x0a9e('0x3f')){_0x11b61d[_0x0a9e('0x40')]=_0x0a9e('0x11');}}else{_0x11b61d[_0x183991+_0x0a9e('0x41')]=_0x0a9e('0x11');}}});}return _0x11b61d;});})[_0x0a9e('0x13')](function(_0x2881b3){if(!_0x478723||_0x106033){return _0x2881b3;}return rta[_0x0a9e('0x42')](_0x2881b3,_0x478723);})[_0x0a9e('0x13')](function(_0x3da2cd){var _0x2c3711=null;if(_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x1e')]){var _0x11ca30=_0xd5b662[_0x0a9e('0xe')]['fields']['split'](',');_0x2c3711=_0x3da2cd[_0x0a9e('0x25')](function(_0xb3795a){return _[_0x0a9e('0x43')](_0xb3795a,_0x11ca30);});}_0x32d742[_0x0a9e('0x22')]=_0x2c3711||_0x3da2cd;return _0x32d742;})[_0x0a9e('0x13')](respondWithFilteredResult(_0x26d672,_0x69aeb7))[_0x0a9e('0x44')](APIHandleError(_0x26d672));};exports[_0x0a9e('0x45')]=function(_0x445e25,_0x432fcc){var _0x25c6e6={'count':0x0,'rows':[]};var _0x2c2cb0={};var _0x35ed4a;var _0x5026aa;var _0x117c99;Promise[_0x0a9e('0x12')]()[_0x0a9e('0x13')](function(){if(_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x14')]){if(!utils[_0x0a9e('0x15')](_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x14')])){throw new APIBadRequestError(util['format'](_0x0a9e('0x17'),_0x445e25['query'][_0x0a9e('0x14')]));}_0x35ed4a=_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x14')]['toLowerCase']();}var _0x14bec2=_[_0x0a9e('0x46')](_0x35ed4a)+_0x0a9e('0x47');var _0x34aa5a=_[_0x0a9e('0x25')](db[_0x14bec2][_0x0a9e('0x27')],function(_0x45bf7f){return{'name':_0x45bf7f['fieldName'],'type':_0x45bf7f[_0x0a9e('0x29')][_0x0a9e('0x2a')]};});if(!_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x1e')]){var _0x409789=['id',_0x0a9e('0x48')];if(_0x35ed4a===_0x0a9e('0x3e')){_0x409789[_0x0a9e('0x2f')](_0x0a9e('0x29'));if(_0x445e25['query'][_0x0a9e('0x29')]===_0x0a9e('0x49')){_0x409789['push'](['dialActive','dialMethod']);}}_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x1e')]=_0x409789[_0x0a9e('0x1f')](',');}_0x2c2cb0=qs[_0x0a9e('0x2d')](_0x34aa5a,_0x445e25);if(_0x445e25[_0x0a9e('0x36')][_0x0a9e('0x2b')]===_0x0a9e('0x36')){var _0x375c18={'params':{'id':_0x445e25['user']['userProfileId']},'query':{'section':_0x35ed4a==='voice'&&_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x29')]===_0x0a9e('0x49')?'QueueCampaigns':_[_0x0a9e('0x46')](_0x35ed4a)+_0x0a9e('0x4a'),'type':_0x445e25['query']['type'],'nolimit':!![],'sort':_0x0a9e('0x48'),'filter':_0x445e25['query'][_0x0a9e('0x4b')]}};_0x375c18['query']=Object[_0x0a9e('0x3a')](_0x375c18[_0x0a9e('0xe')],_0x445e25[_0x0a9e('0xe')]);delete _0x375c18['query']['id'];return db[_0x0a9e('0x4c')][_0x0a9e('0x3b')](_0x375c18);}return db[_0x14bec2]['findAndCountAll'](_0x2c2cb0);})['then'](function(_0x128aa6){_0x25c6e6[_0x0a9e('0x9')]=_0x128aa6['count'];_0x5026aa=_0x128aa6[_0x0a9e('0x22')];return rtq['getRealtimeQueues'](_0x445e25,_0x35ed4a);})[_0x0a9e('0x13')](function(_0x523cd2){_0x117c99=_0x523cd2[_0x0a9e('0x22')];return rtq['initializeQueues'](_0x5026aa,_0x117c99,_0x35ed4a,_0x445e25['query']['type']);})[_0x0a9e('0x13')](function(_0x47de4c){_0x25c6e6[_0x0a9e('0x22')]=_0x47de4c;return _0x25c6e6;})[_0x0a9e('0x13')](respondWithFilteredResult(_0x432fcc,_0x2c2cb0))[_0x0a9e('0x44')](APIHandleError(_0x432fcc));}; \ No newline at end of file +var _0xa9e0=['pause','resolve','then','channel','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','includes','globalStatus','validateSortParameter','getUpdatedSortOptions','fields','join','order','getAgentIdsByQueues','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','map','User','rawAttributes','fieldName','type','key','role','agent','getOptions','raw','push','literal','FIELD(id,','forEach','*pause','Pause','merge','user','userProfileId','Agents','extraQueryConditions','assign','getResources','findAndCountAll','filterAgentAttributes','voice','talking','voiceStatus','Status','sortAgentsByStatus','pick','catch','getQueues','startCase','Queue','name','outbound','Queues','filter','UserProfile','lodash','util','../../components/realtime/agents','../../config/utils','../../errors/api','APIBadRequestError','handleError','offset','undefined','count','limit','json','getAgents','getChannels','query','globalStatusFilter','pauseTypeFilter'];(function(_0x384786,_0x1d1089){var _0x501416=function(_0x266900){while(--_0x266900){_0x384786['push'](_0x384786['shift']());}};_0x501416(++_0x1d1089);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var rta=require(_0x0a9e('0x2'));var rtq=require('../../components/realtime/queues');var qs=require('../../components/parsers/qs');var utils=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var APIBadRequestError=require(_0x0a9e('0x4'))[_0x0a9e('0x5')];var APIHandleError=require(_0x0a9e('0x4'))[_0x0a9e('0x6')];function respondWithFilteredResult(_0x981158,_0x57b080){return function(_0x219af0){if(_0x219af0){var _0x441e3a=typeof _0x57b080[_0x0a9e('0x7')]==='undefined'&&typeof _0x57b080['limit']===_0x0a9e('0x8');var _0x56465b=_0x219af0['count'];var _0x39753a=_0x441e3a?0x0:_0x57b080[_0x0a9e('0x7')];var _0x307b3e=_0x441e3a?_0x219af0[_0x0a9e('0x9')]:_0x57b080[_0x0a9e('0x7')]+_0x57b080[_0x0a9e('0xa')];var _0x4a4c56;if(_0x307b3e>=_0x56465b){_0x307b3e=_0x56465b;_0x4a4c56=0xc8;}else{_0x4a4c56=0xce;}_0x981158['status'](_0x4a4c56);return _0x981158['set']('Content-Range',_0x39753a+'-'+_0x307b3e+'/'+_0x56465b)[_0x0a9e('0xb')](_0x219af0);}return null;};}exports[_0x0a9e('0xc')]=function(_0xd5b662,_0x26d672){var _0x32d742={'count':0x0,'rows':[]};var _0x69aeb7={};var _0x5db4b0;var _0x4283ce=utils[_0x0a9e('0xd')]();var _0x2b4227;var _0x281129;var _0x44dcfd=_0xd5b662[_0x0a9e('0xe')]['globalQueueFilter'];var _0x22dccb=_0xd5b662['query'][_0x0a9e('0xf')];var _0x519dfd=_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x10')];var _0x48f32d=_0x22dccb===_0x0a9e('0x11')||_0x22dccb==='*pause'?!![]:![];var _0x459eb1=[];var _0x478723;var _0x106033;Promise[_0x0a9e('0x12')]()[_0x0a9e('0x13')](function(){if(_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x14')]){if(!utils[_0x0a9e('0x15')](_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x14')])){throw new APIBadRequestError(util[_0x0a9e('0x16')](_0x0a9e('0x17'),_0xd5b662['query'][_0x0a9e('0x14')]));}_0x5db4b0=_0xd5b662[_0x0a9e('0xe')]['channel'][_0x0a9e('0x18')]();}if(!_0xd5b662['query']['sort']||!_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x19')][_0x0a9e('0x1a')](_0x0a9e('0x1b'))){_0xd5b662['query'][_0x0a9e('0x19')]=rta[_0x0a9e('0x1c')](_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x19')]);return;}var _0x370d86=rta[_0x0a9e('0x1d')](_0xd5b662[_0x0a9e('0xe')]['sort']);_0xd5b662['query'][_0x0a9e('0x19')]=_0x370d86[_0x0a9e('0x1e')][_0x0a9e('0x1f')](',');_0x478723=_0x370d86[_0x0a9e('0x20')];})['then'](function(){if(!_0x44dcfd){return[];}return rta[_0x0a9e('0x21')](_0x44dcfd,_0x5db4b0);})['then'](function(_0x45a1e7){_0x459eb1=_0x45a1e7;return rta['getRealtimeAgents']();})[_0x0a9e('0x13')](function(_0x34dc65){_0x281129=_0x34dc65[_0x0a9e('0x22')];if((!_0x22dccb||_0x48f32d)&&!_0x478723){return _0x459eb1;}if(_0x478723&&!_0x22dccb){return rta[_0x0a9e('0x23')](_0x281129,_0x459eb1,_0x478723);}else{return rta[_0x0a9e('0x24')](_0x281129,_0x459eb1,_0x22dccb);}})[_0x0a9e('0x13')](function(_0x11c3b6){_0x459eb1=_0x11c3b6;var _0x14de77=![];if(_0x459eb1['length']===0x0){if(_0x44dcfd||_0x22dccb){_0x14de77=!![];}if(_0x48f32d){_0x14de77=![];}}if(_0x14de77){return _0x32d742;}var _0x3652a7=_[_0x0a9e('0x25')](db[_0x0a9e('0x26')][_0x0a9e('0x27')],function(_0x5c877d){return{'name':_0x5c877d[_0x0a9e('0x28')],'type':_0x5c877d[_0x0a9e('0x29')][_0x0a9e('0x2a')]};});_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x2b')]=_0x0a9e('0x2c');_0x69aeb7=qs[_0x0a9e('0x2d')](_0x3652a7,_0xd5b662);_0x69aeb7[_0x0a9e('0x2e')]=!![];var _0x1dbde2=[];if(_0x459eb1['length']>0x0){_0x1dbde2[_0x0a9e('0x2f')]({'id':{'$in':_0x459eb1}});if(_0x478723&&!_0x22dccb){_0x106033=[db['sequelize'][_0x0a9e('0x30')](_0x0a9e('0x31')+_0x459eb1+')')];_0x69aeb7[_0x0a9e('0x20')]=_0x106033;}}if(_0x48f32d){_0x4283ce[_0x0a9e('0x32')](function(_0x25ce3a){var _0x5180f1=!![];if(_0x22dccb===_0x0a9e('0x33')&&_0x5db4b0!==_0x25ce3a){_0x5180f1=![];}_0x1dbde2[_0x0a9e('0x2f')]({[_0x25ce3a+_0x0a9e('0x34')]:_0x5180f1});});if(_0x519dfd){_0x1dbde2[_0x0a9e('0x2f')]({'pauseType':_0x519dfd});}}else if(_0x22dccb){_0x4283ce[_0x0a9e('0x32')](function(_0x409319){_0x1dbde2[_0x0a9e('0x2f')]({[_0x409319+_0x0a9e('0x34')]:![]});});}_0x69aeb7['where']=_[_0x0a9e('0x35')](_0x69aeb7['where'],{'$and':_0x1dbde2});if(_0xd5b662[_0x0a9e('0x36')][_0x0a9e('0x2b')]===_0x0a9e('0x36')){var _0x3f3d41={'params':{'id':_0xd5b662['user'][_0x0a9e('0x37')]},'query':{'section':_0x0a9e('0x38'),'role':_0x0a9e('0x2c'),'online':_0xd5b662[_0x0a9e('0xe')]['online']===!![]?!![]:![],'raw':!![],'ids':_0x459eb1,'customSorting':_0x106033}};if(_0x48f32d){_0x3f3d41['query'][_0x0a9e('0x39')]=_0x1dbde2;}_0x3f3d41['query']=Object[_0x0a9e('0x3a')](_0x3f3d41[_0x0a9e('0xe')],_0xd5b662[_0x0a9e('0xe')]);delete _0x3f3d41[_0x0a9e('0xe')]['id'];return db['UserProfile'][_0x0a9e('0x3b')](_0x3f3d41);}return db[_0x0a9e('0x26')][_0x0a9e('0x3c')](_0x69aeb7);})['then'](function(_0x1dbf74){_0x32d742[_0x0a9e('0x9')]=_0x1dbf74[_0x0a9e('0x9')];_0x2b4227=_0x1dbf74['rows'];return _0x2b4227['map'](function(_0x11b61d){var _0x40d766=_['find'](_0x281129,['id',_0x11b61d['id']]);if(_0x40d766){var _0x2b814e=rta[_0x0a9e('0x3d')](_0x40d766);_[_0x0a9e('0x35')](_0x11b61d,_0x2b814e);}_0x11b61d[_0x0a9e('0x1b')]=rta['getAgentStatus'](_0x11b61d);if(_0x11b61d['globalStatus'][_0x0a9e('0x1a')](_0x0a9e('0x11'))){_0x4283ce['forEach'](function(_0x183991){if(_0x11b61d[_0x183991+_0x0a9e('0x34')]){if(_0x183991===_0x0a9e('0x3e')){if(_0x11b61d['voiceStatus']!==_0x0a9e('0x3f')){_0x11b61d[_0x0a9e('0x40')]=_0x0a9e('0x11');}}else{_0x11b61d[_0x183991+_0x0a9e('0x41')]=_0x0a9e('0x11');}}});}return _0x11b61d;});})[_0x0a9e('0x13')](function(_0x2881b3){if(!_0x478723||_0x106033){return _0x2881b3;}return rta[_0x0a9e('0x42')](_0x2881b3,_0x478723);})[_0x0a9e('0x13')](function(_0x3da2cd){var _0x2c3711=null;if(_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x1e')]){var _0x11ca30=_0xd5b662[_0x0a9e('0xe')]['fields']['split'](',');_0x2c3711=_0x3da2cd[_0x0a9e('0x25')](function(_0xb3795a){return _[_0x0a9e('0x43')](_0xb3795a,_0x11ca30);});}_0x32d742[_0x0a9e('0x22')]=_0x2c3711||_0x3da2cd;return _0x32d742;})[_0x0a9e('0x13')](respondWithFilteredResult(_0x26d672,_0x69aeb7))[_0x0a9e('0x44')](APIHandleError(_0x26d672));};exports[_0x0a9e('0x45')]=function(_0x445e25,_0x432fcc){var _0x25c6e6={'count':0x0,'rows':[]};var _0x2c2cb0={};var _0x35ed4a;var _0x5026aa;var _0x117c99;Promise[_0x0a9e('0x12')]()[_0x0a9e('0x13')](function(){if(_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x14')]){if(!utils[_0x0a9e('0x15')](_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x14')])){throw new APIBadRequestError(util['format'](_0x0a9e('0x17'),_0x445e25['query'][_0x0a9e('0x14')]));}_0x35ed4a=_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x14')]['toLowerCase']();}var _0x14bec2=_[_0x0a9e('0x46')](_0x35ed4a)+_0x0a9e('0x47');var _0x34aa5a=_[_0x0a9e('0x25')](db[_0x14bec2][_0x0a9e('0x27')],function(_0x45bf7f){return{'name':_0x45bf7f['fieldName'],'type':_0x45bf7f[_0x0a9e('0x29')][_0x0a9e('0x2a')]};});if(!_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x1e')]){var _0x409789=['id',_0x0a9e('0x48')];if(_0x35ed4a===_0x0a9e('0x3e')){_0x409789[_0x0a9e('0x2f')](_0x0a9e('0x29'));if(_0x445e25['query'][_0x0a9e('0x29')]===_0x0a9e('0x49')){_0x409789['push'](['dialActive','dialMethod']);}}_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x1e')]=_0x409789[_0x0a9e('0x1f')](',');}_0x2c2cb0=qs[_0x0a9e('0x2d')](_0x34aa5a,_0x445e25);if(_0x445e25[_0x0a9e('0x36')][_0x0a9e('0x2b')]===_0x0a9e('0x36')){var _0x375c18={'params':{'id':_0x445e25['user']['userProfileId']},'query':{'section':_0x35ed4a==='voice'&&_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x29')]===_0x0a9e('0x49')?'QueueCampaigns':_[_0x0a9e('0x46')](_0x35ed4a)+_0x0a9e('0x4a'),'type':_0x445e25['query']['type'],'nolimit':!![],'sort':_0x0a9e('0x48'),'filter':_0x445e25['query'][_0x0a9e('0x4b')]}};_0x375c18['query']=Object[_0x0a9e('0x3a')](_0x375c18[_0x0a9e('0xe')],_0x445e25[_0x0a9e('0xe')]);delete _0x375c18['query']['id'];return db[_0x0a9e('0x4c')][_0x0a9e('0x3b')](_0x375c18);}return db[_0x14bec2]['findAndCountAll'](_0x2c2cb0);})['then'](function(_0x128aa6){_0x25c6e6[_0x0a9e('0x9')]=_0x128aa6['count'];_0x5026aa=_0x128aa6[_0x0a9e('0x22')];return rtq['getRealtimeQueues'](_0x445e25,_0x35ed4a);})[_0x0a9e('0x13')](function(_0x523cd2){_0x117c99=_0x523cd2[_0x0a9e('0x22')];return rtq['initializeQueues'](_0x5026aa,_0x117c99,_0x35ed4a,_0x445e25['query']['type']);})[_0x0a9e('0x13')](function(_0x47de4c){_0x25c6e6[_0x0a9e('0x22')]=_0x47de4c;return _0x25c6e6;})[_0x0a9e('0x13')](respondWithFilteredResult(_0x432fcc,_0x2c2cb0))[_0x0a9e('0x44')](APIHandleError(_0x432fcc));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 55092c2..e464ba0 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2fbe9b,_0x12d6df){var _0xd88114=function(_0x3c4e96){while(--_0x3c4e96){_0x2fbe9b['push'](_0x2fbe9b['shift']());}};_0xd88114(++_0x12d6df);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x2bf9ae,_0x270fda){var _0x23c251=function(_0x3be086){while(--_0x3be086){_0x2bf9ae['push'](_0x2bf9ae['shift']());}};_0x23c251(++_0x270fda);}(_0x9c44,0x178));var _0x49c4=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x9c44[_0x36c5b0];return _0xf19333;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 6a21acd..f5c0825 100644 --- a/server/api/reportAgentPreview/reportAgentPreview.attributes.js +++ b/server/api/reportAgentPreview/reportAgentPreview.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe6e9=['STRING','sequelize','exports','INTEGER','DATE'];(function(_0x145f29,_0x269b45){var _0x12a17f=function(_0x40b9cf){while(--_0x40b9cf){_0x145f29['push'](_0x145f29['shift']());}};_0x12a17f(++_0x269b45);}(_0xe6e9,0x182));var _0x9e6e=function(_0x41beb7,_0x32009c){_0x41beb7=_0x41beb7-0x0;var _0x11529c=_0xe6e9[_0x41beb7];return _0x11529c;};'use strict';var Sequelize=require(_0x9e6e('0x0'));module[_0x9e6e('0x1')]={'state':{'type':Sequelize[_0x9e6e('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x9e6e('0x3')]},'uniqueid':{'type':Sequelize[_0x9e6e('0x4')]},'starttime':{'type':Sequelize[_0x9e6e('0x3')]},'responsetime':{'type':Sequelize[_0x9e6e('0x3')]},'ringtime':{'type':Sequelize[_0x9e6e('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x9e6e('0x4')]},'membername':{'type':Sequelize[_0x9e6e('0x4')]}}; \ No newline at end of file +var _0x7958=['exports','STRING','DATE','INTEGER','sequelize'];(function(_0x2891b9,_0x2b2c42){var _0x57ccb1=function(_0x293f7a){while(--_0x293f7a){_0x2891b9['push'](_0x2891b9['shift']());}};_0x57ccb1(++_0x2b2c42);}(_0x7958,0x126));var _0x8795=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7958[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x8795('0x0'));module[_0x8795('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x8795('0x2')]},'scheduledat':{'type':Sequelize[_0x8795('0x3')]},'uniqueid':{'type':Sequelize[_0x8795('0x2')]},'starttime':{'type':Sequelize[_0x8795('0x3')]},'responsetime':{'type':Sequelize[_0x8795('0x3')]},'ringtime':{'type':Sequelize[_0x8795('0x4')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x8795('0x2')]},'campaigntype':{'type':Sequelize[_0x8795('0x2')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index a603f75..d5452e2 100644 --- a/server/api/reportAgentPreview/reportAgentPreview.model.js +++ b/server/api/reportAgentPreview/reportAgentPreview.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbf8c=['define','report_agent_preview','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports'];(function(_0x1f3c56,_0x598757){var _0x569524=function(_0x345301){while(--_0x345301){_0x1f3c56['push'](_0x1f3c56['shift']());}};_0x569524(++_0x598757);}(_0xbf8c,0x188));var _0xcbf8=function(_0xffa198,_0x5a8940){_0xffa198=_0xffa198-0x0;var _0x1e4b50=_0xbf8c[_0xffa198];return _0x1e4b50;};'use strict';var _=require('lodash');var util=require(_0xcbf8('0x0'));var logger=require(_0xcbf8('0x1'))(_0xcbf8('0x2'));var moment=require(_0xcbf8('0x3'));var BPromise=require(_0xcbf8('0x4'));var rp=require(_0xcbf8('0x5'));var fs=require('fs');var path=require(_0xcbf8('0x6'));var rimraf=require(_0xcbf8('0x7'));var config=require(_0xcbf8('0x8'));var attributes=require(_0xcbf8('0x9'));module[_0xcbf8('0xa')]=function(_0x3ceee8,_0x418927){return _0x3ceee8[_0xcbf8('0xb')]('ReportAgentPreview',attributes,{'tableName':_0xcbf8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2809=['report_agent_preview','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview'];(function(_0x2a686d,_0x503126){var _0x37731f=function(_0x2752d7){while(--_0x2752d7){_0x2a686d['push'](_0x2a686d['shift']());}};_0x37731f(++_0x503126);}(_0x2809,0xb7));var _0x9280=function(_0x4b33ff,_0x34193c){_0x4b33ff=_0x4b33ff-0x0;var _0x24c2f7=_0x2809[_0x4b33ff];return _0x24c2f7;};'use strict';var _=require(_0x9280('0x0'));var util=require(_0x9280('0x1'));var logger=require('../../config/logger')(_0x9280('0x2'));var moment=require('moment');var BPromise=require(_0x9280('0x3'));var rp=require(_0x9280('0x4'));var fs=require('fs');var path=require(_0x9280('0x5'));var rimraf=require(_0x9280('0x6'));var config=require(_0x9280('0x7'));var attributes=require(_0x9280('0x8'));module[_0x9280('0x9')]=function(_0x18224b,_0x1fc4ea){return _0x18224b[_0x9280('0xa')](_0x9280('0xb'),attributes,{'tableName':_0x9280('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index b96807d..9098725 100644 --- a/server/api/reportAgentPreview/reportAgentPreview.rpc.js +++ b/server/api/reportAgentPreview/reportAgentPreview.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c4f=['result','catch','create','options','raw','CreateReportAgentPreview','debug','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','error','code','message','info'];(function(_0x35bfa2,_0x5e5c4a){var _0x118c03=function(_0x48a316){while(--_0x48a316){_0x35bfa2['push'](_0x35bfa2['shift']());}};_0x118c03(++_0x5e5c4a);}(_0x9c4f,0xf1));var _0xf9c4=function(_0x2de9ae,_0x492af5){_0x2de9ae=_0x2de9ae-0x0;var _0xa6a69=_0x9c4f[_0x2de9ae];return _0xa6a69;};'use strict';var _=require(_0xf9c4('0x0'));var util=require(_0xf9c4('0x1'));var moment=require(_0xf9c4('0x2'));var BPromise=require(_0xf9c4('0x3'));var rs=require(_0xf9c4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf9c4('0x5'));var logger=require(_0xf9c4('0x6'))(_0xf9c4('0x7'));var config=require(_0xf9c4('0x8'));var jayson=require(_0xf9c4('0x9'));var client=jayson[_0xf9c4('0xa')][_0xf9c4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x103339,_0x52c048,_0x203ab1){return new BPromise(function(_0x4d2ab2,_0x4015eb){return client['request'](_0x103339,_0x203ab1)[_0xf9c4('0xc')](function(_0x1897c6){logger['info'](_0xf9c4('0xd'),_0x52c048,_0xf9c4('0xe'));logger['debug']('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x52c048,'request\x20sent',JSON['stringify'](_0x1897c6));if(_0x1897c6[_0xf9c4('0xf')]){if(_0x1897c6['error'][_0xf9c4('0x10')]===0x1f4){logger[_0xf9c4('0xf')](_0xf9c4('0xd'),_0x52c048,_0x1897c6[_0xf9c4('0xf')][_0xf9c4('0x11')]);return _0x4015eb(_0x1897c6[_0xf9c4('0xf')][_0xf9c4('0x11')]);}logger[_0xf9c4('0xf')](_0xf9c4('0xd'),_0x52c048,_0x1897c6[_0xf9c4('0xf')][_0xf9c4('0x11')]);return _0x4d2ab2(_0x1897c6[_0xf9c4('0xf')][_0xf9c4('0x11')]);}else{logger[_0xf9c4('0x12')](_0xf9c4('0xd'),_0x52c048,_0xf9c4('0xe'));_0x4d2ab2(_0x1897c6[_0xf9c4('0x13')][_0xf9c4('0x11')]);}})[_0xf9c4('0x14')](function(_0x47c5cc){logger[_0xf9c4('0xf')](_0xf9c4('0xd'),_0x52c048,_0x47c5cc);_0x4015eb(_0x47c5cc);});});}exports['CreateReportAgentPreview']=function(_0x37add8){var _0x11d2ce=this;return new Promise(function(_0x11094f,_0xe61543){return db['ReportAgentPreview'][_0xf9c4('0x15')](_0x37add8['body'],{'raw':_0x37add8[_0xf9c4('0x16')]?_0x37add8[_0xf9c4('0x16')][_0xf9c4('0x17')]===undefined?!![]:![]:!![]})[_0xf9c4('0xc')](function(_0x2b50c6){logger[_0xf9c4('0x12')](_0xf9c4('0x18'),_0x37add8);logger[_0xf9c4('0x19')](_0xf9c4('0x18'),_0x37add8,JSON['stringify'](_0x2b50c6));_0x11094f(_0x2b50c6);})[_0xf9c4('0x14')](function(_0x1efd4d){logger[_0xf9c4('0xf')]('CreateReportAgentPreview',_0x1efd4d[_0xf9c4('0x11')],_0x37add8);_0xe61543(_0x11d2ce['error'](0x1f4,_0x1efd4d[_0xf9c4('0x11')]));});});}; \ No newline at end of file +var _0xde6c=['rpc','../../config/environment','jayson/promise','client','http','then','info','ReportAgentPreview,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','CreateReportAgentPreview','ReportAgentPreview','create','body','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x341c09,_0x1cce6b){var _0x5f464f=function(_0x550bf7){while(--_0x550bf7){_0x341c09['push'](_0x341c09['shift']());}};_0x5f464f(++_0x1cce6b);}(_0xde6c,0x164));var _0xcde6=function(_0x5076e9,_0x22454a){_0x5076e9=_0x5076e9-0x0;var _0x2a0de1=_0xde6c[_0x5076e9];return _0x2a0de1;};'use strict';var _=require(_0xcde6('0x0'));var util=require(_0xcde6('0x1'));var moment=require(_0xcde6('0x2'));var BPromise=require(_0xcde6('0x3'));var rs=require(_0xcde6('0x4'));var fs=require('fs');var Redis=require(_0xcde6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xcde6('0x6'));var logger=require(_0xcde6('0x7'))(_0xcde6('0x8'));var config=require(_0xcde6('0x9'));var jayson=require(_0xcde6('0xa'));var client=jayson[_0xcde6('0xb')][_0xcde6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x6fbda8,_0x8303fa,_0x46eaa7){return new BPromise(function(_0x5f8dad,_0x53d854){return client['request'](_0x6fbda8,_0x46eaa7)[_0xcde6('0xd')](function(_0x1b5148){logger[_0xcde6('0xe')](_0xcde6('0xf'),_0x8303fa,'request\x20sent');logger[_0xcde6('0x10')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x8303fa,'request\x20sent',JSON[_0xcde6('0x11')](_0x1b5148));if(_0x1b5148[_0xcde6('0x12')]){if(_0x1b5148[_0xcde6('0x12')][_0xcde6('0x13')]===0x1f4){logger['error'](_0xcde6('0xf'),_0x8303fa,_0x1b5148['error']['message']);return _0x53d854(_0x1b5148[_0xcde6('0x12')][_0xcde6('0x14')]);}logger[_0xcde6('0x12')](_0xcde6('0xf'),_0x8303fa,_0x1b5148['error'][_0xcde6('0x14')]);return _0x5f8dad(_0x1b5148[_0xcde6('0x12')][_0xcde6('0x14')]);}else{logger['info'](_0xcde6('0xf'),_0x8303fa,_0xcde6('0x15'));_0x5f8dad(_0x1b5148['result'][_0xcde6('0x14')]);}})['catch'](function(_0xdbc71c){logger[_0xcde6('0x12')](_0xcde6('0xf'),_0x8303fa,_0xdbc71c);_0x53d854(_0xdbc71c);});});}exports[_0xcde6('0x16')]=function(_0x1822a7){var _0x4caeed=this;return new Promise(function(_0x22845a,_0x16e7be){return db[_0xcde6('0x17')][_0xcde6('0x18')](_0x1822a7[_0xcde6('0x19')],{'raw':_0x1822a7['options']?_0x1822a7['options'][_0xcde6('0x1a')]===undefined?!![]:![]:!![]})[_0xcde6('0xd')](function(_0x3a48be){logger[_0xcde6('0xe')](_0xcde6('0x16'),_0x1822a7);logger[_0xcde6('0x10')]('CreateReportAgentPreview',_0x1822a7,JSON[_0xcde6('0x11')](_0x3a48be));_0x22845a(_0x3a48be);})[_0xcde6('0x1b')](function(_0x283517){logger['error'](_0xcde6('0x16'),_0x283517['message'],_0x1822a7);_0x16e7be(_0x4caeed[_0xcde6('0x12')](0x1f4,_0x283517[_0xcde6('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 8ec73ad..ac4e3c9 100644 --- a/server/api/rpc/index.js +++ b/server/api/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','/outbound/channels','/agents/:id/capacity','agentCapacity','/telephones','telephones','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','post','queueNotify','mail','/mail/queues/:id','chat','/fax/queues/:id/notify','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','sms','whatsapp','/sms/queues/:id','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','voiceQueuesPreview','/voice/queues/channels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','voiceQueuesChannelHangup'];(function(_0xc7ed29,_0x515330){var _0xf8da19=function(_0x1bd99c){while(--_0x1bd99c){_0xc7ed29['push'](_0xc7ed29['shift']());}};_0xf8da19(++_0x515330);}(_0xe14b,0xc5));var _0xbe14=function(_0x153e52,_0x26b975){_0x153e52=_0x153e52-0x0;var _0x124eae=_0xe14b[_0x153e52];return _0x124eae;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require(_0xbe14('0x2'));var express=require('express');var router=express[_0xbe14('0x3')]();var auth=require(_0xbe14('0x4'));var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')](_0xbe14('0x7'),auth[_0xbe14('0x8')](),controller[_0xbe14('0x9')]);router['get'](_0xbe14('0xa'),auth[_0xbe14('0x8')](),controller['voiceChannelMixMonitor']);router['get'](_0xbe14('0xb'),auth[_0xbe14('0x8')](),controller[_0xbe14('0xc')]);router[_0xbe14('0x6')](_0xbe14('0xd'),auth[_0xbe14('0x8')](),controller[_0xbe14('0xe')]);router['get'](_0xbe14('0xf'),auth['isAuthenticated'](),controller[_0xbe14('0x10')]);router[_0xbe14('0x6')](_0xbe14('0x11'),auth[_0xbe14('0x8')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x6')](_0xbe14('0x13'),auth[_0xbe14('0x8')](),controller[_0xbe14('0x14')]);router[_0xbe14('0x6')](_0xbe14('0x15'),auth['isAuthenticated'](),controller[_0xbe14('0x16')]);router[_0xbe14('0x6')](_0xbe14('0x17'),auth[_0xbe14('0x8')](),controller[_0xbe14('0x18')]);router['get'](_0xbe14('0x19'),auth['isAuthenticated'](),controller[_0xbe14('0x1a')]);router['get'](_0xbe14('0x1b'),auth[_0xbe14('0x8')](),controller[_0xbe14('0x1c')]);router['get']('/voice/queues/preview/:id',auth[_0xbe14('0x8')](),controller[_0xbe14('0x1d')]);router[_0xbe14('0x6')](_0xbe14('0x1e'),auth[_0xbe14('0x8')](),controller['voiceQueuesChannels']);router[_0xbe14('0x6')](_0xbe14('0x1f'),auth[_0xbe14('0x8')](),controller[_0xbe14('0x20')]);router[_0xbe14('0x6')]('/voice/queues/channels/:uniqueid/hangup',auth[_0xbe14('0x8')](),controller[_0xbe14('0x21')]);router[_0xbe14('0x6')](_0xbe14('0x22'),auth[_0xbe14('0x8')](),controller[_0xbe14('0x23')]);router['get'](_0xbe14('0x24'),auth['isAuthenticated'](),controller[_0xbe14('0x25')]);router[_0xbe14('0x26')](_0xbe14('0x24'),auth[_0xbe14('0x8')](),controller[_0xbe14('0x27')]);router[_0xbe14('0x6')](_0xbe14('0x28'),auth[_0xbe14('0x8')](),controller['outbound']);router[_0xbe14('0x6')](_0xbe14('0x29'),auth[_0xbe14('0x8')](),controller['outboundChannels']);router[_0xbe14('0x6')]('/agents',auth[_0xbe14('0x8')](),controller['agents']);router[_0xbe14('0x26')](_0xbe14('0x2a'),auth[_0xbe14('0x8')](),controller[_0xbe14('0x2b')]);router['get'](_0xbe14('0x2c'),auth[_0xbe14('0x8')](),controller[_0xbe14('0x2d')]);router['get']('/trunks',auth[_0xbe14('0x8')](),controller[_0xbe14('0x2e')]);router['get'](_0xbe14('0x2f'),auth['isAuthenticated'](),controller[_0xbe14('0x30')]);router['get'](_0xbe14('0x31'),auth['isAuthenticated'](),controller[_0xbe14('0x32')]);router[_0xbe14('0x6')](_0xbe14('0x33'),auth[_0xbe14('0x8')](),controller[_0xbe14('0x34')]);router[_0xbe14('0x6')](_0xbe14('0x35'),auth[_0xbe14('0x8')](),controller['mailQueuesWaitingInteractions']);router['get'](_0xbe14('0x36'),auth[_0xbe14('0x8')](),controller[_0xbe14('0x37')]);router['get']('/openchannel/queues/:id/waitinginteractions',auth[_0xbe14('0x8')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0xbe14('0x6')]('/sms/queues/waitinginteractions',auth[_0xbe14('0x8')](),controller[_0xbe14('0x38')]);router[_0xbe14('0x6')](_0xbe14('0x39'),auth[_0xbe14('0x8')](),controller[_0xbe14('0x3a')]);router['get']('/fax/queues/waitinginteractions',auth[_0xbe14('0x8')](),controller['faxQueuesWaitingInteractions']);router[_0xbe14('0x3b')]('/mail/queues/:id/notify',auth[_0xbe14('0x8')](),controller[_0xbe14('0x3c')](_0xbe14('0x3d')));router['get'](_0xbe14('0x3e'),auth['isAuthenticated'](),controller['showMailQueues']);router[_0xbe14('0x3b')]('/chat/queues/:id/notify',auth['isAuthenticated'](),controller['queueNotify'](_0xbe14('0x3f')));router[_0xbe14('0x6')]('/chat/queues/:id',auth[_0xbe14('0x8')](),controller['showChatQueues']);router['post'](_0xbe14('0x40'),auth[_0xbe14('0x8')](),controller[_0xbe14('0x3c')]('fax'));router[_0xbe14('0x6')](_0xbe14('0x41'),auth[_0xbe14('0x8')](),controller[_0xbe14('0x42')]);router[_0xbe14('0x3b')](_0xbe14('0x43'),auth['isAuthenticated'](),controller[_0xbe14('0x3c')](_0xbe14('0x44')));router['get']('/openchannel/queues/:id',auth['isAuthenticated'](),controller['showOpenchannelQueues']);router[_0xbe14('0x3b')]('/sms/queues/:id/notify',auth['isAuthenticated'](),controller[_0xbe14('0x3c')](_0xbe14('0x45')));router[_0xbe14('0x3b')]('/whatsapp/queues/:id/notify',auth[_0xbe14('0x8')](),controller[_0xbe14('0x3c')](_0xbe14('0x46')));router['get'](_0xbe14('0x47'),auth['isAuthenticated'](),controller['showSmsQueues']);router['get'](_0xbe14('0x48'),auth['isAuthenticated'](),controller[_0xbe14('0x49')]);router['post'](_0xbe14('0x4a'),auth[_0xbe14('0x8')](),controller[_0xbe14('0x4b')]);module[_0xbe14('0x4c')]=router; \ No newline at end of file +var _0xc5c0=['/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','multer','util','path','../../components/auth/service','./rpc.controller','/voice/channels','isAuthenticated','voiceChannels','get','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','whatsappQueues','/voice/queues/preview/:id','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','put','/agents/:id/capacity','agentCapacity','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','showMailQueues','/chat/queues/:id/notify','chat'];(function(_0x255c30,_0x1d07d4){var _0x156154=function(_0x3c0a0c){while(--_0x3c0a0c){_0x255c30['push'](_0x255c30['shift']());}};_0x156154(++_0x1d07d4);}(_0xc5c0,0x6c));var _0x0c5c=function(_0xf1dc6e,_0x5f43ff){_0xf1dc6e=_0xf1dc6e-0x0;var _0x50c2ad=_0xc5c0[_0xf1dc6e];return _0x50c2ad;};'use strict';var multer=require(_0x0c5c('0x0'));var util=require(_0x0c5c('0x1'));var path=require(_0x0c5c('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x0c5c('0x3'));var controller=require(_0x0c5c('0x4'));router['get'](_0x0c5c('0x5'),auth[_0x0c5c('0x6')](),controller[_0x0c5c('0x7')]);router[_0x0c5c('0x8')](_0x0c5c('0x9'),auth[_0x0c5c('0x6')](),controller[_0x0c5c('0xa')]);router['get'](_0x0c5c('0xb'),auth[_0x0c5c('0x6')](),controller['voiceChannelStopMixMonitor']);router[_0x0c5c('0x8')](_0x0c5c('0xc'),auth[_0x0c5c('0x6')](),controller[_0x0c5c('0xd')]);router['get'](_0x0c5c('0xe'),auth[_0x0c5c('0x6')](),controller[_0x0c5c('0xf')]);router[_0x0c5c('0x8')](_0x0c5c('0x10'),auth['isAuthenticated'](),controller[_0x0c5c('0x11')]);router['get'](_0x0c5c('0x12'),auth[_0x0c5c('0x6')](),controller[_0x0c5c('0x13')]);router[_0x0c5c('0x8')](_0x0c5c('0x14'),auth[_0x0c5c('0x6')](),controller[_0x0c5c('0x15')]);router[_0x0c5c('0x8')](_0x0c5c('0x16'),auth[_0x0c5c('0x6')](),controller['smsQueues']);router[_0x0c5c('0x8')]('/whatsapp/queues',auth['isAuthenticated'](),controller[_0x0c5c('0x17')]);router[_0x0c5c('0x8')]('/fax/queues',auth[_0x0c5c('0x6')](),controller['faxQueues']);router[_0x0c5c('0x8')](_0x0c5c('0x18'),auth[_0x0c5c('0x6')](),controller['voiceQueuesPreview']);router[_0x0c5c('0x8')](_0x0c5c('0x19'),auth[_0x0c5c('0x6')](),controller[_0x0c5c('0x1a')]);router['get'](_0x0c5c('0x1b'),auth[_0x0c5c('0x6')](),controller[_0x0c5c('0x1c')]);router[_0x0c5c('0x8')](_0x0c5c('0x1d'),auth[_0x0c5c('0x6')](),controller[_0x0c5c('0x1e')]);router[_0x0c5c('0x8')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x0c5c('0x6')](),controller[_0x0c5c('0x1f')]);router[_0x0c5c('0x8')](_0x0c5c('0x20'),auth[_0x0c5c('0x6')](),controller[_0x0c5c('0x21')]);router['put'](_0x0c5c('0x20'),auth['isAuthenticated'](),controller[_0x0c5c('0x22')]);router[_0x0c5c('0x8')](_0x0c5c('0x23'),auth[_0x0c5c('0x6')](),controller[_0x0c5c('0x24')]);router['get'](_0x0c5c('0x25'),auth[_0x0c5c('0x6')](),controller[_0x0c5c('0x26')]);router[_0x0c5c('0x8')](_0x0c5c('0x27'),auth[_0x0c5c('0x6')](),controller[_0x0c5c('0x28')]);router[_0x0c5c('0x29')](_0x0c5c('0x2a'),auth[_0x0c5c('0x6')](),controller[_0x0c5c('0x2b')]);router[_0x0c5c('0x8')]('/telephones',auth['isAuthenticated'](),controller[_0x0c5c('0x2c')]);router[_0x0c5c('0x8')](_0x0c5c('0x2d'),auth[_0x0c5c('0x6')](),controller[_0x0c5c('0x2e')]);router[_0x0c5c('0x8')](_0x0c5c('0x2f'),auth[_0x0c5c('0x6')](),controller[_0x0c5c('0x30')]);router[_0x0c5c('0x8')](_0x0c5c('0x31'),auth[_0x0c5c('0x6')](),controller[_0x0c5c('0x32')]);router[_0x0c5c('0x8')](_0x0c5c('0x33'),auth[_0x0c5c('0x6')](),controller[_0x0c5c('0x34')]);router[_0x0c5c('0x8')](_0x0c5c('0x35'),auth['isAuthenticated'](),controller[_0x0c5c('0x36')]);router[_0x0c5c('0x8')](_0x0c5c('0x37'),auth['isAuthenticated'](),controller[_0x0c5c('0x38')]);router[_0x0c5c('0x8')](_0x0c5c('0x39'),auth['isAuthenticated'](),controller[_0x0c5c('0x3a')]);router['get'](_0x0c5c('0x3b'),auth['isAuthenticated'](),controller[_0x0c5c('0x3c')]);router[_0x0c5c('0x8')](_0x0c5c('0x3d'),auth[_0x0c5c('0x6')](),controller['whatsappQueuesWaitingInteractions']);router[_0x0c5c('0x8')]('/fax/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x0c5c('0x3e')]);router[_0x0c5c('0x3f')](_0x0c5c('0x40'),auth[_0x0c5c('0x6')](),controller[_0x0c5c('0x41')](_0x0c5c('0x42')));router[_0x0c5c('0x8')]('/mail/queues/:id',auth[_0x0c5c('0x6')](),controller[_0x0c5c('0x43')]);router[_0x0c5c('0x3f')](_0x0c5c('0x44'),auth['isAuthenticated'](),controller['queueNotify'](_0x0c5c('0x45')));router['get'](_0x0c5c('0x46'),auth[_0x0c5c('0x6')](),controller[_0x0c5c('0x47')]);router['post'](_0x0c5c('0x48'),auth[_0x0c5c('0x6')](),controller[_0x0c5c('0x41')](_0x0c5c('0x49')));router[_0x0c5c('0x8')](_0x0c5c('0x4a'),auth['isAuthenticated'](),controller[_0x0c5c('0x4b')]);router['post'](_0x0c5c('0x4c'),auth['isAuthenticated'](),controller['queueNotify'](_0x0c5c('0x4d')));router[_0x0c5c('0x8')](_0x0c5c('0x4e'),auth[_0x0c5c('0x6')](),controller[_0x0c5c('0x4f')]);router[_0x0c5c('0x3f')](_0x0c5c('0x50'),auth[_0x0c5c('0x6')](),controller[_0x0c5c('0x41')](_0x0c5c('0x51')));router[_0x0c5c('0x3f')](_0x0c5c('0x52'),auth[_0x0c5c('0x6')](),controller[_0x0c5c('0x41')](_0x0c5c('0x53')));router['get'](_0x0c5c('0x54'),auth['isAuthenticated'](),controller['showSmsQueues']);router[_0x0c5c('0x8')](_0x0c5c('0x55'),auth[_0x0c5c('0x6')](),controller[_0x0c5c('0x56')]);router['post'](_0x0c5c('0x57'),auth[_0x0c5c('0x6')](),controller[_0x0c5c('0x58')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 6555f70..25a84d3 100644 --- a/server/api/rpc/rpc.controller.js +++ b/server/api/rpc/rpc.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','FaxAccounts','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','map','queue_id','uniq','value','filter','indexOf','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found','update','MessageId','InteractionId','From','QueueId','TransferReport','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','capitalize','chat','agent','Message','create','Start','agentTransferTimeout','bluebird','moment','../../config/logger','api','jayson/promise','client','http','request','then','error','code','result','catch','status','json','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','params','VoiceChannelStopMixMonitor','merge','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','findAll','user','length','format','updateAttributes','MemberReport','findOrCreate','INTERACTION','interface','SIP/%s','internal','capacity','campaigns','showChatQueues','ChatQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues'];(function(_0x46dfea,_0x2c082c){var _0x612e75=function(_0x9c9188){while(--_0x9c9188){_0x46dfea['push'](_0x46dfea['shift']());}};_0x612e75(++_0x2c082c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var BPromise=require(_0x0d8b('0x0'));var moment=require(_0x0d8b('0x1'));var _=require('lodash');var util=require('util');var db=require('../../mysqldb')['db'];var logger=require(_0x0d8b('0x2'))(_0x0d8b('0x3'));var jayson=require(_0x0d8b('0x4'));var amiClient=jayson[_0x0d8b('0x5')][_0x0d8b('0x6')]({'port':0x232a});var mailClient=jayson['client']['http']({'port':0x232b});var routingClient=jayson[_0x0d8b('0x5')][_0x0d8b('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){var _0x129310=_0x413284?_0x413284:amiClient;return _0x129310[_0x0d8b('0x7')](_0x39f43a,_0x4a4470)[_0x0d8b('0x8')](function(_0x1f4800){if(_0x1f4800[_0x0d8b('0x9')]){if(_0x1f4800[_0x0d8b('0x9')][_0x0d8b('0xa')]===0x1f4){return _0x58e4e2(_0x1f4800[_0x0d8b('0x9')]['message']);}return _0x284169(_0x1f4800[_0x0d8b('0x9')]['message']);}else{_0x284169(_0x1f4800[_0x0d8b('0xb')]);}})[_0x0d8b('0xc')](function(_0x340cc4){_0x58e4e2(_0x340cc4);});});}function respondWithResult(_0x92cdd8,_0x35a07b){_0x35a07b=_0x35a07b||0xc8;return function(_0x32bb1a){if(_0x32bb1a){return _0x92cdd8[_0x0d8b('0xd')](_0x35a07b)[_0x0d8b('0xe')](_0x32bb1a);}return _0x92cdd8[_0x0d8b('0xf')](0x194);};}function handleError(_0x2ce75e,_0x5ad086){_0x5ad086=_0x5ad086||0x1f4;return function(_0xe65334){logger[_0x0d8b('0x9')](_0xe65334[_0x0d8b('0x10')]);if(_0xe65334['name']){delete _0xe65334[_0x0d8b('0x11')];}_0x2ce75e[_0x0d8b('0xd')](_0x5ad086)[_0x0d8b('0x12')](_0xe65334);};}function findById(_0xe2e167){return function(_0x2cb03c){if(!_['isNil'](_0xe2e167)&&!_[_0x0d8b('0x13')](_0x2cb03c)&&!_[_0x0d8b('0x13')](_0x2cb03c[_0x0d8b('0x14')])){return _[_0x0d8b('0x15')](_0x2cb03c[_0x0d8b('0x14')],function(_0x18dd2d){return _0x18dd2d['id']==_0xe2e167;});}return null;};}exports[_0x0d8b('0x16')]=function(_0xa3612a,_0x4a15bf){return respondWithRpcPromise(_0x0d8b('0x17'),_0xa3612a[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x4a15bf,null))[_0x0d8b('0xc')](handleError(_0x4a15bf,null));};exports[_0x0d8b('0x19')]=function(_0x5b709c,_0x393beb){return respondWithRpcPromise(_0x0d8b('0x1a'),_['merge'](_0x5b709c['query'],_0x5b709c[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x393beb,null))['catch'](handleError(_0x393beb,null));};exports['voiceChannelStopMixMonitor']=function(_0x238728,_0x2b924f){return respondWithRpcPromise(_0x0d8b('0x1c'),_[_0x0d8b('0x1d')](_0x238728[_0x0d8b('0x18')],_0x238728[_0x0d8b('0x1b')]))[_0x0d8b('0x8')](respondWithResult(_0x2b924f,null))[_0x0d8b('0xc')](handleError(_0x2b924f,null));};exports[_0x0d8b('0x1e')]=function(_0x5e5bc3,_0xe8bbee){return respondWithRpcPromise(_0x0d8b('0x1f'),_0x5e5bc3['query'])[_0x0d8b('0x8')](respondWithResult(_0xe8bbee,null))['catch'](handleError(_0xe8bbee,null));};exports[_0x0d8b('0x20')]=function(_0x234bdd,_0xa2af02){return respondWithRpcPromise('VoiceQueues',_0x234bdd['query'])[_0x0d8b('0x8')](findById(_0x234bdd[_0x0d8b('0x1b')]['id']))['then'](respondWithResult(_0xa2af02,null))[_0x0d8b('0xc')](handleError(_0xa2af02,null));};exports['updateVoiceQueue']=function(_0x1b2b59,_0x4b59e5){return respondWithRpcPromise(_0x0d8b('0x21'),_['merge'](_0x1b2b59[_0x0d8b('0x22')],_0x1b2b59['params']))[_0x0d8b('0x8')](respondWithResult(_0x4b59e5,null))['catch'](handleError(_0x4b59e5,null));};exports[_0x0d8b('0x23')]=function(_0x106e4c,_0x2c058d){return respondWithRpcPromise('VoiceQueuesPreview',_['merge'](_0x106e4c['query'],_0x106e4c[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x2c058d,null))[_0x0d8b('0xc')](handleError(_0x2c058d,null));};exports['voiceQueuesChannels']=function(_0x5d05fc,_0x36017a){return respondWithRpcPromise(_0x0d8b('0x24'),_0x5d05fc[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x36017a,null))[_0x0d8b('0xc')](handleError(_0x36017a,null));};exports[_0x0d8b('0x25')]=function(_0x4a99d3,_0x6f93c7){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x0d8b('0x1d')](_0x4a99d3[_0x0d8b('0x18')],_0x4a99d3['params']))[_0x0d8b('0x8')](respondWithResult(_0x6f93c7,null))[_0x0d8b('0xc')](handleError(_0x6f93c7,null));};exports[_0x0d8b('0x26')]=function(_0x4f2ed2,_0x113318){return respondWithRpcPromise(_0x0d8b('0x27'),_[_0x0d8b('0x1d')](_0x4f2ed2[_0x0d8b('0x18')],_0x4f2ed2[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x113318,null))[_0x0d8b('0xc')](handleError(_0x113318,null));};exports[_0x0d8b('0x28')]=function(_0x5ad0fe,_0x1180ac){return respondWithRpcPromise(_0x0d8b('0x29'),_[_0x0d8b('0x1d')](_0x5ad0fe[_0x0d8b('0x18')],_0x5ad0fe[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x1180ac,null))['catch'](handleError(_0x1180ac,null));};exports[_0x0d8b('0x2a')]=function(_0x5c2c04,_0x531c55){return respondWithRpcPromise(_0x0d8b('0x2b'),_0x5c2c04[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x531c55,null))[_0x0d8b('0xc')](handleError(_0x531c55,null));};exports[_0x0d8b('0x2c')]=function(_0x24c789,_0x579324){return respondWithRpcPromise(_0x0d8b('0x2d'),_0x24c789[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x579324,null))[_0x0d8b('0xc')](handleError(_0x579324,null));};exports[_0x0d8b('0x2e')]=function(_0x1a39ad,_0xf1680e){var _0x5c980b;return respondWithRpcPromise(_0x0d8b('0x2f'),_0x1a39ad[_0x0d8b('0x18')])[_0x0d8b('0x8')](function(_0x1f196d){_0x5c980b=_0x1f196d;return respondWithRpcPromise('Agents',_0x1a39ad[_0x0d8b('0x18')],routingClient);})['then'](function(_0x37b26c){return _[_0x0d8b('0x1d')]({},_0x37b26c,_0x5c980b);})[_0x0d8b('0x8')](respondWithResult(_0xf1680e,null))[_0x0d8b('0xc')](handleError(_0xf1680e,null));};exports[_0x0d8b('0x30')]=function(_0x3e632e,_0x1ff17d){if(_0x3e632e[_0x0d8b('0x22')]&&_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')]&&_0x3e632e['user']&&_0x3e632e['user']['name']){for(var _0x4d0811 in _0x3e632e['body'][_0x0d8b('0x31')]){if(_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')]['hasOwnProperty'](_0x4d0811)){db['MemberReport'][_0x0d8b('0x32')]({'where':{'channel':_0x4d0811,'membername':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')][_0x4d0811]&&_0x3e632e['body']['interaction'][_0x4d0811][_0x0d8b('0x34')]?{'$notIn':_0x3e632e['body'][_0x0d8b('0x31')][_0x4d0811]}:{'$ne':null}}})['then'](function(_0x53f643){var _0x30ccee=moment()[_0x0d8b('0x35')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x5ebe8a=0x0,_0x59b8e9=_0x53f643['length'];_0x5ebe8a<_0x59b8e9;_0x5ebe8a+=0x1){_0x53f643[_0x5ebe8a][_0x0d8b('0x36')]({'exitAt':_0x30ccee});}});for(var _0x1e0498=0x0;_0x1e0498<_0x3e632e[_0x0d8b('0x22')]['interaction'][_0x4d0811][_0x0d8b('0x34')];_0x1e0498+=0x1){db[_0x0d8b('0x37')][_0x0d8b('0x38')]({'where':{'channel':_0x4d0811,'membername':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')],'type':_0x0d8b('0x39'),'uniqueid':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')][_0x4d0811][_0x1e0498],'exitAt':null},'defaults':{'channel':_0x4d0811,'membername':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')],'interface':_[_0x0d8b('0x13')](_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x3a')])?util[_0x0d8b('0x35')](_0x0d8b('0x3b'),_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')]):_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x3a')],'type':'INTERACTION','enterAt':moment()[_0x0d8b('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'role':'agent','internal':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x3c')],'uniqueid':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')][_0x4d0811][_0x1e0498]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x3e632e[_0x0d8b('0x1b')]['id'],'capacity':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x3d')]},routingClient)[_0x0d8b('0x8')](respondWithResult(_0x1ff17d,null))[_0x0d8b('0xc')](handleError(_0x1ff17d,null));};exports['telephones']=function(_0x5c0824,_0x4e4d5f){return respondWithRpcPromise('Telephones',_0x5c0824[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x4e4d5f,null))['catch'](handleError(_0x4e4d5f,null));};exports['trunks']=function(_0x44c5c1,_0x3d3cb6){return respondWithRpcPromise('Trunks',_0x44c5c1['query'])[_0x0d8b('0x8')](respondWithResult(_0x3d3cb6,null))[_0x0d8b('0xc')](handleError(_0x3d3cb6,null));};exports[_0x0d8b('0x3e')]=function(_0x346c0d,_0x2d5519){return respondWithRpcPromise('Campaigns',_0x346c0d[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x2d5519,null))['catch'](handleError(_0x2d5519,null));};exports['chatQueues']=function(_0xf6a773,_0x3f2d95){return respondWithRpcPromise('ChatQueues',_0xf6a773['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3f2d95,null))[_0x0d8b('0xc')](handleError(_0x3f2d95,null));};exports[_0x0d8b('0x3f')]=function(_0xb58818,_0x4a2989){return respondWithRpcPromise(_0x0d8b('0x40'),_0xb58818['query'],routingClient)['then'](findById(_0xb58818[_0x0d8b('0x1b')]['id']))[_0x0d8b('0x8')](respondWithResult(_0x4a2989,null))['catch'](handleError(_0x4a2989,null));};exports['mailQueues']=function(_0x44ed23,_0x3d7161){return respondWithRpcPromise(_0x0d8b('0x41'),_0x44ed23[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3d7161,null))[_0x0d8b('0xc')](handleError(_0x3d7161,null));};exports[_0x0d8b('0x42')]=function(_0x3bead7,_0x5418d8){return respondWithRpcPromise(_0x0d8b('0x41'),_0x3bead7[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x3bead7[_0x0d8b('0x1b')]['id']))[_0x0d8b('0x8')](respondWithResult(_0x5418d8,null))[_0x0d8b('0xc')](handleError(_0x5418d8,null));};exports[_0x0d8b('0x43')]=function(_0x1c78b6,_0x375684){return respondWithRpcPromise('MailAccounts',_0x1c78b6[_0x0d8b('0x18')],mailClient)[_0x0d8b('0x8')](respondWithResult(_0x375684,null))[_0x0d8b('0xc')](handleError(_0x375684,null));};exports[_0x0d8b('0x44')]=function(_0x43ad22,_0x577951){return respondWithRpcPromise(_0x0d8b('0x45'),_0x43ad22[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x577951,null))[_0x0d8b('0xc')](handleError(_0x577951,null));};exports[_0x0d8b('0x46')]=function(_0x59ada2,_0x4d0e7c){return respondWithRpcPromise(_0x0d8b('0x45'),_0x59ada2[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x59ada2[_0x0d8b('0x1b')]['id']))['then'](respondWithResult(_0x4d0e7c,null))[_0x0d8b('0xc')](handleError(_0x4d0e7c,null));};exports[_0x0d8b('0x47')]=function(_0x8c0bbe,_0x5952dd){return respondWithRpcPromise(_0x0d8b('0x48'),_0x8c0bbe['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x5952dd,null))[_0x0d8b('0xc')](handleError(_0x5952dd,null));};exports[_0x0d8b('0x49')]=function(_0x26ccf0,_0x2b6eb6){return respondWithRpcPromise(_0x0d8b('0x48'),_0x26ccf0['query'],routingClient)[_0x0d8b('0x8')](findById(_0x26ccf0['params']['id']))[_0x0d8b('0x8')](respondWithResult(_0x2b6eb6,null))[_0x0d8b('0xc')](handleError(_0x2b6eb6,null));};exports[_0x0d8b('0x4a')]=function(_0x33a614,_0x48025e){return respondWithRpcPromise(_0x0d8b('0x4b'),_0x33a614[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x48025e,null))[_0x0d8b('0xc')](handleError(_0x48025e,null));};exports[_0x0d8b('0x4c')]=function(_0x273aef,_0x223fd8){return respondWithRpcPromise(_0x0d8b('0x4b'),_0x273aef[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x273aef['params']['id']))['then'](respondWithResult(_0x223fd8,null))[_0x0d8b('0xc')](handleError(_0x223fd8,null));};exports[_0x0d8b('0x4d')]=function(_0x53e399,_0xb1aa96){return respondWithRpcPromise('FaxQueues',_0x53e399['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0xb1aa96,null))[_0x0d8b('0xc')](handleError(_0xb1aa96,null));};exports['showFaxQueues']=function(_0x587128,_0x1900e3){return respondWithRpcPromise(_0x0d8b('0x4e'),_0x587128[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x587128[_0x0d8b('0x1b')]['id']))[_0x0d8b('0x8')](respondWithResult(_0x1900e3,null))[_0x0d8b('0xc')](handleError(_0x1900e3,null));};exports['faxAccounts']=function(_0x1ca60c,_0x5878c2){return respondWithRpcPromise(_0x0d8b('0x4f'),_0x1ca60c[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x5878c2,null))[_0x0d8b('0xc')](handleError(_0x5878c2,null));};exports['chatQueuesWaitingInteractions']=function(_0x3fe47d,_0x4a1c4a){return respondWithRpcPromise(_0x0d8b('0x50'),_0x3fe47d[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x4a1c4a,null))[_0x0d8b('0xc')](handleError(_0x4a1c4a,null));};exports[_0x0d8b('0x51')]=function(_0x2b44e5,_0x3e927c){return respondWithRpcPromise(_0x0d8b('0x52'),_0x2b44e5[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3e927c,null))['catch'](handleError(_0x3e927c,null));};exports[_0x0d8b('0x53')]=function(_0x54c28b,_0x3e4121){return respondWithRpcPromise(_0x0d8b('0x54'),_0x54c28b['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3e4121,null))['catch'](handleError(_0x3e4121,null));};exports[_0x0d8b('0x55')]=function(_0x445a00,_0x24f75){return respondWithRpcPromise(_0x0d8b('0x54'),_0x445a00[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](function(_0x3a073b){if(_0x445a00[_0x0d8b('0x18')]['type']!==undefined){var _0x10eca6=_(_0x3a073b[_0x0d8b('0x14')])['filter']([_0x445a00[_0x0d8b('0x18')][_0x0d8b('0x56')],_0x445a00[_0x0d8b('0x1b')]['id']])[_0x0d8b('0x57')](_0x0d8b('0x58'))[_0x0d8b('0x59')]()[_0x0d8b('0x5a')]();return _0x3a073b[_0x0d8b('0x14')][_0x0d8b('0x5b')](function(_0x5007c0){return _0x10eca6[_0x0d8b('0x5c')](_0x5007c0[_0x0d8b('0x58')])>-0x1;});}else{return _0x3a073b['rows'][_0x0d8b('0x5b')](function(_0x93fc55){return _0x93fc55[_0x0d8b('0x58')]===parseInt(_0x445a00['params']['id']);});}})['then'](respondWithResult(_0x24f75,null))[_0x0d8b('0xc')](handleError(_0x24f75,null));};exports[_0x0d8b('0x5d')]=function(_0x2c55bc,_0x5b76af){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x2c55bc[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x5b76af,null))[_0x0d8b('0xc')](handleError(_0x5b76af,null));};exports[_0x0d8b('0x5e')]=function(_0x2a2b58,_0x3f7895){return respondWithRpcPromise(_0x0d8b('0x5f'),_0x2a2b58[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3f7895,null))[_0x0d8b('0xc')](handleError(_0x3f7895,null));};exports[_0x0d8b('0x60')]=function(_0x291336,_0x3b060e){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x291336[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3b060e,null))['catch'](handleError(_0x3b060e,null));};exports['queueNotify']=function(_0x1a1029){return function(_0x1dad9f,_0x3573b4){var _0x14b1b8,_0x23e2e0;var _0x354208=_['capitalize'](_0x1a1029);var _0x502715=_0x1a1029==='chat'?_0x0d8b('0x61'):_0x0d8b('0x62');return db[_0x354208+_0x0d8b('0x63')][_0x0d8b('0x64')]({'raw':!![],'where':{'id':_0x1dad9f[_0x0d8b('0x1b')]['id']}})[_0x0d8b('0x8')](function(_0x5ef461){if(_[_0x0d8b('0x13')](_0x5ef461)){throw new Error(_0x354208+_0x0d8b('0x65'));}_0x14b1b8=_0x5ef461;return db[_0x354208+'Message'][_0x0d8b('0x64')]({'where':{'id':_0x1dad9f['body'][_0x0d8b('0x66')]},'include':[{'model':db[_0x354208+_0x0d8b('0x67')],'as':_0x0d8b('0x67')},{'model':db[_0x354208+_0x502715],'as':_0x0d8b('0x62')}]});})[_0x0d8b('0x8')](function(_0x8fae7f){if(_[_0x0d8b('0x13')](_0x8fae7f)){throw new Error(_0x354208+_0x0d8b('0x68'));}_0x23e2e0=_0x8fae7f;return _0x8fae7f[_0x0d8b('0x69')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0d8b('0x8')](function(){var _0x276558={'uniqueid':_0x1a1029+'.'+_0x23e2e0['id']+'.'+_0x23e2e0[_0x0d8b('0x67')]['id'],'FromUserId':_0x1dad9f['user']['id'],'type':'queue'};_0x276558[_0x354208+_0x0d8b('0x6a')]=_0x23e2e0['id'];_0x276558[_0x354208+_0x0d8b('0x6b')]=_0x23e2e0[_0x0d8b('0x67')]['id'];_0x276558[_0x0d8b('0x6c')+_0x354208+_0x502715+'Id']=_0x23e2e0[_0x0d8b('0x62')]['id'];_0x276558['To'+_0x354208+_0x0d8b('0x6d')]=_0x14b1b8['id'];return db[_0x354208+_0x0d8b('0x6e')]['create'](_0x276558);})[_0x0d8b('0x8')](function(){return respondWithRpcPromise('Start',{'channel':_0x1a1029,'interaction':_0x23e2e0[_0x0d8b('0x67')],'message':_0x23e2e0,'account':_0x23e2e0['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x14b1b8[_0x0d8b('0x11')]+','+(_0x23e2e0[_0x0d8b('0x62')][_0x0d8b('0x6f')]||0x12c),'interval':_0x0d8b('0x70')}],'transfer':!![]},routingClient);})[_0x0d8b('0x8')](respondWithResult(_0x3573b4,null))[_0x0d8b('0xc')](handleError(_0x3573b4,null));};};exports[_0x0d8b('0x71')]=function(_0x180eda,_0x35267a){var _0x20a8b6,_0x3a6014;if(_[_0x0d8b('0x13')](_0x180eda['body'][_0x0d8b('0x72')])){throw new Error(_0x0d8b('0x73'));}var _0x8be77c=_0x180eda['body']['channel'];var _0x2db144=_[_0x0d8b('0x74')](_0x8be77c);var _0x36d6ca=_0x8be77c===_0x0d8b('0x75')?_0x0d8b('0x61'):_0x0d8b('0x62');return db['User'][_0x0d8b('0x64')]({'raw':!![],'where':{'id':_0x180eda[_0x0d8b('0x1b')]['id'],'role':_0x0d8b('0x76')}})[_0x0d8b('0x8')](function(_0x4350ee){if(_['isNil'](_0x4350ee)){throw new Error('Agent\x20not\x20found');}_0x20a8b6=_0x4350ee;return db[_0x2db144+_0x0d8b('0x77')][_0x0d8b('0x64')]({'where':{'id':_0x180eda[_0x0d8b('0x22')]['messageId']},'include':[{'model':db[_0x2db144+_0x0d8b('0x67')],'as':_0x0d8b('0x67')},{'model':db[_0x2db144+_0x36d6ca],'as':_0x0d8b('0x62')}]});})['then'](function(_0xb61d4b){if(_[_0x0d8b('0x13')](_0xb61d4b)){throw new Error(_0x2db144+_0x0d8b('0x68'));}_0x3a6014=_0xb61d4b;return _0xb61d4b[_0x0d8b('0x69')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0d8b('0x8')](function(){var _0x150e9f={'uniqueid':_0x8be77c+'.'+_0x3a6014['id']+'.'+_0x3a6014[_0x0d8b('0x67')]['id'],'FromUserId':_0x180eda[_0x0d8b('0x33')]['id'],'type':_0x0d8b('0x76'),'ToUserId':_0x20a8b6['id']};_0x150e9f[_0x2db144+'MessageId']=_0x3a6014['id'];_0x150e9f[_0x2db144+_0x0d8b('0x6b')]=_0x3a6014[_0x0d8b('0x67')]['id'];_0x150e9f[_0x0d8b('0x6c')+_0x2db144+_0x36d6ca+'Id']=_0x3a6014[_0x0d8b('0x62')]['id'];return db[_0x2db144+_0x0d8b('0x6e')][_0x0d8b('0x78')](_0x150e9f);})[_0x0d8b('0x8')](function(){return respondWithRpcPromise(_0x0d8b('0x79'),{'channel':_0x8be77c,'interaction':_0x3a6014[_0x0d8b('0x67')],'message':_0x3a6014,'account':_0x3a6014['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x20a8b6[_0x0d8b('0x11')]+','+(_0x3a6014[_0x0d8b('0x62')][_0x0d8b('0x7a')]||0x12c),'interval':_0x0d8b('0x70')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x35267a,null))[_0x0d8b('0xc')](handleError(_0x35267a,null));}; \ No newline at end of file +var _0xe706=['indexOf','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','Website','Queue','\x20Queue\x20not\x20found','Message','findOne','Interaction','Account','update','queue','MessageId','InteractionId','TransferReport','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','chat','User','Agent\x20not\x20found','messageId','\x20Message\x20not\x20found','From','create','Start','agentTransferTimeout','bluebird','moment','lodash','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','result','catch','status','json','name','send','isNil','rows','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','user','hasOwnProperty','MemberReport','findAll','INTERACTION','interaction','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','SIP/%s','interface','agent','internal','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','OpenchannelQueues','showOpenchannelQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','faxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','uniq'];(function(_0xfc24e,_0x1d1196){var _0xabb3e4=function(_0x4c932c){while(--_0x4c932c){_0xfc24e['push'](_0xfc24e['shift']());}};_0xabb3e4(++_0x1d1196);}(_0xe706,0xa3));var _0x6e70=function(_0x38e47a,_0xc032eb){_0x38e47a=_0x38e47a-0x0;var _0x1b0649=_0xe706[_0x38e47a];return _0x1b0649;};'use strict';var BPromise=require(_0x6e70('0x0'));var moment=require(_0x6e70('0x1'));var _=require(_0x6e70('0x2'));var util=require('util');var db=require(_0x6e70('0x3'))['db'];var logger=require(_0x6e70('0x4'))(_0x6e70('0x5'));var jayson=require(_0x6e70('0x6'));var amiClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232a});var mailClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232b});var routingClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){var _0x449b48=_0x45a2d4?_0x45a2d4:amiClient;return _0x449b48[_0x6e70('0x9')](_0x36357b,_0x293ce7)[_0x6e70('0xa')](function(_0x100eb7){if(_0x100eb7[_0x6e70('0xb')]){if(_0x100eb7[_0x6e70('0xb')][_0x6e70('0xc')]===0x1f4){return _0x3c4843(_0x100eb7[_0x6e70('0xb')][_0x6e70('0xd')]);}return _0x188ed3(_0x100eb7['error']['message']);}else{_0x188ed3(_0x100eb7[_0x6e70('0xe')]);}})[_0x6e70('0xf')](function(_0x18cf27){_0x3c4843(_0x18cf27);});});}function respondWithResult(_0x27dd9b,_0x3b38f3){_0x3b38f3=_0x3b38f3||0xc8;return function(_0x310eb7){if(_0x310eb7){return _0x27dd9b[_0x6e70('0x10')](_0x3b38f3)[_0x6e70('0x11')](_0x310eb7);}return _0x27dd9b['sendStatus'](0x194);};}function handleError(_0x52737e,_0x48bc72){_0x48bc72=_0x48bc72||0x1f4;return function(_0x257e81){logger['error'](_0x257e81['stack']);if(_0x257e81[_0x6e70('0x12')]){delete _0x257e81[_0x6e70('0x12')];}_0x52737e['status'](_0x48bc72)[_0x6e70('0x13')](_0x257e81);};}function findById(_0x5c3fe7){return function(_0x2efc0f){if(!_[_0x6e70('0x14')](_0x5c3fe7)&&!_['isNil'](_0x2efc0f)&&!_['isNil'](_0x2efc0f[_0x6e70('0x15')])){return _['find'](_0x2efc0f[_0x6e70('0x15')],function(_0x173afe){return _0x173afe['id']==_0x5c3fe7;});}return null;};}exports['voiceChannels']=function(_0x497d61,_0xc238ba){return respondWithRpcPromise(_0x6e70('0x16'),_0x497d61[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0xc238ba,null))[_0x6e70('0xf')](handleError(_0xc238ba,null));};exports[_0x6e70('0x18')]=function(_0x1b2453,_0x44a49f){return respondWithRpcPromise(_0x6e70('0x19'),_[_0x6e70('0x1a')](_0x1b2453['query'],_0x1b2453[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x44a49f,null))[_0x6e70('0xf')](handleError(_0x44a49f,null));};exports['voiceChannelStopMixMonitor']=function(_0x3ccd87,_0xa5d49){return respondWithRpcPromise(_0x6e70('0x1c'),_['merge'](_0x3ccd87[_0x6e70('0x17')],_0x3ccd87['params']))['then'](respondWithResult(_0xa5d49,null))['catch'](handleError(_0xa5d49,null));};exports[_0x6e70('0x1d')]=function(_0x19c5ae,_0x51d292){return respondWithRpcPromise(_0x6e70('0x1e'),_0x19c5ae[_0x6e70('0x17')])['then'](respondWithResult(_0x51d292,null))[_0x6e70('0xf')](handleError(_0x51d292,null));};exports[_0x6e70('0x1f')]=function(_0x2bb231,_0x4a67ac){return respondWithRpcPromise('VoiceQueues',_0x2bb231[_0x6e70('0x17')])[_0x6e70('0xa')](findById(_0x2bb231[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x4a67ac,null))[_0x6e70('0xf')](handleError(_0x4a67ac,null));};exports['updateVoiceQueue']=function(_0x1952ea,_0x406f29){return respondWithRpcPromise(_0x6e70('0x20'),_[_0x6e70('0x1a')](_0x1952ea[_0x6e70('0x21')],_0x1952ea[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x406f29,null))[_0x6e70('0xf')](handleError(_0x406f29,null));};exports[_0x6e70('0x22')]=function(_0x3a5d30,_0x4b1229){return respondWithRpcPromise(_0x6e70('0x23'),_['merge'](_0x3a5d30[_0x6e70('0x17')],_0x3a5d30['params']))[_0x6e70('0xa')](respondWithResult(_0x4b1229,null))[_0x6e70('0xf')](handleError(_0x4b1229,null));};exports[_0x6e70('0x24')]=function(_0x56f6f7,_0x38c40d){return respondWithRpcPromise(_0x6e70('0x25'),_0x56f6f7['query'])[_0x6e70('0xa')](respondWithResult(_0x38c40d,null))[_0x6e70('0xf')](handleError(_0x38c40d,null));};exports['voiceQueuesChannel']=function(_0x10d8f6,_0x3665a1){return respondWithRpcPromise(_0x6e70('0x26'),_[_0x6e70('0x1a')](_0x10d8f6[_0x6e70('0x17')],_0x10d8f6[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x3665a1,null))[_0x6e70('0xf')](handleError(_0x3665a1,null));};exports[_0x6e70('0x27')]=function(_0x419a41,_0x4d32d8){return respondWithRpcPromise(_0x6e70('0x28'),_['merge'](_0x419a41[_0x6e70('0x17')],_0x419a41[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x4d32d8,null))[_0x6e70('0xf')](handleError(_0x4d32d8,null));};exports[_0x6e70('0x29')]=function(_0x989b80,_0x2440be){return respondWithRpcPromise(_0x6e70('0x2a'),_[_0x6e70('0x1a')](_0x989b80[_0x6e70('0x17')],_0x989b80[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x2440be,null))[_0x6e70('0xf')](handleError(_0x2440be,null));};exports['outbound']=function(_0x5446a2,_0x5424eb){return respondWithRpcPromise(_0x6e70('0x2b'),_0x5446a2[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x5424eb,null))[_0x6e70('0xf')](handleError(_0x5424eb,null));};exports[_0x6e70('0x2c')]=function(_0x3bdd87,_0x572a71){return respondWithRpcPromise(_0x6e70('0x2d'),_0x3bdd87[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x572a71,null))[_0x6e70('0xf')](handleError(_0x572a71,null));};exports[_0x6e70('0x2e')]=function(_0x37bf46,_0x246e61){var _0x16fc7d;return respondWithRpcPromise('Agents',_0x37bf46[_0x6e70('0x17')])[_0x6e70('0xa')](function(_0x22fce9){_0x16fc7d=_0x22fce9;return respondWithRpcPromise(_0x6e70('0x2f'),_0x37bf46[_0x6e70('0x17')],routingClient);})[_0x6e70('0xa')](function(_0x21b0e7){return _['merge']({},_0x21b0e7,_0x16fc7d);})['then'](respondWithResult(_0x246e61,null))['catch'](handleError(_0x246e61,null));};exports[_0x6e70('0x30')]=function(_0x2b63cc,_0x83847b){if(_0x2b63cc[_0x6e70('0x21')]&&_0x2b63cc[_0x6e70('0x21')]['interaction']&&_0x2b63cc[_0x6e70('0x31')]&&_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x12')]){for(var _0x52b197 in _0x2b63cc['body']['interaction']){if(_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x6e70('0x32')](_0x52b197)){db[_0x6e70('0x33')][_0x6e70('0x34')]({'where':{'channel':_0x52b197,'membername':_0x2b63cc[_0x6e70('0x31')]['name'],'type':_0x6e70('0x35'),'exitAt':null,'uniqueid':_0x2b63cc['body'][_0x6e70('0x36')][_0x52b197]&&_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x36')][_0x52b197][_0x6e70('0x37')]?{'$notIn':_0x2b63cc['body'][_0x6e70('0x36')][_0x52b197]}:{'$ne':null}}})[_0x6e70('0xa')](function(_0x3d39c3){var _0xac87d6=moment()[_0x6e70('0x38')](_0x6e70('0x39'));for(var _0x3d9c5=0x0,_0x552e7e=_0x3d39c3[_0x6e70('0x37')];_0x3d9c5<_0x552e7e;_0x3d9c5+=0x1){_0x3d39c3[_0x3d9c5][_0x6e70('0x3a')]({'exitAt':_0xac87d6});}});for(var _0x10de2a=0x0;_0x10de2a<_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x36')][_0x52b197][_0x6e70('0x37')];_0x10de2a+=0x1){db[_0x6e70('0x33')]['findOrCreate']({'where':{'channel':_0x52b197,'membername':_0x2b63cc[_0x6e70('0x31')]['name'],'type':_0x6e70('0x35'),'uniqueid':_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x52b197][_0x10de2a],'exitAt':null},'defaults':{'channel':_0x52b197,'membername':_0x2b63cc['user'][_0x6e70('0x12')],'interface':_[_0x6e70('0x14')](_0x2b63cc[_0x6e70('0x31')]['interface'])?util['format'](_0x6e70('0x3b'),_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x12')]):_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x3c')],'type':_0x6e70('0x35'),'enterAt':moment()['format'](_0x6e70('0x39')),'role':_0x6e70('0x3d'),'internal':_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x3e')],'uniqueid':_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x52b197][_0x10de2a]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x2b63cc[_0x6e70('0x1b')]['id'],'capacity':_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x3f')]},routingClient)[_0x6e70('0xa')](respondWithResult(_0x83847b,null))[_0x6e70('0xf')](handleError(_0x83847b,null));};exports['telephones']=function(_0x41bd0b,_0x232366){return respondWithRpcPromise(_0x6e70('0x40'),_0x41bd0b[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x232366,null))['catch'](handleError(_0x232366,null));};exports[_0x6e70('0x41')]=function(_0x1dd242,_0x2c20d3){return respondWithRpcPromise(_0x6e70('0x42'),_0x1dd242[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x2c20d3,null))['catch'](handleError(_0x2c20d3,null));};exports[_0x6e70('0x43')]=function(_0x8d425d,_0x5c2396){return respondWithRpcPromise(_0x6e70('0x44'),_0x8d425d[_0x6e70('0x17')])['then'](respondWithResult(_0x5c2396,null))[_0x6e70('0xf')](handleError(_0x5c2396,null));};exports[_0x6e70('0x45')]=function(_0x2134c4,_0x46d536){return respondWithRpcPromise(_0x6e70('0x46'),_0x2134c4['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x46d536,null))[_0x6e70('0xf')](handleError(_0x46d536,null));};exports[_0x6e70('0x47')]=function(_0x13be81,_0x1c02d7){return respondWithRpcPromise(_0x6e70('0x46'),_0x13be81[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x13be81[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x1c02d7,null))[_0x6e70('0xf')](handleError(_0x1c02d7,null));};exports[_0x6e70('0x48')]=function(_0xb8f78,_0x1fd9a6){return respondWithRpcPromise(_0x6e70('0x49'),_0xb8f78[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x1fd9a6,null))[_0x6e70('0xf')](handleError(_0x1fd9a6,null));};exports[_0x6e70('0x4a')]=function(_0x1c7dca,_0x4c6aab){return respondWithRpcPromise(_0x6e70('0x49'),_0x1c7dca[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x1c7dca[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x4c6aab,null))[_0x6e70('0xf')](handleError(_0x4c6aab,null));};exports['mailAccounts']=function(_0x42bd85,_0x6cabf0){return respondWithRpcPromise('MailAccounts',_0x42bd85[_0x6e70('0x17')],mailClient)[_0x6e70('0xa')](respondWithResult(_0x6cabf0,null))[_0x6e70('0xf')](handleError(_0x6cabf0,null));};exports['openchannelQueues']=function(_0x51f268,_0x2f9be4){return respondWithRpcPromise(_0x6e70('0x4b'),_0x51f268[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x2f9be4,null))[_0x6e70('0xf')](handleError(_0x2f9be4,null));};exports[_0x6e70('0x4c')]=function(_0x30cd88,_0x57bfe5){return respondWithRpcPromise('OpenchannelQueues',_0x30cd88[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x30cd88[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x57bfe5,null))['catch'](handleError(_0x57bfe5,null));};exports['smsQueues']=function(_0x2e972b,_0x4e5545){return respondWithRpcPromise('SmsQueues',_0x2e972b['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x4e5545,null))['catch'](handleError(_0x4e5545,null));};exports[_0x6e70('0x4d')]=function(_0x23900b,_0x3b4da0){return respondWithRpcPromise(_0x6e70('0x4e'),_0x23900b[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x23900b[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x3b4da0,null))['catch'](handleError(_0x3b4da0,null));};exports[_0x6e70('0x4f')]=function(_0x6a560f,_0x22c836){return respondWithRpcPromise(_0x6e70('0x50'),_0x6a560f[_0x6e70('0x17')],routingClient)['then'](respondWithResult(_0x22c836,null))['catch'](handleError(_0x22c836,null));};exports['showWhatsappQueues']=function(_0x1bb338,_0xd91b9){return respondWithRpcPromise(_0x6e70('0x50'),_0x1bb338['query'],routingClient)['then'](findById(_0x1bb338[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0xd91b9,null))[_0x6e70('0xf')](handleError(_0xd91b9,null));};exports[_0x6e70('0x51')]=function(_0x2285f1,_0x32b884){return respondWithRpcPromise('FaxQueues',_0x2285f1[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x32b884,null))[_0x6e70('0xf')](handleError(_0x32b884,null));};exports[_0x6e70('0x52')]=function(_0x515c0c,_0xce964b){return respondWithRpcPromise('FaxQueues',_0x515c0c['query'],routingClient)[_0x6e70('0xa')](findById(_0x515c0c[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0xce964b,null))[_0x6e70('0xf')](handleError(_0xce964b,null));};exports[_0x6e70('0x53')]=function(_0x2be0fc,_0x4b5b19){return respondWithRpcPromise(_0x6e70('0x54'),_0x2be0fc[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x4b5b19,null))[_0x6e70('0xf')](handleError(_0x4b5b19,null));};exports[_0x6e70('0x55')]=function(_0x13c092,_0x363722){return respondWithRpcPromise(_0x6e70('0x56'),_0x13c092[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x363722,null))['catch'](handleError(_0x363722,null));};exports[_0x6e70('0x57')]=function(_0x303c5a,_0x577c3b){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x303c5a['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x577c3b,null))[_0x6e70('0xf')](handleError(_0x577c3b,null));};exports[_0x6e70('0x58')]=function(_0x14bb74,_0x5a3dcb){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x14bb74['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x5a3dcb,null))[_0x6e70('0xf')](handleError(_0x5a3dcb,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x58666a,_0x1c7c5f){return respondWithRpcPromise(_0x6e70('0x59'),_0x58666a[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](function(_0x44bf96){if(_0x58666a[_0x6e70('0x17')][_0x6e70('0x5a')]!==undefined){var _0x3650e9=_(_0x44bf96[_0x6e70('0x15')])[_0x6e70('0x5b')]([_0x58666a[_0x6e70('0x17')][_0x6e70('0x5a')],_0x58666a[_0x6e70('0x1b')]['id']])['map']('queue_id')[_0x6e70('0x5c')]()['value']();return _0x44bf96[_0x6e70('0x15')]['filter'](function(_0x5b5471){return _0x3650e9[_0x6e70('0x5d')](_0x5b5471['queue_id'])>-0x1;});}else{return _0x44bf96['rows'][_0x6e70('0x5b')](function(_0x21e4c2){return _0x21e4c2[_0x6e70('0x5e')]===parseInt(_0x58666a['params']['id']);});}})['then'](respondWithResult(_0x1c7c5f,null))['catch'](handleError(_0x1c7c5f,null));};exports[_0x6e70('0x5f')]=function(_0x512b0a,_0x2e8ed3){return respondWithRpcPromise(_0x6e70('0x60'),_0x512b0a[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x2e8ed3,null))[_0x6e70('0xf')](handleError(_0x2e8ed3,null));};exports[_0x6e70('0x61')]=function(_0x214a8f,_0x50046a){return respondWithRpcPromise(_0x6e70('0x62'),_0x214a8f[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x50046a,null))['catch'](handleError(_0x50046a,null));};exports[_0x6e70('0x63')]=function(_0x227d94,_0x11a615){return respondWithRpcPromise(_0x6e70('0x64'),_0x227d94[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x11a615,null))[_0x6e70('0xf')](handleError(_0x11a615,null));};exports[_0x6e70('0x65')]=function(_0x461ec0){return function(_0x48f6fd,_0x463eed){var _0x39e6db,_0x53acc8;var _0x252f07=_[_0x6e70('0x66')](_0x461ec0);var _0x51be27=_0x461ec0==='chat'?_0x6e70('0x67'):'Account';return db[_0x252f07+_0x6e70('0x68')]['findOne']({'raw':!![],'where':{'id':_0x48f6fd[_0x6e70('0x1b')]['id']}})[_0x6e70('0xa')](function(_0x106f32){if(_[_0x6e70('0x14')](_0x106f32)){throw new Error(_0x252f07+_0x6e70('0x69'));}_0x39e6db=_0x106f32;return db[_0x252f07+_0x6e70('0x6a')][_0x6e70('0x6b')]({'where':{'id':_0x48f6fd['body']['messageId']},'include':[{'model':db[_0x252f07+_0x6e70('0x6c')],'as':'Interaction'},{'model':db[_0x252f07+_0x51be27],'as':_0x6e70('0x6d')}]});})[_0x6e70('0xa')](function(_0x28e5b1){if(_[_0x6e70('0x14')](_0x28e5b1)){throw new Error(_0x252f07+'\x20Message\x20not\x20found');}_0x53acc8=_0x28e5b1;return _0x28e5b1[_0x6e70('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x260dfa={'uniqueid':_0x461ec0+'.'+_0x53acc8['id']+'.'+_0x53acc8[_0x6e70('0x6c')]['id'],'FromUserId':_0x48f6fd[_0x6e70('0x31')]['id'],'type':_0x6e70('0x6f')};_0x260dfa[_0x252f07+_0x6e70('0x70')]=_0x53acc8['id'];_0x260dfa[_0x252f07+_0x6e70('0x71')]=_0x53acc8[_0x6e70('0x6c')]['id'];_0x260dfa['From'+_0x252f07+_0x51be27+'Id']=_0x53acc8[_0x6e70('0x6d')]['id'];_0x260dfa['To'+_0x252f07+'QueueId']=_0x39e6db['id'];return db[_0x252f07+_0x6e70('0x72')]['create'](_0x260dfa);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x461ec0,'interaction':_0x53acc8[_0x6e70('0x6c')],'message':_0x53acc8,'account':_0x53acc8[_0x6e70('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6e70('0x6f'),'appdata':_0x39e6db[_0x6e70('0x12')]+','+(_0x53acc8[_0x6e70('0x6d')]['queueTransferTimeout']||0x12c),'interval':_0x6e70('0x73')}],'transfer':!![]},routingClient);})[_0x6e70('0xa')](respondWithResult(_0x463eed,null))['catch'](handleError(_0x463eed,null));};};exports[_0x6e70('0x74')]=function(_0x50e494,_0x17d3a4){var _0x5d0585,_0x4a87e2;if(_[_0x6e70('0x14')](_0x50e494[_0x6e70('0x21')][_0x6e70('0x75')])){throw new Error(_0x6e70('0x76'));}var _0x3e6661=_0x50e494[_0x6e70('0x21')][_0x6e70('0x75')];var _0x5c0276=_[_0x6e70('0x66')](_0x3e6661);var _0x4f4a16=_0x3e6661===_0x6e70('0x77')?_0x6e70('0x67'):_0x6e70('0x6d');return db[_0x6e70('0x78')][_0x6e70('0x6b')]({'raw':!![],'where':{'id':_0x50e494[_0x6e70('0x1b')]['id'],'role':_0x6e70('0x3d')}})['then'](function(_0x4466f0){if(_['isNil'](_0x4466f0)){throw new Error(_0x6e70('0x79'));}_0x5d0585=_0x4466f0;return db[_0x5c0276+_0x6e70('0x6a')][_0x6e70('0x6b')]({'where':{'id':_0x50e494[_0x6e70('0x21')][_0x6e70('0x7a')]},'include':[{'model':db[_0x5c0276+_0x6e70('0x6c')],'as':_0x6e70('0x6c')},{'model':db[_0x5c0276+_0x4f4a16],'as':_0x6e70('0x6d')}]});})[_0x6e70('0xa')](function(_0x162bc3){if(_['isNil'](_0x162bc3)){throw new Error(_0x5c0276+_0x6e70('0x7b'));}_0x4a87e2=_0x162bc3;return _0x162bc3[_0x6e70('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})[_0x6e70('0xa')](function(){var _0x181802={'uniqueid':_0x3e6661+'.'+_0x4a87e2['id']+'.'+_0x4a87e2[_0x6e70('0x6c')]['id'],'FromUserId':_0x50e494['user']['id'],'type':'agent','ToUserId':_0x5d0585['id']};_0x181802[_0x5c0276+'MessageId']=_0x4a87e2['id'];_0x181802[_0x5c0276+_0x6e70('0x71')]=_0x4a87e2[_0x6e70('0x6c')]['id'];_0x181802[_0x6e70('0x7c')+_0x5c0276+_0x4f4a16+'Id']=_0x4a87e2[_0x6e70('0x6d')]['id'];return db[_0x5c0276+_0x6e70('0x72')][_0x6e70('0x7d')](_0x181802);})[_0x6e70('0xa')](function(){return respondWithRpcPromise(_0x6e70('0x7e'),{'channel':_0x3e6661,'interaction':_0x4a87e2[_0x6e70('0x6c')],'message':_0x4a87e2,'account':_0x4a87e2[_0x6e70('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6e70('0x3d'),'appdata':_0x5d0585[_0x6e70('0x12')]+','+(_0x4a87e2[_0x6e70('0x6d')][_0x6e70('0x7f')]||0x12c),'interval':_0x6e70('0x73')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x17d3a4,null))[_0x6e70('0xf')](handleError(_0x17d3a4,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 7c776d2..abbfeca 100644 --- a/server/api/schedule/index.js +++ b/server/api/schedule/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbdf6=['show','run','post','create','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id'];(function(_0x119638,_0x2017e6){var _0x2ffd16=function(_0x3ad72b){while(--_0x3ad72b){_0x119638['push'](_0x119638['shift']());}};_0x2ffd16(++_0x2017e6);}(_0xbdf6,0x198));var _0x6bdf=function(_0x3e2a89,_0x236296){_0x3e2a89=_0x3e2a89-0x0;var _0x320829=_0xbdf6[_0x3e2a89];return _0x320829;};'use strict';var multer=require(_0x6bdf('0x0'));var util=require(_0x6bdf('0x1'));var path=require(_0x6bdf('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6bdf('0x3')]();var fs_extra=require(_0x6bdf('0x4'));var auth=require(_0x6bdf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6bdf('0x6'));var controller=require(_0x6bdf('0x7'));router[_0x6bdf('0x8')]('/',auth[_0x6bdf('0x9')](),controller[_0x6bdf('0xa')]);router[_0x6bdf('0x8')](_0x6bdf('0xb'),auth[_0x6bdf('0x9')](),controller[_0x6bdf('0xc')]);router['get']('/:id/run',auth[_0x6bdf('0x9')](),controller[_0x6bdf('0xd')]);router[_0x6bdf('0xe')]('/',auth[_0x6bdf('0x9')](),controller[_0x6bdf('0xf')]);router['put']('/:id',auth[_0x6bdf('0x9')](),controller[_0x6bdf('0x10')]);router[_0x6bdf('0x11')](_0x6bdf('0xb'),auth['isAuthenticated'](),controller[_0x6bdf('0x12')]);module[_0x6bdf('0x13')]=router; \ No newline at end of file +var _0xba50=['create','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','isAuthenticated','index','get','/:id','show','/:id/run','run','post'];(function(_0x909ce6,_0x659ed4){var _0x3c6350=function(_0x54b2c2){while(--_0x54b2c2){_0x909ce6['push'](_0x909ce6['shift']());}};_0x3c6350(++_0x659ed4);}(_0xba50,0x119));var _0x0ba5=function(_0x51ee2c,_0x24ce75){_0x51ee2c=_0x51ee2c-0x0;var _0x5d76c2=_0xba50[_0x51ee2c];return _0x5d76c2;};'use strict';var multer=require('multer');var util=require(_0x0ba5('0x0'));var path=require(_0x0ba5('0x1'));var timeout=require(_0x0ba5('0x2'));var express=require(_0x0ba5('0x3'));var router=express[_0x0ba5('0x4')]();var fs_extra=require(_0x0ba5('0x5'));var auth=require(_0x0ba5('0x6'));var interaction=require(_0x0ba5('0x7'));var config=require(_0x0ba5('0x8'));var controller=require(_0x0ba5('0x9'));router['get']('/',auth[_0x0ba5('0xa')](),controller[_0x0ba5('0xb')]);router[_0x0ba5('0xc')](_0x0ba5('0xd'),auth[_0x0ba5('0xa')](),controller[_0x0ba5('0xe')]);router['get'](_0x0ba5('0xf'),auth[_0x0ba5('0xa')](),controller[_0x0ba5('0x10')]);router[_0x0ba5('0x11')]('/',auth[_0x0ba5('0xa')](),controller[_0x0ba5('0x12')]);router['put'](_0x0ba5('0xd'),auth[_0x0ba5('0xa')](),controller[_0x0ba5('0x13')]);router[_0x0ba5('0x14')](_0x0ba5('0xd'),auth[_0x0ba5('0xa')](),controller[_0x0ba5('0x15')]);module[_0x0ba5('0x16')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index dd8d1dc..9dd03c8 100644 --- a/server/api/schedule/schedule.attributes.js +++ b/server/api/schedule/schedule.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf8e2=['hours','pdf','csv','default','TEXT','sequelize','STRING','BOOLEAN','DATE','INTEGER','ENUM','months','days'];(function(_0x130705,_0x2d266b){var _0x1fa991=function(_0x395639){while(--_0x395639){_0x130705['push'](_0x130705['shift']());}};_0x1fa991(++_0x2d266b);}(_0xf8e2,0xfc));var _0x2f8e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xf8e2[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0x2f8e('0x0'));module['exports']={'name':{'type':Sequelize[_0x2f8e('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x2f8e('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x2f8e('0x1')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0x2f8e('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0x2f8e('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x2f8e('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x2f8e('0x5')]('years','quarters',_0x2f8e('0x6'),'weeks',_0x2f8e('0x7'),_0x2f8e('0x8'),'minutes'),'allowNull':![],'defaultValue':_0x2f8e('0x7')},'output':{'type':Sequelize[_0x2f8e('0x5')]('csv',_0x2f8e('0x9'),'xlsx'),'allowNull':![],'defaultValue':_0x2f8e('0xa')},'type':{'type':Sequelize[_0x2f8e('0x5')]('custom',_0x2f8e('0xb')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x2f8e('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x2f8e('0x1')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x2f8e('0xc')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xaf45=['months','weeks','days','minutes','csv','xlsx','custom','default','TEXT','BOOLEAN','sequelize','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','quarters'];(function(_0x5d7d06,_0x423126){var _0xe8eacc=function(_0x30e32d){while(--_0x30e32d){_0x5d7d06['push'](_0x5d7d06['shift']());}};_0xe8eacc(++_0x423126);}(_0xaf45,0x16f));var _0x5af4=function(_0x151732,_0x82b764){_0x151732=_0x151732-0x0;var _0x1cda86=_0xaf45[_0x151732];return _0x1cda86;};'use strict';var Sequelize=require(_0x5af4('0x0'));module['exports']={'name':{'type':Sequelize[_0x5af4('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x5af4('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5af4('0x2')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x5af4('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x5af4('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x5af4('0x5')]('years',_0x5af4('0x6'),_0x5af4('0x7'),_0x5af4('0x8'),_0x5af4('0x9'),'hours',_0x5af4('0xa')),'allowNull':![],'defaultValue':_0x5af4('0x9')},'output':{'type':Sequelize[_0x5af4('0x5')](_0x5af4('0xb'),'pdf',_0x5af4('0xc')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x5af4('0x5')](_0x5af4('0xd'),_0x5af4('0xe')),'allowNull':![],'defaultValue':_0x5af4('0xd')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x5af4('0x1')]},'cc':{'type':Sequelize[_0x5af4('0xf')]},'bcc':{'type':Sequelize[_0x5af4('0xf')]},'sendIfEmpty':{'type':Sequelize[_0x5af4('0x10')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 4684903..ea914bf 100644 --- a/server/api/schedule/schedule.controller.js +++ b/server/api/schedule/schedule.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x54c4=['../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','destroy','then','get','Scheduler','UserProfileResource','stack','name','send','index','map','fieldName','type','key','model','keys','filters','intersection','attributes','query','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','Schedule','includeAll','include','findAll','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','params','../../config/schedule','run','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x1da9f2,_0x3accdf){var _0x431b0e=function(_0x2037fc){while(--_0x2037fc){_0x1da9f2['push'](_0x1da9f2['shift']());}};_0x431b0e(++_0x3accdf);}(_0x54c4,0xec));var _0x454c=function(_0x29ca61,_0x6eabc8){_0x29ca61=_0x29ca61-0x0;var _0x3e1d20=_0x54c4[_0x29ca61];return _0x3e1d20;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x454c('0x0'));var moment=require(_0x454c('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x454c('0x2'));var util=require(_0x454c('0x3'));var path=require(_0x454c('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x454c('0x5'));var fs=require('fs');var fs_extra=require(_0x454c('0x6'));var _=require(_0x454c('0x7'));var squel=require('squel');var crypto=require(_0x454c('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x454c('0x9'));var toCsv=require(_0x454c('0xa'));var querystring=require(_0x454c('0xb'));var Papa=require(_0x454c('0xc'));var Redis=require('ioredis');var authService=require(_0x454c('0xd'));var qs=require(_0x454c('0xe'));var as=require(_0x454c('0xf'));var hardwareService=require(_0x454c('0x10'));var logger=require(_0x454c('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x454c('0x12'));var licenseUtil=require(_0x454c('0x13'));var db=require(_0x454c('0x14'))['db'];function respondWithStatusCode(_0x1d7e1e,_0x173f6b){_0x173f6b=_0x173f6b||0xcc;return function(_0x531f70){if(_0x531f70){return _0x1d7e1e[_0x454c('0x15')](_0x173f6b);}return _0x1d7e1e[_0x454c('0x16')](_0x173f6b)[_0x454c('0x17')]();};}function respondWithResult(_0x4777fd,_0x1f5769){_0x1f5769=_0x1f5769||0xc8;return function(_0x45c6b4){if(_0x45c6b4){return _0x4777fd[_0x454c('0x16')](_0x1f5769)[_0x454c('0x18')](_0x45c6b4);}};}function respondWithFilteredResult(_0x8b667e,_0x409cb9){return function(_0x4508e6){if(_0x4508e6){var _0x523c29=typeof _0x409cb9[_0x454c('0x19')]===_0x454c('0x1a')&&typeof _0x409cb9[_0x454c('0x1b')]===_0x454c('0x1a');var _0x235cf5=_0x4508e6['count'];var _0x2a0d79=_0x523c29?0x0:_0x409cb9['offset'];var _0x4d9337=_0x523c29?_0x4508e6[_0x454c('0x1c')]:_0x409cb9[_0x454c('0x19')]+_0x409cb9[_0x454c('0x1b')];var _0x583c44;if(_0x4d9337>=_0x235cf5){_0x4d9337=_0x235cf5;_0x583c44=0xc8;}else{_0x583c44=0xce;}_0x8b667e[_0x454c('0x16')](_0x583c44);return _0x8b667e['set']('Content-Range',_0x2a0d79+'-'+_0x4d9337+'/'+_0x235cf5)[_0x454c('0x18')](_0x4508e6);}return null;};}function patchUpdates(_0x3ef087){return function(_0x55ffab){try{jsonpatch[_0x454c('0x1d')](_0x55ffab,_0x3ef087,!![]);}catch(_0x1903c4){return BPromise[_0x454c('0x1e')](_0x1903c4);}return _0x55ffab[_0x454c('0x1f')]();};}function saveUpdates(_0xe5ac8c,_0x1bacf2){return function(_0x337563){if(_0x337563){return _0x337563[_0x454c('0x20')](_0xe5ac8c)['then'](function(_0x8e28ba){return _0x8e28ba;});}return null;};}function removeEntity(_0x1fc5b5,_0x3e58fd){return function(_0x5e34c9){if(_0x5e34c9){return _0x5e34c9[_0x454c('0x21')]()[_0x454c('0x22')](function(){var _0x3cfb61=_0x5e34c9[_0x454c('0x23')]({'plain':!![]});var _0x50434c=_0x454c('0x24');return db[_0x454c('0x25')]['destroy']({'where':{'type':_0x50434c,'resourceId':_0x3cfb61['id']}})[_0x454c('0x22')](function(){return _0x5e34c9;});})[_0x454c('0x22')](function(){_0x1fc5b5['status'](0xcc)[_0x454c('0x17')]();});}};}function handleEntityNotFound(_0x44d211,_0x5c4a41){return function(_0x15a019){if(!_0x15a019){_0x44d211[_0x454c('0x15')](0x194);}return _0x15a019;};}function handleError(_0x3a8d76,_0xc50a6d){_0xc50a6d=_0xc50a6d||0x1f4;return function(_0x566916){logger['error'](_0x566916[_0x454c('0x26')]);if(_0x566916['name']){delete _0x566916[_0x454c('0x27')];}_0x3a8d76['status'](_0xc50a6d)[_0x454c('0x28')](_0x566916);};}exports[_0x454c('0x29')]=function(_0x20a7e2,_0x4d8b19){var _0x1b0c6d={},_0x5b3dc1={},_0x36d30a={'count':0x0,'rows':[]};var _0x5dfe33=_[_0x454c('0x2a')](db['Schedule']['rawAttributes'],function(_0x5480f8){return{'name':_0x5480f8[_0x454c('0x2b')],'type':_0x5480f8[_0x454c('0x2c')][_0x454c('0x2d')]};});_0x5b3dc1[_0x454c('0x2e')]=_['map'](_0x5dfe33,_0x454c('0x27'));_0x5b3dc1['query']=_[_0x454c('0x2f')](_0x20a7e2['query']);_0x5b3dc1[_0x454c('0x30')]=_[_0x454c('0x31')](_0x5b3dc1[_0x454c('0x2e')],_0x5b3dc1['query']);_0x1b0c6d[_0x454c('0x32')]=_[_0x454c('0x31')](_0x5b3dc1[_0x454c('0x2e')],qs['fields'](_0x20a7e2[_0x454c('0x33')][_0x454c('0x34')]));_0x1b0c6d['attributes']=_0x1b0c6d[_0x454c('0x32')][_0x454c('0x35')]?_0x1b0c6d['attributes']:_0x5b3dc1[_0x454c('0x2e')];if(!_0x20a7e2['query'][_0x454c('0x36')](_0x454c('0x37'))){_0x1b0c6d[_0x454c('0x1b')]=qs[_0x454c('0x1b')](_0x20a7e2[_0x454c('0x33')][_0x454c('0x1b')]);_0x1b0c6d[_0x454c('0x19')]=qs[_0x454c('0x19')](_0x20a7e2[_0x454c('0x33')]['offset']);}_0x1b0c6d[_0x454c('0x38')]=qs[_0x454c('0x39')](_0x20a7e2['query'][_0x454c('0x39')]);_0x1b0c6d['where']=qs['filters'](_[_0x454c('0x3a')](_0x20a7e2['query'],_0x5b3dc1['filters']),_0x5dfe33);if(_0x20a7e2[_0x454c('0x33')][_0x454c('0x3b')]){_0x1b0c6d[_0x454c('0x3c')]=_[_0x454c('0x3d')](_0x1b0c6d[_0x454c('0x3c')],{'$or':_[_0x454c('0x2a')](_0x5dfe33,function(_0x54309f){if(_0x54309f[_0x454c('0x2c')]!==_0x454c('0x3e')){var _0x196c6e={};_0x196c6e[_0x54309f[_0x454c('0x27')]]={'$like':'%'+_0x20a7e2[_0x454c('0x33')][_0x454c('0x3b')]+'%'};return _0x196c6e;}})});}_0x1b0c6d=_[_0x454c('0x3d')]({},_0x1b0c6d,_0x20a7e2[_0x454c('0x3f')]);var _0x5e683a={'where':_0x1b0c6d[_0x454c('0x3c')]};return db[_0x454c('0x40')]['count'](_0x5e683a)['then'](function(_0x2143b9){_0x36d30a['count']=_0x2143b9;if(_0x20a7e2[_0x454c('0x33')][_0x454c('0x41')]){_0x1b0c6d[_0x454c('0x42')]=[{'all':!![]}];}return db[_0x454c('0x40')][_0x454c('0x43')](_0x1b0c6d);})[_0x454c('0x22')](function(_0x5c9ddc){_0x36d30a['rows']=_0x5c9ddc;return _0x36d30a;})[_0x454c('0x22')](respondWithFilteredResult(_0x4d8b19,_0x1b0c6d))['catch'](handleError(_0x4d8b19,null));};exports['show']=function(_0x123acd,_0xc0b147){var _0x4b09de={'raw':![],'where':{'id':_0x123acd['params']['id']}},_0xfd572e={};_0xfd572e[_0x454c('0x2e')]=_[_0x454c('0x2f')](db[_0x454c('0x40')][_0x454c('0x44')]);_0xfd572e['query']=_['keys'](_0x123acd[_0x454c('0x33')]);_0xfd572e[_0x454c('0x30')]=_['intersection'](_0xfd572e['model'],_0xfd572e[_0x454c('0x33')]);_0x4b09de[_0x454c('0x32')]=_[_0x454c('0x31')](_0xfd572e[_0x454c('0x2e')],qs[_0x454c('0x34')](_0x123acd[_0x454c('0x33')][_0x454c('0x34')]));_0x4b09de[_0x454c('0x32')]=_0x4b09de[_0x454c('0x32')]['length']?_0x4b09de['attributes']:_0xfd572e[_0x454c('0x2e')];if(_0x123acd[_0x454c('0x33')][_0x454c('0x41')]){_0x4b09de[_0x454c('0x42')]=[{'all':!![]}];}_0x4b09de=_[_0x454c('0x3d')]({},_0x4b09de,_0x123acd[_0x454c('0x3f')]);return db[_0x454c('0x40')][_0x454c('0x45')](_0x4b09de)['then'](handleEntityNotFound(_0xc0b147,null))[_0x454c('0x22')](respondWithResult(_0xc0b147,null))['catch'](handleError(_0xc0b147,null));};exports['create']=function(_0x4e448e,_0x19b2da){return db[_0x454c('0x40')][_0x454c('0x46')](_0x4e448e[_0x454c('0x47')],{})[_0x454c('0x22')](function(_0x463119){var _0x4cd859=_0x4e448e[_0x454c('0x48')][_0x454c('0x23')]({'plain':!![]});if(!_0x4cd859)throw new Error(_0x454c('0x49'));if(_0x4cd859[_0x454c('0x4a')]==='user'){var _0x3d24ec=_0x463119['get']({'plain':!![]});var _0x42bfce='Scheduler';return db[_0x454c('0x4b')][_0x454c('0x45')]({'where':{'name':_0x42bfce,'userProfileId':_0x4cd859[_0x454c('0x4c')]},'raw':!![]})[_0x454c('0x22')](function(_0x5dec13){if(_0x5dec13&&_0x5dec13[_0x454c('0x4d')]===0x0){return db[_0x454c('0x25')][_0x454c('0x46')]({'name':_0x3d24ec[_0x454c('0x27')],'resourceId':_0x3d24ec['id'],'type':_0x5dec13[_0x454c('0x27')],'sectionId':_0x5dec13['id']},{})[_0x454c('0x22')](function(){return _0x463119;});}else{return _0x463119;}})['catch'](function(_0x55c954){logger[_0x454c('0x4e')](_0x454c('0x4f'),_0x55c954);throw _0x55c954;});}return _0x463119;})[_0x454c('0x22')](respondWithResult(_0x19b2da,0xc9))[_0x454c('0x50')](handleError(_0x19b2da,null));};exports[_0x454c('0x20')]=function(_0x3b7c08,_0x2f21c8){if(_0x3b7c08[_0x454c('0x47')]['id']){delete _0x3b7c08[_0x454c('0x47')]['id'];}return db[_0x454c('0x40')][_0x454c('0x45')]({'where':{'id':_0x3b7c08[_0x454c('0x51')]['id']}})['then'](handleEntityNotFound(_0x2f21c8,null))['then'](saveUpdates(_0x3b7c08['body'],null))[_0x454c('0x22')](respondWithResult(_0x2f21c8,null))[_0x454c('0x50')](handleError(_0x2f21c8,null));};exports[_0x454c('0x21')]=function(_0x197f4f,_0x27fda0){return db['Schedule']['find']({'where':{'id':_0x197f4f['params']['id']}})[_0x454c('0x22')](handleEntityNotFound(_0x27fda0,null))['then'](removeEntity(_0x27fda0,null))['catch'](handleError(_0x27fda0,null));};exports['run']=function(_0x93343b,_0x330238,_0x2ba6f1){var _0x6d9f5=require(_0x454c('0x52'));return db[_0x454c('0x40')][_0x454c('0x45')]({'where':{'id':_0x93343b[_0x454c('0x51')]['id']},'raw':!![]})[_0x454c('0x22')](handleEntityNotFound(_0x330238,null))['then'](function(){_0x6d9f5[_0x454c('0x53')](_0x93343b[_0x454c('0x51')]['id']);})[_0x454c('0x22')](respondWithStatusCode(_0x330238,null))['catch'](handleError(_0x330238,null));}; \ No newline at end of file +var _0x6dfd=['query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','options','Schedule','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','length','include','find','create','body','user','role','Scheduler','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','../../config/schedule','rimraf','zip-dir','fast-json-patch','moment','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','fieldName','type','model'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6dfd,0x1b6));var _0xd6df=function(_0x57e98d,_0x5bb3ad){_0x57e98d=_0x57e98d-0x0;var _0x3086eb=_0x6dfd[_0x57e98d];return _0x3086eb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd6df('0x0'));var zipdir=require(_0xd6df('0x1'));var jsonpatch=require(_0xd6df('0x2'));var rp=require('request-promise');var moment=require(_0xd6df('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xd6df('0x4'));var sox=require(_0xd6df('0x5'));var csv=require('to-csv');var ejs=require(_0xd6df('0x6'));var fs=require('fs');var fs_extra=require(_0xd6df('0x7'));var _=require('lodash');var squel=require(_0xd6df('0x8'));var crypto=require(_0xd6df('0x9'));var jsforce=require(_0xd6df('0xa'));var deskjs=require(_0xd6df('0xb'));var toCsv=require(_0xd6df('0xc'));var querystring=require(_0xd6df('0xd'));var Papa=require(_0xd6df('0xe'));var Redis=require(_0xd6df('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xd6df('0x10'));var as=require(_0xd6df('0x11'));var hardwareService=require(_0xd6df('0x12'));var logger=require('../../config/logger')(_0xd6df('0x13'));var utils=require(_0xd6df('0x14'));var config=require(_0xd6df('0x15'));var licenseUtil=require(_0xd6df('0x16'));var db=require(_0xd6df('0x17'))['db'];function respondWithStatusCode(_0x18641,_0x3220ae){_0x3220ae=_0x3220ae||0xcc;return function(_0x370023){if(_0x370023){return _0x18641[_0xd6df('0x18')](_0x3220ae);}return _0x18641[_0xd6df('0x19')](_0x3220ae)['end']();};}function respondWithResult(_0x2b48be,_0x1f455d){_0x1f455d=_0x1f455d||0xc8;return function(_0x5305cc){if(_0x5305cc){return _0x2b48be['status'](_0x1f455d)[_0xd6df('0x1a')](_0x5305cc);}};}function respondWithFilteredResult(_0x4c28c2,_0x519f31){return function(_0x2c2e8d){if(_0x2c2e8d){var _0x4ca04d=typeof _0x519f31[_0xd6df('0x1b')]==='undefined'&&typeof _0x519f31[_0xd6df('0x1c')]==='undefined';var _0x4f4a55=_0x2c2e8d['count'];var _0x5b89fb=_0x4ca04d?0x0:_0x519f31[_0xd6df('0x1b')];var _0x48a9e1=_0x4ca04d?_0x2c2e8d[_0xd6df('0x1d')]:_0x519f31['offset']+_0x519f31['limit'];var _0x489d68;if(_0x48a9e1>=_0x4f4a55){_0x48a9e1=_0x4f4a55;_0x489d68=0xc8;}else{_0x489d68=0xce;}_0x4c28c2[_0xd6df('0x19')](_0x489d68);return _0x4c28c2[_0xd6df('0x1e')](_0xd6df('0x1f'),_0x5b89fb+'-'+_0x48a9e1+'/'+_0x4f4a55)[_0xd6df('0x1a')](_0x2c2e8d);}return null;};}function patchUpdates(_0x1e9201){return function(_0x1e30f6){try{jsonpatch[_0xd6df('0x20')](_0x1e30f6,_0x1e9201,!![]);}catch(_0xfc32b6){return BPromise['reject'](_0xfc32b6);}return _0x1e30f6[_0xd6df('0x21')]();};}function saveUpdates(_0x19c614,_0x52c396){return function(_0x5e11c9){if(_0x5e11c9){return _0x5e11c9[_0xd6df('0x22')](_0x19c614)[_0xd6df('0x23')](function(_0x41e617){return _0x41e617;});}return null;};}function removeEntity(_0x4fd669,_0x4f514c){return function(_0x1efafe){if(_0x1efafe){return _0x1efafe[_0xd6df('0x24')]()[_0xd6df('0x23')](function(){var _0x3cfceb=_0x1efafe[_0xd6df('0x25')]({'plain':!![]});var _0x293c5e='Scheduler';return db[_0xd6df('0x26')][_0xd6df('0x24')]({'where':{'type':_0x293c5e,'resourceId':_0x3cfceb['id']}})[_0xd6df('0x23')](function(){return _0x1efafe;});})[_0xd6df('0x23')](function(){_0x4fd669[_0xd6df('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13204f,_0x433d33){return function(_0x25329a){if(!_0x25329a){_0x13204f[_0xd6df('0x18')](0x194);}return _0x25329a;};}function handleError(_0x410903,_0x4c9151){_0x4c9151=_0x4c9151||0x1f4;return function(_0x442968){logger[_0xd6df('0x27')](_0x442968[_0xd6df('0x28')]);if(_0x442968['name']){delete _0x442968[_0xd6df('0x29')];}_0x410903['status'](_0x4c9151)[_0xd6df('0x2a')](_0x442968);};}exports[_0xd6df('0x2b')]=function(_0x2db096,_0x58850e){var _0x49ed71={},_0x4442bc={},_0x1ef43e={'count':0x0,'rows':[]};var _0x313fbb=_[_0xd6df('0x2c')](db['Schedule']['rawAttributes'],function(_0x494c32){return{'name':_0x494c32[_0xd6df('0x2d')],'type':_0x494c32[_0xd6df('0x2e')]['key']};});_0x4442bc[_0xd6df('0x2f')]=_[_0xd6df('0x2c')](_0x313fbb,_0xd6df('0x29'));_0x4442bc['query']=_['keys'](_0x2db096[_0xd6df('0x30')]);_0x4442bc[_0xd6df('0x31')]=_[_0xd6df('0x32')](_0x4442bc[_0xd6df('0x2f')],_0x4442bc['query']);_0x49ed71['attributes']=_[_0xd6df('0x32')](_0x4442bc[_0xd6df('0x2f')],qs[_0xd6df('0x33')](_0x2db096[_0xd6df('0x30')]['fields']));_0x49ed71[_0xd6df('0x34')]=_0x49ed71['attributes']['length']?_0x49ed71[_0xd6df('0x34')]:_0x4442bc[_0xd6df('0x2f')];if(!_0x2db096['query'][_0xd6df('0x35')](_0xd6df('0x36'))){_0x49ed71[_0xd6df('0x1c')]=qs[_0xd6df('0x1c')](_0x2db096[_0xd6df('0x30')][_0xd6df('0x1c')]);_0x49ed71[_0xd6df('0x1b')]=qs['offset'](_0x2db096[_0xd6df('0x30')][_0xd6df('0x1b')]);}_0x49ed71['order']=qs[_0xd6df('0x37')](_0x2db096[_0xd6df('0x30')][_0xd6df('0x37')]);_0x49ed71[_0xd6df('0x38')]=qs[_0xd6df('0x31')](_['pick'](_0x2db096[_0xd6df('0x30')],_0x4442bc['filters']),_0x313fbb);if(_0x2db096['query']['filter']){_0x49ed71[_0xd6df('0x38')]=_[_0xd6df('0x39')](_0x49ed71[_0xd6df('0x38')],{'$or':_[_0xd6df('0x2c')](_0x313fbb,function(_0x4d22a0){if(_0x4d22a0[_0xd6df('0x2e')]!==_0xd6df('0x3a')){var _0x4b5e1b={};_0x4b5e1b[_0x4d22a0[_0xd6df('0x29')]]={'$like':'%'+_0x2db096[_0xd6df('0x30')]['filter']+'%'};return _0x4b5e1b;}})});}_0x49ed71=_[_0xd6df('0x39')]({},_0x49ed71,_0x2db096[_0xd6df('0x3b')]);var _0x34799b={'where':_0x49ed71[_0xd6df('0x38')]};return db[_0xd6df('0x3c')][_0xd6df('0x1d')](_0x34799b)[_0xd6df('0x23')](function(_0x187861){_0x1ef43e[_0xd6df('0x1d')]=_0x187861;if(_0x2db096['query'][_0xd6df('0x3d')]){_0x49ed71['include']=[{'all':!![]}];}return db[_0xd6df('0x3c')][_0xd6df('0x3e')](_0x49ed71);})['then'](function(_0x3ff0a9){_0x1ef43e[_0xd6df('0x3f')]=_0x3ff0a9;return _0x1ef43e;})[_0xd6df('0x23')](respondWithFilteredResult(_0x58850e,_0x49ed71))[_0xd6df('0x40')](handleError(_0x58850e,null));};exports[_0xd6df('0x41')]=function(_0x9dbfa,_0x1fd839){var _0x3642c={'raw':![],'where':{'id':_0x9dbfa[_0xd6df('0x42')]['id']}},_0x55c540={};_0x55c540[_0xd6df('0x2f')]=_[_0xd6df('0x43')](db[_0xd6df('0x3c')][_0xd6df('0x44')]);_0x55c540['query']=_['keys'](_0x9dbfa[_0xd6df('0x30')]);_0x55c540['filters']=_[_0xd6df('0x32')](_0x55c540[_0xd6df('0x2f')],_0x55c540[_0xd6df('0x30')]);_0x3642c[_0xd6df('0x34')]=_[_0xd6df('0x32')](_0x55c540[_0xd6df('0x2f')],qs[_0xd6df('0x33')](_0x9dbfa[_0xd6df('0x30')][_0xd6df('0x33')]));_0x3642c['attributes']=_0x3642c['attributes'][_0xd6df('0x45')]?_0x3642c[_0xd6df('0x34')]:_0x55c540[_0xd6df('0x2f')];if(_0x9dbfa[_0xd6df('0x30')][_0xd6df('0x3d')]){_0x3642c[_0xd6df('0x46')]=[{'all':!![]}];}_0x3642c=_[_0xd6df('0x39')]({},_0x3642c,_0x9dbfa[_0xd6df('0x3b')]);return db[_0xd6df('0x3c')][_0xd6df('0x47')](_0x3642c)[_0xd6df('0x23')](handleEntityNotFound(_0x1fd839,null))[_0xd6df('0x23')](respondWithResult(_0x1fd839,null))[_0xd6df('0x40')](handleError(_0x1fd839,null));};exports[_0xd6df('0x48')]=function(_0x22409d,_0x27a51b){return db[_0xd6df('0x3c')][_0xd6df('0x48')](_0x22409d[_0xd6df('0x49')],{})[_0xd6df('0x23')](function(_0x2414e7){var _0x2dfc62=_0x22409d[_0xd6df('0x4a')][_0xd6df('0x25')]({'plain':!![]});if(!_0x2dfc62)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2dfc62[_0xd6df('0x4b')]===_0xd6df('0x4a')){var _0x3c5a11=_0x2414e7['get']({'plain':!![]});var _0x21209e=_0xd6df('0x4c');return db[_0xd6df('0x4d')][_0xd6df('0x47')]({'where':{'name':_0x21209e,'userProfileId':_0x2dfc62[_0xd6df('0x4e')]},'raw':!![]})[_0xd6df('0x23')](function(_0x584a61){if(_0x584a61&&_0x584a61['autoAssociation']===0x0){return db[_0xd6df('0x26')][_0xd6df('0x48')]({'name':_0x3c5a11[_0xd6df('0x29')],'resourceId':_0x3c5a11['id'],'type':_0x584a61['name'],'sectionId':_0x584a61['id']},{})[_0xd6df('0x23')](function(){return _0x2414e7;});}else{return _0x2414e7;}})[_0xd6df('0x40')](function(_0x55fc98){logger[_0xd6df('0x27')](_0xd6df('0x4f'),_0x55fc98);throw _0x55fc98;});}return _0x2414e7;})[_0xd6df('0x23')](respondWithResult(_0x27a51b,0xc9))['catch'](handleError(_0x27a51b,null));};exports[_0xd6df('0x22')]=function(_0x253019,_0x8fd72d){if(_0x253019[_0xd6df('0x49')]['id']){delete _0x253019[_0xd6df('0x49')]['id'];}return db[_0xd6df('0x3c')][_0xd6df('0x47')]({'where':{'id':_0x253019[_0xd6df('0x42')]['id']}})[_0xd6df('0x23')](handleEntityNotFound(_0x8fd72d,null))[_0xd6df('0x23')](saveUpdates(_0x253019[_0xd6df('0x49')],null))[_0xd6df('0x23')](respondWithResult(_0x8fd72d,null))['catch'](handleError(_0x8fd72d,null));};exports['destroy']=function(_0x1fec31,_0x2be58d){return db[_0xd6df('0x3c')][_0xd6df('0x47')]({'where':{'id':_0x1fec31[_0xd6df('0x42')]['id']}})[_0xd6df('0x23')](handleEntityNotFound(_0x2be58d,null))[_0xd6df('0x23')](removeEntity(_0x2be58d,null))[_0xd6df('0x40')](handleError(_0x2be58d,null));};exports['run']=function(_0x37e584,_0x4c8e57,_0x42b53c){var _0xe9cfe5=require(_0xd6df('0x50'));return db[_0xd6df('0x3c')][_0xd6df('0x47')]({'where':{'id':_0x37e584[_0xd6df('0x42')]['id']},'raw':!![]})[_0xd6df('0x23')](handleEntityNotFound(_0x4c8e57,null))[_0xd6df('0x23')](function(){_0xe9cfe5['run'](_0x37e584['params']['id']);})[_0xd6df('0x23')](respondWithStatusCode(_0x4c8e57,null))['catch'](handleError(_0x4c8e57,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 26fa25b..c38a9bb 100644 --- a/server/api/schedule/schedule.model.js +++ b/server/api/schedule/schedule.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2960=['tools_schedules','lodash','util','api','bluebird','path','./schedule.attributes','exports','define','Schedule'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x2960,0x1af));var _0x0296=function(_0x1a0620,_0x4f40c3){_0x1a0620=_0x1a0620-0x0;var _0x475abc=_0x2960[_0x1a0620];return _0x475abc;};'use strict';var _=require(_0x0296('0x0'));var util=require(_0x0296('0x1'));var logger=require('../../config/logger')(_0x0296('0x2'));var moment=require('moment');var BPromise=require(_0x0296('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0296('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0296('0x5'));module[_0x0296('0x6')]=function(_0x526b7d,_0x800e9e){return _0x526b7d[_0x0296('0x7')](_0x0296('0x8'),attributes,{'tableName':_0x0296('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f31=['./schedule.attributes','define','Schedule','tools_schedules','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x4f5747,_0x3a6e91){var _0x12ddf7=function(_0x2bb529){while(--_0x2bb529){_0x4f5747['push'](_0x4f5747['shift']());}};_0x12ddf7(++_0x3a6e91);}(_0x6f31,0xbf));var _0x16f3=function(_0xe4bea,_0x44bc52){_0xe4bea=_0xe4bea-0x0;var _0x25c066=_0x6f31[_0xe4bea];return _0x25c066;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x16f3('0x0'))(_0x16f3('0x1'));var moment=require(_0x16f3('0x2'));var BPromise=require(_0x16f3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x16f3('0x4'));var rimraf=require(_0x16f3('0x5'));var config=require(_0x16f3('0x6'));var attributes=require(_0x16f3('0x7'));module['exports']=function(_0x341b89,_0x579731){return _0x341b89[_0x16f3('0x8')](_0x16f3('0x9'),attributes,{'tableName':_0x16f3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 39d7e5d..d2308ef 100644 --- a/server/api/schedule/schedule.rpc.js +++ b/server/api/schedule/schedule.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe4d6=['Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xe4d6,0x13c));var _0x6e4d=function(_0x290157,_0x544f68){_0x290157=_0x290157-0x0;var _0x265b24=_0xe4d6[_0x290157];return _0x265b24;};'use strict';var _=require('lodash');var util=require(_0x6e4d('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6e4d('0x1'));var fs=require('fs');var Redis=require(_0x6e4d('0x2'));var db=require(_0x6e4d('0x3'))['db'];var utils=require(_0x6e4d('0x4'));var logger=require(_0x6e4d('0x5'))(_0x6e4d('0x6'));var config=require(_0x6e4d('0x7'));var jayson=require(_0x6e4d('0x8'));var client=jayson[_0x6e4d('0x9')][_0x6e4d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4dea38,_0x766d42,_0x56d2a2){return new BPromise(function(_0x12ebf0,_0x2a8769){return client[_0x6e4d('0xb')](_0x4dea38,_0x56d2a2)[_0x6e4d('0xc')](function(_0x5470e9){logger[_0x6e4d('0xd')](_0x6e4d('0xe'),_0x766d42,_0x6e4d('0xf'));logger[_0x6e4d('0x10')](_0x6e4d('0x11'),_0x766d42,'request\x20sent',JSON['stringify'](_0x5470e9));if(_0x5470e9['error']){if(_0x5470e9[_0x6e4d('0x12')][_0x6e4d('0x13')]===0x1f4){logger[_0x6e4d('0x12')](_0x6e4d('0xe'),_0x766d42,_0x5470e9[_0x6e4d('0x12')]['message']);return _0x2a8769(_0x5470e9['error'][_0x6e4d('0x14')]);}logger[_0x6e4d('0x12')](_0x6e4d('0xe'),_0x766d42,_0x5470e9[_0x6e4d('0x12')][_0x6e4d('0x14')]);return _0x12ebf0(_0x5470e9[_0x6e4d('0x12')]['message']);}else{logger['info'](_0x6e4d('0xe'),_0x766d42,_0x6e4d('0xf'));_0x12ebf0(_0x5470e9['result'][_0x6e4d('0x14')]);}})[_0x6e4d('0x15')](function(_0x2f06e5){logger[_0x6e4d('0x12')]('Schedule,\x20%s,\x20%s',_0x766d42,_0x2f06e5);_0x2a8769(_0x2f06e5);});});} \ No newline at end of file +var _0x70fe=['client','http','then','info','Schedule,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x40b66c,_0x5c1d58){var _0x159671=function(_0x17a129){while(--_0x17a129){_0x40b66c['push'](_0x40b66c['shift']());}};_0x159671(++_0x5c1d58);}(_0x70fe,0x196));var _0xe70f=function(_0x34d52b,_0x410457){_0x34d52b=_0x34d52b-0x0;var _0x380c14=_0x70fe[_0x34d52b];return _0x380c14;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe70f('0x0'));var BPromise=require(_0xe70f('0x1'));var rs=require(_0xe70f('0x2'));var fs=require('fs');var Redis=require(_0xe70f('0x3'));var db=require(_0xe70f('0x4'))['db'];var utils=require(_0xe70f('0x5'));var logger=require('../../config/logger')(_0xe70f('0x6'));var config=require(_0xe70f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe70f('0x8')][_0xe70f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b79a4,_0x13c8ee,_0x596df9){return new BPromise(function(_0x51d241,_0x35ba54){return client['request'](_0x3b79a4,_0x596df9)[_0xe70f('0xa')](function(_0x19f8ea){logger[_0xe70f('0xb')](_0xe70f('0xc'),_0x13c8ee,_0xe70f('0xd'));logger['debug']('Schedule,\x20%s,\x20%s,\x20%s',_0x13c8ee,_0xe70f('0xd'),JSON[_0xe70f('0xe')](_0x19f8ea));if(_0x19f8ea[_0xe70f('0xf')]){if(_0x19f8ea[_0xe70f('0xf')]['code']===0x1f4){logger[_0xe70f('0xf')](_0xe70f('0xc'),_0x13c8ee,_0x19f8ea[_0xe70f('0xf')][_0xe70f('0x10')]);return _0x35ba54(_0x19f8ea[_0xe70f('0xf')][_0xe70f('0x10')]);}logger[_0xe70f('0xf')](_0xe70f('0xc'),_0x13c8ee,_0x19f8ea[_0xe70f('0xf')][_0xe70f('0x10')]);return _0x51d241(_0x19f8ea[_0xe70f('0xf')][_0xe70f('0x10')]);}else{logger['info'](_0xe70f('0xc'),_0x13c8ee,_0xe70f('0xd'));_0x51d241(_0x19f8ea['result'][_0xe70f('0x10')]);}})[_0xe70f('0x11')](function(_0x2cbeca){logger[_0xe70f('0xf')](_0xe70f('0xc'),_0x13c8ee,_0x2cbeca);_0x35ba54(_0x2cbeca);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index ef91101..bb5bd42 100644 --- a/server/api/screenRecording/index.js +++ b/server/api/screenRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0df0=['../../components/interaction/service','../../config/environment','./screenRecording.controller','get','/describe','isAuthenticated','/:id','show','download','post','create','put','delete','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0x0df0,0x1af));var _0x00df=function(_0x2d9c6a,_0x59393d){_0x2d9c6a=_0x2d9c6a-0x0;var _0xf3c918=_0x0df0[_0x2d9c6a];return _0xf3c918;};'use strict';var multer=require(_0x00df('0x0'));var util=require(_0x00df('0x1'));var path=require(_0x00df('0x2'));var timeout=require(_0x00df('0x3'));var express=require(_0x00df('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x00df('0x5'));var interaction=require(_0x00df('0x6'));var config=require(_0x00df('0x7'));var controller=require(_0x00df('0x8'));router[_0x00df('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x00df('0x9')](_0x00df('0xa'),auth[_0x00df('0xb')](),controller['describe']);router[_0x00df('0x9')](_0x00df('0xc'),auth['isAuthenticated'](),controller[_0x00df('0xd')]);router[_0x00df('0x9')]('/:id/download',auth['isAuthenticated'](),controller[_0x00df('0xe')]);router[_0x00df('0xf')]('/',auth[_0x00df('0xb')](),controller[_0x00df('0x10')]);router[_0x00df('0x11')](_0x00df('0xc'),auth[_0x00df('0xb')](),controller['update']);router[_0x00df('0x12')](_0x00df('0xc'),auth[_0x00df('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xebc3=['../../config/environment','./screenRecording.controller','get','index','isAuthenticated','describe','/:id/download','download','create','put','delete','/:id','destroy','multer','path','Router','fs-extra','../../components/auth/service'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0xebc3,0x67));var _0x3ebc=function(_0x3b9dea,_0x8475b0){_0x3b9dea=_0x3b9dea-0x0;var _0x3c4258=_0xebc3[_0x3b9dea];return _0x3c4258;};'use strict';var multer=require(_0x3ebc('0x0'));var util=require('util');var path=require(_0x3ebc('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3ebc('0x2')]();var fs_extra=require(_0x3ebc('0x3'));var auth=require(_0x3ebc('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3ebc('0x5'));var controller=require(_0x3ebc('0x6'));router[_0x3ebc('0x7')]('/',auth['isAuthenticated'](),controller[_0x3ebc('0x8')]);router[_0x3ebc('0x7')]('/describe',auth[_0x3ebc('0x9')](),controller[_0x3ebc('0xa')]);router[_0x3ebc('0x7')]('/:id',auth[_0x3ebc('0x9')](),controller['show']);router[_0x3ebc('0x7')](_0x3ebc('0xb'),auth[_0x3ebc('0x9')](),controller[_0x3ebc('0xc')]);router['post']('/',auth[_0x3ebc('0x9')](),controller[_0x3ebc('0xd')]);router[_0x3ebc('0xe')]('/:id',auth[_0x3ebc('0x9')](),controller['update']);router[_0x3ebc('0xf')](_0x3ebc('0x10'),auth[_0x3ebc('0x9')](),controller[_0x3ebc('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index e4786e4..0fc648d 100644 --- a/server/api/screenRecording/screenRecording.attributes.js +++ b/server/api/screenRecording/screenRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5eef=['DATE','createdAt','updatedAt','path','exports','getDataValue','value','extname','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','format','MM-DD-YYYY\x20HH:mm','toString'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0x5eef,0x9c));var _0xf5ee=function(_0x39deaf,_0x39cb84){_0x39deaf=_0x39deaf-0x0;var _0x2d3f1a=_0x5eef[_0x39deaf];return _0x2d3f1a;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var path=require(_0xf5ee('0x0'));var config=require('../../config/environment');module[_0xf5ee('0x1')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xf5ee('0x2')](_0xf5ee('0x3'))?path[_0xf5ee('0x4')](this[_0xf5ee('0x2')](_0xf5ee('0x3'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize['STRING'],'set':function(_0x3ae819){var _0x24e3a5=_0x3ae819['replace'](/\\/g,'/');this[_0xf5ee('0x5')](_0xf5ee('0x3'),_0x24e3a5);}},'rating':{'type':Sequelize[_0xf5ee('0x6')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xf5ee('0x6')],'set':function(_0x125def){this[_0xf5ee('0x5')](_0xf5ee('0x7'),moment()[_0xf5ee('0x8')](_0x125def,'ms'));this[_0xf5ee('0x5')](_0xf5ee('0x9'),moment());this['setDataValue'](_0xf5ee('0xa'),_0x125def);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xf5ee('0x2')]('startedAt'))[_0xf5ee('0xb')](_0xf5ee('0xc'))[_0xf5ee('0xd')]();}},'closedAt':{'type':Sequelize[_0xf5ee('0xe')],'get':function(){return moment(this['getDataValue'](_0xf5ee('0x9')))[_0xf5ee('0xb')](_0xf5ee('0xc'))[_0xf5ee('0xd')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0xf5ee('0xf')))[_0xf5ee('0xb')](_0xf5ee('0xc'))[_0xf5ee('0xd')]();}},'updatedAt':{'type':Sequelize[_0xf5ee('0xe')],'get':function(){return moment(this['getDataValue'](_0xf5ee('0x10')))[_0xf5ee('0xb')]('MM-DD-YYYY\x20HH:mm')[_0xf5ee('0xd')]();}}}; \ No newline at end of file +var _0x11c1=['path','../../config/environment','exports','VIRTUAL','value','extname','getDataValue','STRING','replace','setDataValue','INTEGER','startedAt','subtract','DATE','format','MM-DD-YYYY\x20HH:mm','toString','closedAt','createdAt','sequelize'];(function(_0xe01cdc,_0x1f9b5b){var _0x441fbd=function(_0x40eaf9){while(--_0x40eaf9){_0xe01cdc['push'](_0xe01cdc['shift']());}};_0x441fbd(++_0x1f9b5b);}(_0x11c1,0x1cb));var _0x111c=function(_0x548dbb,_0x44ae96){_0x548dbb=_0x548dbb-0x0;var _0x55b491=_0x11c1[_0x548dbb];return _0x55b491;};'use strict';var Sequelize=require(_0x111c('0x0'));var moment=require('moment');var path=require(_0x111c('0x1'));var config=require(_0x111c('0x2'));module[_0x111c('0x3')]={'format':{'type':Sequelize[_0x111c('0x4')],'get':function(){return this['getDataValue'](_0x111c('0x5'))?path[_0x111c('0x6')](this[_0x111c('0x7')](_0x111c('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0x111c('0x8')]},'channel':{'type':Sequelize[_0x111c('0x8')]},'value':{'type':Sequelize['STRING'],'set':function(_0xd1221b){var _0x223fb1=_0xd1221b[_0x111c('0x9')](/\\/g,'/');this[_0x111c('0xa')](_0x111c('0x5'),_0x223fb1);}},'rating':{'type':Sequelize[_0x111c('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x111c('0xb')],'set':function(_0x14dc02){this[_0x111c('0xa')](_0x111c('0xc'),moment()[_0x111c('0xd')](_0x14dc02,'ms'));this['setDataValue']('closedAt',moment());this['setDataValue']('duration',_0x14dc02);}},'startedAt':{'type':Sequelize[_0x111c('0xe')],'get':function(){return moment(this[_0x111c('0x7')](_0x111c('0xc')))[_0x111c('0xf')](_0x111c('0x10'))[_0x111c('0x11')]();}},'closedAt':{'type':Sequelize[_0x111c('0xe')],'get':function(){return moment(this[_0x111c('0x7')](_0x111c('0x12')))[_0x111c('0xf')](_0x111c('0x10'))[_0x111c('0x11')]();}},'createdAt':{'type':Sequelize[_0x111c('0xe')],'get':function(){return moment(this[_0x111c('0x7')](_0x111c('0x13')))[_0x111c('0xf')](_0x111c('0x10'))[_0x111c('0x11')]();}},'updatedAt':{'type':Sequelize[_0x111c('0xe')],'get':function(){return moment(this['getDataValue']('updatedAt'))['format'](_0x111c('0x10'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 4d9767a..afc25d6 100644 --- a/server/api/screenRecording/screenRecording.controller.js +++ b/server/api/screenRecording/screenRecording.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4bc3=['keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','merge','map','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','includeAll','create','body','update','duration','createdAt','value','find','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','existsSync','decryptFile','secrets','recording','Sequelize','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','json','apply','reject','destroy','then','sendStatus','stack','name','send','ScreenRecording','rawAttributes','fieldName','type','key','differenceBy','format'];(function(_0x400b11,_0x245812){var _0x36ac23=function(_0x4bccd3){while(--_0x4bccd3){_0x400b11['push'](_0x400b11['shift']());}};_0x36ac23(++_0x245812);}(_0x4bc3,0x16e));var _0x34bc=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0x4bc3[_0x45bf86];return _0x1f02b7;};'use strict';var emlformat=require(_0x34bc('0x0'));var rimraf=require(_0x34bc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x34bc('0x2'));var rp=require(_0x34bc('0x3'));var moment=require('moment');var BPromise=require(_0x34bc('0x4'));var Mustache=require(_0x34bc('0x5'));var util=require(_0x34bc('0x6'));var path=require(_0x34bc('0x7'));var sox=require(_0x34bc('0x8'));var csv=require(_0x34bc('0x9'));var ejs=require(_0x34bc('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x34bc('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x34bc('0xc'));var deskjs=require(_0x34bc('0xd'));var toCsv=require(_0x34bc('0x9'));var querystring=require(_0x34bc('0xe'));var Papa=require(_0x34bc('0xf'));var Redis=require(_0x34bc('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x34bc('0x11'));var hardwareService=require(_0x34bc('0x12'));var logger=require(_0x34bc('0x13'))('api');var utils=require(_0x34bc('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x34bc('0x15'));var db=require(_0x34bc('0x16'))['db'];function respondWithStatusCode(_0x164fb2,_0x536ebd){_0x536ebd=_0x536ebd||0xcc;return function(_0x3f8852){if(_0x3f8852){return _0x164fb2['sendStatus'](_0x536ebd);}return _0x164fb2[_0x34bc('0x17')](_0x536ebd)[_0x34bc('0x18')]();};}function respondWithResult(_0xc77013,_0x5a22a3){_0x5a22a3=_0x5a22a3||0xc8;return function(_0x4c365a){if(_0x4c365a){return _0xc77013[_0x34bc('0x17')](_0x5a22a3)['json'](_0x4c365a);}};}function respondWithFilteredResult(_0x3e93bf,_0x217605){return function(_0x1da8eb){if(_0x1da8eb){var _0x25da29=typeof _0x217605[_0x34bc('0x19')]===_0x34bc('0x1a')&&typeof _0x217605['limit']==='undefined';var _0x5a5895=_0x1da8eb[_0x34bc('0x1b')];var _0x3eaedf=_0x25da29?0x0:_0x217605[_0x34bc('0x19')];var _0x239e6c=_0x25da29?_0x1da8eb['count']:_0x217605[_0x34bc('0x19')]+_0x217605[_0x34bc('0x1c')];var _0x50106a;if(_0x239e6c>=_0x5a5895){_0x239e6c=_0x5a5895;_0x50106a=0xc8;}else{_0x50106a=0xce;}_0x3e93bf[_0x34bc('0x17')](_0x50106a);return _0x3e93bf[_0x34bc('0x1d')]('Content-Range',_0x3eaedf+'-'+_0x239e6c+'/'+_0x5a5895)[_0x34bc('0x1e')](_0x1da8eb);}return null;};}function patchUpdates(_0x26cdec){return function(_0x2d18ea){try{jsonpatch[_0x34bc('0x1f')](_0x2d18ea,_0x26cdec,!![]);}catch(_0x1f993b){return BPromise[_0x34bc('0x20')](_0x1f993b);}return _0x2d18ea['save']();};}function saveUpdates(_0x40e128,_0x3c9939){return function(_0x38882c){if(_0x38882c){return _0x38882c['update'](_0x40e128)['then'](function(_0x358d51){return _0x358d51;});}return null;};}function removeEntity(_0x1b820a,_0x4263de){return function(_0x410800){if(_0x410800){return _0x410800[_0x34bc('0x21')]()[_0x34bc('0x22')](function(){_0x1b820a[_0x34bc('0x17')](0xcc)[_0x34bc('0x18')]();});}};}function handleEntityNotFound(_0x19472e,_0x25d6fe){return function(_0x2de017){if(!_0x2de017){_0x19472e[_0x34bc('0x23')](0x194);}return _0x2de017;};}function handleError(_0x4fd589,_0x43e527){_0x43e527=_0x43e527||0x1f4;return function(_0x48ec13){logger['error'](_0x48ec13[_0x34bc('0x24')]);if(_0x48ec13['name']){delete _0x48ec13[_0x34bc('0x25')];}_0x4fd589[_0x34bc('0x17')](_0x43e527)[_0x34bc('0x26')](_0x48ec13);};}exports['index']=function(_0x2e6d96,_0x351ed8){var _0x384fd7={},_0x1a83f7={},_0x2bb874={'count':0x0,'rows':[]};var _0x33bf46=_['map'](db[_0x34bc('0x27')][_0x34bc('0x28')],function(_0x22aacc){return{'name':_0x22aacc[_0x34bc('0x29')],'type':_0x22aacc[_0x34bc('0x2a')][_0x34bc('0x2b')]};});_0x1a83f7['model']=_[_0x34bc('0x2c')](_['map'](_0x33bf46,'name'),[_0x34bc('0x2d')]);_0x1a83f7['query']=_[_0x34bc('0x2e')](_0x2e6d96[_0x34bc('0x2f')]);_0x1a83f7[_0x34bc('0x30')]=_[_0x34bc('0x31')](_0x1a83f7[_0x34bc('0x32')],_0x1a83f7[_0x34bc('0x2f')]);_0x384fd7[_0x34bc('0x33')]=_['intersection'](_0x1a83f7[_0x34bc('0x32')],qs[_0x34bc('0x34')](_0x2e6d96[_0x34bc('0x2f')][_0x34bc('0x34')]));_0x384fd7[_0x34bc('0x33')]=_0x384fd7['attributes'][_0x34bc('0x35')]?_0x384fd7[_0x34bc('0x33')]:_0x1a83f7[_0x34bc('0x32')];if(!_0x2e6d96[_0x34bc('0x2f')][_0x34bc('0x36')]('nolimit')){_0x384fd7['limit']=qs[_0x34bc('0x1c')](_0x2e6d96[_0x34bc('0x2f')][_0x34bc('0x1c')]);_0x384fd7[_0x34bc('0x19')]=qs['offset'](_0x2e6d96[_0x34bc('0x2f')][_0x34bc('0x19')]);}_0x384fd7[_0x34bc('0x37')]=qs['sort'](_0x2e6d96[_0x34bc('0x2f')][_0x34bc('0x38')]);_0x384fd7[_0x34bc('0x39')]=qs[_0x34bc('0x30')](_['pick'](_0x2e6d96[_0x34bc('0x2f')],_0x1a83f7[_0x34bc('0x30')]),_0x33bf46);if(_0x2e6d96[_0x34bc('0x2f')]['filter']){_0x384fd7[_0x34bc('0x39')]=_[_0x34bc('0x3a')](_0x384fd7[_0x34bc('0x39')],{'$or':_[_0x34bc('0x3b')](_0x33bf46,function(_0x348cea){if(_0x348cea['type']!==_0x34bc('0x3c')){var _0x281e81={};_0x281e81[_0x348cea[_0x34bc('0x25')]]={'$like':'%'+_0x2e6d96[_0x34bc('0x2f')][_0x34bc('0x3d')]+'%'};return _0x281e81;}})});}_0x384fd7=_['merge']({},_0x384fd7,_0x2e6d96[_0x34bc('0x3e')]);var _0x50f1ee={'where':_0x384fd7[_0x34bc('0x39')]};return db[_0x34bc('0x27')][_0x34bc('0x1b')](_0x50f1ee)[_0x34bc('0x22')](function(_0x53feca){_0x2bb874[_0x34bc('0x1b')]=_0x53feca;if(_0x2e6d96[_0x34bc('0x2f')]['includeAll']){_0x384fd7[_0x34bc('0x3f')]=[{'all':!![]}];}return db[_0x34bc('0x27')][_0x34bc('0x40')](_0x384fd7);})['then'](function(_0x31afd3){_0x2bb874[_0x34bc('0x41')]=_0x31afd3;return _0x2bb874;})[_0x34bc('0x22')](respondWithFilteredResult(_0x351ed8,_0x384fd7))[_0x34bc('0x42')](handleError(_0x351ed8,null));};exports[_0x34bc('0x43')]=function(_0x20debf,_0x428326){var _0x2e4059={'raw':![],'where':{'id':_0x20debf[_0x34bc('0x44')]['id']}},_0x4756c6={};_0x4756c6[_0x34bc('0x32')]=_['keys'](db['ScreenRecording'][_0x34bc('0x28')]);_0x4756c6[_0x34bc('0x2f')]=_[_0x34bc('0x2e')](_0x20debf[_0x34bc('0x2f')]);_0x4756c6[_0x34bc('0x30')]=_[_0x34bc('0x31')](_0x4756c6['model'],_0x4756c6[_0x34bc('0x2f')]);_0x2e4059['attributes']=_[_0x34bc('0x31')](_0x4756c6[_0x34bc('0x32')],qs[_0x34bc('0x34')](_0x20debf['query'][_0x34bc('0x34')]));_0x2e4059[_0x34bc('0x33')]=_0x2e4059[_0x34bc('0x33')][_0x34bc('0x35')]?_0x2e4059[_0x34bc('0x33')]:_0x4756c6[_0x34bc('0x32')];if(_0x20debf[_0x34bc('0x2f')][_0x34bc('0x45')]){_0x2e4059[_0x34bc('0x3f')]=[{'all':!![]}];}_0x2e4059=_[_0x34bc('0x3a')]({},_0x2e4059,_0x20debf[_0x34bc('0x3e')]);return db[_0x34bc('0x27')]['find'](_0x2e4059)['then'](handleEntityNotFound(_0x428326,null))[_0x34bc('0x22')](respondWithResult(_0x428326,null))[_0x34bc('0x42')](handleError(_0x428326,null));};exports[_0x34bc('0x46')]=function(_0x51116e,_0x4aafd4){return db[_0x34bc('0x27')][_0x34bc('0x46')](_0x51116e[_0x34bc('0x47')],{})['then'](respondWithResult(_0x4aafd4,0xc9))[_0x34bc('0x42')](handleError(_0x4aafd4,null));};exports[_0x34bc('0x48')]=function(_0x49286b,_0x4627de){if(_0x49286b['body']['id']){delete _0x49286b[_0x34bc('0x47')]['id'];}delete _0x49286b['body'][_0x34bc('0x49')];delete _0x49286b[_0x34bc('0x47')][_0x34bc('0x4a')];delete _0x49286b[_0x34bc('0x47')]['closedAt'];delete _0x49286b[_0x34bc('0x47')][_0x34bc('0x4b')];return db[_0x34bc('0x27')][_0x34bc('0x4c')]({'where':{'id':_0x49286b[_0x34bc('0x44')]['id']}})[_0x34bc('0x22')](handleEntityNotFound(_0x4627de,null))[_0x34bc('0x22')](saveUpdates(_0x49286b[_0x34bc('0x47')],null))['then'](respondWithResult(_0x4627de,null))['catch'](handleError(_0x4627de,null));};exports['describe']=function(_0x3a66b4,_0x1ed088){return db['ScreenRecording'][_0x34bc('0x4d')]()[_0x34bc('0x22')](respondWithResult(_0x1ed088,null))[_0x34bc('0x42')](handleError(_0x1ed088,null));};exports[_0x34bc('0x4e')]=function(_0x4562b7,_0x5c82c2,_0x5b6497){var _0x52d4c7=require(_0x34bc('0x4f'));var _0x17ce18=![];var _0x151a45={};if(_0x4562b7[_0x34bc('0x2f')][_0x34bc('0x2a')]&&_0x4562b7['query'][_0x34bc('0x2a')]===_0x34bc('0x50')){_0x151a45[_0x34bc('0x50')]=_0x4562b7[_0x34bc('0x44')]['id'];}else{_0x151a45['id']=_0x4562b7['params']['id'];}return db[_0x34bc('0x27')][_0x34bc('0x4c')]({'where':_0x151a45,'attributes':['id',_0x34bc('0x4b')],'raw':!![]})[_0x34bc('0x22')](handleEntityNotFound(_0x5c82c2,null))[_0x34bc('0x22')](function(_0x31c40b){if(_0x31c40b){var _0x21de42=path[_0x34bc('0x51')](config[_0x34bc('0x52')],_0x34bc('0x53'),_0x31c40b[_0x34bc('0x4b')]);var _0xf8f3fe=util[_0x34bc('0x2d')]('%s.cypher',_0x21de42);if(fs[_0x34bc('0x54')](_0xf8f3fe)){_0x17ce18=!![];return _0x52d4c7[_0x34bc('0x55')](_0xf8f3fe,_0x21de42,config[_0x34bc('0x56')][_0x34bc('0x57')])[_0x34bc('0x22')](function(){return _0x31c40b;});}return _0x31c40b;}})[_0x34bc('0x22')](function(_0x31cf3a){if(_0x31cf3a){var _0x43337d=path[_0x34bc('0x51')](config[_0x34bc('0x52')],_0x34bc('0x53'),_0x31cf3a[_0x34bc('0x4b')]);if(!fs[_0x34bc('0x54')](_0x43337d)){throw new db[(_0x34bc('0x58'))]['ValidationError'](_0x34bc('0x59'));}if(_0x31cf3a[_0x34bc('0x5a')]){return _0x5c82c2[_0x34bc('0x4e')](_0x43337d,_0x31cf3a[_0x34bc('0x5a')]+path[_0x34bc('0x5b')](_0x43337d),function(){if(_0x17ce18){fs[_0x34bc('0x5c')](_0x43337d);}});}else{return _0x5c82c2[_0x34bc('0x4e')](_0x43337d,function(_0x36d2fb){if(_0x17ce18){fs[_0x34bc('0x5c')](_0x43337d);}});}}})[_0x34bc('0x42')](function(_0x5ba13a){if(_0x5ba13a[_0x34bc('0x5d')]===_0x34bc('0x59')){_0x5c82c2[_0x34bc('0x17')](0x194)['send'](_0x34bc('0x5e'));}else{return handleError(_0x5c82c2,null);}});};exports[_0x34bc('0x21')]=function(_0x9dd563,_0x3b087){return db['ScreenRecording'][_0x34bc('0x4c')]({'where':{'id':_0x9dd563[_0x34bc('0x44')]['id']}})[_0x34bc('0x22')](function(_0xfbc469){if(_[_0x34bc('0x5f')](_0xfbc469)){throw new ReferenceError(_0x34bc('0x60'));}return _0xfbc469;})[_0x34bc('0x22')](function(_0x3b8f72){var _0x4e9409=path['join'](config[_0x34bc('0x52')],_0x34bc('0x53'),_0x3b8f72[_0x34bc('0x4b')]);logger[_0x34bc('0x61')](_0x34bc('0x62'),_0x4e9409);if(!_[_0x34bc('0x5f')](_0x3b8f72[_0x34bc('0x4b')])&&fs[_0x34bc('0x54')](_0x4e9409)){logger[_0x34bc('0x61')](_0x34bc('0x63')+_0x4e9409+_0x34bc('0x64'));fs[_0x34bc('0x65')](_0x4e9409);}_0x4e9409=_0x4e9409+_0x34bc('0x66');if(!_[_0x34bc('0x5f')](_0x3b8f72['value'])&&fs[_0x34bc('0x54')](_0x4e9409)){logger[_0x34bc('0x61')](_0x34bc('0x63')+_0x4e9409+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x34bc('0x65')](_0x4e9409);}return _0x3b8f72;})[_0x34bc('0x22')](function(_0x124945){if(!_0x124945)throw new InternalError();return _0x124945[_0x34bc('0x21')]();})['then'](function(){_0x3b087[_0x34bc('0x17')](0xcc)[_0x34bc('0x18')]();})[_0x34bc('0x42')](handleError(_0x3b087,null));}; \ No newline at end of file +var _0xed1f=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','ScreenRecording','rawAttributes','fieldName','type','key','differenceBy','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','show','params','merge','options','catch','create','body','duration','createdAt','closedAt','value','find','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','format','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','filename','extname','unlink','message','ScreenRecording\x20not\x20found','Not\x20found','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','eml-format','rimraf'];(function(_0x7c27e7,_0x334f3b){var _0x33f893=function(_0x392aa7){while(--_0x392aa7){_0x7c27e7['push'](_0x7c27e7['shift']());}};_0x33f893(++_0x334f3b);}(_0xed1f,0x6a));var _0xfed1=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0xed1f[_0x2112d4];return _0x434972;};'use strict';var emlformat=require(_0xfed1('0x0'));var rimraf=require(_0xfed1('0x1'));var zipdir=require(_0xfed1('0x2'));var jsonpatch=require(_0xfed1('0x3'));var rp=require(_0xfed1('0x4'));var moment=require(_0xfed1('0x5'));var BPromise=require(_0xfed1('0x6'));var Mustache=require(_0xfed1('0x7'));var util=require(_0xfed1('0x8'));var path=require(_0xfed1('0x9'));var sox=require(_0xfed1('0xa'));var csv=require(_0xfed1('0xb'));var ejs=require(_0xfed1('0xc'));var fs=require('fs');var fs_extra=require(_0xfed1('0xd'));var _=require(_0xfed1('0xe'));var squel=require(_0xfed1('0xf'));var crypto=require(_0xfed1('0x10'));var jsforce=require(_0xfed1('0x11'));var deskjs=require('desk.js');var toCsv=require(_0xfed1('0xb'));var querystring=require(_0xfed1('0x12'));var Papa=require('papaparse');var Redis=require(_0xfed1('0x13'));var authService=require(_0xfed1('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xfed1('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfed1('0x16'))(_0xfed1('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfed1('0x18'));var db=require(_0xfed1('0x19'))['db'];function respondWithStatusCode(_0x569a6e,_0x17f4fe){_0x17f4fe=_0x17f4fe||0xcc;return function(_0x5a3469){if(_0x5a3469){return _0x569a6e['sendStatus'](_0x17f4fe);}return _0x569a6e[_0xfed1('0x1a')](_0x17f4fe)[_0xfed1('0x1b')]();};}function respondWithResult(_0x532537,_0x2dde3a){_0x2dde3a=_0x2dde3a||0xc8;return function(_0x5b9455){if(_0x5b9455){return _0x532537['status'](_0x2dde3a)[_0xfed1('0x1c')](_0x5b9455);}};}function respondWithFilteredResult(_0x39aa0c,_0x1fbb7a){return function(_0x123c46){if(_0x123c46){var _0x582e67=typeof _0x1fbb7a[_0xfed1('0x1d')]==='undefined'&&typeof _0x1fbb7a[_0xfed1('0x1e')]===_0xfed1('0x1f');var _0x489a0f=_0x123c46[_0xfed1('0x20')];var _0xa72a20=_0x582e67?0x0:_0x1fbb7a['offset'];var _0x59509b=_0x582e67?_0x123c46['count']:_0x1fbb7a[_0xfed1('0x1d')]+_0x1fbb7a['limit'];var _0x201f18;if(_0x59509b>=_0x489a0f){_0x59509b=_0x489a0f;_0x201f18=0xc8;}else{_0x201f18=0xce;}_0x39aa0c[_0xfed1('0x1a')](_0x201f18);return _0x39aa0c['set'](_0xfed1('0x21'),_0xa72a20+'-'+_0x59509b+'/'+_0x489a0f)[_0xfed1('0x1c')](_0x123c46);}return null;};}function patchUpdates(_0x59ee9d){return function(_0x3ce944){try{jsonpatch[_0xfed1('0x22')](_0x3ce944,_0x59ee9d,!![]);}catch(_0xff4842){return BPromise[_0xfed1('0x23')](_0xff4842);}return _0x3ce944['save']();};}function saveUpdates(_0x203cec,_0x59333e){return function(_0x446558){if(_0x446558){return _0x446558[_0xfed1('0x24')](_0x203cec)[_0xfed1('0x25')](function(_0x532ec2){return _0x532ec2;});}return null;};}function removeEntity(_0x41d22c,_0x594917){return function(_0x460555){if(_0x460555){return _0x460555[_0xfed1('0x26')]()[_0xfed1('0x25')](function(){_0x41d22c[_0xfed1('0x1a')](0xcc)[_0xfed1('0x1b')]();});}};}function handleEntityNotFound(_0x1199b7,_0x527fc7){return function(_0x465ce6){if(!_0x465ce6){_0x1199b7[_0xfed1('0x27')](0x194);}return _0x465ce6;};}function handleError(_0x49072b,_0x1d6c72){_0x1d6c72=_0x1d6c72||0x1f4;return function(_0x2b9dd2){logger[_0xfed1('0x28')](_0x2b9dd2[_0xfed1('0x29')]);if(_0x2b9dd2[_0xfed1('0x2a')]){delete _0x2b9dd2[_0xfed1('0x2a')];}_0x49072b['status'](_0x1d6c72)[_0xfed1('0x2b')](_0x2b9dd2);};}exports['index']=function(_0x3106ee,_0x4e5249){var _0x53b0c9={},_0x1cec64={},_0x42c950={'count':0x0,'rows':[]};var _0x2d334e=_['map'](db[_0xfed1('0x2c')][_0xfed1('0x2d')],function(_0x13f414){return{'name':_0x13f414[_0xfed1('0x2e')],'type':_0x13f414[_0xfed1('0x2f')][_0xfed1('0x30')]};});_0x1cec64['model']=_[_0xfed1('0x31')](_[_0xfed1('0x32')](_0x2d334e,'name'),['format']);_0x1cec64[_0xfed1('0x33')]=_[_0xfed1('0x34')](_0x3106ee[_0xfed1('0x33')]);_0x1cec64[_0xfed1('0x35')]=_[_0xfed1('0x36')](_0x1cec64['model'],_0x1cec64[_0xfed1('0x33')]);_0x53b0c9[_0xfed1('0x37')]=_[_0xfed1('0x36')](_0x1cec64[_0xfed1('0x38')],qs[_0xfed1('0x39')](_0x3106ee['query'][_0xfed1('0x39')]));_0x53b0c9['attributes']=_0x53b0c9[_0xfed1('0x37')][_0xfed1('0x3a')]?_0x53b0c9[_0xfed1('0x37')]:_0x1cec64[_0xfed1('0x38')];if(!_0x3106ee[_0xfed1('0x33')][_0xfed1('0x3b')](_0xfed1('0x3c'))){_0x53b0c9[_0xfed1('0x1e')]=qs['limit'](_0x3106ee[_0xfed1('0x33')][_0xfed1('0x1e')]);_0x53b0c9[_0xfed1('0x1d')]=qs[_0xfed1('0x1d')](_0x3106ee['query']['offset']);}_0x53b0c9[_0xfed1('0x3d')]=qs[_0xfed1('0x3e')](_0x3106ee[_0xfed1('0x33')][_0xfed1('0x3e')]);_0x53b0c9[_0xfed1('0x3f')]=qs[_0xfed1('0x35')](_[_0xfed1('0x40')](_0x3106ee[_0xfed1('0x33')],_0x1cec64['filters']),_0x2d334e);if(_0x3106ee['query'][_0xfed1('0x41')]){_0x53b0c9[_0xfed1('0x3f')]=_['merge'](_0x53b0c9[_0xfed1('0x3f')],{'$or':_[_0xfed1('0x32')](_0x2d334e,function(_0x3b0973){if(_0x3b0973[_0xfed1('0x2f')]!==_0xfed1('0x42')){var _0x31ffeb={};_0x31ffeb[_0x3b0973[_0xfed1('0x2a')]]={'$like':'%'+_0x3106ee[_0xfed1('0x33')][_0xfed1('0x41')]+'%'};return _0x31ffeb;}})});}_0x53b0c9=_['merge']({},_0x53b0c9,_0x3106ee['options']);var _0x5598dc={'where':_0x53b0c9[_0xfed1('0x3f')]};return db[_0xfed1('0x2c')][_0xfed1('0x20')](_0x5598dc)['then'](function(_0x3454e6){_0x42c950['count']=_0x3454e6;if(_0x3106ee[_0xfed1('0x33')][_0xfed1('0x43')]){_0x53b0c9[_0xfed1('0x44')]=[{'all':!![]}];}return db['ScreenRecording'][_0xfed1('0x45')](_0x53b0c9);})[_0xfed1('0x25')](function(_0x422433){_0x42c950['rows']=_0x422433;return _0x42c950;})[_0xfed1('0x25')](respondWithFilteredResult(_0x4e5249,_0x53b0c9))['catch'](handleError(_0x4e5249,null));};exports[_0xfed1('0x46')]=function(_0xf1f739,_0x229fc7){var _0x13c087={'raw':![],'where':{'id':_0xf1f739[_0xfed1('0x47')]['id']}},_0x1bfbe8={};_0x1bfbe8[_0xfed1('0x38')]=_[_0xfed1('0x34')](db[_0xfed1('0x2c')]['rawAttributes']);_0x1bfbe8[_0xfed1('0x33')]=_[_0xfed1('0x34')](_0xf1f739[_0xfed1('0x33')]);_0x1bfbe8['filters']=_['intersection'](_0x1bfbe8[_0xfed1('0x38')],_0x1bfbe8[_0xfed1('0x33')]);_0x13c087[_0xfed1('0x37')]=_[_0xfed1('0x36')](_0x1bfbe8[_0xfed1('0x38')],qs[_0xfed1('0x39')](_0xf1f739[_0xfed1('0x33')][_0xfed1('0x39')]));_0x13c087[_0xfed1('0x37')]=_0x13c087[_0xfed1('0x37')][_0xfed1('0x3a')]?_0x13c087[_0xfed1('0x37')]:_0x1bfbe8['model'];if(_0xf1f739[_0xfed1('0x33')][_0xfed1('0x43')]){_0x13c087[_0xfed1('0x44')]=[{'all':!![]}];}_0x13c087=_[_0xfed1('0x48')]({},_0x13c087,_0xf1f739[_0xfed1('0x49')]);return db[_0xfed1('0x2c')]['find'](_0x13c087)[_0xfed1('0x25')](handleEntityNotFound(_0x229fc7,null))[_0xfed1('0x25')](respondWithResult(_0x229fc7,null))[_0xfed1('0x4a')](handleError(_0x229fc7,null));};exports['create']=function(_0x22874a,_0x10f98d){return db[_0xfed1('0x2c')][_0xfed1('0x4b')](_0x22874a['body'],{})[_0xfed1('0x25')](respondWithResult(_0x10f98d,0xc9))[_0xfed1('0x4a')](handleError(_0x10f98d,null));};exports[_0xfed1('0x24')]=function(_0x42761f,_0x14745e){if(_0x42761f[_0xfed1('0x4c')]['id']){delete _0x42761f[_0xfed1('0x4c')]['id'];}delete _0x42761f[_0xfed1('0x4c')][_0xfed1('0x4d')];delete _0x42761f[_0xfed1('0x4c')][_0xfed1('0x4e')];delete _0x42761f[_0xfed1('0x4c')][_0xfed1('0x4f')];delete _0x42761f[_0xfed1('0x4c')][_0xfed1('0x50')];return db[_0xfed1('0x2c')][_0xfed1('0x51')]({'where':{'id':_0x42761f[_0xfed1('0x47')]['id']}})['then'](handleEntityNotFound(_0x14745e,null))['then'](saveUpdates(_0x42761f[_0xfed1('0x4c')],null))[_0xfed1('0x25')](respondWithResult(_0x14745e,null))[_0xfed1('0x4a')](handleError(_0x14745e,null));};exports[_0xfed1('0x52')]=function(_0x5da599,_0x3c2534){return db[_0xfed1('0x2c')]['describe']()['then'](respondWithResult(_0x3c2534,null))['catch'](handleError(_0x3c2534,null));};exports[_0xfed1('0x53')]=function(_0x1aaa3d,_0x15e90f,_0x1d8ef2){var _0x2665c8=require(_0xfed1('0x54'));var _0x1a9f22=![];var _0x144102={};if(_0x1aaa3d[_0xfed1('0x33')][_0xfed1('0x2f')]&&_0x1aaa3d['query']['type']===_0xfed1('0x55')){_0x144102[_0xfed1('0x55')]=_0x1aaa3d[_0xfed1('0x47')]['id'];}else{_0x144102['id']=_0x1aaa3d[_0xfed1('0x47')]['id'];}return db[_0xfed1('0x2c')][_0xfed1('0x51')]({'where':_0x144102,'attributes':['id',_0xfed1('0x50')],'raw':!![]})[_0xfed1('0x25')](handleEntityNotFound(_0x15e90f,null))[_0xfed1('0x25')](function(_0x427fa6){if(_0x427fa6){var _0xbd49dc=path[_0xfed1('0x56')](config[_0xfed1('0x57')],_0xfed1('0x58'),_0x427fa6[_0xfed1('0x50')]);var _0x3a7a42=util[_0xfed1('0x59')]('%s.cypher',_0xbd49dc);if(fs['existsSync'](_0x3a7a42)){_0x1a9f22=!![];return _0x2665c8[_0xfed1('0x5a')](_0x3a7a42,_0xbd49dc,config[_0xfed1('0x5b')][_0xfed1('0x5c')])[_0xfed1('0x25')](function(){return _0x427fa6;});}return _0x427fa6;}})[_0xfed1('0x25')](function(_0x41a22a){if(_0x41a22a){var _0x2ccdc3=path[_0xfed1('0x56')](config[_0xfed1('0x57')],_0xfed1('0x58'),_0x41a22a[_0xfed1('0x50')]);if(!fs[_0xfed1('0x5d')](_0x2ccdc3)){throw new db[(_0xfed1('0x5e'))][(_0xfed1('0x5f'))]('ScreenRecording\x20not\x20found');}if(_0x41a22a[_0xfed1('0x60')]){return _0x15e90f['download'](_0x2ccdc3,_0x41a22a['filename']+path[_0xfed1('0x61')](_0x2ccdc3),function(){if(_0x1a9f22){fs['unlink'](_0x2ccdc3);}});}else{return _0x15e90f[_0xfed1('0x53')](_0x2ccdc3,function(_0x5acc45){if(_0x1a9f22){fs[_0xfed1('0x62')](_0x2ccdc3);}});}}})[_0xfed1('0x4a')](function(_0x53f0ab){if(_0x53f0ab[_0xfed1('0x63')]===_0xfed1('0x64')){_0x15e90f['status'](0x194)[_0xfed1('0x2b')](_0xfed1('0x65'));}else{return handleError(_0x15e90f,null);}});};exports[_0xfed1('0x26')]=function(_0x2f37b9,_0x59a23a){return db[_0xfed1('0x2c')][_0xfed1('0x51')]({'where':{'id':_0x2f37b9[_0xfed1('0x47')]['id']}})[_0xfed1('0x25')](function(_0x23347a){if(_[_0xfed1('0x66')](_0x23347a)){throw new ReferenceError(_0xfed1('0x67'));}return _0x23347a;})[_0xfed1('0x25')](function(_0x5c043d){var _0x2d66ec=path[_0xfed1('0x56')](config[_0xfed1('0x57')],_0xfed1('0x58'),_0x5c043d[_0xfed1('0x50')]);logger[_0xfed1('0x68')]('cancellazione\x20fisica\x20documento\x20%s',_0x2d66ec);if(!_['isNil'](_0x5c043d['value'])&&fs[_0xfed1('0x5d')](_0x2d66ec)){logger[_0xfed1('0x68')](_0xfed1('0x69')+_0x2d66ec+_0xfed1('0x6a'));fs['unlinkSync'](_0x2d66ec);}_0x2d66ec=_0x2d66ec+_0xfed1('0x6b');if(!_['isNil'](_0x5c043d[_0xfed1('0x50')])&&fs[_0xfed1('0x5d')](_0x2d66ec)){logger[_0xfed1('0x68')](_0xfed1('0x69')+_0x2d66ec+_0xfed1('0x6a'));fs['unlinkSync'](_0x2d66ec);}return _0x5c043d;})[_0xfed1('0x25')](function(_0x6b74cb){if(!_0x6b74cb)throw new InternalError();return _0x6b74cb[_0xfed1('0x26')]();})['then'](function(){_0x59a23a[_0xfed1('0x1a')](0xcc)[_0xfed1('0x1b')]();})[_0xfed1('0x4a')](handleError(_0x59a23a,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 9b72982..73879c1 100644 --- a/server/api/screenRecording/screenRecording.model.js +++ b/server/api/screenRecording/screenRecording.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3991=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','../../config/logger'];(function(_0x5aab27,_0x32a9ab){var _0x22dddd=function(_0x21367e){while(--_0x21367e){_0x5aab27['push'](_0x5aab27['shift']());}};_0x22dddd(++_0x32a9ab);}(_0x3991,0xd6));var _0x1399=function(_0x2a0398,_0x1df18e){_0x2a0398=_0x2a0398-0x0;var _0x1a7997=_0x3991[_0x2a0398];return _0x1a7997;};'use strict';var _=require(_0x1399('0x0'));var util=require('util');var logger=require(_0x1399('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1399('0x2'));var rp=require(_0x1399('0x3'));var fs=require('fs');var path=require(_0x1399('0x4'));var rimraf=require(_0x1399('0x5'));var config=require(_0x1399('0x6'));var attributes=require('./screenRecording.attributes');module[_0x1399('0x7')]=function(_0x3c6f6a,_0x15637b){return _0x3c6f6a[_0x1399('0x8')](_0x1399('0x9'),attributes,{'tableName':_0x1399('0xa'),'paranoid':![],'indexes':[{'name':_0x1399('0xb'),'fields':[_0x1399('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xeda7=['request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','ScreenRecording','screen_recordings','interactionid','../../config/logger','api','moment','bluebird'];(function(_0x2f5997,_0x6c1b74){var _0x3369b5=function(_0x326163){while(--_0x326163){_0x2f5997['push'](_0x2f5997['shift']());}};_0x3369b5(++_0x6c1b74);}(_0xeda7,0x194));var _0x7eda=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xeda7[_0x565c49];return _0x20ca34;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7eda('0x0'))(_0x7eda('0x1'));var moment=require(_0x7eda('0x2'));var BPromise=require(_0x7eda('0x3'));var rp=require(_0x7eda('0x4'));var fs=require('fs');var path=require(_0x7eda('0x5'));var rimraf=require(_0x7eda('0x6'));var config=require(_0x7eda('0x7'));var attributes=require(_0x7eda('0x8'));module['exports']=function(_0x213c4a,_0x400ce1){return _0x213c4a['define'](_0x7eda('0x9'),attributes,{'tableName':_0x7eda('0xa'),'paranoid':![],'indexes':[{'name':_0x7eda('0xb'),'fields':[_0x7eda('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 19f4169..8c69d4f 100644 --- a/server/api/screenRecording/screenRecording.rpc.js +++ b/server/api/screenRecording/screenRecording.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4ed9=['debug','ScreenRecording,\x20%s,\x20%s,\x20%s','error','code','message','info','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ScreenRecording,\x20%s,\x20%s','request\x20sent'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0x4ed9,0x13a));var _0x94ed=function(_0x3d2a33,_0x76d73f){_0x3d2a33=_0x3d2a33-0x0;var _0x210589=_0x4ed9[_0x3d2a33];return _0x210589;};'use strict';var _=require(_0x94ed('0x0'));var util=require(_0x94ed('0x1'));var moment=require(_0x94ed('0x2'));var BPromise=require(_0x94ed('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x94ed('0x4'));var db=require(_0x94ed('0x5'))['db'];var utils=require(_0x94ed('0x6'));var logger=require('../../config/logger')(_0x94ed('0x7'));var config=require(_0x94ed('0x8'));var jayson=require(_0x94ed('0x9'));var client=jayson[_0x94ed('0xa')][_0x94ed('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17744a,_0x1fa260,_0x5c2a80){return new BPromise(function(_0x19fd1f,_0x38d22c){return client[_0x94ed('0xc')](_0x17744a,_0x5c2a80)[_0x94ed('0xd')](function(_0x2ea255){logger['info'](_0x94ed('0xe'),_0x1fa260,_0x94ed('0xf'));logger[_0x94ed('0x10')](_0x94ed('0x11'),_0x1fa260,_0x94ed('0xf'),JSON['stringify'](_0x2ea255));if(_0x2ea255['error']){if(_0x2ea255[_0x94ed('0x12')][_0x94ed('0x13')]===0x1f4){logger[_0x94ed('0x12')](_0x94ed('0xe'),_0x1fa260,_0x2ea255[_0x94ed('0x12')][_0x94ed('0x14')]);return _0x38d22c(_0x2ea255[_0x94ed('0x12')]['message']);}logger[_0x94ed('0x12')]('ScreenRecording,\x20%s,\x20%s',_0x1fa260,_0x2ea255[_0x94ed('0x12')][_0x94ed('0x14')]);return _0x19fd1f(_0x2ea255[_0x94ed('0x12')]['message']);}else{logger[_0x94ed('0x15')]('ScreenRecording,\x20%s,\x20%s',_0x1fa260,_0x94ed('0xf'));_0x19fd1f(_0x2ea255['result'][_0x94ed('0x14')]);}})['catch'](function(_0x112e67){logger[_0x94ed('0x12')](_0x94ed('0xe'),_0x1fa260,_0x112e67);_0x38d22c(_0x112e67);});});} \ No newline at end of file +var _0x3fd8=['then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xd511d,_0x3546b9){var _0x3f148e=function(_0x51f35f){while(--_0x51f35f){_0xd511d['push'](_0xd511d['shift']());}};_0x3f148e(++_0x3546b9);}(_0x3fd8,0x14d));var _0x83fd=function(_0x418b6e,_0x32b11a){_0x418b6e=_0x418b6e-0x0;var _0x2c14be=_0x3fd8[_0x418b6e];return _0x2c14be;};'use strict';var _=require(_0x83fd('0x0'));var util=require(_0x83fd('0x1'));var moment=require(_0x83fd('0x2'));var BPromise=require('bluebird');var rs=require(_0x83fd('0x3'));var fs=require('fs');var Redis=require(_0x83fd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x83fd('0x5'));var logger=require(_0x83fd('0x6'))(_0x83fd('0x7'));var config=require(_0x83fd('0x8'));var jayson=require(_0x83fd('0x9'));var client=jayson[_0x83fd('0xa')][_0x83fd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11430c,_0x1496c7,_0x226dc5){return new BPromise(function(_0x20791a,_0x5e976d){return client['request'](_0x11430c,_0x226dc5)[_0x83fd('0xc')](function(_0x124a58){logger[_0x83fd('0xd')](_0x83fd('0xe'),_0x1496c7,_0x83fd('0xf'));logger[_0x83fd('0x10')](_0x83fd('0x11'),_0x1496c7,'request\x20sent',JSON['stringify'](_0x124a58));if(_0x124a58[_0x83fd('0x12')]){if(_0x124a58[_0x83fd('0x12')][_0x83fd('0x13')]===0x1f4){logger[_0x83fd('0x12')](_0x83fd('0xe'),_0x1496c7,_0x124a58[_0x83fd('0x12')][_0x83fd('0x14')]);return _0x5e976d(_0x124a58[_0x83fd('0x12')][_0x83fd('0x14')]);}logger[_0x83fd('0x12')](_0x83fd('0xe'),_0x1496c7,_0x124a58[_0x83fd('0x12')][_0x83fd('0x14')]);return _0x20791a(_0x124a58[_0x83fd('0x12')][_0x83fd('0x14')]);}else{logger[_0x83fd('0xd')](_0x83fd('0xe'),_0x1496c7,_0x83fd('0xf'));_0x20791a(_0x124a58[_0x83fd('0x15')]['message']);}})[_0x83fd('0x16')](function(_0x1298b2){logger[_0x83fd('0x12')](_0x83fd('0xe'),_0x1496c7,_0x1298b2);_0x5e976d(_0x1298b2);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index d9ad6b7..6d21d79 100644 --- a/server/api/setting/index.js +++ b/server/api/setting/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1598=['getFavicon','diskStorage','join','root','server/files/images/logos/','%s%s','logo','extname','post','single','file','addLogo','format','logologin','addLogoLogin','favicon','originalname','addFavicon','put','isAuthenticated','update','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','getDate','/:id','show','/:id/logo','getLogo','/:id/gdpr','gdpr','getPreferred'];(function(_0x1f794b,_0x1aafe6){var _0x22f5cb=function(_0x198d11){while(--_0x198d11){_0x1f794b['push'](_0x1f794b['shift']());}};_0x22f5cb(++_0x1aafe6);}(_0x1598,0x1c3));var _0x8159=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1598[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x8159('0x0'));var util=require('util');var path=require(_0x8159('0x1'));var timeout=require(_0x8159('0x2'));var express=require('express');var router=express[_0x8159('0x3')]();var fs_extra=require(_0x8159('0x4'));var auth=require(_0x8159('0x5'));var interaction=require(_0x8159('0x6'));var config=require(_0x8159('0x7'));var controller=require('./setting.controller');router[_0x8159('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/now',controller[_0x8159('0x9')]);router[_0x8159('0x8')](_0x8159('0xa'),controller[_0x8159('0xb')]);router[_0x8159('0x8')](_0x8159('0xc'),controller[_0x8159('0xd')]);router['get']('/:id/logo_login',controller['getLogoLogin']);router['get'](_0x8159('0xe'),controller[_0x8159('0xf')]);router['get']('/:id/preferred',controller[_0x8159('0x10')]);router['get']('/:id/favicon',controller[_0x8159('0x11')]);var upload=multer({'storage':multer[_0x8159('0x12')]({'destination':function(_0x3f8b8c,_0x29dbe8,_0x3f375c){_0x3f375c(null,path[_0x8159('0x13')](config[_0x8159('0x14')],_0x8159('0x15')));},'filename':function(_0x392583,_0x441a69,_0x34471c){_0x34471c(null,util['format'](_0x8159('0x16'),_0x8159('0x17'),path[_0x8159('0x18')](_0x441a69['originalname'])));}})});router[_0x8159('0x19')](_0x8159('0xc'),upload[_0x8159('0x1a')](_0x8159('0x1b')),controller[_0x8159('0x1c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x13cb0e,_0x27604b,_0xc42cce){_0xc42cce(null,path['join'](config['root'],'server/files/images/logos/'));},'filename':function(_0x39db0a,_0x2ef429,_0x2e9c21){_0x2e9c21(null,util[_0x8159('0x1d')]('%s%s',_0x8159('0x1e'),path[_0x8159('0x18')](_0x2ef429['originalname'])));}})});router[_0x8159('0x19')]('/:id/logo_login',upload[_0x8159('0x1a')](_0x8159('0x1b')),controller[_0x8159('0x1f')]);var upload=multer({'storage':multer[_0x8159('0x12')]({'destination':function(_0x59f007,_0x450b58,_0xea16b7){_0xea16b7(null,path[_0x8159('0x13')](config[_0x8159('0x14')],_0x8159('0x15')));},'filename':function(_0xe09666,_0x1793ec,_0x28e865){_0x28e865(null,util[_0x8159('0x1d')]('%s%s','preferred',path[_0x8159('0x18')](_0x1793ec['originalname'])));}})});router[_0x8159('0x19')]('/:id/preferred',upload['single']('file'),controller['addPreferred']);var upload=multer({'storage':multer[_0x8159('0x12')]({'destination':function(_0x48b84d,_0x59972b,_0x1ac088){_0x1ac088(null,path[_0x8159('0x13')](config[_0x8159('0x14')],_0x8159('0x15')));},'filename':function(_0xeb5fe8,_0x2a0722,_0x404939){_0x404939(null,util[_0x8159('0x1d')](_0x8159('0x16'),_0x8159('0x20'),path[_0x8159('0x18')](_0x2a0722[_0x8159('0x21')])));}})});router[_0x8159('0x19')]('/:id/favicon',upload[_0x8159('0x1a')](_0x8159('0x1b')),controller[_0x8159('0x22')]);router[_0x8159('0x23')](_0x8159('0xa'),auth[_0x8159('0x24')](),controller[_0x8159('0x25')]);module[_0x8159('0x26')]=router; \ No newline at end of file +var _0x1d45=['diskStorage','root','server/files/images/logos/','format','logo','extname','originalname','single','addLogo','join','%s%s','logologin','/:id/logo_login','addLogoLogin','preferred','post','/:id/preferred','addPreferred','favicon','file','addFavicon','put','update','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','isAuthenticated','index','get','/:id','show','/:id/logo','getLogoLogin','/:id/gdpr','/:id/favicon','getFavicon'];(function(_0x321524,_0x329f4a){var _0x5b6921=function(_0x527c09){while(--_0x527c09){_0x321524['push'](_0x321524['shift']());}};_0x5b6921(++_0x329f4a);}(_0x1d45,0xc4));var _0x51d4=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0x1d45[_0x5a95fa];return _0x1a61b8;};'use strict';var multer=require(_0x51d4('0x0'));var util=require(_0x51d4('0x1'));var path=require('path');var timeout=require(_0x51d4('0x2'));var express=require(_0x51d4('0x3'));var router=express[_0x51d4('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x51d4('0x5'));var interaction=require(_0x51d4('0x6'));var config=require(_0x51d4('0x7'));var controller=require(_0x51d4('0x8'));router['get']('/',auth[_0x51d4('0x9')](),controller[_0x51d4('0xa')]);router[_0x51d4('0xb')]('/now',controller['getDate']);router[_0x51d4('0xb')](_0x51d4('0xc'),controller[_0x51d4('0xd')]);router[_0x51d4('0xb')](_0x51d4('0xe'),controller['getLogo']);router[_0x51d4('0xb')]('/:id/logo_login',controller[_0x51d4('0xf')]);router[_0x51d4('0xb')](_0x51d4('0x10'),controller['gdpr']);router[_0x51d4('0xb')]('/:id/preferred',controller['getPreferred']);router['get'](_0x51d4('0x11'),controller[_0x51d4('0x12')]);var upload=multer({'storage':multer[_0x51d4('0x13')]({'destination':function(_0x5f2ef3,_0xcec528,_0x4ce622){_0x4ce622(null,path['join'](config[_0x51d4('0x14')],_0x51d4('0x15')));},'filename':function(_0x5628e3,_0x50f18e,_0x3e5163){_0x3e5163(null,util[_0x51d4('0x16')]('%s%s',_0x51d4('0x17'),path[_0x51d4('0x18')](_0x50f18e[_0x51d4('0x19')])));}})});router['post'](_0x51d4('0xe'),upload[_0x51d4('0x1a')]('file'),controller[_0x51d4('0x1b')]);var upload=multer({'storage':multer[_0x51d4('0x13')]({'destination':function(_0x25cb39,_0x3c5cff,_0x4d7489){_0x4d7489(null,path[_0x51d4('0x1c')](config[_0x51d4('0x14')],_0x51d4('0x15')));},'filename':function(_0x4f5470,_0x3c3a10,_0x57b215){_0x57b215(null,util[_0x51d4('0x16')](_0x51d4('0x1d'),_0x51d4('0x1e'),path[_0x51d4('0x18')](_0x3c3a10[_0x51d4('0x19')])));}})});router['post'](_0x51d4('0x1f'),upload['single']('file'),controller[_0x51d4('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3687ba,_0x223f2f,_0x17fa9c){_0x17fa9c(null,path[_0x51d4('0x1c')](config['root'],_0x51d4('0x15')));},'filename':function(_0x4b3ac2,_0x4a7bb8,_0x356a82){_0x356a82(null,util[_0x51d4('0x16')](_0x51d4('0x1d'),_0x51d4('0x21'),path[_0x51d4('0x18')](_0x4a7bb8[_0x51d4('0x19')])));}})});router[_0x51d4('0x22')](_0x51d4('0x23'),upload[_0x51d4('0x1a')]('file'),controller[_0x51d4('0x24')]);var upload=multer({'storage':multer[_0x51d4('0x13')]({'destination':function(_0x4182d4,_0x44d43b,_0x399815){_0x399815(null,path[_0x51d4('0x1c')](config[_0x51d4('0x14')],_0x51d4('0x15')));},'filename':function(_0x3c1f35,_0xb60db8,_0x39c1cd){_0x39c1cd(null,util[_0x51d4('0x16')](_0x51d4('0x1d'),_0x51d4('0x25'),path['extname'](_0xb60db8[_0x51d4('0x19')])));}})});router[_0x51d4('0x22')](_0x51d4('0x11'),upload[_0x51d4('0x1a')](_0x51d4('0x26')),controller[_0x51d4('0x27')]);router[_0x51d4('0x28')](_0x51d4('0xc'),auth[_0x51d4('0x9')](),controller[_0x51d4('0x29')]);module[_0x51d4('0x2a')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 21b5220..db07ffc 100644 --- a/server/api/setting/setting.attributes.js +++ b/server/api/setting/setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x5a742f,_0x383a17){var _0x5c905f=function(_0x2cc5a6){while(--_0x2cc5a6){_0x5a742f['push'](_0x5a742f['shift']());}};_0x5c905f(++_0x383a17);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file +var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x255ed4,_0x5b1f9d){var _0x5ed6ff=function(_0x32b713){while(--_0x32b713){_0x255ed4['push'](_0x255ed4['shift']());}};_0x5ed6ff(++_0x5b1f9d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index e4329db..04e12cc 100644 --- a/server/api/setting/setting.controller.js +++ b/server/api/setting/setting.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x60e6=['json','undefined','limit','offset','set','reject','save','update','destroy','stack','name','send','map','Setting','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','params','find','body','addLogo','file','filename','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','root','toLower','join','default','upperFirst','default_logo.svg','existsSync','Sequelize','ValidationError','logo','\x20not\x20found','download','getLogoLogin','default_loginLogo.svg','custom','securePassword','addPreferred','preferred','getPreferred','default_preferred.png','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end'];(function(_0x331e4a,_0x1dca1c){var _0x85cd10=function(_0x31fd6a){while(--_0x31fd6a){_0x331e4a['push'](_0x331e4a['shift']());}};_0x85cd10(++_0x1dca1c);}(_0x60e6,0xd2));var _0x660e=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x60e6[_0x1589dd];return _0x1bddd1;};'use strict';var emlformat=require(_0x660e('0x0'));var rimraf=require(_0x660e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x660e('0x2'));var moment=require(_0x660e('0x3'));var BPromise=require(_0x660e('0x4'));var Mustache=require(_0x660e('0x5'));var util=require(_0x660e('0x6'));var path=require(_0x660e('0x7'));var sox=require(_0x660e('0x8'));var csv=require(_0x660e('0x9'));var ejs=require(_0x660e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x660e('0xb'));var squel=require(_0x660e('0xc'));var crypto=require(_0x660e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x660e('0xe'));var toCsv=require(_0x660e('0x9'));var querystring=require('querystring');var Papa=require(_0x660e('0xf'));var Redis=require(_0x660e('0x10'));var authService=require(_0x660e('0x11'));var qs=require(_0x660e('0x12'));var as=require(_0x660e('0x13'));var hardwareService=require(_0x660e('0x14'));var logger=require(_0x660e('0x15'))(_0x660e('0x16'));var utils=require(_0x660e('0x17'));var config=require(_0x660e('0x18'));var licenseUtil=require(_0x660e('0x19'));var db=require(_0x660e('0x1a'))['db'];var jayson=require(_0x660e('0x1b'));var client=jayson['client'][_0x660e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x4175a5,_0x42b6ec,_0x1b6934,_0xc4f1a6){return new BPromise(function(_0x5dd6ed,_0x2529fe){var _0x32d8b2=_0xc4f1a6||client;return _0x32d8b2[_0x660e('0x1d')](_0x4175a5,_0x1b6934)[_0x660e('0x1e')](function(_0x1a1f86){logger[_0x660e('0x1f')](_0x660e('0x20'),_0x42b6ec,_0x660e('0x21'));logger[_0x660e('0x22')](_0x660e('0x23'),_0x42b6ec,_0x660e('0x21'),JSON[_0x660e('0x24')](_0x1a1f86));if(_0x1a1f86['error']){if(_0x1a1f86[_0x660e('0x25')]['code']===0x1f4){logger[_0x660e('0x25')](_0x660e('0x20'),_0x42b6ec,_0x1a1f86['error'][_0x660e('0x26')]);return _0x2529fe(_0x1a1f86[_0x660e('0x25')][_0x660e('0x26')]);}logger[_0x660e('0x25')]('Setting,\x20%s,\x20%s',_0x42b6ec,_0x1a1f86['error'][_0x660e('0x26')]);return _0x5dd6ed(_0x1a1f86[_0x660e('0x25')][_0x660e('0x26')]);}else{logger[_0x660e('0x1f')](_0x660e('0x20'),_0x42b6ec,_0x660e('0x21'));_0x5dd6ed(_0x1a1f86[_0x660e('0x27')][_0x660e('0x26')]);}})[_0x660e('0x28')](function(_0x2390e6){logger[_0x660e('0x25')]('Setting,\x20%s,\x20%s',_0x42b6ec,_0x2390e6);_0x2529fe(_0x2390e6);});});}function respondWithStatusCode(_0x22df0f,_0x54e151){_0x54e151=_0x54e151||0xcc;return function(_0x275552){if(_0x275552){return _0x22df0f[_0x660e('0x29')](_0x54e151);}return _0x22df0f[_0x660e('0x2a')](_0x54e151)[_0x660e('0x2b')]();};}function respondWithResult(_0x116cf4,_0x343523){_0x343523=_0x343523||0xc8;return function(_0x2f47c4){if(_0x2f47c4){return _0x116cf4[_0x660e('0x2a')](_0x343523)[_0x660e('0x2c')](_0x2f47c4);}};}function respondWithFilteredResult(_0x5c8086,_0x3458cf){return function(_0x39512c){if(_0x39512c){var _0x1f4d41=typeof _0x3458cf['offset']===_0x660e('0x2d')&&typeof _0x3458cf[_0x660e('0x2e')]===_0x660e('0x2d');var _0x19926a=_0x39512c['count'];var _0x577c0f=_0x1f4d41?0x0:_0x3458cf[_0x660e('0x2f')];var _0x37278f=_0x1f4d41?_0x39512c['count']:_0x3458cf[_0x660e('0x2f')]+_0x3458cf[_0x660e('0x2e')];var _0x30b211;if(_0x37278f>=_0x19926a){_0x37278f=_0x19926a;_0x30b211=0xc8;}else{_0x30b211=0xce;}_0x5c8086[_0x660e('0x2a')](_0x30b211);return _0x5c8086[_0x660e('0x30')]('Content-Range',_0x577c0f+'-'+_0x37278f+'/'+_0x19926a)['json'](_0x39512c);}return null;};}function patchUpdates(_0x5c76fa){return function(_0x3300c5){try{jsonpatch['apply'](_0x3300c5,_0x5c76fa,!![]);}catch(_0x57233d){return BPromise[_0x660e('0x31')](_0x57233d);}return _0x3300c5[_0x660e('0x32')]();};}function saveUpdates(_0x34be68,_0xa2b54){return function(_0x13147c){if(_0x13147c){return _0x13147c[_0x660e('0x33')](_0x34be68)[_0x660e('0x1e')](function(_0x44aa56){return _0x44aa56;});}return null;};}function removeEntity(_0x266abf,_0x397f64){return function(_0x41a873){if(_0x41a873){return _0x41a873[_0x660e('0x34')]()['then'](function(){_0x266abf[_0x660e('0x2a')](0xcc)[_0x660e('0x2b')]();});}};}function handleEntityNotFound(_0x3122c5,_0x4f5437){return function(_0x6190b1){if(!_0x6190b1){_0x3122c5[_0x660e('0x29')](0x194);}return _0x6190b1;};}function handleError(_0x18832f,_0x50e953){_0x50e953=_0x50e953||0x1f4;return function(_0x469a77){logger['error'](_0x469a77[_0x660e('0x35')]);if(_0x469a77[_0x660e('0x36')]){delete _0x469a77[_0x660e('0x36')];}_0x18832f[_0x660e('0x2a')](_0x50e953)[_0x660e('0x37')](_0x469a77);};}exports['index']=function(_0xf9e64c,_0x3b5ed3){var _0x3d530f={},_0x16e2c0={},_0x1a2dc8={'count':0x0,'rows':[]};var _0x22990f=_[_0x660e('0x38')](db[_0x660e('0x39')][_0x660e('0x3a')],function(_0x3748aa){return{'name':_0x3748aa[_0x660e('0x3b')],'type':_0x3748aa[_0x660e('0x3c')][_0x660e('0x3d')]};});_0x16e2c0[_0x660e('0x3e')]=_[_0x660e('0x38')](_0x22990f,_0x660e('0x36'));_0x16e2c0[_0x660e('0x3f')]=_[_0x660e('0x40')](_0xf9e64c[_0x660e('0x3f')]);_0x16e2c0['filters']=_[_0x660e('0x41')](_0x16e2c0[_0x660e('0x3e')],_0x16e2c0['query']);_0x3d530f[_0x660e('0x42')]=_[_0x660e('0x41')](_0x16e2c0['model'],qs[_0x660e('0x43')](_0xf9e64c[_0x660e('0x3f')][_0x660e('0x43')]));_0x3d530f['attributes']=_0x3d530f[_0x660e('0x42')][_0x660e('0x44')]?_0x3d530f[_0x660e('0x42')]:_0x16e2c0[_0x660e('0x3e')];if(!_0xf9e64c[_0x660e('0x3f')][_0x660e('0x45')](_0x660e('0x46'))){_0x3d530f[_0x660e('0x2e')]=qs[_0x660e('0x2e')](_0xf9e64c[_0x660e('0x3f')][_0x660e('0x2e')]);_0x3d530f[_0x660e('0x2f')]=qs[_0x660e('0x2f')](_0xf9e64c[_0x660e('0x3f')][_0x660e('0x2f')]);}_0x3d530f[_0x660e('0x47')]=qs['sort'](_0xf9e64c[_0x660e('0x3f')]['sort']);_0x3d530f[_0x660e('0x48')]=qs[_0x660e('0x49')](_[_0x660e('0x4a')](_0xf9e64c[_0x660e('0x3f')],_0x16e2c0['filters']),_0x22990f);if(_0xf9e64c['query'][_0x660e('0x4b')]){_0x3d530f[_0x660e('0x48')]=_[_0x660e('0x4c')](_0x3d530f[_0x660e('0x48')],{'$or':_['map'](_0x22990f,function(_0x2b7007){if(_0x2b7007[_0x660e('0x3c')]!==_0x660e('0x4d')){var _0x403db7={};_0x403db7[_0x2b7007[_0x660e('0x36')]]={'$like':'%'+_0xf9e64c[_0x660e('0x3f')]['filter']+'%'};return _0x403db7;}})});}_0x3d530f=_[_0x660e('0x4c')]({},_0x3d530f,_0xf9e64c[_0x660e('0x4e')]);var _0x4dcfda={'where':_0x3d530f[_0x660e('0x48')]};return db['Setting'][_0x660e('0x4f')](_0x4dcfda)[_0x660e('0x1e')](function(_0x1f1422){_0x1a2dc8[_0x660e('0x4f')]=_0x1f1422;if(_0xf9e64c[_0x660e('0x3f')][_0x660e('0x50')]){_0x3d530f[_0x660e('0x51')]=[{'all':!![]}];}return db[_0x660e('0x39')][_0x660e('0x52')](_0x3d530f);})[_0x660e('0x1e')](function(_0x40deeb){_0x1a2dc8[_0x660e('0x53')]=_0x40deeb;return _0x1a2dc8;})[_0x660e('0x1e')](respondWithFilteredResult(_0x3b5ed3,_0x3d530f))['catch'](handleError(_0x3b5ed3,null));};exports['show']=function(_0x5b81b4,_0x1ae7a2){var _0x2029f4={'raw':![],'where':{'id':_0x5b81b4[_0x660e('0x54')]['id']}},_0x47a96d={};_0x47a96d[_0x660e('0x3e')]=_[_0x660e('0x40')](db['Setting'][_0x660e('0x3a')]);_0x47a96d[_0x660e('0x3f')]=_['keys'](_0x5b81b4['query']);_0x47a96d[_0x660e('0x49')]=_[_0x660e('0x41')](_0x47a96d[_0x660e('0x3e')],_0x47a96d[_0x660e('0x3f')]);_0x2029f4[_0x660e('0x42')]=_[_0x660e('0x41')](_0x47a96d['model'],qs[_0x660e('0x43')](_0x5b81b4['query']['fields']));_0x2029f4[_0x660e('0x42')]=_0x2029f4[_0x660e('0x42')][_0x660e('0x44')]?_0x2029f4[_0x660e('0x42')]:_0x47a96d[_0x660e('0x3e')];if(_0x5b81b4[_0x660e('0x3f')][_0x660e('0x50')]){_0x2029f4[_0x660e('0x51')]=[{'all':!![]}];}_0x2029f4=_[_0x660e('0x4c')]({},_0x2029f4,_0x5b81b4[_0x660e('0x4e')]);return db[_0x660e('0x39')][_0x660e('0x55')](_0x2029f4)[_0x660e('0x1e')](handleEntityNotFound(_0x1ae7a2,null))[_0x660e('0x1e')](respondWithResult(_0x1ae7a2,null))[_0x660e('0x28')](handleError(_0x1ae7a2,null));};exports[_0x660e('0x33')]=function(_0x4371d4,_0xa84184){if(_0x4371d4['body']['id']){delete _0x4371d4[_0x660e('0x56')]['id'];}return db['Setting'][_0x660e('0x55')]({'where':{'id':_0x4371d4[_0x660e('0x54')]['id']}})[_0x660e('0x1e')](handleEntityNotFound(_0xa84184,null))[_0x660e('0x1e')](saveUpdates(_0x4371d4[_0x660e('0x56')],null))[_0x660e('0x1e')](respondWithResult(_0xa84184,null))[_0x660e('0x28')](handleError(_0xa84184,null));};exports[_0x660e('0x57')]=function(_0x131bd5,_0x3c6001,_0x3b5b8c){if(_0x131bd5[_0x660e('0x58')]&&_0x131bd5[_0x660e('0x58')][_0x660e('0x59')]){_0x131bd5[_0x660e('0x56')]['logo']=_0x131bd5[_0x660e('0x58')][_0x660e('0x59')];}return db[_0x660e('0x39')][_0x660e('0x55')]({'where':{'id':_0x131bd5[_0x660e('0x54')]['id']}})[_0x660e('0x1e')](handleEntityNotFound(_0x3c6001,null))[_0x660e('0x1e')](saveUpdates(_0x131bd5[_0x660e('0x56')],null))['then'](respondWithResult(_0x3c6001,null))['catch'](handleError(_0x3c6001,null));};exports[_0x660e('0x5a')]=function(_0x2274e9,_0x1217d4,_0x5877e2){if(_0x2274e9[_0x660e('0x58')]&&_0x2274e9['file'][_0x660e('0x59')]){_0x2274e9['body'][_0x660e('0x5b')]=_0x2274e9[_0x660e('0x58')][_0x660e('0x59')];}return db[_0x660e('0x39')]['find']({'where':{'id':_0x2274e9[_0x660e('0x54')]['id']}})[_0x660e('0x1e')](handleEntityNotFound(_0x1217d4,null))[_0x660e('0x1e')](saveUpdates(_0x2274e9[_0x660e('0x56')],null))[_0x660e('0x1e')](respondWithResult(_0x1217d4,null))['catch'](handleError(_0x1217d4,null));};var utilLicense=require(_0x660e('0x19'));exports[_0x660e('0x5c')]=function(_0x4620f9,_0x29678f,_0x57768d){var _0x236533=_0x660e('0x5d');var _0x52e46e={'custom':![]};return utilLicense[_0x660e('0x5e')]()[_0x660e('0x1e')](function(_0x207792){if(_0x207792){_0x52e46e=_0x207792;}return db['Setting'][_0x660e('0x55')]({'where':{'id':_0x4620f9[_0x660e('0x54')]['id']},'attributes':['logo',_0x660e('0x5b'),'preferred',_0x660e('0x5f'),_0x660e('0x60'),_0x660e('0x61'),_0x660e('0x62'),_0x660e('0x63')],'raw':!![]});})[_0x660e('0x1e')](handleEntityNotFound(_0x29678f,null))[_0x660e('0x1e')](function(_0x13afa7){if(_0x13afa7){var _0x3404c3=_0x13afa7['logo']&&fs['existsSync'](path['join'](config[_0x660e('0x64')],_0x236533,_[_0x660e('0x65')](_0x13afa7['logo'])))?path[_0x660e('0x66')](config[_0x660e('0x64')],_0x236533,_[_0x660e('0x65')](_0x13afa7['logo'])):path['join'](config['root'],_0x236533,_[_0x660e('0x65')]('default_logo.svg'));var _0x58da88=_0x660e('0x67')+_[_0x660e('0x68')]('logo');if(_0x13afa7[_0x58da88]||!_0x52e46e['custom']){_0x3404c3=path['join'](config[_0x660e('0x64')],_0x236533,_[_0x660e('0x65')](_0x660e('0x69')));}if(!fs[_0x660e('0x6a')](_0x3404c3)){throw new db[(_0x660e('0x6b'))][(_0x660e('0x6c'))](_['upperFirst'](_0x660e('0x6d'))+_0x660e('0x6e'));}return _0x29678f[_0x660e('0x6f')](_0x3404c3);}})[_0x660e('0x28')](handleError(_0x29678f,null));};var utilLicense=require(_0x660e('0x19'));exports[_0x660e('0x70')]=function(_0x6e9bd9,_0x3aa9d1,_0x5cd57a){var _0x4b4fa5=_0x660e('0x5d');var _0x196dbe={'custom':![]};return utilLicense[_0x660e('0x5e')]()[_0x660e('0x1e')](function(_0x15896f){if(_0x15896f){_0x196dbe=_0x15896f;}return db['Setting'][_0x660e('0x55')]({'where':{'id':_0x6e9bd9[_0x660e('0x54')]['id']},'attributes':[_0x660e('0x6d'),'loginLogo','preferred',_0x660e('0x5f'),_0x660e('0x60'),_0x660e('0x61'),'defaultPreferred',_0x660e('0x63')],'raw':!![]});})[_0x660e('0x1e')](handleEntityNotFound(_0x3aa9d1,null))[_0x660e('0x1e')](function(_0x340440){if(_0x340440){var _0x1062b9=_0x340440['loginLogo']&&fs[_0x660e('0x6a')](path[_0x660e('0x66')](config['root'],_0x4b4fa5,_[_0x660e('0x65')](_0x340440['loginLogo'])))?path[_0x660e('0x66')](config[_0x660e('0x64')],_0x4b4fa5,_[_0x660e('0x65')](_0x340440[_0x660e('0x5b')])):path[_0x660e('0x66')](config[_0x660e('0x64')],_0x4b4fa5,_['toLower'](_0x660e('0x71')));var _0xc89f5f=_0x660e('0x67')+_[_0x660e('0x68')](_0x660e('0x5b'));if(_0x340440[_0xc89f5f]||!_0x196dbe[_0x660e('0x72')]){_0x1062b9=path[_0x660e('0x66')](config[_0x660e('0x64')],_0x4b4fa5,_['toLower']('default_loginLogo.svg'));}if(!fs[_0x660e('0x6a')](_0x1062b9)){throw new db[(_0x660e('0x6b'))][(_0x660e('0x6c'))](_['upperFirst'](_0x660e('0x5b'))+'\x20not\x20found');}return _0x3aa9d1['download'](_0x1062b9);}})[_0x660e('0x28')](handleError(_0x3aa9d1,null));};exports['gdpr']=function(_0x4cc235,_0x10df4c){return db[_0x660e('0x39')][_0x660e('0x55')]({'where':{'id':_0x4cc235[_0x660e('0x54')]['id']},'attributes':[_0x660e('0x73')]})['then'](respondWithResult(_0x10df4c,null))['catch'](handleError(_0x10df4c,null));};exports[_0x660e('0x74')]=function(_0x4342fc,_0x43de35,_0xc6e72b){if(_0x4342fc[_0x660e('0x58')]&&_0x4342fc[_0x660e('0x58')]['filename']){_0x4342fc['body'][_0x660e('0x75')]=_0x4342fc['file'][_0x660e('0x59')];}return db[_0x660e('0x39')]['find']({'where':{'id':_0x4342fc[_0x660e('0x54')]['id']}})[_0x660e('0x1e')](handleEntityNotFound(_0x43de35,null))[_0x660e('0x1e')](saveUpdates(_0x4342fc[_0x660e('0x56')],null))['then'](respondWithResult(_0x43de35,null))[_0x660e('0x28')](handleError(_0x43de35,null));};var utilLicense=require(_0x660e('0x19'));exports[_0x660e('0x76')]=function(_0x378d67,_0x340bbf,_0x3c15f6){var _0x125271='server/files/images/logos';var _0x15f84b={'custom':![]};return utilLicense['getLicense']()[_0x660e('0x1e')](function(_0x54c858){if(_0x54c858){_0x15f84b=_0x54c858;}return db[_0x660e('0x39')][_0x660e('0x55')]({'where':{'id':_0x378d67[_0x660e('0x54')]['id']},'attributes':[_0x660e('0x6d'),_0x660e('0x5b'),_0x660e('0x75'),'favicon',_0x660e('0x60'),_0x660e('0x61'),_0x660e('0x62'),_0x660e('0x63')],'raw':!![]});})[_0x660e('0x1e')](handleEntityNotFound(_0x340bbf,null))[_0x660e('0x1e')](function(_0x4e491c){if(_0x4e491c){var _0x47b8d7=_0x4e491c[_0x660e('0x75')]&&fs[_0x660e('0x6a')](path[_0x660e('0x66')](config['root'],_0x125271,_[_0x660e('0x65')](_0x4e491c[_0x660e('0x75')])))?path[_0x660e('0x66')](config[_0x660e('0x64')],_0x125271,_[_0x660e('0x65')](_0x4e491c[_0x660e('0x75')])):path[_0x660e('0x66')](config[_0x660e('0x64')],_0x125271,_[_0x660e('0x65')]('default_preferred.png'));var _0x5143e8=_0x660e('0x67')+_[_0x660e('0x68')]('preferred');if(_0x4e491c[_0x5143e8]||!_0x15f84b[_0x660e('0x72')]||!_0x15f84b[_0x660e('0x75')]){_0x47b8d7=path[_0x660e('0x66')](config[_0x660e('0x64')],_0x125271,_[_0x660e('0x65')](_0x660e('0x77')));}if(!fs[_0x660e('0x6a')](_0x47b8d7)){throw new db['Sequelize'][(_0x660e('0x6c'))](_[_0x660e('0x68')](_0x660e('0x75'))+_0x660e('0x6e'));}return _0x340bbf[_0x660e('0x6f')](_0x47b8d7);}})[_0x660e('0x28')](handleError(_0x340bbf,null));};exports['addFavicon']=function(_0x22d925,_0x2e4fb3,_0xbb8ba1){if(_0x22d925[_0x660e('0x58')]&&_0x22d925[_0x660e('0x58')][_0x660e('0x59')]){_0x22d925['body'][_0x660e('0x5f')]=_0x22d925['file'][_0x660e('0x59')];}return db[_0x660e('0x39')]['find']({'where':{'id':_0x22d925[_0x660e('0x54')]['id']}})[_0x660e('0x1e')](handleEntityNotFound(_0x2e4fb3,null))[_0x660e('0x1e')](saveUpdates(_0x22d925[_0x660e('0x56')],null))[_0x660e('0x1e')](respondWithResult(_0x2e4fb3,null))[_0x660e('0x28')](handleError(_0x2e4fb3,null));};var utilLicense=require('../../config/license/util');exports[_0x660e('0x78')]=function(_0x294249,_0x21c912,_0x201fc6){var _0x3ea646=_0x660e('0x5d');var _0x18b348={'custom':![]};return utilLicense[_0x660e('0x5e')]()[_0x660e('0x1e')](function(_0xeebaf3){if(_0xeebaf3){_0x18b348=_0xeebaf3;}return db['Setting']['find']({'where':{'id':_0x294249['params']['id']},'attributes':[_0x660e('0x6d'),_0x660e('0x5b'),_0x660e('0x75'),_0x660e('0x5f'),_0x660e('0x60'),_0x660e('0x61'),_0x660e('0x62'),_0x660e('0x63')],'raw':!![]});})[_0x660e('0x1e')](handleEntityNotFound(_0x21c912,null))['then'](function(_0x18b96c){if(_0x18b96c){var _0x3130d2=_0x18b96c[_0x660e('0x5f')]&&fs[_0x660e('0x6a')](path['join'](config[_0x660e('0x64')],_0x3ea646,_[_0x660e('0x65')](_0x18b96c['favicon'])))?path['join'](config[_0x660e('0x64')],_0x3ea646,_[_0x660e('0x65')](_0x18b96c[_0x660e('0x5f')])):path[_0x660e('0x66')](config[_0x660e('0x64')],_0x3ea646,_[_0x660e('0x65')](_0x660e('0x79')));var _0x3e0377=_0x660e('0x67')+_[_0x660e('0x68')](_0x660e('0x5f'));if(_0x18b96c[_0x3e0377]||!_0x18b348[_0x660e('0x72')]){_0x3130d2=path[_0x660e('0x66')](config['root'],_0x3ea646,_[_0x660e('0x65')]('default_favicon.ico'));}if(!fs[_0x660e('0x6a')](_0x3130d2)){throw new db[(_0x660e('0x6b'))][(_0x660e('0x6c'))](_[_0x660e('0x68')]('favicon')+_0x660e('0x6e'));}return _0x21c912[_0x660e('0x6f')](_0x3130d2);}})['catch'](handleError(_0x21c912,null));};exports[_0x660e('0x7a')]=function(_0x27d1b6,_0x5cc9f7){var _0x4c0c74={'offset':moment()[_0x660e('0x7b')]()};_0x4c0c74[_0x660e('0x7c')]=moment()['utcOffset'](_0x4c0c74['offset'])[_0x660e('0x7d')](_0x660e('0x7e'));return _0x5cc9f7[_0x660e('0x2a')](0xc8)[_0x660e('0x37')](_0x4c0c74);}; \ No newline at end of file +var _0x4784=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','sendStatus','name','send','index','map','Setting','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','count','includeAll','include','findAll','params','rawAttributes','options','find','body','addLogo','filename','logo','addLogoLogin','file','loginLogo','getLicense','preferred','favicon','defaultLoginLogo','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','custom','Sequelize','\x20not\x20found','download','server/files/images/logos','defaultLogo','gdpr','securePassword','addPreferred','defaultPreferred','ValidationError','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse'];(function(_0x45ead8,_0x29d265){var _0xe42b60=function(_0x1f7429){while(--_0x1f7429){_0x45ead8['push'](_0x45ead8['shift']());}};_0xe42b60(++_0x29d265);}(_0x4784,0xe4));var _0x4478=function(_0xa15251,_0x935ebc){_0xa15251=_0xa15251-0x0;var _0x455bdb=_0x4784[_0xa15251];return _0x455bdb;};'use strict';var emlformat=require(_0x4478('0x0'));var rimraf=require(_0x4478('0x1'));var zipdir=require(_0x4478('0x2'));var jsonpatch=require(_0x4478('0x3'));var rp=require(_0x4478('0x4'));var moment=require(_0x4478('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4478('0x6'));var util=require(_0x4478('0x7'));var path=require(_0x4478('0x8'));var sox=require('sox');var csv=require(_0x4478('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4478('0xa'));var _=require('lodash');var squel=require(_0x4478('0xb'));var crypto=require(_0x4478('0xc'));var jsforce=require(_0x4478('0xd'));var deskjs=require(_0x4478('0xe'));var toCsv=require(_0x4478('0x9'));var querystring=require('querystring');var Papa=require(_0x4478('0xf'));var Redis=require(_0x4478('0x10'));var authService=require(_0x4478('0x11'));var qs=require(_0x4478('0x12'));var as=require(_0x4478('0x13'));var hardwareService=require(_0x4478('0x14'));var logger=require(_0x4478('0x15'))('api');var utils=require(_0x4478('0x16'));var config=require(_0x4478('0x17'));var licenseUtil=require(_0x4478('0x18'));var db=require(_0x4478('0x19'))['db'];var jayson=require(_0x4478('0x1a'));var client=jayson[_0x4478('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a4a7f,_0x26b881,_0x4286ce,_0x36dacc){return new BPromise(function(_0x38bcfc,_0x4d74ee){var _0x52cd71=_0x36dacc||client;return _0x52cd71[_0x4478('0x1c')](_0x3a4a7f,_0x4286ce)[_0x4478('0x1d')](function(_0x136574){logger[_0x4478('0x1e')](_0x4478('0x1f'),_0x26b881,_0x4478('0x20'));logger[_0x4478('0x21')]('Setting,\x20%s,\x20%s,\x20%s',_0x26b881,_0x4478('0x20'),JSON[_0x4478('0x22')](_0x136574));if(_0x136574[_0x4478('0x23')]){if(_0x136574[_0x4478('0x23')][_0x4478('0x24')]===0x1f4){logger['error'](_0x4478('0x1f'),_0x26b881,_0x136574[_0x4478('0x23')]['message']);return _0x4d74ee(_0x136574[_0x4478('0x23')][_0x4478('0x25')]);}logger['error'](_0x4478('0x1f'),_0x26b881,_0x136574[_0x4478('0x23')][_0x4478('0x25')]);return _0x38bcfc(_0x136574[_0x4478('0x23')][_0x4478('0x25')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0x26b881,_0x4478('0x20'));_0x38bcfc(_0x136574[_0x4478('0x26')]['message']);}})[_0x4478('0x27')](function(_0x2e99ad){logger[_0x4478('0x23')]('Setting,\x20%s,\x20%s',_0x26b881,_0x2e99ad);_0x4d74ee(_0x2e99ad);});});}function respondWithStatusCode(_0x44cfda,_0xc6717d){_0xc6717d=_0xc6717d||0xcc;return function(_0x12a4aa){if(_0x12a4aa){return _0x44cfda['sendStatus'](_0xc6717d);}return _0x44cfda[_0x4478('0x28')](_0xc6717d)[_0x4478('0x29')]();};}function respondWithResult(_0x573ed5,_0x5ce9f6){_0x5ce9f6=_0x5ce9f6||0xc8;return function(_0x25fcaa){if(_0x25fcaa){return _0x573ed5[_0x4478('0x28')](_0x5ce9f6)[_0x4478('0x2a')](_0x25fcaa);}};}function respondWithFilteredResult(_0x5326fb,_0x3d5405){return function(_0xcf0038){if(_0xcf0038){var _0x46055a=typeof _0x3d5405[_0x4478('0x2b')]===_0x4478('0x2c')&&typeof _0x3d5405[_0x4478('0x2d')]===_0x4478('0x2c');var _0x12104d=_0xcf0038['count'];var _0x88b0c8=_0x46055a?0x0:_0x3d5405[_0x4478('0x2b')];var _0x2ba88b=_0x46055a?_0xcf0038['count']:_0x3d5405['offset']+_0x3d5405[_0x4478('0x2d')];var _0x1b027f;if(_0x2ba88b>=_0x12104d){_0x2ba88b=_0x12104d;_0x1b027f=0xc8;}else{_0x1b027f=0xce;}_0x5326fb[_0x4478('0x28')](_0x1b027f);return _0x5326fb[_0x4478('0x2e')](_0x4478('0x2f'),_0x88b0c8+'-'+_0x2ba88b+'/'+_0x12104d)['json'](_0xcf0038);}return null;};}function patchUpdates(_0x2cbe43){return function(_0x400d50){try{jsonpatch[_0x4478('0x30')](_0x400d50,_0x2cbe43,!![]);}catch(_0x20ff66){return BPromise[_0x4478('0x31')](_0x20ff66);}return _0x400d50[_0x4478('0x32')]();};}function saveUpdates(_0x5dfbd3,_0x2f3514){return function(_0x330266){if(_0x330266){return _0x330266[_0x4478('0x33')](_0x5dfbd3)[_0x4478('0x1d')](function(_0x1635da){return _0x1635da;});}return null;};}function removeEntity(_0x5311e8,_0x3a1615){return function(_0x90e6c){if(_0x90e6c){return _0x90e6c[_0x4478('0x34')]()[_0x4478('0x1d')](function(){_0x5311e8[_0x4478('0x28')](0xcc)[_0x4478('0x29')]();});}};}function handleEntityNotFound(_0x4493e1,_0x4b783a){return function(_0x2e6797){if(!_0x2e6797){_0x4493e1[_0x4478('0x35')](0x194);}return _0x2e6797;};}function handleError(_0x426b08,_0x2ea746){_0x2ea746=_0x2ea746||0x1f4;return function(_0x3d1c9a){logger[_0x4478('0x23')](_0x3d1c9a['stack']);if(_0x3d1c9a[_0x4478('0x36')]){delete _0x3d1c9a['name'];}_0x426b08[_0x4478('0x28')](_0x2ea746)[_0x4478('0x37')](_0x3d1c9a);};}exports[_0x4478('0x38')]=function(_0x1f6dee,_0x270a59){var _0x44f4d1={},_0x2a6c1c={},_0x10119f={'count':0x0,'rows':[]};var _0x1d849f=_[_0x4478('0x39')](db[_0x4478('0x3a')]['rawAttributes'],function(_0x4d686a){return{'name':_0x4d686a[_0x4478('0x3b')],'type':_0x4d686a[_0x4478('0x3c')][_0x4478('0x3d')]};});_0x2a6c1c[_0x4478('0x3e')]=_[_0x4478('0x39')](_0x1d849f,_0x4478('0x36'));_0x2a6c1c['query']=_[_0x4478('0x3f')](_0x1f6dee['query']);_0x2a6c1c[_0x4478('0x40')]=_[_0x4478('0x41')](_0x2a6c1c['model'],_0x2a6c1c[_0x4478('0x42')]);_0x44f4d1['attributes']=_[_0x4478('0x41')](_0x2a6c1c[_0x4478('0x3e')],qs[_0x4478('0x43')](_0x1f6dee[_0x4478('0x42')][_0x4478('0x43')]));_0x44f4d1[_0x4478('0x44')]=_0x44f4d1[_0x4478('0x44')][_0x4478('0x45')]?_0x44f4d1['attributes']:_0x2a6c1c['model'];if(!_0x1f6dee[_0x4478('0x42')][_0x4478('0x46')]('nolimit')){_0x44f4d1['limit']=qs[_0x4478('0x2d')](_0x1f6dee[_0x4478('0x42')]['limit']);_0x44f4d1[_0x4478('0x2b')]=qs[_0x4478('0x2b')](_0x1f6dee['query'][_0x4478('0x2b')]);}_0x44f4d1[_0x4478('0x47')]=qs[_0x4478('0x48')](_0x1f6dee['query'][_0x4478('0x48')]);_0x44f4d1['where']=qs['filters'](_['pick'](_0x1f6dee[_0x4478('0x42')],_0x2a6c1c[_0x4478('0x40')]),_0x1d849f);if(_0x1f6dee['query'][_0x4478('0x49')]){_0x44f4d1[_0x4478('0x4a')]=_[_0x4478('0x4b')](_0x44f4d1['where'],{'$or':_[_0x4478('0x39')](_0x1d849f,function(_0x2379a6){if(_0x2379a6[_0x4478('0x3c')]!==_0x4478('0x4c')){var _0x262210={};_0x262210[_0x2379a6[_0x4478('0x36')]]={'$like':'%'+_0x1f6dee[_0x4478('0x42')]['filter']+'%'};return _0x262210;}})});}_0x44f4d1=_[_0x4478('0x4b')]({},_0x44f4d1,_0x1f6dee['options']);var _0x3db312={'where':_0x44f4d1[_0x4478('0x4a')]};return db[_0x4478('0x3a')][_0x4478('0x4d')](_0x3db312)[_0x4478('0x1d')](function(_0x3fd721){_0x10119f[_0x4478('0x4d')]=_0x3fd721;if(_0x1f6dee['query'][_0x4478('0x4e')]){_0x44f4d1[_0x4478('0x4f')]=[{'all':!![]}];}return db[_0x4478('0x3a')][_0x4478('0x50')](_0x44f4d1);})[_0x4478('0x1d')](function(_0x27ebbd){_0x10119f['rows']=_0x27ebbd;return _0x10119f;})['then'](respondWithFilteredResult(_0x270a59,_0x44f4d1))[_0x4478('0x27')](handleError(_0x270a59,null));};exports['show']=function(_0x80882,_0x482b17){var _0x44d2f3={'raw':![],'where':{'id':_0x80882[_0x4478('0x51')]['id']}},_0x58b475={};_0x58b475['model']=_[_0x4478('0x3f')](db[_0x4478('0x3a')][_0x4478('0x52')]);_0x58b475[_0x4478('0x42')]=_[_0x4478('0x3f')](_0x80882[_0x4478('0x42')]);_0x58b475[_0x4478('0x40')]=_[_0x4478('0x41')](_0x58b475['model'],_0x58b475['query']);_0x44d2f3[_0x4478('0x44')]=_['intersection'](_0x58b475[_0x4478('0x3e')],qs[_0x4478('0x43')](_0x80882[_0x4478('0x42')][_0x4478('0x43')]));_0x44d2f3['attributes']=_0x44d2f3[_0x4478('0x44')]['length']?_0x44d2f3[_0x4478('0x44')]:_0x58b475[_0x4478('0x3e')];if(_0x80882[_0x4478('0x42')]['includeAll']){_0x44d2f3[_0x4478('0x4f')]=[{'all':!![]}];}_0x44d2f3=_[_0x4478('0x4b')]({},_0x44d2f3,_0x80882[_0x4478('0x53')]);return db['Setting'][_0x4478('0x54')](_0x44d2f3)[_0x4478('0x1d')](handleEntityNotFound(_0x482b17,null))[_0x4478('0x1d')](respondWithResult(_0x482b17,null))['catch'](handleError(_0x482b17,null));};exports[_0x4478('0x33')]=function(_0x3764a3,_0x2fc501){if(_0x3764a3[_0x4478('0x55')]['id']){delete _0x3764a3[_0x4478('0x55')]['id'];}return db[_0x4478('0x3a')][_0x4478('0x54')]({'where':{'id':_0x3764a3[_0x4478('0x51')]['id']}})[_0x4478('0x1d')](handleEntityNotFound(_0x2fc501,null))[_0x4478('0x1d')](saveUpdates(_0x3764a3['body'],null))[_0x4478('0x1d')](respondWithResult(_0x2fc501,null))[_0x4478('0x27')](handleError(_0x2fc501,null));};exports[_0x4478('0x56')]=function(_0x31430b,_0xed71b7,_0xecff17){if(_0x31430b['file']&&_0x31430b['file'][_0x4478('0x57')]){_0x31430b[_0x4478('0x55')][_0x4478('0x58')]=_0x31430b['file'][_0x4478('0x57')];}return db['Setting']['find']({'where':{'id':_0x31430b[_0x4478('0x51')]['id']}})[_0x4478('0x1d')](handleEntityNotFound(_0xed71b7,null))['then'](saveUpdates(_0x31430b['body'],null))[_0x4478('0x1d')](respondWithResult(_0xed71b7,null))['catch'](handleError(_0xed71b7,null));};exports[_0x4478('0x59')]=function(_0x8bf4e0,_0x41c852,_0x1bbb58){if(_0x8bf4e0[_0x4478('0x5a')]&&_0x8bf4e0[_0x4478('0x5a')][_0x4478('0x57')]){_0x8bf4e0[_0x4478('0x55')][_0x4478('0x5b')]=_0x8bf4e0[_0x4478('0x5a')][_0x4478('0x57')];}return db[_0x4478('0x3a')][_0x4478('0x54')]({'where':{'id':_0x8bf4e0[_0x4478('0x51')]['id']}})[_0x4478('0x1d')](handleEntityNotFound(_0x41c852,null))[_0x4478('0x1d')](saveUpdates(_0x8bf4e0[_0x4478('0x55')],null))['then'](respondWithResult(_0x41c852,null))[_0x4478('0x27')](handleError(_0x41c852,null));};var utilLicense=require(_0x4478('0x18'));exports['getLogo']=function(_0x39fb95,_0x18d245,_0x46bd0a){var _0x1b3a67='server/files/images/logos';var _0x14ff3d={'custom':![]};return utilLicense[_0x4478('0x5c')]()[_0x4478('0x1d')](function(_0x3281e0){if(_0x3281e0){_0x14ff3d=_0x3281e0;}return db['Setting'][_0x4478('0x54')]({'where':{'id':_0x39fb95[_0x4478('0x51')]['id']},'attributes':[_0x4478('0x58'),_0x4478('0x5b'),_0x4478('0x5d'),_0x4478('0x5e'),'defaultLogo',_0x4478('0x5f'),'defaultPreferred',_0x4478('0x60')],'raw':!![]});})[_0x4478('0x1d')](handleEntityNotFound(_0x18d245,null))[_0x4478('0x1d')](function(_0x5eed02){if(_0x5eed02){var _0xc0055e=_0x5eed02['logo']&&fs[_0x4478('0x61')](path[_0x4478('0x62')](config[_0x4478('0x63')],_0x1b3a67,_[_0x4478('0x64')](_0x5eed02[_0x4478('0x58')])))?path[_0x4478('0x62')](config[_0x4478('0x63')],_0x1b3a67,_[_0x4478('0x64')](_0x5eed02[_0x4478('0x58')])):path['join'](config[_0x4478('0x63')],_0x1b3a67,_[_0x4478('0x64')](_0x4478('0x65')));var _0x2afddb=_0x4478('0x66')+_[_0x4478('0x67')]('logo');if(_0x5eed02[_0x2afddb]||!_0x14ff3d[_0x4478('0x68')]){_0xc0055e=path[_0x4478('0x62')](config[_0x4478('0x63')],_0x1b3a67,_['toLower'](_0x4478('0x65')));}if(!fs[_0x4478('0x61')](_0xc0055e)){throw new db[(_0x4478('0x69'))]['ValidationError'](_['upperFirst'](_0x4478('0x58'))+_0x4478('0x6a'));}return _0x18d245[_0x4478('0x6b')](_0xc0055e);}})[_0x4478('0x27')](handleError(_0x18d245,null));};var utilLicense=require(_0x4478('0x18'));exports['getLogoLogin']=function(_0x570c2e,_0x1c69e0,_0x122997){var _0x35397e=_0x4478('0x6c');var _0x422de5={'custom':![]};return utilLicense['getLicense']()[_0x4478('0x1d')](function(_0x598e88){if(_0x598e88){_0x422de5=_0x598e88;}return db['Setting'][_0x4478('0x54')]({'where':{'id':_0x570c2e['params']['id']},'attributes':[_0x4478('0x58'),_0x4478('0x5b'),_0x4478('0x5d'),_0x4478('0x5e'),_0x4478('0x6d'),'defaultLoginLogo','defaultPreferred','defaultFavicon'],'raw':!![]});})[_0x4478('0x1d')](handleEntityNotFound(_0x1c69e0,null))['then'](function(_0x4b67fd){if(_0x4b67fd){var _0x3c0ace=_0x4b67fd[_0x4478('0x5b')]&&fs[_0x4478('0x61')](path['join'](config[_0x4478('0x63')],_0x35397e,_[_0x4478('0x64')](_0x4b67fd['loginLogo'])))?path[_0x4478('0x62')](config[_0x4478('0x63')],_0x35397e,_[_0x4478('0x64')](_0x4b67fd[_0x4478('0x5b')])):path[_0x4478('0x62')](config[_0x4478('0x63')],_0x35397e,_[_0x4478('0x64')]('default_loginLogo.svg'));var _0x1b3664=_0x4478('0x66')+_['upperFirst']('loginLogo');if(_0x4b67fd[_0x1b3664]||!_0x422de5[_0x4478('0x68')]){_0x3c0ace=path['join'](config[_0x4478('0x63')],_0x35397e,_[_0x4478('0x64')]('default_loginLogo.svg'));}if(!fs['existsSync'](_0x3c0ace)){throw new db[(_0x4478('0x69'))]['ValidationError'](_[_0x4478('0x67')](_0x4478('0x5b'))+_0x4478('0x6a'));}return _0x1c69e0['download'](_0x3c0ace);}})[_0x4478('0x27')](handleError(_0x1c69e0,null));};exports[_0x4478('0x6e')]=function(_0x563f64,_0x5a426c){return db[_0x4478('0x3a')]['find']({'where':{'id':_0x563f64[_0x4478('0x51')]['id']},'attributes':[_0x4478('0x6f')]})[_0x4478('0x1d')](respondWithResult(_0x5a426c,null))[_0x4478('0x27')](handleError(_0x5a426c,null));};exports[_0x4478('0x70')]=function(_0x4bb953,_0x4946e4,_0x4dac0c){if(_0x4bb953[_0x4478('0x5a')]&&_0x4bb953[_0x4478('0x5a')][_0x4478('0x57')]){_0x4bb953['body'][_0x4478('0x5d')]=_0x4bb953['file'][_0x4478('0x57')];}return db['Setting']['find']({'where':{'id':_0x4bb953[_0x4478('0x51')]['id']}})[_0x4478('0x1d')](handleEntityNotFound(_0x4946e4,null))['then'](saveUpdates(_0x4bb953['body'],null))[_0x4478('0x1d')](respondWithResult(_0x4946e4,null))[_0x4478('0x27')](handleError(_0x4946e4,null));};var utilLicense=require('../../config/license/util');exports['getPreferred']=function(_0x1eda7f,_0x5ca843,_0x4c8603){var _0x4766e9='server/files/images/logos';var _0x1a07aa={'custom':![]};return utilLicense[_0x4478('0x5c')]()[_0x4478('0x1d')](function(_0x1c719a){if(_0x1c719a){_0x1a07aa=_0x1c719a;}return db[_0x4478('0x3a')][_0x4478('0x54')]({'where':{'id':_0x1eda7f[_0x4478('0x51')]['id']},'attributes':['logo',_0x4478('0x5b'),'preferred','favicon','defaultLogo',_0x4478('0x5f'),_0x4478('0x71'),_0x4478('0x60')],'raw':!![]});})[_0x4478('0x1d')](handleEntityNotFound(_0x5ca843,null))[_0x4478('0x1d')](function(_0x4f6fb4){if(_0x4f6fb4){var _0x8e5ba8=_0x4f6fb4[_0x4478('0x5d')]&&fs[_0x4478('0x61')](path['join'](config[_0x4478('0x63')],_0x4766e9,_['toLower'](_0x4f6fb4['preferred'])))?path['join'](config[_0x4478('0x63')],_0x4766e9,_[_0x4478('0x64')](_0x4f6fb4['preferred'])):path[_0x4478('0x62')](config['root'],_0x4766e9,_[_0x4478('0x64')]('default_preferred.png'));var _0x41de56=_0x4478('0x66')+_[_0x4478('0x67')](_0x4478('0x5d'));if(_0x4f6fb4[_0x41de56]||!_0x1a07aa[_0x4478('0x68')]||!_0x1a07aa[_0x4478('0x5d')]){_0x8e5ba8=path[_0x4478('0x62')](config['root'],_0x4766e9,_[_0x4478('0x64')]('default_preferred.png'));}if(!fs[_0x4478('0x61')](_0x8e5ba8)){throw new db[(_0x4478('0x69'))][(_0x4478('0x72'))](_['upperFirst'](_0x4478('0x5d'))+'\x20not\x20found');}return _0x5ca843[_0x4478('0x6b')](_0x8e5ba8);}})[_0x4478('0x27')](handleError(_0x5ca843,null));};exports['addFavicon']=function(_0x447d5c,_0x175365,_0x4961e9){if(_0x447d5c[_0x4478('0x5a')]&&_0x447d5c[_0x4478('0x5a')][_0x4478('0x57')]){_0x447d5c[_0x4478('0x55')][_0x4478('0x5e')]=_0x447d5c['file'][_0x4478('0x57')];}return db[_0x4478('0x3a')][_0x4478('0x54')]({'where':{'id':_0x447d5c['params']['id']}})[_0x4478('0x1d')](handleEntityNotFound(_0x175365,null))[_0x4478('0x1d')](saveUpdates(_0x447d5c['body'],null))['then'](respondWithResult(_0x175365,null))[_0x4478('0x27')](handleError(_0x175365,null));};var utilLicense=require(_0x4478('0x18'));exports[_0x4478('0x73')]=function(_0xcad87c,_0x9554a2,_0x1c5b20){var _0xf2aa22='server/files/images/logos';var _0x3941e6={'custom':![]};return utilLicense[_0x4478('0x5c')]()[_0x4478('0x1d')](function(_0x160ef3){if(_0x160ef3){_0x3941e6=_0x160ef3;}return db[_0x4478('0x3a')][_0x4478('0x54')]({'where':{'id':_0xcad87c['params']['id']},'attributes':[_0x4478('0x58'),'loginLogo',_0x4478('0x5d'),_0x4478('0x5e'),_0x4478('0x6d'),'defaultLoginLogo',_0x4478('0x71'),_0x4478('0x60')],'raw':!![]});})[_0x4478('0x1d')](handleEntityNotFound(_0x9554a2,null))['then'](function(_0x53873b){if(_0x53873b){var _0x2fdb62=_0x53873b[_0x4478('0x5e')]&&fs['existsSync'](path[_0x4478('0x62')](config['root'],_0xf2aa22,_[_0x4478('0x64')](_0x53873b[_0x4478('0x5e')])))?path[_0x4478('0x62')](config['root'],_0xf2aa22,_[_0x4478('0x64')](_0x53873b[_0x4478('0x5e')])):path[_0x4478('0x62')](config[_0x4478('0x63')],_0xf2aa22,_[_0x4478('0x64')](_0x4478('0x74')));var _0x17d708=_0x4478('0x66')+_['upperFirst']('favicon');if(_0x53873b[_0x17d708]||!_0x3941e6[_0x4478('0x68')]){_0x2fdb62=path['join'](config[_0x4478('0x63')],_0xf2aa22,_[_0x4478('0x64')](_0x4478('0x74')));}if(!fs['existsSync'](_0x2fdb62)){throw new db['Sequelize'][(_0x4478('0x72'))](_[_0x4478('0x67')]('favicon')+_0x4478('0x6a'));}return _0x9554a2[_0x4478('0x6b')](_0x2fdb62);}})['catch'](handleError(_0x9554a2,null));};exports[_0x4478('0x75')]=function(_0x226986,_0x5177b5){var _0x152ddc={'offset':moment()[_0x4478('0x76')]()};_0x152ddc[_0x4478('0x77')]=moment()[_0x4478('0x76')](_0x152ddc[_0x4478('0x2b')])[_0x4478('0x78')](_0x4478('0x79'));return _0x5177b5[_0x4478('0x28')](0xc8)['send'](_0x152ddc);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 17bef5b..23dc1cc 100644 --- a/server/api/setting/setting.model.js +++ b/server/api/setting/setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x4ea6af,_0x4aa32e){var _0x4cb1e6=function(_0xc9edd0){while(--_0xc9edd0){_0x4ea6af['push'](_0x4ea6af['shift']());}};_0x4cb1e6(++_0x4aa32e);}(_0x008c,0x188));var _0xc008=function(_0xcba81,_0x2d4fe8){_0xcba81=_0xcba81-0x0;var _0x2f4468=_0x008c[_0xcba81];return _0x2f4468;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Setting',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e74=['exports','Setting','settings','lodash','../../config/logger','api','moment','path','../../config/environment','./setting.attributes'];(function(_0xd299c3,_0x4ba0f1){var _0x376574=function(_0xc585f){while(--_0xc585f){_0xd299c3['push'](_0xd299c3['shift']());}};_0x376574(++_0x4ba0f1);}(_0x3e74,0x175));var _0x43e7=function(_0x2cc767,_0x55d877){_0x2cc767=_0x2cc767-0x0;var _0x51a4a7=_0x3e74[_0x2cc767];return _0x51a4a7;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 3f86163..8570d9a 100644 --- a/server/api/setting/setting.rpc.js +++ b/server/api/setting/setting.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5e3c=['stringify','error','message','Setting','find','options','raw','where','attributes','include','model','map','ShowSetting','catch','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s'];(function(_0x1a388b,_0x24884d){var _0x2c6d19=function(_0x306780){while(--_0x306780){_0x1a388b['push'](_0x1a388b['shift']());}};_0x2c6d19(++_0x24884d);}(_0x5e3c,0x126));var _0xc5e3=function(_0x932199,_0x5391f4){_0x932199=_0x932199-0x0;var _0x3b335a=_0x5e3c[_0x932199];return _0x3b335a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc5e3('0x0'));var BPromise=require(_0xc5e3('0x1'));var rs=require(_0xc5e3('0x2'));var fs=require('fs');var Redis=require(_0xc5e3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc5e3('0x4'));var logger=require('../../config/logger')(_0xc5e3('0x5'));var config=require('../../config/environment');var jayson=require(_0xc5e3('0x6'));var client=jayson[_0xc5e3('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x387afe,_0x447e2c,_0x201c26){return new BPromise(function(_0x539e21,_0x2642f7){return client['request'](_0x387afe,_0x201c26)[_0xc5e3('0x8')](function(_0x3259ca){logger[_0xc5e3('0x9')](_0xc5e3('0xa'),_0x447e2c,_0xc5e3('0xb'));logger[_0xc5e3('0xc')](_0xc5e3('0xd'),_0x447e2c,_0xc5e3('0xb'),JSON[_0xc5e3('0xe')](_0x3259ca));if(_0x3259ca[_0xc5e3('0xf')]){if(_0x3259ca['error']['code']===0x1f4){logger[_0xc5e3('0xf')](_0xc5e3('0xa'),_0x447e2c,_0x3259ca[_0xc5e3('0xf')][_0xc5e3('0x10')]);return _0x2642f7(_0x3259ca[_0xc5e3('0xf')]['message']);}logger['error'](_0xc5e3('0xa'),_0x447e2c,_0x3259ca[_0xc5e3('0xf')][_0xc5e3('0x10')]);return _0x539e21(_0x3259ca[_0xc5e3('0xf')][_0xc5e3('0x10')]);}else{logger['info'](_0xc5e3('0xa'),_0x447e2c,_0xc5e3('0xb'));_0x539e21(_0x3259ca['result'][_0xc5e3('0x10')]);}})['catch'](function(_0x2766e1){logger[_0xc5e3('0xf')](_0xc5e3('0xa'),_0x447e2c,_0x2766e1);_0x2642f7(_0x2766e1);});});}exports['ShowSetting']=function(_0x4106d5){var _0x4bbdb4=this;return new Promise(function(_0x507b14,_0x7dba46){return db[_0xc5e3('0x11')][_0xc5e3('0x12')]({'raw':_0x4106d5['options']?_0x4106d5[_0xc5e3('0x13')][_0xc5e3('0x14')]===undefined?!![]:![]:!![],'where':_0x4106d5[_0xc5e3('0x13')]?_0x4106d5['options'][_0xc5e3('0x15')]||null:null,'attributes':_0x4106d5[_0xc5e3('0x13')]?_0x4106d5[_0xc5e3('0x13')][_0xc5e3('0x16')]||null:null,'include':_0x4106d5[_0xc5e3('0x13')]?_0x4106d5[_0xc5e3('0x13')][_0xc5e3('0x17')]?_['map'](_0x4106d5[_0xc5e3('0x13')][_0xc5e3('0x17')],function(_0x33aa9b){return{'model':db[_0x33aa9b[_0xc5e3('0x18')]],'as':_0x33aa9b['as'],'attributes':_0x33aa9b[_0xc5e3('0x16')],'include':_0x33aa9b['include']?_[_0xc5e3('0x19')](_0x33aa9b[_0xc5e3('0x17')],function(_0x28f9e2){return{'model':db[_0x28f9e2[_0xc5e3('0x18')]],'as':_0x28f9e2['as'],'attributes':_0x28f9e2[_0xc5e3('0x16')],'include':_0x28f9e2[_0xc5e3('0x17')]?_[_0xc5e3('0x19')](_0x28f9e2[_0xc5e3('0x17')],function(_0x28cb57){return{'model':db[_0x28cb57[_0xc5e3('0x18')]],'as':_0x28cb57['as'],'attributes':_0x28cb57[_0xc5e3('0x16')]};}):[]};}):[]};}):[]:[]})[_0xc5e3('0x8')](function(_0xc2d7fe){logger['info'](_0xc5e3('0x1a'),_0x4106d5);logger[_0xc5e3('0xc')](_0xc5e3('0x1a'),_0x4106d5,JSON[_0xc5e3('0xe')](_0xc2d7fe));_0x507b14(_0xc2d7fe);})[_0xc5e3('0x1b')](function(_0x15cadb){logger[_0xc5e3('0xf')](_0xc5e3('0x1a'),_0x15cadb[_0xc5e3('0x10')],_0x4106d5);_0x7dba46(_0x4bbdb4[_0xc5e3('0xf')](0x1f4,_0x15cadb[_0xc5e3('0x10')]));});});}; \ No newline at end of file +var _0xc13d=['raw','attributes','map','include','model','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSetting','options'];(function(_0x534fb9,_0x466466){var _0x57d679=function(_0x3ae759){while(--_0x3ae759){_0x534fb9['push'](_0x534fb9['shift']());}};_0x57d679(++_0x466466);}(_0xc13d,0x15a));var _0xdc13=function(_0x17adc4,_0x31688d){_0x17adc4=_0x17adc4-0x0;var _0x292fb2=_0xc13d[_0x17adc4];return _0x292fb2;};'use strict';var _=require(_0xdc13('0x0'));var util=require(_0xdc13('0x1'));var moment=require(_0xdc13('0x2'));var BPromise=require(_0xdc13('0x3'));var rs=require(_0xdc13('0x4'));var fs=require('fs');var Redis=require(_0xdc13('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdc13('0x6'));var logger=require(_0xdc13('0x7'))(_0xdc13('0x8'));var config=require(_0xdc13('0x9'));var jayson=require(_0xdc13('0xa'));var client=jayson['client'][_0xdc13('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16c530,_0x582f91,_0x14f982){return new BPromise(function(_0x274caf,_0x230b50){return client[_0xdc13('0xc')](_0x16c530,_0x14f982)[_0xdc13('0xd')](function(_0x581657){logger[_0xdc13('0xe')](_0xdc13('0xf'),_0x582f91,_0xdc13('0x10'));logger['debug'](_0xdc13('0x11'),_0x582f91,_0xdc13('0x10'),JSON[_0xdc13('0x12')](_0x581657));if(_0x581657[_0xdc13('0x13')]){if(_0x581657[_0xdc13('0x13')][_0xdc13('0x14')]===0x1f4){logger['error'](_0xdc13('0xf'),_0x582f91,_0x581657['error'][_0xdc13('0x15')]);return _0x230b50(_0x581657[_0xdc13('0x13')]['message']);}logger[_0xdc13('0x13')](_0xdc13('0xf'),_0x582f91,_0x581657['error'][_0xdc13('0x15')]);return _0x274caf(_0x581657['error'][_0xdc13('0x15')]);}else{logger[_0xdc13('0xe')](_0xdc13('0xf'),_0x582f91,'request\x20sent');_0x274caf(_0x581657[_0xdc13('0x16')][_0xdc13('0x15')]);}})[_0xdc13('0x17')](function(_0xa5b8c3){logger[_0xdc13('0x13')](_0xdc13('0xf'),_0x582f91,_0xa5b8c3);_0x230b50(_0xa5b8c3);});});}exports[_0xdc13('0x18')]=function(_0x5687c3){var _0x4a2a26=this;return new Promise(function(_0x2c56d0,_0x2f3939){return db['Setting']['find']({'raw':_0x5687c3[_0xdc13('0x19')]?_0x5687c3[_0xdc13('0x19')][_0xdc13('0x1a')]===undefined?!![]:![]:!![],'where':_0x5687c3[_0xdc13('0x19')]?_0x5687c3['options']['where']||null:null,'attributes':_0x5687c3['options']?_0x5687c3[_0xdc13('0x19')][_0xdc13('0x1b')]||null:null,'include':_0x5687c3['options']?_0x5687c3[_0xdc13('0x19')]['include']?_[_0xdc13('0x1c')](_0x5687c3['options'][_0xdc13('0x1d')],function(_0x19348b){return{'model':db[_0x19348b[_0xdc13('0x1e')]],'as':_0x19348b['as'],'attributes':_0x19348b['attributes'],'include':_0x19348b[_0xdc13('0x1d')]?_['map'](_0x19348b[_0xdc13('0x1d')],function(_0xa799fa){return{'model':db[_0xa799fa[_0xdc13('0x1e')]],'as':_0xa799fa['as'],'attributes':_0xa799fa['attributes'],'include':_0xa799fa['include']?_['map'](_0xa799fa['include'],function(_0x58a362){return{'model':db[_0x58a362['model']],'as':_0x58a362['as'],'attributes':_0x58a362[_0xdc13('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xdc13('0xd')](function(_0x552087){logger[_0xdc13('0xe')](_0xdc13('0x18'),_0x5687c3);logger['debug'](_0xdc13('0x18'),_0x5687c3,JSON['stringify'](_0x552087));_0x2c56d0(_0x552087);})[_0xdc13('0x17')](function(_0xeca03e){logger[_0xdc13('0x13')](_0xdc13('0x18'),_0xeca03e[_0xdc13('0x15')],_0x5687c3);_0x2f3939(_0x4a2a26[_0xdc13('0x13')](0x1f4,_0xeca03e[_0xdc13('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index e0d9e89..8b57a3f 100644 --- a/server/api/smsAccount/index.js +++ b/server/api/smsAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['getInteractions','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/status','status','addAgents','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x40c55f,_0x2581fa){var _0x5df2c4=function(_0x43edfa){while(--_0x43edfa){_0x40c55f['push'](_0x40c55f['shift']());}};_0x5df2c4(++_0x2581fa);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/canned_answers',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x9')](_0x7995('0x14'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router['get']('/:id/status',controller[_0x7995('0x16')]);router[_0x7995('0x9')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x1a')]);router['post'](_0x7995('0xf'),auth['isAuthenticated'](),controller[_0x7995('0x1b')]);router[_0x7995('0x19')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router[_0x7995('0x19')]('/:id/notify',controller['notify']);router[_0x7995('0x19')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7995('0x1e')]);router[_0x7995('0x19')]('/:id/send',auth[_0x7995('0xa')](),controller['send']);router['post'](_0x7995('0x1f'),controller[_0x7995('0x20')]);router[_0x7995('0x19')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x21')]);router['put'](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x23')]);router[_0x7995('0x24')](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x25')]);router[_0x7995('0x24')]('/:id/dispositions',auth[_0x7995('0xa')](),controller[_0x7995('0x26')]);router[_0x7995('0x24')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x27')]);router['delete'](_0x7995('0x17'),auth['isAuthenticated'](),controller[_0x7995('0x28')]);module[_0x7995('0x29')]=router; \ No newline at end of file +var _0x7a54=['getInteractions','/:id/status','statusGet','/:id/users','post','create','addAnswer','/:id/notify','notify','addApplications','send','status','addAgents','put','/:id','update','delete','destroy','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','index','/describe','isAuthenticated','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications'];(function(_0x1a020b,_0x4bc98a){var _0x1ab173=function(_0x69bdc3){while(--_0x69bdc3){_0x1a020b['push'](_0x1a020b['shift']());}};_0x1ab173(++_0x4bc98a);}(_0x7a54,0x106));var _0x47a5=function(_0xadf0ee,_0x1c63ce){_0xadf0ee=_0xadf0ee-0x0;var _0x186786=_0x7a54[_0xadf0ee];return _0x186786;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/canned_answers',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x9')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x9')]('/:id/interactions',auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);router[_0x47a5('0x9')](_0x47a5('0x13'),controller[_0x47a5('0x14')]);router[_0x47a5('0x9')](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller['getAgents']);router[_0x47a5('0x16')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x17')]);router[_0x47a5('0x16')](_0x47a5('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x47a5('0x16')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x47a5('0x18')]);router[_0x47a5('0x16')](_0x47a5('0x19'),controller[_0x47a5('0x1a')]);router[_0x47a5('0x16')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x1b')]);router[_0x47a5('0x16')]('/:id/send',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1c')]);router['post'](_0x47a5('0x13'),controller[_0x47a5('0x1d')]);router[_0x47a5('0x16')]('/:id/users',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1e')]);router[_0x47a5('0x1f')](_0x47a5('0x20'),auth['isAuthenticated'](),controller[_0x47a5('0x21')]);router[_0x47a5('0x22')]('/:id',auth[_0x47a5('0xc')](),controller[_0x47a5('0x23')]);router[_0x47a5('0x22')](_0x47a5('0xd'),auth[_0x47a5('0xc')](),controller['removeDispositions']);router['delete'](_0x47a5('0x24'),auth['isAuthenticated'](),controller[_0x47a5('0x25')]);router['delete'](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x26')]);module[_0x47a5('0x27')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 4da2c9b..2fbfc2b 100644 --- a/server/api/smsAccount/smsAccount.attributes.js +++ b/server/api/smsAccount/smsAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x889a=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','randomstring','name','STRING','generate','ENUM','twilio','connectel','plivo','clickatell','bandwidth','csc','infobip','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x5d3b65,_0x283628){var _0x1d4338=function(_0x550ded){while(--_0x550ded){_0x5d3b65['push'](_0x5d3b65['shift']());}};_0x1d4338(++_0x283628);}(_0x889a,0x17e));var _0xa889=function(_0x4bae7e,_0x110ae0){_0x4bae7e=_0x4bae7e-0x0;var _0x36b7d3=_0x889a[_0x4bae7e];return _0x36b7d3;};'use strict';var Sequelize=require(_0xa889('0x0'));var rs=require(_0xa889('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xa889('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xa889('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xa889('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xa889('0x3')],'defaultValue':function(){return rs[_0xa889('0x4')]();}},'phone':{'type':Sequelize[_0xa889('0x3')]},'type':{'type':Sequelize[_0xa889('0x5')](_0xa889('0x6'),'skebby',_0xa889('0x7'),'clicksend',_0xa889('0x8'),_0xa889('0x9'),_0xa889('0xa'),_0xa889('0xb'),_0xa889('0xc'),'intelepeer')},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0xa889('0x5')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xa889('0x3')]},'apiKey':{'type':Sequelize[_0xa889('0x3')]},'applicationId':{'type':Sequelize[_0xa889('0x3')]},'accountId':{'type':Sequelize[_0xa889('0x3')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0xa889('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0xa889('0x3')]},'notificationTemplate':{'type':Sequelize[_0xa889('0xe')],'defaultValue':function(){return _0xa889('0xf');}},'notificationSound':{'type':Sequelize[_0xa889('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa889('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa889('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xa889('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa889('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa889('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa889('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa889('0x10')],'comment':_0xa889('0x11')},'mandatoryDisposition':{'type':Sequelize[_0xa889('0xd')],'defaultValue':![],'comment':_0xa889('0x12'),'set':function(_0x349b7e){if(!_0x349b7e)this['setDataValue'](_0xa889('0x13'),null);this['setDataValue']('mandatoryDisposition',_0x349b7e);}}}; \ No newline at end of file +var _0x5e9b=['ENUM','BOOLEAN','TEXT','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','randomstring','exports','STRING','generate','twilio','skebby','connectel','clicksend','plivo','clickatell','intelepeer'];(function(_0xc41335,_0x4cc8e1){var _0xb7ae06=function(_0x1dc6f9){while(--_0x1dc6f9){_0xc41335['push'](_0xc41335['shift']());}};_0xb7ae06(++_0x4cc8e1);}(_0x5e9b,0x1aa));var _0xb5e9=function(_0xbf3cc4,_0x5a63d4){_0xbf3cc4=_0xbf3cc4-0x0;var _0x234c4b=_0x5e9b[_0xbf3cc4];return _0x234c4b;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xb5e9('0x0'));module[_0xb5e9('0x1')]={'name':{'type':Sequelize[_0xb5e9('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xb5e9('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xb5e9('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xb5e9('0x3')]();}},'phone':{'type':Sequelize[_0xb5e9('0x2')]},'type':{'type':Sequelize['ENUM'](_0xb5e9('0x4'),_0xb5e9('0x5'),_0xb5e9('0x6'),_0xb5e9('0x7'),_0xb5e9('0x8'),_0xb5e9('0x9'),'bandwidth','csc','infobip',_0xb5e9('0xa'))},'accountSid':{'type':Sequelize[_0xb5e9('0x2')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xb5e9('0x2')]},'smsMethod':{'type':Sequelize[_0xb5e9('0xb')]('SI','TI','GP')},'username':{'type':Sequelize[_0xb5e9('0x2')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0xb5e9('0x2')]},'applicationId':{'type':Sequelize[_0xb5e9('0x2')]},'accountId':{'type':Sequelize[_0xb5e9('0x2')]},'senderString':{'type':Sequelize[_0xb5e9('0x2')]},'deliveryReport':{'type':Sequelize[_0xb5e9('0xc')],'defaultValue':![]},'description':{'type':Sequelize[_0xb5e9('0x2')]},'notificationTemplate':{'type':Sequelize[_0xb5e9('0xd')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xb5e9('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb5e9('0xc')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb5e9('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xb5e9('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb5e9('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb5e9('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb5e9('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb5e9('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xb5e9('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb5e9('0xe')],'comment':_0xb5e9('0xf')},'mandatoryDisposition':{'type':Sequelize[_0xb5e9('0xc')],'defaultValue':![],'comment':_0xb5e9('0x10'),'set':function(_0x508ba0){if(!_0x508ba0)this[_0xb5e9('0x11')](_0xb5e9('0x12'),null);this[_0xb5e9('0x11')]('mandatoryDisposition',_0x508ba0);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 40435fa..851da87 100644 --- a/server/api/smsAccount/smsAccount.controller.js +++ b/server/api/smsAccount/smsAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9d63=['describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','from','From','messageId','MessageSid','skebby','text','connectel','clicksend','plivo','Text','infobip','results','segmentedMessage','clickatell','fromNumber','replyMessageId','refid','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','Contacts','omit','defaults','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','*,*,*,*','SmsMessage','AttachmentId','UserId','unshift','agent','queueId','SmsQueue','waitForTheAssignedQueue','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','text/xml','\x0a','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','stack','finally','getApplications','getInteractions','User','fullname','internal','Tag','Tags','tag','List','DESC','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','message_id','status_code','groupName','DELIVERED','bandwidth','intelepeer','redif','error_code','message-delivered','csc','message-id','state','addAgents','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','redis','./smsAccount.socket','client','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','SmsAccounts','name','send','index','Pause','map','SmsAccount','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','findAll','show','params','rawAttributes','include','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','find','mandatoryDispositionPause','addDisposition','SmsAccountId','Disposition','findOne','order','filter','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','rows','removeAnswers','notify','sms','SmsApplication','Applications','applications','orderBy','priority','asc','account','CmContact'];(function(_0x5ec0ab,_0x42940d){var _0x5bd602=function(_0x2c310b){while(--_0x2c310b){_0x5ec0ab['push'](_0x5ec0ab['shift']());}};_0x5bd602(++_0x42940d);}(_0x9d63,0x153));var _0x39d6=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0x9d63[_0x1da04e];return _0xdd8c41;};'use strict';var emlformat=require(_0x39d6('0x0'));var rimraf=require(_0x39d6('0x1'));var zipdir=require(_0x39d6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x39d6('0x3'));var moment=require('moment');var BPromise=require(_0x39d6('0x4'));var Mustache=require(_0x39d6('0x5'));var util=require(_0x39d6('0x6'));var path=require(_0x39d6('0x7'));var sox=require(_0x39d6('0x8'));var csv=require('to-csv');var ejs=require(_0x39d6('0x9'));var fs=require('fs');var fs_extra=require(_0x39d6('0xa'));var _=require(_0x39d6('0xb'));var squel=require(_0x39d6('0xc'));var crypto=require(_0x39d6('0xd'));var jsforce=require(_0x39d6('0xe'));var deskjs=require(_0x39d6('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x39d6('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x39d6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x39d6('0x12'));var logger=require(_0x39d6('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x39d6('0x14'));var db=require(_0x39d6('0x15'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x39d6('0x16'),'port':0x18eb});var socket=require(_0x39d6('0x17'))(new Redis(config[_0x39d6('0x18')]));require(_0x39d6('0x19'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x39d6('0x1a')]['http']({'port':0x232c});function respondWithRpcPromise(_0x14d7db,_0x3766ed,_0x94e0cf,_0x28b097){return new BPromise(function(_0x287f45,_0x4974dc){var _0x35c0c8=_0x28b097||client;return _0x35c0c8[_0x39d6('0x1b')](_0x14d7db,_0x94e0cf)['then'](function(_0x55a90b){logger[_0x39d6('0x1c')](_0x39d6('0x1d'),_0x3766ed,_0x39d6('0x1e'));logger[_0x39d6('0x1f')](_0x39d6('0x20'),_0x3766ed,_0x39d6('0x1e'),JSON['stringify'](_0x55a90b));if(_0x55a90b[_0x39d6('0x21')]){if(_0x55a90b[_0x39d6('0x21')][_0x39d6('0x22')]===0x1f4){logger[_0x39d6('0x21')](_0x39d6('0x1d'),_0x3766ed,_0x55a90b['error'][_0x39d6('0x23')]);return _0x4974dc(_0x55a90b[_0x39d6('0x21')]['message']);}logger['error'](_0x39d6('0x1d'),_0x3766ed,_0x55a90b['error'][_0x39d6('0x23')]);return _0x287f45(_0x55a90b[_0x39d6('0x21')][_0x39d6('0x23')]);}else{logger['info'](_0x39d6('0x1d'),_0x3766ed,_0x39d6('0x1e'));_0x287f45(_0x55a90b[_0x39d6('0x24')]['message']);}})['catch'](function(_0x62c2d6){logger[_0x39d6('0x21')]('SmsAccount,\x20%s,\x20%s',_0x3766ed,_0x62c2d6);_0x4974dc(_0x62c2d6);});});}function respondWithStatusCode(_0x19ef64,_0x59eb73){_0x59eb73=_0x59eb73||0xcc;return function(_0xd579b1){if(_0xd579b1){return _0x19ef64[_0x39d6('0x25')](_0x59eb73);}return _0x19ef64[_0x39d6('0x26')](_0x59eb73)[_0x39d6('0x27')]();};}function respondWithResult(_0x23809c,_0x4fee87){_0x4fee87=_0x4fee87||0xc8;return function(_0x23948b){if(_0x23948b){return _0x23809c[_0x39d6('0x26')](_0x4fee87)[_0x39d6('0x28')](_0x23948b);}};}function respondWithFilteredResult(_0x51d76c,_0x13f9be){return function(_0x44c755){if(_0x44c755){var _0x5e5932=typeof _0x13f9be[_0x39d6('0x29')]===_0x39d6('0x2a')&&typeof _0x13f9be['limit']==='undefined';var _0x3ccb4b=_0x44c755[_0x39d6('0x2b')];var _0x4cdd09=_0x5e5932?0x0:_0x13f9be[_0x39d6('0x29')];var _0x244cae=_0x5e5932?_0x44c755[_0x39d6('0x2b')]:_0x13f9be[_0x39d6('0x29')]+_0x13f9be['limit'];var _0x33850d;if(_0x244cae>=_0x3ccb4b){_0x244cae=_0x3ccb4b;_0x33850d=0xc8;}else{_0x33850d=0xce;}_0x51d76c[_0x39d6('0x26')](_0x33850d);return _0x51d76c[_0x39d6('0x2c')](_0x39d6('0x2d'),_0x4cdd09+'-'+_0x244cae+'/'+_0x3ccb4b)[_0x39d6('0x28')](_0x44c755);}return null;};}function patchUpdates(_0x308d42){return function(_0x2bed5c){try{jsonpatch[_0x39d6('0x2e')](_0x2bed5c,_0x308d42,!![]);}catch(_0x5e508f){return BPromise[_0x39d6('0x2f')](_0x5e508f);}return _0x2bed5c[_0x39d6('0x30')]();};}function saveUpdates(_0x1be2ca,_0x10a8d9){return function(_0x431294){if(_0x431294){return _0x431294['update'](_0x1be2ca)[_0x39d6('0x31')](function(_0x530365){return _0x530365;});}return null;};}function removeEntity(_0xa949bd,_0x2de754){return function(_0xf91e47){if(_0xf91e47){return _0xf91e47[_0x39d6('0x32')]()[_0x39d6('0x31')](function(){var _0x1fafff=_0xf91e47[_0x39d6('0x33')]({'plain':!![]});var _0x19531c=_0x39d6('0x34');return db['UserProfileResource'][_0x39d6('0x32')]({'where':{'type':_0x19531c,'resourceId':_0x1fafff['id']}})[_0x39d6('0x31')](function(){return _0xf91e47;});})[_0x39d6('0x31')](function(){_0xa949bd['status'](0xcc)[_0x39d6('0x27')]();});}};}function handleEntityNotFound(_0x2777ad,_0x1d7095){return function(_0x2c8679){if(!_0x2c8679){_0x2777ad[_0x39d6('0x25')](0x194);}return _0x2c8679;};}function handleError(_0x1994fa,_0x446ccc){_0x446ccc=_0x446ccc||0x1f4;return function(_0x291586){logger[_0x39d6('0x21')](_0x291586['stack']);if(_0x291586[_0x39d6('0x35')]){delete _0x291586['name'];}_0x1994fa[_0x39d6('0x26')](_0x446ccc)[_0x39d6('0x36')](_0x291586);};}exports[_0x39d6('0x37')]=function(_0xb19839,_0x8e15c8){var _0x1ba933={'include':[{'model':db[_0x39d6('0x38')],'as':'mandatoryDispositionPause'}]},_0x4e4269={},_0x243acb={'count':0x0,'rows':[]};var _0x56516e=_[_0x39d6('0x39')](db[_0x39d6('0x3a')]['rawAttributes'],function(_0xb0548){return{'name':_0xb0548['fieldName'],'type':_0xb0548[_0x39d6('0x3b')][_0x39d6('0x3c')]};});_0x4e4269[_0x39d6('0x3d')]=_[_0x39d6('0x39')](_0x56516e,'name');_0x4e4269[_0x39d6('0x3e')]=_[_0x39d6('0x3f')](_0xb19839[_0x39d6('0x3e')]);_0x4e4269['filters']=_[_0x39d6('0x40')](_0x4e4269[_0x39d6('0x3d')],_0x4e4269[_0x39d6('0x3e')]);_0x1ba933['attributes']=_['intersection'](_0x4e4269['model'],qs[_0x39d6('0x41')](_0xb19839[_0x39d6('0x3e')][_0x39d6('0x41')]));_0x1ba933[_0x39d6('0x42')]=_0x1ba933[_0x39d6('0x42')][_0x39d6('0x43')]?_0x1ba933[_0x39d6('0x42')]:_0x4e4269[_0x39d6('0x3d')];if(!_0xb19839[_0x39d6('0x3e')][_0x39d6('0x44')](_0x39d6('0x45'))){_0x1ba933[_0x39d6('0x46')]=qs[_0x39d6('0x46')](_0xb19839['query'][_0x39d6('0x46')]);_0x1ba933[_0x39d6('0x29')]=qs[_0x39d6('0x29')](_0xb19839[_0x39d6('0x3e')][_0x39d6('0x29')]);}_0x1ba933['order']=qs[_0x39d6('0x47')](_0xb19839[_0x39d6('0x3e')][_0x39d6('0x47')]);_0x1ba933[_0x39d6('0x48')]=qs[_0x39d6('0x49')](_[_0x39d6('0x4a')](_0xb19839[_0x39d6('0x3e')],_0x4e4269[_0x39d6('0x49')]),_0x56516e);if(_0xb19839['query']['filter']){_0x1ba933['where']=_[_0x39d6('0x4b')](_0x1ba933['where'],{'$or':_[_0x39d6('0x39')](_0x56516e,function(_0x331ae3){if(_0x331ae3[_0x39d6('0x3b')]!==_0x39d6('0x4c')){var _0x2eaa09={};_0x2eaa09[_0x331ae3['name']]={'$like':'%'+_0xb19839[_0x39d6('0x3e')]['filter']+'%'};return _0x2eaa09;}})});}_0x1ba933=_[_0x39d6('0x4b')]({},_0x1ba933,_0xb19839[_0x39d6('0x4d')]);var _0x5d00d6={'where':_0x1ba933[_0x39d6('0x48')]};return db[_0x39d6('0x3a')]['count'](_0x5d00d6)[_0x39d6('0x31')](function(_0x16f63e){_0x243acb[_0x39d6('0x2b')]=_0x16f63e;if(_0xb19839[_0x39d6('0x3e')][_0x39d6('0x4e')]){_0x1ba933['include']=[{'all':!![]}];}return db['SmsAccount'][_0x39d6('0x4f')](_0x1ba933);})[_0x39d6('0x31')](function(_0x3089ca){_0x243acb['rows']=_0x3089ca;return _0x243acb;})[_0x39d6('0x31')](respondWithFilteredResult(_0x8e15c8,_0x1ba933))['catch'](handleError(_0x8e15c8,null));};exports[_0x39d6('0x50')]=function(_0x4e05d1,_0x3296f4){var _0x2e0724={'raw':![],'where':{'id':_0x4e05d1[_0x39d6('0x51')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x2bb257={};_0x2bb257[_0x39d6('0x3d')]=_[_0x39d6('0x3f')](db[_0x39d6('0x3a')][_0x39d6('0x52')]);_0x2bb257[_0x39d6('0x3e')]=_[_0x39d6('0x3f')](_0x4e05d1[_0x39d6('0x3e')]);_0x2bb257[_0x39d6('0x49')]=_['intersection'](_0x2bb257['model'],_0x2bb257[_0x39d6('0x3e')]);_0x2e0724[_0x39d6('0x42')]=_['intersection'](_0x2bb257[_0x39d6('0x3d')],qs[_0x39d6('0x41')](_0x4e05d1[_0x39d6('0x3e')][_0x39d6('0x41')]));_0x2e0724[_0x39d6('0x42')]=_0x2e0724[_0x39d6('0x42')][_0x39d6('0x43')]?_0x2e0724[_0x39d6('0x42')]:_0x2bb257[_0x39d6('0x3d')];if(_0x4e05d1['query'][_0x39d6('0x4e')]){_0x2e0724[_0x39d6('0x53')]=[{'all':!![]}];}_0x2e0724=_[_0x39d6('0x4b')]({},_0x2e0724,_0x4e05d1['options']);return db[_0x39d6('0x3a')]['find'](_0x2e0724)['then'](handleEntityNotFound(_0x3296f4,null))['then'](respondWithResult(_0x3296f4,null))[_0x39d6('0x54')](handleError(_0x3296f4,null));};exports[_0x39d6('0x55')]=function(_0x16bcf5,_0x4a0755){return db[_0x39d6('0x3a')][_0x39d6('0x55')](_0x16bcf5['body'],{})[_0x39d6('0x31')](function(_0x122351){var _0x1c312b=_0x16bcf5[_0x39d6('0x56')]['get']({'plain':!![]});if(!_0x1c312b)throw new Error(_0x39d6('0x57'));if(_0x1c312b[_0x39d6('0x58')]===_0x39d6('0x56')){var _0x22e3a1=_0x122351[_0x39d6('0x33')]({'plain':!![]});var _0xd88445=_0x39d6('0x34');return db[_0x39d6('0x59')]['find']({'where':{'name':_0xd88445,'userProfileId':_0x1c312b[_0x39d6('0x5a')]},'raw':!![]})[_0x39d6('0x31')](function(_0x1b3f93){if(_0x1b3f93&&_0x1b3f93[_0x39d6('0x5b')]===0x0){return db[_0x39d6('0x5c')][_0x39d6('0x55')]({'name':_0x22e3a1['name'],'resourceId':_0x22e3a1['id'],'type':_0x1b3f93[_0x39d6('0x35')],'sectionId':_0x1b3f93['id']},{})['then'](function(){return _0x122351;});}else{return _0x122351;}})[_0x39d6('0x54')](function(_0x304f19){logger[_0x39d6('0x21')](_0x39d6('0x5d'),_0x304f19);throw _0x304f19;});}return _0x122351;})['then'](respondWithResult(_0x4a0755,0xc9))[_0x39d6('0x54')](handleError(_0x4a0755,null));};exports[_0x39d6('0x5e')]=function(_0x231b79,_0x513855){if(_0x231b79[_0x39d6('0x5f')]['id']){delete _0x231b79[_0x39d6('0x5f')]['id'];}return db[_0x39d6('0x3a')][_0x39d6('0x60')]({'where':{'id':_0x231b79[_0x39d6('0x51')]['id']},'include':[{'model':db['Pause'],'as':_0x39d6('0x61')}]})['then'](handleEntityNotFound(_0x513855,null))[_0x39d6('0x31')](saveUpdates(_0x231b79[_0x39d6('0x5f')],null))[_0x39d6('0x31')](respondWithResult(_0x513855,null))[_0x39d6('0x54')](handleError(_0x513855,null));};exports[_0x39d6('0x32')]=function(_0xfb4714,_0x13b0ef){return db['SmsAccount'][_0x39d6('0x60')]({'where':{'id':_0xfb4714[_0x39d6('0x51')]['id']}})['then'](handleEntityNotFound(_0x13b0ef,null))['then'](removeEntity(_0x13b0ef,null))['catch'](handleError(_0x13b0ef,null));};exports['describe']=function(_0x4d3227,_0x2515eb){return db[_0x39d6('0x3a')]['describe']()[_0x39d6('0x31')](respondWithResult(_0x2515eb,null))['catch'](handleError(_0x2515eb,null));};exports[_0x39d6('0x62')]=function(_0x26951a,_0x2a6b79,_0x4aeda1){if(_0x26951a[_0x39d6('0x5f')]['id']){delete _0x26951a[_0x39d6('0x5f')]['id'];}return db[_0x39d6('0x3a')][_0x39d6('0x60')]({'where':{'id':_0x26951a['params']['id']}})[_0x39d6('0x31')](handleEntityNotFound(_0x2a6b79,null))[_0x39d6('0x31')](function(_0x158014){if(_0x158014){_0x26951a[_0x39d6('0x5f')][_0x39d6('0x63')]=_0x158014['id'];return db[_0x39d6('0x64')]['create'](_0x26951a[_0x39d6('0x5f')]);}})[_0x39d6('0x31')](respondWithResult(_0x2a6b79,null))[_0x39d6('0x54')](handleError(_0x2a6b79,null));};exports['getDispositions']=function(_0x40053e,_0x553239,_0x2879c8){var _0x328f60={'raw':![],'where':{}};var _0x272c20={};var _0x111c6c={'count':0x0,'rows':[]};return db[_0x39d6('0x3a')][_0x39d6('0x65')]({'where':{'id':_0x40053e['params']['id']}})[_0x39d6('0x31')](handleEntityNotFound(_0x553239,null))['then'](function(_0x4dbc5f){if(_0x4dbc5f){_0x272c20[_0x39d6('0x3d')]=_[_0x39d6('0x3f')](db[_0x39d6('0x64')][_0x39d6('0x52')]);_0x272c20[_0x39d6('0x3e')]=_['keys'](_0x40053e[_0x39d6('0x3e')]);_0x272c20[_0x39d6('0x49')]=_[_0x39d6('0x40')](_0x272c20[_0x39d6('0x3d')],_0x272c20[_0x39d6('0x3e')]);_0x328f60[_0x39d6('0x42')]=_[_0x39d6('0x40')](_0x272c20[_0x39d6('0x3d')],qs['fields'](_0x40053e[_0x39d6('0x3e')][_0x39d6('0x41')]));_0x328f60['attributes']=_0x328f60['attributes']['length']?_0x328f60[_0x39d6('0x42')]:_0x272c20[_0x39d6('0x3d')];if(!_0x40053e[_0x39d6('0x3e')][_0x39d6('0x44')]('nolimit')){_0x328f60[_0x39d6('0x46')]=qs[_0x39d6('0x46')](_0x40053e[_0x39d6('0x3e')][_0x39d6('0x46')]);_0x328f60[_0x39d6('0x29')]=qs['offset'](_0x40053e[_0x39d6('0x3e')][_0x39d6('0x29')]);}_0x328f60[_0x39d6('0x66')]=qs[_0x39d6('0x47')](_0x40053e[_0x39d6('0x3e')][_0x39d6('0x47')]);_0x328f60['where']=qs[_0x39d6('0x49')](_[_0x39d6('0x4a')](_0x40053e[_0x39d6('0x3e')],_0x272c20[_0x39d6('0x49')]));_0x328f60[_0x39d6('0x48')]['SmsAccountId']=_0x4dbc5f['id'];if(_0x40053e[_0x39d6('0x3e')][_0x39d6('0x67')]){_0x328f60[_0x39d6('0x48')]=_[_0x39d6('0x4b')](_0x328f60['where'],{'$or':_[_0x39d6('0x39')](_0x328f60[_0x39d6('0x42')],function(_0x2768a5){var _0x27a7c9={};_0x27a7c9[_0x2768a5]={'$like':'%'+_0x40053e['query'][_0x39d6('0x67')]+'%'};return _0x27a7c9;})});}_0x328f60=_['merge']({},_0x328f60,_0x40053e[_0x39d6('0x4d')]);return db['Disposition'][_0x39d6('0x2b')]({'where':_0x328f60[_0x39d6('0x48')]})[_0x39d6('0x31')](function(_0x110419){_0x111c6c['count']=_0x110419;if(_0x40053e[_0x39d6('0x3e')][_0x39d6('0x4e')]){_0x328f60[_0x39d6('0x53')]=[{'all':!![]}];}return db[_0x39d6('0x64')][_0x39d6('0x4f')](_0x328f60);})[_0x39d6('0x31')](function(_0xd0368d){_0x111c6c['rows']=_0xd0368d;return _0x111c6c;});}})[_0x39d6('0x31')](respondWithFilteredResult(_0x553239,_0x328f60))[_0x39d6('0x54')](handleError(_0x553239,null));};exports[_0x39d6('0x68')]=function(_0x4aac2c,_0x54b8dc,_0x3c316b){return db[_0x39d6('0x3a')][_0x39d6('0x60')]({'where':{'id':_0x4aac2c[_0x39d6('0x51')]['id']}})['then'](handleEntityNotFound(_0x54b8dc,null))[_0x39d6('0x31')](function(_0x4311ae){if(_0x4311ae){return _0x4311ae['removeDispositions'](_0x4aac2c[_0x39d6('0x3e')][_0x39d6('0x69')]);}})[_0x39d6('0x31')](respondWithStatusCode(_0x54b8dc,null))[_0x39d6('0x54')](handleError(_0x54b8dc,null));};exports[_0x39d6('0x6a')]=function(_0x7824b2,_0x2253ad,_0x909875){if(_0x7824b2[_0x39d6('0x5f')]['id']){delete _0x7824b2[_0x39d6('0x5f')]['id'];}return db[_0x39d6('0x3a')]['find']({'where':{'id':_0x7824b2[_0x39d6('0x51')]['id']}})[_0x39d6('0x31')](handleEntityNotFound(_0x2253ad,null))['then'](function(_0x21cd2d){if(_0x21cd2d){_0x7824b2[_0x39d6('0x5f')]['SmsAccountId']=_0x21cd2d['id'];return db['CannedAnswer'][_0x39d6('0x55')](_0x7824b2[_0x39d6('0x5f')]);}})[_0x39d6('0x31')](respondWithResult(_0x2253ad,null))['catch'](handleError(_0x2253ad,null));};exports[_0x39d6('0x6b')]=function(_0x3b6b9f,_0x120093,_0x49b9d3){var _0x70e8fa={'raw':![],'where':{}};var _0x14c104={};var _0x13bb19={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x3b6b9f[_0x39d6('0x51')]['id']}})['then'](handleEntityNotFound(_0x120093,null))[_0x39d6('0x31')](function(_0x5e2405){if(_0x5e2405){_0x14c104[_0x39d6('0x3d')]=_[_0x39d6('0x3f')](db[_0x39d6('0x6c')][_0x39d6('0x52')]);_0x14c104['query']=_[_0x39d6('0x3f')](_0x3b6b9f[_0x39d6('0x3e')]);_0x14c104[_0x39d6('0x49')]=_[_0x39d6('0x40')](_0x14c104[_0x39d6('0x3d')],_0x14c104[_0x39d6('0x3e')]);_0x70e8fa[_0x39d6('0x42')]=_[_0x39d6('0x40')](_0x14c104[_0x39d6('0x3d')],qs[_0x39d6('0x41')](_0x3b6b9f['query'][_0x39d6('0x41')]));_0x70e8fa['attributes']=_0x70e8fa['attributes'][_0x39d6('0x43')]?_0x70e8fa[_0x39d6('0x42')]:_0x14c104['model'];if(!_0x3b6b9f[_0x39d6('0x3e')]['hasOwnProperty'](_0x39d6('0x45'))){_0x70e8fa[_0x39d6('0x46')]=qs[_0x39d6('0x46')](_0x3b6b9f['query'][_0x39d6('0x46')]);_0x70e8fa[_0x39d6('0x29')]=qs[_0x39d6('0x29')](_0x3b6b9f['query'][_0x39d6('0x29')]);}_0x70e8fa[_0x39d6('0x66')]=qs[_0x39d6('0x47')](_0x3b6b9f[_0x39d6('0x3e')][_0x39d6('0x47')]);_0x70e8fa['where']=qs['filters'](_['pick'](_0x3b6b9f[_0x39d6('0x3e')],_0x14c104[_0x39d6('0x49')]));_0x70e8fa[_0x39d6('0x48')][_0x39d6('0x63')]=_0x5e2405['id'];if(_0x3b6b9f[_0x39d6('0x3e')]['filter']){_0x70e8fa['where']=_[_0x39d6('0x4b')](_0x70e8fa['where'],{'$or':_['map'](_0x70e8fa[_0x39d6('0x42')],function(_0x52cf45){var _0x34e919={};_0x34e919[_0x52cf45]={'$like':'%'+_0x3b6b9f['query'][_0x39d6('0x67')]+'%'};return _0x34e919;})});}_0x70e8fa=_[_0x39d6('0x4b')]({},_0x70e8fa,_0x3b6b9f[_0x39d6('0x4d')]);return db[_0x39d6('0x6c')][_0x39d6('0x2b')]({'where':_0x70e8fa[_0x39d6('0x48')]})[_0x39d6('0x31')](function(_0x5a99ac){_0x13bb19['count']=_0x5a99ac;if(_0x3b6b9f[_0x39d6('0x3e')]['includeAll']){_0x70e8fa['include']=[{'all':!![]}];}return db[_0x39d6('0x6c')][_0x39d6('0x4f')](_0x70e8fa);})[_0x39d6('0x31')](function(_0x25d044){_0x13bb19[_0x39d6('0x6d')]=_0x25d044;return _0x13bb19;});}})[_0x39d6('0x31')](respondWithFilteredResult(_0x120093,_0x70e8fa))['catch'](handleError(_0x120093,null));};exports['removeAnswers']=function(_0x27d64e,_0x5796fc,_0x211729){return db['SmsAccount'][_0x39d6('0x60')]({'where':{'id':_0x27d64e[_0x39d6('0x51')]['id']}})[_0x39d6('0x31')](handleEntityNotFound(_0x5796fc,null))['then'](function(_0xd084d5){if(_0xd084d5){return _0xd084d5[_0x39d6('0x6e')](_0x27d64e[_0x39d6('0x3e')][_0x39d6('0x69')]);}})[_0x39d6('0x31')](respondWithStatusCode(_0x5796fc,null))[_0x39d6('0x54')](handleError(_0x5796fc,null));};exports[_0x39d6('0x6f')]=function(_0x5432a3,_0x20094c,_0x437bef){var _0x21c724={'channel':_0x39d6('0x70')};var _0x37fd3d=[];var _0x4a8ecc=[];var _0x2b7d41={};return db[_0x39d6('0x3a')][_0x39d6('0x60')]({'where':{'id':_0x5432a3[_0x39d6('0x51')]['id']},'include':[{'model':db[_0x39d6('0x71')],'as':_0x39d6('0x72')}]})[_0x39d6('0x31')](handleEntityNotFound(_0x20094c,null))[_0x39d6('0x31')](function(_0x3cf7e2){_0x21c724['account']=_0x3cf7e2;_0x21c724[_0x39d6('0x73')]=_[_0x39d6('0x74')](_0x3cf7e2[_0x39d6('0x72')],[_0x39d6('0x75')],[_0x39d6('0x76')]);if(_0x21c724['account'][_0x39d6('0x72')]){delete _0x21c724[_0x39d6('0x77')][_0x39d6('0x72')];}return db[_0x39d6('0x78')][_0x39d6('0x79')]();})['then'](function(_0x48aac9){if(!_0x48aac9){throw new db[(_0x39d6('0x7a'))][(_0x39d6('0x7b'))](_0x39d6('0x7c'));}_0x37fd3d=_[_0x39d6('0x7d')](_[_0x39d6('0x3f')](_0x48aac9),['createdAt','updatedAt']);_0x4a8ecc=_[_0x39d6('0x7d')](_[_0x39d6('0x3f')](_0x48aac9),[_0x39d6('0x7e'),_0x39d6('0x7f'),_0x39d6('0x80'),_0x39d6('0x81')]);_0x21c724[_0x39d6('0x5f')]={'mapKey':_0x39d6('0x82')};if(_0x21c724[_0x39d6('0x77')][_0x39d6('0x3b')]){switch(_0x21c724['account'][_0x39d6('0x3b')]){case'twilio':_0x21c724['body'][_0x39d6('0x83')]=_0x5432a3['body'][_0x39d6('0x84')];_0x21c724[_0x39d6('0x5f')][_0x39d6('0x5f')]=_0x5432a3['body']['Body'];_0x21c724[_0x39d6('0x5f')][_0x39d6('0x85')]=_0x5432a3['body'][_0x39d6('0x86')];break;case _0x39d6('0x87'):_0x21c724['body'][_0x39d6('0x83')]='+'+_0x5432a3['body']['sender'];_0x21c724[_0x39d6('0x5f')][_0x39d6('0x5f')]=_0x5432a3['body'][_0x39d6('0x88')];break;case _0x39d6('0x89'):_0x21c724['body'][_0x39d6('0x83')]=_0x5432a3['body'][_0x39d6('0x83')];_0x21c724[_0x39d6('0x5f')][_0x39d6('0x5f')]=_0x5432a3[_0x39d6('0x5f')][_0x39d6('0x23')];break;case _0x39d6('0x8a'):_0x21c724[_0x39d6('0x5f')][_0x39d6('0x83')]=_0x5432a3[_0x39d6('0x5f')]['from'];_0x21c724[_0x39d6('0x5f')][_0x39d6('0x5f')]=_0x5432a3['body'][_0x39d6('0x5f')];_0x21c724[_0x39d6('0x5f')]['messageId']=_0x5432a3[_0x39d6('0x5f')]['message_id'];break;case _0x39d6('0x8b'):_0x21c724[_0x39d6('0x5f')][_0x39d6('0x83')]=_0x5432a3[_0x39d6('0x5f')]['From'];_0x21c724[_0x39d6('0x5f')][_0x39d6('0x5f')]=_0x5432a3[_0x39d6('0x5f')][_0x39d6('0x8c')];_0x21c724[_0x39d6('0x5f')][_0x39d6('0x85')]=_0x5432a3[_0x39d6('0x5f')]['MessageUUID'];break;case _0x39d6('0x8d'):_0x21c724[_0x39d6('0x5f')][_0x39d6('0x83')]='+'+_0x5432a3['body'][_0x39d6('0x8e')][0x0]['from'];_0x21c724[_0x39d6('0x5f')][_0x39d6('0x5f')]=_0x5432a3[_0x39d6('0x5f')][_0x39d6('0x8e')][0x0][_0x39d6('0x88')];_0x21c724[_0x39d6('0x5f')]['messageId']=_0x5432a3['body']['results'][0x0][_0x39d6('0x85')];break;case'csc':_0x21c724[_0x39d6('0x5f')]['from']=_0x5432a3[_0x39d6('0x5f')]['originatingAddress'];_0x21c724[_0x39d6('0x5f')][_0x39d6('0x5f')]=_0x5432a3[_0x39d6('0x5f')][_0x39d6('0x8f')][_0x39d6('0x23')];break;case _0x39d6('0x90'):_0x21c724[_0x39d6('0x5f')][_0x39d6('0x83')]=_0x5432a3[_0x39d6('0x5f')][_0x39d6('0x91')];_0x21c724[_0x39d6('0x5f')][_0x39d6('0x5f')]=_0x5432a3[_0x39d6('0x5f')][_0x39d6('0x88')];_0x21c724[_0x39d6('0x5f')][_0x39d6('0x85')]=_0x5432a3[_0x39d6('0x5f')][_0x39d6('0x92')];break;case'bandwidth':_0x21c724[_0x39d6('0x5f')]['messageId']=_0x5432a3[_0x39d6('0x5f')][0x0][_0x39d6('0x23')]['id'];_0x21c724['body'][_0x39d6('0x83')]=_0x5432a3[_0x39d6('0x5f')][0x0][_0x39d6('0x23')]['from'];_0x21c724[_0x39d6('0x5f')]['body']=_0x5432a3['body'][0x0][_0x39d6('0x23')][_0x39d6('0x88')];break;case'intelepeer':_0x21c724[_0x39d6('0x5f')][_0x39d6('0x83')]=_0x5432a3[_0x39d6('0x5f')][_0x39d6('0x83')];_0x21c724[_0x39d6('0x5f')][_0x39d6('0x5f')]=_0x5432a3['body']['message'];_0x21c724[_0x39d6('0x5f')]['messageId']=_0x5432a3[_0x39d6('0x5f')][_0x39d6('0x93')];break;}}if(_0x21c724[_0x39d6('0x5f')]['id']){delete _0x21c724[_0x39d6('0x5f')]['id'];}if(_['isNil'](_0x21c724[_0x39d6('0x5f')][_0x39d6('0x83')])){throw new db[(_0x39d6('0x7a'))][(_0x39d6('0x7b'))](_0x39d6('0x94'));}if(_[_0x39d6('0x95')](_0x21c724['body'][_0x39d6('0x5f')])||_0x21c724[_0x39d6('0x5f')][_0x39d6('0x5f')]===''){throw new db['Sequelize'][(_0x39d6('0x7b'))](_0x39d6('0x96'));}if(_[_0x39d6('0x95')](_0x21c724[_0x39d6('0x5f')]['mapKey'])){throw new db['Sequelize'][(_0x39d6('0x7b'))](_0x39d6('0x97')+_0x4a8ecc);}if(!_[_0x39d6('0x98')](_0x4a8ecc,_0x21c724[_0x39d6('0x5f')]['mapKey'])){throw new db[(_0x39d6('0x7a'))][(_0x39d6('0x7b'))](_0x39d6('0x99')+_0x4a8ecc);}_0x2b7d41[_0x21c724['body'][_0x39d6('0x9a')]]=_0x21c724[_0x39d6('0x5f')]['from'];return db[_0x39d6('0x9b')][_0x39d6('0x60')]({'where':{'id':_0x21c724[_0x39d6('0x77')][_0x39d6('0x81')]},'include':[{'model':db[_0x39d6('0x78')],'as':_0x39d6('0x9c'),'where':_0x2b7d41,'limit':0x1,'order':[[_0x39d6('0x7f'),'DESC']]}]});})[_0x39d6('0x31')](handleEntityNotFound(_0x20094c,null))[_0x39d6('0x31')](function(_0x21fffa){if(_0x21fffa){_0x21c724['list']=_[_0x39d6('0x9d')](_0x21fffa,['Contacts']);if(_0x21fffa['Contacts'][_0x39d6('0x43')]){return _0x21fffa[_0x39d6('0x9c')][0x0];}var _0x14689d=_[_0x39d6('0x9e')](_0x21c724[_0x39d6('0x5f')],{'firstName':_0x21c724[_0x39d6('0x5f')][_0x39d6('0x83')],'ListId':_0x21fffa['id']});_0x14689d[_0x21c724['body'][_0x39d6('0x9a')]]=_0x21c724[_0x39d6('0x5f')]['from'];return db[_0x39d6('0x78')][_0x39d6('0x55')](_0x14689d,{'fields':_0x37fd3d,'raw':!![]});}})[_0x39d6('0x31')](handleEntityNotFound(_0x20094c,null))[_0x39d6('0x31')](function(_0x372a3f){if(_0x372a3f){_0x21c724[_0x39d6('0x9f')]=_0x372a3f;var _0x3f0c8a={'ContactId':_0x372a3f['id'],'phone':_0x21c724[_0x39d6('0x5f')][_0x39d6('0x83')],'SmsAccountId':_0x5432a3['params']['id']};var _0x5415b2={'ContactId':_0x372a3f['id'],'SmsAccountId':_0x5432a3['params']['id'],'closed':![]};return db['SmsInteraction'][_0x39d6('0x60')]({'where':_0x5415b2})['then'](function(_0xe05fb4){if(_0xe05fb4){return[_0xe05fb4,![]];}return db[_0x39d6('0xa0')][_0x39d6('0x55')](_0x3f0c8a)[_0x39d6('0x31')](function(_0x41f05b){return[_0x41f05b,!![]];});});}})[_0x39d6('0xa1')](function(_0x124096,_0x119c1a){_0x21c724[_0x39d6('0xa2')]=_0x124096[_0x39d6('0x33')]({'plain':!![]});_0x21c724['interaction'][_0x39d6('0xa3')]=![];if(_0x119c1a){if(_0x21c724['account'][_0x39d6('0xa4')]){_0x21c724['applications'][_0x39d6('0xa5')]({'id':0x0,'priority':_0x21c724['applications'][_0x39d6('0x43')]+0x1,'app':_0x39d6('0xa6'),'appdata':'unmanaged','interval':_0x39d6('0xa7')});}_0x21c724['interaction'][_0x39d6('0xa3')]=!![];}return db[_0x39d6('0xa8')][_0x39d6('0x55')]({'phone':_0x21c724[_0x39d6('0x5f')][_0x39d6('0x83')],'messageId':_0x21c724[_0x39d6('0x5f')][_0x39d6('0x85')],'body':_0x21c724[_0x39d6('0x5f')]['body'],'SmsAccountId':_0x5432a3[_0x39d6('0x51')]['id'],'SmsInteractionId':_0x124096['id'],'direction':'in','ContactId':_0x124096['ContactId'],'AttachmentId':_0x21c724['body'][_0x39d6('0xa9')]});})[_0x39d6('0x31')](function(_0x548bc0){_0x21c724[_0x39d6('0x23')]=_0x548bc0;if(!_0x21c724[_0x39d6('0xa2')][_0x39d6('0xaa')])return;return db['User']['find']({'attributes':['id','name'],'where':{'id':_0x21c724[_0x39d6('0xa2')]['UserId']}});})[_0x39d6('0x31')](function(_0x2795b0){if(_0x2795b0){_0x21c724[_0x39d6('0x73')][_0x39d6('0xab')]({'id':0x0,'priority':0x0,'app':_0x39d6('0xac'),'appdata':_0x2795b0[_0x39d6('0x35')]+','+(_0x21c724['account']['waitForTheAssignedAgent']||0xa),'interval':_0x39d6('0xa7')});}if(!_0x21c724[_0x39d6('0xa2')][_0x39d6('0xad')])return;return db[_0x39d6('0xae')]['find']({'attributes':['id',_0x39d6('0x35')],'where':{'id':_0x21c724[_0x39d6('0xa2')][_0x39d6('0xad')]}});})[_0x39d6('0x31')](function(_0x1ed270){if(_0x1ed270){_0x21c724[_0x39d6('0x73')][_0x39d6('0xab')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x1ed270[_0x39d6('0x35')]+','+(_0x21c724['account'][_0x39d6('0xaf')]||0x12c),'interval':_0x39d6('0xa7')});}return respondWithRpcPromise(_0x39d6('0xb0'),_0x39d6('0xb1'),_0x21c724);})[_0x39d6('0x31')](function(_0x6d67fc){if(_0x6d67fc){var _0x21ab27=0xc8;var _0xddc0af=_0x39d6('0xb2');logger[_0x39d6('0x1c')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xddc0af,_0x21ab27,_0x39d6('0xb3'));logger[_0x39d6('0x1f')](_0x39d6('0xb4'),_0xddc0af,_0x21ab27,_0x39d6('0xb3'),JSON['stringify'](_0x6d67fc));if(_0x21c724[_0x39d6('0x77')][_0x39d6('0x3b')]===_0x39d6('0xb5')){return _0x20094c['status'](_0x21ab27)[_0x39d6('0x2c')](_0x39d6('0xb6'),_0x39d6('0xb7'))['send'](_0x39d6('0xb8'));}else{return _0x20094c[_0x39d6('0x26')](_0x21ab27)['json'](_0x6d67fc);}}})['catch'](handleError(_0x20094c,null));};exports[_0x39d6('0xb9')]=function(_0x536427,_0x9a0677){var _0x1a964c=_0x536427[_0x39d6('0x51')]['id'];var _0x1b2834=_0x536427[_0x39d6('0x5f')];var _0x33fc33=0xc8;var _0xc814e8=null;return db[_0x39d6('0xba')][_0x39d6('0xbb')]({'isolationLevel':db[_0x39d6('0xba')][_0x39d6('0xbc')][_0x39d6('0xbd')][_0x39d6('0xbe')]},function(_0x40dfd3){return db[_0x39d6('0x3a')][_0x39d6('0x65')]({'where':{'id':_0x1a964c},'transaction':_0x40dfd3})[_0x39d6('0x31')](function(_0x3e7ad6){if(_0x3e7ad6){return db[_0x39d6('0x71')][_0x39d6('0x32')]({'where':{'SmsAccountId':_0x1a964c},'transaction':_0x40dfd3})['then'](function(){var _0xfb5039=_['map'](_0x1b2834,function(_0x487a85){_0x487a85[_0x39d6('0x63')]=_0x1a964c;return _0x487a85;});return db[_0x39d6('0x71')][_0x39d6('0xbf')](_0xfb5039,{'transaction':_0x40dfd3});});}else{_0x33fc33=0x194;_0xc814e8=[];}});})[_0x39d6('0x31')](function(){if(_0x33fc33!==0x194){return db[_0x39d6('0x71')]['findAndCountAll']({'where':{'SmsAccountId':_0x1a964c},'order':_0x39d6('0x75')})[_0x39d6('0x31')](function(_0x16179d){_0xc814e8=_0x16179d;});}})[_0x39d6('0x54')](function(_0x1566bd){_0x33fc33=0x1f4;logger[_0x39d6('0x21')](_0x1566bd[_0x39d6('0xc0')]);if(_0x1566bd['name']){delete _0x1566bd[_0x39d6('0x35')];}_0xc814e8=_0x1566bd;})[_0x39d6('0xc1')](function(){if(_0xc814e8===null){_0x9a0677[_0x39d6('0x25')](_0x33fc33);}else{if(_0x33fc33===0x1f4){_0x9a0677[_0x39d6('0x26')](_0x33fc33)['send'](_0xc814e8);}else{_0x9a0677[_0x39d6('0x26')](_0x33fc33)['json'](_0xc814e8);}}});};exports['getApplications']=function(_0x8cdc94,_0x5d0724,_0x2c80df){var _0x1cc86d={};var _0x5d04c2={};var _0x534001;var _0x1ee053;return db[_0x39d6('0x3a')]['findOne']({'where':{'id':_0x8cdc94['params']['id']}})[_0x39d6('0x31')](handleEntityNotFound(_0x5d0724,null))['then'](function(_0x2de1b4){if(_0x2de1b4){_0x534001=_0x2de1b4;_0x5d04c2[_0x39d6('0x3d')]=_[_0x39d6('0x3f')](db[_0x39d6('0x71')][_0x39d6('0x52')]);_0x5d04c2[_0x39d6('0x3e')]=_[_0x39d6('0x3f')](_0x8cdc94['query']);_0x5d04c2['filters']=_['intersection'](_0x5d04c2[_0x39d6('0x3d')],_0x5d04c2[_0x39d6('0x3e')]);_0x1cc86d[_0x39d6('0x42')]=_[_0x39d6('0x40')](_0x5d04c2[_0x39d6('0x3d')],qs['fields'](_0x8cdc94[_0x39d6('0x3e')]['fields']));_0x1cc86d['attributes']=_0x1cc86d[_0x39d6('0x42')][_0x39d6('0x43')]?_0x1cc86d[_0x39d6('0x42')]:_0x5d04c2[_0x39d6('0x3d')];_0x1cc86d[_0x39d6('0x66')]=qs['sort'](_0x8cdc94[_0x39d6('0x3e')]['sort']);_0x1cc86d[_0x39d6('0x48')]=qs[_0x39d6('0x49')](_[_0x39d6('0x4a')](_0x8cdc94['query'],_0x5d04c2['filters']));if(_0x8cdc94['query'][_0x39d6('0x67')]){_0x1cc86d[_0x39d6('0x48')]=_['merge'](_0x1cc86d[_0x39d6('0x48')],{'$or':_[_0x39d6('0x39')](_0x1cc86d[_0x39d6('0x42')],function(_0x525f43){var _0x3f0d58={};_0x3f0d58[_0x525f43]={'$like':'%'+_0x8cdc94[_0x39d6('0x3e')][_0x39d6('0x67')]+'%'};return _0x3f0d58;})});}_0x1cc86d=_[_0x39d6('0x4b')]({},_0x1cc86d,_0x8cdc94[_0x39d6('0x4d')]);return _0x534001[_0x39d6('0xc2')](_0x1cc86d);}})[_0x39d6('0x31')](function(_0x1c878d){if(_0x1c878d){_0x1ee053=_0x1c878d[_0x39d6('0x43')];if(!_0x8cdc94[_0x39d6('0x3e')][_0x39d6('0x44')](_0x39d6('0x45'))){_0x1cc86d['limit']=qs[_0x39d6('0x46')](_0x8cdc94[_0x39d6('0x3e')][_0x39d6('0x46')]);_0x1cc86d[_0x39d6('0x29')]=qs[_0x39d6('0x29')](_0x8cdc94[_0x39d6('0x3e')][_0x39d6('0x29')]);}return _0x534001[_0x39d6('0xc2')](_0x1cc86d);}})[_0x39d6('0x31')](function(_0x37b2c8){if(_0x37b2c8){return _0x37b2c8?{'count':_0x1ee053,'rows':_0x37b2c8}:null;}})[_0x39d6('0x31')](respondWithResult(_0x5d0724,null))[_0x39d6('0x54')](handleError(_0x5d0724,null));};exports[_0x39d6('0xc3')]=function(_0x47a898,_0x1e667e,_0x5bfcdb){var _0x59012c={'raw':![],'where':{}};var _0x477b53={};var _0x227f1d={'count':0x0,'rows':[]};return db[_0x39d6('0x3a')][_0x39d6('0x65')]({'where':{'id':_0x47a898[_0x39d6('0x51')]['id']}})[_0x39d6('0x31')](handleEntityNotFound(_0x1e667e,null))['then'](function(_0x2c5d7b){if(_0x2c5d7b){_0x477b53[_0x39d6('0x3d')]=_[_0x39d6('0x3f')](db[_0x39d6('0xa0')]['rawAttributes']);_0x477b53['query']=_[_0x39d6('0x3f')](_0x47a898[_0x39d6('0x3e')]);_0x477b53['filters']=_['intersection'](_0x477b53[_0x39d6('0x3d')],_0x477b53[_0x39d6('0x3e')]);_0x59012c[_0x39d6('0x42')]=_['intersection'](_0x477b53[_0x39d6('0x3d')],qs[_0x39d6('0x41')](_0x47a898['query'][_0x39d6('0x41')]));_0x59012c[_0x39d6('0x42')]=_0x59012c['attributes'][_0x39d6('0x43')]?_0x59012c[_0x39d6('0x42')]:_0x477b53[_0x39d6('0x3d')];if(!_0x47a898['query'][_0x39d6('0x44')]('nolimit')){_0x59012c[_0x39d6('0x46')]=qs[_0x39d6('0x46')](_0x47a898['query'][_0x39d6('0x46')]);_0x59012c[_0x39d6('0x29')]=qs[_0x39d6('0x29')](_0x47a898[_0x39d6('0x3e')][_0x39d6('0x29')]);}_0x59012c[_0x39d6('0x66')]=qs[_0x39d6('0x47')](_0x47a898[_0x39d6('0x3e')][_0x39d6('0x47')]);_0x59012c[_0x39d6('0x48')]=qs['filters'](_[_0x39d6('0x4a')](_0x47a898[_0x39d6('0x3e')],_0x477b53['filters']));_0x59012c[_0x39d6('0x48')][_0x39d6('0x63')]=_0x2c5d7b['id'];if(_0x47a898[_0x39d6('0x3e')][_0x39d6('0x67')]){_0x59012c['where']=_['merge'](_0x59012c[_0x39d6('0x48')],{'$or':_['map'](_0x59012c[_0x39d6('0x42')],function(_0x2b9282){var _0x1aa430={};_0x1aa430[_0x2b9282]={'$like':'%'+_0x47a898[_0x39d6('0x3e')][_0x39d6('0x67')]+'%'};return _0x1aa430;})});}_0x59012c=_['merge']({},_0x59012c,_0x47a898[_0x39d6('0x4d')]);return db[_0x39d6('0xa0')]['count']({'where':_0x59012c['where']})['then'](function(_0x3417fc){_0x227f1d[_0x39d6('0x2b')]=_0x3417fc;if(_0x47a898[_0x39d6('0x3e')]['includeAll']){_0x59012c['include']=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x39d6('0xc4')],'as':'Owner','attributes':[_0x39d6('0x35'),_0x39d6('0xc5'),_0x39d6('0xc6')],'required':![]},{'model':db[_0x39d6('0xc7')],'as':_0x39d6('0xc8'),'attributes':['id',_0x39d6('0x35'),'color'],'where':_0x47a898[_0x39d6('0x3e')]['tag']?{'id':_0x47a898[_0x39d6('0x3e')][_0x39d6('0xc9')]}:undefined,'required':_0x47a898[_0x39d6('0x3e')]['tag']?!![]:![]}];}return db['SmsInteraction'][_0x39d6('0x4f')](_0x59012c);})[_0x39d6('0x31')](function(_0x3c6ec5){_0x227f1d['rows']=_0x3c6ec5;return _0x227f1d;});}})[_0x39d6('0x31')](respondWithFilteredResult(_0x1e667e,_0x59012c))[_0x39d6('0x54')](handleError(_0x1e667e,null));};exports[_0x39d6('0x36')]=function(_0x255bf9,_0x3a560b,_0xd25498){var _0x2877a0,_0x2e6751,_0x49bd96;if(_[_0x39d6('0x95')](_0x255bf9[_0x39d6('0x5f')]['body'])||_0x255bf9['body'][_0x39d6('0x5f')]===''){throw new db['Sequelize']['ValidationError'](_0x39d6('0x96'));}if(_[_0x39d6('0x95')](_0x255bf9[_0x39d6('0x5f')]['to'])){throw new db[(_0x39d6('0x7a'))][(_0x39d6('0x7b'))]('to\x20is\x20mandatory');}_0x2877a0=_0x255bf9[_0x39d6('0x5f')]['to'];return db[_0x39d6('0x3a')][_0x39d6('0x60')]({'where':{'id':_0x255bf9[_0x39d6('0x51')]['id']},'include':[{'model':db['CmList'],'as':_0x39d6('0xca'),'include':[{'model':db[_0x39d6('0x78')],'as':_0x39d6('0x9c'),'where':{'mobile':_0x2877a0},'limit':0x1,'order':[[_0x39d6('0x7f'),_0x39d6('0xcb')]]}]}]})[_0x39d6('0x31')](handleEntityNotFound(_0x3a560b,null))['then'](function(_0x1edfbb){if(_0x1edfbb&&_0x1edfbb[_0x39d6('0xca')]){_0x2e6751=_0x1edfbb[_0x39d6('0x33')]({'plain':!![]});if(_0x2e6751[_0x39d6('0xca')]&&_0x2e6751[_0x39d6('0xca')][_0x39d6('0x9c')][_0x39d6('0x43')]){return _0x2e6751[_0x39d6('0xca')][_0x39d6('0x9c')][0x0];}return db['CmContact']['create'](_[_0x39d6('0x9e')](_0x255bf9[_0x39d6('0x5f')],{'firstName':_0x2877a0,'mobile':_0x2877a0,'phone':_0x2877a0,'ListId':_0x2e6751[_0x39d6('0x81')]}));}})[_0x39d6('0x31')](handleEntityNotFound(_0x3a560b,null))[_0x39d6('0x31')](function(_0x728664){if(_0x728664){_0x49bd96=_0x728664;return db[_0x39d6('0xa0')][_0x39d6('0x60')]({'where':{'ContactId':_0x49bd96['id'],'closed':![],'SmsAccountId':_0x2e6751['id']}})['then'](function(_0x507ec9){if(_0x507ec9){return[_0x507ec9,![]];}return db[_0x39d6('0xa0')]['create']({'UserId':_0x255bf9[_0x39d6('0x56')]['id'],'ContactId':_0x49bd96['id'],'SmsAccountId':_0x2e6751['id'],'phone':_0x2877a0,'firstMsgDirection':_0x39d6('0xcc'),'Messages':[_[_0x39d6('0x4b')](_0x255bf9[_0x39d6('0x5f')],{'read':![],'body':_0x255bf9['body'][_0x39d6('0x5f')],'phone':_0x2877a0,'SmsAccountId':_0x2e6751['id'],'UserId':_0x255bf9['user']['id'],'ContactId':_0x49bd96['id']})]},{'include':[{'model':db[_0x39d6('0xa8')],'as':_0x39d6('0xcd')}]})[_0x39d6('0x31')](function(_0x9a2ac6){return[_0x9a2ac6,!![]];});});}})['spread'](function(_0x1b6a08,_0x1369c2){if(_0x1369c2){return _0x1b6a08;}return db['SmsMessage']['create'](_['merge'](_0x255bf9[_0x39d6('0x5f')],{'read':![],'body':_0x255bf9[_0x39d6('0x5f')]['body'],'phone':_0x2877a0,'SmsAccountId':_0x2e6751['id'],'SmsInteractionId':_0x1b6a08['id'],'UserId':_0x255bf9[_0x39d6('0x56')]['id'],'ContactId':_0x49bd96['id']}))['then'](function(_0x331f2c){_0x1b6a08[_0x39d6('0xce')]['Messages']=[];_0x1b6a08['dataValues'][_0x39d6('0xcd')][_0x39d6('0xa5')](_0x331f2c[_0x39d6('0xce')]);return _0x1b6a08;});})[_0x39d6('0x31')](respondWithResult(_0x3a560b,null))['catch'](handleError(_0x3a560b,null));};exports['status']=function(_0x399b84,_0x5750ff,_0xe92b85){if(_0x399b84[_0x39d6('0x5f')]['id']){delete _0x399b84[_0x39d6('0x5f')]['id'];}var _0x1f64c8,_0x1b0768,_0x54d4da;return db[_0x39d6('0x3a')][_0x39d6('0x60')]({'where':{'id':_0x399b84['params']['id']}})[_0x39d6('0x31')](handleEntityNotFound(_0x5750ff,null))[_0x39d6('0x31')](function(_0x4bb830){if(_0x4bb830){_0x54d4da=_0x4bb830;logger[_0x39d6('0x1f')](_0x39d6('0x20'),_0x39d6('0x26'),_0x39d6('0xcf'),_0x4bb830['type'],util[_0x39d6('0xd0')](_0x399b84[_0x39d6('0x5f')],{'showHidden':![],'depth':null}));switch(_0x4bb830[_0x39d6('0x3b')]){case'skebby':if(_0x399b84[_0x39d6('0x5f')][_0x39d6('0xd1')]&&_0x399b84[_0x39d6('0x5f')][_0x39d6('0x26')]){_0x1b0768=_0x399b84['body'][_0x39d6('0x26')];return db[_0x39d6('0xa8')]['find']({'where':{'messageId':_0x399b84[_0x39d6('0x5f')][_0x39d6('0xd1')]}});}break;case _0x39d6('0x89'):if(_0x399b84[_0x39d6('0x5f')][_0x39d6('0xd2')]&&_0x399b84[_0x39d6('0x5f')][_0x39d6('0xd3')]){_0x1b0768=_0x399b84[_0x39d6('0x5f')]['statusInt'];return db[_0x39d6('0xa8')][_0x39d6('0x60')]({'where':{'messageId':_0x399b84[_0x39d6('0x5f')]['requestid']}});}break;case'clicksend':if(_0x399b84[_0x39d6('0x5f')][_0x39d6('0xd4')]&&_0x399b84[_0x39d6('0x5f')][_0x39d6('0xd5')]){_0x1b0768=_0x399b84[_0x39d6('0x5f')]['status_code'];return db['SmsMessage']['find']({'where':{'messageId':_0x399b84[_0x39d6('0x5f')][_0x39d6('0xd4')]}});}break;case _0x39d6('0x8d'):var _0x45a445=_0x399b84[_0x39d6('0x5f')][_0x39d6('0x8e')][0x0];if(_0x45a445[_0x39d6('0x85')]&&_0x45a445[_0x39d6('0x26')][_0x39d6('0xd6')]===_0x39d6('0xd7')){_0x1b0768=_0x45a445[_0x39d6('0x26')][_0x39d6('0xd6')];return db[_0x39d6('0xa8')][_0x39d6('0x60')]({'where':{'messageId':_0x45a445[_0x39d6('0x85')]}});}break;case _0x39d6('0x90'):if(_0x399b84[_0x39d6('0x5f')][_0x39d6('0x85')]&&_0x399b84['body'][_0x39d6('0x26')]){_0x1b0768=_0x399b84[_0x39d6('0x5f')][_0x39d6('0x26')];return db[_0x39d6('0xa8')][_0x39d6('0x60')]({'where':{'messageId':_0x399b84[_0x39d6('0x5f')][_0x39d6('0x85')]}});}break;case _0x39d6('0xd8'):if(_0x399b84['body'][0x0][_0x39d6('0x23')]['id']){_0x1b0768=_0x399b84['body'][0x0]['type'];return db[_0x39d6('0xa8')][_0x39d6('0x60')]({'where':{'messageId':_0x399b84[_0x39d6('0x5f')][0x0][_0x39d6('0x23')]['id']}});}break;case _0x39d6('0xd9'):if(_0x399b84[_0x39d6('0x5f')][_0x39d6('0xda')]&&_0x399b84['body'][_0x39d6('0x26')]){_0x1b0768=_0x399b84['body'][_0x39d6('0x26')];return db[_0x39d6('0xa8')]['find']({'where':{'messageId':_0x399b84['body'][_0x39d6('0xda')]}});}break;}}})[_0x39d6('0x31')](handleEntityNotFound(_0x5750ff,null))[_0x39d6('0x31')](function(_0x461a53){if(_0x461a53){_0x1f64c8=_0x461a53;switch(_0x54d4da['type']){case'skebby':if(_0x1b0768===_0x39d6('0xd7')){return _0x1f64c8[_0x39d6('0x5e')]({'read':!![]});}else{logger[_0x39d6('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x39d6('0x87'),util[_0x39d6('0xd0')](_0x399b84[_0x39d6('0x5f')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x1b0768==='1'){return _0x1f64c8[_0x39d6('0x5e')]({'read':!![]});}else{logger['error'](_0x39d6('0x20'),'status',_0x39d6('0x87'),util[_0x39d6('0xd0')](_0x399b84[_0x39d6('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x39d6('0x8a'):if(!_0x399b84[_0x39d6('0x5f')][_0x39d6('0xdb')]&&_0x1b0768>=0xc8&&_0x1b0768<=0xce){return _0x1f64c8[_0x39d6('0x5e')]({'read':!![]});}else{logger[_0x39d6('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x39d6('0x8a'),util['inspect'](_0x399b84[_0x39d6('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x39d6('0x8d'):var _0x1a3310=_0x399b84['body'][_0x39d6('0x8e')][0x0];if(_0x1a3310[_0x39d6('0x26')][_0x39d6('0xd6')]===_0x39d6('0xd7')){return _0x1f64c8[_0x39d6('0x5e')]({'read':!![]});}else{logger['error'](_0x39d6('0x20'),_0x39d6('0x26'),_0x39d6('0x8d'),util[_0x39d6('0xd0')](_0x399b84['body'],{'showHidden':![],'depth':null}));}break;case _0x39d6('0x90'):if(_0x1b0768=='DELIVERED_TO_GATEWAY'||_0x1b0768=='RECEIVED_BY_RECIPIENT'){return _0x1f64c8[_0x39d6('0x5e')]({'read':!![]});}else{logger[_0x39d6('0x21')](_0x39d6('0x20'),'status',_0x39d6('0x90'),util[_0x39d6('0xd0')](_0x399b84[_0x39d6('0x5f')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x1b0768==_0x39d6('0xdc')){return _0x1f64c8['update']({'read':!![]});}else{logger['error'](_0x39d6('0x20'),_0x39d6('0x26'),_0x39d6('0xd8'),util[_0x39d6('0xd0')](_0x399b84[_0x39d6('0x5f')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x1b0768==='DELIVRD'||_0x1b0768==='ACCEPTD'){return _0x1f64c8[_0x39d6('0x5e')]({'read':!![]});}else{logger[_0x39d6('0x21')](_0x39d6('0x20'),_0x39d6('0x26'),_0x39d6('0xd9'),util[_0x39d6('0xd0')](_0x399b84['body'],{'showHidden':![],'depth':null}));}break;}return _0x1f64c8;}})[_0x39d6('0x31')](respondWithResult(_0x5750ff,null))['catch'](handleError(_0x5750ff,null));};exports['statusGet']=function(_0x467a61,_0x1acdfa,_0x2b6595){var _0x37e756,_0x2fcae1,_0x1dda69;return db[_0x39d6('0x3a')][_0x39d6('0x60')]({'where':{'id':_0x467a61[_0x39d6('0x51')]['id']}})[_0x39d6('0x31')](handleEntityNotFound(_0x1acdfa,null))[_0x39d6('0x31')](function(_0x5c015b){if(_0x5c015b){_0x1dda69=_0x5c015b;logger[_0x39d6('0x1f')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x39d6('0x26'),_0x39d6('0xcf'),_0x5c015b[_0x39d6('0x3b')],util['inspect'](_0x467a61[_0x39d6('0x3e')],{'showHidden':![],'depth':null}));switch(_0x5c015b['type']){case _0x39d6('0xdd'):if(_0x467a61[_0x39d6('0x3e')][_0x39d6('0xde')]&&_0x467a61[_0x39d6('0x3e')]['state']){_0x2fcae1=_0x467a61['query'][_0x39d6('0xdf')];return db['SmsMessage'][_0x39d6('0x60')]({'where':{'messageId':_0x467a61[_0x39d6('0x3e')][_0x39d6('0xde')]}});}break;}}})['then'](handleEntityNotFound(_0x1acdfa,null))[_0x39d6('0x31')](function(_0x3e910c){if(_0x3e910c){_0x37e756=_0x3e910c;switch(_0x1dda69[_0x39d6('0x3b')]){case _0x39d6('0xdd'):if(_0x2fcae1==='2'||_0x2fcae1==='6'){return _0x37e756['update']({'read':!![]});}else{logger[_0x39d6('0x21')](_0x39d6('0x20'),_0x39d6('0x26'),_0x39d6('0xdd'),util['inspect'](_0x467a61[_0x39d6('0x3e')],{'showHidden':![],'depth':null}));};break;}return _0x37e756;}})['then'](respondWithResult(_0x1acdfa,null))[_0x39d6('0x54')](handleError(_0x1acdfa,null));};exports[_0x39d6('0xe0')]=function(_0x463f1e,_0x11910a,_0x56a2f0){return db[_0x39d6('0x3a')]['find']({'where':{'id':_0x463f1e['params']['id']}})[_0x39d6('0x31')](handleEntityNotFound(_0x11910a,null))[_0x39d6('0x31')](function(_0xd07b01){if(_0xd07b01){return _0xd07b01['addAgents'](_0x463f1e[_0x39d6('0x5f')][_0x39d6('0x69')],_[_0x39d6('0x9d')](_0x463f1e['body'],[_0x39d6('0x69'),'id'])||{})[_0x39d6('0xa1')](function(_0x5ebc09){for(var _0x27cfad=0x0;_0x27cfad<_0x463f1e[_0x39d6('0x5f')][_0x39d6('0x69')][_0x39d6('0x43')];_0x27cfad+=0x1){socket[_0x39d6('0xe1')]('userSmsAccount:save',{'UserId':Number(_0x463f1e['body'][_0x39d6('0x69')][_0x27cfad]),'SmsAccountId':Number(_0x463f1e[_0x39d6('0x51')]['id'])});}return _0x5ebc09;});}})['then'](respondWithResult(_0x11910a,null))[_0x39d6('0x54')](handleError(_0x11910a,null));};exports['removeAgents']=function(_0x5ae27e,_0x173a50,_0x50264){return db[_0x39d6('0x3a')][_0x39d6('0x60')]({'where':{'id':_0x5ae27e[_0x39d6('0x51')]['id']}})[_0x39d6('0x31')](handleEntityNotFound(_0x173a50,null))['then'](function(_0x130f46){if(_0x130f46){return _0x130f46[_0x39d6('0xe2')](_0x5ae27e[_0x39d6('0x3e')]['ids'])['then'](function(){if(_[_0x39d6('0xe3')](_0x5ae27e[_0x39d6('0x3e')][_0x39d6('0x69')])){for(var _0x2cf018=0x0;_0x2cf018<_0x5ae27e[_0x39d6('0x3e')]['ids'][_0x39d6('0x43')];_0x2cf018+=0x1){socket[_0x39d6('0xe1')](_0x39d6('0xe4'),{'UserId':Number(_0x5ae27e[_0x39d6('0x3e')][_0x39d6('0x69')][_0x2cf018]),'SmsAccountId':Number(_0x5ae27e[_0x39d6('0x51')]['id'])});}}else{socket[_0x39d6('0xe1')](_0x39d6('0xe4'),{'UserId':Number(_0x5ae27e[_0x39d6('0x3e')][_0x39d6('0x69')]),'SmsAccountId':Number(_0x5ae27e[_0x39d6('0x51')]['id'])});}});}})['then'](respondWithStatusCode(_0x173a50,null))['catch'](handleError(_0x173a50,null));};exports[_0x39d6('0xe5')]=function(_0x700e64,_0x43dfaf,_0x2442b7){var _0x5c96bd={};var _0x2c617e={};var _0x25b14f;var _0x2b5d90;return db['SmsAccount'][_0x39d6('0x65')]({'where':{'id':_0x700e64[_0x39d6('0x51')]['id']}})[_0x39d6('0x31')](handleEntityNotFound(_0x43dfaf,null))[_0x39d6('0x31')](function(_0x152f05){if(_0x152f05){_0x25b14f=_0x152f05;_0x2c617e[_0x39d6('0x3d')]=_[_0x39d6('0x3f')](db[_0x39d6('0xc4')][_0x39d6('0x52')]);_0x2c617e['query']=_[_0x39d6('0x3f')](_0x700e64['query']);_0x2c617e[_0x39d6('0x49')]=_[_0x39d6('0x40')](_0x2c617e[_0x39d6('0x3d')],_0x2c617e['query']);_0x5c96bd['attributes']=_[_0x39d6('0x40')](_0x2c617e[_0x39d6('0x3d')],qs[_0x39d6('0x41')](_0x700e64[_0x39d6('0x3e')]['fields']));_0x5c96bd['attributes']=_0x5c96bd[_0x39d6('0x42')]['length']?_0x5c96bd[_0x39d6('0x42')]:_0x2c617e[_0x39d6('0x3d')];_0x5c96bd['order']=qs[_0x39d6('0x47')](_0x700e64[_0x39d6('0x3e')][_0x39d6('0x47')]);_0x5c96bd['where']=qs[_0x39d6('0x49')](_[_0x39d6('0x4a')](_0x700e64[_0x39d6('0x3e')],_0x2c617e[_0x39d6('0x49')]));if(_0x700e64[_0x39d6('0x3e')][_0x39d6('0x67')]){_0x5c96bd[_0x39d6('0x48')]=_[_0x39d6('0x4b')](_0x5c96bd[_0x39d6('0x48')],{'$or':_['map'](_0x5c96bd[_0x39d6('0x42')],function(_0x395197){var _0x58470e={};_0x58470e[_0x395197]={'$like':'%'+_0x700e64[_0x39d6('0x3e')][_0x39d6('0x67')]+'%'};return _0x58470e;})});}_0x5c96bd=_[_0x39d6('0x4b')]({},_0x5c96bd,_0x700e64[_0x39d6('0x4d')]);return _0x25b14f['getAgents'](_0x5c96bd);}})['then'](function(_0xed2016){if(_0xed2016){_0x2b5d90=_0xed2016['length'];if(!_0x700e64[_0x39d6('0x3e')]['hasOwnProperty']('nolimit')){_0x5c96bd[_0x39d6('0x46')]=qs['limit'](_0x700e64[_0x39d6('0x3e')][_0x39d6('0x46')]);_0x5c96bd[_0x39d6('0x29')]=qs['offset'](_0x700e64[_0x39d6('0x3e')]['offset']);}return _0x25b14f['getAgents'](_0x5c96bd);}})[_0x39d6('0x31')](function(_0x4b347f){if(_0x4b347f){return _0x4b347f?{'count':_0x2b5d90,'rows':_0x4b347f}:null;}})['then'](respondWithResult(_0x43dfaf,null))[_0x39d6('0x54')](handleError(_0x43dfaf,null));}; \ No newline at end of file +var _0x629e=['describe','SmsAccountId','Disposition','findOne','filter','removeDispositions','ids','CannedAnswer','rows','removeAnswers','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','CmContact','Sequelize','ValidationError','difference','updatedAt','createdAt','CompanyId','mobile','twilio','from','From','Body','MessageSid','skebby','text','connectel','clicksend','message_id','plivo','Text','messageId','MessageUUID','infobip','results','csc','segmentedMessage','clickatell','replyMessageId','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','Contacts','list','contact','SmsInteraction','spread','interaction','autoclose','push','close','SmsMessage','AttachmentId','UserId','waitForTheAssignedAgent','*,*,*,*','queueId','SmsQueue','unshift','queue','Start','startRouting','entity\x20found','Content-Type','text/xml','\x0a','addApplications','sequelize','Transaction','ISOLATION_LEVELS','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','User','fullname','Tag','Tags','color','tag','to\x20is\x20mandatory','DESC','List','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','redif','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','bandwidth','message-delivered','DELIVRD','statusGet','state','message-id','addAgents','omit','userSmsAccount:save','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','get','SmsAccounts','destroy','sendStatus','stack','name','send','index','mandatoryDispositionPause','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','type','VIRTUAL','merge','options','SmsAccount','findAll','show','Pause','length','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params'];(function(_0x3cecba,_0x5fbf1){var _0x214221=function(_0x38dbe3){while(--_0x38dbe3){_0x3cecba['push'](_0x3cecba['shift']());}};_0x214221(++_0x5fbf1);}(_0x629e,0x7f));var _0xe629=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x629e[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0xe629('0x0'));var rimraf=require(_0xe629('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe629('0x2'));var rp=require(_0xe629('0x3'));var moment=require(_0xe629('0x4'));var BPromise=require(_0xe629('0x5'));var Mustache=require(_0xe629('0x6'));var util=require(_0xe629('0x7'));var path=require(_0xe629('0x8'));var sox=require('sox');var csv=require(_0xe629('0x9'));var ejs=require(_0xe629('0xa'));var fs=require('fs');var fs_extra=require(_0xe629('0xb'));var _=require(_0xe629('0xc'));var squel=require(_0xe629('0xd'));var crypto=require(_0xe629('0xe'));var jsforce=require(_0xe629('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe629('0x10'));var Papa=require('papaparse');var Redis=require(_0xe629('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe629('0x12'));var as=require(_0xe629('0x13'));var hardwareService=require(_0xe629('0x14'));var logger=require(_0xe629('0x15'))(_0xe629('0x16'));var utils=require(_0xe629('0x17'));var config=require(_0xe629('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe629('0x19'))['db'];config['redis']=_[_0xe629('0x1a')](config[_0xe629('0x1b')],{'host':_0xe629('0x1c'),'port':0x18eb});var socket=require(_0xe629('0x1d'))(new Redis(config[_0xe629('0x1b')]));require('./smsAccount.socket')[_0xe629('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0xe629('0x1f')][_0xe629('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x17af53,_0x461ebf,_0x14f21b,_0x430241){return new BPromise(function(_0x221335,_0x1290aa){var _0x462f1f=_0x430241||client;return _0x462f1f[_0xe629('0x21')](_0x17af53,_0x14f21b)[_0xe629('0x22')](function(_0x53bcf1){logger[_0xe629('0x23')](_0xe629('0x24'),_0x461ebf,_0xe629('0x25'));logger[_0xe629('0x26')](_0xe629('0x27'),_0x461ebf,'request\x20sent',JSON[_0xe629('0x28')](_0x53bcf1));if(_0x53bcf1['error']){if(_0x53bcf1['error'][_0xe629('0x29')]===0x1f4){logger['error'](_0xe629('0x24'),_0x461ebf,_0x53bcf1[_0xe629('0x2a')][_0xe629('0x2b')]);return _0x1290aa(_0x53bcf1['error'][_0xe629('0x2b')]);}logger[_0xe629('0x2a')](_0xe629('0x24'),_0x461ebf,_0x53bcf1[_0xe629('0x2a')][_0xe629('0x2b')]);return _0x221335(_0x53bcf1[_0xe629('0x2a')][_0xe629('0x2b')]);}else{logger[_0xe629('0x23')](_0xe629('0x24'),_0x461ebf,'request\x20sent');_0x221335(_0x53bcf1[_0xe629('0x2c')][_0xe629('0x2b')]);}})[_0xe629('0x2d')](function(_0x2ae90d){logger[_0xe629('0x2a')](_0xe629('0x24'),_0x461ebf,_0x2ae90d);_0x1290aa(_0x2ae90d);});});}function respondWithStatusCode(_0xfd8a88,_0x37836b){_0x37836b=_0x37836b||0xcc;return function(_0x2ca713){if(_0x2ca713){return _0xfd8a88['sendStatus'](_0x37836b);}return _0xfd8a88[_0xe629('0x2e')](_0x37836b)[_0xe629('0x2f')]();};}function respondWithResult(_0x202c7c,_0x3497b8){_0x3497b8=_0x3497b8||0xc8;return function(_0x18c374){if(_0x18c374){return _0x202c7c[_0xe629('0x2e')](_0x3497b8)[_0xe629('0x30')](_0x18c374);}};}function respondWithFilteredResult(_0x16aa00,_0x7e973f){return function(_0x5942e2){if(_0x5942e2){var _0x25e9b5=typeof _0x7e973f[_0xe629('0x31')]===_0xe629('0x32')&&typeof _0x7e973f['limit']==='undefined';var _0x28ebfc=_0x5942e2[_0xe629('0x33')];var _0x45175f=_0x25e9b5?0x0:_0x7e973f[_0xe629('0x31')];var _0x4c3f03=_0x25e9b5?_0x5942e2['count']:_0x7e973f[_0xe629('0x31')]+_0x7e973f[_0xe629('0x34')];var _0x2a3f8d;if(_0x4c3f03>=_0x28ebfc){_0x4c3f03=_0x28ebfc;_0x2a3f8d=0xc8;}else{_0x2a3f8d=0xce;}_0x16aa00[_0xe629('0x2e')](_0x2a3f8d);return _0x16aa00[_0xe629('0x35')](_0xe629('0x36'),_0x45175f+'-'+_0x4c3f03+'/'+_0x28ebfc)[_0xe629('0x30')](_0x5942e2);}return null;};}function patchUpdates(_0x15d374){return function(_0x2c6666){try{jsonpatch[_0xe629('0x37')](_0x2c6666,_0x15d374,!![]);}catch(_0x3d0cb4){return BPromise[_0xe629('0x38')](_0x3d0cb4);}return _0x2c6666[_0xe629('0x39')]();};}function saveUpdates(_0x213493,_0x164f9e){return function(_0x2eacbf){if(_0x2eacbf){return _0x2eacbf[_0xe629('0x3a')](_0x213493)[_0xe629('0x22')](function(_0x21b4f4){return _0x21b4f4;});}return null;};}function removeEntity(_0x567305,_0x43e9fb){return function(_0x272e18){if(_0x272e18){return _0x272e18['destroy']()['then'](function(){var _0x3e9dbc=_0x272e18[_0xe629('0x3b')]({'plain':!![]});var _0x53ffb1=_0xe629('0x3c');return db['UserProfileResource'][_0xe629('0x3d')]({'where':{'type':_0x53ffb1,'resourceId':_0x3e9dbc['id']}})[_0xe629('0x22')](function(){return _0x272e18;});})[_0xe629('0x22')](function(){_0x567305[_0xe629('0x2e')](0xcc)[_0xe629('0x2f')]();});}};}function handleEntityNotFound(_0x81206e,_0x51d1ea){return function(_0x5a3375){if(!_0x5a3375){_0x81206e[_0xe629('0x3e')](0x194);}return _0x5a3375;};}function handleError(_0x101f94,_0x4edef6){_0x4edef6=_0x4edef6||0x1f4;return function(_0x26f1e3){logger['error'](_0x26f1e3[_0xe629('0x3f')]);if(_0x26f1e3['name']){delete _0x26f1e3[_0xe629('0x40')];}_0x101f94[_0xe629('0x2e')](_0x4edef6)[_0xe629('0x41')](_0x26f1e3);};}exports[_0xe629('0x42')]=function(_0x1a9a27,_0x68d1d3){var _0x24907c={'include':[{'model':db['Pause'],'as':_0xe629('0x43')}]},_0x3c206a={},_0x8ca035={'count':0x0,'rows':[]};var _0x2b6b82=_[_0xe629('0x44')](db['SmsAccount'][_0xe629('0x45')],function(_0x3787e0){return{'name':_0x3787e0[_0xe629('0x46')],'type':_0x3787e0['type'][_0xe629('0x47')]};});_0x3c206a[_0xe629('0x48')]=_[_0xe629('0x44')](_0x2b6b82,_0xe629('0x40'));_0x3c206a['query']=_[_0xe629('0x49')](_0x1a9a27[_0xe629('0x4a')]);_0x3c206a[_0xe629('0x4b')]=_[_0xe629('0x4c')](_0x3c206a[_0xe629('0x48')],_0x3c206a[_0xe629('0x4a')]);_0x24907c[_0xe629('0x4d')]=_[_0xe629('0x4c')](_0x3c206a[_0xe629('0x48')],qs[_0xe629('0x4e')](_0x1a9a27[_0xe629('0x4a')][_0xe629('0x4e')]));_0x24907c['attributes']=_0x24907c[_0xe629('0x4d')]['length']?_0x24907c[_0xe629('0x4d')]:_0x3c206a[_0xe629('0x48')];if(!_0x1a9a27[_0xe629('0x4a')][_0xe629('0x4f')](_0xe629('0x50'))){_0x24907c[_0xe629('0x34')]=qs['limit'](_0x1a9a27[_0xe629('0x4a')][_0xe629('0x34')]);_0x24907c['offset']=qs[_0xe629('0x31')](_0x1a9a27[_0xe629('0x4a')]['offset']);}_0x24907c[_0xe629('0x51')]=qs[_0xe629('0x52')](_0x1a9a27[_0xe629('0x4a')][_0xe629('0x52')]);_0x24907c['where']=qs[_0xe629('0x4b')](_[_0xe629('0x53')](_0x1a9a27[_0xe629('0x4a')],_0x3c206a[_0xe629('0x4b')]),_0x2b6b82);if(_0x1a9a27[_0xe629('0x4a')]['filter']){_0x24907c[_0xe629('0x54')]=_['merge'](_0x24907c[_0xe629('0x54')],{'$or':_[_0xe629('0x44')](_0x2b6b82,function(_0x322450){if(_0x322450[_0xe629('0x55')]!==_0xe629('0x56')){var _0xe44be5={};_0xe44be5[_0x322450[_0xe629('0x40')]]={'$like':'%'+_0x1a9a27[_0xe629('0x4a')]['filter']+'%'};return _0xe44be5;}})});}_0x24907c=_[_0xe629('0x57')]({},_0x24907c,_0x1a9a27[_0xe629('0x58')]);var _0xae482d={'where':_0x24907c[_0xe629('0x54')]};return db['SmsAccount'][_0xe629('0x33')](_0xae482d)[_0xe629('0x22')](function(_0x2a7b0a){_0x8ca035[_0xe629('0x33')]=_0x2a7b0a;if(_0x1a9a27[_0xe629('0x4a')]['includeAll']){_0x24907c['include']=[{'all':!![]}];}return db[_0xe629('0x59')][_0xe629('0x5a')](_0x24907c);})[_0xe629('0x22')](function(_0x29a7ca){_0x8ca035['rows']=_0x29a7ca;return _0x8ca035;})['then'](respondWithFilteredResult(_0x68d1d3,_0x24907c))[_0xe629('0x2d')](handleError(_0x68d1d3,null));};exports[_0xe629('0x5b')]=function(_0x2f9bb8,_0x5a5081){var _0x38f83c={'raw':![],'where':{'id':_0x2f9bb8['params']['id']},'include':[{'model':db[_0xe629('0x5c')],'as':_0xe629('0x43')}]},_0xbcb6a6={};_0xbcb6a6[_0xe629('0x48')]=_[_0xe629('0x49')](db[_0xe629('0x59')][_0xe629('0x45')]);_0xbcb6a6[_0xe629('0x4a')]=_[_0xe629('0x49')](_0x2f9bb8[_0xe629('0x4a')]);_0xbcb6a6[_0xe629('0x4b')]=_[_0xe629('0x4c')](_0xbcb6a6[_0xe629('0x48')],_0xbcb6a6[_0xe629('0x4a')]);_0x38f83c[_0xe629('0x4d')]=_[_0xe629('0x4c')](_0xbcb6a6[_0xe629('0x48')],qs['fields'](_0x2f9bb8[_0xe629('0x4a')][_0xe629('0x4e')]));_0x38f83c[_0xe629('0x4d')]=_0x38f83c[_0xe629('0x4d')][_0xe629('0x5d')]?_0x38f83c[_0xe629('0x4d')]:_0xbcb6a6['model'];if(_0x2f9bb8[_0xe629('0x4a')][_0xe629('0x5e')]){_0x38f83c[_0xe629('0x5f')]=[{'all':!![]}];}_0x38f83c=_[_0xe629('0x57')]({},_0x38f83c,_0x2f9bb8[_0xe629('0x58')]);return db[_0xe629('0x59')][_0xe629('0x60')](_0x38f83c)[_0xe629('0x22')](handleEntityNotFound(_0x5a5081,null))[_0xe629('0x22')](respondWithResult(_0x5a5081,null))[_0xe629('0x2d')](handleError(_0x5a5081,null));};exports[_0xe629('0x61')]=function(_0x5df1ae,_0x5f08d5){return db['SmsAccount'][_0xe629('0x61')](_0x5df1ae[_0xe629('0x62')],{})[_0xe629('0x22')](function(_0x577db0){var _0x38f74b=_0x5df1ae[_0xe629('0x63')][_0xe629('0x3b')]({'plain':!![]});if(!_0x38f74b)throw new Error(_0xe629('0x64'));if(_0x38f74b['role']===_0xe629('0x63')){var _0x340e81=_0x577db0[_0xe629('0x3b')]({'plain':!![]});var _0x3f0e36=_0xe629('0x3c');return db[_0xe629('0x65')]['find']({'where':{'name':_0x3f0e36,'userProfileId':_0x38f74b['userProfileId']},'raw':!![]})[_0xe629('0x22')](function(_0x1bf972){if(_0x1bf972&&_0x1bf972[_0xe629('0x66')]===0x0){return db[_0xe629('0x67')]['create']({'name':_0x340e81[_0xe629('0x40')],'resourceId':_0x340e81['id'],'type':_0x1bf972[_0xe629('0x40')],'sectionId':_0x1bf972['id']},{})[_0xe629('0x22')](function(){return _0x577db0;});}else{return _0x577db0;}})[_0xe629('0x2d')](function(_0x591d99){logger[_0xe629('0x2a')](_0xe629('0x68'),_0x591d99);throw _0x591d99;});}return _0x577db0;})[_0xe629('0x22')](respondWithResult(_0x5f08d5,0xc9))['catch'](handleError(_0x5f08d5,null));};exports[_0xe629('0x3a')]=function(_0x1fc6f5,_0x6c0f84){if(_0x1fc6f5[_0xe629('0x62')]['id']){delete _0x1fc6f5[_0xe629('0x62')]['id'];}return db[_0xe629('0x59')][_0xe629('0x60')]({'where':{'id':_0x1fc6f5[_0xe629('0x69')]['id']},'include':[{'model':db[_0xe629('0x5c')],'as':_0xe629('0x43')}]})[_0xe629('0x22')](handleEntityNotFound(_0x6c0f84,null))[_0xe629('0x22')](saveUpdates(_0x1fc6f5[_0xe629('0x62')],null))[_0xe629('0x22')](respondWithResult(_0x6c0f84,null))[_0xe629('0x2d')](handleError(_0x6c0f84,null));};exports[_0xe629('0x3d')]=function(_0x276f42,_0x2e8ccc){return db[_0xe629('0x59')][_0xe629('0x60')]({'where':{'id':_0x276f42[_0xe629('0x69')]['id']}})[_0xe629('0x22')](handleEntityNotFound(_0x2e8ccc,null))['then'](removeEntity(_0x2e8ccc,null))[_0xe629('0x2d')](handleError(_0x2e8ccc,null));};exports[_0xe629('0x6a')]=function(_0x121cf1,_0x39304c){return db[_0xe629('0x59')][_0xe629('0x6a')]()[_0xe629('0x22')](respondWithResult(_0x39304c,null))[_0xe629('0x2d')](handleError(_0x39304c,null));};exports['addDisposition']=function(_0x4d6bb4,_0x387392,_0x23d1f9){if(_0x4d6bb4[_0xe629('0x62')]['id']){delete _0x4d6bb4[_0xe629('0x62')]['id'];}return db[_0xe629('0x59')][_0xe629('0x60')]({'where':{'id':_0x4d6bb4[_0xe629('0x69')]['id']}})['then'](handleEntityNotFound(_0x387392,null))[_0xe629('0x22')](function(_0x4219dc){if(_0x4219dc){_0x4d6bb4[_0xe629('0x62')][_0xe629('0x6b')]=_0x4219dc['id'];return db[_0xe629('0x6c')][_0xe629('0x61')](_0x4d6bb4[_0xe629('0x62')]);}})['then'](respondWithResult(_0x387392,null))[_0xe629('0x2d')](handleError(_0x387392,null));};exports['getDispositions']=function(_0x51fc23,_0x3646d2,_0x1c0437){var _0x39546b={'raw':![],'where':{}};var _0x120259={};var _0x43c9bf={'count':0x0,'rows':[]};return db[_0xe629('0x59')][_0xe629('0x6d')]({'where':{'id':_0x51fc23['params']['id']}})[_0xe629('0x22')](handleEntityNotFound(_0x3646d2,null))[_0xe629('0x22')](function(_0x3d114f){if(_0x3d114f){_0x120259[_0xe629('0x48')]=_[_0xe629('0x49')](db['Disposition'][_0xe629('0x45')]);_0x120259[_0xe629('0x4a')]=_['keys'](_0x51fc23[_0xe629('0x4a')]);_0x120259[_0xe629('0x4b')]=_[_0xe629('0x4c')](_0x120259[_0xe629('0x48')],_0x120259[_0xe629('0x4a')]);_0x39546b[_0xe629('0x4d')]=_[_0xe629('0x4c')](_0x120259[_0xe629('0x48')],qs[_0xe629('0x4e')](_0x51fc23[_0xe629('0x4a')][_0xe629('0x4e')]));_0x39546b['attributes']=_0x39546b[_0xe629('0x4d')]['length']?_0x39546b[_0xe629('0x4d')]:_0x120259[_0xe629('0x48')];if(!_0x51fc23[_0xe629('0x4a')][_0xe629('0x4f')](_0xe629('0x50'))){_0x39546b[_0xe629('0x34')]=qs[_0xe629('0x34')](_0x51fc23[_0xe629('0x4a')][_0xe629('0x34')]);_0x39546b[_0xe629('0x31')]=qs[_0xe629('0x31')](_0x51fc23[_0xe629('0x4a')][_0xe629('0x31')]);}_0x39546b[_0xe629('0x51')]=qs[_0xe629('0x52')](_0x51fc23[_0xe629('0x4a')][_0xe629('0x52')]);_0x39546b[_0xe629('0x54')]=qs[_0xe629('0x4b')](_['pick'](_0x51fc23[_0xe629('0x4a')],_0x120259['filters']));_0x39546b[_0xe629('0x54')][_0xe629('0x6b')]=_0x3d114f['id'];if(_0x51fc23[_0xe629('0x4a')][_0xe629('0x6e')]){_0x39546b['where']=_[_0xe629('0x57')](_0x39546b[_0xe629('0x54')],{'$or':_[_0xe629('0x44')](_0x39546b['attributes'],function(_0x5d0971){var _0x5452f0={};_0x5452f0[_0x5d0971]={'$like':'%'+_0x51fc23[_0xe629('0x4a')][_0xe629('0x6e')]+'%'};return _0x5452f0;})});}_0x39546b=_[_0xe629('0x57')]({},_0x39546b,_0x51fc23['options']);return db[_0xe629('0x6c')][_0xe629('0x33')]({'where':_0x39546b[_0xe629('0x54')]})[_0xe629('0x22')](function(_0xf138e7){_0x43c9bf[_0xe629('0x33')]=_0xf138e7;if(_0x51fc23[_0xe629('0x4a')]['includeAll']){_0x39546b[_0xe629('0x5f')]=[{'all':!![]}];}return db[_0xe629('0x6c')]['findAll'](_0x39546b);})[_0xe629('0x22')](function(_0x558472){_0x43c9bf['rows']=_0x558472;return _0x43c9bf;});}})['then'](respondWithFilteredResult(_0x3646d2,_0x39546b))[_0xe629('0x2d')](handleError(_0x3646d2,null));};exports[_0xe629('0x6f')]=function(_0x4082b8,_0x2ca523,_0x2c36de){return db[_0xe629('0x59')][_0xe629('0x60')]({'where':{'id':_0x4082b8[_0xe629('0x69')]['id']}})[_0xe629('0x22')](handleEntityNotFound(_0x2ca523,null))[_0xe629('0x22')](function(_0x35350f){if(_0x35350f){return _0x35350f['removeDispositions'](_0x4082b8[_0xe629('0x4a')][_0xe629('0x70')]);}})['then'](respondWithStatusCode(_0x2ca523,null))[_0xe629('0x2d')](handleError(_0x2ca523,null));};exports['addAnswer']=function(_0x3996cd,_0x45cd2a,_0x2de0e0){if(_0x3996cd[_0xe629('0x62')]['id']){delete _0x3996cd[_0xe629('0x62')]['id'];}return db['SmsAccount'][_0xe629('0x60')]({'where':{'id':_0x3996cd[_0xe629('0x69')]['id']}})[_0xe629('0x22')](handleEntityNotFound(_0x45cd2a,null))['then'](function(_0x2dafda){if(_0x2dafda){_0x3996cd[_0xe629('0x62')]['SmsAccountId']=_0x2dafda['id'];return db[_0xe629('0x71')][_0xe629('0x61')](_0x3996cd['body']);}})[_0xe629('0x22')](respondWithResult(_0x45cd2a,null))['catch'](handleError(_0x45cd2a,null));};exports['getAnswers']=function(_0x2434a1,_0x586987,_0xac3792){var _0x13c747={'raw':![],'where':{}};var _0x550e49={};var _0x53b713={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x2434a1[_0xe629('0x69')]['id']}})[_0xe629('0x22')](handleEntityNotFound(_0x586987,null))[_0xe629('0x22')](function(_0x4ee754){if(_0x4ee754){_0x550e49[_0xe629('0x48')]=_[_0xe629('0x49')](db['CannedAnswer']['rawAttributes']);_0x550e49[_0xe629('0x4a')]=_[_0xe629('0x49')](_0x2434a1[_0xe629('0x4a')]);_0x550e49[_0xe629('0x4b')]=_[_0xe629('0x4c')](_0x550e49[_0xe629('0x48')],_0x550e49[_0xe629('0x4a')]);_0x13c747[_0xe629('0x4d')]=_['intersection'](_0x550e49[_0xe629('0x48')],qs[_0xe629('0x4e')](_0x2434a1['query'][_0xe629('0x4e')]));_0x13c747[_0xe629('0x4d')]=_0x13c747[_0xe629('0x4d')][_0xe629('0x5d')]?_0x13c747[_0xe629('0x4d')]:_0x550e49['model'];if(!_0x2434a1['query'][_0xe629('0x4f')](_0xe629('0x50'))){_0x13c747['limit']=qs[_0xe629('0x34')](_0x2434a1[_0xe629('0x4a')][_0xe629('0x34')]);_0x13c747['offset']=qs[_0xe629('0x31')](_0x2434a1[_0xe629('0x4a')][_0xe629('0x31')]);}_0x13c747[_0xe629('0x51')]=qs['sort'](_0x2434a1['query'][_0xe629('0x52')]);_0x13c747['where']=qs[_0xe629('0x4b')](_['pick'](_0x2434a1['query'],_0x550e49[_0xe629('0x4b')]));_0x13c747[_0xe629('0x54')][_0xe629('0x6b')]=_0x4ee754['id'];if(_0x2434a1[_0xe629('0x4a')][_0xe629('0x6e')]){_0x13c747[_0xe629('0x54')]=_[_0xe629('0x57')](_0x13c747[_0xe629('0x54')],{'$or':_[_0xe629('0x44')](_0x13c747['attributes'],function(_0x2db56c){var _0x29bbaa={};_0x29bbaa[_0x2db56c]={'$like':'%'+_0x2434a1['query'][_0xe629('0x6e')]+'%'};return _0x29bbaa;})});}_0x13c747=_[_0xe629('0x57')]({},_0x13c747,_0x2434a1[_0xe629('0x58')]);return db[_0xe629('0x71')]['count']({'where':_0x13c747[_0xe629('0x54')]})['then'](function(_0x5aa958){_0x53b713['count']=_0x5aa958;if(_0x2434a1[_0xe629('0x4a')][_0xe629('0x5e')]){_0x13c747[_0xe629('0x5f')]=[{'all':!![]}];}return db[_0xe629('0x71')][_0xe629('0x5a')](_0x13c747);})[_0xe629('0x22')](function(_0x393a18){_0x53b713[_0xe629('0x72')]=_0x393a18;return _0x53b713;});}})[_0xe629('0x22')](respondWithFilteredResult(_0x586987,_0x13c747))[_0xe629('0x2d')](handleError(_0x586987,null));};exports[_0xe629('0x73')]=function(_0x42a67f,_0x5102dc,_0x381ad3){return db[_0xe629('0x59')][_0xe629('0x60')]({'where':{'id':_0x42a67f[_0xe629('0x69')]['id']}})[_0xe629('0x22')](handleEntityNotFound(_0x5102dc,null))[_0xe629('0x22')](function(_0x563444){if(_0x563444){return _0x563444[_0xe629('0x73')](_0x42a67f[_0xe629('0x4a')]['ids']);}})[_0xe629('0x22')](respondWithStatusCode(_0x5102dc,null))[_0xe629('0x2d')](handleError(_0x5102dc,null));};exports['notify']=function(_0x43400e,_0x242e29,_0xcab5fa){var _0x1c942c={'channel':_0xe629('0x74')};var _0xe7c8d5=[];var _0x28bfef=[];var _0x580e10={};return db[_0xe629('0x59')][_0xe629('0x60')]({'where':{'id':_0x43400e['params']['id']},'include':[{'model':db[_0xe629('0x75')],'as':_0xe629('0x76')}]})['then'](handleEntityNotFound(_0x242e29,null))[_0xe629('0x22')](function(_0x458ad9){_0x1c942c[_0xe629('0x77')]=_0x458ad9;_0x1c942c[_0xe629('0x78')]=_[_0xe629('0x79')](_0x458ad9['Applications'],[_0xe629('0x7a')],[_0xe629('0x7b')]);if(_0x1c942c['account']['Applications']){delete _0x1c942c[_0xe629('0x77')][_0xe629('0x76')];}return db[_0xe629('0x7c')][_0xe629('0x6a')]();})[_0xe629('0x22')](function(_0x8cba2b){if(!_0x8cba2b){throw new db[(_0xe629('0x7d'))][(_0xe629('0x7e'))]('no\x20available\x20attributes');}_0xe7c8d5=_[_0xe629('0x7f')](_['keys'](_0x8cba2b),['createdAt',_0xe629('0x80')]);_0x28bfef=_['difference'](_[_0xe629('0x49')](_0x8cba2b),[_0xe629('0x81'),_0xe629('0x80'),_0xe629('0x82'),'ListId']);_0x1c942c[_0xe629('0x62')]={'mapKey':_0xe629('0x83')};if(_0x1c942c['account'][_0xe629('0x55')]){switch(_0x1c942c[_0xe629('0x77')]['type']){case _0xe629('0x84'):_0x1c942c[_0xe629('0x62')][_0xe629('0x85')]=_0x43400e[_0xe629('0x62')][_0xe629('0x86')];_0x1c942c['body'][_0xe629('0x62')]=_0x43400e[_0xe629('0x62')][_0xe629('0x87')];_0x1c942c[_0xe629('0x62')]['messageId']=_0x43400e['body'][_0xe629('0x88')];break;case _0xe629('0x89'):_0x1c942c[_0xe629('0x62')]['from']='+'+_0x43400e[_0xe629('0x62')]['sender'];_0x1c942c[_0xe629('0x62')][_0xe629('0x62')]=_0x43400e[_0xe629('0x62')][_0xe629('0x8a')];break;case _0xe629('0x8b'):_0x1c942c[_0xe629('0x62')][_0xe629('0x85')]=_0x43400e[_0xe629('0x62')]['from'];_0x1c942c[_0xe629('0x62')][_0xe629('0x62')]=_0x43400e[_0xe629('0x62')]['message'];break;case _0xe629('0x8c'):_0x1c942c[_0xe629('0x62')][_0xe629('0x85')]=_0x43400e[_0xe629('0x62')][_0xe629('0x85')];_0x1c942c['body'][_0xe629('0x62')]=_0x43400e[_0xe629('0x62')]['body'];_0x1c942c['body']['messageId']=_0x43400e[_0xe629('0x62')][_0xe629('0x8d')];break;case _0xe629('0x8e'):_0x1c942c['body'][_0xe629('0x85')]=_0x43400e['body'][_0xe629('0x86')];_0x1c942c[_0xe629('0x62')][_0xe629('0x62')]=_0x43400e[_0xe629('0x62')][_0xe629('0x8f')];_0x1c942c[_0xe629('0x62')][_0xe629('0x90')]=_0x43400e[_0xe629('0x62')][_0xe629('0x91')];break;case _0xe629('0x92'):_0x1c942c[_0xe629('0x62')][_0xe629('0x85')]='+'+_0x43400e[_0xe629('0x62')]['results'][0x0]['from'];_0x1c942c['body'][_0xe629('0x62')]=_0x43400e[_0xe629('0x62')][_0xe629('0x93')][0x0][_0xe629('0x8a')];_0x1c942c[_0xe629('0x62')][_0xe629('0x90')]=_0x43400e['body'][_0xe629('0x93')][0x0][_0xe629('0x90')];break;case _0xe629('0x94'):_0x1c942c['body'][_0xe629('0x85')]=_0x43400e[_0xe629('0x62')]['originatingAddress'];_0x1c942c[_0xe629('0x62')][_0xe629('0x62')]=_0x43400e[_0xe629('0x62')][_0xe629('0x95')]['message'];break;case _0xe629('0x96'):_0x1c942c['body'][_0xe629('0x85')]=_0x43400e[_0xe629('0x62')]['fromNumber'];_0x1c942c['body'][_0xe629('0x62')]=_0x43400e[_0xe629('0x62')][_0xe629('0x8a')];_0x1c942c[_0xe629('0x62')][_0xe629('0x90')]=_0x43400e[_0xe629('0x62')][_0xe629('0x97')];break;case'bandwidth':_0x1c942c[_0xe629('0x62')]['messageId']=_0x43400e[_0xe629('0x62')][0x0][_0xe629('0x2b')]['id'];_0x1c942c[_0xe629('0x62')][_0xe629('0x85')]=_0x43400e[_0xe629('0x62')][0x0][_0xe629('0x2b')]['from'];_0x1c942c['body'][_0xe629('0x62')]=_0x43400e[_0xe629('0x62')][0x0]['message'][_0xe629('0x8a')];break;case _0xe629('0x98'):_0x1c942c[_0xe629('0x62')][_0xe629('0x85')]=_0x43400e[_0xe629('0x62')]['from'];_0x1c942c[_0xe629('0x62')]['body']=_0x43400e[_0xe629('0x62')][_0xe629('0x2b')];_0x1c942c['body'][_0xe629('0x90')]=_0x43400e[_0xe629('0x62')][_0xe629('0x99')];break;}}if(_0x1c942c[_0xe629('0x62')]['id']){delete _0x1c942c[_0xe629('0x62')]['id'];}if(_[_0xe629('0x9a')](_0x1c942c[_0xe629('0x62')]['from'])){throw new db[(_0xe629('0x7d'))][(_0xe629('0x7e'))](_0xe629('0x9b'));}if(_[_0xe629('0x9a')](_0x1c942c['body'][_0xe629('0x62')])||_0x1c942c[_0xe629('0x62')][_0xe629('0x62')]===''){throw new db['Sequelize']['ValidationError'](_0xe629('0x9c'));}if(_['isNil'](_0x1c942c['body'][_0xe629('0x9d')])){throw new db[(_0xe629('0x7d'))][(_0xe629('0x7e'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x28bfef);}if(!_[_0xe629('0x9e')](_0x28bfef,_0x1c942c[_0xe629('0x62')][_0xe629('0x9d')])){throw new db[(_0xe629('0x7d'))][(_0xe629('0x7e'))](_0xe629('0x9f')+_0x28bfef);}_0x580e10[_0x1c942c[_0xe629('0x62')][_0xe629('0x9d')]]=_0x1c942c[_0xe629('0x62')][_0xe629('0x85')];return db[_0xe629('0xa0')][_0xe629('0x60')]({'where':{'id':_0x1c942c[_0xe629('0x77')][_0xe629('0xa1')]},'include':[{'model':db['CmContact'],'as':_0xe629('0xa2'),'where':_0x580e10,'limit':0x1,'order':[[_0xe629('0x80'),'DESC']]}]});})['then'](handleEntityNotFound(_0x242e29,null))['then'](function(_0x577084){if(_0x577084){_0x1c942c[_0xe629('0xa3')]=_['omit'](_0x577084,[_0xe629('0xa2')]);if(_0x577084[_0xe629('0xa2')][_0xe629('0x5d')]){return _0x577084[_0xe629('0xa2')][0x0];}var _0x24a77d=_[_0xe629('0x1a')](_0x1c942c[_0xe629('0x62')],{'firstName':_0x1c942c[_0xe629('0x62')][_0xe629('0x85')],'ListId':_0x577084['id']});_0x24a77d[_0x1c942c[_0xe629('0x62')][_0xe629('0x9d')]]=_0x1c942c[_0xe629('0x62')]['from'];return db['CmContact']['create'](_0x24a77d,{'fields':_0xe7c8d5,'raw':!![]});}})[_0xe629('0x22')](handleEntityNotFound(_0x242e29,null))[_0xe629('0x22')](function(_0x5640d0){if(_0x5640d0){_0x1c942c[_0xe629('0xa4')]=_0x5640d0;var _0x185f9d={'ContactId':_0x5640d0['id'],'phone':_0x1c942c[_0xe629('0x62')][_0xe629('0x85')],'SmsAccountId':_0x43400e['params']['id']};var _0x2db946={'ContactId':_0x5640d0['id'],'SmsAccountId':_0x43400e['params']['id'],'closed':![]};return db[_0xe629('0xa5')][_0xe629('0x60')]({'where':_0x2db946})['then'](function(_0xada8de){if(_0xada8de){return[_0xada8de,![]];}return db['SmsInteraction'][_0xe629('0x61')](_0x185f9d)[_0xe629('0x22')](function(_0x45a8be){return[_0x45a8be,!![]];});});}})[_0xe629('0xa6')](function(_0x4daaaf,_0x2342a5){_0x1c942c[_0xe629('0xa7')]=_0x4daaaf[_0xe629('0x3b')]({'plain':!![]});_0x1c942c[_0xe629('0xa7')]['created']=![];if(_0x2342a5){if(_0x1c942c[_0xe629('0x77')][_0xe629('0xa8')]){_0x1c942c[_0xe629('0x78')][_0xe629('0xa9')]({'id':0x0,'priority':_0x1c942c[_0xe629('0x78')][_0xe629('0x5d')]+0x1,'app':_0xe629('0xaa'),'appdata':'unmanaged','interval':'*,*,*,*'});}_0x1c942c[_0xe629('0xa7')]['created']=!![];}return db[_0xe629('0xab')][_0xe629('0x61')]({'phone':_0x1c942c['body'][_0xe629('0x85')],'messageId':_0x1c942c['body'][_0xe629('0x90')],'body':_0x1c942c[_0xe629('0x62')][_0xe629('0x62')],'SmsAccountId':_0x43400e[_0xe629('0x69')]['id'],'SmsInteractionId':_0x4daaaf['id'],'direction':'in','ContactId':_0x4daaaf['ContactId'],'AttachmentId':_0x1c942c[_0xe629('0x62')][_0xe629('0xac')]});})[_0xe629('0x22')](function(_0x202164){_0x1c942c[_0xe629('0x2b')]=_0x202164;if(!_0x1c942c['interaction'][_0xe629('0xad')])return;return db['User'][_0xe629('0x60')]({'attributes':['id',_0xe629('0x40')],'where':{'id':_0x1c942c[_0xe629('0xa7')][_0xe629('0xad')]}});})['then'](function(_0x522061){if(_0x522061){_0x1c942c[_0xe629('0x78')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x522061['name']+','+(_0x1c942c[_0xe629('0x77')][_0xe629('0xae')]||0xa),'interval':_0xe629('0xaf')});}if(!_0x1c942c['interaction'][_0xe629('0xb0')])return;return db[_0xe629('0xb1')][_0xe629('0x60')]({'attributes':['id',_0xe629('0x40')],'where':{'id':_0x1c942c[_0xe629('0xa7')]['queueId']}});})[_0xe629('0x22')](function(_0x267f9c){if(_0x267f9c){_0x1c942c[_0xe629('0x78')][_0xe629('0xb2')]({'id':0x0,'priority':0x1,'app':_0xe629('0xb3'),'appdata':_0x267f9c[_0xe629('0x40')]+','+(_0x1c942c[_0xe629('0x77')]['waitForTheAssignedQueue']||0x12c),'interval':_0xe629('0xaf')});}return respondWithRpcPromise(_0xe629('0xb4'),_0xe629('0xb5'),_0x1c942c);})['then'](function(_0x4546e3){if(_0x4546e3){var _0x31c656=0xc8;var _0xc744f0='receiveMessage';logger[_0xe629('0x23')](_0xe629('0x27'),_0xc744f0,_0x31c656,_0xe629('0xb6'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0xc744f0,_0x31c656,_0xe629('0xb6'),JSON[_0xe629('0x28')](_0x4546e3));if(_0x1c942c[_0xe629('0x77')][_0xe629('0x55')]===_0xe629('0x84')){return _0x242e29[_0xe629('0x2e')](_0x31c656)[_0xe629('0x35')](_0xe629('0xb7'),_0xe629('0xb8'))[_0xe629('0x41')](_0xe629('0xb9'));}else{return _0x242e29['status'](_0x31c656)[_0xe629('0x30')](_0x4546e3);}}})[_0xe629('0x2d')](handleError(_0x242e29,null));};exports[_0xe629('0xba')]=function(_0x35c9f0,_0x3c48d1){var _0x20e048=_0x35c9f0[_0xe629('0x69')]['id'];var _0x335107=_0x35c9f0[_0xe629('0x62')];var _0x5d0af8=0xc8;var _0x2fe944=null;return db[_0xe629('0xbb')]['transaction']({'isolationLevel':db[_0xe629('0xbb')][_0xe629('0xbc')][_0xe629('0xbd')]['READ_COMMITTED']},function(_0x29e09e){return db['SmsAccount']['findOne']({'where':{'id':_0x20e048},'transaction':_0x29e09e})['then'](function(_0x379d7a){if(_0x379d7a){return db[_0xe629('0x75')]['destroy']({'where':{'SmsAccountId':_0x20e048},'transaction':_0x29e09e})[_0xe629('0x22')](function(){var _0x4eb5c4=_[_0xe629('0x44')](_0x335107,function(_0x5e008a){_0x5e008a['SmsAccountId']=_0x20e048;return _0x5e008a;});return db[_0xe629('0x75')][_0xe629('0xbe')](_0x4eb5c4,{'transaction':_0x29e09e});});}else{_0x5d0af8=0x194;_0x2fe944=[];}});})[_0xe629('0x22')](function(){if(_0x5d0af8!==0x194){return db[_0xe629('0x75')][_0xe629('0xbf')]({'where':{'SmsAccountId':_0x20e048},'order':_0xe629('0x7a')})[_0xe629('0x22')](function(_0xd16f6c){_0x2fe944=_0xd16f6c;});}})['catch'](function(_0x1f3162){_0x5d0af8=0x1f4;logger[_0xe629('0x2a')](_0x1f3162[_0xe629('0x3f')]);if(_0x1f3162[_0xe629('0x40')]){delete _0x1f3162[_0xe629('0x40')];}_0x2fe944=_0x1f3162;})[_0xe629('0xc0')](function(){if(_0x2fe944===null){_0x3c48d1[_0xe629('0x3e')](_0x5d0af8);}else{if(_0x5d0af8===0x1f4){_0x3c48d1[_0xe629('0x2e')](_0x5d0af8)[_0xe629('0x41')](_0x2fe944);}else{_0x3c48d1[_0xe629('0x2e')](_0x5d0af8)[_0xe629('0x30')](_0x2fe944);}}});};exports[_0xe629('0xc1')]=function(_0x408d5d,_0x17bc2a,_0x31333e){var _0x41dda5={};var _0x47e9bd={};var _0x363717;var _0xeae208;return db[_0xe629('0x59')][_0xe629('0x6d')]({'where':{'id':_0x408d5d[_0xe629('0x69')]['id']}})[_0xe629('0x22')](handleEntityNotFound(_0x17bc2a,null))[_0xe629('0x22')](function(_0x247b89){if(_0x247b89){_0x363717=_0x247b89;_0x47e9bd[_0xe629('0x48')]=_[_0xe629('0x49')](db[_0xe629('0x75')]['rawAttributes']);_0x47e9bd[_0xe629('0x4a')]=_[_0xe629('0x49')](_0x408d5d[_0xe629('0x4a')]);_0x47e9bd[_0xe629('0x4b')]=_[_0xe629('0x4c')](_0x47e9bd[_0xe629('0x48')],_0x47e9bd['query']);_0x41dda5[_0xe629('0x4d')]=_[_0xe629('0x4c')](_0x47e9bd[_0xe629('0x48')],qs[_0xe629('0x4e')](_0x408d5d[_0xe629('0x4a')][_0xe629('0x4e')]));_0x41dda5['attributes']=_0x41dda5[_0xe629('0x4d')]['length']?_0x41dda5[_0xe629('0x4d')]:_0x47e9bd['model'];_0x41dda5['order']=qs[_0xe629('0x52')](_0x408d5d[_0xe629('0x4a')][_0xe629('0x52')]);_0x41dda5[_0xe629('0x54')]=qs[_0xe629('0x4b')](_[_0xe629('0x53')](_0x408d5d[_0xe629('0x4a')],_0x47e9bd['filters']));if(_0x408d5d[_0xe629('0x4a')][_0xe629('0x6e')]){_0x41dda5[_0xe629('0x54')]=_['merge'](_0x41dda5['where'],{'$or':_[_0xe629('0x44')](_0x41dda5[_0xe629('0x4d')],function(_0x552776){var _0x163b1d={};_0x163b1d[_0x552776]={'$like':'%'+_0x408d5d['query'][_0xe629('0x6e')]+'%'};return _0x163b1d;})});}_0x41dda5=_[_0xe629('0x57')]({},_0x41dda5,_0x408d5d[_0xe629('0x58')]);return _0x363717[_0xe629('0xc1')](_0x41dda5);}})[_0xe629('0x22')](function(_0xc303b9){if(_0xc303b9){_0xeae208=_0xc303b9[_0xe629('0x5d')];if(!_0x408d5d[_0xe629('0x4a')][_0xe629('0x4f')]('nolimit')){_0x41dda5[_0xe629('0x34')]=qs['limit'](_0x408d5d[_0xe629('0x4a')][_0xe629('0x34')]);_0x41dda5['offset']=qs['offset'](_0x408d5d[_0xe629('0x4a')]['offset']);}return _0x363717[_0xe629('0xc1')](_0x41dda5);}})[_0xe629('0x22')](function(_0x166691){if(_0x166691){return _0x166691?{'count':_0xeae208,'rows':_0x166691}:null;}})['then'](respondWithResult(_0x17bc2a,null))[_0xe629('0x2d')](handleError(_0x17bc2a,null));};exports[_0xe629('0xc2')]=function(_0x16e5f0,_0x4fe788,_0x1a0a55){var _0x739c73={'raw':![],'where':{}};var _0x3700ff={};var _0x32e776={'count':0x0,'rows':[]};return db[_0xe629('0x59')][_0xe629('0x6d')]({'where':{'id':_0x16e5f0[_0xe629('0x69')]['id']}})[_0xe629('0x22')](handleEntityNotFound(_0x4fe788,null))[_0xe629('0x22')](function(_0x2fd1c8){if(_0x2fd1c8){_0x3700ff[_0xe629('0x48')]=_['keys'](db[_0xe629('0xa5')][_0xe629('0x45')]);_0x3700ff[_0xe629('0x4a')]=_[_0xe629('0x49')](_0x16e5f0['query']);_0x3700ff[_0xe629('0x4b')]=_[_0xe629('0x4c')](_0x3700ff[_0xe629('0x48')],_0x3700ff['query']);_0x739c73['attributes']=_['intersection'](_0x3700ff[_0xe629('0x48')],qs[_0xe629('0x4e')](_0x16e5f0['query'][_0xe629('0x4e')]));_0x739c73[_0xe629('0x4d')]=_0x739c73[_0xe629('0x4d')][_0xe629('0x5d')]?_0x739c73[_0xe629('0x4d')]:_0x3700ff['model'];if(!_0x16e5f0[_0xe629('0x4a')][_0xe629('0x4f')](_0xe629('0x50'))){_0x739c73[_0xe629('0x34')]=qs[_0xe629('0x34')](_0x16e5f0[_0xe629('0x4a')]['limit']);_0x739c73['offset']=qs[_0xe629('0x31')](_0x16e5f0[_0xe629('0x4a')][_0xe629('0x31')]);}_0x739c73[_0xe629('0x51')]=qs[_0xe629('0x52')](_0x16e5f0[_0xe629('0x4a')][_0xe629('0x52')]);_0x739c73[_0xe629('0x54')]=qs[_0xe629('0x4b')](_[_0xe629('0x53')](_0x16e5f0[_0xe629('0x4a')],_0x3700ff[_0xe629('0x4b')]));_0x739c73['where'][_0xe629('0x6b')]=_0x2fd1c8['id'];if(_0x16e5f0[_0xe629('0x4a')]['filter']){_0x739c73[_0xe629('0x54')]=_['merge'](_0x739c73[_0xe629('0x54')],{'$or':_[_0xe629('0x44')](_0x739c73[_0xe629('0x4d')],function(_0x3d08e1){var _0x50e1f8={};_0x50e1f8[_0x3d08e1]={'$like':'%'+_0x16e5f0['query'][_0xe629('0x6e')]+'%'};return _0x50e1f8;})});}_0x739c73=_[_0xe629('0x57')]({},_0x739c73,_0x16e5f0['options']);return db[_0xe629('0xa5')]['count']({'where':_0x739c73[_0xe629('0x54')]})[_0xe629('0x22')](function(_0x4cdb3b){_0x32e776[_0xe629('0x33')]=_0x4cdb3b;if(_0x16e5f0[_0xe629('0x4a')][_0xe629('0x5e')]){_0x739c73['include']=[{'model':db[_0xe629('0x7c')],'as':_0xe629('0xc3'),'required':![]},{'model':db[_0xe629('0xc4')],'as':'Owner','attributes':['name',_0xe629('0xc5'),'internal'],'required':![]},{'model':db[_0xe629('0xc6')],'as':_0xe629('0xc7'),'attributes':['id',_0xe629('0x40'),_0xe629('0xc8')],'where':_0x16e5f0[_0xe629('0x4a')][_0xe629('0xc9')]?{'id':_0x16e5f0[_0xe629('0x4a')][_0xe629('0xc9')]}:undefined,'required':_0x16e5f0[_0xe629('0x4a')][_0xe629('0xc9')]?!![]:![]}];}return db[_0xe629('0xa5')][_0xe629('0x5a')](_0x739c73);})[_0xe629('0x22')](function(_0x47e5f3){_0x32e776['rows']=_0x47e5f3;return _0x32e776;});}})[_0xe629('0x22')](respondWithFilteredResult(_0x4fe788,_0x739c73))[_0xe629('0x2d')](handleError(_0x4fe788,null));};exports[_0xe629('0x41')]=function(_0x24abae,_0x23f8fe,_0x43644e){var _0x11b6aa,_0x5ba20c,_0x29d155;if(_[_0xe629('0x9a')](_0x24abae['body'][_0xe629('0x62')])||_0x24abae['body'][_0xe629('0x62')]===''){throw new db[(_0xe629('0x7d'))]['ValidationError'](_0xe629('0x9c'));}if(_[_0xe629('0x9a')](_0x24abae['body']['to'])){throw new db['Sequelize'][(_0xe629('0x7e'))](_0xe629('0xca'));}_0x11b6aa=_0x24abae[_0xe629('0x62')]['to'];return db[_0xe629('0x59')][_0xe629('0x60')]({'where':{'id':_0x24abae[_0xe629('0x69')]['id']},'include':[{'model':db[_0xe629('0xa0')],'as':'List','include':[{'model':db[_0xe629('0x7c')],'as':_0xe629('0xa2'),'where':{'mobile':_0x11b6aa},'limit':0x1,'order':[[_0xe629('0x80'),_0xe629('0xcb')]]}]}]})[_0xe629('0x22')](handleEntityNotFound(_0x23f8fe,null))[_0xe629('0x22')](function(_0x52ad44){if(_0x52ad44&&_0x52ad44['List']){_0x5ba20c=_0x52ad44[_0xe629('0x3b')]({'plain':!![]});if(_0x5ba20c[_0xe629('0xcc')]&&_0x5ba20c[_0xe629('0xcc')]['Contacts'][_0xe629('0x5d')]){return _0x5ba20c[_0xe629('0xcc')][_0xe629('0xa2')][0x0];}return db[_0xe629('0x7c')][_0xe629('0x61')](_[_0xe629('0x1a')](_0x24abae[_0xe629('0x62')],{'firstName':_0x11b6aa,'mobile':_0x11b6aa,'phone':_0x11b6aa,'ListId':_0x5ba20c[_0xe629('0xa1')]}));}})['then'](handleEntityNotFound(_0x23f8fe,null))['then'](function(_0x31bba8){if(_0x31bba8){_0x29d155=_0x31bba8;return db[_0xe629('0xa5')]['find']({'where':{'ContactId':_0x29d155['id'],'closed':![],'SmsAccountId':_0x5ba20c['id']}})[_0xe629('0x22')](function(_0x215e82){if(_0x215e82){return[_0x215e82,![]];}return db[_0xe629('0xa5')]['create']({'UserId':_0x24abae[_0xe629('0x63')]['id'],'ContactId':_0x29d155['id'],'SmsAccountId':_0x5ba20c['id'],'phone':_0x11b6aa,'firstMsgDirection':'out','Messages':[_[_0xe629('0x57')](_0x24abae[_0xe629('0x62')],{'read':![],'body':_0x24abae[_0xe629('0x62')][_0xe629('0x62')],'phone':_0x11b6aa,'SmsAccountId':_0x5ba20c['id'],'UserId':_0x24abae[_0xe629('0x63')]['id'],'ContactId':_0x29d155['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0xe629('0xcd')}]})[_0xe629('0x22')](function(_0x2372a1){return[_0x2372a1,!![]];});});}})[_0xe629('0xa6')](function(_0x306db5,_0x6971a4){if(_0x6971a4){return _0x306db5;}return db['SmsMessage'][_0xe629('0x61')](_['merge'](_0x24abae[_0xe629('0x62')],{'read':![],'body':_0x24abae[_0xe629('0x62')][_0xe629('0x62')],'phone':_0x11b6aa,'SmsAccountId':_0x5ba20c['id'],'SmsInteractionId':_0x306db5['id'],'UserId':_0x24abae['user']['id'],'ContactId':_0x29d155['id']}))[_0xe629('0x22')](function(_0x3c70b5){_0x306db5[_0xe629('0xce')][_0xe629('0xcd')]=[];_0x306db5['dataValues'][_0xe629('0xcd')][_0xe629('0xa9')](_0x3c70b5['dataValues']);return _0x306db5;});})[_0xe629('0x22')](respondWithResult(_0x23f8fe,null))[_0xe629('0x2d')](handleError(_0x23f8fe,null));};exports[_0xe629('0x2e')]=function(_0x3506e3,_0x1aee23,_0x361575){if(_0x3506e3['body']['id']){delete _0x3506e3[_0xe629('0x62')]['id'];}var _0x56a950,_0x487988,_0x2c6c23;return db[_0xe629('0x59')]['find']({'where':{'id':_0x3506e3[_0xe629('0x69')]['id']}})['then'](handleEntityNotFound(_0x1aee23,null))[_0xe629('0x22')](function(_0x475fd5){if(_0x475fd5){_0x2c6c23=_0x475fd5;logger['debug'](_0xe629('0x27'),'status',_0xe629('0xcf'),_0x475fd5[_0xe629('0x55')],util[_0xe629('0xd0')](_0x3506e3[_0xe629('0x62')],{'showHidden':![],'depth':null}));switch(_0x475fd5[_0xe629('0x55')]){case _0xe629('0x89'):if(_0x3506e3[_0xe629('0x62')][_0xe629('0xd1')]&&_0x3506e3[_0xe629('0x62')]['status']){_0x487988=_0x3506e3['body'][_0xe629('0x2e')];return db[_0xe629('0xab')][_0xe629('0x60')]({'where':{'messageId':_0x3506e3[_0xe629('0x62')][_0xe629('0xd1')]}});}break;case _0xe629('0x8b'):if(_0x3506e3[_0xe629('0x62')][_0xe629('0xd2')]&&_0x3506e3[_0xe629('0x62')][_0xe629('0xd3')]){_0x487988=_0x3506e3[_0xe629('0x62')][_0xe629('0xd3')];return db['SmsMessage'][_0xe629('0x60')]({'where':{'messageId':_0x3506e3['body'][_0xe629('0xd2')]}});}break;case _0xe629('0x8c'):if(_0x3506e3[_0xe629('0x62')]['message_id']&&_0x3506e3['body'][_0xe629('0xd4')]){_0x487988=_0x3506e3['body']['status_code'];return db[_0xe629('0xab')][_0xe629('0x60')]({'where':{'messageId':_0x3506e3[_0xe629('0x62')]['message_id']}});}break;case'infobip':var _0x420a2f=_0x3506e3[_0xe629('0x62')]['results'][0x0];if(_0x420a2f[_0xe629('0x90')]&&_0x420a2f[_0xe629('0x2e')][_0xe629('0xd5')]===_0xe629('0xd6')){_0x487988=_0x420a2f[_0xe629('0x2e')][_0xe629('0xd5')];return db[_0xe629('0xab')]['find']({'where':{'messageId':_0x420a2f['messageId']}});}break;case _0xe629('0x96'):if(_0x3506e3[_0xe629('0x62')][_0xe629('0x90')]&&_0x3506e3['body'][_0xe629('0x2e')]){_0x487988=_0x3506e3['body'][_0xe629('0x2e')];return db[_0xe629('0xab')][_0xe629('0x60')]({'where':{'messageId':_0x3506e3[_0xe629('0x62')][_0xe629('0x90')]}});}break;case'bandwidth':if(_0x3506e3[_0xe629('0x62')][0x0][_0xe629('0x2b')]['id']){_0x487988=_0x3506e3[_0xe629('0x62')][0x0][_0xe629('0x55')];return db[_0xe629('0xab')][_0xe629('0x60')]({'where':{'messageId':_0x3506e3['body'][0x0][_0xe629('0x2b')]['id']}});}break;case'intelepeer':if(_0x3506e3[_0xe629('0x62')][_0xe629('0xd7')]&&_0x3506e3['body'][_0xe629('0x2e')]){_0x487988=_0x3506e3[_0xe629('0x62')]['status'];return db['SmsMessage'][_0xe629('0x60')]({'where':{'messageId':_0x3506e3[_0xe629('0x62')]['redif']}});}break;}}})[_0xe629('0x22')](handleEntityNotFound(_0x1aee23,null))[_0xe629('0x22')](function(_0x4b90aa){if(_0x4b90aa){_0x56a950=_0x4b90aa;switch(_0x2c6c23[_0xe629('0x55')]){case'skebby':if(_0x487988===_0xe629('0xd6')){return _0x56a950[_0xe629('0x3a')]({'read':!![]});}else{logger[_0xe629('0x2a')](_0xe629('0x27'),'status',_0xe629('0x89'),util[_0xe629('0xd0')](_0x3506e3[_0xe629('0x62')],{'showHidden':![],'depth':null}));}break;case _0xe629('0x8b'):if(_0x487988==='1'){return _0x56a950[_0xe629('0x3a')]({'read':!![]});}else{logger[_0xe629('0x2a')](_0xe629('0x27'),'status',_0xe629('0x89'),util['inspect'](_0x3506e3['body'],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x3506e3[_0xe629('0x62')][_0xe629('0xd8')]&&_0x487988>=0xc8&&_0x487988<=0xce){return _0x56a950[_0xe629('0x3a')]({'read':!![]});}else{logger[_0xe629('0x2a')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xe629('0x2e'),_0xe629('0x8c'),util[_0xe629('0xd0')](_0x3506e3[_0xe629('0x62')],{'showHidden':![],'depth':null}));}break;case _0xe629('0x92'):var _0x1f379a=_0x3506e3['body'][_0xe629('0x93')][0x0];if(_0x1f379a['status']['groupName']===_0xe629('0xd6')){return _0x56a950['update']({'read':!![]});}else{logger[_0xe629('0x2a')](_0xe629('0x27'),_0xe629('0x2e'),'infobip',util[_0xe629('0xd0')](_0x3506e3[_0xe629('0x62')],{'showHidden':![],'depth':null}));}break;case _0xe629('0x96'):if(_0x487988==_0xe629('0xd9')||_0x487988==_0xe629('0xda')){return _0x56a950[_0xe629('0x3a')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xe629('0x2e'),_0xe629('0x96'),util[_0xe629('0xd0')](_0x3506e3[_0xe629('0x62')],{'showHidden':![],'depth':null}));}break;case _0xe629('0xdb'):if(_0x487988==_0xe629('0xdc')){return _0x56a950['update']({'read':!![]});}else{logger['error'](_0xe629('0x27'),'status',_0xe629('0xdb'),util[_0xe629('0xd0')](_0x3506e3[_0xe629('0x62')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x487988===_0xe629('0xdd')||_0x487988==='ACCEPTD'){return _0x56a950[_0xe629('0x3a')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xe629('0x2e'),_0xe629('0x98'),util[_0xe629('0xd0')](_0x3506e3[_0xe629('0x62')],{'showHidden':![],'depth':null}));}break;}return _0x56a950;}})[_0xe629('0x22')](respondWithResult(_0x1aee23,null))[_0xe629('0x2d')](handleError(_0x1aee23,null));};exports[_0xe629('0xde')]=function(_0x16560f,_0x2caaa3,_0x588c02){var _0x5dd7d3,_0xf4e67f,_0x425c8d;return db['SmsAccount'][_0xe629('0x60')]({'where':{'id':_0x16560f[_0xe629('0x69')]['id']}})[_0xe629('0x22')](handleEntityNotFound(_0x2caaa3,null))['then'](function(_0x7f1a9d){if(_0x7f1a9d){_0x425c8d=_0x7f1a9d;logger['debug'](_0xe629('0x27'),'status','received\x20delivery\x20report\x20from',_0x7f1a9d[_0xe629('0x55')],util[_0xe629('0xd0')](_0x16560f['query'],{'showHidden':![],'depth':null}));switch(_0x7f1a9d['type']){case _0xe629('0x94'):if(_0x16560f[_0xe629('0x4a')]['message-id']&&_0x16560f[_0xe629('0x4a')]['state']){_0xf4e67f=_0x16560f[_0xe629('0x4a')][_0xe629('0xdf')];return db[_0xe629('0xab')]['find']({'where':{'messageId':_0x16560f[_0xe629('0x4a')][_0xe629('0xe0')]}});}break;}}})[_0xe629('0x22')](handleEntityNotFound(_0x2caaa3,null))[_0xe629('0x22')](function(_0x52b531){if(_0x52b531){_0x5dd7d3=_0x52b531;switch(_0x425c8d[_0xe629('0x55')]){case _0xe629('0x94'):if(_0xf4e67f==='2'||_0xf4e67f==='6'){return _0x5dd7d3['update']({'read':!![]});}else{logger[_0xe629('0x2a')](_0xe629('0x27'),_0xe629('0x2e'),_0xe629('0x94'),util['inspect'](_0x16560f[_0xe629('0x4a')],{'showHidden':![],'depth':null}));};break;}return _0x5dd7d3;}})[_0xe629('0x22')](respondWithResult(_0x2caaa3,null))[_0xe629('0x2d')](handleError(_0x2caaa3,null));};exports[_0xe629('0xe1')]=function(_0x50417b,_0x31eecb,_0x443a51){return db['SmsAccount']['find']({'where':{'id':_0x50417b[_0xe629('0x69')]['id']}})[_0xe629('0x22')](handleEntityNotFound(_0x31eecb,null))[_0xe629('0x22')](function(_0x18bb03){if(_0x18bb03){return _0x18bb03[_0xe629('0xe1')](_0x50417b[_0xe629('0x62')][_0xe629('0x70')],_[_0xe629('0xe2')](_0x50417b[_0xe629('0x62')],[_0xe629('0x70'),'id'])||{})['spread'](function(_0x1ed81e){for(var _0x318c27=0x0;_0x318c27<_0x50417b[_0xe629('0x62')]['ids'][_0xe629('0x5d')];_0x318c27+=0x1){socket['emit'](_0xe629('0xe3'),{'UserId':Number(_0x50417b['body']['ids'][_0x318c27]),'SmsAccountId':Number(_0x50417b[_0xe629('0x69')]['id'])});}return _0x1ed81e;});}})[_0xe629('0x22')](respondWithResult(_0x31eecb,null))['catch'](handleError(_0x31eecb,null));};exports[_0xe629('0xe4')]=function(_0x43eaf5,_0x417d2b,_0x1332c3){return db[_0xe629('0x59')][_0xe629('0x60')]({'where':{'id':_0x43eaf5[_0xe629('0x69')]['id']}})['then'](handleEntityNotFound(_0x417d2b,null))[_0xe629('0x22')](function(_0xf12169){if(_0xf12169){return _0xf12169['removeAgents'](_0x43eaf5['query']['ids'])['then'](function(){if(_[_0xe629('0xe5')](_0x43eaf5[_0xe629('0x4a')][_0xe629('0x70')])){for(var _0x53660f=0x0;_0x53660f<_0x43eaf5[_0xe629('0x4a')][_0xe629('0x70')][_0xe629('0x5d')];_0x53660f+=0x1){socket[_0xe629('0xe6')]('userSmsAccount:remove',{'UserId':Number(_0x43eaf5[_0xe629('0x4a')]['ids'][_0x53660f]),'SmsAccountId':Number(_0x43eaf5[_0xe629('0x69')]['id'])});}}else{socket[_0xe629('0xe6')](_0xe629('0xe7'),{'UserId':Number(_0x43eaf5[_0xe629('0x4a')][_0xe629('0x70')]),'SmsAccountId':Number(_0x43eaf5[_0xe629('0x69')]['id'])});}});}})[_0xe629('0x22')](respondWithStatusCode(_0x417d2b,null))[_0xe629('0x2d')](handleError(_0x417d2b,null));};exports[_0xe629('0xe8')]=function(_0x5027de,_0xa71153,_0x10ccb5){var _0x250e92={};var _0xa3f0fe={};var _0x62bdcc;var _0x172d7b;return db[_0xe629('0x59')][_0xe629('0x6d')]({'where':{'id':_0x5027de[_0xe629('0x69')]['id']}})['then'](handleEntityNotFound(_0xa71153,null))['then'](function(_0x468ba0){if(_0x468ba0){_0x62bdcc=_0x468ba0;_0xa3f0fe[_0xe629('0x48')]=_[_0xe629('0x49')](db[_0xe629('0xc4')][_0xe629('0x45')]);_0xa3f0fe[_0xe629('0x4a')]=_[_0xe629('0x49')](_0x5027de[_0xe629('0x4a')]);_0xa3f0fe[_0xe629('0x4b')]=_[_0xe629('0x4c')](_0xa3f0fe[_0xe629('0x48')],_0xa3f0fe[_0xe629('0x4a')]);_0x250e92['attributes']=_[_0xe629('0x4c')](_0xa3f0fe[_0xe629('0x48')],qs[_0xe629('0x4e')](_0x5027de[_0xe629('0x4a')]['fields']));_0x250e92[_0xe629('0x4d')]=_0x250e92['attributes'][_0xe629('0x5d')]?_0x250e92['attributes']:_0xa3f0fe['model'];_0x250e92[_0xe629('0x51')]=qs[_0xe629('0x52')](_0x5027de[_0xe629('0x4a')]['sort']);_0x250e92[_0xe629('0x54')]=qs['filters'](_[_0xe629('0x53')](_0x5027de['query'],_0xa3f0fe['filters']));if(_0x5027de[_0xe629('0x4a')][_0xe629('0x6e')]){_0x250e92[_0xe629('0x54')]=_[_0xe629('0x57')](_0x250e92[_0xe629('0x54')],{'$or':_[_0xe629('0x44')](_0x250e92[_0xe629('0x4d')],function(_0x425df2){var _0x3981ff={};_0x3981ff[_0x425df2]={'$like':'%'+_0x5027de[_0xe629('0x4a')][_0xe629('0x6e')]+'%'};return _0x3981ff;})});}_0x250e92=_[_0xe629('0x57')]({},_0x250e92,_0x5027de[_0xe629('0x58')]);return _0x62bdcc['getAgents'](_0x250e92);}})[_0xe629('0x22')](function(_0x16daaf){if(_0x16daaf){_0x172d7b=_0x16daaf[_0xe629('0x5d')];if(!_0x5027de['query']['hasOwnProperty'](_0xe629('0x50'))){_0x250e92['limit']=qs[_0xe629('0x34')](_0x5027de['query']['limit']);_0x250e92['offset']=qs['offset'](_0x5027de[_0xe629('0x4a')]['offset']);}return _0x62bdcc[_0xe629('0xe8')](_0x250e92);}})[_0xe629('0x22')](function(_0x333f0c){if(_0x333f0c){return _0x333f0c?{'count':_0x172d7b,'rows':_0x333f0c}:null;}})[_0xe629('0x22')](respondWithResult(_0xa71153,null))[_0xe629('0x2d')](handleError(_0xa71153,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 6524fe2..d3191bc 100644 --- a/server/api/smsAccount/smsAccount.events.js +++ b/server/api/smsAccount/smsAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1f95=['exports','events','../../mysqldb','SmsAccount','setMaxListeners','save','update','remove','emit'];(function(_0x22a289,_0x148765){var _0x37d881=function(_0x17db28){while(--_0x17db28){_0x22a289['push'](_0x22a289['shift']());}};_0x37d881(++_0x148765);}(_0x1f95,0xd0));var _0x51f9=function(_0x22ce50,_0x54dbea){_0x22ce50=_0x22ce50-0x0;var _0x4bdfa3=_0x1f95[_0x22ce50];return _0x4bdfa3;};'use strict';var EventEmitter=require(_0x51f9('0x0'));var SmsAccount=require(_0x51f9('0x1'))['db'][_0x51f9('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x51f9('0x3')](0x0);var events={'afterCreate':_0x51f9('0x4'),'afterUpdate':_0x51f9('0x5'),'afterDestroy':_0x51f9('0x6')};function emitEvent(_0x42d6f3){return function(_0x24345b,_0x51d3f8,_0x57d0d2){SmsAccountEvents['emit'](_0x42d6f3+':'+_0x24345b['id'],_0x24345b);SmsAccountEvents[_0x51f9('0x7')](_0x42d6f3,_0x24345b);_0x57d0d2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x51f9('0x8')]=SmsAccountEvents; \ No newline at end of file +var _0x1882=['update','remove','emit','hasOwnProperty','exports','events','SmsAccount','setMaxListeners','save'];(function(_0x46aaaa,_0x3af897){var _0x26d04e=function(_0x4373ba){while(--_0x4373ba){_0x46aaaa['push'](_0x46aaaa['shift']());}};_0x26d04e(++_0x3af897);}(_0x1882,0xb9));var _0x2188=function(_0x5e7d88,_0x362bc5){_0x5e7d88=_0x5e7d88-0x0;var _0x3fb1df=_0x1882[_0x5e7d88];return _0x3fb1df;};'use strict';var EventEmitter=require(_0x2188('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0x2188('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x2188('0x2')](0x0);var events={'afterCreate':_0x2188('0x3'),'afterUpdate':_0x2188('0x4'),'afterDestroy':_0x2188('0x5')};function emitEvent(_0x2c465c){return function(_0x1d0551,_0x4cc6ef,_0x459380){SmsAccountEvents[_0x2188('0x6')](_0x2c465c+':'+_0x1d0551['id'],_0x1d0551);SmsAccountEvents['emit'](_0x2c465c,_0x1d0551);_0x459380(null);};}for(var e in events){if(events[_0x2188('0x7')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x2188('0x8')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 299e606..64dedeb 100644 --- a/server/api/smsAccount/smsAccount.model.js +++ b/server/api/smsAccount/smsAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5125=['path','rimraf','./smsAccount.attributes','exports','define','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x5125,0x1db));var _0x5512=function(_0x48afb3,_0x1e78b6){_0x48afb3=_0x48afb3-0x0;var _0x5a58d6=_0x5125[_0x48afb3];return _0x5a58d6;};'use strict';var _=require(_0x5512('0x0'));var util=require('util');var logger=require(_0x5512('0x1'))(_0x5512('0x2'));var moment=require('moment');var BPromise=require(_0x5512('0x3'));var rp=require(_0x5512('0x4'));var fs=require('fs');var path=require(_0x5512('0x5'));var rimraf=require(_0x5512('0x6'));var config=require('../../config/environment');var attributes=require(_0x5512('0x7'));module[_0x5512('0x8')]=function(_0x6f738c,_0x42c2d9){return _0x6f738c[_0x5512('0x9')]('SmsAccount',attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x70aa=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','define','SmsAccount','sms_accounts'];(function(_0x3da687,_0x2ebafa){var _0x1a7e7a=function(_0x1b8099){while(--_0x1b8099){_0x3da687['push'](_0x3da687['shift']());}};_0x1a7e7a(++_0x2ebafa);}(_0x70aa,0x90));var _0xa70a=function(_0x1b02bb,_0x3d9fde){_0x1b02bb=_0x1b02bb-0x0;var _0x131245=_0x70aa[_0x1b02bb];return _0x131245;};'use strict';var _=require(_0xa70a('0x0'));var util=require(_0xa70a('0x1'));var logger=require(_0xa70a('0x2'))(_0xa70a('0x3'));var moment=require(_0xa70a('0x4'));var BPromise=require(_0xa70a('0x5'));var rp=require(_0xa70a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa70a('0x7'));var config=require('../../config/environment');var attributes=require('./smsAccount.attributes');module[_0xa70a('0x8')]=function(_0x54f2fc,_0x44fb8e){return _0x54f2fc[_0xa70a('0x9')](_0xa70a('0xa'),attributes,{'tableName':_0xa70a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index 48790f7..a2a490a 100644 --- a/server/api/smsAccount/smsAccount.rpc.js +++ b/server/api/smsAccount/smsAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x03c4=['map','model','stringify','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','localhost','./smsAccount.socket','register','request','then','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','ShowSmsAccount','find','options','where','attributes','include'];(function(_0xab9d30,_0x188a37){var _0x5b9ea8=function(_0x1cec03){while(--_0x1cec03){_0xab9d30['push'](_0xab9d30['shift']());}};_0x5b9ea8(++_0x188a37);}(_0x03c4,0xf8));var _0x403c=function(_0x30a339,_0x15699d){_0x30a339=_0x30a339-0x0;var _0x312b8a=_0x03c4[_0x30a339];return _0x312b8a;};'use strict';var _=require(_0x403c('0x0'));var util=require(_0x403c('0x1'));var moment=require(_0x403c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x403c('0x3'));var db=require(_0x403c('0x4'))['db'];var utils=require(_0x403c('0x5'));var logger=require(_0x403c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x403c('0x7')][_0x403c('0x8')]({'port':0x232a});config[_0x403c('0x9')]=_[_0x403c('0xa')](config['redis'],{'host':_0x403c('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x403c('0x9')]));require(_0x403c('0xc'))[_0x403c('0xd')](socket);function respondWithRpcPromise(_0x2f1181,_0x186f0c,_0x52bea3){return new BPromise(function(_0x4b8bc4,_0xd0a4a9){return client[_0x403c('0xe')](_0x2f1181,_0x52bea3)[_0x403c('0xf')](function(_0x128462){logger['info'](_0x403c('0x10'),_0x186f0c,'request\x20sent');logger[_0x403c('0x11')](_0x403c('0x12'),_0x186f0c,_0x403c('0x13'),JSON['stringify'](_0x128462));if(_0x128462[_0x403c('0x14')]){if(_0x128462[_0x403c('0x14')][_0x403c('0x15')]===0x1f4){logger[_0x403c('0x14')](_0x403c('0x10'),_0x186f0c,_0x128462[_0x403c('0x14')][_0x403c('0x16')]);return _0xd0a4a9(_0x128462[_0x403c('0x14')][_0x403c('0x16')]);}logger[_0x403c('0x14')](_0x403c('0x10'),_0x186f0c,_0x128462[_0x403c('0x14')]['message']);return _0x4b8bc4(_0x128462[_0x403c('0x14')]['message']);}else{logger[_0x403c('0x17')]('SmsAccount,\x20%s,\x20%s',_0x186f0c,_0x403c('0x13'));_0x4b8bc4(_0x128462[_0x403c('0x18')][_0x403c('0x16')]);}})[_0x403c('0x19')](function(_0x4a6d4d){logger[_0x403c('0x14')](_0x403c('0x10'),_0x186f0c,_0x4a6d4d);_0xd0a4a9(_0x4a6d4d);});});}exports[_0x403c('0x1a')]=function(_0x52bad1){var _0x3086a5=this;return new Promise(function(_0x19f284,_0x437f0b){return db['SmsAccount'][_0x403c('0x1b')]({'raw':_0x52bad1[_0x403c('0x1c')]?_0x52bad1[_0x403c('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x52bad1[_0x403c('0x1c')]?_0x52bad1[_0x403c('0x1c')][_0x403c('0x1d')]||null:null,'attributes':_0x52bad1[_0x403c('0x1c')]?_0x52bad1[_0x403c('0x1c')][_0x403c('0x1e')]||null:null,'include':_0x52bad1['options']?_0x52bad1[_0x403c('0x1c')][_0x403c('0x1f')]?_[_0x403c('0x20')](_0x52bad1['options'][_0x403c('0x1f')],function(_0x11b322){return{'model':db[_0x11b322['model']],'as':_0x11b322['as'],'attributes':_0x11b322[_0x403c('0x1e')],'include':_0x11b322[_0x403c('0x1f')]?_['map'](_0x11b322[_0x403c('0x1f')],function(_0x3c41b9){return{'model':db[_0x3c41b9['model']],'as':_0x3c41b9['as'],'attributes':_0x3c41b9[_0x403c('0x1e')],'include':_0x3c41b9[_0x403c('0x1f')]?_[_0x403c('0x20')](_0x3c41b9[_0x403c('0x1f')],function(_0x552ff7){return{'model':db[_0x552ff7[_0x403c('0x21')]],'as':_0x552ff7['as'],'attributes':_0x552ff7[_0x403c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x403c('0xf')](function(_0x564ce3){logger[_0x403c('0x17')](_0x403c('0x1a'),_0x52bad1);logger[_0x403c('0x11')](_0x403c('0x1a'),_0x52bad1,JSON[_0x403c('0x22')](_0x564ce3));_0x19f284(_0x564ce3);})['catch'](function(_0x4369fc){logger[_0x403c('0x14')](_0x403c('0x1a'),_0x4369fc[_0x403c('0x16')],_0x52bad1);_0x437f0b(_0x3086a5[_0x403c('0x14')](0x1f4,_0x4369fc[_0x403c('0x16')]));});});}; \ No newline at end of file +var _0xc650=['../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','./smsAccount.socket','request','then','request\x20sent','debug','stringify','error','SmsAccount,\x20%s,\x20%s','message','info','result','catch','ShowSmsAccount','find','options','attributes','model','include','map','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xc650,0x142));var _0x0c65=function(_0x42db23,_0x112b01){_0x42db23=_0x42db23-0x0;var _0x2d1e4e=_0xc650[_0x42db23];return _0x2d1e4e;};'use strict';var _=require(_0x0c65('0x0'));var util=require(_0x0c65('0x1'));var moment=require(_0x0c65('0x2'));var BPromise=require(_0x0c65('0x3'));var rs=require(_0x0c65('0x4'));var fs=require('fs');var Redis=require(_0x0c65('0x5'));var db=require(_0x0c65('0x6'))['db'];var utils=require(_0x0c65('0x7'));var logger=require(_0x0c65('0x8'))('rpc');var config=require(_0x0c65('0x9'));var jayson=require(_0x0c65('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x0c65('0xb')]=_[_0x0c65('0xc')](config['redis'],{'host':_0x0c65('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0c65('0xb')]));require(_0x0c65('0xe'))['register'](socket);function respondWithRpcPromise(_0x2dd2f6,_0x256ee6,_0x2169c1){return new BPromise(function(_0x1d1925,_0x1f85f8){return client[_0x0c65('0xf')](_0x2dd2f6,_0x2169c1)[_0x0c65('0x10')](function(_0x3bea9f){logger['info']('SmsAccount,\x20%s,\x20%s',_0x256ee6,_0x0c65('0x11'));logger[_0x0c65('0x12')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x256ee6,_0x0c65('0x11'),JSON[_0x0c65('0x13')](_0x3bea9f));if(_0x3bea9f[_0x0c65('0x14')]){if(_0x3bea9f[_0x0c65('0x14')]['code']===0x1f4){logger[_0x0c65('0x14')](_0x0c65('0x15'),_0x256ee6,_0x3bea9f[_0x0c65('0x14')][_0x0c65('0x16')]);return _0x1f85f8(_0x3bea9f['error']['message']);}logger[_0x0c65('0x14')](_0x0c65('0x15'),_0x256ee6,_0x3bea9f[_0x0c65('0x14')][_0x0c65('0x16')]);return _0x1d1925(_0x3bea9f[_0x0c65('0x14')][_0x0c65('0x16')]);}else{logger[_0x0c65('0x17')]('SmsAccount,\x20%s,\x20%s',_0x256ee6,_0x0c65('0x11'));_0x1d1925(_0x3bea9f[_0x0c65('0x18')]['message']);}})[_0x0c65('0x19')](function(_0x43cb9b){logger[_0x0c65('0x14')](_0x0c65('0x15'),_0x256ee6,_0x43cb9b);_0x1f85f8(_0x43cb9b);});});}exports[_0x0c65('0x1a')]=function(_0x42c5d2){var _0x454f63=this;return new Promise(function(_0x45177c,_0x5c2f39){return db['SmsAccount'][_0x0c65('0x1b')]({'raw':_0x42c5d2['options']?_0x42c5d2[_0x0c65('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x42c5d2[_0x0c65('0x1c')]?_0x42c5d2[_0x0c65('0x1c')]['where']||null:null,'attributes':_0x42c5d2[_0x0c65('0x1c')]?_0x42c5d2[_0x0c65('0x1c')][_0x0c65('0x1d')]||null:null,'include':_0x42c5d2['options']?_0x42c5d2[_0x0c65('0x1c')]['include']?_['map'](_0x42c5d2[_0x0c65('0x1c')]['include'],function(_0x5f4e75){return{'model':db[_0x5f4e75[_0x0c65('0x1e')]],'as':_0x5f4e75['as'],'attributes':_0x5f4e75[_0x0c65('0x1d')],'include':_0x5f4e75[_0x0c65('0x1f')]?_[_0x0c65('0x20')](_0x5f4e75[_0x0c65('0x1f')],function(_0x591e24){return{'model':db[_0x591e24[_0x0c65('0x1e')]],'as':_0x591e24['as'],'attributes':_0x591e24[_0x0c65('0x1d')],'include':_0x591e24['include']?_[_0x0c65('0x20')](_0x591e24[_0x0c65('0x1f')],function(_0x4b6e80){return{'model':db[_0x4b6e80['model']],'as':_0x4b6e80['as'],'attributes':_0x4b6e80[_0x0c65('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0c65('0x10')](function(_0x5b4e8e){logger[_0x0c65('0x17')]('ShowSmsAccount',_0x42c5d2);logger['debug'](_0x0c65('0x1a'),_0x42c5d2,JSON['stringify'](_0x5b4e8e));_0x45177c(_0x5b4e8e);})['catch'](function(_0x439913){logger[_0x0c65('0x14')]('ShowSmsAccount',_0x439913['message'],_0x42c5d2);_0x5c2f39(_0x454f63[_0x0c65('0x14')](0x1f4,_0x439913[_0x0c65('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 7267ec6..690f59a 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index 2884096..71ae3c3 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['../../config/environment','./smsApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x13eec6,_0x170127){var _0x585c24=function(_0x3052df){while(--_0x3052df){_0x13eec6['push'](_0x13eec6['shift']());}};_0x585c24(++_0x170127);}(_0x34e8,0x12c));var _0x834e=function(_0x32cd14,_0x1e1ab7){_0x32cd14=_0x32cd14-0x0;var _0x25a3db=_0x34e8[_0x32cd14];return _0x25a3db;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xf')]('/',auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);module[_0x834e('0x15')]=router; \ No newline at end of file +var _0x55ca=['update','delete','/:id','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','show','create'];(function(_0x1dec83,_0x12ead5){var _0xca669=function(_0x38d2fa){while(--_0x38d2fa){_0x1dec83['push'](_0x1dec83['shift']());}};_0xca669(++_0x12ead5);}(_0x55ca,0x126));var _0xa55c=function(_0x5597a0,_0x35c11e){_0x5597a0=_0x5597a0-0x0;var _0x2fc8d6=_0x55ca[_0x5597a0];return _0x2fc8d6;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['post']('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0xb')]);router['put']('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xc')]);router[_0xa55c('0xd')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);module[_0xa55c('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index aa962f0..a3bb1e8 100644 --- a/server/api/smsApplication/smsApplication.attributes.js +++ b/server/api/smsApplication/smsApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4da1=['*,*,*,*','sequelize','STRING','TEXT'];(function(_0x1ee0a1,_0x51058e){var _0x1d2d5b=function(_0x35cfb5){while(--_0x35cfb5){_0x1ee0a1['push'](_0x1ee0a1['shift']());}};_0x1d2d5b(++_0x51058e);}(_0x4da1,0xb5));var _0x14da=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4da1[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x14da('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x14da('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x14da('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x14da('0x1')],'defaultValue':_0x14da('0x3')}}; \ No newline at end of file +var _0x22fc=['exports','INTEGER','noop','TEXT','STRING','sequelize'];(function(_0x167cd4,_0x185eae){var _0x2d71b6=function(_0x3d13be){while(--_0x3d13be){_0x167cd4['push'](_0x167cd4['shift']());}};_0x2d71b6(++_0x185eae);}(_0x22fc,0x149));var _0xc22f=function(_0x6188d4,_0xf6bb3b){_0x6188d4=_0x6188d4-0x0;var _0xde06a3=_0x22fc[_0x6188d4];return _0xde06a3;};'use strict';var Sequelize=require(_0xc22f('0x0'));module[_0xc22f('0x1')]={'priority':{'type':Sequelize[_0xc22f('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc22f('0x3')},'appdata':{'type':Sequelize[_0xc22f('0x4')]()},'description':{'type':Sequelize[_0xc22f('0x5')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index dc3fc54..40ae6f6 100644 --- a/server/api/smsApplication/smsApplication.controller.js +++ b/server/api/smsApplication/smsApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xefb0=['count','limit','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','name','send','index','map','SmsApplication','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','rawAttributes','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','undefined','offset'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xefb0,0x1a5));var _0x0efb=function(_0x1a42d2,_0x34daf2){_0x1a42d2=_0x1a42d2-0x0;var _0x5a2d73=_0xefb0[_0x1a42d2];return _0x5a2d73;};'use strict';var emlformat=require(_0x0efb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0efb('0x1'));var jsonpatch=require(_0x0efb('0x2'));var rp=require(_0x0efb('0x3'));var moment=require(_0x0efb('0x4'));var BPromise=require(_0x0efb('0x5'));var Mustache=require(_0x0efb('0x6'));var util=require('util');var path=require('path');var sox=require(_0x0efb('0x7'));var csv=require('to-csv');var ejs=require(_0x0efb('0x8'));var fs=require('fs');var fs_extra=require(_0x0efb('0x9'));var _=require(_0x0efb('0xa'));var squel=require('squel');var crypto=require(_0x0efb('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0efb('0xc'));var toCsv=require(_0x0efb('0xd'));var querystring=require(_0x0efb('0xe'));var Papa=require(_0x0efb('0xf'));var Redis=require(_0x0efb('0x10'));var authService=require(_0x0efb('0x11'));var qs=require(_0x0efb('0x12'));var as=require(_0x0efb('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0efb('0x14'))(_0x0efb('0x15'));var utils=require(_0x0efb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0efb('0x17'));var db=require(_0x0efb('0x18'))['db'];function respondWithStatusCode(_0x15bec9,_0x33ce14){_0x33ce14=_0x33ce14||0xcc;return function(_0x821ee9){if(_0x821ee9){return _0x15bec9['sendStatus'](_0x33ce14);}return _0x15bec9[_0x0efb('0x19')](_0x33ce14)['end']();};}function respondWithResult(_0xfb9516,_0x2f761c){_0x2f761c=_0x2f761c||0xc8;return function(_0x24e1ec){if(_0x24e1ec){return _0xfb9516[_0x0efb('0x19')](_0x2f761c)[_0x0efb('0x1a')](_0x24e1ec);}};}function respondWithFilteredResult(_0x1bc214,_0x5dc30f){return function(_0x4809d0){if(_0x4809d0){var _0x985c84=typeof _0x5dc30f['offset']===_0x0efb('0x1b')&&typeof _0x5dc30f['limit']===_0x0efb('0x1b');var _0x2f6e5b=_0x4809d0['count'];var _0x253b33=_0x985c84?0x0:_0x5dc30f[_0x0efb('0x1c')];var _0x1402d3=_0x985c84?_0x4809d0[_0x0efb('0x1d')]:_0x5dc30f[_0x0efb('0x1c')]+_0x5dc30f[_0x0efb('0x1e')];var _0x469a47;if(_0x1402d3>=_0x2f6e5b){_0x1402d3=_0x2f6e5b;_0x469a47=0xc8;}else{_0x469a47=0xce;}_0x1bc214[_0x0efb('0x19')](_0x469a47);return _0x1bc214['set'](_0x0efb('0x1f'),_0x253b33+'-'+_0x1402d3+'/'+_0x2f6e5b)[_0x0efb('0x1a')](_0x4809d0);}return null;};}function patchUpdates(_0x5a9076){return function(_0x228463){try{jsonpatch[_0x0efb('0x20')](_0x228463,_0x5a9076,!![]);}catch(_0x5079ca){return BPromise[_0x0efb('0x21')](_0x5079ca);}return _0x228463[_0x0efb('0x22')]();};}function saveUpdates(_0x440f72,_0x30ec2b){return function(_0x5656dc){if(_0x5656dc){return _0x5656dc[_0x0efb('0x23')](_0x440f72)[_0x0efb('0x24')](function(_0xaa2eeb){return _0xaa2eeb;});}return null;};}function removeEntity(_0x44ef7d,_0x585265){return function(_0x57fad3){if(_0x57fad3){return _0x57fad3[_0x0efb('0x25')]()[_0x0efb('0x24')](function(){_0x44ef7d[_0x0efb('0x19')](0xcc)[_0x0efb('0x26')]();});}};}function handleEntityNotFound(_0x4a6a49,_0x38c6f0){return function(_0x3cd8e4){if(!_0x3cd8e4){_0x4a6a49[_0x0efb('0x27')](0x194);}return _0x3cd8e4;};}function handleError(_0x48ca50,_0x37a1aa){_0x37a1aa=_0x37a1aa||0x1f4;return function(_0x486da5){logger[_0x0efb('0x28')](_0x486da5['stack']);if(_0x486da5[_0x0efb('0x29')]){delete _0x486da5[_0x0efb('0x29')];}_0x48ca50[_0x0efb('0x19')](_0x37a1aa)[_0x0efb('0x2a')](_0x486da5);};}exports[_0x0efb('0x2b')]=function(_0x9d57da,_0x5d86b1){var _0x431877={},_0x299323={},_0x4bf02d={'count':0x0,'rows':[]};var _0x105496=_[_0x0efb('0x2c')](db[_0x0efb('0x2d')]['rawAttributes'],function(_0x4145e1){return{'name':_0x4145e1['fieldName'],'type':_0x4145e1[_0x0efb('0x2e')][_0x0efb('0x2f')]};});_0x299323['model']=_[_0x0efb('0x2c')](_0x105496,_0x0efb('0x29'));_0x299323[_0x0efb('0x30')]=_['keys'](_0x9d57da[_0x0efb('0x30')]);_0x299323[_0x0efb('0x31')]=_[_0x0efb('0x32')](_0x299323['model'],_0x299323[_0x0efb('0x30')]);_0x431877[_0x0efb('0x33')]=_[_0x0efb('0x32')](_0x299323[_0x0efb('0x34')],qs[_0x0efb('0x35')](_0x9d57da[_0x0efb('0x30')]['fields']));_0x431877[_0x0efb('0x33')]=_0x431877[_0x0efb('0x33')][_0x0efb('0x36')]?_0x431877['attributes']:_0x299323[_0x0efb('0x34')];if(!_0x9d57da[_0x0efb('0x30')][_0x0efb('0x37')](_0x0efb('0x38'))){_0x431877[_0x0efb('0x1e')]=qs[_0x0efb('0x1e')](_0x9d57da['query']['limit']);_0x431877[_0x0efb('0x1c')]=qs['offset'](_0x9d57da[_0x0efb('0x30')][_0x0efb('0x1c')]);}_0x431877['order']=qs[_0x0efb('0x39')](_0x9d57da[_0x0efb('0x30')]['sort']);_0x431877[_0x0efb('0x3a')]=qs[_0x0efb('0x31')](_[_0x0efb('0x3b')](_0x9d57da[_0x0efb('0x30')],_0x299323[_0x0efb('0x31')]),_0x105496);if(_0x9d57da[_0x0efb('0x30')][_0x0efb('0x3c')]){_0x431877[_0x0efb('0x3a')]=_[_0x0efb('0x3d')](_0x431877[_0x0efb('0x3a')],{'$or':_['map'](_0x105496,function(_0x3f030f){if(_0x3f030f[_0x0efb('0x2e')]!==_0x0efb('0x3e')){var _0x3428d7={};_0x3428d7[_0x3f030f[_0x0efb('0x29')]]={'$like':'%'+_0x9d57da[_0x0efb('0x30')][_0x0efb('0x3c')]+'%'};return _0x3428d7;}})});}_0x431877=_[_0x0efb('0x3d')]({},_0x431877,_0x9d57da[_0x0efb('0x3f')]);var _0x142563={'where':_0x431877[_0x0efb('0x3a')]};return db['SmsApplication'][_0x0efb('0x1d')](_0x142563)['then'](function(_0x39d4ed){_0x4bf02d[_0x0efb('0x1d')]=_0x39d4ed;if(_0x9d57da[_0x0efb('0x30')][_0x0efb('0x40')]){_0x431877[_0x0efb('0x41')]=[{'all':!![]}];}return db[_0x0efb('0x2d')]['findAll'](_0x431877);})['then'](function(_0x46fc75){_0x4bf02d[_0x0efb('0x42')]=_0x46fc75;return _0x4bf02d;})['then'](respondWithFilteredResult(_0x5d86b1,_0x431877))[_0x0efb('0x43')](handleError(_0x5d86b1,null));};exports[_0x0efb('0x44')]=function(_0x88387c,_0x17b454){var _0x9aca91={'raw':!![],'where':{'id':_0x88387c[_0x0efb('0x45')]['id']}},_0x5cf0d6={};_0x5cf0d6[_0x0efb('0x34')]=_[_0x0efb('0x46')](db['SmsApplication'][_0x0efb('0x47')]);_0x5cf0d6[_0x0efb('0x30')]=_[_0x0efb('0x46')](_0x88387c['query']);_0x5cf0d6[_0x0efb('0x31')]=_[_0x0efb('0x32')](_0x5cf0d6[_0x0efb('0x34')],_0x5cf0d6[_0x0efb('0x30')]);_0x9aca91[_0x0efb('0x33')]=_[_0x0efb('0x32')](_0x5cf0d6[_0x0efb('0x34')],qs[_0x0efb('0x35')](_0x88387c[_0x0efb('0x30')][_0x0efb('0x35')]));_0x9aca91['attributes']=_0x9aca91[_0x0efb('0x33')]['length']?_0x9aca91['attributes']:_0x5cf0d6[_0x0efb('0x34')];if(_0x88387c['query'][_0x0efb('0x40')]){_0x9aca91[_0x0efb('0x41')]=[{'all':!![]}];}_0x9aca91=_[_0x0efb('0x3d')]({},_0x9aca91,_0x88387c['options']);return db[_0x0efb('0x2d')][_0x0efb('0x48')](_0x9aca91)[_0x0efb('0x24')](handleEntityNotFound(_0x17b454,null))['then'](respondWithResult(_0x17b454,null))[_0x0efb('0x43')](handleError(_0x17b454,null));};exports[_0x0efb('0x49')]=function(_0x85636b,_0x449a27){return db[_0x0efb('0x2d')][_0x0efb('0x49')](_0x85636b['body'],{})[_0x0efb('0x24')](respondWithResult(_0x449a27,0xc9))[_0x0efb('0x43')](handleError(_0x449a27,null));};exports[_0x0efb('0x23')]=function(_0x3ccadd,_0x232ce5){if(_0x3ccadd[_0x0efb('0x4a')]['id']){delete _0x3ccadd[_0x0efb('0x4a')]['id'];}return db[_0x0efb('0x2d')]['find']({'where':{'id':_0x3ccadd[_0x0efb('0x45')]['id']}})['then'](handleEntityNotFound(_0x232ce5,null))[_0x0efb('0x24')](saveUpdates(_0x3ccadd[_0x0efb('0x4a')],null))['then'](respondWithResult(_0x232ce5,null))[_0x0efb('0x43')](handleError(_0x232ce5,null));};exports[_0x0efb('0x25')]=function(_0x1c4632,_0x4a2b60){return db['SmsApplication']['find']({'where':{'id':_0x1c4632[_0x0efb('0x45')]['id']}})[_0x0efb('0x24')](handleEntityNotFound(_0x4a2b60,null))['then'](removeEntity(_0x4a2b60,null))['catch'](handleError(_0x4a2b60,null));}; \ No newline at end of file +var _0xb4e8=['desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','save','update','then','destroy','stack','send','index','map','SmsApplication','type','key','model','name','query','intersection','attributes','hasOwnProperty','order','sort','filters','pick','merge','VIRTUAL','filter','options','include','rows','catch','keys','fields','length','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce'];(function(_0x24e914,_0x14b008){var _0x2cabe2=function(_0xac0dc1){while(--_0xac0dc1){_0x24e914['push'](_0x24e914['shift']());}};_0x2cabe2(++_0x14b008);}(_0xb4e8,0x80));var _0x8b4e=function(_0x1e76cc,_0x2e2148){_0x1e76cc=_0x1e76cc-0x0;var _0x17bcc4=_0xb4e8[_0x1e76cc];return _0x17bcc4;};'use strict';var emlformat=require(_0x8b4e('0x0'));var rimraf=require(_0x8b4e('0x1'));var zipdir=require(_0x8b4e('0x2'));var jsonpatch=require(_0x8b4e('0x3'));var rp=require('request-promise');var moment=require(_0x8b4e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8b4e('0x5'));var util=require(_0x8b4e('0x6'));var path=require(_0x8b4e('0x7'));var sox=require(_0x8b4e('0x8'));var csv=require(_0x8b4e('0x9'));var ejs=require(_0x8b4e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8b4e('0xb'));var crypto=require(_0x8b4e('0xc'));var jsforce=require(_0x8b4e('0xd'));var deskjs=require(_0x8b4e('0xe'));var toCsv=require(_0x8b4e('0x9'));var querystring=require(_0x8b4e('0xf'));var Papa=require('papaparse');var Redis=require(_0x8b4e('0x10'));var authService=require(_0x8b4e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8b4e('0x12'));var hardwareService=require(_0x8b4e('0x13'));var logger=require(_0x8b4e('0x14'))(_0x8b4e('0x15'));var utils=require(_0x8b4e('0x16'));var config=require(_0x8b4e('0x17'));var licenseUtil=require(_0x8b4e('0x18'));var db=require(_0x8b4e('0x19'))['db'];function respondWithStatusCode(_0x2129e7,_0x591b21){_0x591b21=_0x591b21||0xcc;return function(_0x1949ee){if(_0x1949ee){return _0x2129e7[_0x8b4e('0x1a')](_0x591b21);}return _0x2129e7[_0x8b4e('0x1b')](_0x591b21)[_0x8b4e('0x1c')]();};}function respondWithResult(_0x343a6b,_0x40fd52){_0x40fd52=_0x40fd52||0xc8;return function(_0x20013f){if(_0x20013f){return _0x343a6b[_0x8b4e('0x1b')](_0x40fd52)['json'](_0x20013f);}};}function respondWithFilteredResult(_0x5a504d,_0x431f96){return function(_0x94bac7){if(_0x94bac7){var _0x1fe8c4=typeof _0x431f96[_0x8b4e('0x1d')]===_0x8b4e('0x1e')&&typeof _0x431f96[_0x8b4e('0x1f')]===_0x8b4e('0x1e');var _0x264892=_0x94bac7[_0x8b4e('0x20')];var _0x723236=_0x1fe8c4?0x0:_0x431f96[_0x8b4e('0x1d')];var _0x1efb50=_0x1fe8c4?_0x94bac7[_0x8b4e('0x20')]:_0x431f96[_0x8b4e('0x1d')]+_0x431f96[_0x8b4e('0x1f')];var _0x10b4f0;if(_0x1efb50>=_0x264892){_0x1efb50=_0x264892;_0x10b4f0=0xc8;}else{_0x10b4f0=0xce;}_0x5a504d[_0x8b4e('0x1b')](_0x10b4f0);return _0x5a504d['set'](_0x8b4e('0x21'),_0x723236+'-'+_0x1efb50+'/'+_0x264892)[_0x8b4e('0x22')](_0x94bac7);}return null;};}function patchUpdates(_0x3b6037){return function(_0x64e765){try{jsonpatch[_0x8b4e('0x23')](_0x64e765,_0x3b6037,!![]);}catch(_0x53c8fd){return BPromise['reject'](_0x53c8fd);}return _0x64e765[_0x8b4e('0x24')]();};}function saveUpdates(_0x17bc43,_0x5272a1){return function(_0x167cb9){if(_0x167cb9){return _0x167cb9[_0x8b4e('0x25')](_0x17bc43)[_0x8b4e('0x26')](function(_0x5eeb30){return _0x5eeb30;});}return null;};}function removeEntity(_0x277eaa,_0xc7cf8d){return function(_0x2eb7e1){if(_0x2eb7e1){return _0x2eb7e1[_0x8b4e('0x27')]()[_0x8b4e('0x26')](function(){_0x277eaa[_0x8b4e('0x1b')](0xcc)[_0x8b4e('0x1c')]();});}};}function handleEntityNotFound(_0x2196ce,_0x163899){return function(_0x4ad44d){if(!_0x4ad44d){_0x2196ce['sendStatus'](0x194);}return _0x4ad44d;};}function handleError(_0x3047a2,_0x3b712e){_0x3b712e=_0x3b712e||0x1f4;return function(_0x5b267b){logger['error'](_0x5b267b[_0x8b4e('0x28')]);if(_0x5b267b['name']){delete _0x5b267b['name'];}_0x3047a2[_0x8b4e('0x1b')](_0x3b712e)[_0x8b4e('0x29')](_0x5b267b);};}exports[_0x8b4e('0x2a')]=function(_0xf1e02,_0x17946e){var _0x664bb7={},_0x1b6d4e={},_0x2b6b59={'count':0x0,'rows':[]};var _0x24f55f=_[_0x8b4e('0x2b')](db[_0x8b4e('0x2c')]['rawAttributes'],function(_0x3f702e){return{'name':_0x3f702e['fieldName'],'type':_0x3f702e[_0x8b4e('0x2d')][_0x8b4e('0x2e')]};});_0x1b6d4e[_0x8b4e('0x2f')]=_[_0x8b4e('0x2b')](_0x24f55f,_0x8b4e('0x30'));_0x1b6d4e[_0x8b4e('0x31')]=_['keys'](_0xf1e02[_0x8b4e('0x31')]);_0x1b6d4e['filters']=_[_0x8b4e('0x32')](_0x1b6d4e[_0x8b4e('0x2f')],_0x1b6d4e[_0x8b4e('0x31')]);_0x664bb7['attributes']=_[_0x8b4e('0x32')](_0x1b6d4e[_0x8b4e('0x2f')],qs['fields'](_0xf1e02[_0x8b4e('0x31')]['fields']));_0x664bb7[_0x8b4e('0x33')]=_0x664bb7[_0x8b4e('0x33')]['length']?_0x664bb7[_0x8b4e('0x33')]:_0x1b6d4e['model'];if(!_0xf1e02[_0x8b4e('0x31')][_0x8b4e('0x34')]('nolimit')){_0x664bb7[_0x8b4e('0x1f')]=qs['limit'](_0xf1e02[_0x8b4e('0x31')]['limit']);_0x664bb7[_0x8b4e('0x1d')]=qs[_0x8b4e('0x1d')](_0xf1e02[_0x8b4e('0x31')]['offset']);}_0x664bb7[_0x8b4e('0x35')]=qs[_0x8b4e('0x36')](_0xf1e02['query'][_0x8b4e('0x36')]);_0x664bb7['where']=qs[_0x8b4e('0x37')](_[_0x8b4e('0x38')](_0xf1e02['query'],_0x1b6d4e[_0x8b4e('0x37')]),_0x24f55f);if(_0xf1e02[_0x8b4e('0x31')]['filter']){_0x664bb7['where']=_[_0x8b4e('0x39')](_0x664bb7['where'],{'$or':_[_0x8b4e('0x2b')](_0x24f55f,function(_0x39f802){if(_0x39f802[_0x8b4e('0x2d')]!==_0x8b4e('0x3a')){var _0x3d3200={};_0x3d3200[_0x39f802[_0x8b4e('0x30')]]={'$like':'%'+_0xf1e02[_0x8b4e('0x31')][_0x8b4e('0x3b')]+'%'};return _0x3d3200;}})});}_0x664bb7=_[_0x8b4e('0x39')]({},_0x664bb7,_0xf1e02[_0x8b4e('0x3c')]);var _0x5a149={'where':_0x664bb7['where']};return db[_0x8b4e('0x2c')]['count'](_0x5a149)[_0x8b4e('0x26')](function(_0x22aaba){_0x2b6b59[_0x8b4e('0x20')]=_0x22aaba;if(_0xf1e02[_0x8b4e('0x31')]['includeAll']){_0x664bb7[_0x8b4e('0x3d')]=[{'all':!![]}];}return db[_0x8b4e('0x2c')]['findAll'](_0x664bb7);})[_0x8b4e('0x26')](function(_0x39939c){_0x2b6b59[_0x8b4e('0x3e')]=_0x39939c;return _0x2b6b59;})[_0x8b4e('0x26')](respondWithFilteredResult(_0x17946e,_0x664bb7))[_0x8b4e('0x3f')](handleError(_0x17946e,null));};exports['show']=function(_0x28210e,_0x3d6f45){var _0x2c3ce7={'raw':!![],'where':{'id':_0x28210e['params']['id']}},_0x197076={};_0x197076[_0x8b4e('0x2f')]=_[_0x8b4e('0x40')](db[_0x8b4e('0x2c')]['rawAttributes']);_0x197076[_0x8b4e('0x31')]=_[_0x8b4e('0x40')](_0x28210e[_0x8b4e('0x31')]);_0x197076['filters']=_[_0x8b4e('0x32')](_0x197076[_0x8b4e('0x2f')],_0x197076['query']);_0x2c3ce7['attributes']=_[_0x8b4e('0x32')](_0x197076['model'],qs[_0x8b4e('0x41')](_0x28210e['query']['fields']));_0x2c3ce7[_0x8b4e('0x33')]=_0x2c3ce7[_0x8b4e('0x33')][_0x8b4e('0x42')]?_0x2c3ce7[_0x8b4e('0x33')]:_0x197076[_0x8b4e('0x2f')];if(_0x28210e[_0x8b4e('0x31')]['includeAll']){_0x2c3ce7[_0x8b4e('0x3d')]=[{'all':!![]}];}_0x2c3ce7=_['merge']({},_0x2c3ce7,_0x28210e[_0x8b4e('0x3c')]);return db['SmsApplication'][_0x8b4e('0x43')](_0x2c3ce7)['then'](handleEntityNotFound(_0x3d6f45,null))[_0x8b4e('0x26')](respondWithResult(_0x3d6f45,null))[_0x8b4e('0x3f')](handleError(_0x3d6f45,null));};exports['create']=function(_0x2fa9f3,_0x589e39){return db['SmsApplication'][_0x8b4e('0x44')](_0x2fa9f3[_0x8b4e('0x45')],{})['then'](respondWithResult(_0x589e39,0xc9))[_0x8b4e('0x3f')](handleError(_0x589e39,null));};exports[_0x8b4e('0x25')]=function(_0x4c32fe,_0x4f4e66){if(_0x4c32fe[_0x8b4e('0x45')]['id']){delete _0x4c32fe[_0x8b4e('0x45')]['id'];}return db[_0x8b4e('0x2c')]['find']({'where':{'id':_0x4c32fe['params']['id']}})[_0x8b4e('0x26')](handleEntityNotFound(_0x4f4e66,null))[_0x8b4e('0x26')](saveUpdates(_0x4c32fe[_0x8b4e('0x45')],null))[_0x8b4e('0x26')](respondWithResult(_0x4f4e66,null))[_0x8b4e('0x3f')](handleError(_0x4f4e66,null));};exports['destroy']=function(_0x3b8568,_0x74e0a){return db[_0x8b4e('0x2c')][_0x8b4e('0x43')]({'where':{'id':_0x3b8568[_0x8b4e('0x46')]['id']}})['then'](handleEntityNotFound(_0x74e0a,null))['then'](removeEntity(_0x74e0a,null))[_0x8b4e('0x3f')](handleError(_0x74e0a,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 569188f..b24afb7 100644 --- a/server/api/smsApplication/smsApplication.model.js +++ b/server/api/smsApplication/smsApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xad0f=['bluebird','../../config/environment','./smsApplication.attributes','exports','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment'];(function(_0x1d7510,_0x469676){var _0x446171=function(_0x3f8a1e){while(--_0x3f8a1e){_0x1d7510['push'](_0x1d7510['shift']());}};_0x446171(++_0x469676);}(_0xad0f,0xa1));var _0xfad0=function(_0x16dbfd,_0x2f9431){_0x16dbfd=_0x16dbfd-0x0;var _0x382254=_0xad0f[_0x16dbfd];return _0x382254;};'use strict';var _=require(_0xfad0('0x0'));var util=require(_0xfad0('0x1'));var logger=require('../../config/logger')(_0xfad0('0x2'));var moment=require(_0xfad0('0x3'));var BPromise=require(_0xfad0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xfad0('0x5'));var attributes=require(_0xfad0('0x6'));module[_0xfad0('0x7')]=function(_0x503b53,_0x38a18c){return _0x503b53['define']('SmsApplication',attributes,{'tableName':_0xfad0('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfad0('0x9'),'collate':_0xfad0('0xa')});}; \ No newline at end of file +var _0x02f4=['define','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports'];(function(_0x38f6b4,_0x217a0c){var _0x3777da=function(_0x4faa64){while(--_0x4faa64){_0x38f6b4['push'](_0x38f6b4['shift']());}};_0x3777da(++_0x217a0c);}(_0x02f4,0x181));var _0x402f=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x02f4[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x402f('0x0'));var util=require(_0x402f('0x1'));var logger=require('../../config/logger')(_0x402f('0x2'));var moment=require(_0x402f('0x3'));var BPromise=require(_0x402f('0x4'));var rp=require(_0x402f('0x5'));var fs=require('fs');var path=require(_0x402f('0x6'));var rimraf=require(_0x402f('0x7'));var config=require(_0x402f('0x8'));var attributes=require(_0x402f('0x9'));module[_0x402f('0xa')]=function(_0x8275b7,_0x2e344e){return _0x8275b7[_0x402f('0xb')]('SmsApplication',attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 6f32050..c44f021 100644 --- a/server/api/smsApplication/smsApplication.rpc.js +++ b/server/api/smsApplication/smsApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x04d5=['stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5d3e1a,_0xea02fa){var _0x8e2289=function(_0x48bd4d){while(--_0x48bd4d){_0x5d3e1a['push'](_0x5d3e1a['shift']());}};_0x8e2289(++_0xea02fa);}(_0x04d5,0xe1));var _0x504d=function(_0x43fcff,_0x3c1f86){_0x43fcff=_0x43fcff-0x0;var _0x476841=_0x04d5[_0x43fcff];return _0x476841;};'use strict';var _=require(_0x504d('0x0'));var util=require(_0x504d('0x1'));var moment=require('moment');var BPromise=require(_0x504d('0x2'));var rs=require(_0x504d('0x3'));var fs=require('fs');var Redis=require(_0x504d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x504d('0x5'));var logger=require(_0x504d('0x6'))(_0x504d('0x7'));var config=require(_0x504d('0x8'));var jayson=require(_0x504d('0x9'));var client=jayson['client'][_0x504d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x278262,_0x87bf04,_0x49cb76){return new BPromise(function(_0x5712a7,_0x16da4f){return client[_0x504d('0xb')](_0x278262,_0x49cb76)[_0x504d('0xc')](function(_0x48e0e6){logger[_0x504d('0xd')](_0x504d('0xe'),_0x87bf04,_0x504d('0xf'));logger[_0x504d('0x10')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x87bf04,_0x504d('0xf'),JSON[_0x504d('0x11')](_0x48e0e6));if(_0x48e0e6[_0x504d('0x12')]){if(_0x48e0e6[_0x504d('0x12')][_0x504d('0x13')]===0x1f4){logger[_0x504d('0x12')](_0x504d('0xe'),_0x87bf04,_0x48e0e6['error']['message']);return _0x16da4f(_0x48e0e6[_0x504d('0x12')][_0x504d('0x14')]);}logger[_0x504d('0x12')](_0x504d('0xe'),_0x87bf04,_0x48e0e6[_0x504d('0x12')][_0x504d('0x14')]);return _0x5712a7(_0x48e0e6['error'][_0x504d('0x14')]);}else{logger['info'](_0x504d('0xe'),_0x87bf04,_0x504d('0xf'));_0x5712a7(_0x48e0e6['result'][_0x504d('0x14')]);}})[_0x504d('0x15')](function(_0x1e3722){logger[_0x504d('0x12')](_0x504d('0xe'),_0x87bf04,_0x1e3722);_0x16da4f(_0x1e3722);});});} \ No newline at end of file +var _0x761c=['../../config/utils','rpc','jayson/promise','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x761c,0x18a));var _0xc761=function(_0x1a7a4b,_0x13dee8){_0x1a7a4b=_0x1a7a4b-0x0;var _0x1ac9e0=_0x761c[_0x1a7a4b];return _0x1ac9e0;};'use strict';var _=require(_0xc761('0x0'));var util=require('util');var moment=require(_0xc761('0x1'));var BPromise=require(_0xc761('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc761('0x3'));var db=require(_0xc761('0x4'))['db'];var utils=require(_0xc761('0x5'));var logger=require('../../config/logger')(_0xc761('0x6'));var config=require('../../config/environment');var jayson=require(_0xc761('0x7'));var client=jayson[_0xc761('0x8')][_0xc761('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xafa0bd,_0x2f4f2e,_0x444747){return new BPromise(function(_0x46e882,_0x507772){return client[_0xc761('0xa')](_0xafa0bd,_0x444747)[_0xc761('0xb')](function(_0x175c1c){logger[_0xc761('0xc')](_0xc761('0xd'),_0x2f4f2e,_0xc761('0xe'));logger[_0xc761('0xf')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x2f4f2e,'request\x20sent',JSON[_0xc761('0x10')](_0x175c1c));if(_0x175c1c[_0xc761('0x11')]){if(_0x175c1c['error']['code']===0x1f4){logger[_0xc761('0x11')]('SmsApplication,\x20%s,\x20%s',_0x2f4f2e,_0x175c1c[_0xc761('0x11')]['message']);return _0x507772(_0x175c1c[_0xc761('0x11')]['message']);}logger[_0xc761('0x11')](_0xc761('0xd'),_0x2f4f2e,_0x175c1c[_0xc761('0x11')][_0xc761('0x12')]);return _0x46e882(_0x175c1c[_0xc761('0x11')][_0xc761('0x12')]);}else{logger[_0xc761('0xc')]('SmsApplication,\x20%s,\x20%s',_0x2f4f2e,'request\x20sent');_0x46e882(_0x175c1c[_0xc761('0x13')][_0xc761('0x12')]);}})[_0xc761('0x14')](function(_0x597085){logger[_0xc761('0x11')](_0xc761('0xd'),_0x2f4f2e,_0x597085);_0x507772(_0x597085);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 971e8db..2b4193d 100644 --- a/server/api/smsInteraction/index.js +++ b/server/api/smsInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['sms','smsinteraction:addtags','addTags','put','/:id','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked'];(function(_0x3fa77c,_0x284952){var _0x57d3e7=function(_0x57936b){while(--_0x57936b){_0x3fa77c['push'](_0x3fa77c['shift']());}};_0x57d3e7(++_0x284952);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0x9')](_0x0baf('0xe'),auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x9')](_0x0baf('0x10'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x11')]);router[_0x0baf('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0baf('0x12')](_0x0baf('0xe'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x13')]);router['post'](_0x0baf('0x14'),auth['isAuthenticated'](),interaction[_0x0baf('0x15')](_0x0baf('0x16'),_0x0baf('0x17')),controller[_0x0baf('0x18')]);router[_0x0baf('0x19')](_0x0baf('0x1a'),auth['isAuthenticated'](),interaction['tracked'](_0x0baf('0x16'),_0x0baf('0x1b')),controller[_0x0baf('0x1c')]);router[_0x0baf('0x1d')](_0x0baf('0x1a'),auth[_0x0baf('0xa')](),interaction['tracked'](_0x0baf('0x16'),_0x0baf('0x1e')),controller[_0x0baf('0x1f')]);router[_0x0baf('0x1d')](_0x0baf('0x14'),auth[_0x0baf('0xa')](),controller['removeTags']);module['exports']=router; \ No newline at end of file +var _0x3c81=['express','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','addTags','tracked','sms','update','delete','smsinteraction:destroy','destroy','/:id/tags','exports','multer','util','connect-timeout'];(function(_0x2caefb,_0x2e1f06){var _0x1b3613=function(_0x4541b6){while(--_0x4541b6){_0x2caefb['push'](_0x2caefb['shift']());}};_0x1b3613(++_0x2e1f06);}(_0x3c81,0x102));var _0x13c8=function(_0x3eb1b9,_0x2ed168){_0x3eb1b9=_0x3eb1b9-0x0;var _0x105a14=_0x3c81[_0x3eb1b9];return _0x105a14;};'use strict';var multer=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var path=require('path');var timeout=require(_0x13c8('0x2'));var express=require(_0x13c8('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x13c8('0x4'));var controller=require(_0x13c8('0x5'));router[_0x13c8('0x6')]('/',auth[_0x13c8('0x7')](),controller[_0x13c8('0x8')]);router[_0x13c8('0x6')](_0x13c8('0x9'),auth['isAuthenticated'](),controller[_0x13c8('0xa')]);router['get'](_0x13c8('0xb'),auth[_0x13c8('0x7')](),controller[_0x13c8('0xc')]);router[_0x13c8('0x6')](_0x13c8('0xd'),auth[_0x13c8('0x7')](),controller[_0x13c8('0xe')]);router[_0x13c8('0x6')](_0x13c8('0xf'),auth[_0x13c8('0x7')](),controller[_0x13c8('0x10')]);router[_0x13c8('0x11')]('/',auth[_0x13c8('0x7')](),controller[_0x13c8('0x12')]);router['post'](_0x13c8('0xd'),auth[_0x13c8('0x7')](),controller[_0x13c8('0x13')]);router[_0x13c8('0x11')]('/:id/tags',auth[_0x13c8('0x7')](),interaction['tracked']('sms','smsinteraction:addtags'),controller[_0x13c8('0x14')]);router['put'](_0x13c8('0xb'),auth[_0x13c8('0x7')](),interaction[_0x13c8('0x15')](_0x13c8('0x16'),'smsinteraction:update'),controller[_0x13c8('0x17')]);router[_0x13c8('0x18')](_0x13c8('0xb'),auth[_0x13c8('0x7')](),interaction[_0x13c8('0x15')](_0x13c8('0x16'),_0x13c8('0x19')),controller[_0x13c8('0x1a')]);router[_0x13c8('0x18')](_0x13c8('0x1b'),auth[_0x13c8('0x7')](),controller['removeTags']);module[_0x13c8('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index edb86ab..4bb0738 100644 --- a/server/api/smsInteraction/smsInteraction.attributes.js +++ b/server/api/smsInteraction/smsInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3a15=['DATE','STRING','out','BOOLEAN','INTEGER','sequelize','exports'];(function(_0xcae5ee,_0xcbc7a){var _0x3402db=function(_0x794249){while(--_0x794249){_0xcae5ee['push'](_0xcae5ee['shift']());}};_0x3402db(++_0xcbc7a);}(_0x3a15,0xde));var _0x53a1=function(_0x347f98,_0x23b964){_0x347f98=_0x347f98-0x0;var _0x5c8bfc=_0x3a15[_0x347f98];return _0x5c8bfc;};'use strict';var Sequelize=require(_0x53a1('0x0'));var moment=require('moment');module[_0x53a1('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x53a1('0x2')]},'disposition':{'type':Sequelize[_0x53a1('0x3')]},'secondDisposition':{'type':Sequelize[_0x53a1('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x53a1('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x53a1('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x53a1('0x4')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x53a1('0x5')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x53a1('0x6')]}}; \ No newline at end of file +var _0x4f08=['STRING','out','ENUM','INTEGER','sequelize','moment','BOOLEAN','DATE'];(function(_0x2e2cd7,_0x9a3d16){var _0x397801=function(_0x1e15e0){while(--_0x1e15e0){_0x2e2cd7['push'](_0x2e2cd7['shift']());}};_0x397801(++_0x9a3d16);}(_0x4f08,0x194));var _0x84f0=function(_0x521c68,_0x292e36){_0x521c68=_0x521c68-0x0;var _0x5f6b9f=_0x4f08[_0x521c68];return _0x5f6b9f;};'use strict';var Sequelize=require(_0x84f0('0x0'));var moment=require(_0x84f0('0x1'));module['exports']={'closed':{'type':Sequelize[_0x84f0('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x84f0('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x84f0('0x4')]},'thirdDisposition':{'type':Sequelize[_0x84f0('0x4')]},'note':{'type':Sequelize[_0x84f0('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x84f0('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x84f0('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x84f0('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x84f0('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x84f0('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x84f0('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 3731734..9b8c435 100644 --- a/server/api/smsInteraction/smsInteraction.controller.js +++ b/server/api/smsInteraction/smsInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb018=['../../mysqldb','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','name','SmsInteraction','fieldName','type','key','getOptions','findAll','sms','query','user','catch','show','params','model','keys','rawAttributes','filters','attributes','intersection','fields','length','includeAll','include','merge','options','create','body','find','describe','addMessage','SmsMessage','ids','omit','findOne','hasOwnProperty','sort','where','pick','SmsInteractionId','map','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread','Tag','emit','smsInteractionTags:save','removeTags','download','unix','toString','join','root','server','tmp','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','direction','secret','Account','Owner','get','mkdirSync','createdAt','closed','closedAt','disposition','Messages','out','System','lastName','read','value','views','Sms','createPdfFromHTML','log','err','rimraf','zip-dir','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/environment'];(function(_0x27d96c,_0x3419be){var _0x33ef6d=function(_0x58654d){while(--_0x58654d){_0x27d96c['push'](_0x27d96c['shift']());}};_0x33ef6d(++_0x3419be);}(_0xb018,0x6b));var _0x8b01=function(_0x223d90,_0x3d10c4){_0x223d90=_0x223d90-0x0;var _0x1cc144=_0xb018[_0x223d90];return _0x1cc144;};'use strict';var rimraf=require(_0x8b01('0x0'));var zipdir=require(_0x8b01('0x1'));var moment=require('moment');var BPromise=require(_0x8b01('0x2'));var util=require(_0x8b01('0x3'));var path=require(_0x8b01('0x4'));var ejs=require(_0x8b01('0x5'));var fs=require('fs');var _=require(_0x8b01('0x6'));var Redis=require(_0x8b01('0x7'));var interaction=require(_0x8b01('0x8'));var qs=require(_0x8b01('0x9'));var pdf=require(_0x8b01('0xa'));var logger=require('../../config/logger')('api');var config=require(_0x8b01('0xb'));var db=require(_0x8b01('0xc'))['db'];config[_0x8b01('0xd')]=_[_0x8b01('0xe')](config[_0x8b01('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x8b01('0xf'))(new Redis(config[_0x8b01('0xd')]));require(_0x8b01('0x10'))[_0x8b01('0x11')](socket);function respondWithStatusCode(_0x106719,_0xec0f68){_0xec0f68=_0xec0f68||0xcc;return function(_0x1d5014){if(_0x1d5014){return _0x106719[_0x8b01('0x12')](_0xec0f68);}return _0x106719['status'](_0xec0f68)[_0x8b01('0x13')]();};}function respondWithResult(_0x23aca9,_0x412c32){_0x412c32=_0x412c32||0xc8;return function(_0x35164e){if(_0x35164e){return _0x23aca9[_0x8b01('0x14')](_0x412c32)[_0x8b01('0x15')](_0x35164e);}};}function respondWithFilteredResult(_0x1c9423,_0x1f1fc6){return function(_0x20bf58){if(_0x20bf58){var _0x258bbb=typeof _0x1f1fc6[_0x8b01('0x16')]===_0x8b01('0x17')&&typeof _0x1f1fc6[_0x8b01('0x18')]===_0x8b01('0x17');var _0x5e398a=_0x20bf58[_0x8b01('0x19')];var _0x3eb107=_0x258bbb?0x0:_0x1f1fc6['offset'];var _0x1fbb50=_0x258bbb?_0x20bf58[_0x8b01('0x19')]:_0x1f1fc6[_0x8b01('0x16')]+_0x1f1fc6['limit'];var _0x1b2f67;if(_0x1fbb50>=_0x5e398a){_0x1fbb50=_0x5e398a;_0x1b2f67=0xc8;}else{_0x1b2f67=0xce;}_0x1c9423[_0x8b01('0x14')](_0x1b2f67);return _0x1c9423[_0x8b01('0x1a')](_0x8b01('0x1b'),_0x3eb107+'-'+_0x1fbb50+'/'+_0x5e398a)[_0x8b01('0x15')](_0x20bf58);}return null;};}function saveUpdates(_0x138987){return function(_0x5428ac){if(_0x5428ac){return _0x5428ac[_0x8b01('0x1c')](_0x138987)[_0x8b01('0x1d')](function(_0x44ee59){return _0x44ee59;});}return null;};}function removeEntity(_0x25f0f2){return function(_0x3c9604){if(_0x3c9604){return _0x3c9604[_0x8b01('0x1e')]()[_0x8b01('0x1d')](function(){_0x25f0f2[_0x8b01('0x14')](0xcc)[_0x8b01('0x13')]();});}};}function handleEntityNotFound(_0x252627){return function(_0x28cca3){if(!_0x28cca3){_0x252627[_0x8b01('0x12')](0x194);}return _0x28cca3;};}function handleError(_0x237ecd,_0x119069){_0x119069=_0x119069||0x1f4;return function(_0x243a07){logger['error'](_0x243a07['stack']);if(_0x243a07[_0x8b01('0x1f')]){delete _0x243a07[_0x8b01('0x1f')];}_0x237ecd[_0x8b01('0x14')](_0x119069)['send'](_0x243a07);};}exports['index']=function(_0xe373d4,_0x31d750){var _0x1dbfd5={};var _0x298e19=_['map'](db[_0x8b01('0x20')]['rawAttributes'],function(_0x5a7c8e){return{'name':_0x5a7c8e[_0x8b01('0x21')],'type':_0x5a7c8e[_0x8b01('0x22')][_0x8b01('0x23')]};});_0x1dbfd5=qs[_0x8b01('0x24')](_0x298e19,_0xe373d4);return interaction[_0x8b01('0x25')](_0x8b01('0x26'),_0xe373d4[_0x8b01('0x27')],_0xe373d4[_0x8b01('0x28')],_0x1dbfd5,_0x298e19)[_0x8b01('0x1d')](respondWithFilteredResult(_0x31d750,_0x1dbfd5))[_0x8b01('0x29')](handleError(_0x31d750,null));};exports[_0x8b01('0x2a')]=function(_0x1fcc17,_0x14216e){var _0x2aad64={'raw':![],'where':{'id':_0x1fcc17[_0x8b01('0x2b')]['id']}},_0x4511b6={};_0x4511b6[_0x8b01('0x2c')]=_[_0x8b01('0x2d')](db['SmsInteraction'][_0x8b01('0x2e')]);_0x4511b6[_0x8b01('0x27')]=_[_0x8b01('0x2d')](_0x1fcc17['query']);_0x4511b6[_0x8b01('0x2f')]=_['intersection'](_0x4511b6[_0x8b01('0x2c')],_0x4511b6['query']);_0x2aad64[_0x8b01('0x30')]=_[_0x8b01('0x31')](_0x4511b6['model'],qs[_0x8b01('0x32')](_0x1fcc17[_0x8b01('0x27')][_0x8b01('0x32')]));_0x2aad64['attributes']=_0x2aad64[_0x8b01('0x30')][_0x8b01('0x33')]?_0x2aad64['attributes']:_0x4511b6[_0x8b01('0x2c')];if(_0x1fcc17[_0x8b01('0x27')][_0x8b01('0x34')]){_0x2aad64[_0x8b01('0x35')]=[{'all':!![]}];}_0x2aad64=_[_0x8b01('0x36')]({},_0x2aad64,_0x1fcc17[_0x8b01('0x37')]);return db[_0x8b01('0x20')]['find'](_0x2aad64)[_0x8b01('0x1d')](handleEntityNotFound(_0x14216e,null))['then'](respondWithResult(_0x14216e,null))[_0x8b01('0x29')](handleError(_0x14216e,null));};exports[_0x8b01('0x38')]=function(_0x1701c6,_0xb01f80){return db['SmsInteraction'][_0x8b01('0x38')](_0x1701c6['body'],{})[_0x8b01('0x1d')](respondWithResult(_0xb01f80,0xc9))['catch'](handleError(_0xb01f80,null));};exports['update']=function(_0x43f4c3,_0x3a7a78){if(_0x43f4c3[_0x8b01('0x39')]['id']){delete _0x43f4c3[_0x8b01('0x39')]['id'];}return db[_0x8b01('0x20')][_0x8b01('0x3a')]({'where':{'id':_0x43f4c3['params']['id']}})[_0x8b01('0x1d')](handleEntityNotFound(_0x3a7a78,null))[_0x8b01('0x1d')](saveUpdates(_0x43f4c3[_0x8b01('0x39')],null))[_0x8b01('0x1d')](respondWithResult(_0x3a7a78,null))[_0x8b01('0x29')](handleError(_0x3a7a78,null));};exports[_0x8b01('0x1e')]=function(_0x367bfb,_0x5d4838){return db[_0x8b01('0x20')]['find']({'where':{'id':_0x367bfb[_0x8b01('0x2b')]['id']}})[_0x8b01('0x1d')](handleEntityNotFound(_0x5d4838,null))['then'](removeEntity(_0x5d4838,null))[_0x8b01('0x29')](handleError(_0x5d4838,null));};exports[_0x8b01('0x3b')]=function(_0x164df9,_0x2df803){return db[_0x8b01('0x20')][_0x8b01('0x3b')]()[_0x8b01('0x1d')](respondWithResult(_0x2df803,null))[_0x8b01('0x29')](handleError(_0x2df803,null));};exports[_0x8b01('0x3c')]=function(_0x2f5ccd,_0x137661){return db[_0x8b01('0x3d')][_0x8b01('0x3a')]({'where':{'id':_0x2f5ccd['params']['id']}})[_0x8b01('0x1d')](handleEntityNotFound(_0x137661,null))[_0x8b01('0x1d')](function(_0x3c4473){if(_0x3c4473){return _0x3c4473['addMessage'](_0x2f5ccd[_0x8b01('0x39')][_0x8b01('0x3e')],_[_0x8b01('0x3f')](_0x2f5ccd['body'],[_0x8b01('0x3e'),'id'])||{});}})['then'](respondWithResult(_0x137661,null))['catch'](handleError(_0x137661,null));};exports['getMessages']=function(_0x2fb6d5,_0x236d20){var _0xc88035={'raw':![],'where':{}};var _0x113583={};var _0x487ba3={'count':0x0,'rows':[]};return db['SmsInteraction'][_0x8b01('0x40')]({'where':{'id':_0x2fb6d5[_0x8b01('0x2b')]['id']}})[_0x8b01('0x1d')](handleEntityNotFound(_0x236d20,null))['then'](function(_0x4a4590){if(_0x4a4590){_0x113583[_0x8b01('0x2c')]=_[_0x8b01('0x2d')](db[_0x8b01('0x3d')]['rawAttributes']);_0x113583[_0x8b01('0x27')]=_['keys'](_0x2fb6d5[_0x8b01('0x27')]);_0x113583[_0x8b01('0x2f')]=_[_0x8b01('0x31')](_0x113583['model'],_0x113583[_0x8b01('0x27')]);_0xc88035[_0x8b01('0x30')]=_[_0x8b01('0x31')](_0x113583[_0x8b01('0x2c')],qs[_0x8b01('0x32')](_0x2fb6d5[_0x8b01('0x27')][_0x8b01('0x32')]));_0xc88035[_0x8b01('0x30')]=_0xc88035[_0x8b01('0x30')][_0x8b01('0x33')]?_0xc88035['attributes']:_0x113583['model'];if(!_0x2fb6d5[_0x8b01('0x27')][_0x8b01('0x41')]('nolimit')){_0xc88035[_0x8b01('0x18')]=qs['limit'](_0x2fb6d5[_0x8b01('0x27')][_0x8b01('0x18')]);_0xc88035['offset']=qs[_0x8b01('0x16')](_0x2fb6d5['query'][_0x8b01('0x16')]);}_0xc88035['order']=qs[_0x8b01('0x42')](_0x2fb6d5['query']['sort']);_0xc88035[_0x8b01('0x43')]=qs[_0x8b01('0x2f')](_[_0x8b01('0x44')](_0x2fb6d5['query'],_0x113583['filters']));_0xc88035[_0x8b01('0x43')][_0x8b01('0x45')]=_0x4a4590['id'];if(_0x2fb6d5[_0x8b01('0x27')]['filter']){_0xc88035[_0x8b01('0x43')]=_['merge'](_0xc88035[_0x8b01('0x43')],{'$or':_[_0x8b01('0x46')](_0xc88035[_0x8b01('0x30')],function(_0x4f1b7b){var _0x12b590={};_0x12b590[_0x4f1b7b]={'$like':'%'+_0x2fb6d5['query'][_0x8b01('0x47')]+'%'};return _0x12b590;})});}if(_0x2fb6d5[_0x8b01('0x27')][_0x8b01('0x48')]){var _0x4f73c2=_0x2fb6d5[_0x8b01('0x27')][_0x8b01('0x48')][_0x8b01('0x49')](',');var _0x4f7f78={};_0x4f7f78[_0x4f73c2[0x0]]={'$gte':moment(_0x4f73c2[0x1])[_0x8b01('0x4a')](_0x8b01('0x4b'))};_0xc88035[_0x8b01('0x43')]=_[_0x8b01('0x36')](_0xc88035[_0x8b01('0x43')],_0x4f7f78);}_0xc88035=_['merge']({},_0xc88035,_0x2fb6d5[_0x8b01('0x37')]);return db[_0x8b01('0x3d')]['count']({'where':_0xc88035[_0x8b01('0x43')]})[_0x8b01('0x1d')](function(_0x43a9b0){_0x487ba3['count']=_0x43a9b0;if(_0x2fb6d5[_0x8b01('0x27')][_0x8b01('0x34')]){_0xc88035[_0x8b01('0x35')]=[{'all':!![]}];}return db[_0x8b01('0x3d')][_0x8b01('0x25')](_0xc88035);})[_0x8b01('0x1d')](function(_0x3bc464){_0x487ba3[_0x8b01('0x4c')]=_0x3bc464;return _0x487ba3;});}})[_0x8b01('0x1d')](respondWithFilteredResult(_0x236d20,_0xc88035))['catch'](handleError(_0x236d20,null));};exports[_0x8b01('0x4d')]=function(_0x5a84fc,_0x26b7cd){return db[_0x8b01('0x20')][_0x8b01('0x3a')]({'where':{'id':_0x5a84fc[_0x8b01('0x2b')]['id']}})['then'](handleEntityNotFound(_0x26b7cd,null))[_0x8b01('0x1d')](function(_0x1a45f0){if(_0x1a45f0){return _0x1a45f0[_0x8b01('0x4e')](_0x5a84fc[_0x8b01('0x39')][_0x8b01('0x3e')],_['omit'](_0x5a84fc[_0x8b01('0x39')],[_0x8b01('0x3e'),'id'])||{})[_0x8b01('0x4f')](function(){return db[_0x8b01('0x50')][_0x8b01('0x25')]({'attributes':['id',_0x8b01('0x1f'),'color'],'where':{'id':_0x5a84fc[_0x8b01('0x39')][_0x8b01('0x3e')]}});})[_0x8b01('0x1d')](function(_0x5b389a){socket[_0x8b01('0x51')](_0x8b01('0x52'),{'id':Number(_0x5a84fc[_0x8b01('0x2b')]['id']),'tags':_0x5b389a||[]});return{'id':Number(_0x5a84fc[_0x8b01('0x2b')]['id']),'tags':_0x5b389a||[]};});}})[_0x8b01('0x1d')](respondWithResult(_0x26b7cd,null))[_0x8b01('0x29')](handleError(_0x26b7cd,null));};exports[_0x8b01('0x53')]=function(_0x226b54,_0x50f5af){return db[_0x8b01('0x20')][_0x8b01('0x3a')]({'where':{'id':_0x226b54[_0x8b01('0x2b')]['id']}})[_0x8b01('0x1d')](handleEntityNotFound(_0x50f5af,null))[_0x8b01('0x1d')](function(_0x54600c){if(_0x54600c){return _0x54600c['removeTags'](_0x226b54[_0x8b01('0x27')][_0x8b01('0x3e')]);}})[_0x8b01('0x1d')](respondWithStatusCode(_0x50f5af,null))[_0x8b01('0x29')](handleError(_0x50f5af,null));};exports[_0x8b01('0x54')]=function(_0xb9e71a,_0x1c989a){var _0x252135=moment()[_0x8b01('0x55')]()[_0x8b01('0x56')]();var _0x113416=path[_0x8b01('0x57')](config[_0x8b01('0x58')],_0x8b01('0x59'),'files',_0x8b01('0x5a'));var _0x13b838=path[_0x8b01('0x57')](_0x113416,_0x252135);var _0x4422c0=util[_0x8b01('0x4a')](_0x8b01('0x5b'),_0xb9e71a['params']['id'],_0x252135);var _0x4d9ee0=path[_0x8b01('0x57')](_0x113416,_0x4422c0);var _0x3b52ef=[];_0x3b52ef[_0x8b01('0x5c')]({'model':db[_0x8b01('0x5d')],'as':_0x8b01('0x5d'),'attributes':['id',_0x8b01('0x5e')],'raw':!![]});_0x3b52ef[_0x8b01('0x5c')]({'model':db[_0x8b01('0x5f')],'as':_0x8b01('0x60'),'attributes':['id',_0x8b01('0x61'),'lastName'],'raw':!![]});var _0x3f2183=[{'model':db[_0x8b01('0x3d')],'as':'Messages','attributes':['id','body','createdAt',_0x8b01('0x62'),_0x8b01('0x63'),'read'],'include':_0x3b52ef}];_0x3f2183[_0x8b01('0x5c')]({'model':db['SmsAccount'],'as':_0x8b01('0x64'),'attributes':['id','name']});_0x3f2183[_0x8b01('0x5c')]({'model':db['User'],'as':_0x8b01('0x65'),'attributes':['id',_0x8b01('0x5e')]});return db[_0x8b01('0x20')][_0x8b01('0x3a')]({'where':{'id':_0xb9e71a[_0x8b01('0x2b')]['id']},'include':_0x3f2183})['then'](handleEntityNotFound(_0x1c989a,null))[_0x8b01('0x1d')](function(_0x3a8052){if(_0x3a8052){var _0x7bcae7=_0x3a8052[_0x8b01('0x66')]({'plain':!![]});fs[_0x8b01('0x67')](_0x13b838);var _0x483416={'channel':'Sms','account':_0x7bcae7[_0x8b01('0x64')][_0x8b01('0x1f')],'agent':_0x7bcae7[_0x8b01('0x65')]?_0x7bcae7['Owner'][_0x8b01('0x5e')]:'N.A.','createdAt':moment(_0x7bcae7[_0x8b01('0x68')])[_0x8b01('0x4a')]('YYYY-MM-DD\x20HH:mm:ss')[_0x8b01('0x56')](),'closedAt':_0x7bcae7[_0x8b01('0x69')]?moment(_0x7bcae7[_0x8b01('0x6a')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x7bcae7[_0x8b01('0x6b')],'messages':_(_0x7bcae7[_0x8b01('0x6c')])[_0x8b01('0x47')]({'secret':![]})['map'](function(_0x4d5d9f){return{'date':moment(_0x4d5d9f[_0x8b01('0x68')])['format'](_0x8b01('0x4b'))['toString'](),'sender':_0x4d5d9f['direction']===_0x8b01('0x6d')?_0x4d5d9f[_0x8b01('0x5d')]?_0x4d5d9f[_0x8b01('0x5d')][_0x8b01('0x5e')]:_0x8b01('0x6e'):_0x4d5d9f[_0x8b01('0x60')]['firstName']+(_0x4d5d9f[_0x8b01('0x60')][_0x8b01('0x6f')]?'\x20'+_0x4d5d9f['Contact'][_0x8b01('0x6f')]:''),'body':_0x4d5d9f[_0x8b01('0x39')],'direction':_0x4d5d9f[_0x8b01('0x62')]===_0x8b01('0x6d')?'A':'C','secret':_0x4d5d9f['secret'],'read':_0x4d5d9f[_0x8b01('0x70')]};})[_0x8b01('0x71')]()};return ejs['renderFile'](path[_0x8b01('0x57')](config[_0x8b01('0x58')],'server',_0x8b01('0x72'),'downloadInteraction.ejs'),{'interaction':_0x483416})[_0x8b01('0x1d')](function(_0x8bf610){var _0x5d6fde=path[_0x8b01('0x57')](_0x13b838,'transcript-'+_0x7bcae7['id']+'-'+_0x252135+'.pdf');var _0x658df3={'path':_0x5d6fde,'channel':_0x8b01('0x73'),'interactionId':_0x7bcae7['id']};return pdf[_0x8b01('0x74')](_0x8bf610,_0x658df3);})['then'](function(){return new BPromise(function(_0x29d84a,_0x32687a){zipdir(_0x13b838,{'saveTo':_0x4d9ee0},function(_0x7780f2,_0x128ff1){if(_0x7780f2)return _0x32687a(_0x7780f2);return _0x29d84a(_0x128ff1);});})[_0x8b01('0x1d')](function(){return new BPromise(function(_0x4c9018,_0x564d50){rimraf(_0x13b838,function(_0x59b98b){if(_0x59b98b)_0x564d50(_0x59b98b);return _0x4c9018();});});})[_0x8b01('0x1d')](function(){return _0x1c989a[_0x8b01('0x54')](_0x4d9ee0,_0x4422c0,function(_0x39db68){if(_0x39db68){console[_0x8b01('0x75')](_0x8b01('0x76'),_0x39db68);}else{fs['unlinkSync'](_0x4d9ee0);}});});});}else{return _0x1c989a[_0x8b01('0x12')](0xc8);}})['catch'](handleError(_0x1c989a,null));}; \ No newline at end of file +var _0xc1af=['defaults','localhost','./smsInteraction.socket','register','sendStatus','end','status','offset','limit','count','set','Content-Range','json','update','destroy','name','send','index','map','SmsInteraction','rawAttributes','fieldName','key','getOptions','findAll','sms','query','catch','show','keys','filters','intersection','model','attributes','fields','length','includeAll','merge','options','find','then','create','body','params','describe','SmsMessage','ids','getMessages','findOne','hasOwnProperty','nolimit','order','sort','pick','where','SmsInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','omit','color','emit','removeTags','download','toString','files','join','push','User','fullname','CmContact','Contact','firstName','lastName','createdAt','direction','secret','read','SmsAccount','Account','get','Sms','Owner','closed','disposition','Messages','out','System','value','renderFile','root','server','views','downloadInteraction.ejs','createPdfFromHTML','log','unlinkSync','rimraf','zip-dir','bluebird','ejs','lodash','ioredis','../../components/interaction/service','../../config/logger','api','../../config/environment','../../mysqldb','redis'];(function(_0x4627f4,_0xf578e5){var _0x399f0d=function(_0x33e300){while(--_0x33e300){_0x4627f4['push'](_0x4627f4['shift']());}};_0x399f0d(++_0xf578e5);}(_0xc1af,0x1b8));var _0xfc1a=function(_0x8bcbe4,_0x4d8be0){_0x8bcbe4=_0x8bcbe4-0x0;var _0x205c70=_0xc1af[_0x8bcbe4];return _0x205c70;};'use strict';var rimraf=require(_0xfc1a('0x0'));var zipdir=require(_0xfc1a('0x1'));var moment=require('moment');var BPromise=require(_0xfc1a('0x2'));var util=require('util');var path=require('path');var ejs=require(_0xfc1a('0x3'));var fs=require('fs');var _=require(_0xfc1a('0x4'));var Redis=require(_0xfc1a('0x5'));var interaction=require(_0xfc1a('0x6'));var qs=require('../../components/parsers/qs');var pdf=require('../../components/export/pdf');var logger=require(_0xfc1a('0x7'))(_0xfc1a('0x8'));var config=require(_0xfc1a('0x9'));var db=require(_0xfc1a('0xa'))['db'];config[_0xfc1a('0xb')]=_[_0xfc1a('0xc')](config['redis'],{'host':_0xfc1a('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xfc1a('0xe'))[_0xfc1a('0xf')](socket);function respondWithStatusCode(_0x1d2f76,_0x6a7124){_0x6a7124=_0x6a7124||0xcc;return function(_0x3e6f82){if(_0x3e6f82){return _0x1d2f76[_0xfc1a('0x10')](_0x6a7124);}return _0x1d2f76['status'](_0x6a7124)[_0xfc1a('0x11')]();};}function respondWithResult(_0x422eec,_0x469af8){_0x469af8=_0x469af8||0xc8;return function(_0x2cb3db){if(_0x2cb3db){return _0x422eec[_0xfc1a('0x12')](_0x469af8)['json'](_0x2cb3db);}};}function respondWithFilteredResult(_0x1d79da,_0x3f83aa){return function(_0x5c19de){if(_0x5c19de){var _0x588158=typeof _0x3f83aa[_0xfc1a('0x13')]==='undefined'&&typeof _0x3f83aa[_0xfc1a('0x14')]==='undefined';var _0xf71c4b=_0x5c19de[_0xfc1a('0x15')];var _0x51c026=_0x588158?0x0:_0x3f83aa['offset'];var _0xb89ca6=_0x588158?_0x5c19de[_0xfc1a('0x15')]:_0x3f83aa[_0xfc1a('0x13')]+_0x3f83aa[_0xfc1a('0x14')];var _0x38d2b6;if(_0xb89ca6>=_0xf71c4b){_0xb89ca6=_0xf71c4b;_0x38d2b6=0xc8;}else{_0x38d2b6=0xce;}_0x1d79da[_0xfc1a('0x12')](_0x38d2b6);return _0x1d79da[_0xfc1a('0x16')](_0xfc1a('0x17'),_0x51c026+'-'+_0xb89ca6+'/'+_0xf71c4b)[_0xfc1a('0x18')](_0x5c19de);}return null;};}function saveUpdates(_0x3fbf6e){return function(_0x4298eb){if(_0x4298eb){return _0x4298eb[_0xfc1a('0x19')](_0x3fbf6e)['then'](function(_0x9b837f){return _0x9b837f;});}return null;};}function removeEntity(_0x2caed5){return function(_0x1fa1a2){if(_0x1fa1a2){return _0x1fa1a2[_0xfc1a('0x1a')]()['then'](function(){_0x2caed5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1697bb){return function(_0x4f455a){if(!_0x4f455a){_0x1697bb[_0xfc1a('0x10')](0x194);}return _0x4f455a;};}function handleError(_0x425552,_0x29ca1b){_0x29ca1b=_0x29ca1b||0x1f4;return function(_0x432846){logger['error'](_0x432846['stack']);if(_0x432846[_0xfc1a('0x1b')]){delete _0x432846[_0xfc1a('0x1b')];}_0x425552[_0xfc1a('0x12')](_0x29ca1b)[_0xfc1a('0x1c')](_0x432846);};}exports[_0xfc1a('0x1d')]=function(_0x5e86fc,_0x1a36a1){var _0x2d62cb={};var _0x239ff5=_[_0xfc1a('0x1e')](db[_0xfc1a('0x1f')][_0xfc1a('0x20')],function(_0x4adbc0){return{'name':_0x4adbc0[_0xfc1a('0x21')],'type':_0x4adbc0['type'][_0xfc1a('0x22')]};});_0x2d62cb=qs[_0xfc1a('0x23')](_0x239ff5,_0x5e86fc);return interaction[_0xfc1a('0x24')](_0xfc1a('0x25'),_0x5e86fc[_0xfc1a('0x26')],_0x5e86fc['user'],_0x2d62cb,_0x239ff5)['then'](respondWithFilteredResult(_0x1a36a1,_0x2d62cb))[_0xfc1a('0x27')](handleError(_0x1a36a1,null));};exports[_0xfc1a('0x28')]=function(_0x16b09d,_0x760f8f){var _0x51f4e7={'raw':![],'where':{'id':_0x16b09d['params']['id']}},_0x5ca6aa={};_0x5ca6aa['model']=_[_0xfc1a('0x29')](db[_0xfc1a('0x1f')][_0xfc1a('0x20')]);_0x5ca6aa[_0xfc1a('0x26')]=_[_0xfc1a('0x29')](_0x16b09d['query']);_0x5ca6aa[_0xfc1a('0x2a')]=_[_0xfc1a('0x2b')](_0x5ca6aa[_0xfc1a('0x2c')],_0x5ca6aa['query']);_0x51f4e7[_0xfc1a('0x2d')]=_['intersection'](_0x5ca6aa[_0xfc1a('0x2c')],qs[_0xfc1a('0x2e')](_0x16b09d[_0xfc1a('0x26')][_0xfc1a('0x2e')]));_0x51f4e7['attributes']=_0x51f4e7[_0xfc1a('0x2d')][_0xfc1a('0x2f')]?_0x51f4e7[_0xfc1a('0x2d')]:_0x5ca6aa[_0xfc1a('0x2c')];if(_0x16b09d[_0xfc1a('0x26')][_0xfc1a('0x30')]){_0x51f4e7['include']=[{'all':!![]}];}_0x51f4e7=_[_0xfc1a('0x31')]({},_0x51f4e7,_0x16b09d[_0xfc1a('0x32')]);return db['SmsInteraction'][_0xfc1a('0x33')](_0x51f4e7)[_0xfc1a('0x34')](handleEntityNotFound(_0x760f8f,null))[_0xfc1a('0x34')](respondWithResult(_0x760f8f,null))[_0xfc1a('0x27')](handleError(_0x760f8f,null));};exports[_0xfc1a('0x35')]=function(_0x47ccfa,_0x7aac42){return db[_0xfc1a('0x1f')]['create'](_0x47ccfa[_0xfc1a('0x36')],{})[_0xfc1a('0x34')](respondWithResult(_0x7aac42,0xc9))['catch'](handleError(_0x7aac42,null));};exports['update']=function(_0x39e439,_0x4e65f6){if(_0x39e439[_0xfc1a('0x36')]['id']){delete _0x39e439[_0xfc1a('0x36')]['id'];}return db['SmsInteraction'][_0xfc1a('0x33')]({'where':{'id':_0x39e439[_0xfc1a('0x37')]['id']}})[_0xfc1a('0x34')](handleEntityNotFound(_0x4e65f6,null))[_0xfc1a('0x34')](saveUpdates(_0x39e439['body'],null))[_0xfc1a('0x34')](respondWithResult(_0x4e65f6,null))['catch'](handleError(_0x4e65f6,null));};exports['destroy']=function(_0x1748df,_0x1efed9){return db[_0xfc1a('0x1f')]['find']({'where':{'id':_0x1748df[_0xfc1a('0x37')]['id']}})[_0xfc1a('0x34')](handleEntityNotFound(_0x1efed9,null))['then'](removeEntity(_0x1efed9,null))[_0xfc1a('0x27')](handleError(_0x1efed9,null));};exports[_0xfc1a('0x38')]=function(_0x4a85ff,_0x54c5ab){return db['SmsInteraction'][_0xfc1a('0x38')]()[_0xfc1a('0x34')](respondWithResult(_0x54c5ab,null))[_0xfc1a('0x27')](handleError(_0x54c5ab,null));};exports['addMessage']=function(_0xbd6de6,_0x499f56){return db[_0xfc1a('0x39')][_0xfc1a('0x33')]({'where':{'id':_0xbd6de6['params']['id']}})[_0xfc1a('0x34')](handleEntityNotFound(_0x499f56,null))[_0xfc1a('0x34')](function(_0x4759d0){if(_0x4759d0){return _0x4759d0['addMessage'](_0xbd6de6['body']['ids'],_['omit'](_0xbd6de6[_0xfc1a('0x36')],[_0xfc1a('0x3a'),'id'])||{});}})['then'](respondWithResult(_0x499f56,null))[_0xfc1a('0x27')](handleError(_0x499f56,null));};exports[_0xfc1a('0x3b')]=function(_0x1001c9,_0x41b544){var _0x5f45bd={'raw':![],'where':{}};var _0x2f2946={};var _0x47195b={'count':0x0,'rows':[]};return db[_0xfc1a('0x1f')][_0xfc1a('0x3c')]({'where':{'id':_0x1001c9[_0xfc1a('0x37')]['id']}})[_0xfc1a('0x34')](handleEntityNotFound(_0x41b544,null))['then'](function(_0x26652a){if(_0x26652a){_0x2f2946['model']=_['keys'](db['SmsMessage'][_0xfc1a('0x20')]);_0x2f2946['query']=_[_0xfc1a('0x29')](_0x1001c9[_0xfc1a('0x26')]);_0x2f2946[_0xfc1a('0x2a')]=_[_0xfc1a('0x2b')](_0x2f2946[_0xfc1a('0x2c')],_0x2f2946[_0xfc1a('0x26')]);_0x5f45bd[_0xfc1a('0x2d')]=_[_0xfc1a('0x2b')](_0x2f2946[_0xfc1a('0x2c')],qs[_0xfc1a('0x2e')](_0x1001c9[_0xfc1a('0x26')][_0xfc1a('0x2e')]));_0x5f45bd[_0xfc1a('0x2d')]=_0x5f45bd[_0xfc1a('0x2d')][_0xfc1a('0x2f')]?_0x5f45bd['attributes']:_0x2f2946[_0xfc1a('0x2c')];if(!_0x1001c9['query'][_0xfc1a('0x3d')](_0xfc1a('0x3e'))){_0x5f45bd['limit']=qs[_0xfc1a('0x14')](_0x1001c9[_0xfc1a('0x26')]['limit']);_0x5f45bd[_0xfc1a('0x13')]=qs[_0xfc1a('0x13')](_0x1001c9['query'][_0xfc1a('0x13')]);}_0x5f45bd[_0xfc1a('0x3f')]=qs[_0xfc1a('0x40')](_0x1001c9[_0xfc1a('0x26')][_0xfc1a('0x40')]);_0x5f45bd['where']=qs[_0xfc1a('0x2a')](_[_0xfc1a('0x41')](_0x1001c9[_0xfc1a('0x26')],_0x2f2946[_0xfc1a('0x2a')]));_0x5f45bd[_0xfc1a('0x42')][_0xfc1a('0x43')]=_0x26652a['id'];if(_0x1001c9[_0xfc1a('0x26')][_0xfc1a('0x44')]){_0x5f45bd[_0xfc1a('0x42')]=_['merge'](_0x5f45bd[_0xfc1a('0x42')],{'$or':_[_0xfc1a('0x1e')](_0x5f45bd[_0xfc1a('0x2d')],function(_0x765b6f){var _0x24417d={};_0x24417d[_0x765b6f]={'$like':'%'+_0x1001c9['query'][_0xfc1a('0x44')]+'%'};return _0x24417d;})});}if(_0x1001c9[_0xfc1a('0x26')][_0xfc1a('0x45')]){var _0x5b7c76=_0x1001c9[_0xfc1a('0x26')]['$gte'][_0xfc1a('0x46')](',');var _0x37c7cd={};_0x37c7cd[_0x5b7c76[0x0]]={'$gte':moment(_0x5b7c76[0x1])[_0xfc1a('0x47')](_0xfc1a('0x48'))};_0x5f45bd[_0xfc1a('0x42')]=_[_0xfc1a('0x31')](_0x5f45bd[_0xfc1a('0x42')],_0x37c7cd);}_0x5f45bd=_['merge']({},_0x5f45bd,_0x1001c9[_0xfc1a('0x32')]);return db[_0xfc1a('0x39')]['count']({'where':_0x5f45bd[_0xfc1a('0x42')]})[_0xfc1a('0x34')](function(_0x58a78a){_0x47195b[_0xfc1a('0x15')]=_0x58a78a;if(_0x1001c9[_0xfc1a('0x26')][_0xfc1a('0x30')]){_0x5f45bd['include']=[{'all':!![]}];}return db[_0xfc1a('0x39')]['findAll'](_0x5f45bd);})[_0xfc1a('0x34')](function(_0x248f84){_0x47195b[_0xfc1a('0x49')]=_0x248f84;return _0x47195b;});}})[_0xfc1a('0x34')](respondWithFilteredResult(_0x41b544,_0x5f45bd))[_0xfc1a('0x27')](handleError(_0x41b544,null));};exports[_0xfc1a('0x4a')]=function(_0x1eee4f,_0x45582b){return db[_0xfc1a('0x1f')]['find']({'where':{'id':_0x1eee4f[_0xfc1a('0x37')]['id']}})[_0xfc1a('0x34')](handleEntityNotFound(_0x45582b,null))[_0xfc1a('0x34')](function(_0x96d69c){if(_0x96d69c){return _0x96d69c['setTags'](_0x1eee4f[_0xfc1a('0x36')]['ids'],_[_0xfc1a('0x4b')](_0x1eee4f[_0xfc1a('0x36')],[_0xfc1a('0x3a'),'id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0xfc1a('0x1b'),_0xfc1a('0x4c')],'where':{'id':_0x1eee4f['body'][_0xfc1a('0x3a')]}});})[_0xfc1a('0x34')](function(_0x407cdc){socket[_0xfc1a('0x4d')]('smsInteractionTags:save',{'id':Number(_0x1eee4f['params']['id']),'tags':_0x407cdc||[]});return{'id':Number(_0x1eee4f[_0xfc1a('0x37')]['id']),'tags':_0x407cdc||[]};});}})['then'](respondWithResult(_0x45582b,null))[_0xfc1a('0x27')](handleError(_0x45582b,null));};exports[_0xfc1a('0x4e')]=function(_0x1423a4,_0x4aaf7f){return db['SmsInteraction']['find']({'where':{'id':_0x1423a4[_0xfc1a('0x37')]['id']}})['then'](handleEntityNotFound(_0x4aaf7f,null))['then'](function(_0x2b1632){if(_0x2b1632){return _0x2b1632['removeTags'](_0x1423a4['query']['ids']);}})[_0xfc1a('0x34')](respondWithStatusCode(_0x4aaf7f,null))[_0xfc1a('0x27')](handleError(_0x4aaf7f,null));};exports[_0xfc1a('0x4f')]=function(_0x489c2a,_0x34da27){var _0xa791f=moment()['unix']()[_0xfc1a('0x50')]();var _0x23b7b6=path['join'](config['root'],'server',_0xfc1a('0x51'),'tmp');var _0x3c4f50=path[_0xfc1a('0x52')](_0x23b7b6,_0xa791f);var _0x4eaa96=util[_0xfc1a('0x47')]('transcript-%d-%s.zip',_0x489c2a[_0xfc1a('0x37')]['id'],_0xa791f);var _0x116695=path[_0xfc1a('0x52')](_0x23b7b6,_0x4eaa96);var _0x9e0d56=[];_0x9e0d56[_0xfc1a('0x53')]({'model':db[_0xfc1a('0x54')],'as':'User','attributes':['id',_0xfc1a('0x55')],'raw':!![]});_0x9e0d56[_0xfc1a('0x53')]({'model':db[_0xfc1a('0x56')],'as':_0xfc1a('0x57'),'attributes':['id',_0xfc1a('0x58'),_0xfc1a('0x59')],'raw':!![]});var _0x1aada4=[{'model':db['SmsMessage'],'as':'Messages','attributes':['id',_0xfc1a('0x36'),_0xfc1a('0x5a'),_0xfc1a('0x5b'),_0xfc1a('0x5c'),_0xfc1a('0x5d')],'include':_0x9e0d56}];_0x1aada4[_0xfc1a('0x53')]({'model':db[_0xfc1a('0x5e')],'as':_0xfc1a('0x5f'),'attributes':['id',_0xfc1a('0x1b')]});_0x1aada4[_0xfc1a('0x53')]({'model':db[_0xfc1a('0x54')],'as':'Owner','attributes':['id',_0xfc1a('0x55')]});return db['SmsInteraction']['find']({'where':{'id':_0x489c2a['params']['id']},'include':_0x1aada4})[_0xfc1a('0x34')](handleEntityNotFound(_0x34da27,null))[_0xfc1a('0x34')](function(_0x99e546){if(_0x99e546){var _0xc3391a=_0x99e546[_0xfc1a('0x60')]({'plain':!![]});fs['mkdirSync'](_0x3c4f50);var _0x2970d9={'channel':_0xfc1a('0x61'),'account':_0xc3391a[_0xfc1a('0x5f')][_0xfc1a('0x1b')],'agent':_0xc3391a[_0xfc1a('0x62')]?_0xc3391a['Owner']['fullname']:'N.A.','createdAt':moment(_0xc3391a[_0xfc1a('0x5a')])[_0xfc1a('0x47')](_0xfc1a('0x48'))['toString'](),'closedAt':_0xc3391a[_0xfc1a('0x63')]?moment(_0xc3391a['closedAt'])[_0xfc1a('0x47')]('YYYY-MM-DD\x20HH:mm:ss')[_0xfc1a('0x50')]():'','disposition':_0xc3391a[_0xfc1a('0x64')],'messages':_(_0xc3391a[_0xfc1a('0x65')])[_0xfc1a('0x44')]({'secret':![]})['map'](function(_0xbf33ec){return{'date':moment(_0xbf33ec[_0xfc1a('0x5a')])[_0xfc1a('0x47')](_0xfc1a('0x48'))['toString'](),'sender':_0xbf33ec[_0xfc1a('0x5b')]===_0xfc1a('0x66')?_0xbf33ec[_0xfc1a('0x54')]?_0xbf33ec[_0xfc1a('0x54')][_0xfc1a('0x55')]:_0xfc1a('0x67'):_0xbf33ec['Contact'][_0xfc1a('0x58')]+(_0xbf33ec[_0xfc1a('0x57')]['lastName']?'\x20'+_0xbf33ec[_0xfc1a('0x57')][_0xfc1a('0x59')]:''),'body':_0xbf33ec[_0xfc1a('0x36')],'direction':_0xbf33ec[_0xfc1a('0x5b')]==='out'?'A':'C','secret':_0xbf33ec[_0xfc1a('0x5c')],'read':_0xbf33ec['read']};})[_0xfc1a('0x68')]()};return ejs[_0xfc1a('0x69')](path[_0xfc1a('0x52')](config[_0xfc1a('0x6a')],_0xfc1a('0x6b'),_0xfc1a('0x6c'),_0xfc1a('0x6d')),{'interaction':_0x2970d9})[_0xfc1a('0x34')](function(_0x7a6dcd){var _0x497dc2=path[_0xfc1a('0x52')](_0x3c4f50,'transcript-'+_0xc3391a['id']+'-'+_0xa791f+'.pdf');var _0x406a49={'path':_0x497dc2,'channel':'Sms','interactionId':_0xc3391a['id']};return pdf[_0xfc1a('0x6e')](_0x7a6dcd,_0x406a49);})[_0xfc1a('0x34')](function(){return new BPromise(function(_0x14a951,_0x5f8788){zipdir(_0x3c4f50,{'saveTo':_0x116695},function(_0x36f9cb,_0x250650){if(_0x36f9cb)return _0x5f8788(_0x36f9cb);return _0x14a951(_0x250650);});})[_0xfc1a('0x34')](function(){return new BPromise(function(_0x1a1ee6,_0x3d7a8f){rimraf(_0x3c4f50,function(_0x51e987){if(_0x51e987)_0x3d7a8f(_0x51e987);return _0x1a1ee6();});});})[_0xfc1a('0x34')](function(){return _0x34da27[_0xfc1a('0x4f')](_0x116695,_0x4eaa96,function(_0x579348){if(_0x579348){console[_0xfc1a('0x6f')]('err',_0x579348);}else{fs[_0xfc1a('0x70')](_0x116695);}});});});}else{return _0x34da27['sendStatus'](0xc8);}})[_0xfc1a('0x27')](handleError(_0x34da27,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 465830c..a874d14 100644 --- a/server/api/smsInteraction/smsInteraction.events.js +++ b/server/api/smsInteraction/smsInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe820=['unreadMessages','length','emit','catch','hasOwnProperty','exports','events','SmsInteraction','setMaxListeners','save','update','getUsers','then','Users','map','findAll','setDataValue'];(function(_0x34a66a,_0x55df56){var _0x5b62de=function(_0x139ef9){while(--_0x139ef9){_0x34a66a['push'](_0x34a66a['shift']());}};_0x5b62de(++_0x55df56);}(_0xe820,0xd2));var _0x0e82=function(_0x4ac1e5,_0x246f8b){_0x4ac1e5=_0x4ac1e5-0x0;var _0x24a309=_0xe820[_0x4ac1e5];return _0x24a309;};'use strict';var EventEmitter=require(_0x0e82('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0x0e82('0x1')];var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x0e82('0x2')](0x0);var events={'afterCreate':_0x0e82('0x3'),'afterUpdate':_0x0e82('0x4'),'afterDestroy':'remove'};function emitEvent(_0xc6d61e){return function(_0x5de50f,_0x2cb88f,_0x105e3c){_0x5de50f[_0x0e82('0x5')]({'attributes':['id'],'raw':!![]})[_0x0e82('0x6')](function(_0x2a0f9b){_0x5de50f['setDataValue'](_0x0e82('0x7'),_0x2a0f9b[_0x0e82('0x8')](function(_0x2c0d6d){return{'id':_0x2c0d6d['id']};}));return SmsMessage[_0x0e82('0x9')]({'where':{'SmsInteractionId':_0x5de50f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0e82('0x6')](function(_0x4b3302){_0x5de50f[_0x0e82('0xa')](_0x0e82('0xb'),_0x4b3302[_0x0e82('0xc')]);SmsInteractionEvents[_0x0e82('0xd')](_0xc6d61e+':'+_0x5de50f['id'],_0x5de50f);SmsInteractionEvents[_0x0e82('0xd')](_0xc6d61e,_0x5de50f);_0x105e3c(null);})[_0x0e82('0xe')](_0x105e3c(null));};}for(var e in events){if(events[_0x0e82('0xf')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x0e82('0x10')]=SmsInteractionEvents; \ No newline at end of file +var _0x7880=['emit','hasOwnProperty','hook','exports','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','remove','getUsers','then','setDataValue','Users','unreadMessages','length'];(function(_0x3bddfa,_0x3acd58){var _0xb87c4a=function(_0x4d35d2){while(--_0x4d35d2){_0x3bddfa['push'](_0x3bddfa['shift']());}};_0xb87c4a(++_0x3acd58);}(_0x7880,0x1f4));var _0x0788=function(_0x3e3221,_0x392851){_0x3e3221=_0x3e3221-0x0;var _0x190da4=_0x7880[_0x3e3221];return _0x190da4;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x0788('0x0'))['db'][_0x0788('0x1')];var SmsMessage=require(_0x0788('0x0'))['db'][_0x0788('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x0788('0x3')](0x0);var events={'afterCreate':_0x0788('0x4'),'afterUpdate':'update','afterDestroy':_0x0788('0x5')};function emitEvent(_0x1e0814){return function(_0x317885,_0xd53e7d,_0x262f5c){_0x317885[_0x0788('0x6')]({'attributes':['id'],'raw':!![]})[_0x0788('0x7')](function(_0x44bbb5){_0x317885[_0x0788('0x8')](_0x0788('0x9'),_0x44bbb5['map'](function(_0x1497dd){return{'id':_0x1497dd['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x317885['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0788('0x7')](function(_0x53b2f2){_0x317885[_0x0788('0x8')](_0x0788('0xa'),_0x53b2f2[_0x0788('0xb')]);SmsInteractionEvents[_0x0788('0xc')](_0x1e0814+':'+_0x317885['id'],_0x317885);SmsInteractionEvents[_0x0788('0xc')](_0x1e0814,_0x317885);_0x262f5c(null);})['catch'](_0x262f5c(null));};}for(var e in events){if(events[_0x0788('0xd')](e)){var event=events[e];SmsInteraction[_0x0788('0xe')](e,emitEvent(event));}}module[_0x0788('0xf')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index d1cc6d3..c9f6985 100644 --- a/server/api/smsInteraction/smsInteraction.model.js +++ b/server/api/smsInteraction/smsInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e7b=['../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','closed','closedAt','format','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x1ae022,_0x4bea59){var _0x51f769=function(_0x48fa2b){while(--_0x48fa2b){_0x1ae022['push'](_0x1ae022['shift']());}};_0x51f769(++_0x4bea59);}(_0x3e7b,0xa8));var _0xb3e7=function(_0x1d021f,_0xfd197e){_0x1d021f=_0x1d021f-0x0;var _0xa92373=_0x3e7b[_0x1d021f];return _0xa92373;};'use strict';var _=require(_0xb3e7('0x0'));var util=require(_0xb3e7('0x1'));var logger=require(_0xb3e7('0x2'))(_0xb3e7('0x3'));var moment=require(_0xb3e7('0x4'));var BPromise=require('bluebird');var rp=require(_0xb3e7('0x5'));var fs=require('fs');var path=require(_0xb3e7('0x6'));var rimraf=require(_0xb3e7('0x7'));var config=require(_0xb3e7('0x8'));var attributes=require(_0xb3e7('0x9'));module[_0xb3e7('0xa')]=function(_0x521ffa,_0x12247d){return _0x521ffa[_0xb3e7('0xb')](_0xb3e7('0xc'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x508542,_0xc952c7,_0x15799e){if(_0x508542['changed'](_0xb3e7('0xd'))){_0x508542[_0xb3e7('0xe')]=moment()[_0xb3e7('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x15799e(null,_0x508542);}}});}; \ No newline at end of file +var _0xb3af=['bluebird','request-promise','path','./smsInteraction.attributes','exports','define','SmsInteraction','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api'];(function(_0xfb0cfd,_0x500179){var _0x2fd8aa=function(_0xccb501){while(--_0xccb501){_0xfb0cfd['push'](_0xfb0cfd['shift']());}};_0x2fd8aa(++_0x500179);}(_0xb3af,0xec));var _0xfb3a=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xb3af[_0x1694f5];return _0x5b4321;};'use strict';var _=require(_0xfb3a('0x0'));var util=require(_0xfb3a('0x1'));var logger=require(_0xfb3a('0x2'))(_0xfb3a('0x3'));var moment=require('moment');var BPromise=require(_0xfb3a('0x4'));var rp=require(_0xfb3a('0x5'));var fs=require('fs');var path=require(_0xfb3a('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfb3a('0x7'));module[_0xfb3a('0x8')]=function(_0x5e8001,_0x13d71f){return _0x5e8001[_0xfb3a('0x9')](_0xfb3a('0xa'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x15e81f,_0x5e3c98,_0x3c5dfe){if(_0x15e81f[_0xfb3a('0xb')](_0xfb3a('0xc'))){_0x15e81f['closedAt']=moment()[_0xfb3a('0xd')](_0xfb3a('0xe'));}_0x3c5dfe(null,_0x15e81f);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 57928d6..a8aca76 100644 --- a/server/api/smsInteraction/smsInteraction.rpc.js +++ b/server/api/smsInteraction/smsInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6605=['AddTags','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','SmsInteraction,\x20%s,\x20%s','message','result','SmsInteraction','update','body','options','raw','where','attributes','UpdateSmsInteraction','catch','AddTagsToSmsInteraction','find','addTags','ids','omit'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x6605,0x120));var _0x5660=function(_0x4210d0,_0xeb5b0a){_0x4210d0=_0x4210d0-0x0;var _0x8af8bc=_0x6605[_0x4210d0];return _0x8af8bc;};'use strict';var _=require(_0x5660('0x0'));var util=require('util');var moment=require(_0x5660('0x1'));var BPromise=require('bluebird');var rs=require(_0x5660('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5660('0x3'))['db'];var utils=require(_0x5660('0x4'));var logger=require(_0x5660('0x5'))(_0x5660('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5660('0x7')][_0x5660('0x8')]({'port':0x232a});config[_0x5660('0x9')]=_[_0x5660('0xa')](config['redis'],{'host':_0x5660('0xb'),'port':0x18eb});var socket=require(_0x5660('0xc'))(new Redis(config[_0x5660('0x9')]));require(_0x5660('0xd'))[_0x5660('0xe')](socket);function respondWithRpcPromise(_0x1cbbb3,_0x21913f,_0x49fe66){return new BPromise(function(_0x5193f2,_0x564641){return client[_0x5660('0xf')](_0x1cbbb3,_0x49fe66)[_0x5660('0x10')](function(_0x557663){logger[_0x5660('0x11')]('SmsInteraction,\x20%s,\x20%s',_0x21913f,_0x5660('0x12'));logger[_0x5660('0x13')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x21913f,'request\x20sent',JSON[_0x5660('0x14')](_0x557663));if(_0x557663[_0x5660('0x15')]){if(_0x557663[_0x5660('0x15')][_0x5660('0x16')]===0x1f4){logger['error'](_0x5660('0x17'),_0x21913f,_0x557663['error'][_0x5660('0x18')]);return _0x564641(_0x557663[_0x5660('0x15')][_0x5660('0x18')]);}logger[_0x5660('0x15')](_0x5660('0x17'),_0x21913f,_0x557663[_0x5660('0x15')][_0x5660('0x18')]);return _0x5193f2(_0x557663[_0x5660('0x15')]['message']);}else{logger[_0x5660('0x11')](_0x5660('0x17'),_0x21913f,_0x5660('0x12'));_0x5193f2(_0x557663[_0x5660('0x19')][_0x5660('0x18')]);}})['catch'](function(_0x5d462d){logger['error'](_0x5660('0x17'),_0x21913f,_0x5d462d);_0x564641(_0x5d462d);});});}exports['UpdateSmsInteraction']=function(_0x3658d6){var _0x7b21db=this;return new Promise(function(_0x1a6110,_0x4d1dcc){return db[_0x5660('0x1a')][_0x5660('0x1b')](_0x3658d6[_0x5660('0x1c')],{'raw':_0x3658d6[_0x5660('0x1d')]?_0x3658d6[_0x5660('0x1d')][_0x5660('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3658d6[_0x5660('0x1d')]?_0x3658d6[_0x5660('0x1d')][_0x5660('0x1f')]||null:null,'attributes':_0x3658d6[_0x5660('0x1d')]?_0x3658d6['options'][_0x5660('0x20')]||null:null,'limit':_0x3658d6[_0x5660('0x1d')]?_0x3658d6[_0x5660('0x1d')]['limit']||null:null})['then'](function(_0x50c171){logger[_0x5660('0x11')](_0x5660('0x21'),_0x3658d6);logger['debug'](_0x5660('0x21'),_0x3658d6,JSON[_0x5660('0x14')](_0x50c171));_0x1a6110(_0x50c171);})[_0x5660('0x22')](function(_0x46c4ec){logger[_0x5660('0x15')](_0x5660('0x21'),_0x46c4ec[_0x5660('0x18')],_0x3658d6);_0x4d1dcc(_0x7b21db['error'](0x1f4,_0x46c4ec[_0x5660('0x18')]));});});};exports[_0x5660('0x23')]=function(_0x4a6820){return new Promise(function(_0x535932,_0x361a6b){return db[_0x5660('0x1a')][_0x5660('0x24')]({'where':_0x4a6820['options']?_0x4a6820[_0x5660('0x1d')][_0x5660('0x1f')]||null:null})[_0x5660('0x10')](function(_0x500ae9){if(_0x500ae9){return _0x500ae9[_0x5660('0x25')](_0x4a6820[_0x5660('0x1c')][_0x5660('0x26')],_[_0x5660('0x27')](_0x4a6820['body'],[_0x5660('0x26'),'id'])||{});}})['spread'](function(_0x9e74b2){logger[_0x5660('0x11')](_0x5660('0x28'),_0x4a6820);logger['debug'](_0x5660('0x28'),_0x4a6820,JSON[_0x5660('0x14')](_0x9e74b2));_0x535932(_0x9e74b2);})['catch'](function(_0x3c6e43){logger['error'](_0x5660('0x28'),_0x3c6e43[_0x5660('0x18')],_0x4a6820);_0x361a6b(_this['error'](0x1f4,_0x3c6e43['message']));});});}; \ No newline at end of file +var _0x4710=['body','ids','omit','spread','AddTags','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','client','redis','defaults','register','request','then','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','message','SmsInteraction,\x20%s,\x20%s','result','catch','UpdateSmsInteraction','SmsInteraction','update','options','raw','limit','info','stringify','AddTagsToSmsInteraction','find','addTags'];(function(_0x43225f,_0x443c32){var _0x506729=function(_0x5df66b){while(--_0x5df66b){_0x43225f['push'](_0x43225f['shift']());}};_0x506729(++_0x443c32);}(_0x4710,0x12d));var _0x0471=function(_0x25debf,_0x47e03a){_0x25debf=_0x25debf-0x0;var _0x3aabe2=_0x4710[_0x25debf];return _0x3aabe2;};'use strict';var _=require(_0x0471('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0471('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0471('0x2'));var db=require(_0x0471('0x3'))['db'];var utils=require(_0x0471('0x4'));var logger=require('../../config/logger')(_0x0471('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0471('0x6')]['http']({'port':0x232a});config[_0x0471('0x7')]=_[_0x0471('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0471('0x7')]));require('./smsInteraction.socket')[_0x0471('0x9')](socket);function respondWithRpcPromise(_0x41f989,_0x205a30,_0x271f0d){return new BPromise(function(_0x10c7f6,_0xf6f518){return client[_0x0471('0xa')](_0x41f989,_0x271f0d)[_0x0471('0xb')](function(_0x2bc1f1){logger['info']('SmsInteraction,\x20%s,\x20%s',_0x205a30,_0x0471('0xc'));logger[_0x0471('0xd')](_0x0471('0xe'),_0x205a30,_0x0471('0xc'),JSON['stringify'](_0x2bc1f1));if(_0x2bc1f1['error']){if(_0x2bc1f1[_0x0471('0xf')][_0x0471('0x10')]===0x1f4){logger[_0x0471('0xf')]('SmsInteraction,\x20%s,\x20%s',_0x205a30,_0x2bc1f1['error'][_0x0471('0x11')]);return _0xf6f518(_0x2bc1f1[_0x0471('0xf')][_0x0471('0x11')]);}logger[_0x0471('0xf')]('SmsInteraction,\x20%s,\x20%s',_0x205a30,_0x2bc1f1['error'][_0x0471('0x11')]);return _0x10c7f6(_0x2bc1f1[_0x0471('0xf')][_0x0471('0x11')]);}else{logger['info'](_0x0471('0x12'),_0x205a30,'request\x20sent');_0x10c7f6(_0x2bc1f1[_0x0471('0x13')]['message']);}})[_0x0471('0x14')](function(_0x1c0608){logger['error']('SmsInteraction,\x20%s,\x20%s',_0x205a30,_0x1c0608);_0xf6f518(_0x1c0608);});});}exports[_0x0471('0x15')]=function(_0x31420b){var _0x3b169d=this;return new Promise(function(_0x301b3a,_0x33e9ad){return db[_0x0471('0x16')][_0x0471('0x17')](_0x31420b['body'],{'raw':_0x31420b[_0x0471('0x18')]?_0x31420b[_0x0471('0x18')][_0x0471('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x31420b[_0x0471('0x18')]?_0x31420b['options']['where']||null:null,'attributes':_0x31420b[_0x0471('0x18')]?_0x31420b[_0x0471('0x18')]['attributes']||null:null,'limit':_0x31420b[_0x0471('0x18')]?_0x31420b['options'][_0x0471('0x1a')]||null:null})[_0x0471('0xb')](function(_0x16e195){logger[_0x0471('0x1b')](_0x0471('0x15'),_0x31420b);logger[_0x0471('0xd')](_0x0471('0x15'),_0x31420b,JSON[_0x0471('0x1c')](_0x16e195));_0x301b3a(_0x16e195);})[_0x0471('0x14')](function(_0x3b4933){logger[_0x0471('0xf')]('UpdateSmsInteraction',_0x3b4933[_0x0471('0x11')],_0x31420b);_0x33e9ad(_0x3b169d['error'](0x1f4,_0x3b4933['message']));});});};exports[_0x0471('0x1d')]=function(_0x16761c){return new Promise(function(_0x3d8e53,_0x45d07f){return db[_0x0471('0x16')][_0x0471('0x1e')]({'where':_0x16761c[_0x0471('0x18')]?_0x16761c[_0x0471('0x18')]['where']||null:null})[_0x0471('0xb')](function(_0x4e27d2){if(_0x4e27d2){return _0x4e27d2[_0x0471('0x1f')](_0x16761c[_0x0471('0x20')][_0x0471('0x21')],_[_0x0471('0x22')](_0x16761c['body'],[_0x0471('0x21'),'id'])||{});}})[_0x0471('0x23')](function(_0x3a2f3d){logger[_0x0471('0x1b')]('AddTags',_0x16761c);logger['debug'](_0x0471('0x24'),_0x16761c,JSON['stringify'](_0x3a2f3d));_0x3d8e53(_0x3a2f3d);})[_0x0471('0x14')](function(_0x51b94a){logger['error'](_0x0471('0x24'),_0x51b94a[_0x0471('0x11')],_0x16761c);_0x45d07f(_this[_0x0471('0xf')](0x1f4,_0x51b94a['message']));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 9258a46..9c1689f 100644 --- a/server/api/smsInteraction/smsInteraction.socket.js +++ b/server/api/smsInteraction/smsInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d32=['./smsInteraction.events','remove','update','emit','removeListener','register','length'];(function(_0xe45fef,_0x1ff738){var _0x36586a=function(_0x57e185){while(--_0x57e185){_0xe45fef['push'](_0xe45fef['shift']());}};_0x36586a(++_0x1ff738);}(_0x6d32,0xee));var _0x26d3=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x6d32[_0x2e4aa2];return _0x5e6092;};'use strict';var SmsInteractionEvents=require(_0x26d3('0x0'));var events=['save',_0x26d3('0x1'),_0x26d3('0x2')];function createListener(_0x3349fa,_0xb04091){return function(_0x5a5640){_0xb04091[_0x26d3('0x3')](_0x3349fa,_0x5a5640);};}function removeListener(_0x233277,_0x50a3f0){return function(){SmsInteractionEvents[_0x26d3('0x4')](_0x233277,_0x50a3f0);};}exports[_0x26d3('0x5')]=function(_0x44848a){for(var _0x368ddc=0x0,_0x48562b=events[_0x26d3('0x6')];_0x368ddc<_0x48562b;_0x368ddc++){var _0x504618=events[_0x368ddc];var _0x5e110d=createListener('smsInteraction:'+_0x504618,_0x44848a);SmsInteractionEvents['on'](_0x504618,_0x5e110d);}}; \ No newline at end of file +var _0x4941=['emit','register','smsInteraction:','./smsInteraction.events','remove','update'];(function(_0x503564,_0x55867e){var _0x4be9fd=function(_0x41c543){while(--_0x41c543){_0x503564['push'](_0x503564['shift']());}};_0x4be9fd(++_0x55867e);}(_0x4941,0x1c5));var _0x1494=function(_0x1c8cc6,_0x411e5c){_0x1c8cc6=_0x1c8cc6-0x0;var _0x522936=_0x4941[_0x1c8cc6];return _0x522936;};'use strict';var SmsInteractionEvents=require(_0x1494('0x0'));var events=['save',_0x1494('0x1'),_0x1494('0x2')];function createListener(_0x53a808,_0x422e40){return function(_0x4ac5d5){_0x422e40[_0x1494('0x3')](_0x53a808,_0x4ac5d5);};}function removeListener(_0x4cdda6,_0x2d80fc){return function(){SmsInteractionEvents['removeListener'](_0x4cdda6,_0x2d80fc);};}exports[_0x1494('0x4')]=function(_0x418013){for(var _0x5247bb=0x0,_0x969629=events['length'];_0x5247bb<_0x969629;_0x5247bb++){var _0x19bb3c=events[_0x5247bb];var _0x3514b8=createListener(_0x1494('0x5')+_0x19bb3c,_0x418013);SmsInteractionEvents['on'](_0x19bb3c,_0x3514b8);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 5ef0da2..754ec6a 100644 --- a/server/api/smsMessage/index.js +++ b/server/api/smsMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8dae=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','smsmessage:create','create','/:id/status','status','update','/:id/reject','reject','destroy','exports','multer'];(function(_0x3ff2f9,_0x544ba1){var _0x3b0913=function(_0x554288){while(--_0x554288){_0x3ff2f9['push'](_0x3ff2f9['shift']());}};_0x3b0913(++_0x544ba1);}(_0x8dae,0xa7));var _0xe8da=function(_0x219b57,_0x44e2c0){_0x219b57=_0x219b57-0x0;var _0x3457f5=_0x8dae[_0x219b57];return _0x3457f5;};'use strict';var multer=require(_0xe8da('0x0'));var util=require('util');var path=require(_0xe8da('0x1'));var timeout=require(_0xe8da('0x2'));var express=require(_0xe8da('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe8da('0x4'));var interaction=require(_0xe8da('0x5'));var config=require(_0xe8da('0x6'));var controller=require('./smsMessage.controller');router[_0xe8da('0x7')]('/',auth[_0xe8da('0x8')](),controller[_0xe8da('0x9')]);router[_0xe8da('0x7')](_0xe8da('0xa'),auth[_0xe8da('0x8')](),controller[_0xe8da('0xb')]);router['get'](_0xe8da('0xc'),auth['isAuthenticated'](),controller[_0xe8da('0xd')]);router[_0xe8da('0xe')]('/',auth[_0xe8da('0x8')](),interaction['tracked']('sms',_0xe8da('0xf')),controller[_0xe8da('0x10')]);router[_0xe8da('0xe')](_0xe8da('0x11'),controller[_0xe8da('0x12')]);router['put']('/:id',auth[_0xe8da('0x8')](),controller[_0xe8da('0x13')]);router['put']('/:id/accept',auth[_0xe8da('0x8')](),controller['accept']);router['put'](_0xe8da('0x14'),auth['isAuthenticated'](),controller[_0xe8da('0x15')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xe8da('0x16')]);module[_0xe8da('0x17')]=router; \ No newline at end of file +var _0x9d62=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','tracked','sms','smsmessage:create','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x148b2b,_0x4d3524){var _0x15ab9e=function(_0x57d751){while(--_0x57d751){_0x148b2b['push'](_0x148b2b['shift']());}};_0x15ab9e(++_0x4d3524);}(_0x9d62,0xaf));var _0x29d6=function(_0x38c231,_0xb92c92){_0x38c231=_0x38c231-0x0;var _0x2a0e14=_0x9d62[_0x38c231];return _0x2a0e14;};'use strict';var multer=require(_0x29d6('0x0'));var util=require(_0x29d6('0x1'));var path=require(_0x29d6('0x2'));var timeout=require(_0x29d6('0x3'));var express=require(_0x29d6('0x4'));var router=express['Router']();var fs_extra=require(_0x29d6('0x5'));var auth=require(_0x29d6('0x6'));var interaction=require(_0x29d6('0x7'));var config=require(_0x29d6('0x8'));var controller=require(_0x29d6('0x9'));router['get']('/',auth[_0x29d6('0xa')](),controller[_0x29d6('0xb')]);router[_0x29d6('0xc')](_0x29d6('0xd'),auth[_0x29d6('0xa')](),controller[_0x29d6('0xe')]);router['get'](_0x29d6('0xf'),auth[_0x29d6('0xa')](),controller[_0x29d6('0x10')]);router[_0x29d6('0x11')]('/',auth[_0x29d6('0xa')](),interaction[_0x29d6('0x12')](_0x29d6('0x13'),_0x29d6('0x14')),controller['create']);router[_0x29d6('0x11')](_0x29d6('0x15'),controller[_0x29d6('0x16')]);router[_0x29d6('0x17')](_0x29d6('0xf'),auth[_0x29d6('0xa')](),controller[_0x29d6('0x18')]);router['put'](_0x29d6('0x19'),auth['isAuthenticated'](),controller[_0x29d6('0x1a')]);router[_0x29d6('0x17')](_0x29d6('0x1b'),auth[_0x29d6('0xa')](),controller['reject']);router['delete']('/:id',auth[_0x29d6('0xa')](),controller[_0x29d6('0x1c')]);module[_0x29d6('0x1d')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 3ee71fe..09a579d 100644 --- a/server/api/smsMessage/smsMessage.attributes.js +++ b/server/api/smsMessage/smsMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2a1d=['TEXT','BOOLEAN','ENUM','out','STRING'];(function(_0x519f,_0x48a547){var _0x3a8345=function(_0x399f62){while(--_0x399f62){_0x519f['push'](_0x519f['shift']());}};_0x3a8345(++_0x48a547);}(_0x2a1d,0x113));var _0xd2a1=function(_0x43f4b8,_0x3c24a1){_0x43f4b8=_0x43f4b8-0x0;var _0x35d077=_0x2a1d[_0x43f4b8];return _0x35d077;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xd2a1('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xd2a1('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd2a1('0x2')]('in','out'),'defaultValue':_0xd2a1('0x3'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xd2a1('0x4')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xd2a1('0x1')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xd2a1('0x4')]},'providerResponse':{'type':Sequelize[_0xd2a1('0x0')]}}; \ No newline at end of file +var _0xed08=['TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE','exports'];(function(_0x5d4aa3,_0x504c43){var _0x3a3413=function(_0x526b6d){while(--_0x526b6d){_0x5d4aa3['push'](_0x5d4aa3['shift']());}};_0x3a3413(++_0x504c43);}(_0xed08,0x67));var _0x8ed0=function(_0x54364f,_0x79e5e1){_0x54364f=_0x54364f-0x0;var _0x5319a4=_0xed08[_0x54364f];return _0x5319a4;};'use strict';var Sequelize=require('sequelize');module[_0x8ed0('0x0')]={'body':{'type':Sequelize[_0x8ed0('0x1')](_0x8ed0('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x8ed0('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8ed0('0x4')]('in',_0x8ed0('0x5')),'defaultValue':_0x8ed0('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x8ed0('0x6')](0xbe)},'phone':{'type':Sequelize[_0x8ed0('0x6')]},'readAt':{'type':Sequelize[_0x8ed0('0x7')]},'secret':{'type':Sequelize[_0x8ed0('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x8ed0('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 3e7d778..5690ad1 100644 --- a/server/api/smsMessage/smsMessage.controller.js +++ b/server/api/smsMessage/smsMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcdb4=['where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','find','create','body','describe','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','SmsInteraction','isNil','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','agent','fullname','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','sms-interactions','reject','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','contact','User','internal','rejectmessage','SmsAccountId','inspect','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','DELIVERED','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','count','limit','set','apply','save','update','destroy','name','send','index','map','SmsMessage','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','sort','filters','filter'];(function(_0x1780f8,_0x11ba93){var _0x33a410=function(_0x2a015f){while(--_0x2a015f){_0x1780f8['push'](_0x1780f8['shift']());}};_0x33a410(++_0x11ba93);}(_0xcdb4,0x1f3));var _0x4cdb=function(_0x125c40,_0x4ff068){_0x125c40=_0x125c40-0x0;var _0x5cb927=_0xcdb4[_0x125c40];return _0x5cb927;};'use strict';var emlformat=require(_0x4cdb('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4cdb('0x1'));var moment=require(_0x4cdb('0x2'));var BPromise=require(_0x4cdb('0x3'));var Mustache=require(_0x4cdb('0x4'));var util=require(_0x4cdb('0x5'));var path=require(_0x4cdb('0x6'));var sox=require(_0x4cdb('0x7'));var csv=require(_0x4cdb('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4cdb('0x9'));var crypto=require('crypto');var jsforce=require(_0x4cdb('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x4cdb('0x8'));var querystring=require(_0x4cdb('0xb'));var Papa=require(_0x4cdb('0xc'));var Redis=require(_0x4cdb('0xd'));var authService=require(_0x4cdb('0xe'));var qs=require(_0x4cdb('0xf'));var as=require(_0x4cdb('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4cdb('0x11'))('api');var utils=require(_0x4cdb('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x4cdb('0x13'));var db=require(_0x4cdb('0x14'))['db'];config[_0x4cdb('0x15')]=_[_0x4cdb('0x16')](config[_0x4cdb('0x15')],{'host':_0x4cdb('0x17'),'port':0x18eb});var socket=require(_0x4cdb('0x18'))(new Redis(config[_0x4cdb('0x15')]));require(_0x4cdb('0x19'))[_0x4cdb('0x1a')](socket);var jayson=require(_0x4cdb('0x1b'));var client=jayson[_0x4cdb('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0x4cdb('0x1c')][_0x4cdb('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x28e7c6,_0x4ac3e1,_0x280a06,_0x26d5bd){return new BPromise(function(_0x2bd40c,_0x255804){var _0x380eb7=_0x26d5bd||client;return _0x380eb7[_0x4cdb('0x1e')](_0x28e7c6,_0x280a06)[_0x4cdb('0x1f')](function(_0x2a7e95){logger[_0x4cdb('0x20')](_0x4cdb('0x21'),_0x4ac3e1,_0x4cdb('0x22'));logger[_0x4cdb('0x23')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4ac3e1,_0x4cdb('0x22'),JSON[_0x4cdb('0x24')](_0x2a7e95));if(_0x2a7e95[_0x4cdb('0x25')]){if(_0x2a7e95[_0x4cdb('0x25')][_0x4cdb('0x26')]===0x1f4){logger[_0x4cdb('0x25')](_0x4cdb('0x21'),_0x4ac3e1,_0x2a7e95['error'][_0x4cdb('0x27')]);return _0x255804(_0x2a7e95[_0x4cdb('0x25')][_0x4cdb('0x27')]);}logger[_0x4cdb('0x25')](_0x4cdb('0x21'),_0x4ac3e1,_0x2a7e95[_0x4cdb('0x25')][_0x4cdb('0x27')]);return _0x2bd40c(_0x2a7e95[_0x4cdb('0x25')][_0x4cdb('0x27')]);}else{logger[_0x4cdb('0x20')](_0x4cdb('0x21'),_0x4ac3e1,'request\x20sent');_0x2bd40c(_0x2a7e95[_0x4cdb('0x28')][_0x4cdb('0x27')]);}})[_0x4cdb('0x29')](function(_0x44a4a6){logger['error'](_0x4cdb('0x21'),_0x4ac3e1,_0x44a4a6);_0x255804(_0x44a4a6);});});}function respondWithStatusCode(_0x29680c,_0x2b8047){_0x2b8047=_0x2b8047||0xcc;return function(_0xa36cc2){if(_0xa36cc2){return _0x29680c[_0x4cdb('0x2a')](_0x2b8047);}return _0x29680c['status'](_0x2b8047)['end']();};}function respondWithResult(_0x22b6bf,_0xdb6cfe){_0xdb6cfe=_0xdb6cfe||0xc8;return function(_0x14b9df){if(_0x14b9df){return _0x22b6bf[_0x4cdb('0x2b')](_0xdb6cfe)[_0x4cdb('0x2c')](_0x14b9df);}};}function respondWithFilteredResult(_0x48ce9e,_0x413171){return function(_0x2d15b3){if(_0x2d15b3){var _0x203cdf=typeof _0x413171[_0x4cdb('0x2d')]===_0x4cdb('0x2e')&&typeof _0x413171['limit']==='undefined';var _0xf0621b=_0x2d15b3[_0x4cdb('0x2f')];var _0x2cd06e=_0x203cdf?0x0:_0x413171[_0x4cdb('0x2d')];var _0x34a4aa=_0x203cdf?_0x2d15b3[_0x4cdb('0x2f')]:_0x413171[_0x4cdb('0x2d')]+_0x413171[_0x4cdb('0x30')];var _0xc0efa9;if(_0x34a4aa>=_0xf0621b){_0x34a4aa=_0xf0621b;_0xc0efa9=0xc8;}else{_0xc0efa9=0xce;}_0x48ce9e[_0x4cdb('0x2b')](_0xc0efa9);return _0x48ce9e[_0x4cdb('0x31')]('Content-Range',_0x2cd06e+'-'+_0x34a4aa+'/'+_0xf0621b)[_0x4cdb('0x2c')](_0x2d15b3);}return null;};}function patchUpdates(_0x1995c5){return function(_0x4f67bd){try{jsonpatch[_0x4cdb('0x32')](_0x4f67bd,_0x1995c5,!![]);}catch(_0x446fa7){return BPromise['reject'](_0x446fa7);}return _0x4f67bd[_0x4cdb('0x33')]();};}function saveUpdates(_0x497867,_0x560aa5){return function(_0x21b80a){if(_0x21b80a){return _0x21b80a[_0x4cdb('0x34')](_0x497867)[_0x4cdb('0x1f')](function(_0x268ed5){return _0x268ed5;});}return null;};}function removeEntity(_0x312377,_0x3b7f5a){return function(_0x349a25){if(_0x349a25){return _0x349a25[_0x4cdb('0x35')]()[_0x4cdb('0x1f')](function(){_0x312377[_0x4cdb('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4457bc,_0x2b49aa){return function(_0x44d846){if(!_0x44d846){_0x4457bc[_0x4cdb('0x2a')](0x194);}return _0x44d846;};}function handleError(_0x2d1905,_0x3fee1d){_0x3fee1d=_0x3fee1d||0x1f4;return function(_0x3acdec){logger[_0x4cdb('0x25')](_0x3acdec['stack']);if(_0x3acdec[_0x4cdb('0x36')]){delete _0x3acdec[_0x4cdb('0x36')];}_0x2d1905[_0x4cdb('0x2b')](_0x3fee1d)[_0x4cdb('0x37')](_0x3acdec);};}exports[_0x4cdb('0x38')]=function(_0x19dc03,_0x1a8ca9){var _0x2e280c={},_0x43e1cb={},_0x4e981b={'count':0x0,'rows':[]};var _0x10a553=_[_0x4cdb('0x39')](db[_0x4cdb('0x3a')][_0x4cdb('0x3b')],function(_0x4fa43b){return{'name':_0x4fa43b['fieldName'],'type':_0x4fa43b[_0x4cdb('0x3c')][_0x4cdb('0x3d')]};});_0x43e1cb[_0x4cdb('0x3e')]=_['map'](_0x10a553,_0x4cdb('0x36'));_0x43e1cb[_0x4cdb('0x3f')]=_[_0x4cdb('0x40')](_0x19dc03[_0x4cdb('0x3f')]);_0x43e1cb['filters']=_[_0x4cdb('0x41')](_0x43e1cb[_0x4cdb('0x3e')],_0x43e1cb[_0x4cdb('0x3f')]);_0x2e280c['attributes']=_[_0x4cdb('0x41')](_0x43e1cb[_0x4cdb('0x3e')],qs['fields'](_0x19dc03[_0x4cdb('0x3f')][_0x4cdb('0x42')]));_0x2e280c[_0x4cdb('0x43')]=_0x2e280c[_0x4cdb('0x43')]['length']?_0x2e280c[_0x4cdb('0x43')]:_0x43e1cb['model'];if(!_0x19dc03[_0x4cdb('0x3f')][_0x4cdb('0x44')](_0x4cdb('0x45'))){_0x2e280c[_0x4cdb('0x30')]=qs[_0x4cdb('0x30')](_0x19dc03[_0x4cdb('0x3f')][_0x4cdb('0x30')]);_0x2e280c[_0x4cdb('0x2d')]=qs[_0x4cdb('0x2d')](_0x19dc03[_0x4cdb('0x3f')][_0x4cdb('0x2d')]);}_0x2e280c['order']=qs[_0x4cdb('0x46')](_0x19dc03[_0x4cdb('0x3f')][_0x4cdb('0x46')]);_0x2e280c['where']=qs[_0x4cdb('0x47')](_['pick'](_0x19dc03[_0x4cdb('0x3f')],_0x43e1cb['filters']),_0x10a553);if(_0x19dc03[_0x4cdb('0x3f')][_0x4cdb('0x48')]){_0x2e280c[_0x4cdb('0x49')]=_[_0x4cdb('0x4a')](_0x2e280c[_0x4cdb('0x49')],{'$or':_[_0x4cdb('0x39')](_0x10a553,function(_0x2231a5){if(_0x2231a5[_0x4cdb('0x3c')]!==_0x4cdb('0x4b')){var _0x4708f9={};_0x4708f9[_0x2231a5[_0x4cdb('0x36')]]={'$like':'%'+_0x19dc03[_0x4cdb('0x3f')][_0x4cdb('0x48')]+'%'};return _0x4708f9;}})});}_0x2e280c=_[_0x4cdb('0x4a')]({},_0x2e280c,_0x19dc03[_0x4cdb('0x4c')]);var _0x530909={'where':_0x2e280c['where']};return db['SmsMessage'][_0x4cdb('0x2f')](_0x530909)['then'](function(_0x9f3744){_0x4e981b['count']=_0x9f3744;if(_0x19dc03[_0x4cdb('0x3f')][_0x4cdb('0x4d')]){_0x2e280c[_0x4cdb('0x4e')]=[{'all':!![]}];}return db[_0x4cdb('0x3a')][_0x4cdb('0x4f')](_0x2e280c);})['then'](function(_0x11143d){_0x4e981b[_0x4cdb('0x50')]=_0x11143d;return _0x4e981b;})[_0x4cdb('0x1f')](respondWithFilteredResult(_0x1a8ca9,_0x2e280c))[_0x4cdb('0x29')](handleError(_0x1a8ca9,null));};exports[_0x4cdb('0x51')]=function(_0x21e815,_0x23db67){var _0x2f7b87={'raw':!![],'where':{'id':_0x21e815[_0x4cdb('0x52')]['id']}},_0x3392ea={};_0x3392ea[_0x4cdb('0x3e')]=_[_0x4cdb('0x40')](db[_0x4cdb('0x3a')][_0x4cdb('0x3b')]);_0x3392ea[_0x4cdb('0x3f')]=_[_0x4cdb('0x40')](_0x21e815['query']);_0x3392ea['filters']=_[_0x4cdb('0x41')](_0x3392ea[_0x4cdb('0x3e')],_0x3392ea[_0x4cdb('0x3f')]);_0x2f7b87[_0x4cdb('0x43')]=_[_0x4cdb('0x41')](_0x3392ea[_0x4cdb('0x3e')],qs['fields'](_0x21e815[_0x4cdb('0x3f')][_0x4cdb('0x42')]));_0x2f7b87['attributes']=_0x2f7b87[_0x4cdb('0x43')][_0x4cdb('0x53')]?_0x2f7b87[_0x4cdb('0x43')]:_0x3392ea[_0x4cdb('0x3e')];if(_0x21e815[_0x4cdb('0x3f')][_0x4cdb('0x4d')]){_0x2f7b87['include']=[{'all':!![]}];}_0x2f7b87=_[_0x4cdb('0x4a')]({},_0x2f7b87,_0x21e815[_0x4cdb('0x4c')]);return db[_0x4cdb('0x3a')][_0x4cdb('0x54')](_0x2f7b87)[_0x4cdb('0x1f')](handleEntityNotFound(_0x23db67,null))['then'](respondWithResult(_0x23db67,null))['catch'](handleError(_0x23db67,null));};exports[_0x4cdb('0x55')]=function(_0x17fbc6,_0x1d5944){return db[_0x4cdb('0x3a')]['create'](_0x17fbc6[_0x4cdb('0x56')],{})['then'](respondWithResult(_0x1d5944,0xc9))[_0x4cdb('0x29')](handleError(_0x1d5944,null));};exports[_0x4cdb('0x34')]=function(_0xb25014,_0x2255c2){if(_0xb25014[_0x4cdb('0x56')]['id']){delete _0xb25014['body']['id'];}return db[_0x4cdb('0x3a')]['find']({'where':{'id':_0xb25014['params']['id']}})['then'](handleEntityNotFound(_0x2255c2,null))[_0x4cdb('0x1f')](saveUpdates(_0xb25014['body'],null))[_0x4cdb('0x1f')](respondWithResult(_0x2255c2,null))[_0x4cdb('0x29')](handleError(_0x2255c2,null));};exports[_0x4cdb('0x35')]=function(_0x5b9153,_0xd1f6f9){return db[_0x4cdb('0x3a')][_0x4cdb('0x54')]({'where':{'id':_0x5b9153[_0x4cdb('0x52')]['id']}})[_0x4cdb('0x1f')](handleEntityNotFound(_0xd1f6f9,null))[_0x4cdb('0x1f')](removeEntity(_0xd1f6f9,null))['catch'](handleError(_0xd1f6f9,null));};exports['describe']=function(_0x3c9074,_0x5c00ed){return db[_0x4cdb('0x3a')][_0x4cdb('0x57')]()[_0x4cdb('0x1f')](respondWithResult(_0x5c00ed,null))[_0x4cdb('0x29')](handleError(_0x5c00ed,null));};var interaction_log=require(_0x4cdb('0x11'))('sms-interactions');exports[_0x4cdb('0x58')]=function(_0x52e1a3,_0x23204f,_0x4c3c10){var _0x4fa65d={'agent':{},'channel':'sms'};if(_0x52e1a3[_0x4cdb('0x56')]['id']){delete _0x52e1a3[_0x4cdb('0x56')]['id'];}_0x52e1a3[_0x4cdb('0x56')]['read']=!![];_0x52e1a3[_0x4cdb('0x56')][_0x4cdb('0x59')]=moment()[_0x4cdb('0x5a')](_0x4cdb('0x5b'));_0x52e1a3[_0x4cdb('0x56')][_0x4cdb('0x5c')]=_0x52e1a3[_0x4cdb('0x56')][_0x4cdb('0x5c')]||_0x52e1a3['user']['id'];_0x4fa65d['agent']['id']=_0x52e1a3['body'][_0x4cdb('0x5c')];return db[_0x4cdb('0x3a')][_0x4cdb('0x54')]({'where':{'id':_0x52e1a3[_0x4cdb('0x52')]['id'],'UserId':null}})[_0x4cdb('0x1f')](handleEntityNotFound(_0x23204f,null))[_0x4cdb('0x1f')](saveUpdates(_0x52e1a3[_0x4cdb('0x56')],null))['then'](function(_0x501422){if(_0x501422){_0x4fa65d[_0x4cdb('0x27')]=_0x501422[_0x4cdb('0x5d')]({'plain':!![]});return db[_0x4cdb('0x5e')][_0x4cdb('0x54')]({'where':{'id':_0x501422['SmsInteractionId']}});}return null;})[_0x4cdb('0x1f')](handleEntityNotFound(_0x23204f,null))[_0x4cdb('0x1f')](function(_0x33f10d){if(_0x33f10d){return _0x33f10d[_0x4cdb('0x34')]({'UserId':_0x52e1a3[_0x4cdb('0x56')][_0x4cdb('0x5c')],'read1stAt':_[_0x4cdb('0x5f')](_0x33f10d['read1stAt'])?moment()['format'](_0x4cdb('0x5b')):undefined});}return null;})['then'](function(_0x2e4c84){if(_0x2e4c84){_0x4fa65d[_0x4cdb('0x60')]=_0x2e4c84[_0x4cdb('0x5d')]({'plain':!![]});interaction_log[_0x4cdb('0x20')](_0x4cdb('0x61'),_0x52e1a3[_0x4cdb('0x62')]['id'],_0x52e1a3[_0x4cdb('0x62')]['name'],_0x52e1a3[_0x4cdb('0x62')][_0x4cdb('0x63')],_0x4fa65d[_0x4cdb('0x60')]['id'],_0x52e1a3['body']?JSON[_0x4cdb('0x24')](_0x52e1a3[_0x4cdb('0x56')]):'null');return respondWithRpcPromise(_0x4cdb('0x64'),_0x4cdb('0x65'),_0x4fa65d);}return null;})[_0x4cdb('0x1f')](function(_0x7b969d){var _0xfc695f='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x7b969d['message'][_0x4cdb('0x66')];return db[_0x4cdb('0x67')][_0x4cdb('0x3f')](_0xfc695f,{'type':db[_0x4cdb('0x68')][_0x4cdb('0x69')][_0x4cdb('0x6a')],'raw':!![]})[_0x4cdb('0x1f')](function(_0x437af3){return _0x437af3;});})[_0x4cdb('0x1f')](function(_0x291f5a){if(_0x291f5a){_0x4fa65d[_0x4cdb('0x27')]['contact']=_0x291f5a[0x0];if(!_0x52e1a3['body'][_0x4cdb('0x5c')])return;return db['User'][_0x4cdb('0x54')]({'where':{'id':_0x52e1a3[_0x4cdb('0x56')]['UserId'],'role':_0x4cdb('0x6b')},'attributes':['id','name',_0x4cdb('0x6c'),'email','internal'],'raw':!![]});}return null;})[_0x4cdb('0x1f')](function(_0x3cb1bb){if(!_0x3cb1bb)return null;_0x4fa65d[_0x4cdb('0x27')]['agent']=_0x3cb1bb;return _0x4fa65d;})['then'](function(_0x24f4ae){if(_0x24f4ae){if(_0x52e1a3[_0x4cdb('0x56')][_0x4cdb('0x6d')]){_0x4fa65d[_0x4cdb('0x27')][_0x4cdb('0x6e')]=util[_0x4cdb('0x5a')](_0x4cdb('0x6f'),_0x52e1a3[_0x4cdb('0x62')][_0x4cdb('0x36')]);_0x4fa65d[_0x4cdb('0x27')][_0x4cdb('0x70')]=_0x4fa65d['channel'];_0x4fa65d[_0x4cdb('0x27')][_0x4cdb('0x71')]=_0x4fa65d[_0x4cdb('0x70')];_0x4fa65d[_0x4cdb('0x27')][_0x4cdb('0x72')]=_0x4cdb('0x58');return respondWithRpcPromise(_0x4cdb('0x73'),'EventManager',{'event':_0x4cdb('0x74'),'message':_0x4fa65d[_0x4cdb('0x27')]},client9002)['then'](function(){return _0x4fa65d;});}return _0x4fa65d;}return null;})[_0x4cdb('0x1f')](respondWithResult(_0x23204f,null))[_0x4cdb('0x29')](handleError(_0x23204f,null));};var interaction_log=require('../../config/logger')(_0x4cdb('0x75'));exports[_0x4cdb('0x76')]=function(_0x521040,_0x16c6b8,_0x278274){var _0x3258a3={'agent':{},'channel':'sms'};if(_0x521040[_0x4cdb('0x56')]['id']){delete _0x521040['body']['id'];}_0x521040[_0x4cdb('0x56')][_0x4cdb('0x5c')]=_0x521040[_0x4cdb('0x56')][_0x4cdb('0x5c')]||_0x521040[_0x4cdb('0x62')]['id'];_0x3258a3['agent']['id']=_0x521040[_0x4cdb('0x56')]['UserId'];return db['SmsMessage'][_0x4cdb('0x54')]({'where':{'id':_0x521040['params']['id'],'UserId':null}})[_0x4cdb('0x1f')](handleEntityNotFound(_0x16c6b8,null))[_0x4cdb('0x1f')](function(_0x4aee58){if(_0x4aee58){_0x3258a3['message']=_0x4aee58['get']({'plain':!![]});return db[_0x4cdb('0x5e')][_0x4cdb('0x54')]({'where':{'id':_0x4aee58[_0x4cdb('0x77')]}});}return null;})[_0x4cdb('0x1f')](handleEntityNotFound(_0x16c6b8,null))['then'](function(_0x3aa096){if(_0x3aa096){_0x3258a3[_0x4cdb('0x60')]=_0x3aa096[_0x4cdb('0x5d')]({'plain':!![]});interaction_log[_0x4cdb('0x20')](_0x4cdb('0x78'),_0x521040[_0x4cdb('0x62')]['id'],_0x521040[_0x4cdb('0x62')][_0x4cdb('0x36')],_0x521040[_0x4cdb('0x62')][_0x4cdb('0x63')],_0x3258a3[_0x4cdb('0x60')]['id'],_0x521040[_0x4cdb('0x56')]?JSON[_0x4cdb('0x24')](_0x521040[_0x4cdb('0x56')]):_0x4cdb('0x79'));return respondWithRpcPromise('RejectMessage',_0x4cdb('0x7a'),_0x3258a3);}return null;})['then'](function(_0x181bb8){var _0x7854be=_0x4cdb('0x7b')+_0x181bb8['message'][_0x4cdb('0x66')];return db[_0x4cdb('0x67')][_0x4cdb('0x3f')](_0x7854be,{'type':db['Sequelize'][_0x4cdb('0x69')][_0x4cdb('0x6a')],'raw':!![]})[_0x4cdb('0x1f')](function(_0x3bb955){return _0x3bb955;});})['then'](function(_0x423215){if(_0x423215){_0x3258a3[_0x4cdb('0x27')][_0x4cdb('0x7c')]=_0x423215[0x0];if(!_0x521040['body'][_0x4cdb('0x5c')])return;return db[_0x4cdb('0x7d')]['find']({'where':{'id':_0x521040[_0x4cdb('0x56')][_0x4cdb('0x5c')],'role':_0x4cdb('0x6b')},'attributes':['id',_0x4cdb('0x36'),'fullname','email',_0x4cdb('0x7e')],'raw':!![]});}return null;})['then'](function(_0x28ff44){if(!_0x28ff44)return null;_0x3258a3[_0x4cdb('0x27')][_0x4cdb('0x6b')]=_0x28ff44;return _0x3258a3;})[_0x4cdb('0x1f')](function(_0x43ccbf){if(_0x43ccbf){_0x43ccbf['message']['interface']=util['format'](_0x4cdb('0x6f'),_0x521040[_0x4cdb('0x62')][_0x4cdb('0x36')]);_0x43ccbf[_0x4cdb('0x27')][_0x4cdb('0x70')]=_0x3258a3[_0x4cdb('0x70')];_0x43ccbf[_0x4cdb('0x27')][_0x4cdb('0x71')]=_0x3258a3[_0x4cdb('0x70')];_0x43ccbf[_0x4cdb('0x27')]['event']=_0x4cdb('0x76');respondWithRpcPromise(_0x4cdb('0x73'),_0x4cdb('0x73'),{'event':_0x4cdb('0x7f'),'message':_0x43ccbf[_0x4cdb('0x27')]},client9002);return _0x3258a3;}return null;})[_0x4cdb('0x1f')](respondWithResult(_0x16c6b8,null))['catch'](handleError(_0x16c6b8,null));};exports['status']=function(_0x337be5,_0x132782,_0x545c3d){if(_0x337be5[_0x4cdb('0x56')]['id']){delete _0x337be5[_0x4cdb('0x56')]['id'];}var _0x40e6f4;return db[_0x4cdb('0x3a')]['find']({'where':{'id':_0x337be5[_0x4cdb('0x52')]['id']}})[_0x4cdb('0x1f')](handleEntityNotFound(_0x132782,null))[_0x4cdb('0x1f')](function(_0x963f2a){if(_0x963f2a){_0x40e6f4=_0x963f2a;return db['SmsAccount'][_0x4cdb('0x54')]({'where':{'id':_0x963f2a[_0x4cdb('0x80')]}});}})[_0x4cdb('0x1f')](handleEntityNotFound(_0x132782,null))['then'](function(_0x3f3b7d){if(_0x3f3b7d){logger[_0x4cdb('0x23')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4cdb('0x2b'),'received\x20delivery\x20report\x20from',_0x3f3b7d[_0x4cdb('0x3c')],util[_0x4cdb('0x81')](_0x337be5['body'],{'showHidden':![],'depth':null}));switch(_0x3f3b7d[_0x4cdb('0x3c')]){case'twilio':if(_0x337be5[_0x4cdb('0x56')][_0x4cdb('0x82')]&&_0x337be5['body'][_0x4cdb('0x82')]===_0x40e6f4[_0x4cdb('0x83')]){return _0x40e6f4[_0x4cdb('0x34')]({'read':!![]});}else{logger[_0x4cdb('0x25')](_0x4cdb('0x84'),_0x4cdb('0x2b'),_0x4cdb('0x85'),util['inspect'](_0x337be5[_0x4cdb('0x56')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x337be5[_0x4cdb('0x56')][_0x4cdb('0x86')]&&_0x337be5[_0x4cdb('0x56')][_0x4cdb('0x86')]===_0x40e6f4['messageId']&&_[_0x4cdb('0x87')]([_0x4cdb('0x88'),_0x4cdb('0x89')],_0x337be5[_0x4cdb('0x56')][_0x4cdb('0x8a')])>=0x0){return _0x40e6f4[_0x4cdb('0x34')]({'read':!![]});}else{logger[_0x4cdb('0x25')](_0x4cdb('0x84'),_0x4cdb('0x2b'),_0x4cdb('0x8b'),util[_0x4cdb('0x81')](_0x337be5[_0x4cdb('0x56')],{'showHidden':![],'depth':null}));}break;case _0x4cdb('0x8c'):var _0x7f8844=_0x337be5['body'][_0x4cdb('0x8d')][0x0];if(_0x7f8844[_0x4cdb('0x2b')]['groupName']===_0x4cdb('0x8e')){return _0x40e6f4[_0x4cdb('0x34')]({'read':!![]});}else{logger['error'](_0x4cdb('0x84'),'status','infobip',util[_0x4cdb('0x81')](_0x337be5[_0x4cdb('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x40e6f4;}})[_0x4cdb('0x1f')](respondWithResult(_0x132782,null))[_0x4cdb('0x29')](handleError(_0x132782,null));}; \ No newline at end of file +var _0xb235=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','stack','name','send','map','SmsMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','VIRTUAL','filter','options','includeAll','findAll','rows','show','include','find','create','body','params','describe','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','stringify','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','interface','channel','event','EventManager','acceptmessage','sms-interactions','sms','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','sequelize','SIP/%s','motionChannel','rejectmessage','SmsAccount','debug','inspect','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','plivo','sent','delivered','Status','plivio','infobip','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','desk.js','papaparse','ioredis','../../components/auth/service'];(function(_0x231a8a,_0x20b10d){var _0x5597fa=function(_0x10f17c){while(--_0x10f17c){_0x231a8a['push'](_0x231a8a['shift']());}};_0x5597fa(++_0x20b10d);}(_0xb235,0x10d));var _0x5b23=function(_0xd22d95,_0xc59f8f){_0xd22d95=_0xd22d95-0x0;var _0x15d7a3=_0xb235[_0xd22d95];return _0x15d7a3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5b23('0x0'));var rp=require(_0x5b23('0x1'));var moment=require(_0x5b23('0x2'));var BPromise=require(_0x5b23('0x3'));var Mustache=require(_0x5b23('0x4'));var util=require(_0x5b23('0x5'));var path=require(_0x5b23('0x6'));var sox=require('sox');var csv=require(_0x5b23('0x7'));var ejs=require(_0x5b23('0x8'));var fs=require('fs');var fs_extra=require(_0x5b23('0x9'));var _=require('lodash');var squel=require(_0x5b23('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5b23('0xb'));var toCsv=require(_0x5b23('0x7'));var querystring=require('querystring');var Papa=require(_0x5b23('0xc'));var Redis=require(_0x5b23('0xd'));var authService=require(_0x5b23('0xe'));var qs=require(_0x5b23('0xf'));var as=require(_0x5b23('0x10'));var hardwareService=require(_0x5b23('0x11'));var logger=require(_0x5b23('0x12'))(_0x5b23('0x13'));var utils=require(_0x5b23('0x14'));var config=require(_0x5b23('0x15'));var licenseUtil=require(_0x5b23('0x16'));var db=require('../../mysqldb')['db'];config[_0x5b23('0x17')]=_[_0x5b23('0x18')](config[_0x5b23('0x17')],{'host':_0x5b23('0x19'),'port':0x18eb});var socket=require(_0x5b23('0x1a'))(new Redis(config[_0x5b23('0x17')]));require('./smsMessage.socket')[_0x5b23('0x1b')](socket);var jayson=require(_0x5b23('0x1c'));var client=jayson[_0x5b23('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0x5b23('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e0f88,_0x3c9db5,_0x311f01,_0xb501ec){return new BPromise(function(_0x113022,_0x1c1226){var _0x44a8d3=_0xb501ec||client;return _0x44a8d3[_0x5b23('0x1e')](_0x4e0f88,_0x311f01)[_0x5b23('0x1f')](function(_0x2ad9b7){logger[_0x5b23('0x20')](_0x5b23('0x21'),_0x3c9db5,_0x5b23('0x22'));logger['debug'](_0x5b23('0x23'),_0x3c9db5,_0x5b23('0x22'),JSON['stringify'](_0x2ad9b7));if(_0x2ad9b7['error']){if(_0x2ad9b7[_0x5b23('0x24')][_0x5b23('0x25')]===0x1f4){logger[_0x5b23('0x24')](_0x5b23('0x21'),_0x3c9db5,_0x2ad9b7[_0x5b23('0x24')][_0x5b23('0x26')]);return _0x1c1226(_0x2ad9b7['error'][_0x5b23('0x26')]);}logger[_0x5b23('0x24')](_0x5b23('0x21'),_0x3c9db5,_0x2ad9b7[_0x5b23('0x24')][_0x5b23('0x26')]);return _0x113022(_0x2ad9b7[_0x5b23('0x24')][_0x5b23('0x26')]);}else{logger[_0x5b23('0x20')]('SmsMessage,\x20%s,\x20%s',_0x3c9db5,_0x5b23('0x22'));_0x113022(_0x2ad9b7[_0x5b23('0x27')][_0x5b23('0x26')]);}})[_0x5b23('0x28')](function(_0x19b123){logger['error'](_0x5b23('0x21'),_0x3c9db5,_0x19b123);_0x1c1226(_0x19b123);});});}function respondWithStatusCode(_0x5e8d24,_0x2ef6c4){_0x2ef6c4=_0x2ef6c4||0xcc;return function(_0x1bac1f){if(_0x1bac1f){return _0x5e8d24[_0x5b23('0x29')](_0x2ef6c4);}return _0x5e8d24[_0x5b23('0x2a')](_0x2ef6c4)['end']();};}function respondWithResult(_0x4092c3,_0x5e71c2){_0x5e71c2=_0x5e71c2||0xc8;return function(_0x23f39a){if(_0x23f39a){return _0x4092c3['status'](_0x5e71c2)[_0x5b23('0x2b')](_0x23f39a);}};}function respondWithFilteredResult(_0x125850,_0x802f77){return function(_0x3511f3){if(_0x3511f3){var _0x29d1ca=typeof _0x802f77[_0x5b23('0x2c')]==='undefined'&&typeof _0x802f77[_0x5b23('0x2d')]===_0x5b23('0x2e');var _0x2c4f28=_0x3511f3[_0x5b23('0x2f')];var _0x3e5c5e=_0x29d1ca?0x0:_0x802f77[_0x5b23('0x2c')];var _0x610256=_0x29d1ca?_0x3511f3['count']:_0x802f77[_0x5b23('0x2c')]+_0x802f77['limit'];var _0x481218;if(_0x610256>=_0x2c4f28){_0x610256=_0x2c4f28;_0x481218=0xc8;}else{_0x481218=0xce;}_0x125850[_0x5b23('0x2a')](_0x481218);return _0x125850['set'](_0x5b23('0x30'),_0x3e5c5e+'-'+_0x610256+'/'+_0x2c4f28)[_0x5b23('0x2b')](_0x3511f3);}return null;};}function patchUpdates(_0x274474){return function(_0x45a049){try{jsonpatch[_0x5b23('0x31')](_0x45a049,_0x274474,!![]);}catch(_0x552ea6){return BPromise[_0x5b23('0x32')](_0x552ea6);}return _0x45a049[_0x5b23('0x33')]();};}function saveUpdates(_0x2df0c8,_0xdfde65){return function(_0x3465c7){if(_0x3465c7){return _0x3465c7[_0x5b23('0x34')](_0x2df0c8)[_0x5b23('0x1f')](function(_0x228b87){return _0x228b87;});}return null;};}function removeEntity(_0x14ec8b,_0x4c2d92){return function(_0x2bb095){if(_0x2bb095){return _0x2bb095[_0x5b23('0x35')]()[_0x5b23('0x1f')](function(){_0x14ec8b[_0x5b23('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33d389,_0x4df653){return function(_0x43a236){if(!_0x43a236){_0x33d389['sendStatus'](0x194);}return _0x43a236;};}function handleError(_0x4321c9,_0x210b3e){_0x210b3e=_0x210b3e||0x1f4;return function(_0x51db8c){logger[_0x5b23('0x24')](_0x51db8c[_0x5b23('0x36')]);if(_0x51db8c[_0x5b23('0x37')]){delete _0x51db8c['name'];}_0x4321c9[_0x5b23('0x2a')](_0x210b3e)[_0x5b23('0x38')](_0x51db8c);};}exports['index']=function(_0x32661c,_0x5abdce){var _0x3ceecd={},_0x57475f={},_0x2534df={'count':0x0,'rows':[]};var _0x69f9c4=_[_0x5b23('0x39')](db[_0x5b23('0x3a')][_0x5b23('0x3b')],function(_0x20c4e8){return{'name':_0x20c4e8[_0x5b23('0x3c')],'type':_0x20c4e8[_0x5b23('0x3d')][_0x5b23('0x3e')]};});_0x57475f[_0x5b23('0x3f')]=_[_0x5b23('0x39')](_0x69f9c4,'name');_0x57475f[_0x5b23('0x40')]=_[_0x5b23('0x41')](_0x32661c[_0x5b23('0x40')]);_0x57475f[_0x5b23('0x42')]=_[_0x5b23('0x43')](_0x57475f[_0x5b23('0x3f')],_0x57475f[_0x5b23('0x40')]);_0x3ceecd['attributes']=_[_0x5b23('0x43')](_0x57475f[_0x5b23('0x3f')],qs['fields'](_0x32661c['query'][_0x5b23('0x44')]));_0x3ceecd[_0x5b23('0x45')]=_0x3ceecd[_0x5b23('0x45')][_0x5b23('0x46')]?_0x3ceecd[_0x5b23('0x45')]:_0x57475f[_0x5b23('0x3f')];if(!_0x32661c['query'][_0x5b23('0x47')]('nolimit')){_0x3ceecd[_0x5b23('0x2d')]=qs[_0x5b23('0x2d')](_0x32661c[_0x5b23('0x40')][_0x5b23('0x2d')]);_0x3ceecd[_0x5b23('0x2c')]=qs[_0x5b23('0x2c')](_0x32661c['query'][_0x5b23('0x2c')]);}_0x3ceecd[_0x5b23('0x48')]=qs[_0x5b23('0x49')](_0x32661c[_0x5b23('0x40')]['sort']);_0x3ceecd[_0x5b23('0x4a')]=qs['filters'](_['pick'](_0x32661c[_0x5b23('0x40')],_0x57475f['filters']),_0x69f9c4);if(_0x32661c[_0x5b23('0x40')]['filter']){_0x3ceecd[_0x5b23('0x4a')]=_['merge'](_0x3ceecd['where'],{'$or':_[_0x5b23('0x39')](_0x69f9c4,function(_0x22b8f3){if(_0x22b8f3[_0x5b23('0x3d')]!==_0x5b23('0x4b')){var _0x210e7a={};_0x210e7a[_0x22b8f3['name']]={'$like':'%'+_0x32661c[_0x5b23('0x40')][_0x5b23('0x4c')]+'%'};return _0x210e7a;}})});}_0x3ceecd=_['merge']({},_0x3ceecd,_0x32661c[_0x5b23('0x4d')]);var _0x6404d2={'where':_0x3ceecd[_0x5b23('0x4a')]};return db[_0x5b23('0x3a')]['count'](_0x6404d2)[_0x5b23('0x1f')](function(_0x4bf55e){_0x2534df['count']=_0x4bf55e;if(_0x32661c[_0x5b23('0x40')][_0x5b23('0x4e')]){_0x3ceecd['include']=[{'all':!![]}];}return db[_0x5b23('0x3a')][_0x5b23('0x4f')](_0x3ceecd);})[_0x5b23('0x1f')](function(_0x542916){_0x2534df[_0x5b23('0x50')]=_0x542916;return _0x2534df;})['then'](respondWithFilteredResult(_0x5abdce,_0x3ceecd))[_0x5b23('0x28')](handleError(_0x5abdce,null));};exports[_0x5b23('0x51')]=function(_0x22c9f8,_0x2c44d6){var _0x4ca9c7={'raw':!![],'where':{'id':_0x22c9f8['params']['id']}},_0x3ada2f={};_0x3ada2f['model']=_[_0x5b23('0x41')](db[_0x5b23('0x3a')][_0x5b23('0x3b')]);_0x3ada2f['query']=_[_0x5b23('0x41')](_0x22c9f8[_0x5b23('0x40')]);_0x3ada2f['filters']=_[_0x5b23('0x43')](_0x3ada2f[_0x5b23('0x3f')],_0x3ada2f[_0x5b23('0x40')]);_0x4ca9c7[_0x5b23('0x45')]=_[_0x5b23('0x43')](_0x3ada2f['model'],qs['fields'](_0x22c9f8[_0x5b23('0x40')][_0x5b23('0x44')]));_0x4ca9c7[_0x5b23('0x45')]=_0x4ca9c7['attributes'][_0x5b23('0x46')]?_0x4ca9c7[_0x5b23('0x45')]:_0x3ada2f[_0x5b23('0x3f')];if(_0x22c9f8[_0x5b23('0x40')][_0x5b23('0x4e')]){_0x4ca9c7[_0x5b23('0x52')]=[{'all':!![]}];}_0x4ca9c7=_['merge']({},_0x4ca9c7,_0x22c9f8[_0x5b23('0x4d')]);return db[_0x5b23('0x3a')][_0x5b23('0x53')](_0x4ca9c7)[_0x5b23('0x1f')](handleEntityNotFound(_0x2c44d6,null))['then'](respondWithResult(_0x2c44d6,null))[_0x5b23('0x28')](handleError(_0x2c44d6,null));};exports[_0x5b23('0x54')]=function(_0x519749,_0x3475a0){return db['SmsMessage'][_0x5b23('0x54')](_0x519749[_0x5b23('0x55')],{})[_0x5b23('0x1f')](respondWithResult(_0x3475a0,0xc9))[_0x5b23('0x28')](handleError(_0x3475a0,null));};exports[_0x5b23('0x34')]=function(_0x556419,_0x1bcf22){if(_0x556419[_0x5b23('0x55')]['id']){delete _0x556419[_0x5b23('0x55')]['id'];}return db[_0x5b23('0x3a')]['find']({'where':{'id':_0x556419[_0x5b23('0x56')]['id']}})['then'](handleEntityNotFound(_0x1bcf22,null))[_0x5b23('0x1f')](saveUpdates(_0x556419[_0x5b23('0x55')],null))[_0x5b23('0x1f')](respondWithResult(_0x1bcf22,null))[_0x5b23('0x28')](handleError(_0x1bcf22,null));};exports['destroy']=function(_0x1f743e,_0x2c4548){return db[_0x5b23('0x3a')][_0x5b23('0x53')]({'where':{'id':_0x1f743e[_0x5b23('0x56')]['id']}})['then'](handleEntityNotFound(_0x2c4548,null))[_0x5b23('0x1f')](removeEntity(_0x2c4548,null))[_0x5b23('0x28')](handleError(_0x2c4548,null));};exports[_0x5b23('0x57')]=function(_0x26fd26,_0x3b093e){return db[_0x5b23('0x3a')][_0x5b23('0x57')]()[_0x5b23('0x1f')](respondWithResult(_0x3b093e,null))[_0x5b23('0x28')](handleError(_0x3b093e,null));};var interaction_log=require(_0x5b23('0x12'))('sms-interactions');exports[_0x5b23('0x58')]=function(_0x14feca,_0x2d44f3,_0x4f205a){var _0x49b1d7={'agent':{},'channel':'sms'};if(_0x14feca[_0x5b23('0x55')]['id']){delete _0x14feca[_0x5b23('0x55')]['id'];}_0x14feca['body']['read']=!![];_0x14feca[_0x5b23('0x55')][_0x5b23('0x59')]=moment()[_0x5b23('0x5a')](_0x5b23('0x5b'));_0x14feca[_0x5b23('0x55')][_0x5b23('0x5c')]=_0x14feca[_0x5b23('0x55')][_0x5b23('0x5c')]||_0x14feca[_0x5b23('0x5d')]['id'];_0x49b1d7['agent']['id']=_0x14feca[_0x5b23('0x55')][_0x5b23('0x5c')];return db[_0x5b23('0x3a')][_0x5b23('0x53')]({'where':{'id':_0x14feca['params']['id'],'UserId':null}})[_0x5b23('0x1f')](handleEntityNotFound(_0x2d44f3,null))[_0x5b23('0x1f')](saveUpdates(_0x14feca['body'],null))['then'](function(_0x5a9528){if(_0x5a9528){_0x49b1d7[_0x5b23('0x26')]=_0x5a9528[_0x5b23('0x5e')]({'plain':!![]});return db[_0x5b23('0x5f')]['find']({'where':{'id':_0x5a9528[_0x5b23('0x60')]}});}return null;})[_0x5b23('0x1f')](handleEntityNotFound(_0x2d44f3,null))[_0x5b23('0x1f')](function(_0x408415){if(_0x408415){return _0x408415['update']({'UserId':_0x14feca[_0x5b23('0x55')][_0x5b23('0x5c')],'read1stAt':_[_0x5b23('0x61')](_0x408415[_0x5b23('0x62')])?moment()[_0x5b23('0x5a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x33c937){if(_0x33c937){_0x49b1d7['interaction']=_0x33c937[_0x5b23('0x5e')]({'plain':!![]});interaction_log[_0x5b23('0x20')](_0x5b23('0x63'),_0x14feca['user']['id'],_0x14feca[_0x5b23('0x5d')][_0x5b23('0x37')],_0x14feca['user']['role'],_0x49b1d7[_0x5b23('0x64')]['id'],_0x14feca[_0x5b23('0x55')]?JSON[_0x5b23('0x65')](_0x14feca[_0x5b23('0x55')]):'null');return respondWithRpcPromise(_0x5b23('0x66'),_0x5b23('0x67'),_0x49b1d7);}return null;})[_0x5b23('0x1f')](function(_0x2ec21e){var _0xb88d7=_0x5b23('0x68')+_0x2ec21e[_0x5b23('0x26')][_0x5b23('0x69')];return db['sequelize'][_0x5b23('0x40')](_0xb88d7,{'type':db[_0x5b23('0x6a')][_0x5b23('0x6b')][_0x5b23('0x6c')],'raw':!![]})[_0x5b23('0x1f')](function(_0x5d28d1){return _0x5d28d1;});})[_0x5b23('0x1f')](function(_0x2595e6){if(_0x2595e6){_0x49b1d7[_0x5b23('0x26')][_0x5b23('0x6d')]=_0x2595e6[0x0];if(!_0x14feca[_0x5b23('0x55')]['UserId'])return;return db[_0x5b23('0x6e')][_0x5b23('0x53')]({'where':{'id':_0x14feca['body']['UserId'],'role':_0x5b23('0x6f')},'attributes':['id',_0x5b23('0x37'),_0x5b23('0x70'),_0x5b23('0x71'),_0x5b23('0x72')],'raw':!![]});}return null;})[_0x5b23('0x1f')](function(_0x5d250d){if(!_0x5d250d)return null;_0x49b1d7[_0x5b23('0x26')][_0x5b23('0x6f')]=_0x5d250d;return _0x49b1d7;})['then'](function(_0x3cac71){if(_0x3cac71){if(_0x14feca[_0x5b23('0x55')]['manual']){_0x49b1d7[_0x5b23('0x26')][_0x5b23('0x73')]=util[_0x5b23('0x5a')]('SIP/%s',_0x14feca[_0x5b23('0x5d')][_0x5b23('0x37')]);_0x49b1d7[_0x5b23('0x26')]['channel']=_0x49b1d7[_0x5b23('0x74')];_0x49b1d7[_0x5b23('0x26')]['motionChannel']=_0x49b1d7[_0x5b23('0x74')];_0x49b1d7[_0x5b23('0x26')][_0x5b23('0x75')]=_0x5b23('0x58');return respondWithRpcPromise(_0x5b23('0x76'),_0x5b23('0x76'),{'event':_0x5b23('0x77'),'message':_0x49b1d7['message']},client9002)[_0x5b23('0x1f')](function(){return _0x49b1d7;});}return _0x49b1d7;}return null;})[_0x5b23('0x1f')](respondWithResult(_0x2d44f3,null))[_0x5b23('0x28')](handleError(_0x2d44f3,null));};var interaction_log=require(_0x5b23('0x12'))(_0x5b23('0x78'));exports[_0x5b23('0x32')]=function(_0x2781c1,_0x440925,_0xfe1664){var _0x26ac16={'agent':{},'channel':_0x5b23('0x79')};if(_0x2781c1[_0x5b23('0x55')]['id']){delete _0x2781c1[_0x5b23('0x55')]['id'];}_0x2781c1[_0x5b23('0x55')]['UserId']=_0x2781c1[_0x5b23('0x55')][_0x5b23('0x5c')]||_0x2781c1['user']['id'];_0x26ac16[_0x5b23('0x6f')]['id']=_0x2781c1[_0x5b23('0x55')][_0x5b23('0x5c')];return db[_0x5b23('0x3a')][_0x5b23('0x53')]({'where':{'id':_0x2781c1[_0x5b23('0x56')]['id'],'UserId':null}})[_0x5b23('0x1f')](handleEntityNotFound(_0x440925,null))[_0x5b23('0x1f')](function(_0x4194a6){if(_0x4194a6){_0x26ac16[_0x5b23('0x26')]=_0x4194a6[_0x5b23('0x5e')]({'plain':!![]});return db[_0x5b23('0x5f')][_0x5b23('0x53')]({'where':{'id':_0x4194a6[_0x5b23('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x440925,null))['then'](function(_0x2d8869){if(_0x2d8869){_0x26ac16['interaction']=_0x2d8869[_0x5b23('0x5e')]({'plain':!![]});interaction_log['info'](_0x5b23('0x7a'),_0x2781c1[_0x5b23('0x5d')]['id'],_0x2781c1[_0x5b23('0x5d')][_0x5b23('0x37')],_0x2781c1[_0x5b23('0x5d')]['role'],_0x26ac16[_0x5b23('0x64')]['id'],_0x2781c1[_0x5b23('0x55')]?JSON[_0x5b23('0x65')](_0x2781c1[_0x5b23('0x55')]):_0x5b23('0x7b'));return respondWithRpcPromise(_0x5b23('0x7c'),_0x5b23('0x7d'),_0x26ac16);}return null;})[_0x5b23('0x1f')](function(_0x4e6547){var _0x40176e=_0x5b23('0x68')+_0x4e6547['message'][_0x5b23('0x69')];return db[_0x5b23('0x7e')][_0x5b23('0x40')](_0x40176e,{'type':db[_0x5b23('0x6a')][_0x5b23('0x6b')]['SELECT'],'raw':!![]})[_0x5b23('0x1f')](function(_0x4c855f){return _0x4c855f;});})[_0x5b23('0x1f')](function(_0x9be0e){if(_0x9be0e){_0x26ac16[_0x5b23('0x26')][_0x5b23('0x6d')]=_0x9be0e[0x0];if(!_0x2781c1['body'][_0x5b23('0x5c')])return;return db[_0x5b23('0x6e')][_0x5b23('0x53')]({'where':{'id':_0x2781c1[_0x5b23('0x55')][_0x5b23('0x5c')],'role':_0x5b23('0x6f')},'attributes':['id','name','fullname',_0x5b23('0x71'),_0x5b23('0x72')],'raw':!![]});}return null;})['then'](function(_0x3b12a5){if(!_0x3b12a5)return null;_0x26ac16[_0x5b23('0x26')][_0x5b23('0x6f')]=_0x3b12a5;return _0x26ac16;})['then'](function(_0x49e0bd){if(_0x49e0bd){_0x49e0bd[_0x5b23('0x26')][_0x5b23('0x73')]=util['format'](_0x5b23('0x7f'),_0x2781c1[_0x5b23('0x5d')][_0x5b23('0x37')]);_0x49e0bd[_0x5b23('0x26')][_0x5b23('0x74')]=_0x26ac16[_0x5b23('0x74')];_0x49e0bd[_0x5b23('0x26')][_0x5b23('0x80')]=_0x26ac16[_0x5b23('0x74')];_0x49e0bd[_0x5b23('0x26')][_0x5b23('0x75')]=_0x5b23('0x32');respondWithRpcPromise(_0x5b23('0x76'),_0x5b23('0x76'),{'event':_0x5b23('0x81'),'message':_0x49e0bd['message']},client9002);return _0x26ac16;}return null;})[_0x5b23('0x1f')](respondWithResult(_0x440925,null))['catch'](handleError(_0x440925,null));};exports['status']=function(_0x5c0267,_0x2bbc45,_0x2f082e){if(_0x5c0267[_0x5b23('0x55')]['id']){delete _0x5c0267[_0x5b23('0x55')]['id'];}var _0x1d0b39;return db[_0x5b23('0x3a')][_0x5b23('0x53')]({'where':{'id':_0x5c0267[_0x5b23('0x56')]['id']}})[_0x5b23('0x1f')](handleEntityNotFound(_0x2bbc45,null))[_0x5b23('0x1f')](function(_0x22f3bd){if(_0x22f3bd){_0x1d0b39=_0x22f3bd;return db[_0x5b23('0x82')][_0x5b23('0x53')]({'where':{'id':_0x22f3bd['SmsAccountId']}});}})[_0x5b23('0x1f')](handleEntityNotFound(_0x2bbc45,null))[_0x5b23('0x1f')](function(_0x57363d){if(_0x57363d){logger[_0x5b23('0x83')](_0x5b23('0x23'),_0x5b23('0x2a'),'received\x20delivery\x20report\x20from',_0x57363d[_0x5b23('0x3d')],util[_0x5b23('0x84')](_0x5c0267[_0x5b23('0x55')],{'showHidden':![],'depth':null}));switch(_0x57363d[_0x5b23('0x3d')]){case'twilio':if(_0x5c0267[_0x5b23('0x55')]['MessageSid']&&_0x5c0267[_0x5b23('0x55')]['MessageSid']===_0x1d0b39[_0x5b23('0x85')]){return _0x1d0b39[_0x5b23('0x34')]({'read':!![]});}else{logger[_0x5b23('0x24')](_0x5b23('0x86'),_0x5b23('0x2a'),_0x5b23('0x87'),util[_0x5b23('0x84')](_0x5c0267[_0x5b23('0x55')],{'showHidden':![],'depth':null}));}break;case _0x5b23('0x88'):if(_0x5c0267['body']['MessageUUID']&&_0x5c0267[_0x5b23('0x55')]['MessageUUID']===_0x1d0b39['messageId']&&_['indexOf']([_0x5b23('0x89'),_0x5b23('0x8a')],_0x5c0267[_0x5b23('0x55')][_0x5b23('0x8b')])>=0x0){return _0x1d0b39['update']({'read':!![]});}else{logger[_0x5b23('0x24')](_0x5b23('0x86'),_0x5b23('0x2a'),_0x5b23('0x8c'),util[_0x5b23('0x84')](_0x5c0267[_0x5b23('0x55')],{'showHidden':![],'depth':null}));}break;case _0x5b23('0x8d'):var _0x184528=_0x5c0267[_0x5b23('0x55')]['results'][0x0];if(_0x184528[_0x5b23('0x2a')]['groupName']==='DELIVERED'){return _0x1d0b39[_0x5b23('0x34')]({'read':!![]});}else{logger[_0x5b23('0x24')](_0x5b23('0x86'),_0x5b23('0x2a'),_0x5b23('0x8d'),util[_0x5b23('0x84')](_0x5c0267['body'],{'showHidden':![],'depth':null}));}break;}return _0x1d0b39;}})[_0x5b23('0x1f')](respondWithResult(_0x2bbc45,null))[_0x5b23('0x28')](handleError(_0x2bbc45,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index aeb503f..33739ea 100644 --- a/server/api/smsMessage/smsMessage.events.js +++ b/server/api/smsMessage/smsMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa4fe=['setMaxListeners','save','update','remove','emit','hasOwnProperty','events','../../mysqldb','SmsMessage'];(function(_0x4ee632,_0x426322){var _0x3c70e6=function(_0x1541f7){while(--_0x1541f7){_0x4ee632['push'](_0x4ee632['shift']());}};_0x3c70e6(++_0x426322);}(_0xa4fe,0x12f));var _0xea4f=function(_0x5219b1,_0x45dfad){_0x5219b1=_0x5219b1-0x0;var _0x1fff2e=_0xa4fe[_0x5219b1];return _0x1fff2e;};'use strict';var EventEmitter=require(_0xea4f('0x0'));var SmsMessage=require(_0xea4f('0x1'))['db'][_0xea4f('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xea4f('0x3')](0x0);var events={'afterCreate':_0xea4f('0x4'),'afterUpdate':_0xea4f('0x5'),'afterDestroy':_0xea4f('0x6')};function emitEvent(_0xf11183){return function(_0x36beff,_0x54a16e,_0x29108f){SmsMessageEvents[_0xea4f('0x7')](_0xf11183+':'+_0x36beff['id'],_0x36beff);SmsMessageEvents[_0xea4f('0x7')](_0xf11183,_0x36beff);_0x29108f(null);};}for(var e in events){if(events[_0xea4f('0x8')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0x9250=['../../mysqldb','SmsMessage','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x4b4949,_0x3d9072){var _0x121a97=function(_0x2a552e){while(--_0x2a552e){_0x4b4949['push'](_0x4b4949['shift']());}};_0x121a97(++_0x3d9072);}(_0x9250,0x1ef));var _0x0925=function(_0x17798e,_0x300c73){_0x17798e=_0x17798e-0x0;var _0x284db9=_0x9250[_0x17798e];return _0x284db9;};'use strict';var EventEmitter=require(_0x0925('0x0'));var SmsMessage=require(_0x0925('0x1'))['db'][_0x0925('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0925('0x3'),'afterDestroy':_0x0925('0x4')};function emitEvent(_0x173b86){return function(_0x28c194,_0x510241,_0x41f0fc){SmsMessageEvents['emit'](_0x173b86+':'+_0x28c194['id'],_0x28c194);SmsMessageEvents[_0x0925('0x5')](_0x173b86,_0x28c194);_0x41f0fc(null);};}for(var e in events){if(events[_0x0925('0x6')](e)){var event=events[e];SmsMessage[_0x0925('0x7')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index b08690e..41a2893 100644 --- a/server/api/smsMessage/smsMessage.model.js +++ b/server/api/smsMessage/smsMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7743=['applicationId','base64','bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','SmsMessage','sms_messages','messageId','FULLTEXT','models','toLowerCase','direction','out','isNil','UserId','SmsInteractionId','SmsInteraction','findOne','then','update','catch','error','secret','SmsAccount','find','type','twilio','accountSid','authToken','phone','messages','body','/api/sms/messages/','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','skebby','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','login?username=','username','&password=','split','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','afterCreate','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','inspect','clicksend','xCALLY\x20Motion','format','Basic\x20%s','toString','http_code','data','queued_count','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','authId','remote','%s:%s','https://api.plivo.com/v1/Account/%s/Message/','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','sender','sort','length','md5','digest','signature=','GET','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','/messages'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7743,0x85));var _0x3774=function(_0x5c2836,_0x31b257){_0x5c2836=_0x5c2836-0x0;var _0x58ad3f=_0x7743[_0x5c2836];return _0x58ad3f;};'use strict';var _=require(_0x3774('0x0'));var util=require(_0x3774('0x1'));var logger=require(_0x3774('0x2'))(_0x3774('0x3'));var moment=require(_0x3774('0x4'));var BPromise=require(_0x3774('0x5'));var rp=require(_0x3774('0x6'));var fs=require('fs');var path=require(_0x3774('0x7'));var rimraf=require('rimraf');var config=require(_0x3774('0x8'));var attributes=require('./smsMessage.attributes');module['exports']=function(_0x5c3319,_0x213cea){return _0x5c3319['define'](_0x3774('0x9'),attributes,{'tableName':_0x3774('0xa'),'paranoid':![],'indexes':[{'name':_0x3774('0xb'),'fields':[_0x3774('0xb')]},{'name':'fti_sms_messages','fields':['body'],'type':_0x3774('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xcdcf76,_0x236dae,_0x2d3839){var _0x1a32d9=_0x5c3319[_0x3774('0xd')];var _0x4c44da=_0xcdcf76['get']({'plain':!![]});if(_0x4c44da['direction'][_0x3774('0xe')]()==='in'||_0x4c44da[_0x3774('0xf')][_0x3774('0xe')]()===_0x3774('0x10')&&!_0x4c44da['secret']&&!_[_0x3774('0x11')](_0x4c44da[_0x3774('0x12')])&&!_[_0x3774('0x11')](_0x4c44da[_0x3774('0x13')])){_0x1a32d9[_0x3774('0x14')][_0x3774('0x15')]({'where':{'id':_0x4c44da[_0x3774('0x13')]}})[_0x3774('0x16')](function(_0x2052f5){if(_0x2052f5){_0x2052f5[_0x3774('0x17')]({'lastMsgAt':_0x4c44da['createdAt'],'lastMsgDirection':_0x4c44da[_0x3774('0xf')]['toLowerCase']()});}})[_0x3774('0x18')](function(_0x21e4fe){console[_0x3774('0x19')](_0x21e4fe);});}if(_0x4c44da[_0x3774('0xf')]===_0x3774('0x10')&&!_0x4c44da[_0x3774('0x1a')]){var _0x4a74ef;_0x1a32d9[_0x3774('0x1b')][_0x3774('0x1c')]({'where':{'id':_0x4c44da['SmsAccountId']},'raw':!![]})[_0x3774('0x16')](function(_0x41212d){_0x4a74ef=_0x41212d;if(_0x4a74ef&&_0x4a74ef[_0x3774('0x1d')]){switch(_0x4a74ef[_0x3774('0x1d')]){case'twilio':var _0x6ba888=require(_0x3774('0x1e'));if(_0x4a74ef[_0x3774('0x1f')]&&_0x4a74ef[_0x3774('0x20')]&&_0x4a74ef[_0x3774('0x21')]){var _0x66290f=new _0x6ba888(_0x4a74ef[_0x3774('0x1f')],_0x4a74ef['authToken']);_0x66290f[_0x3774('0x22')]['create']({'body':_0x4c44da[_0x3774('0x23')],'to':_0x4c44da[_0x3774('0x21')],'from':_0x4a74ef[_0x3774('0x21')],'statusCallback':_0x4a74ef['remote']+_0x3774('0x24')+_0x4c44da['id']+_0x3774('0x25')+_0x4a74ef[_0x3774('0x26')]})[_0x3774('0x16')](function(_0xb05cf9){if(_0xb05cf9[_0x3774('0x27')]){return _0xcdcf76[_0x3774('0x17')]({'messageId':_0xb05cf9[_0x3774('0x27')]});}})[_0x3774('0x18')](function(_0x3822ed){logger[_0x3774('0x19')](_0x3774('0x28'),'afterCreate','twilio',util['inspect'](_0x3822ed,{'showHidden':![],'depth':null}));});}else{logger[_0x3774('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x3774('0x1e'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x3774('0x29'):var _0x5478b4=_0x3774('0x2a');if(_0x4a74ef['username']&&_0x4a74ef[_0x3774('0x2b')]){var _0x46c8cc={'recipient':[_0x4c44da[_0x3774('0x21')]],'message':_0x4c44da[_0x3774('0x23')],'message_type':_0x4a74ef['smsMethod']};if(_0x4a74ef[_0x3774('0x2c')]&&_0x4a74ef[_0x3774('0x2c')]!=='SI'){_0x46c8cc['sender']=_0x4a74ef[_0x3774('0x21')];}var _0x5accfe={'url':_0x5478b4+_0x3774('0x2d')+_0x4a74ef[_0x3774('0x2e')]+_0x3774('0x2f')+_0x4a74ef[_0x3774('0x2b')],'method':'GET'};rp(_0x5accfe)['then'](function(_0x679c5a){var _0x2f566e=_0x679c5a[_0x3774('0x30')](';');var _0x5ad272={'user_key':_0x2f566e[0x0],'session_key':_0x2f566e[0x1]};_0x5accfe={'url':_0x5478b4+_0x3774('0x31'),'method':_0x3774('0x32'),'headers':{'user_key':_0x5ad272[_0x3774('0x33')],'Session_key':_0x5ad272[_0x3774('0x34')]},'json':!![],'body':_0x46c8cc};return rp(_0x5accfe);})[_0x3774('0x16')](function(_0x2e6d0d){if(_0x2e6d0d[_0x3774('0x35')]>=0x1){var _0x2776d4={'messageId':_0x2e6d0d[_0x3774('0x36')]};if(_0x4a74ef['smsMethod']!=='GP'||!_0x4a74ef[_0x3774('0x37')]){_0x2776d4[_0x3774('0x38')]=!![];}return _0xcdcf76[_0x3774('0x17')](_0x2776d4);}else{return logger[_0x3774('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3774('0x39'),_0x3774('0x29'),util['inspect'](_0x2e6d0d,{'showHidden':![],'depth':null}));}})[_0x3774('0x18')](function(_0x3ad9e6){return logger[_0x3774('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3774('0x39'),_0x3774('0x29'),util['inspect'](_0x3ad9e6,{'showHidden':![],'depth':null}));});}else{logger[_0x3774('0x19')](_0x3774('0x28'),'afterCreate',_0x3774('0x29'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x3774('0x3a'):if(_0x4a74ef[_0x3774('0x20')]){var _0xd67216={'recipient':_0x4c44da['phone'],'message':_0x4c44da['body'],'sender':_0x4a74ef[_0x3774('0x3b')]||_0x4a74ef[_0x3774('0x21')],'authorization':_0x4a74ef[_0x3774('0x20')]};var _0x236dae={'method':'POST','uri':_0x3774('0x3c'),'body':_0xd67216,'json':!![]};rp(_0x236dae)[_0x3774('0x16')](function(_0x10e41e){var _0x3ebfde={'messageId':_0x10e41e[_0x3774('0x3d')]};if(!_0x4a74ef[_0x3774('0x37')]){_0x3ebfde[_0x3774('0x38')]=!![];}return _0xcdcf76['update'](_0x3ebfde);})[_0x3774('0x18')](function(_0x12b6ad){logger[_0x3774('0x19')](_0x3774('0x28'),'afterCreate',_0x3774('0x3a'),util[_0x3774('0x3e')](_0x12b6ad,{'showHidden':![],'depth':null}));});}else{logger[_0x3774('0x19')](_0x3774('0x28'),'afterCreate',_0x3774('0x3a'),'Missing\x20parameters:\x20authToken');}break;case _0x3774('0x3f'):if(_0x4a74ef[_0x3774('0x2e')]&&_0x4a74ef['password']){var _0xd67216={'messages':[{'source':_0x3774('0x40'),'to':_0x4c44da[_0x3774('0x21')],'body':_0x4c44da[_0x3774('0x23')],'from':_0x4a74ef[_0x3774('0x3b')]||_0x4a74ef[_0x3774('0x21')]}]};var _0x415744=util[_0x3774('0x41')]('%s:%s',_0x4a74ef[_0x3774('0x2e')],_0x4a74ef['password']);var _0x236dae={'method':_0x3774('0x32'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0xd67216,'headers':{'Authorization':util['format'](_0x3774('0x42'),new Buffer(_0x415744)[_0x3774('0x43')]('base64'))},'json':!![]};rp(_0x236dae)[_0x3774('0x16')](function(_0x49ad39){if(_0x49ad39[_0x3774('0x44')]>=0xc8&&_0x49ad39[_0x3774('0x44')]<=0xce){if(_0x49ad39[_0x3774('0x45')]&&_0x49ad39[_0x3774('0x45')][_0x3774('0x46')]>0x0){var _0x6bb33e=_['head'](_0x49ad39[_0x3774('0x45')][_0x3774('0x22')]);var _0x19d22f={'messageId':_0x6bb33e[_0x3774('0x47')]};if(!_0x4a74ef['deliveryReport']){_0x19d22f[_0x3774('0x38')]=!![];}return _0xcdcf76[_0x3774('0x17')](_0x19d22f);}else{logger[_0x3774('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3774('0x39'),_0x3774('0x48'),util[_0x3774('0x3e')](_0x49ad39,{'showHidden':![],'depth':null}));}}else{logger[_0x3774('0x19')](_0x3774('0x28'),_0x3774('0x39'),'clickSend',util[_0x3774('0x3e')](_0x49ad39,{'showHidden':![],'depth':null}));}})[_0x3774('0x18')](function(_0x3af08d){logger[_0x3774('0x19')](_0x3774('0x28'),_0x3774('0x39'),_0x3774('0x48'),util[_0x3774('0x3e')](_0x3af08d,{'showHidden':![],'depth':null}));});}else{logger[_0x3774('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x3774('0x48'),_0x3774('0x49'));}break;case _0x3774('0x4a'):if(_0x4a74ef[_0x3774('0x4b')]&&_0x4a74ef[_0x3774('0x20')]){var _0xd67216={'dst':_0x4c44da[_0x3774('0x21')],'text':_0x4c44da[_0x3774('0x23')],'src':_0x4a74ef[_0x3774('0x3b')]||_0x4a74ef['phone'],'url':_0x4a74ef[_0x3774('0x4c')]+_0x3774('0x24')+_0x4c44da['id']+_0x3774('0x25')+_0x4a74ef['token']};var _0x415744=util[_0x3774('0x41')](_0x3774('0x4d'),_0x4a74ef['authId'],_0x4a74ef[_0x3774('0x20')]);var _0x236dae={'method':_0x3774('0x32'),'uri':util[_0x3774('0x41')](_0x3774('0x4e'),_0x4a74ef['authId']),'body':_0xd67216,'headers':{'Authorization':util[_0x3774('0x41')](_0x3774('0x42'),new Buffer(_0x415744)[_0x3774('0x43')]('base64'))},'json':!![]};rp(_0x236dae)[_0x3774('0x16')](function(_0x27486e){var _0x4c9a81={'messageId':_0x27486e['message_uuid'][0x0]};return _0xcdcf76[_0x3774('0x17')](_0x4c9a81);})['catch'](function(_0x3dbe78){logger[_0x3774('0x19')](_0x3774('0x28'),_0x3774('0x39'),'plivo',util['inspect'](_0x3dbe78,{'showHidden':![],'depth':null}));});}else{logger[_0x3774('0x19')](_0x3774('0x28'),_0x3774('0x39'),_0x3774('0x4a'),_0x3774('0x4f'));}break;case _0x3774('0x50'):if(_0x4a74ef[_0x3774('0x2e')]&&_0x4a74ef[_0x3774('0x2b')]){if(_0x4a74ef['baseUrl']){var _0x398874={'method':_0x3774('0x32'),'uri':_0x4a74ef[_0x3774('0x51')]+_0x3774('0x52'),'body':{'username':_0x4a74ef[_0x3774('0x2e')],'password':_0x4a74ef[_0x3774('0x2b')]},'json':!![]};return rp(_0x398874)['then'](function(_0xfa8422){var _0x123722={'method':_0x3774('0x32'),'uri':_0x4a74ef['baseUrl']+_0x3774('0x53'),'body':{'messages':[{'from':_0x4a74ef[_0x3774('0x21')],'destinations':[{'to':_0x4c44da[_0x3774('0x21')]}],'text':_0x4c44da['body'],'notifyUrl':_0x4a74ef[_0x3774('0x4c')]+_0x3774('0x24')+_0x4c44da['id']+_0x3774('0x25')+_0x4a74ef[_0x3774('0x26')],'notifyContentType':_0x3774('0x54'),'callbackData':_0x4a74ef['phone']+';'+_0x4c44da[_0x3774('0x23')]}]},'headers':{'Authorization':_0x3774('0x55')+_0xfa8422[_0x3774('0x26')]},'json':!![]};return rp(_0x123722)[_0x3774('0x16')](function(_0x25c9f0){if(_0x25c9f0['messages']){var _0x47cd8e={'messageId':_0x25c9f0['messages'][0x0][_0x3774('0xb')]};if(!_0x4a74ef['deliveryReport']){_0x47cd8e['read']=!![];}return _0xcdcf76[_0x3774('0x17')](_0x47cd8e);}else{return logger['error'](_0x3774('0x28'),_0x3774('0x39'),_0x3774('0x50'),util[_0x3774('0x3e')](_0x25c9f0,{'showHidden':![],'depth':null}));}});})[_0x3774('0x18')](function(_0x50ac9b){return logger[_0x3774('0x19')](_0x3774('0x28'),'afterCreate',_0x3774('0x50'),util[_0x3774('0x3e')](_0x50ac9b,{'showHidden':![],'depth':null}));});}else{logger[_0x3774('0x19')](_0x3774('0x28'),'afterCreate','infobip',_0x3774('0x56'));}}else{logger[_0x3774('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3774('0x39'),_0x3774('0x50'),_0x3774('0x49'));}break;case _0x3774('0x57'):var _0xd6cf6e=require(_0x3774('0x58'));if(_0x4a74ef[_0x3774('0x59')]){var _0x19c337={};_0x19c337[_0x3774('0x5a')]=_0x4a74ef['username'];_0x19c337[_0x3774('0x21')]=_0x4c44da[_0x3774('0x21')];_0x19c337[_0x3774('0x5b')]=_0x4a74ef[_0x3774('0x21')];_0x19c337['text']=_0x4c44da[_0x3774('0x23')];_0x19c337['timestamp']=+new Date();var _0x12854c='';var _0x232123='';var _0x3d917a=Object['keys'](_0x19c337);_0x3d917a[_0x3774('0x5c')]();for(var _0x118e83=0x0;_0x118e83<_0x3d917a[_0x3774('0x5d')];_0x118e83++){if(_0x12854c!=''){_0x12854c+='&';}_0x12854c+=_0x3d917a[_0x118e83]+'='+encodeURIComponent(_0x19c337[_0x3d917a[_0x118e83]]);_0x232123+=_0x19c337[_0x3d917a[_0x118e83]];}_0x232123+=_0x4a74ef[_0x3774('0x59')];_0x232123=_0xd6cf6e['createHash'](_0x3774('0x5e'))['update'](_0x232123)[_0x3774('0x5f')]('hex');if(_0x12854c!==''){_0x12854c+='&';}_0x12854c+=_0x3774('0x60')+_0x232123;var _0x5accfe={'method':_0x3774('0x61'),'uri':_0x4a74ef[_0x3774('0x51')]+'/external/get/send.php?'+_0x12854c,'json':!![]};return rp(_0x5accfe)[_0x3774('0x16')](function(_0x503b36){var _0x2fc6b7=Object['keys'](_0x503b36);if(_0x503b36[_0x2fc6b7[0x0]]['error']&&parseInt(_0x503b36[_0x2fc6b7[0x0]]['error'])===0x0){var _0xfc365a={'messageId':_0x503b36[_0x2fc6b7[0x0]][_0x3774('0x62')]};if(!_0x4a74ef[_0x3774('0x37')]){_0xfc365a[_0x3774('0x38')]=!![];}return _0xcdcf76[_0x3774('0x17')](_0xfc365a);}else{return logger[_0x3774('0x19')](_0x3774('0x28'),_0x3774('0x39'),_0x3774('0x57'),util[_0x3774('0x3e')](_0x503b36['error'],{'showHidden':![],'depth':null}));}})[_0x3774('0x18')](function(_0x1957cf){return logger['error'](_0x3774('0x28'),_0x3774('0x39'),_0x3774('0x57'),util[_0x3774('0x3e')](_0x1957cf,{'showHidden':![],'depth':null}));});}else{logger[_0x3774('0x19')](_0x3774('0x28'),'afterCreate',_0x3774('0x57'),_0x3774('0x63'));}break;case _0x3774('0x64'):if(_0x4a74ef[_0x3774('0x59')]){var _0x5ec67e={'method':_0x3774('0x32'),'uri':_0x3774('0x65'),'headers':{'Authorization':_0x4a74ef['apiKey']},'body':{'content':_0x4c44da[_0x3774('0x23')],'to':[_0x4c44da[_0x3774('0x21')]],'from':_0x4a74ef[_0x3774('0x21')],'binary':![],'clientMessageId':_0x3774('0x66'),'charset':_0x3774('0x67')},'json':!![]};rp(_0x5ec67e)['then'](function(_0x48da5e){if(!_0x48da5e[_0x3774('0x19')]){var _0x356f39={'messageId':_0x48da5e['messages'][0x0]['apiMessageId']};if(!_0x4a74ef['deliveryReport']){_0x356f39['read']=!![];}return _0xcdcf76[_0x3774('0x17')](_0x356f39);}else{return logger[_0x3774('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','clickatell',util['inspect'](_0x48da5e[_0x3774('0x19')],{'showHidden':![],'depth':null}));}})[_0x3774('0x18')](function(_0x285a2f){return logger[_0x3774('0x19')](_0x3774('0x28'),_0x3774('0x39'),_0x3774('0x64'),util[_0x3774('0x3e')](_0x285a2f,{'showHidden':![],'depth':null}));});}else{logger[_0x3774('0x19')](_0x3774('0x28'),_0x3774('0x39'),_0x3774('0x64'),_0x3774('0x63'));}break;case'bandwidth':if(_0x4a74ef[_0x3774('0x2e')]&&_0x4a74ef[_0x3774('0x2b')]){var _0x415744=util['format'](_0x3774('0x4d'),_0x4a74ef[_0x3774('0x2e')],_0x4a74ef['password']);var _0x236dae={'method':_0x3774('0x32'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x4a74ef['accountId']+_0x3774('0x68'),'body':{'to':[_0x4c44da[_0x3774('0x21')]],'text':_0x4c44da['body'],'from':_0x4a74ef[_0x3774('0x21')],'applicationId':_0x4a74ef[_0x3774('0x69')]},'headers':{'Authorization':util['format'](_0x3774('0x42'),new Buffer(_0x415744)[_0x3774('0x43')](_0x3774('0x6a')))},'json':!![]};rp(_0x236dae)[_0x3774('0x16')](function(_0x3e7c15){if(_0x3e7c15['id']){var _0x4bbeca={'messageId':_0x3e7c15['id']};return _0xcdcf76[_0x3774('0x17')](_0x4bbeca);}else{logger[_0x3774('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3774('0x39'),'bandwidth',util['inspect'](_0x3e7c15,{'showHidden':![],'depth':null}));}})[_0x3774('0x18')](function(_0x9cde0b){logger[_0x3774('0x19')](_0x3774('0x28'),'afterCreate',_0x3774('0x6b'),util[_0x3774('0x3e')](_0x9cde0b,{'showHidden':![],'depth':null}));});}else{logger[_0x3774('0x19')](_0x3774('0x28'),_0x3774('0x39'),_0x3774('0x6b'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x3774('0x6c'):if(_0x4a74ef['apiKey']){var _0x5c5ca5={};var _0x5accfe={'method':_0x3774('0x32'),'uri':_0x3774('0x6d'),'headers':{'Authorization':_0x3774('0x6e')+_0x4a74ef[_0x3774('0x59')],'Content-Type':'application/json'},'body':{'from':_0x4a74ef[_0x3774('0x21')],'to':_0x4c44da[_0x3774('0x21')],'text':_0x4c44da[_0x3774('0x23')]},'json':!![]};return rp(_0x5accfe)['then'](function(_0x584e39){if(_0x584e39[_0x3774('0x6f')]==0xca){_0x5c5ca5[_0x3774('0x70')]=_0x584e39;var _0x42b6ac={'method':_0x3774('0x32'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x3774('0x6e')+_0x4a74ef[_0x3774('0x59')],'Content-Type':_0x3774('0x54')},'body':{'refid':_0x5c5ca5[_0x3774('0x70')][_0x3774('0x71')]},'json':!![]};return rp(_0x42b6ac)[_0x3774('0x16')](function(_0x5be980){_0x5c5ca5[_0x3774('0x72')]=_0x5be980;var _0x42529f={'messageId':_0x5c5ca5[_0x3774('0x70')][_0x3774('0x71')],'read':!![]};return _0xcdcf76[_0x3774('0x17')](_0x42529f);});}else{return logger[_0x3774('0x19')](_0x3774('0x28'),_0x3774('0x39'),'intelepeer',util['inspect'](_0x584e39,{'showHidden':![],'depth':null}));}})['catch'](function(_0xac77ac){return logger[_0x3774('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3774('0x39'),'intelepeer',util[_0x3774('0x3e')](_0xac77ac,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x3774('0x28'),_0x3774('0x39'),_0x3774('0x6c'),_0x3774('0x73'));}break;}}})[_0x3774('0x74')](function(){_0x2d3839();});}else{_0x2d3839();}}},'charset':_0x3774('0x75'),'collate':_0x3774('0x76')});}; \ No newline at end of file +var _0x4f9a=['IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','csc','crypto','login','text','length','createHash','digest','hex','signature=','GET','/external/get/send.php?','keys','id_sms','Missing\x20parameters:\x20apiKey','apiKey','uuid','UTF-8','clickatell','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','bandwidth','intelepeer','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','refid','status','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','models','direction','toLowerCase','out','isNil','SmsInteractionId','SmsInteraction','findOne','then','update','createdAt','secret','SmsAccount','find','type','twilio','accountSid','phone','authToken','messages','create','/api/sms/messages/','/status?token=','sid','catch','error','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','split','POST','user_key','session_key','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','head','message_id','clickSend','token','authId','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','plivo','baseUrl','remote','application/json'];(function(_0x1ebeea,_0x2f54f4){var _0x576465=function(_0x47fc77){while(--_0x47fc77){_0x1ebeea['push'](_0x1ebeea['shift']());}};_0x576465(++_0x2f54f4);}(_0x4f9a,0x192));var _0xa4f9=function(_0x509ac6,_0x225d25){_0x509ac6=_0x509ac6-0x0;var _0x41ee05=_0x4f9a[_0x509ac6];return _0x41ee05;};'use strict';var _=require(_0xa4f9('0x0'));var util=require(_0xa4f9('0x1'));var logger=require(_0xa4f9('0x2'))(_0xa4f9('0x3'));var moment=require(_0xa4f9('0x4'));var BPromise=require('bluebird');var rp=require(_0xa4f9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa4f9('0x6'));var attributes=require(_0xa4f9('0x7'));module[_0xa4f9('0x8')]=function(_0xb80b8e,_0xeddc60){return _0xb80b8e[_0xa4f9('0x9')](_0xa4f9('0xa'),attributes,{'tableName':_0xa4f9('0xb'),'paranoid':![],'indexes':[{'name':_0xa4f9('0xc'),'fields':[_0xa4f9('0xc')]},{'name':_0xa4f9('0xd'),'fields':[_0xa4f9('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x150f51,_0x23a07f,_0x6befd2){var _0x442874=_0xb80b8e[_0xa4f9('0xf')];var _0x2c946a=_0x150f51['get']({'plain':!![]});if(_0x2c946a[_0xa4f9('0x10')][_0xa4f9('0x11')]()==='in'||_0x2c946a[_0xa4f9('0x10')]['toLowerCase']()===_0xa4f9('0x12')&&!_0x2c946a['secret']&&!_[_0xa4f9('0x13')](_0x2c946a['UserId'])&&!_['isNil'](_0x2c946a[_0xa4f9('0x14')])){_0x442874[_0xa4f9('0x15')][_0xa4f9('0x16')]({'where':{'id':_0x2c946a[_0xa4f9('0x14')]}})[_0xa4f9('0x17')](function(_0x3833ba){if(_0x3833ba){_0x3833ba[_0xa4f9('0x18')]({'lastMsgAt':_0x2c946a[_0xa4f9('0x19')],'lastMsgDirection':_0x2c946a[_0xa4f9('0x10')][_0xa4f9('0x11')]()});}})['catch'](function(_0x5105ab){console['error'](_0x5105ab);});}if(_0x2c946a[_0xa4f9('0x10')]===_0xa4f9('0x12')&&!_0x2c946a[_0xa4f9('0x1a')]){var _0x3f5a0f;_0x442874[_0xa4f9('0x1b')][_0xa4f9('0x1c')]({'where':{'id':_0x2c946a['SmsAccountId']},'raw':!![]})['then'](function(_0x2e2b5c){_0x3f5a0f=_0x2e2b5c;if(_0x3f5a0f&&_0x3f5a0f[_0xa4f9('0x1d')]){switch(_0x3f5a0f['type']){case _0xa4f9('0x1e'):var _0x15b66e=require('twilio');if(_0x3f5a0f[_0xa4f9('0x1f')]&&_0x3f5a0f['authToken']&&_0x3f5a0f[_0xa4f9('0x20')]){var _0x1f85a3=new _0x15b66e(_0x3f5a0f[_0xa4f9('0x1f')],_0x3f5a0f[_0xa4f9('0x21')]);_0x1f85a3[_0xa4f9('0x22')][_0xa4f9('0x23')]({'body':_0x2c946a['body'],'to':_0x2c946a[_0xa4f9('0x20')],'from':_0x3f5a0f['phone'],'statusCallback':_0x3f5a0f['remote']+_0xa4f9('0x24')+_0x2c946a['id']+_0xa4f9('0x25')+_0x3f5a0f['token']})[_0xa4f9('0x17')](function(_0x29ee88){if(_0x29ee88[_0xa4f9('0x26')]){return _0x150f51[_0xa4f9('0x18')]({'messageId':_0x29ee88['sid']});}})[_0xa4f9('0x27')](function(_0x1cb53e){logger[_0xa4f9('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa4f9('0x29'),_0xa4f9('0x1e'),util[_0xa4f9('0x2a')](_0x1cb53e,{'showHidden':![],'depth':null}));});}else{logger[_0xa4f9('0x28')](_0xa4f9('0x2b'),_0xa4f9('0x29'),_0xa4f9('0x1e'),_0xa4f9('0x2c'));}break;case _0xa4f9('0x2d'):var _0x5e40cf=_0xa4f9('0x2e');if(_0x3f5a0f[_0xa4f9('0x2f')]&&_0x3f5a0f[_0xa4f9('0x30')]){var _0x51a53a={'recipient':[_0x2c946a['phone']],'message':_0x2c946a[_0xa4f9('0xe')],'message_type':_0x3f5a0f[_0xa4f9('0x31')]};if(_0x3f5a0f[_0xa4f9('0x31')]&&_0x3f5a0f[_0xa4f9('0x31')]!=='SI'){_0x51a53a[_0xa4f9('0x32')]=_0x3f5a0f['phone'];}var _0x412aca={'url':_0x5e40cf+_0xa4f9('0x33')+_0x3f5a0f['username']+_0xa4f9('0x34')+_0x3f5a0f[_0xa4f9('0x30')],'method':'GET'};rp(_0x412aca)[_0xa4f9('0x17')](function(_0x2d55c5){var _0xe17619=_0x2d55c5[_0xa4f9('0x35')](';');var _0x59fa82={'user_key':_0xe17619[0x0],'session_key':_0xe17619[0x1]};_0x412aca={'url':_0x5e40cf+'sms','method':_0xa4f9('0x36'),'headers':{'user_key':_0x59fa82[_0xa4f9('0x37')],'Session_key':_0x59fa82[_0xa4f9('0x38')]},'json':!![],'body':_0x51a53a};return rp(_0x412aca);})[_0xa4f9('0x17')](function(_0x5cbeef){if(_0x5cbeef['total_sent']>=0x1){var _0x19488a={'messageId':_0x5cbeef[_0xa4f9('0x39')]};if(_0x3f5a0f[_0xa4f9('0x31')]!=='GP'||!_0x3f5a0f[_0xa4f9('0x3a')]){_0x19488a[_0xa4f9('0x3b')]=!![];}return _0x150f51[_0xa4f9('0x18')](_0x19488a);}else{return logger['error'](_0xa4f9('0x2b'),_0xa4f9('0x29'),'skebby',util[_0xa4f9('0x2a')](_0x5cbeef,{'showHidden':![],'depth':null}));}})[_0xa4f9('0x27')](function(_0x13a1dd){return logger[_0xa4f9('0x28')](_0xa4f9('0x2b'),_0xa4f9('0x29'),_0xa4f9('0x2d'),util[_0xa4f9('0x2a')](_0x13a1dd,{'showHidden':![],'depth':null}));});}else{logger[_0xa4f9('0x28')](_0xa4f9('0x2b'),_0xa4f9('0x29'),_0xa4f9('0x2d'),_0xa4f9('0x3c'));}break;case _0xa4f9('0x3d'):if(_0x3f5a0f[_0xa4f9('0x21')]){var _0x224563={'recipient':_0x2c946a[_0xa4f9('0x20')],'message':_0x2c946a[_0xa4f9('0xe')],'sender':_0x3f5a0f[_0xa4f9('0x3e')]||_0x3f5a0f[_0xa4f9('0x20')],'authorization':_0x3f5a0f['authToken']};var _0x23a07f={'method':'POST','uri':_0xa4f9('0x3f'),'body':_0x224563,'json':!![]};rp(_0x23a07f)[_0xa4f9('0x17')](function(_0x3c81e4){var _0x3112c9={'messageId':_0x3c81e4[_0xa4f9('0x40')]};if(!_0x3f5a0f[_0xa4f9('0x3a')]){_0x3112c9['read']=!![];}return _0x150f51[_0xa4f9('0x18')](_0x3112c9);})[_0xa4f9('0x27')](function(_0xcf8a72){logger[_0xa4f9('0x28')](_0xa4f9('0x2b'),_0xa4f9('0x29'),'connectel',util['inspect'](_0xcf8a72,{'showHidden':![],'depth':null}));});}else{logger[_0xa4f9('0x28')](_0xa4f9('0x2b'),'afterCreate',_0xa4f9('0x3d'),'Missing\x20parameters:\x20authToken');}break;case'clicksend':if(_0x3f5a0f[_0xa4f9('0x2f')]&&_0x3f5a0f[_0xa4f9('0x30')]){var _0x224563={'messages':[{'source':_0xa4f9('0x41'),'to':_0x2c946a['phone'],'body':_0x2c946a['body'],'from':_0x3f5a0f['senderString']||_0x3f5a0f[_0xa4f9('0x20')]}]};var _0x1863a7=util[_0xa4f9('0x42')](_0xa4f9('0x43'),_0x3f5a0f[_0xa4f9('0x2f')],_0x3f5a0f[_0xa4f9('0x30')]);var _0x23a07f={'method':_0xa4f9('0x36'),'uri':_0xa4f9('0x44'),'body':_0x224563,'headers':{'Authorization':util[_0xa4f9('0x42')](_0xa4f9('0x45'),new Buffer(_0x1863a7)[_0xa4f9('0x46')](_0xa4f9('0x47')))},'json':!![]};rp(_0x23a07f)[_0xa4f9('0x17')](function(_0x2668f1){if(_0x2668f1['http_code']>=0xc8&&_0x2668f1[_0xa4f9('0x48')]<=0xce){if(_0x2668f1[_0xa4f9('0x49')]&&_0x2668f1['data'][_0xa4f9('0x4a')]>0x0){var _0x473e9a=_[_0xa4f9('0x4b')](_0x2668f1[_0xa4f9('0x49')][_0xa4f9('0x22')]);var _0x4afbc1={'messageId':_0x473e9a[_0xa4f9('0x4c')]};if(!_0x3f5a0f['deliveryReport']){_0x4afbc1[_0xa4f9('0x3b')]=!![];}return _0x150f51[_0xa4f9('0x18')](_0x4afbc1);}else{logger[_0xa4f9('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa4f9('0x29'),_0xa4f9('0x4d'),util[_0xa4f9('0x2a')](_0x2668f1,{'showHidden':![],'depth':null}));}}else{logger[_0xa4f9('0x28')](_0xa4f9('0x2b'),'afterCreate','clickSend',util[_0xa4f9('0x2a')](_0x2668f1,{'showHidden':![],'depth':null}));}})[_0xa4f9('0x27')](function(_0x56cd2d){logger[_0xa4f9('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xa4f9('0x4d'),util[_0xa4f9('0x2a')](_0x56cd2d,{'showHidden':![],'depth':null}));});}else{logger[_0xa4f9('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa4f9('0x29'),'clickSend',_0xa4f9('0x3c'));}break;case'plivo':if(_0x3f5a0f['authId']&&_0x3f5a0f[_0xa4f9('0x21')]){var _0x224563={'dst':_0x2c946a[_0xa4f9('0x20')],'text':_0x2c946a[_0xa4f9('0xe')],'src':_0x3f5a0f[_0xa4f9('0x3e')]||_0x3f5a0f['phone'],'url':_0x3f5a0f['remote']+'/api/sms/messages/'+_0x2c946a['id']+_0xa4f9('0x25')+_0x3f5a0f[_0xa4f9('0x4e')]};var _0x1863a7=util[_0xa4f9('0x42')](_0xa4f9('0x43'),_0x3f5a0f[_0xa4f9('0x4f')],_0x3f5a0f['authToken']);var _0x23a07f={'method':_0xa4f9('0x36'),'uri':util[_0xa4f9('0x42')](_0xa4f9('0x50'),_0x3f5a0f[_0xa4f9('0x4f')]),'body':_0x224563,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x1863a7)['toString'](_0xa4f9('0x47')))},'json':!![]};rp(_0x23a07f)['then'](function(_0xe12cc1){var _0x45c58b={'messageId':_0xe12cc1[_0xa4f9('0x51')][0x0]};return _0x150f51['update'](_0x45c58b);})['catch'](function(_0x42f0e5){logger[_0xa4f9('0x28')](_0xa4f9('0x2b'),_0xa4f9('0x29'),_0xa4f9('0x52'),util[_0xa4f9('0x2a')](_0x42f0e5,{'showHidden':![],'depth':null}));});}else{logger[_0xa4f9('0x28')](_0xa4f9('0x2b'),'afterCreate',_0xa4f9('0x52'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case'infobip':if(_0x3f5a0f[_0xa4f9('0x2f')]&&_0x3f5a0f[_0xa4f9('0x30')]){if(_0x3f5a0f[_0xa4f9('0x53')]){var _0x2a2dc6={'method':_0xa4f9('0x36'),'uri':_0x3f5a0f[_0xa4f9('0x53')]+'/auth/1/session','body':{'username':_0x3f5a0f['username'],'password':_0x3f5a0f[_0xa4f9('0x30')]},'json':!![]};return rp(_0x2a2dc6)[_0xa4f9('0x17')](function(_0x5e0ed3){var _0x5b140a={'method':'POST','uri':_0x3f5a0f[_0xa4f9('0x53')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x3f5a0f['phone'],'destinations':[{'to':_0x2c946a[_0xa4f9('0x20')]}],'text':_0x2c946a['body'],'notifyUrl':_0x3f5a0f[_0xa4f9('0x54')]+_0xa4f9('0x24')+_0x2c946a['id']+_0xa4f9('0x25')+_0x3f5a0f[_0xa4f9('0x4e')],'notifyContentType':_0xa4f9('0x55'),'callbackData':_0x3f5a0f[_0xa4f9('0x20')]+';'+_0x2c946a['body']}]},'headers':{'Authorization':_0xa4f9('0x56')+_0x5e0ed3[_0xa4f9('0x4e')]},'json':!![]};return rp(_0x5b140a)[_0xa4f9('0x17')](function(_0x3d6f7e){if(_0x3d6f7e[_0xa4f9('0x22')]){var _0x187405={'messageId':_0x3d6f7e['messages'][0x0]['messageId']};if(!_0x3f5a0f[_0xa4f9('0x3a')]){_0x187405[_0xa4f9('0x3b')]=!![];}return _0x150f51['update'](_0x187405);}else{return logger[_0xa4f9('0x28')](_0xa4f9('0x2b'),_0xa4f9('0x29'),_0xa4f9('0x57'),util[_0xa4f9('0x2a')](_0x3d6f7e,{'showHidden':![],'depth':null}));}});})[_0xa4f9('0x27')](function(_0x22cb24){return logger[_0xa4f9('0x28')](_0xa4f9('0x2b'),_0xa4f9('0x29'),'infobip',util[_0xa4f9('0x2a')](_0x22cb24,{'showHidden':![],'depth':null}));});}else{logger[_0xa4f9('0x28')](_0xa4f9('0x2b'),_0xa4f9('0x29'),_0xa4f9('0x57'),_0xa4f9('0x58'));}}else{logger[_0xa4f9('0x28')](_0xa4f9('0x2b'),_0xa4f9('0x29'),_0xa4f9('0x57'),_0xa4f9('0x3c'));}break;case _0xa4f9('0x59'):var _0x177d70=require(_0xa4f9('0x5a'));if(_0x3f5a0f['apiKey']){var _0x3a9963={};_0x3a9963[_0xa4f9('0x5b')]=_0x3f5a0f['username'];_0x3a9963[_0xa4f9('0x20')]=_0x2c946a[_0xa4f9('0x20')];_0x3a9963['sender']=_0x3f5a0f[_0xa4f9('0x20')];_0x3a9963[_0xa4f9('0x5c')]=_0x2c946a['body'];_0x3a9963['timestamp']=+new Date();var _0x287e42='';var _0x60355b='';var _0x102561=Object['keys'](_0x3a9963);_0x102561['sort']();for(var _0x486541=0x0;_0x486541<_0x102561[_0xa4f9('0x5d')];_0x486541++){if(_0x287e42!=''){_0x287e42+='&';}_0x287e42+=_0x102561[_0x486541]+'='+encodeURIComponent(_0x3a9963[_0x102561[_0x486541]]);_0x60355b+=_0x3a9963[_0x102561[_0x486541]];}_0x60355b+=_0x3f5a0f['apiKey'];_0x60355b=_0x177d70[_0xa4f9('0x5e')]('md5')[_0xa4f9('0x18')](_0x60355b)[_0xa4f9('0x5f')](_0xa4f9('0x60'));if(_0x287e42!==''){_0x287e42+='&';}_0x287e42+=_0xa4f9('0x61')+_0x60355b;var _0x412aca={'method':_0xa4f9('0x62'),'uri':_0x3f5a0f[_0xa4f9('0x53')]+_0xa4f9('0x63')+_0x287e42,'json':!![]};return rp(_0x412aca)[_0xa4f9('0x17')](function(_0x53706c){var _0x39e5c3=Object[_0xa4f9('0x64')](_0x53706c);if(_0x53706c[_0x39e5c3[0x0]]['error']&&parseInt(_0x53706c[_0x39e5c3[0x0]]['error'])===0x0){var _0x2c6f74={'messageId':_0x53706c[_0x39e5c3[0x0]][_0xa4f9('0x65')]};if(!_0x3f5a0f[_0xa4f9('0x3a')]){_0x2c6f74[_0xa4f9('0x3b')]=!![];}return _0x150f51[_0xa4f9('0x18')](_0x2c6f74);}else{return logger['error'](_0xa4f9('0x2b'),_0xa4f9('0x29'),_0xa4f9('0x59'),util[_0xa4f9('0x2a')](_0x53706c[_0xa4f9('0x28')],{'showHidden':![],'depth':null}));}})[_0xa4f9('0x27')](function(_0x5d73d6){return logger[_0xa4f9('0x28')](_0xa4f9('0x2b'),_0xa4f9('0x29'),_0xa4f9('0x59'),util['inspect'](_0x5d73d6,{'showHidden':![],'depth':null}));});}else{logger[_0xa4f9('0x28')](_0xa4f9('0x2b'),_0xa4f9('0x29'),'csc',_0xa4f9('0x66'));}break;case'clickatell':if(_0x3f5a0f[_0xa4f9('0x67')]){var _0xf12b8d={'method':'POST','uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x3f5a0f[_0xa4f9('0x67')]},'body':{'content':_0x2c946a['body'],'to':[_0x2c946a[_0xa4f9('0x20')]],'from':_0x3f5a0f[_0xa4f9('0x20')],'binary':![],'clientMessageId':_0xa4f9('0x68'),'charset':_0xa4f9('0x69')},'json':!![]};rp(_0xf12b8d)[_0xa4f9('0x17')](function(_0x1c497f){if(!_0x1c497f[_0xa4f9('0x28')]){var _0x33b2b8={'messageId':_0x1c497f[_0xa4f9('0x22')][0x0]['apiMessageId']};if(!_0x3f5a0f['deliveryReport']){_0x33b2b8[_0xa4f9('0x3b')]=!![];}return _0x150f51[_0xa4f9('0x18')](_0x33b2b8);}else{return logger[_0xa4f9('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa4f9('0x29'),_0xa4f9('0x6a'),util[_0xa4f9('0x2a')](_0x1c497f[_0xa4f9('0x28')],{'showHidden':![],'depth':null}));}})[_0xa4f9('0x27')](function(_0x2a963c){return logger['error'](_0xa4f9('0x2b'),_0xa4f9('0x29'),_0xa4f9('0x6a'),util[_0xa4f9('0x2a')](_0x2a963c,{'showHidden':![],'depth':null}));});}else{logger[_0xa4f9('0x28')](_0xa4f9('0x2b'),'afterCreate',_0xa4f9('0x6a'),'Missing\x20parameters:\x20apiKey');}break;case'bandwidth':if(_0x3f5a0f['username']&&_0x3f5a0f['password']){var _0x1863a7=util[_0xa4f9('0x42')](_0xa4f9('0x43'),_0x3f5a0f[_0xa4f9('0x2f')],_0x3f5a0f[_0xa4f9('0x30')]);var _0x23a07f={'method':_0xa4f9('0x36'),'uri':_0xa4f9('0x6b')+_0x3f5a0f[_0xa4f9('0x6c')]+_0xa4f9('0x6d'),'body':{'to':[_0x2c946a[_0xa4f9('0x20')]],'text':_0x2c946a[_0xa4f9('0xe')],'from':_0x3f5a0f[_0xa4f9('0x20')],'applicationId':_0x3f5a0f[_0xa4f9('0x6e')]},'headers':{'Authorization':util[_0xa4f9('0x42')]('Basic\x20%s',new Buffer(_0x1863a7)['toString'](_0xa4f9('0x47')))},'json':!![]};rp(_0x23a07f)[_0xa4f9('0x17')](function(_0x371d68){if(_0x371d68['id']){var _0x2c0ef9={'messageId':_0x371d68['id']};return _0x150f51['update'](_0x2c0ef9);}else{logger[_0xa4f9('0x28')](_0xa4f9('0x2b'),'afterCreate',_0xa4f9('0x6f'),util['inspect'](_0x371d68,{'showHidden':![],'depth':null}));}})['catch'](function(_0x4a93be){logger[_0xa4f9('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa4f9('0x29'),_0xa4f9('0x6f'),util[_0xa4f9('0x2a')](_0x4a93be,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xa4f9('0x2b'),_0xa4f9('0x29'),_0xa4f9('0x6f'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xa4f9('0x70'):if(_0x3f5a0f['apiKey']){var _0x50e935={};var _0x412aca={'method':_0xa4f9('0x36'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':'Bearer\x20'+_0x3f5a0f[_0xa4f9('0x67')],'Content-Type':_0xa4f9('0x55')},'body':{'from':_0x3f5a0f[_0xa4f9('0x20')],'to':_0x2c946a[_0xa4f9('0x20')],'text':_0x2c946a[_0xa4f9('0xe')]},'json':!![]};return rp(_0x412aca)[_0xa4f9('0x17')](function(_0x10e229){if(_0x10e229[_0xa4f9('0x71')]==0xca){_0x50e935[_0xa4f9('0x72')]=_0x10e229;var _0x4312bd={'method':_0xa4f9('0x36'),'uri':_0xa4f9('0x73'),'headers':{'Authorization':_0xa4f9('0x74')+_0x3f5a0f[_0xa4f9('0x67')],'Content-Type':'application/json'},'body':{'refid':_0x50e935[_0xa4f9('0x72')][_0xa4f9('0x75')]},'json':!![]};return rp(_0x4312bd)[_0xa4f9('0x17')](function(_0x3497bf){_0x50e935[_0xa4f9('0x76')]=_0x3497bf;var _0x9133de={'messageId':_0x50e935[_0xa4f9('0x72')][_0xa4f9('0x75')],'read':!![]};return _0x150f51[_0xa4f9('0x18')](_0x9133de);});}else{return logger[_0xa4f9('0x28')](_0xa4f9('0x2b'),_0xa4f9('0x29'),'intelepeer',util[_0xa4f9('0x2a')](_0x10e229,{'showHidden':![],'depth':null}));}})[_0xa4f9('0x27')](function(_0x47ad94){return logger[_0xa4f9('0x28')](_0xa4f9('0x2b'),_0xa4f9('0x29'),_0xa4f9('0x70'),util[_0xa4f9('0x2a')](_0x47ad94,{'showHidden':![],'depth':null}));});}else{return logger[_0xa4f9('0x28')](_0xa4f9('0x2b'),_0xa4f9('0x29'),_0xa4f9('0x70'),_0xa4f9('0x77'));}break;}}})['finally'](function(){_0x6befd2();});}else{_0x6befd2();}}},'charset':_0xa4f9('0x78'),'collate':_0xa4f9('0x79')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 70569de..5b4836e 100644 --- a/server/api/smsMessage/smsMessage.rpc.js +++ b/server/api/smsMessage/smsMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x94e9=['request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket'];(function(_0x57cbfb,_0x2de760){var _0x4cb933=function(_0x33cf6a){while(--_0x33cf6a){_0x57cbfb['push'](_0x57cbfb['shift']());}};_0x4cb933(++_0x2de760);}(_0x94e9,0x11b));var _0x994e=function(_0x195577,_0x5de53a){_0x195577=_0x195577-0x0;var _0x13c367=_0x94e9[_0x195577];return _0x13c367;};'use strict';var _=require(_0x994e('0x0'));var util=require(_0x994e('0x1'));var moment=require(_0x994e('0x2'));var BPromise=require(_0x994e('0x3'));var rs=require(_0x994e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x994e('0x5'))(_0x994e('0x6'));var config=require(_0x994e('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x994e('0x8')]({'port':0x232a});config[_0x994e('0x9')]=_[_0x994e('0xa')](config[_0x994e('0x9')],{'host':_0x994e('0xb'),'port':0x18eb});var socket=require(_0x994e('0xc'))(new Redis(config[_0x994e('0x9')]));require(_0x994e('0xd'))['register'](socket);function respondWithRpcPromise(_0x169080,_0x3b5cc4,_0x16bcb4){return new BPromise(function(_0x766913,_0x3c6a03){return client[_0x994e('0xe')](_0x169080,_0x16bcb4)[_0x994e('0xf')](function(_0x33b021){logger[_0x994e('0x10')](_0x994e('0x11'),_0x3b5cc4,_0x994e('0x12'));logger[_0x994e('0x13')](_0x994e('0x14'),_0x3b5cc4,_0x994e('0x12'),JSON[_0x994e('0x15')](_0x33b021));if(_0x33b021[_0x994e('0x16')]){if(_0x33b021['error'][_0x994e('0x17')]===0x1f4){logger[_0x994e('0x16')](_0x994e('0x11'),_0x3b5cc4,_0x33b021[_0x994e('0x16')][_0x994e('0x18')]);return _0x3c6a03(_0x33b021[_0x994e('0x16')]['message']);}logger[_0x994e('0x16')](_0x994e('0x11'),_0x3b5cc4,_0x33b021[_0x994e('0x16')][_0x994e('0x18')]);return _0x766913(_0x33b021[_0x994e('0x16')][_0x994e('0x18')]);}else{logger[_0x994e('0x10')](_0x994e('0x11'),_0x3b5cc4,_0x994e('0x12'));_0x766913(_0x33b021[_0x994e('0x19')][_0x994e('0x18')]);}})[_0x994e('0x1a')](function(_0x50d029){logger[_0x994e('0x16')](_0x994e('0x11'),_0x3b5cc4,_0x50d029);_0x3c6a03(_0x50d029);});});}exports[_0x994e('0x1b')]=function(_0xff55c8){var _0x3375ba=this;return new Promise(function(_0x1566c6,_0x26295c){return db[_0x994e('0x1c')][_0x994e('0x1d')](_0xff55c8[_0x994e('0x1e')],{'raw':_0xff55c8[_0x994e('0x1f')]?_0xff55c8['options'][_0x994e('0x20')]===undefined?!![]:![]:!![]})[_0x994e('0xf')](function(_0x5ca9db){logger[_0x994e('0x10')](_0x994e('0x1b'),_0xff55c8);logger[_0x994e('0x13')]('CreateSmsMessage',_0xff55c8,JSON[_0x994e('0x15')](_0x5ca9db));_0x1566c6(_0x5ca9db);})['catch'](function(_0x5ba25a){logger[_0x994e('0x16')](_0x994e('0x1b'),_0x5ba25a[_0x994e('0x18')],_0xff55c8);_0x26295c(_0x3375ba[_0x994e('0x16')](0x1f4,_0x5ba25a[_0x994e('0x18')]));});});}; \ No newline at end of file +var _0x413f=['raw','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateSmsMessage','create','body'];(function(_0xed8833,_0x2a801e){var _0x42a79d=function(_0xc6cb6c){while(--_0xc6cb6c){_0xed8833['push'](_0xed8833['shift']());}};_0x42a79d(++_0x2a801e);}(_0x413f,0x182));var _0xf413=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x413f[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0xf413('0x0'));var moment=require(_0xf413('0x1'));var BPromise=require(_0xf413('0x2'));var rs=require(_0xf413('0x3'));var fs=require('fs');var Redis=require(_0xf413('0x4'));var db=require(_0xf413('0x5'))['db'];var utils=require(_0xf413('0x6'));var logger=require(_0xf413('0x7'))(_0xf413('0x8'));var config=require(_0xf413('0x9'));var jayson=require(_0xf413('0xa'));var client=jayson[_0xf413('0xb')]['http']({'port':0x232a});config[_0xf413('0xc')]=_[_0xf413('0xd')](config[_0xf413('0xc')],{'host':_0xf413('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf413('0xc')]));require('./smsMessage.socket')[_0xf413('0xf')](socket);function respondWithRpcPromise(_0x19c916,_0x21b3b5,_0x5e47e9){return new BPromise(function(_0x2dff7c,_0x41afae){return client[_0xf413('0x10')](_0x19c916,_0x5e47e9)[_0xf413('0x11')](function(_0x503399){logger[_0xf413('0x12')](_0xf413('0x13'),_0x21b3b5,_0xf413('0x14'));logger[_0xf413('0x15')](_0xf413('0x16'),_0x21b3b5,'request\x20sent',JSON['stringify'](_0x503399));if(_0x503399[_0xf413('0x17')]){if(_0x503399[_0xf413('0x17')][_0xf413('0x18')]===0x1f4){logger[_0xf413('0x17')](_0xf413('0x13'),_0x21b3b5,_0x503399[_0xf413('0x17')][_0xf413('0x19')]);return _0x41afae(_0x503399[_0xf413('0x17')][_0xf413('0x19')]);}logger[_0xf413('0x17')](_0xf413('0x13'),_0x21b3b5,_0x503399['error'][_0xf413('0x19')]);return _0x2dff7c(_0x503399[_0xf413('0x17')]['message']);}else{logger[_0xf413('0x12')]('SmsMessage,\x20%s,\x20%s',_0x21b3b5,_0xf413('0x14'));_0x2dff7c(_0x503399['result'][_0xf413('0x19')]);}})[_0xf413('0x1a')](function(_0x277bcf){logger['error']('SmsMessage,\x20%s,\x20%s',_0x21b3b5,_0x277bcf);_0x41afae(_0x277bcf);});});}exports[_0xf413('0x1b')]=function(_0x44a59d){var _0x3cf5cd=this;return new Promise(function(_0xb09379,_0x1d0a17){return db['SmsMessage'][_0xf413('0x1c')](_0x44a59d[_0xf413('0x1d')],{'raw':_0x44a59d['options']?_0x44a59d['options'][_0xf413('0x1e')]===undefined?!![]:![]:!![]})[_0xf413('0x11')](function(_0xf91c75){logger[_0xf413('0x12')](_0xf413('0x1b'),_0x44a59d);logger['debug'](_0xf413('0x1b'),_0x44a59d,JSON[_0xf413('0x1f')](_0xf91c75));_0xb09379(_0xf91c75);})['catch'](function(_0x58593b){logger[_0xf413('0x17')](_0xf413('0x1b'),_0x58593b[_0xf413('0x19')],_0x44a59d);_0x1d0a17(_0x3cf5cd[_0xf413('0x17')](0x1f4,_0x58593b['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 7e1bfe8..f32a75e 100644 --- a/server/api/smsMessage/smsMessage.socket.js +++ b/server/api/smsMessage/smsMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4d89=['remove','removeListener','register','length','smsMessage:','./smsMessage.events'];(function(_0x1aaa52,_0x442418){var _0x1a3b6a=function(_0x4a168a){while(--_0x4a168a){_0x1aaa52['push'](_0x1aaa52['shift']());}};_0x1a3b6a(++_0x442418);}(_0x4d89,0x95));var _0x94d8=function(_0xfc698b,_0x3d8e45){_0xfc698b=_0xfc698b-0x0;var _0x57816f=_0x4d89[_0xfc698b];return _0x57816f;};'use strict';var SmsMessageEvents=require(_0x94d8('0x0'));var events=['save',_0x94d8('0x1'),'update'];function createListener(_0x4a619d,_0x4e5824){return function(_0xa42a64){_0x4e5824['emit'](_0x4a619d,_0xa42a64);};}function removeListener(_0x1feb2a,_0xcd328a){return function(){SmsMessageEvents[_0x94d8('0x2')](_0x1feb2a,_0xcd328a);};}exports[_0x94d8('0x3')]=function(_0x54e370){for(var _0x9a3d2=0x0,_0x4c5c71=events[_0x94d8('0x4')];_0x9a3d2<_0x4c5c71;_0x9a3d2++){var _0x1019bd=events[_0x9a3d2];var _0x14098f=createListener(_0x94d8('0x5')+_0x1019bd,_0x54e370);SmsMessageEvents['on'](_0x1019bd,_0x14098f);}}; \ No newline at end of file +var _0x4869=['remove','emit','register','length','smsMessage:','./smsMessage.events','save'];(function(_0x1b0063,_0x9e9012){var _0x3affc2=function(_0x2e1491){while(--_0x2e1491){_0x1b0063['push'](_0x1b0063['shift']());}};_0x3affc2(++_0x9e9012);}(_0x4869,0x6e));var _0x9486=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x4869[_0x18ab2a];return _0x16dcee;};'use strict';var SmsMessageEvents=require(_0x9486('0x0'));var events=[_0x9486('0x1'),_0x9486('0x2'),'update'];function createListener(_0x12425b,_0x8d2145){return function(_0x1098b8){_0x8d2145[_0x9486('0x3')](_0x12425b,_0x1098b8);};}function removeListener(_0xad3f9,_0x57eef4){return function(){SmsMessageEvents['removeListener'](_0xad3f9,_0x57eef4);};}exports[_0x9486('0x4')]=function(_0x390b0c){for(var _0x43c880=0x0,_0x5846fd=events[_0x9486('0x5')];_0x43c880<_0x5846fd;_0x43c880++){var _0x2039a8=events[_0x43c880];var _0x50e83b=createListener(_0x9486('0x6')+_0x2039a8,_0x390b0c);SmsMessageEvents['on'](_0x2039a8,_0x50e83b);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index f2e5347..9d4bc2f 100644 --- a/server/api/smsQueue/index.js +++ b/server/api/smsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1a78=['getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsQueue.controller','isAuthenticated','get','/describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users'];(function(_0x23c2c3,_0x27ecc8){var _0x41e09f=function(_0x5e6873){while(--_0x5e6873){_0x23c2c3['push'](_0x23c2c3['shift']());}};_0x41e09f(++_0x27ecc8);}(_0x1a78,0x180));var _0x81a7=function(_0x46acc4,_0x381c5c){_0x46acc4=_0x46acc4-0x0;var _0x308d88=_0x1a78[_0x46acc4];return _0x308d88;};'use strict';var multer=require(_0x81a7('0x0'));var util=require(_0x81a7('0x1'));var path=require(_0x81a7('0x2'));var timeout=require(_0x81a7('0x3'));var express=require(_0x81a7('0x4'));var router=express[_0x81a7('0x5')]();var fs_extra=require(_0x81a7('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x81a7('0x7'));var config=require(_0x81a7('0x8'));var controller=require(_0x81a7('0x9'));router['get']('/',auth[_0x81a7('0xa')](),controller['index']);router[_0x81a7('0xb')](_0x81a7('0xc'),auth[_0x81a7('0xa')](),controller['describe']);router[_0x81a7('0xb')](_0x81a7('0xd'),auth[_0x81a7('0xa')](),controller[_0x81a7('0xe')]);router[_0x81a7('0xb')]('/:id/members',auth[_0x81a7('0xa')](),controller[_0x81a7('0xf')]);router[_0x81a7('0xb')](_0x81a7('0x10'),auth['isAuthenticated'](),controller[_0x81a7('0x11')]);router[_0x81a7('0xb')](_0x81a7('0x12'),auth[_0x81a7('0xa')](),controller[_0x81a7('0x13')]);router[_0x81a7('0x14')]('/',auth[_0x81a7('0xa')](),controller[_0x81a7('0x15')]);router['post'](_0x81a7('0x10'),auth[_0x81a7('0xa')](),controller[_0x81a7('0x16')]);router['post'](_0x81a7('0x12'),auth[_0x81a7('0xa')](),controller[_0x81a7('0x17')]);router[_0x81a7('0x18')](_0x81a7('0xd'),auth['isAuthenticated'](),controller[_0x81a7('0x19')]);router[_0x81a7('0x1a')](_0x81a7('0xd'),auth[_0x81a7('0xa')](),controller[_0x81a7('0x1b')]);router[_0x81a7('0x1a')](_0x81a7('0x10'),auth[_0x81a7('0xa')](),controller[_0x81a7('0x1c')]);router[_0x81a7('0x1a')](_0x81a7('0x12'),auth['isAuthenticated'](),controller[_0x81a7('0x1d')]);module[_0x81a7('0x1e')]=router; \ No newline at end of file +var _0xdbea=['/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','destroy','delete','removeTeams','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','./smsQueue.controller','get','isAuthenticated'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xdbea,0x104));var _0xadbe=function(_0x5a4a6c,_0x1d29a0){_0x5a4a6c=_0x5a4a6c-0x0;var _0x4ba0a4=_0xdbea[_0x5a4a6c];return _0x4ba0a4;};'use strict';var multer=require(_0xadbe('0x0'));var util=require(_0xadbe('0x1'));var path=require(_0xadbe('0x2'));var timeout=require('connect-timeout');var express=require(_0xadbe('0x3'));var router=express[_0xadbe('0x4')]();var fs_extra=require(_0xadbe('0x5'));var auth=require(_0xadbe('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xadbe('0x7'));router[_0xadbe('0x8')]('/',auth[_0xadbe('0x9')](),controller['index']);router[_0xadbe('0x8')](_0xadbe('0xa'),auth['isAuthenticated'](),controller[_0xadbe('0xb')]);router[_0xadbe('0x8')](_0xadbe('0xc'),auth[_0xadbe('0x9')](),controller[_0xadbe('0xd')]);router[_0xadbe('0x8')](_0xadbe('0xe'),auth[_0xadbe('0x9')](),controller[_0xadbe('0xf')]);router[_0xadbe('0x8')](_0xadbe('0x10'),auth[_0xadbe('0x9')](),controller[_0xadbe('0x11')]);router[_0xadbe('0x8')](_0xadbe('0x12'),auth[_0xadbe('0x9')](),controller[_0xadbe('0x13')]);router[_0xadbe('0x14')]('/',auth[_0xadbe('0x9')](),controller[_0xadbe('0x15')]);router[_0xadbe('0x14')](_0xadbe('0x10'),auth['isAuthenticated'](),controller[_0xadbe('0x16')]);router[_0xadbe('0x14')](_0xadbe('0x12'),auth[_0xadbe('0x9')](),controller[_0xadbe('0x17')]);router[_0xadbe('0x18')](_0xadbe('0xc'),auth[_0xadbe('0x9')](),controller['update']);router['delete'](_0xadbe('0xc'),auth[_0xadbe('0x9')](),controller[_0xadbe('0x19')]);router[_0xadbe('0x1a')]('/:id/teams',auth[_0xadbe('0x9')](),controller[_0xadbe('0x1b')]);router[_0xadbe('0x1a')](_0xadbe('0x12'),auth[_0xadbe('0x9')](),controller[_0xadbe('0x1c')]);module[_0xadbe('0x1d')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 06f07a7..a1aa607 100644 --- a/server/api/smsQueue/smsQueue.attributes.js +++ b/server/api/smsQueue/smsQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x07b7=['INTEGER','rrmemory','beepall','roundrobin','sequelize','STRING'];(function(_0x5bec90,_0x885c73){var _0x5d8698=function(_0x4743fc){while(--_0x4743fc){_0x5bec90['push'](_0x5bec90['shift']());}};_0x5d8698(++_0x885c73);}(_0x07b7,0x16c));var _0x707b=function(_0x37452f,_0x17a04c){_0x37452f=_0x37452f-0x0;var _0xd5b34f=_0x07b7[_0x37452f];return _0xd5b34f;};'use strict';var Sequelize=require(_0x707b('0x0'));module['exports']={'name':{'type':Sequelize[_0x707b('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x707b('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x707b('0x3'),_0x707b('0x4'),_0x707b('0x5'))}}; \ No newline at end of file +var _0x6bc6=['roundrobin','exports','name','STRING','rrmemory','beepall'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6bc6,0x175));var _0x66bc=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0x6bc6[_0xf71120];return _0xbe2fd3;};'use strict';var Sequelize=require('sequelize');module[_0x66bc('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x66bc('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x66bc('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x66bc('0x3'),_0x66bc('0x4'),_0x66bc('0x5'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index a079c28..980c8dd 100644 --- a/server/api/smsQueue/smsQueue.controller.js +++ b/server/api/smsQueue/smsQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['%s/%s','pick','filter','getTeams','addTeams','ids','findAll','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','forEach','userSmsQueue:save','removeTeams','Team','field','tq.TeamId','from','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','find','isEmpty','removeAgents','emit','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','util','squel','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','update','then','destroy','SmsQueues','UserProfileResource','error','stack','name','send','index','SmsQueue','rawAttributes','type','key','getOptions','where','count','include','query','rows','catch','show','model','keys','filters','fields','attributes','length','includeAll','options','create','user','get','role','autoAssociation','body','params','describe','getMembers','findOne','intersection','hasOwnProperty','nolimit','order','sort','SmsQueueId','merge','UserSmsQueue','User','findAndCountAll','map','UserId','agent','smsPause','updatedAt','createdAt','format'];(function(_0x58fc2f,_0x111399){var _0x3a1312=function(_0x3d2ff2){while(--_0x3d2ff2){_0x58fc2f['push'](_0x58fc2f['shift']());}};_0x3a1312(++_0x111399);}(_0xadb5,0xad));var _0x5adb=function(_0x2710aa,_0x135a56){_0x2710aa=_0x2710aa-0x0;var _0x88abdf=_0xadb5[_0x2710aa];return _0x88abdf;};'use strict';var BPromise=require('bluebird');var util=require(_0x5adb('0x0'));var _=require('lodash');var squel=require(_0x5adb('0x1'));var Redis=require(_0x5adb('0x2'));var qs=require(_0x5adb('0x3'));var logger=require('../../config/logger')(_0x5adb('0x4'));var config=require(_0x5adb('0x5'));var db=require(_0x5adb('0x6'))['db'];config['redis']=_[_0x5adb('0x7')](config[_0x5adb('0x8')],{'host':_0x5adb('0x9'),'port':0x18eb});var socket=require(_0x5adb('0xa'))(new Redis(config[_0x5adb('0x8')]));require(_0x5adb('0xb'))[_0x5adb('0xc')](socket);function respondWithStatusCode(_0x6d1b45,_0x41261c){_0x41261c=_0x41261c||0xcc;return function(_0x7293ab){if(_0x7293ab){return _0x6d1b45[_0x5adb('0xd')](_0x41261c);}return _0x6d1b45[_0x5adb('0xe')](_0x41261c)[_0x5adb('0xf')]();};}function respondWithResult(_0x275428,_0x563d86){_0x563d86=_0x563d86||0xc8;return function(_0x4c268d){if(_0x4c268d){return _0x275428[_0x5adb('0xe')](_0x563d86)[_0x5adb('0x10')](_0x4c268d);}};}function respondWithFilteredResult(_0x82e67e,_0x53b772){return function(_0x29f0d5){if(_0x29f0d5){var _0x56012f=typeof _0x53b772[_0x5adb('0x11')]==='undefined'&&typeof _0x53b772[_0x5adb('0x12')]===_0x5adb('0x13');var _0x44abe3=_0x29f0d5['count'];var _0x2a545b=_0x56012f?0x0:_0x53b772[_0x5adb('0x11')];var _0xf82f72=_0x56012f?_0x29f0d5['count']:_0x53b772[_0x5adb('0x11')]+_0x53b772['limit'];var _0x367d82;if(_0xf82f72>=_0x44abe3){_0xf82f72=_0x44abe3;_0x367d82=0xc8;}else{_0x367d82=0xce;}_0x82e67e[_0x5adb('0xe')](_0x367d82);return _0x82e67e[_0x5adb('0x14')](_0x5adb('0x15'),_0x2a545b+'-'+_0xf82f72+'/'+_0x44abe3)[_0x5adb('0x10')](_0x29f0d5);}return null;};}function saveUpdates(_0x39d24d){return function(_0xa29dc){if(_0xa29dc){return _0xa29dc[_0x5adb('0x16')](_0x39d24d)[_0x5adb('0x17')](function(_0x529b65){return _0x529b65;});}return null;};}function removeEntity(_0x3fff62){return function(_0x5de028){if(_0x5de028){return _0x5de028[_0x5adb('0x18')]()['then'](function(){var _0x3ef465=_0x5de028['get']({'plain':!![]});var _0x5e218c=_0x5adb('0x19');return db[_0x5adb('0x1a')][_0x5adb('0x18')]({'where':{'type':_0x5e218c,'resourceId':_0x3ef465['id']}})[_0x5adb('0x17')](function(){return _0x5de028;});})[_0x5adb('0x17')](function(){_0x3fff62['status'](0xcc)[_0x5adb('0xf')]();});}};}function handleEntityNotFound(_0x5c296e){return function(_0x4e9f16){if(!_0x4e9f16){_0x5c296e[_0x5adb('0xd')](0x194);}return _0x4e9f16;};}function handleError(_0x379b33,_0x1a38d3){_0x1a38d3=_0x1a38d3||0x1f4;return function(_0x1a8014){logger[_0x5adb('0x1b')](_0x1a8014[_0x5adb('0x1c')]);if(_0x1a8014[_0x5adb('0x1d')]){delete _0x1a8014['name'];}_0x379b33[_0x5adb('0xe')](_0x1a38d3)[_0x5adb('0x1e')](_0x1a8014);};}exports[_0x5adb('0x1f')]=function(_0x3839fb,_0xeb556c){var _0x49f203={};var _0x2fee18={'count':0x0,'rows':[]};var _0x2e1e63=_['map'](db[_0x5adb('0x20')][_0x5adb('0x21')],function(_0x1a0acd){return{'name':_0x1a0acd['fieldName'],'type':_0x1a0acd[_0x5adb('0x22')][_0x5adb('0x23')]};});_0x49f203=qs[_0x5adb('0x24')](_0x2e1e63,_0x3839fb);var _0x2c64a3={'where':_0x49f203[_0x5adb('0x25')]};return db[_0x5adb('0x20')]['count'](_0x2c64a3)['then'](function(_0x5d457e){_0x2fee18[_0x5adb('0x26')]=_0x5d457e;_0x49f203[_0x5adb('0x27')]=qs[_0x5adb('0x27')](_0x3839fb[_0x5adb('0x28')]);return db[_0x5adb('0x20')]['findAll'](_0x49f203);})[_0x5adb('0x17')](function(_0x34b793){_0x2fee18[_0x5adb('0x29')]=_0x34b793;return _0x2fee18;})[_0x5adb('0x17')](respondWithFilteredResult(_0xeb556c,_0x49f203))[_0x5adb('0x2a')](handleError(_0xeb556c,null));};exports[_0x5adb('0x2b')]=function(_0x28190d,_0x28bf1f){var _0x138bf6={'raw':!![],'where':{'id':_0x28190d['params']['id']}},_0x260295={};_0x260295[_0x5adb('0x2c')]=_['keys'](db[_0x5adb('0x20')][_0x5adb('0x21')]);_0x260295['query']=_[_0x5adb('0x2d')](_0x28190d[_0x5adb('0x28')]);_0x260295[_0x5adb('0x2e')]=_['intersection'](_0x260295[_0x5adb('0x2c')],_0x260295[_0x5adb('0x28')]);_0x138bf6['attributes']=_['intersection'](_0x260295[_0x5adb('0x2c')],qs['fields'](_0x28190d[_0x5adb('0x28')][_0x5adb('0x2f')]));_0x138bf6[_0x5adb('0x30')]=_0x138bf6[_0x5adb('0x30')][_0x5adb('0x31')]?_0x138bf6['attributes']:_0x260295[_0x5adb('0x2c')];if(_0x28190d[_0x5adb('0x28')][_0x5adb('0x32')]){_0x138bf6['include']=[{'all':!![]}];}_0x138bf6=_['merge']({},_0x138bf6,_0x28190d[_0x5adb('0x33')]);return db[_0x5adb('0x20')]['find'](_0x138bf6)[_0x5adb('0x17')](handleEntityNotFound(_0x28bf1f,null))['then'](respondWithResult(_0x28bf1f,null))[_0x5adb('0x2a')](handleError(_0x28bf1f,null));};exports['create']=function(_0x11cb37,_0x4d052f){return db[_0x5adb('0x20')][_0x5adb('0x34')](_0x11cb37['body'],{})[_0x5adb('0x17')](function(_0x5a6a79){var _0xadbe37=_0x11cb37[_0x5adb('0x35')][_0x5adb('0x36')]({'plain':!![]});if(!_0xadbe37)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xadbe37[_0x5adb('0x37')]===_0x5adb('0x35')){var _0xcdaf8e=_0x5a6a79[_0x5adb('0x36')]({'plain':!![]});var _0x22aa95='SmsQueues';return db['UserProfileSection']['find']({'where':{'name':_0x22aa95,'userProfileId':_0xadbe37['userProfileId']},'raw':!![]})[_0x5adb('0x17')](function(_0x2fbe14){if(_0x2fbe14&&_0x2fbe14[_0x5adb('0x38')]===0x0){return db[_0x5adb('0x1a')][_0x5adb('0x34')]({'name':_0xcdaf8e[_0x5adb('0x1d')],'resourceId':_0xcdaf8e['id'],'type':_0x2fbe14[_0x5adb('0x1d')],'sectionId':_0x2fbe14['id']},{})[_0x5adb('0x17')](function(){return _0x5a6a79;});}else{return _0x5a6a79;}})['catch'](function(_0x53f2c6){logger[_0x5adb('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x53f2c6);throw _0x53f2c6;});}return _0x5a6a79;})[_0x5adb('0x17')](respondWithResult(_0x4d052f,0xc9))[_0x5adb('0x2a')](handleError(_0x4d052f,null));};exports[_0x5adb('0x16')]=function(_0x121714,_0xdfecfd){if(_0x121714['body']['id']){delete _0x121714[_0x5adb('0x39')]['id'];}return db[_0x5adb('0x20')]['find']({'where':{'id':_0x121714[_0x5adb('0x3a')]['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0xdfecfd,null))['then'](saveUpdates(_0x121714[_0x5adb('0x39')],null))[_0x5adb('0x17')](respondWithResult(_0xdfecfd,null))[_0x5adb('0x2a')](handleError(_0xdfecfd,null));};exports[_0x5adb('0x18')]=function(_0xea3307,_0x4362ec){return db[_0x5adb('0x20')]['find']({'where':{'id':_0xea3307['params']['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0x4362ec,null))[_0x5adb('0x17')](removeEntity(_0x4362ec,null))[_0x5adb('0x2a')](handleError(_0x4362ec,null));};exports[_0x5adb('0x3b')]=function(_0x57b8af,_0x507e48){return db[_0x5adb('0x20')][_0x5adb('0x3b')]()[_0x5adb('0x17')](respondWithResult(_0x507e48,null))[_0x5adb('0x2a')](handleError(_0x507e48,null));};exports[_0x5adb('0x3c')]=function(_0x5358c0,_0x182cbc){var _0x437f52={'raw':!![],'where':{}},_0x5b574c={},_0x7786c4;return db[_0x5adb('0x20')][_0x5adb('0x3d')]({'where':{'id':_0x5358c0[_0x5adb('0x3a')]['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0x182cbc,null))[_0x5adb('0x17')](function(_0x39840e){if(_0x39840e){_0x7786c4=_0x39840e[_0x5adb('0x36')]({'plain':!![]});_0x5b574c['model']=_[_0x5adb('0x2d')](db['UserSmsQueue']['rawAttributes']);_0x5b574c['query']=_[_0x5adb('0x2d')](_0x5358c0[_0x5adb('0x28')]);_0x5b574c[_0x5adb('0x2e')]=_['intersection'](_0x5b574c[_0x5adb('0x2c')],_0x5b574c['query']);_0x437f52[_0x5adb('0x30')]=_[_0x5adb('0x3e')](_0x5b574c[_0x5adb('0x2c')],qs['fields'](_0x5358c0[_0x5adb('0x28')]['fields']));_0x437f52[_0x5adb('0x30')]=_0x437f52[_0x5adb('0x30')]['length']?_0x437f52[_0x5adb('0x30')]:_0x5b574c[_0x5adb('0x2c')];if(!_0x5358c0[_0x5adb('0x28')][_0x5adb('0x3f')](_0x5adb('0x40'))){_0x437f52['limit']=qs[_0x5adb('0x12')](_0x5358c0[_0x5adb('0x28')][_0x5adb('0x12')]);_0x437f52[_0x5adb('0x11')]=qs['offset'](_0x5358c0[_0x5adb('0x28')][_0x5adb('0x11')]);}_0x437f52[_0x5adb('0x41')]=qs['sort'](_0x5358c0[_0x5adb('0x28')][_0x5adb('0x42')]);_0x437f52[_0x5adb('0x25')]=qs[_0x5adb('0x2e')](_['pick'](_0x5358c0[_0x5adb('0x28')],_0x5b574c[_0x5adb('0x2e')]));_0x437f52[_0x5adb('0x25')][_0x5adb('0x43')]=_0x39840e['id'];if(_0x5358c0[_0x5adb('0x28')]['filter']){_0x437f52[_0x5adb('0x25')]=_['merge'](_0x437f52[_0x5adb('0x25')],{'$or':_['map'](_0x437f52[_0x5adb('0x30')],function(_0x35df22){var _0x1a9358={};_0x1a9358[_0x35df22]={'$like':'%'+_0x5358c0[_0x5adb('0x28')]['filter']+'%'};return _0x1a9358;})});}_0x437f52=_[_0x5adb('0x44')]({},_0x437f52,_0x5358c0[_0x5adb('0x33')]);return db[_0x5adb('0x45')]['findAll'](_0x437f52);}})['then'](function(_0x4ddfdf){if(_0x4ddfdf){return db[_0x5adb('0x46')][_0x5adb('0x47')]({'where':{'id':_[_0x5adb('0x48')](_0x4ddfdf,_0x5adb('0x49')),'role':_0x5adb('0x4a')},'attributes':['id',_0x5adb('0x1d'),_0x5adb('0x4b'),_0x5adb('0x4c'),_0x5adb('0x4d')]});}})[_0x5adb('0x17')](function(_0x452767){if(_0x452767){return{'count':_0x452767[_0x5adb('0x26')],'rows':_[_0x5adb('0x48')](_0x452767['rows'],function(_0x49f4c8){return{'membername':_0x49f4c8[_0x5adb('0x1d')],'UserId':_0x49f4c8['id'],'queue_name':_0x7786c4[_0x5adb('0x1d')],'SmsQueueId':_0x7786c4['id'],'interface':util[_0x5adb('0x4e')](_0x5adb('0x4f'),'SIP',_0x49f4c8[_0x5adb('0x1d')]),'penalty':0x0,'paused':_0x49f4c8[_0x5adb('0x4b')],'createdAt':_0x49f4c8['createdAt'],'updatedAt':_0x49f4c8[_0x5adb('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5adb('0x17')](respondWithFilteredResult(_0x182cbc,_0x437f52))[_0x5adb('0x2a')](handleError(_0x182cbc,null));};exports['getTeams']=function(_0x30d185,_0x409357){var _0x19df2f={};var _0x30c92c={};var _0x330290;var _0x428019;return db['SmsQueue'][_0x5adb('0x3d')]({'where':{'id':_0x30d185[_0x5adb('0x3a')]['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0x409357,null))['then'](function(_0xcd71d2){if(_0xcd71d2){_0x330290=_0xcd71d2;_0x30c92c[_0x5adb('0x2c')]=_[_0x5adb('0x2d')](db['Team'][_0x5adb('0x21')]);_0x30c92c['query']=_[_0x5adb('0x2d')](_0x30d185[_0x5adb('0x28')]);_0x30c92c[_0x5adb('0x2e')]=_['intersection'](_0x30c92c[_0x5adb('0x2c')],_0x30c92c[_0x5adb('0x28')]);_0x19df2f['attributes']=_[_0x5adb('0x3e')](_0x30c92c[_0x5adb('0x2c')],qs[_0x5adb('0x2f')](_0x30d185[_0x5adb('0x28')]['fields']));_0x19df2f[_0x5adb('0x30')]=_0x19df2f[_0x5adb('0x30')][_0x5adb('0x31')]?_0x19df2f[_0x5adb('0x30')]:_0x30c92c['model'];_0x19df2f['order']=qs[_0x5adb('0x42')](_0x30d185['query']['sort']);_0x19df2f['where']=qs[_0x5adb('0x2e')](_[_0x5adb('0x50')](_0x30d185['query'],_0x30c92c[_0x5adb('0x2e')]));if(_0x30d185[_0x5adb('0x28')][_0x5adb('0x51')]){_0x19df2f[_0x5adb('0x25')]=_[_0x5adb('0x44')](_0x19df2f[_0x5adb('0x25')],{'$or':_[_0x5adb('0x48')](_0x19df2f[_0x5adb('0x30')],function(_0x5240c1){var _0x4b9e80={};_0x4b9e80[_0x5240c1]={'$like':'%'+_0x30d185['query'][_0x5adb('0x51')]+'%'};return _0x4b9e80;})});}_0x19df2f=_[_0x5adb('0x44')]({},_0x19df2f,_0x30d185[_0x5adb('0x33')]);return _0x330290[_0x5adb('0x52')](_0x19df2f);}})[_0x5adb('0x17')](function(_0x2f6ef7){if(_0x2f6ef7){_0x428019=_0x2f6ef7[_0x5adb('0x31')];if(!_0x30d185[_0x5adb('0x28')]['hasOwnProperty']('nolimit')){_0x19df2f[_0x5adb('0x12')]=qs[_0x5adb('0x12')](_0x30d185[_0x5adb('0x28')][_0x5adb('0x12')]);_0x19df2f[_0x5adb('0x11')]=qs[_0x5adb('0x11')](_0x30d185[_0x5adb('0x28')][_0x5adb('0x11')]);}return _0x330290[_0x5adb('0x52')](_0x19df2f);}})[_0x5adb('0x17')](function(_0x484f3d){if(_0x484f3d){return _0x484f3d?{'count':_0x428019,'rows':_0x484f3d}:null;}})[_0x5adb('0x17')](respondWithResult(_0x409357,null))[_0x5adb('0x2a')](handleError(_0x409357,null));};exports[_0x5adb('0x53')]=function(_0x5d3aa4,_0x31f041){var _0xa1bd33=_0x5d3aa4['body'][_0x5adb('0x54')];return db['Team'][_0x5adb('0x55')]({'where':{'id':_0xa1bd33},'attributes':['id'],'include':[{'model':db[_0x5adb('0x46')],'as':'Agents','attributes':['id',_0x5adb('0x1d'),_0x5adb('0x56'),_0x5adb('0x57'),_0x5adb('0x58')],'raw':!![]}]})[_0x5adb('0x17')](function(_0x10f54a){if(_0x10f54a){var _0x3cee6c=_[_0x5adb('0x59')](_0x10f54a,function(_0x49a8a6){var _0x3786b4=_0x49a8a6[_0x5adb('0x36')]({'plain':!![]});return _0x3786b4[_0x5adb('0x5a')];});return db['SmsQueue']['find']({'where':{'id':_0x5d3aa4[_0x5adb('0x3a')]['id']}})['then'](function(_0x27d3d8){return db[_0x5adb('0x5b')][_0x5adb('0x5c')](function(_0x50600f){return _0x27d3d8[_0x5adb('0x53')](_0xa1bd33,{'transaction':_0x50600f})[_0x5adb('0x17')](function(){return BPromise[_0x5adb('0x5d')](_0x3cee6c,function(_0x3ecc56){return db[_0x5adb('0x45')]['findOrCreate']({'where':{'UserId':_0x3ecc56['id'],'SmsQueueId':_0x5d3aa4[_0x5adb('0x3a')]['id']},'transaction':_0x50600f});});})[_0x5adb('0x17')](function(){_0x3cee6c[_0x5adb('0x5e')](function(_0xe3d12d){socket['emit'](_0x5adb('0x5f'),{'UserId':_0xe3d12d['id'],'SmsQueueId':_0x27d3d8['id']});});});});});}})[_0x5adb('0x17')](respondWithStatusCode(_0x31f041,null))[_0x5adb('0x2a')](handleError(_0x31f041,null));};exports[_0x5adb('0x60')]=function(_0x15d4f1,_0x20faf6){return db[_0x5adb('0x61')]['findAll']({'where':{'id':_0x15d4f1[_0x5adb('0x28')][_0x5adb('0x54')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x5adb('0x5a'),'attributes':['id'],'raw':!![]}]})[_0x5adb('0x17')](handleEntityNotFound(_0x20faf6,null))['then'](function(_0x462fa0){var _0x50f8ed=_[_0x5adb('0x48')](_0x462fa0,'id');var _0x268df2=[];var _0x4a2ebc=[];var _0x167432=squel['select']();_0x167432[_0x5adb('0x62')](_0x5adb('0x63'))[_0x5adb('0x64')](_0x5adb('0x65'),'tq')[_0x5adb('0x66')]('user_has_teams','ut',_0x5adb('0x67'))[_0x5adb('0x25')](_0x5adb('0x68'),_0x15d4f1[_0x5adb('0x3a')]['id']);for(var _0x47c631=0x0;_0x47c631<_0x462fa0['length'];_0x47c631+=0x1){let _0x3f3db9=_0x462fa0[_0x47c631];for(var _0x461a07=0x0;_0x461a07<_0x3f3db9[_0x5adb('0x5a')][_0x5adb('0x31')];_0x461a07+=0x1){let _0x277668=_0x3f3db9[_0x5adb('0x5a')][_0x461a07];var _0x31f5b2=_0x167432['clone']();_0x31f5b2[_0x5adb('0x25')](_0x5adb('0x69'),_0x277668['id']);_0x4a2ebc[_0x5adb('0x6a')](db[_0x5adb('0x5b')]['query'](_0x31f5b2[_0x5adb('0x6b')](),{'type':db[_0x5adb('0x5b')][_0x5adb('0x6c')][_0x5adb('0x6d')]})[_0x5adb('0x17')](function(_0x188cbd){if(_0x188cbd[_0x5adb('0x31')]===0x1){return _0x277668['id'];}else{var _0x2d1b65=_[_0x5adb('0x6e')](_['map'](_0x188cbd,_0x5adb('0x6f')),function(_0x456799){return _['includes'](_0x50f8ed,_0x456799);});if(_0x2d1b65){return _0x277668['id'];}}}));}}return BPromise[_0x5adb('0x70')](_0x4a2ebc)[_0x5adb('0x17')](function(_0x2b8915){_0x268df2=_(_0x268df2)[_0x5adb('0x71')](_0x2b8915)[_0x5adb('0x72')]()[_0x5adb('0x73')]();return db[_0x5adb('0x20')][_0x5adb('0x74')]({'where':{'id':_0x15d4f1['params']['id']}})[_0x5adb('0x17')](function(_0x2386c0){return db['sequelize'][_0x5adb('0x5c')](function(_0x58a26f){return _0x2386c0[_0x5adb('0x60')](_0x15d4f1['query']['ids'],{'transaction':_0x58a26f})[_0x5adb('0x17')](function(){if(!_[_0x5adb('0x75')](_0x268df2)){return _0x2386c0[_0x5adb('0x76')](_0x268df2,{'transaction':_0x58a26f});}})['then'](function(){_0x268df2[_0x5adb('0x5e')](function(_0x321c3a){socket[_0x5adb('0x77')](_0x5adb('0x78'),{'UserId':_0x321c3a,'SmsQueueId':_0x2386c0['id']});});});});});});})[_0x5adb('0x17')](respondWithStatusCode(_0x20faf6,null))[_0x5adb('0x2a')](handleError(_0x20faf6,null));};exports[_0x5adb('0x79')]=function(_0x463e84,_0x28bd33){return db[_0x5adb('0x20')][_0x5adb('0x74')]({'where':{'id':_0x463e84[_0x5adb('0x3a')]['id']}})['then'](handleEntityNotFound(_0x28bd33,null))['then'](function(_0x312463){if(_0x312463){return _0x312463[_0x5adb('0x79')](_0x463e84['body'][_0x5adb('0x54')],_[_0x5adb('0x7a')](_0x463e84[_0x5adb('0x39')],[_0x5adb('0x54'),'id'])||{})[_0x5adb('0x7b')](function(_0x24cd3b){for(var _0x15626b=0x0;_0x15626b<_0x463e84[_0x5adb('0x39')][_0x5adb('0x54')]['length'];_0x15626b+=0x1){socket[_0x5adb('0x77')](_0x5adb('0x5f'),{'UserId':Number(_0x463e84[_0x5adb('0x39')]['ids'][_0x15626b]),'SmsQueueId':Number(_0x463e84[_0x5adb('0x3a')]['id'])});}return _0x24cd3b;});}})[_0x5adb('0x17')](respondWithResult(_0x28bd33,null))[_0x5adb('0x2a')](handleError(_0x28bd33,null));};exports[_0x5adb('0x76')]=function(_0x64475f,_0x2a78f9){return db['SmsQueue'][_0x5adb('0x74')]({'where':{'id':_0x64475f[_0x5adb('0x3a')]['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0x2a78f9,null))[_0x5adb('0x17')](function(_0x2c3af8){if(_0x2c3af8){return _0x2c3af8[_0x5adb('0x76')](_0x64475f[_0x5adb('0x28')][_0x5adb('0x54')])[_0x5adb('0x17')](function(){if(_[_0x5adb('0x7c')](_0x64475f['query'][_0x5adb('0x54')])){for(var _0x5b9565=0x0;_0x5b9565<_0x64475f[_0x5adb('0x28')][_0x5adb('0x54')][_0x5adb('0x31')];_0x5b9565+=0x1){socket[_0x5adb('0x77')](_0x5adb('0x78'),{'UserId':Number(_0x64475f['query']['ids'][_0x5b9565]),'SmsQueueId':Number(_0x64475f[_0x5adb('0x3a')]['id'])});}}else{socket[_0x5adb('0x77')](_0x5adb('0x78'),{'UserId':Number(_0x64475f[_0x5adb('0x28')][_0x5adb('0x54')]),'SmsQueueId':Number(_0x64475f[_0x5adb('0x3a')]['id'])});}});}})['then'](respondWithStatusCode(_0x2a78f9,null))['catch'](handleError(_0x2a78f9,null));};exports[_0x5adb('0x7d')]=function(_0xd5b95d,_0x9d80fd){var _0x4f5721={};var _0x542626={};var _0x227c17;var _0x5982a5;return db[_0x5adb('0x20')][_0x5adb('0x3d')]({'where':{'id':_0xd5b95d['params']['id']}})['then'](handleEntityNotFound(_0x9d80fd,null))[_0x5adb('0x17')](function(_0x4bb198){if(_0x4bb198){_0x227c17=_0x4bb198;_0x542626['model']=_[_0x5adb('0x2d')](db[_0x5adb('0x46')][_0x5adb('0x21')]);_0x542626[_0x5adb('0x28')]=_[_0x5adb('0x2d')](_0xd5b95d[_0x5adb('0x28')]);_0x542626[_0x5adb('0x2e')]=_[_0x5adb('0x3e')](_0x542626[_0x5adb('0x2c')],_0x542626[_0x5adb('0x28')]);_0x4f5721[_0x5adb('0x30')]=_[_0x5adb('0x3e')](_0x542626[_0x5adb('0x2c')],qs['fields'](_0xd5b95d[_0x5adb('0x28')]['fields']));_0x4f5721[_0x5adb('0x30')]=_0x4f5721[_0x5adb('0x30')][_0x5adb('0x31')]?_0x4f5721[_0x5adb('0x30')]:_0x542626[_0x5adb('0x2c')];_0x4f5721[_0x5adb('0x41')]=qs[_0x5adb('0x42')](_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x42')]);_0x4f5721[_0x5adb('0x25')]=qs[_0x5adb('0x2e')](_[_0x5adb('0x50')](_0xd5b95d['query'],_0x542626[_0x5adb('0x2e')]));if(_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x51')]){_0x4f5721[_0x5adb('0x25')]=_[_0x5adb('0x44')](_0x4f5721[_0x5adb('0x25')],{'$or':_[_0x5adb('0x48')](_0x4f5721[_0x5adb('0x30')],function(_0x57c160){var _0xe7ddc4={};_0xe7ddc4[_0x57c160]={'$like':'%'+_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x51')]+'%'};return _0xe7ddc4;})});}_0x4f5721=_['merge']({},_0x4f5721,_0xd5b95d[_0x5adb('0x33')]);return _0x227c17['getAgents'](_0x4f5721);}})[_0x5adb('0x17')](function(_0x50c3a3){if(_0x50c3a3){_0x5982a5=_0x50c3a3['length'];if(!_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x3f')](_0x5adb('0x40'))){_0x4f5721[_0x5adb('0x12')]=qs[_0x5adb('0x12')](_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x12')]);_0x4f5721[_0x5adb('0x11')]=qs[_0x5adb('0x11')](_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x11')]);}return _0x227c17[_0x5adb('0x7d')](_0x4f5721);}})['then'](function(_0x364da7){if(_0x364da7){return _0x364da7?{'count':_0x5982a5,'rows':_0x364da7}:null;}})['then'](respondWithResult(_0x9d80fd,null))[_0x5adb('0x2a')](handleError(_0x9d80fd,null));}; \ No newline at end of file +var _0x7a54=['transaction','addTeams','each','findOrCreate','userSmsQueue:save','removeTeams','Team','select','field','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','QueryTypes','SELECT','every','includes','all','compact','isEmpty','forEach','userSmsQueue:remove','addAgents','omit','emit','removeAgents','isArray','getAgents','bluebird','util','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsQueue.socket','status','end','json','offset','undefined','count','set','Content-Range','update','destroy','then','get','SmsQueues','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','key','getOptions','where','SmsQueue','include','rows','catch','show','params','model','query','intersection','fields','attributes','includeAll','merge','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserSmsQueue','length','hasOwnProperty','limit','order','sort','filters','pick','filter','User','UserId','createdAt','format','%s/%s','smsPause','getTeams','keys','nolimit','ids','findAll','Agents','online','voicePause','interface','flatMap','sequelize'];(function(_0x311507,_0x5766af){var _0x3ae0d6=function(_0x653802){while(--_0x653802){_0x311507['push'](_0x311507['shift']());}};_0x3ae0d6(++_0x5766af);}(_0x7a54,0x106));var _0x47a5=function(_0x4e14d6,_0x475b5d){_0x4e14d6=_0x4e14d6-0x0;var _0x13b758=_0x7a54[_0x4e14d6];return _0x13b758;};'use strict';var BPromise=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var _=require(_0x47a5('0x2'));var squel=require('squel');var Redis=require(_0x47a5('0x3'));var qs=require(_0x47a5('0x4'));var logger=require('../../config/logger')(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var db=require(_0x47a5('0x7'))['db'];config[_0x47a5('0x8')]=_[_0x47a5('0x9')](config['redis'],{'host':_0x47a5('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x47a5('0x8')]));require(_0x47a5('0xb'))['register'](socket);function respondWithStatusCode(_0x194fb0,_0x5077f3){_0x5077f3=_0x5077f3||0xcc;return function(_0x5d90b3){if(_0x5d90b3){return _0x194fb0['sendStatus'](_0x5077f3);}return _0x194fb0[_0x47a5('0xc')](_0x5077f3)[_0x47a5('0xd')]();};}function respondWithResult(_0x5e31dd,_0x2eb0dd){_0x2eb0dd=_0x2eb0dd||0xc8;return function(_0x49e844){if(_0x49e844){return _0x5e31dd['status'](_0x2eb0dd)[_0x47a5('0xe')](_0x49e844);}};}function respondWithFilteredResult(_0x69e4d4,_0x2f399b){return function(_0x250fad){if(_0x250fad){var _0xd612dd=typeof _0x2f399b[_0x47a5('0xf')]===_0x47a5('0x10')&&typeof _0x2f399b['limit']===_0x47a5('0x10');var _0x221b54=_0x250fad[_0x47a5('0x11')];var _0x711793=_0xd612dd?0x0:_0x2f399b[_0x47a5('0xf')];var _0x620ee9=_0xd612dd?_0x250fad[_0x47a5('0x11')]:_0x2f399b[_0x47a5('0xf')]+_0x2f399b['limit'];var _0x362359;if(_0x620ee9>=_0x221b54){_0x620ee9=_0x221b54;_0x362359=0xc8;}else{_0x362359=0xce;}_0x69e4d4[_0x47a5('0xc')](_0x362359);return _0x69e4d4[_0x47a5('0x12')](_0x47a5('0x13'),_0x711793+'-'+_0x620ee9+'/'+_0x221b54)[_0x47a5('0xe')](_0x250fad);}return null;};}function saveUpdates(_0x574af6){return function(_0x549de3){if(_0x549de3){return _0x549de3[_0x47a5('0x14')](_0x574af6)['then'](function(_0x5247fd){return _0x5247fd;});}return null;};}function removeEntity(_0x423a81){return function(_0xaf70a6){if(_0xaf70a6){return _0xaf70a6[_0x47a5('0x15')]()[_0x47a5('0x16')](function(){var _0x477b1d=_0xaf70a6[_0x47a5('0x17')]({'plain':!![]});var _0x2763d6=_0x47a5('0x18');return db[_0x47a5('0x19')]['destroy']({'where':{'type':_0x2763d6,'resourceId':_0x477b1d['id']}})[_0x47a5('0x16')](function(){return _0xaf70a6;});})[_0x47a5('0x16')](function(){_0x423a81['status'](0xcc)[_0x47a5('0xd')]();});}};}function handleEntityNotFound(_0x1f03f7){return function(_0x36874d){if(!_0x36874d){_0x1f03f7['sendStatus'](0x194);}return _0x36874d;};}function handleError(_0xb8ae6c,_0x2f142b){_0x2f142b=_0x2f142b||0x1f4;return function(_0x23db32){logger[_0x47a5('0x1a')](_0x23db32['stack']);if(_0x23db32[_0x47a5('0x1b')]){delete _0x23db32[_0x47a5('0x1b')];}_0xb8ae6c['status'](_0x2f142b)[_0x47a5('0x1c')](_0x23db32);};}exports[_0x47a5('0x1d')]=function(_0x4437f1,_0x129ce5){var _0x3abd6a={};var _0x50bf17={'count':0x0,'rows':[]};var _0x53078a=_[_0x47a5('0x1e')](db['SmsQueue'][_0x47a5('0x1f')],function(_0x5b6c4e){return{'name':_0x5b6c4e[_0x47a5('0x20')],'type':_0x5b6c4e[_0x47a5('0x21')][_0x47a5('0x22')]};});_0x3abd6a=qs[_0x47a5('0x23')](_0x53078a,_0x4437f1);var _0x21f296={'where':_0x3abd6a[_0x47a5('0x24')]};return db[_0x47a5('0x25')][_0x47a5('0x11')](_0x21f296)[_0x47a5('0x16')](function(_0x361bfa){_0x50bf17[_0x47a5('0x11')]=_0x361bfa;_0x3abd6a[_0x47a5('0x26')]=qs[_0x47a5('0x26')](_0x4437f1['query']);return db[_0x47a5('0x25')]['findAll'](_0x3abd6a);})[_0x47a5('0x16')](function(_0x9ac908){_0x50bf17[_0x47a5('0x27')]=_0x9ac908;return _0x50bf17;})['then'](respondWithFilteredResult(_0x129ce5,_0x3abd6a))[_0x47a5('0x28')](handleError(_0x129ce5,null));};exports[_0x47a5('0x29')]=function(_0x39b50b,_0x1f1c68){var _0x51cc81={'raw':!![],'where':{'id':_0x39b50b[_0x47a5('0x2a')]['id']}},_0x50d875={};_0x50d875[_0x47a5('0x2b')]=_['keys'](db['SmsQueue'][_0x47a5('0x1f')]);_0x50d875[_0x47a5('0x2c')]=_['keys'](_0x39b50b[_0x47a5('0x2c')]);_0x50d875['filters']=_[_0x47a5('0x2d')](_0x50d875[_0x47a5('0x2b')],_0x50d875['query']);_0x51cc81['attributes']=_[_0x47a5('0x2d')](_0x50d875['model'],qs[_0x47a5('0x2e')](_0x39b50b[_0x47a5('0x2c')][_0x47a5('0x2e')]));_0x51cc81['attributes']=_0x51cc81[_0x47a5('0x2f')]['length']?_0x51cc81['attributes']:_0x50d875[_0x47a5('0x2b')];if(_0x39b50b['query'][_0x47a5('0x30')]){_0x51cc81['include']=[{'all':!![]}];}_0x51cc81=_[_0x47a5('0x31')]({},_0x51cc81,_0x39b50b[_0x47a5('0x32')]);return db[_0x47a5('0x25')][_0x47a5('0x33')](_0x51cc81)[_0x47a5('0x16')](handleEntityNotFound(_0x1f1c68,null))[_0x47a5('0x16')](respondWithResult(_0x1f1c68,null))[_0x47a5('0x28')](handleError(_0x1f1c68,null));};exports[_0x47a5('0x34')]=function(_0x1a0d23,_0x4caed5){return db[_0x47a5('0x25')][_0x47a5('0x34')](_0x1a0d23['body'],{})[_0x47a5('0x16')](function(_0x2bf53d){var _0x1d4348=_0x1a0d23['user'][_0x47a5('0x17')]({'plain':!![]});if(!_0x1d4348)throw new Error(_0x47a5('0x35'));if(_0x1d4348['role']===_0x47a5('0x36')){var _0x19218a=_0x2bf53d['get']({'plain':!![]});var _0x55c5eb='SmsQueues';return db[_0x47a5('0x37')]['find']({'where':{'name':_0x55c5eb,'userProfileId':_0x1d4348[_0x47a5('0x38')]},'raw':!![]})[_0x47a5('0x16')](function(_0x301a85){if(_0x301a85&&_0x301a85[_0x47a5('0x39')]===0x0){return db[_0x47a5('0x19')][_0x47a5('0x34')]({'name':_0x19218a[_0x47a5('0x1b')],'resourceId':_0x19218a['id'],'type':_0x301a85[_0x47a5('0x1b')],'sectionId':_0x301a85['id']},{})[_0x47a5('0x16')](function(){return _0x2bf53d;});}else{return _0x2bf53d;}})[_0x47a5('0x28')](function(_0x280500){logger[_0x47a5('0x1a')](_0x47a5('0x3a'),_0x280500);throw _0x280500;});}return _0x2bf53d;})['then'](respondWithResult(_0x4caed5,0xc9))[_0x47a5('0x28')](handleError(_0x4caed5,null));};exports[_0x47a5('0x14')]=function(_0x331474,_0x23bd8d){if(_0x331474['body']['id']){delete _0x331474[_0x47a5('0x3b')]['id'];}return db['SmsQueue']['find']({'where':{'id':_0x331474['params']['id']}})['then'](handleEntityNotFound(_0x23bd8d,null))[_0x47a5('0x16')](saveUpdates(_0x331474['body'],null))[_0x47a5('0x16')](respondWithResult(_0x23bd8d,null))[_0x47a5('0x28')](handleError(_0x23bd8d,null));};exports[_0x47a5('0x15')]=function(_0x494526,_0x3805fd){return db[_0x47a5('0x25')]['find']({'where':{'id':_0x494526['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x3805fd,null))['then'](removeEntity(_0x3805fd,null))[_0x47a5('0x28')](handleError(_0x3805fd,null));};exports[_0x47a5('0x3c')]=function(_0x188614,_0xd75ca3){return db[_0x47a5('0x25')][_0x47a5('0x3c')]()[_0x47a5('0x16')](respondWithResult(_0xd75ca3,null))[_0x47a5('0x28')](handleError(_0xd75ca3,null));};exports[_0x47a5('0x3d')]=function(_0x162fa0,_0x24ecb1){var _0x3c3ebf={'raw':!![],'where':{}},_0xe28d76={},_0x3574d4;return db[_0x47a5('0x25')][_0x47a5('0x3e')]({'where':{'id':_0x162fa0['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x24ecb1,null))[_0x47a5('0x16')](function(_0x49eab1){if(_0x49eab1){_0x3574d4=_0x49eab1['get']({'plain':!![]});_0xe28d76[_0x47a5('0x2b')]=_['keys'](db[_0x47a5('0x3f')][_0x47a5('0x1f')]);_0xe28d76['query']=_['keys'](_0x162fa0[_0x47a5('0x2c')]);_0xe28d76['filters']=_[_0x47a5('0x2d')](_0xe28d76[_0x47a5('0x2b')],_0xe28d76[_0x47a5('0x2c')]);_0x3c3ebf[_0x47a5('0x2f')]=_[_0x47a5('0x2d')](_0xe28d76[_0x47a5('0x2b')],qs[_0x47a5('0x2e')](_0x162fa0['query']['fields']));_0x3c3ebf[_0x47a5('0x2f')]=_0x3c3ebf[_0x47a5('0x2f')][_0x47a5('0x40')]?_0x3c3ebf[_0x47a5('0x2f')]:_0xe28d76[_0x47a5('0x2b')];if(!_0x162fa0[_0x47a5('0x2c')][_0x47a5('0x41')]('nolimit')){_0x3c3ebf[_0x47a5('0x42')]=qs[_0x47a5('0x42')](_0x162fa0[_0x47a5('0x2c')]['limit']);_0x3c3ebf[_0x47a5('0xf')]=qs['offset'](_0x162fa0[_0x47a5('0x2c')][_0x47a5('0xf')]);}_0x3c3ebf[_0x47a5('0x43')]=qs[_0x47a5('0x44')](_0x162fa0['query'][_0x47a5('0x44')]);_0x3c3ebf[_0x47a5('0x24')]=qs[_0x47a5('0x45')](_[_0x47a5('0x46')](_0x162fa0[_0x47a5('0x2c')],_0xe28d76[_0x47a5('0x45')]));_0x3c3ebf[_0x47a5('0x24')]['SmsQueueId']=_0x49eab1['id'];if(_0x162fa0[_0x47a5('0x2c')][_0x47a5('0x47')]){_0x3c3ebf[_0x47a5('0x24')]=_[_0x47a5('0x31')](_0x3c3ebf[_0x47a5('0x24')],{'$or':_[_0x47a5('0x1e')](_0x3c3ebf['attributes'],function(_0x1ad6a9){var _0x245a15={};_0x245a15[_0x1ad6a9]={'$like':'%'+_0x162fa0[_0x47a5('0x2c')]['filter']+'%'};return _0x245a15;})});}_0x3c3ebf=_[_0x47a5('0x31')]({},_0x3c3ebf,_0x162fa0[_0x47a5('0x32')]);return db[_0x47a5('0x3f')]['findAll'](_0x3c3ebf);}})['then'](function(_0x274e38){if(_0x274e38){return db[_0x47a5('0x48')]['findAndCountAll']({'where':{'id':_['map'](_0x274e38,_0x47a5('0x49')),'role':'agent'},'attributes':['id',_0x47a5('0x1b'),'smsPause','updatedAt',_0x47a5('0x4a')]});}})[_0x47a5('0x16')](function(_0x53eedf){if(_0x53eedf){return{'count':_0x53eedf[_0x47a5('0x11')],'rows':_[_0x47a5('0x1e')](_0x53eedf['rows'],function(_0x5b6127){return{'membername':_0x5b6127[_0x47a5('0x1b')],'UserId':_0x5b6127['id'],'queue_name':_0x3574d4[_0x47a5('0x1b')],'SmsQueueId':_0x3574d4['id'],'interface':util[_0x47a5('0x4b')](_0x47a5('0x4c'),'SIP',_0x5b6127[_0x47a5('0x1b')]),'penalty':0x0,'paused':_0x5b6127[_0x47a5('0x4d')],'createdAt':_0x5b6127[_0x47a5('0x4a')],'updatedAt':_0x5b6127['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x47a5('0x16')](respondWithFilteredResult(_0x24ecb1,_0x3c3ebf))['catch'](handleError(_0x24ecb1,null));};exports[_0x47a5('0x4e')]=function(_0x470da6,_0x943a15){var _0x1c485b={};var _0x3603b7={};var _0x4966af;var _0x144af9;return db['SmsQueue']['findOne']({'where':{'id':_0x470da6['params']['id']}})['then'](handleEntityNotFound(_0x943a15,null))[_0x47a5('0x16')](function(_0x6cd4ea){if(_0x6cd4ea){_0x4966af=_0x6cd4ea;_0x3603b7[_0x47a5('0x2b')]=_['keys'](db['Team'][_0x47a5('0x1f')]);_0x3603b7[_0x47a5('0x2c')]=_[_0x47a5('0x4f')](_0x470da6[_0x47a5('0x2c')]);_0x3603b7[_0x47a5('0x45')]=_['intersection'](_0x3603b7[_0x47a5('0x2b')],_0x3603b7['query']);_0x1c485b[_0x47a5('0x2f')]=_[_0x47a5('0x2d')](_0x3603b7['model'],qs[_0x47a5('0x2e')](_0x470da6[_0x47a5('0x2c')][_0x47a5('0x2e')]));_0x1c485b[_0x47a5('0x2f')]=_0x1c485b[_0x47a5('0x2f')][_0x47a5('0x40')]?_0x1c485b[_0x47a5('0x2f')]:_0x3603b7[_0x47a5('0x2b')];_0x1c485b['order']=qs[_0x47a5('0x44')](_0x470da6[_0x47a5('0x2c')][_0x47a5('0x44')]);_0x1c485b[_0x47a5('0x24')]=qs[_0x47a5('0x45')](_['pick'](_0x470da6[_0x47a5('0x2c')],_0x3603b7[_0x47a5('0x45')]));if(_0x470da6[_0x47a5('0x2c')][_0x47a5('0x47')]){_0x1c485b[_0x47a5('0x24')]=_[_0x47a5('0x31')](_0x1c485b[_0x47a5('0x24')],{'$or':_[_0x47a5('0x1e')](_0x1c485b[_0x47a5('0x2f')],function(_0x44cb90){var _0x1d56f3={};_0x1d56f3[_0x44cb90]={'$like':'%'+_0x470da6[_0x47a5('0x2c')][_0x47a5('0x47')]+'%'};return _0x1d56f3;})});}_0x1c485b=_[_0x47a5('0x31')]({},_0x1c485b,_0x470da6[_0x47a5('0x32')]);return _0x4966af['getTeams'](_0x1c485b);}})[_0x47a5('0x16')](function(_0x284fb8){if(_0x284fb8){_0x144af9=_0x284fb8[_0x47a5('0x40')];if(!_0x470da6['query'][_0x47a5('0x41')](_0x47a5('0x50'))){_0x1c485b[_0x47a5('0x42')]=qs[_0x47a5('0x42')](_0x470da6['query'][_0x47a5('0x42')]);_0x1c485b['offset']=qs[_0x47a5('0xf')](_0x470da6['query'][_0x47a5('0xf')]);}return _0x4966af['getTeams'](_0x1c485b);}})[_0x47a5('0x16')](function(_0x2f27c3){if(_0x2f27c3){return _0x2f27c3?{'count':_0x144af9,'rows':_0x2f27c3}:null;}})[_0x47a5('0x16')](respondWithResult(_0x943a15,null))['catch'](handleError(_0x943a15,null));};exports['addTeams']=function(_0x4b8084,_0x4164a3){var _0x2b1303=_0x4b8084[_0x47a5('0x3b')][_0x47a5('0x51')];return db['Team'][_0x47a5('0x52')]({'where':{'id':_0x2b1303},'attributes':['id'],'include':[{'model':db[_0x47a5('0x48')],'as':_0x47a5('0x53'),'attributes':['id',_0x47a5('0x1b'),_0x47a5('0x54'),_0x47a5('0x55'),_0x47a5('0x56')],'raw':!![]}]})[_0x47a5('0x16')](function(_0x4618a0){if(_0x4618a0){var _0xc69a68=_[_0x47a5('0x57')](_0x4618a0,function(_0x463e5e){var _0x49d3dc=_0x463e5e[_0x47a5('0x17')]({'plain':!![]});return _0x49d3dc['Agents'];});return db[_0x47a5('0x25')][_0x47a5('0x33')]({'where':{'id':_0x4b8084[_0x47a5('0x2a')]['id']}})[_0x47a5('0x16')](function(_0x40e584){return db[_0x47a5('0x58')][_0x47a5('0x59')](function(_0x448981){return _0x40e584[_0x47a5('0x5a')](_0x2b1303,{'transaction':_0x448981})[_0x47a5('0x16')](function(){return BPromise[_0x47a5('0x5b')](_0xc69a68,function(_0x1f07ac){return db[_0x47a5('0x3f')][_0x47a5('0x5c')]({'where':{'UserId':_0x1f07ac['id'],'SmsQueueId':_0x4b8084[_0x47a5('0x2a')]['id']},'transaction':_0x448981});});})['then'](function(){_0xc69a68['forEach'](function(_0x5ccc89){socket['emit'](_0x47a5('0x5d'),{'UserId':_0x5ccc89['id'],'SmsQueueId':_0x40e584['id']});});});});});}})[_0x47a5('0x16')](respondWithStatusCode(_0x4164a3,null))['catch'](handleError(_0x4164a3,null));};exports[_0x47a5('0x5e')]=function(_0x44dda2,_0x1baa5a){return db[_0x47a5('0x5f')][_0x47a5('0x52')]({'where':{'id':_0x44dda2[_0x47a5('0x2c')][_0x47a5('0x51')]},'attributes':['id'],'include':[{'model':db[_0x47a5('0x48')],'as':_0x47a5('0x53'),'attributes':['id'],'raw':!![]}]})[_0x47a5('0x16')](handleEntityNotFound(_0x1baa5a,null))[_0x47a5('0x16')](function(_0x5e5f16){var _0x18fa31=_[_0x47a5('0x1e')](_0x5e5f16,'id');var _0x420671=[];var _0x4f35ff=[];var _0x340846=squel[_0x47a5('0x60')]();_0x340846[_0x47a5('0x61')]('tq.TeamId')[_0x47a5('0x62')]('team_has_sms_queues','tq')['join'](_0x47a5('0x63'),'ut',_0x47a5('0x64'))[_0x47a5('0x24')](_0x47a5('0x65'),_0x44dda2[_0x47a5('0x2a')]['id']);for(var _0xea50f3=0x0;_0xea50f3<_0x5e5f16['length'];_0xea50f3+=0x1){let _0x592322=_0x5e5f16[_0xea50f3];for(var _0x3e0dbd=0x0;_0x3e0dbd<_0x592322['Agents'][_0x47a5('0x40')];_0x3e0dbd+=0x1){let _0x3fffd1=_0x592322[_0x47a5('0x53')][_0x3e0dbd];var _0xb16bdd=_0x340846['clone']();_0xb16bdd[_0x47a5('0x24')]('ut.UserId\x20=\x20?',_0x3fffd1['id']);_0x4f35ff['push'](db[_0x47a5('0x58')][_0x47a5('0x2c')](_0xb16bdd['toString'](),{'type':db[_0x47a5('0x58')][_0x47a5('0x66')][_0x47a5('0x67')]})['then'](function(_0x280372){if(_0x280372['length']===0x1){return _0x3fffd1['id'];}else{var _0x2307da=_[_0x47a5('0x68')](_[_0x47a5('0x1e')](_0x280372,'TeamId'),function(_0x2e0af1){return _[_0x47a5('0x69')](_0x18fa31,_0x2e0af1);});if(_0x2307da){return _0x3fffd1['id'];}}}));}}return BPromise[_0x47a5('0x6a')](_0x4f35ff)['then'](function(_0x3525e7){_0x420671=_(_0x420671)['union'](_0x3525e7)[_0x47a5('0x6b')]()['value']();return db[_0x47a5('0x25')][_0x47a5('0x33')]({'where':{'id':_0x44dda2[_0x47a5('0x2a')]['id']}})[_0x47a5('0x16')](function(_0x51738b){return db[_0x47a5('0x58')][_0x47a5('0x59')](function(_0x23c393){return _0x51738b[_0x47a5('0x5e')](_0x44dda2[_0x47a5('0x2c')]['ids'],{'transaction':_0x23c393})['then'](function(){if(!_[_0x47a5('0x6c')](_0x420671)){return _0x51738b['removeAgents'](_0x420671,{'transaction':_0x23c393});}})[_0x47a5('0x16')](function(){_0x420671[_0x47a5('0x6d')](function(_0x216402){socket['emit'](_0x47a5('0x6e'),{'UserId':_0x216402,'SmsQueueId':_0x51738b['id']});});});});});});})[_0x47a5('0x16')](respondWithStatusCode(_0x1baa5a,null))['catch'](handleError(_0x1baa5a,null));};exports[_0x47a5('0x6f')]=function(_0x8a9dea,_0x19acfa){return db[_0x47a5('0x25')]['find']({'where':{'id':_0x8a9dea['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x19acfa,null))[_0x47a5('0x16')](function(_0x48e7f3){if(_0x48e7f3){return _0x48e7f3[_0x47a5('0x6f')](_0x8a9dea[_0x47a5('0x3b')]['ids'],_[_0x47a5('0x70')](_0x8a9dea[_0x47a5('0x3b')],[_0x47a5('0x51'),'id'])||{})['spread'](function(_0x3f2ad9){for(var _0x59b4a5=0x0;_0x59b4a5<_0x8a9dea[_0x47a5('0x3b')]['ids'][_0x47a5('0x40')];_0x59b4a5+=0x1){socket[_0x47a5('0x71')]('userSmsQueue:save',{'UserId':Number(_0x8a9dea[_0x47a5('0x3b')]['ids'][_0x59b4a5]),'SmsQueueId':Number(_0x8a9dea[_0x47a5('0x2a')]['id'])});}return _0x3f2ad9;});}})[_0x47a5('0x16')](respondWithResult(_0x19acfa,null))[_0x47a5('0x28')](handleError(_0x19acfa,null));};exports[_0x47a5('0x72')]=function(_0x49b76a,_0x3eb5c1){return db['SmsQueue']['find']({'where':{'id':_0x49b76a[_0x47a5('0x2a')]['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x3eb5c1,null))[_0x47a5('0x16')](function(_0x96fb22){if(_0x96fb22){return _0x96fb22[_0x47a5('0x72')](_0x49b76a['query'][_0x47a5('0x51')])[_0x47a5('0x16')](function(){if(_[_0x47a5('0x73')](_0x49b76a[_0x47a5('0x2c')]['ids'])){for(var _0x240db9=0x0;_0x240db9<_0x49b76a['query'][_0x47a5('0x51')][_0x47a5('0x40')];_0x240db9+=0x1){socket[_0x47a5('0x71')](_0x47a5('0x6e'),{'UserId':Number(_0x49b76a[_0x47a5('0x2c')][_0x47a5('0x51')][_0x240db9]),'SmsQueueId':Number(_0x49b76a[_0x47a5('0x2a')]['id'])});}}else{socket[_0x47a5('0x71')](_0x47a5('0x6e'),{'UserId':Number(_0x49b76a['query'][_0x47a5('0x51')]),'SmsQueueId':Number(_0x49b76a[_0x47a5('0x2a')]['id'])});}});}})['then'](respondWithStatusCode(_0x3eb5c1,null))[_0x47a5('0x28')](handleError(_0x3eb5c1,null));};exports[_0x47a5('0x74')]=function(_0x6d6a5,_0x5b85cd){var _0x4bf1f5={};var _0x126bb1={};var _0x3d7371;var _0x47fbb6;return db['SmsQueue'][_0x47a5('0x3e')]({'where':{'id':_0x6d6a5[_0x47a5('0x2a')]['id']}})['then'](handleEntityNotFound(_0x5b85cd,null))[_0x47a5('0x16')](function(_0x269ff6){if(_0x269ff6){_0x3d7371=_0x269ff6;_0x126bb1['model']=_[_0x47a5('0x4f')](db[_0x47a5('0x48')][_0x47a5('0x1f')]);_0x126bb1[_0x47a5('0x2c')]=_[_0x47a5('0x4f')](_0x6d6a5[_0x47a5('0x2c')]);_0x126bb1['filters']=_['intersection'](_0x126bb1['model'],_0x126bb1[_0x47a5('0x2c')]);_0x4bf1f5[_0x47a5('0x2f')]=_['intersection'](_0x126bb1[_0x47a5('0x2b')],qs[_0x47a5('0x2e')](_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0x2e')]));_0x4bf1f5[_0x47a5('0x2f')]=_0x4bf1f5['attributes'][_0x47a5('0x40')]?_0x4bf1f5['attributes']:_0x126bb1['model'];_0x4bf1f5['order']=qs[_0x47a5('0x44')](_0x6d6a5['query'][_0x47a5('0x44')]);_0x4bf1f5[_0x47a5('0x24')]=qs[_0x47a5('0x45')](_['pick'](_0x6d6a5[_0x47a5('0x2c')],_0x126bb1[_0x47a5('0x45')]));if(_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0x47')]){_0x4bf1f5[_0x47a5('0x24')]=_['merge'](_0x4bf1f5[_0x47a5('0x24')],{'$or':_[_0x47a5('0x1e')](_0x4bf1f5['attributes'],function(_0x42ba59){var _0x419870={};_0x419870[_0x42ba59]={'$like':'%'+_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0x47')]+'%'};return _0x419870;})});}_0x4bf1f5=_[_0x47a5('0x31')]({},_0x4bf1f5,_0x6d6a5[_0x47a5('0x32')]);return _0x3d7371['getAgents'](_0x4bf1f5);}})[_0x47a5('0x16')](function(_0x2e418d){if(_0x2e418d){_0x47fbb6=_0x2e418d['length'];if(!_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0x41')](_0x47a5('0x50'))){_0x4bf1f5[_0x47a5('0x42')]=qs['limit'](_0x6d6a5['query']['limit']);_0x4bf1f5['offset']=qs[_0x47a5('0xf')](_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0xf')]);}return _0x3d7371[_0x47a5('0x74')](_0x4bf1f5);}})[_0x47a5('0x16')](function(_0x6bc37b){if(_0x6bc37b){return _0x6bc37b?{'count':_0x47fbb6,'rows':_0x6bc37b}:null;}})[_0x47a5('0x16')](respondWithResult(_0x5b85cd,null))[_0x47a5('0x28')](handleError(_0x5b85cd,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 3db60d0..f92f94e 100644 --- a/server/api/smsQueue/smsQueue.events.js +++ b/server/api/smsQueue/smsQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf806=['SmsQueue','save','emit','hook','exports','events'];(function(_0x56c70f,_0x4e4493){var _0x3812ed=function(_0x25460f){while(--_0x25460f){_0x56c70f['push'](_0x56c70f['shift']());}};_0x3812ed(++_0x4e4493);}(_0xf806,0x6b));var _0x6f80=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf806[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x6f80('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0x6f80('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6f80('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x29af7d){return function(_0x158a9c,_0x2f3ce5,_0x10c519){SmsQueueEvents['emit'](_0x29af7d+':'+_0x158a9c['id'],_0x158a9c);SmsQueueEvents[_0x6f80('0x3')](_0x29af7d,_0x158a9c);_0x10c519(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x6f80('0x4')](e,emitEvent(event));}}module[_0x6f80('0x5')]=SmsQueueEvents; \ No newline at end of file +var _0x9c29=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','SmsQueue','setMaxListeners','save'];(function(_0x45fc0a,_0x10cfdf){var _0xcc882b=function(_0x3b46a6){while(--_0x3b46a6){_0x45fc0a['push'](_0x45fc0a['shift']());}};_0xcc882b(++_0x10cfdf);}(_0x9c29,0x1f4));var _0x99c2=function(_0x11e4eb,_0x3d920f){_0x11e4eb=_0x11e4eb-0x0;var _0xf49c4b=_0x9c29[_0x11e4eb];return _0xf49c4b;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0x99c2('0x0'))['db'][_0x99c2('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x99c2('0x2')](0x0);var events={'afterCreate':_0x99c2('0x3'),'afterUpdate':'update','afterDestroy':_0x99c2('0x4')};function emitEvent(_0x40f9c8){return function(_0x284af4,_0x5e934a,_0x19bfb6){SmsQueueEvents[_0x99c2('0x5')](_0x40f9c8+':'+_0x284af4['id'],_0x284af4);SmsQueueEvents[_0x99c2('0x5')](_0x40f9c8,_0x284af4);_0x19bfb6(null);};}for(var e in events){if(events[_0x99c2('0x6')](e)){var event=events[e];SmsQueue[_0x99c2('0x7')](e,emitEvent(event));}}module[_0x99c2('0x8')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index d4b1fc1..3ad8be8 100644 --- a/server/api/smsQueue/smsQueue.model.js +++ b/server/api/smsQueue/smsQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x99fe=['moment','bluebird','request-promise','path','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','util','../../config/logger','api'];(function(_0x832043,_0x59881e){var _0x2eeb21=function(_0x31dc4e){while(--_0x31dc4e){_0x832043['push'](_0x832043['shift']());}};_0x2eeb21(++_0x59881e);}(_0x99fe,0xbd));var _0xe99f=function(_0x441e18,_0x2a4780){_0x441e18=_0x441e18-0x0;var _0x4adf21=_0x99fe[_0x441e18];return _0x4adf21;};'use strict';var _=require('lodash');var util=require(_0xe99f('0x0'));var logger=require(_0xe99f('0x1'))(_0xe99f('0x2'));var moment=require(_0xe99f('0x3'));var BPromise=require(_0xe99f('0x4'));var rp=require(_0xe99f('0x5'));var fs=require('fs');var path=require(_0xe99f('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe99f('0x7'));module[_0xe99f('0x8')]=function(_0x36b27a,_0x1f17d6){return _0x36b27a[_0xe99f('0x9')](_0xe99f('0xa'),attributes,{'tableName':_0xe99f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe9e8=['request-promise','path','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x33a694,_0x9b6640){var _0x41ff01=function(_0x4c38b7){while(--_0x4c38b7){_0x33a694['push'](_0x33a694['shift']());}};_0x41ff01(++_0x9b6640);}(_0xe9e8,0x7c));var _0x8e9e=function(_0x1bba88,_0x4729a1){_0x1bba88=_0x1bba88-0x0;var _0x39dfcd=_0xe9e8[_0x1bba88];return _0x39dfcd;};'use strict';var _=require(_0x8e9e('0x0'));var util=require(_0x8e9e('0x1'));var logger=require(_0x8e9e('0x2'))(_0x8e9e('0x3'));var moment=require(_0x8e9e('0x4'));var BPromise=require(_0x8e9e('0x5'));var rp=require(_0x8e9e('0x6'));var fs=require('fs');var path=require(_0x8e9e('0x7'));var rimraf=require('rimraf');var config=require(_0x8e9e('0x8'));var attributes=require(_0x8e9e('0x9'));module[_0x8e9e('0xa')]=function(_0x462926,_0x1a9dfa){return _0x462926[_0x8e9e('0xb')](_0x8e9e('0xc'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index 9698cb6..0642dec 100644 --- a/server/api/smsQueue/smsQueue.rpc.js +++ b/server/api/smsQueue/smsQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd910=['model','debug','catch','find','ShowSmsQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','SmsQueue,\x20%s,\x20%s','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','GetSmsQueue','SmsQueue','options','raw','attributes','include','map'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0xd910,0x116));var _0x0d91=function(_0x31e87a,_0xb14bd7){_0x31e87a=_0x31e87a-0x0;var _0x234ddd=_0xd910[_0x31e87a];return _0x234ddd;};'use strict';var _=require(_0x0d91('0x0'));var util=require(_0x0d91('0x1'));var moment=require(_0x0d91('0x2'));var BPromise=require(_0x0d91('0x3'));var rs=require(_0x0d91('0x4'));var fs=require('fs');var Redis=require(_0x0d91('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0d91('0x6'))(_0x0d91('0x7'));var config=require(_0x0d91('0x8'));var jayson=require(_0x0d91('0x9'));var client=jayson[_0x0d91('0xa')][_0x0d91('0xb')]({'port':0x232a});config[_0x0d91('0xc')]=_[_0x0d91('0xd')](config[_0x0d91('0xc')],{'host':_0x0d91('0xe'),'port':0x18eb});var socket=require(_0x0d91('0xf'))(new Redis(config[_0x0d91('0xc')]));require('./smsQueue.socket')[_0x0d91('0x10')](socket);function respondWithRpcPromise(_0xc0c306,_0x446dfd,_0x220030){return new BPromise(function(_0x488a94,_0x2777b3){return client[_0x0d91('0x11')](_0xc0c306,_0x220030)[_0x0d91('0x12')](function(_0x5e6a64){logger[_0x0d91('0x13')](_0x0d91('0x14'),_0x446dfd,'request\x20sent');logger['debug'](_0x0d91('0x15'),_0x446dfd,_0x0d91('0x16'),JSON[_0x0d91('0x17')](_0x5e6a64));if(_0x5e6a64[_0x0d91('0x18')]){if(_0x5e6a64[_0x0d91('0x18')]['code']===0x1f4){logger[_0x0d91('0x18')](_0x0d91('0x14'),_0x446dfd,_0x5e6a64[_0x0d91('0x18')][_0x0d91('0x19')]);return _0x2777b3(_0x5e6a64['error'][_0x0d91('0x19')]);}logger['error'](_0x0d91('0x14'),_0x446dfd,_0x5e6a64[_0x0d91('0x18')][_0x0d91('0x19')]);return _0x488a94(_0x5e6a64[_0x0d91('0x18')][_0x0d91('0x19')]);}else{logger[_0x0d91('0x13')](_0x0d91('0x14'),_0x446dfd,_0x0d91('0x16'));_0x488a94(_0x5e6a64[_0x0d91('0x1a')][_0x0d91('0x19')]);}})['catch'](function(_0x2e8526){logger[_0x0d91('0x18')]('SmsQueue,\x20%s,\x20%s',_0x446dfd,_0x2e8526);_0x2777b3(_0x2e8526);});});}exports[_0x0d91('0x1b')]=function(_0x3d76cb){var _0x36cdcc=this;return new Promise(function(_0x2232f2,_0x414354){return db[_0x0d91('0x1c')]['findAll']({'raw':_0x3d76cb[_0x0d91('0x1d')]?_0x3d76cb['options'][_0x0d91('0x1e')]===undefined?!![]:![]:!![],'where':_0x3d76cb[_0x0d91('0x1d')]?_0x3d76cb['options']['where']||null:null,'attributes':_0x3d76cb[_0x0d91('0x1d')]?_0x3d76cb[_0x0d91('0x1d')][_0x0d91('0x1f')]||null:null,'limit':_0x3d76cb['options']?_0x3d76cb['options']['limit']||null:null,'include':_0x3d76cb[_0x0d91('0x1d')]?_0x3d76cb[_0x0d91('0x1d')][_0x0d91('0x20')]?_[_0x0d91('0x21')](_0x3d76cb[_0x0d91('0x1d')][_0x0d91('0x20')],function(_0x677f69){return{'model':db[_0x677f69[_0x0d91('0x22')]],'as':_0x677f69['as'],'attributes':_0x677f69[_0x0d91('0x1f')],'include':_0x677f69[_0x0d91('0x20')]?_[_0x0d91('0x21')](_0x677f69[_0x0d91('0x20')],function(_0x12f97a){return{'model':db[_0x12f97a[_0x0d91('0x22')]],'as':_0x12f97a['as'],'attributes':_0x12f97a[_0x0d91('0x1f')],'include':_0x12f97a[_0x0d91('0x20')]?_[_0x0d91('0x21')](_0x12f97a[_0x0d91('0x20')],function(_0x4df33c){return{'model':db[_0x4df33c[_0x0d91('0x22')]],'as':_0x4df33c['as'],'attributes':_0x4df33c[_0x0d91('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xb95e97){logger['info']('GetSmsQueue',_0x3d76cb);logger[_0x0d91('0x23')](_0x0d91('0x1b'),_0x3d76cb,JSON[_0x0d91('0x17')](_0xb95e97));_0x2232f2(_0xb95e97);})[_0x0d91('0x24')](function(_0x40919d){logger['error']('GetSmsQueue',_0x40919d[_0x0d91('0x19')],_0x3d76cb);_0x414354(_0x36cdcc[_0x0d91('0x18')](0x1f4,_0x40919d[_0x0d91('0x19')]));});});};exports['ShowSmsQueue']=function(_0x3f5343){var _0x5cf0d2=this;return new Promise(function(_0x4499e3,_0x157f97){return db['SmsQueue'][_0x0d91('0x25')]({'raw':_0x3f5343[_0x0d91('0x1d')]?_0x3f5343[_0x0d91('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x3f5343[_0x0d91('0x1d')]?_0x3f5343['options']['where']||null:null,'attributes':_0x3f5343['options']?_0x3f5343[_0x0d91('0x1d')]['attributes']||null:null,'include':_0x3f5343[_0x0d91('0x1d')]?_0x3f5343[_0x0d91('0x1d')][_0x0d91('0x20')]?_[_0x0d91('0x21')](_0x3f5343[_0x0d91('0x1d')][_0x0d91('0x20')],function(_0x1296e7){return{'model':db[_0x1296e7['model']],'as':_0x1296e7['as'],'attributes':_0x1296e7[_0x0d91('0x1f')],'include':_0x1296e7[_0x0d91('0x20')]?_[_0x0d91('0x21')](_0x1296e7[_0x0d91('0x20')],function(_0x3a70be){return{'model':db[_0x3a70be[_0x0d91('0x22')]],'as':_0x3a70be['as'],'attributes':_0x3a70be[_0x0d91('0x1f')],'include':_0x3a70be[_0x0d91('0x20')]?_[_0x0d91('0x21')](_0x3a70be[_0x0d91('0x20')],function(_0x2fc1ef){return{'model':db[_0x2fc1ef['model']],'as':_0x2fc1ef['as'],'attributes':_0x2fc1ef[_0x0d91('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x556969){logger[_0x0d91('0x13')](_0x0d91('0x26'),_0x3f5343);logger[_0x0d91('0x23')](_0x0d91('0x26'),_0x3f5343,JSON[_0x0d91('0x17')](_0x556969));_0x4499e3(_0x556969);})[_0x0d91('0x24')](function(_0x72806b){logger[_0x0d91('0x18')](_0x0d91('0x26'),_0x72806b[_0x0d91('0x19')],_0x3f5343);_0x157f97(_0x5cf0d2[_0x0d91('0x18')](0x1f4,_0x72806b[_0x0d91('0x19')]));});});}; \ No newline at end of file +var _0x8f8e=['include','model','attributes','then','ShowSmsQueue','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','request','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','limit','map'];(function(_0x1fd135,_0x12dd1b){var _0x53d2db=function(_0x19d475){while(--_0x19d475){_0x1fd135['push'](_0x1fd135['shift']());}};_0x53d2db(++_0x12dd1b);}(_0x8f8e,0x7a));var _0xe8f8=function(_0x307086,_0x3bfe4e){_0x307086=_0x307086-0x0;var _0x699043=_0x8f8e[_0x307086];return _0x699043;};'use strict';var _=require('lodash');var util=require(_0xe8f8('0x0'));var moment=require(_0xe8f8('0x1'));var BPromise=require(_0xe8f8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe8f8('0x3'));var db=require(_0xe8f8('0x4'))['db'];var utils=require(_0xe8f8('0x5'));var logger=require(_0xe8f8('0x6'))('rpc');var config=require(_0xe8f8('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe8f8('0x8')]['http']({'port':0x232a});config['redis']=_[_0xe8f8('0x9')](config[_0xe8f8('0xa')],{'host':_0xe8f8('0xb'),'port':0x18eb});var socket=require(_0xe8f8('0xc'))(new Redis(config[_0xe8f8('0xa')]));require(_0xe8f8('0xd'))['register'](socket);function respondWithRpcPromise(_0x13c720,_0x5baa9b,_0x3123f1){return new BPromise(function(_0x197e72,_0x1ffdde){return client[_0xe8f8('0xe')](_0x13c720,_0x3123f1)['then'](function(_0x34edd8){logger[_0xe8f8('0xf')](_0xe8f8('0x10'),_0x5baa9b,_0xe8f8('0x11'));logger[_0xe8f8('0x12')](_0xe8f8('0x13'),_0x5baa9b,_0xe8f8('0x11'),JSON[_0xe8f8('0x14')](_0x34edd8));if(_0x34edd8['error']){if(_0x34edd8[_0xe8f8('0x15')][_0xe8f8('0x16')]===0x1f4){logger[_0xe8f8('0x15')](_0xe8f8('0x10'),_0x5baa9b,_0x34edd8[_0xe8f8('0x15')][_0xe8f8('0x17')]);return _0x1ffdde(_0x34edd8[_0xe8f8('0x15')][_0xe8f8('0x17')]);}logger[_0xe8f8('0x15')](_0xe8f8('0x10'),_0x5baa9b,_0x34edd8[_0xe8f8('0x15')][_0xe8f8('0x17')]);return _0x197e72(_0x34edd8['error']['message']);}else{logger[_0xe8f8('0xf')]('SmsQueue,\x20%s,\x20%s',_0x5baa9b,_0xe8f8('0x11'));_0x197e72(_0x34edd8[_0xe8f8('0x18')][_0xe8f8('0x17')]);}})[_0xe8f8('0x19')](function(_0x2362d4){logger[_0xe8f8('0x15')]('SmsQueue,\x20%s,\x20%s',_0x5baa9b,_0x2362d4);_0x1ffdde(_0x2362d4);});});}exports[_0xe8f8('0x1a')]=function(_0x388f35){var _0x17b6d0=this;return new Promise(function(_0x53ce6c,_0x492c22){return db[_0xe8f8('0x1b')][_0xe8f8('0x1c')]({'raw':_0x388f35[_0xe8f8('0x1d')]?_0x388f35['options'][_0xe8f8('0x1e')]===undefined?!![]:![]:!![],'where':_0x388f35['options']?_0x388f35[_0xe8f8('0x1d')][_0xe8f8('0x1f')]||null:null,'attributes':_0x388f35[_0xe8f8('0x1d')]?_0x388f35[_0xe8f8('0x1d')]['attributes']||null:null,'limit':_0x388f35['options']?_0x388f35[_0xe8f8('0x1d')][_0xe8f8('0x20')]||null:null,'include':_0x388f35[_0xe8f8('0x1d')]?_0x388f35['options']['include']?_[_0xe8f8('0x21')](_0x388f35['options'][_0xe8f8('0x22')],function(_0x144283){return{'model':db[_0x144283[_0xe8f8('0x23')]],'as':_0x144283['as'],'attributes':_0x144283['attributes'],'include':_0x144283[_0xe8f8('0x22')]?_[_0xe8f8('0x21')](_0x144283[_0xe8f8('0x22')],function(_0x137cec){return{'model':db[_0x137cec[_0xe8f8('0x23')]],'as':_0x137cec['as'],'attributes':_0x137cec['attributes'],'include':_0x137cec['include']?_[_0xe8f8('0x21')](_0x137cec[_0xe8f8('0x22')],function(_0x37b959){return{'model':db[_0x37b959[_0xe8f8('0x23')]],'as':_0x37b959['as'],'attributes':_0x37b959[_0xe8f8('0x24')]};}):[]};}):[]};}):[]:[]})[_0xe8f8('0x25')](function(_0x47233d){logger['info'](_0xe8f8('0x1a'),_0x388f35);logger[_0xe8f8('0x12')](_0xe8f8('0x1a'),_0x388f35,JSON[_0xe8f8('0x14')](_0x47233d));_0x53ce6c(_0x47233d);})[_0xe8f8('0x19')](function(_0x109086){logger['error']('GetSmsQueue',_0x109086['message'],_0x388f35);_0x492c22(_0x17b6d0[_0xe8f8('0x15')](0x1f4,_0x109086[_0xe8f8('0x17')]));});});};exports[_0xe8f8('0x26')]=function(_0x12db09){var _0x3eefbf=this;return new Promise(function(_0x4e021b,_0x5d4e2b){return db[_0xe8f8('0x1b')]['find']({'raw':_0x12db09['options']?_0x12db09[_0xe8f8('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x12db09[_0xe8f8('0x1d')]?_0x12db09[_0xe8f8('0x1d')][_0xe8f8('0x1f')]||null:null,'attributes':_0x12db09[_0xe8f8('0x1d')]?_0x12db09['options'][_0xe8f8('0x24')]||null:null,'include':_0x12db09['options']?_0x12db09[_0xe8f8('0x1d')][_0xe8f8('0x22')]?_['map'](_0x12db09[_0xe8f8('0x1d')]['include'],function(_0x411c0b){return{'model':db[_0x411c0b['model']],'as':_0x411c0b['as'],'attributes':_0x411c0b[_0xe8f8('0x24')],'include':_0x411c0b['include']?_['map'](_0x411c0b[_0xe8f8('0x22')],function(_0x2750ce){return{'model':db[_0x2750ce[_0xe8f8('0x23')]],'as':_0x2750ce['as'],'attributes':_0x2750ce[_0xe8f8('0x24')],'include':_0x2750ce['include']?_[_0xe8f8('0x21')](_0x2750ce['include'],function(_0x41e066){return{'model':db[_0x41e066[_0xe8f8('0x23')]],'as':_0x41e066['as'],'attributes':_0x41e066[_0xe8f8('0x24')]};}):[]};}):[]};}):[]:[]})[_0xe8f8('0x25')](function(_0x3bceff){logger[_0xe8f8('0xf')](_0xe8f8('0x26'),_0x12db09);logger[_0xe8f8('0x12')](_0xe8f8('0x26'),_0x12db09,JSON[_0xe8f8('0x14')](_0x3bceff));_0x4e021b(_0x3bceff);})[_0xe8f8('0x19')](function(_0xdb3f91){logger[_0xe8f8('0x15')](_0xe8f8('0x26'),_0xdb3f91[_0xe8f8('0x17')],_0x12db09);_0x5d4e2b(_0x3eefbf[_0xe8f8('0x15')](0x1f4,_0xdb3f91['message']));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 11c9e82..dfbb21a 100644 --- a/server/api/smsQueue/smsQueue.socket.js +++ b/server/api/smsQueue/smsQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x219c=['length','smsQueue:','./smsQueue.events','save','removeListener'];(function(_0x5d6e30,_0xc21d51){var _0x3d3f3b=function(_0x33597b){while(--_0x33597b){_0x5d6e30['push'](_0x5d6e30['shift']());}};_0x3d3f3b(++_0xc21d51);}(_0x219c,0xca));var _0xc219=function(_0x1693da,_0xade59c){_0x1693da=_0x1693da-0x0;var _0x44187f=_0x219c[_0x1693da];return _0x44187f;};'use strict';var SmsQueueEvents=require(_0xc219('0x0'));var events=[_0xc219('0x1'),'remove','update'];function createListener(_0x51630a,_0x4ae01a){return function(_0x54ddee){_0x4ae01a['emit'](_0x51630a,_0x54ddee);};}function removeListener(_0x962872,_0x429cd7){return function(){SmsQueueEvents[_0xc219('0x2')](_0x962872,_0x429cd7);};}exports['register']=function(_0x5421c3){for(var _0x50ef90=0x0,_0x160eac=events[_0xc219('0x3')];_0x50ef90<_0x160eac;_0x50ef90++){var _0x90220b=events[_0x50ef90];var _0x484bf4=createListener(_0xc219('0x4')+_0x90220b,_0x5421c3);SmsQueueEvents['on'](_0x90220b,_0x484bf4);}}; \ No newline at end of file +var _0xc8f4=['register','length','smsQueue:','./smsQueue.events','remove','removeListener'];(function(_0x4179b3,_0x2eaff2){var _0x5b5c7e=function(_0x568341){while(--_0x568341){_0x4179b3['push'](_0x4179b3['shift']());}};_0x5b5c7e(++_0x2eaff2);}(_0xc8f4,0x165));var _0x4c8f=function(_0xa6cb09,_0x39410f){_0xa6cb09=_0xa6cb09-0x0;var _0x12b437=_0xc8f4[_0xa6cb09];return _0x12b437;};'use strict';var SmsQueueEvents=require(_0x4c8f('0x0'));var events=['save',_0x4c8f('0x1'),'update'];function createListener(_0x2efdcc,_0x130b24){return function(_0x1b5799){_0x130b24['emit'](_0x2efdcc,_0x1b5799);};}function removeListener(_0x4ad08f,_0x113f58){return function(){SmsQueueEvents[_0x4c8f('0x2')](_0x4ad08f,_0x113f58);};}exports[_0x4c8f('0x3')]=function(_0xf8fceb){for(var _0x15c846=0x0,_0x5b6507=events[_0x4c8f('0x4')];_0x15c846<_0x5b6507;_0x15c846++){var _0x1002dd=events[_0x15c846];var _0x241b68=createListener(_0x4c8f('0x5')+_0x1002dd,_0xf8fceb);SmsQueueEvents['on'](_0x1002dd,_0x241b68);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index faa2c46..18d3364 100644 --- a/server/api/smsQueueReport/index.js +++ b/server/api/smsQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9330=['describe','/:id','show','post','create','put','destroy','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','/describe'];(function(_0x284c96,_0x3e1bec){var _0xbdbb1e=function(_0xb9050){while(--_0xb9050){_0x284c96['push'](_0x284c96['shift']());}};_0xbdbb1e(++_0x3e1bec);}(_0x9330,0x14a));var _0x0933=function(_0x24d6f5,_0x5d0c1c){_0x24d6f5=_0x24d6f5-0x0;var _0x5368fe=_0x9330[_0x24d6f5];return _0x5368fe;};'use strict';var multer=require(_0x0933('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0933('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0933('0x2'));var auth=require(_0x0933('0x3'));var interaction=require(_0x0933('0x4'));var config=require(_0x0933('0x5'));var controller=require(_0x0933('0x6'));router[_0x0933('0x7')]('/',auth[_0x0933('0x8')](),controller['index']);router[_0x0933('0x7')](_0x0933('0x9'),auth[_0x0933('0x8')](),controller[_0x0933('0xa')]);router[_0x0933('0x7')](_0x0933('0xb'),auth[_0x0933('0x8')](),controller[_0x0933('0xc')]);router[_0x0933('0xd')]('/',auth[_0x0933('0x8')](),controller[_0x0933('0xe')]);router[_0x0933('0xf')](_0x0933('0xb'),auth[_0x0933('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0933('0x10')]);module['exports']=router; \ No newline at end of file +var _0x8893=['show','post','create','put','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','isAuthenticated','index','/describe','describe','get','/:id'];(function(_0x266e57,_0x41125b){var _0x4cdc1d=function(_0x3d3734){while(--_0x3d3734){_0x266e57['push'](_0x266e57['shift']());}};_0x4cdc1d(++_0x41125b);}(_0x8893,0x1a8));var _0x3889=function(_0x48d8fc,_0x5e5bc5){_0x48d8fc=_0x48d8fc-0x0;var _0x4c1900=_0x8893[_0x48d8fc];return _0x4c1900;};'use strict';var multer=require(_0x3889('0x0'));var util=require(_0x3889('0x1'));var path=require(_0x3889('0x2'));var timeout=require(_0x3889('0x3'));var express=require(_0x3889('0x4'));var router=express[_0x3889('0x5')]();var fs_extra=require(_0x3889('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3889('0x7'));var config=require(_0x3889('0x8'));var controller=require(_0x3889('0x9'));router['get']('/',auth[_0x3889('0xa')](),controller[_0x3889('0xb')]);router['get'](_0x3889('0xc'),auth[_0x3889('0xa')](),controller[_0x3889('0xd')]);router[_0x3889('0xe')](_0x3889('0xf'),auth[_0x3889('0xa')](),controller[_0x3889('0x10')]);router[_0x3889('0x11')]('/',auth[_0x3889('0xa')](),controller[_0x3889('0x12')]);router[_0x3889('0x13')]('/:id',auth[_0x3889('0xa')](),controller['update']);router[_0x3889('0x14')](_0x3889('0xf'),auth['isAuthenticated'](),controller[_0x3889('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index a173b16..c467205 100644 --- a/server/api/smsQueueReport/smsQueueReport.attributes.js +++ b/server/api/smsQueueReport/smsQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcd65=['sequelize','STRING','DATE','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcd65,0x12b));var _0x5cd6=function(_0x469665,_0x394876){_0x469665=_0x469665-0x0;var _0x291ab5=_0xcd65[_0x469665];return _0x291ab5;};'use strict';var moment=require(_0x5cd6('0x0'));var Sequelize=require(_0x5cd6('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x5cd6('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x5cd6('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x5cd6('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x60fe=['STRING','DATE'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0x60fe,0x176));var _0xe60f=function(_0x412ed6,_0x5ac827){_0x412ed6=_0x412ed6-0x0;var _0x3883d2=_0x60fe[_0x412ed6];return _0x3883d2;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xe60f('0x0')],'allowNull':![]},'from':{'type':Sequelize[_0xe60f('0x0')]},'joinAt':{'type':Sequelize[_0xe60f('0x1')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xe60f('0x1')]},'reason':{'type':Sequelize[_0xe60f('0x0')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index c3e2017..7653725 100644 --- a/server/api/smsQueueReport/smsQueueReport.controller.js +++ b/server/api/smsQueueReport/smsQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7b03=['Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count'];(function(_0x27c24e,_0x5db1c7){var _0x39004a=function(_0x44286d){while(--_0x44286d){_0x27c24e['push'](_0x27c24e['shift']());}};_0x39004a(++_0x5db1c7);}(_0x7b03,0x173));var _0x37b0=function(_0x47a40b,_0x443ecf){_0x47a40b=_0x47a40b-0x0;var _0x19610c=_0x7b03[_0x47a40b];return _0x19610c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x37b0('0x0'));var zipdir=require(_0x37b0('0x1'));var jsonpatch=require(_0x37b0('0x2'));var rp=require(_0x37b0('0x3'));var moment=require(_0x37b0('0x4'));var BPromise=require(_0x37b0('0x5'));var Mustache=require(_0x37b0('0x6'));var util=require(_0x37b0('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x37b0('0x8'));var ejs=require(_0x37b0('0x9'));var fs=require('fs');var fs_extra=require(_0x37b0('0xa'));var _=require(_0x37b0('0xb'));var squel=require(_0x37b0('0xc'));var crypto=require(_0x37b0('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x37b0('0xe'));var toCsv=require(_0x37b0('0x8'));var querystring=require(_0x37b0('0xf'));var Papa=require(_0x37b0('0x10'));var Redis=require(_0x37b0('0x11'));var authService=require(_0x37b0('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x37b0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x37b0('0x14'))(_0x37b0('0x15'));var utils=require(_0x37b0('0x16'));var config=require(_0x37b0('0x17'));var licenseUtil=require(_0x37b0('0x18'));var db=require(_0x37b0('0x19'))['db'];function respondWithStatusCode(_0x9f1e0e,_0x4df2c6){_0x4df2c6=_0x4df2c6||0xcc;return function(_0x3889d0){if(_0x3889d0){return _0x9f1e0e[_0x37b0('0x1a')](_0x4df2c6);}return _0x9f1e0e[_0x37b0('0x1b')](_0x4df2c6)[_0x37b0('0x1c')]();};}function respondWithResult(_0x29a468,_0xf48540){_0xf48540=_0xf48540||0xc8;return function(_0x39d074){if(_0x39d074){return _0x29a468['status'](_0xf48540)[_0x37b0('0x1d')](_0x39d074);}};}function respondWithFilteredResult(_0x207cfb,_0x559156){return function(_0x349155){if(_0x349155){var _0xfeeb30=typeof _0x559156[_0x37b0('0x1e')]==='undefined'&&typeof _0x559156[_0x37b0('0x1f')]===_0x37b0('0x20');var _0x236314=_0x349155[_0x37b0('0x21')];var _0x41501b=_0xfeeb30?0x0:_0x559156[_0x37b0('0x1e')];var _0x335a64=_0xfeeb30?_0x349155[_0x37b0('0x21')]:_0x559156[_0x37b0('0x1e')]+_0x559156['limit'];var _0x5ce396;if(_0x335a64>=_0x236314){_0x335a64=_0x236314;_0x5ce396=0xc8;}else{_0x5ce396=0xce;}_0x207cfb['status'](_0x5ce396);return _0x207cfb['set'](_0x37b0('0x22'),_0x41501b+'-'+_0x335a64+'/'+_0x236314)['json'](_0x349155);}return null;};}function patchUpdates(_0x4e2c5d){return function(_0x15e3c6){try{jsonpatch[_0x37b0('0x23')](_0x15e3c6,_0x4e2c5d,!![]);}catch(_0x34a9a3){return BPromise[_0x37b0('0x24')](_0x34a9a3);}return _0x15e3c6[_0x37b0('0x25')]();};}function saveUpdates(_0x1b995b,_0x58e2ba){return function(_0x484933){if(_0x484933){return _0x484933[_0x37b0('0x26')](_0x1b995b)[_0x37b0('0x27')](function(_0x54920c){return _0x54920c;});}return null;};}function removeEntity(_0x23d3e3,_0x4e97d8){return function(_0x59aacc){if(_0x59aacc){return _0x59aacc['destroy']()['then'](function(){_0x23d3e3['status'](0xcc)[_0x37b0('0x1c')]();});}};}function handleEntityNotFound(_0x40e24b,_0x1fc2b7){return function(_0x1d07ae){if(!_0x1d07ae){_0x40e24b[_0x37b0('0x1a')](0x194);}return _0x1d07ae;};}function handleError(_0x4cc1a9,_0x251fbd){_0x251fbd=_0x251fbd||0x1f4;return function(_0x230411){logger[_0x37b0('0x28')](_0x230411[_0x37b0('0x29')]);if(_0x230411['name']){delete _0x230411[_0x37b0('0x2a')];}_0x4cc1a9['status'](_0x251fbd)[_0x37b0('0x2b')](_0x230411);};}exports[_0x37b0('0x2c')]=function(_0x43b961,_0x479021){var _0x33160e={},_0x533bbb={},_0x5eada4={'count':0x0,'rows':[]};var _0xb0f8eb=_[_0x37b0('0x2d')](db[_0x37b0('0x2e')][_0x37b0('0x2f')],function(_0x409ca4){return{'name':_0x409ca4[_0x37b0('0x30')],'type':_0x409ca4[_0x37b0('0x31')][_0x37b0('0x32')]};});_0x533bbb['model']=_[_0x37b0('0x2d')](_0xb0f8eb,'name');_0x533bbb[_0x37b0('0x33')]=_['keys'](_0x43b961[_0x37b0('0x33')]);_0x533bbb['filters']=_[_0x37b0('0x34')](_0x533bbb[_0x37b0('0x35')],_0x533bbb[_0x37b0('0x33')]);_0x33160e['attributes']=_[_0x37b0('0x34')](_0x533bbb[_0x37b0('0x35')],qs[_0x37b0('0x36')](_0x43b961['query'][_0x37b0('0x36')]));_0x33160e[_0x37b0('0x37')]=_0x33160e[_0x37b0('0x37')][_0x37b0('0x38')]?_0x33160e[_0x37b0('0x37')]:_0x533bbb['model'];if(!_0x43b961['query'][_0x37b0('0x39')](_0x37b0('0x3a'))){_0x33160e[_0x37b0('0x1f')]=qs[_0x37b0('0x1f')](_0x43b961['query'][_0x37b0('0x1f')]);_0x33160e[_0x37b0('0x1e')]=qs[_0x37b0('0x1e')](_0x43b961['query'][_0x37b0('0x1e')]);}_0x33160e[_0x37b0('0x3b')]=qs[_0x37b0('0x3c')](_0x43b961[_0x37b0('0x33')]['sort']);_0x33160e[_0x37b0('0x3d')]=qs[_0x37b0('0x3e')](_[_0x37b0('0x3f')](_0x43b961[_0x37b0('0x33')],_0x533bbb['filters']),_0xb0f8eb);if(_0x43b961[_0x37b0('0x33')]['filter']){_0x33160e['where']=_['merge'](_0x33160e[_0x37b0('0x3d')],{'$or':_[_0x37b0('0x2d')](_0xb0f8eb,function(_0x52d5dc){if(_0x52d5dc[_0x37b0('0x31')]!==_0x37b0('0x40')){var _0x2cee57={};_0x2cee57[_0x52d5dc[_0x37b0('0x2a')]]={'$like':'%'+_0x43b961[_0x37b0('0x33')][_0x37b0('0x41')]+'%'};return _0x2cee57;}})});}_0x33160e=_[_0x37b0('0x42')]({},_0x33160e,_0x43b961[_0x37b0('0x43')]);var _0x431a86={'where':_0x33160e['where']};return db[_0x37b0('0x2e')][_0x37b0('0x21')](_0x431a86)[_0x37b0('0x27')](function(_0x481f45){_0x5eada4[_0x37b0('0x21')]=_0x481f45;if(_0x43b961[_0x37b0('0x33')][_0x37b0('0x44')]){_0x33160e[_0x37b0('0x45')]=[{'all':!![]}];}return db[_0x37b0('0x2e')][_0x37b0('0x46')](_0x33160e);})[_0x37b0('0x27')](function(_0x3bed92){_0x5eada4[_0x37b0('0x47')]=_0x3bed92;return _0x5eada4;})[_0x37b0('0x27')](respondWithFilteredResult(_0x479021,_0x33160e))[_0x37b0('0x48')](handleError(_0x479021,null));};exports[_0x37b0('0x49')]=function(_0x493bbe,_0x286e78){var _0x9bb078={'raw':!![],'where':{'id':_0x493bbe[_0x37b0('0x4a')]['id']}},_0x1bc76b={};_0x1bc76b['model']=_[_0x37b0('0x4b')](db[_0x37b0('0x2e')][_0x37b0('0x2f')]);_0x1bc76b['query']=_[_0x37b0('0x4b')](_0x493bbe[_0x37b0('0x33')]);_0x1bc76b[_0x37b0('0x3e')]=_['intersection'](_0x1bc76b['model'],_0x1bc76b[_0x37b0('0x33')]);_0x9bb078[_0x37b0('0x37')]=_[_0x37b0('0x34')](_0x1bc76b[_0x37b0('0x35')],qs[_0x37b0('0x36')](_0x493bbe[_0x37b0('0x33')]['fields']));_0x9bb078[_0x37b0('0x37')]=_0x9bb078[_0x37b0('0x37')][_0x37b0('0x38')]?_0x9bb078[_0x37b0('0x37')]:_0x1bc76b[_0x37b0('0x35')];if(_0x493bbe[_0x37b0('0x33')][_0x37b0('0x44')]){_0x9bb078[_0x37b0('0x45')]=[{'all':!![]}];}_0x9bb078=_[_0x37b0('0x42')]({},_0x9bb078,_0x493bbe['options']);return db[_0x37b0('0x2e')][_0x37b0('0x4c')](_0x9bb078)[_0x37b0('0x27')](handleEntityNotFound(_0x286e78,null))[_0x37b0('0x27')](respondWithResult(_0x286e78,null))[_0x37b0('0x48')](handleError(_0x286e78,null));};exports[_0x37b0('0x4d')]=function(_0x1a6a5f,_0xd1137a){return db[_0x37b0('0x2e')][_0x37b0('0x4d')](_0x1a6a5f[_0x37b0('0x4e')],{})[_0x37b0('0x27')](respondWithResult(_0xd1137a,0xc9))[_0x37b0('0x48')](handleError(_0xd1137a,null));};exports[_0x37b0('0x26')]=function(_0x4ea3bb,_0x410af3){if(_0x4ea3bb[_0x37b0('0x4e')]['id']){delete _0x4ea3bb['body']['id'];}return db['SmsQueueReport'][_0x37b0('0x4c')]({'where':{'id':_0x4ea3bb['params']['id']}})[_0x37b0('0x27')](handleEntityNotFound(_0x410af3,null))[_0x37b0('0x27')](saveUpdates(_0x4ea3bb[_0x37b0('0x4e')],null))[_0x37b0('0x27')](respondWithResult(_0x410af3,null))[_0x37b0('0x48')](handleError(_0x410af3,null));};exports[_0x37b0('0x4f')]=function(_0x117143,_0x957cc9){return db[_0x37b0('0x2e')][_0x37b0('0x4c')]({'where':{'id':_0x117143[_0x37b0('0x4a')]['id']}})[_0x37b0('0x27')](handleEntityNotFound(_0x957cc9,null))[_0x37b0('0x27')](removeEntity(_0x957cc9,null))[_0x37b0('0x48')](handleError(_0x957cc9,null));};exports[_0x37b0('0x50')]=function(_0x77e400,_0x582d49){return db[_0x37b0('0x2e')][_0x37b0('0x50')]()['then'](respondWithResult(_0x582d49,null))[_0x37b0('0x48')](handleError(_0x582d49,null));}; \ No newline at end of file +var _0x8150=['path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','end','error','stack','name','index','map','SmsQueueReport','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','include','catch','show','params','length','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','moment','mustache','util'];(function(_0x57b1e9,_0x546d69){var _0x312035=function(_0x38935f){while(--_0x38935f){_0x57b1e9['push'](_0x57b1e9['shift']());}};_0x312035(++_0x546d69);}(_0x8150,0x1a4));var _0x0815=function(_0x488744,_0x12f1dd){_0x488744=_0x488744-0x0;var _0x46a8ff=_0x8150[_0x488744];return _0x46a8ff;};'use strict';var emlformat=require(_0x0815('0x0'));var rimraf=require(_0x0815('0x1'));var zipdir=require(_0x0815('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0815('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0815('0x4'));var util=require(_0x0815('0x5'));var path=require(_0x0815('0x6'));var sox=require(_0x0815('0x7'));var csv=require('to-csv');var ejs=require(_0x0815('0x8'));var fs=require('fs');var fs_extra=require(_0x0815('0x9'));var _=require(_0x0815('0xa'));var squel=require(_0x0815('0xb'));var crypto=require(_0x0815('0xc'));var jsforce=require(_0x0815('0xd'));var deskjs=require(_0x0815('0xe'));var toCsv=require(_0x0815('0xf'));var querystring=require(_0x0815('0x10'));var Papa=require(_0x0815('0x11'));var Redis=require(_0x0815('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x0815('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0815('0x14'));var logger=require('../../config/logger')(_0x0815('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0815('0x16'));var db=require(_0x0815('0x17'))['db'];function respondWithStatusCode(_0x38523a,_0x5a2539){_0x5a2539=_0x5a2539||0xcc;return function(_0x15b6b1){if(_0x15b6b1){return _0x38523a[_0x0815('0x18')](_0x5a2539);}return _0x38523a[_0x0815('0x19')](_0x5a2539)['end']();};}function respondWithResult(_0x16c0ec,_0x9a4e40){_0x9a4e40=_0x9a4e40||0xc8;return function(_0x29adf9){if(_0x29adf9){return _0x16c0ec['status'](_0x9a4e40)['json'](_0x29adf9);}};}function respondWithFilteredResult(_0x531dc0,_0x508e6a){return function(_0x3d8389){if(_0x3d8389){var _0x474fd2=typeof _0x508e6a[_0x0815('0x1a')]===_0x0815('0x1b')&&typeof _0x508e6a[_0x0815('0x1c')]===_0x0815('0x1b');var _0x3bf0bc=_0x3d8389[_0x0815('0x1d')];var _0x202768=_0x474fd2?0x0:_0x508e6a[_0x0815('0x1a')];var _0x9099c5=_0x474fd2?_0x3d8389[_0x0815('0x1d')]:_0x508e6a[_0x0815('0x1a')]+_0x508e6a['limit'];var _0x2ed752;if(_0x9099c5>=_0x3bf0bc){_0x9099c5=_0x3bf0bc;_0x2ed752=0xc8;}else{_0x2ed752=0xce;}_0x531dc0[_0x0815('0x19')](_0x2ed752);return _0x531dc0['set'](_0x0815('0x1e'),_0x202768+'-'+_0x9099c5+'/'+_0x3bf0bc)[_0x0815('0x1f')](_0x3d8389);}return null;};}function patchUpdates(_0x22d446){return function(_0x118021){try{jsonpatch[_0x0815('0x20')](_0x118021,_0x22d446,!![]);}catch(_0x342d0e){return BPromise[_0x0815('0x21')](_0x342d0e);}return _0x118021['save']();};}function saveUpdates(_0x11b35c,_0xfab87){return function(_0x1c4461){if(_0x1c4461){return _0x1c4461[_0x0815('0x22')](_0x11b35c)[_0x0815('0x23')](function(_0x30e57c){return _0x30e57c;});}return null;};}function removeEntity(_0x5078c3,_0x348fdb){return function(_0x47cb2e){if(_0x47cb2e){return _0x47cb2e['destroy']()[_0x0815('0x23')](function(){_0x5078c3[_0x0815('0x19')](0xcc)[_0x0815('0x24')]();});}};}function handleEntityNotFound(_0x321527,_0x37ef9b){return function(_0xa33981){if(!_0xa33981){_0x321527[_0x0815('0x18')](0x194);}return _0xa33981;};}function handleError(_0x5d2f2e,_0x308e05){_0x308e05=_0x308e05||0x1f4;return function(_0x2ca86d){logger[_0x0815('0x25')](_0x2ca86d[_0x0815('0x26')]);if(_0x2ca86d[_0x0815('0x27')]){delete _0x2ca86d['name'];}_0x5d2f2e[_0x0815('0x19')](_0x308e05)['send'](_0x2ca86d);};}exports[_0x0815('0x28')]=function(_0x2d33fd,_0x4f6385){var _0x277a5a={},_0x67805e={},_0x127383={'count':0x0,'rows':[]};var _0x18c674=_[_0x0815('0x29')](db[_0x0815('0x2a')][_0x0815('0x2b')],function(_0xf84ebe){return{'name':_0xf84ebe['fieldName'],'type':_0xf84ebe[_0x0815('0x2c')][_0x0815('0x2d')]};});_0x67805e[_0x0815('0x2e')]=_[_0x0815('0x29')](_0x18c674,'name');_0x67805e[_0x0815('0x2f')]=_[_0x0815('0x30')](_0x2d33fd[_0x0815('0x2f')]);_0x67805e['filters']=_[_0x0815('0x31')](_0x67805e['model'],_0x67805e[_0x0815('0x2f')]);_0x277a5a[_0x0815('0x32')]=_[_0x0815('0x31')](_0x67805e[_0x0815('0x2e')],qs[_0x0815('0x33')](_0x2d33fd[_0x0815('0x2f')][_0x0815('0x33')]));_0x277a5a['attributes']=_0x277a5a['attributes']['length']?_0x277a5a[_0x0815('0x32')]:_0x67805e[_0x0815('0x2e')];if(!_0x2d33fd[_0x0815('0x2f')]['hasOwnProperty']('nolimit')){_0x277a5a['limit']=qs[_0x0815('0x1c')](_0x2d33fd[_0x0815('0x2f')][_0x0815('0x1c')]);_0x277a5a['offset']=qs[_0x0815('0x1a')](_0x2d33fd[_0x0815('0x2f')]['offset']);}_0x277a5a[_0x0815('0x34')]=qs[_0x0815('0x35')](_0x2d33fd[_0x0815('0x2f')]['sort']);_0x277a5a[_0x0815('0x36')]=qs['filters'](_[_0x0815('0x37')](_0x2d33fd[_0x0815('0x2f')],_0x67805e[_0x0815('0x38')]),_0x18c674);if(_0x2d33fd['query']['filter']){_0x277a5a[_0x0815('0x36')]=_[_0x0815('0x39')](_0x277a5a[_0x0815('0x36')],{'$or':_[_0x0815('0x29')](_0x18c674,function(_0x247bf0){if(_0x247bf0[_0x0815('0x2c')]!==_0x0815('0x3a')){var _0x590f81={};_0x590f81[_0x247bf0[_0x0815('0x27')]]={'$like':'%'+_0x2d33fd['query'][_0x0815('0x3b')]+'%'};return _0x590f81;}})});}_0x277a5a=_['merge']({},_0x277a5a,_0x2d33fd[_0x0815('0x3c')]);var _0x2f739f={'where':_0x277a5a[_0x0815('0x36')]};return db['SmsQueueReport']['count'](_0x2f739f)[_0x0815('0x23')](function(_0x57e68f){_0x127383[_0x0815('0x1d')]=_0x57e68f;if(_0x2d33fd[_0x0815('0x2f')]['includeAll']){_0x277a5a[_0x0815('0x3d')]=[{'all':!![]}];}return db[_0x0815('0x2a')]['findAll'](_0x277a5a);})['then'](function(_0x49f52b){_0x127383['rows']=_0x49f52b;return _0x127383;})[_0x0815('0x23')](respondWithFilteredResult(_0x4f6385,_0x277a5a))[_0x0815('0x3e')](handleError(_0x4f6385,null));};exports[_0x0815('0x3f')]=function(_0x525a90,_0x4dde0f){var _0x17f0c5={'raw':!![],'where':{'id':_0x525a90[_0x0815('0x40')]['id']}},_0xc204d7={};_0xc204d7[_0x0815('0x2e')]=_[_0x0815('0x30')](db[_0x0815('0x2a')][_0x0815('0x2b')]);_0xc204d7[_0x0815('0x2f')]=_[_0x0815('0x30')](_0x525a90[_0x0815('0x2f')]);_0xc204d7[_0x0815('0x38')]=_[_0x0815('0x31')](_0xc204d7[_0x0815('0x2e')],_0xc204d7[_0x0815('0x2f')]);_0x17f0c5[_0x0815('0x32')]=_[_0x0815('0x31')](_0xc204d7['model'],qs[_0x0815('0x33')](_0x525a90['query'][_0x0815('0x33')]));_0x17f0c5[_0x0815('0x32')]=_0x17f0c5[_0x0815('0x32')][_0x0815('0x41')]?_0x17f0c5[_0x0815('0x32')]:_0xc204d7[_0x0815('0x2e')];if(_0x525a90[_0x0815('0x2f')]['includeAll']){_0x17f0c5[_0x0815('0x3d')]=[{'all':!![]}];}_0x17f0c5=_[_0x0815('0x39')]({},_0x17f0c5,_0x525a90['options']);return db[_0x0815('0x2a')][_0x0815('0x42')](_0x17f0c5)[_0x0815('0x23')](handleEntityNotFound(_0x4dde0f,null))['then'](respondWithResult(_0x4dde0f,null))[_0x0815('0x3e')](handleError(_0x4dde0f,null));};exports[_0x0815('0x43')]=function(_0xfffc68,_0x2eea2d){return db[_0x0815('0x2a')][_0x0815('0x43')](_0xfffc68[_0x0815('0x44')],{})[_0x0815('0x23')](respondWithResult(_0x2eea2d,0xc9))['catch'](handleError(_0x2eea2d,null));};exports[_0x0815('0x22')]=function(_0x2103d6,_0x428caf){if(_0x2103d6[_0x0815('0x44')]['id']){delete _0x2103d6[_0x0815('0x44')]['id'];}return db[_0x0815('0x2a')][_0x0815('0x42')]({'where':{'id':_0x2103d6[_0x0815('0x40')]['id']}})[_0x0815('0x23')](handleEntityNotFound(_0x428caf,null))[_0x0815('0x23')](saveUpdates(_0x2103d6[_0x0815('0x44')],null))[_0x0815('0x23')](respondWithResult(_0x428caf,null))[_0x0815('0x3e')](handleError(_0x428caf,null));};exports[_0x0815('0x45')]=function(_0x2c0056,_0x5ca0e4){return db[_0x0815('0x2a')][_0x0815('0x42')]({'where':{'id':_0x2c0056[_0x0815('0x40')]['id']}})[_0x0815('0x23')](handleEntityNotFound(_0x5ca0e4,null))[_0x0815('0x23')](removeEntity(_0x5ca0e4,null))[_0x0815('0x3e')](handleError(_0x5ca0e4,null));};exports[_0x0815('0x46')]=function(_0x23c77f,_0x192d4e){return db[_0x0815('0x2a')][_0x0815('0x46')]()[_0x0815('0x23')](respondWithResult(_0x192d4e,null))[_0x0815('0x3e')](handleError(_0x192d4e,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 499f406..f1e33ee 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','uniqueid','lodash'];(function(_0x770f4,_0x3896bc){var _0x1cdaef=function(_0xc83c8b){while(--_0xc83c8b){_0x770f4['push'](_0x770f4['shift']());}};_0x1cdaef(++_0x3896bc);}(_0xb7e7,0x121));var _0x7b7e=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0xb7e7[_0x513aa5];return _0x1a1a7c;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util'];(function(_0x4cc95a,_0x15c4c7){var _0x4abee3=function(_0x5e9e49){while(--_0x5e9e49){_0x4cc95a['push'](_0x4cc95a['shift']());}};_0x4abee3(++_0x15c4c7);}(_0xe706,0xa3));var _0x6e70=function(_0x3e0763,_0x3d12be){_0x3e0763=_0x3e0763-0x0;var _0x351ca2=_0xe706[_0x3e0763];return _0x351ca2;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 980ed59..e6a39f5 100644 --- a/server/api/smsQueueReport/smsQueueReport.rpc.js +++ b/server/api/smsQueueReport/smsQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3a7f=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','attributes','limit','UpdateSmsQueueReport','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x3a7f,0x127));var _0xf3a7=function(_0x1b3ddb,_0x55f51f){_0x1b3ddb=_0x1b3ddb-0x0;var _0x5e8d85=_0x3a7f[_0x1b3ddb];return _0x5e8d85;};'use strict';var _=require(_0xf3a7('0x0'));var util=require(_0xf3a7('0x1'));var moment=require(_0xf3a7('0x2'));var BPromise=require('bluebird');var rs=require(_0xf3a7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf3a7('0x4'))['db'];var utils=require(_0xf3a7('0x5'));var logger=require(_0xf3a7('0x6'))('rpc');var config=require(_0xf3a7('0x7'));var jayson=require(_0xf3a7('0x8'));var client=jayson[_0xf3a7('0x9')][_0xf3a7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41fdd8,_0x1a1a95,_0x26f66b){return new BPromise(function(_0x46c489,_0x265864){return client[_0xf3a7('0xb')](_0x41fdd8,_0x26f66b)[_0xf3a7('0xc')](function(_0x58fa09){logger[_0xf3a7('0xd')](_0xf3a7('0xe'),_0x1a1a95,_0xf3a7('0xf'));logger[_0xf3a7('0x10')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x1a1a95,_0xf3a7('0xf'),JSON[_0xf3a7('0x11')](_0x58fa09));if(_0x58fa09[_0xf3a7('0x12')]){if(_0x58fa09['error']['code']===0x1f4){logger[_0xf3a7('0x12')]('SmsQueueReport,\x20%s,\x20%s',_0x1a1a95,_0x58fa09[_0xf3a7('0x12')][_0xf3a7('0x13')]);return _0x265864(_0x58fa09[_0xf3a7('0x12')][_0xf3a7('0x13')]);}logger[_0xf3a7('0x12')](_0xf3a7('0xe'),_0x1a1a95,_0x58fa09[_0xf3a7('0x12')][_0xf3a7('0x13')]);return _0x46c489(_0x58fa09[_0xf3a7('0x12')]['message']);}else{logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x1a1a95,_0xf3a7('0xf'));_0x46c489(_0x58fa09['result']['message']);}})[_0xf3a7('0x14')](function(_0x4f4e8e){logger[_0xf3a7('0x12')](_0xf3a7('0xe'),_0x1a1a95,_0x4f4e8e);_0x265864(_0x4f4e8e);});});}exports[_0xf3a7('0x15')]=function(_0x198d82){var _0x15cb0e=this;return new Promise(function(_0x3af433,_0x480808){return db[_0xf3a7('0x16')][_0xf3a7('0x17')](_0x198d82[_0xf3a7('0x18')],{'raw':_0x198d82[_0xf3a7('0x19')]?_0x198d82[_0xf3a7('0x19')][_0xf3a7('0x1a')]===undefined?!![]:![]:!![]})[_0xf3a7('0xc')](function(_0x30a098){logger[_0xf3a7('0xd')](_0xf3a7('0x15'),_0x198d82);logger['debug'](_0xf3a7('0x15'),_0x198d82,JSON[_0xf3a7('0x11')](_0x30a098));_0x3af433(_0x30a098);})['catch'](function(_0xd178b9){logger['error'](_0xf3a7('0x15'),_0xd178b9[_0xf3a7('0x13')],_0x198d82);_0x480808(_0x15cb0e[_0xf3a7('0x12')](0x1f4,_0xd178b9[_0xf3a7('0x13')]));});});};exports['UpdateSmsQueueReport']=function(_0x5c7502){var _0x147262=this;return new Promise(function(_0x18b189,_0x4acf27){return db[_0xf3a7('0x16')]['update'](_0x5c7502[_0xf3a7('0x18')],{'raw':_0x5c7502['options']?_0x5c7502[_0xf3a7('0x19')][_0xf3a7('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c7502[_0xf3a7('0x19')]?_0x5c7502[_0xf3a7('0x19')]['where']||null:null,'attributes':_0x5c7502[_0xf3a7('0x19')]?_0x5c7502[_0xf3a7('0x19')][_0xf3a7('0x1b')]||null:null,'limit':_0x5c7502['options']?_0x5c7502[_0xf3a7('0x19')][_0xf3a7('0x1c')]||null:null})[_0xf3a7('0xc')](function(_0x5e2554){logger[_0xf3a7('0xd')](_0xf3a7('0x1d'),_0x5c7502);logger[_0xf3a7('0x10')](_0xf3a7('0x1d'),_0x5c7502,JSON[_0xf3a7('0x11')](_0x5e2554));_0x18b189(_0x5e2554);})[_0xf3a7('0x14')](function(_0x37efbd){logger['error'](_0xf3a7('0x1d'),_0x37efbd['message'],_0x5c7502);_0x4acf27(_0x147262[_0xf3a7('0x12')](0x1f4,_0x37efbd['message']));});});}; \ No newline at end of file +var _0x7bc0=['limit','then','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create','options','UpdateSmsQueueReport','update','body','where','attributes'];(function(_0x4cb7fc,_0x44939b){var _0x16f4c9=function(_0xb5c17e){while(--_0xb5c17e){_0x4cb7fc['push'](_0x4cb7fc['shift']());}};_0x16f4c9(++_0x44939b);}(_0x7bc0,0x19a));var _0x07bc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7bc0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x07bc('0x0'));var moment=require(_0x07bc('0x1'));var BPromise=require('bluebird');var rs=require(_0x07bc('0x2'));var fs=require('fs');var Redis=require(_0x07bc('0x3'));var db=require(_0x07bc('0x4'))['db'];var utils=require(_0x07bc('0x5'));var logger=require(_0x07bc('0x6'))(_0x07bc('0x7'));var config=require(_0x07bc('0x8'));var jayson=require(_0x07bc('0x9'));var client=jayson[_0x07bc('0xa')][_0x07bc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9ae3a5,_0x1c75c7,_0x56035b){return new BPromise(function(_0xa41d42,_0x669085){return client[_0x07bc('0xc')](_0x9ae3a5,_0x56035b)['then'](function(_0x1b5d69){logger[_0x07bc('0xd')](_0x07bc('0xe'),_0x1c75c7,_0x07bc('0xf'));logger[_0x07bc('0x10')](_0x07bc('0x11'),_0x1c75c7,_0x07bc('0xf'),JSON[_0x07bc('0x12')](_0x1b5d69));if(_0x1b5d69[_0x07bc('0x13')]){if(_0x1b5d69[_0x07bc('0x13')]['code']===0x1f4){logger[_0x07bc('0x13')]('SmsQueueReport,\x20%s,\x20%s',_0x1c75c7,_0x1b5d69[_0x07bc('0x13')][_0x07bc('0x14')]);return _0x669085(_0x1b5d69[_0x07bc('0x13')][_0x07bc('0x14')]);}logger[_0x07bc('0x13')](_0x07bc('0xe'),_0x1c75c7,_0x1b5d69['error'][_0x07bc('0x14')]);return _0xa41d42(_0x1b5d69['error'][_0x07bc('0x14')]);}else{logger[_0x07bc('0xd')](_0x07bc('0xe'),_0x1c75c7,_0x07bc('0xf'));_0xa41d42(_0x1b5d69[_0x07bc('0x15')]['message']);}})[_0x07bc('0x16')](function(_0x384747){logger[_0x07bc('0x13')](_0x07bc('0xe'),_0x1c75c7,_0x384747);_0x669085(_0x384747);});});}exports[_0x07bc('0x17')]=function(_0x3531b9){var _0xd71e09=this;return new Promise(function(_0x4ba70b,_0x9ac830){return db[_0x07bc('0x18')][_0x07bc('0x19')](_0x3531b9['body'],{'raw':_0x3531b9[_0x07bc('0x1a')]?_0x3531b9[_0x07bc('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x5ad895){logger['info'](_0x07bc('0x17'),_0x3531b9);logger[_0x07bc('0x10')]('CreateSmsQueueReport',_0x3531b9,JSON['stringify'](_0x5ad895));_0x4ba70b(_0x5ad895);})['catch'](function(_0x2c0431){logger[_0x07bc('0x13')](_0x07bc('0x17'),_0x2c0431[_0x07bc('0x14')],_0x3531b9);_0x9ac830(_0xd71e09[_0x07bc('0x13')](0x1f4,_0x2c0431[_0x07bc('0x14')]));});});};exports[_0x07bc('0x1b')]=function(_0x2bb7a8){var _0x1ea664=this;return new Promise(function(_0x215e9d,_0x579c15){return db[_0x07bc('0x18')][_0x07bc('0x1c')](_0x2bb7a8[_0x07bc('0x1d')],{'raw':_0x2bb7a8[_0x07bc('0x1a')]?_0x2bb7a8['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2bb7a8[_0x07bc('0x1a')]?_0x2bb7a8[_0x07bc('0x1a')][_0x07bc('0x1e')]||null:null,'attributes':_0x2bb7a8[_0x07bc('0x1a')]?_0x2bb7a8['options'][_0x07bc('0x1f')]||null:null,'limit':_0x2bb7a8[_0x07bc('0x1a')]?_0x2bb7a8[_0x07bc('0x1a')][_0x07bc('0x20')]||null:null})[_0x07bc('0x21')](function(_0xa6177){logger['info'](_0x07bc('0x1b'),_0x2bb7a8);logger[_0x07bc('0x10')](_0x07bc('0x1b'),_0x2bb7a8,JSON[_0x07bc('0x12')](_0xa6177));_0x215e9d(_0xa6177);})[_0x07bc('0x16')](function(_0x225510){logger[_0x07bc('0x13')](_0x07bc('0x1b'),_0x225510[_0x07bc('0x14')],_0x2bb7a8);_0x579c15(_0x1ea664[_0x07bc('0x13')](0x1f4,_0x225510['message']));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 2298265..e484893 100644 --- a/server/api/smsTransferReport/index.js +++ b/server/api/smsTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f47=['path','express','fs-extra','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','util'];(function(_0x512973,_0x564e8b){var _0x32f2e1=function(_0x5d5d3b){while(--_0x5d5d3b){_0x512973['push'](_0x512973['shift']());}};_0x32f2e1(++_0x564e8b);}(_0x6f47,0xc7));var _0x76f4=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0x6f47[_0x2faddb];return _0x273c05;};'use strict';var multer=require('multer');var util=require(_0x76f4('0x0'));var path=require(_0x76f4('0x1'));var timeout=require('connect-timeout');var express=require(_0x76f4('0x2'));var router=express['Router']();var fs_extra=require(_0x76f4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x76f4('0x4'));var config=require(_0x76f4('0x5'));var controller=require(_0x76f4('0x6'));router[_0x76f4('0x7')]('/',auth['isAuthenticated'](),controller[_0x76f4('0x8')]);router[_0x76f4('0x7')](_0x76f4('0x9'),auth['isAuthenticated'](),controller[_0x76f4('0xa')]);router[_0x76f4('0x7')](_0x76f4('0xb'),auth[_0x76f4('0xc')](),controller[_0x76f4('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x76f4('0xe')]);router[_0x76f4('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x76f4('0x10')]);router[_0x76f4('0x11')](_0x76f4('0xb'),auth[_0x76f4('0xc')](),controller[_0x76f4('0x12')]);module[_0x76f4('0x13')]=router; \ No newline at end of file +var _0x1b20=['show','post','create','put','/:id','delete','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe'];(function(_0x324455,_0xae778e){var _0x298f66=function(_0x88c8e3){while(--_0x88c8e3){_0x324455['push'](_0x324455['shift']());}};_0x298f66(++_0xae778e);}(_0x1b20,0x66));var _0x01b2=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x1b20[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require('multer');var util=require(_0x01b2('0x0'));var path=require(_0x01b2('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x01b2('0x2')]();var fs_extra=require(_0x01b2('0x3'));var auth=require(_0x01b2('0x4'));var interaction=require(_0x01b2('0x5'));var config=require(_0x01b2('0x6'));var controller=require(_0x01b2('0x7'));router[_0x01b2('0x8')]('/',auth[_0x01b2('0x9')](),controller[_0x01b2('0xa')]);router[_0x01b2('0x8')](_0x01b2('0xb'),auth[_0x01b2('0x9')](),controller['describe']);router[_0x01b2('0x8')]('/:id',auth[_0x01b2('0x9')](),controller[_0x01b2('0xc')]);router[_0x01b2('0xd')]('/',auth[_0x01b2('0x9')](),controller[_0x01b2('0xe')]);router[_0x01b2('0xf')](_0x01b2('0x10'),auth[_0x01b2('0x9')](),controller['update']);router[_0x01b2('0x11')]('/:id',auth[_0x01b2('0x9')](),controller['destroy']);module[_0x01b2('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index b707892..b58ba06 100644 --- a/server/api/smsTransferReport/smsTransferReport.attributes.js +++ b/server/api/smsTransferReport/smsTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x3aadde,_0x50f23f){var _0x21df4e=function(_0x55a49d){while(--_0x55a49d){_0x3aadde['push'](_0x3aadde['shift']());}};_0x21df4e(++_0x50f23f);}(_0x54ef,0x112));var _0xf54e=function(_0xe6e60,_0x360dbe){_0xe6e60=_0xe6e60-0x0;var _0x218a4a=_0x54ef[_0xe6e60];return _0x218a4a;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file +var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x9c44,0x178));var _0x49c4=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x9c44[_0x5f1391];return _0x50ebe3;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 7299197..8f5820f 100644 --- a/server/api/smsTransferReport/smsTransferReport.controller.js +++ b/server/api/smsTransferReport/smsTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcd0d=['include','findAll','rows','catch','show','params','options','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','json','apply','update','then','destroy','end','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll'];(function(_0x289925,_0x8644ff){var _0x38d3cf=function(_0x4457d6){while(--_0x4457d6){_0x289925['push'](_0x289925['shift']());}};_0x38d3cf(++_0x8644ff);}(_0xcd0d,0xa3));var _0xdcd0=function(_0x89ace6,_0x39064b){_0x89ace6=_0x89ace6-0x0;var _0x302694=_0xcd0d[_0x89ace6];return _0x302694;};'use strict';var emlformat=require(_0xdcd0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdcd0('0x1'));var jsonpatch=require(_0xdcd0('0x2'));var rp=require(_0xdcd0('0x3'));var moment=require('moment');var BPromise=require(_0xdcd0('0x4'));var Mustache=require(_0xdcd0('0x5'));var util=require(_0xdcd0('0x6'));var path=require(_0xdcd0('0x7'));var sox=require(_0xdcd0('0x8'));var csv=require(_0xdcd0('0x9'));var ejs=require(_0xdcd0('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdcd0('0xb'));var squel=require(_0xdcd0('0xc'));var crypto=require(_0xdcd0('0xd'));var jsforce=require(_0xdcd0('0xe'));var deskjs=require(_0xdcd0('0xf'));var toCsv=require(_0xdcd0('0x9'));var querystring=require(_0xdcd0('0x10'));var Papa=require('papaparse');var Redis=require(_0xdcd0('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xdcd0('0x12'));var hardwareService=require(_0xdcd0('0x13'));var logger=require(_0xdcd0('0x14'))(_0xdcd0('0x15'));var utils=require('../../config/utils');var config=require(_0xdcd0('0x16'));var licenseUtil=require(_0xdcd0('0x17'));var db=require(_0xdcd0('0x18'))['db'];function respondWithStatusCode(_0x532e8c,_0x5d2626){_0x5d2626=_0x5d2626||0xcc;return function(_0x35461b){if(_0x35461b){return _0x532e8c[_0xdcd0('0x19')](_0x5d2626);}return _0x532e8c[_0xdcd0('0x1a')](_0x5d2626)['end']();};}function respondWithResult(_0x249071,_0x1d744f){_0x1d744f=_0x1d744f||0xc8;return function(_0x31cce3){if(_0x31cce3){return _0x249071['status'](_0x1d744f)['json'](_0x31cce3);}};}function respondWithFilteredResult(_0x36ed33,_0x43dc0e){return function(_0x58d9c9){if(_0x58d9c9){var _0x292d65=typeof _0x43dc0e['offset']===_0xdcd0('0x1b')&&typeof _0x43dc0e[_0xdcd0('0x1c')]==='undefined';var _0x1b8c21=_0x58d9c9[_0xdcd0('0x1d')];var _0x15be47=_0x292d65?0x0:_0x43dc0e[_0xdcd0('0x1e')];var _0x39b3a9=_0x292d65?_0x58d9c9[_0xdcd0('0x1d')]:_0x43dc0e['offset']+_0x43dc0e['limit'];var _0x5c5f43;if(_0x39b3a9>=_0x1b8c21){_0x39b3a9=_0x1b8c21;_0x5c5f43=0xc8;}else{_0x5c5f43=0xce;}_0x36ed33[_0xdcd0('0x1a')](_0x5c5f43);return _0x36ed33[_0xdcd0('0x1f')]('Content-Range',_0x15be47+'-'+_0x39b3a9+'/'+_0x1b8c21)[_0xdcd0('0x20')](_0x58d9c9);}return null;};}function patchUpdates(_0xd2f83a){return function(_0x528657){try{jsonpatch[_0xdcd0('0x21')](_0x528657,_0xd2f83a,!![]);}catch(_0x31f330){return BPromise['reject'](_0x31f330);}return _0x528657['save']();};}function saveUpdates(_0x212882,_0x22af93){return function(_0x13b370){if(_0x13b370){return _0x13b370[_0xdcd0('0x22')](_0x212882)[_0xdcd0('0x23')](function(_0x68612c){return _0x68612c;});}return null;};}function removeEntity(_0x3cb83f,_0x59bcba){return function(_0x4d2665){if(_0x4d2665){return _0x4d2665[_0xdcd0('0x24')]()[_0xdcd0('0x23')](function(){_0x3cb83f[_0xdcd0('0x1a')](0xcc)[_0xdcd0('0x25')]();});}};}function handleEntityNotFound(_0x29a9c0,_0x43b469){return function(_0x4960bf){if(!_0x4960bf){_0x29a9c0[_0xdcd0('0x19')](0x194);}return _0x4960bf;};}function handleError(_0x5efd9d,_0x5bb408){_0x5bb408=_0x5bb408||0x1f4;return function(_0x24f373){logger[_0xdcd0('0x26')](_0x24f373[_0xdcd0('0x27')]);if(_0x24f373[_0xdcd0('0x28')]){delete _0x24f373['name'];}_0x5efd9d[_0xdcd0('0x1a')](_0x5bb408)[_0xdcd0('0x29')](_0x24f373);};}exports[_0xdcd0('0x2a')]=function(_0x3f2c9c,_0x59b55a){var _0xd67b86={},_0x150ca7={},_0xdb52dd={'count':0x0,'rows':[]};var _0x4c87db=_[_0xdcd0('0x2b')](db[_0xdcd0('0x2c')][_0xdcd0('0x2d')],function(_0x1c7640){return{'name':_0x1c7640[_0xdcd0('0x2e')],'type':_0x1c7640[_0xdcd0('0x2f')]['key']};});_0x150ca7[_0xdcd0('0x30')]=_[_0xdcd0('0x2b')](_0x4c87db,_0xdcd0('0x28'));_0x150ca7[_0xdcd0('0x31')]=_[_0xdcd0('0x32')](_0x3f2c9c['query']);_0x150ca7['filters']=_[_0xdcd0('0x33')](_0x150ca7['model'],_0x150ca7[_0xdcd0('0x31')]);_0xd67b86[_0xdcd0('0x34')]=_['intersection'](_0x150ca7[_0xdcd0('0x30')],qs[_0xdcd0('0x35')](_0x3f2c9c[_0xdcd0('0x31')][_0xdcd0('0x35')]));_0xd67b86[_0xdcd0('0x34')]=_0xd67b86['attributes'][_0xdcd0('0x36')]?_0xd67b86[_0xdcd0('0x34')]:_0x150ca7[_0xdcd0('0x30')];if(!_0x3f2c9c[_0xdcd0('0x31')][_0xdcd0('0x37')](_0xdcd0('0x38'))){_0xd67b86[_0xdcd0('0x1c')]=qs[_0xdcd0('0x1c')](_0x3f2c9c[_0xdcd0('0x31')][_0xdcd0('0x1c')]);_0xd67b86[_0xdcd0('0x1e')]=qs[_0xdcd0('0x1e')](_0x3f2c9c[_0xdcd0('0x31')][_0xdcd0('0x1e')]);}_0xd67b86['order']=qs[_0xdcd0('0x39')](_0x3f2c9c[_0xdcd0('0x31')][_0xdcd0('0x39')]);_0xd67b86[_0xdcd0('0x3a')]=qs[_0xdcd0('0x3b')](_[_0xdcd0('0x3c')](_0x3f2c9c[_0xdcd0('0x31')],_0x150ca7[_0xdcd0('0x3b')]),_0x4c87db);if(_0x3f2c9c[_0xdcd0('0x31')]['filter']){_0xd67b86['where']=_[_0xdcd0('0x3d')](_0xd67b86[_0xdcd0('0x3a')],{'$or':_['map'](_0x4c87db,function(_0x39a8f1){if(_0x39a8f1[_0xdcd0('0x2f')]!==_0xdcd0('0x3e')){var _0x565d6d={};_0x565d6d[_0x39a8f1[_0xdcd0('0x28')]]={'$like':'%'+_0x3f2c9c[_0xdcd0('0x31')][_0xdcd0('0x3f')]+'%'};return _0x565d6d;}})});}_0xd67b86=_[_0xdcd0('0x3d')]({},_0xd67b86,_0x3f2c9c['options']);var _0xa94229={'where':_0xd67b86[_0xdcd0('0x3a')]};return db[_0xdcd0('0x2c')][_0xdcd0('0x1d')](_0xa94229)[_0xdcd0('0x23')](function(_0x5c3431){_0xdb52dd[_0xdcd0('0x1d')]=_0x5c3431;if(_0x3f2c9c[_0xdcd0('0x31')][_0xdcd0('0x40')]){_0xd67b86[_0xdcd0('0x41')]=[{'all':!![]}];}return db[_0xdcd0('0x2c')][_0xdcd0('0x42')](_0xd67b86);})[_0xdcd0('0x23')](function(_0x365386){_0xdb52dd[_0xdcd0('0x43')]=_0x365386;return _0xdb52dd;})[_0xdcd0('0x23')](respondWithFilteredResult(_0x59b55a,_0xd67b86))[_0xdcd0('0x44')](handleError(_0x59b55a,null));};exports[_0xdcd0('0x45')]=function(_0x14b368,_0x42a331){var _0x332ea0={'raw':!![],'where':{'id':_0x14b368[_0xdcd0('0x46')]['id']}},_0x404a7f={};_0x404a7f[_0xdcd0('0x30')]=_['keys'](db[_0xdcd0('0x2c')]['rawAttributes']);_0x404a7f[_0xdcd0('0x31')]=_[_0xdcd0('0x32')](_0x14b368[_0xdcd0('0x31')]);_0x404a7f[_0xdcd0('0x3b')]=_['intersection'](_0x404a7f['model'],_0x404a7f[_0xdcd0('0x31')]);_0x332ea0['attributes']=_[_0xdcd0('0x33')](_0x404a7f[_0xdcd0('0x30')],qs['fields'](_0x14b368[_0xdcd0('0x31')][_0xdcd0('0x35')]));_0x332ea0[_0xdcd0('0x34')]=_0x332ea0[_0xdcd0('0x34')]['length']?_0x332ea0[_0xdcd0('0x34')]:_0x404a7f['model'];if(_0x14b368[_0xdcd0('0x31')][_0xdcd0('0x40')]){_0x332ea0['include']=[{'all':!![]}];}_0x332ea0=_['merge']({},_0x332ea0,_0x14b368[_0xdcd0('0x47')]);return db[_0xdcd0('0x2c')][_0xdcd0('0x48')](_0x332ea0)[_0xdcd0('0x23')](handleEntityNotFound(_0x42a331,null))[_0xdcd0('0x23')](respondWithResult(_0x42a331,null))[_0xdcd0('0x44')](handleError(_0x42a331,null));};exports[_0xdcd0('0x49')]=function(_0x130e70,_0xe82e19){return db[_0xdcd0('0x2c')][_0xdcd0('0x49')](_0x130e70[_0xdcd0('0x4a')],{})[_0xdcd0('0x23')](respondWithResult(_0xe82e19,0xc9))[_0xdcd0('0x44')](handleError(_0xe82e19,null));};exports[_0xdcd0('0x22')]=function(_0x4f1001,_0x47c5e4){if(_0x4f1001[_0xdcd0('0x4a')]['id']){delete _0x4f1001[_0xdcd0('0x4a')]['id'];}return db[_0xdcd0('0x2c')][_0xdcd0('0x48')]({'where':{'id':_0x4f1001[_0xdcd0('0x46')]['id']}})[_0xdcd0('0x23')](handleEntityNotFound(_0x47c5e4,null))[_0xdcd0('0x23')](saveUpdates(_0x4f1001['body'],null))[_0xdcd0('0x23')](respondWithResult(_0x47c5e4,null))[_0xdcd0('0x44')](handleError(_0x47c5e4,null));};exports[_0xdcd0('0x24')]=function(_0x1cc55e,_0x2882f7){return db[_0xdcd0('0x2c')][_0xdcd0('0x48')]({'where':{'id':_0x1cc55e[_0xdcd0('0x46')]['id']}})['then'](handleEntityNotFound(_0x2882f7,null))[_0xdcd0('0x23')](removeEntity(_0x2882f7,null))[_0xdcd0('0x44')](handleError(_0x2882f7,null));};exports[_0xdcd0('0x4b')]=function(_0x1bcab1,_0x1b002d){return db[_0xdcd0('0x2c')][_0xdcd0('0x4b')]()[_0xdcd0('0x23')](respondWithResult(_0x1b002d,null))['catch'](handleError(_0x1b002d,null));}; \ No newline at end of file +var _0xde47=['fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','SmsTransferReport','includeAll','include','rows','catch','show','params','options','find','create','body','destroy','describe','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','update','then','error','name','send','index','map','rawAttributes','type','key','query','keys','filters','intersection','model'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0xde47,0xf5));var _0x7de4=function(_0x421725,_0x318a04){_0x421725=_0x421725-0x0;var _0x51b322=_0xde47[_0x421725];return _0x51b322;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7de4('0x0'));var rp=require(_0x7de4('0x1'));var moment=require(_0x7de4('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7de4('0x3'));var path=require(_0x7de4('0x4'));var sox=require(_0x7de4('0x5'));var csv=require(_0x7de4('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7de4('0x7'));var _=require(_0x7de4('0x8'));var squel=require(_0x7de4('0x9'));var crypto=require(_0x7de4('0xa'));var jsforce=require(_0x7de4('0xb'));var deskjs=require(_0x7de4('0xc'));var toCsv=require(_0x7de4('0x6'));var querystring=require(_0x7de4('0xd'));var Papa=require(_0x7de4('0xe'));var Redis=require(_0x7de4('0xf'));var authService=require(_0x7de4('0x10'));var qs=require(_0x7de4('0x11'));var as=require(_0x7de4('0x12'));var hardwareService=require(_0x7de4('0x13'));var logger=require(_0x7de4('0x14'))(_0x7de4('0x15'));var utils=require('../../config/utils');var config=require(_0x7de4('0x16'));var licenseUtil=require(_0x7de4('0x17'));var db=require(_0x7de4('0x18'))['db'];function respondWithStatusCode(_0x236b10,_0x40cef9){_0x40cef9=_0x40cef9||0xcc;return function(_0x223adb){if(_0x223adb){return _0x236b10[_0x7de4('0x19')](_0x40cef9);}return _0x236b10[_0x7de4('0x1a')](_0x40cef9)[_0x7de4('0x1b')]();};}function respondWithResult(_0xa3b595,_0x3c72f9){_0x3c72f9=_0x3c72f9||0xc8;return function(_0x2b24ed){if(_0x2b24ed){return _0xa3b595[_0x7de4('0x1a')](_0x3c72f9)['json'](_0x2b24ed);}};}function respondWithFilteredResult(_0x2f05e2,_0x1f0574){return function(_0x4502b2){if(_0x4502b2){var _0x2dfff1=typeof _0x1f0574[_0x7de4('0x1c')]===_0x7de4('0x1d')&&typeof _0x1f0574[_0x7de4('0x1e')]===_0x7de4('0x1d');var _0x50b4d3=_0x4502b2[_0x7de4('0x1f')];var _0x571bee=_0x2dfff1?0x0:_0x1f0574[_0x7de4('0x1c')];var _0x545241=_0x2dfff1?_0x4502b2[_0x7de4('0x1f')]:_0x1f0574[_0x7de4('0x1c')]+_0x1f0574[_0x7de4('0x1e')];var _0x510c8e;if(_0x545241>=_0x50b4d3){_0x545241=_0x50b4d3;_0x510c8e=0xc8;}else{_0x510c8e=0xce;}_0x2f05e2[_0x7de4('0x1a')](_0x510c8e);return _0x2f05e2[_0x7de4('0x20')](_0x7de4('0x21'),_0x571bee+'-'+_0x545241+'/'+_0x50b4d3)[_0x7de4('0x22')](_0x4502b2);}return null;};}function patchUpdates(_0xab663a){return function(_0x40f17d){try{jsonpatch['apply'](_0x40f17d,_0xab663a,!![]);}catch(_0x79efe6){return BPromise[_0x7de4('0x23')](_0x79efe6);}return _0x40f17d['save']();};}function saveUpdates(_0x1bed1a,_0x2441ae){return function(_0x4c0a75){if(_0x4c0a75){return _0x4c0a75[_0x7de4('0x24')](_0x1bed1a)['then'](function(_0x5426a1){return _0x5426a1;});}return null;};}function removeEntity(_0x55d3ea,_0x478b05){return function(_0x597a91){if(_0x597a91){return _0x597a91['destroy']()[_0x7de4('0x25')](function(){_0x55d3ea[_0x7de4('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19a8bf,_0x4a7ed4){return function(_0x3f0924){if(!_0x3f0924){_0x19a8bf['sendStatus'](0x194);}return _0x3f0924;};}function handleError(_0x4c1848,_0x6b917){_0x6b917=_0x6b917||0x1f4;return function(_0x1fd111){logger[_0x7de4('0x26')](_0x1fd111['stack']);if(_0x1fd111[_0x7de4('0x27')]){delete _0x1fd111['name'];}_0x4c1848[_0x7de4('0x1a')](_0x6b917)[_0x7de4('0x28')](_0x1fd111);};}exports[_0x7de4('0x29')]=function(_0x199dc3,_0x54bb78){var _0x45d522={},_0x49b5e5={},_0x55658a={'count':0x0,'rows':[]};var _0x24e81e=_[_0x7de4('0x2a')](db['SmsTransferReport'][_0x7de4('0x2b')],function(_0x10bbc4){return{'name':_0x10bbc4['fieldName'],'type':_0x10bbc4[_0x7de4('0x2c')][_0x7de4('0x2d')]};});_0x49b5e5['model']=_[_0x7de4('0x2a')](_0x24e81e,_0x7de4('0x27'));_0x49b5e5[_0x7de4('0x2e')]=_[_0x7de4('0x2f')](_0x199dc3['query']);_0x49b5e5[_0x7de4('0x30')]=_[_0x7de4('0x31')](_0x49b5e5[_0x7de4('0x32')],_0x49b5e5[_0x7de4('0x2e')]);_0x45d522['attributes']=_['intersection'](_0x49b5e5[_0x7de4('0x32')],qs[_0x7de4('0x33')](_0x199dc3[_0x7de4('0x2e')]['fields']));_0x45d522[_0x7de4('0x34')]=_0x45d522[_0x7de4('0x34')][_0x7de4('0x35')]?_0x45d522[_0x7de4('0x34')]:_0x49b5e5[_0x7de4('0x32')];if(!_0x199dc3[_0x7de4('0x2e')][_0x7de4('0x36')](_0x7de4('0x37'))){_0x45d522['limit']=qs[_0x7de4('0x1e')](_0x199dc3[_0x7de4('0x2e')][_0x7de4('0x1e')]);_0x45d522[_0x7de4('0x1c')]=qs['offset'](_0x199dc3[_0x7de4('0x2e')][_0x7de4('0x1c')]);}_0x45d522['order']=qs['sort'](_0x199dc3['query'][_0x7de4('0x38')]);_0x45d522['where']=qs['filters'](_[_0x7de4('0x39')](_0x199dc3['query'],_0x49b5e5[_0x7de4('0x30')]),_0x24e81e);if(_0x199dc3['query'][_0x7de4('0x3a')]){_0x45d522['where']=_[_0x7de4('0x3b')](_0x45d522[_0x7de4('0x3c')],{'$or':_[_0x7de4('0x2a')](_0x24e81e,function(_0x4a32cb){if(_0x4a32cb[_0x7de4('0x2c')]!=='VIRTUAL'){var _0x3e72f3={};_0x3e72f3[_0x4a32cb[_0x7de4('0x27')]]={'$like':'%'+_0x199dc3[_0x7de4('0x2e')][_0x7de4('0x3a')]+'%'};return _0x3e72f3;}})});}_0x45d522=_[_0x7de4('0x3b')]({},_0x45d522,_0x199dc3['options']);var _0x37f9f7={'where':_0x45d522[_0x7de4('0x3c')]};return db[_0x7de4('0x3d')][_0x7de4('0x1f')](_0x37f9f7)[_0x7de4('0x25')](function(_0x20e21c){_0x55658a[_0x7de4('0x1f')]=_0x20e21c;if(_0x199dc3[_0x7de4('0x2e')][_0x7de4('0x3e')]){_0x45d522[_0x7de4('0x3f')]=[{'all':!![]}];}return db[_0x7de4('0x3d')]['findAll'](_0x45d522);})[_0x7de4('0x25')](function(_0x45857b){_0x55658a[_0x7de4('0x40')]=_0x45857b;return _0x55658a;})[_0x7de4('0x25')](respondWithFilteredResult(_0x54bb78,_0x45d522))[_0x7de4('0x41')](handleError(_0x54bb78,null));};exports[_0x7de4('0x42')]=function(_0x1bfe7e,_0x3ecf30){var _0x41ac1b={'raw':!![],'where':{'id':_0x1bfe7e[_0x7de4('0x43')]['id']}},_0x385a13={};_0x385a13[_0x7de4('0x32')]=_[_0x7de4('0x2f')](db['SmsTransferReport'][_0x7de4('0x2b')]);_0x385a13[_0x7de4('0x2e')]=_[_0x7de4('0x2f')](_0x1bfe7e[_0x7de4('0x2e')]);_0x385a13['filters']=_['intersection'](_0x385a13['model'],_0x385a13[_0x7de4('0x2e')]);_0x41ac1b[_0x7de4('0x34')]=_[_0x7de4('0x31')](_0x385a13[_0x7de4('0x32')],qs[_0x7de4('0x33')](_0x1bfe7e[_0x7de4('0x2e')][_0x7de4('0x33')]));_0x41ac1b[_0x7de4('0x34')]=_0x41ac1b[_0x7de4('0x34')][_0x7de4('0x35')]?_0x41ac1b[_0x7de4('0x34')]:_0x385a13[_0x7de4('0x32')];if(_0x1bfe7e[_0x7de4('0x2e')][_0x7de4('0x3e')]){_0x41ac1b[_0x7de4('0x3f')]=[{'all':!![]}];}_0x41ac1b=_[_0x7de4('0x3b')]({},_0x41ac1b,_0x1bfe7e[_0x7de4('0x44')]);return db[_0x7de4('0x3d')][_0x7de4('0x45')](_0x41ac1b)['then'](handleEntityNotFound(_0x3ecf30,null))['then'](respondWithResult(_0x3ecf30,null))[_0x7de4('0x41')](handleError(_0x3ecf30,null));};exports[_0x7de4('0x46')]=function(_0x3d78fe,_0xe1226){return db[_0x7de4('0x3d')][_0x7de4('0x46')](_0x3d78fe['body'],{})[_0x7de4('0x25')](respondWithResult(_0xe1226,0xc9))[_0x7de4('0x41')](handleError(_0xe1226,null));};exports['update']=function(_0x12805e,_0x39f980){if(_0x12805e[_0x7de4('0x47')]['id']){delete _0x12805e['body']['id'];}return db[_0x7de4('0x3d')][_0x7de4('0x45')]({'where':{'id':_0x12805e[_0x7de4('0x43')]['id']}})[_0x7de4('0x25')](handleEntityNotFound(_0x39f980,null))[_0x7de4('0x25')](saveUpdates(_0x12805e[_0x7de4('0x47')],null))[_0x7de4('0x25')](respondWithResult(_0x39f980,null))[_0x7de4('0x41')](handleError(_0x39f980,null));};exports[_0x7de4('0x48')]=function(_0x3b43e8,_0x18f9ea){return db['SmsTransferReport'][_0x7de4('0x45')]({'where':{'id':_0x3b43e8[_0x7de4('0x43')]['id']}})[_0x7de4('0x25')](handleEntityNotFound(_0x18f9ea,null))[_0x7de4('0x25')](removeEntity(_0x18f9ea,null))[_0x7de4('0x41')](handleError(_0x18f9ea,null));};exports[_0x7de4('0x49')]=function(_0x2b1f41,_0x591a8e){return db[_0x7de4('0x3d')]['describe']()['then'](respondWithResult(_0x591a8e,null))[_0x7de4('0x41')](handleError(_0x591a8e,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 35ad872..8d88df6 100644 --- a/server/api/smsTransferReport/smsTransferReport.model.js +++ b/server/api/smsTransferReport/smsTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6347=['report_sms_transfer','uniqueid','lodash','util','api','moment','bluebird','request-promise','rimraf','./smsTransferReport.attributes','exports','define','SmsTransferReport'];(function(_0x1e49a5,_0x181fa0){var _0x13bb32=function(_0x171613){while(--_0x171613){_0x1e49a5['push'](_0x1e49a5['shift']());}};_0x13bb32(++_0x181fa0);}(_0x6347,0x1c9));var _0x7634=function(_0x447ade,_0xf08302){_0x447ade=_0x447ade-0x0;var _0x5dd563=_0x6347[_0x447ade];return _0x5dd563;};'use strict';var _=require(_0x7634('0x0'));var util=require(_0x7634('0x1'));var logger=require('../../config/logger')(_0x7634('0x2'));var moment=require(_0x7634('0x3'));var BPromise=require(_0x7634('0x4'));var rp=require(_0x7634('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7634('0x6'));var config=require('../../config/environment');var attributes=require(_0x7634('0x7'));module[_0x7634('0x8')]=function(_0x56d2ad,_0x58d043){return _0x56d2ad[_0x7634('0x9')](_0x7634('0xa'),attributes,{'tableName':_0x7634('0xb'),'paranoid':![],'indexes':[{'name':_0x7634('0xc'),'fields':[_0x7634('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xff96=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','uniqueid'];(function(_0x5b133d,_0x59bd25){var _0x379730=function(_0x53b0d6){while(--_0x53b0d6){_0x5b133d['push'](_0x5b133d['shift']());}};_0x379730(++_0x59bd25);}(_0xff96,0x179));var _0x6ff9=function(_0x16af01,_0x9c623c){_0x16af01=_0x16af01-0x0;var _0x4d4b9a=_0xff96[_0x16af01];return _0x4d4b9a;};'use strict';var _=require(_0x6ff9('0x0'));var util=require(_0x6ff9('0x1'));var logger=require(_0x6ff9('0x2'))(_0x6ff9('0x3'));var moment=require(_0x6ff9('0x4'));var BPromise=require(_0x6ff9('0x5'));var rp=require(_0x6ff9('0x6'));var fs=require('fs');var path=require(_0x6ff9('0x7'));var rimraf=require(_0x6ff9('0x8'));var config=require(_0x6ff9('0x9'));var attributes=require(_0x6ff9('0xa'));module[_0x6ff9('0xb')]=function(_0x4adb77,_0x3efaff){return _0x4adb77['define']('SmsTransferReport',attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0x6ff9('0xc'),'fields':[_0x6ff9('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 6d8efa3..a08dc83 100644 --- a/server/api/smsTransferReport/smsTransferReport.rpc.js +++ b/server/api/smsTransferReport/smsTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe64a=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','http','request','then','info','request\x20sent','stringify','error','message','SmsTransferReport,\x20%s,\x20%s','result','catch'];(function(_0x175e89,_0x20835f){var _0x2ed996=function(_0x56239f){while(--_0x56239f){_0x175e89['push'](_0x175e89['shift']());}};_0x2ed996(++_0x20835f);}(_0xe64a,0x1e0));var _0xae64=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xe64a[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xae64('0x0'));var util=require(_0xae64('0x1'));var moment=require(_0xae64('0x2'));var BPromise=require(_0xae64('0x3'));var rs=require(_0xae64('0x4'));var fs=require('fs');var Redis=require(_0xae64('0x5'));var db=require(_0xae64('0x6'))['db'];var utils=require(_0xae64('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xae64('0x8')][_0xae64('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1064e3,_0x3cb2a6,_0x272ae9){return new BPromise(function(_0x65a9d1,_0x385871){return client[_0xae64('0xa')](_0x1064e3,_0x272ae9)[_0xae64('0xb')](function(_0x407543){logger[_0xae64('0xc')]('SmsTransferReport,\x20%s,\x20%s',_0x3cb2a6,_0xae64('0xd'));logger['debug']('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x3cb2a6,_0xae64('0xd'),JSON[_0xae64('0xe')](_0x407543));if(_0x407543[_0xae64('0xf')]){if(_0x407543[_0xae64('0xf')]['code']===0x1f4){logger[_0xae64('0xf')]('SmsTransferReport,\x20%s,\x20%s',_0x3cb2a6,_0x407543['error'][_0xae64('0x10')]);return _0x385871(_0x407543[_0xae64('0xf')][_0xae64('0x10')]);}logger['error'](_0xae64('0x11'),_0x3cb2a6,_0x407543[_0xae64('0xf')][_0xae64('0x10')]);return _0x65a9d1(_0x407543[_0xae64('0xf')][_0xae64('0x10')]);}else{logger['info'](_0xae64('0x11'),_0x3cb2a6,_0xae64('0xd'));_0x65a9d1(_0x407543[_0xae64('0x12')][_0xae64('0x10')]);}})[_0xae64('0x13')](function(_0x561408){logger[_0xae64('0xf')](_0xae64('0x11'),_0x3cb2a6,_0x561408);_0x385871(_0x561408);});});} \ No newline at end of file +var _0x723e=['SmsTransferReport,\x20%s,\x20%s','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info'];(function(_0x5ab6f7,_0x5ebde9){var _0x853e97=function(_0x419e22){while(--_0x419e22){_0x5ab6f7['push'](_0x5ab6f7['shift']());}};_0x853e97(++_0x5ebde9);}(_0x723e,0x179));var _0xe723=function(_0x364f2a,_0x18bafd){_0x364f2a=_0x364f2a-0x0;var _0x4f8a32=_0x723e[_0x364f2a];return _0x4f8a32;};'use strict';var _=require('lodash');var util=require(_0xe723('0x0'));var moment=require(_0xe723('0x1'));var BPromise=require(_0xe723('0x2'));var rs=require(_0xe723('0x3'));var fs=require('fs');var Redis=require(_0xe723('0x4'));var db=require(_0xe723('0x5'))['db'];var utils=require(_0xe723('0x6'));var logger=require(_0xe723('0x7'))(_0xe723('0x8'));var config=require(_0xe723('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe723('0xa')][_0xe723('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1335cd,_0x3bf082,_0x2aebbd){return new BPromise(function(_0xe50f7,_0x1b46e0){return client[_0xe723('0xc')](_0x1335cd,_0x2aebbd)['then'](function(_0x380444){logger[_0xe723('0xd')](_0xe723('0xe'),_0x3bf082,'request\x20sent');logger[_0xe723('0xf')](_0xe723('0x10'),_0x3bf082,_0xe723('0x11'),JSON['stringify'](_0x380444));if(_0x380444[_0xe723('0x12')]){if(_0x380444[_0xe723('0x12')][_0xe723('0x13')]===0x1f4){logger[_0xe723('0x12')](_0xe723('0xe'),_0x3bf082,_0x380444['error'][_0xe723('0x14')]);return _0x1b46e0(_0x380444['error']['message']);}logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x3bf082,_0x380444[_0xe723('0x12')][_0xe723('0x14')]);return _0xe50f7(_0x380444[_0xe723('0x12')][_0xe723('0x14')]);}else{logger[_0xe723('0xd')]('SmsTransferReport,\x20%s,\x20%s',_0x3bf082,_0xe723('0x11'));_0xe50f7(_0x380444[_0xe723('0x15')][_0xe723('0x14')]);}})[_0xe723('0x16')](function(_0x347fa0){logger[_0xe723('0x12')](_0xe723('0xe'),_0x3bf082,_0x347fa0);_0x1b46e0(_0x347fa0);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index ee44785..7a86c61 100644 --- a/server/api/sound/index.js +++ b/server/api/sound/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9f53=['diskStorage','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','now','extname','post','single','file','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','/:id','show','download'];(function(_0x1cf035,_0x48a94c){var _0x1c2209=function(_0x1590e3){while(--_0x1590e3){_0x1cf035['push'](_0x1cf035['shift']());}};_0x1c2209(++_0x48a94c);}(_0x9f53,0x11a));var _0x39f5=function(_0x35a982,_0x2ad7dd){_0x35a982=_0x35a982-0x0;var _0x509232=_0x9f53[_0x35a982];return _0x509232;};'use strict';var multer=require(_0x39f5('0x0'));var util=require(_0x39f5('0x1'));var path=require(_0x39f5('0x2'));var timeout=require(_0x39f5('0x3'));var express=require(_0x39f5('0x4'));var router=express[_0x39f5('0x5')]();var fs_extra=require(_0x39f5('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x39f5('0x7'));var config=require(_0x39f5('0x8'));var controller=require(_0x39f5('0x9'));router[_0x39f5('0xa')]('/',auth[_0x39f5('0xb')](),controller['index']);router[_0x39f5('0xa')](_0x39f5('0xc'),auth[_0x39f5('0xb')](),controller[_0x39f5('0xd')]);router[_0x39f5('0xa')]('/:id/download',auth[_0x39f5('0xb')](),controller[_0x39f5('0xe')]);var upload=multer({'storage':multer[_0x39f5('0xf')]({'destination':function(_0x1a631a,_0x4763e2,_0x12fbb2){_0x12fbb2(null,path['join'](config[_0x39f5('0x10')],_0x39f5('0x11')));},'filename':function(_0x40fe5b,_0x4c9248,_0x547ac8){_0x4c9248[_0x39f5('0x12')]=_0x4c9248[_0x39f5('0x12')][_0x39f5('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x547ac8(null,util[_0x39f5('0x14')](_0x39f5('0x15'),path[_0x39f5('0x16')](_0x4c9248[_0x39f5('0x12')],path['extname'](_0x4c9248[_0x39f5('0x12')])),Date[_0x39f5('0x17')](),path[_0x39f5('0x18')](_0x4c9248['originalname'])));}})});router[_0x39f5('0x19')]('/',upload[_0x39f5('0x1a')](_0x39f5('0x1b')),controller[_0x39f5('0x1c')]);router[_0x39f5('0x1d')]('/:id',auth['isAuthenticated'](),controller[_0x39f5('0x1e')]);router[_0x39f5('0x1f')]('/:id',auth[_0x39f5('0xb')](),controller['delete']);module[_0x39f5('0x20')]=router; \ No newline at end of file +var _0x0227=['file','create','update','delete','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','index','/:id','isAuthenticated','show','server/files/sounds/original/','originalname','replace','basename','extname','now','post','single'];(function(_0x537b69,_0xd56ab9){var _0x129049=function(_0x10cb80){while(--_0x10cb80){_0x537b69['push'](_0x537b69['shift']());}};_0x129049(++_0xd56ab9);}(_0x0227,0x1ad));var _0x7022=function(_0x899e2d,_0x4cc474){_0x899e2d=_0x899e2d-0x0;var _0x1146fc=_0x0227[_0x899e2d];return _0x1146fc;};'use strict';var multer=require(_0x7022('0x0'));var util=require(_0x7022('0x1'));var path=require(_0x7022('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x7022('0x3'));var auth=require(_0x7022('0x4'));var interaction=require(_0x7022('0x5'));var config=require(_0x7022('0x6'));var controller=require(_0x7022('0x7'));router[_0x7022('0x8')]('/',auth['isAuthenticated'](),controller[_0x7022('0x9')]);router[_0x7022('0x8')](_0x7022('0xa'),auth[_0x7022('0xb')](),controller[_0x7022('0xc')]);router[_0x7022('0x8')]('/:id/download',auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x30675a,_0x1d923e,_0x1f4317){_0x1f4317(null,path['join'](config['root'],_0x7022('0xd')));},'filename':function(_0x4f7f4d,_0x3939ba,_0x1f6dfb){_0x3939ba['originalname']=_0x3939ba[_0x7022('0xe')][_0x7022('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1f6dfb(null,util['format']('%s-%s%s',path[_0x7022('0x10')](_0x3939ba[_0x7022('0xe')],path[_0x7022('0x11')](_0x3939ba[_0x7022('0xe')])),Date[_0x7022('0x12')](),path['extname'](_0x3939ba[_0x7022('0xe')])));}})});router[_0x7022('0x13')]('/',upload[_0x7022('0x14')](_0x7022('0x15')),controller[_0x7022('0x16')]);router['put'](_0x7022('0xa'),auth[_0x7022('0xb')](),controller[_0x7022('0x17')]);router[_0x7022('0x18')](_0x7022('0xa'),auth[_0x7022('0xb')](),controller[_0x7022('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 43d1818..e40e5d3 100644 --- a/server/api/sound/sound.attributes.js +++ b/server/api/sound/sound.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x175f=['INTEGER','BIGINT','exports','STRING','name','FLOAT'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0x175f,0x1be));var _0xf175=function(_0x30a6a5,_0x1a5cc6){_0x30a6a5=_0x30a6a5-0x0;var _0x560984=_0x175f[_0x30a6a5];return _0x560984;};'use strict';var Sequelize=require('sequelize');module[_0xf175('0x0')]={'name':{'type':Sequelize[_0xf175('0x1')],'unique':_0xf175('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0xf175('0x1')]},'display_name':{'type':Sequelize[_0xf175('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0xf175('0x1')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0xf175('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0xf175('0x4')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0xf175('0x4')]},'converted_format':{'type':Sequelize[_0xf175('0x1')]},'converted_duration':{'type':Sequelize[_0xf175('0x3')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0xf175('0x5')]},'converted_sampleRate':{'type':Sequelize[_0xf175('0x4')]}}; \ No newline at end of file +var _0x566d=['FLOAT','BIGINT','INTEGER','exports','STRING'];(function(_0x2c412c,_0x31de56){var _0xcfff0d=function(_0x49362a){while(--_0x49362a){_0x2c412c['push'](_0x2c412c['shift']());}};_0xcfff0d(++_0x31de56);}(_0x566d,0x139));var _0xd566=function(_0xa86de9,_0xd7a283){_0xa86de9=_0xa86de9-0x0;var _0x5e5415=_0x566d[_0xa86de9];return _0x5e5415;};'use strict';var Sequelize=require('sequelize');module[_0xd566('0x0')]={'name':{'type':Sequelize[_0xd566('0x1')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0xd566('0x1')]},'display_name':{'type':Sequelize[_0xd566('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0xd566('0x1')]},'original_format':{'type':Sequelize[_0xd566('0x1')]},'original_duration':{'type':Sequelize[_0xd566('0x2')]},'original_sampleCount':{'type':Sequelize[_0xd566('0x3')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0xd566('0x3')]},'original_sampleRate':{'type':Sequelize[_0xd566('0x4')]},'converted_format':{'type':Sequelize[_0xd566('0x1')]},'converted_duration':{'type':Sequelize[_0xd566('0x2')]},'converted_sampleCount':{'type':Sequelize[_0xd566('0x3')]},'converted_channelCount':{'type':Sequelize[_0xd566('0x4')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0xd566('0x4')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 077fd76..ad94e6f 100644 --- a/server/api/sound/sound.controller.js +++ b/server/api/sound/sound.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0412=['src','duration','original_sampleCount','sampleCount','original_channelCount','original_bitRate','bitRate','sampleRate','dest','converted_sampleCount','converted_channelCount','channelCount','converted_bitRate','body','role','userProfileId','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Sounds','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','Sound','includeAll','include','rows','catch','show','params','keys','intersection','find','download','save_name','converted_format','existsSync','join','server/files/sounds/converted','Sequelize','ValidationError','format','%s.%s','create','basename','originalname','extname','file','filename','substring','root','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','chmodSync','0777','transcode','wav','unlinkSync'];(function(_0x57d13b,_0x52d8cb){var _0x467696=function(_0x153000){while(--_0x153000){_0x57d13b['push'](_0x57d13b['shift']());}};_0x467696(++_0x52d8cb);}(_0x0412,0x95));var _0x2041=function(_0x42b1f9,_0x13071e){_0x42b1f9=_0x42b1f9-0x0;var _0x190bf9=_0x0412[_0x42b1f9];return _0x190bf9;};'use strict';var emlformat=require(_0x2041('0x0'));var rimraf=require(_0x2041('0x1'));var zipdir=require(_0x2041('0x2'));var jsonpatch=require(_0x2041('0x3'));var rp=require(_0x2041('0x4'));var moment=require(_0x2041('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2041('0x6'));var util=require('util');var path=require(_0x2041('0x7'));var sox=require(_0x2041('0x8'));var csv=require(_0x2041('0x9'));var ejs=require(_0x2041('0xa'));var fs=require('fs');var fs_extra=require(_0x2041('0xb'));var _=require(_0x2041('0xc'));var squel=require(_0x2041('0xd'));var crypto=require(_0x2041('0xe'));var jsforce=require(_0x2041('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x2041('0x9'));var querystring=require(_0x2041('0x10'));var Papa=require('papaparse');var Redis=require(_0x2041('0x11'));var authService=require(_0x2041('0x12'));var qs=require(_0x2041('0x13'));var as=require(_0x2041('0x14'));var hardwareService=require(_0x2041('0x15'));var logger=require(_0x2041('0x16'))(_0x2041('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x38f226,_0x1c8cbf){_0x1c8cbf=_0x1c8cbf||0xcc;return function(_0x41b226){if(_0x41b226){return _0x38f226[_0x2041('0x18')](_0x1c8cbf);}return _0x38f226[_0x2041('0x19')](_0x1c8cbf)[_0x2041('0x1a')]();};}function respondWithResult(_0x3aa911,_0xa3bc9){_0xa3bc9=_0xa3bc9||0xc8;return function(_0x454ee6){if(_0x454ee6){return _0x3aa911['status'](_0xa3bc9)[_0x2041('0x1b')](_0x454ee6);}};}function respondWithFilteredResult(_0x515f31,_0x35c021){return function(_0x44b60a){if(_0x44b60a){var _0x5e6074=typeof _0x35c021[_0x2041('0x1c')]===_0x2041('0x1d')&&typeof _0x35c021['limit']===_0x2041('0x1d');var _0x224d27=_0x44b60a[_0x2041('0x1e')];var _0x29bb7a=_0x5e6074?0x0:_0x35c021['offset'];var _0x48abb8=_0x5e6074?_0x44b60a[_0x2041('0x1e')]:_0x35c021['offset']+_0x35c021[_0x2041('0x1f')];var _0x100c8b;if(_0x48abb8>=_0x224d27){_0x48abb8=_0x224d27;_0x100c8b=0xc8;}else{_0x100c8b=0xce;}_0x515f31[_0x2041('0x19')](_0x100c8b);return _0x515f31[_0x2041('0x20')](_0x2041('0x21'),_0x29bb7a+'-'+_0x48abb8+'/'+_0x224d27)[_0x2041('0x1b')](_0x44b60a);}return null;};}function patchUpdates(_0xb3445e){return function(_0x16c76a){try{jsonpatch[_0x2041('0x22')](_0x16c76a,_0xb3445e,!![]);}catch(_0x4683dc){return BPromise[_0x2041('0x23')](_0x4683dc);}return _0x16c76a[_0x2041('0x24')]();};}function saveUpdates(_0x58e1f3,_0x4cecdf){return function(_0x400e0f){if(_0x400e0f){return _0x400e0f[_0x2041('0x25')](_0x58e1f3)[_0x2041('0x26')](function(_0x142601){return _0x142601;});}return null;};}function removeEntity(_0x204b66,_0x194faa){return function(_0xfabac8){if(_0xfabac8){return _0xfabac8[_0x2041('0x27')]()[_0x2041('0x26')](function(){var _0x48263a=_0xfabac8[_0x2041('0x28')]({'plain':!![]});var _0x51d905=_0x2041('0x29');return db['UserProfileResource'][_0x2041('0x27')]({'where':{'type':_0x51d905,'resourceId':_0x48263a['id']}})['then'](function(){return _0xfabac8;});})[_0x2041('0x26')](function(){_0x204b66[_0x2041('0x19')](0xcc)[_0x2041('0x1a')]();});}};}function handleEntityNotFound(_0xaa8a65,_0x2cb083){return function(_0x5ac193){if(!_0x5ac193){_0xaa8a65['sendStatus'](0x194);}return _0x5ac193;};}function handleError(_0x4bb1e8,_0x438741){_0x438741=_0x438741||0x1f4;return function(_0x313e7e){logger['error'](_0x313e7e['stack']);if(_0x313e7e[_0x2041('0x2a')]){delete _0x313e7e['name'];}_0x4bb1e8[_0x2041('0x19')](_0x438741)[_0x2041('0x2b')](_0x313e7e);};}exports[_0x2041('0x2c')]=function(_0x334093,_0x3233b8){var _0x5b3a36={},_0x143f9c={},_0x5b7d6a={'count':0x0,'rows':[]};var _0x1d5304=_[_0x2041('0x2d')](db['Sound'][_0x2041('0x2e')],function(_0x49673b){return{'name':_0x49673b[_0x2041('0x2f')],'type':_0x49673b[_0x2041('0x30')][_0x2041('0x31')]};});_0x143f9c['model']=_[_0x2041('0x2d')](_0x1d5304,_0x2041('0x2a'));_0x143f9c[_0x2041('0x32')]=_['keys'](_0x334093[_0x2041('0x32')]);_0x143f9c[_0x2041('0x33')]=_['intersection'](_0x143f9c[_0x2041('0x34')],_0x143f9c[_0x2041('0x32')]);_0x5b3a36[_0x2041('0x35')]=_['intersection'](_0x143f9c['model'],qs[_0x2041('0x36')](_0x334093[_0x2041('0x32')]['fields']));_0x5b3a36[_0x2041('0x35')]=_0x5b3a36['attributes'][_0x2041('0x37')]?_0x5b3a36['attributes']:_0x143f9c[_0x2041('0x34')];if(!_0x334093[_0x2041('0x32')][_0x2041('0x38')]('nolimit')){_0x5b3a36[_0x2041('0x1f')]=qs[_0x2041('0x1f')](_0x334093[_0x2041('0x32')][_0x2041('0x1f')]);_0x5b3a36[_0x2041('0x1c')]=qs[_0x2041('0x1c')](_0x334093[_0x2041('0x32')][_0x2041('0x1c')]);}_0x5b3a36[_0x2041('0x39')]=qs[_0x2041('0x3a')](_0x334093[_0x2041('0x32')]['sort']);_0x5b3a36['where']=qs[_0x2041('0x33')](_[_0x2041('0x3b')](_0x334093['query'],_0x143f9c[_0x2041('0x33')]),_0x1d5304);if(_0x334093[_0x2041('0x32')][_0x2041('0x3c')]){_0x5b3a36[_0x2041('0x3d')]=_[_0x2041('0x3e')](_0x5b3a36[_0x2041('0x3d')],{'$or':_[_0x2041('0x2d')](_0x1d5304,function(_0x51efc7){if(_0x51efc7[_0x2041('0x30')]!==_0x2041('0x3f')){var _0x3c6c0e={};_0x3c6c0e[_0x51efc7[_0x2041('0x2a')]]={'$like':'%'+_0x334093['query'][_0x2041('0x3c')]+'%'};return _0x3c6c0e;}})});}_0x5b3a36=_[_0x2041('0x3e')]({},_0x5b3a36,_0x334093[_0x2041('0x40')]);var _0x2f66c6={'where':_0x5b3a36[_0x2041('0x3d')]};return db[_0x2041('0x41')][_0x2041('0x1e')](_0x2f66c6)[_0x2041('0x26')](function(_0x5bda04){_0x5b7d6a['count']=_0x5bda04;if(_0x334093['query'][_0x2041('0x42')]){_0x5b3a36[_0x2041('0x43')]=[{'all':!![]}];}return db['Sound']['findAll'](_0x5b3a36);})['then'](function(_0x26498c){_0x5b7d6a[_0x2041('0x44')]=_0x26498c;return _0x5b7d6a;})[_0x2041('0x26')](respondWithFilteredResult(_0x3233b8,_0x5b3a36))[_0x2041('0x45')](handleError(_0x3233b8,null));};exports[_0x2041('0x46')]=function(_0x59fe16,_0x168383){var _0x398db3={'raw':!![],'where':{'id':_0x59fe16[_0x2041('0x47')]['id']}},_0x291e9f={};_0x291e9f[_0x2041('0x34')]=_[_0x2041('0x48')](db[_0x2041('0x41')][_0x2041('0x2e')]);_0x291e9f[_0x2041('0x32')]=_[_0x2041('0x48')](_0x59fe16[_0x2041('0x32')]);_0x291e9f[_0x2041('0x33')]=_[_0x2041('0x49')](_0x291e9f['model'],_0x291e9f[_0x2041('0x32')]);_0x398db3[_0x2041('0x35')]=_[_0x2041('0x49')](_0x291e9f[_0x2041('0x34')],qs[_0x2041('0x36')](_0x59fe16[_0x2041('0x32')][_0x2041('0x36')]));_0x398db3[_0x2041('0x35')]=_0x398db3[_0x2041('0x35')][_0x2041('0x37')]?_0x398db3[_0x2041('0x35')]:_0x291e9f[_0x2041('0x34')];if(_0x59fe16['query'][_0x2041('0x42')]){_0x398db3['include']=[{'all':!![]}];}_0x398db3=_[_0x2041('0x3e')]({},_0x398db3,_0x59fe16[_0x2041('0x40')]);return db['Sound'][_0x2041('0x4a')](_0x398db3)[_0x2041('0x26')](handleEntityNotFound(_0x168383,null))['then'](respondWithResult(_0x168383,null))[_0x2041('0x45')](handleError(_0x168383,null));};exports[_0x2041('0x4b')]=function(_0x4dd84f,_0x4ab1a1,_0x397397){return db[_0x2041('0x41')][_0x2041('0x4a')]({'where':{'id':_0x4dd84f[_0x2041('0x47')]['id']},'attributes':['name',_0x2041('0x4c'),_0x2041('0x4d')],'raw':!![]})[_0x2041('0x26')](handleEntityNotFound(_0x4ab1a1,null))[_0x2041('0x26')](function(_0x270e0d){if(_0x270e0d){if(!fs[_0x2041('0x4e')](path[_0x2041('0x4f')](config['root'],_0x2041('0x50'),_0x270e0d['save_name']+'.'+_0x270e0d['converted_format']))){throw new db[(_0x2041('0x51'))][(_0x2041('0x52'))]('Sound\x20not\x20found');}return _0x4ab1a1['download'](path[_0x2041('0x4f')](config['root'],_0x2041('0x50'),util[_0x2041('0x53')](_0x2041('0x54'),_0x270e0d[_0x2041('0x4c')],_0x270e0d[_0x2041('0x4d')])),util[_0x2041('0x53')](_0x2041('0x54'),_0x270e0d[_0x2041('0x2a')],_0x270e0d[_0x2041('0x4d')]));}return null;})[_0x2041('0x45')](handleError(_0x4ab1a1,null));};exports[_0x2041('0x55')]=function(_0x521399,_0x37eb2f,_0x51a1cf){var _0x2b6c01={'name':path[_0x2041('0x56')](_0x521399['file'][_0x2041('0x57')],path[_0x2041('0x58')](_0x521399['file'][_0x2041('0x57')])),'save_name':path[_0x2041('0x56')](_0x521399[_0x2041('0x59')]['filename'],path[_0x2041('0x58')](_0x521399['file'][_0x2041('0x5a')])),'original_format':path[_0x2041('0x58')](_0x521399[_0x2041('0x59')][_0x2041('0x57')])[_0x2041('0x5b')](0x1),'converted_format':'wav'};var _0x41b65b=path[_0x2041('0x4f')](config[_0x2041('0x5c')],_0x2041('0x5d'),_0x521399[_0x2041('0x59')][_0x2041('0x5a')]);var _0x1a8581=path[_0x2041('0x4f')](config[_0x2041('0x5c')],_0x2041('0x50'),util[_0x2041('0x53')](_0x2041('0x54'),path['basename'](_0x521399[_0x2041('0x59')][_0x2041('0x5a')],path[_0x2041('0x58')](_0x521399[_0x2041('0x59')][_0x2041('0x5a')])),_0x2b6c01[_0x2041('0x4d')]));logger[_0x2041('0x5e')](_0x2041('0x5f'),_0x41b65b);logger['info']('Sound\x20upload\x20destination:\x20%s',_0x1a8581);try{fs[_0x2041('0x60')](_0x41b65b,parseInt(_0x2041('0x61'),0x8));var _0x1dbbc2=sox[_0x2041('0x62')](_0x41b65b,_0x1a8581,{'sampleRate':0x1f40,'format':_0x2041('0x63'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1dbbc2['on']('error',function(_0x3f6157){fs[_0x2041('0x64')](_0x41b65b);_0x37eb2f[_0x2041('0x19')](0x1f4)[_0x2041('0x2b')](_0x3f6157);});_0x1dbbc2['on'](_0x2041('0x65'),function(_0xefb77c){_0x2b6c01['original_duration']=isNaN(_0xefb77c[_0x2041('0x66')])?null:_0xefb77c[_0x2041('0x66')]*0x3e8;_0x2b6c01[_0x2041('0x67')]=isNaN(_0xefb77c[_0x2041('0x68')])?null:_0xefb77c[_0x2041('0x68')];_0x2b6c01[_0x2041('0x69')]=isNaN(_0xefb77c['channelCount'])?null:_0xefb77c['channelCount'];_0x2b6c01[_0x2041('0x6a')]=isNaN(_0xefb77c[_0x2041('0x6b')])?null:_0xefb77c[_0x2041('0x6b')];_0x2b6c01['original_sampleRate']=isNaN(_0xefb77c[_0x2041('0x6c')])?null:_0xefb77c[_0x2041('0x6c')];});_0x1dbbc2['on'](_0x2041('0x6d'),function(_0x4a3185){_0x2b6c01['converted_duration']=isNaN(_0x4a3185[_0x2041('0x66')])?null:_0x4a3185[_0x2041('0x66')]*0x3e8;_0x2b6c01[_0x2041('0x6e')]=isNaN(_0x4a3185[_0x2041('0x68')])?null:_0x4a3185[_0x2041('0x68')];_0x2b6c01[_0x2041('0x6f')]=isNaN(_0x4a3185[_0x2041('0x70')])?null:_0x4a3185[_0x2041('0x70')];_0x2b6c01[_0x2041('0x71')]=isNaN(_0x4a3185[_0x2041('0x6b')])?null:_0x4a3185['bitRate'];_0x2b6c01['converted_sampleRate']=isNaN(_0x4a3185[_0x2041('0x6c')])?null:_0x4a3185[_0x2041('0x6c')];});_0x1dbbc2['on'](_0x2041('0x1a'),function(){fs[_0x2041('0x60')](_0x1a8581,parseInt(_0x2041('0x61'),0x8));return db['Sound']['create'](_0x2b6c01)[_0x2041('0x26')](function(_0x1cc4ac){var _0x47b983={'role':_0x521399[_0x2041('0x72')][_0x2041('0x73')],'userProfileId':_0x521399['body'][_0x2041('0x74')]};if(!_0x47b983)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x47b983['role']===_0x2041('0x75')){var _0x25e835=_0x1cc4ac['get']({'plain':!![]});return db[_0x2041('0x76')][_0x2041('0x4a')]({'where':{'name':_0x2041('0x29'),'userProfileId':_0x47b983[_0x2041('0x74')]},'raw':!![]})[_0x2041('0x26')](function(_0x31c6af){if(_0x31c6af&&_0x31c6af[_0x2041('0x77')]===0x0){return db[_0x2041('0x78')][_0x2041('0x55')]({'name':_0x25e835[_0x2041('0x2a')],'resourceId':_0x25e835['id'],'type':_0x31c6af[_0x2041('0x2a')],'sectionId':_0x31c6af['id']},{})[_0x2041('0x26')](function(){return _0x1cc4ac;});}else{return _0x1cc4ac;}})['catch'](function(_0x2e0971){logger['error'](_0x2041('0x79'),_0x2e0971);throw _0x2e0971;});}return _0x1cc4ac;})['then'](respondWithResult(_0x37eb2f,null))['catch'](handleError(_0x37eb2f,null));});_0x1dbbc2[_0x2041('0x7a')]();}catch(_0x416c3d){_0x37eb2f[_0x2041('0x19')](0x1f4)['send'](_0x416c3d);}};exports[_0x2041('0x25')]=function(_0x3dce7f,_0x434720,_0x59e97c){return db['Sound']['find']({'where':{'id':_0x3dce7f[_0x2041('0x47')]['id']}})[_0x2041('0x26')](handleEntityNotFound(_0x434720,null))[_0x2041('0x26')](saveUpdates(_[_0x2041('0x3b')](_0x3dce7f['body'],[_0x2041('0x2a'),_0x2041('0x7b')]),null))[_0x2041('0x26')](respondWithResult(_0x434720,null))[_0x2041('0x45')](handleError(_0x434720,null));};exports[_0x2041('0x7c')]=function(_0x260535,_0x22933b,_0x196231){return db[_0x2041('0x41')][_0x2041('0x4a')]({'where':{'id':_0x260535[_0x2041('0x47')]['id']}})['then'](function(_0x1abb6b){if(_0x1abb6b){return _0x1abb6b[_0x2041('0x27')]();}})[_0x2041('0x26')](function(_0x305e44){var _0x1a5725=path[_0x2041('0x4f')](config['root'],_0x2041('0x5d'),util[_0x2041('0x53')](_0x2041('0x54'),_0x305e44[_0x2041('0x4c')],_0x305e44['original_format']));var _0x5ef1f5=path['join'](config[_0x2041('0x5c')],_0x2041('0x50'),util[_0x2041('0x53')]('%s.%s',_0x305e44[_0x2041('0x4c')],_0x305e44[_0x2041('0x4d')]));fs['unlinkSync'](_0x1a5725);fs['unlinkSync'](_0x5ef1f5);return _0x305e44;})[_0x2041('0x26')](function(_0x35b9ca){if(_0x35b9ca){return _0x22933b[_0x2041('0x19')](0xcc)[_0x2041('0x1a')]();}})[_0x2041('0x26')](handleEntityNotFound(_0x22933b,null))['catch'](handleError(_0x22933b,null));}; \ No newline at end of file +var _0x5c32=['catch','show','params','include','find','converted_format','existsSync','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','save_name','create','file','originalname','extname','filename','wav','join','server/files/sounds/original','basename','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','send','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','original_format','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','get','Sounds','UserProfileResource','error','stack','name','index','map','Sound','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','options','includeAll','rows'];(function(_0x14331c,_0x3555ed){var _0xa6ea=function(_0x4b6acf){while(--_0x4b6acf){_0x14331c['push'](_0x14331c['shift']());}};_0xa6ea(++_0x3555ed);}(_0x5c32,0x12d));var _0x25c3=function(_0x4e0dcd,_0x33ca0d){_0x4e0dcd=_0x4e0dcd-0x0;var _0x46506d=_0x5c32[_0x4e0dcd];return _0x46506d;};'use strict';var emlformat=require(_0x25c3('0x0'));var rimraf=require(_0x25c3('0x1'));var zipdir=require(_0x25c3('0x2'));var jsonpatch=require(_0x25c3('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x25c3('0x4'));var util=require(_0x25c3('0x5'));var path=require(_0x25c3('0x6'));var sox=require(_0x25c3('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x25c3('0x8'));var _=require(_0x25c3('0x9'));var squel=require(_0x25c3('0xa'));var crypto=require(_0x25c3('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x25c3('0xc'));var toCsv=require(_0x25c3('0xd'));var querystring=require(_0x25c3('0xe'));var Papa=require('papaparse');var Redis=require(_0x25c3('0xf'));var authService=require(_0x25c3('0x10'));var qs=require(_0x25c3('0x11'));var as=require(_0x25c3('0x12'));var hardwareService=require(_0x25c3('0x13'));var logger=require(_0x25c3('0x14'))(_0x25c3('0x15'));var utils=require(_0x25c3('0x16'));var config=require(_0x25c3('0x17'));var licenseUtil=require(_0x25c3('0x18'));var db=require(_0x25c3('0x19'))['db'];function respondWithStatusCode(_0x5d22f6,_0x13aebb){_0x13aebb=_0x13aebb||0xcc;return function(_0x25b933){if(_0x25b933){return _0x5d22f6[_0x25c3('0x1a')](_0x13aebb);}return _0x5d22f6['status'](_0x13aebb)[_0x25c3('0x1b')]();};}function respondWithResult(_0x2a06ba,_0xa7fe40){_0xa7fe40=_0xa7fe40||0xc8;return function(_0x2e384a){if(_0x2e384a){return _0x2a06ba[_0x25c3('0x1c')](_0xa7fe40)[_0x25c3('0x1d')](_0x2e384a);}};}function respondWithFilteredResult(_0x27201f,_0x3e6883){return function(_0x5346f8){if(_0x5346f8){var _0x4a44a9=typeof _0x3e6883[_0x25c3('0x1e')]===_0x25c3('0x1f')&&typeof _0x3e6883[_0x25c3('0x20')]===_0x25c3('0x1f');var _0x55614c=_0x5346f8[_0x25c3('0x21')];var _0x417458=_0x4a44a9?0x0:_0x3e6883[_0x25c3('0x1e')];var _0x14f713=_0x4a44a9?_0x5346f8[_0x25c3('0x21')]:_0x3e6883[_0x25c3('0x1e')]+_0x3e6883[_0x25c3('0x20')];var _0x2626c0;if(_0x14f713>=_0x55614c){_0x14f713=_0x55614c;_0x2626c0=0xc8;}else{_0x2626c0=0xce;}_0x27201f[_0x25c3('0x1c')](_0x2626c0);return _0x27201f[_0x25c3('0x22')](_0x25c3('0x23'),_0x417458+'-'+_0x14f713+'/'+_0x55614c)[_0x25c3('0x1d')](_0x5346f8);}return null;};}function patchUpdates(_0x4fd55a){return function(_0x3173ab){try{jsonpatch['apply'](_0x3173ab,_0x4fd55a,!![]);}catch(_0x3086ef){return BPromise['reject'](_0x3086ef);}return _0x3173ab[_0x25c3('0x24')]();};}function saveUpdates(_0x576f09,_0x3a777b){return function(_0x9df103){if(_0x9df103){return _0x9df103[_0x25c3('0x25')](_0x576f09)[_0x25c3('0x26')](function(_0x4e36ea){return _0x4e36ea;});}return null;};}function removeEntity(_0x57e12c,_0x438c36){return function(_0x46eda4){if(_0x46eda4){return _0x46eda4[_0x25c3('0x27')]()[_0x25c3('0x26')](function(){var _0x16ffec=_0x46eda4[_0x25c3('0x28')]({'plain':!![]});var _0x4b3daf=_0x25c3('0x29');return db[_0x25c3('0x2a')]['destroy']({'where':{'type':_0x4b3daf,'resourceId':_0x16ffec['id']}})[_0x25c3('0x26')](function(){return _0x46eda4;});})[_0x25c3('0x26')](function(){_0x57e12c[_0x25c3('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf16b6e,_0x5e8243){return function(_0x48376a){if(!_0x48376a){_0xf16b6e['sendStatus'](0x194);}return _0x48376a;};}function handleError(_0x1d1790,_0x14d10a){_0x14d10a=_0x14d10a||0x1f4;return function(_0x1f7ba4){logger[_0x25c3('0x2b')](_0x1f7ba4[_0x25c3('0x2c')]);if(_0x1f7ba4[_0x25c3('0x2d')]){delete _0x1f7ba4[_0x25c3('0x2d')];}_0x1d1790[_0x25c3('0x1c')](_0x14d10a)['send'](_0x1f7ba4);};}exports[_0x25c3('0x2e')]=function(_0x2ea483,_0x494e55){var _0x12a23f={},_0xa24010={},_0x45f6d6={'count':0x0,'rows':[]};var _0x16e98c=_[_0x25c3('0x2f')](db[_0x25c3('0x30')][_0x25c3('0x31')],function(_0x1014da){return{'name':_0x1014da[_0x25c3('0x32')],'type':_0x1014da[_0x25c3('0x33')]['key']};});_0xa24010[_0x25c3('0x34')]=_[_0x25c3('0x2f')](_0x16e98c,_0x25c3('0x2d'));_0xa24010[_0x25c3('0x35')]=_[_0x25c3('0x36')](_0x2ea483[_0x25c3('0x35')]);_0xa24010[_0x25c3('0x37')]=_[_0x25c3('0x38')](_0xa24010[_0x25c3('0x34')],_0xa24010[_0x25c3('0x35')]);_0x12a23f[_0x25c3('0x39')]=_['intersection'](_0xa24010[_0x25c3('0x34')],qs[_0x25c3('0x3a')](_0x2ea483['query'][_0x25c3('0x3a')]));_0x12a23f[_0x25c3('0x39')]=_0x12a23f['attributes'][_0x25c3('0x3b')]?_0x12a23f['attributes']:_0xa24010[_0x25c3('0x34')];if(!_0x2ea483['query']['hasOwnProperty']('nolimit')){_0x12a23f['limit']=qs[_0x25c3('0x20')](_0x2ea483[_0x25c3('0x35')][_0x25c3('0x20')]);_0x12a23f[_0x25c3('0x1e')]=qs[_0x25c3('0x1e')](_0x2ea483[_0x25c3('0x35')]['offset']);}_0x12a23f['order']=qs[_0x25c3('0x3c')](_0x2ea483[_0x25c3('0x35')]['sort']);_0x12a23f[_0x25c3('0x3d')]=qs['filters'](_[_0x25c3('0x3e')](_0x2ea483[_0x25c3('0x35')],_0xa24010['filters']),_0x16e98c);if(_0x2ea483[_0x25c3('0x35')][_0x25c3('0x3f')]){_0x12a23f[_0x25c3('0x3d')]=_['merge'](_0x12a23f[_0x25c3('0x3d')],{'$or':_['map'](_0x16e98c,function(_0x8d2a3b){if(_0x8d2a3b[_0x25c3('0x33')]!=='VIRTUAL'){var _0x465297={};_0x465297[_0x8d2a3b[_0x25c3('0x2d')]]={'$like':'%'+_0x2ea483[_0x25c3('0x35')][_0x25c3('0x3f')]+'%'};return _0x465297;}})});}_0x12a23f=_[_0x25c3('0x40')]({},_0x12a23f,_0x2ea483[_0x25c3('0x41')]);var _0x6ff910={'where':_0x12a23f[_0x25c3('0x3d')]};return db[_0x25c3('0x30')][_0x25c3('0x21')](_0x6ff910)['then'](function(_0x1e1e66){_0x45f6d6[_0x25c3('0x21')]=_0x1e1e66;if(_0x2ea483['query'][_0x25c3('0x42')]){_0x12a23f['include']=[{'all':!![]}];}return db[_0x25c3('0x30')]['findAll'](_0x12a23f);})['then'](function(_0x37b026){_0x45f6d6[_0x25c3('0x43')]=_0x37b026;return _0x45f6d6;})[_0x25c3('0x26')](respondWithFilteredResult(_0x494e55,_0x12a23f))[_0x25c3('0x44')](handleError(_0x494e55,null));};exports[_0x25c3('0x45')]=function(_0x2cecad,_0x1c25b0){var _0x63e7f3={'raw':!![],'where':{'id':_0x2cecad[_0x25c3('0x46')]['id']}},_0x5bb909={};_0x5bb909[_0x25c3('0x34')]=_[_0x25c3('0x36')](db['Sound'][_0x25c3('0x31')]);_0x5bb909[_0x25c3('0x35')]=_['keys'](_0x2cecad[_0x25c3('0x35')]);_0x5bb909[_0x25c3('0x37')]=_[_0x25c3('0x38')](_0x5bb909[_0x25c3('0x34')],_0x5bb909[_0x25c3('0x35')]);_0x63e7f3['attributes']=_[_0x25c3('0x38')](_0x5bb909[_0x25c3('0x34')],qs[_0x25c3('0x3a')](_0x2cecad[_0x25c3('0x35')][_0x25c3('0x3a')]));_0x63e7f3[_0x25c3('0x39')]=_0x63e7f3['attributes'][_0x25c3('0x3b')]?_0x63e7f3[_0x25c3('0x39')]:_0x5bb909[_0x25c3('0x34')];if(_0x2cecad['query'][_0x25c3('0x42')]){_0x63e7f3[_0x25c3('0x47')]=[{'all':!![]}];}_0x63e7f3=_[_0x25c3('0x40')]({},_0x63e7f3,_0x2cecad[_0x25c3('0x41')]);return db[_0x25c3('0x30')]['find'](_0x63e7f3)[_0x25c3('0x26')](handleEntityNotFound(_0x1c25b0,null))['then'](respondWithResult(_0x1c25b0,null))['catch'](handleError(_0x1c25b0,null));};exports['download']=function(_0x2500c3,_0x183fda,_0x271214){return db['Sound'][_0x25c3('0x48')]({'where':{'id':_0x2500c3[_0x25c3('0x46')]['id']},'attributes':[_0x25c3('0x2d'),'save_name',_0x25c3('0x49')],'raw':!![]})['then'](handleEntityNotFound(_0x183fda,null))[_0x25c3('0x26')](function(_0x235f10){if(_0x235f10){if(!fs[_0x25c3('0x4a')](path['join'](config[_0x25c3('0x4b')],_0x25c3('0x4c'),_0x235f10['save_name']+'.'+_0x235f10[_0x25c3('0x49')]))){throw new db[(_0x25c3('0x4d'))][(_0x25c3('0x4e'))](_0x25c3('0x4f'));}return _0x183fda['download'](path['join'](config[_0x25c3('0x4b')],_0x25c3('0x4c'),util[_0x25c3('0x50')](_0x25c3('0x51'),_0x235f10[_0x25c3('0x52')],_0x235f10[_0x25c3('0x49')])),util[_0x25c3('0x50')](_0x25c3('0x51'),_0x235f10[_0x25c3('0x2d')],_0x235f10[_0x25c3('0x49')]));}return null;})['catch'](handleError(_0x183fda,null));};exports[_0x25c3('0x53')]=function(_0x3b9627,_0x5afcaf,_0x3fc4d0){var _0x512814={'name':path['basename'](_0x3b9627[_0x25c3('0x54')][_0x25c3('0x55')],path[_0x25c3('0x56')](_0x3b9627[_0x25c3('0x54')]['originalname'])),'save_name':path['basename'](_0x3b9627['file'][_0x25c3('0x57')],path[_0x25c3('0x56')](_0x3b9627[_0x25c3('0x54')][_0x25c3('0x57')])),'original_format':path['extname'](_0x3b9627['file'][_0x25c3('0x55')])['substring'](0x1),'converted_format':_0x25c3('0x58')};var _0x222530=path[_0x25c3('0x59')](config['root'],_0x25c3('0x5a'),_0x3b9627['file']['filename']);var _0x5ce189=path[_0x25c3('0x59')](config[_0x25c3('0x4b')],'server/files/sounds/converted',util['format'](_0x25c3('0x51'),path[_0x25c3('0x5b')](_0x3b9627[_0x25c3('0x54')]['filename'],path[_0x25c3('0x56')](_0x3b9627[_0x25c3('0x54')][_0x25c3('0x57')])),_0x512814['converted_format']));logger[_0x25c3('0x5c')]('Sound\x20upload\x20filepath:\x20%s',_0x222530);logger['info'](_0x25c3('0x5d'),_0x5ce189);try{fs[_0x25c3('0x5e')](_0x222530,parseInt(_0x25c3('0x5f'),0x8));var _0x56b368=sox[_0x25c3('0x60')](_0x222530,_0x5ce189,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x56b368['on'](_0x25c3('0x2b'),function(_0x582c74){fs[_0x25c3('0x61')](_0x222530);_0x5afcaf['status'](0x1f4)[_0x25c3('0x62')](_0x582c74);});_0x56b368['on']('src',function(_0xa6f3e1){_0x512814[_0x25c3('0x63')]=isNaN(_0xa6f3e1[_0x25c3('0x64')])?null:_0xa6f3e1[_0x25c3('0x64')]*0x3e8;_0x512814[_0x25c3('0x65')]=isNaN(_0xa6f3e1[_0x25c3('0x66')])?null:_0xa6f3e1[_0x25c3('0x66')];_0x512814[_0x25c3('0x67')]=isNaN(_0xa6f3e1['channelCount'])?null:_0xa6f3e1[_0x25c3('0x68')];_0x512814['original_bitRate']=isNaN(_0xa6f3e1[_0x25c3('0x69')])?null:_0xa6f3e1['bitRate'];_0x512814[_0x25c3('0x6a')]=isNaN(_0xa6f3e1['sampleRate'])?null:_0xa6f3e1[_0x25c3('0x6b')];});_0x56b368['on'](_0x25c3('0x6c'),function(_0x1066a3){_0x512814[_0x25c3('0x6d')]=isNaN(_0x1066a3[_0x25c3('0x64')])?null:_0x1066a3['duration']*0x3e8;_0x512814[_0x25c3('0x6e')]=isNaN(_0x1066a3[_0x25c3('0x66')])?null:_0x1066a3['sampleCount'];_0x512814[_0x25c3('0x6f')]=isNaN(_0x1066a3[_0x25c3('0x68')])?null:_0x1066a3['channelCount'];_0x512814[_0x25c3('0x70')]=isNaN(_0x1066a3['bitRate'])?null:_0x1066a3['bitRate'];_0x512814[_0x25c3('0x71')]=isNaN(_0x1066a3['sampleRate'])?null:_0x1066a3['sampleRate'];});_0x56b368['on']('end',function(){fs['chmodSync'](_0x5ce189,parseInt(_0x25c3('0x5f'),0x8));return db[_0x25c3('0x30')][_0x25c3('0x53')](_0x512814)[_0x25c3('0x26')](function(_0x2f9a75){var _0x3bbdf9={'role':_0x3b9627[_0x25c3('0x72')]['role'],'userProfileId':_0x3b9627[_0x25c3('0x72')]['userProfileId']};if(!_0x3bbdf9)throw new Error(_0x25c3('0x73'));if(_0x3bbdf9[_0x25c3('0x74')]===_0x25c3('0x75')){var _0x3d3bd8=_0x2f9a75[_0x25c3('0x28')]({'plain':!![]});return db[_0x25c3('0x76')]['find']({'where':{'name':_0x25c3('0x29'),'userProfileId':_0x3bbdf9[_0x25c3('0x77')]},'raw':!![]})[_0x25c3('0x26')](function(_0x13ef9b){if(_0x13ef9b&&_0x13ef9b[_0x25c3('0x78')]===0x0){return db[_0x25c3('0x2a')][_0x25c3('0x53')]({'name':_0x3d3bd8[_0x25c3('0x2d')],'resourceId':_0x3d3bd8['id'],'type':_0x13ef9b['name'],'sectionId':_0x13ef9b['id']},{})['then'](function(){return _0x2f9a75;});}else{return _0x2f9a75;}})['catch'](function(_0x1fbffb){logger['error'](_0x25c3('0x79'),_0x1fbffb);throw _0x1fbffb;});}return _0x2f9a75;})[_0x25c3('0x26')](respondWithResult(_0x5afcaf,null))[_0x25c3('0x44')](handleError(_0x5afcaf,null));});_0x56b368['start']();}catch(_0x11f365){_0x5afcaf[_0x25c3('0x1c')](0x1f4)[_0x25c3('0x62')](_0x11f365);}};exports[_0x25c3('0x25')]=function(_0xeaada3,_0x1673f0,_0x5c97f4){return db[_0x25c3('0x30')][_0x25c3('0x48')]({'where':{'id':_0xeaada3['params']['id']}})[_0x25c3('0x26')](handleEntityNotFound(_0x1673f0,null))[_0x25c3('0x26')](saveUpdates(_[_0x25c3('0x3e')](_0xeaada3[_0x25c3('0x72')],[_0x25c3('0x2d'),'description']),null))[_0x25c3('0x26')](respondWithResult(_0x1673f0,null))[_0x25c3('0x44')](handleError(_0x1673f0,null));};exports['delete']=function(_0x500c1d,_0x3849a4,_0xb79d08){return db[_0x25c3('0x30')]['find']({'where':{'id':_0x500c1d[_0x25c3('0x46')]['id']}})[_0x25c3('0x26')](function(_0x48169a){if(_0x48169a){return _0x48169a[_0x25c3('0x27')]();}})[_0x25c3('0x26')](function(_0xa2f532){var _0x25e082=path['join'](config['root'],_0x25c3('0x5a'),util[_0x25c3('0x50')](_0x25c3('0x51'),_0xa2f532['save_name'],_0xa2f532[_0x25c3('0x7a')]));var _0xa2efca=path['join'](config[_0x25c3('0x4b')],_0x25c3('0x4c'),util[_0x25c3('0x50')](_0x25c3('0x51'),_0xa2f532['save_name'],_0xa2f532[_0x25c3('0x49')]));fs[_0x25c3('0x61')](_0x25e082);fs['unlinkSync'](_0xa2efca);return _0xa2f532;})[_0x25c3('0x26')](function(_0x1756cb){if(_0x1756cb){return _0x3849a4[_0x25c3('0x1c')](0xcc)[_0x25c3('0x1b')]();}})['then'](handleEntityNotFound(_0x3849a4,null))[_0x25c3('0x44')](handleError(_0x3849a4,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 7e68b7d..817485c 100644 --- a/server/api/sound/sound.model.js +++ b/server/api/sound/sound.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5449=['api','bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','define','Sound','tools_sounds','lodash','../../config/logger'];(function(_0x33ebd4,_0x294358){var _0xad487a=function(_0x2ba19f){while(--_0x2ba19f){_0x33ebd4['push'](_0x33ebd4['shift']());}};_0xad487a(++_0x294358);}(_0x5449,0x8e));var _0x9544=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x5449[_0x580576];return _0x3f55a0;};'use strict';var _=require(_0x9544('0x0'));var util=require('util');var logger=require(_0x9544('0x1'))(_0x9544('0x2'));var moment=require('moment');var BPromise=require(_0x9544('0x3'));var rp=require(_0x9544('0x4'));var fs=require('fs');var path=require(_0x9544('0x5'));var rimraf=require(_0x9544('0x6'));var config=require(_0x9544('0x7'));var attributes=require(_0x9544('0x8'));module['exports']=function(_0x4acc39,_0x292b35){return _0x4acc39[_0x9544('0x9')](_0x9544('0xa'),attributes,{'tableName':_0x9544('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x782d=['path','rimraf','../../config/environment','./sound.attributes','Sound','tools_sounds','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x782d,0xc6));var _0xd782=function(_0x193c17,_0x31715e){_0x193c17=_0x193c17-0x0;var _0xb8fdf3=_0x782d[_0x193c17];return _0xb8fdf3;};'use strict';var _=require(_0xd782('0x0'));var util=require(_0xd782('0x1'));var logger=require(_0xd782('0x2'))('api');var moment=require(_0xd782('0x3'));var BPromise=require(_0xd782('0x4'));var rp=require(_0xd782('0x5'));var fs=require('fs');var path=require(_0xd782('0x6'));var rimraf=require(_0xd782('0x7'));var config=require(_0xd782('0x8'));var attributes=require(_0xd782('0x9'));module['exports']=function(_0x2d5e97,_0x3c0bd2){return _0x2d5e97['define'](_0xd782('0xa'),attributes,{'tableName':_0xd782('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index d8f47d0..c7f32e1 100644 --- a/server/api/sound/sound.rpc.js +++ b/server/api/sound/sound.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0a39=['map','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Sound,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','ShowSound','Sound','find','options','raw','where','attributes','include','model'];(function(_0x1c1682,_0x37c715){var _0x1010b5=function(_0x1dc476){while(--_0x1dc476){_0x1c1682['push'](_0x1c1682['shift']());}};_0x1010b5(++_0x37c715);}(_0x0a39,0xe8));var _0x90a3=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x0a39[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require(_0x90a3('0x0'));var moment=require(_0x90a3('0x1'));var BPromise=require('bluebird');var rs=require(_0x90a3('0x2'));var fs=require('fs');var Redis=require(_0x90a3('0x3'));var db=require(_0x90a3('0x4'))['db'];var utils=require(_0x90a3('0x5'));var logger=require(_0x90a3('0x6'))('rpc');var config=require(_0x90a3('0x7'));var jayson=require(_0x90a3('0x8'));var client=jayson[_0x90a3('0x9')][_0x90a3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x94f007,_0x2141b9,_0x3992af){return new BPromise(function(_0x1e2510,_0x4a1dae){return client[_0x90a3('0xb')](_0x94f007,_0x3992af)[_0x90a3('0xc')](function(_0x4ca205){logger[_0x90a3('0xd')](_0x90a3('0xe'),_0x2141b9,'request\x20sent');logger[_0x90a3('0xf')]('Sound,\x20%s,\x20%s,\x20%s',_0x2141b9,_0x90a3('0x10'),JSON[_0x90a3('0x11')](_0x4ca205));if(_0x4ca205[_0x90a3('0x12')]){if(_0x4ca205[_0x90a3('0x12')][_0x90a3('0x13')]===0x1f4){logger[_0x90a3('0x12')](_0x90a3('0xe'),_0x2141b9,_0x4ca205[_0x90a3('0x12')][_0x90a3('0x14')]);return _0x4a1dae(_0x4ca205[_0x90a3('0x12')][_0x90a3('0x14')]);}logger[_0x90a3('0x12')](_0x90a3('0xe'),_0x2141b9,_0x4ca205['error'][_0x90a3('0x14')]);return _0x1e2510(_0x4ca205['error'][_0x90a3('0x14')]);}else{logger[_0x90a3('0xd')](_0x90a3('0xe'),_0x2141b9,'request\x20sent');_0x1e2510(_0x4ca205[_0x90a3('0x15')][_0x90a3('0x14')]);}})[_0x90a3('0x16')](function(_0x2a7ee7){logger[_0x90a3('0x12')](_0x90a3('0xe'),_0x2141b9,_0x2a7ee7);_0x4a1dae(_0x2a7ee7);});});}exports[_0x90a3('0x17')]=function(_0x224785){var _0x3544f2=this;return new Promise(function(_0x4473df,_0xda239c){return db[_0x90a3('0x18')][_0x90a3('0x19')]({'raw':_0x224785[_0x90a3('0x1a')]?_0x224785[_0x90a3('0x1a')][_0x90a3('0x1b')]===undefined?!![]:![]:!![],'where':_0x224785[_0x90a3('0x1a')]?_0x224785['options'][_0x90a3('0x1c')]||null:null,'attributes':_0x224785[_0x90a3('0x1a')]?_0x224785[_0x90a3('0x1a')][_0x90a3('0x1d')]||null:null,'include':_0x224785[_0x90a3('0x1a')]?_0x224785[_0x90a3('0x1a')][_0x90a3('0x1e')]?_['map'](_0x224785[_0x90a3('0x1a')][_0x90a3('0x1e')],function(_0x1fb9d3){return{'model':db[_0x1fb9d3[_0x90a3('0x1f')]],'as':_0x1fb9d3['as'],'attributes':_0x1fb9d3[_0x90a3('0x1d')],'include':_0x1fb9d3[_0x90a3('0x1e')]?_['map'](_0x1fb9d3[_0x90a3('0x1e')],function(_0x57e36c){return{'model':db[_0x57e36c[_0x90a3('0x1f')]],'as':_0x57e36c['as'],'attributes':_0x57e36c[_0x90a3('0x1d')],'include':_0x57e36c[_0x90a3('0x1e')]?_[_0x90a3('0x20')](_0x57e36c[_0x90a3('0x1e')],function(_0x161c91){return{'model':db[_0x161c91['model']],'as':_0x161c91['as'],'attributes':_0x161c91['attributes']};}):[]};}):[]};}):[]:[]})[_0x90a3('0xc')](function(_0x1ca74d){logger[_0x90a3('0xd')](_0x90a3('0x17'),_0x224785);logger[_0x90a3('0xf')]('ShowSound',_0x224785,JSON['stringify'](_0x1ca74d));_0x4473df(_0x1ca74d);})[_0x90a3('0x16')](function(_0x4a948c){logger['error'](_0x90a3('0x17'),_0x4a948c[_0x90a3('0x14')],_0x224785);_0xda239c(_0x3544f2[_0x90a3('0x12')](0x1f4,_0x4a948c[_0x90a3('0x14')]));});});}; \ No newline at end of file +var _0x20b1=['result','catch','ShowSound','find','options','raw','where','attributes','include','map','model','debug','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','http','request','then','Sound,\x20%s,\x20%s','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','error','message','info'];(function(_0x355e2b,_0x1e99eb){var _0x2b59bb=function(_0x14f698){while(--_0x14f698){_0x355e2b['push'](_0x355e2b['shift']());}};_0x2b59bb(++_0x1e99eb);}(_0x20b1,0x1dd));var _0x120b=function(_0x508a9d,_0x23b515){_0x508a9d=_0x508a9d-0x0;var _0x22449d=_0x20b1[_0x508a9d];return _0x22449d;};'use strict';var _=require(_0x120b('0x0'));var util=require('util');var moment=require(_0x120b('0x1'));var BPromise=require(_0x120b('0x2'));var rs=require(_0x120b('0x3'));var fs=require('fs');var Redis=require(_0x120b('0x4'));var db=require(_0x120b('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x120b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x120b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x478d22,_0x4bd8a,_0x31e5f0){return new BPromise(function(_0x5900af,_0x282943){return client[_0x120b('0x8')](_0x478d22,_0x31e5f0)[_0x120b('0x9')](function(_0x9097e6){logger['info'](_0x120b('0xa'),_0x4bd8a,_0x120b('0xb'));logger['debug'](_0x120b('0xc'),_0x4bd8a,'request\x20sent',JSON['stringify'](_0x9097e6));if(_0x9097e6[_0x120b('0xd')]){if(_0x9097e6[_0x120b('0xd')]['code']===0x1f4){logger[_0x120b('0xd')](_0x120b('0xa'),_0x4bd8a,_0x9097e6[_0x120b('0xd')]['message']);return _0x282943(_0x9097e6[_0x120b('0xd')][_0x120b('0xe')]);}logger[_0x120b('0xd')](_0x120b('0xa'),_0x4bd8a,_0x9097e6[_0x120b('0xd')]['message']);return _0x5900af(_0x9097e6['error'][_0x120b('0xe')]);}else{logger[_0x120b('0xf')](_0x120b('0xa'),_0x4bd8a,_0x120b('0xb'));_0x5900af(_0x9097e6[_0x120b('0x10')]['message']);}})[_0x120b('0x11')](function(_0x202b9d){logger['error'](_0x120b('0xa'),_0x4bd8a,_0x202b9d);_0x282943(_0x202b9d);});});}exports[_0x120b('0x12')]=function(_0x572362){var _0x43c8de=this;return new Promise(function(_0x34c1ce,_0x4eb5eb){return db['Sound'][_0x120b('0x13')]({'raw':_0x572362['options']?_0x572362[_0x120b('0x14')][_0x120b('0x15')]===undefined?!![]:![]:!![],'where':_0x572362[_0x120b('0x14')]?_0x572362['options'][_0x120b('0x16')]||null:null,'attributes':_0x572362[_0x120b('0x14')]?_0x572362['options'][_0x120b('0x17')]||null:null,'include':_0x572362['options']?_0x572362[_0x120b('0x14')][_0x120b('0x18')]?_[_0x120b('0x19')](_0x572362[_0x120b('0x14')][_0x120b('0x18')],function(_0x17951a){return{'model':db[_0x17951a['model']],'as':_0x17951a['as'],'attributes':_0x17951a[_0x120b('0x17')],'include':_0x17951a[_0x120b('0x18')]?_[_0x120b('0x19')](_0x17951a['include'],function(_0x402f3b){return{'model':db[_0x402f3b[_0x120b('0x1a')]],'as':_0x402f3b['as'],'attributes':_0x402f3b[_0x120b('0x17')],'include':_0x402f3b[_0x120b('0x18')]?_['map'](_0x402f3b['include'],function(_0x195113){return{'model':db[_0x195113[_0x120b('0x1a')]],'as':_0x195113['as'],'attributes':_0x195113[_0x120b('0x17')]};}):[]};}):[]};}):[]:[]})[_0x120b('0x9')](function(_0x1a1388){logger[_0x120b('0xf')](_0x120b('0x12'),_0x572362);logger[_0x120b('0x1b')](_0x120b('0x12'),_0x572362,JSON[_0x120b('0x1c')](_0x1a1388));_0x34c1ce(_0x1a1388);})['catch'](function(_0x517d55){logger[_0x120b('0xd')]('ShowSound',_0x517d55['message'],_0x572362);_0x4eb5eb(_0x43c8de['error'](0x1f4,_0x517d55['message']));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 6b8cc69..f78dccf 100644 --- a/server/api/squareMessage/index.js +++ b/server/api/squareMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','index','get','/:id','show','post','isAuthenticated','create','put','delete','destroy'];(function(_0x44b034,_0xe3f980){var _0x5216cc=function(_0x10af31){while(--_0x10af31){_0x44b034['push'](_0x44b034['shift']());}};_0x5216cc(++_0xe3f980);}(_0xb7e7,0x121));var _0x7b7e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xb7e7[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var fs_extra=require(_0x7b7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var controller=require(_0x7b7e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b7e('0x7')]);router[_0x7b7e('0x8')](_0x7b7e('0x9'),auth['isAuthenticated'](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0xb')]('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller['update']);router[_0x7b7e('0xf')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x10')]);module[_0x7b7e('0x11')]=router; \ No newline at end of file +var _0xb10b=['./squareMessage.controller','get','index','isAuthenticated','show','post','create','put','/:id','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x28133f,_0x7a259a){var _0x38c581=function(_0x4ebf2e){while(--_0x4ebf2e){_0x28133f['push'](_0x28133f['shift']());}};_0x38c581(++_0x7a259a);}(_0xb10b,0x12a));var _0xbb10=function(_0x26cf90,_0x50702d){_0x26cf90=_0x26cf90-0x0;var _0x3e13f6=_0xb10b[_0x26cf90];return _0x3e13f6;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0xd')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['update']);router['delete'](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index e1de4c7..5d120a6 100644 --- a/server/api/squareMessage/squareMessage.attributes.js +++ b/server/api/squareMessage/squareMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd1c2=['TEXT','medium','ENUM','out','sequelize','exports','STRING'];(function(_0x26a506,_0x335198){var _0xbddb9b=function(_0x1cc8a5){while(--_0x1cc8a5){_0x26a506['push'](_0x26a506['shift']());}};_0xbddb9b(++_0x335198);}(_0xd1c2,0x169));var _0x2d1c=function(_0x3cca04,_0x52efed){_0x3cca04=_0x3cca04-0x0;var _0x10e0e5=_0xd1c2[_0x3cca04];return _0x10e0e5;};'use strict';var Sequelize=require(_0x2d1c('0x0'));module[_0x2d1c('0x1')]={'uniqueid':{'type':Sequelize[_0x2d1c('0x2')]},'body':{'type':Sequelize[_0x2d1c('0x3')](_0x2d1c('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0x2d1c('0x5')]('in','out'),'defaultValue':_0x2d1c('0x6'),'allowNull':![]},'providerName':{'type':Sequelize[_0x2d1c('0x2')]},'providerResponse':{'type':Sequelize[_0x2d1c('0x3')]}}; \ No newline at end of file +var _0xc3a3=['out','sequelize','TEXT','ENUM'];(function(_0x13753e,_0x2428d9){var _0x45bdba=function(_0x398acf){while(--_0x398acf){_0x13753e['push'](_0x13753e['shift']());}};_0x45bdba(++_0x2428d9);}(_0xc3a3,0x65));var _0x3c3a=function(_0x31b0e6,_0x18522a){_0x31b0e6=_0x31b0e6-0x0;var _0x3f5389=_0xc3a3[_0x31b0e6];return _0x3f5389;};'use strict';var Sequelize=require(_0x3c3a('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x3c3a('0x1')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x3c3a('0x2')]('in',_0x3c3a('0x3')),'defaultValue':_0x3c3a('0x3'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x3c3a('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index c4e94f1..6c00d61 100644 --- a/server/api/squareMessage/squareMessage.controller.js +++ b/server/api/squareMessage/squareMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9918=['rawAttributes','fieldName','type','key','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','keys','includeAll','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','end','status','json','offset','undefined','limit','count','set','save','update','then','destroy','sendStatus','error','name','index','map','SquareMessage'];(function(_0x3da888,_0x7a9b4c){var _0x8e5abf=function(_0x353434){while(--_0x353434){_0x3da888['push'](_0x3da888['shift']());}};_0x8e5abf(++_0x7a9b4c);}(_0x9918,0x186));var _0x8991=function(_0x32cefe,_0x1befba){_0x32cefe=_0x32cefe-0x0;var _0x283e79=_0x9918[_0x32cefe];return _0x283e79;};'use strict';var emlformat=require(_0x8991('0x0'));var rimraf=require(_0x8991('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8991('0x2'));var rp=require(_0x8991('0x3'));var moment=require(_0x8991('0x4'));var BPromise=require(_0x8991('0x5'));var Mustache=require(_0x8991('0x6'));var util=require(_0x8991('0x7'));var path=require(_0x8991('0x8'));var sox=require(_0x8991('0x9'));var csv=require(_0x8991('0xa'));var ejs=require(_0x8991('0xb'));var fs=require('fs');var fs_extra=require(_0x8991('0xc'));var _=require(_0x8991('0xd'));var squel=require(_0x8991('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8991('0xa'));var querystring=require(_0x8991('0xf'));var Papa=require('papaparse');var Redis=require(_0x8991('0x10'));var authService=require(_0x8991('0x11'));var qs=require(_0x8991('0x12'));var as=require(_0x8991('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8991('0x14'))(_0x8991('0x15'));var utils=require('../../config/utils');var config=require(_0x8991('0x16'));var licenseUtil=require(_0x8991('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54ac95,_0xfbee87){_0xfbee87=_0xfbee87||0xcc;return function(_0xadf5a2){if(_0xadf5a2){return _0x54ac95['sendStatus'](_0xfbee87);}return _0x54ac95['status'](_0xfbee87)[_0x8991('0x18')]();};}function respondWithResult(_0x465fc4,_0x183767){_0x183767=_0x183767||0xc8;return function(_0x3711e9){if(_0x3711e9){return _0x465fc4[_0x8991('0x19')](_0x183767)[_0x8991('0x1a')](_0x3711e9);}};}function respondWithFilteredResult(_0x57cdec,_0x4770b8){return function(_0x26d039){if(_0x26d039){var _0x75a1e4=typeof _0x4770b8[_0x8991('0x1b')]===_0x8991('0x1c')&&typeof _0x4770b8[_0x8991('0x1d')]==='undefined';var _0x5e9558=_0x26d039[_0x8991('0x1e')];var _0x500ede=_0x75a1e4?0x0:_0x4770b8[_0x8991('0x1b')];var _0x3137f9=_0x75a1e4?_0x26d039[_0x8991('0x1e')]:_0x4770b8[_0x8991('0x1b')]+_0x4770b8[_0x8991('0x1d')];var _0x206d4c;if(_0x3137f9>=_0x5e9558){_0x3137f9=_0x5e9558;_0x206d4c=0xc8;}else{_0x206d4c=0xce;}_0x57cdec[_0x8991('0x19')](_0x206d4c);return _0x57cdec[_0x8991('0x1f')]('Content-Range',_0x500ede+'-'+_0x3137f9+'/'+_0x5e9558)[_0x8991('0x1a')](_0x26d039);}return null;};}function patchUpdates(_0x3cfd7d){return function(_0xbcc0e0){try{jsonpatch['apply'](_0xbcc0e0,_0x3cfd7d,!![]);}catch(_0x475834){return BPromise['reject'](_0x475834);}return _0xbcc0e0[_0x8991('0x20')]();};}function saveUpdates(_0x5113fd,_0x1ab7f6){return function(_0x3aecbb){if(_0x3aecbb){return _0x3aecbb[_0x8991('0x21')](_0x5113fd)[_0x8991('0x22')](function(_0x53802f){return _0x53802f;});}return null;};}function removeEntity(_0x5d52a0,_0x39490d){return function(_0xbfec5f){if(_0xbfec5f){return _0xbfec5f[_0x8991('0x23')]()['then'](function(){_0x5d52a0['status'](0xcc)[_0x8991('0x18')]();});}};}function handleEntityNotFound(_0x38f6ca,_0x93931e){return function(_0x1d86af){if(!_0x1d86af){_0x38f6ca[_0x8991('0x24')](0x194);}return _0x1d86af;};}function handleError(_0x5086d7,_0x5e148c){_0x5e148c=_0x5e148c||0x1f4;return function(_0x4263c6){logger[_0x8991('0x25')](_0x4263c6['stack']);if(_0x4263c6[_0x8991('0x26')]){delete _0x4263c6[_0x8991('0x26')];}_0x5086d7[_0x8991('0x19')](_0x5e148c)['send'](_0x4263c6);};}exports[_0x8991('0x27')]=function(_0x42ed44,_0x21e8f2){var _0x582ab7={},_0x1aade7={},_0xeefa8f={'count':0x0,'rows':[]};var _0x14f4f9=_[_0x8991('0x28')](db[_0x8991('0x29')][_0x8991('0x2a')],function(_0x4a18fd){return{'name':_0x4a18fd[_0x8991('0x2b')],'type':_0x4a18fd[_0x8991('0x2c')][_0x8991('0x2d')]};});_0x1aade7['model']=_[_0x8991('0x28')](_0x14f4f9,'name');_0x1aade7[_0x8991('0x2e')]=_['keys'](_0x42ed44[_0x8991('0x2e')]);_0x1aade7[_0x8991('0x2f')]=_['intersection'](_0x1aade7[_0x8991('0x30')],_0x1aade7[_0x8991('0x2e')]);_0x582ab7[_0x8991('0x31')]=_[_0x8991('0x32')](_0x1aade7['model'],qs[_0x8991('0x33')](_0x42ed44[_0x8991('0x2e')][_0x8991('0x33')]));_0x582ab7[_0x8991('0x31')]=_0x582ab7['attributes'][_0x8991('0x34')]?_0x582ab7[_0x8991('0x31')]:_0x1aade7[_0x8991('0x30')];if(!_0x42ed44[_0x8991('0x2e')][_0x8991('0x35')](_0x8991('0x36'))){_0x582ab7['limit']=qs[_0x8991('0x1d')](_0x42ed44[_0x8991('0x2e')][_0x8991('0x1d')]);_0x582ab7[_0x8991('0x1b')]=qs[_0x8991('0x1b')](_0x42ed44[_0x8991('0x2e')]['offset']);}_0x582ab7['order']=qs[_0x8991('0x37')](_0x42ed44[_0x8991('0x2e')]['sort']);_0x582ab7[_0x8991('0x38')]=qs[_0x8991('0x2f')](_[_0x8991('0x39')](_0x42ed44[_0x8991('0x2e')],_0x1aade7[_0x8991('0x2f')]),_0x14f4f9);if(_0x42ed44[_0x8991('0x2e')][_0x8991('0x3a')]){_0x582ab7[_0x8991('0x38')]=_[_0x8991('0x3b')](_0x582ab7[_0x8991('0x38')],{'$or':_['map'](_0x14f4f9,function(_0x266ad8){if(_0x266ad8['type']!==_0x8991('0x3c')){var _0x85dea0={};_0x85dea0[_0x266ad8[_0x8991('0x26')]]={'$like':'%'+_0x42ed44[_0x8991('0x2e')]['filter']+'%'};return _0x85dea0;}})});}_0x582ab7=_[_0x8991('0x3b')]({},_0x582ab7,_0x42ed44[_0x8991('0x3d')]);var _0x21c20b={'where':_0x582ab7['where']};return db[_0x8991('0x29')][_0x8991('0x1e')](_0x21c20b)[_0x8991('0x22')](function(_0x351dea){_0xeefa8f[_0x8991('0x1e')]=_0x351dea;if(_0x42ed44[_0x8991('0x2e')]['includeAll']){_0x582ab7[_0x8991('0x3e')]=[{'all':!![]}];}return db[_0x8991('0x29')][_0x8991('0x3f')](_0x582ab7);})[_0x8991('0x22')](function(_0x4139e3){_0xeefa8f[_0x8991('0x40')]=_0x4139e3;return _0xeefa8f;})[_0x8991('0x22')](respondWithFilteredResult(_0x21e8f2,_0x582ab7))[_0x8991('0x41')](handleError(_0x21e8f2,null));};exports['show']=function(_0x145a34,_0x2c5221){var _0x5a84b2={'raw':!![],'where':{'id':_0x145a34[_0x8991('0x42')]['id']}},_0x2653f7={};_0x2653f7['model']=_[_0x8991('0x43')](db[_0x8991('0x29')][_0x8991('0x2a')]);_0x2653f7[_0x8991('0x2e')]=_[_0x8991('0x43')](_0x145a34[_0x8991('0x2e')]);_0x2653f7[_0x8991('0x2f')]=_[_0x8991('0x32')](_0x2653f7[_0x8991('0x30')],_0x2653f7[_0x8991('0x2e')]);_0x5a84b2[_0x8991('0x31')]=_[_0x8991('0x32')](_0x2653f7['model'],qs[_0x8991('0x33')](_0x145a34[_0x8991('0x2e')][_0x8991('0x33')]));_0x5a84b2[_0x8991('0x31')]=_0x5a84b2[_0x8991('0x31')][_0x8991('0x34')]?_0x5a84b2['attributes']:_0x2653f7['model'];if(_0x145a34['query'][_0x8991('0x44')]){_0x5a84b2[_0x8991('0x3e')]=[{'all':!![]}];}_0x5a84b2=_[_0x8991('0x3b')]({},_0x5a84b2,_0x145a34['options']);return db['SquareMessage'][_0x8991('0x45')](_0x5a84b2)[_0x8991('0x22')](handleEntityNotFound(_0x2c5221,null))['then'](respondWithResult(_0x2c5221,null))[_0x8991('0x41')](handleError(_0x2c5221,null));};exports[_0x8991('0x46')]=function(_0x4faa49,_0x5871a9){return db[_0x8991('0x29')][_0x8991('0x46')](_0x4faa49[_0x8991('0x47')],{})[_0x8991('0x22')](respondWithResult(_0x5871a9,0xc9))['catch'](handleError(_0x5871a9,null));};exports['update']=function(_0x3238c2,_0xa5e40){if(_0x3238c2[_0x8991('0x47')]['id']){delete _0x3238c2[_0x8991('0x47')]['id'];}return db[_0x8991('0x29')]['find']({'where':{'id':_0x3238c2['params']['id']}})['then'](handleEntityNotFound(_0xa5e40,null))[_0x8991('0x22')](saveUpdates(_0x3238c2[_0x8991('0x47')],null))[_0x8991('0x22')](respondWithResult(_0xa5e40,null))[_0x8991('0x41')](handleError(_0xa5e40,null));};exports[_0x8991('0x23')]=function(_0x2e5fb3,_0x389290){return db[_0x8991('0x29')]['find']({'where':{'id':_0x2e5fb3[_0x8991('0x42')]['id']}})['then'](handleEntityNotFound(_0x389290,null))['then'](removeEntity(_0x389290,null))[_0x8991('0x41')](handleError(_0x389290,null));}; \ No newline at end of file +var _0x0bb0=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SquareMessage','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','show','find','catch','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x481e30,_0x299a14){var _0x4c4489=function(_0x59a92a){while(--_0x59a92a){_0x481e30['push'](_0x481e30['shift']());}};_0x4c4489(++_0x299a14);}(_0x0bb0,0x11e));var _0x00bb=function(_0x173fc5,_0x47ff3d){_0x173fc5=_0x173fc5-0x0;var _0xbd61e2=_0x0bb0[_0x173fc5];return _0xbd61e2;};'use strict';var emlformat=require(_0x00bb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x00bb('0x1'));var jsonpatch=require(_0x00bb('0x2'));var rp=require(_0x00bb('0x3'));var moment=require(_0x00bb('0x4'));var BPromise=require(_0x00bb('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x00bb('0x6'));var ejs=require(_0x00bb('0x7'));var fs=require('fs');var fs_extra=require(_0x00bb('0x8'));var _=require(_0x00bb('0x9'));var squel=require(_0x00bb('0xa'));var crypto=require(_0x00bb('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x00bb('0xc'));var toCsv=require('to-csv');var querystring=require(_0x00bb('0xd'));var Papa=require(_0x00bb('0xe'));var Redis=require(_0x00bb('0xf'));var authService=require(_0x00bb('0x10'));var qs=require(_0x00bb('0x11'));var as=require(_0x00bb('0x12'));var hardwareService=require(_0x00bb('0x13'));var logger=require(_0x00bb('0x14'))(_0x00bb('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x00bb('0x16'));var db=require(_0x00bb('0x17'))['db'];function respondWithStatusCode(_0x25222,_0x1e8db8){_0x1e8db8=_0x1e8db8||0xcc;return function(_0x58257f){if(_0x58257f){return _0x25222[_0x00bb('0x18')](_0x1e8db8);}return _0x25222[_0x00bb('0x19')](_0x1e8db8)[_0x00bb('0x1a')]();};}function respondWithResult(_0x1b0ec0,_0x1ab826){_0x1ab826=_0x1ab826||0xc8;return function(_0x9966f3){if(_0x9966f3){return _0x1b0ec0[_0x00bb('0x19')](_0x1ab826)[_0x00bb('0x1b')](_0x9966f3);}};}function respondWithFilteredResult(_0x46376a,_0x5d8d9c){return function(_0x1c70f6){if(_0x1c70f6){var _0x50eeec=typeof _0x5d8d9c[_0x00bb('0x1c')]==='undefined'&&typeof _0x5d8d9c[_0x00bb('0x1d')]==='undefined';var _0x3a6f53=_0x1c70f6[_0x00bb('0x1e')];var _0x5d5921=_0x50eeec?0x0:_0x5d8d9c[_0x00bb('0x1c')];var _0x13c31e=_0x50eeec?_0x1c70f6[_0x00bb('0x1e')]:_0x5d8d9c[_0x00bb('0x1c')]+_0x5d8d9c[_0x00bb('0x1d')];var _0x23d1fe;if(_0x13c31e>=_0x3a6f53){_0x13c31e=_0x3a6f53;_0x23d1fe=0xc8;}else{_0x23d1fe=0xce;}_0x46376a[_0x00bb('0x19')](_0x23d1fe);return _0x46376a[_0x00bb('0x1f')](_0x00bb('0x20'),_0x5d5921+'-'+_0x13c31e+'/'+_0x3a6f53)[_0x00bb('0x1b')](_0x1c70f6);}return null;};}function patchUpdates(_0x312449){return function(_0x1eb567){try{jsonpatch[_0x00bb('0x21')](_0x1eb567,_0x312449,!![]);}catch(_0x5cd26f){return BPromise[_0x00bb('0x22')](_0x5cd26f);}return _0x1eb567[_0x00bb('0x23')]();};}function saveUpdates(_0x45bc21,_0x23c44d){return function(_0x386d82){if(_0x386d82){return _0x386d82[_0x00bb('0x24')](_0x45bc21)[_0x00bb('0x25')](function(_0x2c3c30){return _0x2c3c30;});}return null;};}function removeEntity(_0x279d01,_0x2b1070){return function(_0x1a1fff){if(_0x1a1fff){return _0x1a1fff[_0x00bb('0x26')]()[_0x00bb('0x25')](function(){_0x279d01['status'](0xcc)[_0x00bb('0x1a')]();});}};}function handleEntityNotFound(_0x333c78,_0x54c9a){return function(_0x3752f4){if(!_0x3752f4){_0x333c78[_0x00bb('0x18')](0x194);}return _0x3752f4;};}function handleError(_0x388f18,_0x1045d8){_0x1045d8=_0x1045d8||0x1f4;return function(_0x19a8a1){logger[_0x00bb('0x27')](_0x19a8a1[_0x00bb('0x28')]);if(_0x19a8a1['name']){delete _0x19a8a1[_0x00bb('0x29')];}_0x388f18['status'](_0x1045d8)[_0x00bb('0x2a')](_0x19a8a1);};}exports[_0x00bb('0x2b')]=function(_0x1caf4b,_0x357825){var _0x2a0406={},_0x55a398={},_0x438f84={'count':0x0,'rows':[]};var _0xe6e8be=_[_0x00bb('0x2c')](db[_0x00bb('0x2d')][_0x00bb('0x2e')],function(_0x50fb18){return{'name':_0x50fb18['fieldName'],'type':_0x50fb18[_0x00bb('0x2f')][_0x00bb('0x30')]};});_0x55a398[_0x00bb('0x31')]=_[_0x00bb('0x2c')](_0xe6e8be,_0x00bb('0x29'));_0x55a398[_0x00bb('0x32')]=_[_0x00bb('0x33')](_0x1caf4b[_0x00bb('0x32')]);_0x55a398[_0x00bb('0x34')]=_['intersection'](_0x55a398['model'],_0x55a398['query']);_0x2a0406[_0x00bb('0x35')]=_[_0x00bb('0x36')](_0x55a398[_0x00bb('0x31')],qs['fields'](_0x1caf4b[_0x00bb('0x32')][_0x00bb('0x37')]));_0x2a0406[_0x00bb('0x35')]=_0x2a0406[_0x00bb('0x35')][_0x00bb('0x38')]?_0x2a0406['attributes']:_0x55a398[_0x00bb('0x31')];if(!_0x1caf4b[_0x00bb('0x32')][_0x00bb('0x39')]('nolimit')){_0x2a0406['limit']=qs[_0x00bb('0x1d')](_0x1caf4b[_0x00bb('0x32')][_0x00bb('0x1d')]);_0x2a0406['offset']=qs[_0x00bb('0x1c')](_0x1caf4b[_0x00bb('0x32')][_0x00bb('0x1c')]);}_0x2a0406[_0x00bb('0x3a')]=qs['sort'](_0x1caf4b[_0x00bb('0x32')][_0x00bb('0x3b')]);_0x2a0406['where']=qs[_0x00bb('0x34')](_[_0x00bb('0x3c')](_0x1caf4b[_0x00bb('0x32')],_0x55a398['filters']),_0xe6e8be);if(_0x1caf4b[_0x00bb('0x32')][_0x00bb('0x3d')]){_0x2a0406['where']=_[_0x00bb('0x3e')](_0x2a0406[_0x00bb('0x3f')],{'$or':_[_0x00bb('0x2c')](_0xe6e8be,function(_0x4a64ba){if(_0x4a64ba[_0x00bb('0x2f')]!==_0x00bb('0x40')){var _0x2d4973={};_0x2d4973[_0x4a64ba[_0x00bb('0x29')]]={'$like':'%'+_0x1caf4b[_0x00bb('0x32')][_0x00bb('0x3d')]+'%'};return _0x2d4973;}})});}_0x2a0406=_[_0x00bb('0x3e')]({},_0x2a0406,_0x1caf4b[_0x00bb('0x41')]);var _0x4b085c={'where':_0x2a0406[_0x00bb('0x3f')]};return db[_0x00bb('0x2d')][_0x00bb('0x1e')](_0x4b085c)[_0x00bb('0x25')](function(_0x1bc94b){_0x438f84['count']=_0x1bc94b;if(_0x1caf4b[_0x00bb('0x32')][_0x00bb('0x42')]){_0x2a0406[_0x00bb('0x43')]=[{'all':!![]}];}return db['SquareMessage'][_0x00bb('0x44')](_0x2a0406);})[_0x00bb('0x25')](function(_0x4f6611){_0x438f84[_0x00bb('0x45')]=_0x4f6611;return _0x438f84;})['then'](respondWithFilteredResult(_0x357825,_0x2a0406))['catch'](handleError(_0x357825,null));};exports[_0x00bb('0x46')]=function(_0x16f06b,_0x157e44){var _0x2b1386={'raw':!![],'where':{'id':_0x16f06b['params']['id']}},_0x153376={};_0x153376[_0x00bb('0x31')]=_['keys'](db[_0x00bb('0x2d')]['rawAttributes']);_0x153376['query']=_['keys'](_0x16f06b[_0x00bb('0x32')]);_0x153376[_0x00bb('0x34')]=_['intersection'](_0x153376[_0x00bb('0x31')],_0x153376[_0x00bb('0x32')]);_0x2b1386[_0x00bb('0x35')]=_[_0x00bb('0x36')](_0x153376[_0x00bb('0x31')],qs['fields'](_0x16f06b[_0x00bb('0x32')][_0x00bb('0x37')]));_0x2b1386[_0x00bb('0x35')]=_0x2b1386[_0x00bb('0x35')][_0x00bb('0x38')]?_0x2b1386[_0x00bb('0x35')]:_0x153376[_0x00bb('0x31')];if(_0x16f06b['query'][_0x00bb('0x42')]){_0x2b1386[_0x00bb('0x43')]=[{'all':!![]}];}_0x2b1386=_[_0x00bb('0x3e')]({},_0x2b1386,_0x16f06b[_0x00bb('0x41')]);return db[_0x00bb('0x2d')][_0x00bb('0x47')](_0x2b1386)[_0x00bb('0x25')](handleEntityNotFound(_0x157e44,null))[_0x00bb('0x25')](respondWithResult(_0x157e44,null))[_0x00bb('0x48')](handleError(_0x157e44,null));};exports[_0x00bb('0x49')]=function(_0x3d4802,_0x30e5b2){return db[_0x00bb('0x2d')][_0x00bb('0x49')](_0x3d4802[_0x00bb('0x4a')],{})[_0x00bb('0x25')](respondWithResult(_0x30e5b2,0xc9))[_0x00bb('0x48')](handleError(_0x30e5b2,null));};exports[_0x00bb('0x24')]=function(_0x5f21ce,_0x128015){if(_0x5f21ce[_0x00bb('0x4a')]['id']){delete _0x5f21ce[_0x00bb('0x4a')]['id'];}return db[_0x00bb('0x2d')]['find']({'where':{'id':_0x5f21ce[_0x00bb('0x4b')]['id']}})[_0x00bb('0x25')](handleEntityNotFound(_0x128015,null))[_0x00bb('0x25')](saveUpdates(_0x5f21ce[_0x00bb('0x4a')],null))[_0x00bb('0x25')](respondWithResult(_0x128015,null))[_0x00bb('0x48')](handleError(_0x128015,null));};exports['destroy']=function(_0x5858ee,_0x94a0b){return db[_0x00bb('0x2d')][_0x00bb('0x47')]({'where':{'id':_0x5858ee['params']['id']}})[_0x00bb('0x25')](handleEntityNotFound(_0x94a0b,null))[_0x00bb('0x25')](removeEntity(_0x94a0b,null))[_0x00bb('0x48')](handleError(_0x94a0b,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 60e401f..4e8e89d 100644 --- a/server/api/squareMessage/squareMessage.model.js +++ b/server/api/squareMessage/squareMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa54e=['path','rimraf','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','square_messages','lodash','util','../../config/logger','api','bluebird'];(function(_0x23ff69,_0x354544){var _0x1ce4d1=function(_0x28c9e2){while(--_0x28c9e2){_0x23ff69['push'](_0x23ff69['shift']());}};_0x1ce4d1(++_0x354544);}(_0xa54e,0x70));var _0xea54=function(_0x54b396,_0x3612ee){_0x54b396=_0x54b396-0x0;var _0x532e6d=_0xa54e[_0x54b396];return _0x532e6d;};'use strict';var _=require(_0xea54('0x0'));var util=require(_0xea54('0x1'));var logger=require(_0xea54('0x2'))(_0xea54('0x3'));var moment=require('moment');var BPromise=require(_0xea54('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xea54('0x5'));var rimraf=require(_0xea54('0x6'));var config=require(_0xea54('0x7'));var attributes=require(_0xea54('0x8'));module[_0xea54('0x9')]=function(_0xb795a9,_0x2a032a){return _0xb795a9[_0xea54('0xa')](_0xea54('0xb'),attributes,{'tableName':_0xea54('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc60a=['./squareMessage.attributes','exports','SquareMessage','square_messages','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x315265,_0x5a3de5){var _0x595f5a=function(_0xcee4bf){while(--_0xcee4bf){_0x315265['push'](_0x315265['shift']());}};_0x595f5a(++_0x5a3de5);}(_0xc60a,0x148));var _0xac60=function(_0x37cca1,_0x386871){_0x37cca1=_0x37cca1-0x0;var _0x81354c=_0xc60a[_0x37cca1];return _0x81354c;};'use strict';var _=require('lodash');var util=require(_0xac60('0x0'));var logger=require(_0xac60('0x1'))(_0xac60('0x2'));var moment=require('moment');var BPromise=require(_0xac60('0x3'));var rp=require(_0xac60('0x4'));var fs=require('fs');var path=require(_0xac60('0x5'));var rimraf=require(_0xac60('0x6'));var config=require(_0xac60('0x7'));var attributes=require(_0xac60('0x8'));module[_0xac60('0x9')]=function(_0x49ba19,_0x3ee9ad){return _0x49ba19['define'](_0xac60('0xa'),attributes,{'tableName':_0xac60('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index ed538ca..777f3d7 100644 --- a/server/api/squareMessage/squareMessage.rpc.js +++ b/server/api/squareMessage/squareMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x377d=['../../config/utils','../../config/environment','jayson/promise','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','stringify','lodash','moment','randomstring','ioredis'];(function(_0x42d448,_0x5b3376){var _0x406964=function(_0x182cdb){while(--_0x182cdb){_0x42d448['push'](_0x42d448['shift']());}};_0x406964(++_0x5b3376);}(_0x377d,0x128));var _0xd377=function(_0x1b788f,_0x3f119d){_0x1b788f=_0x1b788f-0x0;var _0x21cfc4=_0x377d[_0x1b788f];return _0x21cfc4;};'use strict';var _=require(_0xd377('0x0'));var util=require('util');var moment=require(_0xd377('0x1'));var BPromise=require('bluebird');var rs=require(_0xd377('0x2'));var fs=require('fs');var Redis=require(_0xd377('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd377('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xd377('0x5'));var jayson=require(_0xd377('0x6'));var client=jayson['client'][_0xd377('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x276b2a,_0x284878,_0x1f4956){return new BPromise(function(_0x2fc5ca,_0x3472fd){return client[_0xd377('0x8')](_0x276b2a,_0x1f4956)[_0xd377('0x9')](function(_0x2d4c76){logger[_0xd377('0xa')](_0xd377('0xb'),_0x284878,_0xd377('0xc'));logger[_0xd377('0xd')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x284878,_0xd377('0xc'),JSON['stringify'](_0x2d4c76));if(_0x2d4c76[_0xd377('0xe')]){if(_0x2d4c76[_0xd377('0xe')]['code']===0x1f4){logger['error'](_0xd377('0xb'),_0x284878,_0x2d4c76[_0xd377('0xe')][_0xd377('0xf')]);return _0x3472fd(_0x2d4c76[_0xd377('0xe')]['message']);}logger['error']('SquareMessage,\x20%s,\x20%s',_0x284878,_0x2d4c76[_0xd377('0xe')]['message']);return _0x2fc5ca(_0x2d4c76[_0xd377('0xe')][_0xd377('0xf')]);}else{logger[_0xd377('0xa')](_0xd377('0xb'),_0x284878,_0xd377('0xc'));_0x2fc5ca(_0x2d4c76[_0xd377('0x10')]['message']);}})[_0xd377('0x11')](function(_0x42a015){logger[_0xd377('0xe')]('SquareMessage,\x20%s,\x20%s',_0x284878,_0x42a015);_0x3472fd(_0x42a015);});});}exports[_0xd377('0x12')]=function(_0x56c395){var _0x48566e=this;return new Promise(function(_0x391406,_0xbd5aa1){return db[_0xd377('0x13')][_0xd377('0x14')](_0x56c395[_0xd377('0x15')],{'raw':_0x56c395[_0xd377('0x16')]?_0x56c395['options'][_0xd377('0x17')]===undefined?!![]:![]:!![]})[_0xd377('0x9')](function(_0x554187){logger['info'](_0xd377('0x12'),_0x56c395);logger[_0xd377('0xd')]('CreateSquareMessage',_0x56c395,JSON[_0xd377('0x18')](_0x554187));_0x391406(_0x554187);})['catch'](function(_0x2738a2){logger[_0xd377('0xe')](_0xd377('0x12'),_0x2738a2[_0xd377('0xf')],_0x56c395);_0xbd5aa1(_0x48566e[_0xd377('0xe')](0x1f4,_0x2738a2[_0xd377('0xf')]));});});}; \ No newline at end of file +var _0x40b5=['SquareMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSquareMessage'];(function(_0x44a64f,_0x38475c){var _0x52024b=function(_0x2cd055){while(--_0x2cd055){_0x44a64f['push'](_0x44a64f['shift']());}};_0x52024b(++_0x38475c);}(_0x40b5,0x18b));var _0x540b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x40b5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x540b('0x0'));var util=require(_0x540b('0x1'));var moment=require(_0x540b('0x2'));var BPromise=require(_0x540b('0x3'));var rs=require(_0x540b('0x4'));var fs=require('fs');var Redis=require(_0x540b('0x5'));var db=require(_0x540b('0x6'))['db'];var utils=require(_0x540b('0x7'));var logger=require(_0x540b('0x8'))(_0x540b('0x9'));var config=require('../../config/environment');var jayson=require(_0x540b('0xa'));var client=jayson[_0x540b('0xb')][_0x540b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x67dd20,_0x9a3167,_0x143e70){return new BPromise(function(_0x5bdffd,_0x58c6e3){return client[_0x540b('0xd')](_0x67dd20,_0x143e70)[_0x540b('0xe')](function(_0xb74cfc){logger[_0x540b('0xf')](_0x540b('0x10'),_0x9a3167,'request\x20sent');logger['debug']('SquareMessage,\x20%s,\x20%s,\x20%s',_0x9a3167,_0x540b('0x11'),JSON[_0x540b('0x12')](_0xb74cfc));if(_0xb74cfc[_0x540b('0x13')]){if(_0xb74cfc['error'][_0x540b('0x14')]===0x1f4){logger[_0x540b('0x13')](_0x540b('0x10'),_0x9a3167,_0xb74cfc['error'][_0x540b('0x15')]);return _0x58c6e3(_0xb74cfc[_0x540b('0x13')][_0x540b('0x15')]);}logger[_0x540b('0x13')](_0x540b('0x10'),_0x9a3167,_0xb74cfc[_0x540b('0x13')][_0x540b('0x15')]);return _0x5bdffd(_0xb74cfc[_0x540b('0x13')][_0x540b('0x15')]);}else{logger[_0x540b('0xf')](_0x540b('0x10'),_0x9a3167,'request\x20sent');_0x5bdffd(_0xb74cfc[_0x540b('0x16')][_0x540b('0x15')]);}})[_0x540b('0x17')](function(_0x10d874){logger[_0x540b('0x13')](_0x540b('0x10'),_0x9a3167,_0x10d874);_0x58c6e3(_0x10d874);});});}exports[_0x540b('0x18')]=function(_0x1d1c18){var _0x39acfb=this;return new Promise(function(_0x52784c,_0x1951f3){return db[_0x540b('0x19')][_0x540b('0x1a')](_0x1d1c18[_0x540b('0x1b')],{'raw':_0x1d1c18[_0x540b('0x1c')]?_0x1d1c18[_0x540b('0x1c')][_0x540b('0x1d')]===undefined?!![]:![]:!![]})[_0x540b('0xe')](function(_0x46e4b6){logger[_0x540b('0xf')](_0x540b('0x18'),_0x1d1c18);logger['debug'](_0x540b('0x18'),_0x1d1c18,JSON[_0x540b('0x12')](_0x46e4b6));_0x52784c(_0x46e4b6);})[_0x540b('0x17')](function(_0x149760){logger[_0x540b('0x13')](_0x540b('0x18'),_0x149760[_0x540b('0x15')],_0x1d1c18);_0x1951f3(_0x39acfb[_0x540b('0x13')](0x1f4,_0x149760[_0x540b('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index a2d687e..7ba8e30 100644 --- a/server/api/squareOdbc/index.js +++ b/server/api/squareOdbc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7865=['../../components/auth/service','../../components/interaction/service','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','create','put','destroy','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x20c2ac,_0x4c4d82){var _0x24d8ff=function(_0x550a81){while(--_0x550a81){_0x20c2ac['push'](_0x20c2ac['shift']());}};_0x24d8ff(++_0x4c4d82);}(_0x7865,0x13d));var _0x5786=function(_0xb87a63,_0xe20ceb){_0xb87a63=_0xb87a63-0x0;var _0x707353=_0x7865[_0xb87a63];return _0x707353;};'use strict';var multer=require(_0x5786('0x0'));var util=require(_0x5786('0x1'));var path=require('path');var timeout=require(_0x5786('0x2'));var express=require(_0x5786('0x3'));var router=express[_0x5786('0x4')]();var fs_extra=require(_0x5786('0x5'));var auth=require(_0x5786('0x6'));var interaction=require(_0x5786('0x7'));var config=require('../../config/environment');var controller=require(_0x5786('0x8'));router[_0x5786('0x9')]('/',auth[_0x5786('0xa')](),controller[_0x5786('0xb')]);router['get'](_0x5786('0xc'),auth[_0x5786('0xa')](),controller[_0x5786('0xd')]);router[_0x5786('0x9')]('/:id/test',auth[_0x5786('0xa')](),timeout('15s'),controller['test']);router['post']('/',auth[_0x5786('0xa')](),controller[_0x5786('0xe')]);router[_0x5786('0xf')](_0x5786('0xc'),auth[_0x5786('0xa')](),controller['update']);router['delete']('/:id',auth[_0x5786('0xa')](),controller[_0x5786('0x10')]);module['exports']=router; \ No newline at end of file +var _0x5406=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','/:id','isAuthenticated','show','/:id/test','15s','test','create','put','update','delete','destroy','multer'];(function(_0x3ac469,_0x57cd58){var _0x1b2e6c=function(_0x21749a){while(--_0x21749a){_0x3ac469['push'](_0x3ac469['shift']());}};_0x1b2e6c(++_0x57cd58);}(_0x5406,0x1b8));var _0x6540=function(_0x43776a,_0x4eb74c){_0x43776a=_0x43776a-0x0;var _0x18eb8f=_0x5406[_0x43776a];return _0x18eb8f;};'use strict';var multer=require(_0x6540('0x0'));var util=require('util');var path=require(_0x6540('0x1'));var timeout=require(_0x6540('0x2'));var express=require('express');var router=express[_0x6540('0x3')]();var fs_extra=require(_0x6540('0x4'));var auth=require(_0x6540('0x5'));var interaction=require(_0x6540('0x6'));var config=require(_0x6540('0x7'));var controller=require(_0x6540('0x8'));router[_0x6540('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x6540('0xa'),auth[_0x6540('0xb')](),controller[_0x6540('0xc')]);router[_0x6540('0x9')](_0x6540('0xd'),auth[_0x6540('0xb')](),timeout(_0x6540('0xe')),controller[_0x6540('0xf')]);router['post']('/',auth[_0x6540('0xb')](),controller[_0x6540('0x10')]);router[_0x6540('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x6540('0x12')]);router[_0x6540('0x13')]('/:id',auth[_0x6540('0xb')](),controller[_0x6540('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 04b5b57..fc45bf7 100644 --- a/server/api/squareOdbc/squareOdbc.attributes.js +++ b/server/api/squareOdbc/squareOdbc.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb91c=['STRING','name'];(function(_0x1d130e,_0x314633){var _0x156c2f=function(_0x5751d2){while(--_0x5751d2){_0x1d130e['push'](_0x1d130e['shift']());}};_0x156c2f(++_0x314633);}(_0xb91c,0x140));var _0xcb91=function(_0x381208,_0xb6b22){_0x381208=_0x381208-0x0;var _0x40fdae=_0xb91c[_0x381208];return _0x40fdae;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xcb91('0x0')],'unique':_0xcb91('0x1'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xcb91('0x0')]}}; \ No newline at end of file +var _0xea2a=['name','STRING'];(function(_0x3b9930,_0x1eab14){var _0x346f43=function(_0x192b7a){while(--_0x192b7a){_0x3b9930['push'](_0x3b9930['shift']());}};_0x346f43(++_0x1eab14);}(_0xea2a,0x73));var _0xaea2=function(_0x4fd51c,_0x212fca){_0x4fd51c=_0x4fd51c-0x0;var _0xde5b62=_0xea2a[_0x4fd51c];return _0xde5b62;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xaea2('0x0')],'unique':_0xaea2('0x1'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 52f3a0d..b595a4c 100644 --- a/server/api/squareOdbc/squareOdbc.controller.js +++ b/server/api/squareOdbc/squareOdbc.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x74b0=['pick','VIRTUAL','merge','options','includeAll','findAll','rows','catch','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','test','dsn','odbc','openSync','closeSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','get','ODBC','UserProfileResource','destroy','error','stack','name','send','index','map','SquareOdbc','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where'];(function(_0xed3592,_0x386639){var _0x466c99=function(_0x594259){while(--_0x594259){_0xed3592['push'](_0xed3592['shift']());}};_0x466c99(++_0x386639);}(_0x74b0,0x126));var _0x074b=function(_0x259d11,_0x222597){_0x259d11=_0x259d11-0x0;var _0x34f70c=_0x74b0[_0x259d11];return _0x34f70c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x074b('0x0'));var zipdir=require(_0x074b('0x1'));var jsonpatch=require(_0x074b('0x2'));var rp=require(_0x074b('0x3'));var moment=require(_0x074b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x074b('0x5'));var util=require(_0x074b('0x6'));var path=require(_0x074b('0x7'));var sox=require(_0x074b('0x8'));var csv=require(_0x074b('0x9'));var ejs=require(_0x074b('0xa'));var fs=require('fs');var fs_extra=require(_0x074b('0xb'));var _=require('lodash');var squel=require(_0x074b('0xc'));var crypto=require(_0x074b('0xd'));var jsforce=require(_0x074b('0xe'));var deskjs=require(_0x074b('0xf'));var toCsv=require(_0x074b('0x9'));var querystring=require(_0x074b('0x10'));var Papa=require('papaparse');var Redis=require(_0x074b('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x074b('0x12'));var as=require(_0x074b('0x13'));var hardwareService=require(_0x074b('0x14'));var logger=require(_0x074b('0x15'))(_0x074b('0x16'));var utils=require('../../config/utils');var config=require(_0x074b('0x17'));var licenseUtil=require(_0x074b('0x18'));var db=require(_0x074b('0x19'))['db'];function respondWithStatusCode(_0x5334e5,_0x2d3af2){_0x2d3af2=_0x2d3af2||0xcc;return function(_0x4909c9){if(_0x4909c9){return _0x5334e5[_0x074b('0x1a')](_0x2d3af2);}return _0x5334e5[_0x074b('0x1b')](_0x2d3af2)[_0x074b('0x1c')]();};}function respondWithResult(_0x14e273,_0x21dd39){_0x21dd39=_0x21dd39||0xc8;return function(_0x50afcf){if(_0x50afcf){return _0x14e273['status'](_0x21dd39)[_0x074b('0x1d')](_0x50afcf);}};}function respondWithFilteredResult(_0xec0a4f,_0x6ea7f7){return function(_0x23d99b){if(_0x23d99b){var _0x101d1f=typeof _0x6ea7f7[_0x074b('0x1e')]===_0x074b('0x1f')&&typeof _0x6ea7f7[_0x074b('0x20')]===_0x074b('0x1f');var _0x3df48e=_0x23d99b['count'];var _0x4556e9=_0x101d1f?0x0:_0x6ea7f7[_0x074b('0x1e')];var _0x3bb6d0=_0x101d1f?_0x23d99b[_0x074b('0x21')]:_0x6ea7f7[_0x074b('0x1e')]+_0x6ea7f7[_0x074b('0x20')];var _0x54805d;if(_0x3bb6d0>=_0x3df48e){_0x3bb6d0=_0x3df48e;_0x54805d=0xc8;}else{_0x54805d=0xce;}_0xec0a4f[_0x074b('0x1b')](_0x54805d);return _0xec0a4f[_0x074b('0x22')](_0x074b('0x23'),_0x4556e9+'-'+_0x3bb6d0+'/'+_0x3df48e)[_0x074b('0x1d')](_0x23d99b);}return null;};}function patchUpdates(_0x451cb8){return function(_0x3acc5b){try{jsonpatch[_0x074b('0x24')](_0x3acc5b,_0x451cb8,!![]);}catch(_0xea6319){return BPromise[_0x074b('0x25')](_0xea6319);}return _0x3acc5b[_0x074b('0x26')]();};}function saveUpdates(_0x32286b,_0x41167a){return function(_0x30e36d){if(_0x30e36d){return _0x30e36d['update'](_0x32286b)['then'](function(_0x2549e2){return _0x2549e2;});}return null;};}function removeEntity(_0x3be39d,_0xeaa2b){return function(_0x50cd64){if(_0x50cd64){return _0x50cd64['destroy']()[_0x074b('0x27')](function(){var _0x118863=_0x50cd64[_0x074b('0x28')]({'plain':!![]});var _0x57ad75=_0x074b('0x29');return db[_0x074b('0x2a')][_0x074b('0x2b')]({'where':{'type':_0x57ad75,'resourceId':_0x118863['id']}})[_0x074b('0x27')](function(){return _0x50cd64;});})[_0x074b('0x27')](function(){_0x3be39d[_0x074b('0x1b')](0xcc)[_0x074b('0x1c')]();});}};}function handleEntityNotFound(_0x486895,_0x2d30b0){return function(_0x2e5214){if(!_0x2e5214){_0x486895[_0x074b('0x1a')](0x194);}return _0x2e5214;};}function handleError(_0x4fee8a,_0x5e3620){_0x5e3620=_0x5e3620||0x1f4;return function(_0x1f0e9a){logger[_0x074b('0x2c')](_0x1f0e9a[_0x074b('0x2d')]);if(_0x1f0e9a[_0x074b('0x2e')]){delete _0x1f0e9a[_0x074b('0x2e')];}_0x4fee8a[_0x074b('0x1b')](_0x5e3620)[_0x074b('0x2f')](_0x1f0e9a);};}exports[_0x074b('0x30')]=function(_0x459583,_0x1987c1){var _0x559119={},_0x5537de={},_0x330e2a={'count':0x0,'rows':[]};var _0x1554ea=_[_0x074b('0x31')](db[_0x074b('0x32')][_0x074b('0x33')],function(_0x3d6046){return{'name':_0x3d6046[_0x074b('0x34')],'type':_0x3d6046[_0x074b('0x35')]['key']};});_0x5537de[_0x074b('0x36')]=_[_0x074b('0x31')](_0x1554ea,_0x074b('0x2e'));_0x5537de[_0x074b('0x37')]=_[_0x074b('0x38')](_0x459583[_0x074b('0x37')]);_0x5537de[_0x074b('0x39')]=_[_0x074b('0x3a')](_0x5537de['model'],_0x5537de[_0x074b('0x37')]);_0x559119[_0x074b('0x3b')]=_['intersection'](_0x5537de['model'],qs[_0x074b('0x3c')](_0x459583['query'][_0x074b('0x3c')]));_0x559119[_0x074b('0x3b')]=_0x559119[_0x074b('0x3b')][_0x074b('0x3d')]?_0x559119['attributes']:_0x5537de[_0x074b('0x36')];if(!_0x459583['query'][_0x074b('0x3e')](_0x074b('0x3f'))){_0x559119['limit']=qs[_0x074b('0x20')](_0x459583[_0x074b('0x37')][_0x074b('0x20')]);_0x559119['offset']=qs[_0x074b('0x1e')](_0x459583['query'][_0x074b('0x1e')]);}_0x559119[_0x074b('0x40')]=qs['sort'](_0x459583[_0x074b('0x37')]['sort']);_0x559119[_0x074b('0x41')]=qs['filters'](_[_0x074b('0x42')](_0x459583[_0x074b('0x37')],_0x5537de[_0x074b('0x39')]),_0x1554ea);if(_0x459583[_0x074b('0x37')]['filter']){_0x559119['where']=_['merge'](_0x559119[_0x074b('0x41')],{'$or':_['map'](_0x1554ea,function(_0x1a0bd9){if(_0x1a0bd9[_0x074b('0x35')]!==_0x074b('0x43')){var _0x5bf8d0={};_0x5bf8d0[_0x1a0bd9[_0x074b('0x2e')]]={'$like':'%'+_0x459583[_0x074b('0x37')]['filter']+'%'};return _0x5bf8d0;}})});}_0x559119=_[_0x074b('0x44')]({},_0x559119,_0x459583[_0x074b('0x45')]);var _0x386544={'where':_0x559119[_0x074b('0x41')]};return db[_0x074b('0x32')][_0x074b('0x21')](_0x386544)[_0x074b('0x27')](function(_0x511870){_0x330e2a['count']=_0x511870;if(_0x459583[_0x074b('0x37')][_0x074b('0x46')]){_0x559119['include']=[{'all':!![]}];}return db[_0x074b('0x32')][_0x074b('0x47')](_0x559119);})[_0x074b('0x27')](function(_0x4c4bcb){_0x330e2a[_0x074b('0x48')]=_0x4c4bcb;return _0x330e2a;})[_0x074b('0x27')](respondWithFilteredResult(_0x1987c1,_0x559119))[_0x074b('0x49')](handleError(_0x1987c1,null));};exports['show']=function(_0x2236c5,_0x121498){var _0x562931={'raw':!![],'where':{'id':_0x2236c5[_0x074b('0x4a')]['id']}},_0x5227e3={};_0x5227e3[_0x074b('0x36')]=_[_0x074b('0x38')](db[_0x074b('0x32')][_0x074b('0x33')]);_0x5227e3[_0x074b('0x37')]=_['keys'](_0x2236c5[_0x074b('0x37')]);_0x5227e3[_0x074b('0x39')]=_['intersection'](_0x5227e3[_0x074b('0x36')],_0x5227e3[_0x074b('0x37')]);_0x562931['attributes']=_[_0x074b('0x3a')](_0x5227e3['model'],qs[_0x074b('0x3c')](_0x2236c5[_0x074b('0x37')][_0x074b('0x3c')]));_0x562931[_0x074b('0x3b')]=_0x562931[_0x074b('0x3b')][_0x074b('0x3d')]?_0x562931['attributes']:_0x5227e3[_0x074b('0x36')];if(_0x2236c5[_0x074b('0x37')][_0x074b('0x46')]){_0x562931['include']=[{'all':!![]}];}_0x562931=_[_0x074b('0x44')]({},_0x562931,_0x2236c5[_0x074b('0x45')]);return db[_0x074b('0x32')][_0x074b('0x4b')](_0x562931)[_0x074b('0x27')](handleEntityNotFound(_0x121498,null))['then'](respondWithResult(_0x121498,null))['catch'](handleError(_0x121498,null));};exports[_0x074b('0x4c')]=function(_0x5e0124,_0x27a840){return db['SquareOdbc']['create'](_0x5e0124['body'],{})[_0x074b('0x27')](function(_0x68ee8d){var _0x8c3d9c=_0x5e0124[_0x074b('0x4d')]['get']({'plain':!![]});if(!_0x8c3d9c)throw new Error(_0x074b('0x4e'));if(_0x8c3d9c[_0x074b('0x4f')]===_0x074b('0x4d')){var _0x5c0bcc=_0x68ee8d[_0x074b('0x28')]({'plain':!![]});var _0x927772='ODBC';return db['UserProfileSection'][_0x074b('0x4b')]({'where':{'name':_0x927772,'userProfileId':_0x8c3d9c[_0x074b('0x50')]},'raw':!![]})[_0x074b('0x27')](function(_0x465ea6){if(_0x465ea6&&_0x465ea6[_0x074b('0x51')]===0x0){return db[_0x074b('0x2a')][_0x074b('0x4c')]({'name':_0x5c0bcc[_0x074b('0x2e')],'resourceId':_0x5c0bcc['id'],'type':_0x465ea6[_0x074b('0x2e')],'sectionId':_0x465ea6['id']},{})[_0x074b('0x27')](function(){return _0x68ee8d;});}else{return _0x68ee8d;}})[_0x074b('0x49')](function(_0x256dc8){logger[_0x074b('0x2c')](_0x074b('0x52'),_0x256dc8);throw _0x256dc8;});}return _0x68ee8d;})[_0x074b('0x27')](respondWithResult(_0x27a840,0xc9))[_0x074b('0x49')](handleError(_0x27a840,null));};exports[_0x074b('0x53')]=function(_0x266773,_0x5db21f){if(_0x266773['body']['id']){delete _0x266773[_0x074b('0x54')]['id'];}return db[_0x074b('0x32')]['find']({'where':{'id':_0x266773['params']['id']}})[_0x074b('0x27')](handleEntityNotFound(_0x5db21f,null))[_0x074b('0x27')](saveUpdates(_0x266773[_0x074b('0x54')],null))[_0x074b('0x27')](respondWithResult(_0x5db21f,null))[_0x074b('0x49')](handleError(_0x5db21f,null));};exports[_0x074b('0x2b')]=function(_0x540bdb,_0xa7f940){return db[_0x074b('0x32')][_0x074b('0x4b')]({'where':{'id':_0x540bdb['params']['id']}})[_0x074b('0x27')](handleEntityNotFound(_0xa7f940,null))[_0x074b('0x27')](removeEntity(_0xa7f940,null))['catch'](handleError(_0xa7f940,null));};exports[_0x074b('0x55')]=function(_0x5e6f7d,_0x22e910,_0x1d67cd){var _0x41b9b2;return db[_0x074b('0x32')]['find']({'where':{'id':_0x5e6f7d[_0x074b('0x4a')]['id']},'attributes':['id',_0x074b('0x56')]})[_0x074b('0x27')](handleEntityNotFound(_0x22e910,null))[_0x074b('0x27')](function(_0x56a621){if(_0x56a621){var _0x84e290=require(_0x074b('0x57'))();_0x84e290[_0x074b('0x58')](_0x56a621[_0x074b('0x56')]);_0x84e290[_0x074b('0x59')]();return _0x56a621;}})[_0x074b('0x27')](respondWithResult(_0x22e910,null))[_0x074b('0x49')](handleError(_0x22e910,null));}; \ No newline at end of file +var _0x2fbf=['update','test','dsn','closeSync','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','ODBC','UserProfileResource','error','stack','name','send','index','SquareOdbc','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','VIRTUAL','filter','merge','where','includeAll','include','rows','catch','show','params','rawAttributes','options','find','create','body','user','get','autoAssociation'];(function(_0xd72790,_0x142afb){var _0x5bc661=function(_0x50531e){while(--_0x50531e){_0xd72790['push'](_0xd72790['shift']());}};_0x5bc661(++_0x142afb);}(_0x2fbf,0xfd));var _0xf2fb=function(_0x4a5eca,_0x49fb04){_0x4a5eca=_0x4a5eca-0x0;var _0x365eaf=_0x2fbf[_0x4a5eca];return _0x365eaf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf2fb('0x0'));var zipdir=require(_0xf2fb('0x1'));var jsonpatch=require(_0xf2fb('0x2'));var rp=require(_0xf2fb('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf2fb('0x4'));var util=require(_0xf2fb('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xf2fb('0x6'));var ejs=require(_0xf2fb('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf2fb('0x8'));var squel=require(_0xf2fb('0x9'));var crypto=require(_0xf2fb('0xa'));var jsforce=require(_0xf2fb('0xb'));var deskjs=require(_0xf2fb('0xc'));var toCsv=require(_0xf2fb('0x6'));var querystring=require(_0xf2fb('0xd'));var Papa=require(_0xf2fb('0xe'));var Redis=require('ioredis');var authService=require(_0xf2fb('0xf'));var qs=require(_0xf2fb('0x10'));var as=require(_0xf2fb('0x11'));var hardwareService=require(_0xf2fb('0x12'));var logger=require('../../config/logger')(_0xf2fb('0x13'));var utils=require(_0xf2fb('0x14'));var config=require(_0xf2fb('0x15'));var licenseUtil=require(_0xf2fb('0x16'));var db=require(_0xf2fb('0x17'))['db'];function respondWithStatusCode(_0x2c0af2,_0x119478){_0x119478=_0x119478||0xcc;return function(_0x213cc0){if(_0x213cc0){return _0x2c0af2[_0xf2fb('0x18')](_0x119478);}return _0x2c0af2[_0xf2fb('0x19')](_0x119478)[_0xf2fb('0x1a')]();};}function respondWithResult(_0x234f43,_0x1a69cc){_0x1a69cc=_0x1a69cc||0xc8;return function(_0x674b6c){if(_0x674b6c){return _0x234f43[_0xf2fb('0x19')](_0x1a69cc)[_0xf2fb('0x1b')](_0x674b6c);}};}function respondWithFilteredResult(_0x23dd3f,_0x3f4046){return function(_0x33d043){if(_0x33d043){var _0x1c8c74=typeof _0x3f4046[_0xf2fb('0x1c')]===_0xf2fb('0x1d')&&typeof _0x3f4046[_0xf2fb('0x1e')]==='undefined';var _0x1738ce=_0x33d043[_0xf2fb('0x1f')];var _0x479352=_0x1c8c74?0x0:_0x3f4046[_0xf2fb('0x1c')];var _0x332877=_0x1c8c74?_0x33d043[_0xf2fb('0x1f')]:_0x3f4046['offset']+_0x3f4046['limit'];var _0x313e79;if(_0x332877>=_0x1738ce){_0x332877=_0x1738ce;_0x313e79=0xc8;}else{_0x313e79=0xce;}_0x23dd3f[_0xf2fb('0x19')](_0x313e79);return _0x23dd3f[_0xf2fb('0x20')](_0xf2fb('0x21'),_0x479352+'-'+_0x332877+'/'+_0x1738ce)['json'](_0x33d043);}return null;};}function patchUpdates(_0x18c444){return function(_0x1894fd){try{jsonpatch['apply'](_0x1894fd,_0x18c444,!![]);}catch(_0x3c0db7){return BPromise[_0xf2fb('0x22')](_0x3c0db7);}return _0x1894fd[_0xf2fb('0x23')]();};}function saveUpdates(_0x11f02a,_0x3776c6){return function(_0x2f9262){if(_0x2f9262){return _0x2f9262['update'](_0x11f02a)[_0xf2fb('0x24')](function(_0xdc1317){return _0xdc1317;});}return null;};}function removeEntity(_0x2cda8f,_0x20cc56){return function(_0x47d3d9){if(_0x47d3d9){return _0x47d3d9[_0xf2fb('0x25')]()[_0xf2fb('0x24')](function(){var _0x357925=_0x47d3d9['get']({'plain':!![]});var _0x52c26b=_0xf2fb('0x26');return db[_0xf2fb('0x27')][_0xf2fb('0x25')]({'where':{'type':_0x52c26b,'resourceId':_0x357925['id']}})[_0xf2fb('0x24')](function(){return _0x47d3d9;});})[_0xf2fb('0x24')](function(){_0x2cda8f[_0xf2fb('0x19')](0xcc)[_0xf2fb('0x1a')]();});}};}function handleEntityNotFound(_0x2304bd,_0x10a32a){return function(_0x29771c){if(!_0x29771c){_0x2304bd['sendStatus'](0x194);}return _0x29771c;};}function handleError(_0x49f968,_0x37d939){_0x37d939=_0x37d939||0x1f4;return function(_0x44137a){logger[_0xf2fb('0x28')](_0x44137a[_0xf2fb('0x29')]);if(_0x44137a[_0xf2fb('0x2a')]){delete _0x44137a['name'];}_0x49f968[_0xf2fb('0x19')](_0x37d939)[_0xf2fb('0x2b')](_0x44137a);};}exports[_0xf2fb('0x2c')]=function(_0x334915,_0x4c630d){var _0x242877={},_0x5628fd={},_0x1531f5={'count':0x0,'rows':[]};var _0x33175c=_['map'](db[_0xf2fb('0x2d')]['rawAttributes'],function(_0x5a709c){return{'name':_0x5a709c[_0xf2fb('0x2e')],'type':_0x5a709c['type'][_0xf2fb('0x2f')]};});_0x5628fd[_0xf2fb('0x30')]=_[_0xf2fb('0x31')](_0x33175c,_0xf2fb('0x2a'));_0x5628fd['query']=_[_0xf2fb('0x32')](_0x334915[_0xf2fb('0x33')]);_0x5628fd[_0xf2fb('0x34')]=_[_0xf2fb('0x35')](_0x5628fd['model'],_0x5628fd[_0xf2fb('0x33')]);_0x242877[_0xf2fb('0x36')]=_[_0xf2fb('0x35')](_0x5628fd[_0xf2fb('0x30')],qs[_0xf2fb('0x37')](_0x334915['query'][_0xf2fb('0x37')]));_0x242877[_0xf2fb('0x36')]=_0x242877['attributes'][_0xf2fb('0x38')]?_0x242877[_0xf2fb('0x36')]:_0x5628fd[_0xf2fb('0x30')];if(!_0x334915['query'][_0xf2fb('0x39')](_0xf2fb('0x3a'))){_0x242877['limit']=qs[_0xf2fb('0x1e')](_0x334915[_0xf2fb('0x33')][_0xf2fb('0x1e')]);_0x242877[_0xf2fb('0x1c')]=qs['offset'](_0x334915['query'][_0xf2fb('0x1c')]);}_0x242877['order']=qs[_0xf2fb('0x3b')](_0x334915[_0xf2fb('0x33')]['sort']);_0x242877['where']=qs[_0xf2fb('0x34')](_[_0xf2fb('0x3c')](_0x334915[_0xf2fb('0x33')],_0x5628fd['filters']),_0x33175c);if(_0x334915['query']['filter']){_0x242877['where']=_['merge'](_0x242877['where'],{'$or':_['map'](_0x33175c,function(_0x17da0b){if(_0x17da0b['type']!==_0xf2fb('0x3d')){var _0x3b9327={};_0x3b9327[_0x17da0b[_0xf2fb('0x2a')]]={'$like':'%'+_0x334915[_0xf2fb('0x33')][_0xf2fb('0x3e')]+'%'};return _0x3b9327;}})});}_0x242877=_[_0xf2fb('0x3f')]({},_0x242877,_0x334915['options']);var _0x21e91f={'where':_0x242877[_0xf2fb('0x40')]};return db[_0xf2fb('0x2d')][_0xf2fb('0x1f')](_0x21e91f)[_0xf2fb('0x24')](function(_0x476120){_0x1531f5[_0xf2fb('0x1f')]=_0x476120;if(_0x334915[_0xf2fb('0x33')][_0xf2fb('0x41')]){_0x242877[_0xf2fb('0x42')]=[{'all':!![]}];}return db[_0xf2fb('0x2d')]['findAll'](_0x242877);})[_0xf2fb('0x24')](function(_0x59de51){_0x1531f5[_0xf2fb('0x43')]=_0x59de51;return _0x1531f5;})[_0xf2fb('0x24')](respondWithFilteredResult(_0x4c630d,_0x242877))[_0xf2fb('0x44')](handleError(_0x4c630d,null));};exports[_0xf2fb('0x45')]=function(_0x347325,_0x3bd84b){var _0x5a301f={'raw':!![],'where':{'id':_0x347325[_0xf2fb('0x46')]['id']}},_0x5b2170={};_0x5b2170['model']=_[_0xf2fb('0x32')](db[_0xf2fb('0x2d')][_0xf2fb('0x47')]);_0x5b2170[_0xf2fb('0x33')]=_[_0xf2fb('0x32')](_0x347325[_0xf2fb('0x33')]);_0x5b2170[_0xf2fb('0x34')]=_[_0xf2fb('0x35')](_0x5b2170[_0xf2fb('0x30')],_0x5b2170['query']);_0x5a301f[_0xf2fb('0x36')]=_['intersection'](_0x5b2170[_0xf2fb('0x30')],qs[_0xf2fb('0x37')](_0x347325[_0xf2fb('0x33')][_0xf2fb('0x37')]));_0x5a301f['attributes']=_0x5a301f[_0xf2fb('0x36')]['length']?_0x5a301f[_0xf2fb('0x36')]:_0x5b2170['model'];if(_0x347325[_0xf2fb('0x33')]['includeAll']){_0x5a301f[_0xf2fb('0x42')]=[{'all':!![]}];}_0x5a301f=_[_0xf2fb('0x3f')]({},_0x5a301f,_0x347325[_0xf2fb('0x48')]);return db[_0xf2fb('0x2d')][_0xf2fb('0x49')](_0x5a301f)[_0xf2fb('0x24')](handleEntityNotFound(_0x3bd84b,null))[_0xf2fb('0x24')](respondWithResult(_0x3bd84b,null))[_0xf2fb('0x44')](handleError(_0x3bd84b,null));};exports[_0xf2fb('0x4a')]=function(_0x2c8c05,_0x50eb68){return db[_0xf2fb('0x2d')][_0xf2fb('0x4a')](_0x2c8c05[_0xf2fb('0x4b')],{})[_0xf2fb('0x24')](function(_0x5e6a40){var _0x5ac18b=_0x2c8c05[_0xf2fb('0x4c')][_0xf2fb('0x4d')]({'plain':!![]});if(!_0x5ac18b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5ac18b['role']===_0xf2fb('0x4c')){var _0x115aa0=_0x5e6a40[_0xf2fb('0x4d')]({'plain':!![]});var _0xf4aec4=_0xf2fb('0x26');return db['UserProfileSection'][_0xf2fb('0x49')]({'where':{'name':_0xf4aec4,'userProfileId':_0x5ac18b['userProfileId']},'raw':!![]})[_0xf2fb('0x24')](function(_0x17f91f){if(_0x17f91f&&_0x17f91f[_0xf2fb('0x4e')]===0x0){return db[_0xf2fb('0x27')][_0xf2fb('0x4a')]({'name':_0x115aa0['name'],'resourceId':_0x115aa0['id'],'type':_0x17f91f['name'],'sectionId':_0x17f91f['id']},{})[_0xf2fb('0x24')](function(){return _0x5e6a40;});}else{return _0x5e6a40;}})[_0xf2fb('0x44')](function(_0xb69231){logger[_0xf2fb('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb69231);throw _0xb69231;});}return _0x5e6a40;})['then'](respondWithResult(_0x50eb68,0xc9))[_0xf2fb('0x44')](handleError(_0x50eb68,null));};exports[_0xf2fb('0x4f')]=function(_0x28d2ea,_0xa10d4b){if(_0x28d2ea[_0xf2fb('0x4b')]['id']){delete _0x28d2ea[_0xf2fb('0x4b')]['id'];}return db[_0xf2fb('0x2d')][_0xf2fb('0x49')]({'where':{'id':_0x28d2ea[_0xf2fb('0x46')]['id']}})[_0xf2fb('0x24')](handleEntityNotFound(_0xa10d4b,null))['then'](saveUpdates(_0x28d2ea[_0xf2fb('0x4b')],null))[_0xf2fb('0x24')](respondWithResult(_0xa10d4b,null))[_0xf2fb('0x44')](handleError(_0xa10d4b,null));};exports[_0xf2fb('0x25')]=function(_0x20b33f,_0x367f8e){return db[_0xf2fb('0x2d')][_0xf2fb('0x49')]({'where':{'id':_0x20b33f[_0xf2fb('0x46')]['id']}})[_0xf2fb('0x24')](handleEntityNotFound(_0x367f8e,null))[_0xf2fb('0x24')](removeEntity(_0x367f8e,null))[_0xf2fb('0x44')](handleError(_0x367f8e,null));};exports[_0xf2fb('0x50')]=function(_0x3f623c,_0x2e4bca,_0x1eab03){var _0x21522a;return db[_0xf2fb('0x2d')]['find']({'where':{'id':_0x3f623c[_0xf2fb('0x46')]['id']},'attributes':['id',_0xf2fb('0x51')]})[_0xf2fb('0x24')](handleEntityNotFound(_0x2e4bca,null))[_0xf2fb('0x24')](function(_0x489605){if(_0x489605){var _0xcb5952=require('odbc')();_0xcb5952['openSync'](_0x489605[_0xf2fb('0x51')]);_0xcb5952[_0xf2fb('0x52')]();return _0x489605;}})[_0xf2fb('0x24')](respondWithResult(_0x2e4bca,null))[_0xf2fb('0x44')](handleError(_0x2e4bca,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 1c1fc44..b96ceea 100644 --- a/server/api/squareOdbc/squareOdbc.model.js +++ b/server/api/squareOdbc/squareOdbc.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbf5f=['request-promise','rimraf','./squareOdbc.attributes','exports','define','square_odbc','lodash','util','api','moment','bluebird'];(function(_0x513dfe,_0x5b2a8e){var _0x3f01a9=function(_0x287163){while(--_0x287163){_0x513dfe['push'](_0x513dfe['shift']());}};_0x3f01a9(++_0x5b2a8e);}(_0xbf5f,0x145));var _0xfbf5=function(_0x429013,_0x11f74e){_0x429013=_0x429013-0x0;var _0x551ba2=_0xbf5f[_0x429013];return _0x551ba2;};'use strict';var _=require(_0xfbf5('0x0'));var util=require(_0xfbf5('0x1'));var logger=require('../../config/logger')(_0xfbf5('0x2'));var moment=require(_0xfbf5('0x3'));var BPromise=require(_0xfbf5('0x4'));var rp=require(_0xfbf5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfbf5('0x6'));var config=require('../../config/environment');var attributes=require(_0xfbf5('0x7'));module[_0xfbf5('0x8')]=function(_0x3502e8,_0x5738d7){return _0x3502e8[_0xfbf5('0x9')]('SquareOdbc',attributes,{'tableName':_0xfbf5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8c8f=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc'];(function(_0x80b9b8,_0x2a2163){var _0xb7fe18=function(_0x4db660){while(--_0x4db660){_0x80b9b8['push'](_0x80b9b8['shift']());}};_0xb7fe18(++_0x2a2163);}(_0x8c8f,0x193));var _0xf8c8=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x8c8f[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0xf8c8('0x0'));var util=require(_0xf8c8('0x1'));var logger=require(_0xf8c8('0x2'))(_0xf8c8('0x3'));var moment=require(_0xf8c8('0x4'));var BPromise=require(_0xf8c8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf8c8('0x6'));var rimraf=require(_0xf8c8('0x7'));var config=require('../../config/environment');var attributes=require(_0xf8c8('0x8'));module[_0xf8c8('0x9')]=function(_0xb0abb,_0x51f5a2){return _0xb0abb[_0xf8c8('0xa')](_0xf8c8('0xb'),attributes,{'tableName':_0xf8c8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index b4d9ef5..85b7a8e 100644 --- a/server/api/squareOdbc/squareOdbc.rpc.js +++ b/server/api/squareOdbc/squareOdbc.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0229=['message','result','catch','ShowSquareOdbc','SquareOdbc','options','raw','attributes','map','model','include','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x581059,_0x379b9){var _0x1423d2=function(_0x4bc119){while(--_0x4bc119){_0x581059['push'](_0x581059['shift']());}};_0x1423d2(++_0x379b9);}(_0x0229,0x141));var _0x9022=function(_0xc9eddf,_0x1cae92){_0xc9eddf=_0xc9eddf-0x0;var _0x2950ee=_0x0229[_0xc9eddf];return _0x2950ee;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9022('0x0'));var BPromise=require('bluebird');var rs=require(_0x9022('0x1'));var fs=require('fs');var Redis=require(_0x9022('0x2'));var db=require(_0x9022('0x3'))['db'];var utils=require(_0x9022('0x4'));var logger=require(_0x9022('0x5'))(_0x9022('0x6'));var config=require(_0x9022('0x7'));var jayson=require(_0x9022('0x8'));var client=jayson[_0x9022('0x9')][_0x9022('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x69f22d,_0x2096b5,_0x287ad9){return new BPromise(function(_0x110a4c,_0x197ad9){return client[_0x9022('0xb')](_0x69f22d,_0x287ad9)[_0x9022('0xc')](function(_0x3f8f24){logger[_0x9022('0xd')](_0x9022('0xe'),_0x2096b5,_0x9022('0xf'));logger[_0x9022('0x10')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x2096b5,_0x9022('0xf'),JSON[_0x9022('0x11')](_0x3f8f24));if(_0x3f8f24[_0x9022('0x12')]){if(_0x3f8f24[_0x9022('0x12')][_0x9022('0x13')]===0x1f4){logger['error'](_0x9022('0xe'),_0x2096b5,_0x3f8f24[_0x9022('0x12')][_0x9022('0x14')]);return _0x197ad9(_0x3f8f24[_0x9022('0x12')][_0x9022('0x14')]);}logger['error'](_0x9022('0xe'),_0x2096b5,_0x3f8f24[_0x9022('0x12')][_0x9022('0x14')]);return _0x110a4c(_0x3f8f24['error'][_0x9022('0x14')]);}else{logger['info']('SquareOdbc,\x20%s,\x20%s',_0x2096b5,_0x9022('0xf'));_0x110a4c(_0x3f8f24[_0x9022('0x15')][_0x9022('0x14')]);}})[_0x9022('0x16')](function(_0xfc6e05){logger[_0x9022('0x12')]('SquareOdbc,\x20%s,\x20%s',_0x2096b5,_0xfc6e05);_0x197ad9(_0xfc6e05);});});}exports[_0x9022('0x17')]=function(_0x1b7483){var _0x4a4d75=this;return new Promise(function(_0x19a895,_0x28cc51){return db[_0x9022('0x18')]['find']({'raw':_0x1b7483[_0x9022('0x19')]?_0x1b7483[_0x9022('0x19')][_0x9022('0x1a')]===undefined?!![]:![]:!![],'where':_0x1b7483[_0x9022('0x19')]?_0x1b7483[_0x9022('0x19')]['where']||null:null,'attributes':_0x1b7483[_0x9022('0x19')]?_0x1b7483['options'][_0x9022('0x1b')]||null:null,'include':_0x1b7483[_0x9022('0x19')]?_0x1b7483[_0x9022('0x19')]['include']?_[_0x9022('0x1c')](_0x1b7483['options']['include'],function(_0x3dc1d1){return{'model':db[_0x3dc1d1[_0x9022('0x1d')]],'as':_0x3dc1d1['as'],'attributes':_0x3dc1d1[_0x9022('0x1b')],'include':_0x3dc1d1[_0x9022('0x1e')]?_[_0x9022('0x1c')](_0x3dc1d1[_0x9022('0x1e')],function(_0x5675df){return{'model':db[_0x5675df[_0x9022('0x1d')]],'as':_0x5675df['as'],'attributes':_0x5675df[_0x9022('0x1b')],'include':_0x5675df[_0x9022('0x1e')]?_['map'](_0x5675df['include'],function(_0x859233){return{'model':db[_0x859233[_0x9022('0x1d')]],'as':_0x859233['as'],'attributes':_0x859233['attributes']};}):[]};}):[]};}):[]:[]})[_0x9022('0xc')](function(_0x1a75b6){logger[_0x9022('0xd')]('ShowSquareOdbc',_0x1b7483);logger[_0x9022('0x10')](_0x9022('0x17'),_0x1b7483,JSON[_0x9022('0x11')](_0x1a75b6));_0x19a895(_0x1a75b6);})['catch'](function(_0x574b30){logger[_0x9022('0x12')]('ShowSquareOdbc',_0x574b30[_0x9022('0x14')],_0x1b7483);_0x28cc51(_0x4a4d75[_0x9022('0x12')](0x1f4,_0x574b30[_0x9022('0x14')]));});});}; \ No newline at end of file +var _0x4043=['client','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','SquareOdbc','options','raw','attributes','map','include','model','ShowSquareOdbc','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise'];(function(_0x21d7a2,_0x5aecda){var _0x1da981=function(_0x4c86f2){while(--_0x4c86f2){_0x21d7a2['push'](_0x21d7a2['shift']());}};_0x1da981(++_0x5aecda);}(_0x4043,0x181));var _0x3404=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x4043[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3404('0x0'));var BPromise=require(_0x3404('0x1'));var rs=require(_0x3404('0x2'));var fs=require('fs');var Redis=require(_0x3404('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3404('0x4'));var config=require(_0x3404('0x5'));var jayson=require(_0x3404('0x6'));var client=jayson[_0x3404('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e59cf,_0x64c99a,_0x52c635){return new BPromise(function(_0x5098e7,_0x195830){return client[_0x3404('0x8')](_0x5e59cf,_0x52c635)[_0x3404('0x9')](function(_0x35b21d){logger[_0x3404('0xa')](_0x3404('0xb'),_0x64c99a,_0x3404('0xc'));logger[_0x3404('0xd')](_0x3404('0xe'),_0x64c99a,_0x3404('0xc'),JSON[_0x3404('0xf')](_0x35b21d));if(_0x35b21d[_0x3404('0x10')]){if(_0x35b21d[_0x3404('0x10')]['code']===0x1f4){logger[_0x3404('0x10')](_0x3404('0xb'),_0x64c99a,_0x35b21d[_0x3404('0x10')][_0x3404('0x11')]);return _0x195830(_0x35b21d[_0x3404('0x10')][_0x3404('0x11')]);}logger['error'](_0x3404('0xb'),_0x64c99a,_0x35b21d[_0x3404('0x10')][_0x3404('0x11')]);return _0x5098e7(_0x35b21d[_0x3404('0x10')][_0x3404('0x11')]);}else{logger[_0x3404('0xa')](_0x3404('0xb'),_0x64c99a,_0x3404('0xc'));_0x5098e7(_0x35b21d[_0x3404('0x12')]['message']);}})[_0x3404('0x13')](function(_0x1fe4ad){logger[_0x3404('0x10')](_0x3404('0xb'),_0x64c99a,_0x1fe4ad);_0x195830(_0x1fe4ad);});});}exports['ShowSquareOdbc']=function(_0x3f2039){var _0x455a6d=this;return new Promise(function(_0x365e7b,_0xbd7e91){return db[_0x3404('0x14')]['find']({'raw':_0x3f2039[_0x3404('0x15')]?_0x3f2039[_0x3404('0x15')][_0x3404('0x16')]===undefined?!![]:![]:!![],'where':_0x3f2039[_0x3404('0x15')]?_0x3f2039[_0x3404('0x15')]['where']||null:null,'attributes':_0x3f2039[_0x3404('0x15')]?_0x3f2039[_0x3404('0x15')][_0x3404('0x17')]||null:null,'include':_0x3f2039[_0x3404('0x15')]?_0x3f2039[_0x3404('0x15')]['include']?_[_0x3404('0x18')](_0x3f2039[_0x3404('0x15')][_0x3404('0x19')],function(_0x485b10){return{'model':db[_0x485b10[_0x3404('0x1a')]],'as':_0x485b10['as'],'attributes':_0x485b10[_0x3404('0x17')],'include':_0x485b10[_0x3404('0x19')]?_[_0x3404('0x18')](_0x485b10[_0x3404('0x19')],function(_0x2caf32){return{'model':db[_0x2caf32[_0x3404('0x1a')]],'as':_0x2caf32['as'],'attributes':_0x2caf32[_0x3404('0x17')],'include':_0x2caf32[_0x3404('0x19')]?_['map'](_0x2caf32[_0x3404('0x19')],function(_0x58097d){return{'model':db[_0x58097d[_0x3404('0x1a')]],'as':_0x58097d['as'],'attributes':_0x58097d[_0x3404('0x17')]};}):[]};}):[]};}):[]:[]})[_0x3404('0x9')](function(_0x383232){logger[_0x3404('0xa')](_0x3404('0x1b'),_0x3f2039);logger[_0x3404('0xd')](_0x3404('0x1b'),_0x3f2039,JSON[_0x3404('0xf')](_0x383232));_0x365e7b(_0x383232);})[_0x3404('0x13')](function(_0x3fe533){logger[_0x3404('0x10')](_0x3404('0x1b'),_0x3fe533['message'],_0x3f2039);_0xbd7e91(_0x455a6d['error'](0x1f4,_0x3fe533[_0x3404('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 9185a9f..b2a5f76 100644 --- a/server/api/squareProject/index.js +++ b/server/api/squareProject/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd7db=['show','create','put','/:id','update','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index'];(function(_0x451a3a,_0x36947e){var _0x545b8d=function(_0x42b4fb){while(--_0x42b4fb){_0x451a3a['push'](_0x451a3a['shift']());}};_0x545b8d(++_0x36947e);}(_0xd7db,0x17b));var _0xbd7d=function(_0x4d7f9c,_0x40fda5){_0x4d7f9c=_0x4d7f9c-0x0;var _0x59970a=_0xd7db[_0x4d7f9c];return _0x59970a;};'use strict';var multer=require(_0xbd7d('0x0'));var util=require('util');var path=require(_0xbd7d('0x1'));var timeout=require(_0xbd7d('0x2'));var express=require(_0xbd7d('0x3'));var router=express['Router']();var fs_extra=require(_0xbd7d('0x4'));var auth=require(_0xbd7d('0x5'));var interaction=require(_0xbd7d('0x6'));var config=require(_0xbd7d('0x7'));var controller=require(_0xbd7d('0x8'));router[_0xbd7d('0x9')]('/',auth[_0xbd7d('0xa')](),controller[_0xbd7d('0xb')]);router[_0xbd7d('0x9')]('/:id',auth[_0xbd7d('0xa')](),controller[_0xbd7d('0xc')]);router['post']('/',auth[_0xbd7d('0xa')](),controller[_0xbd7d('0xd')]);router[_0xbd7d('0xe')](_0xbd7d('0xf'),auth['isAuthenticated'](),controller[_0xbd7d('0x10')]);router['delete'](_0xbd7d('0xf'),auth[_0xbd7d('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xba0d=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','index','isAuthenticated','show','post','put','update','delete','destroy','multer','path','connect-timeout','express'];(function(_0x5cc533,_0x22f53a){var _0x3b1674=function(_0x2ce2e7){while(--_0x2ce2e7){_0x5cc533['push'](_0x5cc533['shift']());}};_0x3b1674(++_0x22f53a);}(_0xba0d,0xcd));var _0xdba0=function(_0x249351,_0x25dd5f){_0x249351=_0x249351-0x0;var _0x57283a=_0xba0d[_0x249351];return _0x57283a;};'use strict';var multer=require(_0xdba0('0x0'));var util=require('util');var path=require(_0xdba0('0x1'));var timeout=require(_0xdba0('0x2'));var express=require(_0xdba0('0x3'));var router=express[_0xdba0('0x4')]();var fs_extra=require(_0xdba0('0x5'));var auth=require(_0xdba0('0x6'));var interaction=require(_0xdba0('0x7'));var config=require(_0xdba0('0x8'));var controller=require(_0xdba0('0x9'));router[_0xdba0('0xa')]('/',auth['isAuthenticated'](),controller[_0xdba0('0xb')]);router['get']('/:id',auth[_0xdba0('0xc')](),controller[_0xdba0('0xd')]);router[_0xdba0('0xe')]('/',auth[_0xdba0('0xc')](),controller['create']);router[_0xdba0('0xf')]('/:id',auth[_0xdba0('0xc')](),controller[_0xdba0('0x10')]);router[_0xdba0('0x11')]('/:id',auth[_0xdba0('0xc')](),controller[_0xdba0('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index fe26db2..f8344b1 100644 --- a/server/api/squareProject/squareProject.attributes.js +++ b/server/api/squareProject/squareProject.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc6df=['long','getDataValue','preproduction','toString','utf8','production','DATE','STRING','name','BLOB'];(function(_0x1c510a,_0x1413a9){var _0x23cedd=function(_0x3f3e43){while(--_0x3f3e43){_0x1c510a['push'](_0x1c510a['shift']());}};_0x23cedd(++_0x1413a9);}(_0xc6df,0x115));var _0xfc6d=function(_0xa2d19e,_0x5e82d0){_0xa2d19e=_0xa2d19e-0x0;var _0x6994cb=_0xc6df[_0xa2d19e];return _0x6994cb;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xfc6d('0x0')],'unique':_0xfc6d('0x1'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0xfc6d('0x2')](_0xfc6d('0x3')),'get':function(){if(this[_0xfc6d('0x4')](_0xfc6d('0x5'))){return this[_0xfc6d('0x4')](_0xfc6d('0x5'))[_0xfc6d('0x6')](_0xfc6d('0x7'));}}},'production':{'type':Sequelize['BLOB'](_0xfc6d('0x3')),'get':function(){if(this[_0xfc6d('0x4')](_0xfc6d('0x8'))){return this['getDataValue']('production')[_0xfc6d('0x6')](_0xfc6d('0x7'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0xfc6d('0x9')]}}; \ No newline at end of file +var _0xf960=['utf8','BLOB','production','DATE','sequelize','exports','STRING','name','long','getDataValue','preproduction','toString'];(function(_0x106748,_0x51d97c){var _0x2d5b47=function(_0x2b1699){while(--_0x2b1699){_0x106748['push'](_0x106748['shift']());}};_0x2d5b47(++_0x51d97c);}(_0xf960,0x190));var _0x0f96=function(_0x1ee62e,_0x159bb2){_0x1ee62e=_0x1ee62e-0x0;var _0x27c6c8=_0xf960[_0x1ee62e];return _0x27c6c8;};'use strict';var Sequelize=require(_0x0f96('0x0'));module[_0x0f96('0x1')]={'name':{'type':Sequelize[_0x0f96('0x2')],'unique':_0x0f96('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x0f96('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize['BLOB'](_0x0f96('0x4')),'get':function(){if(this[_0x0f96('0x5')](_0x0f96('0x6'))){return this[_0x0f96('0x5')](_0x0f96('0x6'))[_0x0f96('0x7')](_0x0f96('0x8'));}}},'production':{'type':Sequelize[_0x0f96('0x9')](_0x0f96('0x4')),'get':function(){if(this[_0x0f96('0x5')](_0x0f96('0xa'))){return this[_0x0f96('0x5')](_0x0f96('0xa'))[_0x0f96('0x7')](_0x0f96('0x8'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0x0f96('0xb')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index a0153f9..3d74266 100644 --- a/server/api/squareProject/squareProject.controller.js +++ b/server/api/squareProject/squareProject.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3c9f=['limit','set','Content-Range','update','then','get','SquareProjects','destroy','publish','agi','stringify','status','end','error','stack','name','send','index','map','SquareProject','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','catch','params','rawAttributes','length','find','body','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','pick','lodash','ioredis','../../components/parsers/qs','../../config/logger','defaults','redis','./squareProject.socket','register','json','offset','undefined','count'];(function(_0x4147ff,_0x154530){var _0x1e71e6=function(_0x21f992){while(--_0x21f992){_0x4147ff['push'](_0x4147ff['shift']());}};_0x1e71e6(++_0x154530);}(_0x3c9f,0x1e4));var _0xf3c9=function(_0x1f85bb,_0x5d2857){_0x1f85bb=_0x1f85bb-0x0;var _0x34fc88=_0x3c9f[_0x1f85bb];return _0x34fc88;};'use strict';var _=require(_0xf3c9('0x0'));var Redis=require(_0xf3c9('0x1'));var qs=require(_0xf3c9('0x2'));var logger=require(_0xf3c9('0x3'))('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0xf3c9('0x4')](config[_0xf3c9('0x5')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf3c9('0x5')]));require(_0xf3c9('0x6'))[_0xf3c9('0x7')](socket);function respondWithResult(_0x48815b,_0x49f0ac){_0x49f0ac=_0x49f0ac||0xc8;return function(_0x28e4de){if(_0x28e4de){return _0x48815b['status'](_0x49f0ac)[_0xf3c9('0x8')](_0x28e4de);}};}function respondWithFilteredResult(_0x4e6841,_0xc9b72a){return function(_0x582eee){if(_0x582eee){var _0x4eced8=typeof _0xc9b72a[_0xf3c9('0x9')]===_0xf3c9('0xa')&&typeof _0xc9b72a['limit']===_0xf3c9('0xa');var _0x38c7aa=_0x582eee[_0xf3c9('0xb')];var _0x5853b1=_0x4eced8?0x0:_0xc9b72a[_0xf3c9('0x9')];var _0x4fb3ed=_0x4eced8?_0x582eee[_0xf3c9('0xb')]:_0xc9b72a[_0xf3c9('0x9')]+_0xc9b72a[_0xf3c9('0xc')];var _0x2f5c5e;if(_0x4fb3ed>=_0x38c7aa){_0x4fb3ed=_0x38c7aa;_0x2f5c5e=0xc8;}else{_0x2f5c5e=0xce;}_0x4e6841['status'](_0x2f5c5e);return _0x4e6841[_0xf3c9('0xd')](_0xf3c9('0xe'),_0x5853b1+'-'+_0x4fb3ed+'/'+_0x38c7aa)[_0xf3c9('0x8')](_0x582eee);}return null;};}function saveUpdates(_0x52fe45){return function(_0xfa738b){if(_0xfa738b){return _0xfa738b[_0xf3c9('0xf')](_0x52fe45)[_0xf3c9('0x10')](function(_0x2cabc3){return _0x2cabc3;});}return null;};}function removeEntity(_0x7be0b8){return function(_0xf9f042){if(_0xf9f042){return _0xf9f042['destroy']()['then'](function(){var _0x1e7437=_0xf9f042[_0xf3c9('0x11')]({'plain':!![]});var _0x4bb22c=_0xf3c9('0x12');return db['UserProfileResource'][_0xf3c9('0x13')]({'where':{'type':_0x4bb22c,'resourceId':_0x1e7437['id']}})['then'](function(){return _0xf9f042;});})[_0xf3c9('0x10')](function(){var _0x135b3d=new Redis(config['redis']);_0x135b3d[_0xf3c9('0x14')](_0xf3c9('0x15'),JSON[_0xf3c9('0x16')]({'id':_0xf9f042['id'],'deleted':!![]}));})[_0xf3c9('0x10')](function(){_0x7be0b8[_0xf3c9('0x17')](0xcc)[_0xf3c9('0x18')]();});}};}function handleEntityNotFound(_0x39cf7e){return function(_0x9fb843){if(!_0x9fb843){_0x39cf7e['sendStatus'](0x194);}return _0x9fb843;};}function handleError(_0x5746c6,_0x557bc8){_0x557bc8=_0x557bc8||0x1f4;return function(_0x4e645b){logger[_0xf3c9('0x19')](_0x4e645b[_0xf3c9('0x1a')]);if(_0x4e645b['name']){delete _0x4e645b[_0xf3c9('0x1b')];}_0x5746c6[_0xf3c9('0x17')](_0x557bc8)[_0xf3c9('0x1c')](_0x4e645b);};}exports[_0xf3c9('0x1d')]=function(_0x4fbc10,_0x1ebe0c){var _0x23b0c9={},_0x439488={},_0x1683dd={'count':0x0,'rows':[]};var _0x573fa9=_[_0xf3c9('0x1e')](db[_0xf3c9('0x1f')]['rawAttributes'],function(_0x45db64){return{'name':_0x45db64['fieldName'],'type':_0x45db64[_0xf3c9('0x20')][_0xf3c9('0x21')]};});_0x439488[_0xf3c9('0x22')]=_[_0xf3c9('0x1e')](_0x573fa9,_0xf3c9('0x1b'));_0x439488[_0xf3c9('0x23')]=_[_0xf3c9('0x24')](_0x4fbc10['query']);_0x439488[_0xf3c9('0x25')]=_[_0xf3c9('0x26')](_0x439488[_0xf3c9('0x22')],_0x439488[_0xf3c9('0x23')]);_0x23b0c9[_0xf3c9('0x27')]=_[_0xf3c9('0x26')](_0x439488['model'],qs['fields'](_0x4fbc10[_0xf3c9('0x23')][_0xf3c9('0x28')]));_0x23b0c9[_0xf3c9('0x27')]=_0x23b0c9[_0xf3c9('0x27')]['length']?_0x23b0c9[_0xf3c9('0x27')]:_0x439488[_0xf3c9('0x22')];if(!_0x4fbc10[_0xf3c9('0x23')][_0xf3c9('0x29')](_0xf3c9('0x2a'))){_0x23b0c9['limit']=qs[_0xf3c9('0xc')](_0x4fbc10['query'][_0xf3c9('0xc')]);_0x23b0c9[_0xf3c9('0x9')]=qs[_0xf3c9('0x9')](_0x4fbc10[_0xf3c9('0x23')][_0xf3c9('0x9')]);}_0x23b0c9[_0xf3c9('0x2b')]=qs[_0xf3c9('0x2c')](_0x4fbc10['query'][_0xf3c9('0x2c')]);_0x23b0c9[_0xf3c9('0x2d')]=qs[_0xf3c9('0x25')](_['pick'](_0x4fbc10[_0xf3c9('0x23')],_0x439488['filters']),_0x573fa9);if(_0x4fbc10[_0xf3c9('0x23')][_0xf3c9('0x2e')]){_0x23b0c9[_0xf3c9('0x2d')]=_[_0xf3c9('0x2f')](_0x23b0c9[_0xf3c9('0x2d')],{'$or':_['map'](_0x573fa9,function(_0x4cd79b){if(_0x4cd79b['type']!==_0xf3c9('0x30')){var _0xeab09c={};_0xeab09c[_0x4cd79b[_0xf3c9('0x1b')]]={'$like':'%'+_0x4fbc10[_0xf3c9('0x23')][_0xf3c9('0x2e')]+'%'};return _0xeab09c;}})});}_0x23b0c9=_[_0xf3c9('0x2f')]({},_0x23b0c9,_0x4fbc10[_0xf3c9('0x31')]);var _0xf24632={'where':_0x23b0c9['where']};return db[_0xf3c9('0x1f')][_0xf3c9('0xb')](_0xf24632)['then'](function(_0x1079d9){_0x1683dd[_0xf3c9('0xb')]=_0x1079d9;if(_0x4fbc10['query'][_0xf3c9('0x32')]){_0x23b0c9['include']=[{'all':!![]}];}return db[_0xf3c9('0x1f')]['findAll'](_0x23b0c9);})[_0xf3c9('0x10')](function(_0xee7f28){_0x1683dd['rows']=_0xee7f28;return _0x1683dd;})[_0xf3c9('0x10')](respondWithFilteredResult(_0x1ebe0c,_0x23b0c9))[_0xf3c9('0x33')](handleError(_0x1ebe0c,null));};exports['show']=function(_0x5b0560,_0x3fad5b){var _0x4ed19c={'raw':![],'where':{'id':_0x5b0560[_0xf3c9('0x34')]['id']}},_0x1f116a={};_0x1f116a['model']=_['keys'](db[_0xf3c9('0x1f')][_0xf3c9('0x35')]);_0x1f116a[_0xf3c9('0x23')]=_['keys'](_0x5b0560[_0xf3c9('0x23')]);_0x1f116a[_0xf3c9('0x25')]=_[_0xf3c9('0x26')](_0x1f116a[_0xf3c9('0x22')],_0x1f116a[_0xf3c9('0x23')]);_0x4ed19c['attributes']=_['intersection'](_0x1f116a[_0xf3c9('0x22')],qs[_0xf3c9('0x28')](_0x5b0560[_0xf3c9('0x23')]['fields']));_0x4ed19c['attributes']=_0x4ed19c[_0xf3c9('0x27')][_0xf3c9('0x36')]?_0x4ed19c[_0xf3c9('0x27')]:_0x1f116a['model'];if(_0x5b0560[_0xf3c9('0x23')][_0xf3c9('0x32')]){_0x4ed19c['include']=[{'all':!![]}];}_0x4ed19c=_[_0xf3c9('0x2f')]({},_0x4ed19c,_0x5b0560['options']);return db[_0xf3c9('0x1f')][_0xf3c9('0x37')](_0x4ed19c)[_0xf3c9('0x10')](handleEntityNotFound(_0x3fad5b,null))[_0xf3c9('0x10')](respondWithResult(_0x3fad5b,null))['catch'](handleError(_0x3fad5b,null));};exports['create']=function(_0x2addd1,_0xf1e747){return db[_0xf3c9('0x1f')]['create'](_0x2addd1[_0xf3c9('0x38')],{})[_0xf3c9('0x10')](function(_0x4f0e96){var _0x481592=_0x2addd1['user'][_0xf3c9('0x11')]({'plain':!![]});if(!_0x481592)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x481592[_0xf3c9('0x39')]==='user'){var _0x20f803=_0x4f0e96[_0xf3c9('0x11')]({'plain':!![]});var _0x1cd5a0=_0xf3c9('0x12');return db['UserProfileSection'][_0xf3c9('0x37')]({'where':{'name':_0x1cd5a0,'userProfileId':_0x481592[_0xf3c9('0x3a')]},'raw':!![]})[_0xf3c9('0x10')](function(_0x30ea5e){if(_0x30ea5e&&_0x30ea5e[_0xf3c9('0x3b')]===0x0){return db['UserProfileResource']['create']({'name':_0x20f803['name'],'resourceId':_0x20f803['id'],'type':_0x30ea5e['name'],'sectionId':_0x30ea5e['id']},{})[_0xf3c9('0x10')](function(){return _0x4f0e96;});}else{return _0x4f0e96;}})[_0xf3c9('0x33')](function(_0x510b44){logger[_0xf3c9('0x19')](_0xf3c9('0x3c'),_0x510b44);throw _0x510b44;});}return _0x4f0e96;})[_0xf3c9('0x10')](respondWithResult(_0xf1e747,0xc9))[_0xf3c9('0x33')](handleError(_0xf1e747,null));};exports[_0xf3c9('0xf')]=function(_0x3f73a1,_0x1473ed){if(_0x3f73a1[_0xf3c9('0x38')]['id']){delete _0x3f73a1[_0xf3c9('0x38')]['id'];}return db['SquareProject'][_0xf3c9('0x37')]({'where':{'id':_0x3f73a1[_0xf3c9('0x34')]['id']}})[_0xf3c9('0x10')](handleEntityNotFound(_0x1473ed,null))[_0xf3c9('0x10')](saveUpdates(_0x3f73a1[_0xf3c9('0x38')],null))[_0xf3c9('0x10')](function(_0x3d31d5){if(!_0x3d31d5)return;var _0x14e7a6=_0x3d31d5['get']({'plain':!![]});return _0x14e7a6;})[_0xf3c9('0x10')](function(_0x52f056){var _0x1dab2f=new Redis(config[_0xf3c9('0x5')]);_0x1dab2f[_0xf3c9('0x14')]('agi',JSON[_0xf3c9('0x16')](_[_0xf3c9('0x3d')](_0x52f056,['id',_0xf3c9('0x1b'),'production'])));return _0x52f056;})[_0xf3c9('0x10')](respondWithResult(_0x1473ed,null))['catch'](handleError(_0x1473ed,null));};exports[_0xf3c9('0x13')]=function(_0x430302,_0x2f0c4a){return db[_0xf3c9('0x1f')]['find']({'where':{'id':_0x430302['params']['id']}})[_0xf3c9('0x10')](handleEntityNotFound(_0x2f0c4a,null))[_0xf3c9('0x10')](removeEntity(_0x2f0c4a,null))[_0xf3c9('0x33')](handleError(_0x2f0c4a,null));}; \ No newline at end of file +var _0x8d29=['set','update','then','destroy','get','SquareProjects','UserProfileResource','publish','agi','stringify','end','sendStatus','error','name','index','map','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options','includeAll','SquareProject','findAll','catch','show','keys','rawAttributes','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','production','lodash','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','./squareProject.socket','register','status','json','offset','undefined','limit','count'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8d29,0x17e));var _0x98d2=function(_0x543bd0,_0x2ce070){_0x543bd0=_0x543bd0-0x0;var _0x2ed63e=_0x8d29[_0x543bd0];return _0x2ed63e;};'use strict';var _=require(_0x98d2('0x0'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x98d2('0x1'))('api');var config=require(_0x98d2('0x2'));var db=require(_0x98d2('0x3'))['db'];config[_0x98d2('0x4')]=_['defaults'](config[_0x98d2('0x4')],{'host':_0x98d2('0x5'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x98d2('0x4')]));require(_0x98d2('0x6'))[_0x98d2('0x7')](socket);function respondWithResult(_0xe0f5d6,_0x2534b4){_0x2534b4=_0x2534b4||0xc8;return function(_0x232aaa){if(_0x232aaa){return _0xe0f5d6[_0x98d2('0x8')](_0x2534b4)[_0x98d2('0x9')](_0x232aaa);}};}function respondWithFilteredResult(_0x5af689,_0x2a9d7b){return function(_0x4c74d4){if(_0x4c74d4){var _0x6048cc=typeof _0x2a9d7b[_0x98d2('0xa')]===_0x98d2('0xb')&&typeof _0x2a9d7b[_0x98d2('0xc')]===_0x98d2('0xb');var _0x176f26=_0x4c74d4['count'];var _0x4f1dad=_0x6048cc?0x0:_0x2a9d7b[_0x98d2('0xa')];var _0x39e8ff=_0x6048cc?_0x4c74d4[_0x98d2('0xd')]:_0x2a9d7b[_0x98d2('0xa')]+_0x2a9d7b['limit'];var _0x3f972d;if(_0x39e8ff>=_0x176f26){_0x39e8ff=_0x176f26;_0x3f972d=0xc8;}else{_0x3f972d=0xce;}_0x5af689['status'](_0x3f972d);return _0x5af689[_0x98d2('0xe')]('Content-Range',_0x4f1dad+'-'+_0x39e8ff+'/'+_0x176f26)['json'](_0x4c74d4);}return null;};}function saveUpdates(_0x377722){return function(_0x3b49be){if(_0x3b49be){return _0x3b49be[_0x98d2('0xf')](_0x377722)[_0x98d2('0x10')](function(_0x28b34){return _0x28b34;});}return null;};}function removeEntity(_0x4b573d){return function(_0x1ec16e){if(_0x1ec16e){return _0x1ec16e[_0x98d2('0x11')]()[_0x98d2('0x10')](function(){var _0x22ba09=_0x1ec16e[_0x98d2('0x12')]({'plain':!![]});var _0x401304=_0x98d2('0x13');return db[_0x98d2('0x14')][_0x98d2('0x11')]({'where':{'type':_0x401304,'resourceId':_0x22ba09['id']}})[_0x98d2('0x10')](function(){return _0x1ec16e;});})['then'](function(){var _0x483695=new Redis(config['redis']);_0x483695[_0x98d2('0x15')](_0x98d2('0x16'),JSON[_0x98d2('0x17')]({'id':_0x1ec16e['id'],'deleted':!![]}));})[_0x98d2('0x10')](function(){_0x4b573d[_0x98d2('0x8')](0xcc)[_0x98d2('0x18')]();});}};}function handleEntityNotFound(_0x3009d5){return function(_0x310b10){if(!_0x310b10){_0x3009d5[_0x98d2('0x19')](0x194);}return _0x310b10;};}function handleError(_0x3d1875,_0x35c08d){_0x35c08d=_0x35c08d||0x1f4;return function(_0x3de46e){logger[_0x98d2('0x1a')](_0x3de46e['stack']);if(_0x3de46e['name']){delete _0x3de46e[_0x98d2('0x1b')];}_0x3d1875[_0x98d2('0x8')](_0x35c08d)['send'](_0x3de46e);};}exports[_0x98d2('0x1c')]=function(_0x21e33e,_0x30218e){var _0x3ae6a1={},_0x2644f2={},_0x4d1981={'count':0x0,'rows':[]};var _0x27a0c0=_[_0x98d2('0x1d')](db['SquareProject']['rawAttributes'],function(_0x22f115){return{'name':_0x22f115[_0x98d2('0x1e')],'type':_0x22f115[_0x98d2('0x1f')][_0x98d2('0x20')]};});_0x2644f2['model']=_[_0x98d2('0x1d')](_0x27a0c0,'name');_0x2644f2[_0x98d2('0x21')]=_['keys'](_0x21e33e[_0x98d2('0x21')]);_0x2644f2[_0x98d2('0x22')]=_[_0x98d2('0x23')](_0x2644f2[_0x98d2('0x24')],_0x2644f2['query']);_0x3ae6a1[_0x98d2('0x25')]=_['intersection'](_0x2644f2['model'],qs[_0x98d2('0x26')](_0x21e33e[_0x98d2('0x21')][_0x98d2('0x26')]));_0x3ae6a1[_0x98d2('0x25')]=_0x3ae6a1[_0x98d2('0x25')]['length']?_0x3ae6a1[_0x98d2('0x25')]:_0x2644f2[_0x98d2('0x24')];if(!_0x21e33e[_0x98d2('0x21')][_0x98d2('0x27')](_0x98d2('0x28'))){_0x3ae6a1[_0x98d2('0xc')]=qs['limit'](_0x21e33e['query'][_0x98d2('0xc')]);_0x3ae6a1['offset']=qs['offset'](_0x21e33e[_0x98d2('0x21')]['offset']);}_0x3ae6a1[_0x98d2('0x29')]=qs[_0x98d2('0x2a')](_0x21e33e[_0x98d2('0x21')]['sort']);_0x3ae6a1['where']=qs[_0x98d2('0x22')](_[_0x98d2('0x2b')](_0x21e33e['query'],_0x2644f2['filters']),_0x27a0c0);if(_0x21e33e[_0x98d2('0x21')][_0x98d2('0x2c')]){_0x3ae6a1['where']=_[_0x98d2('0x2d')](_0x3ae6a1[_0x98d2('0x2e')],{'$or':_[_0x98d2('0x1d')](_0x27a0c0,function(_0xd961c5){if(_0xd961c5[_0x98d2('0x1f')]!=='VIRTUAL'){var _0x44f82e={};_0x44f82e[_0xd961c5[_0x98d2('0x1b')]]={'$like':'%'+_0x21e33e[_0x98d2('0x21')]['filter']+'%'};return _0x44f82e;}})});}_0x3ae6a1=_[_0x98d2('0x2d')]({},_0x3ae6a1,_0x21e33e[_0x98d2('0x2f')]);var _0x3a194f={'where':_0x3ae6a1[_0x98d2('0x2e')]};return db['SquareProject'][_0x98d2('0xd')](_0x3a194f)[_0x98d2('0x10')](function(_0x36aff5){_0x4d1981[_0x98d2('0xd')]=_0x36aff5;if(_0x21e33e['query'][_0x98d2('0x30')]){_0x3ae6a1['include']=[{'all':!![]}];}return db[_0x98d2('0x31')][_0x98d2('0x32')](_0x3ae6a1);})['then'](function(_0x2f9525){_0x4d1981['rows']=_0x2f9525;return _0x4d1981;})[_0x98d2('0x10')](respondWithFilteredResult(_0x30218e,_0x3ae6a1))[_0x98d2('0x33')](handleError(_0x30218e,null));};exports[_0x98d2('0x34')]=function(_0x386413,_0x159ec0){var _0xfcb1dc={'raw':![],'where':{'id':_0x386413['params']['id']}},_0x3f1deb={};_0x3f1deb[_0x98d2('0x24')]=_[_0x98d2('0x35')](db[_0x98d2('0x31')][_0x98d2('0x36')]);_0x3f1deb['query']=_['keys'](_0x386413['query']);_0x3f1deb[_0x98d2('0x22')]=_[_0x98d2('0x23')](_0x3f1deb[_0x98d2('0x24')],_0x3f1deb['query']);_0xfcb1dc[_0x98d2('0x25')]=_[_0x98d2('0x23')](_0x3f1deb[_0x98d2('0x24')],qs[_0x98d2('0x26')](_0x386413[_0x98d2('0x21')]['fields']));_0xfcb1dc[_0x98d2('0x25')]=_0xfcb1dc['attributes']['length']?_0xfcb1dc[_0x98d2('0x25')]:_0x3f1deb[_0x98d2('0x24')];if(_0x386413['query']['includeAll']){_0xfcb1dc[_0x98d2('0x37')]=[{'all':!![]}];}_0xfcb1dc=_['merge']({},_0xfcb1dc,_0x386413[_0x98d2('0x2f')]);return db['SquareProject']['find'](_0xfcb1dc)[_0x98d2('0x10')](handleEntityNotFound(_0x159ec0,null))[_0x98d2('0x10')](respondWithResult(_0x159ec0,null))[_0x98d2('0x33')](handleError(_0x159ec0,null));};exports[_0x98d2('0x38')]=function(_0x4527ab,_0x2fa0bd){return db[_0x98d2('0x31')][_0x98d2('0x38')](_0x4527ab[_0x98d2('0x39')],{})[_0x98d2('0x10')](function(_0x335d6b){var _0x33db55=_0x4527ab[_0x98d2('0x3a')]['get']({'plain':!![]});if(!_0x33db55)throw new Error(_0x98d2('0x3b'));if(_0x33db55[_0x98d2('0x3c')]==='user'){var _0x5b017a=_0x335d6b[_0x98d2('0x12')]({'plain':!![]});var _0x27340e=_0x98d2('0x13');return db[_0x98d2('0x3d')][_0x98d2('0x3e')]({'where':{'name':_0x27340e,'userProfileId':_0x33db55['userProfileId']},'raw':!![]})[_0x98d2('0x10')](function(_0x51f001){if(_0x51f001&&_0x51f001['autoAssociation']===0x0){return db[_0x98d2('0x14')]['create']({'name':_0x5b017a[_0x98d2('0x1b')],'resourceId':_0x5b017a['id'],'type':_0x51f001[_0x98d2('0x1b')],'sectionId':_0x51f001['id']},{})[_0x98d2('0x10')](function(){return _0x335d6b;});}else{return _0x335d6b;}})[_0x98d2('0x33')](function(_0x2720f5){logger[_0x98d2('0x1a')](_0x98d2('0x3f'),_0x2720f5);throw _0x2720f5;});}return _0x335d6b;})[_0x98d2('0x10')](respondWithResult(_0x2fa0bd,0xc9))[_0x98d2('0x33')](handleError(_0x2fa0bd,null));};exports[_0x98d2('0xf')]=function(_0x2f33f9,_0x20a0f6){if(_0x2f33f9['body']['id']){delete _0x2f33f9['body']['id'];}return db[_0x98d2('0x31')][_0x98d2('0x3e')]({'where':{'id':_0x2f33f9[_0x98d2('0x40')]['id']}})[_0x98d2('0x10')](handleEntityNotFound(_0x20a0f6,null))[_0x98d2('0x10')](saveUpdates(_0x2f33f9[_0x98d2('0x39')],null))['then'](function(_0x21e84b){if(!_0x21e84b)return;var _0x5e40e0=_0x21e84b[_0x98d2('0x12')]({'plain':!![]});return _0x5e40e0;})[_0x98d2('0x10')](function(_0x3e4279){var _0x4a5b6c=new Redis(config[_0x98d2('0x4')]);_0x4a5b6c[_0x98d2('0x15')]('agi',JSON[_0x98d2('0x17')](_[_0x98d2('0x2b')](_0x3e4279,['id','name',_0x98d2('0x41')])));return _0x3e4279;})[_0x98d2('0x10')](respondWithResult(_0x20a0f6,null))[_0x98d2('0x33')](handleError(_0x20a0f6,null));};exports['destroy']=function(_0x298089,_0xff20b7){return db[_0x98d2('0x31')][_0x98d2('0x3e')]({'where':{'id':_0x298089[_0x98d2('0x40')]['id']}})[_0x98d2('0x10')](handleEntityNotFound(_0xff20b7,null))[_0x98d2('0x10')](removeEntity(_0xff20b7,null))['catch'](handleError(_0xff20b7,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index d21c128..77ec8ce 100644 --- a/server/api/squareProject/squareProject.events.js +++ b/server/api/squareProject/squareProject.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdc75=['hook','exports','events','../../mysqldb','SquareProject','setMaxListeners','save','remove','emit'];(function(_0x1bafb1,_0x3f4d43){var _0x1e9aa9=function(_0x34c867){while(--_0x34c867){_0x1bafb1['push'](_0x1bafb1['shift']());}};_0x1e9aa9(++_0x3f4d43);}(_0xdc75,0x80));var _0x5dc7=function(_0x394d6c,_0x30adb1){_0x394d6c=_0x394d6c-0x0;var _0x18df60=_0xdc75[_0x394d6c];return _0x18df60;};'use strict';var EventEmitter=require(_0x5dc7('0x0'));var SquareProject=require(_0x5dc7('0x1'))['db'][_0x5dc7('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x5dc7('0x3')](0x0);var events={'afterCreate':_0x5dc7('0x4'),'afterUpdate':'update','afterDestroy':_0x5dc7('0x5')};function emitEvent(_0x4462f8){return function(_0x1fdbe0,_0x6c8979,_0x4ab778){SquareProjectEvents[_0x5dc7('0x6')](_0x4462f8+':'+_0x1fdbe0['id'],_0x1fdbe0);SquareProjectEvents[_0x5dc7('0x6')](_0x4462f8,_0x1fdbe0);_0x4ab778(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x5dc7('0x7')](e,emitEvent(event));}}module[_0x5dc7('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0xd53e=['remove','emit','hook','events','SquareProject','setMaxListeners','save','update'];(function(_0x5679e5,_0x4e45c9){var _0x34a94=function(_0xda168c){while(--_0xda168c){_0x5679e5['push'](_0x5679e5['shift']());}};_0x34a94(++_0x4e45c9);}(_0xd53e,0x11b));var _0xed53=function(_0x2148dc,_0x1a2df3){_0x2148dc=_0x2148dc-0x0;var _0x302f2f=_0xd53e[_0x2148dc];return _0x302f2f;};'use strict';var EventEmitter=require(_0xed53('0x0'));var SquareProject=require('../../mysqldb')['db'][_0xed53('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xed53('0x2')](0x0);var events={'afterCreate':_0xed53('0x3'),'afterUpdate':_0xed53('0x4'),'afterDestroy':_0xed53('0x5')};function emitEvent(_0x4b31ce){return function(_0x115e8b,_0x35abf0,_0x454f92){SquareProjectEvents[_0xed53('0x6')](_0x4b31ce+':'+_0x115e8b['id'],_0x115e8b);SquareProjectEvents['emit'](_0x4b31ce,_0x115e8b);_0x454f92(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0xed53('0x7')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 8cc6617..3dd58a4 100644 --- a/server/api/squareProject/squareProject.model.js +++ b/server/api/squareProject/squareProject.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9696=['moment','bluebird','path','../../config/environment','./squareProject.attributes','exports','define','square_projects','changed','savedAt','YYYY-MM-DD\x20HH:mm:ss','publishedAt','lodash','../../config/logger','api'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x9696,0x10b));var _0x6969=function(_0x356d92,_0xdd350e){_0x356d92=_0x356d92-0x0;var _0x517e3e=_0x9696[_0x356d92];return _0x517e3e;};'use strict';var _=require(_0x6969('0x0'));var util=require('util');var logger=require(_0x6969('0x1'))(_0x6969('0x2'));var moment=require(_0x6969('0x3'));var BPromise=require(_0x6969('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6969('0x5'));var rimraf=require('rimraf');var config=require(_0x6969('0x6'));var attributes=require(_0x6969('0x7'));module[_0x6969('0x8')]=function(_0x3d864d,_0x4f47af){return _0x3d864d[_0x6969('0x9')]('SquareProject',attributes,{'tableName':_0x6969('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x58a1ce,_0x31e53c,_0xadcf10){if(_0x58a1ce[_0x6969('0xb')]('preproduction')){_0x58a1ce[_0x6969('0xc')]=moment()['format'](_0x6969('0xd'));}if(_0x58a1ce[_0x6969('0xb')]('production')){_0x58a1ce[_0x6969('0xe')]=moment()['format'](_0x6969('0xd'));}_0xadcf10(null,_0x58a1ce);}}});}; \ No newline at end of file +var _0x7df6=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','define','SquareProject','square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','publishedAt','lodash','util'];(function(_0x59c046,_0x3ca395){var _0x2c5f44=function(_0x4f149f){while(--_0x4f149f){_0x59c046['push'](_0x59c046['shift']());}};_0x2c5f44(++_0x3ca395);}(_0x7df6,0xc4));var _0x67df=function(_0x559a80,_0x3d193d){_0x559a80=_0x559a80-0x0;var _0x42f555=_0x7df6[_0x559a80];return _0x42f555;};'use strict';var _=require(_0x67df('0x0'));var util=require(_0x67df('0x1'));var logger=require(_0x67df('0x2'))(_0x67df('0x3'));var moment=require('moment');var BPromise=require(_0x67df('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x67df('0x5'));var rimraf=require(_0x67df('0x6'));var config=require(_0x67df('0x7'));var attributes=require('./squareProject.attributes');module[_0x67df('0x8')]=function(_0xf952f8,_0x50dfb1){return _0xf952f8[_0x67df('0x9')](_0x67df('0xa'),attributes,{'tableName':_0x67df('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x163196,_0x34ef13,_0x3de60b){if(_0x163196[_0x67df('0xc')](_0x67df('0xd'))){_0x163196[_0x67df('0xe')]=moment()[_0x67df('0xf')](_0x67df('0x10'));}if(_0x163196[_0x67df('0xc')]('production')){_0x163196[_0x67df('0x11')]=moment()[_0x67df('0xf')](_0x67df('0x10'));}_0x3de60b(null,_0x163196);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index e3ba141..52a93ed 100644 --- a/server/api/squareProject/squareProject.rpc.js +++ b/server/api/squareProject/squareProject.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb905=['socket.io-emitter','./squareProject.socket','register','SquareProject','findAll','options','raw','where','attributes','limit','include','map','model','then','info','debug','GetSquareProjects','stringify','catch','message','ShowSquareProject','error','../../mysqldb','../../config/logger','rpc','../../config/environment','defaults','redis','localhost'];(function(_0x55c2b6,_0x2eedb1){var _0x4105d3=function(_0x4806cf){while(--_0x4806cf){_0x55c2b6['push'](_0x55c2b6['shift']());}};_0x4105d3(++_0x2eedb1);}(_0xb905,0x8a));var _0x5b90=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0xb905[_0x6cf19c];return _0xce14f3;};'use strict';var _=require('lodash');var Redis=require('ioredis');var db=require(_0x5b90('0x0'))['db'];var logger=require(_0x5b90('0x1'))(_0x5b90('0x2'));var config=require(_0x5b90('0x3'));config['redis']=_[_0x5b90('0x4')](config[_0x5b90('0x5')],{'host':_0x5b90('0x6'),'port':0x18eb});var socket=require(_0x5b90('0x7'))(new Redis(config['redis']));require(_0x5b90('0x8'))[_0x5b90('0x9')](socket);exports['GetSquareProjects']=function(_0x3f65b1){var _0x44399e=this;return new Promise(function(_0x496d86,_0x3c58a0){return db[_0x5b90('0xa')][_0x5b90('0xb')]({'raw':_0x3f65b1[_0x5b90('0xc')]?_0x3f65b1[_0x5b90('0xc')][_0x5b90('0xd')]===undefined?!![]:![]:!![],'where':_0x3f65b1[_0x5b90('0xc')]?_0x3f65b1[_0x5b90('0xc')][_0x5b90('0xe')]||null:null,'attributes':_0x3f65b1[_0x5b90('0xc')]?_0x3f65b1[_0x5b90('0xc')][_0x5b90('0xf')]||null:null,'limit':_0x3f65b1['options']?_0x3f65b1['options'][_0x5b90('0x10')]||null:null,'include':_0x3f65b1[_0x5b90('0xc')]?_0x3f65b1['options'][_0x5b90('0x11')]?_[_0x5b90('0x12')](_0x3f65b1[_0x5b90('0xc')][_0x5b90('0x11')],function(_0x3e7f38){return{'model':db[_0x3e7f38[_0x5b90('0x13')]],'as':_0x3e7f38['as'],'attributes':_0x3e7f38[_0x5b90('0xf')],'include':_0x3e7f38[_0x5b90('0x11')]?_[_0x5b90('0x12')](_0x3e7f38['include'],function(_0x36ef06){return{'model':db[_0x36ef06[_0x5b90('0x13')]],'as':_0x36ef06['as'],'attributes':_0x36ef06[_0x5b90('0xf')],'include':_0x36ef06['include']?_['map'](_0x36ef06['include'],function(_0x4afcbd){return{'model':db[_0x4afcbd[_0x5b90('0x13')]],'as':_0x4afcbd['as'],'attributes':_0x4afcbd[_0x5b90('0xf')]};}):[]};}):[]};}):[]:[]})[_0x5b90('0x14')](function(_0x55dc28){logger[_0x5b90('0x15')]('GetSquareProjects',_0x3f65b1);logger[_0x5b90('0x16')](_0x5b90('0x17'),_0x3f65b1,JSON[_0x5b90('0x18')](_0x55dc28));_0x496d86(_0x55dc28);})[_0x5b90('0x19')](function(_0x3197b3){logger['error'](_0x5b90('0x17'),_0x3197b3[_0x5b90('0x1a')],_0x3f65b1);_0x3c58a0(_0x44399e['error'](0x1f4,_0x3197b3['message']));});});};exports['ShowSquareProject']=function(_0x253290){var _0x404474=this;return new Promise(function(_0x5361a9,_0x813f1){return db['SquareProject']['find']({'raw':_0x253290[_0x5b90('0xc')]?_0x253290[_0x5b90('0xc')][_0x5b90('0xd')]===undefined?!![]:![]:!![],'where':_0x253290[_0x5b90('0xc')]?_0x253290[_0x5b90('0xc')]['where']||null:null,'attributes':_0x253290['options']?_0x253290[_0x5b90('0xc')][_0x5b90('0xf')]||null:null,'include':_0x253290[_0x5b90('0xc')]?_0x253290[_0x5b90('0xc')][_0x5b90('0x11')]?_['map'](_0x253290[_0x5b90('0xc')][_0x5b90('0x11')],function(_0x5bc326){return{'model':db[_0x5bc326['model']],'as':_0x5bc326['as'],'attributes':_0x5bc326[_0x5b90('0xf')],'include':_0x5bc326[_0x5b90('0x11')]?_[_0x5b90('0x12')](_0x5bc326['include'],function(_0x574101){return{'model':db[_0x574101['model']],'as':_0x574101['as'],'attributes':_0x574101['attributes'],'include':_0x574101[_0x5b90('0x11')]?_[_0x5b90('0x12')](_0x574101[_0x5b90('0x11')],function(_0x1e6a6d){return{'model':db[_0x1e6a6d['model']],'as':_0x1e6a6d['as'],'attributes':_0x1e6a6d[_0x5b90('0xf')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x332b7a){logger['info'](_0x5b90('0x1b'),_0x253290);logger[_0x5b90('0x16')](_0x5b90('0x1b'),_0x253290,JSON[_0x5b90('0x18')](_0x332b7a));_0x5361a9(_0x332b7a);})[_0x5b90('0x19')](function(_0x29f372){logger[_0x5b90('0x1c')]('ShowSquareProject',_0x29f372['message'],_0x253290);_0x813f1(_0x404474[_0x5b90('0x1c')](0x1f4,_0x29f372[_0x5b90('0x1a')]));});});}; \ No newline at end of file +var _0x0373=['findAll','options','raw','where','limit','include','attributes','model','map','debug','stringify','error','message','ShowSquareProject','find','info','catch','lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','GetSquareProjects','SquareProject'];(function(_0x5c8fe3,_0x50521e){var _0x4e6cbd=function(_0x2904b1){while(--_0x2904b1){_0x5c8fe3['push'](_0x5c8fe3['shift']());}};_0x4e6cbd(++_0x50521e);}(_0x0373,0x101));var _0x3037=function(_0x53cb54,_0xd9adb6){_0x53cb54=_0x53cb54-0x0;var _0x4e57a6=_0x0373[_0x53cb54];return _0x4e57a6;};'use strict';var _=require(_0x3037('0x0'));var Redis=require(_0x3037('0x1'));var db=require(_0x3037('0x2'))['db'];var logger=require(_0x3037('0x3'))(_0x3037('0x4'));var config=require(_0x3037('0x5'));config[_0x3037('0x6')]=_[_0x3037('0x7')](config['redis'],{'host':_0x3037('0x8'),'port':0x18eb});var socket=require(_0x3037('0x9'))(new Redis(config[_0x3037('0x6')]));require(_0x3037('0xa'))['register'](socket);exports[_0x3037('0xb')]=function(_0x58629d){var _0x507b4d=this;return new Promise(function(_0x5e38ad,_0xff886e){return db[_0x3037('0xc')][_0x3037('0xd')]({'raw':_0x58629d[_0x3037('0xe')]?_0x58629d[_0x3037('0xe')][_0x3037('0xf')]===undefined?!![]:![]:!![],'where':_0x58629d[_0x3037('0xe')]?_0x58629d[_0x3037('0xe')][_0x3037('0x10')]||null:null,'attributes':_0x58629d['options']?_0x58629d[_0x3037('0xe')]['attributes']||null:null,'limit':_0x58629d[_0x3037('0xe')]?_0x58629d[_0x3037('0xe')][_0x3037('0x11')]||null:null,'include':_0x58629d[_0x3037('0xe')]?_0x58629d[_0x3037('0xe')][_0x3037('0x12')]?_['map'](_0x58629d[_0x3037('0xe')]['include'],function(_0xc5ed2a){return{'model':db[_0xc5ed2a['model']],'as':_0xc5ed2a['as'],'attributes':_0xc5ed2a[_0x3037('0x13')],'include':_0xc5ed2a[_0x3037('0x12')]?_['map'](_0xc5ed2a[_0x3037('0x12')],function(_0xa51009){return{'model':db[_0xa51009[_0x3037('0x14')]],'as':_0xa51009['as'],'attributes':_0xa51009[_0x3037('0x13')],'include':_0xa51009[_0x3037('0x12')]?_[_0x3037('0x15')](_0xa51009['include'],function(_0x214f31){return{'model':db[_0x214f31['model']],'as':_0x214f31['as'],'attributes':_0x214f31[_0x3037('0x13')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x274646){logger['info'](_0x3037('0xb'),_0x58629d);logger[_0x3037('0x16')](_0x3037('0xb'),_0x58629d,JSON[_0x3037('0x17')](_0x274646));_0x5e38ad(_0x274646);})['catch'](function(_0x2a8840){logger[_0x3037('0x18')]('GetSquareProjects',_0x2a8840[_0x3037('0x19')],_0x58629d);_0xff886e(_0x507b4d['error'](0x1f4,_0x2a8840['message']));});});};exports[_0x3037('0x1a')]=function(_0xa950ff){var _0x4db233=this;return new Promise(function(_0x566cfd,_0x252d8b){return db['SquareProject'][_0x3037('0x1b')]({'raw':_0xa950ff[_0x3037('0xe')]?_0xa950ff[_0x3037('0xe')][_0x3037('0xf')]===undefined?!![]:![]:!![],'where':_0xa950ff[_0x3037('0xe')]?_0xa950ff[_0x3037('0xe')][_0x3037('0x10')]||null:null,'attributes':_0xa950ff[_0x3037('0xe')]?_0xa950ff['options'][_0x3037('0x13')]||null:null,'include':_0xa950ff[_0x3037('0xe')]?_0xa950ff['options'][_0x3037('0x12')]?_[_0x3037('0x15')](_0xa950ff[_0x3037('0xe')]['include'],function(_0x47d7b6){return{'model':db[_0x47d7b6[_0x3037('0x14')]],'as':_0x47d7b6['as'],'attributes':_0x47d7b6[_0x3037('0x13')],'include':_0x47d7b6[_0x3037('0x12')]?_[_0x3037('0x15')](_0x47d7b6[_0x3037('0x12')],function(_0x3cb5d3){return{'model':db[_0x3cb5d3[_0x3037('0x14')]],'as':_0x3cb5d3['as'],'attributes':_0x3cb5d3[_0x3037('0x13')],'include':_0x3cb5d3['include']?_['map'](_0x3cb5d3[_0x3037('0x12')],function(_0xd63e4a){return{'model':db[_0xd63e4a[_0x3037('0x14')]],'as':_0xd63e4a['as'],'attributes':_0xd63e4a[_0x3037('0x13')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf66936){logger[_0x3037('0x1c')](_0x3037('0x1a'),_0xa950ff);logger['debug'](_0x3037('0x1a'),_0xa950ff,JSON[_0x3037('0x17')](_0xf66936));_0x566cfd(_0xf66936);})[_0x3037('0x1d')](function(_0x2e33f5){logger[_0x3037('0x18')](_0x3037('0x1a'),_0x2e33f5[_0x3037('0x19')],_0xa950ff);_0x252d8b(_0x4db233[_0x3037('0x18')](0x1f4,_0x2e33f5[_0x3037('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 4dbba82..a1fbf03 100644 --- a/server/api/squareProject/squareProject.socket.js +++ b/server/api/squareProject/squareProject.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xccd2=['register','length','squareProject:','save','remove','update','emit'];(function(_0x39bc4a,_0x595147){var _0x436b0d=function(_0x44e6eb){while(--_0x44e6eb){_0x39bc4a['push'](_0x39bc4a['shift']());}};_0x436b0d(++_0x595147);}(_0xccd2,0x114));var _0x2ccd=function(_0x315319,_0x139f0f){_0x315319=_0x315319-0x0;var _0x5563aa=_0xccd2[_0x315319];return _0x5563aa;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x2ccd('0x0'),_0x2ccd('0x1'),_0x2ccd('0x2')];function createListener(_0x5dbed,_0x4a5b9b){return function(_0x14dcc7){_0x4a5b9b[_0x2ccd('0x3')](_0x5dbed,_0x14dcc7);};}function removeListener(_0x60e27b,_0x2b7223){return function(){SquareProjectEvents['removeListener'](_0x60e27b,_0x2b7223);};}exports[_0x2ccd('0x4')]=function(_0x64da75){for(var _0x268208=0x0,_0xbc46c=events[_0x2ccd('0x5')];_0x268208<_0xbc46c;_0x268208++){var _0x942514=events[_0x268208];var _0x3ad0d7=createListener(_0x2ccd('0x6')+_0x942514,_0x64da75);SquareProjectEvents['on'](_0x942514,_0x3ad0d7);}}; \ No newline at end of file +var _0x7e42=['length','save','remove','update','emit','removeListener'];(function(_0x20aadb,_0x5a607a){var _0x520018=function(_0x1d258a){while(--_0x1d258a){_0x20aadb['push'](_0x20aadb['shift']());}};_0x520018(++_0x5a607a);}(_0x7e42,0x1c3));var _0x27e4=function(_0x328466,_0x3355b8){_0x328466=_0x328466-0x0;var _0x466849=_0x7e42[_0x328466];return _0x466849;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x27e4('0x0'),_0x27e4('0x1'),_0x27e4('0x2')];function createListener(_0x33938,_0x58adce){return function(_0x4f58d6){_0x58adce[_0x27e4('0x3')](_0x33938,_0x4f58d6);};}function removeListener(_0x4acb69,_0x5b4802){return function(){SquareProjectEvents[_0x27e4('0x4')](_0x4acb69,_0x5b4802);};}exports['register']=function(_0x2ccdb1){for(var _0x311b41=0x0,_0x94ee53=events[_0x27e4('0x5')];_0x311b41<_0x94ee53;_0x311b41++){var _0x5cfced=events[_0x311b41];var _0x2118ac=createListener('squareProject:'+_0x5cfced,_0x2ccdb1);SquareProjectEvents['on'](_0x5cfced,_0x2118ac);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 997739f..9489da8 100644 --- a/server/api/squareRecording/index.js +++ b/server/api/squareRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7217=['../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x1f6f84,_0x2bab55){var _0x177f40=function(_0x384ab4){while(--_0x384ab4){_0x1f6f84['push'](_0x1f6f84['shift']());}};_0x177f40(++_0x2bab55);}(_0x7217,0x19e));var _0x7721=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x7217[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0xf')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x10')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);router[_0x7721('0x12')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x13')]);module['exports']=router; \ No newline at end of file +var _0x5fab=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','/:id/download','download','create','put','update','delete','destroy','multer','util','connect-timeout'];(function(_0x50a814,_0x2b7f35){var _0x373d00=function(_0x2d7766){while(--_0x2d7766){_0x50a814['push'](_0x50a814['shift']());}};_0x373d00(++_0x2b7f35);}(_0x5fab,0x177));var _0xb5fa=function(_0x15de11,_0x3cd20d){_0x15de11=_0x15de11-0x0;var _0x4f1c07=_0x5fab[_0x15de11];return _0x4f1c07;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var fs_extra=require(_0xb5fa('0x5'));var auth=require(_0xb5fa('0x6'));var interaction=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var controller=require(_0xb5fa('0x9'));router[_0xb5fa('0xa')]('/',auth[_0xb5fa('0xb')](),controller['index']);router['get'](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xd')]);router['get'](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0x11')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router[_0xb5fa('0x13')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 8d6b8b8..1a91e91 100644 --- a/server/api/squareRecording/squareRecording.attributes.js +++ b/server/api/squareRecording/squareRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5d17=['getDataValue','savePath','substring','sequelize','exports','STRING','VIRTUAL'];(function(_0x215733,_0x5c567e){var _0x7f1a5c=function(_0x98bf92){while(--_0x98bf92){_0x215733['push'](_0x215733['shift']());}};_0x7f1a5c(++_0x5c567e);}(_0x5d17,0x114));var _0x75d1=function(_0x1d9163,_0x79567d){_0x1d9163=_0x1d9163-0x0;var _0xb42197=_0x5d17[_0x1d9163];return _0xb42197;};'use strict';var Sequelize=require(_0x75d1('0x0'));module[_0x75d1('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x75d1('0x2')]},'context':{'type':Sequelize[_0x75d1('0x2')]},'extension':{'type':Sequelize[_0x75d1('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x75d1('0x2')]},'dnid':{'type':Sequelize[_0x75d1('0x2')]},'projectName':{'type':Sequelize[_0x75d1('0x2')]},'saveName':{'type':Sequelize[_0x75d1('0x2')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x75d1('0x2')]},'format':{'type':Sequelize[_0x75d1('0x3')],'get':function(){var _0x5c957a='';var _0x1ee61b=this[_0x75d1('0x4')](_0x75d1('0x5'));if(_0x1ee61b){_0x5c957a=_0x1ee61b[_0x75d1('0x6')](_0x1ee61b['lastIndexOf']('.'));}return _0x5c957a;}}}; \ No newline at end of file +var _0x8ef6=['VIRTUAL','savePath','substring','lastIndexOf','sequelize','exports','STRING'];(function(_0x2d1cf5,_0x8212d4){var _0x3edb6e=function(_0x55854e){while(--_0x55854e){_0x2d1cf5['push'](_0x2d1cf5['shift']());}};_0x3edb6e(++_0x8212d4);}(_0x8ef6,0xf2));var _0x68ef=function(_0x2995d,_0x55f9d2){_0x2995d=_0x2995d-0x0;var _0x39c769=_0x8ef6[_0x2995d];return _0x39c769;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'uniqueid':{'type':Sequelize[_0x68ef('0x2')]},'callerid':{'type':Sequelize[_0x68ef('0x2')]},'calleridname':{'type':Sequelize[_0x68ef('0x2')]},'context':{'type':Sequelize[_0x68ef('0x2')]},'extension':{'type':Sequelize[_0x68ef('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x68ef('0x2')]},'dnid':{'type':Sequelize[_0x68ef('0x2')]},'projectName':{'type':Sequelize[_0x68ef('0x2')]},'saveName':{'type':Sequelize[_0x68ef('0x2')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x68ef('0x3')],'get':function(){var _0x4740e8='';var _0x2de776=this['getDataValue'](_0x68ef('0x4'));if(_0x2de776){_0x4740e8=_0x2de776[_0x68ef('0x5')](_0x2de776[_0x68ef('0x6')]('.'));}return _0x4740e8;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 57d6b93..92235d8 100644 --- a/server/api/squareRecording/squareRecording.controller.js +++ b/server/api/squareRecording/squareRecording.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1b0e=['attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','merge','VIRTUAL','filter','options','include','rows','show','params','keys','length','find','create','catch','body','download','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','existsSync','secrets','ValidationError','extname','unlink','message','SquareRecording\x20not\x20found','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','SquareRecording','rawAttributes','fieldName','type','key','model','query','intersection'];(function(_0x549b53,_0x56d9a0){var _0xc54d57=function(_0x4a7a50){while(--_0x4a7a50){_0x549b53['push'](_0x549b53['shift']());}};_0xc54d57(++_0x56d9a0);}(_0x1b0e,0x1b5));var _0xe1b0=function(_0x2bb296,_0x32393e){_0x2bb296=_0x2bb296-0x0;var _0x1f63fe=_0x1b0e[_0x2bb296];return _0x1f63fe;};'use strict';var emlformat=require(_0xe1b0('0x0'));var rimraf=require(_0xe1b0('0x1'));var zipdir=require(_0xe1b0('0x2'));var jsonpatch=require(_0xe1b0('0x3'));var rp=require(_0xe1b0('0x4'));var moment=require(_0xe1b0('0x5'));var BPromise=require(_0xe1b0('0x6'));var Mustache=require(_0xe1b0('0x7'));var util=require(_0xe1b0('0x8'));var path=require(_0xe1b0('0x9'));var sox=require(_0xe1b0('0xa'));var csv=require(_0xe1b0('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe1b0('0xc'));var crypto=require(_0xe1b0('0xd'));var jsforce=require(_0xe1b0('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe1b0('0xb'));var querystring=require('querystring');var Papa=require(_0xe1b0('0xf'));var Redis=require(_0xe1b0('0x10'));var authService=require(_0xe1b0('0x11'));var qs=require(_0xe1b0('0x12'));var as=require(_0xe1b0('0x13'));var hardwareService=require(_0xe1b0('0x14'));var logger=require(_0xe1b0('0x15'))('api');var utils=require(_0xe1b0('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xe1b0('0x17'));var db=require(_0xe1b0('0x18'))['db'];function respondWithStatusCode(_0x1e59aa,_0x1ed4df){_0x1ed4df=_0x1ed4df||0xcc;return function(_0x17b41d){if(_0x17b41d){return _0x1e59aa[_0xe1b0('0x19')](_0x1ed4df);}return _0x1e59aa[_0xe1b0('0x1a')](_0x1ed4df)[_0xe1b0('0x1b')]();};}function respondWithResult(_0x31e716,_0x1849fd){_0x1849fd=_0x1849fd||0xc8;return function(_0x1ce2d3){if(_0x1ce2d3){return _0x31e716['status'](_0x1849fd)[_0xe1b0('0x1c')](_0x1ce2d3);}};}function respondWithFilteredResult(_0xbf0a4c,_0x37c97a){return function(_0x45bde3){if(_0x45bde3){var _0x160f68=typeof _0x37c97a[_0xe1b0('0x1d')]===_0xe1b0('0x1e')&&typeof _0x37c97a[_0xe1b0('0x1f')]==='undefined';var _0x45b1d5=_0x45bde3[_0xe1b0('0x20')];var _0x224ca3=_0x160f68?0x0:_0x37c97a['offset'];var _0x45ff53=_0x160f68?_0x45bde3[_0xe1b0('0x20')]:_0x37c97a[_0xe1b0('0x1d')]+_0x37c97a[_0xe1b0('0x1f')];var _0x2d007e;if(_0x45ff53>=_0x45b1d5){_0x45ff53=_0x45b1d5;_0x2d007e=0xc8;}else{_0x2d007e=0xce;}_0xbf0a4c[_0xe1b0('0x1a')](_0x2d007e);return _0xbf0a4c['set'](_0xe1b0('0x21'),_0x224ca3+'-'+_0x45ff53+'/'+_0x45b1d5)[_0xe1b0('0x1c')](_0x45bde3);}return null;};}function patchUpdates(_0x2752c9){return function(_0x54566c){try{jsonpatch[_0xe1b0('0x22')](_0x54566c,_0x2752c9,!![]);}catch(_0x11682d){return BPromise[_0xe1b0('0x23')](_0x11682d);}return _0x54566c[_0xe1b0('0x24')]();};}function saveUpdates(_0x886b68,_0x5356bc){return function(_0x6f5eed){if(_0x6f5eed){return _0x6f5eed[_0xe1b0('0x25')](_0x886b68)[_0xe1b0('0x26')](function(_0x74cff1){return _0x74cff1;});}return null;};}function removeEntity(_0x9e0373,_0x527e70){return function(_0x1830a0){if(_0x1830a0){return _0x1830a0[_0xe1b0('0x27')]()['then'](function(){_0x9e0373[_0xe1b0('0x1a')](0xcc)[_0xe1b0('0x1b')]();});}};}function handleEntityNotFound(_0x1add70,_0x53339b){return function(_0x72eb4){if(!_0x72eb4){_0x1add70[_0xe1b0('0x19')](0x194);}return _0x72eb4;};}function handleError(_0x3fe415,_0x54d0dc){_0x54d0dc=_0x54d0dc||0x1f4;return function(_0xfee60b){logger[_0xe1b0('0x28')](_0xfee60b['stack']);if(_0xfee60b[_0xe1b0('0x29')]){delete _0xfee60b[_0xe1b0('0x29')];}_0x3fe415[_0xe1b0('0x1a')](_0x54d0dc)[_0xe1b0('0x2a')](_0xfee60b);};}exports[_0xe1b0('0x2b')]=function(_0x260e90,_0x475a72){var _0x569c39={},_0x3d9625={},_0xa63d7b={'count':0x0,'rows':[]};var _0x2c5912=_[_0xe1b0('0x2c')](db[_0xe1b0('0x2d')][_0xe1b0('0x2e')],function(_0x434c19){return{'name':_0x434c19[_0xe1b0('0x2f')],'type':_0x434c19[_0xe1b0('0x30')][_0xe1b0('0x31')]};});_0x3d9625[_0xe1b0('0x32')]=_[_0xe1b0('0x2c')](_0x2c5912,_0xe1b0('0x29'));_0x3d9625[_0xe1b0('0x33')]=_['keys'](_0x260e90[_0xe1b0('0x33')]);_0x3d9625['filters']=_[_0xe1b0('0x34')](_0x3d9625['model'],_0x3d9625[_0xe1b0('0x33')]);_0x569c39[_0xe1b0('0x35')]=_['intersection'](_0x3d9625[_0xe1b0('0x32')],qs[_0xe1b0('0x36')](_0x260e90[_0xe1b0('0x33')][_0xe1b0('0x36')]));_0x569c39[_0xe1b0('0x35')]=_0x569c39[_0xe1b0('0x35')]['length']?_0x569c39['attributes']:_0x3d9625[_0xe1b0('0x32')];if(!_0x260e90['query'][_0xe1b0('0x37')](_0xe1b0('0x38'))){_0x569c39[_0xe1b0('0x1f')]=qs[_0xe1b0('0x1f')](_0x260e90[_0xe1b0('0x33')][_0xe1b0('0x1f')]);_0x569c39[_0xe1b0('0x1d')]=qs[_0xe1b0('0x1d')](_0x260e90['query']['offset']);}_0x569c39['order']=qs['sort'](_0x260e90[_0xe1b0('0x33')][_0xe1b0('0x39')]);_0x569c39[_0xe1b0('0x3a')]=qs['filters'](_[_0xe1b0('0x3b')](_0x260e90[_0xe1b0('0x33')],_0x3d9625[_0xe1b0('0x3c')]),_0x2c5912);if(_0x260e90[_0xe1b0('0x33')]['filter']){_0x569c39[_0xe1b0('0x3a')]=_[_0xe1b0('0x3d')](_0x569c39[_0xe1b0('0x3a')],{'$or':_['map'](_0x2c5912,function(_0x1245e0){if(_0x1245e0[_0xe1b0('0x30')]!==_0xe1b0('0x3e')){var _0x246c37={};_0x246c37[_0x1245e0[_0xe1b0('0x29')]]={'$like':'%'+_0x260e90['query'][_0xe1b0('0x3f')]+'%'};return _0x246c37;}})});}_0x569c39=_[_0xe1b0('0x3d')]({},_0x569c39,_0x260e90[_0xe1b0('0x40')]);var _0x1eba5e={'where':_0x569c39[_0xe1b0('0x3a')]};return db[_0xe1b0('0x2d')]['count'](_0x1eba5e)[_0xe1b0('0x26')](function(_0x86efe2){_0xa63d7b[_0xe1b0('0x20')]=_0x86efe2;if(_0x260e90[_0xe1b0('0x33')]['includeAll']){_0x569c39[_0xe1b0('0x41')]=[{'all':!![]}];}return db['SquareRecording']['findAll'](_0x569c39);})[_0xe1b0('0x26')](function(_0x46d73d){_0xa63d7b[_0xe1b0('0x42')]=_0x46d73d;return _0xa63d7b;})['then'](respondWithFilteredResult(_0x475a72,_0x569c39))['catch'](handleError(_0x475a72,null));};exports[_0xe1b0('0x43')]=function(_0x4c0b8e,_0x585e20){var _0x58ac06={'raw':!![],'where':{'id':_0x4c0b8e[_0xe1b0('0x44')]['id']}},_0x1523e7={};_0x1523e7[_0xe1b0('0x32')]=_[_0xe1b0('0x45')](db[_0xe1b0('0x2d')][_0xe1b0('0x2e')]);_0x1523e7[_0xe1b0('0x33')]=_[_0xe1b0('0x45')](_0x4c0b8e[_0xe1b0('0x33')]);_0x1523e7['filters']=_['intersection'](_0x1523e7[_0xe1b0('0x32')],_0x1523e7[_0xe1b0('0x33')]);_0x58ac06[_0xe1b0('0x35')]=_[_0xe1b0('0x34')](_0x1523e7[_0xe1b0('0x32')],qs[_0xe1b0('0x36')](_0x4c0b8e[_0xe1b0('0x33')]['fields']));_0x58ac06[_0xe1b0('0x35')]=_0x58ac06[_0xe1b0('0x35')][_0xe1b0('0x46')]?_0x58ac06[_0xe1b0('0x35')]:_0x1523e7['model'];if(_0x4c0b8e[_0xe1b0('0x33')]['includeAll']){_0x58ac06[_0xe1b0('0x41')]=[{'all':!![]}];}_0x58ac06=_[_0xe1b0('0x3d')]({},_0x58ac06,_0x4c0b8e[_0xe1b0('0x40')]);return db['SquareRecording'][_0xe1b0('0x47')](_0x58ac06)['then'](handleEntityNotFound(_0x585e20,null))[_0xe1b0('0x26')](respondWithResult(_0x585e20,null))['catch'](handleError(_0x585e20,null));};exports[_0xe1b0('0x48')]=function(_0x51141c,_0xd78c9b){return db['SquareRecording'][_0xe1b0('0x48')](_0x51141c['body'],{})[_0xe1b0('0x26')](respondWithResult(_0xd78c9b,0xc9))[_0xe1b0('0x49')](handleError(_0xd78c9b,null));};exports[_0xe1b0('0x25')]=function(_0x1696f1,_0x5b3cba){if(_0x1696f1[_0xe1b0('0x4a')]['id']){delete _0x1696f1[_0xe1b0('0x4a')]['id'];}return db[_0xe1b0('0x2d')][_0xe1b0('0x47')]({'where':{'id':_0x1696f1['params']['id']}})['then'](handleEntityNotFound(_0x5b3cba,null))[_0xe1b0('0x26')](saveUpdates(_0x1696f1['body'],null))[_0xe1b0('0x26')](respondWithResult(_0x5b3cba,null))['catch'](handleError(_0x5b3cba,null));};exports[_0xe1b0('0x4b')]=function(_0x1e925b,_0x17e0be,_0x20c234){var _0x3ae3c4=require(_0xe1b0('0x4c'));var _0x2803e1=![];var _0x205e58={};if(_0x1e925b['query'][_0xe1b0('0x30')]&&_0x1e925b[_0xe1b0('0x33')][_0xe1b0('0x30')]===_0xe1b0('0x4d')){_0x205e58[_0xe1b0('0x4d')]=_0x1e925b[_0xe1b0('0x44')]['id'];}else{_0x205e58['id']=_0x1e925b[_0xe1b0('0x44')]['id'];}return db['SquareRecording']['find']({'where':_0x205e58,'attributes':['id',_0xe1b0('0x4e'),_0xe1b0('0x4f')],'raw':!![]})[_0xe1b0('0x26')](handleEntityNotFound(_0x17e0be,null))[_0xe1b0('0x26')](function(_0x38aebb){if(_0x38aebb){var _0x17e33b=_0x38aebb[_0xe1b0('0x4e')];var _0x4f613f=util[_0xe1b0('0x50')](_0xe1b0('0x51'),_0x17e33b);if(fs[_0xe1b0('0x52')](_0x4f613f)){_0x2803e1=!![];return _0x3ae3c4['decryptFile'](_0x4f613f,_0x17e33b,config[_0xe1b0('0x53')]['recording'])[_0xe1b0('0x26')](function(){return _0x38aebb;});}return _0x38aebb;}})[_0xe1b0('0x26')](function(_0x12f901){if(_0x12f901){var _0x13d4a1=_0x12f901[_0xe1b0('0x4e')];if(!fs[_0xe1b0('0x52')](_0x13d4a1)){throw new db['Sequelize'][(_0xe1b0('0x54'))]('SquareRecording\x20not\x20found');}if(_0x12f901[_0xe1b0('0x4f')]){return _0x17e0be[_0xe1b0('0x4b')](_0x13d4a1,_0x12f901[_0xe1b0('0x4f')]+path[_0xe1b0('0x55')](_0x13d4a1),function(){if(_0x2803e1){fs[_0xe1b0('0x56')](_0x13d4a1);}});}else{return _0x17e0be['download'](_0x13d4a1,function(_0x32a769){if(_0x2803e1){fs['unlink'](_0x13d4a1);}});}}})[_0xe1b0('0x49')](function(_0x4cff3a){if(_0x4cff3a[_0xe1b0('0x57')]===_0xe1b0('0x58')){_0x17e0be[_0xe1b0('0x1a')](0x194)[_0xe1b0('0x2a')](_0xe1b0('0x59'));}else{return handleError(_0x17e0be,null);}});};exports['destroy']=function(_0x43ce6d,_0x568d9a){return db['SquareRecording'][_0xe1b0('0x47')]({'where':{'id':_0x43ce6d[_0xe1b0('0x44')]['id']}})[_0xe1b0('0x26')](function(_0x2f7c84){if(_[_0xe1b0('0x5a')](_0x2f7c84)){throw new ReferenceError(_0xe1b0('0x5b'));}return _0x2f7c84;})[_0xe1b0('0x26')](function(_0x224804){var _0x1be05b=_0x224804[_0xe1b0('0x4e')];logger[_0xe1b0('0x5c')](_0xe1b0('0x5d'),_0x1be05b);if(!_[_0xe1b0('0x5a')](_0x224804[_0xe1b0('0x4e')])&&fs[_0xe1b0('0x52')](_0x1be05b)){logger[_0xe1b0('0x5c')](_0xe1b0('0x5e')+_0x1be05b+_0xe1b0('0x5f'));fs[_0xe1b0('0x60')](_0x1be05b);}_0x1be05b=_0x1be05b+_0xe1b0('0x61');if(!_[_0xe1b0('0x5a')](_0x224804[_0xe1b0('0x4e')])&&fs[_0xe1b0('0x52')](_0x1be05b)){logger[_0xe1b0('0x5c')](_0xe1b0('0x5e')+_0x1be05b+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xe1b0('0x60')](_0x1be05b);}return _0x224804;})[_0xe1b0('0x26')](function(_0x337cdf){if(!_0x337cdf)throw new InternalError();return _0x337cdf['destroy']();})[_0xe1b0('0x26')](function(){_0x568d9a[_0xe1b0('0x1a')](0xcc)[_0xe1b0('0x1b')]();})['catch'](handleError(_0x568d9a,null));}; \ No newline at end of file +var _0x7c5d=['SquareRecording\x20not\x20found','extname','unlink','message','send','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','end','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','SquareRecording','findAll','rows','catch','show','params','keys','include','find','create','body','download','uniqueid','filename','savePath','format','%s.cypher','existsSync','decryptFile','secrets','Sequelize'];(function(_0x2f523b,_0x35e5b4){var _0x38e3b0=function(_0x16ee1a){while(--_0x16ee1a){_0x2f523b['push'](_0x2f523b['shift']());}};_0x38e3b0(++_0x35e5b4);}(_0x7c5d,0x195));var _0xd7c5=function(_0x512c6e,_0x141437){_0x512c6e=_0x512c6e-0x0;var _0x2e197d=_0x7c5d[_0x512c6e];return _0x2e197d;};'use strict';var emlformat=require(_0xd7c5('0x0'));var rimraf=require(_0xd7c5('0x1'));var zipdir=require(_0xd7c5('0x2'));var jsonpatch=require(_0xd7c5('0x3'));var rp=require(_0xd7c5('0x4'));var moment=require(_0xd7c5('0x5'));var BPromise=require(_0xd7c5('0x6'));var Mustache=require(_0xd7c5('0x7'));var util=require(_0xd7c5('0x8'));var path=require('path');var sox=require(_0xd7c5('0x9'));var csv=require(_0xd7c5('0xa'));var ejs=require(_0xd7c5('0xb'));var fs=require('fs');var fs_extra=require(_0xd7c5('0xc'));var _=require('lodash');var squel=require(_0xd7c5('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd7c5('0xe'));var Papa=require(_0xd7c5('0xf'));var Redis=require(_0xd7c5('0x10'));var authService=require(_0xd7c5('0x11'));var qs=require(_0xd7c5('0x12'));var as=require(_0xd7c5('0x13'));var hardwareService=require(_0xd7c5('0x14'));var logger=require(_0xd7c5('0x15'))('api');var utils=require(_0xd7c5('0x16'));var config=require(_0xd7c5('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xd7c5('0x18'))['db'];function respondWithStatusCode(_0xed5dc4,_0x193ebd){_0x193ebd=_0x193ebd||0xcc;return function(_0x1cfc68){if(_0x1cfc68){return _0xed5dc4[_0xd7c5('0x19')](_0x193ebd);}return _0xed5dc4[_0xd7c5('0x1a')](_0x193ebd)['end']();};}function respondWithResult(_0x507861,_0x4ada10){_0x4ada10=_0x4ada10||0xc8;return function(_0x1dce66){if(_0x1dce66){return _0x507861[_0xd7c5('0x1a')](_0x4ada10)[_0xd7c5('0x1b')](_0x1dce66);}};}function respondWithFilteredResult(_0x24094a,_0x108868){return function(_0x2c8c27){if(_0x2c8c27){var _0x2fb95f=typeof _0x108868[_0xd7c5('0x1c')]===_0xd7c5('0x1d')&&typeof _0x108868[_0xd7c5('0x1e')]===_0xd7c5('0x1d');var _0x394798=_0x2c8c27[_0xd7c5('0x1f')];var _0x10a3a8=_0x2fb95f?0x0:_0x108868[_0xd7c5('0x1c')];var _0x1b8d0f=_0x2fb95f?_0x2c8c27[_0xd7c5('0x1f')]:_0x108868['offset']+_0x108868[_0xd7c5('0x1e')];var _0xa1a142;if(_0x1b8d0f>=_0x394798){_0x1b8d0f=_0x394798;_0xa1a142=0xc8;}else{_0xa1a142=0xce;}_0x24094a[_0xd7c5('0x1a')](_0xa1a142);return _0x24094a['set'](_0xd7c5('0x20'),_0x10a3a8+'-'+_0x1b8d0f+'/'+_0x394798)[_0xd7c5('0x1b')](_0x2c8c27);}return null;};}function patchUpdates(_0x45f06b){return function(_0xdfcec3){try{jsonpatch[_0xd7c5('0x21')](_0xdfcec3,_0x45f06b,!![]);}catch(_0x23caa8){return BPromise[_0xd7c5('0x22')](_0x23caa8);}return _0xdfcec3['save']();};}function saveUpdates(_0x200c67,_0x12f7c5){return function(_0xa5afb4){if(_0xa5afb4){return _0xa5afb4[_0xd7c5('0x23')](_0x200c67)['then'](function(_0x334251){return _0x334251;});}return null;};}function removeEntity(_0x239839,_0x2c4214){return function(_0x1c2b27){if(_0x1c2b27){return _0x1c2b27[_0xd7c5('0x24')]()[_0xd7c5('0x25')](function(){_0x239839[_0xd7c5('0x1a')](0xcc)[_0xd7c5('0x26')]();});}};}function handleEntityNotFound(_0x4dfde2,_0x1ddfcc){return function(_0x2fd555){if(!_0x2fd555){_0x4dfde2[_0xd7c5('0x19')](0x194);}return _0x2fd555;};}function handleError(_0x465862,_0x83c3e9){_0x83c3e9=_0x83c3e9||0x1f4;return function(_0x651cb3){logger['error'](_0x651cb3[_0xd7c5('0x27')]);if(_0x651cb3[_0xd7c5('0x28')]){delete _0x651cb3[_0xd7c5('0x28')];}_0x465862['status'](_0x83c3e9)['send'](_0x651cb3);};}exports[_0xd7c5('0x29')]=function(_0x275dd9,_0x259a76){var _0x96dd6e={},_0x4e80b5={},_0x46f227={'count':0x0,'rows':[]};var _0x1629ea=_['map'](db['SquareRecording'][_0xd7c5('0x2a')],function(_0x32f780){return{'name':_0x32f780[_0xd7c5('0x2b')],'type':_0x32f780[_0xd7c5('0x2c')][_0xd7c5('0x2d')]};});_0x4e80b5[_0xd7c5('0x2e')]=_[_0xd7c5('0x2f')](_0x1629ea,_0xd7c5('0x28'));_0x4e80b5[_0xd7c5('0x30')]=_['keys'](_0x275dd9[_0xd7c5('0x30')]);_0x4e80b5[_0xd7c5('0x31')]=_[_0xd7c5('0x32')](_0x4e80b5[_0xd7c5('0x2e')],_0x4e80b5[_0xd7c5('0x30')]);_0x96dd6e['attributes']=_[_0xd7c5('0x32')](_0x4e80b5[_0xd7c5('0x2e')],qs[_0xd7c5('0x33')](_0x275dd9[_0xd7c5('0x30')][_0xd7c5('0x33')]));_0x96dd6e[_0xd7c5('0x34')]=_0x96dd6e[_0xd7c5('0x34')][_0xd7c5('0x35')]?_0x96dd6e['attributes']:_0x4e80b5[_0xd7c5('0x2e')];if(!_0x275dd9[_0xd7c5('0x30')]['hasOwnProperty'](_0xd7c5('0x36'))){_0x96dd6e[_0xd7c5('0x1e')]=qs[_0xd7c5('0x1e')](_0x275dd9[_0xd7c5('0x30')]['limit']);_0x96dd6e[_0xd7c5('0x1c')]=qs[_0xd7c5('0x1c')](_0x275dd9['query'][_0xd7c5('0x1c')]);}_0x96dd6e[_0xd7c5('0x37')]=qs[_0xd7c5('0x38')](_0x275dd9[_0xd7c5('0x30')][_0xd7c5('0x38')]);_0x96dd6e['where']=qs[_0xd7c5('0x31')](_[_0xd7c5('0x39')](_0x275dd9[_0xd7c5('0x30')],_0x4e80b5['filters']),_0x1629ea);if(_0x275dd9['query']['filter']){_0x96dd6e[_0xd7c5('0x3a')]=_[_0xd7c5('0x3b')](_0x96dd6e[_0xd7c5('0x3a')],{'$or':_[_0xd7c5('0x2f')](_0x1629ea,function(_0x1234ea){if(_0x1234ea[_0xd7c5('0x2c')]!==_0xd7c5('0x3c')){var _0x167291={};_0x167291[_0x1234ea['name']]={'$like':'%'+_0x275dd9[_0xd7c5('0x30')][_0xd7c5('0x3d')]+'%'};return _0x167291;}})});}_0x96dd6e=_[_0xd7c5('0x3b')]({},_0x96dd6e,_0x275dd9[_0xd7c5('0x3e')]);var _0x55cbcc={'where':_0x96dd6e[_0xd7c5('0x3a')]};return db['SquareRecording'][_0xd7c5('0x1f')](_0x55cbcc)[_0xd7c5('0x25')](function(_0x4dc3fe){_0x46f227[_0xd7c5('0x1f')]=_0x4dc3fe;if(_0x275dd9['query'][_0xd7c5('0x3f')]){_0x96dd6e['include']=[{'all':!![]}];}return db[_0xd7c5('0x40')][_0xd7c5('0x41')](_0x96dd6e);})[_0xd7c5('0x25')](function(_0x4c2fb3){_0x46f227[_0xd7c5('0x42')]=_0x4c2fb3;return _0x46f227;})[_0xd7c5('0x25')](respondWithFilteredResult(_0x259a76,_0x96dd6e))[_0xd7c5('0x43')](handleError(_0x259a76,null));};exports[_0xd7c5('0x44')]=function(_0x1522f9,_0x28ffb4){var _0x3370b9={'raw':!![],'where':{'id':_0x1522f9[_0xd7c5('0x45')]['id']}},_0x4ab803={};_0x4ab803[_0xd7c5('0x2e')]=_[_0xd7c5('0x46')](db['SquareRecording'][_0xd7c5('0x2a')]);_0x4ab803[_0xd7c5('0x30')]=_['keys'](_0x1522f9[_0xd7c5('0x30')]);_0x4ab803[_0xd7c5('0x31')]=_[_0xd7c5('0x32')](_0x4ab803[_0xd7c5('0x2e')],_0x4ab803['query']);_0x3370b9[_0xd7c5('0x34')]=_[_0xd7c5('0x32')](_0x4ab803[_0xd7c5('0x2e')],qs[_0xd7c5('0x33')](_0x1522f9[_0xd7c5('0x30')][_0xd7c5('0x33')]));_0x3370b9['attributes']=_0x3370b9[_0xd7c5('0x34')][_0xd7c5('0x35')]?_0x3370b9[_0xd7c5('0x34')]:_0x4ab803[_0xd7c5('0x2e')];if(_0x1522f9[_0xd7c5('0x30')]['includeAll']){_0x3370b9[_0xd7c5('0x47')]=[{'all':!![]}];}_0x3370b9=_[_0xd7c5('0x3b')]({},_0x3370b9,_0x1522f9[_0xd7c5('0x3e')]);return db[_0xd7c5('0x40')][_0xd7c5('0x48')](_0x3370b9)['then'](handleEntityNotFound(_0x28ffb4,null))[_0xd7c5('0x25')](respondWithResult(_0x28ffb4,null))[_0xd7c5('0x43')](handleError(_0x28ffb4,null));};exports[_0xd7c5('0x49')]=function(_0x4b6734,_0x325c5d){return db['SquareRecording']['create'](_0x4b6734[_0xd7c5('0x4a')],{})[_0xd7c5('0x25')](respondWithResult(_0x325c5d,0xc9))[_0xd7c5('0x43')](handleError(_0x325c5d,null));};exports[_0xd7c5('0x23')]=function(_0x52c085,_0x7c1c24){if(_0x52c085[_0xd7c5('0x4a')]['id']){delete _0x52c085[_0xd7c5('0x4a')]['id'];}return db[_0xd7c5('0x40')][_0xd7c5('0x48')]({'where':{'id':_0x52c085[_0xd7c5('0x45')]['id']}})[_0xd7c5('0x25')](handleEntityNotFound(_0x7c1c24,null))[_0xd7c5('0x25')](saveUpdates(_0x52c085[_0xd7c5('0x4a')],null))[_0xd7c5('0x25')](respondWithResult(_0x7c1c24,null))[_0xd7c5('0x43')](handleError(_0x7c1c24,null));};exports[_0xd7c5('0x4b')]=function(_0x4c601a,_0x408aa8,_0x19eb25){var _0x82312c=require('../../components/encryptor');var _0x3560d9=![];var _0x1251a7={};if(_0x4c601a[_0xd7c5('0x30')][_0xd7c5('0x2c')]&&_0x4c601a[_0xd7c5('0x30')][_0xd7c5('0x2c')]===_0xd7c5('0x4c')){_0x1251a7[_0xd7c5('0x4c')]=_0x4c601a[_0xd7c5('0x45')]['id'];}else{_0x1251a7['id']=_0x4c601a[_0xd7c5('0x45')]['id'];}return db[_0xd7c5('0x40')][_0xd7c5('0x48')]({'where':_0x1251a7,'attributes':['id','savePath',_0xd7c5('0x4d')],'raw':!![]})[_0xd7c5('0x25')](handleEntityNotFound(_0x408aa8,null))[_0xd7c5('0x25')](function(_0x4b8978){if(_0x4b8978){var _0x1c028b=_0x4b8978[_0xd7c5('0x4e')];var _0x3113aa=util[_0xd7c5('0x4f')](_0xd7c5('0x50'),_0x1c028b);if(fs[_0xd7c5('0x51')](_0x3113aa)){_0x3560d9=!![];return _0x82312c[_0xd7c5('0x52')](_0x3113aa,_0x1c028b,config[_0xd7c5('0x53')]['recording'])[_0xd7c5('0x25')](function(){return _0x4b8978;});}return _0x4b8978;}})[_0xd7c5('0x25')](function(_0x3e3ba6){if(_0x3e3ba6){var _0x1de64b=_0x3e3ba6[_0xd7c5('0x4e')];if(!fs[_0xd7c5('0x51')](_0x1de64b)){throw new db[(_0xd7c5('0x54'))]['ValidationError'](_0xd7c5('0x55'));}if(_0x3e3ba6[_0xd7c5('0x4d')]){return _0x408aa8[_0xd7c5('0x4b')](_0x1de64b,_0x3e3ba6[_0xd7c5('0x4d')]+path[_0xd7c5('0x56')](_0x1de64b),function(){if(_0x3560d9){fs[_0xd7c5('0x57')](_0x1de64b);}});}else{return _0x408aa8[_0xd7c5('0x4b')](_0x1de64b,function(_0x47bb1e){if(_0x3560d9){fs[_0xd7c5('0x57')](_0x1de64b);}});}}})['catch'](function(_0x86f3bb){if(_0x86f3bb[_0xd7c5('0x58')]===_0xd7c5('0x55')){_0x408aa8[_0xd7c5('0x1a')](0x194)[_0xd7c5('0x59')](_0xd7c5('0x5a'));}else{return handleError(_0x408aa8,null);}});};exports[_0xd7c5('0x24')]=function(_0x5d5898,_0x5f1a10){return db[_0xd7c5('0x40')][_0xd7c5('0x48')]({'where':{'id':_0x5d5898['params']['id']}})[_0xd7c5('0x25')](function(_0x3501fb){if(_[_0xd7c5('0x5b')](_0x3501fb)){throw new ReferenceError(_0xd7c5('0x5c'));}return _0x3501fb;})[_0xd7c5('0x25')](function(_0x424a4c){var _0x5a750c=_0x424a4c[_0xd7c5('0x4e')];logger[_0xd7c5('0x5d')](_0xd7c5('0x5e'),_0x5a750c);if(!_[_0xd7c5('0x5b')](_0x424a4c[_0xd7c5('0x4e')])&&fs[_0xd7c5('0x51')](_0x5a750c)){logger[_0xd7c5('0x5d')](_0xd7c5('0x5f')+_0x5a750c+_0xd7c5('0x60'));fs[_0xd7c5('0x61')](_0x5a750c);}_0x5a750c=_0x5a750c+'.cypher';if(!_[_0xd7c5('0x5b')](_0x424a4c[_0xd7c5('0x4e')])&&fs[_0xd7c5('0x51')](_0x5a750c)){logger[_0xd7c5('0x5d')]('File:\x20\x22'+_0x5a750c+_0xd7c5('0x60'));fs[_0xd7c5('0x61')](_0x5a750c);}return _0x424a4c;})['then'](function(_0x284179){if(!_0x284179)throw new InternalError();return _0x284179['destroy']();})[_0xd7c5('0x25')](function(){_0x5f1a10[_0xd7c5('0x1a')](0xcc)['end']();})[_0xd7c5('0x43')](handleError(_0x5f1a10,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index f6310d2..83b1d7f 100644 --- a/server/api/squareRecording/squareRecording.model.js +++ b/server/api/squareRecording/squareRecording.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x15ef=['request-promise','path','rimraf','./squareRecording.attributes','exports','define','SquareRecording','util','../../config/logger','moment','bluebird'];(function(_0x5659c0,_0x5f2532){var _0x36e3c0=function(_0x247a5f){while(--_0x247a5f){_0x5659c0['push'](_0x5659c0['shift']());}};_0x36e3c0(++_0x5f2532);}(_0x15ef,0x80));var _0xf15e=function(_0x200696,_0x29fbff){_0x200696=_0x200696-0x0;var _0x974349=_0x15ef[_0x200696];return _0x974349;};'use strict';var _=require('lodash');var util=require(_0xf15e('0x0'));var logger=require(_0xf15e('0x1'))('api');var moment=require(_0xf15e('0x2'));var BPromise=require(_0xf15e('0x3'));var rp=require(_0xf15e('0x4'));var fs=require('fs');var path=require(_0xf15e('0x5'));var rimraf=require(_0xf15e('0x6'));var config=require('../../config/environment');var attributes=require(_0xf15e('0x7'));module[_0xf15e('0x8')]=function(_0x5e96b4,_0x5ba863){return _0x5e96b4[_0xf15e('0x9')](_0xf15e('0xa'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x01db=['api','moment','bluebird','path','./squareRecording.attributes','exports','define','SquareRecording','square_recordings','lodash'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x01db,0x171));var _0xb01d=function(_0xa37ba8,_0x921471){_0xa37ba8=_0xa37ba8-0x0;var _0x5b6cba=_0x01db[_0xa37ba8];return _0x5b6cba;};'use strict';var _=require(_0xb01d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb01d('0x1'));var moment=require(_0xb01d('0x2'));var BPromise=require(_0xb01d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb01d('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb01d('0x5'));module[_0xb01d('0x6')]=function(_0x30bddd,_0x30f6b5){return _0x30bddd[_0xb01d('0x7')](_0xb01d('0x8'),attributes,{'tableName':_0xb01d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 0d38f33..16f435c 100644 --- a/server/api/squareRecording/squareRecording.rpc.js +++ b/server/api/squareRecording/squareRecording.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8c97=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request\x20sent','debug','error','code','message','SquareRecording,\x20%s,\x20%s','result','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','then','stringify'];(function(_0x48b6c6,_0xba4073){var _0x1bcc9a=function(_0x581c84){while(--_0x581c84){_0x48b6c6['push'](_0x48b6c6['shift']());}};_0x1bcc9a(++_0xba4073);}(_0x8c97,0x1e6));var _0x78c9=function(_0x5220a1,_0x474db8){_0x5220a1=_0x5220a1-0x0;var _0x2b9bd2=_0x8c97[_0x5220a1];return _0x2b9bd2;};'use strict';var _=require('lodash');var util=require(_0x78c9('0x0'));var moment=require(_0x78c9('0x1'));var BPromise=require(_0x78c9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x78c9('0x3'));var db=require(_0x78c9('0x4'))['db'];var utils=require(_0x78c9('0x5'));var logger=require(_0x78c9('0x6'))(_0x78c9('0x7'));var config=require(_0x78c9('0x8'));var jayson=require(_0x78c9('0x9'));var client=jayson[_0x78c9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xaf0f74,_0x47bc9f,_0x3fcede){return new BPromise(function(_0x5828f3,_0x209e46){return client['request'](_0xaf0f74,_0x3fcede)['then'](function(_0x48e3cd){logger['info']('SquareRecording,\x20%s,\x20%s',_0x47bc9f,_0x78c9('0xb'));logger[_0x78c9('0xc')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x47bc9f,_0x78c9('0xb'),JSON['stringify'](_0x48e3cd));if(_0x48e3cd[_0x78c9('0xd')]){if(_0x48e3cd[_0x78c9('0xd')][_0x78c9('0xe')]===0x1f4){logger[_0x78c9('0xd')]('SquareRecording,\x20%s,\x20%s',_0x47bc9f,_0x48e3cd[_0x78c9('0xd')][_0x78c9('0xf')]);return _0x209e46(_0x48e3cd[_0x78c9('0xd')][_0x78c9('0xf')]);}logger[_0x78c9('0xd')]('SquareRecording,\x20%s,\x20%s',_0x47bc9f,_0x48e3cd[_0x78c9('0xd')][_0x78c9('0xf')]);return _0x5828f3(_0x48e3cd[_0x78c9('0xd')][_0x78c9('0xf')]);}else{logger['info'](_0x78c9('0x10'),_0x47bc9f,_0x78c9('0xb'));_0x5828f3(_0x48e3cd[_0x78c9('0x11')][_0x78c9('0xf')]);}})[_0x78c9('0x12')](function(_0x26f185){logger[_0x78c9('0xd')](_0x78c9('0x10'),_0x47bc9f,_0x26f185);_0x209e46(_0x26f185);});});}exports[_0x78c9('0x13')]=function(_0x28048a){var _0x312d8b=this;return new Promise(function(_0x28bed9,_0x2252c3){return db[_0x78c9('0x14')][_0x78c9('0x15')](_0x28048a[_0x78c9('0x16')],{'raw':_0x28048a[_0x78c9('0x17')]?_0x28048a['options'][_0x78c9('0x18')]===undefined?!![]:![]:!![]})[_0x78c9('0x19')](function(_0xeafb30){logger['info'](_0x78c9('0x13'),_0x28048a);logger['debug'](_0x78c9('0x13'),_0x28048a,JSON[_0x78c9('0x1a')](_0xeafb30));_0x28bed9(_0xeafb30);})['catch'](function(_0x42d1bf){logger[_0x78c9('0xd')](_0x78c9('0x13'),_0x42d1bf[_0x78c9('0xf')],_0x28048a);_0x2252c3(_0x312d8b['error'](0x1f4,_0x42d1bf[_0x78c9('0xf')]));});});}; \ No newline at end of file +var _0x7931=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareRecording','SquareRecording','options','raw','then','lodash','util'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0x7931,0x120));var _0x1793=function(_0x2cd6c6,_0x11de3a){_0x2cd6c6=_0x2cd6c6-0x0;var _0x5ab0b5=_0x7931[_0x2cd6c6];return _0x5ab0b5;};'use strict';var _=require(_0x1793('0x0'));var util=require(_0x1793('0x1'));var moment=require(_0x1793('0x2'));var BPromise=require(_0x1793('0x3'));var rs=require(_0x1793('0x4'));var fs=require('fs');var Redis=require(_0x1793('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1793('0x6'));var logger=require(_0x1793('0x7'))(_0x1793('0x8'));var config=require(_0x1793('0x9'));var jayson=require(_0x1793('0xa'));var client=jayson['client'][_0x1793('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x107007,_0x44da51,_0x3f5591){return new BPromise(function(_0x451c9d,_0x40ea7a){return client[_0x1793('0xc')](_0x107007,_0x3f5591)['then'](function(_0x4dcfb3){logger[_0x1793('0xd')](_0x1793('0xe'),_0x44da51,_0x1793('0xf'));logger[_0x1793('0x10')](_0x1793('0x11'),_0x44da51,_0x1793('0xf'),JSON[_0x1793('0x12')](_0x4dcfb3));if(_0x4dcfb3[_0x1793('0x13')]){if(_0x4dcfb3[_0x1793('0x13')][_0x1793('0x14')]===0x1f4){logger[_0x1793('0x13')](_0x1793('0xe'),_0x44da51,_0x4dcfb3[_0x1793('0x13')][_0x1793('0x15')]);return _0x40ea7a(_0x4dcfb3[_0x1793('0x13')]['message']);}logger[_0x1793('0x13')](_0x1793('0xe'),_0x44da51,_0x4dcfb3['error'][_0x1793('0x15')]);return _0x451c9d(_0x4dcfb3[_0x1793('0x13')][_0x1793('0x15')]);}else{logger[_0x1793('0xd')](_0x1793('0xe'),_0x44da51,_0x1793('0xf'));_0x451c9d(_0x4dcfb3[_0x1793('0x16')][_0x1793('0x15')]);}})[_0x1793('0x17')](function(_0x3d2f03){logger[_0x1793('0x13')]('SquareRecording,\x20%s,\x20%s',_0x44da51,_0x3d2f03);_0x40ea7a(_0x3d2f03);});});}exports[_0x1793('0x18')]=function(_0x2857b6){var _0x883eb5=this;return new Promise(function(_0x219191,_0x2a6c3a){return db[_0x1793('0x19')]['create'](_0x2857b6['body'],{'raw':_0x2857b6[_0x1793('0x1a')]?_0x2857b6['options'][_0x1793('0x1b')]===undefined?!![]:![]:!![]})[_0x1793('0x1c')](function(_0x25cea5){logger[_0x1793('0xd')]('CreateSquareRecording',_0x2857b6);logger['debug'](_0x1793('0x18'),_0x2857b6,JSON[_0x1793('0x12')](_0x25cea5));_0x219191(_0x25cea5);})[_0x1793('0x17')](function(_0x3fb727){logger[_0x1793('0x13')](_0x1793('0x18'),_0x3fb727['message'],_0x2857b6);_0x2a6c3a(_0x883eb5['error'](0x1f4,_0x3fb727[_0x1793('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index d26b36d..03bbd9f 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x1d2a1a,_0x44c78f){var _0x2173c2=function(_0x17ba21){while(--_0x17ba21){_0x1d2a1a['push'](_0x1d2a1a['shift']());}};_0x2173c2(++_0x44c78f);}(_0xb10b,0x12a));var _0xbb10=function(_0x599570,_0x460668){_0x599570=_0x599570-0x0;var _0x3d743f=_0xb10b[_0x599570];return _0x3d743f;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file +var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x4f178a,_0x2fa7eb){var _0x435135=function(_0x59b381){while(--_0x59b381){_0x4f178a['push'](_0x4f178a['shift']());}};_0x435135(++_0x2fa7eb);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index a33a0d6..402490e 100644 --- a/server/api/squareReport/squareReport.attributes.js +++ b/server/api/squareReport/squareReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda59=['DATE','BOOLEAN','sequelize','exports','STRING'];(function(_0x4687c3,_0x27c841){var _0xf055e6=function(_0x39d1f7){while(--_0x39d1f7){_0x4687c3['push'](_0x4687c3['shift']());}};_0xf055e6(++_0x27c841);}(_0xda59,0x66));var _0x9da5=function(_0x5068ef,_0xf0f7c4){_0x5068ef=_0x5068ef-0x0;var _0x41f6d1=_0xda59[_0x5068ef];return _0x41f6d1;};'use strict';var Sequelize=require(_0x9da5('0x0'));module[_0x9da5('0x1')]={'network':{'type':Sequelize[_0x9da5('0x2')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x9da5('0x2')]},'channel':{'type':Sequelize[_0x9da5('0x2')]},'language':{'type':Sequelize[_0x9da5('0x2')]},'type':{'type':Sequelize[_0x9da5('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0x9da5('0x2')]},'callerid':{'type':Sequelize[_0x9da5('0x2')]},'calleridname':{'type':Sequelize[_0x9da5('0x2')]},'callingpres':{'type':Sequelize[_0x9da5('0x2')]},'callingani2':{'type':Sequelize[_0x9da5('0x2')]},'callington':{'type':Sequelize[_0x9da5('0x2')]},'callingtns':{'type':Sequelize[_0x9da5('0x2')]},'dnid':{'type':Sequelize[_0x9da5('0x2')]},'rdnis':{'type':Sequelize[_0x9da5('0x2')]},'context':{'type':Sequelize[_0x9da5('0x2')]},'extension':{'type':Sequelize[_0x9da5('0x2')]},'priority':{'type':Sequelize[_0x9da5('0x2')]},'enhanced':{'type':Sequelize[_0x9da5('0x2')]},'accountcode':{'type':Sequelize[_0x9da5('0x2')]},'threadid':{'type':Sequelize[_0x9da5('0x2')]},'project_name':{'type':Sequelize[_0x9da5('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x9da5('0x3')]},'bot':{'type':Sequelize[_0x9da5('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x4b72=['exports','STRING','DATE','sequelize'];(function(_0x1b931a,_0x2b1010){var _0x2d10aa=function(_0x59fd83){while(--_0x59fd83){_0x1b931a['push'](_0x1b931a['shift']());}};_0x2d10aa(++_0x2b1010);}(_0x4b72,0x10f));var _0x24b7=function(_0x3076b5,_0x6bc9df){_0x3076b5=_0x3076b5-0x0;var _0x5ef5da=_0x4b72[_0x3076b5];return _0x5ef5da;};'use strict';var Sequelize=require(_0x24b7('0x0'));module[_0x24b7('0x1')]={'network':{'type':Sequelize[_0x24b7('0x2')]},'network_script':{'type':Sequelize[_0x24b7('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x24b7('0x2')]},'type':{'type':Sequelize[_0x24b7('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0x24b7('0x2')]},'callerid':{'type':Sequelize[_0x24b7('0x2')]},'calleridname':{'type':Sequelize[_0x24b7('0x2')]},'callingpres':{'type':Sequelize[_0x24b7('0x2')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x24b7('0x2')]},'callingtns':{'type':Sequelize[_0x24b7('0x2')]},'dnid':{'type':Sequelize[_0x24b7('0x2')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x24b7('0x2')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x24b7('0x2')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x24b7('0x3')]},'leaveAt':{'type':Sequelize[_0x24b7('0x3')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 3812579..18e591f 100644 --- a/server/api/squareReport/squareReport.controller.js +++ b/server/api/squareReport/squareReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd00d=['papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','apply','reject','save','update','then','stack','name','send','index','SquareReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','map','merge','includeAll','include','findAll','show','params','options','create','body','catch','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js'];(function(_0x460316,_0x576130){var _0x1f417d=function(_0x41486d){while(--_0x41486d){_0x460316['push'](_0x460316['shift']());}};_0x1f417d(++_0x576130);}(_0xd00d,0xc6));var _0xdd00=function(_0x52b7b9,_0x43ed4b){_0x52b7b9=_0x52b7b9-0x0;var _0x5b5d30=_0xd00d[_0x52b7b9];return _0x5b5d30;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdd00('0x0'));var zipdir=require(_0xdd00('0x1'));var jsonpatch=require(_0xdd00('0x2'));var rp=require(_0xdd00('0x3'));var moment=require(_0xdd00('0x4'));var BPromise=require(_0xdd00('0x5'));var Mustache=require('mustache');var util=require(_0xdd00('0x6'));var path=require(_0xdd00('0x7'));var sox=require(_0xdd00('0x8'));var csv=require(_0xdd00('0x9'));var ejs=require(_0xdd00('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xdd00('0xb'));var crypto=require(_0xdd00('0xc'));var jsforce=require(_0xdd00('0xd'));var deskjs=require(_0xdd00('0xe'));var toCsv=require(_0xdd00('0x9'));var querystring=require('querystring');var Papa=require(_0xdd00('0xf'));var Redis=require('ioredis');var authService=require(_0xdd00('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xdd00('0x11'));var hardwareService=require(_0xdd00('0x12'));var logger=require(_0xdd00('0x13'))('api');var utils=require(_0xdd00('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xdd00('0x15'));var db=require(_0xdd00('0x16'))['db'];function respondWithStatusCode(_0x532134,_0x54bf10){_0x54bf10=_0x54bf10||0xcc;return function(_0x55d782){if(_0x55d782){return _0x532134[_0xdd00('0x17')](_0x54bf10);}return _0x532134[_0xdd00('0x18')](_0x54bf10)[_0xdd00('0x19')]();};}function respondWithResult(_0x27c6fb,_0xf23d31){_0xf23d31=_0xf23d31||0xc8;return function(_0x2bc9ae){if(_0x2bc9ae){return _0x27c6fb['status'](_0xf23d31)['json'](_0x2bc9ae);}};}function respondWithFilteredResult(_0x48fff6,_0x10be43){return function(_0x2f5622){if(_0x2f5622){var _0x5bdd1f=typeof _0x10be43[_0xdd00('0x1a')]==='undefined'&&typeof _0x10be43['limit']===_0xdd00('0x1b');var _0x73aba6=_0x2f5622[_0xdd00('0x1c')];var _0x9ae519=_0x5bdd1f?0x0:_0x10be43[_0xdd00('0x1a')];var _0x449e96=_0x5bdd1f?_0x2f5622[_0xdd00('0x1c')]:_0x10be43[_0xdd00('0x1a')]+_0x10be43[_0xdd00('0x1d')];var _0x1a003c;if(_0x449e96>=_0x73aba6){_0x449e96=_0x73aba6;_0x1a003c=0xc8;}else{_0x1a003c=0xce;}_0x48fff6[_0xdd00('0x18')](_0x1a003c);return _0x48fff6[_0xdd00('0x1e')]('Content-Range',_0x9ae519+'-'+_0x449e96+'/'+_0x73aba6)['json'](_0x2f5622);}return null;};}function patchUpdates(_0x567a2c){return function(_0x55c110){try{jsonpatch[_0xdd00('0x1f')](_0x55c110,_0x567a2c,!![]);}catch(_0x599bda){return BPromise[_0xdd00('0x20')](_0x599bda);}return _0x55c110[_0xdd00('0x21')]();};}function saveUpdates(_0x3c052e,_0x517b19){return function(_0x2b9428){if(_0x2b9428){return _0x2b9428[_0xdd00('0x22')](_0x3c052e)['then'](function(_0x3ddcc4){return _0x3ddcc4;});}return null;};}function removeEntity(_0x4902b2,_0x2bd782){return function(_0x42b8c3){if(_0x42b8c3){return _0x42b8c3['destroy']()[_0xdd00('0x23')](function(){_0x4902b2[_0xdd00('0x18')](0xcc)[_0xdd00('0x19')]();});}};}function handleEntityNotFound(_0x542884,_0x158183){return function(_0x13b2e7){if(!_0x13b2e7){_0x542884['sendStatus'](0x194);}return _0x13b2e7;};}function handleError(_0x41cf5a,_0x5dd7e6){_0x5dd7e6=_0x5dd7e6||0x1f4;return function(_0x40b8b7){logger['error'](_0x40b8b7[_0xdd00('0x24')]);if(_0x40b8b7[_0xdd00('0x25')]){delete _0x40b8b7['name'];}_0x41cf5a[_0xdd00('0x18')](_0x5dd7e6)[_0xdd00('0x26')](_0x40b8b7);};}exports[_0xdd00('0x27')]=function(_0x3d1873,_0x1f4b10){var _0x5d940c={},_0x524a3a={},_0x1832c6={'count':0x0,'rows':[]};var _0x56ee0f=_['map'](db[_0xdd00('0x28')][_0xdd00('0x29')],function(_0x57c007){return{'name':_0x57c007['fieldName'],'type':_0x57c007[_0xdd00('0x2a')][_0xdd00('0x2b')]};});_0x524a3a[_0xdd00('0x2c')]=_['map'](_0x56ee0f,_0xdd00('0x25'));_0x524a3a[_0xdd00('0x2d')]=_[_0xdd00('0x2e')](_0x3d1873[_0xdd00('0x2d')]);_0x524a3a[_0xdd00('0x2f')]=_[_0xdd00('0x30')](_0x524a3a[_0xdd00('0x2c')],_0x524a3a['query']);_0x5d940c[_0xdd00('0x31')]=_[_0xdd00('0x30')](_0x524a3a[_0xdd00('0x2c')],qs[_0xdd00('0x32')](_0x3d1873[_0xdd00('0x2d')][_0xdd00('0x32')]));_0x5d940c[_0xdd00('0x31')]=_0x5d940c[_0xdd00('0x31')][_0xdd00('0x33')]?_0x5d940c[_0xdd00('0x31')]:_0x524a3a[_0xdd00('0x2c')];if(!_0x3d1873['query']['hasOwnProperty'](_0xdd00('0x34'))){_0x5d940c[_0xdd00('0x1d')]=qs[_0xdd00('0x1d')](_0x3d1873[_0xdd00('0x2d')][_0xdd00('0x1d')]);_0x5d940c['offset']=qs[_0xdd00('0x1a')](_0x3d1873[_0xdd00('0x2d')][_0xdd00('0x1a')]);}_0x5d940c[_0xdd00('0x35')]=qs[_0xdd00('0x36')](_0x3d1873['query']['sort']);_0x5d940c['where']=qs['filters'](_[_0xdd00('0x37')](_0x3d1873[_0xdd00('0x2d')],_0x524a3a[_0xdd00('0x2f')]),_0x56ee0f);if(_0x3d1873[_0xdd00('0x2d')][_0xdd00('0x38')]){_0x5d940c[_0xdd00('0x39')]=_['merge'](_0x5d940c[_0xdd00('0x39')],{'$or':_[_0xdd00('0x3a')](_0x56ee0f,function(_0x30977f){if(_0x30977f[_0xdd00('0x2a')]!=='VIRTUAL'){var _0x5a3f84={};_0x5a3f84[_0x30977f[_0xdd00('0x25')]]={'$like':'%'+_0x3d1873['query'][_0xdd00('0x38')]+'%'};return _0x5a3f84;}})});}_0x5d940c=_[_0xdd00('0x3b')]({},_0x5d940c,_0x3d1873['options']);var _0x157afe={'where':_0x5d940c[_0xdd00('0x39')]};return db['SquareReport'][_0xdd00('0x1c')](_0x157afe)[_0xdd00('0x23')](function(_0x1d689c){_0x1832c6[_0xdd00('0x1c')]=_0x1d689c;if(_0x3d1873[_0xdd00('0x2d')][_0xdd00('0x3c')]){_0x5d940c[_0xdd00('0x3d')]=[{'all':!![]}];}return db[_0xdd00('0x28')][_0xdd00('0x3e')](_0x5d940c);})[_0xdd00('0x23')](function(_0xf4a226){_0x1832c6['rows']=_0xf4a226;return _0x1832c6;})[_0xdd00('0x23')](respondWithFilteredResult(_0x1f4b10,_0x5d940c))['catch'](handleError(_0x1f4b10,null));};exports[_0xdd00('0x3f')]=function(_0x540d9e,_0x591fd8){var _0x167db5={'raw':!![],'where':{'id':_0x540d9e[_0xdd00('0x40')]['id']}},_0x4cf7f0={};_0x4cf7f0[_0xdd00('0x2c')]=_['keys'](db['SquareReport'][_0xdd00('0x29')]);_0x4cf7f0['query']=_['keys'](_0x540d9e[_0xdd00('0x2d')]);_0x4cf7f0[_0xdd00('0x2f')]=_['intersection'](_0x4cf7f0[_0xdd00('0x2c')],_0x4cf7f0[_0xdd00('0x2d')]);_0x167db5[_0xdd00('0x31')]=_[_0xdd00('0x30')](_0x4cf7f0['model'],qs['fields'](_0x540d9e['query'][_0xdd00('0x32')]));_0x167db5[_0xdd00('0x31')]=_0x167db5['attributes'][_0xdd00('0x33')]?_0x167db5[_0xdd00('0x31')]:_0x4cf7f0['model'];if(_0x540d9e['query'][_0xdd00('0x3c')]){_0x167db5[_0xdd00('0x3d')]=[{'all':!![]}];}_0x167db5=_['merge']({},_0x167db5,_0x540d9e[_0xdd00('0x41')]);return db[_0xdd00('0x28')]['find'](_0x167db5)[_0xdd00('0x23')](handleEntityNotFound(_0x591fd8,null))[_0xdd00('0x23')](respondWithResult(_0x591fd8,null))['catch'](handleError(_0x591fd8,null));};exports[_0xdd00('0x42')]=function(_0x4ccd53,_0xc76528){return db[_0xdd00('0x28')]['create'](_0x4ccd53[_0xdd00('0x43')],{})[_0xdd00('0x23')](respondWithResult(_0xc76528,0xc9))[_0xdd00('0x44')](handleError(_0xc76528,null));};exports[_0xdd00('0x22')]=function(_0x3704fa,_0x348315){if(_0x3704fa['body']['id']){delete _0x3704fa[_0xdd00('0x43')]['id'];}return db['SquareReport']['find']({'where':{'id':_0x3704fa['params']['id']}})[_0xdd00('0x23')](handleEntityNotFound(_0x348315,null))[_0xdd00('0x23')](saveUpdates(_0x3704fa[_0xdd00('0x43')],null))[_0xdd00('0x23')](respondWithResult(_0x348315,null))[_0xdd00('0x44')](handleError(_0x348315,null));};exports['destroy']=function(_0x49dcf9,_0x2aa983){return db[_0xdd00('0x28')][_0xdd00('0x45')]({'where':{'id':_0x49dcf9[_0xdd00('0x40')]['id']}})[_0xdd00('0x23')](handleEntityNotFound(_0x2aa983,null))['then'](removeEntity(_0x2aa983,null))['catch'](handleError(_0x2aa983,null));};exports[_0xdd00('0x46')]=function(_0x16813d,_0xeb47ba){return db[_0xdd00('0x28')]['describe']()['then'](respondWithResult(_0xeb47ba,null))[_0xdd00('0x44')](handleError(_0xeb47ba,null));}; \ No newline at end of file +var _0x6fe2=['rawAttributes','find','catch','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','apply','reject','save','then','end','error','stack','name','send','index','map','SquareReport','fieldName','type','model','keys','intersection','fields','query','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','params'];(function(_0x335604,_0x3aad45){var _0x3eef3e=function(_0x63e704){while(--_0x63e704){_0x335604['push'](_0x335604['shift']());}};_0x3eef3e(++_0x3aad45);}(_0x6fe2,0x126));var _0x26fe=function(_0x2c8564,_0x21da88){_0x2c8564=_0x2c8564-0x0;var _0x21fd52=_0x6fe2[_0x2c8564];return _0x21fd52;};'use strict';var emlformat=require(_0x26fe('0x0'));var rimraf=require(_0x26fe('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x26fe('0x2'));var rp=require(_0x26fe('0x3'));var moment=require('moment');var BPromise=require(_0x26fe('0x4'));var Mustache=require(_0x26fe('0x5'));var util=require(_0x26fe('0x6'));var path=require(_0x26fe('0x7'));var sox=require(_0x26fe('0x8'));var csv=require(_0x26fe('0x9'));var ejs=require(_0x26fe('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x26fe('0xb'));var squel=require(_0x26fe('0xc'));var crypto=require(_0x26fe('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x26fe('0x9'));var querystring=require(_0x26fe('0xe'));var Papa=require(_0x26fe('0xf'));var Redis=require(_0x26fe('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x26fe('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x26fe('0x12'));var logger=require(_0x26fe('0x13'))(_0x26fe('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x26fe('0x15'));var db=require(_0x26fe('0x16'))['db'];function respondWithStatusCode(_0x1584a8,_0x540cf7){_0x540cf7=_0x540cf7||0xcc;return function(_0x4590b9){if(_0x4590b9){return _0x1584a8[_0x26fe('0x17')](_0x540cf7);}return _0x1584a8[_0x26fe('0x18')](_0x540cf7)['end']();};}function respondWithResult(_0x4a8269,_0x11da97){_0x11da97=_0x11da97||0xc8;return function(_0x476bf2){if(_0x476bf2){return _0x4a8269[_0x26fe('0x18')](_0x11da97)['json'](_0x476bf2);}};}function respondWithFilteredResult(_0x4751dd,_0x3904ee){return function(_0x5db84d){if(_0x5db84d){var _0x13f46a=typeof _0x3904ee[_0x26fe('0x19')]===_0x26fe('0x1a')&&typeof _0x3904ee[_0x26fe('0x1b')]===_0x26fe('0x1a');var _0x12add9=_0x5db84d[_0x26fe('0x1c')];var _0x4b0d61=_0x13f46a?0x0:_0x3904ee[_0x26fe('0x19')];var _0xb684ee=_0x13f46a?_0x5db84d[_0x26fe('0x1c')]:_0x3904ee[_0x26fe('0x19')]+_0x3904ee[_0x26fe('0x1b')];var _0x347d10;if(_0xb684ee>=_0x12add9){_0xb684ee=_0x12add9;_0x347d10=0xc8;}else{_0x347d10=0xce;}_0x4751dd[_0x26fe('0x18')](_0x347d10);return _0x4751dd['set'](_0x26fe('0x1d'),_0x4b0d61+'-'+_0xb684ee+'/'+_0x12add9)['json'](_0x5db84d);}return null;};}function patchUpdates(_0x2395d4){return function(_0x144288){try{jsonpatch[_0x26fe('0x1e')](_0x144288,_0x2395d4,!![]);}catch(_0x1f4a39){return BPromise[_0x26fe('0x1f')](_0x1f4a39);}return _0x144288[_0x26fe('0x20')]();};}function saveUpdates(_0x284796,_0x3ad651){return function(_0x42f3f0){if(_0x42f3f0){return _0x42f3f0['update'](_0x284796)[_0x26fe('0x21')](function(_0x3ae768){return _0x3ae768;});}return null;};}function removeEntity(_0xfc5079,_0xb2402e){return function(_0x312514){if(_0x312514){return _0x312514['destroy']()[_0x26fe('0x21')](function(){_0xfc5079[_0x26fe('0x18')](0xcc)[_0x26fe('0x22')]();});}};}function handleEntityNotFound(_0x4ab12b,_0x19259a){return function(_0x2a2ebc){if(!_0x2a2ebc){_0x4ab12b[_0x26fe('0x17')](0x194);}return _0x2a2ebc;};}function handleError(_0x3420ed,_0x503774){_0x503774=_0x503774||0x1f4;return function(_0x57bc04){logger[_0x26fe('0x23')](_0x57bc04[_0x26fe('0x24')]);if(_0x57bc04[_0x26fe('0x25')]){delete _0x57bc04[_0x26fe('0x25')];}_0x3420ed[_0x26fe('0x18')](_0x503774)[_0x26fe('0x26')](_0x57bc04);};}exports[_0x26fe('0x27')]=function(_0x59df77,_0x1d4c09){var _0x50ea45={},_0x4fc425={},_0x58106a={'count':0x0,'rows':[]};var _0x28200c=_[_0x26fe('0x28')](db[_0x26fe('0x29')]['rawAttributes'],function(_0x2c7d6e){return{'name':_0x2c7d6e[_0x26fe('0x2a')],'type':_0x2c7d6e[_0x26fe('0x2b')]['key']};});_0x4fc425[_0x26fe('0x2c')]=_[_0x26fe('0x28')](_0x28200c,_0x26fe('0x25'));_0x4fc425['query']=_[_0x26fe('0x2d')](_0x59df77['query']);_0x4fc425['filters']=_[_0x26fe('0x2e')](_0x4fc425['model'],_0x4fc425['query']);_0x50ea45['attributes']=_['intersection'](_0x4fc425[_0x26fe('0x2c')],qs[_0x26fe('0x2f')](_0x59df77[_0x26fe('0x30')]['fields']));_0x50ea45[_0x26fe('0x31')]=_0x50ea45[_0x26fe('0x31')][_0x26fe('0x32')]?_0x50ea45[_0x26fe('0x31')]:_0x4fc425[_0x26fe('0x2c')];if(!_0x59df77[_0x26fe('0x30')][_0x26fe('0x33')](_0x26fe('0x34'))){_0x50ea45['limit']=qs[_0x26fe('0x1b')](_0x59df77[_0x26fe('0x30')][_0x26fe('0x1b')]);_0x50ea45[_0x26fe('0x19')]=qs[_0x26fe('0x19')](_0x59df77[_0x26fe('0x30')][_0x26fe('0x19')]);}_0x50ea45[_0x26fe('0x35')]=qs['sort'](_0x59df77[_0x26fe('0x30')][_0x26fe('0x36')]);_0x50ea45[_0x26fe('0x37')]=qs['filters'](_[_0x26fe('0x38')](_0x59df77[_0x26fe('0x30')],_0x4fc425[_0x26fe('0x39')]),_0x28200c);if(_0x59df77[_0x26fe('0x30')][_0x26fe('0x3a')]){_0x50ea45[_0x26fe('0x37')]=_[_0x26fe('0x3b')](_0x50ea45[_0x26fe('0x37')],{'$or':_[_0x26fe('0x28')](_0x28200c,function(_0x397279){if(_0x397279[_0x26fe('0x2b')]!==_0x26fe('0x3c')){var _0x5e561={};_0x5e561[_0x397279[_0x26fe('0x25')]]={'$like':'%'+_0x59df77[_0x26fe('0x30')][_0x26fe('0x3a')]+'%'};return _0x5e561;}})});}_0x50ea45=_[_0x26fe('0x3b')]({},_0x50ea45,_0x59df77[_0x26fe('0x3d')]);var _0x4f56be={'where':_0x50ea45[_0x26fe('0x37')]};return db['SquareReport'][_0x26fe('0x1c')](_0x4f56be)[_0x26fe('0x21')](function(_0x5381a3){_0x58106a['count']=_0x5381a3;if(_0x59df77[_0x26fe('0x30')][_0x26fe('0x3e')]){_0x50ea45[_0x26fe('0x3f')]=[{'all':!![]}];}return db[_0x26fe('0x29')][_0x26fe('0x40')](_0x50ea45);})['then'](function(_0x102acc){_0x58106a['rows']=_0x102acc;return _0x58106a;})['then'](respondWithFilteredResult(_0x1d4c09,_0x50ea45))['catch'](handleError(_0x1d4c09,null));};exports['show']=function(_0x2bc931,_0x5aaf96){var _0x4c1238={'raw':!![],'where':{'id':_0x2bc931[_0x26fe('0x41')]['id']}},_0x5be5dc={};_0x5be5dc[_0x26fe('0x2c')]=_[_0x26fe('0x2d')](db[_0x26fe('0x29')][_0x26fe('0x42')]);_0x5be5dc[_0x26fe('0x30')]=_[_0x26fe('0x2d')](_0x2bc931[_0x26fe('0x30')]);_0x5be5dc['filters']=_['intersection'](_0x5be5dc[_0x26fe('0x2c')],_0x5be5dc[_0x26fe('0x30')]);_0x4c1238['attributes']=_[_0x26fe('0x2e')](_0x5be5dc[_0x26fe('0x2c')],qs[_0x26fe('0x2f')](_0x2bc931[_0x26fe('0x30')]['fields']));_0x4c1238[_0x26fe('0x31')]=_0x4c1238[_0x26fe('0x31')][_0x26fe('0x32')]?_0x4c1238[_0x26fe('0x31')]:_0x5be5dc[_0x26fe('0x2c')];if(_0x2bc931['query'][_0x26fe('0x3e')]){_0x4c1238[_0x26fe('0x3f')]=[{'all':!![]}];}_0x4c1238=_[_0x26fe('0x3b')]({},_0x4c1238,_0x2bc931['options']);return db['SquareReport'][_0x26fe('0x43')](_0x4c1238)[_0x26fe('0x21')](handleEntityNotFound(_0x5aaf96,null))[_0x26fe('0x21')](respondWithResult(_0x5aaf96,null))[_0x26fe('0x44')](handleError(_0x5aaf96,null));};exports[_0x26fe('0x45')]=function(_0x8651e,_0x1f90ae){return db[_0x26fe('0x29')][_0x26fe('0x45')](_0x8651e['body'],{})[_0x26fe('0x21')](respondWithResult(_0x1f90ae,0xc9))[_0x26fe('0x44')](handleError(_0x1f90ae,null));};exports['update']=function(_0x46b5c0,_0x28ea78){if(_0x46b5c0['body']['id']){delete _0x46b5c0[_0x26fe('0x46')]['id'];}return db[_0x26fe('0x29')][_0x26fe('0x43')]({'where':{'id':_0x46b5c0[_0x26fe('0x41')]['id']}})[_0x26fe('0x21')](handleEntityNotFound(_0x28ea78,null))[_0x26fe('0x21')](saveUpdates(_0x46b5c0[_0x26fe('0x46')],null))['then'](respondWithResult(_0x28ea78,null))['catch'](handleError(_0x28ea78,null));};exports['destroy']=function(_0x365d62,_0x511ab6){return db[_0x26fe('0x29')]['find']({'where':{'id':_0x365d62[_0x26fe('0x41')]['id']}})[_0x26fe('0x21')](handleEntityNotFound(_0x511ab6,null))[_0x26fe('0x21')](removeEntity(_0x511ab6,null))[_0x26fe('0x44')](handleError(_0x511ab6,null));};exports[_0x26fe('0x47')]=function(_0x1dcc3f,_0x44c992){return db[_0x26fe('0x29')]['describe']()[_0x26fe('0x21')](respondWithResult(_0x44c992,null))['catch'](handleError(_0x44c992,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 40f59dd..596ed7b 100644 --- a/server/api/squareReport/squareReport.model.js +++ b/server/api/squareReport/squareReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf565=['request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport','uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger','api'];(function(_0x2c971d,_0x2cf295){var _0x25587c=function(_0x1deea5){while(--_0x1deea5){_0x2c971d['push'](_0x2c971d['shift']());}};_0x25587c(++_0x2cf295);}(_0xf565,0xac));var _0x5f56=function(_0x3f2af3,_0x449282){_0x3f2af3=_0x3f2af3-0x0;var _0x27562c=_0xf565[_0x3f2af3];return _0x27562c;};'use strict';var _=require(_0x5f56('0x0'));var util=require(_0x5f56('0x1'));var logger=require(_0x5f56('0x2'))(_0x5f56('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5f56('0x4'));var fs=require('fs');var path=require(_0x5f56('0x5'));var rimraf=require(_0x5f56('0x6'));var config=require(_0x5f56('0x7'));var attributes=require(_0x5f56('0x8'));module[_0x5f56('0x9')]=function(_0x34e8f6,_0x1d67f5){return _0x34e8f6[_0x5f56('0xa')](_0x5f56('0xb'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x5f56('0xc'),'fields':[_0x5f56('0xd'),_0x5f56('0xe')]},{'name':_0x5f56('0xf'),'fields':[_0x5f56('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1ce5=['project_name','leaveAt','lodash','../../config/logger','api','moment','bluebird','rimraf','define','SquareReport','report_square','uid_pname','uniqueid'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1ce5,0x84));var _0x51ce=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x1ce5[_0x4d613c];return _0x301fe3;};'use strict';var _=require(_0x51ce('0x0'));var util=require('util');var logger=require(_0x51ce('0x1'))(_0x51ce('0x2'));var moment=require(_0x51ce('0x3'));var BPromise=require(_0x51ce('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x51ce('0x5'));var config=require('../../config/environment');var attributes=require('./squareReport.attributes');module['exports']=function(_0x131910,_0x9d36e7){return _0x131910[_0x51ce('0x6')](_0x51ce('0x7'),attributes,{'tableName':_0x51ce('0x8'),'paranoid':![],'indexes':[{'name':_0x51ce('0x9'),'fields':[_0x51ce('0xa'),_0x51ce('0xb')]},{'name':_0x51ce('0xc'),'fields':[_0x51ce('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 8da763e..76f39e7 100644 --- a/server/api/squareReport/squareReport.rpc.js +++ b/server/api/squareReport/squareReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0209=['SquareReport,\x20%s,\x20%s,\x20%s','error','SquareReport,\x20%s,\x20%s','message','catch','SquareReport','create','body','options','raw','CreateSquareReport','stringify','UpdateSquareReport','where','attributes','limit','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug'];(function(_0x1290f6,_0x3bf9df){var _0x89158e=function(_0x5eb038){while(--_0x5eb038){_0x1290f6['push'](_0x1290f6['shift']());}};_0x89158e(++_0x3bf9df);}(_0x0209,0x189));var _0x9020=function(_0x1b46a8,_0x27da6d){_0x1b46a8=_0x1b46a8-0x0;var _0x44c92a=_0x0209[_0x1b46a8];return _0x44c92a;};'use strict';var _=require('lodash');var util=require(_0x9020('0x0'));var moment=require(_0x9020('0x1'));var BPromise=require('bluebird');var rs=require(_0x9020('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9020('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9020('0x4'))(_0x9020('0x5'));var config=require(_0x9020('0x6'));var jayson=require(_0x9020('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1ea940,_0x2955f9,_0xd4d050){return new BPromise(function(_0x40e413,_0x5d0954){return client[_0x9020('0x8')](_0x1ea940,_0xd4d050)[_0x9020('0x9')](function(_0x26a3ba){logger[_0x9020('0xa')]('SquareReport,\x20%s,\x20%s',_0x2955f9,_0x9020('0xb'));logger[_0x9020('0xc')](_0x9020('0xd'),_0x2955f9,_0x9020('0xb'),JSON['stringify'](_0x26a3ba));if(_0x26a3ba[_0x9020('0xe')]){if(_0x26a3ba[_0x9020('0xe')]['code']===0x1f4){logger[_0x9020('0xe')](_0x9020('0xf'),_0x2955f9,_0x26a3ba['error'][_0x9020('0x10')]);return _0x5d0954(_0x26a3ba['error'][_0x9020('0x10')]);}logger[_0x9020('0xe')](_0x9020('0xf'),_0x2955f9,_0x26a3ba[_0x9020('0xe')][_0x9020('0x10')]);return _0x40e413(_0x26a3ba['error'][_0x9020('0x10')]);}else{logger[_0x9020('0xa')](_0x9020('0xf'),_0x2955f9,'request\x20sent');_0x40e413(_0x26a3ba['result']['message']);}})[_0x9020('0x11')](function(_0x47d4d1){logger[_0x9020('0xe')](_0x9020('0xf'),_0x2955f9,_0x47d4d1);_0x5d0954(_0x47d4d1);});});}exports['CreateSquareReport']=function(_0xbb92b8){var _0x3d9a98=this;return new Promise(function(_0x579dc9,_0x1f4bc3){return db[_0x9020('0x12')][_0x9020('0x13')](_0xbb92b8[_0x9020('0x14')],{'raw':_0xbb92b8['options']?_0xbb92b8[_0x9020('0x15')][_0x9020('0x16')]===undefined?!![]:![]:!![]})[_0x9020('0x9')](function(_0xb0515c){logger['info'](_0x9020('0x17'),_0xbb92b8);logger[_0x9020('0xc')](_0x9020('0x17'),_0xbb92b8,JSON[_0x9020('0x18')](_0xb0515c));_0x579dc9(_0xb0515c);})[_0x9020('0x11')](function(_0xe5df0b){logger['error']('CreateSquareReport',_0xe5df0b[_0x9020('0x10')],_0xbb92b8);_0x1f4bc3(_0x3d9a98['error'](0x1f4,_0xe5df0b[_0x9020('0x10')]));});});};exports[_0x9020('0x19')]=function(_0x4155c7){var _0x4183a0=this;return new Promise(function(_0x50e6b4,_0x566f89){return db[_0x9020('0x12')]['update'](_0x4155c7['body'],{'raw':_0x4155c7[_0x9020('0x15')]?_0x4155c7['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4155c7['options']?_0x4155c7[_0x9020('0x15')][_0x9020('0x1a')]||null:null,'attributes':_0x4155c7[_0x9020('0x15')]?_0x4155c7[_0x9020('0x15')][_0x9020('0x1b')]||null:null,'limit':_0x4155c7[_0x9020('0x15')]?_0x4155c7[_0x9020('0x15')][_0x9020('0x1c')]||null:null})[_0x9020('0x9')](function(_0x5deeef){logger[_0x9020('0xa')](_0x9020('0x19'),_0x4155c7);logger['debug'](_0x9020('0x19'),_0x4155c7,JSON['stringify'](_0x5deeef));_0x50e6b4(_0x5deeef);})[_0x9020('0x11')](function(_0x45a9f6){logger[_0x9020('0xe')](_0x9020('0x19'),_0x45a9f6[_0x9020('0x10')],_0x4155c7);_0x566f89(_0x4183a0[_0x9020('0xe')](0x1f4,_0x45a9f6['message']));});});}; \ No newline at end of file +var _0xe3aa=['info','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareReport,\x20%s,\x20%s','message','result','catch','CreateSquareReport','SquareReport','create','body','options','raw','UpdateSquareReport','where','attributes','limit','lodash','util','moment','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0xb3e53,_0x2583db){var _0x385233=function(_0x444fe8){while(--_0x444fe8){_0xb3e53['push'](_0xb3e53['shift']());}};_0x385233(++_0x2583db);}(_0xe3aa,0x115));var _0xae3a=function(_0xc0c042,_0x3868f7){_0xc0c042=_0xc0c042-0x0;var _0x4402df=_0xe3aa[_0xc0c042];return _0x4402df;};'use strict';var _=require(_0xae3a('0x0'));var util=require(_0xae3a('0x1'));var moment=require(_0xae3a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xae3a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xae3a('0x4'))(_0xae3a('0x5'));var config=require(_0xae3a('0x6'));var jayson=require(_0xae3a('0x7'));var client=jayson['client'][_0xae3a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x110132,_0x4594e8,_0x83fe87){return new BPromise(function(_0x59b15e,_0x400c3b){return client[_0xae3a('0x9')](_0x110132,_0x83fe87)[_0xae3a('0xa')](function(_0x4b764d){logger[_0xae3a('0xb')]('SquareReport,\x20%s,\x20%s',_0x4594e8,_0xae3a('0xc'));logger[_0xae3a('0xd')](_0xae3a('0xe'),_0x4594e8,_0xae3a('0xc'),JSON[_0xae3a('0xf')](_0x4b764d));if(_0x4b764d[_0xae3a('0x10')]){if(_0x4b764d[_0xae3a('0x10')][_0xae3a('0x11')]===0x1f4){logger['error'](_0xae3a('0x12'),_0x4594e8,_0x4b764d[_0xae3a('0x10')][_0xae3a('0x13')]);return _0x400c3b(_0x4b764d[_0xae3a('0x10')][_0xae3a('0x13')]);}logger[_0xae3a('0x10')]('SquareReport,\x20%s,\x20%s',_0x4594e8,_0x4b764d[_0xae3a('0x10')][_0xae3a('0x13')]);return _0x59b15e(_0x4b764d[_0xae3a('0x10')]['message']);}else{logger[_0xae3a('0xb')](_0xae3a('0x12'),_0x4594e8,_0xae3a('0xc'));_0x59b15e(_0x4b764d[_0xae3a('0x14')][_0xae3a('0x13')]);}})[_0xae3a('0x15')](function(_0x1d0e06){logger[_0xae3a('0x10')]('SquareReport,\x20%s,\x20%s',_0x4594e8,_0x1d0e06);_0x400c3b(_0x1d0e06);});});}exports[_0xae3a('0x16')]=function(_0x35c0af){var _0x4b7bad=this;return new Promise(function(_0x1191b0,_0x1d1efc){return db[_0xae3a('0x17')][_0xae3a('0x18')](_0x35c0af[_0xae3a('0x19')],{'raw':_0x35c0af[_0xae3a('0x1a')]?_0x35c0af[_0xae3a('0x1a')][_0xae3a('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x44b78d){logger['info']('CreateSquareReport',_0x35c0af);logger[_0xae3a('0xd')]('CreateSquareReport',_0x35c0af,JSON[_0xae3a('0xf')](_0x44b78d));_0x1191b0(_0x44b78d);})[_0xae3a('0x15')](function(_0x1ce757){logger[_0xae3a('0x10')](_0xae3a('0x16'),_0x1ce757[_0xae3a('0x13')],_0x35c0af);_0x1d1efc(_0x4b7bad[_0xae3a('0x10')](0x1f4,_0x1ce757['message']));});});};exports[_0xae3a('0x1c')]=function(_0x591166){var _0x2a0ab1=this;return new Promise(function(_0x5578e1,_0xbc2034){return db[_0xae3a('0x17')]['update'](_0x591166[_0xae3a('0x19')],{'raw':_0x591166[_0xae3a('0x1a')]?_0x591166[_0xae3a('0x1a')][_0xae3a('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x591166[_0xae3a('0x1a')]?_0x591166[_0xae3a('0x1a')][_0xae3a('0x1d')]||null:null,'attributes':_0x591166[_0xae3a('0x1a')]?_0x591166[_0xae3a('0x1a')][_0xae3a('0x1e')]||null:null,'limit':_0x591166[_0xae3a('0x1a')]?_0x591166[_0xae3a('0x1a')][_0xae3a('0x1f')]||null:null})['then'](function(_0x29d6e4){logger[_0xae3a('0xb')]('UpdateSquareReport',_0x591166);logger[_0xae3a('0xd')](_0xae3a('0x1c'),_0x591166,JSON[_0xae3a('0xf')](_0x29d6e4));_0x5578e1(_0x29d6e4);})['catch'](function(_0x453129){logger[_0xae3a('0x10')](_0xae3a('0x1c'),_0x453129[_0xae3a('0x13')],_0x591166);_0xbc2034(_0x2a0ab1[_0xae3a('0x10')](0x1f4,_0x453129['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 7b0e69e..c289895 100644 --- a/server/api/squareReportDetail/index.js +++ b/server/api/squareReportDetail/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe083=['isAuthenticated','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','index','describe'];(function(_0x13f9c3,_0x2036c0){var _0x22185a=function(_0x36a7e6){while(--_0x36a7e6){_0x13f9c3['push'](_0x13f9c3['shift']());}};_0x22185a(++_0x2036c0);}(_0xe083,0x179));var _0x3e08=function(_0x502dbe,_0x49af37){_0x502dbe=_0x502dbe-0x0;var _0x49fd5c=_0xe083[_0x502dbe];return _0x49fd5c;};'use strict';var multer=require(_0x3e08('0x0'));var util=require(_0x3e08('0x1'));var path=require(_0x3e08('0x2'));var timeout=require(_0x3e08('0x3'));var express=require(_0x3e08('0x4'));var router=express[_0x3e08('0x5')]();var fs_extra=require(_0x3e08('0x6'));var auth=require(_0x3e08('0x7'));var interaction=require(_0x3e08('0x8'));var config=require(_0x3e08('0x9'));var controller=require(_0x3e08('0xa'));router[_0x3e08('0xb')]('/',auth['isAuthenticated'](),controller[_0x3e08('0xc')]);router[_0x3e08('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x3e08('0xd')]);router[_0x3e08('0xb')]('/:id',auth[_0x3e08('0xe')](),controller['show']);router[_0x3e08('0xf')]('/',auth['isAuthenticated'](),controller[_0x3e08('0x10')]);router[_0x3e08('0x11')](_0x3e08('0x12'),auth[_0x3e08('0xe')](),controller[_0x3e08('0x13')]);router[_0x3e08('0x14')](_0x3e08('0x12'),auth[_0x3e08('0xe')](),controller[_0x3e08('0x15')]);module[_0x3e08('0x16')]=router; \ No newline at end of file +var _0x204e=['./squareReportDetail.controller','isAuthenticated','index','get','show','post','create','/:id','update','delete','multer','util','path','connect-timeout','express','../../components/interaction/service'];(function(_0xfc38d2,_0xf13415){var _0x7ba6f1=function(_0x42b7ab){while(--_0x42b7ab){_0xfc38d2['push'](_0xfc38d2['shift']());}};_0x7ba6f1(++_0xf13415);}(_0x204e,0x16a));var _0xe204=function(_0x5b5fe2,_0x4f4c5c){_0x5b5fe2=_0x5b5fe2-0x0;var _0x526749=_0x204e[_0x5b5fe2];return _0x526749;};'use strict';var multer=require(_0xe204('0x0'));var util=require(_0xe204('0x1'));var path=require(_0xe204('0x2'));var timeout=require(_0xe204('0x3'));var express=require(_0xe204('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe204('0x5'));var config=require('../../config/environment');var controller=require(_0xe204('0x6'));router['get']('/',auth[_0xe204('0x7')](),controller[_0xe204('0x8')]);router[_0xe204('0x9')]('/describe',auth[_0xe204('0x7')](),controller['describe']);router['get']('/:id',auth[_0xe204('0x7')](),controller[_0xe204('0xa')]);router[_0xe204('0xb')]('/',auth[_0xe204('0x7')](),controller[_0xe204('0xc')]);router['put'](_0xe204('0xd'),auth[_0xe204('0x7')](),controller[_0xe204('0xe')]);router[_0xe204('0xf')](_0xe204('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 8e4a523..275b15e 100644 --- a/server/api/squareReportDetail/squareReportDetail.attributes.js +++ b/server/api/squareReportDetail/squareReportDetail.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd697=['TEXT','sequelize','STRING'];(function(_0x359f21,_0x2c0600){var _0x5de42b=function(_0x1242a7){while(--_0x1242a7){_0x359f21['push'](_0x359f21['shift']());}};_0x5de42b(++_0x2c0600);}(_0xd697,0x11b));var _0x7d69=function(_0x3c5fc2,_0x270731){_0x3c5fc2=_0x3c5fc2-0x0;var _0x58ecd8=_0xd697[_0x3c5fc2];return _0x58ecd8;};'use strict';var Sequelize=require(_0x7d69('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x7d69('0x1')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x7d69('0x2')]},'project_name':{'type':Sequelize[_0x7d69('0x1')]},'callerid':{'type':Sequelize[_0x7d69('0x1')]}}; \ No newline at end of file +var _0x1fee=['exports','STRING','sequelize'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x1fee,0x12e));var _0xe1fe=function(_0x2bc581,_0x3a7bd9){_0x2bc581=_0x2bc581-0x0;var _0x25022f=_0x1fee[_0x2bc581];return _0x25022f;};'use strict';var Sequelize=require(_0xe1fe('0x0'));module[_0xe1fe('0x1')]={'uniqueid':{'type':Sequelize[_0xe1fe('0x2')]},'node':{'type':Sequelize[_0xe1fe('0x2')]},'application':{'type':Sequelize[_0xe1fe('0x2')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0xe1fe('0x2')]},'callerid':{'type':Sequelize[_0xe1fe('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 66fbb59..3bc291e 100644 --- a/server/api/squareReportDetail/squareReportDetail.controller.js +++ b/server/api/squareReportDetail/squareReportDetail.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x22e7=['SquareDetailsReport','includeAll','findAll','show','params','include','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','end','status','undefined','count','offset','json','apply','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','where','merge','filter','options'];(function(_0x19b709,_0x373b44){var _0x29eb28=function(_0x4a66c4){while(--_0x4a66c4){_0x19b709['push'](_0x19b709['shift']());}};_0x29eb28(++_0x373b44);}(_0x22e7,0x9d));var _0x722e=function(_0x4048d0,_0x3b7a51){_0x4048d0=_0x4048d0-0x0;var _0x29691=_0x22e7[_0x4048d0];return _0x29691;};'use strict';var emlformat=require(_0x722e('0x0'));var rimraf=require(_0x722e('0x1'));var zipdir=require(_0x722e('0x2'));var jsonpatch=require(_0x722e('0x3'));var rp=require(_0x722e('0x4'));var moment=require('moment');var BPromise=require(_0x722e('0x5'));var Mustache=require(_0x722e('0x6'));var util=require(_0x722e('0x7'));var path=require(_0x722e('0x8'));var sox=require(_0x722e('0x9'));var csv=require(_0x722e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x722e('0xb'));var squel=require(_0x722e('0xc'));var crypto=require(_0x722e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x722e('0xe'));var toCsv=require(_0x722e('0xa'));var querystring=require(_0x722e('0xf'));var Papa=require(_0x722e('0x10'));var Redis=require(_0x722e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x722e('0x12'));var as=require(_0x722e('0x13'));var hardwareService=require(_0x722e('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x722e('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x722e('0x16'))['db'];function respondWithStatusCode(_0x69096b,_0x5bcfc2){_0x5bcfc2=_0x5bcfc2||0xcc;return function(_0x704e58){if(_0x704e58){return _0x69096b[_0x722e('0x17')](_0x5bcfc2);}return _0x69096b['status'](_0x5bcfc2)[_0x722e('0x18')]();};}function respondWithResult(_0x1432cf,_0x1e2495){_0x1e2495=_0x1e2495||0xc8;return function(_0x57693f){if(_0x57693f){return _0x1432cf[_0x722e('0x19')](_0x1e2495)['json'](_0x57693f);}};}function respondWithFilteredResult(_0x410855,_0x1eec0f){return function(_0x22f366){if(_0x22f366){var _0xb4302a=typeof _0x1eec0f['offset']===_0x722e('0x1a')&&typeof _0x1eec0f['limit']===_0x722e('0x1a');var _0xd6dbc0=_0x22f366['count'];var _0x162eb1=_0xb4302a?0x0:_0x1eec0f['offset'];var _0x320c25=_0xb4302a?_0x22f366[_0x722e('0x1b')]:_0x1eec0f[_0x722e('0x1c')]+_0x1eec0f['limit'];var _0x53e90a;if(_0x320c25>=_0xd6dbc0){_0x320c25=_0xd6dbc0;_0x53e90a=0xc8;}else{_0x53e90a=0xce;}_0x410855[_0x722e('0x19')](_0x53e90a);return _0x410855['set']('Content-Range',_0x162eb1+'-'+_0x320c25+'/'+_0xd6dbc0)[_0x722e('0x1d')](_0x22f366);}return null;};}function patchUpdates(_0x275d8c){return function(_0xdfdf12){try{jsonpatch[_0x722e('0x1e')](_0xdfdf12,_0x275d8c,!![]);}catch(_0x7602dd){return BPromise[_0x722e('0x1f')](_0x7602dd);}return _0xdfdf12[_0x722e('0x20')]();};}function saveUpdates(_0x5e971c,_0x259bcb){return function(_0x3b5738){if(_0x3b5738){return _0x3b5738[_0x722e('0x21')](_0x5e971c)[_0x722e('0x22')](function(_0x4ecc13){return _0x4ecc13;});}return null;};}function removeEntity(_0x92d460,_0x33d03b){return function(_0x49da12){if(_0x49da12){return _0x49da12[_0x722e('0x23')]()[_0x722e('0x22')](function(){_0x92d460[_0x722e('0x19')](0xcc)[_0x722e('0x18')]();});}};}function handleEntityNotFound(_0x1f1207,_0x3b1164){return function(_0x4739ca){if(!_0x4739ca){_0x1f1207[_0x722e('0x17')](0x194);}return _0x4739ca;};}function handleError(_0x338912,_0x4ab45f){_0x4ab45f=_0x4ab45f||0x1f4;return function(_0x381a01){logger[_0x722e('0x24')](_0x381a01[_0x722e('0x25')]);if(_0x381a01[_0x722e('0x26')]){delete _0x381a01[_0x722e('0x26')];}_0x338912['status'](_0x4ab45f)['send'](_0x381a01);};}exports[_0x722e('0x27')]=function(_0x1ecedc,_0x5a4af9){var _0xe677c9={},_0x33c6a4={},_0x1657bd={'count':0x0,'rows':[]};var _0x1bcc23=_[_0x722e('0x28')](db['SquareDetailsReport'][_0x722e('0x29')],function(_0x3971e6){return{'name':_0x3971e6['fieldName'],'type':_0x3971e6[_0x722e('0x2a')][_0x722e('0x2b')]};});_0x33c6a4[_0x722e('0x2c')]=_[_0x722e('0x28')](_0x1bcc23,_0x722e('0x26'));_0x33c6a4[_0x722e('0x2d')]=_[_0x722e('0x2e')](_0x1ecedc[_0x722e('0x2d')]);_0x33c6a4[_0x722e('0x2f')]=_[_0x722e('0x30')](_0x33c6a4[_0x722e('0x2c')],_0x33c6a4[_0x722e('0x2d')]);_0xe677c9['attributes']=_[_0x722e('0x30')](_0x33c6a4[_0x722e('0x2c')],qs[_0x722e('0x31')](_0x1ecedc['query'][_0x722e('0x31')]));_0xe677c9[_0x722e('0x32')]=_0xe677c9[_0x722e('0x32')][_0x722e('0x33')]?_0xe677c9['attributes']:_0x33c6a4[_0x722e('0x2c')];if(!_0x1ecedc['query'][_0x722e('0x34')](_0x722e('0x35'))){_0xe677c9['limit']=qs[_0x722e('0x36')](_0x1ecedc[_0x722e('0x2d')][_0x722e('0x36')]);_0xe677c9[_0x722e('0x1c')]=qs['offset'](_0x1ecedc[_0x722e('0x2d')][_0x722e('0x1c')]);}_0xe677c9[_0x722e('0x37')]=qs[_0x722e('0x38')](_0x1ecedc[_0x722e('0x2d')][_0x722e('0x38')]);_0xe677c9['where']=qs[_0x722e('0x2f')](_[_0x722e('0x39')](_0x1ecedc[_0x722e('0x2d')],_0x33c6a4[_0x722e('0x2f')]),_0x1bcc23);if(_0x1ecedc['query']['filter']){_0xe677c9[_0x722e('0x3a')]=_[_0x722e('0x3b')](_0xe677c9['where'],{'$or':_[_0x722e('0x28')](_0x1bcc23,function(_0x52f22b){if(_0x52f22b[_0x722e('0x2a')]!=='VIRTUAL'){var _0x325541={};_0x325541[_0x52f22b[_0x722e('0x26')]]={'$like':'%'+_0x1ecedc[_0x722e('0x2d')][_0x722e('0x3c')]+'%'};return _0x325541;}})});}_0xe677c9=_[_0x722e('0x3b')]({},_0xe677c9,_0x1ecedc[_0x722e('0x3d')]);var _0x29427c={'where':_0xe677c9['where']};return db[_0x722e('0x3e')]['count'](_0x29427c)[_0x722e('0x22')](function(_0x283f25){_0x1657bd['count']=_0x283f25;if(_0x1ecedc[_0x722e('0x2d')][_0x722e('0x3f')]){_0xe677c9['include']=[{'all':!![]}];}return db[_0x722e('0x3e')][_0x722e('0x40')](_0xe677c9);})['then'](function(_0x1b0cfe){_0x1657bd['rows']=_0x1b0cfe;return _0x1657bd;})['then'](respondWithFilteredResult(_0x5a4af9,_0xe677c9))['catch'](handleError(_0x5a4af9,null));};exports[_0x722e('0x41')]=function(_0x34ab80,_0x504b94){var _0x49ad00={'raw':!![],'where':{'id':_0x34ab80[_0x722e('0x42')]['id']}},_0x501dc6={};_0x501dc6['model']=_[_0x722e('0x2e')](db[_0x722e('0x3e')][_0x722e('0x29')]);_0x501dc6[_0x722e('0x2d')]=_[_0x722e('0x2e')](_0x34ab80['query']);_0x501dc6[_0x722e('0x2f')]=_[_0x722e('0x30')](_0x501dc6[_0x722e('0x2c')],_0x501dc6[_0x722e('0x2d')]);_0x49ad00[_0x722e('0x32')]=_[_0x722e('0x30')](_0x501dc6[_0x722e('0x2c')],qs['fields'](_0x34ab80['query'][_0x722e('0x31')]));_0x49ad00[_0x722e('0x32')]=_0x49ad00['attributes'][_0x722e('0x33')]?_0x49ad00[_0x722e('0x32')]:_0x501dc6[_0x722e('0x2c')];if(_0x34ab80['query']['includeAll']){_0x49ad00[_0x722e('0x43')]=[{'all':!![]}];}_0x49ad00=_[_0x722e('0x3b')]({},_0x49ad00,_0x34ab80[_0x722e('0x3d')]);return db['SquareDetailsReport'][_0x722e('0x44')](_0x49ad00)['then'](handleEntityNotFound(_0x504b94,null))[_0x722e('0x22')](respondWithResult(_0x504b94,null))[_0x722e('0x45')](handleError(_0x504b94,null));};exports[_0x722e('0x46')]=function(_0x6840c9,_0x20937a){return db['SquareDetailsReport'][_0x722e('0x46')](_0x6840c9[_0x722e('0x47')],{})[_0x722e('0x22')](respondWithResult(_0x20937a,0xc9))[_0x722e('0x45')](handleError(_0x20937a,null));};exports['update']=function(_0x3675d8,_0xf29f56){if(_0x3675d8['body']['id']){delete _0x3675d8[_0x722e('0x47')]['id'];}return db[_0x722e('0x3e')][_0x722e('0x44')]({'where':{'id':_0x3675d8['params']['id']}})[_0x722e('0x22')](handleEntityNotFound(_0xf29f56,null))[_0x722e('0x22')](saveUpdates(_0x3675d8[_0x722e('0x47')],null))[_0x722e('0x22')](respondWithResult(_0xf29f56,null))[_0x722e('0x45')](handleError(_0xf29f56,null));};exports[_0x722e('0x23')]=function(_0x1d47b2,_0xf8b5b7){return db['SquareDetailsReport'][_0x722e('0x44')]({'where':{'id':_0x1d47b2[_0x722e('0x42')]['id']}})[_0x722e('0x22')](handleEntityNotFound(_0xf8b5b7,null))[_0x722e('0x22')](removeEntity(_0xf8b5b7,null))[_0x722e('0x45')](handleError(_0xf8b5b7,null));};exports[_0x722e('0x48')]=function(_0x1a7069,_0x48e505){return db['SquareDetailsReport']['describe']()[_0x722e('0x22')](respondWithResult(_0x48e505,null))[_0x722e('0x45')](handleError(_0x48e505,null));}; \ No newline at end of file +var _0xd50c=['find','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SquareDetailsReport','includeAll','include','findAll','rows','catch','show','params'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd50c,0x139));var _0xcd50=function(_0x266435,_0x49e9de){_0x266435=_0x266435-0x0;var _0x322f74=_0xd50c[_0x266435];return _0x322f74;};'use strict';var emlformat=require(_0xcd50('0x0'));var rimraf=require(_0xcd50('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcd50('0x2'));var rp=require(_0xcd50('0x3'));var moment=require(_0xcd50('0x4'));var BPromise=require(_0xcd50('0x5'));var Mustache=require('mustache');var util=require(_0xcd50('0x6'));var path=require(_0xcd50('0x7'));var sox=require(_0xcd50('0x8'));var csv=require(_0xcd50('0x9'));var ejs=require(_0xcd50('0xa'));var fs=require('fs');var fs_extra=require(_0xcd50('0xb'));var _=require(_0xcd50('0xc'));var squel=require('squel');var crypto=require(_0xcd50('0xd'));var jsforce=require(_0xcd50('0xe'));var deskjs=require(_0xcd50('0xf'));var toCsv=require(_0xcd50('0x9'));var querystring=require('querystring');var Papa=require(_0xcd50('0x10'));var Redis=require(_0xcd50('0x11'));var authService=require(_0xcd50('0x12'));var qs=require(_0xcd50('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xcd50('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xcd50('0x15'));var db=require(_0xcd50('0x16'))['db'];function respondWithStatusCode(_0x481e4a,_0x3dd895){_0x3dd895=_0x3dd895||0xcc;return function(_0x1915f9){if(_0x1915f9){return _0x481e4a['sendStatus'](_0x3dd895);}return _0x481e4a[_0xcd50('0x17')](_0x3dd895)[_0xcd50('0x18')]();};}function respondWithResult(_0x3cd410,_0x4eb9c3){_0x4eb9c3=_0x4eb9c3||0xc8;return function(_0x57d813){if(_0x57d813){return _0x3cd410[_0xcd50('0x17')](_0x4eb9c3)[_0xcd50('0x19')](_0x57d813);}};}function respondWithFilteredResult(_0x1386c0,_0x485313){return function(_0x41bf63){if(_0x41bf63){var _0x4b0829=typeof _0x485313['offset']==='undefined'&&typeof _0x485313[_0xcd50('0x1a')]==='undefined';var _0x317558=_0x41bf63[_0xcd50('0x1b')];var _0x5eebb8=_0x4b0829?0x0:_0x485313[_0xcd50('0x1c')];var _0x1b27e6=_0x4b0829?_0x41bf63['count']:_0x485313[_0xcd50('0x1c')]+_0x485313[_0xcd50('0x1a')];var _0x5c08c2;if(_0x1b27e6>=_0x317558){_0x1b27e6=_0x317558;_0x5c08c2=0xc8;}else{_0x5c08c2=0xce;}_0x1386c0[_0xcd50('0x17')](_0x5c08c2);return _0x1386c0[_0xcd50('0x1d')](_0xcd50('0x1e'),_0x5eebb8+'-'+_0x1b27e6+'/'+_0x317558)[_0xcd50('0x19')](_0x41bf63);}return null;};}function patchUpdates(_0x423f68){return function(_0x2b0b98){try{jsonpatch[_0xcd50('0x1f')](_0x2b0b98,_0x423f68,!![]);}catch(_0x1de436){return BPromise[_0xcd50('0x20')](_0x1de436);}return _0x2b0b98[_0xcd50('0x21')]();};}function saveUpdates(_0x1275fc,_0x2d5c88){return function(_0x4e30c4){if(_0x4e30c4){return _0x4e30c4[_0xcd50('0x22')](_0x1275fc)[_0xcd50('0x23')](function(_0x1425e2){return _0x1425e2;});}return null;};}function removeEntity(_0x598f4f,_0x1958a2){return function(_0x741d67){if(_0x741d67){return _0x741d67['destroy']()[_0xcd50('0x23')](function(){_0x598f4f[_0xcd50('0x17')](0xcc)[_0xcd50('0x18')]();});}};}function handleEntityNotFound(_0x3ee3a4,_0xdad0ad){return function(_0x346949){if(!_0x346949){_0x3ee3a4[_0xcd50('0x24')](0x194);}return _0x346949;};}function handleError(_0x3721c4,_0x9ea5a9){_0x9ea5a9=_0x9ea5a9||0x1f4;return function(_0x14f5a2){logger[_0xcd50('0x25')](_0x14f5a2[_0xcd50('0x26')]);if(_0x14f5a2[_0xcd50('0x27')]){delete _0x14f5a2[_0xcd50('0x27')];}_0x3721c4[_0xcd50('0x17')](_0x9ea5a9)[_0xcd50('0x28')](_0x14f5a2);};}exports[_0xcd50('0x29')]=function(_0x1e6a15,_0x442602){var _0x824841={},_0x2a0df={},_0x1d49b4={'count':0x0,'rows':[]};var _0x4d5734=_[_0xcd50('0x2a')](db['SquareDetailsReport'][_0xcd50('0x2b')],function(_0x2f57b1){return{'name':_0x2f57b1[_0xcd50('0x2c')],'type':_0x2f57b1[_0xcd50('0x2d')]['key']};});_0x2a0df['model']=_[_0xcd50('0x2a')](_0x4d5734,_0xcd50('0x27'));_0x2a0df['query']=_[_0xcd50('0x2e')](_0x1e6a15[_0xcd50('0x2f')]);_0x2a0df[_0xcd50('0x30')]=_[_0xcd50('0x31')](_0x2a0df[_0xcd50('0x32')],_0x2a0df[_0xcd50('0x2f')]);_0x824841[_0xcd50('0x33')]=_[_0xcd50('0x31')](_0x2a0df[_0xcd50('0x32')],qs[_0xcd50('0x34')](_0x1e6a15[_0xcd50('0x2f')][_0xcd50('0x34')]));_0x824841['attributes']=_0x824841[_0xcd50('0x33')][_0xcd50('0x35')]?_0x824841['attributes']:_0x2a0df['model'];if(!_0x1e6a15[_0xcd50('0x2f')][_0xcd50('0x36')](_0xcd50('0x37'))){_0x824841[_0xcd50('0x1a')]=qs[_0xcd50('0x1a')](_0x1e6a15[_0xcd50('0x2f')][_0xcd50('0x1a')]);_0x824841['offset']=qs[_0xcd50('0x1c')](_0x1e6a15[_0xcd50('0x2f')][_0xcd50('0x1c')]);}_0x824841[_0xcd50('0x38')]=qs[_0xcd50('0x39')](_0x1e6a15[_0xcd50('0x2f')][_0xcd50('0x39')]);_0x824841[_0xcd50('0x3a')]=qs[_0xcd50('0x30')](_[_0xcd50('0x3b')](_0x1e6a15[_0xcd50('0x2f')],_0x2a0df[_0xcd50('0x30')]),_0x4d5734);if(_0x1e6a15[_0xcd50('0x2f')][_0xcd50('0x3c')]){_0x824841[_0xcd50('0x3a')]=_[_0xcd50('0x3d')](_0x824841['where'],{'$or':_[_0xcd50('0x2a')](_0x4d5734,function(_0x5c4fad){if(_0x5c4fad[_0xcd50('0x2d')]!==_0xcd50('0x3e')){var _0x30ab77={};_0x30ab77[_0x5c4fad[_0xcd50('0x27')]]={'$like':'%'+_0x1e6a15['query'][_0xcd50('0x3c')]+'%'};return _0x30ab77;}})});}_0x824841=_[_0xcd50('0x3d')]({},_0x824841,_0x1e6a15[_0xcd50('0x3f')]);var _0x1376f5={'where':_0x824841[_0xcd50('0x3a')]};return db[_0xcd50('0x40')][_0xcd50('0x1b')](_0x1376f5)[_0xcd50('0x23')](function(_0x11fe16){_0x1d49b4[_0xcd50('0x1b')]=_0x11fe16;if(_0x1e6a15['query'][_0xcd50('0x41')]){_0x824841[_0xcd50('0x42')]=[{'all':!![]}];}return db[_0xcd50('0x40')][_0xcd50('0x43')](_0x824841);})['then'](function(_0x266f34){_0x1d49b4[_0xcd50('0x44')]=_0x266f34;return _0x1d49b4;})[_0xcd50('0x23')](respondWithFilteredResult(_0x442602,_0x824841))[_0xcd50('0x45')](handleError(_0x442602,null));};exports[_0xcd50('0x46')]=function(_0x1212ab,_0x1baaaf){var _0x3eeec1={'raw':!![],'where':{'id':_0x1212ab[_0xcd50('0x47')]['id']}},_0x41663d={};_0x41663d[_0xcd50('0x32')]=_[_0xcd50('0x2e')](db[_0xcd50('0x40')]['rawAttributes']);_0x41663d[_0xcd50('0x2f')]=_[_0xcd50('0x2e')](_0x1212ab[_0xcd50('0x2f')]);_0x41663d[_0xcd50('0x30')]=_['intersection'](_0x41663d[_0xcd50('0x32')],_0x41663d[_0xcd50('0x2f')]);_0x3eeec1[_0xcd50('0x33')]=_[_0xcd50('0x31')](_0x41663d[_0xcd50('0x32')],qs[_0xcd50('0x34')](_0x1212ab[_0xcd50('0x2f')][_0xcd50('0x34')]));_0x3eeec1[_0xcd50('0x33')]=_0x3eeec1[_0xcd50('0x33')][_0xcd50('0x35')]?_0x3eeec1['attributes']:_0x41663d[_0xcd50('0x32')];if(_0x1212ab['query'][_0xcd50('0x41')]){_0x3eeec1[_0xcd50('0x42')]=[{'all':!![]}];}_0x3eeec1=_['merge']({},_0x3eeec1,_0x1212ab['options']);return db[_0xcd50('0x40')][_0xcd50('0x48')](_0x3eeec1)[_0xcd50('0x23')](handleEntityNotFound(_0x1baaaf,null))['then'](respondWithResult(_0x1baaaf,null))[_0xcd50('0x45')](handleError(_0x1baaaf,null));};exports['create']=function(_0x43d790,_0x3ea7d9){return db[_0xcd50('0x40')][_0xcd50('0x49')](_0x43d790[_0xcd50('0x4a')],{})['then'](respondWithResult(_0x3ea7d9,0xc9))[_0xcd50('0x45')](handleError(_0x3ea7d9,null));};exports['update']=function(_0x102f3f,_0x44b0b9){if(_0x102f3f['body']['id']){delete _0x102f3f['body']['id'];}return db[_0xcd50('0x40')]['find']({'where':{'id':_0x102f3f['params']['id']}})[_0xcd50('0x23')](handleEntityNotFound(_0x44b0b9,null))['then'](saveUpdates(_0x102f3f['body'],null))[_0xcd50('0x23')](respondWithResult(_0x44b0b9,null))[_0xcd50('0x45')](handleError(_0x44b0b9,null));};exports[_0xcd50('0x4b')]=function(_0x517ed9,_0x3b04df){return db[_0xcd50('0x40')][_0xcd50('0x48')]({'where':{'id':_0x517ed9[_0xcd50('0x47')]['id']}})[_0xcd50('0x23')](handleEntityNotFound(_0x3b04df,null))['then'](removeEntity(_0x3b04df,null))['catch'](handleError(_0x3b04df,null));};exports[_0xcd50('0x4c')]=function(_0x13ab56,_0x2f27aa){return db[_0xcd50('0x40')][_0xcd50('0x4c')]()[_0xcd50('0x23')](respondWithResult(_0x2f27aa,null))['catch'](handleError(_0x2f27aa,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 56dd6db..8993416 100644 --- a/server/api/squareReportDetail/squareReportDetail.model.js +++ b/server/api/squareReportDetail/squareReportDetail.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1711=['rimraf','./squareReportDetail.attributes','exports','define','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x1711,0x138));var _0x1171=function(_0x5ad013,_0x5259f1){_0x5ad013=_0x5ad013-0x0;var _0x246997=_0x1711[_0x5ad013];return _0x246997;};'use strict';var _=require(_0x1171('0x0'));var util=require(_0x1171('0x1'));var logger=require('../../config/logger')(_0x1171('0x2'));var moment=require(_0x1171('0x3'));var BPromise=require(_0x1171('0x4'));var rp=require(_0x1171('0x5'));var fs=require('fs');var path=require(_0x1171('0x6'));var rimraf=require(_0x1171('0x7'));var config=require('../../config/environment');var attributes=require(_0x1171('0x8'));module[_0x1171('0x9')]=function(_0x392877,_0x333464){return _0x392877[_0x1171('0xa')]('SquareDetailsReport',attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd69d=['exports','define','SquareDetailsReport','report_square_details','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes'];(function(_0x4f921d,_0x6567ad){var _0x5802da=function(_0xf86de1){while(--_0xf86de1){_0x4f921d['push'](_0x4f921d['shift']());}};_0x5802da(++_0x6567ad);}(_0xd69d,0x1a4));var _0xdd69=function(_0x198d35,_0x326537){_0x198d35=_0x198d35-0x0;var _0x4ab6bf=_0xd69d[_0x198d35];return _0x4ab6bf;};'use strict';var _=require(_0xdd69('0x0'));var util=require(_0xdd69('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xdd69('0x2'));var BPromise=require(_0xdd69('0x3'));var rp=require(_0xdd69('0x4'));var fs=require('fs');var path=require(_0xdd69('0x5'));var rimraf=require(_0xdd69('0x6'));var config=require(_0xdd69('0x7'));var attributes=require(_0xdd69('0x8'));module[_0xdd69('0x9')]=function(_0xb9d7db,_0x16a777){return _0xb9d7db[_0xdd69('0xa')](_0xdd69('0xb'),attributes,{'tableName':_0xdd69('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index bf59be9..a30e009 100644 --- a/server/api/squareReportDetail/squareReportDetail.rpc.js +++ b/server/api/squareReportDetail/squareReportDetail.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdd4f=['options','raw','catch','lodash','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','CreateSquareDetailsReport','SquareDetailsReport','create'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x2668a9,_0x2ec098){_0x2668a9=_0x2668a9-0x0;var _0x2f4f7d=_0xdd4f[_0x2668a9];return _0x2f4f7d;};'use strict';var _=require(_0xfdd4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfdd4('0x1'));var fs=require('fs');var Redis=require(_0xfdd4('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xfdd4('0x3'));var logger=require(_0xfdd4('0x4'))(_0xfdd4('0x5'));var config=require('../../config/environment');var jayson=require(_0xfdd4('0x6'));var client=jayson[_0xfdd4('0x7')][_0xfdd4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x307ac6,_0x3c72d4,_0x51acd6){return new BPromise(function(_0x3cd8e6,_0x563ae6){return client[_0xfdd4('0x9')](_0x307ac6,_0x51acd6)[_0xfdd4('0xa')](function(_0x1e823e){logger['info'](_0xfdd4('0xb'),_0x3c72d4,'request\x20sent');logger[_0xfdd4('0xc')](_0xfdd4('0xd'),_0x3c72d4,_0xfdd4('0xe'),JSON[_0xfdd4('0xf')](_0x1e823e));if(_0x1e823e[_0xfdd4('0x10')]){if(_0x1e823e[_0xfdd4('0x10')][_0xfdd4('0x11')]===0x1f4){logger[_0xfdd4('0x10')](_0xfdd4('0xb'),_0x3c72d4,_0x1e823e[_0xfdd4('0x10')][_0xfdd4('0x12')]);return _0x563ae6(_0x1e823e['error'][_0xfdd4('0x12')]);}logger[_0xfdd4('0x10')](_0xfdd4('0xb'),_0x3c72d4,_0x1e823e['error'][_0xfdd4('0x12')]);return _0x3cd8e6(_0x1e823e['error'][_0xfdd4('0x12')]);}else{logger[_0xfdd4('0x13')](_0xfdd4('0xb'),_0x3c72d4,_0xfdd4('0xe'));_0x3cd8e6(_0x1e823e[_0xfdd4('0x14')]['message']);}})['catch'](function(_0x559c77){logger[_0xfdd4('0x10')](_0xfdd4('0xb'),_0x3c72d4,_0x559c77);_0x563ae6(_0x559c77);});});}exports[_0xfdd4('0x15')]=function(_0x2ccc88){var _0x32b5f7=this;return new Promise(function(_0x33d752,_0x1746e1){return db[_0xfdd4('0x16')][_0xfdd4('0x17')](_0x2ccc88['body'],{'raw':_0x2ccc88[_0xfdd4('0x18')]?_0x2ccc88[_0xfdd4('0x18')][_0xfdd4('0x19')]===undefined?!![]:![]:!![]})[_0xfdd4('0xa')](function(_0x1454f1){logger[_0xfdd4('0x13')](_0xfdd4('0x15'),_0x2ccc88);logger[_0xfdd4('0xc')]('CreateSquareDetailsReport',_0x2ccc88,JSON[_0xfdd4('0xf')](_0x1454f1));_0x33d752(_0x1454f1);})[_0xfdd4('0x1a')](function(_0x2a24e8){logger[_0xfdd4('0x10')](_0xfdd4('0x15'),_0x2a24e8[_0xfdd4('0x12')],_0x2ccc88);_0x1746e1(_0x32b5f7[_0xfdd4('0x10')](0x1f4,_0x2a24e8[_0xfdd4('0x12')]));});});}; \ No newline at end of file +var _0x9348=['result','SquareDetailsReport','create','body','options','then','CreateSquareDetailsReport','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info'];(function(_0x2e35ab,_0x1ece6d){var _0x1a72af=function(_0x160ec7){while(--_0x160ec7){_0x2e35ab['push'](_0x2e35ab['shift']());}};_0x1a72af(++_0x1ece6d);}(_0x9348,0x10d));var _0x8934=function(_0x2f3291,_0x2f30d0){_0x2f3291=_0x2f3291-0x0;var _0x20d22a=_0x9348[_0x2f3291];return _0x20d22a;};'use strict';var _=require(_0x8934('0x0'));var util=require(_0x8934('0x1'));var moment=require(_0x8934('0x2'));var BPromise=require(_0x8934('0x3'));var rs=require(_0x8934('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8934('0x5'))['db'];var utils=require(_0x8934('0x6'));var logger=require('../../config/logger')(_0x8934('0x7'));var config=require(_0x8934('0x8'));var jayson=require(_0x8934('0x9'));var client=jayson[_0x8934('0xa')][_0x8934('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ee9b9,_0x512f30,_0x284a62){return new BPromise(function(_0x3734c5,_0x1c7f03){return client['request'](_0x3ee9b9,_0x284a62)['then'](function(_0x5ec16d){logger['info'](_0x8934('0xc'),_0x512f30,'request\x20sent');logger[_0x8934('0xd')](_0x8934('0xe'),_0x512f30,_0x8934('0xf'),JSON[_0x8934('0x10')](_0x5ec16d));if(_0x5ec16d[_0x8934('0x11')]){if(_0x5ec16d[_0x8934('0x11')][_0x8934('0x12')]===0x1f4){logger[_0x8934('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0x512f30,_0x5ec16d[_0x8934('0x11')][_0x8934('0x13')]);return _0x1c7f03(_0x5ec16d[_0x8934('0x11')][_0x8934('0x13')]);}logger[_0x8934('0x11')](_0x8934('0xc'),_0x512f30,_0x5ec16d['error'][_0x8934('0x13')]);return _0x3734c5(_0x5ec16d[_0x8934('0x11')][_0x8934('0x13')]);}else{logger[_0x8934('0x14')](_0x8934('0xc'),_0x512f30,_0x8934('0xf'));_0x3734c5(_0x5ec16d[_0x8934('0x15')][_0x8934('0x13')]);}})['catch'](function(_0xb86bc9){logger[_0x8934('0x11')](_0x8934('0xc'),_0x512f30,_0xb86bc9);_0x1c7f03(_0xb86bc9);});});}exports['CreateSquareDetailsReport']=function(_0x47f25e){var _0x597eed=this;return new Promise(function(_0x2ff9ce,_0x51f9ed){return db[_0x8934('0x16')][_0x8934('0x17')](_0x47f25e[_0x8934('0x18')],{'raw':_0x47f25e[_0x8934('0x19')]?_0x47f25e[_0x8934('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x8934('0x1a')](function(_0x5ae49f){logger[_0x8934('0x14')](_0x8934('0x1b'),_0x47f25e);logger[_0x8934('0xd')](_0x8934('0x1b'),_0x47f25e,JSON[_0x8934('0x10')](_0x5ae49f));_0x2ff9ce(_0x5ae49f);})[_0x8934('0x1c')](function(_0x36fe20){logger['error'](_0x8934('0x1b'),_0x36fe20[_0x8934('0x13')],_0x47f25e);_0x51f9ed(_0x597eed[_0x8934('0x11')](0x1f4,_0x36fe20[_0x8934('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index cbda73a..71ec7b7 100644 --- a/server/api/system/index.js +++ b/server/api/system/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd7cc=['/process/:pid/kill','killProcess','../../components/auth/service','./system.controller','isAuthenticated','index','get'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0xd7cc,0xf7));var _0xcd7c=function(_0x3a606e,_0x38a76e){_0x3a606e=_0x3a606e-0x0;var _0x13a811=_0xd7cc[_0x3a606e];return _0x13a811;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0xcd7c('0x0'));var controller=require(_0xcd7c('0x1'));router['get']('/',auth[_0xcd7c('0x2')](),controller[_0xcd7c('0x3')]);router[_0xcd7c('0x4')](_0xcd7c('0x5'),auth['isAuthenticated'](),controller[_0xcd7c('0x6')]);module['exports']=router; \ No newline at end of file +var _0x140f=['Router','../../components/auth/service','./system.controller','get','/process/:pid/kill','isAuthenticated','killProcess','exports','express'];(function(_0x5aea82,_0xb46fb2){var _0x3cd67e=function(_0x5973c7){while(--_0x5973c7){_0x5aea82['push'](_0x5aea82['shift']());}};_0x3cd67e(++_0xb46fb2);}(_0x140f,0x1c1));var _0xf140=function(_0x454165,_0x1f3e74){_0x454165=_0x454165-0x0;var _0x56db53=_0x140f[_0x454165];return _0x56db53;};'use strict';var express=require(_0xf140('0x0'));var router=express[_0xf140('0x1')]();var auth=require(_0xf140('0x2'));var controller=require(_0xf140('0x3'));router[_0xf140('0x4')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf140('0x4')](_0xf140('0x5'),auth[_0xf140('0x6')](),controller[_0xf140('0x7')]);module[_0xf140('0x8')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 6e7a055..e9d950c 100644 --- a/server/api/system/system.controller.js +++ b/server/api/system/system.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb3c3=['SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','../../config/logger','api','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','status','send','index','getAllData','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','length','Process\x20with\x20pid\x20%s\x20not\x20found!','kill'];(function(_0x4b066a,_0x13a284){var _0x536de6=function(_0x15ed0c){while(--_0x15ed0c){_0x4b066a['push'](_0x4b066a['shift']());}};_0x536de6(++_0x13a284);}(_0xb3c3,0x154));var _0x3b3c=function(_0x434345,_0x2ea208){_0x434345=_0x434345-0x0;var _0xfa43f9=_0xb3c3[_0x434345];return _0xfa43f9;};'use strict';var info=require(_0x3b3c('0x0'));var exec=require(_0x3b3c('0x1'))[_0x3b3c('0x2')];var logger=require(_0x3b3c('0x3'))(_0x3b3c('0x4'));var util=require('util');var BPromise=require('bluebird');var _=require(_0x3b3c('0x5'));function handleError(_0x2a8126,_0x19e43e,_0x354e52){_0x19e43e=_0x19e43e||0x1f4;return function(_0x4b7197){logger[_0x3b3c('0x6')](_0x3b3c('0x7'),_0x354e52,_0x19e43e,util['inspect'](_0x4b7197,{'showHidden':![],'depth':null}));delete _0x4b7197[_0x3b3c('0x8')];_0x2a8126[_0x3b3c('0x9')](_0x19e43e)[_0x3b3c('0xa')](_0x4b7197);};}exports[_0x3b3c('0xb')]=function(_0x158fd0,_0x5b635c){return info[_0x3b3c('0xc')]()['then'](function(_0x426cdd){return _0x5b635c[_0x3b3c('0x9')](0xc8)[_0x3b3c('0xd')](_0x426cdd);})[_0x3b3c('0xe')](function(_0x5b1036){return _0x5b635c[_0x3b3c('0x9')](0x1f4)[_0x3b3c('0xd')](_0x5b1036);});};exports[_0x3b3c('0xf')]=function(_0x34cc12,_0x3d4898){var _0x113490=[_0x3b3c('0x10')];return new BPromise(function(_0x570c2d,_0x483d38){return exec(util[_0x3b3c('0x11')](_0x3b3c('0x12'),_0x34cc12[_0x3b3c('0x13')][_0x3b3c('0x14')]),function(_0x2bee22,_0x3578fe,_0x542a47){if(_0x2bee22){return _0x483d38(_0x2bee22);}return _0x570c2d(_0x3578fe);});})['then'](function(_0x1dcbcb){var _0x5c3300=![];var _0x1ed7d5=_0x1dcbcb['split'](/\n/);for(var _0x4140a0=0x0,_0x1d189f=_0x113490[_0x3b3c('0x15')];_0x4140a0<_0x1d189f,_0x5c3300===![];_0x4140a0+=0x1){if(_0x1dcbcb['indexOf'](_0x113490[_0x4140a0])>=0x0){_0x5c3300=!![];}}if(!_0x5c3300){throw new Error(util[_0x3b3c('0x11')](_0x3b3c('0x16'),_0x34cc12[_0x3b3c('0x13')][_0x3b3c('0x14')]));}process[_0x3b3c('0x17')](_0x34cc12['params'][_0x3b3c('0x14')],_0x3b3c('0x18'));return _0x3d4898['status'](0xc8)[_0x3b3c('0xd')]({'message':util[_0x3b3c('0x11')](_0x3b3c('0x19'),_0x34cc12[_0x3b3c('0x13')][_0x3b3c('0x14')])});})[_0x3b3c('0xe')](handleError(_0x3d4898,null,_0x3b3c('0xf')));}; \ No newline at end of file +var _0x1dfa=['index','getAllData','then','status','json','catch','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','systeminformation','child_process','exec','../../config/logger','api','util','bluebird','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','send'];(function(_0xa72ba2,_0x8725da){var _0x356a04=function(_0x1ab62a){while(--_0x1ab62a){_0xa72ba2['push'](_0xa72ba2['shift']());}};_0x356a04(++_0x8725da);}(_0x1dfa,0xb1));var _0xa1df=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0x1dfa[_0x75f869];return _0x10af8b;};'use strict';var info=require(_0xa1df('0x0'));var exec=require(_0xa1df('0x1'))[_0xa1df('0x2')];var logger=require(_0xa1df('0x3'))(_0xa1df('0x4'));var util=require(_0xa1df('0x5'));var BPromise=require(_0xa1df('0x6'));var _=require(_0xa1df('0x7'));function handleError(_0x3635d0,_0xafc4f1,_0x3364af){_0xafc4f1=_0xafc4f1||0x1f4;return function(_0x2e4feb){logger['error'](_0xa1df('0x8'),_0x3364af,_0xafc4f1,util[_0xa1df('0x9')](_0x2e4feb,{'showHidden':![],'depth':null}));delete _0x2e4feb[_0xa1df('0xa')];_0x3635d0['status'](_0xafc4f1)[_0xa1df('0xb')](_0x2e4feb);};}exports[_0xa1df('0xc')]=function(_0x1bc8ac,_0x5d9433){return info[_0xa1df('0xd')]()[_0xa1df('0xe')](function(_0x15f25f){return _0x5d9433[_0xa1df('0xf')](0xc8)[_0xa1df('0x10')](_0x15f25f);})[_0xa1df('0x11')](function(_0x397480){return _0x5d9433[_0xa1df('0xf')](0x1f4)[_0xa1df('0x10')](_0x397480);});};exports['killProcess']=function(_0x36bb4d,_0x3582a1){var _0x91231d=['components/import/cm'];return new BPromise(function(_0x40f5a9,_0x1291bd){return exec(util[_0xa1df('0x12')](_0xa1df('0x13'),_0x36bb4d[_0xa1df('0x14')][_0xa1df('0x15')]),function(_0xbe6488,_0xb31228,_0x4492f){if(_0xbe6488){return _0x1291bd(_0xbe6488);}return _0x40f5a9(_0xb31228);});})[_0xa1df('0xe')](function(_0x597e78){var _0x263a7a=![];var _0x27f5a2=_0x597e78['split'](/\n/);for(var _0x187cde=0x0,_0x165a20=_0x91231d['length'];_0x187cde<_0x165a20,_0x263a7a===![];_0x187cde+=0x1){if(_0x597e78['indexOf'](_0x91231d[_0x187cde])>=0x0){_0x263a7a=!![];}}if(!_0x263a7a){throw new Error(util['format'](_0xa1df('0x16'),_0x36bb4d[_0xa1df('0x14')]['pid']));}process[_0xa1df('0x17')](_0x36bb4d[_0xa1df('0x14')][_0xa1df('0x15')],_0xa1df('0x18'));return _0x3582a1[_0xa1df('0xf')](0xc8)[_0xa1df('0x10')]({'message':util[_0xa1df('0x12')](_0xa1df('0x19'),_0x36bb4d[_0xa1df('0x14')][_0xa1df('0x15')])});})['catch'](handleError(_0x3582a1,null,_0xa1df('0x1a')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 2834720..58d058c 100644 --- a/server/api/tag/index.js +++ b/server/api/tag/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7915=['/:id','show','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','isAuthenticated','index','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7915,0x1a9));var _0x5791=function(_0x4bd329,_0xa5ae4){_0x4bd329=_0x4bd329-0x0;var _0x875f22=_0x7915[_0x4bd329];return _0x875f22;};'use strict';var multer=require(_0x5791('0x0'));var util=require(_0x5791('0x1'));var path=require(_0x5791('0x2'));var timeout=require(_0x5791('0x3'));var express=require(_0x5791('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5791('0x5'));var interaction=require(_0x5791('0x6'));var config=require(_0x5791('0x7'));var controller=require(_0x5791('0x8'));router['get']('/',auth[_0x5791('0x9')](),controller[_0x5791('0xa')]);router[_0x5791('0xb')](_0x5791('0xc'),auth[_0x5791('0x9')](),controller[_0x5791('0xd')]);router['post']('/',auth[_0x5791('0x9')](),controller[_0x5791('0xe')]);router[_0x5791('0xf')]('/:id',auth[_0x5791('0x9')](),controller[_0x5791('0x10')]);router['delete'](_0x5791('0xc'),auth[_0x5791('0x9')](),controller[_0x5791('0x11')]);module[_0x5791('0x12')]=router; \ No newline at end of file +var _0x7ce1=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','show','post','update','delete','destroy','exports','util'];(function(_0x480385,_0x4e2ad1){var _0x3170ae=function(_0x17d531){while(--_0x17d531){_0x480385['push'](_0x480385['shift']());}};_0x3170ae(++_0x4e2ad1);}(_0x7ce1,0x131));var _0x17ce=function(_0x234ae1,_0x42bdd6){_0x234ae1=_0x234ae1-0x0;var _0x227ba0=_0x7ce1[_0x234ae1];return _0x227ba0;};'use strict';var multer=require('multer');var util=require(_0x17ce('0x0'));var path=require('path');var timeout=require(_0x17ce('0x1'));var express=require(_0x17ce('0x2'));var router=express[_0x17ce('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x17ce('0x4'));var interaction=require(_0x17ce('0x5'));var config=require(_0x17ce('0x6'));var controller=require(_0x17ce('0x7'));router[_0x17ce('0x8')]('/',auth[_0x17ce('0x9')](),controller[_0x17ce('0xa')]);router[_0x17ce('0x8')](_0x17ce('0xb'),auth[_0x17ce('0x9')](),controller[_0x17ce('0xc')]);router[_0x17ce('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x17ce('0xb'),auth[_0x17ce('0x9')](),controller[_0x17ce('0xe')]);router[_0x17ce('0xf')](_0x17ce('0xb'),auth[_0x17ce('0x9')](),controller[_0x17ce('0x10')]);module[_0x17ce('0x11')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 2ea39f8..4741208 100644 --- a/server/api/tag/tag.attributes.js +++ b/server/api/tag/tag.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaf4c=['#0091EA','exports','STRING'];(function(_0x320909,_0x17e27a){var _0x3b19b5=function(_0x5268c7){while(--_0x5268c7){_0x320909['push'](_0x320909['shift']());}};_0x3b19b5(++_0x17e27a);}(_0xaf4c,0x1ed));var _0xcaf4=function(_0x15915f,_0x58cd67){_0x15915f=_0x15915f-0x0;var _0xb0d6b3=_0xaf4c[_0x15915f];return _0xb0d6b3;};'use strict';var Sequelize=require('sequelize');module[_0xcaf4('0x0')]={'name':{'type':Sequelize[_0xcaf4('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xcaf4('0x1')],'defaultValue':_0xcaf4('0x2')},'description':{'type':Sequelize[_0xcaf4('0x1')]}}; \ No newline at end of file +var _0x81a5=['#0091EA','sequelize','exports','STRING','name'];(function(_0x2a276d,_0x482b0c){var _0x2914cd=function(_0x452b8b){while(--_0x452b8b){_0x2a276d['push'](_0x2a276d['shift']());}};_0x2914cd(++_0x482b0c);}(_0x81a5,0x1c8));var _0x581a=function(_0x4bfee6,_0x1afce2){_0x4bfee6=_0x4bfee6-0x0;var _0x989e0a=_0x81a5[_0x4bfee6];return _0x989e0a;};'use strict';var Sequelize=require(_0x581a('0x0'));module[_0x581a('0x1')]={'name':{'type':Sequelize[_0x581a('0x2')],'unique':_0x581a('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x581a('0x2')],'defaultValue':_0x581a('0x4')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index d7ca24d..667834f 100644 --- a/server/api/tag/tag.controller.js +++ b/server/api/tag/tag.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe812=['userProfileId','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','rimraf','zip-dir','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','Content-Range','apply','reject','save','then','get','Tags','UserProfileResource','destroy','name','send','index','Tag','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xe812,0x1f2));var _0x2e81=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xe812[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2e81('0x0'));var zipdir=require(_0x2e81('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2e81('0x2'));var BPromise=require(_0x2e81('0x3'));var Mustache=require('mustache');var util=require(_0x2e81('0x4'));var path=require(_0x2e81('0x5'));var sox=require('sox');var csv=require(_0x2e81('0x6'));var ejs=require(_0x2e81('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2e81('0x8'));var squel=require(_0x2e81('0x9'));var crypto=require(_0x2e81('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x2e81('0xb'));var toCsv=require(_0x2e81('0x6'));var querystring=require(_0x2e81('0xc'));var Papa=require(_0x2e81('0xd'));var Redis=require('ioredis');var authService=require(_0x2e81('0xe'));var qs=require(_0x2e81('0xf'));var as=require(_0x2e81('0x10'));var hardwareService=require(_0x2e81('0x11'));var logger=require(_0x2e81('0x12'))(_0x2e81('0x13'));var utils=require(_0x2e81('0x14'));var config=require(_0x2e81('0x15'));var licenseUtil=require(_0x2e81('0x16'));var db=require(_0x2e81('0x17'))['db'];function respondWithStatusCode(_0x4284f3,_0x5c58a2){_0x5c58a2=_0x5c58a2||0xcc;return function(_0x30a730){if(_0x30a730){return _0x4284f3[_0x2e81('0x18')](_0x5c58a2);}return _0x4284f3['status'](_0x5c58a2)[_0x2e81('0x19')]();};}function respondWithResult(_0x5598a9,_0x2a4411){_0x2a4411=_0x2a4411||0xc8;return function(_0x2b24f0){if(_0x2b24f0){return _0x5598a9[_0x2e81('0x1a')](_0x2a4411)[_0x2e81('0x1b')](_0x2b24f0);}};}function respondWithFilteredResult(_0x1bb937,_0x3a8c05){return function(_0x53da62){if(_0x53da62){var _0xc4d315=typeof _0x3a8c05[_0x2e81('0x1c')]==='undefined'&&typeof _0x3a8c05[_0x2e81('0x1d')]==='undefined';var _0x2cc0c6=_0x53da62[_0x2e81('0x1e')];var _0x4c1b11=_0xc4d315?0x0:_0x3a8c05[_0x2e81('0x1c')];var _0x2bb9b6=_0xc4d315?_0x53da62[_0x2e81('0x1e')]:_0x3a8c05[_0x2e81('0x1c')]+_0x3a8c05[_0x2e81('0x1d')];var _0x1f20bf;if(_0x2bb9b6>=_0x2cc0c6){_0x2bb9b6=_0x2cc0c6;_0x1f20bf=0xc8;}else{_0x1f20bf=0xce;}_0x1bb937[_0x2e81('0x1a')](_0x1f20bf);return _0x1bb937[_0x2e81('0x1f')](_0x2e81('0x20'),_0x4c1b11+'-'+_0x2bb9b6+'/'+_0x2cc0c6)[_0x2e81('0x1b')](_0x53da62);}return null;};}function patchUpdates(_0x524694){return function(_0x10b77e){try{jsonpatch[_0x2e81('0x21')](_0x10b77e,_0x524694,!![]);}catch(_0x9ddf6b){return BPromise[_0x2e81('0x22')](_0x9ddf6b);}return _0x10b77e[_0x2e81('0x23')]();};}function saveUpdates(_0x386721,_0x18b9be){return function(_0x39ffa8){if(_0x39ffa8){return _0x39ffa8['update'](_0x386721)[_0x2e81('0x24')](function(_0x49e9f1){return _0x49e9f1;});}return null;};}function removeEntity(_0x2d50af,_0x4fe130){return function(_0x1d09cb){if(_0x1d09cb){return _0x1d09cb['destroy']()['then'](function(){var _0x123d3d=_0x1d09cb[_0x2e81('0x25')]({'plain':!![]});var _0x4a75ff=_0x2e81('0x26');return db[_0x2e81('0x27')][_0x2e81('0x28')]({'where':{'type':_0x4a75ff,'resourceId':_0x123d3d['id']}})[_0x2e81('0x24')](function(){return _0x1d09cb;});})[_0x2e81('0x24')](function(){_0x2d50af[_0x2e81('0x1a')](0xcc)[_0x2e81('0x19')]();});}};}function handleEntityNotFound(_0x4669aa,_0x1b34db){return function(_0x1bf5a6){if(!_0x1bf5a6){_0x4669aa[_0x2e81('0x18')](0x194);}return _0x1bf5a6;};}function handleError(_0xc0720f,_0x8edf9c){_0x8edf9c=_0x8edf9c||0x1f4;return function(_0x3ec91d){logger['error'](_0x3ec91d['stack']);if(_0x3ec91d[_0x2e81('0x29')]){delete _0x3ec91d[_0x2e81('0x29')];}_0xc0720f[_0x2e81('0x1a')](_0x8edf9c)[_0x2e81('0x2a')](_0x3ec91d);};}exports[_0x2e81('0x2b')]=function(_0x2a78bb,_0x243b20){var _0x13612b={},_0x26ec2a={},_0x1c37d1={'count':0x0,'rows':[]};var _0x392c5b=_['map'](db[_0x2e81('0x2c')][_0x2e81('0x2d')],function(_0x1d0437){return{'name':_0x1d0437[_0x2e81('0x2e')],'type':_0x1d0437[_0x2e81('0x2f')][_0x2e81('0x30')]};});_0x26ec2a[_0x2e81('0x31')]=_[_0x2e81('0x32')](_0x392c5b,_0x2e81('0x29'));_0x26ec2a[_0x2e81('0x33')]=_[_0x2e81('0x34')](_0x2a78bb[_0x2e81('0x33')]);_0x26ec2a[_0x2e81('0x35')]=_[_0x2e81('0x36')](_0x26ec2a[_0x2e81('0x31')],_0x26ec2a[_0x2e81('0x33')]);_0x13612b[_0x2e81('0x37')]=_['intersection'](_0x26ec2a[_0x2e81('0x31')],qs[_0x2e81('0x38')](_0x2a78bb['query'][_0x2e81('0x38')]));_0x13612b[_0x2e81('0x37')]=_0x13612b['attributes'][_0x2e81('0x39')]?_0x13612b[_0x2e81('0x37')]:_0x26ec2a[_0x2e81('0x31')];if(!_0x2a78bb['query'][_0x2e81('0x3a')](_0x2e81('0x3b'))){_0x13612b[_0x2e81('0x1d')]=qs[_0x2e81('0x1d')](_0x2a78bb[_0x2e81('0x33')]['limit']);_0x13612b['offset']=qs['offset'](_0x2a78bb['query'][_0x2e81('0x1c')]);}_0x13612b['order']=qs['sort'](_0x2a78bb[_0x2e81('0x33')][_0x2e81('0x3c')]);_0x13612b[_0x2e81('0x3d')]=qs['filters'](_[_0x2e81('0x3e')](_0x2a78bb[_0x2e81('0x33')],_0x26ec2a[_0x2e81('0x35')]),_0x392c5b);if(_0x2a78bb[_0x2e81('0x33')][_0x2e81('0x3f')]){_0x13612b['where']=_['merge'](_0x13612b[_0x2e81('0x3d')],{'$or':_[_0x2e81('0x32')](_0x392c5b,function(_0x35d1c0){if(_0x35d1c0['type']!==_0x2e81('0x40')){var _0x44d10c={};_0x44d10c[_0x35d1c0[_0x2e81('0x29')]]={'$like':'%'+_0x2a78bb['query'][_0x2e81('0x3f')]+'%'};return _0x44d10c;}})});}_0x13612b=_[_0x2e81('0x41')]({},_0x13612b,_0x2a78bb[_0x2e81('0x42')]);var _0x10e240={'where':_0x13612b[_0x2e81('0x3d')]};return db[_0x2e81('0x2c')][_0x2e81('0x1e')](_0x10e240)[_0x2e81('0x24')](function(_0x5508f0){_0x1c37d1['count']=_0x5508f0;if(_0x2a78bb[_0x2e81('0x33')]['includeAll']){_0x13612b[_0x2e81('0x43')]=[{'all':!![]}];}return db[_0x2e81('0x2c')][_0x2e81('0x44')](_0x13612b);})[_0x2e81('0x24')](function(_0x3c5fbb){_0x1c37d1[_0x2e81('0x45')]=_0x3c5fbb;return _0x1c37d1;})['then'](respondWithFilteredResult(_0x243b20,_0x13612b))['catch'](handleError(_0x243b20,null));};exports[_0x2e81('0x46')]=function(_0x2bc2a7,_0x1a8233){var _0x53bb7c={'raw':!![],'where':{'id':_0x2bc2a7[_0x2e81('0x47')]['id']}},_0x4499b7={};_0x4499b7['model']=_[_0x2e81('0x34')](db['Tag'][_0x2e81('0x2d')]);_0x4499b7[_0x2e81('0x33')]=_[_0x2e81('0x34')](_0x2bc2a7[_0x2e81('0x33')]);_0x4499b7['filters']=_[_0x2e81('0x36')](_0x4499b7['model'],_0x4499b7[_0x2e81('0x33')]);_0x53bb7c[_0x2e81('0x37')]=_['intersection'](_0x4499b7[_0x2e81('0x31')],qs[_0x2e81('0x38')](_0x2bc2a7[_0x2e81('0x33')][_0x2e81('0x38')]));_0x53bb7c[_0x2e81('0x37')]=_0x53bb7c[_0x2e81('0x37')][_0x2e81('0x39')]?_0x53bb7c['attributes']:_0x4499b7[_0x2e81('0x31')];if(_0x2bc2a7['query']['includeAll']){_0x53bb7c[_0x2e81('0x43')]=[{'all':!![]}];}_0x53bb7c=_['merge']({},_0x53bb7c,_0x2bc2a7['options']);return db[_0x2e81('0x2c')][_0x2e81('0x48')](_0x53bb7c)[_0x2e81('0x24')](handleEntityNotFound(_0x1a8233,null))['then'](respondWithResult(_0x1a8233,null))['catch'](handleError(_0x1a8233,null));};exports[_0x2e81('0x49')]=function(_0x1dd4d7,_0x16ed11){return db[_0x2e81('0x2c')]['create'](_0x1dd4d7['body'],{})[_0x2e81('0x24')](function(_0x4056e8){var _0x5631b6=_0x1dd4d7['user'][_0x2e81('0x25')]({'plain':!![]});if(!_0x5631b6)throw new Error(_0x2e81('0x4a'));if(_0x5631b6['role']===_0x2e81('0x4b')){var _0x33a4d7=_0x4056e8[_0x2e81('0x25')]({'plain':!![]});var _0x3402b3=_0x2e81('0x26');return db['UserProfileSection'][_0x2e81('0x48')]({'where':{'name':_0x3402b3,'userProfileId':_0x5631b6[_0x2e81('0x4c')]},'raw':!![]})[_0x2e81('0x24')](function(_0xb4decd){if(_0xb4decd&&_0xb4decd['autoAssociation']===0x0){return db['UserProfileResource'][_0x2e81('0x49')]({'name':_0x33a4d7[_0x2e81('0x29')],'resourceId':_0x33a4d7['id'],'type':_0xb4decd[_0x2e81('0x29')],'sectionId':_0xb4decd['id']},{})[_0x2e81('0x24')](function(){return _0x4056e8;});}else{return _0x4056e8;}})[_0x2e81('0x4d')](function(_0x482888){logger[_0x2e81('0x4e')](_0x2e81('0x4f'),_0x482888);throw _0x482888;});}return _0x4056e8;})[_0x2e81('0x24')](respondWithResult(_0x16ed11,0xc9))[_0x2e81('0x4d')](handleError(_0x16ed11,null));};exports[_0x2e81('0x50')]=function(_0x4aa5e5,_0x44db7f){if(_0x4aa5e5[_0x2e81('0x51')]['id']){delete _0x4aa5e5['body']['id'];}return db['Tag'][_0x2e81('0x48')]({'where':{'id':_0x4aa5e5['params']['id']}})[_0x2e81('0x24')](handleEntityNotFound(_0x44db7f,null))[_0x2e81('0x24')](saveUpdates(_0x4aa5e5[_0x2e81('0x51')],null))[_0x2e81('0x24')](respondWithResult(_0x44db7f,null))[_0x2e81('0x4d')](handleError(_0x44db7f,null));};exports[_0x2e81('0x28')]=function(_0x18beeb,_0x1570c1){return db['Tag'][_0x2e81('0x48')]({'where':{'id':_0x18beeb['params']['id']}})[_0x2e81('0x24')](handleEntityNotFound(_0x1570c1,null))[_0x2e81('0x24')](removeEntity(_0x1570c1,null))['catch'](handleError(_0x1570c1,null));}; \ No newline at end of file +var _0x32ef=['lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','get','Tags','UserProfileResource','sendStatus','stack','name','send','index','map','Tag','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra'];(function(_0x25c524,_0x590cd6){var _0x496c5b=function(_0x52f64f){while(--_0x52f64f){_0x25c524['push'](_0x25c524['shift']());}};_0x496c5b(++_0x590cd6);}(_0x32ef,0xf9));var _0xf32e=function(_0x39e524,_0x35e149){_0x39e524=_0x39e524-0x0;var _0x26c4d4=_0x32ef[_0x39e524];return _0x26c4d4;};'use strict';var emlformat=require(_0xf32e('0x0'));var rimraf=require(_0xf32e('0x1'));var zipdir=require(_0xf32e('0x2'));var jsonpatch=require(_0xf32e('0x3'));var rp=require(_0xf32e('0x4'));var moment=require(_0xf32e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf32e('0x6'));var util=require(_0xf32e('0x7'));var path=require('path');var sox=require(_0xf32e('0x8'));var csv=require(_0xf32e('0x9'));var ejs=require(_0xf32e('0xa'));var fs=require('fs');var fs_extra=require(_0xf32e('0xb'));var _=require(_0xf32e('0xc'));var squel=require(_0xf32e('0xd'));var crypto=require('crypto');var jsforce=require(_0xf32e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf32e('0x9'));var querystring=require(_0xf32e('0xf'));var Papa=require(_0xf32e('0x10'));var Redis=require(_0xf32e('0x11'));var authService=require(_0xf32e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf32e('0x13'));var hardwareService=require(_0xf32e('0x14'));var logger=require(_0xf32e('0x15'))(_0xf32e('0x16'));var utils=require(_0xf32e('0x17'));var config=require(_0xf32e('0x18'));var licenseUtil=require(_0xf32e('0x19'));var db=require(_0xf32e('0x1a'))['db'];function respondWithStatusCode(_0x319616,_0x1c1f52){_0x1c1f52=_0x1c1f52||0xcc;return function(_0xf7dc32){if(_0xf7dc32){return _0x319616['sendStatus'](_0x1c1f52);}return _0x319616[_0xf32e('0x1b')](_0x1c1f52)[_0xf32e('0x1c')]();};}function respondWithResult(_0x543072,_0x336e26){_0x336e26=_0x336e26||0xc8;return function(_0x35988d){if(_0x35988d){return _0x543072[_0xf32e('0x1b')](_0x336e26)['json'](_0x35988d);}};}function respondWithFilteredResult(_0xe324ad,_0x299efa){return function(_0x1dd008){if(_0x1dd008){var _0x400d25=typeof _0x299efa[_0xf32e('0x1d')]===_0xf32e('0x1e')&&typeof _0x299efa[_0xf32e('0x1f')]===_0xf32e('0x1e');var _0x21aa73=_0x1dd008['count'];var _0x3510ec=_0x400d25?0x0:_0x299efa[_0xf32e('0x1d')];var _0xb828b8=_0x400d25?_0x1dd008[_0xf32e('0x20')]:_0x299efa[_0xf32e('0x1d')]+_0x299efa[_0xf32e('0x1f')];var _0x2f909b;if(_0xb828b8>=_0x21aa73){_0xb828b8=_0x21aa73;_0x2f909b=0xc8;}else{_0x2f909b=0xce;}_0xe324ad[_0xf32e('0x1b')](_0x2f909b);return _0xe324ad[_0xf32e('0x21')](_0xf32e('0x22'),_0x3510ec+'-'+_0xb828b8+'/'+_0x21aa73)[_0xf32e('0x23')](_0x1dd008);}return null;};}function patchUpdates(_0x1b169e){return function(_0x3202e1){try{jsonpatch[_0xf32e('0x24')](_0x3202e1,_0x1b169e,!![]);}catch(_0x5f2e99){return BPromise['reject'](_0x5f2e99);}return _0x3202e1[_0xf32e('0x25')]();};}function saveUpdates(_0x57a8cb,_0x27b92c){return function(_0x2aaabf){if(_0x2aaabf){return _0x2aaabf[_0xf32e('0x26')](_0x57a8cb)[_0xf32e('0x27')](function(_0x35e34c){return _0x35e34c;});}return null;};}function removeEntity(_0x5409b4,_0x227405){return function(_0x4407f8){if(_0x4407f8){return _0x4407f8[_0xf32e('0x28')]()[_0xf32e('0x27')](function(){var _0x5e62eb=_0x4407f8[_0xf32e('0x29')]({'plain':!![]});var _0x1eb413=_0xf32e('0x2a');return db[_0xf32e('0x2b')][_0xf32e('0x28')]({'where':{'type':_0x1eb413,'resourceId':_0x5e62eb['id']}})[_0xf32e('0x27')](function(){return _0x4407f8;});})[_0xf32e('0x27')](function(){_0x5409b4[_0xf32e('0x1b')](0xcc)[_0xf32e('0x1c')]();});}};}function handleEntityNotFound(_0x29be62,_0x488489){return function(_0x3e6e6f){if(!_0x3e6e6f){_0x29be62[_0xf32e('0x2c')](0x194);}return _0x3e6e6f;};}function handleError(_0x3b906c,_0x4a873c){_0x4a873c=_0x4a873c||0x1f4;return function(_0x419d13){logger['error'](_0x419d13[_0xf32e('0x2d')]);if(_0x419d13['name']){delete _0x419d13[_0xf32e('0x2e')];}_0x3b906c[_0xf32e('0x1b')](_0x4a873c)[_0xf32e('0x2f')](_0x419d13);};}exports[_0xf32e('0x30')]=function(_0x32a74b,_0x4e64d4){var _0x2e2ea4={},_0x1d3c7a={},_0x175096={'count':0x0,'rows':[]};var _0x498c9c=_[_0xf32e('0x31')](db[_0xf32e('0x32')][_0xf32e('0x33')],function(_0x3b87d3){return{'name':_0x3b87d3[_0xf32e('0x34')],'type':_0x3b87d3[_0xf32e('0x35')][_0xf32e('0x36')]};});_0x1d3c7a[_0xf32e('0x37')]=_[_0xf32e('0x31')](_0x498c9c,_0xf32e('0x2e'));_0x1d3c7a[_0xf32e('0x38')]=_[_0xf32e('0x39')](_0x32a74b[_0xf32e('0x38')]);_0x1d3c7a['filters']=_[_0xf32e('0x3a')](_0x1d3c7a['model'],_0x1d3c7a[_0xf32e('0x38')]);_0x2e2ea4['attributes']=_['intersection'](_0x1d3c7a[_0xf32e('0x37')],qs[_0xf32e('0x3b')](_0x32a74b[_0xf32e('0x38')][_0xf32e('0x3b')]));_0x2e2ea4[_0xf32e('0x3c')]=_0x2e2ea4['attributes'][_0xf32e('0x3d')]?_0x2e2ea4[_0xf32e('0x3c')]:_0x1d3c7a[_0xf32e('0x37')];if(!_0x32a74b[_0xf32e('0x38')]['hasOwnProperty'](_0xf32e('0x3e'))){_0x2e2ea4[_0xf32e('0x1f')]=qs[_0xf32e('0x1f')](_0x32a74b[_0xf32e('0x38')][_0xf32e('0x1f')]);_0x2e2ea4['offset']=qs[_0xf32e('0x1d')](_0x32a74b[_0xf32e('0x38')][_0xf32e('0x1d')]);}_0x2e2ea4['order']=qs[_0xf32e('0x3f')](_0x32a74b['query'][_0xf32e('0x3f')]);_0x2e2ea4[_0xf32e('0x40')]=qs[_0xf32e('0x41')](_['pick'](_0x32a74b[_0xf32e('0x38')],_0x1d3c7a[_0xf32e('0x41')]),_0x498c9c);if(_0x32a74b[_0xf32e('0x38')][_0xf32e('0x42')]){_0x2e2ea4[_0xf32e('0x40')]=_[_0xf32e('0x43')](_0x2e2ea4['where'],{'$or':_[_0xf32e('0x31')](_0x498c9c,function(_0x26ef18){if(_0x26ef18[_0xf32e('0x35')]!==_0xf32e('0x44')){var _0x28fb71={};_0x28fb71[_0x26ef18[_0xf32e('0x2e')]]={'$like':'%'+_0x32a74b[_0xf32e('0x38')]['filter']+'%'};return _0x28fb71;}})});}_0x2e2ea4=_[_0xf32e('0x43')]({},_0x2e2ea4,_0x32a74b[_0xf32e('0x45')]);var _0x41fbb1={'where':_0x2e2ea4[_0xf32e('0x40')]};return db[_0xf32e('0x32')][_0xf32e('0x20')](_0x41fbb1)[_0xf32e('0x27')](function(_0x546b80){_0x175096[_0xf32e('0x20')]=_0x546b80;if(_0x32a74b[_0xf32e('0x38')][_0xf32e('0x46')]){_0x2e2ea4[_0xf32e('0x47')]=[{'all':!![]}];}return db[_0xf32e('0x32')][_0xf32e('0x48')](_0x2e2ea4);})[_0xf32e('0x27')](function(_0x3ce422){_0x175096[_0xf32e('0x49')]=_0x3ce422;return _0x175096;})[_0xf32e('0x27')](respondWithFilteredResult(_0x4e64d4,_0x2e2ea4))['catch'](handleError(_0x4e64d4,null));};exports[_0xf32e('0x4a')]=function(_0x1f07a6,_0xbd0442){var _0x2146e8={'raw':!![],'where':{'id':_0x1f07a6[_0xf32e('0x4b')]['id']}},_0x159dfd={};_0x159dfd['model']=_[_0xf32e('0x39')](db[_0xf32e('0x32')][_0xf32e('0x33')]);_0x159dfd[_0xf32e('0x38')]=_[_0xf32e('0x39')](_0x1f07a6['query']);_0x159dfd[_0xf32e('0x41')]=_['intersection'](_0x159dfd[_0xf32e('0x37')],_0x159dfd[_0xf32e('0x38')]);_0x2146e8['attributes']=_[_0xf32e('0x3a')](_0x159dfd['model'],qs['fields'](_0x1f07a6['query'][_0xf32e('0x3b')]));_0x2146e8[_0xf32e('0x3c')]=_0x2146e8[_0xf32e('0x3c')][_0xf32e('0x3d')]?_0x2146e8[_0xf32e('0x3c')]:_0x159dfd[_0xf32e('0x37')];if(_0x1f07a6[_0xf32e('0x38')][_0xf32e('0x46')]){_0x2146e8[_0xf32e('0x47')]=[{'all':!![]}];}_0x2146e8=_[_0xf32e('0x43')]({},_0x2146e8,_0x1f07a6[_0xf32e('0x45')]);return db[_0xf32e('0x32')][_0xf32e('0x4c')](_0x2146e8)[_0xf32e('0x27')](handleEntityNotFound(_0xbd0442,null))['then'](respondWithResult(_0xbd0442,null))[_0xf32e('0x4d')](handleError(_0xbd0442,null));};exports[_0xf32e('0x4e')]=function(_0xc83c9f,_0x4b15be){return db['Tag']['create'](_0xc83c9f[_0xf32e('0x4f')],{})[_0xf32e('0x27')](function(_0x5194e8){var _0x436b8a=_0xc83c9f[_0xf32e('0x50')]['get']({'plain':!![]});if(!_0x436b8a)throw new Error(_0xf32e('0x51'));if(_0x436b8a[_0xf32e('0x52')]===_0xf32e('0x50')){var _0x36015b=_0x5194e8[_0xf32e('0x29')]({'plain':!![]});var _0x12f8e2='Tags';return db[_0xf32e('0x53')][_0xf32e('0x4c')]({'where':{'name':_0x12f8e2,'userProfileId':_0x436b8a[_0xf32e('0x54')]},'raw':!![]})['then'](function(_0x15017b){if(_0x15017b&&_0x15017b[_0xf32e('0x55')]===0x0){return db[_0xf32e('0x2b')]['create']({'name':_0x36015b['name'],'resourceId':_0x36015b['id'],'type':_0x15017b['name'],'sectionId':_0x15017b['id']},{})[_0xf32e('0x27')](function(){return _0x5194e8;});}else{return _0x5194e8;}})[_0xf32e('0x4d')](function(_0x36b32a){logger[_0xf32e('0x56')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x36b32a);throw _0x36b32a;});}return _0x5194e8;})[_0xf32e('0x27')](respondWithResult(_0x4b15be,0xc9))[_0xf32e('0x4d')](handleError(_0x4b15be,null));};exports[_0xf32e('0x26')]=function(_0x787572,_0x10f4d3){if(_0x787572['body']['id']){delete _0x787572[_0xf32e('0x4f')]['id'];}return db[_0xf32e('0x32')][_0xf32e('0x4c')]({'where':{'id':_0x787572[_0xf32e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x10f4d3,null))[_0xf32e('0x27')](saveUpdates(_0x787572['body'],null))['then'](respondWithResult(_0x10f4d3,null))[_0xf32e('0x4d')](handleError(_0x10f4d3,null));};exports[_0xf32e('0x28')]=function(_0x1a485b,_0x391cbc){return db[_0xf32e('0x32')][_0xf32e('0x4c')]({'where':{'id':_0x1a485b[_0xf32e('0x4b')]['id']}})[_0xf32e('0x27')](handleEntityNotFound(_0x391cbc,null))[_0xf32e('0x27')](removeEntity(_0x391cbc,null))[_0xf32e('0x4d')](handleError(_0x391cbc,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index bc815d3..4e9cf25 100644 --- a/server/api/tag/tag.model.js +++ b/server/api/tag/tag.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9874=['api','moment','request-promise','../../config/environment','./tag.attributes','exports','Tag','tools_tags','util'];(function(_0x172328,_0xeb050b){var _0x30db98=function(_0x2b77be){while(--_0x2b77be){_0x172328['push'](_0x172328['shift']());}};_0x30db98(++_0xeb050b);}(_0x9874,0x155));var _0x4987=function(_0x17249d,_0x2c5c7a){_0x17249d=_0x17249d-0x0;var _0x2557e3=_0x9874[_0x17249d];return _0x2557e3;};'use strict';var _=require('lodash');var util=require(_0x4987('0x0'));var logger=require('../../config/logger')(_0x4987('0x1'));var moment=require(_0x4987('0x2'));var BPromise=require('bluebird');var rp=require(_0x4987('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4987('0x4'));var attributes=require(_0x4987('0x5'));module[_0x4987('0x6')]=function(_0xf40c75,_0x26f6b3){return _0xf40c75['define'](_0x4987('0x7'),attributes,{'tableName':_0x4987('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9512=['tools_tags','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','exports','define','Tag'];(function(_0x55753f,_0x4fd68f){var _0xb3a22=function(_0x1eb67a){while(--_0x1eb67a){_0x55753f['push'](_0x55753f['shift']());}};_0xb3a22(++_0x4fd68f);}(_0x9512,0x14b));var _0x2951=function(_0x22cea4,_0x54f16a){_0x22cea4=_0x22cea4-0x0;var _0x59d75b=_0x9512[_0x22cea4];return _0x59d75b;};'use strict';var _=require(_0x2951('0x0'));var util=require(_0x2951('0x1'));var logger=require(_0x2951('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2951('0x3'));var rp=require(_0x2951('0x4'));var fs=require('fs');var path=require(_0x2951('0x5'));var rimraf=require(_0x2951('0x6'));var config=require('../../config/environment');var attributes=require('./tag.attributes');module[_0x2951('0x7')]=function(_0x1c80a5,_0x5d1872){return _0x1c80a5[_0x2951('0x8')](_0x2951('0x9'),attributes,{'tableName':_0x2951('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index d609940..661918a 100644 --- a/server/api/tag/tag.rpc.js +++ b/server/api/tag/tag.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5577=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x5577,0x1b4));var _0x7557=function(_0x229121,_0x4cfd48){_0x229121=_0x229121-0x0;var _0x559765=_0x5577[_0x229121];return _0x559765;};'use strict';var _=require(_0x7557('0x0'));var util=require('util');var moment=require(_0x7557('0x1'));var BPromise=require(_0x7557('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7557('0x3'));var db=require(_0x7557('0x4'))['db'];var utils=require(_0x7557('0x5'));var logger=require(_0x7557('0x6'))(_0x7557('0x7'));var config=require(_0x7557('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7557('0x9')][_0x7557('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3da895,_0x1446fd,_0x33e9aa){return new BPromise(function(_0x37f335,_0xa4f49a){return client[_0x7557('0xb')](_0x3da895,_0x33e9aa)[_0x7557('0xc')](function(_0x24b592){logger[_0x7557('0xd')](_0x7557('0xe'),_0x1446fd,_0x7557('0xf'));logger[_0x7557('0x10')](_0x7557('0x11'),_0x1446fd,'request\x20sent',JSON['stringify'](_0x24b592));if(_0x24b592[_0x7557('0x12')]){if(_0x24b592[_0x7557('0x12')][_0x7557('0x13')]===0x1f4){logger[_0x7557('0x12')](_0x7557('0xe'),_0x1446fd,_0x24b592[_0x7557('0x12')][_0x7557('0x14')]);return _0xa4f49a(_0x24b592[_0x7557('0x12')][_0x7557('0x14')]);}logger[_0x7557('0x12')]('Tag,\x20%s,\x20%s',_0x1446fd,_0x24b592[_0x7557('0x12')][_0x7557('0x14')]);return _0x37f335(_0x24b592[_0x7557('0x12')]['message']);}else{logger[_0x7557('0xd')](_0x7557('0xe'),_0x1446fd,_0x7557('0xf'));_0x37f335(_0x24b592[_0x7557('0x15')]['message']);}})[_0x7557('0x16')](function(_0x46057c){logger['error']('Tag,\x20%s,\x20%s',_0x1446fd,_0x46057c);_0xa4f49a(_0x46057c);});});} \ No newline at end of file +var _0xc818=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x22dfbf,_0x12c884){var _0x590110=function(_0x3b4ff3){while(--_0x3b4ff3){_0x22dfbf['push'](_0x22dfbf['shift']());}};_0x590110(++_0x12c884);}(_0xc818,0x1e3));var _0x8c81=function(_0x2ca515,_0x2f0654){_0x2ca515=_0x2ca515-0x0;var _0x2f7701=_0xc818[_0x2ca515];return _0x2f7701;};'use strict';var _=require(_0x8c81('0x0'));var util=require(_0x8c81('0x1'));var moment=require(_0x8c81('0x2'));var BPromise=require(_0x8c81('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8c81('0x4'));var db=require(_0x8c81('0x5'))['db'];var utils=require(_0x8c81('0x6'));var logger=require(_0x8c81('0x7'))(_0x8c81('0x8'));var config=require(_0x8c81('0x9'));var jayson=require(_0x8c81('0xa'));var client=jayson['client'][_0x8c81('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d663e,_0x32cf31,_0x43d142){return new BPromise(function(_0x501240,_0x1173cf){return client[_0x8c81('0xc')](_0x3d663e,_0x43d142)[_0x8c81('0xd')](function(_0x15ebff){logger[_0x8c81('0xe')](_0x8c81('0xf'),_0x32cf31,_0x8c81('0x10'));logger['debug'](_0x8c81('0x11'),_0x32cf31,_0x8c81('0x10'),JSON[_0x8c81('0x12')](_0x15ebff));if(_0x15ebff[_0x8c81('0x13')]){if(_0x15ebff['error'][_0x8c81('0x14')]===0x1f4){logger[_0x8c81('0x13')](_0x8c81('0xf'),_0x32cf31,_0x15ebff[_0x8c81('0x13')][_0x8c81('0x15')]);return _0x1173cf(_0x15ebff[_0x8c81('0x13')][_0x8c81('0x15')]);}logger[_0x8c81('0x13')](_0x8c81('0xf'),_0x32cf31,_0x15ebff['error']['message']);return _0x501240(_0x15ebff[_0x8c81('0x13')][_0x8c81('0x15')]);}else{logger[_0x8c81('0xe')](_0x8c81('0xf'),_0x32cf31,_0x8c81('0x10'));_0x501240(_0x15ebff[_0x8c81('0x16')]['message']);}})[_0x8c81('0x17')](function(_0x29ccb0){logger[_0x8c81('0x13')](_0x8c81('0xf'),_0x32cf31,_0x29ccb0);_0x1173cf(_0x29ccb0);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 6bfa39c..cd91405 100644 --- a/server/api/team/index.js +++ b/server/api/team/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index 872eb5a..a8b94bd 100644 --- a/server/api/team/team.attributes.js +++ b/server/api/team/team.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['STRING','sequelize'];(function(_0xc77819,_0x139fdc){var _0x1c9434=function(_0x11d15d){while(--_0x11d15d){_0xc77819['push'](_0xc77819['shift']());}};_0x1c9434(++_0x139fdc);}(_0xb7e7,0x121));var _0x7b7e=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0xb7e7[_0x243b2f];return _0xcb3c2d;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file +var _0x757a=['exports','STRING'];(function(_0x347c16,_0x4e4f33){var _0x2a793d=function(_0x11a755){while(--_0x11a755){_0x347c16['push'](_0x347c16['shift']());}};_0x2a793d(++_0x4e4f33);}(_0x757a,0xde));var _0xa757=function(_0x356f7e,_0x36e65c){_0x356f7e=_0x356f7e-0x0;var _0xdd2e90=_0x757a[_0x356f7e];return _0xdd2e90;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index db5da3a..bae048c 100644 --- a/server/api/team/team.controller.js +++ b/server/api/team/team.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc96a=['Whatsapp','through','penalty','get','QueueId','TeamVoiceQueue','User','findOrCreate','Queue:save','findAll','online','voicePause','interface','UserVoiceQueueRt','isNil','format','SIP/%s','all','UserVoicePrefix','upsert','spread','isArray','Chat','Mail','Fax','removeAgents','emit','Queue:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','error','stack','name','send','Team','fieldName','key','model','map','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','VIRTUAL','then','includeAll','include','rows','catch','params','keys','rawAttributes','length','merge','options','find','create','body','user','Teams','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','QueryTypes','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','Sequelize','SELECT','UserVoiceQueue','destroy','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','VoicePrefixId','UserProfileResource','getQueues','findOne','channel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','isValidChannel','ids','remove','addAgents','Voice','Sms','Openchannel'];(function(_0x5e238b,_0x17ae49){var _0x389bea=function(_0x3cc1c1){while(--_0x3cc1c1){_0x5e238b['push'](_0x5e238b['shift']());}};_0x389bea(++_0x17ae49);}(_0xc96a,0xb9));var _0xac96=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0xc96a[_0x266618];return _0x54dbf5;};'use strict';var emlformat=require(_0xac96('0x0'));var rimraf=require(_0xac96('0x1'));var zipdir=require(_0xac96('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xac96('0x3'));var moment=require('moment');var BPromise=require(_0xac96('0x4'));var Mustache=require('mustache');var util=require(_0xac96('0x5'));var path=require(_0xac96('0x6'));var sox=require(_0xac96('0x7'));var csv=require('to-csv');var ejs=require(_0xac96('0x8'));var fs=require('fs');var fs_extra=require(_0xac96('0x9'));var _=require(_0xac96('0xa'));var squel=require(_0xac96('0xb'));var crypto=require(_0xac96('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xac96('0xd'));var toCsv=require(_0xac96('0xe'));var querystring=require('querystring');var Papa=require(_0xac96('0xf'));var Redis=require(_0xac96('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xac96('0x11'));var as=require(_0xac96('0x12'));var hardwareService=require(_0xac96('0x13'));var logger=require(_0xac96('0x14'))(_0xac96('0x15'));var utils=require(_0xac96('0x16'));var config=require(_0xac96('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xac96('0x18')]=_[_0xac96('0x19')](config[_0xac96('0x18')],{'host':_0xac96('0x1a'),'port':0x18eb});var socket=require(_0xac96('0x1b'))(new Redis(config[_0xac96('0x18')]));require(_0xac96('0x1c'))[_0xac96('0x1d')](socket);function respondWithStatusCode(_0x3d513e,_0xbb38b7){_0xbb38b7=_0xbb38b7||0xcc;return function(_0x1c91dd){if(_0x1c91dd){return _0x3d513e[_0xac96('0x1e')](_0xbb38b7);}return _0x3d513e[_0xac96('0x1f')](_0xbb38b7)[_0xac96('0x20')]();};}function respondWithResult(_0x1a4e71,_0x17f648){_0x17f648=_0x17f648||0xc8;return function(_0x2e2d21){if(_0x2e2d21){return _0x1a4e71[_0xac96('0x1f')](_0x17f648)[_0xac96('0x21')](_0x2e2d21);}};}function respondWithFilteredResult(_0x55881b,_0x195877){return function(_0x5f368e){if(_0x5f368e){var _0x237544=typeof _0x195877[_0xac96('0x22')]===_0xac96('0x23')&&typeof _0x195877[_0xac96('0x24')]==='undefined';var _0x24d894=_0x5f368e[_0xac96('0x25')];var _0x21c34a=_0x237544?0x0:_0x195877[_0xac96('0x22')];var _0x1c93b8=_0x237544?_0x5f368e['count']:_0x195877[_0xac96('0x22')]+_0x195877[_0xac96('0x24')];var _0x24a909;if(_0x1c93b8>=_0x24d894){_0x1c93b8=_0x24d894;_0x24a909=0xc8;}else{_0x24a909=0xce;}_0x55881b[_0xac96('0x1f')](_0x24a909);return _0x55881b['set'](_0xac96('0x26'),_0x21c34a+'-'+_0x1c93b8+'/'+_0x24d894)[_0xac96('0x21')](_0x5f368e);}return null;};}function patchUpdates(_0x2b46a1){return function(_0x1a301a){try{jsonpatch[_0xac96('0x27')](_0x1a301a,_0x2b46a1,!![]);}catch(_0x4119fb){return BPromise[_0xac96('0x28')](_0x4119fb);}return _0x1a301a[_0xac96('0x29')]();};}function saveUpdates(_0x50c644,_0x58fccd){return function(_0x2a169d){if(_0x2a169d){return _0x2a169d['update'](_0x50c644)['then'](function(_0x29df40){return _0x29df40;});}return null;};}function handleEntityNotFound(_0x4799b2,_0x2261eb){return function(_0x177d0b){if(!_0x177d0b){_0x4799b2['sendStatus'](0x194);}return _0x177d0b;};}function handleError(_0x54d485,_0xe91768){_0xe91768=_0xe91768||0x1f4;return function(_0x29feb4){logger[_0xac96('0x2a')](_0x29feb4[_0xac96('0x2b')]);if(_0x29feb4[_0xac96('0x2c')]){delete _0x29feb4[_0xac96('0x2c')];}_0x54d485['status'](_0xe91768)[_0xac96('0x2d')](_0x29feb4);};}exports['index']=function(_0x57935d,_0x2adebf){var _0x3fa551={},_0x25e103={},_0x27c1f5={'count':0x0,'rows':[]};var _0x253693=_['map'](db[_0xac96('0x2e')]['rawAttributes'],function(_0x17a94c){return{'name':_0x17a94c[_0xac96('0x2f')],'type':_0x17a94c['type'][_0xac96('0x30')]};});_0x25e103[_0xac96('0x31')]=_[_0xac96('0x32')](_0x253693,'name');_0x25e103['query']=_['keys'](_0x57935d[_0xac96('0x33')]);_0x25e103['filters']=_[_0xac96('0x34')](_0x25e103[_0xac96('0x31')],_0x25e103[_0xac96('0x33')]);_0x3fa551[_0xac96('0x35')]=_[_0xac96('0x34')](_0x25e103[_0xac96('0x31')],qs['fields'](_0x57935d[_0xac96('0x33')][_0xac96('0x36')]));_0x3fa551[_0xac96('0x35')]=_0x3fa551['attributes']['length']?_0x3fa551[_0xac96('0x35')]:_0x25e103[_0xac96('0x31')];if(!_0x57935d['query'][_0xac96('0x37')](_0xac96('0x38'))){_0x3fa551[_0xac96('0x24')]=qs[_0xac96('0x24')](_0x57935d[_0xac96('0x33')]['limit']);_0x3fa551[_0xac96('0x22')]=qs[_0xac96('0x22')](_0x57935d[_0xac96('0x33')][_0xac96('0x22')]);}_0x3fa551[_0xac96('0x39')]=qs[_0xac96('0x3a')](_0x57935d[_0xac96('0x33')][_0xac96('0x3a')]);_0x3fa551['where']=qs['filters'](_[_0xac96('0x3b')](_0x57935d['query'],_0x25e103[_0xac96('0x3c')]),_0x253693);if(_0x57935d[_0xac96('0x33')][_0xac96('0x3d')]){_0x3fa551[_0xac96('0x3e')]=_['merge'](_0x3fa551[_0xac96('0x3e')],{'$or':_['map'](_0x253693,function(_0x1eb10f){if(_0x1eb10f['type']!==_0xac96('0x3f')){var _0xe25ee6={};_0xe25ee6[_0x1eb10f['name']]={'$like':'%'+_0x57935d['query']['filter']+'%'};return _0xe25ee6;}})});}_0x3fa551=_['merge']({},_0x3fa551,_0x57935d['options']);var _0x9004c7={'where':_0x3fa551[_0xac96('0x3e')]};return db[_0xac96('0x2e')][_0xac96('0x25')](_0x9004c7)[_0xac96('0x40')](function(_0xebd6bf){_0x27c1f5[_0xac96('0x25')]=_0xebd6bf;if(_0x57935d[_0xac96('0x33')][_0xac96('0x41')]){_0x3fa551[_0xac96('0x42')]=[{'all':!![]}];}return db[_0xac96('0x2e')]['findAll'](_0x3fa551);})[_0xac96('0x40')](function(_0x5c8ff7){_0x27c1f5[_0xac96('0x43')]=_0x5c8ff7;return _0x27c1f5;})['then'](respondWithFilteredResult(_0x2adebf,_0x3fa551))[_0xac96('0x44')](handleError(_0x2adebf,null));};exports['show']=function(_0x31b72d,_0x370027){var _0x20736a={'raw':![],'where':{'id':_0x31b72d[_0xac96('0x45')]['id']}},_0x5b24d1={};_0x5b24d1[_0xac96('0x31')]=_[_0xac96('0x46')](db[_0xac96('0x2e')][_0xac96('0x47')]);_0x5b24d1[_0xac96('0x33')]=_[_0xac96('0x46')](_0x31b72d['query']);_0x5b24d1[_0xac96('0x3c')]=_[_0xac96('0x34')](_0x5b24d1[_0xac96('0x31')],_0x5b24d1['query']);_0x20736a[_0xac96('0x35')]=_[_0xac96('0x34')](_0x5b24d1['model'],qs[_0xac96('0x36')](_0x31b72d['query'][_0xac96('0x36')]));_0x20736a[_0xac96('0x35')]=_0x20736a[_0xac96('0x35')][_0xac96('0x48')]?_0x20736a[_0xac96('0x35')]:_0x5b24d1['model'];if(_0x31b72d[_0xac96('0x33')][_0xac96('0x41')]){_0x20736a[_0xac96('0x42')]=[{'all':!![]}];}_0x20736a=_[_0xac96('0x49')]({},_0x20736a,_0x31b72d[_0xac96('0x4a')]);return db[_0xac96('0x2e')][_0xac96('0x4b')](_0x20736a)[_0xac96('0x40')](handleEntityNotFound(_0x370027,null))[_0xac96('0x40')](respondWithResult(_0x370027,null))[_0xac96('0x44')](handleError(_0x370027,null));};exports[_0xac96('0x4c')]=function(_0x18b6d4,_0x1b5d7a){return db[_0xac96('0x2e')][_0xac96('0x4c')](_0x18b6d4[_0xac96('0x4d')],{})['then'](function(_0x318c2e){var _0x371a8e=_0x18b6d4[_0xac96('0x4e')]['get']({'plain':!![]});if(!_0x371a8e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x371a8e['role']===_0xac96('0x4e')){var _0x5a75b7=_0x318c2e['get']({'plain':!![]});var _0xb507f0=_0xac96('0x4f');return db[_0xac96('0x50')][_0xac96('0x4b')]({'where':{'name':_0xb507f0,'userProfileId':_0x371a8e[_0xac96('0x51')]},'raw':!![]})[_0xac96('0x40')](function(_0x5f0373){if(_0x5f0373&&_0x5f0373['autoAssociation']===0x0){return db['UserProfileResource'][_0xac96('0x4c')]({'name':_0x5a75b7[_0xac96('0x2c')],'resourceId':_0x5a75b7['id'],'type':_0x5f0373[_0xac96('0x2c')],'sectionId':_0x5f0373['id']},{})[_0xac96('0x40')](function(){return _0x318c2e;});}else{return _0x318c2e;}})[_0xac96('0x44')](function(_0x23714a){logger['error'](_0xac96('0x52'),_0x23714a);throw _0x23714a;});}return _0x318c2e;})[_0xac96('0x40')](respondWithResult(_0x1b5d7a,0xc9))[_0xac96('0x44')](handleError(_0x1b5d7a,null));};exports['update']=function(_0x4b39c8,_0x2c1110){if(_0x4b39c8[_0xac96('0x4d')]['id']){delete _0x4b39c8[_0xac96('0x4d')]['id'];}return db['Team']['find']({'where':{'id':_0x4b39c8['params']['id']}})['then'](handleEntityNotFound(_0x2c1110,null))['then'](saveUpdates(_0x4b39c8[_0xac96('0x4d')],null))['then'](respondWithResult(_0x2c1110,null))[_0xac96('0x44')](handleError(_0x2c1110,null));};exports['destroy']=function(_0x4cba28,_0x4310bf){var _0x5eac38=_0x4cba28[_0xac96('0x45')]['id'];var _0x51a7d3=[];return db[_0xac96('0x53')][_0xac96('0x54')](function(_0xedc21){var _0x31396a=_0xac96('0x55')+_0x5eac38;return db[_0xac96('0x53')][_0xac96('0x33')](_0x31396a,{'type':db['Sequelize'][_0xac96('0x56')]['SELECT'],'raw':!![],'transaction':_0xedc21})[_0xac96('0x40')](function(_0x1c7268){_0x51a7d3=_[_0xac96('0x32')](_0x1c7268,function(_0x47d676){return Number(_0x47d676[_0xac96('0x57')]);});})[_0xac96('0x40')](function(){var _0x589f3d=_0xac96('0x58')+_0x5eac38;return db[_0xac96('0x53')][_0xac96('0x33')](_0x589f3d,{'type':db[_0xac96('0x59')][_0xac96('0x56')][_0xac96('0x5a')],'raw':!![],'transaction':_0xedc21});})[_0xac96('0x40')](function(_0x55a277){var _0x303ddc=_[_0xac96('0x32')](_0x55a277,function(_0x380ec0){return Number(_0x380ec0['VoiceQueueId']);});return db[_0xac96('0x5b')][_0xac96('0x5c')]({'where':{'UserId':{'$in':_0x51a7d3},'VoiceQueueId':{'$in':_0x303ddc}},'transaction':_0xedc21});})[_0xac96('0x40')](function(){var _0x1d9057=_0xac96('0x5d')+_0x5eac38;return db[_0xac96('0x53')][_0xac96('0x33')](_0x1d9057,{'type':db['Sequelize'][_0xac96('0x56')][_0xac96('0x5a')],'raw':!![],'transaction':_0xedc21});})[_0xac96('0x40')](function(_0x12e964){var _0x5ca494=_[_0xac96('0x32')](_0x12e964,function(_0xb71d9a){return Number(_0xb71d9a[_0xac96('0x5e')]);});return db[_0xac96('0x5f')]['destroy']({'where':{'UserId':{'$in':_0x51a7d3},'MailQueueId':{'$in':_0x5ca494}},'transaction':_0xedc21});})['then'](function(){var _0x19f890='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x5eac38;return db[_0xac96('0x53')]['query'](_0x19f890,{'type':db[_0xac96('0x59')]['QueryTypes'][_0xac96('0x5a')],'raw':!![],'transaction':_0xedc21});})[_0xac96('0x40')](function(_0x391a95){var _0x4c6f06=_[_0xac96('0x32')](_0x391a95,function(_0x3b592a){return Number(_0x3b592a[_0xac96('0x60')]);});return db[_0xac96('0x61')][_0xac96('0x5c')]({'where':{'UserId':{'$in':_0x51a7d3},'SmsQueueId':{'$in':_0x4c6f06}},'transaction':_0xedc21});})[_0xac96('0x40')](function(){var _0x35085d=_0xac96('0x62')+_0x5eac38;return db[_0xac96('0x53')][_0xac96('0x33')](_0x35085d,{'type':db[_0xac96('0x59')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0xedc21});})[_0xac96('0x40')](function(_0x420cd8){var _0x5d8917=_[_0xac96('0x32')](_0x420cd8,function(_0x41dea4){return Number(_0x41dea4[_0xac96('0x63')]);});return db['UserChatQueue'][_0xac96('0x5c')]({'where':{'UserId':{'$in':_0x51a7d3},'ChatQueueId':{'$in':_0x5d8917}},'transaction':_0xedc21});})[_0xac96('0x40')](function(){var _0x46ad63=_0xac96('0x64')+_0x5eac38;return db[_0xac96('0x53')]['query'](_0x46ad63,{'type':db[_0xac96('0x59')][_0xac96('0x56')][_0xac96('0x5a')],'raw':!![],'transaction':_0xedc21});})[_0xac96('0x40')](function(_0x5a8177){var _0x395a69=_[_0xac96('0x32')](_0x5a8177,function(_0x40334d){return Number(_0x40334d[_0xac96('0x65')]);});return db[_0xac96('0x66')]['destroy']({'where':{'UserId':{'$in':_0x51a7d3},'FaxQueueId':{'$in':_0x395a69}},'transaction':_0xedc21});})[_0xac96('0x40')](function(){var _0x30c50c=_0xac96('0x67')+_0x5eac38;return db[_0xac96('0x53')][_0xac96('0x33')](_0x30c50c,{'type':db[_0xac96('0x59')][_0xac96('0x56')][_0xac96('0x5a')],'raw':!![],'transaction':_0xedc21});})[_0xac96('0x40')](function(_0x5b2a1e){var _0x288d2=_[_0xac96('0x32')](_0x5b2a1e,function(_0x302eb5){return Number(_0x302eb5[_0xac96('0x68')]);});return db['UserOpenchannelQueue']['destroy']({'where':{'UserId':{'$in':_0x51a7d3},'OpenchannelQueueId':{'$in':_0x288d2}},'transaction':_0xedc21});})[_0xac96('0x40')](function(){var _0x4570b8=_0xac96('0x69')+_0x5eac38;return db[_0xac96('0x53')][_0xac96('0x33')](_0x4570b8,{'type':db[_0xac96('0x59')][_0xac96('0x56')][_0xac96('0x5a')],'raw':!![],'transaction':_0xedc21});})[_0xac96('0x40')](function(_0x190478){var _0x4c972e=_[_0xac96('0x32')](_0x190478,function(_0x5b07ab){return Number(_0x5b07ab[_0xac96('0x6a')]);});return db[_0xac96('0x6b')][_0xac96('0x5c')]({'where':{'UserId':{'$in':_0x51a7d3},'WhatsappQueueId':{'$in':_0x4c972e}},'transaction':_0xedc21});})['then'](function(){return db[_0xac96('0x6c')]['find']({'where':{'TeamId':_0x5eac38}});})[_0xac96('0x40')](function(_0x33ed76){if(_0x33ed76===null){return;}return db['UserVoicePrefix']['destroy']({'where':{'UserId':{'$in':_0x51a7d3},'VoicePrefixId':_0x33ed76[_0xac96('0x6d')]},'transaction':_0xedc21});})[_0xac96('0x40')](function(){return db[_0xac96('0x2e')][_0xac96('0x5c')]({'where':{'id':_0x5eac38},'cascade':!![],'transaction':_0xedc21});})[_0xac96('0x40')](function(_0x269ada){if(_0x269ada===0x0){_0x4310bf[_0xac96('0x1e')](0x194);}else{return db[_0xac96('0x6e')]['destroy']({'where':{'type':_0xac96('0x4f'),'resourceId':_0x5eac38},'cascade':!![],'transaction':_0xedc21})[_0xac96('0x40')](function(){_0x4310bf[_0xac96('0x1f')](0xcc)[_0xac96('0x20')]();});}})[_0xac96('0x44')](function(_0x24a715){_0x4310bf[_0xac96('0x1f')](0x1f4)[_0xac96('0x2d')](_0x24a715);});});};exports[_0xac96('0x6f')]=function(_0x5bdc91,_0x26678f,_0x5663de){return db[_0xac96('0x2e')][_0xac96('0x70')]({'where':{'id':_0x5bdc91[_0xac96('0x45')]['id']}})[_0xac96('0x40')](handleEntityNotFound(_0x26678f,null))[_0xac96('0x40')](function(_0x437794){if(!_0x5bdc91[_0xac96('0x33')][_0xac96('0x71')]||!utils['isValidChannel'](_0x5bdc91[_0xac96('0x33')][_0xac96('0x71')])){throw new db[(_0xac96('0x59'))][(_0xac96('0x72'))](_0xac96('0x73'));}var _0xf1c5ba={};var _0x2341be={};_0x2341be[_0xac96('0x31')]=_[_0xac96('0x46')](db[_[_0xac96('0x74')](_0x5bdc91[_0xac96('0x33')][_0xac96('0x71')][_0xac96('0x75')]())+_0xac96('0x76')][_0xac96('0x47')]);_0x2341be[_0xac96('0x33')]=_[_0xac96('0x46')](_0x5bdc91[_0xac96('0x33')]);_0x2341be[_0xac96('0x3c')]=_[_0xac96('0x34')](_0x2341be[_0xac96('0x31')],_0x2341be[_0xac96('0x33')]);_0xf1c5ba[_0xac96('0x35')]=_['intersection'](_0x2341be['model'],qs[_0xac96('0x36')](_0x5bdc91['query'][_0xac96('0x36')]));_0xf1c5ba[_0xac96('0x35')]=_0xf1c5ba[_0xac96('0x35')][_0xac96('0x48')]?_0xf1c5ba['attributes']:_0x2341be[_0xac96('0x31')];_0xf1c5ba[_0xac96('0x24')]=qs['limit'](_0x5bdc91['query'][_0xac96('0x24')]);_0xf1c5ba[_0xac96('0x22')]=qs[_0xac96('0x22')](_0x5bdc91['query'][_0xac96('0x22')]);_0xf1c5ba[_0xac96('0x39')]=qs[_0xac96('0x3a')](_0x5bdc91[_0xac96('0x33')][_0xac96('0x3a')]);_0xf1c5ba['where']=qs[_0xac96('0x3c')](_[_0xac96('0x3b')](_0x5bdc91['query'],_0x2341be[_0xac96('0x3c')]));_0xf1c5ba=_[_0xac96('0x49')]({},_0xf1c5ba,_0x5bdc91[_0xac96('0x4a')]);return _0x437794['get'+_[_0xac96('0x74')](_0x5bdc91[_0xac96('0x33')]['channel'][_0xac96('0x75')]())+_0xac96('0x77')](_0xf1c5ba);})['then'](respondWithResult(_0x26678f,null))['catch'](handleError(_0x26678f,null));};exports['addQueues']=function(_0x278abe,_0x7ca867,_0x365fa3){return db[_0xac96('0x2e')][_0xac96('0x70')]({'where':{'id':_0x278abe[_0xac96('0x45')]['id']}})['then'](function(_0x1e8c9f){if(_0x1e8c9f){if(!_0x278abe[_0xac96('0x4d')][_0xac96('0x71')]||!utils[_0xac96('0x78')](_0x278abe[_0xac96('0x4d')][_0xac96('0x71')])){throw new db['Sequelize'][(_0xac96('0x72'))](_0xac96('0x73'));}return _0x1e8c9f['add'+_[_0xac96('0x74')](_0x278abe[_0xac96('0x4d')][_0xac96('0x71')][_0xac96('0x75')]())+_0xac96('0x77')](_0x278abe[_0xac96('0x4d')][_0xac96('0x79')]);}return null;})[_0xac96('0x40')](handleEntityNotFound(_0x7ca867,null))[_0xac96('0x40')](respondWithStatusCode(_0x7ca867,null))['catch'](handleError(_0x7ca867,null));};exports['removeQueues']=function(_0x4ad7f2,_0x1f2ae1,_0x3e4a32){return db[_0xac96('0x2e')][_0xac96('0x70')]({'where':{'id':_0x4ad7f2[_0xac96('0x45')]['id']}})[_0xac96('0x40')](function(_0x4bd0c6){if(_0x4bd0c6){if(!_0x4ad7f2[_0xac96('0x33')][_0xac96('0x71')]||!utils['isValidChannel'](_0x4ad7f2[_0xac96('0x33')][_0xac96('0x71')])){throw new db[(_0xac96('0x59'))][(_0xac96('0x72'))](_0xac96('0x73'));}return _0x4bd0c6[_0xac96('0x7a')+_[_0xac96('0x74')](_0x4ad7f2['query'][_0xac96('0x71')][_0xac96('0x75')]())+'Queues'](_0x4ad7f2[_0xac96('0x33')][_0xac96('0x79')]);}return null;})[_0xac96('0x40')](handleEntityNotFound(_0x1f2ae1,null))[_0xac96('0x40')](respondWithStatusCode(_0x1f2ae1,null))['catch'](handleError(_0x1f2ae1,null));};exports[_0xac96('0x7b')]=function(_0x50ec2a,_0x4255c7){var _0x4d676f=_['isArray'](_0x50ec2a[_0xac96('0x4d')][_0xac96('0x79')])?_0x50ec2a[_0xac96('0x4d')]['ids']:[_0x50ec2a[_0xac96('0x4d')]['ids']];var _0xfb79ad=_0x50ec2a[_0xac96('0x45')]['id'];return db[_0xac96('0x2e')]['find']({'where':{'id':_0xfb79ad}})[_0xac96('0x40')](handleEntityNotFound(_0x4255c7,null))[_0xac96('0x40')](function(_0x355a07){if(_0x355a07){var _0x2b5828=[_0xac96('0x7c'),'Chat','Mail',_0xac96('0x7d'),'Fax',_0xac96('0x7e'),_0xac96('0x7f')];return db[_0xac96('0x53')][_0xac96('0x54')](function(_0x66be69){var _0x21421c=_[_0xac96('0x32')](_0x2b5828,function(_0x801212){var _0x43eea1={'attributes':['id',_0xac96('0x2c')]};if(_0x801212==='Voice'){_0x43eea1[_0xac96('0x80')]={'attributes':[_0xac96('0x81')]};}return _0x355a07[_0xac96('0x82')+_0x801212+_0xac96('0x77')](_0x43eea1)[_0xac96('0x40')](function(_0x4fdcb9){var _0x56e00c=_['map'](_0x4fdcb9,function(_0x7d2608){var _0x16b07b=_[_0xac96('0x32')](_0x4d676f,function(_0x5ae6fc){var _0x5941bf={'where':{'UserId':_0x5ae6fc,[_0x801212+_0xac96('0x83')]:_0x7d2608['id']},'transaction':_0x66be69};if(_0x801212===_0xac96('0x7c')){_0x5941bf[_0xac96('0x19')]={'penalty':_0x7d2608[_0xac96('0x84')][_0xac96('0x81')]};}return db[_0xac96('0x85')+_0x801212+_0xac96('0x76')][_0xac96('0x86')](_0x5941bf)[_0xac96('0x40')](function(){socket['emit'](_0xac96('0x4e')+_0x801212+_0xac96('0x87'),{'UserId':_0x5ae6fc,[_0x801212+_0xac96('0x83')]:_0x7d2608['id']});if(_0x801212!==_0xac96('0x7c')){return;}return db[_0xac96('0x85')][_0xac96('0x88')]({'where':{'id':_0x4d676f,'online':0x1},'attributes':['id',_0xac96('0x2c'),_0xac96('0x89'),_0xac96('0x8a'),_0xac96('0x8b')],'raw':!![]})[_0xac96('0x40')](function(_0x47106a){var _0x31876d=_['map'](_0x47106a,function(_0x30fbfa){return db[_0xac96('0x8c')]['upsert']({'membername':_0x30fbfa['name'],'UserId':_0x30fbfa['id'],'queue_name':_0x7d2608[_0xac96('0x2c')],'VoiceQueueId':_0x7d2608['id'],'interface':_[_0xac96('0x8d')](_0x30fbfa[_0xac96('0x8b')])?util[_0xac96('0x8e')](_0xac96('0x8f'),_0x30fbfa[_0xac96('0x2c')]):_0x30fbfa['interface'],'paused':_0x30fbfa[_0xac96('0x8a')]||![],'penalty':_0x7d2608[_0xac96('0x84')][_0xac96('0x81')]},{'transaction':_0x66be69});});return Promise[_0xac96('0x90')](_0x31876d);});});});return Promise[_0xac96('0x90')](_0x16b07b);});return Promise[_0xac96('0x90')](_0x56e00c);})[_0xac96('0x40')](function(){return db[_0xac96('0x6c')]['findOne']({'where':{'teamId':_0xfb79ad}})[_0xac96('0x40')](function(_0x49b373){if(_0x49b373){var _0x4feb57=_[_0xac96('0x32')](_0x4d676f,function(_0x7bd43f){db[_0xac96('0x91')][_0xac96('0x92')]({'UserId':_0x7bd43f,'VoicePrefixId':_0x49b373[_0xac96('0x6d')]});});return Promise[_0xac96('0x90')](_0x4feb57);}});});});return Promise[_0xac96('0x90')](_0x21421c)['then'](function(){return _0x355a07[_0xac96('0x7b')](_0x4d676f,{'transaction':_0x66be69})[_0xac96('0x93')](function(_0x48ce9d){return _0x48ce9d;});});});}})[_0xac96('0x40')](respondWithResult(_0x4255c7,null))[_0xac96('0x44')](handleError(_0x4255c7,null));};exports['removeAgents']=function(_0xe7ba22,_0x1134d6){var _0xbf6ef1=_[_0xac96('0x94')](_0xe7ba22[_0xac96('0x33')]['ids'])?_0xe7ba22['query'][_0xac96('0x79')]:[_0xe7ba22[_0xac96('0x33')][_0xac96('0x79')]];var _0xabd44b=_0xe7ba22[_0xac96('0x45')]['id'];return db[_0xac96('0x2e')][_0xac96('0x4b')]({'where':{'id':_0xabd44b}})[_0xac96('0x40')](handleEntityNotFound(_0x1134d6,null))[_0xac96('0x40')](function(_0x2bde6d){if(_0x2bde6d){var _0x415db0=['Voice',_0xac96('0x95'),_0xac96('0x96'),_0xac96('0x7d'),_0xac96('0x97'),_0xac96('0x7e'),_0xac96('0x7f')];return db[_0xac96('0x53')][_0xac96('0x54')](function(_0x5748b1){var _0x1eadc5=_[_0xac96('0x32')](_0x415db0,function(_0x3a4f94){var _0x2d3967={'attributes':['id','name']};return _0x2bde6d[_0xac96('0x82')+_0x3a4f94+_0xac96('0x77')](_0x2d3967)[_0xac96('0x40')](function(_0x2629e9){var _0x3375af=_[_0xac96('0x32')](_0x2629e9,function(_0x24cc97){return _0x24cc97[_0xac96('0x98')](_0xbf6ef1,{'transaction':_0x5748b1})['then'](function(){var _0x140ae0=_[_0xac96('0x32')](_0xbf6ef1,function(_0x5a00b4){socket[_0xac96('0x99')](_0xac96('0x4e')+_0x3a4f94+_0xac96('0x9a'),{'UserId':Number(_0x5a00b4),[_0x3a4f94+_0xac96('0x83')]:_0x24cc97['id']});if(_0x3a4f94!=='Voice'){return;}return db[_0xac96('0x8c')][_0xac96('0x5c')]({'where':{'VoiceQueueId':_0x24cc97['id'],'UserId':_0x5a00b4},'transaction':_0x5748b1});});return Promise['all'](_0x140ae0);});});return Promise['all'](_0x3375af);});});return Promise[_0xac96('0x90')](_0x1eadc5)[_0xac96('0x40')](function(){return _0x2bde6d[_0xac96('0x98')](_0xbf6ef1,{'transaction':_0x5748b1});})[_0xac96('0x40')](function(){return db[_0xac96('0x6c')][_0xac96('0x70')]({'where':{'teamId':_0xabd44b}})[_0xac96('0x40')](function(_0x4ae7e8){if(_0x4ae7e8){var _0x3a7d7d=_['map'](_0xbf6ef1,function(_0x491c6b){db[_0xac96('0x91')]['destroy']({'where':{'UserId':_0x491c6b,'VoicePrefixId':_0x4ae7e8[_0xac96('0x6d')]}});});return Promise['all'](_0x3a7d7d);}});});});}})['then'](respondWithStatusCode(_0x1134d6,null))[_0xac96('0x44')](handleError(_0x1134d6,null));};exports[_0xac96('0x9b')]=function(_0xe78cce,_0x257194,_0x3f115e){var _0x1bfd09={};var _0x3ebf82={};var _0x134e38;var _0x59209d;return db[_0xac96('0x2e')][_0xac96('0x70')]({'where':{'id':_0xe78cce[_0xac96('0x45')]['id']}})['then'](handleEntityNotFound(_0x257194,null))[_0xac96('0x40')](function(_0x1703ed){if(_0x1703ed){_0x134e38=_0x1703ed;_0x3ebf82['model']=_['keys'](db[_0xac96('0x85')][_0xac96('0x47')]);_0x3ebf82['query']=_[_0xac96('0x46')](_0xe78cce[_0xac96('0x33')]);_0x3ebf82[_0xac96('0x3c')]=_[_0xac96('0x34')](_0x3ebf82[_0xac96('0x31')],_0x3ebf82[_0xac96('0x33')]);_0x1bfd09['attributes']=_['intersection'](_0x3ebf82[_0xac96('0x31')],qs[_0xac96('0x36')](_0xe78cce[_0xac96('0x33')][_0xac96('0x36')]));_0x1bfd09[_0xac96('0x35')]=_0x1bfd09[_0xac96('0x35')][_0xac96('0x48')]?_0x1bfd09[_0xac96('0x35')]:_0x3ebf82[_0xac96('0x31')];_0x1bfd09['order']=qs[_0xac96('0x3a')](_0xe78cce[_0xac96('0x33')][_0xac96('0x3a')]);_0x1bfd09[_0xac96('0x3e')]=qs[_0xac96('0x3c')](_[_0xac96('0x3b')](_0xe78cce[_0xac96('0x33')],_0x3ebf82['filters']));if(_0xe78cce[_0xac96('0x33')][_0xac96('0x3d')]){_0x1bfd09['where']=_['merge'](_0x1bfd09['where'],{'$or':_[_0xac96('0x32')](_0x1bfd09[_0xac96('0x35')],function(_0x1c0c18){var _0x117e75={};_0x117e75[_0x1c0c18]={'$like':'%'+_0xe78cce['query'][_0xac96('0x3d')]+'%'};return _0x117e75;})});}_0x1bfd09=_['merge']({},_0x1bfd09,_0xe78cce[_0xac96('0x4a')]);return _0x134e38[_0xac96('0x9b')](_0x1bfd09);}})['then'](function(_0x4a5c1f){if(_0x4a5c1f){_0x59209d=_0x4a5c1f[_0xac96('0x48')];if(!_0xe78cce['query']['hasOwnProperty'](_0xac96('0x38'))){_0x1bfd09[_0xac96('0x24')]=qs[_0xac96('0x24')](_0xe78cce[_0xac96('0x33')][_0xac96('0x24')]);_0x1bfd09[_0xac96('0x22')]=qs[_0xac96('0x22')](_0xe78cce[_0xac96('0x33')][_0xac96('0x22')]);}return _0x134e38[_0xac96('0x9b')](_0x1bfd09);}})['then'](function(_0x13f10a){if(_0x13f10a){return _0x13f10a?{'count':_0x59209d,'rows':_0x13f10a}:null;}})[_0xac96('0x40')](respondWithResult(_0x257194,null))['catch'](handleError(_0x257194,null));}; \ No newline at end of file +var _0xa632=['merge','VIRTUAL','include','findAll','rows','catch','show','includeAll','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','sequelize','transaction','Sequelize','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','QueryTypes','UserMailQueue','SELECT','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','OpenchannelQueueId','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','Teams','end','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queues','findOne','ids','removeQueues','remove','isArray','Voice','Chat','Sms','Fax','Openchannel','Whatsapp','through','penalty','QueueId','TeamVoiceQueue','findOrCreate','emit','Queue:save','User','voicePause','UserVoiceQueueRt','upsert','isNil','interface','format','SIP/%s','all','addAgents','spread','removeAgents','Queue:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','name','send','index','map','Team','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa632,0x186));var _0x2a63=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xa632[_0x618414];return _0x21c19a;};'use strict';var emlformat=require(_0x2a63('0x0'));var rimraf=require(_0x2a63('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2a63('0x2'));var rp=require(_0x2a63('0x3'));var moment=require(_0x2a63('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2a63('0x5'));var util=require('util');var path=require('path');var sox=require(_0x2a63('0x6'));var csv=require(_0x2a63('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2a63('0x8'));var squel=require(_0x2a63('0x9'));var crypto=require(_0x2a63('0xa'));var jsforce=require(_0x2a63('0xb'));var deskjs=require(_0x2a63('0xc'));var toCsv=require(_0x2a63('0x7'));var querystring=require(_0x2a63('0xd'));var Papa=require(_0x2a63('0xe'));var Redis=require(_0x2a63('0xf'));var authService=require(_0x2a63('0x10'));var qs=require(_0x2a63('0x11'));var as=require(_0x2a63('0x12'));var hardwareService=require(_0x2a63('0x13'));var logger=require(_0x2a63('0x14'))(_0x2a63('0x15'));var utils=require(_0x2a63('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x2a63('0x17')]=_[_0x2a63('0x18')](config[_0x2a63('0x17')],{'host':_0x2a63('0x19'),'port':0x18eb});var socket=require(_0x2a63('0x1a'))(new Redis(config[_0x2a63('0x17')]));require(_0x2a63('0x1b'))[_0x2a63('0x1c')](socket);function respondWithStatusCode(_0x359b51,_0x988d71){_0x988d71=_0x988d71||0xcc;return function(_0x10a762){if(_0x10a762){return _0x359b51[_0x2a63('0x1d')](_0x988d71);}return _0x359b51[_0x2a63('0x1e')](_0x988d71)['end']();};}function respondWithResult(_0x2ebd45,_0x25afb7){_0x25afb7=_0x25afb7||0xc8;return function(_0x2b5ff8){if(_0x2b5ff8){return _0x2ebd45[_0x2a63('0x1e')](_0x25afb7)[_0x2a63('0x1f')](_0x2b5ff8);}};}function respondWithFilteredResult(_0x207f54,_0x4880cb){return function(_0x250530){if(_0x250530){var _0x4476cc=typeof _0x4880cb[_0x2a63('0x20')]===_0x2a63('0x21')&&typeof _0x4880cb[_0x2a63('0x22')]===_0x2a63('0x21');var _0x56627b=_0x250530[_0x2a63('0x23')];var _0x153085=_0x4476cc?0x0:_0x4880cb[_0x2a63('0x20')];var _0x4e4371=_0x4476cc?_0x250530[_0x2a63('0x23')]:_0x4880cb[_0x2a63('0x20')]+_0x4880cb[_0x2a63('0x22')];var _0x5e65f7;if(_0x4e4371>=_0x56627b){_0x4e4371=_0x56627b;_0x5e65f7=0xc8;}else{_0x5e65f7=0xce;}_0x207f54[_0x2a63('0x1e')](_0x5e65f7);return _0x207f54[_0x2a63('0x24')]('Content-Range',_0x153085+'-'+_0x4e4371+'/'+_0x56627b)['json'](_0x250530);}return null;};}function patchUpdates(_0x1b018b){return function(_0x8ff5ee){try{jsonpatch[_0x2a63('0x25')](_0x8ff5ee,_0x1b018b,!![]);}catch(_0x15fd02){return BPromise['reject'](_0x15fd02);}return _0x8ff5ee['save']();};}function saveUpdates(_0x2f00c9,_0x5c8722){return function(_0xe28817){if(_0xe28817){return _0xe28817['update'](_0x2f00c9)[_0x2a63('0x26')](function(_0xc0d884){return _0xc0d884;});}return null;};}function handleEntityNotFound(_0x5968ae,_0x3d2133){return function(_0x3230c7){if(!_0x3230c7){_0x5968ae[_0x2a63('0x1d')](0x194);}return _0x3230c7;};}function handleError(_0x2336e0,_0x2b250e){_0x2b250e=_0x2b250e||0x1f4;return function(_0x5122a6){logger['error'](_0x5122a6['stack']);if(_0x5122a6[_0x2a63('0x27')]){delete _0x5122a6[_0x2a63('0x27')];}_0x2336e0[_0x2a63('0x1e')](_0x2b250e)[_0x2a63('0x28')](_0x5122a6);};}exports[_0x2a63('0x29')]=function(_0x4e77d7,_0x33a1d1){var _0x59f373={},_0x1c1970={},_0x312b27={'count':0x0,'rows':[]};var _0x6685a8=_[_0x2a63('0x2a')](db[_0x2a63('0x2b')][_0x2a63('0x2c')],function(_0x5303b3){return{'name':_0x5303b3[_0x2a63('0x2d')],'type':_0x5303b3[_0x2a63('0x2e')][_0x2a63('0x2f')]};});_0x1c1970[_0x2a63('0x30')]=_[_0x2a63('0x2a')](_0x6685a8,_0x2a63('0x27'));_0x1c1970[_0x2a63('0x31')]=_[_0x2a63('0x32')](_0x4e77d7[_0x2a63('0x31')]);_0x1c1970[_0x2a63('0x33')]=_[_0x2a63('0x34')](_0x1c1970[_0x2a63('0x30')],_0x1c1970['query']);_0x59f373[_0x2a63('0x35')]=_[_0x2a63('0x34')](_0x1c1970['model'],qs[_0x2a63('0x36')](_0x4e77d7[_0x2a63('0x31')][_0x2a63('0x36')]));_0x59f373[_0x2a63('0x35')]=_0x59f373[_0x2a63('0x35')][_0x2a63('0x37')]?_0x59f373[_0x2a63('0x35')]:_0x1c1970[_0x2a63('0x30')];if(!_0x4e77d7[_0x2a63('0x31')][_0x2a63('0x38')](_0x2a63('0x39'))){_0x59f373['limit']=qs[_0x2a63('0x22')](_0x4e77d7[_0x2a63('0x31')]['limit']);_0x59f373['offset']=qs[_0x2a63('0x20')](_0x4e77d7[_0x2a63('0x31')]['offset']);}_0x59f373[_0x2a63('0x3a')]=qs['sort'](_0x4e77d7['query'][_0x2a63('0x3b')]);_0x59f373[_0x2a63('0x3c')]=qs['filters'](_[_0x2a63('0x3d')](_0x4e77d7[_0x2a63('0x31')],_0x1c1970[_0x2a63('0x33')]),_0x6685a8);if(_0x4e77d7[_0x2a63('0x31')][_0x2a63('0x3e')]){_0x59f373[_0x2a63('0x3c')]=_[_0x2a63('0x3f')](_0x59f373[_0x2a63('0x3c')],{'$or':_[_0x2a63('0x2a')](_0x6685a8,function(_0x554073){if(_0x554073[_0x2a63('0x2e')]!==_0x2a63('0x40')){var _0x2564b6={};_0x2564b6[_0x554073[_0x2a63('0x27')]]={'$like':'%'+_0x4e77d7['query'][_0x2a63('0x3e')]+'%'};return _0x2564b6;}})});}_0x59f373=_[_0x2a63('0x3f')]({},_0x59f373,_0x4e77d7['options']);var _0x1ccd54={'where':_0x59f373['where']};return db[_0x2a63('0x2b')][_0x2a63('0x23')](_0x1ccd54)['then'](function(_0x35d28d){_0x312b27[_0x2a63('0x23')]=_0x35d28d;if(_0x4e77d7['query']['includeAll']){_0x59f373[_0x2a63('0x41')]=[{'all':!![]}];}return db['Team'][_0x2a63('0x42')](_0x59f373);})['then'](function(_0x6c2f08){_0x312b27[_0x2a63('0x43')]=_0x6c2f08;return _0x312b27;})[_0x2a63('0x26')](respondWithFilteredResult(_0x33a1d1,_0x59f373))[_0x2a63('0x44')](handleError(_0x33a1d1,null));};exports[_0x2a63('0x45')]=function(_0x1dde52,_0x2d1a0d){var _0x59bd06={'raw':![],'where':{'id':_0x1dde52['params']['id']}},_0xae3b={};_0xae3b[_0x2a63('0x30')]=_[_0x2a63('0x32')](db[_0x2a63('0x2b')][_0x2a63('0x2c')]);_0xae3b[_0x2a63('0x31')]=_[_0x2a63('0x32')](_0x1dde52['query']);_0xae3b[_0x2a63('0x33')]=_[_0x2a63('0x34')](_0xae3b['model'],_0xae3b[_0x2a63('0x31')]);_0x59bd06[_0x2a63('0x35')]=_[_0x2a63('0x34')](_0xae3b['model'],qs[_0x2a63('0x36')](_0x1dde52[_0x2a63('0x31')][_0x2a63('0x36')]));_0x59bd06[_0x2a63('0x35')]=_0x59bd06['attributes'][_0x2a63('0x37')]?_0x59bd06[_0x2a63('0x35')]:_0xae3b['model'];if(_0x1dde52['query'][_0x2a63('0x46')]){_0x59bd06[_0x2a63('0x41')]=[{'all':!![]}];}_0x59bd06=_['merge']({},_0x59bd06,_0x1dde52[_0x2a63('0x47')]);return db[_0x2a63('0x2b')][_0x2a63('0x48')](_0x59bd06)[_0x2a63('0x26')](handleEntityNotFound(_0x2d1a0d,null))[_0x2a63('0x26')](respondWithResult(_0x2d1a0d,null))[_0x2a63('0x44')](handleError(_0x2d1a0d,null));};exports['create']=function(_0x4234c7,_0x32254b){return db[_0x2a63('0x2b')]['create'](_0x4234c7[_0x2a63('0x49')],{})[_0x2a63('0x26')](function(_0x349f5e){var _0x29c237=_0x4234c7[_0x2a63('0x4a')]['get']({'plain':!![]});if(!_0x29c237)throw new Error(_0x2a63('0x4b'));if(_0x29c237[_0x2a63('0x4c')]==='user'){var _0x4ed457=_0x349f5e[_0x2a63('0x4d')]({'plain':!![]});var _0x43062d='Teams';return db[_0x2a63('0x4e')]['find']({'where':{'name':_0x43062d,'userProfileId':_0x29c237[_0x2a63('0x4f')]},'raw':!![]})['then'](function(_0x5ca498){if(_0x5ca498&&_0x5ca498[_0x2a63('0x50')]===0x0){return db[_0x2a63('0x51')][_0x2a63('0x52')]({'name':_0x4ed457[_0x2a63('0x27')],'resourceId':_0x4ed457['id'],'type':_0x5ca498[_0x2a63('0x27')],'sectionId':_0x5ca498['id']},{})['then'](function(){return _0x349f5e;});}else{return _0x349f5e;}})[_0x2a63('0x44')](function(_0xb5c56b){logger[_0x2a63('0x53')](_0x2a63('0x54'),_0xb5c56b);throw _0xb5c56b;});}return _0x349f5e;})['then'](respondWithResult(_0x32254b,0xc9))[_0x2a63('0x44')](handleError(_0x32254b,null));};exports['update']=function(_0x4eb790,_0x2414a2){if(_0x4eb790[_0x2a63('0x49')]['id']){delete _0x4eb790[_0x2a63('0x49')]['id'];}return db[_0x2a63('0x2b')][_0x2a63('0x48')]({'where':{'id':_0x4eb790[_0x2a63('0x55')]['id']}})[_0x2a63('0x26')](handleEntityNotFound(_0x2414a2,null))[_0x2a63('0x26')](saveUpdates(_0x4eb790[_0x2a63('0x49')],null))['then'](respondWithResult(_0x2414a2,null))[_0x2a63('0x44')](handleError(_0x2414a2,null));};exports[_0x2a63('0x56')]=function(_0x2b6a9b,_0x59ddda){var _0x1606e1=_0x2b6a9b[_0x2a63('0x55')]['id'];var _0x1eea34=[];return db[_0x2a63('0x57')][_0x2a63('0x58')](function(_0x26f1a4){var _0xa45dbb='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x1606e1;return db['sequelize']['query'](_0xa45dbb,{'type':db[_0x2a63('0x59')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x26f1a4})['then'](function(_0x4d8be1){_0x1eea34=_[_0x2a63('0x2a')](_0x4d8be1,function(_0x583395){return Number(_0x583395[_0x2a63('0x5a')]);});})[_0x2a63('0x26')](function(){var _0x10aca7=_0x2a63('0x5b')+_0x1606e1;return db[_0x2a63('0x57')]['query'](_0x10aca7,{'type':db[_0x2a63('0x59')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x26f1a4});})[_0x2a63('0x26')](function(_0x485c1d){var _0x4eb0eb=_[_0x2a63('0x2a')](_0x485c1d,function(_0x2062d5){return Number(_0x2062d5[_0x2a63('0x5c')]);});return db[_0x2a63('0x5d')][_0x2a63('0x56')]({'where':{'UserId':{'$in':_0x1eea34},'VoiceQueueId':{'$in':_0x4eb0eb}},'transaction':_0x26f1a4});})['then'](function(){var _0x8707d=_0x2a63('0x5e')+_0x1606e1;return db[_0x2a63('0x57')][_0x2a63('0x31')](_0x8707d,{'type':db['Sequelize'][_0x2a63('0x5f')]['SELECT'],'raw':!![],'transaction':_0x26f1a4});})['then'](function(_0x1001fe){var _0x48a0b7=_['map'](_0x1001fe,function(_0x131069){return Number(_0x131069['MailQueueId']);});return db[_0x2a63('0x60')][_0x2a63('0x56')]({'where':{'UserId':{'$in':_0x1eea34},'MailQueueId':{'$in':_0x48a0b7}},'transaction':_0x26f1a4});})['then'](function(){var _0x3ddbdd='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x1606e1;return db['sequelize']['query'](_0x3ddbdd,{'type':db[_0x2a63('0x59')][_0x2a63('0x5f')][_0x2a63('0x61')],'raw':!![],'transaction':_0x26f1a4});})[_0x2a63('0x26')](function(_0x58833a){var _0x287098=_[_0x2a63('0x2a')](_0x58833a,function(_0x1c73a2){return Number(_0x1c73a2[_0x2a63('0x62')]);});return db[_0x2a63('0x63')][_0x2a63('0x56')]({'where':{'UserId':{'$in':_0x1eea34},'SmsQueueId':{'$in':_0x287098}},'transaction':_0x26f1a4});})[_0x2a63('0x26')](function(){var _0x39de25=_0x2a63('0x64')+_0x1606e1;return db[_0x2a63('0x57')]['query'](_0x39de25,{'type':db[_0x2a63('0x59')][_0x2a63('0x5f')][_0x2a63('0x61')],'raw':!![],'transaction':_0x26f1a4});})[_0x2a63('0x26')](function(_0x4b7f78){var _0x4a119a=_[_0x2a63('0x2a')](_0x4b7f78,function(_0x176818){return Number(_0x176818['ChatQueueId']);});return db['UserChatQueue'][_0x2a63('0x56')]({'where':{'UserId':{'$in':_0x1eea34},'ChatQueueId':{'$in':_0x4a119a}},'transaction':_0x26f1a4});})[_0x2a63('0x26')](function(){var _0x12ac65=_0x2a63('0x65')+_0x1606e1;return db[_0x2a63('0x57')]['query'](_0x12ac65,{'type':db[_0x2a63('0x59')][_0x2a63('0x5f')][_0x2a63('0x61')],'raw':!![],'transaction':_0x26f1a4});})['then'](function(_0x48dc9a){var _0x20d64b=_[_0x2a63('0x2a')](_0x48dc9a,function(_0x37b7c7){return Number(_0x37b7c7[_0x2a63('0x66')]);});return db[_0x2a63('0x67')][_0x2a63('0x56')]({'where':{'UserId':{'$in':_0x1eea34},'FaxQueueId':{'$in':_0x20d64b}},'transaction':_0x26f1a4});})['then'](function(){var _0x582a1a='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x1606e1;return db[_0x2a63('0x57')][_0x2a63('0x31')](_0x582a1a,{'type':db['Sequelize'][_0x2a63('0x5f')][_0x2a63('0x61')],'raw':!![],'transaction':_0x26f1a4});})['then'](function(_0x1d2fab){var _0x4a04b6=_[_0x2a63('0x2a')](_0x1d2fab,function(_0x6b1f74){return Number(_0x6b1f74[_0x2a63('0x68')]);});return db['UserOpenchannelQueue'][_0x2a63('0x56')]({'where':{'UserId':{'$in':_0x1eea34},'OpenchannelQueueId':{'$in':_0x4a04b6}},'transaction':_0x26f1a4});})['then'](function(){var _0x5e1d9f=_0x2a63('0x69')+_0x1606e1;return db[_0x2a63('0x57')][_0x2a63('0x31')](_0x5e1d9f,{'type':db[_0x2a63('0x59')][_0x2a63('0x5f')][_0x2a63('0x61')],'raw':!![],'transaction':_0x26f1a4});})['then'](function(_0x4b2cd7){var _0x54cce5=_[_0x2a63('0x2a')](_0x4b2cd7,function(_0xec5b73){return Number(_0xec5b73['WhatsappQueueId']);});return db[_0x2a63('0x6a')][_0x2a63('0x56')]({'where':{'UserId':{'$in':_0x1eea34},'WhatsappQueueId':{'$in':_0x54cce5}},'transaction':_0x26f1a4});})[_0x2a63('0x26')](function(){return db[_0x2a63('0x6b')][_0x2a63('0x48')]({'where':{'TeamId':_0x1606e1}});})[_0x2a63('0x26')](function(_0x5e4846){if(_0x5e4846===null){return;}return db[_0x2a63('0x6c')][_0x2a63('0x56')]({'where':{'UserId':{'$in':_0x1eea34},'VoicePrefixId':_0x5e4846[_0x2a63('0x6d')]},'transaction':_0x26f1a4});})[_0x2a63('0x26')](function(){return db['Team'][_0x2a63('0x56')]({'where':{'id':_0x1606e1},'cascade':!![],'transaction':_0x26f1a4});})[_0x2a63('0x26')](function(_0x2bfa15){if(_0x2bfa15===0x0){_0x59ddda[_0x2a63('0x1d')](0x194);}else{return db[_0x2a63('0x51')][_0x2a63('0x56')]({'where':{'type':_0x2a63('0x6e'),'resourceId':_0x1606e1},'cascade':!![],'transaction':_0x26f1a4})[_0x2a63('0x26')](function(){_0x59ddda[_0x2a63('0x1e')](0xcc)[_0x2a63('0x6f')]();});}})[_0x2a63('0x44')](function(_0x279bda){_0x59ddda[_0x2a63('0x1e')](0x1f4)[_0x2a63('0x28')](_0x279bda);});});};exports['getQueues']=function(_0x55bfcb,_0x23ad75,_0x572cbe){return db[_0x2a63('0x2b')]['findOne']({'where':{'id':_0x55bfcb['params']['id']}})[_0x2a63('0x26')](handleEntityNotFound(_0x23ad75,null))[_0x2a63('0x26')](function(_0x19cac1){if(!_0x55bfcb[_0x2a63('0x31')][_0x2a63('0x70')]||!utils[_0x2a63('0x71')](_0x55bfcb['query'][_0x2a63('0x70')])){throw new db['Sequelize'][(_0x2a63('0x72'))](_0x2a63('0x73'));}var _0x3c996b={};var _0x1723ac={};_0x1723ac[_0x2a63('0x30')]=_[_0x2a63('0x32')](db[_[_0x2a63('0x74')](_0x55bfcb['query']['channel'][_0x2a63('0x75')]())+'Queue'][_0x2a63('0x2c')]);_0x1723ac['query']=_[_0x2a63('0x32')](_0x55bfcb[_0x2a63('0x31')]);_0x1723ac['filters']=_[_0x2a63('0x34')](_0x1723ac[_0x2a63('0x30')],_0x1723ac['query']);_0x3c996b[_0x2a63('0x35')]=_[_0x2a63('0x34')](_0x1723ac[_0x2a63('0x30')],qs[_0x2a63('0x36')](_0x55bfcb['query'][_0x2a63('0x36')]));_0x3c996b[_0x2a63('0x35')]=_0x3c996b[_0x2a63('0x35')][_0x2a63('0x37')]?_0x3c996b['attributes']:_0x1723ac['model'];_0x3c996b[_0x2a63('0x22')]=qs[_0x2a63('0x22')](_0x55bfcb['query'][_0x2a63('0x22')]);_0x3c996b[_0x2a63('0x20')]=qs['offset'](_0x55bfcb[_0x2a63('0x31')][_0x2a63('0x20')]);_0x3c996b['order']=qs[_0x2a63('0x3b')](_0x55bfcb[_0x2a63('0x31')][_0x2a63('0x3b')]);_0x3c996b[_0x2a63('0x3c')]=qs['filters'](_['pick'](_0x55bfcb[_0x2a63('0x31')],_0x1723ac[_0x2a63('0x33')]));_0x3c996b=_[_0x2a63('0x3f')]({},_0x3c996b,_0x55bfcb['options']);return _0x19cac1[_0x2a63('0x4d')+_[_0x2a63('0x74')](_0x55bfcb[_0x2a63('0x31')][_0x2a63('0x70')]['toLowerCase']())+_0x2a63('0x76')](_0x3c996b);})[_0x2a63('0x26')](respondWithResult(_0x23ad75,null))[_0x2a63('0x44')](handleError(_0x23ad75,null));};exports['addQueues']=function(_0x221aba,_0x4763db,_0x3a585f){return db[_0x2a63('0x2b')][_0x2a63('0x77')]({'where':{'id':_0x221aba['params']['id']}})[_0x2a63('0x26')](function(_0x317bfd){if(_0x317bfd){if(!_0x221aba['body'][_0x2a63('0x70')]||!utils[_0x2a63('0x71')](_0x221aba[_0x2a63('0x49')][_0x2a63('0x70')])){throw new db['Sequelize'][(_0x2a63('0x72'))]('Unknown\x20channel');}return _0x317bfd['add'+_[_0x2a63('0x74')](_0x221aba[_0x2a63('0x49')][_0x2a63('0x70')][_0x2a63('0x75')]())+_0x2a63('0x76')](_0x221aba[_0x2a63('0x49')][_0x2a63('0x78')]);}return null;})[_0x2a63('0x26')](handleEntityNotFound(_0x4763db,null))[_0x2a63('0x26')](respondWithStatusCode(_0x4763db,null))[_0x2a63('0x44')](handleError(_0x4763db,null));};exports[_0x2a63('0x79')]=function(_0x3dffd6,_0x5a3ed9,_0x56ee9f){return db[_0x2a63('0x2b')][_0x2a63('0x77')]({'where':{'id':_0x3dffd6['params']['id']}})[_0x2a63('0x26')](function(_0x15b8b6){if(_0x15b8b6){if(!_0x3dffd6['query'][_0x2a63('0x70')]||!utils[_0x2a63('0x71')](_0x3dffd6[_0x2a63('0x31')][_0x2a63('0x70')])){throw new db[(_0x2a63('0x59'))]['ValidationError'](_0x2a63('0x73'));}return _0x15b8b6[_0x2a63('0x7a')+_[_0x2a63('0x74')](_0x3dffd6[_0x2a63('0x31')][_0x2a63('0x70')][_0x2a63('0x75')]())+_0x2a63('0x76')](_0x3dffd6[_0x2a63('0x31')][_0x2a63('0x78')]);}return null;})['then'](handleEntityNotFound(_0x5a3ed9,null))[_0x2a63('0x26')](respondWithStatusCode(_0x5a3ed9,null))[_0x2a63('0x44')](handleError(_0x5a3ed9,null));};exports['addAgents']=function(_0x508662,_0x28793b){var _0x528bbd=_[_0x2a63('0x7b')](_0x508662['body']['ids'])?_0x508662[_0x2a63('0x49')][_0x2a63('0x78')]:[_0x508662['body']['ids']];var _0x160d86=_0x508662[_0x2a63('0x55')]['id'];return db[_0x2a63('0x2b')][_0x2a63('0x48')]({'where':{'id':_0x160d86}})['then'](handleEntityNotFound(_0x28793b,null))['then'](function(_0x5ce3fb){if(_0x5ce3fb){var _0x2df368=[_0x2a63('0x7c'),_0x2a63('0x7d'),'Mail',_0x2a63('0x7e'),_0x2a63('0x7f'),_0x2a63('0x80'),_0x2a63('0x81')];return db[_0x2a63('0x57')][_0x2a63('0x58')](function(_0x24bf3c){var _0x5ba54c=_[_0x2a63('0x2a')](_0x2df368,function(_0x333d49){var _0xe6fef={'attributes':['id',_0x2a63('0x27')]};if(_0x333d49==='Voice'){_0xe6fef[_0x2a63('0x82')]={'attributes':[_0x2a63('0x83')]};}return _0x5ce3fb['get'+_0x333d49+_0x2a63('0x76')](_0xe6fef)['then'](function(_0x48e063){var _0x2bd324=_[_0x2a63('0x2a')](_0x48e063,function(_0xad76a5){var _0x400913=_[_0x2a63('0x2a')](_0x528bbd,function(_0x186b16){var _0x1bbd77={'where':{'UserId':_0x186b16,[_0x333d49+_0x2a63('0x84')]:_0xad76a5['id']},'transaction':_0x24bf3c};if(_0x333d49===_0x2a63('0x7c')){_0x1bbd77[_0x2a63('0x18')]={'penalty':_0xad76a5[_0x2a63('0x85')][_0x2a63('0x83')]};}return db['User'+_0x333d49+'Queue'][_0x2a63('0x86')](_0x1bbd77)[_0x2a63('0x26')](function(){socket[_0x2a63('0x87')](_0x2a63('0x4a')+_0x333d49+_0x2a63('0x88'),{'UserId':_0x186b16,[_0x333d49+_0x2a63('0x84')]:_0xad76a5['id']});if(_0x333d49!=='Voice'){return;}return db[_0x2a63('0x89')][_0x2a63('0x42')]({'where':{'id':_0x528bbd,'online':0x1},'attributes':['id','name','online',_0x2a63('0x8a'),'interface'],'raw':!![]})[_0x2a63('0x26')](function(_0x598985){var _0x3380c4=_[_0x2a63('0x2a')](_0x598985,function(_0x3b5f0b){return db[_0x2a63('0x8b')][_0x2a63('0x8c')]({'membername':_0x3b5f0b[_0x2a63('0x27')],'UserId':_0x3b5f0b['id'],'queue_name':_0xad76a5[_0x2a63('0x27')],'VoiceQueueId':_0xad76a5['id'],'interface':_[_0x2a63('0x8d')](_0x3b5f0b[_0x2a63('0x8e')])?util[_0x2a63('0x8f')](_0x2a63('0x90'),_0x3b5f0b[_0x2a63('0x27')]):_0x3b5f0b[_0x2a63('0x8e')],'paused':_0x3b5f0b[_0x2a63('0x8a')]||![],'penalty':_0xad76a5['TeamVoiceQueue'][_0x2a63('0x83')]},{'transaction':_0x24bf3c});});return Promise[_0x2a63('0x91')](_0x3380c4);});});});return Promise['all'](_0x400913);});return Promise['all'](_0x2bd324);})[_0x2a63('0x26')](function(){return db['TeamVoicePrefix'][_0x2a63('0x77')]({'where':{'teamId':_0x160d86}})[_0x2a63('0x26')](function(_0x24e95d){if(_0x24e95d){var _0x30f14e=_[_0x2a63('0x2a')](_0x528bbd,function(_0x94d306){db[_0x2a63('0x6c')][_0x2a63('0x8c')]({'UserId':_0x94d306,'VoicePrefixId':_0x24e95d[_0x2a63('0x6d')]});});return Promise[_0x2a63('0x91')](_0x30f14e);}});});});return Promise[_0x2a63('0x91')](_0x5ba54c)[_0x2a63('0x26')](function(){return _0x5ce3fb[_0x2a63('0x92')](_0x528bbd,{'transaction':_0x24bf3c})[_0x2a63('0x93')](function(_0x5cb673){return _0x5cb673;});});});}})[_0x2a63('0x26')](respondWithResult(_0x28793b,null))[_0x2a63('0x44')](handleError(_0x28793b,null));};exports[_0x2a63('0x94')]=function(_0x1153f1,_0x46c8c3){var _0x3adcb2=_[_0x2a63('0x7b')](_0x1153f1[_0x2a63('0x31')][_0x2a63('0x78')])?_0x1153f1[_0x2a63('0x31')][_0x2a63('0x78')]:[_0x1153f1[_0x2a63('0x31')][_0x2a63('0x78')]];var _0x4c2495=_0x1153f1[_0x2a63('0x55')]['id'];return db[_0x2a63('0x2b')][_0x2a63('0x48')]({'where':{'id':_0x4c2495}})[_0x2a63('0x26')](handleEntityNotFound(_0x46c8c3,null))[_0x2a63('0x26')](function(_0x1ca9d4){if(_0x1ca9d4){var _0x3355cf=[_0x2a63('0x7c'),'Chat','Mail',_0x2a63('0x7e'),'Fax','Openchannel',_0x2a63('0x81')];return db[_0x2a63('0x57')][_0x2a63('0x58')](function(_0x270dad){var _0x4c94ee=_[_0x2a63('0x2a')](_0x3355cf,function(_0x1af7f4){var _0x5b6635={'attributes':['id',_0x2a63('0x27')]};return _0x1ca9d4[_0x2a63('0x4d')+_0x1af7f4+_0x2a63('0x76')](_0x5b6635)['then'](function(_0x52bdf1){var _0x228ea7=_[_0x2a63('0x2a')](_0x52bdf1,function(_0x54842d){return _0x54842d[_0x2a63('0x94')](_0x3adcb2,{'transaction':_0x270dad})[_0x2a63('0x26')](function(){var _0x92929e=_[_0x2a63('0x2a')](_0x3adcb2,function(_0x360c42){socket[_0x2a63('0x87')]('user'+_0x1af7f4+_0x2a63('0x95'),{'UserId':Number(_0x360c42),[_0x1af7f4+'QueueId']:_0x54842d['id']});if(_0x1af7f4!=='Voice'){return;}return db['UserVoiceQueueRt'][_0x2a63('0x56')]({'where':{'VoiceQueueId':_0x54842d['id'],'UserId':_0x360c42},'transaction':_0x270dad});});return Promise[_0x2a63('0x91')](_0x92929e);});});return Promise[_0x2a63('0x91')](_0x228ea7);});});return Promise['all'](_0x4c94ee)['then'](function(){return _0x1ca9d4[_0x2a63('0x94')](_0x3adcb2,{'transaction':_0x270dad});})[_0x2a63('0x26')](function(){return db[_0x2a63('0x6b')][_0x2a63('0x77')]({'where':{'teamId':_0x4c2495}})[_0x2a63('0x26')](function(_0x3a7d74){if(_0x3a7d74){var _0xb15448=_[_0x2a63('0x2a')](_0x3adcb2,function(_0x562aa7){db[_0x2a63('0x6c')][_0x2a63('0x56')]({'where':{'UserId':_0x562aa7,'VoicePrefixId':_0x3a7d74[_0x2a63('0x6d')]}});});return Promise[_0x2a63('0x91')](_0xb15448);}});});});}})[_0x2a63('0x26')](respondWithStatusCode(_0x46c8c3,null))[_0x2a63('0x44')](handleError(_0x46c8c3,null));};exports['getAgents']=function(_0x436329,_0x471995,_0x3a6929){var _0x13643e={};var _0x211d59={};var _0x497e84;var _0x5ed477;return db['Team']['findOne']({'where':{'id':_0x436329[_0x2a63('0x55')]['id']}})[_0x2a63('0x26')](handleEntityNotFound(_0x471995,null))[_0x2a63('0x26')](function(_0x2cb7c7){if(_0x2cb7c7){_0x497e84=_0x2cb7c7;_0x211d59[_0x2a63('0x30')]=_['keys'](db[_0x2a63('0x89')]['rawAttributes']);_0x211d59['query']=_[_0x2a63('0x32')](_0x436329[_0x2a63('0x31')]);_0x211d59['filters']=_[_0x2a63('0x34')](_0x211d59[_0x2a63('0x30')],_0x211d59[_0x2a63('0x31')]);_0x13643e[_0x2a63('0x35')]=_[_0x2a63('0x34')](_0x211d59[_0x2a63('0x30')],qs[_0x2a63('0x36')](_0x436329['query'][_0x2a63('0x36')]));_0x13643e['attributes']=_0x13643e['attributes']['length']?_0x13643e['attributes']:_0x211d59[_0x2a63('0x30')];_0x13643e[_0x2a63('0x3a')]=qs['sort'](_0x436329['query']['sort']);_0x13643e[_0x2a63('0x3c')]=qs[_0x2a63('0x33')](_[_0x2a63('0x3d')](_0x436329['query'],_0x211d59[_0x2a63('0x33')]));if(_0x436329[_0x2a63('0x31')][_0x2a63('0x3e')]){_0x13643e[_0x2a63('0x3c')]=_['merge'](_0x13643e[_0x2a63('0x3c')],{'$or':_[_0x2a63('0x2a')](_0x13643e[_0x2a63('0x35')],function(_0x3f81d1){var _0x2e45c2={};_0x2e45c2[_0x3f81d1]={'$like':'%'+_0x436329[_0x2a63('0x31')][_0x2a63('0x3e')]+'%'};return _0x2e45c2;})});}_0x13643e=_[_0x2a63('0x3f')]({},_0x13643e,_0x436329['options']);return _0x497e84['getAgents'](_0x13643e);}})[_0x2a63('0x26')](function(_0x403fef){if(_0x403fef){_0x5ed477=_0x403fef[_0x2a63('0x37')];if(!_0x436329[_0x2a63('0x31')]['hasOwnProperty']('nolimit')){_0x13643e['limit']=qs[_0x2a63('0x22')](_0x436329[_0x2a63('0x31')][_0x2a63('0x22')]);_0x13643e['offset']=qs[_0x2a63('0x20')](_0x436329[_0x2a63('0x31')]['offset']);}return _0x497e84[_0x2a63('0x96')](_0x13643e);}})[_0x2a63('0x26')](function(_0x568e46){if(_0x568e46){return _0x568e46?{'count':_0x5ed477,'rows':_0x568e46}:null;}})[_0x2a63('0x26')](respondWithResult(_0x471995,null))[_0x2a63('0x44')](handleError(_0x471995,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 1dee697..9c677cc 100644 --- a/server/api/team/team.events.js +++ b/server/api/team/team.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x650c=['hasOwnProperty','hook','exports','events','../../mysqldb','save','remove','emit'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x650c,0x163));var _0xc650=function(_0x286614,_0x2c427e){_0x286614=_0x286614-0x0;var _0x439d92=_0x650c[_0x286614];return _0x439d92;};'use strict';var EventEmitter=require(_0xc650('0x0'));var Team=require(_0xc650('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc650('0x2'),'afterUpdate':'update','afterDestroy':_0xc650('0x3')};function emitEvent(_0x40a3c5){return function(_0x4526e6,_0x63bed6,_0x54c6b7){TeamEvents['emit'](_0x40a3c5+':'+_0x4526e6['id'],_0x4526e6);TeamEvents[_0xc650('0x4')](_0x40a3c5,_0x4526e6);_0x54c6b7(null);};}for(var e in events){if(events[_0xc650('0x5')](e)){var event=events[e];Team[_0xc650('0x6')](e,emitEvent(event));}}module[_0xc650('0x7')]=TeamEvents; \ No newline at end of file +var _0x9c37=['hook','exports','events','../../mysqldb','Team','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x88cc5c,_0x4c99a2){var _0x173a72=function(_0x3a7174){while(--_0x3a7174){_0x88cc5c['push'](_0x88cc5c['shift']());}};_0x173a72(++_0x4c99a2);}(_0x9c37,0x7a));var _0x79c3=function(_0x546d2f,_0x371123){_0x546d2f=_0x546d2f-0x0;var _0x6582a9=_0x9c37[_0x546d2f];return _0x6582a9;};'use strict';var EventEmitter=require(_0x79c3('0x0'));var Team=require(_0x79c3('0x1'))['db'][_0x79c3('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x79c3('0x3')](0x0);var events={'afterCreate':_0x79c3('0x4'),'afterUpdate':'update','afterDestroy':_0x79c3('0x5')};function emitEvent(_0x2c8a96){return function(_0x3ca27e,_0x2c603f,_0x4f46e4){TeamEvents[_0x79c3('0x6')](_0x2c8a96+':'+_0x3ca27e['id'],_0x3ca27e);TeamEvents[_0x79c3('0x6')](_0x2c8a96,_0x3ca27e);_0x4f46e4(null);};}for(var e in events){if(events[_0x79c3('0x7')](e)){var event=events[e];Team[_0x79c3('0x8')](e,emitEvent(event));}}module[_0x79c3('0x9')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 3a25b40..2022483 100644 --- a/server/api/team/team.model.js +++ b/server/api/team/team.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe13e=['./team.attributes','get','Queues','then','map','catch','exports','Fax','Mail','Sms','Voice','Whatsapp','resolve','lodash'];(function(_0x41a5ca,_0x16d70a){var _0x588a55=function(_0x424ec7){while(--_0x424ec7){_0x41a5ca['push'](_0x41a5ca['shift']());}};_0x588a55(++_0x16d70a);}(_0xe13e,0xb5));var _0xee13=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe13e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xee13('0x0'));var attributes=require(_0xee13('0x1'));function getQueuesByChannel(_0x5169b5,_0x8d23ff){var _0x101bc1=_0xee13('0x2')+_0x8d23ff+_0xee13('0x3');return _0x5169b5[_0x101bc1]()[_0xee13('0x4')](function(_0x306ccd){return _[_0xee13('0x5')](_0x306ccd,function(_0x26872f){_0x26872f['setDataValue']('channel',_0x8d23ff);return _0x26872f;});})[_0xee13('0x6')](function(_0x52b568){throw _0x52b568;});}module[_0xee13('0x7')]=function(_0x33693a){return _0x33693a['define']('Team',attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x154ee7=this;var _0x393b9b=['Chat',_0xee13('0x8'),_0xee13('0x9'),'Openchannel',_0xee13('0xa'),_0xee13('0xb'),_0xee13('0xc')];return Promise[_0xee13('0xd')]()[_0xee13('0x4')](function(){var _0x145479=_[_0xee13('0x5')](_0x393b9b,function(_0x386de5){return getQueuesByChannel(_0x154ee7,_0x386de5);});return Promise['all'](_0x145479);})[_0xee13('0x6')](function(_0x128e6e){throw _0x128e6e;});}}});}; \ No newline at end of file +var _0xaa5e=['Fax','Mail','Openchannel','Voice','Whatsapp','resolve','all','./team.attributes','get','Queues','then','map','setDataValue','channel','catch','define','Team','teams','Chat'];(function(_0x3c04ef,_0x9d110c){var _0x6a3a69=function(_0x333514){while(--_0x333514){_0x3c04ef['push'](_0x3c04ef['shift']());}};_0x6a3a69(++_0x9d110c);}(_0xaa5e,0x170));var _0xeaa5=function(_0x284f6a,_0x47a723){_0x284f6a=_0x284f6a-0x0;var _0x182db4=_0xaa5e[_0x284f6a];return _0x182db4;};'use strict';var _=require('lodash');var attributes=require(_0xeaa5('0x0'));function getQueuesByChannel(_0xc8eca7,_0x3e60a5){var _0x138c74=_0xeaa5('0x1')+_0x3e60a5+_0xeaa5('0x2');return _0xc8eca7[_0x138c74]()[_0xeaa5('0x3')](function(_0x38c1ee){return _[_0xeaa5('0x4')](_0x38c1ee,function(_0x4ab8d8){_0x4ab8d8[_0xeaa5('0x5')](_0xeaa5('0x6'),_0x3e60a5);return _0x4ab8d8;});})[_0xeaa5('0x7')](function(_0x197da7){throw _0x197da7;});}module['exports']=function(_0x4bc33c){return _0x4bc33c[_0xeaa5('0x8')](_0xeaa5('0x9'),attributes,{'tableName':_0xeaa5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x5e7426=this;var _0x18b6d1=[_0xeaa5('0xb'),_0xeaa5('0xc'),_0xeaa5('0xd'),_0xeaa5('0xe'),'Sms',_0xeaa5('0xf'),_0xeaa5('0x10')];return Promise[_0xeaa5('0x11')]()['then'](function(){var _0x2e00cf=_[_0xeaa5('0x4')](_0x18b6d1,function(_0x5c9c20){return getQueuesByChannel(_0x5e7426,_0x5c9c20);});return Promise[_0xeaa5('0x12')](_0x2e00cf);})[_0xeaa5('0x7')](function(_0x3c44d7){throw _0x3c44d7;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index e0ed66b..90be189 100644 --- a/server/api/team/team.rpc.js +++ b/server/api/team/team.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa00b=['info','Team,\x20%s,\x20%s','Team,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','./team.socket','register','request'];(function(_0x22ba49,_0x2d8c86){var _0x103d4b=function(_0x2f4da4){while(--_0x2f4da4){_0x22ba49['push'](_0x22ba49['shift']());}};_0x103d4b(++_0x2d8c86);}(_0xa00b,0x1dd));var _0xba00=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa00b[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xba00('0x0'));var util=require(_0xba00('0x1'));var moment=require(_0xba00('0x2'));var BPromise=require(_0xba00('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba00('0x4'));var db=require(_0xba00('0x5'))['db'];var utils=require(_0xba00('0x6'));var logger=require(_0xba00('0x7'))('rpc');var config=require(_0xba00('0x8'));var jayson=require(_0xba00('0x9'));var client=jayson[_0xba00('0xa')][_0xba00('0xb')]({'port':0x232a});config[_0xba00('0xc')]=_['defaults'](config[_0xba00('0xc')],{'host':_0xba00('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xba00('0xc')]));require(_0xba00('0xe'))[_0xba00('0xf')](socket);function respondWithRpcPromise(_0x20a96b,_0x55984e,_0x172d3e){return new BPromise(function(_0x5636e1,_0x170d47){return client[_0xba00('0x10')](_0x20a96b,_0x172d3e)['then'](function(_0x442f90){logger[_0xba00('0x11')](_0xba00('0x12'),_0x55984e,'request\x20sent');logger['debug'](_0xba00('0x13'),_0x55984e,_0xba00('0x14'),JSON['stringify'](_0x442f90));if(_0x442f90[_0xba00('0x15')]){if(_0x442f90[_0xba00('0x15')][_0xba00('0x16')]===0x1f4){logger[_0xba00('0x15')]('Team,\x20%s,\x20%s',_0x55984e,_0x442f90[_0xba00('0x15')]['message']);return _0x170d47(_0x442f90[_0xba00('0x15')][_0xba00('0x17')]);}logger[_0xba00('0x15')](_0xba00('0x12'),_0x55984e,_0x442f90['error']['message']);return _0x5636e1(_0x442f90['error'][_0xba00('0x17')]);}else{logger[_0xba00('0x11')](_0xba00('0x12'),_0x55984e,'request\x20sent');_0x5636e1(_0x442f90[_0xba00('0x18')][_0xba00('0x17')]);}})[_0xba00('0x19')](function(_0x458ed7){logger[_0xba00('0x15')](_0xba00('0x12'),_0x55984e,_0x458ed7);_0x170d47(_0x458ed7);});});} \ No newline at end of file +var _0xf199=['moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','then','info','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','error','code','message','lodash','util'];(function(_0x41e226,_0x5b6d61){var _0x87089d=function(_0x596f57){while(--_0x596f57){_0x41e226['push'](_0x41e226['shift']());}};_0x87089d(++_0x5b6d61);}(_0xf199,0x76));var _0x9f19=function(_0x96f74c,_0xfc30a4){_0x96f74c=_0x96f74c-0x0;var _0x379222=_0xf199[_0x96f74c];return _0x379222;};'use strict';var _=require(_0x9f19('0x0'));var util=require(_0x9f19('0x1'));var moment=require(_0x9f19('0x2'));var BPromise=require(_0x9f19('0x3'));var rs=require(_0x9f19('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9f19('0x5'));var logger=require('../../config/logger')(_0x9f19('0x6'));var config=require(_0x9f19('0x7'));var jayson=require(_0x9f19('0x8'));var client=jayson[_0x9f19('0x9')][_0x9f19('0xa')]({'port':0x232a});config[_0x9f19('0xb')]=_[_0x9f19('0xc')](config[_0x9f19('0xb')],{'host':_0x9f19('0xd'),'port':0x18eb});var socket=require(_0x9f19('0xe'))(new Redis(config['redis']));require(_0x9f19('0xf'))['register'](socket);function respondWithRpcPromise(_0x3054ad,_0x7f64df,_0x95daec){return new BPromise(function(_0x178064,_0x550221){return client['request'](_0x3054ad,_0x95daec)[_0x9f19('0x10')](function(_0x39d7c5){logger[_0x9f19('0x11')](_0x9f19('0x12'),_0x7f64df,_0x9f19('0x13'));logger['debug'](_0x9f19('0x14'),_0x7f64df,_0x9f19('0x13'),JSON['stringify'](_0x39d7c5));if(_0x39d7c5[_0x9f19('0x15')]){if(_0x39d7c5[_0x9f19('0x15')][_0x9f19('0x16')]===0x1f4){logger[_0x9f19('0x15')](_0x9f19('0x12'),_0x7f64df,_0x39d7c5[_0x9f19('0x15')][_0x9f19('0x17')]);return _0x550221(_0x39d7c5['error'][_0x9f19('0x17')]);}logger[_0x9f19('0x15')](_0x9f19('0x12'),_0x7f64df,_0x39d7c5[_0x9f19('0x15')][_0x9f19('0x17')]);return _0x178064(_0x39d7c5['error'][_0x9f19('0x17')]);}else{logger['info'](_0x9f19('0x12'),_0x7f64df,'request\x20sent');_0x178064(_0x39d7c5['result'][_0x9f19('0x17')]);}})['catch'](function(_0x34fc59){logger[_0x9f19('0x15')](_0x9f19('0x12'),_0x7f64df,_0x34fc59);_0x550221(_0x34fc59);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index c20d81b..88b4fa1 100644 --- a/server/api/team/team.socket.js +++ b/server/api/team/team.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4849=['save','remove','update','emit','register','length','team:'];(function(_0x45a244,_0x12f982){var _0x57edbc=function(_0x2182b2){while(--_0x2182b2){_0x45a244['push'](_0x45a244['shift']());}};_0x57edbc(++_0x12f982);}(_0x4849,0x181));var _0x9484=function(_0x288784,_0x25a410){_0x288784=_0x288784-0x0;var _0x12e16e=_0x4849[_0x288784];return _0x12e16e;};'use strict';var TeamEvents=require('./team.events');var events=[_0x9484('0x0'),_0x9484('0x1'),_0x9484('0x2')];function createListener(_0x22e8eb,_0x530a18){return function(_0x337903){_0x530a18[_0x9484('0x3')](_0x22e8eb,_0x337903);};}function removeListener(_0xecde47,_0x95b89e){return function(){TeamEvents['removeListener'](_0xecde47,_0x95b89e);};}exports[_0x9484('0x4')]=function(_0x555b70){for(var _0x521217=0x0,_0x4e7b02=events[_0x9484('0x5')];_0x521217<_0x4e7b02;_0x521217++){var _0x515733=events[_0x521217];var _0x2952ea=createListener(_0x9484('0x6')+_0x515733,_0x555b70);TeamEvents['on'](_0x515733,_0x2952ea);}}; \ No newline at end of file +var _0x4a2e=['save','remove','emit','register','length','./team.events'];(function(_0x4fb2aa,_0x4c36aa){var _0x404416=function(_0x128f4c){while(--_0x128f4c){_0x4fb2aa['push'](_0x4fb2aa['shift']());}};_0x404416(++_0x4c36aa);}(_0x4a2e,0x125));var _0xe4a2=function(_0x4e7af4,_0x758572){_0x4e7af4=_0x4e7af4-0x0;var _0x2548f1=_0x4a2e[_0x4e7af4];return _0x2548f1;};'use strict';var TeamEvents=require(_0xe4a2('0x0'));var events=[_0xe4a2('0x1'),_0xe4a2('0x2'),'update'];function createListener(_0x36e827,_0x38471b){return function(_0x4f067f){_0x38471b[_0xe4a2('0x3')](_0x36e827,_0x4f067f);};}function removeListener(_0x39b079,_0x583dab){return function(){TeamEvents['removeListener'](_0x39b079,_0x583dab);};}exports[_0xe4a2('0x4')]=function(_0x5d62f6){for(var _0x3e0f6c=0x0,_0x53fef5=events[_0xe4a2('0x5')];_0x3e0f6c<_0x53fef5;_0x3e0f6c++){var _0x4ec2aa=events[_0x3e0f6c];var _0x2445da=createListener('team:'+_0x4ec2aa,_0x5d62f6);TeamEvents['on'](_0x4ec2aa,_0x2445da);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 1f99e62..efd1d70 100644 --- a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js +++ b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa39f=['INTEGER','sequelize','exports'];(function(_0x2ee54a,_0x202513){var _0x32b378=function(_0x27483a){while(--_0x27483a){_0x2ee54a['push'](_0x2ee54a['shift']());}};_0x32b378(++_0x202513);}(_0xa39f,0x1e4));var _0xfa39=function(_0x1cd47d,_0x55bc75){_0x1cd47d=_0x1cd47d-0x0;var _0x29d52f=_0xa39f[_0x1cd47d];return _0x29d52f;};'use strict';var Sequelize=require(_0xfa39('0x0'));module[_0xfa39('0x1')]={'TeamId':{'type':Sequelize[_0xfa39('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xa000=['sequelize','exports','INTEGER'];(function(_0xb55902,_0xe34bed){var _0x5dc620=function(_0x4a4bd3){while(--_0x4a4bd3){_0xb55902['push'](_0xb55902['shift']());}};_0x5dc620(++_0xe34bed);}(_0xa000,0x177));var _0x0a00=function(_0x4ca274,_0x48e1c2){_0x4ca274=_0x4ca274-0x0;var _0x139535=_0xa000[_0x4ca274];return _0x139535;};'use strict';var Sequelize=require(_0x0a00('0x0'));module[_0x0a00('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x0a00('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 6bd2ebd..c1d7355 100644 --- a/server/api/teamVoicePrefix/teamVoicePrefix.model.js +++ b/server/api/teamVoicePrefix/teamVoicePrefix.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x14b7=['path','rimraf','../../config/environment','define','team_has_voice_prefixes','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x42a7cd,_0x32f06c){var _0x1e482b=function(_0x21de87){while(--_0x21de87){_0x42a7cd['push'](_0x42a7cd['shift']());}};_0x1e482b(++_0x32f06c);}(_0x14b7,0x144));var _0x714b=function(_0x500aeb,_0x29fdba){_0x500aeb=_0x500aeb-0x0;var _0x5f3052=_0x14b7[_0x500aeb];return _0x5f3052;};'use strict';var _=require(_0x714b('0x0'));var util=require(_0x714b('0x1'));var logger=require(_0x714b('0x2'))(_0x714b('0x3'));var moment=require('moment');var BPromise=require(_0x714b('0x4'));var rp=require(_0x714b('0x5'));var fs=require('fs');var path=require(_0x714b('0x6'));var rimraf=require(_0x714b('0x7'));var config=require(_0x714b('0x8'));var attributes=require('./teamVoicePrefix.attributes');module['exports']=function(_0x45c9ae,_0x966048){return _0x45c9ae[_0x714b('0x9')]('TeamVoicePrefix',attributes,{'tableName':_0x714b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x851a=['exports','define','TeamVoicePrefix','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xc40bc,_0x31d144){var _0x5d8c3d=function(_0x28c775){while(--_0x28c775){_0xc40bc['push'](_0xc40bc['shift']());}};_0x5d8c3d(++_0x31d144);}(_0x851a,0x19b));var _0xa851=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x851a[_0x1203f];return _0x365f0a;};'use strict';var _=require(_0xa851('0x0'));var util=require('util');var logger=require(_0xa851('0x1'))(_0xa851('0x2'));var moment=require(_0xa851('0x3'));var BPromise=require(_0xa851('0x4'));var rp=require(_0xa851('0x5'));var fs=require('fs');var path=require(_0xa851('0x6'));var rimraf=require(_0xa851('0x7'));var config=require(_0xa851('0x8'));var attributes=require('./teamVoicePrefix.attributes');module[_0xa851('0x9')]=function(_0x57a7c4,_0x1cba67){return _0x57a7c4[_0xa851('0xa')](_0xa851('0xb'),attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index cb9c754..2647495 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x5b30b3,_0x374892){var _0x33f228=function(_0x19d739){while(--_0x19d739){_0x5b30b3['push'](_0x5b30b3['shift']());}};_0x33f228(++_0x374892);}(_0x9c44,0x178));var _0x49c4=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x9c44[_0x4b055c];return _0x4b62bb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x3fd97b,_0x267878){var _0x5908c1=function(_0x180c73){while(--_0x180c73){_0x3fd97b['push'](_0x3fd97b['shift']());}};_0x5908c1(++_0x267878);}(_0x70e0,0x17b));var _0x070e=function(_0x123f70,_0x4a3e18){_0x123f70=_0x123f70-0x0;var _0x2c8fc5=_0x70e0[_0x123f70];return _0x2c8fc5;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index e70b831..2d32ad2 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc99d=['INTEGER','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc99d,0x175));var _0xdc99=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0xc99d[_0x1abb09];return _0xea1c07;};'use strict';var Sequelize=require(_0xdc99('0x0'));module[_0xdc99('0x1')]={'penalty':{'type':Sequelize[_0xdc99('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xcea7=['exports','INTEGER','sequelize'];(function(_0x541260,_0x4c7f2e){var _0x1dd2b5=function(_0x4140de){while(--_0x4140de){_0x541260['push'](_0x541260['shift']());}};_0x1dd2b5(++_0x4c7f2e);}(_0xcea7,0xd1));var _0x7cea=function(_0x4d3d2d,_0x541e3f){_0x4d3d2d=_0x4d3d2d-0x0;var _0x851a36=_0xcea7[_0x4d3d2d];return _0x851a36;};'use strict';var Sequelize=require(_0x7cea('0x0'));module[_0x7cea('0x1')]={'penalty':{'type':Sequelize[_0x7cea('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index d8ea23f..128680a 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.model.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xff3c=['moment','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','TeamVoiceQueue','lodash','util','api'];(function(_0x8d9e63,_0x27a519){var _0x3589f1=function(_0x73b6a4){while(--_0x73b6a4){_0x8d9e63['push'](_0x8d9e63['shift']());}};_0x3589f1(++_0x27a519);}(_0xff3c,0x179));var _0xcff3=function(_0x1fadd2,_0x4020f0){_0x1fadd2=_0x1fadd2-0x0;var _0x226f9f=_0xff3c[_0x1fadd2];return _0x226f9f;};'use strict';var _=require(_0xcff3('0x0'));var util=require(_0xcff3('0x1'));var logger=require('../../config/logger')(_0xcff3('0x2'));var moment=require(_0xcff3('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcff3('0x4'));var rimraf=require(_0xcff3('0x5'));var config=require(_0xcff3('0x6'));var attributes=require(_0xcff3('0x7'));module[_0xcff3('0x8')]=function(_0x308a82,_0x47b899){return _0x308a82['define'](_0xcff3('0x9'),attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x02ef=['../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues','lodash','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x21ae7c,_0x58bb58){var _0x39910b=function(_0xcf883a){while(--_0xcf883a){_0x21ae7c['push'](_0x21ae7c['shift']());}};_0x39910b(++_0x58bb58);}(_0x02ef,0x11a));var _0xf02e=function(_0x4f6faf,_0x148286){_0x4f6faf=_0x4f6faf-0x0;var _0xb9736b=_0x02ef[_0x4f6faf];return _0xb9736b;};'use strict';var _=require(_0xf02e('0x0'));var util=require('util');var logger=require(_0xf02e('0x1'))('api');var moment=require(_0xf02e('0x2'));var BPromise=require(_0xf02e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf02e('0x4'));var rimraf=require(_0xf02e('0x5'));var config=require(_0xf02e('0x6'));var attributes=require(_0xf02e('0x7'));module[_0xf02e('0x8')]=function(_0x511257,_0x332c29){return _0x511257[_0xf02e('0x9')](_0xf02e('0xa'),attributes,{'tableName':_0xf02e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index a4324c7..b039ba0 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xce92=['request','then','info','TeamVoiceQueue,\x20%s,\x20%s','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','http'];(function(_0x554651,_0x33b329){var _0x53fb5a=function(_0x1f8b0a){while(--_0x1f8b0a){_0x554651['push'](_0x554651['shift']());}};_0x53fb5a(++_0x33b329);}(_0xce92,0x186));var _0x2ce9=function(_0x3fc5d8,_0x3eb153){_0x3fc5d8=_0x3fc5d8-0x0;var _0x25307a=_0xce92[_0x3fc5d8];return _0x25307a;};'use strict';var _=require(_0x2ce9('0x0'));var util=require('util');var moment=require(_0x2ce9('0x1'));var BPromise=require(_0x2ce9('0x2'));var rs=require(_0x2ce9('0x3'));var fs=require('fs');var Redis=require(_0x2ce9('0x4'));var db=require(_0x2ce9('0x5'))['db'];var utils=require(_0x2ce9('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x2ce9('0x7'));var client=jayson['client'][_0x2ce9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5a375f,_0x31829a,_0x32da86){return new BPromise(function(_0x3adbb7,_0x41d233){return client[_0x2ce9('0x9')](_0x5a375f,_0x32da86)[_0x2ce9('0xa')](function(_0x59179f){logger[_0x2ce9('0xb')](_0x2ce9('0xc'),_0x31829a,'request\x20sent');logger['debug'](_0x2ce9('0xd'),_0x31829a,_0x2ce9('0xe'),JSON[_0x2ce9('0xf')](_0x59179f));if(_0x59179f[_0x2ce9('0x10')]){if(_0x59179f['error'][_0x2ce9('0x11')]===0x1f4){logger[_0x2ce9('0x10')](_0x2ce9('0xc'),_0x31829a,_0x59179f[_0x2ce9('0x10')][_0x2ce9('0x12')]);return _0x41d233(_0x59179f[_0x2ce9('0x10')][_0x2ce9('0x12')]);}logger['error'](_0x2ce9('0xc'),_0x31829a,_0x59179f[_0x2ce9('0x10')][_0x2ce9('0x12')]);return _0x3adbb7(_0x59179f[_0x2ce9('0x10')][_0x2ce9('0x12')]);}else{logger[_0x2ce9('0xb')]('TeamVoiceQueue,\x20%s,\x20%s',_0x31829a,_0x2ce9('0xe'));_0x3adbb7(_0x59179f[_0x2ce9('0x13')]['message']);}})[_0x2ce9('0x14')](function(_0x528818){logger[_0x2ce9('0x10')](_0x2ce9('0xc'),_0x31829a,_0x528818);_0x41d233(_0x528818);});});} \ No newline at end of file +var _0xfc9c=['client','http','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x42d6da,_0x3c8613){var _0x37ddd3=function(_0x529230){while(--_0x529230){_0x42d6da['push'](_0x42d6da['shift']());}};_0x37ddd3(++_0x3c8613);}(_0xfc9c,0xb4));var _0xcfc9=function(_0x5e7690,_0x4414c9){_0x5e7690=_0x5e7690-0x0;var _0x3322f3=_0xfc9c[_0x5e7690];return _0x3322f3;};'use strict';var _=require(_0xcfc9('0x0'));var util=require(_0xcfc9('0x1'));var moment=require('moment');var BPromise=require(_0xcfc9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcfc9('0x3'));var db=require(_0xcfc9('0x4'))['db'];var utils=require(_0xcfc9('0x5'));var logger=require(_0xcfc9('0x6'))('rpc');var config=require(_0xcfc9('0x7'));var jayson=require(_0xcfc9('0x8'));var client=jayson[_0xcfc9('0x9')][_0xcfc9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5dd399,_0x5d6694,_0xd6e8eb){return new BPromise(function(_0xb0fe2c,_0x165fa4){return client['request'](_0x5dd399,_0xd6e8eb)[_0xcfc9('0xb')](function(_0x3b5a20){logger[_0xcfc9('0xc')](_0xcfc9('0xd'),_0x5d6694,_0xcfc9('0xe'));logger[_0xcfc9('0xf')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x5d6694,_0xcfc9('0xe'),JSON['stringify'](_0x3b5a20));if(_0x3b5a20['error']){if(_0x3b5a20[_0xcfc9('0x10')][_0xcfc9('0x11')]===0x1f4){logger['error'](_0xcfc9('0xd'),_0x5d6694,_0x3b5a20[_0xcfc9('0x10')]['message']);return _0x165fa4(_0x3b5a20[_0xcfc9('0x10')][_0xcfc9('0x12')]);}logger[_0xcfc9('0x10')](_0xcfc9('0xd'),_0x5d6694,_0x3b5a20[_0xcfc9('0x10')][_0xcfc9('0x12')]);return _0xb0fe2c(_0x3b5a20[_0xcfc9('0x10')][_0xcfc9('0x12')]);}else{logger['info'](_0xcfc9('0xd'),_0x5d6694,'request\x20sent');_0xb0fe2c(_0x3b5a20[_0xcfc9('0x13')]['message']);}})[_0xcfc9('0x14')](function(_0x169a5e){logger[_0xcfc9('0x10')]('TeamVoiceQueue,\x20%s,\x20%s',_0x5d6694,_0x169a5e);_0x165fa4(_0x169a5e);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 5b7c0a3..dd20716 100644 --- a/server/api/template/index.js +++ b/server/api/template/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xacc6=['../../components/auth/service','../../components/interaction/service','./template.controller','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x311f44,_0x1d7f5b){var _0x46f1e6=function(_0x27342a){while(--_0x27342a){_0x311f44['push'](_0x311f44['shift']());}};_0x46f1e6(++_0x1d7f5b);}(_0xacc6,0x150));var _0x6acc=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0xacc6[_0xc0a3d3];return _0x3386e8;};'use strict';var multer=require(_0x6acc('0x0'));var util=require(_0x6acc('0x1'));var path=require(_0x6acc('0x2'));var timeout=require(_0x6acc('0x3'));var express=require(_0x6acc('0x4'));var router=express['Router']();var fs_extra=require(_0x6acc('0x5'));var auth=require(_0x6acc('0x6'));var interaction=require(_0x6acc('0x7'));var config=require('../../config/environment');var controller=require(_0x6acc('0x8'));router['get']('/',auth[_0x6acc('0x9')](),controller[_0x6acc('0xa')]);router['get'](_0x6acc('0xb'),auth['isAuthenticated'](),controller[_0x6acc('0xc')]);router[_0x6acc('0xd')]('/',auth[_0x6acc('0x9')](),controller[_0x6acc('0xe')]);router['put'](_0x6acc('0xb'),auth['isAuthenticated'](),controller[_0x6acc('0xf')]);router[_0x6acc('0x10')](_0x6acc('0xb'),auth[_0x6acc('0x9')](),controller[_0x6acc('0x11')]);module[_0x6acc('0x12')]=router; \ No newline at end of file +var _0xe2fe=['/:id','show','create','destroy','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x4169d8,_0x3d7cd4){var _0x32084a=function(_0x5f59c6){while(--_0x5f59c6){_0x4169d8['push'](_0x4169d8['shift']());}};_0x32084a(++_0x3d7cd4);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xee2f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xee2f('0x1'));var express=require('express');var router=express[_0xee2f('0x2')]();var fs_extra=require(_0xee2f('0x3'));var auth=require(_0xee2f('0x4'));var interaction=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var controller=require('./template.controller');router[_0xee2f('0x7')]('/',auth[_0xee2f('0x8')](),controller['index']);router[_0xee2f('0x7')](_0xee2f('0x9'),auth['isAuthenticated'](),controller[_0xee2f('0xa')]);router['post']('/',auth[_0xee2f('0x8')](),controller[_0xee2f('0xb')]);router['put'](_0xee2f('0x9'),auth[_0xee2f('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xee2f('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 4459bca..c7f76e9 100644 --- a/server/api/template/template.attributes.js +++ b/server/api/template/template.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xff45=['exports','STRING','TEXT','sequelize'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xff45,0xb3));var _0x5ff4=function(_0x1b3c40,_0x48cc44){_0x1b3c40=_0x1b3c40-0x0;var _0x54a769=_0xff45[_0x1b3c40];return _0x54a769;};'use strict';var Sequelize=require(_0x5ff4('0x0'));module[_0x5ff4('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5ff4('0x2')]},'html':{'type':Sequelize[_0x5ff4('0x3')]}}; \ No newline at end of file +var _0x8db2=['STRING','TEXT'];(function(_0x120729,_0x29e515){var _0x1b7766=function(_0x20980f){while(--_0x20980f){_0x120729['push'](_0x120729['shift']());}};_0x1b7766(++_0x29e515);}(_0x8db2,0x156));var _0x28db=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x8db2[_0x2aea9e];return _0x430b92;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x28db('0x0')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x28db('0x1')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index e02e3f1..ed412e3 100644 --- a/server/api/template/template.controller.js +++ b/server/api/template/template.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1587=['create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','destroy','then','get','Templates','UserProfileResource','error','name','index','map','Template','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find'];(function(_0x225a97,_0x477562){var _0xc01055=function(_0x25f821){while(--_0x25f821){_0x225a97['push'](_0x225a97['shift']());}};_0xc01055(++_0x477562);}(_0x1587,0xad));var _0x7158=function(_0x1021b7,_0x1afa2f){_0x1021b7=_0x1021b7-0x0;var _0x4e1ff2=_0x1587[_0x1021b7];return _0x4e1ff2;};'use strict';var emlformat=require(_0x7158('0x0'));var rimraf=require(_0x7158('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7158('0x2'));var rp=require('request-promise');var moment=require(_0x7158('0x3'));var BPromise=require(_0x7158('0x4'));var Mustache=require('mustache');var util=require(_0x7158('0x5'));var path=require(_0x7158('0x6'));var sox=require(_0x7158('0x7'));var csv=require('to-csv');var ejs=require(_0x7158('0x8'));var fs=require('fs');var fs_extra=require(_0x7158('0x9'));var _=require(_0x7158('0xa'));var squel=require('squel');var crypto=require(_0x7158('0xb'));var jsforce=require(_0x7158('0xc'));var deskjs=require(_0x7158('0xd'));var toCsv=require(_0x7158('0xe'));var querystring=require(_0x7158('0xf'));var Papa=require(_0x7158('0x10'));var Redis=require(_0x7158('0x11'));var authService=require(_0x7158('0x12'));var qs=require(_0x7158('0x13'));var as=require(_0x7158('0x14'));var hardwareService=require(_0x7158('0x15'));var logger=require(_0x7158('0x16'))('api');var utils=require(_0x7158('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x7158('0x18'));var db=require(_0x7158('0x19'))['db'];function respondWithStatusCode(_0x5444bb,_0x23bbf7){_0x23bbf7=_0x23bbf7||0xcc;return function(_0x5ca018){if(_0x5ca018){return _0x5444bb[_0x7158('0x1a')](_0x23bbf7);}return _0x5444bb[_0x7158('0x1b')](_0x23bbf7)[_0x7158('0x1c')]();};}function respondWithResult(_0x4c01da,_0x4b7509){_0x4b7509=_0x4b7509||0xc8;return function(_0x3c4130){if(_0x3c4130){return _0x4c01da[_0x7158('0x1b')](_0x4b7509)[_0x7158('0x1d')](_0x3c4130);}};}function respondWithFilteredResult(_0x5234c6,_0x4736bc){return function(_0x57dd74){if(_0x57dd74){var _0x1d6212=typeof _0x4736bc[_0x7158('0x1e')]==='undefined'&&typeof _0x4736bc[_0x7158('0x1f')]===_0x7158('0x20');var _0x3d506b=_0x57dd74[_0x7158('0x21')];var _0x4db2f9=_0x1d6212?0x0:_0x4736bc[_0x7158('0x1e')];var _0x59531e=_0x1d6212?_0x57dd74['count']:_0x4736bc[_0x7158('0x1e')]+_0x4736bc[_0x7158('0x1f')];var _0x4e91ad;if(_0x59531e>=_0x3d506b){_0x59531e=_0x3d506b;_0x4e91ad=0xc8;}else{_0x4e91ad=0xce;}_0x5234c6['status'](_0x4e91ad);return _0x5234c6[_0x7158('0x22')](_0x7158('0x23'),_0x4db2f9+'-'+_0x59531e+'/'+_0x3d506b)['json'](_0x57dd74);}return null;};}function patchUpdates(_0x396e71){return function(_0x22c581){try{jsonpatch[_0x7158('0x24')](_0x22c581,_0x396e71,!![]);}catch(_0xb13b4c){return BPromise[_0x7158('0x25')](_0xb13b4c);}return _0x22c581['save']();};}function saveUpdates(_0x4af042,_0x57d07a){return function(_0x2162bb){if(_0x2162bb){return _0x2162bb[_0x7158('0x26')](_0x4af042)['then'](function(_0x2c15b6){return _0x2c15b6;});}return null;};}function removeEntity(_0x1a577e,_0x35e382){return function(_0x3ef37e){if(_0x3ef37e){return _0x3ef37e[_0x7158('0x27')]()[_0x7158('0x28')](function(){var _0x5c22c3=_0x3ef37e[_0x7158('0x29')]({'plain':!![]});var _0x2ce46f=_0x7158('0x2a');return db[_0x7158('0x2b')]['destroy']({'where':{'type':_0x2ce46f,'resourceId':_0x5c22c3['id']}})[_0x7158('0x28')](function(){return _0x3ef37e;});})[_0x7158('0x28')](function(){_0x1a577e['status'](0xcc)[_0x7158('0x1c')]();});}};}function handleEntityNotFound(_0x23ace2,_0x5fbef5){return function(_0x32ea0e){if(!_0x32ea0e){_0x23ace2['sendStatus'](0x194);}return _0x32ea0e;};}function handleError(_0x2e491a,_0x56e161){_0x56e161=_0x56e161||0x1f4;return function(_0x441d18){logger[_0x7158('0x2c')](_0x441d18['stack']);if(_0x441d18[_0x7158('0x2d')]){delete _0x441d18[_0x7158('0x2d')];}_0x2e491a[_0x7158('0x1b')](_0x56e161)['send'](_0x441d18);};}exports[_0x7158('0x2e')]=function(_0x55052e,_0x10fe2d){var _0x577052={},_0x3af4bd={},_0x35321f={'count':0x0,'rows':[]};var _0x5e9c62=_[_0x7158('0x2f')](db[_0x7158('0x30')]['rawAttributes'],function(_0x422186){return{'name':_0x422186['fieldName'],'type':_0x422186[_0x7158('0x31')][_0x7158('0x32')]};});_0x3af4bd[_0x7158('0x33')]=_[_0x7158('0x2f')](_0x5e9c62,_0x7158('0x2d'));_0x3af4bd[_0x7158('0x34')]=_[_0x7158('0x35')](_0x55052e['query']);_0x3af4bd[_0x7158('0x36')]=_[_0x7158('0x37')](_0x3af4bd[_0x7158('0x33')],_0x3af4bd[_0x7158('0x34')]);_0x577052[_0x7158('0x38')]=_[_0x7158('0x37')](_0x3af4bd['model'],qs[_0x7158('0x39')](_0x55052e[_0x7158('0x34')]['fields']));_0x577052[_0x7158('0x38')]=_0x577052['attributes'][_0x7158('0x3a')]?_0x577052['attributes']:_0x3af4bd[_0x7158('0x33')];if(!_0x55052e['query']['hasOwnProperty'](_0x7158('0x3b'))){_0x577052[_0x7158('0x1f')]=qs[_0x7158('0x1f')](_0x55052e[_0x7158('0x34')][_0x7158('0x1f')]);_0x577052[_0x7158('0x1e')]=qs[_0x7158('0x1e')](_0x55052e[_0x7158('0x34')]['offset']);}_0x577052[_0x7158('0x3c')]=qs[_0x7158('0x3d')](_0x55052e[_0x7158('0x34')]['sort']);_0x577052[_0x7158('0x3e')]=qs[_0x7158('0x36')](_[_0x7158('0x3f')](_0x55052e[_0x7158('0x34')],_0x3af4bd['filters']),_0x5e9c62);if(_0x55052e[_0x7158('0x34')]['filter']){_0x577052[_0x7158('0x3e')]=_['merge'](_0x577052[_0x7158('0x3e')],{'$or':_[_0x7158('0x2f')](_0x5e9c62,function(_0x2d27ce){if(_0x2d27ce[_0x7158('0x31')]!==_0x7158('0x40')){var _0x19a493={};_0x19a493[_0x2d27ce[_0x7158('0x2d')]]={'$like':'%'+_0x55052e['query'][_0x7158('0x41')]+'%'};return _0x19a493;}})});}_0x577052=_[_0x7158('0x42')]({},_0x577052,_0x55052e[_0x7158('0x43')]);var _0x1316a1={'where':_0x577052[_0x7158('0x3e')]};return db['Template'][_0x7158('0x21')](_0x1316a1)[_0x7158('0x28')](function(_0x51d9dc){_0x35321f[_0x7158('0x21')]=_0x51d9dc;if(_0x55052e[_0x7158('0x34')][_0x7158('0x44')]){_0x577052[_0x7158('0x45')]=[{'all':!![]}];}return db[_0x7158('0x30')][_0x7158('0x46')](_0x577052);})[_0x7158('0x28')](function(_0x1566d5){_0x35321f[_0x7158('0x47')]=_0x1566d5;return _0x35321f;})[_0x7158('0x28')](respondWithFilteredResult(_0x10fe2d,_0x577052))[_0x7158('0x48')](handleError(_0x10fe2d,null));};exports['show']=function(_0xa90dfd,_0x1e9053){var _0xf05cdb={'raw':!![],'where':{'id':_0xa90dfd[_0x7158('0x49')]['id']}},_0x1a1b31={};_0x1a1b31[_0x7158('0x33')]=_['keys'](db[_0x7158('0x30')][_0x7158('0x4a')]);_0x1a1b31[_0x7158('0x34')]=_['keys'](_0xa90dfd[_0x7158('0x34')]);_0x1a1b31['filters']=_[_0x7158('0x37')](_0x1a1b31['model'],_0x1a1b31[_0x7158('0x34')]);_0xf05cdb['attributes']=_[_0x7158('0x37')](_0x1a1b31['model'],qs['fields'](_0xa90dfd[_0x7158('0x34')]['fields']));_0xf05cdb[_0x7158('0x38')]=_0xf05cdb['attributes'][_0x7158('0x3a')]?_0xf05cdb['attributes']:_0x1a1b31[_0x7158('0x33')];if(_0xa90dfd[_0x7158('0x34')][_0x7158('0x44')]){_0xf05cdb['include']=[{'all':!![]}];}_0xf05cdb=_[_0x7158('0x42')]({},_0xf05cdb,_0xa90dfd['options']);return db[_0x7158('0x30')][_0x7158('0x4b')](_0xf05cdb)[_0x7158('0x28')](handleEntityNotFound(_0x1e9053,null))[_0x7158('0x28')](respondWithResult(_0x1e9053,null))['catch'](handleError(_0x1e9053,null));};exports[_0x7158('0x4c')]=function(_0xf76ebe,_0x6a421){return db[_0x7158('0x30')]['create'](_0xf76ebe['body'],{})['then'](function(_0x3c39e0){var _0x44ca3a=_0xf76ebe['user']['get']({'plain':!![]});if(!_0x44ca3a)throw new Error(_0x7158('0x4d'));if(_0x44ca3a[_0x7158('0x4e')]===_0x7158('0x4f')){var _0x39ee03=_0x3c39e0[_0x7158('0x29')]({'plain':!![]});var _0x29e3d1=_0x7158('0x2a');return db[_0x7158('0x50')][_0x7158('0x4b')]({'where':{'name':_0x29e3d1,'userProfileId':_0x44ca3a['userProfileId']},'raw':!![]})[_0x7158('0x28')](function(_0x23f210){if(_0x23f210&&_0x23f210['autoAssociation']===0x0){return db[_0x7158('0x2b')][_0x7158('0x4c')]({'name':_0x39ee03[_0x7158('0x2d')],'resourceId':_0x39ee03['id'],'type':_0x23f210[_0x7158('0x2d')],'sectionId':_0x23f210['id']},{})[_0x7158('0x28')](function(){return _0x3c39e0;});}else{return _0x3c39e0;}})[_0x7158('0x48')](function(_0x2c15ee){logger['error'](_0x7158('0x51'),_0x2c15ee);throw _0x2c15ee;});}return _0x3c39e0;})[_0x7158('0x28')](respondWithResult(_0x6a421,0xc9))[_0x7158('0x48')](handleError(_0x6a421,null));};exports[_0x7158('0x26')]=function(_0x4e4701,_0x5cf9fa){if(_0x4e4701['body']['id']){delete _0x4e4701[_0x7158('0x52')]['id'];}return db[_0x7158('0x30')]['find']({'where':{'id':_0x4e4701[_0x7158('0x49')]['id']}})[_0x7158('0x28')](handleEntityNotFound(_0x5cf9fa,null))[_0x7158('0x28')](saveUpdates(_0x4e4701[_0x7158('0x52')],null))[_0x7158('0x28')](respondWithResult(_0x5cf9fa,null))['catch'](handleError(_0x5cf9fa,null));};exports[_0x7158('0x27')]=function(_0x23dfa9,_0x4627a9){return db[_0x7158('0x30')][_0x7158('0x4b')]({'where':{'id':_0x23dfa9[_0x7158('0x49')]['id']}})[_0x7158('0x28')](handleEntityNotFound(_0x4627a9,null))[_0x7158('0x28')](removeEntity(_0x4627a9,null))[_0x7158('0x48')](handleError(_0x4627a9,null));}; \ No newline at end of file +var _0xda7f=['userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','undefined','offset','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','Templates','UserProfileResource','error','name','send','index','Template','fieldName','type','key','model','map','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','rawAttributes','includeAll','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x374785,_0x4f71b8){var _0x572c40=function(_0x1cf7b0){while(--_0x1cf7b0){_0x374785['push'](_0x374785['shift']());}};_0x572c40(++_0x4f71b8);}(_0xda7f,0x147));var _0xfda7=function(_0x53ddb5,_0x5ca714){_0x53ddb5=_0x53ddb5-0x0;var _0x90ef1=_0xda7f[_0x53ddb5];return _0x90ef1;};'use strict';var emlformat=require(_0xfda7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfda7('0x1'));var moment=require(_0xfda7('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xfda7('0x3'));var util=require(_0xfda7('0x4'));var path=require(_0xfda7('0x5'));var sox=require('sox');var csv=require(_0xfda7('0x6'));var ejs=require(_0xfda7('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfda7('0x8'));var squel=require('squel');var crypto=require(_0xfda7('0x9'));var jsforce=require(_0xfda7('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xfda7('0x6'));var querystring=require(_0xfda7('0xb'));var Papa=require(_0xfda7('0xc'));var Redis=require(_0xfda7('0xd'));var authService=require(_0xfda7('0xe'));var qs=require(_0xfda7('0xf'));var as=require(_0xfda7('0x10'));var hardwareService=require(_0xfda7('0x11'));var logger=require('../../config/logger')(_0xfda7('0x12'));var utils=require(_0xfda7('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xfda7('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x216ff9,_0x535aee){_0x535aee=_0x535aee||0xcc;return function(_0x578e50){if(_0x578e50){return _0x216ff9[_0xfda7('0x15')](_0x535aee);}return _0x216ff9[_0xfda7('0x16')](_0x535aee)[_0xfda7('0x17')]();};}function respondWithResult(_0x2baaae,_0x291058){_0x291058=_0x291058||0xc8;return function(_0x3ea838){if(_0x3ea838){return _0x2baaae[_0xfda7('0x16')](_0x291058)['json'](_0x3ea838);}};}function respondWithFilteredResult(_0x356a2b,_0x43f5be){return function(_0x10e182){if(_0x10e182){var _0x5a83db=typeof _0x43f5be['offset']===_0xfda7('0x18')&&typeof _0x43f5be['limit']===_0xfda7('0x18');var _0x4b3861=_0x10e182['count'];var _0x53f007=_0x5a83db?0x0:_0x43f5be[_0xfda7('0x19')];var _0x50f711=_0x5a83db?_0x10e182[_0xfda7('0x1a')]:_0x43f5be[_0xfda7('0x19')]+_0x43f5be[_0xfda7('0x1b')];var _0x1523b6;if(_0x50f711>=_0x4b3861){_0x50f711=_0x4b3861;_0x1523b6=0xc8;}else{_0x1523b6=0xce;}_0x356a2b[_0xfda7('0x16')](_0x1523b6);return _0x356a2b[_0xfda7('0x1c')](_0xfda7('0x1d'),_0x53f007+'-'+_0x50f711+'/'+_0x4b3861)[_0xfda7('0x1e')](_0x10e182);}return null;};}function patchUpdates(_0x221bad){return function(_0x3c73cf){try{jsonpatch[_0xfda7('0x1f')](_0x3c73cf,_0x221bad,!![]);}catch(_0x815197){return BPromise[_0xfda7('0x20')](_0x815197);}return _0x3c73cf[_0xfda7('0x21')]();};}function saveUpdates(_0x1c34c4,_0xae19ad){return function(_0x13735c){if(_0x13735c){return _0x13735c[_0xfda7('0x22')](_0x1c34c4)['then'](function(_0x45d46f){return _0x45d46f;});}return null;};}function removeEntity(_0x32387d,_0x121937){return function(_0x1c4319){if(_0x1c4319){return _0x1c4319[_0xfda7('0x23')]()[_0xfda7('0x24')](function(){var _0x44ae99=_0x1c4319['get']({'plain':!![]});var _0x3d2cf9=_0xfda7('0x25');return db[_0xfda7('0x26')][_0xfda7('0x23')]({'where':{'type':_0x3d2cf9,'resourceId':_0x44ae99['id']}})[_0xfda7('0x24')](function(){return _0x1c4319;});})[_0xfda7('0x24')](function(){_0x32387d[_0xfda7('0x16')](0xcc)[_0xfda7('0x17')]();});}};}function handleEntityNotFound(_0x245ae4,_0x14d4c7){return function(_0x36f4a1){if(!_0x36f4a1){_0x245ae4['sendStatus'](0x194);}return _0x36f4a1;};}function handleError(_0x485166,_0x170b65){_0x170b65=_0x170b65||0x1f4;return function(_0x10eb49){logger[_0xfda7('0x27')](_0x10eb49['stack']);if(_0x10eb49[_0xfda7('0x28')]){delete _0x10eb49[_0xfda7('0x28')];}_0x485166[_0xfda7('0x16')](_0x170b65)[_0xfda7('0x29')](_0x10eb49);};}exports[_0xfda7('0x2a')]=function(_0x489316,_0xebbe14){var _0x33f4ea={},_0x20876b={},_0x2786a8={'count':0x0,'rows':[]};var _0x40ab5c=_['map'](db[_0xfda7('0x2b')]['rawAttributes'],function(_0x1fbd0d){return{'name':_0x1fbd0d[_0xfda7('0x2c')],'type':_0x1fbd0d[_0xfda7('0x2d')][_0xfda7('0x2e')]};});_0x20876b[_0xfda7('0x2f')]=_[_0xfda7('0x30')](_0x40ab5c,_0xfda7('0x28'));_0x20876b[_0xfda7('0x31')]=_['keys'](_0x489316['query']);_0x20876b['filters']=_[_0xfda7('0x32')](_0x20876b[_0xfda7('0x2f')],_0x20876b['query']);_0x33f4ea['attributes']=_[_0xfda7('0x32')](_0x20876b[_0xfda7('0x2f')],qs[_0xfda7('0x33')](_0x489316['query']['fields']));_0x33f4ea[_0xfda7('0x34')]=_0x33f4ea[_0xfda7('0x34')]['length']?_0x33f4ea[_0xfda7('0x34')]:_0x20876b[_0xfda7('0x2f')];if(!_0x489316[_0xfda7('0x31')][_0xfda7('0x35')](_0xfda7('0x36'))){_0x33f4ea[_0xfda7('0x1b')]=qs['limit'](_0x489316[_0xfda7('0x31')][_0xfda7('0x1b')]);_0x33f4ea[_0xfda7('0x19')]=qs[_0xfda7('0x19')](_0x489316[_0xfda7('0x31')][_0xfda7('0x19')]);}_0x33f4ea[_0xfda7('0x37')]=qs['sort'](_0x489316[_0xfda7('0x31')][_0xfda7('0x38')]);_0x33f4ea[_0xfda7('0x39')]=qs[_0xfda7('0x3a')](_[_0xfda7('0x3b')](_0x489316[_0xfda7('0x31')],_0x20876b[_0xfda7('0x3a')]),_0x40ab5c);if(_0x489316['query'][_0xfda7('0x3c')]){_0x33f4ea['where']=_[_0xfda7('0x3d')](_0x33f4ea[_0xfda7('0x39')],{'$or':_[_0xfda7('0x30')](_0x40ab5c,function(_0x5c5775){if(_0x5c5775['type']!==_0xfda7('0x3e')){var _0x41e93d={};_0x41e93d[_0x5c5775[_0xfda7('0x28')]]={'$like':'%'+_0x489316['query']['filter']+'%'};return _0x41e93d;}})});}_0x33f4ea=_[_0xfda7('0x3d')]({},_0x33f4ea,_0x489316[_0xfda7('0x3f')]);var _0x38dc9a={'where':_0x33f4ea[_0xfda7('0x39')]};return db['Template'][_0xfda7('0x1a')](_0x38dc9a)[_0xfda7('0x24')](function(_0x323d12){_0x2786a8[_0xfda7('0x1a')]=_0x323d12;if(_0x489316[_0xfda7('0x31')]['includeAll']){_0x33f4ea[_0xfda7('0x40')]=[{'all':!![]}];}return db[_0xfda7('0x2b')][_0xfda7('0x41')](_0x33f4ea);})[_0xfda7('0x24')](function(_0x1c8ad5){_0x2786a8[_0xfda7('0x42')]=_0x1c8ad5;return _0x2786a8;})['then'](respondWithFilteredResult(_0xebbe14,_0x33f4ea))[_0xfda7('0x43')](handleError(_0xebbe14,null));};exports[_0xfda7('0x44')]=function(_0x230f38,_0x40b51c){var _0x421a6a={'raw':!![],'where':{'id':_0x230f38[_0xfda7('0x45')]['id']}},_0x471a4f={};_0x471a4f[_0xfda7('0x2f')]=_[_0xfda7('0x46')](db['Template'][_0xfda7('0x47')]);_0x471a4f[_0xfda7('0x31')]=_[_0xfda7('0x46')](_0x230f38[_0xfda7('0x31')]);_0x471a4f['filters']=_[_0xfda7('0x32')](_0x471a4f[_0xfda7('0x2f')],_0x471a4f['query']);_0x421a6a['attributes']=_['intersection'](_0x471a4f[_0xfda7('0x2f')],qs['fields'](_0x230f38[_0xfda7('0x31')][_0xfda7('0x33')]));_0x421a6a['attributes']=_0x421a6a[_0xfda7('0x34')]['length']?_0x421a6a[_0xfda7('0x34')]:_0x471a4f[_0xfda7('0x2f')];if(_0x230f38[_0xfda7('0x31')][_0xfda7('0x48')]){_0x421a6a['include']=[{'all':!![]}];}_0x421a6a=_[_0xfda7('0x3d')]({},_0x421a6a,_0x230f38[_0xfda7('0x3f')]);return db['Template'][_0xfda7('0x49')](_0x421a6a)[_0xfda7('0x24')](handleEntityNotFound(_0x40b51c,null))[_0xfda7('0x24')](respondWithResult(_0x40b51c,null))[_0xfda7('0x43')](handleError(_0x40b51c,null));};exports[_0xfda7('0x4a')]=function(_0x4bf021,_0x4babb5){return db[_0xfda7('0x2b')][_0xfda7('0x4a')](_0x4bf021['body'],{})[_0xfda7('0x24')](function(_0x23f1db){var _0x4993bf=_0x4bf021[_0xfda7('0x4b')][_0xfda7('0x4c')]({'plain':!![]});if(!_0x4993bf)throw new Error(_0xfda7('0x4d'));if(_0x4993bf['role']===_0xfda7('0x4b')){var _0x1276df=_0x23f1db[_0xfda7('0x4c')]({'plain':!![]});var _0x4bef1e=_0xfda7('0x25');return db['UserProfileSection'][_0xfda7('0x49')]({'where':{'name':_0x4bef1e,'userProfileId':_0x4993bf[_0xfda7('0x4e')]},'raw':!![]})['then'](function(_0x55a49e){if(_0x55a49e&&_0x55a49e['autoAssociation']===0x0){return db['UserProfileResource'][_0xfda7('0x4a')]({'name':_0x1276df[_0xfda7('0x28')],'resourceId':_0x1276df['id'],'type':_0x55a49e[_0xfda7('0x28')],'sectionId':_0x55a49e['id']},{})[_0xfda7('0x24')](function(){return _0x23f1db;});}else{return _0x23f1db;}})[_0xfda7('0x43')](function(_0x3017d5){logger['error'](_0xfda7('0x4f'),_0x3017d5);throw _0x3017d5;});}return _0x23f1db;})[_0xfda7('0x24')](respondWithResult(_0x4babb5,0xc9))[_0xfda7('0x43')](handleError(_0x4babb5,null));};exports[_0xfda7('0x22')]=function(_0x23466a,_0x41fd65){if(_0x23466a['body']['id']){delete _0x23466a[_0xfda7('0x50')]['id'];}return db[_0xfda7('0x2b')][_0xfda7('0x49')]({'where':{'id':_0x23466a[_0xfda7('0x45')]['id']}})[_0xfda7('0x24')](handleEntityNotFound(_0x41fd65,null))[_0xfda7('0x24')](saveUpdates(_0x23466a[_0xfda7('0x50')],null))[_0xfda7('0x24')](respondWithResult(_0x41fd65,null))[_0xfda7('0x43')](handleError(_0x41fd65,null));};exports[_0xfda7('0x23')]=function(_0x1235bf,_0xda4c2b){return db[_0xfda7('0x2b')][_0xfda7('0x49')]({'where':{'id':_0x1235bf['params']['id']}})[_0xfda7('0x24')](handleEntityNotFound(_0xda4c2b,null))[_0xfda7('0x24')](removeEntity(_0xda4c2b,null))[_0xfda7('0x43')](handleError(_0xda4c2b,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index c5dae84..321098a 100644 --- a/server/api/template/template.model.js +++ b/server/api/template/template.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5476=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Template','tools_templates','util','../../config/logger'];(function(_0x49bcfe,_0x1dfb73){var _0x32b827=function(_0x124238){while(--_0x124238){_0x49bcfe['push'](_0x49bcfe['shift']());}};_0x32b827(++_0x1dfb73);}(_0x5476,0x11c));var _0x6547=function(_0x3c4c51,_0x27b863){_0x3c4c51=_0x3c4c51-0x0;var _0x182e28=_0x5476[_0x3c4c51];return _0x182e28;};'use strict';var _=require('lodash');var util=require(_0x6547('0x0'));var logger=require(_0x6547('0x1'))('api');var moment=require('moment');var BPromise=require(_0x6547('0x2'));var rp=require(_0x6547('0x3'));var fs=require('fs');var path=require(_0x6547('0x4'));var rimraf=require(_0x6547('0x5'));var config=require(_0x6547('0x6'));var attributes=require('./template.attributes');module[_0x6547('0x7')]=function(_0xa9eeec,_0x4e153e){return _0xa9eeec[_0x6547('0x8')](_0x6547('0x9'),attributes,{'tableName':_0x6547('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x98c8=['Template','tools_templates','lodash','api','moment','bluebird','request-promise','../../config/environment','./template.attributes','exports','define'];(function(_0x50b729,_0xbc3d4a){var _0x3ce5c7=function(_0x2af89e){while(--_0x2af89e){_0x50b729['push'](_0x50b729['shift']());}};_0x3ce5c7(++_0xbc3d4a);}(_0x98c8,0x141));var _0x898c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x98c8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x898c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x898c('0x1'));var moment=require(_0x898c('0x2'));var BPromise=require(_0x898c('0x3'));var rp=require(_0x898c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x898c('0x5'));var attributes=require(_0x898c('0x6'));module[_0x898c('0x7')]=function(_0x406ad3,_0x36b139){return _0x406ad3[_0x898c('0x8')](_0x898c('0x9'),attributes,{'tableName':_0x898c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 8242721..cc44d79 100644 --- a/server/api/template/template.rpc.js +++ b/server/api/template/template.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd436=['where','attributes','limit','include','map','model','then','GetTemplate','debug','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/environment','client','http','Template,\x20%s,\x20%s','request\x20sent','Template,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','Template','options','raw'];(function(_0xf022be,_0x14e78e){var _0x18d7d5=function(_0x4bcdca){while(--_0x4bcdca){_0xf022be['push'](_0xf022be['shift']());}};_0x18d7d5(++_0x14e78e);}(_0xd436,0x1ea));var _0x6d43=function(_0x54b719,_0x39ade5){_0x54b719=_0x54b719-0x0;var _0x31edd9=_0xd436[_0x54b719];return _0x31edd9;};'use strict';var _=require(_0x6d43('0x0'));var util=require(_0x6d43('0x1'));var moment=require('moment');var BPromise=require(_0x6d43('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d43('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6d43('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x6d43('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x6d43('0x6')][_0x6d43('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2659b6,_0x2565eb,_0x591df3){return new BPromise(function(_0x5d1195,_0x1b7638){return client['request'](_0x2659b6,_0x591df3)['then'](function(_0x39f1bf){logger['info'](_0x6d43('0x8'),_0x2565eb,_0x6d43('0x9'));logger['debug'](_0x6d43('0xa'),_0x2565eb,_0x6d43('0x9'),JSON[_0x6d43('0xb')](_0x39f1bf));if(_0x39f1bf['error']){if(_0x39f1bf['error'][_0x6d43('0xc')]===0x1f4){logger[_0x6d43('0xd')](_0x6d43('0x8'),_0x2565eb,_0x39f1bf[_0x6d43('0xd')][_0x6d43('0xe')]);return _0x1b7638(_0x39f1bf[_0x6d43('0xd')][_0x6d43('0xe')]);}logger[_0x6d43('0xd')](_0x6d43('0x8'),_0x2565eb,_0x39f1bf[_0x6d43('0xd')][_0x6d43('0xe')]);return _0x5d1195(_0x39f1bf[_0x6d43('0xd')][_0x6d43('0xe')]);}else{logger[_0x6d43('0xf')]('Template,\x20%s,\x20%s',_0x2565eb,_0x6d43('0x9'));_0x5d1195(_0x39f1bf[_0x6d43('0x10')][_0x6d43('0xe')]);}})['catch'](function(_0x13d4ab){logger[_0x6d43('0xd')]('Template,\x20%s,\x20%s',_0x2565eb,_0x13d4ab);_0x1b7638(_0x13d4ab);});});}exports['GetTemplate']=function(_0x5294f9){var _0x1c098b=this;return new Promise(function(_0x2f118e,_0x558ea8){return db[_0x6d43('0x11')]['findAll']({'raw':_0x5294f9[_0x6d43('0x12')]?_0x5294f9[_0x6d43('0x12')][_0x6d43('0x13')]===undefined?!![]:![]:!![],'where':_0x5294f9[_0x6d43('0x12')]?_0x5294f9['options'][_0x6d43('0x14')]||null:null,'attributes':_0x5294f9[_0x6d43('0x12')]?_0x5294f9['options'][_0x6d43('0x15')]||null:null,'limit':_0x5294f9[_0x6d43('0x12')]?_0x5294f9['options'][_0x6d43('0x16')]||null:null,'include':_0x5294f9[_0x6d43('0x12')]?_0x5294f9[_0x6d43('0x12')][_0x6d43('0x17')]?_[_0x6d43('0x18')](_0x5294f9[_0x6d43('0x12')][_0x6d43('0x17')],function(_0x143c6c){return{'model':db[_0x143c6c[_0x6d43('0x19')]],'as':_0x143c6c['as'],'attributes':_0x143c6c[_0x6d43('0x15')],'include':_0x143c6c[_0x6d43('0x17')]?_[_0x6d43('0x18')](_0x143c6c['include'],function(_0x16f5a3){return{'model':db[_0x16f5a3[_0x6d43('0x19')]],'as':_0x16f5a3['as'],'attributes':_0x16f5a3[_0x6d43('0x15')],'include':_0x16f5a3[_0x6d43('0x17')]?_[_0x6d43('0x18')](_0x16f5a3[_0x6d43('0x17')],function(_0x3c6004){return{'model':db[_0x3c6004[_0x6d43('0x19')]],'as':_0x3c6004['as'],'attributes':_0x3c6004[_0x6d43('0x15')]};}):[]};}):[]};}):[]:[]})[_0x6d43('0x1a')](function(_0x421dbe){logger[_0x6d43('0xf')](_0x6d43('0x1b'),_0x5294f9);logger[_0x6d43('0x1c')](_0x6d43('0x1b'),_0x5294f9,JSON[_0x6d43('0xb')](_0x421dbe));_0x2f118e(_0x421dbe);})[_0x6d43('0x1d')](function(_0x1ec6df){logger['error'](_0x6d43('0x1b'),_0x1ec6df[_0x6d43('0xe')],_0x5294f9);_0x558ea8(_0x1c098b[_0x6d43('0xd')](0x1f4,_0x1ec6df['message']));});});}; \ No newline at end of file +var _0x19e1=['code','message','info','catch','GetTemplate','options','raw','where','attributes','map','include','model','then','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x411267,_0x647282){var _0x54e43a=function(_0x14b0e7){while(--_0x14b0e7){_0x411267['push'](_0x411267['shift']());}};_0x54e43a(++_0x647282);}(_0x19e1,0x1a0));var _0x119e=function(_0x3b16e1,_0x3bda3e){_0x3b16e1=_0x3b16e1-0x0;var _0x311d1b=_0x19e1[_0x3b16e1];return _0x311d1b;};'use strict';var _=require(_0x119e('0x0'));var util=require(_0x119e('0x1'));var moment=require(_0x119e('0x2'));var BPromise=require('bluebird');var rs=require(_0x119e('0x3'));var fs=require('fs');var Redis=require(_0x119e('0x4'));var db=require(_0x119e('0x5'))['db'];var utils=require(_0x119e('0x6'));var logger=require(_0x119e('0x7'))(_0x119e('0x8'));var config=require(_0x119e('0x9'));var jayson=require(_0x119e('0xa'));var client=jayson[_0x119e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x547352,_0x13304f,_0x189b12){return new BPromise(function(_0x1179b,_0x459c5b){return client['request'](_0x547352,_0x189b12)['then'](function(_0x52be0c){logger['info'](_0x119e('0xc'),_0x13304f,_0x119e('0xd'));logger[_0x119e('0xe')](_0x119e('0xf'),_0x13304f,_0x119e('0xd'),JSON[_0x119e('0x10')](_0x52be0c));if(_0x52be0c[_0x119e('0x11')]){if(_0x52be0c[_0x119e('0x11')][_0x119e('0x12')]===0x1f4){logger[_0x119e('0x11')](_0x119e('0xc'),_0x13304f,_0x52be0c['error'][_0x119e('0x13')]);return _0x459c5b(_0x52be0c[_0x119e('0x11')][_0x119e('0x13')]);}logger[_0x119e('0x11')](_0x119e('0xc'),_0x13304f,_0x52be0c[_0x119e('0x11')][_0x119e('0x13')]);return _0x1179b(_0x52be0c[_0x119e('0x11')][_0x119e('0x13')]);}else{logger[_0x119e('0x14')](_0x119e('0xc'),_0x13304f,_0x119e('0xd'));_0x1179b(_0x52be0c['result'][_0x119e('0x13')]);}})[_0x119e('0x15')](function(_0x2dff3a){logger['error'](_0x119e('0xc'),_0x13304f,_0x2dff3a);_0x459c5b(_0x2dff3a);});});}exports[_0x119e('0x16')]=function(_0x22d1ed){var _0x1010c4=this;return new Promise(function(_0x4766d5,_0x138926){return db['Template']['findAll']({'raw':_0x22d1ed['options']?_0x22d1ed[_0x119e('0x17')][_0x119e('0x18')]===undefined?!![]:![]:!![],'where':_0x22d1ed[_0x119e('0x17')]?_0x22d1ed[_0x119e('0x17')][_0x119e('0x19')]||null:null,'attributes':_0x22d1ed[_0x119e('0x17')]?_0x22d1ed[_0x119e('0x17')][_0x119e('0x1a')]||null:null,'limit':_0x22d1ed[_0x119e('0x17')]?_0x22d1ed[_0x119e('0x17')]['limit']||null:null,'include':_0x22d1ed[_0x119e('0x17')]?_0x22d1ed[_0x119e('0x17')]['include']?_[_0x119e('0x1b')](_0x22d1ed[_0x119e('0x17')][_0x119e('0x1c')],function(_0x49bf87){return{'model':db[_0x49bf87[_0x119e('0x1d')]],'as':_0x49bf87['as'],'attributes':_0x49bf87[_0x119e('0x1a')],'include':_0x49bf87[_0x119e('0x1c')]?_[_0x119e('0x1b')](_0x49bf87[_0x119e('0x1c')],function(_0x40de00){return{'model':db[_0x40de00[_0x119e('0x1d')]],'as':_0x40de00['as'],'attributes':_0x40de00[_0x119e('0x1a')],'include':_0x40de00[_0x119e('0x1c')]?_[_0x119e('0x1b')](_0x40de00[_0x119e('0x1c')],function(_0x4e85a7){return{'model':db[_0x4e85a7[_0x119e('0x1d')]],'as':_0x4e85a7['as'],'attributes':_0x4e85a7[_0x119e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x119e('0x1e')](function(_0x529539){logger[_0x119e('0x14')](_0x119e('0x16'),_0x22d1ed);logger[_0x119e('0xe')](_0x119e('0x16'),_0x22d1ed,JSON['stringify'](_0x529539));_0x4766d5(_0x529539);})[_0x119e('0x15')](function(_0x4e2f56){logger[_0x119e('0x11')]('GetTemplate',_0x4e2f56[_0x119e('0x13')],_0x22d1ed);_0x138926(_0x1010c4[_0x119e('0x11')](0x1f4,_0x4e2f56[_0x119e('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 55eb000..c0a45f0 100644 --- a/server/api/trigger/index.js +++ b/server/api/trigger/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3eae=['addAction','/:id','update','delete','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','./trigger.controller','get','index','isAuthenticated','/:id/all_conditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','create','post','addAllCondition','addAnyCondition'];(function(_0xd73d53,_0x598443){var _0x560148=function(_0x3c8918){while(--_0x3c8918){_0xd73d53['push'](_0xd73d53['shift']());}};_0x560148(++_0x598443);}(_0x3eae,0x66));var _0xe3ea=function(_0x5b27da,_0x4a6532){_0x5b27da=_0x5b27da-0x0;var _0x3254f4=_0x3eae[_0x5b27da];return _0x3254f4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe3ea('0x0'));var timeout=require(_0xe3ea('0x1'));var express=require('express');var router=express[_0xe3ea('0x2')]();var fs_extra=require(_0xe3ea('0x3'));var auth=require(_0xe3ea('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe3ea('0x5'));router[_0xe3ea('0x6')]('/',auth['isAuthenticated'](),controller[_0xe3ea('0x7')]);router[_0xe3ea('0x6')]('/:id',auth[_0xe3ea('0x8')](),controller['show']);router[_0xe3ea('0x6')](_0xe3ea('0x9'),auth[_0xe3ea('0x8')](),controller['getAllConditions']);router[_0xe3ea('0x6')](_0xe3ea('0xa'),auth[_0xe3ea('0x8')](),controller[_0xe3ea('0xb')]);router[_0xe3ea('0x6')](_0xe3ea('0xc'),auth[_0xe3ea('0x8')](),controller[_0xe3ea('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe3ea('0xe')]);router[_0xe3ea('0xf')](_0xe3ea('0x9'),auth[_0xe3ea('0x8')](),controller[_0xe3ea('0x10')]);router[_0xe3ea('0xf')](_0xe3ea('0xa'),auth[_0xe3ea('0x8')](),controller[_0xe3ea('0x11')]);router[_0xe3ea('0xf')](_0xe3ea('0xc'),auth[_0xe3ea('0x8')](),controller[_0xe3ea('0x12')]);router['put'](_0xe3ea('0x13'),auth[_0xe3ea('0x8')](),controller[_0xe3ea('0x14')]);router[_0xe3ea('0x15')](_0xe3ea('0x13'),auth[_0xe3ea('0x8')](),controller[_0xe3ea('0x16')]);module[_0xe3ea('0x17')]=router; \ No newline at end of file +var _0x0805=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','getAllConditions','/:id/any_conditions','getAnyConditions','post','create','/:id/all_conditions','addAllCondition','addAnyCondition','put','update','delete','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0805,0x1c9));var _0x5080=function(_0x527d48,_0x6aa1){_0x527d48=_0x527d48-0x0;var _0x13e8be=_0x0805[_0x527d48];return _0x13e8be;};'use strict';var multer=require(_0x5080('0x0'));var util=require(_0x5080('0x1'));var path=require(_0x5080('0x2'));var timeout=require(_0x5080('0x3'));var express=require(_0x5080('0x4'));var router=express[_0x5080('0x5')]();var fs_extra=require(_0x5080('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5080('0x7'));var config=require(_0x5080('0x8'));var controller=require('./trigger.controller');router[_0x5080('0x9')]('/',auth['isAuthenticated'](),controller[_0x5080('0xa')]);router['get'](_0x5080('0xb'),auth[_0x5080('0xc')](),controller[_0x5080('0xd')]);router[_0x5080('0x9')]('/:id/all_conditions',auth[_0x5080('0xc')](),controller[_0x5080('0xe')]);router['get'](_0x5080('0xf'),auth[_0x5080('0xc')](),controller[_0x5080('0x10')]);router[_0x5080('0x9')]('/:id/actions',auth['isAuthenticated'](),controller['getActions']);router[_0x5080('0x11')]('/',auth[_0x5080('0xc')](),controller[_0x5080('0x12')]);router[_0x5080('0x11')](_0x5080('0x13'),auth[_0x5080('0xc')](),controller[_0x5080('0x14')]);router[_0x5080('0x11')]('/:id/any_conditions',auth['isAuthenticated'](),controller[_0x5080('0x15')]);router[_0x5080('0x11')]('/:id/actions',auth[_0x5080('0xc')](),controller['addAction']);router[_0x5080('0x16')]('/:id',auth[_0x5080('0xc')](),controller[_0x5080('0x17')]);router[_0x5080('0x18')]('/:id',auth[_0x5080('0xc')](),controller[_0x5080('0x19')]);module[_0x5080('0x1a')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 48c3e33..751807c 100644 --- a/server/api/trigger/trigger.attributes.js +++ b/server/api/trigger/trigger.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8101=['exports','STRING','BOOLEAN'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8101,0x195));var _0x1810=function(_0x2125f0,_0x2f23b9){_0x2125f0=_0x2125f0-0x0;var _0x12d6eb=_0x8101[_0x2125f0];return _0x12d6eb;};'use strict';var Sequelize=require('sequelize');module[_0x1810('0x0')]={'name':{'type':Sequelize[_0x1810('0x1')]},'channel':{'type':Sequelize[_0x1810('0x1')]},'description':{'type':Sequelize[_0x1810('0x1')]},'status':{'type':Sequelize[_0x1810('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xb7aa=['BOOLEAN','sequelize','exports','STRING'];(function(_0x4e88d9,_0x4c1f84){var _0x5c8e3b=function(_0x4bdc74){while(--_0x4bdc74){_0x4e88d9['push'](_0x4e88d9['shift']());}};_0x5c8e3b(++_0x4c1f84);}(_0xb7aa,0x155));var _0xab7a=function(_0x1fbc2f,_0x54cd04){_0x1fbc2f=_0x1fbc2f-0x0;var _0x22dcc8=_0xb7aa[_0x1fbc2f];return _0x22dcc8;};'use strict';var Sequelize=require(_0xab7a('0x0'));module[_0xab7a('0x1')]={'name':{'type':Sequelize[_0xab7a('0x2')]},'channel':{'type':Sequelize[_0xab7a('0x2')]},'description':{'type':Sequelize[_0xab7a('0x2')]},'status':{'type':Sequelize[_0xab7a('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 42fb5a8..3adaa83 100644 --- a/server/api/trigger/trigger.controller.js +++ b/server/api/trigger/trigger.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4b9=['hasOwnProperty','getAnyConditions','order','addAction','TriggerId','getActions','Action','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','get','end','sendStatus','error','stack','name','send','index','map','Trigger','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','sort','where','pick','filter','merge','include','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne'];(function(_0x15d1aa,_0x4fadfb){var _0x5e61ba=function(_0x2aed6b){while(--_0x2aed6b){_0x15d1aa['push'](_0x15d1aa['shift']());}};_0x5e61ba(++_0x4fadfb);}(_0xc4b9,0x127));var _0x9c4b=function(_0x3622c3,_0x593143){_0x3622c3=_0x3622c3-0x0;var _0x4237d5=_0xc4b9[_0x3622c3];return _0x4237d5;};'use strict';var emlformat=require(_0x9c4b('0x0'));var rimraf=require(_0x9c4b('0x1'));var zipdir=require(_0x9c4b('0x2'));var jsonpatch=require(_0x9c4b('0x3'));var rp=require(_0x9c4b('0x4'));var moment=require(_0x9c4b('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9c4b('0x6'));var path=require(_0x9c4b('0x7'));var sox=require(_0x9c4b('0x8'));var csv=require(_0x9c4b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9c4b('0xa'));var _=require(_0x9c4b('0xb'));var squel=require('squel');var crypto=require(_0x9c4b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9c4b('0xd'));var toCsv=require(_0x9c4b('0x9'));var querystring=require(_0x9c4b('0xe'));var Papa=require(_0x9c4b('0xf'));var Redis=require(_0x9c4b('0x10'));var authService=require(_0x9c4b('0x11'));var qs=require(_0x9c4b('0x12'));var as=require(_0x9c4b('0x13'));var hardwareService=require(_0x9c4b('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x9c4b('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9c4b('0x16'));var db=require(_0x9c4b('0x17'))['db'];function respondWithStatusCode(_0x359788,_0x3e439c){_0x3e439c=_0x3e439c||0xcc;return function(_0x2305cb){if(_0x2305cb){return _0x359788['sendStatus'](_0x3e439c);}return _0x359788['status'](_0x3e439c)['end']();};}function respondWithResult(_0x360bea,_0x525a8e){_0x525a8e=_0x525a8e||0xc8;return function(_0x2f6efd){if(_0x2f6efd){return _0x360bea[_0x9c4b('0x18')](_0x525a8e)[_0x9c4b('0x19')](_0x2f6efd);}};}function respondWithFilteredResult(_0x423361,_0x1c5652){return function(_0x3aba58){if(_0x3aba58){var _0x48c79f=typeof _0x1c5652[_0x9c4b('0x1a')]===_0x9c4b('0x1b')&&typeof _0x1c5652['limit']===_0x9c4b('0x1b');var _0x1843db=_0x3aba58[_0x9c4b('0x1c')];var _0x5843f2=_0x48c79f?0x0:_0x1c5652['offset'];var _0x25ed5a=_0x48c79f?_0x3aba58[_0x9c4b('0x1c')]:_0x1c5652[_0x9c4b('0x1a')]+_0x1c5652[_0x9c4b('0x1d')];var _0x533f15;if(_0x25ed5a>=_0x1843db){_0x25ed5a=_0x1843db;_0x533f15=0xc8;}else{_0x533f15=0xce;}_0x423361[_0x9c4b('0x18')](_0x533f15);return _0x423361[_0x9c4b('0x1e')](_0x9c4b('0x1f'),_0x5843f2+'-'+_0x25ed5a+'/'+_0x1843db)['json'](_0x3aba58);}return null;};}function patchUpdates(_0x10947b){return function(_0x1ca9e2){try{jsonpatch[_0x9c4b('0x20')](_0x1ca9e2,_0x10947b,!![]);}catch(_0x4caba7){return BPromise[_0x9c4b('0x21')](_0x4caba7);}return _0x1ca9e2[_0x9c4b('0x22')]();};}function saveUpdates(_0xb68214,_0x196083){return function(_0x341dea){if(_0x341dea){return _0x341dea[_0x9c4b('0x23')](_0xb68214)[_0x9c4b('0x24')](function(_0x5191fa){return _0x5191fa;});}return null;};}function removeEntity(_0x56fd21,_0x2a5ff1){return function(_0xb50fba){if(_0xb50fba){return _0xb50fba['destroy']()[_0x9c4b('0x24')](function(){var _0x3fa669=_0xb50fba[_0x9c4b('0x25')]({'plain':!![]});var _0x1ba1eb='Triggers';return db['UserProfileResource']['destroy']({'where':{'type':_0x1ba1eb,'resourceId':_0x3fa669['id']}})[_0x9c4b('0x24')](function(){return _0xb50fba;});})[_0x9c4b('0x24')](function(){_0x56fd21['status'](0xcc)[_0x9c4b('0x26')]();});}};}function handleEntityNotFound(_0x14e244,_0x10b7ef){return function(_0x28ef5a){if(!_0x28ef5a){_0x14e244[_0x9c4b('0x27')](0x194);}return _0x28ef5a;};}function handleError(_0xb01181,_0x203c15){_0x203c15=_0x203c15||0x1f4;return function(_0x346ceb){logger[_0x9c4b('0x28')](_0x346ceb[_0x9c4b('0x29')]);if(_0x346ceb[_0x9c4b('0x2a')]){delete _0x346ceb[_0x9c4b('0x2a')];}_0xb01181['status'](_0x203c15)[_0x9c4b('0x2b')](_0x346ceb);};}exports[_0x9c4b('0x2c')]=function(_0x5722bd,_0x421260){var _0x1f9998={},_0x112bf3={},_0x5026e1={'count':0x0,'rows':[]};var _0x1133a0=_[_0x9c4b('0x2d')](db[_0x9c4b('0x2e')][_0x9c4b('0x2f')],function(_0x473243){return{'name':_0x473243[_0x9c4b('0x30')],'type':_0x473243[_0x9c4b('0x31')][_0x9c4b('0x32')]};});_0x112bf3['model']=_[_0x9c4b('0x2d')](_0x1133a0,'name');_0x112bf3[_0x9c4b('0x33')]=_[_0x9c4b('0x34')](_0x5722bd['query']);_0x112bf3[_0x9c4b('0x35')]=_[_0x9c4b('0x36')](_0x112bf3[_0x9c4b('0x37')],_0x112bf3['query']);_0x1f9998['attributes']=_['intersection'](_0x112bf3[_0x9c4b('0x37')],qs[_0x9c4b('0x38')](_0x5722bd[_0x9c4b('0x33')]['fields']));_0x1f9998[_0x9c4b('0x39')]=_0x1f9998[_0x9c4b('0x39')][_0x9c4b('0x3a')]?_0x1f9998[_0x9c4b('0x39')]:_0x112bf3[_0x9c4b('0x37')];if(!_0x5722bd['query']['hasOwnProperty'](_0x9c4b('0x3b'))){_0x1f9998[_0x9c4b('0x1d')]=qs[_0x9c4b('0x1d')](_0x5722bd[_0x9c4b('0x33')][_0x9c4b('0x1d')]);_0x1f9998[_0x9c4b('0x1a')]=qs['offset'](_0x5722bd['query'][_0x9c4b('0x1a')]);}_0x1f9998['order']=qs['sort'](_0x5722bd[_0x9c4b('0x33')][_0x9c4b('0x3c')]);_0x1f9998[_0x9c4b('0x3d')]=qs[_0x9c4b('0x35')](_[_0x9c4b('0x3e')](_0x5722bd[_0x9c4b('0x33')],_0x112bf3[_0x9c4b('0x35')]),_0x1133a0);if(_0x5722bd[_0x9c4b('0x33')][_0x9c4b('0x3f')]){_0x1f9998[_0x9c4b('0x3d')]=_[_0x9c4b('0x40')](_0x1f9998[_0x9c4b('0x3d')],{'$or':_[_0x9c4b('0x2d')](_0x1133a0,function(_0x3e36e7){if(_0x3e36e7['type']!=='VIRTUAL'){var _0x1783f2={};_0x1783f2[_0x3e36e7[_0x9c4b('0x2a')]]={'$like':'%'+_0x5722bd[_0x9c4b('0x33')][_0x9c4b('0x3f')]+'%'};return _0x1783f2;}})});}_0x1f9998=_[_0x9c4b('0x40')]({},_0x1f9998,_0x5722bd['options']);var _0x311f90={'where':_0x1f9998[_0x9c4b('0x3d')]};return db['Trigger'][_0x9c4b('0x1c')](_0x311f90)[_0x9c4b('0x24')](function(_0x31e683){_0x5026e1[_0x9c4b('0x1c')]=_0x31e683;if(_0x5722bd['query']['includeAll']){_0x1f9998[_0x9c4b('0x41')]=[{'all':!![]}];}return db['Trigger']['findAll'](_0x1f9998);})[_0x9c4b('0x24')](function(_0x57f238){_0x5026e1['rows']=_0x57f238;return _0x5026e1;})[_0x9c4b('0x24')](respondWithFilteredResult(_0x421260,_0x1f9998))[_0x9c4b('0x42')](handleError(_0x421260,null));};exports[_0x9c4b('0x43')]=function(_0x9e7066,_0x48f5da){var _0x45abd7={'raw':![],'where':{'id':_0x9e7066[_0x9c4b('0x44')]['id']}},_0x1189f0={};_0x1189f0[_0x9c4b('0x37')]=_[_0x9c4b('0x34')](db[_0x9c4b('0x2e')][_0x9c4b('0x2f')]);_0x1189f0[_0x9c4b('0x33')]=_[_0x9c4b('0x34')](_0x9e7066[_0x9c4b('0x33')]);_0x1189f0['filters']=_['intersection'](_0x1189f0[_0x9c4b('0x37')],_0x1189f0['query']);_0x45abd7[_0x9c4b('0x39')]=_[_0x9c4b('0x36')](_0x1189f0[_0x9c4b('0x37')],qs['fields'](_0x9e7066[_0x9c4b('0x33')][_0x9c4b('0x38')]));_0x45abd7['attributes']=_0x45abd7[_0x9c4b('0x39')][_0x9c4b('0x3a')]?_0x45abd7[_0x9c4b('0x39')]:_0x1189f0[_0x9c4b('0x37')];if(_0x9e7066[_0x9c4b('0x33')]['includeAll']){_0x45abd7[_0x9c4b('0x41')]=[{'all':!![]}];}_0x45abd7=_[_0x9c4b('0x40')]({},_0x45abd7,_0x9e7066[_0x9c4b('0x45')]);return db[_0x9c4b('0x2e')][_0x9c4b('0x46')](_0x45abd7)[_0x9c4b('0x24')](handleEntityNotFound(_0x48f5da,null))['then'](respondWithResult(_0x48f5da,null))[_0x9c4b('0x42')](handleError(_0x48f5da,null));};exports['create']=function(_0x17380e,_0x4ae367){return db[_0x9c4b('0x2e')][_0x9c4b('0x47')](_0x17380e[_0x9c4b('0x48')],{})[_0x9c4b('0x24')](function(_0x4c3421){var _0x455089=_0x17380e[_0x9c4b('0x49')][_0x9c4b('0x25')]({'plain':!![]});if(!_0x455089)throw new Error(_0x9c4b('0x4a'));if(_0x455089[_0x9c4b('0x4b')]===_0x9c4b('0x49')){var _0x16eb34=_0x4c3421[_0x9c4b('0x25')]({'plain':!![]});var _0x29cacb='Triggers';return db[_0x9c4b('0x4c')][_0x9c4b('0x46')]({'where':{'name':_0x29cacb,'userProfileId':_0x455089[_0x9c4b('0x4d')]},'raw':!![]})[_0x9c4b('0x24')](function(_0x41c637){if(_0x41c637&&_0x41c637[_0x9c4b('0x4e')]===0x0){return db[_0x9c4b('0x4f')][_0x9c4b('0x47')]({'name':_0x16eb34[_0x9c4b('0x2a')],'resourceId':_0x16eb34['id'],'type':_0x41c637['name'],'sectionId':_0x41c637['id']},{})[_0x9c4b('0x24')](function(){return _0x4c3421;});}else{return _0x4c3421;}})[_0x9c4b('0x42')](function(_0x37fb54){logger[_0x9c4b('0x28')](_0x9c4b('0x50'),_0x37fb54);throw _0x37fb54;});}return _0x4c3421;})['then'](respondWithResult(_0x4ae367,0xc9))[_0x9c4b('0x42')](handleError(_0x4ae367,null));};exports['update']=function(_0xfeb036,_0x17ec47){if(_0xfeb036['body']['id']){delete _0xfeb036[_0x9c4b('0x48')]['id'];}return db[_0x9c4b('0x2e')][_0x9c4b('0x46')]({'where':{'id':_0xfeb036['params']['id']}})[_0x9c4b('0x24')](handleEntityNotFound(_0x17ec47,null))[_0x9c4b('0x24')](saveUpdates(_0xfeb036[_0x9c4b('0x48')],null))['then'](respondWithResult(_0x17ec47,null))[_0x9c4b('0x42')](handleError(_0x17ec47,null));};exports[_0x9c4b('0x51')]=function(_0x1ede39,_0x219ff9){return db[_0x9c4b('0x2e')][_0x9c4b('0x46')]({'where':{'id':_0x1ede39[_0x9c4b('0x44')]['id']}})[_0x9c4b('0x24')](handleEntityNotFound(_0x219ff9,null))['then'](removeEntity(_0x219ff9,null))[_0x9c4b('0x42')](handleError(_0x219ff9,null));};exports[_0x9c4b('0x52')]=function(_0x1b2256,_0x3f1678,_0x14d438){if(_0x1b2256['body']['id']){delete _0x1b2256[_0x9c4b('0x48')]['id'];}return db[_0x9c4b('0x2e')][_0x9c4b('0x46')]({'where':{'id':_0x1b2256['params']['id']}})['then'](handleEntityNotFound(_0x3f1678,null))[_0x9c4b('0x24')](function(_0x254511){if(_0x254511){_0x1b2256[_0x9c4b('0x48')][_0x9c4b('0x53')]=_0x254511['id'];return db[_0x9c4b('0x54')]['create'](_0x1b2256[_0x9c4b('0x48')]);}})[_0x9c4b('0x24')](respondWithResult(_0x3f1678,null))[_0x9c4b('0x42')](handleError(_0x3f1678,null));};exports[_0x9c4b('0x55')]=function(_0x5bcc13,_0x295799,_0x43ca02){if(_0x5bcc13[_0x9c4b('0x48')]['id']){delete _0x5bcc13[_0x9c4b('0x48')]['id'];}return db[_0x9c4b('0x2e')][_0x9c4b('0x46')]({'where':{'id':_0x5bcc13['params']['id']}})[_0x9c4b('0x24')](handleEntityNotFound(_0x295799,null))['then'](function(_0x35ddfa){if(_0x35ddfa){_0x5bcc13[_0x9c4b('0x48')][_0x9c4b('0x56')]=_0x35ddfa['id'];return db['Condition'][_0x9c4b('0x47')](_0x5bcc13[_0x9c4b('0x48')]);}})[_0x9c4b('0x24')](respondWithResult(_0x295799,null))[_0x9c4b('0x42')](handleError(_0x295799,null));};exports[_0x9c4b('0x57')]=function(_0x22605c,_0xf874fb,_0x2fdaed){var _0x5bf112={};var _0x2f76d6={};var _0x20ac4b;var _0x4eb924;return db[_0x9c4b('0x2e')][_0x9c4b('0x58')]({'where':{'id':_0x22605c[_0x9c4b('0x44')]['id']}})[_0x9c4b('0x24')](handleEntityNotFound(_0xf874fb,null))[_0x9c4b('0x24')](function(_0x3b06cd){if(_0x3b06cd){_0x20ac4b=_0x3b06cd;_0x2f76d6[_0x9c4b('0x37')]=_[_0x9c4b('0x34')](db[_0x9c4b('0x54')][_0x9c4b('0x2f')]);_0x2f76d6[_0x9c4b('0x33')]=_[_0x9c4b('0x34')](_0x22605c['query']);_0x2f76d6[_0x9c4b('0x35')]=_[_0x9c4b('0x36')](_0x2f76d6[_0x9c4b('0x37')],_0x2f76d6[_0x9c4b('0x33')]);_0x5bf112['attributes']=_[_0x9c4b('0x36')](_0x2f76d6[_0x9c4b('0x37')],qs[_0x9c4b('0x38')](_0x22605c[_0x9c4b('0x33')][_0x9c4b('0x38')]));_0x5bf112['attributes']=_0x5bf112['attributes'][_0x9c4b('0x3a')]?_0x5bf112[_0x9c4b('0x39')]:_0x2f76d6[_0x9c4b('0x37')];_0x5bf112['order']=qs[_0x9c4b('0x3c')](_0x22605c[_0x9c4b('0x33')][_0x9c4b('0x3c')]);_0x5bf112['where']=qs[_0x9c4b('0x35')](_[_0x9c4b('0x3e')](_0x22605c['query'],_0x2f76d6['filters']));if(_0x22605c[_0x9c4b('0x33')][_0x9c4b('0x3f')]){_0x5bf112['where']=_[_0x9c4b('0x40')](_0x5bf112['where'],{'$or':_[_0x9c4b('0x2d')](_0x5bf112[_0x9c4b('0x39')],function(_0x1eb22a){var _0x432298={};_0x432298[_0x1eb22a]={'$like':'%'+_0x22605c[_0x9c4b('0x33')][_0x9c4b('0x3f')]+'%'};return _0x432298;})});}_0x5bf112=_[_0x9c4b('0x40')]({},_0x5bf112,_0x22605c['options']);return _0x20ac4b[_0x9c4b('0x57')](_0x5bf112);}})['then'](function(_0xebc158){if(_0xebc158){_0x4eb924=_0xebc158['length'];if(!_0x22605c['query'][_0x9c4b('0x59')](_0x9c4b('0x3b'))){_0x5bf112[_0x9c4b('0x1d')]=qs[_0x9c4b('0x1d')](_0x22605c['query'][_0x9c4b('0x1d')]);_0x5bf112['offset']=qs[_0x9c4b('0x1a')](_0x22605c[_0x9c4b('0x33')][_0x9c4b('0x1a')]);}return _0x20ac4b[_0x9c4b('0x57')](_0x5bf112);}})[_0x9c4b('0x24')](function(_0x45ac9a){if(_0x45ac9a){return _0x45ac9a?{'count':_0x4eb924,'rows':_0x45ac9a}:null;}})['then'](respondWithResult(_0xf874fb,null))['catch'](handleError(_0xf874fb,null));};exports[_0x9c4b('0x5a')]=function(_0x19a90e,_0x20f55d,_0x4f03b8){var _0x45efae={};var _0x45d6d5={};var _0xd5dbb7;var _0x482f5f;return db['Trigger']['findOne']({'where':{'id':_0x19a90e[_0x9c4b('0x44')]['id']}})['then'](handleEntityNotFound(_0x20f55d,null))[_0x9c4b('0x24')](function(_0x2ff6bf){if(_0x2ff6bf){_0xd5dbb7=_0x2ff6bf;_0x45d6d5[_0x9c4b('0x37')]=_[_0x9c4b('0x34')](db[_0x9c4b('0x54')][_0x9c4b('0x2f')]);_0x45d6d5[_0x9c4b('0x33')]=_['keys'](_0x19a90e['query']);_0x45d6d5[_0x9c4b('0x35')]=_[_0x9c4b('0x36')](_0x45d6d5['model'],_0x45d6d5[_0x9c4b('0x33')]);_0x45efae[_0x9c4b('0x39')]=_[_0x9c4b('0x36')](_0x45d6d5[_0x9c4b('0x37')],qs[_0x9c4b('0x38')](_0x19a90e['query']['fields']));_0x45efae[_0x9c4b('0x39')]=_0x45efae['attributes'][_0x9c4b('0x3a')]?_0x45efae[_0x9c4b('0x39')]:_0x45d6d5[_0x9c4b('0x37')];_0x45efae[_0x9c4b('0x5b')]=qs[_0x9c4b('0x3c')](_0x19a90e[_0x9c4b('0x33')]['sort']);_0x45efae[_0x9c4b('0x3d')]=qs[_0x9c4b('0x35')](_['pick'](_0x19a90e[_0x9c4b('0x33')],_0x45d6d5[_0x9c4b('0x35')]));if(_0x19a90e['query'][_0x9c4b('0x3f')]){_0x45efae[_0x9c4b('0x3d')]=_[_0x9c4b('0x40')](_0x45efae['where'],{'$or':_['map'](_0x45efae[_0x9c4b('0x39')],function(_0x23947a){var _0x213945={};_0x213945[_0x23947a]={'$like':'%'+_0x19a90e['query'][_0x9c4b('0x3f')]+'%'};return _0x213945;})});}_0x45efae=_[_0x9c4b('0x40')]({},_0x45efae,_0x19a90e[_0x9c4b('0x45')]);return _0xd5dbb7[_0x9c4b('0x5a')](_0x45efae);}})[_0x9c4b('0x24')](function(_0x52407a){if(_0x52407a){_0x482f5f=_0x52407a[_0x9c4b('0x3a')];if(!_0x19a90e[_0x9c4b('0x33')][_0x9c4b('0x59')](_0x9c4b('0x3b'))){_0x45efae[_0x9c4b('0x1d')]=qs[_0x9c4b('0x1d')](_0x19a90e['query'][_0x9c4b('0x1d')]);_0x45efae['offset']=qs[_0x9c4b('0x1a')](_0x19a90e[_0x9c4b('0x33')]['offset']);}return _0xd5dbb7[_0x9c4b('0x5a')](_0x45efae);}})['then'](function(_0x3dd653){if(_0x3dd653){return _0x3dd653?{'count':_0x482f5f,'rows':_0x3dd653}:null;}})['then'](respondWithResult(_0x20f55d,null))[_0x9c4b('0x42')](handleError(_0x20f55d,null));};exports[_0x9c4b('0x5c')]=function(_0x29d2ff,_0x310ec0,_0x42a90c){if(_0x29d2ff['body']['id']){delete _0x29d2ff['body']['id'];}return db['Trigger'][_0x9c4b('0x46')]({'where':{'id':_0x29d2ff['params']['id']}})['then'](handleEntityNotFound(_0x310ec0,null))[_0x9c4b('0x24')](function(_0x5d3e33){if(_0x5d3e33){_0x29d2ff['body'][_0x9c4b('0x5d')]=_0x5d3e33['id'];return db['Action']['create'](_0x29d2ff[_0x9c4b('0x48')]);}})[_0x9c4b('0x24')](respondWithResult(_0x310ec0,null))[_0x9c4b('0x42')](handleError(_0x310ec0,null));};exports[_0x9c4b('0x5e')]=function(_0xab2534,_0x503f6b,_0x438890){var _0x866d10={};var _0x9b17a9={};var _0xae9731;var _0x400d7a;return db[_0x9c4b('0x2e')][_0x9c4b('0x58')]({'where':{'id':_0xab2534[_0x9c4b('0x44')]['id']}})['then'](handleEntityNotFound(_0x503f6b,null))['then'](function(_0x3e51d8){if(_0x3e51d8){_0xae9731=_0x3e51d8;_0x9b17a9[_0x9c4b('0x37')]=_[_0x9c4b('0x34')](db[_0x9c4b('0x5f')]['rawAttributes']);_0x9b17a9[_0x9c4b('0x33')]=_[_0x9c4b('0x34')](_0xab2534[_0x9c4b('0x33')]);_0x9b17a9[_0x9c4b('0x35')]=_[_0x9c4b('0x36')](_0x9b17a9[_0x9c4b('0x37')],_0x9b17a9[_0x9c4b('0x33')]);_0x866d10[_0x9c4b('0x39')]=_[_0x9c4b('0x36')](_0x9b17a9[_0x9c4b('0x37')],qs['fields'](_0xab2534[_0x9c4b('0x33')]['fields']));_0x866d10[_0x9c4b('0x39')]=_0x866d10[_0x9c4b('0x39')][_0x9c4b('0x3a')]?_0x866d10['attributes']:_0x9b17a9['model'];_0x866d10[_0x9c4b('0x5b')]=qs[_0x9c4b('0x3c')](_0xab2534[_0x9c4b('0x33')][_0x9c4b('0x3c')]);_0x866d10[_0x9c4b('0x3d')]=qs[_0x9c4b('0x35')](_[_0x9c4b('0x3e')](_0xab2534[_0x9c4b('0x33')],_0x9b17a9[_0x9c4b('0x35')]));if(_0xab2534[_0x9c4b('0x33')]['filter']){_0x866d10[_0x9c4b('0x3d')]=_[_0x9c4b('0x40')](_0x866d10[_0x9c4b('0x3d')],{'$or':_[_0x9c4b('0x2d')](_0x866d10[_0x9c4b('0x39')],function(_0x59c462){var _0x3e6ead={};_0x3e6ead[_0x59c462]={'$like':'%'+_0xab2534[_0x9c4b('0x33')][_0x9c4b('0x3f')]+'%'};return _0x3e6ead;})});}_0x866d10=_[_0x9c4b('0x40')]({},_0x866d10,_0xab2534[_0x9c4b('0x45')]);return _0xae9731[_0x9c4b('0x5e')](_0x866d10);}})['then'](function(_0x4fb61a){if(_0x4fb61a){_0x400d7a=_0x4fb61a[_0x9c4b('0x3a')];if(!_0xab2534[_0x9c4b('0x33')][_0x9c4b('0x59')]('nolimit')){_0x866d10[_0x9c4b('0x1d')]=qs[_0x9c4b('0x1d')](_0xab2534[_0x9c4b('0x33')][_0x9c4b('0x1d')]);_0x866d10[_0x9c4b('0x1a')]=qs['offset'](_0xab2534[_0x9c4b('0x33')][_0x9c4b('0x1a')]);}return _0xae9731[_0x9c4b('0x5e')](_0x866d10);}})[_0x9c4b('0x24')](function(_0x3c909c){if(_0x3c909c){return _0x3c909c?{'count':_0x400d7a,'rows':_0x3c909c}:null;}})[_0x9c4b('0x24')](respondWithResult(_0x503f6b,null))['catch'](handleError(_0x503f6b,null));}; \ No newline at end of file +var _0xffb2=['pick','getAnyConditions','addAction','Action','getActions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit','Content-Range','reject','save','update','then','destroy','Triggers','UserProfileResource','error','stack','name','send','index','map','Trigger','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','user','get','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Condition','TriggerAnyId','getAllConditions','findOne','keys'];(function(_0x25efc3,_0x555aae){var _0x4d3891=function(_0x149c0a){while(--_0x149c0a){_0x25efc3['push'](_0x25efc3['shift']());}};_0x4d3891(++_0x555aae);}(_0xffb2,0xbb));var _0x2ffb=function(_0x4849f6,_0x104836){_0x4849f6=_0x4849f6-0x0;var _0x1a3dcd=_0xffb2[_0x4849f6];return _0x1a3dcd;};'use strict';var emlformat=require(_0x2ffb('0x0'));var rimraf=require(_0x2ffb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2ffb('0x2'));var rp=require(_0x2ffb('0x3'));var moment=require(_0x2ffb('0x4'));var BPromise=require(_0x2ffb('0x5'));var Mustache=require('mustache');var util=require(_0x2ffb('0x6'));var path=require('path');var sox=require(_0x2ffb('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2ffb('0x8'));var crypto=require(_0x2ffb('0x9'));var jsforce=require(_0x2ffb('0xa'));var deskjs=require(_0x2ffb('0xb'));var toCsv=require(_0x2ffb('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2ffb('0xd'));var authService=require(_0x2ffb('0xe'));var qs=require(_0x2ffb('0xf'));var as=require(_0x2ffb('0x10'));var hardwareService=require(_0x2ffb('0x11'));var logger=require('../../config/logger')(_0x2ffb('0x12'));var utils=require(_0x2ffb('0x13'));var config=require(_0x2ffb('0x14'));var licenseUtil=require(_0x2ffb('0x15'));var db=require(_0x2ffb('0x16'))['db'];function respondWithStatusCode(_0xd47229,_0x395e4c){_0x395e4c=_0x395e4c||0xcc;return function(_0x49b259){if(_0x49b259){return _0xd47229[_0x2ffb('0x17')](_0x395e4c);}return _0xd47229[_0x2ffb('0x18')](_0x395e4c)[_0x2ffb('0x19')]();};}function respondWithResult(_0x2aef21,_0x34769c){_0x34769c=_0x34769c||0xc8;return function(_0x55fd1a){if(_0x55fd1a){return _0x2aef21[_0x2ffb('0x18')](_0x34769c)[_0x2ffb('0x1a')](_0x55fd1a);}};}function respondWithFilteredResult(_0x24b5e9,_0x4edd30){return function(_0x40e3d5){if(_0x40e3d5){var _0x142c97=typeof _0x4edd30['offset']===_0x2ffb('0x1b')&&typeof _0x4edd30['limit']===_0x2ffb('0x1b');var _0x49e8dd=_0x40e3d5['count'];var _0x1daf87=_0x142c97?0x0:_0x4edd30[_0x2ffb('0x1c')];var _0x34f304=_0x142c97?_0x40e3d5[_0x2ffb('0x1d')]:_0x4edd30[_0x2ffb('0x1c')]+_0x4edd30[_0x2ffb('0x1e')];var _0x4668ab;if(_0x34f304>=_0x49e8dd){_0x34f304=_0x49e8dd;_0x4668ab=0xc8;}else{_0x4668ab=0xce;}_0x24b5e9[_0x2ffb('0x18')](_0x4668ab);return _0x24b5e9['set'](_0x2ffb('0x1f'),_0x1daf87+'-'+_0x34f304+'/'+_0x49e8dd)['json'](_0x40e3d5);}return null;};}function patchUpdates(_0x2e0f4f){return function(_0x192f7b){try{jsonpatch['apply'](_0x192f7b,_0x2e0f4f,!![]);}catch(_0x195f1e){return BPromise[_0x2ffb('0x20')](_0x195f1e);}return _0x192f7b[_0x2ffb('0x21')]();};}function saveUpdates(_0x441f1e,_0x257057){return function(_0x27cf1c){if(_0x27cf1c){return _0x27cf1c[_0x2ffb('0x22')](_0x441f1e)[_0x2ffb('0x23')](function(_0x114e24){return _0x114e24;});}return null;};}function removeEntity(_0x2ba2a0,_0x315480){return function(_0x522eef){if(_0x522eef){return _0x522eef[_0x2ffb('0x24')]()[_0x2ffb('0x23')](function(){var _0x22f313=_0x522eef['get']({'plain':!![]});var _0x1ec403=_0x2ffb('0x25');return db[_0x2ffb('0x26')][_0x2ffb('0x24')]({'where':{'type':_0x1ec403,'resourceId':_0x22f313['id']}})[_0x2ffb('0x23')](function(){return _0x522eef;});})['then'](function(){_0x2ba2a0[_0x2ffb('0x18')](0xcc)[_0x2ffb('0x19')]();});}};}function handleEntityNotFound(_0xec8a44,_0x1d52ac){return function(_0x440aee){if(!_0x440aee){_0xec8a44[_0x2ffb('0x17')](0x194);}return _0x440aee;};}function handleError(_0x106e9c,_0x3e60e4){_0x3e60e4=_0x3e60e4||0x1f4;return function(_0x2b29c6){logger[_0x2ffb('0x27')](_0x2b29c6[_0x2ffb('0x28')]);if(_0x2b29c6['name']){delete _0x2b29c6[_0x2ffb('0x29')];}_0x106e9c[_0x2ffb('0x18')](_0x3e60e4)[_0x2ffb('0x2a')](_0x2b29c6);};}exports[_0x2ffb('0x2b')]=function(_0x10409a,_0x446346){var _0x339f63={},_0x3568d4={},_0x3c21ff={'count':0x0,'rows':[]};var _0x2f59b9=_[_0x2ffb('0x2c')](db[_0x2ffb('0x2d')][_0x2ffb('0x2e')],function(_0x4c6143){return{'name':_0x4c6143[_0x2ffb('0x2f')],'type':_0x4c6143['type']['key']};});_0x3568d4[_0x2ffb('0x30')]=_['map'](_0x2f59b9,_0x2ffb('0x29'));_0x3568d4[_0x2ffb('0x31')]=_['keys'](_0x10409a[_0x2ffb('0x31')]);_0x3568d4[_0x2ffb('0x32')]=_[_0x2ffb('0x33')](_0x3568d4[_0x2ffb('0x30')],_0x3568d4[_0x2ffb('0x31')]);_0x339f63[_0x2ffb('0x34')]=_['intersection'](_0x3568d4[_0x2ffb('0x30')],qs['fields'](_0x10409a[_0x2ffb('0x31')][_0x2ffb('0x35')]));_0x339f63[_0x2ffb('0x34')]=_0x339f63['attributes'][_0x2ffb('0x36')]?_0x339f63[_0x2ffb('0x34')]:_0x3568d4[_0x2ffb('0x30')];if(!_0x10409a['query'][_0x2ffb('0x37')](_0x2ffb('0x38'))){_0x339f63[_0x2ffb('0x1e')]=qs[_0x2ffb('0x1e')](_0x10409a[_0x2ffb('0x31')][_0x2ffb('0x1e')]);_0x339f63[_0x2ffb('0x1c')]=qs[_0x2ffb('0x1c')](_0x10409a[_0x2ffb('0x31')][_0x2ffb('0x1c')]);}_0x339f63[_0x2ffb('0x39')]=qs[_0x2ffb('0x3a')](_0x10409a['query'][_0x2ffb('0x3a')]);_0x339f63[_0x2ffb('0x3b')]=qs[_0x2ffb('0x32')](_['pick'](_0x10409a[_0x2ffb('0x31')],_0x3568d4['filters']),_0x2f59b9);if(_0x10409a[_0x2ffb('0x31')][_0x2ffb('0x3c')]){_0x339f63[_0x2ffb('0x3b')]=_[_0x2ffb('0x3d')](_0x339f63[_0x2ffb('0x3b')],{'$or':_[_0x2ffb('0x2c')](_0x2f59b9,function(_0x1bc263){if(_0x1bc263[_0x2ffb('0x3e')]!==_0x2ffb('0x3f')){var _0x292084={};_0x292084[_0x1bc263['name']]={'$like':'%'+_0x10409a[_0x2ffb('0x31')][_0x2ffb('0x3c')]+'%'};return _0x292084;}})});}_0x339f63=_[_0x2ffb('0x3d')]({},_0x339f63,_0x10409a[_0x2ffb('0x40')]);var _0x268c0d={'where':_0x339f63['where']};return db[_0x2ffb('0x2d')][_0x2ffb('0x1d')](_0x268c0d)['then'](function(_0xb5303){_0x3c21ff[_0x2ffb('0x1d')]=_0xb5303;if(_0x10409a[_0x2ffb('0x31')][_0x2ffb('0x41')]){_0x339f63['include']=[{'all':!![]}];}return db[_0x2ffb('0x2d')][_0x2ffb('0x42')](_0x339f63);})['then'](function(_0x4b7119){_0x3c21ff[_0x2ffb('0x43')]=_0x4b7119;return _0x3c21ff;})[_0x2ffb('0x23')](respondWithFilteredResult(_0x446346,_0x339f63))[_0x2ffb('0x44')](handleError(_0x446346,null));};exports[_0x2ffb('0x45')]=function(_0x39ff6b,_0x4ad1a8){var _0x24ca42={'raw':![],'where':{'id':_0x39ff6b[_0x2ffb('0x46')]['id']}},_0x49e5cd={};_0x49e5cd[_0x2ffb('0x30')]=_['keys'](db[_0x2ffb('0x2d')][_0x2ffb('0x2e')]);_0x49e5cd['query']=_['keys'](_0x39ff6b['query']);_0x49e5cd[_0x2ffb('0x32')]=_[_0x2ffb('0x33')](_0x49e5cd[_0x2ffb('0x30')],_0x49e5cd[_0x2ffb('0x31')]);_0x24ca42[_0x2ffb('0x34')]=_['intersection'](_0x49e5cd[_0x2ffb('0x30')],qs[_0x2ffb('0x35')](_0x39ff6b['query'][_0x2ffb('0x35')]));_0x24ca42[_0x2ffb('0x34')]=_0x24ca42['attributes']['length']?_0x24ca42[_0x2ffb('0x34')]:_0x49e5cd[_0x2ffb('0x30')];if(_0x39ff6b[_0x2ffb('0x31')][_0x2ffb('0x41')]){_0x24ca42[_0x2ffb('0x47')]=[{'all':!![]}];}_0x24ca42=_[_0x2ffb('0x3d')]({},_0x24ca42,_0x39ff6b[_0x2ffb('0x40')]);return db[_0x2ffb('0x2d')][_0x2ffb('0x48')](_0x24ca42)[_0x2ffb('0x23')](handleEntityNotFound(_0x4ad1a8,null))[_0x2ffb('0x23')](respondWithResult(_0x4ad1a8,null))[_0x2ffb('0x44')](handleError(_0x4ad1a8,null));};exports[_0x2ffb('0x49')]=function(_0x749688,_0xfcf18e){return db['Trigger'][_0x2ffb('0x49')](_0x749688[_0x2ffb('0x4a')],{})[_0x2ffb('0x23')](function(_0xddb009){var _0x5b8d5e=_0x749688[_0x2ffb('0x4b')][_0x2ffb('0x4c')]({'plain':!![]});if(!_0x5b8d5e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5b8d5e[_0x2ffb('0x4d')]===_0x2ffb('0x4b')){var _0x5af94a=_0xddb009['get']({'plain':!![]});var _0x5003cc='Triggers';return db['UserProfileSection'][_0x2ffb('0x48')]({'where':{'name':_0x5003cc,'userProfileId':_0x5b8d5e[_0x2ffb('0x4e')]},'raw':!![]})[_0x2ffb('0x23')](function(_0x391a46){if(_0x391a46&&_0x391a46[_0x2ffb('0x4f')]===0x0){return db[_0x2ffb('0x26')][_0x2ffb('0x49')]({'name':_0x5af94a[_0x2ffb('0x29')],'resourceId':_0x5af94a['id'],'type':_0x391a46['name'],'sectionId':_0x391a46['id']},{})['then'](function(){return _0xddb009;});}else{return _0xddb009;}})[_0x2ffb('0x44')](function(_0x4a2715){logger[_0x2ffb('0x27')](_0x2ffb('0x50'),_0x4a2715);throw _0x4a2715;});}return _0xddb009;})['then'](respondWithResult(_0xfcf18e,0xc9))[_0x2ffb('0x44')](handleError(_0xfcf18e,null));};exports[_0x2ffb('0x22')]=function(_0x30dfb1,_0x19df3d){if(_0x30dfb1['body']['id']){delete _0x30dfb1[_0x2ffb('0x4a')]['id'];}return db[_0x2ffb('0x2d')][_0x2ffb('0x48')]({'where':{'id':_0x30dfb1[_0x2ffb('0x46')]['id']}})[_0x2ffb('0x23')](handleEntityNotFound(_0x19df3d,null))['then'](saveUpdates(_0x30dfb1[_0x2ffb('0x4a')],null))['then'](respondWithResult(_0x19df3d,null))[_0x2ffb('0x44')](handleError(_0x19df3d,null));};exports[_0x2ffb('0x24')]=function(_0x23876a,_0x22f63e){return db[_0x2ffb('0x2d')][_0x2ffb('0x48')]({'where':{'id':_0x23876a[_0x2ffb('0x46')]['id']}})[_0x2ffb('0x23')](handleEntityNotFound(_0x22f63e,null))['then'](removeEntity(_0x22f63e,null))['catch'](handleError(_0x22f63e,null));};exports['addAllCondition']=function(_0x17ac8d,_0x199f05,_0x11b21f){if(_0x17ac8d['body']['id']){delete _0x17ac8d[_0x2ffb('0x4a')]['id'];}return db[_0x2ffb('0x2d')][_0x2ffb('0x48')]({'where':{'id':_0x17ac8d['params']['id']}})[_0x2ffb('0x23')](handleEntityNotFound(_0x199f05,null))[_0x2ffb('0x23')](function(_0x4002b4){if(_0x4002b4){_0x17ac8d[_0x2ffb('0x4a')]['TriggerAllId']=_0x4002b4['id'];return db[_0x2ffb('0x51')][_0x2ffb('0x49')](_0x17ac8d[_0x2ffb('0x4a')]);}})['then'](respondWithResult(_0x199f05,null))[_0x2ffb('0x44')](handleError(_0x199f05,null));};exports['addAnyCondition']=function(_0x111982,_0x2965d6,_0xde48b5){if(_0x111982[_0x2ffb('0x4a')]['id']){delete _0x111982[_0x2ffb('0x4a')]['id'];}return db[_0x2ffb('0x2d')][_0x2ffb('0x48')]({'where':{'id':_0x111982[_0x2ffb('0x46')]['id']}})[_0x2ffb('0x23')](handleEntityNotFound(_0x2965d6,null))['then'](function(_0x19b7d8){if(_0x19b7d8){_0x111982[_0x2ffb('0x4a')][_0x2ffb('0x52')]=_0x19b7d8['id'];return db['Condition'][_0x2ffb('0x49')](_0x111982['body']);}})['then'](respondWithResult(_0x2965d6,null))[_0x2ffb('0x44')](handleError(_0x2965d6,null));};exports[_0x2ffb('0x53')]=function(_0x4a5b5a,_0x23afe2,_0x4ecbfd){var _0x27ab39={};var _0x2fa3b9={};var _0x5e0dd9;var _0x4ffc8e;return db['Trigger'][_0x2ffb('0x54')]({'where':{'id':_0x4a5b5a[_0x2ffb('0x46')]['id']}})[_0x2ffb('0x23')](handleEntityNotFound(_0x23afe2,null))[_0x2ffb('0x23')](function(_0x257436){if(_0x257436){_0x5e0dd9=_0x257436;_0x2fa3b9[_0x2ffb('0x30')]=_[_0x2ffb('0x55')](db[_0x2ffb('0x51')][_0x2ffb('0x2e')]);_0x2fa3b9[_0x2ffb('0x31')]=_[_0x2ffb('0x55')](_0x4a5b5a[_0x2ffb('0x31')]);_0x2fa3b9[_0x2ffb('0x32')]=_['intersection'](_0x2fa3b9[_0x2ffb('0x30')],_0x2fa3b9[_0x2ffb('0x31')]);_0x27ab39['attributes']=_[_0x2ffb('0x33')](_0x2fa3b9[_0x2ffb('0x30')],qs['fields'](_0x4a5b5a[_0x2ffb('0x31')][_0x2ffb('0x35')]));_0x27ab39[_0x2ffb('0x34')]=_0x27ab39['attributes'][_0x2ffb('0x36')]?_0x27ab39[_0x2ffb('0x34')]:_0x2fa3b9['model'];_0x27ab39[_0x2ffb('0x39')]=qs[_0x2ffb('0x3a')](_0x4a5b5a[_0x2ffb('0x31')][_0x2ffb('0x3a')]);_0x27ab39[_0x2ffb('0x3b')]=qs[_0x2ffb('0x32')](_[_0x2ffb('0x56')](_0x4a5b5a['query'],_0x2fa3b9[_0x2ffb('0x32')]));if(_0x4a5b5a['query'][_0x2ffb('0x3c')]){_0x27ab39[_0x2ffb('0x3b')]=_[_0x2ffb('0x3d')](_0x27ab39[_0x2ffb('0x3b')],{'$or':_[_0x2ffb('0x2c')](_0x27ab39[_0x2ffb('0x34')],function(_0x142c28){var _0x5342a6={};_0x5342a6[_0x142c28]={'$like':'%'+_0x4a5b5a[_0x2ffb('0x31')][_0x2ffb('0x3c')]+'%'};return _0x5342a6;})});}_0x27ab39=_[_0x2ffb('0x3d')]({},_0x27ab39,_0x4a5b5a[_0x2ffb('0x40')]);return _0x5e0dd9['getAllConditions'](_0x27ab39);}})[_0x2ffb('0x23')](function(_0x4a6d92){if(_0x4a6d92){_0x4ffc8e=_0x4a6d92[_0x2ffb('0x36')];if(!_0x4a5b5a[_0x2ffb('0x31')][_0x2ffb('0x37')]('nolimit')){_0x27ab39[_0x2ffb('0x1e')]=qs['limit'](_0x4a5b5a[_0x2ffb('0x31')][_0x2ffb('0x1e')]);_0x27ab39['offset']=qs[_0x2ffb('0x1c')](_0x4a5b5a[_0x2ffb('0x31')][_0x2ffb('0x1c')]);}return _0x5e0dd9[_0x2ffb('0x53')](_0x27ab39);}})['then'](function(_0x3dfaff){if(_0x3dfaff){return _0x3dfaff?{'count':_0x4ffc8e,'rows':_0x3dfaff}:null;}})[_0x2ffb('0x23')](respondWithResult(_0x23afe2,null))[_0x2ffb('0x44')](handleError(_0x23afe2,null));};exports[_0x2ffb('0x57')]=function(_0x3447d0,_0x5c4113,_0x312c11){var _0x59c11e={};var _0x265a0e={};var _0x5da5f8;var _0x40e4ec;return db[_0x2ffb('0x2d')][_0x2ffb('0x54')]({'where':{'id':_0x3447d0[_0x2ffb('0x46')]['id']}})[_0x2ffb('0x23')](handleEntityNotFound(_0x5c4113,null))[_0x2ffb('0x23')](function(_0x227a99){if(_0x227a99){_0x5da5f8=_0x227a99;_0x265a0e[_0x2ffb('0x30')]=_[_0x2ffb('0x55')](db[_0x2ffb('0x51')][_0x2ffb('0x2e')]);_0x265a0e['query']=_[_0x2ffb('0x55')](_0x3447d0['query']);_0x265a0e[_0x2ffb('0x32')]=_[_0x2ffb('0x33')](_0x265a0e[_0x2ffb('0x30')],_0x265a0e['query']);_0x59c11e['attributes']=_[_0x2ffb('0x33')](_0x265a0e['model'],qs['fields'](_0x3447d0[_0x2ffb('0x31')]['fields']));_0x59c11e[_0x2ffb('0x34')]=_0x59c11e[_0x2ffb('0x34')][_0x2ffb('0x36')]?_0x59c11e[_0x2ffb('0x34')]:_0x265a0e[_0x2ffb('0x30')];_0x59c11e[_0x2ffb('0x39')]=qs[_0x2ffb('0x3a')](_0x3447d0[_0x2ffb('0x31')][_0x2ffb('0x3a')]);_0x59c11e[_0x2ffb('0x3b')]=qs[_0x2ffb('0x32')](_['pick'](_0x3447d0[_0x2ffb('0x31')],_0x265a0e[_0x2ffb('0x32')]));if(_0x3447d0[_0x2ffb('0x31')]['filter']){_0x59c11e[_0x2ffb('0x3b')]=_[_0x2ffb('0x3d')](_0x59c11e[_0x2ffb('0x3b')],{'$or':_[_0x2ffb('0x2c')](_0x59c11e[_0x2ffb('0x34')],function(_0x595f9f){var _0x27b8eb={};_0x27b8eb[_0x595f9f]={'$like':'%'+_0x3447d0[_0x2ffb('0x31')][_0x2ffb('0x3c')]+'%'};return _0x27b8eb;})});}_0x59c11e=_[_0x2ffb('0x3d')]({},_0x59c11e,_0x3447d0[_0x2ffb('0x40')]);return _0x5da5f8['getAnyConditions'](_0x59c11e);}})[_0x2ffb('0x23')](function(_0x49152f){if(_0x49152f){_0x40e4ec=_0x49152f[_0x2ffb('0x36')];if(!_0x3447d0[_0x2ffb('0x31')][_0x2ffb('0x37')](_0x2ffb('0x38'))){_0x59c11e[_0x2ffb('0x1e')]=qs[_0x2ffb('0x1e')](_0x3447d0[_0x2ffb('0x31')]['limit']);_0x59c11e[_0x2ffb('0x1c')]=qs[_0x2ffb('0x1c')](_0x3447d0['query'][_0x2ffb('0x1c')]);}return _0x5da5f8[_0x2ffb('0x57')](_0x59c11e);}})['then'](function(_0x435364){if(_0x435364){return _0x435364?{'count':_0x40e4ec,'rows':_0x435364}:null;}})[_0x2ffb('0x23')](respondWithResult(_0x5c4113,null))[_0x2ffb('0x44')](handleError(_0x5c4113,null));};exports[_0x2ffb('0x58')]=function(_0x3c4e1a,_0x490d8f,_0xd2a2b5){if(_0x3c4e1a['body']['id']){delete _0x3c4e1a[_0x2ffb('0x4a')]['id'];}return db[_0x2ffb('0x2d')][_0x2ffb('0x48')]({'where':{'id':_0x3c4e1a['params']['id']}})[_0x2ffb('0x23')](handleEntityNotFound(_0x490d8f,null))[_0x2ffb('0x23')](function(_0x4d226e){if(_0x4d226e){_0x3c4e1a[_0x2ffb('0x4a')]['TriggerId']=_0x4d226e['id'];return db[_0x2ffb('0x59')][_0x2ffb('0x49')](_0x3c4e1a[_0x2ffb('0x4a')]);}})[_0x2ffb('0x23')](respondWithResult(_0x490d8f,null))['catch'](handleError(_0x490d8f,null));};exports[_0x2ffb('0x5a')]=function(_0x1ec0c7,_0x417917,_0x3ecfa8){var _0x4079e9={};var _0x16bec2={};var _0x23526c;var _0x3ea422;return db[_0x2ffb('0x2d')][_0x2ffb('0x54')]({'where':{'id':_0x1ec0c7[_0x2ffb('0x46')]['id']}})[_0x2ffb('0x23')](handleEntityNotFound(_0x417917,null))[_0x2ffb('0x23')](function(_0xaefbd6){if(_0xaefbd6){_0x23526c=_0xaefbd6;_0x16bec2['model']=_[_0x2ffb('0x55')](db[_0x2ffb('0x59')][_0x2ffb('0x2e')]);_0x16bec2['query']=_[_0x2ffb('0x55')](_0x1ec0c7[_0x2ffb('0x31')]);_0x16bec2['filters']=_[_0x2ffb('0x33')](_0x16bec2[_0x2ffb('0x30')],_0x16bec2[_0x2ffb('0x31')]);_0x4079e9[_0x2ffb('0x34')]=_['intersection'](_0x16bec2[_0x2ffb('0x30')],qs[_0x2ffb('0x35')](_0x1ec0c7[_0x2ffb('0x31')][_0x2ffb('0x35')]));_0x4079e9[_0x2ffb('0x34')]=_0x4079e9[_0x2ffb('0x34')][_0x2ffb('0x36')]?_0x4079e9['attributes']:_0x16bec2[_0x2ffb('0x30')];_0x4079e9[_0x2ffb('0x39')]=qs[_0x2ffb('0x3a')](_0x1ec0c7['query'][_0x2ffb('0x3a')]);_0x4079e9[_0x2ffb('0x3b')]=qs[_0x2ffb('0x32')](_['pick'](_0x1ec0c7[_0x2ffb('0x31')],_0x16bec2[_0x2ffb('0x32')]));if(_0x1ec0c7[_0x2ffb('0x31')]['filter']){_0x4079e9['where']=_[_0x2ffb('0x3d')](_0x4079e9[_0x2ffb('0x3b')],{'$or':_['map'](_0x4079e9[_0x2ffb('0x34')],function(_0x2c6270){var _0xad2c2d={};_0xad2c2d[_0x2c6270]={'$like':'%'+_0x1ec0c7[_0x2ffb('0x31')][_0x2ffb('0x3c')]+'%'};return _0xad2c2d;})});}_0x4079e9=_[_0x2ffb('0x3d')]({},_0x4079e9,_0x1ec0c7[_0x2ffb('0x40')]);return _0x23526c['getActions'](_0x4079e9);}})[_0x2ffb('0x23')](function(_0x3456dd){if(_0x3456dd){_0x3ea422=_0x3456dd[_0x2ffb('0x36')];if(!_0x1ec0c7[_0x2ffb('0x31')]['hasOwnProperty'](_0x2ffb('0x38'))){_0x4079e9[_0x2ffb('0x1e')]=qs[_0x2ffb('0x1e')](_0x1ec0c7['query'][_0x2ffb('0x1e')]);_0x4079e9[_0x2ffb('0x1c')]=qs[_0x2ffb('0x1c')](_0x1ec0c7['query'][_0x2ffb('0x1c')]);}return _0x23526c[_0x2ffb('0x5a')](_0x4079e9);}})[_0x2ffb('0x23')](function(_0x2fdb5e){if(_0x2fdb5e){return _0x2fdb5e?{'count':_0x3ea422,'rows':_0x2fdb5e}:null;}})[_0x2ffb('0x23')](respondWithResult(_0x417917,null))[_0x2ffb('0x44')](handleError(_0x417917,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 5bd49b5..106b3bb 100644 --- a/server/api/trigger/trigger.model.js +++ b/server/api/trigger/trigger.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdab2=['./trigger.attributes','exports','define','Trigger','tools_triggers','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x3b2244,_0x54873f){var _0x2dcc14=function(_0x53d73f){while(--_0x53d73f){_0x3b2244['push'](_0x3b2244['shift']());}};_0x2dcc14(++_0x54873f);}(_0xdab2,0x130));var _0x2dab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdab2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2dab('0x0'));var util=require(_0x2dab('0x1'));var logger=require('../../config/logger')(_0x2dab('0x2'));var moment=require(_0x2dab('0x3'));var BPromise=require(_0x2dab('0x4'));var rp=require(_0x2dab('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2dab('0x6'));var config=require(_0x2dab('0x7'));var attributes=require(_0x2dab('0x8'));module[_0x2dab('0x9')]=function(_0x4562bb,_0x1421d5){return _0x4562bb[_0x2dab('0xa')](_0x2dab('0xb'),attributes,{'tableName':_0x2dab('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0a12=['util','bluebird','path','rimraf','../../config/environment','./trigger.attributes','exports','tools_triggers'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x0a12,0xb8));var _0x20a1=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0x0a12[_0x2f1762];return _0x8ab21;};'use strict';var _=require('lodash');var util=require(_0x20a1('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x20a1('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x20a1('0x2'));var rimraf=require(_0x20a1('0x3'));var config=require(_0x20a1('0x4'));var attributes=require(_0x20a1('0x5'));module[_0x20a1('0x6')]=function(_0x2e0ad3,_0x1fedd2){return _0x2e0ad3['define']('Trigger',attributes,{'tableName':_0x20a1('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 926086d..1aa4116 100644 --- a/server/api/trigger/trigger.rpc.js +++ b/server/api/trigger/trigger.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaba9=['attributes','ShowTrigger','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','Trigger,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','GetTrigger','findAll','raw','options','where','map','include','model'];(function(_0x5bf840,_0x9fc2ab){var _0x4f4355=function(_0x5bef49){while(--_0x5bef49){_0x5bf840['push'](_0x5bf840['shift']());}};_0x4f4355(++_0x9fc2ab);}(_0xaba9,0xad));var _0x9aba=function(_0x51b15f,_0x26b98d){_0x51b15f=_0x51b15f-0x0;var _0x2361ce=_0xaba9[_0x51b15f];return _0x2361ce;};'use strict';var _=require(_0x9aba('0x0'));var util=require(_0x9aba('0x1'));var moment=require(_0x9aba('0x2'));var BPromise=require(_0x9aba('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9aba('0x4'));var db=require(_0x9aba('0x5'))['db'];var utils=require(_0x9aba('0x6'));var logger=require(_0x9aba('0x7'))(_0x9aba('0x8'));var config=require('../../config/environment');var jayson=require(_0x9aba('0x9'));var client=jayson[_0x9aba('0xa')][_0x9aba('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x57b28f,_0x4a352c,_0x404657){return new BPromise(function(_0x34f677,_0xeaf7cc){return client['request'](_0x57b28f,_0x404657)[_0x9aba('0xc')](function(_0x310c4b){logger[_0x9aba('0xd')](_0x9aba('0xe'),_0x4a352c,'request\x20sent');logger[_0x9aba('0xf')]('Trigger,\x20%s,\x20%s,\x20%s',_0x4a352c,_0x9aba('0x10'),JSON[_0x9aba('0x11')](_0x310c4b));if(_0x310c4b[_0x9aba('0x12')]){if(_0x310c4b[_0x9aba('0x12')][_0x9aba('0x13')]===0x1f4){logger[_0x9aba('0x12')]('Trigger,\x20%s,\x20%s',_0x4a352c,_0x310c4b[_0x9aba('0x12')][_0x9aba('0x14')]);return _0xeaf7cc(_0x310c4b[_0x9aba('0x12')][_0x9aba('0x14')]);}logger[_0x9aba('0x12')](_0x9aba('0xe'),_0x4a352c,_0x310c4b[_0x9aba('0x12')][_0x9aba('0x14')]);return _0x34f677(_0x310c4b['error']['message']);}else{logger[_0x9aba('0xd')]('Trigger,\x20%s,\x20%s',_0x4a352c,_0x9aba('0x10'));_0x34f677(_0x310c4b[_0x9aba('0x15')][_0x9aba('0x14')]);}})[_0x9aba('0x16')](function(_0x3b8476){logger[_0x9aba('0x12')](_0x9aba('0xe'),_0x4a352c,_0x3b8476);_0xeaf7cc(_0x3b8476);});});}exports[_0x9aba('0x17')]=function(_0x52cb27){var _0x3fa676=this;return new Promise(function(_0x11fed5,_0x496b40){return db['Trigger'][_0x9aba('0x18')]({'raw':_0x52cb27['options']?_0x52cb27['options'][_0x9aba('0x19')]===undefined?!![]:![]:!![],'where':_0x52cb27['options']?_0x52cb27[_0x9aba('0x1a')][_0x9aba('0x1b')]||null:null,'attributes':_0x52cb27['options']?_0x52cb27[_0x9aba('0x1a')]['attributes']||null:null,'limit':_0x52cb27[_0x9aba('0x1a')]?_0x52cb27['options']['limit']||null:null,'include':_0x52cb27[_0x9aba('0x1a')]?_0x52cb27['options']['include']?_[_0x9aba('0x1c')](_0x52cb27[_0x9aba('0x1a')][_0x9aba('0x1d')],function(_0x56ad11){return{'model':db[_0x56ad11[_0x9aba('0x1e')]],'as':_0x56ad11['as'],'attributes':_0x56ad11[_0x9aba('0x1f')],'include':_0x56ad11[_0x9aba('0x1d')]?_[_0x9aba('0x1c')](_0x56ad11[_0x9aba('0x1d')],function(_0x30a4e8){return{'model':db[_0x30a4e8[_0x9aba('0x1e')]],'as':_0x30a4e8['as'],'attributes':_0x30a4e8[_0x9aba('0x1f')],'include':_0x30a4e8[_0x9aba('0x1d')]?_[_0x9aba('0x1c')](_0x30a4e8[_0x9aba('0x1d')],function(_0x496c2e){return{'model':db[_0x496c2e[_0x9aba('0x1e')]],'as':_0x496c2e['as'],'attributes':_0x496c2e[_0x9aba('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x9aba('0xc')](function(_0xc6194c){logger[_0x9aba('0xd')](_0x9aba('0x17'),_0x52cb27);logger[_0x9aba('0xf')](_0x9aba('0x17'),_0x52cb27,JSON['stringify'](_0xc6194c));_0x11fed5(_0xc6194c);})['catch'](function(_0x1f4f57){logger[_0x9aba('0x12')](_0x9aba('0x17'),_0x1f4f57[_0x9aba('0x14')],_0x52cb27);_0x496b40(_0x3fa676[_0x9aba('0x12')](0x1f4,_0x1f4f57['message']));});});};exports[_0x9aba('0x20')]=function(_0x454ff8){var _0x27d174=this;return new Promise(function(_0x54f8a9,_0x1c2185){return db['Trigger'][_0x9aba('0x21')]({'raw':_0x454ff8[_0x9aba('0x1a')]?_0x454ff8[_0x9aba('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x454ff8['options']?_0x454ff8['options'][_0x9aba('0x1b')]||null:null,'attributes':_0x454ff8[_0x9aba('0x1a')]?_0x454ff8['options'][_0x9aba('0x1f')]||null:null,'include':_0x454ff8[_0x9aba('0x1a')]?_0x454ff8[_0x9aba('0x1a')][_0x9aba('0x1d')]?_[_0x9aba('0x1c')](_0x454ff8[_0x9aba('0x1a')][_0x9aba('0x1d')],function(_0x250fa5){return{'model':db[_0x250fa5['model']],'as':_0x250fa5['as'],'attributes':_0x250fa5['attributes'],'include':_0x250fa5[_0x9aba('0x1d')]?_[_0x9aba('0x1c')](_0x250fa5[_0x9aba('0x1d')],function(_0x19212a){return{'model':db[_0x19212a[_0x9aba('0x1e')]],'as':_0x19212a['as'],'attributes':_0x19212a[_0x9aba('0x1f')],'include':_0x19212a[_0x9aba('0x1d')]?_['map'](_0x19212a['include'],function(_0x5bc16a){return{'model':db[_0x5bc16a[_0x9aba('0x1e')]],'as':_0x5bc16a['as'],'attributes':_0x5bc16a[_0x9aba('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x9aba('0xc')](function(_0x4e5328){logger['info'](_0x9aba('0x20'),_0x454ff8);logger[_0x9aba('0xf')](_0x9aba('0x20'),_0x454ff8,JSON[_0x9aba('0x11')](_0x4e5328));_0x54f8a9(_0x4e5328);})['catch'](function(_0x287fe2){logger[_0x9aba('0x12')]('ShowTrigger',_0x287fe2['message'],_0x454ff8);_0x1c2185(_0x27d174[_0x9aba('0x12')](0x1f4,_0x287fe2['message']));});});}; \ No newline at end of file +var _0xe9bb=['jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','options','raw','limit','include','map','model','attributes','GetTrigger','find','where','ShowTrigger','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0xe9bb,0xfa));var _0xbe9b=function(_0x2c2fc6,_0x355d2b){_0x2c2fc6=_0x2c2fc6-0x0;var _0x16d14a=_0xe9bb[_0x2c2fc6];return _0x16d14a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbe9b('0x0'));var BPromise=require(_0xbe9b('0x1'));var rs=require(_0xbe9b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbe9b('0x3'))['db'];var utils=require(_0xbe9b('0x4'));var logger=require(_0xbe9b('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbe9b('0x6'));var client=jayson[_0xbe9b('0x7')][_0xbe9b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x428832,_0x5ba2d7,_0x4d47a0){return new BPromise(function(_0x56537e,_0x1d5b8a){return client[_0xbe9b('0x9')](_0x428832,_0x4d47a0)[_0xbe9b('0xa')](function(_0x1b9f68){logger[_0xbe9b('0xb')](_0xbe9b('0xc'),_0x5ba2d7,_0xbe9b('0xd'));logger[_0xbe9b('0xe')](_0xbe9b('0xf'),_0x5ba2d7,_0xbe9b('0xd'),JSON[_0xbe9b('0x10')](_0x1b9f68));if(_0x1b9f68['error']){if(_0x1b9f68[_0xbe9b('0x11')]['code']===0x1f4){logger[_0xbe9b('0x11')](_0xbe9b('0xc'),_0x5ba2d7,_0x1b9f68[_0xbe9b('0x11')]['message']);return _0x1d5b8a(_0x1b9f68['error'][_0xbe9b('0x12')]);}logger['error'](_0xbe9b('0xc'),_0x5ba2d7,_0x1b9f68[_0xbe9b('0x11')]['message']);return _0x56537e(_0x1b9f68[_0xbe9b('0x11')]['message']);}else{logger[_0xbe9b('0xb')]('Trigger,\x20%s,\x20%s',_0x5ba2d7,_0xbe9b('0xd'));_0x56537e(_0x1b9f68[_0xbe9b('0x13')][_0xbe9b('0x12')]);}})[_0xbe9b('0x14')](function(_0x465ba0){logger[_0xbe9b('0x11')](_0xbe9b('0xc'),_0x5ba2d7,_0x465ba0);_0x1d5b8a(_0x465ba0);});});}exports['GetTrigger']=function(_0x30856f){var _0x401153=this;return new Promise(function(_0x11fc9d,_0x328b71){return db['Trigger']['findAll']({'raw':_0x30856f[_0xbe9b('0x15')]?_0x30856f[_0xbe9b('0x15')][_0xbe9b('0x16')]===undefined?!![]:![]:!![],'where':_0x30856f[_0xbe9b('0x15')]?_0x30856f[_0xbe9b('0x15')]['where']||null:null,'attributes':_0x30856f[_0xbe9b('0x15')]?_0x30856f[_0xbe9b('0x15')]['attributes']||null:null,'limit':_0x30856f[_0xbe9b('0x15')]?_0x30856f[_0xbe9b('0x15')][_0xbe9b('0x17')]||null:null,'include':_0x30856f[_0xbe9b('0x15')]?_0x30856f[_0xbe9b('0x15')][_0xbe9b('0x18')]?_[_0xbe9b('0x19')](_0x30856f['options'][_0xbe9b('0x18')],function(_0x3a8543){return{'model':db[_0x3a8543[_0xbe9b('0x1a')]],'as':_0x3a8543['as'],'attributes':_0x3a8543['attributes'],'include':_0x3a8543[_0xbe9b('0x18')]?_['map'](_0x3a8543[_0xbe9b('0x18')],function(_0x25dd75){return{'model':db[_0x25dd75['model']],'as':_0x25dd75['as'],'attributes':_0x25dd75[_0xbe9b('0x1b')],'include':_0x25dd75[_0xbe9b('0x18')]?_[_0xbe9b('0x19')](_0x25dd75[_0xbe9b('0x18')],function(_0x43aac4){return{'model':db[_0x43aac4[_0xbe9b('0x1a')]],'as':_0x43aac4['as'],'attributes':_0x43aac4[_0xbe9b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xbe9b('0xa')](function(_0x264259){logger[_0xbe9b('0xb')](_0xbe9b('0x1c'),_0x30856f);logger['debug'](_0xbe9b('0x1c'),_0x30856f,JSON[_0xbe9b('0x10')](_0x264259));_0x11fc9d(_0x264259);})[_0xbe9b('0x14')](function(_0x31efaf){logger[_0xbe9b('0x11')](_0xbe9b('0x1c'),_0x31efaf[_0xbe9b('0x12')],_0x30856f);_0x328b71(_0x401153['error'](0x1f4,_0x31efaf[_0xbe9b('0x12')]));});});};exports['ShowTrigger']=function(_0x2cd2d4){var _0x4d8571=this;return new Promise(function(_0x260a1d,_0x56ea15){return db['Trigger'][_0xbe9b('0x1d')]({'raw':_0x2cd2d4[_0xbe9b('0x15')]?_0x2cd2d4[_0xbe9b('0x15')][_0xbe9b('0x16')]===undefined?!![]:![]:!![],'where':_0x2cd2d4['options']?_0x2cd2d4[_0xbe9b('0x15')][_0xbe9b('0x1e')]||null:null,'attributes':_0x2cd2d4[_0xbe9b('0x15')]?_0x2cd2d4[_0xbe9b('0x15')][_0xbe9b('0x1b')]||null:null,'include':_0x2cd2d4['options']?_0x2cd2d4['options']['include']?_[_0xbe9b('0x19')](_0x2cd2d4[_0xbe9b('0x15')][_0xbe9b('0x18')],function(_0xd4af0b){return{'model':db[_0xd4af0b[_0xbe9b('0x1a')]],'as':_0xd4af0b['as'],'attributes':_0xd4af0b['attributes'],'include':_0xd4af0b[_0xbe9b('0x18')]?_[_0xbe9b('0x19')](_0xd4af0b[_0xbe9b('0x18')],function(_0x554759){return{'model':db[_0x554759[_0xbe9b('0x1a')]],'as':_0x554759['as'],'attributes':_0x554759[_0xbe9b('0x1b')],'include':_0x554759['include']?_[_0xbe9b('0x19')](_0x554759['include'],function(_0x479493){return{'model':db[_0x479493[_0xbe9b('0x1a')]],'as':_0x479493['as'],'attributes':_0x479493[_0xbe9b('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xebdb0c){logger['info'](_0xbe9b('0x1f'),_0x2cd2d4);logger[_0xbe9b('0xe')](_0xbe9b('0x1f'),_0x2cd2d4,JSON['stringify'](_0xebdb0c));_0x260a1d(_0xebdb0c);})['catch'](function(_0x1e811d){logger[_0xbe9b('0x11')](_0xbe9b('0x1f'),_0x1e811d[_0xbe9b('0x12')],_0x2cd2d4);_0x56ea15(_0x4d8571[_0xbe9b('0x11')](0x1f4,_0x1e811d[_0xbe9b('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index ef4c45c..4305040 100644 --- a/server/api/trunk/index.js +++ b/server/api/trunk/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x396e=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./trunk.controller','get','isAuthenticated','index','/:id','show','post','/:id/clone','clone','create','put','update','delete'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0x396e,0x172));var _0xe396=function(_0x314726,_0x2391b7){_0x314726=_0x314726-0x0;var _0x25553f=_0x396e[_0x314726];return _0x25553f;};'use strict';var multer=require(_0xe396('0x0'));var util=require(_0xe396('0x1'));var path=require(_0xe396('0x2'));var timeout=require(_0xe396('0x3'));var express=require('express');var router=express[_0xe396('0x4')]();var fs_extra=require(_0xe396('0x5'));var auth=require(_0xe396('0x6'));var interaction=require(_0xe396('0x7'));var config=require('../../config/environment');var controller=require(_0xe396('0x8'));router[_0xe396('0x9')]('/',auth[_0xe396('0xa')](),controller[_0xe396('0xb')]);router[_0xe396('0x9')](_0xe396('0xc'),auth[_0xe396('0xa')](),controller[_0xe396('0xd')]);router[_0xe396('0xe')](_0xe396('0xf'),auth[_0xe396('0xa')](),controller[_0xe396('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe396('0x11')]);router[_0xe396('0x12')](_0xe396('0xc'),auth['isAuthenticated'](),controller[_0xe396('0x13')]);router[_0xe396('0x14')](_0xe396('0xc'),auth[_0xe396('0xa')](),controller[_0xe396('0x15')]);module[_0xe396('0x16')]=router; \ No newline at end of file +var _0x25c8=['isAuthenticated','get','/:id','show','/:id/clone','clone','post','put','update','delete','exports','util','path','connect-timeout','express','Router','../../config/environment','./trunk.controller'];(function(_0x485021,_0x431e05){var _0x185b22=function(_0x21b333){while(--_0x21b333){_0x485021['push'](_0x485021['shift']());}};_0x185b22(++_0x431e05);}(_0x25c8,0x13d));var _0x825c=function(_0x504226,_0x354762){_0x504226=_0x504226-0x0;var _0x252c4e=_0x25c8[_0x504226];return _0x252c4e;};'use strict';var multer=require('multer');var util=require(_0x825c('0x0'));var path=require(_0x825c('0x1'));var timeout=require(_0x825c('0x2'));var express=require(_0x825c('0x3'));var router=express[_0x825c('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x825c('0x5'));var controller=require(_0x825c('0x6'));router['get']('/',auth[_0x825c('0x7')](),controller['index']);router[_0x825c('0x8')](_0x825c('0x9'),auth[_0x825c('0x7')](),controller[_0x825c('0xa')]);router['post'](_0x825c('0xb'),auth[_0x825c('0x7')](),controller[_0x825c('0xc')]);router[_0x825c('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x825c('0xe')](_0x825c('0x9'),auth[_0x825c('0x7')](),controller[_0x825c('0xf')]);router[_0x825c('0x10')](_0x825c('0x9'),auth[_0x825c('0x7')](),controller['destroy']);module[_0x825c('0x11')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 6cea2ab..b6c8b55 100644 --- a/server/api/trunk/trunk.attributes.js +++ b/server/api/trunk/trunk.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf033=['PROHIB_PASSED_SCREEN','PROHIB','udp','transport','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','setDataValue','nat','all','ulaw;alaw;gsm','allow','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','never','INTEGER','\x22\x22\x20<>','always','refuse','originate','uac','uas','pai','fingerprint','certificate','active','passive','update,nonat','exports','ENUM','friend','user','peer','STRING','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED'];(function(_0x429e1,_0x3dcc52){var _0x4d01b0=function(_0xd04ffe){while(--_0xd04ffe){_0x429e1['push'](_0x429e1['shift']());}};_0x4d01b0(++_0x3dcc52);}(_0xf033,0x1cd));var _0x3f03=function(_0x2b59e5,_0x104bf9){_0x2b59e5=_0x2b59e5-0x0;var _0x41aab2=_0xf033[_0x2b59e5];return _0x41aab2;};'use strict';var Sequelize=require('sequelize');module[_0x3f03('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x3f03('0x1')](_0x3f03('0x2'),_0x3f03('0x3'),_0x3f03('0x4')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x3f03('0x5')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN',_0x3f03('0x6'),_0x3f03('0x7'),_0x3f03('0x8'),_0x3f03('0x9'),'PROHIB_FAILED_SCREEN',_0x3f03('0xa'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x3f03('0x5')]},'secret':{'type':Sequelize[_0x3f03('0x5')]},'md5secret':{'type':Sequelize[_0x3f03('0x5')]},'remotesecret':{'type':Sequelize[_0x3f03('0x5')]},'transport':{'type':Sequelize[_0x3f03('0x5')],'defaultValue':_0x3f03('0xb'),'set':function(_0x38e3c6){this['setDataValue'](_0x3f03('0xc'),_0x38e3c6?_0x38e3c6['join'](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0x3f03('0xd')](_0x3f03('0xc'))[_0x3f03('0xe')](','):null;},'comment':_0x3f03('0xf')},'dtmfmode':{'type':Sequelize[_0x3f03('0x1')](_0x3f03('0x10'),_0x3f03('0x11'),_0x3f03('0x12'),_0x3f03('0x13'),'auto'),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x3f03('0x1')](_0x3f03('0x14'),'no',_0x3f03('0x15'),_0x3f03('0x16'),_0x3f03('0x17')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x3f03('0x1')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x3f03('0x5')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x3f03('0x18'),'set':function(_0x3483c6){this[_0x3f03('0x19')](_0x3f03('0x1a'),_0x3483c6?_0x3483c6['join'](','):null);},'get':function(){return this[_0x3f03('0xd')]('nat')?this[_0x3f03('0xd')](_0x3f03('0x1a'))[_0x3f03('0xe')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x3f03('0x5')]},'namedcallgroup':{'type':Sequelize[_0x3f03('0x5')]},'pickupgroup':{'type':Sequelize[_0x3f03('0x5')]},'namedpickupgroup':{'type':Sequelize[_0x3f03('0x5')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x3f03('0x5')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x3f03('0x5')],'defaultValue':_0x3f03('0x1b')},'allow':{'type':Sequelize[_0x3f03('0x5')],'allowNull':![],'defaultValue':_0x3f03('0x1c'),'set':function(_0x2ed0da){this[_0x3f03('0x19')](_0x3f03('0x1d'),_0x2ed0da?_0x2ed0da[_0x3f03('0x1e')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x3f03('0xd')]('allow')?this[_0x3f03('0xd')](_0x3f03('0x1d'))[_0x3f03('0xe')](';'):null;},'comment':_0x3f03('0x1f')},'autoframing':{'type':Sequelize[_0x3f03('0x1')]('yes','no')},'insecure':{'type':Sequelize[_0x3f03('0x5')],'defaultValue':'port,invite','set':function(_0x3ec896){this[_0x3f03('0x19')](_0x3f03('0x20'),_0x3ec896?_0x3ec896[_0x3f03('0x1e')](','):null);},'get':function(){return this[_0x3f03('0xd')](_0x3f03('0x20'))?this[_0x3f03('0xd')](_0x3f03('0x20'))[_0x3f03('0xe')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x3f03('0x1')](_0x3f03('0x14'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x3f03('0x14'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x3f03('0x1')]('yes','no',_0x3f03('0x21'))},'promiscredir':{'type':Sequelize[_0x3f03('0x1')]('yes','no')},'useclientcode':{'type':Sequelize['ENUM']('yes','no')},'accountcode':{'type':Sequelize[_0x3f03('0x22')](0xb)},'setvar':{'type':Sequelize[_0x3f03('0x5')]},'callerid':{'type':Sequelize[_0x3f03('0x5')],'defaultValue':_0x3f03('0x23')},'amaflags':{'type':Sequelize[_0x3f03('0x5')]},'callcounter':{'type':Sequelize['ENUM'](_0x3f03('0x14'),'no'),'defaultValue':_0x3f03('0x14')},'busylevel':{'type':Sequelize[_0x3f03('0x22')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x3f03('0x14'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x3f03('0x14'),'no')},'allowtransfer':{'type':Sequelize[_0x3f03('0x1')](_0x3f03('0x14'),'no')},'ignoresdpversion':{'type':Sequelize[_0x3f03('0x1')](_0x3f03('0x14'),'no')},'subscribecontext':{'type':Sequelize[_0x3f03('0x5')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x3f03('0x1')](_0x3f03('0x14'),'no',_0x3f03('0x24')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x3f03('0x22')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x3f03('0x1')](_0x3f03('0x14'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0x3f03('0x1')]('accept',_0x3f03('0x25'),_0x3f03('0x26'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x3f03('0x22')](0xb)},'session_refresher':{'type':Sequelize[_0x3f03('0x1')](_0x3f03('0x27'),_0x3f03('0x28')),'defaultValue':_0x3f03('0x28')},'t38pt_usertpsource':{'type':Sequelize[_0x3f03('0x5')]},'regexten':{'type':Sequelize[_0x3f03('0x5')]},'fromdomain':{'type':Sequelize[_0x3f03('0x5')]},'fromuser':{'type':Sequelize[_0x3f03('0x5')]},'port':{'type':Sequelize[_0x3f03('0x22')](0x5)},'qualify':{'type':Sequelize[_0x3f03('0x1')](_0x3f03('0x14'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x3f03('0x22')](0xb)},'defaultip':{'type':Sequelize[_0x3f03('0x5')]},'defaultuser':{'type':Sequelize[_0x3f03('0x5')]},'rtptimeout':{'type':Sequelize[_0x3f03('0x22')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x3f03('0x22')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x3f03('0x1')](_0x3f03('0x14'),'no',_0x3f03('0x29')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0x3f03('0x5')]},'timert1':{'type':Sequelize[_0x3f03('0x22')](0xb)},'timerb':{'type':Sequelize[_0x3f03('0x22')](0xb)},'qualifyfreq':{'type':Sequelize[_0x3f03('0x22')](0xb)},'contactpermit':{'type':Sequelize[_0x3f03('0x5')]},'contactdeny':{'type':Sequelize[_0x3f03('0x5')]},'contactacl':{'type':Sequelize[_0x3f03('0x5')]},'unsolicited_mailbox':{'type':Sequelize[_0x3f03('0x5')]},'use_q850_reason':{'type':Sequelize[_0x3f03('0x5')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize['ENUM'](_0x3f03('0x14'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x3f03('0x1')](_0x3f03('0x14'),'no')},'force_avp':{'type':Sequelize[_0x3f03('0x1')]('yes','no')},'icesupport':{'type':Sequelize[_0x3f03('0x1')](_0x3f03('0x14'),'no')},'dtlsenable':{'type':Sequelize[_0x3f03('0x1')](_0x3f03('0x14'),'no')},'dtlsverify':{'type':Sequelize[_0x3f03('0x1')](_0x3f03('0x14'),'no',_0x3f03('0x2a'),_0x3f03('0x2b'))},'dtlsrekey':{'type':Sequelize[_0x3f03('0x22')](0xb)},'dtlscertfile':{'type':Sequelize[_0x3f03('0x5')]},'dtlsprivatekey':{'type':Sequelize[_0x3f03('0x5')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x3f03('0x5')]},'dtlscapath':{'type':Sequelize[_0x3f03('0x5')]},'dtlssetup':{'type':Sequelize[_0x3f03('0x1')](_0x3f03('0x2c'),_0x3f03('0x2d'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0x3f03('0x1')](_0x3f03('0x14'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x3f03('0x22')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x3f03('0x1')]('yes','no')},'subscribemwi':{'type':Sequelize[_0x3f03('0x1')]('yes','no')},'vmexten':{'type':Sequelize[_0x3f03('0x5')]},'mohinterpret':{'type':Sequelize[_0x3f03('0x5')]},'mohsuggest':{'type':Sequelize[_0x3f03('0x5')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3f03('0x5')]},'host':{'type':Sequelize[_0x3f03('0x5')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x3f03('0x1')](_0x3f03('0x14'),'no',_0x3f03('0x15'),_0x3f03('0x16'),_0x3f03('0x2e')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x3f03('0x5')]},'otherFields':{'type':Sequelize[_0x3f03('0x5')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x3f03('0x5')],'defaultValue':'no'}}; \ No newline at end of file +var _0x95cc=['nonat','update','outgoing','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','setDataValue','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','\x22\x22\x20<>','INTEGER','always','accept','refuse','originate','uas','pai','fingerprint','certificate','active','passive','actpass','dynamic','update,nonat','exports','STRING','name','ENUM','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes'];(function(_0x21be67,_0x26afd5){var _0x5c7ccc=function(_0x559005){while(--_0x559005){_0x21be67['push'](_0x21be67['shift']());}};_0x5c7ccc(++_0x26afd5);}(_0x95cc,0x1b4));var _0xc95c=function(_0x2475fb,_0x238ba5){_0x2475fb=_0x2475fb-0x0;var _0x5a879a=_0x95cc[_0x2475fb];return _0x5a879a;};'use strict';var Sequelize=require('sequelize');module[_0xc95c('0x0')]={'name':{'type':Sequelize[_0xc95c('0x1')],'allowNull':![],'unique':_0xc95c('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xc95c('0x3')]('friend','user',_0xc95c('0x4')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xc95c('0x1')],'allowNull':![],'defaultValue':_0xc95c('0x5')},'callingpres':{'type':Sequelize[_0xc95c('0x3')](_0xc95c('0x6'),_0xc95c('0x7'),_0xc95c('0x8'),_0xc95c('0x9'),'PROHIB_NOT_SCREENED',_0xc95c('0xa'),_0xc95c('0xb'),_0xc95c('0xc'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0xc95c('0x1')]},'secret':{'type':Sequelize[_0xc95c('0x1')]},'md5secret':{'type':Sequelize[_0xc95c('0x1')]},'remotesecret':{'type':Sequelize[_0xc95c('0x1')]},'transport':{'type':Sequelize[_0xc95c('0x1')],'defaultValue':'udp','set':function(_0x11b322){this['setDataValue'](_0xc95c('0xd'),_0x11b322?_0x11b322[_0xc95c('0xe')](','):null);},'get':function(){return this[_0xc95c('0xf')](_0xc95c('0xd'))?this['getDataValue'](_0xc95c('0xd'))['split'](','):null;},'comment':_0xc95c('0x10')},'dtmfmode':{'type':Sequelize[_0xc95c('0x3')](_0xc95c('0x11'),_0xc95c('0x12'),_0xc95c('0x13'),_0xc95c('0x14'),_0xc95c('0x15')),'defaultValue':_0xc95c('0x11')},'directmedia':{'type':Sequelize[_0xc95c('0x3')](_0xc95c('0x16'),'no',_0xc95c('0x17'),_0xc95c('0x18'),_0xc95c('0x19')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xc95c('0x3')](_0xc95c('0x16'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xc95c('0x1')]},'directmediadeny':{'type':Sequelize[_0xc95c('0x1')]},'nat':{'type':Sequelize[_0xc95c('0x1')],'defaultValue':'force_rport,comedia','set':function(_0x123914){this['setDataValue'](_0xc95c('0x1a'),_0x123914?_0x123914['join'](','):null);},'get':function(){return this[_0xc95c('0xf')](_0xc95c('0x1a'))?this[_0xc95c('0xf')](_0xc95c('0x1a'))[_0xc95c('0x1b')](','):null;},'comment':_0xc95c('0x1c')},'callgroup':{'type':Sequelize[_0xc95c('0x1')]},'namedcallgroup':{'type':Sequelize[_0xc95c('0x1')]},'pickupgroup':{'type':Sequelize[_0xc95c('0x1')]},'namedpickupgroup':{'type':Sequelize[_0xc95c('0x1')]},'language':{'type':Sequelize[_0xc95c('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xc95c('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xc95c('0x1')],'defaultValue':_0xc95c('0x1d')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x566370){this[_0xc95c('0x1e')]('allow',_0x566370?_0x566370[_0xc95c('0xe')](';'):_0xc95c('0x1f'));},'get':function(){return this[_0xc95c('0xf')](_0xc95c('0x20'))?this[_0xc95c('0xf')]('allow')[_0xc95c('0x1b')](';'):null;},'comment':_0xc95c('0x21')},'autoframing':{'type':Sequelize[_0xc95c('0x3')]('yes','no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0xc95c('0x22'),'set':function(_0x30f2b9){this[_0xc95c('0x1e')]('insecure',_0x30f2b9?_0x30f2b9[_0xc95c('0xe')](','):null);},'get':function(){return this[_0xc95c('0xf')]('insecure')?this[_0xc95c('0xf')](_0xc95c('0x23'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xc95c('0x3')](_0xc95c('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xc95c('0x16'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xc95c('0x3')](_0xc95c('0x16'),'no','never')},'promiscredir':{'type':Sequelize[_0xc95c('0x3')](_0xc95c('0x16'),'no')},'useclientcode':{'type':Sequelize[_0xc95c('0x3')](_0xc95c('0x16'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0xc95c('0x1')]},'callerid':{'type':Sequelize[_0xc95c('0x1')],'defaultValue':_0xc95c('0x24')},'amaflags':{'type':Sequelize[_0xc95c('0x1')]},'callcounter':{'type':Sequelize[_0xc95c('0x3')]('yes','no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xc95c('0x25')](0xb)},'allowoverlap':{'type':Sequelize[_0xc95c('0x3')](_0xc95c('0x16'),'no')},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no')},'allowtransfer':{'type':Sequelize['ENUM'](_0xc95c('0x16'),'no')},'ignoresdpversion':{'type':Sequelize[_0xc95c('0x3')](_0xc95c('0x16'),'no')},'subscribecontext':{'type':Sequelize[_0xc95c('0x1')]},'template':{'type':Sequelize[_0xc95c('0x1')]},'videosupport':{'type':Sequelize[_0xc95c('0x3')](_0xc95c('0x16'),'no',_0xc95c('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xc95c('0x25')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xc95c('0x3')]('yes','no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize['ENUM'](_0xc95c('0x27'),_0xc95c('0x28'),_0xc95c('0x29'))},'session_expires':{'type':Sequelize[_0xc95c('0x25')](0xb)},'session_minse':{'type':Sequelize[_0xc95c('0x25')](0xb)},'session_refresher':{'type':Sequelize[_0xc95c('0x3')]('uac',_0xc95c('0x2a')),'defaultValue':_0xc95c('0x2a')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0xc95c('0x1')]},'fromdomain':{'type':Sequelize[_0xc95c('0x1')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xc95c('0x16')},'keepalive':{'type':Sequelize[_0xc95c('0x25')](0xb)},'defaultip':{'type':Sequelize[_0xc95c('0x1')]},'defaultuser':{'type':Sequelize[_0xc95c('0x1')]},'rtptimeout':{'type':Sequelize[_0xc95c('0x25')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xc95c('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xc95c('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0xc95c('0x3')](_0xc95c('0x16'),'no',_0xc95c('0x2b')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xc95c('0x1')]},'callbackextension':{'type':Sequelize[_0xc95c('0x1')]},'timert1':{'type':Sequelize[_0xc95c('0x25')](0xb)},'timerb':{'type':Sequelize[_0xc95c('0x25')](0xb)},'qualifyfreq':{'type':Sequelize[_0xc95c('0x25')](0xb)},'contactpermit':{'type':Sequelize[_0xc95c('0x1')]},'contactdeny':{'type':Sequelize[_0xc95c('0x1')]},'contactacl':{'type':Sequelize[_0xc95c('0x1')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0xc95c('0x3')](_0xc95c('0x16'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xc95c('0x3')](_0xc95c('0x16'),'no')},'force_avp':{'type':Sequelize[_0xc95c('0x3')](_0xc95c('0x16'),'no')},'icesupport':{'type':Sequelize[_0xc95c('0x3')](_0xc95c('0x16'),'no')},'dtlsenable':{'type':Sequelize[_0xc95c('0x3')](_0xc95c('0x16'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0xc95c('0x16'),'no',_0xc95c('0x2c'),_0xc95c('0x2d'))},'dtlsrekey':{'type':Sequelize[_0xc95c('0x25')](0xb)},'dtlscertfile':{'type':Sequelize[_0xc95c('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0xc95c('0x1')]},'dtlscipher':{'type':Sequelize[_0xc95c('0x1')]},'dtlscafile':{'type':Sequelize[_0xc95c('0x1')]},'dtlscapath':{'type':Sequelize[_0xc95c('0x1')]},'dtlssetup':{'type':Sequelize[_0xc95c('0x3')](_0xc95c('0x2e'),_0xc95c('0x2f'),_0xc95c('0x30')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xc95c('0x1')]},'usereqphone':{'type':Sequelize['ENUM'](_0xc95c('0x16'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xc95c('0x1')]},'recordofffeature':{'type':Sequelize[_0xc95c('0x1')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xc95c('0x3')](_0xc95c('0x16'),'no')},'subscribemwi':{'type':Sequelize[_0xc95c('0x3')](_0xc95c('0x16'),'no')},'vmexten':{'type':Sequelize[_0xc95c('0x1')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc95c('0x1')]},'host':{'type':Sequelize[_0xc95c('0x1')],'defaultValue':_0xc95c('0x31')},'canreinvite':{'type':Sequelize[_0xc95c('0x3')](_0xc95c('0x16'),'no',_0xc95c('0x17'),'update',_0xc95c('0x32')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xc95c('0x1')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index 3339a45..cb89b8b 100644 --- a/server/api/trunk/trunk.controller.js +++ b/server/api/trunk/trunk.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x84ab=['../../mysqldb','client','http','request','then','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','get','Trunks','UserProfileResource','destroy','stack','name','index','map','rawAttributes','fieldName','type','query','keys','intersection','fields','attributes','length','model','order','sort','where','filters','pick','merge','filter','options','Trunk','count','includeAll','rows','params','include','find','createdAt','updatedAt','body','omit','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findAll','readFileSync','utf8','join','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','userProfileId','autoAssociation','root','chan_sip.so','server/files/templates/trunk.ejs','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x5bf3c8,_0x5c268b){var _0xf2a998=function(_0x24243d){while(--_0x24243d){_0x5bf3c8['push'](_0x5bf3c8['shift']());}};_0xf2a998(++_0x5c268b);}(_0x84ab,0x12f));var _0xb84a=function(_0x3bef2c,_0x5a86fd){_0x3bef2c=_0x3bef2c-0x0;var _0x331503=_0x84ab[_0x3bef2c];return _0x331503;};'use strict';var emlformat=require(_0xb84a('0x0'));var rimraf=require(_0xb84a('0x1'));var zipdir=require(_0xb84a('0x2'));var jsonpatch=require(_0xb84a('0x3'));var rp=require(_0xb84a('0x4'));var moment=require('moment');var BPromise=require(_0xb84a('0x5'));var Mustache=require(_0xb84a('0x6'));var util=require('util');var path=require(_0xb84a('0x7'));var sox=require(_0xb84a('0x8'));var csv=require(_0xb84a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb84a('0xa'));var crypto=require('crypto');var jsforce=require(_0xb84a('0xb'));var deskjs=require(_0xb84a('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb84a('0xd'));var Papa=require('papaparse');var Redis=require(_0xb84a('0xe'));var authService=require(_0xb84a('0xf'));var qs=require(_0xb84a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb84a('0x11'));var utils=require(_0xb84a('0x12'));var config=require(_0xb84a('0x13'));var licenseUtil=require(_0xb84a('0x14'));var db=require(_0xb84a('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xb84a('0x16')][_0xb84a('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x39a0df,_0x3c161c,_0x44b26b,_0x11dfe9){return new BPromise(function(_0x12ccab,_0x475b){var _0x3113a2=_0x11dfe9||client;return _0x3113a2[_0xb84a('0x18')](_0x39a0df,_0x44b26b)[_0xb84a('0x19')](function(_0x1251ec){logger['info'](_0xb84a('0x1a'),_0x3c161c,_0xb84a('0x1b'));logger[_0xb84a('0x1c')](_0xb84a('0x1d'),_0x3c161c,_0xb84a('0x1b'),JSON[_0xb84a('0x1e')](_0x1251ec));if(_0x1251ec[_0xb84a('0x1f')]){if(_0x1251ec[_0xb84a('0x1f')][_0xb84a('0x20')]===0x1f4){logger[_0xb84a('0x1f')](_0xb84a('0x1a'),_0x3c161c,_0x1251ec[_0xb84a('0x1f')][_0xb84a('0x21')]);return _0x475b(_0x1251ec[_0xb84a('0x1f')]['message']);}logger[_0xb84a('0x1f')](_0xb84a('0x1a'),_0x3c161c,_0x1251ec['error'][_0xb84a('0x21')]);return _0x12ccab(_0x1251ec[_0xb84a('0x1f')][_0xb84a('0x21')]);}else{logger[_0xb84a('0x22')]('Trunk,\x20%s,\x20%s',_0x3c161c,'request\x20sent');_0x12ccab(_0x1251ec[_0xb84a('0x23')][_0xb84a('0x21')]);}})[_0xb84a('0x24')](function(_0x259f74){logger[_0xb84a('0x1f')](_0xb84a('0x1a'),_0x3c161c,_0x259f74);_0x475b(_0x259f74);});});}function respondWithStatusCode(_0x8b28cd,_0x21d0d3){_0x21d0d3=_0x21d0d3||0xcc;return function(_0x3aa06f){if(_0x3aa06f){return _0x8b28cd[_0xb84a('0x25')](_0x21d0d3);}return _0x8b28cd[_0xb84a('0x26')](_0x21d0d3)[_0xb84a('0x27')]();};}function respondWithResult(_0x218aef,_0x409df0){_0x409df0=_0x409df0||0xc8;return function(_0x19bdfa){if(_0x19bdfa){return _0x218aef[_0xb84a('0x26')](_0x409df0)[_0xb84a('0x28')](_0x19bdfa);}};}function respondWithFilteredResult(_0x3ff0bc,_0x3b6805){return function(_0xd468c3){if(_0xd468c3){var _0x33bf1d=typeof _0x3b6805[_0xb84a('0x29')]===_0xb84a('0x2a')&&typeof _0x3b6805[_0xb84a('0x2b')]===_0xb84a('0x2a');var _0x97d71b=_0xd468c3['count'];var _0x582954=_0x33bf1d?0x0:_0x3b6805[_0xb84a('0x29')];var _0x2c30b0=_0x33bf1d?_0xd468c3['count']:_0x3b6805[_0xb84a('0x29')]+_0x3b6805[_0xb84a('0x2b')];var _0x52c23c;if(_0x2c30b0>=_0x97d71b){_0x2c30b0=_0x97d71b;_0x52c23c=0xc8;}else{_0x52c23c=0xce;}_0x3ff0bc['status'](_0x52c23c);return _0x3ff0bc[_0xb84a('0x2c')](_0xb84a('0x2d'),_0x582954+'-'+_0x2c30b0+'/'+_0x97d71b)['json'](_0xd468c3);}return null;};}function patchUpdates(_0x251778){return function(_0xba1147){try{jsonpatch[_0xb84a('0x2e')](_0xba1147,_0x251778,!![]);}catch(_0x44a405){return BPromise[_0xb84a('0x2f')](_0x44a405);}return _0xba1147[_0xb84a('0x30')]();};}function saveUpdates(_0x34b212,_0xac214f){return function(_0x54ec50){if(_0x54ec50){return _0x54ec50[_0xb84a('0x31')](_0x34b212)['then'](function(_0x4bca85){return _0x4bca85;});}return null;};}function removeEntity(_0x2eea7e,_0x3b4515){return function(_0x47a5b6){if(_0x47a5b6){return _0x47a5b6['destroy']()[_0xb84a('0x19')](function(){var _0x13c167=_0x47a5b6[_0xb84a('0x32')]({'plain':!![]});var _0x308240=_0xb84a('0x33');return db[_0xb84a('0x34')][_0xb84a('0x35')]({'where':{'type':_0x308240,'resourceId':_0x13c167['id']}})[_0xb84a('0x19')](function(){return _0x47a5b6;});})['then'](function(){_0x2eea7e[_0xb84a('0x26')](0xcc)[_0xb84a('0x27')]();});}};}function handleEntityNotFound(_0x10b944,_0xf894a6){return function(_0x36aa07){if(!_0x36aa07){_0x10b944[_0xb84a('0x25')](0x194);}return _0x36aa07;};}function handleError(_0x2a5130,_0x5aa2ae){_0x5aa2ae=_0x5aa2ae||0x1f4;return function(_0x30d22d){logger['error'](_0x30d22d[_0xb84a('0x36')]);if(_0x30d22d[_0xb84a('0x37')]){delete _0x30d22d[_0xb84a('0x37')];}_0x2a5130['status'](_0x5aa2ae)['send'](_0x30d22d);};}exports[_0xb84a('0x38')]=function(_0x75e6e6,_0x4a3737){var _0x2d3e08={},_0xab76ce={},_0x4cb5d4={'count':0x0,'rows':[]};var _0x19aa4c=_[_0xb84a('0x39')](db['Trunk'][_0xb84a('0x3a')],function(_0xe6f19e){return{'name':_0xe6f19e[_0xb84a('0x3b')],'type':_0xe6f19e[_0xb84a('0x3c')]['key']};});_0xab76ce['model']=_['map'](_0x19aa4c,_0xb84a('0x37'));_0xab76ce[_0xb84a('0x3d')]=_[_0xb84a('0x3e')](_0x75e6e6[_0xb84a('0x3d')]);_0xab76ce['filters']=_[_0xb84a('0x3f')](_0xab76ce['model'],_0xab76ce[_0xb84a('0x3d')]);_0x2d3e08['attributes']=_['intersection'](_0xab76ce['model'],qs[_0xb84a('0x40')](_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x40')]));_0x2d3e08[_0xb84a('0x41')]=_0x2d3e08['attributes'][_0xb84a('0x42')]?_0x2d3e08[_0xb84a('0x41')]:_0xab76ce[_0xb84a('0x43')];if(!_0x75e6e6[_0xb84a('0x3d')]['hasOwnProperty']('nolimit')){_0x2d3e08[_0xb84a('0x2b')]=qs[_0xb84a('0x2b')](_0x75e6e6['query'][_0xb84a('0x2b')]);_0x2d3e08[_0xb84a('0x29')]=qs[_0xb84a('0x29')](_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x29')]);}_0x2d3e08[_0xb84a('0x44')]=qs[_0xb84a('0x45')](_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x45')]);_0x2d3e08[_0xb84a('0x46')]=qs[_0xb84a('0x47')](_[_0xb84a('0x48')](_0x75e6e6[_0xb84a('0x3d')],_0xab76ce[_0xb84a('0x47')]),_0x19aa4c);if(_0x75e6e6[_0xb84a('0x3d')]['filter']){_0x2d3e08[_0xb84a('0x46')]=_[_0xb84a('0x49')](_0x2d3e08[_0xb84a('0x46')],{'$or':_[_0xb84a('0x39')](_0x19aa4c,function(_0x37f4fe){if(_0x37f4fe[_0xb84a('0x3c')]!=='VIRTUAL'){var _0xfd2927={};_0xfd2927[_0x37f4fe['name']]={'$like':'%'+_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x4a')]+'%'};return _0xfd2927;}})});}_0x2d3e08=_[_0xb84a('0x49')]({},_0x2d3e08,_0x75e6e6[_0xb84a('0x4b')]);var _0x5e7327={'where':_0x2d3e08[_0xb84a('0x46')]};return db[_0xb84a('0x4c')][_0xb84a('0x4d')](_0x5e7327)['then'](function(_0x55f39f){_0x4cb5d4[_0xb84a('0x4d')]=_0x55f39f;if(_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x4e')]){_0x2d3e08['include']=[{'all':!![]}];}return db['Trunk']['findAll'](_0x2d3e08);})[_0xb84a('0x19')](function(_0x384a0d){_0x4cb5d4[_0xb84a('0x4f')]=_0x384a0d;return _0x4cb5d4;})[_0xb84a('0x19')](respondWithFilteredResult(_0x4a3737,_0x2d3e08))[_0xb84a('0x24')](handleError(_0x4a3737,null));};exports['show']=function(_0x4b40fe,_0x5b853a){var _0x53d4d6={'raw':![],'where':{'id':_0x4b40fe[_0xb84a('0x50')]['id']}},_0x421ba0={};_0x421ba0['model']=_[_0xb84a('0x3e')](db[_0xb84a('0x4c')][_0xb84a('0x3a')]);_0x421ba0[_0xb84a('0x3d')]=_[_0xb84a('0x3e')](_0x4b40fe[_0xb84a('0x3d')]);_0x421ba0['filters']=_['intersection'](_0x421ba0[_0xb84a('0x43')],_0x421ba0['query']);_0x53d4d6[_0xb84a('0x41')]=_['intersection'](_0x421ba0['model'],qs['fields'](_0x4b40fe[_0xb84a('0x3d')][_0xb84a('0x40')]));_0x53d4d6[_0xb84a('0x41')]=_0x53d4d6[_0xb84a('0x41')][_0xb84a('0x42')]?_0x53d4d6[_0xb84a('0x41')]:_0x421ba0[_0xb84a('0x43')];if(_0x4b40fe[_0xb84a('0x3d')]['includeAll']){_0x53d4d6['include']=[{'all':!![]}];}_0x53d4d6=_['merge']({},_0x53d4d6,_0x4b40fe[_0xb84a('0x4b')]);return db[_0xb84a('0x4c')]['find'](_0x53d4d6)[_0xb84a('0x19')](handleEntityNotFound(_0x5b853a,null))['then'](respondWithResult(_0x5b853a,null))['catch'](handleError(_0x5b853a,null));};exports['clone']=function(_0x419e27,_0x172076){var _0x49a0e2={'where':{'id':_0x419e27[_0xb84a('0x50')]['id']}},_0x51c415={};_0x51c415[_0xb84a('0x43')]=_[_0xb84a('0x3e')](db['Trunk'][_0xb84a('0x3a')]);_0x49a0e2['attributes']=_['intersection'](_0x51c415[_0xb84a('0x43')],qs['fields'](_0x419e27[_0xb84a('0x3d')]['fields']));_0x49a0e2[_0xb84a('0x41')]=_0x49a0e2[_0xb84a('0x41')][_0xb84a('0x42')]?_0x49a0e2[_0xb84a('0x41')]:_0x51c415['model'];if(_0x419e27['query']['includeAll']){_0x49a0e2[_0xb84a('0x51')]=[{'all':!![]}];}_0x49a0e2=_[_0xb84a('0x49')]({},_0x49a0e2,_0x419e27['options']);return db['Trunk'][_0xb84a('0x52')](_0x49a0e2)[_0xb84a('0x19')](handleEntityNotFound(_0x172076,null))[_0xb84a('0x19')](function(_0x5f415d){if(_0x5f415d){var _0x29f67f=_0x5f415d[_0xb84a('0x32')]({'plain':!![]});_0x29f67f=qs['omit'](_0x29f67f,['id',_0xb84a('0x53'),_0xb84a('0x54')]);_0x419e27[_0xb84a('0x55')]=_[_0xb84a('0x56')](_0x419e27[_0xb84a('0x55')],['id',_0xb84a('0x53'),_0xb84a('0x54')]);return db['Trunk'][_0xb84a('0x57')](_[_0xb84a('0x49')](_0x29f67f,_0x419e27['body']),{'include':_0x419e27[_0xb84a('0x3d')][_0xb84a('0x4e')]?[{'all':!![]}]:undefined})[_0xb84a('0x19')](function(_0x3e16d8){var _0x347998=_0x419e27[_0xb84a('0x58')][_0xb84a('0x32')]({'plain':!![]});if(!_0x347998)throw new Error(_0xb84a('0x59'));if(_0x347998[_0xb84a('0x5a')]==='user'){var _0x291008=_0x3e16d8['get']({'plain':!![]});var _0x5a2d44=_0xb84a('0x33');return db['UserProfileSection'][_0xb84a('0x52')]({'where':{'name':_0x5a2d44,'userProfileId':_0x347998['userProfileId']},'raw':!![]})[_0xb84a('0x19')](function(_0x44e508){if(_0x44e508&&_0x44e508['autoAssociation']===0x0){return db[_0xb84a('0x34')][_0xb84a('0x57')]({'name':_0x291008[_0xb84a('0x37')],'resourceId':_0x291008['id'],'type':_0x44e508[_0xb84a('0x37')],'sectionId':_0x44e508['id']},{})[_0xb84a('0x19')](function(){return _0x3e16d8;});}else{return _0x3e16d8;}})[_0xb84a('0x24')](function(_0x4514f0){logger['error'](_0xb84a('0x5b'),_0x4514f0);throw _0x4514f0;});}return _0x3e16d8;});}})['then'](respondWithResult(_0x172076,0xc9))['catch'](handleError(_0x172076,null));};exports[_0xb84a('0x57')]=function(_0x2a2dc0,_0x2ee241,_0x32a455){var _0x5612f3;return db['Trunk'][_0xb84a('0x57')](_0x2a2dc0[_0xb84a('0x55')],{'raw':!![]})[_0xb84a('0x19')](function(_0x1a2e1a){_0x5612f3=_0x1a2e1a;return db['Trunk'][_0xb84a('0x5c')]({'raw':!![]});})['then'](function(_0x1eec1f){var _0x57b784=fs[_0xb84a('0x5d')](path['join'](config['root'],'server/files/templates/trunk.ejs'),_0xb84a('0x5e'));var _0xf936f1=fs[_0xb84a('0x5d')](path[_0xb84a('0x5f')](config['root'],_0xb84a('0x60')),_0xb84a('0x5e'));var _0x33d416=ejs[_0xb84a('0x61')](_0x57b784,{'trunks':_0x1eec1f||[]});fs[_0xb84a('0x62')](_0xb84a('0x63'),_0x33d416);if(_0x5612f3[_0xb84a('0x64')]){var _0x542d70=ejs[_0xb84a('0x61')](_0xf936f1,{'trunks':_0x1eec1f||[]});fs[_0xb84a('0x62')](_0xb84a('0x65'),_0x542d70);}})[_0xb84a('0x19')](function(){return respondWithRpcPromise(_0xb84a('0x66'),_0xb84a('0x57'),{'module':'chan_sip.so'});})[_0xb84a('0x19')](function(){var _0x6f8f=_0x2a2dc0[_0xb84a('0x58')][_0xb84a('0x32')]({'plain':!![]});if(!_0x6f8f)throw new Error(_0xb84a('0x59'));if(_0x6f8f['role']===_0xb84a('0x58')){var _0x4b0b18=_0x5612f3[_0xb84a('0x32')]({'plain':!![]});return db['UserProfileSection'][_0xb84a('0x52')]({'where':{'name':_0xb84a('0x33'),'userProfileId':_0x6f8f[_0xb84a('0x67')]},'raw':!![]})['then'](function(_0x121fda){if(_0x121fda&&_0x121fda[_0xb84a('0x68')]===0x0){return db[_0xb84a('0x34')][_0xb84a('0x57')]({'name':_0x4b0b18[_0xb84a('0x37')],'resourceId':_0x4b0b18['id'],'type':_0x121fda['name'],'sectionId':_0x121fda['id']},{})[_0xb84a('0x19')](function(){return _0x5612f3;});}else{return _0x5612f3;}})[_0xb84a('0x24')](function(_0x287d25){logger['error'](_0xb84a('0x5b'),_0x287d25);throw _0x287d25;});}return _0x5612f3;})['then'](respondWithResult(_0x2ee241,0xc9))['catch'](handleError(_0x2ee241,null));};exports[_0xb84a('0x31')]=function(_0x35cb8b,_0x13c7b7,_0x3b2a2d){var _0x2047f5;return db[_0xb84a('0x4c')][_0xb84a('0x52')]({'where':{'id':_0x35cb8b[_0xb84a('0x50')]['id']}})[_0xb84a('0x19')](handleEntityNotFound(_0x13c7b7,null))[_0xb84a('0x19')](saveUpdates(_0x35cb8b[_0xb84a('0x55')],null))[_0xb84a('0x19')](function(_0x3ec1fb){if(_0x3ec1fb){_0x2047f5=_0x3ec1fb;return db[_0xb84a('0x4c')][_0xb84a('0x5c')]({'raw':!![]});}})[_0xb84a('0x19')](function(_0xb18756){if(_0xb18756){var _0x1169d1=fs['readFileSync'](path[_0xb84a('0x5f')](config[_0xb84a('0x69')],'server/files/templates/trunk.ejs'),_0xb84a('0x5e'));var _0x576df5=fs[_0xb84a('0x5d')](path['join'](config[_0xb84a('0x69')],'server/files/templates/registry.ejs'),'utf8');var _0xf3f253=ejs[_0xb84a('0x61')](_0x1169d1,{'trunks':_0xb18756||[]});fs['writeFileSync'](_0xb84a('0x63'),_0xf3f253);var _0xcf9bc2=ejs[_0xb84a('0x61')](_0x576df5,{'trunks':_0xb18756||[]});fs[_0xb84a('0x62')](_0xb84a('0x65'),_0xcf9bc2);return respondWithRpcPromise('Reload',_0xb84a('0x31'),{'module':_0xb84a('0x6a')});}return null;})[_0xb84a('0x19')](function(_0x30f7cd){if(_0x30f7cd){return _0x2047f5;}})['then'](respondWithResult(_0x13c7b7,null))[_0xb84a('0x24')](handleError(_0x13c7b7,null));};exports['destroy']=function(_0x14118c,_0x12d796,_0x54ae3e){var _0xf6765a;return db[_0xb84a('0x4c')][_0xb84a('0x52')]({'where':{'id':_0x14118c['params']['id']}})['then'](handleEntityNotFound(_0x12d796,null))[_0xb84a('0x19')](removeEntity(_0x12d796,null))[_0xb84a('0x19')](function(){return db['Trunk'][_0xb84a('0x5c')]({'raw':!![]});})['then'](function(_0x166d75){var _0x54161c=fs['readFileSync'](path[_0xb84a('0x5f')](config[_0xb84a('0x69')],_0xb84a('0x6b')),_0xb84a('0x5e'));var _0x403a3e=fs['readFileSync'](path['join'](config[_0xb84a('0x69')],_0xb84a('0x60')),'utf8');var _0x305b67=ejs[_0xb84a('0x61')](_0x54161c,{'trunks':_0x166d75});var _0x385a05=ejs[_0xb84a('0x61')](_0x403a3e,{'trunks':_0x166d75});fs['writeFileSync'](_0xb84a('0x63'),_0x305b67);fs['writeFileSync'](_0xb84a('0x65'),_0x385a05);return respondWithRpcPromise(_0xb84a('0x66'),_0xb84a('0x35'),{'module':_0xb84a('0x6a')});})[_0xb84a('0x24')](handleError(_0x12d796,null));}; \ No newline at end of file +var _0x9bde=['fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','request','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','get','Trunks','UserProfileResource','destroy','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','offset','order','sort','where','pick','filter','VIRTUAL','merge','Trunk','includeAll','findAll','rows','show','params','fields','include','options','clone','find','omit','createdAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','server/files/templates/registry.ejs','utf8','render','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','root','server/files/templates/trunk.ejs','writeFileSync','rimraf'];(function(_0x40ea21,_0xe55b66){var _0x555e46=function(_0x5e73fc){while(--_0x5e73fc){_0x40ea21['push'](_0x40ea21['shift']());}};_0x555e46(++_0xe55b66);}(_0x9bde,0xe1));var _0xe9bd=function(_0x3315ec,_0x4b02bf){_0x3315ec=_0x3315ec-0x0;var _0x37d4c3=_0x9bde[_0x3315ec];return _0x37d4c3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe9bd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe9bd('0x1'));var rp=require('request-promise');var moment=require(_0xe9bd('0x2'));var BPromise=require(_0xe9bd('0x3'));var Mustache=require(_0xe9bd('0x4'));var util=require(_0xe9bd('0x5'));var path=require(_0xe9bd('0x6'));var sox=require(_0xe9bd('0x7'));var csv=require(_0xe9bd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe9bd('0x9'));var _=require(_0xe9bd('0xa'));var squel=require(_0xe9bd('0xb'));var crypto=require(_0xe9bd('0xc'));var jsforce=require(_0xe9bd('0xd'));var deskjs=require(_0xe9bd('0xe'));var toCsv=require(_0xe9bd('0x8'));var querystring=require(_0xe9bd('0xf'));var Papa=require(_0xe9bd('0x10'));var Redis=require(_0xe9bd('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe9bd('0x12'));var hardwareService=require(_0xe9bd('0x13'));var logger=require(_0xe9bd('0x14'))('api');var utils=require(_0xe9bd('0x15'));var config=require(_0xe9bd('0x16'));var licenseUtil=require(_0xe9bd('0x17'));var db=require(_0xe9bd('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xe9bd('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x220d07,_0x429e88,_0x3435b4,_0x51109f){return new BPromise(function(_0x47ba5e,_0x46a95e){var _0x248818=_0x51109f||client;return _0x248818[_0xe9bd('0x1a')](_0x220d07,_0x3435b4)[_0xe9bd('0x1b')](function(_0x3360bd){logger[_0xe9bd('0x1c')](_0xe9bd('0x1d'),_0x429e88,'request\x20sent');logger[_0xe9bd('0x1e')](_0xe9bd('0x1f'),_0x429e88,_0xe9bd('0x20'),JSON['stringify'](_0x3360bd));if(_0x3360bd[_0xe9bd('0x21')]){if(_0x3360bd[_0xe9bd('0x21')][_0xe9bd('0x22')]===0x1f4){logger[_0xe9bd('0x21')]('Trunk,\x20%s,\x20%s',_0x429e88,_0x3360bd[_0xe9bd('0x21')]['message']);return _0x46a95e(_0x3360bd[_0xe9bd('0x21')]['message']);}logger[_0xe9bd('0x21')](_0xe9bd('0x1d'),_0x429e88,_0x3360bd[_0xe9bd('0x21')][_0xe9bd('0x23')]);return _0x47ba5e(_0x3360bd[_0xe9bd('0x21')][_0xe9bd('0x23')]);}else{logger[_0xe9bd('0x1c')]('Trunk,\x20%s,\x20%s',_0x429e88,_0xe9bd('0x20'));_0x47ba5e(_0x3360bd[_0xe9bd('0x24')]['message']);}})[_0xe9bd('0x25')](function(_0x505c23){logger[_0xe9bd('0x21')](_0xe9bd('0x1d'),_0x429e88,_0x505c23);_0x46a95e(_0x505c23);});});}function respondWithStatusCode(_0x36f8c0,_0xf02209){_0xf02209=_0xf02209||0xcc;return function(_0x5bc4bf){if(_0x5bc4bf){return _0x36f8c0[_0xe9bd('0x26')](_0xf02209);}return _0x36f8c0[_0xe9bd('0x27')](_0xf02209)[_0xe9bd('0x28')]();};}function respondWithResult(_0x39b206,_0x2641be){_0x2641be=_0x2641be||0xc8;return function(_0xb52d45){if(_0xb52d45){return _0x39b206[_0xe9bd('0x27')](_0x2641be)[_0xe9bd('0x29')](_0xb52d45);}};}function respondWithFilteredResult(_0x1ae889,_0x5987af){return function(_0x3c211a){if(_0x3c211a){var _0x38fdfa=typeof _0x5987af['offset']===_0xe9bd('0x2a')&&typeof _0x5987af[_0xe9bd('0x2b')]===_0xe9bd('0x2a');var _0x429055=_0x3c211a[_0xe9bd('0x2c')];var _0x183601=_0x38fdfa?0x0:_0x5987af['offset'];var _0x5b7f1d=_0x38fdfa?_0x3c211a[_0xe9bd('0x2c')]:_0x5987af['offset']+_0x5987af[_0xe9bd('0x2b')];var _0x1f2c0e;if(_0x5b7f1d>=_0x429055){_0x5b7f1d=_0x429055;_0x1f2c0e=0xc8;}else{_0x1f2c0e=0xce;}_0x1ae889[_0xe9bd('0x27')](_0x1f2c0e);return _0x1ae889[_0xe9bd('0x2d')](_0xe9bd('0x2e'),_0x183601+'-'+_0x5b7f1d+'/'+_0x429055)['json'](_0x3c211a);}return null;};}function patchUpdates(_0x4b7bc2){return function(_0x7f2c5){try{jsonpatch[_0xe9bd('0x2f')](_0x7f2c5,_0x4b7bc2,!![]);}catch(_0x3f96a0){return BPromise[_0xe9bd('0x30')](_0x3f96a0);}return _0x7f2c5[_0xe9bd('0x31')]();};}function saveUpdates(_0x1f0f9e,_0x3c31ee){return function(_0x66213a){if(_0x66213a){return _0x66213a[_0xe9bd('0x32')](_0x1f0f9e)['then'](function(_0x426004){return _0x426004;});}return null;};}function removeEntity(_0x81a31f,_0x390a43){return function(_0x5117bc){if(_0x5117bc){return _0x5117bc['destroy']()[_0xe9bd('0x1b')](function(){var _0x2e9593=_0x5117bc[_0xe9bd('0x33')]({'plain':!![]});var _0x3ed60a=_0xe9bd('0x34');return db[_0xe9bd('0x35')][_0xe9bd('0x36')]({'where':{'type':_0x3ed60a,'resourceId':_0x2e9593['id']}})[_0xe9bd('0x1b')](function(){return _0x5117bc;});})[_0xe9bd('0x1b')](function(){_0x81a31f[_0xe9bd('0x27')](0xcc)[_0xe9bd('0x28')]();});}};}function handleEntityNotFound(_0x549dd1,_0x2ad46e){return function(_0x199477){if(!_0x199477){_0x549dd1[_0xe9bd('0x26')](0x194);}return _0x199477;};}function handleError(_0x8ff624,_0x264ba0){_0x264ba0=_0x264ba0||0x1f4;return function(_0x147da5){logger['error'](_0x147da5[_0xe9bd('0x37')]);if(_0x147da5[_0xe9bd('0x38')]){delete _0x147da5['name'];}_0x8ff624[_0xe9bd('0x27')](_0x264ba0)[_0xe9bd('0x39')](_0x147da5);};}exports['index']=function(_0x4b1da0,_0x2785e6){var _0xdf43b9={},_0x4d2f3d={},_0x2d1289={'count':0x0,'rows':[]};var _0x3ea705=_[_0xe9bd('0x3a')](db['Trunk'][_0xe9bd('0x3b')],function(_0x4d1945){return{'name':_0x4d1945[_0xe9bd('0x3c')],'type':_0x4d1945[_0xe9bd('0x3d')][_0xe9bd('0x3e')]};});_0x4d2f3d[_0xe9bd('0x3f')]=_['map'](_0x3ea705,_0xe9bd('0x38'));_0x4d2f3d[_0xe9bd('0x40')]=_[_0xe9bd('0x41')](_0x4b1da0[_0xe9bd('0x40')]);_0x4d2f3d[_0xe9bd('0x42')]=_[_0xe9bd('0x43')](_0x4d2f3d[_0xe9bd('0x3f')],_0x4d2f3d[_0xe9bd('0x40')]);_0xdf43b9[_0xe9bd('0x44')]=_[_0xe9bd('0x43')](_0x4d2f3d['model'],qs['fields'](_0x4b1da0[_0xe9bd('0x40')]['fields']));_0xdf43b9[_0xe9bd('0x44')]=_0xdf43b9[_0xe9bd('0x44')][_0xe9bd('0x45')]?_0xdf43b9['attributes']:_0x4d2f3d[_0xe9bd('0x3f')];if(!_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x46')]('nolimit')){_0xdf43b9[_0xe9bd('0x2b')]=qs[_0xe9bd('0x2b')](_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x2b')]);_0xdf43b9[_0xe9bd('0x47')]=qs[_0xe9bd('0x47')](_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x47')]);}_0xdf43b9[_0xe9bd('0x48')]=qs[_0xe9bd('0x49')](_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x49')]);_0xdf43b9[_0xe9bd('0x4a')]=qs[_0xe9bd('0x42')](_[_0xe9bd('0x4b')](_0x4b1da0['query'],_0x4d2f3d['filters']),_0x3ea705);if(_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x4c')]){_0xdf43b9[_0xe9bd('0x4a')]=_['merge'](_0xdf43b9['where'],{'$or':_[_0xe9bd('0x3a')](_0x3ea705,function(_0x3f6f22){if(_0x3f6f22[_0xe9bd('0x3d')]!==_0xe9bd('0x4d')){var _0x39fb61={};_0x39fb61[_0x3f6f22[_0xe9bd('0x38')]]={'$like':'%'+_0x4b1da0[_0xe9bd('0x40')]['filter']+'%'};return _0x39fb61;}})});}_0xdf43b9=_[_0xe9bd('0x4e')]({},_0xdf43b9,_0x4b1da0['options']);var _0x36726e={'where':_0xdf43b9[_0xe9bd('0x4a')]};return db[_0xe9bd('0x4f')][_0xe9bd('0x2c')](_0x36726e)[_0xe9bd('0x1b')](function(_0x4b7b67){_0x2d1289[_0xe9bd('0x2c')]=_0x4b7b67;if(_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x50')]){_0xdf43b9['include']=[{'all':!![]}];}return db[_0xe9bd('0x4f')][_0xe9bd('0x51')](_0xdf43b9);})[_0xe9bd('0x1b')](function(_0x5a466b){_0x2d1289[_0xe9bd('0x52')]=_0x5a466b;return _0x2d1289;})[_0xe9bd('0x1b')](respondWithFilteredResult(_0x2785e6,_0xdf43b9))[_0xe9bd('0x25')](handleError(_0x2785e6,null));};exports[_0xe9bd('0x53')]=function(_0x1ee09c,_0x579d26){var _0x3f4833={'raw':![],'where':{'id':_0x1ee09c[_0xe9bd('0x54')]['id']}},_0x4b8ff9={};_0x4b8ff9[_0xe9bd('0x3f')]=_[_0xe9bd('0x41')](db[_0xe9bd('0x4f')][_0xe9bd('0x3b')]);_0x4b8ff9['query']=_[_0xe9bd('0x41')](_0x1ee09c['query']);_0x4b8ff9[_0xe9bd('0x42')]=_[_0xe9bd('0x43')](_0x4b8ff9['model'],_0x4b8ff9['query']);_0x3f4833[_0xe9bd('0x44')]=_['intersection'](_0x4b8ff9[_0xe9bd('0x3f')],qs['fields'](_0x1ee09c[_0xe9bd('0x40')][_0xe9bd('0x55')]));_0x3f4833['attributes']=_0x3f4833[_0xe9bd('0x44')]['length']?_0x3f4833[_0xe9bd('0x44')]:_0x4b8ff9[_0xe9bd('0x3f')];if(_0x1ee09c[_0xe9bd('0x40')]['includeAll']){_0x3f4833[_0xe9bd('0x56')]=[{'all':!![]}];}_0x3f4833=_[_0xe9bd('0x4e')]({},_0x3f4833,_0x1ee09c[_0xe9bd('0x57')]);return db[_0xe9bd('0x4f')]['find'](_0x3f4833)['then'](handleEntityNotFound(_0x579d26,null))[_0xe9bd('0x1b')](respondWithResult(_0x579d26,null))['catch'](handleError(_0x579d26,null));};exports[_0xe9bd('0x58')]=function(_0x3c33b8,_0xc7dd2f){var _0xc818b4={'where':{'id':_0x3c33b8[_0xe9bd('0x54')]['id']}},_0x159f68={};_0x159f68[_0xe9bd('0x3f')]=_[_0xe9bd('0x41')](db[_0xe9bd('0x4f')][_0xe9bd('0x3b')]);_0xc818b4[_0xe9bd('0x44')]=_[_0xe9bd('0x43')](_0x159f68['model'],qs['fields'](_0x3c33b8['query'][_0xe9bd('0x55')]));_0xc818b4['attributes']=_0xc818b4[_0xe9bd('0x44')][_0xe9bd('0x45')]?_0xc818b4[_0xe9bd('0x44')]:_0x159f68[_0xe9bd('0x3f')];if(_0x3c33b8[_0xe9bd('0x40')][_0xe9bd('0x50')]){_0xc818b4[_0xe9bd('0x56')]=[{'all':!![]}];}_0xc818b4=_[_0xe9bd('0x4e')]({},_0xc818b4,_0x3c33b8[_0xe9bd('0x57')]);return db['Trunk'][_0xe9bd('0x59')](_0xc818b4)[_0xe9bd('0x1b')](handleEntityNotFound(_0xc7dd2f,null))[_0xe9bd('0x1b')](function(_0x3f848d){if(_0x3f848d){var _0x4d58c1=_0x3f848d[_0xe9bd('0x33')]({'plain':!![]});_0x4d58c1=qs[_0xe9bd('0x5a')](_0x4d58c1,['id',_0xe9bd('0x5b'),'updatedAt']);_0x3c33b8[_0xe9bd('0x5c')]=_[_0xe9bd('0x5a')](_0x3c33b8[_0xe9bd('0x5c')],['id',_0xe9bd('0x5b'),'updatedAt']);return db['Trunk'][_0xe9bd('0x5d')](_[_0xe9bd('0x4e')](_0x4d58c1,_0x3c33b8[_0xe9bd('0x5c')]),{'include':_0x3c33b8[_0xe9bd('0x40')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x305efa){var _0x20855b=_0x3c33b8[_0xe9bd('0x5e')][_0xe9bd('0x33')]({'plain':!![]});if(!_0x20855b)throw new Error(_0xe9bd('0x5f'));if(_0x20855b[_0xe9bd('0x60')]==='user'){var _0x179c8d=_0x305efa['get']({'plain':!![]});var _0x27e07c=_0xe9bd('0x34');return db[_0xe9bd('0x61')][_0xe9bd('0x59')]({'where':{'name':_0x27e07c,'userProfileId':_0x20855b['userProfileId']},'raw':!![]})[_0xe9bd('0x1b')](function(_0x263ad9){if(_0x263ad9&&_0x263ad9[_0xe9bd('0x62')]===0x0){return db['UserProfileResource'][_0xe9bd('0x5d')]({'name':_0x179c8d[_0xe9bd('0x38')],'resourceId':_0x179c8d['id'],'type':_0x263ad9[_0xe9bd('0x38')],'sectionId':_0x263ad9['id']},{})[_0xe9bd('0x1b')](function(){return _0x305efa;});}else{return _0x305efa;}})[_0xe9bd('0x25')](function(_0x16b66c){logger[_0xe9bd('0x21')](_0xe9bd('0x63'),_0x16b66c);throw _0x16b66c;});}return _0x305efa;});}})[_0xe9bd('0x1b')](respondWithResult(_0xc7dd2f,0xc9))[_0xe9bd('0x25')](handleError(_0xc7dd2f,null));};exports[_0xe9bd('0x5d')]=function(_0x37d07a,_0x5d1e4b,_0x3a12e9){var _0x9d0603;return db['Trunk'][_0xe9bd('0x5d')](_0x37d07a[_0xe9bd('0x5c')],{'raw':!![]})['then'](function(_0x561165){_0x9d0603=_0x561165;return db[_0xe9bd('0x4f')][_0xe9bd('0x51')]({'raw':!![]});})['then'](function(_0x4ec8be){var _0x4a6422=fs[_0xe9bd('0x64')](path['join'](config['root'],'server/files/templates/trunk.ejs'),'utf8');var _0x1fc88d=fs[_0xe9bd('0x64')](path[_0xe9bd('0x65')](config['root'],_0xe9bd('0x66')),_0xe9bd('0x67'));var _0x337284=ejs[_0xe9bd('0x68')](_0x4a6422,{'trunks':_0x4ec8be||[]});fs['writeFileSync'](_0xe9bd('0x69'),_0x337284);if(_0x9d0603[_0xe9bd('0x6a')]){var _0x11ebcb=ejs['render'](_0x1fc88d,{'trunks':_0x4ec8be||[]});fs['writeFileSync'](_0xe9bd('0x6b'),_0x11ebcb);}})[_0xe9bd('0x1b')](function(){return respondWithRpcPromise(_0xe9bd('0x6c'),_0xe9bd('0x5d'),{'module':_0xe9bd('0x6d')});})[_0xe9bd('0x1b')](function(){var _0x3fda4c=_0x37d07a[_0xe9bd('0x5e')]['get']({'plain':!![]});if(!_0x3fda4c)throw new Error(_0xe9bd('0x5f'));if(_0x3fda4c[_0xe9bd('0x60')]===_0xe9bd('0x5e')){var _0x3db47a=_0x9d0603[_0xe9bd('0x33')]({'plain':!![]});return db['UserProfileSection'][_0xe9bd('0x59')]({'where':{'name':'Trunks','userProfileId':_0x3fda4c['userProfileId']},'raw':!![]})[_0xe9bd('0x1b')](function(_0x4496e3){if(_0x4496e3&&_0x4496e3['autoAssociation']===0x0){return db[_0xe9bd('0x35')][_0xe9bd('0x5d')]({'name':_0x3db47a[_0xe9bd('0x38')],'resourceId':_0x3db47a['id'],'type':_0x4496e3[_0xe9bd('0x38')],'sectionId':_0x4496e3['id']},{})['then'](function(){return _0x9d0603;});}else{return _0x9d0603;}})[_0xe9bd('0x25')](function(_0x41fb41){logger['error'](_0xe9bd('0x63'),_0x41fb41);throw _0x41fb41;});}return _0x9d0603;})[_0xe9bd('0x1b')](respondWithResult(_0x5d1e4b,0xc9))[_0xe9bd('0x25')](handleError(_0x5d1e4b,null));};exports[_0xe9bd('0x32')]=function(_0x2e63c7,_0x1a36aa,_0x466a89){var _0x5e127b;return db[_0xe9bd('0x4f')][_0xe9bd('0x59')]({'where':{'id':_0x2e63c7[_0xe9bd('0x54')]['id']}})[_0xe9bd('0x1b')](handleEntityNotFound(_0x1a36aa,null))[_0xe9bd('0x1b')](saveUpdates(_0x2e63c7[_0xe9bd('0x5c')],null))[_0xe9bd('0x1b')](function(_0x2adc49){if(_0x2adc49){_0x5e127b=_0x2adc49;return db[_0xe9bd('0x4f')]['findAll']({'raw':!![]});}})[_0xe9bd('0x1b')](function(_0x466952){if(_0x466952){var _0x256890=fs[_0xe9bd('0x64')](path[_0xe9bd('0x65')](config[_0xe9bd('0x6e')],_0xe9bd('0x6f')),'utf8');var _0x18519d=fs[_0xe9bd('0x64')](path['join'](config[_0xe9bd('0x6e')],_0xe9bd('0x66')),_0xe9bd('0x67'));var _0x2083c4=ejs[_0xe9bd('0x68')](_0x256890,{'trunks':_0x466952||[]});fs[_0xe9bd('0x70')](_0xe9bd('0x69'),_0x2083c4);var _0x4f3dc6=ejs['render'](_0x18519d,{'trunks':_0x466952||[]});fs[_0xe9bd('0x70')](_0xe9bd('0x6b'),_0x4f3dc6);return respondWithRpcPromise(_0xe9bd('0x6c'),_0xe9bd('0x32'),{'module':_0xe9bd('0x6d')});}return null;})[_0xe9bd('0x1b')](function(_0x1b46f4){if(_0x1b46f4){return _0x5e127b;}})['then'](respondWithResult(_0x1a36aa,null))[_0xe9bd('0x25')](handleError(_0x1a36aa,null));};exports[_0xe9bd('0x36')]=function(_0x29833b,_0x256862,_0x14cdd5){var _0x74063;return db[_0xe9bd('0x4f')]['find']({'where':{'id':_0x29833b['params']['id']}})['then'](handleEntityNotFound(_0x256862,null))[_0xe9bd('0x1b')](removeEntity(_0x256862,null))['then'](function(){return db['Trunk']['findAll']({'raw':!![]});})[_0xe9bd('0x1b')](function(_0x402ab2){var _0xf170d4=fs[_0xe9bd('0x64')](path[_0xe9bd('0x65')](config[_0xe9bd('0x6e')],_0xe9bd('0x6f')),_0xe9bd('0x67'));var _0x14ec42=fs['readFileSync'](path[_0xe9bd('0x65')](config['root'],_0xe9bd('0x66')),_0xe9bd('0x67'));var _0x22c67f=ejs[_0xe9bd('0x68')](_0xf170d4,{'trunks':_0x402ab2});var _0x416938=ejs['render'](_0x14ec42,{'trunks':_0x402ab2});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x22c67f);fs[_0xe9bd('0x70')](_0xe9bd('0x6b'),_0x416938);return respondWithRpcPromise('Reload',_0xe9bd('0x36'),{'module':_0xe9bd('0x6d')});})[_0xe9bd('0x25')](handleError(_0x256862,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 4fd5486..b74090d 100644 --- a/server/api/trunk/trunk.model.js +++ b/server/api/trunk/trunk.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x323c=['api','moment','bluebird','path','rimraf','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash','util'];(function(_0xed7d9a,_0x26a34d){var _0x3e9f15=function(_0x109a7f){while(--_0x109a7f){_0xed7d9a['push'](_0xed7d9a['shift']());}};_0x3e9f15(++_0x26a34d);}(_0x323c,0x76));var _0xc323=function(_0xded12b,_0xecfb8e){_0xded12b=_0xded12b-0x0;var _0x572384=_0x323c[_0xded12b];return _0x572384;};'use strict';var _=require(_0xc323('0x0'));var util=require(_0xc323('0x1'));var logger=require('../../config/logger')(_0xc323('0x2'));var moment=require(_0xc323('0x3'));var BPromise=require(_0xc323('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc323('0x5'));var rimraf=require(_0xc323('0x6'));var config=require('../../config/environment');var attributes=require(_0xc323('0x7'));module[_0xc323('0x8')]=function(_0x66691a,_0x2b2510){return _0x66691a[_0xc323('0x9')](_0xc323('0xa'),attributes,{'tableName':_0xc323('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x384b=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x3c86f4,_0xf76317){var _0x22fa28=function(_0x3defbe){while(--_0x3defbe){_0x3c86f4['push'](_0x3c86f4['shift']());}};_0x22fa28(++_0xf76317);}(_0x384b,0x1b8));var _0xb384=function(_0x5bac6d,_0x4e790d){_0x5bac6d=_0x5bac6d-0x0;var _0x4406b5=_0x384b[_0x5bac6d];return _0x4406b5;};'use strict';var _=require(_0xb384('0x0'));var util=require(_0xb384('0x1'));var logger=require(_0xb384('0x2'))(_0xb384('0x3'));var moment=require(_0xb384('0x4'));var BPromise=require(_0xb384('0x5'));var rp=require(_0xb384('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb384('0x7'));var config=require(_0xb384('0x8'));var attributes=require('./trunk.attributes');module[_0xb384('0x9')]=function(_0x2f3cd2,_0x4983b7){return _0x2f3cd2['define']('Trunk',attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index de43e46..bde614f 100644 --- a/server/api/trunk/trunk.rpc.js +++ b/server/api/trunk/trunk.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7cc2=['Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Trunk,\x20%s,\x20%s','info','Trunk','findAll','options','raw','where','attributes','include','model','map','then','GetTrunk','catch','find','ShowTrunk','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug'];(function(_0x5e3560,_0x74add3){var _0x4a1160=function(_0x4d3c23){while(--_0x4d3c23){_0x5e3560['push'](_0x5e3560['shift']());}};_0x4a1160(++_0x74add3);}(_0x7cc2,0x1dc));var _0x27cc=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0x7cc2[_0x9dfc10];return _0x4f938a;};'use strict';var _=require(_0x27cc('0x0'));var util=require('util');var moment=require(_0x27cc('0x1'));var BPromise=require('bluebird');var rs=require(_0x27cc('0x2'));var fs=require('fs');var Redis=require(_0x27cc('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x27cc('0x4'));var logger=require(_0x27cc('0x5'))(_0x27cc('0x6'));var config=require(_0x27cc('0x7'));var jayson=require(_0x27cc('0x8'));var client=jayson[_0x27cc('0x9')][_0x27cc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30b5ea,_0x56932a,_0x40599a){return new BPromise(function(_0x2d63b1,_0x340237){return client[_0x27cc('0xb')](_0x30b5ea,_0x40599a)['then'](function(_0x2fb814){logger['info']('Trunk,\x20%s,\x20%s',_0x56932a,_0x27cc('0xc'));logger[_0x27cc('0xd')](_0x27cc('0xe'),_0x56932a,'request\x20sent',JSON[_0x27cc('0xf')](_0x2fb814));if(_0x2fb814['error']){if(_0x2fb814[_0x27cc('0x10')][_0x27cc('0x11')]===0x1f4){logger['error']('Trunk,\x20%s,\x20%s',_0x56932a,_0x2fb814[_0x27cc('0x10')][_0x27cc('0x12')]);return _0x340237(_0x2fb814[_0x27cc('0x10')]['message']);}logger[_0x27cc('0x10')](_0x27cc('0x13'),_0x56932a,_0x2fb814[_0x27cc('0x10')][_0x27cc('0x12')]);return _0x2d63b1(_0x2fb814['error'][_0x27cc('0x12')]);}else{logger[_0x27cc('0x14')](_0x27cc('0x13'),_0x56932a,_0x27cc('0xc'));_0x2d63b1(_0x2fb814['result']['message']);}})['catch'](function(_0x118f51){logger['error'](_0x27cc('0x13'),_0x56932a,_0x118f51);_0x340237(_0x118f51);});});}exports['GetTrunk']=function(_0x3ba003){var _0x173936=this;return new Promise(function(_0x14b85e,_0x1a1669){return db[_0x27cc('0x15')][_0x27cc('0x16')]({'raw':_0x3ba003['options']?_0x3ba003[_0x27cc('0x17')][_0x27cc('0x18')]===undefined?!![]:![]:!![],'where':_0x3ba003['options']?_0x3ba003[_0x27cc('0x17')][_0x27cc('0x19')]||null:null,'attributes':_0x3ba003[_0x27cc('0x17')]?_0x3ba003[_0x27cc('0x17')][_0x27cc('0x1a')]||null:null,'limit':_0x3ba003[_0x27cc('0x17')]?_0x3ba003[_0x27cc('0x17')]['limit']||null:null,'include':_0x3ba003[_0x27cc('0x17')]?_0x3ba003['options'][_0x27cc('0x1b')]?_['map'](_0x3ba003['options'][_0x27cc('0x1b')],function(_0x33a413){return{'model':db[_0x33a413['model']],'as':_0x33a413['as'],'attributes':_0x33a413['attributes'],'include':_0x33a413[_0x27cc('0x1b')]?_['map'](_0x33a413[_0x27cc('0x1b')],function(_0x10ef50){return{'model':db[_0x10ef50[_0x27cc('0x1c')]],'as':_0x10ef50['as'],'attributes':_0x10ef50[_0x27cc('0x1a')],'include':_0x10ef50[_0x27cc('0x1b')]?_[_0x27cc('0x1d')](_0x10ef50[_0x27cc('0x1b')],function(_0xd5c85e){return{'model':db[_0xd5c85e[_0x27cc('0x1c')]],'as':_0xd5c85e['as'],'attributes':_0xd5c85e[_0x27cc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x27cc('0x1e')](function(_0x3de9ac){logger[_0x27cc('0x14')](_0x27cc('0x1f'),_0x3ba003);logger['debug']('GetTrunk',_0x3ba003,JSON[_0x27cc('0xf')](_0x3de9ac));_0x14b85e(_0x3de9ac);})[_0x27cc('0x20')](function(_0x16953b){logger['error'](_0x27cc('0x1f'),_0x16953b[_0x27cc('0x12')],_0x3ba003);_0x1a1669(_0x173936['error'](0x1f4,_0x16953b[_0x27cc('0x12')]));});});};exports['ShowTrunk']=function(_0x1fb59d){var _0x398891=this;return new Promise(function(_0x843e6d,_0x1c48cb){return db[_0x27cc('0x15')][_0x27cc('0x21')]({'raw':_0x1fb59d['options']?_0x1fb59d['options'][_0x27cc('0x18')]===undefined?!![]:![]:!![],'where':_0x1fb59d[_0x27cc('0x17')]?_0x1fb59d[_0x27cc('0x17')][_0x27cc('0x19')]||null:null,'attributes':_0x1fb59d[_0x27cc('0x17')]?_0x1fb59d[_0x27cc('0x17')][_0x27cc('0x1a')]||null:null,'include':_0x1fb59d[_0x27cc('0x17')]?_0x1fb59d[_0x27cc('0x17')]['include']?_[_0x27cc('0x1d')](_0x1fb59d[_0x27cc('0x17')][_0x27cc('0x1b')],function(_0x56469f){return{'model':db[_0x56469f[_0x27cc('0x1c')]],'as':_0x56469f['as'],'attributes':_0x56469f[_0x27cc('0x1a')],'include':_0x56469f[_0x27cc('0x1b')]?_[_0x27cc('0x1d')](_0x56469f['include'],function(_0x4e64a5){return{'model':db[_0x4e64a5['model']],'as':_0x4e64a5['as'],'attributes':_0x4e64a5[_0x27cc('0x1a')],'include':_0x4e64a5['include']?_[_0x27cc('0x1d')](_0x4e64a5[_0x27cc('0x1b')],function(_0xc5bdce){return{'model':db[_0xc5bdce[_0x27cc('0x1c')]],'as':_0xc5bdce['as'],'attributes':_0xc5bdce[_0x27cc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x27cc('0x1e')](function(_0x230420){logger[_0x27cc('0x14')]('ShowTrunk',_0x1fb59d);logger[_0x27cc('0xd')](_0x27cc('0x22'),_0x1fb59d,JSON[_0x27cc('0xf')](_0x230420));_0x843e6d(_0x230420);})[_0x27cc('0x20')](function(_0x650a85){logger[_0x27cc('0x10')](_0x27cc('0x22'),_0x650a85[_0x27cc('0x12')],_0x1fb59d);_0x1c48cb(_0x398891['error'](0x1f4,_0x650a85['message']));});});}; \ No newline at end of file +var _0x3be5=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','request\x20sent','error','Trunk,\x20%s,\x20%s','message','result','catch','GetTrunk','Trunk','findAll','options','raw','attributes','limit','include','map','model','debug','stringify','ShowTrunk','find','where','lodash','util'];(function(_0x2377f0,_0x10ca6b){var _0x580d94=function(_0x2ac038){while(--_0x2ac038){_0x2377f0['push'](_0x2377f0['shift']());}};_0x580d94(++_0x10ca6b);}(_0x3be5,0x82));var _0x53be=function(_0x49c7a2,_0x35a73b){_0x49c7a2=_0x49c7a2-0x0;var _0x13a4e0=_0x3be5[_0x49c7a2];return _0x13a4e0;};'use strict';var _=require(_0x53be('0x0'));var util=require(_0x53be('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x53be('0x2'));var fs=require('fs');var Redis=require(_0x53be('0x3'));var db=require(_0x53be('0x4'))['db'];var utils=require(_0x53be('0x5'));var logger=require(_0x53be('0x6'))('rpc');var config=require(_0x53be('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x53be('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa8834f,_0xc13c52,_0x4639b9){return new BPromise(function(_0x938d55,_0x2435bb){return client[_0x53be('0x9')](_0xa8834f,_0x4639b9)[_0x53be('0xa')](function(_0x32e667){logger[_0x53be('0xb')]('Trunk,\x20%s,\x20%s',_0xc13c52,'request\x20sent');logger['debug']('Trunk,\x20%s,\x20%s,\x20%s',_0xc13c52,_0x53be('0xc'),JSON['stringify'](_0x32e667));if(_0x32e667[_0x53be('0xd')]){if(_0x32e667[_0x53be('0xd')]['code']===0x1f4){logger[_0x53be('0xd')](_0x53be('0xe'),_0xc13c52,_0x32e667[_0x53be('0xd')][_0x53be('0xf')]);return _0x2435bb(_0x32e667[_0x53be('0xd')][_0x53be('0xf')]);}logger['error'](_0x53be('0xe'),_0xc13c52,_0x32e667['error'][_0x53be('0xf')]);return _0x938d55(_0x32e667[_0x53be('0xd')][_0x53be('0xf')]);}else{logger[_0x53be('0xb')]('Trunk,\x20%s,\x20%s',_0xc13c52,_0x53be('0xc'));_0x938d55(_0x32e667[_0x53be('0x10')][_0x53be('0xf')]);}})[_0x53be('0x11')](function(_0x2ae76c){logger[_0x53be('0xd')]('Trunk,\x20%s,\x20%s',_0xc13c52,_0x2ae76c);_0x2435bb(_0x2ae76c);});});}exports[_0x53be('0x12')]=function(_0x4c95f0){var _0x54518c=this;return new Promise(function(_0x31a72b,_0x217e07){return db[_0x53be('0x13')][_0x53be('0x14')]({'raw':_0x4c95f0['options']?_0x4c95f0[_0x53be('0x15')][_0x53be('0x16')]===undefined?!![]:![]:!![],'where':_0x4c95f0['options']?_0x4c95f0[_0x53be('0x15')]['where']||null:null,'attributes':_0x4c95f0[_0x53be('0x15')]?_0x4c95f0['options'][_0x53be('0x17')]||null:null,'limit':_0x4c95f0['options']?_0x4c95f0[_0x53be('0x15')][_0x53be('0x18')]||null:null,'include':_0x4c95f0[_0x53be('0x15')]?_0x4c95f0[_0x53be('0x15')][_0x53be('0x19')]?_[_0x53be('0x1a')](_0x4c95f0[_0x53be('0x15')][_0x53be('0x19')],function(_0x7e0dc0){return{'model':db[_0x7e0dc0[_0x53be('0x1b')]],'as':_0x7e0dc0['as'],'attributes':_0x7e0dc0[_0x53be('0x17')],'include':_0x7e0dc0[_0x53be('0x19')]?_[_0x53be('0x1a')](_0x7e0dc0[_0x53be('0x19')],function(_0x3807b9){return{'model':db[_0x3807b9[_0x53be('0x1b')]],'as':_0x3807b9['as'],'attributes':_0x3807b9[_0x53be('0x17')],'include':_0x3807b9[_0x53be('0x19')]?_[_0x53be('0x1a')](_0x3807b9[_0x53be('0x19')],function(_0x2a3bc7){return{'model':db[_0x2a3bc7[_0x53be('0x1b')]],'as':_0x2a3bc7['as'],'attributes':_0x2a3bc7[_0x53be('0x17')]};}):[]};}):[]};}):[]:[]})[_0x53be('0xa')](function(_0x2bf93d){logger['info'](_0x53be('0x12'),_0x4c95f0);logger[_0x53be('0x1c')](_0x53be('0x12'),_0x4c95f0,JSON[_0x53be('0x1d')](_0x2bf93d));_0x31a72b(_0x2bf93d);})[_0x53be('0x11')](function(_0x1dd171){logger[_0x53be('0xd')]('GetTrunk',_0x1dd171[_0x53be('0xf')],_0x4c95f0);_0x217e07(_0x54518c[_0x53be('0xd')](0x1f4,_0x1dd171[_0x53be('0xf')]));});});};exports[_0x53be('0x1e')]=function(_0x495dca){var _0x7c230f=this;return new Promise(function(_0x36de3e,_0x663a7d){return db['Trunk'][_0x53be('0x1f')]({'raw':_0x495dca['options']?_0x495dca[_0x53be('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x495dca[_0x53be('0x15')]?_0x495dca[_0x53be('0x15')][_0x53be('0x20')]||null:null,'attributes':_0x495dca[_0x53be('0x15')]?_0x495dca[_0x53be('0x15')][_0x53be('0x17')]||null:null,'include':_0x495dca[_0x53be('0x15')]?_0x495dca['options'][_0x53be('0x19')]?_[_0x53be('0x1a')](_0x495dca[_0x53be('0x15')][_0x53be('0x19')],function(_0xe6dcb1){return{'model':db[_0xe6dcb1[_0x53be('0x1b')]],'as':_0xe6dcb1['as'],'attributes':_0xe6dcb1['attributes'],'include':_0xe6dcb1['include']?_[_0x53be('0x1a')](_0xe6dcb1[_0x53be('0x19')],function(_0x43dc90){return{'model':db[_0x43dc90[_0x53be('0x1b')]],'as':_0x43dc90['as'],'attributes':_0x43dc90[_0x53be('0x17')],'include':_0x43dc90['include']?_[_0x53be('0x1a')](_0x43dc90[_0x53be('0x19')],function(_0x893b5e){return{'model':db[_0x893b5e[_0x53be('0x1b')]],'as':_0x893b5e['as'],'attributes':_0x893b5e[_0x53be('0x17')]};}):[]};}):[]};}):[]:[]})[_0x53be('0xa')](function(_0xb56bca){logger[_0x53be('0xb')](_0x53be('0x1e'),_0x495dca);logger[_0x53be('0x1c')]('ShowTrunk',_0x495dca,JSON[_0x53be('0x1d')](_0xb56bca));_0x36de3e(_0xb56bca);})['catch'](function(_0x5cad2c){logger['error'](_0x53be('0x1e'),_0x5cad2c[_0x53be('0xf')],_0x495dca);_0x663a7d(_0x7c230f['error'](0x1f4,_0x5cad2c[_0x53be('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 77d660d..7857278 100644 --- a/server/api/user-setting/index.js +++ b/server/api/user-setting/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4f8c=['../../components/auth/service','put','/:id','isAuthenticated','update','exports','express','Router'];(function(_0xf989a3,_0x7b4ae6){var _0x438f68=function(_0x2cdd48){while(--_0x2cdd48){_0xf989a3['push'](_0xf989a3['shift']());}};_0x438f68(++_0x7b4ae6);}(_0x4f8c,0x136));var _0xc4f8=function(_0x1fb20b,_0x4d5ba8){_0x1fb20b=_0x1fb20b-0x0;var _0x1d5705=_0x4f8c[_0x1fb20b];return _0x1d5705;};'use strict';var express=require(_0xc4f8('0x0'));var router=express[_0xc4f8('0x1')]();var auth=require(_0xc4f8('0x2'));var controller=require('./user-setting.controller');router[_0xc4f8('0x3')](_0xc4f8('0x4'),auth[_0xc4f8('0x5')](),controller[_0xc4f8('0x6')]);module[_0xc4f8('0x7')]=router; \ No newline at end of file +var _0xcb2f=['../../components/auth/service','put','/:id','isAuthenticated','update','exports','express','Router'];(function(_0x101157,_0x59e621){var _0xb6aaf5=function(_0x1cafe6){while(--_0x1cafe6){_0x101157['push'](_0x101157['shift']());}};_0xb6aaf5(++_0x59e621);}(_0xcb2f,0xfe));var _0xfcb2=function(_0x330a21,_0x1d91f1){_0x330a21=_0x330a21-0x0;var _0x160db6=_0xcb2f[_0x330a21];return _0x160db6;};'use strict';var express=require(_0xfcb2('0x0'));var router=express[_0xfcb2('0x1')]();var auth=require(_0xfcb2('0x2'));var controller=require('./user-setting.controller');router[_0xfcb2('0x3')](_0xfcb2('0x4'),auth[_0xfcb2('0x5')](),controller[_0xfcb2('0x6')]);module[_0xfcb2('0x7')]=router; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.attributes.js b/server/api/user-setting/user-setting.attributes.js index ec74ef5..c72b858 100644 --- a/server/api/user-setting/user-setting.attributes.js +++ b/server/api/user-setting/user-setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1b8e=['sequelize','error','warning','info','debug','ENUM','BOOLEAN','TEXT','DATE','INTEGER','UserId'];(function(_0x25c8f8,_0x44e62b){var _0x14bef9=function(_0x3815e7){while(--_0x3815e7){_0x25c8f8['push'](_0x25c8f8['shift']());}};_0x14bef9(++_0x44e62b);}(_0x1b8e,0x84));var _0xe1b8=function(_0x15775d,_0x55a800){_0x15775d=_0x15775d-0x0;var _0x4e7685=_0x1b8e[_0x15775d];return _0x4e7685;};'use strict';var Sequelize=require(_0xe1b8('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xe1b8('0x1'),_0xe1b8('0x2'),_0xe1b8('0x3'),_0xe1b8('0x4')];module['exports']={'clientSideLoggingLevel':{'type':Sequelize[_0xe1b8('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xe1b8('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xe1b8('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xe1b8('0x7')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xe1b8('0x8')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xe1b8('0x9')],'unique':_0xe1b8('0xa')}}; \ No newline at end of file +var _0x7a5f=['warning','info','exports','ENUM','BOOLEAN','DATE','INTEGER','UserId','sequelize','error'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7a5f,0x10c));var _0xf7a5=function(_0x18afca,_0x4219d9){_0x18afca=_0x18afca-0x0;var _0x11603f=_0x7a5f[_0x18afca];return _0x11603f;};'use strict';var Sequelize=require(_0xf7a5('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xf7a5('0x1'),_0xf7a5('0x2'),_0xf7a5('0x3'),'debug'];module[_0xf7a5('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0xf7a5('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xf7a5('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xf7a5('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xf7a5('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xf7a5('0x8')],'unique':_0xf7a5('0x9')}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index 0e14525..d3b6871 100644 --- a/server/api/user-setting/user-setting.controller.js +++ b/server/api/user-setting/user-setting.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4853=['json','update','then','sendStatus','error','stack','send','Unauthorized','params','Invalid\x20user\x20setting\x20id','find','catch','ioredis','api','../../config/environment','../../mysqldb','socket.io-emitter','redis','./user-setting.socket','localhost','status'];(function(_0x420204,_0xaae94d){var _0x93aaad=function(_0x2049fa){while(--_0x2049fa){_0x420204['push'](_0x420204['shift']());}};_0x93aaad(++_0xaae94d);}(_0x4853,0x11d));var _0x3485=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4853[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var Redis=require(_0x3485('0x0'));var logger=require('../../config/logger')(_0x3485('0x1'));var config=require(_0x3485('0x2'));var db=require(_0x3485('0x3'))['db'];var socket=require(_0x3485('0x4'))(new Redis(config[_0x3485('0x5')]));require(_0x3485('0x6'))['register'](socket);config['redis']=_['defaults'](config[_0x3485('0x5')],{'host':_0x3485('0x7'),'port':0x18eb});function respondWithResult(_0x2442dd,_0x10ec4b){_0x10ec4b=_0x10ec4b||0xc8;return function(_0x41a183){if(_0x41a183){return _0x2442dd[_0x3485('0x8')](_0x10ec4b)[_0x3485('0x9')](_0x41a183);}};}function saveUpdates(_0x568ea7){return function(_0x386f6b){if(_0x386f6b){return _0x386f6b[_0x3485('0xa')](_0x568ea7)[_0x3485('0xb')](function(_0x876b94){return _0x876b94;});}return null;};}function handleEntityNotFound(_0xe402e6){return function(_0x466c62){if(!_0x466c62){_0xe402e6[_0x3485('0xc')](0x194);}return _0x466c62;};}function handleError(_0x432791,_0x1db53c){_0x1db53c=_0x1db53c||0x1f4;return function(_0x523fff){logger[_0x3485('0xd')](_0x523fff[_0x3485('0xe')]);if(_0x523fff['name']){delete _0x523fff['name'];}_0x432791[_0x3485('0x8')](_0x1db53c)[_0x3485('0xf')](_0x523fff);};}exports[_0x3485('0xa')]=function(_0x516082,_0x4c33dd){if(_0x516082['user']['role']!=='admin')throw new Error(_0x3485('0x10'));if(isNaN(Number(_0x516082[_0x3485('0x11')]['id'])))throw new Error(_0x3485('0x12'));return db['UserSetting'][_0x3485('0x13')]({'where':{'id':_0x516082['params']['id']}})['then'](handleEntityNotFound(_0x4c33dd,null))[_0x3485('0xb')](saveUpdates(_0x516082['body'],null))[_0x3485('0xb')](respondWithResult(_0x4c33dd,null))[_0x3485('0x14')](handleError(_0x4c33dd,null));}; \ No newline at end of file +var _0x2ce1=['update','then','sendStatus','stack','name','send','role','admin','Unauthorized','Invalid\x20user\x20setting\x20id','UserSetting','find','params','catch','api','../../config/environment','../../mysqldb','socket.io-emitter','./user-setting.socket','register','defaults','redis','localhost','status','json'];(function(_0x4a70df,_0x140683){var _0x526538=function(_0xaba988){while(--_0xaba988){_0x4a70df['push'](_0x4a70df['shift']());}};_0x526538(++_0x140683);}(_0x2ce1,0x8b));var _0x12ce=function(_0x1706d7,_0x3a3c3b){_0x1706d7=_0x1706d7-0x0;var _0x4427c5=_0x2ce1[_0x1706d7];return _0x4427c5;};'use strict';var _=require('lodash');var Redis=require('ioredis');var logger=require('../../config/logger')(_0x12ce('0x0'));var config=require(_0x12ce('0x1'));var db=require(_0x12ce('0x2'))['db'];var socket=require(_0x12ce('0x3'))(new Redis(config['redis']));require(_0x12ce('0x4'))[_0x12ce('0x5')](socket);config['redis']=_[_0x12ce('0x6')](config[_0x12ce('0x7')],{'host':_0x12ce('0x8'),'port':0x18eb});function respondWithResult(_0x5a4cde,_0x32c7c8){_0x32c7c8=_0x32c7c8||0xc8;return function(_0x4eef9a){if(_0x4eef9a){return _0x5a4cde[_0x12ce('0x9')](_0x32c7c8)[_0x12ce('0xa')](_0x4eef9a);}};}function saveUpdates(_0x3dc12e){return function(_0x5ebe11){if(_0x5ebe11){return _0x5ebe11[_0x12ce('0xb')](_0x3dc12e)[_0x12ce('0xc')](function(_0x3e1ee9){return _0x3e1ee9;});}return null;};}function handleEntityNotFound(_0x1bf7f1){return function(_0x4b5b43){if(!_0x4b5b43){_0x1bf7f1[_0x12ce('0xd')](0x194);}return _0x4b5b43;};}function handleError(_0x4d6de1,_0x3a3d4d){_0x3a3d4d=_0x3a3d4d||0x1f4;return function(_0x5ee0eb){logger['error'](_0x5ee0eb[_0x12ce('0xe')]);if(_0x5ee0eb[_0x12ce('0xf')]){delete _0x5ee0eb[_0x12ce('0xf')];}_0x4d6de1[_0x12ce('0x9')](_0x3a3d4d)[_0x12ce('0x10')](_0x5ee0eb);};}exports[_0x12ce('0xb')]=function(_0x4d9178,_0x2e3b21){if(_0x4d9178['user'][_0x12ce('0x11')]!==_0x12ce('0x12'))throw new Error(_0x12ce('0x13'));if(isNaN(Number(_0x4d9178['params']['id'])))throw new Error(_0x12ce('0x14'));return db[_0x12ce('0x15')][_0x12ce('0x16')]({'where':{'id':_0x4d9178[_0x12ce('0x17')]['id']}})[_0x12ce('0xc')](handleEntityNotFound(_0x2e3b21,null))[_0x12ce('0xc')](saveUpdates(_0x4d9178['body'],null))['then'](respondWithResult(_0x2e3b21,null))[_0x12ce('0x18')](handleError(_0x2e3b21,null));}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.events.js b/server/api/user-setting/user-setting.events.js index 49ed3da..7b82444 100644 --- a/server/api/user-setting/user-setting.events.js +++ b/server/api/user-setting/user-setting.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xad8b=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x484b24,_0x5f34ad){var _0x379fbb=function(_0x138c14){while(--_0x138c14){_0x484b24['push'](_0x484b24['shift']());}};_0x379fbb(++_0x5f34ad);}(_0xad8b,0x1e4));var _0xbad8=function(_0x113974,_0x4850e4){_0x113974=_0x113974-0x0;var _0x1b242f=_0xad8b[_0x113974];return _0x1b242f;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0xbad8('0x0'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xbad8('0x1')](0x0);var events={'afterCreate':_0xbad8('0x2'),'afterUpdate':_0xbad8('0x3'),'afterDestroy':_0xbad8('0x4')};function emitEvent(_0x4670fc){return function(_0x15d7df,_0x3f1ddb,_0x310df9){UserSettingEvents[_0xbad8('0x5')](_0x4670fc+':'+_0x15d7df['id'],_0x15d7df);UserSettingEvents['emit'](_0x4670fc,_0x15d7df);_0x310df9(null);};}for(var e in events){if(events[_0xbad8('0x6')](e)){var event=events[e];UserSetting[_0xbad8('0x7')](e,emitEvent(event));}}module[_0xbad8('0x8')]=UserSettingEvents; \ No newline at end of file +var _0x4552=['events','../../mysqldb','save','emit','hasOwnProperty','hook','exports'];(function(_0x499eec,_0x2f6b9e){var _0x54c8bf=function(_0x1ab6a3){while(--_0x1ab6a3){_0x499eec['push'](_0x499eec['shift']());}};_0x54c8bf(++_0x2f6b9e);}(_0x4552,0x69));var _0x2455=function(_0x120168,_0x582418){_0x120168=_0x120168-0x0;var _0x2d30c2=_0x4552[_0x120168];return _0x2d30c2;};'use strict';var EventEmitter=require(_0x2455('0x0'));var UserSetting=require(_0x2455('0x1'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2455('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x198bf9){return function(_0x190a14,_0x3b0b45,_0x143a56){UserSettingEvents[_0x2455('0x3')](_0x198bf9+':'+_0x190a14['id'],_0x190a14);UserSettingEvents[_0x2455('0x3')](_0x198bf9,_0x190a14);_0x143a56(null);};}for(var e in events){if(events[_0x2455('0x4')](e)){var event=events[e];UserSetting[_0x2455('0x5')](e,emitEvent(event));}}module[_0x2455('0x6')]=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index bd26005..22c4a37 100644 --- a/server/api/user-setting/user-setting.model.js +++ b/server/api/user-setting/user-setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7980=['UserSetting','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports','define'];(function(_0x706eb3,_0x2304c3){var _0x34a6e6=function(_0x4e52a5){while(--_0x4e52a5){_0x706eb3['push'](_0x706eb3['shift']());}};_0x34a6e6(++_0x2304c3);}(_0x7980,0xab));var _0x0798=function(_0x44fcdb,_0x1e9a76){_0x44fcdb=_0x44fcdb-0x0;var _0x30b086=_0x7980[_0x44fcdb];return _0x30b086;};'use strict';var attributes=require(_0x0798('0x0'));module[_0x0798('0x1')]=function(_0x2c2c4e){return _0x2c2c4e[_0x0798('0x2')](_0x0798('0x3'),attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3a9ff7){if(!_0x3a9ff7[_0x0798('0x4')])_0x3a9ff7[_0x0798('0x5')]=null;else if(_0x3a9ff7[_0x0798('0x5')]===null)_0x3a9ff7[_0x0798('0x5')]=new Date();}}});}; \ No newline at end of file +var _0x8c7a=['./user-setting.attributes','define','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince'];(function(_0x4a3ae6,_0xa4130b){var _0x2503a6=function(_0x1c7303){while(--_0x1c7303){_0x4a3ae6['push'](_0x4a3ae6['shift']());}};_0x2503a6(++_0xa4130b);}(_0x8c7a,0x8c));var _0xa8c7=function(_0x3a342e,_0x3ca937){_0x3a342e=_0x3a342e-0x0;var _0x176e7f=_0x8c7a[_0x3a342e];return _0x176e7f;};'use strict';var attributes=require(_0xa8c7('0x0'));module['exports']=function(_0x514b45){return _0x514b45[_0xa8c7('0x1')]('UserSetting',attributes,{'tableName':_0xa8c7('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3bf4c4){if(!_0x3bf4c4[_0xa8c7('0x3')])_0x3bf4c4['clientSideLoggingEnabledSince']=null;else if(_0x3bf4c4['clientSideLoggingEnabledSince']===null)_0x3bf4c4[_0xa8c7('0x4')]=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index b202c5b..342fcc8 100644 --- a/server/api/user-setting/user-setting.socket.js +++ b/server/api/user-setting/user-setting.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x36b1=['register','user-setting:','./user-setting.events','save','remove','emit','user-setting:update:user-','UserId'];(function(_0x3699c7,_0x100180){var _0x34767c=function(_0x45c0ed){while(--_0x45c0ed){_0x3699c7['push'](_0x3699c7['shift']());}};_0x34767c(++_0x100180);}(_0x36b1,0x1aa));var _0x136b=function(_0x1a3ff5,_0x5eecbd){_0x1a3ff5=_0x1a3ff5-0x0;var _0x339f6b=_0x36b1[_0x1a3ff5];return _0x339f6b;};'use strict';var UserSettingEvents=require(_0x136b('0x0'));var events=[_0x136b('0x1'),_0x136b('0x2'),'update'];function createListener(_0x4a8986,_0x4f42e8){return function(_0x4d0907){_0x4f42e8[_0x136b('0x3')](_0x4a8986,_0x4d0907);if(_0x4a8986==='user-setting:update'){_0x4f42e8[_0x136b('0x3')](_0x136b('0x4')+_0x4d0907[_0x136b('0x5')],_0x4d0907);}};}exports[_0x136b('0x6')]=function(_0x5a8f24){for(var _0xb6691a=0x0,_0x23d223=events['length'];_0xb6691a<_0x23d223;_0xb6691a++){var _0x3e946d=events[_0xb6691a];var _0x1b43fd=createListener(_0x136b('0x7')+_0x3e946d,_0x5a8f24);UserSettingEvents['on'](_0x3e946d,_0x1b43fd);}}; \ No newline at end of file +var _0xa5f2=['user-setting:update:user-','UserId','register','length','user-setting:','./user-setting.events','remove','update','user-setting:update'];(function(_0x44e9b4,_0xb46e37){var _0x678351=function(_0x3ec614){while(--_0x3ec614){_0x44e9b4['push'](_0x44e9b4['shift']());}};_0x678351(++_0xb46e37);}(_0xa5f2,0x8c));var _0x2a5f=function(_0x17542e,_0x497c31){_0x17542e=_0x17542e-0x0;var _0x28c798=_0xa5f2[_0x17542e];return _0x28c798;};'use strict';var UserSettingEvents=require(_0x2a5f('0x0'));var events=['save',_0x2a5f('0x1'),_0x2a5f('0x2')];function createListener(_0x5b4d72,_0x1a577d){return function(_0x2705c8){_0x1a577d['emit'](_0x5b4d72,_0x2705c8);if(_0x5b4d72===_0x2a5f('0x3')){_0x1a577d['emit'](_0x2a5f('0x4')+_0x2705c8[_0x2a5f('0x5')],_0x2705c8);}};}exports[_0x2a5f('0x6')]=function(_0x1da467){for(var _0x515b36=0x0,_0xf10906=events[_0x2a5f('0x7')];_0x515b36<_0xf10906;_0x515b36++){var _0x54dff2=events[_0x515b36];var _0x419a60=createListener(_0x2a5f('0x8')+_0x54dff2,_0x1da467);UserSettingEvents['on'](_0x54dff2,_0x419a60);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 7576875..177de03 100644 --- a/server/api/user/index.js +++ b/server/api/user/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd237=['getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','getApiKey','post','/:id/contacts','/create_many','bulkCreate','diskStorage','root','server/files/images/','now','single','addAvatar','/:id/login','/:id/logout','pause','/:id/unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','addFaxAccounts','addMailAccounts','/:id/chat_websites','addWhatsappAccounts','/:id/api_key','createApiKey','update','put','/:id/password','removeQueues','delete','destroy','removeChatInteractions','removeMailInteractions','/:id/fax_interactions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','/:id/whatsapp_interactions','removeFaxAccounts','/:id/openchannel_accounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','messengerSoundNotification','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','/describe','describe','/whoami','isAuthenticated','whoami','getPresence','/:id','show','/:id/avatar','getAvatar','getOpenTabs','/:id/queues'];(function(_0x24392f,_0x15a3e5){var _0x591e33=function(_0xe0ccea){while(--_0xe0ccea){_0x24392f['push'](_0x24392f['shift']());}};_0x591e33(++_0x15a3e5);}(_0xd237,0x12b));var _0x7d23=function(_0x1f1eee,_0x2f10af){_0x1f1eee=_0x1f1eee-0x0;var _0x325e75=_0xd237[_0x1f1eee];return _0x325e75;};'use strict';var multer=require(_0x7d23('0x0'));var util=require(_0x7d23('0x1'));var path=require(_0x7d23('0x2'));var timeout=require(_0x7d23('0x3'));var express=require('express');var router=express[_0x7d23('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7d23('0x5'));var interaction=require(_0x7d23('0x6'));var config=require(_0x7d23('0x7'));var controller=require(_0x7d23('0x8'));router[_0x7d23('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7d23('0x9')](_0x7d23('0xa'),auth['isAuthenticated'](),controller[_0x7d23('0xb')]);router[_0x7d23('0x9')](_0x7d23('0xc'),auth[_0x7d23('0xd')](),controller[_0x7d23('0xe')]);router[_0x7d23('0x9')]('/presence',auth[_0x7d23('0xd')](),controller[_0x7d23('0xf')]);router[_0x7d23('0x9')](_0x7d23('0x10'),auth['isAuthenticated'](),controller[_0x7d23('0x11')]);router[_0x7d23('0x9')](_0x7d23('0x12'),controller[_0x7d23('0x13')]);router[_0x7d23('0x9')]('/:id/open_tabs',auth[_0x7d23('0xd')](),controller[_0x7d23('0x14')]);router[_0x7d23('0x9')]('/:id/contacts',auth[_0x7d23('0xd')](),controller['getContacts']);router[_0x7d23('0x9')](_0x7d23('0x15'),auth[_0x7d23('0xd')](),controller[_0x7d23('0x16')]);router[_0x7d23('0x9')](_0x7d23('0x17'),auth[_0x7d23('0xd')](),controller[_0x7d23('0x18')]);router[_0x7d23('0x9')](_0x7d23('0x19'),auth['isAuthenticated'](),controller[_0x7d23('0x1a')]);router[_0x7d23('0x9')](_0x7d23('0x1b'),auth[_0x7d23('0xd')](),controller[_0x7d23('0x1c')]);router['get'](_0x7d23('0x1d'),auth['isAuthenticated'](),controller[_0x7d23('0x1e')]);router[_0x7d23('0x9')](_0x7d23('0x1f'),auth[_0x7d23('0xd')](),controller[_0x7d23('0x20')]);router[_0x7d23('0x9')](_0x7d23('0x21'),auth[_0x7d23('0xd')](),controller[_0x7d23('0x22')]);router['get'](_0x7d23('0x23'),auth['isAuthenticated'](),controller[_0x7d23('0x24')]);router['get']('/:id/sms/interactions',auth[_0x7d23('0xd')](),controller['getSmsInteractions']);router['get']('/:id/fax/interactions',auth[_0x7d23('0xd')](),controller['getFaxInteractions']);router[_0x7d23('0x9')]('/:id/whatsapp/interactions',auth['isAuthenticated'](),controller[_0x7d23('0x25')]);router[_0x7d23('0x9')](_0x7d23('0x26'),auth[_0x7d23('0xd')](),controller[_0x7d23('0x27')]);router['get'](_0x7d23('0x28'),auth[_0x7d23('0xd')](),controller[_0x7d23('0x29')]);router['get'](_0x7d23('0x2a'),auth['isAuthenticated'](),controller[_0x7d23('0x2b')]);router[_0x7d23('0x9')](_0x7d23('0x2c'),auth[_0x7d23('0xd')](),controller[_0x7d23('0x2d')]);router[_0x7d23('0x9')](_0x7d23('0x2e'),auth['isAuthenticated'](),controller[_0x7d23('0x2f')]);router['get'](_0x7d23('0x30'),auth['isAuthenticated'](),controller[_0x7d23('0x31')]);router[_0x7d23('0x9')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0x7d23('0x32')]);router['get'](_0x7d23('0x33'),auth[_0x7d23('0xd')](),controller[_0x7d23('0x34')]);router[_0x7d23('0x9')]('/:id/chat_websites',auth[_0x7d23('0xd')](),controller[_0x7d23('0x35')]);router['get'](_0x7d23('0x36'),auth['isAuthenticated'](),controller[_0x7d23('0x37')]);router[_0x7d23('0x9')]('/:id/scheduled_calls',auth[_0x7d23('0xd')](),controller['getScheduledCalls']);router[_0x7d23('0x9')]('/:id/api_key',auth['isAuthenticated'](),controller[_0x7d23('0x38')]);router[_0x7d23('0x39')](_0x7d23('0x3a'),auth['isAuthenticated'](),controller['addContacts']);router[_0x7d23('0x39')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7d23('0x39')](_0x7d23('0x3b'),auth['isAuthenticated'](),controller[_0x7d23('0x3c')]);router[_0x7d23('0x39')]('/:id/queues',auth[_0x7d23('0xd')](),controller['addQueues']);var upload=multer({'storage':multer[_0x7d23('0x3d')]({'destination':function(_0x53a10f,_0x3c7c95,_0x24c787){_0x24c787(null,path['join'](config[_0x7d23('0x3e')],_0x7d23('0x3f')));},'filename':function(_0xaf83ad,_0x16799b,_0x240f6e){_0x240f6e(null,util['format']('%s-%s',Date[_0x7d23('0x40')](),_0x16799b['originalname']));}})});router[_0x7d23('0x39')](_0x7d23('0x12'),upload[_0x7d23('0x41')]('file'),controller[_0x7d23('0x42')]);router[_0x7d23('0x39')](_0x7d23('0x43'),auth[_0x7d23('0xd')](),controller['login']);router['post'](_0x7d23('0x44'),auth['isAuthenticated'](),controller['logout']);router[_0x7d23('0x39')]('/:id/pause',auth['isAuthenticated'](),controller[_0x7d23('0x45')]);router[_0x7d23('0x39')](_0x7d23('0x46'),auth[_0x7d23('0xd')](),controller['unpause']);router[_0x7d23('0x39')](_0x7d23('0x26'),auth[_0x7d23('0xd')](),controller[_0x7d23('0x47')]);router[_0x7d23('0x39')](_0x7d23('0x48'),auth[_0x7d23('0xd')](),controller[_0x7d23('0x49')]);router[_0x7d23('0x39')](_0x7d23('0x4a'),auth[_0x7d23('0xd')](),controller[_0x7d23('0x4b')]);router[_0x7d23('0x39')]('/:id/fax_interactions',auth[_0x7d23('0xd')](),controller[_0x7d23('0x4c')]);router[_0x7d23('0x39')](_0x7d23('0x4d'),auth[_0x7d23('0xd')](),controller['addSmsInteractions']);router[_0x7d23('0x39')](_0x7d23('0x4e'),auth[_0x7d23('0xd')](),controller[_0x7d23('0x4f')]);router[_0x7d23('0x39')]('/:id/whatsapp_interactions',auth['isAuthenticated'](),controller['addWhatsappInteractions']);router[_0x7d23('0x39')](_0x7d23('0x2e'),auth[_0x7d23('0xd')](),controller[_0x7d23('0x50')]);router['post']('/:id/mail_accounts',auth[_0x7d23('0xd')](),controller[_0x7d23('0x51')]);router[_0x7d23('0x39')]('/:id/openchannel_accounts',auth[_0x7d23('0xd')](),controller['addOpenchannelAccounts']);router[_0x7d23('0x39')](_0x7d23('0x33'),auth[_0x7d23('0xd')](),controller['addSmsAccounts']);router[_0x7d23('0x39')](_0x7d23('0x52'),auth[_0x7d23('0xd')](),controller['addChatWebsites']);router[_0x7d23('0x39')](_0x7d23('0x36'),auth[_0x7d23('0xd')](),controller[_0x7d23('0x53')]);router['post'](_0x7d23('0x54'),auth['isAuthenticated'](),controller[_0x7d23('0x55')]);router['put'](_0x7d23('0x10'),auth[_0x7d23('0xd')](),controller[_0x7d23('0x56')]);router[_0x7d23('0x57')](_0x7d23('0x58'),auth[_0x7d23('0xd')](),controller['changePassword']);router['delete']('/:id/queues',auth[_0x7d23('0xd')](),controller[_0x7d23('0x59')]);router[_0x7d23('0x5a')](_0x7d23('0x26'),auth['isAuthenticated'](),controller['removeTeams']);router['delete'](_0x7d23('0x10'),auth['isAuthenticated'](),controller[_0x7d23('0x5b')]);router[_0x7d23('0x5a')](_0x7d23('0x48'),auth['isAuthenticated'](),controller[_0x7d23('0x5c')]);router[_0x7d23('0x5a')](_0x7d23('0x4a'),auth[_0x7d23('0xd')](),controller[_0x7d23('0x5d')]);router[_0x7d23('0x5a')](_0x7d23('0x5e'),auth[_0x7d23('0xd')](),controller[_0x7d23('0x5f')]);router[_0x7d23('0x5a')](_0x7d23('0x4d'),auth['isAuthenticated'](),controller[_0x7d23('0x60')]);router[_0x7d23('0x5a')](_0x7d23('0x4e'),auth[_0x7d23('0xd')](),controller[_0x7d23('0x61')]);router['delete'](_0x7d23('0x62'),auth[_0x7d23('0xd')](),controller['removeWhatsappInteractions']);router[_0x7d23('0x5a')]('/:id/fax_accounts',auth[_0x7d23('0xd')](),controller[_0x7d23('0x63')]);router['delete'](_0x7d23('0x30'),auth[_0x7d23('0xd')](),controller['removeMailAccounts']);router[_0x7d23('0x5a')](_0x7d23('0x64'),auth[_0x7d23('0xd')](),controller['removeOpenchannelAccounts']);router['delete'](_0x7d23('0x33'),auth[_0x7d23('0xd')](),controller[_0x7d23('0x65')]);router[_0x7d23('0x5a')](_0x7d23('0x52'),auth[_0x7d23('0xd')](),controller[_0x7d23('0x66')]);router['delete'](_0x7d23('0x36'),auth[_0x7d23('0xd')](),controller[_0x7d23('0x67')]);router[_0x7d23('0x5a')](_0x7d23('0x54'),auth[_0x7d23('0xd')](),controller[_0x7d23('0x68')]);router[_0x7d23('0x39')]('/:id/messengerSoundNotification',auth[_0x7d23('0xd')](),controller[_0x7d23('0x69')]);module[_0x7d23('0x6a')]=router; \ No newline at end of file +var _0xfb67=['removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeWhatsappAccounts','/:id/messengerSoundNotification','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','/describe','/whoami','whoami','/presence','getPresence','/:id','show','getAvatar','/:id/open_tabs','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','/:id/sms/interactions','/:id/teams','getTeams','/:id/agents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','getScheduledCalls','/:id/api_key','post','/:id/contacts','addContacts','create','/create_many','addQueues','root','server/files/images/','format','originalname','/:id/avatar','single','login','/:id/logout','logout','/:id/pause','unpause','addTeams','/:id/chat_interactions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','createApiKey','put','update','/:id/password','changePassword','delete','removeTeams','destroy','removeChatInteractions','/:id/mail_interactions'];(function(_0x48e395,_0xf8a3b6){var _0x2e69b5=function(_0x166bdb){while(--_0x166bdb){_0x48e395['push'](_0x48e395['shift']());}};_0x2e69b5(++_0xf8a3b6);}(_0xfb67,0xdd));var _0x7fb6=function(_0x5870e4,_0x5b2557){_0x5870e4=_0x5870e4-0x0;var _0x3b8342=_0xfb67[_0x5870e4];return _0x3b8342;};'use strict';var multer=require(_0x7fb6('0x0'));var util=require(_0x7fb6('0x1'));var path=require(_0x7fb6('0x2'));var timeout=require(_0x7fb6('0x3'));var express=require(_0x7fb6('0x4'));var router=express[_0x7fb6('0x5')]();var fs_extra=require(_0x7fb6('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x7fb6('0x7'));var config=require(_0x7fb6('0x8'));var controller=require(_0x7fb6('0x9'));router[_0x7fb6('0xa')]('/',auth[_0x7fb6('0xb')](),controller['index']);router[_0x7fb6('0xa')](_0x7fb6('0xc'),auth[_0x7fb6('0xb')](),controller['describe']);router[_0x7fb6('0xa')](_0x7fb6('0xd'),auth['isAuthenticated'](),controller[_0x7fb6('0xe')]);router[_0x7fb6('0xa')](_0x7fb6('0xf'),auth['isAuthenticated'](),controller[_0x7fb6('0x10')]);router['get'](_0x7fb6('0x11'),auth[_0x7fb6('0xb')](),controller[_0x7fb6('0x12')]);router[_0x7fb6('0xa')]('/:id/avatar',controller[_0x7fb6('0x13')]);router[_0x7fb6('0xa')](_0x7fb6('0x14'),auth['isAuthenticated'](),controller['getOpenTabs']);router['get']('/:id/contacts',auth['isAuthenticated'](),controller['getContacts']);router[_0x7fb6('0xa')](_0x7fb6('0x15'),auth['isAuthenticated'](),controller[_0x7fb6('0x16')]);router[_0x7fb6('0xa')](_0x7fb6('0x17'),auth[_0x7fb6('0xb')](),controller[_0x7fb6('0x18')]);router[_0x7fb6('0xa')](_0x7fb6('0x19'),auth[_0x7fb6('0xb')](),controller[_0x7fb6('0x1a')]);router[_0x7fb6('0xa')](_0x7fb6('0x1b'),auth[_0x7fb6('0xb')](),controller['getRecordings']);router[_0x7fb6('0xa')](_0x7fb6('0x1c'),auth[_0x7fb6('0xb')](),controller[_0x7fb6('0x1d')]);router[_0x7fb6('0xa')](_0x7fb6('0x1e'),auth[_0x7fb6('0xb')](),controller['getChatInteractions']);router['get'](_0x7fb6('0x1f'),auth[_0x7fb6('0xb')](),controller[_0x7fb6('0x20')]);router[_0x7fb6('0xa')]('/:id/mail/interactions',auth[_0x7fb6('0xb')](),controller[_0x7fb6('0x21')]);router['get'](_0x7fb6('0x22'),auth['isAuthenticated'](),controller['getSmsInteractions']);router[_0x7fb6('0xa')]('/:id/fax/interactions',auth['isAuthenticated'](),controller['getFaxInteractions']);router[_0x7fb6('0xa')]('/:id/whatsapp/interactions',auth[_0x7fb6('0xb')](),controller['getWhatsappInteractions']);router[_0x7fb6('0xa')](_0x7fb6('0x23'),auth[_0x7fb6('0xb')](),controller[_0x7fb6('0x24')]);router[_0x7fb6('0xa')]('/:id/lists',auth[_0x7fb6('0xb')](),controller['getLists']);router[_0x7fb6('0xa')](_0x7fb6('0x25'),auth['isAuthenticated'](),controller['getAgents']);router['get'](_0x7fb6('0x26'),auth[_0x7fb6('0xb')](),controller[_0x7fb6('0x27')]);router[_0x7fb6('0xa')](_0x7fb6('0x28'),auth[_0x7fb6('0xb')](),controller['getFaxAccounts']);router[_0x7fb6('0xa')]('/:id/mail_accounts',auth[_0x7fb6('0xb')](),controller[_0x7fb6('0x29')]);router[_0x7fb6('0xa')](_0x7fb6('0x2a'),auth[_0x7fb6('0xb')](),controller[_0x7fb6('0x2b')]);router[_0x7fb6('0xa')](_0x7fb6('0x2c'),auth[_0x7fb6('0xb')](),controller['getSmsAccounts']);router[_0x7fb6('0xa')](_0x7fb6('0x2d'),auth[_0x7fb6('0xb')](),controller[_0x7fb6('0x2e')]);router[_0x7fb6('0xa')](_0x7fb6('0x2f'),auth[_0x7fb6('0xb')](),controller[_0x7fb6('0x30')]);router[_0x7fb6('0xa')]('/:id/scheduled_calls',auth[_0x7fb6('0xb')](),controller[_0x7fb6('0x31')]);router[_0x7fb6('0xa')](_0x7fb6('0x32'),auth['isAuthenticated'](),controller['getApiKey']);router[_0x7fb6('0x33')](_0x7fb6('0x34'),auth[_0x7fb6('0xb')](),controller[_0x7fb6('0x35')]);router[_0x7fb6('0x33')]('/',auth['isAuthenticated'](),controller[_0x7fb6('0x36')]);router[_0x7fb6('0x33')](_0x7fb6('0x37'),auth[_0x7fb6('0xb')](),controller['bulkCreate']);router[_0x7fb6('0x33')](_0x7fb6('0x15'),auth['isAuthenticated'](),controller[_0x7fb6('0x38')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x379f07,_0x5eb431,_0xdc9375){_0xdc9375(null,path['join'](config[_0x7fb6('0x39')],_0x7fb6('0x3a')));},'filename':function(_0xbf8c2d,_0x41580b,_0x40a850){_0x40a850(null,util[_0x7fb6('0x3b')]('%s-%s',Date['now'](),_0x41580b[_0x7fb6('0x3c')]));}})});router[_0x7fb6('0x33')](_0x7fb6('0x3d'),upload[_0x7fb6('0x3e')]('file'),controller['addAvatar']);router[_0x7fb6('0x33')]('/:id/login',auth[_0x7fb6('0xb')](),controller[_0x7fb6('0x3f')]);router[_0x7fb6('0x33')](_0x7fb6('0x40'),auth[_0x7fb6('0xb')](),controller[_0x7fb6('0x41')]);router[_0x7fb6('0x33')](_0x7fb6('0x42'),auth['isAuthenticated'](),controller['pause']);router[_0x7fb6('0x33')]('/:id/unpause',auth[_0x7fb6('0xb')](),controller[_0x7fb6('0x43')]);router[_0x7fb6('0x33')](_0x7fb6('0x23'),auth[_0x7fb6('0xb')](),controller[_0x7fb6('0x44')]);router[_0x7fb6('0x33')](_0x7fb6('0x45'),auth['isAuthenticated'](),controller['addChatInteractions']);router[_0x7fb6('0x33')]('/:id/mail_interactions',auth[_0x7fb6('0xb')](),controller['addMailInteractions']);router[_0x7fb6('0x33')](_0x7fb6('0x46'),auth['isAuthenticated'](),controller[_0x7fb6('0x47')]);router[_0x7fb6('0x33')](_0x7fb6('0x48'),auth[_0x7fb6('0xb')](),controller[_0x7fb6('0x49')]);router[_0x7fb6('0x33')](_0x7fb6('0x4a'),auth[_0x7fb6('0xb')](),controller[_0x7fb6('0x4b')]);router['post'](_0x7fb6('0x4c'),auth['isAuthenticated'](),controller[_0x7fb6('0x4d')]);router[_0x7fb6('0x33')]('/:id/fax_accounts',auth[_0x7fb6('0xb')](),controller[_0x7fb6('0x4e')]);router[_0x7fb6('0x33')]('/:id/mail_accounts',auth[_0x7fb6('0xb')](),controller[_0x7fb6('0x4f')]);router[_0x7fb6('0x33')](_0x7fb6('0x2a'),auth[_0x7fb6('0xb')](),controller[_0x7fb6('0x50')]);router[_0x7fb6('0x33')](_0x7fb6('0x2c'),auth[_0x7fb6('0xb')](),controller[_0x7fb6('0x51')]);router['post'](_0x7fb6('0x2d'),auth['isAuthenticated'](),controller[_0x7fb6('0x52')]);router['post'](_0x7fb6('0x2f'),auth['isAuthenticated'](),controller[_0x7fb6('0x53')]);router[_0x7fb6('0x33')]('/:id/api_key',auth[_0x7fb6('0xb')](),controller[_0x7fb6('0x54')]);router[_0x7fb6('0x55')](_0x7fb6('0x11'),auth[_0x7fb6('0xb')](),controller[_0x7fb6('0x56')]);router[_0x7fb6('0x55')](_0x7fb6('0x57'),auth[_0x7fb6('0xb')](),controller[_0x7fb6('0x58')]);router[_0x7fb6('0x59')](_0x7fb6('0x15'),auth['isAuthenticated'](),controller['removeQueues']);router[_0x7fb6('0x59')]('/:id/teams',auth[_0x7fb6('0xb')](),controller[_0x7fb6('0x5a')]);router[_0x7fb6('0x59')](_0x7fb6('0x11'),auth['isAuthenticated'](),controller[_0x7fb6('0x5b')]);router[_0x7fb6('0x59')](_0x7fb6('0x45'),auth['isAuthenticated'](),controller[_0x7fb6('0x5c')]);router[_0x7fb6('0x59')](_0x7fb6('0x5d'),auth['isAuthenticated'](),controller[_0x7fb6('0x5e')]);router['delete'](_0x7fb6('0x46'),auth[_0x7fb6('0xb')](),controller[_0x7fb6('0x5f')]);router[_0x7fb6('0x59')](_0x7fb6('0x48'),auth['isAuthenticated'](),controller[_0x7fb6('0x60')]);router[_0x7fb6('0x59')](_0x7fb6('0x4a'),auth[_0x7fb6('0xb')](),controller[_0x7fb6('0x61')]);router['delete'](_0x7fb6('0x4c'),auth[_0x7fb6('0xb')](),controller[_0x7fb6('0x62')]);router['delete'](_0x7fb6('0x28'),auth[_0x7fb6('0xb')](),controller[_0x7fb6('0x63')]);router[_0x7fb6('0x59')]('/:id/mail_accounts',auth[_0x7fb6('0xb')](),controller['removeMailAccounts']);router[_0x7fb6('0x59')](_0x7fb6('0x2a'),auth[_0x7fb6('0xb')](),controller[_0x7fb6('0x64')]);router[_0x7fb6('0x59')]('/:id/sms_accounts',auth[_0x7fb6('0xb')](),controller[_0x7fb6('0x65')]);router['delete'](_0x7fb6('0x2d'),auth[_0x7fb6('0xb')](),controller['removeChatWebsites']);router[_0x7fb6('0x59')](_0x7fb6('0x2f'),auth['isAuthenticated'](),controller[_0x7fb6('0x66')]);router[_0x7fb6('0x59')](_0x7fb6('0x32'),auth[_0x7fb6('0xb')](),controller['removeApiKey']);router[_0x7fb6('0x33')](_0x7fb6('0x67'),auth['isAuthenticated'](),controller['messengerSoundNotification']);module[_0x7fb6('0x68')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index ca21e8c..f026b52 100644 --- a/server/api/user/user.attributes.js +++ b/server/api/user/user.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3488=['blocked','blockedAt','loginAttempts','UNSIGNED','util','lodash','exports','STRING','setDataValue','name','defaultuser','fullname','callerid','\x22%s\x22\x20<%s>','getDataValue','internal','email','ENUM','admin','telephone','local','INTEGER','accountcode','BOOLEAN','DATE','dynamic','friend','user','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','join','transport','split','rfc2833','info','shortinfo','inband','auto','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','yes','insecure','never','\x22\x22\x20<>','always','accept','refuse','originate','uas','active','passive','update,nonat','TEXT','showWebBar','get','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','wss','encryption','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording'];(function(_0x1ab180,_0x382b2c){var _0xfb2c2d=function(_0x1c5fd3){while(--_0x1c5fd3){_0x1ab180['push'](_0x1ab180['shift']());}};_0xfb2c2d(++_0x382b2c);}(_0x3488,0x168));var _0x8348=function(_0x2a613c,_0x2d4228){_0x2a613c=_0x2a613c-0x0;var _0x1f024f=_0x3488[_0x2a613c];return _0x1f024f;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var util=require(_0x8348('0x0'));var _=require(_0x8348('0x1'));module[_0x8348('0x2')]={'name':{'type':Sequelize[_0x8348('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x5e348b){this[_0x8348('0x4')](_0x8348('0x5'),_0x5e348b);this[_0x8348('0x4')](_0x8348('0x6'),_0x5e348b);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x4e0e6c){this[_0x8348('0x4')](_0x8348('0x7'),_0x4e0e6c);this[_0x8348('0x4')](_0x8348('0x8'),util['format'](_0x8348('0x9'),_0x4e0e6c,this[_0x8348('0xa')](_0x8348('0xb'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x8348('0x3')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x2eb2f7){if(_0x2eb2f7){this['setDataValue'](_0x8348('0xc'),_0x2eb2f7['toLowerCase']());}}},'role':{'type':Sequelize[_0x8348('0xd')](_0x8348('0xe'),'user','agent',_0x8348('0xf')),'allowNull':![]},'password':{'type':Sequelize[_0x8348('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x8348('0x3')],'defaultValue':_0x8348('0x10')},'internal':{'type':Sequelize[_0x8348('0x11')](0xb),'allowNull':![],'unique':_0x8348('0xb'),'set':function(_0x4f0fb5){this['setDataValue']('internal',_0x4f0fb5);this[_0x8348('0x4')](_0x8348('0x12'),_0x4f0fb5);this[_0x8348('0x4')](_0x8348('0x8'),util['format']('\x22%s\x22\x20<%s>',this[_0x8348('0xa')](_0x8348('0x7')),_0x4f0fb5));}},'salt':{'type':Sequelize[_0x8348('0x3')]},'phone':{'type':Sequelize[_0x8348('0x3')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x8348('0x3')]},'zipcode':{'type':Sequelize[_0x8348('0x3')]},'userpic':{'type':Sequelize[_0x8348('0x3')]},'city':{'type':Sequelize[_0x8348('0x3')]},'country':{'type':Sequelize[_0x8348('0x3')]},'online':{'type':Sequelize[_0x8348('0x13')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x8348('0x13')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x8348('0x13')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x8348('0x13')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x8348('0x13')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x8348('0x13')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x8348('0x13')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x8348('0x3')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x8348('0x14')]},'chatCapacity':{'type':Sequelize[_0x8348('0x11')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x8348('0x11')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x8348('0x11')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x8348('0x11')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x8348('0x11')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x8348('0x13')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x8348('0x11')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x8348('0x11')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x8348('0x13')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x8348('0x11')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x8348('0x13')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x8348('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0x8348('0x3')],'allowNull':!![],'defaultValue':_0x8348('0x15')},'ipaddr':{'type':Sequelize[_0x8348('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x8348('0x11')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0x8348('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x8348('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x8348('0x11')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x8348('0xd')](_0x8348('0x16'),_0x8348('0x17'),'peer'),'allowNull':!![],'defaultValue':_0x8348('0x16')},'context':{'type':Sequelize[_0x8348('0x3')],'allowNull':!![],'defaultValue':_0x8348('0x18')},'callingpres':{'type':Sequelize[_0x8348('0xd')](_0x8348('0x19'),_0x8348('0x1a'),_0x8348('0x1b'),_0x8348('0x1c'),'PROHIB_NOT_SCREENED',_0x8348('0x1d'),_0x8348('0x1e'),_0x8348('0x1f')),'allowNull':!![]},'deny':{'type':Sequelize[_0x8348('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x8348('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x8348('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x8348('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x8348('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x8348('0x3')],'allowNull':!![],'defaultValue':_0x8348('0x20'),'set':function(_0x2b31b1){this[_0x8348('0x4')]('transport',_0x2b31b1?_0x2b31b1[_0x8348('0x21')](','):null);},'get':function(){return this[_0x8348('0xa')](_0x8348('0x22'))?this['getDataValue'](_0x8348('0x22'))[_0x8348('0x23')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0x8348('0x24'),_0x8348('0x25'),_0x8348('0x26'),_0x8348('0x27'),_0x8348('0x28')),'allowNull':!![],'defaultValue':_0x8348('0x24')},'directmedia':{'type':Sequelize[_0x8348('0xd')]('yes','no',_0x8348('0x29'),_0x8348('0x2a'),_0x8348('0x2b')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x8348('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x8348('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x8348('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x8348('0x2c'),'set':function(_0x798501){this[_0x8348('0x4')](_0x8348('0x2d'),_0x798501?_0x798501[_0x8348('0x21')](','):null);},'get':function(){return this[_0x8348('0xa')](_0x8348('0x2d'))?this[_0x8348('0xa')](_0x8348('0x2d'))[_0x8348('0x23')](','):null;},'comment':_0x8348('0x2e')},'callgroup':{'type':Sequelize[_0x8348('0x3')]},'namedcallgroup':{'type':Sequelize[_0x8348('0x3')]},'pickupgroup':{'type':Sequelize[_0x8348('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x8348('0x3')]},'language':{'type':Sequelize[_0x8348('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x8348('0x3')]},'disallow':{'type':Sequelize[_0x8348('0x3')],'allowNull':![],'defaultValue':_0x8348('0x2f')},'allow':{'type':Sequelize[_0x8348('0x3')],'allowNull':![],'defaultValue':_0x8348('0x30'),'set':function(_0x453c99){this[_0x8348('0x4')](_0x8348('0x31'),_0x453c99?_0x453c99[_0x8348('0x21')](';'):_0x8348('0x30'));},'get':function(){return this[_0x8348('0xa')](_0x8348('0x31'))?this[_0x8348('0xa')](_0x8348('0x31'))['split'](';'):null;},'comment':_0x8348('0x32')},'autoframing':{'type':Sequelize[_0x8348('0xd')](_0x8348('0x33'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x8348('0x3')],'allowNull':!![],'set':function(_0xc80fc9){this['setDataValue']('insecure',_0xc80fc9?_0xc80fc9[_0x8348('0x21')](','):null);},'get':function(){return this[_0x8348('0xa')]('insecure')?this[_0x8348('0xa')](_0x8348('0x34'))[_0x8348('0x23')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0x8348('0x33'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x8348('0xd')](_0x8348('0x33'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x8348('0xd')](_0x8348('0x33'),'no',_0x8348('0x35')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x8348('0xd')](_0x8348('0x33'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x8348('0x33'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x8348('0x11')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0x8348('0x3')],'allowNull':!![],'defaultValue':_0x8348('0x36')},'amaflags':{'type':Sequelize[_0x8348('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x8348('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x8348('0x11')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x8348('0xd')](_0x8348('0x33'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x8348('0xd')](_0x8348('0x33'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x8348('0xd')](_0x8348('0x33'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x8348('0xd')](_0x8348('0x33'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x8348('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x8348('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x8348('0xd')](_0x8348('0x33'),'no',_0x8348('0x37')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x8348('0x11')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x8348('0xd')](_0x8348('0x33'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x8348('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x8348('0xd')](_0x8348('0x38'),_0x8348('0x39'),_0x8348('0x3a')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x8348('0x11')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x8348('0x11')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM']('uac',_0x8348('0x3b')),'allowNull':!![],'defaultValue':_0x8348('0x3b')},'t38pt_usertpsource':{'type':Sequelize[_0x8348('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x8348('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x8348('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x8348('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x8348('0xd')](_0x8348('0x33'),'no'),'allowNull':!![],'defaultValue':_0x8348('0x33')},'keepalive':{'type':Sequelize[_0x8348('0x11')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x8348('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x8348('0x11')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x8348('0x11')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x8348('0x11')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x8348('0xd')](_0x8348('0x33'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x8348('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x8348('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x8348('0x11')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x8348('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x8348('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x8348('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x8348('0x11')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x8348('0x33'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x8348('0xd')](_0x8348('0x33'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x8348('0x33'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x8348('0xd')](_0x8348('0x33'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x8348('0x33'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x8348('0xd')](_0x8348('0x33'),'no','fingerprint','certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x8348('0x11')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x8348('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x8348('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x8348('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x8348('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x8348('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x8348('0xd')](_0x8348('0x3c'),_0x8348('0x3d'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x8348('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x8348('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x8348('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x8348('0xd')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x8348('0xd')](_0x8348('0x33'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x8348('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x8348('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x8348('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x8348('0xd')](_0x8348('0x33'),'no',_0x8348('0x29'),_0x8348('0x2a'),_0x8348('0x3e')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x8348('0x13')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x8348('0x3')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x8348('0x14')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x8348('0x3f')]},'showWebBar':{'type':Sequelize[_0x8348('0x11')],'defaultValue':0x0,'set':function(_0x190620){this[_0x8348('0x4')](_0x8348('0x40'),_0x190620);var _0x5df1a8=this[_0x8348('0x41')]({'plain':!![]});switch(_0x190620){case 0x0:case 0x1:var _0x3ce5bf=_0x5df1a8['transport']?_['isArray'](_0x5df1a8[_0x8348('0x22')])?_0x5df1a8[_0x8348('0x22')][_0x8348('0x21')]():_0x5df1a8['transport']:_0x8348('0x20');if(_0x3ce5bf==='wss'){_0x3ce5bf=_0x8348('0x20');}this['setDataValue'](_0x8348('0x22'),_0x3ce5bf);this[_0x8348('0x4')]('encryption','no');this[_0x8348('0x4')](_0x8348('0x42'),null);this['setDataValue'](_0x8348('0x43'),null);this[_0x8348('0x4')](_0x8348('0x44'),null);this['setDataValue'](_0x8348('0x45'),null);this[_0x8348('0x4')](_0x8348('0x46'),null);this[_0x8348('0x4')](_0x8348('0x47'),null);this['setDataValue'](_0x8348('0x48'),null);this[_0x8348('0x4')](_0x8348('0x49'),null);this[_0x8348('0x4')](_0x8348('0x4a'),'no');break;case 0x2:this[_0x8348('0x4')](_0x8348('0x22'),_0x8348('0x4b'));this[_0x8348('0x4')](_0x8348('0x4c'),'yes');this[_0x8348('0x4')](_0x8348('0x42'),_0x8348('0x33'));this[_0x8348('0x4')](_0x8348('0x43'),'yes');this[_0x8348('0x4')](_0x8348('0x44'),_0x8348('0x33'));this[_0x8348('0x4')](_0x8348('0x45'),_0x8348('0x33'));this[_0x8348('0x4')](_0x8348('0x46'),'no');this[_0x8348('0x4')](_0x8348('0x47'),'actpass');this[_0x8348('0x4')](_0x8348('0x48'),_0x5df1a8[_0x8348('0x48')]||_0x8348('0x4d'));this[_0x8348('0x4')](_0x8348('0x49'),_0x5df1a8[_0x8348('0x49')]||_0x8348('0x4e'));this['setDataValue'](_0x8348('0x4a'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0x8348('0x3f')],'set':function(_0x3af950){this[_0x8348('0x4')](_0x8348('0x4f'),_0x3af950?_0x3af950[_0x8348('0x21')](','):[]);},'get':function(){return this[_0x8348('0xa')]('permissions')?_['map'](this['getDataValue'](_0x8348('0x4f'))['split'](','),function(_0x50a19a){return parseInt(_0x50a19a,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x8348('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x8348('0x3')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x8348('0x13')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x8348('0x13')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x8348('0x13')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x8348('0x13')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x8348('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x8348('0x11')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x8348('0xd')](_0x8348('0x33'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x8348('0x13')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x8348('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0x8348('0x13')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x8348('0x13')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('phoneBarEnableScreenRecordingByAgent')?this['getDataValue'](_0x8348('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x8348('0x13')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x8348('0x13')],'defaultValue':![]},'interface':{'type':Sequelize[_0x8348('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x8348('0x13')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x8348('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x210632){if(typeof _0x210632===_0x8348('0x51')){var _0x5028ca=_0x210632==='1'?!![]:_0x210632==='0'?![]:_0x210632===_0x8348('0x52')?!![]:_0x210632===_0x8348('0x53')?![]:![];this[_0x8348('0x4')](_0x8348('0x54'),_0x5028ca);}else{this[_0x8348('0x4')](_0x8348('0x54'),_0x210632);}}},'blocked':{'type':Sequelize[_0x8348('0x13')],'defaultValue':![],'set':function(_0x47e04d){this[_0x8348('0x4')](_0x8348('0x55'),_0x47e04d);if(_0x47e04d===!![]){this[_0x8348('0x4')](_0x8348('0x56'),moment());this[_0x8348('0x4')](_0x8348('0x57'),0x0);}else{this[_0x8348('0x4')](_0x8348('0x56'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x8348('0x11')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x8348('0x13')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x8348('0x11')](0x5)[_0x8348('0x58')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x8348('0x13')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x8348('0x13')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x8348('0x13')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x8348('0x13')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x8348('0x13')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x8348('0x13')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x8348('0x11')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x8348('0x13')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x8348('0x13')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x8348('0x11')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x8348('0x13')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x8348('0x11')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x8348('0x13')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0x8348('0x13')],'defaultValue':![]}}; \ No newline at end of file +var _0xe809=['avpf','force_avp','dtlscertfile','rtcp_mux','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','moment','util','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','user','agent','telephone','BOOLEAN','DATE','DEFAULT\x20PAUSE','INTEGER','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','udp','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','inband','auto','nonat','update','outgoing','yes','nat','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','refuse','originate','uac','uas','active','passive','actpass','TEXT','showWebBar','isArray','wss','encryption'];(function(_0x30ddb8,_0x414c76){var _0x456396=function(_0x52b22b){while(--_0x52b22b){_0x30ddb8['push'](_0x30ddb8['shift']());}};_0x456396(++_0x414c76);}(_0xe809,0x1d8));var _0x9e80=function(_0x47952f,_0x503bf4){_0x47952f=_0x47952f-0x0;var _0x27e659=_0xe809[_0x47952f];return _0x27e659;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x9e80('0x0'));var util=require(_0x9e80('0x1'));var _=require(_0x9e80('0x2'));module[_0x9e80('0x3')]={'name':{'type':Sequelize[_0x9e80('0x4')],'allowNull':![],'unique':_0x9e80('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x5e1a6c){this[_0x9e80('0x6')](_0x9e80('0x5'),_0x5e1a6c);this[_0x9e80('0x6')](_0x9e80('0x7'),_0x5e1a6c);},'comment':_0x9e80('0x8')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x52f756){this[_0x9e80('0x6')](_0x9e80('0x9'),_0x52f756);this[_0x9e80('0x6')](_0x9e80('0xa'),util[_0x9e80('0xb')](_0x9e80('0xc'),_0x52f756,this[_0x9e80('0xd')](_0x9e80('0xe'))));}},'alias':{'type':Sequelize[_0x9e80('0x4')]},'email':{'type':Sequelize[_0x9e80('0x4')],'allowNull':![],'unique':_0x9e80('0xf'),'validate':{'isEmail':!![]},'set':function(_0x3647ed){if(_0x3647ed){this[_0x9e80('0x6')](_0x9e80('0xf'),_0x3647ed[_0x9e80('0x10')]());}}},'role':{'type':Sequelize[_0x9e80('0x11')](_0x9e80('0x12'),_0x9e80('0x13'),_0x9e80('0x14'),_0x9e80('0x15')),'allowNull':![]},'password':{'type':Sequelize[_0x9e80('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x9e80('0x4')],'defaultValue':'local'},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x9e80('0xe'),'set':function(_0x329c8e){this[_0x9e80('0x6')](_0x9e80('0xe'),_0x329c8e);this[_0x9e80('0x6')]('accountcode',_0x329c8e);this['setDataValue']('callerid',util['format']('\x22%s\x22\x20<%s>',this[_0x9e80('0xd')](_0x9e80('0x9')),_0x329c8e));}},'salt':{'type':Sequelize[_0x9e80('0x4')]},'phone':{'type':Sequelize[_0x9e80('0x4')]},'mobile':{'type':Sequelize[_0x9e80('0x4')]},'address':{'type':Sequelize[_0x9e80('0x4')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x9e80('0x4')]},'city':{'type':Sequelize[_0x9e80('0x4')]},'country':{'type':Sequelize[_0x9e80('0x4')]},'online':{'type':Sequelize[_0x9e80('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x9e80('0x17')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x9e80('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x9e80('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x9e80('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x9e80('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x9e80('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x9e80('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x9e80('0x4')],'defaultValue':_0x9e80('0x18')},'lastPauseAt':{'type':Sequelize[_0x9e80('0x17')]},'chatCapacity':{'type':Sequelize[_0x9e80('0x19')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x9e80('0x19')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x9e80('0x19')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x9e80('0x19')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x9e80('0x19')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x9e80('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x9e80('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x9e80('0x19')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x9e80('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x9e80('0x19')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x9e80('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x9e80('0x16')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x9e80('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0x9e80('0x4')],'allowNull':!![],'defaultValue':_0x9e80('0x1a')},'ipaddr':{'type':Sequelize[_0x9e80('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0x9e80('0x19')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x9e80('0x19')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x9e80('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x9e80('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x9e80('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x9e80('0x19')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x9e80('0x11')](_0x9e80('0x1b'),_0x9e80('0x13'),_0x9e80('0x1c')),'allowNull':!![],'defaultValue':_0x9e80('0x1b')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x9e80('0x1d')},'callingpres':{'type':Sequelize[_0x9e80('0x11')](_0x9e80('0x1e'),_0x9e80('0x1f'),_0x9e80('0x20'),'ALLOWED',_0x9e80('0x21'),_0x9e80('0x22'),'PROHIB_FAILED_SCREEN','PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x9e80('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0x9e80('0x4')],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x9e80('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x9e80('0x4')],'allowNull':!![],'defaultValue':_0x9e80('0x23'),'set':function(_0x34f0a4){this['setDataValue'](_0x9e80('0x24'),_0x34f0a4?_0x34f0a4['join'](','):null);},'get':function(){return this[_0x9e80('0xd')](_0x9e80('0x24'))?this[_0x9e80('0xd')](_0x9e80('0x24'))['split'](','):null;},'comment':_0x9e80('0x25')},'dtmfmode':{'type':Sequelize[_0x9e80('0x11')](_0x9e80('0x26'),'info','shortinfo',_0x9e80('0x27'),_0x9e80('0x28')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x9e80('0x11')]('yes','no',_0x9e80('0x29'),_0x9e80('0x2a'),_0x9e80('0x2b')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x9e80('0x11')](_0x9e80('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x9e80('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x9e80('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x9e80('0x4')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x57004c){this[_0x9e80('0x6')](_0x9e80('0x2d'),_0x57004c?_0x57004c[_0x9e80('0x2e')](','):null);},'get':function(){return this[_0x9e80('0xd')](_0x9e80('0x2d'))?this[_0x9e80('0xd')](_0x9e80('0x2d'))[_0x9e80('0x2f')](','):null;},'comment':_0x9e80('0x30')},'callgroup':{'type':Sequelize[_0x9e80('0x4')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x9e80('0x4')]},'namedpickupgroup':{'type':Sequelize[_0x9e80('0x4')]},'language':{'type':Sequelize[_0x9e80('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x9e80('0x4')]},'disallow':{'type':Sequelize[_0x9e80('0x4')],'allowNull':![],'defaultValue':_0x9e80('0x31')},'allow':{'type':Sequelize[_0x9e80('0x4')],'allowNull':![],'defaultValue':_0x9e80('0x32'),'set':function(_0x277638){this['setDataValue']('allow',_0x277638?_0x277638[_0x9e80('0x2e')](';'):_0x9e80('0x32'));},'get':function(){return this[_0x9e80('0xd')](_0x9e80('0x33'))?this[_0x9e80('0xd')](_0x9e80('0x33'))['split'](';'):null;},'comment':_0x9e80('0x34')},'autoframing':{'type':Sequelize[_0x9e80('0x11')](_0x9e80('0x2c'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x9e80('0x4')],'allowNull':!![],'set':function(_0x36b219){this[_0x9e80('0x6')](_0x9e80('0x35'),_0x36b219?_0x36b219[_0x9e80('0x2e')](','):null);},'get':function(){return this[_0x9e80('0xd')]('insecure')?this[_0x9e80('0xd')](_0x9e80('0x35'))[_0x9e80('0x2f')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0x9e80('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x9e80('0x11')](_0x9e80('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x9e80('0x2c'),'no',_0x9e80('0x36')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0x9e80('0x2c'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x9e80('0x11')](_0x9e80('0x2c'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x9e80('0x19')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x9e80('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x9e80('0x4')],'allowNull':!![],'defaultValue':_0x9e80('0x37')},'amaflags':{'type':Sequelize[_0x9e80('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x9e80('0x11')](_0x9e80('0x2c'),'no'),'allowNull':!![],'defaultValue':_0x9e80('0x2c')},'busylevel':{'type':Sequelize[_0x9e80('0x19')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x9e80('0x11')](_0x9e80('0x2c'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x9e80('0x11')]('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x9e80('0x11')](_0x9e80('0x2c'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x9e80('0x11')](_0x9e80('0x2c'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0x9e80('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x9e80('0x11')](_0x9e80('0x2c'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x9e80('0x19')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x9e80('0x2c'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x9e80('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM']('accept',_0x9e80('0x38'),_0x9e80('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x9e80('0x19')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x9e80('0x11')](_0x9e80('0x3a'),_0x9e80('0x3b')),'allowNull':!![],'defaultValue':_0x9e80('0x3b')},'t38pt_usertpsource':{'type':Sequelize[_0x9e80('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x9e80('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x9e80('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x9e80('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x9e80('0x2c'),'no'),'allowNull':!![],'defaultValue':_0x9e80('0x2c')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x9e80('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x9e80('0x19')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x9e80('0x19')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x9e80('0x19')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x9e80('0x11')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x9e80('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x9e80('0x19')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x9e80('0x19')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x9e80('0x19')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x9e80('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x9e80('0x11')](_0x9e80('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x9e80('0x11')](_0x9e80('0x2c'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x9e80('0x11')](_0x9e80('0x2c'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x9e80('0x11')](_0x9e80('0x2c'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x9e80('0x11')](_0x9e80('0x2c'),'no','fingerprint','certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x9e80('0x19')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x9e80('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x9e80('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x9e80('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x9e80('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x9e80('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x9e80('0x11')](_0x9e80('0x3c'),_0x9e80('0x3d'),_0x9e80('0x3e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x9e80('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x9e80('0x11')](_0x9e80('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x9e80('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x9e80('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x9e80('0x19')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x9e80('0x11')](_0x9e80('0x2c'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x9e80('0x11')](_0x9e80('0x2c'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x9e80('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x9e80('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x9e80('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x9e80('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x9e80('0x11')](_0x9e80('0x2c'),'no',_0x9e80('0x29'),_0x9e80('0x2a'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x9e80('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x9e80('0x17')]},'passwordResetAt':{'type':Sequelize[_0x9e80('0x17')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x9e80('0x3f')]},'showWebBar':{'type':Sequelize[_0x9e80('0x19')],'defaultValue':0x0,'set':function(_0x502ba6){this[_0x9e80('0x6')](_0x9e80('0x40'),_0x502ba6);var _0x362f80=this['get']({'plain':!![]});switch(_0x502ba6){case 0x0:case 0x1:var _0x486726=_0x362f80['transport']?_[_0x9e80('0x41')](_0x362f80[_0x9e80('0x24')])?_0x362f80[_0x9e80('0x24')]['join']():_0x362f80['transport']:_0x9e80('0x23');if(_0x486726===_0x9e80('0x42')){_0x486726=_0x9e80('0x23');}this[_0x9e80('0x6')](_0x9e80('0x24'),_0x486726);this[_0x9e80('0x6')](_0x9e80('0x43'),'no');this[_0x9e80('0x6')](_0x9e80('0x44'),null);this[_0x9e80('0x6')](_0x9e80('0x45'),null);this[_0x9e80('0x6')]('icesupport',null);this[_0x9e80('0x6')]('dtlsenable',null);this[_0x9e80('0x6')]('dtlsverify',null);this['setDataValue']('dtlssetup',null);this[_0x9e80('0x6')](_0x9e80('0x46'),null);this['setDataValue']('dtlsprivatekey',null);this[_0x9e80('0x6')](_0x9e80('0x47'),'no');break;case 0x2:this[_0x9e80('0x6')](_0x9e80('0x24'),'wss');this[_0x9e80('0x6')](_0x9e80('0x43'),_0x9e80('0x2c'));this[_0x9e80('0x6')](_0x9e80('0x44'),_0x9e80('0x2c'));this[_0x9e80('0x6')]('force_avp',_0x9e80('0x2c'));this[_0x9e80('0x6')](_0x9e80('0x48'),_0x9e80('0x2c'));this['setDataValue'](_0x9e80('0x49'),'yes');this[_0x9e80('0x6')](_0x9e80('0x4a'),'no');this['setDataValue'](_0x9e80('0x4b'),_0x9e80('0x3e'));this['setDataValue'](_0x9e80('0x46'),_0x362f80['dtlscertfile']||'/etc/pki/tls/certs/motion.crt');this[_0x9e80('0x6')](_0x9e80('0x4c'),_0x362f80['dtlsprivatekey']||_0x9e80('0x4d'));this[_0x9e80('0x6')](_0x9e80('0x47'),_0x9e80('0x2c'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x1df22f){this[_0x9e80('0x6')](_0x9e80('0x4e'),_0x1df22f?_0x1df22f[_0x9e80('0x2e')](','):[]);},'get':function(){return this['getDataValue']('permissions')?_[_0x9e80('0x4f')](this[_0x9e80('0xd')](_0x9e80('0x4e'))['split'](','),function(_0x14df23){return parseInt(_0x14df23,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x9e80('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x9e80('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x9e80('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0x9e80('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x9e80('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x9e80('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x9e80('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x9e80('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x9e80('0x19')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x9e80('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x9e80('0x19')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x9e80('0x11')](_0x9e80('0x2c'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x9e80('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize[_0x9e80('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x9e80('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x9e80('0x50')],'get':function(){return this[_0x9e80('0xd')](_0x9e80('0x51'))?this[_0x9e80('0xd')](_0x9e80('0x51')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x9e80('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x9e80('0x16')],'defaultValue':![]},'interface':{'type':Sequelize[_0x9e80('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x9e80('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x9e80('0x16')],'defaultValue':![],'set':function(_0x143569){if(typeof _0x143569===_0x9e80('0x52')){var _0x6ae66d=_0x143569==='1'?!![]:_0x143569==='0'?![]:_0x143569===_0x9e80('0x53')?!![]:_0x143569===_0x9e80('0x54')?![]:![];this[_0x9e80('0x6')]('screenrecording',_0x6ae66d);}else{this[_0x9e80('0x6')](_0x9e80('0x55'),_0x143569);}}},'blocked':{'type':Sequelize[_0x9e80('0x16')],'defaultValue':![],'set':function(_0x516b05){this[_0x9e80('0x6')](_0x9e80('0x56'),_0x516b05);if(_0x516b05===!![]){this[_0x9e80('0x6')](_0x9e80('0x57'),moment());this[_0x9e80('0x6')](_0x9e80('0x58'),0x0);}else{this[_0x9e80('0x6')](_0x9e80('0x57'),null);}}},'blockedAt':{'type':Sequelize[_0x9e80('0x17')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x9e80('0x16')],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)[_0x9e80('0x59')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x9e80('0x16')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x9e80('0x16')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x9e80('0x16')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x9e80('0x16')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x9e80('0x16')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x9e80('0x16')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x9e80('0x19')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x9e80('0x16')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x9e80('0x19')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x9e80('0x19')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x9e80('0x19')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0x9e80('0x16')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index b136325..ccf8493 100644 --- a/server/api/user/user.controller.js +++ b/server/api/user/user.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbe51=['messengerSoundNotification','enabled','moment','util','lodash','ioredis','../../components/contacts','../../components/parsers/qs','../../components/realtime/agents','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../errors/api','APIBadRequestError','handleError','../../mysqldb','socket.io-emitter','redis','./user.socket','register','localhost','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','then','role','agent','userNotification:recalc:','get','admin','Users','Agents','telephone','filter','ignore','value','name','UserProfileResource','destroy','stack','send','User','rawAttributes','fieldName','type','key','password','salt','previousPasswords','resetPasswordToken','resetPasswordExpires','md5secret','includes','getOptions','where','query','includeAll','include','userSetting','true','attributes','push','findAll','rows','openTabs','dataValues','sms','mail','whatsapp','all','UserSetting','options','find','chat','fax','body','params','catch','addContacts','omit','ids','findById','securePassword','validatePasswordPattern','isNil','min_internal','internal','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','sequelize','SELECT','length','from','mailbox','VoiceMail','email','permissions','101','102','113','104','105','107','108','109','100','111','114','115','create','Unauthorized','user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','Telephones','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','map','UserProfileSection','compact','oldPassword','newPassword','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Sequelize','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','passwordHistoryLimit','updatePasswordsHistory','addQueues','channel','online','loginInPause','voicePause','interface','Unknown\x20channel','capitalize','toLowerCase','Queues','penalty','spread','QueueId','emit','Queue:save','VoiceQueue','voice','format','SIP/%s','UserVoiceQueueRt','upsert','removeQueues','isValidChannel','remove','isArray','Queue:remove','userpic','file','getAvatar','join','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','getOpenTabs','openchannel','CHAT','FaxOpenTabs','FAX','createdAt','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','concat','User\x20with\x20id\x20%s\x20not\x20found','hasOwnProperty','CmList','List','Tags','color','tag','getQueues','model','keys','Queue','intersection','fields','order','sort','pick','merge','nolimit','getVoiceQueuesRt','filters','ChatGroup','getGroups','UserId','VoiceRecording','getScreenRecordings','ScreenRecording','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','MailInteraction','getSmsInteractions','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','login','mobile','LOCAL/%s@from-sip/n','intrf','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','device','PAUSE','LOGININPAUSE','logout','pause','updateAttributes','DEFAULT\x20PAUSE','unpause','smsPause','whatsappPause','lastPauseAt','getTeams','Team','resolve','Body\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','addTeams','getAssociatedQueues','flattenDeep','addAgent','getDataValue','Voice','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','removeAgent','getLists','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','getSmsAccounts','addSmsAccounts','removeSmsAccounts','ChatWebsite','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getScheduledCalls','CmHopper','$and','$or','$gte','$lt','$lte','$ne','$between','$in','$like','$notLike','$iLike','$overlap','$contains','$contained','$any','CmContact','dialActive','getApiKey','retrieveApiKey','No\x20API\x20access\x20key\x20found!','createApiKey','generateApiKey','iat','nonce','token','removeApiKey','apiKeyNonce','API\x20key\x20not\x20available','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','unknown','ringing','teams','queues','inbound','getAgents','toString','lower','col','asc','substring','uniqBy','orderBy','offline','voiceStatus','unavailable','busy','slice','charAt','toUpperCase','QueryTypes','select','field','ui.createdAt','user_has_','ui.UserId\x20=\x20?','OpenTabs'];(function(_0x43b22b,_0xea722c){var _0xd4e124=function(_0x271814){while(--_0x271814){_0x43b22b['push'](_0x43b22b['shift']());}};_0xd4e124(++_0xea722c);}(_0xbe51,0x17d));var _0x1be5=function(_0x25cb3e,_0x2b4637){_0x25cb3e=_0x25cb3e-0x0;var _0x297c82=_0xbe51[_0x25cb3e];return _0x297c82;};'use strict';var moment=require(_0x1be5('0x0'));var util=require(_0x1be5('0x1'));var path=require('path');var fs=require('fs');var _=require(_0x1be5('0x2'));var squel=require('squel');var Redis=require(_0x1be5('0x3'));var authService=require('../../components/auth/service');var contacts=require(_0x1be5('0x4'));var qs=require(_0x1be5('0x5'));var rta=require(_0x1be5('0x6'));var logger=require(_0x1be5('0x7'))('api');var utils=require(_0x1be5('0x8'));var config=require(_0x1be5('0x9'));var licenseUtil=require(_0x1be5('0xa'));var APIBadRequestError=require(_0x1be5('0xb'))[_0x1be5('0xc')];var APINotFoundError=require(_0x1be5('0xb'))['APINotFoundError'];var APIHandleError=require('../../errors/api')[_0x1be5('0xd')];var db=require(_0x1be5('0xe'))['db'];var socket=require(_0x1be5('0xf'))(new Redis(config[_0x1be5('0x10')]));require(_0x1be5('0x11'))[_0x1be5('0x12')](socket);config[_0x1be5('0x10')]=_['defaults'](config['redis'],{'host':_0x1be5('0x13'),'port':0x18eb});var values;function respondWithStatusCode(_0x2cf40b,_0x2ef95d){_0x2ef95d=_0x2ef95d||0xcc;return function(_0x27e7ef){if(_0x27e7ef){return _0x2cf40b[_0x1be5('0x14')](_0x2ef95d);}return _0x2cf40b['status'](_0x2ef95d)[_0x1be5('0x15')]();};}function respondWithResult(_0x365867,_0x17b74e){_0x17b74e=_0x17b74e||0xc8;return function(_0x3f51ca){if(_0x3f51ca){return _0x365867[_0x1be5('0x16')](_0x17b74e)[_0x1be5('0x17')](_0x3f51ca);}};}function respondWithFilteredResult(_0x2eb1c4,_0x3e0bb9){return function(_0x3fc045){if(_0x3fc045){var _0x528051=typeof _0x3e0bb9[_0x1be5('0x18')]===_0x1be5('0x19')&&typeof _0x3e0bb9[_0x1be5('0x1a')]==='undefined';var _0x256e51=_0x3fc045[_0x1be5('0x1b')];var _0x3f833a=_0x528051?0x0:_0x3e0bb9[_0x1be5('0x18')];var _0x596c2f=_0x528051?_0x3fc045[_0x1be5('0x1b')]:_0x3e0bb9[_0x1be5('0x18')]+_0x3e0bb9[_0x1be5('0x1a')];var _0xbb80af;if(_0x596c2f>=_0x256e51){_0x596c2f=_0x256e51;_0xbb80af=0xc8;}else{_0xbb80af=0xce;}_0x2eb1c4[_0x1be5('0x16')](_0xbb80af);return _0x2eb1c4[_0x1be5('0x1c')](_0x1be5('0x1d'),_0x3f833a+'-'+_0x596c2f+'/'+_0x256e51)[_0x1be5('0x17')](_0x3fc045);}return null;};}function saveUpdates(_0x262cf8){return function(_0x4ced50){if(_0x4ced50){return _0x4ced50[_0x1be5('0x1e')](_0x262cf8)[_0x1be5('0x1f')](function(_0x481c81){if(_0x481c81[_0x1be5('0x20')]===_0x1be5('0x21')){socket['emit'](_0x1be5('0x22')+_0x481c81['id'],_0x481c81);}return _0x481c81;});}return null;};}function removeEntity(_0x2c7c3d){return function(_0x548234){if(_0x548234){return _0x548234['destroy']()[_0x1be5('0x1f')](function(){var _0x412738=_0x548234[_0x1be5('0x23')]({'plain':!![]});if(_0x412738[_0x1be5('0x20')]===_0x1be5('0x24'))return;var _0x5f3e37=[{'name':_0x1be5('0x25'),'value':'user','ignore':!![]},{'name':_0x1be5('0x26'),'value':'agent','ignore':![]},{'name':'Telephones','value':_0x1be5('0x27'),'ignore':![]}];var _0x184adc=_(_0x5f3e37)[_0x1be5('0x28')](_0x1be5('0x29'))['map'](_0x1be5('0x2a'))[_0x1be5('0x2a')]();if(_['includes'](_0x184adc,_0x412738[_0x1be5('0x20')])){return;}var _0x28551d=_['find'](_0x5f3e37,[_0x1be5('0x2a'),_0x412738[_0x1be5('0x20')]])[_0x1be5('0x2b')];return db[_0x1be5('0x2c')][_0x1be5('0x2d')]({'where':{'type':_0x28551d,'resourceId':_0x412738['id']}})['then'](function(){return _0x548234;});})['then'](function(){_0x2c7c3d[_0x1be5('0x16')](0xcc)[_0x1be5('0x15')]();});}};}function handleEntityNotFound(_0x351202){return function(_0x1b1a1e){if(!_0x1b1a1e){_0x351202[_0x1be5('0x14')](0x194);}return _0x1b1a1e;};}function handleError(_0x320ea0,_0x398352){_0x398352=_0x398352||0x1f4;return function(_0x4193b8){logger['error'](_0x4193b8[_0x1be5('0x2e')]);if(_0x4193b8[_0x1be5('0x2b')]){delete _0x4193b8['name'];}_0x320ea0[_0x1be5('0x16')](_0x398352)[_0x1be5('0x2f')](_0x4193b8);};}function getUserAttributes(){return _(db[_0x1be5('0x30')][_0x1be5('0x31')])['map'](function(_0x38b9a3){return{'name':_0x38b9a3[_0x1be5('0x32')],'type':_0x38b9a3[_0x1be5('0x33')][_0x1be5('0x34')]};})[_0x1be5('0x28')](function(_0x5f1945){return![_0x1be5('0x35'),_0x1be5('0x36'),_0x1be5('0x37'),_0x1be5('0x38'),_0x1be5('0x39'),_0x1be5('0x3a')][_0x1be5('0x3b')](_0x5f1945[_0x1be5('0x2b')]);})['value']();}exports['index']=function(_0x210d58,_0x5ee3b0){var _0x1d746d={},_0x9e3131={'count':0x0,'rows':[]};var _0x14d27e=getUserAttributes();_0x1d746d=qs[_0x1be5('0x3c')](_0x14d27e,_0x210d58);var _0x42a314={'where':_0x1d746d[_0x1be5('0x3d')]};return db[_0x1be5('0x30')][_0x1be5('0x1b')](_0x42a314)[_0x1be5('0x1f')](function(_0x21498c){_0x9e3131[_0x1be5('0x1b')]=_0x21498c;if(_0x210d58[_0x1be5('0x3e')][_0x1be5('0x3f')]){_0x1d746d[_0x1be5('0x40')]=[{'all':!![]}];}if(_0x210d58['query'][_0x1be5('0x41')]===_0x1be5('0x42')){_0x1d746d[_0x1be5('0x40')]=[{'model':db['UserSetting'],'as':_0x1be5('0x41')}];}if(!_[_0x1be5('0x3b')](_0x1d746d['attributes'],'id')){_0x1d746d[_0x1be5('0x43')][_0x1be5('0x44')]('id');}return db[_0x1be5('0x30')][_0x1be5('0x45')](_0x1d746d);})[_0x1be5('0x1f')](function(_0x47cb75){_0x9e3131[_0x1be5('0x46')]=_0x47cb75;if(_0x210d58[_0x1be5('0x3e')][_0x1be5('0x47')]===_0x1be5('0x42')){var _0x5408ec=[];for(var _0x45824d=0x0;_0x45824d<_0x9e3131[_0x1be5('0x46')]['length'];_0x45824d++){_0x5408ec[_0x1be5('0x44')](get_open_tabs('chat',_0x9e3131['rows'][_0x45824d][_0x1be5('0x48')]));_0x5408ec['push'](get_open_tabs(_0x1be5('0x49'),_0x9e3131[_0x1be5('0x46')][_0x45824d]['dataValues']));_0x5408ec[_0x1be5('0x44')](get_open_tabs('fax',_0x9e3131[_0x1be5('0x46')][_0x45824d][_0x1be5('0x48')]));_0x5408ec[_0x1be5('0x44')](get_open_tabs(_0x1be5('0x4a'),_0x9e3131[_0x1be5('0x46')][_0x45824d][_0x1be5('0x48')]));_0x5408ec[_0x1be5('0x44')](get_open_tabs('openchannel',_0x9e3131[_0x1be5('0x46')][_0x45824d][_0x1be5('0x48')]));_0x5408ec[_0x1be5('0x44')](get_open_tabs(_0x1be5('0x4b'),_0x9e3131[_0x1be5('0x46')][_0x45824d][_0x1be5('0x48')]));}return Promise[_0x1be5('0x4c')](_0x5408ec)[_0x1be5('0x1f')](function(){return _0x9e3131;});}else{return _0x9e3131;}})[_0x1be5('0x1f')](respondWithFilteredResult(_0x5ee3b0,_0x1d746d))['catch'](handleError(_0x5ee3b0,null));};exports['show']=function(_0x5c6723,_0x3f38b8){var _0x5f3521=getUserAttributes();_0x5c6723['query']['id']=_0x5c6723['params']['id'];var _0x5daa7b=qs[_0x1be5('0x3c')](_0x5f3521,_0x5c6723);if(_0x5c6723[_0x1be5('0x3e')]['includeAll']){_0x5daa7b[_0x1be5('0x40')]=[{'all':!![]}];}if(_0x5c6723[_0x1be5('0x3e')]['userSetting']==='true'){_0x5daa7b[_0x1be5('0x40')]=[{'model':db[_0x1be5('0x4d')],'as':_0x1be5('0x41')}];}_0x5daa7b=_['merge']({},_0x5daa7b,_0x5c6723[_0x1be5('0x4e')]);if(!_[_0x1be5('0x3b')](_0x5daa7b[_0x1be5('0x43')],'id')){_0x5daa7b[_0x1be5('0x43')][_0x1be5('0x44')]('id');}return db[_0x1be5('0x30')][_0x1be5('0x4f')](_0x5daa7b)[_0x1be5('0x1f')](handleEntityNotFound(_0x3f38b8,null))[_0x1be5('0x1f')](function(_0x5a58e4){var _0xdfdb7a=[];values=_0x5a58e4;if(_0x5c6723['query'][_0x1be5('0x47')]===_0x1be5('0x42')){_0xdfdb7a[_0x1be5('0x44')](get_open_tabs(_0x1be5('0x50'),_0x5a58e4[_0x1be5('0x48')]));_0xdfdb7a[_0x1be5('0x44')](get_open_tabs(_0x1be5('0x49'),_0x5a58e4[_0x1be5('0x48')]));_0xdfdb7a['push'](get_open_tabs('openchannel',_0x5a58e4['dataValues']));_0xdfdb7a['push'](get_open_tabs(_0x1be5('0x4b'),_0x5a58e4[_0x1be5('0x48')]));_0xdfdb7a[_0x1be5('0x44')](get_open_tabs(_0x1be5('0x51'),_0x5a58e4[_0x1be5('0x48')]));_0xdfdb7a[_0x1be5('0x44')](get_open_tabs(_0x1be5('0x4a'),_0x5a58e4['dataValues']));return Promise['all'](_0xdfdb7a);}else{return values;}})[_0x1be5('0x1f')](function(){return values;})['then'](respondWithResult(_0x3f38b8,null))['catch'](handleError(_0x3f38b8,null));};exports[_0x1be5('0x1e')]=function(_0x1268fe,_0x151072){if(_0x1268fe['body']['id']){delete _0x1268fe[_0x1be5('0x52')]['id'];}delete _0x1268fe[_0x1be5('0x52')][_0x1be5('0x20')];return db[_0x1be5('0x30')][_0x1be5('0x4f')]({'where':{'id':_0x1268fe[_0x1be5('0x53')]['id']}})[_0x1be5('0x1f')](handleEntityNotFound(_0x151072,null))[_0x1be5('0x1f')](saveUpdates(_0x1268fe[_0x1be5('0x52')],null))['then'](respondWithResult(_0x151072,null))[_0x1be5('0x54')](handleError(_0x151072,null));};exports['describe']=function(_0x483424,_0x175339){return db[_0x1be5('0x30')]['describe']()[_0x1be5('0x1f')](respondWithResult(_0x175339,null))[_0x1be5('0x54')](handleError(_0x175339,null));};exports['addContacts']=function(_0x254c6d,_0x794130){return db[_0x1be5('0x30')][_0x1be5('0x4f')]({'where':{'id':_0x254c6d['params']['id']}})[_0x1be5('0x1f')](handleEntityNotFound(_0x794130,null))['then'](function(_0x31de77){if(_0x31de77){return _0x31de77[_0x1be5('0x55')](_0x254c6d[_0x1be5('0x52')]['ids'],_[_0x1be5('0x56')](_0x254c6d['body'],[_0x1be5('0x57'),'id'])||{});}})[_0x1be5('0x1f')](respondWithResult(_0x794130,null))[_0x1be5('0x54')](handleError(_0x794130,null));};function validateUser(_0x1425ad){return new Promise(function(_0x38a646,_0x1f9566){if(_0x1425ad['internal'])return _0x38a646(_0x1425ad);return db['Setting'][_0x1be5('0x58')](0x1)[_0x1be5('0x1f')](function(_0x3376c8){if(_0x3376c8[_0x1be5('0x59')])authService[_0x1be5('0x5a')](_0x1425ad['password']);db[_0x1be5('0x30')]['max']('internal')[_0x1be5('0x1f')](function(_0x46c4da){if(_[_0x1be5('0x5b')](_0x46c4da)){_0x1425ad['internal']=_0x3376c8[_0x1be5('0x5c')]||0x1;return;}if(_[_0x1be5('0x5b')](_0x3376c8['min_internal'])||_0x3376c8[_0x1be5('0x5c')]===_0x46c4da){_0x1425ad[_0x1be5('0x5d')]=_0x46c4da+0x1;return;}if(_0x3376c8['min_internal']>_0x46c4da){_0x1425ad['internal']=_0x3376c8[_0x1be5('0x5c')];return;}return db['sequelize'][_0x1be5('0x3e')](_0x1be5('0x5e'),{'type':db[_0x1be5('0x5f')]['QueryTypes'][_0x1be5('0x60')]})['then'](function(_0x37e200){if(_0x37e200&&_0x37e200[_0x1be5('0x61')]){for(var _0x4efe3d=0x0,_0x3a8742=_0x37e200[_0x1be5('0x61')];_0x4efe3d<_0x3a8742&&_[_0x1be5('0x5b')](_0x1425ad[_0x1be5('0x5d')]);_0x4efe3d++){if(_0x3376c8[_0x1be5('0x5c')]<=_0x37e200[_0x4efe3d]['from']){_0x1425ad[_0x1be5('0x5d')]=_0x37e200[_0x4efe3d][_0x1be5('0x62')];}else if(_0x3376c8[_0x1be5('0x5c')]>_0x37e200[_0x4efe3d][_0x1be5('0x62')]&&_0x3376c8[_0x1be5('0x5c')]<=_0x37e200[_0x4efe3d]['to']){_0x1425ad[_0x1be5('0x5d')]=_0x3376c8['min_internal'];}}}if(_[_0x1be5('0x5b')](_0x1425ad[_0x1be5('0x5d')])){_0x1425ad[_0x1be5('0x5d')]=_0x46c4da+0x1;}return _0x38a646(_0x1425ad);});});})['catch'](function(_0xa55a26){_0x1f9566(_0xa55a26);});});}function updateUser(_0x3b749e){return new Promise(function(_0x5af72b,_0x316c3b){try{if(_0x3b749e['voicemail']){_0x3b749e[_0x1be5('0x63')]=_0x3b749e['internal'];_0x3b749e[_0x1be5('0x64')]={'mailbox':_0x3b749e[_0x1be5('0x5d')],'password':_0x3b749e[_0x1be5('0x35')],'fullname':_0x3b749e['fullname'],'email':_0x3b749e[_0x1be5('0x65')]};}if(_0x3b749e['role']===_0x1be5('0x21')){if(!_0x3b749e[_0x1be5('0x66')])_0x3b749e[_0x1be5('0x66')]=[_0x1be5('0x67'),_0x1be5('0x68'),'103',_0x1be5('0x69'),'110',_0x1be5('0x6a'),_0x1be5('0x6b'),'106',_0x1be5('0x6c'),_0x1be5('0x6d'),_0x1be5('0x6e'),_0x1be5('0x6f'),_0x1be5('0x70'),_0x1be5('0x71'),_0x1be5('0x72')];}_0x5af72b(_0x3b749e);}catch(_0x574996){_0x316c3b(_0x574996);}});}exports[_0x1be5('0x73')]=function(_0x4e03ff,_0x60a082){if(_0x4e03ff['user'][_0x1be5('0x20')]===_0x1be5('0x21'))throw new Error(_0x1be5('0x74'));if(_0x4e03ff[_0x1be5('0x52')][_0x1be5('0x20')]===_0x1be5('0x75')&&_0x4e03ff[_0x1be5('0x75')][_0x1be5('0x20')]!==_0x1be5('0x24')){throw new Error(_0x1be5('0x76'));}if(_0x4e03ff[_0x1be5('0x52')][_0x1be5('0x20')]==='admin'&&_0x4e03ff[_0x1be5('0x75')][_0x1be5('0x20')]!==_0x1be5('0x24')){throw new Error(_0x1be5('0x77'));}return licenseUtil[_0x1be5('0x78')]([_0x4e03ff[_0x1be5('0x52')]])[_0x1be5('0x1f')](function(){return validateUser(_0x4e03ff[_0x1be5('0x52')]);})[_0x1be5('0x1f')](function(_0x421de4){return updateUser(_0x421de4)[_0x1be5('0x1f')](function(_0x5d4d72){if(_0x5d4d72[_0x1be5('0x20')]===_0x1be5('0x24')){_0x5d4d72[_0x1be5('0x79')]=_0x4e03ff['user'][_0x1be5('0x79')];delete _0x5d4d72[_0x1be5('0x7a')];}return _0x5d4d72;});})['then'](function(_0x3997b7){return db['User'][_0x1be5('0x73')](_0x3997b7,{'include':[{'model':db['VoiceMail'],'as':_0x1be5('0x64')}]});})['then'](function(_0x5912ee){if(_0x4e03ff['body'][_0x1be5('0x20')]===_0x1be5('0x75'))return _0x5912ee;if(_0x4e03ff[_0x1be5('0x75')][_0x1be5('0x20')]!==_0x1be5('0x75'))return _0x5912ee;return db['UserProfileSection'][_0x1be5('0x4f')]({'where':{'name':_0x5912ee[_0x1be5('0x20')]===_0x1be5('0x21')?'Agents':_0x1be5('0x7b'),'userProfileId':_0x4e03ff['user'][_0x1be5('0x7a')]},'raw':!![]})['then'](function(_0x174819){if(!_0x174819||_0x174819[_0x1be5('0x7c')]!=0x0)return _0x5912ee;return db[_0x1be5('0x2c')][_0x1be5('0x73')]({'name':_0x5912ee['name'],'resourceId':_0x5912ee['id'],'type':_0x174819['name'],'sectionId':_0x174819['id']},{})[_0x1be5('0x1f')](function(){return _0x5912ee;});})[_0x1be5('0x54')](function(_0x4ce188){logger[_0x1be5('0x7d')](_0x1be5('0x7e'),_0x4ce188);throw _0x4ce188;});})[_0x1be5('0x1f')](respondWithResult(_0x60a082,0xc9))['catch'](handleError(_0x60a082,null));};exports['bulkCreate']=function(_0x2a8243,_0x1388f8){var _0xb2dd0b=_0x2a8243['body'];var _0x139a71=[];if(_0x2a8243['user'][_0x1be5('0x20')]===_0x1be5('0x21'))throw new Error(_0x1be5('0x74'));if(_[_0x1be5('0x7f')](_0xb2dd0b,[_0x1be5('0x20'),_0x1be5('0x75')])&&_0x2a8243[_0x1be5('0x75')][_0x1be5('0x20')]!==_0x1be5('0x24')){throw new Error(_0x1be5('0x76'));}if(_['some'](_0xb2dd0b,[_0x1be5('0x20'),_0x1be5('0x24')])&&_0x2a8243[_0x1be5('0x75')][_0x1be5('0x20')]!==_0x1be5('0x24')){throw new Error(_0x1be5('0x80'));}return licenseUtil[_0x1be5('0x78')](_0xb2dd0b)['then'](function(){return validateUser(_0xb2dd0b[0x0]);})[_0x1be5('0x1f')](function(){for(var _0x173911=0x1;_0x173911<_0xb2dd0b[_0x1be5('0x61')];_0x173911++){var _0x23a5e4=_0xb2dd0b[_0x173911-0x1][_0x1be5('0x5d')];if(!_0xb2dd0b[_0x173911]['internal'])_0xb2dd0b[_0x173911][_0x1be5('0x5d')]=_0x23a5e4+0x1;_0x139a71['push'](validateUser(_0xb2dd0b[_0x173911]));}return Promise[_0x1be5('0x4c')](_0x139a71);})[_0x1be5('0x1f')](function(){_0x139a71=[];for(var _0x289978=0x0;_0x289978<_0xb2dd0b[_0x1be5('0x61')];_0x289978++){_0x139a71[_0x1be5('0x44')](updateUser(_0xb2dd0b[_0x289978]));}return Promise['all'](_0x139a71);})[_0x1be5('0x1f')](function(){_0x139a71=_0xb2dd0b[_0x1be5('0x81')](function(_0x1c83ce){return db[_0x1be5('0x30')][_0x1be5('0x73')](_0x1c83ce,{'include':[{'model':db[_0x1be5('0x64')],'as':_0x1be5('0x64')}]})[_0x1be5('0x1f')](function(_0x1dc353){_0x1c83ce['id']=_0x1dc353['id'];return _0x1c83ce;});});return Promise[_0x1be5('0x4c')](_0x139a71);})['then'](function(_0x1c46b2){if(_0x2a8243[_0x1be5('0x52')][_0x1be5('0x20')]===_0x1be5('0x75'))return _0x1c46b2;if(_0x2a8243[_0x1be5('0x75')][_0x1be5('0x20')]!==_0x1be5('0x75'))return _0x1c46b2;var _0x3c542b=_['some'](_0x1c46b2,function(_0x248d8c){return _0x248d8c[_0x1be5('0x20')]==='agent'||_0x248d8c[_0x1be5('0x20')]===_0x1be5('0x27');});if(!_0x3c542b)return _0x1c46b2;return db[_0x1be5('0x82')][_0x1be5('0x45')]({'where':{'name':{'$or':['Agents',_0x1be5('0x7b')]},'userProfileId':_0x2a8243[_0x1be5('0x75')]['userProfileId']},'raw':!![]})[_0x1be5('0x1f')](function(_0x193b41){if(_['isEmpty'](_0x193b41)||!_['some'](_0x193b41,['autoAssociation',0x0]))return _0x1c46b2;_0x139a71=[];var _0x5df78a=_(_0x193b41)['map'](function(_0x217615){if(_0x217615['autoAssociation']===0x1)return;return _0x217615['name']==='Agents'?'agent':_0x1be5('0x27');})[_0x1be5('0x83')]()[_0x1be5('0x2a')]();for(var _0x462546=0x0;_0x462546<_0x1c46b2[_0x1be5('0x61')];_0x462546++){if(!_[_0x1be5('0x3b')](_0x5df78a,_0x1c46b2[_0x462546]['role']))return;var _0x2d152c=_0x1c46b2[_0x462546]['role']===_0x1be5('0x21')?'Agents':_0x1be5('0x7b');_0x139a71['push'](db[_0x1be5('0x2c')][_0x1be5('0x73')]({'name':_0x1c46b2[_0x462546][_0x1be5('0x2b')],'resourceId':_0x1c46b2[_0x462546]['id'],'type':_0x2d152c,'sectionId':_['find'](_0x193b41,['name',_0x2d152c])['id']},{}));}return Promise[_0x1be5('0x4c')](_0x139a71);});})[_0x1be5('0x1f')](respondWithResult(_0x1388f8,0xc9))[_0x1be5('0x54')](handleError(_0x1388f8,null));};exports['changePassword']=function(_0x69287a,_0x537840){if(_0x69287a[_0x1be5('0x52')]['id']){delete _0x69287a['body']['id'];}return db['User']['find']({'where':{'id':_0x69287a[_0x1be5('0x53')]['id']}})[_0x1be5('0x1f')](function(_0x57112f){if(!_0x57112f)return null;if(_0x57112f['id']===_0x69287a[_0x1be5('0x75')]['id']){if(!_0x69287a['body'][_0x1be5('0x84')]||!_0x69287a[_0x1be5('0x52')][_0x1be5('0x85')]){throw new db['Sequelize'][(_0x1be5('0x86'))](_0x1be5('0x87'));}if(!_0x57112f[_0x1be5('0x88')](_0x69287a[_0x1be5('0x52')]['oldPassword'])){throw new db[(_0x1be5('0x89'))][(_0x1be5('0x86'))](_0x1be5('0x8a'));}if(_0x69287a[_0x1be5('0x52')]['oldPassword']===_0x69287a[_0x1be5('0x52')][_0x1be5('0x85')]){throw new db[(_0x1be5('0x89'))]['ValidationError'](_0x1be5('0x8b'));}}else if(_0x69287a['user'][_0x1be5('0x20')]==='admin'){if(!_0x69287a[_0x1be5('0x52')]['newPassword']){throw new db['Sequelize'][(_0x1be5('0x86'))](_0x1be5('0x8c'));}}else if(_0x69287a[_0x1be5('0x75')][_0x1be5('0x20')]==='user'){if(!_0x69287a['body'][_0x1be5('0x85')]){throw new db[(_0x1be5('0x89'))][(_0x1be5('0x86'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x57112f[_0x1be5('0x20')]!==_0x1be5('0x21')){throw new db[(_0x1be5('0x89'))][(_0x1be5('0x86'))](_0x1be5('0x74'));}}else{throw new db[(_0x1be5('0x89'))][(_0x1be5('0x86'))]('Unauthorized');}return _0x57112f;})[_0x1be5('0x1f')](handleEntityNotFound(_0x537840,null))[_0x1be5('0x1f')](function(_0x58ae68){return db['Setting'][_0x1be5('0x8d')]({'attributes':['id',_0x1be5('0x59'),_0x1be5('0x8e'),_0x1be5('0x8f')]})[_0x1be5('0x1f')](function(_0x494a96){if(_0x494a96['securePassword'])authService[_0x1be5('0x5a')](_0x69287a[_0x1be5('0x52')][_0x1be5('0x85')]);if(!_0x494a96[_0x1be5('0x8e')]||!_0x58ae68['previousPasswords'])return _0x58ae68;authService['validatePasswordHistory'](_0x69287a[_0x1be5('0x52')][_0x1be5('0x85')],_0x58ae68[_0x1be5('0x37')],_0x494a96[_0x1be5('0x8f')]);return _0x58ae68;})[_0x1be5('0x1f')](saveUpdates({'password':_0x69287a['body'][_0x1be5('0x85')],'passwordResetAt':_0x69287a[_0x1be5('0x75')]['id']==_0x69287a[_0x1be5('0x53')]['id']?moment():null,'previousPasswords':authService[_0x1be5('0x90')](_0x69287a[_0x1be5('0x52')][_0x1be5('0x85')],_0x58ae68[_0x1be5('0x37')])},null));})[_0x1be5('0x1f')](respondWithResult(_0x537840,null))['catch'](handleError(_0x537840,null));};exports[_0x1be5('0x91')]=function(_0x2dea03,_0x550c00){var _0x3037e5=_0x2dea03['body'][_0x1be5('0x92')];return db[_0x1be5('0x30')][_0x1be5('0x4f')]({'where':{'id':_0x2dea03['params']['id']},'attributes':['id',_0x1be5('0x2b'),_0x1be5('0x20'),_0x1be5('0x93'),_0x1be5('0x94'),_0x1be5('0x95'),_0x1be5('0x96')]})[_0x1be5('0x1f')](handleEntityNotFound(_0x550c00,null))[_0x1be5('0x1f')](function(_0x360df4){if(_0x360df4){if(!utils['isValidChannel'](_0x3037e5)){throw new db[(_0x1be5('0x89'))][(_0x1be5('0x86'))](_0x1be5('0x97'));}return _0x360df4['add'+_[_0x1be5('0x98')](_0x3037e5[_0x1be5('0x99')]())+_0x1be5('0x9a')](_0x2dea03[_0x1be5('0x52')][_0x1be5('0x57')],{'penalty':_0x2dea03[_0x1be5('0x52')][_0x1be5('0x9b')]||0x0})[_0x1be5('0x9c')](function(_0x162e47){for(var _0xab7b9b=0x0;_0xab7b9b<_0x2dea03[_0x1be5('0x52')][_0x1be5('0x57')]['length'];_0xab7b9b+=0x1){var _0x5805fb={'UserId':Number(_0x2dea03['params']['id'])};_0x5805fb[_['capitalize'](_0x3037e5[_0x1be5('0x99')]())+_0x1be5('0x9d')]=Number(_0x2dea03[_0x1be5('0x52')][_0x1be5('0x57')][_0xab7b9b]);socket[_0x1be5('0x9e')]('user'+_[_0x1be5('0x98')](_0x3037e5[_0x1be5('0x99')]())+_0x1be5('0x9f'),_0x5805fb);}return _0x162e47;})[_0x1be5('0x1f')](function(){if(_0x3037e5==='voice'){return db[_0x1be5('0xa0')][_0x1be5('0x45')]({'where':{'id':_0x2dea03[_0x1be5('0x52')][_0x1be5('0x57')]||[]},'raw':!![],'attributes':['id',_0x1be5('0x2b')]});}})[_0x1be5('0x1f')](function(_0x36a399){var _0x39936e=_0x360df4[_0x1be5('0x23')]({'plain':!![]});var _0x4ef3af=[];if(_0x3037e5===_0x1be5('0xa1')&&_0x39936e[_0x1be5('0x20')]==='agent'&&_0x39936e[_0x1be5('0x93')]){for(let _0x2269d0=0x0;_0x2269d0<_0x36a399[_0x1be5('0x61')];_0x2269d0+=0x1){_0x4ef3af['push']({'membername':_0x39936e[_0x1be5('0x2b')],'UserId':_0x39936e['id'],'queue_name':_0x36a399[_0x2269d0][_0x1be5('0x2b')],'VoiceQueueId':_0x36a399[_0x2269d0]['id'],'interface':_[_0x1be5('0x5b')](_0x39936e[_0x1be5('0x96')])?util[_0x1be5('0xa2')](_0x1be5('0xa3'),_0x39936e[_0x1be5('0x2b')]):_0x39936e[_0x1be5('0x96')],'paused':_0x39936e[_0x1be5('0x95')]||![],'penalty':_0x2dea03['body'][_0x1be5('0x9b')]||0x0});}return Promise[_0x1be5('0x4c')](_0x4ef3af[_0x1be5('0x81')](function(_0x4f5c58){return db[_0x1be5('0xa4')][_0x1be5('0xa5')](_0x4f5c58);}));}return _0x360df4;});}})['then'](respondWithStatusCode(_0x550c00,null))['catch'](handleError(_0x550c00,null));};exports[_0x1be5('0xa6')]=function(_0x57fb67,_0x2a62d0){var _0x4a317c,_0x217fff;return db[_0x1be5('0x30')][_0x1be5('0x4f')]({'where':{'id':_0x57fb67[_0x1be5('0x53')]['id']},'attributes':['id','name',_0x1be5('0x20')]})[_0x1be5('0x1f')](handleEntityNotFound(_0x2a62d0,null))[_0x1be5('0x1f')](function(_0x54be5d){if(_0x54be5d){_0x4a317c=_0x54be5d;if(!_0x57fb67[_0x1be5('0x3e')]['channel']||!utils[_0x1be5('0xa7')](_0x57fb67[_0x1be5('0x3e')][_0x1be5('0x92')])){throw new db[(_0x1be5('0x89'))][(_0x1be5('0x86'))](_0x1be5('0x97'));}return _0x54be5d[_0x1be5('0xa8')+_[_0x1be5('0x98')](_0x57fb67[_0x1be5('0x3e')][_0x1be5('0x92')][_0x1be5('0x99')]())+_0x1be5('0x9a')](_0x57fb67[_0x1be5('0x3e')][_0x1be5('0x57')]);}})[_0x1be5('0x1f')](function(_0x1284a0){if(_[_0x1be5('0xa9')](_0x57fb67[_0x1be5('0x3e')][_0x1be5('0x57')])){for(var _0x4a0f09=0x0;_0x4a0f09<_0x57fb67[_0x1be5('0x3e')][_0x1be5('0x57')][_0x1be5('0x61')];_0x4a0f09+=0x1){_0x217fff={'UserId':Number(_0x57fb67[_0x1be5('0x53')]['id'])};_0x217fff[_[_0x1be5('0x98')](_0x57fb67[_0x1be5('0x3e')][_0x1be5('0x92')][_0x1be5('0x99')]())+_0x1be5('0x9d')]=Number(_0x57fb67[_0x1be5('0x3e')][_0x1be5('0x57')][_0x4a0f09]);socket[_0x1be5('0x9e')](_0x1be5('0x75')+_[_0x1be5('0x98')](_0x57fb67[_0x1be5('0x3e')][_0x1be5('0x92')]['toLowerCase']())+'Queue:remove',_0x217fff);}}else{_0x217fff={'UserId':Number(_0x57fb67[_0x1be5('0x53')]['id'])};_0x217fff[_[_0x1be5('0x98')](_0x57fb67[_0x1be5('0x3e')]['channel']['toLowerCase']())+_0x1be5('0x9d')]=Number(_0x57fb67[_0x1be5('0x3e')][_0x1be5('0x57')]);socket[_0x1be5('0x9e')](_0x1be5('0x75')+_[_0x1be5('0x98')](_0x57fb67['query'][_0x1be5('0x92')][_0x1be5('0x99')]())+_0x1be5('0xaa'),_0x217fff);}return _0x1284a0;})['then'](function(){if(_0x57fb67[_0x1be5('0x3e')]['channel']===_0x1be5('0xa1')){return db[_0x1be5('0xa4')][_0x1be5('0x2d')]({'where':{'UserId':_0x57fb67[_0x1be5('0x53')]['id'],'VoiceQueueId':_0x57fb67['query'][_0x1be5('0x57')]},'individualHooks':!![]})[_0x1be5('0x1f')](function(){return _0x4a317c;});}return _0x4a317c;})[_0x1be5('0x1f')](respondWithStatusCode(_0x2a62d0,null))[_0x1be5('0x54')](handleError(_0x2a62d0,null));};exports['addAvatar']=function(_0x446aa5,_0x1f3cb1){_0x446aa5[_0x1be5('0x52')][_0x1be5('0xab')]=_0x446aa5[_0x1be5('0xac')]['filename'];return db[_0x1be5('0x30')][_0x1be5('0x4f')]({'where':{'id':_0x446aa5[_0x1be5('0x53')]['id']}})[_0x1be5('0x1f')](handleEntityNotFound(_0x1f3cb1,null))[_0x1be5('0x1f')](saveUpdates(_0x446aa5[_0x1be5('0x52')],null))[_0x1be5('0x1f')](respondWithResult(_0x1f3cb1,null))[_0x1be5('0x54')](handleError(_0x1f3cb1,null));};exports[_0x1be5('0xad')]=function(_0xac757e,_0x1ce9ad){var _0x12d37e=path[_0x1be5('0xae')](config[_0x1be5('0xaf')],_0x1be5('0xb0'));return db['User'][_0x1be5('0x4f')]({'where':{'id':_0xac757e[_0x1be5('0x53')]['id']},'attributes':['id',_0x1be5('0xab')],'raw':!![]})[_0x1be5('0x1f')](handleEntityNotFound(_0x1ce9ad,null))[_0x1be5('0x1f')](function(_0x56a080){if(_0x56a080){if(_['isNil'](_0x56a080['userpic'])){return _0x1ce9ad[_0x1be5('0xb1')](_0x12d37e);}else{if(!fs[_0x1be5('0xb2')](path['join'](config[_0x1be5('0xaf')],_0x1be5('0xb3'),_0x56a080['userpic']))){return _0x1ce9ad[_0x1be5('0xb1')](_0x12d37e);}return _0x1ce9ad[_0x1be5('0xb1')](path[_0x1be5('0xae')](config[_0x1be5('0xaf')],_0x1be5('0xb3'),_0x56a080[_0x1be5('0xab')]));}}})[_0x1be5('0x54')](handleError(_0x1ce9ad,null));};exports[_0x1be5('0xb4')]=function(_0x4143d4,_0x34c0b5){return db[_0x1be5('0x30')][_0x1be5('0x4f')]({'where':{'id':_0x4143d4['params']['id']},'attributes':['id']})[_0x1be5('0x1f')](handleEntityNotFound(_0x34c0b5,null))[_0x1be5('0x1f')](function(_0x40ad07){var _0x53b7fe=[];values=_0x40ad07[_0x1be5('0x48')];_0x53b7fe[_0x1be5('0x44')](get_open_tabs('chat',_0x40ad07[_0x1be5('0x48')]));_0x53b7fe[_0x1be5('0x44')](get_open_tabs(_0x1be5('0x49'),_0x40ad07['dataValues']));_0x53b7fe[_0x1be5('0x44')](get_open_tabs(_0x1be5('0xb5'),_0x40ad07[_0x1be5('0x48')]));_0x53b7fe[_0x1be5('0x44')](get_open_tabs(_0x1be5('0x4b'),_0x40ad07['dataValues']));_0x53b7fe['push'](get_open_tabs('fax',_0x40ad07[_0x1be5('0x48')]));_0x53b7fe['push'](get_open_tabs(_0x1be5('0x4a'),_0x40ad07[_0x1be5('0x48')]));return Promise[_0x1be5('0x4c')](_0x53b7fe);})['then'](function(_0x5eb738){if(_0x5eb738){var _0x44f4ab=_[_0x1be5('0x81')](values['ChatOpenTabs'],function(_0xa622d1){return{'channel':_0x1be5('0xb6'),'id':_0xa622d1['id'],'createdAt':_0xa622d1['createdAt']};});var _0x1e8950=_[_0x1be5('0x81')](values[_0x1be5('0xb7')],function(_0x550a44){return{'channel':_0x1be5('0xb8'),'id':_0x550a44['id'],'createdAt':_0x550a44[_0x1be5('0xb9')]};});var _0x2c7570=_[_0x1be5('0x81')](values[_0x1be5('0xba')],function(_0x1d076e){return{'channel':_0x1be5('0xbb'),'id':_0x1d076e['id'],'createdAt':_0x1d076e[_0x1be5('0xb9')]};});var _0x79577b=_[_0x1be5('0x81')](values[_0x1be5('0xbc')],function(_0x598bad){return{'channel':'MAIL','id':_0x598bad['id'],'createdAt':_0x598bad[_0x1be5('0xb9')]};});var _0x52f74a=_[_0x1be5('0x81')](values['SmsOpenTabs'],function(_0x25cdbf){return{'channel':_0x1be5('0xbd'),'id':_0x25cdbf['id'],'createdAt':_0x25cdbf[_0x1be5('0xb9')]};});var _0x509b98=_['map'](values[_0x1be5('0xbe')],function(_0x1855eb){return{'channel':_0x1be5('0xbf'),'id':_0x1855eb['id'],'createdAt':_0x1855eb[_0x1be5('0xb9')]};});var _0x277757=_[_0x1be5('0xc0')](_0x44f4ab,_0x1e8950,_0x2c7570,_0x79577b,_0x52f74a,_0x509b98);var _0x4ecca1={'count':_0x277757['length'],'rows':_0x277757};return _0x4ecca1;}else return null;})[_0x1be5('0x1f')](respondWithResult(_0x34c0b5,null))[_0x1be5('0x54')](handleError(_0x34c0b5,null));};exports['getContacts']=function(_0x11da00,_0x10de2d){var _0x5f0d79={};return db[_0x1be5('0x30')][_0x1be5('0x8d')]({'where':{'id':_0x11da00[_0x1be5('0x53')]['id']}})[_0x1be5('0x1f')](function(_0x471f82){if(!_0x471f82){throw new APINotFoundError(util[_0x1be5('0xa2')](_0x1be5('0xc1'),_0x11da00['params']['id']));}return contacts['describe']();})[_0x1be5('0x1f')](function(_0x55f95c){_0x11da00[_0x1be5('0x3e')][_0x1be5('0x30')]=_0x11da00[_0x1be5('0x53')]['id'];_0x5f0d79=qs['getOptions'](_0x55f95c,_0x11da00);if(_0x11da00[_0x1be5('0x3e')][_0x1be5('0xc2')]('includeAll')){_0x5f0d79[_0x1be5('0x40')]=[{'model':db[_0x1be5('0xc3')],'as':_0x1be5('0xc4'),'required':![]},{'model':db['Tag'],'as':_0x1be5('0xc5'),'attributes':['id',_0x1be5('0x2b'),_0x1be5('0xc6')],'where':_0x11da00[_0x1be5('0x3e')][_0x1be5('0xc7')]?{'id':_0x11da00['query'][_0x1be5('0xc7')]}:undefined,'required':_0x11da00[_0x1be5('0x3e')]['tag']?!![]:![]}];}return contacts[_0x1be5('0x45')](_0x11da00[_0x1be5('0x3e')],_0x11da00['user'],_0x5f0d79,_0x55f95c);})[_0x1be5('0x1f')](respondWithFilteredResult(_0x10de2d,_0x5f0d79))['catch'](APIHandleError(_0x10de2d));};exports[_0x1be5('0xc8')]=function(_0x1c2c92,_0x2970f9){var _0x5416f6;var _0x4cf727={};var _0x3d8626;return db[_0x1be5('0x30')][_0x1be5('0x8d')]({'where':{'id':_0x1c2c92[_0x1be5('0x53')]['id']},'attributes':['id',_0x1be5('0x2b'),_0x1be5('0x20')]})[_0x1be5('0x1f')](handleEntityNotFound(_0x2970f9,null))[_0x1be5('0x1f')](function(_0x37b34b){if(!utils[_0x1be5('0xa7')](_0x1c2c92['query'][_0x1be5('0x92')])){throw new db['Sequelize'][(_0x1be5('0x86'))]('Unknown\x20channel');}_0x5416f6=_0x37b34b;var _0x2bbeca={};_0x2bbeca[_0x1be5('0xc9')]=_[_0x1be5('0xca')](db[_[_0x1be5('0x98')](_0x1c2c92['query'][_0x1be5('0x92')])+_0x1be5('0xcb')][_0x1be5('0x31')]);_0x2bbeca[_0x1be5('0x3e')]=_['keys'](_0x1c2c92['query']);_0x2bbeca['filters']=_[_0x1be5('0xcc')](_0x2bbeca['model'],_0x2bbeca['query']);_0x4cf727[_0x1be5('0x43')]=_[_0x1be5('0xcc')](_0x2bbeca[_0x1be5('0xc9')],qs[_0x1be5('0xcd')](_0x1c2c92[_0x1be5('0x3e')]['fields']));_0x4cf727[_0x1be5('0x43')]=_0x4cf727['attributes'][_0x1be5('0x61')]?_0x4cf727[_0x1be5('0x43')]:_0x2bbeca[_0x1be5('0xc9')];_0x4cf727[_0x1be5('0xce')]=qs[_0x1be5('0xcf')](_0x1c2c92[_0x1be5('0x3e')][_0x1be5('0xcf')]);_0x4cf727['where']=qs['filters'](_[_0x1be5('0xd0')](_0x1c2c92[_0x1be5('0x3e')],_0x2bbeca['filters']));if(_0x1c2c92['query'][_0x1be5('0x28')]){_0x4cf727[_0x1be5('0x3d')]=_[_0x1be5('0xd1')](_0x4cf727['where'],{'$or':_[_0x1be5('0x81')](_0x4cf727[_0x1be5('0x43')],function(_0x24fbcb){var _0x245413={};_0x245413[_0x24fbcb]={'$like':'%'+_0x1c2c92[_0x1be5('0x3e')][_0x1be5('0x28')]+'%'};return _0x245413;})});}_0x4cf727=_[_0x1be5('0xd1')]({},_0x4cf727,_0x1c2c92[_0x1be5('0x4e')]);switch(_0x5416f6['role']){case _0x1be5('0x24'):return db[_['capitalize'](_0x1c2c92[_0x1be5('0x3e')][_0x1be5('0x92')])+_0x1be5('0xcb')][_0x1be5('0x45')](_0x4cf727);case _0x1be5('0x75'):case _0x1be5('0x21'):return _0x5416f6['get'+_[_0x1be5('0x98')](_0x1c2c92[_0x1be5('0x3e')]['channel'])+_0x1be5('0x9a')](_0x4cf727);default:throw new db[(_0x1be5('0x89'))]['ValidationError']('Unknown\x20role');}})['then'](function(_0x12a530){_0x3d8626=_0x12a530[_0x1be5('0x61')];if(!_0x1c2c92[_0x1be5('0x3e')][_0x1be5('0xc2')](_0x1be5('0xd2'))){_0x4cf727[_0x1be5('0x1a')]=qs[_0x1be5('0x1a')](_0x1c2c92[_0x1be5('0x3e')][_0x1be5('0x1a')]);_0x4cf727['offset']=qs[_0x1be5('0x18')](_0x1c2c92[_0x1be5('0x3e')][_0x1be5('0x18')]);}switch(_0x5416f6[_0x1be5('0x20')]){case'admin':return db[_[_0x1be5('0x98')](_0x1c2c92['query']['channel'])+_0x1be5('0xcb')][_0x1be5('0x45')](_0x4cf727);case _0x1be5('0x75'):case'agent':return _0x5416f6[_0x1be5('0x23')+_['capitalize'](_0x1c2c92[_0x1be5('0x3e')][_0x1be5('0x92')])+'Queues'](_0x4cf727);}})[_0x1be5('0x1f')](function(_0x173e0c){return{'count':_0x3d8626,'rows':_0x173e0c};})[_0x1be5('0x1f')](respondWithResult(_0x2970f9,null))[_0x1be5('0x54')](handleError(_0x2970f9,null));};exports[_0x1be5('0xd3')]=function(_0x4aa6c2,_0x30d547){var _0x6090c1={};var _0x425fe2={};var _0x59772a;var _0x2c4e74;return db[_0x1be5('0x30')][_0x1be5('0x8d')]({'where':{'id':_0x4aa6c2[_0x1be5('0x53')]['id']}})['then'](handleEntityNotFound(_0x30d547,null))[_0x1be5('0x1f')](function(_0x3ba86d){if(_0x3ba86d){_0x59772a=_0x3ba86d;_0x425fe2[_0x1be5('0xc9')]=_[_0x1be5('0xca')](db['UserVoiceQueueRt'][_0x1be5('0x31')]);_0x425fe2['query']=_[_0x1be5('0xca')](_0x4aa6c2['query']);_0x425fe2[_0x1be5('0xd4')]=_[_0x1be5('0xcc')](_0x425fe2[_0x1be5('0xc9')],_0x425fe2[_0x1be5('0x3e')]);_0x6090c1['attributes']=_[_0x1be5('0xcc')](_0x425fe2[_0x1be5('0xc9')],qs[_0x1be5('0xcd')](_0x4aa6c2['query'][_0x1be5('0xcd')]));_0x6090c1[_0x1be5('0x43')]=_0x6090c1['attributes'][_0x1be5('0x61')]?_0x6090c1[_0x1be5('0x43')]:_0x425fe2['model'];_0x6090c1[_0x1be5('0xce')]=qs['sort'](_0x4aa6c2[_0x1be5('0x3e')]['sort']);_0x6090c1['where']=qs[_0x1be5('0xd4')](_[_0x1be5('0xd0')](_0x4aa6c2[_0x1be5('0x3e')],_0x425fe2[_0x1be5('0xd4')]));if(_0x4aa6c2[_0x1be5('0x3e')][_0x1be5('0x28')]){_0x6090c1[_0x1be5('0x3d')]=_[_0x1be5('0xd1')](_0x6090c1[_0x1be5('0x3d')],{'$or':_['map'](_0x6090c1[_0x1be5('0x43')],function(_0xe3755a){var _0x32b759={};_0x32b759[_0xe3755a]={'$like':'%'+_0x4aa6c2['query'][_0x1be5('0x28')]+'%'};return _0x32b759;})});}_0x6090c1=_['merge']({},_0x6090c1,_0x4aa6c2[_0x1be5('0x4e')]);return _0x59772a[_0x1be5('0xd3')](_0x6090c1);}})['then'](function(_0x2a2180){if(_0x2a2180){_0x2c4e74=_0x2a2180['length'];if(!_0x4aa6c2[_0x1be5('0x3e')]['hasOwnProperty'](_0x1be5('0xd2'))){_0x6090c1[_0x1be5('0x1a')]=qs['limit'](_0x4aa6c2[_0x1be5('0x3e')]['limit']);_0x6090c1[_0x1be5('0x18')]=qs[_0x1be5('0x18')](_0x4aa6c2[_0x1be5('0x3e')][_0x1be5('0x18')]);}return _0x59772a[_0x1be5('0xd3')](_0x6090c1);}})[_0x1be5('0x1f')](function(_0x4b16b2){if(_0x4b16b2){return _0x4b16b2?{'count':_0x2c4e74,'rows':_0x4b16b2}:null;}})[_0x1be5('0x1f')](respondWithResult(_0x30d547,null))[_0x1be5('0x54')](handleError(_0x30d547,null));};exports['getGroups']=function(_0x26a2bf,_0x2a2cce){var _0x56bb87={};var _0x4ecfa6={};var _0x26c3d4;var _0xb0987b;return db[_0x1be5('0x30')][_0x1be5('0x8d')]({'where':{'id':_0x26a2bf[_0x1be5('0x53')]['id']}})[_0x1be5('0x1f')](handleEntityNotFound(_0x2a2cce,null))[_0x1be5('0x1f')](function(_0x4e525c){if(_0x4e525c){_0x26c3d4=_0x4e525c;_0x4ecfa6['model']=_[_0x1be5('0xca')](db[_0x1be5('0xd5')][_0x1be5('0x31')]);_0x4ecfa6[_0x1be5('0x3e')]=_[_0x1be5('0xca')](_0x26a2bf['query']);_0x4ecfa6[_0x1be5('0xd4')]=_[_0x1be5('0xcc')](_0x4ecfa6[_0x1be5('0xc9')],_0x4ecfa6[_0x1be5('0x3e')]);_0x56bb87[_0x1be5('0x43')]=_['intersection'](_0x4ecfa6[_0x1be5('0xc9')],qs['fields'](_0x26a2bf[_0x1be5('0x3e')][_0x1be5('0xcd')]));_0x56bb87[_0x1be5('0x43')]=_0x56bb87[_0x1be5('0x43')][_0x1be5('0x61')]?_0x56bb87[_0x1be5('0x43')]:_0x4ecfa6[_0x1be5('0xc9')];_0x56bb87[_0x1be5('0xce')]=qs[_0x1be5('0xcf')](_0x26a2bf['query'][_0x1be5('0xcf')]);_0x56bb87[_0x1be5('0x3d')]=qs[_0x1be5('0xd4')](_[_0x1be5('0xd0')](_0x26a2bf[_0x1be5('0x3e')],_0x4ecfa6[_0x1be5('0xd4')]));if(_0x26a2bf[_0x1be5('0x3e')][_0x1be5('0x28')]){_0x56bb87[_0x1be5('0x3d')]=_[_0x1be5('0xd1')](_0x56bb87['where'],{'$or':_[_0x1be5('0x81')](_0x56bb87[_0x1be5('0x43')],function(_0x5b060a){var _0x1c9f92={};_0x1c9f92[_0x5b060a]={'$like':'%'+_0x26a2bf['query'][_0x1be5('0x28')]+'%'};return _0x1c9f92;})});}_0x56bb87=_[_0x1be5('0xd1')]({},_0x56bb87,_0x26a2bf[_0x1be5('0x4e')]);return _0x26c3d4[_0x1be5('0xd6')](_0x56bb87);}})[_0x1be5('0x1f')](function(_0x389f51){if(_0x389f51){_0xb0987b=_0x389f51['length'];if(!_0x26a2bf[_0x1be5('0x3e')][_0x1be5('0xc2')](_0x1be5('0xd2'))){_0x56bb87[_0x1be5('0x1a')]=qs[_0x1be5('0x1a')](_0x26a2bf[_0x1be5('0x3e')][_0x1be5('0x1a')]);_0x56bb87[_0x1be5('0x18')]=qs[_0x1be5('0x18')](_0x26a2bf[_0x1be5('0x3e')][_0x1be5('0x18')]);}return _0x26c3d4['getGroups'](_0x56bb87);}})['then'](function(_0x3455ee){if(_0x3455ee){return _0x3455ee?{'count':_0xb0987b,'rows':_0x3455ee}:null;}})['then'](respondWithResult(_0x2a2cce,null))['catch'](handleError(_0x2a2cce,null));};exports['getRecordings']=function(_0x49862a,_0x182c35){var _0x5b394a={'raw':!![],'where':{}};var _0x3d6b3b={};var _0x1147c2={'count':0x0,'rows':[]};return db[_0x1be5('0x30')][_0x1be5('0x8d')]({'where':{'id':_0x49862a[_0x1be5('0x53')]['id']}})[_0x1be5('0x1f')](handleEntityNotFound(_0x182c35,null))[_0x1be5('0x1f')](function(_0x525833){if(_0x525833){_0x3d6b3b[_0x1be5('0xc9')]=_[_0x1be5('0xca')](db['VoiceRecording'][_0x1be5('0x31')]);_0x3d6b3b[_0x1be5('0x3e')]=_[_0x1be5('0xca')](_0x49862a[_0x1be5('0x3e')]);_0x3d6b3b[_0x1be5('0xd4')]=_[_0x1be5('0xcc')](_0x3d6b3b[_0x1be5('0xc9')],_0x3d6b3b[_0x1be5('0x3e')]);_0x5b394a['attributes']=_[_0x1be5('0xcc')](_0x3d6b3b[_0x1be5('0xc9')],qs[_0x1be5('0xcd')](_0x49862a['query'][_0x1be5('0xcd')]));_0x5b394a[_0x1be5('0x43')]=_0x5b394a[_0x1be5('0x43')][_0x1be5('0x61')]?_0x5b394a[_0x1be5('0x43')]:_0x3d6b3b[_0x1be5('0xc9')];if(!_0x49862a[_0x1be5('0x3e')][_0x1be5('0xc2')](_0x1be5('0xd2'))){_0x5b394a['limit']=qs[_0x1be5('0x1a')](_0x49862a[_0x1be5('0x3e')]['limit']);_0x5b394a['offset']=qs[_0x1be5('0x18')](_0x49862a[_0x1be5('0x3e')][_0x1be5('0x18')]);}_0x5b394a['order']=qs[_0x1be5('0xcf')](_0x49862a[_0x1be5('0x3e')][_0x1be5('0xcf')]);_0x5b394a['where']=qs[_0x1be5('0xd4')](_['pick'](_0x49862a['query'],_0x3d6b3b['filters']));_0x5b394a[_0x1be5('0x3d')][_0x1be5('0xd7')]=_0x525833['id'];if(_0x49862a[_0x1be5('0x3e')][_0x1be5('0x28')]){_0x5b394a[_0x1be5('0x3d')]=_[_0x1be5('0xd1')](_0x5b394a['where'],{'$or':_[_0x1be5('0x81')](_0x5b394a[_0x1be5('0x43')],function(_0x619f70){var _0x5d7c60={};_0x5d7c60[_0x619f70]={'$like':'%'+_0x49862a['query'][_0x1be5('0x28')]+'%'};return _0x5d7c60;})});}_0x5b394a=_[_0x1be5('0xd1')]({},_0x5b394a,_0x49862a[_0x1be5('0x4e')]);return db[_0x1be5('0xd8')]['count']({'where':_0x5b394a[_0x1be5('0x3d')]})[_0x1be5('0x1f')](function(_0x484cfe){_0x1147c2[_0x1be5('0x1b')]=_0x484cfe;if(_0x49862a['query'][_0x1be5('0x3f')]){_0x5b394a[_0x1be5('0x40')]=[{'all':!![]}];}return db[_0x1be5('0xd8')][_0x1be5('0x45')](_0x5b394a);})['then'](function(_0x1bbbaf){_0x1147c2[_0x1be5('0x46')]=_0x1bbbaf;return _0x1147c2;});}})[_0x1be5('0x1f')](respondWithFilteredResult(_0x182c35,_0x5b394a))[_0x1be5('0x54')](handleError(_0x182c35,null));};exports[_0x1be5('0xd9')]=function(_0xce9739,_0x4c2c71){var _0x343a52={'raw':!![],'where':{}};var _0x339c02={};var _0x1ae6e7={'count':0x0,'rows':[]};return db['User']['findOne']({'where':{'id':_0xce9739[_0x1be5('0x53')]['id']}})['then'](handleEntityNotFound(_0x4c2c71,null))['then'](function(_0x2a05f3){if(_0x2a05f3){_0x339c02[_0x1be5('0xc9')]=_['keys'](db[_0x1be5('0xda')][_0x1be5('0x31')]);_0x339c02[_0x1be5('0x3e')]=_[_0x1be5('0xca')](_0xce9739[_0x1be5('0x3e')]);_0x339c02[_0x1be5('0xd4')]=_['intersection'](_0x339c02['model'],_0x339c02['query']);_0x343a52[_0x1be5('0x43')]=_['intersection'](_0x339c02[_0x1be5('0xc9')],qs[_0x1be5('0xcd')](_0xce9739['query'][_0x1be5('0xcd')]));_0x343a52[_0x1be5('0x43')]=_0x343a52[_0x1be5('0x43')]['length']?_0x343a52['attributes']:_0x339c02[_0x1be5('0xc9')];if(!_0xce9739['query']['hasOwnProperty'](_0x1be5('0xd2'))){_0x343a52['limit']=qs['limit'](_0xce9739['query']['limit']);_0x343a52[_0x1be5('0x18')]=qs[_0x1be5('0x18')](_0xce9739[_0x1be5('0x3e')][_0x1be5('0x18')]);}_0x343a52[_0x1be5('0xce')]=qs['sort'](_0xce9739[_0x1be5('0x3e')][_0x1be5('0xcf')]);_0x343a52[_0x1be5('0x3d')]=qs[_0x1be5('0xd4')](_[_0x1be5('0xd0')](_0xce9739[_0x1be5('0x3e')],_0x339c02['filters']));_0x343a52[_0x1be5('0x3d')]['UserId']=_0x2a05f3['id'];if(_0xce9739[_0x1be5('0x3e')][_0x1be5('0x28')]){_0x343a52[_0x1be5('0x3d')]=_[_0x1be5('0xd1')](_0x343a52[_0x1be5('0x3d')],{'$or':_['map'](_0x343a52['attributes'],function(_0x4ee352){var _0x338f70={};_0x338f70[_0x4ee352]={'$like':'%'+_0xce9739[_0x1be5('0x3e')][_0x1be5('0x28')]+'%'};return _0x338f70;})});}_0x343a52=_[_0x1be5('0xd1')]({},_0x343a52,_0xce9739[_0x1be5('0x4e')]);return db['ScreenRecording'][_0x1be5('0x1b')]({'where':_0x343a52[_0x1be5('0x3d')]})[_0x1be5('0x1f')](function(_0x45c792){_0x1ae6e7[_0x1be5('0x1b')]=_0x45c792;if(_0xce9739[_0x1be5('0x3e')][_0x1be5('0x3f')]){_0x343a52[_0x1be5('0x40')]=[{'all':!![]}];}return db['ScreenRecording'][_0x1be5('0x45')](_0x343a52);})[_0x1be5('0x1f')](function(_0x4d1604){_0x1ae6e7['rows']=_0x4d1604;return _0x1ae6e7;});}})[_0x1be5('0x1f')](respondWithFilteredResult(_0x4c2c71,_0x343a52))[_0x1be5('0x54')](handleError(_0x4c2c71,null));};exports[_0x1be5('0xdb')]=function(_0x324b88,_0x463896){var _0x4a7423={};var _0x2f0934={};var _0x2f552c;var _0x1d2164;return db[_0x1be5('0x30')][_0x1be5('0x8d')]({'where':{'id':_0x324b88[_0x1be5('0x53')]['id']}})[_0x1be5('0x1f')](handleEntityNotFound(_0x463896,null))['then'](function(_0x23333e){if(_0x23333e){_0x2f552c=_0x23333e;_0x2f0934[_0x1be5('0xc9')]=_[_0x1be5('0xca')](db['ChatInteraction']['rawAttributes']);_0x2f0934['query']=_[_0x1be5('0xca')](_0x324b88['query']);_0x2f0934[_0x1be5('0xd4')]=_['intersection'](_0x2f0934[_0x1be5('0xc9')],_0x2f0934[_0x1be5('0x3e')]);_0x4a7423[_0x1be5('0x43')]=_[_0x1be5('0xcc')](_0x2f0934[_0x1be5('0xc9')],qs[_0x1be5('0xcd')](_0x324b88['query'][_0x1be5('0xcd')]));_0x4a7423[_0x1be5('0x43')]=_0x4a7423[_0x1be5('0x43')][_0x1be5('0x61')]?_0x4a7423[_0x1be5('0x43')]:_0x2f0934[_0x1be5('0xc9')];_0x4a7423['order']=qs[_0x1be5('0xcf')](_0x324b88[_0x1be5('0x3e')]['sort']);_0x4a7423['where']=qs['filters'](_['pick'](_0x324b88[_0x1be5('0x3e')],_0x2f0934[_0x1be5('0xd4')]));if(_0x324b88[_0x1be5('0x3e')][_0x1be5('0x28')]){_0x4a7423['where']=_[_0x1be5('0xd1')](_0x4a7423['where'],{'$or':_['map'](_0x4a7423[_0x1be5('0x43')],function(_0x1eb30c){var _0x3fcb5b={};_0x3fcb5b[_0x1eb30c]={'$like':'%'+_0x324b88[_0x1be5('0x3e')][_0x1be5('0x28')]+'%'};return _0x3fcb5b;})});}_0x4a7423=_[_0x1be5('0xd1')]({},_0x4a7423,_0x324b88[_0x1be5('0x4e')]);return _0x2f552c[_0x1be5('0xdb')](_0x4a7423);}})[_0x1be5('0x1f')](function(_0xaf9401){if(_0xaf9401){_0x1d2164=_0xaf9401[_0x1be5('0x61')];if(!_0x324b88[_0x1be5('0x3e')][_0x1be5('0xc2')]('nolimit')){_0x4a7423[_0x1be5('0x1a')]=qs['limit'](_0x324b88['query'][_0x1be5('0x1a')]);_0x4a7423[_0x1be5('0x18')]=qs['offset'](_0x324b88[_0x1be5('0x3e')]['offset']);}return _0x2f552c[_0x1be5('0xdb')](_0x4a7423);}})[_0x1be5('0x1f')](function(_0x3b695d){if(_0x3b695d){return _0x3b695d?{'count':_0x1d2164,'rows':_0x3b695d}:null;}})[_0x1be5('0x1f')](respondWithResult(_0x463896,null))['catch'](handleError(_0x463896,null));};exports[_0x1be5('0xdc')]=function(_0xaead7c,_0x1662fc){var _0x469bd1={};var _0x2969ca={};var _0x1e6c77;var _0x2bfe7d;return db[_0x1be5('0x30')]['findOne']({'where':{'id':_0xaead7c[_0x1be5('0x53')]['id']}})[_0x1be5('0x1f')](handleEntityNotFound(_0x1662fc,null))[_0x1be5('0x1f')](function(_0x5918c0){if(_0x5918c0){_0x1e6c77=_0x5918c0;_0x2969ca[_0x1be5('0xc9')]=_['keys'](db[_0x1be5('0xdd')][_0x1be5('0x31')]);_0x2969ca[_0x1be5('0x3e')]=_[_0x1be5('0xca')](_0xaead7c[_0x1be5('0x3e')]);_0x2969ca[_0x1be5('0xd4')]=_[_0x1be5('0xcc')](_0x2969ca[_0x1be5('0xc9')],_0x2969ca[_0x1be5('0x3e')]);_0x469bd1[_0x1be5('0x43')]=_['intersection'](_0x2969ca[_0x1be5('0xc9')],qs[_0x1be5('0xcd')](_0xaead7c[_0x1be5('0x3e')][_0x1be5('0xcd')]));_0x469bd1[_0x1be5('0x43')]=_0x469bd1[_0x1be5('0x43')][_0x1be5('0x61')]?_0x469bd1['attributes']:_0x2969ca[_0x1be5('0xc9')];_0x469bd1[_0x1be5('0xce')]=qs[_0x1be5('0xcf')](_0xaead7c['query'][_0x1be5('0xcf')]);_0x469bd1['where']=qs[_0x1be5('0xd4')](_[_0x1be5('0xd0')](_0xaead7c['query'],_0x2969ca[_0x1be5('0xd4')]));if(_0xaead7c[_0x1be5('0x3e')][_0x1be5('0x28')]){_0x469bd1[_0x1be5('0x3d')]=_['merge'](_0x469bd1[_0x1be5('0x3d')],{'$or':_[_0x1be5('0x81')](_0x469bd1['attributes'],function(_0x47fdc0){var _0x54b58f={};_0x54b58f[_0x47fdc0]={'$like':'%'+_0xaead7c[_0x1be5('0x3e')][_0x1be5('0x28')]+'%'};return _0x54b58f;})});}_0x469bd1=_[_0x1be5('0xd1')]({},_0x469bd1,_0xaead7c[_0x1be5('0x4e')]);return _0x1e6c77[_0x1be5('0xdc')](_0x469bd1);}})['then'](function(_0x2fca2f){if(_0x2fca2f){_0x2bfe7d=_0x2fca2f['length'];if(!_0xaead7c['query']['hasOwnProperty'](_0x1be5('0xd2'))){_0x469bd1['limit']=qs[_0x1be5('0x1a')](_0xaead7c[_0x1be5('0x3e')][_0x1be5('0x1a')]);_0x469bd1[_0x1be5('0x18')]=qs[_0x1be5('0x18')](_0xaead7c[_0x1be5('0x3e')][_0x1be5('0x18')]);}return _0x1e6c77[_0x1be5('0xdc')](_0x469bd1);}})[_0x1be5('0x1f')](function(_0x35818a){if(_0x35818a){return _0x35818a?{'count':_0x2bfe7d,'rows':_0x35818a}:null;}})[_0x1be5('0x1f')](respondWithResult(_0x1662fc,null))[_0x1be5('0x54')](handleError(_0x1662fc,null));};exports['getMailInteractions']=function(_0x5e9ab8,_0x57f663){var _0x440226={'raw':!![],'where':{}};var _0x353e6d={};var _0x10265f={'count':0x0,'rows':[]};return db[_0x1be5('0x30')][_0x1be5('0x8d')]({'where':{'id':_0x5e9ab8[_0x1be5('0x53')]['id']}})[_0x1be5('0x1f')](handleEntityNotFound(_0x57f663,null))[_0x1be5('0x1f')](function(_0x4041f6){if(_0x4041f6){_0x353e6d[_0x1be5('0xc9')]=_[_0x1be5('0xca')](db[_0x1be5('0xde')][_0x1be5('0x31')]);_0x353e6d['query']=_[_0x1be5('0xca')](_0x5e9ab8[_0x1be5('0x3e')]);_0x353e6d['filters']=_[_0x1be5('0xcc')](_0x353e6d['model'],_0x353e6d[_0x1be5('0x3e')]);_0x440226[_0x1be5('0x43')]=_[_0x1be5('0xcc')](_0x353e6d[_0x1be5('0xc9')],qs[_0x1be5('0xcd')](_0x5e9ab8[_0x1be5('0x3e')][_0x1be5('0xcd')]));_0x440226[_0x1be5('0x43')]=_0x440226['attributes'][_0x1be5('0x61')]?_0x440226[_0x1be5('0x43')]:_0x353e6d[_0x1be5('0xc9')];if(!_0x5e9ab8[_0x1be5('0x3e')][_0x1be5('0xc2')](_0x1be5('0xd2'))){_0x440226[_0x1be5('0x1a')]=qs[_0x1be5('0x1a')](_0x5e9ab8['query'][_0x1be5('0x1a')]);_0x440226[_0x1be5('0x18')]=qs['offset'](_0x5e9ab8[_0x1be5('0x3e')][_0x1be5('0x18')]);}_0x440226['order']=qs['sort'](_0x5e9ab8['query'][_0x1be5('0xcf')]);_0x440226[_0x1be5('0x3d')]=qs[_0x1be5('0xd4')](_['pick'](_0x5e9ab8[_0x1be5('0x3e')],_0x353e6d['filters']));_0x440226[_0x1be5('0x3d')]['UserId']=_0x4041f6['id'];if(_0x5e9ab8[_0x1be5('0x3e')][_0x1be5('0x28')]){_0x440226[_0x1be5('0x3d')]=_['merge'](_0x440226[_0x1be5('0x3d')],{'$or':_[_0x1be5('0x81')](_0x440226[_0x1be5('0x43')],function(_0x1a7b23){var _0xb2817b={};_0xb2817b[_0x1a7b23]={'$like':'%'+_0x5e9ab8[_0x1be5('0x3e')][_0x1be5('0x28')]+'%'};return _0xb2817b;})});}_0x440226=_['merge']({},_0x440226,_0x5e9ab8['options']);return db['MailInteraction'][_0x1be5('0x1b')]({'where':_0x440226[_0x1be5('0x3d')]})[_0x1be5('0x1f')](function(_0x497e33){_0x10265f[_0x1be5('0x1b')]=_0x497e33;if(_0x5e9ab8['query'][_0x1be5('0x3f')]){_0x440226[_0x1be5('0x40')]=[{'all':!![]}];}return db['MailInteraction'][_0x1be5('0x45')](_0x440226);})[_0x1be5('0x1f')](function(_0x573502){_0x10265f[_0x1be5('0x46')]=_0x573502;return _0x10265f;});}})['then'](respondWithFilteredResult(_0x57f663,_0x440226))['catch'](handleError(_0x57f663,null));};exports[_0x1be5('0xdf')]=function(_0x4b0d7d,_0x4eebdf){var _0x56b70e={};var _0x1cb70a={};var _0x189b03;var _0x5ce9e8;return db[_0x1be5('0x30')]['findOne']({'where':{'id':_0x4b0d7d['params']['id']}})['then'](handleEntityNotFound(_0x4eebdf,null))[_0x1be5('0x1f')](function(_0x5241da){if(_0x5241da){_0x189b03=_0x5241da;_0x1cb70a[_0x1be5('0xc9')]=_[_0x1be5('0xca')](db['SmsInteraction'][_0x1be5('0x31')]);_0x1cb70a[_0x1be5('0x3e')]=_[_0x1be5('0xca')](_0x4b0d7d[_0x1be5('0x3e')]);_0x1cb70a[_0x1be5('0xd4')]=_['intersection'](_0x1cb70a[_0x1be5('0xc9')],_0x1cb70a[_0x1be5('0x3e')]);_0x56b70e[_0x1be5('0x43')]=_['intersection'](_0x1cb70a[_0x1be5('0xc9')],qs[_0x1be5('0xcd')](_0x4b0d7d['query'][_0x1be5('0xcd')]));_0x56b70e[_0x1be5('0x43')]=_0x56b70e[_0x1be5('0x43')][_0x1be5('0x61')]?_0x56b70e[_0x1be5('0x43')]:_0x1cb70a[_0x1be5('0xc9')];_0x56b70e['order']=qs['sort'](_0x4b0d7d[_0x1be5('0x3e')][_0x1be5('0xcf')]);_0x56b70e[_0x1be5('0x3d')]=qs[_0x1be5('0xd4')](_[_0x1be5('0xd0')](_0x4b0d7d[_0x1be5('0x3e')],_0x1cb70a[_0x1be5('0xd4')]));if(_0x4b0d7d['query']['filter']){_0x56b70e[_0x1be5('0x3d')]=_['merge'](_0x56b70e['where'],{'$or':_[_0x1be5('0x81')](_0x56b70e[_0x1be5('0x43')],function(_0x3be593){var _0x3bbb0f={};_0x3bbb0f[_0x3be593]={'$like':'%'+_0x4b0d7d['query'][_0x1be5('0x28')]+'%'};return _0x3bbb0f;})});}_0x56b70e=_[_0x1be5('0xd1')]({},_0x56b70e,_0x4b0d7d['options']);return _0x189b03[_0x1be5('0xdf')](_0x56b70e);}})[_0x1be5('0x1f')](function(_0x4eb463){if(_0x4eb463){_0x5ce9e8=_0x4eb463['length'];if(!_0x4b0d7d[_0x1be5('0x3e')][_0x1be5('0xc2')](_0x1be5('0xd2'))){_0x56b70e[_0x1be5('0x1a')]=qs['limit'](_0x4b0d7d['query'][_0x1be5('0x1a')]);_0x56b70e[_0x1be5('0x18')]=qs[_0x1be5('0x18')](_0x4b0d7d[_0x1be5('0x3e')][_0x1be5('0x18')]);}return _0x189b03['getSmsInteractions'](_0x56b70e);}})[_0x1be5('0x1f')](function(_0x5c6a86){if(_0x5c6a86){return _0x5c6a86?{'count':_0x5ce9e8,'rows':_0x5c6a86}:null;}})[_0x1be5('0x1f')](respondWithResult(_0x4eebdf,null))['catch'](handleError(_0x4eebdf,null));};exports[_0x1be5('0xe0')]=function(_0x1b6efc,_0x552fa6){var _0x41676f={};var _0x5cb5bf={};var _0xabe086;var _0xd099c8;return db[_0x1be5('0x30')]['findOne']({'where':{'id':_0x1b6efc[_0x1be5('0x53')]['id']}})[_0x1be5('0x1f')](handleEntityNotFound(_0x552fa6,null))['then'](function(_0xf0fcd6){if(_0xf0fcd6){_0xabe086=_0xf0fcd6;_0x5cb5bf[_0x1be5('0xc9')]=_['keys'](db['FaxInteraction'][_0x1be5('0x31')]);_0x5cb5bf[_0x1be5('0x3e')]=_['keys'](_0x1b6efc[_0x1be5('0x3e')]);_0x5cb5bf[_0x1be5('0xd4')]=_['intersection'](_0x5cb5bf[_0x1be5('0xc9')],_0x5cb5bf['query']);_0x41676f['attributes']=_[_0x1be5('0xcc')](_0x5cb5bf[_0x1be5('0xc9')],qs[_0x1be5('0xcd')](_0x1b6efc[_0x1be5('0x3e')][_0x1be5('0xcd')]));_0x41676f[_0x1be5('0x43')]=_0x41676f[_0x1be5('0x43')]['length']?_0x41676f[_0x1be5('0x43')]:_0x5cb5bf[_0x1be5('0xc9')];_0x41676f[_0x1be5('0xce')]=qs[_0x1be5('0xcf')](_0x1b6efc[_0x1be5('0x3e')]['sort']);_0x41676f['where']=qs[_0x1be5('0xd4')](_[_0x1be5('0xd0')](_0x1b6efc['query'],_0x5cb5bf[_0x1be5('0xd4')]));if(_0x1b6efc[_0x1be5('0x3e')][_0x1be5('0x28')]){_0x41676f['where']=_['merge'](_0x41676f[_0x1be5('0x3d')],{'$or':_[_0x1be5('0x81')](_0x41676f['attributes'],function(_0x45257a){var _0x3495b1={};_0x3495b1[_0x45257a]={'$like':'%'+_0x1b6efc[_0x1be5('0x3e')][_0x1be5('0x28')]+'%'};return _0x3495b1;})});}_0x41676f=_['merge']({},_0x41676f,_0x1b6efc[_0x1be5('0x4e')]);return _0xabe086[_0x1be5('0xe0')](_0x41676f);}})[_0x1be5('0x1f')](function(_0x23999c){if(_0x23999c){_0xd099c8=_0x23999c[_0x1be5('0x61')];if(!_0x1b6efc[_0x1be5('0x3e')]['hasOwnProperty'](_0x1be5('0xd2'))){_0x41676f[_0x1be5('0x1a')]=qs['limit'](_0x1b6efc[_0x1be5('0x3e')][_0x1be5('0x1a')]);_0x41676f[_0x1be5('0x18')]=qs['offset'](_0x1b6efc[_0x1be5('0x3e')][_0x1be5('0x18')]);}return _0xabe086[_0x1be5('0xe0')](_0x41676f);}})[_0x1be5('0x1f')](function(_0x14bbc1){if(_0x14bbc1){return _0x14bbc1?{'count':_0xd099c8,'rows':_0x14bbc1}:null;}})[_0x1be5('0x1f')](respondWithResult(_0x552fa6,null))[_0x1be5('0x54')](handleError(_0x552fa6,null));};exports[_0x1be5('0xe1')]=function(_0x3a370e,_0x30852e){var _0x3a8e54={};var _0x3f3e89={};var _0x3ac3f5;var _0x30595b;return db['User'][_0x1be5('0x8d')]({'where':{'id':_0x3a370e['params']['id']}})['then'](handleEntityNotFound(_0x30852e,null))[_0x1be5('0x1f')](function(_0x1a8d3){if(_0x1a8d3){_0x3ac3f5=_0x1a8d3;_0x3f3e89[_0x1be5('0xc9')]=_[_0x1be5('0xca')](db[_0x1be5('0xe2')][_0x1be5('0x31')]);_0x3f3e89[_0x1be5('0x3e')]=_[_0x1be5('0xca')](_0x3a370e['query']);_0x3f3e89[_0x1be5('0xd4')]=_['intersection'](_0x3f3e89[_0x1be5('0xc9')],_0x3f3e89[_0x1be5('0x3e')]);_0x3a8e54['attributes']=_[_0x1be5('0xcc')](_0x3f3e89[_0x1be5('0xc9')],qs[_0x1be5('0xcd')](_0x3a370e[_0x1be5('0x3e')][_0x1be5('0xcd')]));_0x3a8e54[_0x1be5('0x43')]=_0x3a8e54[_0x1be5('0x43')][_0x1be5('0x61')]?_0x3a8e54[_0x1be5('0x43')]:_0x3f3e89[_0x1be5('0xc9')];_0x3a8e54[_0x1be5('0xce')]=qs[_0x1be5('0xcf')](_0x3a370e['query'][_0x1be5('0xcf')]);_0x3a8e54[_0x1be5('0x3d')]=qs[_0x1be5('0xd4')](_[_0x1be5('0xd0')](_0x3a370e[_0x1be5('0x3e')],_0x3f3e89[_0x1be5('0xd4')]));if(_0x3a370e[_0x1be5('0x3e')][_0x1be5('0x28')]){_0x3a8e54[_0x1be5('0x3d')]=_['merge'](_0x3a8e54[_0x1be5('0x3d')],{'$or':_[_0x1be5('0x81')](_0x3a8e54[_0x1be5('0x43')],function(_0x56a8eb){var _0x38d96c={};_0x38d96c[_0x56a8eb]={'$like':'%'+_0x3a370e[_0x1be5('0x3e')]['filter']+'%'};return _0x38d96c;})});}_0x3a8e54=_[_0x1be5('0xd1')]({},_0x3a8e54,_0x3a370e[_0x1be5('0x4e')]);return _0x3ac3f5[_0x1be5('0xe1')](_0x3a8e54);}})['then'](function(_0x37e9f1){if(_0x37e9f1){_0x30595b=_0x37e9f1[_0x1be5('0x61')];if(!_0x3a370e[_0x1be5('0x3e')][_0x1be5('0xc2')](_0x1be5('0xd2'))){_0x3a8e54[_0x1be5('0x1a')]=qs[_0x1be5('0x1a')](_0x3a370e[_0x1be5('0x3e')][_0x1be5('0x1a')]);_0x3a8e54['offset']=qs[_0x1be5('0x18')](_0x3a370e['query']['offset']);}return _0x3ac3f5[_0x1be5('0xe1')](_0x3a8e54);}})[_0x1be5('0x1f')](function(_0x4678ea){if(_0x4678ea){return _0x4678ea?{'count':_0x30595b,'rows':_0x4678ea}:null;}})[_0x1be5('0x1f')](respondWithResult(_0x30852e,null))[_0x1be5('0x54')](handleError(_0x30852e,null));};exports[_0x1be5('0xe3')]=function(_0x3d8665,_0x408e73,_0x4318b9){var _0x543ad4;var _0x2e59d5;var _0x8413c9;var _0x3fa0f5=!_[_0x1be5('0x5b')](_0x3d8665[_0x1be5('0x53')]['id'])?_0x3d8665[_0x1be5('0x53')]['id']:!_['isNil'](_0x3d8665[_0x1be5('0x75')]['id'])?_0x3d8665[_0x1be5('0x75')]['id']:null;return db[_0x1be5('0x30')][_0x1be5('0x4f')]({'where':{'id':_0x3fa0f5,'role':{'$or':['admin',_0x1be5('0x75'),'agent']}},'attributes':['id',_0x1be5('0x2b'),'phone',_0x1be5('0xe4'),_0x1be5('0x20'),_0x1be5('0x5d'),'loginInPause']})[_0x1be5('0x1f')](function(_0x236ac1){if(_0x236ac1){if(_0x236ac1[_0x1be5('0x20')]===_0x1be5('0x21')){_0x543ad4=_0x236ac1;if(_0x3d8665[_0x1be5('0x52')][_0x1be5('0x96')]){_0x8413c9=util[_0x1be5('0xa2')](_0x1be5('0xe5'),_0x543ad4[_0x3d8665[_0x1be5('0x52')]['interface']]);}else if(_0x3d8665[_0x1be5('0x52')][_0x1be5('0xe6')]){_0x8413c9=util[_0x1be5('0xa2')]('SIP/%s',_0x3d8665[_0x1be5('0x52')][_0x1be5('0xe6')]);}else{_0x8413c9=util[_0x1be5('0xa2')](_0x1be5('0xa3'),_0x543ad4['name']);}socket['to'](util['format']('user:%s',_0x543ad4['name']))[_0x1be5('0x9e')]('user:forcelogout',{'user':{'id':_0x543ad4['id'],'name':_0x543ad4['name']},'ip':_0x3d8665[_0x1be5('0xe7')][_0x1be5('0xe8')]||_0x3d8665[_0x1be5('0xe9')][_0x1be5('0xea')]||_0x3d8665[_0x1be5('0xeb')]['remoteAddress']||_0x3d8665[_0x1be5('0xe9')][_0x1be5('0xeb')]['remoteAddress']});return db[_0x1be5('0xa4')]['destroy']({'where':{'membername':_0x543ad4[_0x1be5('0x2b')]},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0x1be5('0x86'))](_0x1be5('0xec'));}})['then'](function(){if(_0x543ad4){return _0x543ad4[_0x1be5('0xed')]({'raw':!![]});}})[_0x1be5('0x1f')](function(_0x882748){if(_0x543ad4){if(_0x882748){_0x2e59d5=_0x882748;if(_0x2e59d5['length']){var _0x172259=_0x2e59d5['map'](function(_0x4324fb){var _0x1630f5={'membername':_0x543ad4['name'],'UserId':_0x543ad4['id'],'queue_name':_0x4324fb[_0x1be5('0x2b')],'VoiceQueueId':_0x4324fb['id'],'interface':_0x8413c9,'paused':_0x543ad4[_0x1be5('0x94')]||![],'penalty':_0x4324fb[_0x1be5('0xee')]||0x0};return db[_0x1be5('0xa4')][_0x1be5('0xa5')](_0x1630f5);});return Promise['all'](_0x172259);}}}})[_0x1be5('0x1f')](function(){if(_0x543ad4){return db[_0x1be5('0xef')][_0x1be5('0x45')]({'where':{'membername':_0x543ad4[_0x1be5('0x2b')],'exitAt':null}});}})[_0x1be5('0x1f')](function(_0x276de4){if(_0x543ad4){var _0xb9518c=[];_0x276de4[_0x1be5('0xf0')](function(_0xf930fd){_0xb9518c[_0x1be5('0x44')](_0xf930fd[_0x1be5('0x1e')]({'exitAt':moment()[_0x1be5('0xa2')](_0x1be5('0xf1'))}));});return Promise[_0x1be5('0x4c')](_0xb9518c);}})[_0x1be5('0x1f')](function(){if(_0x543ad4){var _0x5e2e98=[];var _0x45e2ec=[];var _0x2cfb5f=utils[_0x1be5('0xf2')]();var _0x28d662={'membername':_0x543ad4[_0x1be5('0x2b')],'interface':_0x8413c9,'enterAt':moment()['format'](_0x1be5('0xf1')),'role':_0x543ad4[_0x1be5('0x20')],'internal':_0x543ad4[_0x1be5('0x5d')]};_0x2cfb5f['forEach'](function(_0x1ed394){_0x5e2e98[_0x1be5('0x44')](_[_0x1be5('0xd1')]({'channel':_0x1ed394,'type':_0x1be5('0xf3'),'data1':_0x3d8665[_0x1be5('0x52')][_0x1be5('0xf4')],'data2':_0x8413c9},_0x28d662));if(_0x543ad4[_0x1be5('0x94')]){_0x45e2ec[_0x1be5('0x44')](_[_0x1be5('0xd1')]({'channel':_0x1ed394,'type':_0x1be5('0xf5'),'data1':'LOGININPAUSE'},_0x28d662));}});return db['MemberReport']['bulkCreate'](_0x5e2e98[_0x1be5('0xc0')](_0x45e2ec),{'individualHooks':!![]});}})[_0x1be5('0x1f')](function(){if(_0x543ad4){return _0x543ad4[_0x1be5('0x1e')]({'online':!![],'lastLoginAt':moment()['format'](_0x1be5('0xf1')),'voicePause':_0x543ad4[_0x1be5('0x94')]||![],'mailPause':_0x543ad4['loginInPause']||![],'chatPause':_0x543ad4['loginInPause']||![],'faxPause':_0x543ad4[_0x1be5('0x94')]||![],'smsPause':_0x543ad4[_0x1be5('0x94')]||![],'openchannelPause':_0x543ad4[_0x1be5('0x94')]||![],'whatsappPause':_0x543ad4[_0x1be5('0x94')]||![],'pauseType':_0x543ad4[_0x1be5('0x94')]?_0x1be5('0xf6'):null,'interface':_0x8413c9,'lastPauseAt':moment()[_0x1be5('0xa2')](_0x1be5('0xf1'))});}})['then'](function(_0x217491){if(_0x3d8665['isMiddleware']){return _0x4318b9();}else{return Promise['resolve'](_0x217491)['then'](respondWithResult(_0x408e73,null));}})[_0x1be5('0x54')](handleError(_0x408e73,null));};exports[_0x1be5('0xf7')]=function(_0x2c13fc,_0x4f92f7){var _0x232919;return db[_0x1be5('0x30')][_0x1be5('0x4f')]({'where':{'id':_0x2c13fc[_0x1be5('0x53')]['id'],'role':_0x1be5('0x21')},'attributes':['id',_0x1be5('0x2b'),_0x1be5('0x20')]})[_0x1be5('0x1f')](handleEntityNotFound(_0x4f92f7,null))[_0x1be5('0x1f')](function(_0x1c2dc8){if(_0x1c2dc8){_0x232919=_0x1c2dc8;return db[_0x1be5('0xa4')][_0x1be5('0x2d')]({'where':{'membername':_0x232919[_0x1be5('0x2b')]},'individualHooks':!![]});}})[_0x1be5('0x1f')](function(){return db[_0x1be5('0xef')]['findAll']({'where':{'membername':_0x232919[_0x1be5('0x2b')],'exitAt':null}});})[_0x1be5('0x1f')](function(_0x4d50ea){var _0x4ea3f4=[];_0x4d50ea[_0x1be5('0xf0')](function(_0x27dfd6){_0x4ea3f4['push'](_0x27dfd6[_0x1be5('0x1e')]({'exitAt':moment()[_0x1be5('0xa2')](_0x1be5('0xf1'))}));});return Promise[_0x1be5('0x4c')](_0x4ea3f4);})[_0x1be5('0x1f')](function(){return _0x232919[_0x1be5('0x1e')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x4f92f7,null))[_0x1be5('0x54')](handleError(_0x4f92f7,null));};exports[_0x1be5('0xf8')]=function(_0x331d59,_0x2d20ee){var _0x354620;return db['UserVoiceQueueRt'][_0x1be5('0x1e')]({'paused':0x1},{'where':{'UserId':_0x331d59[_0x1be5('0x53')]['id']},'individualHooks':!![]})[_0x1be5('0x1f')](function(){return db['User'][_0x1be5('0x4f')]({'where':{'id':_0x331d59[_0x1be5('0x53')]['id'],'role':_0x1be5('0x21')},'attributes':['id',_0x1be5('0x2b'),_0x1be5('0x20'),_0x1be5('0x5d'),_0x1be5('0x96'),_0x1be5('0x93')]});})[_0x1be5('0x1f')](handleEntityNotFound(_0x2d20ee,null))['then'](function(_0x3142eb){if(_0x3142eb){_0x354620=_0x3142eb;return db[_0x1be5('0xef')][_0x1be5('0x45')]({'where':{'membername':_0x354620[_0x1be5('0x2b')],'type':_0x1be5('0xf5'),'exitAt':null}});}})[_0x1be5('0x1f')](function(_0x2891df){if(_0x2891df[_0x1be5('0x61')]){var _0x595429=moment()[_0x1be5('0xa2')](_0x1be5('0xf1'));for(var _0x229b39=0x0,_0x4539d9=_0x2891df[_0x1be5('0x61')];_0x229b39<_0x4539d9;_0x229b39++){_0x2891df[_0x229b39][_0x1be5('0xf9')]({'exitAt':_0x595429});}}})['then'](function(){var _0x7810cd=[];var _0x2c0fa6=utils['getChannels']();_0x2c0fa6[_0x1be5('0xf0')](function(_0x5cf16e){_0x7810cd[_0x1be5('0x44')]({'channel':_0x5cf16e,'membername':_0x354620[_0x1be5('0x2b')],'interface':_['isNil'](_0x354620[_0x1be5('0x96')])?util[_0x1be5('0xa2')](_0x1be5('0xa3'),_0x354620[_0x1be5('0x2b')]):_0x354620[_0x1be5('0x96')],'type':_0x1be5('0xf5'),'enterAt':moment()[_0x1be5('0xa2')](_0x1be5('0xf1')),'data1':_0x331d59[_0x1be5('0x52')]['type']||_0x1be5('0xfa'),'role':_0x354620[_0x1be5('0x20')],'internal':_0x354620[_0x1be5('0x5d')]});});return db[_0x1be5('0xef')]['bulkCreate'](_0x7810cd,{'individualHooks':!![]});})[_0x1be5('0x1f')](function(){return _0x354620[_0x1be5('0x1e')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x331d59['body']['type']||_0x1be5('0xfa'),'lastPauseAt':moment()[_0x1be5('0xa2')](_0x1be5('0xf1'))});})[_0x1be5('0x1f')](respondWithResult(_0x2d20ee,null))[_0x1be5('0x54')](handleError(_0x2d20ee,null));};exports[_0x1be5('0xfb')]=function(_0x2b5b8b,_0x196faa){if(_0x2b5b8b[_0x1be5('0x52')][_0x1be5('0x92')]&&!utils[_0x1be5('0xa7')](_0x2b5b8b[_0x1be5('0x52')][_0x1be5('0x92')])){throw new APIBadRequestError(util[_0x1be5('0xa2')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x2b5b8b[_0x1be5('0x52')]['channel']));}return db[_0x1be5('0x30')][_0x1be5('0x4f')]({'where':{'id':_0x2b5b8b[_0x1be5('0x53')]['id']},'attributes':['id',_0x1be5('0x2b'),_0x1be5('0x20'),_0x1be5('0x5d'),_0x1be5('0x96'),'online','voicePause','mailPause','chatPause','faxPause','openchannelPause',_0x1be5('0xfc'),_0x1be5('0xfd'),'pauseType',_0x1be5('0xfe')]})[_0x1be5('0x1f')](function(_0x49e438){if(!_0x49e438){throw new APINotFoundError(util['format'](_0x1be5('0xc1'),_0x2b5b8b[_0x1be5('0x53')]['id']));}return _0x49e438[_0x1be5('0xfb')](_0x2b5b8b[_0x1be5('0x52')]['channel']);})['then'](respondWithResult(_0x196faa,null))[_0x1be5('0x54')](APIHandleError(_0x196faa));};exports[_0x1be5('0xff')]=function(_0x3ca2b7,_0xbec632){var _0x4ae5ee={};var _0x2565ac={};var _0x240944;var _0x32bb2d;return db[_0x1be5('0x30')][_0x1be5('0x8d')]({'where':{'id':_0x3ca2b7['params']['id']}})[_0x1be5('0x1f')](handleEntityNotFound(_0xbec632,null))[_0x1be5('0x1f')](function(_0x3c1f9a){if(_0x3c1f9a){_0x240944=_0x3c1f9a;_0x2565ac[_0x1be5('0xc9')]=_[_0x1be5('0xca')](db[_0x1be5('0x100')][_0x1be5('0x31')]);_0x2565ac['query']=_[_0x1be5('0xca')](_0x3ca2b7['query']);_0x2565ac['filters']=_['intersection'](_0x2565ac[_0x1be5('0xc9')],_0x2565ac[_0x1be5('0x3e')]);_0x4ae5ee[_0x1be5('0x43')]=_['intersection'](_0x2565ac[_0x1be5('0xc9')],qs[_0x1be5('0xcd')](_0x3ca2b7[_0x1be5('0x3e')][_0x1be5('0xcd')]));_0x4ae5ee[_0x1be5('0x43')]=_0x4ae5ee['attributes'][_0x1be5('0x61')]?_0x4ae5ee['attributes']:_0x2565ac[_0x1be5('0xc9')];_0x4ae5ee[_0x1be5('0xce')]=qs[_0x1be5('0xcf')](_0x3ca2b7[_0x1be5('0x3e')]['sort']);_0x4ae5ee[_0x1be5('0x3d')]=qs[_0x1be5('0xd4')](_[_0x1be5('0xd0')](_0x3ca2b7[_0x1be5('0x3e')],_0x2565ac[_0x1be5('0xd4')]));if(_0x3ca2b7[_0x1be5('0x3e')][_0x1be5('0x28')]){_0x4ae5ee[_0x1be5('0x3d')]=_[_0x1be5('0xd1')](_0x4ae5ee[_0x1be5('0x3d')],{'$or':_[_0x1be5('0x81')](_0x4ae5ee[_0x1be5('0x43')],function(_0x42e239){var _0x42aaa8={};_0x42aaa8[_0x42e239]={'$like':'%'+_0x3ca2b7[_0x1be5('0x3e')]['filter']+'%'};return _0x42aaa8;})});}_0x4ae5ee=_['merge']({},_0x4ae5ee,_0x3ca2b7['options']);return _0x240944[_0x1be5('0xff')](_0x4ae5ee);}})['then'](function(_0xeb1237){if(_0xeb1237){_0x32bb2d=_0xeb1237[_0x1be5('0x61')];if(!_0x3ca2b7[_0x1be5('0x3e')][_0x1be5('0xc2')](_0x1be5('0xd2'))){_0x4ae5ee['limit']=qs[_0x1be5('0x1a')](_0x3ca2b7[_0x1be5('0x3e')][_0x1be5('0x1a')]);_0x4ae5ee[_0x1be5('0x18')]=qs[_0x1be5('0x18')](_0x3ca2b7[_0x1be5('0x3e')]['offset']);}return _0x240944[_0x1be5('0xff')](_0x4ae5ee);}})[_0x1be5('0x1f')](function(_0xc0691e){if(_0xc0691e){return _0xc0691e?{'count':_0x32bb2d,'rows':_0xc0691e}:null;}})['then'](respondWithResult(_0xbec632,null))['catch'](handleError(_0xbec632,null));};exports['addTeams']=function(_0x48ef73,_0x47cdc2){var _0x2ba80b=_0x48ef73[_0x1be5('0x53')]['id'];var _0x44b1ea=_0x48ef73[_0x1be5('0x52')]?_0x48ef73[_0x1be5('0x52')][_0x1be5('0x57')]:null;var _0x55492c=[];return Promise[_0x1be5('0x101')]()['then'](function(){if(!_0x44b1ea)throw new APIBadRequestError(_0x1be5('0x102'));})[_0x1be5('0x1f')](function(){return db[_0x1be5('0x30')]['findOne']({'where':{'id':_0x2ba80b}});})['then'](function(_0x45e488){if(!_0x45e488)throw new APINotFoundError(util[_0x1be5('0xa2')](_0x1be5('0xc1'),_0x48ef73[_0x1be5('0x53')]['id']));return db[_0x1be5('0x5f')][_0x1be5('0x103')](function(_0x2cdcf8){return _0x45e488[_0x1be5('0x104')](_0x44b1ea,{'transaction':_0x2cdcf8})[_0x1be5('0x1f')](function(){return db['Team']['findAll']({'where':{'id':{'$in':_0x44b1ea}}});})[_0x1be5('0x1f')](function(_0x105286){var _0x501218=_[_0x1be5('0x81')](_0x105286,function(_0x384182){return _0x384182[_0x1be5('0x105')]();});return Promise[_0x1be5('0x4c')](_0x501218);})['then'](function(_0x32d602){_0x55492c=_[_0x1be5('0x106')](_0x32d602);var _0x3808db=_[_0x1be5('0x81')](_0x55492c,function(_0x357065){return _0x357065[_0x1be5('0x107')](_0x45e488['id'],{'transaction':_0x2cdcf8});});return Promise[_0x1be5('0x4c')](_0x3808db);})[_0x1be5('0x1f')](function(){if(!_0x45e488['online'])return;var _0x4b1c70=_[_0x1be5('0x28')](_0x55492c,function(_0x533a2b){return _0x533a2b[_0x1be5('0x108')]('channel')===_0x1be5('0x109');});var _0x58e8f1=_[_0x1be5('0x81')](_0x4b1c70,function(_0x2ea2d3){return db[_0x1be5('0xa4')][_0x1be5('0xa5')]({'membername':_0x45e488[_0x1be5('0x2b')],'UserId':_0x45e488['id'],'queue_name':_0x2ea2d3[_0x1be5('0x2b')],'VoiceQueueId':_0x2ea2d3['id'],'interface':_['isNil'](_0x45e488['interface'])?util[_0x1be5('0xa2')](_0x1be5('0xa3'),_0x45e488[_0x1be5('0x2b')]):_0x45e488[_0x1be5('0x96')],'paused':_0x45e488[_0x1be5('0x95')]||![],'penalty':_0x45e488[_0x1be5('0x9b')]},{'transaction':_0x2cdcf8});});return Promise[_0x1be5('0x4c')](_0x58e8f1);})[_0x1be5('0x1f')](function(){return db[_0x1be5('0x10a')][_0x1be5('0x45')]({'where':{'teamId':{'$in':_0x44b1ea}}});})[_0x1be5('0x1f')](function(_0x4b1ca8){var _0x5499b4=_['map'](_0x4b1ca8,function(_0x18cf78){return db[_0x1be5('0x10b')][_0x1be5('0x73')]({'UserId':_0x45e488['id'],'VoicePrefixId':_0x18cf78[_0x1be5('0x10c')]},{'transaction':_0x2cdcf8});});return Promise['all'](_0x5499b4);});});})[_0x1be5('0x1f')](function(){for(var _0x3cf4b5=0x0;_0x3cf4b5<_0x55492c[_0x1be5('0x61')];_0x3cf4b5++){var _0x5c9e0f=_0x55492c[_0x3cf4b5]['getDataValue'](_0x1be5('0x92'));var _0x269951=_0x5c9e0f+_0x1be5('0x9d');socket[_0x1be5('0x9e')](_0x1be5('0x75')+_0x5c9e0f+_0x1be5('0x9f'),{'UserId':_0x2ba80b,['queueField']:_0x55492c[_0x3cf4b5]['id']});}})[_0x1be5('0x1f')](respondWithStatusCode(_0x47cdc2,null))[_0x1be5('0x54')](APIHandleError(_0x47cdc2));};exports['removeTeams']=function(_0x37dbc3,_0x3b6ae9){var _0x1a92af=_0x37dbc3[_0x1be5('0x53')]['id'];var _0x1a2f36=null;if(_0x37dbc3[_0x1be5('0x3e')]['ids']){_0x1a2f36=_[_0x1be5('0xa9')](_0x37dbc3['query'][_0x1be5('0x57')])?_0x37dbc3[_0x1be5('0x3e')]['ids']:[_0x37dbc3[_0x1be5('0x3e')]['ids']];}var _0xbb9b14=[];return Promise['resolve']()['then'](function(){if(!_0x1a2f36)throw new APIBadRequestError('Query\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0x1be5('0x1f')](function(){return db['User']['findOne']({'where':{'id':_0x1a92af}});})['then'](function(_0xffb471){if(!_0xffb471)throw new APINotFoundError(util[_0x1be5('0xa2')](_0x1be5('0xc1'),_0x37dbc3['params']['id']));return db[_0x1be5('0x5f')]['transaction'](function(_0x1e1093){return _0xffb471[_0x1be5('0x10d')](_0x1a2f36,{'transaction':_0x1e1093})[_0x1be5('0x1f')](function(){return db[_0x1be5('0x100')][_0x1be5('0x45')]({'where':{'id':{'$in':_0x1a2f36}}});})[_0x1be5('0x1f')](function(_0x30ba03){var _0x34e1d2=_[_0x1be5('0x81')](_0x30ba03,function(_0x3b71d8){return _0x3b71d8[_0x1be5('0x105')]();});return Promise[_0x1be5('0x4c')](_0x34e1d2);})[_0x1be5('0x1f')](function(_0x4ba411){_0xbb9b14=_['flattenDeep'](_0x4ba411);var _0x3351ca=_[_0x1be5('0x81')](_0xbb9b14,function(_0x11db28){return _0x11db28[_0x1be5('0x10e')](_0xffb471['id'],{'transaction':_0x1e1093});});return Promise[_0x1be5('0x4c')](_0x3351ca);})['then'](function(){if(!_0xffb471[_0x1be5('0x93')])return;var _0x1b8887=_[_0x1be5('0x28')](_0xbb9b14,function(_0x5ebaa3){return _0x5ebaa3['getDataValue'](_0x1be5('0x92'))===_0x1be5('0x109');});var _0x1da0cf=_[_0x1be5('0x81')](_0x1b8887,function(_0x224471){return db[_0x1be5('0xa4')][_0x1be5('0x2d')]({'where':{'VoiceQueueId':_0x224471['id'],'UserId':_0xffb471['id']},'transaction':_0x1e1093});});return Promise[_0x1be5('0x4c')](_0x1da0cf);})[_0x1be5('0x1f')](function(){return db[_0x1be5('0x10a')][_0x1be5('0x45')]({'where':{'teamId':{'$in':_0x1a2f36}}});})[_0x1be5('0x1f')](function(_0x30c8a5){var _0x4c95c0=_[_0x1be5('0x81')](_0x30c8a5,function(_0x3a1187){return db[_0x1be5('0x10b')][_0x1be5('0x2d')]({'where':{'UserId':_0xffb471['id'],'VoicePrefixId':_0x3a1187[_0x1be5('0x10c')]}},{'transaction':_0x1e1093});});return Promise[_0x1be5('0x4c')](_0x4c95c0);});});})[_0x1be5('0x1f')](function(){for(var _0x4c1a05=0x0;_0x4c1a05<_0xbb9b14[_0x1be5('0x61')];_0x4c1a05++){var _0x20ab34=_0xbb9b14[_0x4c1a05][_0x1be5('0x108')](_0x1be5('0x92'));var _0x3fb8f0=_0x20ab34+_0x1be5('0x9d');socket[_0x1be5('0x9e')](_0x1be5('0x75')+_0x20ab34+_0x1be5('0xaa'),{'UserId':_0x1a92af,['queueField']:_0xbb9b14[_0x4c1a05]['id']});}})[_0x1be5('0x1f')](respondWithStatusCode(_0x3b6ae9,null))[_0x1be5('0x54')](APIHandleError(_0x3b6ae9));};exports[_0x1be5('0x10f')]=function(_0x2c1035,_0x5ca7b8){var _0x59ebad={};var _0x11006a={};var _0x1abfc7;var _0x3cabd8;return db[_0x1be5('0x30')][_0x1be5('0x8d')]({'where':{'id':_0x2c1035[_0x1be5('0x53')]['id']}})['then'](handleEntityNotFound(_0x5ca7b8,null))[_0x1be5('0x1f')](function(_0x1417b1){if(_0x1417b1){_0x1abfc7=_0x1417b1;_0x11006a[_0x1be5('0xc9')]=_['keys'](db[_0x1be5('0xc3')][_0x1be5('0x31')]);_0x11006a[_0x1be5('0x3e')]=_['keys'](_0x2c1035[_0x1be5('0x3e')]);_0x11006a['filters']=_[_0x1be5('0xcc')](_0x11006a[_0x1be5('0xc9')],_0x11006a[_0x1be5('0x3e')]);_0x59ebad['attributes']=_['intersection'](_0x11006a['model'],qs['fields'](_0x2c1035[_0x1be5('0x3e')][_0x1be5('0xcd')]));_0x59ebad[_0x1be5('0x43')]=_0x59ebad[_0x1be5('0x43')][_0x1be5('0x61')]?_0x59ebad['attributes']:_0x11006a[_0x1be5('0xc9')];_0x59ebad['order']=qs['sort'](_0x2c1035[_0x1be5('0x3e')][_0x1be5('0xcf')]);_0x59ebad[_0x1be5('0x3d')]=qs['filters'](_[_0x1be5('0xd0')](_0x2c1035['query'],_0x11006a[_0x1be5('0xd4')]));if(_0x2c1035['query']['filter']){_0x59ebad[_0x1be5('0x3d')]=_['merge'](_0x59ebad[_0x1be5('0x3d')],{'$or':_[_0x1be5('0x81')](_0x59ebad[_0x1be5('0x43')],function(_0x127f70){var _0x2e2dec={};_0x2e2dec[_0x127f70]={'$like':'%'+_0x2c1035[_0x1be5('0x3e')][_0x1be5('0x28')]+'%'};return _0x2e2dec;})});}_0x59ebad=_[_0x1be5('0xd1')]({},_0x59ebad,_0x2c1035[_0x1be5('0x4e')]);return _0x1abfc7[_0x1be5('0x10f')](_0x59ebad);}})[_0x1be5('0x1f')](function(_0x176a57){if(_0x176a57){_0x3cabd8=_0x176a57[_0x1be5('0x61')];if(!_0x2c1035[_0x1be5('0x3e')]['hasOwnProperty'](_0x1be5('0xd2'))){_0x59ebad[_0x1be5('0x1a')]=qs['limit'](_0x2c1035[_0x1be5('0x3e')][_0x1be5('0x1a')]);_0x59ebad[_0x1be5('0x18')]=qs[_0x1be5('0x18')](_0x2c1035[_0x1be5('0x3e')][_0x1be5('0x18')]);}return _0x1abfc7[_0x1be5('0x10f')](_0x59ebad);}})['then'](function(_0x17d0a5){if(_0x17d0a5){return _0x17d0a5?{'count':_0x3cabd8,'rows':_0x17d0a5}:null;}})[_0x1be5('0x1f')](respondWithResult(_0x5ca7b8,null))[_0x1be5('0x54')](handleError(_0x5ca7b8,null));};exports['getAgents']=function(_0x535d7a,_0x4d6f74){var _0x55ed3e={};var _0x228374={};var _0x4c481c;return db['User'][_0x1be5('0x8d')]({'where':{'id':_0x535d7a[_0x1be5('0x53')]['id']}})[_0x1be5('0x1f')](handleEntityNotFound(_0x4d6f74,null))[_0x1be5('0x1f')](function(_0x395db2){if(_0x395db2){_0x4c481c=_0x395db2;_0x228374[_0x1be5('0xc9')]=_[_0x1be5('0xca')](db[_0x1be5('0x30')][_0x1be5('0x31')]);_0x228374[_0x1be5('0x3e')]=_['keys'](_0x535d7a[_0x1be5('0x3e')]);_0x228374[_0x1be5('0xd4')]=_[_0x1be5('0xcc')](_0x228374['model'],_0x228374[_0x1be5('0x3e')]);_0x55ed3e[_0x1be5('0x43')]=_[_0x1be5('0xcc')](_0x228374['model'],qs[_0x1be5('0xcd')](_0x535d7a[_0x1be5('0x3e')][_0x1be5('0xcd')]));_0x55ed3e[_0x1be5('0x43')]=_0x55ed3e[_0x1be5('0x43')]['length']?_0x55ed3e[_0x1be5('0x43')]:_0x228374[_0x1be5('0xc9')];_0x55ed3e[_0x1be5('0xce')]=qs[_0x1be5('0xcf')](_0x535d7a[_0x1be5('0x3e')][_0x1be5('0xcf')]);_0x55ed3e[_0x1be5('0x3d')]=qs[_0x1be5('0xd4')](_[_0x1be5('0xd0')](_0x535d7a[_0x1be5('0x3e')],_0x228374[_0x1be5('0xd4')]));if(_0x535d7a['query']['filter']){_0x55ed3e[_0x1be5('0x3d')]=_[_0x1be5('0xd1')](_0x55ed3e[_0x1be5('0x3d')],{'$or':_[_0x1be5('0x81')](_0x55ed3e[_0x1be5('0x43')],function(_0x2a449e){var _0x5297c0={};_0x5297c0[_0x2a449e]={'$like':'%'+_0x535d7a[_0x1be5('0x3e')][_0x1be5('0x28')]+'%'};return _0x5297c0;})});}_0x55ed3e[_0x1be5('0xc9')]=db[_0x1be5('0x30')];_0x55ed3e['as']=_0x1be5('0x26');_0x55ed3e=_['merge']({},_0x55ed3e,_0x535d7a[_0x1be5('0x4e')]);return _0x4c481c[_0x1be5('0xed')]({'include':[_0x55ed3e]});}})['then'](function(_0x3f7f64){if(_0x3f7f64){var _0x4a2212={},_0x44485a=[];for(var _0x13d8c2=0x0;_0x13d8c2<_0x3f7f64[_0x1be5('0x61')];_0x13d8c2+=0x1){for(var _0x522fc8=0x0,_0x4bd362;_0x522fc8<_0x3f7f64[_0x13d8c2]['Agents'][_0x1be5('0x61')];_0x522fc8+=0x1){_0x4bd362=_0x3f7f64[_0x13d8c2][_0x1be5('0x26')][_0x522fc8][_0x1be5('0x23')]({'plain':!![]});_0x4a2212[_0x4bd362['id']]=_0x4bd362;}}_0x4a2212=_[_0x1be5('0x110')](_0x4a2212);for(var _0x457673=qs[_0x1be5('0x18')](_0x535d7a[_0x1be5('0x3e')][_0x1be5('0x18')]);_0x457673<_0x4a2212[_0x1be5('0x61')]&&_0x44485a[_0x1be5('0x61')]=_0x36c708){_0x1c9ae9=_0x36c708;_0x55ee4b=0xc8;}else{_0x55ee4b=0xce;}_0x5c6294[_0x39fc('0x1d')](_0x55ee4b);return _0x5c6294['set'](_0x39fc('0x1e'),_0x3a04e3+'-'+_0x1c9ae9+'/'+_0x36c708)[_0x39fc('0x18')](_0x5e8f93);}return null;};}function saveUpdates(_0x6ee330){return function(_0xc5d431){if(_0xc5d431){return _0xc5d431['update'](_0x6ee330)[_0x39fc('0x1f')](function(_0x2792ae){if(_0x2792ae['role']===_0x39fc('0x20')){socket[_0x39fc('0x21')](_0x39fc('0x22')+_0x2792ae['id'],_0x2792ae);}return _0x2792ae;});}return null;};}function removeEntity(_0x5c0547){return function(_0x41c055){if(_0x41c055){return _0x41c055[_0x39fc('0x23')]()[_0x39fc('0x1f')](function(){var _0x25e3f4=_0x41c055[_0x39fc('0x24')]({'plain':!![]});if(_0x25e3f4['role']===_0x39fc('0x25'))return;var _0x45296e=[{'name':'Users','value':_0x39fc('0x26'),'ignore':!![]},{'name':_0x39fc('0x27'),'value':_0x39fc('0x20'),'ignore':![]},{'name':_0x39fc('0x28'),'value':_0x39fc('0x29'),'ignore':![]}];var _0x53c05e=_(_0x45296e)[_0x39fc('0x2a')](_0x39fc('0x2b'))[_0x39fc('0x2c')]('value')[_0x39fc('0x2d')]();if(_[_0x39fc('0x2e')](_0x53c05e,_0x25e3f4[_0x39fc('0x2f')])){return;}var _0x15bf3c=_[_0x39fc('0x30')](_0x45296e,[_0x39fc('0x2d'),_0x25e3f4['role']])[_0x39fc('0x31')];return db[_0x39fc('0x32')]['destroy']({'where':{'type':_0x15bf3c,'resourceId':_0x25e3f4['id']}})[_0x39fc('0x1f')](function(){return _0x41c055;});})[_0x39fc('0x1f')](function(){_0x5c0547[_0x39fc('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57ccb3){return function(_0x494d3a){if(!_0x494d3a){_0x57ccb3[_0x39fc('0x16')](0x194);}return _0x494d3a;};}function handleError(_0x2b0e77,_0x523373){_0x523373=_0x523373||0x1f4;return function(_0x3d109d){logger['error'](_0x3d109d[_0x39fc('0x33')]);if(_0x3d109d[_0x39fc('0x31')]){delete _0x3d109d[_0x39fc('0x31')];}_0x2b0e77[_0x39fc('0x1d')](_0x523373)[_0x39fc('0x34')](_0x3d109d);};}function getUserAttributes(){return _(db['User'][_0x39fc('0x35')])[_0x39fc('0x2c')](function(_0x108db7){return{'name':_0x108db7[_0x39fc('0x36')],'type':_0x108db7[_0x39fc('0x37')][_0x39fc('0x38')]};})[_0x39fc('0x2a')](function(_0x1dc632){return![_0x39fc('0x39'),_0x39fc('0x3a'),_0x39fc('0x3b'),_0x39fc('0x3c'),'resetPasswordExpires',_0x39fc('0x3d')]['includes'](_0x1dc632[_0x39fc('0x31')]);})[_0x39fc('0x2d')]();}exports[_0x39fc('0x3e')]=function(_0x46d003,_0x12e9f5){var _0x26117c={},_0x1e2c5a={'count':0x0,'rows':[]};var _0x556abc=getUserAttributes();_0x26117c=qs[_0x39fc('0x3f')](_0x556abc,_0x46d003);var _0xab3447={'where':_0x26117c['where']};return db[_0x39fc('0x40')][_0x39fc('0x1b')](_0xab3447)[_0x39fc('0x1f')](function(_0xbe5cc4){_0x1e2c5a[_0x39fc('0x1b')]=_0xbe5cc4;if(_0x46d003[_0x39fc('0x41')]['includeAll']){_0x26117c[_0x39fc('0x42')]=[{'all':!![]}];}if(_0x46d003[_0x39fc('0x41')][_0x39fc('0x43')]===_0x39fc('0x44')){_0x26117c[_0x39fc('0x42')]=[{'model':db[_0x39fc('0x45')],'as':'userSetting'}];}if(!_[_0x39fc('0x2e')](_0x26117c[_0x39fc('0x46')],'id')){_0x26117c[_0x39fc('0x46')][_0x39fc('0x47')]('id');}return db['User'][_0x39fc('0x48')](_0x26117c);})[_0x39fc('0x1f')](function(_0x8051e6){_0x1e2c5a['rows']=_0x8051e6;if(_0x46d003[_0x39fc('0x41')][_0x39fc('0x49')]===_0x39fc('0x44')){var _0x5109bb=[];for(var _0x1699d2=0x0;_0x1699d2<_0x1e2c5a[_0x39fc('0x4a')]['length'];_0x1699d2++){_0x5109bb[_0x39fc('0x47')](get_open_tabs('chat',_0x1e2c5a[_0x39fc('0x4a')][_0x1699d2][_0x39fc('0x4b')]));_0x5109bb['push'](get_open_tabs('sms',_0x1e2c5a[_0x39fc('0x4a')][_0x1699d2][_0x39fc('0x4b')]));_0x5109bb['push'](get_open_tabs(_0x39fc('0x4c'),_0x1e2c5a[_0x39fc('0x4a')][_0x1699d2][_0x39fc('0x4b')]));_0x5109bb[_0x39fc('0x47')](get_open_tabs(_0x39fc('0x4d'),_0x1e2c5a['rows'][_0x1699d2][_0x39fc('0x4b')]));_0x5109bb[_0x39fc('0x47')](get_open_tabs(_0x39fc('0x4e'),_0x1e2c5a[_0x39fc('0x4a')][_0x1699d2][_0x39fc('0x4b')]));_0x5109bb['push'](get_open_tabs('whatsapp',_0x1e2c5a['rows'][_0x1699d2][_0x39fc('0x4b')]));}return Promise['all'](_0x5109bb)[_0x39fc('0x1f')](function(){return _0x1e2c5a;});}else{return _0x1e2c5a;}})['then'](respondWithFilteredResult(_0x12e9f5,_0x26117c))[_0x39fc('0x4f')](handleError(_0x12e9f5,null));};exports[_0x39fc('0x50')]=function(_0x23e2d9,_0xe46180){var _0x3c54e1=getUserAttributes();_0x23e2d9[_0x39fc('0x41')]['id']=_0x23e2d9[_0x39fc('0x51')]['id'];var _0x4c7b85=qs['getOptions'](_0x3c54e1,_0x23e2d9);if(_0x23e2d9[_0x39fc('0x41')][_0x39fc('0x52')]){_0x4c7b85[_0x39fc('0x42')]=[{'all':!![]}];}if(_0x23e2d9['query'][_0x39fc('0x43')]===_0x39fc('0x44')){_0x4c7b85['include']=[{'model':db[_0x39fc('0x45')],'as':'userSetting'}];}_0x4c7b85=_['merge']({},_0x4c7b85,_0x23e2d9[_0x39fc('0x53')]);if(!_[_0x39fc('0x2e')](_0x4c7b85[_0x39fc('0x46')],'id')){_0x4c7b85[_0x39fc('0x46')]['push']('id');}return db[_0x39fc('0x40')][_0x39fc('0x30')](_0x4c7b85)[_0x39fc('0x1f')](handleEntityNotFound(_0xe46180,null))[_0x39fc('0x1f')](function(_0x5d039b){var _0x296dea=[];values=_0x5d039b;if(_0x23e2d9[_0x39fc('0x41')][_0x39fc('0x49')]===_0x39fc('0x44')){_0x296dea[_0x39fc('0x47')](get_open_tabs(_0x39fc('0x54'),_0x5d039b[_0x39fc('0x4b')]));_0x296dea[_0x39fc('0x47')](get_open_tabs(_0x39fc('0x55'),_0x5d039b[_0x39fc('0x4b')]));_0x296dea['push'](get_open_tabs(_0x39fc('0x4e'),_0x5d039b['dataValues']));_0x296dea[_0x39fc('0x47')](get_open_tabs(_0x39fc('0x56'),_0x5d039b['dataValues']));_0x296dea[_0x39fc('0x47')](get_open_tabs(_0x39fc('0x4c'),_0x5d039b[_0x39fc('0x4b')]));_0x296dea[_0x39fc('0x47')](get_open_tabs('mail',_0x5d039b['dataValues']));return Promise[_0x39fc('0x57')](_0x296dea);}else{return values;}})[_0x39fc('0x1f')](function(){return values;})[_0x39fc('0x1f')](respondWithResult(_0xe46180,null))['catch'](handleError(_0xe46180,null));};exports[_0x39fc('0x58')]=function(_0x7b4e45,_0x1eb1bb){if(_0x7b4e45[_0x39fc('0x59')]['id']){delete _0x7b4e45[_0x39fc('0x59')]['id'];}delete _0x7b4e45['body']['role'];return db['User'][_0x39fc('0x30')]({'where':{'id':_0x7b4e45['params']['id']}})['then'](handleEntityNotFound(_0x1eb1bb,null))[_0x39fc('0x1f')](saveUpdates(_0x7b4e45[_0x39fc('0x59')],null))[_0x39fc('0x1f')](respondWithResult(_0x1eb1bb,null))['catch'](handleError(_0x1eb1bb,null));};exports[_0x39fc('0x5a')]=function(_0x546ad8,_0x3190ae){return db[_0x39fc('0x40')][_0x39fc('0x5a')]()[_0x39fc('0x1f')](respondWithResult(_0x3190ae,null))[_0x39fc('0x4f')](handleError(_0x3190ae,null));};exports[_0x39fc('0x5b')]=function(_0x5f403e,_0x23499e){return db['User'][_0x39fc('0x30')]({'where':{'id':_0x5f403e[_0x39fc('0x51')]['id']}})[_0x39fc('0x1f')](handleEntityNotFound(_0x23499e,null))[_0x39fc('0x1f')](function(_0x531e5d){if(_0x531e5d){return _0x531e5d[_0x39fc('0x5b')](_0x5f403e[_0x39fc('0x59')]['ids'],_[_0x39fc('0x5c')](_0x5f403e[_0x39fc('0x59')],[_0x39fc('0x5d'),'id'])||{});}})[_0x39fc('0x1f')](respondWithResult(_0x23499e,null))[_0x39fc('0x4f')](handleError(_0x23499e,null));};function validateUser(_0x5bc251){return new Promise(function(_0xa860fc,_0x36f97e){if(_0x5bc251['internal'])return _0xa860fc(_0x5bc251);return db[_0x39fc('0x5e')][_0x39fc('0x5f')](0x1)['then'](function(_0x3d9d6e){if(_0x3d9d6e[_0x39fc('0x60')])authService[_0x39fc('0x61')](_0x5bc251[_0x39fc('0x39')]);db[_0x39fc('0x40')][_0x39fc('0x62')](_0x39fc('0x63'))['then'](function(_0x5c36e0){if(_[_0x39fc('0x64')](_0x5c36e0)){_0x5bc251[_0x39fc('0x63')]=_0x3d9d6e[_0x39fc('0x65')]||0x1;return;}if(_['isNil'](_0x3d9d6e['min_internal'])||_0x3d9d6e[_0x39fc('0x65')]===_0x5c36e0){_0x5bc251['internal']=_0x5c36e0+0x1;return;}if(_0x3d9d6e[_0x39fc('0x65')]>_0x5c36e0){_0x5bc251[_0x39fc('0x63')]=_0x3d9d6e[_0x39fc('0x65')];return;}return db[_0x39fc('0x66')][_0x39fc('0x41')](_0x39fc('0x67'),{'type':db[_0x39fc('0x66')]['QueryTypes'][_0x39fc('0x68')]})[_0x39fc('0x1f')](function(_0x5b4a8e){if(_0x5b4a8e&&_0x5b4a8e['length']){for(var _0x33171a=0x0,_0x42ccda=_0x5b4a8e[_0x39fc('0x69')];_0x33171a<_0x42ccda&&_[_0x39fc('0x64')](_0x5bc251['internal']);_0x33171a++){if(_0x3d9d6e['min_internal']<=_0x5b4a8e[_0x33171a][_0x39fc('0x6a')]){_0x5bc251[_0x39fc('0x63')]=_0x5b4a8e[_0x33171a][_0x39fc('0x6a')];}else if(_0x3d9d6e[_0x39fc('0x65')]>_0x5b4a8e[_0x33171a]['from']&&_0x3d9d6e['min_internal']<=_0x5b4a8e[_0x33171a]['to']){_0x5bc251['internal']=_0x3d9d6e['min_internal'];}}}if(_[_0x39fc('0x64')](_0x5bc251[_0x39fc('0x63')])){_0x5bc251['internal']=_0x5c36e0+0x1;}return _0xa860fc(_0x5bc251);});});})[_0x39fc('0x4f')](function(_0x4d2f03){_0x36f97e(_0x4d2f03);});});}function updateUser(_0x2eb681){return new Promise(function(_0x15332c,_0x2baabe){try{if(_0x2eb681[_0x39fc('0x6b')]){_0x2eb681['mailbox']=_0x2eb681['internal'];_0x2eb681['VoiceMail']={'mailbox':_0x2eb681[_0x39fc('0x63')],'password':_0x2eb681[_0x39fc('0x39')],'fullname':_0x2eb681[_0x39fc('0x6c')],'email':_0x2eb681['email']};}if(_0x2eb681['role']==='agent'){if(!_0x2eb681['permissions'])_0x2eb681[_0x39fc('0x6d')]=['101',_0x39fc('0x6e'),'103',_0x39fc('0x6f'),_0x39fc('0x70'),_0x39fc('0x71'),_0x39fc('0x72'),_0x39fc('0x73'),_0x39fc('0x74'),_0x39fc('0x75'),'109',_0x39fc('0x76'),_0x39fc('0x77'),'114',_0x39fc('0x78')];}_0x15332c(_0x2eb681);}catch(_0x26997f){_0x2baabe(_0x26997f);}});}exports[_0x39fc('0x79')]=function(_0x53b4eb,_0x1774b2){if(_0x53b4eb['user'][_0x39fc('0x2f')]===_0x39fc('0x20'))throw new Error(_0x39fc('0x7a'));if(_0x53b4eb[_0x39fc('0x59')][_0x39fc('0x2f')]==='user'&&_0x53b4eb[_0x39fc('0x26')][_0x39fc('0x2f')]!=='admin'){throw new Error(_0x39fc('0x7b'));}if(_0x53b4eb['body'][_0x39fc('0x2f')]==='admin'&&_0x53b4eb[_0x39fc('0x26')][_0x39fc('0x2f')]!==_0x39fc('0x25')){throw new Error(_0x39fc('0x7c'));}return licenseUtil[_0x39fc('0x7d')]([_0x53b4eb['body']])[_0x39fc('0x1f')](function(){return validateUser(_0x53b4eb[_0x39fc('0x59')]);})[_0x39fc('0x1f')](function(_0x22599a){return updateUser(_0x22599a)[_0x39fc('0x1f')](function(_0x295906){if(_0x295906[_0x39fc('0x2f')]==='admin'){_0x295906[_0x39fc('0x7e')]=_0x53b4eb['user'][_0x39fc('0x7e')];delete _0x295906[_0x39fc('0x7f')];}return _0x295906;});})[_0x39fc('0x1f')](function(_0x49ae6b){return db[_0x39fc('0x40')][_0x39fc('0x79')](_0x49ae6b,{'include':[{'model':db[_0x39fc('0x80')],'as':_0x39fc('0x80')}]});})[_0x39fc('0x1f')](function(_0xe07426){if(_0x53b4eb[_0x39fc('0x59')][_0x39fc('0x2f')]===_0x39fc('0x26'))return _0xe07426;if(_0x53b4eb['user'][_0x39fc('0x2f')]!=='user')return _0xe07426;return db['UserProfileSection'][_0x39fc('0x30')]({'where':{'name':_0xe07426[_0x39fc('0x2f')]===_0x39fc('0x20')?_0x39fc('0x27'):'Telephones','userProfileId':_0x53b4eb['user'][_0x39fc('0x7f')]},'raw':!![]})[_0x39fc('0x1f')](function(_0x497163){if(!_0x497163||_0x497163[_0x39fc('0x81')]!=0x0)return _0xe07426;return db[_0x39fc('0x32')]['create']({'name':_0xe07426[_0x39fc('0x31')],'resourceId':_0xe07426['id'],'type':_0x497163[_0x39fc('0x31')],'sectionId':_0x497163['id']},{})['then'](function(){return _0xe07426;});})[_0x39fc('0x4f')](function(_0x4b52f2){logger[_0x39fc('0x82')](_0x39fc('0x83'),_0x4b52f2);throw _0x4b52f2;});})['then'](respondWithResult(_0x1774b2,0xc9))['catch'](handleError(_0x1774b2,null));};exports[_0x39fc('0x84')]=function(_0x2ac545,_0x5c5e32){var _0x1e103f=_0x2ac545[_0x39fc('0x59')];var _0x2ed008=[];if(_0x2ac545[_0x39fc('0x26')][_0x39fc('0x2f')]===_0x39fc('0x20'))throw new Error('Unauthorized');if(_[_0x39fc('0x85')](_0x1e103f,[_0x39fc('0x2f'),'user'])&&_0x2ac545[_0x39fc('0x26')][_0x39fc('0x2f')]!==_0x39fc('0x25')){throw new Error(_0x39fc('0x7b'));}if(_[_0x39fc('0x85')](_0x1e103f,['role',_0x39fc('0x25')])&&_0x2ac545['user'][_0x39fc('0x2f')]!==_0x39fc('0x25')){throw new Error(_0x39fc('0x86'));}return licenseUtil[_0x39fc('0x7d')](_0x1e103f)[_0x39fc('0x1f')](function(){return validateUser(_0x1e103f[0x0]);})[_0x39fc('0x1f')](function(){for(var _0x556e64=0x1;_0x556e64<_0x1e103f[_0x39fc('0x69')];_0x556e64++){var _0x71bafd=_0x1e103f[_0x556e64-0x1][_0x39fc('0x63')];if(!_0x1e103f[_0x556e64][_0x39fc('0x63')])_0x1e103f[_0x556e64][_0x39fc('0x63')]=_0x71bafd+0x1;_0x2ed008[_0x39fc('0x47')](validateUser(_0x1e103f[_0x556e64]));}return Promise['all'](_0x2ed008);})['then'](function(){_0x2ed008=[];for(var _0x5467c1=0x0;_0x5467c1<_0x1e103f[_0x39fc('0x69')];_0x5467c1++){_0x2ed008[_0x39fc('0x47')](updateUser(_0x1e103f[_0x5467c1]));}return Promise[_0x39fc('0x57')](_0x2ed008);})['then'](function(){_0x2ed008=_0x1e103f[_0x39fc('0x2c')](function(_0x3d5609){return db[_0x39fc('0x40')][_0x39fc('0x79')](_0x3d5609,{'include':[{'model':db[_0x39fc('0x80')],'as':'VoiceMail'}]})[_0x39fc('0x1f')](function(_0x574536){_0x3d5609['id']=_0x574536['id'];return _0x3d5609;});});return Promise[_0x39fc('0x57')](_0x2ed008);})[_0x39fc('0x1f')](function(_0x4f63de){if(_0x2ac545['body'][_0x39fc('0x2f')]===_0x39fc('0x26'))return _0x4f63de;if(_0x2ac545[_0x39fc('0x26')][_0x39fc('0x2f')]!==_0x39fc('0x26'))return _0x4f63de;var _0x5750d3=_[_0x39fc('0x85')](_0x4f63de,function(_0x4b3ffa){return _0x4b3ffa['role']==='agent'||_0x4b3ffa[_0x39fc('0x2f')]===_0x39fc('0x29');});if(!_0x5750d3)return _0x4f63de;return db[_0x39fc('0x87')][_0x39fc('0x48')]({'where':{'name':{'$or':[_0x39fc('0x27'),_0x39fc('0x28')]},'userProfileId':_0x2ac545[_0x39fc('0x26')][_0x39fc('0x7f')]},'raw':!![]})[_0x39fc('0x1f')](function(_0x384196){if(_[_0x39fc('0x88')](_0x384196)||!_[_0x39fc('0x85')](_0x384196,[_0x39fc('0x81'),0x0]))return _0x4f63de;_0x2ed008=[];var _0x3964a0=_(_0x384196)[_0x39fc('0x2c')](function(_0x36b860){if(_0x36b860[_0x39fc('0x81')]===0x1)return;return _0x36b860[_0x39fc('0x31')]===_0x39fc('0x27')?'agent':_0x39fc('0x29');})[_0x39fc('0x89')]()['value']();for(var _0xe5e1de=0x0;_0xe5e1de<_0x4f63de[_0x39fc('0x69')];_0xe5e1de++){if(!_[_0x39fc('0x2e')](_0x3964a0,_0x4f63de[_0xe5e1de][_0x39fc('0x2f')]))return;var _0x5a8ebb=_0x4f63de[_0xe5e1de][_0x39fc('0x2f')]===_0x39fc('0x20')?_0x39fc('0x27'):_0x39fc('0x28');_0x2ed008[_0x39fc('0x47')](db[_0x39fc('0x32')][_0x39fc('0x79')]({'name':_0x4f63de[_0xe5e1de][_0x39fc('0x31')],'resourceId':_0x4f63de[_0xe5e1de]['id'],'type':_0x5a8ebb,'sectionId':_[_0x39fc('0x30')](_0x384196,[_0x39fc('0x31'),_0x5a8ebb])['id']},{}));}return Promise[_0x39fc('0x57')](_0x2ed008);});})[_0x39fc('0x1f')](respondWithResult(_0x5c5e32,0xc9))[_0x39fc('0x4f')](handleError(_0x5c5e32,null));};exports[_0x39fc('0x8a')]=function(_0x511b05,_0x3e0d26){if(_0x511b05['body']['id']){delete _0x511b05[_0x39fc('0x59')]['id'];}return db['User']['find']({'where':{'id':_0x511b05[_0x39fc('0x51')]['id']}})['then'](function(_0x476f92){if(!_0x476f92)return null;if(_0x476f92['id']===_0x511b05['user']['id']){if(!_0x511b05['body'][_0x39fc('0x8b')]||!_0x511b05[_0x39fc('0x59')][_0x39fc('0x8c')]){throw new db[(_0x39fc('0x8d'))][(_0x39fc('0x8e'))](_0x39fc('0x8f'));}if(!_0x476f92[_0x39fc('0x90')](_0x511b05[_0x39fc('0x59')]['oldPassword'])){throw new db['Sequelize']['ValidationError'](_0x39fc('0x91'));}if(_0x511b05[_0x39fc('0x59')][_0x39fc('0x8b')]===_0x511b05[_0x39fc('0x59')]['newPassword']){throw new db['Sequelize'][(_0x39fc('0x8e'))](_0x39fc('0x92'));}}else if(_0x511b05[_0x39fc('0x26')]['role']===_0x39fc('0x25')){if(!_0x511b05[_0x39fc('0x59')]['newPassword']){throw new db[(_0x39fc('0x8d'))][(_0x39fc('0x8e'))](_0x39fc('0x93'));}}else if(_0x511b05[_0x39fc('0x26')]['role']==='user'){if(!_0x511b05['body'][_0x39fc('0x8c')]){throw new db[(_0x39fc('0x8d'))]['ValidationError'](_0x39fc('0x93'));}if(_0x476f92[_0x39fc('0x2f')]!=='agent'){throw new db[(_0x39fc('0x8d'))][(_0x39fc('0x8e'))](_0x39fc('0x7a'));}}else{throw new db[(_0x39fc('0x8d'))][(_0x39fc('0x8e'))](_0x39fc('0x7a'));}return _0x476f92;})['then'](handleEntityNotFound(_0x3e0d26,null))[_0x39fc('0x1f')](function(_0x13c778){return db['Setting'][_0x39fc('0x94')]({'attributes':['id',_0x39fc('0x60'),_0x39fc('0x95'),'passwordHistoryLimit']})[_0x39fc('0x1f')](function(_0x45a7d3){if(_0x45a7d3[_0x39fc('0x60')])authService[_0x39fc('0x61')](_0x511b05[_0x39fc('0x59')][_0x39fc('0x8c')]);if(!_0x45a7d3[_0x39fc('0x95')]||!_0x13c778['previousPasswords'])return _0x13c778;authService[_0x39fc('0x96')](_0x511b05[_0x39fc('0x59')]['newPassword'],_0x13c778['previousPasswords'],_0x45a7d3[_0x39fc('0x97')]);return _0x13c778;})['then'](saveUpdates({'password':_0x511b05[_0x39fc('0x59')]['newPassword'],'passwordResetAt':_0x511b05[_0x39fc('0x26')]['id']==_0x511b05['params']['id']?moment():null,'previousPasswords':authService[_0x39fc('0x98')](_0x511b05[_0x39fc('0x59')]['newPassword'],_0x13c778[_0x39fc('0x3b')])},null));})['then'](respondWithResult(_0x3e0d26,null))['catch'](handleError(_0x3e0d26,null));};exports[_0x39fc('0x99')]=function(_0x57f332,_0xadea9){var _0x58e0c7=_0x57f332[_0x39fc('0x59')][_0x39fc('0x9a')];return db[_0x39fc('0x40')][_0x39fc('0x30')]({'where':{'id':_0x57f332[_0x39fc('0x51')]['id']},'attributes':['id',_0x39fc('0x31'),_0x39fc('0x2f'),'online',_0x39fc('0x9b'),_0x39fc('0x9c'),_0x39fc('0x9d')]})[_0x39fc('0x1f')](handleEntityNotFound(_0xadea9,null))[_0x39fc('0x1f')](function(_0x4f05f3){if(_0x4f05f3){if(!utils['isValidChannel'](_0x58e0c7)){throw new db[(_0x39fc('0x8d'))]['ValidationError'](_0x39fc('0x9e'));}return _0x4f05f3[_0x39fc('0x9f')+_['capitalize'](_0x58e0c7[_0x39fc('0xa0')]())+_0x39fc('0xa1')](_0x57f332[_0x39fc('0x59')][_0x39fc('0x5d')],{'penalty':_0x57f332['body'][_0x39fc('0xa2')]||0x0})[_0x39fc('0xa3')](function(_0x549ac8){for(var _0x998fb0=0x0;_0x998fb0<_0x57f332[_0x39fc('0x59')][_0x39fc('0x5d')][_0x39fc('0x69')];_0x998fb0+=0x1){var _0x3440c3={'UserId':Number(_0x57f332[_0x39fc('0x51')]['id'])};_0x3440c3[_[_0x39fc('0xa4')](_0x58e0c7[_0x39fc('0xa0')]())+_0x39fc('0xa5')]=Number(_0x57f332[_0x39fc('0x59')][_0x39fc('0x5d')][_0x998fb0]);socket['emit'](_0x39fc('0x26')+_[_0x39fc('0xa4')](_0x58e0c7['toLowerCase']())+'Queue:save',_0x3440c3);}return _0x549ac8;})[_0x39fc('0x1f')](function(){if(_0x58e0c7==='voice'){return db['VoiceQueue'][_0x39fc('0x48')]({'where':{'id':_0x57f332[_0x39fc('0x59')][_0x39fc('0x5d')]||[]},'raw':!![],'attributes':['id',_0x39fc('0x31')]});}})[_0x39fc('0x1f')](function(_0x22bf38){var _0x26a856=_0x4f05f3[_0x39fc('0x24')]({'plain':!![]});var _0x363f26=[];if(_0x58e0c7==='voice'&&_0x26a856[_0x39fc('0x2f')]===_0x39fc('0x20')&&_0x26a856[_0x39fc('0xa6')]){for(let _0x49605c=0x0;_0x49605c<_0x22bf38[_0x39fc('0x69')];_0x49605c+=0x1){_0x363f26[_0x39fc('0x47')]({'membername':_0x26a856[_0x39fc('0x31')],'UserId':_0x26a856['id'],'queue_name':_0x22bf38[_0x49605c][_0x39fc('0x31')],'VoiceQueueId':_0x22bf38[_0x49605c]['id'],'interface':_[_0x39fc('0x64')](_0x26a856[_0x39fc('0x9d')])?util[_0x39fc('0xa7')](_0x39fc('0xa8'),_0x26a856['name']):_0x26a856[_0x39fc('0x9d')],'paused':_0x26a856[_0x39fc('0x9c')]||![],'penalty':_0x57f332[_0x39fc('0x59')][_0x39fc('0xa2')]||0x0});}return Promise[_0x39fc('0x57')](_0x363f26['map'](function(_0x589e32){return db['UserVoiceQueueRt']['upsert'](_0x589e32);}));}return _0x4f05f3;});}})[_0x39fc('0x1f')](respondWithStatusCode(_0xadea9,null))['catch'](handleError(_0xadea9,null));};exports[_0x39fc('0xa9')]=function(_0x2d7d46,_0xe898b0){var _0x347363,_0x584ffc;return db[_0x39fc('0x40')][_0x39fc('0x30')]({'where':{'id':_0x2d7d46['params']['id']},'attributes':['id',_0x39fc('0x31'),_0x39fc('0x2f')]})[_0x39fc('0x1f')](handleEntityNotFound(_0xe898b0,null))['then'](function(_0x582645){if(_0x582645){_0x347363=_0x582645;if(!_0x2d7d46[_0x39fc('0x41')]['channel']||!utils[_0x39fc('0xaa')](_0x2d7d46[_0x39fc('0x41')]['channel'])){throw new db[(_0x39fc('0x8d'))][(_0x39fc('0x8e'))](_0x39fc('0x9e'));}return _0x582645['remove'+_[_0x39fc('0xa4')](_0x2d7d46[_0x39fc('0x41')][_0x39fc('0x9a')][_0x39fc('0xa0')]())+'Queues'](_0x2d7d46['query']['ids']);}})[_0x39fc('0x1f')](function(_0x104d8d){if(_[_0x39fc('0xab')](_0x2d7d46['query']['ids'])){for(var _0x166215=0x0;_0x166215<_0x2d7d46[_0x39fc('0x41')][_0x39fc('0x5d')][_0x39fc('0x69')];_0x166215+=0x1){_0x584ffc={'UserId':Number(_0x2d7d46[_0x39fc('0x51')]['id'])};_0x584ffc[_[_0x39fc('0xa4')](_0x2d7d46['query'][_0x39fc('0x9a')][_0x39fc('0xa0')]())+_0x39fc('0xa5')]=Number(_0x2d7d46[_0x39fc('0x41')][_0x39fc('0x5d')][_0x166215]);socket[_0x39fc('0x21')](_0x39fc('0x26')+_[_0x39fc('0xa4')](_0x2d7d46[_0x39fc('0x41')][_0x39fc('0x9a')][_0x39fc('0xa0')]())+_0x39fc('0xac'),_0x584ffc);}}else{_0x584ffc={'UserId':Number(_0x2d7d46[_0x39fc('0x51')]['id'])};_0x584ffc[_[_0x39fc('0xa4')](_0x2d7d46[_0x39fc('0x41')][_0x39fc('0x9a')][_0x39fc('0xa0')]())+_0x39fc('0xa5')]=Number(_0x2d7d46[_0x39fc('0x41')][_0x39fc('0x5d')]);socket['emit'](_0x39fc('0x26')+_[_0x39fc('0xa4')](_0x2d7d46[_0x39fc('0x41')][_0x39fc('0x9a')][_0x39fc('0xa0')]())+_0x39fc('0xac'),_0x584ffc);}return _0x104d8d;})[_0x39fc('0x1f')](function(){if(_0x2d7d46['query'][_0x39fc('0x9a')]===_0x39fc('0xad')){return db['UserVoiceQueueRt'][_0x39fc('0x23')]({'where':{'UserId':_0x2d7d46[_0x39fc('0x51')]['id'],'VoiceQueueId':_0x2d7d46['query'][_0x39fc('0x5d')]},'individualHooks':!![]})[_0x39fc('0x1f')](function(){return _0x347363;});}return _0x347363;})[_0x39fc('0x1f')](respondWithStatusCode(_0xe898b0,null))[_0x39fc('0x4f')](handleError(_0xe898b0,null));};exports['addAvatar']=function(_0x5ee277,_0x57f514){_0x5ee277[_0x39fc('0x59')][_0x39fc('0xae')]=_0x5ee277[_0x39fc('0xaf')][_0x39fc('0xb0')];return db[_0x39fc('0x40')][_0x39fc('0x30')]({'where':{'id':_0x5ee277[_0x39fc('0x51')]['id']}})[_0x39fc('0x1f')](handleEntityNotFound(_0x57f514,null))[_0x39fc('0x1f')](saveUpdates(_0x5ee277['body'],null))[_0x39fc('0x1f')](respondWithResult(_0x57f514,null))[_0x39fc('0x4f')](handleError(_0x57f514,null));};exports[_0x39fc('0xb1')]=function(_0x9946a,_0xa9bc8e){var _0x4067b6=path[_0x39fc('0xb2')](config[_0x39fc('0xb3')],_0x39fc('0xb4'));return db['User']['find']({'where':{'id':_0x9946a[_0x39fc('0x51')]['id']},'attributes':['id',_0x39fc('0xae')],'raw':!![]})['then'](handleEntityNotFound(_0xa9bc8e,null))[_0x39fc('0x1f')](function(_0x5e4f13){if(_0x5e4f13){if(_['isNil'](_0x5e4f13[_0x39fc('0xae')])){return _0xa9bc8e[_0x39fc('0xb5')](_0x4067b6);}else{if(!fs[_0x39fc('0xb6')](path[_0x39fc('0xb2')](config[_0x39fc('0xb3')],_0x39fc('0xb7'),_0x5e4f13[_0x39fc('0xae')]))){return _0xa9bc8e[_0x39fc('0xb5')](_0x4067b6);}return _0xa9bc8e[_0x39fc('0xb5')](path[_0x39fc('0xb2')](config[_0x39fc('0xb3')],_0x39fc('0xb7'),_0x5e4f13[_0x39fc('0xae')]));}}})[_0x39fc('0x4f')](handleError(_0xa9bc8e,null));};exports[_0x39fc('0xb8')]=function(_0x2c06eb,_0x35b00d){return db[_0x39fc('0x40')][_0x39fc('0x30')]({'where':{'id':_0x2c06eb[_0x39fc('0x51')]['id']},'attributes':['id']})[_0x39fc('0x1f')](handleEntityNotFound(_0x35b00d,null))['then'](function(_0x3c8c14){var _0x44f722=[];values=_0x3c8c14['dataValues'];_0x44f722['push'](get_open_tabs(_0x39fc('0x54'),_0x3c8c14[_0x39fc('0x4b')]));_0x44f722[_0x39fc('0x47')](get_open_tabs('sms',_0x3c8c14['dataValues']));_0x44f722[_0x39fc('0x47')](get_open_tabs(_0x39fc('0x4e'),_0x3c8c14[_0x39fc('0x4b')]));_0x44f722[_0x39fc('0x47')](get_open_tabs(_0x39fc('0x56'),_0x3c8c14[_0x39fc('0x4b')]));_0x44f722[_0x39fc('0x47')](get_open_tabs('fax',_0x3c8c14[_0x39fc('0x4b')]));_0x44f722[_0x39fc('0x47')](get_open_tabs(_0x39fc('0x4d'),_0x3c8c14[_0x39fc('0x4b')]));return Promise[_0x39fc('0x57')](_0x44f722);})[_0x39fc('0x1f')](function(_0x1e854f){if(_0x1e854f){var _0x47f51b=_[_0x39fc('0x2c')](values[_0x39fc('0xb9')],function(_0x5b71be){return{'channel':_0x39fc('0xba'),'id':_0x5b71be['id'],'createdAt':_0x5b71be[_0x39fc('0xbb')]};});var _0x7bc998=_[_0x39fc('0x2c')](values[_0x39fc('0xbc')],function(_0x2a327b){return{'channel':_0x39fc('0xbd'),'id':_0x2a327b['id'],'createdAt':_0x2a327b[_0x39fc('0xbb')]};});var _0x24fbaf=_[_0x39fc('0x2c')](values['OpenchannelOpenTabs'],function(_0x4ffff4){return{'channel':_0x39fc('0xbe'),'id':_0x4ffff4['id'],'createdAt':_0x4ffff4[_0x39fc('0xbb')]};});var _0x528495=_[_0x39fc('0x2c')](values[_0x39fc('0xbf')],function(_0x94b972){return{'channel':_0x39fc('0xc0'),'id':_0x94b972['id'],'createdAt':_0x94b972[_0x39fc('0xbb')]};});var _0x57f2a9=_[_0x39fc('0x2c')](values['SmsOpenTabs'],function(_0x58591c){return{'channel':_0x39fc('0xc1'),'id':_0x58591c['id'],'createdAt':_0x58591c[_0x39fc('0xbb')]};});var _0x216cf7=_[_0x39fc('0x2c')](values[_0x39fc('0xc2')],function(_0x26404b){return{'channel':_0x39fc('0xc3'),'id':_0x26404b['id'],'createdAt':_0x26404b[_0x39fc('0xbb')]};});var _0x460fa8=_[_0x39fc('0xc4')](_0x47f51b,_0x7bc998,_0x24fbaf,_0x528495,_0x57f2a9,_0x216cf7);var _0x46af1a={'count':_0x460fa8['length'],'rows':_0x460fa8};return _0x46af1a;}else return null;})[_0x39fc('0x1f')](respondWithResult(_0x35b00d,null))[_0x39fc('0x4f')](handleError(_0x35b00d,null));};exports[_0x39fc('0xc5')]=function(_0x2e39f2,_0x496cea){var _0x54680f={};return db['User'][_0x39fc('0x94')]({'where':{'id':_0x2e39f2[_0x39fc('0x51')]['id']}})[_0x39fc('0x1f')](function(_0x2de014){if(!_0x2de014){throw new APINotFoundError(util[_0x39fc('0xa7')](_0x39fc('0xc6'),_0x2e39f2[_0x39fc('0x51')]['id']));}return contacts['describe']();})[_0x39fc('0x1f')](function(_0x50c656){_0x2e39f2[_0x39fc('0x41')]['User']=_0x2e39f2[_0x39fc('0x51')]['id'];_0x54680f=qs[_0x39fc('0x3f')](_0x50c656,_0x2e39f2);if(_0x2e39f2[_0x39fc('0x41')][_0x39fc('0xc7')](_0x39fc('0x52'))){_0x54680f['include']=[{'model':db[_0x39fc('0xc8')],'as':_0x39fc('0xc9'),'required':![]},{'model':db[_0x39fc('0xca')],'as':_0x39fc('0xcb'),'attributes':['id',_0x39fc('0x31'),_0x39fc('0xcc')],'where':_0x2e39f2['query']['tag']?{'id':_0x2e39f2[_0x39fc('0x41')]['tag']}:undefined,'required':_0x2e39f2[_0x39fc('0x41')][_0x39fc('0xcd')]?!![]:![]}];}return contacts['findAll'](_0x2e39f2[_0x39fc('0x41')],_0x2e39f2[_0x39fc('0x26')],_0x54680f,_0x50c656);})[_0x39fc('0x1f')](respondWithFilteredResult(_0x496cea,_0x54680f))['catch'](APIHandleError(_0x496cea));};exports[_0x39fc('0xce')]=function(_0x12aea0,_0x431504){var _0x5124cb;var _0x324038={};var _0x150ef7;return db[_0x39fc('0x40')][_0x39fc('0x94')]({'where':{'id':_0x12aea0['params']['id']},'attributes':['id',_0x39fc('0x31'),'role']})['then'](handleEntityNotFound(_0x431504,null))['then'](function(_0x27584b){if(!utils[_0x39fc('0xaa')](_0x12aea0[_0x39fc('0x41')]['channel'])){throw new db[(_0x39fc('0x8d'))][(_0x39fc('0x8e'))](_0x39fc('0x9e'));}_0x5124cb=_0x27584b;var _0x110939={};_0x110939[_0x39fc('0xcf')]=_['keys'](db[_[_0x39fc('0xa4')](_0x12aea0[_0x39fc('0x41')][_0x39fc('0x9a')])+_0x39fc('0xd0')][_0x39fc('0x35')]);_0x110939[_0x39fc('0x41')]=_[_0x39fc('0xd1')](_0x12aea0[_0x39fc('0x41')]);_0x110939[_0x39fc('0xd2')]=_[_0x39fc('0xd3')](_0x110939['model'],_0x110939[_0x39fc('0x41')]);_0x324038['attributes']=_[_0x39fc('0xd3')](_0x110939['model'],qs[_0x39fc('0xd4')](_0x12aea0[_0x39fc('0x41')][_0x39fc('0xd4')]));_0x324038[_0x39fc('0x46')]=_0x324038[_0x39fc('0x46')][_0x39fc('0x69')]?_0x324038[_0x39fc('0x46')]:_0x110939['model'];_0x324038['order']=qs[_0x39fc('0xd5')](_0x12aea0['query'][_0x39fc('0xd5')]);_0x324038['where']=qs['filters'](_[_0x39fc('0xd6')](_0x12aea0['query'],_0x110939[_0x39fc('0xd2')]));if(_0x12aea0[_0x39fc('0x41')][_0x39fc('0x2a')]){_0x324038['where']=_[_0x39fc('0xd7')](_0x324038[_0x39fc('0xd8')],{'$or':_[_0x39fc('0x2c')](_0x324038[_0x39fc('0x46')],function(_0x41f2c9){var _0x50facf={};_0x50facf[_0x41f2c9]={'$like':'%'+_0x12aea0[_0x39fc('0x41')][_0x39fc('0x2a')]+'%'};return _0x50facf;})});}_0x324038=_[_0x39fc('0xd7')]({},_0x324038,_0x12aea0['options']);switch(_0x5124cb[_0x39fc('0x2f')]){case _0x39fc('0x25'):return db[_[_0x39fc('0xa4')](_0x12aea0[_0x39fc('0x41')]['channel'])+_0x39fc('0xd0')][_0x39fc('0x48')](_0x324038);case _0x39fc('0x26'):case _0x39fc('0x20'):return _0x5124cb[_0x39fc('0x24')+_[_0x39fc('0xa4')](_0x12aea0[_0x39fc('0x41')]['channel'])+_0x39fc('0xa1')](_0x324038);default:throw new db[(_0x39fc('0x8d'))][(_0x39fc('0x8e'))](_0x39fc('0xd9'));}})['then'](function(_0xaaeeed){_0x150ef7=_0xaaeeed[_0x39fc('0x69')];if(!_0x12aea0['query'][_0x39fc('0xc7')](_0x39fc('0xda'))){_0x324038[_0x39fc('0x1c')]=qs[_0x39fc('0x1c')](_0x12aea0[_0x39fc('0x41')][_0x39fc('0x1c')]);_0x324038[_0x39fc('0x19')]=qs[_0x39fc('0x19')](_0x12aea0[_0x39fc('0x41')]['offset']);}switch(_0x5124cb[_0x39fc('0x2f')]){case _0x39fc('0x25'):return db[_[_0x39fc('0xa4')](_0x12aea0[_0x39fc('0x41')][_0x39fc('0x9a')])+_0x39fc('0xd0')][_0x39fc('0x48')](_0x324038);case _0x39fc('0x26'):case _0x39fc('0x20'):return _0x5124cb['get'+_['capitalize'](_0x12aea0[_0x39fc('0x41')][_0x39fc('0x9a')])+_0x39fc('0xa1')](_0x324038);}})['then'](function(_0x3e94a6){return{'count':_0x150ef7,'rows':_0x3e94a6};})[_0x39fc('0x1f')](respondWithResult(_0x431504,null))['catch'](handleError(_0x431504,null));};exports[_0x39fc('0xdb')]=function(_0x3400eb,_0x179a63){var _0x9dd731={};var _0x44e9e9={};var _0x3f3108;var _0x5b7381;return db['User'][_0x39fc('0x94')]({'where':{'id':_0x3400eb[_0x39fc('0x51')]['id']}})['then'](handleEntityNotFound(_0x179a63,null))[_0x39fc('0x1f')](function(_0x2cf9e1){if(_0x2cf9e1){_0x3f3108=_0x2cf9e1;_0x44e9e9[_0x39fc('0xcf')]=_[_0x39fc('0xd1')](db[_0x39fc('0xdc')][_0x39fc('0x35')]);_0x44e9e9[_0x39fc('0x41')]=_[_0x39fc('0xd1')](_0x3400eb[_0x39fc('0x41')]);_0x44e9e9['filters']=_['intersection'](_0x44e9e9[_0x39fc('0xcf')],_0x44e9e9[_0x39fc('0x41')]);_0x9dd731['attributes']=_['intersection'](_0x44e9e9[_0x39fc('0xcf')],qs['fields'](_0x3400eb['query']['fields']));_0x9dd731[_0x39fc('0x46')]=_0x9dd731[_0x39fc('0x46')][_0x39fc('0x69')]?_0x9dd731[_0x39fc('0x46')]:_0x44e9e9[_0x39fc('0xcf')];_0x9dd731[_0x39fc('0xdd')]=qs['sort'](_0x3400eb[_0x39fc('0x41')][_0x39fc('0xd5')]);_0x9dd731[_0x39fc('0xd8')]=qs['filters'](_[_0x39fc('0xd6')](_0x3400eb[_0x39fc('0x41')],_0x44e9e9[_0x39fc('0xd2')]));if(_0x3400eb[_0x39fc('0x41')][_0x39fc('0x2a')]){_0x9dd731[_0x39fc('0xd8')]=_[_0x39fc('0xd7')](_0x9dd731[_0x39fc('0xd8')],{'$or':_[_0x39fc('0x2c')](_0x9dd731[_0x39fc('0x46')],function(_0x2f02f6){var _0x29fb7c={};_0x29fb7c[_0x2f02f6]={'$like':'%'+_0x3400eb[_0x39fc('0x41')][_0x39fc('0x2a')]+'%'};return _0x29fb7c;})});}_0x9dd731=_[_0x39fc('0xd7')]({},_0x9dd731,_0x3400eb[_0x39fc('0x53')]);return _0x3f3108[_0x39fc('0xdb')](_0x9dd731);}})[_0x39fc('0x1f')](function(_0x219112){if(_0x219112){_0x5b7381=_0x219112['length'];if(!_0x3400eb[_0x39fc('0x41')][_0x39fc('0xc7')](_0x39fc('0xda'))){_0x9dd731[_0x39fc('0x1c')]=qs[_0x39fc('0x1c')](_0x3400eb[_0x39fc('0x41')]['limit']);_0x9dd731['offset']=qs['offset'](_0x3400eb[_0x39fc('0x41')][_0x39fc('0x19')]);}return _0x3f3108[_0x39fc('0xdb')](_0x9dd731);}})['then'](function(_0x57e5bf){if(_0x57e5bf){return _0x57e5bf?{'count':_0x5b7381,'rows':_0x57e5bf}:null;}})[_0x39fc('0x1f')](respondWithResult(_0x179a63,null))[_0x39fc('0x4f')](handleError(_0x179a63,null));};exports[_0x39fc('0xde')]=function(_0x2fd0a6,_0x487e7b){var _0x192045={};var _0x8a516a={};var _0x5897ba;var _0x407c1d;return db[_0x39fc('0x40')][_0x39fc('0x94')]({'where':{'id':_0x2fd0a6[_0x39fc('0x51')]['id']}})[_0x39fc('0x1f')](handleEntityNotFound(_0x487e7b,null))[_0x39fc('0x1f')](function(_0x40a61c){if(_0x40a61c){_0x5897ba=_0x40a61c;_0x8a516a[_0x39fc('0xcf')]=_['keys'](db[_0x39fc('0xdf')][_0x39fc('0x35')]);_0x8a516a[_0x39fc('0x41')]=_['keys'](_0x2fd0a6[_0x39fc('0x41')]);_0x8a516a[_0x39fc('0xd2')]=_[_0x39fc('0xd3')](_0x8a516a['model'],_0x8a516a[_0x39fc('0x41')]);_0x192045[_0x39fc('0x46')]=_[_0x39fc('0xd3')](_0x8a516a[_0x39fc('0xcf')],qs['fields'](_0x2fd0a6[_0x39fc('0x41')][_0x39fc('0xd4')]));_0x192045[_0x39fc('0x46')]=_0x192045[_0x39fc('0x46')]['length']?_0x192045['attributes']:_0x8a516a[_0x39fc('0xcf')];_0x192045[_0x39fc('0xdd')]=qs[_0x39fc('0xd5')](_0x2fd0a6[_0x39fc('0x41')][_0x39fc('0xd5')]);_0x192045[_0x39fc('0xd8')]=qs['filters'](_['pick'](_0x2fd0a6['query'],_0x8a516a['filters']));if(_0x2fd0a6[_0x39fc('0x41')][_0x39fc('0x2a')]){_0x192045[_0x39fc('0xd8')]=_[_0x39fc('0xd7')](_0x192045[_0x39fc('0xd8')],{'$or':_[_0x39fc('0x2c')](_0x192045[_0x39fc('0x46')],function(_0x430673){var _0x3ca8db={};_0x3ca8db[_0x430673]={'$like':'%'+_0x2fd0a6['query']['filter']+'%'};return _0x3ca8db;})});}_0x192045=_[_0x39fc('0xd7')]({},_0x192045,_0x2fd0a6[_0x39fc('0x53')]);return _0x5897ba['getGroups'](_0x192045);}})['then'](function(_0x26561e){if(_0x26561e){_0x407c1d=_0x26561e[_0x39fc('0x69')];if(!_0x2fd0a6[_0x39fc('0x41')]['hasOwnProperty']('nolimit')){_0x192045[_0x39fc('0x1c')]=qs['limit'](_0x2fd0a6[_0x39fc('0x41')][_0x39fc('0x1c')]);_0x192045[_0x39fc('0x19')]=qs[_0x39fc('0x19')](_0x2fd0a6[_0x39fc('0x41')]['offset']);}return _0x5897ba[_0x39fc('0xde')](_0x192045);}})[_0x39fc('0x1f')](function(_0x1153d2){if(_0x1153d2){return _0x1153d2?{'count':_0x407c1d,'rows':_0x1153d2}:null;}})['then'](respondWithResult(_0x487e7b,null))[_0x39fc('0x4f')](handleError(_0x487e7b,null));};exports[_0x39fc('0xe0')]=function(_0x550f67,_0x11bc1b){var _0x57d978={'raw':!![],'where':{}};var _0x137b31={};var _0x3ae93c={'count':0x0,'rows':[]};return db[_0x39fc('0x40')][_0x39fc('0x94')]({'where':{'id':_0x550f67['params']['id']}})[_0x39fc('0x1f')](handleEntityNotFound(_0x11bc1b,null))[_0x39fc('0x1f')](function(_0x4017a1){if(_0x4017a1){_0x137b31['model']=_[_0x39fc('0xd1')](db[_0x39fc('0xe1')][_0x39fc('0x35')]);_0x137b31[_0x39fc('0x41')]=_[_0x39fc('0xd1')](_0x550f67[_0x39fc('0x41')]);_0x137b31[_0x39fc('0xd2')]=_[_0x39fc('0xd3')](_0x137b31[_0x39fc('0xcf')],_0x137b31[_0x39fc('0x41')]);_0x57d978[_0x39fc('0x46')]=_[_0x39fc('0xd3')](_0x137b31[_0x39fc('0xcf')],qs[_0x39fc('0xd4')](_0x550f67[_0x39fc('0x41')][_0x39fc('0xd4')]));_0x57d978['attributes']=_0x57d978[_0x39fc('0x46')][_0x39fc('0x69')]?_0x57d978[_0x39fc('0x46')]:_0x137b31['model'];if(!_0x550f67[_0x39fc('0x41')]['hasOwnProperty']('nolimit')){_0x57d978[_0x39fc('0x1c')]=qs[_0x39fc('0x1c')](_0x550f67[_0x39fc('0x41')]['limit']);_0x57d978[_0x39fc('0x19')]=qs[_0x39fc('0x19')](_0x550f67[_0x39fc('0x41')][_0x39fc('0x19')]);}_0x57d978[_0x39fc('0xdd')]=qs[_0x39fc('0xd5')](_0x550f67[_0x39fc('0x41')]['sort']);_0x57d978[_0x39fc('0xd8')]=qs['filters'](_[_0x39fc('0xd6')](_0x550f67['query'],_0x137b31[_0x39fc('0xd2')]));_0x57d978[_0x39fc('0xd8')]['UserId']=_0x4017a1['id'];if(_0x550f67[_0x39fc('0x41')][_0x39fc('0x2a')]){_0x57d978[_0x39fc('0xd8')]=_[_0x39fc('0xd7')](_0x57d978[_0x39fc('0xd8')],{'$or':_[_0x39fc('0x2c')](_0x57d978['attributes'],function(_0x43b582){var _0x36199e={};_0x36199e[_0x43b582]={'$like':'%'+_0x550f67[_0x39fc('0x41')][_0x39fc('0x2a')]+'%'};return _0x36199e;})});}_0x57d978=_[_0x39fc('0xd7')]({},_0x57d978,_0x550f67[_0x39fc('0x53')]);return db['VoiceRecording']['count']({'where':_0x57d978[_0x39fc('0xd8')]})['then'](function(_0x37a1d6){_0x3ae93c[_0x39fc('0x1b')]=_0x37a1d6;if(_0x550f67[_0x39fc('0x41')][_0x39fc('0x52')]){_0x57d978[_0x39fc('0x42')]=[{'all':!![]}];}return db[_0x39fc('0xe1')][_0x39fc('0x48')](_0x57d978);})[_0x39fc('0x1f')](function(_0x500136){_0x3ae93c['rows']=_0x500136;return _0x3ae93c;});}})[_0x39fc('0x1f')](respondWithFilteredResult(_0x11bc1b,_0x57d978))[_0x39fc('0x4f')](handleError(_0x11bc1b,null));};exports['getScreenRecordings']=function(_0x4ee3fc,_0xfd8c1f){var _0x4c7ff7={'raw':!![],'where':{}};var _0x477486={};var _0x4276f2={'count':0x0,'rows':[]};return db[_0x39fc('0x40')][_0x39fc('0x94')]({'where':{'id':_0x4ee3fc[_0x39fc('0x51')]['id']}})[_0x39fc('0x1f')](handleEntityNotFound(_0xfd8c1f,null))[_0x39fc('0x1f')](function(_0x5807ca){if(_0x5807ca){_0x477486[_0x39fc('0xcf')]=_[_0x39fc('0xd1')](db['ScreenRecording'][_0x39fc('0x35')]);_0x477486[_0x39fc('0x41')]=_['keys'](_0x4ee3fc[_0x39fc('0x41')]);_0x477486[_0x39fc('0xd2')]=_[_0x39fc('0xd3')](_0x477486['model'],_0x477486[_0x39fc('0x41')]);_0x4c7ff7['attributes']=_[_0x39fc('0xd3')](_0x477486[_0x39fc('0xcf')],qs[_0x39fc('0xd4')](_0x4ee3fc[_0x39fc('0x41')][_0x39fc('0xd4')]));_0x4c7ff7['attributes']=_0x4c7ff7[_0x39fc('0x46')][_0x39fc('0x69')]?_0x4c7ff7[_0x39fc('0x46')]:_0x477486['model'];if(!_0x4ee3fc['query'][_0x39fc('0xc7')](_0x39fc('0xda'))){_0x4c7ff7['limit']=qs[_0x39fc('0x1c')](_0x4ee3fc[_0x39fc('0x41')][_0x39fc('0x1c')]);_0x4c7ff7[_0x39fc('0x19')]=qs['offset'](_0x4ee3fc['query'][_0x39fc('0x19')]);}_0x4c7ff7['order']=qs['sort'](_0x4ee3fc['query'][_0x39fc('0xd5')]);_0x4c7ff7['where']=qs['filters'](_['pick'](_0x4ee3fc['query'],_0x477486[_0x39fc('0xd2')]));_0x4c7ff7[_0x39fc('0xd8')][_0x39fc('0xe2')]=_0x5807ca['id'];if(_0x4ee3fc[_0x39fc('0x41')][_0x39fc('0x2a')]){_0x4c7ff7[_0x39fc('0xd8')]=_[_0x39fc('0xd7')](_0x4c7ff7[_0x39fc('0xd8')],{'$or':_[_0x39fc('0x2c')](_0x4c7ff7[_0x39fc('0x46')],function(_0x49fd67){var _0x3ce4d5={};_0x3ce4d5[_0x49fd67]={'$like':'%'+_0x4ee3fc[_0x39fc('0x41')][_0x39fc('0x2a')]+'%'};return _0x3ce4d5;})});}_0x4c7ff7=_[_0x39fc('0xd7')]({},_0x4c7ff7,_0x4ee3fc['options']);return db[_0x39fc('0xe3')][_0x39fc('0x1b')]({'where':_0x4c7ff7[_0x39fc('0xd8')]})['then'](function(_0x1892d2){_0x4276f2[_0x39fc('0x1b')]=_0x1892d2;if(_0x4ee3fc[_0x39fc('0x41')][_0x39fc('0x52')]){_0x4c7ff7[_0x39fc('0x42')]=[{'all':!![]}];}return db[_0x39fc('0xe3')][_0x39fc('0x48')](_0x4c7ff7);})['then'](function(_0x439e36){_0x4276f2[_0x39fc('0x4a')]=_0x439e36;return _0x4276f2;});}})[_0x39fc('0x1f')](respondWithFilteredResult(_0xfd8c1f,_0x4c7ff7))[_0x39fc('0x4f')](handleError(_0xfd8c1f,null));};exports[_0x39fc('0xe4')]=function(_0x27ebe9,_0xd890d1){var _0x566cd3={};var _0x158bfc={};var _0x433d32;var _0x25fbb3;return db[_0x39fc('0x40')][_0x39fc('0x94')]({'where':{'id':_0x27ebe9['params']['id']}})['then'](handleEntityNotFound(_0xd890d1,null))['then'](function(_0x58d2a7){if(_0x58d2a7){_0x433d32=_0x58d2a7;_0x158bfc[_0x39fc('0xcf')]=_[_0x39fc('0xd1')](db[_0x39fc('0xe5')][_0x39fc('0x35')]);_0x158bfc[_0x39fc('0x41')]=_[_0x39fc('0xd1')](_0x27ebe9[_0x39fc('0x41')]);_0x158bfc['filters']=_['intersection'](_0x158bfc[_0x39fc('0xcf')],_0x158bfc['query']);_0x566cd3[_0x39fc('0x46')]=_['intersection'](_0x158bfc['model'],qs[_0x39fc('0xd4')](_0x27ebe9[_0x39fc('0x41')][_0x39fc('0xd4')]));_0x566cd3[_0x39fc('0x46')]=_0x566cd3[_0x39fc('0x46')][_0x39fc('0x69')]?_0x566cd3[_0x39fc('0x46')]:_0x158bfc[_0x39fc('0xcf')];_0x566cd3[_0x39fc('0xdd')]=qs[_0x39fc('0xd5')](_0x27ebe9['query'][_0x39fc('0xd5')]);_0x566cd3['where']=qs['filters'](_[_0x39fc('0xd6')](_0x27ebe9[_0x39fc('0x41')],_0x158bfc[_0x39fc('0xd2')]));if(_0x27ebe9['query'][_0x39fc('0x2a')]){_0x566cd3['where']=_[_0x39fc('0xd7')](_0x566cd3[_0x39fc('0xd8')],{'$or':_[_0x39fc('0x2c')](_0x566cd3[_0x39fc('0x46')],function(_0x3945f7){var _0x29a9b0={};_0x29a9b0[_0x3945f7]={'$like':'%'+_0x27ebe9[_0x39fc('0x41')][_0x39fc('0x2a')]+'%'};return _0x29a9b0;})});}_0x566cd3=_[_0x39fc('0xd7')]({},_0x566cd3,_0x27ebe9[_0x39fc('0x53')]);return _0x433d32[_0x39fc('0xe4')](_0x566cd3);}})[_0x39fc('0x1f')](function(_0x851491){if(_0x851491){_0x25fbb3=_0x851491[_0x39fc('0x69')];if(!_0x27ebe9['query']['hasOwnProperty'](_0x39fc('0xda'))){_0x566cd3[_0x39fc('0x1c')]=qs[_0x39fc('0x1c')](_0x27ebe9[_0x39fc('0x41')][_0x39fc('0x1c')]);_0x566cd3[_0x39fc('0x19')]=qs[_0x39fc('0x19')](_0x27ebe9[_0x39fc('0x41')][_0x39fc('0x19')]);}return _0x433d32[_0x39fc('0xe4')](_0x566cd3);}})[_0x39fc('0x1f')](function(_0x117515){if(_0x117515){return _0x117515?{'count':_0x25fbb3,'rows':_0x117515}:null;}})[_0x39fc('0x1f')](respondWithResult(_0xd890d1,null))['catch'](handleError(_0xd890d1,null));};exports['getOpenchannelInteractions']=function(_0x4eb485,_0x2e1f98){var _0x3e38e0={};var _0xbc0707={};var _0x21fde6;var _0x358659;return db[_0x39fc('0x40')][_0x39fc('0x94')]({'where':{'id':_0x4eb485[_0x39fc('0x51')]['id']}})[_0x39fc('0x1f')](handleEntityNotFound(_0x2e1f98,null))[_0x39fc('0x1f')](function(_0x5cf25c){if(_0x5cf25c){_0x21fde6=_0x5cf25c;_0xbc0707[_0x39fc('0xcf')]=_['keys'](db[_0x39fc('0xe6')]['rawAttributes']);_0xbc0707[_0x39fc('0x41')]=_[_0x39fc('0xd1')](_0x4eb485[_0x39fc('0x41')]);_0xbc0707['filters']=_['intersection'](_0xbc0707[_0x39fc('0xcf')],_0xbc0707[_0x39fc('0x41')]);_0x3e38e0[_0x39fc('0x46')]=_[_0x39fc('0xd3')](_0xbc0707['model'],qs[_0x39fc('0xd4')](_0x4eb485[_0x39fc('0x41')][_0x39fc('0xd4')]));_0x3e38e0[_0x39fc('0x46')]=_0x3e38e0[_0x39fc('0x46')][_0x39fc('0x69')]?_0x3e38e0[_0x39fc('0x46')]:_0xbc0707[_0x39fc('0xcf')];_0x3e38e0[_0x39fc('0xdd')]=qs[_0x39fc('0xd5')](_0x4eb485[_0x39fc('0x41')][_0x39fc('0xd5')]);_0x3e38e0[_0x39fc('0xd8')]=qs[_0x39fc('0xd2')](_[_0x39fc('0xd6')](_0x4eb485['query'],_0xbc0707[_0x39fc('0xd2')]));if(_0x4eb485[_0x39fc('0x41')][_0x39fc('0x2a')]){_0x3e38e0[_0x39fc('0xd8')]=_[_0x39fc('0xd7')](_0x3e38e0[_0x39fc('0xd8')],{'$or':_[_0x39fc('0x2c')](_0x3e38e0[_0x39fc('0x46')],function(_0x44cdc3){var _0x156ebc={};_0x156ebc[_0x44cdc3]={'$like':'%'+_0x4eb485[_0x39fc('0x41')][_0x39fc('0x2a')]+'%'};return _0x156ebc;})});}_0x3e38e0=_[_0x39fc('0xd7')]({},_0x3e38e0,_0x4eb485['options']);return _0x21fde6[_0x39fc('0xe7')](_0x3e38e0);}})[_0x39fc('0x1f')](function(_0x4712cd){if(_0x4712cd){_0x358659=_0x4712cd['length'];if(!_0x4eb485['query'][_0x39fc('0xc7')]('nolimit')){_0x3e38e0[_0x39fc('0x1c')]=qs[_0x39fc('0x1c')](_0x4eb485[_0x39fc('0x41')][_0x39fc('0x1c')]);_0x3e38e0[_0x39fc('0x19')]=qs['offset'](_0x4eb485['query'][_0x39fc('0x19')]);}return _0x21fde6['getOpenchannelInteractions'](_0x3e38e0);}})['then'](function(_0x7e2623){if(_0x7e2623){return _0x7e2623?{'count':_0x358659,'rows':_0x7e2623}:null;}})[_0x39fc('0x1f')](respondWithResult(_0x2e1f98,null))[_0x39fc('0x4f')](handleError(_0x2e1f98,null));};exports['getMailInteractions']=function(_0x194b20,_0x3634c8){var _0x2d2391={'raw':!![],'where':{}};var _0x122f66={};var _0x3605bc={'count':0x0,'rows':[]};return db[_0x39fc('0x40')][_0x39fc('0x94')]({'where':{'id':_0x194b20[_0x39fc('0x51')]['id']}})[_0x39fc('0x1f')](handleEntityNotFound(_0x3634c8,null))['then'](function(_0x2b1c11){if(_0x2b1c11){_0x122f66[_0x39fc('0xcf')]=_[_0x39fc('0xd1')](db[_0x39fc('0xe8')][_0x39fc('0x35')]);_0x122f66[_0x39fc('0x41')]=_[_0x39fc('0xd1')](_0x194b20[_0x39fc('0x41')]);_0x122f66['filters']=_[_0x39fc('0xd3')](_0x122f66[_0x39fc('0xcf')],_0x122f66[_0x39fc('0x41')]);_0x2d2391[_0x39fc('0x46')]=_['intersection'](_0x122f66[_0x39fc('0xcf')],qs[_0x39fc('0xd4')](_0x194b20[_0x39fc('0x41')][_0x39fc('0xd4')]));_0x2d2391[_0x39fc('0x46')]=_0x2d2391['attributes'][_0x39fc('0x69')]?_0x2d2391[_0x39fc('0x46')]:_0x122f66[_0x39fc('0xcf')];if(!_0x194b20['query'][_0x39fc('0xc7')](_0x39fc('0xda'))){_0x2d2391[_0x39fc('0x1c')]=qs['limit'](_0x194b20[_0x39fc('0x41')][_0x39fc('0x1c')]);_0x2d2391[_0x39fc('0x19')]=qs[_0x39fc('0x19')](_0x194b20[_0x39fc('0x41')][_0x39fc('0x19')]);}_0x2d2391[_0x39fc('0xdd')]=qs[_0x39fc('0xd5')](_0x194b20[_0x39fc('0x41')][_0x39fc('0xd5')]);_0x2d2391[_0x39fc('0xd8')]=qs[_0x39fc('0xd2')](_[_0x39fc('0xd6')](_0x194b20[_0x39fc('0x41')],_0x122f66['filters']));_0x2d2391[_0x39fc('0xd8')][_0x39fc('0xe2')]=_0x2b1c11['id'];if(_0x194b20[_0x39fc('0x41')][_0x39fc('0x2a')]){_0x2d2391[_0x39fc('0xd8')]=_['merge'](_0x2d2391[_0x39fc('0xd8')],{'$or':_[_0x39fc('0x2c')](_0x2d2391[_0x39fc('0x46')],function(_0x51d4f1){var _0x360fa7={};_0x360fa7[_0x51d4f1]={'$like':'%'+_0x194b20[_0x39fc('0x41')][_0x39fc('0x2a')]+'%'};return _0x360fa7;})});}_0x2d2391=_['merge']({},_0x2d2391,_0x194b20['options']);return db[_0x39fc('0xe8')][_0x39fc('0x1b')]({'where':_0x2d2391[_0x39fc('0xd8')]})['then'](function(_0x2aa8b8){_0x3605bc[_0x39fc('0x1b')]=_0x2aa8b8;if(_0x194b20[_0x39fc('0x41')][_0x39fc('0x52')]){_0x2d2391['include']=[{'all':!![]}];}return db[_0x39fc('0xe8')][_0x39fc('0x48')](_0x2d2391);})[_0x39fc('0x1f')](function(_0x4778af){_0x3605bc[_0x39fc('0x4a')]=_0x4778af;return _0x3605bc;});}})['then'](respondWithFilteredResult(_0x3634c8,_0x2d2391))[_0x39fc('0x4f')](handleError(_0x3634c8,null));};exports[_0x39fc('0xe9')]=function(_0x3ca785,_0x4a765d){var _0x28986e={};var _0x3b068c={};var _0x520250;var _0x12d35d;return db[_0x39fc('0x40')][_0x39fc('0x94')]({'where':{'id':_0x3ca785[_0x39fc('0x51')]['id']}})[_0x39fc('0x1f')](handleEntityNotFound(_0x4a765d,null))[_0x39fc('0x1f')](function(_0x38f8fb){if(_0x38f8fb){_0x520250=_0x38f8fb;_0x3b068c[_0x39fc('0xcf')]=_[_0x39fc('0xd1')](db['SmsInteraction'][_0x39fc('0x35')]);_0x3b068c[_0x39fc('0x41')]=_[_0x39fc('0xd1')](_0x3ca785[_0x39fc('0x41')]);_0x3b068c[_0x39fc('0xd2')]=_[_0x39fc('0xd3')](_0x3b068c[_0x39fc('0xcf')],_0x3b068c[_0x39fc('0x41')]);_0x28986e[_0x39fc('0x46')]=_[_0x39fc('0xd3')](_0x3b068c[_0x39fc('0xcf')],qs[_0x39fc('0xd4')](_0x3ca785[_0x39fc('0x41')]['fields']));_0x28986e['attributes']=_0x28986e[_0x39fc('0x46')][_0x39fc('0x69')]?_0x28986e[_0x39fc('0x46')]:_0x3b068c[_0x39fc('0xcf')];_0x28986e[_0x39fc('0xdd')]=qs['sort'](_0x3ca785[_0x39fc('0x41')][_0x39fc('0xd5')]);_0x28986e[_0x39fc('0xd8')]=qs[_0x39fc('0xd2')](_[_0x39fc('0xd6')](_0x3ca785[_0x39fc('0x41')],_0x3b068c['filters']));if(_0x3ca785[_0x39fc('0x41')][_0x39fc('0x2a')]){_0x28986e[_0x39fc('0xd8')]=_['merge'](_0x28986e['where'],{'$or':_[_0x39fc('0x2c')](_0x28986e[_0x39fc('0x46')],function(_0x2a9a04){var _0x4cbe43={};_0x4cbe43[_0x2a9a04]={'$like':'%'+_0x3ca785['query'][_0x39fc('0x2a')]+'%'};return _0x4cbe43;})});}_0x28986e=_[_0x39fc('0xd7')]({},_0x28986e,_0x3ca785[_0x39fc('0x53')]);return _0x520250['getSmsInteractions'](_0x28986e);}})[_0x39fc('0x1f')](function(_0x592fb1){if(_0x592fb1){_0x12d35d=_0x592fb1[_0x39fc('0x69')];if(!_0x3ca785[_0x39fc('0x41')][_0x39fc('0xc7')]('nolimit')){_0x28986e[_0x39fc('0x1c')]=qs[_0x39fc('0x1c')](_0x3ca785[_0x39fc('0x41')]['limit']);_0x28986e[_0x39fc('0x19')]=qs['offset'](_0x3ca785[_0x39fc('0x41')]['offset']);}return _0x520250[_0x39fc('0xe9')](_0x28986e);}})[_0x39fc('0x1f')](function(_0x331e89){if(_0x331e89){return _0x331e89?{'count':_0x12d35d,'rows':_0x331e89}:null;}})[_0x39fc('0x1f')](respondWithResult(_0x4a765d,null))[_0x39fc('0x4f')](handleError(_0x4a765d,null));};exports[_0x39fc('0xea')]=function(_0x2cfa41,_0x30d07a){var _0x267fc9={};var _0x1238c8={};var _0x1dae8a;var _0x24c6f2;return db[_0x39fc('0x40')][_0x39fc('0x94')]({'where':{'id':_0x2cfa41[_0x39fc('0x51')]['id']}})[_0x39fc('0x1f')](handleEntityNotFound(_0x30d07a,null))[_0x39fc('0x1f')](function(_0x24deae){if(_0x24deae){_0x1dae8a=_0x24deae;_0x1238c8[_0x39fc('0xcf')]=_[_0x39fc('0xd1')](db[_0x39fc('0xeb')][_0x39fc('0x35')]);_0x1238c8['query']=_[_0x39fc('0xd1')](_0x2cfa41[_0x39fc('0x41')]);_0x1238c8[_0x39fc('0xd2')]=_[_0x39fc('0xd3')](_0x1238c8['model'],_0x1238c8[_0x39fc('0x41')]);_0x267fc9['attributes']=_[_0x39fc('0xd3')](_0x1238c8[_0x39fc('0xcf')],qs[_0x39fc('0xd4')](_0x2cfa41[_0x39fc('0x41')][_0x39fc('0xd4')]));_0x267fc9[_0x39fc('0x46')]=_0x267fc9[_0x39fc('0x46')][_0x39fc('0x69')]?_0x267fc9[_0x39fc('0x46')]:_0x1238c8[_0x39fc('0xcf')];_0x267fc9[_0x39fc('0xdd')]=qs['sort'](_0x2cfa41[_0x39fc('0x41')][_0x39fc('0xd5')]);_0x267fc9[_0x39fc('0xd8')]=qs[_0x39fc('0xd2')](_['pick'](_0x2cfa41[_0x39fc('0x41')],_0x1238c8['filters']));if(_0x2cfa41['query'][_0x39fc('0x2a')]){_0x267fc9[_0x39fc('0xd8')]=_[_0x39fc('0xd7')](_0x267fc9[_0x39fc('0xd8')],{'$or':_['map'](_0x267fc9['attributes'],function(_0x431635){var _0x4359ab={};_0x4359ab[_0x431635]={'$like':'%'+_0x2cfa41[_0x39fc('0x41')][_0x39fc('0x2a')]+'%'};return _0x4359ab;})});}_0x267fc9=_[_0x39fc('0xd7')]({},_0x267fc9,_0x2cfa41[_0x39fc('0x53')]);return _0x1dae8a[_0x39fc('0xea')](_0x267fc9);}})[_0x39fc('0x1f')](function(_0x64ebfa){if(_0x64ebfa){_0x24c6f2=_0x64ebfa['length'];if(!_0x2cfa41['query'][_0x39fc('0xc7')](_0x39fc('0xda'))){_0x267fc9[_0x39fc('0x1c')]=qs['limit'](_0x2cfa41[_0x39fc('0x41')][_0x39fc('0x1c')]);_0x267fc9[_0x39fc('0x19')]=qs[_0x39fc('0x19')](_0x2cfa41[_0x39fc('0x41')][_0x39fc('0x19')]);}return _0x1dae8a['getFaxInteractions'](_0x267fc9);}})['then'](function(_0x212830){if(_0x212830){return _0x212830?{'count':_0x24c6f2,'rows':_0x212830}:null;}})[_0x39fc('0x1f')](respondWithResult(_0x30d07a,null))[_0x39fc('0x4f')](handleError(_0x30d07a,null));};exports[_0x39fc('0xec')]=function(_0x65d623,_0x5c669c){var _0x496109={};var _0x4c9820={};var _0x1ab199;var _0x1b6225;return db[_0x39fc('0x40')][_0x39fc('0x94')]({'where':{'id':_0x65d623['params']['id']}})[_0x39fc('0x1f')](handleEntityNotFound(_0x5c669c,null))[_0x39fc('0x1f')](function(_0x1c3a6e){if(_0x1c3a6e){_0x1ab199=_0x1c3a6e;_0x4c9820[_0x39fc('0xcf')]=_[_0x39fc('0xd1')](db[_0x39fc('0xed')][_0x39fc('0x35')]);_0x4c9820[_0x39fc('0x41')]=_[_0x39fc('0xd1')](_0x65d623['query']);_0x4c9820[_0x39fc('0xd2')]=_[_0x39fc('0xd3')](_0x4c9820[_0x39fc('0xcf')],_0x4c9820[_0x39fc('0x41')]);_0x496109[_0x39fc('0x46')]=_[_0x39fc('0xd3')](_0x4c9820[_0x39fc('0xcf')],qs[_0x39fc('0xd4')](_0x65d623[_0x39fc('0x41')][_0x39fc('0xd4')]));_0x496109[_0x39fc('0x46')]=_0x496109['attributes']['length']?_0x496109[_0x39fc('0x46')]:_0x4c9820[_0x39fc('0xcf')];_0x496109[_0x39fc('0xdd')]=qs[_0x39fc('0xd5')](_0x65d623[_0x39fc('0x41')][_0x39fc('0xd5')]);_0x496109[_0x39fc('0xd8')]=qs[_0x39fc('0xd2')](_['pick'](_0x65d623[_0x39fc('0x41')],_0x4c9820[_0x39fc('0xd2')]));if(_0x65d623['query']['filter']){_0x496109[_0x39fc('0xd8')]=_['merge'](_0x496109[_0x39fc('0xd8')],{'$or':_[_0x39fc('0x2c')](_0x496109[_0x39fc('0x46')],function(_0x49870a){var _0x24ee71={};_0x24ee71[_0x49870a]={'$like':'%'+_0x65d623['query'][_0x39fc('0x2a')]+'%'};return _0x24ee71;})});}_0x496109=_[_0x39fc('0xd7')]({},_0x496109,_0x65d623[_0x39fc('0x53')]);return _0x1ab199[_0x39fc('0xec')](_0x496109);}})['then'](function(_0x261d51){if(_0x261d51){_0x1b6225=_0x261d51[_0x39fc('0x69')];if(!_0x65d623[_0x39fc('0x41')][_0x39fc('0xc7')]('nolimit')){_0x496109['limit']=qs[_0x39fc('0x1c')](_0x65d623['query'][_0x39fc('0x1c')]);_0x496109[_0x39fc('0x19')]=qs['offset'](_0x65d623[_0x39fc('0x41')][_0x39fc('0x19')]);}return _0x1ab199[_0x39fc('0xec')](_0x496109);}})[_0x39fc('0x1f')](function(_0x69a7c7){if(_0x69a7c7){return _0x69a7c7?{'count':_0x1b6225,'rows':_0x69a7c7}:null;}})[_0x39fc('0x1f')](respondWithResult(_0x5c669c,null))[_0x39fc('0x4f')](handleError(_0x5c669c,null));};exports[_0x39fc('0xee')]=function(_0x4d165b,_0x432bd2,_0x59d52e){var _0x47dd73;var _0xfff5a1;var _0x2aaa69;var _0x86730f=!_[_0x39fc('0x64')](_0x4d165b[_0x39fc('0x51')]['id'])?_0x4d165b[_0x39fc('0x51')]['id']:!_['isNil'](_0x4d165b['user']['id'])?_0x4d165b[_0x39fc('0x26')]['id']:null;return db[_0x39fc('0x40')][_0x39fc('0x30')]({'where':{'id':_0x86730f,'role':{'$or':[_0x39fc('0x25'),'user','agent']}},'attributes':['id','name',_0x39fc('0xef'),_0x39fc('0xf0'),_0x39fc('0x2f'),_0x39fc('0x63'),_0x39fc('0x9b')]})[_0x39fc('0x1f')](function(_0x5e0bed){if(_0x5e0bed){if(_0x5e0bed['role']===_0x39fc('0x20')){_0x47dd73=_0x5e0bed;if(_0x4d165b['body'][_0x39fc('0x9d')]){_0x2aaa69=util[_0x39fc('0xa7')](_0x39fc('0xf1'),_0x47dd73[_0x4d165b['body'][_0x39fc('0x9d')]]);}else if(_0x4d165b[_0x39fc('0x59')][_0x39fc('0xf2')]){_0x2aaa69=util['format'](_0x39fc('0xa8'),_0x4d165b[_0x39fc('0x59')][_0x39fc('0xf2')]);}else{_0x2aaa69=util[_0x39fc('0xa7')](_0x39fc('0xa8'),_0x47dd73[_0x39fc('0x31')]);}socket['to'](util['format'](_0x39fc('0xf3'),_0x47dd73[_0x39fc('0x31')]))[_0x39fc('0x21')]('user:forcelogout',{'user':{'id':_0x47dd73['id'],'name':_0x47dd73[_0x39fc('0x31')]},'ip':_0x4d165b[_0x39fc('0xf4')][_0x39fc('0xf5')]||_0x4d165b['connection'][_0x39fc('0xf6')]||_0x4d165b[_0x39fc('0xf7')][_0x39fc('0xf6')]||_0x4d165b[_0x39fc('0xf8')][_0x39fc('0xf7')][_0x39fc('0xf6')]});return db[_0x39fc('0xdc')]['destroy']({'where':{'membername':_0x47dd73[_0x39fc('0x31')]},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0x39fc('0x8e'))]('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})[_0x39fc('0x1f')](function(){if(_0x47dd73){return _0x47dd73['getVoiceQueues']({'raw':!![]});}})[_0x39fc('0x1f')](function(_0x3fbed4){if(_0x47dd73){if(_0x3fbed4){_0xfff5a1=_0x3fbed4;if(_0xfff5a1['length']){var _0x27a494=_0xfff5a1[_0x39fc('0x2c')](function(_0x440ab0){var _0x532cd4={'membername':_0x47dd73[_0x39fc('0x31')],'UserId':_0x47dd73['id'],'queue_name':_0x440ab0[_0x39fc('0x31')],'VoiceQueueId':_0x440ab0['id'],'interface':_0x2aaa69,'paused':_0x47dd73[_0x39fc('0x9b')]||![],'penalty':_0x440ab0[_0x39fc('0xf9')]||0x0};return db[_0x39fc('0xdc')][_0x39fc('0xfa')](_0x532cd4);});return Promise[_0x39fc('0x57')](_0x27a494);}}}})[_0x39fc('0x1f')](function(){if(_0x47dd73){return db[_0x39fc('0xfb')]['findAll']({'where':{'membername':_0x47dd73['name'],'exitAt':null}});}})['then'](function(_0x452dce){if(_0x47dd73){var _0x175a7e=[];_0x452dce['forEach'](function(_0x495dec){_0x175a7e[_0x39fc('0x47')](_0x495dec[_0x39fc('0x58')]({'exitAt':moment()['format'](_0x39fc('0xfc'))}));});return Promise[_0x39fc('0x57')](_0x175a7e);}})['then'](function(){if(_0x47dd73){var _0x179719=[];var _0x4fd67d=[];var _0x38e092=utils['getChannels']();var _0x5b3956={'membername':_0x47dd73[_0x39fc('0x31')],'interface':_0x2aaa69,'enterAt':moment()[_0x39fc('0xa7')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x47dd73['role'],'internal':_0x47dd73[_0x39fc('0x63')]};_0x38e092['forEach'](function(_0x10874d){_0x179719['push'](_['merge']({'channel':_0x10874d,'type':_0x39fc('0xfd'),'data1':_0x4d165b['body'][_0x39fc('0xfe')],'data2':_0x2aaa69},_0x5b3956));if(_0x47dd73[_0x39fc('0x9b')]){_0x4fd67d['push'](_[_0x39fc('0xd7')]({'channel':_0x10874d,'type':'PAUSE','data1':_0x39fc('0xff')},_0x5b3956));}});return db['MemberReport'][_0x39fc('0x84')](_0x179719[_0x39fc('0xc4')](_0x4fd67d),{'individualHooks':!![]});}})[_0x39fc('0x1f')](function(){if(_0x47dd73){return _0x47dd73[_0x39fc('0x58')]({'online':!![],'lastLoginAt':moment()['format'](_0x39fc('0xfc')),'voicePause':_0x47dd73[_0x39fc('0x9b')]||![],'mailPause':_0x47dd73[_0x39fc('0x9b')]||![],'chatPause':_0x47dd73[_0x39fc('0x9b')]||![],'faxPause':_0x47dd73[_0x39fc('0x9b')]||![],'smsPause':_0x47dd73[_0x39fc('0x9b')]||![],'openchannelPause':_0x47dd73[_0x39fc('0x9b')]||![],'whatsappPause':_0x47dd73[_0x39fc('0x9b')]||![],'pauseType':_0x47dd73[_0x39fc('0x9b')]?_0x39fc('0xff'):null,'interface':_0x2aaa69,'lastPauseAt':moment()[_0x39fc('0xa7')](_0x39fc('0xfc'))});}})[_0x39fc('0x1f')](function(_0x522cc7){if(_0x4d165b['isMiddleware']){return _0x59d52e();}else{return Promise[_0x39fc('0x100')](_0x522cc7)[_0x39fc('0x1f')](respondWithResult(_0x432bd2,null));}})['catch'](handleError(_0x432bd2,null));};exports[_0x39fc('0x101')]=function(_0x5a0f18,_0x32fdb6){var _0x1b02ab;return db[_0x39fc('0x40')][_0x39fc('0x30')]({'where':{'id':_0x5a0f18['params']['id'],'role':_0x39fc('0x20')},'attributes':['id','name',_0x39fc('0x2f')]})[_0x39fc('0x1f')](handleEntityNotFound(_0x32fdb6,null))[_0x39fc('0x1f')](function(_0x10e1ca){if(_0x10e1ca){_0x1b02ab=_0x10e1ca;return db[_0x39fc('0xdc')]['destroy']({'where':{'membername':_0x1b02ab[_0x39fc('0x31')]},'individualHooks':!![]});}})[_0x39fc('0x1f')](function(){return db[_0x39fc('0xfb')]['findAll']({'where':{'membername':_0x1b02ab[_0x39fc('0x31')],'exitAt':null}});})[_0x39fc('0x1f')](function(_0x4a243f){var _0x407bd8=[];_0x4a243f[_0x39fc('0x102')](function(_0x92f519){_0x407bd8[_0x39fc('0x47')](_0x92f519['update']({'exitAt':moment()[_0x39fc('0xa7')](_0x39fc('0xfc'))}));});return Promise[_0x39fc('0x57')](_0x407bd8);})['then'](function(){return _0x1b02ab[_0x39fc('0x58')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x39fc('0x1f')](respondWithResult(_0x32fdb6,null))['catch'](handleError(_0x32fdb6,null));};exports['pause']=function(_0x301567,_0x380b3c){var _0x2db731;return db['UserVoiceQueueRt'][_0x39fc('0x58')]({'paused':0x1},{'where':{'UserId':_0x301567['params']['id']},'individualHooks':!![]})[_0x39fc('0x1f')](function(){return db[_0x39fc('0x40')][_0x39fc('0x30')]({'where':{'id':_0x301567[_0x39fc('0x51')]['id'],'role':_0x39fc('0x20')},'attributes':['id',_0x39fc('0x31'),_0x39fc('0x2f'),_0x39fc('0x63'),_0x39fc('0x9d'),_0x39fc('0xa6')]});})[_0x39fc('0x1f')](handleEntityNotFound(_0x380b3c,null))[_0x39fc('0x1f')](function(_0x18fd6d){if(_0x18fd6d){_0x2db731=_0x18fd6d;return db[_0x39fc('0xfb')][_0x39fc('0x48')]({'where':{'membername':_0x2db731[_0x39fc('0x31')],'type':'PAUSE','exitAt':null}});}})[_0x39fc('0x1f')](function(_0x154494){if(_0x154494['length']){var _0x360cf6=moment()[_0x39fc('0xa7')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x19ce60=0x0,_0x5608d2=_0x154494[_0x39fc('0x69')];_0x19ce60<_0x5608d2;_0x19ce60++){_0x154494[_0x19ce60][_0x39fc('0x103')]({'exitAt':_0x360cf6});}}})['then'](function(){var _0x10b215=[];var _0x4e19d9=utils[_0x39fc('0x104')]();_0x4e19d9[_0x39fc('0x102')](function(_0x180751){_0x10b215[_0x39fc('0x47')]({'channel':_0x180751,'membername':_0x2db731[_0x39fc('0x31')],'interface':_['isNil'](_0x2db731['interface'])?util[_0x39fc('0xa7')](_0x39fc('0xa8'),_0x2db731[_0x39fc('0x31')]):_0x2db731[_0x39fc('0x9d')],'type':_0x39fc('0x105'),'enterAt':moment()[_0x39fc('0xa7')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x301567[_0x39fc('0x59')]['type']||_0x39fc('0x106'),'role':_0x2db731[_0x39fc('0x2f')],'internal':_0x2db731[_0x39fc('0x63')]});});return db[_0x39fc('0xfb')][_0x39fc('0x84')](_0x10b215,{'individualHooks':!![]});})[_0x39fc('0x1f')](function(){return _0x2db731[_0x39fc('0x58')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x301567[_0x39fc('0x59')][_0x39fc('0x37')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x39fc('0xa7')](_0x39fc('0xfc'))});})[_0x39fc('0x1f')](respondWithResult(_0x380b3c,null))['catch'](handleError(_0x380b3c,null));};exports[_0x39fc('0x107')]=function(_0x5005d4,_0x4a8b69){if(_0x5005d4[_0x39fc('0x59')][_0x39fc('0x9a')]&&!utils[_0x39fc('0xaa')](_0x5005d4[_0x39fc('0x59')]['channel'])){throw new APIBadRequestError(util[_0x39fc('0xa7')](_0x39fc('0x108'),_0x5005d4[_0x39fc('0x59')]['channel']));}return db['User'][_0x39fc('0x30')]({'where':{'id':_0x5005d4[_0x39fc('0x51')]['id']},'attributes':['id',_0x39fc('0x31'),_0x39fc('0x2f'),'internal',_0x39fc('0x9d'),_0x39fc('0xa6'),_0x39fc('0x9c'),_0x39fc('0x109'),_0x39fc('0x10a'),'faxPause',_0x39fc('0x10b'),_0x39fc('0x10c'),_0x39fc('0x10d'),'pauseType',_0x39fc('0x10e')]})['then'](function(_0x4fe460){if(!_0x4fe460){throw new APINotFoundError(util[_0x39fc('0xa7')](_0x39fc('0xc6'),_0x5005d4[_0x39fc('0x51')]['id']));}return _0x4fe460[_0x39fc('0x107')](_0x5005d4[_0x39fc('0x59')][_0x39fc('0x9a')]);})[_0x39fc('0x1f')](respondWithResult(_0x4a8b69,null))['catch'](APIHandleError(_0x4a8b69));};exports[_0x39fc('0x10f')]=function(_0x36d161,_0x866139){var _0x4abea3={};var _0x5740a5={};var _0x21c698;var _0x3421c4;return db[_0x39fc('0x40')]['findOne']({'where':{'id':_0x36d161[_0x39fc('0x51')]['id']}})[_0x39fc('0x1f')](handleEntityNotFound(_0x866139,null))['then'](function(_0x573dfc){if(_0x573dfc){_0x21c698=_0x573dfc;_0x5740a5[_0x39fc('0xcf')]=_[_0x39fc('0xd1')](db[_0x39fc('0x110')][_0x39fc('0x35')]);_0x5740a5['query']=_[_0x39fc('0xd1')](_0x36d161['query']);_0x5740a5[_0x39fc('0xd2')]=_[_0x39fc('0xd3')](_0x5740a5['model'],_0x5740a5[_0x39fc('0x41')]);_0x4abea3[_0x39fc('0x46')]=_[_0x39fc('0xd3')](_0x5740a5[_0x39fc('0xcf')],qs[_0x39fc('0xd4')](_0x36d161['query'][_0x39fc('0xd4')]));_0x4abea3[_0x39fc('0x46')]=_0x4abea3['attributes']['length']?_0x4abea3[_0x39fc('0x46')]:_0x5740a5[_0x39fc('0xcf')];_0x4abea3['order']=qs[_0x39fc('0xd5')](_0x36d161[_0x39fc('0x41')][_0x39fc('0xd5')]);_0x4abea3[_0x39fc('0xd8')]=qs[_0x39fc('0xd2')](_['pick'](_0x36d161[_0x39fc('0x41')],_0x5740a5[_0x39fc('0xd2')]));if(_0x36d161[_0x39fc('0x41')][_0x39fc('0x2a')]){_0x4abea3['where']=_[_0x39fc('0xd7')](_0x4abea3[_0x39fc('0xd8')],{'$or':_[_0x39fc('0x2c')](_0x4abea3[_0x39fc('0x46')],function(_0x3e6387){var _0x544e40={};_0x544e40[_0x3e6387]={'$like':'%'+_0x36d161['query'][_0x39fc('0x2a')]+'%'};return _0x544e40;})});}_0x4abea3=_[_0x39fc('0xd7')]({},_0x4abea3,_0x36d161['options']);return _0x21c698[_0x39fc('0x10f')](_0x4abea3);}})['then'](function(_0x227038){if(_0x227038){_0x3421c4=_0x227038[_0x39fc('0x69')];if(!_0x36d161[_0x39fc('0x41')][_0x39fc('0xc7')](_0x39fc('0xda'))){_0x4abea3[_0x39fc('0x1c')]=qs[_0x39fc('0x1c')](_0x36d161[_0x39fc('0x41')][_0x39fc('0x1c')]);_0x4abea3[_0x39fc('0x19')]=qs[_0x39fc('0x19')](_0x36d161[_0x39fc('0x41')]['offset']);}return _0x21c698[_0x39fc('0x10f')](_0x4abea3);}})[_0x39fc('0x1f')](function(_0x1515be){if(_0x1515be){return _0x1515be?{'count':_0x3421c4,'rows':_0x1515be}:null;}})['then'](respondWithResult(_0x866139,null))[_0x39fc('0x4f')](handleError(_0x866139,null));};exports[_0x39fc('0x111')]=function(_0x5b1eee,_0x2ad305){var _0xa4dcf7=_0x5b1eee[_0x39fc('0x51')]['id'];var _0x470a89=_0x5b1eee['body']?_0x5b1eee[_0x39fc('0x59')][_0x39fc('0x5d')]:null;var _0x4b95fe=[];return Promise[_0x39fc('0x100')]()['then'](function(){if(!_0x470a89)throw new APIBadRequestError('Body\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0x39fc('0x1f')](function(){return db['User']['findOne']({'where':{'id':_0xa4dcf7}});})[_0x39fc('0x1f')](function(_0x279479){if(!_0x279479)throw new APINotFoundError(util[_0x39fc('0xa7')](_0x39fc('0xc6'),_0x5b1eee[_0x39fc('0x51')]['id']));return db[_0x39fc('0x66')]['transaction'](function(_0x457a1b){return _0x279479[_0x39fc('0x111')](_0x470a89,{'transaction':_0x457a1b})['then'](function(){return db[_0x39fc('0x110')]['findAll']({'where':{'id':{'$in':_0x470a89}}});})[_0x39fc('0x1f')](function(_0x26f039){var _0x48e191=_[_0x39fc('0x2c')](_0x26f039,function(_0xf6c7bb){return _0xf6c7bb['getAssociatedQueues']();});return Promise[_0x39fc('0x57')](_0x48e191);})['then'](function(_0x68d33c){_0x4b95fe=_[_0x39fc('0x112')](_0x68d33c);var _0x379a1d=_[_0x39fc('0x2c')](_0x4b95fe,function(_0x2410a9){return _0x2410a9[_0x39fc('0x113')](_0x279479['id'],{'transaction':_0x457a1b});});return Promise[_0x39fc('0x57')](_0x379a1d);})[_0x39fc('0x1f')](function(){if(!_0x279479[_0x39fc('0xa6')])return;var _0x4cd2f7=_[_0x39fc('0x2a')](_0x4b95fe,function(_0x2289f0){return _0x2289f0['getDataValue']('channel')===_0x39fc('0x114');});var _0x105a59=_[_0x39fc('0x2c')](_0x4cd2f7,function(_0x10c57f){return db[_0x39fc('0xdc')][_0x39fc('0xfa')]({'membername':_0x279479[_0x39fc('0x31')],'UserId':_0x279479['id'],'queue_name':_0x10c57f[_0x39fc('0x31')],'VoiceQueueId':_0x10c57f['id'],'interface':_[_0x39fc('0x64')](_0x279479[_0x39fc('0x9d')])?util[_0x39fc('0xa7')](_0x39fc('0xa8'),_0x279479[_0x39fc('0x31')]):_0x279479[_0x39fc('0x9d')],'paused':_0x279479[_0x39fc('0x9c')]||![],'penalty':_0x279479[_0x39fc('0xa2')]},{'transaction':_0x457a1b});});return Promise[_0x39fc('0x57')](_0x105a59);})['then'](function(){return db[_0x39fc('0x115')][_0x39fc('0x48')]({'where':{'teamId':{'$in':_0x470a89}}});})['then'](function(_0x2b8a24){var _0x5ee72e=_[_0x39fc('0x2c')](_0x2b8a24,function(_0x22c931){return db[_0x39fc('0x116')]['create']({'UserId':_0x279479['id'],'VoicePrefixId':_0x22c931[_0x39fc('0x117')]},{'transaction':_0x457a1b});});return Promise['all'](_0x5ee72e);});});})[_0x39fc('0x1f')](function(){for(var _0x17d5a8=0x0;_0x17d5a8<_0x4b95fe[_0x39fc('0x69')];_0x17d5a8++){var _0x2a43f8=_0x4b95fe[_0x17d5a8]['getDataValue'](_0x39fc('0x9a'));var _0x16fb13=_0x2a43f8+'QueueId';socket[_0x39fc('0x21')]('user'+_0x2a43f8+_0x39fc('0x118'),{'UserId':_0xa4dcf7,['queueField']:_0x4b95fe[_0x17d5a8]['id']});}})[_0x39fc('0x1f')](respondWithStatusCode(_0x2ad305,null))[_0x39fc('0x4f')](APIHandleError(_0x2ad305));};exports['removeTeams']=function(_0x3f9d0c,_0x112da2){var _0x6fde=_0x3f9d0c[_0x39fc('0x51')]['id'];var _0xfda0db=null;if(_0x3f9d0c[_0x39fc('0x41')]['ids']){_0xfda0db=_['isArray'](_0x3f9d0c['query'][_0x39fc('0x5d')])?_0x3f9d0c[_0x39fc('0x41')][_0x39fc('0x5d')]:[_0x3f9d0c[_0x39fc('0x41')][_0x39fc('0x5d')]];}var _0x4d342d=[];return Promise[_0x39fc('0x100')]()[_0x39fc('0x1f')](function(){if(!_0xfda0db)throw new APIBadRequestError('Query\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0x39fc('0x1f')](function(){return db[_0x39fc('0x40')][_0x39fc('0x94')]({'where':{'id':_0x6fde}});})[_0x39fc('0x1f')](function(_0x25c2aa){if(!_0x25c2aa)throw new APINotFoundError(util['format'](_0x39fc('0xc6'),_0x3f9d0c[_0x39fc('0x51')]['id']));return db[_0x39fc('0x66')][_0x39fc('0x119')](function(_0x4d1309){return _0x25c2aa[_0x39fc('0x11a')](_0xfda0db,{'transaction':_0x4d1309})[_0x39fc('0x1f')](function(){return db[_0x39fc('0x110')][_0x39fc('0x48')]({'where':{'id':{'$in':_0xfda0db}}});})['then'](function(_0x18dff3){var _0x25d13=_[_0x39fc('0x2c')](_0x18dff3,function(_0x37177e){return _0x37177e[_0x39fc('0x11b')]();});return Promise[_0x39fc('0x57')](_0x25d13);})['then'](function(_0xf1a3d7){_0x4d342d=_[_0x39fc('0x112')](_0xf1a3d7);var _0x2a265f=_[_0x39fc('0x2c')](_0x4d342d,function(_0x14f155){return _0x14f155[_0x39fc('0x11c')](_0x25c2aa['id'],{'transaction':_0x4d1309});});return Promise[_0x39fc('0x57')](_0x2a265f);})['then'](function(){if(!_0x25c2aa['online'])return;var _0x476b41=_['filter'](_0x4d342d,function(_0x3761f5){return _0x3761f5[_0x39fc('0x11d')](_0x39fc('0x9a'))===_0x39fc('0x114');});var _0x5c9055=_[_0x39fc('0x2c')](_0x476b41,function(_0x3af85b){return db[_0x39fc('0xdc')]['destroy']({'where':{'VoiceQueueId':_0x3af85b['id'],'UserId':_0x25c2aa['id']},'transaction':_0x4d1309});});return Promise[_0x39fc('0x57')](_0x5c9055);})[_0x39fc('0x1f')](function(){return db[_0x39fc('0x115')][_0x39fc('0x48')]({'where':{'teamId':{'$in':_0xfda0db}}});})[_0x39fc('0x1f')](function(_0x28383f){var _0xe2a940=_[_0x39fc('0x2c')](_0x28383f,function(_0x3c9d24){return db['UserVoicePrefix'][_0x39fc('0x23')]({'where':{'UserId':_0x25c2aa['id'],'VoicePrefixId':_0x3c9d24[_0x39fc('0x117')]}},{'transaction':_0x4d1309});});return Promise[_0x39fc('0x57')](_0xe2a940);});});})['then'](function(){for(var _0x275db7=0x0;_0x275db7<_0x4d342d[_0x39fc('0x69')];_0x275db7++){var _0xfaf052=_0x4d342d[_0x275db7][_0x39fc('0x11d')]('channel');var _0x24da29=_0xfaf052+_0x39fc('0xa5');socket[_0x39fc('0x21')](_0x39fc('0x26')+_0xfaf052+_0x39fc('0xac'),{'UserId':_0x6fde,['queueField']:_0x4d342d[_0x275db7]['id']});}})[_0x39fc('0x1f')](respondWithStatusCode(_0x112da2,null))['catch'](APIHandleError(_0x112da2));};exports[_0x39fc('0x11e')]=function(_0x59b29e,_0x5405b0){var _0x5b7d8b={};var _0x571dff={};var _0xad7975;var _0xee08a6;return db[_0x39fc('0x40')]['findOne']({'where':{'id':_0x59b29e['params']['id']}})[_0x39fc('0x1f')](handleEntityNotFound(_0x5405b0,null))[_0x39fc('0x1f')](function(_0x436fde){if(_0x436fde){_0xad7975=_0x436fde;_0x571dff[_0x39fc('0xcf')]=_[_0x39fc('0xd1')](db[_0x39fc('0xc8')]['rawAttributes']);_0x571dff[_0x39fc('0x41')]=_['keys'](_0x59b29e[_0x39fc('0x41')]);_0x571dff[_0x39fc('0xd2')]=_[_0x39fc('0xd3')](_0x571dff['model'],_0x571dff[_0x39fc('0x41')]);_0x5b7d8b[_0x39fc('0x46')]=_[_0x39fc('0xd3')](_0x571dff[_0x39fc('0xcf')],qs['fields'](_0x59b29e[_0x39fc('0x41')][_0x39fc('0xd4')]));_0x5b7d8b[_0x39fc('0x46')]=_0x5b7d8b['attributes'][_0x39fc('0x69')]?_0x5b7d8b[_0x39fc('0x46')]:_0x571dff['model'];_0x5b7d8b[_0x39fc('0xdd')]=qs[_0x39fc('0xd5')](_0x59b29e[_0x39fc('0x41')]['sort']);_0x5b7d8b[_0x39fc('0xd8')]=qs['filters'](_[_0x39fc('0xd6')](_0x59b29e[_0x39fc('0x41')],_0x571dff[_0x39fc('0xd2')]));if(_0x59b29e[_0x39fc('0x41')]['filter']){_0x5b7d8b['where']=_['merge'](_0x5b7d8b[_0x39fc('0xd8')],{'$or':_['map'](_0x5b7d8b[_0x39fc('0x46')],function(_0x3d873e){var _0x16af46={};_0x16af46[_0x3d873e]={'$like':'%'+_0x59b29e[_0x39fc('0x41')]['filter']+'%'};return _0x16af46;})});}_0x5b7d8b=_[_0x39fc('0xd7')]({},_0x5b7d8b,_0x59b29e['options']);return _0xad7975['getLists'](_0x5b7d8b);}})[_0x39fc('0x1f')](function(_0x41f68c){if(_0x41f68c){_0xee08a6=_0x41f68c[_0x39fc('0x69')];if(!_0x59b29e[_0x39fc('0x41')][_0x39fc('0xc7')](_0x39fc('0xda'))){_0x5b7d8b[_0x39fc('0x1c')]=qs[_0x39fc('0x1c')](_0x59b29e[_0x39fc('0x41')][_0x39fc('0x1c')]);_0x5b7d8b[_0x39fc('0x19')]=qs[_0x39fc('0x19')](_0x59b29e[_0x39fc('0x41')][_0x39fc('0x19')]);}return _0xad7975[_0x39fc('0x11e')](_0x5b7d8b);}})[_0x39fc('0x1f')](function(_0x32a668){if(_0x32a668){return _0x32a668?{'count':_0xee08a6,'rows':_0x32a668}:null;}})[_0x39fc('0x1f')](respondWithResult(_0x5405b0,null))[_0x39fc('0x4f')](handleError(_0x5405b0,null));};exports[_0x39fc('0x11f')]=function(_0x6e4b47,_0xf629a1){var _0x24ab90={};var _0x58dc8d={};var _0x9cdd36;return db[_0x39fc('0x40')][_0x39fc('0x94')]({'where':{'id':_0x6e4b47['params']['id']}})[_0x39fc('0x1f')](handleEntityNotFound(_0xf629a1,null))['then'](function(_0x550934){if(_0x550934){_0x9cdd36=_0x550934;_0x58dc8d[_0x39fc('0xcf')]=_[_0x39fc('0xd1')](db[_0x39fc('0x40')][_0x39fc('0x35')]);_0x58dc8d['query']=_['keys'](_0x6e4b47[_0x39fc('0x41')]);_0x58dc8d['filters']=_[_0x39fc('0xd3')](_0x58dc8d[_0x39fc('0xcf')],_0x58dc8d[_0x39fc('0x41')]);_0x24ab90[_0x39fc('0x46')]=_['intersection'](_0x58dc8d[_0x39fc('0xcf')],qs[_0x39fc('0xd4')](_0x6e4b47[_0x39fc('0x41')][_0x39fc('0xd4')]));_0x24ab90[_0x39fc('0x46')]=_0x24ab90[_0x39fc('0x46')][_0x39fc('0x69')]?_0x24ab90[_0x39fc('0x46')]:_0x58dc8d[_0x39fc('0xcf')];_0x24ab90[_0x39fc('0xdd')]=qs[_0x39fc('0xd5')](_0x6e4b47[_0x39fc('0x41')]['sort']);_0x24ab90[_0x39fc('0xd8')]=qs[_0x39fc('0xd2')](_[_0x39fc('0xd6')](_0x6e4b47[_0x39fc('0x41')],_0x58dc8d[_0x39fc('0xd2')]));if(_0x6e4b47[_0x39fc('0x41')][_0x39fc('0x2a')]){_0x24ab90[_0x39fc('0xd8')]=_[_0x39fc('0xd7')](_0x24ab90['where'],{'$or':_[_0x39fc('0x2c')](_0x24ab90[_0x39fc('0x46')],function(_0x5c29b8){var _0x250ba1={};_0x250ba1[_0x5c29b8]={'$like':'%'+_0x6e4b47['query'][_0x39fc('0x2a')]+'%'};return _0x250ba1;})});}_0x24ab90[_0x39fc('0xcf')]=db[_0x39fc('0x40')];_0x24ab90['as']=_0x39fc('0x27');_0x24ab90=_['merge']({},_0x24ab90,_0x6e4b47[_0x39fc('0x53')]);return _0x9cdd36[_0x39fc('0x120')]({'include':[_0x24ab90]});}})[_0x39fc('0x1f')](function(_0x5aa3cf){if(_0x5aa3cf){var _0x293b39={},_0x211363=[];for(var _0x347dce=0x0;_0x347dce<_0x5aa3cf[_0x39fc('0x69')];_0x347dce+=0x1){for(var _0x1b120c=0x0,_0xfb8a06;_0x1b120c<_0x5aa3cf[_0x347dce][_0x39fc('0x27')][_0x39fc('0x69')];_0x1b120c+=0x1){_0xfb8a06=_0x5aa3cf[_0x347dce][_0x39fc('0x27')][_0x1b120c][_0x39fc('0x24')]({'plain':!![]});_0x293b39[_0xfb8a06['id']]=_0xfb8a06;}}_0x293b39=_[_0x39fc('0x121')](_0x293b39);for(var _0x5c3ef7=qs[_0x39fc('0x19')](_0x6e4b47[_0x39fc('0x41')]['offset']);_0x5c3ef7<_0x293b39[_0x39fc('0x69')]&&_0x211363[_0x39fc('0x69')]=_0x16c0e2[_0x87a0('0x48')]){throw new Error(_0x87a0('0x49'));}})[_0x87a0('0x13')](function(){if(_0x341a3e){return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x341a3e[_0x87a0('0x23')]},'individualHooks':!![]});}})['then'](function(){if(_0x341a3e){return _0x341a3e['getVoiceQueues']({'raw':!![]});}})[_0x87a0('0x13')](function(_0x1735ef){if(_0x341a3e){if(_0x1735ef){var _0x29f1e9=[];_0x23d453=_0x1735ef;if(_0x23d453['length']){for(var _0x2fe791=0x0;_0x2fe791<_0x23d453[_0x87a0('0x25')];_0x2fe791++){_0x29f1e9[_0x87a0('0x41')](db[_0x87a0('0x20')][_0x87a0('0x4a')]({'membername':_0x341a3e[_0x87a0('0x23')],'UserId':_0x341a3e['id'],'queue_name':_0x23d453[_0x2fe791][_0x87a0('0x23')],'VoiceQueueId':_0x23d453[_0x2fe791]['id'],'interface':_0x3472f4,'paused':_0x341a3e['loginInPause']||![],'penalty':_0x23d453[_0x2fe791][_0x87a0('0x4b')]||0x0}));}return BPromise['all'](_0x29f1e9);}}}})[_0x87a0('0x13')](function(){if(_0x341a3e){return db[_0x87a0('0x22')][_0x87a0('0xa')]({'where':{'membername':_0x341a3e[_0x87a0('0x23')],'exitAt':null}});}})[_0x87a0('0x13')](function(_0x2bff9b){if(_0x341a3e){if(_0x2bff9b&&_0x2bff9b[_0x87a0('0x25')]){var _0x1aabea=[];_0x2bff9b['forEach'](function(_0x2a448c){_0x1aabea[_0x87a0('0x41')](_0x2a448c[_0x87a0('0x21')]({'exitAt':moment()['format'](_0x87a0('0x26'))}));});return BPromise['all'](_0x1aabea);}}})['then'](function(){if(_0x341a3e){var _0x58c211=[];var _0x3e07d2=[];var _0x49744b=utils[_0x87a0('0x28')]();var _0x230acf={'membername':_0x341a3e[_0x87a0('0x23')],'interface':_0x3472f4,'enterAt':moment()[_0x87a0('0x1e')](_0x87a0('0x26')),'role':_0x341a3e[_0x87a0('0x1c')],'internal':_0x341a3e['internal']};_0x49744b[_0x87a0('0x4c')](function(_0x1d0d1d){_0x58c211[_0x87a0('0x41')](_['merge']({'channel':_0x1d0d1d,'type':_0x87a0('0x4d'),'data1':_0x87a0('0x4e'),'data2':_0x3472f4},_0x230acf));if(_0x341a3e[_0x87a0('0x45')]){_0x3e07d2[_0x87a0('0x41')](_[_0x87a0('0x4f')]({'channel':_0x1d0d1d,'type':_0x87a0('0x24'),'data1':_0x87a0('0x50')},_0x230acf));}});return db['MemberReport'][_0x87a0('0x2c')](_0x58c211['concat'](_0x3e07d2),{'individualHooks':!![]});}})[_0x87a0('0x13')](function(){if(_0x341a3e){return _0x341a3e[_0x87a0('0x21')]({'online':!![],'lastLoginAt':moment()[_0x87a0('0x1e')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x341a3e[_0x87a0('0x45')]||![],'mailPause':_0x341a3e[_0x87a0('0x45')]||![],'chatPause':_0x341a3e[_0x87a0('0x45')]||![],'faxPause':_0x341a3e[_0x87a0('0x45')]||![],'smsPause':_0x341a3e[_0x87a0('0x45')]||![],'openchannelPause':_0x341a3e[_0x87a0('0x45')]||![],'pauseType':_0x341a3e[_0x87a0('0x45')]?_0x87a0('0x50'):null,'lastPauseAt':moment()[_0x87a0('0x1e')](_0x87a0('0x26')),'interface':_0x3472f4});}})[_0x87a0('0x13')](function(_0x3bb253){_0x4385e5(_0x3bb253);})[_0x87a0('0x17')](function(_0x111f1d){_0x340759(_0x1955ce[_0x87a0('0x19')](0x1f4,_0x111f1d[_0x87a0('0x18')]));});});}; \ No newline at end of file +var _0x6ffe=['type','internal','uniqueid','DEFAULT\x20PAUSE','YYYY-MM-DD\x20HH:mm:ss','UnpauseUser','channel','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','findOne','online','voicePause','faxPause','openchannelPause','smsPause','whatsappPause','pauseType','User\x20with\x20id\x20%s\x20not\x20found','unpause','system','LogoutUser','all','LoginUser','mobile','phone','loginInPause','SIP/%s','count','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','destroy','getVoiceQueues','upsert','UserVoiceQueue.penalty','merge','LOGIN','callysquare','LOGININPAUSE','bulkCreate','concat','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','redis','socket.io-emitter','register','GetUser','User','findAll','options','raw','where','attributes','limit','include','map','model','then','info','debug','stringify','catch','error','message','ShowUser','find','role','interface','format','UserVoiceQueueRt','update','MemberReport','PAUSE','length','getChannels','forEach','push','name','isNil','body'];(function(_0x5e83b1,_0x235290){var _0x538c92=function(_0x240a1f){while(--_0x240a1f){_0x5e83b1['push'](_0x5e83b1['shift']());}};_0x538c92(++_0x235290);}(_0x6ffe,0x7f));var _0xe6ff=function(_0x41bd0d,_0x283017){_0x41bd0d=_0x41bd0d-0x0;var _0x5a4f5d=_0x6ffe[_0x41bd0d];return _0x5a4f5d;};'use strict';var _=require(_0xe6ff('0x0'));var util=require('util');var moment=require(_0xe6ff('0x1'));var BPromise=require(_0xe6ff('0x2'));var Redis=require(_0xe6ff('0x3'));var db=require(_0xe6ff('0x4'))['db'];var utils=require(_0xe6ff('0x5'));var logger=require(_0xe6ff('0x6'))(_0xe6ff('0x7'));var config=require('../../config/environment');config[_0xe6ff('0x8')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe6ff('0x9'))(new Redis(config['redis']));require('./user.socket')[_0xe6ff('0xa')](socket);exports[_0xe6ff('0xb')]=function(_0x4003e6){var _0x2afe4b=this;return new Promise(function(_0x487dbc,_0x6ab70f){return db[_0xe6ff('0xc')][_0xe6ff('0xd')]({'raw':_0x4003e6[_0xe6ff('0xe')]?_0x4003e6[_0xe6ff('0xe')][_0xe6ff('0xf')]===undefined?!![]:![]:!![],'where':_0x4003e6[_0xe6ff('0xe')]?_0x4003e6[_0xe6ff('0xe')][_0xe6ff('0x10')]||null:null,'attributes':_0x4003e6['options']?_0x4003e6['options'][_0xe6ff('0x11')]||null:null,'limit':_0x4003e6[_0xe6ff('0xe')]?_0x4003e6[_0xe6ff('0xe')][_0xe6ff('0x12')]||null:null,'include':_0x4003e6[_0xe6ff('0xe')]?_0x4003e6[_0xe6ff('0xe')][_0xe6ff('0x13')]?_[_0xe6ff('0x14')](_0x4003e6[_0xe6ff('0xe')]['include'],function(_0x444657){return{'model':db[_0x444657[_0xe6ff('0x15')]],'as':_0x444657['as'],'attributes':_0x444657[_0xe6ff('0x11')],'include':_0x444657[_0xe6ff('0x13')]?_[_0xe6ff('0x14')](_0x444657[_0xe6ff('0x13')],function(_0x3a8838){return{'model':db[_0x3a8838['model']],'as':_0x3a8838['as'],'attributes':_0x3a8838[_0xe6ff('0x11')],'include':_0x3a8838[_0xe6ff('0x13')]?_[_0xe6ff('0x14')](_0x3a8838[_0xe6ff('0x13')],function(_0x135adf){return{'model':db[_0x135adf[_0xe6ff('0x15')]],'as':_0x135adf['as'],'attributes':_0x135adf['attributes']};}):[]};}):[]};}):[]:[]})[_0xe6ff('0x16')](function(_0x2bbec0){logger[_0xe6ff('0x17')](_0xe6ff('0xb'),_0x4003e6);logger[_0xe6ff('0x18')](_0xe6ff('0xb'),_0x4003e6,JSON[_0xe6ff('0x19')](_0x2bbec0));_0x487dbc(_0x2bbec0);})[_0xe6ff('0x1a')](function(_0x15ce42){logger['error'](_0xe6ff('0xb'),_0x15ce42['message'],_0x4003e6);_0x6ab70f(_0x2afe4b[_0xe6ff('0x1b')](0x1f4,_0x15ce42[_0xe6ff('0x1c')]));});});};exports[_0xe6ff('0x1d')]=function(_0x150db9){var _0x17d6df=this;return new Promise(function(_0x44305b,_0x455e68){return db[_0xe6ff('0xc')][_0xe6ff('0x1e')]({'raw':_0x150db9['options']?_0x150db9[_0xe6ff('0xe')][_0xe6ff('0xf')]===undefined?!![]:![]:!![],'where':_0x150db9[_0xe6ff('0xe')]?_0x150db9[_0xe6ff('0xe')][_0xe6ff('0x10')]||null:null,'attributes':_0x150db9[_0xe6ff('0xe')]?_0x150db9[_0xe6ff('0xe')][_0xe6ff('0x11')]||null:null,'include':_0x150db9['options']?_0x150db9[_0xe6ff('0xe')][_0xe6ff('0x13')]?_[_0xe6ff('0x14')](_0x150db9['options'][_0xe6ff('0x13')],function(_0x3106bf){return{'model':db[_0x3106bf['model']],'as':_0x3106bf['as'],'attributes':_0x3106bf[_0xe6ff('0x11')],'include':_0x3106bf[_0xe6ff('0x13')]?_['map'](_0x3106bf[_0xe6ff('0x13')],function(_0x12b1f8){return{'model':db[_0x12b1f8['model']],'as':_0x12b1f8['as'],'attributes':_0x12b1f8[_0xe6ff('0x11')],'include':_0x12b1f8[_0xe6ff('0x13')]?_['map'](_0x12b1f8[_0xe6ff('0x13')],function(_0x235984){return{'model':db[_0x235984[_0xe6ff('0x15')]],'as':_0x235984['as'],'attributes':_0x235984['attributes']};}):[]};}):[]};}):[]:[]})[_0xe6ff('0x16')](function(_0x50619e){logger[_0xe6ff('0x17')](_0xe6ff('0x1d'),_0x150db9);logger[_0xe6ff('0x18')]('ShowUser',_0x150db9,JSON['stringify'](_0x50619e));_0x44305b(_0x50619e);})[_0xe6ff('0x1a')](function(_0x516818){logger[_0xe6ff('0x1b')](_0xe6ff('0x1d'),_0x516818['message'],_0x150db9);_0x455e68(_0x17d6df[_0xe6ff('0x1b')](0x1f4,_0x516818[_0xe6ff('0x1c')]));});});};exports['PauseUser']=function(_0x132683){var _0x255b65;return db[_0xe6ff('0xc')][_0xe6ff('0x1e')]({'where':_0x132683[_0xe6ff('0xe')][_0xe6ff('0x10')]||{},'attributes':['id','name',_0xe6ff('0x1f'),'internal',_0xe6ff('0x20')]})[_0xe6ff('0x16')](function(_0x57c83c){if(!_0x57c83c){throw new Error(util[_0xe6ff('0x21')]('User\x20with\x20id\x20%s\x20not\x20found',_0x132683['params']['id']));}_0x255b65=_0x57c83c;return db[_0xe6ff('0x22')][_0xe6ff('0x23')]({'paused':0x1},{'where':{'UserId':_0x255b65['id']},'individualHooks':!![]});})[_0xe6ff('0x16')](function(){return db[_0xe6ff('0x24')]['findAll']({'where':{'membername':_0x255b65['name'],'type':_0xe6ff('0x25'),'exitAt':null}});})[_0xe6ff('0x16')](function(_0x49098d){if(_0x49098d&&_0x49098d[_0xe6ff('0x26')]){var _0x348116=moment()[_0xe6ff('0x21')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x3e0d53=0x0,_0x5e9945=_0x49098d['length'];_0x3e0d53<_0x5e9945;_0x3e0d53++){_0x49098d[_0x3e0d53]['updateAttributes']({'exitAt':_0x348116});}}})['then'](function(){var _0x42ea7d=[];var _0xec2be7=utils[_0xe6ff('0x27')]();_0xec2be7[_0xe6ff('0x28')](function(_0xd66a00){_0x42ea7d[_0xe6ff('0x29')]({'channel':_0xd66a00,'membername':_0x255b65[_0xe6ff('0x2a')],'interface':_[_0xe6ff('0x2b')](_0x255b65[_0xe6ff('0x20')])?util[_0xe6ff('0x21')]('SIP/%s',_0x255b65['name']):_0x255b65[_0xe6ff('0x20')],'type':_0xe6ff('0x25'),'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x132683[_0xe6ff('0x2c')][_0xe6ff('0x2d')]||'DEFAULT\x20PAUSE','role':_0x255b65[_0xe6ff('0x1f')],'internal':_0x255b65[_0xe6ff('0x2e')],'uniqueid':_0x132683['body'][_0xe6ff('0x2f')]||null});});return db[_0xe6ff('0x24')]['bulkCreate'](_0x42ea7d,{'individualHooks':!![]});})['then'](function(){return _0x255b65['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x132683['body'][_0xe6ff('0x2d')]||_0xe6ff('0x30'),'lastPauseAt':moment()['format'](_0xe6ff('0x31'))});})[_0xe6ff('0x1a')](function(_0x28305f){throw _0x28305f;});};exports[_0xe6ff('0x32')]=function(_0x253393){return Promise['resolve']()[_0xe6ff('0x16')](function(){if(_0x253393[_0xe6ff('0x2c')][_0xe6ff('0x33')]&&!utils[_0xe6ff('0x34')](_0x253393['body'][_0xe6ff('0x33')])){throw new Error(util[_0xe6ff('0x21')](_0xe6ff('0x35'),_0x253393[_0xe6ff('0x2c')][_0xe6ff('0x33')]));}return db['User'][_0xe6ff('0x36')]({'where':_0x253393['options'][_0xe6ff('0x10')]||{},'attributes':['id',_0xe6ff('0x2a'),'role',_0xe6ff('0x2e'),_0xe6ff('0x20'),_0xe6ff('0x37'),_0xe6ff('0x38'),'mailPause','chatPause',_0xe6ff('0x39'),_0xe6ff('0x3a'),_0xe6ff('0x3b'),_0xe6ff('0x3c'),_0xe6ff('0x3d'),'lastPauseAt']});})[_0xe6ff('0x16')](function(_0x4ed906){if(!_0x4ed906){throw new Error(util['format'](_0xe6ff('0x3e'),_0x253393['params']['id']));}return _0x4ed906[_0xe6ff('0x3f')](_0x253393['body'][_0xe6ff('0x33')],_0xe6ff('0x40'));})[_0xe6ff('0x1a')](function(_0x8c3db9){throw _0x8c3db9;});};exports[_0xe6ff('0x41')]=function(_0x2a10f5){var _0x58436c=this;return new Promise(function(_0x220e4c,_0x27f81f){var _0x440ef2;return db['User'][_0xe6ff('0x36')]({'where':_0x2a10f5[_0xe6ff('0xe')][_0xe6ff('0x10')]||{},'attributes':['id',_0xe6ff('0x2a')]})[_0xe6ff('0x16')](function(_0x1e511e){if(_0x1e511e){_0x440ef2=_0x1e511e;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x440ef2[_0xe6ff('0x2a')]},'individualHooks':!![]});}})[_0xe6ff('0x16')](function(){if(_0x440ef2){return db[_0xe6ff('0x24')][_0xe6ff('0xd')]({'where':{'membername':_0x440ef2['name'],'exitAt':null}});}})[_0xe6ff('0x16')](function(_0x5a42f6){if(_0x440ef2){if(_0x5a42f6&&_0x5a42f6[_0xe6ff('0x26')]){var _0x1beda7=[];_0x5a42f6[_0xe6ff('0x28')](function(_0x2b760e){_0x1beda7[_0xe6ff('0x29')](_0x2b760e[_0xe6ff('0x23')]({'exitAt':moment()[_0xe6ff('0x21')](_0xe6ff('0x31'))}));});return BPromise[_0xe6ff('0x42')](_0x1beda7);}}})[_0xe6ff('0x16')](function(){if(_0x440ef2){return _0x440ef2[_0xe6ff('0x23')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xe6ff('0x16')](function(_0x5a01d7){_0x220e4c(_0x5a01d7);})[_0xe6ff('0x1a')](function(_0x88af43){_0x27f81f(_0x58436c['error'](0x1f4,_0x88af43[_0xe6ff('0x1c')]));});});};exports[_0xe6ff('0x43')]=function(_0x447167){var _0x10c40c=this;return new Promise(function(_0x8cafe6,_0x566346){var _0xea114c;var _0x15ff95;var _0x261d27;var _0x357974;return db[_0xe6ff('0xc')]['findOne']({'where':_0x447167[_0xe6ff('0xe')]['where']||{},'attributes':['id',_0xe6ff('0x2a'),_0xe6ff('0x1f'),_0xe6ff('0x44'),_0xe6ff('0x45'),_0xe6ff('0x2e'),_0xe6ff('0x46'),_0xe6ff('0x20')]})['then'](function(_0x6917a6){if(_0x6917a6){_0xea114c=_0x6917a6;_0x357974=_0x447167[_0xe6ff('0x2c')]['interface']?_0x447167['body'][_0xe6ff('0x20')]:util[_0xe6ff('0x21')](_0xe6ff('0x47'),_0xea114c[_0xe6ff('0x2a')]);return db[_0xe6ff('0xc')][_0xe6ff('0x48')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0xea114c['id']}}});}})[_0xe6ff('0x16')](function(_0x3a346b){if(_0x3a346b){_0x261d27=_0x3a346b;return require(_0xe6ff('0x49'))['getLicense']();}})[_0xe6ff('0x16')](function(_0x86490c){if(_0x86490c&&_0x86490c[_0xe6ff('0x4a')]&&_0x261d27>=_0x86490c[_0xe6ff('0x4a')]){throw new Error(_0xe6ff('0x4b'));}})['then'](function(){if(_0xea114c){return db['UserVoiceQueueRt'][_0xe6ff('0x4c')]({'where':{'membername':_0xea114c[_0xe6ff('0x2a')]},'individualHooks':!![]});}})['then'](function(){if(_0xea114c){return _0xea114c[_0xe6ff('0x4d')]({'raw':!![]});}})['then'](function(_0x225e9f){if(_0xea114c){if(_0x225e9f){var _0x38fc8a=[];_0x15ff95=_0x225e9f;if(_0x15ff95['length']){for(var _0x59790a=0x0;_0x59790a<_0x15ff95['length'];_0x59790a++){_0x38fc8a[_0xe6ff('0x29')](db[_0xe6ff('0x22')][_0xe6ff('0x4e')]({'membername':_0xea114c['name'],'UserId':_0xea114c['id'],'queue_name':_0x15ff95[_0x59790a][_0xe6ff('0x2a')],'VoiceQueueId':_0x15ff95[_0x59790a]['id'],'interface':_0x357974,'paused':_0xea114c[_0xe6ff('0x46')]||![],'penalty':_0x15ff95[_0x59790a][_0xe6ff('0x4f')]||0x0}));}return BPromise[_0xe6ff('0x42')](_0x38fc8a);}}}})[_0xe6ff('0x16')](function(){if(_0xea114c){return db[_0xe6ff('0x24')][_0xe6ff('0xd')]({'where':{'membername':_0xea114c[_0xe6ff('0x2a')],'exitAt':null}});}})['then'](function(_0x21405b){if(_0xea114c){if(_0x21405b&&_0x21405b[_0xe6ff('0x26')]){var _0x54535a=[];_0x21405b['forEach'](function(_0x2bd907){_0x54535a[_0xe6ff('0x29')](_0x2bd907[_0xe6ff('0x23')]({'exitAt':moment()[_0xe6ff('0x21')](_0xe6ff('0x31'))}));});return BPromise[_0xe6ff('0x42')](_0x54535a);}}})[_0xe6ff('0x16')](function(){if(_0xea114c){var _0x2eac9a=[];var _0x398294=[];var _0x48df46=utils[_0xe6ff('0x27')]();var _0x2281ce={'membername':_0xea114c['name'],'interface':_0x357974,'enterAt':moment()[_0xe6ff('0x21')](_0xe6ff('0x31')),'role':_0xea114c[_0xe6ff('0x1f')],'internal':_0xea114c['internal']};_0x48df46[_0xe6ff('0x28')](function(_0x3a8fec){_0x2eac9a[_0xe6ff('0x29')](_[_0xe6ff('0x50')]({'channel':_0x3a8fec,'type':_0xe6ff('0x51'),'data1':_0xe6ff('0x52'),'data2':_0x357974},_0x2281ce));if(_0xea114c[_0xe6ff('0x46')]){_0x398294['push'](_[_0xe6ff('0x50')]({'channel':_0x3a8fec,'type':_0xe6ff('0x25'),'data1':_0xe6ff('0x53')},_0x2281ce));}});return db[_0xe6ff('0x24')][_0xe6ff('0x54')](_0x2eac9a[_0xe6ff('0x55')](_0x398294),{'individualHooks':!![]});}})[_0xe6ff('0x16')](function(){if(_0xea114c){return _0xea114c[_0xe6ff('0x23')]({'online':!![],'lastLoginAt':moment()[_0xe6ff('0x21')](_0xe6ff('0x31')),'voicePause':_0xea114c['loginInPause']||![],'mailPause':_0xea114c[_0xe6ff('0x46')]||![],'chatPause':_0xea114c['loginInPause']||![],'faxPause':_0xea114c[_0xe6ff('0x46')]||![],'smsPause':_0xea114c[_0xe6ff('0x46')]||![],'openchannelPause':_0xea114c[_0xe6ff('0x46')]||![],'pauseType':_0xea114c[_0xe6ff('0x46')]?_0xe6ff('0x53'):null,'lastPauseAt':moment()[_0xe6ff('0x21')](_0xe6ff('0x31')),'interface':_0x357974});}})[_0xe6ff('0x16')](function(_0x1e1dfa){_0x8cafe6(_0x1e1dfa);})[_0xe6ff('0x1a')](function(_0x100c5a){_0x566346(_0x10c40c[_0xe6ff('0x1b')](0x1f4,_0x100c5a[_0xe6ff('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index f1553af..9597582 100644 --- a/server/api/user/user.socket.js +++ b/server/api/user/user.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa7d8=['remove','emit','register','length','./user.events','save'];(function(_0x56aab0,_0x4afd25){var _0xa15bf4=function(_0x499049){while(--_0x499049){_0x56aab0['push'](_0x56aab0['shift']());}};_0xa15bf4(++_0x4afd25);}(_0xa7d8,0xa0));var _0x8a7d=function(_0xe73aed,_0x31959f){_0xe73aed=_0xe73aed-0x0;var _0x367936=_0xa7d8[_0xe73aed];return _0x367936;};'use strict';var UserEvents=require(_0x8a7d('0x0'));var events=[_0x8a7d('0x1'),_0x8a7d('0x2'),'update'];function createListener(_0x5c5cf7,_0x34d0d1){return function(_0x3dd6df){_0x34d0d1[_0x8a7d('0x3')](_0x5c5cf7,_0x3dd6df);};}function removeListener(_0x1b25f3,_0xa31822){return function(){UserEvents['removeListener'](_0x1b25f3,_0xa31822);};}exports[_0x8a7d('0x4')]=function(_0x50326d){for(var _0x22a17d=0x0,_0x3002a3=events[_0x8a7d('0x5')];_0x22a17d<_0x3002a3;_0x22a17d++){var _0x1a94d1=events[_0x22a17d];var _0x477a06=createListener('user:'+_0x1a94d1,_0x50326d);UserEvents['on'](_0x1a94d1,_0x477a06);}}; \ No newline at end of file +var _0xb036=['register','length','user:','./user.events','save','remove','update','emit'];(function(_0xd44dc,_0x103608){var _0x561cf4=function(_0x50ab75){while(--_0x50ab75){_0xd44dc['push'](_0xd44dc['shift']());}};_0x561cf4(++_0x103608);}(_0xb036,0xdb));var _0x6b03=function(_0x3d831f,_0x18c1a3){_0x3d831f=_0x3d831f-0x0;var _0x118b94=_0xb036[_0x3d831f];return _0x118b94;};'use strict';var UserEvents=require(_0x6b03('0x0'));var events=[_0x6b03('0x1'),_0x6b03('0x2'),_0x6b03('0x3')];function createListener(_0xaedd12,_0x3c1a86){return function(_0x13accf){_0x3c1a86[_0x6b03('0x4')](_0xaedd12,_0x13accf);};}function removeListener(_0x378ff9,_0x29c596){return function(){UserEvents['removeListener'](_0x378ff9,_0x29c596);};}exports[_0x6b03('0x5')]=function(_0xe352de){for(var _0x32afc3=0x0,_0x535cdd=events[_0x6b03('0x6')];_0x32afc3<_0x535cdd;_0x32afc3++){var _0x3286ea=events[_0x32afc3];var _0x3b6cef=createListener(_0x6b03('0x7')+_0x3286ea,_0xe352de);UserEvents['on'](_0x3286ea,_0x3b6cef);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 15f1d68..bf24d4f 100644 --- a/server/api/userChatQueue/index.js +++ b/server/api/userChatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x28467d,_0x2ac2bf){var _0x22cbbd=function(_0x3288ec){while(--_0x3288ec){_0x28467d['push'](_0x28467d['shift']());}};_0x22cbbd(++_0x2ac2bf);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x49415c,_0x3e12ea){var _0x2b1ca0=function(_0x197dbc){while(--_0x197dbc){_0x49415c['push'](_0x49415c['shift']());}};_0x2b1ca0(++_0x3e12ea);}(_0xedd9,0xfc));var _0x9edd=function(_0x23329e,_0x392405){_0x23329e=_0x23329e-0x0;var _0x5a037d=_0xedd9[_0x23329e];return _0x5a037d;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 9ef9de5..3f8bfbb 100644 --- a/server/api/userChatQueue/userChatQueue.attributes.js +++ b/server/api/userChatQueue/userChatQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xebe7=['sequelize','exports','INTEGER'];(function(_0x46ea72,_0x3d5c9f){var _0x2b51c1=function(_0x1961c4){while(--_0x1961c4){_0x46ea72['push'](_0x46ea72['shift']());}};_0x2b51c1(++_0x3d5c9f);}(_0xebe7,0x165));var _0x7ebe=function(_0x5e3ed2,_0x580c0c){_0x5e3ed2=_0x5e3ed2-0x0;var _0x291e6e=_0xebe7[_0x5e3ed2];return _0x291e6e;};'use strict';var Sequelize=require(_0x7ebe('0x0'));module[_0x7ebe('0x1')]={'penalty':{'type':Sequelize[_0x7ebe('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3959=['sequelize','exports','INTEGER'];(function(_0x1a183f,_0x40b274){var _0x247d5e=function(_0x498dce){while(--_0x498dce){_0x1a183f['push'](_0x1a183f['shift']());}};_0x247d5e(++_0x40b274);}(_0x3959,0x19b));var _0x9395=function(_0x2feec9,_0x44e086){_0x2feec9=_0x2feec9-0x0;var _0x2c442e=_0x3959[_0x2feec9];return _0x2c442e;};'use strict';var Sequelize=require(_0x9395('0x0'));module[_0x9395('0x1')]={'penalty':{'type':Sequelize[_0x9395('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index a85d3b2..8181a4f 100644 --- a/server/api/userChatQueue/userChatQueue.model.js +++ b/server/api/userChatQueue/userChatQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xab05=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','user_has_chat_queues','lodash'];(function(_0x1cd47d,_0x55bc75){var _0x29d52f=function(_0x37737a){while(--_0x37737a){_0x1cd47d['push'](_0x1cd47d['shift']());}};_0x29d52f(++_0x55bc75);}(_0xab05,0x113));var _0x5ab0=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0xab05[_0x550d12];return _0x12103d;};'use strict';var _=require(_0x5ab0('0x0'));var util=require(_0x5ab0('0x1'));var logger=require(_0x5ab0('0x2'))(_0x5ab0('0x3'));var moment=require(_0x5ab0('0x4'));var BPromise=require(_0x5ab0('0x5'));var rp=require(_0x5ab0('0x6'));var fs=require('fs');var path=require(_0x5ab0('0x7'));var rimraf=require(_0x5ab0('0x8'));var config=require('../../config/environment');var attributes=require('./userChatQueue.attributes');module[_0x5ab0('0x9')]=function(_0x3ae5ae,_0x5b2bd2){return _0x3ae5ae[_0x5ab0('0xa')]('UserChatQueue',attributes,{'tableName':_0x5ab0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa4e7=['exports','define','UserChatQueue','user_has_chat_queues','../../config/logger','api','bluebird','request-promise','path','rimraf','./userChatQueue.attributes'];(function(_0xc14e9b,_0x5c3047){var _0x48f298=function(_0x3ddc68){while(--_0x3ddc68){_0xc14e9b['push'](_0xc14e9b['shift']());}};_0x48f298(++_0x5c3047);}(_0xa4e7,0xf6));var _0x7a4e=function(_0x579c63,_0x3c8d68){_0x579c63=_0x579c63-0x0;var _0x7e7a24=_0xa4e7[_0x579c63];return _0x7e7a24;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7a4e('0x0'))(_0x7a4e('0x1'));var moment=require('moment');var BPromise=require(_0x7a4e('0x2'));var rp=require(_0x7a4e('0x3'));var fs=require('fs');var path=require(_0x7a4e('0x4'));var rimraf=require(_0x7a4e('0x5'));var config=require('../../config/environment');var attributes=require(_0x7a4e('0x6'));module[_0x7a4e('0x7')]=function(_0x123a99,_0xa64e4a){return _0x123a99[_0x7a4e('0x8')](_0x7a4e('0x9'),attributes,{'tableName':_0x7a4e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index c1e9ec8..3d0749c 100644 --- a/server/api/userChatQueue/userChatQueue.rpc.js +++ b/server/api/userChatQueue/userChatQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xabf3=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','request','info','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserChatQueue,\x20%s,\x20%s'];(function(_0x4e9a22,_0x65e645){var _0x364420=function(_0x4ecb09){while(--_0x4ecb09){_0x4e9a22['push'](_0x4e9a22['shift']());}};_0x364420(++_0x65e645);}(_0xabf3,0x1a6));var _0x3abf=function(_0x57e950,_0x2d719b){_0x57e950=_0x57e950-0x0;var _0x55b448=_0xabf3[_0x57e950];return _0x55b448;};'use strict';var _=require(_0x3abf('0x0'));var util=require(_0x3abf('0x1'));var moment=require(_0x3abf('0x2'));var BPromise=require(_0x3abf('0x3'));var rs=require(_0x3abf('0x4'));var fs=require('fs');var Redis=require(_0x3abf('0x5'));var db=require(_0x3abf('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3abf('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3abf('0x8'));var client=jayson[_0x3abf('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x292f7b,_0x443a,_0x1f5309){return new BPromise(function(_0x5bd3c5,_0x39bfbc){return client[_0x3abf('0xa')](_0x292f7b,_0x1f5309)['then'](function(_0x284a50){logger[_0x3abf('0xb')]('UserChatQueue,\x20%s,\x20%s',_0x443a,'request\x20sent');logger[_0x3abf('0xc')](_0x3abf('0xd'),_0x443a,_0x3abf('0xe'),JSON[_0x3abf('0xf')](_0x284a50));if(_0x284a50[_0x3abf('0x10')]){if(_0x284a50[_0x3abf('0x10')][_0x3abf('0x11')]===0x1f4){logger['error'](_0x3abf('0x12'),_0x443a,_0x284a50[_0x3abf('0x10')][_0x3abf('0x13')]);return _0x39bfbc(_0x284a50[_0x3abf('0x10')][_0x3abf('0x13')]);}logger['error']('UserChatQueue,\x20%s,\x20%s',_0x443a,_0x284a50[_0x3abf('0x10')][_0x3abf('0x13')]);return _0x5bd3c5(_0x284a50[_0x3abf('0x10')][_0x3abf('0x13')]);}else{logger['info']('UserChatQueue,\x20%s,\x20%s',_0x443a,_0x3abf('0xe'));_0x5bd3c5(_0x284a50['result']['message']);}})[_0x3abf('0x14')](function(_0x133f1a){logger[_0x3abf('0x10')]('UserChatQueue,\x20%s,\x20%s',_0x443a,_0x133f1a);_0x39bfbc(_0x133f1a);});});} \ No newline at end of file +var _0x3457=['code','message','catch','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x44db60,_0x4ec8ca){var _0x3fa929=function(_0x5800a6){while(--_0x5800a6){_0x44db60['push'](_0x44db60['shift']());}};_0x3fa929(++_0x4ec8ca);}(_0x3457,0x16b));var _0x7345=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3457[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x7345('0x0'));var util=require('util');var moment=require(_0x7345('0x1'));var BPromise=require(_0x7345('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7345('0x3'));var logger=require(_0x7345('0x4'))(_0x7345('0x5'));var config=require(_0x7345('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7345('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3a4c30,_0x182b09,_0x3ab8ff){return new BPromise(function(_0x10c44f,_0x19e043){return client[_0x7345('0x8')](_0x3a4c30,_0x3ab8ff)[_0x7345('0x9')](function(_0xabf04d){logger[_0x7345('0xa')](_0x7345('0xb'),_0x182b09,'request\x20sent');logger[_0x7345('0xc')](_0x7345('0xd'),_0x182b09,_0x7345('0xe'),JSON[_0x7345('0xf')](_0xabf04d));if(_0xabf04d[_0x7345('0x10')]){if(_0xabf04d[_0x7345('0x10')][_0x7345('0x11')]===0x1f4){logger[_0x7345('0x10')]('UserChatQueue,\x20%s,\x20%s',_0x182b09,_0xabf04d[_0x7345('0x10')][_0x7345('0x12')]);return _0x19e043(_0xabf04d[_0x7345('0x10')][_0x7345('0x12')]);}logger['error'](_0x7345('0xb'),_0x182b09,_0xabf04d[_0x7345('0x10')][_0x7345('0x12')]);return _0x10c44f(_0xabf04d['error'][_0x7345('0x12')]);}else{logger['info'](_0x7345('0xb'),_0x182b09,_0x7345('0xe'));_0x10c44f(_0xabf04d['result'][_0x7345('0x12')]);}})[_0x7345('0x13')](function(_0x142c6b){logger[_0x7345('0x10')](_0x7345('0xb'),_0x182b09,_0x142c6b);_0x19e043(_0x142c6b);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 574c6d3..b339776 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x2b2094,_0x59e69d){var _0x3d56ff=function(_0x138bdf){while(--_0x138bdf){_0x2b2094['push'](_0x2b2094['shift']());}};_0x3d56ff(++_0x59e69d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5b2075,_0x241a7f){var _0x36ca77=function(_0x479e79){while(--_0x479e79){_0x5b2075['push'](_0x5b2075['shift']());}};_0x36ca77(++_0x241a7f);}(_0xe706,0xa3));var _0x6e70=function(_0x1be448,_0x1fb778){_0x1be448=_0x1be448-0x0;var _0x39a54d=_0xe706[_0x1be448];return _0x39a54d;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 621d7be..962ee67 100644 --- a/server/api/userFaxQueue/userFaxQueue.attributes.js +++ b/server/api/userFaxQueue/userFaxQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbc78=['INTEGER','STRING','sequelize','exports'];(function(_0x60e7fc,_0xae4e2a){var _0x19c8be=function(_0x472eb7){while(--_0x472eb7){_0x60e7fc['push'](_0x60e7fc['shift']());}};_0x19c8be(++_0xae4e2a);}(_0xbc78,0x1ee));var _0x8bc7=function(_0x3fe3dd,_0x4c5e35){_0x3fe3dd=_0x3fe3dd-0x0;var _0x34b30d=_0xbc78[_0x3fe3dd];return _0x34b30d;};'use strict';var Sequelize=require(_0x8bc7('0x0'));module[_0x8bc7('0x1')]={'penalty':{'type':Sequelize[_0x8bc7('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x8bc7('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x8bc7('0x3')]}}; \ No newline at end of file +var _0x96b8=['exports','STRING','sequelize'];(function(_0x40015a,_0x415db5){var _0x42f8a4=function(_0x5685ad){while(--_0x5685ad){_0x40015a['push'](_0x40015a['shift']());}};_0x42f8a4(++_0x415db5);}(_0x96b8,0x1e8));var _0x896b=function(_0x2ff803,_0xf4f514){_0x2ff803=_0x2ff803-0x0;var _0x3b980a=_0x96b8[_0x2ff803];return _0x3b980a;};'use strict';var Sequelize=require(_0x896b('0x0'));module[_0x896b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0x896b('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 77f1bea..9f9b0da 100644 --- a/server/api/userFaxQueue/userFaxQueue.model.js +++ b/server/api/userFaxQueue/userFaxQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4f81=['request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5419e5,_0x17b24f){var _0x5d8080=function(_0x18cb6a){while(--_0x18cb6a){_0x5419e5['push'](_0x5419e5['shift']());}};_0x5d8080(++_0x17b24f);}(_0x4f81,0x158));var _0x14f8=function(_0x4e3f11,_0x32323b){_0x4e3f11=_0x4e3f11-0x0;var _0x4fca3f=_0x4f81[_0x4e3f11];return _0x4fca3f;};'use strict';var _=require(_0x14f8('0x0'));var util=require(_0x14f8('0x1'));var logger=require(_0x14f8('0x2'))(_0x14f8('0x3'));var moment=require(_0x14f8('0x4'));var BPromise=require(_0x14f8('0x5'));var rp=require(_0x14f8('0x6'));var fs=require('fs');var path=require(_0x14f8('0x7'));var rimraf=require(_0x14f8('0x8'));var config=require(_0x14f8('0x9'));var attributes=require(_0x14f8('0xa'));module[_0x14f8('0xb')]=function(_0x75a7b4,_0x5534b9){return _0x75a7b4[_0x14f8('0xc')](_0x14f8('0xd'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdf0c=['exports','user_has_fax_queues','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x401792,_0x3e07f6){var _0x25e1c1=function(_0x5c6732){while(--_0x5c6732){_0x401792['push'](_0x401792['shift']());}};_0x25e1c1(++_0x3e07f6);}(_0xdf0c,0x91));var _0xcdf0=function(_0x2cc4e5,_0x3688c8){_0x2cc4e5=_0x2cc4e5-0x0;var _0x3148f5=_0xdf0c[_0x2cc4e5];return _0x3148f5;};'use strict';var _=require(_0xcdf0('0x0'));var util=require(_0xcdf0('0x1'));var logger=require(_0xcdf0('0x2'))(_0xcdf0('0x3'));var moment=require(_0xcdf0('0x4'));var BPromise=require(_0xcdf0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcdf0('0x6'));var rimraf=require(_0xcdf0('0x7'));var config=require(_0xcdf0('0x8'));var attributes=require('./userFaxQueue.attributes');module[_0xcdf0('0x9')]=function(_0x194ff8,_0x24cd38){return _0x194ff8['define']('UserFaxQueue',attributes,{'tableName':_0xcdf0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 14b240b..582e7c5 100644 --- a/server/api/userFaxQueue/userFaxQueue.rpc.js +++ b/server/api/userFaxQueue/userFaxQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe9c8=['http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x14a6ed,_0x1f879e){var _0x3bcbc4=function(_0x30d0b3){while(--_0x30d0b3){_0x14a6ed['push'](_0x14a6ed['shift']());}};_0x3bcbc4(++_0x1f879e);}(_0xe9c8,0x106));var _0x8e9c=function(_0x50c186,_0xf7791){_0x50c186=_0x50c186-0x0;var _0x1da419=_0xe9c8[_0x50c186];return _0x1da419;};'use strict';var _=require(_0x8e9c('0x0'));var util=require(_0x8e9c('0x1'));var moment=require(_0x8e9c('0x2'));var BPromise=require(_0x8e9c('0x3'));var rs=require(_0x8e9c('0x4'));var fs=require('fs');var Redis=require(_0x8e9c('0x5'));var db=require(_0x8e9c('0x6'))['db'];var utils=require(_0x8e9c('0x7'));var logger=require(_0x8e9c('0x8'))(_0x8e9c('0x9'));var config=require(_0x8e9c('0xa'));var jayson=require(_0x8e9c('0xb'));var client=jayson[_0x8e9c('0xc')][_0x8e9c('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4bd17f,_0x1a35a8,_0x279b39){return new BPromise(function(_0x33564a,_0x387d01){return client[_0x8e9c('0xe')](_0x4bd17f,_0x279b39)[_0x8e9c('0xf')](function(_0x44bfec){logger[_0x8e9c('0x10')](_0x8e9c('0x11'),_0x1a35a8,_0x8e9c('0x12'));logger[_0x8e9c('0x13')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x1a35a8,_0x8e9c('0x12'),JSON['stringify'](_0x44bfec));if(_0x44bfec['error']){if(_0x44bfec[_0x8e9c('0x14')][_0x8e9c('0x15')]===0x1f4){logger[_0x8e9c('0x14')]('UserFaxQueue,\x20%s,\x20%s',_0x1a35a8,_0x44bfec[_0x8e9c('0x14')][_0x8e9c('0x16')]);return _0x387d01(_0x44bfec[_0x8e9c('0x14')][_0x8e9c('0x16')]);}logger['error'](_0x8e9c('0x11'),_0x1a35a8,_0x44bfec[_0x8e9c('0x14')][_0x8e9c('0x16')]);return _0x33564a(_0x44bfec[_0x8e9c('0x14')][_0x8e9c('0x16')]);}else{logger[_0x8e9c('0x10')](_0x8e9c('0x11'),_0x1a35a8,_0x8e9c('0x12'));_0x33564a(_0x44bfec[_0x8e9c('0x17')][_0x8e9c('0x16')]);}})[_0x8e9c('0x18')](function(_0xc4760c){logger[_0x8e9c('0x14')](_0x8e9c('0x11'),_0x1a35a8,_0xc4760c);_0x387d01(_0xc4760c);});});} \ No newline at end of file +var _0x3398=['debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','UserFaxQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x49d280,_0x33d68f){var _0x25274a=function(_0x8ace90){while(--_0x8ace90){_0x49d280['push'](_0x49d280['shift']());}};_0x25274a(++_0x33d68f);}(_0x3398,0x106));var _0x8339=function(_0x555e6b,_0x5793c2){_0x555e6b=_0x555e6b-0x0;var _0x357980=_0x3398[_0x555e6b];return _0x357980;};'use strict';var _=require(_0x8339('0x0'));var util=require('util');var moment=require(_0x8339('0x1'));var BPromise=require(_0x8339('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8339('0x3'));var db=require(_0x8339('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8339('0x5'))('rpc');var config=require(_0x8339('0x6'));var jayson=require(_0x8339('0x7'));var client=jayson[_0x8339('0x8')][_0x8339('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5628f5,_0x43a808,_0x506565){return new BPromise(function(_0x5218b3,_0x5a1655){return client[_0x8339('0xa')](_0x5628f5,_0x506565)[_0x8339('0xb')](function(_0x55696a){logger['info'](_0x8339('0xc'),_0x43a808,_0x8339('0xd'));logger[_0x8339('0xe')](_0x8339('0xf'),_0x43a808,_0x8339('0xd'),JSON[_0x8339('0x10')](_0x55696a));if(_0x55696a[_0x8339('0x11')]){if(_0x55696a[_0x8339('0x11')][_0x8339('0x12')]===0x1f4){logger[_0x8339('0x11')](_0x8339('0xc'),_0x43a808,_0x55696a[_0x8339('0x11')][_0x8339('0x13')]);return _0x5a1655(_0x55696a[_0x8339('0x11')][_0x8339('0x13')]);}logger[_0x8339('0x11')](_0x8339('0xc'),_0x43a808,_0x55696a[_0x8339('0x11')][_0x8339('0x13')]);return _0x5218b3(_0x55696a[_0x8339('0x11')][_0x8339('0x13')]);}else{logger[_0x8339('0x14')]('UserFaxQueue,\x20%s,\x20%s',_0x43a808,_0x8339('0xd'));_0x5218b3(_0x55696a[_0x8339('0x15')][_0x8339('0x13')]);}})[_0x8339('0x16')](function(_0x3ed27d){logger['error'](_0x8339('0xc'),_0x43a808,_0x3ed27d);_0x5a1655(_0x3ed27d);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 4e8e05f..f400c55 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x38db76,_0xa73369){var _0x1e51db=function(_0x5814af){while(--_0x5814af){_0x38db76['push'](_0x38db76['shift']());}};_0x1e51db(++_0xa73369);}(_0xedd9,0xfc));var _0x9edd=function(_0x5984a2,_0x597338){_0x5984a2=_0x5984a2-0x0;var _0x435a53=_0xedd9[_0x5984a2];return _0x435a53;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x2d2a9b,_0x5870ff){var _0x3d2d49=function(_0x13884d){while(--_0x13884d){_0x2d2a9b['push'](_0x2d2a9b['shift']());}};_0x3d2d49(++_0x5870ff);}(_0x9c44,0x178));var _0x49c4=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x9c44[_0x550d12];return _0x12103d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 281ebe2..d21f7be 100644 --- a/server/api/userMailQueue/userMailQueue.attributes.js +++ b/server/api/userMailQueue/userMailQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc6f6=['exports','sequelize'];(function(_0x562582,_0x459282){var _0x37c6cb=function(_0x48f239){while(--_0x48f239){_0x562582['push'](_0x562582['shift']());}};_0x37c6cb(++_0x459282);}(_0xc6f6,0x1cb));var _0x6c6f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc6f6[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x6c6f('0x0'));module[_0x6c6f('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x0d8d=['INTEGER'];(function(_0x40083e,_0x3e45af){var _0x53b9a3=function(_0xda595c){while(--_0xda595c){_0x40083e['push'](_0x40083e['shift']());}};_0x53b9a3(++_0x3e45af);}(_0x0d8d,0x1ac));var _0xd0d8=function(_0x5dd186,_0x23054a){_0x5dd186=_0x5dd186-0x0;var _0x5cff28=_0x0d8d[_0x5dd186];return _0x5cff28;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xd0d8('0x0')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 90daa84..578c40a 100644 --- a/server/api/userMailQueue/userMailQueue.model.js +++ b/server/api/userMailQueue/userMailQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xde13=['define','UserMailQueue','user_has_mail_queues','lodash','util','api','bluebird','request-promise','path','rimraf','exports'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0xde13,0x121));var _0x3de1=function(_0x9d4921,_0x5bfaaa){_0x9d4921=_0x9d4921-0x0;var _0xbecfb1=_0xde13[_0x9d4921];return _0xbecfb1;};'use strict';var _=require(_0x3de1('0x0'));var util=require(_0x3de1('0x1'));var logger=require('../../config/logger')(_0x3de1('0x2'));var moment=require('moment');var BPromise=require(_0x3de1('0x3'));var rp=require(_0x3de1('0x4'));var fs=require('fs');var path=require(_0x3de1('0x5'));var rimraf=require(_0x3de1('0x6'));var config=require('../../config/environment');var attributes=require('./userMailQueue.attributes');module[_0x3de1('0x7')]=function(_0x554997,_0x44c2fd){return _0x554997[_0x3de1('0x8')](_0x3de1('0x9'),attributes,{'tableName':_0x3de1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd864=['moment','bluebird','request-promise','path','rimraf','./userMailQueue.attributes','define','UserMailQueue','user_has_mail_queues','lodash'];(function(_0x1aa202,_0x16fed5){var _0x1bc948=function(_0x1fb208){while(--_0x1fb208){_0x1aa202['push'](_0x1aa202['shift']());}};_0x1bc948(++_0x16fed5);}(_0xd864,0x1df));var _0x4d86=function(_0x22ee56,_0x25b28c){_0x22ee56=_0x22ee56-0x0;var _0xa74879=_0xd864[_0x22ee56];return _0xa74879;};'use strict';var _=require(_0x4d86('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x4d86('0x1'));var BPromise=require(_0x4d86('0x2'));var rp=require(_0x4d86('0x3'));var fs=require('fs');var path=require(_0x4d86('0x4'));var rimraf=require(_0x4d86('0x5'));var config=require('../../config/environment');var attributes=require(_0x4d86('0x6'));module['exports']=function(_0x102f5f,_0x43d03d){return _0x102f5f[_0x4d86('0x7')](_0x4d86('0x8'),attributes,{'tableName':_0x4d86('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index 92730d7..0a889e5 100644 --- a/server/api/userMailQueue/userMailQueue.rpc.js +++ b/server/api/userMailQueue/userMailQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','UserMailQueue,\x20%s,\x20%s','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x16285d,_0x47b433){var _0x1e666a=function(_0x345942){while(--_0x345942){_0x16285d['push'](_0x16285d['shift']());}};_0x1e666a(++_0x47b433);}(_0xe14b,0x93));var _0xbe14=function(_0x41979f,_0x299fae){_0x41979f=_0x41979f-0x0;var _0x29f0b9=_0xe14b[_0x41979f];return _0x29f0b9;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});} \ No newline at end of file +var _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x1bb6b4,_0x14dd50){var _0x370231=function(_0x29cf9c){while(--_0x29cf9c){_0x1bb6b4['push'](_0x1bb6b4['shift']());}};_0x370231(++_0x14dd50);}(_0x34e8,0x12c));var _0x834e=function(_0x1ed686,_0x92b42a){_0x1ed686=_0x1ed686-0x0;var _0x580799=_0x34e8[_0x1ed686];return _0x580799;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x834e('0x4'));var db=require(_0x834e('0x5'))['db'];var utils=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));var config=require(_0x834e('0x9'));var jayson=require(_0x834e('0xa'));var client=jayson['client'][_0x834e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52056d,_0x3e16d2,_0x3cc2e3){return new BPromise(function(_0x3a3ef6,_0x2e69e2){return client[_0x834e('0xc')](_0x52056d,_0x3cc2e3)[_0x834e('0xd')](function(_0x363786){logger[_0x834e('0xe')](_0x834e('0xf'),_0x3e16d2,_0x834e('0x10'));logger[_0x834e('0x11')](_0x834e('0x12'),_0x3e16d2,_0x834e('0x10'),JSON[_0x834e('0x13')](_0x363786));if(_0x363786[_0x834e('0x14')]){if(_0x363786[_0x834e('0x14')][_0x834e('0x15')]===0x1f4){logger['error'](_0x834e('0xf'),_0x3e16d2,_0x363786[_0x834e('0x14')]['message']);return _0x2e69e2(_0x363786[_0x834e('0x14')][_0x834e('0x16')]);}logger[_0x834e('0x14')](_0x834e('0xf'),_0x3e16d2,_0x363786['error'][_0x834e('0x16')]);return _0x3a3ef6(_0x363786[_0x834e('0x14')]['message']);}else{logger[_0x834e('0xe')]('UserMailQueue,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('UserMailQueue,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 5060d4d..c67c7cd 100644 --- a/server/api/userNotification/index.js +++ b/server/api/userNotification/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4509=['../../components/interaction/service','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x4509,0x126));var _0x9450=function(_0x404516,_0x399245){_0x404516=_0x404516-0x0;var _0xd56781=_0x4509[_0x404516];return _0xd56781;};'use strict';var multer=require(_0x9450('0x0'));var util=require(_0x9450('0x1'));var path=require(_0x9450('0x2'));var timeout=require(_0x9450('0x3'));var express=require(_0x9450('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9450('0x5'));var interaction=require(_0x9450('0x6'));var config=require('../../config/environment');var controller=require(_0x9450('0x7'));router[_0x9450('0x8')]('/',auth[_0x9450('0x9')](),controller[_0x9450('0xa')]);module[_0x9450('0xb')]=router; \ No newline at end of file +var _0x2a95=['fs-extra','./userNotification.controller','post','util','path','connect-timeout','express','Router'];(function(_0x5b5cde,_0x1f7c5f){var _0x364ad2=function(_0x4a1172){while(--_0x4a1172){_0x5b5cde['push'](_0x5b5cde['shift']());}};_0x364ad2(++_0x1f7c5f);}(_0x2a95,0xfb));var _0x52a9=function(_0x4973ae,_0x3bbef0){_0x4973ae=_0x4973ae-0x0;var _0xf6cd4d=_0x2a95[_0x4973ae];return _0xf6cd4d;};'use strict';var multer=require('multer');var util=require(_0x52a9('0x0'));var path=require(_0x52a9('0x1'));var timeout=require(_0x52a9('0x2'));var express=require(_0x52a9('0x3'));var router=express[_0x52a9('0x4')]();var fs_extra=require(_0x52a9('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x52a9('0x6'));router[_0x52a9('0x7')]('/',auth['isAuthenticated'](),controller['sendUserNotification']);module['exports']=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index a52074c..af3e89d 100644 --- a/server/api/userNotification/userNotification.attributes.js +++ b/server/api/userNotification/userNotification.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc1c2=['STRING','BOOLEAN','TEXT'];(function(_0x172f74,_0x1d0434){var _0x51d04e=function(_0x118c23){while(--_0x118c23){_0x172f74['push'](_0x172f74['shift']());}};_0x51d04e(++_0x1d0434);}(_0xc1c2,0x104));var _0x2c1c=function(_0x116bc9,_0x5e8d8b){_0x116bc9=_0x116bc9-0x0;var _0x36b11b=_0xc1c2[_0x116bc9];return _0x36b11b;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x2c1c('0x0')]},'senderName':{'type':Sequelize[_0x2c1c('0x1')]},'recipientsId':{'type':Sequelize[_0x2c1c('0x0')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x2c1c('0x2')]}}; \ No newline at end of file +var _0x96ec=['STRING','TEXT','BOOLEAN'];(function(_0x229e54,_0x4007bf){var _0x2274e2=function(_0x36e864){while(--_0x36e864){_0x229e54['push'](_0x229e54['shift']());}};_0x2274e2(++_0x4007bf);}(_0x96ec,0x1b6));var _0xc96e=function(_0x2b9e8a,_0x7b21d4){_0x2b9e8a=_0x2b9e8a-0x0;var _0x520e67=_0x96ec[_0x2b9e8a];return _0x520e67;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0xc96e('0x0')]},'recipientsId':{'type':Sequelize[_0xc96e('0x1')]},'recipientsDescription':{'type':Sequelize[_0xc96e('0x0')]},'beep':{'type':Sequelize[_0xc96e('0x2')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 7c73801..fbbd144 100644 --- a/server/api/userNotification/userNotification.controller.js +++ b/server/api/userNotification/userNotification.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7dc2=['fullname','isEmpty','recipientsDescription','beep','SenderId','recipientsId','sortBy','join','UserNotification','create','emit','userNotification:send','catch','text','Template','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','view','forEach','User','union','ids','queue','replace','Queue','push','flatten','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./userNotification.socket','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','sendUserNotification','body','hasOwnProperty','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','Sequelize','ValidationError','Missing\x20\x27view\x27\x20parameter','recipients','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','openchannelqueue','smsqueue','whatsappqueue','team','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName'];(function(_0x286d7c,_0x24589e){var _0x26479b=function(_0x3066eb){while(--_0x3066eb){_0x286d7c['push'](_0x286d7c['shift']());}};_0x26479b(++_0x24589e);}(_0x7dc2,0x86));var _0x27dc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7dc2[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x27dc('0x0'));var rimraf=require(_0x27dc('0x1'));var zipdir=require(_0x27dc('0x2'));var jsonpatch=require(_0x27dc('0x3'));var rp=require(_0x27dc('0x4'));var moment=require('moment');var BPromise=require(_0x27dc('0x5'));var Mustache=require(_0x27dc('0x6'));var util=require(_0x27dc('0x7'));var path=require(_0x27dc('0x8'));var sox=require(_0x27dc('0x9'));var csv=require(_0x27dc('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x27dc('0xb'));var _=require(_0x27dc('0xc'));var squel=require(_0x27dc('0xd'));var crypto=require(_0x27dc('0xe'));var jsforce=require(_0x27dc('0xf'));var deskjs=require(_0x27dc('0x10'));var toCsv=require(_0x27dc('0xa'));var querystring=require(_0x27dc('0x11'));var Papa=require('papaparse');var Redis=require(_0x27dc('0x12'));var authService=require(_0x27dc('0x13'));var qs=require(_0x27dc('0x14'));var as=require(_0x27dc('0x15'));var hardwareService=require(_0x27dc('0x16'));var logger=require(_0x27dc('0x17'))(_0x27dc('0x18'));var utils=require(_0x27dc('0x19'));var config=require(_0x27dc('0x1a'));var licenseUtil=require(_0x27dc('0x1b'));var db=require(_0x27dc('0x1c'))['db'];config[_0x27dc('0x1d')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x27dc('0x1e'))(new Redis(config['redis']));require(_0x27dc('0x1f'))['register'](socket);function respondWithStatusCode(_0x4bad28,_0x1099fe){_0x1099fe=_0x1099fe||0xcc;return function(_0x32eb00){if(_0x32eb00){return _0x4bad28[_0x27dc('0x20')](_0x1099fe);}return _0x4bad28[_0x27dc('0x21')](_0x1099fe)[_0x27dc('0x22')]();};}function respondWithResult(_0x4b919c,_0x5f20c6){_0x5f20c6=_0x5f20c6||0xc8;return function(_0x4e840d){if(_0x4e840d){return _0x4b919c['status'](_0x5f20c6)[_0x27dc('0x23')](_0x4e840d);}};}function respondWithFilteredResult(_0x2ee117,_0x2f63b0){return function(_0x59fa67){if(_0x59fa67){var _0x172405=typeof _0x2f63b0[_0x27dc('0x24')]===_0x27dc('0x25')&&typeof _0x2f63b0[_0x27dc('0x26')]===_0x27dc('0x25');var _0x45a0ce=_0x59fa67['count'];var _0x38ff53=_0x172405?0x0:_0x2f63b0[_0x27dc('0x24')];var _0x159e71=_0x172405?_0x59fa67['count']:_0x2f63b0['offset']+_0x2f63b0['limit'];var _0x132277;if(_0x159e71>=_0x45a0ce){_0x159e71=_0x45a0ce;_0x132277=0xc8;}else{_0x132277=0xce;}_0x2ee117[_0x27dc('0x21')](_0x132277);return _0x2ee117[_0x27dc('0x27')](_0x27dc('0x28'),_0x38ff53+'-'+_0x159e71+'/'+_0x45a0ce)[_0x27dc('0x23')](_0x59fa67);}return null;};}function patchUpdates(_0x3069e9){return function(_0x49853b){try{jsonpatch[_0x27dc('0x29')](_0x49853b,_0x3069e9,!![]);}catch(_0x238c7f){return BPromise[_0x27dc('0x2a')](_0x238c7f);}return _0x49853b[_0x27dc('0x2b')]();};}function saveUpdates(_0x46c933,_0x113024){return function(_0x4f5d72){if(_0x4f5d72){return _0x4f5d72[_0x27dc('0x2c')](_0x46c933)[_0x27dc('0x2d')](function(_0x140263){return _0x140263;});}return null;};}function removeEntity(_0x2a5293,_0x26d721){return function(_0xabac98){if(_0xabac98){return _0xabac98[_0x27dc('0x2e')]()['then'](function(){_0x2a5293[_0x27dc('0x21')](0xcc)[_0x27dc('0x22')]();});}};}function handleEntityNotFound(_0x3d2a30,_0x2755c8){return function(_0x5390bf){if(!_0x5390bf){_0x3d2a30['sendStatus'](0x194);}return _0x5390bf;};}function handleError(_0x219849,_0x26daee){_0x26daee=_0x26daee||0x1f4;return function(_0x2bc6b9){logger[_0x27dc('0x2f')](_0x2bc6b9['stack']);if(_0x2bc6b9[_0x27dc('0x30')]){delete _0x2bc6b9['name'];}_0x219849[_0x27dc('0x21')](_0x26daee)[_0x27dc('0x31')](_0x2bc6b9);};}exports[_0x27dc('0x32')]=function(_0x32eb1b,_0x1946d0,_0x1ab5b6){if(!_0x32eb1b[_0x27dc('0x33')][_0x27dc('0x34')]('text')&&!_0x32eb1b[_0x27dc('0x33')][_0x27dc('0x34')]('TemplateId')){throw new db['Sequelize']['ValidationError'](_0x27dc('0x35'));}else{if(_0x32eb1b['body'][_0x27dc('0x34')](_0x27dc('0x36'))&&!_0x32eb1b[_0x27dc('0x33')][_0x27dc('0x34')]('view')){throw new db[(_0x27dc('0x37'))][(_0x27dc('0x38'))](_0x27dc('0x39'));}if(!_0x32eb1b['body']['hasOwnProperty'](_0x27dc('0x3a'))){throw new db[(_0x27dc('0x37'))][(_0x27dc('0x38'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x7ea686=JSON[_0x27dc('0x3b')](_0x32eb1b['body'][_0x27dc('0x3a')]);}catch(_0x1f524d){logger[_0x27dc('0x2f')](_0x1f524d);throw new db[(_0x27dc('0x37'))][(_0x27dc('0x38'))](_0x27dc('0x3c'));}var _0x387cc2=[_0x27dc('0x3d'),_0x27dc('0x3e'),'mailqueue',_0x27dc('0x3f'),_0x27dc('0x40'),'voicequeue',_0x27dc('0x41'),_0x27dc('0x42'),_0x27dc('0x43')];if(_[_0x27dc('0x44')](_0x7ea686,function(_0x4bb217){return!_[_0x27dc('0x45')](_0x387cc2,_0x4bb217[_0x27dc('0x46')][_0x27dc('0x47')]());})){throw new db['Sequelize'][(_0x27dc('0x38'))](_0x27dc('0x48'));}}}var _0x44cfe2={};_0x44cfe2[_0x27dc('0x49')]=_0x32eb1b[_0x27dc('0x33')][_0x27dc('0x34')](_0x27dc('0x49'))?_0x32eb1b['body'][_0x27dc('0x49')]:_0x32eb1b[_0x27dc('0x43')][_0x27dc('0x4a')];_0x44cfe2['recipientsDescription']=_[_0x27dc('0x4b')](_0x32eb1b[_0x27dc('0x33')][_0x27dc('0x4c')])?null:_0x32eb1b[_0x27dc('0x33')][_0x27dc('0x4c')];_0x44cfe2['beep']=_0x32eb1b[_0x27dc('0x33')][_0x27dc('0x4d')]||![];_0x44cfe2[_0x27dc('0x4e')]=_0x32eb1b[_0x27dc('0x43')]['id'];return getContent(_0x32eb1b[_0x27dc('0x33')])['then'](function(_0x281bce){_0x44cfe2['body']=_0x281bce;return getRecipients(_0x7ea686);})[_0x27dc('0x2d')](function(_0x565b85){_0x44cfe2[_0x27dc('0x4f')]=_[_0x27dc('0x50')](_0x565b85)[_0x27dc('0x51')](',');return db['sequelize']['transaction'](function(_0x966761){return db[_0x27dc('0x52')][_0x27dc('0x53')](_0x44cfe2,{'raw':!![],'transaction':_0x966761})[_0x27dc('0x2d')](function(_0x9baaca){var _0x16d497={'sender':_0x44cfe2[_0x27dc('0x49')],'description':_0x44cfe2['recipientsDescription'],'content':_0x44cfe2[_0x27dc('0x33')],'beep':_0x44cfe2[_0x27dc('0x4d')]};_0x565b85['forEach'](function(_0x38bed7){_0x16d497['recipient']=_0x38bed7;socket[_0x27dc('0x54')](_0x27dc('0x55'),_0x16d497);});return _0x9baaca;});});})[_0x27dc('0x2d')](respondWithResult(_0x1946d0,0xc9))[_0x27dc('0x56')](handleError(_0x1946d0,null));};function getContent(_0x2875fc){return new BPromise(function(_0x293c00,_0x325bcd){if(_0x2875fc[_0x27dc('0x57')]){_0x293c00(_0x2875fc[_0x27dc('0x57')]);return;}return db[_0x27dc('0x58')]['findOne']({'attributes':[_0x27dc('0x59')],'where':{'id':_0x2875fc[_0x27dc('0x36')]},'raw':!![]})[_0x27dc('0x2d')](function(_0x56df25){if(!_0x56df25)throw new db[(_0x27dc('0x37'))][(_0x27dc('0x38'))](_0x27dc('0x5a'));var _0xe77cb1=Mustache[_0x27dc('0x5b')](_0x56df25[_0x27dc('0x59')],_0x2875fc[_0x27dc('0x5c')]);_0x293c00(_0xe77cb1);})['catch'](function(_0x11d586){_0x325bcd(_0x11d586);});});}function getRecipients(_0x4181da){return new BPromise(function(_0x5676c4,_0x10061a){var _0x173f48=[];var _0x5aff54=[];_0x4181da[_0x27dc('0x5d')](function(_0x378bfb){var _0x116c82=_['startCase'](_0x378bfb[_0x27dc('0x46')]['toLowerCase']());if(_0x116c82===_0x27dc('0x5e')){_0x173f48=_[_0x27dc('0x5f')](_0x173f48,_0x378bfb[_0x27dc('0x60')]);}else{if(_[_0x27dc('0x45')](_0x116c82,_0x27dc('0x61')))_0x116c82=_0x116c82[_0x27dc('0x62')](_0x27dc('0x61'),_0x27dc('0x63'));_0x378bfb['ids']['forEach'](function(_0x56a431){_0x5aff54[_0x27dc('0x64')](getAgents(_0x116c82,_0x56a431));});}});return BPromise['all'](_0x5aff54)['then'](function(_0x5c8734){_0x173f48=_[_0x27dc('0x5f')](_0x173f48,_[_0x27dc('0x65')](_0x5c8734));_0x5676c4(_0x173f48);})[_0x27dc('0x56')](function(_0x3e8deb){_0x10061a(_0x3e8deb);});});}function getAgents(_0x324059,_0x13b018){return new BPromise(function(_0x8e56b1,_0x50af8d){return db[_0x324059]['findOne']({'where':{'id':_0x13b018}})[_0x27dc('0x2d')](function(_0x50fae3){return _0x50fae3[_0x27dc('0x66')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4e59a3){var _0x435558=_[_0x27dc('0x67')](_0x4e59a3,'id');_0x8e56b1(_0x435558);});})[_0x27dc('0x56')](function(_0x5c46b6){_0x50af8d(_0x5c46b6);});});} \ No newline at end of file +var _0x9590=['util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','json','limit','count','offset','Content-Range','apply','reject','save','then','destroy','error','stack','name','sendUserNotification','body','hasOwnProperty','TemplateId','Sequelize','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','ValidationError','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','recipientsDescription','isEmpty','beep','user','recipientsId','join','sequelize','transaction','UserNotification','create','forEach','recipient','emit','userNotification:send','catch','text','Template','findOne','render','html','startCase','User','ids','queue','replace','Queue','push','all','union','flatten','getAgents','map','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache'];(function(_0xaf51c8,_0x4bb8fe){var _0x1baf26=function(_0x2daf28){while(--_0x2daf28){_0xaf51c8['push'](_0xaf51c8['shift']());}};_0x1baf26(++_0x4bb8fe);}(_0x9590,0xc2));var _0x0959=function(_0x73dee5,_0x1c9320){_0x73dee5=_0x73dee5-0x0;var _0x23e0c8=_0x9590[_0x73dee5];return _0x23e0c8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0959('0x0'));var zipdir=require(_0x0959('0x1'));var jsonpatch=require(_0x0959('0x2'));var rp=require(_0x0959('0x3'));var moment=require(_0x0959('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0959('0x5'));var util=require(_0x0959('0x6'));var path=require('path');var sox=require(_0x0959('0x7'));var csv=require(_0x0959('0x8'));var ejs=require(_0x0959('0x9'));var fs=require('fs');var fs_extra=require(_0x0959('0xa'));var _=require(_0x0959('0xb'));var squel=require(_0x0959('0xc'));var crypto=require(_0x0959('0xd'));var jsforce=require(_0x0959('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0959('0x8'));var querystring=require(_0x0959('0xf'));var Papa=require(_0x0959('0x10'));var Redis=require(_0x0959('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0959('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0959('0x13'));var logger=require(_0x0959('0x14'))('api');var utils=require(_0x0959('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x0959('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x0959('0x17'),'port':0x18eb});var socket=require(_0x0959('0x18'))(new Redis(config['redis']));require(_0x0959('0x19'))[_0x0959('0x1a')](socket);function respondWithStatusCode(_0x116c1c,_0x2ac9a7){_0x2ac9a7=_0x2ac9a7||0xcc;return function(_0xf34922){if(_0xf34922){return _0x116c1c[_0x0959('0x1b')](_0x2ac9a7);}return _0x116c1c[_0x0959('0x1c')](_0x2ac9a7)[_0x0959('0x1d')]();};}function respondWithResult(_0x2b956d,_0x5f4ad0){_0x5f4ad0=_0x5f4ad0||0xc8;return function(_0x32ae7d){if(_0x32ae7d){return _0x2b956d[_0x0959('0x1c')](_0x5f4ad0)[_0x0959('0x1e')](_0x32ae7d);}};}function respondWithFilteredResult(_0x5a7006,_0xc1570f){return function(_0x44d102){if(_0x44d102){var _0x3e97a4=typeof _0xc1570f['offset']==='undefined'&&typeof _0xc1570f[_0x0959('0x1f')]==='undefined';var _0x2e4dac=_0x44d102[_0x0959('0x20')];var _0x42c308=_0x3e97a4?0x0:_0xc1570f[_0x0959('0x21')];var _0x4b2873=_0x3e97a4?_0x44d102[_0x0959('0x20')]:_0xc1570f[_0x0959('0x21')]+_0xc1570f[_0x0959('0x1f')];var _0x356701;if(_0x4b2873>=_0x2e4dac){_0x4b2873=_0x2e4dac;_0x356701=0xc8;}else{_0x356701=0xce;}_0x5a7006['status'](_0x356701);return _0x5a7006['set'](_0x0959('0x22'),_0x42c308+'-'+_0x4b2873+'/'+_0x2e4dac)[_0x0959('0x1e')](_0x44d102);}return null;};}function patchUpdates(_0xe7e5cf){return function(_0x36a25a){try{jsonpatch[_0x0959('0x23')](_0x36a25a,_0xe7e5cf,!![]);}catch(_0x46375e){return BPromise[_0x0959('0x24')](_0x46375e);}return _0x36a25a[_0x0959('0x25')]();};}function saveUpdates(_0x1e91de,_0x3ed0ca){return function(_0x3f93ca){if(_0x3f93ca){return _0x3f93ca['update'](_0x1e91de)[_0x0959('0x26')](function(_0x2ec1a4){return _0x2ec1a4;});}return null;};}function removeEntity(_0x55e302,_0x65a77d){return function(_0x46410d){if(_0x46410d){return _0x46410d[_0x0959('0x27')]()['then'](function(){_0x55e302[_0x0959('0x1c')](0xcc)[_0x0959('0x1d')]();});}};}function handleEntityNotFound(_0x53e658,_0x590d89){return function(_0x5f0467){if(!_0x5f0467){_0x53e658[_0x0959('0x1b')](0x194);}return _0x5f0467;};}function handleError(_0x16db87,_0x50c827){_0x50c827=_0x50c827||0x1f4;return function(_0x464ea9){logger[_0x0959('0x28')](_0x464ea9[_0x0959('0x29')]);if(_0x464ea9[_0x0959('0x2a')]){delete _0x464ea9[_0x0959('0x2a')];}_0x16db87[_0x0959('0x1c')](_0x50c827)['send'](_0x464ea9);};}exports[_0x0959('0x2b')]=function(_0x3dedaf,_0x2390c9,_0x34a6c2){if(!_0x3dedaf[_0x0959('0x2c')][_0x0959('0x2d')]('text')&&!_0x3dedaf[_0x0959('0x2c')][_0x0959('0x2d')](_0x0959('0x2e'))){throw new db[(_0x0959('0x2f'))]['ValidationError'](_0x0959('0x30'));}else{if(_0x3dedaf[_0x0959('0x2c')][_0x0959('0x2d')](_0x0959('0x2e'))&&!_0x3dedaf[_0x0959('0x2c')]['hasOwnProperty'](_0x0959('0x31'))){throw new db[(_0x0959('0x2f'))][(_0x0959('0x32'))](_0x0959('0x33'));}if(!_0x3dedaf[_0x0959('0x2c')]['hasOwnProperty'](_0x0959('0x34'))){throw new db[(_0x0959('0x2f'))]['ValidationError'](_0x0959('0x35'));}else{try{var _0x60126=JSON[_0x0959('0x36')](_0x3dedaf[_0x0959('0x2c')]['recipients']);}catch(_0xa046a1){logger[_0x0959('0x28')](_0xa046a1);throw new db[(_0x0959('0x2f'))][(_0x0959('0x32'))](_0x0959('0x37'));}var _0x45df76=['chatqueue',_0x0959('0x38'),_0x0959('0x39'),_0x0959('0x3a'),_0x0959('0x3b'),_0x0959('0x3c'),_0x0959('0x3d'),'team','user'];if(_[_0x0959('0x3e')](_0x60126,function(_0x56e01c){return!_[_0x0959('0x3f')](_0x45df76,_0x56e01c[_0x0959('0x40')][_0x0959('0x41')]());})){throw new db[(_0x0959('0x2f'))][(_0x0959('0x32'))](_0x0959('0x42'));}}}var _0x243dd9={};_0x243dd9[_0x0959('0x43')]=_0x3dedaf[_0x0959('0x2c')][_0x0959('0x2d')]('senderName')?_0x3dedaf[_0x0959('0x2c')]['senderName']:_0x3dedaf['user']['fullname'];_0x243dd9[_0x0959('0x44')]=_[_0x0959('0x45')](_0x3dedaf[_0x0959('0x2c')][_0x0959('0x44')])?null:_0x3dedaf[_0x0959('0x2c')]['recipientsDescription'];_0x243dd9[_0x0959('0x46')]=_0x3dedaf[_0x0959('0x2c')][_0x0959('0x46')]||![];_0x243dd9['SenderId']=_0x3dedaf[_0x0959('0x47')]['id'];return getContent(_0x3dedaf[_0x0959('0x2c')])[_0x0959('0x26')](function(_0x16aefe){_0x243dd9[_0x0959('0x2c')]=_0x16aefe;return getRecipients(_0x60126);})[_0x0959('0x26')](function(_0x50ae69){_0x243dd9[_0x0959('0x48')]=_['sortBy'](_0x50ae69)[_0x0959('0x49')](',');return db[_0x0959('0x4a')][_0x0959('0x4b')](function(_0x2d47a7){return db[_0x0959('0x4c')][_0x0959('0x4d')](_0x243dd9,{'raw':!![],'transaction':_0x2d47a7})['then'](function(_0x5492ba){var _0x28c6a6={'sender':_0x243dd9[_0x0959('0x43')],'description':_0x243dd9[_0x0959('0x44')],'content':_0x243dd9['body'],'beep':_0x243dd9[_0x0959('0x46')]};_0x50ae69[_0x0959('0x4e')](function(_0x518e3e){_0x28c6a6[_0x0959('0x4f')]=_0x518e3e;socket[_0x0959('0x50')](_0x0959('0x51'),_0x28c6a6);});return _0x5492ba;});});})['then'](respondWithResult(_0x2390c9,0xc9))[_0x0959('0x52')](handleError(_0x2390c9,null));};function getContent(_0x16737a){return new BPromise(function(_0x169a9b,_0x158ccd){if(_0x16737a[_0x0959('0x53')]){_0x169a9b(_0x16737a[_0x0959('0x53')]);return;}return db[_0x0959('0x54')][_0x0959('0x55')]({'attributes':['html'],'where':{'id':_0x16737a[_0x0959('0x2e')]},'raw':!![]})[_0x0959('0x26')](function(_0x3f2e8c){if(!_0x3f2e8c)throw new db['Sequelize'][(_0x0959('0x32'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x57fdb4=Mustache[_0x0959('0x56')](_0x3f2e8c[_0x0959('0x57')],_0x16737a[_0x0959('0x31')]);_0x169a9b(_0x57fdb4);})[_0x0959('0x52')](function(_0x4e4b9a){_0x158ccd(_0x4e4b9a);});});}function getRecipients(_0x4aa1c3){return new BPromise(function(_0x50821,_0x40af5c){var _0x1c5f33=[];var _0x41d9e7=[];_0x4aa1c3[_0x0959('0x4e')](function(_0x1e2add){var _0x27f033=_[_0x0959('0x58')](_0x1e2add[_0x0959('0x40')][_0x0959('0x41')]());if(_0x27f033===_0x0959('0x59')){_0x1c5f33=_['union'](_0x1c5f33,_0x1e2add[_0x0959('0x5a')]);}else{if(_[_0x0959('0x3f')](_0x27f033,_0x0959('0x5b')))_0x27f033=_0x27f033[_0x0959('0x5c')]('queue',_0x0959('0x5d'));_0x1e2add[_0x0959('0x5a')]['forEach'](function(_0x28ca52){_0x41d9e7[_0x0959('0x5e')](getAgents(_0x27f033,_0x28ca52));});}});return BPromise[_0x0959('0x5f')](_0x41d9e7)[_0x0959('0x26')](function(_0x2ebb71){_0x1c5f33=_[_0x0959('0x60')](_0x1c5f33,_[_0x0959('0x61')](_0x2ebb71));_0x50821(_0x1c5f33);})['catch'](function(_0x471cdc){_0x40af5c(_0x471cdc);});});}function getAgents(_0x3ace2d,_0x239824){return new BPromise(function(_0x1bcf67,_0xa2a468){return db[_0x3ace2d][_0x0959('0x55')]({'where':{'id':_0x239824}})[_0x0959('0x26')](function(_0x33936f){return _0x33936f[_0x0959('0x62')]({'attributes':['id'],'raw':!![]})[_0x0959('0x26')](function(_0x2f5260){var _0x218718=_[_0x0959('0x63')](_0x2f5260,'id');_0x1bcf67(_0x218718);});})[_0x0959('0x52')](function(_0x50964a){_0xa2a468(_0x50964a);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 46bb9f1..b9252ed 100644 --- a/server/api/userNotification/userNotification.events.js +++ b/server/api/userNotification/userNotification.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa218=['hasOwnProperty','exports','events','UserNotification','setMaxListeners','save','update','emit'];(function(_0x2652ef,_0x234230){var _0x2db578=function(_0x56b137){while(--_0x56b137){_0x2652ef['push'](_0x2652ef['shift']());}};_0x2db578(++_0x234230);}(_0xa218,0x112));var _0x8a21=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xa218[_0x32f7d7];return _0x133d09;};'use strict';var EventEmitter=require(_0x8a21('0x0'));var UserNotification=require('../../mysqldb')['db'][_0x8a21('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x8a21('0x2')](0x0);var events={'afterCreate':_0x8a21('0x3'),'afterUpdate':_0x8a21('0x4'),'afterDestroy':'remove'};function emitEvent(_0xa75149){return function(_0x5c2624,_0x4b62cc,_0x52be8d){UserNotificationEvents[_0x8a21('0x5')](_0xa75149+':'+_0x5c2624['id'],_0x5c2624);UserNotificationEvents['emit'](_0xa75149,_0x5c2624);_0x52be8d(null);};}for(var e in events){if(events[_0x8a21('0x6')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x8a21('0x7')]=UserNotificationEvents; \ No newline at end of file +var _0xa101=['UserNotification','setMaxListeners','update','emit','hasOwnProperty','exports','events'];(function(_0x91e838,_0x42fae8){var _0x250b9d=function(_0x1d4f84){while(--_0x1d4f84){_0x91e838['push'](_0x91e838['shift']());}};_0x250b9d(++_0x42fae8);}(_0xa101,0x13a));var _0x1a10=function(_0x1b02bb,_0x3d9fde){_0x1b02bb=_0x1b02bb-0x0;var _0x131245=_0xa101[_0x1b02bb];return _0x131245;};'use strict';var EventEmitter=require(_0x1a10('0x0'));var UserNotification=require('../../mysqldb')['db'][_0x1a10('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x1a10('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1a10('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5e9d71){return function(_0x33416d,_0x4ab95d,_0x57242e){UserNotificationEvents['emit'](_0x5e9d71+':'+_0x33416d['id'],_0x33416d);UserNotificationEvents[_0x1a10('0x4')](_0x5e9d71,_0x33416d);_0x57242e(null);};}for(var e in events){if(events[_0x1a10('0x5')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x1a10('0x6')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 88bd8b9..6aabc8e 100644 --- a/server/api/userNotification/userNotification.model.js +++ b/server/api/userNotification/userNotification.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1b72=['rimraf','../../config/environment','./userNotification.attributes','define','UserNotification','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','path'];(function(_0xfe2302,_0x86e767){var _0x14f90d=function(_0x5a7726){while(--_0x5a7726){_0xfe2302['push'](_0xfe2302['shift']());}};_0x14f90d(++_0x86e767);}(_0x1b72,0x67));var _0x21b7=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x1b72[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require('lodash');var util=require(_0x21b7('0x0'));var logger=require(_0x21b7('0x1'))('api');var moment=require(_0x21b7('0x2'));var BPromise=require(_0x21b7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x21b7('0x4'));var rimraf=require(_0x21b7('0x5'));var config=require(_0x21b7('0x6'));var attributes=require(_0x21b7('0x7'));module['exports']=function(_0x2ccc0d,_0x5315f2){return _0x2ccc0d[_0x21b7('0x8')](_0x21b7('0x9'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x21b7('0xa'),'collate':_0x21b7('0xb')});}; \ No newline at end of file +var _0x65c5=['moment','path','../../config/environment','./userNotification.attributes','exports','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x553893,_0x3331a5){var _0xf32dc7=function(_0x19f910){while(--_0x19f910){_0x553893['push'](_0x553893['shift']());}};_0xf32dc7(++_0x3331a5);}(_0x65c5,0x1a9));var _0x565c=function(_0x3d4e2a,_0x5e90e8){_0x3d4e2a=_0x3d4e2a-0x0;var _0x527e09=_0x65c5[_0x3d4e2a];return _0x527e09;};'use strict';var _=require(_0x565c('0x0'));var util=require(_0x565c('0x1'));var logger=require(_0x565c('0x2'))(_0x565c('0x3'));var moment=require(_0x565c('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x565c('0x5'));var rimraf=require('rimraf');var config=require(_0x565c('0x6'));var attributes=require(_0x565c('0x7'));module[_0x565c('0x8')]=function(_0x67d742,_0x22583a){return _0x67d742['define'](_0x565c('0x9'),attributes,{'tableName':_0x565c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x565c('0xb'),'collate':_0x565c('0xc')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index fb1d440..f9bac1d 100644 --- a/server/api/userNotification/userNotification.rpc.js +++ b/server/api/userNotification/userNotification.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2988=['localhost','socket.io-emitter','./userNotification.socket','register','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x3b0268,_0x134ef2){var _0x2dd69a=function(_0x3d9dc6){while(--_0x3d9dc6){_0x3b0268['push'](_0x3b0268['shift']());}};_0x2dd69a(++_0x134ef2);}(_0x2988,0x101));var _0x8298=function(_0x2ab6bc,_0x2726fa){_0x2ab6bc=_0x2ab6bc-0x0;var _0x3cce59=_0x2988[_0x2ab6bc];return _0x3cce59;};'use strict';var _=require(_0x8298('0x0'));var util=require(_0x8298('0x1'));var moment=require(_0x8298('0x2'));var BPromise=require(_0x8298('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8298('0x4'))['db'];var utils=require(_0x8298('0x5'));var logger=require(_0x8298('0x6'))(_0x8298('0x7'));var config=require(_0x8298('0x8'));var jayson=require(_0x8298('0x9'));var client=jayson[_0x8298('0xa')][_0x8298('0xb')]({'port':0x232a});config[_0x8298('0xc')]=_['defaults'](config[_0x8298('0xc')],{'host':_0x8298('0xd'),'port':0x18eb});var socket=require(_0x8298('0xe'))(new Redis(config[_0x8298('0xc')]));require(_0x8298('0xf'))[_0x8298('0x10')](socket);function respondWithRpcPromise(_0x59b4f0,_0x5875f2,_0x42aebd){return new BPromise(function(_0x138635,_0x382110){return client[_0x8298('0x11')](_0x59b4f0,_0x42aebd)[_0x8298('0x12')](function(_0x2c5b19){logger[_0x8298('0x13')](_0x8298('0x14'),_0x5875f2,'request\x20sent');logger['debug']('UserNotification,\x20%s,\x20%s,\x20%s',_0x5875f2,_0x8298('0x15'),JSON[_0x8298('0x16')](_0x2c5b19));if(_0x2c5b19[_0x8298('0x17')]){if(_0x2c5b19[_0x8298('0x17')][_0x8298('0x18')]===0x1f4){logger[_0x8298('0x17')](_0x8298('0x14'),_0x5875f2,_0x2c5b19[_0x8298('0x17')][_0x8298('0x19')]);return _0x382110(_0x2c5b19[_0x8298('0x17')][_0x8298('0x19')]);}logger['error'](_0x8298('0x14'),_0x5875f2,_0x2c5b19['error'][_0x8298('0x19')]);return _0x138635(_0x2c5b19['error'][_0x8298('0x19')]);}else{logger[_0x8298('0x13')](_0x8298('0x14'),_0x5875f2,_0x8298('0x15'));_0x138635(_0x2c5b19['result'][_0x8298('0x19')]);}})[_0x8298('0x1a')](function(_0x1adb56){logger['error'](_0x8298('0x14'),_0x5875f2,_0x1adb56);_0x382110(_0x1adb56);});});} \ No newline at end of file +var _0xfc7b=['redis','defaults','localhost','socket.io-emitter','./userNotification.socket','request','then','info','request\x20sent','debug','stringify','error','UserNotification,\x20%s,\x20%s','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http'];(function(_0x483d8b,_0x526c52){var _0x6500f1=function(_0x372797){while(--_0x372797){_0x483d8b['push'](_0x483d8b['shift']());}};_0x6500f1(++_0x526c52);}(_0xfc7b,0x19e));var _0xbfc7=function(_0x37fe9a,_0x5f4d04){_0x37fe9a=_0x37fe9a-0x0;var _0x49b067=_0xfc7b[_0x37fe9a];return _0x49b067;};'use strict';var _=require(_0xbfc7('0x0'));var util=require(_0xbfc7('0x1'));var moment=require(_0xbfc7('0x2'));var BPromise=require('bluebird');var rs=require(_0xbfc7('0x3'));var fs=require('fs');var Redis=require(_0xbfc7('0x4'));var db=require(_0xbfc7('0x5'))['db'];var utils=require(_0xbfc7('0x6'));var logger=require('../../config/logger')(_0xbfc7('0x7'));var config=require(_0xbfc7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbfc7('0x9')][_0xbfc7('0xa')]({'port':0x232a});config[_0xbfc7('0xb')]=_[_0xbfc7('0xc')](config[_0xbfc7('0xb')],{'host':_0xbfc7('0xd'),'port':0x18eb});var socket=require(_0xbfc7('0xe'))(new Redis(config[_0xbfc7('0xb')]));require(_0xbfc7('0xf'))['register'](socket);function respondWithRpcPromise(_0x22415f,_0xfaa95c,_0x1f84f1){return new BPromise(function(_0x2e4cd9,_0x5d939b){return client[_0xbfc7('0x10')](_0x22415f,_0x1f84f1)[_0xbfc7('0x11')](function(_0x2262c3){logger[_0xbfc7('0x12')]('UserNotification,\x20%s,\x20%s',_0xfaa95c,_0xbfc7('0x13'));logger[_0xbfc7('0x14')]('UserNotification,\x20%s,\x20%s,\x20%s',_0xfaa95c,_0xbfc7('0x13'),JSON[_0xbfc7('0x15')](_0x2262c3));if(_0x2262c3[_0xbfc7('0x16')]){if(_0x2262c3['error']['code']===0x1f4){logger[_0xbfc7('0x16')]('UserNotification,\x20%s,\x20%s',_0xfaa95c,_0x2262c3[_0xbfc7('0x16')]['message']);return _0x5d939b(_0x2262c3[_0xbfc7('0x16')]['message']);}logger[_0xbfc7('0x16')]('UserNotification,\x20%s,\x20%s',_0xfaa95c,_0x2262c3[_0xbfc7('0x16')]['message']);return _0x2e4cd9(_0x2262c3[_0xbfc7('0x16')]['message']);}else{logger['info'](_0xbfc7('0x17'),_0xfaa95c,_0xbfc7('0x13'));_0x2e4cd9(_0x2262c3[_0xbfc7('0x18')]['message']);}})['catch'](function(_0x41e2e4){logger['error'](_0xbfc7('0x17'),_0xfaa95c,_0x41e2e4);_0x5d939b(_0x41e2e4);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index db64b1f..5cf8023 100644 --- a/server/api/userNotification/userNotification.socket.js +++ b/server/api/userNotification/userNotification.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa6b0=['save','remove','update','emit','removeListener','length','./userNotification.events'];(function(_0x3ed528,_0x52481c){var _0x3ac7fb=function(_0x473a8f){while(--_0x473a8f){_0x3ed528['push'](_0x3ed528['shift']());}};_0x3ac7fb(++_0x52481c);}(_0xa6b0,0x18e));var _0x0a6b=function(_0x283693,_0x5b512c){_0x283693=_0x283693-0x0;var _0xd2b8ef=_0xa6b0[_0x283693];return _0xd2b8ef;};'use strict';var UserNotificationEvents=require(_0x0a6b('0x0'));var events=[_0x0a6b('0x1'),_0x0a6b('0x2'),_0x0a6b('0x3')];function createListener(_0x21fcfe,_0x272414){return function(_0x19aa7d){_0x272414[_0x0a6b('0x4')](_0x21fcfe,_0x19aa7d);};}function removeListener(_0x23ff07,_0x1a5f11){return function(){UserNotificationEvents[_0x0a6b('0x5')](_0x23ff07,_0x1a5f11);};}exports['register']=function(_0x4acf60){for(var _0x5064c2=0x0,_0x52dc4f=events[_0x0a6b('0x6')];_0x5064c2<_0x52dc4f;_0x5064c2++){var _0x4eb252=events[_0x5064c2];var _0x468034=createListener('userNotification:'+_0x4eb252,_0x4acf60);UserNotificationEvents['on'](_0x4eb252,_0x468034);}}; \ No newline at end of file +var _0x4499=['save','update','emit','length','./userNotification.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4499,0x86));var _0x9449=function(_0x4fc756,_0x5969c9){_0x4fc756=_0x4fc756-0x0;var _0x6b1861=_0x4499[_0x4fc756];return _0x6b1861;};'use strict';var UserNotificationEvents=require(_0x9449('0x0'));var events=[_0x9449('0x1'),'remove',_0x9449('0x2')];function createListener(_0x209127,_0x246dd4){return function(_0xc0bbf){_0x246dd4[_0x9449('0x3')](_0x209127,_0xc0bbf);};}function removeListener(_0x16959e,_0x1a9920){return function(){UserNotificationEvents['removeListener'](_0x16959e,_0x1a9920);};}exports['register']=function(_0x14a9cf){for(var _0x5c7a1c=0x0,_0x1f7e56=events[_0x9449('0x4')];_0x5c7a1c<_0x1f7e56;_0x5c7a1c++){var _0x4757fc=events[_0x5c7a1c];var _0x4d1e1e=createListener('userNotification:'+_0x4757fc,_0x14a9cf);UserNotificationEvents['on'](_0x4757fc,_0x4d1e1e);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 50be67d..d228cdc 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x94ea5d,_0xe526c8){var _0x3f1692=function(_0x5c73cf){while(--_0x5c73cf){_0x94ea5d['push'](_0x94ea5d['shift']());}};_0x3f1692(++_0xe526c8);}(_0xe706,0xa3));var _0x6e70=function(_0x2df84d,_0x56d874){_0x2df84d=_0x2df84d-0x0;var _0x2634ce=_0xe706[_0x2df84d];return _0x2634ce;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x2dd085,_0x14a9de){var _0x18f010=function(_0x51f9d8){while(--_0x51f9d8){_0x2dd085['push'](_0x2dd085['shift']());}};_0x18f010(++_0x14a9de);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 04a3297..6f4e64e 100644 --- a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js +++ b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x268b=['INTEGER','sequelize','exports'];(function(_0x4344b6,_0x1973cb){var _0x5d6de3=function(_0x4e4047){while(--_0x4e4047){_0x4344b6['push'](_0x4344b6['shift']());}};_0x5d6de3(++_0x1973cb);}(_0x268b,0xca));var _0xb268=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x268b[_0x1a36a5];return _0x746243;};'use strict';var Sequelize=require(_0xb268('0x0'));module[_0xb268('0x1')]={'penalty':{'type':Sequelize[_0xb268('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x669d=['INTEGER','exports'];(function(_0xb862fd,_0x2de599){var _0x173ca1=function(_0x5ac899){while(--_0x5ac899){_0xb862fd['push'](_0xb862fd['shift']());}};_0x173ca1(++_0x2de599);}(_0x669d,0x97));var _0xd669=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x669d[_0x1beef3];return _0x5af964;};'use strict';var Sequelize=require('sequelize');module[_0xd669('0x0')]={'penalty':{'type':Sequelize[_0xd669('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index a3bab18..69ca08a 100644 --- a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js +++ b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcea9=['user_has_openchannel_queues','lodash','../../config/logger','api','request-promise','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue'];(function(_0x421cf8,_0x23152c){var _0x145c48=function(_0x565862){while(--_0x565862){_0x421cf8['push'](_0x421cf8['shift']());}};_0x145c48(++_0x23152c);}(_0xcea9,0x90));var _0x9cea=function(_0x48786d,_0x523e00){_0x48786d=_0x48786d-0x0;var _0x44a241=_0xcea9[_0x48786d];return _0x44a241;};'use strict';var _=require(_0x9cea('0x0'));var util=require('util');var logger=require(_0x9cea('0x1'))(_0x9cea('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9cea('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9cea('0x4'));var config=require(_0x9cea('0x5'));var attributes=require(_0x9cea('0x6'));module[_0x9cea('0x7')]=function(_0x6f5535,_0x1b61f2){return _0x6f5535[_0x9cea('0x8')](_0x9cea('0x9'),attributes,{'tableName':_0x9cea('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6a22=['../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','util','../../config/logger','api','moment','path','rimraf'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6a22,0x1c8));var _0x26a2=function(_0x5b7f48,_0x4d8a1d){_0x5b7f48=_0x5b7f48-0x0;var _0x2424b0=_0x6a22[_0x5b7f48];return _0x2424b0;};'use strict';var _=require('lodash');var util=require(_0x26a2('0x0'));var logger=require(_0x26a2('0x1'))(_0x26a2('0x2'));var moment=require(_0x26a2('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x26a2('0x4'));var rimraf=require(_0x26a2('0x5'));var config=require(_0x26a2('0x6'));var attributes=require(_0x26a2('0x7'));module[_0x26a2('0x8')]=function(_0x13418c,_0x59d903){return _0x13418c[_0x26a2('0x9')](_0x26a2('0xa'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index 95ba296..5f17aff 100644 --- a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js +++ b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0695=['info','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','UserOpenchannelQueue,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then'];(function(_0x30786b,_0x50879b){var _0x26a50d=function(_0x4fe06d){while(--_0x4fe06d){_0x30786b['push'](_0x30786b['shift']());}};_0x26a50d(++_0x50879b);}(_0x0695,0x127));var _0x5069=function(_0x3a3b65,_0x2f239f){_0x3a3b65=_0x3a3b65-0x0;var _0xc09bc0=_0x0695[_0x3a3b65];return _0xc09bc0;};'use strict';var _=require(_0x5069('0x0'));var util=require(_0x5069('0x1'));var moment=require(_0x5069('0x2'));var BPromise=require('bluebird');var rs=require(_0x5069('0x3'));var fs=require('fs');var Redis=require(_0x5069('0x4'));var db=require(_0x5069('0x5'))['db'];var utils=require(_0x5069('0x6'));var logger=require(_0x5069('0x7'))(_0x5069('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5069('0x9')][_0x5069('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf6bd1c,_0x4843f8,_0x57814e){return new BPromise(function(_0x1481af,_0x1babd9){return client[_0x5069('0xb')](_0xf6bd1c,_0x57814e)[_0x5069('0xc')](function(_0x2b0a7d){logger[_0x5069('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x4843f8,_0x5069('0xe'));logger['debug'](_0x5069('0xf'),_0x4843f8,_0x5069('0xe'),JSON['stringify'](_0x2b0a7d));if(_0x2b0a7d[_0x5069('0x10')]){if(_0x2b0a7d[_0x5069('0x10')][_0x5069('0x11')]===0x1f4){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x4843f8,_0x2b0a7d['error'][_0x5069('0x12')]);return _0x1babd9(_0x2b0a7d[_0x5069('0x10')]['message']);}logger['error'](_0x5069('0x13'),_0x4843f8,_0x2b0a7d['error'][_0x5069('0x12')]);return _0x1481af(_0x2b0a7d[_0x5069('0x10')][_0x5069('0x12')]);}else{logger['info'](_0x5069('0x13'),_0x4843f8,_0x5069('0xe'));_0x1481af(_0x2b0a7d[_0x5069('0x14')][_0x5069('0x12')]);}})[_0x5069('0x15')](function(_0x528a9b){logger[_0x5069('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x4843f8,_0x528a9b);_0x1babd9(_0x528a9b);});});} \ No newline at end of file +var _0x4c0e=['util','moment','ioredis','../../config/utils','rpc','jayson/promise','client','request','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash'];(function(_0x1da455,_0x2b162e){var _0xc719ff=function(_0x461568){while(--_0x461568){_0x1da455['push'](_0x1da455['shift']());}};_0xc719ff(++_0x2b162e);}(_0x4c0e,0xfb));var _0xe4c0=function(_0x6173fc,_0x32aadf){_0x6173fc=_0x6173fc-0x0;var _0x965fbe=_0x4c0e[_0x6173fc];return _0x965fbe;};'use strict';var _=require(_0xe4c0('0x0'));var util=require(_0xe4c0('0x1'));var moment=require(_0xe4c0('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe4c0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe4c0('0x4'));var logger=require('../../config/logger')(_0xe4c0('0x5'));var config=require('../../config/environment');var jayson=require(_0xe4c0('0x6'));var client=jayson[_0xe4c0('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x520e10,_0x27f67e,_0x127815){return new BPromise(function(_0x3157c4,_0x589fe5){return client[_0xe4c0('0x8')](_0x520e10,_0x127815)['then'](function(_0x57a9c9){logger[_0xe4c0('0x9')](_0xe4c0('0xa'),_0x27f67e,_0xe4c0('0xb'));logger[_0xe4c0('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x27f67e,'request\x20sent',JSON[_0xe4c0('0xd')](_0x57a9c9));if(_0x57a9c9[_0xe4c0('0xe')]){if(_0x57a9c9[_0xe4c0('0xe')][_0xe4c0('0xf')]===0x1f4){logger[_0xe4c0('0xe')](_0xe4c0('0xa'),_0x27f67e,_0x57a9c9[_0xe4c0('0xe')][_0xe4c0('0x10')]);return _0x589fe5(_0x57a9c9[_0xe4c0('0xe')][_0xe4c0('0x10')]);}logger[_0xe4c0('0xe')](_0xe4c0('0xa'),_0x27f67e,_0x57a9c9[_0xe4c0('0xe')][_0xe4c0('0x10')]);return _0x3157c4(_0x57a9c9[_0xe4c0('0xe')][_0xe4c0('0x10')]);}else{logger['info'](_0xe4c0('0xa'),_0x27f67e,'request\x20sent');_0x3157c4(_0x57a9c9[_0xe4c0('0x11')][_0xe4c0('0x10')]);}})['catch'](function(_0x430e2f){logger[_0xe4c0('0xe')](_0xe4c0('0xa'),_0x27f67e,_0x430e2f);_0x589fe5(_0x430e2f);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index e87b07f..b295a63 100644 --- a/server/api/userProfile/index.js +++ b/server/api/userProfile/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf391=['show','/:id/sections','getSections','getResources','post','create','/:id/clone','clone','addSections','/:id/resources','put','update','delete','destroy','removeSections','removeResources','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfile.controller','get','/describe','isAuthenticated','/:id'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf391,0x1f1));var _0x1f39=function(_0x251f99,_0x224b33){_0x251f99=_0x251f99-0x0;var _0x3c8ec2=_0xf391[_0x251f99];return _0x3c8ec2;};'use strict';var multer=require(_0x1f39('0x0'));var util=require(_0x1f39('0x1'));var path=require('path');var timeout=require(_0x1f39('0x2'));var express=require(_0x1f39('0x3'));var router=express[_0x1f39('0x4')]();var fs_extra=require(_0x1f39('0x5'));var auth=require(_0x1f39('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1f39('0x7'));var controller=require(_0x1f39('0x8'));router[_0x1f39('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1f39('0x9')](_0x1f39('0xa'),auth[_0x1f39('0xb')](),controller['describe']);router[_0x1f39('0x9')](_0x1f39('0xc'),auth[_0x1f39('0xb')](),controller[_0x1f39('0xd')]);router[_0x1f39('0x9')](_0x1f39('0xe'),auth[_0x1f39('0xb')](),controller[_0x1f39('0xf')]);router['get']('/:id/resources',auth[_0x1f39('0xb')](),controller[_0x1f39('0x10')]);router[_0x1f39('0x11')]('/',auth[_0x1f39('0xb')](),controller[_0x1f39('0x12')]);router[_0x1f39('0x11')](_0x1f39('0x13'),auth[_0x1f39('0xb')](),controller[_0x1f39('0x14')]);router[_0x1f39('0x11')](_0x1f39('0xe'),auth['isAuthenticated'](),controller[_0x1f39('0x15')]);router[_0x1f39('0x11')](_0x1f39('0x16'),auth['isAuthenticated'](),controller['addResources']);router[_0x1f39('0x17')](_0x1f39('0xc'),auth[_0x1f39('0xb')](),controller[_0x1f39('0x18')]);router[_0x1f39('0x19')](_0x1f39('0xc'),auth['isAuthenticated'](),controller[_0x1f39('0x1a')]);router[_0x1f39('0x19')](_0x1f39('0xe'),auth['isAuthenticated'](),controller[_0x1f39('0x1b')]);router[_0x1f39('0x19')]('/:id/resources',auth[_0x1f39('0xb')](),controller[_0x1f39('0x1c')]);module[_0x1f39('0x1d')]=router; \ No newline at end of file +var _0xa7b8=['clone','/:id/sections','addSections','addResources','/:id','update','delete','destroy','removeSections','removeResources','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfile.controller','get','index','/describe','describe','isAuthenticated','getSections','/:id/resources','getResources','post','create','/:id/clone'];(function(_0x412451,_0x188b76){var _0x4b4bd9=function(_0x1c6699){while(--_0x1c6699){_0x412451['push'](_0x412451['shift']());}};_0x4b4bd9(++_0x188b76);}(_0xa7b8,0x149));var _0x8a7b=function(_0x290735,_0x576eae){_0x290735=_0x290735-0x0;var _0x11ffb0=_0xa7b8[_0x290735];return _0x11ffb0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8a7b('0x0'));var timeout=require(_0x8a7b('0x1'));var express=require(_0x8a7b('0x2'));var router=express[_0x8a7b('0x3')]();var fs_extra=require(_0x8a7b('0x4'));var auth=require(_0x8a7b('0x5'));var interaction=require(_0x8a7b('0x6'));var config=require('../../config/environment');var controller=require(_0x8a7b('0x7'));router[_0x8a7b('0x8')]('/',auth['isAuthenticated'](),controller[_0x8a7b('0x9')]);router['get'](_0x8a7b('0xa'),auth['isAuthenticated'](),controller[_0x8a7b('0xb')]);router['get']('/:id',auth[_0x8a7b('0xc')](),controller['show']);router['get']('/:id/sections',auth['isAuthenticated'](),controller[_0x8a7b('0xd')]);router[_0x8a7b('0x8')](_0x8a7b('0xe'),auth['isAuthenticated'](),controller[_0x8a7b('0xf')]);router[_0x8a7b('0x10')]('/',auth[_0x8a7b('0xc')](),controller[_0x8a7b('0x11')]);router[_0x8a7b('0x10')](_0x8a7b('0x12'),auth[_0x8a7b('0xc')](),controller[_0x8a7b('0x13')]);router[_0x8a7b('0x10')](_0x8a7b('0x14'),auth[_0x8a7b('0xc')](),controller[_0x8a7b('0x15')]);router['post'](_0x8a7b('0xe'),auth[_0x8a7b('0xc')](),controller[_0x8a7b('0x16')]);router['put'](_0x8a7b('0x17'),auth[_0x8a7b('0xc')](),controller[_0x8a7b('0x18')]);router[_0x8a7b('0x19')](_0x8a7b('0x17'),auth[_0x8a7b('0xc')](),controller[_0x8a7b('0x1a')]);router[_0x8a7b('0x19')](_0x8a7b('0x14'),auth[_0x8a7b('0xc')](),controller[_0x8a7b('0x1b')]);router[_0x8a7b('0x19')](_0x8a7b('0xe'),auth[_0x8a7b('0xc')](),controller[_0x8a7b('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 4c1d3c3..ab08c97 100644 --- a/server/api/userProfile/userProfile.attributes.js +++ b/server/api/userProfile/userProfile.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6040=['split','BOOLEAN','sequelize','STRING','name','setDataValue','crudPermissions','join','getDataValue'];(function(_0x87fbcf,_0x2dbd4e){var _0x58a1b5=function(_0x222795){while(--_0x222795){_0x87fbcf['push'](_0x87fbcf['shift']());}};_0x58a1b5(++_0x2dbd4e);}(_0x6040,0x146));var _0x0604=function(_0x3a7634,_0x2db384){_0x3a7634=_0x3a7634-0x0;var _0x23bbe9=_0x6040[_0x3a7634];return _0x23bbe9;};'use strict';var Sequelize=require(_0x0604('0x0'));module['exports']={'name':{'type':Sequelize[_0x0604('0x1')],'allowNull':![],'unique':_0x0604('0x2')},'crudPermissions':{'type':Sequelize[_0x0604('0x1')],'set':function(_0x522f21){this[_0x0604('0x3')](_0x0604('0x4'),_0x522f21?_0x522f21[_0x0604('0x5')](''):[]);},'get':function(){return this[_0x0604('0x6')](_0x0604('0x4'))?this[_0x0604('0x6')](_0x0604('0x4'))[_0x0604('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x0604('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x0604('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x0604('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x0604('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x0604('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x0604('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xe3f4=['BOOLEAN','exports','setDataValue','crudPermissions','join','getDataValue','split','STRING'];(function(_0x64b13e,_0x3431bd){var _0x4b79b3=function(_0x2e24af){while(--_0x2e24af){_0x64b13e['push'](_0x64b13e['shift']());}};_0x4b79b3(++_0x3431bd);}(_0xe3f4,0x81));var _0x4e3f=function(_0x40be1f,_0x22379b){_0x40be1f=_0x40be1f-0x0;var _0x246458=_0xe3f4[_0x40be1f];return _0x246458;};'use strict';var Sequelize=require('sequelize');module[_0x4e3f('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x1426a9){this[_0x4e3f('0x1')](_0x4e3f('0x2'),_0x1426a9?_0x1426a9[_0x4e3f('0x3')](''):[]);},'get':function(){return this[_0x4e3f('0x4')](_0x4e3f('0x2'))?this[_0x4e3f('0x4')]('crudPermissions')[_0x4e3f('0x5')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x4e3f('0x6')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x4e3f('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x4e3f('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x4e3f('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x4e3f('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x4e3f('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x4e3f('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x4e3f('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 18734f0..bef79a8 100644 --- a/server/api/userProfile/userProfile.controller.js +++ b/server/api/userProfile/userProfile.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0a20=['save','update','then','error','stack','name','map','UserProfile','rawAttributes','key','query','keys','filters','model','attributes','intersection','fields','length','sort','where','pick','filter','merge','type','options','include','findAll','catch','show','params','includeAll','find','create','get','createdAt','updatedAt','crudPermissions','body','omit','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','Resources','destroy','describe','addSections','userProfileId','push','getSections','includes','isEmpty','subsections','concat','enabled','findOne','Dashboard','forEach','resourceId','addResources','bulkCreate','removeResources','getResources','section','hasOwnProperty','nolimit','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./userProfile.socket','sendStatus','end','status','json','offset','undefined','limit','count','set'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x0a20,0x1ed));var _0x00a2=function(_0x13770c,_0x37b7eb){_0x13770c=_0x13770c-0x0;var _0x447aec=_0x0a20[_0x13770c];return _0x447aec;};'use strict';var emlformat=require(_0x00a2('0x0'));var rimraf=require(_0x00a2('0x1'));var zipdir=require(_0x00a2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x00a2('0x3'));var moment=require(_0x00a2('0x4'));var BPromise=require(_0x00a2('0x5'));var Mustache=require('mustache');var util=require(_0x00a2('0x6'));var path=require(_0x00a2('0x7'));var sox=require(_0x00a2('0x8'));var csv=require(_0x00a2('0x9'));var ejs=require(_0x00a2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x00a2('0xb'));var squel=require(_0x00a2('0xc'));var crypto=require(_0x00a2('0xd'));var jsforce=require(_0x00a2('0xe'));var deskjs=require(_0x00a2('0xf'));var toCsv=require(_0x00a2('0x9'));var querystring=require('querystring');var Papa=require(_0x00a2('0x10'));var Redis=require(_0x00a2('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x00a2('0x12'));var as=require(_0x00a2('0x13'));var hardwareService=require(_0x00a2('0x14'));var logger=require(_0x00a2('0x15'))('api');var utils=require(_0x00a2('0x16'));var config=require(_0x00a2('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x00a2('0x18')]=_['defaults'](config['redis'],{'host':_0x00a2('0x19'),'port':0x18eb});var socket=require(_0x00a2('0x1a'))(new Redis(config['redis']));require(_0x00a2('0x1b'))['register'](socket);function respondWithStatusCode(_0x34cf48,_0x3681ae){_0x3681ae=_0x3681ae||0xcc;return function(_0x551098){if(_0x551098){return _0x34cf48[_0x00a2('0x1c')](_0x3681ae);}return _0x34cf48['status'](_0x3681ae)[_0x00a2('0x1d')]();};}function respondWithResult(_0x2685c1,_0x1c3f08){_0x1c3f08=_0x1c3f08||0xc8;return function(_0xdaec0e){if(_0xdaec0e){return _0x2685c1[_0x00a2('0x1e')](_0x1c3f08)[_0x00a2('0x1f')](_0xdaec0e);}};}function respondWithFilteredResult(_0x540f42,_0x227599){return function(_0xbc6922){if(_0xbc6922){var _0x102a6f=typeof _0x227599[_0x00a2('0x20')]===_0x00a2('0x21')&&typeof _0x227599[_0x00a2('0x22')]==='undefined';var _0x58e2af=_0xbc6922[_0x00a2('0x23')];var _0x4a332d=_0x102a6f?0x0:_0x227599[_0x00a2('0x20')];var _0x32520f=_0x102a6f?_0xbc6922[_0x00a2('0x23')]:_0x227599[_0x00a2('0x20')]+_0x227599[_0x00a2('0x22')];var _0x269ef6;if(_0x32520f>=_0x58e2af){_0x32520f=_0x58e2af;_0x269ef6=0xc8;}else{_0x269ef6=0xce;}_0x540f42['status'](_0x269ef6);return _0x540f42[_0x00a2('0x24')]('Content-Range',_0x4a332d+'-'+_0x32520f+'/'+_0x58e2af)['json'](_0xbc6922);}return null;};}function patchUpdates(_0x21c3e9){return function(_0x3f050b){try{jsonpatch['apply'](_0x3f050b,_0x21c3e9,!![]);}catch(_0xda3c19){return BPromise['reject'](_0xda3c19);}return _0x3f050b[_0x00a2('0x25')]();};}function saveUpdates(_0x7ab198,_0x4899fe){return function(_0x2ced9b){if(_0x2ced9b){return _0x2ced9b[_0x00a2('0x26')](_0x7ab198)[_0x00a2('0x27')](function(_0x196694){return _0x196694;});}return null;};}function removeEntity(_0x56542c,_0x1664c5){return function(_0x373054){if(_0x373054){return _0x373054['destroy']()[_0x00a2('0x27')](function(){_0x56542c[_0x00a2('0x1e')](0xcc)[_0x00a2('0x1d')]();});}};}function handleEntityNotFound(_0x1e2f7c,_0x3a523c){return function(_0x408c79){if(!_0x408c79){_0x1e2f7c['sendStatus'](0x194);}return _0x408c79;};}function handleError(_0x3a8502,_0x195feb){_0x195feb=_0x195feb||0x1f4;return function(_0x4c192b){logger[_0x00a2('0x28')](_0x4c192b[_0x00a2('0x29')]);if(_0x4c192b[_0x00a2('0x2a')]){delete _0x4c192b['name'];}_0x3a8502[_0x00a2('0x1e')](_0x195feb)['send'](_0x4c192b);};}exports['index']=function(_0x2702b4,_0x34ef99){var _0x38070a={},_0x2e534f={},_0x25037a={'count':0x0,'rows':[]};var _0x3186fa=_[_0x00a2('0x2b')](db[_0x00a2('0x2c')][_0x00a2('0x2d')],function(_0x13619c){return{'name':_0x13619c['fieldName'],'type':_0x13619c['type'][_0x00a2('0x2e')]};});_0x2e534f['model']=_[_0x00a2('0x2b')](_0x3186fa,_0x00a2('0x2a'));_0x2e534f[_0x00a2('0x2f')]=_[_0x00a2('0x30')](_0x2702b4[_0x00a2('0x2f')]);_0x2e534f[_0x00a2('0x31')]=_['intersection'](_0x2e534f[_0x00a2('0x32')],_0x2e534f['query']);_0x38070a[_0x00a2('0x33')]=_[_0x00a2('0x34')](_0x2e534f['model'],qs[_0x00a2('0x35')](_0x2702b4[_0x00a2('0x2f')][_0x00a2('0x35')]));_0x38070a['attributes']=_0x38070a[_0x00a2('0x33')][_0x00a2('0x36')]?_0x38070a['attributes']:_0x2e534f[_0x00a2('0x32')];if(!_0x2702b4['query']['hasOwnProperty']('nolimit')){_0x38070a[_0x00a2('0x22')]=qs['limit'](_0x2702b4[_0x00a2('0x2f')][_0x00a2('0x22')]);_0x38070a[_0x00a2('0x20')]=qs[_0x00a2('0x20')](_0x2702b4[_0x00a2('0x2f')][_0x00a2('0x20')]);}_0x38070a['order']=qs[_0x00a2('0x37')](_0x2702b4[_0x00a2('0x2f')][_0x00a2('0x37')]);_0x38070a[_0x00a2('0x38')]=qs[_0x00a2('0x31')](_[_0x00a2('0x39')](_0x2702b4[_0x00a2('0x2f')],_0x2e534f['filters']),_0x3186fa);if(_0x2702b4[_0x00a2('0x2f')][_0x00a2('0x3a')]){_0x38070a[_0x00a2('0x38')]=_[_0x00a2('0x3b')](_0x38070a[_0x00a2('0x38')],{'$or':_[_0x00a2('0x2b')](_0x3186fa,function(_0x308411){if(_0x308411[_0x00a2('0x3c')]!=='VIRTUAL'){var _0x3116ee={};_0x3116ee[_0x308411[_0x00a2('0x2a')]]={'$like':'%'+_0x2702b4[_0x00a2('0x2f')]['filter']+'%'};return _0x3116ee;}})});}_0x38070a=_['merge']({},_0x38070a,_0x2702b4[_0x00a2('0x3d')]);var _0x2ce84a={'where':_0x38070a[_0x00a2('0x38')]};return db[_0x00a2('0x2c')][_0x00a2('0x23')](_0x2ce84a)['then'](function(_0x4dca71){_0x25037a[_0x00a2('0x23')]=_0x4dca71;if(_0x2702b4[_0x00a2('0x2f')]['includeAll']){_0x38070a[_0x00a2('0x3e')]=[{'all':!![]}];}return db[_0x00a2('0x2c')][_0x00a2('0x3f')](_0x38070a);})[_0x00a2('0x27')](function(_0x4bd6f9){_0x25037a['rows']=_0x4bd6f9;return _0x25037a;})[_0x00a2('0x27')](respondWithFilteredResult(_0x34ef99,_0x38070a))[_0x00a2('0x40')](handleError(_0x34ef99,null));};exports[_0x00a2('0x41')]=function(_0x456741,_0x176150){var _0xc483df={'raw':![],'where':{'id':_0x456741[_0x00a2('0x42')]['id']}},_0x388f88={};_0x388f88['model']=_['keys'](db[_0x00a2('0x2c')][_0x00a2('0x2d')]);_0x388f88[_0x00a2('0x2f')]=_[_0x00a2('0x30')](_0x456741[_0x00a2('0x2f')]);_0x388f88['filters']=_[_0x00a2('0x34')](_0x388f88[_0x00a2('0x32')],_0x388f88[_0x00a2('0x2f')]);_0xc483df['attributes']=_[_0x00a2('0x34')](_0x388f88[_0x00a2('0x32')],qs['fields'](_0x456741[_0x00a2('0x2f')][_0x00a2('0x35')]));_0xc483df[_0x00a2('0x33')]=_0xc483df[_0x00a2('0x33')][_0x00a2('0x36')]?_0xc483df['attributes']:_0x388f88[_0x00a2('0x32')];if(_0x456741[_0x00a2('0x2f')][_0x00a2('0x43')]){_0xc483df[_0x00a2('0x3e')]=[{'all':!![]}];}_0xc483df=_[_0x00a2('0x3b')]({},_0xc483df,_0x456741['options']);return db[_0x00a2('0x2c')][_0x00a2('0x44')](_0xc483df)[_0x00a2('0x27')](handleEntityNotFound(_0x176150,null))[_0x00a2('0x27')](respondWithResult(_0x176150,null))[_0x00a2('0x40')](handleError(_0x176150,null));};exports[_0x00a2('0x45')]=function(_0x4a67b3,_0x440f07){return db[_0x00a2('0x2c')]['create'](_0x4a67b3['body'],{})[_0x00a2('0x27')](respondWithResult(_0x440f07,0xc9))[_0x00a2('0x40')](handleError(_0x440f07,null));};exports['clone']=function(_0x1b1f3c,_0x20004e){var _0x21fdce={'where':{'id':_0x1b1f3c['params']['id']}},_0x4c817d={};_0x4c817d[_0x00a2('0x32')]=_[_0x00a2('0x30')](db['UserProfile'][_0x00a2('0x2d')]);_0x21fdce[_0x00a2('0x33')]=_[_0x00a2('0x34')](_0x4c817d[_0x00a2('0x32')],qs[_0x00a2('0x35')](_0x1b1f3c[_0x00a2('0x2f')][_0x00a2('0x35')]));_0x21fdce[_0x00a2('0x33')]=_0x21fdce['attributes']['length']?_0x21fdce[_0x00a2('0x33')]:_0x4c817d[_0x00a2('0x32')];if(_0x1b1f3c[_0x00a2('0x2f')][_0x00a2('0x43')]){_0x21fdce['include']=[{'all':!![]}];}_0x21fdce=_[_0x00a2('0x3b')]({},_0x21fdce,_0x1b1f3c[_0x00a2('0x3d')]);return db[_0x00a2('0x2c')][_0x00a2('0x44')](_0x21fdce)['then'](handleEntityNotFound(_0x20004e,null))[_0x00a2('0x27')](function(_0x20a839){if(_0x20a839){var _0x310643=_0x20a839[_0x00a2('0x46')]({'plain':!![]});_0x310643=qs['omit'](_0x310643,['id',_0x00a2('0x47'),_0x00a2('0x48'),_0x00a2('0x49')]);_0x1b1f3c[_0x00a2('0x4a')]=_[_0x00a2('0x4b')](_0x1b1f3c[_0x00a2('0x4a')],['id',_0x00a2('0x47'),_0x00a2('0x48')]);return db[_0x00a2('0x4c')][_0x00a2('0x4d')](function(_0x4db43a){return db[_0x00a2('0x2c')]['create'](_['merge'](_0x310643,_0x1b1f3c[_0x00a2('0x4a')]),{'include':_0x1b1f3c[_0x00a2('0x2f')][_0x00a2('0x43')]?[{'all':!![]}]:undefined,'transaction':_0x4db43a})[_0x00a2('0x27')](function(_0x58b6ac){var _0x1e8a68=_0x58b6ac['get']({'plain':!![]});return db[_0x00a2('0x4e')][_0x00a2('0x3f')]({'where':{'userProfileId':_0x1b1f3c[_0x00a2('0x42')]['id']},'raw':!![]})[_0x00a2('0x27')](function(_0x9bd1d6){if(_0x9bd1d6){return BPromise[_0x00a2('0x4f')](_0x9bd1d6,function(_0x2e47af){return new BPromise(function(_0x461964,_0x1f1843){if(_0x2e47af[_0x00a2('0x50')]===null||_0x2e47af[_0x00a2('0x50')]===0x1)_0x461964(null);return db[_0x00a2('0x51')]['findAll']({'where':{'sectionId':_0x2e47af['id']},'raw':!![]})['then'](function(_0x3df912){var _0x47b9e2=_[_0x00a2('0x2b')](_0x3df912,function(_0x441164){return qs[_0x00a2('0x4b')](_0x441164,['id',_0x00a2('0x47'),_0x00a2('0x48'),_0x00a2('0x52')]);});_0x461964(_0x47b9e2);})[_0x00a2('0x40')](function(_0xcb1c0){_0x1f1843(_0xcb1c0);});})[_0x00a2('0x27')](function(_0x175535){var _0x22f1eb=qs[_0x00a2('0x4b')](_0x2e47af,['id',_0x00a2('0x47'),'updatedAt']);_0x22f1eb['userProfileId']=_0x1e8a68['id'];if(_0x175535)_0x22f1eb[_0x00a2('0x53')]=_0x175535;return _0x22f1eb;})[_0x00a2('0x27')](function(_0x546229){return db[_0x00a2('0x4e')][_0x00a2('0x45')](_0x546229,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x4db43a});});})[_0x00a2('0x27')](function(){return _0x1e8a68;});}});});});}})['then'](respondWithResult(_0x20004e,0xc9))['catch'](handleError(_0x20004e,null));};exports[_0x00a2('0x26')]=function(_0x5176f4,_0x2a2e38){if(_0x5176f4[_0x00a2('0x4a')]['id']){delete _0x5176f4[_0x00a2('0x4a')]['id'];}return db[_0x00a2('0x2c')]['find']({'where':{'id':_0x5176f4['params']['id']}})[_0x00a2('0x27')](handleEntityNotFound(_0x2a2e38,null))[_0x00a2('0x27')](saveUpdates(_0x5176f4['body'],null))[_0x00a2('0x27')](respondWithResult(_0x2a2e38,null))[_0x00a2('0x40')](handleError(_0x2a2e38,null));};exports[_0x00a2('0x54')]=function(_0xf7fc90,_0x26c0f6){return db['UserProfile'][_0x00a2('0x44')]({'where':{'id':_0xf7fc90[_0x00a2('0x42')]['id']}})['then'](handleEntityNotFound(_0x26c0f6,null))[_0x00a2('0x27')](removeEntity(_0x26c0f6,null))[_0x00a2('0x40')](handleError(_0x26c0f6,null));};exports[_0x00a2('0x55')]=function(_0x5f305f,_0x44b2fa){return db[_0x00a2('0x2c')][_0x00a2('0x55')]()[_0x00a2('0x27')](respondWithResult(_0x44b2fa,null))['catch'](handleError(_0x44b2fa,null));};exports[_0x00a2('0x56')]=function(_0x4642b2,_0x33f020){var _0x5a0e2d=_0x4642b2[_0x00a2('0x4a')];return db[_0x00a2('0x2c')][_0x00a2('0x44')]({'where':{'id':_0x4642b2[_0x00a2('0x42')]['id']}})[_0x00a2('0x27')](handleEntityNotFound(_0x33f020,null))[_0x00a2('0x27')](function(_0x4d375a){if(_0x4d375a){return db[_0x00a2('0x4c')]['transaction'](function(_0x5ad419){return db[_0x00a2('0x4e')][_0x00a2('0x54')]({'where':{'userProfileId':_0x4642b2['params']['id'],'sectionId':_[_0x00a2('0x2b')](_0x5a0e2d,function(_0x213c9a){return _0x213c9a['sectionId'];})},'transaction':_0x5ad419})[_0x00a2('0x27')](function(){var _0x5ccedb=_[_0x00a2('0x2b')](_0x5a0e2d,function(_0x4d9a47){_0x4d9a47[_0x00a2('0x57')]=_0x4642b2['params']['id'];return _0x4d9a47;});var _0x199a21=[];return BPromise[_0x00a2('0x4f')](_0x5ccedb,function(_0x45597f){return db[_0x00a2('0x4e')][_0x00a2('0x45')](_0x45597f,{'include':[{'model':db[_0x00a2('0x51')],'as':_0x00a2('0x53')}],'raw':!![],'transaction':_0x5ad419})[_0x00a2('0x27')](function(_0x3d2d71){_0x199a21[_0x00a2('0x58')](_0x3d2d71[_0x00a2('0x46')]({'plain':!![]}));});})[_0x00a2('0x27')](function(){return _0x199a21;});});});}})['then'](function(_0x1772d3){return _0x1772d3;})['then'](respondWithResult(_0x33f020,null))[_0x00a2('0x40')](handleError(_0x33f020,null));};exports['removeSections']=function(_0x614d80,_0x3c0435){var _0x1482a7;return db[_0x00a2('0x2c')][_0x00a2('0x44')]({'where':{'id':_0x614d80[_0x00a2('0x42')]['id']},'attributes':['id',_0x00a2('0x2a')]})[_0x00a2('0x27')](handleEntityNotFound(_0x3c0435,null))[_0x00a2('0x27')](function(_0x5b692d){if(_0x5b692d){_0x1482a7=_0x5b692d;return db[_0x00a2('0x4e')][_0x00a2('0x54')]({'where':{'userProfileId':_0x614d80[_0x00a2('0x42')]['id'],'sectionId':_0x614d80[_0x00a2('0x2f')]['ids']}});}})[_0x00a2('0x27')](function(){return _0x1482a7;})[_0x00a2('0x27')](respondWithStatusCode(_0x3c0435,null))[_0x00a2('0x40')](handleError(_0x3c0435,null));};exports[_0x00a2('0x59')]=function(_0x49353f,_0x502ec4){var _0xfc757a=[];var _0x3f2bad=[];return db[_0x00a2('0x4e')][_0x00a2('0x3f')]({'where':{'userProfileId':_0x49353f[_0x00a2('0x42')]['id']},'raw':!![]})[_0x00a2('0x27')](function(_0x4a4191){_0xfc757a=_[_0x00a2('0x3a')](_0x4a4191,function(_0xa6fe3b){return _0xa6fe3b['enabled']===0x1||_[_0x00a2('0x5a')]([0x3eb,0x709],_0xa6fe3b[_0x00a2('0x52')]);});if(!_[_0x00a2('0x5b')](_0xfc757a)){return _['map'](_0xfc757a,function(_0x23e8d0){return _0x23e8d0[_0x00a2('0x52')];});}else{return;}})[_0x00a2('0x27')](function(_0x151b4f){if(_0x151b4f)_0x3f2bad=_0x151b4f;if(_[_0x00a2('0x5a')](_0x3f2bad,0x64)){var _0x38f961=_['find'](_0xfc757a,{'sectionId':0x64});return hasDefaultDashboard(_0x38f961)[_0x00a2('0x27')](function(_0xac043c){return _[_0x00a2('0x2b')](_0xfc757a,function(_0x53ae75){if(_0x53ae75[_0x00a2('0x52')]===0x64){_0x53ae75[_0x00a2('0x5c')]=_0xac043c;}return _0x53ae75;});});}else{return;}})['then'](function(_0x5649de){if(_0x5649de)_0xfc757a=_0x5649de;if(_[_0x00a2('0x5a')](_0x3f2bad,0x3eb)){var _0x440cea=_[_0x00a2('0x44')](_0xfc757a,{'sectionId':0x3eb});return getCustomDashboards(_0x440cea)[_0x00a2('0x27')](function(_0x5c0f6a){return _[_0x00a2('0x2b')](_0xfc757a,function(_0x5bf8a3){if(_0x440cea['enabled']){if(_0x5bf8a3[_0x00a2('0x52')]===0x3eb){_0x5bf8a3[_0x00a2('0x5c')]=_0x5c0f6a;}}else{if(_0x5bf8a3[_0x00a2('0x52')]===0x64){if(!_0x5bf8a3[_0x00a2('0x5c')]){_0x5bf8a3[_0x00a2('0x5c')]=[];}_0x5bf8a3[_0x00a2('0x5c')]=_0x5bf8a3['subsections'][_0x00a2('0x5d')](_0x5c0f6a);}}return _0x5bf8a3;});});}else{return;}})[_0x00a2('0x27')](function(_0x5b87a9){if(_0x5b87a9)_0xfc757a=_0x5b87a9;if(_[_0x00a2('0x5a')](_0x3f2bad,0x709)){var _0x2f6477=_[_0x00a2('0x44')](_0xfc757a,{'sectionId':0x709});return getPlugins(_0x2f6477)[_0x00a2('0x27')](function(_0x369191){if(_0x2f6477[_0x00a2('0x5e')]){return _[_0x00a2('0x2b')](_0xfc757a,function(_0x4a7c2c){if(_0x4a7c2c[_0x00a2('0x52')]===0x709){_0x4a7c2c['subsections']=_0x369191;}return _0x4a7c2c;});}else{var _0x1ec437={'sectionId':0x76c,'enabled':0x1,'subsections':_0x369191};var _0x15c88d=_[_0x00a2('0x2b')](_0xfc757a);_0x15c88d[_0x00a2('0x58')](_0x1ec437);return _0x15c88d;}});}else{return;}})[_0x00a2('0x27')](function(_0x4bad38){if(_0x4bad38)_0xfc757a=_0x4bad38;return _[_0x00a2('0x3a')](_0xfc757a,[_0x00a2('0x5e'),0x1]);})[_0x00a2('0x27')](respondWithResult(_0x502ec4,null))[_0x00a2('0x40')](handleError(_0x502ec4,null));};function hasDefaultDashboard(_0x559045){var _0x2af67a=[0x65];return new BPromise(function(_0x33c435,_0x1f2b7e){try{if(_0x559045['autoAssociation']){_0x33c435(_0x2af67a);}else{return db[_0x00a2('0x51')][_0x00a2('0x5f')]({'where':{'sectionId':_0x559045['id']},'raw':!![]})[_0x00a2('0x27')](function(_0x185cbc){_0x185cbc?_0x33c435(_0x2af67a):_0x33c435();});}}catch(_0x25e063){_0x1f2b7e(_0x25e063);}});}function getCustomDashboards(_0x392f00){var _0x3a977f=[];return new BPromise(function(_0x19450b,_0x4d383b){try{if(_0x392f00['autoAssociation']){return db[_0x00a2('0x60')][_0x00a2('0x3f')]({'raw':!![]})['then'](function(_0x17e79a){_0x17e79a[_0x00a2('0x61')](function(_0x57277a){_0x3a977f[_0x00a2('0x58')](_0x57277a['id']+0x1869f);});_0x19450b(_0x3a977f);});}else{return db[_0x00a2('0x51')][_0x00a2('0x3f')]({'where':{'sectionId':_0x392f00['id']},'raw':!![]})[_0x00a2('0x27')](function(_0x2fd025){_0x2fd025['forEach'](function(_0x308edc){_0x3a977f[_0x00a2('0x58')](_0x308edc[_0x00a2('0x62')]+0x1869f);});_0x19450b(_0x3a977f);});}}catch(_0x2b4224){_0x4d383b(_0x2b4224);}});}function getPlugins(_0x2751cf){var _0x48e31a=[];return new BPromise(function(_0x326d85,_0x345a28){try{if(_0x2751cf[_0x00a2('0x50')]){return db['Plugin'][_0x00a2('0x3f')]({'raw':!![]})[_0x00a2('0x27')](function(_0x467c4f){_0x467c4f[_0x00a2('0x61')](function(_0x243a79){_0x48e31a[_0x00a2('0x58')](_0x243a79['id']+0x15b38);});_0x326d85(_0x48e31a);});}else{return db[_0x00a2('0x51')][_0x00a2('0x3f')]({'where':{'sectionId':_0x2751cf['id']},'raw':!![]})[_0x00a2('0x27')](function(_0x2f3525){_0x2f3525[_0x00a2('0x61')](function(_0x285d0e){_0x48e31a[_0x00a2('0x58')](_0x285d0e[_0x00a2('0x62')]+0x15b38);});_0x326d85(_0x48e31a);});}}catch(_0x15fdde){_0x345a28(_0x15fdde);}});}exports[_0x00a2('0x63')]=function(_0x5da448,_0xa62384){return db[_0x00a2('0x2c')][_0x00a2('0x44')]({'where':{'id':_0x5da448[_0x00a2('0x42')]['id']}})['then'](handleEntityNotFound(_0xa62384,null))[_0x00a2('0x27')](function(_0x17f8fa){if(_0x17f8fa){return db['sequelize'][_0x00a2('0x4d')](function(_0x2285d2){return db[_0x00a2('0x4e')]['findAll']({'where':{'userProfileId':_0x5da448[_0x00a2('0x42')]['id']},'attributes':['id'],'raw':!![]})[_0x00a2('0x27')](function(_0xf4961){if(_0xf4961){return db[_0x00a2('0x4e')][_0x00a2('0x54')]({'where':{'userProfileId':_0x5da448[_0x00a2('0x42')]['id'],'id':_[_0x00a2('0x2b')](_0xf4961,function(_0x5964e0){return _0x5964e0['id'];})},'transaction':_0x2285d2});}})[_0x00a2('0x27')](function(_0x1d71af){var _0x384bc1=_[_0x00a2('0x2b')](_0x5da448['body'],function(_0x3f2c51){_0x3f2c51[_0x00a2('0x57')]=_0x5da448[_0x00a2('0x42')]['id'];return _0x3f2c51;});return db[_0x00a2('0x4e')][_0x00a2('0x64')](_0x384bc1,{'raw':!![],'transaction':_0x2285d2});})['then'](function(_0x873e1a){var _0x30f4c3=_[_0x00a2('0x3a')](_[_0x00a2('0x2b')](_0x873e1a,function(_0x57344c){return _0x57344c['get']({'plain':!![]});}),{'includeAll':![]});if(_0x30f4c3){return db[_0x00a2('0x4e')][_0x00a2('0x3f')]({'where':{'userProfileId':_0x5da448[_0x00a2('0x42')]['id'],'sectionId':_[_0x00a2('0x2b')](_0x30f4c3,function(_0x5a6acb){return _0x5a6acb[_0x00a2('0x52')];})},'attributes':['id',_0x00a2('0x52')],'raw':!![]})['then'](function(_0x2f966d){var _0x1d842a=_[_0x00a2('0x2b')](_0x5da448[_0x00a2('0x4a')],function(_0x5b27b2){_0x5b27b2['userProfileId']=_0x5da448[_0x00a2('0x42')]['id'];return _0x5b27b2;});return db[_0x00a2('0x51')][_0x00a2('0x64')](_0x1d842a,{'raw':!![],'transaction':_0x2285d2});});}})[_0x00a2('0x40')](handleError(_0xa62384,null));});}})[_0x00a2('0x27')](function(_0xf56f6e){var _0x426d1e=_[_0x00a2('0x2b')](_0xf56f6e,function(_0x2d91e9){return _0x2d91e9['get']({'plain':!![]});});})['then'](respondWithResult(_0xa62384,null))['catch'](handleError(_0xa62384,null));};exports['removeResources']=function(_0x34008b,_0x5b8ec9,_0x2189ee){return db[_0x00a2('0x2c')][_0x00a2('0x44')]({'where':{'id':_0x34008b[_0x00a2('0x42')]['id']}})[_0x00a2('0x27')](handleEntityNotFound(_0x5b8ec9,null))['then'](function(_0x545998){if(_0x545998){return _0x545998[_0x00a2('0x65')](_0x34008b[_0x00a2('0x2f')]['ids']);}})[_0x00a2('0x27')](respondWithStatusCode(_0x5b8ec9,null))[_0x00a2('0x40')](handleError(_0x5b8ec9,null));};exports[_0x00a2('0x66')]=function(_0x380c87,_0x255420){var _0x7c8064={};if(!_0x380c87[_0x00a2('0x2f')][_0x00a2('0x67')])throw new Error('Missing\x20section\x20parameter');if(!_0x380c87[_0x00a2('0x2f')][_0x00a2('0x68')](_0x00a2('0x69'))){_0x7c8064[_0x00a2('0x22')]=qs[_0x00a2('0x22')](_0x380c87[_0x00a2('0x2f')]['limit']);_0x7c8064['offset']=qs['offset'](_0x380c87[_0x00a2('0x2f')][_0x00a2('0x20')]);}return db['UserProfile'][_0x00a2('0x44')]({'where':{'id':_0x380c87[_0x00a2('0x42')]['id']}})['then'](function(_0x5a57dc){if(!_0x5a57dc)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x380c87[_0x00a2('0x42')]['id']);return db[_0x00a2('0x2c')][_0x00a2('0x66')](_0x380c87);})[_0x00a2('0x27')](respondWithFilteredResult(_0x255420,_0x7c8064))['catch'](handleError(_0x255420,null));}; \ No newline at end of file +var _0x4c66=['then','destroy','error','stack','name','send','index','map','UserProfile','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','clone','length','get','createdAt','updatedAt','crudPermissions','omit','UserProfileSection','each','autoAssociation','sectionId','Resources','UserProfileResource','update','describe','addSections','sequelize','userProfileId','push','removeSections','ids','getSections','enabled','includes','subsections','Dashboard','forEach','resourceId','Plugin','addResources','transaction','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','hasOwnProperty','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x4c66,0x13e));var _0x64c6=function(_0x60a248,_0x558b95){_0x60a248=_0x60a248-0x0;var _0x1458bf=_0x4c66[_0x60a248];return _0x1458bf;};'use strict';var emlformat=require(_0x64c6('0x0'));var rimraf=require(_0x64c6('0x1'));var zipdir=require(_0x64c6('0x2'));var jsonpatch=require(_0x64c6('0x3'));var rp=require(_0x64c6('0x4'));var moment=require(_0x64c6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x64c6('0x6'));var util=require(_0x64c6('0x7'));var path=require(_0x64c6('0x8'));var sox=require(_0x64c6('0x9'));var csv=require(_0x64c6('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x64c6('0xb'));var _=require(_0x64c6('0xc'));var squel=require(_0x64c6('0xd'));var crypto=require(_0x64c6('0xe'));var jsforce=require(_0x64c6('0xf'));var deskjs=require(_0x64c6('0x10'));var toCsv=require(_0x64c6('0xa'));var querystring=require(_0x64c6('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x64c6('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x64c6('0x13'));var hardwareService=require(_0x64c6('0x14'));var logger=require(_0x64c6('0x15'))(_0x64c6('0x16'));var utils=require(_0x64c6('0x17'));var config=require(_0x64c6('0x18'));var licenseUtil=require(_0x64c6('0x19'));var db=require(_0x64c6('0x1a'))['db'];config[_0x64c6('0x1b')]=_[_0x64c6('0x1c')](config[_0x64c6('0x1b')],{'host':_0x64c6('0x1d'),'port':0x18eb});var socket=require(_0x64c6('0x1e'))(new Redis(config['redis']));require(_0x64c6('0x1f'))['register'](socket);function respondWithStatusCode(_0x45aa68,_0x3aac57){_0x3aac57=_0x3aac57||0xcc;return function(_0x4e443a){if(_0x4e443a){return _0x45aa68[_0x64c6('0x20')](_0x3aac57);}return _0x45aa68[_0x64c6('0x21')](_0x3aac57)[_0x64c6('0x22')]();};}function respondWithResult(_0x4eac6c,_0x680120){_0x680120=_0x680120||0xc8;return function(_0x5484ff){if(_0x5484ff){return _0x4eac6c['status'](_0x680120)[_0x64c6('0x23')](_0x5484ff);}};}function respondWithFilteredResult(_0x939c16,_0x46d35e){return function(_0xe09de9){if(_0xe09de9){var _0x14e5d8=typeof _0x46d35e[_0x64c6('0x24')]===_0x64c6('0x25')&&typeof _0x46d35e[_0x64c6('0x26')]===_0x64c6('0x25');var _0x2d7ad9=_0xe09de9[_0x64c6('0x27')];var _0x5c267d=_0x14e5d8?0x0:_0x46d35e[_0x64c6('0x24')];var _0x54847a=_0x14e5d8?_0xe09de9[_0x64c6('0x27')]:_0x46d35e['offset']+_0x46d35e[_0x64c6('0x26')];var _0x437429;if(_0x54847a>=_0x2d7ad9){_0x54847a=_0x2d7ad9;_0x437429=0xc8;}else{_0x437429=0xce;}_0x939c16[_0x64c6('0x21')](_0x437429);return _0x939c16[_0x64c6('0x28')](_0x64c6('0x29'),_0x5c267d+'-'+_0x54847a+'/'+_0x2d7ad9)[_0x64c6('0x23')](_0xe09de9);}return null;};}function patchUpdates(_0x29a5f6){return function(_0xd0fb2d){try{jsonpatch[_0x64c6('0x2a')](_0xd0fb2d,_0x29a5f6,!![]);}catch(_0x54e790){return BPromise[_0x64c6('0x2b')](_0x54e790);}return _0xd0fb2d[_0x64c6('0x2c')]();};}function saveUpdates(_0x7dca4b,_0x5f3f2b){return function(_0x55be8c){if(_0x55be8c){return _0x55be8c['update'](_0x7dca4b)[_0x64c6('0x2d')](function(_0x291efb){return _0x291efb;});}return null;};}function removeEntity(_0x4485a6,_0x43aeff){return function(_0xf17dff){if(_0xf17dff){return _0xf17dff[_0x64c6('0x2e')]()[_0x64c6('0x2d')](function(){_0x4485a6['status'](0xcc)[_0x64c6('0x22')]();});}};}function handleEntityNotFound(_0x4a0bc1,_0x49d11a){return function(_0xd4c7bf){if(!_0xd4c7bf){_0x4a0bc1[_0x64c6('0x20')](0x194);}return _0xd4c7bf;};}function handleError(_0x2e5dac,_0x383520){_0x383520=_0x383520||0x1f4;return function(_0x3237bf){logger[_0x64c6('0x2f')](_0x3237bf[_0x64c6('0x30')]);if(_0x3237bf[_0x64c6('0x31')]){delete _0x3237bf[_0x64c6('0x31')];}_0x2e5dac[_0x64c6('0x21')](_0x383520)[_0x64c6('0x32')](_0x3237bf);};}exports[_0x64c6('0x33')]=function(_0x22e788,_0x5522ad){var _0x2c3d9c={},_0x2e0050={},_0x3ebefe={'count':0x0,'rows':[]};var _0x218908=_[_0x64c6('0x34')](db[_0x64c6('0x35')][_0x64c6('0x36')],function(_0x45b2d2){return{'name':_0x45b2d2['fieldName'],'type':_0x45b2d2['type'][_0x64c6('0x37')]};});_0x2e0050['model']=_[_0x64c6('0x34')](_0x218908,_0x64c6('0x31'));_0x2e0050[_0x64c6('0x38')]=_[_0x64c6('0x39')](_0x22e788[_0x64c6('0x38')]);_0x2e0050[_0x64c6('0x3a')]=_[_0x64c6('0x3b')](_0x2e0050[_0x64c6('0x3c')],_0x2e0050[_0x64c6('0x38')]);_0x2c3d9c[_0x64c6('0x3d')]=_[_0x64c6('0x3b')](_0x2e0050[_0x64c6('0x3c')],qs[_0x64c6('0x3e')](_0x22e788['query'][_0x64c6('0x3e')]));_0x2c3d9c[_0x64c6('0x3d')]=_0x2c3d9c[_0x64c6('0x3d')]['length']?_0x2c3d9c[_0x64c6('0x3d')]:_0x2e0050[_0x64c6('0x3c')];if(!_0x22e788[_0x64c6('0x38')]['hasOwnProperty'](_0x64c6('0x3f'))){_0x2c3d9c['limit']=qs[_0x64c6('0x26')](_0x22e788[_0x64c6('0x38')][_0x64c6('0x26')]);_0x2c3d9c['offset']=qs['offset'](_0x22e788[_0x64c6('0x38')][_0x64c6('0x24')]);}_0x2c3d9c[_0x64c6('0x40')]=qs[_0x64c6('0x41')](_0x22e788[_0x64c6('0x38')][_0x64c6('0x41')]);_0x2c3d9c[_0x64c6('0x42')]=qs['filters'](_[_0x64c6('0x43')](_0x22e788[_0x64c6('0x38')],_0x2e0050[_0x64c6('0x3a')]),_0x218908);if(_0x22e788['query'][_0x64c6('0x44')]){_0x2c3d9c[_0x64c6('0x42')]=_[_0x64c6('0x45')](_0x2c3d9c['where'],{'$or':_[_0x64c6('0x34')](_0x218908,function(_0x36c107){if(_0x36c107[_0x64c6('0x46')]!==_0x64c6('0x47')){var _0x6827da={};_0x6827da[_0x36c107['name']]={'$like':'%'+_0x22e788[_0x64c6('0x38')][_0x64c6('0x44')]+'%'};return _0x6827da;}})});}_0x2c3d9c=_[_0x64c6('0x45')]({},_0x2c3d9c,_0x22e788[_0x64c6('0x48')]);var _0x17184f={'where':_0x2c3d9c[_0x64c6('0x42')]};return db[_0x64c6('0x35')]['count'](_0x17184f)[_0x64c6('0x2d')](function(_0x2b5a6b){_0x3ebefe['count']=_0x2b5a6b;if(_0x22e788[_0x64c6('0x38')][_0x64c6('0x49')]){_0x2c3d9c[_0x64c6('0x4a')]=[{'all':!![]}];}return db['UserProfile'][_0x64c6('0x4b')](_0x2c3d9c);})[_0x64c6('0x2d')](function(_0x54f389){_0x3ebefe[_0x64c6('0x4c')]=_0x54f389;return _0x3ebefe;})['then'](respondWithFilteredResult(_0x5522ad,_0x2c3d9c))[_0x64c6('0x4d')](handleError(_0x5522ad,null));};exports[_0x64c6('0x4e')]=function(_0xdeacf7,_0x5e4465){var _0x242562={'raw':![],'where':{'id':_0xdeacf7[_0x64c6('0x4f')]['id']}},_0x2e6301={};_0x2e6301[_0x64c6('0x3c')]=_['keys'](db[_0x64c6('0x35')][_0x64c6('0x36')]);_0x2e6301[_0x64c6('0x38')]=_['keys'](_0xdeacf7[_0x64c6('0x38')]);_0x2e6301[_0x64c6('0x3a')]=_[_0x64c6('0x3b')](_0x2e6301[_0x64c6('0x3c')],_0x2e6301[_0x64c6('0x38')]);_0x242562[_0x64c6('0x3d')]=_[_0x64c6('0x3b')](_0x2e6301[_0x64c6('0x3c')],qs[_0x64c6('0x3e')](_0xdeacf7['query'][_0x64c6('0x3e')]));_0x242562[_0x64c6('0x3d')]=_0x242562[_0x64c6('0x3d')]['length']?_0x242562[_0x64c6('0x3d')]:_0x2e6301['model'];if(_0xdeacf7[_0x64c6('0x38')][_0x64c6('0x49')]){_0x242562['include']=[{'all':!![]}];}_0x242562=_[_0x64c6('0x45')]({},_0x242562,_0xdeacf7[_0x64c6('0x48')]);return db[_0x64c6('0x35')][_0x64c6('0x50')](_0x242562)[_0x64c6('0x2d')](handleEntityNotFound(_0x5e4465,null))['then'](respondWithResult(_0x5e4465,null))[_0x64c6('0x4d')](handleError(_0x5e4465,null));};exports[_0x64c6('0x51')]=function(_0x2a2611,_0x4bbaed){return db[_0x64c6('0x35')]['create'](_0x2a2611[_0x64c6('0x52')],{})['then'](respondWithResult(_0x4bbaed,0xc9))[_0x64c6('0x4d')](handleError(_0x4bbaed,null));};exports[_0x64c6('0x53')]=function(_0x3058fc,_0x7cbf31){var _0x1b47ba={'where':{'id':_0x3058fc['params']['id']}},_0x4fed48={};_0x4fed48[_0x64c6('0x3c')]=_[_0x64c6('0x39')](db[_0x64c6('0x35')][_0x64c6('0x36')]);_0x1b47ba[_0x64c6('0x3d')]=_['intersection'](_0x4fed48[_0x64c6('0x3c')],qs['fields'](_0x3058fc[_0x64c6('0x38')][_0x64c6('0x3e')]));_0x1b47ba['attributes']=_0x1b47ba[_0x64c6('0x3d')][_0x64c6('0x54')]?_0x1b47ba[_0x64c6('0x3d')]:_0x4fed48[_0x64c6('0x3c')];if(_0x3058fc[_0x64c6('0x38')][_0x64c6('0x49')]){_0x1b47ba[_0x64c6('0x4a')]=[{'all':!![]}];}_0x1b47ba=_['merge']({},_0x1b47ba,_0x3058fc[_0x64c6('0x48')]);return db['UserProfile'][_0x64c6('0x50')](_0x1b47ba)[_0x64c6('0x2d')](handleEntityNotFound(_0x7cbf31,null))['then'](function(_0x84d6f){if(_0x84d6f){var _0x10a386=_0x84d6f[_0x64c6('0x55')]({'plain':!![]});_0x10a386=qs['omit'](_0x10a386,['id',_0x64c6('0x56'),_0x64c6('0x57'),_0x64c6('0x58')]);_0x3058fc[_0x64c6('0x52')]=_[_0x64c6('0x59')](_0x3058fc[_0x64c6('0x52')],['id','createdAt','updatedAt']);return db['sequelize']['transaction'](function(_0xf65b13){return db[_0x64c6('0x35')][_0x64c6('0x51')](_['merge'](_0x10a386,_0x3058fc[_0x64c6('0x52')]),{'include':_0x3058fc[_0x64c6('0x38')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0xf65b13})[_0x64c6('0x2d')](function(_0x23aa56){var _0x3abd74=_0x23aa56['get']({'plain':!![]});return db[_0x64c6('0x5a')][_0x64c6('0x4b')]({'where':{'userProfileId':_0x3058fc['params']['id']},'raw':!![]})['then'](function(_0x2154d5){if(_0x2154d5){return BPromise[_0x64c6('0x5b')](_0x2154d5,function(_0x35ce84){return new BPromise(function(_0x329b39,_0x2670e5){if(_0x35ce84['autoAssociation']===null||_0x35ce84[_0x64c6('0x5c')]===0x1)_0x329b39(null);return db['UserProfileResource'][_0x64c6('0x4b')]({'where':{'sectionId':_0x35ce84['id']},'raw':!![]})['then'](function(_0x5635fc){var _0xe62152=_[_0x64c6('0x34')](_0x5635fc,function(_0x354908){return qs[_0x64c6('0x59')](_0x354908,['id',_0x64c6('0x56'),_0x64c6('0x57'),_0x64c6('0x5d')]);});_0x329b39(_0xe62152);})[_0x64c6('0x4d')](function(_0x31fcec){_0x2670e5(_0x31fcec);});})[_0x64c6('0x2d')](function(_0x4e06ae){var _0x4127a6=qs[_0x64c6('0x59')](_0x35ce84,['id',_0x64c6('0x56'),_0x64c6('0x57')]);_0x4127a6['userProfileId']=_0x3abd74['id'];if(_0x4e06ae)_0x4127a6[_0x64c6('0x5e')]=_0x4e06ae;return _0x4127a6;})['then'](function(_0x1f792f){return db[_0x64c6('0x5a')][_0x64c6('0x51')](_0x1f792f,{'include':[{'model':db[_0x64c6('0x5f')],'as':_0x64c6('0x5e')}],'raw':!![],'transaction':_0xf65b13});});})[_0x64c6('0x2d')](function(){return _0x3abd74;});}});});});}})[_0x64c6('0x2d')](respondWithResult(_0x7cbf31,0xc9))[_0x64c6('0x4d')](handleError(_0x7cbf31,null));};exports[_0x64c6('0x60')]=function(_0x5c73b7,_0x27de4f){if(_0x5c73b7[_0x64c6('0x52')]['id']){delete _0x5c73b7['body']['id'];}return db[_0x64c6('0x35')][_0x64c6('0x50')]({'where':{'id':_0x5c73b7[_0x64c6('0x4f')]['id']}})['then'](handleEntityNotFound(_0x27de4f,null))['then'](saveUpdates(_0x5c73b7[_0x64c6('0x52')],null))[_0x64c6('0x2d')](respondWithResult(_0x27de4f,null))[_0x64c6('0x4d')](handleError(_0x27de4f,null));};exports[_0x64c6('0x2e')]=function(_0x31e763,_0x5655a6){return db[_0x64c6('0x35')][_0x64c6('0x50')]({'where':{'id':_0x31e763['params']['id']}})['then'](handleEntityNotFound(_0x5655a6,null))['then'](removeEntity(_0x5655a6,null))['catch'](handleError(_0x5655a6,null));};exports[_0x64c6('0x61')]=function(_0x5a792f,_0xde7e00){return db['UserProfile'][_0x64c6('0x61')]()['then'](respondWithResult(_0xde7e00,null))['catch'](handleError(_0xde7e00,null));};exports[_0x64c6('0x62')]=function(_0xa44676,_0x2249e0){var _0x233182=_0xa44676['body'];return db['UserProfile'][_0x64c6('0x50')]({'where':{'id':_0xa44676[_0x64c6('0x4f')]['id']}})[_0x64c6('0x2d')](handleEntityNotFound(_0x2249e0,null))[_0x64c6('0x2d')](function(_0x519fcd){if(_0x519fcd){return db[_0x64c6('0x63')]['transaction'](function(_0x420a68){return db[_0x64c6('0x5a')]['destroy']({'where':{'userProfileId':_0xa44676[_0x64c6('0x4f')]['id'],'sectionId':_[_0x64c6('0x34')](_0x233182,function(_0x595a60){return _0x595a60[_0x64c6('0x5d')];})},'transaction':_0x420a68})[_0x64c6('0x2d')](function(){var _0x45cfd2=_[_0x64c6('0x34')](_0x233182,function(_0x59ae0a){_0x59ae0a[_0x64c6('0x64')]=_0xa44676[_0x64c6('0x4f')]['id'];return _0x59ae0a;});var _0x53a026=[];return BPromise[_0x64c6('0x5b')](_0x45cfd2,function(_0xb41bbd){return db[_0x64c6('0x5a')]['create'](_0xb41bbd,{'include':[{'model':db['UserProfileResource'],'as':_0x64c6('0x5e')}],'raw':!![],'transaction':_0x420a68})[_0x64c6('0x2d')](function(_0x369216){_0x53a026[_0x64c6('0x65')](_0x369216['get']({'plain':!![]}));});})[_0x64c6('0x2d')](function(){return _0x53a026;});});});}})['then'](function(_0x2164a2){return _0x2164a2;})['then'](respondWithResult(_0x2249e0,null))['catch'](handleError(_0x2249e0,null));};exports[_0x64c6('0x66')]=function(_0x382682,_0x3cc4a3){var _0x234ce3;return db[_0x64c6('0x35')][_0x64c6('0x50')]({'where':{'id':_0x382682['params']['id']},'attributes':['id',_0x64c6('0x31')]})['then'](handleEntityNotFound(_0x3cc4a3,null))[_0x64c6('0x2d')](function(_0x55967d){if(_0x55967d){_0x234ce3=_0x55967d;return db[_0x64c6('0x5a')]['destroy']({'where':{'userProfileId':_0x382682[_0x64c6('0x4f')]['id'],'sectionId':_0x382682['query'][_0x64c6('0x67')]}});}})[_0x64c6('0x2d')](function(){return _0x234ce3;})['then'](respondWithStatusCode(_0x3cc4a3,null))[_0x64c6('0x4d')](handleError(_0x3cc4a3,null));};exports[_0x64c6('0x68')]=function(_0x163e12,_0x359a41){var _0x3263c4=[];var _0xf3e757=[];return db[_0x64c6('0x5a')][_0x64c6('0x4b')]({'where':{'userProfileId':_0x163e12[_0x64c6('0x4f')]['id']},'raw':!![]})[_0x64c6('0x2d')](function(_0x4631e5){_0x3263c4=_[_0x64c6('0x44')](_0x4631e5,function(_0x446e35){return _0x446e35[_0x64c6('0x69')]===0x1||_[_0x64c6('0x6a')]([0x3eb,0x709],_0x446e35[_0x64c6('0x5d')]);});if(!_['isEmpty'](_0x3263c4)){return _[_0x64c6('0x34')](_0x3263c4,function(_0x3a55c1){return _0x3a55c1[_0x64c6('0x5d')];});}else{return;}})[_0x64c6('0x2d')](function(_0x1d2e80){if(_0x1d2e80)_0xf3e757=_0x1d2e80;if(_[_0x64c6('0x6a')](_0xf3e757,0x64)){var _0x2a7a89=_['find'](_0x3263c4,{'sectionId':0x64});return hasDefaultDashboard(_0x2a7a89)[_0x64c6('0x2d')](function(_0x3d6a83){return _[_0x64c6('0x34')](_0x3263c4,function(_0xd1c1b5){if(_0xd1c1b5[_0x64c6('0x5d')]===0x64){_0xd1c1b5['subsections']=_0x3d6a83;}return _0xd1c1b5;});});}else{return;}})[_0x64c6('0x2d')](function(_0x261a51){if(_0x261a51)_0x3263c4=_0x261a51;if(_[_0x64c6('0x6a')](_0xf3e757,0x3eb)){var _0x35fe74=_[_0x64c6('0x50')](_0x3263c4,{'sectionId':0x3eb});return getCustomDashboards(_0x35fe74)[_0x64c6('0x2d')](function(_0x482419){return _[_0x64c6('0x34')](_0x3263c4,function(_0x29ca89){if(_0x35fe74[_0x64c6('0x69')]){if(_0x29ca89['sectionId']===0x3eb){_0x29ca89[_0x64c6('0x6b')]=_0x482419;}}else{if(_0x29ca89['sectionId']===0x64){if(!_0x29ca89['subsections']){_0x29ca89[_0x64c6('0x6b')]=[];}_0x29ca89[_0x64c6('0x6b')]=_0x29ca89[_0x64c6('0x6b')]['concat'](_0x482419);}}return _0x29ca89;});});}else{return;}})[_0x64c6('0x2d')](function(_0xe364bc){if(_0xe364bc)_0x3263c4=_0xe364bc;if(_[_0x64c6('0x6a')](_0xf3e757,0x709)){var _0x16b5f6=_[_0x64c6('0x50')](_0x3263c4,{'sectionId':0x709});return getPlugins(_0x16b5f6)['then'](function(_0x199d4b){if(_0x16b5f6[_0x64c6('0x69')]){return _[_0x64c6('0x34')](_0x3263c4,function(_0x2782fd){if(_0x2782fd['sectionId']===0x709){_0x2782fd[_0x64c6('0x6b')]=_0x199d4b;}return _0x2782fd;});}else{var _0x1673c0={'sectionId':0x76c,'enabled':0x1,'subsections':_0x199d4b};var _0x396421=_[_0x64c6('0x34')](_0x3263c4);_0x396421[_0x64c6('0x65')](_0x1673c0);return _0x396421;}});}else{return;}})[_0x64c6('0x2d')](function(_0x1d66b0){if(_0x1d66b0)_0x3263c4=_0x1d66b0;return _[_0x64c6('0x44')](_0x3263c4,['enabled',0x1]);})[_0x64c6('0x2d')](respondWithResult(_0x359a41,null))[_0x64c6('0x4d')](handleError(_0x359a41,null));};function hasDefaultDashboard(_0x3d1fa7){var _0x5cde01=[0x65];return new BPromise(function(_0x3354ed,_0x1cf0fe){try{if(_0x3d1fa7[_0x64c6('0x5c')]){_0x3354ed(_0x5cde01);}else{return db[_0x64c6('0x5f')]['findOne']({'where':{'sectionId':_0x3d1fa7['id']},'raw':!![]})[_0x64c6('0x2d')](function(_0x475730){_0x475730?_0x3354ed(_0x5cde01):_0x3354ed();});}}catch(_0x2a4a0d){_0x1cf0fe(_0x2a4a0d);}});}function getCustomDashboards(_0x14cd29){var _0x188c56=[];return new BPromise(function(_0x26766f,_0x4f12fc){try{if(_0x14cd29['autoAssociation']){return db[_0x64c6('0x6c')][_0x64c6('0x4b')]({'raw':!![]})[_0x64c6('0x2d')](function(_0x52cc23){_0x52cc23[_0x64c6('0x6d')](function(_0x1be712){_0x188c56[_0x64c6('0x65')](_0x1be712['id']+0x1869f);});_0x26766f(_0x188c56);});}else{return db[_0x64c6('0x5f')][_0x64c6('0x4b')]({'where':{'sectionId':_0x14cd29['id']},'raw':!![]})[_0x64c6('0x2d')](function(_0xaf6647){_0xaf6647[_0x64c6('0x6d')](function(_0x1e5b79){_0x188c56[_0x64c6('0x65')](_0x1e5b79[_0x64c6('0x6e')]+0x1869f);});_0x26766f(_0x188c56);});}}catch(_0x14885f){_0x4f12fc(_0x14885f);}});}function getPlugins(_0x3e75ee){var _0x44650a=[];return new BPromise(function(_0x169ac0,_0x345016){try{if(_0x3e75ee[_0x64c6('0x5c')]){return db[_0x64c6('0x6f')][_0x64c6('0x4b')]({'raw':!![]})[_0x64c6('0x2d')](function(_0x30ee99){_0x30ee99[_0x64c6('0x6d')](function(_0x40a84f){_0x44650a['push'](_0x40a84f['id']+0x15b38);});_0x169ac0(_0x44650a);});}else{return db['UserProfileResource'][_0x64c6('0x4b')]({'where':{'sectionId':_0x3e75ee['id']},'raw':!![]})[_0x64c6('0x2d')](function(_0x32332f){_0x32332f['forEach'](function(_0xe8eaff){_0x44650a['push'](_0xe8eaff['resourceId']+0x15b38);});_0x169ac0(_0x44650a);});}}catch(_0x160977){_0x345016(_0x160977);}});}exports[_0x64c6('0x70')]=function(_0x595a6e,_0x309ad9){return db['UserProfile'][_0x64c6('0x50')]({'where':{'id':_0x595a6e[_0x64c6('0x4f')]['id']}})[_0x64c6('0x2d')](handleEntityNotFound(_0x309ad9,null))[_0x64c6('0x2d')](function(_0x58e281){if(_0x58e281){return db[_0x64c6('0x63')][_0x64c6('0x71')](function(_0x2bbfcf){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x595a6e['params']['id']},'attributes':['id'],'raw':!![]})[_0x64c6('0x2d')](function(_0x107bc7){if(_0x107bc7){return db[_0x64c6('0x5a')][_0x64c6('0x2e')]({'where':{'userProfileId':_0x595a6e[_0x64c6('0x4f')]['id'],'id':_[_0x64c6('0x34')](_0x107bc7,function(_0x2a53f2){return _0x2a53f2['id'];})},'transaction':_0x2bbfcf});}})['then'](function(_0x57d160){var _0xf67f1d=_[_0x64c6('0x34')](_0x595a6e[_0x64c6('0x52')],function(_0x20bb45){_0x20bb45['userProfileId']=_0x595a6e[_0x64c6('0x4f')]['id'];return _0x20bb45;});return db['UserProfileSection'][_0x64c6('0x72')](_0xf67f1d,{'raw':!![],'transaction':_0x2bbfcf});})[_0x64c6('0x2d')](function(_0x44b37a){var _0x47629c=_[_0x64c6('0x44')](_[_0x64c6('0x34')](_0x44b37a,function(_0x5c6e00){return _0x5c6e00['get']({'plain':!![]});}),{'includeAll':![]});if(_0x47629c){return db[_0x64c6('0x5a')]['findAll']({'where':{'userProfileId':_0x595a6e[_0x64c6('0x4f')]['id'],'sectionId':_[_0x64c6('0x34')](_0x47629c,function(_0x18b017){return _0x18b017['sectionId'];})},'attributes':['id',_0x64c6('0x5d')],'raw':!![]})[_0x64c6('0x2d')](function(_0x29f442){var _0x14c035=_[_0x64c6('0x34')](_0x595a6e[_0x64c6('0x52')],function(_0x4a677c){_0x4a677c['userProfileId']=_0x595a6e[_0x64c6('0x4f')]['id'];return _0x4a677c;});return db[_0x64c6('0x5f')]['bulkCreate'](_0x14c035,{'raw':!![],'transaction':_0x2bbfcf});});}})[_0x64c6('0x4d')](handleError(_0x309ad9,null));});}})[_0x64c6('0x2d')](function(_0x9ddc57){var _0x235c50=_[_0x64c6('0x34')](_0x9ddc57,function(_0x3fd43f){return _0x3fd43f[_0x64c6('0x55')]({'plain':!![]});});})[_0x64c6('0x2d')](respondWithResult(_0x309ad9,null))[_0x64c6('0x4d')](handleError(_0x309ad9,null));};exports[_0x64c6('0x73')]=function(_0x4210ae,_0xef07eb,_0x26d755){return db['UserProfile'][_0x64c6('0x50')]({'where':{'id':_0x4210ae[_0x64c6('0x4f')]['id']}})[_0x64c6('0x2d')](handleEntityNotFound(_0xef07eb,null))['then'](function(_0x4ee5b2){if(_0x4ee5b2){return _0x4ee5b2[_0x64c6('0x73')](_0x4210ae[_0x64c6('0x38')][_0x64c6('0x67')]);}})['then'](respondWithStatusCode(_0xef07eb,null))[_0x64c6('0x4d')](handleError(_0xef07eb,null));};exports[_0x64c6('0x74')]=function(_0x1ee1f9,_0x167ef9){var _0x40e604={};if(!_0x1ee1f9[_0x64c6('0x38')][_0x64c6('0x75')])throw new Error(_0x64c6('0x76'));if(!_0x1ee1f9['query'][_0x64c6('0x77')]('nolimit')){_0x40e604['limit']=qs[_0x64c6('0x26')](_0x1ee1f9['query'][_0x64c6('0x26')]);_0x40e604['offset']=qs[_0x64c6('0x24')](_0x1ee1f9[_0x64c6('0x38')][_0x64c6('0x24')]);}return db[_0x64c6('0x35')][_0x64c6('0x50')]({'where':{'id':_0x1ee1f9['params']['id']}})[_0x64c6('0x2d')](function(_0x19c06c){if(!_0x19c06c)throw new Error(_0x64c6('0x78')+_0x1ee1f9[_0x64c6('0x4f')]['id']);return db['UserProfile'][_0x64c6('0x74')](_0x1ee1f9);})[_0x64c6('0x2d')](respondWithFilteredResult(_0x167ef9,_0x40e604))[_0x64c6('0x4d')](handleError(_0x167ef9,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 2e44a77..eccb173 100644 --- a/server/api/userProfile/userProfile.events.js +++ b/server/api/userProfile/userProfile.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc14a=['UserProfile','setMaxListeners','save','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x2e0617,_0x198eb4){var _0x56d26f=function(_0x33a288){while(--_0x33a288){_0x2e0617['push'](_0x2e0617['shift']());}};_0x56d26f(++_0x198eb4);}(_0xc14a,0xa9));var _0xac14=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xc14a[_0x3b380d];return _0x54502b;};'use strict';var EventEmitter=require(_0xac14('0x0'));var UserProfile=require(_0xac14('0x1'))['db'][_0xac14('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xac14('0x3')](0x0);var events={'afterCreate':_0xac14('0x4'),'afterUpdate':'update','afterDestroy':_0xac14('0x5')};function emitEvent(_0x21c4da){return function(_0x53f3d1,_0x412485,_0x525320){UserProfileEvents[_0xac14('0x6')](_0x21c4da+':'+_0x53f3d1['id'],_0x53f3d1);UserProfileEvents[_0xac14('0x6')](_0x21c4da,_0x53f3d1);_0x525320(null);};}for(var e in events){if(events[_0xac14('0x7')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0xac14('0x8')]=UserProfileEvents; \ No newline at end of file +var _0x187d=['save','update','remove','emit','hasOwnProperty','hook','exports','events','UserProfile','setMaxListeners'];(function(_0x51de59,_0x1b2d82){var _0x100f25=function(_0x18c171){while(--_0x18c171){_0x51de59['push'](_0x51de59['shift']());}};_0x100f25(++_0x1b2d82);}(_0x187d,0x93));var _0xd187=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0x187d[_0xbe200f];return _0x192597;};'use strict';var EventEmitter=require(_0xd187('0x0'));var UserProfile=require('../../mysqldb')['db'][_0xd187('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xd187('0x2')](0x0);var events={'afterCreate':_0xd187('0x3'),'afterUpdate':_0xd187('0x4'),'afterDestroy':_0xd187('0x5')};function emitEvent(_0x201b79){return function(_0x58622a,_0x28fa0b,_0x163807){UserProfileEvents['emit'](_0x201b79+':'+_0x58622a['id'],_0x58622a);UserProfileEvents[_0xd187('0x6')](_0x201b79,_0x58622a);_0x163807(null);};}for(var e in events){if(events[_0xd187('0x7')](e)){var event=events[e];UserProfile[_0xd187('0x8')](e,emitEvent(event));}}module[_0xd187('0x9')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index aa284f1..86da39f 100644 --- a/server/api/userProfile/userProfile.model.js +++ b/server/api/userProfile/userProfile.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x952e=['reportType','default','reportId','DefaultReports','custom','count','rows','ids','customSorting','order','extraQueryConditions','CmContact','Tags','ThroughTags','color','tag','openTabs','true','chat','dataValues','sms','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','squel','models','filter','field','value','findAll','then','associatedResources','map','catch','name','resolve','AnalyticExtractedReport','type','resourceId','toLowerCase','squareprojects','SquareProject','childModel','SquareOdbc','squarerecordings','SquareRecording','parentSections','projectName','projects','JscriptyProject','contacts','Lists','ListId','CmList','companies','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','VoiceContext','voicemails','voicerecordings','VoiceRecording','membername','agent','telephone','VoiceQueues','VoiceQueue','inbound','QueueCampaigns','queue','outbound','chanspies','VoiceChanSpy','VoicePrefix','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','users','agents','telephones','User','Users','role','admin','user','Telephones','zendeskaccounts','salesforceaccounts','SalesforceAccount','FreshdeskAccount','sugarcrmaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','customdashboards','Dashboard','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','tags','Tag','Template','triggers','Trigger','Trunk','variables','Variable','plugins','Plugin','Reports','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','../../components/parsers/qs','raw','section','mergeResources','Invalid\x20section\x20\x27','length','push','find','params','all','ignore','isEmpty','autoAssociation','model','rawAttributes','keys','filters','intersection','attributes','fields','nolimit','limit','offset','sort','VIRTUAL','foreignKey','merge','options','includeAll','include','forEach'];(function(_0x5cb3d6,_0x15c259){var _0x99da4=function(_0x57b15a){while(--_0x57b15a){_0x5cb3d6['push'](_0x5cb3d6['shift']());}};_0x99da4(++_0x15c259);}(_0x952e,0xde));var _0xe952=function(_0x41b263,_0x31cb88){_0x41b263=_0x41b263-0x0;var _0x513e3d=_0x952e[_0x41b263];return _0x513e3d;};'use strict';var _=require(_0xe952('0x0'));var attributes=require(_0xe952('0x1'));var squel=require(_0xe952('0x2'));module['exports']=function(_0x2ef07d){var _0x58eadc=_0x2ef07d[_0xe952('0x3')];function _0x4b70fc(_0x27aae8,_0x360a56){return new Promise(function(_0x33f157,_0x10d025){if(!_0x360a56)return _0x33f157(null);var _0x353627=_0x360a56[_0xe952('0x4')]?{[_0x360a56['filter'][_0xe952('0x5')]]:_0x360a56[_0xe952('0x4')][_0xe952('0x6')]}:undefined;return _0x58eadc[_0x27aae8][_0xe952('0x7')]({'where':_0x353627,'raw':!![]})[_0xe952('0x8')](function(_0x1bc199){_0x360a56[_0xe952('0x9')]=_[_0xe952('0xa')](_0x1bc199,'id');_0x33f157(_0x360a56);})[_0xe952('0xb')](function(_0x24bf69){_0x10d025(_0x24bf69);});});}function _0x14f0e0(_0x19cb81,_0x2afebe){return new Promise(function(_0xb091d6,_0x45a6ee){var _0x4a08c7=_0x19cb81['filter']?{[_0x19cb81[_0xe952('0x4')]['field']]:_0x19cb81[_0xe952('0x4')][_0xe952('0x6')]}:undefined;return _0x58eadc[_0x19cb81['model']][_0xe952('0x7')]({'where':_0x4a08c7,'raw':!![]})[_0xe952('0x8')](function(_0x30b48a){_0x2afebe[_0xe952('0x9')]=_[_0xe952('0xa')](_0x30b48a,function(_0x3a539d){return _0x3a539d[_0xe952('0xc')];});_0xb091d6(_0x2afebe);})[_0xe952('0xb')](function(_0x3da225){_0x45a6ee(_0x3da225);});});}function _0x3a91d1(_0x3d52f9,_0x37fce6,_0x66cebe){if(!_0x37fce6)return Promise[_0xe952('0xd')](null);return new Promise(function(_0x41f631,_0x13e4d9){return _0x58eadc['UserProfileResource']['findAll']({'where':{'sectionId':_0x37fce6['id']},'raw':!![]})[_0xe952('0x8')](function(_0x598e54){if(_0x3d52f9['field']&&_0x3d52f9['field']!=='id'){_0x37fce6['associatedResources']=_[_0xe952('0xa')](_0x598e54,function(_0x527fc4){return _0x527fc4[_0x3d52f9[_0xe952('0x5')]];});}else{if(_0x66cebe===_0xe952('0xe')){_0x37fce6[_0xe952('0x9')]=_[_0xe952('0xa')](_0x598e54,function(_0xae79f5){return{'id':_0xae79f5['resourceId'],'type':_0xae79f5[_0xe952('0xf')]};});}else{_0x37fce6['associatedResources']=_[_0xe952('0xa')](_0x598e54,function(_0x447bf1){return _0x447bf1[_0xe952('0x10')];});}}_0x41f631(_0x37fce6);})[_0xe952('0xb')](function(_0x32b7c0){_0x13e4d9(_0x32b7c0);});});}function _0x43a39f(_0x51dce1,_0x395e5b){var _0x3d3519={'parentSections':[]};switch(_0x51dce1[_0xe952('0x11')]()){case _0xe952('0x12'):_0x3d3519['childModel']=_0xe952('0x13');break;case'odbc':_0x3d3519[_0xe952('0x14')]=_0xe952('0x15');break;case _0xe952('0x16'):_0x3d3519['childModel']=_0xe952('0x17');_0x3d3519[_0xe952('0x18')]=[{'name':'SquareProjects','field':_0xe952('0xc'),'foreignKey':_0xe952('0x19')}];break;case _0xe952('0x1a'):_0x3d3519['childModel']=_0xe952('0x1b');break;case _0xe952('0x1c'):_0x3d3519[_0xe952('0x14')]='CmContact';_0x3d3519[_0xe952('0x18')]=[{'name':_0xe952('0x1d'),'field':'id','foreignKey':_0xe952('0x1e')}];break;case'lists':_0x3d3519[_0xe952('0x14')]=_0xe952('0x1f');break;case _0xe952('0x20'):_0x3d3519[_0xe952('0x14')]='CmCompany';break;case'globalcustomfields':_0x3d3519[_0xe952('0x14')]=_0xe952('0x21');break;case _0xe952('0x22'):_0x3d3519['childModel']=_0xe952('0x23');break;case _0xe952('0x24'):_0x3d3519[_0xe952('0x14')]=_0xe952('0x25');break;case'faxqueues':_0x3d3519[_0xe952('0x14')]=_0xe952('0x26');break;case _0xe952('0x27'):_0x3d3519['childModel']=_0xe952('0x28');break;case _0xe952('0x29'):case _0xe952('0x2a'):case _0xe952('0x2b'):_0x3d3519[_0xe952('0x14')]=_0xe952('0x2c');break;case'contexts':_0x3d3519[_0xe952('0x14')]=_0xe952('0x2d');break;case _0xe952('0x2e'):_0x3d3519['childModel']='VoiceMail';break;case _0xe952('0x2f'):_0x3d3519['childModel']=_0xe952('0x30');_0x3d3519[_0xe952('0x18')]=[{'name':'Agents','field':'name','foreignKey':_0xe952('0x31'),'model':'User','filter':{'field':'role','value':[_0xe952('0x32')]}},{'name':'Telephones','field':_0xe952('0xc'),'foreignKey':_0xe952('0x31'),'model':'User','filter':{'field':'role','value':[_0xe952('0x33')]}},{'name':_0xe952('0x34'),'field':_0xe952('0xc'),'foreignKey':'queue','model':_0xe952('0x35'),'filter':{'field':_0xe952('0xf'),'value':[_0xe952('0x36')]}},{'name':_0xe952('0x37'),'field':_0xe952('0xc'),'foreignKey':_0xe952('0x38'),'model':'VoiceQueue','filter':{'field':_0xe952('0xf'),'value':[_0xe952('0x39')]}}];break;case'musiconholds':_0x3d3519['childModel']='VoiceMusicOnHold';break;case _0xe952('0x3a'):_0x3d3519[_0xe952('0x14')]=_0xe952('0x3b');break;case'voiceprefixes':_0x3d3519['childModel']=_0xe952('0x3c');break;case'ivrcampaigns':_0x3d3519[_0xe952('0x14')]='Campaign';break;case _0xe952('0x3d'):_0x3d3519[_0xe952('0x14')]=_0xe952('0x3e');break;case _0xe952('0x3f'):_0x3d3519['childModel']=_0xe952('0x40');break;case _0xe952('0x41'):_0x3d3519['childModel']='MailSubstatus';break;case _0xe952('0x42'):_0x3d3519[_0xe952('0x14')]=_0xe952('0x43');break;case _0xe952('0x44'):_0x3d3519[_0xe952('0x14')]=_0xe952('0x45');break;case _0xe952('0x46'):_0x3d3519['childModel']='SmsQueue';break;case'smsaccounts':_0x3d3519[_0xe952('0x14')]=_0xe952('0x47');break;case _0xe952('0x48'):_0x3d3519['childModel']=_0xe952('0x49');break;case _0xe952('0x4a'):_0x3d3519[_0xe952('0x14')]=_0xe952('0x4b');break;case _0xe952('0x4c'):_0x3d3519[_0xe952('0x14')]=_0xe952('0x4d');break;case _0xe952('0x4e'):case _0xe952('0x4f'):_0x3d3519[_0xe952('0x14')]=_0xe952('0x35');if(_0x395e5b){_0x3d3519[_0xe952('0x18')]=[{'name':_0xe952('0x34')},{'name':_0xe952('0x37')}];}break;case _0xe952('0x50'):case _0xe952('0x51'):case _0xe952('0x52'):_0x3d3519[_0xe952('0x14')]=_0xe952('0x53');if(_0x395e5b){_0x3d3519[_0xe952('0x18')]=[{'name':_0xe952('0x54'),'filter':{'field':_0xe952('0x55'),'value':[_0xe952('0x56'),_0xe952('0x57')]},'ignore':!![]},{'name':'Agents'},{'name':_0xe952('0x58')}];}break;case _0xe952('0x59'):_0x3d3519['childModel']='ZendeskAccount';break;case _0xe952('0x5a'):_0x3d3519[_0xe952('0x14')]=_0xe952('0x5b');break;case'freshdeskaccounts':_0x3d3519[_0xe952('0x14')]=_0xe952('0x5c');break;case _0xe952('0x5d'):_0x3d3519[_0xe952('0x14')]='SugarcrmAccount';break;case'deskaccounts':_0x3d3519[_0xe952('0x14')]=_0xe952('0x5e');break;case _0xe952('0x5f'):_0x3d3519[_0xe952('0x14')]=_0xe952('0x60');break;case _0xe952('0x61'):_0x3d3519[_0xe952('0x14')]='User';break;case _0xe952('0x62'):_0x3d3519[_0xe952('0x14')]=_0xe952('0x63');break;case'dispositions':_0x3d3519[_0xe952('0x14')]='Disposition';break;case _0xe952('0x64'):_0x3d3519[_0xe952('0x14')]=_0xe952('0x65');break;case'intervals':_0x3d3519[_0xe952('0x14')]=_0xe952('0x66');break;case _0xe952('0x67'):_0x3d3519[_0xe952('0x14')]=_0xe952('0x68');break;case _0xe952('0x69'):_0x3d3519[_0xe952('0x14')]=_0xe952('0x6a');break;case _0xe952('0x6b'):_0x3d3519[_0xe952('0x14')]=_0xe952('0x6c');break;case _0xe952('0x6d'):_0x3d3519[_0xe952('0x14')]=_0xe952('0x6e');break;case'templates':_0x3d3519[_0xe952('0x14')]=_0xe952('0x6f');break;case _0xe952('0x70'):_0x3d3519[_0xe952('0x14')]=_0xe952('0x71');break;case'trunks':_0x3d3519[_0xe952('0x14')]=_0xe952('0x72');break;case _0xe952('0x73'):_0x3d3519[_0xe952('0x14')]=_0xe952('0x74');break;case _0xe952('0x75'):_0x3d3519[_0xe952('0x14')]=_0xe952('0x76');break;case'extractedreports':_0x3d3519[_0xe952('0x14')]='AnalyticExtractedReport';_0x3d3519[_0xe952('0x18')]=[{'name':_0xe952('0x77'),'field':'id','foreignKey':'reportId'}];break;case _0xe952('0x78'):_0x3d3519[_0xe952('0x14')]=_0xe952('0x79');break;}return _0x3d3519;}function _0x27aab7(_0x431902,_0x2de8e6){var _0x78d172=_0x431902[_0xe952('0x7a')](0x0)[_0xe952('0x7b')]()+_0x431902[_0xe952('0x7c')](0x1);var _0x33242f={'type':_0x58eadc[_0xe952('0x7d')][_0xe952('0x7e')][_0xe952('0x7f')],'raw':!![]};return new Promise(function(_0x19b475,_0x3edcc8){var _0x39c77d=squel['select']()[_0xe952('0x5')](_0xe952('0x80')+_0x78d172+_0xe952('0x81'),'id')[_0xe952('0x5')](_0xe952('0x82'))[_0xe952('0x83')](_0xe952('0x84')+_0x431902+_0xe952('0x85'),'ui')[_0xe952('0x86')](_0xe952('0x87'),_0x2de8e6['id']);return _0x58eadc[_0xe952('0x88')][_0xe952('0x89')](_0x39c77d[_0xe952('0x8a')](),_0x33242f)[_0xe952('0x8')](function(_0xd1f538){_0x2de8e6[_0x78d172+_0xe952('0x8b')]=_0xd1f538;_0x19b475(_0xd1f538);})[_0xe952('0xb')](function(_0x13129e){_0x3edcc8(_0x13129e);});});}return _0x2ef07d[_0xe952('0x8c')]('UserProfile',attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x400c32){var _0x3e96e6=require(_0xe952('0x8d'));var _0xc06dd9={'raw':_0x400c32['query'][_0xe952('0x8e')],'where':{}};var _0x1bf1b3={};var _0x4b3bff={'count':0x0,'rows':[]};var _0x47a644=_0x400c32[_0xe952('0x89')][_0xe952('0x8f')];var _0x5810a0=_0x400c32[_0xe952('0x89')][_0xe952('0x90')]||![];var _0x23c7fd=_0x43a39f(_0x47a644,_0x5810a0);if(!_0x23c7fd[_0xe952('0x14')])throw new Error(_0xe952('0x91')+_0x47a644+'\x27');var _0x5ce519=[{'name':_0x47a644}];if(!_['isEmpty'](_0x23c7fd[_0xe952('0x18')]))_0x5ce519=_0x23c7fd[_0xe952('0x18')];var _0x89b11a=[];for(var _0x5eb002=0x0;_0x5eb002<_0x5ce519[_0xe952('0x92')];_0x5eb002++){_0x89b11a[_0xe952('0x93')](_0x58eadc['UserProfileSection'][_0xe952('0x94')]({'where':{'userProfileId':_0x400c32[_0xe952('0x95')]['id'],'name':_0x5ce519[_0x5eb002][_0xe952('0xc')]},'raw':!![]}));}return Promise[_0xe952('0x96')](_0x89b11a)[_0xe952('0x8')](function(_0x2aaacc){var _0x2fb8f2=_['filter'](_0x2aaacc,function(_0x37bd53){return _0x37bd53?_0x37bd53:undefined;});var _0x266ec3=_[_0xe952('0x4')](_0x5ce519,[_0xe952('0x97'),!![]]);var _0x1ff686=_[_0xe952('0x98')](_0x2fb8f2)&&_[_0xe952('0x98')](_0x266ec3)?null:_['union'](_0x266ec3,_0x2fb8f2);if(!_0x1ff686)return null;var _0x3787ae=[];for(var _0x337b7e=0x0;_0x337b7e<_0x1ff686[_0xe952('0x92')];_0x337b7e++){var _0x5152ce=_[_0xe952('0x94')](_0x5ce519,function(_0x2d26ee){return _0x1ff686[_0x337b7e]?_0x2d26ee['name']===_0x1ff686[_0x337b7e]['name']:null;});if(_0x5152ce){if(_0x1ff686[_0x337b7e][_0xe952('0x97')]){_0x3787ae[_0xe952('0x93')](_0x4b70fc(_0x23c7fd[_0xe952('0x14')],_0x1ff686[_0x337b7e]));}else{if(!_0x1ff686[_0x337b7e][_0xe952('0x99')]){_0x3787ae[_0xe952('0x93')](_0x3a91d1(_0x5152ce,_0x1ff686[_0x337b7e],_0x23c7fd[_0xe952('0x14')]));}else{if(_0x5152ce[_0xe952('0x9a')]){_0x3787ae['push'](_0x14f0e0(_0x5152ce,_0x1ff686[_0x337b7e]));}}}}}return Promise[_0xe952('0x96')](_0x3787ae);})[_0xe952('0x8')](function(_0x2b8a41){var _0x2b9523=_0x2b8a41;var _0xdc5853=null;if(_0x2b9523){_0xdc5853=_0x2b9523[_0xe952('0x92')]===0x1?_0x2b9523[0x0]:null;}if(!_0xdc5853&&!_0x2b9523)return _0x4b3bff;var _0x5b0e2f=_0x58eadc[_0x23c7fd[_0xe952('0x14')]][_0xe952('0x9b')];_0x1bf1b3[_0xe952('0x9a')]=_[_0xe952('0x9c')](_0x5b0e2f);_0x1bf1b3['query']=_[_0xe952('0x9c')](_0x400c32[_0xe952('0x89')]);_0x1bf1b3[_0xe952('0x9d')]=_[_0xe952('0x9e')](_0x1bf1b3[_0xe952('0x9a')],_0x1bf1b3[_0xe952('0x89')]);_0xc06dd9[_0xe952('0x9f')]=_['intersection'](_0x1bf1b3[_0xe952('0x9a')],_0x3e96e6[_0xe952('0xa0')](_0x400c32[_0xe952('0x89')][_0xe952('0xa0')]));_0xc06dd9['attributes']=_0xc06dd9[_0xe952('0x9f')][_0xe952('0x92')]?_0xc06dd9[_0xe952('0x9f')]:_0x1bf1b3[_0xe952('0x9a')];if(!_0x400c32[_0xe952('0x89')]['hasOwnProperty'](_0xe952('0xa1'))){_0xc06dd9[_0xe952('0xa2')]=_0x3e96e6[_0xe952('0xa2')](_0x400c32['query']['limit']);_0xc06dd9[_0xe952('0xa3')]=_0x3e96e6['offset'](_0x400c32[_0xe952('0x89')][_0xe952('0xa3')]);}_0xc06dd9['order']=_0x3e96e6[_0xe952('0xa4')](_0x400c32[_0xe952('0x89')]['sort']);_0xc06dd9[_0xe952('0x86')]=_0x3e96e6[_0xe952('0x9d')](_['pick'](_0x400c32[_0xe952('0x89')],_0x1bf1b3[_0xe952('0x9d')]));if(_0x400c32[_0xe952('0x89')][_0xe952('0x4')]){_0xc06dd9[_0xe952('0x86')]=_['merge'](_0xc06dd9[_0xe952('0x86')],{'$or':_['map'](_0x5b0e2f,function(_0x1c84dc){if(_0x1c84dc[_0xe952('0xf')]['key']!==_0xe952('0xa5')){var _0x48c552={};_0x48c552[_0x1c84dc[_0xe952('0x5')]]={'$like':'%'+_0x400c32[_0xe952('0x89')][_0xe952('0x4')]+'%'};return _0x48c552;}})});}var _0x3a6313=[];var _0x5aa98f=null;var _0x4dddbd={};if(_0xdc5853){_0x5aa98f=_[_0xe952('0x94')](_0x5ce519,[_0xe952('0xc'),_0xdc5853[_0xe952('0xc')]]);if(_0x5aa98f[_0xe952('0x5')]){_0x4dddbd={};if(_0x23c7fd[_0xe952('0x14')]==='AnalyticExtractedReport'){_0x4dddbd[_0x5aa98f['foreignKey']]=_[_0xe952('0xa')](_0xdc5853[_0xe952('0x9')],'id');}else{_0x4dddbd[_0x5aa98f[_0xe952('0xa6')]]=_0xdc5853[_0xe952('0x9')];}_0x3a6313[_0xe952('0x93')](_0x4dddbd);}else{_0xc06dd9['where']['id']=_0xdc5853[_0xe952('0x9')];}}else{for(var _0x52af95=0x0;_0x52af95<_0x2b9523[_0xe952('0x92')];_0x52af95++){_0x5aa98f=_[_0xe952('0x94')](_0x5ce519,['name',_0x2b9523[_0x52af95][_0xe952('0xc')]]);if(_0x5aa98f['field']){_0x4dddbd={};_0x4dddbd[_0x5aa98f[_0xe952('0xa6')]]=_0x2b9523[_0x52af95][_0xe952('0x9')];_0x3a6313['push'](_0x4dddbd);}else{if(!_0xc06dd9[_0xe952('0x86')]['id'])_0xc06dd9[_0xe952('0x86')]['id']=[];_0x2b9523[_0x52af95][_0xe952('0x9')]['forEach'](function(_0x4fe868){_0xc06dd9[_0xe952('0x86')]['id']['push'](_0x4fe868);});}}}if(!_[_0xe952('0x98')](_0x3a6313)){_0xc06dd9['where']=_[_0xe952('0xa7')](_0xc06dd9[_0xe952('0x86')],{'$and':{'$or':_0x3a6313}});}_0xc06dd9=_[_0xe952('0xa7')]({},_0xc06dd9,_0x400c32[_0xe952('0xa8')]);if(_0xdc5853&&!_0xdc5853[_0xe952('0x99')]&&_0x23c7fd[_0xe952('0x14')]===_0xe952('0xe')){if(_0x400c32['query'][_0xe952('0xa9')]){_0xc06dd9[_0xe952('0xaa')]=[{'all':!![]}];}return _0x58eadc[_0x23c7fd[_0xe952('0x14')]][_0xe952('0x7')](_0xc06dd9)['then'](function(_0x1e1daa){var _0x34ee72=[];_0x1e1daa[_0xe952('0xab')](function(_0x435b19){var _0x3af90d;switch(_0x435b19[_0xe952('0xac')]){case _0xe952('0xad'):_0x3af90d=_['find'](_0xdc5853[_0xe952('0x9')],function(_0x135074){return _0x135074['id']===_0x435b19[_0xe952('0xae')]&&_0x135074[_0xe952('0xf')]===_0xe952('0xaf');});break;case _0xe952('0xb0'):_0x3af90d=_[_0xe952('0x94')](_0xdc5853[_0xe952('0x9')],function(_0x5c636b){return _0x5c636b['id']===_0x435b19[_0xe952('0xae')]&&_0x5c636b['type']==='CustomReports';});break;}if(_0x3af90d)_0x34ee72[_0xe952('0x93')](_0x435b19);});_0x4b3bff[_0xe952('0xb1')]=_0x34ee72['length'];_0x4b3bff[_0xe952('0xb2')]=_0x34ee72;return _0x4b3bff;});}else{if(!_[_0xe952('0x98')](_0x400c32[_0xe952('0x89')][_0xe952('0xb3')])){_0xc06dd9[_0xe952('0x86')]['id']=_0xc06dd9[_0xe952('0x86')]['id']?_[_0xe952('0x9e')](_0xc06dd9['where']['id'],_0x400c32[_0xe952('0x89')]['ids']):_0x400c32[_0xe952('0x89')][_0xe952('0xb3')];if(_0x400c32[_0xe952('0x89')][_0xe952('0xb4')]){_0xc06dd9[_0xe952('0xb5')]=_0x400c32['query'][_0xe952('0xb4')];}}if(_0x400c32[_0xe952('0x89')][_0xe952('0xb6')]){_0xc06dd9[_0xe952('0x86')]=_[_0xe952('0xa7')](_0xc06dd9[_0xe952('0x86')],{'$and':_0x400c32['query'][_0xe952('0xb6')]});}return _0x58eadc[_0x23c7fd[_0xe952('0x14')]]['count']({'where':_0xc06dd9[_0xe952('0x86')]})['then'](function(_0x1b1843){_0x4b3bff[_0xe952('0xb1')]=_0x1b1843;if(_0x400c32['query']['includeAll']){if(_0x23c7fd[_0xe952('0x14')]===_0xe952('0xb7')){_0xc06dd9[_0xe952('0xaa')]=[{'model':_0x58eadc[_0xe952('0x6e')],'as':_0xe952('0xb8'),'attributes':['id',_0xe952('0xc'),'color'],'required':_0x400c32[_0xe952('0x89')]['tag']?!![]:![]},{'model':_0x58eadc[_0xe952('0x6e')],'as':_0xe952('0xb9'),'attributes':['id',_0xe952('0xc'),_0xe952('0xba')],'through':_0x400c32['query'][_0xe952('0xbb')]?{'attributes':[],'where':{'TagId':_0x400c32['query'][_0xe952('0xbb')]||undefined}}:{},'required':_0x400c32[_0xe952('0x89')][_0xe952('0xbb')]?!![]:![]}];}else{_0xc06dd9[_0xe952('0xaa')]=[{'all':!![]}];}}return _0x58eadc[_0x23c7fd[_0xe952('0x14')]][_0xe952('0x7')](_0xc06dd9);})[_0xe952('0x8')](function(_0x32a8c3){_0x4b3bff['rows']=_0x32a8c3;if(_0x47a644==='Agents'&&_0x400c32['query'][_0xe952('0xbc')]===_0xe952('0xbd')){var _0x845681=[];for(var _0x4ad854=0x0;_0x4ad854<_0x4b3bff[_0xe952('0xb2')][_0xe952('0x92')];_0x4ad854++){_0x845681[_0xe952('0x93')](_0x27aab7(_0xe952('0xbe'),_0x4b3bff[_0xe952('0xb2')][_0x4ad854][_0xe952('0xbf')]));_0x845681['push'](_0x27aab7(_0xe952('0xc0'),_0x4b3bff[_0xe952('0xb2')][_0x4ad854]['dataValues']));_0x845681['push'](_0x27aab7(_0xe952('0xc1'),_0x4b3bff[_0xe952('0xb2')][_0x4ad854]['dataValues']));_0x845681[_0xe952('0x93')](_0x27aab7(_0xe952('0xc2'),_0x4b3bff[_0xe952('0xb2')][_0x4ad854][_0xe952('0xbf')]));_0x845681['push'](_0x27aab7(_0xe952('0xc3'),_0x4b3bff[_0xe952('0xb2')][_0x4ad854][_0xe952('0xbf')]));_0x845681[_0xe952('0x93')](_0x27aab7(_0xe952('0xc4'),_0x4b3bff['rows'][_0x4ad854][_0xe952('0xbf')]));}return Promise[_0xe952('0x96')](_0x845681)['then'](function(){return _0x4b3bff;});}return _0x4b3bff;});}});}}});}; \ No newline at end of file +var _0xf1c0=['Sequelize','QueryTypes','SELECT','select','ui.createdAt','from','user_has_','_interactions','sequelize','UserProfile','user_profiles','query','mergeResources','Invalid\x20section\x20\x27','length','push','UserProfileSection','find','params','all','isEmpty','union','ignore','autoAssociation','rawAttributes','keys','filters','attributes','intersection','fields','nolimit','limit','offset','order','where','pick','key','VIRTUAL','foreignKey','forEach','merge','options','reportType','default','DefaultReports','custom','CustomReports','rows','ids','customSorting','extraQueryConditions','count','include','Tags','color','tag','ThroughTags','openTabs','true','chat','sms','dataValues','fax','openchannel','whatsapp','lodash','./userProfile.attributes','squel','exports','models','field','filter','value','associatedResources','map','catch','model','findAll','then','resolve','AnalyticExtractedReport','resourceId','toLowerCase','squareprojects','childModel','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','contacts','CmContact','ListId','lists','companies','CmCompany','globalcustomfields','CmCustomField','ChatQueue','chatwebsites','ChatWebsite','FaxQueue','inboundroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','name','membername','User','role','agent','Telephones','telephone','VoiceQueues','QueueCampaigns','queue','VoiceQueue','type','outbound','musiconholds','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','SmsQueue','smsaccounts','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','users','agents','telephones','admin','user','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','scheduler','Schedule','sounds','Sound','Tag','templates','Template','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','Plugin','extractedreports','Reports','reportId','AnalyticMetric','charAt','toUpperCase','slice'];(function(_0x4b8fc7,_0x5022fc){var _0x249f4a=function(_0x1b25d4){while(--_0x1b25d4){_0x4b8fc7['push'](_0x4b8fc7['shift']());}};_0x249f4a(++_0x5022fc);}(_0xf1c0,0x1c9));var _0x0f1c=function(_0x5b38b2,_0x186865){_0x5b38b2=_0x5b38b2-0x0;var _0xe27bb1=_0xf1c0[_0x5b38b2];return _0xe27bb1;};'use strict';var _=require(_0x0f1c('0x0'));var attributes=require(_0x0f1c('0x1'));var squel=require(_0x0f1c('0x2'));module[_0x0f1c('0x3')]=function(_0x16e277){var _0x543cca=_0x16e277[_0x0f1c('0x4')];function _0xaa898c(_0x36f908,_0x43610c){return new Promise(function(_0x3cedd8,_0x21d07e){if(!_0x43610c)return _0x3cedd8(null);var _0x367322=_0x43610c['filter']?{[_0x43610c['filter'][_0x0f1c('0x5')]]:_0x43610c[_0x0f1c('0x6')][_0x0f1c('0x7')]}:undefined;return _0x543cca[_0x36f908]['findAll']({'where':_0x367322,'raw':!![]})['then'](function(_0x3ca19c){_0x43610c[_0x0f1c('0x8')]=_[_0x0f1c('0x9')](_0x3ca19c,'id');_0x3cedd8(_0x43610c);})[_0x0f1c('0xa')](function(_0x390387){_0x21d07e(_0x390387);});});}function _0x3d7d8d(_0x3709c2,_0x35ba20){return new Promise(function(_0x4e5a7d,_0x3a50b3){var _0x6f8e6=_0x3709c2[_0x0f1c('0x6')]?{[_0x3709c2[_0x0f1c('0x6')][_0x0f1c('0x5')]]:_0x3709c2[_0x0f1c('0x6')][_0x0f1c('0x7')]}:undefined;return _0x543cca[_0x3709c2[_0x0f1c('0xb')]][_0x0f1c('0xc')]({'where':_0x6f8e6,'raw':!![]})[_0x0f1c('0xd')](function(_0x55d1ae){_0x35ba20[_0x0f1c('0x8')]=_['map'](_0x55d1ae,function(_0x55debb){return _0x55debb['name'];});_0x4e5a7d(_0x35ba20);})[_0x0f1c('0xa')](function(_0x4ecb6c){_0x3a50b3(_0x4ecb6c);});});}function _0x3b7b63(_0x127b78,_0x563106,_0x6702d8){if(!_0x563106)return Promise[_0x0f1c('0xe')](null);return new Promise(function(_0x367715,_0x126154){return _0x543cca['UserProfileResource'][_0x0f1c('0xc')]({'where':{'sectionId':_0x563106['id']},'raw':!![]})['then'](function(_0x27cbdc){if(_0x127b78[_0x0f1c('0x5')]&&_0x127b78[_0x0f1c('0x5')]!=='id'){_0x563106['associatedResources']=_[_0x0f1c('0x9')](_0x27cbdc,function(_0xf9aff7){return _0xf9aff7[_0x127b78[_0x0f1c('0x5')]];});}else{if(_0x6702d8===_0x0f1c('0xf')){_0x563106[_0x0f1c('0x8')]=_[_0x0f1c('0x9')](_0x27cbdc,function(_0x29ab63){return{'id':_0x29ab63[_0x0f1c('0x10')],'type':_0x29ab63['type']};});}else{_0x563106[_0x0f1c('0x8')]=_[_0x0f1c('0x9')](_0x27cbdc,function(_0x1bb24b){return _0x1bb24b[_0x0f1c('0x10')];});}}_0x367715(_0x563106);})[_0x0f1c('0xa')](function(_0xd4eee3){_0x126154(_0xd4eee3);});});}function _0x357be4(_0x147abc,_0x1f9575){var _0x36279a={'parentSections':[]};switch(_0x147abc[_0x0f1c('0x11')]()){case _0x0f1c('0x12'):_0x36279a[_0x0f1c('0x13')]='SquareProject';break;case'odbc':_0x36279a[_0x0f1c('0x13')]=_0x0f1c('0x14');break;case _0x0f1c('0x15'):_0x36279a[_0x0f1c('0x13')]=_0x0f1c('0x16');_0x36279a[_0x0f1c('0x17')]=[{'name':_0x0f1c('0x18'),'field':'name','foreignKey':_0x0f1c('0x19')}];break;case _0x0f1c('0x1a'):_0x36279a[_0x0f1c('0x13')]='JscriptyProject';break;case _0x0f1c('0x1b'):_0x36279a[_0x0f1c('0x13')]=_0x0f1c('0x1c');_0x36279a[_0x0f1c('0x17')]=[{'name':'Lists','field':'id','foreignKey':_0x0f1c('0x1d')}];break;case _0x0f1c('0x1e'):_0x36279a['childModel']='CmList';break;case _0x0f1c('0x1f'):_0x36279a['childModel']=_0x0f1c('0x20');break;case _0x0f1c('0x21'):_0x36279a['childModel']=_0x0f1c('0x22');break;case'chatqueues':_0x36279a[_0x0f1c('0x13')]=_0x0f1c('0x23');break;case _0x0f1c('0x24'):_0x36279a[_0x0f1c('0x13')]=_0x0f1c('0x25');break;case'faxqueues':_0x36279a[_0x0f1c('0x13')]=_0x0f1c('0x26');break;case'faxaccounts':_0x36279a[_0x0f1c('0x13')]='FaxAccount';break;case _0x0f1c('0x27'):case'internalroutes':case _0x0f1c('0x28'):_0x36279a[_0x0f1c('0x13')]=_0x0f1c('0x29');break;case _0x0f1c('0x2a'):_0x36279a[_0x0f1c('0x13')]=_0x0f1c('0x2b');break;case _0x0f1c('0x2c'):_0x36279a[_0x0f1c('0x13')]=_0x0f1c('0x2d');break;case _0x0f1c('0x2e'):_0x36279a[_0x0f1c('0x13')]=_0x0f1c('0x2f');_0x36279a[_0x0f1c('0x17')]=[{'name':_0x0f1c('0x30'),'field':_0x0f1c('0x31'),'foreignKey':_0x0f1c('0x32'),'model':_0x0f1c('0x33'),'filter':{'field':_0x0f1c('0x34'),'value':[_0x0f1c('0x35')]}},{'name':_0x0f1c('0x36'),'field':_0x0f1c('0x31'),'foreignKey':'membername','model':_0x0f1c('0x33'),'filter':{'field':'role','value':[_0x0f1c('0x37')]}},{'name':_0x0f1c('0x38'),'field':_0x0f1c('0x31'),'foreignKey':'queue','model':'VoiceQueue','filter':{'field':'type','value':['inbound']}},{'name':_0x0f1c('0x39'),'field':'name','foreignKey':_0x0f1c('0x3a'),'model':_0x0f1c('0x3b'),'filter':{'field':_0x0f1c('0x3c'),'value':[_0x0f1c('0x3d')]}}];break;case _0x0f1c('0x3e'):_0x36279a[_0x0f1c('0x13')]='VoiceMusicOnHold';break;case _0x0f1c('0x3f'):_0x36279a[_0x0f1c('0x13')]=_0x0f1c('0x40');break;case _0x0f1c('0x41'):_0x36279a['childModel']=_0x0f1c('0x42');break;case _0x0f1c('0x43'):_0x36279a[_0x0f1c('0x13')]=_0x0f1c('0x44');break;case _0x0f1c('0x45'):_0x36279a[_0x0f1c('0x13')]=_0x0f1c('0x46');break;case _0x0f1c('0x47'):_0x36279a['childModel']=_0x0f1c('0x48');break;case'mailsubstatuses':_0x36279a[_0x0f1c('0x13')]=_0x0f1c('0x49');break;case _0x0f1c('0x4a'):_0x36279a['childModel']=_0x0f1c('0x4b');break;case _0x0f1c('0x4c'):_0x36279a[_0x0f1c('0x13')]='OpenchannelAccount';break;case'smsqueues':_0x36279a[_0x0f1c('0x13')]=_0x0f1c('0x4d');break;case _0x0f1c('0x4e'):_0x36279a[_0x0f1c('0x13')]='SmsAccount';break;case'whatsappqueues':_0x36279a[_0x0f1c('0x13')]=_0x0f1c('0x4f');break;case _0x0f1c('0x50'):_0x36279a[_0x0f1c('0x13')]=_0x0f1c('0x51');break;case _0x0f1c('0x52'):_0x36279a['childModel']=_0x0f1c('0x53');break;case _0x0f1c('0x54'):case'queuecampaigns':_0x36279a[_0x0f1c('0x13')]=_0x0f1c('0x3b');if(_0x1f9575){_0x36279a[_0x0f1c('0x17')]=[{'name':_0x0f1c('0x38')},{'name':_0x0f1c('0x39')}];}break;case _0x0f1c('0x55'):case _0x0f1c('0x56'):case _0x0f1c('0x57'):_0x36279a['childModel']='User';if(_0x1f9575){_0x36279a[_0x0f1c('0x17')]=[{'name':'Users','filter':{'field':_0x0f1c('0x34'),'value':[_0x0f1c('0x58'),_0x0f1c('0x59')]},'ignore':!![]},{'name':_0x0f1c('0x30')},{'name':_0x0f1c('0x36')}];}break;case'zendeskaccounts':_0x36279a['childModel']=_0x0f1c('0x5a');break;case _0x0f1c('0x5b'):_0x36279a[_0x0f1c('0x13')]=_0x0f1c('0x5c');break;case _0x0f1c('0x5d'):_0x36279a[_0x0f1c('0x13')]=_0x0f1c('0x5e');break;case _0x0f1c('0x5f'):_0x36279a['childModel']=_0x0f1c('0x60');break;case _0x0f1c('0x61'):_0x36279a[_0x0f1c('0x13')]=_0x0f1c('0x62');break;case'zohoaccounts':_0x36279a[_0x0f1c('0x13')]=_0x0f1c('0x63');break;case'vtigeraccounts':_0x36279a[_0x0f1c('0x13')]=_0x0f1c('0x33');break;case _0x0f1c('0x64'):_0x36279a['childModel']=_0x0f1c('0x65');break;case _0x0f1c('0x66'):_0x36279a[_0x0f1c('0x13')]=_0x0f1c('0x67');break;case _0x0f1c('0x68'):_0x36279a[_0x0f1c('0x13')]=_0x0f1c('0x69');break;case _0x0f1c('0x6a'):_0x36279a[_0x0f1c('0x13')]=_0x0f1c('0x6b');break;case _0x0f1c('0x6c'):_0x36279a[_0x0f1c('0x13')]='Pause';break;case _0x0f1c('0x6d'):_0x36279a[_0x0f1c('0x13')]=_0x0f1c('0x6e');break;case _0x0f1c('0x6f'):_0x36279a[_0x0f1c('0x13')]=_0x0f1c('0x70');break;case'tags':_0x36279a[_0x0f1c('0x13')]=_0x0f1c('0x71');break;case _0x0f1c('0x72'):_0x36279a[_0x0f1c('0x13')]=_0x0f1c('0x73');break;case _0x0f1c('0x74'):_0x36279a['childModel']=_0x0f1c('0x75');break;case _0x0f1c('0x76'):_0x36279a[_0x0f1c('0x13')]=_0x0f1c('0x77');break;case _0x0f1c('0x78'):_0x36279a[_0x0f1c('0x13')]=_0x0f1c('0x79');break;case _0x0f1c('0x7a'):_0x36279a['childModel']=_0x0f1c('0x7b');break;case _0x0f1c('0x7c'):_0x36279a[_0x0f1c('0x13')]='AnalyticExtractedReport';_0x36279a['parentSections']=[{'name':_0x0f1c('0x7d'),'field':'id','foreignKey':_0x0f1c('0x7e')}];break;case'metrics':_0x36279a['childModel']=_0x0f1c('0x7f');break;}return _0x36279a;}function _0x54dcef(_0x5452cb,_0x3dd707){var _0xaafe98=_0x5452cb[_0x0f1c('0x80')](0x0)[_0x0f1c('0x81')]()+_0x5452cb[_0x0f1c('0x82')](0x1);var _0xe1db65={'type':_0x543cca[_0x0f1c('0x83')][_0x0f1c('0x84')][_0x0f1c('0x85')],'raw':!![]};return new Promise(function(_0xe966e7,_0x318484){var _0x2eb4b5=squel[_0x0f1c('0x86')]()[_0x0f1c('0x5')]('ui.'+_0xaafe98+'InteractionId','id')[_0x0f1c('0x5')](_0x0f1c('0x87'))[_0x0f1c('0x88')](_0x0f1c('0x89')+_0x5452cb+_0x0f1c('0x8a'),'ui')['where']('ui.UserId\x20=\x20?',_0x3dd707['id']);return _0x543cca[_0x0f1c('0x8b')]['query'](_0x2eb4b5['toString'](),_0xe1db65)[_0x0f1c('0xd')](function(_0x55b71b){_0x3dd707[_0xaafe98+'OpenTabs']=_0x55b71b;_0xe966e7(_0x55b71b);})[_0x0f1c('0xa')](function(_0x5f088f){_0x318484(_0x5f088f);});});}return _0x16e277['define'](_0x0f1c('0x8c'),attributes,{'tableName':_0x0f1c('0x8d'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x3ed33f){var _0x1afc6b=require('../../components/parsers/qs');var _0x348b24={'raw':_0x3ed33f['query']['raw'],'where':{}};var _0x39fdd5={};var _0x158cfb={'count':0x0,'rows':[]};var _0x10176c=_0x3ed33f[_0x0f1c('0x8e')]['section'];var _0x46de91=_0x3ed33f[_0x0f1c('0x8e')][_0x0f1c('0x8f')]||![];var _0x3bdbce=_0x357be4(_0x10176c,_0x46de91);if(!_0x3bdbce[_0x0f1c('0x13')])throw new Error(_0x0f1c('0x90')+_0x10176c+'\x27');var _0x10ece9=[{'name':_0x10176c}];if(!_['isEmpty'](_0x3bdbce[_0x0f1c('0x17')]))_0x10ece9=_0x3bdbce[_0x0f1c('0x17')];var _0x5e1a98=[];for(var _0x4b59a5=0x0;_0x4b59a5<_0x10ece9[_0x0f1c('0x91')];_0x4b59a5++){_0x5e1a98[_0x0f1c('0x92')](_0x543cca[_0x0f1c('0x93')][_0x0f1c('0x94')]({'where':{'userProfileId':_0x3ed33f[_0x0f1c('0x95')]['id'],'name':_0x10ece9[_0x4b59a5]['name']},'raw':!![]}));}return Promise[_0x0f1c('0x96')](_0x5e1a98)['then'](function(_0x187ee6){var _0x5bb0e7=_[_0x0f1c('0x6')](_0x187ee6,function(_0x1f0669){return _0x1f0669?_0x1f0669:undefined;});var _0x2b9694=_['filter'](_0x10ece9,['ignore',!![]]);var _0x20cd35=_[_0x0f1c('0x97')](_0x5bb0e7)&&_['isEmpty'](_0x2b9694)?null:_[_0x0f1c('0x98')](_0x2b9694,_0x5bb0e7);if(!_0x20cd35)return null;var _0x5030bf=[];for(var _0x35cb30=0x0;_0x35cb30<_0x20cd35[_0x0f1c('0x91')];_0x35cb30++){var _0x7d4a5f=_[_0x0f1c('0x94')](_0x10ece9,function(_0x3f1d37){return _0x20cd35[_0x35cb30]?_0x3f1d37[_0x0f1c('0x31')]===_0x20cd35[_0x35cb30][_0x0f1c('0x31')]:null;});if(_0x7d4a5f){if(_0x20cd35[_0x35cb30][_0x0f1c('0x99')]){_0x5030bf[_0x0f1c('0x92')](_0xaa898c(_0x3bdbce[_0x0f1c('0x13')],_0x20cd35[_0x35cb30]));}else{if(!_0x20cd35[_0x35cb30][_0x0f1c('0x9a')]){_0x5030bf['push'](_0x3b7b63(_0x7d4a5f,_0x20cd35[_0x35cb30],_0x3bdbce[_0x0f1c('0x13')]));}else{if(_0x7d4a5f[_0x0f1c('0xb')]){_0x5030bf[_0x0f1c('0x92')](_0x3d7d8d(_0x7d4a5f,_0x20cd35[_0x35cb30]));}}}}}return Promise[_0x0f1c('0x96')](_0x5030bf);})['then'](function(_0x1f48ed){var _0x5e0efb=_0x1f48ed;var _0x49bd23=null;if(_0x5e0efb){_0x49bd23=_0x5e0efb['length']===0x1?_0x5e0efb[0x0]:null;}if(!_0x49bd23&&!_0x5e0efb)return _0x158cfb;var _0x544acd=_0x543cca[_0x3bdbce[_0x0f1c('0x13')]][_0x0f1c('0x9b')];_0x39fdd5[_0x0f1c('0xb')]=_[_0x0f1c('0x9c')](_0x544acd);_0x39fdd5[_0x0f1c('0x8e')]=_[_0x0f1c('0x9c')](_0x3ed33f[_0x0f1c('0x8e')]);_0x39fdd5[_0x0f1c('0x9d')]=_['intersection'](_0x39fdd5[_0x0f1c('0xb')],_0x39fdd5[_0x0f1c('0x8e')]);_0x348b24[_0x0f1c('0x9e')]=_[_0x0f1c('0x9f')](_0x39fdd5['model'],_0x1afc6b['fields'](_0x3ed33f['query'][_0x0f1c('0xa0')]));_0x348b24['attributes']=_0x348b24[_0x0f1c('0x9e')][_0x0f1c('0x91')]?_0x348b24[_0x0f1c('0x9e')]:_0x39fdd5[_0x0f1c('0xb')];if(!_0x3ed33f[_0x0f1c('0x8e')]['hasOwnProperty'](_0x0f1c('0xa1'))){_0x348b24[_0x0f1c('0xa2')]=_0x1afc6b['limit'](_0x3ed33f[_0x0f1c('0x8e')][_0x0f1c('0xa2')]);_0x348b24['offset']=_0x1afc6b['offset'](_0x3ed33f['query'][_0x0f1c('0xa3')]);}_0x348b24[_0x0f1c('0xa4')]=_0x1afc6b['sort'](_0x3ed33f[_0x0f1c('0x8e')]['sort']);_0x348b24[_0x0f1c('0xa5')]=_0x1afc6b['filters'](_[_0x0f1c('0xa6')](_0x3ed33f[_0x0f1c('0x8e')],_0x39fdd5[_0x0f1c('0x9d')]));if(_0x3ed33f[_0x0f1c('0x8e')][_0x0f1c('0x6')]){_0x348b24[_0x0f1c('0xa5')]=_['merge'](_0x348b24['where'],{'$or':_[_0x0f1c('0x9')](_0x544acd,function(_0x4bef2a){if(_0x4bef2a[_0x0f1c('0x3c')][_0x0f1c('0xa7')]!==_0x0f1c('0xa8')){var _0x26ffe6={};_0x26ffe6[_0x4bef2a['field']]={'$like':'%'+_0x3ed33f[_0x0f1c('0x8e')]['filter']+'%'};return _0x26ffe6;}})});}var _0xe283fb=[];var _0x449728=null;var _0x411f9a={};if(_0x49bd23){_0x449728=_['find'](_0x10ece9,[_0x0f1c('0x31'),_0x49bd23['name']]);if(_0x449728[_0x0f1c('0x5')]){_0x411f9a={};if(_0x3bdbce[_0x0f1c('0x13')]===_0x0f1c('0xf')){_0x411f9a[_0x449728[_0x0f1c('0xa9')]]=_[_0x0f1c('0x9')](_0x49bd23['associatedResources'],'id');}else{_0x411f9a[_0x449728[_0x0f1c('0xa9')]]=_0x49bd23[_0x0f1c('0x8')];}_0xe283fb[_0x0f1c('0x92')](_0x411f9a);}else{_0x348b24[_0x0f1c('0xa5')]['id']=_0x49bd23[_0x0f1c('0x8')];}}else{for(var _0x4c9946=0x0;_0x4c9946<_0x5e0efb[_0x0f1c('0x91')];_0x4c9946++){_0x449728=_['find'](_0x10ece9,['name',_0x5e0efb[_0x4c9946][_0x0f1c('0x31')]]);if(_0x449728[_0x0f1c('0x5')]){_0x411f9a={};_0x411f9a[_0x449728[_0x0f1c('0xa9')]]=_0x5e0efb[_0x4c9946][_0x0f1c('0x8')];_0xe283fb[_0x0f1c('0x92')](_0x411f9a);}else{if(!_0x348b24[_0x0f1c('0xa5')]['id'])_0x348b24[_0x0f1c('0xa5')]['id']=[];_0x5e0efb[_0x4c9946]['associatedResources'][_0x0f1c('0xaa')](function(_0x2d9141){_0x348b24[_0x0f1c('0xa5')]['id'][_0x0f1c('0x92')](_0x2d9141);});}}}if(!_[_0x0f1c('0x97')](_0xe283fb)){_0x348b24[_0x0f1c('0xa5')]=_[_0x0f1c('0xab')](_0x348b24['where'],{'$and':{'$or':_0xe283fb}});}_0x348b24=_[_0x0f1c('0xab')]({},_0x348b24,_0x3ed33f[_0x0f1c('0xac')]);if(_0x49bd23&&!_0x49bd23[_0x0f1c('0x9a')]&&_0x3bdbce[_0x0f1c('0x13')]===_0x0f1c('0xf')){if(_0x3ed33f[_0x0f1c('0x8e')]['includeAll']){_0x348b24['include']=[{'all':!![]}];}return _0x543cca[_0x3bdbce[_0x0f1c('0x13')]][_0x0f1c('0xc')](_0x348b24)[_0x0f1c('0xd')](function(_0x3ae510){var _0x4511bd=[];_0x3ae510[_0x0f1c('0xaa')](function(_0x114744){var _0x5acf88;switch(_0x114744[_0x0f1c('0xad')]){case _0x0f1c('0xae'):_0x5acf88=_['find'](_0x49bd23[_0x0f1c('0x8')],function(_0x59830a){return _0x59830a['id']===_0x114744['reportId']&&_0x59830a[_0x0f1c('0x3c')]===_0x0f1c('0xaf');});break;case _0x0f1c('0xb0'):_0x5acf88=_['find'](_0x49bd23[_0x0f1c('0x8')],function(_0x49f8b8){return _0x49f8b8['id']===_0x114744[_0x0f1c('0x7e')]&&_0x49f8b8[_0x0f1c('0x3c')]===_0x0f1c('0xb1');});break;}if(_0x5acf88)_0x4511bd[_0x0f1c('0x92')](_0x114744);});_0x158cfb['count']=_0x4511bd[_0x0f1c('0x91')];_0x158cfb[_0x0f1c('0xb2')]=_0x4511bd;return _0x158cfb;});}else{if(!_[_0x0f1c('0x97')](_0x3ed33f[_0x0f1c('0x8e')][_0x0f1c('0xb3')])){_0x348b24['where']['id']=_0x348b24[_0x0f1c('0xa5')]['id']?_[_0x0f1c('0x9f')](_0x348b24[_0x0f1c('0xa5')]['id'],_0x3ed33f[_0x0f1c('0x8e')]['ids']):_0x3ed33f['query'][_0x0f1c('0xb3')];if(_0x3ed33f['query'][_0x0f1c('0xb4')]){_0x348b24[_0x0f1c('0xa4')]=_0x3ed33f[_0x0f1c('0x8e')][_0x0f1c('0xb4')];}}if(_0x3ed33f[_0x0f1c('0x8e')][_0x0f1c('0xb5')]){_0x348b24['where']=_[_0x0f1c('0xab')](_0x348b24[_0x0f1c('0xa5')],{'$and':_0x3ed33f[_0x0f1c('0x8e')]['extraQueryConditions']});}return _0x543cca[_0x3bdbce['childModel']][_0x0f1c('0xb6')]({'where':_0x348b24[_0x0f1c('0xa5')]})[_0x0f1c('0xd')](function(_0x55fecf){_0x158cfb[_0x0f1c('0xb6')]=_0x55fecf;if(_0x3ed33f[_0x0f1c('0x8e')]['includeAll']){if(_0x3bdbce[_0x0f1c('0x13')]===_0x0f1c('0x1c')){_0x348b24[_0x0f1c('0xb7')]=[{'model':_0x543cca['Tag'],'as':_0x0f1c('0xb8'),'attributes':['id',_0x0f1c('0x31'),_0x0f1c('0xb9')],'required':_0x3ed33f[_0x0f1c('0x8e')][_0x0f1c('0xba')]?!![]:![]},{'model':_0x543cca['Tag'],'as':_0x0f1c('0xbb'),'attributes':['id',_0x0f1c('0x31'),_0x0f1c('0xb9')],'through':_0x3ed33f[_0x0f1c('0x8e')][_0x0f1c('0xba')]?{'attributes':[],'where':{'TagId':_0x3ed33f[_0x0f1c('0x8e')][_0x0f1c('0xba')]||undefined}}:{},'required':_0x3ed33f['query']['tag']?!![]:![]}];}else{_0x348b24['include']=[{'all':!![]}];}}return _0x543cca[_0x3bdbce[_0x0f1c('0x13')]][_0x0f1c('0xc')](_0x348b24);})['then'](function(_0x4eb60e){_0x158cfb['rows']=_0x4eb60e;if(_0x10176c===_0x0f1c('0x30')&&_0x3ed33f[_0x0f1c('0x8e')][_0x0f1c('0xbc')]===_0x0f1c('0xbd')){var _0x540a5f=[];for(var _0x388906=0x0;_0x388906<_0x158cfb[_0x0f1c('0xb2')][_0x0f1c('0x91')];_0x388906++){_0x540a5f['push'](_0x54dcef(_0x0f1c('0xbe'),_0x158cfb[_0x0f1c('0xb2')][_0x388906]['dataValues']));_0x540a5f[_0x0f1c('0x92')](_0x54dcef(_0x0f1c('0xbf'),_0x158cfb[_0x0f1c('0xb2')][_0x388906][_0x0f1c('0xc0')]));_0x540a5f['push'](_0x54dcef(_0x0f1c('0xc1'),_0x158cfb[_0x0f1c('0xb2')][_0x388906][_0x0f1c('0xc0')]));_0x540a5f[_0x0f1c('0x92')](_0x54dcef('mail',_0x158cfb[_0x0f1c('0xb2')][_0x388906][_0x0f1c('0xc0')]));_0x540a5f[_0x0f1c('0x92')](_0x54dcef(_0x0f1c('0xc2'),_0x158cfb[_0x0f1c('0xb2')][_0x388906]['dataValues']));_0x540a5f[_0x0f1c('0x92')](_0x54dcef(_0x0f1c('0xc3'),_0x158cfb[_0x0f1c('0xb2')][_0x388906][_0x0f1c('0xc0')]));}return Promise[_0x0f1c('0x96')](_0x540a5f)['then'](function(){return _0x158cfb;});}return _0x158cfb;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 137532b..e3685b8 100644 --- a/server/api/userProfile/userProfile.rpc.js +++ b/server/api/userProfile/userProfile.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc14a=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','defaults','redis','localhost','./userProfile.socket','register','request','info','UserProfile,\x20%s,\x20%s','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result'];(function(_0x49bf94,_0x1b48c7){var _0x88831d=function(_0x555f68){while(--_0x555f68){_0x49bf94['push'](_0x49bf94['shift']());}};_0x88831d(++_0x1b48c7);}(_0xc14a,0xa9));var _0xac14=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xc14a[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xac14('0x0'));var util=require(_0xac14('0x1'));var moment=require(_0xac14('0x2'));var BPromise=require(_0xac14('0x3'));var rs=require(_0xac14('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xac14('0x5'))['db'];var utils=require(_0xac14('0x6'));var logger=require('../../config/logger')(_0xac14('0x7'));var config=require('../../config/environment');var jayson=require(_0xac14('0x8'));var client=jayson[_0xac14('0x9')][_0xac14('0xa')]({'port':0x232a});config['redis']=_[_0xac14('0xb')](config[_0xac14('0xc')],{'host':_0xac14('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xac14('0xc')]));require(_0xac14('0xe'))[_0xac14('0xf')](socket);function respondWithRpcPromise(_0x25f266,_0x5b8be6,_0x86118d){return new BPromise(function(_0x540967,_0x85ed98){return client[_0xac14('0x10')](_0x25f266,_0x86118d)['then'](function(_0x517651){logger[_0xac14('0x11')](_0xac14('0x12'),_0x5b8be6,'request\x20sent');logger[_0xac14('0x13')](_0xac14('0x14'),_0x5b8be6,'request\x20sent',JSON[_0xac14('0x15')](_0x517651));if(_0x517651['error']){if(_0x517651[_0xac14('0x16')][_0xac14('0x17')]===0x1f4){logger[_0xac14('0x16')]('UserProfile,\x20%s,\x20%s',_0x5b8be6,_0x517651['error'][_0xac14('0x18')]);return _0x85ed98(_0x517651['error'][_0xac14('0x18')]);}logger['error'](_0xac14('0x12'),_0x5b8be6,_0x517651[_0xac14('0x16')][_0xac14('0x18')]);return _0x540967(_0x517651[_0xac14('0x16')][_0xac14('0x18')]);}else{logger['info'](_0xac14('0x12'),_0x5b8be6,_0xac14('0x19'));_0x540967(_0x517651[_0xac14('0x1a')][_0xac14('0x18')]);}})[_0xac14('0x1b')](function(_0x15fc09){logger[_0xac14('0x16')]('UserProfile,\x20%s,\x20%s',_0x5b8be6,_0x15fc09);_0x85ed98(_0x15fc09);});});} \ No newline at end of file +var _0x3cb7=['http','redis','defaults','localhost','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5cf90e,_0x5df405){var _0xae958d=function(_0x52c27c){while(--_0x52c27c){_0x5cf90e['push'](_0x5cf90e['shift']());}};_0xae958d(++_0x5df405);}(_0x3cb7,0xcf));var _0x73cb=function(_0x444f91,_0x2a61f2){_0x444f91=_0x444f91-0x0;var _0x3248ab=_0x3cb7[_0x444f91];return _0x3248ab;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x73cb('0x0'));var BPromise=require('bluebird');var rs=require(_0x73cb('0x1'));var fs=require('fs');var Redis=require(_0x73cb('0x2'));var db=require(_0x73cb('0x3'))['db'];var utils=require(_0x73cb('0x4'));var logger=require(_0x73cb('0x5'))(_0x73cb('0x6'));var config=require(_0x73cb('0x7'));var jayson=require(_0x73cb('0x8'));var client=jayson['client'][_0x73cb('0x9')]({'port':0x232a});config[_0x73cb('0xa')]=_[_0x73cb('0xb')](config[_0x73cb('0xa')],{'host':_0x73cb('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x73cb('0xa')]));require(_0x73cb('0xd'))[_0x73cb('0xe')](socket);function respondWithRpcPromise(_0x29deae,_0x1826dd,_0xc1a63e){return new BPromise(function(_0x43eab2,_0x501542){return client[_0x73cb('0xf')](_0x29deae,_0xc1a63e)[_0x73cb('0x10')](function(_0x35900e){logger[_0x73cb('0x11')](_0x73cb('0x12'),_0x1826dd,_0x73cb('0x13'));logger['debug'](_0x73cb('0x14'),_0x1826dd,_0x73cb('0x13'),JSON[_0x73cb('0x15')](_0x35900e));if(_0x35900e[_0x73cb('0x16')]){if(_0x35900e[_0x73cb('0x16')][_0x73cb('0x17')]===0x1f4){logger[_0x73cb('0x16')](_0x73cb('0x12'),_0x1826dd,_0x35900e[_0x73cb('0x16')][_0x73cb('0x18')]);return _0x501542(_0x35900e['error']['message']);}logger['error'](_0x73cb('0x12'),_0x1826dd,_0x35900e[_0x73cb('0x16')][_0x73cb('0x18')]);return _0x43eab2(_0x35900e[_0x73cb('0x16')][_0x73cb('0x18')]);}else{logger['info'](_0x73cb('0x12'),_0x1826dd,_0x73cb('0x13'));_0x43eab2(_0x35900e[_0x73cb('0x19')][_0x73cb('0x18')]);}})[_0x73cb('0x1a')](function(_0x28ee3b){logger[_0x73cb('0x16')](_0x73cb('0x12'),_0x1826dd,_0x28ee3b);_0x501542(_0x28ee3b);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index a8290cf..8b4ebee 100644 --- a/server/api/userProfile/userProfile.socket.js +++ b/server/api/userProfile/userProfile.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x57bc=['length','userProfile:','save','remove','emit','register'];(function(_0x262de4,_0x38f4ef){var _0x46d6ec=function(_0x342e66){while(--_0x342e66){_0x262de4['push'](_0x262de4['shift']());}};_0x46d6ec(++_0x38f4ef);}(_0x57bc,0x6e));var _0xc57b=function(_0x364937,_0x550b55){_0x364937=_0x364937-0x0;var _0x1740ea=_0x57bc[_0x364937];return _0x1740ea;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0xc57b('0x0'),_0xc57b('0x1'),'update'];function createListener(_0x16c20c,_0x2dadab){return function(_0x48eb2d){_0x2dadab[_0xc57b('0x2')](_0x16c20c,_0x48eb2d);};}function removeListener(_0x3d5b6c,_0x3e6412){return function(){UserProfileEvents['removeListener'](_0x3d5b6c,_0x3e6412);};}exports[_0xc57b('0x3')]=function(_0x504b01){for(var _0x264155=0x0,_0x10603a=events[_0xc57b('0x4')];_0x264155<_0x10603a;_0x264155++){var _0x25175b=events[_0x264155];var _0x40eff4=createListener(_0xc57b('0x5')+_0x25175b,_0x504b01);UserProfileEvents['on'](_0x25175b,_0x40eff4);}}; \ No newline at end of file +var _0x4f0c=['length','./userProfile.events','remove','emit','removeListener','register'];(function(_0x443dba,_0x4bb020){var _0x3034f1=function(_0x3e5804){while(--_0x3e5804){_0x443dba['push'](_0x443dba['shift']());}};_0x3034f1(++_0x4bb020);}(_0x4f0c,0xe5));var _0xc4f0=function(_0x5293e7,_0x493dc0){_0x5293e7=_0x5293e7-0x0;var _0x15896b=_0x4f0c[_0x5293e7];return _0x15896b;};'use strict';var UserProfileEvents=require(_0xc4f0('0x0'));var events=['save',_0xc4f0('0x1'),'update'];function createListener(_0x5ca04d,_0x5786ca){return function(_0xa4677a){_0x5786ca[_0xc4f0('0x2')](_0x5ca04d,_0xa4677a);};}function removeListener(_0x24c7ef,_0x4a686e){return function(){UserProfileEvents[_0xc4f0('0x3')](_0x24c7ef,_0x4a686e);};}exports[_0xc4f0('0x4')]=function(_0x1c6e5c){for(var _0xa23e76=0x0,_0x5e5d97=events[_0xc4f0('0x5')];_0xa23e76<_0x5e5d97;_0xa23e76++){var _0x30aa0a=events[_0xa23e76];var _0x1a0619=createListener('userProfile:'+_0x30aa0a,_0x1c6e5c);UserProfileEvents['on'](_0x30aa0a,_0x1a0619);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 065c3c2..55527a8 100644 --- a/server/api/userProfileResource/index.js +++ b/server/api/userProfileResource/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb395=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/describe','/:id','update','delete','destroy','exports','multer'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xb395,0x71));var _0x5b39=function(_0x50203e,_0x547524){_0x50203e=_0x50203e-0x0;var _0x5f5944=_0xb395[_0x50203e];return _0x5f5944;};'use strict';var multer=require(_0x5b39('0x0'));var util=require(_0x5b39('0x1'));var path=require(_0x5b39('0x2'));var timeout=require(_0x5b39('0x3'));var express=require(_0x5b39('0x4'));var router=express[_0x5b39('0x5')]();var fs_extra=require(_0x5b39('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5b39('0x7'));var config=require(_0x5b39('0x8'));var controller=require(_0x5b39('0x9'));router[_0x5b39('0xa')]('/',auth[_0x5b39('0xb')](),controller[_0x5b39('0xc')]);router[_0x5b39('0xa')](_0x5b39('0xd'),auth[_0x5b39('0xb')](),controller['describe']);router[_0x5b39('0xa')](_0x5b39('0xe'),auth[_0x5b39('0xb')](),controller['show']);router['post']('/',auth[_0x5b39('0xb')](),controller['create']);router['put'](_0x5b39('0xe'),auth['isAuthenticated'](),controller[_0x5b39('0xf')]);router[_0x5b39('0x10')](_0x5b39('0xe'),auth[_0x5b39('0xb')](),controller[_0x5b39('0x11')]);module[_0x5b39('0x12')]=router; \ No newline at end of file +var _0x6458=['update','delete','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x6458,0x133));var _0x8645=function(_0x919bbb,_0x55ef48){_0x919bbb=_0x919bbb-0x0;var _0x40971a=_0x6458[_0x919bbb];return _0x40971a;};'use strict';var multer=require(_0x8645('0x0'));var util=require('util');var path=require(_0x8645('0x1'));var timeout=require(_0x8645('0x2'));var express=require('express');var router=express[_0x8645('0x3')]();var fs_extra=require(_0x8645('0x4'));var auth=require(_0x8645('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8645('0x6'));var controller=require(_0x8645('0x7'));router[_0x8645('0x8')]('/',auth[_0x8645('0x9')](),controller[_0x8645('0xa')]);router['get'](_0x8645('0xb'),auth['isAuthenticated'](),controller[_0x8645('0xc')]);router[_0x8645('0x8')](_0x8645('0xd'),auth[_0x8645('0x9')](),controller[_0x8645('0xe')]);router[_0x8645('0xf')]('/',auth[_0x8645('0x9')](),controller['create']);router['put']('/:id',auth[_0x8645('0x9')](),controller[_0x8645('0x10')]);router[_0x8645('0x11')](_0x8645('0xd'),auth[_0x8645('0x9')](),controller['destroy']);module[_0x8645('0x12')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 3dedce5..5611bfa 100644 --- a/server/api/userProfileResource/userProfileResource.attributes.js +++ b/server/api/userProfileResource/userProfileResource.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5044=['STRING','INTEGER','sequelize','exports'];(function(_0x9657be,_0x2a7995){var _0x267e2b=function(_0x467c27){while(--_0x467c27){_0x9657be['push'](_0x9657be['shift']());}};_0x267e2b(++_0x2a7995);}(_0x5044,0x1da));var _0x4504=function(_0x5b7cc2,_0x2b4334){_0x5b7cc2=_0x5b7cc2-0x0;var _0x56573e=_0x5044[_0x5b7cc2];return _0x56573e;};'use strict';var Sequelize=require(_0x4504('0x0'));module[_0x4504('0x1')]={'name':{'type':Sequelize[_0x4504('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x4504('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x4504('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x9ec4=['STRING','INTEGER','sequelize','exports'];(function(_0x22ee1e,_0x3eff80){var _0x49a5c9=function(_0x373480){while(--_0x373480){_0x22ee1e['push'](_0x22ee1e['shift']());}};_0x49a5c9(++_0x3eff80);}(_0x9ec4,0x1ba));var _0x49ec=function(_0x2373c2,_0x14aaeb){_0x2373c2=_0x2373c2-0x0;var _0x17a42f=_0x9ec4[_0x2373c2];return _0x17a42f;};'use strict';var Sequelize=require(_0x49ec('0x0'));module[_0x49ec('0x1')]={'name':{'type':Sequelize[_0x49ec('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x49ec('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x49ec('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 4468064..98a7d7b 100644 --- a/server/api/userProfileResource/userProfileResource.controller.js +++ b/server/api/userProfileResource/userProfileResource.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7096=['Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','params','UserProfileResource','find','catch','create','body','describe','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','set'];(function(_0x5e17b6,_0x3b17f2){var _0x317d37=function(_0x3c29c0){while(--_0x3c29c0){_0x5e17b6['push'](_0x5e17b6['shift']());}};_0x317d37(++_0x3b17f2);}(_0x7096,0x10c));var _0x6709=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x7096[_0x491a7f];return _0x3d8f44;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6709('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6709('0x1'));var rp=require('request-promise');var moment=require(_0x6709('0x2'));var BPromise=require(_0x6709('0x3'));var Mustache=require(_0x6709('0x4'));var util=require(_0x6709('0x5'));var path=require(_0x6709('0x6'));var sox=require(_0x6709('0x7'));var csv=require(_0x6709('0x8'));var ejs=require(_0x6709('0x9'));var fs=require('fs');var fs_extra=require(_0x6709('0xa'));var _=require(_0x6709('0xb'));var squel=require(_0x6709('0xc'));var crypto=require(_0x6709('0xd'));var jsforce=require(_0x6709('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6709('0xf'));var Papa=require(_0x6709('0x10'));var Redis=require(_0x6709('0x11'));var authService=require(_0x6709('0x12'));var qs=require(_0x6709('0x13'));var as=require(_0x6709('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6709('0x15'));var utils=require(_0x6709('0x16'));var config=require(_0x6709('0x17'));var licenseUtil=require(_0x6709('0x18'));var db=require(_0x6709('0x19'))['db'];function respondWithStatusCode(_0x288f51,_0x1d56a5){_0x1d56a5=_0x1d56a5||0xcc;return function(_0x1ac547){if(_0x1ac547){return _0x288f51['sendStatus'](_0x1d56a5);}return _0x288f51[_0x6709('0x1a')](_0x1d56a5)[_0x6709('0x1b')]();};}function respondWithResult(_0x4d5255,_0x3706e1){_0x3706e1=_0x3706e1||0xc8;return function(_0x4e4587){if(_0x4e4587){return _0x4d5255[_0x6709('0x1a')](_0x3706e1)['json'](_0x4e4587);}};}function respondWithFilteredResult(_0x41af1f,_0x4bc059){return function(_0x149233){if(_0x149233){var _0x28866a=typeof _0x4bc059[_0x6709('0x1c')]===_0x6709('0x1d')&&typeof _0x4bc059['limit']==='undefined';var _0x5c4f94=_0x149233[_0x6709('0x1e')];var _0x235a54=_0x28866a?0x0:_0x4bc059['offset'];var _0x9c1fd8=_0x28866a?_0x149233[_0x6709('0x1e')]:_0x4bc059[_0x6709('0x1c')]+_0x4bc059['limit'];var _0x13cf04;if(_0x9c1fd8>=_0x5c4f94){_0x9c1fd8=_0x5c4f94;_0x13cf04=0xc8;}else{_0x13cf04=0xce;}_0x41af1f[_0x6709('0x1a')](_0x13cf04);return _0x41af1f[_0x6709('0x1f')](_0x6709('0x20'),_0x235a54+'-'+_0x9c1fd8+'/'+_0x5c4f94)['json'](_0x149233);}return null;};}function patchUpdates(_0x3c4971){return function(_0x1edac3){try{jsonpatch[_0x6709('0x21')](_0x1edac3,_0x3c4971,!![]);}catch(_0x3cf882){return BPromise[_0x6709('0x22')](_0x3cf882);}return _0x1edac3[_0x6709('0x23')]();};}function saveUpdates(_0x45921e,_0x17763d){return function(_0x386224){if(_0x386224){return _0x386224[_0x6709('0x24')](_0x45921e)[_0x6709('0x25')](function(_0xa36371){return _0xa36371;});}return null;};}function removeEntity(_0x5cf48b,_0x29f25f){return function(_0x81138e){if(_0x81138e){return _0x81138e[_0x6709('0x26')]()['then'](function(){_0x5cf48b[_0x6709('0x1a')](0xcc)[_0x6709('0x1b')]();});}};}function handleEntityNotFound(_0x20a347,_0x44b465){return function(_0x588e00){if(!_0x588e00){_0x20a347[_0x6709('0x27')](0x194);}return _0x588e00;};}function handleError(_0x3076fe,_0x50f7d6){_0x50f7d6=_0x50f7d6||0x1f4;return function(_0x585073){logger[_0x6709('0x28')](_0x585073['stack']);if(_0x585073[_0x6709('0x29')]){delete _0x585073[_0x6709('0x29')];}_0x3076fe['status'](_0x50f7d6)[_0x6709('0x2a')](_0x585073);};}exports['index']=function(_0x46a325,_0x3cd555){var _0x5b6906={},_0x137137={},_0x4e6989={'count':0x0,'rows':[]};var _0xe066d8=_[_0x6709('0x2b')](db['UserProfileResource'][_0x6709('0x2c')],function(_0x5deff5){return{'name':_0x5deff5[_0x6709('0x2d')],'type':_0x5deff5[_0x6709('0x2e')]['key']};});_0x137137['model']=_[_0x6709('0x2b')](_0xe066d8,_0x6709('0x29'));_0x137137[_0x6709('0x2f')]=_[_0x6709('0x30')](_0x46a325[_0x6709('0x2f')]);_0x137137[_0x6709('0x31')]=_[_0x6709('0x32')](_0x137137[_0x6709('0x33')],_0x137137[_0x6709('0x2f')]);_0x5b6906['attributes']=_[_0x6709('0x32')](_0x137137[_0x6709('0x33')],qs[_0x6709('0x34')](_0x46a325[_0x6709('0x2f')]['fields']));_0x5b6906[_0x6709('0x35')]=_0x5b6906[_0x6709('0x35')][_0x6709('0x36')]?_0x5b6906[_0x6709('0x35')]:_0x137137['model'];if(!_0x46a325[_0x6709('0x2f')][_0x6709('0x37')]('nolimit')){_0x5b6906[_0x6709('0x38')]=qs[_0x6709('0x38')](_0x46a325['query'][_0x6709('0x38')]);_0x5b6906[_0x6709('0x1c')]=qs[_0x6709('0x1c')](_0x46a325[_0x6709('0x2f')][_0x6709('0x1c')]);}_0x5b6906[_0x6709('0x39')]=qs[_0x6709('0x3a')](_0x46a325['query'][_0x6709('0x3a')]);_0x5b6906[_0x6709('0x3b')]=qs['filters'](_[_0x6709('0x3c')](_0x46a325[_0x6709('0x2f')],_0x137137[_0x6709('0x31')]),_0xe066d8);if(_0x46a325[_0x6709('0x2f')][_0x6709('0x3d')]){_0x5b6906[_0x6709('0x3b')]=_['merge'](_0x5b6906[_0x6709('0x3b')],{'$or':_['map'](_0xe066d8,function(_0x31e05a){if(_0x31e05a[_0x6709('0x2e')]!==_0x6709('0x3e')){var _0x48492f={};_0x48492f[_0x31e05a[_0x6709('0x29')]]={'$like':'%'+_0x46a325[_0x6709('0x2f')][_0x6709('0x3d')]+'%'};return _0x48492f;}})});}_0x5b6906=_[_0x6709('0x3f')]({},_0x5b6906,_0x46a325[_0x6709('0x40')]);var _0x1030ee={'where':_0x5b6906[_0x6709('0x3b')]};return db['UserProfileResource'][_0x6709('0x1e')](_0x1030ee)[_0x6709('0x25')](function(_0x50fbcd){_0x4e6989[_0x6709('0x1e')]=_0x50fbcd;if(_0x46a325[_0x6709('0x2f')][_0x6709('0x41')]){_0x5b6906[_0x6709('0x42')]=[{'all':!![]}];}return db['UserProfileResource']['findAll'](_0x5b6906);})[_0x6709('0x25')](function(_0x3f0da1){_0x4e6989[_0x6709('0x43')]=_0x3f0da1;return _0x4e6989;})[_0x6709('0x25')](respondWithFilteredResult(_0x3cd555,_0x5b6906))['catch'](handleError(_0x3cd555,null));};exports['show']=function(_0x5af1fb,_0x3d4237){var _0x293577={'raw':![],'where':{'id':_0x5af1fb[_0x6709('0x44')]['id']}},_0x54f74e={};_0x54f74e[_0x6709('0x33')]=_['keys'](db['UserProfileResource'][_0x6709('0x2c')]);_0x54f74e[_0x6709('0x2f')]=_[_0x6709('0x30')](_0x5af1fb[_0x6709('0x2f')]);_0x54f74e[_0x6709('0x31')]=_['intersection'](_0x54f74e[_0x6709('0x33')],_0x54f74e['query']);_0x293577[_0x6709('0x35')]=_[_0x6709('0x32')](_0x54f74e[_0x6709('0x33')],qs['fields'](_0x5af1fb[_0x6709('0x2f')]['fields']));_0x293577['attributes']=_0x293577[_0x6709('0x35')][_0x6709('0x36')]?_0x293577[_0x6709('0x35')]:_0x54f74e[_0x6709('0x33')];if(_0x5af1fb[_0x6709('0x2f')][_0x6709('0x41')]){_0x293577[_0x6709('0x42')]=[{'all':!![]}];}_0x293577=_[_0x6709('0x3f')]({},_0x293577,_0x5af1fb[_0x6709('0x40')]);return db[_0x6709('0x45')][_0x6709('0x46')](_0x293577)[_0x6709('0x25')](handleEntityNotFound(_0x3d4237,null))[_0x6709('0x25')](respondWithResult(_0x3d4237,null))[_0x6709('0x47')](handleError(_0x3d4237,null));};exports[_0x6709('0x48')]=function(_0x4f82a0,_0xfbb810){return db['UserProfileResource']['create'](_0x4f82a0[_0x6709('0x49')],{})[_0x6709('0x25')](respondWithResult(_0xfbb810,0xc9))[_0x6709('0x47')](handleError(_0xfbb810,null));};exports[_0x6709('0x24')]=function(_0x22363b,_0x2b05dc){if(_0x22363b[_0x6709('0x49')]['id']){delete _0x22363b[_0x6709('0x49')]['id'];}return db['UserProfileResource'][_0x6709('0x46')]({'where':{'id':_0x22363b[_0x6709('0x44')]['id']}})[_0x6709('0x25')](handleEntityNotFound(_0x2b05dc,null))[_0x6709('0x25')](saveUpdates(_0x22363b['body'],null))[_0x6709('0x25')](respondWithResult(_0x2b05dc,null))['catch'](handleError(_0x2b05dc,null));};exports[_0x6709('0x26')]=function(_0x34a950,_0x2a563b){return db[_0x6709('0x45')][_0x6709('0x46')]({'where':{'id':_0x34a950['params']['id']}})[_0x6709('0x25')](handleEntityNotFound(_0x2a563b,null))[_0x6709('0x25')](removeEntity(_0x2a563b,null))[_0x6709('0x47')](handleError(_0x2a563b,null));};exports[_0x6709('0x4a')]=function(_0x1015e0,_0x55188c){return db['UserProfileResource'][_0x6709('0x4a')]()['then'](respondWithResult(_0x55188c,null))['catch'](handleError(_0x55188c,null));}; \ No newline at end of file +var _0x5496=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','UserProfileResource','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','rows','catch','show','params','keys','fields','include','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils'];(function(_0x40dbe5,_0x51232a){var _0x153259=function(_0x5da9b2){while(--_0x5da9b2){_0x40dbe5['push'](_0x40dbe5['shift']());}};_0x153259(++_0x51232a);}(_0x5496,0x175));var _0x6549=function(_0x9405a7,_0x1ea9fd){_0x9405a7=_0x9405a7-0x0;var _0x180cbd=_0x5496[_0x9405a7];return _0x180cbd;};'use strict';var emlformat=require(_0x6549('0x0'));var rimraf=require(_0x6549('0x1'));var zipdir=require(_0x6549('0x2'));var jsonpatch=require(_0x6549('0x3'));var rp=require(_0x6549('0x4'));var moment=require('moment');var BPromise=require(_0x6549('0x5'));var Mustache=require('mustache');var util=require(_0x6549('0x6'));var path=require(_0x6549('0x7'));var sox=require(_0x6549('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6549('0x9'));var _=require(_0x6549('0xa'));var squel=require('squel');var crypto=require(_0x6549('0xb'));var jsforce=require(_0x6549('0xc'));var deskjs=require(_0x6549('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6549('0xe'));var Papa=require(_0x6549('0xf'));var Redis=require(_0x6549('0x10'));var authService=require(_0x6549('0x11'));var qs=require(_0x6549('0x12'));var as=require(_0x6549('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6549('0x14'));var utils=require(_0x6549('0x15'));var config=require(_0x6549('0x16'));var licenseUtil=require(_0x6549('0x17'));var db=require(_0x6549('0x18'))['db'];function respondWithStatusCode(_0x5bc018,_0x4dfb06){_0x4dfb06=_0x4dfb06||0xcc;return function(_0x3f844f){if(_0x3f844f){return _0x5bc018[_0x6549('0x19')](_0x4dfb06);}return _0x5bc018['status'](_0x4dfb06)[_0x6549('0x1a')]();};}function respondWithResult(_0x150fc8,_0x195d25){_0x195d25=_0x195d25||0xc8;return function(_0x12b068){if(_0x12b068){return _0x150fc8[_0x6549('0x1b')](_0x195d25)[_0x6549('0x1c')](_0x12b068);}};}function respondWithFilteredResult(_0x55c112,_0x5db86d){return function(_0x384f75){if(_0x384f75){var _0x25da29=typeof _0x5db86d['offset']===_0x6549('0x1d')&&typeof _0x5db86d[_0x6549('0x1e')]===_0x6549('0x1d');var _0x387e60=_0x384f75[_0x6549('0x1f')];var _0x53b12b=_0x25da29?0x0:_0x5db86d['offset'];var _0x26a212=_0x25da29?_0x384f75['count']:_0x5db86d['offset']+_0x5db86d[_0x6549('0x1e')];var _0x1e5079;if(_0x26a212>=_0x387e60){_0x26a212=_0x387e60;_0x1e5079=0xc8;}else{_0x1e5079=0xce;}_0x55c112[_0x6549('0x1b')](_0x1e5079);return _0x55c112[_0x6549('0x20')](_0x6549('0x21'),_0x53b12b+'-'+_0x26a212+'/'+_0x387e60)['json'](_0x384f75);}return null;};}function patchUpdates(_0x228117){return function(_0x4b40c1){try{jsonpatch[_0x6549('0x22')](_0x4b40c1,_0x228117,!![]);}catch(_0x72322b){return BPromise[_0x6549('0x23')](_0x72322b);}return _0x4b40c1[_0x6549('0x24')]();};}function saveUpdates(_0x22bcf8,_0x12d547){return function(_0x427b47){if(_0x427b47){return _0x427b47[_0x6549('0x25')](_0x22bcf8)[_0x6549('0x26')](function(_0x6ae00c){return _0x6ae00c;});}return null;};}function removeEntity(_0x40d3f9,_0x1fbfa4){return function(_0x23c0ba){if(_0x23c0ba){return _0x23c0ba['destroy']()[_0x6549('0x26')](function(){_0x40d3f9[_0x6549('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x126967,_0x29f89e){return function(_0x3768cb){if(!_0x3768cb){_0x126967['sendStatus'](0x194);}return _0x3768cb;};}function handleError(_0x31a95,_0xfb51a1){_0xfb51a1=_0xfb51a1||0x1f4;return function(_0x14de1f){logger[_0x6549('0x27')](_0x14de1f[_0x6549('0x28')]);if(_0x14de1f[_0x6549('0x29')]){delete _0x14de1f[_0x6549('0x29')];}_0x31a95[_0x6549('0x1b')](_0xfb51a1)['send'](_0x14de1f);};}exports[_0x6549('0x2a')]=function(_0x136518,_0x17fdfb){var _0x4c605c={},_0x3f1502={},_0x4acaf5={'count':0x0,'rows':[]};var _0x4f0ad1=_['map'](db[_0x6549('0x2b')][_0x6549('0x2c')],function(_0x4f3069){return{'name':_0x4f3069[_0x6549('0x2d')],'type':_0x4f3069[_0x6549('0x2e')][_0x6549('0x2f')]};});_0x3f1502[_0x6549('0x30')]=_[_0x6549('0x31')](_0x4f0ad1,_0x6549('0x29'));_0x3f1502[_0x6549('0x32')]=_['keys'](_0x136518[_0x6549('0x32')]);_0x3f1502[_0x6549('0x33')]=_[_0x6549('0x34')](_0x3f1502[_0x6549('0x30')],_0x3f1502[_0x6549('0x32')]);_0x4c605c[_0x6549('0x35')]=_['intersection'](_0x3f1502[_0x6549('0x30')],qs['fields'](_0x136518[_0x6549('0x32')]['fields']));_0x4c605c[_0x6549('0x35')]=_0x4c605c[_0x6549('0x35')][_0x6549('0x36')]?_0x4c605c['attributes']:_0x3f1502[_0x6549('0x30')];if(!_0x136518[_0x6549('0x32')][_0x6549('0x37')](_0x6549('0x38'))){_0x4c605c['limit']=qs['limit'](_0x136518['query'][_0x6549('0x1e')]);_0x4c605c[_0x6549('0x39')]=qs['offset'](_0x136518[_0x6549('0x32')][_0x6549('0x39')]);}_0x4c605c[_0x6549('0x3a')]=qs[_0x6549('0x3b')](_0x136518[_0x6549('0x32')]['sort']);_0x4c605c['where']=qs[_0x6549('0x33')](_[_0x6549('0x3c')](_0x136518[_0x6549('0x32')],_0x3f1502[_0x6549('0x33')]),_0x4f0ad1);if(_0x136518[_0x6549('0x32')][_0x6549('0x3d')]){_0x4c605c[_0x6549('0x3e')]=_[_0x6549('0x3f')](_0x4c605c[_0x6549('0x3e')],{'$or':_[_0x6549('0x31')](_0x4f0ad1,function(_0x525f82){if(_0x525f82[_0x6549('0x2e')]!==_0x6549('0x40')){var _0x2ea977={};_0x2ea977[_0x525f82[_0x6549('0x29')]]={'$like':'%'+_0x136518[_0x6549('0x32')]['filter']+'%'};return _0x2ea977;}})});}_0x4c605c=_['merge']({},_0x4c605c,_0x136518['options']);var _0x22b919={'where':_0x4c605c[_0x6549('0x3e')]};return db[_0x6549('0x2b')][_0x6549('0x1f')](_0x22b919)['then'](function(_0x56ce9f){_0x4acaf5[_0x6549('0x1f')]=_0x56ce9f;if(_0x136518[_0x6549('0x32')][_0x6549('0x41')]){_0x4c605c['include']=[{'all':!![]}];}return db[_0x6549('0x2b')]['findAll'](_0x4c605c);})[_0x6549('0x26')](function(_0x2ec614){_0x4acaf5[_0x6549('0x42')]=_0x2ec614;return _0x4acaf5;})[_0x6549('0x26')](respondWithFilteredResult(_0x17fdfb,_0x4c605c))[_0x6549('0x43')](handleError(_0x17fdfb,null));};exports[_0x6549('0x44')]=function(_0xbbfdc9,_0x4deaab){var _0x132625={'raw':![],'where':{'id':_0xbbfdc9[_0x6549('0x45')]['id']}},_0x309f45={};_0x309f45[_0x6549('0x30')]=_[_0x6549('0x46')](db[_0x6549('0x2b')][_0x6549('0x2c')]);_0x309f45[_0x6549('0x32')]=_[_0x6549('0x46')](_0xbbfdc9[_0x6549('0x32')]);_0x309f45[_0x6549('0x33')]=_[_0x6549('0x34')](_0x309f45[_0x6549('0x30')],_0x309f45[_0x6549('0x32')]);_0x132625[_0x6549('0x35')]=_[_0x6549('0x34')](_0x309f45['model'],qs[_0x6549('0x47')](_0xbbfdc9[_0x6549('0x32')][_0x6549('0x47')]));_0x132625[_0x6549('0x35')]=_0x132625['attributes'][_0x6549('0x36')]?_0x132625['attributes']:_0x309f45[_0x6549('0x30')];if(_0xbbfdc9[_0x6549('0x32')]['includeAll']){_0x132625[_0x6549('0x48')]=[{'all':!![]}];}_0x132625=_[_0x6549('0x3f')]({},_0x132625,_0xbbfdc9[_0x6549('0x49')]);return db[_0x6549('0x2b')][_0x6549('0x4a')](_0x132625)['then'](handleEntityNotFound(_0x4deaab,null))['then'](respondWithResult(_0x4deaab,null))[_0x6549('0x43')](handleError(_0x4deaab,null));};exports[_0x6549('0x4b')]=function(_0x41d675,_0x1712f3){return db[_0x6549('0x2b')]['create'](_0x41d675[_0x6549('0x4c')],{})[_0x6549('0x26')](respondWithResult(_0x1712f3,0xc9))[_0x6549('0x43')](handleError(_0x1712f3,null));};exports[_0x6549('0x25')]=function(_0xa4c650,_0x25a6ee){if(_0xa4c650[_0x6549('0x4c')]['id']){delete _0xa4c650[_0x6549('0x4c')]['id'];}return db['UserProfileResource'][_0x6549('0x4a')]({'where':{'id':_0xa4c650['params']['id']}})[_0x6549('0x26')](handleEntityNotFound(_0x25a6ee,null))[_0x6549('0x26')](saveUpdates(_0xa4c650[_0x6549('0x4c')],null))['then'](respondWithResult(_0x25a6ee,null))[_0x6549('0x43')](handleError(_0x25a6ee,null));};exports[_0x6549('0x4d')]=function(_0x2ef4d2,_0x5300c8){return db[_0x6549('0x2b')][_0x6549('0x4a')]({'where':{'id':_0x2ef4d2[_0x6549('0x45')]['id']}})[_0x6549('0x26')](handleEntityNotFound(_0x5300c8,null))[_0x6549('0x26')](removeEntity(_0x5300c8,null))[_0x6549('0x43')](handleError(_0x5300c8,null));};exports['describe']=function(_0x28af00,_0x4bbc61){return db[_0x6549('0x2b')][_0x6549('0x4e')]()[_0x6549('0x26')](respondWithResult(_0x4bbc61,null))[_0x6549('0x43')](handleError(_0x4bbc61,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 2bca675..b0ebb73 100644 --- a/server/api/userProfileResource/userProfileResource.model.js +++ b/server/api/userProfileResource/userProfileResource.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3a12=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','util','../../config/logger','api'];(function(_0x1876b2,_0x5d0225){var _0x9fb1e0=function(_0x29b099){while(--_0x29b099){_0x1876b2['push'](_0x1876b2['shift']());}};_0x9fb1e0(++_0x5d0225);}(_0x3a12,0x9e));var _0x23a1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3a12[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x23a1('0x0'));var util=require(_0x23a1('0x1'));var logger=require(_0x23a1('0x2'))(_0x23a1('0x3'));var moment=require(_0x23a1('0x4'));var BPromise=require(_0x23a1('0x5'));var rp=require(_0x23a1('0x6'));var fs=require('fs');var path=require(_0x23a1('0x7'));var rimraf=require(_0x23a1('0x8'));var config=require(_0x23a1('0x9'));var attributes=require(_0x23a1('0xa'));module[_0x23a1('0xb')]=function(_0xd7d745,_0x26aa5f){return _0xd7d745[_0x23a1('0xc')](_0x23a1('0xd'),attributes,{'tableName':_0x23a1('0xe'),'paranoid':![],'indexes':[{'name':_0x23a1('0xf'),'fields':[_0x23a1('0x10'),_0x23a1('0x11')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd85f=['define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','util','api','bluebird','request-promise','path','./userProfileResource.attributes'];(function(_0x4d11e7,_0x3e7fdb){var _0x25f4d3=function(_0x16da42){while(--_0x16da42){_0x4d11e7['push'](_0x4d11e7['shift']());}};_0x25f4d3(++_0x3e7fdb);}(_0xd85f,0xfd));var _0xfd85=function(_0x11a0d6,_0x290e5e){_0x11a0d6=_0x11a0d6-0x0;var _0x578781=_0xd85f[_0x11a0d6];return _0x578781;};'use strict';var _=require(_0xfd85('0x0'));var util=require(_0xfd85('0x1'));var logger=require('../../config/logger')(_0xfd85('0x2'));var moment=require('moment');var BPromise=require(_0xfd85('0x3'));var rp=require(_0xfd85('0x4'));var fs=require('fs');var path=require(_0xfd85('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfd85('0x6'));module['exports']=function(_0x47e568,_0x5e071b){return _0x47e568[_0xfd85('0x7')](_0xfd85('0x8'),attributes,{'tableName':_0xfd85('0x9'),'paranoid':![],'indexes':[{'name':_0xfd85('0xa'),'fields':[_0xfd85('0xb'),_0xfd85('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 744b339..2ab3146 100644 --- a/server/api/userProfileResource/userProfileResource.rpc.js +++ b/server/api/userProfileResource/userProfileResource.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2651=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util'];(function(_0x10b48a,_0x1a0a3f){var _0x2c4533=function(_0x5e4be6){while(--_0x5e4be6){_0x10b48a['push'](_0x10b48a['shift']());}};_0x2c4533(++_0x1a0a3f);}(_0x2651,0x19c));var _0x1265=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x2651[_0x38537f];return _0x141e23;};'use strict';var _=require(_0x1265('0x0'));var util=require(_0x1265('0x1'));var moment=require(_0x1265('0x2'));var BPromise=require('bluebird');var rs=require(_0x1265('0x3'));var fs=require('fs');var Redis=require(_0x1265('0x4'));var db=require(_0x1265('0x5'))['db'];var utils=require(_0x1265('0x6'));var logger=require(_0x1265('0x7'))(_0x1265('0x8'));var config=require(_0x1265('0x9'));var jayson=require(_0x1265('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xf9be05,_0x55872b,_0x463e7f){return new BPromise(function(_0x3dc50f,_0x2d5f3a){return client[_0x1265('0xb')](_0xf9be05,_0x463e7f)[_0x1265('0xc')](function(_0x54a958){logger[_0x1265('0xd')](_0x1265('0xe'),_0x55872b,_0x1265('0xf'));logger[_0x1265('0x10')](_0x1265('0x11'),_0x55872b,_0x1265('0xf'),JSON['stringify'](_0x54a958));if(_0x54a958[_0x1265('0x12')]){if(_0x54a958[_0x1265('0x12')][_0x1265('0x13')]===0x1f4){logger['error'](_0x1265('0xe'),_0x55872b,_0x54a958[_0x1265('0x12')][_0x1265('0x14')]);return _0x2d5f3a(_0x54a958[_0x1265('0x12')][_0x1265('0x14')]);}logger[_0x1265('0x12')](_0x1265('0xe'),_0x55872b,_0x54a958[_0x1265('0x12')][_0x1265('0x14')]);return _0x3dc50f(_0x54a958['error'][_0x1265('0x14')]);}else{logger[_0x1265('0xd')](_0x1265('0xe'),_0x55872b,_0x1265('0xf'));_0x3dc50f(_0x54a958[_0x1265('0x15')][_0x1265('0x14')]);}})[_0x1265('0x16')](function(_0x2bceca){logger[_0x1265('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x55872b,_0x2bceca);_0x2d5f3a(_0x2bceca);});});} \ No newline at end of file +var _0x38f9=['then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','http'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x38f9,0x1af));var _0x938f=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x38f9[_0x1ccdf7];return _0x52a0ae;};'use strict';var _=require(_0x938f('0x0'));var util=require(_0x938f('0x1'));var moment=require(_0x938f('0x2'));var BPromise=require('bluebird');var rs=require(_0x938f('0x3'));var fs=require('fs');var Redis=require(_0x938f('0x4'));var db=require(_0x938f('0x5'))['db'];var utils=require(_0x938f('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x938f('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x938f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x275a93,_0x345bfd,_0x439921){return new BPromise(function(_0xf2db39,_0x3c9fb6){return client['request'](_0x275a93,_0x439921)[_0x938f('0x9')](function(_0x355eee){logger[_0x938f('0xa')](_0x938f('0xb'),_0x345bfd,_0x938f('0xc'));logger[_0x938f('0xd')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x345bfd,_0x938f('0xc'),JSON[_0x938f('0xe')](_0x355eee));if(_0x355eee['error']){if(_0x355eee[_0x938f('0xf')][_0x938f('0x10')]===0x1f4){logger[_0x938f('0xf')]('UserProfileResource,\x20%s,\x20%s',_0x345bfd,_0x355eee[_0x938f('0xf')][_0x938f('0x11')]);return _0x3c9fb6(_0x355eee[_0x938f('0xf')][_0x938f('0x11')]);}logger[_0x938f('0xf')](_0x938f('0xb'),_0x345bfd,_0x355eee['error']['message']);return _0xf2db39(_0x355eee[_0x938f('0xf')]['message']);}else{logger['info'](_0x938f('0xb'),_0x345bfd,_0x938f('0xc'));_0xf2db39(_0x355eee[_0x938f('0x12')][_0x938f('0x11')]);}})[_0x938f('0x13')](function(_0x4bdcb3){logger[_0x938f('0xf')](_0x938f('0xb'),_0x345bfd,_0x4bdcb3);_0x3c9fb6(_0x4bdcb3);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 27ac32f..a1fc1be 100644 --- a/server/api/userProfileSection/index.js +++ b/server/api/userProfileSection/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbb53=['create','put','update','destroy','exports','util','connect-timeout','express','fs-extra','./userProfileSection.controller','get','index','/describe','isAuthenticated','describe','/:id','show'];(function(_0x5d9bca,_0x28d26f){var _0x22b41b=function(_0x425566){while(--_0x425566){_0x5d9bca['push'](_0x5d9bca['shift']());}};_0x22b41b(++_0x28d26f);}(_0xbb53,0x126));var _0x3bb5=function(_0x3dc0af,_0x276349){_0x3dc0af=_0x3dc0af-0x0;var _0x1aa258=_0xbb53[_0x3dc0af];return _0x1aa258;};'use strict';var multer=require('multer');var util=require(_0x3bb5('0x0'));var path=require('path');var timeout=require(_0x3bb5('0x1'));var express=require(_0x3bb5('0x2'));var router=express['Router']();var fs_extra=require(_0x3bb5('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3bb5('0x4'));router[_0x3bb5('0x5')]('/',auth['isAuthenticated'](),controller[_0x3bb5('0x6')]);router[_0x3bb5('0x5')](_0x3bb5('0x7'),auth[_0x3bb5('0x8')](),controller[_0x3bb5('0x9')]);router[_0x3bb5('0x5')](_0x3bb5('0xa'),auth['isAuthenticated'](),controller[_0x3bb5('0xb')]);router['post']('/',auth[_0x3bb5('0x8')](),controller[_0x3bb5('0xc')]);router[_0x3bb5('0xd')](_0x3bb5('0xa'),auth[_0x3bb5('0x8')](),controller[_0x3bb5('0xe')]);router['delete']('/:id',auth[_0x3bb5('0x8')](),controller[_0x3bb5('0xf')]);module[_0x3bb5('0x10')]=router; \ No newline at end of file +var _0x4ab0=['get','/describe','/:id','show','post','create','put','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileSection.controller','isAuthenticated','index'];(function(_0x1cb881,_0x56812d){var _0x1d6ed2=function(_0x5e8b70){while(--_0x5e8b70){_0x1cb881['push'](_0x1cb881['shift']());}};_0x1d6ed2(++_0x56812d);}(_0x4ab0,0x9c));var _0x04ab=function(_0x494306,_0x19a450){_0x494306=_0x494306-0x0;var _0x565a04=_0x4ab0[_0x494306];return _0x565a04;};'use strict';var multer=require(_0x04ab('0x0'));var util=require(_0x04ab('0x1'));var path=require(_0x04ab('0x2'));var timeout=require(_0x04ab('0x3'));var express=require(_0x04ab('0x4'));var router=express[_0x04ab('0x5')]();var fs_extra=require(_0x04ab('0x6'));var auth=require(_0x04ab('0x7'));var interaction=require(_0x04ab('0x8'));var config=require('../../config/environment');var controller=require(_0x04ab('0x9'));router['get']('/',auth[_0x04ab('0xa')](),controller[_0x04ab('0xb')]);router[_0x04ab('0xc')](_0x04ab('0xd'),auth[_0x04ab('0xa')](),controller['describe']);router['get'](_0x04ab('0xe'),auth[_0x04ab('0xa')](),controller[_0x04ab('0xf')]);router[_0x04ab('0x10')]('/',auth['isAuthenticated'](),controller[_0x04ab('0x11')]);router[_0x04ab('0x12')](_0x04ab('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x04ab('0x13')](_0x04ab('0xe'),auth[_0x04ab('0xa')](),controller[_0x04ab('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 1d1f007..77bb38d 100644 --- a/server/api/userProfileSection/userProfileSection.attributes.js +++ b/server/api/userProfileSection/userProfileSection.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2547=['BOOLEAN','crudPermissions','join','getDataValue','split','exports','STRING','INTEGER'];(function(_0x4a6cbb,_0x4d21be){var _0x562d6f=function(_0x2c3644){while(--_0x2c3644){_0x4a6cbb['push'](_0x4a6cbb['shift']());}};_0x562d6f(++_0x4d21be);}(_0x2547,0x1cd));var _0x7254=function(_0x24c492,_0x14f22a){_0x24c492=_0x24c492-0x0;var _0x4d4bd7=_0x2547[_0x24c492];return _0x4d4bd7;};'use strict';var Sequelize=require('sequelize');module[_0x7254('0x0')]={'name':{'type':Sequelize[_0x7254('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x7254('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x7254('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x7254('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x7254('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x7254('0x1')],'set':function(_0x265ebf){this['setDataValue'](_0x7254('0x4'),_0x265ebf?_0x265ebf[_0x7254('0x5')](''):[]);},'get':function(){return this[_0x7254('0x6')](_0x7254('0x4'))?this['getDataValue'](_0x7254('0x4'))[_0x7254('0x7')](''):[];}}}; \ No newline at end of file +var _0xbfcc=['split','sequelize','STRING','INTEGER','BOOLEAN','join','getDataValue'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xbfcc[_0x373dee];return _0x46798f;};'use strict';var Sequelize=require(_0xcbfc('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0xcbfc('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xcbfc('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0xcbfc('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xcbfc('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x59b1de){this['setDataValue']('crudPermissions',_0x59b1de?_0x59b1de[_0xcbfc('0x4')](''):[]);},'get':function(){return this[_0xcbfc('0x5')]('crudPermissions')?this[_0xcbfc('0x5')]('crudPermissions')[_0xcbfc('0x6')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index a0ce114..1c1e994 100644 --- a/server/api/userProfileSection/userProfileSection.controller.js +++ b/server/api/userProfileSection/userProfileSection.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc5c6=['rows','show','params','keys','length','catch','create','body','find','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','UserProfileSection','rawAttributes','type','key','query','filters','intersection','model','fields','attributes','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll'];(function(_0x261b8a,_0x553ec4){var _0x3455e8=function(_0xdf10d4){while(--_0xdf10d4){_0x261b8a['push'](_0x261b8a['shift']());}};_0x3455e8(++_0x553ec4);}(_0xc5c6,0xf7));var _0x6c5c=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0xc5c6[_0x411017];return _0x2adeea;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6c5c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6c5c('0x1'));var rp=require(_0x6c5c('0x2'));var moment=require(_0x6c5c('0x3'));var BPromise=require(_0x6c5c('0x4'));var Mustache=require(_0x6c5c('0x5'));var util=require(_0x6c5c('0x6'));var path=require(_0x6c5c('0x7'));var sox=require(_0x6c5c('0x8'));var csv=require(_0x6c5c('0x9'));var ejs=require(_0x6c5c('0xa'));var fs=require('fs');var fs_extra=require(_0x6c5c('0xb'));var _=require(_0x6c5c('0xc'));var squel=require(_0x6c5c('0xd'));var crypto=require(_0x6c5c('0xe'));var jsforce=require(_0x6c5c('0xf'));var deskjs=require(_0x6c5c('0x10'));var toCsv=require(_0x6c5c('0x9'));var querystring=require('querystring');var Papa=require(_0x6c5c('0x11'));var Redis=require(_0x6c5c('0x12'));var authService=require(_0x6c5c('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x6c5c('0x14'));var hardwareService=require(_0x6c5c('0x15'));var logger=require('../../config/logger')(_0x6c5c('0x16'));var utils=require('../../config/utils');var config=require(_0x6c5c('0x17'));var licenseUtil=require(_0x6c5c('0x18'));var db=require(_0x6c5c('0x19'))['db'];function respondWithStatusCode(_0x3ab851,_0xbc77f0){_0xbc77f0=_0xbc77f0||0xcc;return function(_0x39626c){if(_0x39626c){return _0x3ab851[_0x6c5c('0x1a')](_0xbc77f0);}return _0x3ab851[_0x6c5c('0x1b')](_0xbc77f0)[_0x6c5c('0x1c')]();};}function respondWithResult(_0x4f2fae,_0x1bbbae){_0x1bbbae=_0x1bbbae||0xc8;return function(_0x4004e0){if(_0x4004e0){return _0x4f2fae['status'](_0x1bbbae)['json'](_0x4004e0);}};}function respondWithFilteredResult(_0x113941,_0x5087c5){return function(_0x3dc8cb){if(_0x3dc8cb){var _0x5acddd=typeof _0x5087c5[_0x6c5c('0x1d')]==='undefined'&&typeof _0x5087c5[_0x6c5c('0x1e')]==='undefined';var _0x19965f=_0x3dc8cb[_0x6c5c('0x1f')];var _0x334514=_0x5acddd?0x0:_0x5087c5['offset'];var _0x4e0545=_0x5acddd?_0x3dc8cb[_0x6c5c('0x1f')]:_0x5087c5[_0x6c5c('0x1d')]+_0x5087c5[_0x6c5c('0x1e')];var _0x4bbda6;if(_0x4e0545>=_0x19965f){_0x4e0545=_0x19965f;_0x4bbda6=0xc8;}else{_0x4bbda6=0xce;}_0x113941[_0x6c5c('0x1b')](_0x4bbda6);return _0x113941[_0x6c5c('0x20')](_0x6c5c('0x21'),_0x334514+'-'+_0x4e0545+'/'+_0x19965f)[_0x6c5c('0x22')](_0x3dc8cb);}return null;};}function patchUpdates(_0x15f3d1){return function(_0x241c32){try{jsonpatch[_0x6c5c('0x23')](_0x241c32,_0x15f3d1,!![]);}catch(_0x3ea81a){return BPromise[_0x6c5c('0x24')](_0x3ea81a);}return _0x241c32[_0x6c5c('0x25')]();};}function saveUpdates(_0x1dc2aa,_0x225b36){return function(_0xbd4fd8){if(_0xbd4fd8){return _0xbd4fd8[_0x6c5c('0x26')](_0x1dc2aa)['then'](function(_0x5458ff){return _0x5458ff;});}return null;};}function removeEntity(_0x7707cc,_0x111aef){return function(_0x1419c8){if(_0x1419c8){return _0x1419c8[_0x6c5c('0x27')]()[_0x6c5c('0x28')](function(){_0x7707cc['status'](0xcc)[_0x6c5c('0x1c')]();});}};}function handleEntityNotFound(_0x38aea0,_0x4b1bb9){return function(_0xa04c77){if(!_0xa04c77){_0x38aea0['sendStatus'](0x194);}return _0xa04c77;};}function handleError(_0x4de290,_0x35b846){_0x35b846=_0x35b846||0x1f4;return function(_0x19c089){logger[_0x6c5c('0x29')](_0x19c089[_0x6c5c('0x2a')]);if(_0x19c089[_0x6c5c('0x2b')]){delete _0x19c089['name'];}_0x4de290['status'](_0x35b846)[_0x6c5c('0x2c')](_0x19c089);};}exports[_0x6c5c('0x2d')]=function(_0x32cf5c,_0xa136dc){var _0x5999fa={},_0x9cd51b={},_0x33303a={'count':0x0,'rows':[]};var _0x2fbaf5=_[_0x6c5c('0x2e')](db[_0x6c5c('0x2f')][_0x6c5c('0x30')],function(_0x2f7fb9){return{'name':_0x2f7fb9['fieldName'],'type':_0x2f7fb9[_0x6c5c('0x31')][_0x6c5c('0x32')]};});_0x9cd51b['model']=_[_0x6c5c('0x2e')](_0x2fbaf5,_0x6c5c('0x2b'));_0x9cd51b[_0x6c5c('0x33')]=_['keys'](_0x32cf5c[_0x6c5c('0x33')]);_0x9cd51b[_0x6c5c('0x34')]=_[_0x6c5c('0x35')](_0x9cd51b[_0x6c5c('0x36')],_0x9cd51b[_0x6c5c('0x33')]);_0x5999fa['attributes']=_[_0x6c5c('0x35')](_0x9cd51b[_0x6c5c('0x36')],qs[_0x6c5c('0x37')](_0x32cf5c['query']['fields']));_0x5999fa[_0x6c5c('0x38')]=_0x5999fa[_0x6c5c('0x38')]['length']?_0x5999fa[_0x6c5c('0x38')]:_0x9cd51b[_0x6c5c('0x36')];if(!_0x32cf5c[_0x6c5c('0x33')][_0x6c5c('0x39')]('nolimit')){_0x5999fa[_0x6c5c('0x1e')]=qs[_0x6c5c('0x1e')](_0x32cf5c[_0x6c5c('0x33')][_0x6c5c('0x1e')]);_0x5999fa[_0x6c5c('0x1d')]=qs[_0x6c5c('0x1d')](_0x32cf5c[_0x6c5c('0x33')][_0x6c5c('0x1d')]);}_0x5999fa[_0x6c5c('0x3a')]=qs['sort'](_0x32cf5c[_0x6c5c('0x33')][_0x6c5c('0x3b')]);_0x5999fa['where']=qs[_0x6c5c('0x34')](_[_0x6c5c('0x3c')](_0x32cf5c['query'],_0x9cd51b[_0x6c5c('0x34')]),_0x2fbaf5);if(_0x32cf5c[_0x6c5c('0x33')][_0x6c5c('0x3d')]){_0x5999fa[_0x6c5c('0x3e')]=_[_0x6c5c('0x3f')](_0x5999fa[_0x6c5c('0x3e')],{'$or':_[_0x6c5c('0x2e')](_0x2fbaf5,function(_0x3a8ea5){if(_0x3a8ea5['type']!==_0x6c5c('0x40')){var _0x5d2105={};_0x5d2105[_0x3a8ea5[_0x6c5c('0x2b')]]={'$like':'%'+_0x32cf5c[_0x6c5c('0x33')][_0x6c5c('0x3d')]+'%'};return _0x5d2105;}})});}_0x5999fa=_[_0x6c5c('0x3f')]({},_0x5999fa,_0x32cf5c[_0x6c5c('0x41')]);var _0x577582={'where':_0x5999fa['where']};return db[_0x6c5c('0x2f')][_0x6c5c('0x1f')](_0x577582)[_0x6c5c('0x28')](function(_0x2ae3b6){_0x33303a[_0x6c5c('0x1f')]=_0x2ae3b6;if(_0x32cf5c['query'][_0x6c5c('0x42')]){_0x5999fa[_0x6c5c('0x43')]=[{'all':!![]}];}return db[_0x6c5c('0x2f')][_0x6c5c('0x44')](_0x5999fa);})[_0x6c5c('0x28')](function(_0x548775){_0x33303a[_0x6c5c('0x45')]=_0x548775;return _0x33303a;})[_0x6c5c('0x28')](respondWithFilteredResult(_0xa136dc,_0x5999fa))['catch'](handleError(_0xa136dc,null));};exports[_0x6c5c('0x46')]=function(_0x3707e1,_0x28acd3){var _0x4f6cd8={'raw':![],'where':{'id':_0x3707e1[_0x6c5c('0x47')]['id']}},_0x2699fb={};_0x2699fb[_0x6c5c('0x36')]=_[_0x6c5c('0x48')](db[_0x6c5c('0x2f')]['rawAttributes']);_0x2699fb['query']=_['keys'](_0x3707e1['query']);_0x2699fb['filters']=_[_0x6c5c('0x35')](_0x2699fb[_0x6c5c('0x36')],_0x2699fb[_0x6c5c('0x33')]);_0x4f6cd8[_0x6c5c('0x38')]=_[_0x6c5c('0x35')](_0x2699fb[_0x6c5c('0x36')],qs['fields'](_0x3707e1[_0x6c5c('0x33')][_0x6c5c('0x37')]));_0x4f6cd8[_0x6c5c('0x38')]=_0x4f6cd8['attributes'][_0x6c5c('0x49')]?_0x4f6cd8['attributes']:_0x2699fb[_0x6c5c('0x36')];if(_0x3707e1[_0x6c5c('0x33')][_0x6c5c('0x42')]){_0x4f6cd8[_0x6c5c('0x43')]=[{'all':!![]}];}_0x4f6cd8=_[_0x6c5c('0x3f')]({},_0x4f6cd8,_0x3707e1[_0x6c5c('0x41')]);return db[_0x6c5c('0x2f')]['find'](_0x4f6cd8)[_0x6c5c('0x28')](handleEntityNotFound(_0x28acd3,null))[_0x6c5c('0x28')](respondWithResult(_0x28acd3,null))[_0x6c5c('0x4a')](handleError(_0x28acd3,null));};exports['create']=function(_0x279a32,_0x382a92){return db[_0x6c5c('0x2f')][_0x6c5c('0x4b')](_0x279a32[_0x6c5c('0x4c')],{})[_0x6c5c('0x28')](respondWithResult(_0x382a92,0xc9))[_0x6c5c('0x4a')](handleError(_0x382a92,null));};exports[_0x6c5c('0x26')]=function(_0x440ac7,_0x4b1f0c){if(_0x440ac7[_0x6c5c('0x4c')]['id']){delete _0x440ac7[_0x6c5c('0x4c')]['id'];}return db[_0x6c5c('0x2f')][_0x6c5c('0x4d')]({'where':{'id':_0x440ac7[_0x6c5c('0x47')]['id']}})[_0x6c5c('0x28')](handleEntityNotFound(_0x4b1f0c,null))[_0x6c5c('0x28')](saveUpdates(_0x440ac7[_0x6c5c('0x4c')],null))[_0x6c5c('0x28')](respondWithResult(_0x4b1f0c,null))[_0x6c5c('0x4a')](handleError(_0x4b1f0c,null));};exports[_0x6c5c('0x27')]=function(_0x1a86aa,_0x397f1f){return db['UserProfileSection'][_0x6c5c('0x4d')]({'where':{'id':_0x1a86aa[_0x6c5c('0x47')]['id']}})[_0x6c5c('0x28')](handleEntityNotFound(_0x397f1f,null))[_0x6c5c('0x28')](removeEntity(_0x397f1f,null))['catch'](handleError(_0x397f1f,null));};exports[_0x6c5c('0x4e')]=function(_0x3c8584,_0x4514a){return db[_0x6c5c('0x2f')][_0x6c5c('0x4e')]()['then'](respondWithResult(_0x4514a,null))[_0x6c5c('0x4a')](handleError(_0x4514a,null));}; \ No newline at end of file +var _0xb9e2=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','send','index','map','UserProfileSection','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filters','where','merge','name','filter','includeAll','include','findAll','rows','catch','params','keys','options','find','create','body','describe','rimraf','zip-dir','moment','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb9e2,0x163));var _0x2b9e=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0xb9e2[_0xac151d];return _0x111dba;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2b9e('0x0'));var zipdir=require(_0x2b9e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2b9e('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2b9e('0x3'));var path=require(_0x2b9e('0x4'));var sox=require(_0x2b9e('0x5'));var csv=require(_0x2b9e('0x6'));var ejs=require(_0x2b9e('0x7'));var fs=require('fs');var fs_extra=require(_0x2b9e('0x8'));var _=require('lodash');var squel=require(_0x2b9e('0x9'));var crypto=require(_0x2b9e('0xa'));var jsforce=require(_0x2b9e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x2b9e('0x6'));var querystring=require(_0x2b9e('0xc'));var Papa=require(_0x2b9e('0xd'));var Redis=require(_0x2b9e('0xe'));var authService=require(_0x2b9e('0xf'));var qs=require(_0x2b9e('0x10'));var as=require(_0x2b9e('0x11'));var hardwareService=require(_0x2b9e('0x12'));var logger=require(_0x2b9e('0x13'))(_0x2b9e('0x14'));var utils=require(_0x2b9e('0x15'));var config=require(_0x2b9e('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x2b9e('0x17'))['db'];function respondWithStatusCode(_0x158704,_0x306413){_0x306413=_0x306413||0xcc;return function(_0x503b5f){if(_0x503b5f){return _0x158704[_0x2b9e('0x18')](_0x306413);}return _0x158704[_0x2b9e('0x19')](_0x306413)[_0x2b9e('0x1a')]();};}function respondWithResult(_0x3d5e27,_0x39af68){_0x39af68=_0x39af68||0xc8;return function(_0x3b3d72){if(_0x3b3d72){return _0x3d5e27[_0x2b9e('0x19')](_0x39af68)[_0x2b9e('0x1b')](_0x3b3d72);}};}function respondWithFilteredResult(_0x23b30e,_0x4fc7bb){return function(_0x5980bf){if(_0x5980bf){var _0x5b89c8=typeof _0x4fc7bb[_0x2b9e('0x1c')]===_0x2b9e('0x1d')&&typeof _0x4fc7bb[_0x2b9e('0x1e')]===_0x2b9e('0x1d');var _0xfb6d01=_0x5980bf['count'];var _0x5effa9=_0x5b89c8?0x0:_0x4fc7bb[_0x2b9e('0x1c')];var _0x4f5ab6=_0x5b89c8?_0x5980bf[_0x2b9e('0x1f')]:_0x4fc7bb['offset']+_0x4fc7bb['limit'];var _0x524de7;if(_0x4f5ab6>=_0xfb6d01){_0x4f5ab6=_0xfb6d01;_0x524de7=0xc8;}else{_0x524de7=0xce;}_0x23b30e[_0x2b9e('0x19')](_0x524de7);return _0x23b30e['set'](_0x2b9e('0x20'),_0x5effa9+'-'+_0x4f5ab6+'/'+_0xfb6d01)[_0x2b9e('0x1b')](_0x5980bf);}return null;};}function patchUpdates(_0x2c24eb){return function(_0x18a7a2){try{jsonpatch[_0x2b9e('0x21')](_0x18a7a2,_0x2c24eb,!![]);}catch(_0xf47301){return BPromise[_0x2b9e('0x22')](_0xf47301);}return _0x18a7a2[_0x2b9e('0x23')]();};}function saveUpdates(_0x52e61e,_0xebe5f8){return function(_0x5e18b6){if(_0x5e18b6){return _0x5e18b6[_0x2b9e('0x24')](_0x52e61e)[_0x2b9e('0x25')](function(_0x41a476){return _0x41a476;});}return null;};}function removeEntity(_0x4a27fa,_0x3c8418){return function(_0xea3dfc){if(_0xea3dfc){return _0xea3dfc[_0x2b9e('0x26')]()['then'](function(){_0x4a27fa[_0x2b9e('0x19')](0xcc)[_0x2b9e('0x1a')]();});}};}function handleEntityNotFound(_0x1069ef,_0x163fab){return function(_0x130a7){if(!_0x130a7){_0x1069ef[_0x2b9e('0x18')](0x194);}return _0x130a7;};}function handleError(_0x1a3f2f,_0x467539){_0x467539=_0x467539||0x1f4;return function(_0x1ceafd){logger['error'](_0x1ceafd[_0x2b9e('0x27')]);if(_0x1ceafd['name']){delete _0x1ceafd['name'];}_0x1a3f2f[_0x2b9e('0x19')](_0x467539)[_0x2b9e('0x28')](_0x1ceafd);};}exports[_0x2b9e('0x29')]=function(_0x2effa5,_0x5550e4){var _0x2d9825={},_0x42b5b6={},_0xdf9154={'count':0x0,'rows':[]};var _0x4c7820=_[_0x2b9e('0x2a')](db[_0x2b9e('0x2b')][_0x2b9e('0x2c')],function(_0x964331){return{'name':_0x964331[_0x2b9e('0x2d')],'type':_0x964331[_0x2b9e('0x2e')][_0x2b9e('0x2f')]};});_0x42b5b6[_0x2b9e('0x30')]=_[_0x2b9e('0x2a')](_0x4c7820,'name');_0x42b5b6[_0x2b9e('0x31')]=_['keys'](_0x2effa5[_0x2b9e('0x31')]);_0x42b5b6['filters']=_['intersection'](_0x42b5b6[_0x2b9e('0x30')],_0x42b5b6[_0x2b9e('0x31')]);_0x2d9825[_0x2b9e('0x32')]=_[_0x2b9e('0x33')](_0x42b5b6[_0x2b9e('0x30')],qs[_0x2b9e('0x34')](_0x2effa5[_0x2b9e('0x31')][_0x2b9e('0x34')]));_0x2d9825[_0x2b9e('0x32')]=_0x2d9825[_0x2b9e('0x32')]['length']?_0x2d9825[_0x2b9e('0x32')]:_0x42b5b6[_0x2b9e('0x30')];if(!_0x2effa5['query'][_0x2b9e('0x35')](_0x2b9e('0x36'))){_0x2d9825[_0x2b9e('0x1e')]=qs[_0x2b9e('0x1e')](_0x2effa5[_0x2b9e('0x31')][_0x2b9e('0x1e')]);_0x2d9825[_0x2b9e('0x1c')]=qs[_0x2b9e('0x1c')](_0x2effa5[_0x2b9e('0x31')]['offset']);}_0x2d9825[_0x2b9e('0x37')]=qs[_0x2b9e('0x38')](_0x2effa5['query']['sort']);_0x2d9825['where']=qs['filters'](_['pick'](_0x2effa5[_0x2b9e('0x31')],_0x42b5b6[_0x2b9e('0x39')]),_0x4c7820);if(_0x2effa5['query']['filter']){_0x2d9825[_0x2b9e('0x3a')]=_[_0x2b9e('0x3b')](_0x2d9825[_0x2b9e('0x3a')],{'$or':_[_0x2b9e('0x2a')](_0x4c7820,function(_0x278b44){if(_0x278b44[_0x2b9e('0x2e')]!=='VIRTUAL'){var _0x362c86={};_0x362c86[_0x278b44[_0x2b9e('0x3c')]]={'$like':'%'+_0x2effa5['query'][_0x2b9e('0x3d')]+'%'};return _0x362c86;}})});}_0x2d9825=_[_0x2b9e('0x3b')]({},_0x2d9825,_0x2effa5['options']);var _0xf4b04a={'where':_0x2d9825[_0x2b9e('0x3a')]};return db[_0x2b9e('0x2b')]['count'](_0xf4b04a)[_0x2b9e('0x25')](function(_0xd71b8a){_0xdf9154[_0x2b9e('0x1f')]=_0xd71b8a;if(_0x2effa5[_0x2b9e('0x31')][_0x2b9e('0x3e')]){_0x2d9825[_0x2b9e('0x3f')]=[{'all':!![]}];}return db[_0x2b9e('0x2b')][_0x2b9e('0x40')](_0x2d9825);})['then'](function(_0x5d0e93){_0xdf9154[_0x2b9e('0x41')]=_0x5d0e93;return _0xdf9154;})[_0x2b9e('0x25')](respondWithFilteredResult(_0x5550e4,_0x2d9825))[_0x2b9e('0x42')](handleError(_0x5550e4,null));};exports['show']=function(_0x372c12,_0x5c035b){var _0x5ed2c8={'raw':![],'where':{'id':_0x372c12[_0x2b9e('0x43')]['id']}},_0x5a5d8b={};_0x5a5d8b['model']=_['keys'](db[_0x2b9e('0x2b')][_0x2b9e('0x2c')]);_0x5a5d8b[_0x2b9e('0x31')]=_[_0x2b9e('0x44')](_0x372c12[_0x2b9e('0x31')]);_0x5a5d8b['filters']=_[_0x2b9e('0x33')](_0x5a5d8b[_0x2b9e('0x30')],_0x5a5d8b[_0x2b9e('0x31')]);_0x5ed2c8[_0x2b9e('0x32')]=_['intersection'](_0x5a5d8b[_0x2b9e('0x30')],qs['fields'](_0x372c12[_0x2b9e('0x31')]['fields']));_0x5ed2c8[_0x2b9e('0x32')]=_0x5ed2c8[_0x2b9e('0x32')]['length']?_0x5ed2c8[_0x2b9e('0x32')]:_0x5a5d8b[_0x2b9e('0x30')];if(_0x372c12[_0x2b9e('0x31')][_0x2b9e('0x3e')]){_0x5ed2c8[_0x2b9e('0x3f')]=[{'all':!![]}];}_0x5ed2c8=_[_0x2b9e('0x3b')]({},_0x5ed2c8,_0x372c12[_0x2b9e('0x45')]);return db['UserProfileSection'][_0x2b9e('0x46')](_0x5ed2c8)[_0x2b9e('0x25')](handleEntityNotFound(_0x5c035b,null))[_0x2b9e('0x25')](respondWithResult(_0x5c035b,null))['catch'](handleError(_0x5c035b,null));};exports[_0x2b9e('0x47')]=function(_0x11776b,_0x1a93af){return db[_0x2b9e('0x2b')]['create'](_0x11776b['body'],{})[_0x2b9e('0x25')](respondWithResult(_0x1a93af,0xc9))[_0x2b9e('0x42')](handleError(_0x1a93af,null));};exports[_0x2b9e('0x24')]=function(_0x28581c,_0x372cb0){if(_0x28581c['body']['id']){delete _0x28581c[_0x2b9e('0x48')]['id'];}return db[_0x2b9e('0x2b')]['find']({'where':{'id':_0x28581c[_0x2b9e('0x43')]['id']}})[_0x2b9e('0x25')](handleEntityNotFound(_0x372cb0,null))[_0x2b9e('0x25')](saveUpdates(_0x28581c[_0x2b9e('0x48')],null))[_0x2b9e('0x25')](respondWithResult(_0x372cb0,null))['catch'](handleError(_0x372cb0,null));};exports['destroy']=function(_0xbdbaea,_0x156f55){return db[_0x2b9e('0x2b')][_0x2b9e('0x46')]({'where':{'id':_0xbdbaea[_0x2b9e('0x43')]['id']}})['then'](handleEntityNotFound(_0x156f55,null))[_0x2b9e('0x25')](removeEntity(_0x156f55,null))[_0x2b9e('0x42')](handleError(_0x156f55,null));};exports['describe']=function(_0x16a452,_0x4e615f){return db['UserProfileSection'][_0x2b9e('0x49')]()[_0x2b9e('0x25')](respondWithResult(_0x4e615f,null))[_0x2b9e('0x42')](handleError(_0x4e615f,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index e62d1db..393a280 100644 --- a/server/api/userProfileSection/userProfileSection.model.js +++ b/server/api/userProfileSection/userProfileSection.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbe9e=['path','rimraf','UserProfileSection','compositeIndex','userProfileId','lodash','util','api','bluebird','request-promise'];(function(_0x57e239,_0x19e557){var _0x57025b=function(_0x33d16e){while(--_0x33d16e){_0x57e239['push'](_0x57e239['shift']());}};_0x57025b(++_0x19e557);}(_0xbe9e,0x11d));var _0xebe9=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xbe9e[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xebe9('0x0'));var util=require(_0xebe9('0x1'));var logger=require('../../config/logger')(_0xebe9('0x2'));var moment=require('moment');var BPromise=require(_0xebe9('0x3'));var rp=require(_0xebe9('0x4'));var fs=require('fs');var path=require(_0xebe9('0x5'));var rimraf=require(_0xebe9('0x6'));var config=require('../../config/environment');var attributes=require('./userProfileSection.attributes');module['exports']=function(_0x530f66,_0x2ca911){return _0x530f66['define'](_0xebe9('0x7'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0xebe9('0x8'),'fields':['sectionId',_0xebe9('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd826=['lodash','util','api','moment','bluebird','path','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId'];(function(_0x41508a,_0xf373a0){var _0x27872b=function(_0x38dac2){while(--_0x38dac2){_0x41508a['push'](_0x41508a['shift']());}};_0x27872b(++_0xf373a0);}(_0xd826,0x1c2));var _0x6d82=function(_0x25f98f,_0x51fd24){_0x25f98f=_0x25f98f-0x0;var _0x37b870=_0xd826[_0x25f98f];return _0x37b870;};'use strict';var _=require(_0x6d82('0x0'));var util=require(_0x6d82('0x1'));var logger=require('../../config/logger')(_0x6d82('0x2'));var moment=require(_0x6d82('0x3'));var BPromise=require(_0x6d82('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6d82('0x5'));var rimraf=require('rimraf');var config=require(_0x6d82('0x6'));var attributes=require(_0x6d82('0x7'));module[_0x6d82('0x8')]=function(_0x1f8b70,_0x138a70){return _0x1f8b70[_0x6d82('0x9')](_0x6d82('0xa'),attributes,{'tableName':_0x6d82('0xb'),'paranoid':![],'indexes':[{'name':_0x6d82('0xc'),'fields':[_0x6d82('0xd'),_0x6d82('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index d8ce25c..a4e0b5d 100644 --- a/server/api/userProfileSection/userProfileSection.rpc.js +++ b/server/api/userProfileSection/userProfileSection.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8d88=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird'];(function(_0x11860e,_0x38e69f){var _0x3a49fc=function(_0x511907){while(--_0x511907){_0x11860e['push'](_0x11860e['shift']());}};_0x3a49fc(++_0x38e69f);}(_0x8d88,0x1be));var _0x88d8=function(_0x3ad133,_0x377068){_0x3ad133=_0x3ad133-0x0;var _0x33b86a=_0x8d88[_0x3ad133];return _0x33b86a;};'use strict';var _=require(_0x88d8('0x0'));var util=require(_0x88d8('0x1'));var moment=require(_0x88d8('0x2'));var BPromise=require(_0x88d8('0x3'));var rs=require(_0x88d8('0x4'));var fs=require('fs');var Redis=require(_0x88d8('0x5'));var db=require(_0x88d8('0x6'))['db'];var utils=require(_0x88d8('0x7'));var logger=require(_0x88d8('0x8'))(_0x88d8('0x9'));var config=require(_0x88d8('0xa'));var jayson=require(_0x88d8('0xb'));var client=jayson[_0x88d8('0xc')][_0x88d8('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x53b9c9,_0x4e9836,_0x508641){return new BPromise(function(_0x2aa2f3,_0x595b73){return client[_0x88d8('0xe')](_0x53b9c9,_0x508641)[_0x88d8('0xf')](function(_0x46e060){logger[_0x88d8('0x10')](_0x88d8('0x11'),_0x4e9836,_0x88d8('0x12'));logger[_0x88d8('0x13')](_0x88d8('0x14'),_0x4e9836,_0x88d8('0x12'),JSON['stringify'](_0x46e060));if(_0x46e060[_0x88d8('0x15')]){if(_0x46e060['error'][_0x88d8('0x16')]===0x1f4){logger[_0x88d8('0x15')](_0x88d8('0x11'),_0x4e9836,_0x46e060['error'][_0x88d8('0x17')]);return _0x595b73(_0x46e060[_0x88d8('0x15')][_0x88d8('0x17')]);}logger[_0x88d8('0x15')](_0x88d8('0x11'),_0x4e9836,_0x46e060['error'][_0x88d8('0x17')]);return _0x2aa2f3(_0x46e060['error'][_0x88d8('0x17')]);}else{logger[_0x88d8('0x10')](_0x88d8('0x11'),_0x4e9836,_0x88d8('0x12'));_0x2aa2f3(_0x46e060[_0x88d8('0x18')]['message']);}})['catch'](function(_0x115f7b){logger[_0x88d8('0x15')](_0x88d8('0x11'),_0x4e9836,_0x115f7b);_0x595b73(_0x115f7b);});});} \ No newline at end of file +var _0x2122=['jayson/promise','http','request','then','info','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','UserProfileSection,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xd4c816,_0x4f7d84){var _0x3fbbb1=function(_0x48eeaa){while(--_0x48eeaa){_0xd4c816['push'](_0xd4c816['shift']());}};_0x3fbbb1(++_0x4f7d84);}(_0x2122,0x167));var _0x2212=function(_0x1b1aee,_0x57c8ed){_0x1b1aee=_0x1b1aee-0x0;var _0x276aa2=_0x2122[_0x1b1aee];return _0x276aa2;};'use strict';var _=require(_0x2212('0x0'));var util=require(_0x2212('0x1'));var moment=require(_0x2212('0x2'));var BPromise=require(_0x2212('0x3'));var rs=require(_0x2212('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2212('0x5'));var logger=require(_0x2212('0x6'))(_0x2212('0x7'));var config=require(_0x2212('0x8'));var jayson=require(_0x2212('0x9'));var client=jayson['client'][_0x2212('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd515b6,_0xb95199,_0x180fd7){return new BPromise(function(_0x23c954,_0xdd92d5){return client[_0x2212('0xb')](_0xd515b6,_0x180fd7)[_0x2212('0xc')](function(_0x3b2990){logger[_0x2212('0xd')]('UserProfileSection,\x20%s,\x20%s',_0xb95199,'request\x20sent');logger[_0x2212('0xe')](_0x2212('0xf'),_0xb95199,_0x2212('0x10'),JSON['stringify'](_0x3b2990));if(_0x3b2990[_0x2212('0x11')]){if(_0x3b2990[_0x2212('0x11')][_0x2212('0x12')]===0x1f4){logger[_0x2212('0x11')](_0x2212('0x13'),_0xb95199,_0x3b2990[_0x2212('0x11')][_0x2212('0x14')]);return _0xdd92d5(_0x3b2990[_0x2212('0x11')][_0x2212('0x14')]);}logger[_0x2212('0x11')](_0x2212('0x13'),_0xb95199,_0x3b2990[_0x2212('0x11')][_0x2212('0x14')]);return _0x23c954(_0x3b2990[_0x2212('0x11')][_0x2212('0x14')]);}else{logger[_0x2212('0xd')](_0x2212('0x13'),_0xb95199,_0x2212('0x10'));_0x23c954(_0x3b2990[_0x2212('0x15')]['message']);}})[_0x2212('0x16')](function(_0x550e8b){logger[_0x2212('0x11')](_0x2212('0x13'),_0xb95199,_0x550e8b);_0xdd92d5(_0x550e8b);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index f3451e4..b3ed9eb 100644 --- a/server/api/userSmsQueue/index.js +++ b/server/api/userSmsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x40c281,_0x48018b){var _0x350b73=function(_0x55dfc2){while(--_0x55dfc2){_0x40c281['push'](_0x40c281['shift']());}};_0x350b73(++_0x48018b);}(_0x70e0,0x17b));var _0x070e=function(_0x240ed0,_0x476512){_0x240ed0=_0x240ed0-0x0;var _0xc08f71=_0x70e0[_0x240ed0];return _0xc08f71;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x540a5f,_0x4b38af){var _0x4bc3a3=function(_0x2183cc){while(--_0x2183cc){_0x540a5f['push'](_0x540a5f['shift']());}};_0x4bc3a3(++_0x4b38af);}(_0xe706,0xa3));var _0x6e70=function(_0x12b1a6,_0x22df2d){_0x12b1a6=_0x12b1a6-0x0;var _0x5813d3=_0xe706[_0x12b1a6];return _0x5813d3;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 3fa58a5..4e886c9 100644 --- a/server/api/userSmsQueue/userSmsQueue.attributes.js +++ b/server/api/userSmsQueue/userSmsQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb646=['exports','INTEGER','sequelize'];(function(_0x4a010b,_0x3523b3){var _0xe0b19b=function(_0x68b0bb){while(--_0x68b0bb){_0x4a010b['push'](_0x4a010b['shift']());}};_0xe0b19b(++_0x3523b3);}(_0xb646,0x83));var _0x6b64=function(_0x343bd9,_0x5691e8){_0x343bd9=_0x343bd9-0x0;var _0x573c69=_0xb646[_0x343bd9];return _0x573c69;};'use strict';var Sequelize=require(_0x6b64('0x0'));module[_0x6b64('0x1')]={'penalty':{'type':Sequelize[_0x6b64('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb018=['exports','sequelize'];(function(_0x4c8a8f,_0x997ef){var _0x404500=function(_0x1c6072){while(--_0x1c6072){_0x4c8a8f['push'](_0x4c8a8f['shift']());}};_0x404500(++_0x997ef);}(_0xb018,0x6b));var _0x8b01=function(_0x534c16,_0x35a388){_0x534c16=_0x534c16-0x0;var _0x4717ca=_0xb018[_0x534c16];return _0x4717ca;};'use strict';var Sequelize=require(_0x8b01('0x0'));module[_0x8b01('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 87fe4bc..c86d638 100644 --- a/server/api/userSmsQueue/userSmsQueue.model.js +++ b/server/api/userSmsQueue/userSmsQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4bd3=['exports','define','UserSmsQueue','lodash','../../config/logger','api','path','rimraf','../../config/environment'];(function(_0x118a26,_0x3326bb){var _0x1624c1=function(_0x242089){while(--_0x242089){_0x118a26['push'](_0x118a26['shift']());}};_0x1624c1(++_0x3326bb);}(_0x4bd3,0x174));var _0x34bd=function(_0x407883,_0x10a193){_0x407883=_0x407883-0x0;var _0x402503=_0x4bd3[_0x407883];return _0x402503;};'use strict';var _=require(_0x34bd('0x0'));var util=require('util');var logger=require(_0x34bd('0x1'))(_0x34bd('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x34bd('0x3'));var rimraf=require(_0x34bd('0x4'));var config=require(_0x34bd('0x5'));var attributes=require('./userSmsQueue.attributes');module[_0x34bd('0x6')]=function(_0x2a15a2,_0x5c2a7a){return _0x2a15a2[_0x34bd('0x7')](_0x34bd('0x8'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa37=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','user_has_sms_queues','lodash'];(function(_0x7e2ae0,_0x1a46fd){var _0xbe75e8=function(_0xce88b1){while(--_0xce88b1){_0x7e2ae0['push'](_0x7e2ae0['shift']());}};_0xbe75e8(++_0x1a46fd);}(_0xaa37,0x1d3));var _0x7aa3=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xaa37[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require(_0x7aa3('0x0'));var util=require(_0x7aa3('0x1'));var logger=require(_0x7aa3('0x2'))(_0x7aa3('0x3'));var moment=require('moment');var BPromise=require(_0x7aa3('0x4'));var rp=require(_0x7aa3('0x5'));var fs=require('fs');var path=require(_0x7aa3('0x6'));var rimraf=require(_0x7aa3('0x7'));var config=require(_0x7aa3('0x8'));var attributes=require(_0x7aa3('0x9'));module[_0x7aa3('0xa')]=function(_0x5b738a,_0x437b90){return _0x5b738a[_0x7aa3('0xb')]('UserSmsQueue',attributes,{'tableName':_0x7aa3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index bbbc161..64f402d 100644 --- a/server/api/userSmsQueue/userSmsQueue.rpc.js +++ b/server/api/userSmsQueue/userSmsQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe9f5=['jayson/promise','client','http','request','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','message','error','result','catch','util','bluebird','../../config/utils','../../config/environment'];(function(_0x11315f,_0x4eabdd){var _0xb4c69c=function(_0x2773ea){while(--_0x2773ea){_0x11315f['push'](_0x11315f['shift']());}};_0xb4c69c(++_0x4eabdd);}(_0xe9f5,0x1a5));var _0x5e9f=function(_0xc74e59,_0xdec86b){_0xc74e59=_0xc74e59-0x0;var _0x125171=_0xe9f5[_0xc74e59];return _0x125171;};'use strict';var _=require('lodash');var util=require(_0x5e9f('0x0'));var moment=require('moment');var BPromise=require(_0x5e9f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5e9f('0x2'));var logger=require('../../config/logger')('rpc');var config=require(_0x5e9f('0x3'));var jayson=require(_0x5e9f('0x4'));var client=jayson[_0x5e9f('0x5')][_0x5e9f('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x225d44,_0x4b61db,_0xc332f9){return new BPromise(function(_0x2a2742,_0x2d0c43){return client[_0x5e9f('0x7')](_0x225d44,_0xc332f9)['then'](function(_0xe8eba3){logger[_0x5e9f('0x8')](_0x5e9f('0x9'),_0x4b61db,_0x5e9f('0xa'));logger[_0x5e9f('0xb')](_0x5e9f('0xc'),_0x4b61db,'request\x20sent',JSON['stringify'](_0xe8eba3));if(_0xe8eba3['error']){if(_0xe8eba3['error']['code']===0x1f4){logger['error'](_0x5e9f('0x9'),_0x4b61db,_0xe8eba3['error'][_0x5e9f('0xd')]);return _0x2d0c43(_0xe8eba3[_0x5e9f('0xe')][_0x5e9f('0xd')]);}logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x4b61db,_0xe8eba3[_0x5e9f('0xe')][_0x5e9f('0xd')]);return _0x2a2742(_0xe8eba3[_0x5e9f('0xe')]['message']);}else{logger[_0x5e9f('0x8')](_0x5e9f('0x9'),_0x4b61db,_0x5e9f('0xa'));_0x2a2742(_0xe8eba3[_0x5e9f('0xf')][_0x5e9f('0xd')]);}})[_0x5e9f('0x10')](function(_0x3e2364){logger[_0x5e9f('0xe')](_0x5e9f('0x9'),_0x4b61db,_0x3e2364);_0x2d0c43(_0x3e2364);});});} \ No newline at end of file +var _0x4b17=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util'];(function(_0x2806d0,_0xdb865c){var _0x21050e=function(_0x4bb95c){while(--_0x4bb95c){_0x2806d0['push'](_0x2806d0['shift']());}};_0x21050e(++_0xdb865c);}(_0x4b17,0xae));var _0x74b1=function(_0x36b400,_0x277ec5){_0x36b400=_0x36b400-0x0;var _0x4d47bf=_0x4b17[_0x36b400];return _0x4d47bf;};'use strict';var _=require(_0x74b1('0x0'));var util=require(_0x74b1('0x1'));var moment=require(_0x74b1('0x2'));var BPromise=require(_0x74b1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x74b1('0x4'));var db=require(_0x74b1('0x5'))['db'];var utils=require(_0x74b1('0x6'));var logger=require(_0x74b1('0x7'))(_0x74b1('0x8'));var config=require(_0x74b1('0x9'));var jayson=require(_0x74b1('0xa'));var client=jayson[_0x74b1('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3db6be,_0x1c44e2,_0x227db3){return new BPromise(function(_0xe9ef39,_0x54cdc7){return client['request'](_0x3db6be,_0x227db3)[_0x74b1('0xc')](function(_0x3acfa9){logger['info'](_0x74b1('0xd'),_0x1c44e2,_0x74b1('0xe'));logger[_0x74b1('0xf')](_0x74b1('0x10'),_0x1c44e2,_0x74b1('0xe'),JSON[_0x74b1('0x11')](_0x3acfa9));if(_0x3acfa9[_0x74b1('0x12')]){if(_0x3acfa9[_0x74b1('0x12')][_0x74b1('0x13')]===0x1f4){logger[_0x74b1('0x12')](_0x74b1('0xd'),_0x1c44e2,_0x3acfa9[_0x74b1('0x12')][_0x74b1('0x14')]);return _0x54cdc7(_0x3acfa9['error'][_0x74b1('0x14')]);}logger[_0x74b1('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x1c44e2,_0x3acfa9[_0x74b1('0x12')][_0x74b1('0x14')]);return _0xe9ef39(_0x3acfa9[_0x74b1('0x12')][_0x74b1('0x14')]);}else{logger['info'](_0x74b1('0xd'),_0x1c44e2,_0x74b1('0xe'));_0xe9ef39(_0x3acfa9['result'][_0x74b1('0x14')]);}})[_0x74b1('0x15')](function(_0x189819){logger[_0x74b1('0x12')](_0x74b1('0xd'),_0x1c44e2,_0x189819);_0x54cdc7(_0x189819);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 373ef38..82a62d5 100644 --- a/server/api/userVoicePrefix/userVoicePrefix.attributes.js +++ b/server/api/userVoicePrefix/userVoicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6141=['exports','INTEGER','sequelize'];(function(_0x2dff37,_0x497f07){var _0x155983=function(_0x506770){while(--_0x506770){_0x2dff37['push'](_0x2dff37['shift']());}};_0x155983(++_0x497f07);}(_0x6141,0x95));var _0x1614=function(_0x558308,_0x5bd50e){_0x558308=_0x558308-0x0;var _0x329acc=_0x6141[_0x558308];return _0x329acc;};'use strict';var Sequelize=require(_0x1614('0x0'));module[_0x1614('0x1')]={'UserId':{'type':Sequelize[_0x1614('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x1614('0x2')]}}; \ No newline at end of file +var _0x27d8=['exports','INTEGER','sequelize'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x27d8,0x1eb));var _0x827d=function(_0x178668,_0x1ec300){_0x178668=_0x178668-0x0;var _0x26107d=_0x27d8[_0x178668];return _0x26107d;};'use strict';var Sequelize=require(_0x827d('0x0'));module[_0x827d('0x1')]={'UserId':{'type':Sequelize[_0x827d('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index c2dfa69..9cf7b80 100644 --- a/server/api/userVoicePrefix/userVoicePrefix.model.js +++ b/server/api/userVoicePrefix/userVoicePrefix.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x3d258b,_0x103ba8){var _0x1b48cb=function(_0x5bcb97){while(--_0x5bcb97){_0x3d258b['push'](_0x3d258b['shift']());}};_0x1b48cb(++_0x103ba8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x1581d6,_0x36a450){var _0x3028f9=function(_0x5ef198){while(--_0x5ef198){_0x1581d6['push'](_0x1581d6['shift']());}};_0x3028f9(++_0x36a450);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 04c7fb3..6d64a64 100644 --- a/server/api/userVoiceQueue/index.js +++ b/server/api/userVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x368abc,_0x8bbc6f){var _0x2fd9f0=function(_0x129756){while(--_0x129756){_0x368abc['push'](_0x368abc['shift']());}};_0x2fd9f0(++_0x8bbc6f);}(_0x9c44,0x178));var _0x49c4=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x9c44[_0x334841];return _0x5beb4b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x4c943f,_0x25b583){var _0x4a3dde=function(_0x4ff49a){while(--_0x4ff49a){_0x4c943f['push'](_0x4c943f['shift']());}};_0x4a3dde(++_0x25b583);}(_0x70e0,0x17b));var _0x070e=function(_0xe93165,_0x32b5e6){_0xe93165=_0xe93165-0x0;var _0x39aeca=_0x70e0[_0xe93165];return _0x39aeca;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 0510fe7..f8cfce9 100644 --- a/server/api/userVoiceQueue/userVoiceQueue.attributes.js +++ b/server/api/userVoiceQueue/userVoiceQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7244=['sequelize','exports','INTEGER'];(function(_0x55c55d,_0x44107a){var _0x219eab=function(_0x554462){while(--_0x554462){_0x55c55d['push'](_0x55c55d['shift']());}};_0x219eab(++_0x44107a);}(_0x7244,0xf6));var _0x4724=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x7244[_0x178e48];return _0x440d7e;};'use strict';var Sequelize=require(_0x4724('0x0'));module[_0x4724('0x1')]={'penalty':{'type':Sequelize[_0x4724('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8833=['INTEGER','sequelize','exports'];(function(_0x4d76c5,_0x2572c1){var _0x34dac4=function(_0x334684){while(--_0x334684){_0x4d76c5['push'](_0x4d76c5['shift']());}};_0x34dac4(++_0x2572c1);}(_0x8833,0xb5));var _0x3883=function(_0x3f868b,_0x503f9c){_0x3f868b=_0x3f868b-0x0;var _0x19bc99=_0x8833[_0x3f868b];return _0x19bc99;};'use strict';var Sequelize=require(_0x3883('0x0'));module[_0x3883('0x1')]={'penalty':{'type':Sequelize[_0x3883('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 8d69805..4fd265e 100644 --- a/server/api/userVoiceQueue/userVoiceQueue.model.js +++ b/server/api/userVoiceQueue/userVoiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaa6d=['path','../../config/environment','./userVoiceQueue.attributes','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api','moment'];(function(_0x10dcd1,_0x38b131){var _0x4b4c6a=function(_0x2dcdc7){while(--_0x2dcdc7){_0x10dcd1['push'](_0x10dcd1['shift']());}};_0x4b4c6a(++_0x38b131);}(_0xaa6d,0x9b));var _0xdaa6=function(_0x49f839,_0x5a8382){_0x49f839=_0x49f839-0x0;var _0x60a229=_0xaa6d[_0x49f839];return _0x60a229;};'use strict';var _=require(_0xdaa6('0x0'));var util=require(_0xdaa6('0x1'));var logger=require(_0xdaa6('0x2'))(_0xdaa6('0x3'));var moment=require(_0xdaa6('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdaa6('0x5'));var rimraf=require('rimraf');var config=require(_0xdaa6('0x6'));var attributes=require(_0xdaa6('0x7'));module['exports']=function(_0x12bcb8,_0x43b41d){return _0x12bcb8['define'](_0xdaa6('0x8'),attributes,{'tableName':_0xdaa6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b59=['user_has_voice_queues','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1b59,0x83));var _0x91b5=function(_0x307f72,_0x32fba4){_0x307f72=_0x307f72-0x0;var _0x10f2c6=_0x1b59[_0x307f72];return _0x10f2c6;};'use strict';var _=require(_0x91b5('0x0'));var util=require(_0x91b5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x91b5('0x2'));var BPromise=require(_0x91b5('0x3'));var rp=require(_0x91b5('0x4'));var fs=require('fs');var path=require(_0x91b5('0x5'));var rimraf=require(_0x91b5('0x6'));var config=require(_0x91b5('0x7'));var attributes=require(_0x91b5('0x8'));module[_0x91b5('0x9')]=function(_0x175665,_0x2000ed){return _0x175665[_0x91b5('0xa')](_0x91b5('0xb'),attributes,{'tableName':_0x91b5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 26ef817..7e910e9 100644 --- a/server/api/userVoiceQueue/userVoiceQueue.rpc.js +++ b/server/api/userVoiceQueue/userVoiceQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeb39=['error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s'];(function(_0x2d3c42,_0x682053){var _0x51e8e0=function(_0x5261a3){while(--_0x5261a3){_0x2d3c42['push'](_0x2d3c42['shift']());}};_0x51e8e0(++_0x682053);}(_0xeb39,0x100));var _0x9eb3=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0xeb39[_0x5317b5];return _0x3b7ce2;};'use strict';var _=require(_0x9eb3('0x0'));var util=require(_0x9eb3('0x1'));var moment=require(_0x9eb3('0x2'));var BPromise=require(_0x9eb3('0x3'));var rs=require(_0x9eb3('0x4'));var fs=require('fs');var Redis=require(_0x9eb3('0x5'));var db=require(_0x9eb3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9eb3('0x7'))(_0x9eb3('0x8'));var config=require(_0x9eb3('0x9'));var jayson=require(_0x9eb3('0xa'));var client=jayson[_0x9eb3('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a7c68,_0x217dba,_0x394f46){return new BPromise(function(_0x258528,_0x1b5b0e){return client['request'](_0x1a7c68,_0x394f46)['then'](function(_0x2233e6){logger[_0x9eb3('0xc')](_0x9eb3('0xd'),_0x217dba,_0x9eb3('0xe'));logger[_0x9eb3('0xf')](_0x9eb3('0x10'),_0x217dba,_0x9eb3('0xe'),JSON['stringify'](_0x2233e6));if(_0x2233e6[_0x9eb3('0x11')]){if(_0x2233e6[_0x9eb3('0x11')]['code']===0x1f4){logger[_0x9eb3('0x11')](_0x9eb3('0xd'),_0x217dba,_0x2233e6[_0x9eb3('0x11')]['message']);return _0x1b5b0e(_0x2233e6[_0x9eb3('0x11')][_0x9eb3('0x12')]);}logger[_0x9eb3('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x217dba,_0x2233e6['error']['message']);return _0x258528(_0x2233e6[_0x9eb3('0x11')][_0x9eb3('0x12')]);}else{logger[_0x9eb3('0xc')](_0x9eb3('0xd'),_0x217dba,_0x9eb3('0xe'));_0x258528(_0x2233e6[_0x9eb3('0x13')][_0x9eb3('0x12')]);}})[_0x9eb3('0x14')](function(_0x4f3e06){logger['error'](_0x9eb3('0xd'),_0x217dba,_0x4f3e06);_0x1b5b0e(_0x4f3e06);});});} \ No newline at end of file +var _0x01c1=['UserVoiceQueue,\x20%s,\x20%s','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x48c3f9,_0x47b31f){var _0x383a23=function(_0x23b27a){while(--_0x23b27a){_0x48c3f9['push'](_0x48c3f9['shift']());}};_0x383a23(++_0x47b31f);}(_0x01c1,0xc7));var _0x101c=function(_0x38124f,_0x23399a){_0x38124f=_0x38124f-0x0;var _0x30c359=_0x01c1[_0x38124f];return _0x30c359;};'use strict';var _=require(_0x101c('0x0'));var util=require(_0x101c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x101c('0x2'));var fs=require('fs');var Redis=require(_0x101c('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x101c('0x4'));var jayson=require(_0x101c('0x5'));var client=jayson[_0x101c('0x6')][_0x101c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x34e411,_0x553b58,_0x5ce18a){return new BPromise(function(_0x429847,_0x9bacaf){return client[_0x101c('0x8')](_0x34e411,_0x5ce18a)[_0x101c('0x9')](function(_0x2249a4){logger['info'](_0x101c('0xa'),_0x553b58,_0x101c('0xb'));logger['debug'](_0x101c('0xc'),_0x553b58,'request\x20sent',JSON[_0x101c('0xd')](_0x2249a4));if(_0x2249a4[_0x101c('0xe')]){if(_0x2249a4[_0x101c('0xe')][_0x101c('0xf')]===0x1f4){logger[_0x101c('0xe')](_0x101c('0xa'),_0x553b58,_0x2249a4[_0x101c('0xe')][_0x101c('0x10')]);return _0x9bacaf(_0x2249a4['error'][_0x101c('0x10')]);}logger['error'](_0x101c('0xa'),_0x553b58,_0x2249a4[_0x101c('0xe')][_0x101c('0x10')]);return _0x429847(_0x2249a4[_0x101c('0xe')]['message']);}else{logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0x553b58,_0x101c('0xb'));_0x429847(_0x2249a4[_0x101c('0x11')]['message']);}})[_0x101c('0x12')](function(_0x385c75){logger[_0x101c('0xe')](_0x101c('0xa'),_0x553b58,_0x385c75);_0x9bacaf(_0x385c75);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index b2311fd..f932266 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x5b767d,_0x30f31c){var _0x11ee86=function(_0xf05263){while(--_0xf05263){_0x5b767d['push'](_0x5b767d['shift']());}};_0x11ee86(++_0x30f31c);}(_0x70e0,0x17b));var _0x070e=function(_0x21e804,_0x13ad4c){_0x21e804=_0x21e804-0x0;var _0x514de4=_0x70e0[_0x21e804];return _0x514de4;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4a0fc8,_0x29b08a){var _0x519804=function(_0x274c58){while(--_0x274c58){_0x4a0fc8['push'](_0x4a0fc8['shift']());}};_0x519804(++_0x29b08a);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index d041f26..56392e0 100644 --- a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js +++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe35c=['STRING','queue_interface','sequelize','exports','INTEGER','Required\x20by\x20Asterisk'];(function(_0x3fe6af,_0x282deb){var _0x53a5cd=function(_0x1c477e){while(--_0x1c477e){_0x3fe6af['push'](_0x3fe6af['shift']());}};_0x53a5cd(++_0x282deb);}(_0xe35c,0x146));var _0xce35=function(_0x226880,_0x24c02a){_0x226880=_0x226880-0x0;var _0x3df351=_0xe35c[_0x226880];return _0x3df351;};'use strict';var Sequelize=require(_0xce35('0x0'));module[_0xce35('0x1')]={'uniqueid':{'type':Sequelize[_0xce35('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xce35('0x3')},'membername':{'type':Sequelize[_0xce35('0x4')],'allowNull':![],'comment':_0xce35('0x3')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xce35('0x5'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0xce35('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0xce35('0x4')],'allowNull':![],'unique':_0xce35('0x5'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0xce35('0x2')](0xb),'defaultValue':0x0,'comment':_0xce35('0x3')},'paused':{'type':Sequelize[_0xce35('0x2')](0xb),'defaultValue':0x0,'comment':_0xce35('0x3')}}; \ No newline at end of file +var _0xd89f=['sequelize','exports','Required\x20by\x20Asterisk','STRING','queue_interface','INTEGER'];(function(_0x44c7a5,_0x23e2ac){var _0x2692d3=function(_0x20ef86){while(--_0x20ef86){_0x44c7a5['push'](_0x44c7a5['shift']());}};_0x2692d3(++_0x23e2ac);}(_0xd89f,0x13e));var _0xfd89=function(_0x2a4e37,_0x4bb55d){_0x2a4e37=_0x2a4e37-0x0;var _0x239467=_0xd89f[_0x2a4e37];return _0x239467;};'use strict';var Sequelize=require(_0xfd89('0x0'));module[_0xfd89('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0xfd89('0x2')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0xfd89('0x3')],'allowNull':![],'unique':_0xfd89('0x4'),'comment':_0xfd89('0x2')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xfd89('0x4'),'comment':_0xfd89('0x2')},'penalty':{'type':Sequelize[_0xfd89('0x5')](0xb),'defaultValue':0x0,'comment':_0xfd89('0x2')},'paused':{'type':Sequelize[_0xfd89('0x5')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 0ded5b9..6550fef 100644 --- a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js +++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfe85=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserVoiceQueueRt','save'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xfe85,0x178));var _0x5fe8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfe85[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x5fe8('0x0'));var UserVoiceQueueRt=require(_0x5fe8('0x1'))['db'][_0x5fe8('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5fe8('0x3'),'afterUpdate':_0x5fe8('0x4'),'afterDestroy':_0x5fe8('0x5')};function emitEvent(_0x2b6271){return function(_0x5e59d4,_0x3675c7,_0xda3a40){UserVoiceQueueRtEvents[_0x5fe8('0x6')](_0x2b6271+':'+_0x5e59d4['id'],_0x5e59d4);UserVoiceQueueRtEvents['emit'](_0x2b6271,_0x5e59d4);_0xda3a40(null);};}for(var e in events){if(events[_0x5fe8('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0x5fe8('0x8')](e,emitEvent(event));}}module[_0x5fe8('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x9840=['emit','hasOwnProperty','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','remove'];(function(_0x4145b5,_0x1a41ad){var _0xe11a00=function(_0x36cbb5){while(--_0x36cbb5){_0x4145b5['push'](_0x4145b5['shift']());}};_0xe11a00(++_0x1a41ad);}(_0x9840,0x1da));var _0x0984=function(_0x5b3460,_0x26d2f7){_0x5b3460=_0x5b3460-0x0;var _0x3633d4=_0x9840[_0x5b3460];return _0x3633d4;};'use strict';var EventEmitter=require(_0x0984('0x0'));var UserVoiceQueueRt=require(_0x0984('0x1'))['db'][_0x0984('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x0984('0x3')](0x0);var events={'afterCreate':_0x0984('0x4'),'afterUpdate':'update','afterDestroy':_0x0984('0x5')};function emitEvent(_0x2a7b10){return function(_0xb194ca,_0x5d9fb9,_0x2b41d0){UserVoiceQueueRtEvents[_0x0984('0x6')](_0x2a7b10+':'+_0xb194ca['id'],_0xb194ca);UserVoiceQueueRtEvents['emit'](_0x2a7b10,_0xb194ca);_0x2b41d0(null);};}for(var e in events){if(events[_0x0984('0x7')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 814ec7c..3a414f2 100644 --- a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js +++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeae9=['request-promise','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','user_has_voice_queues_rt','lodash','util','../../config/logger','api','bluebird'];(function(_0x14e3f7,_0x57eac6){var _0x55836d=function(_0x5418be){while(--_0x5418be){_0x14e3f7['push'](_0x14e3f7['shift']());}};_0x55836d(++_0x57eac6);}(_0xeae9,0x7f));var _0x9eae=function(_0x115ef0,_0x5a83b2){_0x115ef0=_0x115ef0-0x0;var _0x420f5a=_0xeae9[_0x115ef0];return _0x420f5a;};'use strict';var _=require(_0x9eae('0x0'));var util=require(_0x9eae('0x1'));var logger=require(_0x9eae('0x2'))(_0x9eae('0x3'));var moment=require('moment');var BPromise=require(_0x9eae('0x4'));var rp=require(_0x9eae('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9eae('0x6'));var config=require(_0x9eae('0x7'));var attributes=require(_0x9eae('0x8'));module[_0x9eae('0x9')]=function(_0x474585,_0x2f1a86){return _0x474585['define']('UserVoiceQueueRt',attributes,{'tableName':_0x9eae('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x57fa=['./userVoiceQueueRt.attributes','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x2d1611,_0x1bbfd5){var _0x13f856=function(_0x542a31){while(--_0x542a31){_0x2d1611['push'](_0x2d1611['shift']());}};_0x13f856(++_0x1bbfd5);}(_0x57fa,0x117));var _0xa57f=function(_0x3f7bd0,_0x954c77){_0x3f7bd0=_0x3f7bd0-0x0;var _0x248243=_0x57fa[_0x3f7bd0];return _0x248243;};'use strict';var _=require(_0xa57f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa57f('0x1'));var moment=require(_0xa57f('0x2'));var BPromise=require(_0xa57f('0x3'));var rp=require(_0xa57f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa57f('0x5'));var config=require(_0xa57f('0x6'));var attributes=require(_0xa57f('0x7'));module['exports']=function(_0x3998eb,_0x34ac72){return _0x3998eb[_0xa57f('0x8')](_0xa57f('0x9'),attributes,{'tableName':_0xa57f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index d43d255..af9521c 100644 --- a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js +++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x85da=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info','debug','error','UserVoiceQueueRt,\x20%s,\x20%s','message','request\x20sent','result','catch','GetVoiceQueueRtPauses','findAll','options','raw','where','sequelize','COUNT','lodash','util','moment'];(function(_0x59f261,_0x4eb1a5){var _0x3c0e46=function(_0x3b8963){while(--_0x3b8963){_0x59f261['push'](_0x59f261['shift']());}};_0x3c0e46(++_0x4eb1a5);}(_0x85da,0x189));var _0xa85d=function(_0x1dbaf7,_0x3d05b3){_0x1dbaf7=_0x1dbaf7-0x0;var _0x593f05=_0x85da[_0x1dbaf7];return _0x593f05;};'use strict';var _=require(_0xa85d('0x0'));var util=require(_0xa85d('0x1'));var moment=require(_0xa85d('0x2'));var BPromise=require(_0xa85d('0x3'));var rs=require(_0xa85d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa85d('0x5'))['db'];var utils=require(_0xa85d('0x6'));var logger=require(_0xa85d('0x7'))(_0xa85d('0x8'));var config=require(_0xa85d('0x9'));var jayson=require(_0xa85d('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0xa85d('0xb')]=_['defaults'](config['redis'],{'host':_0xa85d('0xc'),'port':0x18eb});var socket=require(_0xa85d('0xd'))(new Redis(config[_0xa85d('0xb')]));require(_0xa85d('0xe'))[_0xa85d('0xf')](socket);function respondWithRpcPromise(_0x3fb179,_0x580b36,_0x1d9331){return new BPromise(function(_0x5cd97e,_0x3d8401){return client[_0xa85d('0x10')](_0x3fb179,_0x1d9331)[_0xa85d('0x11')](function(_0x264d3d){logger[_0xa85d('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x580b36,'request\x20sent');logger[_0xa85d('0x13')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x580b36,'request\x20sent',JSON['stringify'](_0x264d3d));if(_0x264d3d[_0xa85d('0x14')]){if(_0x264d3d[_0xa85d('0x14')]['code']===0x1f4){logger[_0xa85d('0x14')](_0xa85d('0x15'),_0x580b36,_0x264d3d[_0xa85d('0x14')]['message']);return _0x3d8401(_0x264d3d[_0xa85d('0x14')]['message']);}logger[_0xa85d('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x580b36,_0x264d3d['error'][_0xa85d('0x16')]);return _0x5cd97e(_0x264d3d[_0xa85d('0x14')]['message']);}else{logger[_0xa85d('0x12')](_0xa85d('0x15'),_0x580b36,_0xa85d('0x17'));_0x5cd97e(_0x264d3d[_0xa85d('0x18')][_0xa85d('0x16')]);}})[_0xa85d('0x19')](function(_0x51e619){logger[_0xa85d('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x580b36,_0x51e619);_0x3d8401(_0x51e619);});});}exports[_0xa85d('0x1a')]=function(_0x16d971){var _0xf7606a=this;return new Promise(function(_0x1c0ca5,_0x22c8cb){return db['UserVoiceQueueRt'][_0xa85d('0x1b')]({'raw':_0x16d971[_0xa85d('0x1c')]?_0x16d971[_0xa85d('0x1c')][_0xa85d('0x1d')]===undefined?!![]:![]:!![],'where':_0x16d971[_0xa85d('0x1c')]?_0x16d971['options'][_0xa85d('0x1e')]||null:null,'attributes':[[db[_0xa85d('0x1f')]['fn'](_0xa85d('0x20'),db[_0xa85d('0x1f')]['fn']('IF',db[_0xa85d('0x1f')]['literal']('`paused`\x20=\x201,\x201,\x20null'))),'outboundQueuePauses']]})[_0xa85d('0x11')](function(_0x313dbc){logger[_0xa85d('0x12')](_0xa85d('0x1a'),_0x16d971);logger[_0xa85d('0x13')](_0xa85d('0x1a'),_0x16d971,JSON['stringify'](_0x313dbc));_0x1c0ca5(_0x313dbc);})[_0xa85d('0x19')](function(_0x3585eb){logger['error'](_0xa85d('0x1a'),_0x3585eb[_0xa85d('0x16')],_0x16d971);_0x22c8cb(_0xf7606a[_0xa85d('0x14')](0x1f4,_0x3585eb[_0xa85d('0x16')]));});});}; \ No newline at end of file +var _0xf407=['debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','findAll','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','then','GetVoiceQueueRtPauses','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','./userVoiceQueueRt.socket','register','request','info','UserVoiceQueueRt,\x20%s,\x20%s'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0xf407,0xab));var _0x7f40=function(_0x96c55d,_0x190a33){_0x96c55d=_0x96c55d-0x0;var _0x21c6c5=_0xf407[_0x96c55d];return _0x21c6c5;};'use strict';var _=require(_0x7f40('0x0'));var util=require(_0x7f40('0x1'));var moment=require('moment');var BPromise=require(_0x7f40('0x2'));var rs=require(_0x7f40('0x3'));var fs=require('fs');var Redis=require(_0x7f40('0x4'));var db=require(_0x7f40('0x5'))['db'];var utils=require(_0x7f40('0x6'));var logger=require(_0x7f40('0x7'))(_0x7f40('0x8'));var config=require(_0x7f40('0x9'));var jayson=require(_0x7f40('0xa'));var client=jayson['client'][_0x7f40('0xb')]({'port':0x232a});config[_0x7f40('0xc')]=_['defaults'](config[_0x7f40('0xc')],{'host':_0x7f40('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7f40('0xc')]));require(_0x7f40('0xe'))[_0x7f40('0xf')](socket);function respondWithRpcPromise(_0x40ae2c,_0x41c1f0,_0x47b428){return new BPromise(function(_0x2be070,_0x32b3cd){return client[_0x7f40('0x10')](_0x40ae2c,_0x47b428)['then'](function(_0x5d3330){logger[_0x7f40('0x11')](_0x7f40('0x12'),_0x41c1f0,'request\x20sent');logger[_0x7f40('0x13')](_0x7f40('0x14'),_0x41c1f0,_0x7f40('0x15'),JSON[_0x7f40('0x16')](_0x5d3330));if(_0x5d3330[_0x7f40('0x17')]){if(_0x5d3330[_0x7f40('0x17')][_0x7f40('0x18')]===0x1f4){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x41c1f0,_0x5d3330[_0x7f40('0x17')][_0x7f40('0x19')]);return _0x32b3cd(_0x5d3330['error'][_0x7f40('0x19')]);}logger[_0x7f40('0x17')](_0x7f40('0x12'),_0x41c1f0,_0x5d3330['error'][_0x7f40('0x19')]);return _0x2be070(_0x5d3330[_0x7f40('0x17')]['message']);}else{logger['info'](_0x7f40('0x12'),_0x41c1f0,'request\x20sent');_0x2be070(_0x5d3330['result'][_0x7f40('0x19')]);}})[_0x7f40('0x1a')](function(_0x44c533){logger[_0x7f40('0x17')](_0x7f40('0x12'),_0x41c1f0,_0x44c533);_0x32b3cd(_0x44c533);});});}exports['GetVoiceQueueRtPauses']=function(_0x88d1fc){var _0x5461cf=this;return new Promise(function(_0x4a94e0,_0x4b04a4){return db['UserVoiceQueueRt'][_0x7f40('0x1b')]({'raw':_0x88d1fc['options']?_0x88d1fc[_0x7f40('0x1c')][_0x7f40('0x1d')]===undefined?!![]:![]:!![],'where':_0x88d1fc[_0x7f40('0x1c')]?_0x88d1fc['options'][_0x7f40('0x1e')]||null:null,'attributes':[[db[_0x7f40('0x1f')]['fn'](_0x7f40('0x20'),db[_0x7f40('0x1f')]['fn']('IF',db[_0x7f40('0x1f')][_0x7f40('0x21')](_0x7f40('0x22')))),_0x7f40('0x23')]]})[_0x7f40('0x24')](function(_0x128de5){logger[_0x7f40('0x11')](_0x7f40('0x25'),_0x88d1fc);logger[_0x7f40('0x13')]('GetVoiceQueueRtPauses',_0x88d1fc,JSON[_0x7f40('0x16')](_0x128de5));_0x4a94e0(_0x128de5);})['catch'](function(_0x316e6c){logger[_0x7f40('0x17')]('GetVoiceQueueRtPauses',_0x316e6c[_0x7f40('0x19')],_0x88d1fc);_0x4b04a4(_0x5461cf[_0x7f40('0x17')](0x1f4,_0x316e6c[_0x7f40('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 7cea746..7863fa4 100644 --- a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js +++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7722=['remove','update','emit','removeListener','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save'];(function(_0x9470db,_0x45e341){var _0x2d8149=function(_0x5d5c7c){while(--_0x5d5c7c){_0x9470db['push'](_0x9470db['shift']());}};_0x2d8149(++_0x45e341);}(_0x7722,0x14e));var _0x2772=function(_0x1c604f,_0x1899e4){_0x1c604f=_0x1c604f-0x0;var _0x55e98e=_0x7722[_0x1c604f];return _0x55e98e;};'use strict';var UserVoiceQueueRtEvents=require(_0x2772('0x0'));var events=[_0x2772('0x1'),_0x2772('0x2'),_0x2772('0x3')];function createListener(_0x169af9,_0xbdd234){return function(_0xede334){_0xbdd234[_0x2772('0x4')](_0x169af9,_0xede334);};}function removeListener(_0x1c4d7f,_0x53f112){return function(){UserVoiceQueueRtEvents[_0x2772('0x5')](_0x1c4d7f,_0x53f112);};}exports['register']=function(_0x2a3e34){for(var _0x112ea5=0x0,_0x3e6c6e=events[_0x2772('0x6')];_0x112ea5<_0x3e6c6e;_0x112ea5++){var _0x21b452=events[_0x112ea5];var _0x53f017=createListener(_0x2772('0x7')+_0x21b452,_0x2a3e34);UserVoiceQueueRtEvents['on'](_0x21b452,_0x53f017);}}; \ No newline at end of file +var _0x9a22=['update','removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove'];(function(_0x5a239e,_0x30f7b0){var _0x376124=function(_0x254f49){while(--_0x254f49){_0x5a239e['push'](_0x5a239e['shift']());}};_0x376124(++_0x30f7b0);}(_0x9a22,0x75));var _0x29a2=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0x9a22[_0xf0bcac];return _0x4e4c65;};'use strict';var UserVoiceQueueRtEvents=require(_0x29a2('0x0'));var events=[_0x29a2('0x1'),_0x29a2('0x2'),_0x29a2('0x3')];function createListener(_0x2f7a2d,_0xc7dd1f){return function(_0x195e9e){_0xc7dd1f['emit'](_0x2f7a2d,_0x195e9e);};}function removeListener(_0x4e617e,_0x427d51){return function(){UserVoiceQueueRtEvents[_0x29a2('0x4')](_0x4e617e,_0x427d51);};}exports[_0x29a2('0x5')]=function(_0x2ea411){for(var _0x261835=0x0,_0xfb91e8=events[_0x29a2('0x6')];_0x261835<_0xfb91e8;_0x261835++){var _0x2887e1=events[_0x261835];var _0x4b55de=createListener(_0x29a2('0x7')+_0x2887e1,_0x2ea411);UserVoiceQueueRtEvents['on'](_0x2887e1,_0x4b55de);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 8c83f37..968f535 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x5d9b3b,_0x2b7af4){var _0x3ddd58=function(_0x5a5717){while(--_0x5a5717){_0x5d9b3b['push'](_0x5d9b3b['shift']());}};_0x3ddd58(++_0x2b7af4);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2cdc4e,_0x1c3e23){var _0x1617a8=function(_0x44b5e6){while(--_0x44b5e6){_0x2cdc4e['push'](_0x2cdc4e['shift']());}};_0x1617a8(++_0x1c3e23);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index e0d21ec..0f2bd85 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb000=['INTEGER','sequelize'];(function(_0x52cd91,_0x373551){var _0x4773d4=function(_0xb76abf){while(--_0xb76abf){_0x52cd91['push'](_0x52cd91['shift']());}};_0x4773d4(++_0x373551);}(_0xb000,0x1a7));var _0x0b00=function(_0x188703,_0x596b26){_0x188703=_0x188703-0x0;var _0x1a0c81=_0xb000[_0x188703];return _0x1a0c81;};'use strict';var Sequelize=require(_0x0b00('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x0b00('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf97d=['INTEGER','sequelize','exports'];(function(_0x1d53cb,_0x4cf3f1){var _0x1de5fe=function(_0x438bbf){while(--_0x438bbf){_0x1d53cb['push'](_0x1d53cb['shift']());}};_0x1de5fe(++_0x4cf3f1);}(_0xf97d,0x199));var _0xdf97=function(_0x4c93d4,_0x5a17bd){_0x4c93d4=_0x4c93d4-0x0;var _0x29caca=_0xf97d[_0x4c93d4];return _0x29caca;};'use strict';var Sequelize=require(_0xdf97('0x0'));module[_0xdf97('0x1')]={'penalty':{'type':Sequelize[_0xdf97('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index e3688ab..2519b72 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.model.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa3e8=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','../../config/logger','api','moment'];(function(_0x49e584,_0x2886f8){var _0x58b1be=function(_0x40397c){while(--_0x40397c){_0x49e584['push'](_0x49e584['shift']());}};_0x58b1be(++_0x2886f8);}(_0xa3e8,0xb1));var _0x8a3e=function(_0x1b27fd,_0x29ccef){_0x1b27fd=_0x1b27fd-0x0;var _0x41d72e=_0xa3e8[_0x1b27fd];return _0x41d72e;};'use strict';var _=require(_0x8a3e('0x0'));var util=require(_0x8a3e('0x1'));var logger=require(_0x8a3e('0x2'))(_0x8a3e('0x3'));var moment=require(_0x8a3e('0x4'));var BPromise=require(_0x8a3e('0x5'));var rp=require(_0x8a3e('0x6'));var fs=require('fs');var path=require(_0x8a3e('0x7'));var rimraf=require(_0x8a3e('0x8'));var config=require(_0x8a3e('0x9'));var attributes=require('./userWhatsappQueue.attributes');module[_0x8a3e('0xa')]=function(_0x288201,_0x130e92){return _0x288201[_0x8a3e('0xb')](_0x8a3e('0xc'),attributes,{'tableName':_0x8a3e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0ec3=['exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','../../config/logger','bluebird','path','../../config/environment','./userWhatsappQueue.attributes'];(function(_0x5a7112,_0x1f9492){var _0x3147f7=function(_0x4d2329){while(--_0x4d2329){_0x5a7112['push'](_0x5a7112['shift']());}};_0x3147f7(++_0x1f9492);}(_0x0ec3,0x1da));var _0x30ec=function(_0x58e63b,_0x52ffec){_0x58e63b=_0x58e63b-0x0;var _0x2099f3=_0x0ec3[_0x58e63b];return _0x2099f3;};'use strict';var _=require(_0x30ec('0x0'));var util=require('util');var logger=require(_0x30ec('0x1'))('api');var moment=require('moment');var BPromise=require(_0x30ec('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x30ec('0x3'));var rimraf=require('rimraf');var config=require(_0x30ec('0x4'));var attributes=require(_0x30ec('0x5'));module[_0x30ec('0x6')]=function(_0xb5a47a,_0x46cb04){return _0xb5a47a[_0x30ec('0x7')](_0x30ec('0x8'),attributes,{'tableName':_0x30ec('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index 13ea1dd..0112107 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9a23=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5f0f2c,_0x9817bf){var _0x104e69=function(_0x6915cc){while(--_0x6915cc){_0x5f0f2c['push'](_0x5f0f2c['shift']());}};_0x104e69(++_0x9817bf);}(_0x9a23,0x1dd));var _0x39a2=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x9a23[_0x199572];return _0x13cfa3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x39a2('0x0'));var BPromise=require(_0x39a2('0x1'));var rs=require(_0x39a2('0x2'));var fs=require('fs');var Redis=require(_0x39a2('0x3'));var db=require(_0x39a2('0x4'))['db'];var utils=require(_0x39a2('0x5'));var logger=require(_0x39a2('0x6'))(_0x39a2('0x7'));var config=require(_0x39a2('0x8'));var jayson=require(_0x39a2('0x9'));var client=jayson['client'][_0x39a2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16644b,_0x54d71b,_0x5c44ab){return new BPromise(function(_0x1b917e,_0x436cc3){return client[_0x39a2('0xb')](_0x16644b,_0x5c44ab)[_0x39a2('0xc')](function(_0x210d37){logger[_0x39a2('0xd')](_0x39a2('0xe'),_0x54d71b,_0x39a2('0xf'));logger[_0x39a2('0x10')](_0x39a2('0x11'),_0x54d71b,_0x39a2('0xf'),JSON['stringify'](_0x210d37));if(_0x210d37['error']){if(_0x210d37[_0x39a2('0x12')][_0x39a2('0x13')]===0x1f4){logger['error'](_0x39a2('0xe'),_0x54d71b,_0x210d37['error'][_0x39a2('0x14')]);return _0x436cc3(_0x210d37[_0x39a2('0x12')]['message']);}logger[_0x39a2('0x12')]('UserWhatsappQueue,\x20%s,\x20%s',_0x54d71b,_0x210d37['error'][_0x39a2('0x14')]);return _0x1b917e(_0x210d37[_0x39a2('0x12')][_0x39a2('0x14')]);}else{logger[_0x39a2('0xd')]('UserWhatsappQueue,\x20%s,\x20%s',_0x54d71b,_0x39a2('0xf'));_0x1b917e(_0x210d37[_0x39a2('0x15')][_0x39a2('0x14')]);}})[_0x39a2('0x16')](function(_0x4c60e4){logger[_0x39a2('0x12')](_0x39a2('0xe'),_0x54d71b,_0x4c60e4);_0x436cc3(_0x4c60e4);});});} \ No newline at end of file +var _0x4474=['code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4539c1,_0x40b836){var _0x58854b=function(_0x33621b){while(--_0x33621b){_0x4539c1['push'](_0x4539c1['shift']());}};_0x58854b(++_0x40b836);}(_0x4474,0x184));var _0x4447=function(_0x325a08,_0x571fff){_0x325a08=_0x325a08-0x0;var _0x436e01=_0x4474[_0x325a08];return _0x436e01;};'use strict';var _=require(_0x4447('0x0'));var util=require(_0x4447('0x1'));var moment=require(_0x4447('0x2'));var BPromise=require('bluebird');var rs=require(_0x4447('0x3'));var fs=require('fs');var Redis=require(_0x4447('0x4'));var db=require(_0x4447('0x5'))['db'];var utils=require(_0x4447('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x4447('0x7'));var jayson=require(_0x4447('0x8'));var client=jayson[_0x4447('0x9')][_0x4447('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4366eb,_0x4102b8,_0x5c672d){return new BPromise(function(_0x33ddd5,_0x213bdd){return client[_0x4447('0xb')](_0x4366eb,_0x5c672d)[_0x4447('0xc')](function(_0x248036){logger[_0x4447('0xd')](_0x4447('0xe'),_0x4102b8,_0x4447('0xf'));logger[_0x4447('0x10')](_0x4447('0x11'),_0x4102b8,_0x4447('0xf'),JSON[_0x4447('0x12')](_0x248036));if(_0x248036[_0x4447('0x13')]){if(_0x248036['error'][_0x4447('0x14')]===0x1f4){logger[_0x4447('0x13')](_0x4447('0xe'),_0x4102b8,_0x248036['error'][_0x4447('0x15')]);return _0x213bdd(_0x248036[_0x4447('0x13')]['message']);}logger[_0x4447('0x13')](_0x4447('0xe'),_0x4102b8,_0x248036['error']['message']);return _0x33ddd5(_0x248036[_0x4447('0x13')][_0x4447('0x15')]);}else{logger[_0x4447('0xd')](_0x4447('0xe'),_0x4102b8,_0x4447('0xf'));_0x33ddd5(_0x248036[_0x4447('0x16')][_0x4447('0x15')]);}})[_0x4447('0x17')](function(_0x22ff67){logger[_0x4447('0x13')](_0x4447('0xe'),_0x4102b8,_0x22ff67);_0x213bdd(_0x22ff67);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index ef756f0..f3ad357 100644 --- a/server/api/variable/index.js +++ b/server/api/variable/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb99=['../../config/environment','./variable.controller','isAuthenticated','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service'];(function(_0x3836a4,_0x2c853b){var _0xd3b99f=function(_0x191a62){while(--_0x191a62){_0x3836a4['push'](_0x3836a4['shift']());}};_0xd3b99f(++_0x2c853b);}(_0xcb99,0x8b));var _0x9cb9=function(_0x2a40b3,_0xe1c253){_0x2a40b3=_0x2a40b3-0x0;var _0x4ac6cb=_0xcb99[_0x2a40b3];return _0x4ac6cb;};'use strict';var multer=require(_0x9cb9('0x0'));var util=require('util');var path=require(_0x9cb9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9cb9('0x2')]();var fs_extra=require(_0x9cb9('0x3'));var auth=require(_0x9cb9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9cb9('0x5'));var controller=require(_0x9cb9('0x6'));router['get']('/',auth[_0x9cb9('0x7')](),controller['index']);router[_0x9cb9('0x8')](_0x9cb9('0x9'),auth[_0x9cb9('0x7')](),controller[_0x9cb9('0xa')]);router[_0x9cb9('0xb')]('/',auth[_0x9cb9('0x7')](),controller[_0x9cb9('0xc')]);router[_0x9cb9('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x9cb9('0xe')]);router[_0x9cb9('0xf')](_0x9cb9('0x9'),auth['isAuthenticated'](),controller[_0x9cb9('0x10')]);module[_0x9cb9('0x11')]=router; \ No newline at end of file +var _0xc30d=['Router','fs-extra','../../components/interaction/service','./variable.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','path','connect-timeout','express'];(function(_0xeb9c56,_0x13c435){var _0x5a8357=function(_0xda5820){while(--_0xda5820){_0xeb9c56['push'](_0xeb9c56['shift']());}};_0x5a8357(++_0x13c435);}(_0xc30d,0x6e));var _0xdc30=function(_0x5a58af,_0x2fd0e0){_0x5a58af=_0x5a58af-0x0;var _0x40b593=_0xc30d[_0x5a58af];return _0x40b593;};'use strict';var multer=require(_0xdc30('0x0'));var util=require('util');var path=require(_0xdc30('0x1'));var timeout=require(_0xdc30('0x2'));var express=require(_0xdc30('0x3'));var router=express[_0xdc30('0x4')]();var fs_extra=require(_0xdc30('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xdc30('0x6'));var config=require('../../config/environment');var controller=require(_0xdc30('0x7'));router[_0xdc30('0x8')]('/',auth[_0xdc30('0x9')](),controller[_0xdc30('0xa')]);router[_0xdc30('0x8')](_0xdc30('0xb'),auth['isAuthenticated'](),controller[_0xdc30('0xc')]);router[_0xdc30('0xd')]('/',auth[_0xdc30('0x9')](),controller[_0xdc30('0xe')]);router[_0xdc30('0xf')](_0xdc30('0xb'),auth[_0xdc30('0x9')](),controller[_0xdc30('0x10')]);router[_0xdc30('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xdc30('0x12')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 029c572..bc8bd29 100644 --- a/server/api/variable/variable.attributes.js +++ b/server/api/variable/variable.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcfab=['sequelize','STRING'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xcfab,0x1e0));var _0xbcfa=function(_0x42fa68,_0x5850c2){_0x42fa68=_0x42fa68-0x0;var _0x2cc677=_0xcfab[_0x42fa68];return _0x2cc677;};'use strict';var Sequelize=require(_0xbcfa('0x0'));module['exports']={'name':{'type':Sequelize[_0xbcfa('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xbcfa('0x1')]}}; \ No newline at end of file +var _0x7881=['sequelize','STRING'];(function(_0x501f85,_0x5de511){var _0x28d466=function(_0x1a3575){while(--_0x1a3575){_0x501f85['push'](_0x501f85['shift']());}};_0x28d466(++_0x5de511);}(_0x7881,0x1b0));var _0x1788=function(_0x35029c,_0x344997){_0x35029c=_0x35029c-0x0;var _0x198604=_0x7881[_0x35029c];return _0x198604;};'use strict';var Sequelize=require(_0x1788('0x0'));module['exports']={'name':{'type':Sequelize[_0x1788('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x1788('0x1')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index d2dc7c2..813e882 100644 --- a/server/api/variable/variable.controller.js +++ b/server/api/variable/variable.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x902d=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','undefined','limit','offset','count','set','json','apply','reject','save','update','then','destroy','get','Variables','UserProfileResource','error','stack','name','send','index','Variable','rawAttributes','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x902d,0x1aa));var _0xd902=function(_0x382d7e,_0x16798c){_0x382d7e=_0x382d7e-0x0;var _0x33c721=_0x902d[_0x382d7e];return _0x33c721;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd902('0x0'));var zipdir=require(_0xd902('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd902('0x2'));var moment=require(_0xd902('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd902('0x4'));var util=require(_0xd902('0x5'));var path=require(_0xd902('0x6'));var sox=require(_0xd902('0x7'));var csv=require(_0xd902('0x8'));var ejs=require(_0xd902('0x9'));var fs=require('fs');var fs_extra=require(_0xd902('0xa'));var _=require(_0xd902('0xb'));var squel=require(_0xd902('0xc'));var crypto=require(_0xd902('0xd'));var jsforce=require(_0xd902('0xe'));var deskjs=require(_0xd902('0xf'));var toCsv=require(_0xd902('0x8'));var querystring=require('querystring');var Papa=require(_0xd902('0x10'));var Redis=require(_0xd902('0x11'));var authService=require(_0xd902('0x12'));var qs=require(_0xd902('0x13'));var as=require(_0xd902('0x14'));var hardwareService=require(_0xd902('0x15'));var logger=require(_0xd902('0x16'))(_0xd902('0x17'));var utils=require(_0xd902('0x18'));var config=require(_0xd902('0x19'));var licenseUtil=require(_0xd902('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x423db5,_0x37188c){_0x37188c=_0x37188c||0xcc;return function(_0x2b67b3){if(_0x2b67b3){return _0x423db5['sendStatus'](_0x37188c);}return _0x423db5['status'](_0x37188c)[_0xd902('0x1b')]();};}function respondWithResult(_0x4f1462,_0x563418){_0x563418=_0x563418||0xc8;return function(_0x1f5d00){if(_0x1f5d00){return _0x4f1462[_0xd902('0x1c')](_0x563418)['json'](_0x1f5d00);}};}function respondWithFilteredResult(_0x4ccac0,_0x2f6307){return function(_0x4bd483){if(_0x4bd483){var _0xa37d2c=typeof _0x2f6307['offset']===_0xd902('0x1d')&&typeof _0x2f6307[_0xd902('0x1e')]==='undefined';var _0x3dd662=_0x4bd483['count'];var _0x3dffcd=_0xa37d2c?0x0:_0x2f6307[_0xd902('0x1f')];var _0x3a126a=_0xa37d2c?_0x4bd483[_0xd902('0x20')]:_0x2f6307[_0xd902('0x1f')]+_0x2f6307['limit'];var _0x144a9a;if(_0x3a126a>=_0x3dd662){_0x3a126a=_0x3dd662;_0x144a9a=0xc8;}else{_0x144a9a=0xce;}_0x4ccac0[_0xd902('0x1c')](_0x144a9a);return _0x4ccac0[_0xd902('0x21')]('Content-Range',_0x3dffcd+'-'+_0x3a126a+'/'+_0x3dd662)[_0xd902('0x22')](_0x4bd483);}return null;};}function patchUpdates(_0x171585){return function(_0xdd3666){try{jsonpatch[_0xd902('0x23')](_0xdd3666,_0x171585,!![]);}catch(_0x48f80d){return BPromise[_0xd902('0x24')](_0x48f80d);}return _0xdd3666[_0xd902('0x25')]();};}function saveUpdates(_0x1f5705,_0x308a83){return function(_0x25e324){if(_0x25e324){return _0x25e324[_0xd902('0x26')](_0x1f5705)[_0xd902('0x27')](function(_0xb5f15){return _0xb5f15;});}return null;};}function removeEntity(_0x4f46a6,_0x31da67){return function(_0x53c3f6){if(_0x53c3f6){return _0x53c3f6[_0xd902('0x28')]()[_0xd902('0x27')](function(){var _0x6406=_0x53c3f6[_0xd902('0x29')]({'plain':!![]});var _0x52cf04=_0xd902('0x2a');return db[_0xd902('0x2b')][_0xd902('0x28')]({'where':{'type':_0x52cf04,'resourceId':_0x6406['id']}})[_0xd902('0x27')](function(){return _0x53c3f6;});})[_0xd902('0x27')](function(){_0x4f46a6[_0xd902('0x1c')](0xcc)[_0xd902('0x1b')]();});}};}function handleEntityNotFound(_0x392199,_0x92d297){return function(_0x519f60){if(!_0x519f60){_0x392199['sendStatus'](0x194);}return _0x519f60;};}function handleError(_0x43518e,_0x23555b){_0x23555b=_0x23555b||0x1f4;return function(_0x4166c8){logger[_0xd902('0x2c')](_0x4166c8[_0xd902('0x2d')]);if(_0x4166c8[_0xd902('0x2e')]){delete _0x4166c8['name'];}_0x43518e['status'](_0x23555b)[_0xd902('0x2f')](_0x4166c8);};}exports[_0xd902('0x30')]=function(_0x3bd22c,_0x4ef9e1){var _0x3b4387={},_0x16c683={},_0x95dfde={'count':0x0,'rows':[]};var _0x3f6fe2=_['map'](db[_0xd902('0x31')][_0xd902('0x32')],function(_0x3b5db3){return{'name':_0x3b5db3['fieldName'],'type':_0x3b5db3[_0xd902('0x33')]['key']};});_0x16c683[_0xd902('0x34')]=_[_0xd902('0x35')](_0x3f6fe2,_0xd902('0x2e'));_0x16c683[_0xd902('0x36')]=_[_0xd902('0x37')](_0x3bd22c[_0xd902('0x36')]);_0x16c683[_0xd902('0x38')]=_['intersection'](_0x16c683[_0xd902('0x34')],_0x16c683['query']);_0x3b4387['attributes']=_[_0xd902('0x39')](_0x16c683['model'],qs[_0xd902('0x3a')](_0x3bd22c[_0xd902('0x36')][_0xd902('0x3a')]));_0x3b4387['attributes']=_0x3b4387[_0xd902('0x3b')][_0xd902('0x3c')]?_0x3b4387[_0xd902('0x3b')]:_0x16c683[_0xd902('0x34')];if(!_0x3bd22c[_0xd902('0x36')][_0xd902('0x3d')]('nolimit')){_0x3b4387['limit']=qs[_0xd902('0x1e')](_0x3bd22c[_0xd902('0x36')]['limit']);_0x3b4387[_0xd902('0x1f')]=qs['offset'](_0x3bd22c['query'][_0xd902('0x1f')]);}_0x3b4387[_0xd902('0x3e')]=qs[_0xd902('0x3f')](_0x3bd22c[_0xd902('0x36')][_0xd902('0x3f')]);_0x3b4387[_0xd902('0x40')]=qs['filters'](_['pick'](_0x3bd22c[_0xd902('0x36')],_0x16c683[_0xd902('0x38')]),_0x3f6fe2);if(_0x3bd22c['query'][_0xd902('0x41')]){_0x3b4387[_0xd902('0x40')]=_[_0xd902('0x42')](_0x3b4387['where'],{'$or':_[_0xd902('0x35')](_0x3f6fe2,function(_0x503334){if(_0x503334[_0xd902('0x33')]!==_0xd902('0x43')){var _0x3d33f6={};_0x3d33f6[_0x503334['name']]={'$like':'%'+_0x3bd22c[_0xd902('0x36')]['filter']+'%'};return _0x3d33f6;}})});}_0x3b4387=_['merge']({},_0x3b4387,_0x3bd22c[_0xd902('0x44')]);var _0x5bd123={'where':_0x3b4387['where']};return db[_0xd902('0x31')][_0xd902('0x20')](_0x5bd123)[_0xd902('0x27')](function(_0x28dd6f){_0x95dfde[_0xd902('0x20')]=_0x28dd6f;if(_0x3bd22c['query']['includeAll']){_0x3b4387[_0xd902('0x45')]=[{'all':!![]}];}return db[_0xd902('0x31')][_0xd902('0x46')](_0x3b4387);})['then'](function(_0x59c285){_0x95dfde[_0xd902('0x47')]=_0x59c285;return _0x95dfde;})[_0xd902('0x27')](respondWithFilteredResult(_0x4ef9e1,_0x3b4387))[_0xd902('0x48')](handleError(_0x4ef9e1,null));};exports[_0xd902('0x49')]=function(_0x7ce7f8,_0x8219f0){var _0x334a28={'raw':!![],'where':{'id':_0x7ce7f8[_0xd902('0x4a')]['id']}},_0x2d468b={};_0x2d468b['model']=_['keys'](db[_0xd902('0x31')]['rawAttributes']);_0x2d468b[_0xd902('0x36')]=_[_0xd902('0x37')](_0x7ce7f8['query']);_0x2d468b[_0xd902('0x38')]=_[_0xd902('0x39')](_0x2d468b[_0xd902('0x34')],_0x2d468b[_0xd902('0x36')]);_0x334a28[_0xd902('0x3b')]=_[_0xd902('0x39')](_0x2d468b[_0xd902('0x34')],qs[_0xd902('0x3a')](_0x7ce7f8[_0xd902('0x36')][_0xd902('0x3a')]));_0x334a28[_0xd902('0x3b')]=_0x334a28[_0xd902('0x3b')]['length']?_0x334a28[_0xd902('0x3b')]:_0x2d468b['model'];if(_0x7ce7f8[_0xd902('0x36')][_0xd902('0x4b')]){_0x334a28[_0xd902('0x45')]=[{'all':!![]}];}_0x334a28=_[_0xd902('0x42')]({},_0x334a28,_0x7ce7f8[_0xd902('0x44')]);return db[_0xd902('0x31')][_0xd902('0x4c')](_0x334a28)['then'](handleEntityNotFound(_0x8219f0,null))[_0xd902('0x27')](respondWithResult(_0x8219f0,null))[_0xd902('0x48')](handleError(_0x8219f0,null));};exports[_0xd902('0x4d')]=function(_0x51b595,_0x20b625){return db[_0xd902('0x31')][_0xd902('0x4d')](_0x51b595[_0xd902('0x4e')],{})[_0xd902('0x27')](function(_0x56aea8){var _0x13acb5=_0x51b595[_0xd902('0x4f')][_0xd902('0x29')]({'plain':!![]});if(!_0x13acb5)throw new Error(_0xd902('0x50'));if(_0x13acb5[_0xd902('0x51')]===_0xd902('0x4f')){var _0x4ad198=_0x56aea8[_0xd902('0x29')]({'plain':!![]});var _0x30086c=_0xd902('0x2a');return db[_0xd902('0x52')][_0xd902('0x4c')]({'where':{'name':_0x30086c,'userProfileId':_0x13acb5['userProfileId']},'raw':!![]})[_0xd902('0x27')](function(_0xfdf943){if(_0xfdf943&&_0xfdf943[_0xd902('0x53')]===0x0){return db[_0xd902('0x2b')][_0xd902('0x4d')]({'name':_0x4ad198[_0xd902('0x2e')],'resourceId':_0x4ad198['id'],'type':_0xfdf943[_0xd902('0x2e')],'sectionId':_0xfdf943['id']},{})[_0xd902('0x27')](function(){return _0x56aea8;});}else{return _0x56aea8;}})[_0xd902('0x48')](function(_0x30a0dd){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x30a0dd);throw _0x30a0dd;});}return _0x56aea8;})[_0xd902('0x27')](respondWithResult(_0x20b625,0xc9))[_0xd902('0x48')](handleError(_0x20b625,null));};exports[_0xd902('0x26')]=function(_0x5675ee,_0x5df8bd){if(_0x5675ee[_0xd902('0x4e')]['id']){delete _0x5675ee['body']['id'];}return db[_0xd902('0x31')][_0xd902('0x4c')]({'where':{'id':_0x5675ee[_0xd902('0x4a')]['id']}})[_0xd902('0x27')](handleEntityNotFound(_0x5df8bd,null))['then'](saveUpdates(_0x5675ee[_0xd902('0x4e')],null))['then'](respondWithResult(_0x5df8bd,null))[_0xd902('0x48')](handleError(_0x5df8bd,null));};exports['destroy']=function(_0x171302,_0x594436){return db[_0xd902('0x31')]['find']({'where':{'id':_0x171302['params']['id']}})['then'](handleEntityNotFound(_0x594436,null))['then'](removeEntity(_0x594436,null))[_0xd902('0x48')](handleError(_0x594436,null));}; \ No newline at end of file +var _0x1ca2=['VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','then','destroy','get','Variables','stack','name','send','index','Variable','rawAttributes','fieldName','type','keys','model','query','attributes','intersection','fields','length','nolimit','sort','where','pick','filters','merge','map'];(function(_0x250746,_0x337271){var _0xcdbf1c=function(_0x369d7a){while(--_0x369d7a){_0x250746['push'](_0x250746['shift']());}};_0xcdbf1c(++_0x337271);}(_0x1ca2,0x107));var _0x21ca=function(_0x1e5db8,_0x44ef41){_0x1e5db8=_0x1e5db8-0x0;var _0x219a51=_0x1ca2[_0x1e5db8];return _0x219a51;};'use strict';var emlformat=require(_0x21ca('0x0'));var rimraf=require(_0x21ca('0x1'));var zipdir=require(_0x21ca('0x2'));var jsonpatch=require(_0x21ca('0x3'));var rp=require(_0x21ca('0x4'));var moment=require(_0x21ca('0x5'));var BPromise=require(_0x21ca('0x6'));var Mustache=require('mustache');var util=require(_0x21ca('0x7'));var path=require('path');var sox=require(_0x21ca('0x8'));var csv=require('to-csv');var ejs=require(_0x21ca('0x9'));var fs=require('fs');var fs_extra=require(_0x21ca('0xa'));var _=require(_0x21ca('0xb'));var squel=require(_0x21ca('0xc'));var crypto=require(_0x21ca('0xd'));var jsforce=require(_0x21ca('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x21ca('0xf'));var authService=require(_0x21ca('0x10'));var qs=require(_0x21ca('0x11'));var as=require(_0x21ca('0x12'));var hardwareService=require(_0x21ca('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x21ca('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x21ca('0x15'))['db'];function respondWithStatusCode(_0x49f99b,_0xd79e9c){_0xd79e9c=_0xd79e9c||0xcc;return function(_0x32e465){if(_0x32e465){return _0x49f99b[_0x21ca('0x16')](_0xd79e9c);}return _0x49f99b[_0x21ca('0x17')](_0xd79e9c)[_0x21ca('0x18')]();};}function respondWithResult(_0x5de4d1,_0x4324d4){_0x4324d4=_0x4324d4||0xc8;return function(_0x4d2e1){if(_0x4d2e1){return _0x5de4d1[_0x21ca('0x17')](_0x4324d4)['json'](_0x4d2e1);}};}function respondWithFilteredResult(_0x981991,_0x58978a){return function(_0xbb4fb){if(_0xbb4fb){var _0x21b3fb=typeof _0x58978a['offset']===_0x21ca('0x19')&&typeof _0x58978a[_0x21ca('0x1a')]==='undefined';var _0x1af1a9=_0xbb4fb[_0x21ca('0x1b')];var _0x2a164f=_0x21b3fb?0x0:_0x58978a[_0x21ca('0x1c')];var _0x2573c5=_0x21b3fb?_0xbb4fb[_0x21ca('0x1b')]:_0x58978a[_0x21ca('0x1c')]+_0x58978a[_0x21ca('0x1a')];var _0x46cf30;if(_0x2573c5>=_0x1af1a9){_0x2573c5=_0x1af1a9;_0x46cf30=0xc8;}else{_0x46cf30=0xce;}_0x981991[_0x21ca('0x17')](_0x46cf30);return _0x981991[_0x21ca('0x1d')](_0x21ca('0x1e'),_0x2a164f+'-'+_0x2573c5+'/'+_0x1af1a9)[_0x21ca('0x1f')](_0xbb4fb);}return null;};}function patchUpdates(_0x46299f){return function(_0x54492c){try{jsonpatch[_0x21ca('0x20')](_0x54492c,_0x46299f,!![]);}catch(_0x3604fd){return BPromise['reject'](_0x3604fd);}return _0x54492c[_0x21ca('0x21')]();};}function saveUpdates(_0xc43f4,_0x4b8b41){return function(_0x2e27f1){if(_0x2e27f1){return _0x2e27f1[_0x21ca('0x22')](_0xc43f4)[_0x21ca('0x23')](function(_0x44025a){return _0x44025a;});}return null;};}function removeEntity(_0x144454,_0x534b1d){return function(_0x29499e){if(_0x29499e){return _0x29499e[_0x21ca('0x24')]()[_0x21ca('0x23')](function(){var _0x3e3c51=_0x29499e[_0x21ca('0x25')]({'plain':!![]});var _0x343534=_0x21ca('0x26');return db['UserProfileResource'][_0x21ca('0x24')]({'where':{'type':_0x343534,'resourceId':_0x3e3c51['id']}})[_0x21ca('0x23')](function(){return _0x29499e;});})[_0x21ca('0x23')](function(){_0x144454[_0x21ca('0x17')](0xcc)[_0x21ca('0x18')]();});}};}function handleEntityNotFound(_0x3b8271,_0x476c50){return function(_0x3f8d5d){if(!_0x3f8d5d){_0x3b8271[_0x21ca('0x16')](0x194);}return _0x3f8d5d;};}function handleError(_0x5d2320,_0x4771c6){_0x4771c6=_0x4771c6||0x1f4;return function(_0x273602){logger['error'](_0x273602[_0x21ca('0x27')]);if(_0x273602['name']){delete _0x273602[_0x21ca('0x28')];}_0x5d2320[_0x21ca('0x17')](_0x4771c6)[_0x21ca('0x29')](_0x273602);};}exports[_0x21ca('0x2a')]=function(_0x489bfa,_0x30d5f5){var _0x12a5d0={},_0x327bf8={},_0x451bce={'count':0x0,'rows':[]};var _0x4dfe9b=_['map'](db[_0x21ca('0x2b')][_0x21ca('0x2c')],function(_0x21e0ae){return{'name':_0x21e0ae[_0x21ca('0x2d')],'type':_0x21e0ae[_0x21ca('0x2e')]['key']};});_0x327bf8['model']=_['map'](_0x4dfe9b,_0x21ca('0x28'));_0x327bf8['query']=_[_0x21ca('0x2f')](_0x489bfa['query']);_0x327bf8['filters']=_['intersection'](_0x327bf8[_0x21ca('0x30')],_0x327bf8[_0x21ca('0x31')]);_0x12a5d0[_0x21ca('0x32')]=_[_0x21ca('0x33')](_0x327bf8['model'],qs[_0x21ca('0x34')](_0x489bfa[_0x21ca('0x31')][_0x21ca('0x34')]));_0x12a5d0[_0x21ca('0x32')]=_0x12a5d0[_0x21ca('0x32')][_0x21ca('0x35')]?_0x12a5d0[_0x21ca('0x32')]:_0x327bf8[_0x21ca('0x30')];if(!_0x489bfa[_0x21ca('0x31')]['hasOwnProperty'](_0x21ca('0x36'))){_0x12a5d0[_0x21ca('0x1a')]=qs[_0x21ca('0x1a')](_0x489bfa[_0x21ca('0x31')][_0x21ca('0x1a')]);_0x12a5d0['offset']=qs[_0x21ca('0x1c')](_0x489bfa[_0x21ca('0x31')][_0x21ca('0x1c')]);}_0x12a5d0['order']=qs[_0x21ca('0x37')](_0x489bfa[_0x21ca('0x31')]['sort']);_0x12a5d0[_0x21ca('0x38')]=qs['filters'](_[_0x21ca('0x39')](_0x489bfa[_0x21ca('0x31')],_0x327bf8[_0x21ca('0x3a')]),_0x4dfe9b);if(_0x489bfa['query']['filter']){_0x12a5d0[_0x21ca('0x38')]=_[_0x21ca('0x3b')](_0x12a5d0[_0x21ca('0x38')],{'$or':_[_0x21ca('0x3c')](_0x4dfe9b,function(_0x13eefc){if(_0x13eefc[_0x21ca('0x2e')]!==_0x21ca('0x3d')){var _0x317709={};_0x317709[_0x13eefc[_0x21ca('0x28')]]={'$like':'%'+_0x489bfa[_0x21ca('0x31')][_0x21ca('0x3e')]+'%'};return _0x317709;}})});}_0x12a5d0=_[_0x21ca('0x3b')]({},_0x12a5d0,_0x489bfa[_0x21ca('0x3f')]);var _0x1ed9c4={'where':_0x12a5d0['where']};return db['Variable'][_0x21ca('0x1b')](_0x1ed9c4)['then'](function(_0x28d413){_0x451bce[_0x21ca('0x1b')]=_0x28d413;if(_0x489bfa[_0x21ca('0x31')][_0x21ca('0x40')]){_0x12a5d0[_0x21ca('0x41')]=[{'all':!![]}];}return db[_0x21ca('0x2b')][_0x21ca('0x42')](_0x12a5d0);})[_0x21ca('0x23')](function(_0x3ff28e){_0x451bce[_0x21ca('0x43')]=_0x3ff28e;return _0x451bce;})[_0x21ca('0x23')](respondWithFilteredResult(_0x30d5f5,_0x12a5d0))[_0x21ca('0x44')](handleError(_0x30d5f5,null));};exports[_0x21ca('0x45')]=function(_0x29548d,_0x1d442d){var _0xe9e4e3={'raw':!![],'where':{'id':_0x29548d['params']['id']}},_0x1940e5={};_0x1940e5['model']=_[_0x21ca('0x2f')](db[_0x21ca('0x2b')][_0x21ca('0x2c')]);_0x1940e5[_0x21ca('0x31')]=_['keys'](_0x29548d[_0x21ca('0x31')]);_0x1940e5[_0x21ca('0x3a')]=_['intersection'](_0x1940e5[_0x21ca('0x30')],_0x1940e5[_0x21ca('0x31')]);_0xe9e4e3[_0x21ca('0x32')]=_[_0x21ca('0x33')](_0x1940e5[_0x21ca('0x30')],qs[_0x21ca('0x34')](_0x29548d['query'][_0x21ca('0x34')]));_0xe9e4e3[_0x21ca('0x32')]=_0xe9e4e3[_0x21ca('0x32')][_0x21ca('0x35')]?_0xe9e4e3['attributes']:_0x1940e5['model'];if(_0x29548d[_0x21ca('0x31')][_0x21ca('0x40')]){_0xe9e4e3['include']=[{'all':!![]}];}_0xe9e4e3=_[_0x21ca('0x3b')]({},_0xe9e4e3,_0x29548d[_0x21ca('0x3f')]);return db[_0x21ca('0x2b')][_0x21ca('0x46')](_0xe9e4e3)[_0x21ca('0x23')](handleEntityNotFound(_0x1d442d,null))[_0x21ca('0x23')](respondWithResult(_0x1d442d,null))[_0x21ca('0x44')](handleError(_0x1d442d,null));};exports[_0x21ca('0x47')]=function(_0x54a695,_0x278c5d){return db[_0x21ca('0x2b')]['create'](_0x54a695[_0x21ca('0x48')],{})[_0x21ca('0x23')](function(_0x4f7a7f){var _0x1ba938=_0x54a695['user'][_0x21ca('0x25')]({'plain':!![]});if(!_0x1ba938)throw new Error(_0x21ca('0x49'));if(_0x1ba938['role']===_0x21ca('0x4a')){var _0x157bd7=_0x4f7a7f['get']({'plain':!![]});var _0xb67826='Variables';return db[_0x21ca('0x4b')][_0x21ca('0x46')]({'where':{'name':_0xb67826,'userProfileId':_0x1ba938[_0x21ca('0x4c')]},'raw':!![]})['then'](function(_0x41f7c8){if(_0x41f7c8&&_0x41f7c8[_0x21ca('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x157bd7[_0x21ca('0x28')],'resourceId':_0x157bd7['id'],'type':_0x41f7c8[_0x21ca('0x28')],'sectionId':_0x41f7c8['id']},{})['then'](function(){return _0x4f7a7f;});}else{return _0x4f7a7f;}})[_0x21ca('0x44')](function(_0x1e05a4){logger[_0x21ca('0x4e')](_0x21ca('0x4f'),_0x1e05a4);throw _0x1e05a4;});}return _0x4f7a7f;})[_0x21ca('0x23')](respondWithResult(_0x278c5d,0xc9))[_0x21ca('0x44')](handleError(_0x278c5d,null));};exports[_0x21ca('0x22')]=function(_0x131b51,_0x5a33f4){if(_0x131b51[_0x21ca('0x48')]['id']){delete _0x131b51[_0x21ca('0x48')]['id'];}return db[_0x21ca('0x2b')][_0x21ca('0x46')]({'where':{'id':_0x131b51[_0x21ca('0x50')]['id']}})[_0x21ca('0x23')](handleEntityNotFound(_0x5a33f4,null))['then'](saveUpdates(_0x131b51[_0x21ca('0x48')],null))['then'](respondWithResult(_0x5a33f4,null))[_0x21ca('0x44')](handleError(_0x5a33f4,null));};exports[_0x21ca('0x24')]=function(_0x35d0f3,_0x4e1998){return db[_0x21ca('0x2b')][_0x21ca('0x46')]({'where':{'id':_0x35d0f3[_0x21ca('0x50')]['id']}})[_0x21ca('0x23')](handleEntityNotFound(_0x4e1998,null))[_0x21ca('0x23')](removeEntity(_0x4e1998,null))[_0x21ca('0x44')](handleError(_0x4e1998,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 15c205c..a15c64f 100644 --- a/server/api/variable/variable.model.js +++ b/server/api/variable/variable.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5e53=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','tools_variables','lodash','util'];(function(_0x124c44,_0x3b8f29){var _0x4c85a7=function(_0x22c658){while(--_0x22c658){_0x124c44['push'](_0x124c44['shift']());}};_0x4c85a7(++_0x3b8f29);}(_0x5e53,0x6c));var _0x35e5=function(_0x3378c1,_0x48bb97){_0x3378c1=_0x3378c1-0x0;var _0x1e3821=_0x5e53[_0x3378c1];return _0x1e3821;};'use strict';var _=require(_0x35e5('0x0'));var util=require(_0x35e5('0x1'));var logger=require(_0x35e5('0x2'))(_0x35e5('0x3'));var moment=require('moment');var BPromise=require(_0x35e5('0x4'));var rp=require(_0x35e5('0x5'));var fs=require('fs');var path=require(_0x35e5('0x6'));var rimraf=require(_0x35e5('0x7'));var config=require(_0x35e5('0x8'));var attributes=require('./variable.attributes');module[_0x35e5('0x9')]=function(_0x36e589,_0x4b1670){return _0x36e589['define']('Variable',attributes,{'tableName':_0x35e5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0cb8=['../../config/environment','exports','define','Variable','tools_variables','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x391c55,_0x168617){var _0xa434e0=function(_0x51fa5c){while(--_0x51fa5c){_0x391c55['push'](_0x391c55['shift']());}};_0xa434e0(++_0x168617);}(_0x0cb8,0x144));var _0x80cb=function(_0x22632d,_0x23774d){_0x22632d=_0x22632d-0x0;var _0x560d5b=_0x0cb8[_0x22632d];return _0x560d5b;};'use strict';var _=require(_0x80cb('0x0'));var util=require(_0x80cb('0x1'));var logger=require(_0x80cb('0x2'))('api');var moment=require(_0x80cb('0x3'));var BPromise=require(_0x80cb('0x4'));var rp=require(_0x80cb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x80cb('0x6'));var attributes=require('./variable.attributes');module[_0x80cb('0x7')]=function(_0x4bc998,_0x351831){return _0x4bc998[_0x80cb('0x8')](_0x80cb('0x9'),attributes,{'tableName':_0x80cb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index f39f015..db5fd83 100644 --- a/server/api/variable/variable.rpc.js +++ b/server/api/variable/variable.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','Variable,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','ShowVariable','Variable','raw','options','include','model','attributes','map','then','stringify','lodash'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x326f,0xd1));var _0xf326=function(_0x804576,_0x2e12a4){_0x804576=_0x804576-0x0;var _0xb067f8=_0x326f[_0x804576];return _0xb067f8;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('Variable,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('Variable,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}exports[_0xf326('0x14')]=function(_0x453100){var _0x18bee3=this;return new Promise(function(_0x31ffb9,_0xcef2b5){return db[_0xf326('0x15')]['find']({'raw':_0x453100['options']?_0x453100['options'][_0xf326('0x16')]===undefined?!![]:![]:!![],'where':_0x453100[_0xf326('0x17')]?_0x453100['options']['where']||null:null,'attributes':_0x453100[_0xf326('0x17')]?_0x453100['options']['attributes']||null:null,'include':_0x453100[_0xf326('0x17')]?_0x453100[_0xf326('0x17')]['include']?_['map'](_0x453100[_0xf326('0x17')][_0xf326('0x18')],function(_0x5f21a2){return{'model':db[_0x5f21a2[_0xf326('0x19')]],'as':_0x5f21a2['as'],'attributes':_0x5f21a2[_0xf326('0x1a')],'include':_0x5f21a2[_0xf326('0x18')]?_[_0xf326('0x1b')](_0x5f21a2[_0xf326('0x18')],function(_0x2049ec){return{'model':db[_0x2049ec['model']],'as':_0x2049ec['as'],'attributes':_0x2049ec['attributes'],'include':_0x2049ec['include']?_[_0xf326('0x1b')](_0x2049ec[_0xf326('0x18')],function(_0x2cd45a){return{'model':db[_0x2cd45a[_0xf326('0x19')]],'as':_0x2cd45a['as'],'attributes':_0x2cd45a[_0xf326('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf326('0x1c')](function(_0x5217d4){logger[_0xf326('0xb')](_0xf326('0x14'),_0x453100);logger[_0xf326('0xe')]('ShowVariable',_0x453100,JSON[_0xf326('0x1d')](_0x5217d4));_0x31ffb9(_0x5217d4);})['catch'](function(_0x4a9abf){logger[_0xf326('0xf')](_0xf326('0x14'),_0x4a9abf[_0xf326('0x11')],_0x453100);_0xcef2b5(_0x18bee3['error'](0x1f4,_0x4a9abf[_0xf326('0x11')]));});});}; \ No newline at end of file +var _0x1cb9=['include','map','model','then','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowVariable','Variable','options','attributes'];(function(_0xf237f7,_0xb11ac){var _0x2c183b=function(_0xe3b47b){while(--_0xe3b47b){_0xf237f7['push'](_0xf237f7['shift']());}};_0x2c183b(++_0xb11ac);}(_0x1cb9,0x14e));var _0x91cb=function(_0x41bdbc,_0x4c8a0d){_0x41bdbc=_0x41bdbc-0x0;var _0x4c481d=_0x1cb9[_0x41bdbc];return _0x4c481d;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Variable,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});}exports[_0x91cb('0x16')]=function(_0x1cd34b){var _0xcd1a78=this;return new Promise(function(_0x5cc1c3,_0x3fba4f){return db[_0x91cb('0x17')]['find']({'raw':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b['options']['raw']===undefined?!![]:![]:!![],'where':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')]['where']||null:null,'attributes':_0x1cd34b['options']?_0x1cd34b['options'][_0x91cb('0x19')]||null:null,'include':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1a')]?_['map'](_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1a')],function(_0x1fa837){return{'model':db[_0x1fa837['model']],'as':_0x1fa837['as'],'attributes':_0x1fa837[_0x91cb('0x19')],'include':_0x1fa837[_0x91cb('0x1a')]?_[_0x91cb('0x1b')](_0x1fa837[_0x91cb('0x1a')],function(_0x3ca500){return{'model':db[_0x3ca500[_0x91cb('0x1c')]],'as':_0x3ca500['as'],'attributes':_0x3ca500[_0x91cb('0x19')],'include':_0x3ca500[_0x91cb('0x1a')]?_[_0x91cb('0x1b')](_0x3ca500['include'],function(_0x59bf3a){return{'model':db[_0x59bf3a[_0x91cb('0x1c')]],'as':_0x59bf3a['as'],'attributes':_0x59bf3a['attributes']};}):[]};}):[]};}):[]:[]})[_0x91cb('0x1d')](function(_0x34d372){logger[_0x91cb('0xc')]('ShowVariable',_0x1cd34b);logger[_0x91cb('0xf')]('ShowVariable',_0x1cd34b,JSON[_0x91cb('0x11')](_0x34d372));_0x5cc1c3(_0x34d372);})[_0x91cb('0x15')](function(_0x3b3ee6){logger[_0x91cb('0x12')](_0x91cb('0x16'),_0x3b3ee6['message'],_0x1cd34b);_0x3fba4f(_0xcd1a78[_0x91cb('0x12')](0x1f4,_0x3b3ee6['message']));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index e7e5437..c211a7f 100644 --- a/server/api/version/index.js +++ b/server/api/version/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe2f4=['index','/fetch','isAuthenticated','canUpdate','/pull','pull','/restart','restart','/migrations','migrations','exports','Router','../../components/auth/service','./version.controller','get'];(function(_0xbbc6a8,_0x17eb6d){var _0x598c4c=function(_0x266425){while(--_0x266425){_0xbbc6a8['push'](_0xbbc6a8['shift']());}};_0x598c4c(++_0x17eb6d);}(_0xe2f4,0x1a0));var _0x4e2f=function(_0x31aa1f,_0x42ef34){_0x31aa1f=_0x31aa1f-0x0;var _0x2b4c46=_0xe2f4[_0x31aa1f];return _0x2b4c46;};'use strict';var express=require('express');var router=express[_0x4e2f('0x0')]();var auth=require(_0x4e2f('0x1'));var controller=require(_0x4e2f('0x2'));router[_0x4e2f('0x3')]('/',controller[_0x4e2f('0x4')]);router[_0x4e2f('0x3')](_0x4e2f('0x5'),auth[_0x4e2f('0x6')](),auth[_0x4e2f('0x7')](),controller['fetch']);router[_0x4e2f('0x3')]('/reset',auth['isAuthenticated'](),auth[_0x4e2f('0x7')](),controller['reset']);router[_0x4e2f('0x3')](_0x4e2f('0x8'),auth[_0x4e2f('0x6')](),auth[_0x4e2f('0x7')](),controller[_0x4e2f('0x9')]);router[_0x4e2f('0x3')](_0x4e2f('0xa'),auth[_0x4e2f('0x6')](),controller[_0x4e2f('0xb')]);router[_0x4e2f('0x3')](_0x4e2f('0xc'),controller[_0x4e2f('0xd')]);module[_0x4e2f('0xe')]=router; \ No newline at end of file +var _0xfa7c=['/migrations','migrations','express','Router','get','index','/fetch','isAuthenticated','canUpdate','fetch','/pull','pull','/restart','restart'];(function(_0x38ced4,_0x24263f){var _0x547c07=function(_0x279fc4){while(--_0x279fc4){_0x38ced4['push'](_0x38ced4['shift']());}};_0x547c07(++_0x24263f);}(_0xfa7c,0xc6));var _0xcfa7=function(_0x4d08e8,_0x46dfb2){_0x4d08e8=_0x4d08e8-0x0;var _0x3244ac=_0xfa7c[_0x4d08e8];return _0x3244ac;};'use strict';var express=require(_0xcfa7('0x0'));var router=express[_0xcfa7('0x1')]();var auth=require('../../components/auth/service');var controller=require('./version.controller');router[_0xcfa7('0x2')]('/',controller[_0xcfa7('0x3')]);router[_0xcfa7('0x2')](_0xcfa7('0x4'),auth[_0xcfa7('0x5')](),auth[_0xcfa7('0x6')](),controller[_0xcfa7('0x7')]);router[_0xcfa7('0x2')]('/reset',auth[_0xcfa7('0x5')](),auth[_0xcfa7('0x6')](),controller['reset']);router[_0xcfa7('0x2')](_0xcfa7('0x8'),auth[_0xcfa7('0x5')](),auth['canUpdate'](),controller[_0xcfa7('0x9')]);router[_0xcfa7('0x2')](_0xcfa7('0xa'),auth['isAuthenticated'](),controller[_0xcfa7('0xb')]);router[_0xcfa7('0x2')](_0xcfa7('0xc'),controller[_0xcfa7('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index c62f5b4..b131415 100644 --- a/server/api/version/version.controller.js +++ b/server/api/version/version.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x90cc=['../../config/logger','update','simple-git','root','index','exports','query','latest','fetch','tags','status','json','origin','master','error','git\x20fetch','reset','--hard','FETCH_HEAD','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','length','.js','push','sort','sequelize','Migration','getQueryInterface','constructor','map','Database\x20migrated\x20successfully\x20from\x20version\x20','Database\x20already\x20up-to-date','lodash','pkginfo','version','compare-versions','child_process','exec','../../config/environment','../../config/pm2'];(function(_0x5d3878,_0xc64460){var _0x4be8b9=function(_0x4756a2){while(--_0x4756a2){_0x5d3878['push'](_0x5d3878['shift']());}};_0x4be8b9(++_0xc64460);}(_0x90cc,0xc8));var _0xc90c=function(_0x2a9f03,_0x4ebaad){_0x2a9f03=_0x2a9f03-0x0;var _0x1bd245=_0x90cc[_0x2a9f03];return _0x1bd245;};'use strict';var Umzug=require('umzug');var path=require('path');var fs=require('fs');var _=require(_0xc90c('0x0'));var pkginfo=require(_0xc90c('0x1'))(module,_0xc90c('0x2'));var compareVersions=require(_0xc90c('0x3'));var exec=require(_0xc90c('0x4'))[_0xc90c('0x5')];var db=require('../../mysqldb')['db'];var config=require(_0xc90c('0x6'));var pm2=require(_0xc90c('0x7'));var logger=require(_0xc90c('0x8'))(_0xc90c('0x9'));var git=require(_0xc90c('0xa'))(config[_0xc90c('0xb')]);exports[_0xc90c('0xc')]=function(_0x33cca7,_0x49ccf2){var _0x578a97={'current':module[_0xc90c('0xd')][_0xc90c('0x2')],'phonebar':0x2};if(_0x33cca7['query']&&_0x33cca7[_0xc90c('0xe')][_0xc90c('0xf')]){return git[_0xc90c('0x10')]()[_0xc90c('0x11')](function(_0x3fd8e3,_0x419638){_0x578a97[_0xc90c('0xf')]=(_0x3fd8e3?module[_0xc90c('0xd')]['version']:_0x419638['latest'])||'2.0.0';return _0x49ccf2[_0xc90c('0x12')](0xc8)[_0xc90c('0x13')](_0x578a97);});}else{return _0x49ccf2[_0xc90c('0x12')](0xc8)[_0xc90c('0x13')](_0x578a97);}};exports[_0xc90c('0x10')]=function(_0x474b1d,_0x3f9615){return git[_0xc90c('0x10')]([_0xc90c('0x14'),_0xc90c('0x15')],function(_0x45f586){if(_0x45f586){logger[_0xc90c('0x16')](_0x45f586);return _0x3f9615['status'](0x1f4)[_0xc90c('0x13')](_0x45f586);}logger['info'](_0xc90c('0x17'));return _0x3f9615['status'](0xc8)[_0xc90c('0x13')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0xc90c('0x18')]=function(_0x496668,_0xefe79a){return git[_0xc90c('0x18')]([_0xc90c('0x19'),_0xc90c('0x1a')],function(_0x21d1e5){if(_0x21d1e5){logger[_0xc90c('0x16')](_0x21d1e5);return _0xefe79a[_0xc90c('0x12')](0x1f4)['json'](_0x21d1e5);}logger[_0xc90c('0x1b')](_0xc90c('0x1c'));return _0xefe79a[_0xc90c('0x12')](0xc8)[_0xc90c('0x13')]({'output':_0xc90c('0x1d')});});};exports[_0xc90c('0x1e')]=function(_0x5c1901,_0x4ff18d){exec(_0xc90c('0x1f'),function(_0x512bac,_0x4aec5e,_0x4f41cd){logger['info'](_0x4aec5e);logger['info'](_0x4f41cd);if(_0x512bac){logger[_0xc90c('0x16')](_0x512bac);return _0x4ff18d[_0xc90c('0x12')](0x1f4)[_0xc90c('0x13')](_0x512bac);}return _0x4ff18d[_0xc90c('0x12')](0xc8)[_0xc90c('0x13')]({'output':_0x4aec5e});});};exports[_0xc90c('0x20')]=function(_0x4589a0,_0x5d0c2f){return pm2['restart'](_0xc90c('0x21'))[_0xc90c('0x22')](function(_0x37b250){logger[_0xc90c('0x1b')]('pm2\x20restart\x20motion\x20%s',_0x37b250);return _0x5d0c2f['status'](0xc8)['json']({'output':_0xc90c('0x23')});})[_0xc90c('0x24')](function(_0x380b14){logger[_0xc90c('0x16')](_0x380b14);return _0x5d0c2f['status'](0x1f4)[_0xc90c('0x13')](_0x380b14);});};exports[_0xc90c('0x25')]=function(_0x1e0e72,_0x420a5d){var _0x288da4=fs[_0xc90c('0x26')](path[_0xc90c('0x27')](config[_0xc90c('0xb')],_0xc90c('0x28'),_0xc90c('0x25')));var _0x8c89be=[];for(var _0x58035e=0x0;_0x58035e<_0x288da4[_0xc90c('0x29')];_0x58035e++){var _0x5562d9=_0x288da4[_0x58035e]['replace'](_0xc90c('0x2a'),'');if(compareVersions(module[_0xc90c('0xd')]['version'],_0x5562d9)===-0x1){_0x8c89be[_0xc90c('0x2b')](_0x5562d9);}}if(_0x8c89be[_0xc90c('0x29')]){var _0x5ddda5=_0x8c89be[_0xc90c('0x2c')](compareVersions);var _0x3f2702=new Umzug({'storage':_0xc90c('0x2d'),'storageOptions':{'model':db['Migration'],'modelName':_0xc90c('0x2e'),'columnName':'version'},'migrations':{'params':[db[_0xc90c('0x2d')][_0xc90c('0x2f')](),db[_0xc90c('0x2d')][_0xc90c('0x30')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path['join'](config[_0xc90c('0xb')],'server',_0xc90c('0x25')),'pattern':/\.js$/}});_0x3f2702['up']({'migrations':_[_0xc90c('0x31')](_0x5ddda5,function(_0x7977c){return _0x7977c+'.js';})})[_0xc90c('0x22')](function(){return _0x420a5d[_0xc90c('0x12')](0xc8)[_0xc90c('0x13')]({'output':_0xc90c('0x32')+module[_0xc90c('0xd')][_0xc90c('0x2')]+'\x20to\x20'+_['last'](_0x5ddda5),'migrations':_['join'](_0x5ddda5)});})[_0xc90c('0x24')](function(_0x5f2fab){if(_0x5f2fab instanceof db[_0xc90c('0x2d')]['UniqueConstraintError']){return _0x420a5d[_0xc90c('0x12')](0xc8)[_0xc90c('0x13')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x420a5d[_0xc90c('0x12')](0x1f4)['json'](_0x5f2fab);}});}else{return _0x420a5d[_0xc90c('0x12')](0xc8)[_0xc90c('0x13')]({'output':_0xc90c('0x33')});}}; \ No newline at end of file +var _0xe224=['git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','then','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','join','root','server','replace','.js','length','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','path','lodash','pkginfo','version','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','index','query','fetch','tags','latest','exports','2.0.0','status','json','origin','master','error','info'];(function(_0x3c255b,_0x5a7900){var _0x6d7591=function(_0x222cda){while(--_0x222cda){_0x3c255b['push'](_0x3c255b['shift']());}};_0x6d7591(++_0x5a7900);}(_0xe224,0x15b));var _0x4e22=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe224[_0x20a584];return _0x4b41a8;};'use strict';var Umzug=require('umzug');var path=require(_0x4e22('0x0'));var fs=require('fs');var _=require(_0x4e22('0x1'));var pkginfo=require(_0x4e22('0x2'))(module,_0x4e22('0x3'));var compareVersions=require('compare-versions');var exec=require('child_process')[_0x4e22('0x4')];var db=require(_0x4e22('0x5'))['db'];var config=require(_0x4e22('0x6'));var pm2=require(_0x4e22('0x7'));var logger=require(_0x4e22('0x8'))(_0x4e22('0x9'));var git=require(_0x4e22('0xa'))(config['root']);exports[_0x4e22('0xb')]=function(_0x94c51a,_0x307927){var _0x5ea30d={'current':module['exports'][_0x4e22('0x3')],'phonebar':0x2};if(_0x94c51a[_0x4e22('0xc')]&&_0x94c51a[_0x4e22('0xc')]['latest']){return git[_0x4e22('0xd')]()[_0x4e22('0xe')](function(_0x1510b2,_0x54ba81){_0x5ea30d[_0x4e22('0xf')]=(_0x1510b2?module[_0x4e22('0x10')][_0x4e22('0x3')]:_0x54ba81[_0x4e22('0xf')])||_0x4e22('0x11');return _0x307927[_0x4e22('0x12')](0xc8)[_0x4e22('0x13')](_0x5ea30d);});}else{return _0x307927['status'](0xc8)[_0x4e22('0x13')](_0x5ea30d);}};exports[_0x4e22('0xd')]=function(_0x3f4d67,_0x28f3ce){return git[_0x4e22('0xd')]([_0x4e22('0x14'),_0x4e22('0x15')],function(_0x1f9f27){if(_0x1f9f27){logger[_0x4e22('0x16')](_0x1f9f27);return _0x28f3ce[_0x4e22('0x12')](0x1f4)[_0x4e22('0x13')](_0x1f9f27);}logger[_0x4e22('0x17')](_0x4e22('0x18'));return _0x28f3ce[_0x4e22('0x12')](0xc8)[_0x4e22('0x13')]({'output':_0x4e22('0x19')});});};exports['reset']=function(_0x37561c,_0x556da6){return git[_0x4e22('0x1a')]([_0x4e22('0x1b'),'FETCH_HEAD'],function(_0x17f915){if(_0x17f915){logger[_0x4e22('0x16')](_0x17f915);return _0x556da6[_0x4e22('0x12')](0x1f4)[_0x4e22('0x13')](_0x17f915);}logger[_0x4e22('0x17')](_0x4e22('0x1c'));return _0x556da6[_0x4e22('0x12')](0xc8)['json']({'output':_0x4e22('0x1d')});});};exports[_0x4e22('0x1e')]=function(_0xfe277b,_0x338e0c){exec(_0x4e22('0x1f'),function(_0x5f320d,_0x198906,_0x57673f){logger[_0x4e22('0x17')](_0x198906);logger[_0x4e22('0x17')](_0x57673f);if(_0x5f320d){logger[_0x4e22('0x16')](_0x5f320d);return _0x338e0c[_0x4e22('0x12')](0x1f4)[_0x4e22('0x13')](_0x5f320d);}return _0x338e0c[_0x4e22('0x12')](0xc8)[_0x4e22('0x13')]({'output':_0x198906});});};exports['restart']=function(_0x3826ee,_0x101f0b){return pm2[_0x4e22('0x20')]('motion2')[_0x4e22('0x21')](function(_0x370b5f){logger[_0x4e22('0x17')]('pm2\x20restart\x20motion\x20%s',_0x370b5f);return _0x101f0b[_0x4e22('0x12')](0xc8)[_0x4e22('0x13')]({'output':_0x4e22('0x22')});})['catch'](function(_0x347667){logger['error'](_0x347667);return _0x101f0b['status'](0x1f4)['json'](_0x347667);});};exports[_0x4e22('0x23')]=function(_0xf3accb,_0x113131){var _0x3720d8=fs[_0x4e22('0x24')](path[_0x4e22('0x25')](config[_0x4e22('0x26')],_0x4e22('0x27'),'migrations'));var _0x5c5c54=[];for(var _0x2424c5=0x0;_0x2424c5<_0x3720d8['length'];_0x2424c5++){var _0x510db3=_0x3720d8[_0x2424c5][_0x4e22('0x28')](_0x4e22('0x29'),'');if(compareVersions(module[_0x4e22('0x10')][_0x4e22('0x3')],_0x510db3)===-0x1){_0x5c5c54['push'](_0x510db3);}}if(_0x5c5c54[_0x4e22('0x2a')]){var _0x57e5f5=_0x5c5c54[_0x4e22('0x2b')](compareVersions);var _0x1a9325=new Umzug({'storage':_0x4e22('0x2c'),'storageOptions':{'model':db['Migration'],'modelName':_0x4e22('0x2d'),'columnName':_0x4e22('0x3')},'migrations':{'params':[db[_0x4e22('0x2c')][_0x4e22('0x2e')](),db['sequelize'][_0x4e22('0x2f')],function(){throw new Error(_0x4e22('0x30'));}],'path':path[_0x4e22('0x25')](config[_0x4e22('0x26')],_0x4e22('0x27'),_0x4e22('0x23')),'pattern':/\.js$/}});_0x1a9325['up']({'migrations':_['map'](_0x57e5f5,function(_0xa88228){return _0xa88228+'.js';})})['then'](function(){return _0x113131['status'](0xc8)[_0x4e22('0x13')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x4e22('0x10')][_0x4e22('0x3')]+_0x4e22('0x31')+_[_0x4e22('0x32')](_0x57e5f5),'migrations':_[_0x4e22('0x25')](_0x57e5f5)});})['catch'](function(_0x19e69f){if(_0x19e69f instanceof db[_0x4e22('0x2c')][_0x4e22('0x33')]){return _0x113131[_0x4e22('0x12')](0xc8)[_0x4e22('0x13')]({'output':_0x4e22('0x34')});}else{return _0x113131[_0x4e22('0x12')](0x1f4)['json'](_0x19e69f);}});}else{return _0x113131[_0x4e22('0x12')](0xc8)[_0x4e22('0x13')]({'output':_0x4e22('0x34')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index e2a18e4..809f3a7 100644 --- a/server/api/voiceAgentReport/index.js +++ b/server/api/voiceAgentReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3185=['../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x49e838,_0x4d36a4){var _0x31db07=function(_0x7b8a6a){while(--_0x7b8a6a){_0x49e838['push'](_0x49e838['shift']());}};_0x31db07(++_0x4d36a4);}(_0x3185,0xf6));var _0x5318=function(_0x3c902b,_0x12e11c){_0x3c902b=_0x3c902b-0x0;var _0x5c785a=_0x3185[_0x3c902b];return _0x5c785a;};'use strict';var multer=require(_0x5318('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5318('0x1'));var express=require(_0x5318('0x2'));var router=express[_0x5318('0x3')]();var fs_extra=require(_0x5318('0x4'));var auth=require(_0x5318('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5318('0x6'));var controller=require(_0x5318('0x7'));router[_0x5318('0x8')]('/',auth[_0x5318('0x9')](),controller['index']);router['get'](_0x5318('0xa'),auth[_0x5318('0x9')](),controller[_0x5318('0xb')]);router[_0x5318('0x8')](_0x5318('0xc'),auth[_0x5318('0x9')](),controller[_0x5318('0xd')]);router[_0x5318('0xe')]('/',auth[_0x5318('0x9')](),controller[_0x5318('0xf')]);router[_0x5318('0x10')](_0x5318('0xc'),auth[_0x5318('0x9')](),controller[_0x5318('0x11')]);router[_0x5318('0x12')](_0x5318('0xc'),auth[_0x5318('0x9')](),controller[_0x5318('0x13')]);module[_0x5318('0x14')]=router; \ No newline at end of file +var _0xb57e=['destroy','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','put'];(function(_0x18327d,_0x5eaa42){var _0x1c6ba6=function(_0x4880ce){while(--_0x4880ce){_0x18327d['push'](_0x18327d['shift']());}};_0x1c6ba6(++_0x5eaa42);}(_0xb57e,0x111));var _0xeb57=function(_0x5bdd42,_0x37c72f){_0x5bdd42=_0x5bdd42-0x0;var _0x396b0d=_0xb57e[_0x5bdd42];return _0x396b0d;};'use strict';var multer=require(_0xeb57('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xeb57('0x1'));var express=require('express');var router=express[_0xeb57('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xeb57('0x3'));var interaction=require(_0xeb57('0x4'));var config=require(_0xeb57('0x5'));var controller=require(_0xeb57('0x6'));router['get']('/',auth[_0xeb57('0x7')](),controller[_0xeb57('0x8')]);router[_0xeb57('0x9')](_0xeb57('0xa'),auth[_0xeb57('0x7')](),controller[_0xeb57('0xb')]);router['get'](_0xeb57('0xc'),auth[_0xeb57('0x7')](),controller[_0xeb57('0xd')]);router[_0xeb57('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xeb57('0xf')]('/:id',auth[_0xeb57('0x7')](),controller['update']);router['delete']('/:id',auth[_0xeb57('0x7')](),controller[_0xeb57('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 2d43689..a424c7c 100644 --- a/server/api/voiceAgentReport/voiceAgentReport.attributes.js +++ b/server/api/voiceAgentReport/voiceAgentReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4b17=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x4b17,0x10f));var _0x74b1=function(_0x1dac7a,_0x1828ce){_0x1dac7a=_0x1dac7a-0x0;var _0x4cb363=_0x4b17[_0x1dac7a];return _0x4cb363;};'use strict';var Sequelize=require(_0x74b1('0x0'));module['exports']={'type':{'type':Sequelize[_0x74b1('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x74b1('0x1')]},'calleridname':{'type':Sequelize[_0x74b1('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x74b1('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x74b1('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x74b1('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x74b1('0x2')]},'agentdumpAt':{'type':Sequelize[_0x74b1('0x2')]},'holdtime':{'type':Sequelize[_0x74b1('0x3')]},'agentcomplete':{'type':Sequelize[_0x74b1('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x74b1('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x74b1('0x3')]},'agentacw':{'type':Sequelize[_0x74b1('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x74b1('0x3')]},'reason':{'type':Sequelize[_0x74b1('0x1')]},'lastevent':{'type':Sequelize[_0x74b1('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x74b1('0x3')]},'channelstatedesc':{'type':Sequelize[_0x74b1('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x74b1('0x1')]},'language':{'type':Sequelize[_0x74b1('0x1')]},'accountcode':{'type':Sequelize[_0x74b1('0x1')]},'context':{'type':Sequelize[_0x74b1('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x74b1('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x74b1('0x1')]},'destcalleridnum':{'type':Sequelize[_0x74b1('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x74b1('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x74b1('0x1')]},'destpriority':{'type':Sequelize[_0x74b1('0x1')]},'destuniqueid':{'type':Sequelize[_0x74b1('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x74b1('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x74b1('0x1')]},'transfer':{'type':Sequelize[_0x74b1('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x74b1('0x5')},'transferexten':{'type':Sequelize[_0x74b1('0x1')]},'transferuniqueid':{'type':Sequelize[_0x74b1('0x1')]},'agententerreason':{'type':Sequelize[_0x74b1('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7d25=['DATE','INTEGER','BOOLEAN','exports','STRING'];(function(_0xebbb8f,_0x39c01b){var _0xb876fb=function(_0x2a318a){while(--_0x2a318a){_0xebbb8f['push'](_0xebbb8f['shift']());}};_0xb876fb(++_0x39c01b);}(_0x7d25,0x8a));var _0x57d2=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x7d25[_0x1203f];return _0x365f0a;};'use strict';var Sequelize=require('sequelize');module[_0x57d2('0x0')]={'type':{'type':Sequelize[_0x57d2('0x1')]},'uniqueid':{'type':Sequelize[_0x57d2('0x1')]},'calleridnum':{'type':Sequelize[_0x57d2('0x1')]},'calleridname':{'type':Sequelize[_0x57d2('0x1')]},'queue':{'type':Sequelize[_0x57d2('0x1')]},'interface':{'type':Sequelize[_0x57d2('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x57d2('0x2')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x57d2('0x3')]},'agentcomplete':{'type':Sequelize[_0x57d2('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x57d2('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x57d2('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x57d2('0x1')]},'lastevent':{'type':Sequelize[_0x57d2('0x1')]},'channel':{'type':Sequelize[_0x57d2('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x57d2('0x1')]},'connectedlinenum':{'type':Sequelize[_0x57d2('0x1')]},'connectedlinename':{'type':Sequelize[_0x57d2('0x1')]},'language':{'type':Sequelize[_0x57d2('0x1')]},'accountcode':{'type':Sequelize[_0x57d2('0x1')]},'context':{'type':Sequelize[_0x57d2('0x1')]},'exten':{'type':Sequelize[_0x57d2('0x1')]},'priority':{'type':Sequelize[_0x57d2('0x1')]},'destchannel':{'type':Sequelize[_0x57d2('0x1')]},'destchannelstate':{'type':Sequelize[_0x57d2('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x57d2('0x1')]},'destcalleridnum':{'type':Sequelize[_0x57d2('0x1')]},'destcalleridname':{'type':Sequelize[_0x57d2('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x57d2('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x57d2('0x1')]},'destlanguage':{'type':Sequelize[_0x57d2('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x57d2('0x1')]},'destpriority':{'type':Sequelize[_0x57d2('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x57d2('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x57d2('0x1')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x57d2('0x1')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x57d2('0x1')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x57d2('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 9ae0552..46fb93f 100644 --- a/server/api/voiceAgentReport/voiceAgentReport.controller.js +++ b/server/api/voiceAgentReport/voiceAgentReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file +var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index 640cb6d..5130ae7 100644 --- a/server/api/voiceAgentReport/voiceAgentReport.model.js +++ b/server/api/voiceAgentReport/voiceAgentReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x39c7=['destuniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceAgentReport.attributes','define','uniqueid'];(function(_0x2acf33,_0x4184a1){var _0x57555d=function(_0x3b909c){while(--_0x3b909c){_0x2acf33['push'](_0x2acf33['shift']());}};_0x57555d(++_0x4184a1);}(_0x39c7,0x85));var _0x739c=function(_0x4c2c72,_0x295857){_0x4c2c72=_0x4c2c72-0x0;var _0x13e980=_0x39c7[_0x4c2c72];return _0x13e980;};'use strict';var _=require('lodash');var util=require(_0x739c('0x0'));var logger=require(_0x739c('0x1'))(_0x739c('0x2'));var moment=require(_0x739c('0x3'));var BPromise=require(_0x739c('0x4'));var rp=require(_0x739c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x739c('0x6'));var config=require(_0x739c('0x7'));var attributes=require(_0x739c('0x8'));module['exports']=function(_0x4c5030,_0x1923d9){return _0x4c5030[_0x739c('0x9')]('VoiceAgentReport',attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x739c('0xa'),_0x739c('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8a28=['destuniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voiceAgentReport.attributes','exports','VoiceAgentReport','uniqueid'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x8a28,0xfd));var _0x88a2=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0x8a28[_0x5e36d1];return _0x950b9e;};'use strict';var _=require(_0x88a2('0x0'));var util=require(_0x88a2('0x1'));var logger=require(_0x88a2('0x2'))(_0x88a2('0x3'));var moment=require(_0x88a2('0x4'));var BPromise=require(_0x88a2('0x5'));var rp=require(_0x88a2('0x6'));var fs=require('fs');var path=require(_0x88a2('0x7'));var rimraf=require('rimraf');var config=require(_0x88a2('0x8'));var attributes=require(_0x88a2('0x9'));module[_0x88a2('0xa')]=function(_0x438e32,_0x29ce92){return _0x438e32['define'](_0x88a2('0xb'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x88a2('0xc'),_0x88a2('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index d2ac304..d483c45 100644 --- a/server/api/voiceAgentReport/voiceAgentReport.rpc.js +++ b/server/api/voiceAgentReport/voiceAgentReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb53e=['util','moment','randomstring','../../config/utils','../../config/logger','rpc','http','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','message','catch','VoiceAgentReport','body','options','raw','CreateVoiceAgentReport','debug','stringify','update','where','attributes','limit','UpdateVoiceAgentReport','lodash'];(function(_0x301bee,_0x91a563){var _0x3fbdbc=function(_0x4a7222){while(--_0x4a7222){_0x301bee['push'](_0x301bee['shift']());}};_0x3fbdbc(++_0x91a563);}(_0xb53e,0x1db));var _0xeb53=function(_0x555e37,_0x44c858){_0x555e37=_0x555e37-0x0;var _0xcd685f=_0xb53e[_0x555e37];return _0xcd685f;};'use strict';var _=require(_0xeb53('0x0'));var util=require(_0xeb53('0x1'));var moment=require(_0xeb53('0x2'));var BPromise=require('bluebird');var rs=require(_0xeb53('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeb53('0x4'));var logger=require(_0xeb53('0x5'))(_0xeb53('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xeb53('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x33bb9a,_0x55fbc1,_0x47e85c){return new BPromise(function(_0xe6854a,_0x5a57a2){return client['request'](_0x33bb9a,_0x47e85c)[_0xeb53('0x8')](function(_0x1c05ef){logger[_0xeb53('0x9')](_0xeb53('0xa'),_0x55fbc1,_0xeb53('0xb'));logger['debug'](_0xeb53('0xc'),_0x55fbc1,'request\x20sent',JSON['stringify'](_0x1c05ef));if(_0x1c05ef['error']){if(_0x1c05ef[_0xeb53('0xd')]['code']===0x1f4){logger[_0xeb53('0xd')](_0xeb53('0xa'),_0x55fbc1,_0x1c05ef[_0xeb53('0xd')][_0xeb53('0xe')]);return _0x5a57a2(_0x1c05ef['error'][_0xeb53('0xe')]);}logger[_0xeb53('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x55fbc1,_0x1c05ef[_0xeb53('0xd')][_0xeb53('0xe')]);return _0xe6854a(_0x1c05ef['error'][_0xeb53('0xe')]);}else{logger[_0xeb53('0x9')]('VoiceAgentReport,\x20%s,\x20%s',_0x55fbc1,_0xeb53('0xb'));_0xe6854a(_0x1c05ef['result'][_0xeb53('0xe')]);}})[_0xeb53('0xf')](function(_0x5e8fb1){logger[_0xeb53('0xd')](_0xeb53('0xa'),_0x55fbc1,_0x5e8fb1);_0x5a57a2(_0x5e8fb1);});});}exports['CreateVoiceAgentReport']=function(_0x3a0118){var _0x4b9052=this;return new Promise(function(_0x1b9628,_0x6dc8f6){return db[_0xeb53('0x10')]['create'](_0x3a0118[_0xeb53('0x11')],{'raw':_0x3a0118[_0xeb53('0x12')]?_0x3a0118[_0xeb53('0x12')][_0xeb53('0x13')]===undefined?!![]:![]:!![]})[_0xeb53('0x8')](function(_0x14e20e){logger['info'](_0xeb53('0x14'),_0x3a0118);logger[_0xeb53('0x15')]('CreateVoiceAgentReport',_0x3a0118,JSON[_0xeb53('0x16')](_0x14e20e));_0x1b9628(_0x14e20e);})['catch'](function(_0x34ac11){logger['error']('CreateVoiceAgentReport',_0x34ac11[_0xeb53('0xe')],_0x3a0118);_0x6dc8f6(_0x4b9052[_0xeb53('0xd')](0x1f4,_0x34ac11[_0xeb53('0xe')]));});});};exports['UpdateVoiceAgentReport']=function(_0x10ca28){var _0x2ab626=this;return new Promise(function(_0x2900d9,_0x2f15e4){return db[_0xeb53('0x10')][_0xeb53('0x17')](_0x10ca28[_0xeb53('0x11')],{'raw':_0x10ca28[_0xeb53('0x12')]?_0x10ca28[_0xeb53('0x12')][_0xeb53('0x13')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10ca28[_0xeb53('0x12')]?_0x10ca28[_0xeb53('0x12')][_0xeb53('0x18')]||null:null,'attributes':_0x10ca28['options']?_0x10ca28[_0xeb53('0x12')][_0xeb53('0x19')]||null:null,'limit':_0x10ca28[_0xeb53('0x12')]?_0x10ca28[_0xeb53('0x12')][_0xeb53('0x1a')]||null:null})[_0xeb53('0x8')](function(_0x16da12){logger['info']('UpdateVoiceAgentReport',_0x10ca28);logger['debug']('UpdateVoiceAgentReport',_0x10ca28,JSON[_0xeb53('0x16')](_0x16da12));_0x2900d9(_0x16da12);})[_0xeb53('0xf')](function(_0x24c08f){logger[_0xeb53('0xd')](_0xeb53('0x1b'),_0x24c08f[_0xeb53('0xe')],_0x10ca28);_0x2f15e4(_0x2ab626[_0xeb53('0xd')](0x1f4,_0x24c08f[_0xeb53('0xe')]));});});}; \ No newline at end of file +var _0xe84c=['info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','UpdateVoiceAgentReport','update','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x255ac0,_0x3f6645){var _0x437bf1=function(_0x5baff0){while(--_0x5baff0){_0x255ac0['push'](_0x255ac0['shift']());}};_0x437bf1(++_0x3f6645);}(_0xe84c,0xee));var _0xce84=function(_0x117e9a,_0x14dcfc){_0x117e9a=_0x117e9a-0x0;var _0x103e88=_0xe84c[_0x117e9a];return _0x103e88;};'use strict';var _=require('lodash');var util=require(_0xce84('0x0'));var moment=require(_0xce84('0x1'));var BPromise=require(_0xce84('0x2'));var rs=require(_0xce84('0x3'));var fs=require('fs');var Redis=require(_0xce84('0x4'));var db=require(_0xce84('0x5'))['db'];var utils=require(_0xce84('0x6'));var logger=require(_0xce84('0x7'))('rpc');var config=require(_0xce84('0x8'));var jayson=require(_0xce84('0x9'));var client=jayson[_0xce84('0xa')][_0xce84('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x449bd6,_0xf89413,_0x42fa4b){return new BPromise(function(_0x4225a6,_0x4b8aac){return client[_0xce84('0xc')](_0x449bd6,_0x42fa4b)[_0xce84('0xd')](function(_0x3a8597){logger[_0xce84('0xe')](_0xce84('0xf'),_0xf89413,_0xce84('0x10'));logger[_0xce84('0x11')](_0xce84('0x12'),_0xf89413,_0xce84('0x10'),JSON[_0xce84('0x13')](_0x3a8597));if(_0x3a8597[_0xce84('0x14')]){if(_0x3a8597[_0xce84('0x14')][_0xce84('0x15')]===0x1f4){logger[_0xce84('0x14')](_0xce84('0xf'),_0xf89413,_0x3a8597[_0xce84('0x14')][_0xce84('0x16')]);return _0x4b8aac(_0x3a8597[_0xce84('0x14')][_0xce84('0x16')]);}logger[_0xce84('0x14')]('VoiceAgentReport,\x20%s,\x20%s',_0xf89413,_0x3a8597[_0xce84('0x14')]['message']);return _0x4225a6(_0x3a8597[_0xce84('0x14')]['message']);}else{logger['info'](_0xce84('0xf'),_0xf89413,'request\x20sent');_0x4225a6(_0x3a8597[_0xce84('0x17')]['message']);}})[_0xce84('0x18')](function(_0x4bcafb){logger[_0xce84('0x14')](_0xce84('0xf'),_0xf89413,_0x4bcafb);_0x4b8aac(_0x4bcafb);});});}exports[_0xce84('0x19')]=function(_0x4918f1){var _0x4b5182=this;return new Promise(function(_0x4dff65,_0x9fae4f){return db[_0xce84('0x1a')][_0xce84('0x1b')](_0x4918f1[_0xce84('0x1c')],{'raw':_0x4918f1[_0xce84('0x1d')]?_0x4918f1[_0xce84('0x1d')][_0xce84('0x1e')]===undefined?!![]:![]:!![]})[_0xce84('0xd')](function(_0x41fab5){logger[_0xce84('0xe')]('CreateVoiceAgentReport',_0x4918f1);logger['debug']('CreateVoiceAgentReport',_0x4918f1,JSON[_0xce84('0x13')](_0x41fab5));_0x4dff65(_0x41fab5);})['catch'](function(_0xe407bb){logger[_0xce84('0x14')](_0xce84('0x19'),_0xe407bb[_0xce84('0x16')],_0x4918f1);_0x9fae4f(_0x4b5182[_0xce84('0x14')](0x1f4,_0xe407bb['message']));});});};exports[_0xce84('0x1f')]=function(_0x275507){var _0x6cd50c=this;return new Promise(function(_0x1bc377,_0x1c00f9){return db[_0xce84('0x1a')][_0xce84('0x20')](_0x275507['body'],{'raw':_0x275507[_0xce84('0x1d')]?_0x275507[_0xce84('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x275507[_0xce84('0x1d')]?_0x275507[_0xce84('0x1d')][_0xce84('0x21')]||null:null,'attributes':_0x275507[_0xce84('0x1d')]?_0x275507['options'][_0xce84('0x22')]||null:null,'limit':_0x275507[_0xce84('0x1d')]?_0x275507[_0xce84('0x1d')][_0xce84('0x23')]||null:null})[_0xce84('0xd')](function(_0x2fb303){logger[_0xce84('0xe')](_0xce84('0x1f'),_0x275507);logger[_0xce84('0x11')]('UpdateVoiceAgentReport',_0x275507,JSON[_0xce84('0x13')](_0x2fb303));_0x1bc377(_0x2fb303);})['catch'](function(_0x5e9eef){logger['error']('UpdateVoiceAgentReport',_0x5e9eef[_0xce84('0x16')],_0x275507);_0x1c00f9(_0x6cd50c['error'](0x1f4,_0x5e9eef[_0xce84('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 32c4a63..41b5b3b 100644 --- a/server/api/voiceCallReport/index.js +++ b/server/api/voiceCallReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd0bb=['express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','destroy','exports','multer','util','path'];(function(_0x42e186,_0x40ee6b){var _0x3b36c4=function(_0xf4c536){while(--_0xf4c536){_0x42e186['push'](_0x42e186['shift']());}};_0x3b36c4(++_0x40ee6b);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x5b2c50,_0x4db66b){_0x5b2c50=_0x5b2c50-0x0;var _0x47f2f9=_0xd0bb[_0x5b2c50];return _0x47f2f9;};'use strict';var multer=require(_0xbd0b('0x0'));var util=require(_0xbd0b('0x1'));var path=require(_0xbd0b('0x2'));var timeout=require('connect-timeout');var express=require(_0xbd0b('0x3'));var router=express['Router']();var fs_extra=require(_0xbd0b('0x4'));var auth=require(_0xbd0b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbd0b('0x6'));var controller=require('./voiceCallReport.controller');router[_0xbd0b('0x7')]('/',auth[_0xbd0b('0x8')](),controller[_0xbd0b('0x9')]);router[_0xbd0b('0x7')](_0xbd0b('0xa'),auth['isAuthenticated'](),controller[_0xbd0b('0xb')]);router[_0xbd0b('0x7')](_0xbd0b('0xc'),auth[_0xbd0b('0x8')](),controller[_0xbd0b('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbd0b('0xe')]);router[_0xbd0b('0xf')]('/:id',auth[_0xbd0b('0x8')](),controller[_0xbd0b('0x10')]);router['delete'](_0xbd0b('0xc'),auth[_0xbd0b('0x8')](),controller[_0xbd0b('0x11')]);module[_0xbd0b('0x12')]=router; \ No newline at end of file +var _0x0309=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','index','get','isAuthenticated','/:id','post','create','update','delete','destroy','multer','path','express'];(function(_0x4e27c3,_0x4f890f){var _0x12d23d=function(_0x2b1d62){while(--_0x2b1d62){_0x4e27c3['push'](_0x4e27c3['shift']());}};_0x12d23d(++_0x4f890f);}(_0x0309,0x165));var _0x9030=function(_0x3db292,_0xbb0479){_0x3db292=_0x3db292-0x0;var _0x44255e=_0x0309[_0x3db292];return _0x44255e;};'use strict';var multer=require(_0x9030('0x0'));var util=require('util');var path=require(_0x9030('0x1'));var timeout=require('connect-timeout');var express=require(_0x9030('0x2'));var router=express[_0x9030('0x3')]();var fs_extra=require(_0x9030('0x4'));var auth=require(_0x9030('0x5'));var interaction=require(_0x9030('0x6'));var config=require(_0x9030('0x7'));var controller=require(_0x9030('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x9030('0x9')]);router[_0x9030('0xa')]('/describe',auth[_0x9030('0xb')](),controller['describe']);router[_0x9030('0xa')](_0x9030('0xc'),auth[_0x9030('0xb')](),controller['show']);router[_0x9030('0xd')]('/',auth[_0x9030('0xb')](),controller[_0x9030('0xe')]);router['put'](_0x9030('0xc'),auth[_0x9030('0xb')](),controller[_0x9030('0xf')]);router[_0x9030('0x10')](_0x9030('0xc'),auth[_0x9030('0xb')](),controller[_0x9030('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index b4eab46..77a4f0d 100644 --- a/server/api/voiceCallReport/voiceCallReport.attributes.js +++ b/server/api/voiceCallReport/voiceCallReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd472=['exports','STRING','inbound','internal','outbound','inbound-fax','outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize'];(function(_0x3ec45b,_0x438d73){var _0x2c8b12=function(_0x314b68){while(--_0x314b68){_0x3ec45b['push'](_0x3ec45b['shift']());}};_0x2c8b12(++_0x438d73);}(_0xd472,0x1eb));var _0x2d47=function(_0x2e7323,_0x524e79){_0x2e7323=_0x2e7323-0x0;var _0x58a813=_0xd472[_0x2e7323];return _0x58a813;};'use strict';var Sequelize=require(_0x2d47('0x0'));module[_0x2d47('0x1')]={'uniqueid':{'type':Sequelize[_0x2d47('0x2')]},'type':{'type':Sequelize['ENUM'](_0x2d47('0x3'),_0x2d47('0x4'),_0x2d47('0x5'),_0x2d47('0x6'),_0x2d47('0x7'),_0x2d47('0x8'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0x2d47('0x2')]},'destination':{'type':Sequelize[_0x2d47('0x2')]},'destinationcontext':{'type':Sequelize[_0x2d47('0x2')]},'callerid':{'type':Sequelize[_0x2d47('0x2')]},'channel':{'type':Sequelize[_0x2d47('0x2')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x2d47('0x2')]},'lastdata':{'type':Sequelize[_0x2d47('0x9')]},'starttime':{'type':Sequelize[_0x2d47('0xa')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x2d47('0xa')]},'duration':{'type':Sequelize[_0x2d47('0xb')]},'billableseconds':{'type':Sequelize[_0x2d47('0xb')]},'mohtime':{'type':Sequelize[_0x2d47('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x2d47('0x2')]},'userfield':{'type':Sequelize[_0x2d47('0x2')]},'userDisposition':{'type':Sequelize[_0x2d47('0x2')]},'userSecondDisposition':{'type':Sequelize[_0x2d47('0x2')]},'userThirdDisposition':{'type':Sequelize[_0x2d47('0x2')]},'note':{'type':Sequelize[_0x2d47('0x2')]},'prefix':{'type':Sequelize[_0x2d47('0x2')]},'routeid':{'type':Sequelize[_0x2d47('0xb')]},'sipcallid':{'type':Sequelize[_0x2d47('0x2')]}}; \ No newline at end of file +var _0x1485=['STRING','ENUM','internal','inbound-fax','outbound-fax','dialer','TEXT','DATE','INTEGER','exports'];(function(_0x56ea6f,_0x15535a){var _0x43ac31=function(_0x1b6d99){while(--_0x1b6d99){_0x56ea6f['push'](_0x56ea6f['shift']());}};_0x43ac31(++_0x15535a);}(_0x1485,0x77));var _0x5148=function(_0x97bb36,_0x4de233){_0x97bb36=_0x97bb36-0x0;var _0x2e70d5=_0x1485[_0x97bb36];return _0x2e70d5;};'use strict';var Sequelize=require('sequelize');module[_0x5148('0x0')]={'uniqueid':{'type':Sequelize[_0x5148('0x1')]},'type':{'type':Sequelize[_0x5148('0x2')]('inbound',_0x5148('0x3'),'outbound',_0x5148('0x4'),_0x5148('0x5'),_0x5148('0x6'))},'tag':{'type':Sequelize[_0x5148('0x1')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x5148('0x1')]},'destinationcontext':{'type':Sequelize[_0x5148('0x1')]},'callerid':{'type':Sequelize[_0x5148('0x1')]},'channel':{'type':Sequelize[_0x5148('0x1')]},'destinationchannel':{'type':Sequelize[_0x5148('0x1')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x5148('0x7')]},'starttime':{'type':Sequelize[_0x5148('0x8')]},'systemanswertime':{'type':Sequelize[_0x5148('0x8')]},'answertime':{'type':Sequelize[_0x5148('0x8')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0x5148('0x9')]},'billableseconds':{'type':Sequelize[_0x5148('0x9')]},'mohtime':{'type':Sequelize[_0x5148('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x5148('0x1')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x5148('0x1')]},'userDisposition':{'type':Sequelize[_0x5148('0x1')]},'userSecondDisposition':{'type':Sequelize[_0x5148('0x1')]},'userThirdDisposition':{'type':Sequelize[_0x5148('0x1')]},'note':{'type':Sequelize[_0x5148('0x1')]},'prefix':{'type':Sequelize[_0x5148('0x1')]},'routeid':{'type':Sequelize[_0x5148('0x9')]},'sipcallid':{'type':Sequelize[_0x5148('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 82e5b14..bb25c67 100644 --- a/server/api/voiceCallReport/voiceCallReport.controller.js +++ b/server/api/voiceCallReport/voiceCallReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','VoiceCallReport','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','count','includeAll','fullname','alias','User','findAll','rows','params','find','create','body','catch','describe','update','uniqueid','user','eml-format','zip-dir','request-promise','moment'];(function(_0x57c48a,_0xf38316){var _0x5af402=function(_0x163d4c){while(--_0x163d4c){_0x57c48a['push'](_0x57c48a['shift']());}};_0x5af402(++_0xf38316);}(_0x0b0e,0x187));var _0xe0b0=function(_0x492af5,_0xd51471){_0x492af5=_0x492af5-0x0;var _0x59f529=_0x0b0e[_0x492af5];return _0x59f529;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['VoiceCallReport'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'attributes':['id',_0xe0b0('0x27'),_0xe0b0('0x41'),_0xe0b0('0x42')],'model':db[_0xe0b0('0x43')],'as':_0xe0b0('0x43')}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x44')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x52ffe4){_0x36d137[_0xe0b0('0x45')]=_0x52ffe4;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))['catch'](handleError(_0x5b7a64,null));};exports['show']=function(_0x327fb4,_0x247f8d){var _0x56e7df={'raw':!![],'where':{'id':_0x327fb4[_0xe0b0('0x46')]['id']}},_0x18a59d={};_0x18a59d[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db[_0xe0b0('0x2a')]['rawAttributes']);_0x18a59d['query']=_['keys'](_0x327fb4[_0xe0b0('0x2e')]);_0x18a59d[_0xe0b0('0x39')]=_['intersection'](_0x18a59d[_0xe0b0('0x31')],_0x18a59d[_0xe0b0('0x2e')]);_0x56e7df[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x18a59d[_0xe0b0('0x31')],qs['fields'](_0x327fb4['query'][_0xe0b0('0x33')]));_0x56e7df[_0xe0b0('0x32')]=_0x56e7df[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x56e7df[_0xe0b0('0x32')]:_0x18a59d['model'];if(_0x327fb4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x56e7df['include']=[{'all':!![]}];}_0x56e7df=_['merge']({},_0x56e7df,_0x327fb4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x47')](_0x56e7df)[_0xe0b0('0x23')](handleEntityNotFound(_0x247f8d,null))[_0xe0b0('0x23')](respondWithResult(_0x247f8d,null))['catch'](handleError(_0x247f8d,null));};exports[_0xe0b0('0x48')]=function(_0x87d8f3,_0x483f12){return db['VoiceCallReport'][_0xe0b0('0x48')](_0x87d8f3[_0xe0b0('0x49')],{})['then'](respondWithResult(_0x483f12,0xc9))[_0xe0b0('0x4a')](handleError(_0x483f12,null));};exports[_0xe0b0('0x24')]=function(_0x504284,_0x5cb2b6){return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x504284[_0xe0b0('0x46')]['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x5cb2b6,null))[_0xe0b0('0x23')](removeEntity(_0x5cb2b6,null))[_0xe0b0('0x4a')](handleError(_0x5cb2b6,null));};exports[_0xe0b0('0x4b')]=function(_0xf9e694,_0x5f5486){return db['VoiceCallReport'][_0xe0b0('0x4b')]()['then'](respondWithResult(_0x5f5486,null))['catch'](handleError(_0x5f5486,null));};exports[_0xe0b0('0x4c')]=function(_0x222174,_0x54cf7b){if(_0x222174['body'][_0xe0b0('0x4d')]){delete _0x222174[_0xe0b0('0x49')][_0xe0b0('0x4d')];}return db[_0xe0b0('0x2a')][_0xe0b0('0x47')]({'where':{'uniqueid':_0x222174[_0xe0b0('0x46')]['id'],'UserId':{'$or':[null,_0x222174[_0xe0b0('0x4e')]['id']]}}})['then'](handleEntityNotFound(_0x54cf7b,null))[_0xe0b0('0x23')](saveUpdates(_0x222174['body'],null))[_0xe0b0('0x23')](respondWithResult(_0x54cf7b,null))['catch'](handleError(_0x54cf7b,null));}; \ No newline at end of file +var _0x5f2f=['stack','name','send','index','VoiceCallReport','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','fullname','alias','User','findAll','catch','params','keys','find','create','body','destroy','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0x5ad771,_0x34186f){var _0x5b5dce=function(_0x5ad0fb){while(--_0x5ad0fb){_0x5ad771['push'](_0x5ad771['shift']());}};_0x5b5dce(++_0x34186f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4d2caf,_0x243e5c){_0x4d2caf=_0x4d2caf-0x0;var _0x531936=_0x5f2f[_0x4d2caf];return _0x531936;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'attributes':['id',_0xf5f2('0x26'),_0xf5f2('0x3e'),_0xf5f2('0x3f')],'model':db['User'],'as':_0xf5f2('0x40')}];}return db[_0xf5f2('0x29')][_0xf5f2('0x41')](_0x22c826);})['then'](function(_0x509dbc){_0x11c771['rows']=_0x509dbc;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x42')](handleError(_0x53cb96,null));};exports['show']=function(_0x106272,_0xeed03d){var _0x28e33f={'raw':!![],'where':{'id':_0x106272[_0xf5f2('0x43')]['id']}},_0x31f86c={};_0x31f86c[_0xf5f2('0x31')]=_[_0xf5f2('0x44')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x31f86c[_0xf5f2('0x2e')]=_[_0xf5f2('0x44')](_0x106272[_0xf5f2('0x2e')]);_0x31f86c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x31f86c['model'],_0x31f86c[_0xf5f2('0x2e')]);_0x28e33f['attributes']=_[_0xf5f2('0x30')](_0x31f86c[_0xf5f2('0x31')],qs[_0xf5f2('0x33')](_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x28e33f[_0xf5f2('0x32')]=_0x28e33f['attributes'][_0xf5f2('0x34')]?_0x28e33f[_0xf5f2('0x32')]:_0x31f86c[_0xf5f2('0x31')];if(_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x28e33f[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x28e33f=_[_0xf5f2('0x39')]({},_0x28e33f,_0x106272[_0xf5f2('0x3b')]);return db['VoiceCallReport'][_0xf5f2('0x45')](_0x28e33f)[_0xf5f2('0x24')](handleEntityNotFound(_0xeed03d,null))[_0xf5f2('0x24')](respondWithResult(_0xeed03d,null))['catch'](handleError(_0xeed03d,null));};exports[_0xf5f2('0x46')]=function(_0xc91b64,_0x3179a9){return db['VoiceCallReport']['create'](_0xc91b64[_0xf5f2('0x47')],{})[_0xf5f2('0x24')](respondWithResult(_0x3179a9,0xc9))['catch'](handleError(_0x3179a9,null));};exports[_0xf5f2('0x48')]=function(_0x533cca,_0x740321){return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'id':_0x533cca['params']['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x740321,null))[_0xf5f2('0x24')](removeEntity(_0x740321,null))[_0xf5f2('0x42')](handleError(_0x740321,null));};exports[_0xf5f2('0x49')]=function(_0x4fa738,_0x3154c1){return db[_0xf5f2('0x29')]['describe']()['then'](respondWithResult(_0x3154c1,null))[_0xf5f2('0x42')](handleError(_0x3154c1,null));};exports[_0xf5f2('0x4a')]=function(_0x57782c,_0x22b645){if(_0x57782c[_0xf5f2('0x47')][_0xf5f2('0x4b')]){delete _0x57782c[_0xf5f2('0x47')]['uniqueid'];}return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'uniqueid':_0x57782c[_0xf5f2('0x43')]['id'],'UserId':{'$or':[null,_0x57782c['user']['id']]}}})[_0xf5f2('0x24')](handleEntityNotFound(_0x22b645,null))[_0xf5f2('0x24')](saveUpdates(_0x57782c[_0xf5f2('0x47')],null))[_0xf5f2('0x24')](respondWithResult(_0x22b645,null))[_0xf5f2('0x42')](handleError(_0x22b645,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 00eaa8d..69b7931 100644 --- a/server/api/voiceCallReport/voiceCallReport.model.js +++ b/server/api/voiceCallReport/voiceCallReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd9f9=['moment','bluebird','request-promise','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','lodash','util','../../config/logger','api'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0xd9f9,0xcc));var _0x9d9f=function(_0x1d240e,_0x303b04){_0x1d240e=_0x1d240e-0x0;var _0x59ca9b=_0xd9f9[_0x1d240e];return _0x59ca9b;};'use strict';var _=require(_0x9d9f('0x0'));var util=require(_0x9d9f('0x1'));var logger=require(_0x9d9f('0x2'))(_0x9d9f('0x3'));var moment=require(_0x9d9f('0x4'));var BPromise=require(_0x9d9f('0x5'));var rp=require(_0x9d9f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9d9f('0x7'));module[_0x9d9f('0x8')]=function(_0x506f5c,_0x2596b8){return _0x506f5c[_0x9d9f('0x9')](_0x9d9f('0xa'),attributes,{'tableName':_0x9d9f('0xb'),'paranoid':![],'indexes':[{'fields':[_0x9d9f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2a92=['request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','define','VoiceCallReport','report_call','uniqueid','lodash','util','../../config/logger','api'];(function(_0x47fb90,_0x24df2c){var _0x4dfe92=function(_0x3ee98b){while(--_0x3ee98b){_0x47fb90['push'](_0x47fb90['shift']());}};_0x4dfe92(++_0x24df2c);}(_0x2a92,0xbf));var _0x22a9=function(_0x42676f,_0x4c3299){_0x42676f=_0x42676f-0x0;var _0x2b884e=_0x2a92[_0x42676f];return _0x2b884e;};'use strict';var _=require(_0x22a9('0x0'));var util=require(_0x22a9('0x1'));var logger=require(_0x22a9('0x2'))(_0x22a9('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x22a9('0x4'));var fs=require('fs');var path=require(_0x22a9('0x5'));var rimraf=require(_0x22a9('0x6'));var config=require(_0x22a9('0x7'));var attributes=require(_0x22a9('0x8'));module['exports']=function(_0x5d9d1f,_0x3a3f84){return _0x5d9d1f[_0x22a9('0x9')](_0x22a9('0xa'),attributes,{'tableName':_0x22a9('0xb'),'paranoid':![],'indexes':[{'fields':[_0x22a9('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index e8857f1..adb21d1 100644 --- a/server/api/voiceCallReport/voiceCallReport.rpc.js +++ b/server/api/voiceCallReport/voiceCallReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0e19=['stringify','error','code','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','limit','include','model','map','create','body','CreateVoiceCallReport','update','UpdateVoiceCallReport','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5263d2,_0x476862){var _0x2363a0=function(_0x22380d){while(--_0x22380d){_0x5263d2['push'](_0x5263d2['shift']());}};_0x2363a0(++_0x476862);}(_0x0e19,0x64));var _0x90e1=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x0e19[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require(_0x90e1('0x0'));var moment=require(_0x90e1('0x1'));var BPromise=require(_0x90e1('0x2'));var rs=require(_0x90e1('0x3'));var fs=require('fs');var Redis=require(_0x90e1('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x90e1('0x5'))(_0x90e1('0x6'));var config=require(_0x90e1('0x7'));var jayson=require(_0x90e1('0x8'));var client=jayson[_0x90e1('0x9')][_0x90e1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b3eb0,_0x31ef49,_0x197bf5){return new BPromise(function(_0x3e1d2f,_0x44f0b1){return client[_0x90e1('0xb')](_0x2b3eb0,_0x197bf5)[_0x90e1('0xc')](function(_0x4c5808){logger[_0x90e1('0xd')](_0x90e1('0xe'),_0x31ef49,_0x90e1('0xf'));logger[_0x90e1('0x10')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x31ef49,_0x90e1('0xf'),JSON[_0x90e1('0x11')](_0x4c5808));if(_0x4c5808[_0x90e1('0x12')]){if(_0x4c5808[_0x90e1('0x12')][_0x90e1('0x13')]===0x1f4){logger[_0x90e1('0x12')](_0x90e1('0xe'),_0x31ef49,_0x4c5808[_0x90e1('0x12')][_0x90e1('0x14')]);return _0x44f0b1(_0x4c5808[_0x90e1('0x12')]['message']);}logger['error'](_0x90e1('0xe'),_0x31ef49,_0x4c5808[_0x90e1('0x12')][_0x90e1('0x14')]);return _0x3e1d2f(_0x4c5808[_0x90e1('0x12')]['message']);}else{logger[_0x90e1('0xd')]('VoiceCallReport,\x20%s,\x20%s',_0x31ef49,'request\x20sent');_0x3e1d2f(_0x4c5808[_0x90e1('0x15')]['message']);}})[_0x90e1('0x16')](function(_0x483620){logger['error'](_0x90e1('0xe'),_0x31ef49,_0x483620);_0x44f0b1(_0x483620);});});}exports[_0x90e1('0x17')]=function(_0x1aea31){var _0x11ceeb=this;return new Promise(function(_0x35d204,_0x4cebcc){return db[_0x90e1('0x18')][_0x90e1('0x19')]({'raw':_0x1aea31[_0x90e1('0x1a')]?_0x1aea31[_0x90e1('0x1a')][_0x90e1('0x1b')]===undefined?!![]:![]:!![],'where':_0x1aea31[_0x90e1('0x1a')]?_0x1aea31[_0x90e1('0x1a')][_0x90e1('0x1c')]||null:null,'attributes':_0x1aea31[_0x90e1('0x1a')]?_0x1aea31[_0x90e1('0x1a')][_0x90e1('0x1d')]||null:null,'limit':_0x1aea31[_0x90e1('0x1a')]?_0x1aea31['options'][_0x90e1('0x1e')]||null:null,'include':_0x1aea31[_0x90e1('0x1a')]?_0x1aea31['options']['include']?_['map'](_0x1aea31['options'][_0x90e1('0x1f')],function(_0x336ece){return{'model':db[_0x336ece[_0x90e1('0x20')]],'as':_0x336ece['as'],'attributes':_0x336ece[_0x90e1('0x1d')],'include':_0x336ece['include']?_[_0x90e1('0x21')](_0x336ece[_0x90e1('0x1f')],function(_0x25c2fd){return{'model':db[_0x25c2fd[_0x90e1('0x20')]],'as':_0x25c2fd['as'],'attributes':_0x25c2fd[_0x90e1('0x1d')],'include':_0x25c2fd[_0x90e1('0x1f')]?_['map'](_0x25c2fd[_0x90e1('0x1f')],function(_0xa87a6b){return{'model':db[_0xa87a6b[_0x90e1('0x20')]],'as':_0xa87a6b['as'],'attributes':_0xa87a6b[_0x90e1('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b613f){logger['info'](_0x90e1('0x17'),_0x1aea31);logger[_0x90e1('0x10')]('GetVoiceCallReport',_0x1aea31,JSON['stringify'](_0x4b613f));_0x35d204(_0x4b613f);})[_0x90e1('0x16')](function(_0x6969ed){logger[_0x90e1('0x12')](_0x90e1('0x17'),_0x6969ed[_0x90e1('0x14')],_0x1aea31);_0x4cebcc(_0x11ceeb[_0x90e1('0x12')](0x1f4,_0x6969ed['message']));});});};exports['CreateVoiceCallReport']=function(_0x2de2c0){var _0x326e4c=this;return new Promise(function(_0x4210ab,_0x15e541){return db[_0x90e1('0x18')][_0x90e1('0x22')](_0x2de2c0[_0x90e1('0x23')],{'raw':_0x2de2c0['options']?_0x2de2c0[_0x90e1('0x1a')][_0x90e1('0x1b')]===undefined?!![]:![]:!![]})[_0x90e1('0xc')](function(_0x594447){logger[_0x90e1('0xd')](_0x90e1('0x24'),_0x2de2c0);logger[_0x90e1('0x10')]('CreateVoiceCallReport',_0x2de2c0,JSON[_0x90e1('0x11')](_0x594447));_0x4210ab(_0x594447);})[_0x90e1('0x16')](function(_0x39ddc3){logger[_0x90e1('0x12')](_0x90e1('0x24'),_0x39ddc3[_0x90e1('0x14')],_0x2de2c0);_0x15e541(_0x326e4c['error'](0x1f4,_0x39ddc3[_0x90e1('0x14')]));});});};exports['UpdateVoiceCallReport']=function(_0x44be23){var _0x4f2b3f=this;return new Promise(function(_0xc6e05d,_0x52447f){return db[_0x90e1('0x18')][_0x90e1('0x25')](_0x44be23['body'],{'raw':_0x44be23['options']?_0x44be23[_0x90e1('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44be23[_0x90e1('0x1a')]?_0x44be23[_0x90e1('0x1a')][_0x90e1('0x1c')]||null:null,'attributes':_0x44be23[_0x90e1('0x1a')]?_0x44be23['options'][_0x90e1('0x1d')]||null:null,'limit':_0x44be23[_0x90e1('0x1a')]?_0x44be23['options']['limit']||null:null})['then'](function(_0x202624){logger[_0x90e1('0xd')](_0x90e1('0x26'),_0x44be23);logger['debug'](_0x90e1('0x26'),_0x44be23,JSON[_0x90e1('0x11')](_0x202624));_0xc6e05d(_0x202624);})['catch'](function(_0x429c63){logger[_0x90e1('0x12')]('UpdateVoiceCallReport',_0x429c63['message'],_0x44be23);_0x52447f(_0x4f2b3f['error'](0x1f4,_0x429c63[_0x90e1('0x14')]));});});}; \ No newline at end of file +var _0xed04=['message','result','GetVoiceCallReport','VoiceCallReport','options','raw','where','attributes','limit','include','map','model','debug','catch','CreateVoiceCallReport','UpdateVoiceCallReport','update','body','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xd77bf5,_0x42b453){var _0x48e838=function(_0x32d312){while(--_0x32d312){_0xd77bf5['push'](_0xd77bf5['shift']());}};_0x48e838(++_0x42b453);}(_0xed04,0xf6));var _0x4ed0=function(_0x18d9d7,_0x490bf0){_0x18d9d7=_0x18d9d7-0x0;var _0x2f4e0a=_0xed04[_0x18d9d7];return _0x2f4e0a;};'use strict';var _=require(_0x4ed0('0x0'));var util=require(_0x4ed0('0x1'));var moment=require(_0x4ed0('0x2'));var BPromise=require('bluebird');var rs=require(_0x4ed0('0x3'));var fs=require('fs');var Redis=require(_0x4ed0('0x4'));var db=require(_0x4ed0('0x5'))['db'];var utils=require(_0x4ed0('0x6'));var logger=require(_0x4ed0('0x7'))('rpc');var config=require(_0x4ed0('0x8'));var jayson=require(_0x4ed0('0x9'));var client=jayson['client'][_0x4ed0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b514d,_0x553960,_0x505697){return new BPromise(function(_0x18c0d8,_0x13e712){return client[_0x4ed0('0xb')](_0x2b514d,_0x505697)[_0x4ed0('0xc')](function(_0x25a2f0){logger[_0x4ed0('0xd')](_0x4ed0('0xe'),_0x553960,_0x4ed0('0xf'));logger['debug'](_0x4ed0('0x10'),_0x553960,_0x4ed0('0xf'),JSON[_0x4ed0('0x11')](_0x25a2f0));if(_0x25a2f0[_0x4ed0('0x12')]){if(_0x25a2f0[_0x4ed0('0x12')][_0x4ed0('0x13')]===0x1f4){logger['error'](_0x4ed0('0xe'),_0x553960,_0x25a2f0['error'][_0x4ed0('0x14')]);return _0x13e712(_0x25a2f0['error'][_0x4ed0('0x14')]);}logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x553960,_0x25a2f0[_0x4ed0('0x12')]['message']);return _0x18c0d8(_0x25a2f0[_0x4ed0('0x12')]['message']);}else{logger[_0x4ed0('0xd')](_0x4ed0('0xe'),_0x553960,_0x4ed0('0xf'));_0x18c0d8(_0x25a2f0[_0x4ed0('0x15')][_0x4ed0('0x14')]);}})['catch'](function(_0x1b0ce0){logger[_0x4ed0('0x12')](_0x4ed0('0xe'),_0x553960,_0x1b0ce0);_0x13e712(_0x1b0ce0);});});}exports[_0x4ed0('0x16')]=function(_0x15327f){var _0x72b01c=this;return new Promise(function(_0x55b57f,_0x55729c){return db[_0x4ed0('0x17')]['findAll']({'raw':_0x15327f[_0x4ed0('0x18')]?_0x15327f[_0x4ed0('0x18')][_0x4ed0('0x19')]===undefined?!![]:![]:!![],'where':_0x15327f[_0x4ed0('0x18')]?_0x15327f[_0x4ed0('0x18')][_0x4ed0('0x1a')]||null:null,'attributes':_0x15327f['options']?_0x15327f[_0x4ed0('0x18')][_0x4ed0('0x1b')]||null:null,'limit':_0x15327f['options']?_0x15327f['options'][_0x4ed0('0x1c')]||null:null,'include':_0x15327f[_0x4ed0('0x18')]?_0x15327f['options'][_0x4ed0('0x1d')]?_[_0x4ed0('0x1e')](_0x15327f['options'][_0x4ed0('0x1d')],function(_0x5670e5){return{'model':db[_0x5670e5[_0x4ed0('0x1f')]],'as':_0x5670e5['as'],'attributes':_0x5670e5[_0x4ed0('0x1b')],'include':_0x5670e5[_0x4ed0('0x1d')]?_[_0x4ed0('0x1e')](_0x5670e5['include'],function(_0xbbbd16){return{'model':db[_0xbbbd16[_0x4ed0('0x1f')]],'as':_0xbbbd16['as'],'attributes':_0xbbbd16['attributes'],'include':_0xbbbd16[_0x4ed0('0x1d')]?_['map'](_0xbbbd16[_0x4ed0('0x1d')],function(_0x35aa26){return{'model':db[_0x35aa26[_0x4ed0('0x1f')]],'as':_0x35aa26['as'],'attributes':_0x35aa26[_0x4ed0('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x938348){logger['info'](_0x4ed0('0x16'),_0x15327f);logger[_0x4ed0('0x20')](_0x4ed0('0x16'),_0x15327f,JSON[_0x4ed0('0x11')](_0x938348));_0x55b57f(_0x938348);})[_0x4ed0('0x21')](function(_0x97f635){logger[_0x4ed0('0x12')](_0x4ed0('0x16'),_0x97f635['message'],_0x15327f);_0x55729c(_0x72b01c[_0x4ed0('0x12')](0x1f4,_0x97f635[_0x4ed0('0x14')]));});});};exports['CreateVoiceCallReport']=function(_0x34c217){var _0x5b48c8=this;return new Promise(function(_0x35f36d,_0x1f6be4){return db[_0x4ed0('0x17')]['create'](_0x34c217['body'],{'raw':_0x34c217[_0x4ed0('0x18')]?_0x34c217[_0x4ed0('0x18')][_0x4ed0('0x19')]===undefined?!![]:![]:!![]})[_0x4ed0('0xc')](function(_0x4d7ae9){logger[_0x4ed0('0xd')](_0x4ed0('0x22'),_0x34c217);logger['debug'](_0x4ed0('0x22'),_0x34c217,JSON['stringify'](_0x4d7ae9));_0x35f36d(_0x4d7ae9);})[_0x4ed0('0x21')](function(_0xefa26a){logger[_0x4ed0('0x12')](_0x4ed0('0x22'),_0xefa26a['message'],_0x34c217);_0x1f6be4(_0x5b48c8['error'](0x1f4,_0xefa26a[_0x4ed0('0x14')]));});});};exports[_0x4ed0('0x23')]=function(_0x26dbf0){var _0x14cc5f=this;return new Promise(function(_0x56a185,_0x1efd2a){return db['VoiceCallReport'][_0x4ed0('0x24')](_0x26dbf0[_0x4ed0('0x25')],{'raw':_0x26dbf0[_0x4ed0('0x18')]?_0x26dbf0[_0x4ed0('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26dbf0[_0x4ed0('0x18')]?_0x26dbf0[_0x4ed0('0x18')][_0x4ed0('0x1a')]||null:null,'attributes':_0x26dbf0[_0x4ed0('0x18')]?_0x26dbf0[_0x4ed0('0x18')][_0x4ed0('0x1b')]||null:null,'limit':_0x26dbf0[_0x4ed0('0x18')]?_0x26dbf0[_0x4ed0('0x18')]['limit']||null:null})[_0x4ed0('0xc')](function(_0x29c2f8){logger[_0x4ed0('0xd')](_0x4ed0('0x23'),_0x26dbf0);logger[_0x4ed0('0x20')]('UpdateVoiceCallReport',_0x26dbf0,JSON[_0x4ed0('0x11')](_0x29c2f8));_0x56a185(_0x29c2f8);})[_0x4ed0('0x21')](function(_0x201280){logger[_0x4ed0('0x12')](_0x4ed0('0x23'),_0x201280[_0x4ed0('0x14')],_0x26dbf0);_0x1efd2a(_0x14cc5f[_0x4ed0('0x12')](0x1f4,_0x201280[_0x4ed0('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index b264c0c..54f80a5 100644 --- a/server/api/voiceChanSpy/index.js +++ b/server/api/voiceChanSpy/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x20a1=['/:id','update','delete','destroy','exports','multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceChanSpy.controller','get','isAuthenticated','index','show','post','create','put'];(function(_0x3805e9,_0x33a4ed){var _0x207e20=function(_0x293840){while(--_0x293840){_0x3805e9['push'](_0x3805e9['shift']());}};_0x207e20(++_0x33a4ed);}(_0x20a1,0x101));var _0x120a=function(_0x324e2c,_0x29c55a){_0x324e2c=_0x324e2c-0x0;var _0x27caf1=_0x20a1[_0x324e2c];return _0x27caf1;};'use strict';var multer=require(_0x120a('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x120a('0x1')]();var fs_extra=require(_0x120a('0x2'));var auth=require(_0x120a('0x3'));var interaction=require(_0x120a('0x4'));var config=require('../../config/environment');var controller=require(_0x120a('0x5'));router[_0x120a('0x6')]('/',auth[_0x120a('0x7')](),controller[_0x120a('0x8')]);router[_0x120a('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x120a('0x9')]);router[_0x120a('0xa')]('/',auth[_0x120a('0x7')](),controller[_0x120a('0xb')]);router[_0x120a('0xc')](_0x120a('0xd'),auth['isAuthenticated'](),controller[_0x120a('0xe')]);router[_0x120a('0xf')](_0x120a('0xd'),auth[_0x120a('0x7')](),controller[_0x120a('0x10')]);module[_0x120a('0x11')]=router; \ No newline at end of file +var _0x6391=['/:id','post','create','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get'];(function(_0x4154b2,_0x315ca1){var _0xf4400e=function(_0x1c0fe6){while(--_0x1c0fe6){_0x4154b2['push'](_0x4154b2['shift']());}};_0xf4400e(++_0x315ca1);}(_0x6391,0x115));var _0x1639=function(_0x2a6d45,_0x3c9321){_0x2a6d45=_0x2a6d45-0x0;var _0x295253=_0x6391[_0x2a6d45];return _0x295253;};'use strict';var multer=require(_0x1639('0x0'));var util=require(_0x1639('0x1'));var path=require(_0x1639('0x2'));var timeout=require(_0x1639('0x3'));var express=require('express');var router=express[_0x1639('0x4')]();var fs_extra=require(_0x1639('0x5'));var auth=require(_0x1639('0x6'));var interaction=require(_0x1639('0x7'));var config=require('../../config/environment');var controller=require('./voiceChanSpy.controller');router['get']('/',auth[_0x1639('0x8')](),controller[_0x1639('0x9')]);router[_0x1639('0xa')](_0x1639('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1639('0xc')]('/',auth[_0x1639('0x8')](),controller[_0x1639('0xd')]);router[_0x1639('0xe')](_0x1639('0xb'),auth[_0x1639('0x8')](),controller[_0x1639('0xf')]);router[_0x1639('0x10')]('/:id',auth[_0x1639('0x8')](),controller['destroy']);module[_0x1639('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index e9b1529..ab3d659 100644 --- a/server/api/voiceChanSpy/voiceChanSpy.attributes.js +++ b/server/api/voiceChanSpy/voiceChanSpy.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x381b=['sequelize','STRING','name','setDataValue','join','getDataValue','options','BOOLEAN'];(function(_0x564b7f,_0x162734){var _0x194ae6=function(_0x25fe6b){while(--_0x25fe6b){_0x564b7f['push'](_0x564b7f['shift']());}};_0x194ae6(++_0x162734);}(_0x381b,0x100));var _0xb381=function(_0xa25342,_0x24522b){_0xa25342=_0xa25342-0x0;var _0x52be43=_0x381b[_0xa25342];return _0x52be43;};'use strict';var Sequelize=require(_0xb381('0x0'));module['exports']={'name':{'type':Sequelize[_0xb381('0x1')]},'prefix':{'type':Sequelize[_0xb381('0x1')],'unique':_0xb381('0x2'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x49da78){this[_0xb381('0x3')]('options',_0x49da78?_0x49da78[_0xb381('0x4')](''):[]);},'get':function(){return this[_0xb381('0x5')](_0xb381('0x6'))?this[_0xb381('0x5')]('options')['split'](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0xb381('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xb381('0x1')]},'description':{'type':Sequelize[_0xb381('0x1')]}}; \ No newline at end of file +var _0xe6a3=['name','setDataValue','options','join','getDataValue','split','BOOLEAN','exports','STRING'];(function(_0x52e68e,_0x309912){var _0x3211a4=function(_0x467c01){while(--_0x467c01){_0x52e68e['push'](_0x52e68e['shift']());}};_0x3211a4(++_0x309912);}(_0xe6a3,0xf1));var _0x3e6a=function(_0x3042c5,_0x36cb88){_0x3042c5=_0x3042c5-0x0;var _0x7cd140=_0xe6a3[_0x3042c5];return _0x7cd140;};'use strict';var Sequelize=require('sequelize');module[_0x3e6a('0x0')]={'name':{'type':Sequelize[_0x3e6a('0x1')]},'prefix':{'type':Sequelize[_0x3e6a('0x1')],'unique':_0x3e6a('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x3e6a('0x1')],'set':function(_0x25d0fb){this[_0x3e6a('0x3')](_0x3e6a('0x4'),_0x25d0fb?_0x25d0fb[_0x3e6a('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0x3e6a('0x4'))?this[_0x3e6a('0x6')](_0x3e6a('0x4'))[_0x3e6a('0x7')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x3e6a('0x1')]},'record':{'type':Sequelize[_0x3e6a('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x3e6a('0x1')]},'description':{'type':Sequelize[_0x3e6a('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 588d99e..08a0085 100644 --- a/server/api/voiceChanSpy/voiceChanSpy.controller.js +++ b/server/api/voiceChanSpy/voiceChanSpy.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaf93=['sort','where','filters','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','apply','reject','then','get','ChanSpies','UserProfileResource','destroy','end','sendStatus','stack','name','index','VoiceChanSpy','rawAttributes','type','key','model','query','intersection','attributes','fields','length','nolimit'];(function(_0xabd630,_0x53cf00){var _0x35e2d0=function(_0x42561e){while(--_0x42561e){_0xabd630['push'](_0xabd630['shift']());}};_0x35e2d0(++_0x53cf00);}(_0xaf93,0x151));var _0x3af9=function(_0x189b1d,_0x1df005){_0x189b1d=_0x189b1d-0x0;var _0x3d8ab0=_0xaf93[_0x189b1d];return _0x3d8ab0;};'use strict';var emlformat=require(_0x3af9('0x0'));var rimraf=require(_0x3af9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3af9('0x2'));var moment=require(_0x3af9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3af9('0x4'));var util=require(_0x3af9('0x5'));var path=require(_0x3af9('0x6'));var sox=require(_0x3af9('0x7'));var csv=require(_0x3af9('0x8'));var ejs=require(_0x3af9('0x9'));var fs=require('fs');var fs_extra=require(_0x3af9('0xa'));var _=require('lodash');var squel=require(_0x3af9('0xb'));var crypto=require('crypto');var jsforce=require(_0x3af9('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3af9('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3af9('0xe'));var qs=require(_0x3af9('0xf'));var as=require(_0x3af9('0x10'));var hardwareService=require(_0x3af9('0x11'));var logger=require('../../config/logger')(_0x3af9('0x12'));var utils=require(_0x3af9('0x13'));var config=require(_0x3af9('0x14'));var licenseUtil=require(_0x3af9('0x15'));var db=require(_0x3af9('0x16'))['db'];function respondWithStatusCode(_0xfa1410,_0x212f63){_0x212f63=_0x212f63||0xcc;return function(_0xa7b81f){if(_0xa7b81f){return _0xfa1410['sendStatus'](_0x212f63);}return _0xfa1410[_0x3af9('0x17')](_0x212f63)['end']();};}function respondWithResult(_0x152254,_0x222b6f){_0x222b6f=_0x222b6f||0xc8;return function(_0x1e4ebb){if(_0x1e4ebb){return _0x152254['status'](_0x222b6f)[_0x3af9('0x18')](_0x1e4ebb);}};}function respondWithFilteredResult(_0x1088fc,_0x37cb8b){return function(_0x4b2845){if(_0x4b2845){var _0x278e80=typeof _0x37cb8b[_0x3af9('0x19')]===_0x3af9('0x1a')&&typeof _0x37cb8b[_0x3af9('0x1b')]==='undefined';var _0x1d3410=_0x4b2845[_0x3af9('0x1c')];var _0x298135=_0x278e80?0x0:_0x37cb8b[_0x3af9('0x19')];var _0x314df2=_0x278e80?_0x4b2845['count']:_0x37cb8b[_0x3af9('0x19')]+_0x37cb8b[_0x3af9('0x1b')];var _0x1f9214;if(_0x314df2>=_0x1d3410){_0x314df2=_0x1d3410;_0x1f9214=0xc8;}else{_0x1f9214=0xce;}_0x1088fc[_0x3af9('0x17')](_0x1f9214);return _0x1088fc[_0x3af9('0x1d')]('Content-Range',_0x298135+'-'+_0x314df2+'/'+_0x1d3410)[_0x3af9('0x18')](_0x4b2845);}return null;};}function patchUpdates(_0x34eb91){return function(_0x449349){try{jsonpatch[_0x3af9('0x1e')](_0x449349,_0x34eb91,!![]);}catch(_0x3c1793){return BPromise[_0x3af9('0x1f')](_0x3c1793);}return _0x449349['save']();};}function saveUpdates(_0x4a88ea,_0x505e25){return function(_0x5e24e3){if(_0x5e24e3){return _0x5e24e3['update'](_0x4a88ea)[_0x3af9('0x20')](function(_0x5c1c8f){return _0x5c1c8f;});}return null;};}function removeEntity(_0x74c872,_0x307f9d){return function(_0x4b5a5c){if(_0x4b5a5c){return _0x4b5a5c['destroy']()['then'](function(){var _0x119e85=_0x4b5a5c[_0x3af9('0x21')]({'plain':!![]});var _0x22965b=_0x3af9('0x22');return db[_0x3af9('0x23')][_0x3af9('0x24')]({'where':{'type':_0x22965b,'resourceId':_0x119e85['id']}})[_0x3af9('0x20')](function(){return _0x4b5a5c;});})[_0x3af9('0x20')](function(){_0x74c872['status'](0xcc)[_0x3af9('0x25')]();});}};}function handleEntityNotFound(_0x574b71,_0x485754){return function(_0x177650){if(!_0x177650){_0x574b71[_0x3af9('0x26')](0x194);}return _0x177650;};}function handleError(_0x19643f,_0xf8840){_0xf8840=_0xf8840||0x1f4;return function(_0x374382){logger['error'](_0x374382[_0x3af9('0x27')]);if(_0x374382[_0x3af9('0x28')]){delete _0x374382[_0x3af9('0x28')];}_0x19643f['status'](_0xf8840)['send'](_0x374382);};}exports[_0x3af9('0x29')]=function(_0x1d022d,_0x8867c6){var _0x540969={},_0x4186d5={},_0x115673={'count':0x0,'rows':[]};var _0x1c923d=_['map'](db[_0x3af9('0x2a')][_0x3af9('0x2b')],function(_0x407572){return{'name':_0x407572['fieldName'],'type':_0x407572[_0x3af9('0x2c')][_0x3af9('0x2d')]};});_0x4186d5[_0x3af9('0x2e')]=_['map'](_0x1c923d,_0x3af9('0x28'));_0x4186d5[_0x3af9('0x2f')]=_['keys'](_0x1d022d[_0x3af9('0x2f')]);_0x4186d5['filters']=_[_0x3af9('0x30')](_0x4186d5['model'],_0x4186d5['query']);_0x540969[_0x3af9('0x31')]=_['intersection'](_0x4186d5[_0x3af9('0x2e')],qs[_0x3af9('0x32')](_0x1d022d[_0x3af9('0x2f')]['fields']));_0x540969['attributes']=_0x540969[_0x3af9('0x31')][_0x3af9('0x33')]?_0x540969['attributes']:_0x4186d5['model'];if(!_0x1d022d[_0x3af9('0x2f')]['hasOwnProperty'](_0x3af9('0x34'))){_0x540969[_0x3af9('0x1b')]=qs['limit'](_0x1d022d['query'][_0x3af9('0x1b')]);_0x540969[_0x3af9('0x19')]=qs[_0x3af9('0x19')](_0x1d022d[_0x3af9('0x2f')][_0x3af9('0x19')]);}_0x540969['order']=qs['sort'](_0x1d022d[_0x3af9('0x2f')][_0x3af9('0x35')]);_0x540969[_0x3af9('0x36')]=qs[_0x3af9('0x37')](_['pick'](_0x1d022d['query'],_0x4186d5[_0x3af9('0x37')]),_0x1c923d);if(_0x1d022d[_0x3af9('0x2f')][_0x3af9('0x38')]){_0x540969['where']=_[_0x3af9('0x39')](_0x540969[_0x3af9('0x36')],{'$or':_[_0x3af9('0x3a')](_0x1c923d,function(_0x576c86){if(_0x576c86[_0x3af9('0x2c')]!=='VIRTUAL'){var _0x1f3ac9={};_0x1f3ac9[_0x576c86[_0x3af9('0x28')]]={'$like':'%'+_0x1d022d[_0x3af9('0x2f')][_0x3af9('0x38')]+'%'};return _0x1f3ac9;}})});}_0x540969=_[_0x3af9('0x39')]({},_0x540969,_0x1d022d[_0x3af9('0x3b')]);var _0x43fd62={'where':_0x540969[_0x3af9('0x36')]};return db[_0x3af9('0x2a')][_0x3af9('0x1c')](_0x43fd62)[_0x3af9('0x20')](function(_0x4d7bd4){_0x115673[_0x3af9('0x1c')]=_0x4d7bd4;if(_0x1d022d[_0x3af9('0x2f')][_0x3af9('0x3c')]){_0x540969[_0x3af9('0x3d')]=[{'all':!![]}];}return db[_0x3af9('0x2a')][_0x3af9('0x3e')](_0x540969);})[_0x3af9('0x20')](function(_0x384a61){_0x115673[_0x3af9('0x3f')]=_0x384a61;return _0x115673;})[_0x3af9('0x20')](respondWithFilteredResult(_0x8867c6,_0x540969))[_0x3af9('0x40')](handleError(_0x8867c6,null));};exports[_0x3af9('0x41')]=function(_0x549274,_0x542580){var _0x461dd6={'raw':![],'where':{'id':_0x549274[_0x3af9('0x42')]['id']}},_0x1daea4={};_0x1daea4[_0x3af9('0x2e')]=_[_0x3af9('0x43')](db[_0x3af9('0x2a')][_0x3af9('0x2b')]);_0x1daea4[_0x3af9('0x2f')]=_[_0x3af9('0x43')](_0x549274[_0x3af9('0x2f')]);_0x1daea4[_0x3af9('0x37')]=_[_0x3af9('0x30')](_0x1daea4[_0x3af9('0x2e')],_0x1daea4['query']);_0x461dd6[_0x3af9('0x31')]=_[_0x3af9('0x30')](_0x1daea4[_0x3af9('0x2e')],qs[_0x3af9('0x32')](_0x549274['query']['fields']));_0x461dd6[_0x3af9('0x31')]=_0x461dd6['attributes'][_0x3af9('0x33')]?_0x461dd6[_0x3af9('0x31')]:_0x1daea4[_0x3af9('0x2e')];if(_0x549274[_0x3af9('0x2f')]['includeAll']){_0x461dd6[_0x3af9('0x3d')]=[{'all':!![]}];}_0x461dd6=_[_0x3af9('0x39')]({},_0x461dd6,_0x549274[_0x3af9('0x3b')]);return db['VoiceChanSpy']['find'](_0x461dd6)[_0x3af9('0x20')](handleEntityNotFound(_0x542580,null))['then'](respondWithResult(_0x542580,null))['catch'](handleError(_0x542580,null));};exports['create']=function(_0x19bd47,_0x3bc784){return db[_0x3af9('0x2a')][_0x3af9('0x44')](_0x19bd47[_0x3af9('0x45')],{})[_0x3af9('0x20')](function(_0x442681){var _0x48377b=_0x19bd47[_0x3af9('0x46')][_0x3af9('0x21')]({'plain':!![]});if(!_0x48377b)throw new Error(_0x3af9('0x47'));if(_0x48377b[_0x3af9('0x48')]===_0x3af9('0x46')){var _0x1104d4=_0x442681['get']({'plain':!![]});var _0x1b4509=_0x3af9('0x22');return db[_0x3af9('0x49')][_0x3af9('0x4a')]({'where':{'name':_0x1b4509,'userProfileId':_0x48377b['userProfileId']},'raw':!![]})[_0x3af9('0x20')](function(_0x39d954){if(_0x39d954&&_0x39d954[_0x3af9('0x4b')]===0x0){return db[_0x3af9('0x23')]['create']({'name':_0x1104d4[_0x3af9('0x28')],'resourceId':_0x1104d4['id'],'type':_0x39d954[_0x3af9('0x28')],'sectionId':_0x39d954['id']},{})[_0x3af9('0x20')](function(){return _0x442681;});}else{return _0x442681;}})[_0x3af9('0x40')](function(_0x4c75b6){logger['error'](_0x3af9('0x4c'),_0x4c75b6);throw _0x4c75b6;});}return _0x442681;})[_0x3af9('0x20')](respondWithResult(_0x3bc784,0xc9))[_0x3af9('0x40')](handleError(_0x3bc784,null));};exports[_0x3af9('0x4d')]=function(_0x3f087a,_0x268820){if(_0x3f087a[_0x3af9('0x45')]['id']){delete _0x3f087a[_0x3af9('0x45')]['id'];}return db[_0x3af9('0x2a')][_0x3af9('0x4a')]({'where':{'id':_0x3f087a[_0x3af9('0x42')]['id']}})['then'](handleEntityNotFound(_0x268820,null))[_0x3af9('0x20')](saveUpdates(_0x3f087a[_0x3af9('0x45')],null))['then'](respondWithResult(_0x268820,null))['catch'](handleError(_0x268820,null));};exports[_0x3af9('0x24')]=function(_0x4b205f,_0x27f717){return db[_0x3af9('0x2a')]['find']({'where':{'id':_0x4b205f['params']['id']}})[_0x3af9('0x20')](handleEntityNotFound(_0x27f717,null))[_0x3af9('0x20')](removeEntity(_0x27f717,null))[_0x3af9('0x40')](handleError(_0x27f717,null));}; \ No newline at end of file +var _0x279d=['send','index','map','VoiceChanSpy','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChanSpies','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','get','end','sendStatus','stack','name'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x279d,0x1d8));var _0xd279=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0x279d[_0x3e44fa];return _0x2a0aba;};'use strict';var emlformat=require(_0xd279('0x0'));var rimraf=require(_0xd279('0x1'));var zipdir=require(_0xd279('0x2'));var jsonpatch=require(_0xd279('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd279('0x4'));var Mustache=require(_0xd279('0x5'));var util=require('util');var path=require(_0xd279('0x6'));var sox=require(_0xd279('0x7'));var csv=require(_0xd279('0x8'));var ejs=require(_0xd279('0x9'));var fs=require('fs');var fs_extra=require(_0xd279('0xa'));var _=require(_0xd279('0xb'));var squel=require(_0xd279('0xc'));var crypto=require('crypto');var jsforce=require(_0xd279('0xd'));var deskjs=require(_0xd279('0xe'));var toCsv=require(_0xd279('0x8'));var querystring=require(_0xd279('0xf'));var Papa=require(_0xd279('0x10'));var Redis=require(_0xd279('0x11'));var authService=require(_0xd279('0x12'));var qs=require(_0xd279('0x13'));var as=require(_0xd279('0x14'));var hardwareService=require(_0xd279('0x15'));var logger=require(_0xd279('0x16'))('api');var utils=require(_0xd279('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xd279('0x18'));var db=require(_0xd279('0x19'))['db'];function respondWithStatusCode(_0x5056bd,_0xeb0828){_0xeb0828=_0xeb0828||0xcc;return function(_0x54f78b){if(_0x54f78b){return _0x5056bd['sendStatus'](_0xeb0828);}return _0x5056bd[_0xd279('0x1a')](_0xeb0828)['end']();};}function respondWithResult(_0x426d48,_0x5c3b48){_0x5c3b48=_0x5c3b48||0xc8;return function(_0x2bf8e3){if(_0x2bf8e3){return _0x426d48[_0xd279('0x1a')](_0x5c3b48)[_0xd279('0x1b')](_0x2bf8e3);}};}function respondWithFilteredResult(_0x1161b3,_0x5c1c0f){return function(_0x55b3c5){if(_0x55b3c5){var _0x20db5d=typeof _0x5c1c0f[_0xd279('0x1c')]===_0xd279('0x1d')&&typeof _0x5c1c0f[_0xd279('0x1e')]==='undefined';var _0x5701c0=_0x55b3c5['count'];var _0x5a52fd=_0x20db5d?0x0:_0x5c1c0f['offset'];var _0x1394bb=_0x20db5d?_0x55b3c5[_0xd279('0x1f')]:_0x5c1c0f['offset']+_0x5c1c0f[_0xd279('0x1e')];var _0xd3b5d3;if(_0x1394bb>=_0x5701c0){_0x1394bb=_0x5701c0;_0xd3b5d3=0xc8;}else{_0xd3b5d3=0xce;}_0x1161b3[_0xd279('0x1a')](_0xd3b5d3);return _0x1161b3[_0xd279('0x20')]('Content-Range',_0x5a52fd+'-'+_0x1394bb+'/'+_0x5701c0)[_0xd279('0x1b')](_0x55b3c5);}return null;};}function patchUpdates(_0x2be01c){return function(_0x5577fc){try{jsonpatch[_0xd279('0x21')](_0x5577fc,_0x2be01c,!![]);}catch(_0x395762){return BPromise[_0xd279('0x22')](_0x395762);}return _0x5577fc[_0xd279('0x23')]();};}function saveUpdates(_0x533ceb,_0x36fd44){return function(_0x2716f4){if(_0x2716f4){return _0x2716f4[_0xd279('0x24')](_0x533ceb)['then'](function(_0x7683bc){return _0x7683bc;});}return null;};}function removeEntity(_0x1a06e7,_0x3a9e73){return function(_0x307599){if(_0x307599){return _0x307599[_0xd279('0x25')]()[_0xd279('0x26')](function(){var _0x163e21=_0x307599[_0xd279('0x27')]({'plain':!![]});var _0x440293='ChanSpies';return db['UserProfileResource'][_0xd279('0x25')]({'where':{'type':_0x440293,'resourceId':_0x163e21['id']}})[_0xd279('0x26')](function(){return _0x307599;});})['then'](function(){_0x1a06e7[_0xd279('0x1a')](0xcc)[_0xd279('0x28')]();});}};}function handleEntityNotFound(_0x29e166,_0x1f842b){return function(_0x54101a){if(!_0x54101a){_0x29e166[_0xd279('0x29')](0x194);}return _0x54101a;};}function handleError(_0x1d4520,_0x529154){_0x529154=_0x529154||0x1f4;return function(_0x43aacd){logger['error'](_0x43aacd[_0xd279('0x2a')]);if(_0x43aacd[_0xd279('0x2b')]){delete _0x43aacd[_0xd279('0x2b')];}_0x1d4520[_0xd279('0x1a')](_0x529154)[_0xd279('0x2c')](_0x43aacd);};}exports[_0xd279('0x2d')]=function(_0x1e585d,_0x36041f){var _0x3c95fb={},_0x4c545d={},_0x45984f={'count':0x0,'rows':[]};var _0x41c529=_[_0xd279('0x2e')](db[_0xd279('0x2f')][_0xd279('0x30')],function(_0x444270){return{'name':_0x444270[_0xd279('0x31')],'type':_0x444270[_0xd279('0x32')][_0xd279('0x33')]};});_0x4c545d['model']=_['map'](_0x41c529,_0xd279('0x2b'));_0x4c545d[_0xd279('0x34')]=_[_0xd279('0x35')](_0x1e585d[_0xd279('0x34')]);_0x4c545d['filters']=_[_0xd279('0x36')](_0x4c545d[_0xd279('0x37')],_0x4c545d[_0xd279('0x34')]);_0x3c95fb[_0xd279('0x38')]=_['intersection'](_0x4c545d[_0xd279('0x37')],qs[_0xd279('0x39')](_0x1e585d[_0xd279('0x34')]['fields']));_0x3c95fb[_0xd279('0x38')]=_0x3c95fb['attributes'][_0xd279('0x3a')]?_0x3c95fb['attributes']:_0x4c545d[_0xd279('0x37')];if(!_0x1e585d[_0xd279('0x34')]['hasOwnProperty'](_0xd279('0x3b'))){_0x3c95fb[_0xd279('0x1e')]=qs[_0xd279('0x1e')](_0x1e585d['query'][_0xd279('0x1e')]);_0x3c95fb[_0xd279('0x1c')]=qs[_0xd279('0x1c')](_0x1e585d[_0xd279('0x34')][_0xd279('0x1c')]);}_0x3c95fb[_0xd279('0x3c')]=qs['sort'](_0x1e585d['query'][_0xd279('0x3d')]);_0x3c95fb[_0xd279('0x3e')]=qs[_0xd279('0x3f')](_[_0xd279('0x40')](_0x1e585d[_0xd279('0x34')],_0x4c545d[_0xd279('0x3f')]),_0x41c529);if(_0x1e585d['query'][_0xd279('0x41')]){_0x3c95fb['where']=_[_0xd279('0x42')](_0x3c95fb[_0xd279('0x3e')],{'$or':_['map'](_0x41c529,function(_0x4ec208){if(_0x4ec208[_0xd279('0x32')]!==_0xd279('0x43')){var _0xa61464={};_0xa61464[_0x4ec208[_0xd279('0x2b')]]={'$like':'%'+_0x1e585d['query'][_0xd279('0x41')]+'%'};return _0xa61464;}})});}_0x3c95fb=_['merge']({},_0x3c95fb,_0x1e585d[_0xd279('0x44')]);var _0x2cad90={'where':_0x3c95fb[_0xd279('0x3e')]};return db[_0xd279('0x2f')]['count'](_0x2cad90)['then'](function(_0x3084f5){_0x45984f[_0xd279('0x1f')]=_0x3084f5;if(_0x1e585d[_0xd279('0x34')][_0xd279('0x45')]){_0x3c95fb[_0xd279('0x46')]=[{'all':!![]}];}return db['VoiceChanSpy']['findAll'](_0x3c95fb);})[_0xd279('0x26')](function(_0x3acc04){_0x45984f[_0xd279('0x47')]=_0x3acc04;return _0x45984f;})['then'](respondWithFilteredResult(_0x36041f,_0x3c95fb))['catch'](handleError(_0x36041f,null));};exports[_0xd279('0x48')]=function(_0x586746,_0x201b90){var _0x49c8f8={'raw':![],'where':{'id':_0x586746[_0xd279('0x49')]['id']}},_0x57ec92={};_0x57ec92[_0xd279('0x37')]=_[_0xd279('0x35')](db[_0xd279('0x2f')][_0xd279('0x30')]);_0x57ec92[_0xd279('0x34')]=_[_0xd279('0x35')](_0x586746[_0xd279('0x34')]);_0x57ec92['filters']=_[_0xd279('0x36')](_0x57ec92[_0xd279('0x37')],_0x57ec92[_0xd279('0x34')]);_0x49c8f8[_0xd279('0x38')]=_['intersection'](_0x57ec92[_0xd279('0x37')],qs[_0xd279('0x39')](_0x586746[_0xd279('0x34')][_0xd279('0x39')]));_0x49c8f8[_0xd279('0x38')]=_0x49c8f8[_0xd279('0x38')][_0xd279('0x3a')]?_0x49c8f8[_0xd279('0x38')]:_0x57ec92[_0xd279('0x37')];if(_0x586746[_0xd279('0x34')][_0xd279('0x45')]){_0x49c8f8['include']=[{'all':!![]}];}_0x49c8f8=_['merge']({},_0x49c8f8,_0x586746['options']);return db[_0xd279('0x2f')][_0xd279('0x4a')](_0x49c8f8)[_0xd279('0x26')](handleEntityNotFound(_0x201b90,null))[_0xd279('0x26')](respondWithResult(_0x201b90,null))[_0xd279('0x4b')](handleError(_0x201b90,null));};exports[_0xd279('0x4c')]=function(_0x2983bf,_0x55b189){return db[_0xd279('0x2f')][_0xd279('0x4c')](_0x2983bf[_0xd279('0x4d')],{})[_0xd279('0x26')](function(_0x3e95b9){var _0x3b48ec=_0x2983bf[_0xd279('0x4e')][_0xd279('0x27')]({'plain':!![]});if(!_0x3b48ec)throw new Error(_0xd279('0x4f'));if(_0x3b48ec[_0xd279('0x50')]===_0xd279('0x4e')){var _0x81278c=_0x3e95b9[_0xd279('0x27')]({'plain':!![]});var _0x496e2f=_0xd279('0x51');return db['UserProfileSection'][_0xd279('0x4a')]({'where':{'name':_0x496e2f,'userProfileId':_0x3b48ec[_0xd279('0x52')]},'raw':!![]})[_0xd279('0x26')](function(_0x1c84bc){if(_0x1c84bc&&_0x1c84bc['autoAssociation']===0x0){return db[_0xd279('0x53')][_0xd279('0x4c')]({'name':_0x81278c[_0xd279('0x2b')],'resourceId':_0x81278c['id'],'type':_0x1c84bc[_0xd279('0x2b')],'sectionId':_0x1c84bc['id']},{})[_0xd279('0x26')](function(){return _0x3e95b9;});}else{return _0x3e95b9;}})[_0xd279('0x4b')](function(_0xeb52c3){logger[_0xd279('0x54')](_0xd279('0x55'),_0xeb52c3);throw _0xeb52c3;});}return _0x3e95b9;})[_0xd279('0x26')](respondWithResult(_0x55b189,0xc9))['catch'](handleError(_0x55b189,null));};exports[_0xd279('0x24')]=function(_0x2224af,_0x38c492){if(_0x2224af['body']['id']){delete _0x2224af['body']['id'];}return db[_0xd279('0x2f')][_0xd279('0x4a')]({'where':{'id':_0x2224af[_0xd279('0x49')]['id']}})[_0xd279('0x26')](handleEntityNotFound(_0x38c492,null))[_0xd279('0x26')](saveUpdates(_0x2224af['body'],null))[_0xd279('0x26')](respondWithResult(_0x38c492,null))[_0xd279('0x4b')](handleError(_0x38c492,null));};exports[_0xd279('0x25')]=function(_0x2b0407,_0x5df5ab){return db[_0xd279('0x2f')][_0xd279('0x4a')]({'where':{'id':_0x2b0407[_0xd279('0x49')]['id']}})[_0xd279('0x26')](handleEntityNotFound(_0x5df5ab,null))['then'](removeEntity(_0x5df5ab,null))[_0xd279('0x4b')](handleError(_0x5df5ab,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 39f51ad..128bb9b 100644 --- a/server/api/voiceChanSpy/voiceChanSpy.model.js +++ b/server/api/voiceChanSpy/voiceChanSpy.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x32b2=['push','Set','format','chanspy','record','merge','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','concat','User','internal','agent','then','models','define','VoiceChanSpy','voice_chanspy','length','VoiceExtension','bulkCreate','catch','destroy','./voiceChanSpy.attributes','context','from-sip','%s%s','prefix','system'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x32b2,0x66));var _0x232b=function(_0x64b6e,_0x391478){_0x64b6e=_0x64b6e-0x0;var _0x5d4448=_0x32b2[_0x64b6e];return _0x5d4448;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require('bluebird');var attributes=require(_0x232b('0x0'));var getUserApplications=function(_0x487fb1,_0x53e524,_0x2ac63b){var _0x2dcca8=0x1;var _0x4d90b3=[];var _0x231503={'context':_0x53e524[_0x232b('0x1')]||_0x232b('0x2'),'exten':util['format'](_0x232b('0x3'),_0x487fb1[_0x232b('0x4')],_0x2ac63b),'type':_0x232b('0x5'),'isApp':![],'ChanSpyId':_0x487fb1['id'],'UserId':_0x53e524['id']};_0x4d90b3[_0x232b('0x6')](_['merge']({'app':_0x232b('0x7'),'appdata':util[_0x232b('0x8')]('CDR(type)=%s',_0x232b('0x9')),'priority':_0x2dcca8++},_0x231503));if(_0x487fb1[_0x232b('0xa')]){_0x4d90b3['push'](_[_0x232b('0xb')]({'app':_0x232b('0xc'),'appdata':util[_0x232b('0x8')](_0x232b('0xd'),_0x487fb1[_0x232b('0xe')]),'priority':_0x2dcca8++},_0x231503));}if(_0x487fb1['auth']){_0x4d90b3[_0x232b('0x6')](_['merge']({'app':'Authenticate','appdata':_0x487fb1[_0x232b('0xf')],'priority':_0x2dcca8++},_0x231503));}_0x4d90b3[_0x232b('0x6')](_['merge']({'app':_0x232b('0x10'),'appdata':util[_0x232b('0x8')](_0x232b('0x11'),_0x53e524[_0x232b('0x12')],_0x487fb1[_0x232b('0x13')]?_0x487fb1[_0x232b('0x13')][_0x232b('0x14')](''):''),'priority':_0x2dcca8++},_0x231503));if(_0x487fb1[_0x232b('0xa')]){_0x4d90b3[_0x232b('0x6')](_[_0x232b('0xb')]({'app':_0x232b('0x15'),'priority':_0x2dcca8++},_0x231503));}return _0x4d90b3;};var getChanSpyApplications=function(_0x35f1eb,_0x56b28f){var _0xc5f5d7=[];for(var _0x2e8a51=0x0,_0x436530=0x1;_0x2e8a51<_0x56b28f['length'];_0x2e8a51++,_0x436530=0x1){_0xc5f5d7=_0xc5f5d7[_0x232b('0x16')](getUserApplications(_0x35f1eb,_0x56b28f[_0x2e8a51],_0x56b28f[_0x2e8a51]['internal']));if(_0x56b28f[_0x2e8a51]['internal']!=_0x56b28f[_0x2e8a51][_0x232b('0x12')]){_0xc5f5d7=_0xc5f5d7[_0x232b('0x16')](getUserApplications(_0x35f1eb,_0x56b28f[_0x2e8a51],_0x56b28f[_0x2e8a51][_0x232b('0x12')]));}}return _0xc5f5d7;};var getChanSpyPromise=function(_0x113be5,_0x15384e){return new BPromise(function(_0x50baa5,_0x10b93f){return _0x113be5[_0x232b('0x17')]['findAll']({'attributes':['id',_0x232b('0x12'),_0x232b('0x18')],'where':{'role':_0x232b('0x19'),'chanspy':!![]},'raw':!![]})[_0x232b('0x1a')](function(_0x200dc2){if(_0x200dc2){return _0x50baa5(getChanSpyApplications(_0x15384e,_0x200dc2));}return _0x50baa5([]);})['catch'](function(_0x3f1f44){_0x10b93f(_0x3f1f44);});});};module['exports']=function(_0x2d50f6,_0x418ced){var _0x61c55f=_0x2d50f6[_0x232b('0x1b')];return _0x2d50f6[_0x232b('0x1c')](_0x232b('0x1d'),attributes,{'tableName':_0x232b('0x1e'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2e908f,_0x12298f,_0x394bb4){return getChanSpyPromise(_0x61c55f,_0x2e908f)[_0x232b('0x1a')](function(_0x51bf41){if(_0x51bf41&&_0x51bf41[_0x232b('0x1f')]){return _0x61c55f[_0x232b('0x20')][_0x232b('0x21')](_0x51bf41);}})['then'](function(){_0x394bb4();})[_0x232b('0x22')](function(_0x396ca8){_0x394bb4(_0x396ca8);});},'afterUpdate':function(_0x2ad70f,_0x50bb91,_0x34bb9c){return _0x61c55f[_0x232b('0x20')][_0x232b('0x23')]({'where':{'ChanSpyId':_0x2ad70f['id']}})[_0x232b('0x1a')](function(){return getChanSpyPromise(_0x61c55f,_0x2ad70f);})['then'](function(_0x40ec67){if(_0x40ec67&&_0x40ec67[_0x232b('0x1f')]){return _0x61c55f[_0x232b('0x20')][_0x232b('0x21')](_0x40ec67);}})['then'](function(){_0x34bb9c();})[_0x232b('0x22')](function(_0x3da8d9){_0x34bb9c(_0x3da8d9);});},'afterDestroy':function(_0x40776b,_0x120d18,_0x1be76f){return _0x61c55f[_0x232b('0x20')]['destroy']({'where':{'ChanSpyId':_0x40776b['id']}})[_0x232b('0x1a')](function(){_0x1be76f();})['catch'](function(_0x403f75){_0x1be76f(_0x403f75);});}}});}; \ No newline at end of file +var _0xce49=['name','options','join','length','concat','internal','User','then','catch','exports','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','context','from-sip','format','prefix','push','merge','Set','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','auth','Authenticate','ChanSpy'];(function(_0x5bbc3e,_0x3b466f){var _0x45f5f0=function(_0x5f4627){while(--_0x5f4627){_0x5bbc3e['push'](_0x5bbc3e['shift']());}};_0x45f5f0(++_0x3b466f);}(_0xce49,0x121));var _0x9ce4=function(_0x42ca2a,_0x1d4f80){_0x42ca2a=_0x42ca2a-0x0;var _0x71dca=_0xce49[_0x42ca2a];return _0x71dca;};'use strict';var _=require(_0x9ce4('0x0'));var util=require(_0x9ce4('0x1'));var BPromise=require(_0x9ce4('0x2'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x120b80,_0x5cd643,_0x2c15d9){var _0x2a5f22=0x1;var _0x48cd68=[];var _0x1bac7d={'context':_0x5cd643[_0x9ce4('0x3')]||_0x9ce4('0x4'),'exten':util[_0x9ce4('0x5')]('%s%s',_0x120b80[_0x9ce4('0x6')],_0x2c15d9),'type':'system','isApp':![],'ChanSpyId':_0x120b80['id'],'UserId':_0x5cd643['id']};_0x48cd68[_0x9ce4('0x7')](_[_0x9ce4('0x8')]({'app':_0x9ce4('0x9'),'appdata':util[_0x9ce4('0x5')]('CDR(type)=%s',_0x9ce4('0xa')),'priority':_0x2a5f22++},_0x1bac7d));if(_0x120b80[_0x9ce4('0xb')]){_0x48cd68['push'](_[_0x9ce4('0x8')]({'app':_0x9ce4('0xc'),'appdata':util[_0x9ce4('0x5')](_0x9ce4('0xd'),_0x120b80['recordingFormat']),'priority':_0x2a5f22++},_0x1bac7d));}if(_0x120b80[_0x9ce4('0xe')]){_0x48cd68[_0x9ce4('0x7')](_['merge']({'app':_0x9ce4('0xf'),'appdata':_0x120b80['password'],'priority':_0x2a5f22++},_0x1bac7d));}_0x48cd68[_0x9ce4('0x7')](_['merge']({'app':_0x9ce4('0x10'),'appdata':util[_0x9ce4('0x5')]('SIP/%s,%s',_0x5cd643[_0x9ce4('0x11')],_0x120b80[_0x9ce4('0x12')]?_0x120b80[_0x9ce4('0x12')][_0x9ce4('0x13')](''):''),'priority':_0x2a5f22++},_0x1bac7d));if(_0x120b80[_0x9ce4('0xb')]){_0x48cd68['push'](_['merge']({'app':'StopMixMonitor','priority':_0x2a5f22++},_0x1bac7d));}return _0x48cd68;};var getChanSpyApplications=function(_0x26d48f,_0x585f61){var _0x57a64e=[];for(var _0x2a34d4=0x0,_0x394232=0x1;_0x2a34d4<_0x585f61[_0x9ce4('0x14')];_0x2a34d4++,_0x394232=0x1){_0x57a64e=_0x57a64e[_0x9ce4('0x15')](getUserApplications(_0x26d48f,_0x585f61[_0x2a34d4],_0x585f61[_0x2a34d4][_0x9ce4('0x16')]));if(_0x585f61[_0x2a34d4][_0x9ce4('0x16')]!=_0x585f61[_0x2a34d4][_0x9ce4('0x11')]){_0x57a64e=_0x57a64e[_0x9ce4('0x15')](getUserApplications(_0x26d48f,_0x585f61[_0x2a34d4],_0x585f61[_0x2a34d4]['name']));}}return _0x57a64e;};var getChanSpyPromise=function(_0x36c83b,_0x10f7d6){return new BPromise(function(_0x144b67,_0x10faa6){return _0x36c83b[_0x9ce4('0x17')]['findAll']({'attributes':['id',_0x9ce4('0x11'),_0x9ce4('0x16')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x9ce4('0x18')](function(_0x65af07){if(_0x65af07){return _0x144b67(getChanSpyApplications(_0x10f7d6,_0x65af07));}return _0x144b67([]);})[_0x9ce4('0x19')](function(_0x56bc98){_0x10faa6(_0x56bc98);});});};module[_0x9ce4('0x1a')]=function(_0x509229,_0x135033){var _0x519141=_0x509229[_0x9ce4('0x1b')];return _0x509229[_0x9ce4('0x1c')](_0x9ce4('0x1d'),attributes,{'tableName':_0x9ce4('0x1e'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x493a0f,_0x41997b,_0x554bb8){return getChanSpyPromise(_0x519141,_0x493a0f)[_0x9ce4('0x18')](function(_0x139a69){if(_0x139a69&&_0x139a69[_0x9ce4('0x14')]){return _0x519141[_0x9ce4('0x1f')][_0x9ce4('0x20')](_0x139a69);}})[_0x9ce4('0x18')](function(){_0x554bb8();})[_0x9ce4('0x19')](function(_0x1f25a9){_0x554bb8(_0x1f25a9);});},'afterUpdate':function(_0x415c70,_0xee4f13,_0x10d87a){return _0x519141[_0x9ce4('0x1f')][_0x9ce4('0x21')]({'where':{'ChanSpyId':_0x415c70['id']}})['then'](function(){return getChanSpyPromise(_0x519141,_0x415c70);})[_0x9ce4('0x18')](function(_0x3588d5){if(_0x3588d5&&_0x3588d5['length']){return _0x519141[_0x9ce4('0x1f')][_0x9ce4('0x20')](_0x3588d5);}})['then'](function(){_0x10d87a();})[_0x9ce4('0x19')](function(_0x2e8ead){_0x10d87a(_0x2e8ead);});},'afterDestroy':function(_0x4c8e4e,_0x258e89,_0x3da2e5){return _0x519141[_0x9ce4('0x1f')][_0x9ce4('0x21')]({'where':{'ChanSpyId':_0x4c8e4e['id']}})[_0x9ce4('0x18')](function(){_0x3da2e5();})[_0x9ce4('0x19')](function(_0x3a3c0b){_0x3da2e5(_0x3a3c0b);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index b4df734..e8bf2cf 100644 --- a/server/api/voiceChanSpy/voiceChanSpy.rpc.js +++ b/server/api/voiceChanSpy/voiceChanSpy.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x593e=['then','info','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','VoiceChanSpy,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3708c6,_0x376fd7){var _0x33f164=function(_0x251895){while(--_0x251895){_0x3708c6['push'](_0x3708c6['shift']());}};_0x33f164(++_0x376fd7);}(_0x593e,0xcb));var _0xe593=function(_0x7dce19,_0xcb4522){_0x7dce19=_0x7dce19-0x0;var _0x37fa61=_0x593e[_0x7dce19];return _0x37fa61;};'use strict';var _=require(_0xe593('0x0'));var util=require(_0xe593('0x1'));var moment=require(_0xe593('0x2'));var BPromise=require(_0xe593('0x3'));var rs=require(_0xe593('0x4'));var fs=require('fs');var Redis=require(_0xe593('0x5'));var db=require(_0xe593('0x6'))['db'];var utils=require(_0xe593('0x7'));var logger=require('../../config/logger')(_0xe593('0x8'));var config=require(_0xe593('0x9'));var jayson=require(_0xe593('0xa'));var client=jayson[_0xe593('0xb')][_0xe593('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x14cff3,_0x1cda29,_0x307dad){return new BPromise(function(_0x169c08,_0x265099){return client['request'](_0x14cff3,_0x307dad)[_0xe593('0xd')](function(_0x4091db){logger[_0xe593('0xe')]('VoiceChanSpy,\x20%s,\x20%s',_0x1cda29,'request\x20sent');logger[_0xe593('0xf')](_0xe593('0x10'),_0x1cda29,_0xe593('0x11'),JSON['stringify'](_0x4091db));if(_0x4091db[_0xe593('0x12')]){if(_0x4091db[_0xe593('0x12')][_0xe593('0x13')]===0x1f4){logger[_0xe593('0x12')](_0xe593('0x14'),_0x1cda29,_0x4091db[_0xe593('0x12')][_0xe593('0x15')]);return _0x265099(_0x4091db[_0xe593('0x12')][_0xe593('0x15')]);}logger[_0xe593('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0x1cda29,_0x4091db[_0xe593('0x12')][_0xe593('0x15')]);return _0x169c08(_0x4091db['error'][_0xe593('0x15')]);}else{logger[_0xe593('0xe')]('VoiceChanSpy,\x20%s,\x20%s',_0x1cda29,_0xe593('0x11'));_0x169c08(_0x4091db[_0xe593('0x16')][_0xe593('0x15')]);}})[_0xe593('0x17')](function(_0x3408ec){logger[_0xe593('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0x1cda29,_0x3408ec);_0x265099(_0x3408ec);});});} \ No newline at end of file +var _0xa699=['request','then','info','VoiceChanSpy,\x20%s,\x20%s','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3ff4c1,_0x300c74){var _0x2cdd9c=function(_0x1922ae){while(--_0x1922ae){_0x3ff4c1['push'](_0x3ff4c1['shift']());}};_0x2cdd9c(++_0x300c74);}(_0xa699,0x6b));var _0x9a69=function(_0x2a390b,_0xf49f9b){_0x2a390b=_0x2a390b-0x0;var _0x5df10a=_0xa699[_0x2a390b];return _0x5df10a;};'use strict';var _=require(_0x9a69('0x0'));var util=require(_0x9a69('0x1'));var moment=require(_0x9a69('0x2'));var BPromise=require(_0x9a69('0x3'));var rs=require(_0x9a69('0x4'));var fs=require('fs');var Redis=require(_0x9a69('0x5'));var db=require(_0x9a69('0x6'))['db'];var utils=require(_0x9a69('0x7'));var logger=require(_0x9a69('0x8'))(_0x9a69('0x9'));var config=require(_0x9a69('0xa'));var jayson=require(_0x9a69('0xb'));var client=jayson[_0x9a69('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26b842,_0x3f9bce,_0x3bb021){return new BPromise(function(_0x4665a9,_0x5031b0){return client[_0x9a69('0xd')](_0x26b842,_0x3bb021)[_0x9a69('0xe')](function(_0x3fb953){logger[_0x9a69('0xf')](_0x9a69('0x10'),_0x3f9bce,'request\x20sent');logger['debug'](_0x9a69('0x11'),_0x3f9bce,'request\x20sent',JSON[_0x9a69('0x12')](_0x3fb953));if(_0x3fb953[_0x9a69('0x13')]){if(_0x3fb953['error'][_0x9a69('0x14')]===0x1f4){logger[_0x9a69('0x13')]('VoiceChanSpy,\x20%s,\x20%s',_0x3f9bce,_0x3fb953[_0x9a69('0x13')][_0x9a69('0x15')]);return _0x5031b0(_0x3fb953[_0x9a69('0x13')][_0x9a69('0x15')]);}logger[_0x9a69('0x13')](_0x9a69('0x10'),_0x3f9bce,_0x3fb953[_0x9a69('0x13')][_0x9a69('0x15')]);return _0x4665a9(_0x3fb953[_0x9a69('0x13')]['message']);}else{logger[_0x9a69('0xf')](_0x9a69('0x10'),_0x3f9bce,_0x9a69('0x16'));_0x4665a9(_0x3fb953['result'][_0x9a69('0x15')]);}})[_0x9a69('0x17')](function(_0x380e46){logger[_0x9a69('0x13')](_0x9a69('0x10'),_0x3f9bce,_0x380e46);_0x5031b0(_0x380e46);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index cc791d3..b3b9d2a 100644 --- a/server/api/voiceContext/index.js +++ b/server/api/voiceContext/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcc90=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','post','create','put'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xcc90,0x16c));var _0x0cc9=function(_0x5c570f,_0x233f02){_0x5c570f=_0x5c570f-0x0;var _0x23d3bf=_0xcc90[_0x5c570f];return _0x23d3bf;};'use strict';var multer=require(_0x0cc9('0x0'));var util=require(_0x0cc9('0x1'));var path=require(_0x0cc9('0x2'));var timeout=require(_0x0cc9('0x3'));var express=require(_0x0cc9('0x4'));var router=express[_0x0cc9('0x5')]();var fs_extra=require(_0x0cc9('0x6'));var auth=require(_0x0cc9('0x7'));var interaction=require(_0x0cc9('0x8'));var config=require(_0x0cc9('0x9'));var controller=require('./voiceContext.controller');router['get']('/',auth[_0x0cc9('0xa')](),controller['index']);router[_0x0cc9('0xb')](_0x0cc9('0xc'),auth[_0x0cc9('0xa')](),controller['show']);router[_0x0cc9('0xd')]('/',auth[_0x0cc9('0xa')](),controller[_0x0cc9('0xe')]);router[_0x0cc9('0xf')]('/:id',auth[_0x0cc9('0xa')](),controller[_0x0cc9('0x10')]);router[_0x0cc9('0x11')](_0x0cc9('0xc'),auth[_0x0cc9('0xa')](),controller[_0x0cc9('0x12')]);module[_0x0cc9('0x13')]=router; \ No newline at end of file +var _0x5eb7=['get','isAuthenticated','show','post','/:id','delete','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x37b4ec,_0x5a447b){var _0x18b1e8=function(_0x2a6db9){while(--_0x2a6db9){_0x37b4ec['push'](_0x37b4ec['shift']());}};_0x18b1e8(++_0x5a447b);}(_0x5eb7,0x93));var _0x75eb=function(_0x17b0d4,_0x377add){_0x17b0d4=_0x17b0d4-0x0;var _0x2d02c7=_0x5eb7[_0x17b0d4];return _0x2d02c7;};'use strict';var multer=require('multer');var util=require(_0x75eb('0x0'));var path=require(_0x75eb('0x1'));var timeout=require(_0x75eb('0x2'));var express=require(_0x75eb('0x3'));var router=express[_0x75eb('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x75eb('0x5'));var config=require(_0x75eb('0x6'));var controller=require('./voiceContext.controller');router[_0x75eb('0x7')]('/',auth[_0x75eb('0x8')](),controller['index']);router[_0x75eb('0x7')]('/:id',auth[_0x75eb('0x8')](),controller[_0x75eb('0x9')]);router[_0x75eb('0xa')]('/',auth[_0x75eb('0x8')](),controller['create']);router['put'](_0x75eb('0xb'),auth[_0x75eb('0x8')](),controller['update']);router[_0x75eb('0xc')](_0x75eb('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x75eb('0xd')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index b6189db..0b389f9 100644 --- a/server/api/voiceContext/voiceContext.attributes.js +++ b/server/api/voiceContext/voiceContext.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x77b8=['name','BOOLEAN','exports','STRING'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x77b8,0x9a));var _0x877b=function(_0x20af4e,_0x511577){_0x20af4e=_0x20af4e-0x0;var _0x4f990f=_0x77b8[_0x20af4e];return _0x4f990f;};'use strict';var Sequelize=require('sequelize');module[_0x877b('0x0')]={'name':{'type':Sequelize[_0x877b('0x1')],'unique':_0x877b('0x2')},'description':{'type':Sequelize[_0x877b('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x877b('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x74d7=['BOOLEAN','sequelize','exports','name','STRING'];(function(_0x2f5d9f,_0x595a19){var _0x3d0e19=function(_0x5b5d0d){while(--_0x5b5d0d){_0x2f5d9f['push'](_0x2f5d9f['shift']());}};_0x3d0e19(++_0x595a19);}(_0x74d7,0x169));var _0x774d=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x74d7[_0x2a6809];return _0x11c371;};'use strict';var Sequelize=require(_0x774d('0x0'));module[_0x774d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x774d('0x2')},'description':{'type':Sequelize[_0x774d('0x3')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x774d('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 5b9940d..eb85f3d 100644 --- a/server/api/voiceContext/voiceContext.controller.js +++ b/server/api/voiceContext/voiceContext.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1b7a=['end','undefined','limit','count','offset','set','Content-Range','json','reject','save','update','destroy','get','Contexts','UserProfileResource','stack','name','send','index','map','VoiceContext','rawAttributes','type','key','model','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','keys','length','options','find','create','readFileSync','join','root','server/files/templates/context.ejs','render','writeFileSync','Reload','chan_sip.so','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','utf8','/etc/asterisk/extensions_xcally_contexts.conf','eml-format','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status'];(function(_0x4ca218,_0x2c3b47){var _0x1856e7=function(_0x552e3d){while(--_0x552e3d){_0x4ca218['push'](_0x4ca218['shift']());}};_0x1856e7(++_0x2c3b47);}(_0x1b7a,0x172));var _0xa1b7=function(_0x17baf0,_0x17750f){_0x17baf0=_0x17baf0-0x0;var _0x2e0c36=_0x1b7a[_0x17baf0];return _0x2e0c36;};'use strict';var emlformat=require(_0xa1b7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa1b7('0x1'));var rp=require('request-promise');var moment=require(_0xa1b7('0x2'));var BPromise=require(_0xa1b7('0x3'));var Mustache=require('mustache');var util=require(_0xa1b7('0x4'));var path=require(_0xa1b7('0x5'));var sox=require(_0xa1b7('0x6'));var csv=require('to-csv');var ejs=require(_0xa1b7('0x7'));var fs=require('fs');var fs_extra=require(_0xa1b7('0x8'));var _=require(_0xa1b7('0x9'));var squel=require(_0xa1b7('0xa'));var crypto=require('crypto');var jsforce=require(_0xa1b7('0xb'));var deskjs=require(_0xa1b7('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa1b7('0xd'));var Redis=require(_0xa1b7('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xa1b7('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa1b7('0x10'));var logger=require(_0xa1b7('0x11'))(_0xa1b7('0x12'));var utils=require(_0xa1b7('0x13'));var config=require(_0xa1b7('0x14'));var licenseUtil=require(_0xa1b7('0x15'));var db=require(_0xa1b7('0x16'))['db'];var jayson=require(_0xa1b7('0x17'));var client=jayson[_0xa1b7('0x18')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b1b39,_0x13422d,_0x577b89,_0x5f19c9){return new BPromise(function(_0x3b53a5,_0x4b08e7){var _0x379dc7=_0x5f19c9||client;return _0x379dc7[_0xa1b7('0x19')](_0x4b1b39,_0x577b89)[_0xa1b7('0x1a')](function(_0x19b94a){logger[_0xa1b7('0x1b')](_0xa1b7('0x1c'),_0x13422d,_0xa1b7('0x1d'));logger[_0xa1b7('0x1e')](_0xa1b7('0x1f'),_0x13422d,_0xa1b7('0x1d'),JSON[_0xa1b7('0x20')](_0x19b94a));if(_0x19b94a[_0xa1b7('0x21')]){if(_0x19b94a[_0xa1b7('0x21')][_0xa1b7('0x22')]===0x1f4){logger[_0xa1b7('0x21')]('VoiceContext,\x20%s,\x20%s',_0x13422d,_0x19b94a[_0xa1b7('0x21')][_0xa1b7('0x23')]);return _0x4b08e7(_0x19b94a['error'][_0xa1b7('0x23')]);}logger[_0xa1b7('0x21')](_0xa1b7('0x1c'),_0x13422d,_0x19b94a[_0xa1b7('0x21')]['message']);return _0x3b53a5(_0x19b94a[_0xa1b7('0x21')]['message']);}else{logger[_0xa1b7('0x1b')](_0xa1b7('0x1c'),_0x13422d,_0xa1b7('0x1d'));_0x3b53a5(_0x19b94a['result'][_0xa1b7('0x23')]);}})['catch'](function(_0x27ffeb){logger[_0xa1b7('0x21')](_0xa1b7('0x1c'),_0x13422d,_0x27ffeb);_0x4b08e7(_0x27ffeb);});});}function respondWithStatusCode(_0x537824,_0x4d4d40){_0x4d4d40=_0x4d4d40||0xcc;return function(_0x25ee87){if(_0x25ee87){return _0x537824[_0xa1b7('0x24')](_0x4d4d40);}return _0x537824[_0xa1b7('0x25')](_0x4d4d40)[_0xa1b7('0x26')]();};}function respondWithResult(_0x531bf6,_0x65ac6c){_0x65ac6c=_0x65ac6c||0xc8;return function(_0x17b249){if(_0x17b249){return _0x531bf6[_0xa1b7('0x25')](_0x65ac6c)['json'](_0x17b249);}};}function respondWithFilteredResult(_0x5e982b,_0x392eb9){return function(_0xfb040a){if(_0xfb040a){var _0x44de6c=typeof _0x392eb9['offset']===_0xa1b7('0x27')&&typeof _0x392eb9[_0xa1b7('0x28')]===_0xa1b7('0x27');var _0x5b6f1b=_0xfb040a[_0xa1b7('0x29')];var _0x398ce2=_0x44de6c?0x0:_0x392eb9[_0xa1b7('0x2a')];var _0xf20f10=_0x44de6c?_0xfb040a['count']:_0x392eb9[_0xa1b7('0x2a')]+_0x392eb9[_0xa1b7('0x28')];var _0x1b3223;if(_0xf20f10>=_0x5b6f1b){_0xf20f10=_0x5b6f1b;_0x1b3223=0xc8;}else{_0x1b3223=0xce;}_0x5e982b['status'](_0x1b3223);return _0x5e982b[_0xa1b7('0x2b')](_0xa1b7('0x2c'),_0x398ce2+'-'+_0xf20f10+'/'+_0x5b6f1b)[_0xa1b7('0x2d')](_0xfb040a);}return null;};}function patchUpdates(_0xde1156){return function(_0x291752){try{jsonpatch['apply'](_0x291752,_0xde1156,!![]);}catch(_0x3b05d1){return BPromise[_0xa1b7('0x2e')](_0x3b05d1);}return _0x291752[_0xa1b7('0x2f')]();};}function saveUpdates(_0x5c1225,_0x121545){return function(_0x4354ac){if(_0x4354ac){return _0x4354ac[_0xa1b7('0x30')](_0x5c1225)['then'](function(_0x272075){return _0x272075;});}return null;};}function removeEntity(_0x1386e1,_0x457ea7){return function(_0x1d56ea){if(_0x1d56ea){return _0x1d56ea[_0xa1b7('0x31')]()[_0xa1b7('0x1a')](function(){var _0x59e0d6=_0x1d56ea[_0xa1b7('0x32')]({'plain':!![]});var _0x473617=_0xa1b7('0x33');return db[_0xa1b7('0x34')][_0xa1b7('0x31')]({'where':{'type':_0x473617,'resourceId':_0x59e0d6['id']}})[_0xa1b7('0x1a')](function(){return _0x1d56ea;});})['then'](function(){_0x1386e1[_0xa1b7('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x381b62,_0x372be7){return function(_0x20562f){if(!_0x20562f){_0x381b62[_0xa1b7('0x24')](0x194);}return _0x20562f;};}function handleError(_0x584f5b,_0x57d5c0){_0x57d5c0=_0x57d5c0||0x1f4;return function(_0x25491b){logger[_0xa1b7('0x21')](_0x25491b[_0xa1b7('0x35')]);if(_0x25491b[_0xa1b7('0x36')]){delete _0x25491b[_0xa1b7('0x36')];}_0x584f5b[_0xa1b7('0x25')](_0x57d5c0)[_0xa1b7('0x37')](_0x25491b);};}exports[_0xa1b7('0x38')]=function(_0x47c124,_0x3143f4){var _0x503d14={},_0x17c4d4={},_0x19a56b={'count':0x0,'rows':[]};var _0x1fb6e8=_[_0xa1b7('0x39')](db[_0xa1b7('0x3a')][_0xa1b7('0x3b')],function(_0x4e3758){return{'name':_0x4e3758['fieldName'],'type':_0x4e3758[_0xa1b7('0x3c')][_0xa1b7('0x3d')]};});_0x17c4d4[_0xa1b7('0x3e')]=_['map'](_0x1fb6e8,_0xa1b7('0x36'));_0x17c4d4['query']=_['keys'](_0x47c124['query']);_0x17c4d4['filters']=_[_0xa1b7('0x3f')](_0x17c4d4['model'],_0x17c4d4[_0xa1b7('0x40')]);_0x503d14[_0xa1b7('0x41')]=_[_0xa1b7('0x3f')](_0x17c4d4[_0xa1b7('0x3e')],qs[_0xa1b7('0x42')](_0x47c124[_0xa1b7('0x40')][_0xa1b7('0x42')]));_0x503d14[_0xa1b7('0x41')]=_0x503d14['attributes']['length']?_0x503d14[_0xa1b7('0x41')]:_0x17c4d4[_0xa1b7('0x3e')];if(!_0x47c124[_0xa1b7('0x40')][_0xa1b7('0x43')](_0xa1b7('0x44'))){_0x503d14[_0xa1b7('0x28')]=qs[_0xa1b7('0x28')](_0x47c124[_0xa1b7('0x40')][_0xa1b7('0x28')]);_0x503d14['offset']=qs[_0xa1b7('0x2a')](_0x47c124['query']['offset']);}_0x503d14[_0xa1b7('0x45')]=qs['sort'](_0x47c124['query']['sort']);_0x503d14[_0xa1b7('0x46')]=qs[_0xa1b7('0x47')](_[_0xa1b7('0x48')](_0x47c124[_0xa1b7('0x40')],_0x17c4d4['filters']),_0x1fb6e8);if(_0x47c124[_0xa1b7('0x40')][_0xa1b7('0x49')]){_0x503d14['where']=_[_0xa1b7('0x4a')](_0x503d14['where'],{'$or':_[_0xa1b7('0x39')](_0x1fb6e8,function(_0x2bc1f1){if(_0x2bc1f1[_0xa1b7('0x3c')]!==_0xa1b7('0x4b')){var _0x5391d4={};_0x5391d4[_0x2bc1f1[_0xa1b7('0x36')]]={'$like':'%'+_0x47c124[_0xa1b7('0x40')][_0xa1b7('0x49')]+'%'};return _0x5391d4;}})});}_0x503d14=_[_0xa1b7('0x4a')]({},_0x503d14,_0x47c124['options']);var _0x447e10={'where':_0x503d14[_0xa1b7('0x46')]};return db[_0xa1b7('0x3a')]['count'](_0x447e10)['then'](function(_0x481bed){_0x19a56b['count']=_0x481bed;if(_0x47c124[_0xa1b7('0x40')][_0xa1b7('0x4c')]){_0x503d14[_0xa1b7('0x4d')]=[{'all':!![]}];}return db[_0xa1b7('0x3a')][_0xa1b7('0x4e')](_0x503d14);})['then'](function(_0x1e3b8e){_0x19a56b[_0xa1b7('0x4f')]=_0x1e3b8e;return _0x19a56b;})[_0xa1b7('0x1a')](respondWithFilteredResult(_0x3143f4,_0x503d14))[_0xa1b7('0x50')](handleError(_0x3143f4,null));};exports['show']=function(_0xabbe86,_0x21012b){var _0x22eab9={'raw':![],'where':{'id':_0xabbe86['params']['id']}},_0x388038={};_0x388038[_0xa1b7('0x3e')]=_[_0xa1b7('0x51')](db[_0xa1b7('0x3a')][_0xa1b7('0x3b')]);_0x388038[_0xa1b7('0x40')]=_[_0xa1b7('0x51')](_0xabbe86[_0xa1b7('0x40')]);_0x388038[_0xa1b7('0x47')]=_[_0xa1b7('0x3f')](_0x388038['model'],_0x388038['query']);_0x22eab9[_0xa1b7('0x41')]=_[_0xa1b7('0x3f')](_0x388038['model'],qs[_0xa1b7('0x42')](_0xabbe86['query'][_0xa1b7('0x42')]));_0x22eab9[_0xa1b7('0x41')]=_0x22eab9['attributes'][_0xa1b7('0x52')]?_0x22eab9[_0xa1b7('0x41')]:_0x388038[_0xa1b7('0x3e')];if(_0xabbe86['query'][_0xa1b7('0x4c')]){_0x22eab9['include']=[{'all':!![]}];}_0x22eab9=_[_0xa1b7('0x4a')]({},_0x22eab9,_0xabbe86[_0xa1b7('0x53')]);return db[_0xa1b7('0x3a')][_0xa1b7('0x54')](_0x22eab9)[_0xa1b7('0x1a')](handleEntityNotFound(_0x21012b,null))[_0xa1b7('0x1a')](respondWithResult(_0x21012b,null))['catch'](handleError(_0x21012b,null));};exports[_0xa1b7('0x55')]=function(_0x478099,_0x334cd3,_0x41fb99){var _0x177cc1;return db[_0xa1b7('0x3a')][_0xa1b7('0x55')](_0x478099['body'],{'raw':!![]})[_0xa1b7('0x1a')](function(_0x1274f8){_0x177cc1=_0x1274f8;return db[_0xa1b7('0x3a')][_0xa1b7('0x4e')]({'raw':!![]});})[_0xa1b7('0x1a')](function(_0x1d5891){var _0x68a2d=fs[_0xa1b7('0x56')](path[_0xa1b7('0x57')](config[_0xa1b7('0x58')],_0xa1b7('0x59')),'utf8');var _0x26a1c0=ejs[_0xa1b7('0x5a')](_0x68a2d,{'contexts':_0x1d5891||[]});fs[_0xa1b7('0x5b')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x26a1c0);})[_0xa1b7('0x1a')](function(){return respondWithRpcPromise(_0xa1b7('0x5c'),_0xa1b7('0x55'),{'module':_0xa1b7('0x5d')});})[_0xa1b7('0x1a')](function(){var _0x31d4fe=_0x478099[_0xa1b7('0x5e')][_0xa1b7('0x32')]({'plain':!![]});if(!_0x31d4fe)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x31d4fe[_0xa1b7('0x5f')]==='user'){var _0x3514b3=_0x177cc1[_0xa1b7('0x32')]({'plain':!![]});return db['UserProfileSection'][_0xa1b7('0x54')]({'where':{'name':'Contexts','userProfileId':_0x31d4fe[_0xa1b7('0x60')]},'raw':!![]})[_0xa1b7('0x1a')](function(_0x200b81){if(_0x200b81&&_0x200b81[_0xa1b7('0x61')]===0x0){return db[_0xa1b7('0x34')][_0xa1b7('0x55')]({'name':_0x3514b3[_0xa1b7('0x36')],'resourceId':_0x3514b3['id'],'type':_0x200b81[_0xa1b7('0x36')],'sectionId':_0x200b81['id']},{})[_0xa1b7('0x1a')](function(){return _0x177cc1;});}else{return _0x177cc1;}})[_0xa1b7('0x50')](function(_0x214a6){logger[_0xa1b7('0x21')](_0xa1b7('0x62'),_0x214a6);throw _0x214a6;});}return _0x177cc1;})[_0xa1b7('0x1a')](respondWithResult(_0x334cd3,0xc9))[_0xa1b7('0x50')](handleError(_0x334cd3,null));};exports['update']=function(_0x27fd9e,_0x1cacec,_0x1cb904){var _0x5c872b;return db['VoiceContext']['find']({'where':{'id':_0x27fd9e[_0xa1b7('0x63')]['id']}})[_0xa1b7('0x1a')](handleEntityNotFound(_0x1cacec,null))[_0xa1b7('0x1a')](saveUpdates(_0x27fd9e['body'],null))[_0xa1b7('0x1a')](function(_0x23c4fe){if(_0x23c4fe){_0x5c872b=_0x23c4fe;return db[_0xa1b7('0x3a')][_0xa1b7('0x4e')]({'raw':!![]});}})[_0xa1b7('0x1a')](function(_0x28a399){var _0x4ce834=fs[_0xa1b7('0x56')](path[_0xa1b7('0x57')](config[_0xa1b7('0x58')],_0xa1b7('0x59')),_0xa1b7('0x64'));var _0x1acac0=ejs[_0xa1b7('0x5a')](_0x4ce834,{'contexts':_0x28a399||[]});fs[_0xa1b7('0x5b')](_0xa1b7('0x65'),_0x1acac0);})[_0xa1b7('0x1a')](function(){return respondWithRpcPromise(_0xa1b7('0x5c'),_0xa1b7('0x30'),{'module':'chan_sip.so'});})[_0xa1b7('0x1a')](function(){return _0x5c872b;})[_0xa1b7('0x1a')](respondWithResult(_0x1cacec,null))[_0xa1b7('0x50')](handleError(_0x1cacec,null));};exports[_0xa1b7('0x31')]=function(_0x3d93d7,_0x3f6794,_0x349ce4){var _0x5b6060;return db[_0xa1b7('0x3a')][_0xa1b7('0x54')]({'where':{'id':_0x3d93d7['params']['id']}})['then'](handleEntityNotFound(_0x3f6794,null))['then'](removeEntity(_0x3f6794,null))[_0xa1b7('0x1a')](function(){return db[_0xa1b7('0x3a')][_0xa1b7('0x4e')]({'raw':!![]});})[_0xa1b7('0x1a')](function(_0x37fc57){var _0x4a9017=fs[_0xa1b7('0x56')](path['join'](config[_0xa1b7('0x58')],'server/files/templates/context.ejs'),'utf8');var _0x20f786=ejs['render'](_0x4a9017,{'contexts':_0x37fc57});fs[_0xa1b7('0x5b')](_0xa1b7('0x65'),_0x20f786);return respondWithRpcPromise(_0xa1b7('0x5c'),_0xa1b7('0x31'),{'module':_0xa1b7('0x5d')});})[_0xa1b7('0x50')](handleError(_0x3f6794,null));}; \ No newline at end of file +var _0x06a8=['intersection','model','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','fields','length','find','create','body','readFileSync','join','root','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Contexts','autoAssociation','UserProfileResource','update','server/files/templates/context.ejs','utf8','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','get','stack','name','map','VoiceContext','rawAttributes','fieldName','type','key','query','keys','filters'];(function(_0x3723a0,_0x53924c){var _0x366390=function(_0x384834){while(--_0x384834){_0x3723a0['push'](_0x3723a0['shift']());}};_0x366390(++_0x53924c);}(_0x06a8,0x97));var _0x806a=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0x06a8[_0x3e44fa];return _0x2a0aba;};'use strict';var emlformat=require(_0x806a('0x0'));var rimraf=require(_0x806a('0x1'));var zipdir=require(_0x806a('0x2'));var jsonpatch=require(_0x806a('0x3'));var rp=require(_0x806a('0x4'));var moment=require(_0x806a('0x5'));var BPromise=require(_0x806a('0x6'));var Mustache=require('mustache');var util=require(_0x806a('0x7'));var path=require(_0x806a('0x8'));var sox=require(_0x806a('0x9'));var csv=require(_0x806a('0xa'));var ejs=require(_0x806a('0xb'));var fs=require('fs');var fs_extra=require(_0x806a('0xc'));var _=require(_0x806a('0xd'));var squel=require(_0x806a('0xe'));var crypto=require(_0x806a('0xf'));var jsforce=require(_0x806a('0x10'));var deskjs=require(_0x806a('0x11'));var toCsv=require(_0x806a('0xa'));var querystring=require('querystring');var Papa=require(_0x806a('0x12'));var Redis=require(_0x806a('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x806a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x806a('0x15'))(_0x806a('0x16'));var utils=require(_0x806a('0x17'));var config=require(_0x806a('0x18'));var licenseUtil=require(_0x806a('0x19'));var db=require(_0x806a('0x1a'))['db'];var jayson=require(_0x806a('0x1b'));var client=jayson[_0x806a('0x1c')][_0x806a('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0xf82f9,_0x1411bf,_0x3d0c5,_0x384982){return new BPromise(function(_0x5e004d,_0x5094d2){var _0x44f88b=_0x384982||client;return _0x44f88b[_0x806a('0x1e')](_0xf82f9,_0x3d0c5)[_0x806a('0x1f')](function(_0x2a5280){logger['info'](_0x806a('0x20'),_0x1411bf,_0x806a('0x21'));logger[_0x806a('0x22')](_0x806a('0x23'),_0x1411bf,'request\x20sent',JSON[_0x806a('0x24')](_0x2a5280));if(_0x2a5280[_0x806a('0x25')]){if(_0x2a5280[_0x806a('0x25')][_0x806a('0x26')]===0x1f4){logger[_0x806a('0x25')]('VoiceContext,\x20%s,\x20%s',_0x1411bf,_0x2a5280[_0x806a('0x25')][_0x806a('0x27')]);return _0x5094d2(_0x2a5280[_0x806a('0x25')][_0x806a('0x27')]);}logger['error'](_0x806a('0x20'),_0x1411bf,_0x2a5280['error']['message']);return _0x5e004d(_0x2a5280[_0x806a('0x25')][_0x806a('0x27')]);}else{logger['info'](_0x806a('0x20'),_0x1411bf,_0x806a('0x21'));_0x5e004d(_0x2a5280[_0x806a('0x28')][_0x806a('0x27')]);}})[_0x806a('0x29')](function(_0x36161c){logger[_0x806a('0x25')](_0x806a('0x20'),_0x1411bf,_0x36161c);_0x5094d2(_0x36161c);});});}function respondWithStatusCode(_0x306c82,_0x39f590){_0x39f590=_0x39f590||0xcc;return function(_0x4b1e37){if(_0x4b1e37){return _0x306c82[_0x806a('0x2a')](_0x39f590);}return _0x306c82[_0x806a('0x2b')](_0x39f590)[_0x806a('0x2c')]();};}function respondWithResult(_0x29345f,_0x11f98f){_0x11f98f=_0x11f98f||0xc8;return function(_0x2488e4){if(_0x2488e4){return _0x29345f[_0x806a('0x2b')](_0x11f98f)[_0x806a('0x2d')](_0x2488e4);}};}function respondWithFilteredResult(_0xed8515,_0x48629c){return function(_0x154796){if(_0x154796){var _0x5650c6=typeof _0x48629c[_0x806a('0x2e')]==='undefined'&&typeof _0x48629c[_0x806a('0x2f')]===_0x806a('0x30');var _0x596d64=_0x154796[_0x806a('0x31')];var _0x37a74d=_0x5650c6?0x0:_0x48629c[_0x806a('0x2e')];var _0x118551=_0x5650c6?_0x154796[_0x806a('0x31')]:_0x48629c[_0x806a('0x2e')]+_0x48629c['limit'];var _0x455501;if(_0x118551>=_0x596d64){_0x118551=_0x596d64;_0x455501=0xc8;}else{_0x455501=0xce;}_0xed8515[_0x806a('0x2b')](_0x455501);return _0xed8515[_0x806a('0x32')](_0x806a('0x33'),_0x37a74d+'-'+_0x118551+'/'+_0x596d64)[_0x806a('0x2d')](_0x154796);}return null;};}function patchUpdates(_0x3a8e52){return function(_0x25f355){try{jsonpatch[_0x806a('0x34')](_0x25f355,_0x3a8e52,!![]);}catch(_0x4b3f06){return BPromise[_0x806a('0x35')](_0x4b3f06);}return _0x25f355[_0x806a('0x36')]();};}function saveUpdates(_0x398046,_0x535005){return function(_0x322fb1){if(_0x322fb1){return _0x322fb1['update'](_0x398046)[_0x806a('0x1f')](function(_0x3550d7){return _0x3550d7;});}return null;};}function removeEntity(_0x16eaab,_0x344489){return function(_0x2fe71a){if(_0x2fe71a){return _0x2fe71a['destroy']()[_0x806a('0x1f')](function(){var _0x59ff47=_0x2fe71a[_0x806a('0x37')]({'plain':!![]});var _0x38f3db='Contexts';return db['UserProfileResource']['destroy']({'where':{'type':_0x38f3db,'resourceId':_0x59ff47['id']}})['then'](function(){return _0x2fe71a;});})[_0x806a('0x1f')](function(){_0x16eaab[_0x806a('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7f5914,_0x20e81f){return function(_0x513c39){if(!_0x513c39){_0x7f5914[_0x806a('0x2a')](0x194);}return _0x513c39;};}function handleError(_0x5ddece,_0x3305d3){_0x3305d3=_0x3305d3||0x1f4;return function(_0x1e2760){logger['error'](_0x1e2760[_0x806a('0x38')]);if(_0x1e2760[_0x806a('0x39')]){delete _0x1e2760[_0x806a('0x39')];}_0x5ddece['status'](_0x3305d3)['send'](_0x1e2760);};}exports['index']=function(_0x5f3869,_0x32819c){var _0x28aef3={},_0x4848a4={},_0x4c151a={'count':0x0,'rows':[]};var _0xea12f6=_[_0x806a('0x3a')](db[_0x806a('0x3b')][_0x806a('0x3c')],function(_0x484d23){return{'name':_0x484d23[_0x806a('0x3d')],'type':_0x484d23[_0x806a('0x3e')][_0x806a('0x3f')]};});_0x4848a4['model']=_['map'](_0xea12f6,_0x806a('0x39'));_0x4848a4[_0x806a('0x40')]=_[_0x806a('0x41')](_0x5f3869[_0x806a('0x40')]);_0x4848a4[_0x806a('0x42')]=_[_0x806a('0x43')](_0x4848a4[_0x806a('0x44')],_0x4848a4['query']);_0x28aef3['attributes']=_[_0x806a('0x43')](_0x4848a4[_0x806a('0x44')],qs['fields'](_0x5f3869[_0x806a('0x40')]['fields']));_0x28aef3[_0x806a('0x45')]=_0x28aef3[_0x806a('0x45')]['length']?_0x28aef3[_0x806a('0x45')]:_0x4848a4[_0x806a('0x44')];if(!_0x5f3869[_0x806a('0x40')][_0x806a('0x46')]('nolimit')){_0x28aef3[_0x806a('0x2f')]=qs[_0x806a('0x2f')](_0x5f3869[_0x806a('0x40')]['limit']);_0x28aef3[_0x806a('0x2e')]=qs[_0x806a('0x2e')](_0x5f3869['query'][_0x806a('0x2e')]);}_0x28aef3[_0x806a('0x47')]=qs[_0x806a('0x48')](_0x5f3869[_0x806a('0x40')][_0x806a('0x48')]);_0x28aef3[_0x806a('0x49')]=qs[_0x806a('0x42')](_[_0x806a('0x4a')](_0x5f3869[_0x806a('0x40')],_0x4848a4[_0x806a('0x42')]),_0xea12f6);if(_0x5f3869['query'][_0x806a('0x4b')]){_0x28aef3[_0x806a('0x49')]=_[_0x806a('0x4c')](_0x28aef3[_0x806a('0x49')],{'$or':_[_0x806a('0x3a')](_0xea12f6,function(_0x353f43){if(_0x353f43[_0x806a('0x3e')]!==_0x806a('0x4d')){var _0x4d408a={};_0x4d408a[_0x353f43[_0x806a('0x39')]]={'$like':'%'+_0x5f3869[_0x806a('0x40')][_0x806a('0x4b')]+'%'};return _0x4d408a;}})});}_0x28aef3=_[_0x806a('0x4c')]({},_0x28aef3,_0x5f3869[_0x806a('0x4e')]);var _0x1b9138={'where':_0x28aef3[_0x806a('0x49')]};return db[_0x806a('0x3b')]['count'](_0x1b9138)['then'](function(_0x417788){_0x4c151a[_0x806a('0x31')]=_0x417788;if(_0x5f3869[_0x806a('0x40')][_0x806a('0x4f')]){_0x28aef3[_0x806a('0x50')]=[{'all':!![]}];}return db[_0x806a('0x3b')][_0x806a('0x51')](_0x28aef3);})[_0x806a('0x1f')](function(_0x28d9c2){_0x4c151a[_0x806a('0x52')]=_0x28d9c2;return _0x4c151a;})['then'](respondWithFilteredResult(_0x32819c,_0x28aef3))[_0x806a('0x29')](handleError(_0x32819c,null));};exports[_0x806a('0x53')]=function(_0x11b677,_0x4e6177){var _0x1554c8={'raw':![],'where':{'id':_0x11b677[_0x806a('0x54')]['id']}},_0x318785={};_0x318785[_0x806a('0x44')]=_[_0x806a('0x41')](db[_0x806a('0x3b')]['rawAttributes']);_0x318785[_0x806a('0x40')]=_['keys'](_0x11b677[_0x806a('0x40')]);_0x318785[_0x806a('0x42')]=_[_0x806a('0x43')](_0x318785[_0x806a('0x44')],_0x318785[_0x806a('0x40')]);_0x1554c8[_0x806a('0x45')]=_[_0x806a('0x43')](_0x318785[_0x806a('0x44')],qs[_0x806a('0x55')](_0x11b677['query']['fields']));_0x1554c8[_0x806a('0x45')]=_0x1554c8['attributes'][_0x806a('0x56')]?_0x1554c8[_0x806a('0x45')]:_0x318785['model'];if(_0x11b677[_0x806a('0x40')][_0x806a('0x4f')]){_0x1554c8[_0x806a('0x50')]=[{'all':!![]}];}_0x1554c8=_[_0x806a('0x4c')]({},_0x1554c8,_0x11b677[_0x806a('0x4e')]);return db['VoiceContext'][_0x806a('0x57')](_0x1554c8)[_0x806a('0x1f')](handleEntityNotFound(_0x4e6177,null))['then'](respondWithResult(_0x4e6177,null))[_0x806a('0x29')](handleError(_0x4e6177,null));};exports[_0x806a('0x58')]=function(_0x1e0eea,_0x136aad,_0x4ef5e1){var _0x27343f;return db[_0x806a('0x3b')][_0x806a('0x58')](_0x1e0eea[_0x806a('0x59')],{'raw':!![]})[_0x806a('0x1f')](function(_0x31a081){_0x27343f=_0x31a081;return db[_0x806a('0x3b')]['findAll']({'raw':!![]});})[_0x806a('0x1f')](function(_0x3a3061){var _0x243f4e=fs[_0x806a('0x5a')](path[_0x806a('0x5b')](config[_0x806a('0x5c')],'server/files/templates/context.ejs'),'utf8');var _0x5c76e1=ejs[_0x806a('0x5d')](_0x243f4e,{'contexts':_0x3a3061||[]});fs[_0x806a('0x5e')](_0x806a('0x5f'),_0x5c76e1);})[_0x806a('0x1f')](function(){return respondWithRpcPromise(_0x806a('0x60'),_0x806a('0x58'),{'module':_0x806a('0x61')});})[_0x806a('0x1f')](function(){var _0x455ec4=_0x1e0eea[_0x806a('0x62')]['get']({'plain':!![]});if(!_0x455ec4)throw new Error(_0x806a('0x63'));if(_0x455ec4[_0x806a('0x64')]===_0x806a('0x62')){var _0x168a5d=_0x27343f[_0x806a('0x37')]({'plain':!![]});return db[_0x806a('0x65')][_0x806a('0x57')]({'where':{'name':_0x806a('0x66'),'userProfileId':_0x455ec4['userProfileId']},'raw':!![]})['then'](function(_0x239c24){if(_0x239c24&&_0x239c24[_0x806a('0x67')]===0x0){return db[_0x806a('0x68')][_0x806a('0x58')]({'name':_0x168a5d['name'],'resourceId':_0x168a5d['id'],'type':_0x239c24[_0x806a('0x39')],'sectionId':_0x239c24['id']},{})['then'](function(){return _0x27343f;});}else{return _0x27343f;}})[_0x806a('0x29')](function(_0x60d426){logger[_0x806a('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x60d426);throw _0x60d426;});}return _0x27343f;})['then'](respondWithResult(_0x136aad,0xc9))[_0x806a('0x29')](handleError(_0x136aad,null));};exports[_0x806a('0x69')]=function(_0x5dd814,_0x5e23ca,_0x580a45){var _0x3dffa3;return db[_0x806a('0x3b')][_0x806a('0x57')]({'where':{'id':_0x5dd814[_0x806a('0x54')]['id']}})[_0x806a('0x1f')](handleEntityNotFound(_0x5e23ca,null))[_0x806a('0x1f')](saveUpdates(_0x5dd814[_0x806a('0x59')],null))[_0x806a('0x1f')](function(_0x390fa4){if(_0x390fa4){_0x3dffa3=_0x390fa4;return db[_0x806a('0x3b')]['findAll']({'raw':!![]});}})[_0x806a('0x1f')](function(_0x32d73f){var _0x58cd8e=fs[_0x806a('0x5a')](path[_0x806a('0x5b')](config[_0x806a('0x5c')],_0x806a('0x6a')),_0x806a('0x6b'));var _0x2e155d=ejs['render'](_0x58cd8e,{'contexts':_0x32d73f||[]});fs['writeFileSync'](_0x806a('0x5f'),_0x2e155d);})[_0x806a('0x1f')](function(){return respondWithRpcPromise(_0x806a('0x60'),_0x806a('0x69'),{'module':'chan_sip.so'});})[_0x806a('0x1f')](function(){return _0x3dffa3;})[_0x806a('0x1f')](respondWithResult(_0x5e23ca,null))[_0x806a('0x29')](handleError(_0x5e23ca,null));};exports['destroy']=function(_0x676d4e,_0xe9356a,_0x841863){var _0x1428be;return db['VoiceContext']['find']({'where':{'id':_0x676d4e['params']['id']}})[_0x806a('0x1f')](handleEntityNotFound(_0xe9356a,null))['then'](removeEntity(_0xe9356a,null))['then'](function(){return db[_0x806a('0x3b')][_0x806a('0x51')]({'raw':!![]});})[_0x806a('0x1f')](function(_0x22b969){var _0xd8119c=fs['readFileSync'](path[_0x806a('0x5b')](config[_0x806a('0x5c')],_0x806a('0x6a')),_0x806a('0x6b'));var _0x5b149c=ejs['render'](_0xd8119c,{'contexts':_0x22b969});fs[_0x806a('0x5e')](_0x806a('0x5f'),_0x5b149c);return respondWithRpcPromise(_0x806a('0x60'),_0x806a('0x6c'),{'module':_0x806a('0x61')});})[_0x806a('0x29')](handleError(_0xe9356a,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index dace81f..09ce9dc 100644 --- a/server/api/voiceContext/voiceContext.model.js +++ b/server/api/voiceContext/voiceContext.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5a2a=['request-promise','path','../../config/environment','./voiceContext.attributes','VoiceContext','voice_contexts','../../config/logger','api','moment'];(function(_0x173d7e,_0x3242fd){var _0x2220d6=function(_0x462828){while(--_0x462828){_0x173d7e['push'](_0x173d7e['shift']());}};_0x2220d6(++_0x3242fd);}(_0x5a2a,0x138));var _0xa5a2=function(_0x3dbf8e,_0x52c9d4){_0x3dbf8e=_0x3dbf8e-0x0;var _0x322e14=_0x5a2a[_0x3dbf8e];return _0x322e14;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa5a2('0x0'))(_0xa5a2('0x1'));var moment=require(_0xa5a2('0x2'));var BPromise=require('bluebird');var rp=require(_0xa5a2('0x3'));var fs=require('fs');var path=require(_0xa5a2('0x4'));var rimraf=require('rimraf');var config=require(_0xa5a2('0x5'));var attributes=require(_0xa5a2('0x6'));module['exports']=function(_0x29f700,_0x476ca0){return _0x29f700['define'](_0xa5a2('0x7'),attributes,{'tableName':_0xa5a2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x27ee=['api','moment','bluebird','path','rimraf','./voiceContext.attributes','exports','define','voice_contexts','lodash','util','../../config/logger'];(function(_0x4fda38,_0x44c823){var _0x16c06b=function(_0x5bad99){while(--_0x5bad99){_0x4fda38['push'](_0x4fda38['shift']());}};_0x16c06b(++_0x44c823);}(_0x27ee,0x195));var _0xe27e=function(_0x4153d8,_0x3c6cb8){_0x4153d8=_0x4153d8-0x0;var _0x34d71b=_0x27ee[_0x4153d8];return _0x34d71b;};'use strict';var _=require(_0xe27e('0x0'));var util=require(_0xe27e('0x1'));var logger=require(_0xe27e('0x2'))(_0xe27e('0x3'));var moment=require(_0xe27e('0x4'));var BPromise=require(_0xe27e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe27e('0x6'));var rimraf=require(_0xe27e('0x7'));var config=require('../../config/environment');var attributes=require(_0xe27e('0x8'));module[_0xe27e('0x9')]=function(_0x1f5651,_0x3ca559){return _0x1f5651[_0xe27e('0xa')]('VoiceContext',attributes,{'tableName':_0xe27e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 497c40f..68a70b6 100644 --- a/server/api/voiceContext/voiceContext.rpc.js +++ b/server/api/voiceContext/voiceContext.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfc64=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','info','lodash','util','moment','randomstring','ioredis'];(function(_0x2b2ea6,_0x3d98c1){var _0xb6e7d5=function(_0xb313e6){while(--_0xb313e6){_0x2b2ea6['push'](_0x2b2ea6['shift']());}};_0xb6e7d5(++_0x3d98c1);}(_0xfc64,0x1b3));var _0x4fc6=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xfc64[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0x4fc6('0x0'));var util=require(_0x4fc6('0x1'));var moment=require(_0x4fc6('0x2'));var BPromise=require('bluebird');var rs=require(_0x4fc6('0x3'));var fs=require('fs');var Redis=require(_0x4fc6('0x4'));var db=require(_0x4fc6('0x5'))['db'];var utils=require(_0x4fc6('0x6'));var logger=require(_0x4fc6('0x7'))('rpc');var config=require(_0x4fc6('0x8'));var jayson=require(_0x4fc6('0x9'));var client=jayson[_0x4fc6('0xa')][_0x4fc6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f829a,_0x3d67db,_0x4487c4){return new BPromise(function(_0x5999c7,_0x1e566c){return client[_0x4fc6('0xc')](_0x1f829a,_0x4487c4)[_0x4fc6('0xd')](function(_0x23d866){logger['info']('VoiceContext,\x20%s,\x20%s',_0x3d67db,_0x4fc6('0xe'));logger[_0x4fc6('0xf')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x3d67db,'request\x20sent',JSON[_0x4fc6('0x10')](_0x23d866));if(_0x23d866[_0x4fc6('0x11')]){if(_0x23d866[_0x4fc6('0x11')][_0x4fc6('0x12')]===0x1f4){logger[_0x4fc6('0x11')](_0x4fc6('0x13'),_0x3d67db,_0x23d866[_0x4fc6('0x11')][_0x4fc6('0x14')]);return _0x1e566c(_0x23d866['error'][_0x4fc6('0x14')]);}logger[_0x4fc6('0x11')]('VoiceContext,\x20%s,\x20%s',_0x3d67db,_0x23d866[_0x4fc6('0x11')]['message']);return _0x5999c7(_0x23d866['error']['message']);}else{logger[_0x4fc6('0x15')](_0x4fc6('0x13'),_0x3d67db,'request\x20sent');_0x5999c7(_0x23d866['result'][_0x4fc6('0x14')]);}})['catch'](function(_0x40dc97){logger[_0x4fc6('0x11')](_0x4fc6('0x13'),_0x3d67db,_0x40dc97);_0x1e566c(_0x40dc97);});});} \ No newline at end of file +var _0x04fa=['catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','info','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','request\x20sent'];(function(_0x668cb2,_0x20017c){var _0x24577f=function(_0x28e2a0){while(--_0x28e2a0){_0x668cb2['push'](_0x668cb2['shift']());}};_0x24577f(++_0x20017c);}(_0x04fa,0x119));var _0xa04f=function(_0x4c86b9,_0x482f19){_0x4c86b9=_0x4c86b9-0x0;var _0x138314=_0x04fa[_0x4c86b9];return _0x138314;};'use strict';var _=require('lodash');var util=require(_0xa04f('0x0'));var moment=require(_0xa04f('0x1'));var BPromise=require(_0xa04f('0x2'));var rs=require(_0xa04f('0x3'));var fs=require('fs');var Redis=require(_0xa04f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa04f('0x5'));var logger=require('../../config/logger')(_0xa04f('0x6'));var config=require(_0xa04f('0x7'));var jayson=require(_0xa04f('0x8'));var client=jayson['client'][_0xa04f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c521c,_0x315771,_0x56f898){return new BPromise(function(_0x303e54,_0x4a2e03){return client['request'](_0x2c521c,_0x56f898)['then'](function(_0x5ea498){logger[_0xa04f('0xa')]('VoiceContext,\x20%s,\x20%s',_0x315771,'request\x20sent');logger[_0xa04f('0xb')](_0xa04f('0xc'),_0x315771,'request\x20sent',JSON[_0xa04f('0xd')](_0x5ea498));if(_0x5ea498['error']){if(_0x5ea498[_0xa04f('0xe')][_0xa04f('0xf')]===0x1f4){logger['error'](_0xa04f('0x10'),_0x315771,_0x5ea498[_0xa04f('0xe')]['message']);return _0x4a2e03(_0x5ea498['error']['message']);}logger[_0xa04f('0xe')](_0xa04f('0x10'),_0x315771,_0x5ea498[_0xa04f('0xe')][_0xa04f('0x11')]);return _0x303e54(_0x5ea498[_0xa04f('0xe')][_0xa04f('0x11')]);}else{logger['info'](_0xa04f('0x10'),_0x315771,_0xa04f('0x12'));_0x303e54(_0x5ea498['result'][_0xa04f('0x11')]);}})[_0xa04f('0x13')](function(_0x505abc){logger[_0xa04f('0xe')]('VoiceContext,\x20%s,\x20%s',_0x315771,_0x505abc);_0x4a2e03(_0x505abc);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 8c43495..516a358 100644 --- a/server/api/voiceDialReport/index.js +++ b/server/api/voiceDialReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd4cc=['update','delete','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put'];(function(_0x38ff71,_0x58fa98){var _0x428f4d=function(_0x269a44){while(--_0x269a44){_0x38ff71['push'](_0x38ff71['shift']());}};_0x428f4d(++_0x58fa98);}(_0xd4cc,0x114));var _0xcd4c=function(_0x1bb8ae,_0x16a589){_0x1bb8ae=_0x1bb8ae-0x0;var _0x590cff=_0xd4cc[_0x1bb8ae];return _0x590cff;};'use strict';var multer=require(_0xcd4c('0x0'));var util=require(_0xcd4c('0x1'));var path=require(_0xcd4c('0x2'));var timeout=require('connect-timeout');var express=require(_0xcd4c('0x3'));var router=express['Router']();var fs_extra=require(_0xcd4c('0x4'));var auth=require(_0xcd4c('0x5'));var interaction=require(_0xcd4c('0x6'));var config=require(_0xcd4c('0x7'));var controller=require(_0xcd4c('0x8'));router[_0xcd4c('0x9')]('/',auth[_0xcd4c('0xa')](),controller[_0xcd4c('0xb')]);router[_0xcd4c('0x9')]('/describe',auth[_0xcd4c('0xa')](),controller[_0xcd4c('0xc')]);router[_0xcd4c('0x9')](_0xcd4c('0xd'),auth[_0xcd4c('0xa')](),controller[_0xcd4c('0xe')]);router[_0xcd4c('0xf')]('/',auth[_0xcd4c('0xa')](),controller[_0xcd4c('0x10')]);router[_0xcd4c('0x11')]('/:id',auth[_0xcd4c('0xa')](),controller[_0xcd4c('0x12')]);router[_0xcd4c('0x13')]('/:id',auth[_0xcd4c('0xa')](),controller['destroy']);module[_0xcd4c('0x14')]=router; \ No newline at end of file +var _0x5c9c=['get','index','isAuthenticated','post','create','put','/:id','update','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller'];(function(_0x467dc1,_0x1cb7b6){var _0x1c25d9=function(_0x453d24){while(--_0x453d24){_0x467dc1['push'](_0x467dc1['shift']());}};_0x1c25d9(++_0x1cb7b6);}(_0x5c9c,0x1d1));var _0xc5c9=function(_0x160257,_0xf0c1f8){_0x160257=_0x160257-0x0;var _0x424cfc=_0x5c9c[_0x160257];return _0x424cfc;};'use strict';var multer=require(_0xc5c9('0x0'));var util=require(_0xc5c9('0x1'));var path=require(_0xc5c9('0x2'));var timeout=require(_0xc5c9('0x3'));var express=require(_0xc5c9('0x4'));var router=express['Router']();var fs_extra=require(_0xc5c9('0x5'));var auth=require(_0xc5c9('0x6'));var interaction=require(_0xc5c9('0x7'));var config=require(_0xc5c9('0x8'));var controller=require(_0xc5c9('0x9'));router[_0xc5c9('0xa')]('/',auth['isAuthenticated'](),controller[_0xc5c9('0xb')]);router[_0xc5c9('0xa')]('/describe',auth[_0xc5c9('0xc')](),controller['describe']);router['get']('/:id',auth[_0xc5c9('0xc')](),controller['show']);router[_0xc5c9('0xd')]('/',auth[_0xc5c9('0xc')](),controller[_0xc5c9('0xe')]);router[_0xc5c9('0xf')](_0xc5c9('0x10'),auth[_0xc5c9('0xc')](),controller[_0xc5c9('0x11')]);router[_0xc5c9('0x12')](_0xc5c9('0x10'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index bfdc566..a3a8e25 100644 --- a/server/api/voiceDialReport/voiceDialReport.attributes.js +++ b/server/api/voiceDialReport/voiceDialReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe5b3=['STRING','INTEGER','DATE','exports'];(function(_0x4bda99,_0x5f39e0){var _0x29737b=function(_0x5afe04){while(--_0x5afe04){_0x4bda99['push'](_0x4bda99['shift']());}};_0x29737b(++_0x5f39e0);}(_0xe5b3,0x133));var _0x3e5b=function(_0x34bd60,_0x235471){_0x34bd60=_0x34bd60-0x0;var _0x265ed1=_0xe5b3[_0x34bd60];return _0x265ed1;};'use strict';var Sequelize=require('sequelize');module[_0x3e5b('0x0')]={'privilege':{'type':Sequelize[_0x3e5b('0x1')]},'channel':{'type':Sequelize[_0x3e5b('0x1')]},'channelstate':{'type':Sequelize[_0x3e5b('0x2')]},'channelstatedesc':{'type':Sequelize[_0x3e5b('0x1')]},'calleridnum':{'type':Sequelize[_0x3e5b('0x1')]},'calleridname':{'type':Sequelize[_0x3e5b('0x1')]},'connectedlinenum':{'type':Sequelize[_0x3e5b('0x1')]},'connectedlinename':{'type':Sequelize[_0x3e5b('0x1')]},'language':{'type':Sequelize[_0x3e5b('0x1')]},'accountcode':{'type':Sequelize[_0x3e5b('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x3e5b('0x1')]},'priority':{'type':Sequelize[_0x3e5b('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x3e5b('0x1')]},'destchannel':{'type':Sequelize[_0x3e5b('0x1')]},'destchannelstate':{'type':Sequelize[_0x3e5b('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x3e5b('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x3e5b('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x3e5b('0x1')]},'destlanguage':{'type':Sequelize[_0x3e5b('0x1')]},'destaccountcode':{'type':Sequelize[_0x3e5b('0x1')]},'destcontext':{'type':Sequelize[_0x3e5b('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x3e5b('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x3e5b('0x1')]},'dialstring':{'type':Sequelize[_0x3e5b('0x1')]},'dialstatus':{'type':Sequelize[_0x3e5b('0x1')]},'starttime':{'type':Sequelize[_0x3e5b('0x3')]},'answertime':{'type':Sequelize[_0x3e5b('0x3')]},'endtime':{'type':Sequelize[_0x3e5b('0x3')]},'lastevent':{'type':Sequelize[_0x3e5b('0x1')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x3e5b('0x2')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x6f0d=['STRING','INTEGER','DATE','called,connect,complete','exports'];(function(_0x1a7294,_0x5d41d5){var _0xcc42e6=function(_0x218074){while(--_0x218074){_0x1a7294['push'](_0x1a7294['shift']());}};_0xcc42e6(++_0x5d41d5);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x21aa9b,_0x4d1a2e){_0x21aa9b=_0x21aa9b-0x0;var _0x5e63e8=_0x6f0d[_0x21aa9b];return _0x5e63e8;};'use strict';var Sequelize=require('sequelize');module[_0xd6f0('0x0')]={'privilege':{'type':Sequelize[_0xd6f0('0x1')]},'channel':{'type':Sequelize[_0xd6f0('0x1')]},'channelstate':{'type':Sequelize[_0xd6f0('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xd6f0('0x1')]},'calleridname':{'type':Sequelize[_0xd6f0('0x1')]},'connectedlinenum':{'type':Sequelize[_0xd6f0('0x1')]},'connectedlinename':{'type':Sequelize[_0xd6f0('0x1')]},'language':{'type':Sequelize[_0xd6f0('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xd6f0('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xd6f0('0x2')]},'uniqueid':{'type':Sequelize[_0xd6f0('0x1')]},'linkedid':{'type':Sequelize[_0xd6f0('0x1')]},'destchannel':{'type':Sequelize[_0xd6f0('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xd6f0('0x1')]},'destcalleridname':{'type':Sequelize[_0xd6f0('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xd6f0('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xd6f0('0x1')]},'destlanguage':{'type':Sequelize[_0xd6f0('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xd6f0('0x1')]},'destexten':{'type':Sequelize[_0xd6f0('0x1')]},'destpriority':{'type':Sequelize[_0xd6f0('0x2')]},'destuniqueid':{'type':Sequelize[_0xd6f0('0x1')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0xd6f0('0x1')]},'dialstatus':{'type':Sequelize[_0xd6f0('0x1')]},'starttime':{'type':Sequelize[_0xd6f0('0x3')]},'answertime':{'type':Sequelize[_0xd6f0('0x3')]},'endtime':{'type':Sequelize[_0xd6f0('0x3')]},'lastevent':{'type':Sequelize[_0xd6f0('0x1')],'comment':_0xd6f0('0x4')},'routeId':{'type':Sequelize[_0xd6f0('0x2')]},'duration':{'type':Sequelize[_0xd6f0('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xd6f0('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 3e88086..e4fe8f5 100644 --- a/server/api/voiceDialReport/voiceDialReport.controller.js +++ b/server/api/voiceDialReport/voiceDialReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8a7f=['merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','params','VoiceDialReport','filters','options','body','update','find','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','count','offset','limit','set','apply','reject','save','then','destroy','sendStatus','name','send','index','map','rawAttributes','key','query','keys','model','intersection','fields','attributes','length','nolimit','sort','where','pick','filter'];(function(_0x246aa7,_0x126c74){var _0x3fbdd8=function(_0x5d714d){while(--_0x5d714d){_0x246aa7['push'](_0x246aa7['shift']());}};_0x3fbdd8(++_0x126c74);}(_0x8a7f,0x178));var _0xf8a7=function(_0x50cc4a,_0x3225f2){_0x50cc4a=_0x50cc4a-0x0;var _0x3ec6e8=_0x8a7f[_0x50cc4a];return _0x3ec6e8;};'use strict';var emlformat=require(_0xf8a7('0x0'));var rimraf=require(_0xf8a7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf8a7('0x2'));var rp=require('request-promise');var moment=require(_0xf8a7('0x3'));var BPromise=require(_0xf8a7('0x4'));var Mustache=require(_0xf8a7('0x5'));var util=require(_0xf8a7('0x6'));var path=require(_0xf8a7('0x7'));var sox=require(_0xf8a7('0x8'));var csv=require(_0xf8a7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf8a7('0xa'));var _=require(_0xf8a7('0xb'));var squel=require(_0xf8a7('0xc'));var crypto=require(_0xf8a7('0xd'));var jsforce=require(_0xf8a7('0xe'));var deskjs=require(_0xf8a7('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf8a7('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf8a7('0x11'));var qs=require(_0xf8a7('0x12'));var as=require(_0xf8a7('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xf8a7('0x14'));var config=require(_0xf8a7('0x15'));var licenseUtil=require(_0xf8a7('0x16'));var db=require(_0xf8a7('0x17'))['db'];function respondWithStatusCode(_0x4560cf,_0x3784c5){_0x3784c5=_0x3784c5||0xcc;return function(_0x581a09){if(_0x581a09){return _0x4560cf['sendStatus'](_0x3784c5);}return _0x4560cf['status'](_0x3784c5)[_0xf8a7('0x18')]();};}function respondWithResult(_0x42fab1,_0x41c08b){_0x41c08b=_0x41c08b||0xc8;return function(_0x223ba5){if(_0x223ba5){return _0x42fab1[_0xf8a7('0x19')](_0x41c08b)[_0xf8a7('0x1a')](_0x223ba5);}};}function respondWithFilteredResult(_0x59859d,_0x4aea3d){return function(_0x4d6123){if(_0x4d6123){var _0x5a2100=typeof _0x4aea3d['offset']===_0xf8a7('0x1b')&&typeof _0x4aea3d['limit']===_0xf8a7('0x1b');var _0xe0089b=_0x4d6123[_0xf8a7('0x1c')];var _0x34d083=_0x5a2100?0x0:_0x4aea3d[_0xf8a7('0x1d')];var _0x2024a7=_0x5a2100?_0x4d6123['count']:_0x4aea3d['offset']+_0x4aea3d[_0xf8a7('0x1e')];var _0x3bb98f;if(_0x2024a7>=_0xe0089b){_0x2024a7=_0xe0089b;_0x3bb98f=0xc8;}else{_0x3bb98f=0xce;}_0x59859d[_0xf8a7('0x19')](_0x3bb98f);return _0x59859d[_0xf8a7('0x1f')]('Content-Range',_0x34d083+'-'+_0x2024a7+'/'+_0xe0089b)[_0xf8a7('0x1a')](_0x4d6123);}return null;};}function patchUpdates(_0xbcabd5){return function(_0x222a76){try{jsonpatch[_0xf8a7('0x20')](_0x222a76,_0xbcabd5,!![]);}catch(_0x472be8){return BPromise[_0xf8a7('0x21')](_0x472be8);}return _0x222a76[_0xf8a7('0x22')]();};}function saveUpdates(_0x5aba72,_0x20c08e){return function(_0x547324){if(_0x547324){return _0x547324['update'](_0x5aba72)[_0xf8a7('0x23')](function(_0x25fc30){return _0x25fc30;});}return null;};}function removeEntity(_0x240663,_0x44c070){return function(_0x504271){if(_0x504271){return _0x504271[_0xf8a7('0x24')]()['then'](function(){_0x240663[_0xf8a7('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25fcae,_0x30167c){return function(_0x121435){if(!_0x121435){_0x25fcae[_0xf8a7('0x25')](0x194);}return _0x121435;};}function handleError(_0x59ff2e,_0x1c554b){_0x1c554b=_0x1c554b||0x1f4;return function(_0x14b4cb){logger['error'](_0x14b4cb['stack']);if(_0x14b4cb[_0xf8a7('0x26')]){delete _0x14b4cb[_0xf8a7('0x26')];}_0x59ff2e[_0xf8a7('0x19')](_0x1c554b)[_0xf8a7('0x27')](_0x14b4cb);};}exports[_0xf8a7('0x28')]=function(_0x5f1609,_0x4c8ab8){var _0x29af66={},_0x170b5a={},_0x7cac1e={'count':0x0,'rows':[]};var _0x21f3ac=_[_0xf8a7('0x29')](db['VoiceDialReport'][_0xf8a7('0x2a')],function(_0x16c5bc){return{'name':_0x16c5bc['fieldName'],'type':_0x16c5bc['type'][_0xf8a7('0x2b')]};});_0x170b5a['model']=_['map'](_0x21f3ac,'name');_0x170b5a[_0xf8a7('0x2c')]=_[_0xf8a7('0x2d')](_0x5f1609[_0xf8a7('0x2c')]);_0x170b5a['filters']=_['intersection'](_0x170b5a[_0xf8a7('0x2e')],_0x170b5a[_0xf8a7('0x2c')]);_0x29af66['attributes']=_[_0xf8a7('0x2f')](_0x170b5a[_0xf8a7('0x2e')],qs[_0xf8a7('0x30')](_0x5f1609[_0xf8a7('0x2c')][_0xf8a7('0x30')]));_0x29af66['attributes']=_0x29af66[_0xf8a7('0x31')][_0xf8a7('0x32')]?_0x29af66['attributes']:_0x170b5a['model'];if(!_0x5f1609[_0xf8a7('0x2c')]['hasOwnProperty'](_0xf8a7('0x33'))){_0x29af66['limit']=qs[_0xf8a7('0x1e')](_0x5f1609[_0xf8a7('0x2c')]['limit']);_0x29af66[_0xf8a7('0x1d')]=qs[_0xf8a7('0x1d')](_0x5f1609['query'][_0xf8a7('0x1d')]);}_0x29af66['order']=qs[_0xf8a7('0x34')](_0x5f1609['query'][_0xf8a7('0x34')]);_0x29af66[_0xf8a7('0x35')]=qs['filters'](_[_0xf8a7('0x36')](_0x5f1609[_0xf8a7('0x2c')],_0x170b5a['filters']),_0x21f3ac);if(_0x5f1609['query'][_0xf8a7('0x37')]){_0x29af66[_0xf8a7('0x35')]=_[_0xf8a7('0x38')](_0x29af66['where'],{'$or':_[_0xf8a7('0x29')](_0x21f3ac,function(_0x40cd8b){if(_0x40cd8b[_0xf8a7('0x39')]!==_0xf8a7('0x3a')){var _0x3e5353={};_0x3e5353[_0x40cd8b['name']]={'$like':'%'+_0x5f1609[_0xf8a7('0x2c')]['filter']+'%'};return _0x3e5353;}})});}_0x29af66=_['merge']({},_0x29af66,_0x5f1609['options']);var _0x1a7105={'where':_0x29af66['where']};return db['VoiceDialReport'][_0xf8a7('0x1c')](_0x1a7105)[_0xf8a7('0x23')](function(_0x17d3b6){_0x7cac1e[_0xf8a7('0x1c')]=_0x17d3b6;if(_0x5f1609['query'][_0xf8a7('0x3b')]){_0x29af66[_0xf8a7('0x3c')]=[{'all':!![]}];}return db['VoiceDialReport'][_0xf8a7('0x3d')](_0x29af66);})[_0xf8a7('0x23')](function(_0x3b58b6){_0x7cac1e[_0xf8a7('0x3e')]=_0x3b58b6;return _0x7cac1e;})['then'](respondWithFilteredResult(_0x4c8ab8,_0x29af66))[_0xf8a7('0x3f')](handleError(_0x4c8ab8,null));};exports['show']=function(_0x3ff92c,_0xd325df){var _0x72d18={'raw':!![],'where':{'id':_0x3ff92c[_0xf8a7('0x40')]['id']}},_0x18004d={};_0x18004d[_0xf8a7('0x2e')]=_[_0xf8a7('0x2d')](db[_0xf8a7('0x41')][_0xf8a7('0x2a')]);_0x18004d['query']=_[_0xf8a7('0x2d')](_0x3ff92c['query']);_0x18004d[_0xf8a7('0x42')]=_[_0xf8a7('0x2f')](_0x18004d['model'],_0x18004d[_0xf8a7('0x2c')]);_0x72d18['attributes']=_[_0xf8a7('0x2f')](_0x18004d['model'],qs[_0xf8a7('0x30')](_0x3ff92c[_0xf8a7('0x2c')][_0xf8a7('0x30')]));_0x72d18['attributes']=_0x72d18[_0xf8a7('0x31')][_0xf8a7('0x32')]?_0x72d18[_0xf8a7('0x31')]:_0x18004d[_0xf8a7('0x2e')];if(_0x3ff92c[_0xf8a7('0x2c')]['includeAll']){_0x72d18[_0xf8a7('0x3c')]=[{'all':!![]}];}_0x72d18=_[_0xf8a7('0x38')]({},_0x72d18,_0x3ff92c[_0xf8a7('0x43')]);return db[_0xf8a7('0x41')]['find'](_0x72d18)['then'](handleEntityNotFound(_0xd325df,null))['then'](respondWithResult(_0xd325df,null))[_0xf8a7('0x3f')](handleError(_0xd325df,null));};exports['create']=function(_0x3da9e4,_0x308601){return db[_0xf8a7('0x41')]['create'](_0x3da9e4[_0xf8a7('0x44')],{})[_0xf8a7('0x23')](respondWithResult(_0x308601,0xc9))[_0xf8a7('0x3f')](handleError(_0x308601,null));};exports[_0xf8a7('0x45')]=function(_0x13c246,_0x1b3c13){if(_0x13c246[_0xf8a7('0x44')]['id']){delete _0x13c246['body']['id'];}return db[_0xf8a7('0x41')][_0xf8a7('0x46')]({'where':{'id':_0x13c246[_0xf8a7('0x40')]['id']}})[_0xf8a7('0x23')](handleEntityNotFound(_0x1b3c13,null))[_0xf8a7('0x23')](saveUpdates(_0x13c246[_0xf8a7('0x44')],null))[_0xf8a7('0x23')](respondWithResult(_0x1b3c13,null))[_0xf8a7('0x3f')](handleError(_0x1b3c13,null));};exports[_0xf8a7('0x24')]=function(_0x2c045e,_0x13a0c4){return db['VoiceDialReport'][_0xf8a7('0x46')]({'where':{'id':_0x2c045e[_0xf8a7('0x40')]['id']}})[_0xf8a7('0x23')](handleEntityNotFound(_0x13a0c4,null))['then'](removeEntity(_0x13a0c4,null))['catch'](handleError(_0x13a0c4,null));};exports[_0xf8a7('0x47')]=function(_0x28c14f,_0x219e9b){return db[_0xf8a7('0x41')][_0xf8a7('0x47')]()[_0xf8a7('0x23')](respondWithResult(_0x219e9b,null))['catch'](handleError(_0x219e9b,null));}; \ No newline at end of file +var _0x298a=['save','update','destroy','then','error','send','index','rawAttributes','fieldName','type','key','model','map','name','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','VoiceDialReport','rows','show','params','fields','includeAll','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply'];(function(_0x57af6f,_0x1977a5){var _0x238c7d=function(_0x3c53aa){while(--_0x3c53aa){_0x57af6f['push'](_0x57af6f['shift']());}};_0x238c7d(++_0x1977a5);}(_0x298a,0x10e));var _0xa298=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x298a[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0xa298('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa298('0x1'));var jsonpatch=require(_0xa298('0x2'));var rp=require('request-promise');var moment=require(_0xa298('0x3'));var BPromise=require(_0xa298('0x4'));var Mustache=require('mustache');var util=require(_0xa298('0x5'));var path=require(_0xa298('0x6'));var sox=require(_0xa298('0x7'));var csv=require(_0xa298('0x8'));var ejs=require(_0xa298('0x9'));var fs=require('fs');var fs_extra=require(_0xa298('0xa'));var _=require(_0xa298('0xb'));var squel=require(_0xa298('0xc'));var crypto=require(_0xa298('0xd'));var jsforce=require(_0xa298('0xe'));var deskjs=require(_0xa298('0xf'));var toCsv=require(_0xa298('0x8'));var querystring=require(_0xa298('0x10'));var Papa=require(_0xa298('0x11'));var Redis=require(_0xa298('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa298('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa298('0x14'));var utils=require('../../config/utils');var config=require(_0xa298('0x15'));var licenseUtil=require(_0xa298('0x16'));var db=require(_0xa298('0x17'))['db'];function respondWithStatusCode(_0x542f66,_0x2ea850){_0x2ea850=_0x2ea850||0xcc;return function(_0x87bf59){if(_0x87bf59){return _0x542f66[_0xa298('0x18')](_0x2ea850);}return _0x542f66[_0xa298('0x19')](_0x2ea850)[_0xa298('0x1a')]();};}function respondWithResult(_0x393b18,_0x2cc57f){_0x2cc57f=_0x2cc57f||0xc8;return function(_0x1cfd33){if(_0x1cfd33){return _0x393b18[_0xa298('0x19')](_0x2cc57f)[_0xa298('0x1b')](_0x1cfd33);}};}function respondWithFilteredResult(_0x319fe7,_0x22261a){return function(_0x3f3c2d){if(_0x3f3c2d){var _0x5dc781=typeof _0x22261a['offset']===_0xa298('0x1c')&&typeof _0x22261a['limit']===_0xa298('0x1c');var _0x3620a6=_0x3f3c2d[_0xa298('0x1d')];var _0x50f36=_0x5dc781?0x0:_0x22261a['offset'];var _0x1e5052=_0x5dc781?_0x3f3c2d[_0xa298('0x1d')]:_0x22261a[_0xa298('0x1e')]+_0x22261a[_0xa298('0x1f')];var _0x59a3a8;if(_0x1e5052>=_0x3620a6){_0x1e5052=_0x3620a6;_0x59a3a8=0xc8;}else{_0x59a3a8=0xce;}_0x319fe7[_0xa298('0x19')](_0x59a3a8);return _0x319fe7['set'](_0xa298('0x20'),_0x50f36+'-'+_0x1e5052+'/'+_0x3620a6)[_0xa298('0x1b')](_0x3f3c2d);}return null;};}function patchUpdates(_0xb2e15){return function(_0x575747){try{jsonpatch[_0xa298('0x21')](_0x575747,_0xb2e15,!![]);}catch(_0x28e0a3){return BPromise['reject'](_0x28e0a3);}return _0x575747[_0xa298('0x22')]();};}function saveUpdates(_0xd23ce5,_0x3cb833){return function(_0x1a73db){if(_0x1a73db){return _0x1a73db[_0xa298('0x23')](_0xd23ce5)['then'](function(_0x319e4e){return _0x319e4e;});}return null;};}function removeEntity(_0x4d38f5,_0x493427){return function(_0x8f5406){if(_0x8f5406){return _0x8f5406[_0xa298('0x24')]()[_0xa298('0x25')](function(){_0x4d38f5[_0xa298('0x19')](0xcc)[_0xa298('0x1a')]();});}};}function handleEntityNotFound(_0x30c416,_0x19ec1f){return function(_0x1af8c1){if(!_0x1af8c1){_0x30c416[_0xa298('0x18')](0x194);}return _0x1af8c1;};}function handleError(_0x53ee89,_0x54d294){_0x54d294=_0x54d294||0x1f4;return function(_0x456a69){logger[_0xa298('0x26')](_0x456a69['stack']);if(_0x456a69['name']){delete _0x456a69['name'];}_0x53ee89['status'](_0x54d294)[_0xa298('0x27')](_0x456a69);};}exports[_0xa298('0x28')]=function(_0x44f5e2,_0x57d615){var _0x4a5f5b={},_0x33d7eb={},_0x393491={'count':0x0,'rows':[]};var _0x2afae2=_['map'](db['VoiceDialReport'][_0xa298('0x29')],function(_0x57e827){return{'name':_0x57e827[_0xa298('0x2a')],'type':_0x57e827[_0xa298('0x2b')][_0xa298('0x2c')]};});_0x33d7eb[_0xa298('0x2d')]=_[_0xa298('0x2e')](_0x2afae2,_0xa298('0x2f'));_0x33d7eb[_0xa298('0x30')]=_[_0xa298('0x31')](_0x44f5e2['query']);_0x33d7eb['filters']=_['intersection'](_0x33d7eb['model'],_0x33d7eb[_0xa298('0x30')]);_0x4a5f5b['attributes']=_[_0xa298('0x32')](_0x33d7eb[_0xa298('0x2d')],qs['fields'](_0x44f5e2[_0xa298('0x30')]['fields']));_0x4a5f5b[_0xa298('0x33')]=_0x4a5f5b[_0xa298('0x33')][_0xa298('0x34')]?_0x4a5f5b[_0xa298('0x33')]:_0x33d7eb[_0xa298('0x2d')];if(!_0x44f5e2['query'][_0xa298('0x35')](_0xa298('0x36'))){_0x4a5f5b[_0xa298('0x1f')]=qs['limit'](_0x44f5e2['query'][_0xa298('0x1f')]);_0x4a5f5b['offset']=qs[_0xa298('0x1e')](_0x44f5e2[_0xa298('0x30')]['offset']);}_0x4a5f5b[_0xa298('0x37')]=qs['sort'](_0x44f5e2[_0xa298('0x30')][_0xa298('0x38')]);_0x4a5f5b[_0xa298('0x39')]=qs[_0xa298('0x3a')](_[_0xa298('0x3b')](_0x44f5e2[_0xa298('0x30')],_0x33d7eb['filters']),_0x2afae2);if(_0x44f5e2['query'][_0xa298('0x3c')]){_0x4a5f5b['where']=_[_0xa298('0x3d')](_0x4a5f5b['where'],{'$or':_[_0xa298('0x2e')](_0x2afae2,function(_0x1831b2){if(_0x1831b2[_0xa298('0x2b')]!==_0xa298('0x3e')){var _0x1e7f3c={};_0x1e7f3c[_0x1831b2['name']]={'$like':'%'+_0x44f5e2[_0xa298('0x30')]['filter']+'%'};return _0x1e7f3c;}})});}_0x4a5f5b=_[_0xa298('0x3d')]({},_0x4a5f5b,_0x44f5e2[_0xa298('0x3f')]);var _0x4c2bdf={'where':_0x4a5f5b[_0xa298('0x39')]};return db['VoiceDialReport'][_0xa298('0x1d')](_0x4c2bdf)[_0xa298('0x25')](function(_0x453607){_0x393491['count']=_0x453607;if(_0x44f5e2[_0xa298('0x30')]['includeAll']){_0x4a5f5b[_0xa298('0x40')]=[{'all':!![]}];}return db[_0xa298('0x41')]['findAll'](_0x4a5f5b);})[_0xa298('0x25')](function(_0xf1b808){_0x393491[_0xa298('0x42')]=_0xf1b808;return _0x393491;})[_0xa298('0x25')](respondWithFilteredResult(_0x57d615,_0x4a5f5b))['catch'](handleError(_0x57d615,null));};exports[_0xa298('0x43')]=function(_0x51b0e6,_0x544af8){var _0x368936={'raw':!![],'where':{'id':_0x51b0e6[_0xa298('0x44')]['id']}},_0x216e2a={};_0x216e2a[_0xa298('0x2d')]=_[_0xa298('0x31')](db[_0xa298('0x41')][_0xa298('0x29')]);_0x216e2a[_0xa298('0x30')]=_[_0xa298('0x31')](_0x51b0e6[_0xa298('0x30')]);_0x216e2a[_0xa298('0x3a')]=_[_0xa298('0x32')](_0x216e2a['model'],_0x216e2a[_0xa298('0x30')]);_0x368936['attributes']=_[_0xa298('0x32')](_0x216e2a[_0xa298('0x2d')],qs[_0xa298('0x45')](_0x51b0e6[_0xa298('0x30')][_0xa298('0x45')]));_0x368936['attributes']=_0x368936['attributes']['length']?_0x368936[_0xa298('0x33')]:_0x216e2a['model'];if(_0x51b0e6[_0xa298('0x30')][_0xa298('0x46')]){_0x368936[_0xa298('0x40')]=[{'all':!![]}];}_0x368936=_[_0xa298('0x3d')]({},_0x368936,_0x51b0e6['options']);return db[_0xa298('0x41')][_0xa298('0x47')](_0x368936)[_0xa298('0x25')](handleEntityNotFound(_0x544af8,null))[_0xa298('0x25')](respondWithResult(_0x544af8,null))[_0xa298('0x48')](handleError(_0x544af8,null));};exports[_0xa298('0x49')]=function(_0x3f0db1,_0x318620){return db[_0xa298('0x41')][_0xa298('0x49')](_0x3f0db1[_0xa298('0x4a')],{})[_0xa298('0x25')](respondWithResult(_0x318620,0xc9))[_0xa298('0x48')](handleError(_0x318620,null));};exports[_0xa298('0x23')]=function(_0x2996ed,_0x16a202){if(_0x2996ed[_0xa298('0x4a')]['id']){delete _0x2996ed[_0xa298('0x4a')]['id'];}return db['VoiceDialReport'][_0xa298('0x47')]({'where':{'id':_0x2996ed['params']['id']}})[_0xa298('0x25')](handleEntityNotFound(_0x16a202,null))['then'](saveUpdates(_0x2996ed[_0xa298('0x4a')],null))[_0xa298('0x25')](respondWithResult(_0x16a202,null))[_0xa298('0x48')](handleError(_0x16a202,null));};exports[_0xa298('0x24')]=function(_0x16f3ea,_0x703a62){return db[_0xa298('0x41')]['find']({'where':{'id':_0x16f3ea[_0xa298('0x44')]['id']}})['then'](handleEntityNotFound(_0x703a62,null))[_0xa298('0x25')](removeEntity(_0x703a62,null))[_0xa298('0x48')](handleError(_0x703a62,null));};exports['describe']=function(_0x4aa299,_0x24533c){return db[_0xa298('0x41')][_0xa298('0x4b')]()['then'](respondWithResult(_0x24533c,null))[_0xa298('0x48')](handleError(_0x24533c,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index d97f96d..15e10f8 100644 --- a/server/api/voiceDialReport/voiceDialReport.model.js +++ b/server/api/voiceDialReport/voiceDialReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x01ab=['exports','define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes'];(function(_0x853e64,_0x42bb1e){var _0xe300cc=function(_0x425a46){while(--_0x425a46){_0x853e64['push'](_0x853e64['shift']());}};_0xe300cc(++_0x42bb1e);}(_0x01ab,0xaa));var _0xb01a=function(_0x254744,_0x219e6b){_0x254744=_0x254744-0x0;var _0x2a6a96=_0x01ab[_0x254744];return _0x2a6a96;};'use strict';var _=require(_0xb01a('0x0'));var util=require(_0xb01a('0x1'));var logger=require(_0xb01a('0x2'))('api');var moment=require(_0xb01a('0x3'));var BPromise=require(_0xb01a('0x4'));var rp=require(_0xb01a('0x5'));var fs=require('fs');var path=require(_0xb01a('0x6'));var rimraf=require(_0xb01a('0x7'));var config=require(_0xb01a('0x8'));var attributes=require(_0xb01a('0x9'));module[_0xb01a('0xa')]=function(_0x450f3c,_0x1115a5){return _0x450f3c[_0xb01a('0xb')](_0xb01a('0xc'),attributes,{'tableName':_0xb01a('0xd'),'paranoid':![],'indexes':[{'fields':[_0xb01a('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdb6f=['VoiceDialReport','report_dial','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceDialReport.attributes','exports','define'];(function(_0x2c3f08,_0x380f2b){var _0x4ea2ab=function(_0x4b198a){while(--_0x4b198a){_0x2c3f08['push'](_0x2c3f08['shift']());}};_0x4ea2ab(++_0x380f2b);}(_0xdb6f,0x64));var _0xfdb6=function(_0x382602,_0x5e9d2d){_0x382602=_0x382602-0x0;var _0x14dda6=_0xdb6f[_0x382602];return _0x14dda6;};'use strict';var _=require(_0xfdb6('0x0'));var util=require(_0xfdb6('0x1'));var logger=require(_0xfdb6('0x2'))(_0xfdb6('0x3'));var moment=require(_0xfdb6('0x4'));var BPromise=require(_0xfdb6('0x5'));var rp=require(_0xfdb6('0x6'));var fs=require('fs');var path=require(_0xfdb6('0x7'));var rimraf=require(_0xfdb6('0x8'));var config=require('../../config/environment');var attributes=require(_0xfdb6('0x9'));module[_0xfdb6('0xa')]=function(_0x39f342,_0x4d6f7a){return _0x39f342[_0xfdb6('0xb')](_0xfdb6('0xc'),attributes,{'tableName':_0xfdb6('0xd'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index a58bb03..327ad08 100644 --- a/server/api/voiceDialReport/voiceDialReport.rpc.js +++ b/server/api/voiceDialReport/voiceDialReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc5e0=['info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','debug','UpdateVoiceDialReport','update','raw','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xc5e0,0x11c));var _0x0c5e=function(_0x591c9b,_0x2201f6){_0x591c9b=_0x591c9b-0x0;var _0x4bfc6c=_0xc5e0[_0x591c9b];return _0x4bfc6c;};'use strict';var _=require(_0x0c5e('0x0'));var util=require(_0x0c5e('0x1'));var moment=require(_0x0c5e('0x2'));var BPromise=require(_0x0c5e('0x3'));var rs=require(_0x0c5e('0x4'));var fs=require('fs');var Redis=require(_0x0c5e('0x5'));var db=require(_0x0c5e('0x6'))['db'];var utils=require(_0x0c5e('0x7'));var logger=require(_0x0c5e('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0c5e('0x9')][_0x0c5e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2dc8b0,_0x547ebc,_0x3525e8){return new BPromise(function(_0x5a7271,_0x8c06c2){return client[_0x0c5e('0xb')](_0x2dc8b0,_0x3525e8)[_0x0c5e('0xc')](function(_0xf488ec){logger[_0x0c5e('0xd')](_0x0c5e('0xe'),_0x547ebc,_0x0c5e('0xf'));logger['debug']('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x547ebc,_0x0c5e('0xf'),JSON[_0x0c5e('0x10')](_0xf488ec));if(_0xf488ec['error']){if(_0xf488ec[_0x0c5e('0x11')][_0x0c5e('0x12')]===0x1f4){logger['error'](_0x0c5e('0xe'),_0x547ebc,_0xf488ec['error'][_0x0c5e('0x13')]);return _0x8c06c2(_0xf488ec[_0x0c5e('0x11')][_0x0c5e('0x13')]);}logger[_0x0c5e('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x547ebc,_0xf488ec['error'][_0x0c5e('0x13')]);return _0x5a7271(_0xf488ec[_0x0c5e('0x11')]['message']);}else{logger[_0x0c5e('0xd')](_0x0c5e('0xe'),_0x547ebc,'request\x20sent');_0x5a7271(_0xf488ec[_0x0c5e('0x14')][_0x0c5e('0x13')]);}})[_0x0c5e('0x15')](function(_0x5cc1e5){logger[_0x0c5e('0x11')](_0x0c5e('0xe'),_0x547ebc,_0x5cc1e5);_0x8c06c2(_0x5cc1e5);});});}exports[_0x0c5e('0x16')]=function(_0x445082){var _0x582abf=this;return new Promise(function(_0x1817d2,_0x500770){return db[_0x0c5e('0x17')][_0x0c5e('0x18')](_0x445082[_0x0c5e('0x19')],{'raw':_0x445082[_0x0c5e('0x1a')]?_0x445082[_0x0c5e('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x0c5e('0xc')](function(_0x5edce4){logger[_0x0c5e('0xd')](_0x0c5e('0x16'),_0x445082);logger[_0x0c5e('0x1b')](_0x0c5e('0x16'),_0x445082,JSON['stringify'](_0x5edce4));_0x1817d2(_0x5edce4);})[_0x0c5e('0x15')](function(_0x59773c){logger['error'](_0x0c5e('0x16'),_0x59773c['message'],_0x445082);_0x500770(_0x582abf[_0x0c5e('0x11')](0x1f4,_0x59773c['message']));});});};exports[_0x0c5e('0x1c')]=function(_0x2dfcd0){var _0x57d664=this;return new Promise(function(_0x2567ba,_0x146c5b){return db[_0x0c5e('0x17')][_0x0c5e('0x1d')](_0x2dfcd0['body'],{'raw':_0x2dfcd0['options']?_0x2dfcd0[_0x0c5e('0x1a')][_0x0c5e('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2dfcd0[_0x0c5e('0x1a')]?_0x2dfcd0[_0x0c5e('0x1a')][_0x0c5e('0x1f')]||null:null,'attributes':_0x2dfcd0['options']?_0x2dfcd0['options']['attributes']||null:null,'limit':_0x2dfcd0['options']?_0x2dfcd0[_0x0c5e('0x1a')][_0x0c5e('0x20')]||null:null})[_0x0c5e('0xc')](function(_0x2d1064){logger[_0x0c5e('0xd')](_0x0c5e('0x1c'),_0x2dfcd0);logger[_0x0c5e('0x1b')](_0x0c5e('0x1c'),_0x2dfcd0,JSON[_0x0c5e('0x10')](_0x2d1064));_0x2567ba(_0x2d1064);})['catch'](function(_0x58ef02){logger['error'](_0x0c5e('0x1c'),_0x58ef02[_0x0c5e('0x13')],_0x2dfcd0);_0x146c5b(_0x57d664[_0x0c5e('0x11')](0x1f4,_0x58ef02[_0x0c5e('0x13')]));});});}; \ No newline at end of file +var _0x2edc=['where','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceDialReport,\x20%s,\x20%s','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','UpdateVoiceDialReport','update'];(function(_0x51b2a3,_0x397f0d){var _0x3ec708=function(_0x1c0fbb){while(--_0x1c0fbb){_0x51b2a3['push'](_0x51b2a3['shift']());}};_0x3ec708(++_0x397f0d);}(_0x2edc,0x18d));var _0xc2ed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2edc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc2ed('0x0'));var util=require(_0xc2ed('0x1'));var moment=require(_0xc2ed('0x2'));var BPromise=require(_0xc2ed('0x3'));var rs=require(_0xc2ed('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc2ed('0x5'));var logger=require(_0xc2ed('0x6'))(_0xc2ed('0x7'));var config=require(_0xc2ed('0x8'));var jayson=require(_0xc2ed('0x9'));var client=jayson[_0xc2ed('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b0d2a,_0x184395,_0x1914e8){return new BPromise(function(_0x41a0d7,_0x52757d){return client[_0xc2ed('0xb')](_0x4b0d2a,_0x1914e8)[_0xc2ed('0xc')](function(_0x2dc414){logger[_0xc2ed('0xd')](_0xc2ed('0xe'),_0x184395,'request\x20sent');logger[_0xc2ed('0xf')](_0xc2ed('0x10'),_0x184395,_0xc2ed('0x11'),JSON[_0xc2ed('0x12')](_0x2dc414));if(_0x2dc414[_0xc2ed('0x13')]){if(_0x2dc414[_0xc2ed('0x13')][_0xc2ed('0x14')]===0x1f4){logger[_0xc2ed('0x13')](_0xc2ed('0xe'),_0x184395,_0x2dc414[_0xc2ed('0x13')][_0xc2ed('0x15')]);return _0x52757d(_0x2dc414[_0xc2ed('0x13')][_0xc2ed('0x15')]);}logger['error'](_0xc2ed('0xe'),_0x184395,_0x2dc414[_0xc2ed('0x13')]['message']);return _0x41a0d7(_0x2dc414['error'][_0xc2ed('0x15')]);}else{logger['info'](_0xc2ed('0xe'),_0x184395,_0xc2ed('0x11'));_0x41a0d7(_0x2dc414[_0xc2ed('0x16')]['message']);}})[_0xc2ed('0x17')](function(_0x359e24){logger[_0xc2ed('0x13')]('VoiceDialReport,\x20%s,\x20%s',_0x184395,_0x359e24);_0x52757d(_0x359e24);});});}exports[_0xc2ed('0x18')]=function(_0x512697){var _0xda5090=this;return new Promise(function(_0x56f367,_0x25b9bd){return db[_0xc2ed('0x19')][_0xc2ed('0x1a')](_0x512697[_0xc2ed('0x1b')],{'raw':_0x512697['options']?_0x512697[_0xc2ed('0x1c')][_0xc2ed('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x16aad8){logger[_0xc2ed('0xd')](_0xc2ed('0x18'),_0x512697);logger[_0xc2ed('0xf')](_0xc2ed('0x18'),_0x512697,JSON[_0xc2ed('0x12')](_0x16aad8));_0x56f367(_0x16aad8);})['catch'](function(_0x3cf779){logger['error'](_0xc2ed('0x18'),_0x3cf779[_0xc2ed('0x15')],_0x512697);_0x25b9bd(_0xda5090[_0xc2ed('0x13')](0x1f4,_0x3cf779[_0xc2ed('0x15')]));});});};exports[_0xc2ed('0x1e')]=function(_0x592525){var _0x59fa59=this;return new Promise(function(_0x5383da,_0x26eb0f){return db['VoiceDialReport'][_0xc2ed('0x1f')](_0x592525[_0xc2ed('0x1b')],{'raw':_0x592525['options']?_0x592525[_0xc2ed('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x592525['options']?_0x592525['options'][_0xc2ed('0x20')]||null:null,'attributes':_0x592525['options']?_0x592525['options']['attributes']||null:null,'limit':_0x592525[_0xc2ed('0x1c')]?_0x592525[_0xc2ed('0x1c')]['limit']||null:null})[_0xc2ed('0xc')](function(_0x3255b2){logger[_0xc2ed('0xd')](_0xc2ed('0x1e'),_0x592525);logger[_0xc2ed('0xf')](_0xc2ed('0x1e'),_0x592525,JSON[_0xc2ed('0x12')](_0x3255b2));_0x5383da(_0x3255b2);})[_0xc2ed('0x17')](function(_0x307722){logger['error'](_0xc2ed('0x1e'),_0x307722[_0xc2ed('0x15')],_0x592525);_0x26eb0f(_0x59fa59[_0xc2ed('0x13')](0x1f4,_0x307722[_0xc2ed('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index ba64b35..f4bd6c8 100644 --- a/server/api/voiceExtension/index.js +++ b/server/api/voiceExtension/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x733f=['/:id','isAuthenticated','show','post','create','addApplications','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x733f,0xc7));var _0xf733=function(_0x24d0a6,_0x48ff79){_0x24d0a6=_0x24d0a6-0x0;var _0xe6e137=_0x733f[_0x24d0a6];return _0xe6e137;};'use strict';var multer=require(_0xf733('0x0'));var util=require(_0xf733('0x1'));var path=require(_0xf733('0x2'));var timeout=require(_0xf733('0x3'));var express=require(_0xf733('0x4'));var router=express['Router']();var fs_extra=require(_0xf733('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf733('0x6'));var config=require(_0xf733('0x7'));var controller=require(_0xf733('0x8'));router[_0xf733('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xf733('0xa'),auth[_0xf733('0xb')](),controller[_0xf733('0xc')]);router[_0xf733('0xd')]('/',auth['isAuthenticated'](),controller[_0xf733('0xe')]);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0xf733('0xf')]);router['put'](_0xf733('0xa'),auth[_0xf733('0xb')](),controller[_0xf733('0x10')]);router[_0xf733('0x11')](_0xf733('0xa'),auth[_0xf733('0xb')](),controller[_0xf733('0x12')]);module['exports']=router; \ No newline at end of file +var _0x3bf0=['/:id','show','post','create','/:id/applications','addApplications','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./voiceExtension.controller','get','isAuthenticated'];(function(_0x1688ba,_0x468e19){var _0x39e428=function(_0x27134d){while(--_0x27134d){_0x1688ba['push'](_0x1688ba['shift']());}};_0x39e428(++_0x468e19);}(_0x3bf0,0x9d));var _0x03bf=function(_0x3f18e3,_0xfbe15b){_0x3f18e3=_0x3f18e3-0x0;var _0x53733d=_0x3bf0[_0x3f18e3];return _0x53733d;};'use strict';var multer=require(_0x03bf('0x0'));var util=require(_0x03bf('0x1'));var path=require(_0x03bf('0x2'));var timeout=require(_0x03bf('0x3'));var express=require(_0x03bf('0x4'));var router=express[_0x03bf('0x5')]();var fs_extra=require(_0x03bf('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x03bf('0x7'));var config=require('../../config/environment');var controller=require(_0x03bf('0x8'));router[_0x03bf('0x9')]('/',auth[_0x03bf('0xa')](),controller['index']);router['get'](_0x03bf('0xb'),auth[_0x03bf('0xa')](),controller[_0x03bf('0xc')]);router[_0x03bf('0xd')]('/',auth[_0x03bf('0xa')](),controller[_0x03bf('0xe')]);router[_0x03bf('0xd')](_0x03bf('0xf'),auth[_0x03bf('0xa')](),controller[_0x03bf('0x10')]);router['put']('/:id',auth[_0x03bf('0xa')](),controller[_0x03bf('0x11')]);router[_0x03bf('0x12')](_0x03bf('0xb'),auth[_0x03bf('0xa')](),controller[_0x03bf('0x13')]);module[_0x03bf('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 6bcb7c0..0e72009 100644 --- a/server/api/voiceExtension/voiceExtension.attributes.js +++ b/server/api/voiceExtension/voiceExtension.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7e40=['wav','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','inbound-fax','any','*,*,*,*','INTEGER','BOOLEAN'];(function(_0x4a6a6b,_0x4f2226){var _0x479216=function(_0x278ee3){while(--_0x278ee3){_0x4a6a6b['push'](_0x4a6a6b['shift']());}};_0x479216(++_0x4f2226);}(_0x7e40,0x136));var _0x07e4=function(_0x55f10a,_0x46dad1){_0x55f10a=_0x55f10a-0x0;var _0x23851b=_0x7e40[_0x55f10a];return _0x23851b;};'use strict';var Sequelize=require(_0x07e4('0x0'));module[_0x07e4('0x1')]={'context':{'type':Sequelize[_0x07e4('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x07e4('0x2')],'allowNull':![],'unique':_0x07e4('0x3')},'priority':{'type':Sequelize[_0x07e4('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x07e4('0x3')},'tag':{'type':Sequelize[_0x07e4('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x07e4('0x4')},'appdata':{'type':Sequelize[_0x07e4('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x07e4('0x5'),_0x07e4('0x6'),_0x07e4('0x7'),_0x07e4('0x8'),'outbound-fax','system',_0x07e4('0x9')),'allowNull':![]},'description':{'type':Sequelize[_0x07e4('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x07e4('0xa')},'IntervalId':{'type':Sequelize[_0x07e4('0xb')]},'isApp':{'type':Sequelize[_0x07e4('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x07e4('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x07e4('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x07e4('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x07e4('0xb')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0x07e4('0xd')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0x07e4('0xe')],'get':function(_0x555559){return this[_0x07e4('0xf')](_0x07e4('0x10'));}},'alias':{'type':Sequelize[_0x07e4('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x715f=['internal','inbound-fax','outbound-fax','system','any','*,*,*,*','BOOLEAN','INTEGER','VIRTUAL','exten','sequelize','exports','STRING','compositeIndex','inbound'];(function(_0x12fe7d,_0x3c77d2){var _0x29f1ca=function(_0x59511f){while(--_0x59511f){_0x12fe7d['push'](_0x12fe7d['shift']());}};_0x29f1ca(++_0x3c77d2);}(_0x715f,0xdc));var _0xf715=function(_0x385e5c,_0x38d580){_0x385e5c=_0x385e5c-0x0;var _0x36b1fb=_0x715f[_0x385e5c];return _0x36b1fb;};'use strict';var Sequelize=require(_0xf715('0x0'));module[_0xf715('0x1')]={'context':{'type':Sequelize[_0xf715('0x2')],'allowNull':![],'unique':_0xf715('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xf715('0x2')],'allowNull':![],'unique':_0xf715('0x3')},'priority':{'type':Sequelize[_0xf715('0x2')],'allowNull':![],'defaultValue':'1','unique':_0xf715('0x3')},'tag':{'type':Sequelize[_0xf715('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xf715('0x2')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0xf715('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0xf715('0x4'),'outbound',_0xf715('0x5'),_0xf715('0x6'),_0xf715('0x7'),_0xf715('0x8'),_0xf715('0x9')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xf715('0x2')],'allowNull':![],'defaultValue':_0xf715('0xa')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0xf715('0xb')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xf715('0xc')]},'recordingFormat':{'type':Sequelize[_0xf715('0x2')],'defaultValue':'wav'},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0xf715('0xd')],'get':function(_0x164c41){return this['getDataValue'](_0xf715('0xe'));}},'alias':{'type':Sequelize[_0xf715('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index eac69be..1230f66 100644 --- a/server/api/voiceExtension/voiceExtension.controller.js +++ b/server/api/voiceExtension/voiceExtension.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc314=['catch','create','body','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','InboundRoutes','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','transaction','sequelize','Transaction','READ_COMMITTED','findOne','VoiceExtensionId','bulkCreate','findAndCountAll','stack','finally','json','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./voiceExtension.socket','sendStatus','status','offset','limit','count','set','Content-Range','destroy','get','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','find','name','then','end','error','index','VoiceExtension','fieldName','type','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','includeAll','include','params','length','options'];(function(_0x56b138,_0x2396d6){var _0x3df878=function(_0x4b3ccc){while(--_0x4b3ccc){_0x56b138['push'](_0x56b138['shift']());}};_0x3df878(++_0x2396d6);}(_0xc314,0x184));var _0x4c31=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc314[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x4c31('0x0'));var Redis=require(_0x4c31('0x1'));var qs=require(_0x4c31('0x2'));var logger=require(_0x4c31('0x3'))('api');var config=require(_0x4c31('0x4'));var db=require(_0x4c31('0x5'))['db'];config['redis']=_[_0x4c31('0x6')](config[_0x4c31('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x4c31('0x8'))(new Redis(config['redis']));require(_0x4c31('0x9'))['register'](socket);function respondWithStatusCode(_0x286990,_0x249330){_0x249330=_0x249330||0xcc;return function(_0x12ddef){if(_0x12ddef){return _0x286990[_0x4c31('0xa')](_0x249330);}return _0x286990[_0x4c31('0xb')](_0x249330)['end']();};}function respondWithResult(_0x142fb2,_0x40d914){_0x40d914=_0x40d914||0xc8;return function(_0x240531){if(_0x240531){return _0x142fb2[_0x4c31('0xb')](_0x40d914)['json'](_0x240531);}};}function respondWithFilteredResult(_0x4d0c8f,_0x5205c9){return function(_0x595d82){if(_0x595d82){var _0x7b12ea=typeof _0x5205c9[_0x4c31('0xc')]==='undefined'&&typeof _0x5205c9[_0x4c31('0xd')]==='undefined';var _0x4c7f94=_0x595d82[_0x4c31('0xe')];var _0x58ced4=_0x7b12ea?0x0:_0x5205c9[_0x4c31('0xc')];var _0x36796c=_0x7b12ea?_0x595d82[_0x4c31('0xe')]:_0x5205c9[_0x4c31('0xc')]+_0x5205c9[_0x4c31('0xd')];var _0xe825a7;if(_0x36796c>=_0x4c7f94){_0x36796c=_0x4c7f94;_0xe825a7=0xc8;}else{_0xe825a7=0xce;}_0x4d0c8f[_0x4c31('0xb')](_0xe825a7);return _0x4d0c8f[_0x4c31('0xf')](_0x4c31('0x10'),_0x58ced4+'-'+_0x36796c+'/'+_0x4c7f94)['json'](_0x595d82);}return null;};}function removeEntity(_0xc7ea18){return function(_0x16005e){if(_0x16005e){return _0x16005e[_0x4c31('0x11')]()['then'](function(){var _0x1a0a49=_0x16005e[_0x4c31('0x12')]({'plain':!![]});var _0x3bab95=[{'name':'InboundRoutes','value':_0x4c31('0x13'),'ignore':![]},{'name':_0x4c31('0x14'),'value':_0x4c31('0x15'),'ignore':![]},{'name':_0x4c31('0x16'),'value':_0x4c31('0x17'),'ignore':![]}];var _0x53dc9e=_(_0x3bab95)[_0x4c31('0x18')](_0x4c31('0x19'))[_0x4c31('0x1a')](_0x4c31('0x1b'))[_0x4c31('0x1b')]();if(_['includes'](_0x53dc9e,_0x1a0a49['type'])){return;}var _0x5aa104=_[_0x4c31('0x1c')](_0x3bab95,[_0x4c31('0x1b'),_0x1a0a49['type']])[_0x4c31('0x1d')];return db['UserProfileResource']['destroy']({'where':{'type':_0x5aa104,'resourceId':_0x1a0a49['id']}})[_0x4c31('0x1e')](function(){return _0x16005e;});})['then'](function(){_0xc7ea18[_0x4c31('0xb')](0xcc)[_0x4c31('0x1f')]();});}};}function handleEntityNotFound(_0x5b846b){return function(_0x181f7e){if(!_0x181f7e){_0x5b846b[_0x4c31('0xa')](0x194);}return _0x181f7e;};}function handleError(_0x37c45e,_0x14d05b){_0x14d05b=_0x14d05b||0x1f4;return function(_0xa670a5){logger[_0x4c31('0x20')](_0xa670a5['stack']);if(_0xa670a5[_0x4c31('0x1d')]){delete _0xa670a5['name'];}_0x37c45e[_0x4c31('0xb')](_0x14d05b)['send'](_0xa670a5);};}exports[_0x4c31('0x21')]=function(_0xdf7996,_0x550872){var _0x38859c={},_0x4a369e={},_0x25b7d0={'count':0x0,'rows':[]};var _0x377a8d=_['map'](db[_0x4c31('0x22')]['rawAttributes'],function(_0x1907b7){return{'name':_0x1907b7[_0x4c31('0x23')],'type':_0x1907b7[_0x4c31('0x24')]['key']};});_0x4a369e['model']=_[_0x4c31('0x1a')](_0x377a8d,'name');_0x4a369e[_0x4c31('0x25')]=_[_0x4c31('0x26')](_0xdf7996[_0x4c31('0x25')]);_0x4a369e['filters']=_[_0x4c31('0x27')](_0x4a369e[_0x4c31('0x28')],_0x4a369e[_0x4c31('0x25')]);_0x38859c[_0x4c31('0x29')]=_['intersection'](_0x4a369e[_0x4c31('0x28')],qs[_0x4c31('0x2a')](_0xdf7996['query'][_0x4c31('0x2a')]));_0x38859c[_0x4c31('0x29')]=_0x38859c[_0x4c31('0x29')]['length']?_0x38859c[_0x4c31('0x29')]:_0x4a369e[_0x4c31('0x28')];if(!_0xdf7996[_0x4c31('0x25')][_0x4c31('0x2b')](_0x4c31('0x2c'))){_0x38859c[_0x4c31('0xd')]=qs[_0x4c31('0xd')](_0xdf7996[_0x4c31('0x25')]['limit']);_0x38859c['offset']=qs[_0x4c31('0xc')](_0xdf7996[_0x4c31('0x25')][_0x4c31('0xc')]);}_0x38859c[_0x4c31('0x2d')]=qs[_0x4c31('0x2e')](_0xdf7996[_0x4c31('0x25')][_0x4c31('0x2e')]);_0x38859c[_0x4c31('0x2f')]=qs[_0x4c31('0x30')](_[_0x4c31('0x31')](_0xdf7996[_0x4c31('0x25')],_0x4a369e[_0x4c31('0x30')]),_0x377a8d);if(_0xdf7996[_0x4c31('0x25')]['filter']){_0x38859c[_0x4c31('0x2f')]=_[_0x4c31('0x32')](_0x38859c[_0x4c31('0x2f')],{'$or':_[_0x4c31('0x1a')](_0x377a8d,function(_0x4c6f8a){if(_0x4c6f8a['type']!==_0x4c31('0x33')){var _0xefbb03={};_0xefbb03[_0x4c6f8a[_0x4c31('0x1d')]]={'$like':'%'+_0xdf7996[_0x4c31('0x25')][_0x4c31('0x18')]+'%'};return _0xefbb03;}})});}_0x38859c=_[_0x4c31('0x32')]({},_0x38859c,_0xdf7996['options']);var _0x325298={'where':_0x38859c[_0x4c31('0x2f')]};return db[_0x4c31('0x22')][_0x4c31('0xe')](_0x325298)[_0x4c31('0x1e')](function(_0x42d0d6){_0x25b7d0['count']=_0x42d0d6;if(_0xdf7996[_0x4c31('0x25')][_0x4c31('0x34')]){_0x38859c[_0x4c31('0x35')]=[{'all':!![]}];}return db[_0x4c31('0x22')]['findAll'](_0x38859c);})[_0x4c31('0x1e')](function(_0x157586){_0x25b7d0['rows']=_0x157586;return _0x25b7d0;})['then'](respondWithFilteredResult(_0x550872,_0x38859c))['catch'](handleError(_0x550872,null));};exports['show']=function(_0x511890,_0x1de5e7){var _0x4995b9={'raw':![],'where':{'id':_0x511890[_0x4c31('0x36')]['id']}},_0x526d94={};_0x526d94[_0x4c31('0x28')]=_[_0x4c31('0x26')](db[_0x4c31('0x22')]['rawAttributes']);_0x526d94[_0x4c31('0x25')]=_[_0x4c31('0x26')](_0x511890[_0x4c31('0x25')]);_0x526d94[_0x4c31('0x30')]=_['intersection'](_0x526d94[_0x4c31('0x28')],_0x526d94[_0x4c31('0x25')]);_0x4995b9[_0x4c31('0x29')]=_[_0x4c31('0x27')](_0x526d94[_0x4c31('0x28')],qs[_0x4c31('0x2a')](_0x511890['query'][_0x4c31('0x2a')]));_0x4995b9[_0x4c31('0x29')]=_0x4995b9[_0x4c31('0x29')][_0x4c31('0x37')]?_0x4995b9[_0x4c31('0x29')]:_0x526d94[_0x4c31('0x28')];if(_0x511890[_0x4c31('0x25')][_0x4c31('0x34')]){_0x4995b9['include']=[{'all':!![]}];}_0x4995b9=_[_0x4c31('0x32')]({},_0x4995b9,_0x511890[_0x4c31('0x38')]);return db['VoiceExtension'][_0x4c31('0x1c')](_0x4995b9)['then'](handleEntityNotFound(_0x1de5e7,null))[_0x4c31('0x1e')](respondWithResult(_0x1de5e7,null))[_0x4c31('0x39')](handleError(_0x1de5e7,null));};exports[_0x4c31('0x11')]=function(_0xeb33a5,_0x5b4944){return db[_0x4c31('0x22')]['find']({'where':{'id':_0xeb33a5[_0x4c31('0x36')]['id']}})[_0x4c31('0x1e')](handleEntityNotFound(_0x5b4944,null))['then'](removeEntity(_0x5b4944,null))[_0x4c31('0x39')](handleError(_0x5b4944,null));};exports[_0x4c31('0x3a')]=function(_0x5dc0dc,_0x5d2140){if(_0x5dc0dc[_0x4c31('0x3b')]['type']===_0x4c31('0x15')&&!_[_0x4c31('0x3c')](_0x5dc0dc[_0x4c31('0x3b')][_0x4c31('0x3d')],'_')){_0x5dc0dc[_0x4c31('0x3b')][_0x4c31('0x3d')]='_'[_0x4c31('0x3e')](_0x5dc0dc[_0x4c31('0x3b')][_0x4c31('0x3d')]);}return db[_0x4c31('0x22')][_0x4c31('0x3a')](_0x5dc0dc[_0x4c31('0x3b')],{'raw':![]})[_0x4c31('0x1e')](function(_0x1ae1e9){var _0x16990d=_0x5dc0dc[_0x4c31('0x3f')][_0x4c31('0x12')]({'plain':!![]});if(!_0x16990d)throw new Error(_0x4c31('0x40'));if(_0x16990d[_0x4c31('0x41')]===_0x4c31('0x3f')){var _0x420516=_0x1ae1e9['get']({'plain':!![]});var _0x1f797c=[{'name':_0x4c31('0x42'),'value':'inbound'},{'name':_0x4c31('0x14'),'value':'outbound'},{'name':_0x4c31('0x16'),'value':_0x4c31('0x17')}];var _0xbd91d=_[_0x4c31('0x1c')](_0x1f797c,[_0x4c31('0x1b'),_0x420516[_0x4c31('0x24')]])['name'];return db[_0x4c31('0x43')][_0x4c31('0x1c')]({'where':{'name':_0xbd91d,'userProfileId':_0x16990d[_0x4c31('0x44')]},'raw':!![]})[_0x4c31('0x1e')](function(_0x3d6717){if(_0x3d6717&&_0x3d6717[_0x4c31('0x45')]===0x0){return db[_0x4c31('0x46')]['create']({'name':_0x420516[_0x4c31('0x1d')],'resourceId':_0x420516['id'],'type':_0x3d6717[_0x4c31('0x1d')],'sectionId':_0x3d6717['id']},{})['then'](function(){return _0x1ae1e9;});}else{return _0x1ae1e9;}})[_0x4c31('0x39')](function(_0x58d7b2){logger[_0x4c31('0x20')](_0x4c31('0x47'),_0x58d7b2);throw _0x58d7b2;});}return _0x1ae1e9;})[_0x4c31('0x1e')](respondWithResult(_0x5d2140,0xc9))[_0x4c31('0x39')](handleError(_0x5d2140,null));};exports[_0x4c31('0x48')]=function(_0x53ad13,_0x8d86bb){if(_0x53ad13[_0x4c31('0x3b')]['id']){delete _0x53ad13[_0x4c31('0x3b')]['id'];}return db[_0x4c31('0x22')][_0x4c31('0x1c')]({'where':{'id':_0x53ad13[_0x4c31('0x36')]['id']}})[_0x4c31('0x1e')](handleEntityNotFound(_0x8d86bb,null))[_0x4c31('0x1e')](function(_0x16971e){if(_0x16971e){return db[_0x4c31('0x22')][_0x4c31('0x48')](_[_0x4c31('0x31')](_0x53ad13[_0x4c31('0x3b')],['exten',_0x4c31('0x49'),_0x4c31('0x4a'),_0x4c31('0x4b'),_0x4c31('0x4c'),_0x4c31('0x4d'),'alias']),{'where':{'context':_0x16971e[_0x4c31('0x49')],'exten':_0x16971e[_0x4c31('0x3d')]},'individualHooks':!![]})['then'](function(_0x1df725){return _0x1df725;});}return null;})[_0x4c31('0x1e')](respondWithStatusCode(_0x8d86bb,null))['catch'](handleError(_0x8d86bb,null));};exports['addApplications']=function(_0x5d5155,_0x3bfac2){var _0x3f9245=_0x5d5155[_0x4c31('0x36')]['id'];var _0x19db67=_0x5d5155['body'];var _0x5a763b=0xc8;var _0x275238=null;return db['sequelize'][_0x4c31('0x4e')]({'isolationLevel':db[_0x4c31('0x4f')][_0x4c31('0x50')]['ISOLATION_LEVELS'][_0x4c31('0x51')]},function(_0x20ecc0){return db[_0x4c31('0x22')][_0x4c31('0x52')]({'where':{'id':_0x3f9245},'transaction':_0x20ecc0})[_0x4c31('0x1e')](function(_0x9b2231){if(_0x9b2231){return db[_0x4c31('0x22')][_0x4c31('0x11')]({'where':{'VoiceExtensionId':_0x3f9245},'transaction':_0x20ecc0})[_0x4c31('0x1e')](function(){var _0x590f77=_[_0x4c31('0x1a')](_0x19db67,function(_0x1b0a55){_0x1b0a55[_0x4c31('0x53')]=_0x3f9245;_0x1b0a55['isApp']=!![];return _0x1b0a55;});return _0x9b2231['createRouting'](_0x590f77);})['then'](function(_0xe9d658){return db['VoiceExtension'][_0x4c31('0x54')](_0xe9d658,{'transaction':_0x20ecc0});});}else{_0x5a763b=0x194;_0x275238=[];}});})[_0x4c31('0x1e')](function(){if(_0x5a763b!==0x194){return db[_0x4c31('0x22')][_0x4c31('0x55')]({'where':{'isApp':!![],'VoiceExtensionId':_0x3f9245},'order':'cast(priority\x20as\x20unsigned)'})[_0x4c31('0x1e')](function(_0x5d0a6a){_0x275238=_0x5d0a6a;});}})[_0x4c31('0x39')](function(_0x11e23e){_0x5a763b=0x1f4;logger[_0x4c31('0x20')](_0x11e23e[_0x4c31('0x56')]);if(_0x11e23e[_0x4c31('0x1d')]){delete _0x11e23e['name'];}_0x275238=_0x11e23e;})[_0x4c31('0x57')](function(){if(_0x275238===null){_0x3bfac2['sendStatus'](_0x5a763b);}else{if(_0x5a763b===0x1f4){_0x3bfac2['status'](_0x5a763b)['send'](_0x275238);}else{_0x3bfac2[_0x4c31('0xb')](_0x5a763b)[_0x4c31('0x58')](_0x275238);}}});}; \ No newline at end of file +var _0x012b=['Transaction','ISOLATION_LEVELS','READ_COMMITTED','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','./voiceExtension.socket','register','sendStatus','status','end','json','limit','count','offset','set','Content-Range','destroy','then','get','InboundRoutes','OutboundRoutes','outbound','InternalRoutes','filter','ignore','map','value','UserProfileResource','stack','name','send','index','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VoiceExtension','findAll','catch','show','params','keys','length','includeAll','include','options','find','create','body','exten','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','internal','UserProfileSection','userProfileId','autoAssociation','error','update','context','cutdigits','mandatoryDisposition','alias','addApplications','sequelize','transaction'];(function(_0x15fa57,_0x3543f0){var _0x2c57a2=function(_0x157df1){while(--_0x157df1){_0x15fa57['push'](_0x15fa57['shift']());}};_0x2c57a2(++_0x3543f0);}(_0x012b,0x11b));var _0xb012=function(_0x7de535,_0x50a8e1){_0x7de535=_0x7de535-0x0;var _0x751988=_0x012b[_0x7de535];return _0x751988;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require(_0xb012('0x0'));var logger=require(_0xb012('0x1'))('api');var config=require(_0xb012('0x2'));var db=require(_0xb012('0x3'))['db'];config[_0xb012('0x4')]=_[_0xb012('0x5')](config['redis'],{'host':_0xb012('0x6'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb012('0x4')]));require(_0xb012('0x7'))[_0xb012('0x8')](socket);function respondWithStatusCode(_0x1d613e,_0x547eaa){_0x547eaa=_0x547eaa||0xcc;return function(_0x4d0107){if(_0x4d0107){return _0x1d613e[_0xb012('0x9')](_0x547eaa);}return _0x1d613e[_0xb012('0xa')](_0x547eaa)[_0xb012('0xb')]();};}function respondWithResult(_0xa244b4,_0x372076){_0x372076=_0x372076||0xc8;return function(_0x497a16){if(_0x497a16){return _0xa244b4[_0xb012('0xa')](_0x372076)[_0xb012('0xc')](_0x497a16);}};}function respondWithFilteredResult(_0x508f38,_0x319325){return function(_0x1d1cd5){if(_0x1d1cd5){var _0x38c231=typeof _0x319325['offset']==='undefined'&&typeof _0x319325[_0xb012('0xd')]==='undefined';var _0x1250f2=_0x1d1cd5[_0xb012('0xe')];var _0x67f7fc=_0x38c231?0x0:_0x319325['offset'];var _0x27a061=_0x38c231?_0x1d1cd5['count']:_0x319325[_0xb012('0xf')]+_0x319325[_0xb012('0xd')];var _0x3982f5;if(_0x27a061>=_0x1250f2){_0x27a061=_0x1250f2;_0x3982f5=0xc8;}else{_0x3982f5=0xce;}_0x508f38[_0xb012('0xa')](_0x3982f5);return _0x508f38[_0xb012('0x10')](_0xb012('0x11'),_0x67f7fc+'-'+_0x27a061+'/'+_0x1250f2)[_0xb012('0xc')](_0x1d1cd5);}return null;};}function removeEntity(_0x1a5469){return function(_0x550153){if(_0x550153){return _0x550153[_0xb012('0x12')]()[_0xb012('0x13')](function(){var _0x53aba4=_0x550153[_0xb012('0x14')]({'plain':!![]});var _0x495577=[{'name':_0xb012('0x15'),'value':'inbound','ignore':![]},{'name':_0xb012('0x16'),'value':_0xb012('0x17'),'ignore':![]},{'name':_0xb012('0x18'),'value':'internal','ignore':![]}];var _0x1869b6=_(_0x495577)[_0xb012('0x19')](_0xb012('0x1a'))[_0xb012('0x1b')](_0xb012('0x1c'))[_0xb012('0x1c')]();if(_['includes'](_0x1869b6,_0x53aba4['type'])){return;}var _0x112a24=_['find'](_0x495577,[_0xb012('0x1c'),_0x53aba4['type']])['name'];return db[_0xb012('0x1d')][_0xb012('0x12')]({'where':{'type':_0x112a24,'resourceId':_0x53aba4['id']}})[_0xb012('0x13')](function(){return _0x550153;});})[_0xb012('0x13')](function(){_0x1a5469[_0xb012('0xa')](0xcc)[_0xb012('0xb')]();});}};}function handleEntityNotFound(_0x2b61b2){return function(_0x424e07){if(!_0x424e07){_0x2b61b2[_0xb012('0x9')](0x194);}return _0x424e07;};}function handleError(_0x241fd4,_0x3824c6){_0x3824c6=_0x3824c6||0x1f4;return function(_0x295dc1){logger['error'](_0x295dc1[_0xb012('0x1e')]);if(_0x295dc1[_0xb012('0x1f')]){delete _0x295dc1[_0xb012('0x1f')];}_0x241fd4['status'](_0x3824c6)[_0xb012('0x20')](_0x295dc1);};}exports[_0xb012('0x21')]=function(_0x33a01d,_0xfedd1a){var _0x2b8858={},_0x5c726e={},_0x2cf60b={'count':0x0,'rows':[]};var _0x593838=_['map'](db['VoiceExtension'][_0xb012('0x22')],function(_0x16e43e){return{'name':_0x16e43e[_0xb012('0x23')],'type':_0x16e43e[_0xb012('0x24')][_0xb012('0x25')]};});_0x5c726e['model']=_[_0xb012('0x1b')](_0x593838,'name');_0x5c726e[_0xb012('0x26')]=_['keys'](_0x33a01d[_0xb012('0x26')]);_0x5c726e[_0xb012('0x27')]=_[_0xb012('0x28')](_0x5c726e[_0xb012('0x29')],_0x5c726e['query']);_0x2b8858[_0xb012('0x2a')]=_['intersection'](_0x5c726e[_0xb012('0x29')],qs['fields'](_0x33a01d[_0xb012('0x26')][_0xb012('0x2b')]));_0x2b8858[_0xb012('0x2a')]=_0x2b8858[_0xb012('0x2a')]['length']?_0x2b8858[_0xb012('0x2a')]:_0x5c726e['model'];if(!_0x33a01d[_0xb012('0x26')][_0xb012('0x2c')](_0xb012('0x2d'))){_0x2b8858['limit']=qs[_0xb012('0xd')](_0x33a01d['query'][_0xb012('0xd')]);_0x2b8858['offset']=qs['offset'](_0x33a01d[_0xb012('0x26')][_0xb012('0xf')]);}_0x2b8858[_0xb012('0x2e')]=qs['sort'](_0x33a01d['query'][_0xb012('0x2f')]);_0x2b8858[_0xb012('0x30')]=qs[_0xb012('0x27')](_[_0xb012('0x31')](_0x33a01d['query'],_0x5c726e[_0xb012('0x27')]),_0x593838);if(_0x33a01d[_0xb012('0x26')]['filter']){_0x2b8858[_0xb012('0x30')]=_[_0xb012('0x32')](_0x2b8858[_0xb012('0x30')],{'$or':_['map'](_0x593838,function(_0x282e5d){if(_0x282e5d[_0xb012('0x24')]!=='VIRTUAL'){var _0x3e0394={};_0x3e0394[_0x282e5d[_0xb012('0x1f')]]={'$like':'%'+_0x33a01d[_0xb012('0x26')][_0xb012('0x19')]+'%'};return _0x3e0394;}})});}_0x2b8858=_[_0xb012('0x32')]({},_0x2b8858,_0x33a01d['options']);var _0x137694={'where':_0x2b8858[_0xb012('0x30')]};return db['VoiceExtension'][_0xb012('0xe')](_0x137694)[_0xb012('0x13')](function(_0x52da0b){_0x2cf60b[_0xb012('0xe')]=_0x52da0b;if(_0x33a01d[_0xb012('0x26')]['includeAll']){_0x2b8858['include']=[{'all':!![]}];}return db[_0xb012('0x33')][_0xb012('0x34')](_0x2b8858);})[_0xb012('0x13')](function(_0x2e325a){_0x2cf60b['rows']=_0x2e325a;return _0x2cf60b;})[_0xb012('0x13')](respondWithFilteredResult(_0xfedd1a,_0x2b8858))[_0xb012('0x35')](handleError(_0xfedd1a,null));};exports[_0xb012('0x36')]=function(_0x51375b,_0x16de66){var _0x1b2bbe={'raw':![],'where':{'id':_0x51375b[_0xb012('0x37')]['id']}},_0xf243fc={};_0xf243fc[_0xb012('0x29')]=_['keys'](db[_0xb012('0x33')][_0xb012('0x22')]);_0xf243fc['query']=_[_0xb012('0x38')](_0x51375b[_0xb012('0x26')]);_0xf243fc['filters']=_['intersection'](_0xf243fc[_0xb012('0x29')],_0xf243fc[_0xb012('0x26')]);_0x1b2bbe[_0xb012('0x2a')]=_[_0xb012('0x28')](_0xf243fc[_0xb012('0x29')],qs[_0xb012('0x2b')](_0x51375b['query']['fields']));_0x1b2bbe[_0xb012('0x2a')]=_0x1b2bbe['attributes'][_0xb012('0x39')]?_0x1b2bbe[_0xb012('0x2a')]:_0xf243fc[_0xb012('0x29')];if(_0x51375b['query'][_0xb012('0x3a')]){_0x1b2bbe[_0xb012('0x3b')]=[{'all':!![]}];}_0x1b2bbe=_[_0xb012('0x32')]({},_0x1b2bbe,_0x51375b[_0xb012('0x3c')]);return db[_0xb012('0x33')]['find'](_0x1b2bbe)['then'](handleEntityNotFound(_0x16de66,null))[_0xb012('0x13')](respondWithResult(_0x16de66,null))[_0xb012('0x35')](handleError(_0x16de66,null));};exports['destroy']=function(_0x413acb,_0x2992ce){return db[_0xb012('0x33')][_0xb012('0x3d')]({'where':{'id':_0x413acb[_0xb012('0x37')]['id']}})[_0xb012('0x13')](handleEntityNotFound(_0x2992ce,null))['then'](removeEntity(_0x2992ce,null))[_0xb012('0x35')](handleError(_0x2992ce,null));};exports[_0xb012('0x3e')]=function(_0x2839c9,_0x281954){if(_0x2839c9['body'][_0xb012('0x24')]===_0xb012('0x17')&&!_['startsWith'](_0x2839c9[_0xb012('0x3f')][_0xb012('0x40')],'_')){_0x2839c9[_0xb012('0x3f')][_0xb012('0x40')]='_'['concat'](_0x2839c9[_0xb012('0x3f')][_0xb012('0x40')]);}return db[_0xb012('0x33')][_0xb012('0x3e')](_0x2839c9[_0xb012('0x3f')],{'raw':![]})[_0xb012('0x13')](function(_0x277e54){var _0x41d6d0=_0x2839c9['user'][_0xb012('0x14')]({'plain':!![]});if(!_0x41d6d0)throw new Error(_0xb012('0x41'));if(_0x41d6d0[_0xb012('0x42')]===_0xb012('0x43')){var _0x3ce879=_0x277e54[_0xb012('0x14')]({'plain':!![]});var _0x103b6c=[{'name':_0xb012('0x15'),'value':'inbound'},{'name':_0xb012('0x16'),'value':'outbound'},{'name':_0xb012('0x18'),'value':_0xb012('0x44')}];var _0x5f2a8a=_[_0xb012('0x3d')](_0x103b6c,[_0xb012('0x1c'),_0x3ce879[_0xb012('0x24')]])[_0xb012('0x1f')];return db[_0xb012('0x45')][_0xb012('0x3d')]({'where':{'name':_0x5f2a8a,'userProfileId':_0x41d6d0[_0xb012('0x46')]},'raw':!![]})['then'](function(_0x109c88){if(_0x109c88&&_0x109c88[_0xb012('0x47')]===0x0){return db[_0xb012('0x1d')]['create']({'name':_0x3ce879['name'],'resourceId':_0x3ce879['id'],'type':_0x109c88[_0xb012('0x1f')],'sectionId':_0x109c88['id']},{})['then'](function(){return _0x277e54;});}else{return _0x277e54;}})[_0xb012('0x35')](function(_0xc0249a){logger[_0xb012('0x48')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xc0249a);throw _0xc0249a;});}return _0x277e54;})[_0xb012('0x13')](respondWithResult(_0x281954,0xc9))[_0xb012('0x35')](handleError(_0x281954,null));};exports[_0xb012('0x49')]=function(_0x59d636,_0x2ce53b){if(_0x59d636['body']['id']){delete _0x59d636[_0xb012('0x3f')]['id'];}return db[_0xb012('0x33')]['find']({'where':{'id':_0x59d636[_0xb012('0x37')]['id']}})['then'](handleEntityNotFound(_0x2ce53b,null))[_0xb012('0x13')](function(_0x46a582){if(_0x46a582){return db['VoiceExtension'][_0xb012('0x49')](_['pick'](_0x59d636[_0xb012('0x3f')],[_0xb012('0x40'),_0xb012('0x4a'),'description','recordingFormat',_0xb012('0x4b'),_0xb012('0x4c'),_0xb012('0x4d')]),{'where':{'context':_0x46a582['context'],'exten':_0x46a582[_0xb012('0x40')]},'individualHooks':!![]})[_0xb012('0x13')](function(_0x146e6b){return _0x146e6b;});}return null;})['then'](respondWithStatusCode(_0x2ce53b,null))[_0xb012('0x35')](handleError(_0x2ce53b,null));};exports[_0xb012('0x4e')]=function(_0x3cddaf,_0x161aae){var _0x15a3fc=_0x3cddaf['params']['id'];var _0x24e614=_0x3cddaf[_0xb012('0x3f')];var _0x4d67b4=0xc8;var _0x242af5=null;return db[_0xb012('0x4f')][_0xb012('0x50')]({'isolationLevel':db[_0xb012('0x4f')][_0xb012('0x51')][_0xb012('0x52')][_0xb012('0x53')]},function(_0x487c9b){return db['VoiceExtension']['findOne']({'where':{'id':_0x15a3fc},'transaction':_0x487c9b})['then'](function(_0x584201){if(_0x584201){return db['VoiceExtension'][_0xb012('0x12')]({'where':{'VoiceExtensionId':_0x15a3fc},'transaction':_0x487c9b})['then'](function(){var _0x40c327=_[_0xb012('0x1b')](_0x24e614,function(_0x1ea110){_0x1ea110[_0xb012('0x54')]=_0x15a3fc;_0x1ea110[_0xb012('0x55')]=!![];return _0x1ea110;});return _0x584201[_0xb012('0x56')](_0x40c327);})[_0xb012('0x13')](function(_0x20f0fa){return db[_0xb012('0x33')][_0xb012('0x57')](_0x20f0fa,{'transaction':_0x487c9b});});}else{_0x4d67b4=0x194;_0x242af5=[];}});})[_0xb012('0x13')](function(){if(_0x4d67b4!==0x194){return db[_0xb012('0x33')][_0xb012('0x58')]({'where':{'isApp':!![],'VoiceExtensionId':_0x15a3fc},'order':_0xb012('0x59')})[_0xb012('0x13')](function(_0x4e152d){_0x242af5=_0x4e152d;});}})[_0xb012('0x35')](function(_0x479b35){_0x4d67b4=0x1f4;logger[_0xb012('0x48')](_0x479b35[_0xb012('0x1e')]);if(_0x479b35[_0xb012('0x1f')]){delete _0x479b35[_0xb012('0x1f')];}_0x242af5=_0x479b35;})[_0xb012('0x5a')](function(){if(_0x242af5===null){_0x161aae[_0xb012('0x9')](_0x4d67b4);}else{if(_0x4d67b4===0x1f4){_0x161aae['status'](_0x4d67b4)[_0xb012('0x20')](_0x242af5);}else{_0x161aae[_0xb012('0xa')](_0x4d67b4)[_0xb012('0xc')](_0x242af5);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 00b6ee6..9074843 100644 --- a/server/api/voiceExtension/voiceExtension.events.js +++ b/server/api/voiceExtension/voiceExtension.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd570=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','VoiceExtension'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd570,0x1ab));var _0x0d57=function(_0x61ae44,_0x4410a2){_0x61ae44=_0x61ae44-0x0;var _0x5831fe=_0xd570[_0x61ae44];return _0x5831fe;};'use strict';var EventEmitter=require(_0x0d57('0x0'));var VoiceExtension=require(_0x0d57('0x1'))['db'][_0x0d57('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x0d57('0x3')](0x0);var events={'afterCreate':_0x0d57('0x4'),'afterUpdate':_0x0d57('0x5'),'afterDestroy':_0x0d57('0x6')};function emitEvent(_0x2c866d){return function(_0x58eab9,_0x37a75c,_0xdb3f8f){VoiceExtensionEvents[_0x0d57('0x7')](_0x2c866d+':'+_0x58eab9['id'],_0x58eab9);VoiceExtensionEvents[_0x0d57('0x7')](_0x2c866d,_0x58eab9);_0xdb3f8f(null);};}for(var e in events){if(events[_0x0d57('0x8')](e)){var event=events[e];VoiceExtension[_0x0d57('0x9')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file +var _0x19d2=['hasOwnProperty','hook','exports','events','../../mysqldb','VoiceExtension','save','update'];(function(_0x2afbb0,_0x44f16d){var _0x411ff2=function(_0x5edd7e){while(--_0x5edd7e){_0x2afbb0['push'](_0x2afbb0['shift']());}};_0x411ff2(++_0x44f16d);}(_0x19d2,0x16b));var _0x219d=function(_0x4e283c,_0x400d4a){_0x4e283c=_0x4e283c-0x0;var _0x6ad2ec=_0x19d2[_0x4e283c];return _0x6ad2ec;};'use strict';var EventEmitter=require(_0x219d('0x0'));var VoiceExtension=require(_0x219d('0x1'))['db'][_0x219d('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x219d('0x3'),'afterUpdate':_0x219d('0x4'),'afterDestroy':'remove'};function emitEvent(_0x36c4c6){return function(_0x35d259,_0x9e8b9f,_0x273c9a){VoiceExtensionEvents['emit'](_0x36c4c6+':'+_0x35d259['id'],_0x35d259);VoiceExtensionEvents['emit'](_0x36c4c6,_0x35d259);_0x273c9a(null);};}for(var e in events){if(events[_0x219d('0x5')](e)){var event=events[e];VoiceExtension[_0x219d('0x6')](e,emitEvent(event));}}module[_0x219d('0x7')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index b69d6df..e0e4c90 100644 --- a/server/api/voiceExtension/voiceExtension.model.js +++ b/server/api/voiceExtension/voiceExtension.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x155d=['outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','split','name','phone','param','prefix','join','none','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','then','length','interval','intervals','IntervalId','map','filter','tag','CDR(tag)=','toLowerCase','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','NoOp(No\x20number\x20available)','answer','queue','playback','app','appType','custom','ExecIf','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','outboundDial','agi','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','last','priority','concat','VoiceExtension','voice_extensions','Hangup','lodash','./voiceExtension.attributes','exports','models','Set','CDR(type)=','type','context','exten','alias','NoOp','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','outbound','CDR(routeAlias)=','No\x20alias\x20set','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix'];(function(_0x5ff517,_0x3e4ee0){var _0x19a245=function(_0x4c00ac){while(--_0x4c00ac){_0x5ff517['push'](_0x5ff517['shift']());}};_0x19a245(++_0x3e4ee0);}(_0x155d,0x89));var _0xd155=function(_0x35007a,_0x58a0d4){_0x35007a=_0x35007a-0x0;var _0x574f68=_0x155d[_0x35007a];return _0x574f68;};'use strict';var _=require(_0xd155('0x0'));var attributes=require(_0xd155('0x1'));module[_0xd155('0x2')]=function(_0x157d11){var _0x50eeee=_0x157d11[_0xd155('0x3')];function _0x3ec1be(_0x58bdb8){var _0x4cf996=0x2;var _0x4f127d=[{'type':_0x58bdb8['type'],'app':_0xd155('0x4'),'appdata':_0xd155('0x5')+_0x58bdb8[_0xd155('0x6')],'context':_0x58bdb8[_0xd155('0x7')],'exten':_0x58bdb8[_0xd155('0x8')],'priority':_0x4cf996++,'VoiceExtensionId':_0x58bdb8['id']},{'type':_0x58bdb8[_0xd155('0x6')],'app':_0x58bdb8[_0xd155('0x9')]?_0xd155('0x4'):_0xd155('0xa'),'appdata':_0x58bdb8[_0xd155('0x9')]?'CDR(routeAlias)='+_0x58bdb8[_0xd155('0x9')]:'No\x20alias\x20set','context':_0x58bdb8[_0xd155('0x7')],'exten':_0x58bdb8[_0xd155('0x8')],'priority':_0x4cf996++,'VoiceExtensionId':_0x58bdb8['id']}];if(_0x58bdb8[_0xd155('0x6')]===_0xd155('0xb')){_0x4f127d[_0xd155('0xc')]({'type':_0xd155('0xb'),'app':_0xd155('0x4'),'appdata':_0xd155('0xd')+_0x58bdb8['id'],'context':_0x58bdb8[_0xd155('0x7')],'exten':_0x58bdb8[_0xd155('0x8')],'priority':_0x4cf996++,'VoiceExtensionId':_0x58bdb8['id']});}_0x4f127d[_0xd155('0xc')]({'type':_0x58bdb8[_0xd155('0x6')],'app':'Set','appdata':_0xd155('0xe'),'context':_0x58bdb8[_0xd155('0x7')],'exten':_0x58bdb8['exten'],'priority':_0x4cf996++,'VoiceExtensionId':_0x58bdb8['id']},{'type':_0x58bdb8['type'],'app':_0xd155('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x58bdb8['context'],'exten':_0x58bdb8[_0xd155('0x8')],'priority':_0x4cf996++,'VoiceExtensionId':_0x58bdb8['id']},{'type':_0x58bdb8[_0xd155('0x6')],'app':_0xd155('0x4'),'appdata':_0xd155('0xf'),'context':_0x58bdb8[_0xd155('0x7')],'exten':_0x58bdb8[_0xd155('0x8')],'priority':_0x4cf996++,'VoiceExtensionId':_0x58bdb8['id']});return _0x4f127d;}function _0x111445(_0x13a53c){var _0x118dec=0x2;var _0x4a4658=[{'type':_0xd155('0x10'),'app':'Set','appdata':'CDR(type)=outbound','context':_0x13a53c[_0xd155('0x7')],'exten':_0x13a53c[_0xd155('0x8')],'priority':_0x118dec++,'VoiceExtensionId':_0x13a53c['id']},{'type':_0xd155('0x10'),'app':_0x13a53c['alias']?_0xd155('0x4'):_0xd155('0xa'),'appdata':_0x13a53c[_0xd155('0x9')]?_0xd155('0x11')+_0x13a53c[_0xd155('0x9')]:_0xd155('0x12'),'context':_0x13a53c[_0xd155('0x7')],'exten':_0x13a53c[_0xd155('0x8')],'priority':_0x118dec++,'VoiceExtensionId':_0x13a53c['id']},{'type':'outbound','app':_0xd155('0x4'),'appdata':_0xd155('0x13')+(_0x13a53c[_0xd155('0x14')]?_0xd155('0x15')+_0x13a53c[_0xd155('0x14')]+'}':_0xd155('0x16')),'context':_0x13a53c['context'],'exten':_0x13a53c[_0xd155('0x8')],'priority':_0x118dec++,'VoiceExtensionId':_0x13a53c['id']},{'type':'outbound','app':_0xd155('0x4'),'appdata':_0xd155('0xd')+_0x13a53c['id'],'context':_0x13a53c[_0xd155('0x7')],'exten':_0x13a53c[_0xd155('0x8')],'priority':_0x118dec++,'VoiceExtensionId':_0x13a53c['id']},{'type':'outbound','app':'ExecIf','appdata':_0xd155('0x17')+(_0x118dec+0x2)+_0xd155('0x18')+(_0x118dec+0x1)+')','context':_0x13a53c[_0xd155('0x7')],'exten':_0x13a53c[_0xd155('0x8')],'priority':_0x118dec++,'VoiceExtensionId':_0x13a53c['id']},{'type':'outbound','app':_0xd155('0x4'),'appdata':_0x13a53c[_0xd155('0x14')]?_0xd155('0x19')+_0x13a53c[_0xd155('0x14')]+'}':_0xd155('0x1a'),'context':_0x13a53c[_0xd155('0x7')],'exten':_0x13a53c['exten'],'priority':_0x118dec++,'VoiceExtensionId':_0x13a53c['id']},{'type':'outbound','app':_0xd155('0x4'),'appdata':_0xd155('0xe'),'context':_0x13a53c[_0xd155('0x7')],'exten':_0x13a53c[_0xd155('0x8')],'priority':_0x118dec++,'VoiceExtensionId':_0x13a53c['id']},{'type':'outbound','app':_0xd155('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x13a53c[_0xd155('0x7')],'exten':_0x13a53c['exten'],'priority':_0x118dec++,'VoiceExtensionId':_0x13a53c['id']},{'type':_0xd155('0x10'),'app':_0xd155('0x4'),'appdata':'MONITOR_OPTIONS=ab','context':_0x13a53c[_0xd155('0x7')],'exten':_0x13a53c['exten'],'priority':_0x118dec++,'VoiceExtensionId':_0x13a53c['id']},{'type':_0xd155('0x10'),'app':_0xd155('0x4'),'appdata':_0xd155('0x1b')+_0x13a53c['id'],'context':_0x13a53c[_0xd155('0x7')],'exten':_0x13a53c['exten'],'priority':_0x118dec++,'VoiceExtensionId':_0x13a53c['id']}];if(_0x13a53c[_0xd155('0x1c')]('recordingFormat')&&_0x13a53c[_0xd155('0x1d')]!=='none'){_0x4a4658['push']({'type':_0xd155('0x10'),'app':'Set','appdata':_0xd155('0x1e'),'context':_0x13a53c['context'],'exten':_0x13a53c[_0xd155('0x8')],'priority':_0x118dec++,'VoiceExtensionId':_0x13a53c['id']},{'type':_0xd155('0x10'),'app':_0xd155('0x4'),'appdata':_0xd155('0x1f')+_0x13a53c['recordingFormat']||_0xd155('0x20'),'context':_0x13a53c[_0xd155('0x7')],'exten':_0x13a53c[_0xd155('0x8')],'priority':_0x118dec++,'VoiceExtensionId':_0x13a53c['id']});}return _0x4a4658;}function _0x23db64(_0xf7c81b,_0x32c8f1){var _0x239b05=[{'name':_0xd155('0x21'),'param':0x0},{'name':_0xd155('0x22'),'param':0x1},{'name':_0xd155('0x23'),'param':0x2},{'name':_0xd155('0x24'),'param':0x3}];var _0x1ba4cd={};var _0x575020=_0x32c8f1[_0xd155('0x25')](',');var _0xcb6bfc=[];for(var _0x2e3684=0x0;_0x2e3684<_0x239b05['length'];_0x2e3684++){switch(_0x239b05[_0x2e3684][_0xd155('0x26')]){case _0xd155('0x21'):_0x1ba4cd[_0xd155('0x21')]=_0x575020[_0x239b05[_0x2e3684]['param']][_0xd155('0x25')]('/')[0x1];_0x1ba4cd[_0xd155('0x27')]=_0x575020[_0x239b05[_0x2e3684][_0xd155('0x28')]]['split']('/')[0x2];_0x1ba4cd[_0xd155('0x29')]=_0x1ba4cd[_0xd155('0x27')]?_0x1ba4cd[_0xd155('0x27')][_0xd155('0x25')]('$')[0x0]:undefined;_0x1ba4cd[_0xd155('0x27')]=_0xf7c81b[_0xd155('0x14')]?(_0x1ba4cd[_0xd155('0x29')]||'')+'${EXTEN:'+_0xf7c81b[_0xd155('0x14')]+'}':(_0x1ba4cd[_0xd155('0x29')]||'')+_0xd155('0x16');_0xcb6bfc[_0x239b05[_0x2e3684][_0xd155('0x28')]]=['SIP',_0x1ba4cd[_0xd155('0x21')],_0x1ba4cd[_0xd155('0x27')]][_0xd155('0x2a')]('/');break;case'options':_0x1ba4cd['options']=_0x575020[_0x239b05[_0x2e3684][_0xd155('0x28')]];if(_0xf7c81b['recordingFormat']!==_0xd155('0x2b')){if(_0x1ba4cd[_0xd155('0x23')][_0xd155('0x2c')](_0xd155('0x2d'))<0x0){_0x1ba4cd[_0xd155('0x23')]+=_0xd155('0x2d');}}else{_0x1ba4cd[_0xd155('0x23')]=_0x1ba4cd[_0xd155('0x23')][_0xd155('0x2e')](_0xd155('0x2d'),'');}_0xcb6bfc[_0x239b05[_0x2e3684][_0xd155('0x28')]]=_0x1ba4cd['options'];break;default:_0xcb6bfc[_0x239b05[_0x2e3684][_0xd155('0x28')]]=_0x575020[_0x239b05[_0x2e3684][_0xd155('0x28')]];}}return _0xcb6bfc[_0xd155('0x2a')](',');}function _0x179d80(_0x219b57,_0xfc2b15,_0x306511){return new Promise(function(_0x195b92,_0x4076d8){var _0xab6f77=[];if(_[_0xd155('0x2f')](_0xfc2b15))return _0x195b92(_0xab6f77);_0x50eeee['Interval']['findAll']({'attributes':['id','interval','IntervalId'],'raw':!![]})[_0xd155('0x30')](function(_0x22a9cb){for(var _0x5d3436=0x0,_0x7f1da=0x0;_0x5d3436<_0xfc2b15[_0xd155('0x31')];_0x5d3436++,_0x7f1da=0x0){var _0x1258b6=_0xfc2b15[_0x5d3436];var _0x4d8061=[];var _0x3d5a10=[];delete _0x1258b6['id'];if(_0x1258b6[_0xd155('0x32')]!=='*,*,*,*'){_0x1258b6[_0xd155('0x33')]=[_0x1258b6[_0xd155('0x32')]];}else{_0x1258b6[_0xd155('0x33')]=_0x1258b6[_0xd155('0x34')]?_[_0xd155('0x35')](_[_0xd155('0x36')](_0x22a9cb,{'IntervalId':_0x1258b6[_0xd155('0x34')]}),_0xd155('0x32')):[];}_0x1258b6[_0xd155('0x7')]=_0x219b57['context'];_0x1258b6[_0xd155('0x8')]=_0x219b57[_0xd155('0x8')];if(_0x1258b6[_0xd155('0x6')])_0x1258b6[_0xd155('0x6')]=_0x1258b6[_0xd155('0x6')]['toLowerCase']();if(_0x219b57[_0xd155('0x6')]===_0xd155('0x10')){if(_0x1258b6[_0xd155('0x1c')](_0xd155('0x37'))&&_0x1258b6[_0xd155('0x37')]&&_0x1258b6[_0xd155('0x37')]!=='--'){_0x4d8061['push']({'type':_0x1258b6[_0xd155('0x6')]['toLowerCase'](),'app':_0xd155('0x4'),'appdata':_0xd155('0x38')+_0x1258b6[_0xd155('0x37')],'context':_0x219b57[_0xd155('0x7')],'exten':_0x219b57[_0xd155('0x8')],'priority':_0x1258b6[_0xd155('0x33')]['length']+_0x306511+_0x7f1da++,'VoiceExtensionId':_0x219b57['id']});}_0x4d8061['push']({'type':_0x1258b6[_0xd155('0x6')][_0xd155('0x39')](),'app':'ExecIf','appdata':_0xd155('0x3a')+(_0x1258b6['callerID']?'Set(CALLERID(all)='+_0x1258b6['callerID']+')':_0xd155('0x3b')),'context':_0x219b57[_0xd155('0x7')],'exten':_0x219b57[_0xd155('0x8')],'priority':_0x1258b6[_0xd155('0x33')][_0xd155('0x31')]+_0x306511+_0x7f1da++,'VoiceExtensionId':_0x219b57['id']});}else{if(_0x1258b6[_0xd155('0x1c')](_0xd155('0x3c'))){if([_0xd155('0x3d'),_0xd155('0x3e')]['includes'](_0x1258b6[_0xd155('0x3f')]['toLowerCase']())&&_0x1258b6[_0xd155('0x40')]!==_0xd155('0x41')){if(_0x1258b6[_0xd155('0x3c')]){_0x4d8061[_0xd155('0xc')]({'type':_0x1258b6[_0xd155('0x6')]['toLowerCase'](),'app':_0xd155('0x42'),'appdata':_0xd155('0x43'),'context':_0x219b57[_0xd155('0x7')],'exten':_0x219b57[_0xd155('0x8')],'priority':_0x1258b6[_0xd155('0x33')][_0xd155('0x31')]+_0x306511+_0x7f1da++,'VoiceExtensionId':_0x219b57['id']});_0x4d8061[_0xd155('0xc')]({'type':_0x1258b6['type'][_0xd155('0x39')](),'app':_0xd155('0x4'),'appdata':_0xd155('0x44'),'context':_0x219b57[_0xd155('0x7')],'exten':_0x219b57[_0xd155('0x8')],'priority':_0x1258b6[_0xd155('0x33')][_0xd155('0x31')]+_0x306511+_0x7f1da++,'VoiceExtensionId':_0x219b57['id']});}else{_0x4d8061['push']({'type':_0x1258b6[_0xd155('0x6')][_0xd155('0x39')](),'app':'ExecIf','appdata':_0xd155('0x45'),'context':_0x219b57['context'],'exten':_0x219b57['exten'],'priority':_0x1258b6[_0xd155('0x33')][_0xd155('0x31')]+_0x306511+_0x7f1da++,'VoiceExtensionId':_0x219b57['id']});_0x4d8061[_0xd155('0xc')]({'type':_0x1258b6[_0xd155('0x6')][_0xd155('0x39')](),'app':_0xd155('0x4'),'appdata':_0xd155('0x46'),'context':_0x219b57[_0xd155('0x7')],'exten':_0x219b57[_0xd155('0x8')],'priority':_0x1258b6[_0xd155('0x33')][_0xd155('0x31')]+_0x306511+_0x7f1da++,'VoiceExtensionId':_0x219b57['id']});}}}}for(var _0x1a2fc8=0x0;_0x1a2fc8<_0x1258b6['intervals']['length'];_0x1a2fc8++){var _0x12ee24=_0x306511+_0x1258b6[_0xd155('0x33')][_0xd155('0x31')];var _0x21275a=_0x1a2fc8===_0x1258b6[_0xd155('0x33')][_0xd155('0x31')]-0x1?_0x306511+_0x4d8061[_0xd155('0x31')]+_0x3d5a10[_0xd155('0x31')]+0x2:_0x306511+_0x1a2fc8+0x1;_0x4d8061['splice'](_0x1a2fc8,0x0,{'type':_0x219b57[_0xd155('0x6')],'app':_0xd155('0x47'),'appdata':_0x1258b6[_0xd155('0x33')][_0x1a2fc8]+'?'+_0x219b57[_0xd155('0x7')]+_0xd155('0x48')+_0x12ee24+':'+_0x219b57['context']+',${EXTEN},'+_0x21275a,'exten':_0x219b57[_0xd155('0x8')],'context':_0x219b57['context'],'priority':_0x306511+_0x1a2fc8,'VoiceExtensionId':_0x219b57['id']});}if(_0x1258b6['appType']===_0xd155('0x49')){_0x1258b6['appdata']=_0x23db64(_0x219b57,_0x1258b6['appdata']);}if(_0x1258b6[_0xd155('0x40')]===_0xd155('0x4a')){_0x4d8061[_0xd155('0xc')]({'type':_0x1258b6[_0xd155('0x6')][_0xd155('0x39')](),'app':'Set','appdata':_0xd155('0x4b'),'context':_0x219b57[_0xd155('0x7')],'exten':_0x219b57[_0xd155('0x8')],'priority':_0x1258b6['intervals'][_0xd155('0x31')]+_0x306511+_0x7f1da++,'VoiceExtensionId':_0x219b57['id']});}_0x1258b6['priority']=_0x4d8061[_0xd155('0x31')]?_[_0xd155('0x4c')](_0x4d8061)[_0xd155('0x4d')]+0x1:_0x306511;_0xab6f77=_[_0xd155('0x4e')](_0xab6f77,_0x4d8061,[_0x1258b6],_0x3d5a10);_0x306511=_[_0xd155('0x4c')](_0xab6f77)['priority']+0x1;}return _0x195b92(_0xab6f77);})['catch'](function(_0x474214){_0x4076d8(_0x474214);});});}return _0x157d11['define'](_0xd155('0x4f'),attributes,{'tableName':_0xd155('0x50'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x5b7e1a){var _0x208e52=this['get']({'plain':!![]});var _0x19e2e4=_0x208e52['type']===_0xd155('0x10')?_0x111445(_0x208e52):_0x3ec1be(_0x208e52);return _0x179d80(_0x208e52,_0x5b7e1a,_['last'](_0x19e2e4)[_0xd155('0x4d')]+0x1)[_0xd155('0x30')](function(_0x9fcf0e){var _0x3521d6=_['concat'](_0x19e2e4,_0x9fcf0e);_0x3521d6[_0xd155('0xc')]({'type':_0x208e52[_0xd155('0x6')],'app':_0xd155('0x51'),'exten':_0x208e52[_0xd155('0x8')],'context':_0x208e52[_0xd155('0x7')],'priority':_[_0xd155('0x4c')](_0x3521d6)[_0xd155('0x4d')]+0x1,'VoiceExtensionId':_0x208e52['id']});return _0x3521d6;});}}});}; \ No newline at end of file +var _0x43bf=['wav','trunk','options','split','length','param','phone','prefix','SIP','indexOf','U(xcally-mixmonitor-context)','findAll','interval','intervals','IntervalId','map','toLowerCase','tag','CDR(tag)=','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','hasOwnProperty','answer','queue','playback','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','outboundDial','appdata','agi','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','priority','last','catch','define','then','concat','Hangup','./voiceExtension.attributes','exports','models','Set','CDR(type)=','context','exten','type','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','CDR(type)=outbound','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT='];(function(_0x5b1a2f,_0x4208c8){var _0x13ca37=function(_0x4381b7){while(--_0x4381b7){_0x5b1a2f['push'](_0x5b1a2f['shift']());}};_0x13ca37(++_0x4208c8);}(_0x43bf,0x81));var _0xf43b=function(_0x30a1b6,_0x158e1e){_0x30a1b6=_0x30a1b6-0x0;var _0x304819=_0x43bf[_0x30a1b6];return _0x304819;};'use strict';var _=require('lodash');var attributes=require(_0xf43b('0x0'));module[_0xf43b('0x1')]=function(_0x3f8ced){var _0x48cdd5=_0x3f8ced[_0xf43b('0x2')];function _0x4f6ab5(_0x58101d){var _0x3d8b3a=0x2;var _0x478873=[{'type':_0x58101d['type'],'app':_0xf43b('0x3'),'appdata':_0xf43b('0x4')+_0x58101d['type'],'context':_0x58101d[_0xf43b('0x5')],'exten':_0x58101d[_0xf43b('0x6')],'priority':_0x3d8b3a++,'VoiceExtensionId':_0x58101d['id']},{'type':_0x58101d[_0xf43b('0x7')],'app':_0x58101d[_0xf43b('0x8')]?'Set':_0xf43b('0x9'),'appdata':_0x58101d[_0xf43b('0x8')]?_0xf43b('0xa')+_0x58101d[_0xf43b('0x8')]:_0xf43b('0xb'),'context':_0x58101d[_0xf43b('0x5')],'exten':_0x58101d[_0xf43b('0x6')],'priority':_0x3d8b3a++,'VoiceExtensionId':_0x58101d['id']}];if(_0x58101d[_0xf43b('0x7')]===_0xf43b('0xc')){_0x478873[_0xf43b('0xd')]({'type':'inbound','app':_0xf43b('0x3'),'appdata':_0xf43b('0xe')+_0x58101d['id'],'context':_0x58101d[_0xf43b('0x5')],'exten':_0x58101d[_0xf43b('0x6')],'priority':_0x3d8b3a++,'VoiceExtensionId':_0x58101d['id']});}_0x478873['push']({'type':_0x58101d['type'],'app':_0xf43b('0x3'),'appdata':_0xf43b('0xf'),'context':_0x58101d[_0xf43b('0x5')],'exten':_0x58101d[_0xf43b('0x6')],'priority':_0x3d8b3a++,'VoiceExtensionId':_0x58101d['id']},{'type':_0x58101d[_0xf43b('0x7')],'app':'Set','appdata':_0xf43b('0x10'),'context':_0x58101d[_0xf43b('0x5')],'exten':_0x58101d[_0xf43b('0x6')],'priority':_0x3d8b3a++,'VoiceExtensionId':_0x58101d['id']},{'type':_0x58101d['type'],'app':_0xf43b('0x3'),'appdata':_0xf43b('0x11'),'context':_0x58101d[_0xf43b('0x5')],'exten':_0x58101d[_0xf43b('0x6')],'priority':_0x3d8b3a++,'VoiceExtensionId':_0x58101d['id']});return _0x478873;}function _0x361983(_0x533c62){var _0x583376=0x2;var _0x5bce5e=[{'type':'outbound','app':_0xf43b('0x3'),'appdata':_0xf43b('0x12'),'context':_0x533c62['context'],'exten':_0x533c62[_0xf43b('0x6')],'priority':_0x583376++,'VoiceExtensionId':_0x533c62['id']},{'type':_0xf43b('0x13'),'app':_0x533c62[_0xf43b('0x8')]?_0xf43b('0x3'):_0xf43b('0x9'),'appdata':_0x533c62[_0xf43b('0x8')]?'CDR(routeAlias)='+_0x533c62[_0xf43b('0x8')]:_0xf43b('0xb'),'context':_0x533c62['context'],'exten':_0x533c62[_0xf43b('0x6')],'priority':_0x583376++,'VoiceExtensionId':_0x533c62['id']},{'type':'outbound','app':'Set','appdata':_0xf43b('0x14')+(_0x533c62[_0xf43b('0x15')]?_0xf43b('0x16')+_0x533c62[_0xf43b('0x15')]+'}':_0xf43b('0x17')),'context':_0x533c62[_0xf43b('0x5')],'exten':_0x533c62['exten'],'priority':_0x583376++,'VoiceExtensionId':_0x533c62['id']},{'type':_0xf43b('0x13'),'app':'Set','appdata':_0xf43b('0xe')+_0x533c62['id'],'context':_0x533c62[_0xf43b('0x5')],'exten':_0x533c62[_0xf43b('0x6')],'priority':_0x583376++,'VoiceExtensionId':_0x533c62['id']},{'type':'outbound','app':'ExecIf','appdata':_0xf43b('0x18')+(_0x583376+0x2)+'):Goto('+(_0x583376+0x1)+')','context':_0x533c62[_0xf43b('0x5')],'exten':_0x533c62[_0xf43b('0x6')],'priority':_0x583376++,'VoiceExtensionId':_0x533c62['id']},{'type':_0xf43b('0x13'),'app':'Set','appdata':_0x533c62[_0xf43b('0x15')]?_0xf43b('0x19')+_0x533c62['cutdigits']+'}':_0xf43b('0x1a'),'context':_0x533c62[_0xf43b('0x5')],'exten':_0x533c62[_0xf43b('0x6')],'priority':_0x583376++,'VoiceExtensionId':_0x533c62['id']},{'type':_0xf43b('0x13'),'app':_0xf43b('0x3'),'appdata':_0xf43b('0xf'),'context':_0x533c62['context'],'exten':_0x533c62['exten'],'priority':_0x583376++,'VoiceExtensionId':_0x533c62['id']},{'type':'outbound','app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x533c62['context'],'exten':_0x533c62['exten'],'priority':_0x583376++,'VoiceExtensionId':_0x533c62['id']},{'type':_0xf43b('0x13'),'app':'Set','appdata':_0xf43b('0x11'),'context':_0x533c62['context'],'exten':_0x533c62['exten'],'priority':_0x583376++,'VoiceExtensionId':_0x533c62['id']},{'type':_0xf43b('0x13'),'app':_0xf43b('0x3'),'appdata':_0xf43b('0x1b')+_0x533c62['id'],'context':_0x533c62['context'],'exten':_0x533c62[_0xf43b('0x6')],'priority':_0x583376++,'VoiceExtensionId':_0x533c62['id']}];if(_0x533c62['hasOwnProperty']('recordingFormat')&&_0x533c62[_0xf43b('0x1c')]!==_0xf43b('0x1d')){_0x5bce5e['push']({'type':_0xf43b('0x13'),'app':_0xf43b('0x3'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x533c62[_0xf43b('0x5')],'exten':_0x533c62[_0xf43b('0x6')],'priority':_0x583376++,'VoiceExtensionId':_0x533c62['id']},{'type':_0xf43b('0x13'),'app':_0xf43b('0x3'),'appdata':_0xf43b('0x1e')+_0x533c62[_0xf43b('0x1c')]||_0xf43b('0x1f'),'context':_0x533c62[_0xf43b('0x5')],'exten':_0x533c62[_0xf43b('0x6')],'priority':_0x583376++,'VoiceExtensionId':_0x533c62['id']});}return _0x5bce5e;}function _0x5059f1(_0x55d940,_0x360522){var _0x6da334=[{'name':_0xf43b('0x20'),'param':0x0},{'name':'timeout','param':0x1},{'name':_0xf43b('0x21'),'param':0x2},{'name':'url','param':0x3}];var _0x4d5ac0={};var _0x3d8bcc=_0x360522[_0xf43b('0x22')](',');var _0x4ed363=[];for(var _0x1fd213=0x0;_0x1fd213<_0x6da334[_0xf43b('0x23')];_0x1fd213++){switch(_0x6da334[_0x1fd213]['name']){case _0xf43b('0x20'):_0x4d5ac0['trunk']=_0x3d8bcc[_0x6da334[_0x1fd213][_0xf43b('0x24')]][_0xf43b('0x22')]('/')[0x1];_0x4d5ac0[_0xf43b('0x25')]=_0x3d8bcc[_0x6da334[_0x1fd213]['param']][_0xf43b('0x22')]('/')[0x2];_0x4d5ac0[_0xf43b('0x26')]=_0x4d5ac0['phone']?_0x4d5ac0[_0xf43b('0x25')][_0xf43b('0x22')]('$')[0x0]:undefined;_0x4d5ac0[_0xf43b('0x25')]=_0x55d940[_0xf43b('0x15')]?(_0x4d5ac0[_0xf43b('0x26')]||'')+_0xf43b('0x16')+_0x55d940[_0xf43b('0x15')]+'}':(_0x4d5ac0['prefix']||'')+_0xf43b('0x17');_0x4ed363[_0x6da334[_0x1fd213]['param']]=[_0xf43b('0x27'),_0x4d5ac0[_0xf43b('0x20')],_0x4d5ac0[_0xf43b('0x25')]]['join']('/');break;case _0xf43b('0x21'):_0x4d5ac0[_0xf43b('0x21')]=_0x3d8bcc[_0x6da334[_0x1fd213][_0xf43b('0x24')]];if(_0x55d940[_0xf43b('0x1c')]!==_0xf43b('0x1d')){if(_0x4d5ac0[_0xf43b('0x21')][_0xf43b('0x28')](_0xf43b('0x29'))<0x0){_0x4d5ac0[_0xf43b('0x21')]+='U(xcally-mixmonitor-context)';}}else{_0x4d5ac0[_0xf43b('0x21')]=_0x4d5ac0[_0xf43b('0x21')]['replace'](_0xf43b('0x29'),'');}_0x4ed363[_0x6da334[_0x1fd213][_0xf43b('0x24')]]=_0x4d5ac0[_0xf43b('0x21')];break;default:_0x4ed363[_0x6da334[_0x1fd213]['param']]=_0x3d8bcc[_0x6da334[_0x1fd213]['param']];}}return _0x4ed363['join'](',');}function _0x35f7ec(_0xce7b29,_0x1f2174,_0x2cac3d){return new Promise(function(_0xfeed83,_0x22b808){var _0x3ac69f=[];if(_['isEmpty'](_0x1f2174))return _0xfeed83(_0x3ac69f);_0x48cdd5['Interval'][_0xf43b('0x2a')]({'attributes':['id',_0xf43b('0x2b'),'IntervalId'],'raw':!![]})['then'](function(_0x14987b){for(var _0x505e45=0x0,_0x6e947c=0x0;_0x505e45<_0x1f2174[_0xf43b('0x23')];_0x505e45++,_0x6e947c=0x0){var _0x3c18d5=_0x1f2174[_0x505e45];var _0x56138a=[];var _0x46700c=[];delete _0x3c18d5['id'];if(_0x3c18d5[_0xf43b('0x2b')]!=='*,*,*,*'){_0x3c18d5[_0xf43b('0x2c')]=[_0x3c18d5[_0xf43b('0x2b')]];}else{_0x3c18d5[_0xf43b('0x2c')]=_0x3c18d5[_0xf43b('0x2d')]?_[_0xf43b('0x2e')](_['filter'](_0x14987b,{'IntervalId':_0x3c18d5[_0xf43b('0x2d')]}),_0xf43b('0x2b')):[];}_0x3c18d5[_0xf43b('0x5')]=_0xce7b29[_0xf43b('0x5')];_0x3c18d5[_0xf43b('0x6')]=_0xce7b29['exten'];if(_0x3c18d5[_0xf43b('0x7')])_0x3c18d5['type']=_0x3c18d5[_0xf43b('0x7')][_0xf43b('0x2f')]();if(_0xce7b29['type']===_0xf43b('0x13')){if(_0x3c18d5['hasOwnProperty'](_0xf43b('0x30'))&&_0x3c18d5[_0xf43b('0x30')]&&_0x3c18d5[_0xf43b('0x30')]!=='--'){_0x56138a[_0xf43b('0xd')]({'type':_0x3c18d5[_0xf43b('0x7')][_0xf43b('0x2f')](),'app':'Set','appdata':_0xf43b('0x31')+_0x3c18d5[_0xf43b('0x30')],'context':_0xce7b29['context'],'exten':_0xce7b29['exten'],'priority':_0x3c18d5[_0xf43b('0x2c')][_0xf43b('0x23')]+_0x2cac3d+_0x6e947c++,'VoiceExtensionId':_0xce7b29['id']});}_0x56138a[_0xf43b('0xd')]({'type':_0x3c18d5[_0xf43b('0x7')][_0xf43b('0x2f')](),'app':_0xf43b('0x32'),'appdata':_0xf43b('0x33')+(_0x3c18d5[_0xf43b('0x34')]?_0xf43b('0x35')+_0x3c18d5[_0xf43b('0x34')]+')':_0xf43b('0x36')),'context':_0xce7b29[_0xf43b('0x5')],'exten':_0xce7b29[_0xf43b('0x6')],'priority':_0x3c18d5[_0xf43b('0x2c')][_0xf43b('0x23')]+_0x2cac3d+_0x6e947c++,'VoiceExtensionId':_0xce7b29['id']});}else{if(_0x3c18d5[_0xf43b('0x37')](_0xf43b('0x38'))){if([_0xf43b('0x39'),_0xf43b('0x3a')][_0xf43b('0x3b')](_0x3c18d5[_0xf43b('0x3c')]['toLowerCase']())&&_0x3c18d5[_0xf43b('0x3d')]!==_0xf43b('0x3e')){if(_0x3c18d5[_0xf43b('0x38')]){_0x56138a[_0xf43b('0xd')]({'type':_0x3c18d5[_0xf43b('0x7')][_0xf43b('0x2f')](),'app':_0xf43b('0x32'),'appdata':_0xf43b('0x3f'),'context':_0xce7b29['context'],'exten':_0xce7b29['exten'],'priority':_0x3c18d5[_0xf43b('0x2c')]['length']+_0x2cac3d+_0x6e947c++,'VoiceExtensionId':_0xce7b29['id']});_0x56138a[_0xf43b('0xd')]({'type':_0x3c18d5[_0xf43b('0x7')][_0xf43b('0x2f')](),'app':'Set','appdata':_0xf43b('0x40'),'context':_0xce7b29[_0xf43b('0x5')],'exten':_0xce7b29['exten'],'priority':_0x3c18d5['intervals'][_0xf43b('0x23')]+_0x2cac3d+_0x6e947c++,'VoiceExtensionId':_0xce7b29['id']});}else{_0x56138a[_0xf43b('0xd')]({'type':_0x3c18d5[_0xf43b('0x7')][_0xf43b('0x2f')](),'app':_0xf43b('0x32'),'appdata':_0xf43b('0x41'),'context':_0xce7b29[_0xf43b('0x5')],'exten':_0xce7b29[_0xf43b('0x6')],'priority':_0x3c18d5[_0xf43b('0x2c')][_0xf43b('0x23')]+_0x2cac3d+_0x6e947c++,'VoiceExtensionId':_0xce7b29['id']});_0x56138a['push']({'type':_0x3c18d5[_0xf43b('0x7')][_0xf43b('0x2f')](),'app':_0xf43b('0x3'),'appdata':_0xf43b('0x42'),'context':_0xce7b29[_0xf43b('0x5')],'exten':_0xce7b29[_0xf43b('0x6')],'priority':_0x3c18d5[_0xf43b('0x2c')]['length']+_0x2cac3d+_0x6e947c++,'VoiceExtensionId':_0xce7b29['id']});}}}}for(var _0x1be43f=0x0;_0x1be43f<_0x3c18d5[_0xf43b('0x2c')][_0xf43b('0x23')];_0x1be43f++){var _0x248f73=_0x2cac3d+_0x3c18d5[_0xf43b('0x2c')]['length'];var _0x165fd4=_0x1be43f===_0x3c18d5['intervals'][_0xf43b('0x23')]-0x1?_0x2cac3d+_0x56138a[_0xf43b('0x23')]+_0x46700c[_0xf43b('0x23')]+0x2:_0x2cac3d+_0x1be43f+0x1;_0x56138a['splice'](_0x1be43f,0x0,{'type':_0xce7b29[_0xf43b('0x7')],'app':_0xf43b('0x43'),'appdata':_0x3c18d5[_0xf43b('0x2c')][_0x1be43f]+'?'+_0xce7b29[_0xf43b('0x5')]+_0xf43b('0x44')+_0x248f73+':'+_0xce7b29[_0xf43b('0x5')]+',${EXTEN},'+_0x165fd4,'exten':_0xce7b29['exten'],'context':_0xce7b29[_0xf43b('0x5')],'priority':_0x2cac3d+_0x1be43f,'VoiceExtensionId':_0xce7b29['id']});}if(_0x3c18d5[_0xf43b('0x3d')]===_0xf43b('0x45')){_0x3c18d5[_0xf43b('0x46')]=_0x5059f1(_0xce7b29,_0x3c18d5[_0xf43b('0x46')]);}if(_0x3c18d5['appType']===_0xf43b('0x47')){_0x56138a[_0xf43b('0xd')]({'type':_0x3c18d5[_0xf43b('0x7')][_0xf43b('0x2f')](),'app':'Set','appdata':_0xf43b('0x48'),'context':_0xce7b29[_0xf43b('0x5')],'exten':_0xce7b29['exten'],'priority':_0x3c18d5[_0xf43b('0x2c')][_0xf43b('0x23')]+_0x2cac3d+_0x6e947c++,'VoiceExtensionId':_0xce7b29['id']});}_0x3c18d5['priority']=_0x56138a['length']?_['last'](_0x56138a)[_0xf43b('0x49')]+0x1:_0x2cac3d;_0x3ac69f=_['concat'](_0x3ac69f,_0x56138a,[_0x3c18d5],_0x46700c);_0x2cac3d=_[_0xf43b('0x4a')](_0x3ac69f)[_0xf43b('0x49')]+0x1;}return _0xfeed83(_0x3ac69f);})[_0xf43b('0x4b')](function(_0x411af7){_0x22b808(_0x411af7);});});}return _0x3f8ced[_0xf43b('0x4c')]('VoiceExtension',attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x36e97d){var _0x77bca0=this['get']({'plain':!![]});var _0x53cdeb=_0x77bca0['type']===_0xf43b('0x13')?_0x361983(_0x77bca0):_0x4f6ab5(_0x77bca0);return _0x35f7ec(_0x77bca0,_0x36e97d,_[_0xf43b('0x4a')](_0x53cdeb)['priority']+0x1)[_0xf43b('0x4d')](function(_0x392dd9){var _0x549778=_[_0xf43b('0x4e')](_0x53cdeb,_0x392dd9);_0x549778[_0xf43b('0xd')]({'type':_0x77bca0['type'],'app':_0xf43b('0x4f'),'exten':_0x77bca0[_0xf43b('0x6')],'context':_0x77bca0[_0xf43b('0x5')],'priority':_[_0xf43b('0x4a')](_0x549778)['priority']+0x1,'VoiceExtensionId':_0x77bca0['id']});return _0x549778;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index a794a5c..6adab6e 100644 --- a/server/api/voiceExtension/voiceExtension.rpc.js +++ b/server/api/voiceExtension/voiceExtension.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdedd=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','localhost','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','where','attributes','limit','include','model','stringify'];(function(_0x3420f5,_0x42e6dc){var _0x3abba7=function(_0x2f9a34){while(--_0x2f9a34){_0x3420f5['push'](_0x3420f5['shift']());}};_0x3abba7(++_0x42e6dc);}(_0xdedd,0x197));var _0xdded=function(_0x1acf7f,_0x4d5169){_0x1acf7f=_0x1acf7f-0x0;var _0x462baf=_0xdedd[_0x1acf7f];return _0x462baf;};'use strict';var _=require(_0xdded('0x0'));var util=require(_0xdded('0x1'));var moment=require(_0xdded('0x2'));var BPromise=require(_0xdded('0x3'));var rs=require(_0xdded('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdded('0x5'))['db'];var utils=require(_0xdded('0x6'));var logger=require(_0xdded('0x7'))(_0xdded('0x8'));var config=require(_0xdded('0x9'));var jayson=require(_0xdded('0xa'));var client=jayson[_0xdded('0xb')][_0xdded('0xc')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xdded('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xdded('0xe'))[_0xdded('0xf')](socket);function respondWithRpcPromise(_0x30db97,_0xc7fb6a,_0x4e53bb){return new BPromise(function(_0x91b36d,_0x4f3d66){return client[_0xdded('0x10')](_0x30db97,_0x4e53bb)[_0xdded('0x11')](function(_0x363291){logger[_0xdded('0x12')](_0xdded('0x13'),_0xc7fb6a,_0xdded('0x14'));logger[_0xdded('0x15')](_0xdded('0x16'),_0xc7fb6a,_0xdded('0x14'),JSON['stringify'](_0x363291));if(_0x363291[_0xdded('0x17')]){if(_0x363291[_0xdded('0x17')]['code']===0x1f4){logger[_0xdded('0x17')]('VoiceExtension,\x20%s,\x20%s',_0xc7fb6a,_0x363291[_0xdded('0x17')]['message']);return _0x4f3d66(_0x363291[_0xdded('0x17')][_0xdded('0x18')]);}logger[_0xdded('0x17')]('VoiceExtension,\x20%s,\x20%s',_0xc7fb6a,_0x363291[_0xdded('0x17')][_0xdded('0x18')]);return _0x91b36d(_0x363291[_0xdded('0x17')][_0xdded('0x18')]);}else{logger[_0xdded('0x12')](_0xdded('0x13'),_0xc7fb6a,_0xdded('0x14'));_0x91b36d(_0x363291[_0xdded('0x19')]['message']);}})[_0xdded('0x1a')](function(_0x1ff810){logger[_0xdded('0x17')](_0xdded('0x13'),_0xc7fb6a,_0x1ff810);_0x4f3d66(_0x1ff810);});});}exports[_0xdded('0x1b')]=function(_0x29eb80){var _0x43f005=this;return new Promise(function(_0x457ee4,_0x415b38){return db[_0xdded('0x1c')][_0xdded('0x1d')]({'raw':_0x29eb80[_0xdded('0x1e')]?_0x29eb80[_0xdded('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x29eb80[_0xdded('0x1e')]?_0x29eb80[_0xdded('0x1e')][_0xdded('0x1f')]||null:null,'attributes':_0x29eb80[_0xdded('0x1e')]?_0x29eb80['options'][_0xdded('0x20')]||null:null,'limit':_0x29eb80['options']?_0x29eb80[_0xdded('0x1e')][_0xdded('0x21')]||null:null,'include':_0x29eb80[_0xdded('0x1e')]?_0x29eb80[_0xdded('0x1e')][_0xdded('0x22')]?_['map'](_0x29eb80[_0xdded('0x1e')][_0xdded('0x22')],function(_0x2b66b3){return{'model':db[_0x2b66b3[_0xdded('0x23')]],'as':_0x2b66b3['as'],'attributes':_0x2b66b3[_0xdded('0x20')],'include':_0x2b66b3['include']?_['map'](_0x2b66b3[_0xdded('0x22')],function(_0x88b9f1){return{'model':db[_0x88b9f1[_0xdded('0x23')]],'as':_0x88b9f1['as'],'attributes':_0x88b9f1[_0xdded('0x20')],'include':_0x88b9f1[_0xdded('0x22')]?_['map'](_0x88b9f1[_0xdded('0x22')],function(_0x10c128){return{'model':db[_0x10c128[_0xdded('0x23')]],'as':_0x10c128['as'],'attributes':_0x10c128[_0xdded('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x415158){logger['info'](_0xdded('0x1b'),_0x29eb80);logger[_0xdded('0x15')](_0xdded('0x1b'),_0x29eb80,JSON[_0xdded('0x24')](_0x415158));_0x457ee4(_0x415158);})[_0xdded('0x1a')](function(_0x3459c7){logger[_0xdded('0x17')]('GetVoiceExtension',_0x3459c7[_0xdded('0x18')],_0x29eb80);_0x415b38(_0x43f005[_0xdded('0x17')](0x1f4,_0x3459c7['message']));});});}; \ No newline at end of file +var _0xbac8=['../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','VoiceExtension','findAll','options','where','attributes','limit','include','map','model','GetVoiceExtension','stringify','lodash','util','randomstring','ioredis'];(function(_0x4bc890,_0x5c7d29){var _0x446183=function(_0x41a28a){while(--_0x41a28a){_0x4bc890['push'](_0x4bc890['shift']());}};_0x446183(++_0x5c7d29);}(_0xbac8,0x140));var _0x8bac=function(_0x1c55c4,_0x2a38ec){_0x1c55c4=_0x1c55c4-0x0;var _0x2f47c2=_0xbac8[_0x1c55c4];return _0x2f47c2;};'use strict';var _=require(_0x8bac('0x0'));var util=require(_0x8bac('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8bac('0x2'));var fs=require('fs');var Redis=require(_0x8bac('0x3'));var db=require(_0x8bac('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8bac('0x5'))(_0x8bac('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8bac('0x7')][_0x8bac('0x8')]({'port':0x232a});config[_0x8bac('0x9')]=_[_0x8bac('0xa')](config[_0x8bac('0x9')],{'host':_0x8bac('0xb'),'port':0x18eb});var socket=require(_0x8bac('0xc'))(new Redis(config[_0x8bac('0x9')]));require(_0x8bac('0xd'))['register'](socket);function respondWithRpcPromise(_0x11596d,_0x39b869,_0x16ebdb){return new BPromise(function(_0x4d1a27,_0x31e977){return client['request'](_0x11596d,_0x16ebdb)[_0x8bac('0xe')](function(_0x4620a2){logger['info'](_0x8bac('0xf'),_0x39b869,_0x8bac('0x10'));logger[_0x8bac('0x11')](_0x8bac('0x12'),_0x39b869,_0x8bac('0x10'),JSON['stringify'](_0x4620a2));if(_0x4620a2['error']){if(_0x4620a2[_0x8bac('0x13')][_0x8bac('0x14')]===0x1f4){logger['error'](_0x8bac('0xf'),_0x39b869,_0x4620a2['error']['message']);return _0x31e977(_0x4620a2[_0x8bac('0x13')][_0x8bac('0x15')]);}logger[_0x8bac('0x13')](_0x8bac('0xf'),_0x39b869,_0x4620a2[_0x8bac('0x13')][_0x8bac('0x15')]);return _0x4d1a27(_0x4620a2['error']['message']);}else{logger[_0x8bac('0x16')]('VoiceExtension,\x20%s,\x20%s',_0x39b869,'request\x20sent');_0x4d1a27(_0x4620a2[_0x8bac('0x17')][_0x8bac('0x15')]);}})[_0x8bac('0x18')](function(_0x362ec8){logger[_0x8bac('0x13')](_0x8bac('0xf'),_0x39b869,_0x362ec8);_0x31e977(_0x362ec8);});});}exports['GetVoiceExtension']=function(_0x21c13){var _0x24dbea=this;return new Promise(function(_0x26c7b5,_0x193ac5){return db[_0x8bac('0x19')][_0x8bac('0x1a')]({'raw':_0x21c13[_0x8bac('0x1b')]?_0x21c13[_0x8bac('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x21c13[_0x8bac('0x1b')]?_0x21c13['options'][_0x8bac('0x1c')]||null:null,'attributes':_0x21c13[_0x8bac('0x1b')]?_0x21c13[_0x8bac('0x1b')][_0x8bac('0x1d')]||null:null,'limit':_0x21c13['options']?_0x21c13[_0x8bac('0x1b')][_0x8bac('0x1e')]||null:null,'include':_0x21c13[_0x8bac('0x1b')]?_0x21c13['options'][_0x8bac('0x1f')]?_[_0x8bac('0x20')](_0x21c13[_0x8bac('0x1b')]['include'],function(_0x5a5e64){return{'model':db[_0x5a5e64['model']],'as':_0x5a5e64['as'],'attributes':_0x5a5e64[_0x8bac('0x1d')],'include':_0x5a5e64[_0x8bac('0x1f')]?_[_0x8bac('0x20')](_0x5a5e64[_0x8bac('0x1f')],function(_0x3a002d){return{'model':db[_0x3a002d[_0x8bac('0x21')]],'as':_0x3a002d['as'],'attributes':_0x3a002d['attributes'],'include':_0x3a002d[_0x8bac('0x1f')]?_[_0x8bac('0x20')](_0x3a002d['include'],function(_0x3c9fd3){return{'model':db[_0x3c9fd3[_0x8bac('0x21')]],'as':_0x3c9fd3['as'],'attributes':_0x3c9fd3[_0x8bac('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xc94572){logger[_0x8bac('0x16')](_0x8bac('0x22'),_0x21c13);logger[_0x8bac('0x11')]('GetVoiceExtension',_0x21c13,JSON[_0x8bac('0x23')](_0xc94572));_0x26c7b5(_0xc94572);})[_0x8bac('0x18')](function(_0x5795d1){logger['error'](_0x8bac('0x22'),_0x5795d1['message'],_0x21c13);_0x193ac5(_0x24dbea['error'](0x1f4,_0x5795d1[_0x8bac('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 8d3a38f..5571ac9 100644 --- a/server/api/voiceExtension/voiceExtension.socket.js +++ b/server/api/voiceExtension/voiceExtension.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf494=['save','remove','emit','removeListener','register','voiceExtension:','./voiceExtension.events'];(function(_0x4d956a,_0x4d4dcc){var _0x2137b0=function(_0x39a05c){while(--_0x39a05c){_0x4d956a['push'](_0x4d956a['shift']());}};_0x2137b0(++_0x4d4dcc);}(_0xf494,0x1c6));var _0x4f49=function(_0x24aacf,_0x406a66){_0x24aacf=_0x24aacf-0x0;var _0x32cb33=_0xf494[_0x24aacf];return _0x32cb33;};'use strict';var VoiceExtensionEvents=require(_0x4f49('0x0'));var events=[_0x4f49('0x1'),_0x4f49('0x2'),'update'];function createListener(_0x3aeeb8,_0x1d54cc){return function(_0x423b25){_0x1d54cc[_0x4f49('0x3')](_0x3aeeb8,_0x423b25);};}function removeListener(_0x20c0d7,_0x2a15fb){return function(){VoiceExtensionEvents[_0x4f49('0x4')](_0x20c0d7,_0x2a15fb);};}exports[_0x4f49('0x5')]=function(_0xc5e778){for(var _0x413530=0x0,_0x42b0e8=events['length'];_0x413530<_0x42b0e8;_0x413530++){var _0x58e9a0=events[_0x413530];var _0x169c95=createListener(_0x4f49('0x6')+_0x58e9a0,_0xc5e778);VoiceExtensionEvents['on'](_0x58e9a0,_0x169c95);}}; \ No newline at end of file +var _0x5fc3=['./voiceExtension.events','save','update','emit','removeListener','register','voiceExtension:'];(function(_0x205c11,_0x941d3d){var _0x550e7b=function(_0x8b0263){while(--_0x8b0263){_0x205c11['push'](_0x205c11['shift']());}};_0x550e7b(++_0x941d3d);}(_0x5fc3,0xa8));var _0x35fc=function(_0x439d59,_0x11ccdf){_0x439d59=_0x439d59-0x0;var _0x3670c7=_0x5fc3[_0x439d59];return _0x3670c7;};'use strict';var VoiceExtensionEvents=require(_0x35fc('0x0'));var events=[_0x35fc('0x1'),'remove',_0x35fc('0x2')];function createListener(_0x2ac6da,_0x196bc2){return function(_0x91d024){_0x196bc2[_0x35fc('0x3')](_0x2ac6da,_0x91d024);};}function removeListener(_0x5e75e6,_0x2d1404){return function(){VoiceExtensionEvents[_0x35fc('0x4')](_0x5e75e6,_0x2d1404);};}exports[_0x35fc('0x5')]=function(_0x5b85ad){for(var _0x5754be=0x0,_0x19a0d1=events['length'];_0x5754be<_0x19a0d1;_0x5754be++){var _0x16e153=events[_0x5754be];var _0x27524f=createListener(_0x35fc('0x6')+_0x16e153,_0x5b85ad);VoiceExtensionEvents['on'](_0x16e153,_0x27524f);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 7a07f66..8d44c9f 100644 --- a/server/api/voiceMail/index.js +++ b/server/api/voiceMail/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1883=['index','/:id','/:id/messages','getMessages','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated'];(function(_0x3fe1ba,_0x1a33c5){var _0x5df1b4=function(_0x55d7c3){while(--_0x55d7c3){_0x3fe1ba['push'](_0x3fe1ba['shift']());}};_0x5df1b4(++_0x1a33c5);}(_0x1883,0xab));var _0x3188=function(_0x449842,_0x3d7507){_0x449842=_0x449842-0x0;var _0x99e21f=_0x1883[_0x449842];return _0x99e21f;};'use strict';var multer=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var path=require(_0x3188('0x2'));var timeout=require(_0x3188('0x3'));var express=require(_0x3188('0x4'));var router=express[_0x3188('0x5')]();var fs_extra=require(_0x3188('0x6'));var auth=require(_0x3188('0x7'));var interaction=require(_0x3188('0x8'));var config=require(_0x3188('0x9'));var controller=require(_0x3188('0xa'));router[_0x3188('0xb')]('/',auth[_0x3188('0xc')](),controller[_0x3188('0xd')]);router[_0x3188('0xb')](_0x3188('0xe'),auth[_0x3188('0xc')](),controller['show']);router[_0x3188('0xb')](_0x3188('0xf'),auth['isAuthenticated'](),controller[_0x3188('0x10')]);router['post']('/',auth[_0x3188('0xc')](),controller[_0x3188('0x11')]);router[_0x3188('0x12')](_0x3188('0xe'),auth['isAuthenticated'](),controller[_0x3188('0x13')]);router[_0x3188('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x3188('0x15')]);module[_0x3188('0x16')]=router; \ No newline at end of file +var _0x9582=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','/:id/messages','getMessages','put','update','delete'];(function(_0x460150,_0x232949){var _0x340677=function(_0x5b7e32){while(--_0x5b7e32){_0x460150['push'](_0x460150['shift']());}};_0x340677(++_0x232949);}(_0x9582,0x95));var _0x2958=function(_0x227aad,_0x34d127){_0x227aad=_0x227aad-0x0;var _0x34cb07=_0x9582[_0x227aad];return _0x34cb07;};'use strict';var multer=require(_0x2958('0x0'));var util=require(_0x2958('0x1'));var path=require(_0x2958('0x2'));var timeout=require(_0x2958('0x3'));var express=require(_0x2958('0x4'));var router=express[_0x2958('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2958('0x6'));var interaction=require(_0x2958('0x7'));var config=require(_0x2958('0x8'));var controller=require(_0x2958('0x9'));router[_0x2958('0xa')]('/',auth[_0x2958('0xb')](),controller[_0x2958('0xc')]);router[_0x2958('0xa')](_0x2958('0xd'),auth[_0x2958('0xb')](),controller['show']);router['get'](_0x2958('0xe'),auth['isAuthenticated'](),controller[_0x2958('0xf')]);router['post']('/',auth[_0x2958('0xb')](),controller['create']);router[_0x2958('0x10')](_0x2958('0xd'),auth[_0x2958('0xb')](),controller[_0x2958('0x11')]);router[_0x2958('0x12')]('/:id',auth[_0x2958('0xb')](),controller[_0x2958('0x13')]);module[_0x2958('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 9324cbf..429a06b 100644 --- a/server/api/voiceMail/voiceMail.attributes.js +++ b/server/api/voiceMail/voiceMail.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7328=['trim','central','ENUM','yes','TIMESTAMP','INTEGER','getDataValue','fullname','mailbox','sequelize','STRING','contest_mailbox','setDataValue','string'];(function(_0x60d4a3,_0x294479){var _0x346a35=function(_0x1ac840){while(--_0x1ac840){_0x60d4a3['push'](_0x60d4a3['shift']());}};_0x346a35(++_0x294479);}(_0x7328,0xe9));var _0x8732=function(_0x4957ea,_0x12d3c9){_0x4957ea=_0x4957ea-0x0;var _0x9f9354=_0x7328[_0x4957ea];return _0x9f9354;};'use strict';var Sequelize=require(_0x8732('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0x8732('0x1')]},'context':{'type':Sequelize[_0x8732('0x1')],'defaultValue':'from-voicemail','unique':_0x8732('0x2')},'mailbox':{'type':Sequelize[_0x8732('0x1')],'defaultValue':'','allowNull':![],'unique':_0x8732('0x2')},'password':{'type':Sequelize[_0x8732('0x1')]},'fullname':{'type':Sequelize[_0x8732('0x1')]},'email':{'type':Sequelize[_0x8732('0x1')],'validate':{'isEmail':!![]},'set':function(_0x2508b5){this[_0x8732('0x3')]('email',typeof _0x2508b5===_0x8732('0x4')&&_0x2508b5['trim']()?_0x2508b5[_0x8732('0x5')]():null);}},'pager':{'type':Sequelize[_0x8732('0x1')]},'tz':{'type':Sequelize[_0x8732('0x1')],'defaultValue':_0x8732('0x6')},'attach':{'type':Sequelize[_0x8732('0x7')](_0x8732('0x8'),'no'),'defaultValue':_0x8732('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0x8732('0x7')](_0x8732('0x8'),'no'),'defaultValue':_0x8732('0x8'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x8732('0x1')]},'review':{'type':Sequelize['ENUM'](_0x8732('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x8732('0x7')](_0x8732('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x8732('0x7')](_0x8732('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x8732('0x7')](_0x8732('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x8732('0x7')](_0x8732('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x8732('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x8732('0x7')](_0x8732('0x8'),'no'),'defaultValue':_0x8732('0x8'),'allowNull':![]},'forcename':{'type':Sequelize[_0x8732('0x7')](_0x8732('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x8732('0x7')](_0x8732('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x8732('0x7')](_0x8732('0x8'),'no'),'defaultValue':_0x8732('0x8'),'allowNull':![]},'stamp':{'type':_0x8732('0x9')},'emailsubject':{'type':Sequelize[_0x8732('0x1')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x8732('0xa')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x8732('0xb')](_0x8732('0xc'))+'\x20-\x20'+this[_0x8732('0xb')](_0x8732('0xd'));}}}; \ No newline at end of file +var _0x5857=['exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','TIMESTAMP','INTEGER','getDataValue','\x20-\x20'];(function(_0x404c8f,_0x367b1e){var _0x53dacb=function(_0x4dd368){while(--_0x4dd368){_0x404c8f['push'](_0x404c8f['shift']());}};_0x53dacb(++_0x367b1e);}(_0x5857,0xb4));var _0x7585=function(_0x2c9a37,_0x5f5778){_0x2c9a37=_0x2c9a37-0x0;var _0x14d667=_0x5857[_0x2c9a37];return _0x14d667;};'use strict';var Sequelize=require('sequelize');module[_0x7585('0x0')]={'customer_id':{'type':Sequelize[_0x7585('0x1')]},'context':{'type':Sequelize[_0x7585('0x1')],'defaultValue':_0x7585('0x2'),'unique':_0x7585('0x3')},'mailbox':{'type':Sequelize[_0x7585('0x1')],'defaultValue':'','allowNull':![],'unique':_0x7585('0x3')},'password':{'type':Sequelize[_0x7585('0x1')]},'fullname':{'type':Sequelize[_0x7585('0x1')]},'email':{'type':Sequelize[_0x7585('0x1')],'validate':{'isEmail':!![]},'set':function(_0x25150c){this[_0x7585('0x4')](_0x7585('0x5'),typeof _0x25150c===_0x7585('0x6')&&_0x25150c[_0x7585('0x7')]()?_0x25150c[_0x7585('0x7')]():null);}},'pager':{'type':Sequelize[_0x7585('0x1')]},'tz':{'type':Sequelize[_0x7585('0x1')],'defaultValue':_0x7585('0x8')},'attach':{'type':Sequelize[_0x7585('0x9')]('yes','no'),'defaultValue':_0x7585('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x7585('0x9')]('yes','no'),'defaultValue':_0x7585('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0x7585('0x1')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x7585('0x9')](_0x7585('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x7585('0x9')](_0x7585('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x7585('0x9')](_0x7585('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x7585('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x7585('0x9')](_0x7585('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x7585('0x9')]('yes','no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x7585('0x9')](_0x7585('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x7585('0x9')](_0x7585('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x7585('0x9')]('yes','no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x7585('0xb')},'emailsubject':{'type':Sequelize[_0x7585('0x1')]},'emailbody':{'type':Sequelize[_0x7585('0x1')]},'maxsecs':{'type':Sequelize[_0x7585('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x7585('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x7585('0xd')]('fullname')+_0x7585('0xe')+this[_0x7585('0xd')]('mailbox');}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index a05eb68..be29ac5 100644 --- a/server/api/voiceMail/voiceMail.controller.js +++ b/server/api/voiceMail/voiceMail.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1775=['hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','include','params','includeAll','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','findOne','rawAttributes','mailbox','options','VoiceMailMessage','findAndCountAll','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','Voicemails','UserProfileResource','name','send','index','VoiceMail','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length'];(function(_0x53af52,_0x56d628){var _0x589671=function(_0x4e2792){while(--_0x4e2792){_0x53af52['push'](_0x53af52['shift']());}};_0x589671(++_0x56d628);}(_0x1775,0x1db));var _0x5177=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x1775[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5177('0x0'));var zipdir=require(_0x5177('0x1'));var jsonpatch=require(_0x5177('0x2'));var rp=require(_0x5177('0x3'));var moment=require(_0x5177('0x4'));var BPromise=require(_0x5177('0x5'));var Mustache=require(_0x5177('0x6'));var util=require(_0x5177('0x7'));var path=require(_0x5177('0x8'));var sox=require(_0x5177('0x9'));var csv=require(_0x5177('0xa'));var ejs=require(_0x5177('0xb'));var fs=require('fs');var fs_extra=require(_0x5177('0xc'));var _=require(_0x5177('0xd'));var squel=require(_0x5177('0xe'));var crypto=require(_0x5177('0xf'));var jsforce=require(_0x5177('0x10'));var deskjs=require(_0x5177('0x11'));var toCsv=require(_0x5177('0xa'));var querystring=require(_0x5177('0x12'));var Papa=require(_0x5177('0x13'));var Redis=require(_0x5177('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5177('0x15'));var hardwareService=require(_0x5177('0x16'));var logger=require(_0x5177('0x17'))(_0x5177('0x18'));var utils=require(_0x5177('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x5177('0x1a'));var db=require(_0x5177('0x1b'))['db'];function respondWithStatusCode(_0xc613b9,_0x3c4ced){_0x3c4ced=_0x3c4ced||0xcc;return function(_0x111e99){if(_0x111e99){return _0xc613b9[_0x5177('0x1c')](_0x3c4ced);}return _0xc613b9[_0x5177('0x1d')](_0x3c4ced)[_0x5177('0x1e')]();};}function respondWithResult(_0x3e6224,_0x1eb9dd){_0x1eb9dd=_0x1eb9dd||0xc8;return function(_0x41bef4){if(_0x41bef4){return _0x3e6224[_0x5177('0x1d')](_0x1eb9dd)[_0x5177('0x1f')](_0x41bef4);}};}function respondWithFilteredResult(_0x31aff8,_0x1b32e6){return function(_0x175ca6){if(_0x175ca6){var _0x2ab5e5=typeof _0x1b32e6[_0x5177('0x20')]===_0x5177('0x21')&&typeof _0x1b32e6['limit']===_0x5177('0x21');var _0x41e687=_0x175ca6[_0x5177('0x22')];var _0x1b4102=_0x2ab5e5?0x0:_0x1b32e6['offset'];var _0x3e6944=_0x2ab5e5?_0x175ca6[_0x5177('0x22')]:_0x1b32e6[_0x5177('0x20')]+_0x1b32e6['limit'];var _0x86f5f8;if(_0x3e6944>=_0x41e687){_0x3e6944=_0x41e687;_0x86f5f8=0xc8;}else{_0x86f5f8=0xce;}_0x31aff8['status'](_0x86f5f8);return _0x31aff8[_0x5177('0x23')](_0x5177('0x24'),_0x1b4102+'-'+_0x3e6944+'/'+_0x41e687)[_0x5177('0x1f')](_0x175ca6);}return null;};}function patchUpdates(_0x27b732){return function(_0x451e5c){try{jsonpatch[_0x5177('0x25')](_0x451e5c,_0x27b732,!![]);}catch(_0x174c4f){return BPromise[_0x5177('0x26')](_0x174c4f);}return _0x451e5c[_0x5177('0x27')]();};}function saveUpdates(_0x2a95cc,_0x23dad2){return function(_0x3b0c37){if(_0x3b0c37){return _0x3b0c37['update'](_0x2a95cc)[_0x5177('0x28')](function(_0x556f96){return _0x556f96;});}return null;};}function removeEntity(_0x30b60f,_0x2c68d8){return function(_0x3b39b5){if(_0x3b39b5){return _0x3b39b5[_0x5177('0x29')]()['then'](function(){var _0x2503ef=_0x3b39b5['get']({'plain':!![]});var _0x564139=_0x5177('0x2a');return db[_0x5177('0x2b')]['destroy']({'where':{'type':_0x564139,'resourceId':_0x2503ef['id']}})[_0x5177('0x28')](function(){return _0x3b39b5;});})['then'](function(){_0x30b60f[_0x5177('0x1d')](0xcc)[_0x5177('0x1e')]();});}};}function handleEntityNotFound(_0x58846c,_0x3e021a){return function(_0x2554ec){if(!_0x2554ec){_0x58846c[_0x5177('0x1c')](0x194);}return _0x2554ec;};}function handleError(_0x7f86e,_0xe98ff1){_0xe98ff1=_0xe98ff1||0x1f4;return function(_0x1cef5d){logger['error'](_0x1cef5d['stack']);if(_0x1cef5d[_0x5177('0x2c')]){delete _0x1cef5d[_0x5177('0x2c')];}_0x7f86e[_0x5177('0x1d')](_0xe98ff1)[_0x5177('0x2d')](_0x1cef5d);};}exports[_0x5177('0x2e')]=function(_0x8134f9,_0x31eb9f){var _0x72dced={},_0x49f6f1={},_0x42e1db={'count':0x0,'rows':[]};var _0x2233a2=_['map'](db[_0x5177('0x2f')]['rawAttributes'],function(_0x172b36){return{'name':_0x172b36[_0x5177('0x30')],'type':_0x172b36[_0x5177('0x31')]['key']};});_0x49f6f1['model']=_[_0x5177('0x32')](_0x2233a2,_0x5177('0x2c'));_0x49f6f1[_0x5177('0x33')]=_[_0x5177('0x34')](_0x8134f9[_0x5177('0x33')]);_0x49f6f1[_0x5177('0x35')]=_[_0x5177('0x36')](_0x49f6f1[_0x5177('0x37')],_0x49f6f1['query']);_0x72dced[_0x5177('0x38')]=_[_0x5177('0x36')](_0x49f6f1['model'],qs[_0x5177('0x39')](_0x8134f9[_0x5177('0x33')][_0x5177('0x39')]));_0x72dced[_0x5177('0x38')]=_0x72dced[_0x5177('0x38')][_0x5177('0x3a')]?_0x72dced['attributes']:_0x49f6f1[_0x5177('0x37')];if(!_0x8134f9[_0x5177('0x33')][_0x5177('0x3b')](_0x5177('0x3c'))){_0x72dced[_0x5177('0x3d')]=qs[_0x5177('0x3d')](_0x8134f9[_0x5177('0x33')]['limit']);_0x72dced[_0x5177('0x20')]=qs[_0x5177('0x20')](_0x8134f9['query']['offset']);}_0x72dced[_0x5177('0x3e')]=qs[_0x5177('0x3f')](_0x8134f9[_0x5177('0x33')][_0x5177('0x3f')]);_0x72dced[_0x5177('0x40')]=qs[_0x5177('0x35')](_[_0x5177('0x41')](_0x8134f9[_0x5177('0x33')],_0x49f6f1[_0x5177('0x35')]),_0x2233a2);if(_0x8134f9[_0x5177('0x33')][_0x5177('0x42')]){_0x72dced[_0x5177('0x40')]=_[_0x5177('0x43')](_0x72dced['where'],{'$or':_[_0x5177('0x32')](_0x2233a2,function(_0x2a4db1){if(_0x2a4db1['type']!==_0x5177('0x44')){var _0x56f297={};_0x56f297[_0x2a4db1[_0x5177('0x2c')]]={'$like':'%'+_0x8134f9[_0x5177('0x33')][_0x5177('0x42')]+'%'};return _0x56f297;}})});}_0x72dced=_['merge']({},_0x72dced,_0x8134f9['options']);var _0x210510={'where':_0x72dced[_0x5177('0x40')]};return db[_0x5177('0x2f')][_0x5177('0x22')](_0x210510)[_0x5177('0x28')](function(_0x3e710d){_0x42e1db[_0x5177('0x22')]=_0x3e710d;if(_0x8134f9[_0x5177('0x33')]['includeAll']){_0x72dced[_0x5177('0x45')]=[{'all':!![]}];}return db['VoiceMail']['findAll'](_0x72dced);})[_0x5177('0x28')](function(_0x17dc98){_0x42e1db['rows']=_0x17dc98;return _0x42e1db;})[_0x5177('0x28')](respondWithFilteredResult(_0x31eb9f,_0x72dced))['catch'](handleError(_0x31eb9f,null));};exports['show']=function(_0x46c833,_0x1769cd){var _0x262c71={'raw':!![],'where':{'id':_0x46c833[_0x5177('0x46')]['id']}},_0x3776b8={};_0x3776b8[_0x5177('0x37')]=_[_0x5177('0x34')](db['VoiceMail']['rawAttributes']);_0x3776b8[_0x5177('0x33')]=_['keys'](_0x46c833[_0x5177('0x33')]);_0x3776b8[_0x5177('0x35')]=_[_0x5177('0x36')](_0x3776b8[_0x5177('0x37')],_0x3776b8['query']);_0x262c71[_0x5177('0x38')]=_[_0x5177('0x36')](_0x3776b8[_0x5177('0x37')],qs[_0x5177('0x39')](_0x46c833[_0x5177('0x33')][_0x5177('0x39')]));_0x262c71[_0x5177('0x38')]=_0x262c71[_0x5177('0x38')][_0x5177('0x3a')]?_0x262c71[_0x5177('0x38')]:_0x3776b8[_0x5177('0x37')];if(_0x46c833['query'][_0x5177('0x47')]){_0x262c71['include']=[{'all':!![]}];}_0x262c71=_['merge']({},_0x262c71,_0x46c833['options']);return db[_0x5177('0x2f')][_0x5177('0x48')](_0x262c71)['then'](handleEntityNotFound(_0x1769cd,null))[_0x5177('0x28')](respondWithResult(_0x1769cd,null))[_0x5177('0x49')](handleError(_0x1769cd,null));};exports[_0x5177('0x4a')]=function(_0x4891fe,_0x1d4ae4){return db['VoiceMail']['create'](_0x4891fe['body'],{})[_0x5177('0x28')](function(_0x37d5dd){var _0x1300d7=_0x4891fe['user']['get']({'plain':!![]});if(!_0x1300d7)throw new Error(_0x5177('0x4b'));if(_0x1300d7['role']===_0x5177('0x4c')){var _0x9dd7a2=_0x37d5dd[_0x5177('0x4d')]({'plain':!![]});var _0x31a6e1=_0x5177('0x2a');return db[_0x5177('0x4e')][_0x5177('0x48')]({'where':{'name':_0x31a6e1,'userProfileId':_0x1300d7[_0x5177('0x4f')]},'raw':!![]})[_0x5177('0x28')](function(_0x217aca){if(_0x217aca&&_0x217aca[_0x5177('0x50')]===0x0){return db[_0x5177('0x2b')][_0x5177('0x4a')]({'name':_0x9dd7a2['name'],'resourceId':_0x9dd7a2['id'],'type':_0x217aca['name'],'sectionId':_0x217aca['id']},{})[_0x5177('0x28')](function(){return _0x37d5dd;});}else{return _0x37d5dd;}})['catch'](function(_0x649c6f){logger['error'](_0x5177('0x51'),_0x649c6f);throw _0x649c6f;});}return _0x37d5dd;})[_0x5177('0x28')](respondWithResult(_0x1d4ae4,0xc9))[_0x5177('0x49')](handleError(_0x1d4ae4,null));};exports['update']=function(_0x5be224,_0x19884e){if(_0x5be224[_0x5177('0x52')]['id']){delete _0x5be224[_0x5177('0x52')]['id'];}return db[_0x5177('0x2f')]['find']({'where':{'id':_0x5be224['params']['id']}})[_0x5177('0x28')](handleEntityNotFound(_0x19884e,null))[_0x5177('0x28')](saveUpdates(_0x5be224[_0x5177('0x52')],null))[_0x5177('0x28')](respondWithResult(_0x19884e,null))['catch'](handleError(_0x19884e,null));};exports[_0x5177('0x29')]=function(_0x143aff,_0x3a18ad){return db['VoiceMail'][_0x5177('0x48')]({'where':{'id':_0x143aff[_0x5177('0x46')]['id']}})[_0x5177('0x28')](handleEntityNotFound(_0x3a18ad,null))['then'](removeEntity(_0x3a18ad,null))[_0x5177('0x49')](handleError(_0x3a18ad,null));};exports['getMessages']=function(_0x40dfd6,_0x39fb92,_0x3268bd){return db['VoiceMail'][_0x5177('0x53')]({'where':{'id':_0x40dfd6[_0x5177('0x46')]['id']}})[_0x5177('0x28')](handleEntityNotFound(_0x39fb92,null))[_0x5177('0x28')](function(_0xc7a59e){var _0x74589e;var _0x37380c={},_0x267599={};_0x267599['model']=_['keys'](db['VoiceMailMessage'][_0x5177('0x54')]);_0x267599[_0x5177('0x33')]=_[_0x5177('0x34')](_0x40dfd6[_0x5177('0x33')]);_0x267599[_0x5177('0x35')]=_[_0x5177('0x36')](_0x267599['model'],_0x267599['query']);_0x37380c[_0x5177('0x38')]=_[_0x5177('0x36')](_0x267599[_0x5177('0x37')],qs[_0x5177('0x39')](_0x40dfd6[_0x5177('0x33')][_0x5177('0x39')]));_0x37380c[_0x5177('0x38')]=_0x37380c[_0x5177('0x38')][_0x5177('0x3a')]?_0x37380c['attributes']:_0x267599[_0x5177('0x37')];if(!_0x40dfd6[_0x5177('0x33')]['hasOwnProperty'](_0x5177('0x3c'))){_0x37380c[_0x5177('0x3d')]=qs['limit'](_0x40dfd6[_0x5177('0x33')][_0x5177('0x3d')]);_0x37380c[_0x5177('0x20')]=qs['offset'](_0x40dfd6[_0x5177('0x33')][_0x5177('0x20')]);}_0x37380c['order']=qs['sort'](_0x40dfd6[_0x5177('0x33')]['sort']);_0x37380c[_0x5177('0x40')]=qs['filters'](_[_0x5177('0x41')](_0x40dfd6[_0x5177('0x33')],_0x267599['filters']));if(_0x40dfd6[_0x5177('0x33')][_0x5177('0x42')]){_0x37380c[_0x5177('0x40')]=_[_0x5177('0x43')](_0x37380c[_0x5177('0x40')],{'$or':_[_0x5177('0x32')](_0x37380c[_0x5177('0x38')],function(_0x58ebdd){var _0x26b733={};_0x26b733[_0x58ebdd]={'$like':'%'+_0x40dfd6['query']['filter']+'%'};return _0x26b733;})});}_0x37380c[_0x5177('0x40')]=_[_0x5177('0x43')](_0x37380c['where'],{'mailboxuser':_0xc7a59e[_0x5177('0x55')]});_0x37380c=_[_0x5177('0x43')]({},_0x37380c,_0x40dfd6[_0x5177('0x56')]);return db[_0x5177('0x57')][_0x5177('0x58')](_0x37380c)[_0x5177('0x28')](respondWithFilteredResult(_0x39fb92,_0x37380c));})[_0x5177('0x49')](handleError(_0x39fb92,null));}; \ No newline at end of file +var _0xbfcc=['stack','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','key','keys','query','filters','attributes','intersection','model','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','create','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getMessages','nolimit','VoiceMailMessage','eml-format','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','limit','undefined','offset','count','set','Content-Range','json','reject','then','destroy','get','Voicemails','UserProfileResource','error'];(function(_0x26b4c2,_0x83a088){var _0x344a40=function(_0x4f3262){while(--_0x4f3262){_0x26b4c2['push'](_0x26b4c2['shift']());}};_0x344a40(++_0x83a088);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x2338fa,_0x80579a){_0x2338fa=_0x2338fa-0x0;var _0x42df9b=_0xbfcc[_0x2338fa];return _0x42df9b;};'use strict';var emlformat=require(_0xcbfc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcbfc('0x1'));var rp=require(_0xcbfc('0x2'));var moment=require(_0xcbfc('0x3'));var BPromise=require(_0xcbfc('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xcbfc('0x5'));var ejs=require(_0xcbfc('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcbfc('0x7'));var squel=require('squel');var crypto=require(_0xcbfc('0x8'));var jsforce=require(_0xcbfc('0x9'));var deskjs=require(_0xcbfc('0xa'));var toCsv=require(_0xcbfc('0x5'));var querystring=require('querystring');var Papa=require(_0xcbfc('0xb'));var Redis=require(_0xcbfc('0xc'));var authService=require(_0xcbfc('0xd'));var qs=require(_0xcbfc('0xe'));var as=require(_0xcbfc('0xf'));var hardwareService=require(_0xcbfc('0x10'));var logger=require('../../config/logger')(_0xcbfc('0x11'));var utils=require(_0xcbfc('0x12'));var config=require(_0xcbfc('0x13'));var licenseUtil=require(_0xcbfc('0x14'));var db=require(_0xcbfc('0x15'))['db'];function respondWithStatusCode(_0x4e8b34,_0x3bfd05){_0x3bfd05=_0x3bfd05||0xcc;return function(_0x86f67c){if(_0x86f67c){return _0x4e8b34[_0xcbfc('0x16')](_0x3bfd05);}return _0x4e8b34['status'](_0x3bfd05)[_0xcbfc('0x17')]();};}function respondWithResult(_0x3ec338,_0x2f2bdd){_0x2f2bdd=_0x2f2bdd||0xc8;return function(_0x45a5cc){if(_0x45a5cc){return _0x3ec338[_0xcbfc('0x18')](_0x2f2bdd)['json'](_0x45a5cc);}};}function respondWithFilteredResult(_0x3c69ed,_0x1963de){return function(_0x1ec8c4){if(_0x1ec8c4){var _0x4317e4=typeof _0x1963de['offset']==='undefined'&&typeof _0x1963de[_0xcbfc('0x19')]===_0xcbfc('0x1a');var _0xa65368=_0x1ec8c4['count'];var _0x5b078f=_0x4317e4?0x0:_0x1963de[_0xcbfc('0x1b')];var _0x99b59d=_0x4317e4?_0x1ec8c4[_0xcbfc('0x1c')]:_0x1963de['offset']+_0x1963de[_0xcbfc('0x19')];var _0x552777;if(_0x99b59d>=_0xa65368){_0x99b59d=_0xa65368;_0x552777=0xc8;}else{_0x552777=0xce;}_0x3c69ed[_0xcbfc('0x18')](_0x552777);return _0x3c69ed[_0xcbfc('0x1d')](_0xcbfc('0x1e'),_0x5b078f+'-'+_0x99b59d+'/'+_0xa65368)[_0xcbfc('0x1f')](_0x1ec8c4);}return null;};}function patchUpdates(_0x25c167){return function(_0x2653b1){try{jsonpatch['apply'](_0x2653b1,_0x25c167,!![]);}catch(_0x9c79da){return BPromise[_0xcbfc('0x20')](_0x9c79da);}return _0x2653b1['save']();};}function saveUpdates(_0x1da958,_0x5a449b){return function(_0x4cc8b3){if(_0x4cc8b3){return _0x4cc8b3['update'](_0x1da958)[_0xcbfc('0x21')](function(_0x4a0fcb){return _0x4a0fcb;});}return null;};}function removeEntity(_0x4a1915,_0x1b3e42){return function(_0x34cffa){if(_0x34cffa){return _0x34cffa[_0xcbfc('0x22')]()[_0xcbfc('0x21')](function(){var _0x49f5bf=_0x34cffa[_0xcbfc('0x23')]({'plain':!![]});var _0x51284a=_0xcbfc('0x24');return db[_0xcbfc('0x25')]['destroy']({'where':{'type':_0x51284a,'resourceId':_0x49f5bf['id']}})[_0xcbfc('0x21')](function(){return _0x34cffa;});})[_0xcbfc('0x21')](function(){_0x4a1915['status'](0xcc)[_0xcbfc('0x17')]();});}};}function handleEntityNotFound(_0x3c3afd,_0x2f7549){return function(_0x41f3b8){if(!_0x41f3b8){_0x3c3afd['sendStatus'](0x194);}return _0x41f3b8;};}function handleError(_0x29f896,_0x1ec530){_0x1ec530=_0x1ec530||0x1f4;return function(_0x4f632a){logger[_0xcbfc('0x26')](_0x4f632a[_0xcbfc('0x27')]);if(_0x4f632a[_0xcbfc('0x28')]){delete _0x4f632a[_0xcbfc('0x28')];}_0x29f896[_0xcbfc('0x18')](_0x1ec530)[_0xcbfc('0x29')](_0x4f632a);};}exports[_0xcbfc('0x2a')]=function(_0x5366cf,_0x41b68b){var _0x433300={},_0x3f9d20={},_0x20a378={'count':0x0,'rows':[]};var _0x500a0b=_[_0xcbfc('0x2b')](db[_0xcbfc('0x2c')][_0xcbfc('0x2d')],function(_0x245986){return{'name':_0x245986[_0xcbfc('0x2e')],'type':_0x245986[_0xcbfc('0x2f')][_0xcbfc('0x30')]};});_0x3f9d20['model']=_[_0xcbfc('0x2b')](_0x500a0b,_0xcbfc('0x28'));_0x3f9d20['query']=_[_0xcbfc('0x31')](_0x5366cf[_0xcbfc('0x32')]);_0x3f9d20[_0xcbfc('0x33')]=_['intersection'](_0x3f9d20['model'],_0x3f9d20['query']);_0x433300[_0xcbfc('0x34')]=_[_0xcbfc('0x35')](_0x3f9d20[_0xcbfc('0x36')],qs[_0xcbfc('0x37')](_0x5366cf[_0xcbfc('0x32')][_0xcbfc('0x37')]));_0x433300[_0xcbfc('0x34')]=_0x433300[_0xcbfc('0x34')]['length']?_0x433300[_0xcbfc('0x34')]:_0x3f9d20[_0xcbfc('0x36')];if(!_0x5366cf['query'][_0xcbfc('0x38')]('nolimit')){_0x433300[_0xcbfc('0x19')]=qs[_0xcbfc('0x19')](_0x5366cf[_0xcbfc('0x32')]['limit']);_0x433300[_0xcbfc('0x1b')]=qs['offset'](_0x5366cf['query'][_0xcbfc('0x1b')]);}_0x433300[_0xcbfc('0x39')]=qs[_0xcbfc('0x3a')](_0x5366cf[_0xcbfc('0x32')][_0xcbfc('0x3a')]);_0x433300[_0xcbfc('0x3b')]=qs[_0xcbfc('0x33')](_[_0xcbfc('0x3c')](_0x5366cf['query'],_0x3f9d20[_0xcbfc('0x33')]),_0x500a0b);if(_0x5366cf['query'][_0xcbfc('0x3d')]){_0x433300[_0xcbfc('0x3b')]=_[_0xcbfc('0x3e')](_0x433300[_0xcbfc('0x3b')],{'$or':_['map'](_0x500a0b,function(_0x5306e9){if(_0x5306e9[_0xcbfc('0x2f')]!==_0xcbfc('0x3f')){var _0x404f46={};_0x404f46[_0x5306e9[_0xcbfc('0x28')]]={'$like':'%'+_0x5366cf[_0xcbfc('0x32')]['filter']+'%'};return _0x404f46;}})});}_0x433300=_[_0xcbfc('0x3e')]({},_0x433300,_0x5366cf[_0xcbfc('0x40')]);var _0xf2da32={'where':_0x433300['where']};return db[_0xcbfc('0x2c')][_0xcbfc('0x1c')](_0xf2da32)[_0xcbfc('0x21')](function(_0x4ca55c){_0x20a378[_0xcbfc('0x1c')]=_0x4ca55c;if(_0x5366cf[_0xcbfc('0x32')][_0xcbfc('0x41')]){_0x433300[_0xcbfc('0x42')]=[{'all':!![]}];}return db[_0xcbfc('0x2c')][_0xcbfc('0x43')](_0x433300);})[_0xcbfc('0x21')](function(_0x561544){_0x20a378[_0xcbfc('0x44')]=_0x561544;return _0x20a378;})[_0xcbfc('0x21')](respondWithFilteredResult(_0x41b68b,_0x433300))['catch'](handleError(_0x41b68b,null));};exports[_0xcbfc('0x45')]=function(_0x50a01c,_0x17b87b){var _0xdc0521={'raw':!![],'where':{'id':_0x50a01c[_0xcbfc('0x46')]['id']}},_0xd609ec={};_0xd609ec[_0xcbfc('0x36')]=_[_0xcbfc('0x31')](db['VoiceMail'][_0xcbfc('0x2d')]);_0xd609ec[_0xcbfc('0x32')]=_[_0xcbfc('0x31')](_0x50a01c[_0xcbfc('0x32')]);_0xd609ec[_0xcbfc('0x33')]=_[_0xcbfc('0x35')](_0xd609ec[_0xcbfc('0x36')],_0xd609ec['query']);_0xdc0521[_0xcbfc('0x34')]=_[_0xcbfc('0x35')](_0xd609ec['model'],qs[_0xcbfc('0x37')](_0x50a01c[_0xcbfc('0x32')][_0xcbfc('0x37')]));_0xdc0521['attributes']=_0xdc0521[_0xcbfc('0x34')][_0xcbfc('0x47')]?_0xdc0521[_0xcbfc('0x34')]:_0xd609ec[_0xcbfc('0x36')];if(_0x50a01c[_0xcbfc('0x32')][_0xcbfc('0x41')]){_0xdc0521[_0xcbfc('0x42')]=[{'all':!![]}];}_0xdc0521=_['merge']({},_0xdc0521,_0x50a01c['options']);return db[_0xcbfc('0x2c')][_0xcbfc('0x48')](_0xdc0521)[_0xcbfc('0x21')](handleEntityNotFound(_0x17b87b,null))[_0xcbfc('0x21')](respondWithResult(_0x17b87b,null))['catch'](handleError(_0x17b87b,null));};exports['create']=function(_0x2e89bf,_0xe5c5ef){return db[_0xcbfc('0x2c')]['create'](_0x2e89bf[_0xcbfc('0x49')],{})[_0xcbfc('0x21')](function(_0x4446b7){var _0x4b3096=_0x2e89bf[_0xcbfc('0x4a')][_0xcbfc('0x23')]({'plain':!![]});if(!_0x4b3096)throw new Error(_0xcbfc('0x4b'));if(_0x4b3096[_0xcbfc('0x4c')]===_0xcbfc('0x4a')){var _0xd9976d=_0x4446b7[_0xcbfc('0x23')]({'plain':!![]});var _0x374998=_0xcbfc('0x24');return db[_0xcbfc('0x4d')]['find']({'where':{'name':_0x374998,'userProfileId':_0x4b3096[_0xcbfc('0x4e')]},'raw':!![]})[_0xcbfc('0x21')](function(_0x44cc11){if(_0x44cc11&&_0x44cc11['autoAssociation']===0x0){return db[_0xcbfc('0x25')][_0xcbfc('0x4f')]({'name':_0xd9976d['name'],'resourceId':_0xd9976d['id'],'type':_0x44cc11[_0xcbfc('0x28')],'sectionId':_0x44cc11['id']},{})[_0xcbfc('0x21')](function(){return _0x4446b7;});}else{return _0x4446b7;}})[_0xcbfc('0x50')](function(_0x25e48d){logger['error'](_0xcbfc('0x51'),_0x25e48d);throw _0x25e48d;});}return _0x4446b7;})[_0xcbfc('0x21')](respondWithResult(_0xe5c5ef,0xc9))['catch'](handleError(_0xe5c5ef,null));};exports[_0xcbfc('0x52')]=function(_0x34db13,_0x3ed9f0){if(_0x34db13[_0xcbfc('0x49')]['id']){delete _0x34db13[_0xcbfc('0x49')]['id'];}return db[_0xcbfc('0x2c')][_0xcbfc('0x48')]({'where':{'id':_0x34db13[_0xcbfc('0x46')]['id']}})[_0xcbfc('0x21')](handleEntityNotFound(_0x3ed9f0,null))[_0xcbfc('0x21')](saveUpdates(_0x34db13['body'],null))[_0xcbfc('0x21')](respondWithResult(_0x3ed9f0,null))['catch'](handleError(_0x3ed9f0,null));};exports['destroy']=function(_0x4a10e6,_0x4239da){return db[_0xcbfc('0x2c')][_0xcbfc('0x48')]({'where':{'id':_0x4a10e6[_0xcbfc('0x46')]['id']}})[_0xcbfc('0x21')](handleEntityNotFound(_0x4239da,null))[_0xcbfc('0x21')](removeEntity(_0x4239da,null))[_0xcbfc('0x50')](handleError(_0x4239da,null));};exports[_0xcbfc('0x53')]=function(_0x4d2df1,_0x9e0c38,_0xf5f5e1){return db[_0xcbfc('0x2c')]['findOne']({'where':{'id':_0x4d2df1[_0xcbfc('0x46')]['id']}})[_0xcbfc('0x21')](handleEntityNotFound(_0x9e0c38,null))[_0xcbfc('0x21')](function(_0x3b526f){var _0x1ed350;var _0x310b78={},_0x34ec1d={};_0x34ec1d['model']=_[_0xcbfc('0x31')](db['VoiceMailMessage'][_0xcbfc('0x2d')]);_0x34ec1d[_0xcbfc('0x32')]=_['keys'](_0x4d2df1[_0xcbfc('0x32')]);_0x34ec1d['filters']=_[_0xcbfc('0x35')](_0x34ec1d[_0xcbfc('0x36')],_0x34ec1d[_0xcbfc('0x32')]);_0x310b78[_0xcbfc('0x34')]=_[_0xcbfc('0x35')](_0x34ec1d[_0xcbfc('0x36')],qs['fields'](_0x4d2df1[_0xcbfc('0x32')][_0xcbfc('0x37')]));_0x310b78['attributes']=_0x310b78[_0xcbfc('0x34')][_0xcbfc('0x47')]?_0x310b78[_0xcbfc('0x34')]:_0x34ec1d[_0xcbfc('0x36')];if(!_0x4d2df1[_0xcbfc('0x32')][_0xcbfc('0x38')](_0xcbfc('0x54'))){_0x310b78[_0xcbfc('0x19')]=qs['limit'](_0x4d2df1[_0xcbfc('0x32')][_0xcbfc('0x19')]);_0x310b78[_0xcbfc('0x1b')]=qs[_0xcbfc('0x1b')](_0x4d2df1[_0xcbfc('0x32')][_0xcbfc('0x1b')]);}_0x310b78[_0xcbfc('0x39')]=qs[_0xcbfc('0x3a')](_0x4d2df1[_0xcbfc('0x32')][_0xcbfc('0x3a')]);_0x310b78['where']=qs[_0xcbfc('0x33')](_[_0xcbfc('0x3c')](_0x4d2df1['query'],_0x34ec1d[_0xcbfc('0x33')]));if(_0x4d2df1['query']['filter']){_0x310b78[_0xcbfc('0x3b')]=_[_0xcbfc('0x3e')](_0x310b78[_0xcbfc('0x3b')],{'$or':_[_0xcbfc('0x2b')](_0x310b78[_0xcbfc('0x34')],function(_0x4d8d2a){var _0x53babd={};_0x53babd[_0x4d8d2a]={'$like':'%'+_0x4d2df1[_0xcbfc('0x32')][_0xcbfc('0x3d')]+'%'};return _0x53babd;})});}_0x310b78[_0xcbfc('0x3b')]=_[_0xcbfc('0x3e')](_0x310b78[_0xcbfc('0x3b')],{'mailboxuser':_0x3b526f['mailbox']});_0x310b78=_[_0xcbfc('0x3e')]({},_0x310b78,_0x4d2df1[_0xcbfc('0x40')]);return db[_0xcbfc('0x55')]['findAndCountAll'](_0x310b78)['then'](respondWithFilteredResult(_0x9e0c38,_0x310b78));})['catch'](handleError(_0x9e0c38,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 8a0a592..8ecf82a 100644 --- a/server/api/voiceMail/voiceMail.model.js +++ b/server/api/voiceMail/voiceMail.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3785=['request-promise','path','../../config/environment','exports','define','VoiceMail','voice_voicemail','mailbox','util','../../config/logger','api','moment','bluebird'];(function(_0x360a02,_0x5c1a9c){var _0x563dd3=function(_0x366338){while(--_0x366338){_0x360a02['push'](_0x360a02['shift']());}};_0x563dd3(++_0x5c1a9c);}(_0x3785,0x140));var _0x5378=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x3785[_0xc6be3a];return _0x56a310;};'use strict';var _=require('lodash');var util=require(_0x5378('0x0'));var logger=require(_0x5378('0x1'))(_0x5378('0x2'));var moment=require(_0x5378('0x3'));var BPromise=require(_0x5378('0x4'));var rp=require(_0x5378('0x5'));var fs=require('fs');var path=require(_0x5378('0x6'));var rimraf=require('rimraf');var config=require(_0x5378('0x7'));var attributes=require('./voiceMail.attributes');module[_0x5378('0x8')]=function(_0x328a42,_0x471b35){return _0x328a42[_0x5378('0x9')](_0x5378('0xa'),attributes,{'tableName':_0x5378('0xb'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x5378('0xc'),'context']}],'timestamps':!![]});}; \ No newline at end of file +var _0x27c3=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','VoiceMail','mailbox','context','util','../../config/logger'];(function(_0x157b94,_0x5da1c8){var _0x110f3=function(_0x1f6827){while(--_0x1f6827){_0x157b94['push'](_0x157b94['shift']());}};_0x110f3(++_0x5da1c8);}(_0x27c3,0x143));var _0x327c=function(_0x4a04de,_0x2e342c){_0x4a04de=_0x4a04de-0x0;var _0xbbe018=_0x27c3[_0x4a04de];return _0xbbe018;};'use strict';var _=require('lodash');var util=require(_0x327c('0x0'));var logger=require(_0x327c('0x1'))(_0x327c('0x2'));var moment=require(_0x327c('0x3'));var BPromise=require(_0x327c('0x4'));var rp=require(_0x327c('0x5'));var fs=require('fs');var path=require(_0x327c('0x6'));var rimraf=require(_0x327c('0x7'));var config=require(_0x327c('0x8'));var attributes=require('./voiceMail.attributes');module[_0x327c('0x9')]=function(_0x38a4ee,_0x1360bf){return _0x38a4ee['define'](_0x327c('0xa'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x327c('0xb'),_0x327c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 3bb9ae8..a40f22a 100644 --- a/server/api/voiceMail/voiceMail.rpc.js +++ b/server/api/voiceMail/voiceMail.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbdcd=['VoiceMail,\x20%s,\x20%s','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then'];(function(_0x4ebf10,_0x2ea42a){var _0x12453b=function(_0x13643b){while(--_0x13643b){_0x4ebf10['push'](_0x4ebf10['shift']());}};_0x12453b(++_0x2ea42a);}(_0xbdcd,0x134));var _0xdbdc=function(_0x1261c2,_0x3ef819){_0x1261c2=_0x1261c2-0x0;var _0x3aabd2=_0xbdcd[_0x1261c2];return _0x3aabd2;};'use strict';var _=require(_0xdbdc('0x0'));var util=require(_0xdbdc('0x1'));var moment=require(_0xdbdc('0x2'));var BPromise=require(_0xdbdc('0x3'));var rs=require(_0xdbdc('0x4'));var fs=require('fs');var Redis=require(_0xdbdc('0x5'));var db=require(_0xdbdc('0x6'))['db'];var utils=require(_0xdbdc('0x7'));var logger=require(_0xdbdc('0x8'))(_0xdbdc('0x9'));var config=require('../../config/environment');var jayson=require(_0xdbdc('0xa'));var client=jayson[_0xdbdc('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x592cd8,_0x33054b,_0x35e4ca){return new BPromise(function(_0x273d0c,_0x91f442){return client[_0xdbdc('0xc')](_0x592cd8,_0x35e4ca)[_0xdbdc('0xd')](function(_0x405b82){logger['info'](_0xdbdc('0xe'),_0x33054b,'request\x20sent');logger['debug'](_0xdbdc('0xf'),_0x33054b,_0xdbdc('0x10'),JSON[_0xdbdc('0x11')](_0x405b82));if(_0x405b82[_0xdbdc('0x12')]){if(_0x405b82[_0xdbdc('0x12')][_0xdbdc('0x13')]===0x1f4){logger[_0xdbdc('0x12')]('VoiceMail,\x20%s,\x20%s',_0x33054b,_0x405b82[_0xdbdc('0x12')][_0xdbdc('0x14')]);return _0x91f442(_0x405b82[_0xdbdc('0x12')][_0xdbdc('0x14')]);}logger[_0xdbdc('0x12')](_0xdbdc('0xe'),_0x33054b,_0x405b82[_0xdbdc('0x12')]['message']);return _0x273d0c(_0x405b82[_0xdbdc('0x12')][_0xdbdc('0x14')]);}else{logger['info'](_0xdbdc('0xe'),_0x33054b,'request\x20sent');_0x273d0c(_0x405b82[_0xdbdc('0x15')][_0xdbdc('0x14')]);}})[_0xdbdc('0x16')](function(_0x2c4d05){logger['error'](_0xdbdc('0xe'),_0x33054b,_0x2c4d05);_0x91f442(_0x2c4d05);});});} \ No newline at end of file +var _0xe160=['debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','code','VoiceMail,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','request\x20sent'];(function(_0x10e728,_0x1135d8){var _0x25dd5e=function(_0x234007){while(--_0x234007){_0x10e728['push'](_0x10e728['shift']());}};_0x25dd5e(++_0x1135d8);}(_0xe160,0x110));var _0x0e16=function(_0x5b9dde,_0x36d952){_0x5b9dde=_0x5b9dde-0x0;var _0x72b36f=_0xe160[_0x5b9dde];return _0x72b36f;};'use strict';var _=require(_0x0e16('0x0'));var util=require(_0x0e16('0x1'));var moment=require(_0x0e16('0x2'));var BPromise=require(_0x0e16('0x3'));var rs=require(_0x0e16('0x4'));var fs=require('fs');var Redis=require(_0x0e16('0x5'));var db=require(_0x0e16('0x6'))['db'];var utils=require(_0x0e16('0x7'));var logger=require(_0x0e16('0x8'))(_0x0e16('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0e16('0xa')][_0x0e16('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f6ece,_0x1eff8c,_0x5e6b84){return new BPromise(function(_0x594323,_0x44d7e2){return client[_0x0e16('0xc')](_0x1f6ece,_0x5e6b84)[_0x0e16('0xd')](function(_0x2d10cf){logger[_0x0e16('0xe')]('VoiceMail,\x20%s,\x20%s',_0x1eff8c,_0x0e16('0xf'));logger[_0x0e16('0x10')](_0x0e16('0x11'),_0x1eff8c,_0x0e16('0xf'),JSON['stringify'](_0x2d10cf));if(_0x2d10cf['error']){if(_0x2d10cf[_0x0e16('0x12')][_0x0e16('0x13')]===0x1f4){logger[_0x0e16('0x12')](_0x0e16('0x14'),_0x1eff8c,_0x2d10cf['error'][_0x0e16('0x15')]);return _0x44d7e2(_0x2d10cf[_0x0e16('0x12')][_0x0e16('0x15')]);}logger['error']('VoiceMail,\x20%s,\x20%s',_0x1eff8c,_0x2d10cf[_0x0e16('0x12')]['message']);return _0x594323(_0x2d10cf['error'][_0x0e16('0x15')]);}else{logger[_0x0e16('0xe')](_0x0e16('0x14'),_0x1eff8c,_0x0e16('0xf'));_0x594323(_0x2d10cf[_0x0e16('0x16')][_0x0e16('0x15')]);}})[_0x0e16('0x17')](function(_0x48fea8){logger[_0x0e16('0x12')]('VoiceMail,\x20%s,\x20%s',_0x1eff8c,_0x48fea8);_0x44d7e2(_0x48fea8);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index c5d8a5f..430f101 100644 --- a/server/api/voiceMailMessage/index.js +++ b/server/api/voiceMailMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfaa5=['./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x3030e9,_0x435a80){var _0x219650=function(_0x1baabd){while(--_0x1baabd){_0x3030e9['push'](_0x3030e9['shift']());}};_0x219650(++_0x435a80);}(_0xfaa5,0x1d8));var _0x5faa=function(_0x5515a7,_0x2c4af1){_0x5515a7=_0x5515a7-0x0;var _0x43f4bf=_0xfaa5[_0x5515a7];return _0x43f4bf;};'use strict';var multer=require(_0x5faa('0x0'));var util=require(_0x5faa('0x1'));var path=require(_0x5faa('0x2'));var timeout=require(_0x5faa('0x3'));var express=require(_0x5faa('0x4'));var router=express['Router']();var fs_extra=require(_0x5faa('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5faa('0x6'));var config=require(_0x5faa('0x7'));var controller=require(_0x5faa('0x8'));router[_0x5faa('0x9')]('/',auth[_0x5faa('0xa')](),controller[_0x5faa('0xb')]);router[_0x5faa('0x9')](_0x5faa('0xc'),auth[_0x5faa('0xa')](),controller[_0x5faa('0xd')]);router[_0x5faa('0x9')]('/:id/download',auth[_0x5faa('0xa')](),controller['download']);router[_0x5faa('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5faa('0xf')](_0x5faa('0xc'),auth['isAuthenticated'](),controller[_0x5faa('0x10')]);router[_0x5faa('0x11')](_0x5faa('0xc'),auth[_0x5faa('0xa')](),controller[_0x5faa('0x12')]);module[_0x5faa('0x13')]=router; \ No newline at end of file +var _0x3fb9=['../../components/auth/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','show','/:id/download','download','post','put','update','delete','/:id','destroy','exports','multer','util','path','Router','fs-extra'];(function(_0x337293,_0x2a571d){var _0x2f7075=function(_0x349ed6){while(--_0x349ed6){_0x337293['push'](_0x337293['shift']());}};_0x2f7075(++_0x2a571d);}(_0x3fb9,0xe2));var _0x93fb=function(_0x31539d,_0x371a4a){_0x31539d=_0x31539d-0x0;var _0x5983ea=_0x3fb9[_0x31539d];return _0x5983ea;};'use strict';var multer=require(_0x93fb('0x0'));var util=require(_0x93fb('0x1'));var path=require(_0x93fb('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x93fb('0x3')]();var fs_extra=require(_0x93fb('0x4'));var auth=require(_0x93fb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x93fb('0x6'));var controller=require(_0x93fb('0x7'));router[_0x93fb('0x8')]('/',auth[_0x93fb('0x9')](),controller[_0x93fb('0xa')]);router['get']('/:id',auth[_0x93fb('0x9')](),controller[_0x93fb('0xb')]);router['get'](_0x93fb('0xc'),auth[_0x93fb('0x9')](),controller[_0x93fb('0xd')]);router[_0x93fb('0xe')]('/',auth[_0x93fb('0x9')](),controller['create']);router[_0x93fb('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x93fb('0x10')]);router[_0x93fb('0x11')](_0x93fb('0x12'),auth[_0x93fb('0x9')](),controller[_0x93fb('0x13')]);module[_0x93fb('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index e8f8487..42266ae 100644 --- a/server/api/voiceMailMessage/voiceMailMessage.attributes.js +++ b/server/api/voiceMailMessage/voiceMailMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1d41=['TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','getDataValue','STRING','long'];(function(_0x3a7829,_0x19370c){var _0x4f5918=function(_0x68d55a){while(--_0x68d55a){_0x3a7829['push'](_0x3a7829['shift']());}};_0x4f5918(++_0x19370c);}(_0x1d41,0x129));var _0x11d4=function(_0x402c8f,_0x30cc1d){_0x402c8f=_0x402c8f-0x0;var _0x11e809=_0x1d41[_0x402c8f];return _0x11e809;};'use strict';var Sequelize=require(_0x11d4('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x1c51b6){return this[_0x11d4('0x1')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0x11d4('0x2')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x11d4('0x2')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0x11d4('0x2')],'defaultValue':''},'duration':{'type':Sequelize[_0x11d4('0x2')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x11d4('0x2')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x11d4('0x2')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x11d4('0x3')),'defaultValue':null},'flag':{'type':Sequelize[_0x11d4('0x2')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x11d4('0x4'),'defaultValue':Sequelize[_0x11d4('0x5')](_0x11d4('0x6'))}}; \ No newline at end of file +var _0x016b=['STRING','BLOB','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','getDataValue'];(function(_0x17784a,_0x42fe44){var _0x41aded=function(_0x2e7319){while(--_0x2e7319){_0x17784a['push'](_0x17784a['shift']());}};_0x41aded(++_0x42fe44);}(_0x016b,0x1bf));var _0xb016=function(_0x5abba8,_0x50f677){_0x5abba8=_0x5abba8-0x0;var _0x28b779=_0x016b[_0x5abba8];return _0x28b779;};'use strict';var Sequelize=require(_0xb016('0x0'));module[_0xb016('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x420666){return this[_0xb016('0x2')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xb016('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0xb016('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0xb016('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0xb016('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xb016('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xb016('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0xb016('0x4')](_0xb016('0x5')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0xb016('0x3')],'defaultValue':''},'stamp':{'type':_0xb016('0x6'),'defaultValue':Sequelize[_0xb016('0x7')](_0xb016('0x8'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 75b9aa1..b98ec12 100644 --- a/server/api/voiceMailMessage/voiceMailMessage.controller.js +++ b/server/api/voiceMailMessage/voiceMailMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb21=['set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','show','params','find','create','body','catch','recording','msg_id','ValidationError','VoiceMailMessage\x20not\x20found','attachment','Content-Disposition','.wav\x22','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xdb21,0xd2));var _0x1db2=function(_0x293e7a,_0x1792a2){_0x293e7a=_0x293e7a-0x0;var _0xb78342=_0xdb21[_0x293e7a];return _0xb78342;};'use strict';var emlformat=require(_0x1db2('0x0'));var rimraf=require(_0x1db2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1db2('0x2'));var rp=require(_0x1db2('0x3'));var moment=require(_0x1db2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1db2('0x5'));var util=require(_0x1db2('0x6'));var path=require('path');var sox=require(_0x1db2('0x7'));var csv=require('to-csv');var ejs=require(_0x1db2('0x8'));var fs=require('fs');var fs_extra=require(_0x1db2('0x9'));var _=require('lodash');var squel=require(_0x1db2('0xa'));var crypto=require(_0x1db2('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1db2('0xc'));var toCsv=require(_0x1db2('0xd'));var querystring=require('querystring');var Papa=require(_0x1db2('0xe'));var Redis=require('ioredis');var authService=require(_0x1db2('0xf'));var qs=require(_0x1db2('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1db2('0x11'));var logger=require(_0x1db2('0x12'))(_0x1db2('0x13'));var utils=require('../../config/utils');var config=require(_0x1db2('0x14'));var licenseUtil=require(_0x1db2('0x15'));var db=require(_0x1db2('0x16'))['db'];function respondWithStatusCode(_0x144eac,_0x52557c){_0x52557c=_0x52557c||0xcc;return function(_0x3354db){if(_0x3354db){return _0x144eac[_0x1db2('0x17')](_0x52557c);}return _0x144eac[_0x1db2('0x18')](_0x52557c)[_0x1db2('0x19')]();};}function respondWithResult(_0x57125d,_0x27a68d){_0x27a68d=_0x27a68d||0xc8;return function(_0x349eec){if(_0x349eec){return _0x57125d['status'](_0x27a68d)['json'](_0x349eec);}};}function respondWithFilteredResult(_0x601962,_0xac2eda){return function(_0x568b11){if(_0x568b11){var _0x2466e5=typeof _0xac2eda['offset']===_0x1db2('0x1a')&&typeof _0xac2eda[_0x1db2('0x1b')]==='undefined';var _0x31ba86=_0x568b11[_0x1db2('0x1c')];var _0x2684f5=_0x2466e5?0x0:_0xac2eda['offset'];var _0x18f28a=_0x2466e5?_0x568b11[_0x1db2('0x1c')]:_0xac2eda[_0x1db2('0x1d')]+_0xac2eda['limit'];var _0x58fe5b;if(_0x18f28a>=_0x31ba86){_0x18f28a=_0x31ba86;_0x58fe5b=0xc8;}else{_0x58fe5b=0xce;}_0x601962[_0x1db2('0x18')](_0x58fe5b);return _0x601962[_0x1db2('0x1e')](_0x1db2('0x1f'),_0x2684f5+'-'+_0x18f28a+'/'+_0x31ba86)[_0x1db2('0x20')](_0x568b11);}return null;};}function patchUpdates(_0x53fa9f){return function(_0x2d7c79){try{jsonpatch['apply'](_0x2d7c79,_0x53fa9f,!![]);}catch(_0x2c9a33){return BPromise[_0x1db2('0x21')](_0x2c9a33);}return _0x2d7c79[_0x1db2('0x22')]();};}function saveUpdates(_0x27be80,_0x33cc69){return function(_0x3b382e){if(_0x3b382e){return _0x3b382e[_0x1db2('0x23')](_0x27be80)[_0x1db2('0x24')](function(_0x4d63c6){return _0x4d63c6;});}return null;};}function removeEntity(_0x408d44,_0x2ceb5e){return function(_0x1c3f36){if(_0x1c3f36){return _0x1c3f36[_0x1db2('0x25')]()['then'](function(){_0x408d44[_0x1db2('0x18')](0xcc)[_0x1db2('0x19')]();});}};}function handleEntityNotFound(_0x43e986,_0x4f4a0a){return function(_0x298601){if(!_0x298601){_0x43e986['sendStatus'](0x194);}return _0x298601;};}function handleError(_0x266f21,_0x41f81a){_0x41f81a=_0x41f81a||0x1f4;return function(_0x77af89){logger[_0x1db2('0x26')](_0x77af89[_0x1db2('0x27')]);if(_0x77af89['name']){delete _0x77af89[_0x1db2('0x28')];}_0x266f21['status'](_0x41f81a)[_0x1db2('0x29')](_0x77af89);};}exports[_0x1db2('0x2a')]=function(_0xf17cc1,_0x38ddaf){var _0x3e7a1e={},_0x2a53a3={},_0x5bd376={'count':0x0,'rows':[]};var _0x7c131e=_[_0x1db2('0x2b')](db[_0x1db2('0x2c')][_0x1db2('0x2d')],function(_0x3e9b7a){return{'name':_0x3e9b7a[_0x1db2('0x2e')],'type':_0x3e9b7a[_0x1db2('0x2f')][_0x1db2('0x30')]};});_0x2a53a3[_0x1db2('0x31')]=_['differenceBy'](_[_0x1db2('0x2b')](_0x7c131e,_0x1db2('0x28')),[_0x1db2('0x28')]);_0x2a53a3[_0x1db2('0x32')]=_[_0x1db2('0x33')](_0xf17cc1[_0x1db2('0x32')]);_0x2a53a3[_0x1db2('0x34')]=_[_0x1db2('0x35')](_0x2a53a3[_0x1db2('0x31')],_0x2a53a3['query']);_0x3e7a1e[_0x1db2('0x36')]=_[_0x1db2('0x35')](_0x2a53a3[_0x1db2('0x31')],qs['fields'](_0xf17cc1['query'][_0x1db2('0x37')]));_0x3e7a1e[_0x1db2('0x36')]=_0x3e7a1e[_0x1db2('0x36')][_0x1db2('0x38')]?_0x3e7a1e[_0x1db2('0x36')]:_0x2a53a3[_0x1db2('0x31')];if(!_0xf17cc1[_0x1db2('0x32')]['hasOwnProperty'](_0x1db2('0x39'))){_0x3e7a1e[_0x1db2('0x1b')]=qs['limit'](_0xf17cc1[_0x1db2('0x32')]['limit']);_0x3e7a1e[_0x1db2('0x1d')]=qs[_0x1db2('0x1d')](_0xf17cc1['query'][_0x1db2('0x1d')]);}_0x3e7a1e['order']=qs[_0x1db2('0x3a')](_0xf17cc1[_0x1db2('0x32')][_0x1db2('0x3a')]);_0x3e7a1e[_0x1db2('0x3b')]=qs[_0x1db2('0x34')](_[_0x1db2('0x3c')](_0xf17cc1[_0x1db2('0x32')],_0x2a53a3[_0x1db2('0x34')]),_0x7c131e);if(_0xf17cc1['query']['filter']){_0x3e7a1e['where']=_[_0x1db2('0x3d')](_0x3e7a1e[_0x1db2('0x3b')],{'$or':_[_0x1db2('0x2b')](_0x7c131e,function(_0x2a3420){if(_0x2a3420[_0x1db2('0x2f')]!==_0x1db2('0x3e')){var _0x506bbd={};_0x506bbd[_0x2a3420['name']]={'$like':'%'+_0xf17cc1[_0x1db2('0x32')][_0x1db2('0x3f')]+'%'};return _0x506bbd;}})});}_0x3e7a1e=_[_0x1db2('0x3d')]({},_0x3e7a1e,_0xf17cc1['options']);var _0x381c42={'where':_0x3e7a1e[_0x1db2('0x3b')]};return db[_0x1db2('0x2c')][_0x1db2('0x1c')](_0x381c42)[_0x1db2('0x24')](function(_0x1dd614){_0x5bd376[_0x1db2('0x1c')]=_0x1dd614;if(_0xf17cc1[_0x1db2('0x32')][_0x1db2('0x40')]){_0x3e7a1e[_0x1db2('0x41')]=[{'all':!![]}];}return db[_0x1db2('0x2c')][_0x1db2('0x42')](_0x3e7a1e);})['then'](function(_0x45e980){_0x5bd376['rows']=_0x45e980;return _0x5bd376;})[_0x1db2('0x24')](respondWithFilteredResult(_0x38ddaf,_0x3e7a1e))['catch'](handleError(_0x38ddaf,null));};exports[_0x1db2('0x43')]=function(_0x4c1079,_0x1c333f){var _0x197a86={'raw':!![],'where':{'id':_0x4c1079[_0x1db2('0x44')]['id']}},_0x4720e7={};_0x4720e7[_0x1db2('0x31')]=_[_0x1db2('0x33')](db[_0x1db2('0x2c')][_0x1db2('0x2d')]);_0x4720e7[_0x1db2('0x32')]=_[_0x1db2('0x33')](_0x4c1079[_0x1db2('0x32')]);_0x4720e7[_0x1db2('0x34')]=_[_0x1db2('0x35')](_0x4720e7[_0x1db2('0x31')],_0x4720e7[_0x1db2('0x32')]);_0x197a86['attributes']=_['intersection'](_0x4720e7[_0x1db2('0x31')],qs['fields'](_0x4c1079[_0x1db2('0x32')][_0x1db2('0x37')]));_0x197a86[_0x1db2('0x36')]=_0x197a86[_0x1db2('0x36')][_0x1db2('0x38')]?_0x197a86[_0x1db2('0x36')]:_0x4720e7[_0x1db2('0x31')];if(_0x4c1079['query'][_0x1db2('0x40')]){_0x197a86[_0x1db2('0x41')]=[{'all':!![]}];}_0x197a86=_[_0x1db2('0x3d')]({},_0x197a86,_0x4c1079['options']);return db[_0x1db2('0x2c')][_0x1db2('0x45')](_0x197a86)[_0x1db2('0x24')](handleEntityNotFound(_0x1c333f,null))[_0x1db2('0x24')](respondWithResult(_0x1c333f,null))['catch'](handleError(_0x1c333f,null));};exports[_0x1db2('0x46')]=function(_0x29e3e9,_0x5a6451){return db[_0x1db2('0x2c')][_0x1db2('0x46')](_0x29e3e9[_0x1db2('0x47')],{})[_0x1db2('0x24')](respondWithResult(_0x5a6451,0xc9))[_0x1db2('0x48')](handleError(_0x5a6451,null));};exports[_0x1db2('0x23')]=function(_0x14fbcf,_0x36dc6c){if(_0x14fbcf['body']['id']){delete _0x14fbcf[_0x1db2('0x47')]['id'];}return db[_0x1db2('0x2c')]['find']({'where':{'id':_0x14fbcf['params']['id']}})[_0x1db2('0x24')](handleEntityNotFound(_0x36dc6c,null))[_0x1db2('0x24')](saveUpdates(_0x14fbcf['body'],null))[_0x1db2('0x24')](respondWithResult(_0x36dc6c,null))['catch'](handleError(_0x36dc6c,null));};exports[_0x1db2('0x25')]=function(_0x278d48,_0x4767d3){return db['VoiceMailMessage']['find']({'where':{'id':_0x278d48[_0x1db2('0x44')]['id']}})[_0x1db2('0x24')](handleEntityNotFound(_0x4767d3,null))[_0x1db2('0x24')](removeEntity(_0x4767d3,null))[_0x1db2('0x48')](handleError(_0x4767d3,null));};exports['download']=function(_0x202ab0,_0x21ed34,_0x3cd7ec){return db[_0x1db2('0x2c')]['find']({'where':{'id':_0x202ab0[_0x1db2('0x44')]['id']},'attributes':['id',_0x1db2('0x49'),_0x1db2('0x4a')]})[_0x1db2('0x24')](handleEntityNotFound(_0x21ed34,null))[_0x1db2('0x24')](function(_0x424233){if(_0x424233){if(!_0x424233[_0x1db2('0x49')]){throw new db['Sequelize'][(_0x1db2('0x4b'))](_0x1db2('0x4c'));}var _0xc1c6fe={'Content-Type':'audio/wav','Content-Disposition':_0x1db2('0x4d')};if(_0x424233[_0x1db2('0x4a')]){_0xc1c6fe[_0x1db2('0x4e')]='attachment;\x20filename=\x22'+_0x424233[_0x1db2('0x4a')]+_0x1db2('0x4f');}_0x21ed34['set'](_0xc1c6fe);return _0x21ed34[_0x1db2('0x29')](new Buffer(_0x424233[_0x1db2('0x49')]));}})[_0x1db2('0x48')](handleError(_0x21ed34,null));}; \ No newline at end of file +var _0x428e=['key','model','differenceBy','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','create','body','find','params','destroy','download','recording','Sequelize','ValidationError','audio/wav','attachment','msg_id','Content-Disposition','.wav\x22','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','end','error','stack','name','send','index','map','VoiceMailMessage','rawAttributes','type'];(function(_0x234315,_0x48e004){var _0x3f447d=function(_0x1c7537){while(--_0x1c7537){_0x234315['push'](_0x234315['shift']());}};_0x3f447d(++_0x48e004);}(_0x428e,0x1d4));var _0xe428=function(_0x35af23,_0x9190f6){_0x35af23=_0x35af23-0x0;var _0x340506=_0x428e[_0x35af23];return _0x340506;};'use strict';var emlformat=require(_0xe428('0x0'));var rimraf=require(_0xe428('0x1'));var zipdir=require(_0xe428('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe428('0x3'));var BPromise=require(_0xe428('0x4'));var Mustache=require(_0xe428('0x5'));var util=require(_0xe428('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xe428('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe428('0x8'));var _=require(_0xe428('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe428('0xa'));var deskjs=require(_0xe428('0xb'));var toCsv=require(_0xe428('0x7'));var querystring=require(_0xe428('0xc'));var Papa=require(_0xe428('0xd'));var Redis=require(_0xe428('0xe'));var authService=require(_0xe428('0xf'));var qs=require(_0xe428('0x10'));var as=require(_0xe428('0x11'));var hardwareService=require(_0xe428('0x12'));var logger=require(_0xe428('0x13'))(_0xe428('0x14'));var utils=require(_0xe428('0x15'));var config=require(_0xe428('0x16'));var licenseUtil=require(_0xe428('0x17'));var db=require(_0xe428('0x18'))['db'];function respondWithStatusCode(_0x599580,_0x1ee2fb){_0x1ee2fb=_0x1ee2fb||0xcc;return function(_0x48f49e){if(_0x48f49e){return _0x599580[_0xe428('0x19')](_0x1ee2fb);}return _0x599580[_0xe428('0x1a')](_0x1ee2fb)['end']();};}function respondWithResult(_0x4f52c1,_0x318f48){_0x318f48=_0x318f48||0xc8;return function(_0x2b41aa){if(_0x2b41aa){return _0x4f52c1[_0xe428('0x1a')](_0x318f48)['json'](_0x2b41aa);}};}function respondWithFilteredResult(_0x2ff986,_0x5d8b72){return function(_0x300c99){if(_0x300c99){var _0x40a9e7=typeof _0x5d8b72[_0xe428('0x1b')]===_0xe428('0x1c')&&typeof _0x5d8b72[_0xe428('0x1d')]===_0xe428('0x1c');var _0x1c895b=_0x300c99[_0xe428('0x1e')];var _0x1300fd=_0x40a9e7?0x0:_0x5d8b72[_0xe428('0x1b')];var _0x53e1e4=_0x40a9e7?_0x300c99[_0xe428('0x1e')]:_0x5d8b72[_0xe428('0x1b')]+_0x5d8b72[_0xe428('0x1d')];var _0x28e0ff;if(_0x53e1e4>=_0x1c895b){_0x53e1e4=_0x1c895b;_0x28e0ff=0xc8;}else{_0x28e0ff=0xce;}_0x2ff986['status'](_0x28e0ff);return _0x2ff986[_0xe428('0x1f')](_0xe428('0x20'),_0x1300fd+'-'+_0x53e1e4+'/'+_0x1c895b)[_0xe428('0x21')](_0x300c99);}return null;};}function patchUpdates(_0x54abc6){return function(_0x58dcff){try{jsonpatch[_0xe428('0x22')](_0x58dcff,_0x54abc6,!![]);}catch(_0xa382e3){return BPromise['reject'](_0xa382e3);}return _0x58dcff[_0xe428('0x23')]();};}function saveUpdates(_0x520aaa,_0x38a959){return function(_0x2c9383){if(_0x2c9383){return _0x2c9383[_0xe428('0x24')](_0x520aaa)['then'](function(_0x31fa31){return _0x31fa31;});}return null;};}function removeEntity(_0x243bbe,_0x2d437a){return function(_0x14026f){if(_0x14026f){return _0x14026f['destroy']()[_0xe428('0x25')](function(){_0x243bbe['status'](0xcc)[_0xe428('0x26')]();});}};}function handleEntityNotFound(_0x2ecd6c,_0x1b1845){return function(_0x2effe8){if(!_0x2effe8){_0x2ecd6c[_0xe428('0x19')](0x194);}return _0x2effe8;};}function handleError(_0x1df6ab,_0x36777f){_0x36777f=_0x36777f||0x1f4;return function(_0x34f23b){logger[_0xe428('0x27')](_0x34f23b[_0xe428('0x28')]);if(_0x34f23b[_0xe428('0x29')]){delete _0x34f23b[_0xe428('0x29')];}_0x1df6ab[_0xe428('0x1a')](_0x36777f)[_0xe428('0x2a')](_0x34f23b);};}exports[_0xe428('0x2b')]=function(_0x2b157e,_0x4f3dd6){var _0x4a0eee={},_0x59cc22={},_0x37589b={'count':0x0,'rows':[]};var _0x638df0=_[_0xe428('0x2c')](db[_0xe428('0x2d')][_0xe428('0x2e')],function(_0x328ad3){return{'name':_0x328ad3['fieldName'],'type':_0x328ad3[_0xe428('0x2f')][_0xe428('0x30')]};});_0x59cc22[_0xe428('0x31')]=_[_0xe428('0x32')](_[_0xe428('0x2c')](_0x638df0,_0xe428('0x29')),[_0xe428('0x29')]);_0x59cc22['query']=_[_0xe428('0x33')](_0x2b157e['query']);_0x59cc22[_0xe428('0x34')]=_[_0xe428('0x35')](_0x59cc22['model'],_0x59cc22[_0xe428('0x36')]);_0x4a0eee[_0xe428('0x37')]=_[_0xe428('0x35')](_0x59cc22[_0xe428('0x31')],qs[_0xe428('0x38')](_0x2b157e[_0xe428('0x36')][_0xe428('0x38')]));_0x4a0eee[_0xe428('0x37')]=_0x4a0eee['attributes']['length']?_0x4a0eee[_0xe428('0x37')]:_0x59cc22[_0xe428('0x31')];if(!_0x2b157e[_0xe428('0x36')][_0xe428('0x39')](_0xe428('0x3a'))){_0x4a0eee[_0xe428('0x1d')]=qs[_0xe428('0x1d')](_0x2b157e[_0xe428('0x36')]['limit']);_0x4a0eee[_0xe428('0x1b')]=qs['offset'](_0x2b157e[_0xe428('0x36')][_0xe428('0x1b')]);}_0x4a0eee[_0xe428('0x3b')]=qs[_0xe428('0x3c')](_0x2b157e['query'][_0xe428('0x3c')]);_0x4a0eee[_0xe428('0x3d')]=qs[_0xe428('0x34')](_[_0xe428('0x3e')](_0x2b157e['query'],_0x59cc22[_0xe428('0x34')]),_0x638df0);if(_0x2b157e[_0xe428('0x36')][_0xe428('0x3f')]){_0x4a0eee['where']=_[_0xe428('0x40')](_0x4a0eee[_0xe428('0x3d')],{'$or':_[_0xe428('0x2c')](_0x638df0,function(_0xb485cb){if(_0xb485cb[_0xe428('0x2f')]!==_0xe428('0x41')){var _0x408a20={};_0x408a20[_0xb485cb[_0xe428('0x29')]]={'$like':'%'+_0x2b157e[_0xe428('0x36')][_0xe428('0x3f')]+'%'};return _0x408a20;}})});}_0x4a0eee=_[_0xe428('0x40')]({},_0x4a0eee,_0x2b157e[_0xe428('0x42')]);var _0x1a8c0f={'where':_0x4a0eee['where']};return db[_0xe428('0x2d')][_0xe428('0x1e')](_0x1a8c0f)[_0xe428('0x25')](function(_0x358f30){_0x37589b[_0xe428('0x1e')]=_0x358f30;if(_0x2b157e[_0xe428('0x36')][_0xe428('0x43')]){_0x4a0eee[_0xe428('0x44')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0xe428('0x45')](_0x4a0eee);})[_0xe428('0x25')](function(_0xf6912e){_0x37589b[_0xe428('0x46')]=_0xf6912e;return _0x37589b;})['then'](respondWithFilteredResult(_0x4f3dd6,_0x4a0eee))[_0xe428('0x47')](handleError(_0x4f3dd6,null));};exports['show']=function(_0x412051,_0x4209d3){var _0x9dca7b={'raw':!![],'where':{'id':_0x412051['params']['id']}},_0x174b54={};_0x174b54['model']=_['keys'](db[_0xe428('0x2d')][_0xe428('0x2e')]);_0x174b54['query']=_[_0xe428('0x33')](_0x412051[_0xe428('0x36')]);_0x174b54[_0xe428('0x34')]=_[_0xe428('0x35')](_0x174b54[_0xe428('0x31')],_0x174b54[_0xe428('0x36')]);_0x9dca7b['attributes']=_[_0xe428('0x35')](_0x174b54[_0xe428('0x31')],qs[_0xe428('0x38')](_0x412051[_0xe428('0x36')]['fields']));_0x9dca7b[_0xe428('0x37')]=_0x9dca7b[_0xe428('0x37')]['length']?_0x9dca7b['attributes']:_0x174b54[_0xe428('0x31')];if(_0x412051[_0xe428('0x36')][_0xe428('0x43')]){_0x9dca7b[_0xe428('0x44')]=[{'all':!![]}];}_0x9dca7b=_[_0xe428('0x40')]({},_0x9dca7b,_0x412051[_0xe428('0x42')]);return db[_0xe428('0x2d')]['find'](_0x9dca7b)[_0xe428('0x25')](handleEntityNotFound(_0x4209d3,null))[_0xe428('0x25')](respondWithResult(_0x4209d3,null))[_0xe428('0x47')](handleError(_0x4209d3,null));};exports[_0xe428('0x48')]=function(_0x2258fe,_0x38e389){return db['VoiceMailMessage'][_0xe428('0x48')](_0x2258fe['body'],{})[_0xe428('0x25')](respondWithResult(_0x38e389,0xc9))[_0xe428('0x47')](handleError(_0x38e389,null));};exports[_0xe428('0x24')]=function(_0x4dade2,_0xbb12ea){if(_0x4dade2[_0xe428('0x49')]['id']){delete _0x4dade2[_0xe428('0x49')]['id'];}return db[_0xe428('0x2d')][_0xe428('0x4a')]({'where':{'id':_0x4dade2[_0xe428('0x4b')]['id']}})['then'](handleEntityNotFound(_0xbb12ea,null))[_0xe428('0x25')](saveUpdates(_0x4dade2[_0xe428('0x49')],null))['then'](respondWithResult(_0xbb12ea,null))[_0xe428('0x47')](handleError(_0xbb12ea,null));};exports[_0xe428('0x4c')]=function(_0x5f4df5,_0x16291d){return db['VoiceMailMessage'][_0xe428('0x4a')]({'where':{'id':_0x5f4df5[_0xe428('0x4b')]['id']}})[_0xe428('0x25')](handleEntityNotFound(_0x16291d,null))[_0xe428('0x25')](removeEntity(_0x16291d,null))[_0xe428('0x47')](handleError(_0x16291d,null));};exports[_0xe428('0x4d')]=function(_0x2db588,_0x5bf2ec,_0x269b36){return db['VoiceMailMessage'][_0xe428('0x4a')]({'where':{'id':_0x2db588['params']['id']},'attributes':['id',_0xe428('0x4e'),'msg_id']})[_0xe428('0x25')](handleEntityNotFound(_0x5bf2ec,null))[_0xe428('0x25')](function(_0x14f580){if(_0x14f580){if(!_0x14f580[_0xe428('0x4e')]){throw new db[(_0xe428('0x4f'))][(_0xe428('0x50'))]('VoiceMailMessage\x20not\x20found');}var _0x4f42f7={'Content-Type':_0xe428('0x51'),'Content-Disposition':_0xe428('0x52')};if(_0x14f580[_0xe428('0x53')]){_0x4f42f7[_0xe428('0x54')]='attachment;\x20filename=\x22'+_0x14f580[_0xe428('0x53')]+_0xe428('0x55');}_0x5bf2ec[_0xe428('0x1f')](_0x4f42f7);return _0x5bf2ec['send'](new Buffer(_0x14f580[_0xe428('0x4e')]));}})['catch'](handleError(_0x5bf2ec,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 9b7c787..7267498 100644 --- a/server/api/voiceMailMessage/voiceMailMessage.model.js +++ b/server/api/voiceMailMessage/voiceMailMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6297=['./voiceMailMessage.attributes','exports','define','VoiceMailMessage','dir','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2308e7,_0x4037e1){var _0x458c4a=function(_0x598e87){while(--_0x598e87){_0x2308e7['push'](_0x2308e7['shift']());}};_0x458c4a(++_0x4037e1);}(_0x6297,0x11d));var _0x7629=function(_0x1743bb,_0x1d161b){_0x1743bb=_0x1743bb-0x0;var _0x2db451=_0x6297[_0x1743bb];return _0x2db451;};'use strict';var _=require('lodash');var util=require(_0x7629('0x0'));var logger=require(_0x7629('0x1'))(_0x7629('0x2'));var moment=require(_0x7629('0x3'));var BPromise=require(_0x7629('0x4'));var rp=require(_0x7629('0x5'));var fs=require('fs');var path=require(_0x7629('0x6'));var rimraf=require(_0x7629('0x7'));var config=require(_0x7629('0x8'));var attributes=require(_0x7629('0x9'));module[_0x7629('0xa')]=function(_0x3d886f,_0x19c42a){return _0x3d886f[_0x7629('0xb')](_0x7629('0xc'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':'dir','fields':[_0x7629('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0x781d=['bluebird','request-promise','path','rimraf','./voiceMailMessage.attributes','exports','VoiceMailMessage','voice_voicemail_messages','lodash','../../config/logger','moment'];(function(_0x58965a,_0x2e71db){var _0x254efc=function(_0xf14fb4){while(--_0xf14fb4){_0x58965a['push'](_0x58965a['shift']());}};_0x254efc(++_0x2e71db);}(_0x781d,0x1c0));var _0xd781=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x781d[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xd781('0x0'));var util=require('util');var logger=require(_0xd781('0x1'))('api');var moment=require(_0xd781('0x2'));var BPromise=require(_0xd781('0x3'));var rp=require(_0xd781('0x4'));var fs=require('fs');var path=require(_0xd781('0x5'));var rimraf=require(_0xd781('0x6'));var config=require('../../config/environment');var attributes=require(_0xd781('0x7'));module[_0xd781('0x8')]=function(_0x52031d,_0x47d20e){return _0x52031d['define'](_0xd781('0x9'),attributes,{'tableName':_0xd781('0xa'),'paranoid':![],'indexes':[{'name':'dir','fields':['dir']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 6c1ae7a..a2156da 100644 --- a/server/api/voiceMailMessage/voiceMailMessage.rpc.js +++ b/server/api/voiceMailMessage/voiceMailMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6b0e=['http','then','VoiceMailMessage,\x20%s,\x20%s','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x6b0e,0x188));var _0xe6b0=function(_0x22ec6e,_0x5b82ac){_0x22ec6e=_0x22ec6e-0x0;var _0x305f3a=_0x6b0e[_0x22ec6e];return _0x305f3a;};'use strict';var _=require('lodash');var util=require(_0xe6b0('0x0'));var moment=require('moment');var BPromise=require(_0xe6b0('0x1'));var rs=require(_0xe6b0('0x2'));var fs=require('fs');var Redis=require(_0xe6b0('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe6b0('0x4'));var config=require(_0xe6b0('0x5'));var jayson=require(_0xe6b0('0x6'));var client=jayson[_0xe6b0('0x7')][_0xe6b0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xbac2af,_0xfc0d1c,_0x54bc8d){return new BPromise(function(_0x59a722,_0x3ae631){return client['request'](_0xbac2af,_0x54bc8d)[_0xe6b0('0x9')](function(_0x4b0f9e){logger['info'](_0xe6b0('0xa'),_0xfc0d1c,'request\x20sent');logger[_0xe6b0('0xb')](_0xe6b0('0xc'),_0xfc0d1c,_0xe6b0('0xd'),JSON[_0xe6b0('0xe')](_0x4b0f9e));if(_0x4b0f9e[_0xe6b0('0xf')]){if(_0x4b0f9e['error'][_0xe6b0('0x10')]===0x1f4){logger['error'](_0xe6b0('0xa'),_0xfc0d1c,_0x4b0f9e['error'][_0xe6b0('0x11')]);return _0x3ae631(_0x4b0f9e[_0xe6b0('0xf')][_0xe6b0('0x11')]);}logger['error'](_0xe6b0('0xa'),_0xfc0d1c,_0x4b0f9e['error']['message']);return _0x59a722(_0x4b0f9e['error'][_0xe6b0('0x11')]);}else{logger['info'](_0xe6b0('0xa'),_0xfc0d1c,_0xe6b0('0xd'));_0x59a722(_0x4b0f9e[_0xe6b0('0x12')][_0xe6b0('0x11')]);}})[_0xe6b0('0x13')](function(_0x28df2b){logger[_0xe6b0('0xf')](_0xe6b0('0xa'),_0xfc0d1c,_0x28df2b);_0x3ae631(_0x28df2b);});});} \ No newline at end of file +var _0xe9dc=['info','VoiceMailMessage,\x20%s,\x20%s','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x264d15,_0x2f5360){var _0x87a28e=function(_0x13e780){while(--_0x13e780){_0x264d15['push'](_0x264d15['shift']());}};_0x87a28e(++_0x2f5360);}(_0xe9dc,0x153));var _0xce9d=function(_0x3015db,_0x3c73a5){_0x3015db=_0x3015db-0x0;var _0x3ad5b3=_0xe9dc[_0x3015db];return _0x3ad5b3;};'use strict';var _=require(_0xce9d('0x0'));var util=require(_0xce9d('0x1'));var moment=require(_0xce9d('0x2'));var BPromise=require('bluebird');var rs=require(_0xce9d('0x3'));var fs=require('fs');var Redis=require(_0xce9d('0x4'));var db=require(_0xce9d('0x5'))['db'];var utils=require(_0xce9d('0x6'));var logger=require(_0xce9d('0x7'))(_0xce9d('0x8'));var config=require(_0xce9d('0x9'));var jayson=require(_0xce9d('0xa'));var client=jayson['client'][_0xce9d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x57303a,_0x443e08,_0x4171f3){return new BPromise(function(_0x3c8e8f,_0x52d1bc){return client[_0xce9d('0xc')](_0x57303a,_0x4171f3)['then'](function(_0x2ba8b9){logger[_0xce9d('0xd')](_0xce9d('0xe'),_0x443e08,'request\x20sent');logger['debug'](_0xce9d('0xf'),_0x443e08,_0xce9d('0x10'),JSON[_0xce9d('0x11')](_0x2ba8b9));if(_0x2ba8b9[_0xce9d('0x12')]){if(_0x2ba8b9[_0xce9d('0x12')][_0xce9d('0x13')]===0x1f4){logger[_0xce9d('0x12')](_0xce9d('0xe'),_0x443e08,_0x2ba8b9[_0xce9d('0x12')][_0xce9d('0x14')]);return _0x52d1bc(_0x2ba8b9[_0xce9d('0x12')][_0xce9d('0x14')]);}logger['error'](_0xce9d('0xe'),_0x443e08,_0x2ba8b9[_0xce9d('0x12')][_0xce9d('0x14')]);return _0x3c8e8f(_0x2ba8b9[_0xce9d('0x12')]['message']);}else{logger[_0xce9d('0xd')]('VoiceMailMessage,\x20%s,\x20%s',_0x443e08,_0xce9d('0x10'));_0x3c8e8f(_0x2ba8b9['result'][_0xce9d('0x14')]);}})[_0xce9d('0x15')](function(_0x4b6c39){logger[_0xce9d('0x12')](_0xce9d('0xe'),_0x443e08,_0x4b6c39);_0x52d1bc(_0x4b6c39);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index f1faa0c..ebb2dc2 100644 --- a/server/api/voiceMusicOnHold/index.js +++ b/server/api/voiceMusicOnHold/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6cb8=['/:id','update','delete','destroy','/:id/sounds/:id2','removeSound','multer','util','path','connect-timeout','express','Router','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','show','/:id/sounds','getSounds','post','addSound'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6cb8,0xae));var _0x86cb=function(_0x40e699,_0x4ed5ee){_0x40e699=_0x40e699-0x0;var _0x3a13a3=_0x6cb8[_0x40e699];return _0x3a13a3;};'use strict';var multer=require(_0x86cb('0x0'));var util=require(_0x86cb('0x1'));var path=require(_0x86cb('0x2'));var timeout=require(_0x86cb('0x3'));var express=require(_0x86cb('0x4'));var router=express[_0x86cb('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x86cb('0x6'));var controller=require(_0x86cb('0x7'));router[_0x86cb('0x8')]('/',auth[_0x86cb('0x9')](),controller['index']);router[_0x86cb('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x86cb('0xa')]);router[_0x86cb('0x8')](_0x86cb('0xb'),auth['isAuthenticated'](),controller[_0x86cb('0xc')]);router['post']('/',auth[_0x86cb('0x9')](),controller['create']);router[_0x86cb('0xd')](_0x86cb('0xb'),auth[_0x86cb('0x9')](),controller[_0x86cb('0xe')]);router['put'](_0x86cb('0xf'),auth[_0x86cb('0x9')](),controller[_0x86cb('0x10')]);router[_0x86cb('0x11')](_0x86cb('0xf'),auth[_0x86cb('0x9')](),controller[_0x86cb('0x12')]);router[_0x86cb('0x11')](_0x86cb('0x13'),auth['isAuthenticated'](),controller[_0x86cb('0x14')]);module['exports']=router; \ No newline at end of file +var _0xcd38=['get','isAuthenticated','index','/:id','show','getSounds','post','/:id/sounds','put','update','delete','exports','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller'];(function(_0x270a02,_0x223adb){var _0x3cd07b=function(_0x387642){while(--_0x387642){_0x270a02['push'](_0x270a02['shift']());}};_0x3cd07b(++_0x223adb);}(_0xcd38,0x103));var _0x8cd3=function(_0x470f33,_0x2943ab){_0x470f33=_0x470f33-0x0;var _0xd709d4=_0xcd38[_0x470f33];return _0xd709d4;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x8cd3('0x0'));var express=require('express');var router=express[_0x8cd3('0x1')]();var fs_extra=require(_0x8cd3('0x2'));var auth=require(_0x8cd3('0x3'));var interaction=require(_0x8cd3('0x4'));var config=require(_0x8cd3('0x5'));var controller=require(_0x8cd3('0x6'));router[_0x8cd3('0x7')]('/',auth[_0x8cd3('0x8')](),controller[_0x8cd3('0x9')]);router[_0x8cd3('0x7')](_0x8cd3('0xa'),auth[_0x8cd3('0x8')](),controller[_0x8cd3('0xb')]);router[_0x8cd3('0x7')]('/:id/sounds',auth[_0x8cd3('0x8')](),controller[_0x8cd3('0xc')]);router[_0x8cd3('0xd')]('/',auth[_0x8cd3('0x8')](),controller['create']);router[_0x8cd3('0xd')](_0x8cd3('0xe'),auth['isAuthenticated'](),controller['addSound']);router[_0x8cd3('0xf')](_0x8cd3('0xa'),auth['isAuthenticated'](),controller[_0x8cd3('0x10')]);router[_0x8cd3('0x11')](_0x8cd3('0xa'),auth['isAuthenticated'](),controller['destroy']);router[_0x8cd3('0x11')]('/:id/sounds/:id2',auth['isAuthenticated'](),controller['removeSound']);module[_0x8cd3('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 6fe2f34..55387fc 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5ab3=['name','ENUM','custom','files','mp3nb','quietmp3nb','mp3','STRING','TIMESTAMP','BOOLEAN','sequelize','exports'];(function(_0x15a5c7,_0x1eeb3e){var _0x47a94e=function(_0x3aab1f){while(--_0x3aab1f){_0x15a5c7['push'](_0x15a5c7['shift']());}};_0x47a94e(++_0x1eeb3e);}(_0x5ab3,0x136));var _0x35ab=function(_0x1b81c1,_0x1fd465){_0x1b81c1=_0x1b81c1-0x0;var _0x1f2b20=_0x5ab3[_0x1b81c1];return _0x1f2b20;};'use strict';var Sequelize=require(_0x35ab('0x0'));module[_0x35ab('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x35ab('0x2')},'mode':{'type':Sequelize[_0x35ab('0x3')](_0x35ab('0x4'),_0x35ab('0x5'),_0x35ab('0x6'),_0x35ab('0x7'),'quietmp3',_0x35ab('0x8')),'allowNull':!![],'defaultValue':_0x35ab('0x5')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x35ab('0x9')],'allowNull':!![]},'digit':{'type':Sequelize[_0x35ab('0x9')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x35ab('0x9')],'allowNull':!![]},'stamp':{'type':_0x35ab('0xa')},'defaultEntry':{'type':Sequelize[_0x35ab('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3431=['quietmp3','files','STRING','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','name','mp3nb','quietmp3nb'];(function(_0x2ffc5d,_0x564eba){var _0x57f0a=function(_0x44d8fb){while(--_0x44d8fb){_0x2ffc5d['push'](_0x2ffc5d['shift']());}};_0x57f0a(++_0x564eba);}(_0x3431,0x166));var _0x1343=function(_0x5dbb84,_0x1bbce9){_0x5dbb84=_0x5dbb84-0x0;var _0x1d6eae=_0x3431[_0x5dbb84];return _0x1d6eae;};'use strict';var Sequelize=require(_0x1343('0x0'));module[_0x1343('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1343('0x2')},'mode':{'type':Sequelize['ENUM']('custom','files',_0x1343('0x3'),_0x1343('0x4'),_0x1343('0x5'),'mp3'),'allowNull':!![],'defaultValue':_0x1343('0x6')},'directory':{'type':Sequelize[_0x1343('0x7')],'allowNull':!![]},'application':{'type':Sequelize[_0x1343('0x7')],'allowNull':!![]},'digit':{'type':Sequelize[_0x1343('0x7')],'allowNull':!![]},'sort':{'type':Sequelize[_0x1343('0x7')],'allowNull':!![],'defaultValue':_0x1343('0x8')},'format':{'type':Sequelize[_0x1343('0x7')],'allowNull':!![]},'stamp':{'type':_0x1343('0x9')},'defaultEntry':{'type':Sequelize[_0x1343('0xa')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 5f433cd..8bd63b6 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xca62=['rows','catch','show','params','intersection','length','options','find','body','create','transaction','mode','directory','join','root','server/files/moh','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','forEach','unlinkSync','ValidationError','message','addSound','findOne','converted_format','server/files/sounds/converted','format','basename','extname','save_name','symlinkSync','Sequelize','removeSound','id2','createdAt','getSounds','Sound','hasOwnProperty','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','then','get','MusicOnHolds','UserProfileResource','error','send','map','VoiceMusicOnHold','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','nolimit','order','sort','where','pick','filter','type','VIRTUAL','name','merge','includeAll','include','findAll'];(function(_0x10d34b,_0x4fef76){var _0x92b0bf=function(_0x16e291){while(--_0x16e291){_0x10d34b['push'](_0x10d34b['shift']());}};_0x92b0bf(++_0x4fef76);}(_0xca62,0x16c));var _0x2ca6=function(_0x5c6d11,_0x19fc22){_0x5c6d11=_0x5c6d11-0x0;var _0x36f6cd=_0xca62[_0x5c6d11];return _0x36f6cd;};'use strict';var emlformat=require(_0x2ca6('0x0'));var rimraf=require(_0x2ca6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2ca6('0x2'));var rp=require(_0x2ca6('0x3'));var moment=require(_0x2ca6('0x4'));var BPromise=require(_0x2ca6('0x5'));var Mustache=require('mustache');var util=require(_0x2ca6('0x6'));var path=require(_0x2ca6('0x7'));var sox=require('sox');var csv=require(_0x2ca6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2ca6('0x9'));var squel=require('squel');var crypto=require(_0x2ca6('0xa'));var jsforce=require(_0x2ca6('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x2ca6('0x8'));var querystring=require(_0x2ca6('0xc'));var Papa=require(_0x2ca6('0xd'));var Redis=require(_0x2ca6('0xe'));var authService=require(_0x2ca6('0xf'));var qs=require(_0x2ca6('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2ca6('0x11'));var logger=require(_0x2ca6('0x12'))('api');var utils=require(_0x2ca6('0x13'));var config=require(_0x2ca6('0x14'));var licenseUtil=require(_0x2ca6('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55b5c2,_0x4614eb){_0x4614eb=_0x4614eb||0xcc;return function(_0x2649f1){if(_0x2649f1){return _0x55b5c2['sendStatus'](_0x4614eb);}return _0x55b5c2[_0x2ca6('0x16')](_0x4614eb)['end']();};}function respondWithResult(_0x1f02ea,_0x3b9e8d){_0x3b9e8d=_0x3b9e8d||0xc8;return function(_0x2e98da){if(_0x2e98da){return _0x1f02ea[_0x2ca6('0x16')](_0x3b9e8d)[_0x2ca6('0x17')](_0x2e98da);}};}function respondWithFilteredResult(_0x449194,_0x118fa6){return function(_0x3429a1){if(_0x3429a1){var _0xa068f5=typeof _0x118fa6[_0x2ca6('0x18')]==='undefined'&&typeof _0x118fa6[_0x2ca6('0x19')]===_0x2ca6('0x1a');var _0x345cb6=_0x3429a1[_0x2ca6('0x1b')];var _0x2e5c3e=_0xa068f5?0x0:_0x118fa6[_0x2ca6('0x18')];var _0x2e814c=_0xa068f5?_0x3429a1[_0x2ca6('0x1b')]:_0x118fa6[_0x2ca6('0x18')]+_0x118fa6['limit'];var _0x183291;if(_0x2e814c>=_0x345cb6){_0x2e814c=_0x345cb6;_0x183291=0xc8;}else{_0x183291=0xce;}_0x449194['status'](_0x183291);return _0x449194[_0x2ca6('0x1c')](_0x2ca6('0x1d'),_0x2e5c3e+'-'+_0x2e814c+'/'+_0x345cb6)[_0x2ca6('0x17')](_0x3429a1);}return null;};}function patchUpdates(_0x36c1b6){return function(_0x4115fa){try{jsonpatch[_0x2ca6('0x1e')](_0x4115fa,_0x36c1b6,!![]);}catch(_0x567ce6){return BPromise[_0x2ca6('0x1f')](_0x567ce6);}return _0x4115fa[_0x2ca6('0x20')]();};}function saveUpdates(_0x29da26,_0x23295d){return function(_0x48f773){if(_0x48f773){return _0x48f773['update'](_0x29da26)['then'](function(_0x5bff69){return _0x5bff69;});}return null;};}function removeEntity(_0x156dd2,_0x5bb0b4){return function(_0x4fd066){if(_0x4fd066){return _0x4fd066[_0x2ca6('0x21')]()[_0x2ca6('0x22')](function(){var _0x38fb93=_0x4fd066[_0x2ca6('0x23')]({'plain':!![]});var _0x133533=_0x2ca6('0x24');return db[_0x2ca6('0x25')][_0x2ca6('0x21')]({'where':{'type':_0x133533,'resourceId':_0x38fb93['id']}})[_0x2ca6('0x22')](function(){return _0x4fd066;});})[_0x2ca6('0x22')](function(){_0x156dd2[_0x2ca6('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5583bf,_0x7ef139){return function(_0x2e3f7b){if(!_0x2e3f7b){_0x5583bf['sendStatus'](0x194);}return _0x2e3f7b;};}function handleError(_0x4dcd91,_0x5e2e6a){_0x5e2e6a=_0x5e2e6a||0x1f4;return function(_0x212158){logger[_0x2ca6('0x26')](_0x212158['stack']);if(_0x212158['name']){delete _0x212158['name'];}_0x4dcd91[_0x2ca6('0x16')](_0x5e2e6a)[_0x2ca6('0x27')](_0x212158);};}exports['index']=function(_0xed0660,_0x1dd7c2){var _0x17fbd9={},_0x55b8dc={},_0x5db15d={'count':0x0,'rows':[]};var _0x562320=_[_0x2ca6('0x28')](db[_0x2ca6('0x29')][_0x2ca6('0x2a')],function(_0x2c1c3e){return{'name':_0x2c1c3e[_0x2ca6('0x2b')],'type':_0x2c1c3e['type'][_0x2ca6('0x2c')]};});_0x55b8dc[_0x2ca6('0x2d')]=_['map'](_0x562320,'name');_0x55b8dc[_0x2ca6('0x2e')]=_[_0x2ca6('0x2f')](_0xed0660[_0x2ca6('0x2e')]);_0x55b8dc[_0x2ca6('0x30')]=_['intersection'](_0x55b8dc[_0x2ca6('0x2d')],_0x55b8dc[_0x2ca6('0x2e')]);_0x17fbd9[_0x2ca6('0x31')]=_['intersection'](_0x55b8dc[_0x2ca6('0x2d')],qs[_0x2ca6('0x32')](_0xed0660[_0x2ca6('0x2e')]['fields']));_0x17fbd9[_0x2ca6('0x31')]=_0x17fbd9[_0x2ca6('0x31')]['length']?_0x17fbd9['attributes']:_0x55b8dc[_0x2ca6('0x2d')];if(!_0xed0660[_0x2ca6('0x2e')]['hasOwnProperty'](_0x2ca6('0x33'))){_0x17fbd9['limit']=qs[_0x2ca6('0x19')](_0xed0660[_0x2ca6('0x2e')][_0x2ca6('0x19')]);_0x17fbd9[_0x2ca6('0x18')]=qs['offset'](_0xed0660[_0x2ca6('0x2e')][_0x2ca6('0x18')]);}_0x17fbd9[_0x2ca6('0x34')]=qs['sort'](_0xed0660['query'][_0x2ca6('0x35')]);delete _0xed0660[_0x2ca6('0x2e')][_0x2ca6('0x35')];_0x17fbd9[_0x2ca6('0x36')]=qs[_0x2ca6('0x30')](_[_0x2ca6('0x37')](_0xed0660[_0x2ca6('0x2e')],_0x55b8dc[_0x2ca6('0x30')]),_0x562320);if(_0xed0660[_0x2ca6('0x2e')][_0x2ca6('0x38')]){_0x17fbd9[_0x2ca6('0x36')]=_['merge'](_0x17fbd9[_0x2ca6('0x36')],{'$or':_[_0x2ca6('0x28')](_0x562320,function(_0xa8fc43){if(_0xa8fc43[_0x2ca6('0x39')]!==_0x2ca6('0x3a')){var _0x70789b={};_0x70789b[_0xa8fc43[_0x2ca6('0x3b')]]={'$like':'%'+_0xed0660[_0x2ca6('0x2e')][_0x2ca6('0x38')]+'%'};return _0x70789b;}})});}_0x17fbd9=_[_0x2ca6('0x3c')]({},_0x17fbd9,_0xed0660['options']);var _0x26958f={'where':_0x17fbd9[_0x2ca6('0x36')]};return db[_0x2ca6('0x29')][_0x2ca6('0x1b')](_0x26958f)[_0x2ca6('0x22')](function(_0x36f8cc){_0x5db15d[_0x2ca6('0x1b')]=_0x36f8cc;if(_0xed0660[_0x2ca6('0x2e')][_0x2ca6('0x3d')]){_0x17fbd9[_0x2ca6('0x3e')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x2ca6('0x3f')](_0x17fbd9);})[_0x2ca6('0x22')](function(_0x2a539d){_0x5db15d[_0x2ca6('0x40')]=_0x2a539d;return _0x5db15d;})[_0x2ca6('0x22')](respondWithFilteredResult(_0x1dd7c2,_0x17fbd9))[_0x2ca6('0x41')](handleError(_0x1dd7c2,null));};exports[_0x2ca6('0x42')]=function(_0x38ef3d,_0x5802ad){var _0xee32f9={'raw':![],'where':{'id':_0x38ef3d[_0x2ca6('0x43')]['id']}},_0x507fe1={};_0x507fe1['model']=_[_0x2ca6('0x2f')](db[_0x2ca6('0x29')][_0x2ca6('0x2a')]);_0x507fe1['query']=_[_0x2ca6('0x2f')](_0x38ef3d[_0x2ca6('0x2e')]);_0x507fe1[_0x2ca6('0x30')]=_[_0x2ca6('0x44')](_0x507fe1['model'],_0x507fe1['query']);_0xee32f9[_0x2ca6('0x31')]=_[_0x2ca6('0x44')](_0x507fe1[_0x2ca6('0x2d')],qs['fields'](_0x38ef3d[_0x2ca6('0x2e')][_0x2ca6('0x32')]));_0xee32f9[_0x2ca6('0x31')]=_0xee32f9['attributes'][_0x2ca6('0x45')]?_0xee32f9[_0x2ca6('0x31')]:_0x507fe1[_0x2ca6('0x2d')];if(_0x38ef3d['query'][_0x2ca6('0x3d')]){_0xee32f9[_0x2ca6('0x3e')]=[{'all':!![]}];}_0xee32f9=_['merge']({},_0xee32f9,_0x38ef3d[_0x2ca6('0x46')]);return db[_0x2ca6('0x29')][_0x2ca6('0x47')](_0xee32f9)[_0x2ca6('0x22')](handleEntityNotFound(_0x5802ad,null))['then'](respondWithResult(_0x5802ad,null))['catch'](handleError(_0x5802ad,null));};exports['update']=function(_0x408344,_0x30ff49){if(_0x408344['body']['id']){delete _0x408344[_0x2ca6('0x48')]['id'];}return db[_0x2ca6('0x29')]['find']({'where':{'id':_0x408344[_0x2ca6('0x43')]['id']}})[_0x2ca6('0x22')](handleEntityNotFound(_0x30ff49,null))[_0x2ca6('0x22')](saveUpdates(_0x408344[_0x2ca6('0x48')],null))['then'](respondWithResult(_0x30ff49,null))[_0x2ca6('0x41')](handleError(_0x30ff49,null));};exports[_0x2ca6('0x49')]=function(_0x56f02d,_0x475709,_0xc015b){return db['sequelize'][_0x2ca6('0x4a')](function(_0x3ad8a2){if(_0x56f02d['body'][_0x2ca6('0x4b')]==='files'){_0x56f02d[_0x2ca6('0x48')][_0x2ca6('0x4c')]=path[_0x2ca6('0x4d')](config[_0x2ca6('0x4e')],_0x2ca6('0x4f'),_0x56f02d[_0x2ca6('0x48')]['name']);}return db[_0x2ca6('0x29')]['create'](_0x56f02d[_0x2ca6('0x48')],{'transaction':_0x3ad8a2})['then'](function(_0x266068){if(_0x56f02d[_0x2ca6('0x48')][_0x2ca6('0x4b')]==='files'){fs['mkdirSync'](_0x266068[_0x2ca6('0x4c')],parseInt(_0x2ca6('0x50'),0x8));}var _0x550012=_0x56f02d[_0x2ca6('0x51')][_0x2ca6('0x23')]({'plain':!![]});if(!_0x550012)throw new Error(_0x2ca6('0x52'));if(_0x550012['role']===_0x2ca6('0x51')){var _0x4741e2=_0x266068['get']({'plain':!![]});return db['UserProfileSection'][_0x2ca6('0x47')]({'where':{'name':_0x2ca6('0x24'),'userProfileId':_0x550012[_0x2ca6('0x53')]},'raw':!![]})[_0x2ca6('0x22')](function(_0x42f5bb){if(_0x42f5bb&&_0x42f5bb[_0x2ca6('0x54')]===0x0){return db[_0x2ca6('0x25')][_0x2ca6('0x49')]({'name':_0x4741e2[_0x2ca6('0x3b')],'resourceId':_0x4741e2['id'],'type':_0x42f5bb['name'],'sectionId':_0x42f5bb['id']},{})['then'](function(){return _0x266068;});}else{return _0x266068;}})[_0x2ca6('0x41')](function(_0x15ba7c){logger[_0x2ca6('0x26')](_0x2ca6('0x55'),_0x15ba7c);});}return _0x266068;});})[_0x2ca6('0x22')](respondWithResult(_0x475709,0xc9))[_0x2ca6('0x41')](handleError(_0x475709,null));};exports['destroy']=function(_0x172abe,_0x2b6996,_0x4add4d){var _0x593747;return db[_0x2ca6('0x29')][_0x2ca6('0x47')]({'where':{'id':_0x172abe['params']['id']}})['then'](function(_0x4515fb){if(_0x4515fb){return db[_0x2ca6('0x56')]['transaction'](function(_0x5c157d){return _0x4515fb['destroy']({'transaction':_0x5c157d,'raw':!![]})[_0x2ca6('0x22')](function(_0x187171){if(_0x187171[_0x2ca6('0x4c')]){fs['readdirSync'](_0x187171[_0x2ca6('0x4c')])[_0x2ca6('0x57')](function(_0xf188c6){fs[_0x2ca6('0x58')](path[_0x2ca6('0x4d')](_0x187171[_0x2ca6('0x4c')],_0xf188c6));});fs['rmdirSync'](_0x187171[_0x2ca6('0x4c')]);}return _0x187171;});})['catch'](function(_0xbf43fc){throw new db['Sequelize'][(_0x2ca6('0x59'))](_0xbf43fc[_0x2ca6('0x5a')]);});}})[_0x2ca6('0x22')](handleEntityNotFound(_0x2b6996,null))[_0x2ca6('0x22')](removeEntity(_0x2b6996,null))[_0x2ca6('0x41')](handleError(_0x2b6996,null));};exports[_0x2ca6('0x5b')]=function(_0x7956,_0x4a1396,_0x4fc9e0){return db[_0x2ca6('0x56')][_0x2ca6('0x4a')](function(_0x28bbc0){var _0x4c5819;return db[_0x2ca6('0x29')][_0x2ca6('0x47')]({'where':{'id':_0x7956[_0x2ca6('0x43')]['id']}})[_0x2ca6('0x22')](function(_0x4d28b6){if(_0x4d28b6){_0x4c5819=_0x4d28b6;return _0x4d28b6['addSound'](_0x7956[_0x2ca6('0x48')]['id'],{'transaction':_0x28bbc0});}})[_0x2ca6('0x22')](function(_0x27729e){if(_0x27729e){return db['Sound'][_0x2ca6('0x5c')]({'where':{'id':_0x7956['body']['id']},'attributes':['id',_0x2ca6('0x3b'),'save_name',_0x2ca6('0x5d'),'createdAt'],'raw':!![]});}})['then'](function(_0x479ed7){if(_0x479ed7){var _0xfd2f78=path['join'](config[_0x2ca6('0x4e')],_0x2ca6('0x5e'),util[_0x2ca6('0x5f')]('%s.%s',path[_0x2ca6('0x60')](_0x479ed7['save_name'],path[_0x2ca6('0x61')](_0x479ed7[_0x2ca6('0x62')])),_0x479ed7['converted_format']));var _0x5ef52f=path[_0x2ca6('0x4d')](config[_0x2ca6('0x4e')],_0x2ca6('0x4f'),_0x4c5819[_0x2ca6('0x3b')],util[_0x2ca6('0x5f')]('%s.%s',_0x479ed7[_0x2ca6('0x3b')],_0x479ed7[_0x2ca6('0x5d')]));fs[_0x2ca6('0x63')](_0xfd2f78,_0x5ef52f);return _0x479ed7;}})[_0x2ca6('0x41')](function(_0x4d5297){throw new db[(_0x2ca6('0x64'))]['ValidationError'](_0x4d5297[_0x2ca6('0x5a')]);});})[_0x2ca6('0x22')](handleEntityNotFound(_0x4a1396,null))[_0x2ca6('0x22')](respondWithResult(_0x4a1396,0xc9))[_0x2ca6('0x41')](handleError(_0x4a1396,null));};exports[_0x2ca6('0x65')]=function(_0x121cb7,_0x259da6,_0x470b27){return db['sequelize']['transaction'](function(_0x5431f5){var _0x143d70;return db[_0x2ca6('0x29')][_0x2ca6('0x5c')]({'where':{'id':_0x121cb7[_0x2ca6('0x43')]['id']}})['then'](handleEntityNotFound(_0x259da6,null))['then'](function(_0x439a2a){if(_0x439a2a){_0x143d70=_0x439a2a;return _0x439a2a[_0x2ca6('0x65')](_0x121cb7[_0x2ca6('0x43')][_0x2ca6('0x66')]);}})[_0x2ca6('0x22')](function(_0x2bb2c5){if(_0x2bb2c5){return db['Sound']['findOne']({'where':{'id':_0x121cb7[_0x2ca6('0x43')]['id2']},'attributes':['id',_0x2ca6('0x3b'),_0x2ca6('0x62'),_0x2ca6('0x5d'),_0x2ca6('0x67')],'raw':!![]});}})[_0x2ca6('0x22')](function(_0x2928e2){if(_0x2928e2){fs[_0x2ca6('0x58')](path[_0x2ca6('0x4d')](_0x143d70['directory'],util[_0x2ca6('0x5f')]('%s.%s',_0x2928e2[_0x2ca6('0x3b')],_0x2928e2[_0x2ca6('0x5d')])));return _0x2928e2;}})[_0x2ca6('0x41')](function(_0x32780a){throw new db[(_0x2ca6('0x64'))][(_0x2ca6('0x59'))](_0x32780a['message']);});})[_0x2ca6('0x22')](handleEntityNotFound(_0x259da6,null))['then'](respondWithStatusCode(_0x259da6,0xcc))[_0x2ca6('0x41')](handleError(_0x259da6,null));};exports[_0x2ca6('0x68')]=function(_0x20f931,_0x1d3b4b,_0x29fc52){var _0x4d3a1f={};var _0x534e16={};var _0x1f35c9;var _0x37f46d;return db[_0x2ca6('0x29')]['findOne']({'where':{'id':_0x20f931['params']['id']}})['then'](handleEntityNotFound(_0x1d3b4b,null))[_0x2ca6('0x22')](function(_0x405be4){if(_0x405be4){_0x1f35c9=_0x405be4;_0x534e16[_0x2ca6('0x2d')]=_['keys'](db[_0x2ca6('0x69')][_0x2ca6('0x2a')]);_0x534e16[_0x2ca6('0x2e')]=_['keys'](_0x20f931[_0x2ca6('0x2e')]);_0x534e16['filters']=_[_0x2ca6('0x44')](_0x534e16[_0x2ca6('0x2d')],_0x534e16[_0x2ca6('0x2e')]);_0x4d3a1f['attributes']=_[_0x2ca6('0x44')](_0x534e16[_0x2ca6('0x2d')],qs[_0x2ca6('0x32')](_0x20f931['query'][_0x2ca6('0x32')]));_0x4d3a1f[_0x2ca6('0x31')]=_0x4d3a1f[_0x2ca6('0x31')][_0x2ca6('0x45')]?_0x4d3a1f[_0x2ca6('0x31')]:_0x534e16[_0x2ca6('0x2d')];_0x4d3a1f[_0x2ca6('0x34')]=qs[_0x2ca6('0x35')](_0x20f931[_0x2ca6('0x2e')][_0x2ca6('0x35')]);_0x4d3a1f['where']=qs[_0x2ca6('0x30')](_[_0x2ca6('0x37')](_0x20f931[_0x2ca6('0x2e')],_0x534e16[_0x2ca6('0x30')]));if(_0x20f931['query'][_0x2ca6('0x38')]){_0x4d3a1f['where']=_[_0x2ca6('0x3c')](_0x4d3a1f[_0x2ca6('0x36')],{'$or':_[_0x2ca6('0x28')](_0x4d3a1f[_0x2ca6('0x31')],function(_0x5a9322){var _0x5c9a89={};_0x5c9a89[_0x5a9322]={'$like':'%'+_0x20f931[_0x2ca6('0x2e')][_0x2ca6('0x38')]+'%'};return _0x5c9a89;})});}_0x4d3a1f=_['merge']({},_0x4d3a1f,_0x20f931['options']);return _0x1f35c9[_0x2ca6('0x68')](_0x4d3a1f);}})[_0x2ca6('0x22')](function(_0x4d221c){if(_0x4d221c){_0x37f46d=_0x4d221c[_0x2ca6('0x45')];if(!_0x20f931[_0x2ca6('0x2e')][_0x2ca6('0x6a')]('nolimit')){_0x4d3a1f[_0x2ca6('0x19')]=qs[_0x2ca6('0x19')](_0x20f931[_0x2ca6('0x2e')][_0x2ca6('0x19')]);_0x4d3a1f[_0x2ca6('0x18')]=qs['offset'](_0x20f931[_0x2ca6('0x2e')][_0x2ca6('0x18')]);}return _0x1f35c9[_0x2ca6('0x68')](_0x4d3a1f);}})[_0x2ca6('0x22')](function(_0x2a9ef7){if(_0x2a9ef7){return _0x2a9ef7?{'count':_0x37f46d,'rows':_0x2a9ef7}:null;}})[_0x2ca6('0x22')](respondWithResult(_0x1d3b4b,null))['catch'](handleError(_0x1d3b4b,null));}; \ No newline at end of file +var _0x87fa=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','MusicOnHolds','UserProfileResource','stack','send','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','include','rows','catch','show','params','includeAll','options','find','body','create','sequelize','transaction','files','directory','join','root','mode','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','rmdirSync','Sequelize','ValidationError','message','addSound','save_name','converted_format','server/files/sounds/converted','format','%s.%s','basename','server/files/moh','removeSound','findOne','id2','Sound','getSounds','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x87fa,0x1c0));var _0xa87f=function(_0x2a1792,_0x1dcc58){_0x2a1792=_0x2a1792-0x0;var _0x574033=_0x87fa[_0x2a1792];return _0x574033;};'use strict';var emlformat=require(_0xa87f('0x0'));var rimraf=require(_0xa87f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa87f('0x2'));var rp=require('request-promise');var moment=require(_0xa87f('0x3'));var BPromise=require(_0xa87f('0x4'));var Mustache=require(_0xa87f('0x5'));var util=require(_0xa87f('0x6'));var path=require(_0xa87f('0x7'));var sox=require(_0xa87f('0x8'));var csv=require(_0xa87f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa87f('0xa'));var _=require(_0xa87f('0xb'));var squel=require('squel');var crypto=require(_0xa87f('0xc'));var jsforce=require(_0xa87f('0xd'));var deskjs=require(_0xa87f('0xe'));var toCsv=require(_0xa87f('0x9'));var querystring=require(_0xa87f('0xf'));var Papa=require(_0xa87f('0x10'));var Redis=require(_0xa87f('0x11'));var authService=require(_0xa87f('0x12'));var qs=require(_0xa87f('0x13'));var as=require(_0xa87f('0x14'));var hardwareService=require(_0xa87f('0x15'));var logger=require(_0xa87f('0x16'))(_0xa87f('0x17'));var utils=require(_0xa87f('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xa87f('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x40a1a7,_0x11f649){_0x11f649=_0x11f649||0xcc;return function(_0x11965a){if(_0x11965a){return _0x40a1a7[_0xa87f('0x1a')](_0x11f649);}return _0x40a1a7['status'](_0x11f649)[_0xa87f('0x1b')]();};}function respondWithResult(_0x4adaf6,_0x320d6d){_0x320d6d=_0x320d6d||0xc8;return function(_0x1b2bb0){if(_0x1b2bb0){return _0x4adaf6[_0xa87f('0x1c')](_0x320d6d)[_0xa87f('0x1d')](_0x1b2bb0);}};}function respondWithFilteredResult(_0x45a2a5,_0x4165a8){return function(_0x3cb736){if(_0x3cb736){var _0x4c1262=typeof _0x4165a8[_0xa87f('0x1e')]===_0xa87f('0x1f')&&typeof _0x4165a8[_0xa87f('0x20')]===_0xa87f('0x1f');var _0x3cd430=_0x3cb736[_0xa87f('0x21')];var _0xdcda2e=_0x4c1262?0x0:_0x4165a8['offset'];var _0x2f55a7=_0x4c1262?_0x3cb736['count']:_0x4165a8[_0xa87f('0x1e')]+_0x4165a8[_0xa87f('0x20')];var _0xc56ffc;if(_0x2f55a7>=_0x3cd430){_0x2f55a7=_0x3cd430;_0xc56ffc=0xc8;}else{_0xc56ffc=0xce;}_0x45a2a5[_0xa87f('0x1c')](_0xc56ffc);return _0x45a2a5[_0xa87f('0x22')](_0xa87f('0x23'),_0xdcda2e+'-'+_0x2f55a7+'/'+_0x3cd430)[_0xa87f('0x1d')](_0x3cb736);}return null;};}function patchUpdates(_0x50f7f5){return function(_0x5e5ae8){try{jsonpatch[_0xa87f('0x24')](_0x5e5ae8,_0x50f7f5,!![]);}catch(_0x4f645c){return BPromise[_0xa87f('0x25')](_0x4f645c);}return _0x5e5ae8['save']();};}function saveUpdates(_0x440d4f,_0x420dd6){return function(_0x13c32e){if(_0x13c32e){return _0x13c32e[_0xa87f('0x26')](_0x440d4f)[_0xa87f('0x27')](function(_0x23fe21){return _0x23fe21;});}return null;};}function removeEntity(_0xbdc220,_0x4dde19){return function(_0x3206e4){if(_0x3206e4){return _0x3206e4[_0xa87f('0x28')]()[_0xa87f('0x27')](function(){var _0x28ed3f=_0x3206e4[_0xa87f('0x29')]({'plain':!![]});var _0x436545=_0xa87f('0x2a');return db[_0xa87f('0x2b')]['destroy']({'where':{'type':_0x436545,'resourceId':_0x28ed3f['id']}})['then'](function(){return _0x3206e4;});})[_0xa87f('0x27')](function(){_0xbdc220[_0xa87f('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44e54b,_0x50b9f4){return function(_0x561ca3){if(!_0x561ca3){_0x44e54b[_0xa87f('0x1a')](0x194);}return _0x561ca3;};}function handleError(_0x677bdd,_0x2061c0){_0x2061c0=_0x2061c0||0x1f4;return function(_0x386306){logger['error'](_0x386306[_0xa87f('0x2c')]);if(_0x386306['name']){delete _0x386306['name'];}_0x677bdd[_0xa87f('0x1c')](_0x2061c0)[_0xa87f('0x2d')](_0x386306);};}exports['index']=function(_0x2e5a94,_0x233a3d){var _0x2a8ab7={},_0x9a7874={},_0x32b86c={'count':0x0,'rows':[]};var _0x215cb1=_[_0xa87f('0x2e')](db[_0xa87f('0x2f')][_0xa87f('0x30')],function(_0x9bfa35){return{'name':_0x9bfa35[_0xa87f('0x31')],'type':_0x9bfa35[_0xa87f('0x32')][_0xa87f('0x33')]};});_0x9a7874[_0xa87f('0x34')]=_[_0xa87f('0x2e')](_0x215cb1,_0xa87f('0x35'));_0x9a7874[_0xa87f('0x36')]=_[_0xa87f('0x37')](_0x2e5a94['query']);_0x9a7874[_0xa87f('0x38')]=_[_0xa87f('0x39')](_0x9a7874[_0xa87f('0x34')],_0x9a7874['query']);_0x2a8ab7['attributes']=_[_0xa87f('0x39')](_0x9a7874[_0xa87f('0x34')],qs['fields'](_0x2e5a94['query'][_0xa87f('0x3a')]));_0x2a8ab7[_0xa87f('0x3b')]=_0x2a8ab7[_0xa87f('0x3b')][_0xa87f('0x3c')]?_0x2a8ab7['attributes']:_0x9a7874[_0xa87f('0x34')];if(!_0x2e5a94['query'][_0xa87f('0x3d')](_0xa87f('0x3e'))){_0x2a8ab7[_0xa87f('0x20')]=qs[_0xa87f('0x20')](_0x2e5a94[_0xa87f('0x36')][_0xa87f('0x20')]);_0x2a8ab7['offset']=qs[_0xa87f('0x1e')](_0x2e5a94[_0xa87f('0x36')][_0xa87f('0x1e')]);}_0x2a8ab7[_0xa87f('0x3f')]=qs[_0xa87f('0x40')](_0x2e5a94[_0xa87f('0x36')][_0xa87f('0x40')]);delete _0x2e5a94[_0xa87f('0x36')][_0xa87f('0x40')];_0x2a8ab7[_0xa87f('0x41')]=qs[_0xa87f('0x38')](_[_0xa87f('0x42')](_0x2e5a94[_0xa87f('0x36')],_0x9a7874[_0xa87f('0x38')]),_0x215cb1);if(_0x2e5a94[_0xa87f('0x36')]['filter']){_0x2a8ab7[_0xa87f('0x41')]=_['merge'](_0x2a8ab7[_0xa87f('0x41')],{'$or':_[_0xa87f('0x2e')](_0x215cb1,function(_0x450bdc){if(_0x450bdc[_0xa87f('0x32')]!==_0xa87f('0x43')){var _0x36f03d={};_0x36f03d[_0x450bdc[_0xa87f('0x35')]]={'$like':'%'+_0x2e5a94[_0xa87f('0x36')][_0xa87f('0x44')]+'%'};return _0x36f03d;}})});}_0x2a8ab7=_[_0xa87f('0x45')]({},_0x2a8ab7,_0x2e5a94['options']);var _0x36c166={'where':_0x2a8ab7[_0xa87f('0x41')]};return db[_0xa87f('0x2f')][_0xa87f('0x21')](_0x36c166)['then'](function(_0x2e018e){_0x32b86c['count']=_0x2e018e;if(_0x2e5a94['query']['includeAll']){_0x2a8ab7[_0xa87f('0x46')]=[{'all':!![]}];}return db[_0xa87f('0x2f')]['findAll'](_0x2a8ab7);})[_0xa87f('0x27')](function(_0x42f3b5){_0x32b86c[_0xa87f('0x47')]=_0x42f3b5;return _0x32b86c;})[_0xa87f('0x27')](respondWithFilteredResult(_0x233a3d,_0x2a8ab7))[_0xa87f('0x48')](handleError(_0x233a3d,null));};exports[_0xa87f('0x49')]=function(_0x8df194,_0x41720b){var _0xa8ecd7={'raw':![],'where':{'id':_0x8df194[_0xa87f('0x4a')]['id']}},_0x55b811={};_0x55b811[_0xa87f('0x34')]=_[_0xa87f('0x37')](db[_0xa87f('0x2f')][_0xa87f('0x30')]);_0x55b811[_0xa87f('0x36')]=_[_0xa87f('0x37')](_0x8df194[_0xa87f('0x36')]);_0x55b811['filters']=_['intersection'](_0x55b811[_0xa87f('0x34')],_0x55b811['query']);_0xa8ecd7[_0xa87f('0x3b')]=_[_0xa87f('0x39')](_0x55b811[_0xa87f('0x34')],qs[_0xa87f('0x3a')](_0x8df194['query']['fields']));_0xa8ecd7[_0xa87f('0x3b')]=_0xa8ecd7[_0xa87f('0x3b')][_0xa87f('0x3c')]?_0xa8ecd7[_0xa87f('0x3b')]:_0x55b811['model'];if(_0x8df194[_0xa87f('0x36')][_0xa87f('0x4b')]){_0xa8ecd7[_0xa87f('0x46')]=[{'all':!![]}];}_0xa8ecd7=_[_0xa87f('0x45')]({},_0xa8ecd7,_0x8df194[_0xa87f('0x4c')]);return db[_0xa87f('0x2f')][_0xa87f('0x4d')](_0xa8ecd7)[_0xa87f('0x27')](handleEntityNotFound(_0x41720b,null))[_0xa87f('0x27')](respondWithResult(_0x41720b,null))[_0xa87f('0x48')](handleError(_0x41720b,null));};exports[_0xa87f('0x26')]=function(_0x1aba2b,_0x515662){if(_0x1aba2b['body']['id']){delete _0x1aba2b[_0xa87f('0x4e')]['id'];}return db[_0xa87f('0x2f')][_0xa87f('0x4d')]({'where':{'id':_0x1aba2b[_0xa87f('0x4a')]['id']}})[_0xa87f('0x27')](handleEntityNotFound(_0x515662,null))[_0xa87f('0x27')](saveUpdates(_0x1aba2b['body'],null))[_0xa87f('0x27')](respondWithResult(_0x515662,null))[_0xa87f('0x48')](handleError(_0x515662,null));};exports[_0xa87f('0x4f')]=function(_0x7e78b7,_0x2eaf4f,_0x92781){return db[_0xa87f('0x50')][_0xa87f('0x51')](function(_0x46a56f){if(_0x7e78b7['body']['mode']===_0xa87f('0x52')){_0x7e78b7[_0xa87f('0x4e')][_0xa87f('0x53')]=path[_0xa87f('0x54')](config[_0xa87f('0x55')],'server/files/moh',_0x7e78b7[_0xa87f('0x4e')][_0xa87f('0x35')]);}return db[_0xa87f('0x2f')][_0xa87f('0x4f')](_0x7e78b7['body'],{'transaction':_0x46a56f})[_0xa87f('0x27')](function(_0x55a8b2){if(_0x7e78b7[_0xa87f('0x4e')][_0xa87f('0x56')]===_0xa87f('0x52')){fs[_0xa87f('0x57')](_0x55a8b2[_0xa87f('0x53')],parseInt(_0xa87f('0x58'),0x8));}var _0x2e2e5b=_0x7e78b7[_0xa87f('0x59')][_0xa87f('0x29')]({'plain':!![]});if(!_0x2e2e5b)throw new Error(_0xa87f('0x5a'));if(_0x2e2e5b[_0xa87f('0x5b')]==='user'){var _0x37c9b9=_0x55a8b2['get']({'plain':!![]});return db[_0xa87f('0x5c')][_0xa87f('0x4d')]({'where':{'name':'MusicOnHolds','userProfileId':_0x2e2e5b[_0xa87f('0x5d')]},'raw':!![]})['then'](function(_0x2c830a){if(_0x2c830a&&_0x2c830a[_0xa87f('0x5e')]===0x0){return db[_0xa87f('0x2b')]['create']({'name':_0x37c9b9[_0xa87f('0x35')],'resourceId':_0x37c9b9['id'],'type':_0x2c830a[_0xa87f('0x35')],'sectionId':_0x2c830a['id']},{})[_0xa87f('0x27')](function(){return _0x55a8b2;});}else{return _0x55a8b2;}})[_0xa87f('0x48')](function(_0x8759d3){logger[_0xa87f('0x5f')](_0xa87f('0x60'),_0x8759d3);});}return _0x55a8b2;});})[_0xa87f('0x27')](respondWithResult(_0x2eaf4f,0xc9))['catch'](handleError(_0x2eaf4f,null));};exports[_0xa87f('0x28')]=function(_0x2743f7,_0x3ac48a,_0x51b4af){var _0xef40c6;return db[_0xa87f('0x2f')][_0xa87f('0x4d')]({'where':{'id':_0x2743f7[_0xa87f('0x4a')]['id']}})[_0xa87f('0x27')](function(_0x366df8){if(_0x366df8){return db[_0xa87f('0x50')][_0xa87f('0x51')](function(_0x4efaf7){return _0x366df8[_0xa87f('0x28')]({'transaction':_0x4efaf7,'raw':!![]})[_0xa87f('0x27')](function(_0x5e6063){if(_0x5e6063[_0xa87f('0x53')]){fs[_0xa87f('0x61')](_0x5e6063[_0xa87f('0x53')])[_0xa87f('0x62')](function(_0x556955){fs['unlinkSync'](path['join'](_0x5e6063[_0xa87f('0x53')],_0x556955));});fs[_0xa87f('0x63')](_0x5e6063[_0xa87f('0x53')]);}return _0x5e6063;});})[_0xa87f('0x48')](function(_0x5785e1){throw new db[(_0xa87f('0x64'))][(_0xa87f('0x65'))](_0x5785e1[_0xa87f('0x66')]);});}})[_0xa87f('0x27')](handleEntityNotFound(_0x3ac48a,null))[_0xa87f('0x27')](removeEntity(_0x3ac48a,null))[_0xa87f('0x48')](handleError(_0x3ac48a,null));};exports[_0xa87f('0x67')]=function(_0x2fce32,_0x49a954,_0x409843){return db['sequelize'][_0xa87f('0x51')](function(_0x5aa4c4){var _0x5bb920;return db['VoiceMusicOnHold'][_0xa87f('0x4d')]({'where':{'id':_0x2fce32[_0xa87f('0x4a')]['id']}})[_0xa87f('0x27')](function(_0x126d53){if(_0x126d53){_0x5bb920=_0x126d53;return _0x126d53['addSound'](_0x2fce32[_0xa87f('0x4e')]['id'],{'transaction':_0x5aa4c4});}})[_0xa87f('0x27')](function(_0xd4ec4a){if(_0xd4ec4a){return db['Sound']['findOne']({'where':{'id':_0x2fce32[_0xa87f('0x4e')]['id']},'attributes':['id','name',_0xa87f('0x68'),_0xa87f('0x69'),'createdAt'],'raw':!![]});}})[_0xa87f('0x27')](function(_0x306c56){if(_0x306c56){var _0x49467d=path['join'](config[_0xa87f('0x55')],_0xa87f('0x6a'),util[_0xa87f('0x6b')](_0xa87f('0x6c'),path[_0xa87f('0x6d')](_0x306c56[_0xa87f('0x68')],path['extname'](_0x306c56[_0xa87f('0x68')])),_0x306c56['converted_format']));var _0xa49b46=path[_0xa87f('0x54')](config[_0xa87f('0x55')],_0xa87f('0x6e'),_0x5bb920[_0xa87f('0x35')],util['format']('%s.%s',_0x306c56['name'],_0x306c56[_0xa87f('0x69')]));fs['symlinkSync'](_0x49467d,_0xa49b46);return _0x306c56;}})[_0xa87f('0x48')](function(_0x3b22a1){throw new db[(_0xa87f('0x64'))][(_0xa87f('0x65'))](_0x3b22a1[_0xa87f('0x66')]);});})[_0xa87f('0x27')](handleEntityNotFound(_0x49a954,null))[_0xa87f('0x27')](respondWithResult(_0x49a954,0xc9))[_0xa87f('0x48')](handleError(_0x49a954,null));};exports[_0xa87f('0x6f')]=function(_0x43cb3e,_0x5d6752,_0x3f899c){return db[_0xa87f('0x50')]['transaction'](function(_0x2259c5){var _0x55f90e;return db[_0xa87f('0x2f')][_0xa87f('0x70')]({'where':{'id':_0x43cb3e[_0xa87f('0x4a')]['id']}})[_0xa87f('0x27')](handleEntityNotFound(_0x5d6752,null))['then'](function(_0x3793f4){if(_0x3793f4){_0x55f90e=_0x3793f4;return _0x3793f4['removeSound'](_0x43cb3e[_0xa87f('0x4a')][_0xa87f('0x71')]);}})[_0xa87f('0x27')](function(_0x141706){if(_0x141706){return db[_0xa87f('0x72')][_0xa87f('0x70')]({'where':{'id':_0x43cb3e[_0xa87f('0x4a')]['id2']},'attributes':['id',_0xa87f('0x35'),_0xa87f('0x68'),_0xa87f('0x69'),'createdAt'],'raw':!![]});}})['then'](function(_0x1e9b13){if(_0x1e9b13){fs['unlinkSync'](path[_0xa87f('0x54')](_0x55f90e[_0xa87f('0x53')],util[_0xa87f('0x6b')](_0xa87f('0x6c'),_0x1e9b13['name'],_0x1e9b13[_0xa87f('0x69')])));return _0x1e9b13;}})['catch'](function(_0x21ff5c){throw new db[(_0xa87f('0x64'))][(_0xa87f('0x65'))](_0x21ff5c[_0xa87f('0x66')]);});})[_0xa87f('0x27')](handleEntityNotFound(_0x5d6752,null))[_0xa87f('0x27')](respondWithStatusCode(_0x5d6752,0xcc))[_0xa87f('0x48')](handleError(_0x5d6752,null));};exports['getSounds']=function(_0x529f7d,_0x2d41ed,_0x646bf8){var _0x3810bd={};var _0x341247={};var _0x325edf;var _0x4458ac;return db[_0xa87f('0x2f')][_0xa87f('0x70')]({'where':{'id':_0x529f7d['params']['id']}})['then'](handleEntityNotFound(_0x2d41ed,null))[_0xa87f('0x27')](function(_0x5c9be3){if(_0x5c9be3){_0x325edf=_0x5c9be3;_0x341247[_0xa87f('0x34')]=_[_0xa87f('0x37')](db['Sound'][_0xa87f('0x30')]);_0x341247[_0xa87f('0x36')]=_['keys'](_0x529f7d[_0xa87f('0x36')]);_0x341247['filters']=_['intersection'](_0x341247[_0xa87f('0x34')],_0x341247[_0xa87f('0x36')]);_0x3810bd[_0xa87f('0x3b')]=_[_0xa87f('0x39')](_0x341247['model'],qs['fields'](_0x529f7d[_0xa87f('0x36')][_0xa87f('0x3a')]));_0x3810bd[_0xa87f('0x3b')]=_0x3810bd[_0xa87f('0x3b')][_0xa87f('0x3c')]?_0x3810bd[_0xa87f('0x3b')]:_0x341247[_0xa87f('0x34')];_0x3810bd['order']=qs[_0xa87f('0x40')](_0x529f7d[_0xa87f('0x36')][_0xa87f('0x40')]);_0x3810bd[_0xa87f('0x41')]=qs[_0xa87f('0x38')](_['pick'](_0x529f7d[_0xa87f('0x36')],_0x341247[_0xa87f('0x38')]));if(_0x529f7d[_0xa87f('0x36')][_0xa87f('0x44')]){_0x3810bd[_0xa87f('0x41')]=_[_0xa87f('0x45')](_0x3810bd[_0xa87f('0x41')],{'$or':_[_0xa87f('0x2e')](_0x3810bd[_0xa87f('0x3b')],function(_0x24ebbb){var _0x274cb3={};_0x274cb3[_0x24ebbb]={'$like':'%'+_0x529f7d[_0xa87f('0x36')][_0xa87f('0x44')]+'%'};return _0x274cb3;})});}_0x3810bd=_[_0xa87f('0x45')]({},_0x3810bd,_0x529f7d['options']);return _0x325edf[_0xa87f('0x73')](_0x3810bd);}})[_0xa87f('0x27')](function(_0x36142c){if(_0x36142c){_0x4458ac=_0x36142c['length'];if(!_0x529f7d['query'][_0xa87f('0x3d')]('nolimit')){_0x3810bd[_0xa87f('0x20')]=qs['limit'](_0x529f7d['query']['limit']);_0x3810bd[_0xa87f('0x1e')]=qs['offset'](_0x529f7d['query']['offset']);}return _0x325edf[_0xa87f('0x73')](_0x3810bd);}})[_0xa87f('0x27')](function(_0x2625a3){if(_0x2625a3){return _0x2625a3?{'count':_0x4458ac,'rows':_0x2625a3}:null;}})[_0xa87f('0x27')](respondWithResult(_0x2d41ed,null))[_0xa87f('0x48')](handleError(_0x2d41ed,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 49b4e13..9dde6ef 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x10a4=['define','VoiceMusicOnHold','voice_musiconhold','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x19228b,_0x4cca2c){var _0x3bb354=function(_0x3c0cc9){while(--_0x3c0cc9){_0x19228b['push'](_0x19228b['shift']());}};_0x3bb354(++_0x4cca2c);}(_0x10a4,0x10b));var _0x410a=function(_0x234051,_0xcc582f){_0x234051=_0x234051-0x0;var _0x24e238=_0x10a4[_0x234051];return _0x24e238;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x410a('0x0'))(_0x410a('0x1'));var moment=require(_0x410a('0x2'));var BPromise=require(_0x410a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x410a('0x4'));var rimraf=require(_0x410a('0x5'));var config=require(_0x410a('0x6'));var attributes=require('./voiceMusicOnHold.attributes');module[_0x410a('0x7')]=function(_0x5a8617,_0x2f478d){return _0x5a8617[_0x410a('0x8')](_0x410a('0x9'),attributes,{'tableName':_0x410a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcacd=['rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','voice_musiconhold','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x7148b6,_0xa61534){var _0x111019=function(_0x452d96){while(--_0x452d96){_0x7148b6['push'](_0x7148b6['shift']());}};_0x111019(++_0xa61534);}(_0xcacd,0x179));var _0xdcac=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xcacd[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0xdcac('0x0'));var logger=require(_0xdcac('0x1'))(_0xdcac('0x2'));var moment=require(_0xdcac('0x3'));var BPromise=require(_0xdcac('0x4'));var rp=require(_0xdcac('0x5'));var fs=require('fs');var path=require(_0xdcac('0x6'));var rimraf=require(_0xdcac('0x7'));var config=require(_0xdcac('0x8'));var attributes=require(_0xdcac('0x9'));module[_0xdcac('0xa')]=function(_0x1a54fa,_0x318879){return _0x1a54fa['define']('VoiceMusicOnHold',attributes,{'tableName':_0xdcac('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index d54ec3c..fad0296 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x50d1da,_0x5cb3ed){var _0x109fc1=function(_0x41a3f8){while(--_0x41a3f8){_0x50d1da['push'](_0x50d1da['shift']());}};_0x109fc1(++_0x5cb3ed);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file +var _0xa9e0=['http','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xee97d9,_0x4d00a0){var _0x1a9333=function(_0x1a8b61){while(--_0x1a8b61){_0xee97d9['push'](_0xee97d9['shift']());}};_0x1a9333(++_0x4d00a0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index da5d3a8..97c7649 100644 --- a/server/api/voicePrefix/index.js +++ b/server/api/voicePrefix/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c58=['getTeams','post','create','addAgents','/:id/teams','addTeams','delete','removeAgents','removeTeams','exports','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','get','/:id','show','/:id/users','getAgents'];(function(_0x5b754d,_0x5192ff){var _0x423e2e=function(_0x115138){while(--_0x115138){_0x5b754d['push'](_0x5b754d['shift']());}};_0x423e2e(++_0x5192ff);}(_0x5c58,0x154));var _0x85c5=function(_0x21f33c,_0x150610){_0x21f33c=_0x21f33c-0x0;var _0xc255b5=_0x5c58[_0x21f33c];return _0xc255b5;};'use strict';var multer=require('multer');var util=require(_0x85c5('0x0'));var path=require(_0x85c5('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x85c5('0x2')]();var fs_extra=require(_0x85c5('0x3'));var auth=require(_0x85c5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x85c5('0x5'));var controller=require('./voicePrefix.controller');router['get']('/',auth[_0x85c5('0x6')](),controller['index']);router[_0x85c5('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x85c5('0x7')](_0x85c5('0x8'),auth['isAuthenticated'](),controller[_0x85c5('0x9')]);router['get'](_0x85c5('0xa'),auth[_0x85c5('0x6')](),controller[_0x85c5('0xb')]);router[_0x85c5('0x7')]('/:id/teams',auth[_0x85c5('0x6')](),controller[_0x85c5('0xc')]);router[_0x85c5('0xd')]('/',auth[_0x85c5('0x6')](),controller[_0x85c5('0xe')]);router['post'](_0x85c5('0xa'),auth[_0x85c5('0x6')](),controller[_0x85c5('0xf')]);router[_0x85c5('0xd')](_0x85c5('0x10'),auth['isAuthenticated'](),controller[_0x85c5('0x11')]);router['put'](_0x85c5('0x8'),auth[_0x85c5('0x6')](),controller['update']);router[_0x85c5('0x12')](_0x85c5('0x8'),auth['isAuthenticated'](),controller['destroy']);router[_0x85c5('0x12')]('/:id/users',auth[_0x85c5('0x6')](),controller[_0x85c5('0x13')]);router[_0x85c5('0x12')](_0x85c5('0x10'),auth['isAuthenticated'](),controller[_0x85c5('0x14')]);module[_0x85c5('0x15')]=router; \ No newline at end of file +var _0x50a6=['../../components/auth/service','../../components/interaction/service','./voicePrefix.controller','index','get','/describe','isAuthenticated','show','/:id/users','post','create','addAgents','/:id/teams','addTeams','put','/:id','delete','destroy','removeTeams','exports','multer','util','express','fs-extra'];(function(_0x3ccdf8,_0x584ceb){var _0x243dab=function(_0x1a90d1){while(--_0x1a90d1){_0x3ccdf8['push'](_0x3ccdf8['shift']());}};_0x243dab(++_0x584ceb);}(_0x50a6,0xa4));var _0x650a=function(_0xd40d77,_0x101b68){_0xd40d77=_0xd40d77-0x0;var _0x5f062a=_0x50a6[_0xd40d77];return _0x5f062a;};'use strict';var multer=require(_0x650a('0x0'));var util=require(_0x650a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x650a('0x2'));var router=express['Router']();var fs_extra=require(_0x650a('0x3'));var auth=require(_0x650a('0x4'));var interaction=require(_0x650a('0x5'));var config=require('../../config/environment');var controller=require(_0x650a('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x650a('0x7')]);router[_0x650a('0x8')](_0x650a('0x9'),auth[_0x650a('0xa')](),controller['describe']);router[_0x650a('0x8')]('/:id',auth[_0x650a('0xa')](),controller[_0x650a('0xb')]);router['get'](_0x650a('0xc'),auth[_0x650a('0xa')](),controller['getAgents']);router[_0x650a('0x8')]('/:id/teams',auth[_0x650a('0xa')](),controller['getTeams']);router[_0x650a('0xd')]('/',auth['isAuthenticated'](),controller[_0x650a('0xe')]);router['post'](_0x650a('0xc'),auth[_0x650a('0xa')](),controller[_0x650a('0xf')]);router['post'](_0x650a('0x10'),auth[_0x650a('0xa')](),controller[_0x650a('0x11')]);router[_0x650a('0x12')](_0x650a('0x13'),auth[_0x650a('0xa')](),controller['update']);router[_0x650a('0x14')]('/:id',auth[_0x650a('0xa')](),controller[_0x650a('0x15')]);router[_0x650a('0x14')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);router['delete'](_0x650a('0x10'),auth[_0x650a('0xa')](),controller[_0x650a('0x16')]);module[_0x650a('0x17')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 19c04bb..23b5f5e 100644 --- a/server/api/voicePrefix/voicePrefix.attributes.js +++ b/server/api/voicePrefix/voicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x90b6=['STRING','name','VIRTUAL','system-','getDataValue','INTEGER','sequelize','exports'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x90b6,0x17e));var _0x690b=function(_0x379a4d,_0x4d3593){_0x379a4d=_0x379a4d-0x0;var _0x50531a=_0x90b6[_0x379a4d];return _0x50531a;};'use strict';var Sequelize=require(_0x690b('0x0'));module[_0x690b('0x1')]={'name':{'type':Sequelize[_0x690b('0x2')],'allowNull':![],'unique':_0x690b('0x3')},'prefix':{'type':Sequelize[_0x690b('0x4')],'get':function(_0x427c3d){return _0x690b('0x5')+this[_0x690b('0x6')](_0x690b('0x3'))+'-';}},'description':{'type':Sequelize[_0x690b('0x2')]},'callerIdAll':{'type':Sequelize[_0x690b('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x690b('0x7')]}}; \ No newline at end of file +var _0x42f2=['STRING','name','system-','getDataValue','INTEGER','sequelize','exports'];(function(_0xab4f66,_0x58b710){var _0x43cc05=function(_0x56d32a){while(--_0x56d32a){_0xab4f66['push'](_0xab4f66['shift']());}};_0x43cc05(++_0x58b710);}(_0x42f2,0x1e1));var _0x242f=function(_0x5055f1,_0x3cbb87){_0x5055f1=_0x5055f1-0x0;var _0x28a9f0=_0x42f2[_0x5055f1];return _0x28a9f0;};'use strict';var Sequelize=require(_0x242f('0x0'));module[_0x242f('0x1')]={'name':{'type':Sequelize[_0x242f('0x2')],'allowNull':![],'unique':_0x242f('0x3')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x5216ec){return _0x242f('0x4')+this[_0x242f('0x5')](_0x242f('0x3'))+'-';}},'description':{'type':Sequelize[_0x242f('0x2')]},'callerIdAll':{'type':Sequelize[_0x242f('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x242f('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index d039990..af8074f 100644 --- a/server/api/voicePrefix/voicePrefix.controller.js +++ b/server/api/voicePrefix/voicePrefix.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda2d=['UserProfileResource','destroy','stack','name','index','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','filter','VoicePrefix','includeAll','findAll','catch','show','params','rawAttributes','include','find','describe','create','sequelize','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','push','Set','PREFIX-CALLERIDALL=','${EXTEN:','charAt','update','system-','transaction','findById','addAgents','ids','omit','spread','emit','removeAgents','isArray','userVoicePrefix:remove','getAgents','User','options','getTeams','findOne','Team','online','voicePause','interface','flatMap','Agents','addTeams','each','UserVoicePrefix','forEach','userVoicePrefix:save','removeTeams','field','tq.TeamId','from','user_has_teams','VoicePrefixId\x20=\x20?','clone','toString','TeamId','includes','all','union','compact','value','isEmpty','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','get','VoicePrefixes'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xda2d,0x102));var _0xdda2=function(_0x6e5053,_0x48b8ed){_0x6e5053=_0x6e5053-0x0;var _0x11d345=_0xda2d[_0x6e5053];return _0x11d345;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdda2('0x0'));var zipdir=require(_0xdda2('0x1'));var jsonpatch=require(_0xdda2('0x2'));var rp=require(_0xdda2('0x3'));var moment=require(_0xdda2('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xdda2('0x5'));var sox=require(_0xdda2('0x6'));var csv=require(_0xdda2('0x7'));var ejs=require(_0xdda2('0x8'));var fs=require('fs');var fs_extra=require(_0xdda2('0x9'));var _=require(_0xdda2('0xa'));var squel=require(_0xdda2('0xb'));var crypto=require(_0xdda2('0xc'));var jsforce=require(_0xdda2('0xd'));var deskjs=require(_0xdda2('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdda2('0xf'));var Papa=require(_0xdda2('0x10'));var Redis=require('ioredis');var authService=require(_0xdda2('0x11'));var qs=require(_0xdda2('0x12'));var as=require(_0xdda2('0x13'));var hardwareService=require(_0xdda2('0x14'));var logger=require(_0xdda2('0x15'))(_0xdda2('0x16'));var utils=require(_0xdda2('0x17'));var config=require(_0xdda2('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0xdda2('0x19')](config[_0xdda2('0x1a')],{'host':_0xdda2('0x1b'),'port':0x18eb});var socket=require(_0xdda2('0x1c'))(new Redis(config[_0xdda2('0x1a')]));require(_0xdda2('0x1d'))[_0xdda2('0x1e')](socket);function respondWithStatusCode(_0x4df902,_0x79c6d4){_0x79c6d4=_0x79c6d4||0xcc;return function(_0x4b0220){if(_0x4b0220){return _0x4df902[_0xdda2('0x1f')](_0x79c6d4);}return _0x4df902[_0xdda2('0x20')](_0x79c6d4)[_0xdda2('0x21')]();};}function respondWithResult(_0x457764,_0x1922b1){_0x1922b1=_0x1922b1||0xc8;return function(_0x5d8a83){if(_0x5d8a83){return _0x457764['status'](_0x1922b1)[_0xdda2('0x22')](_0x5d8a83);}};}function respondWithFilteredResult(_0x518c6d,_0x1a5192){return function(_0x1a3b35){if(_0x1a3b35){var _0x335fb5=typeof _0x1a5192[_0xdda2('0x23')]===_0xdda2('0x24')&&typeof _0x1a5192[_0xdda2('0x25')]===_0xdda2('0x24');var _0x351151=_0x1a3b35[_0xdda2('0x26')];var _0x337b0b=_0x335fb5?0x0:_0x1a5192[_0xdda2('0x23')];var _0x6fdede=_0x335fb5?_0x1a3b35['count']:_0x1a5192[_0xdda2('0x23')]+_0x1a5192['limit'];var _0xc4567c;if(_0x6fdede>=_0x351151){_0x6fdede=_0x351151;_0xc4567c=0xc8;}else{_0xc4567c=0xce;}_0x518c6d[_0xdda2('0x20')](_0xc4567c);return _0x518c6d[_0xdda2('0x27')]('Content-Range',_0x337b0b+'-'+_0x6fdede+'/'+_0x351151)[_0xdda2('0x22')](_0x1a3b35);}return null;};}function patchUpdates(_0x5a9bb8){return function(_0x425489){try{jsonpatch[_0xdda2('0x28')](_0x425489,_0x5a9bb8,!![]);}catch(_0x4ac3eb){return BPromise[_0xdda2('0x29')](_0x4ac3eb);}return _0x425489[_0xdda2('0x2a')]();};}function saveUpdates(_0x2528d7,_0x13b0f3){return function(_0x45ee9d){if(_0x45ee9d){return _0x45ee9d['update'](_0x2528d7)[_0xdda2('0x2b')](function(_0x4be5ea){return _0x4be5ea;});}return null;};}function removeEntity(_0x2391a5,_0x31d48b){return function(_0x5436d1){if(_0x5436d1){return _0x5436d1['destroy']()[_0xdda2('0x2b')](function(){var _0x4567e7=_0x5436d1[_0xdda2('0x2c')]({'plain':!![]});var _0x5e9e74=_0xdda2('0x2d');return db[_0xdda2('0x2e')][_0xdda2('0x2f')]({'where':{'type':_0x5e9e74,'resourceId':_0x4567e7['id']}})[_0xdda2('0x2b')](function(){return _0x5436d1;});})[_0xdda2('0x2b')](function(){_0x2391a5[_0xdda2('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24c37d,_0x255bbc){return function(_0x53acb5){if(!_0x53acb5){_0x24c37d[_0xdda2('0x1f')](0x194);}return _0x53acb5;};}function handleError(_0x2cfaca,_0x3b18b8){_0x3b18b8=_0x3b18b8||0x1f4;return function(_0x15e511){logger['error'](_0x15e511[_0xdda2('0x30')]);if(_0x15e511[_0xdda2('0x31')]){delete _0x15e511['name'];}_0x2cfaca[_0xdda2('0x20')](_0x3b18b8)['send'](_0x15e511);};}exports[_0xdda2('0x32')]=function(_0x55809a,_0x53ff76){var _0x510b7b={},_0x239c25={},_0x5bfc17={'count':0x0,'rows':[]};var _0x1b13f4=_['map'](db['VoicePrefix']['rawAttributes'],function(_0x4637c1){return{'name':_0x4637c1[_0xdda2('0x33')],'type':_0x4637c1[_0xdda2('0x34')][_0xdda2('0x35')]};});_0x239c25[_0xdda2('0x36')]=_[_0xdda2('0x37')](_0x1b13f4,_0xdda2('0x31'));_0x239c25[_0xdda2('0x38')]=_[_0xdda2('0x39')](_0x55809a[_0xdda2('0x38')]);_0x239c25['filters']=_[_0xdda2('0x3a')](_0x239c25[_0xdda2('0x36')],_0x239c25[_0xdda2('0x38')]);_0x510b7b[_0xdda2('0x3b')]=_[_0xdda2('0x3a')](_0x239c25[_0xdda2('0x36')],qs[_0xdda2('0x3c')](_0x55809a['query']['fields']));_0x510b7b[_0xdda2('0x3b')]=_0x510b7b[_0xdda2('0x3b')][_0xdda2('0x3d')]?_0x510b7b['attributes']:_0x239c25['model'];if(!_0x55809a[_0xdda2('0x38')][_0xdda2('0x3e')](_0xdda2('0x3f'))){_0x510b7b[_0xdda2('0x25')]=qs[_0xdda2('0x25')](_0x55809a['query'][_0xdda2('0x25')]);_0x510b7b[_0xdda2('0x23')]=qs['offset'](_0x55809a['query'][_0xdda2('0x23')]);}_0x510b7b[_0xdda2('0x40')]=qs[_0xdda2('0x41')](_0x55809a[_0xdda2('0x38')][_0xdda2('0x41')]);_0x510b7b['where']=qs[_0xdda2('0x42')](_[_0xdda2('0x43')](_0x55809a[_0xdda2('0x38')],_0x239c25[_0xdda2('0x42')]),_0x1b13f4);if(_0x55809a['query']['filter']){_0x510b7b[_0xdda2('0x44')]=_[_0xdda2('0x45')](_0x510b7b[_0xdda2('0x44')],{'$or':_['map'](_0x1b13f4,function(_0x1bb2a7){if(_0x1bb2a7['type']!==_0xdda2('0x46')){var _0x4c68d7={};_0x4c68d7[_0x1bb2a7[_0xdda2('0x31')]]={'$like':'%'+_0x55809a[_0xdda2('0x38')][_0xdda2('0x47')]+'%'};return _0x4c68d7;}})});}_0x510b7b=_[_0xdda2('0x45')]({},_0x510b7b,_0x55809a['options']);var _0x1c5195={'where':_0x510b7b['where']};return db[_0xdda2('0x48')]['count'](_0x1c5195)[_0xdda2('0x2b')](function(_0x12589b){_0x5bfc17[_0xdda2('0x26')]=_0x12589b;if(_0x55809a[_0xdda2('0x38')][_0xdda2('0x49')]){_0x510b7b['include']=[{'all':!![]}];}return db[_0xdda2('0x48')][_0xdda2('0x4a')](_0x510b7b);})['then'](function(_0x2caced){_0x5bfc17['rows']=_0x2caced;return _0x5bfc17;})[_0xdda2('0x2b')](respondWithFilteredResult(_0x53ff76,_0x510b7b))[_0xdda2('0x4b')](handleError(_0x53ff76,null));};exports[_0xdda2('0x4c')]=function(_0x355b6a,_0x3f1f9b){var _0x6718ea={'raw':![],'where':{'id':_0x355b6a[_0xdda2('0x4d')]['id']}},_0x550351={};_0x550351[_0xdda2('0x36')]=_[_0xdda2('0x39')](db[_0xdda2('0x48')][_0xdda2('0x4e')]);_0x550351[_0xdda2('0x38')]=_['keys'](_0x355b6a['query']);_0x550351['filters']=_[_0xdda2('0x3a')](_0x550351[_0xdda2('0x36')],_0x550351['query']);_0x6718ea[_0xdda2('0x3b')]=_[_0xdda2('0x3a')](_0x550351[_0xdda2('0x36')],qs['fields'](_0x355b6a[_0xdda2('0x38')][_0xdda2('0x3c')]));_0x6718ea['attributes']=_0x6718ea['attributes'][_0xdda2('0x3d')]?_0x6718ea['attributes']:_0x550351[_0xdda2('0x36')];if(_0x355b6a['query'][_0xdda2('0x49')]){_0x6718ea[_0xdda2('0x4f')]=[{'all':!![]}];}_0x6718ea=_['merge']({},_0x6718ea,_0x355b6a['options']);return db[_0xdda2('0x48')][_0xdda2('0x50')](_0x6718ea)[_0xdda2('0x2b')](handleEntityNotFound(_0x3f1f9b,null))[_0xdda2('0x2b')](respondWithResult(_0x3f1f9b,null))['catch'](handleError(_0x3f1f9b,null));};exports[_0xdda2('0x2f')]=function(_0x3bba94,_0x3d2cb0){return db[_0xdda2('0x48')][_0xdda2('0x50')]({'where':{'id':_0x3bba94['params']['id']}})[_0xdda2('0x2b')](handleEntityNotFound(_0x3d2cb0,null))[_0xdda2('0x2b')](removeEntity(_0x3d2cb0,null))['catch'](handleError(_0x3d2cb0,null));};exports[_0xdda2('0x51')]=function(_0x123c2d,_0x143670){return db[_0xdda2('0x48')][_0xdda2('0x51')]()[_0xdda2('0x2b')](respondWithResult(_0x143670,null))['catch'](handleError(_0x143670,null));};exports[_0xdda2('0x52')]=function(_0x4a9814,_0x361038){var _0x4a70ff;return db[_0xdda2('0x53')]['transaction'](function(_0x3b5bbf){return db[_0xdda2('0x48')][_0xdda2('0x52')](_0x4a9814[_0xdda2('0x54')],{'transaction':_0x3b5bbf})[_0xdda2('0x2b')](function(_0x2b45f3){_0x4a70ff=_0x2b45f3[_0xdda2('0x2c')]({'plain':!![]});return db[_0xdda2('0x55')]['find']({'where':{'id':_0x4a70ff[_0xdda2('0x56')]},'raw':!![]})[_0xdda2('0x2b')](function(_0x1b24f2){return createVoicePrefixExtensions(_0x4a70ff,_0x1b24f2,_0x3b5bbf);});});})['then'](function(){var _0xf380b0=_0x4a9814[_0xdda2('0x57')]['get']({'plain':!![]});if(!_0xf380b0)throw new Error(_0xdda2('0x58'));if(_0xf380b0['role']===_0xdda2('0x57')){var _0x10fbac=_0x4a70ff;return db[_0xdda2('0x59')][_0xdda2('0x50')]({'where':{'name':_0xdda2('0x2d'),'userProfileId':_0xf380b0['userProfileId']},'raw':!![]})['then'](function(_0x5c2cb2){if(_0x5c2cb2&&_0x5c2cb2[_0xdda2('0x5a')]===0x0){return db[_0xdda2('0x2e')]['create']({'name':_0x10fbac[_0xdda2('0x31')],'resourceId':_0x10fbac['id'],'type':_0x5c2cb2[_0xdda2('0x31')],'sectionId':_0x5c2cb2['id']},{})[_0xdda2('0x2b')](function(){return _0x4a70ff;});}else{return _0x4a70ff;}})['catch'](function(_0x3fd76c){logger[_0xdda2('0x5b')](_0xdda2('0x5c'),_0x3fd76c);throw _0x3fd76c;});}return _0x4a70ff;})['then'](respondWithResult(_0x361038,null))[_0xdda2('0x4b')](handleError(_0x361038,null));};function Extension(_0x4495e5,_0x7eb83f,_0x25c9a9,_0x5d8602){this[_0xdda2('0x5d')]='from-sip';this['exten']=_0x4495e5;this['app']=_0x25c9a9;this[_0xdda2('0x34')]=_0xdda2('0x5e');this[_0xdda2('0x5f')]=_0xdda2('0x60');this[_0xdda2('0x61')]=_0x7eb83f;this[_0xdda2('0x62')]=_0x5d8602;}function createVoicePrefixExtensions(_0x29a739,_0x3ac33a,_0x269ad1){return new BPromise(function(_0x138c2f,_0x26e7de){var _0x5e6dcf=new Extension(formatPrefixName(_0x29a739[_0xdda2('0x63')]),0x1,_0xdda2('0x64'),_0xdda2('0x65'));_0x5e6dcf[_0xdda2('0x66')]=_0x29a739['id'];return db[_0xdda2('0x55')][_0xdda2('0x52')](_0x5e6dcf,{'transaction':_0x269ad1})[_0xdda2('0x2b')](function(_0x57fb41){var _0x23518f=_0x57fb41[_0xdda2('0x2c')]({'plain':!![]});var _0x19e650=_[_0xdda2('0x37')](addVoicePrefixExtensions(_0x29a739,_0x3ac33a),function(_0x44f619){_0x44f619['VoiceExtensionId']=_0x23518f['id'];_0x44f619[_0xdda2('0x66')]=_0x29a739['id'];return _0x44f619;});return db[_0xdda2('0x55')][_0xdda2('0x67')](_0x19e650,{'transaction':_0x269ad1})[_0xdda2('0x2b')](function(_0x21d0e4){if(!_0x21d0e4){return _0x26e7de('Extensions\x20creation\x20failed');}else{return _0x138c2f(_0x21d0e4);}})[_0xdda2('0x4b')](function(_0x18d251){return _0x26e7de(_0x18d251);});});;});};function addVoicePrefixExtensions(_0x3d49e8,_0x4530b7){var _0x1ac15a=[];var _0x5d34d7=formatPrefixName(_0x3d49e8[_0xdda2('0x63')]);_0x1ac15a[_0xdda2('0x68')](new Extension(_0x5d34d7,0x2,_0xdda2('0x69'),'CDR(prefix)='+_0x3d49e8[_0xdda2('0x31')]));if(_0x3d49e8['callerIdAll']){_0x1ac15a[_0xdda2('0x68')](new Extension(_0x5d34d7,0x3,_0xdda2('0x69'),_0xdda2('0x6a')+_0x3d49e8['callerIdAll']));}else{_0x1ac15a[_0xdda2('0x68')](new Extension(_0x5d34d7,0x3,_0xdda2('0x64'),'No\x20callerid\x20available'));}_0x1ac15a[_0xdda2('0x68')](new Extension(_0x5d34d7,0x4,'goto',_0x4530b7[_0xdda2('0x5d')]+','+_0xdda2('0x6b')+(0x8+_0x3d49e8[_0xdda2('0x31')][_0xdda2('0x3d')])+'}'+','+0x1));return _0x1ac15a;}function formatPrefixName(_0x10d1de){var _0x4a061a='_';for(var _0x586ca1=0x0;_0x586ca1<_0x10d1de[_0xdda2('0x3d')];_0x586ca1++){if(_0x10d1de[_0xdda2('0x6c')](_0x586ca1)=='-'){_0x4a061a+=_0x10d1de['charAt'](_0x586ca1);}else{_0x4a061a+='['+_0x10d1de['charAt'](_0x586ca1)+']';}}_0x4a061a+='.';return _0x4a061a;}exports[_0xdda2('0x6d')]=function(_0x501336,_0x12a052,_0x1a33ba){var _0x4910a6=_0x501336[_0xdda2('0x54')];_0x4910a6[_0xdda2('0x63')]=_0xdda2('0x6e')+_0x4910a6[_0xdda2('0x31')]+'-';return db[_0xdda2('0x53')][_0xdda2('0x6f')](function(_0x4eebb0){return db[_0xdda2('0x48')][_0xdda2('0x6d')](_0x4910a6,{'where':{'id':_0x4910a6['id']},'transaction':_0x4eebb0})[_0xdda2('0x2b')](function(){return db['VoiceExtension'][_0xdda2('0x2f')]({'where':{'VoicePrefixId':_0x4910a6['id']},'transaction':_0x4eebb0})[_0xdda2('0x2b')](function(){return db['VoiceExtension']['find']({'where':{'id':_0x4910a6[_0xdda2('0x56')]},'raw':!![]})[_0xdda2('0x2b')](function(_0x2f03b9){return createVoicePrefixExtensions(_0x4910a6,_0x2f03b9,_0x4eebb0);});});});})['then'](function(){return db['VoicePrefix'][_0xdda2('0x70')](_0x4910a6['id']);})['then'](respondWithResult(_0x12a052,null))[_0xdda2('0x4b')](handleError(_0x12a052,null));};exports[_0xdda2('0x71')]=function(_0x19d92e,_0x12fd67,_0x597b09){return db[_0xdda2('0x48')]['find']({'where':{'id':_0x19d92e['params']['id']}})[_0xdda2('0x2b')](handleEntityNotFound(_0x12fd67,null))['then'](function(_0x2de01c){if(_0x2de01c){return _0x2de01c[_0xdda2('0x71')](_0x19d92e[_0xdda2('0x54')][_0xdda2('0x72')],_[_0xdda2('0x73')](_0x19d92e[_0xdda2('0x54')],[_0xdda2('0x72'),'id'])||{})[_0xdda2('0x74')](function(_0x37c547){for(var _0x495a28=0x0;_0x495a28<_0x19d92e[_0xdda2('0x54')][_0xdda2('0x72')][_0xdda2('0x3d')];_0x495a28+=0x1){socket[_0xdda2('0x75')]('userVoicePrefix:save',{'UserId':Number(_0x19d92e[_0xdda2('0x54')][_0xdda2('0x72')][_0x495a28]),'VoicePrefixId':Number(_0x19d92e[_0xdda2('0x4d')]['id'])});}return _0x37c547;});}})[_0xdda2('0x2b')](respondWithResult(_0x12fd67,null))['catch'](handleError(_0x12fd67,null));};exports['removeAgents']=function(_0xe4110b,_0xdef266,_0x423e1f){return db[_0xdda2('0x48')]['find']({'where':{'id':_0xe4110b[_0xdda2('0x4d')]['id']}})[_0xdda2('0x2b')](handleEntityNotFound(_0xdef266,null))[_0xdda2('0x2b')](function(_0x152ba3){if(_0x152ba3){return _0x152ba3[_0xdda2('0x76')](_0xe4110b[_0xdda2('0x38')][_0xdda2('0x72')])[_0xdda2('0x2b')](function(){if(_[_0xdda2('0x77')](_0xe4110b[_0xdda2('0x38')][_0xdda2('0x72')])){for(var _0x23a80a=0x0;_0x23a80a<_0xe4110b[_0xdda2('0x38')][_0xdda2('0x72')][_0xdda2('0x3d')];_0x23a80a+=0x1){socket['emit'](_0xdda2('0x78'),{'UserId':Number(_0xe4110b[_0xdda2('0x38')]['ids'][_0x23a80a]),'VoicePrefixId':Number(_0xe4110b['params']['id'])});}}else{socket[_0xdda2('0x75')](_0xdda2('0x78'),{'UserId':Number(_0xe4110b[_0xdda2('0x38')][_0xdda2('0x72')]),'VoicePrefixId':Number(_0xe4110b[_0xdda2('0x4d')]['id'])});}});}})[_0xdda2('0x2b')](respondWithStatusCode(_0xdef266,null))['catch'](handleError(_0xdef266,null));};exports[_0xdda2('0x79')]=function(_0x1f3abe,_0x447bd2,_0x2bb4f3){var _0x563be8={};var _0xbf1248={};var _0x5c3d67;var _0x20ebf7;return db[_0xdda2('0x48')]['findOne']({'where':{'id':_0x1f3abe[_0xdda2('0x4d')]['id']}})[_0xdda2('0x2b')](handleEntityNotFound(_0x447bd2,null))[_0xdda2('0x2b')](function(_0x1dfe6d){if(_0x1dfe6d){_0x5c3d67=_0x1dfe6d;_0xbf1248[_0xdda2('0x36')]=_[_0xdda2('0x39')](db[_0xdda2('0x7a')][_0xdda2('0x4e')]);_0xbf1248[_0xdda2('0x38')]=_[_0xdda2('0x39')](_0x1f3abe[_0xdda2('0x38')]);_0xbf1248['filters']=_[_0xdda2('0x3a')](_0xbf1248[_0xdda2('0x36')],_0xbf1248[_0xdda2('0x38')]);_0x563be8[_0xdda2('0x3b')]=_[_0xdda2('0x3a')](_0xbf1248['model'],qs[_0xdda2('0x3c')](_0x1f3abe[_0xdda2('0x38')]['fields']));_0x563be8[_0xdda2('0x3b')]=_0x563be8[_0xdda2('0x3b')]['length']?_0x563be8['attributes']:_0xbf1248[_0xdda2('0x36')];_0x563be8[_0xdda2('0x40')]=qs[_0xdda2('0x41')](_0x1f3abe[_0xdda2('0x38')][_0xdda2('0x41')]);_0x563be8[_0xdda2('0x44')]=qs['filters'](_[_0xdda2('0x43')](_0x1f3abe[_0xdda2('0x38')],_0xbf1248['filters']));if(_0x1f3abe[_0xdda2('0x38')][_0xdda2('0x47')]){_0x563be8['where']=_[_0xdda2('0x45')](_0x563be8[_0xdda2('0x44')],{'$or':_[_0xdda2('0x37')](_0x563be8['attributes'],function(_0xe6f37b){var _0x4a34ee={};_0x4a34ee[_0xe6f37b]={'$like':'%'+_0x1f3abe[_0xdda2('0x38')][_0xdda2('0x47')]+'%'};return _0x4a34ee;})});}_0x563be8=_[_0xdda2('0x45')]({},_0x563be8,_0x1f3abe[_0xdda2('0x7b')]);return _0x5c3d67['getAgents'](_0x563be8);}})['then'](function(_0x2b8c0c){if(_0x2b8c0c){_0x20ebf7=_0x2b8c0c[_0xdda2('0x3d')];if(!_0x1f3abe['query'][_0xdda2('0x3e')](_0xdda2('0x3f'))){_0x563be8[_0xdda2('0x25')]=qs[_0xdda2('0x25')](_0x1f3abe[_0xdda2('0x38')][_0xdda2('0x25')]);_0x563be8[_0xdda2('0x23')]=qs[_0xdda2('0x23')](_0x1f3abe[_0xdda2('0x38')][_0xdda2('0x23')]);}return _0x5c3d67[_0xdda2('0x79')](_0x563be8);}})[_0xdda2('0x2b')](function(_0x528185){if(_0x528185){return _0x528185?{'count':_0x20ebf7,'rows':_0x528185}:null;}})['then'](respondWithResult(_0x447bd2,null))['catch'](handleError(_0x447bd2,null));};exports[_0xdda2('0x7c')]=function(_0x4edf20,_0x2910b0,_0x323af8){var _0x2f18a0={};var _0xe797aa={};var _0x558ab6;var _0x374fc4;return db[_0xdda2('0x48')][_0xdda2('0x7d')]({'where':{'id':_0x4edf20['params']['id']}})[_0xdda2('0x2b')](handleEntityNotFound(_0x2910b0,null))[_0xdda2('0x2b')](function(_0x2588f5){if(_0x2588f5){_0x558ab6=_0x2588f5;_0xe797aa['model']=_['keys'](db[_0xdda2('0x7e')][_0xdda2('0x4e')]);_0xe797aa[_0xdda2('0x38')]=_['keys'](_0x4edf20[_0xdda2('0x38')]);_0xe797aa[_0xdda2('0x42')]=_[_0xdda2('0x3a')](_0xe797aa[_0xdda2('0x36')],_0xe797aa[_0xdda2('0x38')]);_0x2f18a0[_0xdda2('0x3b')]=_[_0xdda2('0x3a')](_0xe797aa['model'],qs[_0xdda2('0x3c')](_0x4edf20[_0xdda2('0x38')][_0xdda2('0x3c')]));_0x2f18a0[_0xdda2('0x3b')]=_0x2f18a0['attributes'][_0xdda2('0x3d')]?_0x2f18a0[_0xdda2('0x3b')]:_0xe797aa[_0xdda2('0x36')];_0x2f18a0[_0xdda2('0x40')]=qs['sort'](_0x4edf20['query']['sort']);_0x2f18a0[_0xdda2('0x44')]=qs[_0xdda2('0x42')](_[_0xdda2('0x43')](_0x4edf20[_0xdda2('0x38')],_0xe797aa[_0xdda2('0x42')]));if(_0x4edf20[_0xdda2('0x38')]['filter']){_0x2f18a0[_0xdda2('0x44')]=_[_0xdda2('0x45')](_0x2f18a0[_0xdda2('0x44')],{'$or':_[_0xdda2('0x37')](_0x2f18a0[_0xdda2('0x3b')],function(_0x39ee74){var _0xcbf57f={};_0xcbf57f[_0x39ee74]={'$like':'%'+_0x4edf20[_0xdda2('0x38')]['filter']+'%'};return _0xcbf57f;})});}_0x2f18a0=_[_0xdda2('0x45')]({},_0x2f18a0,_0x4edf20['options']);return _0x558ab6[_0xdda2('0x7c')](_0x2f18a0);}})['then'](function(_0x15066f){if(_0x15066f){_0x374fc4=_0x15066f['length'];if(!_0x4edf20[_0xdda2('0x38')][_0xdda2('0x3e')](_0xdda2('0x3f'))){_0x2f18a0[_0xdda2('0x25')]=qs[_0xdda2('0x25')](_0x4edf20[_0xdda2('0x38')][_0xdda2('0x25')]);_0x2f18a0[_0xdda2('0x23')]=qs[_0xdda2('0x23')](_0x4edf20['query'][_0xdda2('0x23')]);}return _0x558ab6[_0xdda2('0x7c')](_0x2f18a0);}})['then'](function(_0x42db44){if(_0x42db44){return _0x42db44?{'count':_0x374fc4,'rows':_0x42db44}:null;}})[_0xdda2('0x2b')](respondWithResult(_0x2910b0,null))[_0xdda2('0x4b')](handleError(_0x2910b0,null));};exports['addTeams']=function(_0x1702ae,_0x21ade3,_0x251408){var _0x311e34=_0x1702ae[_0xdda2('0x54')][_0xdda2('0x72')];var _0x4124a5;return db[_0xdda2('0x7e')][_0xdda2('0x4a')]({'where':{'id':_0x311e34},'attributes':['id'],'include':[{'model':db[_0xdda2('0x7a')],'as':'Agents','attributes':['id',_0xdda2('0x31'),_0xdda2('0x7f'),_0xdda2('0x80'),_0xdda2('0x81')],'raw':!![]}]})[_0xdda2('0x2b')](function(_0x4c540d){if(_0x4c540d){_0x4124a5=_0x4c540d;var _0x320cf1=_[_0xdda2('0x82')](_0x4c540d,function(_0xdd343d){var _0x56cd13=_0xdd343d[_0xdda2('0x2c')]({'plain':!![]});return _0x56cd13[_0xdda2('0x83')];});return db[_0xdda2('0x48')]['find']({'where':{'id':_0x1702ae[_0xdda2('0x4d')]['id']}})['then'](function(_0x579fc9){return db[_0xdda2('0x53')][_0xdda2('0x6f')](function(_0x3752bf){return _0x579fc9[_0xdda2('0x84')](_0x311e34,{'transaction':_0x3752bf})[_0xdda2('0x2b')](function(){return BPromise[_0xdda2('0x85')](_0x4124a5,function(_0x14baa0){return db['TeamVoicePrefix']['upsert']({'TeamId':_0x14baa0['id'],'VoicePrefixId':_0x1702ae[_0xdda2('0x4d')]['id']},{'transaction':_0x3752bf});});})[_0xdda2('0x2b')](function(){return BPromise[_0xdda2('0x85')](_0x320cf1,function(_0x16b910){return db[_0xdda2('0x86')]['findOrCreate']({'where':{'UserId':_0x16b910['id'],'VoicePrefixId':_0x1702ae[_0xdda2('0x4d')]['id']},'transaction':_0x3752bf});});})[_0xdda2('0x2b')](function(){_0x320cf1[_0xdda2('0x87')](function(_0x233494){socket[_0xdda2('0x75')](_0xdda2('0x88'),{'UserId':_0x233494['id'],'VoicePrefixId':_0x579fc9['id']});});});});});}})[_0xdda2('0x2b')](respondWithStatusCode(_0x21ade3,null))[_0xdda2('0x4b')](handleError(_0x21ade3,null));};exports[_0xdda2('0x89')]=function(_0x44e93d,_0x2defb2,_0x53c44d){return db[_0xdda2('0x7e')][_0xdda2('0x4a')]({'where':{'id':_0x44e93d[_0xdda2('0x38')][_0xdda2('0x72')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xdda2('0x83'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2defb2,null))[_0xdda2('0x2b')](function(_0x4f2d5c){var _0x240048=_['map'](_0x4f2d5c,'id');var _0x1da0dd=[];var _0xb93d3b=[];var _0x3d59cb=squel['select']();_0x3d59cb[_0xdda2('0x8a')](_0xdda2('0x8b'))[_0xdda2('0x8c')]('team_has_voice_prefixes','tq')['join'](_0xdda2('0x8d'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xdda2('0x44')](_0xdda2('0x8e'),_0x44e93d[_0xdda2('0x4d')]['id']);for(var _0x182570=0x0;_0x182570<_0x4f2d5c['length'];_0x182570+=0x1){let _0x28a217=_0x4f2d5c[_0x182570];for(var _0x54cd55=0x0;_0x54cd55<_0x28a217['Agents']['length'];_0x54cd55+=0x1){let _0x5235d5=_0x28a217[_0xdda2('0x83')][_0x54cd55];var _0x4a6058=_0x3d59cb[_0xdda2('0x8f')]();_0x4a6058[_0xdda2('0x44')]('ut.UserId\x20=\x20?',_0x5235d5['id']);_0xb93d3b['push'](db[_0xdda2('0x53')][_0xdda2('0x38')](_0x4a6058[_0xdda2('0x90')](),{'type':db[_0xdda2('0x53')]['QueryTypes']['SELECT']})[_0xdda2('0x2b')](function(_0x19c1eb){if(_0x19c1eb[_0xdda2('0x3d')]===0x1){return _0x5235d5['id'];}else{var _0x22e01a=_['every'](_[_0xdda2('0x37')](_0x19c1eb,_0xdda2('0x91')),function(_0x3867b3){return _[_0xdda2('0x92')](_0x240048,_0x3867b3);});if(_0x22e01a){return _0x5235d5['id'];}}}));}}return BPromise[_0xdda2('0x93')](_0xb93d3b)[_0xdda2('0x2b')](function(_0xa798dc){_0x1da0dd=_(_0x1da0dd)[_0xdda2('0x94')](_0xa798dc)[_0xdda2('0x95')]()[_0xdda2('0x96')]();return db[_0xdda2('0x48')][_0xdda2('0x50')]({'where':{'id':_0x44e93d[_0xdda2('0x4d')]['id']}})[_0xdda2('0x2b')](function(_0x3cb988){return db[_0xdda2('0x53')]['transaction'](function(_0xe54b68){return _0x3cb988[_0xdda2('0x89')](_0x44e93d[_0xdda2('0x38')][_0xdda2('0x72')],{'transaction':_0xe54b68})[_0xdda2('0x2b')](function(){if(!_[_0xdda2('0x97')](_0x1da0dd)){return _0x3cb988[_0xdda2('0x76')](_0x1da0dd,{'transaction':_0xe54b68});}})[_0xdda2('0x2b')](function(){_0x1da0dd[_0xdda2('0x87')](function(_0x1c008c){socket[_0xdda2('0x75')](_0xdda2('0x78'),{'UserId':_0x1c008c,'VoicePrefixId':_0x3cb988['id']});});});});});});})[_0xdda2('0x2b')](respondWithStatusCode(_0x2defb2,null))[_0xdda2('0x4b')](handleError(_0x2defb2,null));}; \ No newline at end of file +var _0xdb28=['length','nolimit','order','sort','where','filters','pick','filter','merge','VoicePrefix','includeAll','include','findAll','rows','catch','params','fields','describe','create','sequelize','body','VoiceExtension','find','VoiceExtensionId','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','No\x20callerid\x20available','goto','${EXTEN:','charAt','update','system-','findById','addAgents','omit','spread','ids','emit','userVoicePrefix:save','isArray','userVoicePrefix:remove','findOne','User','options','hasOwnProperty','getAgents','getTeams','rawAttributes','addTeams','Team','Agents','online','voicePause','interface','flatMap','transaction','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','removeTeams','select','field','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','all','value','isEmpty','removeAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','get','VoicePrefixes','stack','name','send','map','fieldName','type','key','model','query','keys','intersection','attributes'];(function(_0x41d301,_0x5581fe){var _0x12045b=function(_0x539c1a){while(--_0x539c1a){_0x41d301['push'](_0x41d301['shift']());}};_0x12045b(++_0x5581fe);}(_0xdb28,0x106));var _0x8db2=function(_0x27ca69,_0x3ecf57){_0x27ca69=_0x27ca69-0x0;var _0x39a635=_0xdb28[_0x27ca69];return _0x39a635;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];config[_0x8db2('0x19')]=_[_0x8db2('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8db2('0x1b'))(new Redis(config[_0x8db2('0x19')]));require(_0x8db2('0x1c'))[_0x8db2('0x1d')](socket);function respondWithStatusCode(_0x227355,_0xfa285b){_0xfa285b=_0xfa285b||0xcc;return function(_0x2f177a){if(_0x2f177a){return _0x227355[_0x8db2('0x1e')](_0xfa285b);}return _0x227355[_0x8db2('0x1f')](_0xfa285b)[_0x8db2('0x20')]();};}function respondWithResult(_0x5489a9,_0x13b0f5){_0x13b0f5=_0x13b0f5||0xc8;return function(_0x24da1b){if(_0x24da1b){return _0x5489a9['status'](_0x13b0f5)[_0x8db2('0x21')](_0x24da1b);}};}function respondWithFilteredResult(_0x44957d,_0x21db8c){return function(_0x3fddc2){if(_0x3fddc2){var _0x2efd06=typeof _0x21db8c[_0x8db2('0x22')]==='undefined'&&typeof _0x21db8c['limit']===_0x8db2('0x23');var _0x104e33=_0x3fddc2[_0x8db2('0x24')];var _0x1b64e4=_0x2efd06?0x0:_0x21db8c['offset'];var _0x431d60=_0x2efd06?_0x3fddc2[_0x8db2('0x24')]:_0x21db8c[_0x8db2('0x22')]+_0x21db8c[_0x8db2('0x25')];var _0x3dbe8e;if(_0x431d60>=_0x104e33){_0x431d60=_0x104e33;_0x3dbe8e=0xc8;}else{_0x3dbe8e=0xce;}_0x44957d['status'](_0x3dbe8e);return _0x44957d[_0x8db2('0x26')](_0x8db2('0x27'),_0x1b64e4+'-'+_0x431d60+'/'+_0x104e33)[_0x8db2('0x21')](_0x3fddc2);}return null;};}function patchUpdates(_0x125be2){return function(_0x2260d8){try{jsonpatch[_0x8db2('0x28')](_0x2260d8,_0x125be2,!![]);}catch(_0x796ec1){return BPromise['reject'](_0x796ec1);}return _0x2260d8[_0x8db2('0x29')]();};}function saveUpdates(_0x4f6516,_0x5725f0){return function(_0x52a9ca){if(_0x52a9ca){return _0x52a9ca['update'](_0x4f6516)[_0x8db2('0x2a')](function(_0x29b5cd){return _0x29b5cd;});}return null;};}function removeEntity(_0x3be281,_0x2baed0){return function(_0x145328){if(_0x145328){return _0x145328[_0x8db2('0x2b')]()['then'](function(){var _0x3544ba=_0x145328[_0x8db2('0x2c')]({'plain':!![]});var _0x430dd5=_0x8db2('0x2d');return db['UserProfileResource'][_0x8db2('0x2b')]({'where':{'type':_0x430dd5,'resourceId':_0x3544ba['id']}})[_0x8db2('0x2a')](function(){return _0x145328;});})[_0x8db2('0x2a')](function(){_0x3be281[_0x8db2('0x1f')](0xcc)[_0x8db2('0x20')]();});}};}function handleEntityNotFound(_0x21bae5,_0xa54ea3){return function(_0x3124d5){if(!_0x3124d5){_0x21bae5[_0x8db2('0x1e')](0x194);}return _0x3124d5;};}function handleError(_0x493cab,_0x4718ec){_0x4718ec=_0x4718ec||0x1f4;return function(_0x50b28d){logger['error'](_0x50b28d[_0x8db2('0x2e')]);if(_0x50b28d[_0x8db2('0x2f')]){delete _0x50b28d[_0x8db2('0x2f')];}_0x493cab['status'](_0x4718ec)[_0x8db2('0x30')](_0x50b28d);};}exports['index']=function(_0x3f7aac,_0x2b653b){var _0x14bd12={},_0x4d9e26={},_0x56e9c1={'count':0x0,'rows':[]};var _0x35d337=_[_0x8db2('0x31')](db['VoicePrefix']['rawAttributes'],function(_0x173989){return{'name':_0x173989[_0x8db2('0x32')],'type':_0x173989[_0x8db2('0x33')][_0x8db2('0x34')]};});_0x4d9e26[_0x8db2('0x35')]=_[_0x8db2('0x31')](_0x35d337,_0x8db2('0x2f'));_0x4d9e26[_0x8db2('0x36')]=_[_0x8db2('0x37')](_0x3f7aac[_0x8db2('0x36')]);_0x4d9e26['filters']=_[_0x8db2('0x38')](_0x4d9e26[_0x8db2('0x35')],_0x4d9e26['query']);_0x14bd12[_0x8db2('0x39')]=_[_0x8db2('0x38')](_0x4d9e26['model'],qs['fields'](_0x3f7aac[_0x8db2('0x36')]['fields']));_0x14bd12[_0x8db2('0x39')]=_0x14bd12[_0x8db2('0x39')][_0x8db2('0x3a')]?_0x14bd12[_0x8db2('0x39')]:_0x4d9e26['model'];if(!_0x3f7aac[_0x8db2('0x36')]['hasOwnProperty'](_0x8db2('0x3b'))){_0x14bd12[_0x8db2('0x25')]=qs[_0x8db2('0x25')](_0x3f7aac[_0x8db2('0x36')]['limit']);_0x14bd12['offset']=qs[_0x8db2('0x22')](_0x3f7aac[_0x8db2('0x36')]['offset']);}_0x14bd12[_0x8db2('0x3c')]=qs[_0x8db2('0x3d')](_0x3f7aac[_0x8db2('0x36')]['sort']);_0x14bd12[_0x8db2('0x3e')]=qs[_0x8db2('0x3f')](_[_0x8db2('0x40')](_0x3f7aac[_0x8db2('0x36')],_0x4d9e26[_0x8db2('0x3f')]),_0x35d337);if(_0x3f7aac[_0x8db2('0x36')][_0x8db2('0x41')]){_0x14bd12[_0x8db2('0x3e')]=_[_0x8db2('0x42')](_0x14bd12[_0x8db2('0x3e')],{'$or':_[_0x8db2('0x31')](_0x35d337,function(_0x20bf0b){if(_0x20bf0b[_0x8db2('0x33')]!=='VIRTUAL'){var _0x3ee510={};_0x3ee510[_0x20bf0b[_0x8db2('0x2f')]]={'$like':'%'+_0x3f7aac['query']['filter']+'%'};return _0x3ee510;}})});}_0x14bd12=_[_0x8db2('0x42')]({},_0x14bd12,_0x3f7aac['options']);var _0x130eb9={'where':_0x14bd12[_0x8db2('0x3e')]};return db[_0x8db2('0x43')][_0x8db2('0x24')](_0x130eb9)[_0x8db2('0x2a')](function(_0x30d606){_0x56e9c1[_0x8db2('0x24')]=_0x30d606;if(_0x3f7aac['query'][_0x8db2('0x44')]){_0x14bd12[_0x8db2('0x45')]=[{'all':!![]}];}return db[_0x8db2('0x43')][_0x8db2('0x46')](_0x14bd12);})['then'](function(_0x424c27){_0x56e9c1[_0x8db2('0x47')]=_0x424c27;return _0x56e9c1;})[_0x8db2('0x2a')](respondWithFilteredResult(_0x2b653b,_0x14bd12))[_0x8db2('0x48')](handleError(_0x2b653b,null));};exports['show']=function(_0x12d62d,_0x4e0749){var _0x19bd06={'raw':![],'where':{'id':_0x12d62d[_0x8db2('0x49')]['id']}},_0x116b69={};_0x116b69['model']=_['keys'](db[_0x8db2('0x43')]['rawAttributes']);_0x116b69[_0x8db2('0x36')]=_[_0x8db2('0x37')](_0x12d62d[_0x8db2('0x36')]);_0x116b69[_0x8db2('0x3f')]=_[_0x8db2('0x38')](_0x116b69[_0x8db2('0x35')],_0x116b69[_0x8db2('0x36')]);_0x19bd06[_0x8db2('0x39')]=_[_0x8db2('0x38')](_0x116b69[_0x8db2('0x35')],qs[_0x8db2('0x4a')](_0x12d62d[_0x8db2('0x36')]['fields']));_0x19bd06[_0x8db2('0x39')]=_0x19bd06[_0x8db2('0x39')][_0x8db2('0x3a')]?_0x19bd06[_0x8db2('0x39')]:_0x116b69['model'];if(_0x12d62d['query'][_0x8db2('0x44')]){_0x19bd06[_0x8db2('0x45')]=[{'all':!![]}];}_0x19bd06=_[_0x8db2('0x42')]({},_0x19bd06,_0x12d62d['options']);return db['VoicePrefix']['find'](_0x19bd06)[_0x8db2('0x2a')](handleEntityNotFound(_0x4e0749,null))[_0x8db2('0x2a')](respondWithResult(_0x4e0749,null))[_0x8db2('0x48')](handleError(_0x4e0749,null));};exports[_0x8db2('0x2b')]=function(_0xaab731,_0x4195ef){return db[_0x8db2('0x43')]['find']({'where':{'id':_0xaab731['params']['id']}})[_0x8db2('0x2a')](handleEntityNotFound(_0x4195ef,null))[_0x8db2('0x2a')](removeEntity(_0x4195ef,null))[_0x8db2('0x48')](handleError(_0x4195ef,null));};exports[_0x8db2('0x4b')]=function(_0x3daed6,_0x2bf408){return db[_0x8db2('0x43')][_0x8db2('0x4b')]()[_0x8db2('0x2a')](respondWithResult(_0x2bf408,null))[_0x8db2('0x48')](handleError(_0x2bf408,null));};exports[_0x8db2('0x4c')]=function(_0x319273,_0x345c74){var _0x2d518a;return db[_0x8db2('0x4d')]['transaction'](function(_0x2ded23){return db[_0x8db2('0x43')]['create'](_0x319273[_0x8db2('0x4e')],{'transaction':_0x2ded23})[_0x8db2('0x2a')](function(_0x3af298){_0x2d518a=_0x3af298['get']({'plain':!![]});return db[_0x8db2('0x4f')][_0x8db2('0x50')]({'where':{'id':_0x2d518a[_0x8db2('0x51')]},'raw':!![]})[_0x8db2('0x2a')](function(_0x1167d5){return createVoicePrefixExtensions(_0x2d518a,_0x1167d5,_0x2ded23);});});})['then'](function(){var _0x467505=_0x319273[_0x8db2('0x52')][_0x8db2('0x2c')]({'plain':!![]});if(!_0x467505)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x467505[_0x8db2('0x53')]===_0x8db2('0x52')){var _0x33dddd=_0x2d518a;return db[_0x8db2('0x54')][_0x8db2('0x50')]({'where':{'name':_0x8db2('0x2d'),'userProfileId':_0x467505[_0x8db2('0x55')]},'raw':!![]})['then'](function(_0x39ff90){if(_0x39ff90&&_0x39ff90[_0x8db2('0x56')]===0x0){return db['UserProfileResource'][_0x8db2('0x4c')]({'name':_0x33dddd[_0x8db2('0x2f')],'resourceId':_0x33dddd['id'],'type':_0x39ff90['name'],'sectionId':_0x39ff90['id']},{})[_0x8db2('0x2a')](function(){return _0x2d518a;});}else{return _0x2d518a;}})[_0x8db2('0x48')](function(_0x63e8f7){logger[_0x8db2('0x57')](_0x8db2('0x58'),_0x63e8f7);throw _0x63e8f7;});}return _0x2d518a;})[_0x8db2('0x2a')](respondWithResult(_0x345c74,null))[_0x8db2('0x48')](handleError(_0x345c74,null));};function Extension(_0x33a600,_0x120ef2,_0x173a5e,_0x12fd12){this[_0x8db2('0x59')]=_0x8db2('0x5a');this[_0x8db2('0x5b')]=_0x33a600;this[_0x8db2('0x5c')]=_0x173a5e;this[_0x8db2('0x33')]='system';this[_0x8db2('0x5d')]=_0x8db2('0x5e');this[_0x8db2('0x5f')]=_0x120ef2;this[_0x8db2('0x60')]=_0x12fd12;}function createVoicePrefixExtensions(_0x349db0,_0x53b2dc,_0x3dd6b1){return new BPromise(function(_0x2c3087,_0x3ab670){var _0x1e1c0d=new Extension(formatPrefixName(_0x349db0[_0x8db2('0x61')]),0x1,_0x8db2('0x62'),_0x8db2('0x63'));_0x1e1c0d[_0x8db2('0x64')]=_0x349db0['id'];return db[_0x8db2('0x4f')][_0x8db2('0x4c')](_0x1e1c0d,{'transaction':_0x3dd6b1})[_0x8db2('0x2a')](function(_0xfe6bac){var _0x170a72=_0xfe6bac[_0x8db2('0x2c')]({'plain':!![]});var _0xed9d36=_[_0x8db2('0x31')](addVoicePrefixExtensions(_0x349db0,_0x53b2dc),function(_0x1d7862){_0x1d7862[_0x8db2('0x51')]=_0x170a72['id'];_0x1d7862['VoicePrefixId']=_0x349db0['id'];return _0x1d7862;});return db[_0x8db2('0x4f')]['bulkCreate'](_0xed9d36,{'transaction':_0x3dd6b1})[_0x8db2('0x2a')](function(_0x570c53){if(!_0x570c53){return _0x3ab670(_0x8db2('0x65'));}else{return _0x2c3087(_0x570c53);}})[_0x8db2('0x48')](function(_0xe4fd6a){return _0x3ab670(_0xe4fd6a);});});;});};function addVoicePrefixExtensions(_0x1e2ccd,_0x1e812e){var _0x59a32e=[];var _0x50c5fb=formatPrefixName(_0x1e2ccd[_0x8db2('0x61')]);_0x59a32e[_0x8db2('0x66')](new Extension(_0x50c5fb,0x2,_0x8db2('0x67'),_0x8db2('0x68')+_0x1e2ccd[_0x8db2('0x2f')]));if(_0x1e2ccd[_0x8db2('0x69')]){_0x59a32e[_0x8db2('0x66')](new Extension(_0x50c5fb,0x3,_0x8db2('0x67'),'PREFIX-CALLERIDALL='+_0x1e2ccd[_0x8db2('0x69')]));}else{_0x59a32e[_0x8db2('0x66')](new Extension(_0x50c5fb,0x3,_0x8db2('0x62'),_0x8db2('0x6a')));}_0x59a32e[_0x8db2('0x66')](new Extension(_0x50c5fb,0x4,_0x8db2('0x6b'),_0x1e812e[_0x8db2('0x59')]+','+_0x8db2('0x6c')+(0x8+_0x1e2ccd['name']['length'])+'}'+','+0x1));return _0x59a32e;}function formatPrefixName(_0x358009){var _0x2f8beb='_';for(var _0x1d2dfc=0x0;_0x1d2dfc<_0x358009[_0x8db2('0x3a')];_0x1d2dfc++){if(_0x358009[_0x8db2('0x6d')](_0x1d2dfc)=='-'){_0x2f8beb+=_0x358009['charAt'](_0x1d2dfc);}else{_0x2f8beb+='['+_0x358009['charAt'](_0x1d2dfc)+']';}}_0x2f8beb+='.';return _0x2f8beb;}exports[_0x8db2('0x6e')]=function(_0x364807,_0x54f0d4,_0xa698bd){var _0x2be647=_0x364807[_0x8db2('0x4e')];_0x2be647['prefix']=_0x8db2('0x6f')+_0x2be647[_0x8db2('0x2f')]+'-';return db[_0x8db2('0x4d')]['transaction'](function(_0x3ff023){return db[_0x8db2('0x43')][_0x8db2('0x6e')](_0x2be647,{'where':{'id':_0x2be647['id']},'transaction':_0x3ff023})[_0x8db2('0x2a')](function(){return db[_0x8db2('0x4f')]['destroy']({'where':{'VoicePrefixId':_0x2be647['id']},'transaction':_0x3ff023})[_0x8db2('0x2a')](function(){return db[_0x8db2('0x4f')][_0x8db2('0x50')]({'where':{'id':_0x2be647['VoiceExtensionId']},'raw':!![]})['then'](function(_0x2cdf3c){return createVoicePrefixExtensions(_0x2be647,_0x2cdf3c,_0x3ff023);});});});})[_0x8db2('0x2a')](function(){return db['VoicePrefix'][_0x8db2('0x70')](_0x2be647['id']);})[_0x8db2('0x2a')](respondWithResult(_0x54f0d4,null))[_0x8db2('0x48')](handleError(_0x54f0d4,null));};exports[_0x8db2('0x71')]=function(_0xbf1fce,_0x16848b,_0x395ebb){return db[_0x8db2('0x43')][_0x8db2('0x50')]({'where':{'id':_0xbf1fce[_0x8db2('0x49')]['id']}})[_0x8db2('0x2a')](handleEntityNotFound(_0x16848b,null))[_0x8db2('0x2a')](function(_0x24a52d){if(_0x24a52d){return _0x24a52d['addAgents'](_0xbf1fce[_0x8db2('0x4e')]['ids'],_[_0x8db2('0x72')](_0xbf1fce[_0x8db2('0x4e')],['ids','id'])||{})[_0x8db2('0x73')](function(_0x2fa89d){for(var _0x5cdf53=0x0;_0x5cdf53<_0xbf1fce[_0x8db2('0x4e')][_0x8db2('0x74')][_0x8db2('0x3a')];_0x5cdf53+=0x1){socket[_0x8db2('0x75')](_0x8db2('0x76'),{'UserId':Number(_0xbf1fce[_0x8db2('0x4e')][_0x8db2('0x74')][_0x5cdf53]),'VoicePrefixId':Number(_0xbf1fce[_0x8db2('0x49')]['id'])});}return _0x2fa89d;});}})[_0x8db2('0x2a')](respondWithResult(_0x16848b,null))['catch'](handleError(_0x16848b,null));};exports['removeAgents']=function(_0x198c3b,_0x508f4a,_0xf8afa5){return db[_0x8db2('0x43')][_0x8db2('0x50')]({'where':{'id':_0x198c3b['params']['id']}})[_0x8db2('0x2a')](handleEntityNotFound(_0x508f4a,null))[_0x8db2('0x2a')](function(_0x3e37e7){if(_0x3e37e7){return _0x3e37e7['removeAgents'](_0x198c3b[_0x8db2('0x36')][_0x8db2('0x74')])[_0x8db2('0x2a')](function(){if(_[_0x8db2('0x77')](_0x198c3b['query'][_0x8db2('0x74')])){for(var _0x5f61b8=0x0;_0x5f61b8<_0x198c3b[_0x8db2('0x36')][_0x8db2('0x74')][_0x8db2('0x3a')];_0x5f61b8+=0x1){socket[_0x8db2('0x75')](_0x8db2('0x78'),{'UserId':Number(_0x198c3b[_0x8db2('0x36')][_0x8db2('0x74')][_0x5f61b8]),'VoicePrefixId':Number(_0x198c3b[_0x8db2('0x49')]['id'])});}}else{socket[_0x8db2('0x75')]('userVoicePrefix:remove',{'UserId':Number(_0x198c3b[_0x8db2('0x36')][_0x8db2('0x74')]),'VoicePrefixId':Number(_0x198c3b[_0x8db2('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x508f4a,null))['catch'](handleError(_0x508f4a,null));};exports['getAgents']=function(_0xa09b1d,_0xdba223,_0x3191c8){var _0x454377={};var _0x2ad024={};var _0x313918;var _0x339d09;return db[_0x8db2('0x43')][_0x8db2('0x79')]({'where':{'id':_0xa09b1d[_0x8db2('0x49')]['id']}})[_0x8db2('0x2a')](handleEntityNotFound(_0xdba223,null))['then'](function(_0x360a06){if(_0x360a06){_0x313918=_0x360a06;_0x2ad024[_0x8db2('0x35')]=_[_0x8db2('0x37')](db[_0x8db2('0x7a')]['rawAttributes']);_0x2ad024['query']=_[_0x8db2('0x37')](_0xa09b1d[_0x8db2('0x36')]);_0x2ad024['filters']=_[_0x8db2('0x38')](_0x2ad024[_0x8db2('0x35')],_0x2ad024[_0x8db2('0x36')]);_0x454377['attributes']=_['intersection'](_0x2ad024['model'],qs[_0x8db2('0x4a')](_0xa09b1d[_0x8db2('0x36')][_0x8db2('0x4a')]));_0x454377[_0x8db2('0x39')]=_0x454377[_0x8db2('0x39')]['length']?_0x454377[_0x8db2('0x39')]:_0x2ad024['model'];_0x454377[_0x8db2('0x3c')]=qs[_0x8db2('0x3d')](_0xa09b1d[_0x8db2('0x36')][_0x8db2('0x3d')]);_0x454377[_0x8db2('0x3e')]=qs['filters'](_['pick'](_0xa09b1d[_0x8db2('0x36')],_0x2ad024['filters']));if(_0xa09b1d[_0x8db2('0x36')][_0x8db2('0x41')]){_0x454377[_0x8db2('0x3e')]=_[_0x8db2('0x42')](_0x454377[_0x8db2('0x3e')],{'$or':_[_0x8db2('0x31')](_0x454377['attributes'],function(_0x19f9a0){var _0x222ea2={};_0x222ea2[_0x19f9a0]={'$like':'%'+_0xa09b1d[_0x8db2('0x36')]['filter']+'%'};return _0x222ea2;})});}_0x454377=_[_0x8db2('0x42')]({},_0x454377,_0xa09b1d[_0x8db2('0x7b')]);return _0x313918['getAgents'](_0x454377);}})[_0x8db2('0x2a')](function(_0x7cb97d){if(_0x7cb97d){_0x339d09=_0x7cb97d[_0x8db2('0x3a')];if(!_0xa09b1d[_0x8db2('0x36')][_0x8db2('0x7c')](_0x8db2('0x3b'))){_0x454377[_0x8db2('0x25')]=qs[_0x8db2('0x25')](_0xa09b1d[_0x8db2('0x36')]['limit']);_0x454377[_0x8db2('0x22')]=qs[_0x8db2('0x22')](_0xa09b1d[_0x8db2('0x36')][_0x8db2('0x22')]);}return _0x313918[_0x8db2('0x7d')](_0x454377);}})[_0x8db2('0x2a')](function(_0x16d1c5){if(_0x16d1c5){return _0x16d1c5?{'count':_0x339d09,'rows':_0x16d1c5}:null;}})[_0x8db2('0x2a')](respondWithResult(_0xdba223,null))[_0x8db2('0x48')](handleError(_0xdba223,null));};exports[_0x8db2('0x7e')]=function(_0x5e6fc4,_0x3e79cc,_0x7e4bf){var _0x339ffe={};var _0x1587e8={};var _0x5d371b;var _0x4589c7;return db[_0x8db2('0x43')][_0x8db2('0x79')]({'where':{'id':_0x5e6fc4['params']['id']}})['then'](handleEntityNotFound(_0x3e79cc,null))[_0x8db2('0x2a')](function(_0x6e5a58){if(_0x6e5a58){_0x5d371b=_0x6e5a58;_0x1587e8[_0x8db2('0x35')]=_[_0x8db2('0x37')](db['Team'][_0x8db2('0x7f')]);_0x1587e8[_0x8db2('0x36')]=_[_0x8db2('0x37')](_0x5e6fc4[_0x8db2('0x36')]);_0x1587e8['filters']=_[_0x8db2('0x38')](_0x1587e8[_0x8db2('0x35')],_0x1587e8[_0x8db2('0x36')]);_0x339ffe['attributes']=_['intersection'](_0x1587e8['model'],qs[_0x8db2('0x4a')](_0x5e6fc4[_0x8db2('0x36')][_0x8db2('0x4a')]));_0x339ffe[_0x8db2('0x39')]=_0x339ffe['attributes']['length']?_0x339ffe[_0x8db2('0x39')]:_0x1587e8[_0x8db2('0x35')];_0x339ffe[_0x8db2('0x3c')]=qs[_0x8db2('0x3d')](_0x5e6fc4[_0x8db2('0x36')][_0x8db2('0x3d')]);_0x339ffe['where']=qs[_0x8db2('0x3f')](_['pick'](_0x5e6fc4[_0x8db2('0x36')],_0x1587e8[_0x8db2('0x3f')]));if(_0x5e6fc4[_0x8db2('0x36')][_0x8db2('0x41')]){_0x339ffe[_0x8db2('0x3e')]=_['merge'](_0x339ffe[_0x8db2('0x3e')],{'$or':_[_0x8db2('0x31')](_0x339ffe['attributes'],function(_0x28beec){var _0x1334ea={};_0x1334ea[_0x28beec]={'$like':'%'+_0x5e6fc4[_0x8db2('0x36')][_0x8db2('0x41')]+'%'};return _0x1334ea;})});}_0x339ffe=_['merge']({},_0x339ffe,_0x5e6fc4[_0x8db2('0x7b')]);return _0x5d371b['getTeams'](_0x339ffe);}})['then'](function(_0xaa90b9){if(_0xaa90b9){_0x4589c7=_0xaa90b9[_0x8db2('0x3a')];if(!_0x5e6fc4[_0x8db2('0x36')][_0x8db2('0x7c')](_0x8db2('0x3b'))){_0x339ffe[_0x8db2('0x25')]=qs[_0x8db2('0x25')](_0x5e6fc4['query'][_0x8db2('0x25')]);_0x339ffe['offset']=qs['offset'](_0x5e6fc4[_0x8db2('0x36')]['offset']);}return _0x5d371b['getTeams'](_0x339ffe);}})[_0x8db2('0x2a')](function(_0x1642a7){if(_0x1642a7){return _0x1642a7?{'count':_0x4589c7,'rows':_0x1642a7}:null;}})[_0x8db2('0x2a')](respondWithResult(_0x3e79cc,null))['catch'](handleError(_0x3e79cc,null));};exports[_0x8db2('0x80')]=function(_0xb2ab8e,_0x30d410,_0x555ed0){var _0x27a916=_0xb2ab8e[_0x8db2('0x4e')][_0x8db2('0x74')];var _0x7ff636;return db[_0x8db2('0x81')][_0x8db2('0x46')]({'where':{'id':_0x27a916},'attributes':['id'],'include':[{'model':db[_0x8db2('0x7a')],'as':_0x8db2('0x82'),'attributes':['id','name',_0x8db2('0x83'),_0x8db2('0x84'),_0x8db2('0x85')],'raw':!![]}]})[_0x8db2('0x2a')](function(_0x20d69b){if(_0x20d69b){_0x7ff636=_0x20d69b;var _0x36199d=_[_0x8db2('0x86')](_0x20d69b,function(_0x2910c8){var _0x3a53e2=_0x2910c8[_0x8db2('0x2c')]({'plain':!![]});return _0x3a53e2[_0x8db2('0x82')];});return db['VoicePrefix'][_0x8db2('0x50')]({'where':{'id':_0xb2ab8e[_0x8db2('0x49')]['id']}})[_0x8db2('0x2a')](function(_0x58063b){return db[_0x8db2('0x4d')][_0x8db2('0x87')](function(_0x3c105f){return _0x58063b['addTeams'](_0x27a916,{'transaction':_0x3c105f})['then'](function(){return BPromise[_0x8db2('0x88')](_0x7ff636,function(_0x17d3ee){return db[_0x8db2('0x89')][_0x8db2('0x8a')]({'TeamId':_0x17d3ee['id'],'VoicePrefixId':_0xb2ab8e[_0x8db2('0x49')]['id']},{'transaction':_0x3c105f});});})[_0x8db2('0x2a')](function(){return BPromise[_0x8db2('0x88')](_0x36199d,function(_0x1f1aa5){return db[_0x8db2('0x8b')][_0x8db2('0x8c')]({'where':{'UserId':_0x1f1aa5['id'],'VoicePrefixId':_0xb2ab8e['params']['id']},'transaction':_0x3c105f});});})[_0x8db2('0x2a')](function(){_0x36199d[_0x8db2('0x8d')](function(_0x5b8adc){socket[_0x8db2('0x75')](_0x8db2('0x76'),{'UserId':_0x5b8adc['id'],'VoicePrefixId':_0x58063b['id']});});});});});}})[_0x8db2('0x2a')](respondWithStatusCode(_0x30d410,null))[_0x8db2('0x48')](handleError(_0x30d410,null));};exports[_0x8db2('0x8e')]=function(_0x2e4fb3,_0x8f84e4,_0x372efd){return db[_0x8db2('0x81')][_0x8db2('0x46')]({'where':{'id':_0x2e4fb3[_0x8db2('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0x8db2('0x7a')],'as':_0x8db2('0x82'),'attributes':['id'],'raw':!![]}]})[_0x8db2('0x2a')](handleEntityNotFound(_0x8f84e4,null))[_0x8db2('0x2a')](function(_0x1d27e3){var _0x296981=_['map'](_0x1d27e3,'id');var _0x137788=[];var _0x19bc4d=[];var _0x339dbf=squel[_0x8db2('0x8f')]();_0x339dbf[_0x8db2('0x90')](_0x8db2('0x91'))[_0x8db2('0x92')](_0x8db2('0x93'),'tq')[_0x8db2('0x94')](_0x8db2('0x95'),'ut',_0x8db2('0x96'))['where']('VoicePrefixId\x20=\x20?',_0x2e4fb3[_0x8db2('0x49')]['id']);for(var _0x56f59b=0x0;_0x56f59b<_0x1d27e3[_0x8db2('0x3a')];_0x56f59b+=0x1){let _0xccdab2=_0x1d27e3[_0x56f59b];for(var _0x2428f1=0x0;_0x2428f1<_0xccdab2['Agents'][_0x8db2('0x3a')];_0x2428f1+=0x1){let _0x28cfee=_0xccdab2[_0x8db2('0x82')][_0x2428f1];var _0x3e154a=_0x339dbf['clone']();_0x3e154a[_0x8db2('0x3e')](_0x8db2('0x97'),_0x28cfee['id']);_0x19bc4d[_0x8db2('0x66')](db['sequelize'][_0x8db2('0x36')](_0x3e154a[_0x8db2('0x98')](),{'type':db[_0x8db2('0x4d')]['QueryTypes'][_0x8db2('0x99')]})[_0x8db2('0x2a')](function(_0x41957f){if(_0x41957f['length']===0x1){return _0x28cfee['id'];}else{var _0x18ac5c=_[_0x8db2('0x9a')](_['map'](_0x41957f,_0x8db2('0x9b')),function(_0x231360){return _['includes'](_0x296981,_0x231360);});if(_0x18ac5c){return _0x28cfee['id'];}}}));}}return BPromise[_0x8db2('0x9c')](_0x19bc4d)[_0x8db2('0x2a')](function(_0x3d2729){_0x137788=_(_0x137788)['union'](_0x3d2729)['compact']()[_0x8db2('0x9d')]();return db['VoicePrefix']['find']({'where':{'id':_0x2e4fb3[_0x8db2('0x49')]['id']}})[_0x8db2('0x2a')](function(_0x37fda2){return db[_0x8db2('0x4d')][_0x8db2('0x87')](function(_0x3695cd){return _0x37fda2['removeTeams'](_0x2e4fb3['query'][_0x8db2('0x74')],{'transaction':_0x3695cd})[_0x8db2('0x2a')](function(){if(!_[_0x8db2('0x9e')](_0x137788)){return _0x37fda2[_0x8db2('0x9f')](_0x137788,{'transaction':_0x3695cd});}})['then'](function(){_0x137788[_0x8db2('0x8d')](function(_0x51d15e){socket[_0x8db2('0x75')]('userVoicePrefix:remove',{'UserId':_0x51d15e,'VoicePrefixId':_0x37fda2['id']});});});});});});})[_0x8db2('0x2a')](respondWithStatusCode(_0x8f84e4,null))[_0x8db2('0x48')](handleError(_0x8f84e4,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index ee3a90e..65e42ea 100644 --- a/server/api/voicePrefix/voicePrefix.events.js +++ b/server/api/voicePrefix/voicePrefix.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe2d9=['emit','hasOwnProperty','hook','../../mysqldb','VoicePrefix','setMaxListeners','save','update','remove'];(function(_0x49dcfb,_0x2d2c5e){var _0x512245=function(_0x5358c5){while(--_0x5358c5){_0x49dcfb['push'](_0x49dcfb['shift']());}};_0x512245(++_0x2d2c5e);}(_0xe2d9,0xa5));var _0x9e2d=function(_0x4d9af2,_0x4fb0ec){_0x4d9af2=_0x4d9af2-0x0;var _0x43319b=_0xe2d9[_0x4d9af2];return _0x43319b;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x9e2d('0x0'))['db'][_0x9e2d('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x9e2d('0x2')](0x0);var events={'afterCreate':_0x9e2d('0x3'),'afterUpdate':_0x9e2d('0x4'),'afterDestroy':_0x9e2d('0x5')};function emitEvent(_0x37bf20){return function(_0x4088d7,_0x1f9990,_0x215de6){VoicePrefixEvents[_0x9e2d('0x6')](_0x37bf20+':'+_0x4088d7['id'],_0x4088d7);VoicePrefixEvents[_0x9e2d('0x6')](_0x37bf20,_0x4088d7);_0x215de6(null);};}for(var e in events){if(events[_0x9e2d('0x7')](e)){var event=events[e];VoicePrefix[_0x9e2d('0x8')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file +var _0x46ed=['remove','emit','hasOwnProperty','hook','../../mysqldb','VoicePrefix','setMaxListeners','save','update'];(function(_0x44aef8,_0x7e7c7c){var _0x37eaaf=function(_0x8bd539){while(--_0x8bd539){_0x44aef8['push'](_0x44aef8['shift']());}};_0x37eaaf(++_0x7e7c7c);}(_0x46ed,0xdc));var _0xd46e=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x46ed[_0x46698a];return _0x356db0;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0xd46e('0x0'))['db'][_0xd46e('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xd46e('0x2')](0x0);var events={'afterCreate':_0xd46e('0x3'),'afterUpdate':_0xd46e('0x4'),'afterDestroy':_0xd46e('0x5')};function emitEvent(_0x52a2d0){return function(_0x38fed9,_0x5dae92,_0x105258){VoicePrefixEvents[_0xd46e('0x6')](_0x52a2d0+':'+_0x38fed9['id'],_0x38fed9);VoicePrefixEvents[_0xd46e('0x6')](_0x52a2d0,_0x38fed9);_0x105258(null);};}for(var e in events){if(events[_0xd46e('0x7')](e)){var event=events[e];VoicePrefix[_0xd46e('0x8')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 91f5dbb..fd6d105 100644 --- a/server/api/voicePrefix/voicePrefix.model.js +++ b/server/api/voicePrefix/voicePrefix.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xad71=['exports','voice_prefixes','util','api','moment','bluebird'];(function(_0x55a24c,_0x4f331d){var _0x495763=function(_0x3c41c1){while(--_0x3c41c1){_0x55a24c['push'](_0x55a24c['shift']());}};_0x495763(++_0x4f331d);}(_0xad71,0x1ee));var _0x1ad7=function(_0x4efed9,_0x1aa12a){_0x4efed9=_0x4efed9-0x0;var _0x3635c5=_0xad71[_0x4efed9];return _0x3635c5;};'use strict';var _=require('lodash');var util=require(_0x1ad7('0x0'));var logger=require('../../config/logger')(_0x1ad7('0x1'));var moment=require(_0x1ad7('0x2'));var BPromise=require(_0x1ad7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voicePrefix.attributes');module[_0x1ad7('0x4')]=function(_0x48e2b1,_0x5961e0){return _0x48e2b1['define']('VoicePrefix',attributes,{'tableName':_0x1ad7('0x5'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2de1=['exports','define','lodash','util','bluebird','request-promise','path','../../config/environment','./voicePrefix.attributes'];(function(_0x5a9c4d,_0x443f7f){var _0x409e45=function(_0x2983ef){while(--_0x2983ef){_0x5a9c4d['push'](_0x5a9c4d['shift']());}};_0x409e45(++_0x443f7f);}(_0x2de1,0x1a0));var _0x12de=function(_0x18189b,_0x26e805){_0x18189b=_0x18189b-0x0;var _0x42739a=_0x2de1[_0x18189b];return _0x42739a;};'use strict';var _=require(_0x12de('0x0'));var util=require(_0x12de('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x12de('0x2'));var rp=require(_0x12de('0x3'));var fs=require('fs');var path=require(_0x12de('0x4'));var rimraf=require('rimraf');var config=require(_0x12de('0x5'));var attributes=require(_0x12de('0x6'));module[_0x12de('0x7')]=function(_0x5b2d18,_0x1fea18){return _0x5b2d18[_0x12de('0x8')]('VoicePrefix',attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 7af6ac1..47cd7c6 100644 --- a/server/api/voicePrefix/voicePrefix.rpc.js +++ b/server/api/voicePrefix/voicePrefix.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xea4e=['VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','VoicePrefix,\x20%s,\x20%s','message','result','catch','lodash','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','request\x20sent','debug'];(function(_0xf29686,_0x1e73df){var _0x288c09=function(_0x40eff2){while(--_0x40eff2){_0xf29686['push'](_0xf29686['shift']());}};_0x288c09(++_0x1e73df);}(_0xea4e,0x10c));var _0xeea4=function(_0x21331a,_0x57fc48){_0x21331a=_0x21331a-0x0;var _0x325c55=_0xea4e[_0x21331a];return _0x325c55;};'use strict';var _=require(_0xeea4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xeea4('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeea4('0x2'))['db'];var utils=require(_0xeea4('0x3'));var logger=require('../../config/logger')(_0xeea4('0x4'));var config=require(_0xeea4('0x5'));var jayson=require(_0xeea4('0x6'));var client=jayson[_0xeea4('0x7')][_0xeea4('0x8')]({'port':0x232a});config[_0xeea4('0x9')]=_[_0xeea4('0xa')](config[_0xeea4('0x9')],{'host':_0xeea4('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeea4('0x9')]));require('./voicePrefix.socket')[_0xeea4('0xc')](socket);function respondWithRpcPromise(_0x114d6e,_0x279b9,_0x367d41){return new BPromise(function(_0x16a077,_0x3f9846){return client[_0xeea4('0xd')](_0x114d6e,_0x367d41)[_0xeea4('0xe')](function(_0x48a0db){logger[_0xeea4('0xf')]('VoicePrefix,\x20%s,\x20%s',_0x279b9,_0xeea4('0x10'));logger[_0xeea4('0x11')](_0xeea4('0x12'),_0x279b9,_0xeea4('0x10'),JSON[_0xeea4('0x13')](_0x48a0db));if(_0x48a0db[_0xeea4('0x14')]){if(_0x48a0db[_0xeea4('0x14')][_0xeea4('0x15')]===0x1f4){logger['error'](_0xeea4('0x16'),_0x279b9,_0x48a0db[_0xeea4('0x14')]['message']);return _0x3f9846(_0x48a0db[_0xeea4('0x14')]['message']);}logger[_0xeea4('0x14')](_0xeea4('0x16'),_0x279b9,_0x48a0db[_0xeea4('0x14')][_0xeea4('0x17')]);return _0x16a077(_0x48a0db[_0xeea4('0x14')][_0xeea4('0x17')]);}else{logger[_0xeea4('0xf')](_0xeea4('0x16'),_0x279b9,_0xeea4('0x10'));_0x16a077(_0x48a0db[_0xeea4('0x18')]['message']);}})[_0xeea4('0x19')](function(_0x8e29fb){logger['error'](_0xeea4('0x16'),_0x279b9,_0x8e29fb);_0x3f9846(_0x8e29fb);});});} \ No newline at end of file +var _0x3646=['request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','VoicePrefix,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','request','then','info'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3646,0x15f));var _0x6364=function(_0x274694,_0x24278a){_0x274694=_0x274694-0x0;var _0x4d5938=_0x3646[_0x274694];return _0x4d5938;};'use strict';var _=require(_0x6364('0x0'));var util=require(_0x6364('0x1'));var moment=require(_0x6364('0x2'));var BPromise=require(_0x6364('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6364('0x4'));var db=require(_0x6364('0x5'))['db'];var utils=require(_0x6364('0x6'));var logger=require(_0x6364('0x7'))(_0x6364('0x8'));var config=require(_0x6364('0x9'));var jayson=require(_0x6364('0xa'));var client=jayson[_0x6364('0xb')][_0x6364('0xc')]({'port':0x232a});config[_0x6364('0xd')]=_[_0x6364('0xe')](config['redis'],{'host':_0x6364('0xf'),'port':0x18eb});var socket=require(_0x6364('0x10'))(new Redis(config[_0x6364('0xd')]));require(_0x6364('0x11'))['register'](socket);function respondWithRpcPromise(_0x4bf364,_0x51998c,_0x2d4bbc){return new BPromise(function(_0xfc1996,_0x4646a5){return client[_0x6364('0x12')](_0x4bf364,_0x2d4bbc)[_0x6364('0x13')](function(_0x34de37){logger[_0x6364('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x51998c,_0x6364('0x15'));logger[_0x6364('0x16')](_0x6364('0x17'),_0x51998c,'request\x20sent',JSON[_0x6364('0x18')](_0x34de37));if(_0x34de37[_0x6364('0x19')]){if(_0x34de37[_0x6364('0x19')][_0x6364('0x1a')]===0x1f4){logger['error'](_0x6364('0x1b'),_0x51998c,_0x34de37['error'][_0x6364('0x1c')]);return _0x4646a5(_0x34de37[_0x6364('0x19')][_0x6364('0x1c')]);}logger['error'](_0x6364('0x1b'),_0x51998c,_0x34de37[_0x6364('0x19')][_0x6364('0x1c')]);return _0xfc1996(_0x34de37[_0x6364('0x19')][_0x6364('0x1c')]);}else{logger[_0x6364('0x14')](_0x6364('0x1b'),_0x51998c,'request\x20sent');_0xfc1996(_0x34de37[_0x6364('0x1d')]['message']);}})[_0x6364('0x1e')](function(_0x120401){logger[_0x6364('0x19')](_0x6364('0x1b'),_0x51998c,_0x120401);_0x4646a5(_0x120401);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 44fb4ba..31e9cc1 100644 --- a/server/api/voicePrefix/voicePrefix.socket.js +++ b/server/api/voicePrefix/voicePrefix.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0506=['emit','length','voicePrefix:','./voicePrefix.events','save','remove'];(function(_0x1dcdf3,_0x5e435c){var _0x172849=function(_0x2e85e8){while(--_0x2e85e8){_0x1dcdf3['push'](_0x1dcdf3['shift']());}};_0x172849(++_0x5e435c);}(_0x0506,0x1d1));var _0x6050=function(_0x1cb823,_0x135d10){_0x1cb823=_0x1cb823-0x0;var _0x567ba3=_0x0506[_0x1cb823];return _0x567ba3;};'use strict';var VoicePrefixEvents=require(_0x6050('0x0'));var events=[_0x6050('0x1'),_0x6050('0x2'),'update'];function createListener(_0x52f82b,_0x5139c7){return function(_0x49a1ca){_0x5139c7[_0x6050('0x3')](_0x52f82b,_0x49a1ca);};}function removeListener(_0x58e2a9,_0x3cbb1f){return function(){VoicePrefixEvents['removeListener'](_0x58e2a9,_0x3cbb1f);};}exports['register']=function(_0xfd44cc){for(var _0x269be3=0x0,_0x2a3644=events[_0x6050('0x4')];_0x269be3<_0x2a3644;_0x269be3++){var _0x3512ba=events[_0x269be3];var _0xf64de5=createListener(_0x6050('0x5')+_0x3512ba,_0xfd44cc);VoicePrefixEvents['on'](_0x3512ba,_0xf64de5);}}; \ No newline at end of file +var _0x67da=['removeListener','length','voicePrefix:','save','remove','update','emit'];(function(_0x3b9146,_0xe17f15){var _0x10536f=function(_0x586edf){while(--_0x586edf){_0x3b9146['push'](_0x3b9146['shift']());}};_0x10536f(++_0xe17f15);}(_0x67da,0x192));var _0xa67d=function(_0x5bfdae,_0x364096){_0x5bfdae=_0x5bfdae-0x0;var _0x1f1de2=_0x67da[_0x5bfdae];return _0x1f1de2;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0xa67d('0x0'),_0xa67d('0x1'),_0xa67d('0x2')];function createListener(_0x3cae01,_0x472755){return function(_0x3633a0){_0x472755[_0xa67d('0x3')](_0x3cae01,_0x3633a0);};}function removeListener(_0x1a8b5e,_0x3dcee7){return function(){VoicePrefixEvents[_0xa67d('0x4')](_0x1a8b5e,_0x3dcee7);};}exports['register']=function(_0x5b8ec7){for(var _0x408786=0x0,_0x4d2734=events[_0xa67d('0x5')];_0x408786<_0x4d2734;_0x408786++){var _0x2346f4=events[_0x408786];var _0x10f89a=createListener(_0xa67d('0x6')+_0x2346f4,_0x5b8ec7);VoicePrefixEvents['on'](_0x2346f4,_0x10f89a);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index de87632..89eb5f3 100644 --- a/server/api/voiceQueue/index.js +++ b/server/api/voiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x143ce6,_0x46e089){var _0x33ed64=function(_0x5a6856){while(--_0x5a6856){_0x143ce6['push'](_0x143ce6['shift']());}};_0x33ed64(++_0x46e089);}(_0xb10b,0x12a));var _0xbb10=function(_0x12fc6d,_0x1b2dc1){_0x12fc6d=_0x12fc6d-0x0;var _0x2929f0=_0xb10b[_0x12fc6d];return _0x2929f0;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file +var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x8dc400,_0x1fce4a){var _0x17e5cf=function(_0x2416d9){while(--_0x2416d9){_0x8dc400['push'](_0x8dc400['shift']());}};_0x17e5cf(++_0x1fce4a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 988630a..dc443b6 100644 --- a/server/api/voiceQueue/voiceQueue.attributes.js +++ b/server/api/voiceQueue/voiceQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf11a=['joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','progressive','power','predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','never','onlyIfOpen','always','#AMD\x20Initial\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','mandatoryDispositionPauseId','mandatoryDisposition','exports','name','outbound','inbound','STRING','default','ringall','leastrecent','random','rrmemory','linear','rrordered','setDataValue','strategy','getDataValue','type','preview','roundrobin','includes','INTEGER','ENUM','yes','once','periodic_announce','join','split'];(function(_0x4cc733,_0x390627){var _0x58dc2e=function(_0x2ba205){while(--_0x2ba205){_0x4cc733['push'](_0x4cc733['shift']());}};_0x58dc2e(++_0x390627);}(_0xf11a,0x1ba));var _0xaf11=function(_0x1b2422,_0x1e98d4){_0x1b2422=_0x1b2422-0x0;var _0x376573=_0xf11a[_0x1b2422];return _0x376573;};'use strict';var Sequelize=require('sequelize');module[_0xaf11('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xaf11('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('inbound',_0xaf11('0x2')),'allowNull':![],'defaultValue':_0xaf11('0x3')},'musiconhold':{'type':Sequelize[_0xaf11('0x4')],'defaultValue':_0xaf11('0x5')},'announce':{'type':Sequelize[_0xaf11('0x4')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0xaf11('0x6'),_0xaf11('0x7'),'fewestcalls',_0xaf11('0x8'),_0xaf11('0x9'),_0xaf11('0xa'),'wrandom',_0xaf11('0xb')),'allowNull':![],'defaultValue':'ringall','set':function(_0x4ca7c0){this[_0xaf11('0xc')](_0xaf11('0xd'),_0x4ca7c0?_0x4ca7c0:_0xaf11('0x9'));},'get':function(){var _0x19be2c=this[_0xaf11('0xe')](_0xaf11('0xf'));var _0x2bd011=this[_0xaf11('0xe')]('dialMethod');var _0x14d9a4=this['getDataValue'](_0xaf11('0xd'));if(_0x19be2c===_0xaf11('0x2')){if(_0x2bd011===_0xaf11('0x10')){return null;}if(_0x2bd011==='booked'&&![_0xaf11('0x9'),_0xaf11('0x11')][_0xaf11('0x12')](_0x14d9a4)){this['setDataValue'](_0xaf11('0xd'),_0xaf11('0x9'));}}return _0x14d9a4;}},'servicelevel':{'type':Sequelize[_0xaf11('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xaf11('0x4')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xaf11('0x13')](0xb)},'timeout':{'type':Sequelize[_0xaf11('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xaf11('0x13')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xaf11('0x14')]('yes','no'),'defaultValue':_0xaf11('0x15')},'autopause':{'type':Sequelize['ENUM'](_0xaf11('0x15'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xaf11('0x13')](0xb)},'autopausebusy':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xaf11('0x14')](_0xaf11('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xaf11('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xaf11('0x14')](_0xaf11('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xaf11('0x14')](_0xaf11('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xaf11('0x14')](_0xaf11('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xaf11('0x4')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xaf11('0x4')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xaf11('0x13')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xaf11('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xaf11('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xaf11('0x14')](_0xaf11('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xaf11('0x14')]('yes','no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0xaf11('0x14')](_0xaf11('0x15'),'no',_0xaf11('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xaf11('0x4')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xaf11('0x14')](_0xaf11('0x15'),'no')},'announce_position_limit':{'type':Sequelize[_0xaf11('0x13')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xaf11('0x14')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xaf11('0x4')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0xaf11('0x4')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xaf11('0x4')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xaf11('0x4')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xaf11('0x4')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xaf11('0x4')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xaf11('0x4')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xaf11('0x4')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0xaf11('0x4')]},'queue_periodic_announce':{'type':Sequelize[_0xaf11('0x4')]},'queue_less_than':{'type':Sequelize[_0xaf11('0x4')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x1bdc19){this['setDataValue'](_0xaf11('0x17'),_0x1bdc19?_0x1bdc19[_0xaf11('0x18')](','):[]);},'get':function(){return this['getDataValue'](_0xaf11('0x17'))?this['getDataValue'](_0xaf11('0x17'))[_0xaf11('0x19')](','):[];}},'joinempty':{'type':Sequelize[_0xaf11('0x4')],'defaultValue':'yes','set':function(_0x37af8c){this[_0xaf11('0xc')](_0xaf11('0x1a'),_0x37af8c?_0x37af8c[_0xaf11('0x18')](','):undefined);},'get':function(){return this[_0xaf11('0xe')]('joinempty')?this[_0xaf11('0xe')](_0xaf11('0x1a'))[_0xaf11('0x19')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xaf11('0x4')],'defaultValue':'no','set':function(_0x39428b){this[_0xaf11('0xc')](_0xaf11('0x1b'),_0x39428b?_0x39428b['join'](','):undefined);},'get':function(){return this[_0xaf11('0xe')](_0xaf11('0x1b'))?this['getDataValue'](_0xaf11('0x1b'))[_0xaf11('0x19')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0xaf11('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0xaf11('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xaf11('0x14')](_0xaf11('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xaf11('0x4')]},'acw':{'type':Sequelize[_0xaf11('0x1c')],'defaultValue':0x0,'set':function(_0x5f3501){this[_0xaf11('0xc')](_0xaf11('0x1d'),_0x5f3501);if(_0x5f3501){if(this[_0xaf11('0xe')]('wrapuptime')<0x2){this['setDataValue'](_0xaf11('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xaf11('0x13')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xaf11('0x1c')],'defaultValue':0x0,'comment':_0xaf11('0x1f')},'dialMethod':{'type':Sequelize['ENUM'](_0xaf11('0x10'),_0xaf11('0x20'),_0xaf11('0x21'),_0xaf11('0x22'),'booked'),'defaultValue':_0xaf11('0x20'),'comment':_0xaf11('0x23')},'dialLimitChannel':{'type':Sequelize[_0xaf11('0x13')](0x4)[_0xaf11('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xaf11('0x25')},'dialLimitQueue':{'type':Sequelize[_0xaf11('0x13')](0x4)[_0xaf11('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xaf11('0x26')},'dialPowerLevel':{'type':Sequelize[_0xaf11('0x27')](0x2)[_0xaf11('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xaf11('0x28')},'dialPredictiveOptimization':{'type':Sequelize[_0xaf11('0x14')](_0xaf11('0x29'),_0xaf11('0x2a')),'defaultValue':'dropRate','comment':_0xaf11('0x2b')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xaf11('0x27')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xaf11('0x2c')},'dialPredictiveInterval':{'type':Sequelize[_0xaf11('0x13')](0x3)[_0xaf11('0x24')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xaf11('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize[_0xaf11('0x4')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xaf11('0x4')]},'dialOriginateTimeout':{'type':Sequelize[_0xaf11('0x13')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0xaf11('0x4')],'defaultValue':'tTxX','comment':_0xaf11('0x2e')},'dialQueueTimeout':{'type':Sequelize[_0xaf11('0x13')](0x3)[_0xaf11('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0xaf11('0x4')],'comment':_0xaf11('0x2f')},'dialCongestionMaxRetry':{'type':Sequelize[_0xaf11('0x13')](0x3)[_0xaf11('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xaf11('0x30')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xaf11('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xaf11('0x31')},'dialBusyMaxRetry':{'type':Sequelize[_0xaf11('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xaf11('0x13')](0x5)[_0xaf11('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xaf11('0x32')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xaf11('0x13')](0x3)[_0xaf11('0x24')],'defaultValue':0x3,'comment':_0xaf11('0x33')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xaf11('0x13')](0x5)[_0xaf11('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xaf11('0x34')},'dialGlobalMaxRetry':{'type':Sequelize[_0xaf11('0x13')](0x3)[_0xaf11('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xaf11('0x35')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xaf11('0x4')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0xaf11('0x4')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xaf11('0x14')]('always',_0xaf11('0x36'),_0xaf11('0x37')),'defaultValue':_0xaf11('0x38')},'dialAMDActive':{'type':Sequelize[_0xaf11('0x1c')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xaf11('0x13')](0x9)[_0xaf11('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xaf11('0x39')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xaf11('0x13')](0x9)[_0xaf11('0x24')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xaf11('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xaf11('0x3a')},'dialAMDMinWordLength':{'type':Sequelize[_0xaf11('0x13')](0x9)[_0xaf11('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xaf11('0x13')](0x9)[_0xaf11('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xaf11('0x3b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xaf11('0x13')](0x9)[_0xaf11('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xaf11('0x3c')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xaf11('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xaf11('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xaf11('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0xaf11('0x13')](0x5)[_0xaf11('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xaf11('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0xaf11('0x1c')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0xaf11('0x14')](_0xaf11('0x40'),_0xaf11('0x41')),'defaultValue':_0xaf11('0x40')},'dialQueueProject2':{'type':Sequelize[_0xaf11('0x4')],'comment':_0xaf11('0x2f')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xaf11('0x1c')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xaf11('0x1c')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xaf11('0x13')](0x3)[_0xaf11('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xaf11('0x42')},'dialCutDigit':{'type':Sequelize[_0xaf11('0x13')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xaf11('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xaf11('0x43')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xaf11('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xaf11('0x44')},'dialDropMaxRetry':{'type':Sequelize[_0xaf11('0x13')](0x3)[_0xaf11('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xaf11('0x45')},'dialDropRetryFrequency':{'type':Sequelize[_0xaf11('0x13')](0x5)[_0xaf11('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xaf11('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xaf11('0x13')](0x3)[_0xaf11('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xaf11('0x47')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xaf11('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xaf11('0x48')},'dialMachineMaxRetry':{'type':Sequelize[_0xaf11('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xaf11('0x49')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xaf11('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xaf11('0x4a')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xaf11('0x13')](0x3)[_0xaf11('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xaf11('0x13')](0x5)[_0xaf11('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xaf11('0x4b')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xaf11('0x1c')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xbf8e4f){if(!_0xbf8e4f)this[_0xaf11('0xc')](_0xaf11('0x4c'),null);this['setDataValue'](_0xaf11('0x4d'),_0xbf8e4f);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xaf11('0x13')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xaf11('0x24')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xaf11('0x1c')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0xaf11('0x13')](0x3)[_0xaf11('0x24')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xa290=['always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','ENUM','inbound','outbound','default','leastrecent','fewestcalls','random','rrmemory','linear','setDataValue','strategy','getDataValue','dialMethod','preview','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','predictive','booked','progressive','Dial\x20Method.','UNSIGNED','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*'];(function(_0x26b6ed,_0x5688c4){var _0xe607ce=function(_0x5e4f95){while(--_0x5e4f95){_0x26b6ed['push'](_0x26b6ed['shift']());}};_0xe607ce(++_0x5688c4);}(_0xa290,0x1b8));var _0x0a29=function(_0x8041cc,_0x19cb1f){_0x8041cc=_0x8041cc-0x0;var _0x203821=_0xa290[_0x8041cc];return _0x203821;};'use strict';var Sequelize=require('sequelize');module[_0x0a29('0x0')]={'name':{'type':Sequelize[_0x0a29('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x0a29('0x2')](_0x0a29('0x3'),_0x0a29('0x4')),'allowNull':![],'defaultValue':_0x0a29('0x3')},'musiconhold':{'type':Sequelize[_0x0a29('0x1')],'defaultValue':_0x0a29('0x5')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x0a29('0x2')]('rr','ringall',_0x0a29('0x6'),_0x0a29('0x7'),_0x0a29('0x8'),_0x0a29('0x9'),_0x0a29('0xa'),'wrandom','rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x4a79ba){this[_0x0a29('0xb')](_0x0a29('0xc'),_0x4a79ba?_0x4a79ba:'rrmemory');},'get':function(){var _0x4f78ff=this['getDataValue']('type');var _0x4393d0=this[_0x0a29('0xd')](_0x0a29('0xe'));var _0x19e4c9=this['getDataValue']('strategy');if(_0x4f78ff===_0x0a29('0x4')){if(_0x4393d0===_0x0a29('0xf')){return null;}if(_0x4393d0==='booked'&&![_0x0a29('0x9'),'roundrobin']['includes'](_0x19e4c9)){this[_0x0a29('0xb')]('strategy',_0x0a29('0x9'));}}return _0x19e4c9;}},'servicelevel':{'type':Sequelize[_0x0a29('0x10')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x0a29('0x10')](0xb)},'timeout':{'type':Sequelize[_0x0a29('0x10')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x0a29('0x10')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x0a29('0x10')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x0a29('0x2')]('yes','no'),'defaultValue':_0x0a29('0x11')},'autopause':{'type':Sequelize[_0x0a29('0x2')](_0x0a29('0x11'),'no',_0x0a29('0x12')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x0a29('0x10')](0xb)},'autopausebusy':{'type':Sequelize[_0x0a29('0x2')](_0x0a29('0x11'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x0a29('0x2')](_0x0a29('0x11'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x0a29('0x10')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x0a29('0x2')](_0x0a29('0x11'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x0a29('0x11'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x0a29('0x2')](_0x0a29('0x11'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x0a29('0x2')](_0x0a29('0x11'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x0a29('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x0a29('0x10')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x0a29('0x10')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x0a29('0x10')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x0a29('0x11'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x0a29('0x11')},'announce_holdtime':{'type':Sequelize['ENUM'](_0x0a29('0x11'),'no',_0x0a29('0x13')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x0a29('0x2')](_0x0a29('0x11'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x0a29('0x2')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x0a29('0x1')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x0a29('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x0a29('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x0a29('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x0a29('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x0a29('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x0a29('0x1')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x0a29('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0x0a29('0x1')]},'queue_less_than':{'type':Sequelize[_0x0a29('0x1')]},'periodic_announce':{'type':Sequelize[_0x0a29('0x14')],'set':function(_0x3afebd){this['setDataValue'](_0x0a29('0x15'),_0x3afebd?_0x3afebd[_0x0a29('0x16')](','):[]);},'get':function(){return this['getDataValue']('periodic_announce')?this[_0x0a29('0xd')](_0x0a29('0x15'))[_0x0a29('0x17')](','):[];}},'joinempty':{'type':Sequelize[_0x0a29('0x1')],'defaultValue':_0x0a29('0x11'),'set':function(_0x2c2219){this[_0x0a29('0xb')](_0x0a29('0x18'),_0x2c2219?_0x2c2219[_0x0a29('0x16')](','):undefined);},'get':function(){return this['getDataValue'](_0x0a29('0x18'))?this[_0x0a29('0xd')]('joinempty')[_0x0a29('0x17')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x0a29('0x1')],'defaultValue':'no','set':function(_0x315729){this['setDataValue'](_0x0a29('0x19'),_0x315729?_0x315729['join'](','):undefined);},'get':function(){return this[_0x0a29('0xd')]('leavewhenempty')?this[_0x0a29('0xd')](_0x0a29('0x19'))[_0x0a29('0x17')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x0a29('0x2')](_0x0a29('0x11'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x0a29('0x2')](_0x0a29('0x11'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x0a29('0x2')](_0x0a29('0x11'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x0a29('0x1')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x0a29('0x1a')],'defaultValue':0x0,'set':function(_0x3b0600){this[_0x0a29('0xb')](_0x0a29('0x1b'),_0x3b0600);if(_0x3b0600){if(this[_0x0a29('0xd')](_0x0a29('0x1c'))<0x2){this[_0x0a29('0xb')](_0x0a29('0x1c'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x0a29('0x10')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x0a29('0x1a')],'defaultValue':0x0,'comment':_0x0a29('0x1d')},'dialMethod':{'type':Sequelize[_0x0a29('0x2')](_0x0a29('0xf'),'progressive','power',_0x0a29('0x1e'),_0x0a29('0x1f')),'defaultValue':_0x0a29('0x20'),'comment':_0x0a29('0x21')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x0a29('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x0a29('0x10')](0x4)[_0x0a29('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x0a29('0x23')](0x2)[_0x0a29('0x22')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x0a29('0x24')},'dialPredictiveOptimization':{'type':Sequelize[_0x0a29('0x2')]('agentBusyFactor',_0x0a29('0x25')),'defaultValue':_0x0a29('0x25'),'comment':_0x0a29('0x26')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x0a29('0x23')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x0a29('0x27')},'dialPredictiveInterval':{'type':Sequelize[_0x0a29('0x10')](0x3)[_0x0a29('0x22')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x0a29('0x28')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0a29('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x0a29('0x22')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a29('0x29')},'dialQueueOptions':{'type':Sequelize[_0x0a29('0x1')],'defaultValue':_0x0a29('0x2a'),'comment':_0x0a29('0x2b')},'dialQueueTimeout':{'type':Sequelize[_0x0a29('0x10')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a29('0x2c')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x0a29('0x2d')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0a29('0x10')](0x5)[_0x0a29('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a29('0x2e')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a29('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a29('0x2f')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0a29('0x10')](0x5)[_0x0a29('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a29('0x30')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a29('0x22')],'defaultValue':0x3,'comment':_0x0a29('0x31')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a29('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a29('0x32')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0a29('0x1')],'defaultValue':_0x0a29('0x33')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x0a29('0x2')](_0x0a29('0x34'),_0x0a29('0x35'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x0a29('0x36')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x0a29('0x22')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0a29('0x37')},'dialAMDGreeting':{'type':Sequelize[_0x0a29('0x10')](0x9)[_0x0a29('0x22')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0a29('0x38')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x0a29('0x22')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0a29('0x39')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0a29('0x10')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x0a29('0x10')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0a29('0x3a')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0a29('0x10')](0x9)[_0x0a29('0x22')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0a29('0x3b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0a29('0x10')](0x9)[_0x0a29('0x22')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0a29('0x3c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x0a29('0x10')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0a29('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0a29('0x10')](0x9)[_0x0a29('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a29('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0x0a29('0x10')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x0a29('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0x0a29('0x1a')],'defaultValue':0x0,'comment':_0x0a29('0x40')},'dialOrderByScheduledAt':{'type':Sequelize[_0x0a29('0x2')](_0x0a29('0x41'),'ASC'),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x0a29('0x1')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x0a29('0x1a')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0a29('0x10')](0x3)[_0x0a29('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0a29('0x42')},'dialCutDigit':{'type':Sequelize[_0x0a29('0x10')](0x3)[_0x0a29('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0a29('0x43')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0a29('0x10')](0x3)[_0x0a29('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a29('0x44')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a29('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a29('0x45')},'dialDropMaxRetry':{'type':Sequelize[_0x0a29('0x10')](0x3)[_0x0a29('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a29('0x46')},'dialDropRetryFrequency':{'type':Sequelize[_0x0a29('0x10')](0x5)[_0x0a29('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a29('0x47')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x0a29('0x10')](0x3)[_0x0a29('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a29('0x48')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0a29('0x10')](0x5)[_0x0a29('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a29('0x49')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a29('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a29('0x4a')},'dialMachineRetryFrequency':{'type':Sequelize[_0x0a29('0x10')](0x5)[_0x0a29('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a29('0x4b')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a29('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a29('0x4c')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a29('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a29('0x4d')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0a29('0x10')],'allowNull':!![],'comment':_0x0a29('0x4e')},'mandatoryDisposition':{'type':Sequelize[_0x0a29('0x1a')],'defaultValue':![],'comment':_0x0a29('0x4f'),'set':function(_0x311a97){if(!_0x311a97)this['setDataValue'](_0x0a29('0x50'),null);this[_0x0a29('0xb')](_0x0a29('0x51'),_0x311a97);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x0a29('0x10')](0x3)[_0x0a29('0x22')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x0a29('0x10')](0x3)[_0x0a29('0x22')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)[_0x0a29('0x22')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index ec372b3..9de150c 100644 --- a/server/api/voiceQueue/voiceQueue.controller.js +++ b/server/api/voiceQueue/voiceQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7217=['toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','ids','emit','userVoiceQueue:remove','addAgents','isEmpty','removeAgents','getAgents','getMembers','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','spread','dialCheckDuplicateType','always','insert','into','scheduledAt','ContactId','ListId','phone','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_hopper','fromQuery','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','moment','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','json','offset','undefined','count','set','Content-Range','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','filter','ignore','map','value','type','find','name','UserProfileResource','end','error','send','index','VoiceQueue','fieldName','getOptions','where','include','query','findAll','rows','catch','params','model','keys','rawAttributes','filters','attributes','intersection','fields','length','options','create','user','role','outbound','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','includeAll','omit','createdAt','updatedAt','body','merge','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','getHoppers','findOne','CmHopper','hasOwnProperty','nolimit','limit','order','sort','pick','VoiceQueueId','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','teams','User','online','flatMap','penalty','sequelize','transaction','addTeams','upsert','each','UserVoiceQueueRt','isNil','interface','format','SIP/%s','voicePause','forEach','userVoiceQueue:save','removeTeams','Agents','select','field','from','team_has_voice_queues','join','user_has_teams','VoiceQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push'];(function(_0x5bda3b,_0x41160f){var _0x431bb9=function(_0x160122){while(--_0x160122){_0x5bda3b['push'](_0x5bda3b['shift']());}};_0x431bb9(++_0x41160f);}(_0x7217,0x19e));var _0x7721=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x7217[_0x411add];return _0x238242;};'use strict';var moment=require(_0x7721('0x0'));var BPromise=require('bluebird');var util=require(_0x7721('0x1'));var _=require(_0x7721('0x2'));var squel=require(_0x7721('0x3'));var Redis=require(_0x7721('0x4'));var qs=require(_0x7721('0x5'));var logger=require('../../config/logger')('api');var config=require(_0x7721('0x6'));var db=require(_0x7721('0x7'))['db'];config[_0x7721('0x8')]=_[_0x7721('0x9')](config[_0x7721('0x8')],{'host':_0x7721('0xa'),'port':0x18eb});var socket=require(_0x7721('0xb'))(new Redis(config[_0x7721('0x8')]));require(_0x7721('0xc'))[_0x7721('0xd')](socket);function respondWithStatusCode(_0x3e6368,_0x2a66cb){_0x2a66cb=_0x2a66cb||0xcc;return function(_0xfa8835){if(_0xfa8835){return _0x3e6368[_0x7721('0xe')](_0x2a66cb);}return _0x3e6368[_0x7721('0xf')](_0x2a66cb)['end']();};}function respondWithResult(_0x461d1a,_0x29bc8f){_0x29bc8f=_0x29bc8f||0xc8;return function(_0x8729a6){if(_0x8729a6){return _0x461d1a[_0x7721('0xf')](_0x29bc8f)[_0x7721('0x10')](_0x8729a6);}};}function respondWithFilteredResult(_0x409b37,_0x1e7fd7){return function(_0x27b36b){if(_0x27b36b){var _0x55b4ca=typeof _0x1e7fd7[_0x7721('0x11')]===_0x7721('0x12')&&typeof _0x1e7fd7['limit']===_0x7721('0x12');var _0x30da54=_0x27b36b[_0x7721('0x13')];var _0x2e9752=_0x55b4ca?0x0:_0x1e7fd7['offset'];var _0x3cbce8=_0x55b4ca?_0x27b36b[_0x7721('0x13')]:_0x1e7fd7['offset']+_0x1e7fd7['limit'];var _0x4b183e;if(_0x3cbce8>=_0x30da54){_0x3cbce8=_0x30da54;_0x4b183e=0xc8;}else{_0x4b183e=0xce;}_0x409b37[_0x7721('0xf')](_0x4b183e);return _0x409b37[_0x7721('0x14')](_0x7721('0x15'),_0x2e9752+'-'+_0x3cbce8+'/'+_0x30da54)[_0x7721('0x10')](_0x27b36b);}return null;};}function saveUpdates(_0x5ed94b){return function(_0x20f669){if(_0x20f669){return _0x20f669['update'](_0x5ed94b)[_0x7721('0x16')](function(_0x5cb0e6){return _0x5cb0e6;});}return null;};}function removeEntity(_0xfec626){return function(_0x4e96fb){if(_0x4e96fb){return _0x4e96fb[_0x7721('0x17')]()[_0x7721('0x16')](function(){var _0x2286e5=_0x4e96fb[_0x7721('0x18')]({'plain':!![]});var _0x402820=[{'name':_0x7721('0x19'),'value':_0x7721('0x1a'),'ignore':![]},{'name':_0x7721('0x1b'),'value':'outbound','ignore':![]}];var _0x288f7e=_(_0x402820)[_0x7721('0x1c')](_0x7721('0x1d'))[_0x7721('0x1e')]('value')[_0x7721('0x1f')]();if(_['includes'](_0x288f7e,_0x2286e5[_0x7721('0x20')])){return;}var _0x288e3a=_[_0x7721('0x21')](_0x402820,[_0x7721('0x1f'),_0x2286e5[_0x7721('0x20')]])[_0x7721('0x22')];return db[_0x7721('0x23')]['destroy']({'where':{'type':_0x288e3a,'resourceId':_0x2286e5['id']}})[_0x7721('0x16')](function(){return _0x4e96fb;});})[_0x7721('0x16')](function(){_0xfec626[_0x7721('0xf')](0xcc)[_0x7721('0x24')]();});}};}function handleEntityNotFound(_0x40d550){return function(_0x16355a){if(!_0x16355a){_0x40d550[_0x7721('0xe')](0x194);}return _0x16355a;};}function handleError(_0xf753f1,_0x40f367){_0x40f367=_0x40f367||0x1f4;return function(_0x52316e){logger[_0x7721('0x25')](_0x52316e['stack']);if(_0x52316e['name']){delete _0x52316e[_0x7721('0x22')];}_0xf753f1[_0x7721('0xf')](_0x40f367)[_0x7721('0x26')](_0x52316e);};}exports[_0x7721('0x27')]=function(_0x1ea4d,_0x37b9f0){var _0xd7d703={};var _0x1da2d8={'count':0x0,'rows':[]};var _0x5c54f0=_[_0x7721('0x1e')](db[_0x7721('0x28')]['rawAttributes'],function(_0x4a25c9){return{'name':_0x4a25c9[_0x7721('0x29')],'type':_0x4a25c9[_0x7721('0x20')]['key']};});_0xd7d703=qs[_0x7721('0x2a')](_0x5c54f0,_0x1ea4d);var _0x4651b5={'where':_0xd7d703[_0x7721('0x2b')]};return db['VoiceQueue'][_0x7721('0x13')](_0x4651b5)[_0x7721('0x16')](function(_0x1492d4){_0x1da2d8[_0x7721('0x13')]=_0x1492d4;_0xd7d703[_0x7721('0x2c')]=qs['include'](_0x1ea4d[_0x7721('0x2d')]);return db[_0x7721('0x28')][_0x7721('0x2e')](_0xd7d703);})['then'](function(_0x35de7a){_0x1da2d8[_0x7721('0x2f')]=_0x35de7a;return _0x1da2d8;})['then'](respondWithFilteredResult(_0x37b9f0,_0xd7d703))[_0x7721('0x30')](handleError(_0x37b9f0,null));};exports['show']=function(_0x2d6ba0,_0x326c50){var _0x19d082={'raw':![],'where':{'id':_0x2d6ba0[_0x7721('0x31')]['id']}},_0x1d894b={};_0x1d894b[_0x7721('0x32')]=_[_0x7721('0x33')](db[_0x7721('0x28')][_0x7721('0x34')]);_0x1d894b[_0x7721('0x2d')]=_[_0x7721('0x33')](_0x2d6ba0['query']);_0x1d894b[_0x7721('0x35')]=_['intersection'](_0x1d894b[_0x7721('0x32')],_0x1d894b[_0x7721('0x2d')]);_0x19d082[_0x7721('0x36')]=_[_0x7721('0x37')](_0x1d894b[_0x7721('0x32')],qs[_0x7721('0x38')](_0x2d6ba0['query']['fields']));_0x19d082['attributes']=_0x19d082['attributes'][_0x7721('0x39')]?_0x19d082[_0x7721('0x36')]:_0x1d894b[_0x7721('0x32')];if(_0x2d6ba0[_0x7721('0x2d')]['includeAll']){_0x19d082[_0x7721('0x2c')]=[{'all':!![]}];}_0x19d082=_['merge']({},_0x19d082,_0x2d6ba0[_0x7721('0x3a')]);return db[_0x7721('0x28')]['find'](_0x19d082)[_0x7721('0x16')](handleEntityNotFound(_0x326c50,null))[_0x7721('0x16')](respondWithResult(_0x326c50,null))['catch'](handleError(_0x326c50,null));};exports['create']=function(_0x3d84d3,_0xfc4dc4){return db[_0x7721('0x28')][_0x7721('0x3b')](_0x3d84d3['body'],{})[_0x7721('0x16')](function(_0x120de9){var _0x40ce8c=_0x3d84d3[_0x7721('0x3c')][_0x7721('0x18')]({'plain':!![]});if(!_0x40ce8c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x40ce8c[_0x7721('0x3d')]==='user'){var _0xaa3216=_0x120de9['get']({'plain':!![]});var _0x2333b8=[{'name':_0x7721('0x19'),'value':_0x7721('0x1a')},{'name':'QueueCampaigns','value':_0x7721('0x3e')}];var _0x11d853=_[_0x7721('0x21')](_0x2333b8,['value',_0xaa3216[_0x7721('0x20')]])[_0x7721('0x22')];return db[_0x7721('0x3f')][_0x7721('0x21')]({'where':{'name':_0x11d853,'userProfileId':_0x40ce8c[_0x7721('0x40')]},'raw':!![]})[_0x7721('0x16')](function(_0x463ccc){if(_0x463ccc&&_0x463ccc['autoAssociation']===0x0){return db['UserProfileResource'][_0x7721('0x3b')]({'name':_0xaa3216[_0x7721('0x22')],'resourceId':_0xaa3216['id'],'type':_0x463ccc[_0x7721('0x22')],'sectionId':_0x463ccc['id']},{})[_0x7721('0x16')](function(){return _0x120de9;});}else{return _0x120de9;}})[_0x7721('0x30')](function(_0x15181b){logger[_0x7721('0x25')](_0x7721('0x41'),_0x15181b);throw _0x15181b;});}return _0x120de9;})[_0x7721('0x16')](respondWithResult(_0xfc4dc4,0xc9))[_0x7721('0x30')](handleError(_0xfc4dc4,null));};exports['clone']=function(_0x578867,_0x5ed70d){var _0x6a4664={'where':{'id':_0x578867[_0x7721('0x31')]['id']}},_0x151f69={};_0x151f69['model']=_[_0x7721('0x33')](db[_0x7721('0x28')]['rawAttributes']);_0x6a4664[_0x7721('0x36')]=_['intersection'](_0x151f69[_0x7721('0x32')],qs['fields'](_0x578867[_0x7721('0x2d')][_0x7721('0x38')]));_0x6a4664[_0x7721('0x36')]=_0x6a4664['attributes'][_0x7721('0x39')]?_0x6a4664[_0x7721('0x36')]:_0x151f69['model'];if(_0x578867[_0x7721('0x2d')][_0x7721('0x42')]){_0x6a4664[_0x7721('0x2c')]=[{'all':!![]}];}_0x6a4664=_['merge']({},_0x6a4664,_0x578867[_0x7721('0x3a')]);return db['VoiceQueue'][_0x7721('0x21')](_0x6a4664)[_0x7721('0x16')](handleEntityNotFound(_0x5ed70d,null))[_0x7721('0x16')](function(_0x443503){if(_0x443503){var _0x1c95d8=_0x443503[_0x7721('0x18')]({'plain':!![]});_0x1c95d8=qs[_0x7721('0x43')](_0x1c95d8,['id',_0x7721('0x44'),_0x7721('0x45')]);_0x578867[_0x7721('0x46')]=_[_0x7721('0x43')](_0x578867[_0x7721('0x46')],['id',_0x7721('0x44'),_0x7721('0x45')]);return db[_0x7721('0x28')]['create'](_[_0x7721('0x47')](_0x1c95d8,_0x578867[_0x7721('0x46')]),{'include':_0x578867[_0x7721('0x2d')][_0x7721('0x42')]?[{'all':!![]}]:undefined})[_0x7721('0x16')](function(_0x315127){var _0x267f5e=_0x578867['user'][_0x7721('0x18')]({'plain':!![]});if(!_0x267f5e)throw new Error(_0x7721('0x48'));if(_0x267f5e[_0x7721('0x3d')]===_0x7721('0x3c')){var _0x1f1e84=_0x315127[_0x7721('0x18')]({'plain':!![]});var _0x7fbd6c=[{'name':_0x7721('0x19'),'value':_0x7721('0x1a')},{'name':_0x7721('0x1b'),'value':_0x7721('0x3e')}];var _0x52e870=_[_0x7721('0x21')](_0x7fbd6c,[_0x7721('0x1f'),_0x1f1e84[_0x7721('0x20')]])[_0x7721('0x22')];return db[_0x7721('0x3f')][_0x7721('0x21')]({'where':{'name':_0x52e870,'userProfileId':_0x267f5e[_0x7721('0x40')]},'raw':!![]})[_0x7721('0x16')](function(_0x360882){if(_0x360882&&_0x360882[_0x7721('0x49')]===0x0){return db[_0x7721('0x23')][_0x7721('0x3b')]({'name':_0x1f1e84[_0x7721('0x22')],'resourceId':_0x1f1e84['id'],'type':_0x360882[_0x7721('0x22')],'sectionId':_0x360882['id']},{})[_0x7721('0x16')](function(){return _0x315127;});}else{return _0x315127;}})['catch'](function(_0x50e9e9){logger['error'](_0x7721('0x41'),_0x50e9e9);throw _0x50e9e9;});}return _0x315127;});}})['then'](respondWithResult(_0x5ed70d,0xc9))['catch'](handleError(_0x5ed70d,null));};exports['update']=function(_0x5d7036,_0x47925a){if(_0x5d7036[_0x7721('0x46')]['id']){delete _0x5d7036[_0x7721('0x46')]['id'];}return db['VoiceQueue'][_0x7721('0x21')]({'where':{'id':_0x5d7036['params']['id']}})['then'](handleEntityNotFound(_0x47925a,null))['then'](saveUpdates(_0x5d7036[_0x7721('0x46')],null))['then'](respondWithResult(_0x47925a,null))['catch'](handleError(_0x47925a,null));};exports['destroy']=function(_0x160292,_0x2e9155){return db[_0x7721('0x28')]['find']({'where':{'id':_0x160292[_0x7721('0x31')]['id']}})[_0x7721('0x16')](handleEntityNotFound(_0x2e9155,null))[_0x7721('0x16')](removeEntity(_0x2e9155,null))[_0x7721('0x30')](handleError(_0x2e9155,null));};exports[_0x7721('0x4a')]=function(_0x16e80b,_0xad43ce){var _0x3e3301={'raw':![],'where':{}};var _0x127f46={};var _0x197b73={'count':0x0,'rows':[]};return db[_0x7721('0x28')][_0x7721('0x4b')]({'where':{'id':_0x16e80b[_0x7721('0x31')]['id']}})[_0x7721('0x16')](handleEntityNotFound(_0xad43ce,null))[_0x7721('0x16')](function(_0x4cbd28){if(_0x4cbd28){_0x127f46[_0x7721('0x32')]=_[_0x7721('0x33')](db[_0x7721('0x4c')][_0x7721('0x34')]);_0x127f46['query']=_[_0x7721('0x33')](_0x16e80b[_0x7721('0x2d')]);_0x127f46['filters']=_[_0x7721('0x37')](_0x127f46['model'],_0x127f46[_0x7721('0x2d')]);_0x3e3301[_0x7721('0x36')]=_[_0x7721('0x37')](_0x127f46[_0x7721('0x32')],qs[_0x7721('0x38')](_0x16e80b[_0x7721('0x2d')][_0x7721('0x38')]));_0x3e3301[_0x7721('0x36')]=_0x3e3301[_0x7721('0x36')]['length']?_0x3e3301[_0x7721('0x36')]:_0x127f46[_0x7721('0x32')];if(!_0x16e80b[_0x7721('0x2d')][_0x7721('0x4d')](_0x7721('0x4e'))){_0x3e3301[_0x7721('0x4f')]=qs[_0x7721('0x4f')](_0x16e80b['query'][_0x7721('0x4f')]);_0x3e3301[_0x7721('0x11')]=qs['offset'](_0x16e80b[_0x7721('0x2d')]['offset']);}_0x3e3301[_0x7721('0x50')]=qs[_0x7721('0x51')](_0x16e80b[_0x7721('0x2d')][_0x7721('0x51')]);_0x3e3301[_0x7721('0x2b')]=qs[_0x7721('0x35')](_[_0x7721('0x52')](_0x16e80b['query'],_0x127f46[_0x7721('0x35')]));_0x3e3301[_0x7721('0x2b')][_0x7721('0x53')]=_0x4cbd28['id'];if(_0x16e80b['query']['filter']){_0x3e3301['where']=_['merge'](_0x3e3301['where'],{'$or':_[_0x7721('0x1e')](_0x3e3301[_0x7721('0x36')],function(_0x580473){var _0x2d4b3a={};_0x2d4b3a[_0x580473]={'$like':'%'+_0x16e80b[_0x7721('0x2d')][_0x7721('0x1c')]+'%'};return _0x2d4b3a;})});}_0x3e3301=_[_0x7721('0x47')]({},_0x3e3301,_0x16e80b['options']);return db[_0x7721('0x4c')][_0x7721('0x13')]({'where':_0x3e3301[_0x7721('0x2b')]})[_0x7721('0x16')](function(_0x3cf3fd){_0x197b73['count']=_0x3cf3fd;if(_0x16e80b[_0x7721('0x2d')][_0x7721('0x42')]){_0x3e3301[_0x7721('0x2c')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x3e3301);})[_0x7721('0x16')](function(_0x752564){_0x197b73[_0x7721('0x2f')]=_0x752564;return _0x197b73;});}})[_0x7721('0x16')](respondWithFilteredResult(_0xad43ce,_0x3e3301))[_0x7721('0x30')](handleError(_0xad43ce,null));};exports['getHopperHistories']=function(_0x4ba35e,_0x263070){var _0x1bd97e={'raw':!![],'where':{}};var _0x68de4={};var _0x3c66b3={'count':0x0,'rows':[]};return db[_0x7721('0x28')][_0x7721('0x4b')]({'where':{'id':_0x4ba35e[_0x7721('0x31')]['id']}})['then'](handleEntityNotFound(_0x263070,null))[_0x7721('0x16')](function(_0x413185){if(_0x413185){_0x68de4[_0x7721('0x32')]=_['keys'](db[_0x7721('0x54')][_0x7721('0x34')]);_0x68de4[_0x7721('0x2d')]=_[_0x7721('0x33')](_0x4ba35e['query']);_0x68de4['filters']=_[_0x7721('0x37')](_0x68de4[_0x7721('0x32')],_0x68de4[_0x7721('0x2d')]);_0x1bd97e[_0x7721('0x36')]=_[_0x7721('0x37')](_0x68de4[_0x7721('0x32')],qs['fields'](_0x4ba35e[_0x7721('0x2d')][_0x7721('0x38')]));_0x1bd97e[_0x7721('0x36')]=_0x1bd97e['attributes'][_0x7721('0x39')]?_0x1bd97e[_0x7721('0x36')]:_0x68de4[_0x7721('0x32')];if(!_0x4ba35e[_0x7721('0x2d')][_0x7721('0x4d')]('nolimit')){_0x1bd97e[_0x7721('0x4f')]=qs['limit'](_0x4ba35e[_0x7721('0x2d')][_0x7721('0x4f')]);_0x1bd97e[_0x7721('0x11')]=qs[_0x7721('0x11')](_0x4ba35e[_0x7721('0x2d')][_0x7721('0x11')]);}_0x1bd97e[_0x7721('0x50')]=qs[_0x7721('0x51')](_0x4ba35e[_0x7721('0x2d')][_0x7721('0x51')]);_0x1bd97e[_0x7721('0x2b')]=qs['filters'](_[_0x7721('0x52')](_0x4ba35e[_0x7721('0x2d')],_0x68de4[_0x7721('0x35')]));_0x1bd97e['where'][_0x7721('0x53')]=_0x413185['id'];if(_0x4ba35e[_0x7721('0x2d')][_0x7721('0x1c')]){_0x1bd97e[_0x7721('0x2b')]=_[_0x7721('0x47')](_0x1bd97e['where'],{'$or':_[_0x7721('0x1e')](_0x1bd97e[_0x7721('0x36')],function(_0x44326d){var _0x21b365={};_0x21b365[_0x44326d]={'$like':'%'+_0x4ba35e[_0x7721('0x2d')][_0x7721('0x1c')]+'%'};return _0x21b365;})});}_0x1bd97e=_['merge']({},_0x1bd97e,_0x4ba35e[_0x7721('0x3a')]);return db[_0x7721('0x54')]['count']({'where':_0x1bd97e[_0x7721('0x2b')]})['then'](function(_0x453792){_0x3c66b3[_0x7721('0x13')]=_0x453792;if(_0x4ba35e['query'][_0x7721('0x42')]){_0x1bd97e['include']=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x1bd97e);})[_0x7721('0x16')](function(_0x20f12e){_0x3c66b3[_0x7721('0x2f')]=_0x20f12e;return _0x3c66b3;});}})['then'](respondWithFilteredResult(_0x263070,_0x1bd97e))['catch'](handleError(_0x263070,null));};exports['getHopperFinals']=function(_0x355aa8,_0x3f7923){var _0x3c9334={'raw':!![],'where':{}};var _0x4220cf={};var _0x3b02d7={'count':0x0,'rows':[]};return db[_0x7721('0x28')]['findOne']({'where':{'id':_0x355aa8[_0x7721('0x31')]['id']}})[_0x7721('0x16')](handleEntityNotFound(_0x3f7923,null))[_0x7721('0x16')](function(_0xcf5304){if(_0xcf5304){_0x4220cf[_0x7721('0x32')]=_[_0x7721('0x33')](db[_0x7721('0x55')][_0x7721('0x34')]);_0x4220cf[_0x7721('0x2d')]=_[_0x7721('0x33')](_0x355aa8[_0x7721('0x2d')]);_0x4220cf[_0x7721('0x35')]=_['intersection'](_0x4220cf['model'],_0x4220cf[_0x7721('0x2d')]);_0x3c9334[_0x7721('0x36')]=_['intersection'](_0x4220cf[_0x7721('0x32')],qs['fields'](_0x355aa8['query'][_0x7721('0x38')]));_0x3c9334['attributes']=_0x3c9334['attributes'][_0x7721('0x39')]?_0x3c9334[_0x7721('0x36')]:_0x4220cf[_0x7721('0x32')];if(!_0x355aa8[_0x7721('0x2d')][_0x7721('0x4d')]('nolimit')){_0x3c9334[_0x7721('0x4f')]=qs[_0x7721('0x4f')](_0x355aa8[_0x7721('0x2d')][_0x7721('0x4f')]);_0x3c9334['offset']=qs['offset'](_0x355aa8[_0x7721('0x2d')][_0x7721('0x11')]);}_0x3c9334['order']=qs[_0x7721('0x51')](_0x355aa8[_0x7721('0x2d')]['sort']);_0x3c9334['where']=qs[_0x7721('0x35')](_[_0x7721('0x52')](_0x355aa8[_0x7721('0x2d')],_0x4220cf[_0x7721('0x35')]));_0x3c9334[_0x7721('0x2b')][_0x7721('0x53')]=_0xcf5304['id'];if(_0x355aa8[_0x7721('0x2d')][_0x7721('0x1c')]){_0x3c9334['where']=_[_0x7721('0x47')](_0x3c9334[_0x7721('0x2b')],{'$or':_[_0x7721('0x1e')](_0x3c9334[_0x7721('0x36')],function(_0xe1c795){var _0x9b5f60={};_0x9b5f60[_0xe1c795]={'$like':'%'+_0x355aa8[_0x7721('0x2d')]['filter']+'%'};return _0x9b5f60;})});}_0x3c9334=_[_0x7721('0x47')]({},_0x3c9334,_0x355aa8[_0x7721('0x3a')]);return db['CmHopperFinal'][_0x7721('0x13')]({'where':_0x3c9334[_0x7721('0x2b')]})[_0x7721('0x16')](function(_0xb8547a){_0x3b02d7[_0x7721('0x13')]=_0xb8547a;if(_0x355aa8[_0x7721('0x2d')][_0x7721('0x42')]){_0x3c9334[_0x7721('0x2c')]=[{'all':!![]}];}return db[_0x7721('0x55')][_0x7721('0x2e')](_0x3c9334);})['then'](function(_0x418954){_0x3b02d7[_0x7721('0x2f')]=_0x418954;return _0x3b02d7;});}})[_0x7721('0x16')](respondWithFilteredResult(_0x3f7923,_0x3c9334))[_0x7721('0x30')](handleError(_0x3f7923,null));};exports[_0x7721('0x56')]=function(_0x47653d,_0x12869b){var _0x1cfee2={'raw':!![],'where':{}};var _0x425327={};var _0x42ee11={'count':0x0,'rows':[]};return db[_0x7721('0x28')][_0x7721('0x4b')]({'where':{'id':_0x47653d[_0x7721('0x31')]['id']}})[_0x7721('0x16')](handleEntityNotFound(_0x12869b,null))[_0x7721('0x16')](function(_0x461938){if(_0x461938){_0x425327[_0x7721('0x32')]=_[_0x7721('0x33')](db[_0x7721('0x57')][_0x7721('0x34')]);_0x425327['query']=_[_0x7721('0x33')](_0x47653d['query']);_0x425327[_0x7721('0x35')]=_[_0x7721('0x37')](_0x425327[_0x7721('0x32')],_0x425327[_0x7721('0x2d')]);_0x1cfee2[_0x7721('0x36')]=_['intersection'](_0x425327['model'],qs['fields'](_0x47653d['query'][_0x7721('0x38')]));_0x1cfee2[_0x7721('0x36')]=_0x1cfee2[_0x7721('0x36')][_0x7721('0x39')]?_0x1cfee2[_0x7721('0x36')]:_0x425327['model'];if(!_0x47653d[_0x7721('0x2d')]['hasOwnProperty'](_0x7721('0x4e'))){_0x1cfee2[_0x7721('0x4f')]=qs[_0x7721('0x4f')](_0x47653d[_0x7721('0x2d')][_0x7721('0x4f')]);_0x1cfee2[_0x7721('0x11')]=qs['offset'](_0x47653d[_0x7721('0x2d')]['offset']);}_0x1cfee2['order']=qs[_0x7721('0x51')](_0x47653d[_0x7721('0x2d')][_0x7721('0x51')]);_0x1cfee2[_0x7721('0x2b')]=qs[_0x7721('0x35')](_['pick'](_0x47653d[_0x7721('0x2d')],_0x425327[_0x7721('0x35')]));_0x1cfee2[_0x7721('0x2b')][_0x7721('0x53')]=_0x461938['id'];if(_0x47653d[_0x7721('0x2d')][_0x7721('0x1c')]){_0x1cfee2[_0x7721('0x2b')]=_['merge'](_0x1cfee2[_0x7721('0x2b')],{'$or':_[_0x7721('0x1e')](_0x1cfee2[_0x7721('0x36')],function(_0x193326){var _0x1dbf47={};_0x1dbf47[_0x193326]={'$like':'%'+_0x47653d['query'][_0x7721('0x1c')]+'%'};return _0x1dbf47;})});}_0x1cfee2=_[_0x7721('0x47')]({},_0x1cfee2,_0x47653d[_0x7721('0x3a')]);return db['CmHopperBlack'][_0x7721('0x13')]({'where':_0x1cfee2[_0x7721('0x2b')]})['then'](function(_0x29403d){_0x42ee11[_0x7721('0x13')]=_0x29403d;if(_0x47653d[_0x7721('0x2d')][_0x7721('0x42')]){_0x1cfee2['include']=[{'all':!![]}];}return db[_0x7721('0x57')]['findAll'](_0x1cfee2);})[_0x7721('0x16')](function(_0x1c50c2){_0x42ee11['rows']=_0x1c50c2;return _0x42ee11;});}})[_0x7721('0x16')](respondWithFilteredResult(_0x12869b,_0x1cfee2))[_0x7721('0x30')](handleError(_0x12869b,null));};exports['getTeams']=function(_0x29968c,_0x11733f){var _0x5e3816={};var _0x7fd3e8={};var _0x52e8b1;var _0x240b0a;return db[_0x7721('0x28')][_0x7721('0x4b')]({'where':{'id':_0x29968c['params']['id']}})[_0x7721('0x16')](handleEntityNotFound(_0x11733f,null))['then'](function(_0x5a00be){if(_0x5a00be){_0x52e8b1=_0x5a00be;_0x7fd3e8[_0x7721('0x32')]=_[_0x7721('0x33')](db[_0x7721('0x58')][_0x7721('0x34')]);_0x7fd3e8[_0x7721('0x2d')]=_['keys'](_0x29968c[_0x7721('0x2d')]);_0x7fd3e8[_0x7721('0x35')]=_[_0x7721('0x37')](_0x7fd3e8[_0x7721('0x32')],_0x7fd3e8[_0x7721('0x2d')]);_0x5e3816['attributes']=_[_0x7721('0x37')](_0x7fd3e8['model'],qs[_0x7721('0x38')](_0x29968c['query']['fields']));_0x5e3816[_0x7721('0x36')]=_0x5e3816['attributes']['length']?_0x5e3816[_0x7721('0x36')]:_0x7fd3e8[_0x7721('0x32')];_0x5e3816[_0x7721('0x50')]=qs['sort'](_0x29968c[_0x7721('0x2d')]['sort']);_0x5e3816['where']=qs['filters'](_[_0x7721('0x52')](_0x29968c[_0x7721('0x2d')],_0x7fd3e8[_0x7721('0x35')]));if(_0x29968c[_0x7721('0x2d')][_0x7721('0x1c')]){_0x5e3816[_0x7721('0x2b')]=_[_0x7721('0x47')](_0x5e3816[_0x7721('0x2b')],{'$or':_[_0x7721('0x1e')](_0x5e3816[_0x7721('0x36')],function(_0x25bf32){var _0x4ec3c6={};_0x4ec3c6[_0x25bf32]={'$like':'%'+_0x29968c[_0x7721('0x2d')][_0x7721('0x1c')]+'%'};return _0x4ec3c6;})});}_0x5e3816=_[_0x7721('0x47')]({},_0x5e3816,_0x29968c[_0x7721('0x3a')]);return _0x52e8b1[_0x7721('0x59')](_0x5e3816);}})[_0x7721('0x16')](function(_0xc7e4e9){if(_0xc7e4e9){_0x240b0a=_0xc7e4e9['length'];if(!_0x29968c['query'][_0x7721('0x4d')](_0x7721('0x4e'))){_0x5e3816[_0x7721('0x4f')]=qs[_0x7721('0x4f')](_0x29968c['query'][_0x7721('0x4f')]);_0x5e3816['offset']=qs[_0x7721('0x11')](_0x29968c['query'][_0x7721('0x11')]);}return _0x52e8b1[_0x7721('0x59')](_0x5e3816);}})[_0x7721('0x16')](function(_0x249a5b){if(_0x249a5b){return _0x249a5b?{'count':_0x240b0a,'rows':_0x249a5b}:null;}})[_0x7721('0x16')](respondWithResult(_0x11733f,null))[_0x7721('0x30')](handleError(_0x11733f,null));};exports['addTeams']=function(_0x509f2d,_0x4d2644){var _0x2b0968=_0x509f2d['body'][_0x7721('0x5a')];var _0x186ada=_['map'](_0x2b0968,'id');return db[_0x7721('0x58')][_0x7721('0x2e')]({'where':{'id':_0x186ada},'attributes':['id'],'include':[{'model':db[_0x7721('0x5b')],'as':'Agents','attributes':['id',_0x7721('0x22'),_0x7721('0x5c'),'voicePause','interface'],'raw':!![]}]})[_0x7721('0x16')](function(_0xc85b9){if(_0xc85b9){var _0x58be49=_[_0x7721('0x5d')](_0xc85b9,function(_0x283716){var _0x4cd26e=_0x283716['get']({'plain':!![]});_0x4cd26e['Agents']['forEach'](function(_0x19be6b){_0x19be6b[_0x7721('0x5e')]=_[_0x7721('0x21')](_0x2b0968,{'id':_0x4cd26e['id']})['penalty'];});return _0x4cd26e['Agents'];});return db[_0x7721('0x28')][_0x7721('0x21')]({'where':{'id':_0x509f2d[_0x7721('0x31')]['id']}})[_0x7721('0x16')](function(_0x14711c){return db[_0x7721('0x5f')][_0x7721('0x60')](function(_0x435455){return _0x14711c[_0x7721('0x61')](_0x186ada,{'transaction':_0x435455})['then'](function(){return BPromise['each'](_0x2b0968,function(_0x415445){return db['TeamVoiceQueue'][_0x7721('0x62')]({'TeamId':_0x415445['id'],'VoiceQueueId':_0x509f2d['params']['id'],'penalty':_0x415445[_0x7721('0x5e')]},{'transaction':_0x435455});});})['then'](function(){return BPromise[_0x7721('0x63')](_0x58be49,function(_0x14341e){return db['UserVoiceQueue']['findOrCreate']({'where':{'UserId':_0x14341e['id'],'VoiceQueueId':_0x509f2d[_0x7721('0x31')]['id']},'defaults':{'penalty':_0x14341e[_0x7721('0x5e')]},'transaction':_0x435455});});})[_0x7721('0x16')](function(){return BPromise[_0x7721('0x63')](_[_0x7721('0x1c')](_0x58be49,{'online':!![]}),function(_0x5e69d7){return db[_0x7721('0x64')][_0x7721('0x62')]({'membername':_0x5e69d7[_0x7721('0x22')],'UserId':_0x5e69d7['id'],'queue_name':_0x14711c['name'],'VoiceQueueId':_0x14711c['id'],'interface':_[_0x7721('0x65')](_0x5e69d7[_0x7721('0x66')])?util[_0x7721('0x67')](_0x7721('0x68'),_0x5e69d7[_0x7721('0x22')]):_0x5e69d7[_0x7721('0x66')],'paused':_0x5e69d7[_0x7721('0x69')]||![],'penalty':_0x5e69d7[_0x7721('0x5e')]},{'transaction':_0x435455});});})[_0x7721('0x16')](function(){_0x58be49[_0x7721('0x6a')](function(_0x2a2d8a){socket['emit'](_0x7721('0x6b'),{'UserId':_0x2a2d8a['id'],'VoiceQueueId':_0x14711c['id']});});});});});}})[_0x7721('0x16')](respondWithStatusCode(_0x4d2644,null))[_0x7721('0x30')](handleError(_0x4d2644,null));};exports[_0x7721('0x6c')]=function(_0xcb843e,_0x35d3f1){return db[_0x7721('0x58')]['findAll']({'where':{'id':_0xcb843e[_0x7721('0x2d')]['ids']},'attributes':['id'],'include':[{'model':db[_0x7721('0x5b')],'as':_0x7721('0x6d'),'attributes':['id'],'raw':!![]}]})[_0x7721('0x16')](handleEntityNotFound(_0x35d3f1,null))[_0x7721('0x16')](function(_0x37b607){var _0x3d6d41=_['map'](_0x37b607,'id');var _0xbce1b=[];var _0x4d3ad1=[];var _0x4028fa=squel[_0x7721('0x6e')]();_0x4028fa[_0x7721('0x6f')]('tq.TeamId')[_0x7721('0x70')](_0x7721('0x71'),'tq')[_0x7721('0x72')](_0x7721('0x73'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x7721('0x2b')](_0x7721('0x74'),_0xcb843e[_0x7721('0x31')]['id']);for(var _0x980f26=0x0;_0x980f26<_0x37b607['length'];_0x980f26+=0x1){let _0x40dd5e=_0x37b607[_0x980f26];for(var _0x3d143a=0x0;_0x3d143a<_0x40dd5e[_0x7721('0x6d')][_0x7721('0x39')];_0x3d143a+=0x1){let _0x53fa66=_0x40dd5e[_0x7721('0x6d')][_0x3d143a];var _0x1a95e6=_0x4028fa[_0x7721('0x75')]();_0x1a95e6[_0x7721('0x2b')](_0x7721('0x76'),_0x53fa66['id']);_0x4d3ad1[_0x7721('0x77')](db[_0x7721('0x5f')][_0x7721('0x2d')](_0x1a95e6[_0x7721('0x78')](),{'type':db['sequelize'][_0x7721('0x79')][_0x7721('0x7a')]})[_0x7721('0x16')](function(_0x1c246b){if(_0x1c246b[_0x7721('0x39')]===0x1){return _0x53fa66['id'];}else{var _0x31447d=_[_0x7721('0x7b')](_[_0x7721('0x1e')](_0x1c246b,_0x7721('0x7c')),function(_0x14fd97){return _[_0x7721('0x7d')](_0x3d6d41,_0x14fd97);});if(_0x31447d){return _0x53fa66['id'];}}}));}}return BPromise[_0x7721('0x7e')](_0x4d3ad1)[_0x7721('0x16')](function(_0x18ccdf){_0xbce1b=_(_0xbce1b)[_0x7721('0x7f')](_0x18ccdf)[_0x7721('0x80')]()['value']();return db[_0x7721('0x28')][_0x7721('0x21')]({'where':{'id':_0xcb843e[_0x7721('0x31')]['id']}})[_0x7721('0x16')](function(_0x157310){return db[_0x7721('0x5f')][_0x7721('0x60')](function(_0xdd0e7a){return _0x157310[_0x7721('0x6c')](_0xcb843e[_0x7721('0x2d')][_0x7721('0x81')],{'transaction':_0xdd0e7a})[_0x7721('0x16')](function(){if(!_['isEmpty'](_0xbce1b)){return _0x157310['removeAgents'](_0xbce1b,{'transaction':_0xdd0e7a})[_0x7721('0x16')](function(){return db[_0x7721('0x64')][_0x7721('0x17')]({'where':{'VoiceQueueId':_0xcb843e[_0x7721('0x31')]['id'],'UserId':_0xbce1b},'transaction':_0xdd0e7a});});}})[_0x7721('0x16')](function(){_0xbce1b['forEach'](function(_0x1ebc86){socket[_0x7721('0x82')](_0x7721('0x83'),{'UserId':_0x1ebc86,'VoiceQueueId':_0x157310['id']});});});});});});})[_0x7721('0x16')](respondWithStatusCode(_0x35d3f1,null))[_0x7721('0x30')](handleError(_0x35d3f1,null));};exports[_0x7721('0x84')]=function(_0xc0f448,_0x3dc688){var _0x298aca,_0x45b430;return db[_0x7721('0x28')][_0x7721('0x21')]({'where':{'id':_0xc0f448['params']['id']}})[_0x7721('0x16')](handleEntityNotFound(_0x3dc688,null))[_0x7721('0x16')](function(_0x16e0cd){if(_0x16e0cd){_0x45b430=_0x16e0cd;return _0x16e0cd['addAgents'](_0xc0f448[_0x7721('0x46')][_0x7721('0x81')],_[_0x7721('0x43')](_0xc0f448['body'],[_0x7721('0x81'),'id'])||{})['spread'](function(_0x5f3dd2){for(var _0xa73193=0x0;_0xa73193<_0xc0f448[_0x7721('0x46')][_0x7721('0x81')][_0x7721('0x39')];_0xa73193+=0x1){socket['emit'](_0x7721('0x6b'),{'UserId':Number(_0xc0f448[_0x7721('0x46')][_0x7721('0x81')][_0xa73193]),'VoiceQueueId':Number(_0xc0f448[_0x7721('0x31')]['id'])});}return _0x5f3dd2;});}})[_0x7721('0x16')](function(_0x5b12c7){_0x298aca=_0x5b12c7||[];if(_0x45b430){return db[_0x7721('0x5b')][_0x7721('0x2e')]({'where':{'id':_0xc0f448[_0x7721('0x46')][_0x7721('0x81')]},'attributes':['id',_0x7721('0x22'),_0x7721('0x5c'),_0x7721('0x69'),_0x7721('0x66')],'raw':!![]});}})[_0x7721('0x16')](function(_0x385c86){if(!_[_0x7721('0x85')](_0x385c86)){var _0xc18d1a=[];for(var _0x9575b3=0x0;_0x9575b3<_0x385c86[_0x7721('0x39')];_0x9575b3++){if(_0x385c86[_0x9575b3][_0x7721('0x5c')]){_0xc18d1a[_0x7721('0x77')](db[_0x7721('0x64')][_0x7721('0x62')]({'membername':_0x385c86[_0x9575b3][_0x7721('0x22')],'UserId':_0x385c86[_0x9575b3]['id'],'queue_name':_0x45b430[_0x7721('0x22')],'VoiceQueueId':_0x45b430['id'],'interface':_[_0x7721('0x65')](_0x385c86[_0x9575b3][_0x7721('0x66')])?util['format'](_0x7721('0x68'),_0x385c86[_0x9575b3]['name']):_0x385c86[_0x9575b3][_0x7721('0x66')],'paused':_0x385c86[_0x9575b3][_0x7721('0x69')]||![],'penalty':_0xc0f448[_0x7721('0x46')][_0x7721('0x5e')]||0x0}));}}return BPromise['all'](_0xc18d1a);}})[_0x7721('0x16')](function(){return _0x298aca;})[_0x7721('0x16')](respondWithResult(_0x3dc688,null))['catch'](handleError(_0x3dc688,null));};exports[_0x7721('0x86')]=function(_0x3a8f89,_0x52aae1){return db[_0x7721('0x28')][_0x7721('0x21')]({'where':{'id':_0x3a8f89[_0x7721('0x31')]['id']}})[_0x7721('0x16')](handleEntityNotFound(_0x52aae1,null))[_0x7721('0x16')](function(_0x55c43c){if(_0x55c43c){return _0x55c43c['removeAgents'](_0x3a8f89[_0x7721('0x2d')][_0x7721('0x81')])['then'](function(){if(_['isArray'](_0x3a8f89[_0x7721('0x2d')]['ids'])){for(var _0x1c23e3=0x0;_0x1c23e3<_0x3a8f89[_0x7721('0x2d')][_0x7721('0x81')]['length'];_0x1c23e3+=0x1){socket[_0x7721('0x82')](_0x7721('0x83'),{'UserId':Number(_0x3a8f89[_0x7721('0x2d')][_0x7721('0x81')][_0x1c23e3]),'VoiceQueueId':Number(_0x3a8f89[_0x7721('0x31')]['id'])});}}else{socket[_0x7721('0x82')](_0x7721('0x83'),{'UserId':Number(_0x3a8f89[_0x7721('0x2d')]['ids']),'VoiceQueueId':Number(_0x3a8f89[_0x7721('0x31')]['id'])});}});}})[_0x7721('0x16')](function(_0x3c3c7e){return db[_0x7721('0x64')][_0x7721('0x17')]({'where':{'VoiceQueueId':_0x3a8f89['params']['id'],'UserId':_0x3a8f89[_0x7721('0x2d')][_0x7721('0x81')]}})[_0x7721('0x16')](function(){return _0x3c3c7e;});})[_0x7721('0x16')](respondWithStatusCode(_0x52aae1,null))[_0x7721('0x30')](handleError(_0x52aae1,null));};exports[_0x7721('0x87')]=function(_0x16b110,_0x366323){var _0x14b49e={};var _0x12f568={};var _0x259640;var _0x4a0e50;return db[_0x7721('0x28')][_0x7721('0x4b')]({'where':{'id':_0x16b110[_0x7721('0x31')]['id']}})[_0x7721('0x16')](handleEntityNotFound(_0x366323,null))[_0x7721('0x16')](function(_0x25e4db){if(_0x25e4db){_0x259640=_0x25e4db;_0x12f568[_0x7721('0x32')]=_[_0x7721('0x33')](db[_0x7721('0x5b')][_0x7721('0x34')]);_0x12f568[_0x7721('0x2d')]=_[_0x7721('0x33')](_0x16b110[_0x7721('0x2d')]);_0x12f568[_0x7721('0x35')]=_[_0x7721('0x37')](_0x12f568['model'],_0x12f568[_0x7721('0x2d')]);_0x14b49e['attributes']=_['intersection'](_0x12f568[_0x7721('0x32')],qs['fields'](_0x16b110[_0x7721('0x2d')][_0x7721('0x38')]));_0x14b49e[_0x7721('0x36')]=_0x14b49e[_0x7721('0x36')]['length']?_0x14b49e['attributes']:_0x12f568[_0x7721('0x32')];_0x14b49e[_0x7721('0x50')]=qs[_0x7721('0x51')](_0x16b110[_0x7721('0x2d')][_0x7721('0x51')]);_0x14b49e[_0x7721('0x2b')]=qs[_0x7721('0x35')](_['pick'](_0x16b110[_0x7721('0x2d')],_0x12f568['filters']));if(_0x16b110[_0x7721('0x2d')][_0x7721('0x1c')]){_0x14b49e[_0x7721('0x2b')]=_[_0x7721('0x47')](_0x14b49e[_0x7721('0x2b')],{'$or':_[_0x7721('0x1e')](_0x14b49e[_0x7721('0x36')],function(_0x184f1b){var _0xa257a0={};_0xa257a0[_0x184f1b]={'$like':'%'+_0x16b110[_0x7721('0x2d')][_0x7721('0x1c')]+'%'};return _0xa257a0;})});}_0x14b49e=_[_0x7721('0x47')]({},_0x14b49e,_0x16b110[_0x7721('0x3a')]);return _0x259640[_0x7721('0x87')](_0x14b49e);}})[_0x7721('0x16')](function(_0x1ee0c1){if(_0x1ee0c1){_0x4a0e50=_0x1ee0c1[_0x7721('0x39')];if(!_0x16b110[_0x7721('0x2d')]['hasOwnProperty'](_0x7721('0x4e'))){_0x14b49e[_0x7721('0x4f')]=qs[_0x7721('0x4f')](_0x16b110[_0x7721('0x2d')][_0x7721('0x4f')]);_0x14b49e[_0x7721('0x11')]=qs['offset'](_0x16b110[_0x7721('0x2d')][_0x7721('0x11')]);}return _0x259640[_0x7721('0x87')](_0x14b49e);}})['then'](function(_0x1bdadb){if(_0x1bdadb){return _0x1bdadb?{'count':_0x4a0e50,'rows':_0x1bdadb}:null;}})['then'](respondWithResult(_0x366323,null))[_0x7721('0x30')](handleError(_0x366323,null));};exports['getMembers']=function(_0xe5e55f,_0x17ce3b){var _0xbc0a80={};var _0xf2dc08={};var _0x5b493a;var _0x45024c;return db[_0x7721('0x28')][_0x7721('0x4b')]({'where':{'id':_0xe5e55f[_0x7721('0x31')]['id']}})['then'](handleEntityNotFound(_0x17ce3b,null))['then'](function(_0x12b255){if(_0x12b255){_0x5b493a=_0x12b255;_0xf2dc08['model']=_[_0x7721('0x33')](db[_0x7721('0x64')][_0x7721('0x34')]);_0xf2dc08[_0x7721('0x2d')]=_[_0x7721('0x33')](_0xe5e55f[_0x7721('0x2d')]);_0xf2dc08[_0x7721('0x35')]=_[_0x7721('0x37')](_0xf2dc08[_0x7721('0x32')],_0xf2dc08['query']);_0xbc0a80[_0x7721('0x36')]=_[_0x7721('0x37')](_0xf2dc08[_0x7721('0x32')],qs['fields'](_0xe5e55f['query'][_0x7721('0x38')]));_0xbc0a80[_0x7721('0x36')]=_0xbc0a80[_0x7721('0x36')][_0x7721('0x39')]?_0xbc0a80[_0x7721('0x36')]:_0xf2dc08[_0x7721('0x32')];_0xbc0a80['order']=qs[_0x7721('0x51')](_0xe5e55f[_0x7721('0x2d')]['sort']);_0xbc0a80[_0x7721('0x2b')]=qs['filters'](_[_0x7721('0x52')](_0xe5e55f['query'],_0xf2dc08[_0x7721('0x35')]));if(_0xe5e55f['query']['filter']){_0xbc0a80['where']=_[_0x7721('0x47')](_0xbc0a80['where'],{'$or':_['map'](_0xbc0a80['attributes'],function(_0x52a1ee){var _0x41c991={};_0x41c991[_0x52a1ee]={'$like':'%'+_0xe5e55f[_0x7721('0x2d')][_0x7721('0x1c')]+'%'};return _0x41c991;})});}_0xbc0a80=_[_0x7721('0x47')]({},_0xbc0a80,_0xe5e55f[_0x7721('0x3a')]);return _0x5b493a['getMembers'](_0xbc0a80);}})[_0x7721('0x16')](function(_0x22d4e0){if(_0x22d4e0){_0x45024c=_0x22d4e0['length'];if(!_0xe5e55f[_0x7721('0x2d')][_0x7721('0x4d')](_0x7721('0x4e'))){_0xbc0a80[_0x7721('0x4f')]=qs[_0x7721('0x4f')](_0xe5e55f[_0x7721('0x2d')][_0x7721('0x4f')]);_0xbc0a80[_0x7721('0x11')]=qs['offset'](_0xe5e55f[_0x7721('0x2d')][_0x7721('0x11')]);}return _0x5b493a[_0x7721('0x88')](_0xbc0a80);}})[_0x7721('0x16')](function(_0x2fbb00){return _0x2fbb00?{'count':_0x45024c,'rows':_0x2fbb00}:null;})[_0x7721('0x16')](respondWithResult(_0x17ce3b,null))[_0x7721('0x30')](handleError(_0x17ce3b,null));};exports[_0x7721('0x89')]=function(_0x561235,_0x12ad4d){var _0x226081={};var _0x17c3e7={};var _0x250cbf;var _0x255b22;return db['VoiceQueue'][_0x7721('0x4b')]({'where':{'id':_0x561235[_0x7721('0x31')]['id']}})[_0x7721('0x16')](handleEntityNotFound(_0x12ad4d,null))[_0x7721('0x16')](function(_0x396880){if(_0x396880){_0x250cbf=_0x396880;_0x17c3e7['model']=_[_0x7721('0x33')](db[_0x7721('0x8a')]['rawAttributes']);_0x17c3e7[_0x7721('0x2d')]=_[_0x7721('0x33')](_0x561235[_0x7721('0x2d')]);_0x17c3e7[_0x7721('0x35')]=_[_0x7721('0x37')](_0x17c3e7['model'],_0x17c3e7[_0x7721('0x2d')]);_0x226081[_0x7721('0x36')]=_['intersection'](_0x17c3e7['model'],qs[_0x7721('0x38')](_0x561235[_0x7721('0x2d')][_0x7721('0x38')]));_0x226081['attributes']=_0x226081[_0x7721('0x36')]['length']?_0x226081['attributes']:_0x17c3e7[_0x7721('0x32')];_0x226081[_0x7721('0x50')]=qs[_0x7721('0x51')](_0x561235[_0x7721('0x2d')][_0x7721('0x51')]);_0x226081['where']=qs[_0x7721('0x35')](_[_0x7721('0x52')](_0x561235[_0x7721('0x2d')],_0x17c3e7[_0x7721('0x35')]));if(_0x561235[_0x7721('0x2d')]['filter']){_0x226081[_0x7721('0x2b')]=_['merge'](_0x226081[_0x7721('0x2b')],{'$or':_[_0x7721('0x1e')](_0x226081[_0x7721('0x36')],function(_0x5209ff){var _0x2583c1={};_0x2583c1[_0x5209ff]={'$like':'%'+_0x561235['query'][_0x7721('0x1c')]+'%'};return _0x2583c1;})});}_0x226081=_[_0x7721('0x47')]({},_0x226081,_0x561235[_0x7721('0x3a')]);return _0x250cbf[_0x7721('0x89')](_0x226081);}})[_0x7721('0x16')](function(_0x3235d8){if(_0x3235d8){_0x255b22=_0x3235d8[_0x7721('0x39')];if(!_0x561235[_0x7721('0x2d')][_0x7721('0x4d')](_0x7721('0x4e'))){_0x226081['limit']=qs[_0x7721('0x4f')](_0x561235[_0x7721('0x2d')][_0x7721('0x4f')]);_0x226081[_0x7721('0x11')]=qs[_0x7721('0x11')](_0x561235['query'][_0x7721('0x11')]);}return _0x250cbf[_0x7721('0x89')](_0x226081);}})[_0x7721('0x16')](function(_0x501e31){if(_0x501e31){return _0x501e31?{'count':_0x255b22,'rows':_0x501e31}:null;}})[_0x7721('0x16')](respondWithResult(_0x12ad4d,null))[_0x7721('0x30')](handleError(_0x12ad4d,null));};exports[_0x7721('0x8b')]=function(_0xe325e1,_0x1aa1fc){var _0x560be6=moment()[_0x7721('0x67')](_0x7721('0x8c'));var _0x1bd066,_0xaa15c5;return db['VoiceQueue'][_0x7721('0x21')]({'where':{'id':_0xe325e1[_0x7721('0x31')]['id']}})[_0x7721('0x16')](handleEntityNotFound(_0x1aa1fc,null))[_0x7721('0x16')](function(_0x42ffff){if(_0x42ffff){_0xaa15c5=_0x42ffff;return _0x42ffff[_0x7721('0x8b')](_0xe325e1[_0x7721('0x46')][_0x7721('0x81')],_[_0x7721('0x43')](_0xe325e1[_0x7721('0x46')],[_0x7721('0x81'),'id'])||{});}return null;})[_0x7721('0x8d')](function(_0x3f19f5){var _0x28f11a;_0x1bd066=_0x3f19f5||[];var _0x3bc8f3=[];if(_0x3f19f5){for(var _0x26cea3=0x0;_0x26cea3<_0x3f19f5[_0x7721('0x39')];_0x26cea3+=0x1){var _0x57e928=_0x3f19f5[_0x26cea3]['get']({'plain':!![]});_0xaa15c5[_0x7721('0x8e')]=_0xe325e1[_0x7721('0x46')][_0x7721('0x8e')]?_0xe325e1[_0x7721('0x46')]['dialCheckDuplicateType']:_0xaa15c5[_0x7721('0x8e')];switch(_0xaa15c5['dialCheckDuplicateType']){case _0x7721('0x8f'):_0x28f11a=squel[_0x7721('0x90')]()[_0x7721('0x91')]('cm_hopper')['fromQuery'](['phone',_0x7721('0x92'),_0x7721('0x93'),_0x7721('0x94'),_0x7721('0x53'),_0x7721('0x44'),'updatedAt'],squel[_0x7721('0x6e')]()[_0x7721('0x6f')](_0x7721('0x95'),'phone')[_0x7721('0x6f')]('\x27'+_0x560be6+'\x27',_0x7721('0x92'))[_0x7721('0x6f')]('id','ContactId')[_0x7721('0x6f')](_0x57e928[_0x7721('0x96')][_0x7721('0x78')](),'ListId')[_0x7721('0x6f')](_0xe325e1[_0x7721('0x31')]['id'][_0x7721('0x78')](),_0x7721('0x53'))[_0x7721('0x6f')]('\x27'+_0x560be6+'\x27','createdAt')[_0x7721('0x6f')]('\x27'+_0x560be6+'\x27','updatedAt')['from'](_0x7721('0x97'))[_0x7721('0x2b')](_0x7721('0x98'))[_0x7721('0x2b')](_0x7721('0x99'),_0x57e928['CmListId'][_0x7721('0x78')]())[_0x7721('0x2b')](_0x7721('0x9a'))[_0x7721('0x2b')](_0x7721('0x9b'),squel[_0x7721('0x6e')]()[_0x7721('0x6f')](_0x7721('0x9c'))[_0x7721('0x70')](_0x7721('0x9d'))['where'](_0x7721('0x74'),_0xe325e1[_0x7721('0x31')]['id']['toString']()))[_0x7721('0x2b')]('phone\x20NOT\x20IN\x20(?)',squel[_0x7721('0x6e')]()['field'](_0x7721('0x9e'))['from']('cm_hopper')['where']('VoiceQueueId\x20=\x20?',_0xe325e1[_0x7721('0x31')]['id']['toString']())))[_0x7721('0x78')]();break;case _0x7721('0x9f'):_0x28f11a=squel[_0x7721('0x90')]()[_0x7721('0x91')](_0x7721('0xa0'))[_0x7721('0xa1')](['phone',_0x7721('0x92'),_0x7721('0x93'),'ListId','VoiceQueueId',_0x7721('0x44'),_0x7721('0x45')],squel[_0x7721('0x6e')]()['field'](_0x7721('0x95'),_0x7721('0x95'))[_0x7721('0x6f')]('\x27'+_0x560be6+'\x27',_0x7721('0x92'))[_0x7721('0x6f')]('id','ContactId')[_0x7721('0x6f')](_0x57e928[_0x7721('0x96')][_0x7721('0x78')](),_0x7721('0x94'))[_0x7721('0x6f')](_0xe325e1[_0x7721('0x31')]['id'][_0x7721('0x78')](),_0x7721('0x53'))['field']('\x27'+_0x560be6+'\x27','createdAt')[_0x7721('0x6f')]('\x27'+_0x560be6+'\x27',_0x7721('0x45'))['from'](_0x7721('0x97'))['where']('deletedAt\x20IS\x20NULL')[_0x7721('0x2b')]('ListId\x20=\x20?',_0x57e928[_0x7721('0x96')]['toString']())[_0x7721('0x2b')](_0x7721('0x9a'))['where'](_0x7721('0x9b'),squel[_0x7721('0x6e')]()[_0x7721('0x6f')](_0x7721('0x9e'))[_0x7721('0x70')]('cm_hopper')[_0x7721('0x2b')](_0x7721('0x74'),_0xe325e1[_0x7721('0x31')]['id'][_0x7721('0x78')]())))[_0x7721('0x78')]();break;default:_0x28f11a=squel[_0x7721('0x90')]()[_0x7721('0x91')]('cm_hopper')[_0x7721('0xa1')]([_0x7721('0x95'),_0x7721('0x92'),_0x7721('0x93'),_0x7721('0x94'),'VoiceQueueId',_0x7721('0x44'),_0x7721('0x45')],squel[_0x7721('0x6e')]()[_0x7721('0x6f')](_0x7721('0x95'),_0x7721('0x95'))[_0x7721('0x6f')]('\x27'+_0x560be6+'\x27',_0x7721('0x92'))[_0x7721('0x6f')]('id',_0x7721('0x93'))['field'](_0x57e928['CmListId'][_0x7721('0x78')](),'ListId')['field'](_0xe325e1[_0x7721('0x31')]['id'][_0x7721('0x78')](),_0x7721('0x53'))[_0x7721('0x6f')]('\x27'+_0x560be6+'\x27',_0x7721('0x44'))[_0x7721('0x6f')]('\x27'+_0x560be6+'\x27',_0x7721('0x45'))[_0x7721('0x70')](_0x7721('0x97'))[_0x7721('0x2b')](_0x7721('0x98'))[_0x7721('0x2b')](_0x7721('0x99'),_0x57e928[_0x7721('0x96')][_0x7721('0x78')]())[_0x7721('0x2b')]('phone\x20IS\x20NOT\x20NULL'))[_0x7721('0x78')]();}_0x3bc8f3[_0x7721('0x77')](db[_0x7721('0x5f')][_0x7721('0x2d')](_0x28f11a));}return BPromise[_0x7721('0x7e')](_0x3bc8f3);}})[_0x7721('0x16')](function(){var _0x5f53b3=[];var _0x8fc283=squel[_0x7721('0x90')]()['into'](_0x7721('0xa2'))['fromQuery']([_0x7721('0xa3'),_0x7721('0x95'),_0x7721('0xa4'),_0x7721('0x44'),_0x7721('0x45')],squel[_0x7721('0x6e')]()[_0x7721('0x6f')](_0x7721('0xa5'))[_0x7721('0x6f')](_0x7721('0xa6'))[_0x7721('0x6f')](_0x7721('0xa7'))[_0x7721('0x6f')]('\x27'+_0x560be6+'\x27','createdAt')[_0x7721('0x6f')]('\x27'+_0x560be6+'\x27',_0x7721('0x45'))[_0x7721('0x70')](_0x7721('0xa8'),'ci')[_0x7721('0x72')](_0x7721('0xa0'),'h',_0x7721('0xa9'))['where'](_0x7721('0xaa'),_0x560be6)[_0x7721('0x2b')](_0x7721('0xab'),'PHONE'))[_0x7721('0x78')]();_0x5f53b3['push'](db['sequelize'][_0x7721('0x2d')](_0x8fc283));return BPromise[_0x7721('0x7e')](_0x5f53b3);})['then'](function(){return _0x1bd066;})[_0x7721('0x16')](respondWithResult(_0x1aa1fc,null))[_0x7721('0x30')](handleError(_0x1aa1fc,null));};exports[_0x7721('0xac')]=function(_0xbc4f13,_0x50f4bd){return db['VoiceQueue'][_0x7721('0x21')]({'where':{'id':_0xbc4f13['params']['id']}})[_0x7721('0x16')](handleEntityNotFound(_0x50f4bd,null))[_0x7721('0x16')](function(_0x537831){if(_0x537831){return _0x537831[_0x7721('0xac')](_0xbc4f13[_0x7721('0x2d')][_0x7721('0x81')]);}})[_0x7721('0x16')](function(_0x49548e){if(_0x49548e){return db['CmHopper'][_0x7721('0x17')]({'where':{'ListId':_0xbc4f13[_0x7721('0x2d')][_0x7721('0x81')],'VoiceQueueId':_0xbc4f13[_0x7721('0x31')]['id']}})['then'](function(){return _0x49548e;});}})['then'](respondWithStatusCode(_0x50f4bd,null))[_0x7721('0x30')](handleError(_0x50f4bd,null));};exports[_0x7721('0xad')]=function(_0x4ea8ac,_0x226556){var _0x4bd023={};var _0x50de45={};var _0x51ac8f;var _0x27ed5e;return db['VoiceQueue'][_0x7721('0x4b')]({'where':{'id':_0x4ea8ac[_0x7721('0x31')]['id']}})[_0x7721('0x16')](handleEntityNotFound(_0x226556,null))['then'](function(_0x4893c0){if(_0x4893c0){_0x51ac8f=_0x4893c0;_0x50de45[_0x7721('0x32')]=_[_0x7721('0x33')](db[_0x7721('0x8a')][_0x7721('0x34')]);_0x50de45[_0x7721('0x2d')]=_['keys'](_0x4ea8ac[_0x7721('0x2d')]);_0x50de45[_0x7721('0x35')]=_[_0x7721('0x37')](_0x50de45[_0x7721('0x32')],_0x50de45[_0x7721('0x2d')]);_0x4bd023['attributes']=_[_0x7721('0x37')](_0x50de45[_0x7721('0x32')],qs[_0x7721('0x38')](_0x4ea8ac[_0x7721('0x2d')][_0x7721('0x38')]));_0x4bd023[_0x7721('0x36')]=_0x4bd023['attributes']['length']?_0x4bd023[_0x7721('0x36')]:_0x50de45[_0x7721('0x32')];_0x4bd023[_0x7721('0x50')]=qs[_0x7721('0x51')](_0x4ea8ac[_0x7721('0x2d')][_0x7721('0x51')]);_0x4bd023[_0x7721('0x2b')]=qs[_0x7721('0x35')](_[_0x7721('0x52')](_0x4ea8ac[_0x7721('0x2d')],_0x50de45[_0x7721('0x35')]));if(_0x4ea8ac['query'][_0x7721('0x1c')]){_0x4bd023[_0x7721('0x2b')]=_['merge'](_0x4bd023[_0x7721('0x2b')],{'$or':_[_0x7721('0x1e')](_0x4bd023[_0x7721('0x36')],function(_0x400273){var _0x42c438={};_0x42c438[_0x400273]={'$like':'%'+_0x4ea8ac[_0x7721('0x2d')][_0x7721('0x1c')]+'%'};return _0x42c438;})});}_0x4bd023=_[_0x7721('0x47')]({},_0x4bd023,_0x4ea8ac[_0x7721('0x3a')]);return _0x51ac8f[_0x7721('0xad')](_0x4bd023);}})[_0x7721('0x16')](function(_0x1192a8){if(_0x1192a8){_0x27ed5e=_0x1192a8[_0x7721('0x39')];if(!_0x4ea8ac['query'][_0x7721('0x4d')](_0x7721('0x4e'))){_0x4bd023['limit']=qs[_0x7721('0x4f')](_0x4ea8ac['query'][_0x7721('0x4f')]);_0x4bd023[_0x7721('0x11')]=qs['offset'](_0x4ea8ac['query'][_0x7721('0x11')]);}return _0x51ac8f['getBlackLists'](_0x4bd023);}})[_0x7721('0x16')](function(_0x2f7067){if(_0x2f7067){return _0x2f7067?{'count':_0x27ed5e,'rows':_0x2f7067}:null;}})[_0x7721('0x16')](respondWithResult(_0x226556,null))[_0x7721('0x30')](handleError(_0x226556,null));};exports[_0x7721('0xae')]=function(_0x376f37,_0x5b157e){var _0x4b84b9;return db['VoiceQueue'][_0x7721('0x21')]({'where':{'id':_0x376f37[_0x7721('0x31')]['id']}})[_0x7721('0x16')](handleEntityNotFound(_0x5b157e,null))[_0x7721('0x16')](function(_0x39d43b){if(_0x39d43b){return _0x39d43b['addBlackLists'](_0x376f37['body'][_0x7721('0x81')],_[_0x7721('0x43')](_0x376f37[_0x7721('0x46')],[_0x7721('0x81'),'id'])||{});}return null;})[_0x7721('0x8d')](function(_0x430304){var _0x469b6b;_0x4b84b9=_0x430304||[];var _0x6766c6=[];if(_0x430304){for(var _0x37877c=0x0;_0x37877c<_0x430304['length'];_0x37877c+=0x1){var _0x259eaa=_0x430304[_0x37877c][_0x7721('0x18')]({'plain':!![]});_0x469b6b=squel['insert']()['into'](_0x7721('0xaf'))[_0x7721('0xa1')]([_0x7721('0x95'),'ContactId',_0x7721('0x94'),_0x7721('0x53'),_0x7721('0x44'),_0x7721('0x45')],squel[_0x7721('0x6e')]()['field'](_0x7721('0x95'),'phone')[_0x7721('0x6f')]('id','ContactId')[_0x7721('0x6f')](_0x259eaa['CmListId'][_0x7721('0x78')](),_0x7721('0x94'))[_0x7721('0x6f')](_0x376f37[_0x7721('0x31')]['id'][_0x7721('0x78')](),_0x7721('0x53'))['field'](_0x7721('0xb0'),_0x7721('0x44'))[_0x7721('0x6f')](_0x7721('0xb0'),'updatedAt')[_0x7721('0x70')](_0x7721('0x97'))['where'](_0x7721('0x98'))[_0x7721('0x2b')](_0x7721('0x99'),_0x259eaa['CmListId']['toString']())[_0x7721('0x2b')]('phone\x20IS\x20NOT\x20NULL'))[_0x7721('0x78')]();_0x6766c6[_0x7721('0x77')](db['sequelize'][_0x7721('0x2d')](_0x469b6b));}return BPromise[_0x7721('0x7e')](_0x6766c6);}})['then'](function(){return _0x4b84b9;})[_0x7721('0x16')](respondWithResult(_0x5b157e,null))[_0x7721('0x30')](handleError(_0x5b157e,null));};exports[_0x7721('0xb1')]=function(_0x37da70,_0x54616a){return db[_0x7721('0x28')][_0x7721('0x21')]({'where':{'id':_0x37da70[_0x7721('0x31')]['id']}})['then'](handleEntityNotFound(_0x54616a,null))[_0x7721('0x16')](function(_0x174e79){if(_0x174e79){return _0x174e79['removeBlackLists'](_0x37da70[_0x7721('0x2d')]['ids']);}})[_0x7721('0x16')](function(_0x4c1b63){if(_0x4c1b63){return db[_0x7721('0x57')][_0x7721('0x17')]({'where':{'ListId':_0x37da70[_0x7721('0x2d')][_0x7721('0x81')],'VoiceQueueId':_0x37da70[_0x7721('0x31')]['id']}})['then'](function(){return _0x4c1b63;});}})[_0x7721('0x16')](respondWithStatusCode(_0x54616a,null))[_0x7721('0x30')](handleError(_0x54616a,null));}; \ No newline at end of file +var _0x9957=['includes','find','type','name','UserProfileResource','destroy','stack','send','fieldName','key','getOptions','include','query','findAll','catch','show','params','model','rawAttributes','filters','attributes','intersection','fields','includeAll','merge','VoiceQueue','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','inbound','UserProfileSection','userProfileId','autoAssociation','error','clone','length','options','omit','updatedAt','user','role','outbound','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','keys','order','sort','where','pick','CmHopper','rows','getHopperHistories','CmHopperHistory','hasOwnProperty','VoiceQueueId','getHopperFinals','CmHopperFinal','nolimit','getHopperBlacks','CmHopperBlack','getTeams','addTeams','Team','Agents','voicePause','interface','penalty','transaction','each','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','forEach','emit','userVoiceQueue:save','ids','User','field','tq.TeamId','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','every','all','union','compact','removeTeams','isEmpty','userVoiceQueue:remove','addAgents','online','SIP/%s','removeAgents','isArray','getAgents','getMembers','getLists','addLists','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','createdAt','select','ContactId','CmListId','ListId','from','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','VoiceQueueId\x20=\x20?','onlyIfOpen','cm_contacts','deletedAt\x20IS\x20NULL','COALESCE(phone,\x27\x27)','OrderBy','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','join','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','moment','bluebird','util','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','then','VoiceQueues','QueueCampaigns','filter','ignore','map','value'];(function(_0x85173b,_0x155f99){var _0x2a6dad=function(_0x3b180a){while(--_0x3b180a){_0x85173b['push'](_0x85173b['shift']());}};_0x2a6dad(++_0x155f99);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var moment=require(_0x7995('0x0'));var BPromise=require(_0x7995('0x1'));var util=require(_0x7995('0x2'));var _=require(_0x7995('0x3'));var squel=require('squel');var Redis=require(_0x7995('0x4'));var qs=require(_0x7995('0x5'));var logger=require(_0x7995('0x6'))(_0x7995('0x7'));var config=require('../../config/environment');var db=require(_0x7995('0x8'))['db'];config[_0x7995('0x9')]=_[_0x7995('0xa')](config[_0x7995('0x9')],{'host':_0x7995('0xb'),'port':0x18eb});var socket=require(_0x7995('0xc'))(new Redis(config['redis']));require(_0x7995('0xd'))[_0x7995('0xe')](socket);function respondWithStatusCode(_0x4a64f7,_0xa2e5f0){_0xa2e5f0=_0xa2e5f0||0xcc;return function(_0x3116fb){if(_0x3116fb){return _0x4a64f7[_0x7995('0xf')](_0xa2e5f0);}return _0x4a64f7[_0x7995('0x10')](_0xa2e5f0)[_0x7995('0x11')]();};}function respondWithResult(_0x1e400a,_0x341672){_0x341672=_0x341672||0xc8;return function(_0x524f7b){if(_0x524f7b){return _0x1e400a[_0x7995('0x10')](_0x341672)[_0x7995('0x12')](_0x524f7b);}};}function respondWithFilteredResult(_0x581f22,_0xb0c872){return function(_0x2cb37a){if(_0x2cb37a){var _0x19a27e=typeof _0xb0c872[_0x7995('0x13')]===_0x7995('0x14')&&typeof _0xb0c872[_0x7995('0x15')]===_0x7995('0x14');var _0x4cc004=_0x2cb37a['count'];var _0x2b4e94=_0x19a27e?0x0:_0xb0c872[_0x7995('0x13')];var _0x24b5bb=_0x19a27e?_0x2cb37a[_0x7995('0x16')]:_0xb0c872[_0x7995('0x13')]+_0xb0c872[_0x7995('0x15')];var _0x2202ce;if(_0x24b5bb>=_0x4cc004){_0x24b5bb=_0x4cc004;_0x2202ce=0xc8;}else{_0x2202ce=0xce;}_0x581f22[_0x7995('0x10')](_0x2202ce);return _0x581f22['set'](_0x7995('0x17'),_0x2b4e94+'-'+_0x24b5bb+'/'+_0x4cc004)['json'](_0x2cb37a);}return null;};}function saveUpdates(_0x2f832e){return function(_0x37f297){if(_0x37f297){return _0x37f297[_0x7995('0x18')](_0x2f832e)[_0x7995('0x19')](function(_0x1e1415){return _0x1e1415;});}return null;};}function removeEntity(_0x37a7d4){return function(_0x4faa60){if(_0x4faa60){return _0x4faa60['destroy']()[_0x7995('0x19')](function(){var _0x5e6f90=_0x4faa60['get']({'plain':!![]});var _0x3ec178=[{'name':_0x7995('0x1a'),'value':'inbound','ignore':![]},{'name':_0x7995('0x1b'),'value':'outbound','ignore':![]}];var _0x4b1a8e=_(_0x3ec178)[_0x7995('0x1c')](_0x7995('0x1d'))[_0x7995('0x1e')](_0x7995('0x1f'))[_0x7995('0x1f')]();if(_[_0x7995('0x20')](_0x4b1a8e,_0x5e6f90['type'])){return;}var _0x32a09a=_[_0x7995('0x21')](_0x3ec178,[_0x7995('0x1f'),_0x5e6f90[_0x7995('0x22')]])[_0x7995('0x23')];return db[_0x7995('0x24')][_0x7995('0x25')]({'where':{'type':_0x32a09a,'resourceId':_0x5e6f90['id']}})[_0x7995('0x19')](function(){return _0x4faa60;});})['then'](function(){_0x37a7d4[_0x7995('0x10')](0xcc)[_0x7995('0x11')]();});}};}function handleEntityNotFound(_0x401dc3){return function(_0x268ce7){if(!_0x268ce7){_0x401dc3[_0x7995('0xf')](0x194);}return _0x268ce7;};}function handleError(_0x2a307e,_0x56691a){_0x56691a=_0x56691a||0x1f4;return function(_0x47625f){logger['error'](_0x47625f[_0x7995('0x26')]);if(_0x47625f[_0x7995('0x23')]){delete _0x47625f[_0x7995('0x23')];}_0x2a307e[_0x7995('0x10')](_0x56691a)[_0x7995('0x27')](_0x47625f);};}exports['index']=function(_0x9b2a15,_0x514445){var _0x456a28={};var _0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['VoiceQueue']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x28')],'type':_0x3573be[_0x7995('0x22')][_0x7995('0x29')]};});_0x456a28=qs[_0x7995('0x2a')](_0x4253e5,_0x9b2a15);var _0x1ca460={'where':_0x456a28['where']};return db['VoiceQueue'][_0x7995('0x16')](_0x1ca460)['then'](function(_0x553671){_0x3250e0[_0x7995('0x16')]=_0x553671;_0x456a28[_0x7995('0x2b')]=qs[_0x7995('0x2b')](_0x9b2a15[_0x7995('0x2c')]);return db['VoiceQueue'][_0x7995('0x2d')](_0x456a28);})[_0x7995('0x19')](function(_0x5dd802){_0x3250e0['rows']=_0x5dd802;return _0x3250e0;})['then'](respondWithFilteredResult(_0x514445,_0x456a28))[_0x7995('0x2e')](handleError(_0x514445,null));};exports[_0x7995('0x2f')]=function(_0x4a176f,_0x3e7020){var _0x51b95d={'raw':![],'where':{'id':_0x4a176f[_0x7995('0x30')]['id']}},_0x37917b={};_0x37917b[_0x7995('0x31')]=_['keys'](db['VoiceQueue'][_0x7995('0x32')]);_0x37917b['query']=_['keys'](_0x4a176f[_0x7995('0x2c')]);_0x37917b[_0x7995('0x33')]=_['intersection'](_0x37917b[_0x7995('0x31')],_0x37917b[_0x7995('0x2c')]);_0x51b95d[_0x7995('0x34')]=_[_0x7995('0x35')](_0x37917b[_0x7995('0x31')],qs['fields'](_0x4a176f[_0x7995('0x2c')][_0x7995('0x36')]));_0x51b95d[_0x7995('0x34')]=_0x51b95d[_0x7995('0x34')]['length']?_0x51b95d[_0x7995('0x34')]:_0x37917b[_0x7995('0x31')];if(_0x4a176f[_0x7995('0x2c')][_0x7995('0x37')]){_0x51b95d[_0x7995('0x2b')]=[{'all':!![]}];}_0x51b95d=_[_0x7995('0x38')]({},_0x51b95d,_0x4a176f['options']);return db[_0x7995('0x39')][_0x7995('0x21')](_0x51b95d)[_0x7995('0x19')](handleEntityNotFound(_0x3e7020,null))[_0x7995('0x19')](respondWithResult(_0x3e7020,null))[_0x7995('0x2e')](handleError(_0x3e7020,null));};exports[_0x7995('0x3a')]=function(_0x14d638,_0x270c0e){return db[_0x7995('0x39')][_0x7995('0x3a')](_0x14d638[_0x7995('0x3b')],{})[_0x7995('0x19')](function(_0x7b4e67){var _0x53cda2=_0x14d638['user'][_0x7995('0x3c')]({'plain':!![]});if(!_0x53cda2)throw new Error(_0x7995('0x3d'));if(_0x53cda2['role']==='user'){var _0x3f8522=_0x7b4e67['get']({'plain':!![]});var _0x504a33=[{'name':_0x7995('0x1a'),'value':_0x7995('0x3e')},{'name':_0x7995('0x1b'),'value':'outbound'}];var _0x46ac4f=_['find'](_0x504a33,[_0x7995('0x1f'),_0x3f8522['type']])['name'];return db[_0x7995('0x3f')][_0x7995('0x21')]({'where':{'name':_0x46ac4f,'userProfileId':_0x53cda2[_0x7995('0x40')]},'raw':!![]})[_0x7995('0x19')](function(_0x599ecb){if(_0x599ecb&&_0x599ecb[_0x7995('0x41')]===0x0){return db[_0x7995('0x24')][_0x7995('0x3a')]({'name':_0x3f8522[_0x7995('0x23')],'resourceId':_0x3f8522['id'],'type':_0x599ecb['name'],'sectionId':_0x599ecb['id']},{})['then'](function(){return _0x7b4e67;});}else{return _0x7b4e67;}})[_0x7995('0x2e')](function(_0x55791b){logger[_0x7995('0x42')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x55791b);throw _0x55791b;});}return _0x7b4e67;})[_0x7995('0x19')](respondWithResult(_0x270c0e,0xc9))['catch'](handleError(_0x270c0e,null));};exports[_0x7995('0x43')]=function(_0x1b0373,_0x4d9245){var _0x3e9e62={'where':{'id':_0x1b0373[_0x7995('0x30')]['id']}},_0x336ff2={};_0x336ff2[_0x7995('0x31')]=_['keys'](db[_0x7995('0x39')][_0x7995('0x32')]);_0x3e9e62[_0x7995('0x34')]=_['intersection'](_0x336ff2[_0x7995('0x31')],qs[_0x7995('0x36')](_0x1b0373[_0x7995('0x2c')][_0x7995('0x36')]));_0x3e9e62[_0x7995('0x34')]=_0x3e9e62['attributes'][_0x7995('0x44')]?_0x3e9e62[_0x7995('0x34')]:_0x336ff2['model'];if(_0x1b0373[_0x7995('0x2c')]['includeAll']){_0x3e9e62[_0x7995('0x2b')]=[{'all':!![]}];}_0x3e9e62=_[_0x7995('0x38')]({},_0x3e9e62,_0x1b0373[_0x7995('0x45')]);return db[_0x7995('0x39')][_0x7995('0x21')](_0x3e9e62)[_0x7995('0x19')](handleEntityNotFound(_0x4d9245,null))[_0x7995('0x19')](function(_0x4d46bc){if(_0x4d46bc){var _0x427dcf=_0x4d46bc[_0x7995('0x3c')]({'plain':!![]});_0x427dcf=qs[_0x7995('0x46')](_0x427dcf,['id','createdAt',_0x7995('0x47')]);_0x1b0373[_0x7995('0x3b')]=_[_0x7995('0x46')](_0x1b0373['body'],['id','createdAt','updatedAt']);return db[_0x7995('0x39')][_0x7995('0x3a')](_['merge'](_0x427dcf,_0x1b0373[_0x7995('0x3b')]),{'include':_0x1b0373[_0x7995('0x2c')][_0x7995('0x37')]?[{'all':!![]}]:undefined})[_0x7995('0x19')](function(_0xc04004){var _0x528c8e=_0x1b0373[_0x7995('0x48')]['get']({'plain':!![]});if(!_0x528c8e)throw new Error(_0x7995('0x3d'));if(_0x528c8e[_0x7995('0x49')]===_0x7995('0x48')){var _0x50c7b5=_0xc04004['get']({'plain':!![]});var _0x54e2b1=[{'name':'VoiceQueues','value':_0x7995('0x3e')},{'name':_0x7995('0x1b'),'value':_0x7995('0x4a')}];var _0x150261=_[_0x7995('0x21')](_0x54e2b1,[_0x7995('0x1f'),_0x50c7b5[_0x7995('0x22')]])[_0x7995('0x23')];return db[_0x7995('0x3f')][_0x7995('0x21')]({'where':{'name':_0x150261,'userProfileId':_0x528c8e[_0x7995('0x40')]},'raw':!![]})[_0x7995('0x19')](function(_0x3da72b){if(_0x3da72b&&_0x3da72b[_0x7995('0x41')]===0x0){return db[_0x7995('0x24')][_0x7995('0x3a')]({'name':_0x50c7b5[_0x7995('0x23')],'resourceId':_0x50c7b5['id'],'type':_0x3da72b[_0x7995('0x23')],'sectionId':_0x3da72b['id']},{})[_0x7995('0x19')](function(){return _0xc04004;});}else{return _0xc04004;}})['catch'](function(_0x56a374){logger[_0x7995('0x42')](_0x7995('0x4b'),_0x56a374);throw _0x56a374;});}return _0xc04004;});}})[_0x7995('0x19')](respondWithResult(_0x4d9245,0xc9))['catch'](handleError(_0x4d9245,null));};exports['update']=function(_0x402fa0,_0x197b52){if(_0x402fa0[_0x7995('0x3b')]['id']){delete _0x402fa0[_0x7995('0x3b')]['id'];}return db['VoiceQueue'][_0x7995('0x21')]({'where':{'id':_0x402fa0[_0x7995('0x30')]['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x197b52,null))[_0x7995('0x19')](saveUpdates(_0x402fa0['body'],null))['then'](respondWithResult(_0x197b52,null))[_0x7995('0x2e')](handleError(_0x197b52,null));};exports[_0x7995('0x25')]=function(_0x6c0221,_0x1d69ce){return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0x6c0221[_0x7995('0x30')]['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x1d69ce,null))[_0x7995('0x19')](removeEntity(_0x1d69ce,null))['catch'](handleError(_0x1d69ce,null));};exports[_0x7995('0x4c')]=function(_0x3ec5a8,_0xdf9e38){var _0x1ecfdb={'raw':![],'where':{}};var _0x59c5aa={};var _0x51bf6a={'count':0x0,'rows':[]};return db[_0x7995('0x39')][_0x7995('0x4d')]({'where':{'id':_0x3ec5a8['params']['id']}})[_0x7995('0x19')](handleEntityNotFound(_0xdf9e38,null))[_0x7995('0x19')](function(_0x2e3421){if(_0x2e3421){_0x59c5aa[_0x7995('0x31')]=_[_0x7995('0x4e')](db['CmHopper'][_0x7995('0x32')]);_0x59c5aa['query']=_[_0x7995('0x4e')](_0x3ec5a8[_0x7995('0x2c')]);_0x59c5aa[_0x7995('0x33')]=_[_0x7995('0x35')](_0x59c5aa[_0x7995('0x31')],_0x59c5aa[_0x7995('0x2c')]);_0x1ecfdb[_0x7995('0x34')]=_[_0x7995('0x35')](_0x59c5aa[_0x7995('0x31')],qs[_0x7995('0x36')](_0x3ec5a8[_0x7995('0x2c')][_0x7995('0x36')]));_0x1ecfdb['attributes']=_0x1ecfdb[_0x7995('0x34')][_0x7995('0x44')]?_0x1ecfdb[_0x7995('0x34')]:_0x59c5aa[_0x7995('0x31')];if(!_0x3ec5a8[_0x7995('0x2c')]['hasOwnProperty']('nolimit')){_0x1ecfdb[_0x7995('0x15')]=qs[_0x7995('0x15')](_0x3ec5a8[_0x7995('0x2c')][_0x7995('0x15')]);_0x1ecfdb['offset']=qs[_0x7995('0x13')](_0x3ec5a8['query']['offset']);}_0x1ecfdb[_0x7995('0x4f')]=qs[_0x7995('0x50')](_0x3ec5a8[_0x7995('0x2c')][_0x7995('0x50')]);_0x1ecfdb[_0x7995('0x51')]=qs[_0x7995('0x33')](_[_0x7995('0x52')](_0x3ec5a8[_0x7995('0x2c')],_0x59c5aa[_0x7995('0x33')]));_0x1ecfdb[_0x7995('0x51')]['VoiceQueueId']=_0x2e3421['id'];if(_0x3ec5a8[_0x7995('0x2c')][_0x7995('0x1c')]){_0x1ecfdb[_0x7995('0x51')]=_['merge'](_0x1ecfdb[_0x7995('0x51')],{'$or':_[_0x7995('0x1e')](_0x1ecfdb[_0x7995('0x34')],function(_0x3a7d9d){var _0x3b0d30={};_0x3b0d30[_0x3a7d9d]={'$like':'%'+_0x3ec5a8[_0x7995('0x2c')][_0x7995('0x1c')]+'%'};return _0x3b0d30;})});}_0x1ecfdb=_[_0x7995('0x38')]({},_0x1ecfdb,_0x3ec5a8[_0x7995('0x45')]);return db[_0x7995('0x53')][_0x7995('0x16')]({'where':_0x1ecfdb['where']})['then'](function(_0xd07c1c){_0x51bf6a[_0x7995('0x16')]=_0xd07c1c;if(_0x3ec5a8[_0x7995('0x2c')][_0x7995('0x37')]){_0x1ecfdb['include']=[{'all':!![]}];}return db[_0x7995('0x53')][_0x7995('0x2d')](_0x1ecfdb);})['then'](function(_0x480fdb){_0x51bf6a[_0x7995('0x54')]=_0x480fdb;return _0x51bf6a;});}})[_0x7995('0x19')](respondWithFilteredResult(_0xdf9e38,_0x1ecfdb))['catch'](handleError(_0xdf9e38,null));};exports[_0x7995('0x55')]=function(_0x5b1cba,_0x3758f9){var _0xea9aba={'raw':!![],'where':{}};var _0x4ff9ff={};var _0x5d9d33={'count':0x0,'rows':[]};return db[_0x7995('0x39')]['findOne']({'where':{'id':_0x5b1cba[_0x7995('0x30')]['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x3758f9,null))[_0x7995('0x19')](function(_0x45bd8a){if(_0x45bd8a){_0x4ff9ff[_0x7995('0x31')]=_[_0x7995('0x4e')](db[_0x7995('0x56')][_0x7995('0x32')]);_0x4ff9ff[_0x7995('0x2c')]=_[_0x7995('0x4e')](_0x5b1cba[_0x7995('0x2c')]);_0x4ff9ff[_0x7995('0x33')]=_[_0x7995('0x35')](_0x4ff9ff[_0x7995('0x31')],_0x4ff9ff[_0x7995('0x2c')]);_0xea9aba[_0x7995('0x34')]=_[_0x7995('0x35')](_0x4ff9ff[_0x7995('0x31')],qs[_0x7995('0x36')](_0x5b1cba[_0x7995('0x2c')][_0x7995('0x36')]));_0xea9aba[_0x7995('0x34')]=_0xea9aba[_0x7995('0x34')][_0x7995('0x44')]?_0xea9aba[_0x7995('0x34')]:_0x4ff9ff[_0x7995('0x31')];if(!_0x5b1cba[_0x7995('0x2c')][_0x7995('0x57')]('nolimit')){_0xea9aba[_0x7995('0x15')]=qs[_0x7995('0x15')](_0x5b1cba['query']['limit']);_0xea9aba[_0x7995('0x13')]=qs[_0x7995('0x13')](_0x5b1cba[_0x7995('0x2c')][_0x7995('0x13')]);}_0xea9aba[_0x7995('0x4f')]=qs[_0x7995('0x50')](_0x5b1cba['query'][_0x7995('0x50')]);_0xea9aba[_0x7995('0x51')]=qs[_0x7995('0x33')](_[_0x7995('0x52')](_0x5b1cba[_0x7995('0x2c')],_0x4ff9ff[_0x7995('0x33')]));_0xea9aba[_0x7995('0x51')][_0x7995('0x58')]=_0x45bd8a['id'];if(_0x5b1cba['query'][_0x7995('0x1c')]){_0xea9aba[_0x7995('0x51')]=_['merge'](_0xea9aba['where'],{'$or':_[_0x7995('0x1e')](_0xea9aba[_0x7995('0x34')],function(_0x18e1a2){var _0x3db7a9={};_0x3db7a9[_0x18e1a2]={'$like':'%'+_0x5b1cba[_0x7995('0x2c')]['filter']+'%'};return _0x3db7a9;})});}_0xea9aba=_[_0x7995('0x38')]({},_0xea9aba,_0x5b1cba[_0x7995('0x45')]);return db['CmHopperHistory'][_0x7995('0x16')]({'where':_0xea9aba[_0x7995('0x51')]})['then'](function(_0x1535a3){_0x5d9d33['count']=_0x1535a3;if(_0x5b1cba[_0x7995('0x2c')][_0x7995('0x37')]){_0xea9aba[_0x7995('0x2b')]=[{'all':!![]}];}return db[_0x7995('0x56')][_0x7995('0x2d')](_0xea9aba);})['then'](function(_0x1f0506){_0x5d9d33[_0x7995('0x54')]=_0x1f0506;return _0x5d9d33;});}})[_0x7995('0x19')](respondWithFilteredResult(_0x3758f9,_0xea9aba))['catch'](handleError(_0x3758f9,null));};exports[_0x7995('0x59')]=function(_0x3f3434,_0x350ed3){var _0x308a26={'raw':!![],'where':{}};var _0x5d7018={};var _0x3356fd={'count':0x0,'rows':[]};return db[_0x7995('0x39')][_0x7995('0x4d')]({'where':{'id':_0x3f3434['params']['id']}})['then'](handleEntityNotFound(_0x350ed3,null))[_0x7995('0x19')](function(_0x333379){if(_0x333379){_0x5d7018['model']=_['keys'](db[_0x7995('0x5a')][_0x7995('0x32')]);_0x5d7018[_0x7995('0x2c')]=_[_0x7995('0x4e')](_0x3f3434[_0x7995('0x2c')]);_0x5d7018['filters']=_['intersection'](_0x5d7018[_0x7995('0x31')],_0x5d7018['query']);_0x308a26['attributes']=_[_0x7995('0x35')](_0x5d7018[_0x7995('0x31')],qs[_0x7995('0x36')](_0x3f3434['query'][_0x7995('0x36')]));_0x308a26[_0x7995('0x34')]=_0x308a26[_0x7995('0x34')][_0x7995('0x44')]?_0x308a26[_0x7995('0x34')]:_0x5d7018['model'];if(!_0x3f3434[_0x7995('0x2c')][_0x7995('0x57')](_0x7995('0x5b'))){_0x308a26[_0x7995('0x15')]=qs['limit'](_0x3f3434[_0x7995('0x2c')][_0x7995('0x15')]);_0x308a26['offset']=qs[_0x7995('0x13')](_0x3f3434[_0x7995('0x2c')]['offset']);}_0x308a26[_0x7995('0x4f')]=qs['sort'](_0x3f3434[_0x7995('0x2c')]['sort']);_0x308a26[_0x7995('0x51')]=qs['filters'](_[_0x7995('0x52')](_0x3f3434[_0x7995('0x2c')],_0x5d7018['filters']));_0x308a26[_0x7995('0x51')]['VoiceQueueId']=_0x333379['id'];if(_0x3f3434['query'][_0x7995('0x1c')]){_0x308a26[_0x7995('0x51')]=_[_0x7995('0x38')](_0x308a26[_0x7995('0x51')],{'$or':_['map'](_0x308a26[_0x7995('0x34')],function(_0x35044a){var _0x4bd29f={};_0x4bd29f[_0x35044a]={'$like':'%'+_0x3f3434['query'][_0x7995('0x1c')]+'%'};return _0x4bd29f;})});}_0x308a26=_['merge']({},_0x308a26,_0x3f3434[_0x7995('0x45')]);return db[_0x7995('0x5a')][_0x7995('0x16')]({'where':_0x308a26['where']})['then'](function(_0x2b7852){_0x3356fd['count']=_0x2b7852;if(_0x3f3434[_0x7995('0x2c')][_0x7995('0x37')]){_0x308a26[_0x7995('0x2b')]=[{'all':!![]}];}return db[_0x7995('0x5a')]['findAll'](_0x308a26);})['then'](function(_0x50f880){_0x3356fd[_0x7995('0x54')]=_0x50f880;return _0x3356fd;});}})[_0x7995('0x19')](respondWithFilteredResult(_0x350ed3,_0x308a26))[_0x7995('0x2e')](handleError(_0x350ed3,null));};exports[_0x7995('0x5c')]=function(_0x265f07,_0x168e7f){var _0x59a793={'raw':!![],'where':{}};var _0x53cbec={};var _0x1a2902={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x265f07[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x168e7f,null))['then'](function(_0x35c3f3){if(_0x35c3f3){_0x53cbec[_0x7995('0x31')]=_[_0x7995('0x4e')](db['CmHopperBlack'][_0x7995('0x32')]);_0x53cbec[_0x7995('0x2c')]=_[_0x7995('0x4e')](_0x265f07[_0x7995('0x2c')]);_0x53cbec[_0x7995('0x33')]=_[_0x7995('0x35')](_0x53cbec[_0x7995('0x31')],_0x53cbec[_0x7995('0x2c')]);_0x59a793[_0x7995('0x34')]=_['intersection'](_0x53cbec[_0x7995('0x31')],qs[_0x7995('0x36')](_0x265f07[_0x7995('0x2c')][_0x7995('0x36')]));_0x59a793[_0x7995('0x34')]=_0x59a793['attributes'][_0x7995('0x44')]?_0x59a793[_0x7995('0x34')]:_0x53cbec[_0x7995('0x31')];if(!_0x265f07['query']['hasOwnProperty']('nolimit')){_0x59a793[_0x7995('0x15')]=qs[_0x7995('0x15')](_0x265f07[_0x7995('0x2c')][_0x7995('0x15')]);_0x59a793[_0x7995('0x13')]=qs[_0x7995('0x13')](_0x265f07['query'][_0x7995('0x13')]);}_0x59a793['order']=qs[_0x7995('0x50')](_0x265f07[_0x7995('0x2c')][_0x7995('0x50')]);_0x59a793[_0x7995('0x51')]=qs[_0x7995('0x33')](_[_0x7995('0x52')](_0x265f07[_0x7995('0x2c')],_0x53cbec[_0x7995('0x33')]));_0x59a793[_0x7995('0x51')][_0x7995('0x58')]=_0x35c3f3['id'];if(_0x265f07[_0x7995('0x2c')]['filter']){_0x59a793[_0x7995('0x51')]=_['merge'](_0x59a793[_0x7995('0x51')],{'$or':_[_0x7995('0x1e')](_0x59a793['attributes'],function(_0x493e74){var _0x2a25eb={};_0x2a25eb[_0x493e74]={'$like':'%'+_0x265f07[_0x7995('0x2c')][_0x7995('0x1c')]+'%'};return _0x2a25eb;})});}_0x59a793=_[_0x7995('0x38')]({},_0x59a793,_0x265f07[_0x7995('0x45')]);return db[_0x7995('0x5d')][_0x7995('0x16')]({'where':_0x59a793[_0x7995('0x51')]})[_0x7995('0x19')](function(_0x3c9b3c){_0x1a2902[_0x7995('0x16')]=_0x3c9b3c;if(_0x265f07[_0x7995('0x2c')]['includeAll']){_0x59a793['include']=[{'all':!![]}];}return db[_0x7995('0x5d')][_0x7995('0x2d')](_0x59a793);})[_0x7995('0x19')](function(_0x1531a9){_0x1a2902[_0x7995('0x54')]=_0x1531a9;return _0x1a2902;});}})['then'](respondWithFilteredResult(_0x168e7f,_0x59a793))[_0x7995('0x2e')](handleError(_0x168e7f,null));};exports[_0x7995('0x5e')]=function(_0x5ebf5e,_0x46fc1c){var _0x53d693={};var _0x37416c={};var _0x30cda5;var _0x234a40;return db['VoiceQueue'][_0x7995('0x4d')]({'where':{'id':_0x5ebf5e[_0x7995('0x30')]['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x46fc1c,null))[_0x7995('0x19')](function(_0x11f9fb){if(_0x11f9fb){_0x30cda5=_0x11f9fb;_0x37416c[_0x7995('0x31')]=_[_0x7995('0x4e')](db['Team']['rawAttributes']);_0x37416c['query']=_[_0x7995('0x4e')](_0x5ebf5e[_0x7995('0x2c')]);_0x37416c['filters']=_['intersection'](_0x37416c[_0x7995('0x31')],_0x37416c[_0x7995('0x2c')]);_0x53d693['attributes']=_['intersection'](_0x37416c['model'],qs['fields'](_0x5ebf5e[_0x7995('0x2c')][_0x7995('0x36')]));_0x53d693[_0x7995('0x34')]=_0x53d693[_0x7995('0x34')]['length']?_0x53d693[_0x7995('0x34')]:_0x37416c[_0x7995('0x31')];_0x53d693['order']=qs[_0x7995('0x50')](_0x5ebf5e[_0x7995('0x2c')][_0x7995('0x50')]);_0x53d693['where']=qs[_0x7995('0x33')](_[_0x7995('0x52')](_0x5ebf5e['query'],_0x37416c[_0x7995('0x33')]));if(_0x5ebf5e[_0x7995('0x2c')][_0x7995('0x1c')]){_0x53d693[_0x7995('0x51')]=_[_0x7995('0x38')](_0x53d693[_0x7995('0x51')],{'$or':_[_0x7995('0x1e')](_0x53d693[_0x7995('0x34')],function(_0x4254de){var _0x278004={};_0x278004[_0x4254de]={'$like':'%'+_0x5ebf5e[_0x7995('0x2c')][_0x7995('0x1c')]+'%'};return _0x278004;})});}_0x53d693=_[_0x7995('0x38')]({},_0x53d693,_0x5ebf5e['options']);return _0x30cda5[_0x7995('0x5e')](_0x53d693);}})[_0x7995('0x19')](function(_0x3603e8){if(_0x3603e8){_0x234a40=_0x3603e8[_0x7995('0x44')];if(!_0x5ebf5e['query'][_0x7995('0x57')](_0x7995('0x5b'))){_0x53d693[_0x7995('0x15')]=qs['limit'](_0x5ebf5e[_0x7995('0x2c')][_0x7995('0x15')]);_0x53d693[_0x7995('0x13')]=qs[_0x7995('0x13')](_0x5ebf5e[_0x7995('0x2c')][_0x7995('0x13')]);}return _0x30cda5[_0x7995('0x5e')](_0x53d693);}})['then'](function(_0x35dbd7){if(_0x35dbd7){return _0x35dbd7?{'count':_0x234a40,'rows':_0x35dbd7}:null;}})['then'](respondWithResult(_0x46fc1c,null))[_0x7995('0x2e')](handleError(_0x46fc1c,null));};exports[_0x7995('0x5f')]=function(_0x2190d1,_0x4cae1c){var _0xd012b9=_0x2190d1['body']['teams'];var _0x4ee5ee=_['map'](_0xd012b9,'id');return db[_0x7995('0x60')][_0x7995('0x2d')]({'where':{'id':_0x4ee5ee},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7995('0x61'),'attributes':['id',_0x7995('0x23'),'online',_0x7995('0x62'),_0x7995('0x63')],'raw':!![]}]})[_0x7995('0x19')](function(_0x45a479){if(_0x45a479){var _0x443863=_['flatMap'](_0x45a479,function(_0x38ea3e){var _0x1df81d=_0x38ea3e[_0x7995('0x3c')]({'plain':!![]});_0x1df81d[_0x7995('0x61')]['forEach'](function(_0x428d5a){_0x428d5a[_0x7995('0x64')]=_[_0x7995('0x21')](_0xd012b9,{'id':_0x1df81d['id']})[_0x7995('0x64')];});return _0x1df81d[_0x7995('0x61')];});return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0x2190d1[_0x7995('0x30')]['id']}})[_0x7995('0x19')](function(_0x1fda95){return db['sequelize'][_0x7995('0x65')](function(_0x521712){return _0x1fda95[_0x7995('0x5f')](_0x4ee5ee,{'transaction':_0x521712})[_0x7995('0x19')](function(){return BPromise[_0x7995('0x66')](_0xd012b9,function(_0x50eb5e){return db['TeamVoiceQueue'][_0x7995('0x67')]({'TeamId':_0x50eb5e['id'],'VoiceQueueId':_0x2190d1[_0x7995('0x30')]['id'],'penalty':_0x50eb5e['penalty']},{'transaction':_0x521712});});})[_0x7995('0x19')](function(){return BPromise['each'](_0x443863,function(_0x43de18){return db[_0x7995('0x68')][_0x7995('0x69')]({'where':{'UserId':_0x43de18['id'],'VoiceQueueId':_0x2190d1[_0x7995('0x30')]['id']},'defaults':{'penalty':_0x43de18['penalty']},'transaction':_0x521712});});})['then'](function(){return BPromise[_0x7995('0x66')](_[_0x7995('0x1c')](_0x443863,{'online':!![]}),function(_0x365318){return db[_0x7995('0x6a')]['upsert']({'membername':_0x365318[_0x7995('0x23')],'UserId':_0x365318['id'],'queue_name':_0x1fda95[_0x7995('0x23')],'VoiceQueueId':_0x1fda95['id'],'interface':_[_0x7995('0x6b')](_0x365318[_0x7995('0x63')])?util[_0x7995('0x6c')]('SIP/%s',_0x365318['name']):_0x365318['interface'],'paused':_0x365318[_0x7995('0x62')]||![],'penalty':_0x365318[_0x7995('0x64')]},{'transaction':_0x521712});});})['then'](function(){_0x443863[_0x7995('0x6d')](function(_0x5635d6){socket[_0x7995('0x6e')](_0x7995('0x6f'),{'UserId':_0x5635d6['id'],'VoiceQueueId':_0x1fda95['id']});});});});});}})[_0x7995('0x19')](respondWithStatusCode(_0x4cae1c,null))[_0x7995('0x2e')](handleError(_0x4cae1c,null));};exports['removeTeams']=function(_0x3fbafb,_0x2caacd){return db[_0x7995('0x60')][_0x7995('0x2d')]({'where':{'id':_0x3fbafb[_0x7995('0x2c')][_0x7995('0x70')]},'attributes':['id'],'include':[{'model':db[_0x7995('0x71')],'as':_0x7995('0x61'),'attributes':['id'],'raw':!![]}]})[_0x7995('0x19')](handleEntityNotFound(_0x2caacd,null))[_0x7995('0x19')](function(_0x30893a){var _0x2b8d90=_[_0x7995('0x1e')](_0x30893a,'id');var _0x2122af=[];var _0x4ff0b6=[];var _0x764245=squel['select']();_0x764245[_0x7995('0x72')](_0x7995('0x73'))['from'](_0x7995('0x74'),'tq')['join'](_0x7995('0x75'),'ut',_0x7995('0x76'))['where']('VoiceQueueId\x20=\x20?',_0x3fbafb['params']['id']);for(var _0x8f5ecd=0x0;_0x8f5ecd<_0x30893a[_0x7995('0x44')];_0x8f5ecd+=0x1){let _0x139f76=_0x30893a[_0x8f5ecd];for(var _0x2b7bc2=0x0;_0x2b7bc2<_0x139f76['Agents'][_0x7995('0x44')];_0x2b7bc2+=0x1){let _0x2b2814=_0x139f76[_0x7995('0x61')][_0x2b7bc2];var _0x2de960=_0x764245[_0x7995('0x43')]();_0x2de960[_0x7995('0x51')](_0x7995('0x77'),_0x2b2814['id']);_0x4ff0b6[_0x7995('0x78')](db['sequelize'][_0x7995('0x2c')](_0x2de960[_0x7995('0x79')](),{'type':db[_0x7995('0x7a')][_0x7995('0x7b')]['SELECT']})[_0x7995('0x19')](function(_0x3a2958){if(_0x3a2958[_0x7995('0x44')]===0x1){return _0x2b2814['id'];}else{var _0x339e6b=_[_0x7995('0x7c')](_[_0x7995('0x1e')](_0x3a2958,'TeamId'),function(_0x1bc617){return _[_0x7995('0x20')](_0x2b8d90,_0x1bc617);});if(_0x339e6b){return _0x2b2814['id'];}}}));}}return BPromise[_0x7995('0x7d')](_0x4ff0b6)[_0x7995('0x19')](function(_0x3fcc49){_0x2122af=_(_0x2122af)[_0x7995('0x7e')](_0x3fcc49)[_0x7995('0x7f')]()[_0x7995('0x1f')]();return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0x3fbafb[_0x7995('0x30')]['id']}})[_0x7995('0x19')](function(_0x64a62d){return db[_0x7995('0x7a')][_0x7995('0x65')](function(_0x370984){return _0x64a62d[_0x7995('0x80')](_0x3fbafb[_0x7995('0x2c')][_0x7995('0x70')],{'transaction':_0x370984})[_0x7995('0x19')](function(){if(!_[_0x7995('0x81')](_0x2122af)){return _0x64a62d['removeAgents'](_0x2122af,{'transaction':_0x370984})['then'](function(){return db[_0x7995('0x6a')][_0x7995('0x25')]({'where':{'VoiceQueueId':_0x3fbafb['params']['id'],'UserId':_0x2122af},'transaction':_0x370984});});}})[_0x7995('0x19')](function(){_0x2122af['forEach'](function(_0x2ce103){socket['emit'](_0x7995('0x82'),{'UserId':_0x2ce103,'VoiceQueueId':_0x64a62d['id']});});});});});});})[_0x7995('0x19')](respondWithStatusCode(_0x2caacd,null))[_0x7995('0x2e')](handleError(_0x2caacd,null));};exports[_0x7995('0x83')]=function(_0x3aa676,_0x1df2a2){var _0xd82313,_0x1fa59d;return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0x3aa676['params']['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x1df2a2,null))[_0x7995('0x19')](function(_0x1d0481){if(_0x1d0481){_0x1fa59d=_0x1d0481;return _0x1d0481[_0x7995('0x83')](_0x3aa676['body'][_0x7995('0x70')],_[_0x7995('0x46')](_0x3aa676[_0x7995('0x3b')],[_0x7995('0x70'),'id'])||{})['spread'](function(_0x32c550){for(var _0x37e647=0x0;_0x37e647<_0x3aa676[_0x7995('0x3b')][_0x7995('0x70')][_0x7995('0x44')];_0x37e647+=0x1){socket[_0x7995('0x6e')](_0x7995('0x6f'),{'UserId':Number(_0x3aa676[_0x7995('0x3b')][_0x7995('0x70')][_0x37e647]),'VoiceQueueId':Number(_0x3aa676['params']['id'])});}return _0x32c550;});}})[_0x7995('0x19')](function(_0x5f5496){_0xd82313=_0x5f5496||[];if(_0x1fa59d){return db[_0x7995('0x71')][_0x7995('0x2d')]({'where':{'id':_0x3aa676[_0x7995('0x3b')][_0x7995('0x70')]},'attributes':['id','name',_0x7995('0x84'),_0x7995('0x62'),_0x7995('0x63')],'raw':!![]});}})[_0x7995('0x19')](function(_0x2c715){if(!_[_0x7995('0x81')](_0x2c715)){var _0x3661ab=[];for(var _0x408692=0x0;_0x408692<_0x2c715[_0x7995('0x44')];_0x408692++){if(_0x2c715[_0x408692][_0x7995('0x84')]){_0x3661ab[_0x7995('0x78')](db[_0x7995('0x6a')][_0x7995('0x67')]({'membername':_0x2c715[_0x408692][_0x7995('0x23')],'UserId':_0x2c715[_0x408692]['id'],'queue_name':_0x1fa59d['name'],'VoiceQueueId':_0x1fa59d['id'],'interface':_['isNil'](_0x2c715[_0x408692][_0x7995('0x63')])?util[_0x7995('0x6c')](_0x7995('0x85'),_0x2c715[_0x408692]['name']):_0x2c715[_0x408692][_0x7995('0x63')],'paused':_0x2c715[_0x408692][_0x7995('0x62')]||![],'penalty':_0x3aa676[_0x7995('0x3b')]['penalty']||0x0}));}}return BPromise[_0x7995('0x7d')](_0x3661ab);}})[_0x7995('0x19')](function(){return _0xd82313;})[_0x7995('0x19')](respondWithResult(_0x1df2a2,null))[_0x7995('0x2e')](handleError(_0x1df2a2,null));};exports[_0x7995('0x86')]=function(_0x3d42a3,_0x29fb77){return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0x3d42a3[_0x7995('0x30')]['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x29fb77,null))['then'](function(_0x580571){if(_0x580571){return _0x580571[_0x7995('0x86')](_0x3d42a3['query'][_0x7995('0x70')])[_0x7995('0x19')](function(){if(_[_0x7995('0x87')](_0x3d42a3[_0x7995('0x2c')][_0x7995('0x70')])){for(var _0x4eebf4=0x0;_0x4eebf4<_0x3d42a3['query'][_0x7995('0x70')][_0x7995('0x44')];_0x4eebf4+=0x1){socket[_0x7995('0x6e')](_0x7995('0x82'),{'UserId':Number(_0x3d42a3[_0x7995('0x2c')][_0x7995('0x70')][_0x4eebf4]),'VoiceQueueId':Number(_0x3d42a3[_0x7995('0x30')]['id'])});}}else{socket[_0x7995('0x6e')](_0x7995('0x82'),{'UserId':Number(_0x3d42a3[_0x7995('0x2c')]['ids']),'VoiceQueueId':Number(_0x3d42a3[_0x7995('0x30')]['id'])});}});}})[_0x7995('0x19')](function(_0x38e67a){return db[_0x7995('0x6a')]['destroy']({'where':{'VoiceQueueId':_0x3d42a3['params']['id'],'UserId':_0x3d42a3['query']['ids']}})['then'](function(){return _0x38e67a;});})[_0x7995('0x19')](respondWithStatusCode(_0x29fb77,null))['catch'](handleError(_0x29fb77,null));};exports['getAgents']=function(_0x32f19d,_0x44dbb8){var _0x181ed6={};var _0x48b807={};var _0xba00af;var _0x4f008a;return db[_0x7995('0x39')][_0x7995('0x4d')]({'where':{'id':_0x32f19d[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x44dbb8,null))[_0x7995('0x19')](function(_0x14be06){if(_0x14be06){_0xba00af=_0x14be06;_0x48b807[_0x7995('0x31')]=_['keys'](db[_0x7995('0x71')][_0x7995('0x32')]);_0x48b807[_0x7995('0x2c')]=_[_0x7995('0x4e')](_0x32f19d[_0x7995('0x2c')]);_0x48b807['filters']=_[_0x7995('0x35')](_0x48b807[_0x7995('0x31')],_0x48b807[_0x7995('0x2c')]);_0x181ed6['attributes']=_[_0x7995('0x35')](_0x48b807[_0x7995('0x31')],qs[_0x7995('0x36')](_0x32f19d[_0x7995('0x2c')][_0x7995('0x36')]));_0x181ed6['attributes']=_0x181ed6[_0x7995('0x34')][_0x7995('0x44')]?_0x181ed6[_0x7995('0x34')]:_0x48b807[_0x7995('0x31')];_0x181ed6[_0x7995('0x4f')]=qs[_0x7995('0x50')](_0x32f19d[_0x7995('0x2c')]['sort']);_0x181ed6['where']=qs[_0x7995('0x33')](_[_0x7995('0x52')](_0x32f19d['query'],_0x48b807['filters']));if(_0x32f19d[_0x7995('0x2c')][_0x7995('0x1c')]){_0x181ed6[_0x7995('0x51')]=_[_0x7995('0x38')](_0x181ed6[_0x7995('0x51')],{'$or':_[_0x7995('0x1e')](_0x181ed6[_0x7995('0x34')],function(_0x4dca11){var _0xf90cd8={};_0xf90cd8[_0x4dca11]={'$like':'%'+_0x32f19d[_0x7995('0x2c')][_0x7995('0x1c')]+'%'};return _0xf90cd8;})});}_0x181ed6=_[_0x7995('0x38')]({},_0x181ed6,_0x32f19d[_0x7995('0x45')]);return _0xba00af[_0x7995('0x88')](_0x181ed6);}})['then'](function(_0x1d7c33){if(_0x1d7c33){_0x4f008a=_0x1d7c33[_0x7995('0x44')];if(!_0x32f19d[_0x7995('0x2c')][_0x7995('0x57')](_0x7995('0x5b'))){_0x181ed6[_0x7995('0x15')]=qs[_0x7995('0x15')](_0x32f19d['query'][_0x7995('0x15')]);_0x181ed6[_0x7995('0x13')]=qs[_0x7995('0x13')](_0x32f19d[_0x7995('0x2c')]['offset']);}return _0xba00af[_0x7995('0x88')](_0x181ed6);}})['then'](function(_0x21ba9b){if(_0x21ba9b){return _0x21ba9b?{'count':_0x4f008a,'rows':_0x21ba9b}:null;}})[_0x7995('0x19')](respondWithResult(_0x44dbb8,null))['catch'](handleError(_0x44dbb8,null));};exports['getMembers']=function(_0x478c12,_0x3b22ec){var _0xf503d5={};var _0x7d2ccf={};var _0x18a3dc;var _0x503b32;return db[_0x7995('0x39')][_0x7995('0x4d')]({'where':{'id':_0x478c12[_0x7995('0x30')]['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x3b22ec,null))[_0x7995('0x19')](function(_0x1fa484){if(_0x1fa484){_0x18a3dc=_0x1fa484;_0x7d2ccf[_0x7995('0x31')]=_['keys'](db['UserVoiceQueueRt'][_0x7995('0x32')]);_0x7d2ccf['query']=_['keys'](_0x478c12[_0x7995('0x2c')]);_0x7d2ccf[_0x7995('0x33')]=_[_0x7995('0x35')](_0x7d2ccf[_0x7995('0x31')],_0x7d2ccf[_0x7995('0x2c')]);_0xf503d5[_0x7995('0x34')]=_[_0x7995('0x35')](_0x7d2ccf[_0x7995('0x31')],qs[_0x7995('0x36')](_0x478c12[_0x7995('0x2c')][_0x7995('0x36')]));_0xf503d5[_0x7995('0x34')]=_0xf503d5['attributes'][_0x7995('0x44')]?_0xf503d5[_0x7995('0x34')]:_0x7d2ccf[_0x7995('0x31')];_0xf503d5[_0x7995('0x4f')]=qs[_0x7995('0x50')](_0x478c12[_0x7995('0x2c')][_0x7995('0x50')]);_0xf503d5['where']=qs[_0x7995('0x33')](_[_0x7995('0x52')](_0x478c12[_0x7995('0x2c')],_0x7d2ccf[_0x7995('0x33')]));if(_0x478c12[_0x7995('0x2c')]['filter']){_0xf503d5[_0x7995('0x51')]=_['merge'](_0xf503d5[_0x7995('0x51')],{'$or':_[_0x7995('0x1e')](_0xf503d5[_0x7995('0x34')],function(_0x5150aa){var _0x260e84={};_0x260e84[_0x5150aa]={'$like':'%'+_0x478c12[_0x7995('0x2c')][_0x7995('0x1c')]+'%'};return _0x260e84;})});}_0xf503d5=_[_0x7995('0x38')]({},_0xf503d5,_0x478c12[_0x7995('0x45')]);return _0x18a3dc[_0x7995('0x89')](_0xf503d5);}})[_0x7995('0x19')](function(_0x4fb899){if(_0x4fb899){_0x503b32=_0x4fb899['length'];if(!_0x478c12[_0x7995('0x2c')][_0x7995('0x57')](_0x7995('0x5b'))){_0xf503d5[_0x7995('0x15')]=qs[_0x7995('0x15')](_0x478c12[_0x7995('0x2c')]['limit']);_0xf503d5[_0x7995('0x13')]=qs[_0x7995('0x13')](_0x478c12[_0x7995('0x2c')][_0x7995('0x13')]);}return _0x18a3dc['getMembers'](_0xf503d5);}})['then'](function(_0x5b93e6){return _0x5b93e6?{'count':_0x503b32,'rows':_0x5b93e6}:null;})[_0x7995('0x19')](respondWithResult(_0x3b22ec,null))['catch'](handleError(_0x3b22ec,null));};exports[_0x7995('0x8a')]=function(_0x1b6411,_0x54e348){var _0x390bd3={};var _0x3f0a01={};var _0x45d8a2;var _0x26ab59;return db[_0x7995('0x39')]['findOne']({'where':{'id':_0x1b6411['params']['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x54e348,null))[_0x7995('0x19')](function(_0x2cfa1d){if(_0x2cfa1d){_0x45d8a2=_0x2cfa1d;_0x3f0a01[_0x7995('0x31')]=_[_0x7995('0x4e')](db['CmList'][_0x7995('0x32')]);_0x3f0a01[_0x7995('0x2c')]=_[_0x7995('0x4e')](_0x1b6411[_0x7995('0x2c')]);_0x3f0a01[_0x7995('0x33')]=_['intersection'](_0x3f0a01['model'],_0x3f0a01['query']);_0x390bd3['attributes']=_[_0x7995('0x35')](_0x3f0a01[_0x7995('0x31')],qs['fields'](_0x1b6411[_0x7995('0x2c')][_0x7995('0x36')]));_0x390bd3['attributes']=_0x390bd3['attributes'][_0x7995('0x44')]?_0x390bd3[_0x7995('0x34')]:_0x3f0a01[_0x7995('0x31')];_0x390bd3[_0x7995('0x4f')]=qs[_0x7995('0x50')](_0x1b6411[_0x7995('0x2c')][_0x7995('0x50')]);_0x390bd3['where']=qs['filters'](_[_0x7995('0x52')](_0x1b6411[_0x7995('0x2c')],_0x3f0a01[_0x7995('0x33')]));if(_0x1b6411['query'][_0x7995('0x1c')]){_0x390bd3[_0x7995('0x51')]=_[_0x7995('0x38')](_0x390bd3[_0x7995('0x51')],{'$or':_[_0x7995('0x1e')](_0x390bd3[_0x7995('0x34')],function(_0x28ac7c){var _0x1b4cab={};_0x1b4cab[_0x28ac7c]={'$like':'%'+_0x1b6411[_0x7995('0x2c')]['filter']+'%'};return _0x1b4cab;})});}_0x390bd3=_['merge']({},_0x390bd3,_0x1b6411[_0x7995('0x45')]);return _0x45d8a2['getLists'](_0x390bd3);}})[_0x7995('0x19')](function(_0x5953d1){if(_0x5953d1){_0x26ab59=_0x5953d1[_0x7995('0x44')];if(!_0x1b6411[_0x7995('0x2c')][_0x7995('0x57')]('nolimit')){_0x390bd3['limit']=qs[_0x7995('0x15')](_0x1b6411[_0x7995('0x2c')][_0x7995('0x15')]);_0x390bd3[_0x7995('0x13')]=qs[_0x7995('0x13')](_0x1b6411[_0x7995('0x2c')][_0x7995('0x13')]);}return _0x45d8a2[_0x7995('0x8a')](_0x390bd3);}})[_0x7995('0x19')](function(_0x35403c){if(_0x35403c){return _0x35403c?{'count':_0x26ab59,'rows':_0x35403c}:null;}})[_0x7995('0x19')](respondWithResult(_0x54e348,null))['catch'](handleError(_0x54e348,null));};exports[_0x7995('0x8b')]=function(_0xe43c99,_0x1b7e44){var _0x442c6d=moment()[_0x7995('0x6c')]('YYYY-MM-DD\x20HH:mm:ss');var _0x3b5edf,_0x44068f;return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0xe43c99[_0x7995('0x30')]['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x1b7e44,null))[_0x7995('0x19')](function(_0x2b812f){if(_0x2b812f){_0x44068f=_0x2b812f;return _0x2b812f[_0x7995('0x8b')](_0xe43c99['body']['ids'],_[_0x7995('0x46')](_0xe43c99[_0x7995('0x3b')],[_0x7995('0x70'),'id'])||{});}return null;})[_0x7995('0x8c')](function(_0x17fd98){var _0x498d7c;_0x3b5edf=_0x17fd98||[];var _0x341024=[];if(_0x17fd98){for(var _0x2bcbc6=0x0;_0x2bcbc6<_0x17fd98[_0x7995('0x44')];_0x2bcbc6+=0x1){var _0x2dd6c7=_0x17fd98[_0x2bcbc6][_0x7995('0x3c')]({'plain':!![]});_0x44068f[_0x7995('0x8d')]=_0xe43c99[_0x7995('0x3b')][_0x7995('0x8d')]?_0xe43c99[_0x7995('0x3b')]['dialCheckDuplicateType']:_0x44068f['dialCheckDuplicateType'];switch(_0x44068f[_0x7995('0x8d')]){case _0x7995('0x8e'):_0x498d7c=squel[_0x7995('0x8f')]()[_0x7995('0x90')](_0x7995('0x91'))[_0x7995('0x92')]([_0x7995('0x93'),_0x7995('0x94'),'ContactId','ListId',_0x7995('0x58'),_0x7995('0x95'),_0x7995('0x47')],squel[_0x7995('0x96')]()['field']('phone',_0x7995('0x93'))[_0x7995('0x72')]('\x27'+_0x442c6d+'\x27',_0x7995('0x94'))[_0x7995('0x72')]('id',_0x7995('0x97'))[_0x7995('0x72')](_0x2dd6c7[_0x7995('0x98')][_0x7995('0x79')](),_0x7995('0x99'))[_0x7995('0x72')](_0xe43c99[_0x7995('0x30')]['id'][_0x7995('0x79')](),'VoiceQueueId')['field']('\x27'+_0x442c6d+'\x27',_0x7995('0x95'))[_0x7995('0x72')]('\x27'+_0x442c6d+'\x27',_0x7995('0x47'))[_0x7995('0x9a')]('cm_contacts')[_0x7995('0x51')]('deletedAt\x20IS\x20NULL')[_0x7995('0x51')](_0x7995('0x9b'),_0x2dd6c7[_0x7995('0x98')][_0x7995('0x79')]())[_0x7995('0x51')](_0x7995('0x9c'))['where'](_0x7995('0x9d'),squel[_0x7995('0x96')]()[_0x7995('0x72')](_0x7995('0x9e'))['from']('cm_hopper_final')[_0x7995('0x51')](_0x7995('0x9f'),_0xe43c99[_0x7995('0x30')]['id'][_0x7995('0x79')]()))['where'](_0x7995('0x9d'),squel[_0x7995('0x96')]()[_0x7995('0x72')]('COALESCE(phone,\x27\x27)')[_0x7995('0x9a')](_0x7995('0x91'))[_0x7995('0x51')]('VoiceQueueId\x20=\x20?',_0xe43c99[_0x7995('0x30')]['id'][_0x7995('0x79')]())))[_0x7995('0x79')]();break;case _0x7995('0xa0'):_0x498d7c=squel[_0x7995('0x8f')]()[_0x7995('0x90')](_0x7995('0x91'))[_0x7995('0x92')]([_0x7995('0x93'),'scheduledAt',_0x7995('0x97'),_0x7995('0x99'),_0x7995('0x58'),_0x7995('0x95'),'updatedAt'],squel[_0x7995('0x96')]()[_0x7995('0x72')](_0x7995('0x93'),_0x7995('0x93'))['field']('\x27'+_0x442c6d+'\x27',_0x7995('0x94'))[_0x7995('0x72')]('id',_0x7995('0x97'))[_0x7995('0x72')](_0x2dd6c7[_0x7995('0x98')][_0x7995('0x79')](),_0x7995('0x99'))['field'](_0xe43c99[_0x7995('0x30')]['id'][_0x7995('0x79')](),_0x7995('0x58'))[_0x7995('0x72')]('\x27'+_0x442c6d+'\x27',_0x7995('0x95'))['field']('\x27'+_0x442c6d+'\x27',_0x7995('0x47'))['from'](_0x7995('0xa1'))[_0x7995('0x51')](_0x7995('0xa2'))['where']('ListId\x20=\x20?',_0x2dd6c7['CmListId'][_0x7995('0x79')]())[_0x7995('0x51')](_0x7995('0x9c'))[_0x7995('0x51')](_0x7995('0x9d'),squel[_0x7995('0x96')]()['field'](_0x7995('0xa3'))[_0x7995('0x9a')](_0x7995('0x91'))[_0x7995('0x51')]('VoiceQueueId\x20=\x20?',_0xe43c99[_0x7995('0x30')]['id'][_0x7995('0x79')]())))['toString']();break;default:_0x498d7c=squel[_0x7995('0x8f')]()['into'](_0x7995('0x91'))[_0x7995('0x92')]([_0x7995('0x93'),'scheduledAt','ContactId',_0x7995('0x99'),_0x7995('0x58'),_0x7995('0x95'),_0x7995('0x47')],squel[_0x7995('0x96')]()[_0x7995('0x72')](_0x7995('0x93'),_0x7995('0x93'))[_0x7995('0x72')]('\x27'+_0x442c6d+'\x27',_0x7995('0x94'))[_0x7995('0x72')]('id','ContactId')['field'](_0x2dd6c7[_0x7995('0x98')][_0x7995('0x79')](),_0x7995('0x99'))[_0x7995('0x72')](_0xe43c99['params']['id']['toString'](),_0x7995('0x58'))[_0x7995('0x72')]('\x27'+_0x442c6d+'\x27','createdAt')['field']('\x27'+_0x442c6d+'\x27',_0x7995('0x47'))[_0x7995('0x9a')](_0x7995('0xa1'))[_0x7995('0x51')](_0x7995('0xa2'))['where'](_0x7995('0x9b'),_0x2dd6c7[_0x7995('0x98')]['toString']())[_0x7995('0x51')](_0x7995('0x9c')))[_0x7995('0x79')]();}_0x341024['push'](db[_0x7995('0x7a')][_0x7995('0x2c')](_0x498d7c));}return BPromise[_0x7995('0x7d')](_0x341024);}})[_0x7995('0x19')](function(){var _0x113e03=[];var _0x5348b1=squel['insert']()[_0x7995('0x90')]('cm_hopper_additional_phones')[_0x7995('0x92')](['CmHopperId',_0x7995('0x93'),_0x7995('0xa4'),_0x7995('0x95'),'updatedAt'],squel['select']()['field'](_0x7995('0xa5'))[_0x7995('0x72')](_0x7995('0xa6'))['field'](_0x7995('0xa7'))[_0x7995('0x72')]('\x27'+_0x442c6d+'\x27','createdAt')[_0x7995('0x72')]('\x27'+_0x442c6d+'\x27',_0x7995('0x47'))[_0x7995('0x9a')](_0x7995('0xa8'),'ci')[_0x7995('0xa9')]('cm_hopper','h','h.ContactId=ci.CmContactId')[_0x7995('0x51')](_0x7995('0xaa'),_0x442c6d)[_0x7995('0x51')](_0x7995('0xab'),_0x7995('0xac')))[_0x7995('0x79')]();_0x113e03[_0x7995('0x78')](db[_0x7995('0x7a')][_0x7995('0x2c')](_0x5348b1));return BPromise[_0x7995('0x7d')](_0x113e03);})['then'](function(){return _0x3b5edf;})[_0x7995('0x19')](respondWithResult(_0x1b7e44,null))[_0x7995('0x2e')](handleError(_0x1b7e44,null));};exports[_0x7995('0xad')]=function(_0xff759b,_0x39ee00){return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0xff759b['params']['id']}})['then'](handleEntityNotFound(_0x39ee00,null))[_0x7995('0x19')](function(_0x2aec8d){if(_0x2aec8d){return _0x2aec8d[_0x7995('0xad')](_0xff759b[_0x7995('0x2c')]['ids']);}})['then'](function(_0x4b477a){if(_0x4b477a){return db[_0x7995('0x53')][_0x7995('0x25')]({'where':{'ListId':_0xff759b['query'][_0x7995('0x70')],'VoiceQueueId':_0xff759b[_0x7995('0x30')]['id']}})[_0x7995('0x19')](function(){return _0x4b477a;});}})[_0x7995('0x19')](respondWithStatusCode(_0x39ee00,null))[_0x7995('0x2e')](handleError(_0x39ee00,null));};exports[_0x7995('0xae')]=function(_0x35229d,_0x22d392){var _0x57438e={};var _0x463c25={};var _0x13d525;var _0x37b7e7;return db['VoiceQueue'][_0x7995('0x4d')]({'where':{'id':_0x35229d['params']['id']}})['then'](handleEntityNotFound(_0x22d392,null))['then'](function(_0x507bf3){if(_0x507bf3){_0x13d525=_0x507bf3;_0x463c25[_0x7995('0x31')]=_['keys'](db[_0x7995('0xaf')][_0x7995('0x32')]);_0x463c25['query']=_[_0x7995('0x4e')](_0x35229d[_0x7995('0x2c')]);_0x463c25[_0x7995('0x33')]=_[_0x7995('0x35')](_0x463c25['model'],_0x463c25[_0x7995('0x2c')]);_0x57438e['attributes']=_[_0x7995('0x35')](_0x463c25[_0x7995('0x31')],qs[_0x7995('0x36')](_0x35229d[_0x7995('0x2c')][_0x7995('0x36')]));_0x57438e[_0x7995('0x34')]=_0x57438e[_0x7995('0x34')][_0x7995('0x44')]?_0x57438e[_0x7995('0x34')]:_0x463c25[_0x7995('0x31')];_0x57438e['order']=qs[_0x7995('0x50')](_0x35229d[_0x7995('0x2c')]['sort']);_0x57438e[_0x7995('0x51')]=qs[_0x7995('0x33')](_[_0x7995('0x52')](_0x35229d[_0x7995('0x2c')],_0x463c25[_0x7995('0x33')]));if(_0x35229d[_0x7995('0x2c')]['filter']){_0x57438e[_0x7995('0x51')]=_['merge'](_0x57438e[_0x7995('0x51')],{'$or':_[_0x7995('0x1e')](_0x57438e[_0x7995('0x34')],function(_0xb79b0b){var _0x259bf2={};_0x259bf2[_0xb79b0b]={'$like':'%'+_0x35229d[_0x7995('0x2c')]['filter']+'%'};return _0x259bf2;})});}_0x57438e=_[_0x7995('0x38')]({},_0x57438e,_0x35229d[_0x7995('0x45')]);return _0x13d525[_0x7995('0xae')](_0x57438e);}})['then'](function(_0x1176cd){if(_0x1176cd){_0x37b7e7=_0x1176cd[_0x7995('0x44')];if(!_0x35229d[_0x7995('0x2c')][_0x7995('0x57')](_0x7995('0x5b'))){_0x57438e[_0x7995('0x15')]=qs[_0x7995('0x15')](_0x35229d[_0x7995('0x2c')][_0x7995('0x15')]);_0x57438e[_0x7995('0x13')]=qs[_0x7995('0x13')](_0x35229d['query'][_0x7995('0x13')]);}return _0x13d525[_0x7995('0xae')](_0x57438e);}})['then'](function(_0x3098ef){if(_0x3098ef){return _0x3098ef?{'count':_0x37b7e7,'rows':_0x3098ef}:null;}})[_0x7995('0x19')](respondWithResult(_0x22d392,null))[_0x7995('0x2e')](handleError(_0x22d392,null));};exports[_0x7995('0xb0')]=function(_0x258f87,_0x5a5cc4){var _0x37af6b;return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0x258f87[_0x7995('0x30')]['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x5a5cc4,null))[_0x7995('0x19')](function(_0x120bef){if(_0x120bef){return _0x120bef[_0x7995('0xb0')](_0x258f87[_0x7995('0x3b')][_0x7995('0x70')],_[_0x7995('0x46')](_0x258f87[_0x7995('0x3b')],[_0x7995('0x70'),'id'])||{});}return null;})['spread'](function(_0x247b71){var _0x1ecb6f;_0x37af6b=_0x247b71||[];var _0x225a37=[];if(_0x247b71){for(var _0x1a9f59=0x0;_0x1a9f59<_0x247b71['length'];_0x1a9f59+=0x1){var _0x92a561=_0x247b71[_0x1a9f59][_0x7995('0x3c')]({'plain':!![]});_0x1ecb6f=squel[_0x7995('0x8f')]()[_0x7995('0x90')](_0x7995('0xb1'))[_0x7995('0x92')]([_0x7995('0x93'),'ContactId',_0x7995('0x99'),'VoiceQueueId',_0x7995('0x95'),_0x7995('0x47')],squel[_0x7995('0x96')]()['field']('phone',_0x7995('0x93'))[_0x7995('0x72')]('id',_0x7995('0x97'))['field'](_0x92a561[_0x7995('0x98')]['toString'](),_0x7995('0x99'))[_0x7995('0x72')](_0x258f87[_0x7995('0x30')]['id'][_0x7995('0x79')](),_0x7995('0x58'))[_0x7995('0x72')]('NOW()',_0x7995('0x95'))[_0x7995('0x72')]('NOW()',_0x7995('0x47'))[_0x7995('0x9a')](_0x7995('0xa1'))[_0x7995('0x51')](_0x7995('0xa2'))[_0x7995('0x51')](_0x7995('0x9b'),_0x92a561[_0x7995('0x98')][_0x7995('0x79')]())[_0x7995('0x51')](_0x7995('0x9c')))[_0x7995('0x79')]();_0x225a37[_0x7995('0x78')](db[_0x7995('0x7a')][_0x7995('0x2c')](_0x1ecb6f));}return BPromise[_0x7995('0x7d')](_0x225a37);}})[_0x7995('0x19')](function(){return _0x37af6b;})['then'](respondWithResult(_0x5a5cc4,null))['catch'](handleError(_0x5a5cc4,null));};exports[_0x7995('0xb2')]=function(_0x2f3c17,_0x4fe5eb){return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0x2f3c17['params']['id']}})['then'](handleEntityNotFound(_0x4fe5eb,null))[_0x7995('0x19')](function(_0x31a3d6){if(_0x31a3d6){return _0x31a3d6[_0x7995('0xb2')](_0x2f3c17[_0x7995('0x2c')][_0x7995('0x70')]);}})[_0x7995('0x19')](function(_0x1b3920){if(_0x1b3920){return db[_0x7995('0x5d')][_0x7995('0x25')]({'where':{'ListId':_0x2f3c17[_0x7995('0x2c')]['ids'],'VoiceQueueId':_0x2f3c17[_0x7995('0x30')]['id']}})[_0x7995('0x19')](function(){return _0x1b3920;});}})[_0x7995('0x19')](respondWithStatusCode(_0x4fe5eb,null))[_0x7995('0x2e')](handleError(_0x4fe5eb,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index f92c904..67aaf23 100644 --- a/server/api/voiceQueue/voiceQueue.events.js +++ b/server/api/voiceQueue/voiceQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcabd=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueue','save','remove'];(function(_0xab73a1,_0x2bfb0c){var _0x5e9388=function(_0x46513d){while(--_0x46513d){_0xab73a1['push'](_0xab73a1['shift']());}};_0x5e9388(++_0x2bfb0c);}(_0xcabd,0x1b4));var _0xdcab=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xcabd[_0x34bc30];return _0x5706de;};'use strict';var EventEmitter=require(_0xdcab('0x0'));var VoiceQueue=require(_0xdcab('0x1'))['db'][_0xdcab('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdcab('0x3'),'afterUpdate':'update','afterDestroy':_0xdcab('0x4')};function emitEvent(_0x1814b7){return function(_0x4003e3,_0x3c38df,_0x2b466d){VoiceQueueEvents[_0xdcab('0x5')](_0x1814b7+':'+_0x4003e3['id'],_0x4003e3);VoiceQueueEvents[_0xdcab('0x5')](_0x1814b7,_0x4003e3);_0x2b466d(null);};}for(var e in events){if(events[_0xdcab('0x6')](e)){var event=events[e];VoiceQueue[_0xdcab('0x7')](e,emitEvent(event));}}module[_0xdcab('0x8')]=VoiceQueueEvents; \ No newline at end of file +var _0xd296=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xd296,0x18d));var _0x6d29=function(_0x452d6a,_0x24c4b0){_0x452d6a=_0x452d6a-0x0;var _0x512067=_0xd296[_0x452d6a];return _0x512067;};'use strict';var EventEmitter=require(_0x6d29('0x0'));var VoiceQueue=require(_0x6d29('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x6d29('0x2')](0x0);var events={'afterCreate':_0x6d29('0x3'),'afterUpdate':_0x6d29('0x4'),'afterDestroy':_0x6d29('0x5')};function emitEvent(_0x5e851c){return function(_0x34a22b,_0x49cf97,_0xd9a473){VoiceQueueEvents[_0x6d29('0x6')](_0x5e851c+':'+_0x34a22b['id'],_0x34a22b);VoiceQueueEvents[_0x6d29('0x6')](_0x5e851c,_0x34a22b);_0xd9a473(null);};}for(var e in events){if(events[_0x6d29('0x7')](e)){var event=events[e];VoiceQueue[_0x6d29('0x8')](e,emitEvent(event));}}module[_0x6d29('0x9')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 321999c..bcbd3ef 100644 --- a/server/api/voiceQueue/voiceQueue.model.js +++ b/server/api/voiceQueue/voiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0x498396,_0x395c9a){var _0x1b0fbd=function(_0x1c511e){while(--_0x1c511e){_0x498396['push'](_0x498396['shift']());}};_0x1b0fbd(++_0x395c9a);}(_0x70e0,0x17b));var _0x070e=function(_0x5d6ff9,_0x3a1e51){_0x5d6ff9=_0x5d6ff9-0x0;var _0x47be99=_0x70e0[_0x5d6ff9];return _0x47be99;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('VoiceQueue',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55ca=['./voiceQueue.attributes','exports','define','voice_queues','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x1f99a0,_0x50b73d){var _0x1e0849=function(_0x41e764){while(--_0x41e764){_0x1f99a0['push'](_0x1f99a0['shift']());}};_0x1e0849(++_0x50b73d);}(_0x55ca,0x126));var _0xa55c=function(_0x53f3ad,_0x39163e){_0x53f3ad=_0x53f3ad-0x0;var _0x48b203=_0x55ca[_0x53f3ad];return _0x48b203;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('VoiceQueue',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 9f90301..9bfdf62 100644 --- a/server/api/voiceQueue/voiceQueue.rpc.js +++ b/server/api/voiceQueue/voiceQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9f49=['../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','VoiceQueue,\x20%s,\x20%s','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetVoiceQueue','VoiceQueue','options','raw','attributes','limit','include','map','model','ShowVoiceQueue','find','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3ffb6f,_0x4982c0){var _0x264b62=function(_0x1bb68b){while(--_0x1bb68b){_0x3ffb6f['push'](_0x3ffb6f['shift']());}};_0x264b62(++_0x4982c0);}(_0x9f49,0x78));var _0x99f4=function(_0x3db302,_0xe8be0f){_0x3db302=_0x3db302-0x0;var _0x4eff8a=_0x9f49[_0x3db302];return _0x4eff8a;};'use strict';var _=require(_0x99f4('0x0'));var util=require('util');var moment=require(_0x99f4('0x1'));var BPromise=require(_0x99f4('0x2'));var rs=require(_0x99f4('0x3'));var fs=require('fs');var Redis=require(_0x99f4('0x4'));var db=require(_0x99f4('0x5'))['db'];var utils=require(_0x99f4('0x6'));var logger=require(_0x99f4('0x7'))(_0x99f4('0x8'));var config=require(_0x99f4('0x9'));var jayson=require(_0x99f4('0xa'));var client=jayson['client'][_0x99f4('0xb')]({'port':0x232a});config['redis']=_[_0x99f4('0xc')](config[_0x99f4('0xd')],{'host':_0x99f4('0xe'),'port':0x18eb});var socket=require(_0x99f4('0xf'))(new Redis(config[_0x99f4('0xd')]));require(_0x99f4('0x10'))[_0x99f4('0x11')](socket);function respondWithRpcPromise(_0x57d15e,_0x463db6,_0xb74c45){return new BPromise(function(_0x4ee506,_0x4bf42e){return client[_0x99f4('0x12')](_0x57d15e,_0xb74c45)[_0x99f4('0x13')](function(_0x313982){logger['info'](_0x99f4('0x14'),_0x463db6,'request\x20sent');logger[_0x99f4('0x15')](_0x99f4('0x16'),_0x463db6,_0x99f4('0x17'),JSON[_0x99f4('0x18')](_0x313982));if(_0x313982[_0x99f4('0x19')]){if(_0x313982['error'][_0x99f4('0x1a')]===0x1f4){logger['error'](_0x99f4('0x14'),_0x463db6,_0x313982[_0x99f4('0x19')]['message']);return _0x4bf42e(_0x313982[_0x99f4('0x19')][_0x99f4('0x1b')]);}logger[_0x99f4('0x19')](_0x99f4('0x14'),_0x463db6,_0x313982[_0x99f4('0x19')]['message']);return _0x4ee506(_0x313982[_0x99f4('0x19')][_0x99f4('0x1b')]);}else{logger[_0x99f4('0x1c')](_0x99f4('0x14'),_0x463db6,_0x99f4('0x17'));_0x4ee506(_0x313982[_0x99f4('0x1d')][_0x99f4('0x1b')]);}})[_0x99f4('0x1e')](function(_0x59611f){logger[_0x99f4('0x19')](_0x99f4('0x14'),_0x463db6,_0x59611f);_0x4bf42e(_0x59611f);});});}exports[_0x99f4('0x1f')]=function(_0x3eb73e){var _0x42eb60=this;return new Promise(function(_0x11923d,_0x3da2c2){return db[_0x99f4('0x20')]['findAll']({'raw':_0x3eb73e[_0x99f4('0x21')]?_0x3eb73e['options'][_0x99f4('0x22')]===undefined?!![]:![]:!![],'where':_0x3eb73e[_0x99f4('0x21')]?_0x3eb73e[_0x99f4('0x21')]['where']||null:null,'attributes':_0x3eb73e[_0x99f4('0x21')]?_0x3eb73e[_0x99f4('0x21')][_0x99f4('0x23')]||null:null,'limit':_0x3eb73e[_0x99f4('0x21')]?_0x3eb73e['options'][_0x99f4('0x24')]||null:null,'include':_0x3eb73e['options']?_0x3eb73e[_0x99f4('0x21')][_0x99f4('0x25')]?_[_0x99f4('0x26')](_0x3eb73e[_0x99f4('0x21')][_0x99f4('0x25')],function(_0x5b80e6){return{'model':db[_0x5b80e6[_0x99f4('0x27')]],'as':_0x5b80e6['as'],'attributes':_0x5b80e6[_0x99f4('0x23')],'include':_0x5b80e6[_0x99f4('0x25')]?_[_0x99f4('0x26')](_0x5b80e6['include'],function(_0x387c80){return{'model':db[_0x387c80[_0x99f4('0x27')]],'as':_0x387c80['as'],'attributes':_0x387c80[_0x99f4('0x23')],'include':_0x387c80[_0x99f4('0x25')]?_[_0x99f4('0x26')](_0x387c80['include'],function(_0x42d6a8){return{'model':db[_0x42d6a8[_0x99f4('0x27')]],'as':_0x42d6a8['as'],'attributes':_0x42d6a8[_0x99f4('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4fe7e0){logger['info'](_0x99f4('0x1f'),_0x3eb73e);logger[_0x99f4('0x15')](_0x99f4('0x1f'),_0x3eb73e,JSON[_0x99f4('0x18')](_0x4fe7e0));_0x11923d(_0x4fe7e0);})[_0x99f4('0x1e')](function(_0x354601){logger[_0x99f4('0x19')]('GetVoiceQueue',_0x354601['message'],_0x3eb73e);_0x3da2c2(_0x42eb60[_0x99f4('0x19')](0x1f4,_0x354601[_0x99f4('0x1b')]));});});};exports[_0x99f4('0x28')]=function(_0x348f9e){var _0x5d5a65=this;return new Promise(function(_0x569475,_0x2dd052){return db['VoiceQueue'][_0x99f4('0x29')]({'raw':_0x348f9e['options']?_0x348f9e['options'][_0x99f4('0x22')]===undefined?!![]:![]:!![],'where':_0x348f9e[_0x99f4('0x21')]?_0x348f9e[_0x99f4('0x21')][_0x99f4('0x2a')]||null:null,'attributes':_0x348f9e[_0x99f4('0x21')]?_0x348f9e['options'][_0x99f4('0x23')]||null:null,'include':_0x348f9e['options']?_0x348f9e[_0x99f4('0x21')][_0x99f4('0x25')]?_[_0x99f4('0x26')](_0x348f9e['options'][_0x99f4('0x25')],function(_0x425114){return{'model':db[_0x425114[_0x99f4('0x27')]],'as':_0x425114['as'],'attributes':_0x425114[_0x99f4('0x23')],'include':_0x425114[_0x99f4('0x25')]?_[_0x99f4('0x26')](_0x425114['include'],function(_0x1b4a8a){return{'model':db[_0x1b4a8a[_0x99f4('0x27')]],'as':_0x1b4a8a['as'],'attributes':_0x1b4a8a[_0x99f4('0x23')],'include':_0x1b4a8a[_0x99f4('0x25')]?_[_0x99f4('0x26')](_0x1b4a8a[_0x99f4('0x25')],function(_0x3e6ef7){return{'model':db[_0x3e6ef7[_0x99f4('0x27')]],'as':_0x3e6ef7['as'],'attributes':_0x3e6ef7[_0x99f4('0x23')]};}):[]};}):[]};}):[]:[]})[_0x99f4('0x13')](function(_0x4d12e4){logger[_0x99f4('0x1c')](_0x99f4('0x28'),_0x348f9e);logger[_0x99f4('0x15')]('ShowVoiceQueue',_0x348f9e,JSON[_0x99f4('0x18')](_0x4d12e4));_0x569475(_0x4d12e4);})[_0x99f4('0x1e')](function(_0x21be66){logger[_0x99f4('0x19')]('ShowVoiceQueue',_0x21be66[_0x99f4('0x1b')],_0x348f9e);_0x2dd052(_0x5d5a65[_0x99f4('0x19')](0x1f4,_0x21be66[_0x99f4('0x1b')]));});});}; \ No newline at end of file +var _0x0ff7=['limit','include','map','model','then','ShowVoiceQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','info','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceQueue,\x20%s,\x20%s','message','result','catch','GetVoiceQueue','findAll','options','raw','where','attributes'];(function(_0x8a94cb,_0x34f59e){var _0x45c132=function(_0xb1113e){while(--_0xb1113e){_0x8a94cb['push'](_0x8a94cb['shift']());}};_0x45c132(++_0x34f59e);}(_0x0ff7,0x134));var _0x70ff=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x0ff7[_0x2112d4];return _0x434972;};'use strict';var _=require(_0x70ff('0x0'));var util=require(_0x70ff('0x1'));var moment=require(_0x70ff('0x2'));var BPromise=require(_0x70ff('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x70ff('0x4'));var db=require(_0x70ff('0x5'))['db'];var utils=require(_0x70ff('0x6'));var logger=require(_0x70ff('0x7'))(_0x70ff('0x8'));var config=require('../../config/environment');var jayson=require(_0x70ff('0x9'));var client=jayson[_0x70ff('0xa')][_0x70ff('0xb')]({'port':0x232a});config[_0x70ff('0xc')]=_[_0x70ff('0xd')](config['redis'],{'host':_0x70ff('0xe'),'port':0x18eb});var socket=require(_0x70ff('0xf'))(new Redis(config[_0x70ff('0xc')]));require(_0x70ff('0x10'))[_0x70ff('0x11')](socket);function respondWithRpcPromise(_0x4b3a54,_0xc9930a,_0x55d198){return new BPromise(function(_0xa3575b,_0x4f7c65){return client[_0x70ff('0x12')](_0x4b3a54,_0x55d198)['then'](function(_0x43dce5){logger[_0x70ff('0x13')]('VoiceQueue,\x20%s,\x20%s',_0xc9930a,'request\x20sent');logger[_0x70ff('0x14')](_0x70ff('0x15'),_0xc9930a,_0x70ff('0x16'),JSON[_0x70ff('0x17')](_0x43dce5));if(_0x43dce5['error']){if(_0x43dce5[_0x70ff('0x18')][_0x70ff('0x19')]===0x1f4){logger[_0x70ff('0x18')](_0x70ff('0x1a'),_0xc9930a,_0x43dce5[_0x70ff('0x18')][_0x70ff('0x1b')]);return _0x4f7c65(_0x43dce5[_0x70ff('0x18')][_0x70ff('0x1b')]);}logger['error']('VoiceQueue,\x20%s,\x20%s',_0xc9930a,_0x43dce5[_0x70ff('0x18')][_0x70ff('0x1b')]);return _0xa3575b(_0x43dce5[_0x70ff('0x18')][_0x70ff('0x1b')]);}else{logger['info'](_0x70ff('0x1a'),_0xc9930a,_0x70ff('0x16'));_0xa3575b(_0x43dce5[_0x70ff('0x1c')][_0x70ff('0x1b')]);}})[_0x70ff('0x1d')](function(_0x587fe4){logger[_0x70ff('0x18')]('VoiceQueue,\x20%s,\x20%s',_0xc9930a,_0x587fe4);_0x4f7c65(_0x587fe4);});});}exports[_0x70ff('0x1e')]=function(_0x440306){var _0x2eedd3=this;return new Promise(function(_0x2d8b73,_0x5f2819){return db['VoiceQueue'][_0x70ff('0x1f')]({'raw':_0x440306[_0x70ff('0x20')]?_0x440306['options'][_0x70ff('0x21')]===undefined?!![]:![]:!![],'where':_0x440306['options']?_0x440306[_0x70ff('0x20')][_0x70ff('0x22')]||null:null,'attributes':_0x440306[_0x70ff('0x20')]?_0x440306[_0x70ff('0x20')][_0x70ff('0x23')]||null:null,'limit':_0x440306[_0x70ff('0x20')]?_0x440306['options'][_0x70ff('0x24')]||null:null,'include':_0x440306[_0x70ff('0x20')]?_0x440306[_0x70ff('0x20')][_0x70ff('0x25')]?_['map'](_0x440306[_0x70ff('0x20')][_0x70ff('0x25')],function(_0x216723){return{'model':db[_0x216723['model']],'as':_0x216723['as'],'attributes':_0x216723[_0x70ff('0x23')],'include':_0x216723[_0x70ff('0x25')]?_[_0x70ff('0x26')](_0x216723['include'],function(_0x28c9c3){return{'model':db[_0x28c9c3[_0x70ff('0x27')]],'as':_0x28c9c3['as'],'attributes':_0x28c9c3[_0x70ff('0x23')],'include':_0x28c9c3[_0x70ff('0x25')]?_['map'](_0x28c9c3['include'],function(_0x306c4f){return{'model':db[_0x306c4f[_0x70ff('0x27')]],'as':_0x306c4f['as'],'attributes':_0x306c4f[_0x70ff('0x23')]};}):[]};}):[]};}):[]:[]})[_0x70ff('0x28')](function(_0x5a2dea){logger[_0x70ff('0x13')](_0x70ff('0x1e'),_0x440306);logger['debug'](_0x70ff('0x1e'),_0x440306,JSON[_0x70ff('0x17')](_0x5a2dea));_0x2d8b73(_0x5a2dea);})['catch'](function(_0x541841){logger[_0x70ff('0x18')](_0x70ff('0x1e'),_0x541841['message'],_0x440306);_0x5f2819(_0x2eedd3[_0x70ff('0x18')](0x1f4,_0x541841[_0x70ff('0x1b')]));});});};exports[_0x70ff('0x29')]=function(_0x2e0fa9){var _0x46a99b=this;return new Promise(function(_0x1e7566,_0xaf7df8){return db['VoiceQueue'][_0x70ff('0x2a')]({'raw':_0x2e0fa9[_0x70ff('0x20')]?_0x2e0fa9[_0x70ff('0x20')][_0x70ff('0x21')]===undefined?!![]:![]:!![],'where':_0x2e0fa9['options']?_0x2e0fa9[_0x70ff('0x20')][_0x70ff('0x22')]||null:null,'attributes':_0x2e0fa9['options']?_0x2e0fa9['options'][_0x70ff('0x23')]||null:null,'include':_0x2e0fa9[_0x70ff('0x20')]?_0x2e0fa9[_0x70ff('0x20')][_0x70ff('0x25')]?_[_0x70ff('0x26')](_0x2e0fa9[_0x70ff('0x20')][_0x70ff('0x25')],function(_0x406f1a){return{'model':db[_0x406f1a[_0x70ff('0x27')]],'as':_0x406f1a['as'],'attributes':_0x406f1a['attributes'],'include':_0x406f1a[_0x70ff('0x25')]?_[_0x70ff('0x26')](_0x406f1a[_0x70ff('0x25')],function(_0x331486){return{'model':db[_0x331486['model']],'as':_0x331486['as'],'attributes':_0x331486[_0x70ff('0x23')],'include':_0x331486[_0x70ff('0x25')]?_['map'](_0x331486['include'],function(_0x43beab){return{'model':db[_0x43beab[_0x70ff('0x27')]],'as':_0x43beab['as'],'attributes':_0x43beab[_0x70ff('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x54dd73){logger[_0x70ff('0x13')](_0x70ff('0x29'),_0x2e0fa9);logger['debug'](_0x70ff('0x29'),_0x2e0fa9,JSON[_0x70ff('0x17')](_0x54dd73));_0x1e7566(_0x54dd73);})[_0x70ff('0x1d')](function(_0x5b0a03){logger[_0x70ff('0x18')](_0x70ff('0x29'),_0x5b0a03[_0x70ff('0x1b')],_0x2e0fa9);_0xaf7df8(_0x46a99b['error'](0x1f4,_0x5b0a03[_0x70ff('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index c60a377..b843851 100644 --- a/server/api/voiceQueue/voiceQueue.socket.js +++ b/server/api/voiceQueue/voiceQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d1a=['./voiceQueue.events','save','update','register'];(function(_0x531301,_0x3509f2){var _0x46e668=function(_0x272a6c){while(--_0x272a6c){_0x531301['push'](_0x531301['shift']());}};_0x46e668(++_0x3509f2);}(_0x6d1a,0x1ec));var _0xa6d1=function(_0x47b1a8,_0x40c662){_0x47b1a8=_0x47b1a8-0x0;var _0x1258c1=_0x6d1a[_0x47b1a8];return _0x1258c1;};'use strict';var VoiceQueueEvents=require(_0xa6d1('0x0'));var events=[_0xa6d1('0x1'),'remove',_0xa6d1('0x2')];function createListener(_0x54527b,_0x3501b0){return function(_0x5948b8){_0x3501b0['emit'](_0x54527b,_0x5948b8);};}function removeListener(_0x118fdd,_0x2a347d){return function(){VoiceQueueEvents['removeListener'](_0x118fdd,_0x2a347d);};}exports[_0xa6d1('0x3')]=function(_0x5d01f2){for(var _0x3ffc41=0x0,_0x5be59a=events['length'];_0x3ffc41<_0x5be59a;_0x3ffc41++){var _0x3f0c84=events[_0x3ffc41];var _0x1eb996=createListener('voiceQueue:'+_0x3f0c84,_0x5d01f2);VoiceQueueEvents['on'](_0x3f0c84,_0x1eb996);}}; \ No newline at end of file +var _0x0df1=['save','remove','update','emit','removeListener','register','length','voiceQueue:'];(function(_0xa79977,_0x4f7f12){var _0x109f10=function(_0x56780f){while(--_0x56780f){_0xa79977['push'](_0xa79977['shift']());}};_0x109f10(++_0x4f7f12);}(_0x0df1,0x1b8));var _0x10df=function(_0xb6caad,_0x298563){_0xb6caad=_0xb6caad-0x0;var _0xec1e71=_0x0df1[_0xb6caad];return _0xec1e71;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x10df('0x0'),_0x10df('0x1'),_0x10df('0x2')];function createListener(_0x2b99f5,_0x39477b){return function(_0x314d87){_0x39477b[_0x10df('0x3')](_0x2b99f5,_0x314d87);};}function removeListener(_0x3ad398,_0x492c87){return function(){VoiceQueueEvents[_0x10df('0x4')](_0x3ad398,_0x492c87);};}exports[_0x10df('0x5')]=function(_0x3cdda3){for(var _0x522ced=0x0,_0x50e2e8=events[_0x10df('0x6')];_0x522ced<_0x50e2e8;_0x522ced++){var _0xb17eb1=events[_0x522ced];var _0x318a20=createListener(_0x10df('0x7')+_0xb17eb1,_0x3cdda3);VoiceQueueEvents['on'](_0xb17eb1,_0x318a20);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 9d93850..eeeb419 100644 --- a/server/api/voiceQueueReport/index.js +++ b/server/api/voiceQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8155=['./voiceQueueReport.controller','isAuthenticated','index','get','/describe','/index','getVoiceQueuesReport','show','post','create','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8155,0x83));var _0x5815=function(_0x59bcdc,_0x539241){_0x59bcdc=_0x59bcdc-0x0;var _0x388fe3=_0x8155[_0x59bcdc];return _0x388fe3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5815('0x0'));var timeout=require(_0x5815('0x1'));var express=require(_0x5815('0x2'));var router=express['Router']();var fs_extra=require(_0x5815('0x3'));var auth=require(_0x5815('0x4'));var interaction=require(_0x5815('0x5'));var config=require(_0x5815('0x6'));var controller=require(_0x5815('0x7'));router['get']('/',auth[_0x5815('0x8')](),controller[_0x5815('0x9')]);router[_0x5815('0xa')](_0x5815('0xb'),auth[_0x5815('0x8')](),controller['describe']);router[_0x5815('0xa')](_0x5815('0xc'),auth[_0x5815('0x8')](),controller[_0x5815('0xd')]);router[_0x5815('0xa')]('/:id',auth[_0x5815('0x8')](),controller[_0x5815('0xe')]);router[_0x5815('0xf')]('/',auth[_0x5815('0x8')](),controller[_0x5815('0x10')]);router[_0x5815('0x11')](_0x5815('0x12'),auth[_0x5815('0x8')](),controller[_0x5815('0x13')]);router[_0x5815('0x14')]('/:id',auth[_0x5815('0x8')](),controller[_0x5815('0x15')]);module[_0x5815('0x16')]=router; \ No newline at end of file +var _0xa436=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueueReport.controller','get','isAuthenticated','index','describe','/index','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x33ca24,_0x192492){var _0x219673=function(_0x304f52){while(--_0x304f52){_0x33ca24['push'](_0x33ca24['shift']());}};_0x219673(++_0x192492);}(_0xa436,0x111));var _0x6a43=function(_0x4fc753,_0x1717cb){_0x4fc753=_0x4fc753-0x0;var _0x16773f=_0xa436[_0x4fc753];return _0x16773f;};'use strict';var multer=require(_0x6a43('0x0'));var util=require('util');var path=require(_0x6a43('0x1'));var timeout=require(_0x6a43('0x2'));var express=require(_0x6a43('0x3'));var router=express[_0x6a43('0x4')]();var fs_extra=require(_0x6a43('0x5'));var auth=require(_0x6a43('0x6'));var interaction=require(_0x6a43('0x7'));var config=require('../../config/environment');var controller=require(_0x6a43('0x8'));router[_0x6a43('0x9')]('/',auth[_0x6a43('0xa')](),controller[_0x6a43('0xb')]);router[_0x6a43('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x6a43('0xc')]);router[_0x6a43('0x9')](_0x6a43('0xd'),auth[_0x6a43('0xa')](),controller['getVoiceQueuesReport']);router[_0x6a43('0x9')](_0x6a43('0xe'),auth['isAuthenticated'](),controller[_0x6a43('0xf')]);router[_0x6a43('0x10')]('/',auth['isAuthenticated'](),controller[_0x6a43('0x11')]);router[_0x6a43('0x12')](_0x6a43('0xe'),auth[_0x6a43('0xa')](),controller[_0x6a43('0x13')]);router[_0x6a43('0x14')](_0x6a43('0xe'),auth[_0x6a43('0xa')](),controller[_0x6a43('0x15')]);module[_0x6a43('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 48bc40b..0058a31 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.attributes.js +++ b/server/api/voiceQueueReport/voiceQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaa65=['COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN'];(function(_0x3bbe4b,_0x35f067){var _0x402d37=function(_0x2f7f78){while(--_0x2f7f78){_0x3bbe4b['push'](_0x3bbe4b['shift']());}};_0x402d37(++_0x35f067);}(_0xaa65,0x6b));var _0x5aa6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xaa65[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x5aa6('0x0'));var moment=require('moment');module[_0x5aa6('0x1')]={'type':{'type':Sequelize[_0x5aa6('0x2')]},'uniqueid':{'type':Sequelize[_0x5aa6('0x2')]},'calleridnum':{'type':Sequelize[_0x5aa6('0x2')]},'calleridname':{'type':Sequelize[_0x5aa6('0x2')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x5aa6('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x5aa6('0x3')],'set':function(_0xd2f7e8){var _0x56716d=moment(_0xd2f7e8);var _0x5b36f3=moment(this[_0x5aa6('0x4')](_0x5aa6('0x5')))[_0x5aa6('0x6')]('YYYY-MM-DD\x20HH:mm:ss');var _0x51f46e=_0x56716d['diff'](_0x5b36f3,_0x5aa6('0x7'));this[_0x5aa6('0x8')](_0x5aa6('0x9'),_0xd2f7e8);this[_0x5aa6('0x8')](_0x5aa6('0xa'),_0x51f46e||null);}},'position':{'type':Sequelize[_0x5aa6('0xb')]},'count':{'type':Sequelize[_0x5aa6('0xb')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x5aa6('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x5aa6('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x5aa6('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x5aa6('0x3')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0x5aa6('0xd')},'originalposition':{'type':Sequelize[_0x5aa6('0xb')]},'channel':{'type':Sequelize[_0x5aa6('0x2')]},'connectedlinenum':{'type':Sequelize[_0x5aa6('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x5aa6('0x2')]},'context':{'type':Sequelize[_0x5aa6('0x2')]},'exten':{'type':Sequelize[_0x5aa6('0x2')]},'priority':{'type':Sequelize[_0x5aa6('0x2')]},'holdtime':{'type':Sequelize[_0x5aa6('0xb')]},'mohtime':{'type':Sequelize[_0x5aa6('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x5aa6('0x2')]},'transfer':{'type':Sequelize[_0x5aa6('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x5aa6('0x2')],'comment':_0x5aa6('0xe')},'transferexten':{'type':Sequelize[_0x5aa6('0x2')]},'transferuniqueid':{'type':Sequelize[_0x5aa6('0x2')]},'disposition':{'type':Sequelize[_0x5aa6('0x2')]},'secondDisposition':{'type':Sequelize[_0x5aa6('0x2')]},'thirdDisposition':{'type':Sequelize[_0x5aa6('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x5aa6('0xb')],'defaultValue':0x0},'note':{'type':Sequelize[_0x5aa6('0x2')]}}; \ No newline at end of file +var _0xeb48=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','STRING','getDataValue','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','DATE','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'];(function(_0x566168,_0x4c39af){var _0x4e1f7a=function(_0x5ec3ee){while(--_0x5ec3ee){_0x566168['push'](_0x566168['shift']());}};_0x4e1f7a(++_0x4c39af);}(_0xeb48,0x14b));var _0x8eb4=function(_0x314c8c,_0x446c03){_0x314c8c=_0x314c8c-0x0;var _0x11d1ae=_0xeb48[_0x314c8c];return _0x11d1ae;};'use strict';var Sequelize=require(_0x8eb4('0x0'));var moment=require(_0x8eb4('0x1'));module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x8eb4('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x8eb4('0x2')]},'queue':{'type':Sequelize[_0x8eb4('0x2')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x3ebcbf){var _0x2bff4a=moment(_0x3ebcbf);var _0x1c92f8=moment(this[_0x8eb4('0x3')]('queuecallerjoinAt'))['format'](_0x8eb4('0x4'));var _0x1b4216=_0x2bff4a[_0x8eb4('0x5')](_0x1c92f8,_0x8eb4('0x6'));this[_0x8eb4('0x7')](_0x8eb4('0x8'),_0x3ebcbf);this[_0x8eb4('0x7')](_0x8eb4('0x9'),_0x1b4216||null);}},'position':{'type':Sequelize[_0x8eb4('0xa')]},'count':{'type':Sequelize[_0x8eb4('0xa')]},'queuecallerabandon':{'type':Sequelize[_0x8eb4('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x8eb4('0xc')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x8eb4('0xc')]},'queuecallerexit':{'type':Sequelize[_0x8eb4('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x8eb4('0xc')]},'queuecallerexitreason':{'type':Sequelize[_0x8eb4('0x2')],'comment':_0x8eb4('0xd')},'originalposition':{'type':Sequelize[_0x8eb4('0xa')]},'channel':{'type':Sequelize[_0x8eb4('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x8eb4('0x2')]},'accountcode':{'type':Sequelize[_0x8eb4('0x2')]},'context':{'type':Sequelize[_0x8eb4('0x2')]},'exten':{'type':Sequelize[_0x8eb4('0x2')]},'priority':{'type':Sequelize[_0x8eb4('0x2')]},'holdtime':{'type':Sequelize[_0x8eb4('0xa')]},'mohtime':{'type':Sequelize[_0x8eb4('0xa')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x8eb4('0x2')]},'transfer':{'type':Sequelize[_0x8eb4('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x8eb4('0x2')],'comment':_0x8eb4('0xe')},'transferexten':{'type':Sequelize[_0x8eb4('0x2')]},'transferuniqueid':{'type':Sequelize[_0x8eb4('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x8eb4('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x8eb4('0xa')],'defaultValue':0x0},'note':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index e03ef16..d8199a8 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.controller.js +++ b/server/api/voiceQueueReport/voiceQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x324c=['include','findAll','catch','keys','create','body','find','destroy','describe','getVoiceQueuesReport','nolimit','pick','rows','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','end','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','VoiceQueueReport','includeAll'];(function(_0x8b6cb1,_0x5ad718){var _0xb744f4=function(_0x470807){while(--_0x470807){_0x8b6cb1['push'](_0x8b6cb1['shift']());}};_0xb744f4(++_0x5ad718);}(_0x324c,0xb1));var _0xc324=function(_0x31fb29,_0xbf658f){_0x31fb29=_0x31fb29-0x0;var _0x19101e=_0x324c[_0x31fb29];return _0x19101e;};'use strict';var emlformat=require(_0xc324('0x0'));var rimraf=require(_0xc324('0x1'));var zipdir=require(_0xc324('0x2'));var jsonpatch=require(_0xc324('0x3'));var rp=require(_0xc324('0x4'));var moment=require(_0xc324('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc324('0x6'));var util=require(_0xc324('0x7'));var path=require(_0xc324('0x8'));var sox=require('sox');var csv=require(_0xc324('0x9'));var ejs=require(_0xc324('0xa'));var fs=require('fs');var fs_extra=require(_0xc324('0xb'));var _=require(_0xc324('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc324('0xd'));var deskjs=require(_0xc324('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc324('0xf'));var Papa=require(_0xc324('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc324('0x11'));var as=require(_0xc324('0x12'));var hardwareService=require(_0xc324('0x13'));var logger=require(_0xc324('0x14'))(_0xc324('0x15'));var utils=require(_0xc324('0x16'));var config=require(_0xc324('0x17'));var licenseUtil=require(_0xc324('0x18'));var db=require(_0xc324('0x19'))['db'];config[_0xc324('0x1a')]=_[_0xc324('0x1b')](config[_0xc324('0x1a')],{'host':_0xc324('0x1c'),'port':0x18eb});var socket=require(_0xc324('0x1d'))(new Redis(config['redis']));require('./voiceQueueReport.socket')[_0xc324('0x1e')](socket);function respondWithStatusCode(_0x3b5a8a,_0x50b1ce){_0x50b1ce=_0x50b1ce||0xcc;return function(_0x10e4a2){if(_0x10e4a2){return _0x3b5a8a[_0xc324('0x1f')](_0x50b1ce);}return _0x3b5a8a[_0xc324('0x20')](_0x50b1ce)['end']();};}function respondWithResult(_0x463813,_0x3eea11){_0x3eea11=_0x3eea11||0xc8;return function(_0x2d9c10){if(_0x2d9c10){return _0x463813[_0xc324('0x20')](_0x3eea11)['json'](_0x2d9c10);}};}function respondWithFilteredResult(_0x1c9460,_0x196fbc){return function(_0x364364){if(_0x364364){var _0x1d773e=typeof _0x196fbc[_0xc324('0x21')]===_0xc324('0x22')&&typeof _0x196fbc[_0xc324('0x23')]===_0xc324('0x22');var _0x5e0178=_0x364364[_0xc324('0x24')];var _0x54d9f4=_0x1d773e?0x0:_0x196fbc[_0xc324('0x21')];var _0x450958=_0x1d773e?_0x364364['count']:_0x196fbc[_0xc324('0x21')]+_0x196fbc['limit'];var _0x3568b6;if(_0x450958>=_0x5e0178){_0x450958=_0x5e0178;_0x3568b6=0xc8;}else{_0x3568b6=0xce;}_0x1c9460[_0xc324('0x20')](_0x3568b6);return _0x1c9460[_0xc324('0x25')](_0xc324('0x26'),_0x54d9f4+'-'+_0x450958+'/'+_0x5e0178)[_0xc324('0x27')](_0x364364);}return null;};}function patchUpdates(_0xfefb89){return function(_0x471160){try{jsonpatch[_0xc324('0x28')](_0x471160,_0xfefb89,!![]);}catch(_0x3b725d){return BPromise[_0xc324('0x29')](_0x3b725d);}return _0x471160['save']();};}function saveUpdates(_0xd18d2b,_0x4baedf){return function(_0x5ba791){if(_0x5ba791){return _0x5ba791[_0xc324('0x2a')](_0xd18d2b)[_0xc324('0x2b')](function(_0x5bc9bd){return _0x5bc9bd;});}return null;};}function removeEntity(_0x5bc197,_0x1b33b5){return function(_0x16ca55){if(_0x16ca55){return _0x16ca55['destroy']()['then'](function(){_0x5bc197['status'](0xcc)[_0xc324('0x2c')]();});}};}function handleEntityNotFound(_0x42407f,_0x20606b){return function(_0x312019){if(!_0x312019){_0x42407f[_0xc324('0x1f')](0x194);}return _0x312019;};}function handleError(_0x1084b2,_0x242055){_0x242055=_0x242055||0x1f4;return function(_0x2f7a0a){logger['error'](_0x2f7a0a['stack']);if(_0x2f7a0a[_0xc324('0x2d')]){delete _0x2f7a0a[_0xc324('0x2d')];}_0x1084b2[_0xc324('0x20')](_0x242055)[_0xc324('0x2e')](_0x2f7a0a);};}exports[_0xc324('0x2f')]=function(_0xf48f5c,_0x25b1b6){var _0xb2435f={},_0xb14518={},_0x4560bc={'count':0x0,'rows':[]};var _0x3d977e=_[_0xc324('0x30')](db['VoiceQueueReport'][_0xc324('0x31')],function(_0xa0962e){return{'name':_0xa0962e[_0xc324('0x32')],'type':_0xa0962e[_0xc324('0x33')][_0xc324('0x34')]};});_0xb14518['model']=_['map'](_0x3d977e,_0xc324('0x2d'));_0xb14518[_0xc324('0x35')]=_['keys'](_0xf48f5c[_0xc324('0x35')]);_0xb14518[_0xc324('0x36')]=_['intersection'](_0xb14518[_0xc324('0x37')],_0xb14518[_0xc324('0x35')]);_0xb2435f[_0xc324('0x38')]=_[_0xc324('0x39')](_0xb14518['model'],qs[_0xc324('0x3a')](_0xf48f5c[_0xc324('0x35')]['fields']));_0xb2435f['attributes']=_0xb2435f[_0xc324('0x38')][_0xc324('0x3b')]?_0xb2435f[_0xc324('0x38')]:_0xb14518[_0xc324('0x37')];if(!_0xf48f5c[_0xc324('0x35')][_0xc324('0x3c')]('nolimit')){_0xb2435f[_0xc324('0x23')]=qs[_0xc324('0x23')](_0xf48f5c[_0xc324('0x35')][_0xc324('0x23')]);_0xb2435f[_0xc324('0x21')]=qs['offset'](_0xf48f5c['query'][_0xc324('0x21')]);}_0xb2435f[_0xc324('0x3d')]=qs[_0xc324('0x3e')](_0xf48f5c[_0xc324('0x35')][_0xc324('0x3e')]);_0xb2435f[_0xc324('0x3f')]=qs[_0xc324('0x36')](_['pick'](_0xf48f5c[_0xc324('0x35')],_0xb14518['filters']),_0x3d977e);if(_0xf48f5c[_0xc324('0x35')][_0xc324('0x40')]){_0xb2435f[_0xc324('0x3f')]=_[_0xc324('0x41')](_0xb2435f[_0xc324('0x3f')],{'$or':_[_0xc324('0x30')](_0x3d977e,function(_0x31894d){if(_0x31894d[_0xc324('0x33')]!=='VIRTUAL'){var _0x1ffe4a={};_0x1ffe4a[_0x31894d[_0xc324('0x2d')]]={'$like':'%'+_0xf48f5c[_0xc324('0x35')][_0xc324('0x40')]+'%'};return _0x1ffe4a;}})});}_0xb2435f=_[_0xc324('0x41')]({},_0xb2435f,_0xf48f5c[_0xc324('0x42')]);var _0x4420ce={'where':_0xb2435f[_0xc324('0x3f')]};return db[_0xc324('0x43')][_0xc324('0x24')](_0x4420ce)[_0xc324('0x2b')](function(_0x3c18bf){_0x4560bc[_0xc324('0x24')]=_0x3c18bf;if(_0xf48f5c[_0xc324('0x35')][_0xc324('0x44')]){_0xb2435f[_0xc324('0x45')]=[{'all':!![]}];}return db[_0xc324('0x43')][_0xc324('0x46')](_0xb2435f);})[_0xc324('0x2b')](function(_0x2e28b9){_0x4560bc['rows']=_0x2e28b9;return _0x4560bc;})[_0xc324('0x2b')](respondWithFilteredResult(_0x25b1b6,_0xb2435f))[_0xc324('0x47')](handleError(_0x25b1b6,null));};exports['show']=function(_0x9a0995,_0x289ea2){var _0x33abdc={'raw':![],'where':{'id':_0x9a0995['params']['id']}},_0x474862={};_0x474862[_0xc324('0x37')]=_[_0xc324('0x48')](db[_0xc324('0x43')][_0xc324('0x31')]);_0x474862[_0xc324('0x35')]=_['keys'](_0x9a0995['query']);_0x474862[_0xc324('0x36')]=_[_0xc324('0x39')](_0x474862[_0xc324('0x37')],_0x474862[_0xc324('0x35')]);_0x33abdc['attributes']=_['intersection'](_0x474862[_0xc324('0x37')],qs[_0xc324('0x3a')](_0x9a0995['query'][_0xc324('0x3a')]));_0x33abdc[_0xc324('0x38')]=_0x33abdc[_0xc324('0x38')][_0xc324('0x3b')]?_0x33abdc['attributes']:_0x474862[_0xc324('0x37')];if(_0x9a0995[_0xc324('0x35')][_0xc324('0x44')]){_0x33abdc[_0xc324('0x45')]=[{'all':!![]}];}_0x33abdc=_[_0xc324('0x41')]({},_0x33abdc,_0x9a0995[_0xc324('0x42')]);return db['VoiceQueueReport']['find'](_0x33abdc)['then'](handleEntityNotFound(_0x289ea2,null))[_0xc324('0x2b')](respondWithResult(_0x289ea2,null))[_0xc324('0x47')](handleError(_0x289ea2,null));};exports[_0xc324('0x49')]=function(_0x225434,_0x5663eb){return db[_0xc324('0x43')][_0xc324('0x49')](_0x225434[_0xc324('0x4a')],{})[_0xc324('0x2b')](respondWithResult(_0x5663eb,0xc9))[_0xc324('0x47')](handleError(_0x5663eb,null));};exports['update']=function(_0x42a4f0,_0x4266ea){if(_0x42a4f0[_0xc324('0x4a')]['id']){delete _0x42a4f0[_0xc324('0x4a')]['id'];}return db[_0xc324('0x43')][_0xc324('0x4b')]({'where':{'id':_0x42a4f0['params']['id']}})[_0xc324('0x2b')](handleEntityNotFound(_0x4266ea,null))[_0xc324('0x2b')](saveUpdates(_0x42a4f0['body'],null))['then'](respondWithResult(_0x4266ea,null))['catch'](handleError(_0x4266ea,null));};exports[_0xc324('0x4c')]=function(_0x20239e,_0x5a5b1f){return db[_0xc324('0x43')][_0xc324('0x4b')]({'where':{'id':_0x20239e['params']['id']}})[_0xc324('0x2b')](handleEntityNotFound(_0x5a5b1f,null))[_0xc324('0x2b')](removeEntity(_0x5a5b1f,null))[_0xc324('0x47')](handleError(_0x5a5b1f,null));};exports[_0xc324('0x4d')]=function(_0x26611a,_0x57ac02){return db[_0xc324('0x43')]['describe']()[_0xc324('0x2b')](respondWithResult(_0x57ac02,null))[_0xc324('0x47')](handleError(_0x57ac02,null));};exports[_0xc324('0x4e')]=function(_0xc77e31,_0x17f090){var _0x26f17b={},_0x4647b5={},_0x356dab={'count':0x0,'rows':[]};_0x4647b5[_0xc324('0x37')]=_[_0xc324('0x48')](db[_0xc324('0x43')][_0xc324('0x31')]);_0x4647b5[_0xc324('0x35')]=_[_0xc324('0x48')](_0xc77e31[_0xc324('0x35')]);_0x4647b5['filters']=_[_0xc324('0x39')](_0x4647b5[_0xc324('0x37')],_0x4647b5['query']);_0x26f17b[_0xc324('0x38')]=_[_0xc324('0x39')](_0x4647b5[_0xc324('0x37')],qs[_0xc324('0x3a')](_0xc77e31[_0xc324('0x35')]['fields']));_0x26f17b['attributes']=_0x26f17b['attributes'][_0xc324('0x3b')]?_0x26f17b[_0xc324('0x38')]:_0x4647b5[_0xc324('0x37')];if(!_0xc77e31['query'][_0xc324('0x3c')](_0xc324('0x4f'))){_0x26f17b['limit']=qs['limit'](_0xc77e31[_0xc324('0x35')]['limit']);_0x26f17b[_0xc324('0x21')]=qs[_0xc324('0x21')](_0xc77e31[_0xc324('0x35')]['offset']);}_0x26f17b[_0xc324('0x3d')]=qs[_0xc324('0x3e')](_0xc77e31['query']['sort']);_0x26f17b[_0xc324('0x3f')]=qs[_0xc324('0x36')](_[_0xc324('0x50')](_0xc77e31[_0xc324('0x35')],_0x4647b5[_0xc324('0x36')]));if(_0xc77e31[_0xc324('0x35')][_0xc324('0x40')]){_0x26f17b['where']=_[_0xc324('0x41')](_0x26f17b[_0xc324('0x3f')],{'$or':_['map'](_0x26f17b['attributes'],function(_0x8807c2){var _0x242d42={};_0x242d42[_0x8807c2]={'$like':'%'+_0xc77e31[_0xc324('0x35')][_0xc324('0x40')]+'%'};return _0x242d42;})});}_0x26f17b=_[_0xc324('0x41')]({},_0x26f17b,_0xc77e31[_0xc324('0x42')]);var _0x5de30f={'where':_0x26f17b[_0xc324('0x3f')]};return db[_0xc324('0x43')]['count'](_0x5de30f)['then'](function(_0xaa3f71){_0x356dab[_0xc324('0x24')]=_0xaa3f71;if(_0xc77e31[_0xc324('0x35')]['includeAll']){_0x26f17b[_0xc324('0x45')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0xc324('0x46')](_0x26f17b);})['then'](function(_0x354a91){_0x356dab[_0xc324('0x51')]=_0x354a91;return _0x356dab;})['then'](respondWithFilteredResult(_0x17f090,_0x26f17b,_0xc324('0x4e')))[_0xc324('0x47')](handleError(_0x17f090,null,_0xc324('0x4e')));}; \ No newline at end of file +var _0x9859=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','save','update','end','error','name','index','map','VoiceQueueReport','rawAttributes','fieldName','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','then','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','destroy','getVoiceQueuesReport','eml-format','zip-dir','fast-json-patch','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9859,0x140));var _0x9985=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x9859[_0x525c7b];return _0x27b33e;};'use strict';var emlformat=require(_0x9985('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9985('0x1'));var jsonpatch=require(_0x9985('0x2'));var rp=require('request-promise');var moment=require(_0x9985('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9985('0x4'));var util=require(_0x9985('0x5'));var path=require(_0x9985('0x6'));var sox=require(_0x9985('0x7'));var csv=require(_0x9985('0x8'));var ejs=require(_0x9985('0x9'));var fs=require('fs');var fs_extra=require(_0x9985('0xa'));var _=require(_0x9985('0xb'));var squel=require(_0x9985('0xc'));var crypto=require(_0x9985('0xd'));var jsforce=require(_0x9985('0xe'));var deskjs=require(_0x9985('0xf'));var toCsv=require(_0x9985('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9985('0x10'));var authService=require(_0x9985('0x11'));var qs=require(_0x9985('0x12'));var as=require(_0x9985('0x13'));var hardwareService=require(_0x9985('0x14'));var logger=require('../../config/logger')(_0x9985('0x15'));var utils=require(_0x9985('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x9985('0x17'));var db=require(_0x9985('0x18'))['db'];config[_0x9985('0x19')]=_['defaults'](config['redis'],{'host':_0x9985('0x1a'),'port':0x18eb});var socket=require(_0x9985('0x1b'))(new Redis(config[_0x9985('0x19')]));require(_0x9985('0x1c'))[_0x9985('0x1d')](socket);function respondWithStatusCode(_0xb3836f,_0x594635){_0x594635=_0x594635||0xcc;return function(_0x1cd544){if(_0x1cd544){return _0xb3836f[_0x9985('0x1e')](_0x594635);}return _0xb3836f[_0x9985('0x1f')](_0x594635)['end']();};}function respondWithResult(_0x402c29,_0x3f4542){_0x3f4542=_0x3f4542||0xc8;return function(_0x308dac){if(_0x308dac){return _0x402c29[_0x9985('0x1f')](_0x3f4542)['json'](_0x308dac);}};}function respondWithFilteredResult(_0x323ac0,_0x44dc6a){return function(_0x11054a){if(_0x11054a){var _0x3c7308=typeof _0x44dc6a[_0x9985('0x20')]===_0x9985('0x21')&&typeof _0x44dc6a[_0x9985('0x22')]===_0x9985('0x21');var _0x5050a8=_0x11054a[_0x9985('0x23')];var _0x2d2b6a=_0x3c7308?0x0:_0x44dc6a['offset'];var _0x4fbba4=_0x3c7308?_0x11054a[_0x9985('0x23')]:_0x44dc6a['offset']+_0x44dc6a[_0x9985('0x22')];var _0x4ab621;if(_0x4fbba4>=_0x5050a8){_0x4fbba4=_0x5050a8;_0x4ab621=0xc8;}else{_0x4ab621=0xce;}_0x323ac0[_0x9985('0x1f')](_0x4ab621);return _0x323ac0['set'](_0x9985('0x24'),_0x2d2b6a+'-'+_0x4fbba4+'/'+_0x5050a8)[_0x9985('0x25')](_0x11054a);}return null;};}function patchUpdates(_0x2f9cf5){return function(_0x1c254b){try{jsonpatch[_0x9985('0x26')](_0x1c254b,_0x2f9cf5,!![]);}catch(_0x122122){return BPromise['reject'](_0x122122);}return _0x1c254b[_0x9985('0x27')]();};}function saveUpdates(_0xe878f2,_0x3755bc){return function(_0x4f4883){if(_0x4f4883){return _0x4f4883[_0x9985('0x28')](_0xe878f2)['then'](function(_0x3d3955){return _0x3d3955;});}return null;};}function removeEntity(_0x4ff9da,_0x167f14){return function(_0x2c0d89){if(_0x2c0d89){return _0x2c0d89['destroy']()['then'](function(){_0x4ff9da[_0x9985('0x1f')](0xcc)[_0x9985('0x29')]();});}};}function handleEntityNotFound(_0x596b1e,_0x1c8367){return function(_0x5b1541){if(!_0x5b1541){_0x596b1e[_0x9985('0x1e')](0x194);}return _0x5b1541;};}function handleError(_0x83bc5c,_0x53c92f){_0x53c92f=_0x53c92f||0x1f4;return function(_0x30080f){logger[_0x9985('0x2a')](_0x30080f['stack']);if(_0x30080f[_0x9985('0x2b')]){delete _0x30080f['name'];}_0x83bc5c['status'](_0x53c92f)['send'](_0x30080f);};}exports[_0x9985('0x2c')]=function(_0xabc3a9,_0x296e72){var _0x41d728={},_0x849f86={},_0x26d455={'count':0x0,'rows':[]};var _0x1afa9e=_[_0x9985('0x2d')](db[_0x9985('0x2e')][_0x9985('0x2f')],function(_0x59ff8c){return{'name':_0x59ff8c[_0x9985('0x30')],'type':_0x59ff8c['type']['key']};});_0x849f86['model']=_[_0x9985('0x2d')](_0x1afa9e,'name');_0x849f86[_0x9985('0x31')]=_['keys'](_0xabc3a9[_0x9985('0x31')]);_0x849f86[_0x9985('0x32')]=_['intersection'](_0x849f86[_0x9985('0x33')],_0x849f86[_0x9985('0x31')]);_0x41d728[_0x9985('0x34')]=_[_0x9985('0x35')](_0x849f86[_0x9985('0x33')],qs[_0x9985('0x36')](_0xabc3a9[_0x9985('0x31')][_0x9985('0x36')]));_0x41d728['attributes']=_0x41d728[_0x9985('0x34')][_0x9985('0x37')]?_0x41d728[_0x9985('0x34')]:_0x849f86[_0x9985('0x33')];if(!_0xabc3a9[_0x9985('0x31')][_0x9985('0x38')](_0x9985('0x39'))){_0x41d728[_0x9985('0x22')]=qs[_0x9985('0x22')](_0xabc3a9[_0x9985('0x31')][_0x9985('0x22')]);_0x41d728[_0x9985('0x20')]=qs[_0x9985('0x20')](_0xabc3a9[_0x9985('0x31')][_0x9985('0x20')]);}_0x41d728[_0x9985('0x3a')]=qs[_0x9985('0x3b')](_0xabc3a9['query']['sort']);_0x41d728[_0x9985('0x3c')]=qs[_0x9985('0x32')](_[_0x9985('0x3d')](_0xabc3a9[_0x9985('0x31')],_0x849f86[_0x9985('0x32')]),_0x1afa9e);if(_0xabc3a9[_0x9985('0x31')][_0x9985('0x3e')]){_0x41d728['where']=_['merge'](_0x41d728[_0x9985('0x3c')],{'$or':_[_0x9985('0x2d')](_0x1afa9e,function(_0x5001dc){if(_0x5001dc[_0x9985('0x3f')]!==_0x9985('0x40')){var _0x150792={};_0x150792[_0x5001dc[_0x9985('0x2b')]]={'$like':'%'+_0xabc3a9[_0x9985('0x31')][_0x9985('0x3e')]+'%'};return _0x150792;}})});}_0x41d728=_[_0x9985('0x41')]({},_0x41d728,_0xabc3a9[_0x9985('0x42')]);var _0x3bf372={'where':_0x41d728['where']};return db[_0x9985('0x2e')][_0x9985('0x23')](_0x3bf372)[_0x9985('0x43')](function(_0x30bacf){_0x26d455[_0x9985('0x23')]=_0x30bacf;if(_0xabc3a9[_0x9985('0x31')][_0x9985('0x44')]){_0x41d728['include']=[{'all':!![]}];}return db[_0x9985('0x2e')][_0x9985('0x45')](_0x41d728);})[_0x9985('0x43')](function(_0x823ae){_0x26d455[_0x9985('0x46')]=_0x823ae;return _0x26d455;})[_0x9985('0x43')](respondWithFilteredResult(_0x296e72,_0x41d728))[_0x9985('0x47')](handleError(_0x296e72,null));};exports[_0x9985('0x48')]=function(_0x384c0b,_0x205621){var _0x1364be={'raw':![],'where':{'id':_0x384c0b[_0x9985('0x49')]['id']}},_0xfacca2={};_0xfacca2[_0x9985('0x33')]=_[_0x9985('0x4a')](db[_0x9985('0x2e')][_0x9985('0x2f')]);_0xfacca2[_0x9985('0x31')]=_[_0x9985('0x4a')](_0x384c0b['query']);_0xfacca2[_0x9985('0x32')]=_['intersection'](_0xfacca2[_0x9985('0x33')],_0xfacca2[_0x9985('0x31')]);_0x1364be[_0x9985('0x34')]=_[_0x9985('0x35')](_0xfacca2[_0x9985('0x33')],qs['fields'](_0x384c0b[_0x9985('0x31')][_0x9985('0x36')]));_0x1364be[_0x9985('0x34')]=_0x1364be[_0x9985('0x34')][_0x9985('0x37')]?_0x1364be[_0x9985('0x34')]:_0xfacca2['model'];if(_0x384c0b['query'][_0x9985('0x44')]){_0x1364be[_0x9985('0x4b')]=[{'all':!![]}];}_0x1364be=_['merge']({},_0x1364be,_0x384c0b['options']);return db[_0x9985('0x2e')][_0x9985('0x4c')](_0x1364be)[_0x9985('0x43')](handleEntityNotFound(_0x205621,null))[_0x9985('0x43')](respondWithResult(_0x205621,null))['catch'](handleError(_0x205621,null));};exports[_0x9985('0x4d')]=function(_0x559bb0,_0x214fbd){return db[_0x9985('0x2e')]['create'](_0x559bb0[_0x9985('0x4e')],{})[_0x9985('0x43')](respondWithResult(_0x214fbd,0xc9))[_0x9985('0x47')](handleError(_0x214fbd,null));};exports[_0x9985('0x28')]=function(_0x1475ba,_0x4b4690){if(_0x1475ba[_0x9985('0x4e')]['id']){delete _0x1475ba[_0x9985('0x4e')]['id'];}return db['VoiceQueueReport']['find']({'where':{'id':_0x1475ba['params']['id']}})[_0x9985('0x43')](handleEntityNotFound(_0x4b4690,null))[_0x9985('0x43')](saveUpdates(_0x1475ba[_0x9985('0x4e')],null))['then'](respondWithResult(_0x4b4690,null))[_0x9985('0x47')](handleError(_0x4b4690,null));};exports[_0x9985('0x4f')]=function(_0x43f5b7,_0x3ff995){return db['VoiceQueueReport']['find']({'where':{'id':_0x43f5b7[_0x9985('0x49')]['id']}})[_0x9985('0x43')](handleEntityNotFound(_0x3ff995,null))[_0x9985('0x43')](removeEntity(_0x3ff995,null))[_0x9985('0x47')](handleError(_0x3ff995,null));};exports['describe']=function(_0x2f488b,_0x1a4aac){return db[_0x9985('0x2e')]['describe']()[_0x9985('0x43')](respondWithResult(_0x1a4aac,null))['catch'](handleError(_0x1a4aac,null));};exports[_0x9985('0x50')]=function(_0x612f59,_0x47d80b){var _0x375e6f={},_0x50b6a1={},_0x160cba={'count':0x0,'rows':[]};_0x50b6a1[_0x9985('0x33')]=_[_0x9985('0x4a')](db[_0x9985('0x2e')][_0x9985('0x2f')]);_0x50b6a1[_0x9985('0x31')]=_[_0x9985('0x4a')](_0x612f59[_0x9985('0x31')]);_0x50b6a1[_0x9985('0x32')]=_[_0x9985('0x35')](_0x50b6a1[_0x9985('0x33')],_0x50b6a1[_0x9985('0x31')]);_0x375e6f[_0x9985('0x34')]=_['intersection'](_0x50b6a1[_0x9985('0x33')],qs[_0x9985('0x36')](_0x612f59[_0x9985('0x31')][_0x9985('0x36')]));_0x375e6f['attributes']=_0x375e6f[_0x9985('0x34')][_0x9985('0x37')]?_0x375e6f['attributes']:_0x50b6a1[_0x9985('0x33')];if(!_0x612f59['query']['hasOwnProperty'](_0x9985('0x39'))){_0x375e6f['limit']=qs[_0x9985('0x22')](_0x612f59['query']['limit']);_0x375e6f['offset']=qs[_0x9985('0x20')](_0x612f59[_0x9985('0x31')]['offset']);}_0x375e6f['order']=qs[_0x9985('0x3b')](_0x612f59[_0x9985('0x31')][_0x9985('0x3b')]);_0x375e6f[_0x9985('0x3c')]=qs['filters'](_['pick'](_0x612f59[_0x9985('0x31')],_0x50b6a1[_0x9985('0x32')]));if(_0x612f59[_0x9985('0x31')][_0x9985('0x3e')]){_0x375e6f[_0x9985('0x3c')]=_[_0x9985('0x41')](_0x375e6f[_0x9985('0x3c')],{'$or':_[_0x9985('0x2d')](_0x375e6f[_0x9985('0x34')],function(_0x362093){var _0x4815c5={};_0x4815c5[_0x362093]={'$like':'%'+_0x612f59['query']['filter']+'%'};return _0x4815c5;})});}_0x375e6f=_[_0x9985('0x41')]({},_0x375e6f,_0x612f59[_0x9985('0x42')]);var _0x4b2258={'where':_0x375e6f[_0x9985('0x3c')]};return db[_0x9985('0x2e')][_0x9985('0x23')](_0x4b2258)['then'](function(_0x424b56){_0x160cba['count']=_0x424b56;if(_0x612f59[_0x9985('0x31')]['includeAll']){_0x375e6f[_0x9985('0x4b')]=[{'all':!![]}];}return db[_0x9985('0x2e')]['findAll'](_0x375e6f);})['then'](function(_0x103191){_0x160cba[_0x9985('0x46')]=_0x103191;return _0x160cba;})[_0x9985('0x43')](respondWithFilteredResult(_0x47d80b,_0x375e6f,_0x9985('0x50')))[_0x9985('0x47')](handleError(_0x47d80b,null,'getVoiceQueuesReport'));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 5bce59d..555e94f 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.events.js +++ b/server/api/voiceQueueReport/voiceQueueReport.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed8c=['emit','hasOwnProperty','hook','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update'];(function(_0x6f6ff4,_0x196b0a){var _0x651649=function(_0x83acbd){while(--_0x83acbd){_0x6f6ff4['push'](_0x6f6ff4['shift']());}};_0x651649(++_0x196b0a);}(_0xed8c,0x135));var _0xced8=function(_0x3c990a,_0x4d270e){_0x3c990a=_0x3c990a-0x0;var _0x20effd=_0xed8c[_0x3c990a];return _0x20effd;};'use strict';var EventEmitter=require(_0xced8('0x0'));var VoiceQueueReport=require(_0xced8('0x1'))['db'][_0xced8('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xced8('0x3')](0x0);var events={'afterCreate':_0xced8('0x4'),'afterUpdate':_0xced8('0x5'),'afterDestroy':'remove'};function emitEvent(_0x554da0){return function(_0x405a1c,_0x46728e,_0x49a823){VoiceQueueReportEvents[_0xced8('0x6')](_0x554da0+':'+_0x405a1c['id'],_0x405a1c);VoiceQueueReportEvents['emit'](_0x554da0,_0x405a1c);_0x49a823(null);};}for(var e in events){if(events[_0xced8('0x7')](e)){var event=events[e];VoiceQueueReport[_0xced8('0x8')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file +var _0x98cd=['VoiceQueueReport','setMaxListeners','save','remove','hook','exports','events','../../mysqldb'];(function(_0x2fdbf8,_0x461a51){var _0x5dc976=function(_0xb9cea4){while(--_0xb9cea4){_0x2fdbf8['push'](_0x2fdbf8['shift']());}};_0x5dc976(++_0x461a51);}(_0x98cd,0x12e));var _0xd98c=function(_0x1e946e,_0x2ed0df){_0x1e946e=_0x1e946e-0x0;var _0xa26508=_0x98cd[_0x1e946e];return _0xa26508;};'use strict';var EventEmitter=require(_0xd98c('0x0'));var VoiceQueueReport=require(_0xd98c('0x1'))['db'][_0xd98c('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xd98c('0x3')](0x0);var events={'afterCreate':_0xd98c('0x4'),'afterUpdate':'update','afterDestroy':_0xd98c('0x5')};function emitEvent(_0x16e1c0){return function(_0x3c9913,_0x35c23f,_0x4dbd40){VoiceQueueReportEvents['emit'](_0x16e1c0+':'+_0x3c9913['id'],_0x3c9913);VoiceQueueReportEvents['emit'](_0x16e1c0,_0x3c9913);_0x4dbd40(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0xd98c('0x6')](e,emitEvent(event));}}module[_0xd98c('0x7')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 5c96874..80138ba 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.model.js +++ b/server/api/voiceQueueReport/voiceQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf2f1=['lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xf2f1,0xee));var _0x1f2f=function(_0x11e30d,_0x5584aa){_0x11e30d=_0x11e30d-0x0;var _0x2d4e29=_0xf2f1[_0x11e30d];return _0x2d4e29;};'use strict';var _=require(_0x1f2f('0x0'));var util=require('util');var logger=require(_0x1f2f('0x1'))(_0x1f2f('0x2'));var moment=require(_0x1f2f('0x3'));var BPromise=require('bluebird');var rp=require(_0x1f2f('0x4'));var fs=require('fs');var path=require(_0x1f2f('0x5'));var rimraf=require(_0x1f2f('0x6'));var config=require(_0x1f2f('0x7'));var attributes=require('./voiceQueueReport.attributes');module[_0x1f2f('0x8')]=function(_0x399877,_0x551f9f){return _0x399877[_0x1f2f('0x9')](_0x1f2f('0xa'),attributes,{'tableName':_0x1f2f('0xb'),'paranoid':![],'indexes':[{'fields':[_0x1f2f('0xc')]},{'fields':[_0x1f2f('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8f24=['VoiceQueueReport','uniqueid','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports'];(function(_0xb0ec4,_0x18431b){var _0x1af32f=function(_0x2b64fb){while(--_0x2b64fb){_0xb0ec4['push'](_0xb0ec4['shift']());}};_0x1af32f(++_0x18431b);}(_0x8f24,0xde));var _0x48f2=function(_0x4aae0a,_0xb0e1fd){_0x4aae0a=_0x4aae0a-0x0;var _0x3f552f=_0x8f24[_0x4aae0a];return _0x3f552f;};'use strict';var _=require('lodash');var util=require(_0x48f2('0x0'));var logger=require(_0x48f2('0x1'))(_0x48f2('0x2'));var moment=require(_0x48f2('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x48f2('0x4'));var rimraf=require(_0x48f2('0x5'));var config=require(_0x48f2('0x6'));var attributes=require(_0x48f2('0x7'));module[_0x48f2('0x8')]=function(_0x71643c,_0x57462){return _0x71643c['define'](_0x48f2('0x9'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0x48f2('0xa')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 8d26bdd..9ea6290 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.rpc.js +++ b/server/api/voiceQueueReport/voiceQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfa8b=['request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','options','raw','attributes','limit','map','model','include','GetVoiceQueueReport','CreateVoiceQueueReport','VoiceQueueReport','create','body','UpdateVoiceQueueReport','update','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register'];(function(_0x14cd13,_0x2a2097){var _0x13e84a=function(_0x4c1207){while(--_0x4c1207){_0x14cd13['push'](_0x14cd13['shift']());}};_0x13e84a(++_0x2a2097);}(_0xfa8b,0x163));var _0xbfa8=function(_0x59c1b8,_0x251576){_0x59c1b8=_0x59c1b8-0x0;var _0x202875=_0xfa8b[_0x59c1b8];return _0x202875;};'use strict';var _=require(_0xbfa8('0x0'));var util=require(_0xbfa8('0x1'));var moment=require(_0xbfa8('0x2'));var BPromise=require(_0xbfa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbfa8('0x4'))['db'];var utils=require(_0xbfa8('0x5'));var logger=require(_0xbfa8('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbfa8('0x7')][_0xbfa8('0x8')]({'port':0x232a});config[_0xbfa8('0x9')]=_[_0xbfa8('0xa')](config[_0xbfa8('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xbfa8('0xb'))(new Redis(config[_0xbfa8('0x9')]));require(_0xbfa8('0xc'))[_0xbfa8('0xd')](socket);function respondWithRpcPromise(_0x19e950,_0x390301,_0x3922b2){return new BPromise(function(_0x330253,_0x17fd15){return client[_0xbfa8('0xe')](_0x19e950,_0x3922b2)[_0xbfa8('0xf')](function(_0x5ee759){logger[_0xbfa8('0x10')](_0xbfa8('0x11'),_0x390301,_0xbfa8('0x12'));logger[_0xbfa8('0x13')](_0xbfa8('0x14'),_0x390301,'request\x20sent',JSON[_0xbfa8('0x15')](_0x5ee759));if(_0x5ee759['error']){if(_0x5ee759[_0xbfa8('0x16')][_0xbfa8('0x17')]===0x1f4){logger[_0xbfa8('0x16')](_0xbfa8('0x11'),_0x390301,_0x5ee759[_0xbfa8('0x16')][_0xbfa8('0x18')]);return _0x17fd15(_0x5ee759[_0xbfa8('0x16')][_0xbfa8('0x18')]);}logger[_0xbfa8('0x16')](_0xbfa8('0x11'),_0x390301,_0x5ee759[_0xbfa8('0x16')][_0xbfa8('0x18')]);return _0x330253(_0x5ee759[_0xbfa8('0x16')]['message']);}else{logger[_0xbfa8('0x10')]('VoiceQueueReport,\x20%s,\x20%s',_0x390301,_0xbfa8('0x12'));_0x330253(_0x5ee759[_0xbfa8('0x19')][_0xbfa8('0x18')]);}})[_0xbfa8('0x1a')](function(_0x274e83){logger[_0xbfa8('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x390301,_0x274e83);_0x17fd15(_0x274e83);});});}exports['GetVoiceQueueReport']=function(_0x14f1cb){var _0x1cfd05=this;return new Promise(function(_0x4e93c0,_0x3652c7){return db['VoiceQueueReport']['findAll']({'raw':_0x14f1cb['options']?_0x14f1cb[_0xbfa8('0x1b')][_0xbfa8('0x1c')]===undefined?!![]:![]:!![],'where':_0x14f1cb['options']?_0x14f1cb['options']['where']||null:null,'attributes':_0x14f1cb['options']?_0x14f1cb['options'][_0xbfa8('0x1d')]||null:null,'limit':_0x14f1cb[_0xbfa8('0x1b')]?_0x14f1cb[_0xbfa8('0x1b')][_0xbfa8('0x1e')]||null:null,'include':_0x14f1cb[_0xbfa8('0x1b')]?_0x14f1cb['options']['include']?_[_0xbfa8('0x1f')](_0x14f1cb['options']['include'],function(_0x23ef3f){return{'model':db[_0x23ef3f[_0xbfa8('0x20')]],'as':_0x23ef3f['as'],'attributes':_0x23ef3f['attributes'],'include':_0x23ef3f['include']?_['map'](_0x23ef3f[_0xbfa8('0x21')],function(_0x410aed){return{'model':db[_0x410aed[_0xbfa8('0x20')]],'as':_0x410aed['as'],'attributes':_0x410aed[_0xbfa8('0x1d')],'include':_0x410aed[_0xbfa8('0x21')]?_['map'](_0x410aed['include'],function(_0x39b48b){return{'model':db[_0x39b48b[_0xbfa8('0x20')]],'as':_0x39b48b['as'],'attributes':_0x39b48b['attributes']};}):[]};}):[]};}):[]:[]})[_0xbfa8('0xf')](function(_0x43516d){logger['info'](_0xbfa8('0x22'),_0x14f1cb);logger['debug'](_0xbfa8('0x22'),_0x14f1cb,JSON[_0xbfa8('0x15')](_0x43516d));_0x4e93c0(_0x43516d);})['catch'](function(_0x2f258f){logger[_0xbfa8('0x16')]('GetVoiceQueueReport',_0x2f258f[_0xbfa8('0x18')],_0x14f1cb);_0x3652c7(_0x1cfd05[_0xbfa8('0x16')](0x1f4,_0x2f258f[_0xbfa8('0x18')]));});});};exports[_0xbfa8('0x23')]=function(_0x1937f){var _0x42008d=this;return new Promise(function(_0x2474f6,_0xb55787){return db[_0xbfa8('0x24')][_0xbfa8('0x25')](_0x1937f[_0xbfa8('0x26')],{'raw':_0x1937f['options']?_0x1937f[_0xbfa8('0x1b')][_0xbfa8('0x1c')]===undefined?!![]:![]:!![]})[_0xbfa8('0xf')](function(_0x1606f6){logger[_0xbfa8('0x10')](_0xbfa8('0x23'),_0x1937f);logger[_0xbfa8('0x13')](_0xbfa8('0x23'),_0x1937f,JSON[_0xbfa8('0x15')](_0x1606f6));_0x2474f6(_0x1606f6);})[_0xbfa8('0x1a')](function(_0x34e6c0){logger[_0xbfa8('0x16')](_0xbfa8('0x23'),_0x34e6c0['message'],_0x1937f);_0xb55787(_0x42008d[_0xbfa8('0x16')](0x1f4,_0x34e6c0['message']));});});};exports[_0xbfa8('0x27')]=function(_0x3f346a){var _0x199e33=this;return new Promise(function(_0x26eefe,_0x6c8c30){return db[_0xbfa8('0x24')][_0xbfa8('0x28')](_0x3f346a[_0xbfa8('0x26')],{'raw':_0x3f346a['options']?_0x3f346a['options'][_0xbfa8('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f346a[_0xbfa8('0x1b')]?_0x3f346a[_0xbfa8('0x1b')]['where']||null:null,'attributes':_0x3f346a[_0xbfa8('0x1b')]?_0x3f346a['options']['attributes']||null:null,'limit':_0x3f346a[_0xbfa8('0x1b')]?_0x3f346a[_0xbfa8('0x1b')][_0xbfa8('0x1e')]||null:null})['then'](function(_0x1b02e7){logger[_0xbfa8('0x10')]('UpdateVoiceQueueReport',_0x3f346a);logger[_0xbfa8('0x13')](_0xbfa8('0x27'),_0x3f346a,JSON[_0xbfa8('0x15')](_0x1b02e7));_0x26eefe(_0x1b02e7);})[_0xbfa8('0x1a')](function(_0x23cabd){logger[_0xbfa8('0x16')]('UpdateVoiceQueueReport',_0x23cabd[_0xbfa8('0x18')],_0x3f346a);_0x6c8c30(_0x199e33[_0xbfa8('0x16')](0x1f4,_0x23cabd[_0xbfa8('0x18')]));});});}; \ No newline at end of file +var _0xbfe5=['then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','include','map','model','attributes','body','CreateVoiceQueueReport','UpdateVoiceQueueReport','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x3120a1,_0x5a284f){var _0x4e9b85=function(_0x5db4b8){while(--_0x5db4b8){_0x3120a1['push'](_0x3120a1['shift']());}};_0x4e9b85(++_0x5a284f);}(_0xbfe5,0x8d));var _0x5bfe=function(_0x2f9d1d,_0x2c3fd1){_0x2f9d1d=_0x2f9d1d-0x0;var _0x155f7a=_0xbfe5[_0x2f9d1d];return _0x155f7a;};'use strict';var _=require(_0x5bfe('0x0'));var util=require(_0x5bfe('0x1'));var moment=require('moment');var BPromise=require(_0x5bfe('0x2'));var rs=require(_0x5bfe('0x3'));var fs=require('fs');var Redis=require(_0x5bfe('0x4'));var db=require(_0x5bfe('0x5'))['db'];var utils=require(_0x5bfe('0x6'));var logger=require('../../config/logger')(_0x5bfe('0x7'));var config=require(_0x5bfe('0x8'));var jayson=require(_0x5bfe('0x9'));var client=jayson[_0x5bfe('0xa')][_0x5bfe('0xb')]({'port':0x232a});config[_0x5bfe('0xc')]=_[_0x5bfe('0xd')](config[_0x5bfe('0xc')],{'host':_0x5bfe('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5bfe('0xc')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithRpcPromise(_0x1e8b5b,_0x49bd36,_0x31b434){return new BPromise(function(_0x3ffde7,_0x85eaf7){return client['request'](_0x1e8b5b,_0x31b434)[_0x5bfe('0xf')](function(_0x4cec03){logger[_0x5bfe('0x10')](_0x5bfe('0x11'),_0x49bd36,_0x5bfe('0x12'));logger[_0x5bfe('0x13')](_0x5bfe('0x14'),_0x49bd36,_0x5bfe('0x12'),JSON[_0x5bfe('0x15')](_0x4cec03));if(_0x4cec03[_0x5bfe('0x16')]){if(_0x4cec03[_0x5bfe('0x16')][_0x5bfe('0x17')]===0x1f4){logger[_0x5bfe('0x16')](_0x5bfe('0x11'),_0x49bd36,_0x4cec03['error'][_0x5bfe('0x18')]);return _0x85eaf7(_0x4cec03[_0x5bfe('0x16')][_0x5bfe('0x18')]);}logger[_0x5bfe('0x16')](_0x5bfe('0x11'),_0x49bd36,_0x4cec03[_0x5bfe('0x16')][_0x5bfe('0x18')]);return _0x3ffde7(_0x4cec03[_0x5bfe('0x16')]['message']);}else{logger['info'](_0x5bfe('0x11'),_0x49bd36,_0x5bfe('0x12'));_0x3ffde7(_0x4cec03['result'][_0x5bfe('0x18')]);}})[_0x5bfe('0x19')](function(_0x5db0cf){logger[_0x5bfe('0x16')](_0x5bfe('0x11'),_0x49bd36,_0x5db0cf);_0x85eaf7(_0x5db0cf);});});}exports[_0x5bfe('0x1a')]=function(_0x3d97dd){var _0x484c72=this;return new Promise(function(_0x3cfd05,_0x436f4a){return db[_0x5bfe('0x1b')][_0x5bfe('0x1c')]({'raw':_0x3d97dd['options']?_0x3d97dd[_0x5bfe('0x1d')][_0x5bfe('0x1e')]===undefined?!![]:![]:!![],'where':_0x3d97dd['options']?_0x3d97dd[_0x5bfe('0x1d')][_0x5bfe('0x1f')]||null:null,'attributes':_0x3d97dd[_0x5bfe('0x1d')]?_0x3d97dd[_0x5bfe('0x1d')]['attributes']||null:null,'limit':_0x3d97dd[_0x5bfe('0x1d')]?_0x3d97dd[_0x5bfe('0x1d')]['limit']||null:null,'include':_0x3d97dd[_0x5bfe('0x1d')]?_0x3d97dd[_0x5bfe('0x1d')][_0x5bfe('0x20')]?_[_0x5bfe('0x21')](_0x3d97dd[_0x5bfe('0x1d')][_0x5bfe('0x20')],function(_0x1065e3){return{'model':db[_0x1065e3[_0x5bfe('0x22')]],'as':_0x1065e3['as'],'attributes':_0x1065e3[_0x5bfe('0x23')],'include':_0x1065e3[_0x5bfe('0x20')]?_[_0x5bfe('0x21')](_0x1065e3['include'],function(_0x13ae1a){return{'model':db[_0x13ae1a[_0x5bfe('0x22')]],'as':_0x13ae1a['as'],'attributes':_0x13ae1a[_0x5bfe('0x23')],'include':_0x13ae1a[_0x5bfe('0x20')]?_[_0x5bfe('0x21')](_0x13ae1a[_0x5bfe('0x20')],function(_0x3c43c4){return{'model':db[_0x3c43c4[_0x5bfe('0x22')]],'as':_0x3c43c4['as'],'attributes':_0x3c43c4[_0x5bfe('0x23')]};}):[]};}):[]};}):[]:[]})[_0x5bfe('0xf')](function(_0x2aadf8){logger['info'](_0x5bfe('0x1a'),_0x3d97dd);logger[_0x5bfe('0x13')](_0x5bfe('0x1a'),_0x3d97dd,JSON['stringify'](_0x2aadf8));_0x3cfd05(_0x2aadf8);})[_0x5bfe('0x19')](function(_0x6045dd){logger['error'](_0x5bfe('0x1a'),_0x6045dd[_0x5bfe('0x18')],_0x3d97dd);_0x436f4a(_0x484c72[_0x5bfe('0x16')](0x1f4,_0x6045dd['message']));});});};exports['CreateVoiceQueueReport']=function(_0x2b4249){var _0x15df07=this;return new Promise(function(_0x94cdbe,_0x306ae0){return db[_0x5bfe('0x1b')]['create'](_0x2b4249[_0x5bfe('0x24')],{'raw':_0x2b4249[_0x5bfe('0x1d')]?_0x2b4249[_0x5bfe('0x1d')][_0x5bfe('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x5b038c){logger[_0x5bfe('0x10')](_0x5bfe('0x25'),_0x2b4249);logger[_0x5bfe('0x13')]('CreateVoiceQueueReport',_0x2b4249,JSON[_0x5bfe('0x15')](_0x5b038c));_0x94cdbe(_0x5b038c);})[_0x5bfe('0x19')](function(_0x204ff7){logger[_0x5bfe('0x16')](_0x5bfe('0x25'),_0x204ff7['message'],_0x2b4249);_0x306ae0(_0x15df07['error'](0x1f4,_0x204ff7[_0x5bfe('0x18')]));});});};exports[_0x5bfe('0x26')]=function(_0x2e09e4){var _0x3aed34=this;return new Promise(function(_0x5bb492,_0x3bc467){return db['VoiceQueueReport']['update'](_0x2e09e4[_0x5bfe('0x24')],{'raw':_0x2e09e4[_0x5bfe('0x1d')]?_0x2e09e4['options'][_0x5bfe('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e09e4[_0x5bfe('0x1d')]?_0x2e09e4[_0x5bfe('0x1d')][_0x5bfe('0x1f')]||null:null,'attributes':_0x2e09e4[_0x5bfe('0x1d')]?_0x2e09e4[_0x5bfe('0x1d')][_0x5bfe('0x23')]||null:null,'limit':_0x2e09e4[_0x5bfe('0x1d')]?_0x2e09e4[_0x5bfe('0x1d')]['limit']||null:null})[_0x5bfe('0xf')](function(_0x162395){logger[_0x5bfe('0x10')](_0x5bfe('0x26'),_0x2e09e4);logger[_0x5bfe('0x13')](_0x5bfe('0x26'),_0x2e09e4,JSON[_0x5bfe('0x15')](_0x162395));_0x5bb492(_0x162395);})['catch'](function(_0x17de8b){logger['error']('UpdateVoiceQueueReport',_0x17de8b[_0x5bfe('0x18')],_0x2e09e4);_0x3bc467(_0x3aed34[_0x5bfe('0x16')](0x1f4,_0x17de8b[_0x5bfe('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 9fb3795..0abd4f6 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.socket.js +++ b/server/api/voiceQueueReport/voiceQueueReport.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe131=['register','length','voiceQueueReport:','./voiceQueueReport.events','save','emit','removeListener'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0xe131,0x1b5));var _0x1e13=function(_0x50c965,_0x36cac7){_0x50c965=_0x50c965-0x0;var _0x370062=_0xe131[_0x50c965];return _0x370062;};'use strict';var VoiceQueueReportEvents=require(_0x1e13('0x0'));var events=[_0x1e13('0x1'),'remove','update'];function createListener(_0x1e422a,_0x585d3e){return function(_0x5d0ccc){_0x585d3e[_0x1e13('0x2')](_0x1e422a,_0x5d0ccc);};}function removeListener(_0x2680ec,_0x1cabf5){return function(){VoiceQueueReportEvents[_0x1e13('0x3')](_0x2680ec,_0x1cabf5);};}exports[_0x1e13('0x4')]=function(_0x440239){for(var _0x3ec2e6=0x0,_0x3d272f=events[_0x1e13('0x5')];_0x3ec2e6<_0x3d272f;_0x3ec2e6++){var _0x477d58=events[_0x3ec2e6];var _0x65a30d=createListener(_0x1e13('0x6')+_0x477d58,_0x440239);VoiceQueueReportEvents['on'](_0x477d58,_0x65a30d);}}; \ No newline at end of file +var _0x6dc0=['./voiceQueueReport.events','remove','update','removeListener','length','voiceQueueReport:'];(function(_0x6fc37a,_0x44c1e0){var _0x50fba8=function(_0x444c94){while(--_0x444c94){_0x6fc37a['push'](_0x6fc37a['shift']());}};_0x50fba8(++_0x44c1e0);}(_0x6dc0,0x18c));var _0x06dc=function(_0x2fc552,_0x34f4af){_0x2fc552=_0x2fc552-0x0;var _0x348b86=_0x6dc0[_0x2fc552];return _0x348b86;};'use strict';var VoiceQueueReportEvents=require(_0x06dc('0x0'));var events=['save',_0x06dc('0x1'),_0x06dc('0x2')];function createListener(_0x4434e2,_0xc40894){return function(_0x414760){_0xc40894['emit'](_0x4434e2,_0x414760);};}function removeListener(_0x4effcf,_0x2cad0f){return function(){VoiceQueueReportEvents[_0x06dc('0x3')](_0x4effcf,_0x2cad0f);};}exports['register']=function(_0x45a093){for(var _0x26b287=0x0,_0x4ac3b4=events[_0x06dc('0x4')];_0x26b287<_0x4ac3b4;_0x26b287++){var _0x523fb5=events[_0x26b287];var _0xeac52b=createListener(_0x06dc('0x5')+_0x523fb5,_0x45a093);VoiceQueueReportEvents['on'](_0x523fb5,_0xeac52b);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 389a3a3..903155d 100644 --- a/server/api/voiceQueuesLog/index.js +++ b/server/api/voiceQueuesLog/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8f2f=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','/:id','destroy','exports','multer','connect-timeout','express','Router'];(function(_0x36cdd3,_0x5e6a97){var _0x140d84=function(_0x2dd7c6){while(--_0x2dd7c6){_0x36cdd3['push'](_0x36cdd3['shift']());}};_0x140d84(++_0x5e6a97);}(_0x8f2f,0x1b6));var _0xf8f2=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0x8f2f[_0xa8883];return _0x479426;};'use strict';var multer=require(_0xf8f2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf8f2('0x1'));var express=require(_0xf8f2('0x2'));var router=express[_0xf8f2('0x3')]();var fs_extra=require(_0xf8f2('0x4'));var auth=require(_0xf8f2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf8f2('0x6'));var controller=require('./voiceQueuesLog.controller');router[_0xf8f2('0x7')]('/',auth[_0xf8f2('0x8')](),controller[_0xf8f2('0x9')]);router[_0xf8f2('0x7')]('/:id',auth[_0xf8f2('0x8')](),controller[_0xf8f2('0xa')]);router[_0xf8f2('0xb')]('/',auth['isAuthenticated'](),controller[_0xf8f2('0xc')]);router[_0xf8f2('0xd')](_0xf8f2('0xe'),auth[_0xf8f2('0x8')](),controller['update']);router['delete'](_0xf8f2('0xe'),auth[_0xf8f2('0x8')](),controller[_0xf8f2('0xf')]);module[_0xf8f2('0x10')]=router; \ No newline at end of file +var _0x6478=['create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./voiceQueuesLog.controller','get','index','/:id','isAuthenticated','show','post'];(function(_0x215d2e,_0x2ef23a){var _0x47eca4=function(_0x34fcf5){while(--_0x34fcf5){_0x215d2e['push'](_0x215d2e['shift']());}};_0x47eca4(++_0x2ef23a);}(_0x6478,0x64));var _0x8647=function(_0x597dfc,_0x2eb655){_0x597dfc=_0x597dfc-0x0;var _0x5191ad=_0x6478[_0x597dfc];return _0x5191ad;};'use strict';var multer=require(_0x8647('0x0'));var util=require(_0x8647('0x1'));var path=require(_0x8647('0x2'));var timeout=require(_0x8647('0x3'));var express=require('express');var router=express[_0x8647('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8647('0x5'));var interaction=require(_0x8647('0x6'));var config=require('../../config/environment');var controller=require(_0x8647('0x7'));router[_0x8647('0x8')]('/',auth['isAuthenticated'](),controller[_0x8647('0x9')]);router['get'](_0x8647('0xa'),auth[_0x8647('0xb')](),controller[_0x8647('0xc')]);router[_0x8647('0xd')]('/',auth[_0x8647('0xb')](),controller[_0x8647('0xe')]);router[_0x8647('0xf')](_0x8647('0xa'),auth[_0x8647('0xb')](),controller[_0x8647('0x10')]);router['delete'](_0x8647('0xa'),auth[_0x8647('0xb')](),controller[_0x8647('0x11')]);module[_0x8647('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 37f8b06..a0380da 100644 --- a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js +++ b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd61f=['DATE','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','STRING'];(function(_0x5bf2e7,_0x1ca562){var _0x2a556a=function(_0x363fc2){while(--_0x363fc2){_0x5bf2e7['push'](_0x5bf2e7['shift']());}};_0x2a556a(++_0x1ca562);}(_0xd61f,0xe4));var _0xfd61=function(_0x19d5ac,_0x35922c){_0x19d5ac=_0x19d5ac-0x0;var _0x5073b9=_0xd61f[_0x19d5ac];return _0x5073b9;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xfd61('0x0')]={'time':{'type':Sequelize[_0xfd61('0x1')]},'callid':{'type':Sequelize[_0xfd61('0x1')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xfd61('0x1')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xfd61('0x1')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xfd61('0x1')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xfd61('0x1')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xfd61('0x1')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xfd61('0x1')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xfd61('0x1')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xfd61('0x1')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xfd61('0x2')],'allowNull':![],'defaultValue':Sequelize[_0xfd61('0x3')](_0xfd61('0x4'))}}; \ No newline at end of file +var _0xb35c=['exports','STRING','DATE','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','moment'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xb35c,0x1a2));var _0xcb35=function(_0x4d9427,_0x477248){_0x4d9427=_0x4d9427-0x0;var _0x448220=_0xb35c[_0x4d9427];return _0x448220;};'use strict';var Sequelize=require(_0xcb35('0x0'));var moment=require(_0xcb35('0x1'));module[_0xcb35('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0xcb35('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xcb35('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xcb35('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xcb35('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xcb35('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xcb35('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xcb35('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xcb35('0x4')],'allowNull':![],'defaultValue':Sequelize[_0xcb35('0x5')](_0xcb35('0x6'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 23c820f..5ddef0d 100644 --- a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js +++ b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x401a=['find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','stack','name','send','rawAttributes','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','options','VoiceQueuesLog','include','findAll','catch','show','params','includeAll'];(function(_0x1c204b,_0x126bc7){var _0xb4b09=function(_0x2f8de8){while(--_0x2f8de8){_0x1c204b['push'](_0x1c204b['shift']());}};_0xb4b09(++_0x126bc7);}(_0x401a,0x99));var _0xa401=function(_0x4c9c70,_0x5c3955){_0x4c9c70=_0x4c9c70-0x0;var _0x2583ef=_0x401a[_0x4c9c70];return _0x2583ef;};'use strict';var emlformat=require(_0xa401('0x0'));var rimraf=require(_0xa401('0x1'));var zipdir=require(_0xa401('0x2'));var jsonpatch=require(_0xa401('0x3'));var rp=require(_0xa401('0x4'));var moment=require(_0xa401('0x5'));var BPromise=require(_0xa401('0x6'));var Mustache=require(_0xa401('0x7'));var util=require(_0xa401('0x8'));var path=require(_0xa401('0x9'));var sox=require(_0xa401('0xa'));var csv=require('to-csv');var ejs=require(_0xa401('0xb'));var fs=require('fs');var fs_extra=require(_0xa401('0xc'));var _=require(_0xa401('0xd'));var squel=require(_0xa401('0xe'));var crypto=require('crypto');var jsforce=require(_0xa401('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xa401('0x10'));var querystring=require(_0xa401('0x11'));var Papa=require('papaparse');var Redis=require(_0xa401('0x12'));var authService=require(_0xa401('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa401('0x14'));var hardwareService=require(_0xa401('0x15'));var logger=require(_0xa401('0x16'))(_0xa401('0x17'));var utils=require('../../config/utils');var config=require(_0xa401('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xa401('0x19'))['db'];function respondWithStatusCode(_0x2bf202,_0x149540){_0x149540=_0x149540||0xcc;return function(_0x25404){if(_0x25404){return _0x2bf202[_0xa401('0x1a')](_0x149540);}return _0x2bf202[_0xa401('0x1b')](_0x149540)[_0xa401('0x1c')]();};}function respondWithResult(_0x57a050,_0x280e49){_0x280e49=_0x280e49||0xc8;return function(_0x111ef4){if(_0x111ef4){return _0x57a050['status'](_0x280e49)[_0xa401('0x1d')](_0x111ef4);}};}function respondWithFilteredResult(_0x312301,_0x5d91de){return function(_0x1e562a){if(_0x1e562a){var _0x528c69=typeof _0x5d91de[_0xa401('0x1e')]===_0xa401('0x1f')&&typeof _0x5d91de[_0xa401('0x20')]==='undefined';var _0x3c0cf2=_0x1e562a['count'];var _0x81d95e=_0x528c69?0x0:_0x5d91de[_0xa401('0x1e')];var _0x4a8abe=_0x528c69?_0x1e562a[_0xa401('0x21')]:_0x5d91de[_0xa401('0x1e')]+_0x5d91de[_0xa401('0x20')];var _0x4b1d4e;if(_0x4a8abe>=_0x3c0cf2){_0x4a8abe=_0x3c0cf2;_0x4b1d4e=0xc8;}else{_0x4b1d4e=0xce;}_0x312301[_0xa401('0x1b')](_0x4b1d4e);return _0x312301[_0xa401('0x22')]('Content-Range',_0x81d95e+'-'+_0x4a8abe+'/'+_0x3c0cf2)[_0xa401('0x1d')](_0x1e562a);}return null;};}function patchUpdates(_0x2c9d68){return function(_0x555f7f){try{jsonpatch[_0xa401('0x23')](_0x555f7f,_0x2c9d68,!![]);}catch(_0x56ae51){return BPromise['reject'](_0x56ae51);}return _0x555f7f[_0xa401('0x24')]();};}function saveUpdates(_0x4e0367,_0x23bb99){return function(_0x3be277){if(_0x3be277){return _0x3be277[_0xa401('0x25')](_0x4e0367)[_0xa401('0x26')](function(_0x4e3eb4){return _0x4e3eb4;});}return null;};}function removeEntity(_0x566d4e,_0x399928){return function(_0x19d841){if(_0x19d841){return _0x19d841[_0xa401('0x27')]()[_0xa401('0x26')](function(){_0x566d4e[_0xa401('0x1b')](0xcc)[_0xa401('0x1c')]();});}};}function handleEntityNotFound(_0x55e541,_0x1f7382){return function(_0x52043b){if(!_0x52043b){_0x55e541[_0xa401('0x1a')](0x194);}return _0x52043b;};}function handleError(_0x2ef1e0,_0xd1ef2e){_0xd1ef2e=_0xd1ef2e||0x1f4;return function(_0x2e2dc5){logger[_0xa401('0x28')](_0x2e2dc5[_0xa401('0x29')]);if(_0x2e2dc5['name']){delete _0x2e2dc5[_0xa401('0x2a')];}_0x2ef1e0[_0xa401('0x1b')](_0xd1ef2e)[_0xa401('0x2b')](_0x2e2dc5);};}exports['index']=function(_0x39df2d,_0x2d34e6){var _0x15c66e={},_0x1e7c6c={},_0x43b2b0={'count':0x0,'rows':[]};var _0x131ae1=_['map'](db['VoiceQueuesLog'][_0xa401('0x2c')],function(_0x4e83a6){return{'name':_0x4e83a6['fieldName'],'type':_0x4e83a6['type']['key']};});_0x1e7c6c[_0xa401('0x2d')]=_[_0xa401('0x2e')](_0x131ae1,_0xa401('0x2a'));_0x1e7c6c[_0xa401('0x2f')]=_[_0xa401('0x30')](_0x39df2d[_0xa401('0x2f')]);_0x1e7c6c[_0xa401('0x31')]=_[_0xa401('0x32')](_0x1e7c6c[_0xa401('0x2d')],_0x1e7c6c['query']);_0x15c66e[_0xa401('0x33')]=_[_0xa401('0x32')](_0x1e7c6c[_0xa401('0x2d')],qs[_0xa401('0x34')](_0x39df2d[_0xa401('0x2f')]['fields']));_0x15c66e['attributes']=_0x15c66e['attributes'][_0xa401('0x35')]?_0x15c66e[_0xa401('0x33')]:_0x1e7c6c[_0xa401('0x2d')];if(!_0x39df2d[_0xa401('0x2f')][_0xa401('0x36')](_0xa401('0x37'))){_0x15c66e[_0xa401('0x20')]=qs['limit'](_0x39df2d['query']['limit']);_0x15c66e[_0xa401('0x1e')]=qs['offset'](_0x39df2d[_0xa401('0x2f')]['offset']);}_0x15c66e[_0xa401('0x38')]=qs[_0xa401('0x39')](_0x39df2d['query'][_0xa401('0x39')]);_0x15c66e[_0xa401('0x3a')]=qs[_0xa401('0x31')](_[_0xa401('0x3b')](_0x39df2d[_0xa401('0x2f')],_0x1e7c6c[_0xa401('0x31')]),_0x131ae1);if(_0x39df2d[_0xa401('0x2f')]['filter']){_0x15c66e['where']=_['merge'](_0x15c66e[_0xa401('0x3a')],{'$or':_['map'](_0x131ae1,function(_0x3919d7){if(_0x3919d7[_0xa401('0x3c')]!==_0xa401('0x3d')){var _0x40d3cf={};_0x40d3cf[_0x3919d7[_0xa401('0x2a')]]={'$like':'%'+_0x39df2d['query'][_0xa401('0x3e')]+'%'};return _0x40d3cf;}})});}_0x15c66e=_[_0xa401('0x3f')]({},_0x15c66e,_0x39df2d[_0xa401('0x40')]);var _0x451d39={'where':_0x15c66e[_0xa401('0x3a')]};return db[_0xa401('0x41')]['count'](_0x451d39)[_0xa401('0x26')](function(_0x16ca25){_0x43b2b0[_0xa401('0x21')]=_0x16ca25;if(_0x39df2d[_0xa401('0x2f')]['includeAll']){_0x15c66e[_0xa401('0x42')]=[{'all':!![]}];}return db[_0xa401('0x41')][_0xa401('0x43')](_0x15c66e);})[_0xa401('0x26')](function(_0x45b9f9){_0x43b2b0['rows']=_0x45b9f9;return _0x43b2b0;})[_0xa401('0x26')](respondWithFilteredResult(_0x2d34e6,_0x15c66e))[_0xa401('0x44')](handleError(_0x2d34e6,null));};exports[_0xa401('0x45')]=function(_0x47dfc5,_0x269706){var _0x42df22={'raw':!![],'where':{'id':_0x47dfc5[_0xa401('0x46')]['id']}},_0x13415e={};_0x13415e[_0xa401('0x2d')]=_[_0xa401('0x30')](db[_0xa401('0x41')][_0xa401('0x2c')]);_0x13415e[_0xa401('0x2f')]=_[_0xa401('0x30')](_0x47dfc5[_0xa401('0x2f')]);_0x13415e[_0xa401('0x31')]=_[_0xa401('0x32')](_0x13415e[_0xa401('0x2d')],_0x13415e[_0xa401('0x2f')]);_0x42df22[_0xa401('0x33')]=_[_0xa401('0x32')](_0x13415e[_0xa401('0x2d')],qs[_0xa401('0x34')](_0x47dfc5[_0xa401('0x2f')][_0xa401('0x34')]));_0x42df22[_0xa401('0x33')]=_0x42df22[_0xa401('0x33')][_0xa401('0x35')]?_0x42df22['attributes']:_0x13415e[_0xa401('0x2d')];if(_0x47dfc5[_0xa401('0x2f')][_0xa401('0x47')]){_0x42df22[_0xa401('0x42')]=[{'all':!![]}];}_0x42df22=_[_0xa401('0x3f')]({},_0x42df22,_0x47dfc5[_0xa401('0x40')]);return db[_0xa401('0x41')][_0xa401('0x48')](_0x42df22)[_0xa401('0x26')](handleEntityNotFound(_0x269706,null))[_0xa401('0x26')](respondWithResult(_0x269706,null))['catch'](handleError(_0x269706,null));};exports[_0xa401('0x49')]=function(_0x176668,_0x3bc748){return db[_0xa401('0x41')][_0xa401('0x49')](_0x176668[_0xa401('0x4a')],{})[_0xa401('0x26')](respondWithResult(_0x3bc748,0xc9))[_0xa401('0x44')](handleError(_0x3bc748,null));};exports[_0xa401('0x25')]=function(_0x2c3835,_0x5e670d){if(_0x2c3835[_0xa401('0x4a')]['id']){delete _0x2c3835[_0xa401('0x4a')]['id'];}return db['VoiceQueuesLog'][_0xa401('0x48')]({'where':{'id':_0x2c3835[_0xa401('0x46')]['id']}})['then'](handleEntityNotFound(_0x5e670d,null))['then'](saveUpdates(_0x2c3835['body'],null))[_0xa401('0x26')](respondWithResult(_0x5e670d,null))[_0xa401('0x44')](handleError(_0x5e670d,null));};exports[_0xa401('0x27')]=function(_0x265520,_0x7c802a){return db[_0xa401('0x41')]['find']({'where':{'id':_0x265520[_0xa401('0x46')]['id']}})['then'](handleEntityNotFound(_0x7c802a,null))[_0xa401('0x26')](removeEntity(_0x7c802a,null))[_0xa401('0x44')](handleError(_0x7c802a,null));}; \ No newline at end of file +var _0x722e=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','stack','name','index','map','VoiceQueuesLog','type','key','query','keys','intersection','model','attributes','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','rawAttributes','fields','find','create','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis'];(function(_0x4cc49b,_0x59264d){var _0x1d8202=function(_0x52cab5){while(--_0x52cab5){_0x4cc49b['push'](_0x4cc49b['shift']());}};_0x1d8202(++_0x59264d);}(_0x722e,0x81));var _0xe722=function(_0x2a31e4,_0x52a923){_0x2a31e4=_0x2a31e4-0x0;var _0x3aaf27=_0x722e[_0x2a31e4];return _0x3aaf27;};'use strict';var emlformat=require(_0xe722('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe722('0x1'));var jsonpatch=require(_0xe722('0x2'));var rp=require('request-promise');var moment=require(_0xe722('0x3'));var BPromise=require(_0xe722('0x4'));var Mustache=require(_0xe722('0x5'));var util=require('util');var path=require(_0xe722('0x6'));var sox=require(_0xe722('0x7'));var csv=require('to-csv');var ejs=require(_0xe722('0x8'));var fs=require('fs');var fs_extra=require(_0xe722('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe722('0xa'));var jsforce=require(_0xe722('0xb'));var deskjs=require(_0xe722('0xc'));var toCsv=require(_0xe722('0xd'));var querystring=require(_0xe722('0xe'));var Papa=require(_0xe722('0xf'));var Redis=require(_0xe722('0x10'));var authService=require(_0xe722('0x11'));var qs=require(_0xe722('0x12'));var as=require(_0xe722('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe722('0x14'))(_0xe722('0x15'));var utils=require('../../config/utils');var config=require(_0xe722('0x16'));var licenseUtil=require(_0xe722('0x17'));var db=require(_0xe722('0x18'))['db'];function respondWithStatusCode(_0x12c3c9,_0x1d59e2){_0x1d59e2=_0x1d59e2||0xcc;return function(_0x25f3a7){if(_0x25f3a7){return _0x12c3c9['sendStatus'](_0x1d59e2);}return _0x12c3c9[_0xe722('0x19')](_0x1d59e2)['end']();};}function respondWithResult(_0x27b8e0,_0xfa6cd7){_0xfa6cd7=_0xfa6cd7||0xc8;return function(_0x21384e){if(_0x21384e){return _0x27b8e0[_0xe722('0x19')](_0xfa6cd7)[_0xe722('0x1a')](_0x21384e);}};}function respondWithFilteredResult(_0x5ce5ff,_0x33186d){return function(_0x2c5bc6){if(_0x2c5bc6){var _0x56e2f1=typeof _0x33186d[_0xe722('0x1b')]===_0xe722('0x1c')&&typeof _0x33186d['limit']==='undefined';var _0xf8546=_0x2c5bc6['count'];var _0x4856f7=_0x56e2f1?0x0:_0x33186d[_0xe722('0x1b')];var _0x3f6ac6=_0x56e2f1?_0x2c5bc6[_0xe722('0x1d')]:_0x33186d[_0xe722('0x1b')]+_0x33186d[_0xe722('0x1e')];var _0x2c088b;if(_0x3f6ac6>=_0xf8546){_0x3f6ac6=_0xf8546;_0x2c088b=0xc8;}else{_0x2c088b=0xce;}_0x5ce5ff['status'](_0x2c088b);return _0x5ce5ff[_0xe722('0x1f')](_0xe722('0x20'),_0x4856f7+'-'+_0x3f6ac6+'/'+_0xf8546)['json'](_0x2c5bc6);}return null;};}function patchUpdates(_0x107180){return function(_0x42795e){try{jsonpatch[_0xe722('0x21')](_0x42795e,_0x107180,!![]);}catch(_0xfbf7c2){return BPromise[_0xe722('0x22')](_0xfbf7c2);}return _0x42795e[_0xe722('0x23')]();};}function saveUpdates(_0x10adc7,_0x19dd47){return function(_0x10ede9){if(_0x10ede9){return _0x10ede9[_0xe722('0x24')](_0x10adc7)[_0xe722('0x25')](function(_0x152743){return _0x152743;});}return null;};}function removeEntity(_0xaf3eb5,_0x3d1120){return function(_0x42653b){if(_0x42653b){return _0x42653b[_0xe722('0x26')]()[_0xe722('0x25')](function(){_0xaf3eb5[_0xe722('0x19')](0xcc)[_0xe722('0x27')]();});}};}function handleEntityNotFound(_0xa903df,_0xecdaa7){return function(_0x4f40cc){if(!_0x4f40cc){_0xa903df[_0xe722('0x28')](0x194);}return _0x4f40cc;};}function handleError(_0x37f834,_0x5a79b8){_0x5a79b8=_0x5a79b8||0x1f4;return function(_0x1e1011){logger['error'](_0x1e1011[_0xe722('0x29')]);if(_0x1e1011[_0xe722('0x2a')]){delete _0x1e1011[_0xe722('0x2a')];}_0x37f834[_0xe722('0x19')](_0x5a79b8)['send'](_0x1e1011);};}exports[_0xe722('0x2b')]=function(_0x4c2d65,_0x5b6c5a){var _0x2ce346={},_0x2fc217={},_0x5eefbe={'count':0x0,'rows':[]};var _0x55214a=_[_0xe722('0x2c')](db[_0xe722('0x2d')]['rawAttributes'],function(_0x12fa46){return{'name':_0x12fa46['fieldName'],'type':_0x12fa46[_0xe722('0x2e')][_0xe722('0x2f')]};});_0x2fc217['model']=_[_0xe722('0x2c')](_0x55214a,'name');_0x2fc217[_0xe722('0x30')]=_[_0xe722('0x31')](_0x4c2d65[_0xe722('0x30')]);_0x2fc217['filters']=_[_0xe722('0x32')](_0x2fc217[_0xe722('0x33')],_0x2fc217['query']);_0x2ce346['attributes']=_['intersection'](_0x2fc217['model'],qs['fields'](_0x4c2d65[_0xe722('0x30')]['fields']));_0x2ce346[_0xe722('0x34')]=_0x2ce346[_0xe722('0x34')]['length']?_0x2ce346[_0xe722('0x34')]:_0x2fc217[_0xe722('0x33')];if(!_0x4c2d65[_0xe722('0x30')][_0xe722('0x35')]('nolimit')){_0x2ce346[_0xe722('0x1e')]=qs[_0xe722('0x1e')](_0x4c2d65[_0xe722('0x30')]['limit']);_0x2ce346['offset']=qs[_0xe722('0x1b')](_0x4c2d65['query'][_0xe722('0x1b')]);}_0x2ce346[_0xe722('0x36')]=qs[_0xe722('0x37')](_0x4c2d65[_0xe722('0x30')][_0xe722('0x37')]);_0x2ce346[_0xe722('0x38')]=qs[_0xe722('0x39')](_[_0xe722('0x3a')](_0x4c2d65['query'],_0x2fc217['filters']),_0x55214a);if(_0x4c2d65[_0xe722('0x30')][_0xe722('0x3b')]){_0x2ce346[_0xe722('0x38')]=_[_0xe722('0x3c')](_0x2ce346[_0xe722('0x38')],{'$or':_[_0xe722('0x2c')](_0x55214a,function(_0x177a91){if(_0x177a91[_0xe722('0x2e')]!==_0xe722('0x3d')){var _0x1712f5={};_0x1712f5[_0x177a91['name']]={'$like':'%'+_0x4c2d65[_0xe722('0x30')]['filter']+'%'};return _0x1712f5;}})});}_0x2ce346=_[_0xe722('0x3c')]({},_0x2ce346,_0x4c2d65[_0xe722('0x3e')]);var _0x305058={'where':_0x2ce346[_0xe722('0x38')]};return db[_0xe722('0x2d')]['count'](_0x305058)[_0xe722('0x25')](function(_0x4b72e2){_0x5eefbe[_0xe722('0x1d')]=_0x4b72e2;if(_0x4c2d65[_0xe722('0x30')][_0xe722('0x3f')]){_0x2ce346[_0xe722('0x40')]=[{'all':!![]}];}return db[_0xe722('0x2d')][_0xe722('0x41')](_0x2ce346);})[_0xe722('0x25')](function(_0x37a263){_0x5eefbe['rows']=_0x37a263;return _0x5eefbe;})[_0xe722('0x25')](respondWithFilteredResult(_0x5b6c5a,_0x2ce346))[_0xe722('0x42')](handleError(_0x5b6c5a,null));};exports['show']=function(_0xedb7d9,_0x10a235){var _0x39a36e={'raw':!![],'where':{'id':_0xedb7d9[_0xe722('0x43')]['id']}},_0xef9d03={};_0xef9d03[_0xe722('0x33')]=_[_0xe722('0x31')](db[_0xe722('0x2d')][_0xe722('0x44')]);_0xef9d03[_0xe722('0x30')]=_['keys'](_0xedb7d9[_0xe722('0x30')]);_0xef9d03[_0xe722('0x39')]=_['intersection'](_0xef9d03['model'],_0xef9d03['query']);_0x39a36e[_0xe722('0x34')]=_[_0xe722('0x32')](_0xef9d03[_0xe722('0x33')],qs[_0xe722('0x45')](_0xedb7d9[_0xe722('0x30')][_0xe722('0x45')]));_0x39a36e['attributes']=_0x39a36e[_0xe722('0x34')]['length']?_0x39a36e[_0xe722('0x34')]:_0xef9d03[_0xe722('0x33')];if(_0xedb7d9['query'][_0xe722('0x3f')]){_0x39a36e['include']=[{'all':!![]}];}_0x39a36e=_[_0xe722('0x3c')]({},_0x39a36e,_0xedb7d9[_0xe722('0x3e')]);return db[_0xe722('0x2d')][_0xe722('0x46')](_0x39a36e)[_0xe722('0x25')](handleEntityNotFound(_0x10a235,null))['then'](respondWithResult(_0x10a235,null))[_0xe722('0x42')](handleError(_0x10a235,null));};exports[_0xe722('0x47')]=function(_0x1eb5ba,_0x3456cd){return db[_0xe722('0x2d')]['create'](_0x1eb5ba['body'],{})[_0xe722('0x25')](respondWithResult(_0x3456cd,0xc9))['catch'](handleError(_0x3456cd,null));};exports[_0xe722('0x24')]=function(_0x42982b,_0x3f1d0f){if(_0x42982b[_0xe722('0x48')]['id']){delete _0x42982b[_0xe722('0x48')]['id'];}return db[_0xe722('0x2d')]['find']({'where':{'id':_0x42982b['params']['id']}})[_0xe722('0x25')](handleEntityNotFound(_0x3f1d0f,null))[_0xe722('0x25')](saveUpdates(_0x42982b['body'],null))[_0xe722('0x25')](respondWithResult(_0x3f1d0f,null))[_0xe722('0x42')](handleError(_0x3f1d0f,null));};exports[_0xe722('0x26')]=function(_0x4bc643,_0x36d9e0){return db['VoiceQueuesLog'][_0xe722('0x46')]({'where':{'id':_0x4bc643[_0xe722('0x43')]['id']}})[_0xe722('0x25')](handleEntityNotFound(_0x36d9e0,null))[_0xe722('0x25')](removeEntity(_0x36d9e0,null))[_0xe722('0x42')](handleError(_0x36d9e0,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 917a6c2..2b9005f 100644 --- a/server/api/voiceQueuesLog/voiceQueuesLog.model.js +++ b/server/api/voiceQueuesLog/voiceQueuesLog.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa753=['../../config/logger','moment','bluebird','request-promise','path','rimraf','./voiceQueuesLog.attributes','exports','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','util'];(function(_0x450f09,_0x59561d){var _0x4e22ec=function(_0x516748){while(--_0x516748){_0x450f09['push'](_0x450f09['shift']());}};_0x4e22ec(++_0x59561d);}(_0xa753,0xa3));var _0x3a75=function(_0x1a51a2,_0x473530){_0x1a51a2=_0x1a51a2-0x0;var _0x139741=_0xa753[_0x1a51a2];return _0x139741;};'use strict';var _=require(_0x3a75('0x0'));var util=require(_0x3a75('0x1'));var logger=require(_0x3a75('0x2'))('api');var moment=require(_0x3a75('0x3'));var BPromise=require(_0x3a75('0x4'));var rp=require(_0x3a75('0x5'));var fs=require('fs');var path=require(_0x3a75('0x6'));var rimraf=require(_0x3a75('0x7'));var config=require('../../config/environment');var attributes=require(_0x3a75('0x8'));module[_0x3a75('0x9')]=function(_0x4e3db4,_0x2af483){return _0x4e3db4['define'](_0x3a75('0xa'),attributes,{'tableName':_0x3a75('0xb'),'paranoid':![],'indexes':[{'name':_0x3a75('0xc'),'fields':[_0x3a75('0xd'),_0x3a75('0xe')]}],'timestamps':![]});}; \ No newline at end of file +var _0x301c=['../../config/environment','define','VoiceQueuesLog','event_dtm','event','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xef4ef0,_0x3c72f9){var _0x39b60b=function(_0x1d824c){while(--_0x1d824c){_0xef4ef0['push'](_0xef4ef0['shift']());}};_0x39b60b(++_0x3c72f9);}(_0x301c,0x83));var _0xc301=function(_0x7d9c0d,_0x165295){_0x7d9c0d=_0x7d9c0d-0x0;var _0x26a3c7=_0x301c[_0x7d9c0d];return _0x26a3c7;};'use strict';var _=require(_0xc301('0x0'));var util=require(_0xc301('0x1'));var logger=require(_0xc301('0x2'))(_0xc301('0x3'));var moment=require(_0xc301('0x4'));var BPromise=require(_0xc301('0x5'));var rp=require(_0xc301('0x6'));var fs=require('fs');var path=require(_0xc301('0x7'));var rimraf=require(_0xc301('0x8'));var config=require(_0xc301('0x9'));var attributes=require('./voiceQueuesLog.attributes');module['exports']=function(_0x5795b1,_0x3d5442){return _0x5795b1[_0xc301('0xa')](_0xc301('0xb'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0xc301('0xc'),'fields':[_0xc301('0xd'),'dtm']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 78dc269..afeb5d2 100644 --- a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js +++ b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5127=['debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent'];(function(_0x2ef8c1,_0x2f72f4){var _0x288305=function(_0x56244b){while(--_0x56244b){_0x2ef8c1['push'](_0x2ef8c1['shift']());}};_0x288305(++_0x2f72f4);}(_0x5127,0x18f));var _0x7512=function(_0x494223,_0x2c1f71){_0x494223=_0x494223-0x0;var _0xdaf98=_0x5127[_0x494223];return _0xdaf98;};'use strict';var _=require(_0x7512('0x0'));var util=require(_0x7512('0x1'));var moment=require(_0x7512('0x2'));var BPromise=require(_0x7512('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7512('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7512('0x5'))(_0x7512('0x6'));var config=require(_0x7512('0x7'));var jayson=require(_0x7512('0x8'));var client=jayson[_0x7512('0x9')][_0x7512('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e6779,_0x4d0765,_0x2d2e88){return new BPromise(function(_0x543586,_0x43ce62){return client['request'](_0x4e6779,_0x2d2e88)[_0x7512('0xb')](function(_0x1e41b5){logger[_0x7512('0xc')](_0x7512('0xd'),_0x4d0765,_0x7512('0xe'));logger[_0x7512('0xf')](_0x7512('0x10'),_0x4d0765,_0x7512('0xe'),JSON[_0x7512('0x11')](_0x1e41b5));if(_0x1e41b5[_0x7512('0x12')]){if(_0x1e41b5[_0x7512('0x12')][_0x7512('0x13')]===0x1f4){logger[_0x7512('0x12')](_0x7512('0xd'),_0x4d0765,_0x1e41b5[_0x7512('0x12')][_0x7512('0x14')]);return _0x43ce62(_0x1e41b5[_0x7512('0x12')]['message']);}logger[_0x7512('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x4d0765,_0x1e41b5[_0x7512('0x12')][_0x7512('0x14')]);return _0x543586(_0x1e41b5[_0x7512('0x12')][_0x7512('0x14')]);}else{logger[_0x7512('0xc')]('VoiceQueuesLog,\x20%s,\x20%s',_0x4d0765,'request\x20sent');_0x543586(_0x1e41b5[_0x7512('0x15')][_0x7512('0x14')]);}})[_0x7512('0x16')](function(_0x3f8f8f){logger['error'](_0x7512('0xd'),_0x4d0765,_0x3f8f8f);_0x43ce62(_0x3f8f8f);});});} \ No newline at end of file +var _0x6545=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceQueuesLog,\x20%s,\x20%s','debug','stringify','error','message','info','catch','lodash','moment','ioredis'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x6545,0x75));var _0x5654=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6545[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x5654('0x0'));var util=require('util');var moment=require(_0x5654('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5654('0x2'));var db=require(_0x5654('0x3'))['db'];var utils=require(_0x5654('0x4'));var logger=require(_0x5654('0x5'))(_0x5654('0x6'));var config=require(_0x5654('0x7'));var jayson=require(_0x5654('0x8'));var client=jayson[_0x5654('0x9')][_0x5654('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e8292,_0x14f04a,_0x1f853b){return new BPromise(function(_0x192090,_0x2712fe){return client[_0x5654('0xb')](_0x1e8292,_0x1f853b)[_0x5654('0xc')](function(_0x2d26a6){logger['info'](_0x5654('0xd'),_0x14f04a,'request\x20sent');logger[_0x5654('0xe')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x14f04a,'request\x20sent',JSON[_0x5654('0xf')](_0x2d26a6));if(_0x2d26a6[_0x5654('0x10')]){if(_0x2d26a6[_0x5654('0x10')]['code']===0x1f4){logger[_0x5654('0x10')](_0x5654('0xd'),_0x14f04a,_0x2d26a6[_0x5654('0x10')][_0x5654('0x11')]);return _0x2712fe(_0x2d26a6[_0x5654('0x10')][_0x5654('0x11')]);}logger[_0x5654('0x10')]('VoiceQueuesLog,\x20%s,\x20%s',_0x14f04a,_0x2d26a6['error'][_0x5654('0x11')]);return _0x192090(_0x2d26a6[_0x5654('0x10')][_0x5654('0x11')]);}else{logger[_0x5654('0x12')](_0x5654('0xd'),_0x14f04a,'request\x20sent');_0x192090(_0x2d26a6['result'][_0x5654('0x11')]);}})[_0x5654('0x13')](function(_0xe53d8c){logger['error'](_0x5654('0xd'),_0x14f04a,_0xe53d8c);_0x2712fe(_0xe53d8c);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 79a6d28..2f427b5 100644 --- a/server/api/voiceRecording/index.js +++ b/server/api/voiceRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xec25=['show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','put','update','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./voiceRecording.controller','isAuthenticated','index','get','describe','/:id'];(function(_0x5341bd,_0x13383a){var _0xf423b3=function(_0x4e0271){while(--_0x4e0271){_0x5341bd['push'](_0x5341bd['shift']());}};_0xf423b3(++_0x13383a);}(_0xec25,0x89));var _0x5ec2=function(_0x148cf2,_0x1875c2){_0x148cf2=_0x148cf2-0x0;var _0x11e969=_0xec25[_0x148cf2];return _0x11e969;};'use strict';var multer=require(_0x5ec2('0x0'));var util=require(_0x5ec2('0x1'));var path=require(_0x5ec2('0x2'));var timeout=require('connect-timeout');var express=require(_0x5ec2('0x3'));var router=express['Router']();var fs_extra=require(_0x5ec2('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5ec2('0x5'));var config=require(_0x5ec2('0x6'));var controller=require(_0x5ec2('0x7'));router['get']('/',auth[_0x5ec2('0x8')](),controller[_0x5ec2('0x9')]);router[_0x5ec2('0xa')]('/describe',auth[_0x5ec2('0x8')](),controller[_0x5ec2('0xb')]);router[_0x5ec2('0xa')](_0x5ec2('0xc'),auth[_0x5ec2('0x8')](),controller[_0x5ec2('0xd')]);router['get'](_0x5ec2('0xe'),auth[_0x5ec2('0x8')](),controller[_0x5ec2('0xf')]);router[_0x5ec2('0xa')](_0x5ec2('0x10'),controller[_0x5ec2('0x11')]);router[_0x5ec2('0xa')](_0x5ec2('0x12'),auth[_0x5ec2('0x8')](),controller[_0x5ec2('0x13')]);router[_0x5ec2('0x14')]('/',auth[_0x5ec2('0x8')](),controller[_0x5ec2('0x15')]);router[_0x5ec2('0x14')]('/:id/transcribe',auth[_0x5ec2('0x8')](),controller[_0x5ec2('0x16')]);router[_0x5ec2('0x17')](_0x5ec2('0xc'),auth[_0x5ec2('0x8')](),controller[_0x5ec2('0x18')]);router['delete'](_0x5ec2('0xc'),auth[_0x5ec2('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xf95d=['../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x268545,_0x4a28da){var _0x75ad3b=function(_0x162c09){while(--_0x162c09){_0x268545['push'](_0x268545['shift']());}};_0x75ad3b(++_0x4a28da);}(_0xf95d,0xe0));var _0xdf95=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0xf95d[_0x1d24eb];return _0x1dc576;};'use strict';var multer=require(_0xdf95('0x0'));var util=require(_0xdf95('0x1'));var path=require(_0xdf95('0x2'));var timeout=require(_0xdf95('0x3'));var express=require(_0xdf95('0x4'));var router=express[_0xdf95('0x5')]();var fs_extra=require(_0xdf95('0x6'));var auth=require(_0xdf95('0x7'));var interaction=require(_0xdf95('0x8'));var config=require('../../config/environment');var controller=require('./voiceRecording.controller');router[_0xdf95('0x9')]('/',auth[_0xdf95('0xa')](),controller[_0xdf95('0xb')]);router[_0xdf95('0x9')](_0xdf95('0xc'),auth[_0xdf95('0xa')](),controller[_0xdf95('0xd')]);router['get'](_0xdf95('0xe'),auth['isAuthenticated'](),controller[_0xdf95('0xf')]);router[_0xdf95('0x9')](_0xdf95('0x10'),auth['isAuthenticated'](),controller[_0xdf95('0x11')]);router[_0xdf95('0x9')](_0xdf95('0x12'),controller[_0xdf95('0x13')]);router[_0xdf95('0x9')](_0xdf95('0x14'),auth['isAuthenticated'](),controller[_0xdf95('0x15')]);router[_0xdf95('0x16')]('/',auth[_0xdf95('0xa')](),controller[_0xdf95('0x17')]);router[_0xdf95('0x16')](_0xdf95('0x14'),auth[_0xdf95('0xa')](),controller[_0xdf95('0x18')]);router[_0xdf95('0x19')](_0xdf95('0xe'),auth[_0xdf95('0xa')](),controller['update']);router[_0xdf95('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0xdf95('0x1b')]);module[_0xdf95('0x1c')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index b1da8a3..97dcf0b 100644 --- a/server/api/voiceRecording/voiceRecording.attributes.js +++ b/server/api/voiceRecording/voiceRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file +var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index b00b26c..7cc469d 100644 --- a/server/api/voiceRecording/voiceRecording.controller.js +++ b/server/api/voiceRecording/voiceRecording.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe1f6=['decryptFile','secrets','Sequelize','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','sequelize','MD5','col','$and','push','ValidationError','Entity\x20not\x20found','info','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','createBucket','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','transcribeName','TranscriptionJob','transcribeStatus','TranscriptionJobStatus','runTranscribe','%s.cypher','Setting','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','Transcript\x20not\x20available','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','stack','name','send','index','map','VoiceRecording','model','differenceBy','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','length','create','body','find','describe','download','../../components/encryptor','type','uniqueid','params','value','format','existsSync'];(function(_0x25c793,_0x220d04){var _0x29a37a=function(_0x236e4a){while(--_0x236e4a){_0x25c793['push'](_0x25c793['shift']());}};_0x29a37a(++_0x220d04);}(_0xe1f6,0xe3));var _0x6e1f=function(_0x4f3ee5,_0x38db22){_0x4f3ee5=_0x4f3ee5-0x0;var _0x5280c7=_0xe1f6[_0x4f3ee5];return _0x5280c7;};'use strict';var emlformat=require(_0x6e1f('0x0'));var rimraf=require(_0x6e1f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6e1f('0x2'));var rp=require(_0x6e1f('0x3'));var moment=require(_0x6e1f('0x4'));var BPromise=require(_0x6e1f('0x5'));var Mustache=require(_0x6e1f('0x6'));var util=require(_0x6e1f('0x7'));var path=require(_0x6e1f('0x8'));var sox=require(_0x6e1f('0x9'));var csv=require(_0x6e1f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6e1f('0xb'));var crypto=require(_0x6e1f('0xc'));var jsforce=require(_0x6e1f('0xd'));var deskjs=require(_0x6e1f('0xe'));var toCsv=require(_0x6e1f('0xa'));var querystring=require(_0x6e1f('0xf'));var Papa=require(_0x6e1f('0x10'));var AWS=require(_0x6e1f('0x11'));var uuidv4=require(_0x6e1f('0x12'));var Redis=require(_0x6e1f('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x6e1f('0x14'));var as=require(_0x6e1f('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6e1f('0x16'));var utils=require('../../config/utils');var config=require(_0x6e1f('0x17'));var licenseUtil=require(_0x6e1f('0x18'));var db=require(_0x6e1f('0x19'))['db'];function respondWithStatusCode(_0x12c027,_0x1c912a){_0x1c912a=_0x1c912a||0xcc;return function(_0x3d79a6){if(_0x3d79a6){return _0x12c027[_0x6e1f('0x1a')](_0x1c912a);}return _0x12c027['status'](_0x1c912a)[_0x6e1f('0x1b')]();};}function respondWithResult(_0x5da3a3,_0x13ff42){_0x13ff42=_0x13ff42||0xc8;return function(_0x4ee534){if(_0x4ee534){return _0x5da3a3[_0x6e1f('0x1c')](_0x13ff42)[_0x6e1f('0x1d')](_0x4ee534);}};}function respondWithFilteredResult(_0x457e3b,_0x5de91a){return function(_0x2dedff){if(_0x2dedff){var _0x3dbc3b=typeof _0x5de91a[_0x6e1f('0x1e')]===_0x6e1f('0x1f')&&typeof _0x5de91a['limit']===_0x6e1f('0x1f');var _0x30a6ca=_0x2dedff[_0x6e1f('0x20')];var _0x36df90=_0x3dbc3b?0x0:_0x5de91a['offset'];var _0xc84634=_0x3dbc3b?_0x2dedff[_0x6e1f('0x20')]:_0x5de91a[_0x6e1f('0x1e')]+_0x5de91a[_0x6e1f('0x21')];var _0x2425c0;if(_0xc84634>=_0x30a6ca){_0xc84634=_0x30a6ca;_0x2425c0=0xc8;}else{_0x2425c0=0xce;}_0x457e3b[_0x6e1f('0x1c')](_0x2425c0);return _0x457e3b[_0x6e1f('0x22')](_0x6e1f('0x23'),_0x36df90+'-'+_0xc84634+'/'+_0x30a6ca)['json'](_0x2dedff);}return null;};}function patchUpdates(_0x2acea6){return function(_0xfb2227){try{jsonpatch['apply'](_0xfb2227,_0x2acea6,!![]);}catch(_0x3a196c){return BPromise[_0x6e1f('0x24')](_0x3a196c);}return _0xfb2227['save']();};}function saveUpdates(_0x13d3d5,_0x157fe5){return function(_0x522582){if(_0x522582){return _0x522582[_0x6e1f('0x25')](_0x13d3d5)[_0x6e1f('0x26')](function(_0x4598c5){return _0x4598c5;});}return null;};}function removeEntity(_0x168abf,_0x5e7f90){return function(_0x15710c){if(_0x15710c){return _0x15710c[_0x6e1f('0x27')]()[_0x6e1f('0x26')](function(){_0x168abf[_0x6e1f('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3aa13e,_0x3f3f0e){return function(_0x5be2d2){if(!_0x5be2d2){_0x3aa13e[_0x6e1f('0x1a')](0x194);}return _0x5be2d2;};}function handleError(_0x5dc81a,_0x5cc3f2){_0x5cc3f2=_0x5cc3f2||0x1f4;return function(_0x2f855a){logger['error'](_0x2f855a[_0x6e1f('0x28')]);if(_0x2f855a[_0x6e1f('0x29')]){delete _0x2f855a[_0x6e1f('0x29')];}_0x5dc81a['status'](_0x5cc3f2)[_0x6e1f('0x2a')](_0x2f855a);};}exports[_0x6e1f('0x2b')]=function(_0x420ff2,_0x336800){var _0x825b30={},_0xb2c11d={},_0x2f6959={'count':0x0,'rows':[]};var _0xf3ce0a=_[_0x6e1f('0x2c')](db[_0x6e1f('0x2d')]['rawAttributes'],function(_0x32a513){return{'name':_0x32a513['fieldName'],'type':_0x32a513['type']['key']};});_0xb2c11d[_0x6e1f('0x2e')]=_[_0x6e1f('0x2f')](_[_0x6e1f('0x2c')](_0xf3ce0a,_0x6e1f('0x29')),['format']);_0xb2c11d[_0x6e1f('0x30')]=_[_0x6e1f('0x31')](_0x420ff2['query']);_0xb2c11d['filters']=_[_0x6e1f('0x32')](_0xb2c11d[_0x6e1f('0x2e')],_0xb2c11d[_0x6e1f('0x30')]);_0x825b30[_0x6e1f('0x33')]=_[_0x6e1f('0x32')](_0xb2c11d[_0x6e1f('0x2e')],qs[_0x6e1f('0x34')](_0x420ff2['query']['fields']));_0x825b30[_0x6e1f('0x33')]=_0x825b30[_0x6e1f('0x33')]['length']?_0x825b30[_0x6e1f('0x33')]:_0xb2c11d['model'];if(!_0x420ff2[_0x6e1f('0x30')][_0x6e1f('0x35')](_0x6e1f('0x36'))){_0x825b30[_0x6e1f('0x21')]=qs['limit'](_0x420ff2[_0x6e1f('0x30')][_0x6e1f('0x21')]);_0x825b30['offset']=qs[_0x6e1f('0x1e')](_0x420ff2['query'][_0x6e1f('0x1e')]);}_0x825b30['order']=qs[_0x6e1f('0x37')](_0x420ff2[_0x6e1f('0x30')][_0x6e1f('0x37')]);_0x825b30[_0x6e1f('0x38')]=qs[_0x6e1f('0x39')](_[_0x6e1f('0x3a')](_0x420ff2['query'],_0xb2c11d['filters']),_0xf3ce0a);if(_0x420ff2[_0x6e1f('0x30')][_0x6e1f('0x3b')]){_0x825b30[_0x6e1f('0x38')]=_[_0x6e1f('0x3c')](_0x825b30[_0x6e1f('0x38')],{'$or':_['map'](_0xf3ce0a,function(_0x3f0e29){if(_0x3f0e29['type']!==_0x6e1f('0x3d')){var _0x4ba167={};_0x4ba167[_0x3f0e29[_0x6e1f('0x29')]]={'$like':'%'+_0x420ff2['query']['filter']+'%'};return _0x4ba167;}})});}_0x825b30=_['merge']({},_0x825b30,_0x420ff2[_0x6e1f('0x3e')]);var _0x599d9d={'where':_0x825b30[_0x6e1f('0x38')]};return db[_0x6e1f('0x2d')][_0x6e1f('0x20')](_0x599d9d)[_0x6e1f('0x26')](function(_0x5eda88){_0x2f6959[_0x6e1f('0x20')]=_0x5eda88;if(_0x420ff2['query'][_0x6e1f('0x3f')]){_0x825b30[_0x6e1f('0x40')]=[{'all':!![]}];}return db[_0x6e1f('0x2d')][_0x6e1f('0x41')](_0x825b30);})[_0x6e1f('0x26')](function(_0x3e407d){_0x2f6959[_0x6e1f('0x42')]=_0x3e407d;return _0x2f6959;})['then'](respondWithFilteredResult(_0x336800,_0x825b30))[_0x6e1f('0x43')](handleError(_0x336800,null));};exports[_0x6e1f('0x44')]=function(_0x5bd61c,_0x4b1472){var _0x3d1bec={'raw':![],'where':{'id':_0x5bd61c['params']['id']}},_0x48f12d={};_0x48f12d[_0x6e1f('0x2e')]=_[_0x6e1f('0x31')](db['VoiceRecording'][_0x6e1f('0x45')]);_0x48f12d[_0x6e1f('0x30')]=_[_0x6e1f('0x31')](_0x5bd61c[_0x6e1f('0x30')]);_0x48f12d[_0x6e1f('0x39')]=_[_0x6e1f('0x32')](_0x48f12d[_0x6e1f('0x2e')],_0x48f12d[_0x6e1f('0x30')]);_0x3d1bec[_0x6e1f('0x33')]=_[_0x6e1f('0x32')](_0x48f12d['model'],qs[_0x6e1f('0x34')](_0x5bd61c['query'][_0x6e1f('0x34')]));_0x3d1bec[_0x6e1f('0x33')]=_0x3d1bec[_0x6e1f('0x33')][_0x6e1f('0x46')]?_0x3d1bec[_0x6e1f('0x33')]:_0x48f12d[_0x6e1f('0x2e')];if(_0x5bd61c[_0x6e1f('0x30')][_0x6e1f('0x3f')]){_0x3d1bec[_0x6e1f('0x40')]=[{'all':!![]}];}_0x3d1bec=_[_0x6e1f('0x3c')]({},_0x3d1bec,_0x5bd61c[_0x6e1f('0x3e')]);return db[_0x6e1f('0x2d')]['find'](_0x3d1bec)[_0x6e1f('0x26')](handleEntityNotFound(_0x4b1472,null))[_0x6e1f('0x26')](respondWithResult(_0x4b1472,null))[_0x6e1f('0x43')](handleError(_0x4b1472,null));};exports[_0x6e1f('0x47')]=function(_0x1fe22d,_0x546852){return db['VoiceRecording'][_0x6e1f('0x47')](_0x1fe22d['body'],{})[_0x6e1f('0x26')](respondWithResult(_0x546852,0xc9))[_0x6e1f('0x43')](handleError(_0x546852,null));};exports[_0x6e1f('0x25')]=function(_0x7be2af,_0x220176){if(_0x7be2af[_0x6e1f('0x48')]['id']){delete _0x7be2af[_0x6e1f('0x48')]['id'];}return db[_0x6e1f('0x2d')][_0x6e1f('0x49')]({'where':{'id':_0x7be2af['params']['id']}})['then'](handleEntityNotFound(_0x220176,null))[_0x6e1f('0x26')](saveUpdates(_0x7be2af[_0x6e1f('0x48')],null))[_0x6e1f('0x26')](respondWithResult(_0x220176,null))[_0x6e1f('0x43')](handleError(_0x220176,null));};exports[_0x6e1f('0x4a')]=function(_0x3a2507,_0x7ac07c){return db['VoiceRecording'][_0x6e1f('0x4a')]()[_0x6e1f('0x26')](respondWithResult(_0x7ac07c,null))['catch'](handleError(_0x7ac07c,null));};exports[_0x6e1f('0x4b')]=function(_0x4f0ed5,_0x27fa6c,_0x1071c9){var _0x3e80a9=require(_0x6e1f('0x4c'));var _0x3e1157=![];var _0x1f9b86={};if(_0x4f0ed5['query']['type']&&_0x4f0ed5[_0x6e1f('0x30')][_0x6e1f('0x4d')]===_0x6e1f('0x4e')){_0x1f9b86[_0x6e1f('0x4e')]=_0x4f0ed5[_0x6e1f('0x4f')]['id'];}else{_0x1f9b86['id']=_0x4f0ed5['params']['id'];}return db['VoiceRecording'][_0x6e1f('0x49')]({'where':_0x1f9b86,'attributes':['id',_0x6e1f('0x50')],'raw':!![]})[_0x6e1f('0x26')](handleEntityNotFound(_0x27fa6c,null))['then'](function(_0x447cf3){if(_0x447cf3){var _0x38d274=_0x447cf3[_0x6e1f('0x50')];var _0x1d9153=util[_0x6e1f('0x51')]('%s.cypher',_0x38d274);if(fs[_0x6e1f('0x52')](_0x1d9153)){_0x3e1157=!![];return _0x3e80a9[_0x6e1f('0x53')](_0x1d9153,_0x38d274,config[_0x6e1f('0x54')]['recording'])['then'](function(){return _0x447cf3;});}return _0x447cf3;}})[_0x6e1f('0x26')](function(_0x1c38e5){if(_0x1c38e5){var _0x3585a7=_0x1c38e5['value'];if(!fs['existsSync'](_0x3585a7)){throw new db[(_0x6e1f('0x55'))]['ValidationError'](_0x6e1f('0x56'));}if(_0x1c38e5['filename']){return _0x27fa6c['download'](_0x3585a7,_0x1c38e5[_0x6e1f('0x57')]+path[_0x6e1f('0x58')](_0x3585a7),function(){if(_0x3e1157){fs[_0x6e1f('0x59')](_0x3585a7);}});}else{return _0x27fa6c[_0x6e1f('0x4b')](_0x3585a7,function(_0x38d2b5){if(_0x3e1157){fs[_0x6e1f('0x59')](_0x3585a7);}});}}})[_0x6e1f('0x43')](function(_0x2ce13a){if(_0x2ce13a[_0x6e1f('0x5a')]===_0x6e1f('0x56')){_0x27fa6c[_0x6e1f('0x1c')](0x194)[_0x6e1f('0x2a')](_0x6e1f('0x5b'));}else{return handleError(_0x27fa6c,null);}});};exports['downloads']=function(_0x2fb1fc,_0xef7150,_0xbaa083){var _0x4fef92=require(_0x6e1f('0x4c'));var _0x5b58ee=![];var _0x36191e={'$and':[db[_0x6e1f('0x5c')][_0x6e1f('0x38')](db[_0x6e1f('0x5c')]['fn'](_0x6e1f('0x5d'),db[_0x6e1f('0x5c')][_0x6e1f('0x5e')](_0x6e1f('0x4e'))),_0x2fb1fc[_0x6e1f('0x30')]['token'])]};if(_0x2fb1fc[_0x6e1f('0x30')][_0x6e1f('0x4d')]&&_0x2fb1fc[_0x6e1f('0x30')][_0x6e1f('0x4d')]===_0x6e1f('0x4e')){_0x36191e[_0x6e1f('0x5f')]['push']({'uniqueid':_0x2fb1fc['params']['id']});}else{_0x36191e[_0x6e1f('0x5f')][_0x6e1f('0x60')]({'id':_0x2fb1fc[_0x6e1f('0x4f')]['id']});}return db[_0x6e1f('0x2d')][_0x6e1f('0x49')]({'where':_0x36191e,'attributes':['id','value'],'raw':!![]})[_0x6e1f('0x26')](handleEntityNotFound(_0xef7150,null))['then'](function(_0x47de3b){if(_0x47de3b){var _0x12151f=util['format']('%s.cypher',_0x47de3b[_0x6e1f('0x50')]);if(fs[_0x6e1f('0x52')](_0x12151f)){_0x5b58ee=!![];return _0x4fef92[_0x6e1f('0x53')](_0x12151f,_0x47de3b[_0x6e1f('0x50')],config['secrets']['recording'])['then'](function(){return _0x47de3b;});}return _0x47de3b;}})[_0x6e1f('0x26')](function(_0xea32f0){if(_0xea32f0){if(!fs[_0x6e1f('0x52')](_0xea32f0['value'])){throw new db[(_0x6e1f('0x55'))][(_0x6e1f('0x61'))]('VoiceRecording\x20not\x20found');}if(_0xea32f0[_0x6e1f('0x57')]){return _0xef7150['download'](_0xea32f0[_0x6e1f('0x50')],_0xea32f0[_0x6e1f('0x57')]+path[_0x6e1f('0x58')](_0xea32f0[_0x6e1f('0x50')]),function(){if(_0x5b58ee){fs[_0x6e1f('0x59')](_0xea32f0[_0x6e1f('0x50')]);}});}else{return _0xef7150['download'](_0xea32f0[_0x6e1f('0x50')],function(_0x4d93d5){if(_0x5b58ee){fs[_0x6e1f('0x59')](_0xea32f0['value']);}});}}})['catch'](handleError(_0xef7150,null));};exports['destroy']=function(_0x4145d5,_0x3bcdfc){return db[_0x6e1f('0x2d')][_0x6e1f('0x49')]({'where':{'id':_0x4145d5[_0x6e1f('0x4f')]['id']}})['then'](function(_0x4f668a){if(_['isNil'](_0x4f668a)){throw new ReferenceError(_0x6e1f('0x62'));}return _0x4f668a;})[_0x6e1f('0x26')](function(_0x1ca090){var _0x2cd668=_0x1ca090[_0x6e1f('0x50')];logger[_0x6e1f('0x63')]('cancellazione\x20fisica\x20documento\x20%s',_0x2cd668);if(!_[_0x6e1f('0x64')](_0x1ca090[_0x6e1f('0x50')])&&fs[_0x6e1f('0x52')](_0x2cd668)){logger['info'](_0x6e1f('0x65')+_0x2cd668+_0x6e1f('0x66'));fs[_0x6e1f('0x67')](_0x2cd668);}_0x2cd668=_0x2cd668+_0x6e1f('0x68');if(!_[_0x6e1f('0x64')](_0x1ca090['value'])&&fs[_0x6e1f('0x52')](_0x2cd668)){logger[_0x6e1f('0x63')]('File:\x20\x22'+_0x2cd668+_0x6e1f('0x66'));fs[_0x6e1f('0x67')](_0x2cd668);}return _0x1ca090;})[_0x6e1f('0x26')](function(_0x2fbf07){if(!_0x2fbf07)throw new InternalError();return _0x2fbf07[_0x6e1f('0x27')]();})[_0x6e1f('0x26')](function(){_0x3bcdfc[_0x6e1f('0x1c')](0xcc)[_0x6e1f('0x1b')]();})['catch'](handleError(_0x3bcdfc,null));};function getBucketslist(_0x9ee8a2,_0x491602,_0x42463a){return new Promise(function(_0x337113,_0xbf44ca){var _0x4655a1=new AWS['S3']({'accessKeyId':_0x491602,'secretAccessKey':_0x9ee8a2,'region':_0x42463a});_0x4655a1[_0x6e1f('0x69')]({},function(_0x55055b,_0x5d9637){if(_0x55055b){return _0xbf44ca(_0x55055b);}else{return _0x337113(_0x5d9637);}});});}function createBucket(_0x563593,_0x2b0998,_0x12a8a1,_0x44217b){return new Promise(function(_0x2809a3,_0x159186){var _0x11612f=new AWS['S3']({'accessKeyId':_0x2b0998,'secretAccessKey':_0x563593,'region':_0x12a8a1});_0x11612f[_0x6e1f('0x6a')]({'Bucket':_0x44217b},function(_0xbe4ef3,_0x5d9ec0){if(_0xbe4ef3){return _0x159186(_0xbe4ef3);}else{return _0x2809a3(_0x5d9ec0);}});});}function uploadFile(_0x7ae199,_0x4381d3,_0x921484,_0x523caa,_0x48e1d5,_0x5ef9dc){return new Promise(function(_0xd71f98,_0x201fd4){var _0x536b06=new AWS['S3']({'accessKeyId':_0x4381d3,'secretAccessKey':_0x7ae199,'region':_0x921484});_0x536b06['upload']({'Bucket':_0x523caa,'Key':_0x48e1d5,'Body':_0x5ef9dc},function(_0x35d281,_0x5996a1){if(_0x35d281){return _0x201fd4(_0x35d281);}else{return _0xd71f98(_0x5996a1);}});});}function startTranscribe(_0x50e11f,_0x2d378c,_0x563220,_0x4f5c3f,_0x4ada61,_0x20cb2c){return new Promise(function(_0x45bf5c,_0x3a39c4){var _0x354465=new AWS[(_0x6e1f('0x6b'))]({'accessKeyId':_0x2d378c,'secretAccessKey':_0x50e11f,'region':_0x563220});_0x354465[_0x6e1f('0x6c')]({'TranscriptionJobName':_0x4f5c3f,'LanguageCode':_0x4ada61,'Media':{'MediaFileUri':_0x20cb2c}},function(_0x2d6135,_0x300992){if(_0x2d6135){return _0x3a39c4(_0x2d6135);}else{return _0x45bf5c(_0x300992);}});});}function transcribe(_0x48bb91,_0x174c1f,_0x1c2b64,_0x291d02,_0x594e3d,_0x3d28e5,_0x4de05c){return new Promise(function(_0x4cfb5a,_0x34b293){var _0x48cb95={};logger[_0x6e1f('0x63')](util[_0x6e1f('0x51')](_0x6e1f('0x6d'),_0x48bb91,_0x594e3d));return uploadFile(_0x174c1f,_0x1c2b64,_0x291d02,_0x594e3d,path[_0x6e1f('0x6e')](_0x3d28e5),fs[_0x6e1f('0x6f')](_0x3d28e5))['then'](function(_0xba1b50){logger[_0x6e1f('0x63')](util[_0x6e1f('0x51')](_0x6e1f('0x70'),_0x48bb91,_0x594e3d,_0xba1b50[_0x6e1f('0x71')]));_0x48cb95[_0x6e1f('0x72')]=_0xba1b50['Bucket'];_0x48cb95[_0x6e1f('0x73')]=_0xba1b50['Location'];logger[_0x6e1f('0x63')](util[_0x6e1f('0x51')](_0x6e1f('0x74'),_0x48bb91));return startTranscribe(_0x174c1f,_0x1c2b64,_0x291d02,uuidv4(),_0x4de05c,_0xba1b50[_0x6e1f('0x71')]);})['then'](function(_0x33520b){logger[_0x6e1f('0x63')](util[_0x6e1f('0x51')](_0x6e1f('0x75'),_0x48bb91,_0x33520b['TranscriptionJob']['TranscriptionJobName']));_0x48cb95[_0x6e1f('0x76')]=_0x33520b[_0x6e1f('0x77')]['TranscriptionJobName'];_0x48cb95[_0x6e1f('0x78')]=_0x33520b[_0x6e1f('0x77')][_0x6e1f('0x79')];return _0x4cfb5a(_0x48cb95);})['catch'](function(_0x436304){return _0x34b293(_0x436304);});});}exports[_0x6e1f('0x7a')]=function(_0x4306b3,_0x52fbf8,_0x2c390a){var _0x3901f1;var _0x322382;var _0x1057fa;var _0x2cd140=require(_0x6e1f('0x4c'));return db['VoiceRecording']['findOne']({'where':{'id':_0x4306b3['params']['id']}})[_0x6e1f('0x26')](function(_0xc3a908){if(_0xc3a908){var _0xe3094e=util[_0x6e1f('0x51')](_0x6e1f('0x7b'),_0xc3a908[_0x6e1f('0x50')]);if(fs[_0x6e1f('0x52')](_0xe3094e)){cypher=!![];return _0x2cd140[_0x6e1f('0x53')](_0xe3094e,_0xc3a908[_0x6e1f('0x50')],config[_0x6e1f('0x54')]['recording'])[_0x6e1f('0x26')](function(){return _0xc3a908;});}return _0xc3a908;}})[_0x6e1f('0x26')](function(_0x174e08){if(!_0x174e08){throw new db[(_0x6e1f('0x55'))][(_0x6e1f('0x61'))]('Voice\x20Recording\x20not\x20found');}_0x322382=_0x174e08;return db[_0x6e1f('0x7c')]['findOne']({'where':{'id':0x1}});})[_0x6e1f('0x26')](handleEntityNotFound(_0x52fbf8,null))[_0x6e1f('0x26')](function(_0x72b628){if(_0x72b628){_0x3901f1=_0x72b628;if(!_0x3901f1[_0x6e1f('0x7d')]||!_0x3901f1[_0x6e1f('0x7e')]||!_0x3901f1[_0x6e1f('0x7f')]||!_0x3901f1[_0x6e1f('0x80')]||!_0x3901f1[_0x6e1f('0x72')]){throw new db[(_0x6e1f('0x55'))][(_0x6e1f('0x61'))](_0x6e1f('0x81'));}if(_0x4306b3[_0x6e1f('0x48')][_0x6e1f('0x82')]&&(!_0x3901f1[_0x6e1f('0x83')]||!_0x3901f1[_0x6e1f('0x84')]||!_0x3901f1[_0x6e1f('0x85')]||!_0x3901f1[_0x6e1f('0x80')]||!_0x3901f1[_0x6e1f('0x72')])){throw new db[(_0x6e1f('0x55'))][(_0x6e1f('0x61'))](_0x6e1f('0x86'));}return db[_0x6e1f('0x87')][_0x6e1f('0x88')]({'where':{'id':_0x3901f1[_0x6e1f('0x7e')]}});}})[_0x6e1f('0x26')](function(_0x170832){if(!_0x170832){throw new db['Sequelize'][(_0x6e1f('0x61'))](_0x6e1f('0x89'));}if(!_0x170832[_0x6e1f('0x8a')]||!_0x170832[_0x6e1f('0x8b')]){throw new db[(_0x6e1f('0x55'))][(_0x6e1f('0x61'))](_0x6e1f('0x8c'));}_0x1057fa=_0x170832;return getBucketslist(_0x1057fa[_0x6e1f('0x8a')],_0x1057fa[_0x6e1f('0x8b')],_0x3901f1[_0x6e1f('0x7f')]);})['then'](function(_0x57ea4c){if(_0x57ea4c&&_0x57ea4c[_0x6e1f('0x8d')]){var _0x17f8b7=_[_0x6e1f('0x49')](_0x57ea4c[_0x6e1f('0x8d')],function(_0x1b8c40){return _0x1b8c40[_0x6e1f('0x8e')]===_0x3901f1['bucket'];});if(!_0x17f8b7){logger['info'](util[_0x6e1f('0x51')](_0x6e1f('0x8f'),_0x4306b3[_0x6e1f('0x4f')]['id'],_0x3901f1[_0x6e1f('0x72')]));return createBucket(_0x1057fa[_0x6e1f('0x8a')],_0x1057fa[_0x6e1f('0x8b')],_0x3901f1['transcribeRegion'],_0x3901f1['bucket']);}logger[_0x6e1f('0x63')](util['format'](_0x6e1f('0x90'),_0x4306b3[_0x6e1f('0x4f')]['id'],_0x3901f1[_0x6e1f('0x72')]));return;}})[_0x6e1f('0x26')](function(_0x1ce4d6){if(_0x322382[_0x6e1f('0x78')]===_0x6e1f('0x91')){return transcribe(_0x4306b3[_0x6e1f('0x4f')]['id'],_0x1057fa[_0x6e1f('0x8a')],_0x1057fa[_0x6e1f('0x8b')],_0x3901f1['transcribeRegion'],_0x3901f1[_0x6e1f('0x72')],_0x322382[_0x6e1f('0x50')],_0x3901f1[_0x6e1f('0x80')]);}else{logger[_0x6e1f('0x63')](util[_0x6e1f('0x51')](_0x6e1f('0x92'),_0x4306b3[_0x6e1f('0x4f')]['id']));return{'transcribeStatus':_0x6e1f('0x93')};}})[_0x6e1f('0x26')](function(_0x2df595){if(_0x2df595){_0x2df595[_0x6e1f('0x94')]=_0x4306b3[_0x6e1f('0x48')][_0x6e1f('0x82')];return _0x322382[_0x6e1f('0x95')](_0x2df595);}})[_0x6e1f('0x26')](respondWithResult(_0x52fbf8,null))[_0x6e1f('0x43')](handleError(_0x52fbf8,null));};function writeFile(_0xc99d4c,_0x11d8c4){return new Promise(function(_0x10cdc5,_0xb817bf){fs['writeFile'](_0x11d8c4,_0xc99d4c,function(_0x5d1f26,_0x5c85c4){if(_0x5d1f26){return _0xb817bf(_0x5d1f26);}else{return _0x10cdc5(_0x5c85c4);}});});}exports[_0x6e1f('0x96')]=function(_0x1d7acc,_0x55144a,_0x412af2){return db['VoiceRecording'][_0x6e1f('0x88')]({'where':{'id':_0x1d7acc[_0x6e1f('0x4f')]['id']}})['then'](handleEntityNotFound(_0x55144a))[_0x6e1f('0x26')](function(_0x3e91aa){if(_0x3e91aa&&_0x3e91aa[_0x6e1f('0x97')]){var _0x26376e=_0x3e91aa[_0x6e1f('0x97')];var _0x5bcfef=config[_0x6e1f('0x98')]+_0x6e1f('0x99')+_0x3e91aa['id']+'.txt';if(fs[_0x6e1f('0x52')](_0x5bcfef)){return _0x5bcfef;}return writeFile(_0x26376e,_0x5bcfef)['then'](function(){return _0x5bcfef;});}else{throw new db[(_0x6e1f('0x55'))][(_0x6e1f('0x61'))](_0x6e1f('0x9a'));}})['then'](function(_0x4fa3e6){return _0x55144a[_0x6e1f('0x4b')](_0x4fa3e6);})['catch'](handleError(_0x55144a));}; \ No newline at end of file +var _0xedbe=['ValidationError','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','isNil','listBuckets','upload','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','transcribeName','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribeAccountId','runSentiment','sentimentAccountId','language','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','data2','Cloud\x20Provider\x20not\x20configured','data1','transcribeRegion','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','updateAttributes','writeFile','fileText','root','/server/files/transcribes/transcribe_','.txt','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../mysqldb','end','json','offset','undefined','limit','set','apply','save','update','destroy','then','status','sendStatus','error','stack','name','send','map','VoiceRecording','rawAttributes','fieldName','type','key','differenceBy','format','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','count','includeAll','include','rows','show','params','find','catch','create','body','describe','../../components/encryptor','uniqueid','value','%s.cypher','decryptFile','secrets','existsSync','Sequelize','VoiceRecording\x20not\x20found','download','filename','extname','unlink','Not\x20found','sequelize','MD5','col','$and','push','recording'];(function(_0x251e65,_0x13996b){var _0x1041b5=function(_0x14d146){while(--_0x14d146){_0x251e65['push'](_0x251e65['shift']());}};_0x1041b5(++_0x13996b);}(_0xedbe,0xc2));var _0xeedb=function(_0x45f902,_0x2a1e73){_0x45f902=_0x45f902-0x0;var _0xb21532=_0xedbe[_0x45f902];return _0xb21532;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeedb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xeedb('0x1'));var rp=require(_0xeedb('0x2'));var moment=require(_0xeedb('0x3'));var BPromise=require(_0xeedb('0x4'));var Mustache=require(_0xeedb('0x5'));var util=require('util');var path=require('path');var sox=require(_0xeedb('0x6'));var csv=require('to-csv');var ejs=require(_0xeedb('0x7'));var fs=require('fs');var fs_extra=require(_0xeedb('0x8'));var _=require(_0xeedb('0x9'));var squel=require(_0xeedb('0xa'));var crypto=require('crypto');var jsforce=require(_0xeedb('0xb'));var deskjs=require(_0xeedb('0xc'));var toCsv=require(_0xeedb('0xd'));var querystring=require(_0xeedb('0xe'));var Papa=require(_0xeedb('0xf'));var AWS=require(_0xeedb('0x10'));var uuidv4=require(_0xeedb('0x11'));var Redis=require(_0xeedb('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xeedb('0x13'));var as=require(_0xeedb('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xeedb('0x15'))['db'];function respondWithStatusCode(_0x63de41,_0x36ee8a){_0x36ee8a=_0x36ee8a||0xcc;return function(_0x41ee50){if(_0x41ee50){return _0x63de41['sendStatus'](_0x36ee8a);}return _0x63de41['status'](_0x36ee8a)[_0xeedb('0x16')]();};}function respondWithResult(_0x2e9641,_0xaea6ae){_0xaea6ae=_0xaea6ae||0xc8;return function(_0x27cbba){if(_0x27cbba){return _0x2e9641['status'](_0xaea6ae)[_0xeedb('0x17')](_0x27cbba);}};}function respondWithFilteredResult(_0x11d7d8,_0x3cc338){return function(_0x1803f7){if(_0x1803f7){var _0x48964d=typeof _0x3cc338[_0xeedb('0x18')]===_0xeedb('0x19')&&typeof _0x3cc338[_0xeedb('0x1a')]===_0xeedb('0x19');var _0x1a4d63=_0x1803f7['count'];var _0x1c5ec1=_0x48964d?0x0:_0x3cc338[_0xeedb('0x18')];var _0x283f9c=_0x48964d?_0x1803f7['count']:_0x3cc338['offset']+_0x3cc338[_0xeedb('0x1a')];var _0x466b4e;if(_0x283f9c>=_0x1a4d63){_0x283f9c=_0x1a4d63;_0x466b4e=0xc8;}else{_0x466b4e=0xce;}_0x11d7d8['status'](_0x466b4e);return _0x11d7d8[_0xeedb('0x1b')]('Content-Range',_0x1c5ec1+'-'+_0x283f9c+'/'+_0x1a4d63)[_0xeedb('0x17')](_0x1803f7);}return null;};}function patchUpdates(_0x16f83c){return function(_0x5c3ca1){try{jsonpatch[_0xeedb('0x1c')](_0x5c3ca1,_0x16f83c,!![]);}catch(_0x1ec0f5){return BPromise['reject'](_0x1ec0f5);}return _0x5c3ca1[_0xeedb('0x1d')]();};}function saveUpdates(_0x1e4d59,_0x4b9cc8){return function(_0x43e80d){if(_0x43e80d){return _0x43e80d[_0xeedb('0x1e')](_0x1e4d59)['then'](function(_0xa86828){return _0xa86828;});}return null;};}function removeEntity(_0x2a938c,_0x193578){return function(_0x4eb12d){if(_0x4eb12d){return _0x4eb12d[_0xeedb('0x1f')]()[_0xeedb('0x20')](function(){_0x2a938c[_0xeedb('0x21')](0xcc)[_0xeedb('0x16')]();});}};}function handleEntityNotFound(_0xca689a,_0x345828){return function(_0x3fcbb2){if(!_0x3fcbb2){_0xca689a[_0xeedb('0x22')](0x194);}return _0x3fcbb2;};}function handleError(_0x452419,_0x295f0f){_0x295f0f=_0x295f0f||0x1f4;return function(_0x2d7c55){logger[_0xeedb('0x23')](_0x2d7c55[_0xeedb('0x24')]);if(_0x2d7c55[_0xeedb('0x25')]){delete _0x2d7c55[_0xeedb('0x25')];}_0x452419[_0xeedb('0x21')](_0x295f0f)[_0xeedb('0x26')](_0x2d7c55);};}exports['index']=function(_0x3d55a0,_0xb12e91){var _0x528f64={},_0x316164={},_0x1c2268={'count':0x0,'rows':[]};var _0x52626e=_[_0xeedb('0x27')](db[_0xeedb('0x28')][_0xeedb('0x29')],function(_0x997a9){return{'name':_0x997a9[_0xeedb('0x2a')],'type':_0x997a9[_0xeedb('0x2b')][_0xeedb('0x2c')]};});_0x316164['model']=_[_0xeedb('0x2d')](_[_0xeedb('0x27')](_0x52626e,_0xeedb('0x25')),[_0xeedb('0x2e')]);_0x316164[_0xeedb('0x2f')]=_[_0xeedb('0x30')](_0x3d55a0[_0xeedb('0x2f')]);_0x316164[_0xeedb('0x31')]=_['intersection'](_0x316164['model'],_0x316164[_0xeedb('0x2f')]);_0x528f64[_0xeedb('0x32')]=_[_0xeedb('0x33')](_0x316164[_0xeedb('0x34')],qs[_0xeedb('0x35')](_0x3d55a0[_0xeedb('0x2f')][_0xeedb('0x35')]));_0x528f64[_0xeedb('0x32')]=_0x528f64['attributes'][_0xeedb('0x36')]?_0x528f64[_0xeedb('0x32')]:_0x316164[_0xeedb('0x34')];if(!_0x3d55a0[_0xeedb('0x2f')][_0xeedb('0x37')](_0xeedb('0x38'))){_0x528f64[_0xeedb('0x1a')]=qs['limit'](_0x3d55a0[_0xeedb('0x2f')][_0xeedb('0x1a')]);_0x528f64[_0xeedb('0x18')]=qs[_0xeedb('0x18')](_0x3d55a0['query']['offset']);}_0x528f64['order']=qs[_0xeedb('0x39')](_0x3d55a0[_0xeedb('0x2f')]['sort']);_0x528f64[_0xeedb('0x3a')]=qs['filters'](_[_0xeedb('0x3b')](_0x3d55a0['query'],_0x316164[_0xeedb('0x31')]),_0x52626e);if(_0x3d55a0[_0xeedb('0x2f')][_0xeedb('0x3c')]){_0x528f64[_0xeedb('0x3a')]=_['merge'](_0x528f64[_0xeedb('0x3a')],{'$or':_['map'](_0x52626e,function(_0x30a4ca){if(_0x30a4ca[_0xeedb('0x2b')]!=='VIRTUAL'){var _0x456db5={};_0x456db5[_0x30a4ca['name']]={'$like':'%'+_0x3d55a0[_0xeedb('0x2f')][_0xeedb('0x3c')]+'%'};return _0x456db5;}})});}_0x528f64=_[_0xeedb('0x3d')]({},_0x528f64,_0x3d55a0[_0xeedb('0x3e')]);var _0x56dc24={'where':_0x528f64[_0xeedb('0x3a')]};return db[_0xeedb('0x28')][_0xeedb('0x3f')](_0x56dc24)[_0xeedb('0x20')](function(_0x285fa9){_0x1c2268['count']=_0x285fa9;if(_0x3d55a0[_0xeedb('0x2f')][_0xeedb('0x40')]){_0x528f64[_0xeedb('0x41')]=[{'all':!![]}];}return db[_0xeedb('0x28')]['findAll'](_0x528f64);})[_0xeedb('0x20')](function(_0x36d79f){_0x1c2268[_0xeedb('0x42')]=_0x36d79f;return _0x1c2268;})[_0xeedb('0x20')](respondWithFilteredResult(_0xb12e91,_0x528f64))['catch'](handleError(_0xb12e91,null));};exports[_0xeedb('0x43')]=function(_0x23335b,_0x29e197){var _0x424d7a={'raw':![],'where':{'id':_0x23335b[_0xeedb('0x44')]['id']}},_0x208158={};_0x208158[_0xeedb('0x34')]=_[_0xeedb('0x30')](db[_0xeedb('0x28')][_0xeedb('0x29')]);_0x208158[_0xeedb('0x2f')]=_[_0xeedb('0x30')](_0x23335b[_0xeedb('0x2f')]);_0x208158[_0xeedb('0x31')]=_[_0xeedb('0x33')](_0x208158[_0xeedb('0x34')],_0x208158[_0xeedb('0x2f')]);_0x424d7a[_0xeedb('0x32')]=_[_0xeedb('0x33')](_0x208158[_0xeedb('0x34')],qs[_0xeedb('0x35')](_0x23335b[_0xeedb('0x2f')][_0xeedb('0x35')]));_0x424d7a[_0xeedb('0x32')]=_0x424d7a[_0xeedb('0x32')][_0xeedb('0x36')]?_0x424d7a[_0xeedb('0x32')]:_0x208158[_0xeedb('0x34')];if(_0x23335b[_0xeedb('0x2f')][_0xeedb('0x40')]){_0x424d7a[_0xeedb('0x41')]=[{'all':!![]}];}_0x424d7a=_[_0xeedb('0x3d')]({},_0x424d7a,_0x23335b['options']);return db['VoiceRecording'][_0xeedb('0x45')](_0x424d7a)['then'](handleEntityNotFound(_0x29e197,null))['then'](respondWithResult(_0x29e197,null))[_0xeedb('0x46')](handleError(_0x29e197,null));};exports[_0xeedb('0x47')]=function(_0x554dca,_0x4d9f02){return db[_0xeedb('0x28')][_0xeedb('0x47')](_0x554dca[_0xeedb('0x48')],{})[_0xeedb('0x20')](respondWithResult(_0x4d9f02,0xc9))[_0xeedb('0x46')](handleError(_0x4d9f02,null));};exports['update']=function(_0x51eeae,_0x40dbce){if(_0x51eeae[_0xeedb('0x48')]['id']){delete _0x51eeae[_0xeedb('0x48')]['id'];}return db[_0xeedb('0x28')][_0xeedb('0x45')]({'where':{'id':_0x51eeae[_0xeedb('0x44')]['id']}})[_0xeedb('0x20')](handleEntityNotFound(_0x40dbce,null))[_0xeedb('0x20')](saveUpdates(_0x51eeae[_0xeedb('0x48')],null))[_0xeedb('0x20')](respondWithResult(_0x40dbce,null))[_0xeedb('0x46')](handleError(_0x40dbce,null));};exports[_0xeedb('0x49')]=function(_0x3d3452,_0x2cad8c){return db['VoiceRecording']['describe']()[_0xeedb('0x20')](respondWithResult(_0x2cad8c,null))['catch'](handleError(_0x2cad8c,null));};exports['download']=function(_0x48c194,_0x5f5028,_0x56daec){var _0x1a8d99=require(_0xeedb('0x4a'));var _0x117f72=![];var _0x21b7b={};if(_0x48c194['query'][_0xeedb('0x2b')]&&_0x48c194[_0xeedb('0x2f')][_0xeedb('0x2b')]==='uniqueid'){_0x21b7b[_0xeedb('0x4b')]=_0x48c194['params']['id'];}else{_0x21b7b['id']=_0x48c194[_0xeedb('0x44')]['id'];}return db[_0xeedb('0x28')][_0xeedb('0x45')]({'where':_0x21b7b,'attributes':['id',_0xeedb('0x4c')],'raw':!![]})[_0xeedb('0x20')](handleEntityNotFound(_0x5f5028,null))[_0xeedb('0x20')](function(_0x3a43a1){if(_0x3a43a1){var _0xbb06fe=_0x3a43a1[_0xeedb('0x4c')];var _0x45e908=util[_0xeedb('0x2e')](_0xeedb('0x4d'),_0xbb06fe);if(fs['existsSync'](_0x45e908)){_0x117f72=!![];return _0x1a8d99[_0xeedb('0x4e')](_0x45e908,_0xbb06fe,config[_0xeedb('0x4f')]['recording'])[_0xeedb('0x20')](function(){return _0x3a43a1;});}return _0x3a43a1;}})['then'](function(_0x516d3d){if(_0x516d3d){var _0x2230ca=_0x516d3d[_0xeedb('0x4c')];if(!fs[_0xeedb('0x50')](_0x2230ca)){throw new db[(_0xeedb('0x51'))]['ValidationError'](_0xeedb('0x52'));}if(_0x516d3d['filename']){return _0x5f5028[_0xeedb('0x53')](_0x2230ca,_0x516d3d[_0xeedb('0x54')]+path[_0xeedb('0x55')](_0x2230ca),function(){if(_0x117f72){fs[_0xeedb('0x56')](_0x2230ca);}});}else{return _0x5f5028[_0xeedb('0x53')](_0x2230ca,function(_0x1ea6a8){if(_0x117f72){fs[_0xeedb('0x56')](_0x2230ca);}});}}})[_0xeedb('0x46')](function(_0x11bf62){if(_0x11bf62['message']===_0xeedb('0x52')){_0x5f5028[_0xeedb('0x21')](0x194)[_0xeedb('0x26')](_0xeedb('0x57'));}else{return handleError(_0x5f5028,null);}});};exports['downloads']=function(_0x354ce6,_0x11ca00,_0x10a8de){var _0x3e77b3=require('../../components/encryptor');var _0xf22f89=![];var _0x2b79fc={'$and':[db[_0xeedb('0x58')][_0xeedb('0x3a')](db[_0xeedb('0x58')]['fn'](_0xeedb('0x59'),db['sequelize'][_0xeedb('0x5a')](_0xeedb('0x4b'))),_0x354ce6[_0xeedb('0x2f')]['token'])]};if(_0x354ce6[_0xeedb('0x2f')][_0xeedb('0x2b')]&&_0x354ce6[_0xeedb('0x2f')][_0xeedb('0x2b')]==='uniqueid'){_0x2b79fc[_0xeedb('0x5b')][_0xeedb('0x5c')]({'uniqueid':_0x354ce6[_0xeedb('0x44')]['id']});}else{_0x2b79fc['$and'][_0xeedb('0x5c')]({'id':_0x354ce6[_0xeedb('0x44')]['id']});}return db[_0xeedb('0x28')][_0xeedb('0x45')]({'where':_0x2b79fc,'attributes':['id',_0xeedb('0x4c')],'raw':!![]})['then'](handleEntityNotFound(_0x11ca00,null))[_0xeedb('0x20')](function(_0x29af55){if(_0x29af55){var _0xbe85e3=util[_0xeedb('0x2e')](_0xeedb('0x4d'),_0x29af55[_0xeedb('0x4c')]);if(fs[_0xeedb('0x50')](_0xbe85e3)){_0xf22f89=!![];return _0x3e77b3[_0xeedb('0x4e')](_0xbe85e3,_0x29af55[_0xeedb('0x4c')],config[_0xeedb('0x4f')][_0xeedb('0x5d')])[_0xeedb('0x20')](function(){return _0x29af55;});}return _0x29af55;}})[_0xeedb('0x20')](function(_0x432eba){if(_0x432eba){if(!fs[_0xeedb('0x50')](_0x432eba[_0xeedb('0x4c')])){throw new db['Sequelize'][(_0xeedb('0x5e'))](_0xeedb('0x52'));}if(_0x432eba[_0xeedb('0x54')]){return _0x11ca00[_0xeedb('0x53')](_0x432eba[_0xeedb('0x4c')],_0x432eba[_0xeedb('0x54')]+path['extname'](_0x432eba[_0xeedb('0x4c')]),function(){if(_0xf22f89){fs[_0xeedb('0x56')](_0x432eba[_0xeedb('0x4c')]);}});}else{return _0x11ca00[_0xeedb('0x53')](_0x432eba[_0xeedb('0x4c')],function(_0x1836c4){if(_0xf22f89){fs[_0xeedb('0x56')](_0x432eba[_0xeedb('0x4c')]);}});}}})[_0xeedb('0x46')](handleError(_0x11ca00,null));};exports['destroy']=function(_0x1c519d,_0xfb92d6){return db[_0xeedb('0x28')][_0xeedb('0x45')]({'where':{'id':_0x1c519d[_0xeedb('0x44')]['id']}})[_0xeedb('0x20')](function(_0x319a86){if(_['isNil'](_0x319a86)){throw new ReferenceError(_0xeedb('0x5f'));}return _0x319a86;})[_0xeedb('0x20')](function(_0x523d59){var _0x49aaf0=_0x523d59['value'];logger['info'](_0xeedb('0x60'),_0x49aaf0);if(!_['isNil'](_0x523d59[_0xeedb('0x4c')])&&fs[_0xeedb('0x50')](_0x49aaf0)){logger[_0xeedb('0x61')](_0xeedb('0x62')+_0x49aaf0+_0xeedb('0x63'));fs[_0xeedb('0x64')](_0x49aaf0);}_0x49aaf0=_0x49aaf0+_0xeedb('0x65');if(!_[_0xeedb('0x66')](_0x523d59['value'])&&fs['existsSync'](_0x49aaf0)){logger[_0xeedb('0x61')](_0xeedb('0x62')+_0x49aaf0+_0xeedb('0x63'));fs[_0xeedb('0x64')](_0x49aaf0);}return _0x523d59;})[_0xeedb('0x20')](function(_0x51d8fb){if(!_0x51d8fb)throw new InternalError();return _0x51d8fb[_0xeedb('0x1f')]();})['then'](function(){_0xfb92d6[_0xeedb('0x21')](0xcc)[_0xeedb('0x16')]();})[_0xeedb('0x46')](handleError(_0xfb92d6,null));};function getBucketslist(_0x1f6826,_0x46ebba,_0x153c71){return new Promise(function(_0x214c50,_0x2477f5){var _0x522851=new AWS['S3']({'accessKeyId':_0x46ebba,'secretAccessKey':_0x1f6826,'region':_0x153c71});_0x522851[_0xeedb('0x67')]({},function(_0x491bf8,_0x458f6f){if(_0x491bf8){return _0x2477f5(_0x491bf8);}else{return _0x214c50(_0x458f6f);}});});}function createBucket(_0x524a15,_0x2bb867,_0xa50cae,_0x23ff7c){return new Promise(function(_0x769611,_0x1db3c9){var _0x315230=new AWS['S3']({'accessKeyId':_0x2bb867,'secretAccessKey':_0x524a15,'region':_0xa50cae});_0x315230['createBucket']({'Bucket':_0x23ff7c},function(_0x737747,_0x40a9c1){if(_0x737747){return _0x1db3c9(_0x737747);}else{return _0x769611(_0x40a9c1);}});});}function uploadFile(_0x2966e,_0x905d0c,_0x10b18b,_0x351f3b,_0x191889,_0x51f627){return new Promise(function(_0x91155,_0x38a5d9){var _0x2f4519=new AWS['S3']({'accessKeyId':_0x905d0c,'secretAccessKey':_0x2966e,'region':_0x10b18b});_0x2f4519[_0xeedb('0x68')]({'Bucket':_0x351f3b,'Key':_0x191889,'Body':_0x51f627},function(_0x35801d,_0x205f23){if(_0x35801d){return _0x38a5d9(_0x35801d);}else{return _0x91155(_0x205f23);}});});}function startTranscribe(_0x4d1e93,_0x272fe1,_0x16c9c9,_0x255e4c,_0x79f978,_0x18d147){return new Promise(function(_0x43a07d,_0x4d7463){var _0x21a108=new AWS['TranscribeService']({'accessKeyId':_0x272fe1,'secretAccessKey':_0x4d1e93,'region':_0x16c9c9});_0x21a108['startTranscriptionJob']({'TranscriptionJobName':_0x255e4c,'LanguageCode':_0x79f978,'Media':{'MediaFileUri':_0x18d147}},function(_0x51f1fb,_0x1b9028){if(_0x51f1fb){return _0x4d7463(_0x51f1fb);}else{return _0x43a07d(_0x1b9028);}});});}function transcribe(_0x111b89,_0x3cd7a1,_0x15b734,_0x3f3611,_0x5de461,_0x255ac6,_0x1779af){return new Promise(function(_0x43c234,_0x5a1e78){var _0x3fab95={};logger[_0xeedb('0x61')](util[_0xeedb('0x2e')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x111b89,_0x5de461));return uploadFile(_0x3cd7a1,_0x15b734,_0x3f3611,_0x5de461,path[_0xeedb('0x69')](_0x255ac6),fs[_0xeedb('0x6a')](_0x255ac6))[_0xeedb('0x20')](function(_0x2ec2de){logger[_0xeedb('0x61')](util[_0xeedb('0x2e')](_0xeedb('0x6b'),_0x111b89,_0x5de461,_0x2ec2de[_0xeedb('0x6c')]));_0x3fab95[_0xeedb('0x6d')]=_0x2ec2de[_0xeedb('0x6e')];_0x3fab95[_0xeedb('0x6f')]=_0x2ec2de[_0xeedb('0x6c')];logger[_0xeedb('0x61')](util[_0xeedb('0x2e')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x111b89));return startTranscribe(_0x3cd7a1,_0x15b734,_0x3f3611,uuidv4(),_0x1779af,_0x2ec2de[_0xeedb('0x6c')]);})['then'](function(_0x253494){logger['info'](util['format'](_0xeedb('0x70'),_0x111b89,_0x253494[_0xeedb('0x71')]['TranscriptionJobName']));_0x3fab95[_0xeedb('0x72')]=_0x253494[_0xeedb('0x71')][_0xeedb('0x73')];_0x3fab95[_0xeedb('0x74')]=_0x253494['TranscriptionJob'][_0xeedb('0x75')];return _0x43c234(_0x3fab95);})[_0xeedb('0x46')](function(_0xff3c15){return _0x5a1e78(_0xff3c15);});});}exports[_0xeedb('0x76')]=function(_0x5d91cb,_0x539192,_0x4d186d){var _0x3dc7f3;var _0x44005c;var _0xd338ae;var _0x9e4a9d=require(_0xeedb('0x4a'));return db['VoiceRecording'][_0xeedb('0x77')]({'where':{'id':_0x5d91cb[_0xeedb('0x44')]['id']}})[_0xeedb('0x20')](function(_0x4b23af){if(_0x4b23af){var _0x17bce0=util['format'](_0xeedb('0x4d'),_0x4b23af[_0xeedb('0x4c')]);if(fs['existsSync'](_0x17bce0)){cypher=!![];return _0x9e4a9d[_0xeedb('0x4e')](_0x17bce0,_0x4b23af[_0xeedb('0x4c')],config[_0xeedb('0x4f')][_0xeedb('0x5d')])[_0xeedb('0x20')](function(){return _0x4b23af;});}return _0x4b23af;}})[_0xeedb('0x20')](function(_0x1f8095){if(!_0x1f8095){throw new db['Sequelize']['ValidationError'](_0xeedb('0x78'));}_0x44005c=_0x1f8095;return db[_0xeedb('0x79')]['findOne']({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x539192,null))[_0xeedb('0x20')](function(_0x42b752){if(_0x42b752){_0x3dc7f3=_0x42b752;if(!_0x3dc7f3['transcribe']||!_0x3dc7f3[_0xeedb('0x7a')]||!_0x3dc7f3['transcribeRegion']||!_0x3dc7f3['language']||!_0x3dc7f3[_0xeedb('0x6d')]){throw new db[(_0xeedb('0x51'))][(_0xeedb('0x5e'))]('Transcribe\x20not\x20configured');}if(_0x5d91cb[_0xeedb('0x48')][_0xeedb('0x7b')]&&(!_0x3dc7f3['sentiment']||!_0x3dc7f3[_0xeedb('0x7c')]||!_0x3dc7f3['sentimentRegion']||!_0x3dc7f3[_0xeedb('0x7d')]||!_0x3dc7f3[_0xeedb('0x6d')])){throw new db[(_0xeedb('0x51'))][(_0xeedb('0x5e'))](_0xeedb('0x7e'));}return db[_0xeedb('0x7f')][_0xeedb('0x77')]({'where':{'id':_0x3dc7f3[_0xeedb('0x7a')]}});}})['then'](function(_0x456f6c){if(!_0x456f6c){throw new db[(_0xeedb('0x51'))][(_0xeedb('0x5e'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x456f6c['data1']||!_0x456f6c[_0xeedb('0x80')]){throw new db[(_0xeedb('0x51'))]['ValidationError'](_0xeedb('0x81'));}_0xd338ae=_0x456f6c;return getBucketslist(_0xd338ae[_0xeedb('0x82')],_0xd338ae[_0xeedb('0x80')],_0x3dc7f3[_0xeedb('0x83')]);})['then'](function(_0x142090){if(_0x142090&&_0x142090[_0xeedb('0x84')]){var _0x1d1ec7=_[_0xeedb('0x45')](_0x142090[_0xeedb('0x84')],function(_0x4ed05b){return _0x4ed05b['Name']===_0x3dc7f3[_0xeedb('0x6d')];});if(!_0x1d1ec7){logger[_0xeedb('0x61')](util[_0xeedb('0x2e')](_0xeedb('0x85'),_0x5d91cb[_0xeedb('0x44')]['id'],_0x3dc7f3[_0xeedb('0x6d')]));return createBucket(_0xd338ae[_0xeedb('0x82')],_0xd338ae[_0xeedb('0x80')],_0x3dc7f3[_0xeedb('0x83')],_0x3dc7f3[_0xeedb('0x6d')]);}logger[_0xeedb('0x61')](util['format'](_0xeedb('0x86'),_0x5d91cb['params']['id'],_0x3dc7f3[_0xeedb('0x6d')]));return;}})[_0xeedb('0x20')](function(_0x22ba04){if(_0x44005c['transcribeStatus']===_0xeedb('0x87')){return transcribe(_0x5d91cb[_0xeedb('0x44')]['id'],_0xd338ae[_0xeedb('0x82')],_0xd338ae[_0xeedb('0x80')],_0x3dc7f3['transcribeRegion'],_0x3dc7f3[_0xeedb('0x6d')],_0x44005c[_0xeedb('0x4c')],_0x3dc7f3[_0xeedb('0x7d')]);}else{logger[_0xeedb('0x61')](util[_0xeedb('0x2e')](_0xeedb('0x88'),_0x5d91cb[_0xeedb('0x44')]['id']));return{'transcribeStatus':_0xeedb('0x89')};}})[_0xeedb('0x20')](function(_0x2d357a){if(_0x2d357a){_0x2d357a['tempSentiment']=_0x5d91cb[_0xeedb('0x48')][_0xeedb('0x7b')];return _0x44005c[_0xeedb('0x8a')](_0x2d357a);}})[_0xeedb('0x20')](respondWithResult(_0x539192,null))['catch'](handleError(_0x539192,null));};function writeFile(_0x7796ff,_0xf42f0){return new Promise(function(_0xc017f9,_0x5b10b6){fs[_0xeedb('0x8b')](_0xf42f0,_0x7796ff,function(_0x782af7,_0x57f99f){if(_0x782af7){return _0x5b10b6(_0x782af7);}else{return _0xc017f9(_0x57f99f);}});});}exports['downloadTranscribe']=function(_0x3f5be6,_0x11ef43,_0x2c7c81){return db[_0xeedb('0x28')]['findOne']({'where':{'id':_0x3f5be6[_0xeedb('0x44')]['id']}})[_0xeedb('0x20')](handleEntityNotFound(_0x11ef43))['then'](function(_0x13c766){if(_0x13c766&&_0x13c766['fileText']){var _0x292f02=_0x13c766[_0xeedb('0x8c')];var _0x4d65bc=config[_0xeedb('0x8d')]+_0xeedb('0x8e')+_0x13c766['id']+_0xeedb('0x8f');if(fs[_0xeedb('0x50')](_0x4d65bc)){return _0x4d65bc;}return writeFile(_0x292f02,_0x4d65bc)[_0xeedb('0x20')](function(){return _0x4d65bc;});}else{throw new db[(_0xeedb('0x51'))][(_0xeedb('0x5e'))]('Transcript\x20not\x20available');}})[_0xeedb('0x20')](function(_0x296905){return _0x11ef43['download'](_0x296905);})['catch'](handleError(_0x11ef43));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 4a98248..55e0583 100644 --- a/server/api/voiceRecording/voiceRecording.model.js +++ b/server/api/voiceRecording/voiceRecording.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb43b=['define','VoiceRecording','voice_recordings','uniqueid','transcribeStatus','./voiceRecording.attributes'];(function(_0x4064a4,_0x3769d2){var _0x539f9c=function(_0x2156b2){while(--_0x2156b2){_0x4064a4['push'](_0x4064a4['shift']());}};_0x539f9c(++_0x3769d2);}(_0xb43b,0xbf));var _0xbb43=function(_0x585350,_0x3e536d){_0x585350=_0x585350-0x0;var _0x5d8e96=_0xb43b[_0x585350];return _0x5d8e96;};'use strict';var attributes=require(_0xbb43('0x0'));module['exports']=function(_0x1b9ba2,_0x21ce6c){return _0x1b9ba2[_0xbb43('0x1')](_0xbb43('0x2'),attributes,{'tableName':_0xbb43('0x3'),'paranoid':![],'indexes':[{'name':_0xbb43('0x4'),'fields':[_0xbb43('0x4')]},{'name':_0xbb43('0x5'),'fields':[_0xbb43('0x5')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xaf9b=['voice_recordings','uniqueid','transcribeStatus','./voiceRecording.attributes','define','VoiceRecording'];(function(_0x33c637,_0x597c26){var _0x14aa20=function(_0x32a8b5){while(--_0x32a8b5){_0x33c637['push'](_0x33c637['shift']());}};_0x14aa20(++_0x597c26);}(_0xaf9b,0x1d7));var _0xbaf9=function(_0x1e345d,_0x2f7921){_0x1e345d=_0x1e345d-0x0;var _0x4ca266=_0xaf9b[_0x1e345d];return _0x4ca266;};'use strict';var attributes=require(_0xbaf9('0x0'));module['exports']=function(_0x2c58cf,_0x58d1a2){return _0x2c58cf[_0xbaf9('0x1')](_0xbaf9('0x2'),attributes,{'tableName':_0xbaf9('0x3'),'paranoid':![],'indexes':[{'name':_0xbaf9('0x4'),'fields':['uniqueid']},{'name':_0xbaf9('0x5'),'fields':[_0xbaf9('0x5')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 2eb2830..ccf440f 100644 --- a/server/api/voiceRecording/voiceRecording.rpc.js +++ b/server/api/voiceRecording/voiceRecording.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa6b0=['create','value','%s.cypher','encryptFile','secrets','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','update','body','options','raw','where','limit','then','UpdateVoiceRecording','CreateVoiceRecording','../../components/encryptor','callRecordingEncryption','VoiceRecording'];(function(_0x396a44,_0x3557ba){var _0x3fc32b=function(_0x4ab361){while(--_0x4ab361){_0x396a44['push'](_0x396a44['shift']());}};_0x3fc32b(++_0x3557ba);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x3db9e1,_0x4f4198){_0x3db9e1=_0x3db9e1-0x0;var _0x2d43b5=_0xa6b0[_0x3db9e1];return _0x2d43b5;};'use strict';var _=require(_0x0a6b('0x0'));var util=require(_0x0a6b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0a6b('0x2'));var fs=require('fs');var Redis=require(_0x0a6b('0x3'));var db=require(_0x0a6b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0a6b('0x5'))(_0x0a6b('0x6'));var config=require(_0x0a6b('0x7'));var jayson=require(_0x0a6b('0x8'));var client=jayson[_0x0a6b('0x9')][_0x0a6b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b5fb5,_0xa908dd,_0x26f761){return new BPromise(function(_0x340a33,_0x8e89f){return client[_0x0a6b('0xb')](_0x1b5fb5,_0x26f761)['then'](function(_0x493948){logger[_0x0a6b('0xc')](_0x0a6b('0xd'),_0xa908dd,_0x0a6b('0xe'));logger[_0x0a6b('0xf')](_0x0a6b('0x10'),_0xa908dd,_0x0a6b('0xe'),JSON[_0x0a6b('0x11')](_0x493948));if(_0x493948[_0x0a6b('0x12')]){if(_0x493948[_0x0a6b('0x12')][_0x0a6b('0x13')]===0x1f4){logger[_0x0a6b('0x12')](_0x0a6b('0xd'),_0xa908dd,_0x493948[_0x0a6b('0x12')][_0x0a6b('0x14')]);return _0x8e89f(_0x493948['error']['message']);}logger[_0x0a6b('0x12')](_0x0a6b('0xd'),_0xa908dd,_0x493948[_0x0a6b('0x12')][_0x0a6b('0x14')]);return _0x340a33(_0x493948[_0x0a6b('0x12')][_0x0a6b('0x14')]);}else{logger[_0x0a6b('0xc')](_0x0a6b('0xd'),_0xa908dd,_0x0a6b('0xe'));_0x340a33(_0x493948[_0x0a6b('0x15')]['message']);}})[_0x0a6b('0x16')](function(_0x1538f4){logger['error'](_0x0a6b('0xd'),_0xa908dd,_0x1538f4);_0x8e89f(_0x1538f4);});});}exports['UpdateVoiceRecording']=function(_0xcb412){var _0x31f347=this;return new Promise(function(_0x2cb10b,_0x1ad45d){return db['VoiceRecording'][_0x0a6b('0x17')](_0xcb412[_0x0a6b('0x18')],{'raw':_0xcb412['options']?_0xcb412[_0x0a6b('0x19')][_0x0a6b('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xcb412[_0x0a6b('0x19')]?_0xcb412['options'][_0x0a6b('0x1b')]||null:null,'attributes':_0xcb412[_0x0a6b('0x19')]?_0xcb412[_0x0a6b('0x19')]['attributes']||null:null,'limit':_0xcb412[_0x0a6b('0x19')]?_0xcb412[_0x0a6b('0x19')][_0x0a6b('0x1c')]||null:null})[_0x0a6b('0x1d')](function(_0x122c19){logger['info'](_0x0a6b('0x1e'),_0xcb412);logger[_0x0a6b('0xf')](_0x0a6b('0x1e'),_0xcb412,JSON['stringify'](_0x122c19));_0x2cb10b(_0x122c19);})[_0x0a6b('0x16')](function(_0x2e58fd){logger[_0x0a6b('0x12')](_0x0a6b('0x1e'),_0x2e58fd[_0x0a6b('0x14')],_0xcb412);_0x1ad45d(_0x31f347['error'](0x1f4,_0x2e58fd[_0x0a6b('0x14')]));});});};exports[_0x0a6b('0x1f')]=function(_0x19a653){var _0x4ce9d4=this;return new Promise(function(_0x3a9092,_0x51e760){var _0xecbf0c=require(_0x0a6b('0x20'));var _0x45ae97;return db['Setting']['findOne']({'attributes':['id',_0x0a6b('0x21')],'where':{'id':0x1},'raw':!![]})[_0x0a6b('0x1d')](function(_0x1aecc7){_0x45ae97=_0x1aecc7;return db[_0x0a6b('0x22')][_0x0a6b('0x23')](_0x19a653[_0x0a6b('0x18')]);})['then'](function(_0xa7ab7c){if(_0x45ae97[_0x0a6b('0x21')]&&fs['existsSync'](_0xa7ab7c[_0x0a6b('0x24')])){var _0x554145=util['format'](_0x0a6b('0x25'),_0xa7ab7c[_0x0a6b('0x24')]);return _0xecbf0c[_0x0a6b('0x26')](_0xa7ab7c[_0x0a6b('0x24')],_0x554145,config[_0x0a6b('0x27')]['recording'])['then'](function(){fs[_0x0a6b('0x28')](_0xa7ab7c[_0x0a6b('0x24')]);logger[_0x0a6b('0xc')](_0x0a6b('0x29'));return _0xa7ab7c;});}return _0xa7ab7c;})['then'](function(_0xe2b82b){logger[_0x0a6b('0xc')]('CreateVoiceRecording',_0x19a653);logger['debug'](_0x0a6b('0x1f'),_0x19a653,JSON[_0x0a6b('0x11')](_0xe2b82b));_0x3a9092(_0xe2b82b);})['catch'](function(_0x3c3c23){logger[_0x0a6b('0x12')](_0x0a6b('0x1f'),_0x3c3c23[_0x0a6b('0x14')],_0x19a653);_0x51e760(_0x4ce9d4[_0x0a6b('0x12')](0x1f4,_0x3c3c23[_0x0a6b('0x14')]));});});}; \ No newline at end of file +var _0xadb5=['encryptFile','secrets','recording','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateVoiceRecording','update','options','raw','where','limit','debug','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','body','value','format','%s.cypher'];(function(_0xd6b926,_0x36d14b){var _0x31f34a=function(_0x3adff1){while(--_0x3adff1){_0xd6b926['push'](_0xd6b926['shift']());}};_0x31f34a(++_0x36d14b);}(_0xadb5,0xad));var _0x5adb=function(_0x31990e,_0x14e3b8){_0x31990e=_0x31990e-0x0;var _0x52500=_0xadb5[_0x31990e];return _0x52500;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('VoiceRecording,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}exports[_0x5adb('0x15')]=function(_0x529b65){var _0x3fff62=this;return new Promise(function(_0x5de028,_0x1d9e86){return db['VoiceRecording'][_0x5adb('0x16')](_0x529b65['body'],{'raw':_0x529b65['options']?_0x529b65[_0x5adb('0x17')][_0x5adb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x529b65[_0x5adb('0x17')]?_0x529b65[_0x5adb('0x17')][_0x5adb('0x19')]||null:null,'attributes':_0x529b65['options']?_0x529b65[_0x5adb('0x17')]['attributes']||null:null,'limit':_0x529b65['options']?_0x529b65[_0x5adb('0x17')][_0x5adb('0x1a')]||null:null})[_0x5adb('0xb')](function(_0x1a8014){logger[_0x5adb('0xc')](_0x5adb('0x15'),_0x529b65);logger[_0x5adb('0x1b')]('UpdateVoiceRecording',_0x529b65,JSON[_0x5adb('0xf')](_0x1a8014));_0x5de028(_0x1a8014);})[_0x5adb('0x14')](function(_0x3220cd){logger[_0x5adb('0x10')](_0x5adb('0x15'),_0x3220cd['message'],_0x529b65);_0x1d9e86(_0x3fff62[_0x5adb('0x10')](0x1f4,_0x3220cd[_0x5adb('0x12')]));});});};exports['CreateVoiceRecording']=function(_0x1feecf){var _0x1ded9f=this;return new Promise(function(_0x1a0acd,_0x55b40a){var _0x13ad1d=require(_0x5adb('0x1c'));var _0x3a4fca;return db[_0x5adb('0x1d')][_0x5adb('0x1e')]({'attributes':['id',_0x5adb('0x1f')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x49992e){_0x3a4fca=_0x49992e;return db['VoiceRecording'][_0x5adb('0x20')](_0x1feecf[_0x5adb('0x21')]);})[_0x5adb('0xb')](function(_0x512bab){if(_0x3a4fca[_0x5adb('0x1f')]&&fs['existsSync'](_0x512bab[_0x5adb('0x22')])){var _0x34b793=util[_0x5adb('0x23')](_0x5adb('0x24'),_0x512bab[_0x5adb('0x22')]);return _0x13ad1d[_0x5adb('0x25')](_0x512bab[_0x5adb('0x22')],_0x34b793,config[_0x5adb('0x26')][_0x5adb('0x27')])[_0x5adb('0xb')](function(){fs['unlink'](_0x512bab[_0x5adb('0x22')]);logger['info'](_0x5adb('0x28'));return _0x512bab;});}return _0x512bab;})[_0x5adb('0xb')](function(_0x5d1441){logger[_0x5adb('0xc')](_0x5adb('0x29'),_0x1feecf);logger[_0x5adb('0x1b')]('CreateVoiceRecording',_0x1feecf,JSON[_0x5adb('0xf')](_0x5d1441));_0x1a0acd(_0x5d1441);})[_0x5adb('0x14')](function(_0x4b5887){logger['error'](_0x5adb('0x29'),_0x4b5887['message'],_0x1feecf);_0x55b40a(_0x1ded9f[_0x5adb('0x10')](0x1f4,_0x4b5887[_0x5adb('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index a57041f..16601e5 100644 --- a/server/api/voiceTransferReport/index.js +++ b/server/api/voiceTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x102b=['/describe','/:id','show','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index'];(function(_0x54b719,_0x39ade5){var _0x31edd9=function(_0x3f2514){while(--_0x3f2514){_0x54b719['push'](_0x54b719['shift']());}};_0x31edd9(++_0x39ade5);}(_0x102b,0xa0));var _0xb102=function(_0x2828cd,_0xa8ee53){_0x2828cd=_0x2828cd-0x0;var _0x332d95=_0x102b[_0x2828cd];return _0x332d95;};'use strict';var multer=require(_0xb102('0x0'));var util=require(_0xb102('0x1'));var path=require(_0xb102('0x2'));var timeout=require(_0xb102('0x3'));var express=require(_0xb102('0x4'));var router=express[_0xb102('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb102('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb102('0x7'));var controller=require('./voiceTransferReport.controller');router[_0xb102('0x8')]('/',auth[_0xb102('0x9')](),controller[_0xb102('0xa')]);router[_0xb102('0x8')](_0xb102('0xb'),auth[_0xb102('0x9')](),controller['describe']);router[_0xb102('0x8')](_0xb102('0xc'),auth[_0xb102('0x9')](),controller[_0xb102('0xd')]);router[_0xb102('0xe')]('/',auth[_0xb102('0x9')](),controller['create']);router[_0xb102('0xf')](_0xb102('0xc'),auth['isAuthenticated'](),controller[_0xb102('0x10')]);router['delete'](_0xb102('0xc'),auth[_0xb102('0x9')](),controller[_0xb102('0x11')]);module[_0xb102('0x12')]=router; \ No newline at end of file +var _0x6e35=['Router','fs-extra','../../components/auth/service','./voiceTransferReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','path','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6e35,0xe0));var _0x56e3=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x6e35[_0x4d613c];return _0x301fe3;};'use strict';var multer=require(_0x56e3('0x0'));var util=require(_0x56e3('0x1'));var path=require(_0x56e3('0x2'));var timeout=require('connect-timeout');var express=require(_0x56e3('0x3'));var router=express[_0x56e3('0x4')]();var fs_extra=require(_0x56e3('0x5'));var auth=require(_0x56e3('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x56e3('0x7'));router[_0x56e3('0x8')]('/',auth[_0x56e3('0x9')](),controller[_0x56e3('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x56e3('0x8')](_0x56e3('0xb'),auth[_0x56e3('0x9')](),controller[_0x56e3('0xc')]);router[_0x56e3('0xd')]('/',auth['isAuthenticated'](),controller[_0x56e3('0xe')]);router[_0x56e3('0xf')](_0x56e3('0xb'),auth[_0x56e3('0x9')](),controller[_0x56e3('0x10')]);router[_0x56e3('0x11')](_0x56e3('0xb'),auth[_0x56e3('0x9')](),controller['destroy']);module[_0x56e3('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index e40a96d..beab4b4 100644 --- a/server/api/voiceTransferReport/voiceTransferReport.attributes.js +++ b/server/api/voiceTransferReport/voiceTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x83a6=['ENUM','blind','STRING','Yes','sequelize','moment','exports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x83a6,0xe4));var _0x683a=function(_0xacc4f2,_0x3de620){_0xacc4f2=_0xacc4f2-0x0;var _0x359ffe=_0x83a6[_0xacc4f2];return _0x359ffe;};'use strict';var Sequelize=require(_0x683a('0x0'));var moment=require(_0x683a('0x1'));module[_0x683a('0x2')]={'type':{'type':Sequelize[_0x683a('0x3')](_0x683a('0x4'),'attended')},'result':{'type':Sequelize[_0x683a('0x5')]},'transfererchannel':{'type':Sequelize[_0x683a('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x683a('0x5')]},'transferercalleridname':{'type':Sequelize[_0x683a('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x683a('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0x683a('0x5')]},'transfereraccountcode':{'type':Sequelize[_0x683a('0x5')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x683a('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x683a('0x5')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0x683a('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x683a('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0x683a('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x683a('0x5')]},'transfereecontext':{'type':Sequelize[_0x683a('0x5')]},'transfereeexten':{'type':Sequelize[_0x683a('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x683a('0x5')]},'isexternal':{'type':Sequelize[_0x683a('0x3')](_0x683a('0x6'),'No')},'context':{'type':Sequelize[_0x683a('0x5')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x21fc=['moment','ENUM','blind','attended','STRING','sequelize'];(function(_0x50ba90,_0x4811c1){var _0x11dafe=function(_0x441355){while(--_0x441355){_0x50ba90['push'](_0x50ba90['shift']());}};_0x11dafe(++_0x4811c1);}(_0x21fc,0x9b));var _0xc21f=function(_0x2a453b,_0x479c50){_0x2a453b=_0x2a453b-0x0;var _0x132f79=_0x21fc[_0x2a453b];return _0x132f79;};'use strict';var Sequelize=require(_0xc21f('0x0'));var moment=require(_0xc21f('0x1'));module['exports']={'type':{'type':Sequelize[_0xc21f('0x2')](_0xc21f('0x3'),_0xc21f('0x4'))},'result':{'type':Sequelize[_0xc21f('0x5')]},'transfererchannel':{'type':Sequelize[_0xc21f('0x5')]},'transferercalleridnum':{'type':Sequelize[_0xc21f('0x5')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0xc21f('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0xc21f('0x5')]},'transfereraccountcode':{'type':Sequelize[_0xc21f('0x5')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0xc21f('0x5')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0xc21f('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0xc21f('0x5')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0xc21f('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0xc21f('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0xc21f('0x5')]},'transfereecontext':{'type':Sequelize[_0xc21f('0x5')]},'transfereeexten':{'type':Sequelize[_0xc21f('0x5')]},'transfereelinkedid':{'type':Sequelize[_0xc21f('0x5')]},'isexternal':{'type':Sequelize['ENUM']('Yes','No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 91ad080..ca8da79 100644 --- a/server/api/voiceTransferReport/voiceTransferReport.controller.js +++ b/server/api/voiceTransferReport/voiceTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5838=['../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','status','set','Content-Range','apply','reject','then','stack','name','send','index','VoiceTransferReport','rawAttributes','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','findAll','rows','show','params','keys','filters','include','find','catch','create','body','destroy','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5838,0x115));var _0x8583=function(_0x2b84a2,_0x5beede){_0x2b84a2=_0x2b84a2-0x0;var _0x35da14=_0x5838[_0x2b84a2];return _0x35da14;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8583('0x0'));var zipdir=require(_0x8583('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8583('0x2'));var moment=require(_0x8583('0x3'));var BPromise=require(_0x8583('0x4'));var Mustache=require(_0x8583('0x5'));var util=require(_0x8583('0x6'));var path=require(_0x8583('0x7'));var sox=require(_0x8583('0x8'));var csv=require(_0x8583('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8583('0xa'));var _=require(_0x8583('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8583('0xc'));var toCsv=require(_0x8583('0x9'));var querystring=require(_0x8583('0xd'));var Papa=require(_0x8583('0xe'));var Redis=require('ioredis');var authService=require(_0x8583('0xf'));var qs=require(_0x8583('0x10'));var as=require(_0x8583('0x11'));var hardwareService=require(_0x8583('0x12'));var logger=require(_0x8583('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x8583('0x14'));var licenseUtil=require(_0x8583('0x15'));var db=require(_0x8583('0x16'))['db'];function respondWithStatusCode(_0x3a7629,_0x28d270){_0x28d270=_0x28d270||0xcc;return function(_0x5c41c7){if(_0x5c41c7){return _0x3a7629[_0x8583('0x17')](_0x28d270);}return _0x3a7629['status'](_0x28d270)[_0x8583('0x18')]();};}function respondWithResult(_0xcbd4ae,_0x489f4e){_0x489f4e=_0x489f4e||0xc8;return function(_0x3b4a3e){if(_0x3b4a3e){return _0xcbd4ae['status'](_0x489f4e)[_0x8583('0x19')](_0x3b4a3e);}};}function respondWithFilteredResult(_0x57510d,_0x2d9e50){return function(_0x5aedf8){if(_0x5aedf8){var _0xe4b3b9=typeof _0x2d9e50[_0x8583('0x1a')]===_0x8583('0x1b')&&typeof _0x2d9e50['limit']==='undefined';var _0x1c523c=_0x5aedf8[_0x8583('0x1c')];var _0x527c62=_0xe4b3b9?0x0:_0x2d9e50['offset'];var _0x2608e1=_0xe4b3b9?_0x5aedf8['count']:_0x2d9e50['offset']+_0x2d9e50['limit'];var _0x2b1e5e;if(_0x2608e1>=_0x1c523c){_0x2608e1=_0x1c523c;_0x2b1e5e=0xc8;}else{_0x2b1e5e=0xce;}_0x57510d[_0x8583('0x1d')](_0x2b1e5e);return _0x57510d[_0x8583('0x1e')](_0x8583('0x1f'),_0x527c62+'-'+_0x2608e1+'/'+_0x1c523c)['json'](_0x5aedf8);}return null;};}function patchUpdates(_0x4dffc8){return function(_0x104e9a){try{jsonpatch[_0x8583('0x20')](_0x104e9a,_0x4dffc8,!![]);}catch(_0x2ed2ae){return BPromise[_0x8583('0x21')](_0x2ed2ae);}return _0x104e9a['save']();};}function saveUpdates(_0x5a181f,_0x154f0e){return function(_0x13c086){if(_0x13c086){return _0x13c086['update'](_0x5a181f)[_0x8583('0x22')](function(_0xfffde4){return _0xfffde4;});}return null;};}function removeEntity(_0x31c227,_0x387ca4){return function(_0x587cda){if(_0x587cda){return _0x587cda['destroy']()[_0x8583('0x22')](function(){_0x31c227[_0x8583('0x1d')](0xcc)[_0x8583('0x18')]();});}};}function handleEntityNotFound(_0x90ff6,_0x35103a){return function(_0x4227d5){if(!_0x4227d5){_0x90ff6['sendStatus'](0x194);}return _0x4227d5;};}function handleError(_0x37e43f,_0x572269){_0x572269=_0x572269||0x1f4;return function(_0x2bf5f2){logger['error'](_0x2bf5f2[_0x8583('0x23')]);if(_0x2bf5f2[_0x8583('0x24')]){delete _0x2bf5f2[_0x8583('0x24')];}_0x37e43f['status'](_0x572269)[_0x8583('0x25')](_0x2bf5f2);};}exports[_0x8583('0x26')]=function(_0x2583b9,_0x132774){var _0x31f0f9={},_0x55cd69={},_0x4de8bb={'count':0x0,'rows':[]};var _0x1512e0=_['map'](db[_0x8583('0x27')][_0x8583('0x28')],function(_0x360f9a){return{'name':_0x360f9a['fieldName'],'type':_0x360f9a[_0x8583('0x29')][_0x8583('0x2a')]};});_0x55cd69[_0x8583('0x2b')]=_[_0x8583('0x2c')](_0x1512e0,_0x8583('0x24'));_0x55cd69[_0x8583('0x2d')]=_['keys'](_0x2583b9[_0x8583('0x2d')]);_0x55cd69['filters']=_[_0x8583('0x2e')](_0x55cd69[_0x8583('0x2b')],_0x55cd69[_0x8583('0x2d')]);_0x31f0f9[_0x8583('0x2f')]=_[_0x8583('0x2e')](_0x55cd69[_0x8583('0x2b')],qs[_0x8583('0x30')](_0x2583b9[_0x8583('0x2d')][_0x8583('0x30')]));_0x31f0f9['attributes']=_0x31f0f9[_0x8583('0x2f')][_0x8583('0x31')]?_0x31f0f9[_0x8583('0x2f')]:_0x55cd69['model'];if(!_0x2583b9[_0x8583('0x2d')][_0x8583('0x32')](_0x8583('0x33'))){_0x31f0f9[_0x8583('0x34')]=qs['limit'](_0x2583b9[_0x8583('0x2d')][_0x8583('0x34')]);_0x31f0f9['offset']=qs[_0x8583('0x1a')](_0x2583b9['query'][_0x8583('0x1a')]);}_0x31f0f9[_0x8583('0x35')]=qs[_0x8583('0x36')](_0x2583b9['query'][_0x8583('0x36')]);_0x31f0f9['where']=qs['filters'](_[_0x8583('0x37')](_0x2583b9[_0x8583('0x2d')],_0x55cd69['filters']),_0x1512e0);if(_0x2583b9[_0x8583('0x2d')][_0x8583('0x38')]){_0x31f0f9[_0x8583('0x39')]=_[_0x8583('0x3a')](_0x31f0f9[_0x8583('0x39')],{'$or':_['map'](_0x1512e0,function(_0x217d81){if(_0x217d81[_0x8583('0x29')]!==_0x8583('0x3b')){var _0xead6b9={};_0xead6b9[_0x217d81['name']]={'$like':'%'+_0x2583b9[_0x8583('0x2d')]['filter']+'%'};return _0xead6b9;}})});}_0x31f0f9=_[_0x8583('0x3a')]({},_0x31f0f9,_0x2583b9[_0x8583('0x3c')]);var _0x59407c={'where':_0x31f0f9['where']};return db[_0x8583('0x27')][_0x8583('0x1c')](_0x59407c)['then'](function(_0x3d309c){_0x4de8bb[_0x8583('0x1c')]=_0x3d309c;if(_0x2583b9[_0x8583('0x2d')]['includeAll']){_0x31f0f9['include']=[{'all':!![]}];}return db[_0x8583('0x27')][_0x8583('0x3d')](_0x31f0f9);})[_0x8583('0x22')](function(_0x2390ca){_0x4de8bb[_0x8583('0x3e')]=_0x2390ca;return _0x4de8bb;})[_0x8583('0x22')](respondWithFilteredResult(_0x132774,_0x31f0f9))['catch'](handleError(_0x132774,null));};exports[_0x8583('0x3f')]=function(_0x5c3ae1,_0x10b5a6){var _0x398890={'raw':!![],'where':{'id':_0x5c3ae1[_0x8583('0x40')]['id']}},_0x50f601={};_0x50f601[_0x8583('0x2b')]=_[_0x8583('0x41')](db['VoiceTransferReport'][_0x8583('0x28')]);_0x50f601[_0x8583('0x2d')]=_['keys'](_0x5c3ae1['query']);_0x50f601[_0x8583('0x42')]=_['intersection'](_0x50f601[_0x8583('0x2b')],_0x50f601['query']);_0x398890['attributes']=_[_0x8583('0x2e')](_0x50f601[_0x8583('0x2b')],qs[_0x8583('0x30')](_0x5c3ae1['query'][_0x8583('0x30')]));_0x398890[_0x8583('0x2f')]=_0x398890[_0x8583('0x2f')][_0x8583('0x31')]?_0x398890[_0x8583('0x2f')]:_0x50f601['model'];if(_0x5c3ae1[_0x8583('0x2d')]['includeAll']){_0x398890[_0x8583('0x43')]=[{'all':!![]}];}_0x398890=_[_0x8583('0x3a')]({},_0x398890,_0x5c3ae1[_0x8583('0x3c')]);return db['VoiceTransferReport'][_0x8583('0x44')](_0x398890)[_0x8583('0x22')](handleEntityNotFound(_0x10b5a6,null))[_0x8583('0x22')](respondWithResult(_0x10b5a6,null))[_0x8583('0x45')](handleError(_0x10b5a6,null));};exports[_0x8583('0x46')]=function(_0x5c00a5,_0x5c7ac8){return db[_0x8583('0x27')][_0x8583('0x46')](_0x5c00a5[_0x8583('0x47')],{})[_0x8583('0x22')](respondWithResult(_0x5c7ac8,0xc9))[_0x8583('0x45')](handleError(_0x5c7ac8,null));};exports['update']=function(_0x2d6ef2,_0x47ae2a){if(_0x2d6ef2[_0x8583('0x47')]['id']){delete _0x2d6ef2['body']['id'];}return db[_0x8583('0x27')][_0x8583('0x44')]({'where':{'id':_0x2d6ef2[_0x8583('0x40')]['id']}})['then'](handleEntityNotFound(_0x47ae2a,null))[_0x8583('0x22')](saveUpdates(_0x2d6ef2[_0x8583('0x47')],null))[_0x8583('0x22')](respondWithResult(_0x47ae2a,null))[_0x8583('0x45')](handleError(_0x47ae2a,null));};exports[_0x8583('0x48')]=function(_0x53e3b8,_0x5a4c61){return db['VoiceTransferReport'][_0x8583('0x44')]({'where':{'id':_0x53e3b8[_0x8583('0x40')]['id']}})[_0x8583('0x22')](handleEntityNotFound(_0x5a4c61,null))['then'](removeEntity(_0x5a4c61,null))['catch'](handleError(_0x5a4c61,null));};exports[_0x8583('0x49')]=function(_0x181278,_0x72c783){return db[_0x8583('0x27')]['describe']()[_0x8583('0x22')](respondWithResult(_0x72c783,null))[_0x8583('0x45')](handleError(_0x72c783,null));}; \ No newline at end of file +var _0xf373=['include','findAll','catch','show','params','rawAttributes','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','VoiceTransferReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','includeAll'];(function(_0x29c3f6,_0xa10355){var _0x2d47d0=function(_0x204862){while(--_0x204862){_0x29c3f6['push'](_0x29c3f6['shift']());}};_0x2d47d0(++_0xa10355);}(_0xf373,0x1c0));var _0x3f37=function(_0xd1cdea,_0x384d95){_0xd1cdea=_0xd1cdea-0x0;var _0x4d36d1=_0xf373[_0xd1cdea];return _0x4d36d1;};'use strict';var emlformat=require(_0x3f37('0x0'));var rimraf=require(_0x3f37('0x1'));var zipdir=require(_0x3f37('0x2'));var jsonpatch=require(_0x3f37('0x3'));var rp=require(_0x3f37('0x4'));var moment=require('moment');var BPromise=require(_0x3f37('0x5'));var Mustache=require('mustache');var util=require(_0x3f37('0x6'));var path=require(_0x3f37('0x7'));var sox=require(_0x3f37('0x8'));var csv=require(_0x3f37('0x9'));var ejs=require(_0x3f37('0xa'));var fs=require('fs');var fs_extra=require(_0x3f37('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3f37('0xc'));var deskjs=require(_0x3f37('0xd'));var toCsv=require(_0x3f37('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3f37('0xe'));var qs=require(_0x3f37('0xf'));var as=require(_0x3f37('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3f37('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3f37('0x12'));var db=require(_0x3f37('0x13'))['db'];function respondWithStatusCode(_0x26d785,_0xb1eed9){_0xb1eed9=_0xb1eed9||0xcc;return function(_0x1382b6){if(_0x1382b6){return _0x26d785[_0x3f37('0x14')](_0xb1eed9);}return _0x26d785['status'](_0xb1eed9)[_0x3f37('0x15')]();};}function respondWithResult(_0x513647,_0x5227ee){_0x5227ee=_0x5227ee||0xc8;return function(_0x45e78f){if(_0x45e78f){return _0x513647['status'](_0x5227ee)[_0x3f37('0x16')](_0x45e78f);}};}function respondWithFilteredResult(_0x2efbff,_0x4fce0c){return function(_0x1fe712){if(_0x1fe712){var _0x46aaf5=typeof _0x4fce0c[_0x3f37('0x17')]===_0x3f37('0x18')&&typeof _0x4fce0c['limit']===_0x3f37('0x18');var _0x687c9d=_0x1fe712[_0x3f37('0x19')];var _0x4f7d87=_0x46aaf5?0x0:_0x4fce0c[_0x3f37('0x17')];var _0x11c19e=_0x46aaf5?_0x1fe712[_0x3f37('0x19')]:_0x4fce0c[_0x3f37('0x17')]+_0x4fce0c[_0x3f37('0x1a')];var _0x32981e;if(_0x11c19e>=_0x687c9d){_0x11c19e=_0x687c9d;_0x32981e=0xc8;}else{_0x32981e=0xce;}_0x2efbff[_0x3f37('0x1b')](_0x32981e);return _0x2efbff[_0x3f37('0x1c')](_0x3f37('0x1d'),_0x4f7d87+'-'+_0x11c19e+'/'+_0x687c9d)[_0x3f37('0x16')](_0x1fe712);}return null;};}function patchUpdates(_0x3ea60c){return function(_0x5e52ed){try{jsonpatch[_0x3f37('0x1e')](_0x5e52ed,_0x3ea60c,!![]);}catch(_0xcb8bd5){return BPromise[_0x3f37('0x1f')](_0xcb8bd5);}return _0x5e52ed[_0x3f37('0x20')]();};}function saveUpdates(_0x1e7740,_0x238ac1){return function(_0x41d083){if(_0x41d083){return _0x41d083[_0x3f37('0x21')](_0x1e7740)[_0x3f37('0x22')](function(_0x2a971d){return _0x2a971d;});}return null;};}function removeEntity(_0x41d3d2,_0x11fde8){return function(_0x3afdf2){if(_0x3afdf2){return _0x3afdf2[_0x3f37('0x23')]()['then'](function(){_0x41d3d2[_0x3f37('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2657df,_0x1a5869){return function(_0x22b734){if(!_0x22b734){_0x2657df[_0x3f37('0x14')](0x194);}return _0x22b734;};}function handleError(_0x5c1405,_0x2be5c2){_0x2be5c2=_0x2be5c2||0x1f4;return function(_0x32b104){logger[_0x3f37('0x24')](_0x32b104[_0x3f37('0x25')]);if(_0x32b104[_0x3f37('0x26')]){delete _0x32b104[_0x3f37('0x26')];}_0x5c1405['status'](_0x2be5c2)['send'](_0x32b104);};}exports[_0x3f37('0x27')]=function(_0x2cd0c8,_0x280a28){var _0x18b4d5={},_0x3c839e={},_0x1f57ef={'count':0x0,'rows':[]};var _0x15cc3e=_[_0x3f37('0x28')](db[_0x3f37('0x29')]['rawAttributes'],function(_0x43a0f0){return{'name':_0x43a0f0[_0x3f37('0x2a')],'type':_0x43a0f0[_0x3f37('0x2b')][_0x3f37('0x2c')]};});_0x3c839e[_0x3f37('0x2d')]=_['map'](_0x15cc3e,_0x3f37('0x26'));_0x3c839e[_0x3f37('0x2e')]=_[_0x3f37('0x2f')](_0x2cd0c8['query']);_0x3c839e['filters']=_[_0x3f37('0x30')](_0x3c839e[_0x3f37('0x2d')],_0x3c839e[_0x3f37('0x2e')]);_0x18b4d5[_0x3f37('0x31')]=_[_0x3f37('0x30')](_0x3c839e[_0x3f37('0x2d')],qs[_0x3f37('0x32')](_0x2cd0c8['query'][_0x3f37('0x32')]));_0x18b4d5[_0x3f37('0x31')]=_0x18b4d5[_0x3f37('0x31')][_0x3f37('0x33')]?_0x18b4d5[_0x3f37('0x31')]:_0x3c839e[_0x3f37('0x2d')];if(!_0x2cd0c8[_0x3f37('0x2e')][_0x3f37('0x34')](_0x3f37('0x35'))){_0x18b4d5[_0x3f37('0x1a')]=qs[_0x3f37('0x1a')](_0x2cd0c8[_0x3f37('0x2e')][_0x3f37('0x1a')]);_0x18b4d5[_0x3f37('0x17')]=qs[_0x3f37('0x17')](_0x2cd0c8[_0x3f37('0x2e')][_0x3f37('0x17')]);}_0x18b4d5[_0x3f37('0x36')]=qs[_0x3f37('0x37')](_0x2cd0c8['query']['sort']);_0x18b4d5[_0x3f37('0x38')]=qs[_0x3f37('0x39')](_[_0x3f37('0x3a')](_0x2cd0c8[_0x3f37('0x2e')],_0x3c839e['filters']),_0x15cc3e);if(_0x2cd0c8[_0x3f37('0x2e')]['filter']){_0x18b4d5[_0x3f37('0x38')]=_['merge'](_0x18b4d5[_0x3f37('0x38')],{'$or':_['map'](_0x15cc3e,function(_0x35a987){if(_0x35a987[_0x3f37('0x2b')]!==_0x3f37('0x3b')){var _0x179429={};_0x179429[_0x35a987[_0x3f37('0x26')]]={'$like':'%'+_0x2cd0c8[_0x3f37('0x2e')][_0x3f37('0x3c')]+'%'};return _0x179429;}})});}_0x18b4d5=_[_0x3f37('0x3d')]({},_0x18b4d5,_0x2cd0c8['options']);var _0x5064fa={'where':_0x18b4d5['where']};return db['VoiceTransferReport']['count'](_0x5064fa)[_0x3f37('0x22')](function(_0x1df27f){_0x1f57ef[_0x3f37('0x19')]=_0x1df27f;if(_0x2cd0c8[_0x3f37('0x2e')][_0x3f37('0x3e')]){_0x18b4d5[_0x3f37('0x3f')]=[{'all':!![]}];}return db[_0x3f37('0x29')][_0x3f37('0x40')](_0x18b4d5);})[_0x3f37('0x22')](function(_0xd7f303){_0x1f57ef['rows']=_0xd7f303;return _0x1f57ef;})[_0x3f37('0x22')](respondWithFilteredResult(_0x280a28,_0x18b4d5))[_0x3f37('0x41')](handleError(_0x280a28,null));};exports[_0x3f37('0x42')]=function(_0x4a4eab,_0x3d7df1){var _0x5d2095={'raw':!![],'where':{'id':_0x4a4eab[_0x3f37('0x43')]['id']}},_0x183b6e={};_0x183b6e[_0x3f37('0x2d')]=_[_0x3f37('0x2f')](db['VoiceTransferReport'][_0x3f37('0x44')]);_0x183b6e['query']=_['keys'](_0x4a4eab[_0x3f37('0x2e')]);_0x183b6e[_0x3f37('0x39')]=_[_0x3f37('0x30')](_0x183b6e[_0x3f37('0x2d')],_0x183b6e[_0x3f37('0x2e')]);_0x5d2095[_0x3f37('0x31')]=_[_0x3f37('0x30')](_0x183b6e['model'],qs['fields'](_0x4a4eab['query'][_0x3f37('0x32')]));_0x5d2095['attributes']=_0x5d2095[_0x3f37('0x31')]['length']?_0x5d2095[_0x3f37('0x31')]:_0x183b6e['model'];if(_0x4a4eab[_0x3f37('0x2e')][_0x3f37('0x3e')]){_0x5d2095[_0x3f37('0x3f')]=[{'all':!![]}];}_0x5d2095=_[_0x3f37('0x3d')]({},_0x5d2095,_0x4a4eab[_0x3f37('0x45')]);return db['VoiceTransferReport'][_0x3f37('0x46')](_0x5d2095)[_0x3f37('0x22')](handleEntityNotFound(_0x3d7df1,null))[_0x3f37('0x22')](respondWithResult(_0x3d7df1,null))[_0x3f37('0x41')](handleError(_0x3d7df1,null));};exports[_0x3f37('0x47')]=function(_0x338a00,_0x1ccc0d){return db['VoiceTransferReport'][_0x3f37('0x47')](_0x338a00['body'],{})[_0x3f37('0x22')](respondWithResult(_0x1ccc0d,0xc9))[_0x3f37('0x41')](handleError(_0x1ccc0d,null));};exports[_0x3f37('0x21')]=function(_0x1482a3,_0x4d86fb){if(_0x1482a3[_0x3f37('0x48')]['id']){delete _0x1482a3['body']['id'];}return db['VoiceTransferReport'][_0x3f37('0x46')]({'where':{'id':_0x1482a3[_0x3f37('0x43')]['id']}})[_0x3f37('0x22')](handleEntityNotFound(_0x4d86fb,null))[_0x3f37('0x22')](saveUpdates(_0x1482a3[_0x3f37('0x48')],null))[_0x3f37('0x22')](respondWithResult(_0x4d86fb,null))[_0x3f37('0x41')](handleError(_0x4d86fb,null));};exports[_0x3f37('0x23')]=function(_0x218c2a,_0x22b874){return db[_0x3f37('0x29')][_0x3f37('0x46')]({'where':{'id':_0x218c2a['params']['id']}})[_0x3f37('0x22')](handleEntityNotFound(_0x22b874,null))[_0x3f37('0x22')](removeEntity(_0x22b874,null))['catch'](handleError(_0x22b874,null));};exports['describe']=function(_0x2aa47b,_0x401e24){return db[_0x3f37('0x29')]['describe']()['then'](respondWithResult(_0x401e24,null))['catch'](handleError(_0x401e24,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 151040a..6cf66ac 100644 --- a/server/api/voiceTransferReport/voiceTransferReport.model.js +++ b/server/api/voiceTransferReport/voiceTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xce0b=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','define','VoiceTransferReport','util'];(function(_0x5693af,_0xa1e06){var _0x21f29f=function(_0x34327f){while(--_0x34327f){_0x5693af['push'](_0x5693af['shift']());}};_0x21f29f(++_0xa1e06);}(_0xce0b,0xe0));var _0xbce0=function(_0x14f2cf,_0x2d3713){_0x14f2cf=_0x14f2cf-0x0;var _0x4dd78f=_0xce0b[_0x14f2cf];return _0x4dd78f;};'use strict';var _=require('lodash');var util=require(_0xbce0('0x0'));var logger=require(_0xbce0('0x1'))(_0xbce0('0x2'));var moment=require('moment');var BPromise=require(_0xbce0('0x3'));var rp=require(_0xbce0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbce0('0x5'));var config=require(_0xbce0('0x6'));var attributes=require('./voiceTransferReport.attributes');module['exports']=function(_0x31d56b,_0x19ddb8){return _0x31d56b[_0xbce0('0x7')](_0xbce0('0x8'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x986f=['lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x986f,0x1ea));var _0xf986=function(_0x24cf1d,_0xe407fe){_0x24cf1d=_0x24cf1d-0x0;var _0x5dbed1=_0x986f[_0x24cf1d];return _0x5dbed1;};'use strict';var _=require(_0xf986('0x0'));var util=require(_0xf986('0x1'));var logger=require(_0xf986('0x2'))('api');var moment=require(_0xf986('0x3'));var BPromise=require('bluebird');var rp=require(_0xf986('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf986('0x5'));var config=require(_0xf986('0x6'));var attributes=require(_0xf986('0x7'));module[_0xf986('0x8')]=function(_0xb8aeca,_0x101c13){return _0xb8aeca[_0xf986('0x9')]('VoiceTransferReport',attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 2171cf6..3d35f89 100644 --- a/server/api/voiceTransferReport/voiceTransferReport.rpc.js +++ b/server/api/voiceTransferReport/voiceTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x989b=['stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','VoiceTransferReport','create','raw','CreateVoiceTransferReport'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x989b,0xeb));var _0xb989=function(_0x4f680d,_0x28fb35){_0x4f680d=_0x4f680d-0x0;var _0x43850d=_0x989b[_0x4f680d];return _0x43850d;};'use strict';var _=require(_0xb989('0x0'));var util=require(_0xb989('0x1'));var moment=require(_0xb989('0x2'));var BPromise=require(_0xb989('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb989('0x4'));var db=require(_0xb989('0x5'))['db'];var utils=require(_0xb989('0x6'));var logger=require('../../config/logger')(_0xb989('0x7'));var config=require(_0xb989('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb989('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x347f60,_0x139c25,_0x76acb1){return new BPromise(function(_0x1f6f17,_0x41f634){return client[_0xb989('0xa')](_0x347f60,_0x76acb1)[_0xb989('0xb')](function(_0x5df050){logger['info'](_0xb989('0xc'),_0x139c25,_0xb989('0xd'));logger[_0xb989('0xe')](_0xb989('0xf'),_0x139c25,_0xb989('0xd'),JSON['stringify'](_0x5df050));if(_0x5df050[_0xb989('0x10')]){if(_0x5df050['error'][_0xb989('0x11')]===0x1f4){logger[_0xb989('0x10')](_0xb989('0xc'),_0x139c25,_0x5df050['error'][_0xb989('0x12')]);return _0x41f634(_0x5df050[_0xb989('0x10')][_0xb989('0x12')]);}logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x139c25,_0x5df050[_0xb989('0x10')][_0xb989('0x12')]);return _0x1f6f17(_0x5df050['error'][_0xb989('0x12')]);}else{logger[_0xb989('0x13')](_0xb989('0xc'),_0x139c25,_0xb989('0xd'));_0x1f6f17(_0x5df050['result']['message']);}})[_0xb989('0x14')](function(_0x392257){logger[_0xb989('0x10')](_0xb989('0xc'),_0x139c25,_0x392257);_0x41f634(_0x392257);});});}exports['CreateVoiceTransferReport']=function(_0x3d3861){var _0x551ff3=this;return new Promise(function(_0x271f31,_0x1f3819){return db[_0xb989('0x15')][_0xb989('0x16')](_0x3d3861['body'],{'raw':_0x3d3861['options']?_0x3d3861['options'][_0xb989('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x2e5528){logger[_0xb989('0x13')](_0xb989('0x18'),_0x3d3861);logger[_0xb989('0xe')](_0xb989('0x18'),_0x3d3861,JSON[_0xb989('0x19')](_0x2e5528));_0x271f31(_0x2e5528);})['catch'](function(_0x16d8cb){logger['error'](_0xb989('0x18'),_0x16d8cb[_0xb989('0x12')],_0x3d3861);_0x1f3819(_0x551ff3[_0xb989('0x10')](0x1f4,_0x16d8cb[_0xb989('0x12')]));});});}; \ No newline at end of file +var _0x2e1d=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','VoiceTransferReport','create','body','options','CreateVoiceTransferReport','lodash','util'];(function(_0x2848bc,_0x22259e){var _0x4b289c=function(_0x1d45b1){while(--_0x1d45b1){_0x2848bc['push'](_0x2848bc['shift']());}};_0x4b289c(++_0x22259e);}(_0x2e1d,0x1da));var _0xd2e1=function(_0x2605dc,_0x50cf7e){_0x2605dc=_0x2605dc-0x0;var _0x4568c9=_0x2e1d[_0x2605dc];return _0x4568c9;};'use strict';var _=require(_0xd2e1('0x0'));var util=require(_0xd2e1('0x1'));var moment=require(_0xd2e1('0x2'));var BPromise=require(_0xd2e1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd2e1('0x4'))['db'];var utils=require(_0xd2e1('0x5'));var logger=require(_0xd2e1('0x6'))(_0xd2e1('0x7'));var config=require(_0xd2e1('0x8'));var jayson=require(_0xd2e1('0x9'));var client=jayson['client'][_0xd2e1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x239a1f,_0x55b259,_0x905913){return new BPromise(function(_0x3bba66,_0x55af46){return client['request'](_0x239a1f,_0x905913)[_0xd2e1('0xb')](function(_0x732796){logger['info'](_0xd2e1('0xc'),_0x55b259,_0xd2e1('0xd'));logger[_0xd2e1('0xe')](_0xd2e1('0xf'),_0x55b259,_0xd2e1('0xd'),JSON[_0xd2e1('0x10')](_0x732796));if(_0x732796[_0xd2e1('0x11')]){if(_0x732796[_0xd2e1('0x11')][_0xd2e1('0x12')]===0x1f4){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x55b259,_0x732796[_0xd2e1('0x11')][_0xd2e1('0x13')]);return _0x55af46(_0x732796[_0xd2e1('0x11')][_0xd2e1('0x13')]);}logger[_0xd2e1('0x11')](_0xd2e1('0xc'),_0x55b259,_0x732796[_0xd2e1('0x11')][_0xd2e1('0x13')]);return _0x3bba66(_0x732796[_0xd2e1('0x11')]['message']);}else{logger[_0xd2e1('0x14')](_0xd2e1('0xc'),_0x55b259,_0xd2e1('0xd'));_0x3bba66(_0x732796[_0xd2e1('0x15')][_0xd2e1('0x13')]);}})[_0xd2e1('0x16')](function(_0x143935){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x55b259,_0x143935);_0x55af46(_0x143935);});});}exports['CreateVoiceTransferReport']=function(_0x4f6baa){var _0x63c64c=this;return new Promise(function(_0xfcc6,_0x56f960){return db[_0xd2e1('0x17')][_0xd2e1('0x18')](_0x4f6baa[_0xd2e1('0x19')],{'raw':_0x4f6baa[_0xd2e1('0x1a')]?_0x4f6baa[_0xd2e1('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x8a2296){logger[_0xd2e1('0x14')]('CreateVoiceTransferReport',_0x4f6baa);logger[_0xd2e1('0xe')]('CreateVoiceTransferReport',_0x4f6baa,JSON[_0xd2e1('0x10')](_0x8a2296));_0xfcc6(_0x8a2296);})[_0xd2e1('0x16')](function(_0x47be01){logger[_0xd2e1('0x11')](_0xd2e1('0x1b'),_0x47be01[_0xd2e1('0x13')],_0x4f6baa);_0x56f960(_0x63c64c['error'](0x1f4,_0x47be01[_0xd2e1('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 943bdde..9d21eb5 100644 --- a/server/api/webbar/index.js +++ b/server/api/webbar/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf3cd=['/unhold','unhold','/calls','calls','/transfer','transfer','exports','express','Router','../../components/auth/service','./webbar.controller','post','/originate','isWebrtcLicence','originate','isAuthenticated','hangup','/answer','answer'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x143ce6,_0x46e089){_0x143ce6=_0x143ce6-0x0;var _0x33ed64=_0xf3cd[_0x143ce6];return _0x33ed64;};'use strict';var express=require(_0xdf3c('0x0'));var router=express[_0xdf3c('0x1')]();var auth=require(_0xdf3c('0x2'));var controller=require(_0xdf3c('0x3'));router[_0xdf3c('0x4')](_0xdf3c('0x5'),auth['isAuthenticated'](),auth[_0xdf3c('0x6')](),controller[_0xdf3c('0x7')]);router[_0xdf3c('0x4')]('/hangup',auth[_0xdf3c('0x8')](),auth[_0xdf3c('0x6')](),controller[_0xdf3c('0x9')]);router[_0xdf3c('0x4')](_0xdf3c('0xa'),auth[_0xdf3c('0x8')](),auth['isWebrtcLicence'](),controller[_0xdf3c('0xb')]);router['post']('/hold',auth[_0xdf3c('0x8')](),auth[_0xdf3c('0x6')](),controller['hold']);router[_0xdf3c('0x4')](_0xdf3c('0xc'),auth[_0xdf3c('0x8')](),auth[_0xdf3c('0x6')](),controller[_0xdf3c('0xd')]);router[_0xdf3c('0x4')](_0xdf3c('0xe'),auth[_0xdf3c('0x8')](),auth['isWebrtcLicence'](),controller[_0xdf3c('0xf')]);router[_0xdf3c('0x4')](_0xdf3c('0x10'),auth[_0xdf3c('0x8')](),auth['isWebrtcLicence'](),controller[_0xdf3c('0x11')]);module[_0xdf3c('0x12')]=router; \ No newline at end of file +var _0x00bb=['answer','hold','/unhold','unhold','calls','/transfer','exports','express','Router','../../components/auth/service','post','isAuthenticated','isWebrtcLicence','/hangup','/answer'];(function(_0x6af1b1,_0x4ccf9e){var _0x139dae=function(_0x409ebf){while(--_0x409ebf){_0x6af1b1['push'](_0x6af1b1['shift']());}};_0x139dae(++_0x4ccf9e);}(_0x00bb,0x1d8));var _0xb00b=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x00bb[_0x311c35];return _0x5cc50c;};'use strict';var express=require(_0xb00b('0x0'));var router=express[_0xb00b('0x1')]();var auth=require(_0xb00b('0x2'));var controller=require('./webbar.controller');router[_0xb00b('0x3')]('/originate',auth[_0xb00b('0x4')](),auth[_0xb00b('0x5')](),controller['originate']);router[_0xb00b('0x3')](_0xb00b('0x6'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller['hangup']);router[_0xb00b('0x3')](_0xb00b('0x7'),auth[_0xb00b('0x4')](),auth[_0xb00b('0x5')](),controller[_0xb00b('0x8')]);router[_0xb00b('0x3')]('/hold',auth['isAuthenticated'](),auth[_0xb00b('0x5')](),controller[_0xb00b('0x9')]);router[_0xb00b('0x3')](_0xb00b('0xa'),auth[_0xb00b('0x4')](),auth['isWebrtcLicence'](),controller[_0xb00b('0xb')]);router['post']('/calls',auth['isAuthenticated'](),auth[_0xb00b('0x5')](),controller[_0xb00b('0xc')]);router[_0xb00b('0x3')](_0xb00b('0xd'),auth[_0xb00b('0x4')](),auth[_0xb00b('0x5')](),controller['transfer']);module[_0xb00b('0xe')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index dbaf90d..605a5fa 100644 --- a/server/api/webbar/webbar.controller.js +++ b/server/api/webbar/webbar.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd3d1=['send','NotFound','request','then','error','code','message','result','catch','User','findOne','agent','VoiceChannels','filter','rows','UserId','length','sessionId\x20','originate','originate\x20fired:','body','json','callNumber','callerId','entityFound:','format','user:%s','webbar:originate','hangup\x20fired:','webbar:hangup','hangup\x20executed!','answer','userId','webbar:answer','answer\x20executed!','hold','hold\x20fired:','sessionId','webbar:hold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','all','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','callNumber\x20is\x20required','string','sessionId\x20is\x20required','info','handleError:','stack','name','status'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0xd3d1,0x172));var _0x1d3d=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xd3d1[_0x4565bf];return _0x5610ba;};'use strict';var path=require(_0x1d3d('0x0'));var fs=require('fs');var _=require(_0x1d3d('0x1'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var util=require(_0x1d3d('0x2'));var BPromise=require(_0x1d3d('0x3'));var jayson=require(_0x1d3d('0x4'));var amiClient=jayson[_0x1d3d('0x5')][_0x1d3d('0x6')]({'port':0x232a});var logger=require(_0x1d3d('0x7'))(_0x1d3d('0x8'));var Redis=require(_0x1d3d('0x9'));config[_0x1d3d('0xa')]=_[_0x1d3d('0xb')](config[_0x1d3d('0xa')],{'host':_0x1d3d('0xc'),'port':0x18eb});var io=require(_0x1d3d('0xd'))(new Redis(config[_0x1d3d('0xa')]));var Schema=require(_0x1d3d('0xe'));var originateValidation=new Schema({'userId':{'type':_0x1d3d('0xf'),'required':[!![],_0x1d3d('0x10')]},'callNumber':{'type':'string','required':[!![],_0x1d3d('0x11')]},'callerId':{'type':_0x1d3d('0x12')},'callbackUrl':{'type':_0x1d3d('0x12')}});var hangupValidation=new Schema({'userId':{'type':_0x1d3d('0xf'),'required':[!![],_0x1d3d('0x10')]},'sessionId':{'type':_0x1d3d('0x12'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x1d3d('0xf'),'required':[!![],_0x1d3d('0x10')]},'sessionId':{'type':_0x1d3d('0x12'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x1d3d('0xf'),'required':[!![],_0x1d3d('0x10')]},'sessionId':{'type':'string','required':[!![],_0x1d3d('0x13')]},'transferNumber':{'type':_0x1d3d('0x12'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x1d3d('0x10')]},'sessionId':{'type':_0x1d3d('0x12'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x1d3d('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x1d3d('0x12'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0x1d3d('0x10')]}});var conferenceValidation=new Schema({'userId':{'type':_0x1d3d('0xf'),'required':[!![],_0x1d3d('0x10')]}});function emit(_0x24bb8c,_0x21c2e4,_0x1bdbdc){logger[_0x1d3d('0x14')](_0x24bb8c,_0x21c2e4,JSON['stringify'](_0x1bdbdc));io['to'](_0x24bb8c)['emit'](_0x21c2e4,_0x1bdbdc);}function handleError(_0x316ab4){return function(_0xe0a583){console['log'](_0x1d3d('0x15'),_0xe0a583,_0xe0a583 instanceof RangeError);logger['error'](_0xe0a583[_0x1d3d('0x16')]);if(_0xe0a583 instanceof RangeError){if(_0xe0a583[_0x1d3d('0x17')]){delete _0xe0a583[_0x1d3d('0x17')];}_0x316ab4[_0x1d3d('0x18')](0x194)['send'](_0xe0a583);}else{if(_0xe0a583[_0x1d3d('0x17')]){delete _0xe0a583['name'];}_0x316ab4['status'](0x1f4)[_0x1d3d('0x19')](_0xe0a583);}};}function checkError(){return function(_0x2bfac3){if(!_0x2bfac3){throw new RangeError(_0x1d3d('0x1a'));}return _0x2bfac3;};}function respondWithRpcPromise(_0x344a03,_0xa6f180){return new BPromise(function(_0xe4afa2,_0x471df5){var _0xa55c43=amiClient;return _0xa55c43[_0x1d3d('0x1b')](_0x344a03,_0xa6f180)[_0x1d3d('0x1c')](function(_0x1610a6){if(_0x1610a6['error']){if(_0x1610a6[_0x1d3d('0x1d')][_0x1d3d('0x1e')]===0x1f4){return _0x471df5(_0x1610a6['error'][_0x1d3d('0x1f')]);}return _0xe4afa2(_0x1610a6['error'][_0x1d3d('0x1f')]);}else{_0xe4afa2(_0x1610a6[_0x1d3d('0x20')]);}})[_0x1d3d('0x21')](function(_0x4235fd){_0x471df5(_0x4235fd);});});}function getAgent(_0x44e03e){return db[_0x1d3d('0x22')][_0x1d3d('0x23')]({'where':{'id':_0x44e03e,'role':_0x1d3d('0x24')}})[_0x1d3d('0x1c')](checkError());}function getAgentCheckSession(_0x2df7b7,_0x172dbd){return new BPromise(function(_0x4f0aa7,_0x3f5681){var _0x5b2986=respondWithRpcPromise(_0x1d3d('0x25'));var _0x2bcc2=getAgent(_0x2df7b7);Promise['all']([_0x5b2986,_0x2bcc2])[_0x1d3d('0x1c')](function(_0x16b7b3){var _0x3cb011=_0x16b7b3[0x0];var _0x2a3812=_0x16b7b3[0x1];var _0x4abbfc=_[_0x1d3d('0x26')](_0x3cb011[_0x1d3d('0x27')],function(_0x5d1b6c){return _0x5d1b6c[_0x1d3d('0x28')]==_0x2a3812['id']&&_0x5d1b6c['sessionId']==_0x172dbd;});if(_0x4abbfc[_0x1d3d('0x29')]==0x1){_0x4f0aa7(_0x2a3812);}else{_0x3f5681(new RangeError(_0x1d3d('0x2a')+_0x172dbd+'\x20not\x20found!'));}});});}exports[_0x1d3d('0x2b')]=function(_0x192f60,_0x102b70){logger[_0x1d3d('0x14')](_0x1d3d('0x2c'),_0x192f60[_0x1d3d('0x2d')]);var _0x4fc03a=originateValidation[_0x1d3d('0xe')](_0x192f60[_0x1d3d('0x2d')]);if(_0x4fc03a['length']>0x0){return _0x102b70[_0x1d3d('0x18')](0x190)[_0x1d3d('0x2e')](_0x4fc03a);}var _0x4017b2=_0x192f60[_0x1d3d('0x2d')]['userId'];var _0x4a1e67=_0x192f60[_0x1d3d('0x2d')][_0x1d3d('0x2f')];var _0x47a8e3=_0x192f60[_0x1d3d('0x2d')][_0x1d3d('0x30')];var _0x2888f9=_0x192f60[_0x1d3d('0x2d')]['callbackUrl'];return getAgent(_0x4017b2)['then'](function(_0x29fa6c){logger['info'](_0x1d3d('0x31'),_0x29fa6c[_0x1d3d('0x17')]);emit(util[_0x1d3d('0x32')](_0x1d3d('0x33'),_0x29fa6c[_0x1d3d('0x17')]),_0x1d3d('0x34'),{'callNumber':_0x4a1e67,'callerId':_0x47a8e3,'callbackUrl':_0x2888f9});return _0x102b70[_0x1d3d('0x18')](0xc8)[_0x1d3d('0x2e')]({'error':![],'message':'originate\x20executed!'});})[_0x1d3d('0x21')](handleError(_0x102b70));};exports['hangup']=function(_0x58ae8e,_0x206e4c){logger['info'](_0x1d3d('0x35'),_0x58ae8e[_0x1d3d('0x2d')]);var _0x182083=hangupValidation[_0x1d3d('0xe')](_0x58ae8e['body']);if(_0x182083['length']>0x0){return _0x206e4c[_0x1d3d('0x18')](0x190)['json'](_0x182083);}var _0x290853=_0x58ae8e[_0x1d3d('0x2d')]['userId'];var _0x1ad7a6=_0x58ae8e[_0x1d3d('0x2d')]['sessionId'];return getAgent(_0x290853)[_0x1d3d('0x1c')](function(_0x40f8ca){logger[_0x1d3d('0x14')](_0x1d3d('0x31'),_0x40f8ca[_0x1d3d('0x17')]);emit(util[_0x1d3d('0x32')]('user:%s',_0x40f8ca[_0x1d3d('0x17')]),_0x1d3d('0x36'),{'sessionId':_0x1ad7a6});return _0x206e4c[_0x1d3d('0x18')](0xc8)[_0x1d3d('0x2e')]({'error':![],'message':_0x1d3d('0x37')});})['catch'](handleError(_0x206e4c));};exports[_0x1d3d('0x38')]=function(_0x2ccba6,_0x1c0cc6){logger[_0x1d3d('0x14')]('answer\x20fired:',_0x2ccba6[_0x1d3d('0x2d')]);var _0x977ea8=answerValidation[_0x1d3d('0xe')](_0x2ccba6[_0x1d3d('0x2d')]);if(_0x977ea8[_0x1d3d('0x29')]>0x0){return _0x1c0cc6['status'](0x190)['json'](_0x977ea8);}var _0x229f48=_0x2ccba6[_0x1d3d('0x2d')][_0x1d3d('0x39')];var _0x66efd=_0x2ccba6[_0x1d3d('0x2d')]['sessionId'];return getAgent(_0x229f48)[_0x1d3d('0x1c')](function(_0x557a25){logger[_0x1d3d('0x14')](_0x1d3d('0x31'),_0x557a25[_0x1d3d('0x17')]);emit(util[_0x1d3d('0x32')]('user:%s',_0x557a25[_0x1d3d('0x17')]),_0x1d3d('0x3a'),{'sessionId':_0x66efd});return _0x1c0cc6[_0x1d3d('0x18')](0xc8)[_0x1d3d('0x2e')]({'error':![],'message':_0x1d3d('0x3b')});})[_0x1d3d('0x21')](handleError(_0x1c0cc6));};exports[_0x1d3d('0x3c')]=function(_0x55aa8a,_0x3c5ccf){logger['info'](_0x1d3d('0x3d'),_0x55aa8a[_0x1d3d('0x2d')]);var _0x5e8ec0=holdValidation[_0x1d3d('0xe')](_0x55aa8a['body']);if(_0x5e8ec0[_0x1d3d('0x29')]>0x0){return _0x3c5ccf['status'](0x190)[_0x1d3d('0x2e')](_0x5e8ec0);}var _0xebd1f4=_0x55aa8a[_0x1d3d('0x2d')][_0x1d3d('0x39')];var _0xea9cf2=_0x55aa8a[_0x1d3d('0x2d')][_0x1d3d('0x3e')];return getAgent(_0xebd1f4)[_0x1d3d('0x1c')](function(_0x59e88a){logger['info']('entityFound:',_0x59e88a[_0x1d3d('0x17')]);emit(util[_0x1d3d('0x32')](_0x1d3d('0x33'),_0x59e88a[_0x1d3d('0x17')]),_0x1d3d('0x3f'),{'sessionId':_0xea9cf2});return _0x3c5ccf[_0x1d3d('0x18')](0xc8)['json']({'error':![],'message':'hold\x20executed!'});})['catch'](handleError(_0x3c5ccf));};exports['unhold']=function(_0x3dc5ca,_0x21620d){logger[_0x1d3d('0x14')](_0x1d3d('0x40'),_0x3dc5ca[_0x1d3d('0x2d')]);var _0x363f4c=unholdValidation[_0x1d3d('0xe')](_0x3dc5ca[_0x1d3d('0x2d')]);if(_0x363f4c[_0x1d3d('0x29')]>0x0){return _0x21620d[_0x1d3d('0x18')](0x190)[_0x1d3d('0x2e')](_0x363f4c);}var _0xb88d59=_0x3dc5ca[_0x1d3d('0x2d')][_0x1d3d('0x39')];var _0x311b05=_0x3dc5ca['body'][_0x1d3d('0x3e')];return getAgent(_0xb88d59)[_0x1d3d('0x1c')](function(_0x1bbfc8){logger[_0x1d3d('0x14')]('entityFound:',_0x1bbfc8[_0x1d3d('0x17')]);emit(util['format']('user:%s',_0x1bbfc8[_0x1d3d('0x17')]),_0x1d3d('0x41'),{'sessionId':_0x311b05});return _0x21620d['status'](0xc8)[_0x1d3d('0x2e')]({'error':![],'message':_0x1d3d('0x42')});})['catch'](handleError(_0x21620d));};exports[_0x1d3d('0x43')]=function(_0x7af4dd,_0x15d9b4){logger[_0x1d3d('0x14')](_0x1d3d('0x44'),_0x15d9b4[_0x1d3d('0x2d')]);var _0x213b0b=callsValidation[_0x1d3d('0xe')](_0x7af4dd[_0x1d3d('0x2d')]);if(_0x213b0b['length']>0x0){return _0x15d9b4[_0x1d3d('0x18')](0x190)['json'](_0x213b0b);}var _0x482c31=_0x7af4dd['body']['userId'];var _0x17c3ab=respondWithRpcPromise(_0x1d3d('0x25'));var _0x32aaa2=getAgent(_0x482c31);return Promise[_0x1d3d('0x45')]([_0x17c3ab,_0x32aaa2])['then'](function(_0xecfc7e){var _0x480439=_0xecfc7e[0x0];var _0x44273d=_0xecfc7e[0x1];var _0xd3f336=_['filter'](_0x480439[_0x1d3d('0x27')],function(_0x45419e){return _0x45419e['UserId']==_0x44273d['id'];});return _0x15d9b4[_0x1d3d('0x18')](0xc8)[_0x1d3d('0x2e')]({'count':_0xd3f336[_0x1d3d('0x29')],'rows':_0xd3f336});})[_0x1d3d('0x21')](handleError(_0x15d9b4));};exports[_0x1d3d('0x46')]=function(_0x16e757,_0x4e47d5){logger[_0x1d3d('0x14')](_0x1d3d('0x47'),_0x16e757[_0x1d3d('0x2d')]);var _0x1183c0=conferenceValidation[_0x1d3d('0xe')](_0x16e757['body']);if(_0x1183c0[_0x1d3d('0x29')]>0x0){return _0x4e47d5['status'](0x190)[_0x1d3d('0x2e')](_0x1183c0);}var _0x5dcad1=_0x16e757[_0x1d3d('0x2d')][_0x1d3d('0x39')];return getAgent(_0x5dcad1)[_0x1d3d('0x1c')](function(_0x1711ee){logger[_0x1d3d('0x14')](_0x1d3d('0x31'),_0x1711ee[_0x1d3d('0x17')]);emit(util['format'](_0x1d3d('0x33'),_0x1711ee[_0x1d3d('0x17')]),_0x1d3d('0x48'));return _0x4e47d5[_0x1d3d('0x18')](0xc8)[_0x1d3d('0x2e')]({'error':![],'message':_0x1d3d('0x49')});})['catch'](handleError(_0x4e47d5));};exports[_0x1d3d('0x4a')]=function(_0x2ca216,_0xa8891a){logger[_0x1d3d('0x14')](_0x1d3d('0x4b'),_0x2ca216['body']);var _0xe83c1d=transferValidation[_0x1d3d('0xe')](_0x2ca216[_0x1d3d('0x2d')]);if(_0xe83c1d['length']>0x0){return _0xa8891a[_0x1d3d('0x18')](0x190)['json'](_0xe83c1d);}var _0x2ee6ca=_0x2ca216['body'][_0x1d3d('0x39')];var _0x378878=_0x2ca216[_0x1d3d('0x2d')]['sessionId'];var _0x389330=_0x2ca216[_0x1d3d('0x2d')][_0x1d3d('0x4c')];return getAgent(_0x2ee6ca)['then'](function(_0x19a126){logger[_0x1d3d('0x14')](_0x1d3d('0x31'),_0x19a126['name']);emit(util[_0x1d3d('0x32')](_0x1d3d('0x33'),_0x19a126[_0x1d3d('0x17')]),_0x1d3d('0x4d'),{'sessionId':_0x378878,'transferNumber':_0x389330});return _0xa8891a[_0x1d3d('0x18')](0xc8)['json']({'error':![],'message':_0x1d3d('0x4e')});})[_0x1d3d('0x21')](handleError(_0xa8891a));}; \ No newline at end of file +var _0xee24=['stack','name','status','send','NotFound','then','code','message','User','findOne','agent','rows','UserId','sessionId','length','originate','originate\x20fired:','body','json','userId','callNumber','callerId','callbackUrl','info','format','user:%s','webbar:originate','originate\x20executed!','catch','hangup','entityFound:','webbar:hangup','hangup\x20executed!','answer\x20fired:','answer\x20executed!','hold','hold\x20fired:','hold\x20executed!','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','all','filter','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','lodash','../../mysqldb','util','bluebird','jayson/promise','client','../../config/logger','webbarapi','ioredis','redis','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','transferNumber\x20is\x20required','stringify','emit','log','handleError:','error'];(function(_0x5dabf6,_0x26dd82){var _0x64a3ec=function(_0xbe9a58){while(--_0xbe9a58){_0x5dabf6['push'](_0x5dabf6['shift']());}};_0x64a3ec(++_0x26dd82);}(_0xee24,0x1a6));var _0x4ee2=function(_0x4b20c3,_0x594e54){_0x4b20c3=_0x4b20c3-0x0;var _0x5dcb26=_0xee24[_0x4b20c3];return _0x5dcb26;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x4ee2('0x0'));var db=require(_0x4ee2('0x1'))['db'];var config=require('../../config/environment');var util=require(_0x4ee2('0x2'));var BPromise=require(_0x4ee2('0x3'));var jayson=require(_0x4ee2('0x4'));var amiClient=jayson[_0x4ee2('0x5')]['http']({'port':0x232a});var logger=require(_0x4ee2('0x6'))(_0x4ee2('0x7'));var Redis=require(_0x4ee2('0x8'));config[_0x4ee2('0x9')]=_['defaults'](config[_0x4ee2('0x9')],{'host':_0x4ee2('0xa'),'port':0x18eb});var io=require(_0x4ee2('0xb'))(new Redis(config[_0x4ee2('0x9')]));var Schema=require(_0x4ee2('0xc'));var originateValidation=new Schema({'userId':{'type':_0x4ee2('0xd'),'required':[!![],_0x4ee2('0xe')]},'callNumber':{'type':_0x4ee2('0xf'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':'string'},'callbackUrl':{'type':_0x4ee2('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0x4ee2('0xd'),'required':[!![],_0x4ee2('0xe')]},'sessionId':{'type':_0x4ee2('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x4ee2('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x4ee2('0xf'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x4ee2('0xd'),'required':[!![],_0x4ee2('0xe')]},'sessionId':{'type':_0x4ee2('0xf'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x4ee2('0xf'),'required':[!![],_0x4ee2('0x10')]}});var holdValidation=new Schema({'userId':{'type':_0x4ee2('0xd'),'required':[!![],_0x4ee2('0xe')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x4ee2('0xe')]},'sessionId':{'type':_0x4ee2('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0x4ee2('0xe')]}});var conferenceValidation=new Schema({'userId':{'type':_0x4ee2('0xd'),'required':[!![],_0x4ee2('0xe')]}});function emit(_0x1b95c5,_0x14bc72,_0x3b742c){logger['info'](_0x1b95c5,_0x14bc72,JSON[_0x4ee2('0x11')](_0x3b742c));io['to'](_0x1b95c5)[_0x4ee2('0x12')](_0x14bc72,_0x3b742c);}function handleError(_0x3d0308){return function(_0x4aba2b){console[_0x4ee2('0x13')](_0x4ee2('0x14'),_0x4aba2b,_0x4aba2b instanceof RangeError);logger[_0x4ee2('0x15')](_0x4aba2b[_0x4ee2('0x16')]);if(_0x4aba2b instanceof RangeError){if(_0x4aba2b[_0x4ee2('0x17')]){delete _0x4aba2b[_0x4ee2('0x17')];}_0x3d0308[_0x4ee2('0x18')](0x194)[_0x4ee2('0x19')](_0x4aba2b);}else{if(_0x4aba2b['name']){delete _0x4aba2b['name'];}_0x3d0308[_0x4ee2('0x18')](0x1f4)['send'](_0x4aba2b);}};}function checkError(){return function(_0x34c281){if(!_0x34c281){throw new RangeError(_0x4ee2('0x1a'));}return _0x34c281;};}function respondWithRpcPromise(_0x1d9a37,_0x416a78){return new BPromise(function(_0x4507d6,_0x53f246){var _0x1d5037=amiClient;return _0x1d5037['request'](_0x1d9a37,_0x416a78)[_0x4ee2('0x1b')](function(_0x3e6344){if(_0x3e6344[_0x4ee2('0x15')]){if(_0x3e6344[_0x4ee2('0x15')][_0x4ee2('0x1c')]===0x1f4){return _0x53f246(_0x3e6344[_0x4ee2('0x15')][_0x4ee2('0x1d')]);}return _0x4507d6(_0x3e6344['error'][_0x4ee2('0x1d')]);}else{_0x4507d6(_0x3e6344['result']);}})['catch'](function(_0xebd95f){_0x53f246(_0xebd95f);});});}function getAgent(_0x291734){return db[_0x4ee2('0x1e')][_0x4ee2('0x1f')]({'where':{'id':_0x291734,'role':_0x4ee2('0x20')}})['then'](checkError());}function getAgentCheckSession(_0x50005e,_0x404fba){return new BPromise(function(_0x2a078f,_0x562a4d){var _0x2fe02a=respondWithRpcPromise('VoiceChannels');var _0x49b1be=getAgent(_0x50005e);Promise['all']([_0x2fe02a,_0x49b1be])[_0x4ee2('0x1b')](function(_0x970fa6){var _0x50da2d=_0x970fa6[0x0];var _0x3f68b9=_0x970fa6[0x1];var _0x6775f7=_['filter'](_0x50da2d[_0x4ee2('0x21')],function(_0x4bf072){return _0x4bf072[_0x4ee2('0x22')]==_0x3f68b9['id']&&_0x4bf072[_0x4ee2('0x23')]==_0x404fba;});if(_0x6775f7[_0x4ee2('0x24')]==0x1){_0x2a078f(_0x3f68b9);}else{_0x562a4d(new RangeError('sessionId\x20'+_0x404fba+'\x20not\x20found!'));}});});}exports[_0x4ee2('0x25')]=function(_0x14f164,_0x3ab2a1){logger['info'](_0x4ee2('0x26'),_0x14f164[_0x4ee2('0x27')]);var _0x1fca9f=originateValidation[_0x4ee2('0xc')](_0x14f164[_0x4ee2('0x27')]);if(_0x1fca9f[_0x4ee2('0x24')]>0x0){return _0x3ab2a1[_0x4ee2('0x18')](0x190)[_0x4ee2('0x28')](_0x1fca9f);}var _0x256bea=_0x14f164[_0x4ee2('0x27')][_0x4ee2('0x29')];var _0x25db8f=_0x14f164['body'][_0x4ee2('0x2a')];var _0x287ff3=_0x14f164['body'][_0x4ee2('0x2b')];var _0x21968c=_0x14f164[_0x4ee2('0x27')][_0x4ee2('0x2c')];return getAgent(_0x256bea)[_0x4ee2('0x1b')](function(_0x429a90){logger[_0x4ee2('0x2d')]('entityFound:',_0x429a90[_0x4ee2('0x17')]);emit(util[_0x4ee2('0x2e')](_0x4ee2('0x2f'),_0x429a90['name']),_0x4ee2('0x30'),{'callNumber':_0x25db8f,'callerId':_0x287ff3,'callbackUrl':_0x21968c});return _0x3ab2a1['status'](0xc8)[_0x4ee2('0x28')]({'error':![],'message':_0x4ee2('0x31')});})[_0x4ee2('0x32')](handleError(_0x3ab2a1));};exports[_0x4ee2('0x33')]=function(_0x3c7282,_0x52fa55){logger['info']('hangup\x20fired:',_0x3c7282[_0x4ee2('0x27')]);var _0x3f2c6a=hangupValidation[_0x4ee2('0xc')](_0x3c7282[_0x4ee2('0x27')]);if(_0x3f2c6a[_0x4ee2('0x24')]>0x0){return _0x52fa55[_0x4ee2('0x18')](0x190)[_0x4ee2('0x28')](_0x3f2c6a);}var _0x29c4b3=_0x3c7282[_0x4ee2('0x27')][_0x4ee2('0x29')];var _0x57b506=_0x3c7282['body'][_0x4ee2('0x23')];return getAgent(_0x29c4b3)[_0x4ee2('0x1b')](function(_0x1255ff){logger['info'](_0x4ee2('0x34'),_0x1255ff[_0x4ee2('0x17')]);emit(util[_0x4ee2('0x2e')](_0x4ee2('0x2f'),_0x1255ff[_0x4ee2('0x17')]),_0x4ee2('0x35'),{'sessionId':_0x57b506});return _0x52fa55[_0x4ee2('0x18')](0xc8)[_0x4ee2('0x28')]({'error':![],'message':_0x4ee2('0x36')});})[_0x4ee2('0x32')](handleError(_0x52fa55));};exports['answer']=function(_0x5d4395,_0x3e7f65){logger[_0x4ee2('0x2d')](_0x4ee2('0x37'),_0x5d4395['body']);var _0x1ef1d5=answerValidation['validate'](_0x5d4395[_0x4ee2('0x27')]);if(_0x1ef1d5['length']>0x0){return _0x3e7f65[_0x4ee2('0x18')](0x190)[_0x4ee2('0x28')](_0x1ef1d5);}var _0x41607a=_0x5d4395['body'][_0x4ee2('0x29')];var _0x4e7a92=_0x5d4395[_0x4ee2('0x27')][_0x4ee2('0x23')];return getAgent(_0x41607a)[_0x4ee2('0x1b')](function(_0x38a25a){logger['info'](_0x4ee2('0x34'),_0x38a25a[_0x4ee2('0x17')]);emit(util['format'](_0x4ee2('0x2f'),_0x38a25a['name']),'webbar:answer',{'sessionId':_0x4e7a92});return _0x3e7f65[_0x4ee2('0x18')](0xc8)['json']({'error':![],'message':_0x4ee2('0x38')});})['catch'](handleError(_0x3e7f65));};exports[_0x4ee2('0x39')]=function(_0x4641b8,_0x39237a){logger['info'](_0x4ee2('0x3a'),_0x4641b8[_0x4ee2('0x27')]);var _0x44ada1=holdValidation[_0x4ee2('0xc')](_0x4641b8[_0x4ee2('0x27')]);if(_0x44ada1['length']>0x0){return _0x39237a[_0x4ee2('0x18')](0x190)[_0x4ee2('0x28')](_0x44ada1);}var _0x535c11=_0x4641b8['body'][_0x4ee2('0x29')];var _0x54e734=_0x4641b8[_0x4ee2('0x27')][_0x4ee2('0x23')];return getAgent(_0x535c11)['then'](function(_0x43ca98){logger[_0x4ee2('0x2d')](_0x4ee2('0x34'),_0x43ca98['name']);emit(util[_0x4ee2('0x2e')](_0x4ee2('0x2f'),_0x43ca98['name']),'webbar:hold',{'sessionId':_0x54e734});return _0x39237a['status'](0xc8)['json']({'error':![],'message':_0x4ee2('0x3b')});})[_0x4ee2('0x32')](handleError(_0x39237a));};exports['unhold']=function(_0x1379c0,_0x3d25fb){logger[_0x4ee2('0x2d')](_0x4ee2('0x3c'),_0x1379c0[_0x4ee2('0x27')]);var _0x152519=unholdValidation[_0x4ee2('0xc')](_0x1379c0['body']);if(_0x152519[_0x4ee2('0x24')]>0x0){return _0x3d25fb['status'](0x190)[_0x4ee2('0x28')](_0x152519);}var _0x14a86d=_0x1379c0[_0x4ee2('0x27')]['userId'];var _0x386a59=_0x1379c0[_0x4ee2('0x27')][_0x4ee2('0x23')];return getAgent(_0x14a86d)['then'](function(_0x53a6c8){logger[_0x4ee2('0x2d')](_0x4ee2('0x34'),_0x53a6c8[_0x4ee2('0x17')]);emit(util[_0x4ee2('0x2e')]('user:%s',_0x53a6c8[_0x4ee2('0x17')]),_0x4ee2('0x3d'),{'sessionId':_0x386a59});return _0x3d25fb[_0x4ee2('0x18')](0xc8)[_0x4ee2('0x28')]({'error':![],'message':_0x4ee2('0x3e')});})[_0x4ee2('0x32')](handleError(_0x3d25fb));};exports[_0x4ee2('0x3f')]=function(_0x3c65ca,_0x279c28){logger[_0x4ee2('0x2d')](_0x4ee2('0x40'),_0x279c28[_0x4ee2('0x27')]);var _0x58dac3=callsValidation['validate'](_0x3c65ca[_0x4ee2('0x27')]);if(_0x58dac3[_0x4ee2('0x24')]>0x0){return _0x279c28[_0x4ee2('0x18')](0x190)['json'](_0x58dac3);}var _0x578908=_0x3c65ca[_0x4ee2('0x27')][_0x4ee2('0x29')];var _0xf00660=respondWithRpcPromise('VoiceChannels');var _0x45294c=getAgent(_0x578908);return Promise[_0x4ee2('0x41')]([_0xf00660,_0x45294c])[_0x4ee2('0x1b')](function(_0x3ef445){var _0x430dfc=_0x3ef445[0x0];var _0x5a9dac=_0x3ef445[0x1];var _0x55e0a4=_[_0x4ee2('0x42')](_0x430dfc[_0x4ee2('0x21')],function(_0x47f36e){return _0x47f36e[_0x4ee2('0x22')]==_0x5a9dac['id'];});return _0x279c28[_0x4ee2('0x18')](0xc8)[_0x4ee2('0x28')]({'count':_0x55e0a4[_0x4ee2('0x24')],'rows':_0x55e0a4});})[_0x4ee2('0x32')](handleError(_0x279c28));};exports['conference']=function(_0x344e1c,_0x56a88b){logger[_0x4ee2('0x2d')](_0x4ee2('0x43'),_0x344e1c['body']);var _0x1bb9e3=conferenceValidation[_0x4ee2('0xc')](_0x344e1c[_0x4ee2('0x27')]);if(_0x1bb9e3[_0x4ee2('0x24')]>0x0){return _0x56a88b['status'](0x190)[_0x4ee2('0x28')](_0x1bb9e3);}var _0x380682=_0x344e1c['body'][_0x4ee2('0x29')];return getAgent(_0x380682)[_0x4ee2('0x1b')](function(_0x33992f){logger[_0x4ee2('0x2d')]('entityFound:',_0x33992f[_0x4ee2('0x17')]);emit(util[_0x4ee2('0x2e')](_0x4ee2('0x2f'),_0x33992f[_0x4ee2('0x17')]),_0x4ee2('0x44'));return _0x56a88b[_0x4ee2('0x18')](0xc8)['json']({'error':![],'message':_0x4ee2('0x45')});})[_0x4ee2('0x32')](handleError(_0x56a88b));};exports[_0x4ee2('0x46')]=function(_0xd2a358,_0x4f34c1){logger[_0x4ee2('0x2d')](_0x4ee2('0x47'),_0xd2a358[_0x4ee2('0x27')]);var _0x54f7ab=transferValidation['validate'](_0xd2a358['body']);if(_0x54f7ab[_0x4ee2('0x24')]>0x0){return _0x4f34c1['status'](0x190)[_0x4ee2('0x28')](_0x54f7ab);}var _0xcdf9c2=_0xd2a358[_0x4ee2('0x27')]['userId'];var _0x5a5a9e=_0xd2a358[_0x4ee2('0x27')][_0x4ee2('0x23')];var _0x4217f9=_0xd2a358[_0x4ee2('0x27')][_0x4ee2('0x48')];return getAgent(_0xcdf9c2)[_0x4ee2('0x1b')](function(_0x5cc907){logger[_0x4ee2('0x2d')](_0x4ee2('0x34'),_0x5cc907[_0x4ee2('0x17')]);emit(util[_0x4ee2('0x2e')](_0x4ee2('0x2f'),_0x5cc907[_0x4ee2('0x17')]),_0x4ee2('0x49'),{'sessionId':_0x5a5a9e,'transferNumber':_0x4217f9});return _0x4f34c1[_0x4ee2('0x18')](0xc8)[_0x4ee2('0x28')]({'error':![],'message':'transfer\x20executed!'});})['catch'](handleError(_0x4f34c1));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 32b6c82..d08d590 100644 --- a/server/api/whatsappAccount/index.js +++ b/server/api/whatsappAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x902f=['/:id/canned_answers','addAnswer','addAgents','addApplications','/:id/notify','send','put','/:id','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','isAuthenticated','index','get','/describe','describe','getDispositions','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x902f,0x74));var _0xf902=function(_0x42caee,_0x12c5bc){_0x42caee=_0x42caee-0x0;var _0x4a455f=_0x902f[_0x42caee];return _0x4a455f;};'use strict';var multer=require(_0xf902('0x0'));var util=require(_0xf902('0x1'));var path=require(_0xf902('0x2'));var timeout=require(_0xf902('0x3'));var express=require('express');var router=express[_0xf902('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf902('0x5'));var config=require(_0xf902('0x6'));var controller=require(_0xf902('0x7'));router['get']('/',auth[_0xf902('0x8')](),controller[_0xf902('0x9')]);router[_0xf902('0xa')](_0xf902('0xb'),auth[_0xf902('0x8')](),controller[_0xf902('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xf902('0xa')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xf902('0xd')]);router[_0xf902('0xa')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xf902('0xe')]);router[_0xf902('0xa')](_0xf902('0xf'),auth[_0xf902('0x8')](),controller[_0xf902('0x10')]);router[_0xf902('0xa')](_0xf902('0x11'),auth['isAuthenticated'](),controller[_0xf902('0x12')]);router[_0xf902('0x13')]('/',auth[_0xf902('0x8')](),controller['create']);router[_0xf902('0x13')]('/:id/dispositions',auth[_0xf902('0x8')](),controller['addDisposition']);router[_0xf902('0x13')](_0xf902('0x14'),auth[_0xf902('0x8')](),controller[_0xf902('0x15')]);router[_0xf902('0x13')](_0xf902('0xf'),auth['isAuthenticated'](),controller[_0xf902('0x16')]);router[_0xf902('0x13')](_0xf902('0x11'),auth[_0xf902('0x8')](),controller[_0xf902('0x17')]);router[_0xf902('0x13')](_0xf902('0x18'),controller['notify']);router[_0xf902('0x13')]('/:id/send',auth[_0xf902('0x8')](),controller[_0xf902('0x19')]);router[_0xf902('0x1a')](_0xf902('0x1b'),auth['isAuthenticated'](),controller['update']);router[_0xf902('0x1c')](_0xf902('0x1b'),auth['isAuthenticated'](),controller[_0xf902('0x1d')]);router[_0xf902('0x1c')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xf902('0x1e')]);router[_0xf902('0x1c')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xf902('0x1f')]);router[_0xf902('0x1c')](_0xf902('0xf'),auth[_0xf902('0x8')](),controller[_0xf902('0x20')]);module[_0xf902('0x21')]=router; \ No newline at end of file +var _0x7013=['notify','/:id/send','send','put','delete','destroy','removeAnswers','removeAgents','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','/:id/applications','getApplications','post','addDisposition','addAnswer','addAgents','addApplications','/:id/notify'];(function(_0x498334,_0x27b6fe){var _0x13bb70=function(_0x4087b1){while(--_0x4087b1){_0x498334['push'](_0x498334['shift']());}};_0x13bb70(++_0x27b6fe);}(_0x7013,0x10c));var _0x3701=function(_0xf7ccc6,_0x39786d){_0xf7ccc6=_0xf7ccc6-0x0;var _0x3ec873=_0x7013[_0xf7ccc6];return _0x3ec873;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3701('0x0'));var timeout=require(_0x3701('0x1'));var express=require(_0x3701('0x2'));var router=express[_0x3701('0x3')]();var fs_extra=require(_0x3701('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3701('0x5'));var config=require(_0x3701('0x6'));var controller=require(_0x3701('0x7'));router[_0x3701('0x8')]('/',auth[_0x3701('0x9')](),controller[_0x3701('0xa')]);router['get'](_0x3701('0xb'),auth[_0x3701('0x9')](),controller[_0x3701('0xc')]);router[_0x3701('0x8')](_0x3701('0xd'),auth['isAuthenticated'](),controller[_0x3701('0xe')]);router[_0x3701('0x8')](_0x3701('0xf'),auth[_0x3701('0x9')](),controller[_0x3701('0x10')]);router[_0x3701('0x8')](_0x3701('0x11'),auth[_0x3701('0x9')](),controller[_0x3701('0x12')]);router[_0x3701('0x8')](_0x3701('0x13'),auth[_0x3701('0x9')](),controller['getAgents']);router['get'](_0x3701('0x14'),auth['isAuthenticated'](),controller[_0x3701('0x15')]);router['post']('/',auth[_0x3701('0x9')](),controller['create']);router[_0x3701('0x16')](_0x3701('0xf'),auth['isAuthenticated'](),controller[_0x3701('0x17')]);router['post']('/:id/canned_answers',auth[_0x3701('0x9')](),controller[_0x3701('0x18')]);router[_0x3701('0x16')](_0x3701('0x13'),auth['isAuthenticated'](),controller[_0x3701('0x19')]);router['post']('/:id/applications',auth[_0x3701('0x9')](),controller[_0x3701('0x1a')]);router['post'](_0x3701('0x1b'),controller[_0x3701('0x1c')]);router[_0x3701('0x16')](_0x3701('0x1d'),auth[_0x3701('0x9')](),controller[_0x3701('0x1e')]);router[_0x3701('0x1f')](_0x3701('0xd'),auth[_0x3701('0x9')](),controller['update']);router[_0x3701('0x20')](_0x3701('0xd'),auth[_0x3701('0x9')](),controller[_0x3701('0x21')]);router[_0x3701('0x20')]('/:id/dispositions',auth[_0x3701('0x9')](),controller['removeDispositions']);router[_0x3701('0x20')](_0x3701('0x11'),auth[_0x3701('0x9')](),controller[_0x3701('0x22')]);router[_0x3701('0x20')](_0x3701('0x13'),auth[_0x3701('0x9')](),controller[_0x3701('0x23')]);module[_0x3701('0x24')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 1c2da94..8c56dca 100644 --- a/server/api/whatsappAccount/whatsappAccount.attributes.js +++ b/server/api/whatsappAccount/whatsappAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x003a=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','randomstring','exports','STRING','name','generate','twilio','sinch','TEXT','BOOLEAN','INTEGER'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0x003a,0x1b0));var _0xa003=function(_0xac9b92,_0x22d97d){_0xac9b92=_0xac9b92-0x0;var _0x121990=_0x003a[_0xac9b92];return _0x121990;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xa003('0x0'));module[_0xa003('0x1')]={'name':{'type':Sequelize[_0xa003('0x2')],'unique':_0xa003('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xa003('0x2')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xa003('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0xa003('0x5'),_0xa003('0x6'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0xa003('0x2')]},'authToken':{'type':Sequelize[_0xa003('0x2')]},'notificationTemplate':{'type':Sequelize[_0xa003('0x7')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xa003('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xa003('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xa003('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa003('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa003('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa003('0x9')],'comment':_0xa003('0xa')},'mandatoryDisposition':{'type':Sequelize[_0xa003('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x39eaec){if(!_0x39eaec){this[_0xa003('0xb')](_0xa003('0xc'),null);}this['setDataValue']('mandatoryDisposition',_0x39eaec);}},'description':{'type':Sequelize[_0xa003('0x2')]}}; \ No newline at end of file +var _0xd081=['TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','STRING','name','generate','sinch'];(function(_0x1d7a49,_0x504480){var _0xed8427=function(_0x1ce10b){while(--_0x1ce10b){_0x1d7a49['push'](_0x1d7a49['shift']());}};_0xed8427(++_0x504480);}(_0xd081,0x16f));var _0x1d08=function(_0x24d98e,_0x503381){_0x24d98e=_0x24d98e-0x0;var _0x597ce1=_0xd081[_0x24d98e];return _0x597ce1;};'use strict';var Sequelize=require(_0x1d08('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x1d08('0x1')],'unique':_0x1d08('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x1d08('0x1')],'allowNull':![]},'remote':{'type':Sequelize[_0x1d08('0x1')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x1d08('0x3')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM']('twilio',_0x1d08('0x4'))},'accountSid':{'type':Sequelize[_0x1d08('0x1')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x1d08('0x5')],'defaultValue':function(){return _0x1d08('0x6');}},'notificationSound':{'type':Sequelize[_0x1d08('0x7')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x1d08('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1d08('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x1d08('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x1d08('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1d08('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1d08('0x8')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x1d08('0x9'),'set':function(_0x1a3d05){if(!_0x1a3d05){this[_0x1d08('0xa')](_0x1d08('0xb'),null);}this[_0x1d08('0xa')]('mandatoryDisposition',_0x1a3d05);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 3730ca3..2314e2c 100644 --- a/server/api/whatsappAccount/whatsappAccount.controller.js +++ b/server/api/whatsappAccount/whatsappAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc1ec=['Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','stack','finally','getApplications','notify','whatsapp','account','type','sinch','statuses','state','read','update','applications','orderBy','Applications','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','difference','updatedAt','CompanyId','ListId','mobile','twilio','from','From','replace','whatsapp:','Body','messageId','MessageSid','notifications','message_id','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','contact','WhatsappInteraction','interaction','close','unmanaged','created','WhatsappMessage','AttachmentId','UserId','unshift','*,*,*,*','WhatsappQueue','queueId','waitForTheAssignedQueue','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','\x0a','to\x20is\x20mandatory','List','defaults','out','Messages','dataValues','push','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','status','end','json','offset','limit','count','set','apply','reject','save','destroy','get','WhatsappAccounts','sendStatus','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','Disposition','getDispositions','WhatsappAccountId','include','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','userWhatsappAccount:remove','User','getAgents','sequelize','transaction'];(function(_0x14dfd6,_0x392fa4){var _0x36c19a=function(_0x453179){while(--_0x453179){_0x14dfd6['push'](_0x14dfd6['shift']());}};_0x36c19a(++_0x392fa4);}(_0xc1ec,0x117));var _0xcc1e=function(_0x563ae3,_0x1df974){_0x563ae3=_0x563ae3-0x0;var _0x1138cc=_0xc1ec[_0x563ae3];return _0x1138cc;};'use strict';var emlformat=require(_0xcc1e('0x0'));var rimraf=require(_0xcc1e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xcc1e('0x2'));var moment=require(_0xcc1e('0x3'));var BPromise=require(_0xcc1e('0x4'));var Mustache=require(_0xcc1e('0x5'));var util=require(_0xcc1e('0x6'));var path=require(_0xcc1e('0x7'));var sox=require(_0xcc1e('0x8'));var csv=require('to-csv');var ejs=require(_0xcc1e('0x9'));var fs=require('fs');var fs_extra=require(_0xcc1e('0xa'));var _=require(_0xcc1e('0xb'));var squel=require(_0xcc1e('0xc'));var crypto=require(_0xcc1e('0xd'));var jsforce=require(_0xcc1e('0xe'));var deskjs=require(_0xcc1e('0xf'));var toCsv=require(_0xcc1e('0x10'));var querystring=require(_0xcc1e('0x11'));var Papa=require('papaparse');var Redis=require(_0xcc1e('0x12'));var authService=require(_0xcc1e('0x13'));var qs=require(_0xcc1e('0x14'));var as=require(_0xcc1e('0x15'));var hardwareService=require(_0xcc1e('0x16'));var logger=require(_0xcc1e('0x17'))('api');var utils=require(_0xcc1e('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xcc1e('0x19'));var db=require('../../mysqldb')['db'];config[_0xcc1e('0x1a')]=_['defaults'](config[_0xcc1e('0x1a')],{'host':_0xcc1e('0x1b'),'port':0x18eb});var socket=require(_0xcc1e('0x1c'))(new Redis(config['redis']));require(_0xcc1e('0x1d'))[_0xcc1e('0x1e')](socket);var jayson=require(_0xcc1e('0x1f'));var client=jayson[_0xcc1e('0x20')]['http']({'port':0x232c});function respondWithRpcPromise(_0x538f41,_0x6935b8,_0x303e16,_0x12421e){return new BPromise(function(_0x3233b7,_0x13bcff){var _0x3e743d=_0x12421e||client;return _0x3e743d['request'](_0x538f41,_0x303e16)[_0xcc1e('0x21')](function(_0x45d0cf){logger[_0xcc1e('0x22')](_0xcc1e('0x23'),_0x6935b8,_0xcc1e('0x24'));logger[_0xcc1e('0x25')](_0xcc1e('0x26'),_0x6935b8,'request\x20sent',JSON[_0xcc1e('0x27')](_0x45d0cf));if(_0x45d0cf[_0xcc1e('0x28')]){if(_0x45d0cf[_0xcc1e('0x28')][_0xcc1e('0x29')]===0x1f4){logger[_0xcc1e('0x28')](_0xcc1e('0x23'),_0x6935b8,_0x45d0cf[_0xcc1e('0x28')][_0xcc1e('0x2a')]);return _0x13bcff(_0x45d0cf[_0xcc1e('0x28')][_0xcc1e('0x2a')]);}logger[_0xcc1e('0x28')]('WhatsappAccount,\x20%s,\x20%s',_0x6935b8,_0x45d0cf['error']['message']);return _0x3233b7(_0x45d0cf[_0xcc1e('0x28')][_0xcc1e('0x2a')]);}else{logger[_0xcc1e('0x22')](_0xcc1e('0x23'),_0x6935b8,'request\x20sent');_0x3233b7(_0x45d0cf['result']['message']);}})['catch'](function(_0x2f3cfc){logger['error'](_0xcc1e('0x23'),_0x6935b8,_0x2f3cfc);_0x13bcff(_0x2f3cfc);});});}function respondWithStatusCode(_0x50e615,_0x2f28b3){_0x2f28b3=_0x2f28b3||0xcc;return function(_0x348d0d){if(_0x348d0d){return _0x50e615['sendStatus'](_0x2f28b3);}return _0x50e615[_0xcc1e('0x2b')](_0x2f28b3)[_0xcc1e('0x2c')]();};}function respondWithResult(_0x57df1b,_0x5afbc5){_0x5afbc5=_0x5afbc5||0xc8;return function(_0x498df7){if(_0x498df7){return _0x57df1b[_0xcc1e('0x2b')](_0x5afbc5)[_0xcc1e('0x2d')](_0x498df7);}};}function respondWithFilteredResult(_0x33a840,_0x26f70f){return function(_0x366847){if(_0x366847){var _0x46b719=typeof _0x26f70f[_0xcc1e('0x2e')]==='undefined'&&typeof _0x26f70f[_0xcc1e('0x2f')]==='undefined';var _0x59c4ee=_0x366847[_0xcc1e('0x30')];var _0xdb917c=_0x46b719?0x0:_0x26f70f[_0xcc1e('0x2e')];var _0x502e14=_0x46b719?_0x366847[_0xcc1e('0x30')]:_0x26f70f[_0xcc1e('0x2e')]+_0x26f70f[_0xcc1e('0x2f')];var _0x376977;if(_0x502e14>=_0x59c4ee){_0x502e14=_0x59c4ee;_0x376977=0xc8;}else{_0x376977=0xce;}_0x33a840['status'](_0x376977);return _0x33a840[_0xcc1e('0x31')]('Content-Range',_0xdb917c+'-'+_0x502e14+'/'+_0x59c4ee)['json'](_0x366847);}return null;};}function patchUpdates(_0x552c67){return function(_0x1d3afb){try{jsonpatch[_0xcc1e('0x32')](_0x1d3afb,_0x552c67,!![]);}catch(_0x6bc379){return BPromise[_0xcc1e('0x33')](_0x6bc379);}return _0x1d3afb[_0xcc1e('0x34')]();};}function saveUpdates(_0x1b1b32,_0x39db85){return function(_0x29a308){if(_0x29a308){return _0x29a308['update'](_0x1b1b32)[_0xcc1e('0x21')](function(_0x2e6b0e){return _0x2e6b0e;});}return null;};}function removeEntity(_0x107fa9,_0x5eb2be){return function(_0xb1a0c8){if(_0xb1a0c8){return _0xb1a0c8[_0xcc1e('0x35')]()[_0xcc1e('0x21')](function(){var _0x40ec74=_0xb1a0c8[_0xcc1e('0x36')]({'plain':!![]});var _0x557d30=_0xcc1e('0x37');return db['UserProfileResource'][_0xcc1e('0x35')]({'where':{'type':_0x557d30,'resourceId':_0x40ec74['id']}})[_0xcc1e('0x21')](function(){return _0xb1a0c8;});})[_0xcc1e('0x21')](function(){_0x107fa9[_0xcc1e('0x2b')](0xcc)[_0xcc1e('0x2c')]();});}};}function handleEntityNotFound(_0x45ff5e,_0xc0ae9){return function(_0x1f54d3){if(!_0x1f54d3){_0x45ff5e[_0xcc1e('0x38')](0x194);}return _0x1f54d3;};}function handleError(_0x153ad4,_0x11e421){_0x11e421=_0x11e421||0x1f4;return function(_0x15eaf6){logger['error'](_0x15eaf6['stack']);if(_0x15eaf6[_0xcc1e('0x39')]){delete _0x15eaf6[_0xcc1e('0x39')];}_0x153ad4['status'](_0x11e421)[_0xcc1e('0x3a')](_0x15eaf6);};}exports[_0xcc1e('0x3b')]=function(_0x205476,_0x2d9662){var _0x4fa8e0={'include':[{'model':db[_0xcc1e('0x3c')],'as':_0xcc1e('0x3d')}]},_0x2ba331={},_0x409dd4={'count':0x0,'rows':[]};var _0x3a7cfe=_[_0xcc1e('0x3e')](db[_0xcc1e('0x3f')][_0xcc1e('0x40')],function(_0x49f7aa){return{'name':_0x49f7aa['fieldName'],'type':_0x49f7aa['type'][_0xcc1e('0x41')]};});_0x2ba331['model']=_[_0xcc1e('0x3e')](_0x3a7cfe,_0xcc1e('0x39'));_0x2ba331[_0xcc1e('0x42')]=_[_0xcc1e('0x43')](_0x205476['query']);_0x2ba331[_0xcc1e('0x44')]=_[_0xcc1e('0x45')](_0x2ba331[_0xcc1e('0x46')],_0x2ba331['query']);_0x4fa8e0[_0xcc1e('0x47')]=_['intersection'](_0x2ba331[_0xcc1e('0x46')],qs[_0xcc1e('0x48')](_0x205476[_0xcc1e('0x42')][_0xcc1e('0x48')]));_0x4fa8e0['attributes']=_0x4fa8e0['attributes'][_0xcc1e('0x49')]?_0x4fa8e0[_0xcc1e('0x47')]:_0x2ba331[_0xcc1e('0x46')];if(!_0x205476[_0xcc1e('0x42')][_0xcc1e('0x4a')](_0xcc1e('0x4b'))){_0x4fa8e0[_0xcc1e('0x2f')]=qs['limit'](_0x205476['query'][_0xcc1e('0x2f')]);_0x4fa8e0[_0xcc1e('0x2e')]=qs[_0xcc1e('0x2e')](_0x205476[_0xcc1e('0x42')][_0xcc1e('0x2e')]);}_0x4fa8e0[_0xcc1e('0x4c')]=qs[_0xcc1e('0x4d')](_0x205476['query'][_0xcc1e('0x4d')]);_0x4fa8e0[_0xcc1e('0x4e')]=qs[_0xcc1e('0x44')](_[_0xcc1e('0x4f')](_0x205476['query'],_0x2ba331[_0xcc1e('0x44')]),_0x3a7cfe);if(_0x205476[_0xcc1e('0x42')][_0xcc1e('0x50')]){_0x4fa8e0[_0xcc1e('0x4e')]=_[_0xcc1e('0x51')](_0x4fa8e0['where'],{'$or':_['map'](_0x3a7cfe,function(_0x47a7b5){if(_0x47a7b5['type']!==_0xcc1e('0x52')){var _0x5f53e5={};_0x5f53e5[_0x47a7b5[_0xcc1e('0x39')]]={'$like':'%'+_0x205476['query'][_0xcc1e('0x50')]+'%'};return _0x5f53e5;}})});}_0x4fa8e0=_[_0xcc1e('0x51')]({},_0x4fa8e0,_0x205476[_0xcc1e('0x53')]);var _0x56f6e4={'where':_0x4fa8e0[_0xcc1e('0x4e')]};return db[_0xcc1e('0x3f')][_0xcc1e('0x30')](_0x56f6e4)['then'](function(_0x4e547c){_0x409dd4[_0xcc1e('0x30')]=_0x4e547c;if(_0x205476[_0xcc1e('0x42')]['includeAll']){_0x4fa8e0['include']=[{'all':!![]}];}return db[_0xcc1e('0x3f')][_0xcc1e('0x54')](_0x4fa8e0);})['then'](function(_0x30b96c){_0x409dd4[_0xcc1e('0x55')]=_0x30b96c;return _0x409dd4;})[_0xcc1e('0x21')](respondWithFilteredResult(_0x2d9662,_0x4fa8e0))['catch'](handleError(_0x2d9662,null));};exports[_0xcc1e('0x56')]=function(_0x5b1bbc,_0x456816){var _0x51f053={'raw':![],'where':{'id':_0x5b1bbc['params']['id']},'include':[{'model':db[_0xcc1e('0x3c')],'as':_0xcc1e('0x3d')}]},_0x4dde42={};_0x4dde42[_0xcc1e('0x46')]=_[_0xcc1e('0x43')](db[_0xcc1e('0x3f')][_0xcc1e('0x40')]);_0x4dde42[_0xcc1e('0x42')]=_[_0xcc1e('0x43')](_0x5b1bbc['query']);_0x4dde42[_0xcc1e('0x44')]=_[_0xcc1e('0x45')](_0x4dde42[_0xcc1e('0x46')],_0x4dde42[_0xcc1e('0x42')]);_0x51f053[_0xcc1e('0x47')]=_['intersection'](_0x4dde42[_0xcc1e('0x46')],qs['fields'](_0x5b1bbc[_0xcc1e('0x42')][_0xcc1e('0x48')]));_0x51f053[_0xcc1e('0x47')]=_0x51f053[_0xcc1e('0x47')][_0xcc1e('0x49')]?_0x51f053[_0xcc1e('0x47')]:_0x4dde42[_0xcc1e('0x46')];if(_0x5b1bbc[_0xcc1e('0x42')][_0xcc1e('0x57')]){_0x51f053['include']=[{'all':!![]}];}_0x51f053=_['merge']({},_0x51f053,_0x5b1bbc['options']);return db[_0xcc1e('0x3f')][_0xcc1e('0x58')](_0x51f053)[_0xcc1e('0x21')](handleEntityNotFound(_0x456816,null))['then'](respondWithResult(_0x456816,null))[_0xcc1e('0x59')](handleError(_0x456816,null));};exports['create']=function(_0x249606,_0x78b7c){return db[_0xcc1e('0x3f')][_0xcc1e('0x5a')](_0x249606[_0xcc1e('0x5b')],{})[_0xcc1e('0x21')](function(_0x26dd79){var _0x34d70b=_0x249606[_0xcc1e('0x5c')]['get']({'plain':!![]});if(!_0x34d70b)throw new Error(_0xcc1e('0x5d'));if(_0x34d70b['role']===_0xcc1e('0x5c')){var _0x396796=_0x26dd79[_0xcc1e('0x36')]({'plain':!![]});var _0x72b783=_0xcc1e('0x37');return db['UserProfileSection']['find']({'where':{'name':_0x72b783,'userProfileId':_0x34d70b[_0xcc1e('0x5e')]},'raw':!![]})[_0xcc1e('0x21')](function(_0x472b97){if(_0x472b97&&_0x472b97['autoAssociation']===0x0){return db['UserProfileResource'][_0xcc1e('0x5a')]({'name':_0x396796[_0xcc1e('0x39')],'resourceId':_0x396796['id'],'type':_0x472b97['name'],'sectionId':_0x472b97['id']},{})[_0xcc1e('0x21')](function(){return _0x26dd79;});}else{return _0x26dd79;}})[_0xcc1e('0x59')](function(_0x4001b3){logger['error'](_0xcc1e('0x5f'),_0x4001b3);throw _0x4001b3;});}return _0x26dd79;})[_0xcc1e('0x21')](respondWithResult(_0x78b7c,0xc9))[_0xcc1e('0x59')](handleError(_0x78b7c,null));};exports['update']=function(_0x20dd3e,_0x3c317e){if(_0x20dd3e[_0xcc1e('0x5b')]['id']){delete _0x20dd3e['body']['id'];}return db[_0xcc1e('0x3f')][_0xcc1e('0x58')]({'where':{'id':_0x20dd3e['params']['id']},'include':[{'model':db[_0xcc1e('0x3c')],'as':_0xcc1e('0x3d')}]})[_0xcc1e('0x21')](handleEntityNotFound(_0x3c317e,null))[_0xcc1e('0x21')](saveUpdates(_0x20dd3e[_0xcc1e('0x5b')],null))['then'](respondWithResult(_0x3c317e,null))[_0xcc1e('0x59')](handleError(_0x3c317e,null));};exports[_0xcc1e('0x35')]=function(_0x45c5e0,_0x3b3a61){return db[_0xcc1e('0x3f')][_0xcc1e('0x58')]({'where':{'id':_0x45c5e0[_0xcc1e('0x60')]['id']}})[_0xcc1e('0x21')](handleEntityNotFound(_0x3b3a61,null))[_0xcc1e('0x21')](removeEntity(_0x3b3a61,null))[_0xcc1e('0x59')](handleError(_0x3b3a61,null));};exports[_0xcc1e('0x61')]=function(_0x54add2,_0x72fc48){return db[_0xcc1e('0x3f')][_0xcc1e('0x61')]()[_0xcc1e('0x21')](respondWithResult(_0x72fc48,null))[_0xcc1e('0x59')](handleError(_0x72fc48,null));};exports[_0xcc1e('0x62')]=function(_0x66bfca,_0x19f1e5,_0x2ab8b1){if(_0x66bfca[_0xcc1e('0x5b')]['id']){delete _0x66bfca[_0xcc1e('0x5b')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x66bfca[_0xcc1e('0x60')]['id']}})[_0xcc1e('0x21')](handleEntityNotFound(_0x19f1e5,null))[_0xcc1e('0x21')](function(_0x5083b8){if(_0x5083b8){_0x66bfca['body']['WhatsappAccountId']=_0x5083b8['id'];return db[_0xcc1e('0x63')][_0xcc1e('0x5a')](_0x66bfca['body']);}})[_0xcc1e('0x21')](respondWithResult(_0x19f1e5,null))['catch'](handleError(_0x19f1e5,null));};exports[_0xcc1e('0x64')]=function(_0x196fed,_0x82f04e,_0x4d7228){var _0x584c5e={'raw':![],'where':{}};var _0x5833e2={};var _0x3244bf={'count':0x0,'rows':[]};return db[_0xcc1e('0x3f')]['findOne']({'where':{'id':_0x196fed[_0xcc1e('0x60')]['id']}})[_0xcc1e('0x21')](handleEntityNotFound(_0x82f04e,null))[_0xcc1e('0x21')](function(_0x2ca82f){if(_0x2ca82f){_0x5833e2[_0xcc1e('0x46')]=_[_0xcc1e('0x43')](db[_0xcc1e('0x63')][_0xcc1e('0x40')]);_0x5833e2[_0xcc1e('0x42')]=_[_0xcc1e('0x43')](_0x196fed['query']);_0x5833e2['filters']=_[_0xcc1e('0x45')](_0x5833e2[_0xcc1e('0x46')],_0x5833e2['query']);_0x584c5e[_0xcc1e('0x47')]=_[_0xcc1e('0x45')](_0x5833e2[_0xcc1e('0x46')],qs[_0xcc1e('0x48')](_0x196fed['query'][_0xcc1e('0x48')]));_0x584c5e[_0xcc1e('0x47')]=_0x584c5e['attributes'][_0xcc1e('0x49')]?_0x584c5e[_0xcc1e('0x47')]:_0x5833e2[_0xcc1e('0x46')];if(!_0x196fed[_0xcc1e('0x42')][_0xcc1e('0x4a')](_0xcc1e('0x4b'))){_0x584c5e['limit']=qs[_0xcc1e('0x2f')](_0x196fed[_0xcc1e('0x42')][_0xcc1e('0x2f')]);_0x584c5e[_0xcc1e('0x2e')]=qs['offset'](_0x196fed[_0xcc1e('0x42')]['offset']);}_0x584c5e[_0xcc1e('0x4c')]=qs['sort'](_0x196fed['query'][_0xcc1e('0x4d')]);_0x584c5e['where']=qs[_0xcc1e('0x44')](_[_0xcc1e('0x4f')](_0x196fed[_0xcc1e('0x42')],_0x5833e2[_0xcc1e('0x44')]));_0x584c5e[_0xcc1e('0x4e')][_0xcc1e('0x65')]=_0x2ca82f['id'];if(_0x196fed[_0xcc1e('0x42')][_0xcc1e('0x50')]){_0x584c5e[_0xcc1e('0x4e')]=_[_0xcc1e('0x51')](_0x584c5e[_0xcc1e('0x4e')],{'$or':_[_0xcc1e('0x3e')](_0x584c5e['attributes'],function(_0x54a367){var _0x4f5292={};_0x4f5292[_0x54a367]={'$like':'%'+_0x196fed[_0xcc1e('0x42')]['filter']+'%'};return _0x4f5292;})});}_0x584c5e=_[_0xcc1e('0x51')]({},_0x584c5e,_0x196fed[_0xcc1e('0x53')]);return db[_0xcc1e('0x63')][_0xcc1e('0x30')]({'where':_0x584c5e[_0xcc1e('0x4e')]})[_0xcc1e('0x21')](function(_0x45e116){_0x3244bf[_0xcc1e('0x30')]=_0x45e116;if(_0x196fed['query'][_0xcc1e('0x57')]){_0x584c5e[_0xcc1e('0x66')]=[{'all':!![]}];}return db[_0xcc1e('0x63')][_0xcc1e('0x54')](_0x584c5e);})['then'](function(_0x5c48c6){_0x3244bf[_0xcc1e('0x55')]=_0x5c48c6;return _0x3244bf;});}})[_0xcc1e('0x21')](respondWithFilteredResult(_0x82f04e,_0x584c5e))[_0xcc1e('0x59')](handleError(_0x82f04e,null));};exports[_0xcc1e('0x67')]=function(_0x72b3f5,_0x281a6f,_0xc99581){return db[_0xcc1e('0x3f')][_0xcc1e('0x58')]({'where':{'id':_0x72b3f5[_0xcc1e('0x60')]['id']}})['then'](handleEntityNotFound(_0x281a6f,null))[_0xcc1e('0x21')](function(_0x586b30){if(_0x586b30){return _0x586b30[_0xcc1e('0x67')](_0x72b3f5[_0xcc1e('0x42')][_0xcc1e('0x68')]);}})[_0xcc1e('0x21')](respondWithStatusCode(_0x281a6f,null))[_0xcc1e('0x59')](handleError(_0x281a6f,null));};exports[_0xcc1e('0x69')]=function(_0x4cbdba,_0x2937ed,_0x554eaa){if(_0x4cbdba[_0xcc1e('0x5b')]['id']){delete _0x4cbdba[_0xcc1e('0x5b')]['id'];}return db[_0xcc1e('0x3f')]['find']({'where':{'id':_0x4cbdba['params']['id']}})['then'](handleEntityNotFound(_0x2937ed,null))[_0xcc1e('0x21')](function(_0x331706){if(_0x331706){_0x4cbdba[_0xcc1e('0x5b')][_0xcc1e('0x65')]=_0x331706['id'];return db[_0xcc1e('0x6a')]['create'](_0x4cbdba[_0xcc1e('0x5b')]);}})[_0xcc1e('0x21')](respondWithResult(_0x2937ed,null))[_0xcc1e('0x59')](handleError(_0x2937ed,null));};exports[_0xcc1e('0x6b')]=function(_0x8e252f,_0x57f290,_0x7c0b0a){var _0x443a1b={'raw':![],'where':{}};var _0x501cd9={};var _0x2f3d09={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0xcc1e('0x6c')]({'where':{'id':_0x8e252f[_0xcc1e('0x60')]['id']}})[_0xcc1e('0x21')](handleEntityNotFound(_0x57f290,null))[_0xcc1e('0x21')](function(_0x44f61f){if(_0x44f61f){_0x501cd9[_0xcc1e('0x46')]=_['keys'](db[_0xcc1e('0x6a')][_0xcc1e('0x40')]);_0x501cd9['query']=_[_0xcc1e('0x43')](_0x8e252f[_0xcc1e('0x42')]);_0x501cd9[_0xcc1e('0x44')]=_[_0xcc1e('0x45')](_0x501cd9[_0xcc1e('0x46')],_0x501cd9[_0xcc1e('0x42')]);_0x443a1b[_0xcc1e('0x47')]=_['intersection'](_0x501cd9[_0xcc1e('0x46')],qs['fields'](_0x8e252f[_0xcc1e('0x42')]['fields']));_0x443a1b[_0xcc1e('0x47')]=_0x443a1b['attributes'][_0xcc1e('0x49')]?_0x443a1b[_0xcc1e('0x47')]:_0x501cd9['model'];if(!_0x8e252f[_0xcc1e('0x42')][_0xcc1e('0x4a')](_0xcc1e('0x4b'))){_0x443a1b[_0xcc1e('0x2f')]=qs[_0xcc1e('0x2f')](_0x8e252f[_0xcc1e('0x42')][_0xcc1e('0x2f')]);_0x443a1b[_0xcc1e('0x2e')]=qs['offset'](_0x8e252f[_0xcc1e('0x42')][_0xcc1e('0x2e')]);}_0x443a1b['order']=qs[_0xcc1e('0x4d')](_0x8e252f['query'][_0xcc1e('0x4d')]);_0x443a1b['where']=qs[_0xcc1e('0x44')](_['pick'](_0x8e252f['query'],_0x501cd9['filters']));_0x443a1b[_0xcc1e('0x4e')][_0xcc1e('0x65')]=_0x44f61f['id'];if(_0x8e252f[_0xcc1e('0x42')][_0xcc1e('0x50')]){_0x443a1b[_0xcc1e('0x4e')]=_[_0xcc1e('0x51')](_0x443a1b['where'],{'$or':_['map'](_0x443a1b[_0xcc1e('0x47')],function(_0x426c31){var _0x49e99e={};_0x49e99e[_0x426c31]={'$like':'%'+_0x8e252f['query'][_0xcc1e('0x50')]+'%'};return _0x49e99e;})});}_0x443a1b=_[_0xcc1e('0x51')]({},_0x443a1b,_0x8e252f['options']);return db['CannedAnswer'][_0xcc1e('0x30')]({'where':_0x443a1b['where']})[_0xcc1e('0x21')](function(_0x4ca04b){_0x2f3d09['count']=_0x4ca04b;if(_0x8e252f['query'][_0xcc1e('0x57')]){_0x443a1b[_0xcc1e('0x66')]=[{'all':!![]}];}return db[_0xcc1e('0x6a')][_0xcc1e('0x54')](_0x443a1b);})['then'](function(_0x44aef5){_0x2f3d09['rows']=_0x44aef5;return _0x2f3d09;});}})[_0xcc1e('0x21')](respondWithFilteredResult(_0x57f290,_0x443a1b))[_0xcc1e('0x59')](handleError(_0x57f290,null));};exports['removeAnswers']=function(_0x388d41,_0x12f753,_0x41c30d){return db['WhatsappAccount'][_0xcc1e('0x58')]({'where':{'id':_0x388d41[_0xcc1e('0x60')]['id']}})[_0xcc1e('0x21')](handleEntityNotFound(_0x12f753,null))[_0xcc1e('0x21')](function(_0x377dc3){if(_0x377dc3){return _0x377dc3[_0xcc1e('0x6d')](_0x388d41[_0xcc1e('0x42')][_0xcc1e('0x68')]);}})[_0xcc1e('0x21')](respondWithStatusCode(_0x12f753,null))[_0xcc1e('0x59')](handleError(_0x12f753,null));};exports[_0xcc1e('0x6e')]=function(_0x159cda,_0x117c57,_0x458fec){return db['WhatsappAccount'][_0xcc1e('0x58')]({'where':{'id':_0x159cda[_0xcc1e('0x60')]['id']}})[_0xcc1e('0x21')](handleEntityNotFound(_0x117c57,null))[_0xcc1e('0x21')](function(_0x48cbbf){if(_0x48cbbf){return _0x48cbbf[_0xcc1e('0x6e')](_0x159cda[_0xcc1e('0x5b')][_0xcc1e('0x68')],_[_0xcc1e('0x6f')](_0x159cda['body'],[_0xcc1e('0x68'),'id'])||{})[_0xcc1e('0x70')](function(_0x34fbea){for(var _0x30aa26=0x0;_0x30aa26<_0x159cda[_0xcc1e('0x5b')][_0xcc1e('0x68')][_0xcc1e('0x49')];_0x30aa26+=0x1){socket[_0xcc1e('0x71')](_0xcc1e('0x72'),{'UserId':Number(_0x159cda[_0xcc1e('0x5b')]['ids'][_0x30aa26]),'WhatsappAccountId':Number(_0x159cda['params']['id'])});}return _0x34fbea;});}})[_0xcc1e('0x21')](respondWithResult(_0x117c57,null))[_0xcc1e('0x59')](handleError(_0x117c57,null));};exports[_0xcc1e('0x73')]=function(_0x48a74c,_0x1b5477,_0x35fa0b){return db['WhatsappAccount'][_0xcc1e('0x58')]({'where':{'id':_0x48a74c['params']['id']}})[_0xcc1e('0x21')](handleEntityNotFound(_0x1b5477,null))[_0xcc1e('0x21')](function(_0x463f1a){if(_0x463f1a){return _0x463f1a[_0xcc1e('0x73')](_0x48a74c[_0xcc1e('0x42')][_0xcc1e('0x68')])[_0xcc1e('0x21')](function(){if(_['isArray'](_0x48a74c['query'][_0xcc1e('0x68')])){for(var _0x5ad58e=0x0;_0x5ad58e<_0x48a74c[_0xcc1e('0x42')]['ids'][_0xcc1e('0x49')];_0x5ad58e+=0x1){socket['emit'](_0xcc1e('0x74'),{'UserId':Number(_0x48a74c['query']['ids'][_0x5ad58e]),'WhatsappAccountId':Number(_0x48a74c[_0xcc1e('0x60')]['id'])});}}else{socket['emit'](_0xcc1e('0x74'),{'UserId':Number(_0x48a74c[_0xcc1e('0x42')][_0xcc1e('0x68')]),'WhatsappAccountId':Number(_0x48a74c[_0xcc1e('0x60')]['id'])});}});}})[_0xcc1e('0x21')](respondWithStatusCode(_0x1b5477,null))[_0xcc1e('0x59')](handleError(_0x1b5477,null));};exports['getAgents']=function(_0x2b9b9b,_0x49aa91,_0xa9358d){var _0x2a5875={};var _0x544bd8={};var _0x183d44;var _0x298253;return db[_0xcc1e('0x3f')][_0xcc1e('0x6c')]({'where':{'id':_0x2b9b9b[_0xcc1e('0x60')]['id']}})[_0xcc1e('0x21')](handleEntityNotFound(_0x49aa91,null))[_0xcc1e('0x21')](function(_0x39d1ad){if(_0x39d1ad){_0x183d44=_0x39d1ad;_0x544bd8[_0xcc1e('0x46')]=_[_0xcc1e('0x43')](db[_0xcc1e('0x75')][_0xcc1e('0x40')]);_0x544bd8['query']=_[_0xcc1e('0x43')](_0x2b9b9b[_0xcc1e('0x42')]);_0x544bd8[_0xcc1e('0x44')]=_[_0xcc1e('0x45')](_0x544bd8['model'],_0x544bd8['query']);_0x2a5875[_0xcc1e('0x47')]=_['intersection'](_0x544bd8['model'],qs['fields'](_0x2b9b9b[_0xcc1e('0x42')][_0xcc1e('0x48')]));_0x2a5875['attributes']=_0x2a5875[_0xcc1e('0x47')][_0xcc1e('0x49')]?_0x2a5875[_0xcc1e('0x47')]:_0x544bd8[_0xcc1e('0x46')];_0x2a5875['order']=qs['sort'](_0x2b9b9b[_0xcc1e('0x42')]['sort']);_0x2a5875[_0xcc1e('0x4e')]=qs[_0xcc1e('0x44')](_[_0xcc1e('0x4f')](_0x2b9b9b[_0xcc1e('0x42')],_0x544bd8[_0xcc1e('0x44')]));if(_0x2b9b9b[_0xcc1e('0x42')][_0xcc1e('0x50')]){_0x2a5875[_0xcc1e('0x4e')]=_[_0xcc1e('0x51')](_0x2a5875[_0xcc1e('0x4e')],{'$or':_[_0xcc1e('0x3e')](_0x2a5875['attributes'],function(_0x3b1629){var _0x3a3a21={};_0x3a3a21[_0x3b1629]={'$like':'%'+_0x2b9b9b[_0xcc1e('0x42')][_0xcc1e('0x50')]+'%'};return _0x3a3a21;})});}_0x2a5875=_[_0xcc1e('0x51')]({},_0x2a5875,_0x2b9b9b[_0xcc1e('0x53')]);return _0x183d44['getAgents'](_0x2a5875);}})[_0xcc1e('0x21')](function(_0x3b4d74){if(_0x3b4d74){_0x298253=_0x3b4d74[_0xcc1e('0x49')];if(!_0x2b9b9b[_0xcc1e('0x42')][_0xcc1e('0x4a')]('nolimit')){_0x2a5875[_0xcc1e('0x2f')]=qs[_0xcc1e('0x2f')](_0x2b9b9b[_0xcc1e('0x42')]['limit']);_0x2a5875[_0xcc1e('0x2e')]=qs[_0xcc1e('0x2e')](_0x2b9b9b['query'][_0xcc1e('0x2e')]);}return _0x183d44[_0xcc1e('0x76')](_0x2a5875);}})[_0xcc1e('0x21')](function(_0x28f0d0){if(_0x28f0d0){return _0x28f0d0?{'count':_0x298253,'rows':_0x28f0d0}:null;}})[_0xcc1e('0x21')](respondWithResult(_0x49aa91,null))[_0xcc1e('0x59')](handleError(_0x49aa91,null));};exports['addApplications']=function(_0x28a82a,_0xd5dcc6){var _0x241454=_0x28a82a[_0xcc1e('0x60')]['id'];var _0x665dae=_0x28a82a['body'];var _0x29c045=0xc8;var _0x215b46=null;return db[_0xcc1e('0x77')][_0xcc1e('0x78')]({'isolationLevel':db['sequelize'][_0xcc1e('0x79')][_0xcc1e('0x7a')][_0xcc1e('0x7b')]},function(_0x17552e){return db['WhatsappAccount']['findOne']({'where':{'id':_0x241454},'transaction':_0x17552e})[_0xcc1e('0x21')](function(_0x29e182){if(_0x29e182){return db[_0xcc1e('0x7c')][_0xcc1e('0x35')]({'where':{'WhatsappAccountId':_0x241454},'transaction':_0x17552e})[_0xcc1e('0x21')](function(){var _0x364f1e=_[_0xcc1e('0x3e')](_0x665dae,function(_0x1a44f0){_0x1a44f0[_0xcc1e('0x65')]=_0x241454;return _0x1a44f0;});return db[_0xcc1e('0x7c')][_0xcc1e('0x7d')](_0x364f1e,{'transaction':_0x17552e});});}else{_0x29c045=0x194;_0x215b46=[];}});})[_0xcc1e('0x21')](function(){if(_0x29c045!==0x194){return db['WhatsappApplication'][_0xcc1e('0x7e')]({'where':{'WhatsappAccountId':_0x241454},'order':_0xcc1e('0x7f')})[_0xcc1e('0x21')](function(_0x541ef8){_0x215b46=_0x541ef8;});}})['catch'](function(_0x1c0b41){_0x29c045=0x1f4;logger[_0xcc1e('0x28')](_0x1c0b41[_0xcc1e('0x80')]);if(_0x1c0b41[_0xcc1e('0x39')]){delete _0x1c0b41['name'];}_0x215b46=_0x1c0b41;})[_0xcc1e('0x81')](function(){if(_0x215b46===null){_0xd5dcc6[_0xcc1e('0x38')](_0x29c045);}else{if(_0x29c045===0x1f4){_0xd5dcc6[_0xcc1e('0x2b')](_0x29c045)['send'](_0x215b46);}else{_0xd5dcc6[_0xcc1e('0x2b')](_0x29c045)[_0xcc1e('0x2d')](_0x215b46);}}});};exports['getApplications']=function(_0x1c4cf7,_0x114289,_0x33ebfe){var _0x4fda5e={};var _0x3aac53={};var _0x590076;var _0x5cff90;return db[_0xcc1e('0x3f')]['findOne']({'where':{'id':_0x1c4cf7[_0xcc1e('0x60')]['id']}})[_0xcc1e('0x21')](handleEntityNotFound(_0x114289,null))[_0xcc1e('0x21')](function(_0x13c482){if(_0x13c482){_0x590076=_0x13c482;_0x3aac53[_0xcc1e('0x46')]=_[_0xcc1e('0x43')](db[_0xcc1e('0x7c')]['rawAttributes']);_0x3aac53['query']=_[_0xcc1e('0x43')](_0x1c4cf7[_0xcc1e('0x42')]);_0x3aac53['filters']=_[_0xcc1e('0x45')](_0x3aac53[_0xcc1e('0x46')],_0x3aac53['query']);_0x4fda5e['attributes']=_['intersection'](_0x3aac53[_0xcc1e('0x46')],qs[_0xcc1e('0x48')](_0x1c4cf7[_0xcc1e('0x42')][_0xcc1e('0x48')]));_0x4fda5e[_0xcc1e('0x47')]=_0x4fda5e[_0xcc1e('0x47')][_0xcc1e('0x49')]?_0x4fda5e[_0xcc1e('0x47')]:_0x3aac53['model'];_0x4fda5e['order']=qs['sort'](_0x1c4cf7['query'][_0xcc1e('0x4d')]);_0x4fda5e[_0xcc1e('0x4e')]=qs[_0xcc1e('0x44')](_[_0xcc1e('0x4f')](_0x1c4cf7['query'],_0x3aac53['filters']));if(_0x1c4cf7[_0xcc1e('0x42')][_0xcc1e('0x50')]){_0x4fda5e['where']=_[_0xcc1e('0x51')](_0x4fda5e[_0xcc1e('0x4e')],{'$or':_[_0xcc1e('0x3e')](_0x4fda5e['attributes'],function(_0x414a70){var _0x2e3eca={};_0x2e3eca[_0x414a70]={'$like':'%'+_0x1c4cf7[_0xcc1e('0x42')][_0xcc1e('0x50')]+'%'};return _0x2e3eca;})});}_0x4fda5e=_[_0xcc1e('0x51')]({},_0x4fda5e,_0x1c4cf7['options']);return _0x590076[_0xcc1e('0x82')](_0x4fda5e);}})[_0xcc1e('0x21')](function(_0x5472a0){if(_0x5472a0){_0x5cff90=_0x5472a0[_0xcc1e('0x49')];if(!_0x1c4cf7[_0xcc1e('0x42')][_0xcc1e('0x4a')](_0xcc1e('0x4b'))){_0x4fda5e[_0xcc1e('0x2f')]=qs[_0xcc1e('0x2f')](_0x1c4cf7['query'][_0xcc1e('0x2f')]);_0x4fda5e['offset']=qs[_0xcc1e('0x2e')](_0x1c4cf7[_0xcc1e('0x42')][_0xcc1e('0x2e')]);}return _0x590076[_0xcc1e('0x82')](_0x4fda5e);}})[_0xcc1e('0x21')](function(_0x30aa63){if(_0x30aa63){return _0x30aa63?{'count':_0x5cff90,'rows':_0x30aa63}:null;}})[_0xcc1e('0x21')](respondWithResult(_0x114289,null))[_0xcc1e('0x59')](handleError(_0x114289,null));};exports[_0xcc1e('0x83')]=function(_0x5d61a4,_0x30a1be,_0x7b68f3){var _0xd55de={'channel':_0xcc1e('0x84')};var _0x13cad8=[];var _0x10f053=[];var _0x2c8d69={};return db['WhatsappAccount'][_0xcc1e('0x58')]({'where':{'id':_0x5d61a4['params']['id']},'include':[{'model':db['WhatsappApplication'],'as':'Applications'}]})['then'](handleEntityNotFound(_0x30a1be,null))[_0xcc1e('0x21')](function(_0x25a426){_0xd55de['account']=_0x25a426;if(_0xd55de[_0xcc1e('0x85')]&&_0xd55de[_0xcc1e('0x85')][_0xcc1e('0x86')]===_0xcc1e('0x87')&&_0x5d61a4[_0xcc1e('0x5b')][_0xcc1e('0x88')]){if(_0x5d61a4[_0xcc1e('0x5b')][_0xcc1e('0x88')][_0xcc1e('0x49')]===0x0)return;if(_0x5d61a4[_0xcc1e('0x5b')][_0xcc1e('0x88')][0x0][_0xcc1e('0x89')]!==_0xcc1e('0x8a'))return;return db['WhatsappMessage'][_0xcc1e('0x8b')]({'read':!![],'readAt':_0x5d61a4[_0xcc1e('0x5b')][_0xcc1e('0x88')][0x0]['timestamp']},{'where':{'messageId':_0x5d61a4['body'][_0xcc1e('0x88')][0x0]['message_id']},'individualHooks':!![]})[_0xcc1e('0x21')](function(_0x31a4b6){return _0x30a1be[_0xcc1e('0x2b')](0xc8)[_0xcc1e('0x2d')](_0x31a4b6);});}_0xd55de[_0xcc1e('0x8c')]=_[_0xcc1e('0x8d')](_0x25a426[_0xcc1e('0x8e')],[_0xcc1e('0x7f')],['asc']);if(_0xd55de['account'][_0xcc1e('0x8e')]){delete _0xd55de[_0xcc1e('0x85')][_0xcc1e('0x8e')];}return db[_0xcc1e('0x8f')][_0xcc1e('0x61')]()[_0xcc1e('0x21')](function(_0x301cb0){if(!_0x301cb0){throw new db[(_0xcc1e('0x90'))][(_0xcc1e('0x91'))](_0xcc1e('0x92'));}_0x13cad8=_['difference'](_[_0xcc1e('0x43')](_0x301cb0),[_0xcc1e('0x93'),'updatedAt']);_0x10f053=_[_0xcc1e('0x94')](_[_0xcc1e('0x43')](_0x301cb0),['createdAt',_0xcc1e('0x95'),_0xcc1e('0x96'),_0xcc1e('0x97')]);_0xd55de[_0xcc1e('0x5b')]={'mapKey':_0xcc1e('0x98')};if(_0xd55de[_0xcc1e('0x85')]&&_0xd55de[_0xcc1e('0x85')][_0xcc1e('0x86')]===_0xcc1e('0x99')){_0xd55de[_0xcc1e('0x5b')][_0xcc1e('0x9a')]=_0x5d61a4[_0xcc1e('0x5b')][_0xcc1e('0x9b')][_0xcc1e('0x9c')](_0xcc1e('0x9d'),'');_0xd55de[_0xcc1e('0x5b')][_0xcc1e('0x5b')]=_0x5d61a4[_0xcc1e('0x5b')][_0xcc1e('0x9e')];_0xd55de['body'][_0xcc1e('0x9f')]=_0x5d61a4['body'][_0xcc1e('0xa0')];}if(_0xd55de[_0xcc1e('0x85')]&&_0xd55de[_0xcc1e('0x85')][_0xcc1e('0x86')]===_0xcc1e('0x87')){_0xd55de[_0xcc1e('0x5b')][_0xcc1e('0x9a')]=_0x5d61a4['body'][_0xcc1e('0xa1')][0x0][_0xcc1e('0x9a')];_0xd55de[_0xcc1e('0x5b')][_0xcc1e('0x5b')]=_0x5d61a4[_0xcc1e('0x5b')]['notifications'][0x0]['message'][_0xcc1e('0x5b')];_0xd55de[_0xcc1e('0x5b')]['messageId']=_0x5d61a4[_0xcc1e('0x5b')][_0xcc1e('0xa1')][0x0][_0xcc1e('0xa2')];}if(_0xd55de[_0xcc1e('0x5b')]['id']){delete _0xd55de[_0xcc1e('0x5b')]['id'];}if(_[_0xcc1e('0xa3')](_0xd55de['body']['from'])){throw new db['Sequelize'][(_0xcc1e('0x91'))](_0xcc1e('0xa4'));}if(_[_0xcc1e('0xa3')](_0xd55de[_0xcc1e('0x5b')]['body'])||_0xd55de[_0xcc1e('0x5b')][_0xcc1e('0x5b')]===''){throw new db[(_0xcc1e('0x90'))][(_0xcc1e('0x91'))](_0xcc1e('0xa5'));}if(_[_0xcc1e('0xa3')](_0xd55de['body'][_0xcc1e('0xa6')])){throw new db[(_0xcc1e('0x90'))][(_0xcc1e('0x91'))](_0xcc1e('0xa7')+_0x10f053);}if(!_['includes'](_0x10f053,_0xd55de['body'][_0xcc1e('0xa6')])){throw new db[(_0xcc1e('0x90'))][(_0xcc1e('0x91'))](_0xcc1e('0xa8')+_0x10f053);}_0x2c8d69[_0xd55de['body'][_0xcc1e('0xa6')]]=_0xd55de['body'][_0xcc1e('0x9a')];return db[_0xcc1e('0xa9')][_0xcc1e('0x58')]({'where':{'id':_0xd55de[_0xcc1e('0x85')]['ListId']},'include':[{'model':db[_0xcc1e('0x8f')],'as':_0xcc1e('0xaa'),'where':_0x2c8d69,'limit':0x1,'order':[[_0xcc1e('0x95'),_0xcc1e('0xab')]]}]});})[_0xcc1e('0x21')](handleEntityNotFound(_0x30a1be,null))['then'](function(_0x2642cf){if(_0x2642cf){_0xd55de[_0xcc1e('0xac')]=_['omit'](_0x2642cf,[_0xcc1e('0xaa')]);if(_0x2642cf['Contacts'][_0xcc1e('0x49')]){return _0x2642cf[_0xcc1e('0xaa')][0x0];}var _0x203df9=_['defaults'](_0xd55de['body'],{'firstName':_0xd55de['body'][_0xcc1e('0x9a')],'ListId':_0x2642cf['id']});_0x203df9[_0xd55de['body'][_0xcc1e('0xa6')]]=_0xd55de[_0xcc1e('0x5b')]['from'];return db[_0xcc1e('0x8f')][_0xcc1e('0x5a')](_0x203df9,{'fields':_0x13cad8,'raw':!![]});}})[_0xcc1e('0x21')](handleEntityNotFound(_0x30a1be,null))[_0xcc1e('0x21')](function(_0xa6d9d4){if(_0xa6d9d4){_0xd55de[_0xcc1e('0xad')]=_0xa6d9d4;var _0x2597ee={'ContactId':_0xa6d9d4['id'],'phone':_0xd55de[_0xcc1e('0x5b')][_0xcc1e('0x9a')],'WhatsappAccountId':_0x5d61a4['params']['id']};var _0x172b85={'ContactId':_0xa6d9d4['id'],'WhatsappAccountId':_0x5d61a4[_0xcc1e('0x60')]['id'],'closed':![]};return db[_0xcc1e('0xae')]['find']({'where':_0x172b85})['then'](function(_0x210cf2){if(_0x210cf2){return[_0x210cf2,![]];}return db['WhatsappInteraction']['create'](_0x2597ee)['then'](function(_0x49f7a6){return[_0x49f7a6,!![]];});});}})[_0xcc1e('0x70')](function(_0x2bf7c2,_0x33454f){_0xd55de[_0xcc1e('0xaf')]=_0x2bf7c2[_0xcc1e('0x36')]({'plain':!![]});_0xd55de[_0xcc1e('0xaf')]['created']=![];if(_0x33454f){if(_0xd55de[_0xcc1e('0x85')]['autoclose']){_0xd55de[_0xcc1e('0x8c')]['push']({'id':0x0,'priority':_0xd55de['applications'][_0xcc1e('0x49')]+0x1,'app':_0xcc1e('0xb0'),'appdata':_0xcc1e('0xb1'),'interval':'*,*,*,*'});}_0xd55de[_0xcc1e('0xaf')][_0xcc1e('0xb2')]=!![];}return db[_0xcc1e('0xb3')][_0xcc1e('0x5a')]({'phone':_0xd55de['body'][_0xcc1e('0x9a')],'messageId':_0xd55de[_0xcc1e('0x5b')][_0xcc1e('0x9f')],'body':_0xd55de[_0xcc1e('0x5b')][_0xcc1e('0x5b')],'WhatsappAccountId':_0x5d61a4['params']['id'],'WhatsappInteractionId':_0x2bf7c2['id'],'direction':'in','ContactId':_0x2bf7c2['ContactId'],'AttachmentId':_0xd55de[_0xcc1e('0x5b')][_0xcc1e('0xb4')]});})[_0xcc1e('0x21')](function(_0x37d7e5){_0xd55de[_0xcc1e('0x2a')]=_0x37d7e5;if(!_0xd55de[_0xcc1e('0xaf')][_0xcc1e('0xb5')])return;return db[_0xcc1e('0x75')]['find']({'attributes':['id',_0xcc1e('0x39')],'where':{'id':_0xd55de[_0xcc1e('0xaf')]['UserId']}});})[_0xcc1e('0x21')](function(_0xb0317b){if(_0xb0317b){_0xd55de[_0xcc1e('0x8c')][_0xcc1e('0xb6')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xb0317b[_0xcc1e('0x39')]+','+(_0xd55de['account']['waitForTheAssignedAgent']||0xa),'interval':_0xcc1e('0xb7')});}if(!_0xd55de[_0xcc1e('0xaf')]['queueId'])return;return db[_0xcc1e('0xb8')][_0xcc1e('0x58')]({'attributes':['id',_0xcc1e('0x39')],'where':{'id':_0xd55de['interaction'][_0xcc1e('0xb9')]}});})[_0xcc1e('0x21')](function(_0x342391){if(_0x342391){_0xd55de[_0xcc1e('0x8c')][_0xcc1e('0xb6')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x342391[_0xcc1e('0x39')]+','+(_0xd55de['account'][_0xcc1e('0xba')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xcc1e('0xbb'),_0xcc1e('0xbc'),_0xd55de);})[_0xcc1e('0x21')](function(_0x201f02){if(_0x201f02){var _0x30cc60=0xc8;var _0x2d0f7e=_0xcc1e('0xbd');logger[_0xcc1e('0x22')](_0xcc1e('0x26'),_0x2d0f7e,_0x30cc60,'entity\x20found');logger[_0xcc1e('0x25')](_0xcc1e('0xbe'),_0x2d0f7e,_0x30cc60,'entity\x20found',JSON[_0xcc1e('0x27')](_0x201f02));if(_0xd55de['account'][_0xcc1e('0x86')]==='twilio'){return _0x30a1be['status'](_0x30cc60)[_0xcc1e('0x31')](_0xcc1e('0xbf'),'text/xml')[_0xcc1e('0x3a')](_0xcc1e('0xc0'));}else{return _0x30a1be[_0xcc1e('0x2b')](_0x30cc60)[_0xcc1e('0x2d')](_0x201f02);}}});})[_0xcc1e('0x59')](handleError(_0x30a1be,null));};exports[_0xcc1e('0x3a')]=function(_0x1751c9,_0x55e415,_0x41db6d){var _0x4c1169,_0x386681,_0x18d91;if(_['isNil'](_0x1751c9[_0xcc1e('0x5b')][_0xcc1e('0x5b')])||_0x1751c9[_0xcc1e('0x5b')][_0xcc1e('0x5b')]===''){throw new db[(_0xcc1e('0x90'))][(_0xcc1e('0x91'))](_0xcc1e('0xa5'));}if(_[_0xcc1e('0xa3')](_0x1751c9[_0xcc1e('0x5b')]['to'])){throw new db[(_0xcc1e('0x90'))][(_0xcc1e('0x91'))](_0xcc1e('0xc1'));}_0x4c1169=_0x1751c9[_0xcc1e('0x5b')]['to'];return db['WhatsappAccount'][_0xcc1e('0x58')]({'where':{'id':_0x1751c9[_0xcc1e('0x60')]['id']},'include':[{'model':db['CmList'],'as':_0xcc1e('0xc2'),'include':[{'model':db['CmContact'],'as':_0xcc1e('0xaa'),'where':{'mobile':_0x4c1169},'limit':0x1,'order':[[_0xcc1e('0x95'),_0xcc1e('0xab')]]}]}]})[_0xcc1e('0x21')](handleEntityNotFound(_0x55e415,null))['then'](function(_0x35bc85){if(_0x35bc85&&_0x35bc85[_0xcc1e('0xc2')]){_0x386681=_0x35bc85['get']({'plain':!![]});if(_0x386681[_0xcc1e('0xc2')]&&_0x386681['List']['Contacts']['length']){return _0x386681[_0xcc1e('0xc2')][_0xcc1e('0xaa')][0x0];}return db[_0xcc1e('0x8f')][_0xcc1e('0x5a')](_[_0xcc1e('0xc3')](_0x1751c9[_0xcc1e('0x5b')],{'firstName':_0x4c1169,'mobile':_0x4c1169,'phone':_0x4c1169,'ListId':_0x386681[_0xcc1e('0x97')]}));}})[_0xcc1e('0x21')](handleEntityNotFound(_0x55e415,null))['then'](function(_0x1413a9){if(_0x1413a9){_0x18d91=_0x1413a9;return db[_0xcc1e('0xae')]['find']({'where':{'ContactId':_0x18d91['id'],'closed':![],'WhatsappAccountId':_0x386681['id']}})[_0xcc1e('0x21')](function(_0x140cbe){if(_0x140cbe){return[_0x140cbe,![]];}return db[_0xcc1e('0xae')]['create']({'UserId':_0x1751c9[_0xcc1e('0x5c')]['id'],'ContactId':_0x18d91['id'],'WhatsappAccountId':_0x386681['id'],'phone':_0x4c1169,'firstMsgDirection':_0xcc1e('0xc4'),'Messages':[_[_0xcc1e('0x51')](_0x1751c9[_0xcc1e('0x5b')],{'read':![],'body':_0x1751c9[_0xcc1e('0x5b')]['body'],'phone':_0x4c1169,'WhatsappAccountId':_0x386681['id'],'UserId':_0x1751c9[_0xcc1e('0x5c')]['id'],'ContactId':_0x18d91['id']})]},{'include':[{'model':db[_0xcc1e('0xb3')],'as':_0xcc1e('0xc5')}]})[_0xcc1e('0x21')](function(_0x2b8336){return[_0x2b8336,!![]];});});}})[_0xcc1e('0x70')](function(_0x11489f,_0x558def){if(_0x558def){return _0x11489f;}return db[_0xcc1e('0xb3')][_0xcc1e('0x5a')](_['merge'](_0x1751c9[_0xcc1e('0x5b')],{'read':![],'body':_0x1751c9[_0xcc1e('0x5b')]['body'],'phone':_0x4c1169,'WhatsappAccountId':_0x386681['id'],'WhatsappInteractionId':_0x11489f['id'],'UserId':_0x1751c9['user']['id'],'ContactId':_0x18d91['id']}))[_0xcc1e('0x21')](function(_0x299f50){_0x11489f[_0xcc1e('0xc6')]['Messages']=[];_0x11489f['dataValues'][_0xcc1e('0xc5')][_0xcc1e('0xc7')](_0x299f50['dataValues']);return _0x11489f;});})[_0xcc1e('0x21')](respondWithResult(_0x55e415,null))[_0xcc1e('0x59')](handleError(_0x55e415,null));}; \ No newline at end of file +var _0xf9e2=['sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappAccounts','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','WhatsappAccountId','getDispositions','findOne','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','rows','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','User','getAgents','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','send','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','read','WhatsappMessage','timestamp','applications','asc','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','twilio','from','From','whatsapp:','Body','messageId','MessageSid','notifications','message_id','isNil','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','list','Contacts','interaction','autoclose','unmanaged','created','ContactId','AttachmentId','UserId','agent','waitForTheAssignedAgent','*,*,*,*','WhatsappQueue','queueId','queue','waitForTheAssignedQueue','Start','startRouting','receiveMessage','entity\x20found','Content-Type','to\x20is\x20mandatory','List','WhatsappInteraction','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','ejs','lodash','crypto','jsforce','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','jayson/promise','client','http','request','then','info','request\x20sent','stringify','code','error','WhatsappAccount,\x20%s,\x20%s','message','result','catch','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','destroy','get','UserProfileResource','stack','name','index','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x2e725f,_0x4e8f74){var _0x3349db=function(_0x1c3019){while(--_0x1c3019){_0x2e725f['push'](_0x2e725f['shift']());}};_0x3349db(++_0x4e8f74);}(_0xf9e2,0x79));var _0x2f9e=function(_0x25fb5b,_0x24dbbf){_0x25fb5b=_0x25fb5b-0x0;var _0x32038d=_0xf9e2[_0x25fb5b];return _0x32038d;};'use strict';var emlformat=require(_0x2f9e('0x0'));var rimraf=require(_0x2f9e('0x1'));var zipdir=require(_0x2f9e('0x2'));var jsonpatch=require(_0x2f9e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2f9e('0x4'));var Mustache=require(_0x2f9e('0x5'));var util=require('util');var path=require(_0x2f9e('0x6'));var sox=require(_0x2f9e('0x7'));var csv=require('to-csv');var ejs=require(_0x2f9e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2f9e('0x9'));var squel=require('squel');var crypto=require(_0x2f9e('0xa'));var jsforce=require(_0x2f9e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x2f9e('0xc'));var querystring=require('querystring');var Papa=require(_0x2f9e('0xd'));var Redis=require(_0x2f9e('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2f9e('0xf'));var hardwareService=require(_0x2f9e('0x10'));var logger=require(_0x2f9e('0x11'))('api');var utils=require(_0x2f9e('0x12'));var config=require(_0x2f9e('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x2f9e('0x14'))['db'];config[_0x2f9e('0x15')]=_[_0x2f9e('0x16')](config[_0x2f9e('0x15')],{'host':_0x2f9e('0x17'),'port':0x18eb});var socket=require(_0x2f9e('0x18'))(new Redis(config['redis']));require(_0x2f9e('0x19'))['register'](socket);var jayson=require(_0x2f9e('0x1a'));var client=jayson[_0x2f9e('0x1b')][_0x2f9e('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x5bb746,_0x1bdbe1,_0x14efd4,_0x5180cb){return new BPromise(function(_0x99091d,_0x27db7d){var _0x4bd358=_0x5180cb||client;return _0x4bd358[_0x2f9e('0x1d')](_0x5bb746,_0x14efd4)[_0x2f9e('0x1e')](function(_0x3bf954){logger[_0x2f9e('0x1f')]('WhatsappAccount,\x20%s,\x20%s',_0x1bdbe1,_0x2f9e('0x20'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x1bdbe1,'request\x20sent',JSON[_0x2f9e('0x21')](_0x3bf954));if(_0x3bf954['error']){if(_0x3bf954['error'][_0x2f9e('0x22')]===0x1f4){logger[_0x2f9e('0x23')](_0x2f9e('0x24'),_0x1bdbe1,_0x3bf954['error'][_0x2f9e('0x25')]);return _0x27db7d(_0x3bf954[_0x2f9e('0x23')][_0x2f9e('0x25')]);}logger['error'](_0x2f9e('0x24'),_0x1bdbe1,_0x3bf954['error']['message']);return _0x99091d(_0x3bf954[_0x2f9e('0x23')][_0x2f9e('0x25')]);}else{logger[_0x2f9e('0x1f')](_0x2f9e('0x24'),_0x1bdbe1,_0x2f9e('0x20'));_0x99091d(_0x3bf954[_0x2f9e('0x26')][_0x2f9e('0x25')]);}})[_0x2f9e('0x27')](function(_0x55eacc){logger['error'](_0x2f9e('0x24'),_0x1bdbe1,_0x55eacc);_0x27db7d(_0x55eacc);});});}function respondWithStatusCode(_0xb820f0,_0x3c2ffc){_0x3c2ffc=_0x3c2ffc||0xcc;return function(_0x34eba7){if(_0x34eba7){return _0xb820f0['sendStatus'](_0x3c2ffc);}return _0xb820f0[_0x2f9e('0x28')](_0x3c2ffc)[_0x2f9e('0x29')]();};}function respondWithResult(_0x241920,_0x54881e){_0x54881e=_0x54881e||0xc8;return function(_0xef7f3b){if(_0xef7f3b){return _0x241920[_0x2f9e('0x28')](_0x54881e)['json'](_0xef7f3b);}};}function respondWithFilteredResult(_0x1df155,_0x1157de){return function(_0x4f00fd){if(_0x4f00fd){var _0x271b2b=typeof _0x1157de[_0x2f9e('0x2a')]===_0x2f9e('0x2b')&&typeof _0x1157de[_0x2f9e('0x2c')]===_0x2f9e('0x2b');var _0x56b0a7=_0x4f00fd[_0x2f9e('0x2d')];var _0xf072a5=_0x271b2b?0x0:_0x1157de[_0x2f9e('0x2a')];var _0x2d3bc0=_0x271b2b?_0x4f00fd[_0x2f9e('0x2d')]:_0x1157de['offset']+_0x1157de[_0x2f9e('0x2c')];var _0x51079b;if(_0x2d3bc0>=_0x56b0a7){_0x2d3bc0=_0x56b0a7;_0x51079b=0xc8;}else{_0x51079b=0xce;}_0x1df155[_0x2f9e('0x28')](_0x51079b);return _0x1df155[_0x2f9e('0x2e')](_0x2f9e('0x2f'),_0xf072a5+'-'+_0x2d3bc0+'/'+_0x56b0a7)[_0x2f9e('0x30')](_0x4f00fd);}return null;};}function patchUpdates(_0x4008de){return function(_0x2f6a96){try{jsonpatch[_0x2f9e('0x31')](_0x2f6a96,_0x4008de,!![]);}catch(_0x2c99a7){return BPromise[_0x2f9e('0x32')](_0x2c99a7);}return _0x2f6a96['save']();};}function saveUpdates(_0x3b7463,_0x47d1e1){return function(_0x3ce46c){if(_0x3ce46c){return _0x3ce46c[_0x2f9e('0x33')](_0x3b7463)['then'](function(_0x4c87d8){return _0x4c87d8;});}return null;};}function removeEntity(_0x70e8c0,_0x3dfc6e){return function(_0x43f403){if(_0x43f403){return _0x43f403[_0x2f9e('0x34')]()[_0x2f9e('0x1e')](function(){var _0x5b8ffd=_0x43f403[_0x2f9e('0x35')]({'plain':!![]});var _0x45cc1c='WhatsappAccounts';return db[_0x2f9e('0x36')]['destroy']({'where':{'type':_0x45cc1c,'resourceId':_0x5b8ffd['id']}})[_0x2f9e('0x1e')](function(){return _0x43f403;});})[_0x2f9e('0x1e')](function(){_0x70e8c0[_0x2f9e('0x28')](0xcc)[_0x2f9e('0x29')]();});}};}function handleEntityNotFound(_0x418019,_0x18734c){return function(_0x5e7bd2){if(!_0x5e7bd2){_0x418019['sendStatus'](0x194);}return _0x5e7bd2;};}function handleError(_0x1d674f,_0x460a33){_0x460a33=_0x460a33||0x1f4;return function(_0x5dcdb9){logger['error'](_0x5dcdb9[_0x2f9e('0x37')]);if(_0x5dcdb9[_0x2f9e('0x38')]){delete _0x5dcdb9[_0x2f9e('0x38')];}_0x1d674f[_0x2f9e('0x28')](_0x460a33)['send'](_0x5dcdb9);};}exports[_0x2f9e('0x39')]=function(_0x1c2768,_0x4d9760){var _0x55a3ac={'include':[{'model':db['Pause'],'as':_0x2f9e('0x3a')}]},_0x288f94={},_0x3a20ef={'count':0x0,'rows':[]};var _0x4e7998=_[_0x2f9e('0x3b')](db[_0x2f9e('0x3c')][_0x2f9e('0x3d')],function(_0x3c9303){return{'name':_0x3c9303[_0x2f9e('0x3e')],'type':_0x3c9303[_0x2f9e('0x3f')][_0x2f9e('0x40')]};});_0x288f94[_0x2f9e('0x41')]=_['map'](_0x4e7998,_0x2f9e('0x38'));_0x288f94[_0x2f9e('0x42')]=_['keys'](_0x1c2768[_0x2f9e('0x42')]);_0x288f94[_0x2f9e('0x43')]=_[_0x2f9e('0x44')](_0x288f94['model'],_0x288f94[_0x2f9e('0x42')]);_0x55a3ac[_0x2f9e('0x45')]=_[_0x2f9e('0x44')](_0x288f94[_0x2f9e('0x41')],qs[_0x2f9e('0x46')](_0x1c2768[_0x2f9e('0x42')]['fields']));_0x55a3ac[_0x2f9e('0x45')]=_0x55a3ac[_0x2f9e('0x45')][_0x2f9e('0x47')]?_0x55a3ac[_0x2f9e('0x45')]:_0x288f94[_0x2f9e('0x41')];if(!_0x1c2768[_0x2f9e('0x42')][_0x2f9e('0x48')](_0x2f9e('0x49'))){_0x55a3ac['limit']=qs[_0x2f9e('0x2c')](_0x1c2768[_0x2f9e('0x42')][_0x2f9e('0x2c')]);_0x55a3ac['offset']=qs[_0x2f9e('0x2a')](_0x1c2768['query'][_0x2f9e('0x2a')]);}_0x55a3ac[_0x2f9e('0x4a')]=qs[_0x2f9e('0x4b')](_0x1c2768[_0x2f9e('0x42')]['sort']);_0x55a3ac[_0x2f9e('0x4c')]=qs[_0x2f9e('0x43')](_[_0x2f9e('0x4d')](_0x1c2768['query'],_0x288f94[_0x2f9e('0x43')]),_0x4e7998);if(_0x1c2768['query'][_0x2f9e('0x4e')]){_0x55a3ac[_0x2f9e('0x4c')]=_[_0x2f9e('0x4f')](_0x55a3ac[_0x2f9e('0x4c')],{'$or':_[_0x2f9e('0x3b')](_0x4e7998,function(_0x599b37){if(_0x599b37[_0x2f9e('0x3f')]!==_0x2f9e('0x50')){var _0x1ed348={};_0x1ed348[_0x599b37['name']]={'$like':'%'+_0x1c2768[_0x2f9e('0x42')][_0x2f9e('0x4e')]+'%'};return _0x1ed348;}})});}_0x55a3ac=_[_0x2f9e('0x4f')]({},_0x55a3ac,_0x1c2768[_0x2f9e('0x51')]);var _0x2d7d8d={'where':_0x55a3ac[_0x2f9e('0x4c')]};return db['WhatsappAccount'][_0x2f9e('0x2d')](_0x2d7d8d)[_0x2f9e('0x1e')](function(_0x51b0d6){_0x3a20ef[_0x2f9e('0x2d')]=_0x51b0d6;if(_0x1c2768[_0x2f9e('0x42')][_0x2f9e('0x52')]){_0x55a3ac[_0x2f9e('0x53')]=[{'all':!![]}];}return db[_0x2f9e('0x3c')][_0x2f9e('0x54')](_0x55a3ac);})[_0x2f9e('0x1e')](function(_0x481c39){_0x3a20ef['rows']=_0x481c39;return _0x3a20ef;})['then'](respondWithFilteredResult(_0x4d9760,_0x55a3ac))['catch'](handleError(_0x4d9760,null));};exports[_0x2f9e('0x55')]=function(_0x240e3d,_0xefa58b){var _0xe1e199={'raw':![],'where':{'id':_0x240e3d[_0x2f9e('0x56')]['id']},'include':[{'model':db['Pause'],'as':_0x2f9e('0x3a')}]},_0x28ab36={};_0x28ab36[_0x2f9e('0x41')]=_['keys'](db[_0x2f9e('0x3c')][_0x2f9e('0x3d')]);_0x28ab36[_0x2f9e('0x42')]=_[_0x2f9e('0x57')](_0x240e3d[_0x2f9e('0x42')]);_0x28ab36['filters']=_[_0x2f9e('0x44')](_0x28ab36[_0x2f9e('0x41')],_0x28ab36[_0x2f9e('0x42')]);_0xe1e199['attributes']=_[_0x2f9e('0x44')](_0x28ab36['model'],qs[_0x2f9e('0x46')](_0x240e3d['query']['fields']));_0xe1e199[_0x2f9e('0x45')]=_0xe1e199[_0x2f9e('0x45')][_0x2f9e('0x47')]?_0xe1e199[_0x2f9e('0x45')]:_0x28ab36[_0x2f9e('0x41')];if(_0x240e3d[_0x2f9e('0x42')][_0x2f9e('0x52')]){_0xe1e199[_0x2f9e('0x53')]=[{'all':!![]}];}_0xe1e199=_[_0x2f9e('0x4f')]({},_0xe1e199,_0x240e3d[_0x2f9e('0x51')]);return db[_0x2f9e('0x3c')][_0x2f9e('0x58')](_0xe1e199)[_0x2f9e('0x1e')](handleEntityNotFound(_0xefa58b,null))['then'](respondWithResult(_0xefa58b,null))['catch'](handleError(_0xefa58b,null));};exports[_0x2f9e('0x59')]=function(_0x4d682e,_0x42e9bb){return db['WhatsappAccount'][_0x2f9e('0x59')](_0x4d682e[_0x2f9e('0x5a')],{})[_0x2f9e('0x1e')](function(_0x130a9e){var _0x51745f=_0x4d682e[_0x2f9e('0x5b')][_0x2f9e('0x35')]({'plain':!![]});if(!_0x51745f)throw new Error(_0x2f9e('0x5c'));if(_0x51745f[_0x2f9e('0x5d')]===_0x2f9e('0x5b')){var _0x3907b3=_0x130a9e[_0x2f9e('0x35')]({'plain':!![]});var _0x262371=_0x2f9e('0x5e');return db[_0x2f9e('0x5f')][_0x2f9e('0x58')]({'where':{'name':_0x262371,'userProfileId':_0x51745f[_0x2f9e('0x60')]},'raw':!![]})[_0x2f9e('0x1e')](function(_0x439957){if(_0x439957&&_0x439957[_0x2f9e('0x61')]===0x0){return db[_0x2f9e('0x36')][_0x2f9e('0x59')]({'name':_0x3907b3[_0x2f9e('0x38')],'resourceId':_0x3907b3['id'],'type':_0x439957['name'],'sectionId':_0x439957['id']},{})[_0x2f9e('0x1e')](function(){return _0x130a9e;});}else{return _0x130a9e;}})['catch'](function(_0x5a2d7f){logger['error'](_0x2f9e('0x62'),_0x5a2d7f);throw _0x5a2d7f;});}return _0x130a9e;})[_0x2f9e('0x1e')](respondWithResult(_0x42e9bb,0xc9))[_0x2f9e('0x27')](handleError(_0x42e9bb,null));};exports[_0x2f9e('0x33')]=function(_0x48e4cb,_0x464f46){if(_0x48e4cb[_0x2f9e('0x5a')]['id']){delete _0x48e4cb[_0x2f9e('0x5a')]['id'];}return db['WhatsappAccount'][_0x2f9e('0x58')]({'where':{'id':_0x48e4cb[_0x2f9e('0x56')]['id']},'include':[{'model':db['Pause'],'as':_0x2f9e('0x3a')}]})[_0x2f9e('0x1e')](handleEntityNotFound(_0x464f46,null))['then'](saveUpdates(_0x48e4cb[_0x2f9e('0x5a')],null))[_0x2f9e('0x1e')](respondWithResult(_0x464f46,null))['catch'](handleError(_0x464f46,null));};exports[_0x2f9e('0x34')]=function(_0x1d9790,_0x2f19b6){return db['WhatsappAccount'][_0x2f9e('0x58')]({'where':{'id':_0x1d9790['params']['id']}})[_0x2f9e('0x1e')](handleEntityNotFound(_0x2f19b6,null))[_0x2f9e('0x1e')](removeEntity(_0x2f19b6,null))[_0x2f9e('0x27')](handleError(_0x2f19b6,null));};exports[_0x2f9e('0x63')]=function(_0x31f49e,_0x26bc01){return db[_0x2f9e('0x3c')][_0x2f9e('0x63')]()['then'](respondWithResult(_0x26bc01,null))['catch'](handleError(_0x26bc01,null));};exports['addDisposition']=function(_0x547779,_0x5955fc,_0x5c53e6){if(_0x547779[_0x2f9e('0x5a')]['id']){delete _0x547779['body']['id'];}return db[_0x2f9e('0x3c')]['find']({'where':{'id':_0x547779['params']['id']}})[_0x2f9e('0x1e')](handleEntityNotFound(_0x5955fc,null))['then'](function(_0x3c6dd1){if(_0x3c6dd1){_0x547779[_0x2f9e('0x5a')][_0x2f9e('0x64')]=_0x3c6dd1['id'];return db['Disposition'][_0x2f9e('0x59')](_0x547779[_0x2f9e('0x5a')]);}})['then'](respondWithResult(_0x5955fc,null))[_0x2f9e('0x27')](handleError(_0x5955fc,null));};exports[_0x2f9e('0x65')]=function(_0xe49a7f,_0x5be9d4,_0x382707){var _0x2b5422={'raw':![],'where':{}};var _0x3a8adb={};var _0xd22cde={'count':0x0,'rows':[]};return db[_0x2f9e('0x3c')][_0x2f9e('0x66')]({'where':{'id':_0xe49a7f[_0x2f9e('0x56')]['id']}})[_0x2f9e('0x1e')](handleEntityNotFound(_0x5be9d4,null))[_0x2f9e('0x1e')](function(_0x147d63){if(_0x147d63){_0x3a8adb[_0x2f9e('0x41')]=_[_0x2f9e('0x57')](db['Disposition']['rawAttributes']);_0x3a8adb[_0x2f9e('0x42')]=_['keys'](_0xe49a7f[_0x2f9e('0x42')]);_0x3a8adb[_0x2f9e('0x43')]=_[_0x2f9e('0x44')](_0x3a8adb['model'],_0x3a8adb[_0x2f9e('0x42')]);_0x2b5422[_0x2f9e('0x45')]=_[_0x2f9e('0x44')](_0x3a8adb['model'],qs[_0x2f9e('0x46')](_0xe49a7f[_0x2f9e('0x42')]['fields']));_0x2b5422[_0x2f9e('0x45')]=_0x2b5422[_0x2f9e('0x45')][_0x2f9e('0x47')]?_0x2b5422[_0x2f9e('0x45')]:_0x3a8adb[_0x2f9e('0x41')];if(!_0xe49a7f[_0x2f9e('0x42')][_0x2f9e('0x48')](_0x2f9e('0x49'))){_0x2b5422[_0x2f9e('0x2c')]=qs[_0x2f9e('0x2c')](_0xe49a7f[_0x2f9e('0x42')][_0x2f9e('0x2c')]);_0x2b5422[_0x2f9e('0x2a')]=qs[_0x2f9e('0x2a')](_0xe49a7f[_0x2f9e('0x42')][_0x2f9e('0x2a')]);}_0x2b5422[_0x2f9e('0x4a')]=qs[_0x2f9e('0x4b')](_0xe49a7f[_0x2f9e('0x42')][_0x2f9e('0x4b')]);_0x2b5422[_0x2f9e('0x4c')]=qs[_0x2f9e('0x43')](_[_0x2f9e('0x4d')](_0xe49a7f['query'],_0x3a8adb[_0x2f9e('0x43')]));_0x2b5422[_0x2f9e('0x4c')][_0x2f9e('0x64')]=_0x147d63['id'];if(_0xe49a7f[_0x2f9e('0x42')][_0x2f9e('0x4e')]){_0x2b5422[_0x2f9e('0x4c')]=_[_0x2f9e('0x4f')](_0x2b5422[_0x2f9e('0x4c')],{'$or':_[_0x2f9e('0x3b')](_0x2b5422[_0x2f9e('0x45')],function(_0x2f95e0){var _0x2f6e3c={};_0x2f6e3c[_0x2f95e0]={'$like':'%'+_0xe49a7f[_0x2f9e('0x42')][_0x2f9e('0x4e')]+'%'};return _0x2f6e3c;})});}_0x2b5422=_[_0x2f9e('0x4f')]({},_0x2b5422,_0xe49a7f[_0x2f9e('0x51')]);return db[_0x2f9e('0x67')][_0x2f9e('0x2d')]({'where':_0x2b5422['where']})[_0x2f9e('0x1e')](function(_0x426243){_0xd22cde['count']=_0x426243;if(_0xe49a7f['query']['includeAll']){_0x2b5422[_0x2f9e('0x53')]=[{'all':!![]}];}return db[_0x2f9e('0x67')][_0x2f9e('0x54')](_0x2b5422);})[_0x2f9e('0x1e')](function(_0x5b2908){_0xd22cde['rows']=_0x5b2908;return _0xd22cde;});}})['then'](respondWithFilteredResult(_0x5be9d4,_0x2b5422))[_0x2f9e('0x27')](handleError(_0x5be9d4,null));};exports['removeDispositions']=function(_0x2435b6,_0x4b7c20,_0x4298f9){return db[_0x2f9e('0x3c')][_0x2f9e('0x58')]({'where':{'id':_0x2435b6['params']['id']}})[_0x2f9e('0x1e')](handleEntityNotFound(_0x4b7c20,null))['then'](function(_0x500715){if(_0x500715){return _0x500715[_0x2f9e('0x68')](_0x2435b6[_0x2f9e('0x42')][_0x2f9e('0x69')]);}})[_0x2f9e('0x1e')](respondWithStatusCode(_0x4b7c20,null))[_0x2f9e('0x27')](handleError(_0x4b7c20,null));};exports[_0x2f9e('0x6a')]=function(_0x1e25f4,_0x9b0c61,_0xbff7b0){if(_0x1e25f4[_0x2f9e('0x5a')]['id']){delete _0x1e25f4['body']['id'];}return db['WhatsappAccount'][_0x2f9e('0x58')]({'where':{'id':_0x1e25f4[_0x2f9e('0x56')]['id']}})[_0x2f9e('0x1e')](handleEntityNotFound(_0x9b0c61,null))[_0x2f9e('0x1e')](function(_0x2c1034){if(_0x2c1034){_0x1e25f4[_0x2f9e('0x5a')][_0x2f9e('0x64')]=_0x2c1034['id'];return db[_0x2f9e('0x6b')]['create'](_0x1e25f4['body']);}})[_0x2f9e('0x1e')](respondWithResult(_0x9b0c61,null))[_0x2f9e('0x27')](handleError(_0x9b0c61,null));};exports[_0x2f9e('0x6c')]=function(_0x285366,_0x535a4c,_0x23cff7){var _0x1d476b={'raw':![],'where':{}};var _0x3e7d70={};var _0x474b21={'count':0x0,'rows':[]};return db[_0x2f9e('0x3c')][_0x2f9e('0x66')]({'where':{'id':_0x285366[_0x2f9e('0x56')]['id']}})[_0x2f9e('0x1e')](handleEntityNotFound(_0x535a4c,null))[_0x2f9e('0x1e')](function(_0x1f8e1e){if(_0x1f8e1e){_0x3e7d70[_0x2f9e('0x41')]=_[_0x2f9e('0x57')](db['CannedAnswer'][_0x2f9e('0x3d')]);_0x3e7d70[_0x2f9e('0x42')]=_[_0x2f9e('0x57')](_0x285366['query']);_0x3e7d70[_0x2f9e('0x43')]=_['intersection'](_0x3e7d70[_0x2f9e('0x41')],_0x3e7d70[_0x2f9e('0x42')]);_0x1d476b['attributes']=_[_0x2f9e('0x44')](_0x3e7d70[_0x2f9e('0x41')],qs[_0x2f9e('0x46')](_0x285366[_0x2f9e('0x42')][_0x2f9e('0x46')]));_0x1d476b['attributes']=_0x1d476b[_0x2f9e('0x45')][_0x2f9e('0x47')]?_0x1d476b[_0x2f9e('0x45')]:_0x3e7d70[_0x2f9e('0x41')];if(!_0x285366[_0x2f9e('0x42')][_0x2f9e('0x48')](_0x2f9e('0x49'))){_0x1d476b[_0x2f9e('0x2c')]=qs['limit'](_0x285366[_0x2f9e('0x42')][_0x2f9e('0x2c')]);_0x1d476b['offset']=qs['offset'](_0x285366[_0x2f9e('0x42')]['offset']);}_0x1d476b[_0x2f9e('0x4a')]=qs[_0x2f9e('0x4b')](_0x285366[_0x2f9e('0x42')]['sort']);_0x1d476b['where']=qs[_0x2f9e('0x43')](_[_0x2f9e('0x4d')](_0x285366[_0x2f9e('0x42')],_0x3e7d70[_0x2f9e('0x43')]));_0x1d476b['where'][_0x2f9e('0x64')]=_0x1f8e1e['id'];if(_0x285366[_0x2f9e('0x42')][_0x2f9e('0x4e')]){_0x1d476b[_0x2f9e('0x4c')]=_[_0x2f9e('0x4f')](_0x1d476b[_0x2f9e('0x4c')],{'$or':_[_0x2f9e('0x3b')](_0x1d476b[_0x2f9e('0x45')],function(_0x286f69){var _0x37d498={};_0x37d498[_0x286f69]={'$like':'%'+_0x285366[_0x2f9e('0x42')]['filter']+'%'};return _0x37d498;})});}_0x1d476b=_[_0x2f9e('0x4f')]({},_0x1d476b,_0x285366['options']);return db['CannedAnswer']['count']({'where':_0x1d476b[_0x2f9e('0x4c')]})[_0x2f9e('0x1e')](function(_0x5f0ab4){_0x474b21[_0x2f9e('0x2d')]=_0x5f0ab4;if(_0x285366[_0x2f9e('0x42')][_0x2f9e('0x52')]){_0x1d476b['include']=[{'all':!![]}];}return db[_0x2f9e('0x6b')][_0x2f9e('0x54')](_0x1d476b);})[_0x2f9e('0x1e')](function(_0xf4e688){_0x474b21[_0x2f9e('0x6d')]=_0xf4e688;return _0x474b21;});}})['then'](respondWithFilteredResult(_0x535a4c,_0x1d476b))[_0x2f9e('0x27')](handleError(_0x535a4c,null));};exports[_0x2f9e('0x6e')]=function(_0x15ecc2,_0x2a838c,_0x244aae){return db['WhatsappAccount'][_0x2f9e('0x58')]({'where':{'id':_0x15ecc2[_0x2f9e('0x56')]['id']}})['then'](handleEntityNotFound(_0x2a838c,null))['then'](function(_0x2ddbf1){if(_0x2ddbf1){return _0x2ddbf1[_0x2f9e('0x6e')](_0x15ecc2[_0x2f9e('0x42')]['ids']);}})[_0x2f9e('0x1e')](respondWithStatusCode(_0x2a838c,null))[_0x2f9e('0x27')](handleError(_0x2a838c,null));};exports[_0x2f9e('0x6f')]=function(_0x2a74ed,_0x530624,_0x3b08a4){return db[_0x2f9e('0x3c')][_0x2f9e('0x58')]({'where':{'id':_0x2a74ed['params']['id']}})[_0x2f9e('0x1e')](handleEntityNotFound(_0x530624,null))[_0x2f9e('0x1e')](function(_0x427b29){if(_0x427b29){return _0x427b29[_0x2f9e('0x6f')](_0x2a74ed['body'][_0x2f9e('0x69')],_[_0x2f9e('0x70')](_0x2a74ed[_0x2f9e('0x5a')],[_0x2f9e('0x69'),'id'])||{})[_0x2f9e('0x71')](function(_0x3db7c1){for(var _0x2c2378=0x0;_0x2c2378<_0x2a74ed[_0x2f9e('0x5a')]['ids'][_0x2f9e('0x47')];_0x2c2378+=0x1){socket[_0x2f9e('0x72')](_0x2f9e('0x73'),{'UserId':Number(_0x2a74ed[_0x2f9e('0x5a')][_0x2f9e('0x69')][_0x2c2378]),'WhatsappAccountId':Number(_0x2a74ed[_0x2f9e('0x56')]['id'])});}return _0x3db7c1;});}})[_0x2f9e('0x1e')](respondWithResult(_0x530624,null))[_0x2f9e('0x27')](handleError(_0x530624,null));};exports['removeAgents']=function(_0x16cbb1,_0x37176e,_0x473f72){return db[_0x2f9e('0x3c')][_0x2f9e('0x58')]({'where':{'id':_0x16cbb1[_0x2f9e('0x56')]['id']}})[_0x2f9e('0x1e')](handleEntityNotFound(_0x37176e,null))[_0x2f9e('0x1e')](function(_0x411ba0){if(_0x411ba0){return _0x411ba0[_0x2f9e('0x74')](_0x16cbb1['query'][_0x2f9e('0x69')])[_0x2f9e('0x1e')](function(){if(_[_0x2f9e('0x75')](_0x16cbb1[_0x2f9e('0x42')][_0x2f9e('0x69')])){for(var _0x378041=0x0;_0x378041<_0x16cbb1['query']['ids'][_0x2f9e('0x47')];_0x378041+=0x1){socket['emit'](_0x2f9e('0x76'),{'UserId':Number(_0x16cbb1[_0x2f9e('0x42')]['ids'][_0x378041]),'WhatsappAccountId':Number(_0x16cbb1[_0x2f9e('0x56')]['id'])});}}else{socket[_0x2f9e('0x72')](_0x2f9e('0x76'),{'UserId':Number(_0x16cbb1[_0x2f9e('0x42')][_0x2f9e('0x69')]),'WhatsappAccountId':Number(_0x16cbb1['params']['id'])});}});}})[_0x2f9e('0x1e')](respondWithStatusCode(_0x37176e,null))[_0x2f9e('0x27')](handleError(_0x37176e,null));};exports['getAgents']=function(_0x42d001,_0x544de9,_0x416ca9){var _0x2b066b={};var _0x1e72ac={};var _0x1f5025;var _0x44bbf4;return db['WhatsappAccount'][_0x2f9e('0x66')]({'where':{'id':_0x42d001[_0x2f9e('0x56')]['id']}})[_0x2f9e('0x1e')](handleEntityNotFound(_0x544de9,null))[_0x2f9e('0x1e')](function(_0x7a73a){if(_0x7a73a){_0x1f5025=_0x7a73a;_0x1e72ac[_0x2f9e('0x41')]=_[_0x2f9e('0x57')](db[_0x2f9e('0x77')][_0x2f9e('0x3d')]);_0x1e72ac[_0x2f9e('0x42')]=_[_0x2f9e('0x57')](_0x42d001[_0x2f9e('0x42')]);_0x1e72ac[_0x2f9e('0x43')]=_[_0x2f9e('0x44')](_0x1e72ac[_0x2f9e('0x41')],_0x1e72ac[_0x2f9e('0x42')]);_0x2b066b[_0x2f9e('0x45')]=_[_0x2f9e('0x44')](_0x1e72ac[_0x2f9e('0x41')],qs['fields'](_0x42d001[_0x2f9e('0x42')]['fields']));_0x2b066b['attributes']=_0x2b066b[_0x2f9e('0x45')]['length']?_0x2b066b[_0x2f9e('0x45')]:_0x1e72ac['model'];_0x2b066b[_0x2f9e('0x4a')]=qs[_0x2f9e('0x4b')](_0x42d001[_0x2f9e('0x42')][_0x2f9e('0x4b')]);_0x2b066b[_0x2f9e('0x4c')]=qs[_0x2f9e('0x43')](_[_0x2f9e('0x4d')](_0x42d001[_0x2f9e('0x42')],_0x1e72ac[_0x2f9e('0x43')]));if(_0x42d001['query'][_0x2f9e('0x4e')]){_0x2b066b[_0x2f9e('0x4c')]=_[_0x2f9e('0x4f')](_0x2b066b[_0x2f9e('0x4c')],{'$or':_[_0x2f9e('0x3b')](_0x2b066b[_0x2f9e('0x45')],function(_0x46d44a){var _0x23292d={};_0x23292d[_0x46d44a]={'$like':'%'+_0x42d001['query'][_0x2f9e('0x4e')]+'%'};return _0x23292d;})});}_0x2b066b=_[_0x2f9e('0x4f')]({},_0x2b066b,_0x42d001['options']);return _0x1f5025[_0x2f9e('0x78')](_0x2b066b);}})[_0x2f9e('0x1e')](function(_0x4dfb6f){if(_0x4dfb6f){_0x44bbf4=_0x4dfb6f[_0x2f9e('0x47')];if(!_0x42d001[_0x2f9e('0x42')]['hasOwnProperty'](_0x2f9e('0x49'))){_0x2b066b[_0x2f9e('0x2c')]=qs['limit'](_0x42d001[_0x2f9e('0x42')]['limit']);_0x2b066b[_0x2f9e('0x2a')]=qs['offset'](_0x42d001[_0x2f9e('0x42')][_0x2f9e('0x2a')]);}return _0x1f5025[_0x2f9e('0x78')](_0x2b066b);}})[_0x2f9e('0x1e')](function(_0x30b76a){if(_0x30b76a){return _0x30b76a?{'count':_0x44bbf4,'rows':_0x30b76a}:null;}})[_0x2f9e('0x1e')](respondWithResult(_0x544de9,null))[_0x2f9e('0x27')](handleError(_0x544de9,null));};exports[_0x2f9e('0x79')]=function(_0x57d782,_0x220929){var _0x3c03c8=_0x57d782[_0x2f9e('0x56')]['id'];var _0x376929=_0x57d782['body'];var _0x3ab791=0xc8;var _0x36151d=null;return db[_0x2f9e('0x7a')][_0x2f9e('0x7b')]({'isolationLevel':db['sequelize'][_0x2f9e('0x7c')]['ISOLATION_LEVELS'][_0x2f9e('0x7d')]},function(_0x4174eb){return db[_0x2f9e('0x3c')][_0x2f9e('0x66')]({'where':{'id':_0x3c03c8},'transaction':_0x4174eb})[_0x2f9e('0x1e')](function(_0x226fd6){if(_0x226fd6){return db[_0x2f9e('0x7e')]['destroy']({'where':{'WhatsappAccountId':_0x3c03c8},'transaction':_0x4174eb})['then'](function(){var _0x59f744=_['map'](_0x376929,function(_0x1093d5){_0x1093d5['WhatsappAccountId']=_0x3c03c8;return _0x1093d5;});return db['WhatsappApplication'][_0x2f9e('0x7f')](_0x59f744,{'transaction':_0x4174eb});});}else{_0x3ab791=0x194;_0x36151d=[];}});})['then'](function(){if(_0x3ab791!==0x194){return db[_0x2f9e('0x7e')][_0x2f9e('0x80')]({'where':{'WhatsappAccountId':_0x3c03c8},'order':_0x2f9e('0x81')})[_0x2f9e('0x1e')](function(_0x94f955){_0x36151d=_0x94f955;});}})[_0x2f9e('0x27')](function(_0x110346){_0x3ab791=0x1f4;logger[_0x2f9e('0x23')](_0x110346[_0x2f9e('0x37')]);if(_0x110346[_0x2f9e('0x38')]){delete _0x110346['name'];}_0x36151d=_0x110346;})['finally'](function(){if(_0x36151d===null){_0x220929['sendStatus'](_0x3ab791);}else{if(_0x3ab791===0x1f4){_0x220929[_0x2f9e('0x28')](_0x3ab791)[_0x2f9e('0x82')](_0x36151d);}else{_0x220929[_0x2f9e('0x28')](_0x3ab791)[_0x2f9e('0x30')](_0x36151d);}}});};exports[_0x2f9e('0x83')]=function(_0x20b9b9,_0x217a9e,_0x4e6ccd){var _0x128606={};var _0x309e41={};var _0x5235a0;var _0x2e4cc5;return db[_0x2f9e('0x3c')][_0x2f9e('0x66')]({'where':{'id':_0x20b9b9[_0x2f9e('0x56')]['id']}})[_0x2f9e('0x1e')](handleEntityNotFound(_0x217a9e,null))[_0x2f9e('0x1e')](function(_0x5eb97){if(_0x5eb97){_0x5235a0=_0x5eb97;_0x309e41['model']=_[_0x2f9e('0x57')](db[_0x2f9e('0x7e')][_0x2f9e('0x3d')]);_0x309e41[_0x2f9e('0x42')]=_[_0x2f9e('0x57')](_0x20b9b9['query']);_0x309e41[_0x2f9e('0x43')]=_[_0x2f9e('0x44')](_0x309e41['model'],_0x309e41['query']);_0x128606['attributes']=_[_0x2f9e('0x44')](_0x309e41[_0x2f9e('0x41')],qs[_0x2f9e('0x46')](_0x20b9b9[_0x2f9e('0x42')][_0x2f9e('0x46')]));_0x128606[_0x2f9e('0x45')]=_0x128606[_0x2f9e('0x45')]['length']?_0x128606['attributes']:_0x309e41[_0x2f9e('0x41')];_0x128606[_0x2f9e('0x4a')]=qs[_0x2f9e('0x4b')](_0x20b9b9[_0x2f9e('0x42')][_0x2f9e('0x4b')]);_0x128606[_0x2f9e('0x4c')]=qs['filters'](_[_0x2f9e('0x4d')](_0x20b9b9['query'],_0x309e41[_0x2f9e('0x43')]));if(_0x20b9b9[_0x2f9e('0x42')][_0x2f9e('0x4e')]){_0x128606[_0x2f9e('0x4c')]=_[_0x2f9e('0x4f')](_0x128606[_0x2f9e('0x4c')],{'$or':_[_0x2f9e('0x3b')](_0x128606['attributes'],function(_0x3f9d26){var _0x5a9b10={};_0x5a9b10[_0x3f9d26]={'$like':'%'+_0x20b9b9['query'][_0x2f9e('0x4e')]+'%'};return _0x5a9b10;})});}_0x128606=_['merge']({},_0x128606,_0x20b9b9['options']);return _0x5235a0[_0x2f9e('0x83')](_0x128606);}})['then'](function(_0x3d47c7){if(_0x3d47c7){_0x2e4cc5=_0x3d47c7[_0x2f9e('0x47')];if(!_0x20b9b9[_0x2f9e('0x42')][_0x2f9e('0x48')]('nolimit')){_0x128606[_0x2f9e('0x2c')]=qs[_0x2f9e('0x2c')](_0x20b9b9['query'][_0x2f9e('0x2c')]);_0x128606[_0x2f9e('0x2a')]=qs[_0x2f9e('0x2a')](_0x20b9b9['query'][_0x2f9e('0x2a')]);}return _0x5235a0[_0x2f9e('0x83')](_0x128606);}})['then'](function(_0x475261){if(_0x475261){return _0x475261?{'count':_0x2e4cc5,'rows':_0x475261}:null;}})[_0x2f9e('0x1e')](respondWithResult(_0x217a9e,null))['catch'](handleError(_0x217a9e,null));};exports[_0x2f9e('0x84')]=function(_0x453cab,_0x1f9e50,_0x4ee8ae){var _0x38e42b={'channel':_0x2f9e('0x85')};var _0x1f6465=[];var _0x239a7a=[];var _0x5908f1={};return db[_0x2f9e('0x3c')][_0x2f9e('0x58')]({'where':{'id':_0x453cab[_0x2f9e('0x56')]['id']},'include':[{'model':db[_0x2f9e('0x7e')],'as':_0x2f9e('0x86')}]})[_0x2f9e('0x1e')](handleEntityNotFound(_0x1f9e50,null))[_0x2f9e('0x1e')](function(_0x56674e){_0x38e42b[_0x2f9e('0x87')]=_0x56674e;if(_0x38e42b['account']&&_0x38e42b[_0x2f9e('0x87')][_0x2f9e('0x3f')]===_0x2f9e('0x88')&&_0x453cab[_0x2f9e('0x5a')][_0x2f9e('0x89')]){if(_0x453cab[_0x2f9e('0x5a')][_0x2f9e('0x89')][_0x2f9e('0x47')]===0x0)return;if(_0x453cab[_0x2f9e('0x5a')][_0x2f9e('0x89')][0x0][_0x2f9e('0x8a')]!==_0x2f9e('0x8b'))return;return db[_0x2f9e('0x8c')]['update']({'read':!![],'readAt':_0x453cab[_0x2f9e('0x5a')][_0x2f9e('0x89')][0x0][_0x2f9e('0x8d')]},{'where':{'messageId':_0x453cab[_0x2f9e('0x5a')]['statuses'][0x0]['message_id']},'individualHooks':!![]})['then'](function(_0x1f5847){return _0x1f9e50[_0x2f9e('0x28')](0xc8)[_0x2f9e('0x30')](_0x1f5847);});}_0x38e42b[_0x2f9e('0x8e')]=_['orderBy'](_0x56674e['Applications'],[_0x2f9e('0x81')],[_0x2f9e('0x8f')]);if(_0x38e42b[_0x2f9e('0x87')]['Applications']){delete _0x38e42b[_0x2f9e('0x87')]['Applications'];}return db[_0x2f9e('0x90')][_0x2f9e('0x63')]()['then'](function(_0x5b2270){if(!_0x5b2270){throw new db[(_0x2f9e('0x91'))]['ValidationError'](_0x2f9e('0x92'));}_0x1f6465=_[_0x2f9e('0x93')](_[_0x2f9e('0x57')](_0x5b2270),[_0x2f9e('0x94'),_0x2f9e('0x95')]);_0x239a7a=_[_0x2f9e('0x93')](_['keys'](_0x5b2270),[_0x2f9e('0x94'),_0x2f9e('0x95'),_0x2f9e('0x96'),_0x2f9e('0x97')]);_0x38e42b[_0x2f9e('0x5a')]={'mapKey':'mobile'};if(_0x38e42b[_0x2f9e('0x87')]&&_0x38e42b[_0x2f9e('0x87')][_0x2f9e('0x3f')]===_0x2f9e('0x98')){_0x38e42b[_0x2f9e('0x5a')][_0x2f9e('0x99')]=_0x453cab[_0x2f9e('0x5a')][_0x2f9e('0x9a')]['replace'](_0x2f9e('0x9b'),'');_0x38e42b[_0x2f9e('0x5a')][_0x2f9e('0x5a')]=_0x453cab[_0x2f9e('0x5a')][_0x2f9e('0x9c')];_0x38e42b[_0x2f9e('0x5a')][_0x2f9e('0x9d')]=_0x453cab[_0x2f9e('0x5a')][_0x2f9e('0x9e')];}if(_0x38e42b[_0x2f9e('0x87')]&&_0x38e42b['account']['type']===_0x2f9e('0x88')){_0x38e42b['body']['from']=_0x453cab[_0x2f9e('0x5a')][_0x2f9e('0x9f')][0x0][_0x2f9e('0x99')];_0x38e42b[_0x2f9e('0x5a')][_0x2f9e('0x5a')]=_0x453cab['body'][_0x2f9e('0x9f')][0x0]['message'][_0x2f9e('0x5a')];_0x38e42b[_0x2f9e('0x5a')][_0x2f9e('0x9d')]=_0x453cab[_0x2f9e('0x5a')]['notifications'][0x0][_0x2f9e('0xa0')];}if(_0x38e42b['body']['id']){delete _0x38e42b[_0x2f9e('0x5a')]['id'];}if(_[_0x2f9e('0xa1')](_0x38e42b['body'][_0x2f9e('0x99')])){throw new db[(_0x2f9e('0x91'))][(_0x2f9e('0xa2'))]('from\x20is\x20mandatory');}if(_[_0x2f9e('0xa1')](_0x38e42b[_0x2f9e('0x5a')]['body'])||_0x38e42b[_0x2f9e('0x5a')]['body']===''){throw new db[(_0x2f9e('0x91'))][(_0x2f9e('0xa2'))](_0x2f9e('0xa3'));}if(_[_0x2f9e('0xa1')](_0x38e42b['body'][_0x2f9e('0xa4')])){throw new db['Sequelize'][(_0x2f9e('0xa2'))](_0x2f9e('0xa5')+_0x239a7a);}if(!_['includes'](_0x239a7a,_0x38e42b[_0x2f9e('0x5a')][_0x2f9e('0xa4')])){throw new db[(_0x2f9e('0x91'))][(_0x2f9e('0xa2'))](_0x2f9e('0xa6')+_0x239a7a);}_0x5908f1[_0x38e42b[_0x2f9e('0x5a')][_0x2f9e('0xa4')]]=_0x38e42b[_0x2f9e('0x5a')][_0x2f9e('0x99')];return db[_0x2f9e('0xa7')]['find']({'where':{'id':_0x38e42b[_0x2f9e('0x87')][_0x2f9e('0x97')]},'include':[{'model':db[_0x2f9e('0x90')],'as':'Contacts','where':_0x5908f1,'limit':0x1,'order':[[_0x2f9e('0x95'),_0x2f9e('0xa8')]]}]});})[_0x2f9e('0x1e')](handleEntityNotFound(_0x1f9e50,null))[_0x2f9e('0x1e')](function(_0x315af8){if(_0x315af8){_0x38e42b[_0x2f9e('0xa9')]=_[_0x2f9e('0x70')](_0x315af8,['Contacts']);if(_0x315af8[_0x2f9e('0xaa')][_0x2f9e('0x47')]){return _0x315af8[_0x2f9e('0xaa')][0x0];}var _0x4ecc99=_['defaults'](_0x38e42b['body'],{'firstName':_0x38e42b[_0x2f9e('0x5a')][_0x2f9e('0x99')],'ListId':_0x315af8['id']});_0x4ecc99[_0x38e42b[_0x2f9e('0x5a')][_0x2f9e('0xa4')]]=_0x38e42b[_0x2f9e('0x5a')]['from'];return db[_0x2f9e('0x90')][_0x2f9e('0x59')](_0x4ecc99,{'fields':_0x1f6465,'raw':!![]});}})['then'](handleEntityNotFound(_0x1f9e50,null))['then'](function(_0x3d2e32){if(_0x3d2e32){_0x38e42b['contact']=_0x3d2e32;var _0x5d4c84={'ContactId':_0x3d2e32['id'],'phone':_0x38e42b['body'][_0x2f9e('0x99')],'WhatsappAccountId':_0x453cab['params']['id']};var _0x54503e={'ContactId':_0x3d2e32['id'],'WhatsappAccountId':_0x453cab[_0x2f9e('0x56')]['id'],'closed':![]};return db['WhatsappInteraction']['find']({'where':_0x54503e})[_0x2f9e('0x1e')](function(_0x141688){if(_0x141688){return[_0x141688,![]];}return db['WhatsappInteraction'][_0x2f9e('0x59')](_0x5d4c84)['then'](function(_0x10c8af){return[_0x10c8af,!![]];});});}})[_0x2f9e('0x71')](function(_0x360f8c,_0x3eeffe){_0x38e42b[_0x2f9e('0xab')]=_0x360f8c[_0x2f9e('0x35')]({'plain':!![]});_0x38e42b[_0x2f9e('0xab')]['created']=![];if(_0x3eeffe){if(_0x38e42b['account'][_0x2f9e('0xac')]){_0x38e42b[_0x2f9e('0x8e')]['push']({'id':0x0,'priority':_0x38e42b[_0x2f9e('0x8e')]['length']+0x1,'app':'close','appdata':_0x2f9e('0xad'),'interval':'*,*,*,*'});}_0x38e42b[_0x2f9e('0xab')][_0x2f9e('0xae')]=!![];}return db[_0x2f9e('0x8c')]['create']({'phone':_0x38e42b[_0x2f9e('0x5a')][_0x2f9e('0x99')],'messageId':_0x38e42b[_0x2f9e('0x5a')][_0x2f9e('0x9d')],'body':_0x38e42b[_0x2f9e('0x5a')][_0x2f9e('0x5a')],'WhatsappAccountId':_0x453cab[_0x2f9e('0x56')]['id'],'WhatsappInteractionId':_0x360f8c['id'],'direction':'in','ContactId':_0x360f8c[_0x2f9e('0xaf')],'AttachmentId':_0x38e42b['body'][_0x2f9e('0xb0')]});})[_0x2f9e('0x1e')](function(_0xcc9e2a){_0x38e42b['message']=_0xcc9e2a;if(!_0x38e42b['interaction'][_0x2f9e('0xb1')])return;return db['User']['find']({'attributes':['id',_0x2f9e('0x38')],'where':{'id':_0x38e42b['interaction']['UserId']}});})[_0x2f9e('0x1e')](function(_0x24718e){if(_0x24718e){_0x38e42b['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x2f9e('0xb2'),'appdata':_0x24718e[_0x2f9e('0x38')]+','+(_0x38e42b[_0x2f9e('0x87')][_0x2f9e('0xb3')]||0xa),'interval':_0x2f9e('0xb4')});}if(!_0x38e42b['interaction']['queueId'])return;return db[_0x2f9e('0xb5')][_0x2f9e('0x58')]({'attributes':['id',_0x2f9e('0x38')],'where':{'id':_0x38e42b[_0x2f9e('0xab')][_0x2f9e('0xb6')]}});})[_0x2f9e('0x1e')](function(_0x9911dd){if(_0x9911dd){_0x38e42b[_0x2f9e('0x8e')]['unshift']({'id':0x0,'priority':0x1,'app':_0x2f9e('0xb7'),'appdata':_0x9911dd[_0x2f9e('0x38')]+','+(_0x38e42b[_0x2f9e('0x87')][_0x2f9e('0xb8')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x2f9e('0xb9'),_0x2f9e('0xba'),_0x38e42b);})[_0x2f9e('0x1e')](function(_0x51a8cd){if(_0x51a8cd){var _0x3e66d6=0xc8;var _0x483711=_0x2f9e('0xbb');logger[_0x2f9e('0x1f')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x483711,_0x3e66d6,_0x2f9e('0xbc'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x483711,_0x3e66d6,_0x2f9e('0xbc'),JSON[_0x2f9e('0x21')](_0x51a8cd));if(_0x38e42b[_0x2f9e('0x87')]['type']===_0x2f9e('0x98')){return _0x1f9e50[_0x2f9e('0x28')](_0x3e66d6)[_0x2f9e('0x2e')](_0x2f9e('0xbd'),'text/xml')[_0x2f9e('0x82')]('\x0a');}else{return _0x1f9e50[_0x2f9e('0x28')](_0x3e66d6)[_0x2f9e('0x30')](_0x51a8cd);}}});})[_0x2f9e('0x27')](handleError(_0x1f9e50,null));};exports[_0x2f9e('0x82')]=function(_0x13daf1,_0x5814dd,_0x2f5ea5){var _0xc2d0f6,_0x31cd30,_0x1cbe26;if(_[_0x2f9e('0xa1')](_0x13daf1[_0x2f9e('0x5a')]['body'])||_0x13daf1['body'][_0x2f9e('0x5a')]===''){throw new db[(_0x2f9e('0x91'))]['ValidationError'](_0x2f9e('0xa3'));}if(_[_0x2f9e('0xa1')](_0x13daf1[_0x2f9e('0x5a')]['to'])){throw new db['Sequelize'][(_0x2f9e('0xa2'))](_0x2f9e('0xbe'));}_0xc2d0f6=_0x13daf1[_0x2f9e('0x5a')]['to'];return db[_0x2f9e('0x3c')]['find']({'where':{'id':_0x13daf1[_0x2f9e('0x56')]['id']},'include':[{'model':db[_0x2f9e('0xa7')],'as':_0x2f9e('0xbf'),'include':[{'model':db[_0x2f9e('0x90')],'as':_0x2f9e('0xaa'),'where':{'mobile':_0xc2d0f6},'limit':0x1,'order':[[_0x2f9e('0x95'),_0x2f9e('0xa8')]]}]}]})[_0x2f9e('0x1e')](handleEntityNotFound(_0x5814dd,null))[_0x2f9e('0x1e')](function(_0x26c9b8){if(_0x26c9b8&&_0x26c9b8['List']){_0x31cd30=_0x26c9b8[_0x2f9e('0x35')]({'plain':!![]});if(_0x31cd30[_0x2f9e('0xbf')]&&_0x31cd30['List'][_0x2f9e('0xaa')][_0x2f9e('0x47')]){return _0x31cd30['List'][_0x2f9e('0xaa')][0x0];}return db[_0x2f9e('0x90')][_0x2f9e('0x59')](_[_0x2f9e('0x16')](_0x13daf1[_0x2f9e('0x5a')],{'firstName':_0xc2d0f6,'mobile':_0xc2d0f6,'phone':_0xc2d0f6,'ListId':_0x31cd30[_0x2f9e('0x97')]}));}})[_0x2f9e('0x1e')](handleEntityNotFound(_0x5814dd,null))['then'](function(_0x4c18f9){if(_0x4c18f9){_0x1cbe26=_0x4c18f9;return db[_0x2f9e('0xc0')][_0x2f9e('0x58')]({'where':{'ContactId':_0x1cbe26['id'],'closed':![],'WhatsappAccountId':_0x31cd30['id']}})[_0x2f9e('0x1e')](function(_0x5c2099){if(_0x5c2099){return[_0x5c2099,![]];}return db['WhatsappInteraction'][_0x2f9e('0x59')]({'UserId':_0x13daf1[_0x2f9e('0x5b')]['id'],'ContactId':_0x1cbe26['id'],'WhatsappAccountId':_0x31cd30['id'],'phone':_0xc2d0f6,'firstMsgDirection':_0x2f9e('0xc1'),'Messages':[_[_0x2f9e('0x4f')](_0x13daf1[_0x2f9e('0x5a')],{'read':![],'body':_0x13daf1['body']['body'],'phone':_0xc2d0f6,'WhatsappAccountId':_0x31cd30['id'],'UserId':_0x13daf1[_0x2f9e('0x5b')]['id'],'ContactId':_0x1cbe26['id']})]},{'include':[{'model':db[_0x2f9e('0x8c')],'as':_0x2f9e('0xc2')}]})[_0x2f9e('0x1e')](function(_0x533333){return[_0x533333,!![]];});});}})[_0x2f9e('0x71')](function(_0x1ded4d,_0x5c9c90){if(_0x5c9c90){return _0x1ded4d;}return db[_0x2f9e('0x8c')]['create'](_[_0x2f9e('0x4f')](_0x13daf1['body'],{'read':![],'body':_0x13daf1[_0x2f9e('0x5a')]['body'],'phone':_0xc2d0f6,'WhatsappAccountId':_0x31cd30['id'],'WhatsappInteractionId':_0x1ded4d['id'],'UserId':_0x13daf1[_0x2f9e('0x5b')]['id'],'ContactId':_0x1cbe26['id']}))[_0x2f9e('0x1e')](function(_0x4fd5a7){_0x1ded4d[_0x2f9e('0xc3')][_0x2f9e('0xc2')]=[];_0x1ded4d['dataValues'][_0x2f9e('0xc2')]['push'](_0x4fd5a7['dataValues']);return _0x1ded4d;});})['then'](respondWithResult(_0x5814dd,null))[_0x2f9e('0x27')](handleError(_0x5814dd,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index a32f744..c2fac4f 100644 --- a/server/api/whatsappAccount/whatsappAccount.events.js +++ b/server/api/whatsappAccount/whatsappAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x19d2=['remove','emit','hook','../../mysqldb','WhatsappAccount','setMaxListeners','save','update'];(function(_0x1d6ede,_0x161829){var _0x5e51a2=function(_0x1cd55c){while(--_0x1cd55c){_0x1d6ede['push'](_0x1d6ede['shift']());}};_0x5e51a2(++_0x161829);}(_0x19d2,0x1d3));var _0x219d=function(_0x689c1a,_0x4f41b4){_0x689c1a=_0x689c1a-0x0;var _0x58fe41=_0x19d2[_0x689c1a];return _0x58fe41;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0x219d('0x0'))['db'][_0x219d('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x219d('0x2')](0x0);var events={'afterCreate':_0x219d('0x3'),'afterUpdate':_0x219d('0x4'),'afterDestroy':_0x219d('0x5')};function emitEvent(_0x1f4574){return function(_0x496181,_0x2ec0d7,_0x2bbfa9){WhatsappAccountEvents[_0x219d('0x6')](_0x1f4574+':'+_0x496181['id'],_0x496181);WhatsappAccountEvents[_0x219d('0x6')](_0x1f4574,_0x496181);_0x2bbfa9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x219d('0x7')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file +var _0x1e22=['hasOwnProperty','hook','exports','../../mysqldb','WhatsappAccount','setMaxListeners','save','update','remove','emit'];(function(_0x279893,_0x210445){var _0x174c6b=function(_0x3392fd){while(--_0x3392fd){_0x279893['push'](_0x279893['shift']());}};_0x174c6b(++_0x210445);}(_0x1e22,0x99));var _0x21e2=function(_0x355ce8,_0x5f1d0a){_0x355ce8=_0x355ce8-0x0;var _0x1db8b8=_0x1e22[_0x355ce8];return _0x1db8b8;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0x21e2('0x0'))['db'][_0x21e2('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x21e2('0x2')](0x0);var events={'afterCreate':_0x21e2('0x3'),'afterUpdate':_0x21e2('0x4'),'afterDestroy':_0x21e2('0x5')};function emitEvent(_0x38ef42){return function(_0x3bb204,_0x251e8a,_0x2d6906){WhatsappAccountEvents[_0x21e2('0x6')](_0x38ef42+':'+_0x3bb204['id'],_0x3bb204);WhatsappAccountEvents[_0x21e2('0x6')](_0x38ef42,_0x3bb204);_0x2d6906(null);};}for(var e in events){if(events[_0x21e2('0x7')](e)){var event=events[e];WhatsappAccount[_0x21e2('0x8')](e,emitEvent(event));}}module[_0x21e2('0x9')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 07cc125..07676ec 100644 --- a/server/api/whatsappAccount/whatsappAccount.model.js +++ b/server/api/whatsappAccount/whatsappAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3d74=['./whatsappAccount.attributes','define','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x58db63,_0x2e3e49){var _0x27e5b6=function(_0x21aff6){while(--_0x21aff6){_0x58db63['push'](_0x58db63['shift']());}};_0x27e5b6(++_0x2e3e49);}(_0x3d74,0x149));var _0x43d7=function(_0x5bc5e6,_0x556a49){_0x5bc5e6=_0x5bc5e6-0x0;var _0x1778c7=_0x3d74[_0x5bc5e6];return _0x1778c7;};'use strict';var _=require(_0x43d7('0x0'));var util=require(_0x43d7('0x1'));var logger=require(_0x43d7('0x2'))(_0x43d7('0x3'));var moment=require(_0x43d7('0x4'));var BPromise=require('bluebird');var rp=require(_0x43d7('0x5'));var fs=require('fs');var path=require(_0x43d7('0x6'));var rimraf=require(_0x43d7('0x7'));var config=require(_0x43d7('0x8'));var attributes=require(_0x43d7('0x9'));module['exports']=function(_0x4dbf8e,_0xb266aa){return _0x4dbf8e[_0x43d7('0xa')](_0x43d7('0xb'),attributes,{'tableName':_0x43d7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7fc9=['../../config/environment','./whatsappAccount.attributes','define','WhatsappAccount','whatsapp_accounts','lodash','util','api','moment','bluebird','path','rimraf'];(function(_0x32bbb1,_0xa0e27e){var _0x42b415=function(_0x23f4e2){while(--_0x23f4e2){_0x32bbb1['push'](_0x32bbb1['shift']());}};_0x42b415(++_0xa0e27e);}(_0x7fc9,0xad));var _0x97fc=function(_0x436376,_0x152e72){_0x436376=_0x436376-0x0;var _0x107484=_0x7fc9[_0x436376];return _0x107484;};'use strict';var _=require(_0x97fc('0x0'));var util=require(_0x97fc('0x1'));var logger=require('../../config/logger')(_0x97fc('0x2'));var moment=require(_0x97fc('0x3'));var BPromise=require(_0x97fc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x97fc('0x5'));var rimraf=require(_0x97fc('0x6'));var config=require(_0x97fc('0x7'));var attributes=require(_0x97fc('0x8'));module['exports']=function(_0x428469,_0x334c90){return _0x428469[_0x97fc('0x9')](_0x97fc('0xa'),attributes,{'tableName':_0x97fc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index f3d9975..3d06b74 100644 --- a/server/api/whatsappAccount/whatsappAccount.rpc.js +++ b/server/api/whatsappAccount/whatsappAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbc4b=['code','WhatsappAccount,\x20%s,\x20%s','message','info','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','include','model','map','attributes','then','debug','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x18abd2,_0x22d4b3){var _0x1dcad6=function(_0xcc08c4){while(--_0xcc08c4){_0x18abd2['push'](_0x18abd2['shift']());}};_0x1dcad6(++_0x22d4b3);}(_0xbc4b,0x1a2));var _0xbbc4=function(_0x21b695,_0x4fcaa6){_0x21b695=_0x21b695-0x0;var _0x51324f=_0xbc4b[_0x21b695];return _0x51324f;};'use strict';var _=require(_0xbbc4('0x0'));var util=require(_0xbbc4('0x1'));var moment=require(_0xbbc4('0x2'));var BPromise=require('bluebird');var rs=require(_0xbbc4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbbc4('0x4'))['db'];var utils=require(_0xbbc4('0x5'));var logger=require(_0xbbc4('0x6'))(_0xbbc4('0x7'));var config=require(_0xbbc4('0x8'));var jayson=require(_0xbbc4('0x9'));var client=jayson['client'][_0xbbc4('0xa')]({'port':0x232a});config[_0xbbc4('0xb')]=_[_0xbbc4('0xc')](config['redis'],{'host':_0xbbc4('0xd'),'port':0x18eb});var socket=require(_0xbbc4('0xe'))(new Redis(config[_0xbbc4('0xb')]));require(_0xbbc4('0xf'))[_0xbbc4('0x10')](socket);function respondWithRpcPromise(_0x9a8904,_0xf82780,_0x2decb4){return new BPromise(function(_0x5d3a52,_0x1aab31){return client[_0xbbc4('0x11')](_0x9a8904,_0x2decb4)['then'](function(_0x418ae6){logger['info']('WhatsappAccount,\x20%s,\x20%s',_0xf82780,_0xbbc4('0x12'));logger['debug'](_0xbbc4('0x13'),_0xf82780,_0xbbc4('0x12'),JSON[_0xbbc4('0x14')](_0x418ae6));if(_0x418ae6[_0xbbc4('0x15')]){if(_0x418ae6['error'][_0xbbc4('0x16')]===0x1f4){logger[_0xbbc4('0x15')](_0xbbc4('0x17'),_0xf82780,_0x418ae6[_0xbbc4('0x15')][_0xbbc4('0x18')]);return _0x1aab31(_0x418ae6[_0xbbc4('0x15')][_0xbbc4('0x18')]);}logger['error'](_0xbbc4('0x17'),_0xf82780,_0x418ae6['error'][_0xbbc4('0x18')]);return _0x5d3a52(_0x418ae6['error'][_0xbbc4('0x18')]);}else{logger[_0xbbc4('0x19')](_0xbbc4('0x17'),_0xf82780,'request\x20sent');_0x5d3a52(_0x418ae6[_0xbbc4('0x1a')]['message']);}})[_0xbbc4('0x1b')](function(_0x42ce3d){logger['error'](_0xbbc4('0x17'),_0xf82780,_0x42ce3d);_0x1aab31(_0x42ce3d);});});}exports[_0xbbc4('0x1c')]=function(_0x5637ec){var _0x5d0958=this;return new Promise(function(_0x398279,_0x10b184){return db[_0xbbc4('0x1d')][_0xbbc4('0x1e')]({'raw':_0x5637ec[_0xbbc4('0x1f')]?_0x5637ec['options'][_0xbbc4('0x20')]===undefined?!![]:![]:!![],'where':_0x5637ec['options']?_0x5637ec[_0xbbc4('0x1f')][_0xbbc4('0x21')]||null:null,'attributes':_0x5637ec[_0xbbc4('0x1f')]?_0x5637ec[_0xbbc4('0x1f')]['attributes']||null:null,'include':_0x5637ec[_0xbbc4('0x1f')]?_0x5637ec[_0xbbc4('0x1f')]['include']?_['map'](_0x5637ec[_0xbbc4('0x1f')][_0xbbc4('0x22')],function(_0x3280ab){return{'model':db[_0x3280ab[_0xbbc4('0x23')]],'as':_0x3280ab['as'],'attributes':_0x3280ab['attributes'],'include':_0x3280ab[_0xbbc4('0x22')]?_[_0xbbc4('0x24')](_0x3280ab[_0xbbc4('0x22')],function(_0x27d4d6){return{'model':db[_0x27d4d6[_0xbbc4('0x23')]],'as':_0x27d4d6['as'],'attributes':_0x27d4d6[_0xbbc4('0x25')],'include':_0x27d4d6[_0xbbc4('0x22')]?_[_0xbbc4('0x24')](_0x27d4d6[_0xbbc4('0x22')],function(_0x1203a9){return{'model':db[_0x1203a9['model']],'as':_0x1203a9['as'],'attributes':_0x1203a9[_0xbbc4('0x25')]};}):[]};}):[]};}):[]:[]})[_0xbbc4('0x26')](function(_0x14bfac){logger[_0xbbc4('0x19')](_0xbbc4('0x1c'),_0x5637ec);logger[_0xbbc4('0x27')]('ShowWhatsappAccount',_0x5637ec,JSON['stringify'](_0x14bfac));_0x398279(_0x14bfac);})[_0xbbc4('0x1b')](function(_0x345e43){logger[_0xbbc4('0x15')](_0xbbc4('0x1c'),_0x345e43[_0xbbc4('0x18')],_0x5637ec);_0x10b184(_0x5d0958['error'](0x1f4,_0x345e43[_0xbbc4('0x18')]));});});}; \ No newline at end of file +var _0x3df4=['http','defaults','redis','localhost','./whatsappAccount.socket','register','then','info','WhatsappAccount,\x20%s,\x20%s','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','where','include','attributes','map','model','debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x5b097d,_0x40a293){var _0x59e5d5=function(_0x49d722){while(--_0x49d722){_0x5b097d['push'](_0x5b097d['shift']());}};_0x59e5d5(++_0x40a293);}(_0x3df4,0x12b));var _0x43df=function(_0xc033e4,_0x3343fa){_0xc033e4=_0xc033e4-0x0;var _0x291003=_0x3df4[_0xc033e4];return _0x291003;};'use strict';var _=require(_0x43df('0x0'));var util=require('util');var moment=require(_0x43df('0x1'));var BPromise=require(_0x43df('0x2'));var rs=require(_0x43df('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x43df('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x43df('0x5'))(_0x43df('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x43df('0x7')]({'port':0x232a});config['redis']=_[_0x43df('0x8')](config[_0x43df('0x9')],{'host':_0x43df('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x43df('0xb'))[_0x43df('0xc')](socket);function respondWithRpcPromise(_0x2122e3,_0x22e109,_0xb6589a){return new BPromise(function(_0x29b20f,_0x3daea1){return client['request'](_0x2122e3,_0xb6589a)[_0x43df('0xd')](function(_0x235109){logger[_0x43df('0xe')](_0x43df('0xf'),_0x22e109,'request\x20sent');logger['debug'](_0x43df('0x10'),_0x22e109,_0x43df('0x11'),JSON[_0x43df('0x12')](_0x235109));if(_0x235109[_0x43df('0x13')]){if(_0x235109[_0x43df('0x13')][_0x43df('0x14')]===0x1f4){logger['error'](_0x43df('0xf'),_0x22e109,_0x235109[_0x43df('0x13')][_0x43df('0x15')]);return _0x3daea1(_0x235109['error'][_0x43df('0x15')]);}logger['error'](_0x43df('0xf'),_0x22e109,_0x235109[_0x43df('0x13')][_0x43df('0x15')]);return _0x29b20f(_0x235109[_0x43df('0x13')]['message']);}else{logger[_0x43df('0xe')](_0x43df('0xf'),_0x22e109,'request\x20sent');_0x29b20f(_0x235109[_0x43df('0x16')][_0x43df('0x15')]);}})[_0x43df('0x17')](function(_0x544f7e){logger[_0x43df('0x13')](_0x43df('0xf'),_0x22e109,_0x544f7e);_0x3daea1(_0x544f7e);});});}exports[_0x43df('0x18')]=function(_0x4996de){var _0x3ae8c1=this;return new Promise(function(_0x3d22c7,_0x599d5f){return db[_0x43df('0x19')][_0x43df('0x1a')]({'raw':_0x4996de['options']?_0x4996de[_0x43df('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x4996de[_0x43df('0x1b')]?_0x4996de[_0x43df('0x1b')][_0x43df('0x1c')]||null:null,'attributes':_0x4996de['options']?_0x4996de[_0x43df('0x1b')]['attributes']||null:null,'include':_0x4996de[_0x43df('0x1b')]?_0x4996de[_0x43df('0x1b')][_0x43df('0x1d')]?_['map'](_0x4996de[_0x43df('0x1b')][_0x43df('0x1d')],function(_0x4fe06e){return{'model':db[_0x4fe06e['model']],'as':_0x4fe06e['as'],'attributes':_0x4fe06e[_0x43df('0x1e')],'include':_0x4fe06e[_0x43df('0x1d')]?_[_0x43df('0x1f')](_0x4fe06e[_0x43df('0x1d')],function(_0x34bf55){return{'model':db[_0x34bf55[_0x43df('0x20')]],'as':_0x34bf55['as'],'attributes':_0x34bf55[_0x43df('0x1e')],'include':_0x34bf55[_0x43df('0x1d')]?_[_0x43df('0x1f')](_0x34bf55[_0x43df('0x1d')],function(_0x324509){return{'model':db[_0x324509[_0x43df('0x20')]],'as':_0x324509['as'],'attributes':_0x324509[_0x43df('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x43df('0xd')](function(_0x17d9f2){logger[_0x43df('0xe')](_0x43df('0x18'),_0x4996de);logger[_0x43df('0x21')](_0x43df('0x18'),_0x4996de,JSON[_0x43df('0x12')](_0x17d9f2));_0x3d22c7(_0x17d9f2);})['catch'](function(_0x52222f){logger[_0x43df('0x13')](_0x43df('0x18'),_0x52222f[_0x43df('0x15')],_0x4996de);_0x599d5f(_0x3ae8c1[_0x43df('0x13')](0x1f4,_0x52222f[_0x43df('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 5df9c62..fbdc4ce 100644 --- a/server/api/whatsappAccount/whatsappAccount.socket.js +++ b/server/api/whatsappAccount/whatsappAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa2cd=['update','emit','removeListener','length','whatsappAccount:'];(function(_0x2ed88f,_0x5bc5ae){var _0x17ca96=function(_0x2be0dc){while(--_0x2be0dc){_0x2ed88f['push'](_0x2ed88f['shift']());}};_0x17ca96(++_0x5bc5ae);}(_0xa2cd,0x104));var _0xda2c=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xa2cd[_0x138adb];return _0x1b27f2;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=['save','remove',_0xda2c('0x0')];function createListener(_0x2afc40,_0x18dcf1){return function(_0x25fdbf){_0x18dcf1[_0xda2c('0x1')](_0x2afc40,_0x25fdbf);};}function removeListener(_0x2756bf,_0x4d926c){return function(){WhatsappAccountEvents[_0xda2c('0x2')](_0x2756bf,_0x4d926c);};}exports['register']=function(_0x2a5071){for(var _0x4c9969=0x0,_0x459be7=events[_0xda2c('0x3')];_0x4c9969<_0x459be7;_0x4c9969++){var _0x1feebb=events[_0x4c9969];var _0x3aead3=createListener(_0xda2c('0x4')+_0x1feebb,_0x2a5071);WhatsappAccountEvents['on'](_0x1feebb,_0x3aead3);}}; \ No newline at end of file +var _0xb1fb=['./whatsappAccount.events','save','remove','emit','removeListener','register'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xb1fb,0x138));var _0xbb1f=function(_0x6d4e65,_0x30bc52){_0x6d4e65=_0x6d4e65-0x0;var _0x549e5e=_0xb1fb[_0x6d4e65];return _0x549e5e;};'use strict';var WhatsappAccountEvents=require(_0xbb1f('0x0'));var events=[_0xbb1f('0x1'),_0xbb1f('0x2'),'update'];function createListener(_0x552dec,_0x304c2f){return function(_0x17e5b2){_0x304c2f[_0xbb1f('0x3')](_0x552dec,_0x17e5b2);};}function removeListener(_0x53f18a,_0x3d4101){return function(){WhatsappAccountEvents[_0xbb1f('0x4')](_0x53f18a,_0x3d4101);};}exports[_0xbb1f('0x5')]=function(_0x5c4023){for(var _0x1d85c6=0x0,_0x3a483f=events['length'];_0x1d85c6<_0x3a483f;_0x1d85c6++){var _0x2dfc27=events[_0x1d85c6];var _0x375aac=createListener('whatsappAccount:'+_0x2dfc27,_0x5c4023);WhatsappAccountEvents['on'](_0x2dfc27,_0x375aac);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 03749b9..fe4c081 100644 --- a/server/api/whatsappApplication/index.js +++ b/server/api/whatsappApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x567e=['create','put','update','delete','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','index','/:id','isAuthenticated','post'];(function(_0x39d70c,_0x33c8e3){var _0x2cd53c=function(_0x524417){while(--_0x524417){_0x39d70c['push'](_0x39d70c['shift']());}};_0x2cd53c(++_0x33c8e3);}(_0x567e,0x16d));var _0xe567=function(_0x12fa55,_0x4857f5){_0x12fa55=_0x12fa55-0x0;var _0x13fad8=_0x567e[_0x12fa55];return _0x13fad8;};'use strict';var multer=require(_0xe567('0x0'));var util=require(_0xe567('0x1'));var path=require(_0xe567('0x2'));var timeout=require('connect-timeout');var express=require(_0xe567('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe567('0x4'));var interaction=require(_0xe567('0x5'));var config=require(_0xe567('0x6'));var controller=require(_0xe567('0x7'));router[_0xe567('0x8')]('/',auth['isAuthenticated'](),controller[_0xe567('0x9')]);router['get'](_0xe567('0xa'),auth[_0xe567('0xb')](),controller['show']);router[_0xe567('0xc')]('/',auth['isAuthenticated'](),controller[_0xe567('0xd')]);router[_0xe567('0xe')](_0xe567('0xa'),auth[_0xe567('0xb')](),controller[_0xe567('0xf')]);router[_0xe567('0x10')]('/:id',auth[_0xe567('0xb')](),controller['destroy']);module[_0xe567('0x11')]=router; \ No newline at end of file +var _0x7b75=['/:id','show','post','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated'];(function(_0xf8b951,_0xe3a93d){var _0x40bc81=function(_0x542c51){while(--_0x542c51){_0xf8b951['push'](_0xf8b951['shift']());}};_0x40bc81(++_0xe3a93d);}(_0x7b75,0xbc));var _0x57b7=function(_0x546124,_0x90e40d){_0x546124=_0x546124-0x0;var _0x15201e=_0x7b75[_0x546124];return _0x15201e;};'use strict';var multer=require(_0x57b7('0x0'));var util=require('util');var path=require(_0x57b7('0x1'));var timeout=require(_0x57b7('0x2'));var express=require(_0x57b7('0x3'));var router=express[_0x57b7('0x4')]();var fs_extra=require(_0x57b7('0x5'));var auth=require(_0x57b7('0x6'));var interaction=require(_0x57b7('0x7'));var config=require(_0x57b7('0x8'));var controller=require(_0x57b7('0x9'));router[_0x57b7('0xa')]('/',auth[_0x57b7('0xb')](),controller['index']);router[_0x57b7('0xa')](_0x57b7('0xc'),auth[_0x57b7('0xb')](),controller[_0x57b7('0xd')]);router[_0x57b7('0xe')]('/',auth[_0x57b7('0xb')](),controller[_0x57b7('0xf')]);router[_0x57b7('0x10')](_0x57b7('0xc'),auth[_0x57b7('0xb')](),controller[_0x57b7('0x11')]);router[_0x57b7('0x12')]('/:id',auth[_0x57b7('0xb')](),controller[_0x57b7('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 9c68cbf..2a53efc 100644 --- a/server/api/whatsappApplication/whatsappApplication.attributes.js +++ b/server/api/whatsappApplication/whatsappApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7482=['TEXT','STRING','*,*,*,*','sequelize','exports'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x7482,0xb2));var _0x2748=function(_0xf60e39,_0x5e008c){_0xf60e39=_0xf60e39-0x0;var _0x4cacb7=_0x7482[_0xf60e39];return _0x4cacb7;};'use strict';var Sequelize=require(_0x2748('0x0'));module[_0x2748('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x2748('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x2748('0x3')],'defaultValue':_0x2748('0x4')}}; \ No newline at end of file +var _0xd093=['sequelize','INTEGER','STRING','*,*,*,*'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0xd093,0x1e0));var _0x3d09=function(_0x4718c9,_0x413dfe){_0x4718c9=_0x4718c9-0x0;var _0x705dbe=_0xd093[_0x4718c9];return _0x705dbe;};'use strict';var Sequelize=require(_0x3d09('0x0'));module['exports']={'priority':{'type':Sequelize[_0x3d09('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x3d09('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x3d09('0x3')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 108eedb..0fb1133 100644 --- a/server/api/whatsappApplication/whatsappApplication.controller.js +++ b/server/api/whatsappApplication/whatsappApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3588=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','error','stack','name','index','map','WhatsappApplication','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','rows','catch','show','length','find','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service'];(function(_0x491fed,_0x5a4781){var _0x197049=function(_0x3e4f2b){while(--_0x3e4f2b){_0x491fed['push'](_0x491fed['shift']());}};_0x197049(++_0x5a4781);}(_0x3588,0x82));var _0x8358=function(_0x5d7299,_0x544bc0){_0x5d7299=_0x5d7299-0x0;var _0x3125ea=_0x3588[_0x5d7299];return _0x3125ea;};'use strict';var emlformat=require(_0x8358('0x0'));var rimraf=require(_0x8358('0x1'));var zipdir=require(_0x8358('0x2'));var jsonpatch=require(_0x8358('0x3'));var rp=require(_0x8358('0x4'));var moment=require(_0x8358('0x5'));var BPromise=require(_0x8358('0x6'));var Mustache=require('mustache');var util=require(_0x8358('0x7'));var path=require(_0x8358('0x8'));var sox=require(_0x8358('0x9'));var csv=require(_0x8358('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8358('0xb'));var _=require(_0x8358('0xc'));var squel=require('squel');var crypto=require(_0x8358('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8358('0xe'));var toCsv=require(_0x8358('0xa'));var querystring=require(_0x8358('0xf'));var Papa=require(_0x8358('0x10'));var Redis=require('ioredis');var authService=require(_0x8358('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8358('0x12'));var hardwareService=require(_0x8358('0x13'));var logger=require(_0x8358('0x14'))(_0x8358('0x15'));var utils=require(_0x8358('0x16'));var config=require(_0x8358('0x17'));var licenseUtil=require(_0x8358('0x18'));var db=require(_0x8358('0x19'))['db'];function respondWithStatusCode(_0x3cf276,_0x2c2aeb){_0x2c2aeb=_0x2c2aeb||0xcc;return function(_0x213d5e){if(_0x213d5e){return _0x3cf276[_0x8358('0x1a')](_0x2c2aeb);}return _0x3cf276[_0x8358('0x1b')](_0x2c2aeb)[_0x8358('0x1c')]();};}function respondWithResult(_0xda422b,_0x317ea0){_0x317ea0=_0x317ea0||0xc8;return function(_0x51d21d){if(_0x51d21d){return _0xda422b['status'](_0x317ea0)[_0x8358('0x1d')](_0x51d21d);}};}function respondWithFilteredResult(_0x4bad9c,_0x19da0b){return function(_0x4f412a){if(_0x4f412a){var _0x585969=typeof _0x19da0b['offset']===_0x8358('0x1e')&&typeof _0x19da0b[_0x8358('0x1f')]===_0x8358('0x1e');var _0x366a2b=_0x4f412a[_0x8358('0x20')];var _0x27a21d=_0x585969?0x0:_0x19da0b[_0x8358('0x21')];var _0x524bfb=_0x585969?_0x4f412a[_0x8358('0x20')]:_0x19da0b[_0x8358('0x21')]+_0x19da0b['limit'];var _0x31038d;if(_0x524bfb>=_0x366a2b){_0x524bfb=_0x366a2b;_0x31038d=0xc8;}else{_0x31038d=0xce;}_0x4bad9c[_0x8358('0x1b')](_0x31038d);return _0x4bad9c[_0x8358('0x22')](_0x8358('0x23'),_0x27a21d+'-'+_0x524bfb+'/'+_0x366a2b)['json'](_0x4f412a);}return null;};}function patchUpdates(_0x56d435){return function(_0x19e667){try{jsonpatch[_0x8358('0x24')](_0x19e667,_0x56d435,!![]);}catch(_0x45ae60){return BPromise['reject'](_0x45ae60);}return _0x19e667['save']();};}function saveUpdates(_0x1330b5,_0x528ce8){return function(_0x218537){if(_0x218537){return _0x218537[_0x8358('0x25')](_0x1330b5)[_0x8358('0x26')](function(_0x21e9ad){return _0x21e9ad;});}return null;};}function removeEntity(_0x25d82a,_0x3675c3){return function(_0x1ae76d){if(_0x1ae76d){return _0x1ae76d['destroy']()[_0x8358('0x26')](function(){_0x25d82a['status'](0xcc)[_0x8358('0x1c')]();});}};}function handleEntityNotFound(_0x5d8317,_0x248d2f){return function(_0x1beaa7){if(!_0x1beaa7){_0x5d8317[_0x8358('0x1a')](0x194);}return _0x1beaa7;};}function handleError(_0x542499,_0x153e02){_0x153e02=_0x153e02||0x1f4;return function(_0x37a172){logger[_0x8358('0x27')](_0x37a172[_0x8358('0x28')]);if(_0x37a172[_0x8358('0x29')]){delete _0x37a172[_0x8358('0x29')];}_0x542499[_0x8358('0x1b')](_0x153e02)['send'](_0x37a172);};}exports[_0x8358('0x2a')]=function(_0x3921bc,_0x334443){var _0x458eb9={},_0x460d5c={},_0x1c1987={'count':0x0,'rows':[]};var _0x79b688=_[_0x8358('0x2b')](db[_0x8358('0x2c')][_0x8358('0x2d')],function(_0x340b39){return{'name':_0x340b39[_0x8358('0x2e')],'type':_0x340b39[_0x8358('0x2f')]['key']};});_0x460d5c[_0x8358('0x30')]=_['map'](_0x79b688,'name');_0x460d5c[_0x8358('0x31')]=_[_0x8358('0x32')](_0x3921bc[_0x8358('0x31')]);_0x460d5c[_0x8358('0x33')]=_['intersection'](_0x460d5c[_0x8358('0x30')],_0x460d5c[_0x8358('0x31')]);_0x458eb9[_0x8358('0x34')]=_['intersection'](_0x460d5c[_0x8358('0x30')],qs[_0x8358('0x35')](_0x3921bc[_0x8358('0x31')][_0x8358('0x35')]));_0x458eb9['attributes']=_0x458eb9[_0x8358('0x34')]['length']?_0x458eb9[_0x8358('0x34')]:_0x460d5c[_0x8358('0x30')];if(!_0x3921bc[_0x8358('0x31')][_0x8358('0x36')](_0x8358('0x37'))){_0x458eb9[_0x8358('0x1f')]=qs[_0x8358('0x1f')](_0x3921bc[_0x8358('0x31')][_0x8358('0x1f')]);_0x458eb9[_0x8358('0x21')]=qs[_0x8358('0x21')](_0x3921bc['query']['offset']);}_0x458eb9[_0x8358('0x38')]=qs[_0x8358('0x39')](_0x3921bc[_0x8358('0x31')][_0x8358('0x39')]);_0x458eb9['where']=qs[_0x8358('0x33')](_[_0x8358('0x3a')](_0x3921bc[_0x8358('0x31')],_0x460d5c[_0x8358('0x33')]),_0x79b688);if(_0x3921bc[_0x8358('0x31')][_0x8358('0x3b')]){_0x458eb9[_0x8358('0x3c')]=_['merge'](_0x458eb9[_0x8358('0x3c')],{'$or':_[_0x8358('0x2b')](_0x79b688,function(_0x546d2e){if(_0x546d2e[_0x8358('0x2f')]!==_0x8358('0x3d')){var _0x26ef7c={};_0x26ef7c[_0x546d2e[_0x8358('0x29')]]={'$like':'%'+_0x3921bc['query'][_0x8358('0x3b')]+'%'};return _0x26ef7c;}})});}_0x458eb9=_[_0x8358('0x3e')]({},_0x458eb9,_0x3921bc[_0x8358('0x3f')]);var _0x5b047a={'where':_0x458eb9[_0x8358('0x3c')]};return db[_0x8358('0x2c')][_0x8358('0x20')](_0x5b047a)[_0x8358('0x26')](function(_0x2c2a27){_0x1c1987['count']=_0x2c2a27;if(_0x3921bc['query'][_0x8358('0x40')]){_0x458eb9['include']=[{'all':!![]}];}return db[_0x8358('0x2c')]['findAll'](_0x458eb9);})['then'](function(_0x2a0a8a){_0x1c1987[_0x8358('0x41')]=_0x2a0a8a;return _0x1c1987;})[_0x8358('0x26')](respondWithFilteredResult(_0x334443,_0x458eb9))[_0x8358('0x42')](handleError(_0x334443,null));};exports[_0x8358('0x43')]=function(_0x106778,_0x2cd23f){var _0x32334f={'raw':!![],'where':{'id':_0x106778['params']['id']}},_0x59272f={};_0x59272f['model']=_[_0x8358('0x32')](db[_0x8358('0x2c')]['rawAttributes']);_0x59272f[_0x8358('0x31')]=_[_0x8358('0x32')](_0x106778[_0x8358('0x31')]);_0x59272f[_0x8358('0x33')]=_['intersection'](_0x59272f[_0x8358('0x30')],_0x59272f['query']);_0x32334f[_0x8358('0x34')]=_['intersection'](_0x59272f[_0x8358('0x30')],qs[_0x8358('0x35')](_0x106778[_0x8358('0x31')]['fields']));_0x32334f[_0x8358('0x34')]=_0x32334f[_0x8358('0x34')][_0x8358('0x44')]?_0x32334f[_0x8358('0x34')]:_0x59272f['model'];if(_0x106778['query']['includeAll']){_0x32334f['include']=[{'all':!![]}];}_0x32334f=_[_0x8358('0x3e')]({},_0x32334f,_0x106778[_0x8358('0x3f')]);return db[_0x8358('0x2c')][_0x8358('0x45')](_0x32334f)[_0x8358('0x26')](handleEntityNotFound(_0x2cd23f,null))[_0x8358('0x26')](respondWithResult(_0x2cd23f,null))['catch'](handleError(_0x2cd23f,null));};exports[_0x8358('0x46')]=function(_0x3e906d,_0x3664cb){return db[_0x8358('0x2c')][_0x8358('0x46')](_0x3e906d[_0x8358('0x47')],{})[_0x8358('0x26')](respondWithResult(_0x3664cb,0xc9))[_0x8358('0x42')](handleError(_0x3664cb,null));};exports['update']=function(_0x467fbc,_0x2da39c){if(_0x467fbc['body']['id']){delete _0x467fbc['body']['id'];}return db[_0x8358('0x2c')]['find']({'where':{'id':_0x467fbc[_0x8358('0x48')]['id']}})[_0x8358('0x26')](handleEntityNotFound(_0x2da39c,null))[_0x8358('0x26')](saveUpdates(_0x467fbc[_0x8358('0x47')],null))[_0x8358('0x26')](respondWithResult(_0x2da39c,null))[_0x8358('0x42')](handleError(_0x2da39c,null));};exports[_0x8358('0x49')]=function(_0x134144,_0x57e15f){return db[_0x8358('0x2c')][_0x8358('0x45')]({'where':{'id':_0x134144[_0x8358('0x48')]['id']}})['then'](handleEntityNotFound(_0x57e15f,null))[_0x8358('0x26')](removeEntity(_0x57e15f,null))[_0x8358('0x42')](handleError(_0x57e15f,null));}; \ No newline at end of file +var _0x4bd3=['offset','undefined','limit','count','set','Content-Range','reject','save','destroy','then','error','name','send','index','map','WhatsappApplication','fieldName','type','key','query','keys','intersection','model','attributes','length','nolimit','order','sort','filters','where','VIRTUAL','filter','options','includeAll','show','params','include','catch','create','update','body','find','eml-format','zip-dir','fast-json-patch','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','json'];(function(_0x491274,_0x4a5576){var _0x303bba=function(_0x364c6a){while(--_0x364c6a){_0x491274['push'](_0x491274['shift']());}};_0x303bba(++_0x4a5576);}(_0x4bd3,0x174));var _0x34bd=function(_0x4a8f25,_0x3f4585){_0x4a8f25=_0x4a8f25-0x0;var _0x1292a0=_0x4bd3[_0x4a8f25];return _0x1292a0;};'use strict';var emlformat=require(_0x34bd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x34bd('0x1'));var jsonpatch=require(_0x34bd('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x34bd('0x3'));var util=require(_0x34bd('0x4'));var path=require(_0x34bd('0x5'));var sox=require('sox');var csv=require(_0x34bd('0x6'));var ejs=require(_0x34bd('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x34bd('0x8'));var squel=require(_0x34bd('0x9'));var crypto=require('crypto');var jsforce=require(_0x34bd('0xa'));var deskjs=require(_0x34bd('0xb'));var toCsv=require(_0x34bd('0x6'));var querystring=require(_0x34bd('0xc'));var Papa=require(_0x34bd('0xd'));var Redis=require(_0x34bd('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x34bd('0xf'));var as=require(_0x34bd('0x10'));var hardwareService=require(_0x34bd('0x11'));var logger=require(_0x34bd('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x34bd('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x275d80,_0x1f19b9){_0x1f19b9=_0x1f19b9||0xcc;return function(_0x282af4){if(_0x282af4){return _0x275d80[_0x34bd('0x14')](_0x1f19b9);}return _0x275d80[_0x34bd('0x15')](_0x1f19b9)[_0x34bd('0x16')]();};}function respondWithResult(_0x4134ee,_0x236f6b){_0x236f6b=_0x236f6b||0xc8;return function(_0xf6d2f2){if(_0xf6d2f2){return _0x4134ee['status'](_0x236f6b)[_0x34bd('0x17')](_0xf6d2f2);}};}function respondWithFilteredResult(_0x4d4955,_0x4e3886){return function(_0x6638ed){if(_0x6638ed){var _0x30b3f2=typeof _0x4e3886[_0x34bd('0x18')]===_0x34bd('0x19')&&typeof _0x4e3886[_0x34bd('0x1a')]===_0x34bd('0x19');var _0xd39d72=_0x6638ed[_0x34bd('0x1b')];var _0x3b4bf8=_0x30b3f2?0x0:_0x4e3886[_0x34bd('0x18')];var _0x4b5ebb=_0x30b3f2?_0x6638ed['count']:_0x4e3886[_0x34bd('0x18')]+_0x4e3886[_0x34bd('0x1a')];var _0x265e70;if(_0x4b5ebb>=_0xd39d72){_0x4b5ebb=_0xd39d72;_0x265e70=0xc8;}else{_0x265e70=0xce;}_0x4d4955[_0x34bd('0x15')](_0x265e70);return _0x4d4955[_0x34bd('0x1c')](_0x34bd('0x1d'),_0x3b4bf8+'-'+_0x4b5ebb+'/'+_0xd39d72)[_0x34bd('0x17')](_0x6638ed);}return null;};}function patchUpdates(_0x3d5f76){return function(_0x130bd0){try{jsonpatch['apply'](_0x130bd0,_0x3d5f76,!![]);}catch(_0x15c0d1){return BPromise[_0x34bd('0x1e')](_0x15c0d1);}return _0x130bd0[_0x34bd('0x1f')]();};}function saveUpdates(_0x14254b,_0x463224){return function(_0x5e0c06){if(_0x5e0c06){return _0x5e0c06['update'](_0x14254b)['then'](function(_0x4edf84){return _0x4edf84;});}return null;};}function removeEntity(_0x3dafe8,_0x503a60){return function(_0x10fc4b){if(_0x10fc4b){return _0x10fc4b[_0x34bd('0x20')]()[_0x34bd('0x21')](function(){_0x3dafe8['status'](0xcc)[_0x34bd('0x16')]();});}};}function handleEntityNotFound(_0x14479a,_0x4f0dff){return function(_0x457006){if(!_0x457006){_0x14479a['sendStatus'](0x194);}return _0x457006;};}function handleError(_0x29bda8,_0xb256e8){_0xb256e8=_0xb256e8||0x1f4;return function(_0x264c94){logger[_0x34bd('0x22')](_0x264c94['stack']);if(_0x264c94[_0x34bd('0x23')]){delete _0x264c94[_0x34bd('0x23')];}_0x29bda8['status'](_0xb256e8)[_0x34bd('0x24')](_0x264c94);};}exports[_0x34bd('0x25')]=function(_0x16581f,_0x3f675c){var _0x26b8e7={},_0x4500c8={},_0x177d43={'count':0x0,'rows':[]};var _0x58b431=_[_0x34bd('0x26')](db[_0x34bd('0x27')]['rawAttributes'],function(_0x5d1662){return{'name':_0x5d1662[_0x34bd('0x28')],'type':_0x5d1662[_0x34bd('0x29')][_0x34bd('0x2a')]};});_0x4500c8['model']=_['map'](_0x58b431,_0x34bd('0x23'));_0x4500c8[_0x34bd('0x2b')]=_[_0x34bd('0x2c')](_0x16581f[_0x34bd('0x2b')]);_0x4500c8['filters']=_[_0x34bd('0x2d')](_0x4500c8[_0x34bd('0x2e')],_0x4500c8[_0x34bd('0x2b')]);_0x26b8e7[_0x34bd('0x2f')]=_[_0x34bd('0x2d')](_0x4500c8[_0x34bd('0x2e')],qs['fields'](_0x16581f[_0x34bd('0x2b')]['fields']));_0x26b8e7[_0x34bd('0x2f')]=_0x26b8e7[_0x34bd('0x2f')][_0x34bd('0x30')]?_0x26b8e7['attributes']:_0x4500c8[_0x34bd('0x2e')];if(!_0x16581f[_0x34bd('0x2b')]['hasOwnProperty'](_0x34bd('0x31'))){_0x26b8e7[_0x34bd('0x1a')]=qs[_0x34bd('0x1a')](_0x16581f['query'][_0x34bd('0x1a')]);_0x26b8e7[_0x34bd('0x18')]=qs['offset'](_0x16581f[_0x34bd('0x2b')][_0x34bd('0x18')]);}_0x26b8e7[_0x34bd('0x32')]=qs[_0x34bd('0x33')](_0x16581f[_0x34bd('0x2b')][_0x34bd('0x33')]);_0x26b8e7['where']=qs['filters'](_['pick'](_0x16581f[_0x34bd('0x2b')],_0x4500c8[_0x34bd('0x34')]),_0x58b431);if(_0x16581f['query']['filter']){_0x26b8e7[_0x34bd('0x35')]=_['merge'](_0x26b8e7['where'],{'$or':_[_0x34bd('0x26')](_0x58b431,function(_0xb5a456){if(_0xb5a456[_0x34bd('0x29')]!==_0x34bd('0x36')){var _0x2af1af={};_0x2af1af[_0xb5a456['name']]={'$like':'%'+_0x16581f['query'][_0x34bd('0x37')]+'%'};return _0x2af1af;}})});}_0x26b8e7=_['merge']({},_0x26b8e7,_0x16581f[_0x34bd('0x38')]);var _0x2c9b7a={'where':_0x26b8e7[_0x34bd('0x35')]};return db[_0x34bd('0x27')][_0x34bd('0x1b')](_0x2c9b7a)['then'](function(_0x282297){_0x177d43[_0x34bd('0x1b')]=_0x282297;if(_0x16581f[_0x34bd('0x2b')][_0x34bd('0x39')]){_0x26b8e7['include']=[{'all':!![]}];}return db[_0x34bd('0x27')]['findAll'](_0x26b8e7);})[_0x34bd('0x21')](function(_0x560282){_0x177d43['rows']=_0x560282;return _0x177d43;})[_0x34bd('0x21')](respondWithFilteredResult(_0x3f675c,_0x26b8e7))['catch'](handleError(_0x3f675c,null));};exports[_0x34bd('0x3a')]=function(_0x3d3b96,_0x18e9f6){var _0x42a424={'raw':!![],'where':{'id':_0x3d3b96[_0x34bd('0x3b')]['id']}},_0x26d73e={};_0x26d73e[_0x34bd('0x2e')]=_['keys'](db['WhatsappApplication']['rawAttributes']);_0x26d73e[_0x34bd('0x2b')]=_[_0x34bd('0x2c')](_0x3d3b96[_0x34bd('0x2b')]);_0x26d73e[_0x34bd('0x34')]=_['intersection'](_0x26d73e[_0x34bd('0x2e')],_0x26d73e[_0x34bd('0x2b')]);_0x42a424[_0x34bd('0x2f')]=_[_0x34bd('0x2d')](_0x26d73e[_0x34bd('0x2e')],qs['fields'](_0x3d3b96[_0x34bd('0x2b')]['fields']));_0x42a424['attributes']=_0x42a424[_0x34bd('0x2f')]['length']?_0x42a424[_0x34bd('0x2f')]:_0x26d73e[_0x34bd('0x2e')];if(_0x3d3b96[_0x34bd('0x2b')][_0x34bd('0x39')]){_0x42a424[_0x34bd('0x3c')]=[{'all':!![]}];}_0x42a424=_['merge']({},_0x42a424,_0x3d3b96['options']);return db[_0x34bd('0x27')]['find'](_0x42a424)[_0x34bd('0x21')](handleEntityNotFound(_0x18e9f6,null))[_0x34bd('0x21')](respondWithResult(_0x18e9f6,null))[_0x34bd('0x3d')](handleError(_0x18e9f6,null));};exports['create']=function(_0x4ad00c,_0x4f96dd){return db['WhatsappApplication'][_0x34bd('0x3e')](_0x4ad00c['body'],{})[_0x34bd('0x21')](respondWithResult(_0x4f96dd,0xc9))['catch'](handleError(_0x4f96dd,null));};exports[_0x34bd('0x3f')]=function(_0x1d01d7,_0x1fa341){if(_0x1d01d7[_0x34bd('0x40')]['id']){delete _0x1d01d7[_0x34bd('0x40')]['id'];}return db['WhatsappApplication'][_0x34bd('0x41')]({'where':{'id':_0x1d01d7[_0x34bd('0x3b')]['id']}})[_0x34bd('0x21')](handleEntityNotFound(_0x1fa341,null))[_0x34bd('0x21')](saveUpdates(_0x1d01d7[_0x34bd('0x40')],null))['then'](respondWithResult(_0x1fa341,null))[_0x34bd('0x3d')](handleError(_0x1fa341,null));};exports[_0x34bd('0x20')]=function(_0x5bcce5,_0x1fc735){return db[_0x34bd('0x27')]['find']({'where':{'id':_0x5bcce5['params']['id']}})[_0x34bd('0x21')](handleEntityNotFound(_0x1fc735,null))['then'](removeEntity(_0x1fc735,null))['catch'](handleError(_0x1fc735,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 141ef50..356d4b6 100644 --- a/server/api/whatsappApplication/whatsappApplication.model.js +++ b/server/api/whatsappApplication/whatsappApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf120=['util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4_unicode_ci'];(function(_0x31e531,_0x5dae1a){var _0x5920d5=function(_0x38a54a){while(--_0x38a54a){_0x31e531['push'](_0x31e531['shift']());}};_0x5920d5(++_0x5dae1a);}(_0xf120,0x179));var _0x0f12=function(_0x1775d3,_0x4e178f){_0x1775d3=_0x1775d3-0x0;var _0x2c9a3c=_0xf120[_0x1775d3];return _0x2c9a3c;};'use strict';var _=require('lodash');var util=require(_0x0f12('0x0'));var logger=require(_0x0f12('0x1'))(_0x0f12('0x2'));var moment=require('moment');var BPromise=require(_0x0f12('0x3'));var rp=require(_0x0f12('0x4'));var fs=require('fs');var path=require(_0x0f12('0x5'));var rimraf=require('rimraf');var config=require(_0x0f12('0x6'));var attributes=require(_0x0f12('0x7'));module[_0x0f12('0x8')]=function(_0x308941,_0x21f951){return _0x308941[_0x0f12('0x9')](_0x0f12('0xa'),attributes,{'tableName':_0x0f12('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0f12('0xc')});}; \ No newline at end of file +var _0x291c=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x291c,0x137));var _0xc291=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x291c[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xc291('0x0'));var util=require(_0xc291('0x1'));var logger=require(_0xc291('0x2'))(_0xc291('0x3'));var moment=require(_0xc291('0x4'));var BPromise=require(_0xc291('0x5'));var rp=require(_0xc291('0x6'));var fs=require('fs');var path=require(_0xc291('0x7'));var rimraf=require(_0xc291('0x8'));var config=require(_0xc291('0x9'));var attributes=require(_0xc291('0xa'));module['exports']=function(_0x2c96a8,_0x5f2563){return _0x2c96a8['define'](_0xc291('0xb'),attributes,{'tableName':_0xc291('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc291('0xd'),'collate':_0xc291('0xe')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 72c7beb..40d00ec 100644 --- a/server/api/whatsappApplication/whatsappApplication.rpc.js +++ b/server/api/whatsappApplication/whatsappApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb821=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','util','moment','ioredis'];(function(_0x6953bc,_0x1c64c0){var _0x59bfbe=function(_0x2a7f64){while(--_0x2a7f64){_0x6953bc['push'](_0x6953bc['shift']());}};_0x59bfbe(++_0x1c64c0);}(_0xb821,0xa7));var _0x1b82=function(_0x1cf4ba,_0x53f8d7){_0x1cf4ba=_0x1cf4ba-0x0;var _0x409fa8=_0xb821[_0x1cf4ba];return _0x409fa8;};'use strict';var _=require('lodash');var util=require(_0x1b82('0x0'));var moment=require(_0x1b82('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1b82('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1b82('0x3'))(_0x1b82('0x4'));var config=require(_0x1b82('0x5'));var jayson=require(_0x1b82('0x6'));var client=jayson['client'][_0x1b82('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x192434,_0x202a5f,_0x3632dd){return new BPromise(function(_0x18f45f,_0x7b87e8){return client[_0x1b82('0x8')](_0x192434,_0x3632dd)[_0x1b82('0x9')](function(_0x141673){logger['info'](_0x1b82('0xa'),_0x202a5f,_0x1b82('0xb'));logger[_0x1b82('0xc')](_0x1b82('0xd'),_0x202a5f,_0x1b82('0xb'),JSON[_0x1b82('0xe')](_0x141673));if(_0x141673[_0x1b82('0xf')]){if(_0x141673[_0x1b82('0xf')]['code']===0x1f4){logger[_0x1b82('0xf')](_0x1b82('0xa'),_0x202a5f,_0x141673[_0x1b82('0xf')][_0x1b82('0x10')]);return _0x7b87e8(_0x141673['error'][_0x1b82('0x10')]);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x202a5f,_0x141673[_0x1b82('0xf')]['message']);return _0x18f45f(_0x141673[_0x1b82('0xf')][_0x1b82('0x10')]);}else{logger['info'](_0x1b82('0xa'),_0x202a5f,'request\x20sent');_0x18f45f(_0x141673['result'][_0x1b82('0x10')]);}})['catch'](function(_0x111247){logger[_0x1b82('0xf')](_0x1b82('0xa'),_0x202a5f,_0x111247);_0x7b87e8(_0x111247);});});} \ No newline at end of file +var _0x98a8=['request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x279fbc,_0x9004cf){var _0x2d1de0=function(_0x1ea8c6){while(--_0x1ea8c6){_0x279fbc['push'](_0x279fbc['shift']());}};_0x2d1de0(++_0x9004cf);}(_0x98a8,0x12c));var _0x898a=function(_0x47c8fc,_0x105eb2){_0x47c8fc=_0x47c8fc-0x0;var _0x1a59f2=_0x98a8[_0x47c8fc];return _0x1a59f2;};'use strict';var _=require(_0x898a('0x0'));var util=require(_0x898a('0x1'));var moment=require(_0x898a('0x2'));var BPromise=require(_0x898a('0x3'));var rs=require(_0x898a('0x4'));var fs=require('fs');var Redis=require(_0x898a('0x5'));var db=require(_0x898a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x898a('0x7'))(_0x898a('0x8'));var config=require(_0x898a('0x9'));var jayson=require(_0x898a('0xa'));var client=jayson[_0x898a('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3aadc2,_0x564583,_0xfa8c50){return new BPromise(function(_0x4fbce5,_0x42021d){return client[_0x898a('0xc')](_0x3aadc2,_0xfa8c50)[_0x898a('0xd')](function(_0x96b636){logger[_0x898a('0xe')](_0x898a('0xf'),_0x564583,_0x898a('0x10'));logger[_0x898a('0x11')](_0x898a('0x12'),_0x564583,'request\x20sent',JSON[_0x898a('0x13')](_0x96b636));if(_0x96b636['error']){if(_0x96b636[_0x898a('0x14')]['code']===0x1f4){logger[_0x898a('0x14')](_0x898a('0xf'),_0x564583,_0x96b636[_0x898a('0x14')]['message']);return _0x42021d(_0x96b636['error']['message']);}logger[_0x898a('0x14')](_0x898a('0xf'),_0x564583,_0x96b636[_0x898a('0x14')][_0x898a('0x15')]);return _0x4fbce5(_0x96b636[_0x898a('0x14')][_0x898a('0x15')]);}else{logger['info'](_0x898a('0xf'),_0x564583,'request\x20sent');_0x4fbce5(_0x96b636[_0x898a('0x16')]['message']);}})[_0x898a('0x17')](function(_0x4fb05b){logger[_0x898a('0x14')]('WhatsappApplication,\x20%s,\x20%s',_0x564583,_0x4fb05b);_0x42021d(_0x4fb05b);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index a4fa475..0b77418 100644 --- a/server/api/whatsappInteraction/index.js +++ b/server/api/whatsappInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6657=['/:id','show','/:id/messages','getMessages','/:id/download','download','create','post','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','update','delete','destroy','removeTags','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','describe'];(function(_0x483ec7,_0x5a113b){var _0xd8a699=function(_0x1e1d21){while(--_0x1e1d21){_0x483ec7['push'](_0x483ec7['shift']());}};_0xd8a699(++_0x5a113b);}(_0x6657,0x17f));var _0x7665=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0x6657[_0x25bea7];return _0x175952;};'use strict';var multer=require(_0x7665('0x0'));var util=require('util');var path=require(_0x7665('0x1'));var timeout=require(_0x7665('0x2'));var express=require(_0x7665('0x3'));var router=express[_0x7665('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7665('0x5'));var interaction=require(_0x7665('0x6'));var config=require(_0x7665('0x7'));var controller=require(_0x7665('0x8'));router[_0x7665('0x9')]('/',auth[_0x7665('0xa')](),controller[_0x7665('0xb')]);router[_0x7665('0x9')]('/describe',auth[_0x7665('0xa')](),controller[_0x7665('0xc')]);router[_0x7665('0x9')](_0x7665('0xd'),auth[_0x7665('0xa')](),controller[_0x7665('0xe')]);router[_0x7665('0x9')](_0x7665('0xf'),auth['isAuthenticated'](),controller[_0x7665('0x10')]);router[_0x7665('0x9')](_0x7665('0x11'),auth['isAuthenticated'](),controller[_0x7665('0x12')]);router['post']('/',auth[_0x7665('0xa')](),controller[_0x7665('0x13')]);router['post'](_0x7665('0xf'),auth[_0x7665('0xa')](),controller['addMessage']);router[_0x7665('0x14')](_0x7665('0x15'),auth['isAuthenticated'](),interaction[_0x7665('0x16')](_0x7665('0x17'),_0x7665('0x18')),controller[_0x7665('0x19')]);router[_0x7665('0x1a')](_0x7665('0xd'),auth[_0x7665('0xa')](),interaction[_0x7665('0x16')](_0x7665('0x17'),_0x7665('0x1b')),controller[_0x7665('0x1c')]);router[_0x7665('0x1d')](_0x7665('0xd'),auth[_0x7665('0xa')](),interaction[_0x7665('0x16')](_0x7665('0x17'),'whatsappinteraction:destroy'),controller[_0x7665('0x1e')]);router[_0x7665('0x1d')]('/:id/tags',auth[_0x7665('0xa')](),controller[_0x7665('0x1f')]);module[_0x7665('0x20')]=router; \ No newline at end of file +var _0x4819=['whatsappinteraction:addtags','put','whatsappinteraction:update','update','delete','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','isAuthenticated','/describe','describe','get','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsapp'];(function(_0x2ac71a,_0x1d2a02){var _0x3ee904=function(_0x5c902a){while(--_0x5c902a){_0x2ac71a['push'](_0x2ac71a['shift']());}};_0x3ee904(++_0x1d2a02);}(_0x4819,0xcd));var _0x9481=function(_0x5c768b,_0x5e88a6){_0x5c768b=_0x5c768b-0x0;var _0x335af8=_0x4819[_0x5c768b];return _0x335af8;};'use strict';var multer=require('multer');var util=require(_0x9481('0x0'));var path=require(_0x9481('0x1'));var timeout=require(_0x9481('0x2'));var express=require(_0x9481('0x3'));var router=express[_0x9481('0x4')]();var fs_extra=require(_0x9481('0x5'));var auth=require(_0x9481('0x6'));var interaction=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var controller=require(_0x9481('0x9'));router['get']('/',auth[_0x9481('0xa')](),controller['index']);router['get'](_0x9481('0xb'),auth[_0x9481('0xa')](),controller[_0x9481('0xc')]);router[_0x9481('0xd')](_0x9481('0xe'),auth['isAuthenticated'](),controller[_0x9481('0xf')]);router['get'](_0x9481('0x10'),auth['isAuthenticated'](),controller[_0x9481('0x11')]);router[_0x9481('0xd')](_0x9481('0x12'),auth[_0x9481('0xa')](),controller[_0x9481('0x13')]);router[_0x9481('0x14')]('/',auth[_0x9481('0xa')](),controller[_0x9481('0x15')]);router[_0x9481('0x14')]('/:id/messages',auth['isAuthenticated'](),controller[_0x9481('0x16')]);router[_0x9481('0x14')](_0x9481('0x17'),auth[_0x9481('0xa')](),interaction[_0x9481('0x18')](_0x9481('0x19'),_0x9481('0x1a')),controller['addTags']);router[_0x9481('0x1b')](_0x9481('0xe'),auth['isAuthenticated'](),interaction[_0x9481('0x18')]('whatsapp',_0x9481('0x1c')),controller[_0x9481('0x1d')]);router[_0x9481('0x1e')](_0x9481('0xe'),auth['isAuthenticated'](),interaction['tracked'](_0x9481('0x19'),'whatsappinteraction:destroy'),controller['destroy']);router[_0x9481('0x1e')](_0x9481('0x17'),auth[_0x9481('0xa')](),controller[_0x9481('0x1f')]);module[_0x9481('0x20')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index a8e76d5..7802861 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.attributes.js +++ b/server/api/whatsappInteraction/whatsappInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe2ab=['exports','BOOLEAN','DATE','STRING','out','ENUM','INTEGER','sequelize','moment'];(function(_0xfc6247,_0x5cbddb){var _0x291245=function(_0x41d7ba){while(--_0x41d7ba){_0xfc6247['push'](_0xfc6247['shift']());}};_0x291245(++_0x5cbddb);}(_0xe2ab,0xc4));var _0xbe2a=function(_0x470f24,_0x2436a9){_0x470f24=_0x470f24-0x0;var _0x2c6fc8=_0xe2ab[_0x470f24];return _0x2c6fc8;};'use strict';var Sequelize=require(_0xbe2a('0x0'));var moment=require(_0xbe2a('0x1'));module[_0xbe2a('0x2')]={'closed':{'type':Sequelize[_0xbe2a('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xbe2a('0x4')]},'disposition':{'type':Sequelize[_0xbe2a('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xbe2a('0x5')]},'note':{'type':Sequelize[_0xbe2a('0x5')]},'phone':{'type':Sequelize[_0xbe2a('0x5')]},'read1stAt':{'type':Sequelize[_0xbe2a('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xbe2a('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xbe2a('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xbe2a('0x3')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xbe2a('0x8')]}}; \ No newline at end of file +var _0xbcae=['out','sequelize','moment','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x57fee1,_0x232580){var _0x2f0a5f=function(_0x160d0a){while(--_0x160d0a){_0x57fee1['push'](_0x57fee1['shift']());}};_0x2f0a5f(++_0x232580);}(_0xbcae,0xa9));var _0xebca=function(_0x32a45c,_0x319889){_0x32a45c=_0x32a45c-0x0;var _0x5aa199=_0xbcae[_0x32a45c];return _0x5aa199;};'use strict';var Sequelize=require(_0xebca('0x0'));var moment=require(_0xebca('0x1'));module[_0xebca('0x2')]={'closed':{'type':Sequelize[_0xebca('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xebca('0x4')]},'disposition':{'type':Sequelize[_0xebca('0x5')]},'secondDisposition':{'type':Sequelize[_0xebca('0x5')]},'thirdDisposition':{'type':Sequelize[_0xebca('0x5')]},'note':{'type':Sequelize[_0xebca('0x5')]},'phone':{'type':Sequelize[_0xebca('0x5')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xebca('0x6')]('in',_0xebca('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xebca('0x6')]('in',_0xebca('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xebca('0x3')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 9565ba5..223bcb7 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.controller.js +++ b/server/api/whatsappInteraction/whatsappInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c70=['type','key','getOptions','findAll','whatsapp','query','user','catch','params','model','keys','rawAttributes','filters','intersection','fields','attributes','include','merge','options','WhatsappInteraction','find','create','body','describe','addMessage','WhatsappMessage','omit','ids','getMessages','findOne','hasOwnProperty','nolimit','order','sort','where','WhatsappInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread','color','emit','whatsappInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','User','fullname','CmContact','firstName','lastName','Attachment','Messages','createdAt','direction','WhatsappAccount','Account','get','mkdirSync','Whatsapp','Owner','N.A.','closed','closedAt','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','Contact','secret','read','value','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','update','then','destroy','stack','name','send','index','map','fieldName'];(function(_0x593d56,_0x10d793){var _0xb1c92c=function(_0x25f720){while(--_0x25f720){_0x593d56['push'](_0x593d56['shift']());}};_0xb1c92c(++_0x10d793);}(_0x1c70,0xe3));var _0x01c7=function(_0x20c809,_0x26b566){_0x20c809=_0x20c809-0x0;var _0x1064a1=_0x1c70[_0x20c809];return _0x1064a1;};'use strict';var rimraf=require(_0x01c7('0x0'));var zipdir=require(_0x01c7('0x1'));var moment=require(_0x01c7('0x2'));var BPromise=require(_0x01c7('0x3'));var util=require(_0x01c7('0x4'));var path=require(_0x01c7('0x5'));var ejs=require(_0x01c7('0x6'));var fs=require('fs');var _=require(_0x01c7('0x7'));var Redis=require('ioredis');var interaction=require(_0x01c7('0x8'));var qs=require(_0x01c7('0x9'));var pdf=require(_0x01c7('0xa'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x01c7('0xb')]=_[_0x01c7('0xc')](config[_0x01c7('0xb')],{'host':_0x01c7('0xd'),'port':0x18eb});var socket=require(_0x01c7('0xe'))(new Redis(config[_0x01c7('0xb')]));require(_0x01c7('0xf'))['register'](socket);function respondWithStatusCode(_0x4ad06d,_0x2e9988){_0x2e9988=_0x2e9988||0xcc;return function(_0x5e285d){if(_0x5e285d){return _0x4ad06d[_0x01c7('0x10')](_0x2e9988);}return _0x4ad06d[_0x01c7('0x11')](_0x2e9988)[_0x01c7('0x12')]();};}function respondWithResult(_0x320e01,_0x156b40){_0x156b40=_0x156b40||0xc8;return function(_0x58ca7f){if(_0x58ca7f){return _0x320e01[_0x01c7('0x11')](_0x156b40)['json'](_0x58ca7f);}};}function respondWithFilteredResult(_0x44a9a8,_0x357cf7){return function(_0x386eff){if(_0x386eff){var _0x1c0e7a=typeof _0x357cf7['offset']===_0x01c7('0x13')&&typeof _0x357cf7['limit']===_0x01c7('0x13');var _0x47dcac=_0x386eff[_0x01c7('0x14')];var _0x5d4025=_0x1c0e7a?0x0:_0x357cf7['offset'];var _0x3ad6db=_0x1c0e7a?_0x386eff[_0x01c7('0x14')]:_0x357cf7[_0x01c7('0x15')]+_0x357cf7[_0x01c7('0x16')];var _0x5a745a;if(_0x3ad6db>=_0x47dcac){_0x3ad6db=_0x47dcac;_0x5a745a=0xc8;}else{_0x5a745a=0xce;}_0x44a9a8[_0x01c7('0x11')](_0x5a745a);return _0x44a9a8[_0x01c7('0x17')](_0x01c7('0x18'),_0x5d4025+'-'+_0x3ad6db+'/'+_0x47dcac)[_0x01c7('0x19')](_0x386eff);}return null;};}function saveUpdates(_0x2b1c02){return function(_0x4edf89){if(_0x4edf89){return _0x4edf89[_0x01c7('0x1a')](_0x2b1c02)[_0x01c7('0x1b')](function(_0x54656c){return _0x54656c;});}return null;};}function removeEntity(_0x1fbd20){return function(_0x58408c){if(_0x58408c){return _0x58408c[_0x01c7('0x1c')]()[_0x01c7('0x1b')](function(){_0x1fbd20[_0x01c7('0x11')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c8883){return function(_0x4690a6){if(!_0x4690a6){_0x2c8883[_0x01c7('0x10')](0x194);}return _0x4690a6;};}function handleError(_0x1a0dc1,_0x372274){_0x372274=_0x372274||0x1f4;return function(_0x1d5a4d){logger['error'](_0x1d5a4d[_0x01c7('0x1d')]);if(_0x1d5a4d[_0x01c7('0x1e')]){delete _0x1d5a4d['name'];}_0x1a0dc1[_0x01c7('0x11')](_0x372274)[_0x01c7('0x1f')](_0x1d5a4d);};}exports[_0x01c7('0x20')]=function(_0x4814b2,_0xb40a98){var _0x104bcb={};var _0x327d4c=_[_0x01c7('0x21')](db['WhatsappInteraction']['rawAttributes'],function(_0x38c5ac){return{'name':_0x38c5ac[_0x01c7('0x22')],'type':_0x38c5ac[_0x01c7('0x23')][_0x01c7('0x24')]};});_0x104bcb=qs[_0x01c7('0x25')](_0x327d4c,_0x4814b2);return interaction[_0x01c7('0x26')](_0x01c7('0x27'),_0x4814b2[_0x01c7('0x28')],_0x4814b2[_0x01c7('0x29')],_0x104bcb,_0x327d4c)[_0x01c7('0x1b')](respondWithFilteredResult(_0xb40a98,_0x104bcb))[_0x01c7('0x2a')](handleError(_0xb40a98,null));};exports['show']=function(_0x13d993,_0x1c591e){var _0x50a51a={'raw':![],'where':{'id':_0x13d993[_0x01c7('0x2b')]['id']}},_0x337712={};_0x337712[_0x01c7('0x2c')]=_[_0x01c7('0x2d')](db['WhatsappInteraction'][_0x01c7('0x2e')]);_0x337712['query']=_[_0x01c7('0x2d')](_0x13d993[_0x01c7('0x28')]);_0x337712[_0x01c7('0x2f')]=_[_0x01c7('0x30')](_0x337712[_0x01c7('0x2c')],_0x337712[_0x01c7('0x28')]);_0x50a51a['attributes']=_[_0x01c7('0x30')](_0x337712[_0x01c7('0x2c')],qs[_0x01c7('0x31')](_0x13d993[_0x01c7('0x28')][_0x01c7('0x31')]));_0x50a51a[_0x01c7('0x32')]=_0x50a51a[_0x01c7('0x32')]['length']?_0x50a51a[_0x01c7('0x32')]:_0x337712[_0x01c7('0x2c')];if(_0x13d993[_0x01c7('0x28')]['includeAll']){_0x50a51a[_0x01c7('0x33')]=[{'all':!![]}];}_0x50a51a=_[_0x01c7('0x34')]({},_0x50a51a,_0x13d993[_0x01c7('0x35')]);return db[_0x01c7('0x36')][_0x01c7('0x37')](_0x50a51a)[_0x01c7('0x1b')](handleEntityNotFound(_0x1c591e,null))[_0x01c7('0x1b')](respondWithResult(_0x1c591e,null))[_0x01c7('0x2a')](handleError(_0x1c591e,null));};exports[_0x01c7('0x38')]=function(_0x516ba9,_0x56bdac){return db[_0x01c7('0x36')][_0x01c7('0x38')](_0x516ba9[_0x01c7('0x39')],{})[_0x01c7('0x1b')](respondWithResult(_0x56bdac,0xc9))[_0x01c7('0x2a')](handleError(_0x56bdac,null));};exports[_0x01c7('0x1a')]=function(_0x468a62,_0x5cdf1a){if(_0x468a62['body']['id']){delete _0x468a62[_0x01c7('0x39')]['id'];}return db[_0x01c7('0x36')][_0x01c7('0x37')]({'where':{'id':_0x468a62[_0x01c7('0x2b')]['id']}})[_0x01c7('0x1b')](handleEntityNotFound(_0x5cdf1a,null))[_0x01c7('0x1b')](saveUpdates(_0x468a62[_0x01c7('0x39')],null))['then'](respondWithResult(_0x5cdf1a,null))[_0x01c7('0x2a')](handleError(_0x5cdf1a,null));};exports[_0x01c7('0x1c')]=function(_0x2a89b1,_0xa27b69){return db['WhatsappInteraction'][_0x01c7('0x37')]({'where':{'id':_0x2a89b1['params']['id']}})['then'](handleEntityNotFound(_0xa27b69,null))[_0x01c7('0x1b')](removeEntity(_0xa27b69,null))[_0x01c7('0x2a')](handleError(_0xa27b69,null));};exports[_0x01c7('0x3a')]=function(_0x61f6ac,_0x599ed8){return db[_0x01c7('0x36')][_0x01c7('0x3a')]()[_0x01c7('0x1b')](respondWithResult(_0x599ed8,null))[_0x01c7('0x2a')](handleError(_0x599ed8,null));};exports[_0x01c7('0x3b')]=function(_0x25d16b,_0x13510d){return db[_0x01c7('0x3c')]['find']({'where':{'id':_0x25d16b['params']['id']}})[_0x01c7('0x1b')](handleEntityNotFound(_0x13510d,null))['then'](function(_0x35a3d1){if(_0x35a3d1){return _0x35a3d1[_0x01c7('0x3b')](_0x25d16b[_0x01c7('0x39')]['ids'],_[_0x01c7('0x3d')](_0x25d16b[_0x01c7('0x39')],[_0x01c7('0x3e'),'id'])||{});}})[_0x01c7('0x1b')](respondWithResult(_0x13510d,null))[_0x01c7('0x2a')](handleError(_0x13510d,null));};exports[_0x01c7('0x3f')]=function(_0x2f0c36,_0x83e392){var _0x139630={'raw':![],'where':{}};var _0x59cdb6={};var _0x417024={'count':0x0,'rows':[]};return db[_0x01c7('0x36')][_0x01c7('0x40')]({'where':{'id':_0x2f0c36['params']['id']}})[_0x01c7('0x1b')](handleEntityNotFound(_0x83e392,null))[_0x01c7('0x1b')](function(_0x544292){if(_0x544292){_0x59cdb6[_0x01c7('0x2c')]=_[_0x01c7('0x2d')](db[_0x01c7('0x3c')]['rawAttributes']);_0x59cdb6[_0x01c7('0x28')]=_['keys'](_0x2f0c36['query']);_0x59cdb6[_0x01c7('0x2f')]=_[_0x01c7('0x30')](_0x59cdb6[_0x01c7('0x2c')],_0x59cdb6['query']);_0x139630[_0x01c7('0x32')]=_[_0x01c7('0x30')](_0x59cdb6['model'],qs[_0x01c7('0x31')](_0x2f0c36[_0x01c7('0x28')][_0x01c7('0x31')]));_0x139630['attributes']=_0x139630['attributes']['length']?_0x139630['attributes']:_0x59cdb6[_0x01c7('0x2c')];if(!_0x2f0c36[_0x01c7('0x28')][_0x01c7('0x41')](_0x01c7('0x42'))){_0x139630[_0x01c7('0x16')]=qs[_0x01c7('0x16')](_0x2f0c36[_0x01c7('0x28')][_0x01c7('0x16')]);_0x139630[_0x01c7('0x15')]=qs['offset'](_0x2f0c36[_0x01c7('0x28')][_0x01c7('0x15')]);}_0x139630[_0x01c7('0x43')]=qs[_0x01c7('0x44')](_0x2f0c36[_0x01c7('0x28')][_0x01c7('0x44')]);_0x139630[_0x01c7('0x45')]=qs[_0x01c7('0x2f')](_['pick'](_0x2f0c36[_0x01c7('0x28')],_0x59cdb6[_0x01c7('0x2f')]));_0x139630[_0x01c7('0x45')][_0x01c7('0x46')]=_0x544292['id'];if(_0x2f0c36[_0x01c7('0x28')][_0x01c7('0x47')]){_0x139630['where']=_['merge'](_0x139630[_0x01c7('0x45')],{'$or':_[_0x01c7('0x21')](_0x139630[_0x01c7('0x32')],function(_0x55c7e7){var _0x1c34f5={};_0x1c34f5[_0x55c7e7]={'$like':'%'+_0x2f0c36[_0x01c7('0x28')][_0x01c7('0x47')]+'%'};return _0x1c34f5;})});}if(_0x2f0c36[_0x01c7('0x28')][_0x01c7('0x48')]){var _0x2244cb=_0x2f0c36[_0x01c7('0x28')][_0x01c7('0x48')]['split'](',');var _0x4613b4={};_0x4613b4[_0x2244cb[0x0]]={'$gte':moment(_0x2244cb[0x1])[_0x01c7('0x49')](_0x01c7('0x4a'))};_0x139630[_0x01c7('0x45')]=_[_0x01c7('0x34')](_0x139630[_0x01c7('0x45')],_0x4613b4);}_0x139630=_['merge']({},_0x139630,_0x2f0c36[_0x01c7('0x35')]);return db[_0x01c7('0x3c')][_0x01c7('0x14')]({'where':_0x139630[_0x01c7('0x45')]})['then'](function(_0x385316){_0x417024[_0x01c7('0x14')]=_0x385316;if(_0x2f0c36['query']['includeAll']){_0x139630['include']=[{'all':!![]}];}return db['WhatsappMessage'][_0x01c7('0x26')](_0x139630);})['then'](function(_0x1af870){_0x417024[_0x01c7('0x4b')]=_0x1af870;return _0x417024;});}})['then'](respondWithFilteredResult(_0x83e392,_0x139630))[_0x01c7('0x2a')](handleError(_0x83e392,null));};exports[_0x01c7('0x4c')]=function(_0x26338d,_0x1c286b){return db[_0x01c7('0x36')][_0x01c7('0x37')]({'where':{'id':_0x26338d[_0x01c7('0x2b')]['id']}})[_0x01c7('0x1b')](handleEntityNotFound(_0x1c286b,null))[_0x01c7('0x1b')](function(_0x824f97){if(_0x824f97){return _0x824f97[_0x01c7('0x4d')](_0x26338d[_0x01c7('0x39')][_0x01c7('0x3e')],_[_0x01c7('0x3d')](_0x26338d[_0x01c7('0x39')],['ids','id'])||{})[_0x01c7('0x4e')](function(){return db['Tag'][_0x01c7('0x26')]({'attributes':['id',_0x01c7('0x1e'),_0x01c7('0x4f')],'where':{'id':_0x26338d['body'][_0x01c7('0x3e')]}});})[_0x01c7('0x1b')](function(_0x48e66f){socket[_0x01c7('0x50')](_0x01c7('0x51'),{'id':Number(_0x26338d[_0x01c7('0x2b')]['id']),'tags':_0x48e66f||[]});return{'id':Number(_0x26338d['params']['id']),'tags':_0x48e66f||[]};});}})[_0x01c7('0x1b')](respondWithResult(_0x1c286b,null))[_0x01c7('0x2a')](handleError(_0x1c286b,null));};exports[_0x01c7('0x52')]=function(_0x4ce27b,_0x5f043c){return db['WhatsappInteraction'][_0x01c7('0x37')]({'where':{'id':_0x4ce27b[_0x01c7('0x2b')]['id']}})[_0x01c7('0x1b')](handleEntityNotFound(_0x5f043c,null))[_0x01c7('0x1b')](function(_0x38e470){if(_0x38e470){return _0x38e470[_0x01c7('0x52')](_0x4ce27b[_0x01c7('0x28')]['ids']);}})[_0x01c7('0x1b')](respondWithStatusCode(_0x5f043c,null))[_0x01c7('0x2a')](handleError(_0x5f043c,null));};exports[_0x01c7('0x53')]=function(_0x5c19a6,_0x104641){var _0x5d9c68=moment()[_0x01c7('0x54')]()[_0x01c7('0x55')]();var _0x9985a=path[_0x01c7('0x56')](config[_0x01c7('0x57')],_0x01c7('0x58'),_0x01c7('0x59'),_0x01c7('0x5a'));var _0x2818ac=path['join'](config[_0x01c7('0x57')],_0x01c7('0x58'),_0x01c7('0x59'),_0x01c7('0x5b'));var _0x447070=path['join'](_0x9985a,_0x5d9c68);var _0x253cf3=util[_0x01c7('0x49')](_0x01c7('0x5c'),_0x5c19a6[_0x01c7('0x2b')]['id'],_0x5d9c68);var _0x1146dd=path[_0x01c7('0x56')](_0x9985a,_0x253cf3);var _0xebbd1e=[];_0xebbd1e[_0x01c7('0x5d')]({'model':db[_0x01c7('0x5e')],'as':_0x01c7('0x5e'),'attributes':['id',_0x01c7('0x5f')],'raw':!![]});_0xebbd1e['push']({'model':db[_0x01c7('0x60')],'as':'Contact','attributes':['id',_0x01c7('0x61'),_0x01c7('0x62')],'raw':!![]});if(_0x5c19a6[_0x01c7('0x28')][_0x01c7('0x5b')]){_0xebbd1e[_0x01c7('0x5d')]({'model':db[_0x01c7('0x63')],'as':_0x01c7('0x63'),'raw':!![]});}var _0x3bdea0=[{'model':db[_0x01c7('0x3c')],'as':_0x01c7('0x64'),'attributes':['id','body',_0x01c7('0x65'),_0x01c7('0x66'),'secret','read'],'include':_0xebbd1e}];_0x3bdea0['push']({'model':db[_0x01c7('0x67')],'as':_0x01c7('0x68'),'attributes':['id','name']});_0x3bdea0[_0x01c7('0x5d')]({'model':db[_0x01c7('0x5e')],'as':'Owner','attributes':['id',_0x01c7('0x5f')]});return db[_0x01c7('0x36')][_0x01c7('0x37')]({'where':{'id':_0x5c19a6['params']['id']},'include':_0x3bdea0})[_0x01c7('0x1b')](handleEntityNotFound(_0x104641,null))['then'](function(_0x18a4f9){if(_0x18a4f9){var _0x574ee9=_0x18a4f9[_0x01c7('0x69')]({'plain':!![]});fs[_0x01c7('0x6a')](_0x447070);var _0xce7ba8={'channel':_0x01c7('0x6b'),'account':_0x574ee9[_0x01c7('0x68')][_0x01c7('0x1e')],'agent':_0x574ee9[_0x01c7('0x6c')]?_0x574ee9['Owner'][_0x01c7('0x5f')]:_0x01c7('0x6d'),'createdAt':moment(_0x574ee9['createdAt'])[_0x01c7('0x49')](_0x01c7('0x4a'))['toString'](),'closedAt':_0x574ee9[_0x01c7('0x6e')]?moment(_0x574ee9[_0x01c7('0x6f')])[_0x01c7('0x49')](_0x01c7('0x4a'))[_0x01c7('0x55')]():'','disposition':_0x574ee9[_0x01c7('0x70')],'messages':_(_0x574ee9[_0x01c7('0x64')])[_0x01c7('0x47')]({'secret':![]})[_0x01c7('0x21')](function(_0x32271a){if(_0x32271a['Attachment']){var _0x29bb23=path[_0x01c7('0x56')](_0x2818ac,_0x32271a[_0x01c7('0x63')][_0x01c7('0x71')]);if(fs[_0x01c7('0x72')](_0x29bb23)){fs[_0x01c7('0x73')](_0x29bb23)[_0x01c7('0x74')](fs[_0x01c7('0x75')](path['join'](_0x447070,_0x32271a[_0x01c7('0x63')][_0x01c7('0x71')])));}}return{'date':moment(_0x32271a[_0x01c7('0x65')])[_0x01c7('0x49')](_0x01c7('0x4a'))[_0x01c7('0x55')](),'sender':_0x32271a[_0x01c7('0x66')]===_0x01c7('0x76')?_0x32271a['User']?_0x32271a[_0x01c7('0x5e')][_0x01c7('0x5f')]:_0x01c7('0x77'):_0x32271a['Contact'][_0x01c7('0x61')]+(_0x32271a[_0x01c7('0x78')][_0x01c7('0x62')]?'\x20'+_0x32271a[_0x01c7('0x78')][_0x01c7('0x62')]:''),'body':_0x32271a[_0x01c7('0x63')]?_0x32271a[_0x01c7('0x63')][_0x01c7('0x71')]:_0x32271a[_0x01c7('0x39')],'direction':_0x32271a[_0x01c7('0x66')]==='out'?'A':'C','secret':_0x32271a[_0x01c7('0x79')],'read':_0x32271a[_0x01c7('0x7a')],'attachment':_0x32271a[_0x01c7('0x63')]};})[_0x01c7('0x7b')]()};return ejs[_0x01c7('0x7c')](path[_0x01c7('0x56')](config[_0x01c7('0x57')],_0x01c7('0x58'),'views',_0x01c7('0x7d')),{'interaction':_0xce7ba8})[_0x01c7('0x1b')](function(_0x3070cf){var _0x3d83b7=path[_0x01c7('0x56')](_0x447070,_0x01c7('0x7e')+_0x574ee9['id']+'-'+_0x5d9c68+_0x01c7('0x7f'));var _0x554d74={'path':_0x3d83b7,'channel':'Whatsapp','interactionId':_0x574ee9['id']};return pdf[_0x01c7('0x80')](_0x3070cf,_0x554d74);})[_0x01c7('0x1b')](function(){return new BPromise(function(_0x247d26,_0x4366ca){zipdir(_0x447070,{'saveTo':_0x1146dd},function(_0xba00b2,_0x469432){if(_0xba00b2)return _0x4366ca(_0xba00b2);return _0x247d26(_0x469432);});})[_0x01c7('0x1b')](function(){return new BPromise(function(_0x42d056,_0x197b95){rimraf(_0x447070,function(_0x56e935){if(_0x56e935)_0x197b95(_0x56e935);return _0x42d056();});});})[_0x01c7('0x1b')](function(){return _0x104641[_0x01c7('0x53')](_0x1146dd,_0x253cf3,function(_0x43137e){if(_0x43137e){console[_0x01c7('0x81')]('err',_0x43137e);}else{fs[_0x01c7('0x82')](_0x1146dd);}});});});}else{return _0x104641[_0x01c7('0x10')](0xc8);}})['catch'](handleError(_0x104641,null));}; \ No newline at end of file +var _0xc88c=['includeAll','addTags','setTags','spread','color','emit','whatsappInteractionTags:save','removeTags','toString','join','root','server','files','attachments','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','Attachment','Messages','secret','read','Account','mkdirSync','Whatsapp','Owner','createdAt','closed','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','format','direction','out','System','lastName','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','log','err','zip-dir','moment','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','register','sendStatus','status','undefined','offset','count','limit','set','Content-Range','json','then','destroy','end','error','stack','name','send','index','WhatsappInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','whatsapp','query','user','show','keys','filters','intersection','attributes','model','fields','length','include','merge','find','catch','create','body','update','params','describe','addMessage','omit','ids','getMessages','findOne','WhatsappMessage','nolimit','order','sort','where','WhatsappInteractionId','filter','map','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options'];(function(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0xc88c,0xb4));var _0xcc88=function(_0x1ee851,_0x20fbbb){_0x1ee851=_0x1ee851-0x0;var _0x4ea6ef=_0xc88c[_0x1ee851];return _0x4ea6ef;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xcc88('0x0'));var moment=require(_0xcc88('0x1'));var BPromise=require('bluebird');var util=require('util');var path=require(_0xcc88('0x2'));var ejs=require(_0xcc88('0x3'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xcc88('0x4'));var interaction=require(_0xcc88('0x5'));var qs=require(_0xcc88('0x6'));var pdf=require('../../components/export/pdf');var logger=require(_0xcc88('0x7'))(_0xcc88('0x8'));var config=require(_0xcc88('0x9'));var db=require(_0xcc88('0xa'))['db'];config['redis']=_[_0xcc88('0xb')](config[_0xcc88('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xcc88('0xd'))(new Redis(config['redis']));require('./whatsappInteraction.socket')[_0xcc88('0xe')](socket);function respondWithStatusCode(_0x3b85f9,_0x284610){_0x284610=_0x284610||0xcc;return function(_0x1f23fd){if(_0x1f23fd){return _0x3b85f9[_0xcc88('0xf')](_0x284610);}return _0x3b85f9[_0xcc88('0x10')](_0x284610)['end']();};}function respondWithResult(_0x7e4348,_0x5ec502){_0x5ec502=_0x5ec502||0xc8;return function(_0x8a3c){if(_0x8a3c){return _0x7e4348[_0xcc88('0x10')](_0x5ec502)['json'](_0x8a3c);}};}function respondWithFilteredResult(_0x25d501,_0x523f3f){return function(_0x32f755){if(_0x32f755){var _0x240141=typeof _0x523f3f['offset']===_0xcc88('0x11')&&typeof _0x523f3f['limit']===_0xcc88('0x11');var _0x6c466a=_0x32f755['count'];var _0x3cc241=_0x240141?0x0:_0x523f3f[_0xcc88('0x12')];var _0x252bc9=_0x240141?_0x32f755[_0xcc88('0x13')]:_0x523f3f[_0xcc88('0x12')]+_0x523f3f[_0xcc88('0x14')];var _0x2438ed;if(_0x252bc9>=_0x6c466a){_0x252bc9=_0x6c466a;_0x2438ed=0xc8;}else{_0x2438ed=0xce;}_0x25d501['status'](_0x2438ed);return _0x25d501[_0xcc88('0x15')](_0xcc88('0x16'),_0x3cc241+'-'+_0x252bc9+'/'+_0x6c466a)[_0xcc88('0x17')](_0x32f755);}return null;};}function saveUpdates(_0x2ce293){return function(_0x5e4599){if(_0x5e4599){return _0x5e4599['update'](_0x2ce293)[_0xcc88('0x18')](function(_0x3d4b28){return _0x3d4b28;});}return null;};}function removeEntity(_0x2ca832){return function(_0x369a0d){if(_0x369a0d){return _0x369a0d[_0xcc88('0x19')]()[_0xcc88('0x18')](function(){_0x2ca832[_0xcc88('0x10')](0xcc)[_0xcc88('0x1a')]();});}};}function handleEntityNotFound(_0x53f331){return function(_0x5dc0ae){if(!_0x5dc0ae){_0x53f331['sendStatus'](0x194);}return _0x5dc0ae;};}function handleError(_0x570585,_0xba2ac9){_0xba2ac9=_0xba2ac9||0x1f4;return function(_0x471064){logger[_0xcc88('0x1b')](_0x471064[_0xcc88('0x1c')]);if(_0x471064[_0xcc88('0x1d')]){delete _0x471064[_0xcc88('0x1d')];}_0x570585[_0xcc88('0x10')](_0xba2ac9)[_0xcc88('0x1e')](_0x471064);};}exports[_0xcc88('0x1f')]=function(_0x1162f1,_0x326541){var _0x20808b={};var _0x40279c=_['map'](db[_0xcc88('0x20')][_0xcc88('0x21')],function(_0x27e760){return{'name':_0x27e760[_0xcc88('0x22')],'type':_0x27e760[_0xcc88('0x23')][_0xcc88('0x24')]};});_0x20808b=qs[_0xcc88('0x25')](_0x40279c,_0x1162f1);return interaction[_0xcc88('0x26')](_0xcc88('0x27'),_0x1162f1[_0xcc88('0x28')],_0x1162f1[_0xcc88('0x29')],_0x20808b,_0x40279c)[_0xcc88('0x18')](respondWithFilteredResult(_0x326541,_0x20808b))['catch'](handleError(_0x326541,null));};exports[_0xcc88('0x2a')]=function(_0x403a22,_0xb30ec0){var _0xa77b3={'raw':![],'where':{'id':_0x403a22['params']['id']}},_0x39ee5f={};_0x39ee5f['model']=_[_0xcc88('0x2b')](db[_0xcc88('0x20')][_0xcc88('0x21')]);_0x39ee5f[_0xcc88('0x28')]=_['keys'](_0x403a22[_0xcc88('0x28')]);_0x39ee5f[_0xcc88('0x2c')]=_[_0xcc88('0x2d')](_0x39ee5f['model'],_0x39ee5f['query']);_0xa77b3[_0xcc88('0x2e')]=_[_0xcc88('0x2d')](_0x39ee5f[_0xcc88('0x2f')],qs['fields'](_0x403a22[_0xcc88('0x28')][_0xcc88('0x30')]));_0xa77b3[_0xcc88('0x2e')]=_0xa77b3['attributes'][_0xcc88('0x31')]?_0xa77b3[_0xcc88('0x2e')]:_0x39ee5f['model'];if(_0x403a22[_0xcc88('0x28')]['includeAll']){_0xa77b3[_0xcc88('0x32')]=[{'all':!![]}];}_0xa77b3=_[_0xcc88('0x33')]({},_0xa77b3,_0x403a22['options']);return db[_0xcc88('0x20')][_0xcc88('0x34')](_0xa77b3)['then'](handleEntityNotFound(_0xb30ec0,null))[_0xcc88('0x18')](respondWithResult(_0xb30ec0,null))[_0xcc88('0x35')](handleError(_0xb30ec0,null));};exports[_0xcc88('0x36')]=function(_0x94e439,_0x4ddae0){return db[_0xcc88('0x20')][_0xcc88('0x36')](_0x94e439[_0xcc88('0x37')],{})['then'](respondWithResult(_0x4ddae0,0xc9))[_0xcc88('0x35')](handleError(_0x4ddae0,null));};exports[_0xcc88('0x38')]=function(_0x6743ae,_0x396d7e){if(_0x6743ae[_0xcc88('0x37')]['id']){delete _0x6743ae['body']['id'];}return db[_0xcc88('0x20')][_0xcc88('0x34')]({'where':{'id':_0x6743ae[_0xcc88('0x39')]['id']}})[_0xcc88('0x18')](handleEntityNotFound(_0x396d7e,null))['then'](saveUpdates(_0x6743ae['body'],null))[_0xcc88('0x18')](respondWithResult(_0x396d7e,null))[_0xcc88('0x35')](handleError(_0x396d7e,null));};exports[_0xcc88('0x19')]=function(_0x49472d,_0x5d9059){return db[_0xcc88('0x20')]['find']({'where':{'id':_0x49472d[_0xcc88('0x39')]['id']}})['then'](handleEntityNotFound(_0x5d9059,null))['then'](removeEntity(_0x5d9059,null))[_0xcc88('0x35')](handleError(_0x5d9059,null));};exports[_0xcc88('0x3a')]=function(_0x3a9f6d,_0x21b7bd){return db[_0xcc88('0x20')][_0xcc88('0x3a')]()[_0xcc88('0x18')](respondWithResult(_0x21b7bd,null))[_0xcc88('0x35')](handleError(_0x21b7bd,null));};exports['addMessage']=function(_0x1f528d,_0x16127f){return db['WhatsappMessage'][_0xcc88('0x34')]({'where':{'id':_0x1f528d[_0xcc88('0x39')]['id']}})[_0xcc88('0x18')](handleEntityNotFound(_0x16127f,null))[_0xcc88('0x18')](function(_0x132530){if(_0x132530){return _0x132530[_0xcc88('0x3b')](_0x1f528d['body']['ids'],_[_0xcc88('0x3c')](_0x1f528d[_0xcc88('0x37')],[_0xcc88('0x3d'),'id'])||{});}})[_0xcc88('0x18')](respondWithResult(_0x16127f,null))[_0xcc88('0x35')](handleError(_0x16127f,null));};exports[_0xcc88('0x3e')]=function(_0x4d3579,_0x1eb824){var _0x1aa62f={'raw':![],'where':{}};var _0x546538={};var _0x1e2a52={'count':0x0,'rows':[]};return db[_0xcc88('0x20')][_0xcc88('0x3f')]({'where':{'id':_0x4d3579['params']['id']}})[_0xcc88('0x18')](handleEntityNotFound(_0x1eb824,null))['then'](function(_0xc73704){if(_0xc73704){_0x546538[_0xcc88('0x2f')]=_['keys'](db[_0xcc88('0x40')]['rawAttributes']);_0x546538[_0xcc88('0x28')]=_[_0xcc88('0x2b')](_0x4d3579[_0xcc88('0x28')]);_0x546538[_0xcc88('0x2c')]=_[_0xcc88('0x2d')](_0x546538[_0xcc88('0x2f')],_0x546538[_0xcc88('0x28')]);_0x1aa62f[_0xcc88('0x2e')]=_[_0xcc88('0x2d')](_0x546538['model'],qs[_0xcc88('0x30')](_0x4d3579['query'][_0xcc88('0x30')]));_0x1aa62f[_0xcc88('0x2e')]=_0x1aa62f[_0xcc88('0x2e')]['length']?_0x1aa62f[_0xcc88('0x2e')]:_0x546538['model'];if(!_0x4d3579[_0xcc88('0x28')]['hasOwnProperty'](_0xcc88('0x41'))){_0x1aa62f['limit']=qs['limit'](_0x4d3579['query']['limit']);_0x1aa62f[_0xcc88('0x12')]=qs[_0xcc88('0x12')](_0x4d3579['query'][_0xcc88('0x12')]);}_0x1aa62f[_0xcc88('0x42')]=qs[_0xcc88('0x43')](_0x4d3579['query'][_0xcc88('0x43')]);_0x1aa62f[_0xcc88('0x44')]=qs['filters'](_['pick'](_0x4d3579[_0xcc88('0x28')],_0x546538['filters']));_0x1aa62f['where'][_0xcc88('0x45')]=_0xc73704['id'];if(_0x4d3579[_0xcc88('0x28')][_0xcc88('0x46')]){_0x1aa62f['where']=_['merge'](_0x1aa62f[_0xcc88('0x44')],{'$or':_[_0xcc88('0x47')](_0x1aa62f[_0xcc88('0x2e')],function(_0xa133c2){var _0x12606a={};_0x12606a[_0xa133c2]={'$like':'%'+_0x4d3579[_0xcc88('0x28')]['filter']+'%'};return _0x12606a;})});}if(_0x4d3579['query'][_0xcc88('0x48')]){var _0x2dda83=_0x4d3579[_0xcc88('0x28')][_0xcc88('0x48')][_0xcc88('0x49')](',');var _0x59497f={};_0x59497f[_0x2dda83[0x0]]={'$gte':moment(_0x2dda83[0x1])['format'](_0xcc88('0x4a'))};_0x1aa62f[_0xcc88('0x44')]=_[_0xcc88('0x33')](_0x1aa62f[_0xcc88('0x44')],_0x59497f);}_0x1aa62f=_[_0xcc88('0x33')]({},_0x1aa62f,_0x4d3579[_0xcc88('0x4b')]);return db[_0xcc88('0x40')]['count']({'where':_0x1aa62f[_0xcc88('0x44')]})[_0xcc88('0x18')](function(_0x58e526){_0x1e2a52[_0xcc88('0x13')]=_0x58e526;if(_0x4d3579['query'][_0xcc88('0x4c')]){_0x1aa62f[_0xcc88('0x32')]=[{'all':!![]}];}return db[_0xcc88('0x40')][_0xcc88('0x26')](_0x1aa62f);})[_0xcc88('0x18')](function(_0x1ead6c){_0x1e2a52['rows']=_0x1ead6c;return _0x1e2a52;});}})[_0xcc88('0x18')](respondWithFilteredResult(_0x1eb824,_0x1aa62f))[_0xcc88('0x35')](handleError(_0x1eb824,null));};exports[_0xcc88('0x4d')]=function(_0x1e2c08,_0x474ae6){return db[_0xcc88('0x20')][_0xcc88('0x34')]({'where':{'id':_0x1e2c08['params']['id']}})[_0xcc88('0x18')](handleEntityNotFound(_0x474ae6,null))[_0xcc88('0x18')](function(_0x49b875){if(_0x49b875){return _0x49b875[_0xcc88('0x4e')](_0x1e2c08[_0xcc88('0x37')][_0xcc88('0x3d')],_[_0xcc88('0x3c')](_0x1e2c08[_0xcc88('0x37')],[_0xcc88('0x3d'),'id'])||{})[_0xcc88('0x4f')](function(){return db['Tag'][_0xcc88('0x26')]({'attributes':['id',_0xcc88('0x1d'),_0xcc88('0x50')],'where':{'id':_0x1e2c08[_0xcc88('0x37')]['ids']}});})[_0xcc88('0x18')](function(_0x8d6f3f){socket[_0xcc88('0x51')](_0xcc88('0x52'),{'id':Number(_0x1e2c08[_0xcc88('0x39')]['id']),'tags':_0x8d6f3f||[]});return{'id':Number(_0x1e2c08[_0xcc88('0x39')]['id']),'tags':_0x8d6f3f||[]};});}})['then'](respondWithResult(_0x474ae6,null))[_0xcc88('0x35')](handleError(_0x474ae6,null));};exports[_0xcc88('0x53')]=function(_0x38a9e,_0x385218){return db['WhatsappInteraction'][_0xcc88('0x34')]({'where':{'id':_0x38a9e[_0xcc88('0x39')]['id']}})[_0xcc88('0x18')](handleEntityNotFound(_0x385218,null))[_0xcc88('0x18')](function(_0x4acde0){if(_0x4acde0){return _0x4acde0[_0xcc88('0x53')](_0x38a9e[_0xcc88('0x28')][_0xcc88('0x3d')]);}})[_0xcc88('0x18')](respondWithStatusCode(_0x385218,null))[_0xcc88('0x35')](handleError(_0x385218,null));};exports['download']=function(_0x327b3c,_0x46d38e){var _0x64239a=moment()['unix']()[_0xcc88('0x54')]();var _0x3c1bdc=path[_0xcc88('0x55')](config[_0xcc88('0x56')],_0xcc88('0x57'),_0xcc88('0x58'),'tmp');var _0x39294d=path[_0xcc88('0x55')](config[_0xcc88('0x56')],_0xcc88('0x57'),_0xcc88('0x58'),_0xcc88('0x59'));var _0x338aaa=path['join'](_0x3c1bdc,_0x64239a);var _0x24e43e=util['format'](_0xcc88('0x5a'),_0x327b3c['params']['id'],_0x64239a);var _0x4fd29f=path['join'](_0x3c1bdc,_0x24e43e);var _0x24a133=[];_0x24a133[_0xcc88('0x5b')]({'model':db[_0xcc88('0x5c')],'as':_0xcc88('0x5c'),'attributes':['id',_0xcc88('0x5d')],'raw':!![]});_0x24a133['push']({'model':db[_0xcc88('0x5e')],'as':_0xcc88('0x5f'),'attributes':['id',_0xcc88('0x60'),'lastName'],'raw':!![]});if(_0x327b3c[_0xcc88('0x28')][_0xcc88('0x59')]){_0x24a133['push']({'model':db[_0xcc88('0x61')],'as':_0xcc88('0x61'),'raw':!![]});}var _0xd01a40=[{'model':db['WhatsappMessage'],'as':_0xcc88('0x62'),'attributes':['id','body','createdAt','direction',_0xcc88('0x63'),_0xcc88('0x64')],'include':_0x24a133}];_0xd01a40[_0xcc88('0x5b')]({'model':db['WhatsappAccount'],'as':_0xcc88('0x65'),'attributes':['id',_0xcc88('0x1d')]});_0xd01a40['push']({'model':db[_0xcc88('0x5c')],'as':'Owner','attributes':['id',_0xcc88('0x5d')]});return db[_0xcc88('0x20')][_0xcc88('0x34')]({'where':{'id':_0x327b3c['params']['id']},'include':_0xd01a40})['then'](handleEntityNotFound(_0x46d38e,null))[_0xcc88('0x18')](function(_0x38eb46){if(_0x38eb46){var _0x37a7bb=_0x38eb46['get']({'plain':!![]});fs[_0xcc88('0x66')](_0x338aaa);var _0x53a817={'channel':_0xcc88('0x67'),'account':_0x37a7bb[_0xcc88('0x65')][_0xcc88('0x1d')],'agent':_0x37a7bb['Owner']?_0x37a7bb[_0xcc88('0x68')][_0xcc88('0x5d')]:'N.A.','createdAt':moment(_0x37a7bb[_0xcc88('0x69')])['format'](_0xcc88('0x4a'))[_0xcc88('0x54')](),'closedAt':_0x37a7bb[_0xcc88('0x6a')]?moment(_0x37a7bb['closedAt'])['format'](_0xcc88('0x4a'))[_0xcc88('0x54')]():'','disposition':_0x37a7bb[_0xcc88('0x6b')],'messages':_(_0x37a7bb[_0xcc88('0x62')])[_0xcc88('0x46')]({'secret':![]})['map'](function(_0x49bd7f){if(_0x49bd7f['Attachment']){var _0x257ca4=path[_0xcc88('0x55')](_0x39294d,_0x49bd7f[_0xcc88('0x61')][_0xcc88('0x6c')]);if(fs[_0xcc88('0x6d')](_0x257ca4)){fs[_0xcc88('0x6e')](_0x257ca4)[_0xcc88('0x6f')](fs[_0xcc88('0x70')](path[_0xcc88('0x55')](_0x338aaa,_0x49bd7f[_0xcc88('0x61')]['basename'])));}}return{'date':moment(_0x49bd7f[_0xcc88('0x69')])[_0xcc88('0x71')](_0xcc88('0x4a'))[_0xcc88('0x54')](),'sender':_0x49bd7f[_0xcc88('0x72')]===_0xcc88('0x73')?_0x49bd7f[_0xcc88('0x5c')]?_0x49bd7f[_0xcc88('0x5c')][_0xcc88('0x5d')]:_0xcc88('0x74'):_0x49bd7f['Contact'][_0xcc88('0x60')]+(_0x49bd7f[_0xcc88('0x5f')][_0xcc88('0x75')]?'\x20'+_0x49bd7f[_0xcc88('0x5f')][_0xcc88('0x75')]:''),'body':_0x49bd7f[_0xcc88('0x61')]?_0x49bd7f['Attachment'][_0xcc88('0x6c')]:_0x49bd7f[_0xcc88('0x37')],'direction':_0x49bd7f[_0xcc88('0x72')]===_0xcc88('0x73')?'A':'C','secret':_0x49bd7f[_0xcc88('0x63')],'read':_0x49bd7f[_0xcc88('0x64')],'attachment':_0x49bd7f[_0xcc88('0x61')]};})[_0xcc88('0x76')]()};return ejs[_0xcc88('0x77')](path[_0xcc88('0x55')](config[_0xcc88('0x56')],_0xcc88('0x57'),_0xcc88('0x78'),_0xcc88('0x79')),{'interaction':_0x53a817})['then'](function(_0x3e619c){var _0x7eee94=path[_0xcc88('0x55')](_0x338aaa,_0xcc88('0x7a')+_0x37a7bb['id']+'-'+_0x64239a+_0xcc88('0x7b'));var _0x2399f9={'path':_0x7eee94,'channel':_0xcc88('0x67'),'interactionId':_0x37a7bb['id']};return pdf[_0xcc88('0x7c')](_0x3e619c,_0x2399f9);})['then'](function(){return new BPromise(function(_0x263bad,_0x22aaa3){zipdir(_0x338aaa,{'saveTo':_0x4fd29f},function(_0x10080c,_0x32efff){if(_0x10080c)return _0x22aaa3(_0x10080c);return _0x263bad(_0x32efff);});})[_0xcc88('0x18')](function(){return new BPromise(function(_0x1549e7,_0x15ce38){rimraf(_0x338aaa,function(_0x12a9e1){if(_0x12a9e1)_0x15ce38(_0x12a9e1);return _0x1549e7();});});})['then'](function(){return _0x46d38e[_0xcc88('0x7d')](_0x4fd29f,_0x24e43e,function(_0x3b21ce){if(_0x3b21ce){console[_0xcc88('0x7e')](_0xcc88('0x7f'),_0x3b21ce);}else{fs['unlinkSync'](_0x4fd29f);}});});});}else{return _0x46d38e[_0xcc88('0xf')](0xc8);}})[_0xcc88('0x35')](handleError(_0x46d38e,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index d437426..5b03a29 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.events.js +++ b/server/api/whatsappInteraction/whatsappInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6599=['update','getUsers','setDataValue','Users','then','unreadMessages','length','emit','catch','hook','exports','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners'];(function(_0x37c01d,_0x9a740){var _0x45f66a=function(_0x37eac0){while(--_0x37eac0){_0x37c01d['push'](_0x37c01d['shift']());}};_0x45f66a(++_0x9a740);}(_0x6599,0xb0));var _0x9659=function(_0x4fa489,_0x4cba6b){_0x4fa489=_0x4fa489-0x0;var _0x41d2ce=_0x6599[_0x4fa489];return _0x41d2ce;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0x9659('0x0'))['db'][_0x9659('0x1')];var WhatsappMessage=require(_0x9659('0x0'))['db'][_0x9659('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x9659('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9659('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2f5d38){return function(_0x4fd132,_0x2acc26,_0xb08ede){_0x4fd132[_0x9659('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4e4402){_0x4fd132[_0x9659('0x6')](_0x9659('0x7'),_0x4e4402['map'](function(_0xdf6dea){return{'id':_0xdf6dea['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x4fd132['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9659('0x8')](function(_0x194d48){_0x4fd132['setDataValue'](_0x9659('0x9'),_0x194d48[_0x9659('0xa')]);WhatsappInteractionEvents[_0x9659('0xb')](_0x2f5d38+':'+_0x4fd132['id'],_0x4fd132);WhatsappInteractionEvents['emit'](_0x2f5d38,_0x4fd132);_0xb08ede(null);})[_0x9659('0xc')](_0xb08ede(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0x9659('0xd')](e,emitEvent(event));}}module[_0x9659('0xe')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x43fd=['getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x31200f,_0x381f51){var _0xf1827b=function(_0x15b904){while(--_0x15b904){_0x31200f['push'](_0x31200f['shift']());}};_0xf1827b(++_0x381f51);}(_0x43fd,0x150));var _0xd43f=function(_0x3a1f6d,_0x6ea42){_0x3a1f6d=_0x3a1f6d-0x0;var _0x5dbcae=_0x43fd[_0x3a1f6d];return _0x5dbcae;};'use strict';var EventEmitter=require(_0xd43f('0x0'));var WhatsappInteraction=require(_0xd43f('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0xd43f('0x1'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xd43f('0x2')](0x0);var events={'afterCreate':_0xd43f('0x3'),'afterUpdate':_0xd43f('0x4'),'afterDestroy':_0xd43f('0x5')};function emitEvent(_0x1fdb58){return function(_0x14e48f,_0xdd2104,_0x2807ed){_0x14e48f[_0xd43f('0x6')]({'attributes':['id'],'raw':!![]})[_0xd43f('0x7')](function(_0x907208){_0x14e48f[_0xd43f('0x8')](_0xd43f('0x9'),_0x907208[_0xd43f('0xa')](function(_0x587add){return{'id':_0x587add['id']};}));return WhatsappMessage[_0xd43f('0xb')]({'where':{'WhatsappInteractionId':_0x14e48f['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd43f('0x7')](function(_0xcc229e){_0x14e48f['setDataValue'](_0xd43f('0xc'),_0xcc229e[_0xd43f('0xd')]);WhatsappInteractionEvents['emit'](_0x1fdb58+':'+_0x14e48f['id'],_0x14e48f);WhatsappInteractionEvents[_0xd43f('0xe')](_0x1fdb58,_0x14e48f);_0x2807ed(null);})[_0xd43f('0xf')](_0x2807ed(null));};}for(var e in events){if(events[_0xd43f('0x10')](e)){var event=events[e];WhatsappInteraction[_0xd43f('0x11')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 68c5d96..70bb49d 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.model.js +++ b/server/api/whatsappInteraction/whatsappInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8281=['path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','WhatsappInteraction','whatsapp_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','api','bluebird','request-promise'];(function(_0x406c0e,_0x126ef1){var _0x52626a=function(_0x281f84){while(--_0x281f84){_0x406c0e['push'](_0x406c0e['shift']());}};_0x52626a(++_0x126ef1);}(_0x8281,0x182));var _0x1828=function(_0x1e228c,_0x952f1b){_0x1e228c=_0x1e228c-0x0;var _0x2a482f=_0x8281[_0x1e228c];return _0x2a482f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1828('0x0'))(_0x1828('0x1'));var moment=require('moment');var BPromise=require(_0x1828('0x2'));var rp=require(_0x1828('0x3'));var fs=require('fs');var path=require(_0x1828('0x4'));var rimraf=require(_0x1828('0x5'));var config=require(_0x1828('0x6'));var attributes=require(_0x1828('0x7'));module[_0x1828('0x8')]=function(_0x102777,_0x4752d7){return _0x102777['define'](_0x1828('0x9'),attributes,{'tableName':_0x1828('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2a5768,_0x1f6580,_0xfbcc1b){if(_0x2a5768['changed'](_0x1828('0xb'))){_0x2a5768[_0x1828('0xc')]=moment()[_0x1828('0xd')](_0x1828('0xe'));}_0xfbcc1b(null,_0x2a5768);}}});}; \ No newline at end of file +var _0x4d9a=['api','bluebird','rimraf','../../config/environment','define','WhatsappInteraction','changed','closedAt','format','lodash','util','../../config/logger'];(function(_0x47f7f5,_0xa5caf){var _0x52fe6b=function(_0x7ee9cf){while(--_0x7ee9cf){_0x47f7f5['push'](_0x47f7f5['shift']());}};_0x52fe6b(++_0xa5caf);}(_0x4d9a,0x129));var _0xa4d9=function(_0x3ebfb9,_0x47d386){_0x3ebfb9=_0x3ebfb9-0x0;var _0x352341=_0x4d9a[_0x3ebfb9];return _0x352341;};'use strict';var _=require(_0xa4d9('0x0'));var util=require(_0xa4d9('0x1'));var logger=require(_0xa4d9('0x2'))(_0xa4d9('0x3'));var moment=require('moment');var BPromise=require(_0xa4d9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa4d9('0x5'));var config=require(_0xa4d9('0x6'));var attributes=require('./whatsappInteraction.attributes');module['exports']=function(_0xd62603,_0x10ca30){return _0xd62603[_0xa4d9('0x7')](_0xa4d9('0x8'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x30c664,_0x11506f,_0x9f176d){if(_0x30c664[_0xa4d9('0x9')]('closed')){_0x30c664[_0xa4d9('0xa')]=moment()[_0xa4d9('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x9f176d(null,_0x30c664);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index e9c8026..642d9c0 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.rpc.js +++ b/server/api/whatsappInteraction/whatsappInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa48b=['socket.io-emitter','./whatsappInteraction.socket','register','request','then','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappInteraction,\x20%s,\x20%s','message','result','catch','UpdateWhatsappInteraction','update','body','options','raw','where','attributes','limit','AddTagsToWhatsappInteraction','WhatsappInteraction','find','addTags','omit','spread','info','AddTags','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0xa48b,0x72));var _0xba48=function(_0x48aad1,_0x2bc3ca){_0x48aad1=_0x48aad1-0x0;var _0x265330=_0xa48b[_0x48aad1];return _0x265330;};'use strict';var _=require('lodash');var util=require(_0xba48('0x0'));var moment=require(_0xba48('0x1'));var BPromise=require(_0xba48('0x2'));var rs=require(_0xba48('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xba48('0x4'))['db'];var utils=require(_0xba48('0x5'));var logger=require(_0xba48('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xba48('0x7'));var client=jayson[_0xba48('0x8')][_0xba48('0x9')]({'port':0x232a});config[_0xba48('0xa')]=_[_0xba48('0xb')](config[_0xba48('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xba48('0xc'))(new Redis(config[_0xba48('0xa')]));require(_0xba48('0xd'))[_0xba48('0xe')](socket);function respondWithRpcPromise(_0x3e5a01,_0x2ba093,_0x2958e7){return new BPromise(function(_0xd2d1f7,_0x3f7b03){return client[_0xba48('0xf')](_0x3e5a01,_0x2958e7)[_0xba48('0x10')](function(_0x2ca356){logger['info']('WhatsappInteraction,\x20%s,\x20%s',_0x2ba093,_0xba48('0x11'));logger[_0xba48('0x12')](_0xba48('0x13'),_0x2ba093,_0xba48('0x11'),JSON[_0xba48('0x14')](_0x2ca356));if(_0x2ca356[_0xba48('0x15')]){if(_0x2ca356[_0xba48('0x15')]['code']===0x1f4){logger['error'](_0xba48('0x16'),_0x2ba093,_0x2ca356[_0xba48('0x15')][_0xba48('0x17')]);return _0x3f7b03(_0x2ca356[_0xba48('0x15')][_0xba48('0x17')]);}logger[_0xba48('0x15')](_0xba48('0x16'),_0x2ba093,_0x2ca356[_0xba48('0x15')][_0xba48('0x17')]);return _0xd2d1f7(_0x2ca356[_0xba48('0x15')][_0xba48('0x17')]);}else{logger['info'](_0xba48('0x16'),_0x2ba093,'request\x20sent');_0xd2d1f7(_0x2ca356[_0xba48('0x18')]['message']);}})[_0xba48('0x19')](function(_0x24564f){logger[_0xba48('0x15')](_0xba48('0x16'),_0x2ba093,_0x24564f);_0x3f7b03(_0x24564f);});});}exports[_0xba48('0x1a')]=function(_0x407f92){var _0x32d4c7=this;return new Promise(function(_0x1365f1,_0x199802){return db['WhatsappInteraction'][_0xba48('0x1b')](_0x407f92[_0xba48('0x1c')],{'raw':_0x407f92[_0xba48('0x1d')]?_0x407f92[_0xba48('0x1d')][_0xba48('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x407f92['options']?_0x407f92[_0xba48('0x1d')][_0xba48('0x1f')]||null:null,'attributes':_0x407f92[_0xba48('0x1d')]?_0x407f92[_0xba48('0x1d')][_0xba48('0x20')]||null:null,'limit':_0x407f92[_0xba48('0x1d')]?_0x407f92[_0xba48('0x1d')][_0xba48('0x21')]||null:null})[_0xba48('0x10')](function(_0x2e28df){logger['info'](_0xba48('0x1a'),_0x407f92);logger['debug'](_0xba48('0x1a'),_0x407f92,JSON['stringify'](_0x2e28df));_0x1365f1(_0x2e28df);})[_0xba48('0x19')](function(_0x2fe86b){logger[_0xba48('0x15')](_0xba48('0x1a'),_0x2fe86b[_0xba48('0x17')],_0x407f92);_0x199802(_0x32d4c7['error'](0x1f4,_0x2fe86b[_0xba48('0x17')]));});});};exports[_0xba48('0x22')]=function(_0x420f8a){return new Promise(function(_0x18fa26,_0x4cd632){return db[_0xba48('0x23')][_0xba48('0x24')]({'where':_0x420f8a[_0xba48('0x1d')]?_0x420f8a['options'][_0xba48('0x1f')]||null:null})[_0xba48('0x10')](function(_0x107387){if(_0x107387){return _0x107387[_0xba48('0x25')](_0x420f8a[_0xba48('0x1c')]['ids'],_[_0xba48('0x26')](_0x420f8a[_0xba48('0x1c')],['ids','id'])||{});}})[_0xba48('0x27')](function(_0x549783){logger[_0xba48('0x28')](_0xba48('0x29'),_0x420f8a);logger['debug'](_0xba48('0x29'),_0x420f8a,JSON[_0xba48('0x14')](_0x549783));_0x18fa26(_0x549783);})[_0xba48('0x19')](function(_0x5d8cee){logger[_0xba48('0x15')](_0xba48('0x29'),_0x5d8cee[_0xba48('0x17')],_0x420f8a);_0x4cd632(_this['error'](0x1f4,_0x5d8cee[_0xba48('0x17')]));});});}; \ No newline at end of file +var _0x11fa=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','WhatsappInteraction','body','options','raw','where','attributes','then','UpdateWhatsappInteraction','addTags','ids','omit','AddTags'];(function(_0x161587,_0x5c4528){var _0x293546=function(_0x40406e){while(--_0x40406e){_0x161587['push'](_0x161587['shift']());}};_0x293546(++_0x5c4528);}(_0x11fa,0x1ec));var _0xa11f=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0x11fa[_0x5a95fa];return _0x1a61b8;};'use strict';var _=require(_0xa11f('0x0'));var util=require(_0xa11f('0x1'));var moment=require(_0xa11f('0x2'));var BPromise=require(_0xa11f('0x3'));var rs=require(_0xa11f('0x4'));var fs=require('fs');var Redis=require(_0xa11f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa11f('0x6'));var logger=require('../../config/logger')(_0xa11f('0x7'));var config=require(_0xa11f('0x8'));var jayson=require(_0xa11f('0x9'));var client=jayson[_0xa11f('0xa')]['http']({'port':0x232a});config[_0xa11f('0xb')]=_[_0xa11f('0xc')](config[_0xa11f('0xb')],{'host':_0xa11f('0xd'),'port':0x18eb});var socket=require(_0xa11f('0xe'))(new Redis(config[_0xa11f('0xb')]));require(_0xa11f('0xf'))[_0xa11f('0x10')](socket);function respondWithRpcPromise(_0x26ba20,_0x1295cd,_0x4cc568){return new BPromise(function(_0x2577a9,_0x427f91){return client[_0xa11f('0x11')](_0x26ba20,_0x4cc568)['then'](function(_0x34f4d4){logger[_0xa11f('0x12')](_0xa11f('0x13'),_0x1295cd,_0xa11f('0x14'));logger[_0xa11f('0x15')](_0xa11f('0x16'),_0x1295cd,'request\x20sent',JSON[_0xa11f('0x17')](_0x34f4d4));if(_0x34f4d4[_0xa11f('0x18')]){if(_0x34f4d4[_0xa11f('0x18')][_0xa11f('0x19')]===0x1f4){logger[_0xa11f('0x18')](_0xa11f('0x13'),_0x1295cd,_0x34f4d4[_0xa11f('0x18')][_0xa11f('0x1a')]);return _0x427f91(_0x34f4d4[_0xa11f('0x18')][_0xa11f('0x1a')]);}logger[_0xa11f('0x18')](_0xa11f('0x13'),_0x1295cd,_0x34f4d4[_0xa11f('0x18')][_0xa11f('0x1a')]);return _0x2577a9(_0x34f4d4[_0xa11f('0x18')][_0xa11f('0x1a')]);}else{logger[_0xa11f('0x12')](_0xa11f('0x13'),_0x1295cd,_0xa11f('0x14'));_0x2577a9(_0x34f4d4[_0xa11f('0x1b')][_0xa11f('0x1a')]);}})[_0xa11f('0x1c')](function(_0x4f1e55){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x1295cd,_0x4f1e55);_0x427f91(_0x4f1e55);});});}exports['UpdateWhatsappInteraction']=function(_0x10c7d0){var _0x169cf5=this;return new Promise(function(_0x5558b8,_0x1c8ddc){return db[_0xa11f('0x1d')]['update'](_0x10c7d0[_0xa11f('0x1e')],{'raw':_0x10c7d0[_0xa11f('0x1f')]?_0x10c7d0[_0xa11f('0x1f')][_0xa11f('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10c7d0[_0xa11f('0x1f')]?_0x10c7d0[_0xa11f('0x1f')][_0xa11f('0x21')]||null:null,'attributes':_0x10c7d0[_0xa11f('0x1f')]?_0x10c7d0[_0xa11f('0x1f')][_0xa11f('0x22')]||null:null,'limit':_0x10c7d0[_0xa11f('0x1f')]?_0x10c7d0['options']['limit']||null:null})[_0xa11f('0x23')](function(_0x36543b){logger[_0xa11f('0x12')](_0xa11f('0x24'),_0x10c7d0);logger[_0xa11f('0x15')](_0xa11f('0x24'),_0x10c7d0,JSON[_0xa11f('0x17')](_0x36543b));_0x5558b8(_0x36543b);})['catch'](function(_0x1ebdf0){logger['error'](_0xa11f('0x24'),_0x1ebdf0[_0xa11f('0x1a')],_0x10c7d0);_0x1c8ddc(_0x169cf5[_0xa11f('0x18')](0x1f4,_0x1ebdf0['message']));});});};exports['AddTagsToWhatsappInteraction']=function(_0x59f88e){return new Promise(function(_0x162f62,_0x2874d2){return db[_0xa11f('0x1d')]['find']({'where':_0x59f88e[_0xa11f('0x1f')]?_0x59f88e[_0xa11f('0x1f')][_0xa11f('0x21')]||null:null})[_0xa11f('0x23')](function(_0x25e54e){if(_0x25e54e){return _0x25e54e[_0xa11f('0x25')](_0x59f88e[_0xa11f('0x1e')][_0xa11f('0x26')],_[_0xa11f('0x27')](_0x59f88e[_0xa11f('0x1e')],['ids','id'])||{});}})['spread'](function(_0x81f89d){logger[_0xa11f('0x12')](_0xa11f('0x28'),_0x59f88e);logger['debug']('AddTags',_0x59f88e,JSON['stringify'](_0x81f89d));_0x162f62(_0x81f89d);})[_0xa11f('0x1c')](function(_0x4d10a7){logger['error']('AddTags',_0x4d10a7['message'],_0x59f88e);_0x2874d2(_this[_0xa11f('0x18')](0x1f4,_0x4d10a7['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 2afff1d..7d5d0e1 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.socket.js +++ b/server/api/whatsappInteraction/whatsappInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd7cf=['emit','removeListener','register','length','whatsappInteraction:','./whatsappInteraction.events','remove'];(function(_0x2c9c16,_0x191d2e){var _0x3f0ee4=function(_0x408fab){while(--_0x408fab){_0x2c9c16['push'](_0x2c9c16['shift']());}};_0x3f0ee4(++_0x191d2e);}(_0xd7cf,0x140));var _0xfd7c=function(_0x322296,_0x57eb19){_0x322296=_0x322296-0x0;var _0x432ea7=_0xd7cf[_0x322296];return _0x432ea7;};'use strict';var WhatsappInteractionEvents=require(_0xfd7c('0x0'));var events=['save',_0xfd7c('0x1'),'update'];function createListener(_0x5d40fd,_0x2ad411){return function(_0x289e6a){_0x2ad411[_0xfd7c('0x2')](_0x5d40fd,_0x289e6a);};}function removeListener(_0x398901,_0x83242a){return function(){WhatsappInteractionEvents[_0xfd7c('0x3')](_0x398901,_0x83242a);};}exports[_0xfd7c('0x4')]=function(_0x1c5cff){for(var _0x2b50b8=0x0,_0x512592=events[_0xfd7c('0x5')];_0x2b50b8<_0x512592;_0x2b50b8++){var _0x150382=events[_0x2b50b8];var _0x36905b=createListener(_0xfd7c('0x6')+_0x150382,_0x1c5cff);WhatsappInteractionEvents['on'](_0x150382,_0x36905b);}}; \ No newline at end of file +var _0xf95a=['removeListener','register','length','whatsappInteraction:','./whatsappInteraction.events','save','remove','update'];(function(_0x1b2c07,_0x4c9b75){var _0x193a4e=function(_0xa6b584){while(--_0xa6b584){_0x1b2c07['push'](_0x1b2c07['shift']());}};_0x193a4e(++_0x4c9b75);}(_0xf95a,0xbc));var _0xaf95=function(_0x4f1d15,_0x5cde3a){_0x4f1d15=_0x4f1d15-0x0;var _0xbd2c1e=_0xf95a[_0x4f1d15];return _0xbd2c1e;};'use strict';var WhatsappInteractionEvents=require(_0xaf95('0x0'));var events=[_0xaf95('0x1'),_0xaf95('0x2'),_0xaf95('0x3')];function createListener(_0x33a704,_0x42abd1){return function(_0x129c92){_0x42abd1['emit'](_0x33a704,_0x129c92);};}function removeListener(_0x4a1b27,_0x1e401d){return function(){WhatsappInteractionEvents[_0xaf95('0x4')](_0x4a1b27,_0x1e401d);};}exports[_0xaf95('0x5')]=function(_0x10ba2a){for(var _0x5692ec=0x0,_0x1b2c5b=events[_0xaf95('0x6')];_0x5692ec<_0x1b2c5b;_0x5692ec++){var _0x26a6f2=events[_0x5692ec];var _0x31a5f9=createListener(_0xaf95('0x7')+_0x26a6f2,_0x10ba2a);WhatsappInteractionEvents['on'](_0x26a6f2,_0x31a5f9);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 9dfd6c9..bf1a220 100644 --- a/server/api/whatsappMessage/index.js +++ b/server/api/whatsappMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb49d=['/:id/status','update','put','accept','/:id/reject','reject','destroy','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','post','tracked','whatsapp','whatsappmessage:create'];(function(_0x1af327,_0x375aba){var _0x36a437=function(_0x4de506){while(--_0x4de506){_0x1af327['push'](_0x1af327['shift']());}};_0x36a437(++_0x375aba);}(_0xb49d,0x1cf));var _0xdb49=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb49d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xdb49('0x0'));var util=require(_0xdb49('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xdb49('0x2')]();var fs_extra=require(_0xdb49('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xdb49('0x4'));var config=require(_0xdb49('0x5'));var controller=require(_0xdb49('0x6'));router[_0xdb49('0x7')]('/',auth['isAuthenticated'](),controller[_0xdb49('0x8')]);router['get'](_0xdb49('0x9'),auth[_0xdb49('0xa')](),controller[_0xdb49('0xb')]);router['get'](_0xdb49('0xc'),auth[_0xdb49('0xa')](),controller['show']);router[_0xdb49('0xd')]('/',auth['isAuthenticated'](),interaction[_0xdb49('0xe')](_0xdb49('0xf'),_0xdb49('0x10')),controller['create']);router[_0xdb49('0xd')](_0xdb49('0x11'),controller['status']);router['put'](_0xdb49('0xc'),auth[_0xdb49('0xa')](),controller[_0xdb49('0x12')]);router[_0xdb49('0x13')]('/:id/accept',auth['isAuthenticated'](),controller[_0xdb49('0x14')]);router[_0xdb49('0x13')](_0xdb49('0x15'),auth['isAuthenticated'](),controller[_0xdb49('0x16')]);router['delete']('/:id',auth[_0xdb49('0xa')](),controller[_0xdb49('0x17')]);module['exports']=router; \ No newline at end of file +var _0xed12=['/:id/reject','reject','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','isAuthenticated','index','get','/describe','describe','show','post','whatsapp','whatsappmessage:create','/:id/status','status','put','/:id','update','/:id/accept','accept'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xed12,0x79));var _0x2ed1=function(_0x17d3aa,_0x3d15c5){_0x17d3aa=_0x17d3aa-0x0;var _0x4de364=_0xed12[_0x17d3aa];return _0x4de364;};'use strict';var multer=require(_0x2ed1('0x0'));var util=require(_0x2ed1('0x1'));var path=require(_0x2ed1('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2ed1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2ed1('0x4'));var interaction=require(_0x2ed1('0x5'));var config=require(_0x2ed1('0x6'));var controller=require(_0x2ed1('0x7'));router['get']('/',auth[_0x2ed1('0x8')](),controller[_0x2ed1('0x9')]);router[_0x2ed1('0xa')](_0x2ed1('0xb'),auth[_0x2ed1('0x8')](),controller[_0x2ed1('0xc')]);router[_0x2ed1('0xa')]('/:id',auth[_0x2ed1('0x8')](),controller[_0x2ed1('0xd')]);router[_0x2ed1('0xe')]('/',auth[_0x2ed1('0x8')](),interaction['tracked'](_0x2ed1('0xf'),_0x2ed1('0x10')),controller['create']);router[_0x2ed1('0xe')](_0x2ed1('0x11'),controller[_0x2ed1('0x12')]);router[_0x2ed1('0x13')](_0x2ed1('0x14'),auth[_0x2ed1('0x8')](),controller[_0x2ed1('0x15')]);router[_0x2ed1('0x13')](_0x2ed1('0x16'),auth[_0x2ed1('0x8')](),controller[_0x2ed1('0x17')]);router[_0x2ed1('0x13')](_0x2ed1('0x18'),auth[_0x2ed1('0x8')](),controller[_0x2ed1('0x19')]);router[_0x2ed1('0x1a')](_0x2ed1('0x14'),auth[_0x2ed1('0x8')](),controller[_0x2ed1('0x1b')]);module[_0x2ed1('0x1c')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index a60bef3..fe14372 100644 --- a/server/api/whatsappMessage/whatsappMessage.attributes.js +++ b/server/api/whatsappMessage/whatsappMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x95b2=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x413727,_0x17adb1){var _0x5f46d7=function(_0xbb668e){while(--_0xbb668e){_0x413727['push'](_0x413727['shift']());}};_0x5f46d7(++_0x17adb1);}(_0x95b2,0x144));var _0x295b=function(_0x6c6056,_0x6a2792){_0x6c6056=_0x6c6056-0x0;var _0x2cd186=_0x95b2[_0x6c6056];return _0x2cd186;};'use strict';var Sequelize=require(_0x295b('0x0'));module[_0x295b('0x1')]={'body':{'type':Sequelize[_0x295b('0x2')](_0x295b('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x295b('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x295b('0x5')]('in',_0x295b('0x6')),'defaultValue':_0x295b('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x295b('0x7')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x295b('0x8')]},'secret':{'type':Sequelize[_0x295b('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x295b('0x7')]},'providerResponse':{'type':Sequelize[_0x295b('0x2')]}}; \ No newline at end of file +var _0x956a=['exports','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x570e96,_0x13a686){var _0x4bd5d6=function(_0x310029){while(--_0x310029){_0x570e96['push'](_0x570e96['shift']());}};_0x4bd5d6(++_0x13a686);}(_0x956a,0xb6));var _0xa956=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x956a[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require('sequelize');module[_0xa956('0x0')]={'body':{'type':Sequelize[_0xa956('0x1')](_0xa956('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xa956('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa956('0x4')]('in',_0xa956('0x5')),'defaultValue':_0xa956('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xa956('0x6')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xa956('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xa956('0x6')]},'providerResponse':{'type':Sequelize[_0xa956('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index a058638..e76dea8 100644 --- a/server/api/whatsappMessage/whatsappMessage.controller.js +++ b/server/api/whatsappMessage/whatsappMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd830=['jayson/promise','client','http','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','name','send','index','map','WhatsappMessage','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','describe','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','isNil','read1stAt','interaction','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','whatsapp-interactions','WhatsappInteractionId','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','Sequelize','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register'];(function(_0x42c876,_0xbc454b){var _0x3d46ef=function(_0x298f17){while(--_0x298f17){_0x42c876['push'](_0x42c876['shift']());}};_0x3d46ef(++_0xbc454b);}(_0xd830,0x199));var _0x0d83=function(_0x11c702,_0x50d44a){_0x11c702=_0x11c702-0x0;var _0x425081=_0xd830[_0x11c702];return _0x425081;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0d83('0x0'));var zipdir=require(_0x0d83('0x1'));var jsonpatch=require(_0x0d83('0x2'));var rp=require(_0x0d83('0x3'));var moment=require(_0x0d83('0x4'));var BPromise=require(_0x0d83('0x5'));var Mustache=require('mustache');var util=require(_0x0d83('0x6'));var path=require(_0x0d83('0x7'));var sox=require(_0x0d83('0x8'));var csv=require(_0x0d83('0x9'));var ejs=require(_0x0d83('0xa'));var fs=require('fs');var fs_extra=require(_0x0d83('0xb'));var _=require(_0x0d83('0xc'));var squel=require(_0x0d83('0xd'));var crypto=require(_0x0d83('0xe'));var jsforce=require(_0x0d83('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0d83('0x9'));var querystring=require(_0x0d83('0x10'));var Papa=require(_0x0d83('0x11'));var Redis=require(_0x0d83('0x12'));var authService=require(_0x0d83('0x13'));var qs=require(_0x0d83('0x14'));var as=require(_0x0d83('0x15'));var hardwareService=require(_0x0d83('0x16'));var logger=require(_0x0d83('0x17'))(_0x0d83('0x18'));var utils=require('../../config/utils');var config=require(_0x0d83('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x0d83('0x1a'))['db'];config[_0x0d83('0x1b')]=_['defaults'](config[_0x0d83('0x1b')],{'host':_0x0d83('0x1c'),'port':0x18eb});var socket=require(_0x0d83('0x1d'))(new Redis(config[_0x0d83('0x1b')]));require(_0x0d83('0x1e'))[_0x0d83('0x1f')](socket);var jayson=require(_0x0d83('0x20'));var client=jayson[_0x0d83('0x21')][_0x0d83('0x22')]({'port':0x232c});var client9002=jayson[_0x0d83('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8897f3,_0x4686df,_0x488a1f,_0x1f3a8f){return new BPromise(function(_0x182fc3,_0x2c11e2){var _0x1db414=_0x1f3a8f||client;return _0x1db414[_0x0d83('0x23')](_0x8897f3,_0x488a1f)['then'](function(_0x10b3e7){logger[_0x0d83('0x24')](_0x0d83('0x25'),_0x4686df,_0x0d83('0x26'));logger[_0x0d83('0x27')](_0x0d83('0x28'),_0x4686df,_0x0d83('0x26'),JSON[_0x0d83('0x29')](_0x10b3e7));if(_0x10b3e7[_0x0d83('0x2a')]){if(_0x10b3e7[_0x0d83('0x2a')]['code']===0x1f4){logger[_0x0d83('0x2a')](_0x0d83('0x25'),_0x4686df,_0x10b3e7[_0x0d83('0x2a')][_0x0d83('0x2b')]);return _0x2c11e2(_0x10b3e7[_0x0d83('0x2a')][_0x0d83('0x2b')]);}logger[_0x0d83('0x2a')](_0x0d83('0x25'),_0x4686df,_0x10b3e7[_0x0d83('0x2a')]['message']);return _0x182fc3(_0x10b3e7[_0x0d83('0x2a')][_0x0d83('0x2b')]);}else{logger[_0x0d83('0x24')](_0x0d83('0x25'),_0x4686df,'request\x20sent');_0x182fc3(_0x10b3e7['result'][_0x0d83('0x2b')]);}})[_0x0d83('0x2c')](function(_0x28e913){logger[_0x0d83('0x2a')](_0x0d83('0x25'),_0x4686df,_0x28e913);_0x2c11e2(_0x28e913);});});}function respondWithStatusCode(_0x33b3b5,_0x4303fa){_0x4303fa=_0x4303fa||0xcc;return function(_0x438f0a){if(_0x438f0a){return _0x33b3b5[_0x0d83('0x2d')](_0x4303fa);}return _0x33b3b5[_0x0d83('0x2e')](_0x4303fa)[_0x0d83('0x2f')]();};}function respondWithResult(_0x3b7677,_0xa19970){_0xa19970=_0xa19970||0xc8;return function(_0x11ddba){if(_0x11ddba){return _0x3b7677[_0x0d83('0x2e')](_0xa19970)[_0x0d83('0x30')](_0x11ddba);}};}function respondWithFilteredResult(_0x3b26a4,_0x2e8ea4){return function(_0x3eb1b9){if(_0x3eb1b9){var _0x42f048=typeof _0x2e8ea4[_0x0d83('0x31')]===_0x0d83('0x32')&&typeof _0x2e8ea4[_0x0d83('0x33')]==='undefined';var _0x42550f=_0x3eb1b9['count'];var _0x52acaf=_0x42f048?0x0:_0x2e8ea4[_0x0d83('0x31')];var _0x3377dd=_0x42f048?_0x3eb1b9[_0x0d83('0x34')]:_0x2e8ea4[_0x0d83('0x31')]+_0x2e8ea4[_0x0d83('0x33')];var _0x58e3fc;if(_0x3377dd>=_0x42550f){_0x3377dd=_0x42550f;_0x58e3fc=0xc8;}else{_0x58e3fc=0xce;}_0x3b26a4[_0x0d83('0x2e')](_0x58e3fc);return _0x3b26a4[_0x0d83('0x35')](_0x0d83('0x36'),_0x52acaf+'-'+_0x3377dd+'/'+_0x42550f)['json'](_0x3eb1b9);}return null;};}function patchUpdates(_0xaee43e){return function(_0x1267c1){try{jsonpatch[_0x0d83('0x37')](_0x1267c1,_0xaee43e,!![]);}catch(_0x2a22ba){return BPromise[_0x0d83('0x38')](_0x2a22ba);}return _0x1267c1[_0x0d83('0x39')]();};}function saveUpdates(_0x4957db,_0xc1ea41){return function(_0x50d5e8){if(_0x50d5e8){return _0x50d5e8[_0x0d83('0x3a')](_0x4957db)['then'](function(_0x139ef0){return _0x139ef0;});}return null;};}function removeEntity(_0x274b54,_0x3681c1){return function(_0x42a42c){if(_0x42a42c){return _0x42a42c[_0x0d83('0x3b')]()[_0x0d83('0x3c')](function(){_0x274b54[_0x0d83('0x2e')](0xcc)[_0x0d83('0x2f')]();});}};}function handleEntityNotFound(_0x2aba89,_0x8fb9d8){return function(_0x52c1e6){if(!_0x52c1e6){_0x2aba89[_0x0d83('0x2d')](0x194);}return _0x52c1e6;};}function handleError(_0x1db055,_0x4cee0c){_0x4cee0c=_0x4cee0c||0x1f4;return function(_0x526011){logger['error'](_0x526011['stack']);if(_0x526011[_0x0d83('0x3d')]){delete _0x526011[_0x0d83('0x3d')];}_0x1db055[_0x0d83('0x2e')](_0x4cee0c)[_0x0d83('0x3e')](_0x526011);};}exports[_0x0d83('0x3f')]=function(_0x451a01,_0x43876c){var _0x263e14={},_0xa4e352={},_0x22cc8e={'count':0x0,'rows':[]};var _0x5d0677=_[_0x0d83('0x40')](db[_0x0d83('0x41')]['rawAttributes'],function(_0x5600fb){return{'name':_0x5600fb[_0x0d83('0x42')],'type':_0x5600fb[_0x0d83('0x43')][_0x0d83('0x44')]};});_0xa4e352[_0x0d83('0x45')]=_[_0x0d83('0x40')](_0x5d0677,_0x0d83('0x3d'));_0xa4e352[_0x0d83('0x46')]=_[_0x0d83('0x47')](_0x451a01[_0x0d83('0x46')]);_0xa4e352[_0x0d83('0x48')]=_[_0x0d83('0x49')](_0xa4e352[_0x0d83('0x45')],_0xa4e352[_0x0d83('0x46')]);_0x263e14['attributes']=_[_0x0d83('0x49')](_0xa4e352[_0x0d83('0x45')],qs[_0x0d83('0x4a')](_0x451a01[_0x0d83('0x46')][_0x0d83('0x4a')]));_0x263e14[_0x0d83('0x4b')]=_0x263e14['attributes'][_0x0d83('0x4c')]?_0x263e14[_0x0d83('0x4b')]:_0xa4e352[_0x0d83('0x45')];if(!_0x451a01[_0x0d83('0x46')]['hasOwnProperty'](_0x0d83('0x4d'))){_0x263e14[_0x0d83('0x33')]=qs[_0x0d83('0x33')](_0x451a01['query'][_0x0d83('0x33')]);_0x263e14['offset']=qs['offset'](_0x451a01[_0x0d83('0x46')]['offset']);}_0x263e14[_0x0d83('0x4e')]=qs[_0x0d83('0x4f')](_0x451a01[_0x0d83('0x46')][_0x0d83('0x4f')]);_0x263e14[_0x0d83('0x50')]=qs[_0x0d83('0x48')](_[_0x0d83('0x51')](_0x451a01['query'],_0xa4e352[_0x0d83('0x48')]),_0x5d0677);if(_0x451a01['query'][_0x0d83('0x52')]){_0x263e14[_0x0d83('0x50')]=_['merge'](_0x263e14['where'],{'$or':_['map'](_0x5d0677,function(_0x45fcc1){if(_0x45fcc1[_0x0d83('0x43')]!==_0x0d83('0x53')){var _0x2d9d48={};_0x2d9d48[_0x45fcc1['name']]={'$like':'%'+_0x451a01['query'][_0x0d83('0x52')]+'%'};return _0x2d9d48;}})});}_0x263e14=_[_0x0d83('0x54')]({},_0x263e14,_0x451a01[_0x0d83('0x55')]);var _0x288794={'where':_0x263e14[_0x0d83('0x50')]};return db[_0x0d83('0x41')][_0x0d83('0x34')](_0x288794)[_0x0d83('0x3c')](function(_0x19b787){_0x22cc8e[_0x0d83('0x34')]=_0x19b787;if(_0x451a01[_0x0d83('0x46')][_0x0d83('0x56')]){_0x263e14[_0x0d83('0x57')]=[{'all':!![]}];}return db[_0x0d83('0x41')][_0x0d83('0x58')](_0x263e14);})[_0x0d83('0x3c')](function(_0x17a3e7){_0x22cc8e[_0x0d83('0x59')]=_0x17a3e7;return _0x22cc8e;})[_0x0d83('0x3c')](respondWithFilteredResult(_0x43876c,_0x263e14))[_0x0d83('0x2c')](handleError(_0x43876c,null));};exports[_0x0d83('0x5a')]=function(_0x17385a,_0x4319dc){var _0x2c5b57={'raw':!![],'where':{'id':_0x17385a[_0x0d83('0x5b')]['id']}},_0x1fb543={};_0x1fb543[_0x0d83('0x45')]=_[_0x0d83('0x47')](db[_0x0d83('0x41')][_0x0d83('0x5c')]);_0x1fb543['query']=_[_0x0d83('0x47')](_0x17385a['query']);_0x1fb543[_0x0d83('0x48')]=_[_0x0d83('0x49')](_0x1fb543[_0x0d83('0x45')],_0x1fb543[_0x0d83('0x46')]);_0x2c5b57[_0x0d83('0x4b')]=_['intersection'](_0x1fb543[_0x0d83('0x45')],qs[_0x0d83('0x4a')](_0x17385a[_0x0d83('0x46')][_0x0d83('0x4a')]));_0x2c5b57[_0x0d83('0x4b')]=_0x2c5b57[_0x0d83('0x4b')]['length']?_0x2c5b57[_0x0d83('0x4b')]:_0x1fb543[_0x0d83('0x45')];if(_0x17385a[_0x0d83('0x46')][_0x0d83('0x56')]){_0x2c5b57[_0x0d83('0x57')]=[{'all':!![]}];}_0x2c5b57=_['merge']({},_0x2c5b57,_0x17385a[_0x0d83('0x55')]);return db[_0x0d83('0x41')][_0x0d83('0x5d')](_0x2c5b57)[_0x0d83('0x3c')](handleEntityNotFound(_0x4319dc,null))[_0x0d83('0x3c')](respondWithResult(_0x4319dc,null))['catch'](handleError(_0x4319dc,null));};exports[_0x0d83('0x5e')]=function(_0x39a2a1,_0x3b7992){return db[_0x0d83('0x41')][_0x0d83('0x5e')](_0x39a2a1[_0x0d83('0x5f')],{})[_0x0d83('0x3c')](respondWithResult(_0x3b7992,0xc9))['catch'](handleError(_0x3b7992,null));};exports[_0x0d83('0x3a')]=function(_0x24f7d7,_0x33a6d2){if(_0x24f7d7[_0x0d83('0x5f')]['id']){delete _0x24f7d7[_0x0d83('0x5f')]['id'];}return db[_0x0d83('0x41')]['find']({'where':{'id':_0x24f7d7[_0x0d83('0x5b')]['id']}})[_0x0d83('0x3c')](handleEntityNotFound(_0x33a6d2,null))[_0x0d83('0x3c')](saveUpdates(_0x24f7d7[_0x0d83('0x5f')],null))['then'](respondWithResult(_0x33a6d2,null))[_0x0d83('0x2c')](handleError(_0x33a6d2,null));};exports[_0x0d83('0x3b')]=function(_0x1d934c,_0x1b3b3e){return db[_0x0d83('0x41')]['find']({'where':{'id':_0x1d934c[_0x0d83('0x5b')]['id']}})[_0x0d83('0x3c')](handleEntityNotFound(_0x1b3b3e,null))[_0x0d83('0x3c')](removeEntity(_0x1b3b3e,null))['catch'](handleError(_0x1b3b3e,null));};exports[_0x0d83('0x60')]=function(_0x1e02f5,_0x2725d5){return db[_0x0d83('0x41')][_0x0d83('0x60')]()[_0x0d83('0x3c')](respondWithResult(_0x2725d5,null))[_0x0d83('0x2c')](handleError(_0x2725d5,null));};var interaction_log=require('../../config/logger')('whatsapp-interactions');exports[_0x0d83('0x61')]=function(_0x542283,_0x2995a7,_0x2f43dc){var _0x55f210={'agent':{},'channel':_0x0d83('0x62')};if(_0x542283[_0x0d83('0x5f')]['id']){delete _0x542283[_0x0d83('0x5f')]['id'];}_0x542283[_0x0d83('0x5f')][_0x0d83('0x63')]=!![];_0x542283[_0x0d83('0x5f')][_0x0d83('0x64')]=moment()[_0x0d83('0x65')](_0x0d83('0x66'));_0x542283[_0x0d83('0x5f')]['UserId']=_0x542283[_0x0d83('0x5f')][_0x0d83('0x67')]||_0x542283[_0x0d83('0x68')]['id'];_0x55f210[_0x0d83('0x69')]['id']=_0x542283[_0x0d83('0x5f')]['UserId'];return db['WhatsappMessage'][_0x0d83('0x5d')]({'where':{'id':_0x542283['params']['id'],'UserId':null}})[_0x0d83('0x3c')](handleEntityNotFound(_0x2995a7,null))[_0x0d83('0x3c')](saveUpdates(_0x542283[_0x0d83('0x5f')],null))[_0x0d83('0x3c')](function(_0x857583){if(_0x857583){_0x55f210[_0x0d83('0x2b')]=_0x857583[_0x0d83('0x6a')]({'plain':!![]});return db[_0x0d83('0x6b')][_0x0d83('0x5d')]({'where':{'id':_0x857583['WhatsappInteractionId']}});}return null;})[_0x0d83('0x3c')](handleEntityNotFound(_0x2995a7,null))['then'](function(_0x5ba41c){if(_0x5ba41c){return _0x5ba41c[_0x0d83('0x3a')]({'UserId':_0x542283[_0x0d83('0x5f')][_0x0d83('0x67')],'read1stAt':_[_0x0d83('0x6c')](_0x5ba41c[_0x0d83('0x6d')])?moment()[_0x0d83('0x65')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x298919){if(_0x298919){_0x55f210[_0x0d83('0x6e')]=_0x298919[_0x0d83('0x6a')]({'plain':!![]});interaction_log[_0x0d83('0x24')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x542283[_0x0d83('0x68')]['id'],_0x542283['user'][_0x0d83('0x3d')],_0x542283[_0x0d83('0x68')][_0x0d83('0x6f')],_0x55f210[_0x0d83('0x6e')]['id'],_0x542283['body']?JSON[_0x0d83('0x29')](_0x542283[_0x0d83('0x5f')]):'null');return respondWithRpcPromise(_0x0d83('0x70'),_0x0d83('0x71'),_0x55f210);}return null;})['then'](function(_0x20976c){var _0xac0134=_0x0d83('0x72')+_0x20976c['message'][_0x0d83('0x73')];return db[_0x0d83('0x74')]['query'](_0xac0134,{'type':db['Sequelize'][_0x0d83('0x75')][_0x0d83('0x76')],'raw':!![]})['then'](function(_0x575591){return _0x575591;});})[_0x0d83('0x3c')](function(_0xb51cf9){if(_0xb51cf9){_0x55f210[_0x0d83('0x2b')][_0x0d83('0x77')]=_0xb51cf9[0x0];if(!_0x542283[_0x0d83('0x5f')][_0x0d83('0x67')])return;return db[_0x0d83('0x78')][_0x0d83('0x5d')]({'where':{'id':_0x542283[_0x0d83('0x5f')][_0x0d83('0x67')],'role':_0x0d83('0x69')},'attributes':['id',_0x0d83('0x3d'),_0x0d83('0x79'),_0x0d83('0x7a'),'internal'],'raw':!![]});}return null;})[_0x0d83('0x3c')](function(_0x17a5af){if(!_0x17a5af)return null;_0x55f210[_0x0d83('0x2b')]['agent']=_0x17a5af;return _0x55f210;})[_0x0d83('0x3c')](function(_0x2d0876){if(_0x2d0876){if(_0x542283[_0x0d83('0x5f')][_0x0d83('0x7b')]){_0x55f210[_0x0d83('0x2b')][_0x0d83('0x7c')]=util[_0x0d83('0x65')](_0x0d83('0x7d'),_0x542283['user'][_0x0d83('0x3d')]);_0x55f210[_0x0d83('0x2b')]['channel']=_0x55f210[_0x0d83('0x7e')];_0x55f210['message'][_0x0d83('0x7f')]=_0x55f210[_0x0d83('0x7e')];_0x55f210[_0x0d83('0x2b')][_0x0d83('0x80')]=_0x0d83('0x61');return respondWithRpcPromise(_0x0d83('0x81'),_0x0d83('0x81'),{'event':_0x0d83('0x82'),'message':_0x55f210[_0x0d83('0x2b')]},client9002)['then'](function(){return _0x55f210;});}return _0x55f210;}return null;})[_0x0d83('0x3c')](respondWithResult(_0x2995a7,null))['catch'](handleError(_0x2995a7,null));};var interaction_log=require(_0x0d83('0x17'))(_0x0d83('0x83'));exports[_0x0d83('0x38')]=function(_0x3e10c2,_0x11aa0c,_0xe574d2){var _0x2a61fa={'agent':{},'channel':_0x0d83('0x62')};if(_0x3e10c2['body']['id']){delete _0x3e10c2[_0x0d83('0x5f')]['id'];}_0x3e10c2[_0x0d83('0x5f')]['UserId']=_0x3e10c2[_0x0d83('0x5f')][_0x0d83('0x67')]||_0x3e10c2['user']['id'];_0x2a61fa[_0x0d83('0x69')]['id']=_0x3e10c2['body']['UserId'];return db['WhatsappMessage'][_0x0d83('0x5d')]({'where':{'id':_0x3e10c2['params']['id'],'UserId':null}})[_0x0d83('0x3c')](handleEntityNotFound(_0x11aa0c,null))[_0x0d83('0x3c')](function(_0x276309){if(_0x276309){_0x2a61fa[_0x0d83('0x2b')]=_0x276309['get']({'plain':!![]});return db[_0x0d83('0x6b')][_0x0d83('0x5d')]({'where':{'id':_0x276309[_0x0d83('0x84')]}});}return null;})[_0x0d83('0x3c')](handleEntityNotFound(_0x11aa0c,null))['then'](function(_0x3834b0){if(_0x3834b0){_0x2a61fa['interaction']=_0x3834b0[_0x0d83('0x6a')]({'plain':!![]});interaction_log[_0x0d83('0x24')](_0x0d83('0x85'),_0x3e10c2[_0x0d83('0x68')]['id'],_0x3e10c2['user'][_0x0d83('0x3d')],_0x3e10c2[_0x0d83('0x68')][_0x0d83('0x6f')],_0x2a61fa[_0x0d83('0x6e')]['id'],_0x3e10c2[_0x0d83('0x5f')]?JSON[_0x0d83('0x29')](_0x3e10c2[_0x0d83('0x5f')]):_0x0d83('0x86'));return respondWithRpcPromise(_0x0d83('0x87'),_0x0d83('0x88'),_0x2a61fa);}return null;})[_0x0d83('0x3c')](function(_0x622585){var _0x1b255f=_0x0d83('0x72')+_0x622585[_0x0d83('0x2b')][_0x0d83('0x73')];return db[_0x0d83('0x74')][_0x0d83('0x46')](_0x1b255f,{'type':db[_0x0d83('0x89')][_0x0d83('0x75')][_0x0d83('0x76')],'raw':!![]})[_0x0d83('0x3c')](function(_0x5986d1){return _0x5986d1;});})['then'](function(_0x167dc9){if(_0x167dc9){_0x2a61fa[_0x0d83('0x2b')]['contact']=_0x167dc9[0x0];if(!_0x3e10c2[_0x0d83('0x5f')][_0x0d83('0x67')])return;return db['User']['find']({'where':{'id':_0x3e10c2['body']['UserId'],'role':_0x0d83('0x69')},'attributes':['id','name',_0x0d83('0x79'),_0x0d83('0x7a'),'internal'],'raw':!![]});}return null;})[_0x0d83('0x3c')](function(_0x1d32ad){if(!_0x1d32ad)return null;_0x2a61fa[_0x0d83('0x2b')]['agent']=_0x1d32ad;return _0x2a61fa;})['then'](function(_0x37f417){if(_0x37f417){_0x37f417[_0x0d83('0x2b')][_0x0d83('0x7c')]=util[_0x0d83('0x65')](_0x0d83('0x7d'),_0x3e10c2[_0x0d83('0x68')]['name']);_0x37f417[_0x0d83('0x2b')]['channel']=_0x2a61fa[_0x0d83('0x7e')];_0x37f417[_0x0d83('0x2b')][_0x0d83('0x7f')]=_0x2a61fa[_0x0d83('0x7e')];_0x37f417['message'][_0x0d83('0x80')]=_0x0d83('0x38');respondWithRpcPromise(_0x0d83('0x81'),_0x0d83('0x81'),{'event':'rejectmessage','message':_0x37f417[_0x0d83('0x2b')]},client9002);return _0x2a61fa;}return null;})[_0x0d83('0x3c')](respondWithResult(_0x11aa0c,null))[_0x0d83('0x2c')](handleError(_0x11aa0c,null));};exports['status']=function(_0x4c015b,_0x275565,_0x4a01fd){if(_0x4c015b[_0x0d83('0x5f')]['id']){delete _0x4c015b[_0x0d83('0x5f')]['id'];}var _0x465a64;return db[_0x0d83('0x41')][_0x0d83('0x5d')]({'where':{'id':_0x4c015b[_0x0d83('0x5b')]['id']}})[_0x0d83('0x3c')](handleEntityNotFound(_0x275565,null))['then'](function(_0x3422ff){if(_0x3422ff){_0x465a64=_0x3422ff;return db[_0x0d83('0x8a')]['find']({'where':{'id':_0x3422ff[_0x0d83('0x8b')]}});}})[_0x0d83('0x3c')](handleEntityNotFound(_0x275565,null))['then'](function(_0x3c34d9){if(_0x3c34d9){logger[_0x0d83('0x27')](_0x0d83('0x8c'),_0x0d83('0x2e'),_0x0d83('0x8d'),_0x3c34d9[_0x0d83('0x43')],util['inspect'](_0x4c015b[_0x0d83('0x5f')],{'showHidden':![],'depth':null}));switch(_0x3c34d9['type']){case _0x0d83('0x8e'):if(_0x4c015b[_0x0d83('0x5f')][_0x0d83('0x8f')]&&_0x4c015b[_0x0d83('0x5f')][_0x0d83('0x8f')]===_0x465a64[_0x0d83('0x90')]&&_0x4c015b['body'][_0x0d83('0x91')]&&_0x4c015b[_0x0d83('0x5f')][_0x0d83('0x91')]===_0x0d83('0x63')){return _0x465a64[_0x0d83('0x3a')]({'read':!![]});}else{logger[_0x0d83('0x2a')](_0x0d83('0x92'),_0x0d83('0x2e'),_0x0d83('0x8e'),util['inspect'](_0x4c015b['body'],{'showHidden':![],'depth':null}));}break;}return _0x465a64;}})[_0x0d83('0x3c')](respondWithResult(_0x275565,null))['catch'](handleError(_0x275565,null));}; \ No newline at end of file +var _0x2f27=['fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./whatsappMessage.socket','register','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','json','offset','limit','count','set','Content-Range','apply','reject','update','destroy','stack','name','send','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','map','VIRTUAL','merge','options','WhatsappMessage','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','whatsapp-interactions','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','WhatsappInteraction','WhatsappInteractionId','interaction','get','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','channel','EventManager','../../config/logger','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','interface','SIP/%s','motionChannel','event','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','messageId','MessageStatus','twilio','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs'];(function(_0x206487,_0x28eec1){var _0x2714c7=function(_0x298179){while(--_0x298179){_0x206487['push'](_0x206487['shift']());}};_0x2714c7(++_0x28eec1);}(_0x2f27,0x7f));var _0x72f2=function(_0x8c096c,_0x5bd958){_0x8c096c=_0x8c096c-0x0;var _0x3047f6=_0x2f27[_0x8c096c];return _0x3047f6;};'use strict';var emlformat=require(_0x72f2('0x0'));var rimraf=require(_0x72f2('0x1'));var zipdir=require(_0x72f2('0x2'));var jsonpatch=require(_0x72f2('0x3'));var rp=require(_0x72f2('0x4'));var moment=require(_0x72f2('0x5'));var BPromise=require(_0x72f2('0x6'));var Mustache=require('mustache');var util=require(_0x72f2('0x7'));var path=require(_0x72f2('0x8'));var sox=require(_0x72f2('0x9'));var csv=require(_0x72f2('0xa'));var ejs=require(_0x72f2('0xb'));var fs=require('fs');var fs_extra=require(_0x72f2('0xc'));var _=require('lodash');var squel=require(_0x72f2('0xd'));var crypto=require(_0x72f2('0xe'));var jsforce=require(_0x72f2('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x72f2('0xa'));var querystring=require(_0x72f2('0x10'));var Papa=require(_0x72f2('0x11'));var Redis=require(_0x72f2('0x12'));var authService=require(_0x72f2('0x13'));var qs=require(_0x72f2('0x14'));var as=require(_0x72f2('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x72f2('0x16'));var utils=require(_0x72f2('0x17'));var config=require(_0x72f2('0x18'));var licenseUtil=require(_0x72f2('0x19'));var db=require('../../mysqldb')['db'];config[_0x72f2('0x1a')]=_[_0x72f2('0x1b')](config[_0x72f2('0x1a')],{'host':_0x72f2('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x72f2('0x1a')]));require(_0x72f2('0x1d'))[_0x72f2('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x72f2('0x1f')][_0x72f2('0x20')]({'port':0x232c});var client9002=jayson[_0x72f2('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1eba55,_0x4d921e,_0x58de84,_0x29ab09){return new BPromise(function(_0x5d8e9b,_0x3a7213){var _0x201232=_0x29ab09||client;return _0x201232[_0x72f2('0x21')](_0x1eba55,_0x58de84)[_0x72f2('0x22')](function(_0x5a6283){logger[_0x72f2('0x23')](_0x72f2('0x24'),_0x4d921e,_0x72f2('0x25'));logger[_0x72f2('0x26')](_0x72f2('0x27'),_0x4d921e,'request\x20sent',JSON[_0x72f2('0x28')](_0x5a6283));if(_0x5a6283[_0x72f2('0x29')]){if(_0x5a6283[_0x72f2('0x29')][_0x72f2('0x2a')]===0x1f4){logger[_0x72f2('0x29')]('WhatsappMessage,\x20%s,\x20%s',_0x4d921e,_0x5a6283[_0x72f2('0x29')][_0x72f2('0x2b')]);return _0x3a7213(_0x5a6283[_0x72f2('0x29')][_0x72f2('0x2b')]);}logger[_0x72f2('0x29')](_0x72f2('0x24'),_0x4d921e,_0x5a6283[_0x72f2('0x29')][_0x72f2('0x2b')]);return _0x5d8e9b(_0x5a6283[_0x72f2('0x29')][_0x72f2('0x2b')]);}else{logger[_0x72f2('0x23')]('WhatsappMessage,\x20%s,\x20%s',_0x4d921e,_0x72f2('0x25'));_0x5d8e9b(_0x5a6283[_0x72f2('0x2c')]['message']);}})['catch'](function(_0x5775a6){logger[_0x72f2('0x29')](_0x72f2('0x24'),_0x4d921e,_0x5775a6);_0x3a7213(_0x5775a6);});});}function respondWithStatusCode(_0x4b0ee0,_0x3a61d3){_0x3a61d3=_0x3a61d3||0xcc;return function(_0x3e3374){if(_0x3e3374){return _0x4b0ee0['sendStatus'](_0x3a61d3);}return _0x4b0ee0[_0x72f2('0x2d')](_0x3a61d3)[_0x72f2('0x2e')]();};}function respondWithResult(_0x105371,_0x1e7701){_0x1e7701=_0x1e7701||0xc8;return function(_0x3d7b4b){if(_0x3d7b4b){return _0x105371[_0x72f2('0x2d')](_0x1e7701)[_0x72f2('0x2f')](_0x3d7b4b);}};}function respondWithFilteredResult(_0x2fb5dd,_0xc1d666){return function(_0x5e1902){if(_0x5e1902){var _0x4ad629=typeof _0xc1d666[_0x72f2('0x30')]==='undefined'&&typeof _0xc1d666[_0x72f2('0x31')]==='undefined';var _0x5c4952=_0x5e1902[_0x72f2('0x32')];var _0x413904=_0x4ad629?0x0:_0xc1d666['offset'];var _0x562a8e=_0x4ad629?_0x5e1902[_0x72f2('0x32')]:_0xc1d666[_0x72f2('0x30')]+_0xc1d666[_0x72f2('0x31')];var _0x5a977e;if(_0x562a8e>=_0x5c4952){_0x562a8e=_0x5c4952;_0x5a977e=0xc8;}else{_0x5a977e=0xce;}_0x2fb5dd[_0x72f2('0x2d')](_0x5a977e);return _0x2fb5dd[_0x72f2('0x33')](_0x72f2('0x34'),_0x413904+'-'+_0x562a8e+'/'+_0x5c4952)['json'](_0x5e1902);}return null;};}function patchUpdates(_0xf4151){return function(_0x231040){try{jsonpatch[_0x72f2('0x35')](_0x231040,_0xf4151,!![]);}catch(_0x4854ae){return BPromise[_0x72f2('0x36')](_0x4854ae);}return _0x231040['save']();};}function saveUpdates(_0x57b741,_0x1ce0f4){return function(_0x2b3b14){if(_0x2b3b14){return _0x2b3b14[_0x72f2('0x37')](_0x57b741)[_0x72f2('0x22')](function(_0x19f923){return _0x19f923;});}return null;};}function removeEntity(_0x5cea67,_0x306e8d){return function(_0x1d6dee){if(_0x1d6dee){return _0x1d6dee[_0x72f2('0x38')]()[_0x72f2('0x22')](function(){_0x5cea67['status'](0xcc)[_0x72f2('0x2e')]();});}};}function handleEntityNotFound(_0x2ba66b,_0x26a461){return function(_0x22cf61){if(!_0x22cf61){_0x2ba66b['sendStatus'](0x194);}return _0x22cf61;};}function handleError(_0x321c01,_0x4c9e50){_0x4c9e50=_0x4c9e50||0x1f4;return function(_0x10ca2f){logger['error'](_0x10ca2f[_0x72f2('0x39')]);if(_0x10ca2f[_0x72f2('0x3a')]){delete _0x10ca2f['name'];}_0x321c01[_0x72f2('0x2d')](_0x4c9e50)[_0x72f2('0x3b')](_0x10ca2f);};}exports[_0x72f2('0x3c')]=function(_0x567ab8,_0x34e59c){var _0x467c62={},_0xa78f00={},_0x400acd={'count':0x0,'rows':[]};var _0x3ee9cf=_['map'](db['WhatsappMessage'][_0x72f2('0x3d')],function(_0x5aa09c){return{'name':_0x5aa09c[_0x72f2('0x3e')],'type':_0x5aa09c[_0x72f2('0x3f')][_0x72f2('0x40')]};});_0xa78f00[_0x72f2('0x41')]=_['map'](_0x3ee9cf,_0x72f2('0x3a'));_0xa78f00[_0x72f2('0x42')]=_[_0x72f2('0x43')](_0x567ab8['query']);_0xa78f00[_0x72f2('0x44')]=_[_0x72f2('0x45')](_0xa78f00[_0x72f2('0x41')],_0xa78f00[_0x72f2('0x42')]);_0x467c62[_0x72f2('0x46')]=_[_0x72f2('0x45')](_0xa78f00[_0x72f2('0x41')],qs[_0x72f2('0x47')](_0x567ab8['query'][_0x72f2('0x47')]));_0x467c62[_0x72f2('0x46')]=_0x467c62[_0x72f2('0x46')][_0x72f2('0x48')]?_0x467c62[_0x72f2('0x46')]:_0xa78f00[_0x72f2('0x41')];if(!_0x567ab8['query'][_0x72f2('0x49')](_0x72f2('0x4a'))){_0x467c62['limit']=qs['limit'](_0x567ab8['query']['limit']);_0x467c62[_0x72f2('0x30')]=qs['offset'](_0x567ab8['query'][_0x72f2('0x30')]);}_0x467c62['order']=qs['sort'](_0x567ab8['query'][_0x72f2('0x4b')]);_0x467c62['where']=qs[_0x72f2('0x44')](_['pick'](_0x567ab8[_0x72f2('0x42')],_0xa78f00[_0x72f2('0x44')]),_0x3ee9cf);if(_0x567ab8[_0x72f2('0x42')][_0x72f2('0x4c')]){_0x467c62[_0x72f2('0x4d')]=_['merge'](_0x467c62[_0x72f2('0x4d')],{'$or':_[_0x72f2('0x4e')](_0x3ee9cf,function(_0x3e79bd){if(_0x3e79bd[_0x72f2('0x3f')]!==_0x72f2('0x4f')){var _0x2c9cda={};_0x2c9cda[_0x3e79bd[_0x72f2('0x3a')]]={'$like':'%'+_0x567ab8[_0x72f2('0x42')][_0x72f2('0x4c')]+'%'};return _0x2c9cda;}})});}_0x467c62=_[_0x72f2('0x50')]({},_0x467c62,_0x567ab8[_0x72f2('0x51')]);var _0x21f117={'where':_0x467c62[_0x72f2('0x4d')]};return db[_0x72f2('0x52')][_0x72f2('0x32')](_0x21f117)[_0x72f2('0x22')](function(_0x3cf9a0){_0x400acd[_0x72f2('0x32')]=_0x3cf9a0;if(_0x567ab8[_0x72f2('0x42')][_0x72f2('0x53')]){_0x467c62[_0x72f2('0x54')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x72f2('0x55')](_0x467c62);})['then'](function(_0x265f55){_0x400acd[_0x72f2('0x56')]=_0x265f55;return _0x400acd;})['then'](respondWithFilteredResult(_0x34e59c,_0x467c62))[_0x72f2('0x57')](handleError(_0x34e59c,null));};exports[_0x72f2('0x58')]=function(_0x1c6a94,_0x4b7c35){var _0x280bfb={'raw':!![],'where':{'id':_0x1c6a94[_0x72f2('0x59')]['id']}},_0x14fc59={};_0x14fc59[_0x72f2('0x41')]=_['keys'](db[_0x72f2('0x52')][_0x72f2('0x3d')]);_0x14fc59[_0x72f2('0x42')]=_['keys'](_0x1c6a94[_0x72f2('0x42')]);_0x14fc59['filters']=_[_0x72f2('0x45')](_0x14fc59[_0x72f2('0x41')],_0x14fc59[_0x72f2('0x42')]);_0x280bfb[_0x72f2('0x46')]=_['intersection'](_0x14fc59[_0x72f2('0x41')],qs[_0x72f2('0x47')](_0x1c6a94[_0x72f2('0x42')][_0x72f2('0x47')]));_0x280bfb[_0x72f2('0x46')]=_0x280bfb[_0x72f2('0x46')][_0x72f2('0x48')]?_0x280bfb[_0x72f2('0x46')]:_0x14fc59['model'];if(_0x1c6a94[_0x72f2('0x42')][_0x72f2('0x53')]){_0x280bfb[_0x72f2('0x54')]=[{'all':!![]}];}_0x280bfb=_[_0x72f2('0x50')]({},_0x280bfb,_0x1c6a94[_0x72f2('0x51')]);return db[_0x72f2('0x52')][_0x72f2('0x5a')](_0x280bfb)[_0x72f2('0x22')](handleEntityNotFound(_0x4b7c35,null))['then'](respondWithResult(_0x4b7c35,null))[_0x72f2('0x57')](handleError(_0x4b7c35,null));};exports[_0x72f2('0x5b')]=function(_0x2f7ace,_0x19e80f){return db['WhatsappMessage'][_0x72f2('0x5b')](_0x2f7ace[_0x72f2('0x5c')],{})[_0x72f2('0x22')](respondWithResult(_0x19e80f,0xc9))[_0x72f2('0x57')](handleError(_0x19e80f,null));};exports['update']=function(_0x5b47cf,_0x871715){if(_0x5b47cf[_0x72f2('0x5c')]['id']){delete _0x5b47cf[_0x72f2('0x5c')]['id'];}return db[_0x72f2('0x52')]['find']({'where':{'id':_0x5b47cf[_0x72f2('0x59')]['id']}})[_0x72f2('0x22')](handleEntityNotFound(_0x871715,null))[_0x72f2('0x22')](saveUpdates(_0x5b47cf[_0x72f2('0x5c')],null))[_0x72f2('0x22')](respondWithResult(_0x871715,null))['catch'](handleError(_0x871715,null));};exports['destroy']=function(_0x169f20,_0x2cb0b3){return db['WhatsappMessage'][_0x72f2('0x5a')]({'where':{'id':_0x169f20['params']['id']}})[_0x72f2('0x22')](handleEntityNotFound(_0x2cb0b3,null))[_0x72f2('0x22')](removeEntity(_0x2cb0b3,null))['catch'](handleError(_0x2cb0b3,null));};exports[_0x72f2('0x5d')]=function(_0x388e97,_0x4e245e){return db['WhatsappMessage'][_0x72f2('0x5d')]()[_0x72f2('0x22')](respondWithResult(_0x4e245e,null))[_0x72f2('0x57')](handleError(_0x4e245e,null));};var interaction_log=require('../../config/logger')(_0x72f2('0x5e'));exports[_0x72f2('0x5f')]=function(_0x478581,_0x2262d1,_0x4d2fc3){var _0x24c520={'agent':{},'channel':_0x72f2('0x60')};if(_0x478581[_0x72f2('0x5c')]['id']){delete _0x478581[_0x72f2('0x5c')]['id'];}_0x478581[_0x72f2('0x5c')][_0x72f2('0x61')]=!![];_0x478581[_0x72f2('0x5c')][_0x72f2('0x62')]=moment()[_0x72f2('0x63')](_0x72f2('0x64'));_0x478581[_0x72f2('0x5c')][_0x72f2('0x65')]=_0x478581['body'][_0x72f2('0x65')]||_0x478581[_0x72f2('0x66')]['id'];_0x24c520[_0x72f2('0x67')]['id']=_0x478581[_0x72f2('0x5c')][_0x72f2('0x65')];return db[_0x72f2('0x52')]['find']({'where':{'id':_0x478581[_0x72f2('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2262d1,null))['then'](saveUpdates(_0x478581[_0x72f2('0x5c')],null))['then'](function(_0x1543e8){if(_0x1543e8){_0x24c520['message']=_0x1543e8['get']({'plain':!![]});return db[_0x72f2('0x68')][_0x72f2('0x5a')]({'where':{'id':_0x1543e8[_0x72f2('0x69')]}});}return null;})['then'](handleEntityNotFound(_0x2262d1,null))['then'](function(_0x1e28f8){if(_0x1e28f8){return _0x1e28f8[_0x72f2('0x37')]({'UserId':_0x478581[_0x72f2('0x5c')][_0x72f2('0x65')],'read1stAt':_['isNil'](_0x1e28f8['read1stAt'])?moment()[_0x72f2('0x63')](_0x72f2('0x64')):undefined});}return null;})[_0x72f2('0x22')](function(_0x3014bf){if(_0x3014bf){_0x24c520[_0x72f2('0x6a')]=_0x3014bf[_0x72f2('0x6b')]({'plain':!![]});interaction_log[_0x72f2('0x23')](_0x72f2('0x6c'),_0x478581[_0x72f2('0x66')]['id'],_0x478581[_0x72f2('0x66')][_0x72f2('0x3a')],_0x478581[_0x72f2('0x66')][_0x72f2('0x6d')],_0x24c520[_0x72f2('0x6a')]['id'],_0x478581[_0x72f2('0x5c')]?JSON[_0x72f2('0x28')](_0x478581[_0x72f2('0x5c')]):_0x72f2('0x6e'));return respondWithRpcPromise(_0x72f2('0x6f'),_0x72f2('0x70'),_0x24c520);}return null;})[_0x72f2('0x22')](function(_0x2cea26){var _0x4aba22='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2cea26[_0x72f2('0x2b')][_0x72f2('0x71')];return db['sequelize']['query'](_0x4aba22,{'type':db[_0x72f2('0x72')][_0x72f2('0x73')][_0x72f2('0x74')],'raw':!![]})[_0x72f2('0x22')](function(_0x233ece){return _0x233ece;});})[_0x72f2('0x22')](function(_0x262bad){if(_0x262bad){_0x24c520[_0x72f2('0x2b')][_0x72f2('0x75')]=_0x262bad[0x0];if(!_0x478581[_0x72f2('0x5c')][_0x72f2('0x65')])return;return db[_0x72f2('0x76')][_0x72f2('0x5a')]({'where':{'id':_0x478581[_0x72f2('0x5c')][_0x72f2('0x65')],'role':_0x72f2('0x67')},'attributes':['id',_0x72f2('0x3a'),_0x72f2('0x77'),_0x72f2('0x78'),_0x72f2('0x79')],'raw':!![]});}return null;})[_0x72f2('0x22')](function(_0x250fd2){if(!_0x250fd2)return null;_0x24c520[_0x72f2('0x2b')]['agent']=_0x250fd2;return _0x24c520;})['then'](function(_0x5d4d14){if(_0x5d4d14){if(_0x478581[_0x72f2('0x5c')][_0x72f2('0x7a')]){_0x24c520[_0x72f2('0x2b')]['interface']=util[_0x72f2('0x63')]('SIP/%s',_0x478581[_0x72f2('0x66')][_0x72f2('0x3a')]);_0x24c520[_0x72f2('0x2b')]['channel']=_0x24c520[_0x72f2('0x7b')];_0x24c520['message']['motionChannel']=_0x24c520[_0x72f2('0x7b')];_0x24c520['message']['event']=_0x72f2('0x5f');return respondWithRpcPromise(_0x72f2('0x7c'),'EventManager',{'event':'acceptmessage','message':_0x24c520[_0x72f2('0x2b')]},client9002)[_0x72f2('0x22')](function(){return _0x24c520;});}return _0x24c520;}return null;})[_0x72f2('0x22')](respondWithResult(_0x2262d1,null))['catch'](handleError(_0x2262d1,null));};var interaction_log=require(_0x72f2('0x7d'))(_0x72f2('0x5e'));exports[_0x72f2('0x36')]=function(_0xaaae91,_0x43c82b,_0x304f2d){var _0x202c8a={'agent':{},'channel':_0x72f2('0x60')};if(_0xaaae91['body']['id']){delete _0xaaae91['body']['id'];}_0xaaae91[_0x72f2('0x5c')]['UserId']=_0xaaae91[_0x72f2('0x5c')][_0x72f2('0x65')]||_0xaaae91['user']['id'];_0x202c8a[_0x72f2('0x67')]['id']=_0xaaae91['body'][_0x72f2('0x65')];return db[_0x72f2('0x52')][_0x72f2('0x5a')]({'where':{'id':_0xaaae91[_0x72f2('0x59')]['id'],'UserId':null}})[_0x72f2('0x22')](handleEntityNotFound(_0x43c82b,null))[_0x72f2('0x22')](function(_0x348df1){if(_0x348df1){_0x202c8a[_0x72f2('0x2b')]=_0x348df1[_0x72f2('0x6b')]({'plain':!![]});return db['WhatsappInteraction'][_0x72f2('0x5a')]({'where':{'id':_0x348df1['WhatsappInteractionId']}});}return null;})[_0x72f2('0x22')](handleEntityNotFound(_0x43c82b,null))[_0x72f2('0x22')](function(_0x542e3a){if(_0x542e3a){_0x202c8a['interaction']=_0x542e3a['get']({'plain':!![]});interaction_log[_0x72f2('0x23')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xaaae91[_0x72f2('0x66')]['id'],_0xaaae91[_0x72f2('0x66')][_0x72f2('0x3a')],_0xaaae91['user'][_0x72f2('0x6d')],_0x202c8a[_0x72f2('0x6a')]['id'],_0xaaae91[_0x72f2('0x5c')]?JSON['stringify'](_0xaaae91[_0x72f2('0x5c')]):_0x72f2('0x6e'));return respondWithRpcPromise(_0x72f2('0x7e'),'rejectMessage',_0x202c8a);}return null;})[_0x72f2('0x22')](function(_0x4977f8){var _0x260830=_0x72f2('0x7f')+_0x4977f8['message'][_0x72f2('0x71')];return db['sequelize'][_0x72f2('0x42')](_0x260830,{'type':db[_0x72f2('0x72')][_0x72f2('0x73')][_0x72f2('0x74')],'raw':!![]})['then'](function(_0x45bedc){return _0x45bedc;});})['then'](function(_0x3833f0){if(_0x3833f0){_0x202c8a[_0x72f2('0x2b')]['contact']=_0x3833f0[0x0];if(!_0xaaae91['body'][_0x72f2('0x65')])return;return db[_0x72f2('0x76')][_0x72f2('0x5a')]({'where':{'id':_0xaaae91[_0x72f2('0x5c')]['UserId'],'role':'agent'},'attributes':['id',_0x72f2('0x3a'),'fullname',_0x72f2('0x78'),_0x72f2('0x79')],'raw':!![]});}return null;})[_0x72f2('0x22')](function(_0x1f800a){if(!_0x1f800a)return null;_0x202c8a[_0x72f2('0x2b')]['agent']=_0x1f800a;return _0x202c8a;})[_0x72f2('0x22')](function(_0x132a47){if(_0x132a47){_0x132a47[_0x72f2('0x2b')][_0x72f2('0x80')]=util[_0x72f2('0x63')](_0x72f2('0x81'),_0xaaae91[_0x72f2('0x66')][_0x72f2('0x3a')]);_0x132a47[_0x72f2('0x2b')][_0x72f2('0x7b')]=_0x202c8a[_0x72f2('0x7b')];_0x132a47[_0x72f2('0x2b')][_0x72f2('0x82')]=_0x202c8a[_0x72f2('0x7b')];_0x132a47[_0x72f2('0x2b')][_0x72f2('0x83')]=_0x72f2('0x36');respondWithRpcPromise(_0x72f2('0x7c'),'EventManager',{'event':'rejectmessage','message':_0x132a47['message']},client9002);return _0x202c8a;}return null;})[_0x72f2('0x22')](respondWithResult(_0x43c82b,null))[_0x72f2('0x57')](handleError(_0x43c82b,null));};exports[_0x72f2('0x2d')]=function(_0x3f5c7b,_0x23c0b9,_0x18277a){if(_0x3f5c7b[_0x72f2('0x5c')]['id']){delete _0x3f5c7b[_0x72f2('0x5c')]['id'];}var _0x276d50;return db[_0x72f2('0x52')][_0x72f2('0x5a')]({'where':{'id':_0x3f5c7b[_0x72f2('0x59')]['id']}})[_0x72f2('0x22')](handleEntityNotFound(_0x23c0b9,null))[_0x72f2('0x22')](function(_0x1f12c3){if(_0x1f12c3){_0x276d50=_0x1f12c3;return db[_0x72f2('0x84')][_0x72f2('0x5a')]({'where':{'id':_0x1f12c3[_0x72f2('0x85')]}});}})[_0x72f2('0x22')](handleEntityNotFound(_0x23c0b9,null))[_0x72f2('0x22')](function(_0x1e6cb2){if(_0x1e6cb2){logger['debug'](_0x72f2('0x86'),_0x72f2('0x2d'),'received\x20delivery\x20report\x20from',_0x1e6cb2[_0x72f2('0x3f')],util[_0x72f2('0x87')](_0x3f5c7b['body'],{'showHidden':![],'depth':null}));switch(_0x1e6cb2[_0x72f2('0x3f')]){case'twilio':if(_0x3f5c7b[_0x72f2('0x5c')]['MessageSid']&&_0x3f5c7b['body']['MessageSid']===_0x276d50[_0x72f2('0x88')]&&_0x3f5c7b[_0x72f2('0x5c')][_0x72f2('0x89')]&&_0x3f5c7b[_0x72f2('0x5c')][_0x72f2('0x89')]==='read'){return _0x276d50[_0x72f2('0x37')]({'read':!![]});}else{logger[_0x72f2('0x29')]('WhatsappAccount,\x20%s,\x20%s,\x20%s','status',_0x72f2('0x8a'),util['inspect'](_0x3f5c7b[_0x72f2('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x276d50;}})[_0x72f2('0x22')](respondWithResult(_0x23c0b9,null))[_0x72f2('0x57')](handleError(_0x23c0b9,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 5f40405..564321d 100644 --- a/server/api/whatsappMessage/whatsappMessage.events.js +++ b/server/api/whatsappMessage/whatsappMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7894=['WhatsappMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x5e3b04,_0xbb6795){var _0x1fc44d=function(_0x3472a1){while(--_0x3472a1){_0x5e3b04['push'](_0x5e3b04['shift']());}};_0x1fc44d(++_0xbb6795);}(_0x7894,0x170));var _0x4789=function(_0x3f0473,_0x3d11d3){_0x3f0473=_0x3f0473-0x0;var _0x5f1c0c=_0x7894[_0x3f0473];return _0x5f1c0c;};'use strict';var EventEmitter=require(_0x4789('0x0'));var WhatsappMessage=require(_0x4789('0x1'))['db'][_0x4789('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x4789('0x3')](0x0);var events={'afterCreate':_0x4789('0x4'),'afterUpdate':_0x4789('0x5'),'afterDestroy':'remove'};function emitEvent(_0xd4bd76){return function(_0x2b2dd3,_0x4e2393,_0x3394f6){WhatsappMessageEvents[_0x4789('0x6')](_0xd4bd76+':'+_0x2b2dd3['id'],_0x2b2dd3);WhatsappMessageEvents[_0x4789('0x6')](_0xd4bd76,_0x2b2dd3);_0x3394f6(null);};}for(var e in events){if(events[_0x4789('0x7')](e)){var event=events[e];WhatsappMessage[_0x4789('0x8')](e,emitEvent(event));}}module[_0x4789('0x9')]=WhatsappMessageEvents; \ No newline at end of file +var _0x594d=['setMaxListeners','save','update','emit','hook','exports','events'];(function(_0x5d6a4a,_0x4bf184){var _0x518403=function(_0x4ee4ca){while(--_0x4ee4ca){_0x5d6a4a['push'](_0x5d6a4a['shift']());}};_0x518403(++_0x4bf184);}(_0x594d,0x92));var _0xd594=function(_0x1ede1e,_0x5dc75e){_0x1ede1e=_0x1ede1e-0x0;var _0x31ad53=_0x594d[_0x1ede1e];return _0x31ad53;};'use strict';var EventEmitter=require(_0xd594('0x0'));var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xd594('0x1')](0x0);var events={'afterCreate':_0xd594('0x2'),'afterUpdate':_0xd594('0x3'),'afterDestroy':'remove'};function emitEvent(_0x10f523){return function(_0x40d8fa,_0x10155d,_0x7f4ec6){WhatsappMessageEvents['emit'](_0x10f523+':'+_0x40d8fa['id'],_0x40d8fa);WhatsappMessageEvents[_0xd594('0x4')](_0x10f523,_0x40d8fa);_0x7f4ec6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage[_0xd594('0x5')](e,emitEvent(event));}}module[_0xd594('0x6')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index b1432f9..9eac594 100644 --- a/server/api/whatsappMessage/whatsappMessage.model.js +++ b/server/api/whatsappMessage/whatsappMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe6c5=['/messages/','POST','Bearer\x20','application/json','statuses','message_id','catch','err','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','node-fetch','path','rimraf','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','FULLTEXT','models','direction','toLowerCase','secret','isNil','UserId','then','update','createdAt','WhatsappAccount','WhatsappAccountId','twilio','accountSid','phone','authToken','messages','body','whatsapp:','remote','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','baseUrl'];(function(_0x7cb173,_0x93d6e8){var _0x5b101f=function(_0x1ebaa2){while(--_0x1ebaa2){_0x7cb173['push'](_0x7cb173['shift']());}};_0x5b101f(++_0x93d6e8);}(_0xe6c5,0x1e8));var _0x5e6c=function(_0x4f4043,_0x534178){_0x4f4043=_0x4f4043-0x0;var _0x14bedd=_0xe6c5[_0x4f4043];return _0x14bedd;};'use strict';var _=require(_0x5e6c('0x0'));var util=require(_0x5e6c('0x1'));var logger=require(_0x5e6c('0x2'))('api');var moment=require(_0x5e6c('0x3'));var BPromise=require(_0x5e6c('0x4'));var rp=require(_0x5e6c('0x5'));var fetch=require(_0x5e6c('0x6'));var fs=require('fs');var path=require(_0x5e6c('0x7'));var rimraf=require(_0x5e6c('0x8'));var config=require('../../config/environment');var attributes=require(_0x5e6c('0x9'));module[_0x5e6c('0xa')]=function(_0x27fa7b,_0x50af96){return _0x27fa7b[_0x5e6c('0xb')](_0x5e6c('0xc'),attributes,{'tableName':_0x5e6c('0xd'),'paranoid':![],'indexes':[{'name':_0x5e6c('0xe'),'fields':[_0x5e6c('0xe')]},{'name':'fti_whatsapp_messages','fields':['body'],'type':_0x5e6c('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x310f09,_0x5c917c,_0x3bc405){var _0x230108=_0x27fa7b[_0x5e6c('0x10')];var _0x2a5d8a=_0x310f09['get']({'plain':!![]});if(_0x2a5d8a[_0x5e6c('0x11')][_0x5e6c('0x12')]()==='in'||_0x2a5d8a[_0x5e6c('0x11')]['toLowerCase']()==='out'&&!_0x2a5d8a[_0x5e6c('0x13')]&&!_[_0x5e6c('0x14')](_0x2a5d8a[_0x5e6c('0x15')])){_0x230108['WhatsappInteraction']['findOne']({'where':{'id':_0x2a5d8a['WhatsappInteractionId']}})[_0x5e6c('0x16')](function(_0x4ca45a){if(_0x4ca45a){_0x4ca45a[_0x5e6c('0x17')]({'lastMsgAt':_0x2a5d8a[_0x5e6c('0x18')],'lastMsgDirection':_0x2a5d8a[_0x5e6c('0x11')][_0x5e6c('0x12')]()});}})['catch'](function(_0x51229d){console['error'](_0x51229d);});}if(_0x2a5d8a[_0x5e6c('0x11')]==='out'&&!_0x2a5d8a[_0x5e6c('0x13')]){var _0xa94005;_0x230108[_0x5e6c('0x19')]['find']({'where':{'id':_0x2a5d8a[_0x5e6c('0x1a')]},'raw':!![]})[_0x5e6c('0x16')](function(_0x145b96){_0xa94005=_0x145b96;if(_0xa94005&&_0xa94005['type']){switch(_0xa94005['type']){case _0x5e6c('0x1b'):var _0x313c7d=require(_0x5e6c('0x1b'));if(_0xa94005[_0x5e6c('0x1c')]&&_0xa94005['authToken']&&_0xa94005[_0x5e6c('0x1d')]){var _0xf4b8e0=new _0x313c7d(_0xa94005[_0x5e6c('0x1c')],_0xa94005[_0x5e6c('0x1e')]);_0xf4b8e0[_0x5e6c('0x1f')]['create']({'body':_0x2a5d8a[_0x5e6c('0x20')],'to':'whatsapp:'+_0x2a5d8a[_0x5e6c('0x1d')],'from':_0x5e6c('0x21')+_0xa94005['phone'],'statusCallback':_0xa94005[_0x5e6c('0x22')]+'/api/whatsapp/messages/'+_0x2a5d8a['id']+_0x5e6c('0x23')+_0xa94005[_0x5e6c('0x24')]})[_0x5e6c('0x16')](function(_0x48762e){if(_0x48762e[_0x5e6c('0x25')]){return _0x310f09['update']({'messageId':_0x48762e['sid']});}})['catch'](function(_0x5429ca){logger['error'](_0x5e6c('0x26'),_0x5e6c('0x27'),_0x5e6c('0x1b'),util[_0x5e6c('0x28')](_0x5429ca,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x5e6c('0x26'),_0x5e6c('0x27'),_0x5e6c('0x1b'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case'sinch':var _0x8b5df=_0xa94005[_0x5e6c('0x1c')];var _0x350a93=_0xa94005[_0x5e6c('0x1e')];var _0x8ffe79=_0xa94005[_0x5e6c('0x29')]+'/whatsapp/v1/'+_0x8b5df+_0x5e6c('0x2a');var _0x4a8318={'to':[_0x2a5d8a[_0x5e6c('0x1d')]],'message':{'type':'text','text':_0x2a5d8a['body']}};var _0x198772={'method':_0x5e6c('0x2b'),'uri':_0x8ffe79,'headers':{'Authorization':_0x5e6c('0x2c')+_0x350a93,'Content-Type':_0x5e6c('0x2d')},'body':_0x4a8318,'json':!![]};rp(_0x198772)[_0x5e6c('0x16')](function(_0x35518d){if(_0x35518d[_0x5e6c('0x2e')][0x0][_0x5e6c('0x2f')]){return _0x310f09['update']({'messageId':_0x35518d['statuses'][0x0][_0x5e6c('0x2f')]});}})[_0x5e6c('0x30')](function(_0x4d2ce4){logger[_0x5e6c('0x31')]('WhatsappMessage,\x20%s',_0x4d2ce4);});break;}}})[_0x5e6c('0x32')](function(){_0x3bc405();});}else{_0x3bc405();}}},'charset':_0x5e6c('0x33'),'collate':_0x5e6c('0x34')});}; \ No newline at end of file +var _0xb88f=['models','toLowerCase','direction','out','secret','isNil','UserId','findOne','WhatsappInteractionId','then','catch','error','WhatsappAccount','twilio','accountSid','authToken','phone','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','sid','afterCreate','inspect','WhatsappMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','Bearer\x20','application/json','statuses','message_id','update','WhatsappMessage,\x20%s','utf8mb4','util','api','bluebird','request-promise','node-fetch','path','rimraf','./whatsappMessage.attributes','exports','define','whatsapp_messages','fti_whatsapp_messages','body','FULLTEXT'];(function(_0x5df59f,_0xf11a72){var _0x190e3b=function(_0x2b983e){while(--_0x2b983e){_0x5df59f['push'](_0x5df59f['shift']());}};_0x190e3b(++_0xf11a72);}(_0xb88f,0x124));var _0xfb88=function(_0x1d39f6,_0x146f4a){_0x1d39f6=_0x1d39f6-0x0;var _0x3dbd7a=_0xb88f[_0x1d39f6];return _0x3dbd7a;};'use strict';var _=require('lodash');var util=require(_0xfb88('0x0'));var logger=require('../../config/logger')(_0xfb88('0x1'));var moment=require('moment');var BPromise=require(_0xfb88('0x2'));var rp=require(_0xfb88('0x3'));var fetch=require(_0xfb88('0x4'));var fs=require('fs');var path=require(_0xfb88('0x5'));var rimraf=require(_0xfb88('0x6'));var config=require('../../config/environment');var attributes=require(_0xfb88('0x7'));module[_0xfb88('0x8')]=function(_0x11ba28,_0x50ac61){return _0x11ba28[_0xfb88('0x9')]('WhatsappMessage',attributes,{'tableName':_0xfb88('0xa'),'paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0xfb88('0xb'),'fields':[_0xfb88('0xc')],'type':_0xfb88('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5a4215,_0x5b115d,_0x33a846){var _0x2a84f7=_0x11ba28[_0xfb88('0xe')];var _0x5b1960=_0x5a4215['get']({'plain':!![]});if(_0x5b1960['direction'][_0xfb88('0xf')]()==='in'||_0x5b1960[_0xfb88('0x10')][_0xfb88('0xf')]()===_0xfb88('0x11')&&!_0x5b1960[_0xfb88('0x12')]&&!_[_0xfb88('0x13')](_0x5b1960[_0xfb88('0x14')])){_0x2a84f7['WhatsappInteraction'][_0xfb88('0x15')]({'where':{'id':_0x5b1960[_0xfb88('0x16')]}})[_0xfb88('0x17')](function(_0x1afae6){if(_0x1afae6){_0x1afae6['update']({'lastMsgAt':_0x5b1960['createdAt'],'lastMsgDirection':_0x5b1960[_0xfb88('0x10')]['toLowerCase']()});}})[_0xfb88('0x18')](function(_0x1088e4){console[_0xfb88('0x19')](_0x1088e4);});}if(_0x5b1960[_0xfb88('0x10')]==='out'&&!_0x5b1960[_0xfb88('0x12')]){var _0x33c14e;_0x2a84f7[_0xfb88('0x1a')]['find']({'where':{'id':_0x5b1960['WhatsappAccountId']},'raw':!![]})[_0xfb88('0x17')](function(_0x1dfa9a){_0x33c14e=_0x1dfa9a;if(_0x33c14e&&_0x33c14e['type']){switch(_0x33c14e['type']){case _0xfb88('0x1b'):var _0x4d2166=require('twilio');if(_0x33c14e[_0xfb88('0x1c')]&&_0x33c14e[_0xfb88('0x1d')]&&_0x33c14e[_0xfb88('0x1e')]){var _0x43a631=new _0x4d2166(_0x33c14e[_0xfb88('0x1c')],_0x33c14e[_0xfb88('0x1d')]);_0x43a631['messages'][_0xfb88('0x1f')]({'body':_0x5b1960[_0xfb88('0xc')],'to':_0xfb88('0x20')+_0x5b1960['phone'],'from':'whatsapp:'+_0x33c14e['phone'],'statusCallback':_0x33c14e[_0xfb88('0x21')]+_0xfb88('0x22')+_0x5b1960['id']+_0xfb88('0x23')+_0x33c14e['token']})[_0xfb88('0x17')](function(_0x5cf139){if(_0x5cf139[_0xfb88('0x24')]){return _0x5a4215['update']({'messageId':_0x5cf139[_0xfb88('0x24')]});}})[_0xfb88('0x18')](function(_0x26f8fc){logger[_0xfb88('0x19')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xfb88('0x25'),_0xfb88('0x1b'),util[_0xfb88('0x26')](_0x26f8fc,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xfb88('0x27'),_0xfb88('0x25'),_0xfb88('0x1b'),_0xfb88('0x28'));}break;case _0xfb88('0x29'):var _0x4e349e=_0x33c14e['accountSid'];var _0x5c3ec1=_0x33c14e['authToken'];var _0x2f9074=_0x33c14e[_0xfb88('0x2a')]+_0xfb88('0x2b')+_0x4e349e+'/messages/';var _0x4a416d={'to':[_0x5b1960[_0xfb88('0x1e')]],'message':{'type':'text','text':_0x5b1960['body']}};var _0x523961={'method':'POST','uri':_0x2f9074,'headers':{'Authorization':_0xfb88('0x2c')+_0x5c3ec1,'Content-Type':_0xfb88('0x2d')},'body':_0x4a416d,'json':!![]};rp(_0x523961)[_0xfb88('0x17')](function(_0x32eecc){if(_0x32eecc[_0xfb88('0x2e')][0x0][_0xfb88('0x2f')]){return _0x5a4215[_0xfb88('0x30')]({'messageId':_0x32eecc[_0xfb88('0x2e')][0x0][_0xfb88('0x2f')]});}})[_0xfb88('0x18')](function(_0x35acad){logger['err'](_0xfb88('0x31'),_0x35acad);});break;}}})['finally'](function(){_0x33a846();});}else{_0x33a846();}}},'charset':_0xfb88('0x32'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index afb79ac..39daeb2 100644 --- a/server/api/whatsappMessage/whatsappMessage.rpc.js +++ b/server/api/whatsappMessage/whatsappMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb45c=['client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','create','options','debug','CreateWhatsappMessage','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x1728fb,_0x49f68a){var _0x3a7427=function(_0x280f85){while(--_0x280f85){_0x1728fb['push'](_0x1728fb['shift']());}};_0x3a7427(++_0x49f68a);}(_0xb45c,0xee));var _0xcb45=function(_0x5384d2,_0x37278b){_0x5384d2=_0x5384d2-0x0;var _0x5c02d1=_0xb45c[_0x5384d2];return _0x5c02d1;};'use strict';var _=require(_0xcb45('0x0'));var util=require(_0xcb45('0x1'));var moment=require(_0xcb45('0x2'));var BPromise=require('bluebird');var rs=require(_0xcb45('0x3'));var fs=require('fs');var Redis=require(_0xcb45('0x4'));var db=require(_0xcb45('0x5'))['db'];var utils=require(_0xcb45('0x6'));var logger=require('../../config/logger')(_0xcb45('0x7'));var config=require(_0xcb45('0x8'));var jayson=require(_0xcb45('0x9'));var client=jayson[_0xcb45('0xa')][_0xcb45('0xb')]({'port':0x232a});config['redis']=_[_0xcb45('0xc')](config[_0xcb45('0xd')],{'host':_0xcb45('0xe'),'port':0x18eb});var socket=require(_0xcb45('0xf'))(new Redis(config[_0xcb45('0xd')]));require('./whatsappMessage.socket')[_0xcb45('0x10')](socket);function respondWithRpcPromise(_0x3b434,_0x4f8852,_0x3affab){return new BPromise(function(_0x52f828,_0x5d5e19){return client[_0xcb45('0x11')](_0x3b434,_0x3affab)[_0xcb45('0x12')](function(_0x2d4d47){logger[_0xcb45('0x13')](_0xcb45('0x14'),_0x4f8852,_0xcb45('0x15'));logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x4f8852,_0xcb45('0x15'),JSON[_0xcb45('0x16')](_0x2d4d47));if(_0x2d4d47['error']){if(_0x2d4d47['error']['code']===0x1f4){logger[_0xcb45('0x17')](_0xcb45('0x14'),_0x4f8852,_0x2d4d47[_0xcb45('0x17')][_0xcb45('0x18')]);return _0x5d5e19(_0x2d4d47[_0xcb45('0x17')][_0xcb45('0x18')]);}logger[_0xcb45('0x17')](_0xcb45('0x14'),_0x4f8852,_0x2d4d47[_0xcb45('0x17')]['message']);return _0x52f828(_0x2d4d47[_0xcb45('0x17')][_0xcb45('0x18')]);}else{logger[_0xcb45('0x13')](_0xcb45('0x14'),_0x4f8852,_0xcb45('0x15'));_0x52f828(_0x2d4d47[_0xcb45('0x19')][_0xcb45('0x18')]);}})['catch'](function(_0x5dee65){logger['error'](_0xcb45('0x14'),_0x4f8852,_0x5dee65);_0x5d5e19(_0x5dee65);});});}exports['CreateWhatsappMessage']=function(_0x2c4969){var _0x5e7f61=this;return new Promise(function(_0x2f0478,_0x25a6da){return db['WhatsappMessage'][_0xcb45('0x1a')](_0x2c4969['body'],{'raw':_0x2c4969['options']?_0x2c4969[_0xcb45('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xcb45('0x12')](function(_0x4c9567){logger['info']('CreateWhatsappMessage',_0x2c4969);logger[_0xcb45('0x1c')](_0xcb45('0x1d'),_0x2c4969,JSON[_0xcb45('0x16')](_0x4c9567));_0x2f0478(_0x4c9567);})[_0xcb45('0x1e')](function(_0x4e2bf3){logger[_0xcb45('0x17')](_0xcb45('0x1d'),_0x4e2bf3['message'],_0x2c4969);_0x25a6da(_0x5e7f61[_0xcb45('0x17')](0x1f4,_0x4e2bf3[_0xcb45('0x18')]));});});}; \ No newline at end of file +var _0x1ac0=['moment','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','WhatsappMessage','create','body','options','raw','stringify','CreateWhatsappMessage','lodash','util'];(function(_0x1b308d,_0x28dca2){var _0x414df9=function(_0x18c682){while(--_0x18c682){_0x1b308d['push'](_0x1b308d['shift']());}};_0x414df9(++_0x28dca2);}(_0x1ac0,0x17e));var _0x01ac=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x1ac0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x01ac('0x0'));var util=require(_0x01ac('0x1'));var moment=require(_0x01ac('0x2'));var BPromise=require(_0x01ac('0x3'));var rs=require(_0x01ac('0x4'));var fs=require('fs');var Redis=require(_0x01ac('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x01ac('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x01ac('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x01ac('0x8')]=_[_0x01ac('0x9')](config[_0x01ac('0x8')],{'host':_0x01ac('0xa'),'port':0x18eb});var socket=require(_0x01ac('0xb'))(new Redis(config[_0x01ac('0x8')]));require(_0x01ac('0xc'))['register'](socket);function respondWithRpcPromise(_0x2a3e1e,_0x4952c4,_0x5469a4){return new BPromise(function(_0x6cef3b,_0x27f525){return client[_0x01ac('0xd')](_0x2a3e1e,_0x5469a4)[_0x01ac('0xe')](function(_0x22901f){logger[_0x01ac('0xf')](_0x01ac('0x10'),_0x4952c4,_0x01ac('0x11'));logger[_0x01ac('0x12')](_0x01ac('0x13'),_0x4952c4,_0x01ac('0x11'),JSON['stringify'](_0x22901f));if(_0x22901f['error']){if(_0x22901f[_0x01ac('0x14')][_0x01ac('0x15')]===0x1f4){logger[_0x01ac('0x14')](_0x01ac('0x10'),_0x4952c4,_0x22901f[_0x01ac('0x14')][_0x01ac('0x16')]);return _0x27f525(_0x22901f[_0x01ac('0x14')][_0x01ac('0x16')]);}logger['error'](_0x01ac('0x10'),_0x4952c4,_0x22901f['error'][_0x01ac('0x16')]);return _0x6cef3b(_0x22901f['error'][_0x01ac('0x16')]);}else{logger[_0x01ac('0xf')]('WhatsappMessage,\x20%s,\x20%s',_0x4952c4,_0x01ac('0x11'));_0x6cef3b(_0x22901f[_0x01ac('0x17')]['message']);}})[_0x01ac('0x18')](function(_0x295737){logger[_0x01ac('0x14')](_0x01ac('0x10'),_0x4952c4,_0x295737);_0x27f525(_0x295737);});});}exports['CreateWhatsappMessage']=function(_0x4e59d2){var _0x3061d0=this;return new Promise(function(_0x5de9b0,_0x425296){return db[_0x01ac('0x19')][_0x01ac('0x1a')](_0x4e59d2[_0x01ac('0x1b')],{'raw':_0x4e59d2[_0x01ac('0x1c')]?_0x4e59d2['options'][_0x01ac('0x1d')]===undefined?!![]:![]:!![]})[_0x01ac('0xe')](function(_0x55694b){logger[_0x01ac('0xf')]('CreateWhatsappMessage',_0x4e59d2);logger[_0x01ac('0x12')]('CreateWhatsappMessage',_0x4e59d2,JSON[_0x01ac('0x1e')](_0x55694b));_0x5de9b0(_0x55694b);})[_0x01ac('0x18')](function(_0x35aa5a){logger[_0x01ac('0x14')](_0x01ac('0x1f'),_0x35aa5a[_0x01ac('0x16')],_0x4e59d2);_0x425296(_0x3061d0[_0x01ac('0x14')](0x1f4,_0x35aa5a[_0x01ac('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 3d76b77..51af7f7 100644 --- a/server/api/whatsappMessage/whatsappMessage.socket.js +++ b/server/api/whatsappMessage/whatsappMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7931=['update','emit','removeListener','register','whatsappMessage:','remove'];(function(_0x40e218,_0x4231a4){var _0x3d9e5a=function(_0x4e9556){while(--_0x4e9556){_0x40e218['push'](_0x40e218['shift']());}};_0x3d9e5a(++_0x4231a4);}(_0x7931,0x185));var _0x1793=function(_0x5c5405,_0x2068d1){_0x5c5405=_0x5c5405-0x0;var _0x391f29=_0x7931[_0x5c5405];return _0x391f29;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=['save',_0x1793('0x0'),_0x1793('0x1')];function createListener(_0x46aa31,_0x542c1f){return function(_0x1c1303){_0x542c1f[_0x1793('0x2')](_0x46aa31,_0x1c1303);};}function removeListener(_0x1c1951,_0x853ed1){return function(){WhatsappMessageEvents[_0x1793('0x3')](_0x1c1951,_0x853ed1);};}exports[_0x1793('0x4')]=function(_0x2672a7){for(var _0xc94db5=0x0,_0x1092ce=events['length'];_0xc94db5<_0x1092ce;_0xc94db5++){var _0x1f867c=events[_0xc94db5];var _0x352d50=createListener(_0x1793('0x5')+_0x1f867c,_0x2672a7);WhatsappMessageEvents['on'](_0x1f867c,_0x352d50);}}; \ No newline at end of file +var _0x4982=['./whatsappMessage.events','remove','update','emit','removeListener','length','whatsappMessage:'];(function(_0x3a9aec,_0x318f70){var _0x3e7fd6=function(_0x475604){while(--_0x475604){_0x3a9aec['push'](_0x3a9aec['shift']());}};_0x3e7fd6(++_0x318f70);}(_0x4982,0x149));var _0x2498=function(_0xbfba6,_0x344461){_0xbfba6=_0xbfba6-0x0;var _0x3c5291=_0x4982[_0xbfba6];return _0x3c5291;};'use strict';var WhatsappMessageEvents=require(_0x2498('0x0'));var events=['save',_0x2498('0x1'),_0x2498('0x2')];function createListener(_0x431b6d,_0x3b0fd9){return function(_0x5360bc){_0x3b0fd9[_0x2498('0x3')](_0x431b6d,_0x5360bc);};}function removeListener(_0x4df0fe,_0x3cc0d4){return function(){WhatsappMessageEvents[_0x2498('0x4')](_0x4df0fe,_0x3cc0d4);};}exports['register']=function(_0x66c777){for(var _0x21a18e=0x0,_0xc714d0=events[_0x2498('0x5')];_0x21a18e<_0xc714d0;_0x21a18e++){var _0x7a81b=events[_0x21a18e];var _0x5505de=createListener(_0x2498('0x6')+_0x7a81b,_0x66c777);WhatsappMessageEvents['on'](_0x7a81b,_0x5505de);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 4fdb987..db4e665 100644 --- a/server/api/whatsappQueue/index.js +++ b/server/api/whatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfc31=['delete','removeTeams','removeAgents','multer','util','path','express','fs-extra','../../components/interaction/service','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','/:id/teams','/:id/users','getAgents','post','create','addAgents','put','update'];(function(_0x47c989,_0x2f9375){var _0x313538=function(_0x4536ff){while(--_0x4536ff){_0x47c989['push'](_0x47c989['shift']());}};_0x313538(++_0x2f9375);}(_0xfc31,0x121));var _0x1fc3=function(_0x1de813,_0x35bc14){_0x1de813=_0x1de813-0x0;var _0x2e0670=_0xfc31[_0x1de813];return _0x2e0670;};'use strict';var multer=require(_0x1fc3('0x0'));var util=require(_0x1fc3('0x1'));var path=require(_0x1fc3('0x2'));var timeout=require('connect-timeout');var express=require(_0x1fc3('0x3'));var router=express['Router']();var fs_extra=require(_0x1fc3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1fc3('0x5'));var config=require('../../config/environment');var controller=require(_0x1fc3('0x6'));router[_0x1fc3('0x7')]('/',auth[_0x1fc3('0x8')](),controller[_0x1fc3('0x9')]);router[_0x1fc3('0x7')](_0x1fc3('0xa'),auth[_0x1fc3('0x8')](),controller[_0x1fc3('0xb')]);router[_0x1fc3('0x7')](_0x1fc3('0xc'),auth[_0x1fc3('0x8')](),controller[_0x1fc3('0xd')]);router[_0x1fc3('0x7')](_0x1fc3('0xe'),auth[_0x1fc3('0x8')](),controller['getMembers']);router[_0x1fc3('0x7')](_0x1fc3('0xf'),auth[_0x1fc3('0x8')](),controller['getTeams']);router['get'](_0x1fc3('0x10'),auth['isAuthenticated'](),controller[_0x1fc3('0x11')]);router[_0x1fc3('0x12')]('/',auth[_0x1fc3('0x8')](),controller[_0x1fc3('0x13')]);router['post']('/:id/teams',auth['isAuthenticated'](),controller['addTeams']);router[_0x1fc3('0x12')](_0x1fc3('0x10'),auth[_0x1fc3('0x8')](),controller[_0x1fc3('0x14')]);router[_0x1fc3('0x15')]('/:id',auth[_0x1fc3('0x8')](),controller[_0x1fc3('0x16')]);router[_0x1fc3('0x17')]('/:id',auth[_0x1fc3('0x8')](),controller['destroy']);router[_0x1fc3('0x17')](_0x1fc3('0xf'),auth[_0x1fc3('0x8')](),controller[_0x1fc3('0x18')]);router[_0x1fc3('0x17')](_0x1fc3('0x10'),auth[_0x1fc3('0x8')](),controller[_0x1fc3('0x19')]);module['exports']=router; \ No newline at end of file +var _0x511b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put','update','destroy','delete','removeAgents','exports','multer','util','path','../../config/environment','./whatsappQueue.controller','isAuthenticated','index','describe','get','/:id','show'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x511b,0x77));var _0xb511=function(_0x323818,_0x433d1a){_0x323818=_0x323818-0x0;var _0x591b4d=_0x511b[_0x323818];return _0x591b4d;};'use strict';var multer=require(_0xb511('0x0'));var util=require(_0xb511('0x1'));var path=require(_0xb511('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb511('0x3'));var controller=require(_0xb511('0x4'));router['get']('/',auth[_0xb511('0x5')](),controller[_0xb511('0x6')]);router['get']('/describe',auth[_0xb511('0x5')](),controller[_0xb511('0x7')]);router[_0xb511('0x8')](_0xb511('0x9'),auth[_0xb511('0x5')](),controller[_0xb511('0xa')]);router['get'](_0xb511('0xb'),auth[_0xb511('0x5')](),controller[_0xb511('0xc')]);router[_0xb511('0x8')](_0xb511('0xd'),auth[_0xb511('0x5')](),controller[_0xb511('0xe')]);router[_0xb511('0x8')](_0xb511('0xf'),auth['isAuthenticated'](),controller[_0xb511('0x10')]);router[_0xb511('0x11')]('/',auth[_0xb511('0x5')](),controller[_0xb511('0x12')]);router[_0xb511('0x11')](_0xb511('0xd'),auth[_0xb511('0x5')](),controller['addTeams']);router[_0xb511('0x11')](_0xb511('0xf'),auth[_0xb511('0x5')](),controller[_0xb511('0x13')]);router[_0xb511('0x14')](_0xb511('0x9'),auth[_0xb511('0x5')](),controller[_0xb511('0x15')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xb511('0x16')]);router[_0xb511('0x17')](_0xb511('0xd'),auth[_0xb511('0x5')](),controller['removeTeams']);router['delete']('/:id/users',auth[_0xb511('0x5')](),controller[_0xb511('0x18')]);module[_0xb511('0x19')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 5e448a4..d014d28 100644 --- a/server/api/whatsappQueue/whatsappQueue.attributes.js +++ b/server/api/whatsappQueue/whatsappQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc817=['name','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x14a862,_0x2b559d){var _0x245eb5=function(_0x6e014c){while(--_0x6e014c){_0x14a862['push'](_0x14a862['shift']());}};_0x245eb5(++_0x2b559d);}(_0xc817,0x75));var _0x7c81=function(_0x4e6b9c,_0x42d14d){_0x4e6b9c=_0x4e6b9c-0x0;var _0x409757=_0xc817[_0x4e6b9c];return _0x409757;};'use strict';var Sequelize=require(_0x7c81('0x0'));module[_0x7c81('0x1')]={'name':{'type':Sequelize[_0x7c81('0x2')],'unique':_0x7c81('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7c81('0x4')](_0x7c81('0x5'),_0x7c81('0x6'),_0x7c81('0x7'))},'description':{'type':Sequelize[_0x7c81('0x2')]}}; \ No newline at end of file +var _0xc17f=['sequelize','exports','STRING','name','INTEGER','ENUM','beepall','roundrobin'];(function(_0x58fbb0,_0xe497b5){var _0x1783d2=function(_0x5554a8){while(--_0x5554a8){_0x58fbb0['push'](_0x58fbb0['shift']());}};_0x1783d2(++_0xe497b5);}(_0xc17f,0xb8));var _0xfc17=function(_0x4826ba,_0x564a6b){_0x4826ba=_0x4826ba-0x0;var _0x44c28d=_0xc17f[_0x4826ba];return _0x44c28d;};'use strict';var Sequelize=require(_0xfc17('0x0'));module[_0xfc17('0x1')]={'name':{'type':Sequelize[_0xfc17('0x2')],'unique':_0xfc17('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xfc17('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfc17('0x5')]('rrmemory',_0xfc17('0x6'),_0xfc17('0x7'))},'description':{'type':Sequelize[_0xfc17('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 1b7f9bc..48a82b6 100644 --- a/server/api/whatsappQueue/whatsappQueue.controller.js +++ b/server/api/whatsappQueue/whatsappQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3aec=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','UserWhatsappQueue','hasOwnProperty','nolimit','order','sort','pick','WhatsappQueueId','merge','map','filter','findAndCountAll','UserId','agent','whatsappPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','findOne','addTeams','ids','Team','User','online','voicePause','interface','flatMap','Agents','sequelize','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','SELECT','every','TeamId','includes','all','union','compact','value','transaction','isEmpty','removeAgents','addAgents','omit','spread','isArray','userWhatsappQueue:remove','getAgents','bluebird','util','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','status','json','offset','limit','undefined','count','set','update','then','destroy','get','WhatsappQueues','end','sendStatus','stack','name','index','WhatsappQueue','fieldName','type','key','getOptions','where','include','query','findAll','rows','catch','show','params','keys','rawAttributes','filters','model','attributes','intersection','fields','length','includeAll','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','UserProfileResource','error'];(function(_0x18905a,_0x76944c){var _0x5b8ae9=function(_0x4a2020){while(--_0x4a2020){_0x18905a['push'](_0x18905a['shift']());}};_0x5b8ae9(++_0x76944c);}(_0x3aec,0xbe));var _0xc3ae=function(_0x4b7e4d,_0x82d2ab){_0x4b7e4d=_0x4b7e4d-0x0;var _0x38d6af=_0x3aec[_0x4b7e4d];return _0x38d6af;};'use strict';var BPromise=require(_0xc3ae('0x0'));var util=require(_0xc3ae('0x1'));var _=require(_0xc3ae('0x2'));var squel=require('squel');var Redis=require(_0xc3ae('0x3'));var qs=require(_0xc3ae('0x4'));var logger=require(_0xc3ae('0x5'))(_0xc3ae('0x6'));var config=require('../../config/environment');var db=require(_0xc3ae('0x7'))['db'];config['redis']=_[_0xc3ae('0x8')](config[_0xc3ae('0x9')],{'host':_0xc3ae('0xa'),'port':0x18eb});var socket=require(_0xc3ae('0xb'))(new Redis(config[_0xc3ae('0x9')]));require('./whatsappQueue.socket')[_0xc3ae('0xc')](socket);function respondWithStatusCode(_0x444bf9,_0x29c23e){_0x29c23e=_0x29c23e||0xcc;return function(_0x39c632){if(_0x39c632){return _0x444bf9['sendStatus'](_0x29c23e);}return _0x444bf9[_0xc3ae('0xd')](_0x29c23e)['end']();};}function respondWithResult(_0x45e2a8,_0x340435){_0x340435=_0x340435||0xc8;return function(_0x4b4254){if(_0x4b4254){return _0x45e2a8[_0xc3ae('0xd')](_0x340435)[_0xc3ae('0xe')](_0x4b4254);}};}function respondWithFilteredResult(_0xf037e4,_0x4ae54b){return function(_0x4625e6){if(_0x4625e6){var _0x1c105d=typeof _0x4ae54b[_0xc3ae('0xf')]==='undefined'&&typeof _0x4ae54b[_0xc3ae('0x10')]===_0xc3ae('0x11');var _0x254ed5=_0x4625e6[_0xc3ae('0x12')];var _0x40ff32=_0x1c105d?0x0:_0x4ae54b['offset'];var _0x59b1f7=_0x1c105d?_0x4625e6['count']:_0x4ae54b[_0xc3ae('0xf')]+_0x4ae54b[_0xc3ae('0x10')];var _0x437186;if(_0x59b1f7>=_0x254ed5){_0x59b1f7=_0x254ed5;_0x437186=0xc8;}else{_0x437186=0xce;}_0xf037e4['status'](_0x437186);return _0xf037e4[_0xc3ae('0x13')]('Content-Range',_0x40ff32+'-'+_0x59b1f7+'/'+_0x254ed5)[_0xc3ae('0xe')](_0x4625e6);}return null;};}function saveUpdates(_0x579040){return function(_0x15c8db){if(_0x15c8db){return _0x15c8db[_0xc3ae('0x14')](_0x579040)[_0xc3ae('0x15')](function(_0x20cee9){return _0x20cee9;});}return null;};}function removeEntity(_0x10a4f8){return function(_0x5576af){if(_0x5576af){return _0x5576af[_0xc3ae('0x16')]()['then'](function(){var _0x459823=_0x5576af[_0xc3ae('0x17')]({'plain':!![]});var _0xfbc47f=_0xc3ae('0x18');return db['UserProfileResource'][_0xc3ae('0x16')]({'where':{'type':_0xfbc47f,'resourceId':_0x459823['id']}})[_0xc3ae('0x15')](function(){return _0x5576af;});})[_0xc3ae('0x15')](function(){_0x10a4f8[_0xc3ae('0xd')](0xcc)[_0xc3ae('0x19')]();});}};}function handleEntityNotFound(_0x2cc5ac){return function(_0x55d2d4){if(!_0x55d2d4){_0x2cc5ac[_0xc3ae('0x1a')](0x194);}return _0x55d2d4;};}function handleError(_0x4f0ee3,_0x153319){_0x153319=_0x153319||0x1f4;return function(_0x2ee2d2){logger['error'](_0x2ee2d2[_0xc3ae('0x1b')]);if(_0x2ee2d2['name']){delete _0x2ee2d2[_0xc3ae('0x1c')];}_0x4f0ee3[_0xc3ae('0xd')](_0x153319)['send'](_0x2ee2d2);};}exports[_0xc3ae('0x1d')]=function(_0x442c23,_0x4250bf){var _0x4c795d={};var _0x4471cd={'count':0x0,'rows':[]};var _0x59c897=_['map'](db[_0xc3ae('0x1e')]['rawAttributes'],function(_0x43f7d5){return{'name':_0x43f7d5[_0xc3ae('0x1f')],'type':_0x43f7d5[_0xc3ae('0x20')][_0xc3ae('0x21')]};});_0x4c795d=qs[_0xc3ae('0x22')](_0x59c897,_0x442c23);var _0x3b103a={'where':_0x4c795d[_0xc3ae('0x23')]};return db[_0xc3ae('0x1e')][_0xc3ae('0x12')](_0x3b103a)['then'](function(_0x2aa62b){_0x4471cd[_0xc3ae('0x12')]=_0x2aa62b;_0x4c795d[_0xc3ae('0x24')]=qs['include'](_0x442c23[_0xc3ae('0x25')]);return db[_0xc3ae('0x1e')][_0xc3ae('0x26')](_0x4c795d);})[_0xc3ae('0x15')](function(_0xb5954f){_0x4471cd[_0xc3ae('0x27')]=_0xb5954f;return _0x4471cd;})['then'](respondWithFilteredResult(_0x4250bf,_0x4c795d))[_0xc3ae('0x28')](handleError(_0x4250bf,null));};exports[_0xc3ae('0x29')]=function(_0x14eefe,_0x29f810){var _0xc6f3c6={'raw':!![],'where':{'id':_0x14eefe[_0xc3ae('0x2a')]['id']}},_0x8bd34a={};_0x8bd34a['model']=_[_0xc3ae('0x2b')](db[_0xc3ae('0x1e')][_0xc3ae('0x2c')]);_0x8bd34a[_0xc3ae('0x25')]=_[_0xc3ae('0x2b')](_0x14eefe[_0xc3ae('0x25')]);_0x8bd34a[_0xc3ae('0x2d')]=_['intersection'](_0x8bd34a[_0xc3ae('0x2e')],_0x8bd34a[_0xc3ae('0x25')]);_0xc6f3c6[_0xc3ae('0x2f')]=_[_0xc3ae('0x30')](_0x8bd34a[_0xc3ae('0x2e')],qs[_0xc3ae('0x31')](_0x14eefe[_0xc3ae('0x25')][_0xc3ae('0x31')]));_0xc6f3c6[_0xc3ae('0x2f')]=_0xc6f3c6[_0xc3ae('0x2f')][_0xc3ae('0x32')]?_0xc6f3c6[_0xc3ae('0x2f')]:_0x8bd34a[_0xc3ae('0x2e')];if(_0x14eefe[_0xc3ae('0x25')][_0xc3ae('0x33')]){_0xc6f3c6[_0xc3ae('0x24')]=[{'all':!![]}];}_0xc6f3c6=_['merge']({},_0xc6f3c6,_0x14eefe[_0xc3ae('0x34')]);return db[_0xc3ae('0x1e')]['find'](_0xc6f3c6)[_0xc3ae('0x15')](handleEntityNotFound(_0x29f810,null))['then'](respondWithResult(_0x29f810,null))[_0xc3ae('0x28')](handleError(_0x29f810,null));};exports[_0xc3ae('0x35')]=function(_0xd3f8f2,_0x4ce324){return db['WhatsappQueue'][_0xc3ae('0x35')](_0xd3f8f2['body'],{})[_0xc3ae('0x15')](function(_0x506a4f){var _0x59e8e0=_0xd3f8f2[_0xc3ae('0x36')][_0xc3ae('0x17')]({'plain':!![]});if(!_0x59e8e0)throw new Error(_0xc3ae('0x37'));if(_0x59e8e0[_0xc3ae('0x38')]==='user'){var _0x57a9d7=_0x506a4f['get']({'plain':!![]});var _0x18e8dd='WhatsappQueues';return db['UserProfileSection'][_0xc3ae('0x39')]({'where':{'name':_0x18e8dd,'userProfileId':_0x59e8e0['userProfileId']},'raw':!![]})[_0xc3ae('0x15')](function(_0x397d90){if(_0x397d90&&_0x397d90['autoAssociation']===0x0){return db[_0xc3ae('0x3a')][_0xc3ae('0x35')]({'name':_0x57a9d7[_0xc3ae('0x1c')],'resourceId':_0x57a9d7['id'],'type':_0x397d90['name'],'sectionId':_0x397d90['id']},{})[_0xc3ae('0x15')](function(){return _0x506a4f;});}else{return _0x506a4f;}})['catch'](function(_0x537dd0){logger[_0xc3ae('0x3b')](_0xc3ae('0x3c'),_0x537dd0);throw _0x537dd0;});}return _0x506a4f;})[_0xc3ae('0x15')](respondWithResult(_0x4ce324,0xc9))['catch'](handleError(_0x4ce324,null));};exports[_0xc3ae('0x14')]=function(_0x521732,_0xacdbc2){if(_0x521732[_0xc3ae('0x3d')]['id']){delete _0x521732[_0xc3ae('0x3d')]['id'];}return db[_0xc3ae('0x1e')]['find']({'where':{'id':_0x521732[_0xc3ae('0x2a')]['id']}})[_0xc3ae('0x15')](handleEntityNotFound(_0xacdbc2,null))[_0xc3ae('0x15')](saveUpdates(_0x521732[_0xc3ae('0x3d')],null))[_0xc3ae('0x15')](respondWithResult(_0xacdbc2,null))[_0xc3ae('0x28')](handleError(_0xacdbc2,null));};exports[_0xc3ae('0x16')]=function(_0x563347,_0x55092f){return db[_0xc3ae('0x1e')][_0xc3ae('0x39')]({'where':{'id':_0x563347[_0xc3ae('0x2a')]['id']}})['then'](handleEntityNotFound(_0x55092f,null))[_0xc3ae('0x15')](removeEntity(_0x55092f,null))['catch'](handleError(_0x55092f,null));};exports[_0xc3ae('0x3e')]=function(_0xc5fe70,_0x37bb3b){return db['WhatsappQueue'][_0xc3ae('0x3e')]()[_0xc3ae('0x15')](respondWithResult(_0x37bb3b,null))[_0xc3ae('0x28')](handleError(_0x37bb3b,null));};exports[_0xc3ae('0x3f')]=function(_0x1d1009,_0x7dba3f){var _0x1104ff={'raw':!![],'where':{}},_0x158411={},_0x5239d0;return db[_0xc3ae('0x1e')]['findOne']({'where':{'id':_0x1d1009['params']['id']}})[_0xc3ae('0x15')](handleEntityNotFound(_0x7dba3f,null))[_0xc3ae('0x15')](function(_0x3b6798){if(_0x3b6798){_0x5239d0=_0x3b6798[_0xc3ae('0x17')]({'plain':!![]});_0x158411[_0xc3ae('0x2e')]=_[_0xc3ae('0x2b')](db[_0xc3ae('0x40')][_0xc3ae('0x2c')]);_0x158411['query']=_[_0xc3ae('0x2b')](_0x1d1009[_0xc3ae('0x25')]);_0x158411[_0xc3ae('0x2d')]=_['intersection'](_0x158411['model'],_0x158411[_0xc3ae('0x25')]);_0x1104ff[_0xc3ae('0x2f')]=_['intersection'](_0x158411[_0xc3ae('0x2e')],qs['fields'](_0x1d1009[_0xc3ae('0x25')][_0xc3ae('0x31')]));_0x1104ff[_0xc3ae('0x2f')]=_0x1104ff[_0xc3ae('0x2f')]['length']?_0x1104ff[_0xc3ae('0x2f')]:_0x158411[_0xc3ae('0x2e')];if(!_0x1d1009[_0xc3ae('0x25')][_0xc3ae('0x41')](_0xc3ae('0x42'))){_0x1104ff[_0xc3ae('0x10')]=qs[_0xc3ae('0x10')](_0x1d1009[_0xc3ae('0x25')][_0xc3ae('0x10')]);_0x1104ff[_0xc3ae('0xf')]=qs['offset'](_0x1d1009[_0xc3ae('0x25')]['offset']);}_0x1104ff[_0xc3ae('0x43')]=qs[_0xc3ae('0x44')](_0x1d1009[_0xc3ae('0x25')][_0xc3ae('0x44')]);_0x1104ff[_0xc3ae('0x23')]=qs[_0xc3ae('0x2d')](_[_0xc3ae('0x45')](_0x1d1009['query'],_0x158411[_0xc3ae('0x2d')]));_0x1104ff[_0xc3ae('0x23')][_0xc3ae('0x46')]=_0x3b6798['id'];if(_0x1d1009[_0xc3ae('0x25')]['filter']){_0x1104ff['where']=_[_0xc3ae('0x47')](_0x1104ff['where'],{'$or':_[_0xc3ae('0x48')](_0x1104ff[_0xc3ae('0x2f')],function(_0x4cbd4c){var _0x4b9143={};_0x4b9143[_0x4cbd4c]={'$like':'%'+_0x1d1009[_0xc3ae('0x25')][_0xc3ae('0x49')]+'%'};return _0x4b9143;})});}_0x1104ff=_[_0xc3ae('0x47')]({},_0x1104ff,_0x1d1009[_0xc3ae('0x34')]);return db['UserWhatsappQueue'][_0xc3ae('0x26')](_0x1104ff);}})[_0xc3ae('0x15')](function(_0x3bb900){if(_0x3bb900){return db['User'][_0xc3ae('0x4a')]({'where':{'id':_[_0xc3ae('0x48')](_0x3bb900,_0xc3ae('0x4b')),'role':_0xc3ae('0x4c')},'attributes':['id',_0xc3ae('0x1c'),_0xc3ae('0x4d'),'updatedAt',_0xc3ae('0x4e')]});}})[_0xc3ae('0x15')](function(_0x2ed822){if(_0x2ed822){return{'count':_0x2ed822[_0xc3ae('0x12')],'rows':_[_0xc3ae('0x48')](_0x2ed822['rows'],function(_0x49dd28){return{'membername':_0x49dd28[_0xc3ae('0x1c')],'UserId':_0x49dd28['id'],'queue_name':_0x5239d0[_0xc3ae('0x1c')],'WhatsappQueueId':_0x5239d0['id'],'interface':util[_0xc3ae('0x4f')](_0xc3ae('0x50'),_0xc3ae('0x51'),_0x49dd28[_0xc3ae('0x1c')]),'penalty':0x0,'paused':_0x49dd28[_0xc3ae('0x4d')],'createdAt':_0x49dd28['createdAt'],'updatedAt':_0x49dd28[_0xc3ae('0x52')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc3ae('0x15')](respondWithFilteredResult(_0x7dba3f,_0x1104ff))[_0xc3ae('0x28')](handleError(_0x7dba3f,null));};exports[_0xc3ae('0x53')]=function(_0x5eb2a9,_0x5887c7){var _0x132d2c={};var _0x177e49={};var _0x3cbdb8;var _0x49e131;return db[_0xc3ae('0x1e')][_0xc3ae('0x54')]({'where':{'id':_0x5eb2a9['params']['id']}})[_0xc3ae('0x15')](handleEntityNotFound(_0x5887c7,null))[_0xc3ae('0x15')](function(_0x586da2){if(_0x586da2){_0x3cbdb8=_0x586da2;_0x177e49[_0xc3ae('0x2e')]=_[_0xc3ae('0x2b')](db['Team'][_0xc3ae('0x2c')]);_0x177e49[_0xc3ae('0x25')]=_[_0xc3ae('0x2b')](_0x5eb2a9[_0xc3ae('0x25')]);_0x177e49[_0xc3ae('0x2d')]=_[_0xc3ae('0x30')](_0x177e49[_0xc3ae('0x2e')],_0x177e49[_0xc3ae('0x25')]);_0x132d2c[_0xc3ae('0x2f')]=_[_0xc3ae('0x30')](_0x177e49[_0xc3ae('0x2e')],qs['fields'](_0x5eb2a9[_0xc3ae('0x25')][_0xc3ae('0x31')]));_0x132d2c[_0xc3ae('0x2f')]=_0x132d2c['attributes'][_0xc3ae('0x32')]?_0x132d2c[_0xc3ae('0x2f')]:_0x177e49[_0xc3ae('0x2e')];_0x132d2c['order']=qs['sort'](_0x5eb2a9[_0xc3ae('0x25')][_0xc3ae('0x44')]);_0x132d2c[_0xc3ae('0x23')]=qs['filters'](_[_0xc3ae('0x45')](_0x5eb2a9[_0xc3ae('0x25')],_0x177e49[_0xc3ae('0x2d')]));if(_0x5eb2a9[_0xc3ae('0x25')][_0xc3ae('0x49')]){_0x132d2c[_0xc3ae('0x23')]=_['merge'](_0x132d2c[_0xc3ae('0x23')],{'$or':_[_0xc3ae('0x48')](_0x132d2c[_0xc3ae('0x2f')],function(_0x2e3a79){var _0x5be73a={};_0x5be73a[_0x2e3a79]={'$like':'%'+_0x5eb2a9[_0xc3ae('0x25')]['filter']+'%'};return _0x5be73a;})});}_0x132d2c=_[_0xc3ae('0x47')]({},_0x132d2c,_0x5eb2a9[_0xc3ae('0x34')]);return _0x3cbdb8['getTeams'](_0x132d2c);}})[_0xc3ae('0x15')](function(_0x4c8339){if(_0x4c8339){_0x49e131=_0x4c8339[_0xc3ae('0x32')];if(!_0x5eb2a9[_0xc3ae('0x25')][_0xc3ae('0x41')]('nolimit')){_0x132d2c[_0xc3ae('0x10')]=qs['limit'](_0x5eb2a9[_0xc3ae('0x25')]['limit']);_0x132d2c['offset']=qs['offset'](_0x5eb2a9[_0xc3ae('0x25')][_0xc3ae('0xf')]);}return _0x3cbdb8[_0xc3ae('0x53')](_0x132d2c);}})[_0xc3ae('0x15')](function(_0x1945a2){if(_0x1945a2){return _0x1945a2?{'count':_0x49e131,'rows':_0x1945a2}:null;}})[_0xc3ae('0x15')](respondWithResult(_0x5887c7,null))[_0xc3ae('0x28')](handleError(_0x5887c7,null));};exports[_0xc3ae('0x55')]=function(_0x436e28,_0x4f2685){var _0x4663a7=_0x436e28[_0xc3ae('0x3d')][_0xc3ae('0x56')];return db[_0xc3ae('0x57')][_0xc3ae('0x26')]({'where':{'id':_0x4663a7},'attributes':['id'],'include':[{'model':db[_0xc3ae('0x58')],'as':'Agents','attributes':['id','name',_0xc3ae('0x59'),_0xc3ae('0x5a'),_0xc3ae('0x5b')],'raw':!![]}]})[_0xc3ae('0x15')](function(_0x4dbaa5){if(_0x4dbaa5){var _0x11e536=_[_0xc3ae('0x5c')](_0x4dbaa5,function(_0xc0225e){var _0x46ca6e=_0xc0225e[_0xc3ae('0x17')]({'plain':!![]});return _0x46ca6e[_0xc3ae('0x5d')];});return db[_0xc3ae('0x1e')]['find']({'where':{'id':_0x436e28[_0xc3ae('0x2a')]['id']}})[_0xc3ae('0x15')](function(_0x525f66){return db[_0xc3ae('0x5e')]['transaction'](function(_0x4dde9b){return _0x525f66[_0xc3ae('0x55')](_0x4663a7,{'transaction':_0x4dde9b})[_0xc3ae('0x15')](function(){return BPromise[_0xc3ae('0x5f')](_0x11e536,function(_0x2bbd10){return db[_0xc3ae('0x40')][_0xc3ae('0x60')]({'where':{'UserId':_0x2bbd10['id'],'WhatsappQueueId':_0x436e28[_0xc3ae('0x2a')]['id']},'transaction':_0x4dde9b});});})[_0xc3ae('0x15')](function(){_0x11e536[_0xc3ae('0x61')](function(_0x473207){socket[_0xc3ae('0x62')](_0xc3ae('0x63'),{'UserId':_0x473207['id'],'WhatsappQueueId':_0x525f66['id']});});});});});}})['then'](respondWithStatusCode(_0x4f2685,null))['catch'](handleError(_0x4f2685,null));};exports[_0xc3ae('0x64')]=function(_0x5b6bab,_0x9f340d){return db[_0xc3ae('0x57')][_0xc3ae('0x26')]({'where':{'id':_0x5b6bab[_0xc3ae('0x25')][_0xc3ae('0x56')]},'attributes':['id'],'include':[{'model':db[_0xc3ae('0x58')],'as':_0xc3ae('0x5d'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x9f340d,null))[_0xc3ae('0x15')](function(_0x3d0898){var _0x82dd09=_[_0xc3ae('0x48')](_0x3d0898,'id');var _0x18f4ab=[];var _0x1f15e5=[];var _0x140195=squel[_0xc3ae('0x65')]();_0x140195[_0xc3ae('0x66')]('tq.TeamId')[_0xc3ae('0x67')]('team_has_whatsapp_queues','tq')['join'](_0xc3ae('0x68'),'ut',_0xc3ae('0x69'))['where']('WhatsappQueueId\x20=\x20?',_0x5b6bab[_0xc3ae('0x2a')]['id']);for(var _0x37c978=0x0;_0x37c978<_0x3d0898[_0xc3ae('0x32')];_0x37c978+=0x1){let _0x3f2df9=_0x3d0898[_0x37c978];for(var _0x14e12c=0x0;_0x14e12c<_0x3f2df9[_0xc3ae('0x5d')][_0xc3ae('0x32')];_0x14e12c+=0x1){let _0x18fd62=_0x3f2df9['Agents'][_0x14e12c];var _0x3cc970=_0x140195['clone']();_0x3cc970[_0xc3ae('0x23')](_0xc3ae('0x6a'),_0x18fd62['id']);_0x1f15e5[_0xc3ae('0x6b')](db[_0xc3ae('0x5e')][_0xc3ae('0x25')](_0x3cc970['toString'](),{'type':db[_0xc3ae('0x5e')]['QueryTypes'][_0xc3ae('0x6c')]})['then'](function(_0x28d8f8){if(_0x28d8f8['length']===0x1){return _0x18fd62['id'];}else{var _0x2e0bef=_[_0xc3ae('0x6d')](_[_0xc3ae('0x48')](_0x28d8f8,_0xc3ae('0x6e')),function(_0x58d7b3){return _[_0xc3ae('0x6f')](_0x82dd09,_0x58d7b3);});if(_0x2e0bef){return _0x18fd62['id'];}}}));}}return BPromise[_0xc3ae('0x70')](_0x1f15e5)['then'](function(_0x987a30){_0x18f4ab=_(_0x18f4ab)[_0xc3ae('0x71')](_0x987a30)[_0xc3ae('0x72')]()[_0xc3ae('0x73')]();return db['WhatsappQueue'][_0xc3ae('0x39')]({'where':{'id':_0x5b6bab[_0xc3ae('0x2a')]['id']}})[_0xc3ae('0x15')](function(_0x4d8ce7){return db[_0xc3ae('0x5e')][_0xc3ae('0x74')](function(_0x4dd40c){return _0x4d8ce7['removeTeams'](_0x5b6bab[_0xc3ae('0x25')][_0xc3ae('0x56')],{'transaction':_0x4dd40c})[_0xc3ae('0x15')](function(){if(!_[_0xc3ae('0x75')](_0x18f4ab)){return _0x4d8ce7[_0xc3ae('0x76')](_0x18f4ab,{'transaction':_0x4dd40c});}})[_0xc3ae('0x15')](function(){_0x18f4ab['forEach'](function(_0x589eb3){socket[_0xc3ae('0x62')]('userWhatsappQueue:remove',{'UserId':_0x589eb3,'WhatsappQueueId':_0x4d8ce7['id']});});});});});});})[_0xc3ae('0x15')](respondWithStatusCode(_0x9f340d,null))['catch'](handleError(_0x9f340d,null));};exports['addAgents']=function(_0x2cd690,_0x8d8cd9){return db[_0xc3ae('0x1e')][_0xc3ae('0x39')]({'where':{'id':_0x2cd690['params']['id']}})[_0xc3ae('0x15')](handleEntityNotFound(_0x8d8cd9,null))[_0xc3ae('0x15')](function(_0x395da2){if(_0x395da2){return _0x395da2[_0xc3ae('0x77')](_0x2cd690['body'][_0xc3ae('0x56')],_[_0xc3ae('0x78')](_0x2cd690[_0xc3ae('0x3d')],[_0xc3ae('0x56'),'id'])||{})[_0xc3ae('0x79')](function(_0x2a45e9){for(var _0x3756fb=0x0;_0x3756fb<_0x2cd690[_0xc3ae('0x3d')][_0xc3ae('0x56')][_0xc3ae('0x32')];_0x3756fb+=0x1){socket['emit'](_0xc3ae('0x63'),{'UserId':Number(_0x2cd690['body'][_0xc3ae('0x56')][_0x3756fb]),'WhatsappQueueId':Number(_0x2cd690[_0xc3ae('0x2a')]['id'])});}return _0x2a45e9;});}})[_0xc3ae('0x15')](respondWithResult(_0x8d8cd9,null))[_0xc3ae('0x28')](handleError(_0x8d8cd9,null));};exports[_0xc3ae('0x76')]=function(_0x4bdbac,_0x5f4ebe){return db['WhatsappQueue'][_0xc3ae('0x39')]({'where':{'id':_0x4bdbac['params']['id']}})[_0xc3ae('0x15')](handleEntityNotFound(_0x5f4ebe,null))[_0xc3ae('0x15')](function(_0x657373){if(_0x657373){return _0x657373[_0xc3ae('0x76')](_0x4bdbac[_0xc3ae('0x25')][_0xc3ae('0x56')])[_0xc3ae('0x15')](function(){if(_[_0xc3ae('0x7a')](_0x4bdbac['query']['ids'])){for(var _0x51d946=0x0;_0x51d946<_0x4bdbac[_0xc3ae('0x25')][_0xc3ae('0x56')][_0xc3ae('0x32')];_0x51d946+=0x1){socket[_0xc3ae('0x62')]('userWhatsappQueue:remove',{'UserId':Number(_0x4bdbac['query'][_0xc3ae('0x56')][_0x51d946]),'WhatsappQueueId':Number(_0x4bdbac[_0xc3ae('0x2a')]['id'])});}}else{socket['emit'](_0xc3ae('0x7b'),{'UserId':Number(_0x4bdbac[_0xc3ae('0x25')]['ids']),'WhatsappQueueId':Number(_0x4bdbac['params']['id'])});}});}})[_0xc3ae('0x15')](respondWithStatusCode(_0x5f4ebe,null))[_0xc3ae('0x28')](handleError(_0x5f4ebe,null));};exports[_0xc3ae('0x7c')]=function(_0x49da93,_0x44d392){var _0x30f90f={};var _0x5894ef={};var _0x1c017f;var _0x337033;return db[_0xc3ae('0x1e')][_0xc3ae('0x54')]({'where':{'id':_0x49da93[_0xc3ae('0x2a')]['id']}})[_0xc3ae('0x15')](handleEntityNotFound(_0x44d392,null))[_0xc3ae('0x15')](function(_0x2db14c){if(_0x2db14c){_0x1c017f=_0x2db14c;_0x5894ef[_0xc3ae('0x2e')]=_[_0xc3ae('0x2b')](db[_0xc3ae('0x58')][_0xc3ae('0x2c')]);_0x5894ef[_0xc3ae('0x25')]=_[_0xc3ae('0x2b')](_0x49da93[_0xc3ae('0x25')]);_0x5894ef[_0xc3ae('0x2d')]=_[_0xc3ae('0x30')](_0x5894ef[_0xc3ae('0x2e')],_0x5894ef[_0xc3ae('0x25')]);_0x30f90f[_0xc3ae('0x2f')]=_['intersection'](_0x5894ef[_0xc3ae('0x2e')],qs['fields'](_0x49da93[_0xc3ae('0x25')][_0xc3ae('0x31')]));_0x30f90f[_0xc3ae('0x2f')]=_0x30f90f['attributes'][_0xc3ae('0x32')]?_0x30f90f[_0xc3ae('0x2f')]:_0x5894ef[_0xc3ae('0x2e')];_0x30f90f[_0xc3ae('0x43')]=qs[_0xc3ae('0x44')](_0x49da93[_0xc3ae('0x25')][_0xc3ae('0x44')]);_0x30f90f[_0xc3ae('0x23')]=qs[_0xc3ae('0x2d')](_[_0xc3ae('0x45')](_0x49da93[_0xc3ae('0x25')],_0x5894ef[_0xc3ae('0x2d')]));if(_0x49da93['query']['filter']){_0x30f90f[_0xc3ae('0x23')]=_[_0xc3ae('0x47')](_0x30f90f[_0xc3ae('0x23')],{'$or':_[_0xc3ae('0x48')](_0x30f90f['attributes'],function(_0x2e4f53){var _0x574c48={};_0x574c48[_0x2e4f53]={'$like':'%'+_0x49da93['query']['filter']+'%'};return _0x574c48;})});}_0x30f90f=_[_0xc3ae('0x47')]({},_0x30f90f,_0x49da93[_0xc3ae('0x34')]);return _0x1c017f[_0xc3ae('0x7c')](_0x30f90f);}})[_0xc3ae('0x15')](function(_0x4a7101){if(_0x4a7101){_0x337033=_0x4a7101[_0xc3ae('0x32')];if(!_0x49da93[_0xc3ae('0x25')][_0xc3ae('0x41')]('nolimit')){_0x30f90f[_0xc3ae('0x10')]=qs['limit'](_0x49da93[_0xc3ae('0x25')]['limit']);_0x30f90f['offset']=qs[_0xc3ae('0xf')](_0x49da93[_0xc3ae('0x25')][_0xc3ae('0xf')]);}return _0x1c017f[_0xc3ae('0x7c')](_0x30f90f);}})[_0xc3ae('0x15')](function(_0x25dc33){if(_0x25dc33){return _0x25dc33?{'count':_0x337033,'rows':_0x25dc33}:null;}})['then'](respondWithResult(_0x44d392,null))['catch'](handleError(_0x44d392,null));}; \ No newline at end of file +var _0x8973=['spread','userWhatsappQueue:save','getAgents','pick','bluebird','util','../../config/logger','api','../../mysqldb','redis','defaults','localhost','./whatsappQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','UserProfileResource','destroy','error','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','type','getOptions','where','include','findAll','rows','catch','show','params','keys','query','model','attributes','intersection','fields','length','merge','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','WhatsappQueues','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserWhatsappQueue','hasOwnProperty','nolimit','sort','filters','WhatsappQueueId','filter','User','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','Agents','voicePause','flatMap','sequelize','transaction','each','forEach','emit','removeTeams','ids','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','includes','all','union','compact','value','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8973,0x7b));var _0x3897=function(_0x1f2392,_0x10b58d){_0x1f2392=_0x1f2392-0x0;var _0x468535=_0x8973[_0x1f2392];return _0x468535;};'use strict';var BPromise=require(_0x3897('0x0'));var util=require(_0x3897('0x1'));var _=require('lodash');var squel=require('squel');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x3897('0x2'))(_0x3897('0x3'));var config=require('../../config/environment');var db=require(_0x3897('0x4'))['db'];config[_0x3897('0x5')]=_[_0x3897('0x6')](config[_0x3897('0x5')],{'host':_0x3897('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3897('0x8'))[_0x3897('0x9')](socket);function respondWithStatusCode(_0x46e738,_0x55f347){_0x55f347=_0x55f347||0xcc;return function(_0x4c52fc){if(_0x4c52fc){return _0x46e738[_0x3897('0xa')](_0x55f347);}return _0x46e738[_0x3897('0xb')](_0x55f347)[_0x3897('0xc')]();};}function respondWithResult(_0x1674c8,_0x4536fd){_0x4536fd=_0x4536fd||0xc8;return function(_0x5d0685){if(_0x5d0685){return _0x1674c8[_0x3897('0xb')](_0x4536fd)[_0x3897('0xd')](_0x5d0685);}};}function respondWithFilteredResult(_0x4d93cd,_0x162692){return function(_0x2cfb6c){if(_0x2cfb6c){var _0x4b26f6=typeof _0x162692[_0x3897('0xe')]===_0x3897('0xf')&&typeof _0x162692[_0x3897('0x10')]==='undefined';var _0x503349=_0x2cfb6c[_0x3897('0x11')];var _0x2ce1c7=_0x4b26f6?0x0:_0x162692['offset'];var _0x380f99=_0x4b26f6?_0x2cfb6c['count']:_0x162692[_0x3897('0xe')]+_0x162692[_0x3897('0x10')];var _0x1234c5;if(_0x380f99>=_0x503349){_0x380f99=_0x503349;_0x1234c5=0xc8;}else{_0x1234c5=0xce;}_0x4d93cd['status'](_0x1234c5);return _0x4d93cd[_0x3897('0x12')](_0x3897('0x13'),_0x2ce1c7+'-'+_0x380f99+'/'+_0x503349)[_0x3897('0xd')](_0x2cfb6c);}return null;};}function saveUpdates(_0xcab8ce){return function(_0x250ae1){if(_0x250ae1){return _0x250ae1[_0x3897('0x14')](_0xcab8ce)['then'](function(_0x177ebb){return _0x177ebb;});}return null;};}function removeEntity(_0x46e698){return function(_0x42cd51){if(_0x42cd51){return _0x42cd51['destroy']()[_0x3897('0x15')](function(){var _0x56b21a=_0x42cd51['get']({'plain':!![]});var _0x23cf25='WhatsappQueues';return db[_0x3897('0x16')][_0x3897('0x17')]({'where':{'type':_0x23cf25,'resourceId':_0x56b21a['id']}})[_0x3897('0x15')](function(){return _0x42cd51;});})['then'](function(){_0x46e698[_0x3897('0xb')](0xcc)[_0x3897('0xc')]();});}};}function handleEntityNotFound(_0x5a0fe0){return function(_0x5403c9){if(!_0x5403c9){_0x5a0fe0[_0x3897('0xa')](0x194);}return _0x5403c9;};}function handleError(_0x362d03,_0x1b798c){_0x1b798c=_0x1b798c||0x1f4;return function(_0x112ffa){logger[_0x3897('0x18')](_0x112ffa['stack']);if(_0x112ffa[_0x3897('0x19')]){delete _0x112ffa[_0x3897('0x19')];}_0x362d03[_0x3897('0xb')](_0x1b798c)[_0x3897('0x1a')](_0x112ffa);};}exports[_0x3897('0x1b')]=function(_0x40e6d4,_0x5e9112){var _0x493131={};var _0x35914a={'count':0x0,'rows':[]};var _0x4018e6=_[_0x3897('0x1c')](db[_0x3897('0x1d')][_0x3897('0x1e')],function(_0x571357){return{'name':_0x571357[_0x3897('0x1f')],'type':_0x571357[_0x3897('0x20')]['key']};});_0x493131=qs[_0x3897('0x21')](_0x4018e6,_0x40e6d4);var _0x5c9e40={'where':_0x493131[_0x3897('0x22')]};return db['WhatsappQueue'][_0x3897('0x11')](_0x5c9e40)[_0x3897('0x15')](function(_0x521daa){_0x35914a[_0x3897('0x11')]=_0x521daa;_0x493131[_0x3897('0x23')]=qs[_0x3897('0x23')](_0x40e6d4['query']);return db[_0x3897('0x1d')][_0x3897('0x24')](_0x493131);})['then'](function(_0x49de69){_0x35914a[_0x3897('0x25')]=_0x49de69;return _0x35914a;})[_0x3897('0x15')](respondWithFilteredResult(_0x5e9112,_0x493131))[_0x3897('0x26')](handleError(_0x5e9112,null));};exports[_0x3897('0x27')]=function(_0x171997,_0x277135){var _0x320db8={'raw':!![],'where':{'id':_0x171997[_0x3897('0x28')]['id']}},_0x241a73={};_0x241a73['model']=_[_0x3897('0x29')](db[_0x3897('0x1d')][_0x3897('0x1e')]);_0x241a73[_0x3897('0x2a')]=_[_0x3897('0x29')](_0x171997[_0x3897('0x2a')]);_0x241a73['filters']=_['intersection'](_0x241a73[_0x3897('0x2b')],_0x241a73[_0x3897('0x2a')]);_0x320db8[_0x3897('0x2c')]=_[_0x3897('0x2d')](_0x241a73['model'],qs[_0x3897('0x2e')](_0x171997[_0x3897('0x2a')][_0x3897('0x2e')]));_0x320db8['attributes']=_0x320db8['attributes'][_0x3897('0x2f')]?_0x320db8[_0x3897('0x2c')]:_0x241a73['model'];if(_0x171997['query']['includeAll']){_0x320db8['include']=[{'all':!![]}];}_0x320db8=_[_0x3897('0x30')]({},_0x320db8,_0x171997[_0x3897('0x31')]);return db[_0x3897('0x1d')][_0x3897('0x32')](_0x320db8)[_0x3897('0x15')](handleEntityNotFound(_0x277135,null))[_0x3897('0x15')](respondWithResult(_0x277135,null))[_0x3897('0x26')](handleError(_0x277135,null));};exports[_0x3897('0x33')]=function(_0x33e7e6,_0x2d7329){return db['WhatsappQueue'][_0x3897('0x33')](_0x33e7e6[_0x3897('0x34')],{})[_0x3897('0x15')](function(_0x1e8ed2){var _0x4a6fb5=_0x33e7e6['user']['get']({'plain':!![]});if(!_0x4a6fb5)throw new Error(_0x3897('0x35'));if(_0x4a6fb5['role']===_0x3897('0x36')){var _0x339eab=_0x1e8ed2[_0x3897('0x37')]({'plain':!![]});var _0x17c7c9=_0x3897('0x38');return db['UserProfileSection'][_0x3897('0x32')]({'where':{'name':_0x17c7c9,'userProfileId':_0x4a6fb5[_0x3897('0x39')]},'raw':!![]})[_0x3897('0x15')](function(_0x210efe){if(_0x210efe&&_0x210efe[_0x3897('0x3a')]===0x0){return db[_0x3897('0x16')]['create']({'name':_0x339eab[_0x3897('0x19')],'resourceId':_0x339eab['id'],'type':_0x210efe[_0x3897('0x19')],'sectionId':_0x210efe['id']},{})[_0x3897('0x15')](function(){return _0x1e8ed2;});}else{return _0x1e8ed2;}})[_0x3897('0x26')](function(_0x35b59b){logger[_0x3897('0x18')](_0x3897('0x3b'),_0x35b59b);throw _0x35b59b;});}return _0x1e8ed2;})[_0x3897('0x15')](respondWithResult(_0x2d7329,0xc9))['catch'](handleError(_0x2d7329,null));};exports[_0x3897('0x14')]=function(_0x504bf1,_0x583528){if(_0x504bf1[_0x3897('0x34')]['id']){delete _0x504bf1[_0x3897('0x34')]['id'];}return db[_0x3897('0x1d')][_0x3897('0x32')]({'where':{'id':_0x504bf1['params']['id']}})[_0x3897('0x15')](handleEntityNotFound(_0x583528,null))[_0x3897('0x15')](saveUpdates(_0x504bf1[_0x3897('0x34')],null))[_0x3897('0x15')](respondWithResult(_0x583528,null))[_0x3897('0x26')](handleError(_0x583528,null));};exports[_0x3897('0x17')]=function(_0x25dcec,_0x435373){return db[_0x3897('0x1d')][_0x3897('0x32')]({'where':{'id':_0x25dcec['params']['id']}})[_0x3897('0x15')](handleEntityNotFound(_0x435373,null))[_0x3897('0x15')](removeEntity(_0x435373,null))[_0x3897('0x26')](handleError(_0x435373,null));};exports[_0x3897('0x3c')]=function(_0x470e7,_0x241894){return db[_0x3897('0x1d')][_0x3897('0x3c')]()['then'](respondWithResult(_0x241894,null))[_0x3897('0x26')](handleError(_0x241894,null));};exports[_0x3897('0x3d')]=function(_0x5eb9f7,_0xec7631){var _0x27e35a={'raw':!![],'where':{}},_0x2d41fd={},_0x524e6f;return db[_0x3897('0x1d')][_0x3897('0x3e')]({'where':{'id':_0x5eb9f7[_0x3897('0x28')]['id']}})[_0x3897('0x15')](handleEntityNotFound(_0xec7631,null))[_0x3897('0x15')](function(_0x1cd5a2){if(_0x1cd5a2){_0x524e6f=_0x1cd5a2['get']({'plain':!![]});_0x2d41fd['model']=_['keys'](db[_0x3897('0x3f')]['rawAttributes']);_0x2d41fd[_0x3897('0x2a')]=_['keys'](_0x5eb9f7[_0x3897('0x2a')]);_0x2d41fd['filters']=_[_0x3897('0x2d')](_0x2d41fd[_0x3897('0x2b')],_0x2d41fd[_0x3897('0x2a')]);_0x27e35a[_0x3897('0x2c')]=_[_0x3897('0x2d')](_0x2d41fd['model'],qs[_0x3897('0x2e')](_0x5eb9f7[_0x3897('0x2a')]['fields']));_0x27e35a[_0x3897('0x2c')]=_0x27e35a[_0x3897('0x2c')][_0x3897('0x2f')]?_0x27e35a['attributes']:_0x2d41fd['model'];if(!_0x5eb9f7[_0x3897('0x2a')][_0x3897('0x40')](_0x3897('0x41'))){_0x27e35a[_0x3897('0x10')]=qs[_0x3897('0x10')](_0x5eb9f7['query'][_0x3897('0x10')]);_0x27e35a[_0x3897('0xe')]=qs[_0x3897('0xe')](_0x5eb9f7[_0x3897('0x2a')]['offset']);}_0x27e35a['order']=qs[_0x3897('0x42')](_0x5eb9f7[_0x3897('0x2a')][_0x3897('0x42')]);_0x27e35a[_0x3897('0x22')]=qs[_0x3897('0x43')](_['pick'](_0x5eb9f7[_0x3897('0x2a')],_0x2d41fd[_0x3897('0x43')]));_0x27e35a[_0x3897('0x22')][_0x3897('0x44')]=_0x1cd5a2['id'];if(_0x5eb9f7[_0x3897('0x2a')][_0x3897('0x45')]){_0x27e35a['where']=_[_0x3897('0x30')](_0x27e35a[_0x3897('0x22')],{'$or':_['map'](_0x27e35a[_0x3897('0x2c')],function(_0x56cdad){var _0x2dbd64={};_0x2dbd64[_0x56cdad]={'$like':'%'+_0x5eb9f7['query']['filter']+'%'};return _0x2dbd64;})});}_0x27e35a=_[_0x3897('0x30')]({},_0x27e35a,_0x5eb9f7[_0x3897('0x31')]);return db['UserWhatsappQueue'][_0x3897('0x24')](_0x27e35a);}})[_0x3897('0x15')](function(_0x35b02e){if(_0x35b02e){return db[_0x3897('0x46')]['findAndCountAll']({'where':{'id':_[_0x3897('0x1c')](_0x35b02e,'UserId'),'role':_0x3897('0x47')},'attributes':['id','name',_0x3897('0x48'),_0x3897('0x49'),_0x3897('0x4a')]});}})['then'](function(_0x2faef9){if(_0x2faef9){return{'count':_0x2faef9[_0x3897('0x11')],'rows':_[_0x3897('0x1c')](_0x2faef9[_0x3897('0x25')],function(_0x22c126){return{'membername':_0x22c126[_0x3897('0x19')],'UserId':_0x22c126['id'],'queue_name':_0x524e6f[_0x3897('0x19')],'WhatsappQueueId':_0x524e6f['id'],'interface':util[_0x3897('0x4b')](_0x3897('0x4c'),_0x3897('0x4d'),_0x22c126[_0x3897('0x19')]),'penalty':0x0,'paused':_0x22c126[_0x3897('0x48')],'createdAt':_0x22c126['createdAt'],'updatedAt':_0x22c126[_0x3897('0x49')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3897('0x15')](respondWithFilteredResult(_0xec7631,_0x27e35a))[_0x3897('0x26')](handleError(_0xec7631,null));};exports[_0x3897('0x4e')]=function(_0x5341a0,_0x49f443){var _0x332a3f={};var _0x136b5c={};var _0x2ec8fb;var _0x5e233c;return db['WhatsappQueue'][_0x3897('0x3e')]({'where':{'id':_0x5341a0[_0x3897('0x28')]['id']}})[_0x3897('0x15')](handleEntityNotFound(_0x49f443,null))[_0x3897('0x15')](function(_0x507c7f){if(_0x507c7f){_0x2ec8fb=_0x507c7f;_0x136b5c['model']=_['keys'](db[_0x3897('0x4f')][_0x3897('0x1e')]);_0x136b5c[_0x3897('0x2a')]=_['keys'](_0x5341a0[_0x3897('0x2a')]);_0x136b5c['filters']=_['intersection'](_0x136b5c['model'],_0x136b5c[_0x3897('0x2a')]);_0x332a3f[_0x3897('0x2c')]=_[_0x3897('0x2d')](_0x136b5c[_0x3897('0x2b')],qs[_0x3897('0x2e')](_0x5341a0[_0x3897('0x2a')][_0x3897('0x2e')]));_0x332a3f[_0x3897('0x2c')]=_0x332a3f[_0x3897('0x2c')][_0x3897('0x2f')]?_0x332a3f[_0x3897('0x2c')]:_0x136b5c[_0x3897('0x2b')];_0x332a3f['order']=qs[_0x3897('0x42')](_0x5341a0['query'][_0x3897('0x42')]);_0x332a3f[_0x3897('0x22')]=qs['filters'](_['pick'](_0x5341a0[_0x3897('0x2a')],_0x136b5c[_0x3897('0x43')]));if(_0x5341a0[_0x3897('0x2a')][_0x3897('0x45')]){_0x332a3f['where']=_['merge'](_0x332a3f['where'],{'$or':_[_0x3897('0x1c')](_0x332a3f[_0x3897('0x2c')],function(_0x57f3ad){var _0x323e30={};_0x323e30[_0x57f3ad]={'$like':'%'+_0x5341a0[_0x3897('0x2a')][_0x3897('0x45')]+'%'};return _0x323e30;})});}_0x332a3f=_[_0x3897('0x30')]({},_0x332a3f,_0x5341a0[_0x3897('0x31')]);return _0x2ec8fb[_0x3897('0x4e')](_0x332a3f);}})[_0x3897('0x15')](function(_0xe3be1d){if(_0xe3be1d){_0x5e233c=_0xe3be1d[_0x3897('0x2f')];if(!_0x5341a0[_0x3897('0x2a')][_0x3897('0x40')](_0x3897('0x41'))){_0x332a3f[_0x3897('0x10')]=qs['limit'](_0x5341a0[_0x3897('0x2a')][_0x3897('0x10')]);_0x332a3f[_0x3897('0xe')]=qs['offset'](_0x5341a0[_0x3897('0x2a')][_0x3897('0xe')]);}return _0x2ec8fb[_0x3897('0x4e')](_0x332a3f);}})[_0x3897('0x15')](function(_0xf88250){if(_0xf88250){return _0xf88250?{'count':_0x5e233c,'rows':_0xf88250}:null;}})[_0x3897('0x15')](respondWithResult(_0x49f443,null))[_0x3897('0x26')](handleError(_0x49f443,null));};exports[_0x3897('0x50')]=function(_0x4eb841,_0x385063){var _0x311d6f=_0x4eb841['body']['ids'];return db[_0x3897('0x4f')][_0x3897('0x24')]({'where':{'id':_0x311d6f},'attributes':['id'],'include':[{'model':db['User'],'as':_0x3897('0x51'),'attributes':['id','name','online',_0x3897('0x52'),'interface'],'raw':!![]}]})[_0x3897('0x15')](function(_0x33ebff){if(_0x33ebff){var _0x4522bc=_[_0x3897('0x53')](_0x33ebff,function(_0x2e09ab){var _0x53090c=_0x2e09ab[_0x3897('0x37')]({'plain':!![]});return _0x53090c[_0x3897('0x51')];});return db[_0x3897('0x1d')]['find']({'where':{'id':_0x4eb841[_0x3897('0x28')]['id']}})[_0x3897('0x15')](function(_0x1ef7b1){return db[_0x3897('0x54')][_0x3897('0x55')](function(_0x24ae7c){return _0x1ef7b1[_0x3897('0x50')](_0x311d6f,{'transaction':_0x24ae7c})[_0x3897('0x15')](function(){return BPromise[_0x3897('0x56')](_0x4522bc,function(_0xe1364f){return db[_0x3897('0x3f')]['findOrCreate']({'where':{'UserId':_0xe1364f['id'],'WhatsappQueueId':_0x4eb841['params']['id']},'transaction':_0x24ae7c});});})[_0x3897('0x15')](function(){_0x4522bc[_0x3897('0x57')](function(_0x167d96){socket[_0x3897('0x58')]('userWhatsappQueue:save',{'UserId':_0x167d96['id'],'WhatsappQueueId':_0x1ef7b1['id']});});});});});}})[_0x3897('0x15')](respondWithStatusCode(_0x385063,null))['catch'](handleError(_0x385063,null));};exports[_0x3897('0x59')]=function(_0x5a3090,_0x59a504){return db['Team'][_0x3897('0x24')]({'where':{'id':_0x5a3090[_0x3897('0x2a')][_0x3897('0x5a')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x3897('0x51'),'attributes':['id'],'raw':!![]}]})[_0x3897('0x15')](handleEntityNotFound(_0x59a504,null))[_0x3897('0x15')](function(_0x10e977){var _0x1e61f3=_[_0x3897('0x1c')](_0x10e977,'id');var _0x5c5be0=[];var _0x4feb24=[];var _0x1defe0=squel[_0x3897('0x5b')]();_0x1defe0[_0x3897('0x5c')](_0x3897('0x5d'))[_0x3897('0x5e')](_0x3897('0x5f'),'tq')[_0x3897('0x60')]('user_has_teams','ut',_0x3897('0x61'))[_0x3897('0x22')](_0x3897('0x62'),_0x5a3090[_0x3897('0x28')]['id']);for(var _0x583cc3=0x0;_0x583cc3<_0x10e977[_0x3897('0x2f')];_0x583cc3+=0x1){let _0x123a31=_0x10e977[_0x583cc3];for(var _0x32ba7a=0x0;_0x32ba7a<_0x123a31['Agents'][_0x3897('0x2f')];_0x32ba7a+=0x1){let _0x47bd9a=_0x123a31[_0x3897('0x51')][_0x32ba7a];var _0x27d105=_0x1defe0[_0x3897('0x63')]();_0x27d105[_0x3897('0x22')](_0x3897('0x64'),_0x47bd9a['id']);_0x4feb24[_0x3897('0x65')](db[_0x3897('0x54')][_0x3897('0x2a')](_0x27d105[_0x3897('0x66')](),{'type':db[_0x3897('0x54')]['QueryTypes'][_0x3897('0x67')]})[_0x3897('0x15')](function(_0x2dc6bc){if(_0x2dc6bc[_0x3897('0x2f')]===0x1){return _0x47bd9a['id'];}else{var _0x1a7817=_[_0x3897('0x68')](_['map'](_0x2dc6bc,'TeamId'),function(_0xb3460f){return _[_0x3897('0x69')](_0x1e61f3,_0xb3460f);});if(_0x1a7817){return _0x47bd9a['id'];}}}));}}return BPromise[_0x3897('0x6a')](_0x4feb24)['then'](function(_0x129539){_0x5c5be0=_(_0x5c5be0)[_0x3897('0x6b')](_0x129539)[_0x3897('0x6c')]()[_0x3897('0x6d')]();return db['WhatsappQueue'][_0x3897('0x32')]({'where':{'id':_0x5a3090[_0x3897('0x28')]['id']}})[_0x3897('0x15')](function(_0x5c77a5){return db[_0x3897('0x54')][_0x3897('0x55')](function(_0x214744){return _0x5c77a5['removeTeams'](_0x5a3090[_0x3897('0x2a')][_0x3897('0x5a')],{'transaction':_0x214744})['then'](function(){if(!_[_0x3897('0x6e')](_0x5c5be0)){return _0x5c77a5[_0x3897('0x6f')](_0x5c5be0,{'transaction':_0x214744});}})[_0x3897('0x15')](function(){_0x5c5be0[_0x3897('0x57')](function(_0x2fede1){socket['emit'](_0x3897('0x70'),{'UserId':_0x2fede1,'WhatsappQueueId':_0x5c77a5['id']});});});});});});})[_0x3897('0x15')](respondWithStatusCode(_0x59a504,null))[_0x3897('0x26')](handleError(_0x59a504,null));};exports[_0x3897('0x71')]=function(_0x155cfc,_0x1e1ead){return db[_0x3897('0x1d')][_0x3897('0x32')]({'where':{'id':_0x155cfc[_0x3897('0x28')]['id']}})[_0x3897('0x15')](handleEntityNotFound(_0x1e1ead,null))[_0x3897('0x15')](function(_0x1a471f){if(_0x1a471f){return _0x1a471f[_0x3897('0x71')](_0x155cfc['body'][_0x3897('0x5a')],_[_0x3897('0x72')](_0x155cfc[_0x3897('0x34')],[_0x3897('0x5a'),'id'])||{})[_0x3897('0x73')](function(_0x5c7e6b){for(var _0x34f481=0x0;_0x34f481<_0x155cfc[_0x3897('0x34')][_0x3897('0x5a')][_0x3897('0x2f')];_0x34f481+=0x1){socket[_0x3897('0x58')](_0x3897('0x74'),{'UserId':Number(_0x155cfc[_0x3897('0x34')]['ids'][_0x34f481]),'WhatsappQueueId':Number(_0x155cfc[_0x3897('0x28')]['id'])});}return _0x5c7e6b;});}})[_0x3897('0x15')](respondWithResult(_0x1e1ead,null))[_0x3897('0x26')](handleError(_0x1e1ead,null));};exports['removeAgents']=function(_0x3de56a,_0x2a3c00){return db[_0x3897('0x1d')][_0x3897('0x32')]({'where':{'id':_0x3de56a[_0x3897('0x28')]['id']}})[_0x3897('0x15')](handleEntityNotFound(_0x2a3c00,null))['then'](function(_0x431909){if(_0x431909){return _0x431909[_0x3897('0x6f')](_0x3de56a[_0x3897('0x2a')][_0x3897('0x5a')])['then'](function(){if(_['isArray'](_0x3de56a['query']['ids'])){for(var _0x10da59=0x0;_0x10da59<_0x3de56a[_0x3897('0x2a')][_0x3897('0x5a')][_0x3897('0x2f')];_0x10da59+=0x1){socket[_0x3897('0x58')](_0x3897('0x70'),{'UserId':Number(_0x3de56a[_0x3897('0x2a')][_0x3897('0x5a')][_0x10da59]),'WhatsappQueueId':Number(_0x3de56a[_0x3897('0x28')]['id'])});}}else{socket['emit'](_0x3897('0x70'),{'UserId':Number(_0x3de56a[_0x3897('0x2a')][_0x3897('0x5a')]),'WhatsappQueueId':Number(_0x3de56a[_0x3897('0x28')]['id'])});}});}})['then'](respondWithStatusCode(_0x2a3c00,null))['catch'](handleError(_0x2a3c00,null));};exports[_0x3897('0x75')]=function(_0x5e899d,_0x1ad041){var _0x185ea0={};var _0x2a671f={};var _0x3a547a;var _0x39347c;return db[_0x3897('0x1d')][_0x3897('0x3e')]({'where':{'id':_0x5e899d['params']['id']}})[_0x3897('0x15')](handleEntityNotFound(_0x1ad041,null))[_0x3897('0x15')](function(_0x20e8c0){if(_0x20e8c0){_0x3a547a=_0x20e8c0;_0x2a671f[_0x3897('0x2b')]=_['keys'](db[_0x3897('0x46')]['rawAttributes']);_0x2a671f[_0x3897('0x2a')]=_[_0x3897('0x29')](_0x5e899d['query']);_0x2a671f['filters']=_['intersection'](_0x2a671f[_0x3897('0x2b')],_0x2a671f[_0x3897('0x2a')]);_0x185ea0[_0x3897('0x2c')]=_[_0x3897('0x2d')](_0x2a671f[_0x3897('0x2b')],qs[_0x3897('0x2e')](_0x5e899d[_0x3897('0x2a')][_0x3897('0x2e')]));_0x185ea0[_0x3897('0x2c')]=_0x185ea0[_0x3897('0x2c')][_0x3897('0x2f')]?_0x185ea0['attributes']:_0x2a671f[_0x3897('0x2b')];_0x185ea0['order']=qs[_0x3897('0x42')](_0x5e899d[_0x3897('0x2a')][_0x3897('0x42')]);_0x185ea0[_0x3897('0x22')]=qs[_0x3897('0x43')](_[_0x3897('0x76')](_0x5e899d[_0x3897('0x2a')],_0x2a671f[_0x3897('0x43')]));if(_0x5e899d[_0x3897('0x2a')][_0x3897('0x45')]){_0x185ea0[_0x3897('0x22')]=_[_0x3897('0x30')](_0x185ea0[_0x3897('0x22')],{'$or':_[_0x3897('0x1c')](_0x185ea0[_0x3897('0x2c')],function(_0x44fa14){var _0x167551={};_0x167551[_0x44fa14]={'$like':'%'+_0x5e899d['query'][_0x3897('0x45')]+'%'};return _0x167551;})});}_0x185ea0=_[_0x3897('0x30')]({},_0x185ea0,_0x5e899d[_0x3897('0x31')]);return _0x3a547a[_0x3897('0x75')](_0x185ea0);}})[_0x3897('0x15')](function(_0x1f2e0b){if(_0x1f2e0b){_0x39347c=_0x1f2e0b[_0x3897('0x2f')];if(!_0x5e899d[_0x3897('0x2a')][_0x3897('0x40')](_0x3897('0x41'))){_0x185ea0[_0x3897('0x10')]=qs[_0x3897('0x10')](_0x5e899d[_0x3897('0x2a')]['limit']);_0x185ea0[_0x3897('0xe')]=qs[_0x3897('0xe')](_0x5e899d[_0x3897('0x2a')]['offset']);}return _0x3a547a[_0x3897('0x75')](_0x185ea0);}})[_0x3897('0x15')](function(_0x3556d5){if(_0x3556d5){return _0x3556d5?{'count':_0x39347c,'rows':_0x3556d5}:null;}})['then'](respondWithResult(_0x1ad041,null))[_0x3897('0x26')](handleError(_0x1ad041,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index e726bb7..f1ffa3e 100644 --- a/server/api/whatsappQueue/whatsappQueue.events.js +++ b/server/api/whatsappQueue/whatsappQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0030=['WhatsappQueue','setMaxListeners','save','update','remove','emit','events','../../mysqldb'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0x0030,0x106));var _0x0003=function(_0x3c12bb,_0x49de69){_0x3c12bb=_0x3c12bb-0x0;var _0x3fa559=_0x0030[_0x3c12bb];return _0x3fa559;};'use strict';var EventEmitter=require(_0x0003('0x0'));var WhatsappQueue=require(_0x0003('0x1'))['db'][_0x0003('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x0003('0x3')](0x0);var events={'afterCreate':_0x0003('0x4'),'afterUpdate':_0x0003('0x5'),'afterDestroy':_0x0003('0x6')};function emitEvent(_0x35a200){return function(_0x1f14f3,_0x157a23,_0x2f59a6){WhatsappQueueEvents['emit'](_0x35a200+':'+_0x1f14f3['id'],_0x1f14f3);WhatsappQueueEvents[_0x0003('0x7')](_0x35a200,_0x1f14f3);_0x2f59a6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file +var _0xf8a6=['save','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x4f67f8,_0x5edef8){var _0x1b7166=function(_0x18a415){while(--_0x18a415){_0x4f67f8['push'](_0x4f67f8['shift']());}};_0x1b7166(++_0x5edef8);}(_0xf8a6,0x1a8));var _0x6f8a=function(_0x410b2f,_0x1cf4fa){_0x410b2f=_0x410b2f-0x0;var _0x82ac59=_0xf8a6[_0x410b2f];return _0x82ac59;};'use strict';var EventEmitter=require(_0x6f8a('0x0'));var WhatsappQueue=require(_0x6f8a('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6f8a('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2365b6){return function(_0x4e0efa,_0x138c20,_0x1b04f9){WhatsappQueueEvents[_0x6f8a('0x3')](_0x2365b6+':'+_0x4e0efa['id'],_0x4e0efa);WhatsappQueueEvents['emit'](_0x2365b6,_0x4e0efa);_0x1b04f9(null);};}for(var e in events){if(events[_0x6f8a('0x4')](e)){var event=events[e];WhatsappQueue[_0x6f8a('0x5')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index ed80be6..8841a14 100644 --- a/server/api/whatsappQueue/whatsappQueue.model.js +++ b/server/api/whatsappQueue/whatsappQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7dcf=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes','define','WhatsappQueue','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7dcf,0x1d2));var _0xf7dc=function(_0x2de0a7,_0x38d3e7){_0x2de0a7=_0x2de0a7-0x0;var _0x429437=_0x7dcf[_0x2de0a7];return _0x429437;};'use strict';var _=require(_0xf7dc('0x0'));var util=require(_0xf7dc('0x1'));var logger=require('../../config/logger')(_0xf7dc('0x2'));var moment=require(_0xf7dc('0x3'));var BPromise=require(_0xf7dc('0x4'));var rp=require(_0xf7dc('0x5'));var fs=require('fs');var path=require(_0xf7dc('0x6'));var rimraf=require(_0xf7dc('0x7'));var config=require(_0xf7dc('0x8'));var attributes=require(_0xf7dc('0x9'));module['exports']=function(_0x2d1762,_0x1be680){return _0x2d1762[_0xf7dc('0xa')](_0xf7dc('0xb'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb833=['WhatsappQueue','whatsapp_queues','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./whatsappQueue.attributes','exports'];(function(_0x2aa0ac,_0xbd2cd0){var _0x22bbd1=function(_0x54190f){while(--_0x54190f){_0x2aa0ac['push'](_0x2aa0ac['shift']());}};_0x22bbd1(++_0xbd2cd0);}(_0xb833,0x1e6));var _0x3b83=function(_0x462f6e,_0x418318){_0x462f6e=_0x462f6e-0x0;var _0x5ca40b=_0xb833[_0x462f6e];return _0x5ca40b;};'use strict';var _=require(_0x3b83('0x0'));var util=require('util');var logger=require(_0x3b83('0x1'))('api');var moment=require(_0x3b83('0x2'));var BPromise=require(_0x3b83('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3b83('0x4'));var rimraf=require(_0x3b83('0x5'));var config=require(_0x3b83('0x6'));var attributes=require(_0x3b83('0x7'));module[_0x3b83('0x8')]=function(_0x54be57,_0x2c01d7){return _0x54be57['define'](_0x3b83('0x9'),attributes,{'tableName':_0x3b83('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index 145e81f..f74bee9 100644 --- a/server/api/whatsappQueue/whatsappQueue.rpc.js +++ b/server/api/whatsappQueue/whatsappQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x91a5=['model','debug','GetWhatsappQueue','ShowWhatsappQueue','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','WhatsappQueue','findAll','raw','options','attributes','limit','map','include'];(function(_0x20886e,_0x47f131){var _0x4ea5ee=function(_0x2dc482){while(--_0x2dc482){_0x20886e['push'](_0x20886e['shift']());}};_0x4ea5ee(++_0x47f131);}(_0x91a5,0xfc));var _0x591a=function(_0x5a6644,_0x45d612){_0x5a6644=_0x5a6644-0x0;var _0x3a2a5d=_0x91a5[_0x5a6644];return _0x3a2a5d;};'use strict';var _=require(_0x591a('0x0'));var util=require(_0x591a('0x1'));var moment=require(_0x591a('0x2'));var BPromise=require(_0x591a('0x3'));var rs=require(_0x591a('0x4'));var fs=require('fs');var Redis=require(_0x591a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x591a('0x6'));var logger=require('../../config/logger')(_0x591a('0x7'));var config=require(_0x591a('0x8'));var jayson=require(_0x591a('0x9'));var client=jayson[_0x591a('0xa')]['http']({'port':0x232a});config[_0x591a('0xb')]=_[_0x591a('0xc')](config[_0x591a('0xb')],{'host':_0x591a('0xd'),'port':0x18eb});var socket=require(_0x591a('0xe'))(new Redis(config[_0x591a('0xb')]));require(_0x591a('0xf'))[_0x591a('0x10')](socket);function respondWithRpcPromise(_0x34a77f,_0x5439d4,_0x94aa90){return new BPromise(function(_0x561efb,_0x5cad67){return client['request'](_0x34a77f,_0x94aa90)[_0x591a('0x11')](function(_0x36a260){logger[_0x591a('0x12')](_0x591a('0x13'),_0x5439d4,_0x591a('0x14'));logger['debug'](_0x591a('0x15'),_0x5439d4,'request\x20sent',JSON[_0x591a('0x16')](_0x36a260));if(_0x36a260[_0x591a('0x17')]){if(_0x36a260['error'][_0x591a('0x18')]===0x1f4){logger[_0x591a('0x17')](_0x591a('0x13'),_0x5439d4,_0x36a260['error'][_0x591a('0x19')]);return _0x5cad67(_0x36a260[_0x591a('0x17')][_0x591a('0x19')]);}logger[_0x591a('0x17')](_0x591a('0x13'),_0x5439d4,_0x36a260['error']['message']);return _0x561efb(_0x36a260[_0x591a('0x17')]['message']);}else{logger[_0x591a('0x12')](_0x591a('0x13'),_0x5439d4,_0x591a('0x14'));_0x561efb(_0x36a260['result']['message']);}})[_0x591a('0x1a')](function(_0x1bb5a6){logger[_0x591a('0x17')](_0x591a('0x13'),_0x5439d4,_0x1bb5a6);_0x5cad67(_0x1bb5a6);});});}exports['GetWhatsappQueue']=function(_0x4c5de4){var _0x5cd166=this;return new Promise(function(_0x5a9100,_0x282e9e){return db[_0x591a('0x1b')][_0x591a('0x1c')]({'raw':_0x4c5de4['options']?_0x4c5de4['options'][_0x591a('0x1d')]===undefined?!![]:![]:!![],'where':_0x4c5de4[_0x591a('0x1e')]?_0x4c5de4[_0x591a('0x1e')]['where']||null:null,'attributes':_0x4c5de4[_0x591a('0x1e')]?_0x4c5de4['options'][_0x591a('0x1f')]||null:null,'limit':_0x4c5de4[_0x591a('0x1e')]?_0x4c5de4['options'][_0x591a('0x20')]||null:null,'include':_0x4c5de4['options']?_0x4c5de4[_0x591a('0x1e')]['include']?_[_0x591a('0x21')](_0x4c5de4['options'][_0x591a('0x22')],function(_0x11eb18){return{'model':db[_0x11eb18['model']],'as':_0x11eb18['as'],'attributes':_0x11eb18[_0x591a('0x1f')],'include':_0x11eb18[_0x591a('0x22')]?_[_0x591a('0x21')](_0x11eb18[_0x591a('0x22')],function(_0x3044a1){return{'model':db[_0x3044a1[_0x591a('0x23')]],'as':_0x3044a1['as'],'attributes':_0x3044a1[_0x591a('0x1f')],'include':_0x3044a1[_0x591a('0x22')]?_[_0x591a('0x21')](_0x3044a1['include'],function(_0x1717a4){return{'model':db[_0x1717a4[_0x591a('0x23')]],'as':_0x1717a4['as'],'attributes':_0x1717a4['attributes']};}):[]};}):[]};}):[]:[]})[_0x591a('0x11')](function(_0x885e40){logger[_0x591a('0x12')]('GetWhatsappQueue',_0x4c5de4);logger[_0x591a('0x24')](_0x591a('0x25'),_0x4c5de4,JSON['stringify'](_0x885e40));_0x5a9100(_0x885e40);})[_0x591a('0x1a')](function(_0x25a3b0){logger['error']('GetWhatsappQueue',_0x25a3b0['message'],_0x4c5de4);_0x282e9e(_0x5cd166['error'](0x1f4,_0x25a3b0[_0x591a('0x19')]));});});};exports[_0x591a('0x26')]=function(_0x23e911){var _0x4e1b28=this;return new Promise(function(_0x31de1a,_0x3c18bf){return db[_0x591a('0x1b')][_0x591a('0x27')]({'raw':_0x23e911[_0x591a('0x1e')]?_0x23e911['options'][_0x591a('0x1d')]===undefined?!![]:![]:!![],'where':_0x23e911[_0x591a('0x1e')]?_0x23e911[_0x591a('0x1e')][_0x591a('0x28')]||null:null,'attributes':_0x23e911[_0x591a('0x1e')]?_0x23e911['options'][_0x591a('0x1f')]||null:null,'include':_0x23e911[_0x591a('0x1e')]?_0x23e911['options'][_0x591a('0x22')]?_[_0x591a('0x21')](_0x23e911[_0x591a('0x1e')][_0x591a('0x22')],function(_0x5ef5d2){return{'model':db[_0x5ef5d2[_0x591a('0x23')]],'as':_0x5ef5d2['as'],'attributes':_0x5ef5d2[_0x591a('0x1f')],'include':_0x5ef5d2[_0x591a('0x22')]?_[_0x591a('0x21')](_0x5ef5d2[_0x591a('0x22')],function(_0x501e6d){return{'model':db[_0x501e6d[_0x591a('0x23')]],'as':_0x501e6d['as'],'attributes':_0x501e6d['attributes'],'include':_0x501e6d[_0x591a('0x22')]?_[_0x591a('0x21')](_0x501e6d['include'],function(_0x4b2dbb){return{'model':db[_0x4b2dbb[_0x591a('0x23')]],'as':_0x4b2dbb['as'],'attributes':_0x4b2dbb[_0x591a('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x321991){logger[_0x591a('0x12')]('ShowWhatsappQueue',_0x23e911);logger[_0x591a('0x24')](_0x591a('0x26'),_0x23e911,JSON[_0x591a('0x16')](_0x321991));_0x31de1a(_0x321991);})[_0x591a('0x1a')](function(_0x4512f5){logger[_0x591a('0x17')](_0x591a('0x26'),_0x4512f5[_0x591a('0x19')],_0x23e911);_0x3c18bf(_0x4e1b28[_0x591a('0x17')](0x1f4,_0x4512f5[_0x591a('0x19')]));});});}; \ No newline at end of file +var _0x23e5=['WhatsappQueue,\x20%s,\x20%s','request\x20sent','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','attributes','include','map','model','debug','catch','ShowWhatsappQueue','find','where','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info'];(function(_0x16db8b,_0xca7d28){var _0x5ba017=function(_0x35b933){while(--_0x35b933){_0x16db8b['push'](_0x16db8b['shift']());}};_0x5ba017(++_0xca7d28);}(_0x23e5,0x1ea));var _0x523e=function(_0x35d239,_0x234a02){_0x35d239=_0x35d239-0x0;var _0x42f8fe=_0x23e5[_0x35d239];return _0x42f8fe;};'use strict';var _=require('lodash');var util=require(_0x523e('0x0'));var moment=require('moment');var BPromise=require(_0x523e('0x1'));var rs=require(_0x523e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x523e('0x3'))['db'];var utils=require(_0x523e('0x4'));var logger=require(_0x523e('0x5'))('rpc');var config=require(_0x523e('0x6'));var jayson=require(_0x523e('0x7'));var client=jayson[_0x523e('0x8')][_0x523e('0x9')]({'port':0x232a});config[_0x523e('0xa')]=_[_0x523e('0xb')](config['redis'],{'host':_0x523e('0xc'),'port':0x18eb});var socket=require(_0x523e('0xd'))(new Redis(config['redis']));require('./whatsappQueue.socket')['register'](socket);function respondWithRpcPromise(_0x282a76,_0x1e43d5,_0x3bebfb){return new BPromise(function(_0x432351,_0x5295cc){return client[_0x523e('0xe')](_0x282a76,_0x3bebfb)[_0x523e('0xf')](function(_0x4f5032){logger[_0x523e('0x10')](_0x523e('0x11'),_0x1e43d5,_0x523e('0x12'));logger['debug'](_0x523e('0x13'),_0x1e43d5,_0x523e('0x12'),JSON[_0x523e('0x14')](_0x4f5032));if(_0x4f5032[_0x523e('0x15')]){if(_0x4f5032['error'][_0x523e('0x16')]===0x1f4){logger[_0x523e('0x15')]('WhatsappQueue,\x20%s,\x20%s',_0x1e43d5,_0x4f5032[_0x523e('0x15')]['message']);return _0x5295cc(_0x4f5032[_0x523e('0x15')]['message']);}logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x1e43d5,_0x4f5032[_0x523e('0x15')][_0x523e('0x17')]);return _0x432351(_0x4f5032['error'][_0x523e('0x17')]);}else{logger[_0x523e('0x10')](_0x523e('0x11'),_0x1e43d5,_0x523e('0x12'));_0x432351(_0x4f5032[_0x523e('0x18')][_0x523e('0x17')]);}})['catch'](function(_0x160bbd){logger['error'](_0x523e('0x11'),_0x1e43d5,_0x160bbd);_0x5295cc(_0x160bbd);});});}exports[_0x523e('0x19')]=function(_0x3dc679){var _0x2f6024=this;return new Promise(function(_0x474f09,_0x2c6244){return db[_0x523e('0x1a')][_0x523e('0x1b')]({'raw':_0x3dc679['options']?_0x3dc679[_0x523e('0x1c')][_0x523e('0x1d')]===undefined?!![]:![]:!![],'where':_0x3dc679[_0x523e('0x1c')]?_0x3dc679[_0x523e('0x1c')]['where']||null:null,'attributes':_0x3dc679[_0x523e('0x1c')]?_0x3dc679[_0x523e('0x1c')][_0x523e('0x1e')]||null:null,'limit':_0x3dc679[_0x523e('0x1c')]?_0x3dc679[_0x523e('0x1c')]['limit']||null:null,'include':_0x3dc679[_0x523e('0x1c')]?_0x3dc679[_0x523e('0x1c')][_0x523e('0x1f')]?_[_0x523e('0x20')](_0x3dc679[_0x523e('0x1c')][_0x523e('0x1f')],function(_0x3c61f3){return{'model':db[_0x3c61f3[_0x523e('0x21')]],'as':_0x3c61f3['as'],'attributes':_0x3c61f3['attributes'],'include':_0x3c61f3[_0x523e('0x1f')]?_['map'](_0x3c61f3['include'],function(_0x329fbb){return{'model':db[_0x329fbb['model']],'as':_0x329fbb['as'],'attributes':_0x329fbb[_0x523e('0x1e')],'include':_0x329fbb[_0x523e('0x1f')]?_['map'](_0x329fbb['include'],function(_0x47a93a){return{'model':db[_0x47a93a[_0x523e('0x21')]],'as':_0x47a93a['as'],'attributes':_0x47a93a[_0x523e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x523e('0xf')](function(_0x201385){logger[_0x523e('0x10')](_0x523e('0x19'),_0x3dc679);logger[_0x523e('0x22')](_0x523e('0x19'),_0x3dc679,JSON[_0x523e('0x14')](_0x201385));_0x474f09(_0x201385);})[_0x523e('0x23')](function(_0x472076){logger[_0x523e('0x15')]('GetWhatsappQueue',_0x472076[_0x523e('0x17')],_0x3dc679);_0x2c6244(_0x2f6024[_0x523e('0x15')](0x1f4,_0x472076[_0x523e('0x17')]));});});};exports[_0x523e('0x24')]=function(_0x461f2c){var _0x368ae4=this;return new Promise(function(_0x4d2fad,_0x1f1949){return db[_0x523e('0x1a')][_0x523e('0x25')]({'raw':_0x461f2c[_0x523e('0x1c')]?_0x461f2c[_0x523e('0x1c')][_0x523e('0x1d')]===undefined?!![]:![]:!![],'where':_0x461f2c[_0x523e('0x1c')]?_0x461f2c[_0x523e('0x1c')][_0x523e('0x26')]||null:null,'attributes':_0x461f2c[_0x523e('0x1c')]?_0x461f2c[_0x523e('0x1c')]['attributes']||null:null,'include':_0x461f2c[_0x523e('0x1c')]?_0x461f2c[_0x523e('0x1c')][_0x523e('0x1f')]?_[_0x523e('0x20')](_0x461f2c[_0x523e('0x1c')][_0x523e('0x1f')],function(_0x4c8a7a){return{'model':db[_0x4c8a7a[_0x523e('0x21')]],'as':_0x4c8a7a['as'],'attributes':_0x4c8a7a[_0x523e('0x1e')],'include':_0x4c8a7a[_0x523e('0x1f')]?_['map'](_0x4c8a7a[_0x523e('0x1f')],function(_0x558de9){return{'model':db[_0x558de9[_0x523e('0x21')]],'as':_0x558de9['as'],'attributes':_0x558de9[_0x523e('0x1e')],'include':_0x558de9[_0x523e('0x1f')]?_[_0x523e('0x20')](_0x558de9[_0x523e('0x1f')],function(_0x163da0){return{'model':db[_0x163da0[_0x523e('0x21')]],'as':_0x163da0['as'],'attributes':_0x163da0[_0x523e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x523e('0xf')](function(_0x9d5aad){logger[_0x523e('0x10')](_0x523e('0x24'),_0x461f2c);logger[_0x523e('0x22')](_0x523e('0x24'),_0x461f2c,JSON['stringify'](_0x9d5aad));_0x4d2fad(_0x9d5aad);})[_0x523e('0x23')](function(_0x128675){logger['error']('ShowWhatsappQueue',_0x128675['message'],_0x461f2c);_0x1f1949(_0x368ae4[_0x523e('0x15')](0x1f4,_0x128675[_0x523e('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 6f36567..3cdf432 100644 --- a/server/api/whatsappQueue/whatsappQueue.socket.js +++ b/server/api/whatsappQueue/whatsappQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfbe0=['save','removeListener','length','whatsappQueue:','./whatsappQueue.events'];(function(_0x5d2911,_0xdc51b3){var _0x188c41=function(_0x384fa9){while(--_0x384fa9){_0x5d2911['push'](_0x5d2911['shift']());}};_0x188c41(++_0xdc51b3);}(_0xfbe0,0xd6));var _0x0fbe=function(_0x328d75,_0x5af2f9){_0x328d75=_0x328d75-0x0;var _0x2bd0da=_0xfbe0[_0x328d75];return _0x2bd0da;};'use strict';var WhatsappQueueEvents=require(_0x0fbe('0x0'));var events=[_0x0fbe('0x1'),'remove','update'];function createListener(_0x29b23e,_0x2c45c8){return function(_0x45dcdc){_0x2c45c8['emit'](_0x29b23e,_0x45dcdc);};}function removeListener(_0x3df41f,_0x27a7f4){return function(){WhatsappQueueEvents[_0x0fbe('0x2')](_0x3df41f,_0x27a7f4);};}exports['register']=function(_0x5d2ba0){for(var _0x554fe9=0x0,_0x182ec4=events[_0x0fbe('0x3')];_0x554fe9<_0x182ec4;_0x554fe9++){var _0x4b2e83=events[_0x554fe9];var _0x38be11=createListener(_0x0fbe('0x4')+_0x4b2e83,_0x5d2ba0);WhatsappQueueEvents['on'](_0x4b2e83,_0x38be11);}}; \ No newline at end of file +var _0x6271=['removeListener','register','length','whatsappQueue:','./whatsappQueue.events','save','remove','update','emit'];(function(_0x11d131,_0x1289de){var _0x401f57=function(_0xf8230a){while(--_0xf8230a){_0x11d131['push'](_0x11d131['shift']());}};_0x401f57(++_0x1289de);}(_0x6271,0x1e1));var _0x1627=function(_0x473f6e,_0x4cab7b){_0x473f6e=_0x473f6e-0x0;var _0x4facf5=_0x6271[_0x473f6e];return _0x4facf5;};'use strict';var WhatsappQueueEvents=require(_0x1627('0x0'));var events=[_0x1627('0x1'),_0x1627('0x2'),_0x1627('0x3')];function createListener(_0x55c171,_0x4a420){return function(_0x5d1c8a){_0x4a420[_0x1627('0x4')](_0x55c171,_0x5d1c8a);};}function removeListener(_0xda67b6,_0x4fe556){return function(){WhatsappQueueEvents[_0x1627('0x5')](_0xda67b6,_0x4fe556);};}exports[_0x1627('0x6')]=function(_0x5d061e){for(var _0x436095=0x0,_0x384724=events[_0x1627('0x7')];_0x436095<_0x384724;_0x436095++){var _0x18d7f3=events[_0x436095];var _0x1ffd80=createListener(_0x1627('0x8')+_0x18d7f3,_0x5d061e);WhatsappQueueEvents['on'](_0x18d7f3,_0x1ffd80);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 21d700c..de772a6 100644 --- a/server/api/whatsappQueueReport/index.js +++ b/server/api/whatsappQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf6be=['delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id'];(function(_0x5f1c3e,_0x532f71){var _0x19b1ca=function(_0x1291ec){while(--_0x1291ec){_0x5f1c3e['push'](_0x5f1c3e['shift']());}};_0x19b1ca(++_0x532f71);}(_0xf6be,0x1d1));var _0xef6b=function(_0x3c3e72,_0x3e1858){_0x3c3e72=_0x3c3e72-0x0;var _0x48a7e5=_0xf6be[_0x3c3e72];return _0x48a7e5;};'use strict';var multer=require('multer');var util=require(_0xef6b('0x0'));var path=require(_0xef6b('0x1'));var timeout=require(_0xef6b('0x2'));var express=require(_0xef6b('0x3'));var router=express[_0xef6b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xef6b('0x5'));var interaction=require(_0xef6b('0x6'));var config=require(_0xef6b('0x7'));var controller=require(_0xef6b('0x8'));router[_0xef6b('0x9')]('/',auth[_0xef6b('0xa')](),controller[_0xef6b('0xb')]);router['get'](_0xef6b('0xc'),auth[_0xef6b('0xa')](),controller[_0xef6b('0xd')]);router[_0xef6b('0x9')]('/:id',auth[_0xef6b('0xa')](),controller[_0xef6b('0xe')]);router[_0xef6b('0xf')]('/',auth[_0xef6b('0xa')](),controller[_0xef6b('0x10')]);router[_0xef6b('0x11')](_0xef6b('0x12'),auth[_0xef6b('0xa')](),controller['update']);router[_0xef6b('0x13')](_0xef6b('0x12'),auth[_0xef6b('0xa')](),controller[_0xef6b('0x14')]);module[_0xef6b('0x15')]=router; \ No newline at end of file +var _0xfb80=['/describe','describe','post','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0xfb80,0xa9));var _0x0fb8=function(_0x1daab2,_0x49b441){_0x1daab2=_0x1daab2-0x0;var _0x22879a=_0xfb80[_0x1daab2];return _0x22879a;};'use strict';var multer=require(_0x0fb8('0x0'));var util=require(_0x0fb8('0x1'));var path=require(_0x0fb8('0x2'));var timeout=require(_0x0fb8('0x3'));var express=require('express');var router=express[_0x0fb8('0x4')]();var fs_extra=require(_0x0fb8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0fb8('0x6'));var config=require(_0x0fb8('0x7'));var controller=require(_0x0fb8('0x8'));router[_0x0fb8('0x9')]('/',auth[_0x0fb8('0xa')](),controller['index']);router['get'](_0x0fb8('0xb'),auth['isAuthenticated'](),controller[_0x0fb8('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x0fb8('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0fb8('0xe')]('/:id',auth[_0x0fb8('0xa')](),controller[_0x0fb8('0xf')]);router['delete']('/:id',auth[_0x0fb8('0xa')](),controller[_0x0fb8('0x10')]);module[_0x0fb8('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 5189d9b..79294b9 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x40dd35,_0x1316ff){var _0x1705ec=function(_0x21444e){while(--_0x21444e){_0x40dd35['push'](_0x40dd35['shift']());}};_0x1705ec(++_0x1316ff);}(_0x7a54,0x106));var _0x47a5=function(_0x4a8f96,_0x29cb96){_0x4a8f96=_0x4a8f96-0x0;var _0x1217d5=_0x7a54[_0x4a8f96];return _0x1217d5;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x28e742,_0x581f5b){var _0x510ff5=function(_0x5b5c38){while(--_0x5b5c38){_0x28e742['push'](_0x28e742['shift']());}};_0x510ff5(++_0x581f5b);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 428471d..23479bd 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfef3=['offset','limit','undefined','count','status','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','WhatsappQueueReport','then','includeAll','include','findAll','rows','catch','show','params','fields','create','body','find','describe','eml-format','zip-dir','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json'];(function(_0x9e76d,_0x44e7a0){var _0x320985=function(_0x32c6c9){while(--_0x32c6c9){_0x9e76d['push'](_0x9e76d['shift']());}};_0x320985(++_0x44e7a0);}(_0xfef3,0x118));var _0x3fef=function(_0xf27c8d,_0x9ae5ef){_0xf27c8d=_0xf27c8d-0x0;var _0x568348=_0xfef3[_0xf27c8d];return _0x568348;};'use strict';var emlformat=require(_0x3fef('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3fef('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3fef('0x2'));var moment=require(_0x3fef('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3fef('0x4'));var util=require(_0x3fef('0x5'));var path=require('path');var sox=require(_0x3fef('0x6'));var csv=require(_0x3fef('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3fef('0x8'));var _=require(_0x3fef('0x9'));var squel=require(_0x3fef('0xa'));var crypto=require(_0x3fef('0xb'));var jsforce=require(_0x3fef('0xc'));var deskjs=require(_0x3fef('0xd'));var toCsv=require(_0x3fef('0x7'));var querystring=require(_0x3fef('0xe'));var Papa=require(_0x3fef('0xf'));var Redis=require(_0x3fef('0x10'));var authService=require(_0x3fef('0x11'));var qs=require(_0x3fef('0x12'));var as=require(_0x3fef('0x13'));var hardwareService=require(_0x3fef('0x14'));var logger=require('../../config/logger')(_0x3fef('0x15'));var utils=require(_0x3fef('0x16'));var config=require(_0x3fef('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x3fef('0x18'))['db'];function respondWithStatusCode(_0x4c4a47,_0x2c99ff){_0x2c99ff=_0x2c99ff||0xcc;return function(_0x3d2c2d){if(_0x3d2c2d){return _0x4c4a47[_0x3fef('0x19')](_0x2c99ff);}return _0x4c4a47['status'](_0x2c99ff)[_0x3fef('0x1a')]();};}function respondWithResult(_0x4be62f,_0x15b757){_0x15b757=_0x15b757||0xc8;return function(_0x14c053){if(_0x14c053){return _0x4be62f['status'](_0x15b757)[_0x3fef('0x1b')](_0x14c053);}};}function respondWithFilteredResult(_0x177e28,_0x40b479){return function(_0x79b617){if(_0x79b617){var _0x395df0=typeof _0x40b479[_0x3fef('0x1c')]==='undefined'&&typeof _0x40b479[_0x3fef('0x1d')]===_0x3fef('0x1e');var _0x1ec282=_0x79b617[_0x3fef('0x1f')];var _0x1613ad=_0x395df0?0x0:_0x40b479[_0x3fef('0x1c')];var _0x53d993=_0x395df0?_0x79b617[_0x3fef('0x1f')]:_0x40b479[_0x3fef('0x1c')]+_0x40b479['limit'];var _0x2c7f36;if(_0x53d993>=_0x1ec282){_0x53d993=_0x1ec282;_0x2c7f36=0xc8;}else{_0x2c7f36=0xce;}_0x177e28[_0x3fef('0x20')](_0x2c7f36);return _0x177e28[_0x3fef('0x21')](_0x3fef('0x22'),_0x1613ad+'-'+_0x53d993+'/'+_0x1ec282)[_0x3fef('0x1b')](_0x79b617);}return null;};}function patchUpdates(_0x2b5226){return function(_0x451d11){try{jsonpatch[_0x3fef('0x23')](_0x451d11,_0x2b5226,!![]);}catch(_0x124e7c){return BPromise[_0x3fef('0x24')](_0x124e7c);}return _0x451d11[_0x3fef('0x25')]();};}function saveUpdates(_0x3bb110,_0x2eb578){return function(_0x39a8ea){if(_0x39a8ea){return _0x39a8ea[_0x3fef('0x26')](_0x3bb110)['then'](function(_0x5b56de){return _0x5b56de;});}return null;};}function removeEntity(_0x50025f,_0x378b03){return function(_0x3ba38d){if(_0x3ba38d){return _0x3ba38d[_0x3fef('0x27')]()['then'](function(){_0x50025f[_0x3fef('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45464b,_0x2c0848){return function(_0x64d3e6){if(!_0x64d3e6){_0x45464b[_0x3fef('0x19')](0x194);}return _0x64d3e6;};}function handleError(_0x30e17a,_0x492ea0){_0x492ea0=_0x492ea0||0x1f4;return function(_0x4b4dee){logger['error'](_0x4b4dee[_0x3fef('0x28')]);if(_0x4b4dee[_0x3fef('0x29')]){delete _0x4b4dee['name'];}_0x30e17a[_0x3fef('0x20')](_0x492ea0)[_0x3fef('0x2a')](_0x4b4dee);};}exports['index']=function(_0x30a954,_0x3bdf03){var _0xf892bb={},_0x2b73fb={},_0x3a1a0a={'count':0x0,'rows':[]};var _0x137849=_[_0x3fef('0x2b')](db['WhatsappQueueReport'][_0x3fef('0x2c')],function(_0xc20ce5){return{'name':_0xc20ce5[_0x3fef('0x2d')],'type':_0xc20ce5[_0x3fef('0x2e')]['key']};});_0x2b73fb[_0x3fef('0x2f')]=_['map'](_0x137849,_0x3fef('0x29'));_0x2b73fb[_0x3fef('0x30')]=_[_0x3fef('0x31')](_0x30a954[_0x3fef('0x30')]);_0x2b73fb[_0x3fef('0x32')]=_[_0x3fef('0x33')](_0x2b73fb[_0x3fef('0x2f')],_0x2b73fb[_0x3fef('0x30')]);_0xf892bb[_0x3fef('0x34')]=_[_0x3fef('0x33')](_0x2b73fb['model'],qs['fields'](_0x30a954[_0x3fef('0x30')]['fields']));_0xf892bb[_0x3fef('0x34')]=_0xf892bb[_0x3fef('0x34')][_0x3fef('0x35')]?_0xf892bb[_0x3fef('0x34')]:_0x2b73fb[_0x3fef('0x2f')];if(!_0x30a954[_0x3fef('0x30')][_0x3fef('0x36')](_0x3fef('0x37'))){_0xf892bb[_0x3fef('0x1d')]=qs[_0x3fef('0x1d')](_0x30a954[_0x3fef('0x30')][_0x3fef('0x1d')]);_0xf892bb[_0x3fef('0x1c')]=qs[_0x3fef('0x1c')](_0x30a954['query'][_0x3fef('0x1c')]);}_0xf892bb[_0x3fef('0x38')]=qs[_0x3fef('0x39')](_0x30a954[_0x3fef('0x30')][_0x3fef('0x39')]);_0xf892bb[_0x3fef('0x3a')]=qs['filters'](_['pick'](_0x30a954[_0x3fef('0x30')],_0x2b73fb[_0x3fef('0x32')]),_0x137849);if(_0x30a954[_0x3fef('0x30')][_0x3fef('0x3b')]){_0xf892bb[_0x3fef('0x3a')]=_[_0x3fef('0x3c')](_0xf892bb[_0x3fef('0x3a')],{'$or':_[_0x3fef('0x2b')](_0x137849,function(_0x1fa70f){if(_0x1fa70f[_0x3fef('0x2e')]!==_0x3fef('0x3d')){var _0x560aae={};_0x560aae[_0x1fa70f[_0x3fef('0x29')]]={'$like':'%'+_0x30a954[_0x3fef('0x30')]['filter']+'%'};return _0x560aae;}})});}_0xf892bb=_['merge']({},_0xf892bb,_0x30a954[_0x3fef('0x3e')]);var _0x3dda68={'where':_0xf892bb[_0x3fef('0x3a')]};return db[_0x3fef('0x3f')][_0x3fef('0x1f')](_0x3dda68)[_0x3fef('0x40')](function(_0x17aff8){_0x3a1a0a[_0x3fef('0x1f')]=_0x17aff8;if(_0x30a954['query'][_0x3fef('0x41')]){_0xf892bb[_0x3fef('0x42')]=[{'all':!![]}];}return db[_0x3fef('0x3f')][_0x3fef('0x43')](_0xf892bb);})[_0x3fef('0x40')](function(_0x2143ec){_0x3a1a0a[_0x3fef('0x44')]=_0x2143ec;return _0x3a1a0a;})[_0x3fef('0x40')](respondWithFilteredResult(_0x3bdf03,_0xf892bb))[_0x3fef('0x45')](handleError(_0x3bdf03,null));};exports[_0x3fef('0x46')]=function(_0x12867c,_0x254880){var _0x2e1d7f={'raw':!![],'where':{'id':_0x12867c[_0x3fef('0x47')]['id']}},_0x15d2c7={};_0x15d2c7['model']=_[_0x3fef('0x31')](db[_0x3fef('0x3f')][_0x3fef('0x2c')]);_0x15d2c7[_0x3fef('0x30')]=_[_0x3fef('0x31')](_0x12867c[_0x3fef('0x30')]);_0x15d2c7['filters']=_[_0x3fef('0x33')](_0x15d2c7['model'],_0x15d2c7[_0x3fef('0x30')]);_0x2e1d7f[_0x3fef('0x34')]=_['intersection'](_0x15d2c7[_0x3fef('0x2f')],qs['fields'](_0x12867c[_0x3fef('0x30')][_0x3fef('0x48')]));_0x2e1d7f[_0x3fef('0x34')]=_0x2e1d7f[_0x3fef('0x34')][_0x3fef('0x35')]?_0x2e1d7f[_0x3fef('0x34')]:_0x15d2c7[_0x3fef('0x2f')];if(_0x12867c[_0x3fef('0x30')][_0x3fef('0x41')]){_0x2e1d7f[_0x3fef('0x42')]=[{'all':!![]}];}_0x2e1d7f=_[_0x3fef('0x3c')]({},_0x2e1d7f,_0x12867c[_0x3fef('0x3e')]);return db[_0x3fef('0x3f')]['find'](_0x2e1d7f)[_0x3fef('0x40')](handleEntityNotFound(_0x254880,null))[_0x3fef('0x40')](respondWithResult(_0x254880,null))['catch'](handleError(_0x254880,null));};exports[_0x3fef('0x49')]=function(_0x4210d6,_0x2f00c0){return db['WhatsappQueueReport'][_0x3fef('0x49')](_0x4210d6[_0x3fef('0x4a')],{})['then'](respondWithResult(_0x2f00c0,0xc9))[_0x3fef('0x45')](handleError(_0x2f00c0,null));};exports['update']=function(_0x48322c,_0x15fb2c){if(_0x48322c['body']['id']){delete _0x48322c[_0x3fef('0x4a')]['id'];}return db[_0x3fef('0x3f')]['find']({'where':{'id':_0x48322c[_0x3fef('0x47')]['id']}})[_0x3fef('0x40')](handleEntityNotFound(_0x15fb2c,null))[_0x3fef('0x40')](saveUpdates(_0x48322c['body'],null))[_0x3fef('0x40')](respondWithResult(_0x15fb2c,null))[_0x3fef('0x45')](handleError(_0x15fb2c,null));};exports[_0x3fef('0x27')]=function(_0x5b1acb,_0x324f70){return db[_0x3fef('0x3f')][_0x3fef('0x4b')]({'where':{'id':_0x5b1acb[_0x3fef('0x47')]['id']}})[_0x3fef('0x40')](handleEntityNotFound(_0x324f70,null))['then'](removeEntity(_0x324f70,null))[_0x3fef('0x45')](handleError(_0x324f70,null));};exports[_0x3fef('0x4c')]=function(_0x39a4b1,_0x2b9275){return db[_0x3fef('0x3f')][_0x3fef('0x4c')]()[_0x3fef('0x40')](respondWithResult(_0x2b9275,null))[_0x3fef('0x45')](handleError(_0x2b9275,null));}; \ No newline at end of file +var _0x9ffd=['model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','apply','update','then','error','name','send','map','WhatsappQueueReport','rawAttributes','fieldName','key'];(function(_0x34b821,_0x504e55){var _0x5e00a0=function(_0x242892){while(--_0x242892){_0x34b821['push'](_0x34b821['shift']());}};_0x5e00a0(++_0x504e55);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x39f531,_0x2c00ae){_0x39f531=_0x39f531-0x0;var _0x18725b=_0x9ffd[_0x39f531];return _0x18725b;};'use strict';var emlformat=require(_0xd9ff('0x0'));var rimraf=require(_0xd9ff('0x1'));var zipdir=require(_0xd9ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd9ff('0x3'));var moment=require(_0xd9ff('0x4'));var BPromise=require(_0xd9ff('0x5'));var Mustache=require(_0xd9ff('0x6'));var util=require('util');var path=require(_0xd9ff('0x7'));var sox=require(_0xd9ff('0x8'));var csv=require('to-csv');var ejs=require(_0xd9ff('0x9'));var fs=require('fs');var fs_extra=require(_0xd9ff('0xa'));var _=require(_0xd9ff('0xb'));var squel=require(_0xd9ff('0xc'));var crypto=require(_0xd9ff('0xd'));var jsforce=require(_0xd9ff('0xe'));var deskjs=require(_0xd9ff('0xf'));var toCsv=require(_0xd9ff('0x10'));var querystring=require(_0xd9ff('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd9ff('0x12'));var hardwareService=require(_0xd9ff('0x13'));var logger=require(_0xd9ff('0x14'))(_0xd9ff('0x15'));var utils=require(_0xd9ff('0x16'));var config=require(_0xd9ff('0x17'));var licenseUtil=require(_0xd9ff('0x18'));var db=require(_0xd9ff('0x19'))['db'];function respondWithStatusCode(_0x47d842,_0x47b0d7){_0x47b0d7=_0x47b0d7||0xcc;return function(_0xaaf7af){if(_0xaaf7af){return _0x47d842[_0xd9ff('0x1a')](_0x47b0d7);}return _0x47d842[_0xd9ff('0x1b')](_0x47b0d7)[_0xd9ff('0x1c')]();};}function respondWithResult(_0x12c39a,_0x556aa4){_0x556aa4=_0x556aa4||0xc8;return function(_0x2f78c1){if(_0x2f78c1){return _0x12c39a[_0xd9ff('0x1b')](_0x556aa4)['json'](_0x2f78c1);}};}function respondWithFilteredResult(_0xf14c9f,_0x5db010){return function(_0x4ffe54){if(_0x4ffe54){var _0x547e28=typeof _0x5db010['offset']===_0xd9ff('0x1d')&&typeof _0x5db010['limit']===_0xd9ff('0x1d');var _0xa30fd2=_0x4ffe54[_0xd9ff('0x1e')];var _0x3afd19=_0x547e28?0x0:_0x5db010[_0xd9ff('0x1f')];var _0x2d4df1=_0x547e28?_0x4ffe54[_0xd9ff('0x1e')]:_0x5db010[_0xd9ff('0x1f')]+_0x5db010[_0xd9ff('0x20')];var _0x1f028f;if(_0x2d4df1>=_0xa30fd2){_0x2d4df1=_0xa30fd2;_0x1f028f=0xc8;}else{_0x1f028f=0xce;}_0xf14c9f[_0xd9ff('0x1b')](_0x1f028f);return _0xf14c9f[_0xd9ff('0x21')](_0xd9ff('0x22'),_0x3afd19+'-'+_0x2d4df1+'/'+_0xa30fd2)['json'](_0x4ffe54);}return null;};}function patchUpdates(_0x4cf8ec){return function(_0x264a3d){try{jsonpatch[_0xd9ff('0x23')](_0x264a3d,_0x4cf8ec,!![]);}catch(_0x4eea4d){return BPromise['reject'](_0x4eea4d);}return _0x264a3d['save']();};}function saveUpdates(_0x4b1477,_0x1f4d9e){return function(_0x58eb5f){if(_0x58eb5f){return _0x58eb5f[_0xd9ff('0x24')](_0x4b1477)[_0xd9ff('0x25')](function(_0x291f52){return _0x291f52;});}return null;};}function removeEntity(_0x9f074e,_0x278b66){return function(_0x42a828){if(_0x42a828){return _0x42a828['destroy']()['then'](function(){_0x9f074e[_0xd9ff('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ca906,_0x4d86fe){return function(_0x285002){if(!_0x285002){_0x3ca906['sendStatus'](0x194);}return _0x285002;};}function handleError(_0x10cbdd,_0x159e56){_0x159e56=_0x159e56||0x1f4;return function(_0x2138b4){logger[_0xd9ff('0x26')](_0x2138b4['stack']);if(_0x2138b4[_0xd9ff('0x27')]){delete _0x2138b4[_0xd9ff('0x27')];}_0x10cbdd[_0xd9ff('0x1b')](_0x159e56)[_0xd9ff('0x28')](_0x2138b4);};}exports['index']=function(_0x1d3684,_0x3792d9){var _0x44b5a7={},_0x45fb63={},_0x263d3a={'count':0x0,'rows':[]};var _0xe516e2=_[_0xd9ff('0x29')](db[_0xd9ff('0x2a')][_0xd9ff('0x2b')],function(_0x5706cf){return{'name':_0x5706cf[_0xd9ff('0x2c')],'type':_0x5706cf['type'][_0xd9ff('0x2d')]};});_0x45fb63[_0xd9ff('0x2e')]=_[_0xd9ff('0x29')](_0xe516e2,'name');_0x45fb63[_0xd9ff('0x2f')]=_[_0xd9ff('0x30')](_0x1d3684[_0xd9ff('0x2f')]);_0x45fb63[_0xd9ff('0x31')]=_['intersection'](_0x45fb63[_0xd9ff('0x2e')],_0x45fb63['query']);_0x44b5a7[_0xd9ff('0x32')]=_[_0xd9ff('0x33')](_0x45fb63[_0xd9ff('0x2e')],qs[_0xd9ff('0x34')](_0x1d3684[_0xd9ff('0x2f')][_0xd9ff('0x34')]));_0x44b5a7[_0xd9ff('0x32')]=_0x44b5a7[_0xd9ff('0x32')][_0xd9ff('0x35')]?_0x44b5a7[_0xd9ff('0x32')]:_0x45fb63[_0xd9ff('0x2e')];if(!_0x1d3684[_0xd9ff('0x2f')][_0xd9ff('0x36')](_0xd9ff('0x37'))){_0x44b5a7['limit']=qs[_0xd9ff('0x20')](_0x1d3684[_0xd9ff('0x2f')][_0xd9ff('0x20')]);_0x44b5a7['offset']=qs[_0xd9ff('0x1f')](_0x1d3684['query'][_0xd9ff('0x1f')]);}_0x44b5a7['order']=qs[_0xd9ff('0x38')](_0x1d3684['query'][_0xd9ff('0x38')]);_0x44b5a7[_0xd9ff('0x39')]=qs[_0xd9ff('0x31')](_['pick'](_0x1d3684['query'],_0x45fb63['filters']),_0xe516e2);if(_0x1d3684[_0xd9ff('0x2f')][_0xd9ff('0x3a')]){_0x44b5a7[_0xd9ff('0x39')]=_[_0xd9ff('0x3b')](_0x44b5a7[_0xd9ff('0x39')],{'$or':_[_0xd9ff('0x29')](_0xe516e2,function(_0x596d29){if(_0x596d29['type']!=='VIRTUAL'){var _0x316d93={};_0x316d93[_0x596d29[_0xd9ff('0x27')]]={'$like':'%'+_0x1d3684[_0xd9ff('0x2f')][_0xd9ff('0x3a')]+'%'};return _0x316d93;}})});}_0x44b5a7=_['merge']({},_0x44b5a7,_0x1d3684[_0xd9ff('0x3c')]);var _0x5b8e17={'where':_0x44b5a7[_0xd9ff('0x39')]};return db[_0xd9ff('0x2a')][_0xd9ff('0x1e')](_0x5b8e17)[_0xd9ff('0x25')](function(_0x59fc07){_0x263d3a[_0xd9ff('0x1e')]=_0x59fc07;if(_0x1d3684[_0xd9ff('0x2f')]['includeAll']){_0x44b5a7[_0xd9ff('0x3d')]=[{'all':!![]}];}return db[_0xd9ff('0x2a')][_0xd9ff('0x3e')](_0x44b5a7);})[_0xd9ff('0x25')](function(_0x1fe44d){_0x263d3a[_0xd9ff('0x3f')]=_0x1fe44d;return _0x263d3a;})['then'](respondWithFilteredResult(_0x3792d9,_0x44b5a7))[_0xd9ff('0x40')](handleError(_0x3792d9,null));};exports[_0xd9ff('0x41')]=function(_0x10533a,_0x39fbbb){var _0x472724={'raw':!![],'where':{'id':_0x10533a[_0xd9ff('0x42')]['id']}},_0x52aab8={};_0x52aab8[_0xd9ff('0x2e')]=_[_0xd9ff('0x30')](db['WhatsappQueueReport']['rawAttributes']);_0x52aab8[_0xd9ff('0x2f')]=_[_0xd9ff('0x30')](_0x10533a[_0xd9ff('0x2f')]);_0x52aab8[_0xd9ff('0x31')]=_[_0xd9ff('0x33')](_0x52aab8[_0xd9ff('0x2e')],_0x52aab8['query']);_0x472724[_0xd9ff('0x32')]=_[_0xd9ff('0x33')](_0x52aab8['model'],qs[_0xd9ff('0x34')](_0x10533a[_0xd9ff('0x2f')][_0xd9ff('0x34')]));_0x472724[_0xd9ff('0x32')]=_0x472724[_0xd9ff('0x32')]['length']?_0x472724['attributes']:_0x52aab8['model'];if(_0x10533a[_0xd9ff('0x2f')]['includeAll']){_0x472724[_0xd9ff('0x3d')]=[{'all':!![]}];}_0x472724=_[_0xd9ff('0x3b')]({},_0x472724,_0x10533a[_0xd9ff('0x3c')]);return db['WhatsappQueueReport'][_0xd9ff('0x43')](_0x472724)[_0xd9ff('0x25')](handleEntityNotFound(_0x39fbbb,null))['then'](respondWithResult(_0x39fbbb,null))[_0xd9ff('0x40')](handleError(_0x39fbbb,null));};exports[_0xd9ff('0x44')]=function(_0x23b224,_0x316854){return db['WhatsappQueueReport'][_0xd9ff('0x44')](_0x23b224['body'],{})[_0xd9ff('0x25')](respondWithResult(_0x316854,0xc9))['catch'](handleError(_0x316854,null));};exports[_0xd9ff('0x24')]=function(_0x3d91e6,_0x2bf37a){if(_0x3d91e6[_0xd9ff('0x45')]['id']){delete _0x3d91e6[_0xd9ff('0x45')]['id'];}return db['WhatsappQueueReport'][_0xd9ff('0x43')]({'where':{'id':_0x3d91e6[_0xd9ff('0x42')]['id']}})[_0xd9ff('0x25')](handleEntityNotFound(_0x2bf37a,null))[_0xd9ff('0x25')](saveUpdates(_0x3d91e6['body'],null))['then'](respondWithResult(_0x2bf37a,null))['catch'](handleError(_0x2bf37a,null));};exports[_0xd9ff('0x46')]=function(_0x40be56,_0x29c6bd){return db['WhatsappQueueReport'][_0xd9ff('0x43')]({'where':{'id':_0x40be56[_0xd9ff('0x42')]['id']}})[_0xd9ff('0x25')](handleEntityNotFound(_0x29c6bd,null))[_0xd9ff('0x25')](removeEntity(_0x29c6bd,null))[_0xd9ff('0x40')](handleError(_0x29c6bd,null));};exports[_0xd9ff('0x47')]=function(_0x43a8ae,_0x1e1364){return db[_0xd9ff('0x2a')][_0xd9ff('0x47')]()[_0xd9ff('0x25')](respondWithResult(_0x1e1364,null))[_0xd9ff('0x40')](handleError(_0x1e1364,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 017b456..dfa5968 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.model.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9bd6=['report_whatsapp_queue','uniqueid','lodash','api','moment','request-promise','path','./whatsappQueueReport.attributes','exports','WhatsappQueueReport'];(function(_0x527d73,_0x1f6a7a){var _0x30d557=function(_0x1fee7c){while(--_0x1fee7c){_0x527d73['push'](_0x527d73['shift']());}};_0x30d557(++_0x1f6a7a);}(_0x9bd6,0x124));var _0x69bd=function(_0x248193,_0x572826){_0x248193=_0x248193-0x0;var _0x2d30fc=_0x9bd6[_0x248193];return _0x2d30fc;};'use strict';var _=require(_0x69bd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x69bd('0x1'));var moment=require(_0x69bd('0x2'));var BPromise=require('bluebird');var rp=require(_0x69bd('0x3'));var fs=require('fs');var path=require(_0x69bd('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x69bd('0x5'));module[_0x69bd('0x6')]=function(_0x1034c4,_0x11e395){return _0x1034c4['define'](_0x69bd('0x7'),attributes,{'tableName':_0x69bd('0x8'),'paranoid':![],'indexes':[{'name':_0x69bd('0x9'),'fields':[_0x69bd('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbace=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','define','report_whatsapp_queue','uniqueid','lodash'];(function(_0x50b03b,_0x31b89c){var _0x4383b6=function(_0xf4e88a){while(--_0xf4e88a){_0x50b03b['push'](_0x50b03b['shift']());}};_0x4383b6(++_0x31b89c);}(_0xbace,0xb5));var _0xebac=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0xbace[_0x279d37];return _0x530173;};'use strict';var _=require(_0xebac('0x0'));var util=require(_0xebac('0x1'));var logger=require(_0xebac('0x2'))(_0xebac('0x3'));var moment=require(_0xebac('0x4'));var BPromise=require('bluebird');var rp=require(_0xebac('0x5'));var fs=require('fs');var path=require(_0xebac('0x6'));var rimraf=require(_0xebac('0x7'));var config=require(_0xebac('0x8'));var attributes=require(_0xebac('0x9'));module[_0xebac('0xa')]=function(_0x5e797e,_0x2886c8){return _0x5e797e[_0xebac('0xb')]('WhatsappQueueReport',attributes,{'tableName':_0xebac('0xc'),'paranoid':![],'indexes':[{'name':_0xebac('0xd'),'fields':[_0xebac('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 04049a6..f0fa880 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf8e2=['code','error','message','result','CreateWhatsappQueueReport','WhatsappQueueReport','body','options','raw','stringify','UpdateWhatsappQueueReport','update','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','WhatsappQueueReport,\x20%s,\x20%s','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x1c34e7,_0x33f9a8){var _0x378cb1=function(_0x10b5e3){while(--_0x10b5e3){_0x1c34e7['push'](_0x1c34e7['shift']());}};_0x378cb1(++_0x33f9a8);}(_0xf8e2,0xf6));var _0x2f8e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xf8e2[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x2f8e('0x0'));var util=require(_0x2f8e('0x1'));var moment=require(_0x2f8e('0x2'));var BPromise=require('bluebird');var rs=require(_0x2f8e('0x3'));var fs=require('fs');var Redis=require(_0x2f8e('0x4'));var db=require(_0x2f8e('0x5'))['db'];var utils=require(_0x2f8e('0x6'));var logger=require(_0x2f8e('0x7'))(_0x2f8e('0x8'));var config=require('../../config/environment');var jayson=require(_0x2f8e('0x9'));var client=jayson[_0x2f8e('0xa')][_0x2f8e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ea095,_0x59a9b3,_0x33fb95){return new BPromise(function(_0x3597bc,_0x119b60){return client['request'](_0x4ea095,_0x33fb95)[_0x2f8e('0xc')](function(_0x2a3f0c){logger[_0x2f8e('0xd')](_0x2f8e('0xe'),_0x59a9b3,'request\x20sent');logger[_0x2f8e('0xf')](_0x2f8e('0x10'),_0x59a9b3,_0x2f8e('0x11'),JSON['stringify'](_0x2a3f0c));if(_0x2a3f0c['error']){if(_0x2a3f0c['error'][_0x2f8e('0x12')]===0x1f4){logger[_0x2f8e('0x13')]('WhatsappQueueReport,\x20%s,\x20%s',_0x59a9b3,_0x2a3f0c[_0x2f8e('0x13')][_0x2f8e('0x14')]);return _0x119b60(_0x2a3f0c[_0x2f8e('0x13')][_0x2f8e('0x14')]);}logger[_0x2f8e('0x13')](_0x2f8e('0xe'),_0x59a9b3,_0x2a3f0c[_0x2f8e('0x13')][_0x2f8e('0x14')]);return _0x3597bc(_0x2a3f0c[_0x2f8e('0x13')][_0x2f8e('0x14')]);}else{logger[_0x2f8e('0xd')](_0x2f8e('0xe'),_0x59a9b3,'request\x20sent');_0x3597bc(_0x2a3f0c[_0x2f8e('0x15')][_0x2f8e('0x14')]);}})['catch'](function(_0x336194){logger[_0x2f8e('0x13')](_0x2f8e('0xe'),_0x59a9b3,_0x336194);_0x119b60(_0x336194);});});}exports[_0x2f8e('0x16')]=function(_0x1cd697){var _0x3d696d=this;return new Promise(function(_0x343a24,_0x1c12dd){return db[_0x2f8e('0x17')]['create'](_0x1cd697[_0x2f8e('0x18')],{'raw':_0x1cd697[_0x2f8e('0x19')]?_0x1cd697['options'][_0x2f8e('0x1a')]===undefined?!![]:![]:!![]})[_0x2f8e('0xc')](function(_0x34a4f1){logger[_0x2f8e('0xd')](_0x2f8e('0x16'),_0x1cd697);logger[_0x2f8e('0xf')](_0x2f8e('0x16'),_0x1cd697,JSON[_0x2f8e('0x1b')](_0x34a4f1));_0x343a24(_0x34a4f1);})['catch'](function(_0x536e7d){logger[_0x2f8e('0x13')]('CreateWhatsappQueueReport',_0x536e7d[_0x2f8e('0x14')],_0x1cd697);_0x1c12dd(_0x3d696d[_0x2f8e('0x13')](0x1f4,_0x536e7d[_0x2f8e('0x14')]));});});};exports[_0x2f8e('0x1c')]=function(_0x57f20d){var _0x33347b=this;return new Promise(function(_0x3dbe8c,_0x484a9b){return db[_0x2f8e('0x17')][_0x2f8e('0x1d')](_0x57f20d[_0x2f8e('0x18')],{'raw':_0x57f20d[_0x2f8e('0x19')]?_0x57f20d[_0x2f8e('0x19')][_0x2f8e('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57f20d['options']?_0x57f20d[_0x2f8e('0x19')][_0x2f8e('0x1e')]||null:null,'attributes':_0x57f20d[_0x2f8e('0x19')]?_0x57f20d['options'][_0x2f8e('0x1f')]||null:null,'limit':_0x57f20d['options']?_0x57f20d[_0x2f8e('0x19')][_0x2f8e('0x20')]||null:null})['then'](function(_0x142794){logger[_0x2f8e('0xd')](_0x2f8e('0x1c'),_0x57f20d);logger[_0x2f8e('0xf')](_0x2f8e('0x1c'),_0x57f20d,JSON[_0x2f8e('0x1b')](_0x142794));_0x3dbe8c(_0x142794);})['catch'](function(_0x340c2e){logger[_0x2f8e('0x13')](_0x2f8e('0x1c'),_0x340c2e['message'],_0x57f20d);_0x484a9b(_0x33347b['error'](0x1f4,_0x340c2e['message']));});});}; \ No newline at end of file +var _0x6d6a=['CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','debug','stringify','catch','UpdateWhatsappQueueReport','update','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x2b462a,_0x493169){var _0x25f215=function(_0x4df68f){while(--_0x4df68f){_0x2b462a['push'](_0x2b462a['shift']());}};_0x25f215(++_0x493169);}(_0x6d6a,0x16c));var _0xa6d6=function(_0x31a938,_0x4daec6){_0x31a938=_0x31a938-0x0;var _0x1bf341=_0x6d6a[_0x31a938];return _0x1bf341;};'use strict';var _=require(_0xa6d6('0x0'));var util=require(_0xa6d6('0x1'));var moment=require('moment');var BPromise=require(_0xa6d6('0x2'));var rs=require(_0xa6d6('0x3'));var fs=require('fs');var Redis=require(_0xa6d6('0x4'));var db=require(_0xa6d6('0x5'))['db'];var utils=require(_0xa6d6('0x6'));var logger=require(_0xa6d6('0x7'))(_0xa6d6('0x8'));var config=require(_0xa6d6('0x9'));var jayson=require(_0xa6d6('0xa'));var client=jayson[_0xa6d6('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x244126,_0x21d61a,_0x227cc3){return new BPromise(function(_0x130280,_0x37bc94){return client[_0xa6d6('0xc')](_0x244126,_0x227cc3)[_0xa6d6('0xd')](function(_0xb44e97){logger[_0xa6d6('0xe')](_0xa6d6('0xf'),_0x21d61a,_0xa6d6('0x10'));logger['debug'](_0xa6d6('0x11'),_0x21d61a,_0xa6d6('0x10'),JSON['stringify'](_0xb44e97));if(_0xb44e97[_0xa6d6('0x12')]){if(_0xb44e97[_0xa6d6('0x12')]['code']===0x1f4){logger[_0xa6d6('0x12')](_0xa6d6('0xf'),_0x21d61a,_0xb44e97[_0xa6d6('0x12')][_0xa6d6('0x13')]);return _0x37bc94(_0xb44e97[_0xa6d6('0x12')]['message']);}logger[_0xa6d6('0x12')](_0xa6d6('0xf'),_0x21d61a,_0xb44e97[_0xa6d6('0x12')][_0xa6d6('0x13')]);return _0x130280(_0xb44e97[_0xa6d6('0x12')][_0xa6d6('0x13')]);}else{logger[_0xa6d6('0xe')](_0xa6d6('0xf'),_0x21d61a,_0xa6d6('0x10'));_0x130280(_0xb44e97[_0xa6d6('0x14')][_0xa6d6('0x13')]);}})['catch'](function(_0x3ef978){logger[_0xa6d6('0x12')](_0xa6d6('0xf'),_0x21d61a,_0x3ef978);_0x37bc94(_0x3ef978);});});}exports[_0xa6d6('0x15')]=function(_0x40be65){var _0x3f4fc8=this;return new Promise(function(_0x4906b7,_0x47b0f6){return db[_0xa6d6('0x16')][_0xa6d6('0x17')](_0x40be65[_0xa6d6('0x18')],{'raw':_0x40be65[_0xa6d6('0x19')]?_0x40be65[_0xa6d6('0x19')][_0xa6d6('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x109c6f){logger[_0xa6d6('0xe')]('CreateWhatsappQueueReport',_0x40be65);logger[_0xa6d6('0x1b')](_0xa6d6('0x15'),_0x40be65,JSON[_0xa6d6('0x1c')](_0x109c6f));_0x4906b7(_0x109c6f);})[_0xa6d6('0x1d')](function(_0xb9c314){logger[_0xa6d6('0x12')]('CreateWhatsappQueueReport',_0xb9c314[_0xa6d6('0x13')],_0x40be65);_0x47b0f6(_0x3f4fc8[_0xa6d6('0x12')](0x1f4,_0xb9c314[_0xa6d6('0x13')]));});});};exports[_0xa6d6('0x1e')]=function(_0x11abc7){var _0x1a6d30=this;return new Promise(function(_0x4bc76b,_0x3b1379){return db['WhatsappQueueReport'][_0xa6d6('0x1f')](_0x11abc7['body'],{'raw':_0x11abc7['options']?_0x11abc7[_0xa6d6('0x19')][_0xa6d6('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11abc7[_0xa6d6('0x19')]?_0x11abc7[_0xa6d6('0x19')][_0xa6d6('0x20')]||null:null,'attributes':_0x11abc7[_0xa6d6('0x19')]?_0x11abc7['options'][_0xa6d6('0x21')]||null:null,'limit':_0x11abc7[_0xa6d6('0x19')]?_0x11abc7[_0xa6d6('0x19')][_0xa6d6('0x22')]||null:null})[_0xa6d6('0xd')](function(_0x2e170a){logger[_0xa6d6('0xe')]('UpdateWhatsappQueueReport',_0x11abc7);logger[_0xa6d6('0x1b')](_0xa6d6('0x1e'),_0x11abc7,JSON[_0xa6d6('0x1c')](_0x2e170a));_0x4bc76b(_0x2e170a);})[_0xa6d6('0x1d')](function(_0x4bb8d5){logger['error'](_0xa6d6('0x1e'),_0x4bb8d5['message'],_0x11abc7);_0x3b1379(_0x1a6d30[_0xa6d6('0x12')](0x1f4,_0x4bb8d5[_0xa6d6('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index a87b90e..f5a0da5 100644 --- a/server/api/whatsappTransferReport/index.js +++ b/server/api/whatsappTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4de3=['/describe','describe','/:id','show','post','create','put','update','delete','destroy','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','isAuthenticated','index','get'];(function(_0x114903,_0x52c55e){var _0x4108e9=function(_0x5eaf3e){while(--_0x5eaf3e){_0x114903['push'](_0x114903['shift']());}};_0x4108e9(++_0x52c55e);}(_0x4de3,0xc7));var _0x34de=function(_0xc4c195,_0x57ddc8){_0xc4c195=_0xc4c195-0x0;var _0x407305=_0x4de3[_0xc4c195];return _0x407305;};'use strict';var multer=require(_0x34de('0x0'));var util=require('util');var path=require(_0x34de('0x1'));var timeout=require(_0x34de('0x2'));var express=require('express');var router=express[_0x34de('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x34de('0x4'));var interaction=require(_0x34de('0x5'));var config=require(_0x34de('0x6'));var controller=require(_0x34de('0x7'));router['get']('/',auth[_0x34de('0x8')](),controller[_0x34de('0x9')]);router[_0x34de('0xa')](_0x34de('0xb'),auth[_0x34de('0x8')](),controller[_0x34de('0xc')]);router['get'](_0x34de('0xd'),auth[_0x34de('0x8')](),controller[_0x34de('0xe')]);router[_0x34de('0xf')]('/',auth[_0x34de('0x8')](),controller[_0x34de('0x10')]);router[_0x34de('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x34de('0x12')]);router[_0x34de('0x13')](_0x34de('0xd'),auth[_0x34de('0x8')](),controller[_0x34de('0x14')]);module['exports']=router; \ No newline at end of file +var _0x8db9=['put','/:id','update','delete','exports','multer','util','path','express','fs-extra','../../components/interaction/service','./whatsappTransferReport.controller','get','isAuthenticated','index','describe','show','post','create'];(function(_0x28c562,_0x3737c4){var _0x55c945=function(_0x2415bd){while(--_0x2415bd){_0x28c562['push'](_0x28c562['shift']());}};_0x55c945(++_0x3737c4);}(_0x8db9,0x1ba));var _0x98db=function(_0x53ee2e,_0x3f8fd7){_0x53ee2e=_0x53ee2e-0x0;var _0x3fe2cf=_0x8db9[_0x53ee2e];return _0x3fe2cf;};'use strict';var multer=require(_0x98db('0x0'));var util=require(_0x98db('0x1'));var path=require(_0x98db('0x2'));var timeout=require('connect-timeout');var express=require(_0x98db('0x3'));var router=express['Router']();var fs_extra=require(_0x98db('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x98db('0x5'));var config=require('../../config/environment');var controller=require(_0x98db('0x6'));router[_0x98db('0x7')]('/',auth[_0x98db('0x8')](),controller[_0x98db('0x9')]);router[_0x98db('0x7')]('/describe',auth[_0x98db('0x8')](),controller[_0x98db('0xa')]);router[_0x98db('0x7')]('/:id',auth[_0x98db('0x8')](),controller[_0x98db('0xb')]);router[_0x98db('0xc')]('/',auth[_0x98db('0x8')](),controller[_0x98db('0xd')]);router[_0x98db('0xe')](_0x98db('0xf'),auth[_0x98db('0x8')](),controller[_0x98db('0x10')]);router[_0x98db('0x11')](_0x98db('0xf'),auth[_0x98db('0x8')](),controller['destroy']);module[_0x98db('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index e9975bd..b9e0ad2 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd142=['sequelize','exports','STRING','ENUM','queue','DATE'];(function(_0x34d346,_0x4c6502){var _0x122d76=function(_0x22a5fd){while(--_0x22a5fd){_0x34d346['push'](_0x34d346['shift']());}};_0x122d76(++_0x4c6502);}(_0xd142,0x11a));var _0x2d14=function(_0x37eb5c,_0x477cc0){_0x37eb5c=_0x37eb5c-0x0;var _0x243e31=_0xd142[_0x37eb5c];return _0x243e31;};'use strict';var Sequelize=require(_0x2d14('0x0'));module[_0x2d14('0x1')]={'uniqueid':{'type':Sequelize[_0x2d14('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x2d14('0x3')]('account','agent',_0x2d14('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x2d14('0x5')]}}; \ No newline at end of file +var _0x02a7=['queue','DATE','exports','STRING','ENUM','account','agent'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x02a7,0x1a6));var _0x702a=function(_0x59e25f,_0x38eca9){_0x59e25f=_0x59e25f-0x0;var _0x4d8e8a=_0x02a7[_0x59e25f];return _0x4d8e8a;};'use strict';var Sequelize=require('sequelize');module[_0x702a('0x0')]={'uniqueid':{'type':Sequelize[_0x702a('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x702a('0x2')](_0x702a('0x3'),_0x702a('0x4'),_0x702a('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x702a('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index e06d4e4..963a243 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x89f4=['path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','reject','save','update','then','error','name','send','index','map','WhatsappTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','create','body','find','destroy','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util'];(function(_0x574347,_0x214e05){var _0x57f200=function(_0x539128){while(--_0x539128){_0x574347['push'](_0x574347['shift']());}};_0x57f200(++_0x214e05);}(_0x89f4,0x17a));var _0x489f=function(_0x4f8b10,_0x1a4093){_0x4f8b10=_0x4f8b10-0x0;var _0x2ff233=_0x89f4[_0x4f8b10];return _0x2ff233;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x489f('0x0'));var zipdir=require(_0x489f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x489f('0x2'));var moment=require(_0x489f('0x3'));var BPromise=require(_0x489f('0x4'));var Mustache=require(_0x489f('0x5'));var util=require(_0x489f('0x6'));var path=require(_0x489f('0x7'));var sox=require(_0x489f('0x8'));var csv=require(_0x489f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x489f('0xa'));var _=require(_0x489f('0xb'));var squel=require(_0x489f('0xc'));var crypto=require(_0x489f('0xd'));var jsforce=require(_0x489f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x489f('0x9'));var querystring=require(_0x489f('0xf'));var Papa=require(_0x489f('0x10'));var Redis=require(_0x489f('0x11'));var authService=require(_0x489f('0x12'));var qs=require(_0x489f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x489f('0x14'))(_0x489f('0x15'));var utils=require('../../config/utils');var config=require(_0x489f('0x16'));var licenseUtil=require(_0x489f('0x17'));var db=require(_0x489f('0x18'))['db'];function respondWithStatusCode(_0x271049,_0x3be6a9){_0x3be6a9=_0x3be6a9||0xcc;return function(_0x572ffe){if(_0x572ffe){return _0x271049[_0x489f('0x19')](_0x3be6a9);}return _0x271049[_0x489f('0x1a')](_0x3be6a9)[_0x489f('0x1b')]();};}function respondWithResult(_0x31a133,_0x22086e){_0x22086e=_0x22086e||0xc8;return function(_0x44d417){if(_0x44d417){return _0x31a133[_0x489f('0x1a')](_0x22086e)[_0x489f('0x1c')](_0x44d417);}};}function respondWithFilteredResult(_0x328334,_0x34e888){return function(_0x5eefa7){if(_0x5eefa7){var _0x299838=typeof _0x34e888['offset']===_0x489f('0x1d')&&typeof _0x34e888[_0x489f('0x1e')]===_0x489f('0x1d');var _0x245fac=_0x5eefa7['count'];var _0x5e5537=_0x299838?0x0:_0x34e888[_0x489f('0x1f')];var _0x3d77db=_0x299838?_0x5eefa7[_0x489f('0x20')]:_0x34e888['offset']+_0x34e888[_0x489f('0x1e')];var _0x568e45;if(_0x3d77db>=_0x245fac){_0x3d77db=_0x245fac;_0x568e45=0xc8;}else{_0x568e45=0xce;}_0x328334[_0x489f('0x1a')](_0x568e45);return _0x328334[_0x489f('0x21')]('Content-Range',_0x5e5537+'-'+_0x3d77db+'/'+_0x245fac)[_0x489f('0x1c')](_0x5eefa7);}return null;};}function patchUpdates(_0x56645c){return function(_0x3134f9){try{jsonpatch['apply'](_0x3134f9,_0x56645c,!![]);}catch(_0x4fd5e6){return BPromise[_0x489f('0x22')](_0x4fd5e6);}return _0x3134f9[_0x489f('0x23')]();};}function saveUpdates(_0x2d0609,_0x2e5d25){return function(_0xf9a150){if(_0xf9a150){return _0xf9a150[_0x489f('0x24')](_0x2d0609)['then'](function(_0x49decc){return _0x49decc;});}return null;};}function removeEntity(_0x43864f,_0x94471c){return function(_0x3fcb31){if(_0x3fcb31){return _0x3fcb31['destroy']()[_0x489f('0x25')](function(){_0x43864f[_0x489f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31bf27,_0x1b7cc1){return function(_0x12dd25){if(!_0x12dd25){_0x31bf27['sendStatus'](0x194);}return _0x12dd25;};}function handleError(_0x499169,_0x54ae02){_0x54ae02=_0x54ae02||0x1f4;return function(_0x38a658){logger[_0x489f('0x26')](_0x38a658['stack']);if(_0x38a658[_0x489f('0x27')]){delete _0x38a658[_0x489f('0x27')];}_0x499169[_0x489f('0x1a')](_0x54ae02)[_0x489f('0x28')](_0x38a658);};}exports[_0x489f('0x29')]=function(_0x2f03e6,_0x1cc7ae){var _0x57791c={},_0x426bc8={},_0x31e597={'count':0x0,'rows':[]};var _0x1ebc0c=_[_0x489f('0x2a')](db[_0x489f('0x2b')][_0x489f('0x2c')],function(_0xab32ed){return{'name':_0xab32ed[_0x489f('0x2d')],'type':_0xab32ed[_0x489f('0x2e')][_0x489f('0x2f')]};});_0x426bc8[_0x489f('0x30')]=_[_0x489f('0x2a')](_0x1ebc0c,'name');_0x426bc8[_0x489f('0x31')]=_[_0x489f('0x32')](_0x2f03e6[_0x489f('0x31')]);_0x426bc8[_0x489f('0x33')]=_[_0x489f('0x34')](_0x426bc8['model'],_0x426bc8['query']);_0x57791c[_0x489f('0x35')]=_[_0x489f('0x34')](_0x426bc8[_0x489f('0x30')],qs[_0x489f('0x36')](_0x2f03e6['query'][_0x489f('0x36')]));_0x57791c[_0x489f('0x35')]=_0x57791c[_0x489f('0x35')][_0x489f('0x37')]?_0x57791c['attributes']:_0x426bc8[_0x489f('0x30')];if(!_0x2f03e6[_0x489f('0x31')][_0x489f('0x38')](_0x489f('0x39'))){_0x57791c[_0x489f('0x1e')]=qs['limit'](_0x2f03e6['query'][_0x489f('0x1e')]);_0x57791c[_0x489f('0x1f')]=qs[_0x489f('0x1f')](_0x2f03e6[_0x489f('0x31')][_0x489f('0x1f')]);}_0x57791c[_0x489f('0x3a')]=qs['sort'](_0x2f03e6[_0x489f('0x31')][_0x489f('0x3b')]);_0x57791c['where']=qs[_0x489f('0x33')](_[_0x489f('0x3c')](_0x2f03e6[_0x489f('0x31')],_0x426bc8[_0x489f('0x33')]),_0x1ebc0c);if(_0x2f03e6['query']['filter']){_0x57791c['where']=_[_0x489f('0x3d')](_0x57791c[_0x489f('0x3e')],{'$or':_['map'](_0x1ebc0c,function(_0x120a12){if(_0x120a12['type']!==_0x489f('0x3f')){var _0x51981a={};_0x51981a[_0x120a12[_0x489f('0x27')]]={'$like':'%'+_0x2f03e6[_0x489f('0x31')][_0x489f('0x40')]+'%'};return _0x51981a;}})});}_0x57791c=_[_0x489f('0x3d')]({},_0x57791c,_0x2f03e6[_0x489f('0x41')]);var _0x2f2edc={'where':_0x57791c['where']};return db[_0x489f('0x2b')][_0x489f('0x20')](_0x2f2edc)['then'](function(_0x1f0dc6){_0x31e597[_0x489f('0x20')]=_0x1f0dc6;if(_0x2f03e6[_0x489f('0x31')][_0x489f('0x42')]){_0x57791c[_0x489f('0x43')]=[{'all':!![]}];}return db[_0x489f('0x2b')]['findAll'](_0x57791c);})[_0x489f('0x25')](function(_0x5b933c){_0x31e597[_0x489f('0x44')]=_0x5b933c;return _0x31e597;})[_0x489f('0x25')](respondWithFilteredResult(_0x1cc7ae,_0x57791c))[_0x489f('0x45')](handleError(_0x1cc7ae,null));};exports[_0x489f('0x46')]=function(_0x10669e,_0x5a1810){var _0x58eb30={'raw':!![],'where':{'id':_0x10669e[_0x489f('0x47')]['id']}},_0x23b9ea={};_0x23b9ea['model']=_['keys'](db[_0x489f('0x2b')]['rawAttributes']);_0x23b9ea[_0x489f('0x31')]=_[_0x489f('0x32')](_0x10669e['query']);_0x23b9ea['filters']=_[_0x489f('0x34')](_0x23b9ea[_0x489f('0x30')],_0x23b9ea['query']);_0x58eb30[_0x489f('0x35')]=_[_0x489f('0x34')](_0x23b9ea[_0x489f('0x30')],qs['fields'](_0x10669e[_0x489f('0x31')]['fields']));_0x58eb30[_0x489f('0x35')]=_0x58eb30['attributes'][_0x489f('0x37')]?_0x58eb30[_0x489f('0x35')]:_0x23b9ea[_0x489f('0x30')];if(_0x10669e['query'][_0x489f('0x42')]){_0x58eb30[_0x489f('0x43')]=[{'all':!![]}];}_0x58eb30=_[_0x489f('0x3d')]({},_0x58eb30,_0x10669e[_0x489f('0x41')]);return db[_0x489f('0x2b')]['find'](_0x58eb30)[_0x489f('0x25')](handleEntityNotFound(_0x5a1810,null))[_0x489f('0x25')](respondWithResult(_0x5a1810,null))[_0x489f('0x45')](handleError(_0x5a1810,null));};exports[_0x489f('0x48')]=function(_0x5a5431,_0x4e4814){return db[_0x489f('0x2b')][_0x489f('0x48')](_0x5a5431['body'],{})[_0x489f('0x25')](respondWithResult(_0x4e4814,0xc9))['catch'](handleError(_0x4e4814,null));};exports[_0x489f('0x24')]=function(_0x1f6ca4,_0x57446c){if(_0x1f6ca4['body']['id']){delete _0x1f6ca4[_0x489f('0x49')]['id'];}return db[_0x489f('0x2b')][_0x489f('0x4a')]({'where':{'id':_0x1f6ca4[_0x489f('0x47')]['id']}})[_0x489f('0x25')](handleEntityNotFound(_0x57446c,null))[_0x489f('0x25')](saveUpdates(_0x1f6ca4[_0x489f('0x49')],null))[_0x489f('0x25')](respondWithResult(_0x57446c,null))[_0x489f('0x45')](handleError(_0x57446c,null));};exports[_0x489f('0x4b')]=function(_0x42fae4,_0x2acc36){return db[_0x489f('0x2b')][_0x489f('0x4a')]({'where':{'id':_0x42fae4[_0x489f('0x47')]['id']}})[_0x489f('0x25')](handleEntityNotFound(_0x2acc36,null))[_0x489f('0x25')](removeEntity(_0x2acc36,null))['catch'](handleError(_0x2acc36,null));};exports['describe']=function(_0x4e248a,_0x5229f3){return db[_0x489f('0x2b')][_0x489f('0x4c')]()[_0x489f('0x25')](respondWithResult(_0x5229f3,null))[_0x489f('0x45')](handleError(_0x5229f3,null));}; \ No newline at end of file +var _0x0f23=['map','WhatsappTransferReport','type','key','keys','query','intersection','attributes','model','fields','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','show','params','length','catch','create','body','find','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','reject','update','destroy','then','error','name','send','index'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0x0f23,0xeb));var _0x30f2=function(_0xe3e0af,_0x4564ed){_0xe3e0af=_0xe3e0af-0x0;var _0x4828e9=_0x0f23[_0xe3e0af];return _0x4828e9;};'use strict';var emlformat=require(_0x30f2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x30f2('0x1'));var jsonpatch=require(_0x30f2('0x2'));var rp=require('request-promise');var moment=require(_0x30f2('0x3'));var BPromise=require(_0x30f2('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x30f2('0x5'));var sox=require(_0x30f2('0x6'));var csv=require(_0x30f2('0x7'));var ejs=require(_0x30f2('0x8'));var fs=require('fs');var fs_extra=require(_0x30f2('0x9'));var _=require(_0x30f2('0xa'));var squel=require('squel');var crypto=require(_0x30f2('0xb'));var jsforce=require(_0x30f2('0xc'));var deskjs=require(_0x30f2('0xd'));var toCsv=require('to-csv');var querystring=require(_0x30f2('0xe'));var Papa=require(_0x30f2('0xf'));var Redis=require(_0x30f2('0x10'));var authService=require(_0x30f2('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x30f2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x30f2('0x13'))(_0x30f2('0x14'));var utils=require(_0x30f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x30f2('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59d03d,_0x2ea303){_0x2ea303=_0x2ea303||0xcc;return function(_0xb8d418){if(_0xb8d418){return _0x59d03d[_0x30f2('0x17')](_0x2ea303);}return _0x59d03d['status'](_0x2ea303)[_0x30f2('0x18')]();};}function respondWithResult(_0x5a8372,_0x1e8a93){_0x1e8a93=_0x1e8a93||0xc8;return function(_0x4a7c1d){if(_0x4a7c1d){return _0x5a8372[_0x30f2('0x19')](_0x1e8a93)[_0x30f2('0x1a')](_0x4a7c1d);}};}function respondWithFilteredResult(_0x475131,_0x3af3f7){return function(_0x551cee){if(_0x551cee){var _0x106efa=typeof _0x3af3f7['offset']===_0x30f2('0x1b')&&typeof _0x3af3f7['limit']==='undefined';var _0x25c805=_0x551cee['count'];var _0x15d356=_0x106efa?0x0:_0x3af3f7['offset'];var _0xd2e0fc=_0x106efa?_0x551cee[_0x30f2('0x1c')]:_0x3af3f7[_0x30f2('0x1d')]+_0x3af3f7[_0x30f2('0x1e')];var _0x26d22e;if(_0xd2e0fc>=_0x25c805){_0xd2e0fc=_0x25c805;_0x26d22e=0xc8;}else{_0x26d22e=0xce;}_0x475131[_0x30f2('0x19')](_0x26d22e);return _0x475131[_0x30f2('0x1f')](_0x30f2('0x20'),_0x15d356+'-'+_0xd2e0fc+'/'+_0x25c805)[_0x30f2('0x1a')](_0x551cee);}return null;};}function patchUpdates(_0x416f2d){return function(_0x256934){try{jsonpatch['apply'](_0x256934,_0x416f2d,!![]);}catch(_0x280c7d){return BPromise[_0x30f2('0x21')](_0x280c7d);}return _0x256934['save']();};}function saveUpdates(_0x12dad7,_0x5d7d8d){return function(_0x4ff3b9){if(_0x4ff3b9){return _0x4ff3b9[_0x30f2('0x22')](_0x12dad7)['then'](function(_0x3e20c5){return _0x3e20c5;});}return null;};}function removeEntity(_0x3351a3,_0xb8f34e){return function(_0x2df4b1){if(_0x2df4b1){return _0x2df4b1[_0x30f2('0x23')]()[_0x30f2('0x24')](function(){_0x3351a3[_0x30f2('0x19')](0xcc)[_0x30f2('0x18')]();});}};}function handleEntityNotFound(_0x769376,_0x3e647b){return function(_0x202571){if(!_0x202571){_0x769376[_0x30f2('0x17')](0x194);}return _0x202571;};}function handleError(_0x562d89,_0x264036){_0x264036=_0x264036||0x1f4;return function(_0x57fbc1){logger[_0x30f2('0x25')](_0x57fbc1['stack']);if(_0x57fbc1['name']){delete _0x57fbc1[_0x30f2('0x26')];}_0x562d89[_0x30f2('0x19')](_0x264036)[_0x30f2('0x27')](_0x57fbc1);};}exports[_0x30f2('0x28')]=function(_0x512db0,_0x54fb90){var _0x315d12={},_0x230570={},_0x32fbcd={'count':0x0,'rows':[]};var _0x25f9c9=_[_0x30f2('0x29')](db[_0x30f2('0x2a')]['rawAttributes'],function(_0x303e03){return{'name':_0x303e03['fieldName'],'type':_0x303e03[_0x30f2('0x2b')][_0x30f2('0x2c')]};});_0x230570['model']=_[_0x30f2('0x29')](_0x25f9c9,_0x30f2('0x26'));_0x230570['query']=_[_0x30f2('0x2d')](_0x512db0[_0x30f2('0x2e')]);_0x230570['filters']=_[_0x30f2('0x2f')](_0x230570['model'],_0x230570['query']);_0x315d12[_0x30f2('0x30')]=_[_0x30f2('0x2f')](_0x230570[_0x30f2('0x31')],qs['fields'](_0x512db0['query'][_0x30f2('0x32')]));_0x315d12['attributes']=_0x315d12[_0x30f2('0x30')]['length']?_0x315d12[_0x30f2('0x30')]:_0x230570['model'];if(!_0x512db0[_0x30f2('0x2e')]['hasOwnProperty']('nolimit')){_0x315d12[_0x30f2('0x1e')]=qs['limit'](_0x512db0[_0x30f2('0x2e')][_0x30f2('0x1e')]);_0x315d12['offset']=qs[_0x30f2('0x1d')](_0x512db0['query'][_0x30f2('0x1d')]);}_0x315d12['order']=qs[_0x30f2('0x33')](_0x512db0[_0x30f2('0x2e')]['sort']);_0x315d12['where']=qs[_0x30f2('0x34')](_[_0x30f2('0x35')](_0x512db0[_0x30f2('0x2e')],_0x230570[_0x30f2('0x34')]),_0x25f9c9);if(_0x512db0[_0x30f2('0x2e')][_0x30f2('0x36')]){_0x315d12[_0x30f2('0x37')]=_['merge'](_0x315d12[_0x30f2('0x37')],{'$or':_[_0x30f2('0x29')](_0x25f9c9,function(_0x4dea35){if(_0x4dea35['type']!==_0x30f2('0x38')){var _0x39fcc0={};_0x39fcc0[_0x4dea35[_0x30f2('0x26')]]={'$like':'%'+_0x512db0[_0x30f2('0x2e')][_0x30f2('0x36')]+'%'};return _0x39fcc0;}})});}_0x315d12=_[_0x30f2('0x39')]({},_0x315d12,_0x512db0[_0x30f2('0x3a')]);var _0x2ea8f9={'where':_0x315d12[_0x30f2('0x37')]};return db[_0x30f2('0x2a')][_0x30f2('0x1c')](_0x2ea8f9)['then'](function(_0x1e5188){_0x32fbcd[_0x30f2('0x1c')]=_0x1e5188;if(_0x512db0['query'][_0x30f2('0x3b')]){_0x315d12[_0x30f2('0x3c')]=[{'all':!![]}];}return db[_0x30f2('0x2a')]['findAll'](_0x315d12);})[_0x30f2('0x24')](function(_0x2c4831){_0x32fbcd['rows']=_0x2c4831;return _0x32fbcd;})[_0x30f2('0x24')](respondWithFilteredResult(_0x54fb90,_0x315d12))['catch'](handleError(_0x54fb90,null));};exports[_0x30f2('0x3d')]=function(_0x29e1d5,_0x237602){var _0x2a087f={'raw':!![],'where':{'id':_0x29e1d5[_0x30f2('0x3e')]['id']}},_0x5521c0={};_0x5521c0['model']=_['keys'](db[_0x30f2('0x2a')]['rawAttributes']);_0x5521c0[_0x30f2('0x2e')]=_[_0x30f2('0x2d')](_0x29e1d5[_0x30f2('0x2e')]);_0x5521c0[_0x30f2('0x34')]=_[_0x30f2('0x2f')](_0x5521c0[_0x30f2('0x31')],_0x5521c0[_0x30f2('0x2e')]);_0x2a087f[_0x30f2('0x30')]=_[_0x30f2('0x2f')](_0x5521c0[_0x30f2('0x31')],qs[_0x30f2('0x32')](_0x29e1d5[_0x30f2('0x2e')][_0x30f2('0x32')]));_0x2a087f[_0x30f2('0x30')]=_0x2a087f['attributes'][_0x30f2('0x3f')]?_0x2a087f['attributes']:_0x5521c0[_0x30f2('0x31')];if(_0x29e1d5[_0x30f2('0x2e')][_0x30f2('0x3b')]){_0x2a087f[_0x30f2('0x3c')]=[{'all':!![]}];}_0x2a087f=_[_0x30f2('0x39')]({},_0x2a087f,_0x29e1d5['options']);return db[_0x30f2('0x2a')]['find'](_0x2a087f)[_0x30f2('0x24')](handleEntityNotFound(_0x237602,null))[_0x30f2('0x24')](respondWithResult(_0x237602,null))[_0x30f2('0x40')](handleError(_0x237602,null));};exports[_0x30f2('0x41')]=function(_0x5b0d2e,_0x11e49d){return db[_0x30f2('0x2a')][_0x30f2('0x41')](_0x5b0d2e['body'],{})['then'](respondWithResult(_0x11e49d,0xc9))[_0x30f2('0x40')](handleError(_0x11e49d,null));};exports['update']=function(_0x14f5b0,_0x4446a4){if(_0x14f5b0[_0x30f2('0x42')]['id']){delete _0x14f5b0['body']['id'];}return db['WhatsappTransferReport'][_0x30f2('0x43')]({'where':{'id':_0x14f5b0[_0x30f2('0x3e')]['id']}})['then'](handleEntityNotFound(_0x4446a4,null))['then'](saveUpdates(_0x14f5b0[_0x30f2('0x42')],null))['then'](respondWithResult(_0x4446a4,null))[_0x30f2('0x40')](handleError(_0x4446a4,null));};exports[_0x30f2('0x23')]=function(_0x244fd2,_0x527d15){return db[_0x30f2('0x2a')]['find']({'where':{'id':_0x244fd2[_0x30f2('0x3e')]['id']}})['then'](handleEntityNotFound(_0x527d15,null))['then'](removeEntity(_0x527d15,null))[_0x30f2('0x40')](handleError(_0x527d15,null));};exports[_0x30f2('0x44')]=function(_0x60226d,_0x9cb456){return db[_0x30f2('0x2a')][_0x30f2('0x44')]()[_0x30f2('0x24')](respondWithResult(_0x9cb456,null))['catch'](handleError(_0x9cb456,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 5ecda82..37b1737 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.model.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x447d=['rimraf','exports','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x25d263,_0x427584){var _0x30d528=function(_0x173651){while(--_0x173651){_0x25d263['push'](_0x25d263['shift']());}};_0x30d528(++_0x427584);}(_0x447d,0x93));var _0xd447=function(_0x1a013c,_0x5ac4d4){_0x1a013c=_0x1a013c-0x0;var _0x5947ec=_0x447d[_0x1a013c];return _0x5947ec;};'use strict';var _=require(_0xd447('0x0'));var util=require(_0xd447('0x1'));var logger=require(_0xd447('0x2'))(_0xd447('0x3'));var moment=require('moment');var BPromise=require(_0xd447('0x4'));var rp=require(_0xd447('0x5'));var fs=require('fs');var path=require(_0xd447('0x6'));var rimraf=require(_0xd447('0x7'));var config=require('../../config/environment');var attributes=require('./whatsappTransferReport.attributes');module[_0xd447('0x8')]=function(_0x385678,_0x197a58){return _0x385678['define']('WhatsappTransferReport',attributes,{'tableName':_0xd447('0x9'),'paranoid':![],'indexes':[{'name':_0xd447('0xa'),'fields':[_0xd447('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4149=['moment','bluebird','request-promise','exports','WhatsappTransferReport','uniqueid','lodash','util','../../config/logger','api'];(function(_0x57f660,_0x1bf6d7){var _0x5a866e=function(_0x5e0093){while(--_0x5e0093){_0x57f660['push'](_0x57f660['shift']());}};_0x5a866e(++_0x1bf6d7);}(_0x4149,0x1a0));var _0x9414=function(_0x4459fe,_0x42ca37){_0x4459fe=_0x4459fe-0x0;var _0x28ec7d=_0x4149[_0x4459fe];return _0x28ec7d;};'use strict';var _=require(_0x9414('0x0'));var util=require(_0x9414('0x1'));var logger=require(_0x9414('0x2'))(_0x9414('0x3'));var moment=require(_0x9414('0x4'));var BPromise=require(_0x9414('0x5'));var rp=require(_0x9414('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./whatsappTransferReport.attributes');module[_0x9414('0x7')]=function(_0x52e635,_0x44f5a3){return _0x52e635['define'](_0x9414('0x8'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0x9414('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 7321eb3..df53b36 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x11a1=['WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','../../config/utils','rpc','../../config/environment','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3c08b4,_0x52318d){var _0x5c200f=function(_0x2a416c){while(--_0x2a416c){_0x3c08b4['push'](_0x3c08b4['shift']());}};_0x5c200f(++_0x52318d);}(_0x11a1,0x196));var _0x111a=function(_0x1e7f5c,_0x52fe5a){_0x1e7f5c=_0x1e7f5c-0x0;var _0x19dc3f=_0x11a1[_0x1e7f5c];return _0x19dc3f;};'use strict';var _=require(_0x111a('0x0'));var util=require('util');var moment=require(_0x111a('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x111a('0x2'));var logger=require('../../config/logger')(_0x111a('0x3'));var config=require(_0x111a('0x4'));var jayson=require('jayson/promise');var client=jayson['client'][_0x111a('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x3f5abb,_0x3209c4,_0x3b57ff){return new BPromise(function(_0x221a8a,_0x252bc6){return client[_0x111a('0x6')](_0x3f5abb,_0x3b57ff)[_0x111a('0x7')](function(_0x10dad8){logger[_0x111a('0x8')](_0x111a('0x9'),_0x3209c4,_0x111a('0xa'));logger[_0x111a('0xb')](_0x111a('0xc'),_0x3209c4,_0x111a('0xa'),JSON[_0x111a('0xd')](_0x10dad8));if(_0x10dad8[_0x111a('0xe')]){if(_0x10dad8[_0x111a('0xe')][_0x111a('0xf')]===0x1f4){logger[_0x111a('0xe')](_0x111a('0x9'),_0x3209c4,_0x10dad8[_0x111a('0xe')][_0x111a('0x10')]);return _0x252bc6(_0x10dad8[_0x111a('0xe')][_0x111a('0x10')]);}logger[_0x111a('0xe')](_0x111a('0x9'),_0x3209c4,_0x10dad8[_0x111a('0xe')][_0x111a('0x10')]);return _0x221a8a(_0x10dad8[_0x111a('0xe')][_0x111a('0x10')]);}else{logger[_0x111a('0x8')](_0x111a('0x9'),_0x3209c4,_0x111a('0xa'));_0x221a8a(_0x10dad8[_0x111a('0x11')][_0x111a('0x10')]);}})[_0x111a('0x12')](function(_0x164a80){logger['error'](_0x111a('0x9'),_0x3209c4,_0x164a80);_0x252bc6(_0x164a80);});});} \ No newline at end of file +var _0x3d5e=['bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','info','WhatsappTransferReport,\x20%s,\x20%s','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment'];(function(_0x12960d,_0x5c5b5a){var _0x5860e6=function(_0x3e2af5){while(--_0x3e2af5){_0x12960d['push'](_0x12960d['shift']());}};_0x5860e6(++_0x5c5b5a);}(_0x3d5e,0x18d));var _0xe3d5=function(_0x32807d,_0x3934c8){_0x32807d=_0x32807d-0x0;var _0x16e4f6=_0x3d5e[_0x32807d];return _0x16e4f6;};'use strict';var _=require('lodash');var util=require(_0xe3d5('0x0'));var moment=require(_0xe3d5('0x1'));var BPromise=require(_0xe3d5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe3d5('0x3'));var db=require(_0xe3d5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe3d5('0x5'))('rpc');var config=require(_0xe3d5('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe3d5('0x7')][_0xe3d5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x181a17,_0x2d31c1,_0x5d2b9e){return new BPromise(function(_0x210581,_0x33b487){return client[_0xe3d5('0x9')](_0x181a17,_0x5d2b9e)['then'](function(_0x14ed46){logger[_0xe3d5('0xa')](_0xe3d5('0xb'),_0x2d31c1,'request\x20sent');logger['debug'](_0xe3d5('0xc'),_0x2d31c1,_0xe3d5('0xd'),JSON[_0xe3d5('0xe')](_0x14ed46));if(_0x14ed46['error']){if(_0x14ed46[_0xe3d5('0xf')][_0xe3d5('0x10')]===0x1f4){logger[_0xe3d5('0xf')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2d31c1,_0x14ed46['error'][_0xe3d5('0x11')]);return _0x33b487(_0x14ed46[_0xe3d5('0xf')]['message']);}logger[_0xe3d5('0xf')](_0xe3d5('0xb'),_0x2d31c1,_0x14ed46['error'][_0xe3d5('0x11')]);return _0x210581(_0x14ed46['error'][_0xe3d5('0x11')]);}else{logger[_0xe3d5('0xa')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2d31c1,'request\x20sent');_0x210581(_0x14ed46[_0xe3d5('0x12')]['message']);}})['catch'](function(_0x24b581){logger['error'](_0xe3d5('0xb'),_0x2d31c1,_0x24b581);_0x33b487(_0x24b581);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index c3f7bc5..d592ece 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6c32=['sync','then','seedDB','default','start','info','filter','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','online','name','status','log','App\x20Ready!','catch','error','exit','lodash','./config/seedDB','./rpc','./config/logger','app','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize'];(function(_0x5441e3,_0x5db97c){var _0x54d25d=function(_0x388d05){while(--_0x388d05){_0x5441e3['push'](_0x5441e3['shift']());}};_0x54d25d(++_0x5db97c);}(_0x6c32,0xb5));var _0x26c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c32[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x26c3('0x0'));var db=require('./mysqldb')['db'];var seedDb=require(_0x26c3('0x1'));var checkLicense=require('./config/license');var rpc=require(_0x26c3('0x2'));var config=require('./config/environment');var logger=require(_0x26c3('0x3'))(_0x26c3('0x4'));var pm2=require('./config/pm2');var pm2Config=require('./config/pm2/config');var schedule=require(_0x26c3('0x5'));var chat=require(_0x26c3('0x6'));var whatsapp=require(_0x26c3('0x7'));var transcribe=require(_0x26c3('0x8'));var provider=require(_0x26c3('0x9'));function main(){return db[_0x26c3('0xa')][_0x26c3('0xb')]()[_0x26c3('0xc')](function(){if(config[_0x26c3('0xd')]){return seedDb[_0x26c3('0xe')]();}})['then'](function(){return checkLicense['default']();})[_0x26c3('0xc')](function(){return rpc['listen']();})[_0x26c3('0xc')](function(_0xc6e3b4){logger['info'](_0xc6e3b4);return chat[_0x26c3('0xf')]();})[_0x26c3('0xc')](function(){return whatsapp[_0x26c3('0xf')]();})[_0x26c3('0xc')](function(){return schedule[_0x26c3('0xf')]();})['then'](function(){return transcribe[_0x26c3('0xf')]();})[_0x26c3('0xc')](function(){return provider[_0x26c3('0xf')]();})[_0x26c3('0xc')](function(_0x1ef1a9){logger[_0x26c3('0x10')](_0x1ef1a9);return pm2[_0x26c3('0xf')](pm2Config);})[_0x26c3('0xc')](function(_0x5443cd){var _0x554c06=_0x5443cd[_0x26c3('0x11')](function(_0xd612e7){return typeof _0xd612e7[_0x26c3('0x12')]===_0x26c3('0x13')&&_0xd612e7[_0x26c3('0x12')]>=0x0;});if(_0x554c06[_0x26c3('0x14')]>0x0){throw new Error(_0x554c06['length']+_0x26c3('0x15')+_[_0x26c3('0x16')](_0x554c06,function(_0x4db301){return'\x22'+_0x4db301[_0x26c3('0x17')]['name']+'\x22';}));}logger[_0x26c3('0x10')]('Online\x20apps:',_[_0x26c3('0x16')](_[_0x26c3('0x11')](_0x5443cd,{'status':_0x26c3('0x18')}),_0x26c3('0x19'))['join']());logger[_0x26c3('0x10')]('Offline\x20apps:',_[_0x26c3('0x16')](_['filter'](_0x5443cd,function(_0x1c77e6){return _0x1c77e6[_0x26c3('0x1a')]!==_0x26c3('0x18');}),'name')['join']()||'None');console[_0x26c3('0x1b')](_0x26c3('0x1c'));})[_0x26c3('0x1d')](function(_0x5a18c9){console[_0x26c3('0x1b')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x5a18c9);logger[_0x26c3('0x1e')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x5a18c9);process[_0x26c3('0x1f')](0x1);});}main(); \ No newline at end of file +var _0x1247=['./config/environment','./config/logger','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','then','default','listen','start','info','filter','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','online','join','Offline\x20apps:','status','None','log','App\x20Ready!','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','./rpc'];(function(_0x180561,_0x1e208b){var _0x2b3997=function(_0x54076f){while(--_0x54076f){_0x180561['push'](_0x180561['shift']());}};_0x2b3997(++_0x1e208b);}(_0x1247,0xb6));var _0x7124=function(_0x4991d6,_0x348deb){_0x4991d6=_0x4991d6-0x0;var _0x50faf7=_0x1247[_0x4991d6];return _0x50faf7;};'use strict';var _=require(_0x7124('0x0'));var db=require(_0x7124('0x1'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require('./config/license');var rpc=require(_0x7124('0x2'));var config=require(_0x7124('0x3'));var logger=require(_0x7124('0x4'))('app');var pm2=require(_0x7124('0x5'));var pm2Config=require(_0x7124('0x6'));var schedule=require(_0x7124('0x7'));var chat=require(_0x7124('0x8'));var whatsapp=require(_0x7124('0x9'));var transcribe=require(_0x7124('0xa'));var provider=require(_0x7124('0xb'));function main(){return db[_0x7124('0xc')][_0x7124('0xd')]()[_0x7124('0xe')](function(){if(config['seedDB']){return seedDb[_0x7124('0xf')]();}})[_0x7124('0xe')](function(){return checkLicense[_0x7124('0xf')]();})[_0x7124('0xe')](function(){return rpc[_0x7124('0x10')]();})[_0x7124('0xe')](function(_0x84e46c){logger['info'](_0x84e46c);return chat[_0x7124('0x11')]();})['then'](function(){return whatsapp[_0x7124('0x11')]();})[_0x7124('0xe')](function(){return schedule[_0x7124('0x11')]();})[_0x7124('0xe')](function(){return transcribe['start']();})[_0x7124('0xe')](function(){return provider[_0x7124('0x11')]();})['then'](function(_0x594df8){logger[_0x7124('0x12')](_0x594df8);return pm2[_0x7124('0x11')](pm2Config);})[_0x7124('0xe')](function(_0x1b5e06){var _0x3d0f8e=_0x1b5e06[_0x7124('0x13')](function(_0x334112){return typeof _0x334112[_0x7124('0x14')]===_0x7124('0x15')&&_0x334112[_0x7124('0x14')]>=0x0;});if(_0x3d0f8e[_0x7124('0x16')]>0x0){throw new Error(_0x3d0f8e[_0x7124('0x16')]+_0x7124('0x17')+_[_0x7124('0x18')](_0x3d0f8e,function(_0x2df549){return'\x22'+_0x2df549[_0x7124('0x19')][_0x7124('0x1a')]+'\x22';}));}logger[_0x7124('0x12')](_0x7124('0x1b'),_[_0x7124('0x18')](_[_0x7124('0x13')](_0x1b5e06,{'status':_0x7124('0x1c')}),_0x7124('0x1a'))[_0x7124('0x1d')]());logger[_0x7124('0x12')](_0x7124('0x1e'),_[_0x7124('0x18')](_[_0x7124('0x13')](_0x1b5e06,function(_0x28b836){return _0x28b836[_0x7124('0x1f')]!==_0x7124('0x1c');}),'name')[_0x7124('0x1d')]()||_0x7124('0x20'));console[_0x7124('0x21')](_0x7124('0x22'));})['catch'](function(_0x2e7be6){console['log'](_0x7124('0x23'),_0x2e7be6);logger['error'](_0x7124('0x24'),_0x2e7be6);process['exit'](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 92416f2..0725eb8 100644 --- a/server/components/auth/service.js +++ b/server/components/auth/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed3c=['join','promisify','sign','secret','secrets','session','payload','options','verify','randomBytes','toString','hex','floor','now','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','lodash','jsonwebtoken','express-jwt','crypto','bluebird','util','moment','fullname','userpic','permissions','md5secret','voicePause','chatPause','faxPause','smsPause','openchannelPause','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','settingsEnabled','downloadVoiceRecordings','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','whatsappAutoanswerDelay','messengerSoundNotification','isChatInteractionAuthorized','use','user','ChatInteraction','findOne','params','disposition','then','closed','unmanaged','json','catch','isAuthenticated','headers','authorization','startsWith','User','find','name','authenticate','pass','status','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','apikey','getUuid','query','sub','Setting','blockDuration','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','minutes','canUpdate','getLicense','update','Forbidden','isWebrtcLicence','isMiddleware','signToken','setTokenCookie','role','cookie','motion.token','redirect','/dashboards/general','send','isNil','apiKeyNonce','generateApiKey','apiKeyIat','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','splice','unshift','encryptString'];(function(_0x44257e,_0x428c8f){var _0x185d78=function(_0x12e293){while(--_0x12e293){_0x44257e['push'](_0x44257e['shift']());}};_0x185d78(++_0x428c8f);}(_0xed3c,0x1a6));var _0xced3=function(_0x49f30e,_0xf28439){_0x49f30e=_0x49f30e-0x0;var _0x2cafd5=_0xed3c[_0x49f30e];return _0x2cafd5;};'use strict';var db=require(_0xced3('0x0'))['db'];var config=require(_0xced3('0x1'));var hardwareConf=require(_0xced3('0x2'));var licenseUtil=require(_0xced3('0x3'));var encryptor=require('../encryptor');var _=require(_0xced3('0x4'));var jwt=require(_0xced3('0x5'));var expressJwt=require(_0xced3('0x6'));var compose=require('composable-middleware');var basicAuth=require('basic-auth');var crypto=require(_0xced3('0x7'));var BPromise=require(_0xced3('0x8'));var util=require(_0xced3('0x9'));var moment=require(_0xced3('0xa'));var validateJwt=expressJwt({'secret':config['secrets']['session']});var userAttributes=['id','role',_0xced3('0xb'),'name','internal','email',_0xced3('0xc'),_0xced3('0xd'),_0xced3('0xe'),_0xced3('0xf'),_0xced3('0x10'),'mailPause',_0xced3('0x11'),_0xced3('0x12'),_0xced3('0x13'),'pauseType',_0xced3('0x14'),_0xced3('0x15'),_0xced3('0x16'),_0xced3('0x17'),_0xced3('0x18'),_0xced3('0x19'),_0xced3('0x1a'),'phoneBarAutoAnswer',_0xced3('0x1b'),'phoneBarDnd',_0xced3('0x1c'),_0xced3('0x1d'),_0xced3('0x1e'),_0xced3('0x1f'),'phoneBarPrefixRequired',_0xced3('0x20'),_0xced3('0x21'),'hotdesk',_0xced3('0x22'),_0xced3('0x23'),_0xced3('0x24'),_0xced3('0x25'),'wssPort',_0xced3('0x26'),'downloadOmnichannelInteractions',_0xced3('0x27'),_0xced3('0x28'),_0xced3('0x29'),_0xced3('0x2a'),_0xced3('0x2b'),_0xced3('0x2c'),_0xced3('0x2d'),_0xced3('0x2e'),_0xced3('0x2f'),_0xced3('0x30'),_0xced3('0x31'),'faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer',_0xced3('0x32'),_0xced3('0x33')];exports[_0xced3('0x34')]=function(){return this['isAuthenticated'](!![])[_0xced3('0x35')](function(_0x30d984,_0x526854,_0x559fa2){if(_0x30d984[_0xced3('0x36')]){_0x559fa2();}else{return db[_0xced3('0x37')][_0xced3('0x38')]({'where':{'id':_0x30d984[_0xced3('0x39')]['id']},'attributes':['id','closed',_0xced3('0x3a')],'raw':!![]})[_0xced3('0x3b')](function(_0x4fc285){if(_0x4fc285&&_0x4fc285[_0xced3('0x3c')]){return _0x526854['status'](_0x4fc285[_0xced3('0x3a')]===_0xced3('0x3d')?0x195:0x193)[_0xced3('0x3e')]({'message':_0x4fc285[_0xced3('0x3a')]===_0xced3('0x3d')?'Unmanaged.':'Forbidden.'});}else{_0x559fa2();}})[_0xced3('0x3f')](function(_0x5bb425){_0x559fa2(_0x5bb425);});}});};exports[_0xced3('0x40')]=function isAuthenticated(_0x1e6923){return compose()['use'](function(_0x3db664,_0x4024fa,_0x196956){var _0x1032d6;if(_0x3db664[_0xced3('0x41')][_0xced3('0x42')]){if(_[_0xced3('0x43')](_0x3db664[_0xced3('0x41')][_0xced3('0x42')],'Basic')){var _0xa78899=basicAuth(_0x3db664);db[_0xced3('0x44')][_0xced3('0x45')]({'where':{'name':_0xa78899[_0xced3('0x46')]}})[_0xced3('0x3b')](function(_0x21e4a2){if(!_0x21e4a2||!_0x21e4a2[_0xced3('0x47')](_0xa78899[_0xced3('0x48')])){return _0x4024fa[_0xced3('0x49')](0x191)[_0xced3('0x3e')]({'message':_0xced3('0x4a')});}_0x3db664[_0xced3('0x36')]={'id':_0x21e4a2['id']};_0x196956();})[_0xced3('0x3f')](function(_0x407a24){_0x196956(_0x407a24);});}else if(_[_0xced3('0x43')](_0x3db664[_0xced3('0x41')][_0xced3('0x42')],_0xced3('0x4b'))){validateJwt(_0x3db664,_0x4024fa,_0x196956);}else{if(_0x1e6923){_0x196956();}else{return _0x4024fa[_0xced3('0x49')](0x193)[_0xced3('0x3e')]({'message':_0xced3('0x4c')});}}}else if(_0x3db664['query'][_0xced3('0x4d')]){try{var _0x55e3ac={'audience':hardwareConf[_0xced3('0x4e')](),'issuer':hardwareConf[_0xced3('0x4e')]()};verifyJwt(_0x3db664[_0xced3('0x4f')][_0xced3('0x4d')],_0x55e3ac)[_0xced3('0x3b')](function(_0xefac3d){return db[_0xced3('0x44')][_0xced3('0x45')]({'where':{'id':_0xefac3d[_0xced3('0x50')]}})[_0xced3('0x3b')](function(_0x5c290d){_0x1032d6=_0x5c290d;return db[_0xced3('0x51')][_0xced3('0x38')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xced3('0x52')],'raw':!![]});})[_0xced3('0x3b')](function(_0x1b5956){if(!_0x1032d6||!_['isEqual'](_0x1032d6['apiKeyNonce'],_0xefac3d[_0xced3('0x53')])){return _0x4024fa['status'](0x191)[_0xced3('0x3e')]({'message':_0xced3('0x54')});}if(_0x1032d6['disabled']){return _0x4024fa[_0xced3('0x49')](0x191)[_0xced3('0x3e')]({'message':_0xced3('0x55')});}if(_0x1032d6['blocked']){if(_0x1b5956[_0xced3('0x52')]>0x0){if(moment(_0x1032d6['blockedAt'])['add'](_0x1b5956[_0xced3('0x52')],_0xced3('0x56'))>moment()){return _0x4024fa[_0xced3('0x49')](0x191)['json']({'message':_0xced3('0x55')});}}else{return _0x4024fa[_0xced3('0x49')](0x191)[_0xced3('0x3e')]({'message':_0xced3('0x55')});}}_0x3db664[_0xced3('0x36')]={'id':_0x1032d6['id']};_0x196956();});})[_0xced3('0x3f')](function(){return _0x4024fa[_0xced3('0x49')](0x191)[_0xced3('0x3e')]({'message':_0xced3('0x55')});});}catch(_0x3eca11){_0x196956(_0x3eca11);}}else if(_0x1e6923){_0x196956();}else{return _0x4024fa[_0xced3('0x49')](0x193)[_0xced3('0x3e')]({'message':_0xced3('0x4c')});}})[_0xced3('0x35')](function(_0x1ced3a,_0x489546,_0x4279a3){if(_0x1ced3a[_0xced3('0x36')]){db[_0xced3('0x44')][_0xced3('0x45')]({'where':{'id':_0x1ced3a[_0xced3('0x36')]['id']},'attributes':userAttributes})[_0xced3('0x3b')](function(_0x145157){if(!_0x145157){return _0x489546[_0xced3('0x49')](0x194)[_0xced3('0x3e')]({'message':'User\x20not\x20found.'});}_0x1ced3a[_0xced3('0x36')]=_0x145157;_0x4279a3();})['catch'](function(_0x5f4599){_0x4279a3(_0x5f4599);});}else if(_0x1e6923){_0x4279a3();}else{return _0x489546[_0xced3('0x49')](0x194)[_0xced3('0x3e')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0xced3('0x57')]=function canUpdate(){return compose()[_0xced3('0x35')](function(_0x3569f3,_0x26b8ac,_0x5373ab){return licenseUtil[_0xced3('0x58')]()[_0xced3('0x3b')](function(_0xbf8cbc){if(_0xbf8cbc[_0xced3('0x59')]){_0x5373ab();}else{return _0x26b8ac[_0xced3('0x49')](0x193)['json']({'message':_0xced3('0x5a')});}})[_0xced3('0x3f')](function(_0x1dced4){_0x5373ab(_0x1dced4);});});};exports[_0xced3('0x5b')]=function isWebrtcLicence(){return compose()[_0xced3('0x35')](function(_0x740743,_0x3fa9fd,_0x532db9){return licenseUtil[_0xced3('0x58')]()[_0xced3('0x3b')](function(_0x4804e3){if(_0x4804e3['webrtc']){_0x532db9();}else{return _0x3fa9fd[_0xced3('0x49')](0x193)['json']({'message':_0xced3('0x5a')});}})[_0xced3('0x3f')](function(_0x33441c){_0x532db9(_0x33441c);});});};exports[_0xced3('0x5c')]=function(_0x2c70e3,_0x1b3396,_0x3700ed){_0x2c70e3[_0xced3('0x5c')]=!![];return _0x3700ed();};exports[_0xced3('0x5d')]=function signToken(_0x5b3529){return signJwt(_0x5b3529);};exports[_0xced3('0x5e')]=function(_0x8df206,_0x2aa876){if(!_0x8df206[_0xced3('0x36')]){return _0x2aa876[_0xced3('0x49')](0x194)[_0xced3('0x3e')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x420b90={'payload':{'id':_0x8df206[_0xced3('0x36')]['id'],'role':_0x8df206[_0xced3('0x36')][_0xced3('0x5f')]},'options':{'expiresIn':0x15180}};return signJwt(_0x420b90)[_0xced3('0x3b')](function(_0x14dbfe){_0x2aa876[_0xced3('0x60')](_0xced3('0x61'),_0x14dbfe);_0x2aa876[_0xced3('0x62')](_0xced3('0x63'));})[_0xced3('0x3f')](function(_0x3e2a19){return _0x2aa876['status'](0x1f4)[_0xced3('0x64')](_0x3e2a19);});};exports['retrieveApiKey']=function(_0x466ffb){if(_[_0xced3('0x65')](_0x466ffb[_0xced3('0x66')])||_['isNil'](_0x466ffb['apiKeyIat'])){return null;}else{return createJwt(_0x466ffb);}};exports[_0xced3('0x67')]=function(_0x219a11){_0x219a11['apiKeyNonce']=generateNonce();_0x219a11[_0xced3('0x68')]=generateIssuedAt();return createJwt(_0x219a11);};exports['regenerateApiKey']=function(_0x3dba69,_0x3f9582){var _0x4f1860=_0x3dba69[_0xced3('0x4f')][_0xced3('0x4d')];if(_0x4f1860){var _0xf4d7bf={'nonce':_0x3f9582['apiKeyNonce'],'iat':_0x3f9582[_0xced3('0x68')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xced3('0x4e')]()};return verifyJwt(_0x4f1860,_0xf4d7bf)[_0xced3('0x3b')](function(){return generateApiKey(_0x3f9582);});}else{throw{'message':_0xced3('0x69')};}};exports[_0xced3('0x6a')]=function(_0x1c17a8){var _0xd3c7b9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0xd3c7b9[_0xced3('0x6b')](_0x1c17a8))throw new db[(_0xced3('0x6c'))][(_0xced3('0x6d'))](_0xced3('0x6e'));return;};exports[_0xced3('0x6f')]=function(_0x4b14dd,_0x3859e8,_0x3de35d){var _0x40a2a2=encryptor[_0xced3('0x70')](_0x3859e8)[_0xced3('0x71')](',');for(var _0xbad036=0x0;_0xbad036<_0x3de35d;_0xbad036++){if(!_0x40a2a2[_0xbad036])break;if(_0x4b14dd['toLowerCase']()===_0x40a2a2[_0xbad036][_0xced3('0x72')]()){var _0x171081=util[_0xced3('0x73')](_0xced3('0x74'),_0x3de35d);if(_0x3de35d===0x1){_0x171081=_0xced3('0x75');}throw new db[(_0xced3('0x6c'))]['ValidationError'](_0x171081);}}return;};exports[_0xced3('0x76')]=function(_0x53844d,_0xc0cd87){var _0x5d9813=_0xc0cd87?encryptor[_0xced3('0x70')](_0xc0cd87)[_0xced3('0x71')](','):[];if(_0x5d9813['length']===0x5){_0x5d9813[_0xced3('0x77')](-0x1,0x1);}_0x5d9813[_0xced3('0x78')](_0x53844d);return encryptor[_0xced3('0x79')](_0x5d9813[_0xced3('0x7a')](','));};function signJwt(_0x1ec94b){var _0x21eeec=BPromise[_0xced3('0x7b')](jwt[_0xced3('0x7c')],{'context':jwt});var _0x18fe01=_0x1ec94b[_0xced3('0x7d')]||config[_0xced3('0x7e')][_0xced3('0x7f')];return new BPromise(function(_0x38033f,_0x4dea99){_0x21eeec(_0x1ec94b[_0xced3('0x80')],_0x18fe01,_0x1ec94b[_0xced3('0x81')])[_0xced3('0x3b')](function(_0x353a8e){_0x38033f(_0x353a8e);})['catch'](function(_0x463ca4){_0x4dea99(_0x463ca4);});});}function verifyJwt(_0x979b24,_0x404241,_0x373f31){var _0x2a62f5=BPromise[_0xced3('0x7b')](jwt[_0xced3('0x82')],{'context':jwt});var _0x4df923=_0x373f31||config[_0xced3('0x7e')][_0xced3('0x7f')];return new BPromise(function(_0x5db4eb,_0x1630d7){_0x2a62f5(_0x979b24,_0x4df923,_0x404241)[_0xced3('0x3b')](function(_0x3a9dac){_0x5db4eb(_0x3a9dac);})[_0xced3('0x3f')](function(_0x58d7fc){_0x1630d7(_0x58d7fc);});});}function generateNonce(){return crypto[_0xced3('0x83')](0x10)[_0xced3('0x84')](_0xced3('0x85'));}function generateIssuedAt(){return Math[_0xced3('0x86')](Date[_0xced3('0x87')]()/0x3e8)[_0xced3('0x84')]();}function createJwt(_0x236445){var _0x3ad0e7={'payload':{'iat':_0x236445[_0xced3('0x68')],'nonce':_0x236445[_0xced3('0x66')]},'options':{'algorithm':'HS512','subject':_0x236445['id'][_0xced3('0x84')](),'issuer':hardwareConf[_0xced3('0x4e')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x3ad0e7)['then'](function(_0xbec2b7){return{'iat':_0x236445['apiKeyIat'],'nonce':_0x236445[_0xced3('0x66')],'token':_0xbec2b7};});} \ No newline at end of file +var _0x0972=['allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableSettings','phoneBarExpires','hotdesk','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','openchannelAutoanswerDelay','faxAutoanswerDelay','whatsappAutoanswer','messengerSoundNotification','isAuthenticated','use','user','findOne','closed','disposition','then','status','json','unmanaged','Forbidden.','catch','authorization','startsWith','Basic','User','find','authenticate','Wrong\x20credentials.','headers','Unknown\x20authorization\x20format','apikey','getUuid','sub','allowedLoginAttempts','blockDuration','isEqual','nonce','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','canUpdate','update','Forbidden','webrtc','signToken','cookie','motion.token','/dashboards/general','send','isNil','apiKeyNonce','apiKeyIat','generateApiKey','regenerateApiKey','query','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','ValidationError','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','length','splice','unshift','encryptString','join','promisify','sign','secret','session','payload','randomBytes','floor','now','toString','HS512','../../config/environment','../../config/license/util','lodash','jsonwebtoken','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','role','fullname','name','internal','email','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions'];(function(_0x5ad771,_0x34186f){var _0x5b5dce=function(_0x5ad0fb){while(--_0x5ad0fb){_0x5ad771['push'](_0x5ad771['shift']());}};_0x5b5dce(++_0x34186f);}(_0x0972,0x64));var _0x2097=function(_0x3a5d56,_0x1d826f){_0x3a5d56=_0x3a5d56-0x0;var _0x261582=_0x0972[_0x3a5d56];return _0x261582;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0x2097('0x0'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0x2097('0x1'));var encryptor=require('../encryptor');var _=require(_0x2097('0x2'));var jwt=require(_0x2097('0x3'));var expressJwt=require('express-jwt');var compose=require(_0x2097('0x4'));var basicAuth=require(_0x2097('0x5'));var crypto=require(_0x2097('0x6'));var BPromise=require(_0x2097('0x7'));var util=require(_0x2097('0x8'));var moment=require(_0x2097('0x9'));var validateJwt=expressJwt({'secret':config[_0x2097('0xa')]['session']});var userAttributes=['id',_0x2097('0xb'),_0x2097('0xc'),_0x2097('0xd'),_0x2097('0xe'),_0x2097('0xf'),'userpic',_0x2097('0x10'),_0x2097('0x11'),_0x2097('0x12'),_0x2097('0x13'),_0x2097('0x14'),_0x2097('0x15'),_0x2097('0x16'),_0x2097('0x17'),_0x2097('0x18'),_0x2097('0x19'),_0x2097('0x1a'),_0x2097('0x1b'),_0x2097('0x1c'),_0x2097('0x1d'),_0x2097('0x1e'),_0x2097('0x1f'),_0x2097('0x20'),_0x2097('0x21'),_0x2097('0x22'),_0x2097('0x23'),'phoneBarEnableDtmfTone',_0x2097('0x24'),_0x2097('0x25'),'phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort',_0x2097('0x26'),'interface',_0x2097('0x27'),_0x2097('0x28'),_0x2097('0x29'),_0x2097('0x2a'),_0x2097('0x2b'),'downloadOmnichannelInteractions',_0x2097('0x2c'),_0x2097('0x2d'),_0x2097('0x2e'),_0x2097('0x2f'),_0x2097('0x30'),_0x2097('0x31'),_0x2097('0x32'),_0x2097('0x33'),'smsAutoanswerDelay','openchannelAutoanswer',_0x2097('0x34'),'faxAutoanswer',_0x2097('0x35'),_0x2097('0x36'),'whatsappAutoanswerDelay',_0x2097('0x37')];exports['isChatInteractionAuthorized']=function(){return this[_0x2097('0x38')](!![])[_0x2097('0x39')](function(_0x36189e,_0x20b93a,_0x36b15e){if(_0x36189e[_0x2097('0x3a')]){_0x36b15e();}else{return db['ChatInteraction'][_0x2097('0x3b')]({'where':{'id':_0x36189e['params']['id']},'attributes':['id',_0x2097('0x3c'),_0x2097('0x3d')],'raw':!![]})[_0x2097('0x3e')](function(_0x9f59bc){if(_0x9f59bc&&_0x9f59bc['closed']){return _0x20b93a[_0x2097('0x3f')](_0x9f59bc[_0x2097('0x3d')]==='unmanaged'?0x195:0x193)[_0x2097('0x40')]({'message':_0x9f59bc['disposition']===_0x2097('0x41')?'Unmanaged.':_0x2097('0x42')});}else{_0x36b15e();}})[_0x2097('0x43')](function(_0x407a2a){_0x36b15e(_0x407a2a);});}});};exports[_0x2097('0x38')]=function isAuthenticated(_0x410afa){return compose()[_0x2097('0x39')](function(_0x450e0b,_0x4b443d,_0x11242f){var _0x14d964;if(_0x450e0b['headers'][_0x2097('0x44')]){if(_[_0x2097('0x45')](_0x450e0b['headers']['authorization'],_0x2097('0x46'))){var _0x11b051=basicAuth(_0x450e0b);db[_0x2097('0x47')][_0x2097('0x48')]({'where':{'name':_0x11b051[_0x2097('0xd')]}})[_0x2097('0x3e')](function(_0x56c538){if(!_0x56c538||!_0x56c538[_0x2097('0x49')](_0x11b051['pass'])){return _0x4b443d[_0x2097('0x3f')](0x191)[_0x2097('0x40')]({'message':_0x2097('0x4a')});}_0x450e0b[_0x2097('0x3a')]={'id':_0x56c538['id']};_0x11242f();})[_0x2097('0x43')](function(_0x395d9f){_0x11242f(_0x395d9f);});}else if(_[_0x2097('0x45')](_0x450e0b[_0x2097('0x4b')][_0x2097('0x44')],'Bearer')){validateJwt(_0x450e0b,_0x4b443d,_0x11242f);}else{if(_0x410afa){_0x11242f();}else{return _0x4b443d[_0x2097('0x3f')](0x193)[_0x2097('0x40')]({'message':_0x2097('0x4c')});}}}else if(_0x450e0b['query'][_0x2097('0x4d')]){try{var _0x3bda50={'audience':hardwareConf[_0x2097('0x4e')](),'issuer':hardwareConf[_0x2097('0x4e')]()};verifyJwt(_0x450e0b['query']['apikey'],_0x3bda50)['then'](function(_0x3484ff){return db[_0x2097('0x47')][_0x2097('0x48')]({'where':{'id':_0x3484ff[_0x2097('0x4f')]}})[_0x2097('0x3e')](function(_0x296281){_0x14d964=_0x296281;return db['Setting'][_0x2097('0x3b')]({'where':{'id':0x1},'attributes':[_0x2097('0x50'),_0x2097('0x51')],'raw':!![]});})[_0x2097('0x3e')](function(_0x25375f){if(!_0x14d964||!_[_0x2097('0x52')](_0x14d964['apiKeyNonce'],_0x3484ff[_0x2097('0x53')])){return _0x4b443d[_0x2097('0x3f')](0x191)[_0x2097('0x40')]({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x14d964['disabled']){return _0x4b443d[_0x2097('0x3f')](0x191)[_0x2097('0x40')]({'message':_0x2097('0x54')});}if(_0x14d964[_0x2097('0x55')]){if(_0x25375f[_0x2097('0x51')]>0x0){if(moment(_0x14d964[_0x2097('0x56')])[_0x2097('0x57')](_0x25375f[_0x2097('0x51')],_0x2097('0x58'))>moment()){return _0x4b443d[_0x2097('0x3f')](0x191)[_0x2097('0x40')]({'message':_0x2097('0x54')});}}else{return _0x4b443d['status'](0x191)[_0x2097('0x40')]({'message':_0x2097('0x54')});}}_0x450e0b[_0x2097('0x3a')]={'id':_0x14d964['id']};_0x11242f();});})['catch'](function(){return _0x4b443d[_0x2097('0x3f')](0x191)[_0x2097('0x40')]({'message':_0x2097('0x54')});});}catch(_0xf9fba7){_0x11242f(_0xf9fba7);}}else if(_0x410afa){_0x11242f();}else{return _0x4b443d[_0x2097('0x3f')](0x193)[_0x2097('0x40')]({'message':_0x2097('0x4c')});}})[_0x2097('0x39')](function(_0x5ab893,_0x11c825,_0x283adc){if(_0x5ab893[_0x2097('0x3a')]){db[_0x2097('0x47')][_0x2097('0x48')]({'where':{'id':_0x5ab893[_0x2097('0x3a')]['id']},'attributes':userAttributes})[_0x2097('0x3e')](function(_0x280ecd){if(!_0x280ecd){return _0x11c825['status'](0x194)[_0x2097('0x40')]({'message':'User\x20not\x20found.'});}_0x5ab893[_0x2097('0x3a')]=_0x280ecd;_0x283adc();})[_0x2097('0x43')](function(_0x370cc6){_0x283adc(_0x370cc6);});}else if(_0x410afa){_0x283adc();}else{return _0x11c825[_0x2097('0x3f')](0x194)[_0x2097('0x40')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x2097('0x59')]=function canUpdate(){return compose()[_0x2097('0x39')](function(_0x113c3b,_0x39e0a4,_0x1e04f8){return licenseUtil['getLicense']()[_0x2097('0x3e')](function(_0x37cdb9){if(_0x37cdb9[_0x2097('0x5a')]){_0x1e04f8();}else{return _0x39e0a4[_0x2097('0x3f')](0x193)[_0x2097('0x40')]({'message':_0x2097('0x5b')});}})[_0x2097('0x43')](function(_0x40ec03){_0x1e04f8(_0x40ec03);});});};exports['isWebrtcLicence']=function isWebrtcLicence(){return compose()[_0x2097('0x39')](function(_0x594804,_0x305657,_0xfe13c8){return licenseUtil['getLicense']()['then'](function(_0x4b6331){if(_0x4b6331[_0x2097('0x5c')]){_0xfe13c8();}else{return _0x305657[_0x2097('0x3f')](0x193)['json']({'message':_0x2097('0x5b')});}})[_0x2097('0x43')](function(_0x5daafd){_0xfe13c8(_0x5daafd);});});};exports['isMiddleware']=function(_0x23acf3,_0x21829d,_0x1b4de6){_0x23acf3['isMiddleware']=!![];return _0x1b4de6();};exports[_0x2097('0x5d')]=function signToken(_0x2881f8){return signJwt(_0x2881f8);};exports['setTokenCookie']=function(_0x86a05a,_0x2682a9){if(!_0x86a05a[_0x2097('0x3a')]){return _0x2682a9[_0x2097('0x3f')](0x194)[_0x2097('0x40')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x5127d9={'payload':{'id':_0x86a05a[_0x2097('0x3a')]['id'],'role':_0x86a05a[_0x2097('0x3a')][_0x2097('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0x5127d9)['then'](function(_0x5c1739){_0x2682a9[_0x2097('0x5e')](_0x2097('0x5f'),_0x5c1739);_0x2682a9['redirect'](_0x2097('0x60'));})[_0x2097('0x43')](function(_0x12bdbd){return _0x2682a9[_0x2097('0x3f')](0x1f4)[_0x2097('0x61')](_0x12bdbd);});};exports['retrieveApiKey']=function(_0x42b222){if(_[_0x2097('0x62')](_0x42b222[_0x2097('0x63')])||_['isNil'](_0x42b222[_0x2097('0x64')])){return null;}else{return createJwt(_0x42b222);}};exports[_0x2097('0x65')]=function(_0x4edf1d){_0x4edf1d[_0x2097('0x63')]=generateNonce();_0x4edf1d['apiKeyIat']=generateIssuedAt();return createJwt(_0x4edf1d);};exports[_0x2097('0x66')]=function(_0x56a0d1,_0x48742a){var _0x5d4f35=_0x56a0d1[_0x2097('0x67')]['apikey'];if(_0x5d4f35){var _0x54bea1={'nonce':_0x48742a[_0x2097('0x63')],'iat':_0x48742a['apiKeyIat'],'audience':hardwareConf[_0x2097('0x4e')](),'issuer':hardwareConf[_0x2097('0x4e')]()};return verifyJwt(_0x5d4f35,_0x54bea1)['then'](function(){return generateApiKey(_0x48742a);});}else{throw{'message':_0x2097('0x68')};}};exports[_0x2097('0x69')]=function(_0x3445fc){var _0x924537=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x924537[_0x2097('0x6a')](_0x3445fc))throw new db['Sequelize'][(_0x2097('0x6b'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports[_0x2097('0x6c')]=function(_0x140e43,_0x24f166,_0x55e3cd){var _0x365499=encryptor[_0x2097('0x6d')](_0x24f166)[_0x2097('0x6e')](',');for(var _0x168a7d=0x0;_0x168a7d<_0x55e3cd;_0x168a7d++){if(!_0x365499[_0x168a7d])break;if(_0x140e43[_0x2097('0x6f')]()===_0x365499[_0x168a7d]['toLowerCase']()){var _0x5b9fa2=util[_0x2097('0x70')](_0x2097('0x71'),_0x55e3cd);if(_0x55e3cd===0x1){_0x5b9fa2='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db['Sequelize']['ValidationError'](_0x5b9fa2);}}return;};exports['updatePasswordsHistory']=function(_0x14b2d4,_0x4cdc65){var _0x4445ff=_0x4cdc65?encryptor[_0x2097('0x6d')](_0x4cdc65)['split'](','):[];if(_0x4445ff[_0x2097('0x72')]===0x5){_0x4445ff[_0x2097('0x73')](-0x1,0x1);}_0x4445ff[_0x2097('0x74')](_0x14b2d4);return encryptor[_0x2097('0x75')](_0x4445ff[_0x2097('0x76')](','));};function signJwt(_0x60332a){var _0x15aa91=BPromise[_0x2097('0x77')](jwt[_0x2097('0x78')],{'context':jwt});var _0x586922=_0x60332a[_0x2097('0x79')]||config[_0x2097('0xa')][_0x2097('0x7a')];return new BPromise(function(_0x4705e1,_0x412321){_0x15aa91(_0x60332a[_0x2097('0x7b')],_0x586922,_0x60332a['options'])[_0x2097('0x3e')](function(_0x27ed29){_0x4705e1(_0x27ed29);})[_0x2097('0x43')](function(_0x3c3b38){_0x412321(_0x3c3b38);});});}function verifyJwt(_0x1c4156,_0x5d6b8a,_0x437b79){var _0x28dd95=BPromise['promisify'](jwt['verify'],{'context':jwt});var _0x580c1e=_0x437b79||config[_0x2097('0xa')][_0x2097('0x7a')];return new BPromise(function(_0x319d3b,_0x3edb3e){_0x28dd95(_0x1c4156,_0x580c1e,_0x5d6b8a)[_0x2097('0x3e')](function(_0x18d90a){_0x319d3b(_0x18d90a);})[_0x2097('0x43')](function(_0x2ce256){_0x3edb3e(_0x2ce256);});});}function generateNonce(){return crypto[_0x2097('0x7c')](0x10)['toString']('hex');}function generateIssuedAt(){return Math[_0x2097('0x7d')](Date[_0x2097('0x7e')]()/0x3e8)[_0x2097('0x7f')]();}function createJwt(_0x2bdf29){var _0x4649dc={'payload':{'iat':_0x2bdf29[_0x2097('0x64')],'nonce':_0x2bdf29['apiKeyNonce']},'options':{'algorithm':_0x2097('0x80'),'subject':_0x2bdf29['id'][_0x2097('0x7f')](),'issuer':hardwareConf[_0x2097('0x4e')](),'audience':hardwareConf[_0x2097('0x4e')]()}};return signJwt(_0x4649dc)['then'](function(_0x5f4cf9){return{'iat':_0x2bdf29[_0x2097('0x64')],'nonce':_0x2bdf29[_0x2097('0x63')],'token':_0x5f4cf9};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index 44c578b..00b6311 100644 --- a/server/components/contacts/index.js +++ b/server/components/contacts/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x41a4=['then','search','parseAdvancedSearchFilter','where','default','fields','user','clause','tags','checkListsRestrictions','tag','count','User','buildContactsQuery','describe','CmContact','filter','startsWith','cf_','map','CmCustomField','findOne','slice','length','fieldType','type','keys','catch','lodash','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery'];(function(_0x67ef3d,_0x50f0bd){var _0x2ef03e=function(_0x44e463){while(--_0x44e463){_0x67ef3d['push'](_0x67ef3d['shift']());}};_0x2ef03e(++_0x50f0bd);}(_0x41a4,0x10a));var _0x441a=function(_0x2b1e15,_0x12d058){_0x2b1e15=_0x2b1e15-0x0;var _0x31c2e2=_0x41a4[_0x2b1e15];return _0x31c2e2;};'use strict';var _=require(_0x441a('0x0'));var sqlUtils=require('./sql-utils');var db=require(_0x441a('0x1'))['db'];exports[_0x441a('0x2')]=function(_0x37b1fb,_0x24b084,_0x128f02,_0x290d78){var _0xd8fe82={'count':0x0,'rows':[]};var _0x13c215=sqlUtils[_0x441a('0x3')](_0x24b084,_0x37b1fb);if(_0x13c215){return Promise[_0x441a('0x4')](_0xd8fe82);}var _0x40bfc3=sqlUtils[_0x441a('0x5')]();var _0x131439={};var _0x421e28=![];var _0x18c191=![];return Promise[_0x441a('0x4')]()[_0x441a('0x6')](function(){if(_0x37b1fb[_0x441a('0x7')]){return sqlUtils[_0x441a('0x8')](_0x37b1fb[_0x441a('0x7')],_0x290d78);}else{return sqlUtils['parseQueryParameters'](_0x37b1fb,_0x290d78);}})[_0x441a('0x6')](function(_0x53e4dc){_0x40bfc3[_0x441a('0x9')](_0x53e4dc[_0x441a('0xa')]);_0x40bfc3[_0x441a('0x9')](_0x53e4dc[_0x441a('0xb')]);_0x40bfc3[_0x441a('0x9')](_0x53e4dc['filter']);_0x40bfc3[_0x441a('0x9')](_0x53e4dc[_0x441a('0xc')][_0x441a('0xd')]);_0x131439=_0x53e4dc[_0x441a('0xe')];_0x18c191=_0x53e4dc[_0x441a('0xc')]['skip'];return sqlUtils[_0x441a('0xf')](_0x24b084,_0x37b1fb,_0x18c191);})[_0x441a('0x6')](function(_0x310723){_0x40bfc3[_0x441a('0x9')](_0x310723);var _0x9a6e2e=_0x37b1fb[_0x441a('0x7')]?_0x131439['ids']:_0x37b1fb[_0x441a('0x10')];_0x421e28=_0x9a6e2e?!![]:![];return sqlUtils['countFilteredContacts'](_0x40bfc3,_0x9a6e2e);})[_0x441a('0x6')](function(_0x1737ae){_0xd8fe82['count']=_0x1737ae;if(_0xd8fe82[_0x441a('0x11')]===0x0){return;}if(_0x37b1fb[_0x441a('0x12')]){_0x18c191=!![];}return sqlUtils[_0x441a('0x13')](_0x40bfc3,_0x37b1fb[_0x441a('0xb')],_0x128f02,_0x421e28,_0x131439['clause'],_0x18c191);})[_0x441a('0x6')](function(_0x1e2370){if(!_0x1e2370){return[];}return sqlUtils['getFilteredContacts'](_0x1e2370,_0x37b1fb,_0x128f02);})[_0x441a('0x6')](function(_0x40591b){_0xd8fe82['rows']=_0x40591b;return _0xd8fe82;})['catch'](function(_0x129aed){throw _0x129aed;});};exports[_0x441a('0x14')]=function(){var _0x5457c9={};var _0xd4ca1=[];return db[_0x441a('0x15')]['describe']()[_0x441a('0x6')](function(_0x1515c3){_0x5457c9=_0x1515c3;var _0x4bec1c=Object['keys'](_0x5457c9)[_0x441a('0x16')](function(_0x15f027){return _[_0x441a('0x17')](_0x15f027,_0x441a('0x18'))?_0x15f027:undefined;});var _0x103e82=_0x4bec1c[_0x441a('0x19')](function(_0x15c7a4){return db[_0x441a('0x1a')][_0x441a('0x1b')]({'where':{'id':_0x15c7a4[_0x441a('0x1c')](0x3)},'raw':!![]});});return Promise['all'](_0x103e82);})[_0x441a('0x6')](function(_0x57a6c9){for(var _0x4b2b7b=0x0;_0x4b2b7b<_0x57a6c9[_0x441a('0x1d')];_0x4b2b7b++){if(_0x57a6c9[_0x4b2b7b]){var _0x1d5dbe=_0x441a('0x18')+_0x57a6c9[_0x4b2b7b]['id'];_0x5457c9[_0x1d5dbe][_0x441a('0x1e')]=_0x57a6c9[_0x4b2b7b][_0x441a('0x1f')];}}_0xd4ca1=_[_0x441a('0x19')](Object[_0x441a('0x20')](_0x5457c9),function(_0xb788d9){return{'name':_0xb788d9,'type':_0x5457c9[_0xb788d9][_0x441a('0x1f')]};});return _0xd4ca1;})[_0x441a('0x21')](function(_0x2708c1){throw _0x2708c1;});}; \ No newline at end of file +var _0xd195=['startsWith','cf_','map','CmCustomField','findOne','all','length','fieldType','type','lodash','./sql-utils','../../mysqldb','findAll','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','where','fields','user','clause','skip','checkListsRestrictions','ids','tag','count','User','catch','CmContact','describe','keys','filter'];(function(_0x177cc9,_0x3f6fdd){var _0x2fe577=function(_0xa98e83){while(--_0xa98e83){_0x177cc9['push'](_0x177cc9['shift']());}};_0x2fe577(++_0x3f6fdd);}(_0xd195,0xb3));var _0x5d19=function(_0x305048,_0x1b0605){_0x305048=_0x305048-0x0;var _0x1eb207=_0xd195[_0x305048];return _0x1eb207;};'use strict';var _=require(_0x5d19('0x0'));var sqlUtils=require(_0x5d19('0x1'));var db=require(_0x5d19('0x2'))['db'];exports[_0x5d19('0x3')]=function(_0x808eb3,_0x19b2ca,_0x5849dc,_0x4671dd){var _0x3211cc={'count':0x0,'rows':[]};var _0x4eabfc=sqlUtils['skipContactsQuery'](_0x19b2ca,_0x808eb3);if(_0x4eabfc){return Promise[_0x5d19('0x4')](_0x3211cc);}var _0x3a9ff1=sqlUtils[_0x5d19('0x5')]();var _0x2c369b={};var _0x12a439=![];var _0x278d1d=![];return Promise[_0x5d19('0x4')]()[_0x5d19('0x6')](function(){if(_0x808eb3[_0x5d19('0x7')]){return sqlUtils[_0x5d19('0x8')](_0x808eb3[_0x5d19('0x7')],_0x4671dd);}else{return sqlUtils[_0x5d19('0x9')](_0x808eb3,_0x4671dd);}})[_0x5d19('0x6')](function(_0xa82e94){_0x3a9ff1['where'](_0xa82e94['default']);_0x3a9ff1[_0x5d19('0xa')](_0xa82e94[_0x5d19('0xb')]);_0x3a9ff1['where'](_0xa82e94['filter']);_0x3a9ff1[_0x5d19('0xa')](_0xa82e94[_0x5d19('0xc')][_0x5d19('0xd')]);_0x2c369b=_0xa82e94['tags'];_0x278d1d=_0xa82e94[_0x5d19('0xc')][_0x5d19('0xe')];return sqlUtils[_0x5d19('0xf')](_0x19b2ca,_0x808eb3,_0x278d1d);})[_0x5d19('0x6')](function(_0x5c1509){_0x3a9ff1['where'](_0x5c1509);var _0x57e145=_0x808eb3[_0x5d19('0x7')]?_0x2c369b[_0x5d19('0x10')]:_0x808eb3[_0x5d19('0x11')];_0x12a439=_0x57e145?!![]:![];return sqlUtils['countFilteredContacts'](_0x3a9ff1,_0x57e145);})[_0x5d19('0x6')](function(_0x244d0f){_0x3211cc[_0x5d19('0x12')]=_0x244d0f;if(_0x3211cc[_0x5d19('0x12')]===0x0){return;}if(_0x808eb3[_0x5d19('0x13')]){_0x278d1d=!![];}return sqlUtils['buildContactsQuery'](_0x3a9ff1,_0x808eb3[_0x5d19('0xb')],_0x5849dc,_0x12a439,_0x2c369b['clause'],_0x278d1d);})[_0x5d19('0x6')](function(_0x2e7edf){if(!_0x2e7edf){return[];}return sqlUtils['getFilteredContacts'](_0x2e7edf,_0x808eb3,_0x5849dc);})[_0x5d19('0x6')](function(_0x244220){_0x3211cc['rows']=_0x244220;return _0x3211cc;})[_0x5d19('0x14')](function(_0xa29feb){throw _0xa29feb;});};exports['describe']=function(){var _0x31ba57={};var _0x16ed54=[];return db[_0x5d19('0x15')][_0x5d19('0x16')]()[_0x5d19('0x6')](function(_0x28de37){_0x31ba57=_0x28de37;var _0x168d1e=Object[_0x5d19('0x17')](_0x31ba57)[_0x5d19('0x18')](function(_0x58955c){return _[_0x5d19('0x19')](_0x58955c,_0x5d19('0x1a'))?_0x58955c:undefined;});var _0x3ddc08=_0x168d1e[_0x5d19('0x1b')](function(_0x1f7863){return db[_0x5d19('0x1c')][_0x5d19('0x1d')]({'where':{'id':_0x1f7863['slice'](0x3)},'raw':!![]});});return Promise[_0x5d19('0x1e')](_0x3ddc08);})['then'](function(_0x5727fb){for(var _0x422861=0x0;_0x422861<_0x5727fb[_0x5d19('0x1f')];_0x422861++){if(_0x5727fb[_0x422861]){var _0x1310ed=_0x5d19('0x1a')+_0x5727fb[_0x422861]['id'];_0x31ba57[_0x1310ed][_0x5d19('0x20')]=_0x5727fb[_0x422861][_0x5d19('0x21')];}}_0x16ed54=_[_0x5d19('0x1b')](Object[_0x5d19('0x17')](_0x31ba57),function(_0x2dbe89){return{'name':_0x2dbe89,'type':_0x31ba57[_0x2dbe89]['type']};});return _0x16ed54;})[_0x5d19('0x14')](function(_0xbb724a){throw _0xbb724a;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index bbef5f0..a3ac9f8 100644 --- a/server/components/contacts/sql-utils.js +++ b/server/components/contacts/sql-utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x231e=['sequelize','COUNT(*)','exports','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','../../mysqldb','role','agent','search','true','select','from','cm_contacts','where','subqry','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','firstName','lastName','phone','mobile','fax','CompanyId','createdAt','updatedAt','deletedAt','includes','forEach','TagIds','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','replace','split','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','length','find','name','dateOfBirth','DATE','buildExpression','default','text','value','start','end','Tag','map','clause','tags','ids','User','and','uc.UserId\x20=\x20?','user','skip','some','push','ListId','Contact','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','fields','tag','filter','getLists','c.ListId\x20IS\x20NULL','attributes','c.id','limit','offset','group','subqry.id','having','order','DESC','subqry.','color','keyBy','Sequelize','QueryTypes','SELECT','CmContact','query','toString','Tags','clone','getSelectedTags','isEmpty','t.id\x20IN\x20?'];(function(_0x43b801,_0x448a69){var _0x3c7819=function(_0x4c3356){while(--_0x4c3356){_0x43b801['push'](_0x43b801['shift']());}};_0x3c7819(++_0x448a69);}(_0x231e,0x71));var _0xe231=function(_0x6923ea,_0x4b5785){_0x6923ea=_0x6923ea-0x0;var _0x37b5d1=_0x231e[_0x6923ea];return _0x37b5d1;};'use strict';var _=require('lodash');var squel=require(_0xe231('0x0'));var as=require(_0xe231('0x1'));var qs=require(_0xe231('0x2'));var utils=require(_0xe231('0x3'));var db=require(_0xe231('0x4'))['db'];function skipContactsQuery(_0x5c5b41,_0x138461){var _0x5ad1f3=![];if(_0x5c5b41[_0xe231('0x5')]===_0xe231('0x6')&&!_0x138461[_0xe231('0x7')]&&!_0x138461['ListId']&&_0x138461['autocomplete']!==_0xe231('0x8')){_0x5ad1f3=!![];}return _0x5ad1f3;}function getContactsSubquery(){return squel[_0xe231('0x9')]()[_0xe231('0xa')](_0xe231('0xb'),'c')[_0xe231('0xc')]('c.deletedAt\x20IS\x20NULL');}function applyJoinClauses(_0x5de221,_0x3cd63f){var _0x4824f8=_0x3cd63f?'c':_0xe231('0xd');_0x5de221[_0xe231('0xe')](_0xe231('0xf'),'uc',_0xe231('0x10')+_0x4824f8+_0xe231('0x11'))[_0xe231('0xe')](_0xe231('0x12'),'ct',_0xe231('0x13')+_0x4824f8+_0xe231('0x11'))['left_join'](_0xe231('0x14'),'t',_0xe231('0x15'));return _0x5de221;}function addFieldsToQuery(_0x4a9c13,_0x38adc6,_0x101164,_0xc5edeb,_0x3e35b4){var _0x5dea74=_0x3e35b4?'c':_0xe231('0xd');if(!_0x38adc6){_0x38adc6=['id',_0xe231('0x16'),_0xe231('0x17'),_0xe231('0x18'),_0xe231('0x19'),_0xe231('0x1a'),'email','ListId',_0xe231('0x1b'),_0xe231('0x1c'),_0xe231('0x1d'),_0xe231('0x1e'),'TagIds'];}else if(!_0x38adc6[_0xe231('0x1f')]('id')){_0x38adc6['push']('id');}var _0x18788b=_0x101164&&_0x3e35b4||!_0x101164&&!_0x3e35b4;if(_0xc5edeb){_0x18788b=_0xc5edeb&&_0x3e35b4||!_0xc5edeb&&!_0x3e35b4;}_0x38adc6[_0xe231('0x20')](function(_0x128172){if(_0x128172===_0xe231('0x21')){if(_0x18788b){_0x4a9c13[_0xe231('0x22')](_0xe231('0x23'),_0x128172);}else if(_0x101164||_0xc5edeb){_0x4a9c13[_0xe231('0x22')](_0x5dea74+'.'+_0x128172);}}else{_0x4a9c13['field'](_0x5dea74+'.'+_0x128172);}});return _0x4a9c13;}function getSqlClauses(){var _0x4a9bdf={'default':squel[_0xe231('0x24')](),'fields':squel[_0xe231('0x24')](),'filter':squel[_0xe231('0x24')](),'tags':{'clause':squel[_0xe231('0x24')](),'ids':null},'user':{'clause':squel[_0xe231('0x24')](),'skip':![]}};return _0x4a9bdf;}function parseTagParameter(_0x4d0d62){var _0x321639=squel[_0xe231('0x24')]();if(_0x4d0d62){var _0x4faf15=utils['getSelectedTags'](_0x4d0d62);_0x4faf15[_0xe231('0x20')](function(_0x54cea0){_0x321639['or']('CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x54cea0+',%');});}return _0x321639;}function parseSearchFilter(_0x901f7b){var _0x5f0dd6=squel[_0xe231('0x24')]();if(_0x901f7b){var _0x8ce89a=_0x901f7b[_0xe231('0x25')]('\x5c','\x5c\x5c')[_0xe231('0x25')](/'/g,'\x27\x27');if(_0x8ce89a[_0xe231('0x26')]('\x20')['length']>0x1){_0x5f0dd6['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xe231('0x27')](_0x8ce89a,!![]),null);}else{if(qs[_0xe231('0x28')](_0x8ce89a)){_0x5f0dd6['or'](_0xe231('0x29'),_0x8ce89a+'%');_0x5f0dd6['or'](_0xe231('0x2a'),_0x8ce89a+'%');_0x5f0dd6['or'](_0xe231('0x2b'),_0x8ce89a+'%');_0x5f0dd6['or'](_0xe231('0x2c'),_0x8ce89a+'%');}else if(qs['isEmail'](_0x8ce89a)){_0x5f0dd6['or'](_0xe231('0x2d'),_0x8ce89a+'%');}else{_0x5f0dd6['or']('c.firstName\x20LIKE\x20?','%'+_0x8ce89a+'%');_0x5f0dd6['or'](_0xe231('0x2e'),'%'+_0x8ce89a+'%');_0x5f0dd6['or'](_0xe231('0x2d'),'%'+_0x8ce89a+'%');}}}return _0x5f0dd6;}function parseAdvancedSearchFilter(_0xb7971b,_0x5bf7b8){var _0x320344=getSqlClauses();var _0x15cd64=as[_0xe231('0x2f')](_0xb7971b);var _0x38ff90=_0x15cd64[_0xe231('0x30')];for(var _0x56b6ca=0x0;_0x56b6ca<_0x15cd64[_0xe231('0x31')][_0xe231('0x32')];_0x56b6ca++){var _0x4e7e53=_0x15cd64[_0xe231('0x31')][_0x56b6ca];var _0x3d6789='c';var _0x431a1a=_[_0xe231('0x33')](_0x5bf7b8,[_0xe231('0x34'),_0x4e7e53[_0xe231('0x22')]]);if(_0x431a1a){if(_0x4e7e53[_0xe231('0x22')]===_0xe231('0x35')||_0x431a1a['fieldType']==='datetime'){_0x4e7e53['castTo']=_0xe231('0x36');}var _0x5d0751=as[_0xe231('0x37')](_0x3d6789,_0x431a1a['type'],_0x4e7e53);_0x320344[_0xe231('0x38')][_0x38ff90](_0x5d0751[_0xe231('0x39')],_0x5d0751[_0xe231('0x3a')][_0xe231('0x3b')],_0x5d0751['value'][_0xe231('0x3c')]);}else{if(_0x4e7e53[_0xe231('0x22')]===_0xe231('0x3d')){var _0x31dbd4=_0x4e7e53[_0xe231('0x3a')][_0xe231('0x26')](',')[_0xe231('0x3e')](function(_0x162463){return Number(_0x162463);});var _0x2df305=parseTagParameter(_0x31dbd4);_0x320344['tags'][_0xe231('0x3f')]['and'](_0x2df305);_0x320344[_0xe231('0x40')][_0xe231('0x41')]=_0x31dbd4;}else if(_0x4e7e53[_0xe231('0x22')]===_0xe231('0x42')){_0x320344['user'][_0xe231('0x3f')][_0xe231('0x43')](_0xe231('0x44'),_0x4e7e53[_0xe231('0x3a')]);_0x320344[_0xe231('0x45')][_0xe231('0x46')]=!![];}}}return _0x320344;}function parseModelFields(_0x5119ea,_0x227c8d){var _0x313af6=squel[_0xe231('0x24')]();var _0x523fb8=_(_0x5119ea)['keys']()[_0xe231('0x3e')](function(_0x4a0a61){return _[_0xe231('0x47')](_0x227c8d,[_0xe231('0x34'),_0x4a0a61])?_0x4a0a61:undefined;})['compact']()[_0xe231('0x3a')]();if(_0x5119ea['Contact']){_0x523fb8[_0xe231('0x48')]('Contact');}if(_0x5119ea['User']){_0x523fb8['push'](_0xe231('0x42'));}if(_0x523fb8[_0xe231('0x32')]>0x0){_0x523fb8[_0xe231('0x20')](function(_0x1c1106){if(_0x1c1106===_0xe231('0x49')){_0x313af6[_0xe231('0x43')]('c.ListId\x20IN\x20?',[]['concat'](_0x5119ea[_0x1c1106]));}else if(_0x1c1106===_0xe231('0x4a')){var _0x29e2d2='%'+_0x5119ea[_0x1c1106]+'%';_0x313af6['and'](_0xe231('0x4b'),_0x29e2d2);}else if(_0x1c1106===_0xe231('0x42')){_0x313af6['and'](_0xe231('0x44'),_0x5119ea[_0x1c1106]);}else{_0x313af6[_0xe231('0x43')]('c.'+_0x1c1106+_0xe231('0x4c'),_0x5119ea[_0x1c1106]);}});}return _0x313af6;}function parseQueryParameters(_0x3fd8db,_0x24469e){var _0xbc7569=getSqlClauses();return Promise[_0xe231('0x4d')]()[_0xe231('0x4e')](function(){return parseModelFields(_0x3fd8db,_0x24469e);})['then'](function(_0x51db03){_0xbc7569[_0xe231('0x4f')][_0xe231('0x43')](_0x51db03);return parseTagParameter(_0x3fd8db[_0xe231('0x50')]);})[_0xe231('0x4e')](function(_0x45d23c){_0xbc7569[_0xe231('0x40')]['clause'][_0xe231('0x43')](_0x45d23c);return parseSearchFilter(_0x3fd8db['filter']);})[_0xe231('0x4e')](function(_0x275556){_0xbc7569[_0xe231('0x51')]=_0x275556;return _0xbc7569;});}function checkListsRestrictions(_0x3d5f49,_0x31d08f,_0xf7179e){var _0xa9d49c=squel['expr']();return Promise[_0xe231('0x4d')]()[_0xe231('0x4e')](function(){if(_0x31d08f[_0xe231('0x7')]&&_0x3d5f49[_0xe231('0x5')]==='agent'&&!_0xf7179e){return _0x3d5f49[_0xe231('0x52')]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x8c28a3){if(_0x8c28a3){if(_0x8c28a3[_0xe231('0x32')]===0x0){_0xa9d49c[_0xe231('0x43')](_0xe231('0x53'));}else{_0xa9d49c['and']('c.ListId\x20IN\x20?',_[_0xe231('0x3e')](_0x8c28a3,'id'));}}})['then'](function(){return _0xa9d49c;});}function buildContactsQuery(_0x1c20f9,_0xc92f46,_0xbf01a8,_0x56ffc3,_0x53cf82,_0x3e80dd){if(_0xc92f46){_0xc92f46=_0xbf01a8[_0xe231('0x54')];}_0x1c20f9=addFieldsToQuery(_0x1c20f9,_0xc92f46,_0x56ffc3,_0x3e80dd,!![]);var _0x5e22b2=squel[_0xe231('0x9')]();_0x5e22b2=addFieldsToQuery(_0x5e22b2,_0xc92f46,_0x56ffc3,_0x3e80dd,![]);if(_0x56ffc3||_0x3e80dd){_0x1c20f9=applyJoinClauses(_0x1c20f9,!![]);_0x1c20f9['group'](_0xe231('0x55'));if(_0xbf01a8['limit']){_0x5e22b2[_0xe231('0x56')](_0xbf01a8['limit']);}if(_0xbf01a8[_0xe231('0x57')]){_0x5e22b2[_0xe231('0x57')](_0xbf01a8[_0xe231('0x57')]);}}else{_0x5e22b2=applyJoinClauses(_0x5e22b2,![]);_0x5e22b2[_0xe231('0x58')](_0xe231('0x59'));if(_0xbf01a8['limit']){_0x1c20f9[_0xe231('0x56')](_0xbf01a8['limit']);}if(_0xbf01a8['offset']){_0x1c20f9[_0xe231('0x57')](_0xbf01a8[_0xe231('0x57')]);}}_0x5e22b2[_0xe231('0x5a')](_0x53cf82);if(_0xbf01a8[_0xe231('0x5b')]){_0xbf01a8[_0xe231('0x5b')][_0xe231('0x20')](function(_0x51d4a2){_0x1c20f9['order']('c.'+_0x51d4a2[0x0],_0x51d4a2[0x1]===_0xe231('0x5c')?![]:!![]);_0x5e22b2[_0xe231('0x5b')](_0xe231('0x5d')+_0x51d4a2[0x0],_0x51d4a2[0x1]===_0xe231('0x5c')?![]:!![]);});}_0x5e22b2['from'](_0x1c20f9,'subqry');return _0x5e22b2;}function getFilteredContacts(_0x5e696e){var _0x5e3efb=[];return db[_0xe231('0x3d')]['findAll']({'attributes':['id',_0xe231('0x34'),_0xe231('0x5e')],'raw':!![]})[_0xe231('0x4e')](function(_0x1f83f9){_0x5e3efb=_[_0xe231('0x5f')](_0x1f83f9,'id');var _0xc85dbd={'type':db[_0xe231('0x60')][_0xe231('0x61')][_0xe231('0x62')],'model':db[_0xe231('0x63')],'mapToModel':!![],'nest':!![],'raw':!![]};return db['sequelize'][_0xe231('0x64')](_0x5e696e[_0xe231('0x65')](),_0xc85dbd);})['then'](function(_0x1132f8){_0x1132f8['forEach'](function(_0x2fa279){if(_0x2fa279[_0xe231('0x21')]){_0x2fa279['Tags']=[];_0x2fa279[_0xe231('0x21')]['split'](',')[_0xe231('0x20')](function(_0x2467c2){_0x2fa279[_0xe231('0x66')][_0xe231('0x48')](_0x5e3efb[_0x2467c2]);});}delete _0x2fa279[_0xe231('0x21')];});return _0x1132f8;});}function countFilteredContacts(_0x10889e,_0x2ad624){var _0x563518=_0x10889e[_0xe231('0x67')]();_0x563518['field']('COUNT(*)');_0x563518=applyJoinClauses(_0x563518,!![]);_0x10889e[_0xe231('0x58')](_0xe231('0x55'));var _0x544242=utils[_0xe231('0x68')](_0x2ad624);if(!_[_0xe231('0x69')](_0x544242)){_0x563518[_0xe231('0xc')](_0xe231('0x6a'),_0x544242);}var _0x3b6e4e={'type':db[_0xe231('0x60')][_0xe231('0x61')][_0xe231('0x62')],'raw':!![]};return db[_0xe231('0x6b')][_0xe231('0x64')](_0x563518[_0xe231('0x65')](),_0x3b6e4e)[_0xe231('0x4e')](function(_0x17edef){return _0x17edef[0x0][_0xe231('0x6c')];});}module[_0xe231('0x6d')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0x32fd=['keyBy','Sequelize','QueryTypes','SELECT','CmContact','sequelize','query','toString','Tags','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','lodash','squel','../parsers/advancedSearch','role','agent','ListId','autocomplete','true','select','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','left_join','.id','cm_contact_has_tags','tools_tags','t.id\x20=\x20ct.TagId','firstName','lastName','phone','mobile','email','CompanyId','createdAt','updatedAt','deletedAt','TagIds','push','field','expr','getSelectedTags','forEach','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','length','find','dateOfBirth','fieldType','datetime','castTo','DATE','buildExpression','type','default','text','value','start','end','split','map','tags','clause','and','user','uc.UserId\x20=\x20?','skip','name','compact','Contact','User','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','fields','tag','filter','search','getLists','c.ListId\x20IS\x20NULL','attributes','group','c.id','limit','offset','having','order','DESC','Tag','color'];(function(_0x33546a,_0x2386fe){var _0x21e7d1=function(_0x4a6e30){while(--_0x4a6e30){_0x33546a['push'](_0x33546a['shift']());}};_0x21e7d1(++_0x2386fe);}(_0x32fd,0x1bd));var _0xd32f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x32fd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd32f('0x0'));var squel=require(_0xd32f('0x1'));var as=require(_0xd32f('0x2'));var qs=require('../parsers/qs');var utils=require('../interaction/utils');var db=require('../../mysqldb')['db'];function skipContactsQuery(_0x9d24ad,_0x21115f){var _0x21bc94=![];if(_0x9d24ad[_0xd32f('0x3')]===_0xd32f('0x4')&&!_0x21115f['search']&&!_0x21115f[_0xd32f('0x5')]&&_0x21115f[_0xd32f('0x6')]!==_0xd32f('0x7')){_0x21bc94=!![];}return _0x21bc94;}function getContactsSubquery(){return squel[_0xd32f('0x8')]()[_0xd32f('0x9')](_0xd32f('0xa'),'c')[_0xd32f('0xb')](_0xd32f('0xc'));}function applyJoinClauses(_0x29f9d0,_0x3a2ee1){var _0x248f37=_0x3a2ee1?'c':_0xd32f('0xd');_0x29f9d0[_0xd32f('0xe')]('cm_user_has_contacts','uc','uc.CmContactId\x20=\x20'+_0x248f37+_0xd32f('0xf'))[_0xd32f('0xe')](_0xd32f('0x10'),'ct','ct.CmContactId\x20=\x20'+_0x248f37+'.id')[_0xd32f('0xe')](_0xd32f('0x11'),'t',_0xd32f('0x12'));return _0x29f9d0;}function addFieldsToQuery(_0x298b54,_0x59796b,_0x3533a3,_0x537784,_0x18b597){var _0x1e0572=_0x18b597?'c':_0xd32f('0xd');if(!_0x59796b){_0x59796b=['id',_0xd32f('0x13'),_0xd32f('0x14'),_0xd32f('0x15'),_0xd32f('0x16'),'fax',_0xd32f('0x17'),_0xd32f('0x5'),_0xd32f('0x18'),_0xd32f('0x19'),_0xd32f('0x1a'),_0xd32f('0x1b'),_0xd32f('0x1c')];}else if(!_0x59796b['includes']('id')){_0x59796b[_0xd32f('0x1d')]('id');}var _0x42a90a=_0x3533a3&&_0x18b597||!_0x3533a3&&!_0x18b597;if(_0x537784){_0x42a90a=_0x537784&&_0x18b597||!_0x537784&&!_0x18b597;}_0x59796b['forEach'](function(_0x10b959){if(_0x10b959===_0xd32f('0x1c')){if(_0x42a90a){_0x298b54[_0xd32f('0x1e')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x10b959);}else if(_0x3533a3||_0x537784){_0x298b54[_0xd32f('0x1e')](_0x1e0572+'.'+_0x10b959);}}else{_0x298b54[_0xd32f('0x1e')](_0x1e0572+'.'+_0x10b959);}});return _0x298b54;}function getSqlClauses(){var _0x5f39b6={'default':squel['expr'](),'fields':squel['expr'](),'filter':squel[_0xd32f('0x1f')](),'tags':{'clause':squel[_0xd32f('0x1f')](),'ids':null},'user':{'clause':squel[_0xd32f('0x1f')](),'skip':![]}};return _0x5f39b6;}function parseTagParameter(_0x3d63d7){var _0x5575eb=squel[_0xd32f('0x1f')]();if(_0x3d63d7){var _0x49cc4c=utils[_0xd32f('0x20')](_0x3d63d7);_0x49cc4c[_0xd32f('0x21')](function(_0x4d89cb){_0x5575eb['or']('CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4d89cb+',%');});}return _0x5575eb;}function parseSearchFilter(_0x38b320){var _0x35d138=squel[_0xd32f('0x1f')]();if(_0x38b320){var _0x493df3=_0x38b320[_0xd32f('0x22')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x493df3['split']('\x20')['length']>0x1){_0x35d138['or'](_0xd32f('0x23'),qs[_0xd32f('0x24')](_0x493df3,!![]),null);}else{if(qs['isNumeric'](_0x493df3)){_0x35d138['or']('c.id\x20LIKE\x20?',_0x493df3+'%');_0x35d138['or'](_0xd32f('0x25'),_0x493df3+'%');_0x35d138['or'](_0xd32f('0x26'),_0x493df3+'%');_0x35d138['or'](_0xd32f('0x27'),_0x493df3+'%');}else if(qs[_0xd32f('0x28')](_0x493df3)){_0x35d138['or'](_0xd32f('0x29'),_0x493df3+'%');}else{_0x35d138['or'](_0xd32f('0x2a'),'%'+_0x493df3+'%');_0x35d138['or'](_0xd32f('0x2b'),'%'+_0x493df3+'%');_0x35d138['or']('c.email\x20LIKE\x20?','%'+_0x493df3+'%');}}}return _0x35d138;}function parseAdvancedSearchFilter(_0x4e9ac2,_0x3166f9){var _0x4fbe11=getSqlClauses();var _0x4eaf73=as[_0xd32f('0x2c')](_0x4e9ac2);var _0x3802da=_0x4eaf73[_0xd32f('0x2d')];for(var _0x40ac86=0x0;_0x40ac86<_0x4eaf73[_0xd32f('0x2e')][_0xd32f('0x2f')];_0x40ac86++){var _0x430737=_0x4eaf73[_0xd32f('0x2e')][_0x40ac86];var _0x15abef='c';var _0x355451=_[_0xd32f('0x30')](_0x3166f9,['name',_0x430737[_0xd32f('0x1e')]]);if(_0x355451){if(_0x430737[_0xd32f('0x1e')]===_0xd32f('0x31')||_0x355451[_0xd32f('0x32')]===_0xd32f('0x33')){_0x430737[_0xd32f('0x34')]=_0xd32f('0x35');}var _0x1c7c1d=as[_0xd32f('0x36')](_0x15abef,_0x355451[_0xd32f('0x37')],_0x430737);_0x4fbe11[_0xd32f('0x38')][_0x3802da](_0x1c7c1d[_0xd32f('0x39')],_0x1c7c1d[_0xd32f('0x3a')][_0xd32f('0x3b')],_0x1c7c1d[_0xd32f('0x3a')][_0xd32f('0x3c')]);}else{if(_0x430737['field']==='Tag'){var _0x470309=_0x430737[_0xd32f('0x3a')][_0xd32f('0x3d')](',')[_0xd32f('0x3e')](function(_0x204bd8){return Number(_0x204bd8);});var _0xb43702=parseTagParameter(_0x470309);_0x4fbe11[_0xd32f('0x3f')][_0xd32f('0x40')][_0xd32f('0x41')](_0xb43702);_0x4fbe11[_0xd32f('0x3f')]['ids']=_0x470309;}else if(_0x430737[_0xd32f('0x1e')]==='User'){_0x4fbe11[_0xd32f('0x42')][_0xd32f('0x40')]['and'](_0xd32f('0x43'),_0x430737[_0xd32f('0x3a')]);_0x4fbe11['user'][_0xd32f('0x44')]=!![];}}}return _0x4fbe11;}function parseModelFields(_0x888331,_0x5b8c97){var _0x3720cf=squel[_0xd32f('0x1f')]();var _0x227b90=_(_0x888331)['keys']()[_0xd32f('0x3e')](function(_0x493849){return _['some'](_0x5b8c97,[_0xd32f('0x45'),_0x493849])?_0x493849:undefined;})[_0xd32f('0x46')]()[_0xd32f('0x3a')]();if(_0x888331['Contact']){_0x227b90[_0xd32f('0x1d')](_0xd32f('0x47'));}if(_0x888331[_0xd32f('0x48')]){_0x227b90[_0xd32f('0x1d')](_0xd32f('0x48'));}if(_0x227b90[_0xd32f('0x2f')]>0x0){_0x227b90['forEach'](function(_0x513835){if(_0x513835===_0xd32f('0x5')){_0x3720cf[_0xd32f('0x41')](_0xd32f('0x49'),[][_0xd32f('0x4a')](_0x888331[_0x513835]));}else if(_0x513835==='Contact'){var _0x70763='%'+_0x888331[_0x513835]+'%';_0x3720cf['and'](_0xd32f('0x4b'),_0x70763);}else if(_0x513835===_0xd32f('0x48')){_0x3720cf[_0xd32f('0x41')]('uc.UserId\x20=\x20?',_0x888331[_0x513835]);}else{_0x3720cf['and']('c.'+_0x513835+_0xd32f('0x4c'),_0x888331[_0x513835]);}});}return _0x3720cf;}function parseQueryParameters(_0x372c24,_0x20844a){var _0x3f33d1=getSqlClauses();return Promise[_0xd32f('0x4d')]()[_0xd32f('0x4e')](function(){return parseModelFields(_0x372c24,_0x20844a);})['then'](function(_0x51f872){_0x3f33d1[_0xd32f('0x4f')][_0xd32f('0x41')](_0x51f872);return parseTagParameter(_0x372c24[_0xd32f('0x50')]);})[_0xd32f('0x4e')](function(_0x147092){_0x3f33d1['tags']['clause'][_0xd32f('0x41')](_0x147092);return parseSearchFilter(_0x372c24[_0xd32f('0x51')]);})['then'](function(_0x50ebc1){_0x3f33d1[_0xd32f('0x51')]=_0x50ebc1;return _0x3f33d1;});}function checkListsRestrictions(_0x16cacf,_0x20c547,_0x268d3d){var _0x5b0c55=squel[_0xd32f('0x1f')]();return Promise[_0xd32f('0x4d')]()[_0xd32f('0x4e')](function(){if(_0x20c547[_0xd32f('0x52')]&&_0x16cacf[_0xd32f('0x3')]===_0xd32f('0x4')&&!_0x268d3d){return _0x16cacf[_0xd32f('0x53')]({'attributes':['id'],'raw':!![]});}})[_0xd32f('0x4e')](function(_0x5c0906){if(_0x5c0906){if(_0x5c0906[_0xd32f('0x2f')]===0x0){_0x5b0c55[_0xd32f('0x41')](_0xd32f('0x54'));}else{_0x5b0c55[_0xd32f('0x41')](_0xd32f('0x49'),_[_0xd32f('0x3e')](_0x5c0906,'id'));}}})[_0xd32f('0x4e')](function(){return _0x5b0c55;});}function buildContactsQuery(_0x415728,_0x29e1d1,_0x30346e,_0x4ac419,_0x2e924f,_0x2f4e81){if(_0x29e1d1){_0x29e1d1=_0x30346e[_0xd32f('0x55')];}_0x415728=addFieldsToQuery(_0x415728,_0x29e1d1,_0x4ac419,_0x2f4e81,!![]);var _0x353264=squel['select']();_0x353264=addFieldsToQuery(_0x353264,_0x29e1d1,_0x4ac419,_0x2f4e81,![]);if(_0x4ac419||_0x2f4e81){_0x415728=applyJoinClauses(_0x415728,!![]);_0x415728[_0xd32f('0x56')](_0xd32f('0x57'));if(_0x30346e[_0xd32f('0x58')]){_0x353264['limit'](_0x30346e[_0xd32f('0x58')]);}if(_0x30346e[_0xd32f('0x59')]){_0x353264[_0xd32f('0x59')](_0x30346e[_0xd32f('0x59')]);}}else{_0x353264=applyJoinClauses(_0x353264,![]);_0x353264[_0xd32f('0x56')]('subqry.id');if(_0x30346e['limit']){_0x415728[_0xd32f('0x58')](_0x30346e[_0xd32f('0x58')]);}if(_0x30346e[_0xd32f('0x59')]){_0x415728[_0xd32f('0x59')](_0x30346e[_0xd32f('0x59')]);}}_0x353264[_0xd32f('0x5a')](_0x2e924f);if(_0x30346e['order']){_0x30346e[_0xd32f('0x5b')][_0xd32f('0x21')](function(_0x4abbc0){_0x415728[_0xd32f('0x5b')]('c.'+_0x4abbc0[0x0],_0x4abbc0[0x1]==='DESC'?![]:!![]);_0x353264[_0xd32f('0x5b')]('subqry.'+_0x4abbc0[0x0],_0x4abbc0[0x1]===_0xd32f('0x5c')?![]:!![]);});}_0x353264[_0xd32f('0x9')](_0x415728,_0xd32f('0xd'));return _0x353264;}function getFilteredContacts(_0x5cfc5c){var _0x36d598=[];return db[_0xd32f('0x5d')]['findAll']({'attributes':['id',_0xd32f('0x45'),_0xd32f('0x5e')],'raw':!![]})[_0xd32f('0x4e')](function(_0xd11337){_0x36d598=_[_0xd32f('0x5f')](_0xd11337,'id');var _0x386641={'type':db[_0xd32f('0x60')][_0xd32f('0x61')][_0xd32f('0x62')],'model':db[_0xd32f('0x63')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0xd32f('0x64')][_0xd32f('0x65')](_0x5cfc5c[_0xd32f('0x66')](),_0x386641);})[_0xd32f('0x4e')](function(_0x2aa3e4){_0x2aa3e4[_0xd32f('0x21')](function(_0x9f7b99){if(_0x9f7b99[_0xd32f('0x1c')]){_0x9f7b99[_0xd32f('0x67')]=[];_0x9f7b99['TagIds'][_0xd32f('0x3d')](',')['forEach'](function(_0x1d4e1a){_0x9f7b99['Tags'][_0xd32f('0x1d')](_0x36d598[_0x1d4e1a]);});}delete _0x9f7b99[_0xd32f('0x1c')];});return _0x2aa3e4;});}function countFilteredContacts(_0x2e9fae,_0x2caf88){var _0x535ef5=_0x2e9fae[_0xd32f('0x68')]();_0x535ef5[_0xd32f('0x1e')](_0xd32f('0x69'));_0x535ef5=applyJoinClauses(_0x535ef5,!![]);_0x2e9fae[_0xd32f('0x56')](_0xd32f('0x57'));var _0x5ac8bc=utils['getSelectedTags'](_0x2caf88);if(!_[_0xd32f('0x6a')](_0x5ac8bc)){_0x535ef5[_0xd32f('0xb')](_0xd32f('0x6b'),_0x5ac8bc);}var _0xbd61ad={'type':db[_0xd32f('0x60')][_0xd32f('0x61')][_0xd32f('0x62')],'raw':!![]};return db[_0xd32f('0x64')][_0xd32f('0x65')](_0x535ef5[_0xd32f('0x66')](),_0xbd61ad)[_0xd32f('0x4e')](function(_0x558b9f){return _0x558b9f[0x0][_0xd32f('0x69')];});}module['exports']={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 48d553a..5436552 100644 --- a/server/components/encryptor/index.js +++ b/server/components/encryptor/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0c9a=['binary','end','final','write','close','unlink','decryptFile','encryptString','secret','base64','decryptString','createDecipher','crypto','bluebird','../../config/logger','app','secrets','aes-256-ctr','aes192','algorithm','encrypt','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','hasOwnProperty','createReadStream','createWriteStream','createCipher','data','update'];(function(_0x2cfea8,_0x4f5018){var _0x3834c4=function(_0x276a42){while(--_0x276a42){_0x2cfea8['push'](_0x2cfea8['shift']());}};_0x3834c4(++_0x4f5018);}(_0x0c9a,0x114));var _0xa0c9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c9a[_0x3dd15e];return _0x231fd0;};'use strict';var crypto=require(_0xa0c9('0x0'));var fs=require('fs');var BPromise=require(_0xa0c9('0x1'));var _=require('lodash');var config=require('../../config/environment');var logger=require(_0xa0c9('0x2'))(_0xa0c9('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xa0c9('0x4')]['session'],'algorithm':_0xa0c9('0x5')};const fileOptions={'algorithm':_0xa0c9('0x6')};if(config['encrypt']&&config['encrypt'][_0xa0c9('0x7')]){var isSupported=isAlgorithmSupported(config[_0xa0c9('0x8')][_0xa0c9('0x7')]);if(isSupported){fileOptions[_0xa0c9('0x7')]=config['encrypt'][_0xa0c9('0x7')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xa0c9('0x9')](',\x20');logger[_0xa0c9('0xa')](config[_0xa0c9('0x8')][_0xa0c9('0x7')],_0xa0c9('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x473cc1){return AES_SUPPORTED_RX[_0xa0c9('0xc')](_0x473cc1);}function getSupportedCiphers(){return crypto[_0xa0c9('0xd')]()[_0xa0c9('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0x1f86e2){return getSupportedCiphers()['indexOf'](_0x1f86e2)>-0x1;}function combineOptions(_0x5892f6){var _0x33be31={};for(var _0x282506 in fileOptions){if(fileOptions[_0xa0c9('0xf')](_0x282506)){_0x33be31[_0x282506]=fileOptions[_0x282506];}}if(_0x5892f6){for(var _0x5dd5d5 in _0x5892f6){if(_0x5892f6[_0xa0c9('0xf')](_0x5dd5d5)){_0x33be31[_0x5dd5d5]=_0x5892f6[_0x5dd5d5];}}}return _0x33be31;}exports['encryptFile']=function(_0x799960,_0x176d96,_0x2fe384,_0x57adaa){return new BPromise(function(_0x5b05a0,_0x563f92){_0x57adaa=combineOptions(_0x57adaa);var _0x251aca=new Buffer(_0x2fe384);var _0x39900e=fs[_0xa0c9('0x10')](_0x799960);var _0x18cf60=fs[_0xa0c9('0x11')](_0x176d96);var _0x39d719=crypto[_0xa0c9('0x12')](_0x57adaa['algorithm'],_0x251aca);_0x39900e['on'](_0xa0c9('0x13'),function(_0x501e06){var _0x35e792=new Buffer(_0x39d719[_0xa0c9('0x14')](_0x501e06),_0xa0c9('0x15'));_0x18cf60['write'](_0x35e792);});_0x39900e['on'](_0xa0c9('0x16'),function(){try{var _0x3e77cf=new Buffer(_0x39d719[_0xa0c9('0x17')]('binary'),_0xa0c9('0x15'));_0x18cf60[_0xa0c9('0x18')](_0x3e77cf);_0x18cf60[_0xa0c9('0x16')]();_0x18cf60['on'](_0xa0c9('0x19'),function(){return _0x5b05a0(_0x176d96);});}catch(_0x5bf2f2){fs[_0xa0c9('0x1a')](_0x176d96);return _0x563f92(_0x5bf2f2);}});});};exports[_0xa0c9('0x1b')]=function(_0x19fe8f,_0x223494,_0x25b9d8,_0x5ea140){return new BPromise(function(_0x508ba3,_0x53a0f7){_0x5ea140=combineOptions(_0x5ea140);var _0x5be112=new Buffer(_0x25b9d8);var _0x172075=fs['createReadStream'](_0x19fe8f);var _0x29a251=fs['createWriteStream'](_0x223494);var _0x42cccf=crypto['createDecipher'](_0x5ea140[_0xa0c9('0x7')],_0x5be112);_0x172075['on'](_0xa0c9('0x13'),function(_0x1f3076){var _0x318063=new Buffer(_0x42cccf['update'](_0x1f3076),_0xa0c9('0x15'));_0x29a251['write'](_0x318063);});_0x172075['on'](_0xa0c9('0x16'),function(){try{var _0x333b07=new Buffer(_0x42cccf[_0xa0c9('0x17')]('binary'),_0xa0c9('0x15'));_0x29a251[_0xa0c9('0x18')](_0x333b07);_0x29a251[_0xa0c9('0x16')]();_0x29a251['on'](_0xa0c9('0x19'),function(){return _0x508ba3(_0x223494);});}catch(_0x5eedd4){fs[_0xa0c9('0x1a')](_0x223494);return _0x53a0f7(_0x5eedd4);}});});};exports[_0xa0c9('0x1c')]=function(_0x5b1066,_0x47c9d7,_0x114670){var _0x2676db=_0x114670||stringOptions[_0xa0c9('0x7')];var _0x5da623=_0x47c9d7||stringOptions[_0xa0c9('0x1d')];var _0x130642=crypto[_0xa0c9('0x12')](_0x2676db,_0x5da623);var _0x3a49b6=_0x130642[_0xa0c9('0x14')](_0x5b1066,'utf8',_0xa0c9('0x1e'));_0x3a49b6+=_0x130642[_0xa0c9('0x17')]('base64');return _0x3a49b6;};exports[_0xa0c9('0x1f')]=function(_0x5de84b,_0x243128,_0x62ea00){var _0x19cc97=_0x62ea00||stringOptions[_0xa0c9('0x7')];var _0x3152d6=_0x243128||stringOptions[_0xa0c9('0x1d')];var _0x4b25ba=crypto[_0xa0c9('0x20')](_0x19cc97,_0x3152d6);var _0x301567=_0x4b25ba[_0xa0c9('0x14')](_0x5de84b,'base64','utf8');_0x301567+=_0x4b25ba['final']('utf8');return _0x301567;}; \ No newline at end of file +var _0x0c52=['update','final','binary','write','end','close','unlink','decryptFile','createDecipher','encryptString','utf8','base64','decryptString','secret','crypto','bluebird','lodash','../../config/environment','../../config/logger','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','createReadStream','createWriteStream','createCipher','data'];(function(_0x3c4154,_0x425d67){var _0x2c113b=function(_0x4f6b5a){while(--_0x4f6b5a){_0x3c4154['push'](_0x3c4154['shift']());}};_0x2c113b(++_0x425d67);}(_0x0c52,0xc2));var _0x20c5=function(_0x530af5,_0x4bb918){_0x530af5=_0x530af5-0x0;var _0x429418=_0x0c52[_0x530af5];return _0x429418;};'use strict';var crypto=require(_0x20c5('0x0'));var fs=require('fs');var BPromise=require(_0x20c5('0x1'));var _=require(_0x20c5('0x2'));var config=require(_0x20c5('0x3'));var logger=require(_0x20c5('0x4'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x20c5('0x5')][_0x20c5('0x6')],'algorithm':_0x20c5('0x7')};const fileOptions={'algorithm':_0x20c5('0x8')};if(config[_0x20c5('0x9')]&&config[_0x20c5('0x9')][_0x20c5('0xa')]){var isSupported=isAlgorithmSupported(config[_0x20c5('0x9')][_0x20c5('0xa')]);if(isSupported){fileOptions[_0x20c5('0xa')]=config['encrypt']['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0x20c5('0xb')](config[_0x20c5('0x9')][_0x20c5('0xa')],_0x20c5('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x1b5f71){return AES_SUPPORTED_RX[_0x20c5('0xd')](_0x1b5f71);}function getSupportedCiphers(){return crypto[_0x20c5('0xe')]()[_0x20c5('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0x4da696){return getSupportedCiphers()[_0x20c5('0x10')](_0x4da696)>-0x1;}function combineOptions(_0x31058c){var _0x3755b4={};for(var _0xf33416 in fileOptions){if(fileOptions[_0x20c5('0x11')](_0xf33416)){_0x3755b4[_0xf33416]=fileOptions[_0xf33416];}}if(_0x31058c){for(var _0x1b6736 in _0x31058c){if(_0x31058c[_0x20c5('0x11')](_0x1b6736)){_0x3755b4[_0x1b6736]=_0x31058c[_0x1b6736];}}}return _0x3755b4;}exports['encryptFile']=function(_0xa3861e,_0x421018,_0x4cc7fc,_0xa12853){return new BPromise(function(_0x397c48,_0x404af8){_0xa12853=combineOptions(_0xa12853);var _0x25bf58=new Buffer(_0x4cc7fc);var _0x2772c2=fs[_0x20c5('0x12')](_0xa3861e);var _0x2464bb=fs[_0x20c5('0x13')](_0x421018);var _0x40a4f8=crypto[_0x20c5('0x14')](_0xa12853['algorithm'],_0x25bf58);_0x2772c2['on'](_0x20c5('0x15'),function(_0x1c01f6){var _0x1bf307=new Buffer(_0x40a4f8[_0x20c5('0x16')](_0x1c01f6),'binary');_0x2464bb['write'](_0x1bf307);});_0x2772c2['on']('end',function(){try{var _0x1da4c4=new Buffer(_0x40a4f8[_0x20c5('0x17')](_0x20c5('0x18')),'binary');_0x2464bb[_0x20c5('0x19')](_0x1da4c4);_0x2464bb[_0x20c5('0x1a')]();_0x2464bb['on'](_0x20c5('0x1b'),function(){return _0x397c48(_0x421018);});}catch(_0x281788){fs[_0x20c5('0x1c')](_0x421018);return _0x404af8(_0x281788);}});});};exports[_0x20c5('0x1d')]=function(_0x1cb222,_0x1350e1,_0x26a8de,_0x1d7548){return new BPromise(function(_0x2105c9,_0x14c8cd){_0x1d7548=combineOptions(_0x1d7548);var _0x4e221b=new Buffer(_0x26a8de);var _0x1ada82=fs[_0x20c5('0x12')](_0x1cb222);var _0x4e4cd6=fs[_0x20c5('0x13')](_0x1350e1);var _0xd109a6=crypto[_0x20c5('0x1e')](_0x1d7548['algorithm'],_0x4e221b);_0x1ada82['on'](_0x20c5('0x15'),function(_0x21e1e8){var _0x4df014=new Buffer(_0xd109a6['update'](_0x21e1e8),'binary');_0x4e4cd6[_0x20c5('0x19')](_0x4df014);});_0x1ada82['on'](_0x20c5('0x1a'),function(){try{var _0x236302=new Buffer(_0xd109a6['final'](_0x20c5('0x18')),_0x20c5('0x18'));_0x4e4cd6[_0x20c5('0x19')](_0x236302);_0x4e4cd6[_0x20c5('0x1a')]();_0x4e4cd6['on'](_0x20c5('0x1b'),function(){return _0x2105c9(_0x1350e1);});}catch(_0x27032e){fs[_0x20c5('0x1c')](_0x1350e1);return _0x14c8cd(_0x27032e);}});});};exports[_0x20c5('0x1f')]=function(_0x497d6b,_0x5808db,_0x58b297){var _0x52ac58=_0x58b297||stringOptions['algorithm'];var _0x56ca97=_0x5808db||stringOptions['secret'];var _0x2a0c0e=crypto[_0x20c5('0x14')](_0x52ac58,_0x56ca97);var _0x53e00a=_0x2a0c0e[_0x20c5('0x16')](_0x497d6b,_0x20c5('0x20'),_0x20c5('0x21'));_0x53e00a+=_0x2a0c0e[_0x20c5('0x17')](_0x20c5('0x21'));return _0x53e00a;};exports[_0x20c5('0x22')]=function(_0x2a1571,_0x5aac0e,_0x27753e){var _0x86c1a2=_0x27753e||stringOptions[_0x20c5('0xa')];var _0x223f9f=_0x5aac0e||stringOptions[_0x20c5('0x23')];var _0x8532d0=crypto[_0x20c5('0x1e')](_0x86c1a2,_0x223f9f);var _0x4bfa4d=_0x8532d0['update'](_0x2a1571,_0x20c5('0x21'),_0x20c5('0x20'));_0x4bfa4d+=_0x8532d0[_0x20c5('0x17')](_0x20c5('0x20'));return _0x4bfa4d;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 9b2d5f3..b6ad7c8 100644 --- a/server/components/export/csv.js +++ b/server/components/export/csv.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb6b9=['%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','length','join','each','%s%d.%s','csv','%s.%s','zip','zip\x20finished','then','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','finally','util','lodash','to-csv','zip-dir','../../mysqldb','dbH','argv','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','find','split','splitSizeCsv','sequelize','query','QueryTypes','SELECT','num','forEach','push'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xb6b9,0x1be));var _0x9b6b=function(_0x1738c0,_0x2fa809){_0x1738c0=_0x1738c0-0x0;var _0x70cf18=_0xb6b9[_0x1738c0];return _0x70cf18;};'use strict';var util=require(_0x9b6b('0x0'));var path=require('path');var _=require(_0x9b6b('0x1'));var csv=require(_0x9b6b('0x2'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x9b6b('0x3'));var rimraf=require('rimraf');var db=require(_0x9b6b('0x4'))['db'];var dbH=require(_0x9b6b('0x4'))[_0x9b6b('0x5')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x9b6b('0x6')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xc07885,_0x491add){var _0xb697a3={'status':_0xc07885};var _0xcf3a3f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x491add){_0xb697a3['savename']=_0x491add;}return db[_0x9b6b('0x7')]['update'](_0xb697a3,_0xcf3a3f);}function main(){var _0x357619=0x1388;var _0x5520ee;logger[_0x9b6b('0x8')](util[_0x9b6b('0x9')](_0x9b6b('0xa'),EXTRACTED_REPORT_ID,_0x9b6b('0xb')));return db['Setting'][_0x9b6b('0xc')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x9b6b('0xd'),_0x9b6b('0xe')]})['then'](function(_0x313791){if(_0x313791){_0x5520ee=_0x313791;_0x357619=_0x5520ee[_0x9b6b('0xe')]||0x1388;}})['then'](function(){return dbH[_0x9b6b('0xf')][_0x9b6b('0x10')](util[_0x9b6b('0x9')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x9b6b('0xf')][_0x9b6b('0x11')][_0x9b6b('0x12')]});})['then'](function(_0xb6058d){if(!_0xb6058d[0x0][_0x9b6b('0x13')]){return analyticExtractedReport('Empty');}var _0x217116=[];var _0x1fda5a=0x0;if(_0x5520ee['split']){if(_0xb6058d&&_0xb6058d['length']){var _0x156db5=_['range'](_0xb6058d[0x0]['num']/_0x357619);var _0x5dd058=Number['isInteger'](_0xb6058d[0x0][_0x9b6b('0x13')]/_0x357619)?_0xb6058d[0x0]['num']%_0x357619:0x0;_0x156db5[_0x9b6b('0x14')](function(_0x26349f){if(_0x26349f>0x0){_0x1fda5a+=_0x357619;}_0x217116[_0x9b6b('0x15')](dbH['sequelize'][_0x9b6b('0x10')](util[_0x9b6b('0x9')](_0x9b6b('0x16'),QUERY,_0x357619,_0x1fda5a),{'type':dbH[_0x9b6b('0xf')][_0x9b6b('0x11')]['SELECT']}));});if(_0x5dd058>0x0){_0x1fda5a+=_0x357619;_0x217116[_0x9b6b('0x15')](dbH['sequelize'][_0x9b6b('0x10')](util[_0x9b6b('0x9')](_0x9b6b('0x16'),QUERY,_0x5dd058,_0x1fda5a),{'type':dbH[_0x9b6b('0xf')][_0x9b6b('0x11')][_0x9b6b('0x12')]}));}}}else{_0x217116['push'](dbH[_0x9b6b('0xf')][_0x9b6b('0x10')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0x9b6b('0x12')]}));}var _0x5bbff8=path[_0x9b6b('0x17')](PATH);var _0x33a615=path[_0x9b6b('0x18')](PATH,_0x9b6b('0x19'));var _0x46bcef=_0x5520ee[_0x9b6b('0xd')]&&_0x217116[_0x9b6b('0x1a')]>0x1;var _0x3f23d2=[];if(!fs['existsSync'](path[_0x9b6b('0x1b')](_0x5bbff8,_0x33a615))&&_0x46bcef){fs['mkdirSync'](path[_0x9b6b('0x1b')](_0x5bbff8,_0x33a615));}return BPromise[_0x9b6b('0x1c')](_0x217116,function(_0x58fac4){_0x3f23d2[_0x9b6b('0x15')](_0x58fac4);})['then'](function(){for(var _0x25e45e=0x0;_0x25e45e<_0x3f23d2['length'];_0x25e45e+=0x1){var _0x70666e;var _0x149bc2=_0x3f23d2[_0x25e45e];if(_0x46bcef){_0x70666e=path[_0x9b6b('0x1b')](_0x5bbff8,_0x33a615,util[_0x9b6b('0x9')](_0x9b6b('0x1d'),_0x33a615,_0x25e45e,_0x9b6b('0x1e')));}else{_0x70666e=path['join'](_0x5bbff8,util[_0x9b6b('0x9')](_0x9b6b('0x1f'),_0x33a615,'csv'));}fs['writeFileSync'](_0x70666e,csv(_0x149bc2));}})['then'](function(){if(_0x46bcef){return new Promise(function(_0x59850d){zipdir(path['join'](_0x5bbff8,_0x33a615),{'saveTo':path['join'](_0x5bbff8,util['format']('%s.%s',_0x33a615,_0x9b6b('0x20')))},function(_0x30c4b4,_0x4031f7){rimraf(path[_0x9b6b('0x1b')](_0x5bbff8,_0x33a615),function(){});_0x59850d(_0x9b6b('0x21'));});});}})[_0x9b6b('0x22')](function(){logger['info'](util[_0x9b6b('0x9')](_0x9b6b('0x23'),EXTRACTED_REPORT_ID,_0x9b6b('0xb')));return analyticExtractedReport(_0x9b6b('0x24'),_0x46bcef?util['format']('%s.%s',_0x33a615,_0x46bcef?_0x9b6b('0x20'):_0x9b6b('0x1e')):null);});})['catch'](function(_0x4260cf){logger['info'](util['format'](_0x9b6b('0x25'),EXTRACTED_REPORT_ID,_0x9b6b('0xb')),util['inspect'](_0x4260cf,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x9b6b('0x26')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x87f5=['%s.%s','writeFileSync','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','util','path','lodash','bluebird','zip-dir','rimraf','../../mysqldb','../../config/logger','analytics','argv','savename','update','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','range','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','existsSync','join','each','length'];(function(_0x35fb07,_0x14d5a1){var _0xeda50c=function(_0xf2b10b){while(--_0xf2b10b){_0x35fb07['push'](_0x35fb07['shift']());}};_0xeda50c(++_0x14d5a1);}(_0x87f5,0x162));var _0x587f=function(_0x416aed,_0x556c97){_0x416aed=_0x416aed-0x0;var _0x2cbadc=_0x87f5[_0x416aed];return _0x2cbadc;};'use strict';var util=require(_0x587f('0x0'));var path=require(_0x587f('0x1'));var _=require(_0x587f('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x587f('0x3'));var zipdir=require(_0x587f('0x4'));var rimraf=require(_0x587f('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0x587f('0x6'))['dbH'];var logger=require(_0x587f('0x7'))(_0x587f('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x587f('0x9')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xbedc99,_0x460a5e){var _0x17d7fa={'status':_0xbedc99};var _0x249df1={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x460a5e){_0x17d7fa[_0x587f('0xa')]=_0x460a5e;}return db['AnalyticExtractedReport'][_0x587f('0xb')](_0x17d7fa,_0x249df1);}function main(){var _0x40a469=0x1388;var _0x2d34e6;logger['info'](util['format'](_0x587f('0xc'),EXTRACTED_REPORT_ID,_0x587f('0xd')));return db[_0x587f('0xe')][_0x587f('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x587f('0x10'),_0x587f('0x11')]})[_0x587f('0x12')](function(_0x42cb51){if(_0x42cb51){_0x2d34e6=_0x42cb51;_0x40a469=_0x2d34e6[_0x587f('0x11')]||0x1388;}})[_0x587f('0x12')](function(){return dbH[_0x587f('0x13')][_0x587f('0x14')](util[_0x587f('0x15')](_0x587f('0x16'),QUERY),{'type':dbH[_0x587f('0x13')][_0x587f('0x17')][_0x587f('0x18')]});})[_0x587f('0x12')](function(_0x25015e){if(!_0x25015e[0x0][_0x587f('0x19')]){return analyticExtractedReport(_0x587f('0x1a'));}var _0x57343a=[];var _0x1440f6=0x0;if(_0x2d34e6[_0x587f('0x10')]){if(_0x25015e&&_0x25015e['length']){var _0x155b76=_[_0x587f('0x1b')](_0x25015e[0x0][_0x587f('0x19')]/_0x40a469);var _0x4e594f=Number[_0x587f('0x1c')](_0x25015e[0x0]['num']/_0x40a469)?_0x25015e[0x0][_0x587f('0x19')]%_0x40a469:0x0;_0x155b76['forEach'](function(_0x1bf3da){if(_0x1bf3da>0x0){_0x1440f6+=_0x40a469;}_0x57343a[_0x587f('0x1d')](dbH[_0x587f('0x13')][_0x587f('0x14')](util[_0x587f('0x15')](_0x587f('0x1e'),QUERY,_0x40a469,_0x1440f6),{'type':dbH[_0x587f('0x13')][_0x587f('0x17')][_0x587f('0x18')]}));});if(_0x4e594f>0x0){_0x1440f6+=_0x40a469;_0x57343a[_0x587f('0x1d')](dbH[_0x587f('0x13')][_0x587f('0x14')](util['format'](_0x587f('0x1e'),QUERY,_0x4e594f,_0x1440f6),{'type':dbH[_0x587f('0x13')][_0x587f('0x17')][_0x587f('0x18')]}));}}}else{_0x57343a[_0x587f('0x1d')](dbH[_0x587f('0x13')][_0x587f('0x14')](QUERY,{'type':dbH[_0x587f('0x13')]['QueryTypes']['SELECT']}));}var _0x44717b=path[_0x587f('0x1f')](PATH);var _0x2e302f=path[_0x587f('0x20')](PATH,_0x587f('0x21'));var _0x1e1a5d=_0x2d34e6[_0x587f('0x10')]&&_0x57343a['length']>0x1;var _0x43a9b7=[];if(!fs[_0x587f('0x22')](path[_0x587f('0x23')](_0x44717b,_0x2e302f))&&_0x1e1a5d){fs['mkdirSync'](path[_0x587f('0x23')](_0x44717b,_0x2e302f));}return BPromise[_0x587f('0x24')](_0x57343a,function(_0xe73b60){_0x43a9b7[_0x587f('0x1d')](_0xe73b60);})[_0x587f('0x12')](function(){for(var _0x666168=0x0;_0x666168<_0x43a9b7[_0x587f('0x25')];_0x666168+=0x1){var _0x116645;var _0x5bf403=_0x43a9b7[_0x666168];if(_0x1e1a5d){_0x116645=path[_0x587f('0x23')](_0x44717b,_0x2e302f,util[_0x587f('0x15')]('%s%d.%s',_0x2e302f,_0x666168,'csv'));}else{_0x116645=path[_0x587f('0x23')](_0x44717b,util['format'](_0x587f('0x26'),_0x2e302f,'csv'));}fs[_0x587f('0x27')](_0x116645,csv(_0x5bf403));}})[_0x587f('0x12')](function(){if(_0x1e1a5d){return new Promise(function(_0x36248e){zipdir(path[_0x587f('0x23')](_0x44717b,_0x2e302f),{'saveTo':path[_0x587f('0x23')](_0x44717b,util[_0x587f('0x15')]('%s.%s',_0x2e302f,_0x587f('0x28')))},function(_0x3798a5,_0x5b1082){rimraf(path[_0x587f('0x23')](_0x44717b,_0x2e302f),function(){});_0x36248e(_0x587f('0x29'));});});}})[_0x587f('0x12')](function(){logger[_0x587f('0x2a')](util[_0x587f('0x15')](_0x587f('0x2b'),EXTRACTED_REPORT_ID,_0x587f('0xd')));return analyticExtractedReport(_0x587f('0x2c'),_0x1e1a5d?util[_0x587f('0x15')](_0x587f('0x26'),_0x2e302f,_0x1e1a5d?_0x587f('0x28'):'csv'):null);});})['catch'](function(_0x37d35a){logger['info'](util[_0x587f('0x15')](_0x587f('0x2d'),EXTRACTED_REPORT_ID,_0x587f('0xd')),util[_0x587f('0x2e')](_0x37d35a,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x587f('0x2f'));})[_0x587f('0x30')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index bdfe62c..4d06e36 100644 --- a/server/components/export/pdf.js +++ b/server/components/export/pdf.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7b21=['savename','AnalyticExtractedReport','update','map','tableHeader','pick','toString','value','length','auto','body','push','concat','keys','forEach','format','name','startDate','endDate','header','before','margin','\x20/\x20','footer','Arial','num','Setting','find','split','splitSizePdf','then','isInteger','query','sequelize','QueryTypes','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.pdf','existsSync','join','mkdirSync','each','flatten','createPdfKitDocument','pdf','%s.%s','zip','zip\x20finished','info','PDF','Completed','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','pipe','createWriteStream','finish','error','createPdfFromHTML','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','window','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7b21,0x19f));var _0x17b2=function(_0x552711,_0x376342){_0x552711=_0x552711-0x0;var _0x379f53=_0x7b21[_0x552711];return _0x379f53;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0x17b2('0x0'));var path=require(_0x17b2('0x1'));var moment=require(_0x17b2('0x2'));var htmlToPdfmake=require(_0x17b2('0x3'));var PdfPrinter=require(_0x17b2('0x4'));var zipdir=require(_0x17b2('0x5'));var rimraf=require(_0x17b2('0x6'));var JSDOM=require(_0x17b2('0x7'))['JSDOM'];var window=new JSDOM('')[_0x17b2('0x8')];var BPromise=require('bluebird');var db=require(_0x17b2('0x9'))['db'];var dbH=require(_0x17b2('0x9'))[_0x17b2('0xa')];var logger=require(_0x17b2('0xb'))(_0x17b2('0xc'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x17b2('0xd')][0x3];var PATH=process[_0x17b2('0xd')][0x4];var NAME=process[_0x17b2('0xd')][0x5];var FORMAT=_0x17b2('0xe');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x1a107b,_0x3b45c9){var _0x5af14c={'status':_0x1a107b};var _0x2a0b9b={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3b45c9){_0x5af14c[_0x17b2('0xf')]=_0x3b45c9;}return db[_0x17b2('0x10')][_0x17b2('0x11')](_0x5af14c,_0x2a0b9b);}function getHeaders(_0x527e12){return _[_0x17b2('0x12')](_0x527e12,function(_0x2f6543){return{'text':_0x2f6543,'style':_0x17b2('0x13')};});}function getRows(_0x1b5709,_0x4ed225){return _[_0x17b2('0x12')](_0x4ed225,function(_0x14102d){return _(_0x14102d)[_0x17b2('0x14')](_0x1b5709)['map'](function(_0x3d1e2a){return _0x3d1e2a?_[_0x17b2('0x15')](_0x3d1e2a):'';})[_0x17b2('0x16')]();});}function createTable(_0x3d0b79,_0x1094fd){var _0x102a77={'widths':_['fill'](Array(_0x3d0b79[_0x17b2('0x17')]),0x91),'heights':function(_0x3dde7f){return _0x3dde7f===0x0?_0x17b2('0x18'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x23f966=getHeaders(_0x3d0b79);_0x102a77[_0x17b2('0x19')][_0x17b2('0x1a')](_0x23f966);var _0x3989b9=getRows(_0x3d0b79,_0x1094fd);_0x102a77[_0x17b2('0x19')]=_0x102a77['body'][_0x17b2('0x1b')](_0x3989b9);return _0x102a77;}function createTables(_0x17ba1d){var _0x45bb88=[];var _0x2003ed=_['chunk'](Object[_0x17b2('0x1c')](_0x17ba1d[0x0]),0x5);_0x2003ed[_0x17b2('0x1d')](function(_0x477cf1){_0x45bb88['push'](createTable(_0x477cf1,_0x17ba1d));});return _0x45bb88;}function getPDFDocDefinition(_0x5491cd){var _0x407ec2=util[_0x17b2('0x1e')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0x17b2('0x1f')],moment(EXTRACTED_REPORT[_0x17b2('0x20')])[_0x17b2('0x1e')](FORMAT),moment(EXTRACTED_REPORT[_0x17b2('0x21')])[_0x17b2('0x1e')](FORMAT));var _0x205510=[];for(var _0x33083b=0x0;_0x33083b<_0x5491cd[_0x17b2('0x17')];_0x33083b++){var _0x2f24fa=[];if(_0x33083b===0x0){_0x2f24fa['push']({'text':_0x407ec2,'style':_0x17b2('0x22')});}var _0x581ae2={'table':_0x5491cd[_0x33083b]};if(_0x33083b>0x0){_0x581ae2['pageBreak']=_0x17b2('0x23');_0x581ae2[_0x17b2('0x24')]=[0x0,0x46,0x0,0x0];}_0x2f24fa[_0x17b2('0x1a')](_0x581ae2);_0x205510[_0x17b2('0x1a')](_0x2f24fa);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x205510,'footer':function(_0x59b4d0,_0x1f8cc0){return{'text':_0x59b4d0[_0x17b2('0x15')]()+_0x17b2('0x25')+_0x1f8cc0,'style':_0x17b2('0x26')};},'defaultStyle':{'font':_0x17b2('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x29e333){var _0x5e8a5d=0x1388;var _0x4f95a6;if(!_0x29e333[0x0][_0x17b2('0x28')]){return analyticExtractedReport('Empty');}return db[_0x17b2('0x29')][_0x17b2('0x2a')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x17b2('0x2b'),_0x17b2('0x2c')]})[_0x17b2('0x2d')](function(_0x208e74){if(_0x208e74){_0x4f95a6=_0x208e74;_0x5e8a5d=_0x4f95a6[_0x17b2('0x2c')]||0x3e8;}})['then'](function(){var _0x27308a=[];var _0x9322ad=0x0;if(_0x4f95a6[_0x17b2('0x2b')]){if(_0x29e333&&_0x29e333[_0x17b2('0x17')]){var _0x19a137=_['range'](_0x29e333[0x0][_0x17b2('0x28')]/_0x5e8a5d);var _0x313dc9=Number[_0x17b2('0x2e')](_0x29e333[0x0][_0x17b2('0x28')]/_0x5e8a5d)?_0x29e333[0x0][_0x17b2('0x28')]%_0x5e8a5d:0x0;_0x19a137['forEach'](function(_0x1913aa){if(_0x1913aa>0x0){_0x9322ad+=_0x5e8a5d;}_0x27308a[_0x17b2('0x1a')](dbH['sequelize'][_0x17b2('0x2f')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5e8a5d,_0x9322ad),{'type':dbH[_0x17b2('0x30')][_0x17b2('0x31')][_0x17b2('0x32')]}));});if(_0x313dc9>0x0){_0x9322ad+=_0x5e8a5d;_0x27308a['push'](dbH['sequelize'][_0x17b2('0x2f')](util[_0x17b2('0x1e')](_0x17b2('0x33'),QUERY,_0x313dc9,_0x9322ad),{'type':dbH['sequelize'][_0x17b2('0x31')][_0x17b2('0x32')]}));}}}else{_0x27308a['push'](dbH[_0x17b2('0x30')][_0x17b2('0x2f')](QUERY,{'type':dbH[_0x17b2('0x30')][_0x17b2('0x31')]['SELECT']}));}var _0x5e8540=path['dirname'](PATH);var _0x4fe7a6=path[_0x17b2('0x34')](PATH,_0x17b2('0x35'));var _0x3b37d1=_0x4f95a6[_0x17b2('0x2b')]&&_0x27308a[_0x17b2('0x17')]>0x1;var _0xee9542=[];if(!fs[_0x17b2('0x36')](path[_0x17b2('0x37')](_0x5e8540,_0x4fe7a6))&&_0x3b37d1){fs[_0x17b2('0x38')](path[_0x17b2('0x37')](_0x5e8540,_0x4fe7a6));}return BPromise[_0x17b2('0x39')](_0x27308a,function(_0x1e236d){_0xee9542['push'](_0x1e236d);})[_0x17b2('0x2d')](function(){var _0x3f26f1=[];for(var _0x502aa5=0x0;_0x502aa5<_0xee9542[_0x17b2('0x17')];_0x502aa5+=0x1){var _0xe7899f=_0xee9542[_0x502aa5];var _0x845716=createTables(_[_0x17b2('0x3a')](_0xe7899f));var _0x1038e5;var _0x303797=getPDFDocDefinition(_0x845716);var _0xeb76e5=getPDFPrinter();var _0x16d778=_0xeb76e5[_0x17b2('0x3b')](_0x303797);if(_0x3b37d1){_0x1038e5=path[_0x17b2('0x37')](_0x5e8540,_0x4fe7a6,util[_0x17b2('0x1e')]('%s%d.%s',_0x4fe7a6,_0x502aa5,_0x17b2('0x3c')));}else{_0x1038e5=path[_0x17b2('0x37')](_0x5e8540,util[_0x17b2('0x1e')]('%s.%s',_0x4fe7a6,_0x17b2('0x3c')));}_0x3f26f1['push'](writePDFDocument(_0x16d778,_0x1038e5));}return Promise['all'](_0x3f26f1);})[_0x17b2('0x2d')](function(){if(_0x3b37d1){return new Promise(function(_0x5b5ed4){zipdir(path['join'](_0x5e8540,_0x4fe7a6),{'saveTo':path[_0x17b2('0x37')](_0x5e8540,util['format'](_0x17b2('0x3d'),_0x4fe7a6,_0x17b2('0x3e')))},function(){rimraf(path[_0x17b2('0x37')](_0x5e8540,_0x4fe7a6),function(){});_0x5b5ed4(_0x17b2('0x3f'));});});}})[_0x17b2('0x2d')](function(){if(!_0x3b37d1)return;rimraf(path[_0x17b2('0x37')](_0x5e8540,_0x4fe7a6),function(){});})[_0x17b2('0x2d')](function(){logger[_0x17b2('0x40')](util[_0x17b2('0x1e')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x17b2('0x41')));return analyticExtractedReport(_0x17b2('0x42'),_0x3b37d1?util['format']('%s.%s',_0x4fe7a6,_0x3b37d1?_0x17b2('0x3e'):_0x17b2('0x3c')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x17b2('0x40')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'));return db['AnalyticExtractedReport']['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0x17b2('0x2d')](function(_0x3a64b0){EXTRACTED_REPORT=_0x3a64b0;return dbH[_0x17b2('0x30')]['query'](util[_0x17b2('0x1e')](_0x17b2('0x43'),QUERY),{'type':dbH[_0x17b2('0x30')][_0x17b2('0x31')][_0x17b2('0x32')]});})[_0x17b2('0x2d')](extractReport)[_0x17b2('0x44')](function(_0x317686){logger[_0x17b2('0x40')](util[_0x17b2('0x1e')](_0x17b2('0x45'),EXTRACTED_REPORT_ID,_0x17b2('0x41')),util['inspect'](_0x317686,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x17b2('0x46'));})[_0x17b2('0x47')](function(){process[_0x17b2('0x48')](EXIT_CODE);});}main();function getPDFPrinter(){var _0xfb43f8=new PdfPrinter({'Arial':{'normal':__dirname+_0x17b2('0x49'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0x17b2('0x4a'),'bolditalics':__dirname+_0x17b2('0x4b')}});return _0xfb43f8;}function getPDFDocDefinitionFromHTML(_0x4856fa,_0x59bccf){var _0xeb1047=util[_0x17b2('0x1e')](_0x17b2('0x4c'),_0x59bccf[_0x17b2('0x4d')],_0x59bccf[_0x17b2('0x4e')]);var _0x30b908=moment()['format'](_0x17b2('0x4f'))['toString']();var _0xdab2c3=htmlToPdfmake(_0x4856fa,{'window':window,'tableAutoSize':!![]});return{'content':[_0xdab2c3],'defaultStyle':{'font':_0x17b2('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x17b2('0x50'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x17b2('0x50'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x17b2('0x50')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':'header'}];},'footer':function(_0x4d6a90,_0x59ae1d){return[{'text':util[_0x17b2('0x1e')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0xeb1047,_0x4d6a90,_0x59ae1d,_0x30b908),'style':'footer'}];}};}function writePDFDocument(_0x37c244,_0x3d8095){return new Promise(function(_0xc4baf,_0x24c9dd){var _0x17b424=_0x37c244[_0x17b2('0x51')](fs[_0x17b2('0x52')](_0x3d8095));_0x17b424['on'](_0x17b2('0x53'),function(){_0xc4baf(_0x17b2('0x53'));});_0x17b424['on'](_0x17b2('0x54'),function(_0xce0148){_0x24c9dd(_0xce0148);});_0x37c244['end']();});}exports[_0x17b2('0x55')]=function(_0x52fe39,_0x2167c0){var _0x476624=getPDFPrinter();var _0x16e0f4=getPDFDocDefinitionFromHTML(_0x52fe39,_0x2167c0);var _0x3dc083=_0x476624['createPdfKitDocument'](_0x16e0f4);return writePDFDocument(_0x3dc083,_0x2167c0[_0x17b2('0x1')])['catch'](function(_0x56e13b){throw _0x56e13b;});}; \ No newline at end of file +var _0x4b85=['SELECT','query','QueryTypes','dirname','basename','.pdf','existsSync','join','mkdirSync','flatten','createPdfKitDocument','%s.%s','all','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','pdf','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','Arial','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','footer','pipe','createWriteStream','finish','error','createPdfFromHTML','path','util','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','pick','toString','length','body','concat','chunk','keys','forEach','push','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','before','margin','landscape','black','Empty','splitSizePdf','then','split','range','num','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize'];(function(_0x31d525,_0x186377){var _0x3febd5=function(_0x563b53){while(--_0x563b53){_0x31d525['push'](_0x31d525['shift']());}};_0x3febd5(++_0x186377);}(_0x4b85,0x1ea));var _0x54b8=function(_0x89faf4,_0x264aaa){_0x89faf4=_0x89faf4-0x0;var _0x141ad7=_0x4b85[_0x89faf4];return _0x141ad7;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0x54b8('0x0'));var path=require('path');var moment=require('moment');var htmlToPdfmake=require(_0x54b8('0x1'));var PdfPrinter=require(_0x54b8('0x2'));var zipdir=require(_0x54b8('0x3'));var rimraf=require(_0x54b8('0x4'));var JSDOM=require(_0x54b8('0x5'))['JSDOM'];var window=new JSDOM('')['window'];var BPromise=require(_0x54b8('0x6'));var db=require(_0x54b8('0x7'))['db'];var dbH=require(_0x54b8('0x7'))[_0x54b8('0x8')];var logger=require(_0x54b8('0x9'))(_0x54b8('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x54b8('0xb')][0x2]);var QUERY=process[_0x54b8('0xb')][0x3];var PATH=process[_0x54b8('0xb')][0x4];var NAME=process[_0x54b8('0xb')][0x5];var FORMAT=_0x54b8('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x41756f,_0x17c84f){var _0x4eebba={'status':_0x41756f};var _0x1f6cbe={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x17c84f){_0x4eebba[_0x54b8('0xd')]=_0x17c84f;}return db[_0x54b8('0xe')][_0x54b8('0xf')](_0x4eebba,_0x1f6cbe);}function getHeaders(_0x5d1a50){return _[_0x54b8('0x10')](_0x5d1a50,function(_0x67eeae){return{'text':_0x67eeae,'style':'tableHeader'};});}function getRows(_0x59b797,_0x290732){return _[_0x54b8('0x10')](_0x290732,function(_0x12954b){return _(_0x12954b)[_0x54b8('0x11')](_0x59b797)[_0x54b8('0x10')](function(_0x42cb4c){return _0x42cb4c?_[_0x54b8('0x12')](_0x42cb4c):'';})['value']();});}function createTable(_0x38ec1e,_0x29288f){var _0x32a87b={'widths':_['fill'](Array(_0x38ec1e[_0x54b8('0x13')]),0x91),'heights':function(_0x1db1ab){return _0x1db1ab===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x1bc6fb=getHeaders(_0x38ec1e);_0x32a87b[_0x54b8('0x14')]['push'](_0x1bc6fb);var _0x1fd769=getRows(_0x38ec1e,_0x29288f);_0x32a87b[_0x54b8('0x14')]=_0x32a87b['body'][_0x54b8('0x15')](_0x1fd769);return _0x32a87b;}function createTables(_0x481333){var _0x158dd5=[];var _0x30c83=_[_0x54b8('0x16')](Object[_0x54b8('0x17')](_0x481333[0x0]),0x5);_0x30c83[_0x54b8('0x18')](function(_0x5b22ee){_0x158dd5[_0x54b8('0x19')](createTable(_0x5b22ee,_0x481333));});return _0x158dd5;}function getPDFDocDefinition(_0x477021){var _0xcb970b=util[_0x54b8('0x1a')](_0x54b8('0x1b'),NAME,EXTRACTED_REPORT[_0x54b8('0x1c')],moment(EXTRACTED_REPORT[_0x54b8('0x1d')])[_0x54b8('0x1a')](FORMAT),moment(EXTRACTED_REPORT[_0x54b8('0x1e')])[_0x54b8('0x1a')](FORMAT));var _0x2065e5=[];for(var _0x23b5d6=0x0;_0x23b5d6<_0x477021[_0x54b8('0x13')];_0x23b5d6++){var _0x27ac7a=[];if(_0x23b5d6===0x0){_0x27ac7a[_0x54b8('0x19')]({'text':_0xcb970b,'style':_0x54b8('0x1f')});}var _0x372179={'table':_0x477021[_0x23b5d6]};if(_0x23b5d6>0x0){_0x372179['pageBreak']=_0x54b8('0x20');_0x372179[_0x54b8('0x21')]=[0x0,0x46,0x0,0x0];}_0x27ac7a[_0x54b8('0x19')](_0x372179);_0x2065e5['push'](_0x27ac7a);}return{'pageSize':'A4','pageOrientation':_0x54b8('0x22'),'content':_0x2065e5,'footer':function(_0x1afbc5,_0x58cb0f){return{'text':_0x1afbc5[_0x54b8('0x12')]()+'\x20/\x20'+_0x58cb0f,'style':'footer'};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x54b8('0x23')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x5dd467){var _0x2cd2ef=0x1388;var _0x504fe3;if(!_0x5dd467[0x0]['num']){return analyticExtractedReport(_0x54b8('0x24'));}return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x54b8('0x25')]})[_0x54b8('0x26')](function(_0x3bce6a){if(_0x3bce6a){_0x504fe3=_0x3bce6a;_0x2cd2ef=_0x504fe3['splitSizePdf']||0x3e8;}})[_0x54b8('0x26')](function(){var _0x2c14be=[];var _0x3743c0=0x0;if(_0x504fe3[_0x54b8('0x27')]){if(_0x5dd467&&_0x5dd467[_0x54b8('0x13')]){var _0x32faf0=_[_0x54b8('0x28')](_0x5dd467[0x0][_0x54b8('0x29')]/_0x2cd2ef);var _0x22de4b=Number['isInteger'](_0x5dd467[0x0]['num']/_0x2cd2ef)?_0x5dd467[0x0]['num']%_0x2cd2ef:0x0;_0x32faf0['forEach'](function(_0x3ee744){if(_0x3ee744>0x0){_0x3743c0+=_0x2cd2ef;}_0x2c14be[_0x54b8('0x19')](dbH['sequelize']['query'](util['format'](_0x54b8('0x2a'),QUERY,_0x2cd2ef,_0x3743c0),{'type':dbH[_0x54b8('0x2b')]['QueryTypes'][_0x54b8('0x2c')]}));});if(_0x22de4b>0x0){_0x3743c0+=_0x2cd2ef;_0x2c14be[_0x54b8('0x19')](dbH['sequelize'][_0x54b8('0x2d')](util[_0x54b8('0x1a')](_0x54b8('0x2a'),QUERY,_0x22de4b,_0x3743c0),{'type':dbH[_0x54b8('0x2b')][_0x54b8('0x2e')][_0x54b8('0x2c')]}));}}}else{_0x2c14be[_0x54b8('0x19')](dbH[_0x54b8('0x2b')][_0x54b8('0x2d')](QUERY,{'type':dbH[_0x54b8('0x2b')][_0x54b8('0x2e')][_0x54b8('0x2c')]}));}var _0x4431d8=path[_0x54b8('0x2f')](PATH);var _0x40d1aa=path[_0x54b8('0x30')](PATH,_0x54b8('0x31'));var _0x375dd7=_0x504fe3['split']&&_0x2c14be[_0x54b8('0x13')]>0x1;var _0x773a53=[];if(!fs[_0x54b8('0x32')](path[_0x54b8('0x33')](_0x4431d8,_0x40d1aa))&&_0x375dd7){fs[_0x54b8('0x34')](path[_0x54b8('0x33')](_0x4431d8,_0x40d1aa));}return BPromise['each'](_0x2c14be,function(_0x12d50c){_0x773a53['push'](_0x12d50c);})[_0x54b8('0x26')](function(){var _0x1a8deb=[];for(var _0x299cbb=0x0;_0x299cbb<_0x773a53['length'];_0x299cbb+=0x1){var _0x6a8381=_0x773a53[_0x299cbb];var _0x2349e0=createTables(_[_0x54b8('0x35')](_0x6a8381));var _0x5c6d84;var _0xc16a5e=getPDFDocDefinition(_0x2349e0);var _0x450b74=getPDFPrinter();var _0x43dbd2=_0x450b74[_0x54b8('0x36')](_0xc16a5e);if(_0x375dd7){_0x5c6d84=path[_0x54b8('0x33')](_0x4431d8,_0x40d1aa,util[_0x54b8('0x1a')]('%s%d.%s',_0x40d1aa,_0x299cbb,'pdf'));}else{_0x5c6d84=path[_0x54b8('0x33')](_0x4431d8,util[_0x54b8('0x1a')](_0x54b8('0x37'),_0x40d1aa,'pdf'));}_0x1a8deb['push'](writePDFDocument(_0x43dbd2,_0x5c6d84));}return Promise[_0x54b8('0x38')](_0x1a8deb);})['then'](function(){if(_0x375dd7){return new Promise(function(_0x2ef255){zipdir(path[_0x54b8('0x33')](_0x4431d8,_0x40d1aa),{'saveTo':path['join'](_0x4431d8,util['format'](_0x54b8('0x37'),_0x40d1aa,_0x54b8('0x39')))},function(){rimraf(path['join'](_0x4431d8,_0x40d1aa),function(){});_0x2ef255(_0x54b8('0x3a'));});});}})[_0x54b8('0x26')](function(){if(!_0x375dd7)return;rimraf(path['join'](_0x4431d8,_0x40d1aa),function(){});})[_0x54b8('0x26')](function(){logger[_0x54b8('0x3b')](util[_0x54b8('0x1a')](_0x54b8('0x3c'),EXTRACTED_REPORT_ID,_0x54b8('0x3d')));return analyticExtractedReport(_0x54b8('0x3e'),_0x375dd7?util[_0x54b8('0x1a')]('%s.%s',_0x40d1aa,_0x375dd7?'zip':_0x54b8('0x3f')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x54b8('0x3b')](util[_0x54b8('0x1a')](_0x54b8('0x40'),EXTRACTED_REPORT_ID,_0x54b8('0x3d')));return db[_0x54b8('0xe')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0x54b8('0x26')](function(_0x531d1d){EXTRACTED_REPORT=_0x531d1d;return dbH[_0x54b8('0x2b')]['query'](util[_0x54b8('0x1a')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x54b8('0x2b')][_0x54b8('0x2e')][_0x54b8('0x2c')]});})['then'](extractReport)[_0x54b8('0x41')](function(_0x38ee24){logger[_0x54b8('0x3b')](util[_0x54b8('0x1a')](_0x54b8('0x42'),EXTRACTED_REPORT_ID,_0x54b8('0x3d')),util[_0x54b8('0x43')](_0x38ee24,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x54b8('0x44'));})[_0x54b8('0x45')](function(){process[_0x54b8('0x46')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x39a664=new PdfPrinter({'Arial':{'normal':__dirname+_0x54b8('0x47'),'bold':__dirname+_0x54b8('0x48'),'italics':__dirname+_0x54b8('0x49'),'bolditalics':__dirname+_0x54b8('0x4a')}});return _0x39a664;}function getPDFDocDefinitionFromHTML(_0x50d930,_0x24e139){var _0x202895=util[_0x54b8('0x1a')](_0x54b8('0x4b'),_0x24e139[_0x54b8('0x4c')],_0x24e139[_0x54b8('0x4d')]);var _0x2fd534=moment()['format'](_0x54b8('0x4e'))[_0x54b8('0x12')]();var _0x201fda=htmlToPdfmake(_0x50d930,{'window':window,'tableAutoSize':!![]});return{'content':[_0x201fda],'defaultStyle':{'font':_0x54b8('0x4f')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x54b8('0x50'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x54b8('0x50'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x54b8('0x50')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0x54b8('0x1f')}];},'footer':function(_0x25b941,_0x13fd17){return[{'text':util['format'](_0x54b8('0x51'),_0x202895,_0x25b941,_0x13fd17,_0x2fd534),'style':_0x54b8('0x52')}];}};}function writePDFDocument(_0x21e87,_0x14e0bd){return new Promise(function(_0xfb8c34,_0x4f15d3){var _0x37e2fd=_0x21e87[_0x54b8('0x53')](fs[_0x54b8('0x54')](_0x14e0bd));_0x37e2fd['on']('finish',function(){_0xfb8c34(_0x54b8('0x55'));});_0x37e2fd['on'](_0x54b8('0x56'),function(_0x409261){_0x4f15d3(_0x409261);});_0x21e87['end']();});}exports[_0x54b8('0x57')]=function(_0x319bbd,_0x33ddc0){var _0x1a2f8d=getPDFPrinter();var _0x170dac=getPDFDocDefinitionFromHTML(_0x319bbd,_0x33ddc0);var _0x129331=_0x1a2f8d['createPdfKitDocument'](_0x170dac);return writePDFDocument(_0x129331,_0x33ddc0[_0x54b8('0x58')])[_0x54b8('0x41')](function(_0x105366){throw _0x105366;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index e00ce66..75c403c 100644 --- a/server/components/export/xlsx.js +++ b/server/components/export/xlsx.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e49=['existsSync','join','each','%s.%s','xlsx','writeFileSync','binary','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','json2xls','zip-dir','rimraf','analytics','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','split','splitSizeXlsx','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','SELECT','num','Empty','range','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','basename','.xlsx','length'];(function(_0xc8f777,_0xe9e88f){var _0x28bce1=function(_0x3d4da5){while(--_0x3d4da5){_0xc8f777['push'](_0xc8f777['shift']());}};_0x28bce1(++_0xe9e88f);}(_0x3e49,0xfb));var _0x93e4=function(_0x5cbf7b,_0x34e24b){_0x5cbf7b=_0x5cbf7b-0x0;var _0xc91356=_0x3e49[_0x5cbf7b];return _0xc91356;};'use strict';var util=require(_0x93e4('0x0'));var path=require(_0x93e4('0x1'));var _=require(_0x93e4('0x2'));var fs=require('fs');var json2xls=require(_0x93e4('0x3'));var BPromise=require('bluebird');var zipdir=require(_0x93e4('0x4'));var rimraf=require(_0x93e4('0x5'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require('../../config/logger')(_0x93e4('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x93e4('0x7')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x93e4('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x438831,_0x33390d){var _0x195909={'status':_0x438831};var _0x206a64={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x33390d){_0x195909[_0x93e4('0x8')]=_0x33390d;}return db[_0x93e4('0x9')]['update'](_0x195909,_0x206a64);}function main(){var _0x113d53=0x1388;var _0x53a943;logger[_0x93e4('0xa')](util[_0x93e4('0xb')](_0x93e4('0xc'),EXTRACTED_REPORT_ID,_0x93e4('0xd')));return db[_0x93e4('0xe')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x93e4('0xf'),_0x93e4('0x10')]})[_0x93e4('0x11')](function(_0x4d5d66){if(_0x4d5d66){_0x53a943=_0x4d5d66;_0x113d53=_0x53a943[_0x93e4('0x10')]||0x1388;}})[_0x93e4('0x11')](function(){return dbH['sequelize'][_0x93e4('0x12')](util[_0x93e4('0xb')](_0x93e4('0x13'),QUERY),{'type':dbH[_0x93e4('0x14')]['QueryTypes'][_0x93e4('0x15')]});})['then'](function(_0x4ba240){if(!_0x4ba240[0x0][_0x93e4('0x16')]){return analyticExtractedReport(_0x93e4('0x17'));}var _0x5b1a67=[];var _0x123da8=0x0;if(_0x53a943[_0x93e4('0xf')]){if(_0x4ba240&&_0x4ba240['length']){var _0xc5ce72=_[_0x93e4('0x18')](_0x4ba240[0x0]['num']/_0x113d53);var _0x238091=Number['isInteger'](_0x4ba240[0x0][_0x93e4('0x16')]/_0x113d53)?_0x4ba240[0x0][_0x93e4('0x16')]%_0x113d53:0x0;_0xc5ce72['forEach'](function(_0x3dfb94){if(_0x3dfb94>0x0){_0x123da8+=_0x113d53;}_0x5b1a67[_0x93e4('0x19')](dbH[_0x93e4('0x14')][_0x93e4('0x12')](util[_0x93e4('0xb')](_0x93e4('0x1a'),QUERY,_0x113d53,_0x123da8),{'type':dbH['sequelize']['QueryTypes'][_0x93e4('0x15')]}));});if(_0x238091>0x0){_0x123da8+=_0x113d53;_0x5b1a67[_0x93e4('0x19')](dbH[_0x93e4('0x14')]['query'](util['format'](_0x93e4('0x1a'),QUERY,_0x238091,_0x123da8),{'type':dbH[_0x93e4('0x14')][_0x93e4('0x1b')][_0x93e4('0x15')]}));}}}else{_0x5b1a67[_0x93e4('0x19')](dbH[_0x93e4('0x14')][_0x93e4('0x12')](QUERY,{'type':dbH[_0x93e4('0x14')][_0x93e4('0x1b')][_0x93e4('0x15')]}));}var _0x2bca42=path['dirname'](PATH);var _0xd3559e=path[_0x93e4('0x1c')](PATH,_0x93e4('0x1d'));var _0x2f259b=_0x53a943[_0x93e4('0xf')]&&_0x5b1a67[_0x93e4('0x1e')]>0x1;var _0x3761c9=[];if(!fs[_0x93e4('0x1f')](path[_0x93e4('0x20')](_0x2bca42,_0xd3559e))&&_0x2f259b){fs['mkdirSync'](path[_0x93e4('0x20')](_0x2bca42,_0xd3559e));}return BPromise[_0x93e4('0x21')](_0x5b1a67,function(_0x5ede08){_0x3761c9[_0x93e4('0x19')](_0x5ede08);})[_0x93e4('0x11')](function(){for(var _0x11055b=0x0;_0x11055b<_0x3761c9['length'];_0x11055b+=0x1){var _0x3b7701;var _0x1e88b9=_0x3761c9[_0x11055b];if(_0x2f259b){_0x3b7701=path[_0x93e4('0x20')](_0x2bca42,_0xd3559e,util['format']('%s%d.%s',_0xd3559e,_0x11055b,'xlsx'));}else{_0x3b7701=path[_0x93e4('0x20')](_0x2bca42,util[_0x93e4('0xb')](_0x93e4('0x22'),_0xd3559e,_0x93e4('0x23')));}fs[_0x93e4('0x24')](_0x3b7701,json2xls(_0x1e88b9),_0x93e4('0x25'));}})[_0x93e4('0x11')](function(){if(_0x2f259b){return new Promise(function(_0x1cc33a){zipdir(path['join'](_0x2bca42,_0xd3559e),{'saveTo':path[_0x93e4('0x20')](_0x2bca42,util[_0x93e4('0xb')]('%s.%s',_0xd3559e,_0x93e4('0x26')))},function(_0x5af911,_0x173746){rimraf(path['join'](_0x2bca42,_0xd3559e),function(){});_0x1cc33a(_0x93e4('0x27'));});});}})[_0x93e4('0x11')](function(){logger[_0x93e4('0xa')](util[_0x93e4('0xb')](_0x93e4('0x28'),EXTRACTED_REPORT_ID,_0x93e4('0xd')));return analyticExtractedReport(_0x93e4('0x29'),_0x2f259b?util['format']('%s.%s',_0xd3559e,_0x2f259b?_0x93e4('0x26'):_0x93e4('0x23')):null);});})['catch'](function(_0x3e912d){logger[_0x93e4('0xa')](util[_0x93e4('0xb')](_0x93e4('0x2a'),EXTRACTED_REPORT_ID,_0x93e4('0xd')),util[_0x93e4('0x2b')](_0x3e912d,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x93e4('0x2c'));})[_0x93e4('0x2d')](function(){process[_0x93e4('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x4588=['join','mkdirSync','each','%s.%s','xlsx','writeFileSync','binary','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','util','path','lodash','json2xls','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','update','info','format','XLSX','Setting','find','split','then','splitSizeXlsx','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','Empty','range','isInteger','num','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','length','existsSync'];(function(_0x5cd8d2,_0x19bf56){var _0x152705=function(_0x38ef51){while(--_0x38ef51){_0x5cd8d2['push'](_0x5cd8d2['shift']());}};_0x152705(++_0x19bf56);}(_0x4588,0x113));var _0x8458=function(_0x427d3a,_0x23724c){_0x427d3a=_0x427d3a-0x0;var _0xe5c521=_0x4588[_0x427d3a];return _0xe5c521;};'use strict';var util=require(_0x8458('0x0'));var path=require(_0x8458('0x1'));var _=require(_0x8458('0x2'));var fs=require('fs');var json2xls=require(_0x8458('0x3'));var BPromise=require('bluebird');var zipdir=require(_0x8458('0x4'));var rimraf=require(_0x8458('0x5'));var db=require(_0x8458('0x6'))['db'];var dbH=require(_0x8458('0x6'))[_0x8458('0x7')];var logger=require('../../config/logger')(_0x8458('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x8458('0x9')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x497ae5,_0x3f90c4){var _0x243931={'status':_0x497ae5};var _0x8e95cc={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3f90c4){_0x243931[_0x8458('0xa')]=_0x3f90c4;}return db[_0x8458('0xb')][_0x8458('0xc')](_0x243931,_0x8e95cc);}function main(){var _0xf18673=0x1388;var _0x461f8f;logger[_0x8458('0xd')](util[_0x8458('0xe')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x8458('0xf')));return db[_0x8458('0x10')][_0x8458('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x8458('0x12'),'splitSizeXlsx']})[_0x8458('0x13')](function(_0x41532d){if(_0x41532d){_0x461f8f=_0x41532d;_0xf18673=_0x461f8f[_0x8458('0x14')]||0x1388;}})[_0x8458('0x13')](function(){return dbH[_0x8458('0x15')][_0x8458('0x16')](util['format'](_0x8458('0x17'),QUERY),{'type':dbH[_0x8458('0x15')][_0x8458('0x18')][_0x8458('0x19')]});})[_0x8458('0x13')](function(_0x5e0a03){if(!_0x5e0a03[0x0]['num']){return analyticExtractedReport(_0x8458('0x1a'));}var _0x25b9ab=[];var _0x4a4722=0x0;if(_0x461f8f[_0x8458('0x12')]){if(_0x5e0a03&&_0x5e0a03['length']){var _0x1f6084=_[_0x8458('0x1b')](_0x5e0a03[0x0]['num']/_0xf18673);var _0x32e529=Number[_0x8458('0x1c')](_0x5e0a03[0x0][_0x8458('0x1d')]/_0xf18673)?_0x5e0a03[0x0][_0x8458('0x1d')]%_0xf18673:0x0;_0x1f6084['forEach'](function(_0x3d60d6){if(_0x3d60d6>0x0){_0x4a4722+=_0xf18673;}_0x25b9ab[_0x8458('0x1e')](dbH[_0x8458('0x15')][_0x8458('0x16')](util[_0x8458('0xe')](_0x8458('0x1f'),QUERY,_0xf18673,_0x4a4722),{'type':dbH['sequelize'][_0x8458('0x18')]['SELECT']}));});if(_0x32e529>0x0){_0x4a4722+=_0xf18673;_0x25b9ab[_0x8458('0x1e')](dbH[_0x8458('0x15')][_0x8458('0x16')](util[_0x8458('0xe')](_0x8458('0x1f'),QUERY,_0x32e529,_0x4a4722),{'type':dbH['sequelize'][_0x8458('0x18')][_0x8458('0x19')]}));}}}else{_0x25b9ab[_0x8458('0x1e')](dbH['sequelize'][_0x8458('0x16')](QUERY,{'type':dbH['sequelize'][_0x8458('0x18')][_0x8458('0x19')]}));}var _0x1f7da9=path[_0x8458('0x20')](PATH);var _0x5c7ec2=path[_0x8458('0x21')](PATH,_0x8458('0x22'));var _0x2123df=_0x461f8f['split']&&_0x25b9ab[_0x8458('0x23')]>0x1;var _0x3432ee=[];if(!fs[_0x8458('0x24')](path[_0x8458('0x25')](_0x1f7da9,_0x5c7ec2))&&_0x2123df){fs[_0x8458('0x26')](path['join'](_0x1f7da9,_0x5c7ec2));}return BPromise[_0x8458('0x27')](_0x25b9ab,function(_0x17388b){_0x3432ee['push'](_0x17388b);})[_0x8458('0x13')](function(){for(var _0x5dd2ea=0x0;_0x5dd2ea<_0x3432ee[_0x8458('0x23')];_0x5dd2ea+=0x1){var _0x2e84aa;var _0x5a618d=_0x3432ee[_0x5dd2ea];if(_0x2123df){_0x2e84aa=path[_0x8458('0x25')](_0x1f7da9,_0x5c7ec2,util[_0x8458('0xe')]('%s%d.%s',_0x5c7ec2,_0x5dd2ea,'xlsx'));}else{_0x2e84aa=path['join'](_0x1f7da9,util[_0x8458('0xe')](_0x8458('0x28'),_0x5c7ec2,_0x8458('0x29')));}fs[_0x8458('0x2a')](_0x2e84aa,json2xls(_0x5a618d),_0x8458('0x2b'));}})[_0x8458('0x13')](function(){if(_0x2123df){return new Promise(function(_0x4694af){zipdir(path[_0x8458('0x25')](_0x1f7da9,_0x5c7ec2),{'saveTo':path[_0x8458('0x25')](_0x1f7da9,util[_0x8458('0xe')](_0x8458('0x28'),_0x5c7ec2,_0x8458('0x2c')))},function(_0x2b8544,_0x4d41c4){rimraf(path[_0x8458('0x25')](_0x1f7da9,_0x5c7ec2),function(){});_0x4694af(_0x8458('0x2d'));});});}})['then'](function(){logger[_0x8458('0xd')](util[_0x8458('0xe')](_0x8458('0x2e'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport('Completed',_0x2123df?util[_0x8458('0xe')]('%s.%s',_0x5c7ec2,_0x2123df?_0x8458('0x2c'):_0x8458('0x29')):null);});})[_0x8458('0x2f')](function(_0x2a0965){logger[_0x8458('0xd')](util['format'](_0x8458('0x30'),EXTRACTED_REPORT_ID,_0x8458('0xf')),util[_0x8458('0x31')](_0x2a0965,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x8458('0x32'));})[_0x8458('0x33')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 4fc0e71..547acd3 100644 --- a/server/components/extensions/rewrite.js +++ b/server/components/extensions/rewrite.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xab83=['none','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','length','createdAt','*,*,*,*','interval','map','tag','CDR(tag)=','outbound','hasOwnProperty','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat','Hangup','transaction','bulkCreate','sortBy','catch','rewrite','lodash','util','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','uniq','exten','filter','groupBy','queue','playback','priority','extensions','extension','find','Set','CDR(type)=%s','type','inbound','push','CDR(routeid)=','context','CDR(destination)=','${EXTEN:','${EXTEN}','VoiceExtensionId','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','cutdigits','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xab83,0x17e));var _0x3ab8=function(_0x3cb5a7,_0x3849cd){_0x3cb5a7=_0x3cb5a7-0x0;var _0xb9ef8=_0xab83[_0x3cb5a7];return _0xb9ef8;};'use strict';var _=require(_0x3ab8('0x0'));var util=require(_0x3ab8('0x1'));function rewrite(_0x557126,_0x2ae060){var _0x202c98=this;return _0x557126[_0x3ab8('0x2')][_0x3ab8('0x3')][_0x3ab8('0x4')]({'raw':!![]})[_0x3ab8('0x5')](function(_0x5cfb96){_0x202c98[_0x3ab8('0x6')]=_0x5cfb96;return _0x557126[_0x3ab8('0x2')][_0x3ab8('0x7')][_0x3ab8('0x4')]({'where':{'IntervalId':_0x2ae060[_0x3ab8('0x8')]},'raw':!![]});})[_0x3ab8('0x5')](function(_0x1da0fa){return _0x557126[_0x3ab8('0x2')][_0x3ab8('0x7')][_0x3ab8('0x4')]({'where':{'exten':{'$in':_[_0x3ab8('0x9')](_['map'](_0x1da0fa,_0x3ab8('0xa')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x3ab8('0x5')](function(_0x157b99){var _0x2f6f02=_['filter'](_0x157b99,{'priority':'1'});var _0x2c8a6f=_[_0x3ab8('0xb')](_0x157b99,{'isApp':0x1});var _0x5c22fa=_[_0x3ab8('0xc')](_0x2c8a6f,'exten');var _0x56086a=[_0x3ab8('0xd'),_0x3ab8('0xe')];var _0x997481=[];var _0x1865a9=[];for(var _0x143bc2 in _0x5c22fa){if(_0x5c22fa['hasOwnProperty'](_0x143bc2)){_0x202c98[_0x3ab8('0xf')]=0x2;_0x202c98[_0x3ab8('0x10')]=[];_0x202c98[_0x3ab8('0x11')]=_[_0x3ab8('0x12')](_0x2f6f02,{'exten':_0x5c22fa[_0x143bc2][0x0][_0x3ab8('0xa')]});_0x202c98[_0x3ab8('0x10')]['push']({'type':_0x5c22fa[_0x143bc2][0x0]['type'],'app':_0x3ab8('0x13'),'appdata':util['format'](_0x3ab8('0x14'),_0x5c22fa[_0x143bc2][0x0]['type']),'context':_0x5c22fa[_0x143bc2][0x0]['context'],'exten':_0x5c22fa[_0x143bc2][0x0][_0x3ab8('0xa')],'priority':_0x202c98[_0x3ab8('0xf')]++,'VoiceExtensionId':_0x5c22fa[_0x143bc2][0x0]['VoiceExtensionId']});if(_0x5c22fa[_0x143bc2][0x0][_0x3ab8('0x15')]===_0x3ab8('0x16')){_0x202c98[_0x3ab8('0x10')][_0x3ab8('0x17')]({'type':_0x5c22fa[_0x143bc2][0x0][_0x3ab8('0x15')],'app':_0x3ab8('0x13'),'appdata':_0x3ab8('0x18')+_0x5c22fa[_0x143bc2][0x0]['VoiceExtensionId'],'context':_0x5c22fa[_0x143bc2][0x0][_0x3ab8('0x19')],'exten':_0x5c22fa[_0x143bc2][0x0]['exten'],'priority':_0x202c98['priority']++,'VoiceExtensionId':_0x5c22fa[_0x143bc2][0x0]['VoiceExtensionId']});}else if(_0x5c22fa[_0x143bc2][0x0][_0x3ab8('0x15')]==='outbound'){if(_0x202c98[_0x3ab8('0x11')]){_0x202c98[_0x3ab8('0x10')][_0x3ab8('0x17')]({'type':_0x5c22fa[_0x143bc2][0x0][_0x3ab8('0x15')],'app':_0x3ab8('0x13'),'appdata':_0x3ab8('0x1a')+(_0x202c98['extension']['cutdigits']?_0x3ab8('0x1b')+_0x202c98['extension']['cutdigits']+'}':_0x3ab8('0x1c')),'context':_0x5c22fa[_0x143bc2][0x0][_0x3ab8('0x19')],'exten':_0x5c22fa[_0x143bc2][0x0][_0x3ab8('0xa')],'priority':_0x202c98[_0x3ab8('0xf')]++,'VoiceExtensionId':_0x5c22fa[_0x143bc2][0x0][_0x3ab8('0x1d')]});}_0x202c98[_0x3ab8('0x10')][_0x3ab8('0x17')]({'type':_0x5c22fa[_0x143bc2][0x0]['type'],'app':_0x3ab8('0x13'),'appdata':'CDR(routeid)='+_0x5c22fa[_0x143bc2][0x0][_0x3ab8('0x1d')],'context':_0x5c22fa[_0x143bc2][0x0][_0x3ab8('0x19')],'exten':_0x5c22fa[_0x143bc2][0x0]['exten'],'priority':_0x202c98[_0x3ab8('0xf')]++,'VoiceExtensionId':_0x5c22fa[_0x143bc2][0x0][_0x3ab8('0x1d')]});var _0x3d835d=_0x202c98[_0x3ab8('0xf')]++;_0x202c98['extensions'][_0x3ab8('0x17')]({'type':_0x5c22fa[_0x143bc2][0x0][_0x3ab8('0x15')],'app':_0x3ab8('0x1e'),'appdata':_0x3ab8('0x1f')+(_0x3d835d+0x2)+_0x3ab8('0x20')+(_0x3d835d+0x1)+')','context':_0x5c22fa[_0x143bc2][0x0][_0x3ab8('0x19')],'exten':_0x5c22fa[_0x143bc2][0x0]['exten'],'priority':_0x3d835d,'VoiceExtensionId':_0x5c22fa[_0x143bc2][0x0][_0x3ab8('0x1d')]});if(_0x202c98[_0x3ab8('0x11')]){_0x202c98[_0x3ab8('0x10')][_0x3ab8('0x17')]({'type':_0x5c22fa[_0x143bc2][0x0][_0x3ab8('0x15')],'app':_0x3ab8('0x13'),'appdata':_0x202c98['extension'][_0x3ab8('0x21')]?_0x3ab8('0x22')+_0x202c98[_0x3ab8('0x11')][_0x3ab8('0x21')]+'}':_0x3ab8('0x23'),'context':_0x5c22fa[_0x143bc2][0x0][_0x3ab8('0x19')],'exten':_0x5c22fa[_0x143bc2][0x0][_0x3ab8('0xa')],'priority':_0x202c98[_0x3ab8('0xf')]++,'VoiceExtensionId':_0x5c22fa[_0x143bc2][0x0]['VoiceExtensionId']});}_0x202c98[_0x3ab8('0x10')][_0x3ab8('0x17')]({'type':_0x5c22fa[_0x143bc2][0x0][_0x3ab8('0x15')],'app':'Set','appdata':_0x3ab8('0x24')+_0x5c22fa[_0x143bc2][0x0][_0x3ab8('0x1d')],'context':_0x5c22fa[_0x143bc2][0x0][_0x3ab8('0x19')],'exten':_0x5c22fa[_0x143bc2][0x0][_0x3ab8('0xa')],'priority':_0x202c98[_0x3ab8('0xf')]++,'VoiceExtensionId':_0x5c22fa[_0x143bc2][0x0][_0x3ab8('0x1d')]});if(_0x202c98[_0x3ab8('0x11')]&&_0x202c98[_0x3ab8('0x11')]['hasOwnProperty'](_0x3ab8('0x25'))&&_0x202c98[_0x3ab8('0x11')][_0x3ab8('0x25')]!==_0x3ab8('0x26')){_0x202c98[_0x3ab8('0x10')][_0x3ab8('0x17')]({'type':_0x5c22fa[_0x143bc2][0x0]['type'],'app':_0x3ab8('0x13'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x5c22fa[_0x143bc2][0x0]['context'],'exten':_0x5c22fa[_0x143bc2][0x0][_0x3ab8('0xa')],'priority':_0x202c98[_0x3ab8('0xf')]++,'VoiceExtensionId':_0x5c22fa[_0x143bc2][0x0][_0x3ab8('0x1d')]});_0x202c98[_0x3ab8('0x10')][_0x3ab8('0x17')]({'type':_0x5c22fa[_0x143bc2][0x0]['type'],'app':_0x3ab8('0x13'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x202c98[_0x3ab8('0x11')][_0x3ab8('0x25')]||_0x3ab8('0x27'),'context':_0x5c22fa[_0x143bc2][0x0][_0x3ab8('0x19')],'exten':_0x5c22fa[_0x143bc2][0x0][_0x3ab8('0xa')],'priority':_0x202c98['priority']++,'VoiceExtensionId':_0x5c22fa[_0x143bc2][0x0][_0x3ab8('0x1d')]});}}_0x202c98[_0x3ab8('0x10')][_0x3ab8('0x17')]({'type':_0x5c22fa[_0x143bc2][0x0][_0x3ab8('0x15')],'app':_0x3ab8('0x13'),'appdata':_0x3ab8('0x28'),'context':_0x5c22fa[_0x143bc2][0x0][_0x3ab8('0x19')],'exten':_0x5c22fa[_0x143bc2][0x0]['exten'],'priority':_0x202c98[_0x3ab8('0xf')]++,'VoiceExtensionId':_0x5c22fa[_0x143bc2][0x0][_0x3ab8('0x1d')]});_0x202c98[_0x3ab8('0x10')][_0x3ab8('0x17')]({'type':_0x5c22fa[_0x143bc2][0x0][_0x3ab8('0x15')],'app':_0x3ab8('0x13'),'appdata':_0x3ab8('0x29'),'context':_0x5c22fa[_0x143bc2][0x0]['context'],'exten':_0x5c22fa[_0x143bc2][0x0][_0x3ab8('0xa')],'priority':_0x202c98[_0x3ab8('0xf')]++,'VoiceExtensionId':_0x5c22fa[_0x143bc2][0x0]['VoiceExtensionId']});_0x202c98[_0x3ab8('0x10')][_0x3ab8('0x17')]({'type':_0x5c22fa[_0x143bc2][0x0][_0x3ab8('0x15')],'app':_0x3ab8('0x13'),'appdata':'MONITOR_OPTIONS=ab','context':_0x5c22fa[_0x143bc2][0x0][_0x3ab8('0x19')],'exten':_0x5c22fa[_0x143bc2][0x0][_0x3ab8('0xa')],'priority':_0x202c98[_0x3ab8('0xf')]++,'VoiceExtensionId':_0x5c22fa[_0x143bc2][0x0][_0x3ab8('0x1d')]});for(var _0x373bb4=0x0,_0x49d6cd=0x0;_0x373bb4<_0x5c22fa[_0x143bc2][_0x3ab8('0x2a')];_0x373bb4+=0x1,_0x49d6cd=0x0){var _0x2628db=_0x5c22fa[_0x143bc2][_0x373bb4];if(_0x2628db[_0x3ab8('0x15')]){_0x2628db[_0x3ab8('0x15')]=_0x2628db[_0x3ab8('0x15')]['toLowerCase']();}var _0x5be038=[];var _0x13f463=[];delete _0x2628db['id'];delete _0x2628db[_0x3ab8('0x2b')];delete _0x2628db['updatedAt'];var _0x207ec0=_0x2628db['interval']!==_0x3ab8('0x2c')?[_0x2628db[_0x3ab8('0x2d')]]:_0x2628db['IntervalId']?_[_0x3ab8('0x2e')](_[_0x3ab8('0xb')](_0x202c98['intervals'],{'IntervalId':_0x2628db[_0x3ab8('0x8')]}),_0x3ab8('0x2d')):[];if(_0x2628db['hasOwnProperty'](_0x3ab8('0x2f'))){if(_0x2628db['tag']&&_0x2628db[_0x3ab8('0x2f')]!=='--'){_0x5be038[_0x3ab8('0x17')]({'type':_0x2628db['type'],'app':_0x3ab8('0x13'),'appdata':_0x3ab8('0x30')+_0x2628db[_0x3ab8('0x2f')],'context':_0x2628db[_0x3ab8('0x19')],'exten':_0x2628db[_0x3ab8('0xa')],'priority':_0x207ec0[_0x3ab8('0x2a')]+_0x202c98[_0x3ab8('0xf')]+_0x49d6cd++,'VoiceExtensionId':_0x2628db[_0x3ab8('0x1d')]});}}if(_0x2628db['type']===_0x3ab8('0x31')&&_0x2628db[_0x3ab8('0x32')]('callerID')){if(_0x2628db[_0x3ab8('0x33')]){_0x5be038['push']({'type':_0x2628db[_0x3ab8('0x15')],'app':_0x3ab8('0x1e'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x2628db[_0x3ab8('0x33')]+')','context':_0x2628db[_0x3ab8('0x19')],'exten':_0x2628db[_0x3ab8('0xa')],'priority':_0x207ec0['length']+_0x202c98[_0x3ab8('0xf')]+_0x49d6cd++,'VoiceExtensionId':_0x2628db['VoiceExtensionId']});}else{_0x5be038[_0x3ab8('0x17')]({'type':_0x2628db[_0x3ab8('0x15')],'app':'ExecIf','appdata':_0x3ab8('0x34'),'context':_0x2628db['context'],'exten':_0x2628db[_0x3ab8('0xa')],'priority':_0x207ec0[_0x3ab8('0x2a')]+_0x202c98[_0x3ab8('0xf')]+_0x49d6cd++,'VoiceExtensionId':_0x2628db[_0x3ab8('0x1d')]});}}if(_0x2628db[_0x3ab8('0x32')](_0x3ab8('0x35'))){if(_0x56086a[_0x3ab8('0x36')](_0x2628db[_0x3ab8('0x37')]['toLowerCase']())>=0x0&&_0x2628db[_0x3ab8('0x38')]!==_0x3ab8('0x39')){if(_0x2628db[_0x3ab8('0x35')]){_0x5be038[_0x3ab8('0x17')]({'type':_0x2628db['type'],'app':_0x3ab8('0x1e'),'appdata':_0x3ab8('0x3a'),'context':_0x2628db['context'],'exten':_0x2628db[_0x3ab8('0xa')],'priority':_0x207ec0[_0x3ab8('0x2a')]+_0x202c98[_0x3ab8('0xf')]+_0x49d6cd++,'VoiceExtensionId':_0x2628db[_0x3ab8('0x1d')]});_0x5be038['push']({'type':_0x2628db[_0x3ab8('0x15')],'app':_0x3ab8('0x13'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x2628db[_0x3ab8('0x19')],'exten':_0x2628db['exten'],'priority':_0x207ec0[_0x3ab8('0x2a')]+_0x202c98[_0x3ab8('0xf')]+_0x49d6cd++,'VoiceExtensionId':_0x2628db[_0x3ab8('0x1d')]});}else{_0x5be038['push']({'type':_0x2628db[_0x3ab8('0x15')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x2628db[_0x3ab8('0x19')],'exten':_0x2628db['exten'],'priority':_0x207ec0[_0x3ab8('0x2a')]+_0x202c98[_0x3ab8('0xf')]+_0x49d6cd++,'VoiceExtensionId':_0x2628db[_0x3ab8('0x1d')]});_0x5be038[_0x3ab8('0x17')]({'type':_0x2628db[_0x3ab8('0x15')],'app':_0x3ab8('0x13'),'appdata':_0x3ab8('0x3b'),'context':_0x2628db[_0x3ab8('0x19')],'exten':_0x2628db[_0x3ab8('0xa')],'priority':_0x207ec0[_0x3ab8('0x2a')]+_0x202c98[_0x3ab8('0xf')]+_0x49d6cd++,'VoiceExtensionId':_0x2628db[_0x3ab8('0x1d')]});}}}for(var _0xd563ac=0x0;_0xd563ac<_0x207ec0['length'];_0xd563ac+=0x1){var _0xfb38cc=_0x202c98[_0x3ab8('0xf')]+_0x207ec0[_0x3ab8('0x2a')];var _0x5c4c61=_0xd563ac===_0x207ec0[_0x3ab8('0x2a')]-0x1?_0x202c98[_0x3ab8('0xf')]+_0x5be038['length']+_0x13f463['length']+0x2:_0x202c98[_0x3ab8('0xf')]+_0xd563ac+0x1;_0x5be038[_0x3ab8('0x3c')](_0xd563ac,0x0,{'type':_0x2628db[_0x3ab8('0x15')],'app':'GotoIfTime','appdata':_0x207ec0[_0xd563ac]+'?'+_0x2628db[_0x3ab8('0x19')]+_0x3ab8('0x3d')+_0xfb38cc+':'+_0x2628db[_0x3ab8('0x19')]+_0x3ab8('0x3d')+_0x5c4c61,'exten':_0x2628db[_0x3ab8('0xa')],'context':_0x2628db[_0x3ab8('0x19')],'priority':_0x202c98[_0x3ab8('0xf')]+_0xd563ac,'VoiceExtensionId':_0x5c22fa[_0x143bc2][0x0]['VoiceExtensionId']});}_0x2628db['priority']=_0x5be038[_0x3ab8('0x2a')]?_[_0x3ab8('0x3e')](_0x5be038)[_0x3ab8('0xf')]+0x1:_0x202c98['priority'];_0x202c98[_0x3ab8('0xf')]=(_0x13f463[_0x3ab8('0x2a')]?_[_0x3ab8('0x3e')](_0x13f463)['priority']:_0x2628db[_0x3ab8('0xf')])+0x1;_0x202c98[_0x3ab8('0x10')]=_[_0x3ab8('0x3f')](_0x202c98[_0x3ab8('0x10')],_0x5be038,[_0x2628db],_0x13f463);}_0x202c98[_0x3ab8('0x10')][_0x3ab8('0x17')]({'type':_0x5c22fa[_0x143bc2][0x0][_0x3ab8('0x15')],'app':_0x3ab8('0x40'),'exten':_0x5c22fa[_0x143bc2][0x0]['exten'],'context':_0x5c22fa[_0x143bc2][0x0]['context'],'priority':_0x202c98[_0x3ab8('0xf')],'VoiceExtensionId':_0x5c22fa[_0x143bc2][0x0][_0x3ab8('0x1d')]});_0x997481[_0x3ab8('0x17')](_0x5c22fa[_0x143bc2][0x0][_0x3ab8('0x1d')]);_0x1865a9=_[_0x3ab8('0x3f')](_0x1865a9,_0x202c98['extensions']);}}return _0x557126[_0x3ab8('0x41')](function(_0x46d262){return _0x557126[_0x3ab8('0x2')][_0x3ab8('0x7')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x997481}},'transaction':_0x46d262})[_0x3ab8('0x5')](function(_0x4a6828){return _0x557126[_0x3ab8('0x2')][_0x3ab8('0x7')][_0x3ab8('0x42')](_[_0x3ab8('0x43')](_0x1865a9,'priority'),{'transaction':_0x46d262});});});})[_0x3ab8('0x44')](function(_0x45d7ae){console['error'](_0x45d7ae);});}exports[_0x3ab8('0x45')]=rewrite; \ No newline at end of file +var _0xd8c2=['${EXTEN:','${EXTEN}','priority','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','destroy','sortBy','catch','lodash','util','models','findAll','then','intervals','VoiceExtension','IntervalId','uniq','map','exten','filter','groupBy','playback','hasOwnProperty','extensions','extension','find','push','type','Set','format','context','VoiceExtensionId','inbound','CDR(routeid)=','CDR(destination)=','cutdigits'];(function(_0x4b5265,_0x404066){var _0x330224=function(_0x57b06e){while(--_0x57b06e){_0x4b5265['push'](_0x4b5265['shift']());}};_0x330224(++_0x404066);}(_0xd8c2,0x1ab));var _0x2d8c=function(_0x3276ec,_0x480f60){_0x3276ec=_0x3276ec-0x0;var _0x74581a=_0xd8c2[_0x3276ec];return _0x74581a;};'use strict';var _=require(_0x2d8c('0x0'));var util=require(_0x2d8c('0x1'));function rewrite(_0x186dc5,_0x20d9cc){var _0x2248b5=this;return _0x186dc5[_0x2d8c('0x2')]['Interval'][_0x2d8c('0x3')]({'raw':!![]})[_0x2d8c('0x4')](function(_0x4fd333){_0x2248b5[_0x2d8c('0x5')]=_0x4fd333;return _0x186dc5[_0x2d8c('0x2')][_0x2d8c('0x6')]['findAll']({'where':{'IntervalId':_0x20d9cc[_0x2d8c('0x7')]},'raw':!![]});})['then'](function(_0x9491b2){return _0x186dc5[_0x2d8c('0x2')][_0x2d8c('0x6')][_0x2d8c('0x3')]({'where':{'exten':{'$in':_[_0x2d8c('0x8')](_[_0x2d8c('0x9')](_0x9491b2,_0x2d8c('0xa')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})['then'](function(_0xcf9462){var _0x4aa179=_[_0x2d8c('0xb')](_0xcf9462,{'priority':'1'});var _0x5c1c74=_[_0x2d8c('0xb')](_0xcf9462,{'isApp':0x1});var _0x748655=_[_0x2d8c('0xc')](_0x5c1c74,_0x2d8c('0xa'));var _0x3be76c=['queue',_0x2d8c('0xd')];var _0x59c6fc=[];var _0x1a4225=[];for(var _0x38a910 in _0x748655){if(_0x748655[_0x2d8c('0xe')](_0x38a910)){_0x2248b5['priority']=0x2;_0x2248b5[_0x2d8c('0xf')]=[];_0x2248b5[_0x2d8c('0x10')]=_[_0x2d8c('0x11')](_0x4aa179,{'exten':_0x748655[_0x38a910][0x0][_0x2d8c('0xa')]});_0x2248b5['extensions'][_0x2d8c('0x12')]({'type':_0x748655[_0x38a910][0x0][_0x2d8c('0x13')],'app':_0x2d8c('0x14'),'appdata':util[_0x2d8c('0x15')]('CDR(type)=%s',_0x748655[_0x38a910][0x0][_0x2d8c('0x13')]),'context':_0x748655[_0x38a910][0x0][_0x2d8c('0x16')],'exten':_0x748655[_0x38a910][0x0][_0x2d8c('0xa')],'priority':_0x2248b5['priority']++,'VoiceExtensionId':_0x748655[_0x38a910][0x0][_0x2d8c('0x17')]});if(_0x748655[_0x38a910][0x0][_0x2d8c('0x13')]===_0x2d8c('0x18')){_0x2248b5['extensions'][_0x2d8c('0x12')]({'type':_0x748655[_0x38a910][0x0][_0x2d8c('0x13')],'app':'Set','appdata':_0x2d8c('0x19')+_0x748655[_0x38a910][0x0][_0x2d8c('0x17')],'context':_0x748655[_0x38a910][0x0]['context'],'exten':_0x748655[_0x38a910][0x0][_0x2d8c('0xa')],'priority':_0x2248b5['priority']++,'VoiceExtensionId':_0x748655[_0x38a910][0x0][_0x2d8c('0x17')]});}else if(_0x748655[_0x38a910][0x0][_0x2d8c('0x13')]==='outbound'){if(_0x2248b5[_0x2d8c('0x10')]){_0x2248b5[_0x2d8c('0xf')]['push']({'type':_0x748655[_0x38a910][0x0]['type'],'app':_0x2d8c('0x14'),'appdata':_0x2d8c('0x1a')+(_0x2248b5['extension'][_0x2d8c('0x1b')]?_0x2d8c('0x1c')+_0x2248b5[_0x2d8c('0x10')][_0x2d8c('0x1b')]+'}':_0x2d8c('0x1d')),'context':_0x748655[_0x38a910][0x0][_0x2d8c('0x16')],'exten':_0x748655[_0x38a910][0x0][_0x2d8c('0xa')],'priority':_0x2248b5['priority']++,'VoiceExtensionId':_0x748655[_0x38a910][0x0][_0x2d8c('0x17')]});}_0x2248b5[_0x2d8c('0xf')]['push']({'type':_0x748655[_0x38a910][0x0][_0x2d8c('0x13')],'app':_0x2d8c('0x14'),'appdata':'CDR(routeid)='+_0x748655[_0x38a910][0x0][_0x2d8c('0x17')],'context':_0x748655[_0x38a910][0x0][_0x2d8c('0x16')],'exten':_0x748655[_0x38a910][0x0][_0x2d8c('0xa')],'priority':_0x2248b5[_0x2d8c('0x1e')]++,'VoiceExtensionId':_0x748655[_0x38a910][0x0][_0x2d8c('0x17')]});var _0x213610=_0x2248b5[_0x2d8c('0x1e')]++;_0x2248b5['extensions']['push']({'type':_0x748655[_0x38a910][0x0][_0x2d8c('0x13')],'app':_0x2d8c('0x1f'),'appdata':_0x2d8c('0x20')+(_0x213610+0x2)+'):Goto('+(_0x213610+0x1)+')','context':_0x748655[_0x38a910][0x0][_0x2d8c('0x16')],'exten':_0x748655[_0x38a910][0x0]['exten'],'priority':_0x213610,'VoiceExtensionId':_0x748655[_0x38a910][0x0][_0x2d8c('0x17')]});if(_0x2248b5[_0x2d8c('0x10')]){_0x2248b5[_0x2d8c('0xf')][_0x2d8c('0x12')]({'type':_0x748655[_0x38a910][0x0][_0x2d8c('0x13')],'app':'Set','appdata':_0x2248b5[_0x2d8c('0x10')][_0x2d8c('0x1b')]?'CDR(prefix)=${EXTEN:0:'+_0x2248b5[_0x2d8c('0x10')][_0x2d8c('0x1b')]+'}':_0x2d8c('0x21'),'context':_0x748655[_0x38a910][0x0][_0x2d8c('0x16')],'exten':_0x748655[_0x38a910][0x0][_0x2d8c('0xa')],'priority':_0x2248b5[_0x2d8c('0x1e')]++,'VoiceExtensionId':_0x748655[_0x38a910][0x0][_0x2d8c('0x17')]});}_0x2248b5[_0x2d8c('0xf')][_0x2d8c('0x12')]({'type':_0x748655[_0x38a910][0x0]['type'],'app':_0x2d8c('0x14'),'appdata':_0x2d8c('0x22')+_0x748655[_0x38a910][0x0][_0x2d8c('0x17')],'context':_0x748655[_0x38a910][0x0]['context'],'exten':_0x748655[_0x38a910][0x0][_0x2d8c('0xa')],'priority':_0x2248b5[_0x2d8c('0x1e')]++,'VoiceExtensionId':_0x748655[_0x38a910][0x0][_0x2d8c('0x17')]});if(_0x2248b5['extension']&&_0x2248b5[_0x2d8c('0x10')][_0x2d8c('0xe')](_0x2d8c('0x23'))&&_0x2248b5[_0x2d8c('0x10')]['recordingFormat']!=='none'){_0x2248b5[_0x2d8c('0xf')][_0x2d8c('0x12')]({'type':_0x748655[_0x38a910][0x0][_0x2d8c('0x13')],'app':_0x2d8c('0x14'),'appdata':_0x2d8c('0x24'),'context':_0x748655[_0x38a910][0x0]['context'],'exten':_0x748655[_0x38a910][0x0][_0x2d8c('0xa')],'priority':_0x2248b5[_0x2d8c('0x1e')]++,'VoiceExtensionId':_0x748655[_0x38a910][0x0][_0x2d8c('0x17')]});_0x2248b5[_0x2d8c('0xf')][_0x2d8c('0x12')]({'type':_0x748655[_0x38a910][0x0][_0x2d8c('0x13')],'app':_0x2d8c('0x14'),'appdata':_0x2d8c('0x25')+_0x2248b5['extension'][_0x2d8c('0x23')]||'wav','context':_0x748655[_0x38a910][0x0][_0x2d8c('0x16')],'exten':_0x748655[_0x38a910][0x0][_0x2d8c('0xa')],'priority':_0x2248b5[_0x2d8c('0x1e')]++,'VoiceExtensionId':_0x748655[_0x38a910][0x0][_0x2d8c('0x17')]});}}_0x2248b5['extensions'][_0x2d8c('0x12')]({'type':_0x748655[_0x38a910][0x0][_0x2d8c('0x13')],'app':_0x2d8c('0x14'),'appdata':_0x2d8c('0x26'),'context':_0x748655[_0x38a910][0x0][_0x2d8c('0x16')],'exten':_0x748655[_0x38a910][0x0]['exten'],'priority':_0x2248b5[_0x2d8c('0x1e')]++,'VoiceExtensionId':_0x748655[_0x38a910][0x0][_0x2d8c('0x17')]});_0x2248b5[_0x2d8c('0xf')][_0x2d8c('0x12')]({'type':_0x748655[_0x38a910][0x0]['type'],'app':'Set','appdata':_0x2d8c('0x27'),'context':_0x748655[_0x38a910][0x0]['context'],'exten':_0x748655[_0x38a910][0x0][_0x2d8c('0xa')],'priority':_0x2248b5[_0x2d8c('0x1e')]++,'VoiceExtensionId':_0x748655[_0x38a910][0x0]['VoiceExtensionId']});_0x2248b5[_0x2d8c('0xf')][_0x2d8c('0x12')]({'type':_0x748655[_0x38a910][0x0]['type'],'app':'Set','appdata':_0x2d8c('0x28'),'context':_0x748655[_0x38a910][0x0][_0x2d8c('0x16')],'exten':_0x748655[_0x38a910][0x0]['exten'],'priority':_0x2248b5[_0x2d8c('0x1e')]++,'VoiceExtensionId':_0x748655[_0x38a910][0x0][_0x2d8c('0x17')]});for(var _0x4b4181=0x0,_0x2dc654=0x0;_0x4b4181<_0x748655[_0x38a910][_0x2d8c('0x29')];_0x4b4181+=0x1,_0x2dc654=0x0){var _0x58fe3e=_0x748655[_0x38a910][_0x4b4181];if(_0x58fe3e[_0x2d8c('0x13')]){_0x58fe3e['type']=_0x58fe3e[_0x2d8c('0x13')][_0x2d8c('0x2a')]();}var _0x2c09cc=[];var _0x5a3196=[];delete _0x58fe3e['id'];delete _0x58fe3e[_0x2d8c('0x2b')];delete _0x58fe3e[_0x2d8c('0x2c')];var _0x3b0d4a=_0x58fe3e[_0x2d8c('0x2d')]!==_0x2d8c('0x2e')?[_0x58fe3e[_0x2d8c('0x2d')]]:_0x58fe3e[_0x2d8c('0x7')]?_['map'](_[_0x2d8c('0xb')](_0x2248b5[_0x2d8c('0x5')],{'IntervalId':_0x58fe3e['IntervalId']}),_0x2d8c('0x2d')):[];if(_0x58fe3e['hasOwnProperty'](_0x2d8c('0x2f'))){if(_0x58fe3e[_0x2d8c('0x2f')]&&_0x58fe3e[_0x2d8c('0x2f')]!=='--'){_0x2c09cc[_0x2d8c('0x12')]({'type':_0x58fe3e['type'],'app':'Set','appdata':_0x2d8c('0x30')+_0x58fe3e[_0x2d8c('0x2f')],'context':_0x58fe3e[_0x2d8c('0x16')],'exten':_0x58fe3e[_0x2d8c('0xa')],'priority':_0x3b0d4a[_0x2d8c('0x29')]+_0x2248b5[_0x2d8c('0x1e')]+_0x2dc654++,'VoiceExtensionId':_0x58fe3e[_0x2d8c('0x17')]});}}if(_0x58fe3e[_0x2d8c('0x13')]==='outbound'&&_0x58fe3e[_0x2d8c('0xe')](_0x2d8c('0x31'))){if(_0x58fe3e[_0x2d8c('0x31')]){_0x2c09cc[_0x2d8c('0x12')]({'type':_0x58fe3e[_0x2d8c('0x13')],'app':_0x2d8c('0x1f'),'appdata':_0x2d8c('0x32')+_0x58fe3e[_0x2d8c('0x31')]+')','context':_0x58fe3e[_0x2d8c('0x16')],'exten':_0x58fe3e[_0x2d8c('0xa')],'priority':_0x3b0d4a[_0x2d8c('0x29')]+_0x2248b5[_0x2d8c('0x1e')]+_0x2dc654++,'VoiceExtensionId':_0x58fe3e[_0x2d8c('0x17')]});}else{_0x2c09cc[_0x2d8c('0x12')]({'type':_0x58fe3e[_0x2d8c('0x13')],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x58fe3e[_0x2d8c('0x16')],'exten':_0x58fe3e[_0x2d8c('0xa')],'priority':_0x3b0d4a['length']+_0x2248b5[_0x2d8c('0x1e')]+_0x2dc654++,'VoiceExtensionId':_0x58fe3e[_0x2d8c('0x17')]});}}if(_0x58fe3e['hasOwnProperty'](_0x2d8c('0x33'))){if(_0x3be76c['indexOf'](_0x58fe3e['app'][_0x2d8c('0x2a')]())>=0x0&&_0x58fe3e['appType']!=='custom'){if(_0x58fe3e[_0x2d8c('0x33')]){_0x2c09cc[_0x2d8c('0x12')]({'type':_0x58fe3e['type'],'app':_0x2d8c('0x1f'),'appdata':_0x2d8c('0x34'),'context':_0x58fe3e[_0x2d8c('0x16')],'exten':_0x58fe3e[_0x2d8c('0xa')],'priority':_0x3b0d4a['length']+_0x2248b5['priority']+_0x2dc654++,'VoiceExtensionId':_0x58fe3e['VoiceExtensionId']});_0x2c09cc[_0x2d8c('0x12')]({'type':_0x58fe3e[_0x2d8c('0x13')],'app':_0x2d8c('0x14'),'appdata':_0x2d8c('0x35'),'context':_0x58fe3e[_0x2d8c('0x16')],'exten':_0x58fe3e[_0x2d8c('0xa')],'priority':_0x3b0d4a[_0x2d8c('0x29')]+_0x2248b5['priority']+_0x2dc654++,'VoiceExtensionId':_0x58fe3e[_0x2d8c('0x17')]});}else{_0x2c09cc[_0x2d8c('0x12')]({'type':_0x58fe3e['type'],'app':'ExecIf','appdata':_0x2d8c('0x36'),'context':_0x58fe3e[_0x2d8c('0x16')],'exten':_0x58fe3e[_0x2d8c('0xa')],'priority':_0x3b0d4a[_0x2d8c('0x29')]+_0x2248b5[_0x2d8c('0x1e')]+_0x2dc654++,'VoiceExtensionId':_0x58fe3e[_0x2d8c('0x17')]});_0x2c09cc[_0x2d8c('0x12')]({'type':_0x58fe3e[_0x2d8c('0x13')],'app':_0x2d8c('0x14'),'appdata':_0x2d8c('0x37'),'context':_0x58fe3e[_0x2d8c('0x16')],'exten':_0x58fe3e[_0x2d8c('0xa')],'priority':_0x3b0d4a[_0x2d8c('0x29')]+_0x2248b5[_0x2d8c('0x1e')]+_0x2dc654++,'VoiceExtensionId':_0x58fe3e[_0x2d8c('0x17')]});}}}for(var _0xc55efa=0x0;_0xc55efa<_0x3b0d4a['length'];_0xc55efa+=0x1){var _0x544420=_0x2248b5[_0x2d8c('0x1e')]+_0x3b0d4a[_0x2d8c('0x29')];var _0x3de597=_0xc55efa===_0x3b0d4a[_0x2d8c('0x29')]-0x1?_0x2248b5[_0x2d8c('0x1e')]+_0x2c09cc[_0x2d8c('0x29')]+_0x5a3196[_0x2d8c('0x29')]+0x2:_0x2248b5['priority']+_0xc55efa+0x1;_0x2c09cc[_0x2d8c('0x38')](_0xc55efa,0x0,{'type':_0x58fe3e[_0x2d8c('0x13')],'app':_0x2d8c('0x39'),'appdata':_0x3b0d4a[_0xc55efa]+'?'+_0x58fe3e[_0x2d8c('0x16')]+_0x2d8c('0x3a')+_0x544420+':'+_0x58fe3e[_0x2d8c('0x16')]+_0x2d8c('0x3a')+_0x3de597,'exten':_0x58fe3e['exten'],'context':_0x58fe3e[_0x2d8c('0x16')],'priority':_0x2248b5[_0x2d8c('0x1e')]+_0xc55efa,'VoiceExtensionId':_0x748655[_0x38a910][0x0][_0x2d8c('0x17')]});}_0x58fe3e[_0x2d8c('0x1e')]=_0x2c09cc['length']?_[_0x2d8c('0x3b')](_0x2c09cc)[_0x2d8c('0x1e')]+0x1:_0x2248b5[_0x2d8c('0x1e')];_0x2248b5[_0x2d8c('0x1e')]=(_0x5a3196[_0x2d8c('0x29')]?_[_0x2d8c('0x3b')](_0x5a3196)[_0x2d8c('0x1e')]:_0x58fe3e[_0x2d8c('0x1e')])+0x1;_0x2248b5[_0x2d8c('0xf')]=_[_0x2d8c('0x3c')](_0x2248b5[_0x2d8c('0xf')],_0x2c09cc,[_0x58fe3e],_0x5a3196);}_0x2248b5[_0x2d8c('0xf')][_0x2d8c('0x12')]({'type':_0x748655[_0x38a910][0x0][_0x2d8c('0x13')],'app':_0x2d8c('0x3d'),'exten':_0x748655[_0x38a910][0x0][_0x2d8c('0xa')],'context':_0x748655[_0x38a910][0x0][_0x2d8c('0x16')],'priority':_0x2248b5[_0x2d8c('0x1e')],'VoiceExtensionId':_0x748655[_0x38a910][0x0][_0x2d8c('0x17')]});_0x59c6fc[_0x2d8c('0x12')](_0x748655[_0x38a910][0x0][_0x2d8c('0x17')]);_0x1a4225=_[_0x2d8c('0x3c')](_0x1a4225,_0x2248b5[_0x2d8c('0xf')]);}}return _0x186dc5['transaction'](function(_0x4a96c2){return _0x186dc5[_0x2d8c('0x2')][_0x2d8c('0x6')][_0x2d8c('0x3e')]({'where':{'VoiceExtensionId':{'$in':_0x59c6fc}},'transaction':_0x4a96c2})[_0x2d8c('0x4')](function(_0x1912c7){return _0x186dc5[_0x2d8c('0x2')]['VoiceExtension']['bulkCreate'](_[_0x2d8c('0x3f')](_0x1a4225,'priority'),{'transaction':_0x4a96c2});});});})[_0x2d8c('0x40')](function(_0x27fbf5){console['error'](_0x27fbf5);});}exports['rewrite']=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 26bd8d9..8afd3ed 100644 --- a/server/components/import/cm/csv.js +++ b/server/components/import/cm/csv.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb51e=['bluebird','util','lodash','../../../config/logger','defaults','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','isNil','errors','length','map','hasOwnProperty','data','firstName','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','duplicate','Duplicate\x20Contact','CmContact','create','then','pick','catch','Error\x20while\x20creating\x20contact:\x20','message','stringify','cmContact','checkHopper','cm_hopper','fromQuery','phone','ContactId','createdAt','updatedAt','select','field','NOW()','scheduledAt','toString','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','id\x20IN\x20?','str','phone\x20IS\x20NOT\x20NULL','calleridnum','cm_hopper_final','insert','into','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','push','sequelize','query','VoiceQueueId','onlyIfOpen','all','BlackLists','Campaign','always','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','resume','resolve','emit','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','info','CSV\x20import\x20process\x20stopped!','parse','pause','CSV\x20parse\x20error'];(function(_0x49d41c,_0x2bdc35){var _0xb64c5f=function(_0x28f535){while(--_0x28f535){_0x49d41c['push'](_0x49d41c['shift']());}};_0xb64c5f(++_0x2bdc35);}(_0xb51e,0xce));var _0xeb51=function(_0x4a973e,_0x29034b){_0x4a973e=_0x4a973e-0x0;var _0x36b56e=_0xb51e[_0x4a973e];return _0x36b56e;};'use strict';var BPromise=require(_0xeb51('0x0'));var util=require(_0xeb51('0x1'));var _=require(_0xeb51('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require('papaparse');var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var logger=require(_0xeb51('0x3'))('api');config['redis']=_[_0xeb51('0x4')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xeb51('0x5'))(new Redis(config['redis']));require(_0xeb51('0x6'))[_0xeb51('0x7')](socket);try{if(!process['argv'][0x2]||process[_0xeb51('0x8')][0x2]===_0xeb51('0x9')||process[_0xeb51('0x8')][0x2]==='null'){throw new Error(_0xeb51('0xa'));}var FILEPATH=process['argv'][0x2];if(!process['argv'][0x3]||process[_0xeb51('0x8')][0x3]===_0xeb51('0x9')||process[_0xeb51('0x8')][0x3]===_0xeb51('0xb')||!process['argv'][0x4]||process[_0xeb51('0x8')][0x4]===_0xeb51('0x9')||process[_0xeb51('0x8')][0x4]===_0xeb51('0xb')){throw new Error(_0xeb51('0xc'));}var FIELDS=_[_0xeb51('0xd')](process[_0xeb51('0x8')][0x3][_0xeb51('0xe')](','),process[_0xeb51('0x8')][0x4]['split'](','));if(!process[_0xeb51('0x8')][0x5]||process[_0xeb51('0x8')][0x5]===_0xeb51('0x9')||process[_0xeb51('0x8')][0x5]===_0xeb51('0xb')){throw new Error(_0xeb51('0xf'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0xeb51('0x8')][0x6]&&process[_0xeb51('0x8')][0x6]!=='undefined'&&process[_0xeb51('0x8')][0x6]!==_0xeb51('0xb')?process['argv'][0x6]:null;var DUPLICATES=process[_0xeb51('0x8')][0x7]&&process['argv'][0x7]!==_0xeb51('0x9')&&process[_0xeb51('0x8')][0x7]!==_0xeb51('0xb')?process['argv'][0x7]:null;if(!process['argv'][0x8]||process[_0xeb51('0x8')][0x8]==='undefined'||process[_0xeb51('0x8')][0x8]==='null'){throw new Error(_0xeb51('0x10'));}var SOCKET_TIMESTAMP=process[_0xeb51('0x8')][0x8];}catch(_0x5392e0){logger[_0xeb51('0x11')](_0x5392e0);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0x2edc98,_0x51d09c,_0x8308b6,_0x305db0){var _0xf2d46={'message':_0x51d09c};_0xf2d46[_0x2edc98]=!![];if(_0x8308b6){_0xf2d46[_0xeb51('0x12')]=_0x8308b6;}if(_0x305db0){_0xf2d46[_0xeb51('0x13')]=_0x305db0;}return _0xf2d46;}function isEmail(_0x33e706){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x33e706);}function checkRow(_0x5df869,_0x46abfa,_0x4d57aa){return new BPromise(function(_0x2fd7ed,_0x1a2333){if(_[_0xeb51('0x14')](_0x5df869)){return _0x1a2333(handleCheckRowError('error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x4d57aa));}if(_0x5df869[_0xeb51('0x15')]&&_0x5df869[_0xeb51('0x15')][_0xeb51('0x16')]){var _0x5f058b=_[_0xeb51('0x17')](_0x5df869[_0xeb51('0x15')],'message')['join'](';');return _0x1a2333(handleCheckRowError(_0xeb51('0x11'),_0x5f058b,null,_0x4d57aa));}var _0x3991ca={};for(var _0x48625a in FIELDS){if(FIELDS[_0xeb51('0x18')](_0x48625a)&&FIELDS[_0x48625a]){_0x3991ca[_0x48625a]=_0x5df869[_0xeb51('0x19')][0x0][FIELDS[_0x48625a]]||_0x5df869['data'][0x0]['\ufeff'+FIELDS[_0x48625a]];}}if(!_0x3991ca[_0xeb51('0x1a')]){return _0x1a2333(handleCheckRowError(_0xeb51('0x11'),'firstName\x20not\x20specified!',null,_0x4d57aa));}if(!_0x3991ca['phone']){return _0x1a2333(handleCheckRowError('error','phone\x20not\x20specified!',null,_0x4d57aa));}if(_0x3991ca[_0xeb51('0x1b')]){var _0x98b36c=moment(_0x3991ca[_0xeb51('0x1b')],_0xeb51('0x1c'));if(!_0x98b36c[_0xeb51('0x1d')]()){return _0x1a2333(handleCheckRowError(_0xeb51('0x11'),_0xeb51('0x1e'),null,_0x4d57aa));}}if(_0x3991ca[_0xeb51('0x1f')]){if(!isEmail(_0x3991ca[_0xeb51('0x1f')])){return _0x1a2333(handleCheckRowError(_0xeb51('0x11'),'email\x20format\x20is\x20not\x20valid!',null,_0x4d57aa));}}_0x3991ca[_0xeb51('0x20')]=LISTID;_0x3991ca['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xeb51('0x16')]&&_0x46abfa){var _0x178285={};for(var _0x561431=0x0,_0x18c860=DUPLICATES[_0xeb51('0x16')];_0x561431<_0x18c860;_0x561431+=0x1){_0x178285[DUPLICATES[_0x561431]]=_0x3991ca[DUPLICATES[_0x561431]];}var _0x1eb0e9=_['find'](_0x46abfa,_0x178285);if(_0x1eb0e9){return _0x1a2333(handleCheckRowError(_0xeb51('0x21'),_0xeb51('0x22'),_0x1eb0e9,_0x4d57aa));}}return db[_0xeb51('0x23')][_0xeb51('0x24')](_0x3991ca,{'raw':!![],'hooks':![],'fields':_['keys'](_0x3991ca)})[_0xeb51('0x25')](function(_0x17c73c){if(DUPLICATES&&DUPLICATES['length']&&_0x46abfa){_0x46abfa['push'](_[_0xeb51('0x26')](_0x3991ca,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x17c73c['id'];return _0x2fd7ed();})[_0xeb51('0x27')](function(_0x246793){return _0x1a2333(handleCheckRowError(_0xeb51('0x11'),_0xeb51('0x28')+(_0x246793[_0xeb51('0x29')]||JSON[_0xeb51('0x2a')](_0x246793)),null,_0x4d57aa));});});}function checkHopper(){function _0x4a38d1(){return function(_0x34e6f4){logger['error'](_0xeb51('0x2b'),_0xeb51('0x2c'),util['inspect'](_0x34e6f4,{'showHidden':![],'depth':null}));};}var _0x559bc5=function(_0x570793,_0x4efb0b){var _0xa9ba40=squel['insert']()['into'](_0xeb51('0x2d'))[_0xeb51('0x2e')]([_0xeb51('0x2f'),'scheduledAt',_0xeb51('0x30'),_0xeb51('0x20'),_0x4efb0b,_0xeb51('0x31'),_0xeb51('0x32')],squel[_0xeb51('0x33')]()[_0xeb51('0x34')](_0xeb51('0x2f'),_0xeb51('0x2f'))[_0xeb51('0x34')](_0xeb51('0x35'),_0xeb51('0x36'))['field']('id','ContactId')['field'](LISTID[_0xeb51('0x37')](),'ListId')[_0xeb51('0x34')](_0x570793['id'][_0xeb51('0x37')](),_0x4efb0b)['field'](_0xeb51('0x35'),'createdAt')[_0xeb51('0x34')](_0xeb51('0x35'),'updatedAt')[_0xeb51('0x38')](_0xeb51('0x39'))[_0xeb51('0x3a')](_0xeb51('0x3b'))[_0xeb51('0x3a')](_0xeb51('0x3c'),LISTID['toString']())[_0xeb51('0x3a')]('phone\x20IS\x20NOT\x20NULL')['where'](_0xeb51('0x3d'),squel[_0xeb51('0x33')]()[_0xeb51('0x34')](_0xeb51('0x2f'))[_0xeb51('0x38')](_0xeb51('0x2d'))[_0xeb51('0x3a')](_0x4efb0b+_0xeb51('0x3e'),_0x570793['id']['toString']())))[_0xeb51('0x37')]();return _0xa9ba40;};var _0x322ae9=function(_0x2c0ef1,_0x3aeca5){var _0x2440e4=squel['insert']()['into'](_0xeb51('0x2d'))[_0xeb51('0x2e')](['phone','scheduledAt','ContactId','ListId',_0x3aeca5,_0xeb51('0x31'),_0xeb51('0x32')],squel['select']()['field'](_0xeb51('0x2f'),'phone')[_0xeb51('0x34')](_0xeb51('0x35'),_0xeb51('0x36'))[_0xeb51('0x34')]('id',_0xeb51('0x30'))['field'](LISTID[_0xeb51('0x37')](),'ListId')[_0xeb51('0x34')](_0x2c0ef1['id'][_0xeb51('0x37')](),_0x3aeca5)[_0xeb51('0x34')](_0xeb51('0x35'),_0xeb51('0x31'))['field'](_0xeb51('0x35'),_0xeb51('0x32'))['from'](_0xeb51('0x39'))['where']('deletedAt\x20IS\x20NULL')[_0xeb51('0x3a')](_0xeb51('0x3c'),LISTID[_0xeb51('0x37')]())[_0xeb51('0x3a')](_0xeb51('0x3f'),squel[_0xeb51('0x40')](hopperContacts))[_0xeb51('0x3a')](_0xeb51('0x41'))[_0xeb51('0x3a')](_0xeb51('0x3d'),squel[_0xeb51('0x33')]()[_0xeb51('0x34')](_0xeb51('0x42'))[_0xeb51('0x38')](_0xeb51('0x43'))[_0xeb51('0x3a')](_0x3aeca5+_0xeb51('0x3e'),_0x2c0ef1['id'][_0xeb51('0x37')]()))[_0xeb51('0x3a')](_0xeb51('0x3d'),squel[_0xeb51('0x33')]()[_0xeb51('0x34')]('phone')[_0xeb51('0x38')]('cm_hopper')['where'](_0x3aeca5+_0xeb51('0x3e'),_0x2c0ef1['id']['toString']())))['toString']();return _0x2440e4;};function _0x32cdad(_0x371857,_0x29bc85){var _0x5ca111=squel[_0xeb51('0x44')]()[_0xeb51('0x45')](_0xeb51('0x2d'))['fromQuery']([_0xeb51('0x2f'),'scheduledAt',_0xeb51('0x30'),'ListId',_0x29bc85,_0xeb51('0x31'),_0xeb51('0x32')],squel[_0xeb51('0x33')]()[_0xeb51('0x34')](_0xeb51('0x2f'),'phone')['field'](_0xeb51('0x35'),_0xeb51('0x36'))['field']('id',_0xeb51('0x30'))[_0xeb51('0x34')](LISTID[_0xeb51('0x37')](),_0xeb51('0x20'))[_0xeb51('0x34')](_0x371857['id'][_0xeb51('0x37')](),_0x29bc85)[_0xeb51('0x34')](_0xeb51('0x35'),_0xeb51('0x31'))['field']('NOW()',_0xeb51('0x32'))[_0xeb51('0x38')]('cm_contacts')[_0xeb51('0x3a')](_0xeb51('0x3b'))[_0xeb51('0x3a')](_0xeb51('0x3c'),LISTID['toString']())[_0xeb51('0x3a')](_0xeb51('0x3f'),squel[_0xeb51('0x40')](hopperContacts))[_0xeb51('0x3a')](_0xeb51('0x41')))[_0xeb51('0x37')]();return _0x5ca111;}function _0x4efbb6(_0x31c500,_0x1df84b){var _0x215f5a=squel[_0xeb51('0x44')]()[_0xeb51('0x45')](_0xeb51('0x46'))[_0xeb51('0x2e')]([_0xeb51('0x2f'),_0xeb51('0x30'),_0xeb51('0x20'),_0x1df84b,_0xeb51('0x31'),_0xeb51('0x32')],squel[_0xeb51('0x33')]()[_0xeb51('0x34')](_0xeb51('0x2f'),_0xeb51('0x2f'))[_0xeb51('0x34')]('id',_0xeb51('0x30'))[_0xeb51('0x34')](LISTID['toString'](),_0xeb51('0x20'))[_0xeb51('0x34')](_0x31c500['id'][_0xeb51('0x37')](),_0x1df84b)[_0xeb51('0x34')](_0xeb51('0x35'),_0xeb51('0x31'))['field'](_0xeb51('0x35'),_0xeb51('0x32'))[_0xeb51('0x38')](_0xeb51('0x39'))[_0xeb51('0x3a')](_0xeb51('0x3b'))[_0xeb51('0x3a')](_0xeb51('0x3c'),LISTID[_0xeb51('0x37')]())[_0xeb51('0x3a')]('id\x20IN\x20?',squel[_0xeb51('0x40')](hopperContacts))[_0xeb51('0x3a')](_0xeb51('0x41')))[_0xeb51('0x37')]();return _0x215f5a;}return db[_0xeb51('0x47')][_0xeb51('0x48')]({'where':{'type':_0xeb51('0x49')},'attributes':['id',_0xeb51('0x4a')],'include':[{'model':db[_0xeb51('0x4b')],'as':_0xeb51('0x4c'),'where':{'id':LISTID}}]})['then'](function(_0x421c8f){var _0x5e6caf=[];if(_0x421c8f){var _0x35f410;for(var _0x2acc50=0x0,_0x9650d5;_0x2acc50<_0x421c8f['length'];_0x2acc50+=0x1){_0x9650d5=_0x421c8f[_0x2acc50][_0xeb51('0x4d')]({'plain':!![]});switch(_0x9650d5[_0xeb51('0x4a')]){case'always':_0x5e6caf[_0xeb51('0x4e')](db[_0xeb51('0x4f')][_0xeb51('0x50')](_0x322ae9(_0x9650d5,_0xeb51('0x51')))['then'](function(){})[_0xeb51('0x27')](_0x4a38d1()));break;case _0xeb51('0x52'):_0x5e6caf[_0xeb51('0x4e')](db['sequelize'][_0xeb51('0x50')](_0x559bc5(_0x9650d5,_0xeb51('0x51')))[_0xeb51('0x25')](function(){})['catch'](_0x4a38d1()));break;default:_0x5e6caf[_0xeb51('0x4e')](db[_0xeb51('0x4f')][_0xeb51('0x50')](_0x32cdad(_0x9650d5,_0xeb51('0x51')))[_0xeb51('0x25')](function(){})[_0xeb51('0x27')](_0x4a38d1()));}}}return _0x5e6caf;})[_0xeb51('0x53')]()['then'](function(){return db[_0xeb51('0x47')][_0xeb51('0x48')]({'where':{'type':_0xeb51('0x49')},'attributes':['id'],'include':[{'model':db[_0xeb51('0x4b')],'as':_0xeb51('0x54'),'where':{'id':LISTID}}]})[_0xeb51('0x25')](function(_0x262212){var _0x5a96e8=[];if(_0x262212){var _0x1ea835;for(var _0x7f7784=0x0,_0x224b77;_0x7f7784<_0x262212[_0xeb51('0x16')];_0x7f7784+=0x1){_0x224b77=_0x262212[_0x7f7784][_0xeb51('0x4d')]({'plain':!![]});_0x5a96e8[_0xeb51('0x4e')](db[_0xeb51('0x4f')][_0xeb51('0x50')](_0x4efbb6(_0x224b77,'VoiceQueueId'))[_0xeb51('0x25')](function(){})[_0xeb51('0x27')](_0x4a38d1()));}}return _0x5a96e8;})[_0xeb51('0x53')]();})[_0xeb51('0x25')](function(){return db[_0xeb51('0x55')]['findAll']({'attributes':['id',_0xeb51('0x4a')],'include':[{'model':db[_0xeb51('0x4b')],'as':_0xeb51('0x4c'),'where':{'id':LISTID}}]})['then'](function(_0x353b08){var _0x4e06b=[];if(_0x353b08){for(var _0x49f34b=0x0,_0x4d93c7;_0x49f34b<_0x353b08[_0xeb51('0x16')];_0x49f34b+=0x1){_0x4d93c7=_0x353b08[_0x49f34b][_0xeb51('0x4d')]({'plain':!![]});switch(_0x4d93c7[_0xeb51('0x4a')]){case _0xeb51('0x56'):_0x4e06b[_0xeb51('0x4e')](db[_0xeb51('0x4f')][_0xeb51('0x50')](_0x322ae9(_0x4d93c7,_0xeb51('0x57')))[_0xeb51('0x25')](function(){})[_0xeb51('0x27')](_0x4a38d1()));break;case _0xeb51('0x52'):_0x4e06b[_0xeb51('0x4e')](db[_0xeb51('0x4f')][_0xeb51('0x50')](_0x559bc5(_0x4d93c7,_0xeb51('0x57')))[_0xeb51('0x25')](function(){})[_0xeb51('0x27')](_0x4a38d1()));break;default:_0x4e06b[_0xeb51('0x4e')](db[_0xeb51('0x4f')][_0xeb51('0x50')](_0x32cdad(_0x4d93c7,'CampaignId'))[_0xeb51('0x25')](function(){})['catch'](_0x4a38d1()));}}}return _0x4e06b;})['all']();})[_0xeb51('0x25')](function(){return db[_0xeb51('0x55')][_0xeb51('0x48')]({'attributes':['id'],'include':[{'model':db[_0xeb51('0x4b')],'as':_0xeb51('0x54'),'where':{'id':LISTID}}]})['then'](function(_0x266a3f){var _0x36dba3=[];if(_0x266a3f){for(var _0x4aed6c=0x0,_0x36c802;_0x4aed6c<_0x266a3f[_0xeb51('0x16')];_0x4aed6c+=0x1){_0x36c802=_0x266a3f[_0x4aed6c][_0xeb51('0x4d')]({'plain':!![]});_0x36dba3[_0xeb51('0x4e')](db[_0xeb51('0x4f')][_0xeb51('0x50')](_0x4efbb6(_0x36c802,_0xeb51('0x57')))[_0xeb51('0x25')](function(){})['catch'](_0x4a38d1()));}}return _0x36dba3;})['all']();})[_0xeb51('0x27')](function(_0x28711f){logger[_0xeb51('0x11')](_0xeb51('0x58'),_0xeb51('0x59'),_0x28711f[_0xeb51('0x29')]);});}var processPromises=function(_0x26d96c){return BPromise['all'](promises)['then'](function(_0x1329a1){})[_0xeb51('0x27')](function(_0x818159){logger['error'](_0xeb51('0x5a'),JSON['stringify'](_0x818159));})['finally'](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x26d96c){return _0x26d96c[_0xeb51('0x5b')]();}});};var endCsv=function(){return BPromise[_0xeb51('0x5c')]()[_0xeb51('0x25')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0xeb51('0x5d')](_0xeb51('0x5e')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xeb51('0x5f')](FILEPATH);}catch(_0xcf393){logger[_0xeb51('0x11')](_0xeb51('0x60'),JSON[_0xeb51('0x2a')](_0xcf393));}finally{process[_0xeb51('0x61')](0x0);}});};process['on']('SIGINT',function(){logger[_0xeb51('0x62')](_0xeb51('0x63'));endCsv();});function main(){return BPromise[_0xeb51('0x5c')]()[_0xeb51('0x25')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0xeb51('0x23')][_0xeb51('0x48')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xeb51('0x25')](function(_0x598cef){var _0x25b9ff=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xeb51('0x64')](_0x25b9ff,{'header':!![],'skipEmptyLines':!![],'step':function(_0x4e0eec,_0x5378a3){total+=0x1;var _0x2162f7=total;promises[_0xeb51('0x4e')](checkRow(_0x4e0eec,_0x598cef,_0x2162f7)['then'](function(){success+=0x1;})['catch'](function(_0x4f5b06){if(_0x4f5b06[_0xeb51('0x11')]){errors+=0x1;delete _0x4f5b06['error'];}else if(_0x4f5b06[_0xeb51('0x21')]){duplicates+=0x1;delete _0x4f5b06['duplicate'];}rows[_0xeb51('0x4e')](_0x4f5b06);}));if(total%0xc8===0x0){_0x5378a3[_0xeb51('0x65')]();return processPromises(_0x5378a3);}},'complete':function(){return processPromises()[_0xeb51('0x25')](function(){logger['info']('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x48e2d6,_0xdab2c2){logger[_0xeb51('0x62')](_0xeb51('0x66'),JSON[_0xeb51('0x2a')](_0x48e2d6));endCsv();}});})[_0xeb51('0x27')](function(_0x732b0d){logger[_0xeb51('0x11')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0xeb51('0x2a')](_0x732b0d));});}main(); \ No newline at end of file +var _0xc146=['cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','fromQuery','id\x20IN\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','get','always','VoiceQueueId','sequelize','query','catch','all','BlackLists','Campaign','Lists','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','contact:csv_','resume','resolve','emit','unlinkSync','exit','CSV\x20import\x20process\x20stopped!','pause','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','squel','papaparse','ioredis','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','null','undefined','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','contact','index','test','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','data','firstName','firstName\x20not\x20specified!','phone','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','then','push','pick','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','scheduledAt','updatedAt','select','field','NOW()','ContactId','toString','createdAt','from'];(function(_0x34d275,_0x5d84ee){var _0x1379cc=function(_0x320fbe){while(--_0x320fbe){_0x34d275['push'](_0x34d275['shift']());}};_0x1379cc(++_0x5d84ee);}(_0xc146,0x171));var _0x6c14=function(_0x312e48,_0x232a49){_0x312e48=_0x312e48-0x0;var _0x5a268a=_0xc146[_0x312e48];return _0x5a268a;};'use strict';var BPromise=require(_0x6c14('0x0'));var util=require(_0x6c14('0x1'));var _=require('lodash');var fs=require('fs');var squel=require(_0x6c14('0x2'));var Papa=require(_0x6c14('0x3'));var Redis=require(_0x6c14('0x4'));var db=require('../../../mysqldb')['db'];var config=require(_0x6c14('0x5'));var logger=require(_0x6c14('0x6'))(_0x6c14('0x7'));config[_0x6c14('0x8')]=_[_0x6c14('0x9')](config[_0x6c14('0x8')],{'host':_0x6c14('0xa'),'port':0x18eb});var socket=require(_0x6c14('0xb'))(new Redis(config['redis']));require(_0x6c14('0xc'))[_0x6c14('0xd')](socket);try{if(!process[_0x6c14('0xe')][0x2]||process[_0x6c14('0xe')][0x2]==='undefined'||process[_0x6c14('0xe')][0x2]===_0x6c14('0xf')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x6c14('0xe')][0x2];if(!process[_0x6c14('0xe')][0x3]||process['argv'][0x3]===_0x6c14('0x10')||process['argv'][0x3]===_0x6c14('0xf')||!process['argv'][0x4]||process[_0x6c14('0xe')][0x4]===_0x6c14('0x10')||process[_0x6c14('0xe')][0x4]===_0x6c14('0xf')){throw new Error(_0x6c14('0x11'));}var FIELDS=_[_0x6c14('0x12')](process[_0x6c14('0xe')][0x3][_0x6c14('0x13')](','),process[_0x6c14('0xe')][0x4][_0x6c14('0x13')](','));if(!process['argv'][0x5]||process[_0x6c14('0xe')][0x5]==='undefined'||process[_0x6c14('0xe')][0x5]==='null'){throw new Error(_0x6c14('0x14'));}var LISTID=process[_0x6c14('0xe')][0x5];var COMPANYID=process['argv'][0x6]&&process['argv'][0x6]!==_0x6c14('0x10')&&process[_0x6c14('0xe')][0x6]!==_0x6c14('0xf')?process[_0x6c14('0xe')][0x6]:null;var DUPLICATES=process[_0x6c14('0xe')][0x7]&&process['argv'][0x7]!==_0x6c14('0x10')&&process[_0x6c14('0xe')][0x7]!=='null'?process['argv'][0x7]:null;if(!process[_0x6c14('0xe')][0x8]||process[_0x6c14('0xe')][0x8]==='undefined'||process[_0x6c14('0xe')][0x8]==='null'){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x6c14('0xe')][0x8];}catch(_0x198e97){logger['error'](_0x198e97);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0x12ad46,_0x4df6f2,_0x21919c,_0x211324){var _0x47f7d6={'message':_0x4df6f2};_0x47f7d6[_0x12ad46]=!![];if(_0x21919c){_0x47f7d6[_0x6c14('0x15')]=_0x21919c;}if(_0x211324){_0x47f7d6[_0x6c14('0x16')]=_0x211324;}return _0x47f7d6;}function isEmail(_0x4d42dc){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0x6c14('0x17')](_0x4d42dc);}function checkRow(_0x295eeb,_0x280ca6,_0x5786f7){return new BPromise(function(_0x47d571,_0x3d0840){if(_['isNil'](_0x295eeb)){return _0x3d0840(handleCheckRowError(_0x6c14('0x18'),_0x6c14('0x19'),null,_0x5786f7));}if(_0x295eeb['errors']&&_0x295eeb[_0x6c14('0x1a')][_0x6c14('0x1b')]){var _0x2dca41=_[_0x6c14('0x1c')](_0x295eeb[_0x6c14('0x1a')],_0x6c14('0x1d'))['join'](';');return _0x3d0840(handleCheckRowError(_0x6c14('0x18'),_0x2dca41,null,_0x5786f7));}var _0xbf7363={};for(var _0x19608b in FIELDS){if(FIELDS['hasOwnProperty'](_0x19608b)&&FIELDS[_0x19608b]){_0xbf7363[_0x19608b]=_0x295eeb[_0x6c14('0x1e')][0x0][FIELDS[_0x19608b]]||_0x295eeb['data'][0x0]['\ufeff'+FIELDS[_0x19608b]];}}if(!_0xbf7363[_0x6c14('0x1f')]){return _0x3d0840(handleCheckRowError(_0x6c14('0x18'),_0x6c14('0x20'),null,_0x5786f7));}if(!_0xbf7363[_0x6c14('0x21')]){return _0x3d0840(handleCheckRowError(_0x6c14('0x18'),'phone\x20not\x20specified!',null,_0x5786f7));}if(_0xbf7363[_0x6c14('0x22')]){var _0x1ddcc0=moment(_0xbf7363[_0x6c14('0x22')],_0x6c14('0x23'));if(!_0x1ddcc0[_0x6c14('0x24')]()){return _0x3d0840(handleCheckRowError(_0x6c14('0x18'),_0x6c14('0x25'),null,_0x5786f7));}}if(_0xbf7363[_0x6c14('0x26')]){if(!isEmail(_0xbf7363[_0x6c14('0x26')])){return _0x3d0840(handleCheckRowError('error',_0x6c14('0x27'),null,_0x5786f7));}}_0xbf7363[_0x6c14('0x28')]=LISTID;_0xbf7363[_0x6c14('0x29')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x280ca6){var _0x1bb6d8={};for(var _0x84bb3d=0x0,_0x50c756=DUPLICATES[_0x6c14('0x1b')];_0x84bb3d<_0x50c756;_0x84bb3d+=0x1){_0x1bb6d8[DUPLICATES[_0x84bb3d]]=_0xbf7363[DUPLICATES[_0x84bb3d]];}var _0x129532=_[_0x6c14('0x2a')](_0x280ca6,_0x1bb6d8);if(_0x129532){return _0x3d0840(handleCheckRowError(_0x6c14('0x2b'),_0x6c14('0x2c'),_0x129532,_0x5786f7));}}return db[_0x6c14('0x2d')][_0x6c14('0x2e')](_0xbf7363,{'raw':!![],'hooks':![],'fields':_['keys'](_0xbf7363)})[_0x6c14('0x2f')](function(_0x3b968a){if(DUPLICATES&&DUPLICATES[_0x6c14('0x1b')]&&_0x280ca6){_0x280ca6[_0x6c14('0x30')](_[_0x6c14('0x31')](_0xbf7363,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x3b968a['id'];return _0x47d571();})['catch'](function(_0x6fbfa8){return _0x3d0840(handleCheckRowError('error',_0x6c14('0x32')+(_0x6fbfa8[_0x6c14('0x1d')]||JSON[_0x6c14('0x33')](_0x6fbfa8)),null,_0x5786f7));});});}function checkHopper(){function _0x15dc87(){return function(_0x47ced4){logger[_0x6c14('0x18')](_0x6c14('0x34'),_0x6c14('0x35'),util[_0x6c14('0x36')](_0x47ced4,{'showHidden':![],'depth':null}));};}var _0x4a6188=function(_0x107f6f,_0x651afd){var _0x319bde=squel[_0x6c14('0x37')]()[_0x6c14('0x38')](_0x6c14('0x39'))['fromQuery']([_0x6c14('0x21'),_0x6c14('0x3a'),'ContactId',_0x6c14('0x28'),_0x651afd,'createdAt',_0x6c14('0x3b')],squel[_0x6c14('0x3c')]()['field'](_0x6c14('0x21'),_0x6c14('0x21'))[_0x6c14('0x3d')](_0x6c14('0x3e'),_0x6c14('0x3a'))[_0x6c14('0x3d')]('id',_0x6c14('0x3f'))[_0x6c14('0x3d')](LISTID[_0x6c14('0x40')](),'ListId')[_0x6c14('0x3d')](_0x107f6f['id'][_0x6c14('0x40')](),_0x651afd)['field'](_0x6c14('0x3e'),_0x6c14('0x41'))[_0x6c14('0x3d')](_0x6c14('0x3e'),_0x6c14('0x3b'))[_0x6c14('0x42')](_0x6c14('0x43'))[_0x6c14('0x44')](_0x6c14('0x45'))[_0x6c14('0x44')](_0x6c14('0x46'),LISTID['toString']())[_0x6c14('0x44')](_0x6c14('0x47'))[_0x6c14('0x44')](_0x6c14('0x48'),squel[_0x6c14('0x3c')]()[_0x6c14('0x3d')](_0x6c14('0x21'))['from'](_0x6c14('0x39'))[_0x6c14('0x44')](_0x651afd+_0x6c14('0x49'),_0x107f6f['id'][_0x6c14('0x40')]())))['toString']();return _0x319bde;};var _0x135c32=function(_0x5cebf4,_0x29cd43){var _0x4762d1=squel[_0x6c14('0x37')]()[_0x6c14('0x38')]('cm_hopper')[_0x6c14('0x4a')]([_0x6c14('0x21'),_0x6c14('0x3a'),_0x6c14('0x3f'),_0x6c14('0x28'),_0x29cd43,'createdAt',_0x6c14('0x3b')],squel[_0x6c14('0x3c')]()[_0x6c14('0x3d')]('phone',_0x6c14('0x21'))[_0x6c14('0x3d')]('NOW()',_0x6c14('0x3a'))[_0x6c14('0x3d')]('id','ContactId')[_0x6c14('0x3d')](LISTID['toString'](),_0x6c14('0x28'))[_0x6c14('0x3d')](_0x5cebf4['id']['toString'](),_0x29cd43)[_0x6c14('0x3d')](_0x6c14('0x3e'),_0x6c14('0x41'))[_0x6c14('0x3d')](_0x6c14('0x3e'),'updatedAt')[_0x6c14('0x42')](_0x6c14('0x43'))['where'](_0x6c14('0x45'))[_0x6c14('0x44')]('ListId\x20=\x20?',LISTID[_0x6c14('0x40')]())[_0x6c14('0x44')](_0x6c14('0x4b'),squel['str'](hopperContacts))[_0x6c14('0x44')](_0x6c14('0x47'))[_0x6c14('0x44')]('phone\x20NOT\x20IN\x20(?)',squel[_0x6c14('0x3c')]()[_0x6c14('0x3d')]('calleridnum')[_0x6c14('0x42')]('cm_hopper_final')['where'](_0x29cd43+'\x20=\x20?',_0x5cebf4['id']['toString']()))[_0x6c14('0x44')](_0x6c14('0x48'),squel['select']()[_0x6c14('0x3d')]('phone')[_0x6c14('0x42')](_0x6c14('0x39'))[_0x6c14('0x44')](_0x29cd43+_0x6c14('0x49'),_0x5cebf4['id'][_0x6c14('0x40')]())))[_0x6c14('0x40')]();return _0x4762d1;};function _0x2079f1(_0x2c58e2,_0x26ea3a){var _0x27a2cf=squel['insert']()[_0x6c14('0x38')](_0x6c14('0x39'))['fromQuery']([_0x6c14('0x21'),'scheduledAt','ContactId',_0x6c14('0x28'),_0x26ea3a,'createdAt',_0x6c14('0x3b')],squel[_0x6c14('0x3c')]()[_0x6c14('0x3d')](_0x6c14('0x21'),_0x6c14('0x21'))[_0x6c14('0x3d')](_0x6c14('0x3e'),_0x6c14('0x3a'))[_0x6c14('0x3d')]('id',_0x6c14('0x3f'))[_0x6c14('0x3d')](LISTID[_0x6c14('0x40')](),_0x6c14('0x28'))['field'](_0x2c58e2['id'][_0x6c14('0x40')](),_0x26ea3a)['field'](_0x6c14('0x3e'),_0x6c14('0x41'))[_0x6c14('0x3d')]('NOW()',_0x6c14('0x3b'))[_0x6c14('0x42')](_0x6c14('0x43'))[_0x6c14('0x44')](_0x6c14('0x45'))['where'](_0x6c14('0x46'),LISTID[_0x6c14('0x40')]())[_0x6c14('0x44')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x6c14('0x44')](_0x6c14('0x47')))[_0x6c14('0x40')]();return _0x27a2cf;}function _0x22f4d5(_0x8a34de,_0x345512){var _0x4cd547=squel[_0x6c14('0x37')]()['into'](_0x6c14('0x4c'))[_0x6c14('0x4a')]([_0x6c14('0x21'),'ContactId',_0x6c14('0x28'),_0x345512,_0x6c14('0x41'),_0x6c14('0x3b')],squel[_0x6c14('0x3c')]()['field'](_0x6c14('0x21'),_0x6c14('0x21'))[_0x6c14('0x3d')]('id','ContactId')[_0x6c14('0x3d')](LISTID[_0x6c14('0x40')](),_0x6c14('0x28'))['field'](_0x8a34de['id'][_0x6c14('0x40')](),_0x345512)['field']('NOW()',_0x6c14('0x41'))[_0x6c14('0x3d')]('NOW()',_0x6c14('0x3b'))['from']('cm_contacts')[_0x6c14('0x44')](_0x6c14('0x45'))['where'](_0x6c14('0x46'),LISTID[_0x6c14('0x40')]())[_0x6c14('0x44')](_0x6c14('0x4b'),squel['str'](hopperContacts))[_0x6c14('0x44')](_0x6c14('0x47')))[_0x6c14('0x40')]();return _0x4cd547;}return db[_0x6c14('0x4d')][_0x6c14('0x4e')]({'where':{'type':_0x6c14('0x4f')},'attributes':['id',_0x6c14('0x50')],'include':[{'model':db[_0x6c14('0x51')],'as':'Lists','where':{'id':LISTID}}]})[_0x6c14('0x2f')](function(_0x1a9036){var _0x169fcc=[];if(_0x1a9036){var _0x267c2b;for(var _0x237e1c=0x0,_0x1462c4;_0x237e1c<_0x1a9036[_0x6c14('0x1b')];_0x237e1c+=0x1){_0x1462c4=_0x1a9036[_0x237e1c][_0x6c14('0x52')]({'plain':!![]});switch(_0x1462c4[_0x6c14('0x50')]){case _0x6c14('0x53'):_0x169fcc['push'](db['sequelize']['query'](_0x135c32(_0x1462c4,_0x6c14('0x54')))[_0x6c14('0x2f')](function(){})['catch'](_0x15dc87()));break;case'onlyIfOpen':_0x169fcc[_0x6c14('0x30')](db[_0x6c14('0x55')][_0x6c14('0x56')](_0x4a6188(_0x1462c4,_0x6c14('0x54')))[_0x6c14('0x2f')](function(){})[_0x6c14('0x57')](_0x15dc87()));break;default:_0x169fcc[_0x6c14('0x30')](db[_0x6c14('0x55')][_0x6c14('0x56')](_0x2079f1(_0x1462c4,'VoiceQueueId'))['then'](function(){})[_0x6c14('0x57')](_0x15dc87()));}}}return _0x169fcc;})[_0x6c14('0x58')]()[_0x6c14('0x2f')](function(){return db[_0x6c14('0x4d')][_0x6c14('0x4e')]({'where':{'type':_0x6c14('0x4f')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x6c14('0x59'),'where':{'id':LISTID}}]})[_0x6c14('0x2f')](function(_0x3da72d){var _0x4058c1=[];if(_0x3da72d){var _0x30d9fd;for(var _0x275c35=0x0,_0x32a1f2;_0x275c35<_0x3da72d[_0x6c14('0x1b')];_0x275c35+=0x1){_0x32a1f2=_0x3da72d[_0x275c35][_0x6c14('0x52')]({'plain':!![]});_0x4058c1[_0x6c14('0x30')](db['sequelize']['query'](_0x22f4d5(_0x32a1f2,_0x6c14('0x54')))[_0x6c14('0x2f')](function(){})['catch'](_0x15dc87()));}}return _0x4058c1;})[_0x6c14('0x58')]();})[_0x6c14('0x2f')](function(){return db[_0x6c14('0x5a')][_0x6c14('0x4e')]({'attributes':['id',_0x6c14('0x50')],'include':[{'model':db[_0x6c14('0x51')],'as':_0x6c14('0x5b'),'where':{'id':LISTID}}]})[_0x6c14('0x2f')](function(_0xd3dcf6){var _0x35d837=[];if(_0xd3dcf6){for(var _0x501e6d=0x0,_0x40a4ef;_0x501e6d<_0xd3dcf6[_0x6c14('0x1b')];_0x501e6d+=0x1){_0x40a4ef=_0xd3dcf6[_0x501e6d][_0x6c14('0x52')]({'plain':!![]});switch(_0x40a4ef[_0x6c14('0x50')]){case _0x6c14('0x53'):_0x35d837[_0x6c14('0x30')](db[_0x6c14('0x55')]['query'](_0x135c32(_0x40a4ef,_0x6c14('0x5c')))['then'](function(){})['catch'](_0x15dc87()));break;case'onlyIfOpen':_0x35d837[_0x6c14('0x30')](db[_0x6c14('0x55')][_0x6c14('0x56')](_0x4a6188(_0x40a4ef,'CampaignId'))['then'](function(){})['catch'](_0x15dc87()));break;default:_0x35d837[_0x6c14('0x30')](db[_0x6c14('0x55')][_0x6c14('0x56')](_0x2079f1(_0x40a4ef,_0x6c14('0x5c')))[_0x6c14('0x2f')](function(){})['catch'](_0x15dc87()));}}}return _0x35d837;})[_0x6c14('0x58')]();})[_0x6c14('0x2f')](function(){return db[_0x6c14('0x5a')]['findAll']({'attributes':['id'],'include':[{'model':db[_0x6c14('0x51')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x6c14('0x2f')](function(_0x8ef9f2){var _0x527937=[];if(_0x8ef9f2){for(var _0x2222ea=0x0,_0x875067;_0x2222ea<_0x8ef9f2['length'];_0x2222ea+=0x1){_0x875067=_0x8ef9f2[_0x2222ea][_0x6c14('0x52')]({'plain':!![]});_0x527937[_0x6c14('0x30')](db[_0x6c14('0x55')][_0x6c14('0x56')](_0x22f4d5(_0x875067,'CampaignId'))[_0x6c14('0x2f')](function(){})['catch'](_0x15dc87()));}}return _0x527937;})['all']();})[_0x6c14('0x57')](function(_0x3fb9a3){logger['error'](_0x6c14('0x5d'),_0x6c14('0x5e'),_0x3fb9a3[_0x6c14('0x1d')]);});}var processPromises=function(_0x57358c){return BPromise['all'](promises)[_0x6c14('0x2f')](function(_0x23ef18){})[_0x6c14('0x57')](function(_0x1b03d7){logger[_0x6c14('0x18')](_0x6c14('0x5f'),JSON[_0x6c14('0x33')](_0x1b03d7));})[_0x6c14('0x60')](function(){socket['emit'](_0x6c14('0x61')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x57358c){return _0x57358c[_0x6c14('0x62')]();}});};var endCsv=function(){return BPromise[_0x6c14('0x63')]()[_0x6c14('0x2f')](function(){if(hopperContacts){return checkHopper();}})[_0x6c14('0x2f')](function(){socket[_0x6c14('0x64')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x6c14('0x65')](FILEPATH);}catch(_0x21f12f){logger[_0x6c14('0x18')]('Unable\x20to\x20delete\x20temp\x20file:',JSON['stringify'](_0x21f12f));}finally{process[_0x6c14('0x66')](0x0);}});};process['on']('SIGINT',function(){logger['info'](_0x6c14('0x67'));endCsv();});function main(){return BPromise['resolve']()[_0x6c14('0x2f')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x6c14('0x13')](',');return db['CmContact'][_0x6c14('0x4e')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x6c14('0x2f')](function(_0x27c9e2){var _0x3db223=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x3db223,{'header':!![],'skipEmptyLines':!![],'step':function(_0x3d1d76,_0x55408b){total+=0x1;var _0x5d108d=total;promises[_0x6c14('0x30')](checkRow(_0x3d1d76,_0x27c9e2,_0x5d108d)[_0x6c14('0x2f')](function(){success+=0x1;})[_0x6c14('0x57')](function(_0x46bde1){if(_0x46bde1[_0x6c14('0x18')]){errors+=0x1;delete _0x46bde1[_0x6c14('0x18')];}else if(_0x46bde1[_0x6c14('0x2b')]){duplicates+=0x1;delete _0x46bde1[_0x6c14('0x2b')];}rows[_0x6c14('0x30')](_0x46bde1);}));if(total%0xc8===0x0){_0x55408b[_0x6c14('0x68')]();return processPromises(_0x55408b);}},'complete':function(){return processPromises()[_0x6c14('0x2f')](function(){logger[_0x6c14('0x69')](_0x6c14('0x6a'));endCsv();});},'error':function(_0x50a518,_0x4ce5c3){logger[_0x6c14('0x69')](_0x6c14('0x6b'),JSON[_0x6c14('0x33')](_0x50a518));endCsv();}});})[_0x6c14('0x57')](function(_0x262d17){logger[_0x6c14('0x18')](_0x6c14('0x6c'),JSON[_0x6c14('0x33')](_0x262d17));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index fbe01be..f96f4be 100644 --- a/server/components/import/cm/csv2.js +++ b/server/components/import/cm/csv2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x894b=['message','info','sequelize','query','spread','catch','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','all','voice_queues.dialTimezone','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','timezones','dialTimezone','utcOffset','set','offset','main','stringify','start','binding','clone','socket_timestamp','root','server/files/tmp','.csv','includes','name','keys','header','writeFileSync','parse','createReadStream','data','find','_description','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','description','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactId','contactTypeId','orderBy','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','CampaignId','campaigns_has_cm_blacklists','voice_queues_has_cm_blacklists','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','papaparse','util','moment','squel','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','AdditionalPhones','then','push','split','isNil','length','filter','CmContactHasItem','findOne','updated','PHONE','inserted','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','into','fromQuery','ContactId','ListId','createdAt','updatedAt','UserId','fields','from','cm_contacts','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','toString','insert','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper_black','ListId\x20=\x20?','cm_contacts.phone','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.updatedAt','cm_contacts.UserId','scheduledat','priority','recallme','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_hopper.ListId\x20=\x20?','concat','CompanyId','scheduledAt','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','error','exit','errors','code'];(function(_0x2311d5,_0x370ce7){var _0x12f67d=function(_0x151dfc){while(--_0x151dfc){_0x2311d5['push'](_0x2311d5['shift']());}};_0x12f67d(++_0x370ce7);}(_0x894b,0x123));var _0xb894=function(_0x35a1cb,_0x5985c3){_0x35a1cb=_0x35a1cb-0x0;var _0x2cd095=_0x894b[_0x35a1cb];return _0x2cd095;};'use strict';var fs=require('fs');var path=require(_0xb894('0x0'));var _=require(_0xb894('0x1'));var Papa=require(_0xb894('0x2'));var util=require(_0xb894('0x3'));var BPromise=require('bluebird');var moment=require(_0xb894('0x4'));var squel=require(_0xb894('0x5'));var Redis=require('ioredis');var db=require(_0xb894('0x6'))['db'];var config=require(_0xb894('0x7'));var shared=require(_0xb894('0x8'));var logger=require(_0xb894('0x9'))(_0xb894('0xa'));config[_0xb894('0xb')]=_[_0xb894('0xc')](config['redis'],{'host':_0xb894('0xd'),'port':0x18eb});var socket=require(_0xb894('0xe'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xb894('0xf')](_0xb894('0x10'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0xb894('0x10'));function isEmail(_0x1073a3){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0xb894('0x11')](_0x1073a3);}function selectNotIn(_0x495abe,_0x200610,_0x26b0f1,_0x4fb4ae,_0x26debc){return squel[_0xb894('0x12')]()[_0xb894('0x13')](_0xb894('0x14'))['from'](_0x4fb4ae)[_0xb894('0x15')](_0x200610,null,_0x200610+_0xb894('0x16')+_0x4fb4ae+'.'+_0x26b0f1)[_0xb894('0x17')](_0x4fb4ae+'.'+_0x26b0f1+_0xb894('0x18')+_0x495abe+'.'+_0x26b0f1)[_0xb894('0x17')](_0x200610+_0xb894('0x19')+_0x26debc['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x312785,_0xe04630){promisesAdditionalPhones=[];return db[_0xb894('0x1a')][_0xb894('0x1b')]({'raw':!![],'attributes':['id',_0xb894('0x1c')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0xb894('0x1d')](function(_0x1e2271){if(_0x1e2271!==null){var _0x347a21=[];for(var _0x2e4420=0x0;_0x2e4420<_0x1e2271['length'];_0x2e4420++){var _0x3328d4=_0x1e2271[_0x2e4420];_0x347a21[_0xb894('0x1e')](insertAdditionalPhones(_0x3328d4));}}Promise['all'](_0x347a21)['then'](function(){_0x312785({'val':0x1});});});});}function insertAdditionalPhones(_0x17a492){return new Promise(function(_0x21524b,_0x4e4adb){var _0x48a3d0=_0x17a492[_0xb894('0x1c')];var _0x4105c2=_0x48a3d0[_0xb894('0x1f')](';');var _0x100833=[];orderBy=0x0;for(var _0x5a9647=0x0;_0x5a9647<_0x4105c2['length'];_0x5a9647++){_0x100833['push'](splitAdditionalPhone(_0x17a492['id'],_0x4105c2[_0x5a9647]));}Promise['all'](_0x100833)[_0xb894('0x1d')](function(){_0x21524b({'val':_0x4105c2['length']});});});}function splitAdditionalPhone(_0x568e74,_0x2e9c06){return new Promise(function(_0x222e8e,_0x46438b){var _0x234046=_0x2e9c06[_0xb894('0x1f')](':');var _0x18f92e=_0x234046[0x0];var _0x5525db=_0x234046[0x1];if(!_[_0xb894('0x20')](_0x5525db)){var _0x22e24b=_0x5525db['split']('|');var _0x3c50ab=[];for(var _0x272fb8=0x0;_0x272fb8<_0x22e24b[_0xb894('0x21')];_0x272fb8++){if(_0x22e24b[_0x272fb8]!==''){var _0x502689=_[_0xb894('0x22')](promisesAdditionalPhones,{'contactId':_0x568e74,'phone':_0x22e24b[_0x272fb8]});if(_0x502689[_0xb894('0x21')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x568e74,'contactTypeId':_0x18f92e,'phone':_0x22e24b[_0x272fb8],'orderBy':orderBy});}}}_0x222e8e({'ok':0x1});}else _0x222e8e({'res':0x0});});}function createAdditionalPhone(_0x327a71,_0x62ee9,_0xa492c3,_0x5ad173){var _0x4981e5='';var _0x3bf51c='';var _0x886452=_0xa492c3['split']('§');_0x4981e5=_0x886452[0x0];if(_0x886452[_0xb894('0x21')]==0x2)_0x3bf51c=_0x886452[0x1];return new Promise(function(_0x176b4d,_0x10601c){return db[_0xb894('0x23')][_0xb894('0x24')]({'where':{'CmContactId':_0x327a71,'item':_0x4981e5}})[_0xb894('0x1d')](function(_0x259b9d){if(_0x259b9d){return db[_0xb894('0x23')]['update']({'ItemTypeId':_0x62ee9,'description':_0x3bf51c,'OrderBy':_0x5ad173},{'where':{'CmContactId':_0x327a71,'item':_0x4981e5}})['then'](function(_0x2607af){_0x176b4d({'res':_0xb894('0x25')});});}else{return db['CmContactHasItem']['create']({'CmContactId':_0x327a71,'item':_0x4981e5,'description':_0x3bf51c,'ItemTypeId':_0x62ee9,'OrderBy':_0x5ad173,'ItemClass':_0xb894('0x26')})['then'](function(_0x178aa9){_0x176b4d({'res':_0xb894('0x27')});});}});});}function insertCmHopper(_0x1aacf0,_0x3b5e69,_0x1bf71f,_0x563725,_0x52a9ee){var _0x4db1d7=['cm_contacts.phone',_0xb894('0x28'),_0xb894('0x29'),_0xb894('0x2a'),_0x3b5e69+'.'+_0x563725,_0xb894('0x2b'),'cm_contacts.updatedAt',_0xb894('0x2c'),'cm_contacts.UserId','\x22'+_0x52a9ee+'\x22'];return squel['insert']()[_0xb894('0x2d')]('cm_hopper')[_0xb894('0x2e')]([_0xb894('0x14'),'scheduledat',_0xb894('0x2f'),_0xb894('0x30'),_0x563725,_0xb894('0x31'),_0xb894('0x32'),'priority',_0xb894('0x33'),'recallme'],squel[_0xb894('0x12')]()[_0xb894('0x34')](_0x4db1d7)[_0xb894('0x35')](_0x3b5e69)[_0xb894('0x15')](_0xb894('0x36'),null,'cm_contacts.ListId\x20=\x20'+_0x3b5e69+_0xb894('0x37'))['join'](_0x1bf71f,null,_0x1bf71f+_0xb894('0x16')+_0x3b5e69+'.'+_0x563725)[_0xb894('0x17')](_0x3b5e69+'.CmListId\x20=\x20?',_0x1aacf0)['where'](_0xb894('0x38'),NOW)[_0xb894('0x17')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x3b5e69,_0x1bf71f,_0x563725,_0xb894('0x39'),[_0xb894('0x3a'),_0xb894('0x3b')]))['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x3b5e69,_0x1bf71f,_0x563725,_0xb894('0x39'),[_0xb894('0x3a')])))[_0xb894('0x3c')]();}function insertCmHopperBlack(_0x599384,_0x4e1400,_0x82550,_0x2d083a){var _0x23e534=['cm_contacts.phone','cm_contacts.id',_0xb894('0x2a'),_0x4e1400+'.'+_0x2d083a,_0xb894('0x2b'),'cm_contacts.updatedAt'];return squel[_0xb894('0x3d')]()[_0xb894('0x2d')]('cm_hopper_black')['fromQuery']([_0xb894('0x14'),_0xb894('0x2f'),_0xb894('0x30'),_0x2d083a,'createdAt','updatedAt'],squel[_0xb894('0x12')]()['fields'](_0x23e534)[_0xb894('0x35')](_0x4e1400)[_0xb894('0x15')](_0xb894('0x36'),null,_0xb894('0x3e')+_0x4e1400+_0xb894('0x37'))[_0xb894('0x15')](_0x82550,null,_0x82550+_0xb894('0x16')+_0x4e1400+'.'+_0x2d083a)[_0xb894('0x17')](_0x4e1400+_0xb894('0x3f'),_0x599384)[_0xb894('0x17')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xb894('0x17')](_0xb894('0x40'),squel[_0xb894('0x12')]()[_0xb894('0x13')]('phone')[_0xb894('0x35')](_0xb894('0x41'))['where'](_0xb894('0x42'),_0x599384)[_0xb894('0x17')](_0x2d083a+_0xb894('0x18')+_0x4e1400+'.'+_0x2d083a)))['toString']();}function insertTzCmHopper(_0x2d5ed5,_0x4d5800,_0x10b3f3,_0x23fd28,_0x412eb,_0x5a761c){var _0xc43c07=[_0xb894('0x43'),_0xb894('0x44')+_0x5a761c+_0xb894('0x45'),_0xb894('0x29'),_0xb894('0x2a'),_0x4d5800+'.'+_0x23fd28,_0xb894('0x2b'),_0xb894('0x46'),_0xb894('0x2c'),_0xb894('0x47'),'\x22'+_0x412eb+'\x22'];var _0x36fc5f=squel[_0xb894('0x3d')]()['into'](_0xb894('0x39'))[_0xb894('0x2e')]([_0xb894('0x14'),_0xb894('0x48'),_0xb894('0x2f'),_0xb894('0x30'),_0x23fd28,_0xb894('0x31'),_0xb894('0x32'),_0xb894('0x49'),_0xb894('0x33'),_0xb894('0x4a')],squel[_0xb894('0x12')]()[_0xb894('0x34')](_0xc43c07)[_0xb894('0x35')](_0x4d5800)[_0xb894('0x15')](_0xb894('0x36'),null,_0xb894('0x3e')+_0x4d5800+_0xb894('0x37'))[_0xb894('0x15')](_0x10b3f3,null,_0x10b3f3+_0xb894('0x16')+_0x4d5800+'.'+_0x23fd28)['join'](_0x5a761c,null,_0x5a761c+_0xb894('0x16')+_0x4d5800+'.'+_0x23fd28)[_0xb894('0x17')](_0x4d5800+_0xb894('0x3f'),_0x2d5ed5)['where'](_0xb894('0x38'),NOW)[_0xb894('0x17')](_0xb894('0x40'),selectNotIn(_0x4d5800,_0x10b3f3,_0x23fd28,_0xb894('0x39'),[_0xb894('0x3a'),_0xb894('0x3b')]))[_0xb894('0x17')](_0xb894('0x40'),selectNotIn(_0x4d5800,_0x10b3f3,_0x23fd28,_0xb894('0x39'),[_0xb894('0x3a')])))[_0xb894('0x3c')]();return _0x36fc5f;}function insertTzCmHopperBlack(_0x1defea,_0x576681,_0x13ed9b,_0x1a64ad){var _0x159e35=[_0xb894('0x43'),'cm_contacts.id',_0xb894('0x2a'),_0x576681+'.'+_0x1a64ad,_0xb894('0x2b'),'cm_contacts.updatedAt'];return squel[_0xb894('0x3d')]()[_0xb894('0x2d')]('cm_hopper_black')[_0xb894('0x2e')]([_0xb894('0x14'),_0xb894('0x2f'),_0xb894('0x30'),_0x1a64ad,_0xb894('0x31'),_0xb894('0x32')],squel[_0xb894('0x12')]()[_0xb894('0x34')](_0x159e35)[_0xb894('0x35')](_0x576681)[_0xb894('0x15')]('cm_contacts',null,_0xb894('0x3e')+_0x576681+_0xb894('0x37'))[_0xb894('0x15')](_0x13ed9b,null,_0x13ed9b+_0xb894('0x16')+_0x576681+'.'+_0x1a64ad)[_0xb894('0x17')](_0x576681+_0xb894('0x3f'),_0x1defea)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0xb894('0x17')](_0xb894('0x40'),squel[_0xb894('0x12')]()[_0xb894('0x13')](_0xb894('0x14'))[_0xb894('0x35')](_0xb894('0x41'))[_0xb894('0x17')](_0xb894('0x42'),_0x1defea)[_0xb894('0x17')](_0x1a64ad+'\x20=\x20'+_0x576681+'.'+_0x1a64ad)))[_0xb894('0x3c')]();}function insertCmHopperAdditionalPhones(_0x2a14d0){var _0x141910=['cm_hopper.id',_0xb894('0x4b'),_0xb894('0x4c'),_0xb894('0x4d'),_0xb894('0x4e')];return squel[_0xb894('0x3d')]()[_0xb894('0x2d')](_0xb894('0x4f'))[_0xb894('0x2e')](['CmHopperId',_0xb894('0x14'),_0xb894('0x50'),_0xb894('0x31'),_0xb894('0x32')],squel[_0xb894('0x12')]()['fields'](_0x141910)[_0xb894('0x35')](_0xb894('0x39'))['join'](_0xb894('0x36'),null,_0xb894('0x51'))[_0xb894('0x15')]('cm_contact_has_items',null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0xb894('0x17')](_0xb894('0x52'),_0x2a14d0)[_0xb894('0x17')](_0xb894('0x38'),NOW))[_0xb894('0x3c')]();}function insertCmContact(_0x4c0612,_0x1df460,_0x3bdff7,_0xe45ebc){var _0x23e700=_[_0xb894('0x53')](_['keys'](_0xe45ebc),[_0xb894('0x30'),_0xb894('0x54'),'createdAt','updatedAt',_0xb894('0x55')]);return squel['insert']()[_0xb894('0x2d')](_0xb894('0x36'))[_0xb894('0x2e')](_0x23e700,squel[_0xb894('0x12')]()['fields'](_0x23e700)[_0xb894('0x35')](_0x1df460)[_0xb894('0x17')]('('+_0x3bdff7[_0xb894('0x15')](',')+')\x20NOT\x20IN\x20?',squel[_0xb894('0x12')]()['fields'](_0x3bdff7)[_0xb894('0x35')](_0xb894('0x36'))[_0xb894('0x17')](_0xb894('0x42'),_0x4c0612)[_0xb894('0x17')](_0xb894('0x56')))[_0xb894('0x17')](_0xb894('0x57'),squel[_0xb894('0x12')]()['field'](_0xb894('0x58'),_0xb894('0x59'))[_0xb894('0x35')](_0x1df460)[_0xb894('0x5a')](_0x3bdff7[_0xb894('0x15')](','))))[_0xb894('0x3c')]();}function handleStop(){logger['info']('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x4ffb75){logger[_0xb894('0x5b')](_0x4ffb75['message']);process[_0xb894('0x5c')](0x1);}function handleError(_0x231af2,_0x12b57b){stats[_0xb894('0x5d')][_0xb894('0x1e')]({'name':_0x12b57b[_0xb894('0x5e')],'message':_0x12b57b[_0xb894('0x5f')],'row':_0x231af2});}function handleQuery(_0x57a2f7){logger[_0xb894('0x60')](_0x57a2f7);return db[_0xb894('0x61')][_0xb894('0x62')](_0x57a2f7)[_0xb894('0x63')](function(_0x2c3683){results['push'](_0x2c3683);})[_0xb894('0x64')](function(_0x49c221){logger['error'](_0x49c221[_0xb894('0x5f')]);});}function updateTzCampaigns(_0xcf9b9b){return new Promise(function(_0x880f79,_0x60bd45){var _0x3fcbeb=squel[_0xb894('0x12')]()[_0xb894('0x34')]([_0xb894('0x65'),_0xb894('0x66')])['from'](_0xb894('0x67'))[_0xb894('0x15')](_0xb894('0x68'),null,_0xb894('0x69'))[_0xb894('0x17')](_0xb894('0x6a')+_0xcf9b9b);db[_0xb894('0x61')][_0xb894('0x62')](_0x3fcbeb[_0xb894('0x3c')]())['spread'](function(_0x2f26d9){var _0x5707c5=[];for(var _0x4465f4=0x0;_0x4465f4<_0x2f26d9['length'];_0x4465f4++){_0x5707c5[_0xb894('0x1e')](getTimezoneData(_0x2f26d9[_0x4465f4],tmp_campaigns));}BPromise[_0xb894('0x6b')](_0x5707c5)[_0xb894('0x1d')](function(){_0x880f79({'val':0x1});});})[_0xb894('0x64')](function(_0x111981){logger[_0xb894('0x5b')](_0x111981['message']);_0x880f79({'val':0x0});});});}function updateTzVoiceQueues(_0x1dac6a){return new Promise(function(_0x4b95d6,_0x15ad33){var _0x569470=squel[_0xb894('0x12')]()[_0xb894('0x34')](['voice_queues.id',_0xb894('0x6c')])[_0xb894('0x35')]('voice_queues')['join']('voice_queues_has_cm_lists',null,_0xb894('0x6d'))[_0xb894('0x17')](_0xb894('0x6e')+_0x1dac6a);db['sequelize'][_0xb894('0x62')](_0x569470[_0xb894('0x3c')]())['spread'](function(_0x48e27a){var _0xacf2ac=[];for(var _0x2c853d=0x0;_0x2c853d<_0x48e27a[_0xb894('0x21')];_0x2c853d++){_0xacf2ac[_0xb894('0x1e')](getTimezoneData(_0x48e27a[_0x2c853d],tmp_voice_queues));}BPromise[_0xb894('0x6b')](_0xacf2ac)[_0xb894('0x1d')](function(){_0x4b95d6({'val':0x1});});})['catch'](function(_0x43cc3d){logger[_0xb894('0x5b')](_0x43cc3d[_0xb894('0x5f')]);_0x4b95d6({'val':0x0});});});}function getTimezoneData(_0x157f5f,_0x52d432){return new Promise(function(_0x45d0a7,_0x33172b){var _0xc985c1=shared[_0xb894('0x6f')];var _0x17a1fd=_0xc985c1[_0x157f5f[_0xb894('0x70')]];if(_[_0xb894('0x20')](_0x17a1fd)){_0x45d0a7({'ret':0x1});}else{var _0x3e0733=_0x17a1fd[_0xb894('0x71')];var _0x3b2b53=squel[_0xb894('0x3d')]()[_0xb894('0x2d')](_0x52d432)[_0xb894('0x72')]('id',_0x157f5f['id'])[_0xb894('0x72')](_0xb894('0x73'),_0x3e0733)['set'](_0xb894('0x70'),_0x157f5f['dialTimezone'])['toString']();return db['sequelize'][_0xb894('0x62')](_0x3b2b53)[_0xb894('0x63')](function(_0x17d8e5){_0x45d0a7({'ret':0x1});})['catch'](function(_0x406d0f){logger[_0xb894('0x5b')](_0x406d0f[_0xb894('0x5f')]);_0x33172b({'ret':0x1});});}});}function handleTZQuery(_0x38b444){logger[_0xb894('0x60')](_0x38b444);return db[_0xb894('0x61')][_0xb894('0x62')](_0x38b444)['spread'](function(_0x3836c7){})[_0xb894('0x64')](function(_0x374e84){logger[_0xb894('0x5b')](_0x374e84[_0xb894('0x5f')]);});}function main(_0x48319b,_0x5b2f66,_0x4e8c2f,_0x3c4fe3){logger['info'](_0xb894('0x74'),_0x48319b,JSON[_0xb894('0x75')](_0x5b2f66));process['send'](_0xb894('0x76'));var _0x4ab7a6=_0x5b2f66[_0xb894('0x77')];var _0x38400d=_[_0xb894('0x78')](_0x4ab7a6);var _0x2f2f3c=_0x5b2f66[_0xb894('0x79')];var _0x147951=path[_0xb894('0x15')](config[_0xb894('0x7a')],_0xb894('0x7b'),_0x2f2f3c+_0xb894('0x7c'));hasTZ=_['keys'](_0x4ab7a6)[_0xb894('0x7d')]('dialTimezone');var _0x14f508=_['keys'](_0x4ab7a6)['join']();logger[_0xb894('0x60')]('header',_0x14f508);db['ContactItemType']['findAll']({'raw':!![],'attributes':['id',_0xb894('0x7e')]})[_0xb894('0x1d')](function(_0x347d94){for(var _0xaaddcb=0x0;_0xaaddcb<_0x347d94[_0xb894('0x21')];_0xaaddcb++){if(_0x347d94[_0xaaddcb][_0xb894('0x7e')]in _0x4ab7a6){contactItemTypes[_0xb894('0x1e')](_0x347d94[_0xaaddcb]);delete _0x38400d[_0x347d94[_0xaaddcb][_0xb894('0x7e')]];hasAdditionalPhones=!![];}for(var _0x53c8b4 in _0x4ab7a6){if(_0x347d94[_0xaaddcb][_0xb894('0x7e')]+'_description'===_0x53c8b4){phoneDescriptions[_0xb894('0x1e')]({'itemTypeId':_0x347d94[_0xaaddcb]['id'],'description':_0x53c8b4});delete _0x38400d[_0x53c8b4];}}}if(hasAdditionalPhones)_0x38400d['AdditionalPhones']='';var _0x24c2ef=_[_0xb894('0x7f')](_0x38400d)[_0xb894('0x15')]();logger[_0xb894('0x60')](_0xb894('0x80'),_0x24c2ef);fs[_0xb894('0x81')](_0x147951,_0x24c2ef+'\x0a');Papa[_0xb894('0x82')](fs[_0xb894('0x83')](_0x48319b),{'header':!![],'skipEmptyLines':!![],'step':function(_0x102952,_0x285a30){try{for(var _0x22cf26=0x0,_0x595bc3=[];_0x22cf26<_0x102952[_0xb894('0x84')]['length'];_0x22cf26++){stats['rows']+=0x1;if(_0x102952[_0xb894('0x5d')][_0x22cf26]){handleError(_0x102952[_0xb894('0x84')][_0x22cf26],_0x102952['errors'][_0x22cf26]);}else{var _0x3e5f0a=[];var _0x3ba941=[];var _0x386c0d={};for(var _0x87b5a8 in _0x4ab7a6){let _0x2bcc19=contactItemTypes[_0xb894('0x85')](_0x1190dc=>_0x1190dc[_0xb894('0x7e')]===_0x87b5a8);let _0x56357b=contactItemTypes[_0xb894('0x85')](_0x2ae32e=>_0x2ae32e[_0xb894('0x7e')]+_0xb894('0x86')===_0x87b5a8);if(_['isNil'](_0x2bcc19)&&_[_0xb894('0x20')](_0x56357b)){if(_0x4ab7a6[_0xb894('0x87')](_0x87b5a8)){if(_0x102952[_0xb894('0x84')][_0x22cf26][_0x4ab7a6[_0x87b5a8]]){var _0x500870=_[_0xb894('0x88')](_0x102952[_0xb894('0x84')][_0x22cf26][_0x4ab7a6[_0x87b5a8]][_0xb894('0x89')](/"/g,'\x27'));switch(_0x87b5a8){case _0xb894('0x48'):var _0x4fbfa1=moment(_0x500870,_0xb894('0x10'),!![]);if(_0x4fbfa1[_0xb894('0x8a')]()){_0x595bc3[_0xb894('0x1e')]('\x22'+_0x500870+'\x22');}else{_0x3e5f0a[_0xb894('0x1e')](_0xb894('0x8b'));}break;case _0xb894('0x49'):var _0x12231e=parseInt(_0x500870);_0x500870=_[_0xb894('0x8c')](_0x12231e)||_0x12231e<0x0||_0x12231e>0x4?_0x3c4fe3?0x3:0x2:_0x12231e;_0x595bc3[_0xb894('0x1e')]('\x22'+_0x500870+'\x22');break;case _0xb894('0x33'):var _0x12314d=parseInt(_0x500870);if(_['isNumber'](_0x12314d)&&_[_0xb894('0x7d')](_0x4e8c2f,_0x12314d)){_0x595bc3[_0xb894('0x1e')]('\x22'+_0x12314d+'\x22');}else{_0x3e5f0a[_0xb894('0x1e')](_0xb894('0x8d'));}break;case'email':if(isEmail(_0x500870)){_0x595bc3[_0xb894('0x1e')]('\x22'+_0x500870+'\x22');}else{_0x3e5f0a['push'](_0xb894('0x8e'));}break;case _0xb894('0x8f'):var _0x5b745f=moment(_0x500870,_0xb894('0x90'),!![]);if(_0x5b745f[_0xb894('0x8a')]()){_0x595bc3[_0xb894('0x1e')]('\x22'+_0x500870+'\x22');}else{_0x3e5f0a[_0xb894('0x1e')](_0xb894('0x91'));}break;case _0xb894('0x70'):var _0xc2cd6e=shared[_0xb894('0x6f')];var _0x26b5e5=_0xc2cd6e[_0x500870];if(!_[_0xb894('0x20')](_0x26b5e5)){var _0x27069c=_0x26b5e5['utcOffset'];_0x595bc3['push']('\x22'+_0x500870+'\x22');_0x595bc3['push']('\x22'+_0x27069c+'\x22');}break;default:_0x595bc3['push']('\x22'+_0x500870+'\x22');}}else{switch(_0x87b5a8){case _0xb894('0x92'):case _0xb894('0x14'):_0x3e5f0a[_0xb894('0x1e')](_0x87b5a8+_0xb894('0x93'));break;default:_0x595bc3[_0xb894('0x1e')]('\x22\x22');}}}}else{var _0x1aebf4='';if(!_['isNil'](_0x2bcc19)){if(!_0x386c0d[_0xb894('0x87')](_0x2bcc19['id'])){if(!_[_0xb894('0x20')](_0x102952['data'][_0x22cf26][_0x4ab7a6[_0x87b5a8]])){var _0x500870=_['trim'](_0x102952['data'][_0x22cf26][_0x4ab7a6[_0x87b5a8]][_0xb894('0x89')](/"/g,'\x27'));var _0x2e15be=phoneDescriptions[_0xb894('0x85')](_0x2d3475=>_0x2d3475['itemTypeId']===_0x2bcc19['id']);if(!_[_0xb894('0x20')](_0x2e15be)){var _0xc5df5d=_[_0xb894('0x88')](_0x102952[_0xb894('0x84')][_0x22cf26][_0x4ab7a6[_0x2e15be[_0xb894('0x94')]]]['replace'](/"/g,'\x27'));if(!_[_0xb894('0x20')](_0xc5df5d))_0x500870=_0x500870+'§'+_0xc5df5d;}if(_0x1aebf4=='')_0x1aebf4=_0x500870;else _0x1aebf4+='|'+_0x500870;}_0x3ba941[_0xb894('0x1e')](_0x2bcc19['id']+':'+_0x1aebf4);_0x386c0d[_0x2bcc19['id']]=0x1;}}}}if(hasAdditionalPhones){_0x595bc3['push']('\x22'+_0x3ba941[_0xb894('0x15')](';')+'\x22');}if(_0x3e5f0a[_0xb894('0x21')]){handleError(_0x102952[_0xb894('0x84')][_0x22cf26],{'code':_0xb894('0x95'),'message':_0x3e5f0a[_0xb894('0x15')]()});}else{fs[_0xb894('0x96')](_0x147951,_0x595bc3[_0xb894('0x15')]()+'\x0a');}_0x595bc3=[];}if(!(stats['rows']%0xc8)){socket[_0xb894('0x97')](_0xb894('0x98')+_0x2f2f3c,stats);stats[_0xb894('0x5d')]=[];}}if(stopped){logger[_0xb894('0x60')](_0xb894('0x99'));_0x285a30[_0xb894('0x9a')]();}}catch(_0x4810ae){handleError(_0x102952['data'][_0x22cf26],{'code':_0xb894('0x9b'),'message':_0x4810ae[_0xb894('0x5f')]});logger[_0xb894('0x5b')](_0xb894('0x9c'),_0x4810ae[_0xb894('0x5f')]);}},'complete':function(){try{var _0x56be76=[];var _0x70fcb6=[];var _0x59539a='cm_contacts';if(_0x5b2f66[_0xb894('0x9d')]&&_0x5b2f66['duplicates']['length']){_0x59539a=_0xb894('0x9e')+_0x2f2f3c;_0x56be76[_0xb894('0x1e')](_0xb894('0x9f')+_0x59539a+_0xb894('0xa0'));}tmp_campaigns=_0xb894('0xa1')+_0x2f2f3c;tmp_voice_queues=_0xb894('0xa2')+_0x2f2f3c;_0x70fcb6[_0xb894('0x1e')](_0xb894('0x9f')+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x70fcb6[_0xb894('0x1e')]('CREATE\x20TABLE\x20'+tmp_voice_queues+_0xb894('0xa3'));BPromise[_0xb894('0xa4')](_0x70fcb6,handleTZQuery)['then'](function(_0x34bb4e){updateTzCampaigns(_0x5b2f66[_0xb894('0x30')])['then'](function(_0x22684f){updateTzVoiceQueues(_0x5b2f66[_0xb894('0x30')])[_0xb894('0x1d')](function(_0x2074a5){if(hasTZ)_0x24c2ef=_0x24c2ef[_0xb894('0x89')](_0xb894('0x70'),_0xb894('0xa5'));var _0x589938=util[_0xb894('0xf')](_0xb894('0xa6'),_0x147951,_0x59539a,_0x24c2ef,_0x5b2f66[_0xb894('0x30')],_0x5b2f66[_0xb894('0x54')]||null,NOW,NOW);if(_[_0xb894('0x20')](_0x4ab7a6['scheduledat'])){_0x589938+=_0xb894('0xa7');}_0x56be76[_0xb894('0x1e')](_0x589938);if(_0x5b2f66['duplicates']&&_0x5b2f66[_0xb894('0x9d')][_0xb894('0x21')]){_0x56be76[_0xb894('0x1e')](insertCmContact(_0x5b2f66[_0xb894('0x30')],_0x59539a,_0x5b2f66['duplicates'],_0x4ab7a6));_0x56be76[_0xb894('0x1e')](_0xb894('0xa8')+_0x59539a+';');}BPromise[_0xb894('0xa4')](_0x56be76,handleQuery)['then'](function(_0x1576e6){BPromise[_0xb894('0x6b')]([handleAdditionalPhones()])[_0xb894('0x1d')](function(){_0x56be76=[];for(var _0x263aaa=0x0;_0x263aaa\x20\x20','server/files/tmp','binding\x20doesn\x27t\x20exists','firstName','firstName\x20is\x20mandatory','body\x20id\x20mandatory','SIGINT','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','redis','defaults','localhost','format','YYYY-MM-DD\x20HH:mm:ss','select','field','phone','from','where','\x20=\x20','join','CmContact','findAll','AdditionalPhones','then','push','all','split','length','isNil','CmContactHasItem','findOne','update','updated','PHONE','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','cm_hopper','fromQuery','scheduledat','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_contacts.id','into','cm_hopper_black','ContactId','cm_contacts.ListId\x20=\x20','.CmListId','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.UserId','cm_contacts.createdAt\x20=\x20?','\x22onlyIfOpen\x22','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId','scheduledAt','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','error','message','exit','errors','code','sequelize','query','spread','catch','campaigns.dialTimezone','campaigns'];(function(_0x5e9dac,_0x32cb8d){var _0x1720a3=function(_0xdd324c){while(--_0xdd324c){_0x5e9dac['push'](_0x5e9dac['shift']());}};_0x1720a3(++_0x32cb8d);}(_0xae01,0x104));var _0x1ae0=function(_0x396901,_0x121053){_0x396901=_0x396901-0x0;var _0x31b5a8=_0xae01[_0x396901];return _0x31b5a8;};'use strict';var fs=require('fs');var path=require(_0x1ae0('0x0'));var _=require(_0x1ae0('0x1'));var Papa=require(_0x1ae0('0x2'));var util=require(_0x1ae0('0x3'));var BPromise=require(_0x1ae0('0x4'));var moment=require(_0x1ae0('0x5'));var squel=require(_0x1ae0('0x6'));var Redis=require(_0x1ae0('0x7'));var db=require(_0x1ae0('0x8'))['db'];var config=require(_0x1ae0('0x9'));var shared=require(_0x1ae0('0xa'));var logger=require(_0x1ae0('0xb'))(_0x1ae0('0xc'));config[_0x1ae0('0xd')]=_[_0x1ae0('0xe')](config[_0x1ae0('0xd')],{'host':_0x1ae0('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x1ae0('0x10')]('YYYY-MM-DD\x20HH:mm:ss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x1ae0('0x10')](_0x1ae0('0x11'));function isEmail(_0x182655){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x182655);}function selectNotIn(_0xd49537,_0x13793c,_0x167c5c,_0x2e5a02,_0x7f2a84){return squel[_0x1ae0('0x12')]()[_0x1ae0('0x13')](_0x1ae0('0x14'))[_0x1ae0('0x15')](_0x2e5a02)['join'](_0x13793c,null,_0x13793c+'.id\x20=\x20'+_0x2e5a02+'.'+_0x167c5c)[_0x1ae0('0x16')](_0x2e5a02+'.'+_0x167c5c+_0x1ae0('0x17')+_0xd49537+'.'+_0x167c5c)[_0x1ae0('0x16')](_0x13793c+'.dialCheckDuplicateType\x20IN\x20('+_0x7f2a84[_0x1ae0('0x18')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x5ab2b6,_0x32b28d){promisesAdditionalPhones=[];return db[_0x1ae0('0x19')][_0x1ae0('0x1a')]({'raw':!![],'attributes':['id',_0x1ae0('0x1b')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x1ae0('0x1c')](function(_0x5d5063){if(_0x5d5063!==null){var _0x493b2a=[];for(var _0x54bb13=0x0;_0x54bb13<_0x5d5063['length'];_0x54bb13++){var _0x1552b1=_0x5d5063[_0x54bb13];_0x493b2a[_0x1ae0('0x1d')](insertAdditionalPhones(_0x1552b1));}}Promise[_0x1ae0('0x1e')](_0x493b2a)[_0x1ae0('0x1c')](function(){_0x5ab2b6({'val':0x1});});});});}function insertAdditionalPhones(_0x24598d){return new Promise(function(_0x3aaa7a,_0x186c7d){var _0x38e3f5=_0x24598d[_0x1ae0('0x1b')];var _0x11c7f4=_0x38e3f5[_0x1ae0('0x1f')](';');var _0x451a6c=[];orderBy=0x0;for(var _0x2485b3=0x0;_0x2485b3<_0x11c7f4['length'];_0x2485b3++){_0x451a6c[_0x1ae0('0x1d')](splitAdditionalPhone(_0x24598d['id'],_0x11c7f4[_0x2485b3]));}Promise[_0x1ae0('0x1e')](_0x451a6c)[_0x1ae0('0x1c')](function(){_0x3aaa7a({'val':_0x11c7f4[_0x1ae0('0x20')]});});});}function splitAdditionalPhone(_0x5dfebb,_0x2413d8){return new Promise(function(_0x50051d,_0x166342){var _0x5c4e06=_0x2413d8[_0x1ae0('0x1f')](':');var _0x37f358=_0x5c4e06[0x0];var _0xea03a5=_0x5c4e06[0x1];if(!_[_0x1ae0('0x21')](_0xea03a5)){var _0x2d816c=_0xea03a5[_0x1ae0('0x1f')]('|');var _0x4c12e7=[];for(var _0x3d3be4=0x0;_0x3d3be4<_0x2d816c[_0x1ae0('0x20')];_0x3d3be4++){if(_0x2d816c[_0x3d3be4]!==''){var _0x736ab=_['filter'](promisesAdditionalPhones,{'contactId':_0x5dfebb,'phone':_0x2d816c[_0x3d3be4]});if(_0x736ab['length']==0x0){orderBy++;promisesAdditionalPhones[_0x1ae0('0x1d')]({'contactId':_0x5dfebb,'contactTypeId':_0x37f358,'phone':_0x2d816c[_0x3d3be4],'orderBy':orderBy});}}}_0x50051d({'ok':0x1});}else _0x50051d({'res':0x0});});}function createAdditionalPhone(_0x588304,_0x43a1ae,_0x2ddfa3,_0x5ba7dd){var _0x44ee09='';var _0x376c5f='';var _0x364b26=_0x2ddfa3[_0x1ae0('0x1f')]('§');_0x44ee09=_0x364b26[0x0];if(_0x364b26['length']==0x2)_0x376c5f=_0x364b26[0x1];return new Promise(function(_0x4008c2,_0x41bf56){return db[_0x1ae0('0x22')][_0x1ae0('0x23')]({'where':{'CmContactId':_0x588304,'item':_0x44ee09}})[_0x1ae0('0x1c')](function(_0x12593c){if(_0x12593c){return db[_0x1ae0('0x22')][_0x1ae0('0x24')]({'ItemTypeId':_0x43a1ae,'description':_0x376c5f,'OrderBy':_0x5ba7dd},{'where':{'CmContactId':_0x588304,'item':_0x44ee09}})['then'](function(_0xfea209){_0x4008c2({'res':_0x1ae0('0x25')});});}else{return db['CmContactHasItem']['create']({'CmContactId':_0x588304,'item':_0x44ee09,'description':_0x376c5f,'ItemTypeId':_0x43a1ae,'OrderBy':_0x5ba7dd,'ItemClass':_0x1ae0('0x26')})[_0x1ae0('0x1c')](function(_0x1d7ffc){_0x4008c2({'res':_0x1ae0('0x27')});});}});});}function insertCmHopper(_0x1da585,_0x41b831,_0x5cddbe,_0x34cbef,_0x42567c){var _0x305c23=[_0x1ae0('0x28'),_0x1ae0('0x29'),'cm_contacts.id',_0x1ae0('0x2a'),_0x41b831+'.'+_0x34cbef,_0x1ae0('0x2b'),_0x1ae0('0x2c'),_0x1ae0('0x2d'),'cm_contacts.UserId','\x22'+_0x42567c+'\x22'];return squel[_0x1ae0('0x2e')]()['into'](_0x1ae0('0x2f'))[_0x1ae0('0x30')]([_0x1ae0('0x14'),_0x1ae0('0x31'),'ContactId',_0x1ae0('0x32'),_0x34cbef,_0x1ae0('0x33'),_0x1ae0('0x34'),_0x1ae0('0x35'),_0x1ae0('0x36'),_0x1ae0('0x37')],squel[_0x1ae0('0x12')]()[_0x1ae0('0x38')](_0x305c23)[_0x1ae0('0x15')](_0x41b831)[_0x1ae0('0x18')](_0x1ae0('0x39'),null,'cm_contacts.ListId\x20=\x20'+_0x41b831+'.CmListId')['join'](_0x5cddbe,null,_0x5cddbe+_0x1ae0('0x3a')+_0x41b831+'.'+_0x34cbef)['where'](_0x41b831+_0x1ae0('0x3b'),_0x1da585)[_0x1ae0('0x16')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x1ae0('0x16')](_0x1ae0('0x3c'),selectNotIn(_0x41b831,_0x5cddbe,_0x34cbef,_0x1ae0('0x2f'),[_0x1ae0('0x3d'),'\x22onlyIfOpen\x22']))['where'](_0x1ae0('0x3c'),selectNotIn(_0x41b831,_0x5cddbe,_0x34cbef,_0x1ae0('0x2f'),[_0x1ae0('0x3d')])))[_0x1ae0('0x3e')]();}function insertCmHopperBlack(_0xebe89a,_0x44a31c,_0x489dbe,_0x456ca2){var _0x33cbc2=['cm_contacts.phone',_0x1ae0('0x3f'),'cm_contacts.ListId',_0x44a31c+'.'+_0x456ca2,_0x1ae0('0x2b'),_0x1ae0('0x2c')];return squel[_0x1ae0('0x2e')]()[_0x1ae0('0x40')](_0x1ae0('0x41'))['fromQuery'](['phone',_0x1ae0('0x42'),'ListId',_0x456ca2,_0x1ae0('0x33'),'updatedAt'],squel[_0x1ae0('0x12')]()[_0x1ae0('0x38')](_0x33cbc2)[_0x1ae0('0x15')](_0x44a31c)[_0x1ae0('0x18')](_0x1ae0('0x39'),null,_0x1ae0('0x43')+_0x44a31c+_0x1ae0('0x44'))[_0x1ae0('0x18')](_0x489dbe,null,_0x489dbe+_0x1ae0('0x3a')+_0x44a31c+'.'+_0x456ca2)['where'](_0x44a31c+_0x1ae0('0x3b'),_0xebe89a)[_0x1ae0('0x16')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x1ae0('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x1ae0('0x13')]('phone')[_0x1ae0('0x15')](_0x1ae0('0x41'))[_0x1ae0('0x16')]('ListId\x20=\x20?',_0xebe89a)[_0x1ae0('0x16')](_0x456ca2+_0x1ae0('0x17')+_0x44a31c+'.'+_0x456ca2)))[_0x1ae0('0x3e')]();}function insertTzCmHopper(_0xf0eb53,_0x1554d3,_0x4c710a,_0x3c357f,_0x490d3f,_0x5e8e78){var _0x57898a=[_0x1ae0('0x28'),_0x1ae0('0x45')+_0x5e8e78+_0x1ae0('0x46'),_0x1ae0('0x3f'),_0x1ae0('0x2a'),_0x1554d3+'.'+_0x3c357f,_0x1ae0('0x2b'),'cm_contacts.updatedAt',_0x1ae0('0x2d'),_0x1ae0('0x47'),'\x22'+_0x490d3f+'\x22'];var _0x4b411d=squel[_0x1ae0('0x2e')]()[_0x1ae0('0x40')](_0x1ae0('0x2f'))[_0x1ae0('0x30')]([_0x1ae0('0x14'),'scheduledat',_0x1ae0('0x42'),'ListId',_0x3c357f,_0x1ae0('0x33'),_0x1ae0('0x34'),_0x1ae0('0x35'),_0x1ae0('0x36'),_0x1ae0('0x37')],squel[_0x1ae0('0x12')]()[_0x1ae0('0x38')](_0x57898a)[_0x1ae0('0x15')](_0x1554d3)['join'](_0x1ae0('0x39'),null,_0x1ae0('0x43')+_0x1554d3+'.CmListId')[_0x1ae0('0x18')](_0x4c710a,null,_0x4c710a+'.id\x20=\x20'+_0x1554d3+'.'+_0x3c357f)[_0x1ae0('0x18')](_0x5e8e78,null,_0x5e8e78+'.id\x20=\x20'+_0x1554d3+'.'+_0x3c357f)['where'](_0x1554d3+_0x1ae0('0x3b'),_0xf0eb53)['where'](_0x1ae0('0x48'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x1554d3,_0x4c710a,_0x3c357f,_0x1ae0('0x2f'),[_0x1ae0('0x3d'),_0x1ae0('0x49')]))[_0x1ae0('0x16')](_0x1ae0('0x3c'),selectNotIn(_0x1554d3,_0x4c710a,_0x3c357f,_0x1ae0('0x2f'),[_0x1ae0('0x3d')])))[_0x1ae0('0x3e')]();return _0x4b411d;}function insertTzCmHopperBlack(_0x5d2241,_0x2507ce,_0x36c823,_0x14c2ba){var _0x23de37=['cm_contacts.phone',_0x1ae0('0x3f'),_0x1ae0('0x2a'),_0x2507ce+'.'+_0x14c2ba,_0x1ae0('0x2b'),_0x1ae0('0x2c')];return squel[_0x1ae0('0x2e')]()[_0x1ae0('0x40')](_0x1ae0('0x41'))[_0x1ae0('0x30')]([_0x1ae0('0x14'),_0x1ae0('0x42'),_0x1ae0('0x32'),_0x14c2ba,_0x1ae0('0x33'),'updatedAt'],squel[_0x1ae0('0x12')]()[_0x1ae0('0x38')](_0x23de37)[_0x1ae0('0x15')](_0x2507ce)[_0x1ae0('0x18')](_0x1ae0('0x39'),null,'cm_contacts.ListId\x20=\x20'+_0x2507ce+_0x1ae0('0x44'))[_0x1ae0('0x18')](_0x36c823,null,_0x36c823+_0x1ae0('0x3a')+_0x2507ce+'.'+_0x14c2ba)[_0x1ae0('0x16')](_0x2507ce+'.CmListId\x20=\x20?',_0x5d2241)[_0x1ae0('0x16')](_0x1ae0('0x48'),NOW)[_0x1ae0('0x16')](_0x1ae0('0x3c'),squel['select']()[_0x1ae0('0x13')](_0x1ae0('0x14'))[_0x1ae0('0x15')](_0x1ae0('0x41'))[_0x1ae0('0x16')]('ListId\x20=\x20?',_0x5d2241)[_0x1ae0('0x16')](_0x14c2ba+_0x1ae0('0x17')+_0x2507ce+'.'+_0x14c2ba)))[_0x1ae0('0x3e')]();}function insertCmHopperAdditionalPhones(_0x188d88){var _0x18edaa=[_0x1ae0('0x4a'),_0x1ae0('0x4b'),_0x1ae0('0x4c'),_0x1ae0('0x4d'),_0x1ae0('0x4e')];return squel[_0x1ae0('0x2e')]()['into']('cm_hopper_additional_phones')[_0x1ae0('0x30')]([_0x1ae0('0x4f'),_0x1ae0('0x14'),_0x1ae0('0x50'),_0x1ae0('0x33'),_0x1ae0('0x34')],squel[_0x1ae0('0x12')]()['fields'](_0x18edaa)['from'](_0x1ae0('0x2f'))['join']('cm_contacts',null,_0x1ae0('0x51'))[_0x1ae0('0x18')]('cm_contact_has_items',null,_0x1ae0('0x52'))[_0x1ae0('0x16')](_0x1ae0('0x53'),_0x188d88)['where'](_0x1ae0('0x48'),NOW))[_0x1ae0('0x3e')]();}function insertCmContact(_0x2403d9,_0x59a137,_0x3fda2f,_0x1c705d){var _0x37ec9d=_[_0x1ae0('0x54')](_[_0x1ae0('0x55')](_0x1c705d),[_0x1ae0('0x32'),_0x1ae0('0x56'),_0x1ae0('0x33'),_0x1ae0('0x34'),_0x1ae0('0x57')]);return squel[_0x1ae0('0x2e')]()[_0x1ae0('0x40')](_0x1ae0('0x39'))[_0x1ae0('0x30')](_0x37ec9d,squel[_0x1ae0('0x12')]()[_0x1ae0('0x38')](_0x37ec9d)[_0x1ae0('0x15')](_0x59a137)[_0x1ae0('0x16')]('('+_0x3fda2f[_0x1ae0('0x18')](',')+')\x20NOT\x20IN\x20?',squel[_0x1ae0('0x12')]()['fields'](_0x3fda2f)['from'](_0x1ae0('0x39'))['where'](_0x1ae0('0x58'),_0x2403d9)[_0x1ae0('0x16')](_0x1ae0('0x59')))[_0x1ae0('0x16')](_0x1ae0('0x5a'),squel[_0x1ae0('0x12')]()[_0x1ae0('0x13')](_0x1ae0('0x5b'),_0x1ae0('0x5c'))[_0x1ae0('0x15')](_0x59a137)[_0x1ae0('0x5d')](_0x3fda2f[_0x1ae0('0x18')](','))))['toString']();}function handleStop(){logger[_0x1ae0('0x5e')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x1d3fd1){logger[_0x1ae0('0x5f')](_0x1d3fd1[_0x1ae0('0x60')]);process[_0x1ae0('0x61')](0x1);}function handleError(_0x2405d1,_0x17c24d){stats[_0x1ae0('0x62')][_0x1ae0('0x1d')]({'name':_0x17c24d[_0x1ae0('0x63')],'message':_0x17c24d[_0x1ae0('0x60')],'row':_0x2405d1});}function handleQuery(_0x51e4e8){logger[_0x1ae0('0x5e')](_0x51e4e8);return db[_0x1ae0('0x64')][_0x1ae0('0x65')](_0x51e4e8)[_0x1ae0('0x66')](function(_0x312bd7){results[_0x1ae0('0x1d')](_0x312bd7);})[_0x1ae0('0x67')](function(_0x21f789){logger[_0x1ae0('0x5f')](_0x21f789['message']);});}function updateTzCampaigns(_0xf2b278){return new Promise(function(_0x51071b,_0x2e487d){var _0x4820e8=squel['select']()[_0x1ae0('0x38')](['campaigns.id',_0x1ae0('0x68')])['from'](_0x1ae0('0x69'))[_0x1ae0('0x18')](_0x1ae0('0x6a'),null,_0x1ae0('0x6b'))['where'](_0x1ae0('0x6c')+_0xf2b278);db[_0x1ae0('0x64')][_0x1ae0('0x65')](_0x4820e8['toString']())[_0x1ae0('0x66')](function(_0x3e36c1){var _0x555b38=[];for(var _0x5f7740=0x0;_0x5f7740<_0x3e36c1[_0x1ae0('0x20')];_0x5f7740++){_0x555b38['push'](getTimezoneData(_0x3e36c1[_0x5f7740],tmp_campaigns));}BPromise[_0x1ae0('0x1e')](_0x555b38)[_0x1ae0('0x1c')](function(){_0x51071b({'val':0x1});});})['catch'](function(_0x45b501){logger['error'](_0x45b501['message']);_0x51071b({'val':0x0});});});}function updateTzVoiceQueues(_0x3aebd1){return new Promise(function(_0x4f1ff8,_0x3afa5a){var _0x4bc62a=squel[_0x1ae0('0x12')]()[_0x1ae0('0x38')]([_0x1ae0('0x6d'),'voice_queues.dialTimezone'])['from'](_0x1ae0('0x6e'))[_0x1ae0('0x18')](_0x1ae0('0x6f'),null,_0x1ae0('0x70'))[_0x1ae0('0x16')]('voice_queues_has_cm_lists.CmListId='+_0x3aebd1);db['sequelize'][_0x1ae0('0x65')](_0x4bc62a[_0x1ae0('0x3e')]())[_0x1ae0('0x66')](function(_0x32ba0c){var _0x146254=[];for(var _0x18ee1d=0x0;_0x18ee1d<_0x32ba0c[_0x1ae0('0x20')];_0x18ee1d++){_0x146254[_0x1ae0('0x1d')](getTimezoneData(_0x32ba0c[_0x18ee1d],tmp_voice_queues));}BPromise[_0x1ae0('0x1e')](_0x146254)['then'](function(){_0x4f1ff8({'val':0x1});});})[_0x1ae0('0x67')](function(_0x378c1b){logger[_0x1ae0('0x5f')](_0x378c1b[_0x1ae0('0x60')]);_0x4f1ff8({'val':0x0});});});}function getTimezoneData(_0xa3badf,_0x675110){return new Promise(function(_0x3fad04,_0x27d770){var _0x49cd70=shared[_0x1ae0('0x71')];var _0x3e8f89=_0x49cd70[_0xa3badf[_0x1ae0('0x72')]];if(_[_0x1ae0('0x21')](_0x3e8f89)){_0x3fad04({'ret':0x1});}else{var _0x100a55=_0x3e8f89[_0x1ae0('0x73')];var _0x1a4379=squel['insert']()[_0x1ae0('0x40')](_0x675110)[_0x1ae0('0x74')]('id',_0xa3badf['id'])[_0x1ae0('0x74')](_0x1ae0('0x75'),_0x100a55)['set'](_0x1ae0('0x72'),_0xa3badf[_0x1ae0('0x72')])[_0x1ae0('0x3e')]();return db[_0x1ae0('0x64')][_0x1ae0('0x65')](_0x1a4379)[_0x1ae0('0x66')](function(_0x140678){_0x3fad04({'ret':0x1});})[_0x1ae0('0x67')](function(_0x164256){logger[_0x1ae0('0x5f')](_0x164256[_0x1ae0('0x60')]);_0x27d770({'ret':0x1});});}});}function handleTZQuery(_0x3d5515){logger['info'](_0x3d5515);return db[_0x1ae0('0x64')][_0x1ae0('0x65')](_0x3d5515)[_0x1ae0('0x66')](function(_0x337995){})[_0x1ae0('0x67')](function(_0x115a83){logger[_0x1ae0('0x5f')](_0x115a83[_0x1ae0('0x60')]);});}function main(_0x37e233,_0x4cbec8,_0x1b8111,_0x49bbb3){logger[_0x1ae0('0x5e')](_0x1ae0('0x76'),_0x37e233,JSON[_0x1ae0('0x77')](_0x4cbec8));process[_0x1ae0('0x78')](_0x1ae0('0x79'));var _0x4777d1=_0x4cbec8[_0x1ae0('0x7a')];var _0x315ecb=_[_0x1ae0('0x7b')](_0x4777d1);var _0x215515=_0x4cbec8[_0x1ae0('0x7c')];var _0x324c00=path['join'](config[_0x1ae0('0x7d')],'server/files/tmp',_0x215515+'.csv');hasTZ=_[_0x1ae0('0x55')](_0x4777d1)[_0x1ae0('0x7e')](_0x1ae0('0x72'));var _0x44f392=_[_0x1ae0('0x55')](_0x4777d1)[_0x1ae0('0x18')]();logger[_0x1ae0('0x5e')]('header',_0x44f392);db[_0x1ae0('0x7f')][_0x1ae0('0x1a')]({'raw':!![],'attributes':['id','name']})['then'](function(_0x4fa9b7){for(var _0x61a486=0x0;_0x61a486<_0x4fa9b7[_0x1ae0('0x20')];_0x61a486++){if(_0x4fa9b7[_0x61a486][_0x1ae0('0x80')]in _0x4777d1){contactItemTypes[_0x1ae0('0x1d')](_0x4fa9b7[_0x61a486]);delete _0x315ecb[_0x4fa9b7[_0x61a486]['name']];hasAdditionalPhones=!![];}for(var _0x28cb94 in _0x4777d1){if(_0x4fa9b7[_0x61a486][_0x1ae0('0x80')]+_0x1ae0('0x81')===_0x28cb94){phoneDescriptions[_0x1ae0('0x1d')]({'itemTypeId':_0x4fa9b7[_0x61a486]['id'],'description':_0x28cb94});delete _0x315ecb[_0x28cb94];}}}if(hasAdditionalPhones)_0x315ecb[_0x1ae0('0x1b')]='';var _0x1040ff=_[_0x1ae0('0x55')](_0x315ecb)[_0x1ae0('0x18')]();logger['info'](_0x1ae0('0x82'),_0x1040ff);fs[_0x1ae0('0x83')](_0x324c00,_0x1040ff+'\x0a');Papa[_0x1ae0('0x84')](fs[_0x1ae0('0x85')](_0x37e233),{'header':!![],'skipEmptyLines':!![],'step':function(_0x12b013,_0x2e8c72){try{for(var _0x40334c=0x0,_0x428f2d=[];_0x40334c<_0x12b013['data'][_0x1ae0('0x20')];_0x40334c++){stats[_0x1ae0('0x86')]+=0x1;if(_0x12b013['errors'][_0x40334c]){handleError(_0x12b013[_0x1ae0('0x87')][_0x40334c],_0x12b013[_0x1ae0('0x62')][_0x40334c]);}else{var _0x792d87=[];var _0x2ef424=[];var _0x1a4ab4={};for(var _0x13dea0 in _0x4777d1){let _0x2e2fd3=contactItemTypes['find'](_0x497686=>_0x497686[_0x1ae0('0x80')]===_0x13dea0);let _0xb24551=contactItemTypes['find'](_0x2d514e=>_0x2d514e[_0x1ae0('0x80')]+_0x1ae0('0x81')===_0x13dea0);if(_[_0x1ae0('0x21')](_0x2e2fd3)&&_[_0x1ae0('0x21')](_0xb24551)){if(_0x4777d1[_0x1ae0('0x88')](_0x13dea0)){if(_0x12b013[_0x1ae0('0x87')][_0x40334c][_0x4777d1[_0x13dea0]]){var _0x5a40c9=_[_0x1ae0('0x89')](_0x12b013[_0x1ae0('0x87')][_0x40334c][_0x4777d1[_0x13dea0]][_0x1ae0('0x8a')](/"/g,'\x27'));switch(_0x13dea0){case _0x1ae0('0x31'):var _0x4b70dd=moment(_0x5a40c9,_0x1ae0('0x11'),!![]);if(_0x4b70dd['isValid']()){_0x428f2d[_0x1ae0('0x1d')]('\x22'+_0x5a40c9+'\x22');}else{_0x792d87['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x1ae0('0x35'):var _0x226240=parseInt(_0x5a40c9);_0x5a40c9=_['isNaN'](_0x226240)||_0x226240<0x0||_0x226240>0x4?_0x49bbb3?0x3:0x2:_0x226240;_0x428f2d[_0x1ae0('0x1d')]('\x22'+_0x5a40c9+'\x22');break;case _0x1ae0('0x36'):var _0x8a1edf=parseInt(_0x5a40c9);if(_['isNumber'](_0x8a1edf)&&_['includes'](_0x1b8111,_0x8a1edf)){_0x428f2d['push']('\x22'+_0x8a1edf+'\x22');}else{_0x792d87[_0x1ae0('0x1d')](_0x1ae0('0x8b'));}break;case _0x1ae0('0x8c'):if(isEmail(_0x5a40c9)){_0x428f2d['push']('\x22'+_0x5a40c9+'\x22');}else{_0x792d87['push']('email\x20wrong\x20format');}break;case _0x1ae0('0x8d'):var _0x2ab522=moment(_0x5a40c9,_0x1ae0('0x8e'),!![]);if(_0x2ab522[_0x1ae0('0x8f')]()){_0x428f2d[_0x1ae0('0x1d')]('\x22'+_0x5a40c9+'\x22');}else{_0x792d87[_0x1ae0('0x1d')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case _0x1ae0('0x72'):var _0x47cd96=shared[_0x1ae0('0x71')];var _0x44a09d=_0x47cd96[_0x5a40c9];if(!_['isNil'](_0x44a09d)){var _0x319e99=_0x44a09d[_0x1ae0('0x73')];_0x428f2d[_0x1ae0('0x1d')]('\x22'+_0x5a40c9+'\x22');_0x428f2d['push']('\x22'+_0x319e99+'\x22');}break;default:_0x428f2d['push']('\x22'+_0x5a40c9+'\x22');}}else{switch(_0x13dea0){case'firstName':case _0x1ae0('0x14'):_0x792d87[_0x1ae0('0x1d')](_0x13dea0+'\x20not\x20specified');break;default:_0x428f2d[_0x1ae0('0x1d')]('\x22\x22');}}}}else{var _0x385676='';if(!_['isNil'](_0x2e2fd3)){if(!_0x1a4ab4['hasOwnProperty'](_0x2e2fd3['id'])){if(!_[_0x1ae0('0x21')](_0x12b013[_0x1ae0('0x87')][_0x40334c][_0x4777d1[_0x13dea0]])){var _0x5a40c9=_['trim'](_0x12b013['data'][_0x40334c][_0x4777d1[_0x13dea0]][_0x1ae0('0x8a')](/"/g,'\x27'));var _0x46029d=phoneDescriptions[_0x1ae0('0x90')](_0x13cb96=>_0x13cb96[_0x1ae0('0x91')]===_0x2e2fd3['id']);if(!_[_0x1ae0('0x21')](_0x46029d)){var _0x53e27d=_['trim'](_0x12b013[_0x1ae0('0x87')][_0x40334c][_0x4777d1[_0x46029d['description']]]['replace'](/"/g,'\x27'));if(!_[_0x1ae0('0x21')](_0x53e27d))_0x5a40c9=_0x5a40c9+'§'+_0x53e27d;}if(_0x385676=='')_0x385676=_0x5a40c9;else _0x385676+='|'+_0x5a40c9;}_0x2ef424[_0x1ae0('0x1d')](_0x2e2fd3['id']+':'+_0x385676);_0x1a4ab4[_0x2e2fd3['id']]=0x1;}}}}if(hasAdditionalPhones){_0x428f2d[_0x1ae0('0x1d')]('\x22'+_0x2ef424[_0x1ae0('0x18')](';')+'\x22');}if(_0x792d87[_0x1ae0('0x20')]){handleError(_0x12b013[_0x1ae0('0x87')][_0x40334c],{'code':_0x1ae0('0x92'),'message':_0x792d87[_0x1ae0('0x18')]()});}else{fs[_0x1ae0('0x93')](_0x324c00,_0x428f2d[_0x1ae0('0x18')]()+'\x0a');}_0x428f2d=[];}if(!(stats['rows']%0xc8)){socket[_0x1ae0('0x94')](_0x1ae0('0x95')+_0x215515,stats);stats[_0x1ae0('0x62')]=[];}}if(stopped){logger[_0x1ae0('0x5e')](_0x1ae0('0x96'));_0x2e8c72[_0x1ae0('0x97')]();}}catch(_0x31c5ef){handleError(_0x12b013[_0x1ae0('0x87')][_0x40334c],{'code':_0x1ae0('0x98'),'message':_0x31c5ef[_0x1ae0('0x60')]});logger[_0x1ae0('0x5f')]('step',_0x31c5ef[_0x1ae0('0x60')]);}},'complete':function(){try{var _0x32130d=[];var _0x118fe3=[];var _0x258cf6=_0x1ae0('0x39');if(_0x4cbec8[_0x1ae0('0x99')]&&_0x4cbec8[_0x1ae0('0x99')]['length']){_0x258cf6=_0x1ae0('0x9a')+_0x215515;_0x32130d[_0x1ae0('0x1d')](_0x1ae0('0x9b')+_0x258cf6+_0x1ae0('0x9c'));}tmp_campaigns=_0x1ae0('0x9d')+_0x215515;tmp_voice_queues=_0x1ae0('0x9e')+_0x215515;_0x118fe3[_0x1ae0('0x1d')](_0x1ae0('0x9b')+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x118fe3[_0x1ae0('0x1d')]('CREATE\x20TABLE\x20'+tmp_voice_queues+_0x1ae0('0x9f'));BPromise['each'](_0x118fe3,handleTZQuery)['then'](function(_0x31ba41){updateTzCampaigns(_0x4cbec8[_0x1ae0('0x32')])[_0x1ae0('0x1c')](function(_0x48e8d4){updateTzVoiceQueues(_0x4cbec8[_0x1ae0('0x32')])['then'](function(_0x3cf98a){if(hasTZ)_0x1040ff=_0x1040ff[_0x1ae0('0x8a')](_0x1ae0('0x72'),_0x1ae0('0xa0'));var _0x406f19=util[_0x1ae0('0x10')](_0x1ae0('0xa1'),_0x324c00,_0x258cf6,_0x1040ff,_0x4cbec8[_0x1ae0('0x32')],_0x4cbec8[_0x1ae0('0x56')]||null,NOW,NOW);if(_[_0x1ae0('0x21')](_0x4777d1[_0x1ae0('0x31')])){_0x406f19+=_0x1ae0('0xa2');}_0x32130d[_0x1ae0('0x1d')](_0x406f19);if(_0x4cbec8[_0x1ae0('0x99')]&&_0x4cbec8[_0x1ae0('0x99')][_0x1ae0('0x20')]){_0x32130d[_0x1ae0('0x1d')](insertCmContact(_0x4cbec8['ListId'],_0x258cf6,_0x4cbec8[_0x1ae0('0x99')],_0x4777d1));_0x32130d[_0x1ae0('0x1d')](_0x1ae0('0xa3')+_0x258cf6+';');}BPromise['each'](_0x32130d,handleQuery)[_0x1ae0('0x1c')](function(_0x558ded){BPromise[_0x1ae0('0x1e')]([handleAdditionalPhones()])[_0x1ae0('0x1c')](function(){_0x32130d=[];for(var _0x1687dc=0x0;_0x1687dc\x20\x20','existsSync','file\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','uncaughtException','path','papaparse','util','bluebird','ioredis','../../../config/logger','redis','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','format','YYYYMMDDHHmmss','field','phone','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','select\x20*\x20from\x20','spread','isNil','push','all','then','error','message','AdditionalPhones','length','split','findOne','CmContactHasItem','update','create','PHONE','inserted','CmContact','CmHopper','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.UserId','insert','cm_hopper','scheduledat','ContactId','createdAt','updatedAt','priority','UserId','recallme','fields','from','cm_contacts','.CmListId','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_contacts.createdAt','into','cm_hopper_black','fromQuery','ListId','select','cm_contacts.ListId\x20=\x20','cm_contacts.createdAt\x20=\x20?','ListId\x20=\x20?','\x20=\x20?','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_hopper.ListId\x20=\x20?','keys','CompanyId','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','errors','catch','main','send','start','binding','clone','socket_timestamp','root','server/files/tmp','.csv','ContactItemType','findAll','name','header','writeFileSync','parse','createReadStream','data','rows','find','_description','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','email\x20wrong\x20format','YYYY-MM-DD','itemTypeId','SystemRow','appendFileSync','contact:import:','Abort\x20parser'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf6ed,0x1ce));var _0xdf6e=function(_0x237635,_0x6a43af){_0x237635=_0x237635-0x0;var _0x2058d6=_0xf6ed[_0x237635];return _0x2058d6;};'use strict';var fs=require('fs');var path=require(_0xdf6e('0x0'));var _=require('lodash');var Papa=require(_0xdf6e('0x1'));var util=require(_0xdf6e('0x2'));var BPromise=require(_0xdf6e('0x3'));var moment=require('moment');var squel=require('squel');var Redis=require(_0xdf6e('0x4'));var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var logger=require(_0xdf6e('0x5'))('import');config[_0xdf6e('0x6')]=_['defaults'](config[_0xdf6e('0x6')],{'host':_0xdf6e('0x7'),'port':0x18eb});var socket=require(_0xdf6e('0x8'))(new Redis(config[_0xdf6e('0x6')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()['format'](_0xdf6e('0x9'));var tempTableName=_0xdf6e('0xa')+moment()[_0xdf6e('0xb')](_0xdf6e('0xc'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x3a8881){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x3a8881);}function selectNotIn(_0x92cde3,_0x5ad59b,_0x3e3b47,_0x4bca60,_0x336554){return squel['select']()[_0xdf6e('0xd')](_0xdf6e('0xe'))['from'](_0x4bca60)[_0xdf6e('0xf')](_0x5ad59b,null,_0x5ad59b+_0xdf6e('0x10')+_0x4bca60+'.'+_0x3e3b47)[_0xdf6e('0x11')](_0x4bca60+'.'+_0x3e3b47+_0xdf6e('0x12')+_0x92cde3+'.'+_0x3e3b47)[_0xdf6e('0x11')](_0x5ad59b+_0xdf6e('0x13')+_0x336554['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x41ad53,_0x5c6805){promisesAdditionalPhones=[];promisesContact=[];return db[_0xdf6e('0x14')][_0xdf6e('0x15')](_0xdf6e('0x16')+tempTableName)[_0xdf6e('0x17')](function(_0x2eb619){if(_0x2eb619!==null){var _0xa41255=[];for(var _0x3eb3d3=0x0;_0x3eb3d3<_0x2eb619['length'];_0x3eb3d3++){var _0x8c6c36=_0x2eb619[_0x3eb3d3];if(!_['isNil'](_0x8c6c36[_0xdf6e('0xe')])){if(!_[_0xdf6e('0x18')](_0x8c6c36['AdditionalPhones']))_0xa41255['push'](insertAdditionalPhones(_0x8c6c36));promisesContact[_0xdf6e('0x19')]({'contact':_0x8c6c36});}}}Promise[_0xdf6e('0x1a')](_0xa41255)[_0xdf6e('0x1b')](function(){_0x41ad53({'val':0x1});});})['catch'](function(_0x2b5ec6){logger[_0xdf6e('0x1c')](_0x2b5ec6[_0xdf6e('0x1d')]);});});}function insertAdditionalPhones(_0x27e7e5){return new Promise(function(_0x198f92,_0x359100){var _0x530290=_0x27e7e5[_0xdf6e('0x1e')];if(_[_0xdf6e('0x18')](_0x530290))_0x359100({'val':0x0});else{var _0x28957d=_0x530290['split'](';');var _0x3e985c=[];orderBy=0x0;for(var _0x5edc14=0x0;_0x5edc14<_0x28957d[_0xdf6e('0x1f')];_0x5edc14++){_0x3e985c[_0xdf6e('0x19')](splitAdditionalPhone(_0x27e7e5['id'],_0x28957d[_0x5edc14]));}Promise['all'](_0x3e985c)[_0xdf6e('0x1b')](function(){_0x198f92({'val':_0x28957d[_0xdf6e('0x1f')]});});}});}function splitAdditionalPhone(_0x45f053,_0x44caed){return new Promise(function(_0x4da9cc,_0x4fe58f){var _0x71f2a0=_0x44caed['split'](':');var _0x11d19a=_0x71f2a0[0x0];var _0xf10cda=_0x71f2a0[0x1];if(_0xf10cda!==''){var _0x70ef58=_0xf10cda[_0xdf6e('0x20')]('|');var _0x5d4897=[];for(var _0x331f27=0x0;_0x331f27<_0x70ef58[_0xdf6e('0x1f')];_0x331f27++){if(_0x70ef58[_0x331f27]!==''){var _0x9cdeba=_['filter'](promisesAdditionalPhones,{'contactId':_0x45f053,'phone':_0x70ef58[_0x331f27]});if(_0x9cdeba[_0xdf6e('0x1f')]==0x0){orderBy++;promisesAdditionalPhones[_0xdf6e('0x19')]({'contactId':_0x45f053,'contactTypeId':_0x11d19a,'phone':_0x70ef58[_0x331f27],'orderBy':orderBy});}}}_0x4da9cc({'ok':0x1});}else _0x4da9cc({'res':0x0});});}function createAdditionalPhone(_0x2d198d,_0x43816c,_0x5c75f3,_0x1ef42a){var _0x2ed48e='';var _0x533a8c='';var _0x6b4289=_0x5c75f3['split']('§');_0x2ed48e=_0x6b4289[0x0];if(_0x6b4289[_0xdf6e('0x1f')]==0x2)_0x533a8c=_0x6b4289[0x1];return new Promise(function(_0x5e02ec,_0x4478ca){return db['CmContactHasItem'][_0xdf6e('0x21')]({'where':{'CmContactId':_0x2d198d,'item':_0x2ed48e}})[_0xdf6e('0x1b')](function(_0x570547){if(_0x570547){return db[_0xdf6e('0x22')][_0xdf6e('0x23')]({'ItemTypeId':_0x43816c,'description':_0x533a8c,'OrderBy':_0x1ef42a},{'where':{'CmContactId':_0x2d198d,'item':_0x2ed48e}})[_0xdf6e('0x1b')](function(_0x227ab){_0x5e02ec({'res':'updated'});});}else{return db[_0xdf6e('0x22')][_0xdf6e('0x24')]({'CmContactId':_0x2d198d,'item':_0x2ed48e,'ItemTypeId':_0x43816c,'description':_0x533a8c,'OrderBy':_0x1ef42a,'ItemClass':_0xdf6e('0x25')})[_0xdf6e('0x1b')](function(_0x2a3fff){_0x5e02ec({'res':_0xdf6e('0x26')});});}});});}function updateContact(_0x23c21c){return new Promise(function(_0x234954,_0x546d17){var _0x4b4575=_0x23c21c['id'];delete _0x23c21c['id'];return db[_0xdf6e('0x27')][_0xdf6e('0x23')](_0x23c21c,{'where':{'id':_0x4b4575}})['then'](function(_0x5c9659){updatedRows+=0x1;return db[_0xdf6e('0x28')][_0xdf6e('0x23')]({'phone':_0x23c21c[_0xdf6e('0xe')]},{'where':{'ContactId':_0x4b4575}})[_0xdf6e('0x1b')](function(_0x27b1f9){_0x234954({'ret':'OK'});});});});}function insertCmHopper(_0x4fa3f7,_0x107ebe,_0x3304d1,_0x1b86aa,_0x51b7f0){var _0x5466b0=[_0xdf6e('0x29'),'cm_contacts.scheduledat',_0xdf6e('0x2a'),_0xdf6e('0x2b'),_0x107ebe+'.'+_0x1b86aa,'cm_contacts.createdAt',_0xdf6e('0x2c'),'cm_contacts.priority',_0xdf6e('0x2d'),'\x22'+_0x51b7f0+'\x22'];return squel[_0xdf6e('0x2e')]()['into'](_0xdf6e('0x2f'))['fromQuery']([_0xdf6e('0xe'),_0xdf6e('0x30'),_0xdf6e('0x31'),'ListId',_0x1b86aa,_0xdf6e('0x32'),_0xdf6e('0x33'),_0xdf6e('0x34'),_0xdf6e('0x35'),_0xdf6e('0x36')],squel['select']()[_0xdf6e('0x37')](_0x5466b0)[_0xdf6e('0x38')](_0x107ebe)[_0xdf6e('0xf')](_0xdf6e('0x39'),null,'cm_contacts.ListId\x20=\x20'+_0x107ebe+_0xdf6e('0x3a'))[_0xdf6e('0xf')](_0x3304d1,null,_0x3304d1+_0xdf6e('0x10')+_0x107ebe+'.'+_0x1b86aa)[_0xdf6e('0x11')](_0x107ebe+_0xdf6e('0x3b'),_0x4fa3f7)[_0xdf6e('0x11')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xdf6e('0x11')](_0xdf6e('0x3c'),selectNotIn(_0x107ebe,_0x3304d1,_0x1b86aa,_0xdf6e('0x2f'),[_0xdf6e('0x3d'),'\x22onlyIfOpen\x22']))[_0xdf6e('0x11')](_0xdf6e('0x3c'),selectNotIn(_0x107ebe,_0x3304d1,_0x1b86aa,'cm_hopper',[_0xdf6e('0x3d')])))[_0xdf6e('0x3e')]();}function insertCmHopperBlack(_0x35f7da,_0x3148e0,_0x3f1e5f,_0x3878fc){var _0x2e033d=[_0xdf6e('0x29'),_0xdf6e('0x2a'),'cm_contacts.ListId',_0x3148e0+'.'+_0x3878fc,_0xdf6e('0x3f'),_0xdf6e('0x2c')];return squel[_0xdf6e('0x2e')]()[_0xdf6e('0x40')](_0xdf6e('0x41'))[_0xdf6e('0x42')]([_0xdf6e('0xe'),'ContactId',_0xdf6e('0x43'),_0x3878fc,'createdAt',_0xdf6e('0x33')],squel[_0xdf6e('0x44')]()[_0xdf6e('0x37')](_0x2e033d)[_0xdf6e('0x38')](_0x3148e0)['join'](_0xdf6e('0x39'),null,_0xdf6e('0x45')+_0x3148e0+_0xdf6e('0x3a'))['join'](_0x3f1e5f,null,_0x3f1e5f+_0xdf6e('0x10')+_0x3148e0+'.'+_0x3878fc)[_0xdf6e('0x11')](_0x3148e0+_0xdf6e('0x3b'),_0x35f7da)[_0xdf6e('0x11')](_0xdf6e('0x46'),NOW)[_0xdf6e('0x11')](_0xdf6e('0x3c'),squel[_0xdf6e('0x44')]()[_0xdf6e('0xd')]('phone')[_0xdf6e('0x38')]('cm_hopper_black')[_0xdf6e('0x11')](_0xdf6e('0x47'),_0x35f7da)[_0xdf6e('0x11')](_0x3878fc+_0xdf6e('0x48'),_0x3148e0+'.'+_0x3878fc)))[_0xdf6e('0x3e')]();}function insertCmHopperAdditionalPhones(_0x5ef843){var _0x47e822=['cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy',_0xdf6e('0x49'),_0xdf6e('0x4a')];return squel['insert']()[_0xdf6e('0x40')](_0xdf6e('0x4b'))[_0xdf6e('0x42')]([_0xdf6e('0x4c'),_0xdf6e('0xe'),_0xdf6e('0x4d'),'createdAt',_0xdf6e('0x33')],squel[_0xdf6e('0x44')]()['fields'](_0x47e822)[_0xdf6e('0x38')]('cm_hopper')[_0xdf6e('0xf')](_0xdf6e('0x39'),null,_0xdf6e('0x4e'))[_0xdf6e('0xf')](_0xdf6e('0x4f'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0xdf6e('0x11')](_0xdf6e('0x50'),_0x5ef843)[_0xdf6e('0x11')](_0xdf6e('0x46'),NOW))[_0xdf6e('0x3e')]();}function insertCmContact(_0x1275b6,_0xab99d8,_0x8cb048,_0x48f0a6){var _0x2da2df=_['concat'](_[_0xdf6e('0x51')](_0x48f0a6),[_0xdf6e('0x43'),_0xdf6e('0x52'),_0xdf6e('0x32'),_0xdf6e('0x33')]);return squel['insert']()[_0xdf6e('0x40')](_0xdf6e('0x39'))['fromQuery'](_0x2da2df,squel[_0xdf6e('0x44')]()[_0xdf6e('0x37')](_0x2da2df)['from'](_0xab99d8)[_0xdf6e('0x11')]('('+_0x8cb048[_0xdf6e('0xf')](',')+')\x20NOT\x20IN\x20?',squel[_0xdf6e('0x44')]()['fields'](_0x8cb048)[_0xdf6e('0x38')]('cm_contacts')['where'](_0xdf6e('0x47'),_0x1275b6))['where'](_0xdf6e('0x53'),squel[_0xdf6e('0x44')]()[_0xdf6e('0xd')](_0xdf6e('0x54'),_0xdf6e('0x55'))[_0xdf6e('0x38')](_0xab99d8)[_0xdf6e('0x56')](_0x8cb048['join'](','))))['toString']();}function handleStop(){logger[_0xdf6e('0x57')](_0xdf6e('0x58'));stopped=!![];}function handleUncaughtException(_0x111539){logger[_0xdf6e('0x1c')](_0x111539['message']);process['exit'](0x1);}function handleError(_0x279439,_0x256382){stats[_0xdf6e('0x59')][_0xdf6e('0x19')]({'name':_0x256382['code'],'message':_0x256382[_0xdf6e('0x1d')],'row':_0x279439});}function handleQuery(_0x468a08){logger[_0xdf6e('0x57')](_0x468a08);return db['sequelize']['query'](_0x468a08)[_0xdf6e('0x17')](function(_0x2dffc1){results[_0xdf6e('0x19')](_0x2dffc1);})[_0xdf6e('0x5a')](function(_0x22b8f9){logger['error'](_0x22b8f9[_0xdf6e('0x1d')]);});}function main(_0x537b7a,_0x5907b1,_0x21571b,_0x3ecd23){logger[_0xdf6e('0x57')](_0xdf6e('0x5b'),_0x537b7a,JSON['stringify'](_0x5907b1));process[_0xdf6e('0x5c')](_0xdf6e('0x5d'));var _0x12e3fa=_0x5907b1[_0xdf6e('0x5e')];var _0x160a9f=_[_0xdf6e('0x5f')](_0x12e3fa);var _0x5a9284=_0x5907b1[_0xdf6e('0x60')];var _0x49990d=path[_0xdf6e('0xf')](config[_0xdf6e('0x61')],_0xdf6e('0x62'),_0x5a9284+_0xdf6e('0x63'));logger['info']('body',_0x5907b1);db[_0xdf6e('0x64')][_0xdf6e('0x65')]({'raw':!![],'attributes':['id',_0xdf6e('0x66')]})['then'](function(_0x17cc91){for(var _0x18ac18=0x0;_0x18ac18<_0x17cc91[_0xdf6e('0x1f')];_0x18ac18++){if(_0x17cc91[_0x18ac18]['name']in _0x12e3fa){contactItemTypes['push'](_0x17cc91[_0x18ac18]);delete _0x160a9f[_0x17cc91[_0x18ac18][_0xdf6e('0x66')]];hasAdditionalPhones=!![];}for(var _0x2cfec5 in _0x12e3fa){if(_0x17cc91[_0x18ac18][_0xdf6e('0x66')]+'_description'===_0x2cfec5){phoneDescriptions[_0xdf6e('0x19')]({'itemTypeId':_0x17cc91[_0x18ac18]['id'],'description':_0x2cfec5});delete _0x160a9f[_0x2cfec5];}}}if(hasAdditionalPhones)_0x160a9f[_0xdf6e('0x1e')]='';var _0x3887eb=_[_0xdf6e('0x51')](_0x160a9f)[_0xdf6e('0xf')]();logger[_0xdf6e('0x57')](_0xdf6e('0x67'),_0x3887eb);fs[_0xdf6e('0x68')](_0x49990d,_0x3887eb+'\x0a');Papa[_0xdf6e('0x69')](fs[_0xdf6e('0x6a')](_0x537b7a),{'header':!![],'skipEmptyLines':!![],'step':function(_0x443ff5,_0x47b5f1){try{for(var _0x55243d=0x0,_0x430a97=[];_0x55243d<_0x443ff5[_0xdf6e('0x6b')][_0xdf6e('0x1f')];_0x55243d++){stats[_0xdf6e('0x6c')]+=0x1;if(_0x443ff5[_0xdf6e('0x59')][_0x55243d]){handleError(_0x443ff5[_0xdf6e('0x6b')][_0x55243d],_0x443ff5[_0xdf6e('0x59')][_0x55243d]);}else{var _0x7f5aa=[];var _0x505671=[];var _0x1bbf73={};for(var _0x2c75e5 in _0x12e3fa){let _0x1581cf=contactItemTypes[_0xdf6e('0x6d')](_0x37c1e1=>_0x37c1e1[_0xdf6e('0x66')]===_0x2c75e5);let _0x2678bc=contactItemTypes[_0xdf6e('0x6d')](_0x3324ed=>_0x3324ed[_0xdf6e('0x66')]+_0xdf6e('0x6e')===_0x2c75e5);if(_[_0xdf6e('0x18')](_0x1581cf)&&_['isNil'](_0x2678bc)){if(_0x12e3fa[_0xdf6e('0x6f')](_0x2c75e5)){if(_0x443ff5['data'][_0x55243d][_0x12e3fa[_0x2c75e5]]){var _0x1459e5=_[_0xdf6e('0x70')](_0x443ff5[_0xdf6e('0x6b')][_0x55243d][_0x12e3fa[_0x2c75e5]][_0xdf6e('0x71')](/"/g,'\x27'));switch(_0x2c75e5){case _0xdf6e('0x30'):var _0x49b041=moment(_0x1459e5,_0xdf6e('0x9'),!![]);if(_0x49b041[_0xdf6e('0x72')]()){_0x430a97['push']('\x22'+_0x1459e5+'\x22');}else{_0x7f5aa[_0xdf6e('0x19')](_0xdf6e('0x73'));}break;case _0xdf6e('0x34'):var _0x4f6c17=parseInt(_0x1459e5);_0x1459e5=_[_0xdf6e('0x74')](_0x4f6c17)||_0x4f6c17<0x0||_0x4f6c17>0x4?_0x3ecd23?0x3:0x2:_0x4f6c17;_0x430a97[_0xdf6e('0x19')]('\x22'+_0x1459e5+'\x22');break;case _0xdf6e('0x35'):var _0x2d47d5=parseInt(_0x1459e5);if(_[_0xdf6e('0x75')](_0x2d47d5)&&_['includes'](_0x21571b,_0x2d47d5)){_0x430a97[_0xdf6e('0x19')]('\x22'+_0x2d47d5+'\x22');}else{_0x7f5aa['push'](_0xdf6e('0x76'));}break;case'email':if(isEmail(_0x1459e5)){_0x430a97[_0xdf6e('0x19')]('\x22'+_0x1459e5+'\x22');}else{_0x7f5aa[_0xdf6e('0x19')](_0xdf6e('0x77'));}break;case'dateOfBirth':var _0x544584=moment(_0x1459e5,_0xdf6e('0x78'),!![]);if(_0x544584[_0xdf6e('0x72')]()){_0x430a97['push']('\x22'+_0x1459e5+'\x22');}else{_0x7f5aa[_0xdf6e('0x19')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x430a97[_0xdf6e('0x19')]('\x22'+_0x1459e5+'\x22');}}else{switch(_0x2c75e5){case'firstName':case _0xdf6e('0xe'):_0x7f5aa[_0xdf6e('0x19')](_0x2c75e5+'\x20not\x20specified');break;default:_0x430a97[_0xdf6e('0x19')]('\x22\x22');}}}}else{var _0xa62f6d='';if(!_[_0xdf6e('0x18')](_0x1581cf)){if(!_0x1bbf73[_0xdf6e('0x6f')](_0x1581cf['id'])){for(var _0x42eb9c=0x0;_0x42eb9c<_0x12e3fa[_0x2c75e5][_0xdf6e('0x1f')];_0x42eb9c++){var _0x1459e5=_['trim'](_0x443ff5['data'][_0x55243d][_0x12e3fa[_0x2c75e5][_0x42eb9c]]['replace'](/"/g,'\x27'));var _0x49aeb4=phoneDescriptions[_0xdf6e('0x6d')](_0x34c44f=>_0x34c44f[_0xdf6e('0x79')]===_0x1581cf['id']);if(!_[_0xdf6e('0x18')](_0x49aeb4)){var _0x19e35e=_['trim'](_0x443ff5[_0xdf6e('0x6b')][_0x55243d][_0x12e3fa[_0x49aeb4['description']][0x0]][_0xdf6e('0x71')](/"/g,'\x27'));if(!_[_0xdf6e('0x18')](_0x19e35e))_0x1459e5=_0x1459e5+'§'+_0x19e35e;}if(_0xa62f6d=='')_0xa62f6d=_0x1459e5;else _0xa62f6d+='|'+_0x1459e5;}_0x505671['push'](_0x1581cf['id']+':'+_0xa62f6d);_0x1bbf73[_0x1581cf['id']]=0x1;}}}}if(hasAdditionalPhones){_0x430a97[_0xdf6e('0x19')]('\x22'+_0x505671[_0xdf6e('0xf')](';')+'\x22');}if(_0x7f5aa[_0xdf6e('0x1f')]){handleError(_0x443ff5[_0xdf6e('0x6b')][_0x55243d],{'code':_0xdf6e('0x7a'),'message':_0x7f5aa['join']()});}else{fs[_0xdf6e('0x7b')](_0x49990d,_0x430a97[_0xdf6e('0xf')]()+'\x0a');}_0x430a97=[];}if(!(stats[_0xdf6e('0x6c')]%0xc8)){socket['emit'](_0xdf6e('0x7c')+_0x5a9284,stats);stats[_0xdf6e('0x59')]=[];}}if(stopped){logger[_0xdf6e('0x57')](_0xdf6e('0x7d'));_0x47b5f1[_0xdf6e('0x7e')]();}}catch(_0x243861){handleError(_0x443ff5[_0xdf6e('0x6b')][_0x55243d],{'code':_0xdf6e('0x7f'),'message':_0x243861[_0xdf6e('0x1d')]});logger[_0xdf6e('0x1c')](_0xdf6e('0x80'),_0x243861[_0xdf6e('0x1d')]);}},'complete':function(){try{var _0x1f2d7f=[];var _0xb53022=tempTableName;_0x1f2d7f[_0xdf6e('0x19')](_0xdf6e('0x81')+_0xb53022+'\x20LIKE\x20cm_contacts;');logger[_0xdf6e('0x57')]('CIS\x20len',contactItemTypes[_0xdf6e('0x1f')]);var _0x21b6e3=util[_0xdf6e('0xb')](_0xdf6e('0x82'),_0x49990d,_0xb53022,_0x3887eb,_0x5907b1[_0xdf6e('0x43')],_0x5907b1[_0xdf6e('0x52')]||null,NOW,NOW);if(_[_0xdf6e('0x18')](_0x12e3fa[_0xdf6e('0x30')])){_0x21b6e3+=_0xdf6e('0x83');}_0x1f2d7f['push'](_0x21b6e3);BPromise[_0xdf6e('0x84')](_0x1f2d7f,handleQuery)[_0xdf6e('0x1b')](function(_0x3a39ab){BPromise[_0xdf6e('0x1a')]([handleAdditionalPhones()])[_0xdf6e('0x1b')](function(){_0x1f2d7f=[];for(var _0x1197a0=0x0;_0x1197a0\x20\x20','existsSync','binding','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','uncaughtException','lodash','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','import','redis','defaults','localhost','socket.io-emitter','format','YYYYMMDDHHmmss','test','field','join','.id\x20=\x20','where','\x20=\x20','sequelize','query','select\x20*\x20from\x20','length','phone','isNil','AdditionalPhones','push','all','then','error','message','split','filter','CmContactHasItem','updated','create','PHONE','inserted','update','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','priority','UserId','select','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_hopper_black','createdAt','updatedAt','from','.CmListId\x20=\x20?','\x20=\x20?','cm_hopper.id','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','CmHopperId','OrderBy','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','keys','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','group','info','exit','errors','code','spread','catch','main','stringify','send','start','clone','socket_timestamp','root','server/files/tmp','.csv','body','findAll','name','_description','header','parse','createReadStream','data','rows','find','replace','isNaN','isNumber','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','isValid','firstName','\x20not\x20specified','trim','itemTypeId','description','appendFileSync','emit','contact:import:','Abort\x20parser','abort','step'];(function(_0x3df2ba,_0x197da3){var _0xd27168=function(_0x1b674e){while(--_0x1b674e){_0x3df2ba['push'](_0x3df2ba['shift']());}};_0xd27168(++_0x197da3);}(_0x7fea,0x149));var _0xa7fe=function(_0x15c9b4,_0x5ba101){_0x15c9b4=_0x15c9b4-0x0;var _0x18fdd9=_0x7fea[_0x15c9b4];return _0x18fdd9;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0xa7fe('0x0'));var Papa=require('papaparse');var util=require('util');var BPromise=require(_0xa7fe('0x1'));var moment=require(_0xa7fe('0x2'));var squel=require(_0xa7fe('0x3'));var Redis=require(_0xa7fe('0x4'));var db=require(_0xa7fe('0x5'))['db'];var config=require(_0xa7fe('0x6'));var logger=require('../../../config/logger')(_0xa7fe('0x7'));config[_0xa7fe('0x8')]=_[_0xa7fe('0x9')](config[_0xa7fe('0x8')],{'host':_0xa7fe('0xa'),'port':0x18eb});var socket=require(_0xa7fe('0xb'))(new Redis(config[_0xa7fe('0x8')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0xa7fe('0xc')]('YYYY-MM-DD\x20HH:mm:ss');var tempTableName='cm_contacts_temp_'+moment()[_0xa7fe('0xc')](_0xa7fe('0xd'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x39e1f9){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0xa7fe('0xe')](_0x39e1f9);}function selectNotIn(_0x565c34,_0x2c5502,_0x2df82d,_0x5690e4,_0x39898e){return squel['select']()[_0xa7fe('0xf')]('phone')['from'](_0x5690e4)[_0xa7fe('0x10')](_0x2c5502,null,_0x2c5502+_0xa7fe('0x11')+_0x5690e4+'.'+_0x2df82d)[_0xa7fe('0x12')](_0x5690e4+'.'+_0x2df82d+_0xa7fe('0x13')+_0x565c34+'.'+_0x2df82d)[_0xa7fe('0x12')](_0x2c5502+'.dialCheckDuplicateType\x20IN\x20('+_0x39898e['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x215d4c,_0x39c55c){promisesAdditionalPhones=[];promisesContact=[];return db[_0xa7fe('0x14')][_0xa7fe('0x15')](_0xa7fe('0x16')+tempTableName)['spread'](function(_0x137dc9){if(_0x137dc9!==null){var _0x292ad1=[];for(var _0x132586=0x0;_0x132586<_0x137dc9[_0xa7fe('0x17')];_0x132586++){var _0x70ece8=_0x137dc9[_0x132586];if(!_['isNil'](_0x70ece8[_0xa7fe('0x18')])){if(!_[_0xa7fe('0x19')](_0x70ece8[_0xa7fe('0x1a')]))_0x292ad1[_0xa7fe('0x1b')](insertAdditionalPhones(_0x70ece8));promisesContact[_0xa7fe('0x1b')]({'contact':_0x70ece8});}}}Promise[_0xa7fe('0x1c')](_0x292ad1)[_0xa7fe('0x1d')](function(){_0x215d4c({'val':0x1});});})['catch'](function(_0x5409fe){logger[_0xa7fe('0x1e')](_0x5409fe[_0xa7fe('0x1f')]);});});}function insertAdditionalPhones(_0x473612){return new Promise(function(_0x529990,_0x1d33d2){var _0x43feee=_0x473612[_0xa7fe('0x1a')];if(_['isNil'](_0x43feee))_0x1d33d2({'val':0x0});else{var _0x29649c=_0x43feee[_0xa7fe('0x20')](';');var _0x1619c1=[];orderBy=0x0;for(var _0x13e31e=0x0;_0x13e31e<_0x29649c[_0xa7fe('0x17')];_0x13e31e++){_0x1619c1[_0xa7fe('0x1b')](splitAdditionalPhone(_0x473612['id'],_0x29649c[_0x13e31e]));}Promise[_0xa7fe('0x1c')](_0x1619c1)[_0xa7fe('0x1d')](function(){_0x529990({'val':_0x29649c['length']});});}});}function splitAdditionalPhone(_0x3415b8,_0x4fb801){return new Promise(function(_0x4ce2e7,_0x37c8fa){var _0xf06c82=_0x4fb801[_0xa7fe('0x20')](':');var _0x1350fe=_0xf06c82[0x0];var _0x46c807=_0xf06c82[0x1];if(_0x46c807!==''){var _0x5d3b9d=_0x46c807[_0xa7fe('0x20')]('|');var _0x12b558=[];for(var _0xa3fde9=0x0;_0xa3fde9<_0x5d3b9d[_0xa7fe('0x17')];_0xa3fde9++){if(_0x5d3b9d[_0xa3fde9]!==''){var _0x26e5a4=_[_0xa7fe('0x21')](promisesAdditionalPhones,{'contactId':_0x3415b8,'phone':_0x5d3b9d[_0xa3fde9]});if(_0x26e5a4[_0xa7fe('0x17')]==0x0){orderBy++;promisesAdditionalPhones[_0xa7fe('0x1b')]({'contactId':_0x3415b8,'contactTypeId':_0x1350fe,'phone':_0x5d3b9d[_0xa3fde9],'orderBy':orderBy});}}}_0x4ce2e7({'ok':0x1});}else _0x4ce2e7({'res':0x0});});}function createAdditionalPhone(_0x9d5272,_0x3c3f91,_0x44ba8a,_0x19dd83){var _0x1ada44='';var _0x42ca9d='';var _0x1842cb=_0x44ba8a[_0xa7fe('0x20')]('§');_0x1ada44=_0x1842cb[0x0];if(_0x1842cb[_0xa7fe('0x17')]==0x2)_0x42ca9d=_0x1842cb[0x1];return new Promise(function(_0xfeb346,_0x1c9e5a){return db[_0xa7fe('0x22')]['findOne']({'where':{'CmContactId':_0x9d5272,'item':_0x1ada44}})[_0xa7fe('0x1d')](function(_0x3198f9){if(_0x3198f9){return db['CmContactHasItem']['update']({'ItemTypeId':_0x3c3f91,'description':_0x42ca9d,'OrderBy':_0x19dd83},{'where':{'CmContactId':_0x9d5272,'item':_0x1ada44}})['then'](function(_0x331d99){_0xfeb346({'res':_0xa7fe('0x23')});});}else{return db['CmContactHasItem'][_0xa7fe('0x24')]({'CmContactId':_0x9d5272,'item':_0x1ada44,'ItemTypeId':_0x3c3f91,'description':_0x42ca9d,'OrderBy':_0x19dd83,'ItemClass':_0xa7fe('0x25')})[_0xa7fe('0x1d')](function(_0xf57c97){_0xfeb346({'res':_0xa7fe('0x26')});});}});});}function updateContact(_0x1f800b){return new Promise(function(_0x3c1a25,_0x11718c){var _0x383ed4=_0x1f800b['id'];delete _0x1f800b['id'];return db['CmContact'][_0xa7fe('0x27')](_0x1f800b,{'where':{'id':_0x383ed4}})['then'](function(_0x279f57){updatedRows+=0x1;return db[_0xa7fe('0x28')][_0xa7fe('0x27')]({'phone':_0x1f800b['phone']},{'where':{'ContactId':_0x383ed4}})[_0xa7fe('0x1d')](function(_0x189925){_0x3c1a25({'ret':'OK'});});});});}function insertCmHopper(_0x1618e1,_0x3d1600,_0x4ad116,_0x18e736,_0x34cfcc){var _0x57893e=[_0xa7fe('0x29'),_0xa7fe('0x2a'),_0xa7fe('0x2b'),_0xa7fe('0x2c'),_0x3d1600+'.'+_0x18e736,_0xa7fe('0x2d'),_0xa7fe('0x2e'),_0xa7fe('0x2f'),_0xa7fe('0x30'),'\x22'+_0x34cfcc+'\x22'];return squel[_0xa7fe('0x31')]()[_0xa7fe('0x32')](_0xa7fe('0x33'))[_0xa7fe('0x34')]([_0xa7fe('0x18'),_0xa7fe('0x35'),_0xa7fe('0x36'),_0xa7fe('0x37'),_0x18e736,'createdAt','updatedAt',_0xa7fe('0x38'),_0xa7fe('0x39'),'recallme'],squel[_0xa7fe('0x3a')]()[_0xa7fe('0x3b')](_0x57893e)['from'](_0x3d1600)[_0xa7fe('0x10')](_0xa7fe('0x3c'),null,_0xa7fe('0x3d')+_0x3d1600+_0xa7fe('0x3e'))[_0xa7fe('0x10')](_0x4ad116,null,_0x4ad116+_0xa7fe('0x11')+_0x3d1600+'.'+_0x18e736)[_0xa7fe('0x12')](_0x3d1600+'.CmListId\x20=\x20?',_0x1618e1)[_0xa7fe('0x12')](_0xa7fe('0x3f'),NOW)[_0xa7fe('0x12')](_0xa7fe('0x40'),selectNotIn(_0x3d1600,_0x4ad116,_0x18e736,'cm_hopper',[_0xa7fe('0x41'),_0xa7fe('0x42')]))[_0xa7fe('0x12')](_0xa7fe('0x40'),selectNotIn(_0x3d1600,_0x4ad116,_0x18e736,_0xa7fe('0x33'),[_0xa7fe('0x41')])))[_0xa7fe('0x43')]();}function insertCmHopperBlack(_0xafc706,_0x3c3bdf,_0xdc565a,_0x241b13){var _0x2ddac9=[_0xa7fe('0x29'),_0xa7fe('0x2b'),'cm_contacts.ListId',_0x3c3bdf+'.'+_0x241b13,'cm_contacts.createdAt','cm_contacts.updatedAt'];return squel['insert']()[_0xa7fe('0x32')](_0xa7fe('0x44'))[_0xa7fe('0x34')]([_0xa7fe('0x18'),_0xa7fe('0x36'),_0xa7fe('0x37'),_0x241b13,_0xa7fe('0x45'),_0xa7fe('0x46')],squel['select']()[_0xa7fe('0x3b')](_0x2ddac9)[_0xa7fe('0x47')](_0x3c3bdf)[_0xa7fe('0x10')]('cm_contacts',null,_0xa7fe('0x3d')+_0x3c3bdf+_0xa7fe('0x3e'))['join'](_0xdc565a,null,_0xdc565a+_0xa7fe('0x11')+_0x3c3bdf+'.'+_0x241b13)[_0xa7fe('0x12')](_0x3c3bdf+_0xa7fe('0x48'),_0xafc706)[_0xa7fe('0x12')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xa7fe('0x12')](_0xa7fe('0x40'),squel['select']()[_0xa7fe('0xf')]('phone')[_0xa7fe('0x47')](_0xa7fe('0x44'))[_0xa7fe('0x12')]('ListId\x20=\x20?',_0xafc706)[_0xa7fe('0x12')](_0x241b13+_0xa7fe('0x49'),_0x3c3bdf+'.'+_0x241b13)))['toString']();}function insertCmHopperAdditionalPhones(_0xf84413){var _0x51ad4b=[_0xa7fe('0x4a'),'cm_contact_has_items.item',_0xa7fe('0x4b'),_0xa7fe('0x4c'),_0xa7fe('0x4d')];return squel[_0xa7fe('0x31')]()[_0xa7fe('0x32')]('cm_hopper_additional_phones')['fromQuery']([_0xa7fe('0x4e'),_0xa7fe('0x18'),_0xa7fe('0x4f'),_0xa7fe('0x45'),_0xa7fe('0x46')],squel['select']()['fields'](_0x51ad4b)[_0xa7fe('0x47')](_0xa7fe('0x33'))['join'](_0xa7fe('0x3c'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0xa7fe('0x10')](_0xa7fe('0x50'),null,_0xa7fe('0x51'))['where']('cm_hopper.ListId\x20=\x20?',_0xf84413)[_0xa7fe('0x12')]('cm_contacts.createdAt\x20=\x20?',NOW))['toString']();}function insertCmContact(_0x1ebeb5,_0x1b2621,_0x36e571,_0x20a127){var _0x28ba7e=_['concat'](_[_0xa7fe('0x52')](_0x20a127),[_0xa7fe('0x37'),_0xa7fe('0x53'),_0xa7fe('0x45'),'updatedAt']);return squel['insert']()['into'](_0xa7fe('0x3c'))['fromQuery'](_0x28ba7e,squel[_0xa7fe('0x3a')]()[_0xa7fe('0x3b')](_0x28ba7e)[_0xa7fe('0x47')](_0x1b2621)[_0xa7fe('0x12')]('('+_0x36e571[_0xa7fe('0x10')](',')+_0xa7fe('0x54'),squel['select']()['fields'](_0x36e571)[_0xa7fe('0x47')](_0xa7fe('0x3c'))[_0xa7fe('0x12')]('ListId\x20=\x20?',_0x1ebeb5))[_0xa7fe('0x12')](_0xa7fe('0x55'),squel[_0xa7fe('0x3a')]()['field'](_0xa7fe('0x56'),_0xa7fe('0x57'))[_0xa7fe('0x47')](_0x1b2621)[_0xa7fe('0x58')](_0x36e571[_0xa7fe('0x10')](','))))[_0xa7fe('0x43')]();}function handleStop(){logger[_0xa7fe('0x59')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x37e0b6){logger['error'](_0x37e0b6[_0xa7fe('0x1f')]);process[_0xa7fe('0x5a')](0x1);}function handleError(_0x1f2a92,_0x44be0a){stats[_0xa7fe('0x5b')][_0xa7fe('0x1b')]({'name':_0x44be0a[_0xa7fe('0x5c')],'message':_0x44be0a[_0xa7fe('0x1f')],'row':_0x1f2a92});}function handleQuery(_0x2df023){logger[_0xa7fe('0x59')](_0x2df023);return db[_0xa7fe('0x14')][_0xa7fe('0x15')](_0x2df023)[_0xa7fe('0x5d')](function(_0x5262de){results[_0xa7fe('0x1b')](_0x5262de);})[_0xa7fe('0x5e')](function(_0x1ff70a){logger[_0xa7fe('0x1e')](_0x1ff70a[_0xa7fe('0x1f')]);});}function main(_0x39a947,_0x3db771,_0x4d624c,_0x1a5ac8){logger['info'](_0xa7fe('0x5f'),_0x39a947,JSON[_0xa7fe('0x60')](_0x3db771));process[_0xa7fe('0x61')](_0xa7fe('0x62'));var _0x2d9e6b=_0x3db771['binding'];var _0x36450c=_[_0xa7fe('0x63')](_0x2d9e6b);var _0x55048f=_0x3db771[_0xa7fe('0x64')];var _0x163eda=path['join'](config[_0xa7fe('0x65')],_0xa7fe('0x66'),_0x55048f+_0xa7fe('0x67'));logger[_0xa7fe('0x59')](_0xa7fe('0x68'),_0x3db771);db['ContactItemType'][_0xa7fe('0x69')]({'raw':!![],'attributes':['id',_0xa7fe('0x6a')]})[_0xa7fe('0x1d')](function(_0x1111bb){for(var _0x1c5ab7=0x0;_0x1c5ab7<_0x1111bb[_0xa7fe('0x17')];_0x1c5ab7++){if(_0x1111bb[_0x1c5ab7][_0xa7fe('0x6a')]in _0x2d9e6b){contactItemTypes[_0xa7fe('0x1b')](_0x1111bb[_0x1c5ab7]);delete _0x36450c[_0x1111bb[_0x1c5ab7][_0xa7fe('0x6a')]];hasAdditionalPhones=!![];}for(var _0x4e85d7 in _0x2d9e6b){if(_0x1111bb[_0x1c5ab7][_0xa7fe('0x6a')]+_0xa7fe('0x6b')===_0x4e85d7){phoneDescriptions['push']({'itemTypeId':_0x1111bb[_0x1c5ab7]['id'],'description':_0x4e85d7});delete _0x36450c[_0x4e85d7];}}}if(hasAdditionalPhones)_0x36450c[_0xa7fe('0x1a')]='';var _0x511c64=_[_0xa7fe('0x52')](_0x36450c)[_0xa7fe('0x10')]();logger[_0xa7fe('0x59')](_0xa7fe('0x6c'),_0x511c64);fs['writeFileSync'](_0x163eda,_0x511c64+'\x0a');Papa[_0xa7fe('0x6d')](fs[_0xa7fe('0x6e')](_0x39a947),{'header':!![],'skipEmptyLines':!![],'step':function(_0x237d8c,_0x1d4e4a){try{for(var _0x4b767a=0x0,_0x8e04bf=[];_0x4b767a<_0x237d8c[_0xa7fe('0x6f')][_0xa7fe('0x17')];_0x4b767a++){stats[_0xa7fe('0x70')]+=0x1;if(_0x237d8c[_0xa7fe('0x5b')][_0x4b767a]){handleError(_0x237d8c[_0xa7fe('0x6f')][_0x4b767a],_0x237d8c[_0xa7fe('0x5b')][_0x4b767a]);}else{var _0x2c15fc=[];var _0x2c99ea=[];var _0x37fe25={};for(var _0x27797b in _0x2d9e6b){let _0xdcbb9d=contactItemTypes[_0xa7fe('0x71')](_0x41d296=>_0x41d296['name']===_0x27797b);let _0x255709=contactItemTypes[_0xa7fe('0x71')](_0x4b1c06=>_0x4b1c06['name']+_0xa7fe('0x6b')===_0x27797b);if(_['isNil'](_0xdcbb9d)&&_[_0xa7fe('0x19')](_0x255709)){if(_0x2d9e6b['hasOwnProperty'](_0x27797b)){if(_0x237d8c[_0xa7fe('0x6f')][_0x4b767a][_0x2d9e6b[_0x27797b]]){var _0x521a77=_['trim'](_0x237d8c[_0xa7fe('0x6f')][_0x4b767a][_0x2d9e6b[_0x27797b]][_0xa7fe('0x72')](/"/g,'\x27'));switch(_0x27797b){case'scheduledat':var _0x282b0c=moment(_0x521a77,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x282b0c['isValid']()){_0x8e04bf['push']('\x22'+_0x521a77+'\x22');}else{_0x2c15fc[_0xa7fe('0x1b')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xa7fe('0x38'):var _0x157c94=parseInt(_0x521a77);_0x521a77=_[_0xa7fe('0x73')](_0x157c94)||_0x157c94<0x0||_0x157c94>0x4?_0x1a5ac8?0x3:0x2:_0x157c94;_0x8e04bf[_0xa7fe('0x1b')]('\x22'+_0x521a77+'\x22');break;case'UserId':var _0x247783=parseInt(_0x521a77);if(_[_0xa7fe('0x74')](_0x247783)&&_['includes'](_0x4d624c,_0x247783)){_0x8e04bf[_0xa7fe('0x1b')]('\x22'+_0x247783+'\x22');}else{_0x2c15fc[_0xa7fe('0x1b')]('agent\x20not\x20exists');}break;case _0xa7fe('0x75'):if(isEmail(_0x521a77)){_0x8e04bf[_0xa7fe('0x1b')]('\x22'+_0x521a77+'\x22');}else{_0x2c15fc['push'](_0xa7fe('0x76'));}break;case _0xa7fe('0x77'):var _0x3d79f8=moment(_0x521a77,_0xa7fe('0x78'),!![]);if(_0x3d79f8[_0xa7fe('0x79')]()){_0x8e04bf[_0xa7fe('0x1b')]('\x22'+_0x521a77+'\x22');}else{_0x2c15fc[_0xa7fe('0x1b')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x8e04bf['push']('\x22'+_0x521a77+'\x22');}}else{switch(_0x27797b){case _0xa7fe('0x7a'):case _0xa7fe('0x18'):_0x2c15fc[_0xa7fe('0x1b')](_0x27797b+_0xa7fe('0x7b'));break;default:_0x8e04bf[_0xa7fe('0x1b')]('\x22\x22');}}}}else{var _0x915b='';if(!_[_0xa7fe('0x19')](_0xdcbb9d)){if(!_0x37fe25['hasOwnProperty'](_0xdcbb9d['id'])){for(var _0x279fed=0x0;_0x279fed<_0x2d9e6b[_0x27797b][_0xa7fe('0x17')];_0x279fed++){var _0x521a77=_[_0xa7fe('0x7c')](_0x237d8c[_0xa7fe('0x6f')][_0x4b767a][_0x2d9e6b[_0x27797b][_0x279fed]][_0xa7fe('0x72')](/"/g,'\x27'));var _0x11def8=phoneDescriptions[_0xa7fe('0x71')](_0x9b5867=>_0x9b5867[_0xa7fe('0x7d')]===_0xdcbb9d['id']);if(!_['isNil'](_0x11def8)){var _0x408768=_[_0xa7fe('0x7c')](_0x237d8c[_0xa7fe('0x6f')][_0x4b767a][_0x2d9e6b[_0x11def8[_0xa7fe('0x7e')]][0x0]]['replace'](/"/g,'\x27'));if(!_[_0xa7fe('0x19')](_0x408768))_0x521a77=_0x521a77+'§'+_0x408768;}if(_0x915b=='')_0x915b=_0x521a77;else _0x915b+='|'+_0x521a77;}_0x2c99ea[_0xa7fe('0x1b')](_0xdcbb9d['id']+':'+_0x915b);_0x37fe25[_0xdcbb9d['id']]=0x1;}}}}if(hasAdditionalPhones){_0x8e04bf[_0xa7fe('0x1b')]('\x22'+_0x2c99ea[_0xa7fe('0x10')](';')+'\x22');}if(_0x2c15fc[_0xa7fe('0x17')]){handleError(_0x237d8c[_0xa7fe('0x6f')][_0x4b767a],{'code':'SystemRow','message':_0x2c15fc['join']()});}else{fs[_0xa7fe('0x7f')](_0x163eda,_0x8e04bf[_0xa7fe('0x10')]()+'\x0a');}_0x8e04bf=[];}if(!(stats[_0xa7fe('0x70')]%0xc8)){socket[_0xa7fe('0x80')](_0xa7fe('0x81')+_0x55048f,stats);stats[_0xa7fe('0x5b')]=[];}}if(stopped){logger[_0xa7fe('0x59')](_0xa7fe('0x82'));_0x1d4e4a[_0xa7fe('0x83')]();}}catch(_0x507f3b){handleError(_0x237d8c[_0xa7fe('0x6f')][_0x4b767a],{'code':'SystemError','message':_0x507f3b[_0xa7fe('0x1f')]});logger[_0xa7fe('0x1e')](_0xa7fe('0x84'),_0x507f3b[_0xa7fe('0x1f')]);}},'complete':function(){try{var _0x44bed4=[];var _0x433e0e=tempTableName;_0x44bed4['push'](_0xa7fe('0x85')+_0x433e0e+'\x20LIKE\x20cm_contacts;');logger[_0xa7fe('0x59')]('CIS\x20len',contactItemTypes['length']);var _0x178a59=util[_0xa7fe('0xc')]('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x163eda,_0x433e0e,_0x511c64,_0x3db771[_0xa7fe('0x37')],_0x3db771[_0xa7fe('0x53')]||null,NOW,NOW);if(_['isNil'](_0x2d9e6b[_0xa7fe('0x35')])){_0x178a59+=_0xa7fe('0x86');}_0x44bed4[_0xa7fe('0x1b')](_0x178a59);BPromise[_0xa7fe('0x87')](_0x44bed4,handleQuery)['then'](function(_0x508796){BPromise[_0xa7fe('0x1c')]([handleAdditionalPhones()])['then'](function(){_0x44bed4=[];for(var _0x123d87=0x0;_0x123d87\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.attach','i.lastMsgAt','i.lastMsgDirection','i.to','i.ContactId','i.MailAccountId','i.UserId','openchannel','contactName','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','c.fax','o.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','findOne','enableEmailPreview','all','clone','COUNT(*)','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','getSelectedTags','where','t.id\x20IN\x20?','lodash','../parsers/advancedSearch','../parsers/qs','./update-interaction','getAccountFK','role','agent','search','field','name','color','from','getInteractionFK','user_has_'];(function(_0x2359ad,_0x23d661){var _0x1e7ed5=function(_0x4c9de4){while(--_0x4c9de4){_0x2359ad['push'](_0x2359ad['shift']());}};_0x1e7ed5(++_0x23d661);}(_0x3de3,0x132));var _0x33de=function(_0x300af3,_0x16cf33){_0x300af3=_0x300af3-0x0;var _0x28a357=_0x3de3[_0x300af3];return _0x28a357;};'use strict';var _=require(_0x33de('0x0'));var squel=require('squel');var as=require(_0x33de('0x1'));var qs=require(_0x33de('0x2'));var updateInteraction=require(_0x33de('0x3'))['updateInteraction'];var utils=require('./utils');var db=require('../../mysqldb')['db'];function skipInteractionsQuery(_0xf574f9,_0xdf619d,_0x1583da){var _0x29a704=![];var _0x5436e0=utils[_0x33de('0x4')](_0xf574f9);if(_0xdf619d[_0x33de('0x5')]===_0x33de('0x6')&&!_0x1583da[_0x33de('0x7')]&&!_0x1583da[_0x5436e0]){_0x29a704=!![];}return _0x29a704;}function getTagsQuery(){return squel['select']()[_0x33de('0x8')]('id')[_0x33de('0x8')](_0x33de('0x9'))['field'](_0x33de('0xa'))[_0x33de('0xb')]('tools_tags');}function getUsersQuery(_0x551b66,_0x512067){var _0x4348a2=utils[_0x33de('0xc')](_0x551b66);var _0x4040bb=_0x33de('0xd')+_0x551b66+_0x33de('0xe');var _0xcf6f16=squel[_0x33de('0xf')]()[_0x33de('0x8')](_0x33de('0x10'))[_0x33de('0x8')](_0x33de('0x11'))[_0x33de('0x8')](_0x33de('0x12')+_0x4348a2)['from'](_0x4040bb,'ui')['left_join']('users','u',_0x33de('0x13'));if(_0x512067[_0x33de('0x14')]>0x0){_0xcf6f16['where']('ui.'+_0x4348a2+'\x20IN\x20?',_[_0x33de('0x15')](_0x512067,'id'));}return _0xcf6f16;}function getInteractionsQuery(_0xad3623){var _0x3f81f8=utils[_0x33de('0x16')](_0xad3623);var _0x1cf733=utils[_0x33de('0x4')](_0xad3623);var _0x5b3f72=utils[_0x33de('0xc')](_0xad3623);return squel[_0x33de('0xf')]()['from'](_0x3f81f8[_0x33de('0x17')],'i')[_0x33de('0x18')](_0x33de('0x19'),'c',_0x33de('0x1a'))[_0x33de('0x18')](_0x33de('0x1b'),'o',_0x33de('0x1c'))['left_join'](_0x3f81f8[_0x33de('0x1d')],'a','a.id\x20=\x20i.'+_0x1cf733)[_0x33de('0x18')](_0x3f81f8['messages'],'me',_0x33de('0x1e')+_0x5b3f72+'\x20=\x20i.id')[_0x33de('0x18')](_0x3f81f8['interactionsTags'],'it','it.'+_0x5b3f72+_0x33de('0x1f'))['left_join']('tools_tags','t',_0x33de('0x20'));}function getSqlClauses(){var _0x338529={'body':squel['expr'](),'contact':squel['expr'](),'default':squel[_0x33de('0x21')](),'fields':squel[_0x33de('0x21')](),'filter':squel[_0x33de('0x21')](),'read':squel[_0x33de('0x21')](),'tags':{'clause':squel['expr'](),'ids':null},'user':squel[_0x33de('0x21')]()};return _0x338529;}function parseTagParameter(_0x145c88){var _0x40a580=squel['expr']();if(_0x145c88){var _0x14747a=utils['getSelectedTags'](_0x145c88);_0x14747a['forEach'](function(_0x2dc357){_0x40a580['or'](_0x33de('0x22'),'%,'+_0x2dc357+',%');});}return _0x40a580;}function parseReadParameter(_0x3004be){var _0x8bc0cd='';if(_0x3004be){_0x8bc0cd=_0x33de('0x23');if(_0x3004be==='1'){_0x8bc0cd=_0x8bc0cd[_0x33de('0x24')]('{OPERATOR}','=');}else{_0x8bc0cd=_0x8bc0cd['replace'](_0x33de('0x25'),'>');}}return _0x8bc0cd;}function parseSearchFilter(_0x3c6368,_0x35a115){var _0x5aedc5=squel['expr']();if(_0x35a115){var _0x196e54=_0x35a115[_0x33de('0x24')]('\x5c','\x5c\x5c')[_0x33de('0x24')](/'/g,'\x27\x27');if(qs[_0x33de('0x26')](_0x196e54)){_0x5aedc5['or'](_0x33de('0x27'),_0x196e54+'%');if([_0x33de('0x28'),'whatsapp'][_0x33de('0x29')](_0x3c6368)){_0x5aedc5['or'](_0x33de('0x2a'),_0x196e54+'%');}else if(_0x3c6368===_0x33de('0x2b')){_0x5aedc5['or'](_0x33de('0x2c'),_0x196e54+'%');}else if(_0x3c6368==='openchannel'){_0x5aedc5['or'](_0x33de('0x2d'),_0x196e54+'%');}}else if(_0x3c6368===_0x33de('0x2e')&&qs['isEmail'](_0x196e54)){_0x5aedc5['or'](_0x33de('0x2f'),_0x196e54+'%');}else{if(_0x3c6368===_0x33de('0x2e')){_0x5aedc5['or'](_0x33de('0x30'),qs[_0x33de('0x31')](_0x196e54,!![]))['or'](_0x33de('0x32'),qs[_0x33de('0x31')](_0x196e54));}else if(_0x3c6368!==_0x33de('0x2b')){_0x5aedc5['or'](_0x33de('0x33'),qs[_0x33de('0x31')](_0x196e54));}_0x5aedc5['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x33de('0x31')](_0x196e54,!![]),null);}}return _0x5aedc5;}function parseAdvancedSearchFilter(_0x3ce859,_0x5209d5){var _0x20124c=getSqlClauses();var _0x53312d=as[_0x33de('0x34')](_0x3ce859);var _0x9480ae=_0x53312d[_0x33de('0x35')];for(var _0x192534=0x0;_0x192534<_0x53312d[_0x33de('0x36')][_0x33de('0x14')];_0x192534++){var _0x52133b=_0x53312d[_0x33de('0x36')][_0x192534];var _0x17ea19='i';var _0x1f449b=_[_0x33de('0x37')](_0x5209d5,[_0x33de('0x9'),_0x52133b[_0x33de('0x8')]]);if(_0x1f449b){var _0x3243f0=as[_0x33de('0x38')](_0x17ea19,_0x1f449b['type'],_0x52133b);_0x20124c[_0x33de('0x39')][_0x9480ae](_0x3243f0[_0x33de('0x3a')],_0x3243f0['value'][_0x33de('0x3b')],_0x3243f0[_0x33de('0x3c')][_0x33de('0x3d')]);}else{switch(_0x52133b[_0x33de('0x8')]){case _0x33de('0x3e'):var _0x2791f6=parseReadParameter(_0x52133b['value']);_0x20124c[_0x33de('0x3f')][_0x33de('0x40')](_0x2791f6);break;case'Contact':if(_0x52133b[_0x33de('0x41')]===_0x33de('0x42')){if(_0x52133b[_0x33de('0x3c')][_0x33de('0x43')]('\x20')[_0x33de('0x14')]>0x1){_0x20124c[_0x33de('0x44')][_0x9480ae](_0x33de('0x45'),qs['getFullTextValue'](_0x52133b[_0x33de('0x3c')],!![]),null);}else{var _0x8fc686='%'+_0x52133b[_0x33de('0x3c')]+'%';_0x20124c[_0x33de('0x44')][_0x9480ae]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x8fc686,_0x8fc686,_0x8fc686);}}else{_0x1f449b=_[_0x33de('0x37')](_0x5209d5,[_0x33de('0x9'),'ContactId']);_0x52133b[_0x33de('0x8')]=_0x33de('0x46');_0x3243f0=as['buildExpression'](_0x17ea19,_0x1f449b['type'],_0x52133b);_0x20124c[_0x33de('0x44')][_0x9480ae](_0x3243f0[_0x33de('0x3a')],_0x3243f0[_0x33de('0x3c')][_0x33de('0x3b')],_0x3243f0[_0x33de('0x3c')][_0x33de('0x3d')]);}break;case _0x33de('0x47'):var _0x217ad9=_0x52133b['value'][_0x33de('0x43')](',')['map'](function(_0x4a8f0d){return Number(_0x4a8f0d);});var _0x950b4b=parseTagParameter(_0x217ad9);_0x20124c[_0x33de('0x48')][_0x33de('0x49')][_0x33de('0x40')](_0x950b4b);_0x20124c['tags']['ids']=_0x217ad9;break;case _0x33de('0x4a'):if(_0x52133b['operator']==='$substring'){_0x20124c[_0x33de('0x4b')][_0x9480ae](_0x33de('0x4c'),'%'+_0x52133b[_0x33de('0x3c')]+'%',null);}else{_0x1f449b=_[_0x33de('0x37')](_0x5209d5,['name',_0x33de('0x4d')]);_0x52133b[_0x33de('0x8')]=_0x33de('0x4d');_0x3243f0=as['buildExpression'](_0x17ea19,_0x1f449b[_0x33de('0x4e')],_0x52133b);_0x20124c[_0x33de('0x4b')][_0x9480ae](_0x3243f0['text'],_0x3243f0[_0x33de('0x3c')]['start'],_0x3243f0['value'][_0x33de('0x3d')]);}break;case _0x33de('0x4f'):case _0x33de('0x50'):_0x3243f0=as[_0x33de('0x38')]('me',null,_0x52133b);_0x20124c['body'][_0x9480ae](_0x3243f0['text'],_0x3243f0[_0x33de('0x3c')][_0x33de('0x3b')],_0x3243f0[_0x33de('0x3c')][_0x33de('0x3d')]);break;}}}return _0x20124c;}function parseModelFields(_0x2f8687,_0x3a5a26,_0x145a7a){var _0x3df791=utils[_0x33de('0x4')](_0x2f8687);var _0x2d6e2c=squel['expr']();var _0x32337a=_(_0x3a5a26)[_0x33de('0x51')]()['map'](function(_0x224174){return _[_0x33de('0x52')](_0x145a7a,[_0x33de('0x9'),_0x224174])?_0x224174:undefined;})[_0x33de('0x53')]()[_0x33de('0x3c')]();if(_0x32337a[_0x33de('0x14')]>0x0){_0x32337a[_0x33de('0x54')](function(_0x32c920){if(_0x32c920===_0x3df791){_0x2d6e2c[_0x33de('0x40')]('i.'+_0x3df791+_0x33de('0x55'),[][_0x33de('0x56')](_0x3a5a26[_0x32c920]));}else if(_0x32c920===_0x33de('0x57')){var _0x219f84=JSON[_0x33de('0x58')](_0x3a5a26[_0x32c920])[_0x33de('0x59')];var _0x16a485=JSON['parse'](_0x3a5a26[_0x32c920])[_0x33de('0x5a')];_0x2d6e2c['and'](_0x33de('0x5b'),_0x219f84,_0x16a485);}else{if(_0x3a5a26[_0x32c920]===_0x33de('0x5c')){_0x2d6e2c[_0x33de('0x40')]('i.'+_0x32c920+_0x33de('0x5d'));}else{_0x2d6e2c['and']('i.'+_0x32c920+_0x33de('0x5e'),_0x3a5a26[_0x32c920]);}}});}return _0x2d6e2c;}function parseQueryParameters(_0x3421cd,_0x2bf50b,_0x1368f7){var _0xb53ac9=getSqlClauses();return Promise[_0x33de('0x5f')]()[_0x33de('0x60')](function(){return parseModelFields(_0x3421cd,_0x2bf50b,_0x1368f7);})[_0x33de('0x60')](function(_0xa0819f){_0xb53ac9[_0x33de('0x61')][_0x33de('0x40')](_0xa0819f);return parseReadParameter(_0x2bf50b[_0x33de('0x3f')]);})[_0x33de('0x60')](function(_0x541af6){_0xb53ac9[_0x33de('0x3f')][_0x33de('0x40')](_0x541af6);return parseTagParameter(_0x2bf50b[_0x33de('0x62')]);})[_0x33de('0x60')](function(_0x41db07){_0xb53ac9[_0x33de('0x48')]['clause'][_0x33de('0x40')](_0x41db07);return parseSearchFilter(_0x3421cd,_0x2bf50b[_0x33de('0x63')]);})[_0x33de('0x60')](function(_0x43a450){_0xb53ac9[_0x33de('0x63')]=_0x43a450;return _0xb53ac9;});}function checkAccountsRestrictions(_0x76c784,_0x46069c,_0x13bb18){var _0x252e1f=utils['getAccountFK'](_0x76c784);var _0x4216ae='get'+_[_0x33de('0x64')](_0x76c784)+(_0x76c784===_0x33de('0x65')?_0x33de('0x66'):_0x33de('0x67'));var _0x2f5b89=squel[_0x33de('0x21')]();return Promise[_0x33de('0x5f')]()[_0x33de('0x60')](function(){if(_0x13bb18['search']&&_0x46069c[_0x33de('0x5')]==='agent'){return _0x46069c[_0x4216ae]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x1f5820){if(_0x1f5820){if(_0x1f5820['length']===0x0){_0x2f5b89[_0x33de('0x40')]('i.'+_0x252e1f+_0x33de('0x5d'));}else{_0x2f5b89['and']('i.'+_0x252e1f+_0x33de('0x55'),_['map'](_0x1f5820,'id'));}}else if(!_0x13bb18[_0x252e1f]){_0x2f5b89['and']('i.'+_0x252e1f+_0x33de('0x68'));}})[_0x33de('0x60')](function(){return _0x2f5b89;});}function getClosedOrderClause(_0x3037f8,_0x65e78c){var _0x3671ae='';var _0x389b52=[_0x33de('0x69'),_0x33de('0x6a'),_0x33de('0x6b')];if(_0x3037f8===_0x33de('0x2e')){_0x389b52[_0x33de('0x6c')](_0x33de('0x6d'));}if(_0x65e78c[_0x33de('0x6e')]==='0'&&_0x3037f8===_0x33de('0x2e')){_0x3671ae='i.substatus';}else{if(_0x65e78c[_0x33de('0x6e')]==='1'){_0x389b52[_0x33de('0x6f')]();}_0x3671ae='CONCAT_WS(\x27\x27,\x20'+_0x389b52[_0x33de('0x70')](',\x20')+')';}return _0x3671ae;}function getFilteredInteractions(_0x1a8e29,_0x3fcf26,_0x57170b,_0x1a0547){var _0x426ce5=utils['getInteractionFK'](_0x1a8e29);var _0x2e5f0b=_['capitalize'](_0x1a8e29)+_0x33de('0x71');var _0x481057=[];var _0x24d553=getTagsQuery();var _0x137af4={'type':db[_0x33de('0x72')][_0x33de('0x73')][_0x33de('0x74')],'raw':!![]};var _0xaa1b89=[];var _0x321a1d=[];return db[_0x33de('0x75')][_0x33de('0x76')](_0x24d553[_0x33de('0x77')](),_0x137af4)[_0x33de('0x60')](function(_0xfe00d5){_0x481057=_['keyBy'](_0xfe00d5,'id');_0x137af4=_[_0x33de('0x78')](_0x137af4,{'model':db[_0x2e5f0b],'mapToModel':!![],'nest':!![]});if(_0x57170b['fields']){_0x1a0547[_0x33de('0x79')][_0x33de('0x54')](function(_0x51a6ca){_0x3fcf26[_0x33de('0x8')]('i.'+_0x51a6ca);});}else{_0x3fcf26[_0x33de('0x8')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x3fcf26[_0x33de('0x8')](_0x33de('0x7a'),'Account.key');_0x3fcf26[_0x33de('0x8')](_0x33de('0x7b'),_0x33de('0x7c'));if(_0x1a8e29==='mail'){_0x3fcf26[_0x33de('0x8')](_0x33de('0x7d'),_0x33de('0x7e'));_0x3fcf26[_0x33de('0x8')](_0x33de('0x7f'),'contactName');_0x3fcf26[_0x33de('0x8')]('i.id');_0x3fcf26[_0x33de('0x8')]('i.createdAt');_0x3fcf26[_0x33de('0x8')]('i.updatedAt');_0x3fcf26[_0x33de('0x8')]('i.closed');_0x3fcf26[_0x33de('0x8')]('i.closedAt');_0x3fcf26[_0x33de('0x8')](_0x33de('0x80'));_0x3fcf26['field'](_0x33de('0x81'));_0x3fcf26[_0x33de('0x8')](_0x33de('0x82'));_0x3fcf26['field']('i.subject');_0x3fcf26[_0x33de('0x8')]('i.disposition');_0x3fcf26[_0x33de('0x8')]('i.secondDisposition');_0x3fcf26[_0x33de('0x8')](_0x33de('0x69'));_0x3fcf26[_0x33de('0x8')]('i.substatus');_0x3fcf26[_0x33de('0x8')](_0x33de('0x83'));_0x3fcf26[_0x33de('0x8')](_0x33de('0x84'));_0x3fcf26[_0x33de('0x8')](_0x33de('0x85'));_0x3fcf26['field'](_0x33de('0x86'));}else if(_0x1a8e29===_0x33de('0x87')){_0x3fcf26[_0x33de('0x8')]('CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x33de('0x88'));}else{_0x3fcf26[_0x33de('0x8')](_0x33de('0x89'),'contactName');}if(_0x1a8e29!==_0x33de('0x2e')){_0x3fcf26['field']('i.*');}_0x3fcf26[_0x33de('0x8')](_0x33de('0x8a'),'Contact.firstName');_0x3fcf26[_0x33de('0x8')]('c.lastName',_0x33de('0x8b'));_0x3fcf26[_0x33de('0x8')](_0x33de('0x8c'),_0x33de('0x8d'));_0x3fcf26[_0x33de('0x8')]('c.phone',_0x33de('0x8e'));_0x3fcf26[_0x33de('0x8')](_0x33de('0x8f'),'Contact.mobile');_0x3fcf26[_0x33de('0x8')](_0x33de('0x90'),'Contact.fax');_0x3fcf26[_0x33de('0x8')](_0x33de('0x91'),'Owner.fullname');_0x3fcf26[_0x33de('0x8')]('o.internal',_0x33de('0x92'));_0x3fcf26[_0x33de('0x8')](_0x33de('0x93'),_0x33de('0x94'));}if(_0x1a0547[_0x33de('0x95')]){_0x3fcf26[_0x33de('0x95')](_0x1a0547['limit']);}if(_0x1a0547[_0x33de('0x96')]){_0x3fcf26['offset'](_0x1a0547[_0x33de('0x96')]);}return db[_0x33de('0x75')][_0x33de('0x76')](_0x3fcf26[_0x33de('0x77')](),_0x137af4);})[_0x33de('0x60')](function(_0x386add){_0xaa1b89=_0x386add;var _0x4cb685=getUsersQuery(_0x1a8e29,_0xaa1b89);return db[_0x33de('0x75')][_0x33de('0x76')](_0x4cb685[_0x33de('0x77')](),_0x137af4);})[_0x33de('0x60')](function(_0x1dab1e){_0x321a1d=_['groupBy'](_0x1dab1e,_0x426ce5);if(_0x1a8e29===_0x33de('0x2e')){return db['Setting'][_0x33de('0x97')]({'attributes':[_0x33de('0x98')],'raw':!![]});}})['then'](function(_0x1b1e75){var _0x481af0=_0x1b1e75?_0x1b1e75[_0x33de('0x98')]:undefined;var _0x3c63cf=_0xaa1b89[_0x33de('0x15')](function(_0x262189){return updateInteraction(_0x262189,_0x481057,_0x321a1d,_0x481af0);});return Promise[_0x33de('0x99')](_0x3c63cf);});}function countFilteredInteractions(_0x1d58be,_0x23f914){var _0x4882f7=_0x1d58be[_0x33de('0x9a')]();_0x4882f7[_0x33de('0x8')](_0x33de('0x9b'));_0x4882f7['field'](_0x33de('0x9c'),_0x33de('0x3e'));var _0x103aa5=utils[_0x33de('0x9d')](_0x23f914);if(!_['isEmpty'](_0x103aa5)){_0x4882f7[_0x33de('0x9e')](_0x33de('0x9f'),_0x103aa5);}var _0x2902f7={'type':db[_0x33de('0x72')]['QueryTypes'][_0x33de('0x74')],'raw':!![]};return db[_0x33de('0x75')]['query'](_0x4882f7['toString'](),_0x2902f7);}module['exports']={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0x02c2=['me.','\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','getSelectedTags','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','i.id\x20LIKE\x20?','sms','whatsapp','openchannel','i.from\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','mail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','fax','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','conditions','buildExpression','type','value','start','unreadMessages','read','and','Contact','operator','$substring','split','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','contact','text','end','Tag','clause','tags','ids','User','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','plainBody','body','keys','forEach','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','resolve','then','fields','tag','filter','get','chat','Websites','Accounts','\x20IS\x20NULL','i.thirdDisposition','i.disposition','unshift','i.substatus','closed','shift','CONCAT_WS(\x27\x27,\x20','join','capitalize','Interaction','Sequelize','QueryTypes','sequelize','query','toString','keyBy','merge','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.id','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.to','i.ContactId','i.MailAccountId','i.UserId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','Setting','findOne','enableEmailPreview','all','COUNT(*)','isEmpty','t.id\x20IN\x20?','exports','squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','./utils','../../mysqldb','getAccountFK','role','agent','search','select','field','name','color','from','tools_tags','user_has_','u.id','u.fullname','ui.','left_join','users','u.id\x20=\x20ui.UserId','length','where','\x20IN\x20?','map','getInteractionFK','interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','accounts','a.id\x20=\x20i.','messages'];(function(_0x3a2176,_0x4b1399){var _0x965e4d=function(_0x2753ed){while(--_0x2753ed){_0x3a2176['push'](_0x3a2176['shift']());}};_0x965e4d(++_0x4b1399);}(_0x02c2,0x12e));var _0x202c=function(_0x789aaa,_0x13b533){_0x789aaa=_0x789aaa-0x0;var _0x9e154c=_0x02c2[_0x789aaa];return _0x9e154c;};'use strict';var _=require('lodash');var squel=require(_0x202c('0x0'));var as=require(_0x202c('0x1'));var qs=require(_0x202c('0x2'));var updateInteraction=require(_0x202c('0x3'))['updateInteraction'];var utils=require(_0x202c('0x4'));var db=require(_0x202c('0x5'))['db'];function skipInteractionsQuery(_0x56c7e2,_0x1fc4cc,_0xb23470){var _0x30e677=![];var _0x1bb922=utils[_0x202c('0x6')](_0x56c7e2);if(_0x1fc4cc[_0x202c('0x7')]===_0x202c('0x8')&&!_0xb23470[_0x202c('0x9')]&&!_0xb23470[_0x1bb922]){_0x30e677=!![];}return _0x30e677;}function getTagsQuery(){return squel[_0x202c('0xa')]()[_0x202c('0xb')]('id')[_0x202c('0xb')](_0x202c('0xc'))['field'](_0x202c('0xd'))[_0x202c('0xe')](_0x202c('0xf'));}function getUsersQuery(_0x1129be,_0x184b43){var _0x4b9bc9=utils['getInteractionFK'](_0x1129be);var _0x5666cb=_0x202c('0x10')+_0x1129be+'_interactions';var _0x7c07fe=squel[_0x202c('0xa')]()[_0x202c('0xb')](_0x202c('0x11'))[_0x202c('0xb')](_0x202c('0x12'))['field'](_0x202c('0x13')+_0x4b9bc9)[_0x202c('0xe')](_0x5666cb,'ui')[_0x202c('0x14')](_0x202c('0x15'),'u',_0x202c('0x16'));if(_0x184b43[_0x202c('0x17')]>0x0){_0x7c07fe[_0x202c('0x18')]('ui.'+_0x4b9bc9+_0x202c('0x19'),_[_0x202c('0x1a')](_0x184b43,'id'));}return _0x7c07fe;}function getInteractionsQuery(_0x4e399b){var _0x2bafc2=utils['getInteractionsTables'](_0x4e399b);var _0x15743e=utils[_0x202c('0x6')](_0x4e399b);var _0x28b2a5=utils[_0x202c('0x1b')](_0x4e399b);return squel[_0x202c('0xa')]()[_0x202c('0xe')](_0x2bafc2[_0x202c('0x1c')],'i')[_0x202c('0x14')](_0x202c('0x1d'),'c',_0x202c('0x1e'))[_0x202c('0x14')](_0x202c('0x15'),'o','o.id\x20=\x20i.UserId')['left_join'](_0x2bafc2[_0x202c('0x1f')],'a',_0x202c('0x20')+_0x15743e)[_0x202c('0x14')](_0x2bafc2[_0x202c('0x21')],'me',_0x202c('0x22')+_0x28b2a5+'\x20=\x20i.id')['left_join'](_0x2bafc2['interactionsTags'],'it','it.'+_0x28b2a5+_0x202c('0x23'))[_0x202c('0x14')](_0x202c('0xf'),'t',_0x202c('0x24'));}function getSqlClauses(){var _0x819843={'body':squel[_0x202c('0x25')](),'contact':squel[_0x202c('0x25')](),'default':squel[_0x202c('0x25')](),'fields':squel[_0x202c('0x25')](),'filter':squel['expr'](),'read':squel[_0x202c('0x25')](),'tags':{'clause':squel[_0x202c('0x25')](),'ids':null},'user':squel[_0x202c('0x25')]()};return _0x819843;}function parseTagParameter(_0x4cce3d){var _0x5a3787=squel[_0x202c('0x25')]();if(_0x4cce3d){var _0x76115a=utils[_0x202c('0x26')](_0x4cce3d);_0x76115a['forEach'](function(_0x31a6ce){_0x5a3787['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x31a6ce+',%');});}return _0x5a3787;}function parseReadParameter(_0x5eed81){var _0x41ab0c='';if(_0x5eed81){_0x41ab0c=_0x202c('0x27');if(_0x5eed81==='1'){_0x41ab0c=_0x41ab0c[_0x202c('0x28')](_0x202c('0x29'),'=');}else{_0x41ab0c=_0x41ab0c[_0x202c('0x28')]('{OPERATOR}','>');}}return _0x41ab0c;}function parseSearchFilter(_0x30d8ba,_0x5414aa){var _0x242377=squel['expr']();if(_0x5414aa){var _0x87a6ea=_0x5414aa['replace']('\x5c','\x5c\x5c')[_0x202c('0x28')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x87a6ea)){_0x242377['or'](_0x202c('0x2a'),_0x87a6ea+'%');if([_0x202c('0x2b'),_0x202c('0x2c')]['includes'](_0x30d8ba)){_0x242377['or']('i.phone\x20LIKE\x20?',_0x87a6ea+'%');}else if(_0x30d8ba==='fax'){_0x242377['or']('i.fax\x20LIKE\x20?',_0x87a6ea+'%');}else if(_0x30d8ba===_0x202c('0x2d')){_0x242377['or'](_0x202c('0x2e'),_0x87a6ea+'%');}}else if(_0x30d8ba==='mail'&&qs[_0x202c('0x2f')](_0x87a6ea)){_0x242377['or'](_0x202c('0x30'),_0x87a6ea+'%');}else{if(_0x30d8ba===_0x202c('0x31')){_0x242377['or'](_0x202c('0x32'),qs[_0x202c('0x33')](_0x87a6ea,!![]))['or'](_0x202c('0x34'),qs['getFullTextValue'](_0x87a6ea));}else if(_0x30d8ba!==_0x202c('0x35')){_0x242377['or'](_0x202c('0x36'),qs['getFullTextValue'](_0x87a6ea));}_0x242377['or'](_0x202c('0x37'),qs[_0x202c('0x33')](_0x87a6ea,!![]),null);}}return _0x242377;}function parseAdvancedSearchFilter(_0x5eca13,_0x4ac886){var _0x2339f4=getSqlClauses();var _0x3276ad=as[_0x202c('0x38')](_0x5eca13);var _0x2f182c=_0x3276ad['sqlOperator'];for(var _0x2e39e3=0x0;_0x2e39e3<_0x3276ad['conditions']['length'];_0x2e39e3++){var _0x2ce02a=_0x3276ad[_0x202c('0x39')][_0x2e39e3];var _0x5434be='i';var _0x1b6870=_['find'](_0x4ac886,['name',_0x2ce02a[_0x202c('0xb')]]);if(_0x1b6870){var _0x1bdf06=as[_0x202c('0x3a')](_0x5434be,_0x1b6870[_0x202c('0x3b')],_0x2ce02a);_0x2339f4['default'][_0x2f182c](_0x1bdf06['text'],_0x1bdf06[_0x202c('0x3c')][_0x202c('0x3d')],_0x1bdf06[_0x202c('0x3c')]['end']);}else{switch(_0x2ce02a[_0x202c('0xb')]){case _0x202c('0x3e'):var _0xb2825e=parseReadParameter(_0x2ce02a[_0x202c('0x3c')]);_0x2339f4[_0x202c('0x3f')][_0x202c('0x40')](_0xb2825e);break;case _0x202c('0x41'):if(_0x2ce02a[_0x202c('0x42')]===_0x202c('0x43')){if(_0x2ce02a[_0x202c('0x3c')][_0x202c('0x44')]('\x20')[_0x202c('0x17')]>0x1){_0x2339f4['contact'][_0x2f182c](_0x202c('0x37'),qs['getFullTextValue'](_0x2ce02a[_0x202c('0x3c')],!![]),null);}else{var _0x4f2921='%'+_0x2ce02a['value']+'%';_0x2339f4['contact'][_0x2f182c](_0x202c('0x45'),_0x4f2921,_0x4f2921,_0x4f2921);}}else{_0x1b6870=_[_0x202c('0x46')](_0x4ac886,[_0x202c('0xc'),'ContactId']);_0x2ce02a[_0x202c('0xb')]=_0x202c('0x47');_0x1bdf06=as[_0x202c('0x3a')](_0x5434be,_0x1b6870[_0x202c('0x3b')],_0x2ce02a);_0x2339f4[_0x202c('0x48')][_0x2f182c](_0x1bdf06[_0x202c('0x49')],_0x1bdf06[_0x202c('0x3c')][_0x202c('0x3d')],_0x1bdf06[_0x202c('0x3c')][_0x202c('0x4a')]);}break;case _0x202c('0x4b'):var _0x953ac9=_0x2ce02a['value']['split'](',')[_0x202c('0x1a')](function(_0x1fd81f){return Number(_0x1fd81f);});var _0x8807f=parseTagParameter(_0x953ac9);_0x2339f4['tags'][_0x202c('0x4c')][_0x202c('0x40')](_0x8807f);_0x2339f4[_0x202c('0x4d')][_0x202c('0x4e')]=_0x953ac9;break;case _0x202c('0x4f'):if(_0x2ce02a[_0x202c('0x42')]===_0x202c('0x43')){_0x2339f4[_0x202c('0x50')][_0x2f182c](_0x202c('0x51'),'%'+_0x2ce02a['value']+'%',null);}else{_0x1b6870=_[_0x202c('0x46')](_0x4ac886,['name',_0x202c('0x52')]);_0x2ce02a[_0x202c('0xb')]=_0x202c('0x52');_0x1bdf06=as[_0x202c('0x3a')](_0x5434be,_0x1b6870[_0x202c('0x3b')],_0x2ce02a);_0x2339f4[_0x202c('0x50')][_0x2f182c](_0x1bdf06[_0x202c('0x49')],_0x1bdf06[_0x202c('0x3c')][_0x202c('0x3d')],_0x1bdf06['value'][_0x202c('0x4a')]);}break;case'body':case _0x202c('0x53'):_0x1bdf06=as[_0x202c('0x3a')]('me',null,_0x2ce02a);_0x2339f4[_0x202c('0x54')][_0x2f182c](_0x1bdf06[_0x202c('0x49')],_0x1bdf06['value'][_0x202c('0x3d')],_0x1bdf06[_0x202c('0x3c')][_0x202c('0x4a')]);break;}}}return _0x2339f4;}function parseModelFields(_0x2c82d3,_0x3c524f,_0x1e668e){var _0x59f613=utils[_0x202c('0x6')](_0x2c82d3);var _0x23e2c8=squel[_0x202c('0x25')]();var _0x4dc1d8=_(_0x3c524f)[_0x202c('0x55')]()[_0x202c('0x1a')](function(_0x4355fb){return _['some'](_0x1e668e,[_0x202c('0xc'),_0x4355fb])?_0x4355fb:undefined;})['compact']()['value']();if(_0x4dc1d8[_0x202c('0x17')]>0x0){_0x4dc1d8[_0x202c('0x56')](function(_0xc37e95){if(_0xc37e95===_0x59f613){_0x23e2c8['and']('i.'+_0x59f613+_0x202c('0x19'),[]['concat'](_0x3c524f[_0xc37e95]));}else if(_0xc37e95===_0x202c('0x57')){var _0x442b87=JSON[_0x202c('0x58')](_0x3c524f[_0xc37e95])[_0x202c('0x59')];var _0x541047=JSON[_0x202c('0x58')](_0x3c524f[_0xc37e95])[_0x202c('0x5a')];_0x23e2c8[_0x202c('0x40')](_0x202c('0x5b'),_0x442b87,_0x541047);}else{if(_0x3c524f[_0xc37e95]===_0x202c('0x5c')){_0x23e2c8[_0x202c('0x40')]('i.'+_0xc37e95+'\x20IS\x20NULL');}else{_0x23e2c8[_0x202c('0x40')]('i.'+_0xc37e95+_0x202c('0x5d'),_0x3c524f[_0xc37e95]);}}});}return _0x23e2c8;}function parseQueryParameters(_0xad7dbc,_0x385e34,_0x4b5110){var _0x52e87e=getSqlClauses();return Promise[_0x202c('0x5e')]()[_0x202c('0x5f')](function(){return parseModelFields(_0xad7dbc,_0x385e34,_0x4b5110);})[_0x202c('0x5f')](function(_0x3ded61){_0x52e87e[_0x202c('0x60')]['and'](_0x3ded61);return parseReadParameter(_0x385e34[_0x202c('0x3f')]);})[_0x202c('0x5f')](function(_0x3ce7ef){_0x52e87e[_0x202c('0x3f')][_0x202c('0x40')](_0x3ce7ef);return parseTagParameter(_0x385e34[_0x202c('0x61')]);})[_0x202c('0x5f')](function(_0x42812f){_0x52e87e[_0x202c('0x4d')][_0x202c('0x4c')][_0x202c('0x40')](_0x42812f);return parseSearchFilter(_0xad7dbc,_0x385e34['filter']);})[_0x202c('0x5f')](function(_0x349d19){_0x52e87e[_0x202c('0x62')]=_0x349d19;return _0x52e87e;});}function checkAccountsRestrictions(_0x81eef0,_0x4a6d90,_0x1649a8){var _0x139df5=utils[_0x202c('0x6')](_0x81eef0);var _0x12764a=_0x202c('0x63')+_['capitalize'](_0x81eef0)+(_0x81eef0===_0x202c('0x64')?_0x202c('0x65'):_0x202c('0x66'));var _0xa2fc9b=squel['expr']();return Promise[_0x202c('0x5e')]()[_0x202c('0x5f')](function(){if(_0x1649a8[_0x202c('0x9')]&&_0x4a6d90['role']===_0x202c('0x8')){return _0x4a6d90[_0x12764a]({'attributes':['id'],'raw':!![]});}})[_0x202c('0x5f')](function(_0x32b180){if(_0x32b180){if(_0x32b180['length']===0x0){_0xa2fc9b[_0x202c('0x40')]('i.'+_0x139df5+_0x202c('0x67'));}else{_0xa2fc9b[_0x202c('0x40')]('i.'+_0x139df5+_0x202c('0x19'),_['map'](_0x32b180,'id'));}}else if(!_0x1649a8[_0x139df5]){_0xa2fc9b[_0x202c('0x40')]('i.'+_0x139df5+'\x20IS\x20NOT\x20NULL');}})[_0x202c('0x5f')](function(){return _0xa2fc9b;});}function getClosedOrderClause(_0x2e2a8f,_0x3fd1f2){var _0x164b38='';var _0xea0c3e=[_0x202c('0x68'),'i.secondDisposition',_0x202c('0x69')];if(_0x2e2a8f===_0x202c('0x31')){_0xea0c3e[_0x202c('0x6a')]('i.substatus');}if(_0x3fd1f2['closed']==='0'&&_0x2e2a8f===_0x202c('0x31')){_0x164b38=_0x202c('0x6b');}else{if(_0x3fd1f2[_0x202c('0x6c')]==='1'){_0xea0c3e[_0x202c('0x6d')]();}_0x164b38=_0x202c('0x6e')+_0xea0c3e[_0x202c('0x6f')](',\x20')+')';}return _0x164b38;}function getFilteredInteractions(_0x433cec,_0x4bbe26,_0x5f5c25,_0x553331){var _0xe658d7=utils['getInteractionFK'](_0x433cec);var _0x13e369=_[_0x202c('0x70')](_0x433cec)+_0x202c('0x71');var _0x5d504f=[];var _0x5ef1dd=getTagsQuery();var _0x403b40={'type':db[_0x202c('0x72')][_0x202c('0x73')]['SELECT'],'raw':!![]};var _0x2c76b9=[];var _0x165787=[];return db[_0x202c('0x74')][_0x202c('0x75')](_0x5ef1dd[_0x202c('0x76')](),_0x403b40)['then'](function(_0x44e07f){_0x5d504f=_[_0x202c('0x77')](_0x44e07f,'id');_0x403b40=_[_0x202c('0x78')](_0x403b40,{'model':db[_0x13e369],'mapToModel':!![],'nest':!![]});if(_0x5f5c25[_0x202c('0x60')]){_0x553331[_0x202c('0x79')]['forEach'](function(_0x3b38f4){_0x4bbe26['field']('i.'+_0x3b38f4);});}else{_0x4bbe26[_0x202c('0xb')](_0x202c('0x7a'),_0x202c('0x3e'));_0x4bbe26['field']('a.key',_0x202c('0x7b'));_0x4bbe26['field'](_0x202c('0x7c'),_0x202c('0x7d'));if(_0x433cec===_0x202c('0x31')){_0x4bbe26[_0x202c('0xb')](_0x202c('0x7e'),_0x202c('0x7f'));_0x4bbe26[_0x202c('0xb')](_0x202c('0x80'),_0x202c('0x81'));_0x4bbe26[_0x202c('0xb')](_0x202c('0x82'));_0x4bbe26[_0x202c('0xb')]('i.createdAt');_0x4bbe26['field'](_0x202c('0x83'));_0x4bbe26['field'](_0x202c('0x84'));_0x4bbe26[_0x202c('0xb')](_0x202c('0x85'));_0x4bbe26[_0x202c('0xb')](_0x202c('0x86'));_0x4bbe26[_0x202c('0xb')](_0x202c('0x87'));_0x4bbe26[_0x202c('0xb')](_0x202c('0x88'));_0x4bbe26['field']('i.subject');_0x4bbe26[_0x202c('0xb')](_0x202c('0x69'));_0x4bbe26['field']('i.secondDisposition');_0x4bbe26['field']('i.thirdDisposition');_0x4bbe26[_0x202c('0xb')](_0x202c('0x6b'));_0x4bbe26[_0x202c('0xb')](_0x202c('0x89'));_0x4bbe26['field'](_0x202c('0x8a'));_0x4bbe26[_0x202c('0xb')](_0x202c('0x8b'));_0x4bbe26[_0x202c('0xb')](_0x202c('0x8c'));}else if(_0x433cec===_0x202c('0x2d')){_0x4bbe26[_0x202c('0xb')](_0x202c('0x8d'),_0x202c('0x81'));}else{_0x4bbe26['field'](_0x202c('0x8e'),_0x202c('0x81'));}if(_0x433cec!==_0x202c('0x31')){_0x4bbe26['field'](_0x202c('0x8f'));}_0x4bbe26[_0x202c('0xb')](_0x202c('0x90'),'Contact.firstName');_0x4bbe26['field'](_0x202c('0x91'),_0x202c('0x92'));_0x4bbe26[_0x202c('0xb')](_0x202c('0x93'),'Contact.email');_0x4bbe26[_0x202c('0xb')]('c.phone',_0x202c('0x94'));_0x4bbe26[_0x202c('0xb')](_0x202c('0x95'),_0x202c('0x96'));_0x4bbe26['field'](_0x202c('0x97'),_0x202c('0x98'));_0x4bbe26[_0x202c('0xb')]('o.fullname',_0x202c('0x99'));_0x4bbe26[_0x202c('0xb')](_0x202c('0x9a'),_0x202c('0x9b'));_0x4bbe26[_0x202c('0xb')](_0x202c('0x9c'),_0x202c('0x9d'));}if(_0x553331['limit']){_0x4bbe26[_0x202c('0x9e')](_0x553331[_0x202c('0x9e')]);}if(_0x553331[_0x202c('0x9f')]){_0x4bbe26[_0x202c('0x9f')](_0x553331[_0x202c('0x9f')]);}return db[_0x202c('0x74')][_0x202c('0x75')](_0x4bbe26[_0x202c('0x76')](),_0x403b40);})[_0x202c('0x5f')](function(_0xda0f61){_0x2c76b9=_0xda0f61;var _0x6949f5=getUsersQuery(_0x433cec,_0x2c76b9);return db[_0x202c('0x74')][_0x202c('0x75')](_0x6949f5[_0x202c('0x76')](),_0x403b40);})['then'](function(_0x4f9a7d){_0x165787=_['groupBy'](_0x4f9a7d,_0xe658d7);if(_0x433cec==='mail'){return db[_0x202c('0xa0')][_0x202c('0xa1')]({'attributes':['enableEmailPreview'],'raw':!![]});}})[_0x202c('0x5f')](function(_0x1b629f){var _0xad7c87=_0x1b629f?_0x1b629f[_0x202c('0xa2')]:undefined;var _0x3fa65b=_0x2c76b9[_0x202c('0x1a')](function(_0x2b0545){return updateInteraction(_0x2b0545,_0x5d504f,_0x165787,_0xad7c87);});return Promise[_0x202c('0xa3')](_0x3fa65b);});}function countFilteredInteractions(_0x3f4083,_0x4701cd){var _0x3b59be=_0x3f4083['clone']();_0x3b59be[_0x202c('0xb')](_0x202c('0xa4'));_0x3b59be[_0x202c('0xb')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x202c('0x3e'));var _0x4ed756=utils[_0x202c('0x26')](_0x4701cd);if(!_[_0x202c('0xa5')](_0x4ed756)){_0x3b59be[_0x202c('0x18')](_0x202c('0xa6'),_0x4ed756);}var _0x510db6={'type':db[_0x202c('0x72')][_0x202c('0x73')]['SELECT'],'raw':!![]};return db['sequelize'][_0x202c('0x75')](_0x3b59be[_0x202c('0x76')](),_0x510db6);}module[_0x202c('0xa7')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file diff --git a/server/components/interaction/update-interaction.js b/server/components/interaction/update-interaction.js index db0bcd7..b969655 100644 --- a/server/components/interaction/update-interaction.js +++ b/server/components/interaction/update-interaction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xba76=['waiting','talking','answered','total','disposition','abandoned','UserId','unmanaged','MailMessage','findOne','out','-id','then','plainBody','lastMsgText','trimStart','catch','TagIds','lodash','../../mysqldb','map','fullname','split','forEach'];(function(_0x3f2ec7,_0x1d55d3){var _0x10ca4c=function(_0x272fcd){while(--_0x272fcd){_0x3f2ec7['push'](_0x3f2ec7['shift']());}};_0x10ca4c(++_0x1d55d3);}(_0xba76,0x102));var _0x6ba7=function(_0x285cf0,_0x4dbd24){_0x285cf0=_0x285cf0-0x0;var _0x106441=_0xba76[_0x285cf0];return _0x106441;};'use strict';var _=require(_0x6ba7('0x0'));var db=require(_0x6ba7('0x1'))['db'];function getInteractionUsers(_0x5a4fd8,_0xf6ed52){return new Promise(function(_0x185edd,_0x3fd6d8){try{var _0x1c6986=[];if(_0xf6ed52[_0x5a4fd8]){_0x1c6986=_0xf6ed52[_0x5a4fd8][_0x6ba7('0x2')](function(_0x21df8a){return{'id':_0x21df8a['id'],'fullname':_0x21df8a[_0x6ba7('0x3')]};});}return _0x185edd(_0x1c6986);}catch(_0x428469){_0x3fd6d8(_0x428469);}});}function getInteractionTags(_0x1f498e,_0xb11c5f){var _0x5e9613=[];if(_0x1f498e){_0x1f498e[_0x6ba7('0x4')](',')[_0x6ba7('0x5')](function(_0xcef015){_0x5e9613['push'](_0xb11c5f[_0xcef015]);});}return _0x5e9613;}function updateWaitingCounter(_0x3cafc1){if(_0x3cafc1[_0x6ba7('0x6')]){_0x3cafc1[_0x6ba7('0x6')]-=0x1;}}function updateInteractionCounters(_0x2682d5){_0x2682d5['waiting']=0x0;_0x2682d5[_0x6ba7('0x7')]=0x0;_0x2682d5[_0x6ba7('0x8')]=0x0;_0x2682d5['unmanaged']=0x0;_0x2682d5['abandoned']=0x0;_0x2682d5[_0x6ba7('0x9')]=0x0;if(_0x2682d5['closed']){if(_0x2682d5[_0x6ba7('0xa')]===_0x6ba7('0xb')){_0x2682d5['abandoned']+=0x1;updateWaitingCounter(_0x2682d5);}if(_0x2682d5[_0x6ba7('0xc')]){_0x2682d5[_0x6ba7('0x8')]+=0x1;if(_0x2682d5['talking']){_0x2682d5['talking']-=0x1;}}else{if(_0x2682d5[_0x6ba7('0xa')]){_0x2682d5[_0x6ba7('0xd')]+=0x1;updateWaitingCounter(_0x2682d5);}}}else{if(!_0x2682d5[_0x6ba7('0xc')]){_0x2682d5['waiting']+=0x1;}if(_0x2682d5['UserId']){_0x2682d5[_0x6ba7('0x7')]+=0x1;updateWaitingCounter(_0x2682d5);}}_0x2682d5[_0x6ba7('0x9')]+=0x1;return _0x2682d5;}function getLastMessageText(_0x291166){return db[_0x6ba7('0xe')][_0x6ba7('0xf')]({'where':{'$and':[{'MailInteractionId':_0x291166['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x6ba7('0x10')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x6ba7('0x11'),'raw':!![]})[_0x6ba7('0x12')](function(_0x2dbcbc){if(_0x2dbcbc&&_0x2dbcbc[_0x6ba7('0x13')]){_0x291166[_0x6ba7('0x14')]=_[_0x6ba7('0x15')](_0x2dbcbc[_0x6ba7('0x13')]);}return _0x291166;})[_0x6ba7('0x16')](function(_0x50c23c){throw _0x50c23c;});}exports['updateInteraction']=function(_0x13c01e,_0x5492d7,_0x308486,_0x4cc171){return new Promise(function(_0x1a08c6,_0x998a77){return getInteractionUsers(_0x13c01e['id'],_0x308486)[_0x6ba7('0x12')](function(_0x5e659c){_0x13c01e['Users']=_0x5e659c;return getInteractionTags(_0x13c01e[_0x6ba7('0x17')],_0x5492d7);})[_0x6ba7('0x12')](function(_0xfa49fb){_0x13c01e['Tags']=_0xfa49fb;delete _0x13c01e[_0x6ba7('0x17')];return updateInteractionCounters(_0x13c01e);})[_0x6ba7('0x12')](function(_0x6bc460){if(_0x4cc171){return getLastMessageText(_0x6bc460);}else{return _0x6bc460;}})[_0x6ba7('0x12')](function(_0x1d5230){_0x1a08c6(_0x1d5230);})[_0x6ba7('0x16')](function(_0x5f2852){_0x998a77(_0x5f2852);});});}; \ No newline at end of file +var _0x539f=['push','waiting','talking','answered','abandoned','total','closed','disposition','UserId','unmanaged','MailMessage','findOne','out','plainBody','-id','then','lastMsgText','catch','updateInteraction','Users','TagIds','Tags','lodash','../../mysqldb','fullname','split','forEach'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x539f,0x1e1));var _0xf539=function(_0x1c88b6,_0x3c8356){_0x1c88b6=_0x1c88b6-0x0;var _0x256344=_0x539f[_0x1c88b6];return _0x256344;};'use strict';var _=require(_0xf539('0x0'));var db=require(_0xf539('0x1'))['db'];function getInteractionUsers(_0x19a218,_0x4589e6){return new Promise(function(_0x668b5,_0x69ae97){try{var _0x4f697f=[];if(_0x4589e6[_0x19a218]){_0x4f697f=_0x4589e6[_0x19a218]['map'](function(_0x51ea4b){return{'id':_0x51ea4b['id'],'fullname':_0x51ea4b[_0xf539('0x2')]};});}return _0x668b5(_0x4f697f);}catch(_0x4ad493){_0x69ae97(_0x4ad493);}});}function getInteractionTags(_0x21738a,_0x247755){var _0x1c118b=[];if(_0x21738a){_0x21738a[_0xf539('0x3')](',')[_0xf539('0x4')](function(_0xf8003e){_0x1c118b[_0xf539('0x5')](_0x247755[_0xf8003e]);});}return _0x1c118b;}function updateWaitingCounter(_0x98a363){if(_0x98a363['waiting']){_0x98a363['waiting']-=0x1;}}function updateInteractionCounters(_0x3d2e8b){_0x3d2e8b[_0xf539('0x6')]=0x0;_0x3d2e8b[_0xf539('0x7')]=0x0;_0x3d2e8b[_0xf539('0x8')]=0x0;_0x3d2e8b['unmanaged']=0x0;_0x3d2e8b[_0xf539('0x9')]=0x0;_0x3d2e8b[_0xf539('0xa')]=0x0;if(_0x3d2e8b[_0xf539('0xb')]){if(_0x3d2e8b[_0xf539('0xc')]===_0xf539('0x9')){_0x3d2e8b['abandoned']+=0x1;updateWaitingCounter(_0x3d2e8b);}if(_0x3d2e8b[_0xf539('0xd')]){_0x3d2e8b[_0xf539('0x8')]+=0x1;if(_0x3d2e8b[_0xf539('0x7')]){_0x3d2e8b[_0xf539('0x7')]-=0x1;}}else{if(_0x3d2e8b[_0xf539('0xc')]){_0x3d2e8b[_0xf539('0xe')]+=0x1;updateWaitingCounter(_0x3d2e8b);}}}else{if(!_0x3d2e8b[_0xf539('0xd')]){_0x3d2e8b[_0xf539('0x6')]+=0x1;}if(_0x3d2e8b[_0xf539('0xd')]){_0x3d2e8b[_0xf539('0x7')]+=0x1;updateWaitingCounter(_0x3d2e8b);}}_0x3d2e8b['total']+=0x1;return _0x3d2e8b;}function getLastMessageText(_0x18229b){return db[_0xf539('0xf')][_0xf539('0x10')]({'where':{'$and':[{'MailInteractionId':_0x18229b['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xf539('0x11')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xf539('0x12')],'order':_0xf539('0x13'),'raw':!![]})[_0xf539('0x14')](function(_0x40b538){if(_0x40b538&&_0x40b538['plainBody']){_0x18229b[_0xf539('0x15')]=_['trimStart'](_0x40b538[_0xf539('0x12')]);}return _0x18229b;})[_0xf539('0x16')](function(_0xf22d21){throw _0xf22d21;});}exports[_0xf539('0x17')]=function(_0x4ff641,_0x2ab212,_0x28f21a,_0x36d6ad){return new Promise(function(_0x53289d,_0x2b0085){return getInteractionUsers(_0x4ff641['id'],_0x28f21a)['then'](function(_0x436502){_0x4ff641[_0xf539('0x18')]=_0x436502;return getInteractionTags(_0x4ff641[_0xf539('0x19')],_0x2ab212);})['then'](function(_0x34efaa){_0x4ff641[_0xf539('0x1a')]=_0x34efaa;delete _0x4ff641[_0xf539('0x19')];return updateInteractionCounters(_0x4ff641);})[_0xf539('0x14')](function(_0x4f9e4c){if(_0x36d6ad){return getLastMessageText(_0x4f9e4c);}else{return _0x4f9e4c;}})['then'](function(_0x4eda47){_0x53289d(_0x4eda47);})[_0xf539('0x16')](function(_0x933d99){_0x2b0085(_0x933d99);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index f8f97a3..8677a45 100644 --- a/server/components/interaction/utils.js +++ b/server/components/interaction/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcf1a=['role','null','Interaction','findOne','then','update','info','error','exports','lodash','../../mysqldb','openchannel-interactions','../../config/logger','mail-interactions','fax-interactions','sms-interactions','whatsapp-interactions','capitalize','chat','Website','InteractionId','upperFirst','websites','accounts','_interactions','_interaction_has_tags','_messages','toUpperCase','name'];(function(_0x2feb52,_0x9f27d7){var _0x30225a=function(_0x4d8973){while(--_0x4d8973){_0x2feb52['push'](_0x2feb52['shift']());}};_0x30225a(++_0x9f27d7);}(_0xcf1a,0x148));var _0xacf1=function(_0x4e1eac,_0x258749){_0x4e1eac=_0x4e1eac-0x0;var _0x2994db=_0xcf1a[_0x4e1eac];return _0x2994db;};'use strict';var _=require(_0xacf1('0x0'));var db=require(_0xacf1('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')(_0xacf1('0x2')),'mail':require(_0xacf1('0x3'))(_0xacf1('0x4')),'fax':require(_0xacf1('0x3'))(_0xacf1('0x5')),'sms':require('../../config/logger')(_0xacf1('0x6')),'chat':require(_0xacf1('0x3'))('chat-interactions'),'whatsapp':require(_0xacf1('0x3'))(_0xacf1('0x7'))};function getAccountFK(_0x502e29){return _[_0xacf1('0x8')](_0x502e29)+(_0x502e29===_0xacf1('0x9')?_0xacf1('0xa'):'Account')+'Id';}function getInteractionFK(_0x4f73f2){return _[_0xacf1('0x8')](_0x4f73f2)+_0xacf1('0xb');}function getInteractionId(_0x52f548,_0x3c0113,_0x360eac){if(_0x52f548&&_0x52f548[_['upperFirst'](_0x360eac)+_0xacf1('0xb')]){return _0x52f548[_[_0xacf1('0xc')](_0x360eac)+_0xacf1('0xb')];}else if(_0x52f548&&_0x52f548['id']){return _0x52f548['id'];}else if(_0x3c0113&&_0x3c0113['id']){return _0x3c0113['id'];}else{return'unknown';}}function getInteractionsTables(_0x104363){return{'accounts':_0x104363+'_'+(_0x104363==='chat'?_0xacf1('0xd'):_0xacf1('0xe')),'interactions':_0x104363+_0xacf1('0xf'),'interactionsTags':_0x104363+_0xacf1('0x10'),'messages':_0x104363+_0xacf1('0x11'),'userInteractions':'user_has_'+_0x104363+'_interactions'};}function getSelectedTags(_0x3b3e0f){var _0x1c8ef1=[];if(_0x3b3e0f){_0x1c8ef1=Array['isArray'](_0x3b3e0f)?_0x3b3e0f:[_0x3b3e0f];}return _0x1c8ef1;}function log(_0x6f2ace,_0x19f00c,_0x141cd8,_0x4600b3,_0x33594e,_0x4c9785){loggers[_0x33594e['toLowerCase']()][_0x6f2ace]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4c9785[_0xacf1('0x12')](),_0x19f00c?_0x19f00c['id']:null,_0x19f00c?_0x19f00c[_0xacf1('0x13')]:null,_0x19f00c?_0x19f00c[_0xacf1('0x14')]:null,getInteractionId(_0x141cd8,_0x4600b3,_0x33594e),_0x141cd8?JSON['stringify'](_0x141cd8):_0xacf1('0x15'));}function updateUser(_0x49405b,_0x33969a,_0x1b270a,_0x2389c2,_0xa6126){db[_[_0xacf1('0xc')](_0x2389c2)+_0xacf1('0x16')][_0xacf1('0x17')]({'where':{'id':getInteractionId(_0x33969a,_0x1b270a,_0x2389c2)}})[_0xacf1('0x18')](function(_0x388247){if(_0x388247){return _0x388247[_0xacf1('0x19')]({'UserId':_0x49405b?_0x49405b['id']:null});}})[_0xacf1('0x18')](function(_0x1bff0c){if(_0x1bff0c){log(_0xacf1('0x1a'),_0x49405b,_0x33969a,_0x1b270a,_0x2389c2,_0xa6126);}})['catch'](function(){log(_0xacf1('0x1b'),_0x49405b,_0x33969a,_0x1b270a,_0x2389c2,_0xa6126);});}module[_0xacf1('0x1c')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x4aa0=['capitalize','Website','Account','InteractionId','upperFirst','unknown','chat','websites','accounts','_interactions','_interaction_has_tags','user_has_','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','Interaction','findOne','update','then','exports','lodash','../../mysqldb','openchannel-interactions','../../config/logger','fax-interactions'];(function(_0x13d18b,_0x58777b){var _0x597a36=function(_0x50bde9){while(--_0x50bde9){_0x13d18b['push'](_0x13d18b['shift']());}};_0x597a36(++_0x58777b);}(_0x4aa0,0x82));var _0x04aa=function(_0x291faa,_0x459b5a){_0x291faa=_0x291faa-0x0;var _0x19788e=_0x4aa0[_0x291faa];return _0x19788e;};'use strict';var _=require(_0x04aa('0x0'));var db=require(_0x04aa('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')(_0x04aa('0x2')),'mail':require(_0x04aa('0x3'))('mail-interactions'),'fax':require(_0x04aa('0x3'))(_0x04aa('0x4')),'sms':require(_0x04aa('0x3'))('sms-interactions'),'chat':require(_0x04aa('0x3'))('chat-interactions'),'whatsapp':require(_0x04aa('0x3'))('whatsapp-interactions')};function getAccountFK(_0x533349){return _[_0x04aa('0x5')](_0x533349)+(_0x533349==='chat'?_0x04aa('0x6'):_0x04aa('0x7'))+'Id';}function getInteractionFK(_0x1f7be4){return _[_0x04aa('0x5')](_0x1f7be4)+_0x04aa('0x8');}function getInteractionId(_0x1ffb11,_0x3a88e7,_0x1f7da1){if(_0x1ffb11&&_0x1ffb11[_[_0x04aa('0x9')](_0x1f7da1)+_0x04aa('0x8')]){return _0x1ffb11[_['upperFirst'](_0x1f7da1)+_0x04aa('0x8')];}else if(_0x1ffb11&&_0x1ffb11['id']){return _0x1ffb11['id'];}else if(_0x3a88e7&&_0x3a88e7['id']){return _0x3a88e7['id'];}else{return _0x04aa('0xa');}}function getInteractionsTables(_0x53af10){return{'accounts':_0x53af10+'_'+(_0x53af10===_0x04aa('0xb')?_0x04aa('0xc'):_0x04aa('0xd')),'interactions':_0x53af10+_0x04aa('0xe'),'interactionsTags':_0x53af10+_0x04aa('0xf'),'messages':_0x53af10+'_messages','userInteractions':_0x04aa('0x10')+_0x53af10+'_interactions'};}function getSelectedTags(_0x2223c3){var _0x55b708=[];if(_0x2223c3){_0x55b708=Array[_0x04aa('0x11')](_0x2223c3)?_0x2223c3:[_0x2223c3];}return _0x55b708;}function log(_0x10c031,_0x42065e,_0x484bd8,_0x28ccf9,_0x4b3986,_0x230863){loggers[_0x4b3986[_0x04aa('0x12')]()][_0x10c031](_0x04aa('0x13'),_0x230863[_0x04aa('0x14')](),_0x42065e?_0x42065e['id']:null,_0x42065e?_0x42065e[_0x04aa('0x15')]:null,_0x42065e?_0x42065e['role']:null,getInteractionId(_0x484bd8,_0x28ccf9,_0x4b3986),_0x484bd8?JSON['stringify'](_0x484bd8):'null');}function updateUser(_0x270b35,_0x1f1319,_0x4d5e18,_0x109d01,_0x9a88a){db[_[_0x04aa('0x9')](_0x109d01)+_0x04aa('0x16')][_0x04aa('0x17')]({'where':{'id':getInteractionId(_0x1f1319,_0x4d5e18,_0x109d01)}})['then'](function(_0x41334e){if(_0x41334e){return _0x41334e[_0x04aa('0x18')]({'UserId':_0x270b35?_0x270b35['id']:null});}})[_0x04aa('0x19')](function(_0x1d0a9c){if(_0x1d0a9c){log('info',_0x270b35,_0x1f1319,_0x4d5e18,_0x109d01,_0x9a88a);}})['catch'](function(){log('error',_0x270b35,_0x1f1319,_0x4d5e18,_0x109d01,_0x9a88a);});}module[_0x04aa('0x1a')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index fc06fa0..37d0975 100644 --- a/server/components/license/service.js +++ b/server/components/license/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcbde=['../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','utf8','hasOwnProperty','use','License','findOne','then','count','status','json','catch','users','User','admin','user','isUserLimit','crypto','composable-middleware','../../mysqldb'];(function(_0x3d1bd2,_0x51ffe1){var _0x574ee4=function(_0xc1980e){while(--_0xc1980e){_0x3d1bd2['push'](_0x3d1bd2['shift']());}};_0x574ee4(++_0x51ffe1);}(_0xcbde,0x141));var _0xecbd=function(_0x54b1d5,_0x373761){_0x54b1d5=_0x54b1d5-0x0;var _0x469ba9=_0xcbde[_0x54b1d5];return _0x469ba9;};'use strict';var crypto=require(_0xecbd('0x0'));var util=require('util');var compose=require(_0xecbd('0x1'));var db=require(_0xecbd('0x2'))['db'];var config=require(_0xecbd('0x3'));function getValueFromLicense(_0x456f7f,_0x1a4c26){if(_0x456f7f&&_0x1a4c26){if(_0x1a4c26['data1']&&_0x1a4c26['license']){var _0x12470a=_0x1a4c26[_0xecbd('0x4')];var _0x566536=_0x1a4c26[_0xecbd('0x5')];var _0x27a04d=_0x12470a['split']('-')[0x4];var _0x5d1ba5=_0x12470a[_0xecbd('0x6')]('-')[0x0];var _0x3e9e7a=crypto[_0xecbd('0x7')](_0xecbd('0x8'),util[_0xecbd('0x9')](_0xecbd('0xa'),_0x27a04d,_0x12470a,_0x5d1ba5));var _0x493b24=_0x3e9e7a[_0xecbd('0xb')](_0x566536,'base64',_0xecbd('0xc'));_0x493b24+=_0x3e9e7a['final']('utf8');var _0x3ddb13=JSON['parse'](_0x493b24);return _0x3ddb13[_0xecbd('0xd')](_0x456f7f)?_0x3ddb13[_0x456f7f]:null;}}return null;}function isLimit(_0x24ec82,_0x4cd06f,_0x3c6429,_0x444a88){var _0x447856=_0x4cd06f;return compose()[_0xecbd('0xe')](function(_0x27c02a,_0x2ba71e,_0x1f4122){return db[_0xecbd('0xf')][_0xecbd('0x10')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0xc7bb2b){var _0x1607ec=getValueFromLicense(_0x24ec82,_0xc7bb2b);return _0x1607ec?_0x1607ec:_0x447856;})[_0xecbd('0x11')](function(_0x3805a){_0x447856=_0x3805a;return _0x3c6429[_0xecbd('0x12')](_0x444a88);})[_0xecbd('0x11')](function(_0x26d4c4){if(_0x26d4c4>=_0x447856){return _0x2ba71e[_0xecbd('0x13')](0x193)[_0xecbd('0x14')]({'message':util[_0xecbd('0x9')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x24ec82)});}_0x1f4122();})[_0xecbd('0x15')](function(_0x57c160){_0x1f4122(_0x57c160);});});}function isUserLimit(){return isLimit(_0xecbd('0x16'),0x1,db[_0xecbd('0x17')],{'where':{'$or':[{'role':_0xecbd('0x18')},{'role':_0xecbd('0x19')}]}});}exports[_0xecbd('0x1a')]=isUserLimit; \ No newline at end of file +var _0x7e69=['../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','update','base64','final','utf8','hasOwnProperty','use','License','findOne','then','count','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','user','crypto','util','composable-middleware','../../mysqldb'];(function(_0x39c439,_0x35bab7){var _0x16469f=function(_0x59d364){while(--_0x59d364){_0x39c439['push'](_0x39c439['shift']());}};_0x16469f(++_0x35bab7);}(_0x7e69,0x64));var _0x97e6=function(_0x35cc99,_0x5bb972){_0x35cc99=_0x35cc99-0x0;var _0x14373c=_0x7e69[_0x35cc99];return _0x14373c;};'use strict';var crypto=require(_0x97e6('0x0'));var util=require(_0x97e6('0x1'));var compose=require(_0x97e6('0x2'));var db=require(_0x97e6('0x3'))['db'];var config=require(_0x97e6('0x4'));function getValueFromLicense(_0x2bde74,_0x26a223){if(_0x2bde74&&_0x26a223){if(_0x26a223[_0x97e6('0x5')]&&_0x26a223[_0x97e6('0x6')]){var _0x4e4241=_0x26a223[_0x97e6('0x5')];var _0x5a604d=_0x26a223[_0x97e6('0x6')];var _0x2c6308=_0x4e4241[_0x97e6('0x7')]('-')[0x4];var _0x1d2c69=_0x4e4241['split']('-')[0x0];var _0x3e01ea=crypto[_0x97e6('0x8')](_0x97e6('0x9'),util[_0x97e6('0xa')]('%s:%s:%s',_0x2c6308,_0x4e4241,_0x1d2c69));var _0x23eb9b=_0x3e01ea[_0x97e6('0xb')](_0x5a604d,_0x97e6('0xc'),'utf8');_0x23eb9b+=_0x3e01ea[_0x97e6('0xd')](_0x97e6('0xe'));var _0x56165a=JSON['parse'](_0x23eb9b);return _0x56165a[_0x97e6('0xf')](_0x2bde74)?_0x56165a[_0x2bde74]:null;}}return null;}function isLimit(_0x401a6d,_0x2120df,_0x5a9601,_0x22feb5){var _0x1c5b42=_0x2120df;return compose()[_0x97e6('0x10')](function(_0x2f868a,_0x4a6f85,_0x4bb124){return db[_0x97e6('0x11')][_0x97e6('0x12')]({'where':{'id':0x1},'raw':!![]})[_0x97e6('0x13')](function(_0x5e4b7a){var _0xcfbdd1=getValueFromLicense(_0x401a6d,_0x5e4b7a);return _0xcfbdd1?_0xcfbdd1:_0x1c5b42;})['then'](function(_0x319150){_0x1c5b42=_0x319150;return _0x5a9601[_0x97e6('0x14')](_0x22feb5);})[_0x97e6('0x13')](function(_0xc5a30f){if(_0xc5a30f>=_0x1c5b42){return _0x4a6f85['status'](0x193)[_0x97e6('0x15')]({'message':util['format'](_0x97e6('0x16'),_0x401a6d)});}_0x4bb124();})[_0x97e6('0x17')](function(_0x44bb8c){_0x4bb124(_0x44bb8c);});});}function isUserLimit(){return isLimit(_0x97e6('0x18'),0x1,db['User'],{'where':{'$or':[{'role':'admin'},{'role':_0x97e6('0x19')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 09a55bb..dbdc5b3 100644 --- a/server/components/parsers/advancedSearch.js +++ b/server/components/parsers/advancedSearch.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5367=['match','filter','indexOf','map','conditions','push','buildExpression','DATE','$eq','operator','value','includes','$lte','days','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','>\x20?','<=\x20?','$gte','$between','start','utcOffset','format','add','hours','seconds','lodash','parseSearch','sqlOperator','startsWith','[$or]','and','replace','split','length','slice','forEach','shift'];(function(_0x21417b,_0xdee074){var _0x2342f7=function(_0x3e9850){while(--_0x3e9850){_0x21417b['push'](_0x21417b['shift']());}};_0x2342f7(++_0xdee074);}(_0x5367,0xd4));var _0x7536=function(_0x4c97d2,_0x52c766){_0x4c97d2=_0x4c97d2-0x0;var _0x493766=_0x5367[_0x4c97d2];return _0x493766;};'use strict';var _=require(_0x7536('0x0'));var moment=require('moment');exports[_0x7536('0x1')]=function(_0x3a03ba){var _0x3ab11a={'conditions':[]};_0x3ab11a[_0x7536('0x2')]=_[_0x7536('0x3')](_0x3a03ba,_0x7536('0x4'))?'or':_0x7536('0x5');var _0x137467=_0x3a03ba[_0x7536('0x6')]('[$and]','')['replace'](_0x7536('0x4'),'')[_0x7536('0x7')]('||');for(var _0x515457=0x0;_0x515457<_0x137467[_0x7536('0x8')];_0x515457++){var _0x30bfd3=_0x137467[_0x515457][_0x7536('0x7')](':=');var _0x368e8c=_0x30bfd3[0x0];var _0x5943b5=_0x30bfd3[_0x7536('0x9')](0x1);_0x5943b5[_0x7536('0xa')](function(_0x4e0d71){var _0x4a98d7=_0x4e0d71[_0x7536('0x7')]('[')[_0x7536('0xb')]();var _0x8245e9=_0x4e0d71[_0x7536('0xc')](/\[(.*?)\]/g);_0x8245e9[_0x7536('0xa')](function(_0x26822e){var _0x254cb3=_0x26822e[_0x7536('0x7')]('[')[_0x7536('0xd')](function(_0x566eea){return _0x566eea[_0x7536('0xe')](']')>-0x1;})[_0x7536('0xf')](function(_0x2dadb1){return _0x2dadb1['split'](']')[0x0];})[0x0];_0x3ab11a[_0x7536('0x10')][_0x7536('0x11')]({'field':_0x368e8c,'operator':_0x4a98d7,'value':_0x254cb3});});});}return _0x3ab11a;};exports[_0x7536('0x12')]=function(_0x41aec5,_0x4b919c,_0x336d28){var _0x36b9f9={};if(_0x4b919c===_0x7536('0x13')){if(_0x336d28['operator']===_0x7536('0x14')){_0x336d28[_0x7536('0x15')]='$between';_0x336d28[_0x7536('0x16')]+=','+_0x336d28[_0x7536('0x16')];}else if(_[_0x7536('0x17')](['$gt',_0x7536('0x18')],_0x336d28[_0x7536('0x15')])){_0x336d28[_0x7536('0x16')]=moment(_0x336d28[_0x7536('0x16')])['add'](0x1,_0x7536('0x19'))['format'](_0x7536('0x1a'));}}if(_0x336d28['castTo']){_0x4b919c=_0x336d28[_0x7536('0x1b')];_0x36b9f9[_0x7536('0x1c')]=_0x7536('0x1d')+_0x41aec5+'.'+_0x336d28[_0x7536('0x1e')]+_0x7536('0x1f')+_0x336d28[_0x7536('0x1b')]+')\x20'+parseOperator(_0x336d28[_0x7536('0x15')]);}else{_0x36b9f9[_0x7536('0x1c')]=_0x41aec5+'.'+_0x336d28['field']+'\x20'+parseOperator(_0x336d28['operator']);}if(_[_0x7536('0x17')]([_0x7536('0x20'),_0x7536('0x21')],_0x336d28[_0x7536('0x15')]))_0x36b9f9[_0x7536('0x1c')]='('+_0x36b9f9['text']+_0x7536('0x22')+_0x41aec5+'.'+_0x336d28[_0x7536('0x1e')]+_0x7536('0x23');_0x36b9f9[_0x7536('0x16')]=parseValue(_0x4b919c,_0x336d28[_0x7536('0x15')],_0x336d28[_0x7536('0x16')]);return _0x36b9f9;};function parseOperator(_0x488858){var _0xe11268;switch(_0x488858){case _0x7536('0x24'):_0xe11268=_0x7536('0x25');break;case _0x7536('0x21'):_0xe11268=_0x7536('0x26');break;case _0x7536('0x14'):_0xe11268=_0x7536('0x27');break;case _0x7536('0x20'):_0xe11268=_0x7536('0x28');break;case _0x7536('0x29'):case _0x7536('0x2a'):case _0x7536('0x2b'):_0xe11268=_0x7536('0x2c');break;case _0x7536('0x2d'):_0xe11268='<\x20?';break;case'$gt':_0xe11268=_0x7536('0x2e');break;case _0x7536('0x18'):_0xe11268=_0x7536('0x2f');break;case _0x7536('0x30'):_0xe11268='>=\x20?';break;case _0x7536('0x31'):_0xe11268='BETWEEN\x20?\x20AND\x20?';break;}return _0xe11268;}function parseValue(_0x7a7225,_0x44716f,_0x4274cf){var _0x12efd3={'start':undefined,'end':undefined};switch(_0x44716f){case _0x7536('0x24'):case _0x7536('0x21'):_0x12efd3['start']=_0x4274cf[_0x7536('0x7')](',');break;case _0x7536('0x29'):_0x12efd3[_0x7536('0x32')]='%'+_0x4274cf+'%';break;case'$startsWith':_0x12efd3[_0x7536('0x32')]=_0x4274cf+'%';break;case _0x7536('0x2b'):_0x12efd3[_0x7536('0x32')]='%'+_0x4274cf;break;case _0x7536('0x31'):var _0x4ee1f8=_0x4274cf['split'](',');var _0x4274cf=_0x4ee1f8['shift']();var _0x1f7f58=_0x4ee1f8['pop']();if(_0x7a7225===_0x7536('0x13')){_0x4274cf=moment(_0x4274cf)[_0x7536('0x33')](0x0,!![])[_0x7536('0x34')]();_0x1f7f58=moment(_0x1f7f58)[_0x7536('0x33')](0x0,!![])[_0x7536('0x35')](0x17,_0x7536('0x36'))[_0x7536('0x35')](0x3b,'minutes')['add'](0x3b,_0x7536('0x37'))[_0x7536('0x34')]();}_0x12efd3={'start':_0x4274cf,'end':_0x1f7f58};break;default:_0x12efd3[_0x7536('0x32')]=_0x4274cf;break;}return _0x12efd3;} \ No newline at end of file +var _0xc747=['$in','start','pop','utcOffset','format','hours','minutes','lodash','sqlOperator','startsWith','and','replace','[$or]','split','slice','forEach','shift','match','filter','indexOf','map','conditions','push','DATE','operator','$eq','value','$gt','$lte','add','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$notIn','IN\x20?','NOT\x20IN\x20?','$ne','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','<\x20?','<=\x20?','$between','BETWEEN\x20?\x20AND\x20?'];(function(_0x578432,_0x285e37){var _0x431952=function(_0x42c544){while(--_0x42c544){_0x578432['push'](_0x578432['shift']());}};_0x431952(++_0x285e37);}(_0xc747,0x15e));var _0x7c74=function(_0x237c45,_0x55cf99){_0x237c45=_0x237c45-0x0;var _0x2942f6=_0xc747[_0x237c45];return _0x2942f6;};'use strict';var _=require(_0x7c74('0x0'));var moment=require('moment');exports['parseSearch']=function(_0x49b094){var _0x24b0a7={'conditions':[]};_0x24b0a7[_0x7c74('0x1')]=_[_0x7c74('0x2')](_0x49b094,'[$or]')?'or':_0x7c74('0x3');var _0x13cf39=_0x49b094[_0x7c74('0x4')]('[$and]','')[_0x7c74('0x4')](_0x7c74('0x5'),'')[_0x7c74('0x6')]('||');for(var _0x19abfa=0x0;_0x19abfa<_0x13cf39['length'];_0x19abfa++){var _0x1549af=_0x13cf39[_0x19abfa][_0x7c74('0x6')](':=');var _0x4c6143=_0x1549af[0x0];var _0x3fd79e=_0x1549af[_0x7c74('0x7')](0x1);_0x3fd79e[_0x7c74('0x8')](function(_0x219b0e){var _0x38b062=_0x219b0e[_0x7c74('0x6')]('[')[_0x7c74('0x9')]();var _0x16e825=_0x219b0e[_0x7c74('0xa')](/\[(.*?)\]/g);_0x16e825[_0x7c74('0x8')](function(_0xe269cc){var _0x187514=_0xe269cc[_0x7c74('0x6')]('[')[_0x7c74('0xb')](function(_0x51fe42){return _0x51fe42[_0x7c74('0xc')](']')>-0x1;})[_0x7c74('0xd')](function(_0xb63b66){return _0xb63b66[_0x7c74('0x6')](']')[0x0];})[0x0];_0x24b0a7[_0x7c74('0xe')][_0x7c74('0xf')]({'field':_0x4c6143,'operator':_0x38b062,'value':_0x187514});});});}return _0x24b0a7;};exports['buildExpression']=function(_0x47dd6e,_0xfa0a1e,_0x51d85d){var _0x327f7a={};if(_0xfa0a1e===_0x7c74('0x10')){if(_0x51d85d[_0x7c74('0x11')]===_0x7c74('0x12')){_0x51d85d[_0x7c74('0x11')]='$between';_0x51d85d[_0x7c74('0x13')]+=','+_0x51d85d[_0x7c74('0x13')];}else if(_['includes']([_0x7c74('0x14'),_0x7c74('0x15')],_0x51d85d[_0x7c74('0x11')])){_0x51d85d[_0x7c74('0x13')]=moment(_0x51d85d[_0x7c74('0x13')])[_0x7c74('0x16')](0x1,'days')['format'](_0x7c74('0x17'));}}if(_0x51d85d['castTo']){_0xfa0a1e=_0x51d85d[_0x7c74('0x18')];_0x327f7a[_0x7c74('0x19')]=_0x7c74('0x1a')+_0x47dd6e+'.'+_0x51d85d[_0x7c74('0x1b')]+_0x7c74('0x1c')+_0x51d85d['castTo']+')\x20'+parseOperator(_0x51d85d[_0x7c74('0x11')]);}else{_0x327f7a[_0x7c74('0x19')]=_0x47dd6e+'.'+_0x51d85d[_0x7c74('0x1b')]+'\x20'+parseOperator(_0x51d85d[_0x7c74('0x11')]);}if(_['includes'](['$ne',_0x7c74('0x1d')],_0x51d85d['operator']))_0x327f7a[_0x7c74('0x19')]='('+_0x327f7a[_0x7c74('0x19')]+'\x20OR\x20'+_0x47dd6e+'.'+_0x51d85d['field']+'\x20IS\x20NULL)';_0x327f7a[_0x7c74('0x13')]=parseValue(_0xfa0a1e,_0x51d85d[_0x7c74('0x11')],_0x51d85d[_0x7c74('0x13')]);return _0x327f7a;};function parseOperator(_0x1f6455){var _0x15c2bb;switch(_0x1f6455){case'$in':_0x15c2bb=_0x7c74('0x1e');break;case _0x7c74('0x1d'):_0x15c2bb=_0x7c74('0x1f');break;case'$eq':_0x15c2bb='=\x20?';break;case _0x7c74('0x20'):_0x15c2bb=_0x7c74('0x21');break;case _0x7c74('0x22'):case _0x7c74('0x23'):case _0x7c74('0x24'):_0x15c2bb=_0x7c74('0x25');break;case'$lt':_0x15c2bb=_0x7c74('0x26');break;case _0x7c74('0x14'):_0x15c2bb='>\x20?';break;case'$lte':_0x15c2bb=_0x7c74('0x27');break;case'$gte':_0x15c2bb='>=\x20?';break;case _0x7c74('0x28'):_0x15c2bb=_0x7c74('0x29');break;}return _0x15c2bb;}function parseValue(_0x6aa198,_0x39a244,_0x1d686f){var _0x18bb98={'start':undefined,'end':undefined};switch(_0x39a244){case _0x7c74('0x2a'):case _0x7c74('0x1d'):_0x18bb98[_0x7c74('0x2b')]=_0x1d686f[_0x7c74('0x6')](',');break;case _0x7c74('0x22'):_0x18bb98[_0x7c74('0x2b')]='%'+_0x1d686f+'%';break;case'$startsWith':_0x18bb98['start']=_0x1d686f+'%';break;case'$endsWith':_0x18bb98[_0x7c74('0x2b')]='%'+_0x1d686f;break;case _0x7c74('0x28'):var _0x157173=_0x1d686f[_0x7c74('0x6')](',');var _0x1d686f=_0x157173['shift']();var _0x183236=_0x157173[_0x7c74('0x2c')]();if(_0x6aa198===_0x7c74('0x10')){_0x1d686f=moment(_0x1d686f)[_0x7c74('0x2d')](0x0,!![])[_0x7c74('0x2e')]();_0x183236=moment(_0x183236)[_0x7c74('0x2d')](0x0,!![])[_0x7c74('0x16')](0x17,_0x7c74('0x2f'))[_0x7c74('0x16')](0x3b,_0x7c74('0x30'))[_0x7c74('0x16')](0x3b,'seconds')[_0x7c74('0x2e')]();}_0x18bb98={'start':_0x1d686f,'end':_0x183236};break;default:_0x18bb98[_0x7c74('0x2b')]=_0x1d686f;break;}return _0x18bb98;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 4eb70b2..28d83af 100644 --- a/server/components/parsers/qs.js +++ b/server/components/parsers/qs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x528f=['VIRTUAL','merge','options','include','includeAll','sequelize','moment','../../mysqldb','parse','includes','keys','model','fields','split','filters','isEmpty','find','type','DATE','isPlainObject','format','YYYY-MM-DD','utc','$lte','subtract','name','limit','offset','sort','map','indexOf','priority','cast','unsigned','substr','DESC','omit','length','isArray','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','\x22{EXPR}\x22','{EXPR}','forEach','push','replace','join','getOptions','query','$id','intersection','attributes','nolimit','order','where','filter','columns','value'];(function(_0x11fc04,_0x3a532b){var _0x2b30b2=function(_0x4961a5){while(--_0x4961a5){_0x11fc04['push'](_0x11fc04['shift']());}};_0x2b30b2(++_0x3a532b);}(_0x528f,0x140));var _0xf528=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x528f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var sequelize=require(_0xf528('0x0'));var moment=require(_0xf528('0x1'));var db=require(_0xf528('0x2'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x42142d){var _0x413c72=['ne'];try{var _0x5a32b9=JSON[_0xf528('0x3')](_0x42142d);var _0x4c9c0e=Object['keys'](_0x5a32b9)[0x0];return _0x413c72[_0xf528('0x4')](_0x4c9c0e);}catch(_0x491271){return![];}}function getOperatorValue(_0x2a4f5b){var _0x17c8c8=JSON['parse'](_0x2a4f5b);var _0x31b491=Object[_0xf528('0x5')](_0x17c8c8)[0x0];var _0x1b6bfd=_0x17c8c8[_0x31b491];return{['$'+_0x31b491]:_0x1b6bfd};}function parseIncludeModel(_0x2b3ee6){var _0x50be2d=JSON['parse'](_0x2b3ee6);return{'model':db[_0x50be2d[_0xf528('0x6')]],'as':_0x50be2d['alias'],'attributes':_0x50be2d[_0xf528('0x7')],'raw':_0x50be2d['raw']};}exports['fields']=function(_0x1d73ef){var _0x5a99b3=null;if(_0x1d73ef){_0x5a99b3=_0x1d73ef[_0xf528('0x8')](',');}return _0x5a99b3;};exports[_0xf528('0x9')]=function(_0x45b461,_0x2e8340){var _0xc2b1e2={};if(!_[_0xf528('0xa')](_0x45b461)){_['forOwn'](_0x45b461,function(_0x3ee03d,_0x3bf503){try{if(_0x2e8340){var _0x16e01c=_[_0xf528('0xb')](_0x2e8340,{'name':_0x3bf503})||{};if(hasSequelizeOperator(_0x3ee03d)){_0xc2b1e2[_0x3bf503]=getOperatorValue(_0x3ee03d);}else if(_0x16e01c[_0xf528('0xc')]===_0xf528('0xd')&&_[_0xf528('0xe')](_0x3ee03d)){var _0x34d797=JSON[_0xf528('0x3')](_0x3ee03d);var _0x155fe6={'$gte':moment(moment(_0x34d797['$gte'])[_0xf528('0xf')](_0xf528('0x10')))[_0xf528('0x11')]()[_0xf528('0xf')](),'$lte':moment(moment(_0x34d797[_0xf528('0x12')])[_0xf528('0xf')]('YYYY-MM-DD'))['utc']()[_0xf528('0x13')](0x1,'s')[_0xf528('0xf')]()};_0xc2b1e2[_0x3bf503]=_0x155fe6;}else if(_0x16e01c[_0xf528('0x14')]==='uniqueid'){_0xc2b1e2[_0x3bf503]=_0x3ee03d;}else{_0xc2b1e2[_0x3bf503]=_['isArray'](_0x3ee03d)?_0x3ee03d:JSON[_0xf528('0x3')](_0x3ee03d);}}else{_0xc2b1e2[_0x3bf503]=_['isArray'](_0x3ee03d)?_0x3ee03d:JSON[_0xf528('0x3')](_0x3ee03d);}}catch(_0x208d9b){_0xc2b1e2[_0x3bf503]=_0x3ee03d[_0xf528('0x8')](',');}});}return _0xc2b1e2;};exports[_0xf528('0x15')]=function(_0x11263d){_0x11263d=parseInt(_0x11263d,0xa);if(!_0x11263d||_0x11263d<0x0){_0x11263d=LIMIT_VALUE;}return _0x11263d;};exports[_0xf528('0x16')]=function(_0x31beb5){_0x31beb5=parseInt(_0x31beb5,0xa);if(!_0x31beb5||_0x31beb5<0x0){_0x31beb5=0x0;}return _0x31beb5;};exports[_0xf528('0x17')]=function(_0x4ba4cb){var _0x3540b0,_0x13db73=null;if(_0x4ba4cb){_0x3540b0=_0x4ba4cb[_0xf528('0x8')](',');_0x13db73=_[_0xf528('0x18')](_0x3540b0,function(_0x47815e){if(_0x47815e[_0xf528('0x19')]('-')===0x0){return[_0x47815e===_0xf528('0x1a')?sequelize[_0xf528('0x1b')](sequelize['col'](_0xf528('0x1a')),_0xf528('0x1c')):_0x47815e[_0xf528('0x1d')](0x1),_0xf528('0x1e')];}else{return[_0x47815e===_0xf528('0x1a')?sequelize[_0xf528('0x1b')](sequelize['col'](_0xf528('0x1a')),_0xf528('0x1c')):_0x47815e,'ASC'];}});}return _0x13db73;};exports[_0xf528('0x1f')]=function(_0xe5d90c,_0x4cac59){if(_[_0xf528('0xa')](_0xe5d90c)){return _0xe5d90c;}if(_['isArray'](_0xe5d90c)){for(var _0x2b6986=0x0;_0x2b6986<_0xe5d90c[_0xf528('0x20')];_0x2b6986+=0x1){_0xe5d90c[_0x2b6986]=this[_0xf528('0x1f')](_0xe5d90c[_0x2b6986],_0x4cac59);}return _0xe5d90c;}if(!_['isObject'](_0xe5d90c)){return _0xe5d90c;}if(_['isString'](_0x4cac59)){_0x4cac59=[_0x4cac59];}if(!_[_0xf528('0x21')](_0x4cac59)){return _0xe5d90c;}for(var _0x31a194=0x0;_0x31a194<_0x4cac59[_0xf528('0x20')];_0x31a194+=0x1){_[_0xf528('0x22')](_0xe5d90c,_0x4cac59[_0x31a194]);}for(var _0xbeaa21 in _0xe5d90c){if(_0xe5d90c[_0xf528('0x23')](_0xbeaa21)){_0xe5d90c[_0xbeaa21]=this[_0xf528('0x1f')](_0xe5d90c[_0xbeaa21],_0x4cac59);}}return _0xe5d90c;};exports[_0xf528('0x24')]=function(_0x14b950){return _0x14b950[_0xf528('0x25')](RegExp(_0xf528('0x26')))?!![]:![];};exports[_0xf528('0x27')]=function(_0x445916){return _0x445916[_0xf528('0x25')](/^\S+@\S+$/)?!![]:![];};exports[_0xf528('0x28')]=function(_0x1398f4,_0x2e8b5e){var _0x568e54=[];var _0x24c63b=/[ `!@#$%^&*()_\-?~]/;var _0x27c22d=_0x2e8b5e?_0xf528('0x29'):_0xf528('0x2a');_0x1398f4[_0xf528('0x8')](/[ ,]+/)[_0xf528('0x2b')](function(_0x5151da){_0x5151da=_0x5151da['replace'](/([^:]")"+/g,'$1');_0x5151da='+'+_0x5151da+'*';var _0x4511d5=_0x5151da[_0xf528('0x25')](_0x24c63b);if(_0x4511d5){_0x5151da='\x22'+_0x5151da+'\x22';}_0x568e54[_0xf528('0x2c')](_0x5151da);});_0x27c22d=_0x27c22d[_0xf528('0x2d')]('{EXPR}',_0x568e54[_0xf528('0x2e')]('\x20'));return _0x27c22d;};exports[_0xf528('0x2f')]=function(_0x132901,_0x3a3e4f,_0x1a9849){var _0x143849={},_0x41b9e2={};if(_0x3a3e4f[_0xf528('0x30')]['$id']){_0x3a3e4f['query']['id']=_0x3a3e4f[_0xf528('0x30')][_0xf528('0x31')];delete _0x3a3e4f[_0xf528('0x30')][_0xf528('0x31')];}_0x143849[_0xf528('0x6')]=_[_0xf528('0x18')](_0x132901,_0xf528('0x14'));_0x143849[_0xf528('0x30')]=_[_0xf528('0x5')](_0x3a3e4f[_0xf528('0x30')]);_0x143849['filters']=_[_0xf528('0x32')](_0x143849['model'],_0x143849[_0xf528('0x30')]);_0x41b9e2[_0xf528('0x33')]=_[_0xf528('0x32')](_0x143849['model'],this[_0xf528('0x7')](_0x3a3e4f[_0xf528('0x30')][_0xf528('0x7')]));_0x41b9e2[_0xf528('0x33')]=_0x41b9e2['attributes'][_0xf528('0x20')]?_0x41b9e2['attributes']:_0x143849[_0xf528('0x6')];if(!_0x3a3e4f[_0xf528('0x30')][_0xf528('0x23')](_0xf528('0x34'))){_0x41b9e2['limit']=this[_0xf528('0x15')](_0x3a3e4f[_0xf528('0x30')][_0xf528('0x15')]);_0x41b9e2['offset']=this[_0xf528('0x16')](_0x3a3e4f['query'][_0xf528('0x16')]);}_0x41b9e2[_0xf528('0x35')]=this[_0xf528('0x17')](_0x3a3e4f[_0xf528('0x30')]['sort']);_0x41b9e2[_0xf528('0x36')]=this[_0xf528('0x9')](_['pick'](_0x3a3e4f[_0xf528('0x30')],_0x143849[_0xf528('0x9')]),_0x132901);if(_0x3a3e4f['query'][_0xf528('0x37')]){var _0x17f04b=_0x132901;var _0x4d2626=_0x3a3e4f[_0xf528('0x30')][_0xf528('0x37')];if(typeof _0x4d2626==='object'){_0x17f04b=_['filter'](_0x132901,function(_0x1188b9){return _[_0xf528('0x4')](_0x4d2626[_0xf528('0x38')],_0x1188b9[_0xf528('0x14')]);});_0x4d2626=_0x4d2626[_0xf528('0x39')];}_0x41b9e2[_0xf528('0x36')]=_['merge'](_0x41b9e2[_0xf528('0x36')],{'$or':_[_0xf528('0x18')](_0x17f04b,function(_0x49c0f8){if(_0x49c0f8[_0xf528('0xc')]!==_0xf528('0x3a')){if(_0x1a9849){return sequelize[_0xf528('0x36')](sequelize['fn']('lower',sequelize['col'](_0x49c0f8[_0xf528('0x14')])),{'$like':sequelize['fn']('lower','%'+_0x3a3e4f[_0xf528('0x30')][_0xf528('0x37')]+'%')});}else{var _0x47c064={};_0x47c064[_0x49c0f8[_0xf528('0x14')]]={'$like':'%'+_0x3a3e4f[_0xf528('0x30')][_0xf528('0x37')]+'%'};return _0x47c064;}}})});}_0x41b9e2=_[_0xf528('0x3b')]({},_0x41b9e2,_0x3a3e4f[_0xf528('0x3c')]);return _0x41b9e2;};exports[_0xf528('0x3d')]=function(_0x2a4376){var _0x5539d5=[];if(_0x2a4376[_0xf528('0x3e')]){_0x5539d5[_0xf528('0x2c')]({'all':!![]});}else if(_0x2a4376[_0xf528('0x3d')]){if(Array[_0xf528('0x21')](_0x2a4376[_0xf528('0x3d')])){_0x5539d5=Object[_0xf528('0x5')](_0x2a4376[_0xf528('0x3d')])['map'](function(_0x4bc104){return parseIncludeModel(_0x2a4376[_0xf528('0x3d')][_0x4bc104]);});}else{var _0xb90ef0=parseIncludeModel(_0x2a4376['include']);_0x5539d5[_0xf528('0x2c')](_0xb90ef0);}}return _0x5539d5;}; \ No newline at end of file +var _0x4540=['hasOwnProperty','isNumeric','match','isEmail','getFullTextValue','\x22{EXPR}\x22','{EXPR}','replace','join','getOptions','query','$id','map','intersection','attributes','nolimit','limit','order','where','pick','filter','columns','value','merge','lower','options','include','includeAll','push','lodash','sequelize','parse','keys','includes','model','alias','raw','fields','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','format','utc','$lte','YYYY-MM-DD','subtract','name','uniqueid','isArray','offset','sort','split','indexOf','priority','col','unsigned','substr','DESC','cast','ASC','omit','length','isObject','isString','unset'];(function(_0x2540db,_0x9b7318){var _0xbf6e9f=function(_0x5be1c6){while(--_0x5be1c6){_0x2540db['push'](_0x2540db['shift']());}};_0xbf6e9f(++_0x9b7318);}(_0x4540,0x17b));var _0x0454=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4540[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0454('0x0'));var sequelize=require(_0x0454('0x1'));var moment=require('moment');var db=require('../../mysqldb')['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x53b6cd){var _0x198d8f=['ne'];try{var _0x51c214=JSON[_0x0454('0x2')](_0x53b6cd);var _0x3e3d5e=Object[_0x0454('0x3')](_0x51c214)[0x0];return _0x198d8f[_0x0454('0x4')](_0x3e3d5e);}catch(_0x33f86c){return![];}}function getOperatorValue(_0x1c5860){var _0x55283d=JSON[_0x0454('0x2')](_0x1c5860);var _0x4b8beb=Object[_0x0454('0x3')](_0x55283d)[0x0];var _0x546c14=_0x55283d[_0x4b8beb];return{['$'+_0x4b8beb]:_0x546c14};}function parseIncludeModel(_0x17cd35){var _0x54f288=JSON[_0x0454('0x2')](_0x17cd35);return{'model':db[_0x54f288[_0x0454('0x5')]],'as':_0x54f288[_0x0454('0x6')],'attributes':_0x54f288['fields'],'raw':_0x54f288[_0x0454('0x7')]};}exports[_0x0454('0x8')]=function(_0x3f77a8){var _0x14c0de=null;if(_0x3f77a8){_0x14c0de=_0x3f77a8['split'](',');}return _0x14c0de;};exports[_0x0454('0x9')]=function(_0x3bbcec,_0x4d6760){var _0x53a25d={};if(!_[_0x0454('0xa')](_0x3bbcec)){_[_0x0454('0xb')](_0x3bbcec,function(_0x532ca6,_0x33003e){try{if(_0x4d6760){var _0x5f3b40=_[_0x0454('0xc')](_0x4d6760,{'name':_0x33003e})||{};if(hasSequelizeOperator(_0x532ca6)){_0x53a25d[_0x33003e]=getOperatorValue(_0x532ca6);}else if(_0x5f3b40[_0x0454('0xd')]===_0x0454('0xe')&&_[_0x0454('0xf')](_0x532ca6)){var _0x242c5d=JSON[_0x0454('0x2')](_0x532ca6);var _0x1e2f0b={'$gte':moment(moment(_0x242c5d[_0x0454('0x10')])[_0x0454('0x11')]('YYYY-MM-DD'))[_0x0454('0x12')]()[_0x0454('0x11')](),'$lte':moment(moment(_0x242c5d[_0x0454('0x13')])[_0x0454('0x11')](_0x0454('0x14')))['utc']()[_0x0454('0x15')](0x1,'s')[_0x0454('0x11')]()};_0x53a25d[_0x33003e]=_0x1e2f0b;}else if(_0x5f3b40[_0x0454('0x16')]===_0x0454('0x17')){_0x53a25d[_0x33003e]=_0x532ca6;}else{_0x53a25d[_0x33003e]=_['isArray'](_0x532ca6)?_0x532ca6:JSON[_0x0454('0x2')](_0x532ca6);}}else{_0x53a25d[_0x33003e]=_[_0x0454('0x18')](_0x532ca6)?_0x532ca6:JSON['parse'](_0x532ca6);}}catch(_0x14bb72){_0x53a25d[_0x33003e]=_0x532ca6['split'](',');}});}return _0x53a25d;};exports['limit']=function(_0x4b03eb){_0x4b03eb=parseInt(_0x4b03eb,0xa);if(!_0x4b03eb||_0x4b03eb<0x0){_0x4b03eb=LIMIT_VALUE;}return _0x4b03eb;};exports[_0x0454('0x19')]=function(_0x3ef4ec){_0x3ef4ec=parseInt(_0x3ef4ec,0xa);if(!_0x3ef4ec||_0x3ef4ec<0x0){_0x3ef4ec=0x0;}return _0x3ef4ec;};exports[_0x0454('0x1a')]=function(_0x2791b1){var _0x1a491c,_0xdb87d5=null;if(_0x2791b1){_0x1a491c=_0x2791b1[_0x0454('0x1b')](',');_0xdb87d5=_['map'](_0x1a491c,function(_0x45fb03){if(_0x45fb03[_0x0454('0x1c')]('-')===0x0){return[_0x45fb03===_0x0454('0x1d')?sequelize['cast'](sequelize[_0x0454('0x1e')](_0x0454('0x1d')),_0x0454('0x1f')):_0x45fb03[_0x0454('0x20')](0x1),_0x0454('0x21')];}else{return[_0x45fb03==='priority'?sequelize[_0x0454('0x22')](sequelize['col'](_0x0454('0x1d')),'unsigned'):_0x45fb03,_0x0454('0x23')];}});}return _0xdb87d5;};exports[_0x0454('0x24')]=function(_0x3f44e9,_0xdbd7a){if(_['isEmpty'](_0x3f44e9)){return _0x3f44e9;}if(_[_0x0454('0x18')](_0x3f44e9)){for(var _0x29aecd=0x0;_0x29aecd<_0x3f44e9[_0x0454('0x25')];_0x29aecd+=0x1){_0x3f44e9[_0x29aecd]=this['omit'](_0x3f44e9[_0x29aecd],_0xdbd7a);}return _0x3f44e9;}if(!_[_0x0454('0x26')](_0x3f44e9)){return _0x3f44e9;}if(_[_0x0454('0x27')](_0xdbd7a)){_0xdbd7a=[_0xdbd7a];}if(!_[_0x0454('0x18')](_0xdbd7a)){return _0x3f44e9;}for(var _0x15b7fd=0x0;_0x15b7fd<_0xdbd7a['length'];_0x15b7fd+=0x1){_[_0x0454('0x28')](_0x3f44e9,_0xdbd7a[_0x15b7fd]);}for(var _0x4e1bba in _0x3f44e9){if(_0x3f44e9[_0x0454('0x29')](_0x4e1bba)){_0x3f44e9[_0x4e1bba]=this[_0x0454('0x24')](_0x3f44e9[_0x4e1bba],_0xdbd7a);}}return _0x3f44e9;};exports[_0x0454('0x2a')]=function(_0x4fc646){return _0x4fc646[_0x0454('0x2b')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0x0454('0x2c')]=function(_0x5c11c9){return _0x5c11c9[_0x0454('0x2b')](/^\S+@\S+$/)?!![]:![];};exports[_0x0454('0x2d')]=function(_0x5e7e9a,_0x55f935){var _0x4b9fe7=[];var _0x1a14e2=/[ `!@#$%^&*()_\-?~]/;var _0x2bdb14=_0x55f935?_0x0454('0x2e'):_0x0454('0x2f');_0x5e7e9a['split'](/[ ,]+/)['forEach'](function(_0x29faff){_0x29faff=_0x29faff[_0x0454('0x30')](/([^:]")"+/g,'$1');_0x29faff='+'+_0x29faff+'*';var _0x1b9b40=_0x29faff['match'](_0x1a14e2);if(_0x1b9b40){_0x29faff='\x22'+_0x29faff+'\x22';}_0x4b9fe7['push'](_0x29faff);});_0x2bdb14=_0x2bdb14[_0x0454('0x30')]('{EXPR}',_0x4b9fe7[_0x0454('0x31')]('\x20'));return _0x2bdb14;};exports[_0x0454('0x32')]=function(_0x3eef4b,_0x41b34d,_0x52f833){var _0x35704d={},_0x113e8d={};if(_0x41b34d[_0x0454('0x33')][_0x0454('0x34')]){_0x41b34d[_0x0454('0x33')]['id']=_0x41b34d[_0x0454('0x33')][_0x0454('0x34')];delete _0x41b34d['query']['$id'];}_0x35704d[_0x0454('0x5')]=_[_0x0454('0x35')](_0x3eef4b,_0x0454('0x16'));_0x35704d[_0x0454('0x33')]=_[_0x0454('0x3')](_0x41b34d[_0x0454('0x33')]);_0x35704d[_0x0454('0x9')]=_[_0x0454('0x36')](_0x35704d[_0x0454('0x5')],_0x35704d['query']);_0x113e8d[_0x0454('0x37')]=_[_0x0454('0x36')](_0x35704d[_0x0454('0x5')],this['fields'](_0x41b34d[_0x0454('0x33')][_0x0454('0x8')]));_0x113e8d[_0x0454('0x37')]=_0x113e8d[_0x0454('0x37')][_0x0454('0x25')]?_0x113e8d[_0x0454('0x37')]:_0x35704d[_0x0454('0x5')];if(!_0x41b34d[_0x0454('0x33')][_0x0454('0x29')](_0x0454('0x38'))){_0x113e8d[_0x0454('0x39')]=this[_0x0454('0x39')](_0x41b34d['query'][_0x0454('0x39')]);_0x113e8d['offset']=this[_0x0454('0x19')](_0x41b34d['query'][_0x0454('0x19')]);}_0x113e8d[_0x0454('0x3a')]=this[_0x0454('0x1a')](_0x41b34d['query'][_0x0454('0x1a')]);_0x113e8d[_0x0454('0x3b')]=this[_0x0454('0x9')](_[_0x0454('0x3c')](_0x41b34d['query'],_0x35704d[_0x0454('0x9')]),_0x3eef4b);if(_0x41b34d[_0x0454('0x33')][_0x0454('0x3d')]){var _0x526dca=_0x3eef4b;var _0x2e4642=_0x41b34d['query']['filter'];if(typeof _0x2e4642==='object'){_0x526dca=_['filter'](_0x3eef4b,function(_0x5058e3){return _[_0x0454('0x4')](_0x2e4642[_0x0454('0x3e')],_0x5058e3[_0x0454('0x16')]);});_0x2e4642=_0x2e4642[_0x0454('0x3f')];}_0x113e8d[_0x0454('0x3b')]=_[_0x0454('0x40')](_0x113e8d['where'],{'$or':_['map'](_0x526dca,function(_0x40da3f){if(_0x40da3f[_0x0454('0xd')]!=='VIRTUAL'){if(_0x52f833){return sequelize[_0x0454('0x3b')](sequelize['fn'](_0x0454('0x41'),sequelize[_0x0454('0x1e')](_0x40da3f[_0x0454('0x16')])),{'$like':sequelize['fn'](_0x0454('0x41'),'%'+_0x41b34d[_0x0454('0x33')]['filter']+'%')});}else{var _0x1fa3c3={};_0x1fa3c3[_0x40da3f[_0x0454('0x16')]]={'$like':'%'+_0x41b34d[_0x0454('0x33')][_0x0454('0x3d')]+'%'};return _0x1fa3c3;}}})});}_0x113e8d=_[_0x0454('0x40')]({},_0x113e8d,_0x41b34d[_0x0454('0x42')]);return _0x113e8d;};exports[_0x0454('0x43')]=function(_0x363b67){var _0x298c22=[];if(_0x363b67[_0x0454('0x44')]){_0x298c22[_0x0454('0x45')]({'all':!![]});}else if(_0x363b67[_0x0454('0x43')]){if(Array[_0x0454('0x18')](_0x363b67[_0x0454('0x43')])){_0x298c22=Object['keys'](_0x363b67['include'])[_0x0454('0x35')](function(_0x5e6c96){return parseIncludeModel(_0x363b67[_0x0454('0x43')][_0x5e6c96]);});}else{var _0x5c7733=parseIncludeModel(_0x363b67[_0x0454('0x43')]);_0x298c22[_0x0454('0x45')](_0x5c7733);}}return _0x298c22;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index ce178e8..7f23509 100644 --- a/server/components/realtime/agents.js +++ b/server/components/realtime/agents.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x99d4=['all','map','value','includes','filter','getAgentIdsByStatus','resolve','findAll','smsPause','globalStatus','getSortedAgentsIdsByStatus','split','fields','order','startsWith','DESC','fullname,internal','fullname','substring','indexOf','internal','validateSortParameter','sort','pauseType','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','chatCapacity','mailCapacity','smsCapacity','faxCapacity','chatCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','faxCurrentCapacity','openchannelStatusTime','mailStatusTime','smsStatusTime','faxStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','omit','pick','filterAgentAttributes','lodash','../../mysqldb','client','http','chatPause','faxPause','mailPause','openchannelPause','voicePause','whatsappPause','every','length','idle','unknown','unavailable','ringing','isNil','voiceStatus','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','request','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','*pause','getAgentStatus','startCase','Queue','findOne'];(function(_0xc99e78,_0x26f9cf){var _0x533ee5=function(_0x49aa78){while(--_0x49aa78){_0xc99e78['push'](_0xc99e78['shift']());}};_0x533ee5(++_0x26f9cf);}(_0x99d4,0x13e));var _0x499d=function(_0x1ea84a,_0x31a991){_0x1ea84a=_0x1ea84a-0x0;var _0x39590f=_0x99d4[_0x1ea84a];return _0x39590f;};'use strict';var _=require(_0x499d('0x0'));var jayson=require('jayson/promise');var db=require(_0x499d('0x1'))['db'];var amiClient=jayson[_0x499d('0x2')][_0x499d('0x3')]({'port':0x232a});var routingClient=jayson['client'][_0x499d('0x3')]({'port':0x232c});function isAgentPaused(_0x4c011c,_0x1d1a34){var _0x4d083c=[_0x4c011c[_0x499d('0x4')],_0x4c011c[_0x499d('0x5')],_0x4c011c[_0x499d('0x6')],_0x4c011c[_0x499d('0x7')],_0x4c011c['smsPause'],_0x4c011c[_0x499d('0x8')],_0x4c011c[_0x499d('0x9')]];if(!_0x1d1a34)return _[_0x499d('0xa')](_0x4d083c);var _0x437843=_['filter'](_0x4d083c);return _0x437843[_0x499d('0xb')]>0x0&&_0x437843[_0x499d('0xb')]<_0x4d083c[_0x499d('0xb')]?!![]:![];}function isIdle(_0x27d820){return _0x27d820===_0x499d('0xc')||_0x27d820===_0x499d('0xd')||_0x27d820===_0x499d('0xe')||_0x27d820===_0x499d('0xf')||_[_0x499d('0x10')](_0x27d820);}function isAgentIdle(_0xe03ae0){if(_0xe03ae0[_0x499d('0x11')]!==_0x499d('0xc')&&_0xe03ae0[_0x499d('0x8')]){_0xe03ae0[_0x499d('0x11')]=_0x499d('0x12');return![];}return _[_0x499d('0xa')]([_0xe03ae0[_0x499d('0x13')],_0xe03ae0[_0x499d('0x14')],_0xe03ae0[_0x499d('0x15')],_0xe03ae0[_0x499d('0x16')],_0xe03ae0[_0x499d('0x17')],_0xe03ae0[_0x499d('0x11')],_0xe03ae0[_0x499d('0x18')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x499d('0x19')](_0x499d('0x1a'),{})[_0x499d('0x1b')](function(_0x40e679){if(_0x40e679['error']){throw new Error(_0x499d('0x1c'));}var _0x1d12d5=_0x40e679[_0x499d('0x1d')];return routingClient['request'](_0x499d('0x1a'),{})[_0x499d('0x1b')](function(_0xd8b7a){if(_0xd8b7a['error']){throw new Error(_0x499d('0x1e'));}var _0x1adbf8=_0xd8b7a[_0x499d('0x1d')];return _[_0x499d('0x1f')]({},_0x1d12d5,_0x1adbf8);});})[_0x499d('0x20')](function(_0x15d9d0){throw _0x15d9d0;});}exports['getRealtimeAgents']=getRealtimeAgents;function getAgentStatus(_0xaba16d){var _0x4d669a=_0x499d('0xd');if(isAgentPaused(_0xaba16d))_0x4d669a='pause';else if(isAgentPaused(_0xaba16d,!![]))_0x4d669a=_0x499d('0x21');else if(isAgentIdle(_0xaba16d))_0x4d669a='idle';else _0x4d669a='busy';return _0x4d669a;}exports[_0x499d('0x22')]=getAgentStatus;function getAgentIdsByQueues(_0x2d56d5,_0x4a06a9){var _0x59a03a=_['isArray'](_0x2d56d5)?_0x2d56d5:[_0x2d56d5];var _0x4a81ca=_[_0x499d('0x23')](_0x4a06a9)+_0x499d('0x24');var _0x594400=_['map'](_0x59a03a,function(_0x15fbdd){return db[_0x4a81ca][_0x499d('0x25')]({'where':{'id':_0x15fbdd}})[_0x499d('0x1b')](function(_0x235003){if(!_0x235003)return[];return _0x235003['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0x499d('0x26')](_0x594400)[_0x499d('0x1b')](function(_0x4a8591){var _0x330fcc=_(_0x4a8591)['flatten']()[_0x499d('0x27')]('id')['uniq']()[_0x499d('0x28')]();return _0x330fcc;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0x4d3417,_0x125df8,_0x3ff4e2){try{if(_0x125df8[_0x499d('0xb')]>0x0){_0x4d3417=_0x4d3417['filter'](function(_0x28c6f6){return _0x125df8[_0x499d('0x29')](_0x28c6f6['id']);});}var _0xc1cf9c=_0x4d3417[_0x499d('0x2a')](function(_0x44c595){var _0x418380='busy';if(isAgentIdle(_0x44c595)){_0x418380=_0x499d('0xc');}return _0x418380===_0x3ff4e2;});return _[_0x499d('0x27')](_0xc1cf9c,'id');}catch(_0x544734){throw _0x544734;}}exports[_0x499d('0x2b')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x222fc0,_0x144731,_0x30471d){return Promise[_0x499d('0x2c')]()[_0x499d('0x1b')](function(){if(_0x144731[_0x499d('0xb')]>0x0){_0x222fc0=_0x222fc0[_0x499d('0x2a')](function(_0x2f4073){return _0x144731['includes'](_0x2f4073['id']);});}return _0x222fc0;})[_0x499d('0x1b')](function(){return db['User'][_0x499d('0x2d')]({'attributes':['id','name','fullname','chatPause',_0x499d('0x5'),_0x499d('0x6'),_0x499d('0x7'),_0x499d('0x2e'),_0x499d('0x8'),'whatsappPause','pauseType'],'where':{'id':{'$in':_['map'](_0x222fc0,'id')}},'raw':!![]});})[_0x499d('0x1b')](function(_0x2f028a){return _0x2f028a[_0x499d('0x27')](function(_0xe94edf){var _0x4305bd=_['find'](_0x222fc0,['id',_0xe94edf['id']]);var _0x58fb22=filterAgentAttributes(_0x4305bd);_[_0x499d('0x1f')](_0xe94edf,_0x58fb22);_0xe94edf[_0x499d('0x2f')]=getAgentStatus(_0xe94edf);return _0xe94edf;});})[_0x499d('0x1b')](function(_0x850350){var _0x1d3d5a=sortAgentsByStatus(_0x850350,_0x30471d);return _[_0x499d('0x27')](_0x1d3d5a,'id');})['catch'](function(_0x94344){throw _0x94344;});}exports[_0x499d('0x30')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x424920){var _0xdd5812={'fields':[],'order':null};var _0x4b39f4=_0x424920[_0x499d('0x31')](',');_0xdd5812[_0x499d('0x32')]=_[_0x499d('0x2a')](_0x4b39f4,function(_0x516194){if(!_0x516194[_0x499d('0x29')](_0x499d('0x2f'))){return!![];}_0xdd5812[_0x499d('0x33')]=_[_0x499d('0x34')](_0x516194,'-')?_0x499d('0x35'):'ASC';return![];});return _0xdd5812;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x20e336){if(!_0x20e336){_0x20e336=_0x499d('0x36');}if(_0x20e336[_0x499d('0x29')](_0x499d('0x37'))&&!_0x20e336[_0x499d('0x29')]('internal')){var _0x1b40e5=_0x20e336[_0x499d('0x38')](0x0,_0x20e336[_0x499d('0x39')](_0x499d('0x37')));_0x20e336+=','+_0x1b40e5+_0x499d('0x3a');}return _0x20e336;}exports[_0x499d('0x3b')]=validateSortParameter;function sortAgentsByStatus(_0x5ebeb5,_0x393bfa){var _0x5a7d0d=_0x5ebeb5[_0x499d('0x3c')](function(_0x189a6b,_0x2b9cb9){if(_0x189a6b[_0x499d('0x2f')]===_0x2b9cb9[_0x499d('0x2f')]){if(_0x189a6b['globalStatus']===_0x499d('0x12')){if(_0x393bfa===_0x499d('0x35')){return(_0x189a6b[_0x499d('0x3d')]||'')<(_0x2b9cb9[_0x499d('0x3d')]||'')||_0x189a6b[_0x499d('0x37')][_0x499d('0x3e')]()>_0x2b9cb9[_0x499d('0x37')][_0x499d('0x3e')]()?0x1:-0x1;}else{return(_0x189a6b[_0x499d('0x3d')]||'')<(_0x2b9cb9['pauseType']||'')||_0x189a6b[_0x499d('0x37')][_0x499d('0x3e')]()>_0x2b9cb9[_0x499d('0x37')][_0x499d('0x3e')]()?-0x1:0x1;}}else{if(_0x393bfa===_0x499d('0x35')){return _0x189a6b[_0x499d('0x37')][_0x499d('0x3e')]()<_0x2b9cb9[_0x499d('0x37')]['toLowerCase']()?0x1:-0x1;}else{return _0x189a6b[_0x499d('0x37')][_0x499d('0x3e')]()<_0x2b9cb9[_0x499d('0x37')]['toLowerCase']()?-0x1:0x1;}}}else{if(_0x393bfa===_0x499d('0x35')){return _0x189a6b[_0x499d('0x2f')]<_0x2b9cb9[_0x499d('0x2f')]?0x1:-0x1;}else{return _0x189a6b[_0x499d('0x2f')]<_0x2b9cb9[_0x499d('0x2f')]?-0x1:0x1;}}});return _0x5a7d0d;}exports[_0x499d('0x3f')]=sortAgentsByStatus;function filterAgentAttributes(_0x51f956){var _0x4dc763=[_0x499d('0x40'),_0x499d('0x41'),_0x499d('0x42'),_0x499d('0x43'),'pauseType','lastPauseAt','internal',_0x499d('0x44'),_0x499d('0x4'),_0x499d('0x7'),_0x499d('0x6'),_0x499d('0x2e'),_0x499d('0x9'),'faxPause','voicePause',_0x499d('0x45'),'openchannelCapacity',_0x499d('0x46'),_0x499d('0x47'),'whatsappCapacity',_0x499d('0x48'),_0x499d('0x49'),'openchannelCurrentCapacity',_0x499d('0x4a'),_0x499d('0x4b'),'whatsappCurrentCapacity',_0x499d('0x4c'),_0x499d('0x13'),_0x499d('0x16'),_0x499d('0x15'),_0x499d('0x17'),_0x499d('0x18'),_0x499d('0x14'),'voiceStatus','chatStatusTime',_0x499d('0x4d'),_0x499d('0x4e'),_0x499d('0x4f'),'whatsappStatusTime',_0x499d('0x50'),'voiceStatusTime',_0x499d('0x51'),_0x499d('0x52'),_0x499d('0x53'),_0x499d('0x54'),_0x499d('0x55'),'routealias'];var _0x7c0538=[_0x499d('0x4'),'openchannelPause',_0x499d('0x6'),_0x499d('0x2e'),_0x499d('0x9'),_0x499d('0x5'),_0x499d('0x8'),'online'];var _0x3c87e0=_(_0x51f956)[_0x499d('0x56')](_0x7c0538)[_0x499d('0x57')](_0x4dc763)[_0x499d('0x28')]();return _0x3c87e0;}exports[_0x499d('0x58')]=filterAgentAttributes; \ No newline at end of file +var _0x30db=['faxStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','openchannelPause','omit','pick','value','filterAgentAttributes','../../mysqldb','client','http','chatPause','faxPause','mailPause','smsPause','voicePause','whatsappPause','every','filter','length','idle','unknown','unavailable','ringing','voiceStatus','pause','faxStatus','openchannelStatus','smsStatus','whatsappStatus','request','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Agents','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','getRealtimeAgents','*pause','busy','getAgentStatus','isArray','startCase','Queue','map','findOne','all','flatten','getAgentIdsByQueues','includes','resolve','User','findAll','name','fullname','pauseType','globalStatus','getSortedAgentsIdsByStatus','fields','order','startsWith','DESC','ASC','getUpdatedSortOptions','fullname,internal','internal','substring','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','chatCapacity','mailCapacity','smsCapacity','whatsappCapacity','chatCurrentCapacity','mailCurrentCapacity','faxCurrentCapacity','chatStatus','mailStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime'];(function(_0x461f91,_0x1e60c0){var _0x22f8c7=function(_0x9e7967){while(--_0x9e7967){_0x461f91['push'](_0x461f91['shift']());}};_0x22f8c7(++_0x1e60c0);}(_0x30db,0x17b));var _0xb30d=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x30db[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var jayson=require('jayson/promise');var db=require(_0xb30d('0x0'))['db'];var amiClient=jayson[_0xb30d('0x1')][_0xb30d('0x2')]({'port':0x232a});var routingClient=jayson[_0xb30d('0x1')][_0xb30d('0x2')]({'port':0x232c});function isAgentPaused(_0x51a114,_0x3a9d96){var _0x3b1a81=[_0x51a114[_0xb30d('0x3')],_0x51a114[_0xb30d('0x4')],_0x51a114[_0xb30d('0x5')],_0x51a114['openchannelPause'],_0x51a114[_0xb30d('0x6')],_0x51a114[_0xb30d('0x7')],_0x51a114[_0xb30d('0x8')]];if(!_0x3a9d96)return _[_0xb30d('0x9')](_0x3b1a81);var _0x319354=_[_0xb30d('0xa')](_0x3b1a81);return _0x319354[_0xb30d('0xb')]>0x0&&_0x319354['length']<_0x3b1a81[_0xb30d('0xb')]?!![]:![];}function isIdle(_0x139d64){return _0x139d64===_0xb30d('0xc')||_0x139d64===_0xb30d('0xd')||_0x139d64===_0xb30d('0xe')||_0x139d64===_0xb30d('0xf')||_['isNil'](_0x139d64);}function isAgentIdle(_0x1c8de8){if(_0x1c8de8[_0xb30d('0x10')]!==_0xb30d('0xc')&&_0x1c8de8[_0xb30d('0x7')]){_0x1c8de8[_0xb30d('0x10')]=_0xb30d('0x11');return![];}return _[_0xb30d('0x9')]([_0x1c8de8['chatStatus'],_0x1c8de8[_0xb30d('0x12')],_0x1c8de8['mailStatus'],_0x1c8de8[_0xb30d('0x13')],_0x1c8de8[_0xb30d('0x14')],_0x1c8de8[_0xb30d('0x10')],_0x1c8de8[_0xb30d('0x15')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xb30d('0x16')]('Agents',{})[_0xb30d('0x17')](function(_0x4abd65){if(_0x4abd65['error']){throw new Error(_0xb30d('0x18'));}var _0x390801=_0x4abd65[_0xb30d('0x19')];return routingClient[_0xb30d('0x16')](_0xb30d('0x1a'),{})['then'](function(_0x11fe07){if(_0x11fe07[_0xb30d('0x1b')]){throw new Error(_0xb30d('0x1c'));}var _0x345614=_0x11fe07[_0xb30d('0x19')];return _[_0xb30d('0x1d')]({},_0x390801,_0x345614);});})[_0xb30d('0x1e')](function(_0x2962f2){throw _0x2962f2;});}exports[_0xb30d('0x1f')]=getRealtimeAgents;function getAgentStatus(_0x846fe6){var _0x32e15c=_0xb30d('0xd');if(isAgentPaused(_0x846fe6))_0x32e15c=_0xb30d('0x11');else if(isAgentPaused(_0x846fe6,!![]))_0x32e15c=_0xb30d('0x20');else if(isAgentIdle(_0x846fe6))_0x32e15c=_0xb30d('0xc');else _0x32e15c=_0xb30d('0x21');return _0x32e15c;}exports[_0xb30d('0x22')]=getAgentStatus;function getAgentIdsByQueues(_0x505581,_0x16156a){var _0x37a33a=_[_0xb30d('0x23')](_0x505581)?_0x505581:[_0x505581];var _0x32dfce=_[_0xb30d('0x24')](_0x16156a)+_0xb30d('0x25');var _0x1fc4fb=_[_0xb30d('0x26')](_0x37a33a,function(_0x5a3d38){return db[_0x32dfce][_0xb30d('0x27')]({'where':{'id':_0x5a3d38}})[_0xb30d('0x17')](function(_0x41004e){if(!_0x41004e)return[];return _0x41004e['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0xb30d('0x28')](_0x1fc4fb)[_0xb30d('0x17')](function(_0x674457){var _0x565641=_(_0x674457)[_0xb30d('0x29')]()[_0xb30d('0x26')]('id')['uniq']()['value']();return _0x565641;});}exports[_0xb30d('0x2a')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x17d11b,_0x57df6b,_0x251b07){try{if(_0x57df6b['length']>0x0){_0x17d11b=_0x17d11b[_0xb30d('0xa')](function(_0x3d8be6){return _0x57df6b[_0xb30d('0x2b')](_0x3d8be6['id']);});}var _0x12818c=_0x17d11b[_0xb30d('0xa')](function(_0x26b9e7){var _0x45c5ab=_0xb30d('0x21');if(isAgentIdle(_0x26b9e7)){_0x45c5ab='idle';}return _0x45c5ab===_0x251b07;});return _['map'](_0x12818c,'id');}catch(_0x5da882){throw _0x5da882;}}exports['getAgentIdsByStatus']=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x274051,_0x362950,_0x2536ff){return Promise[_0xb30d('0x2c')]()[_0xb30d('0x17')](function(){if(_0x362950[_0xb30d('0xb')]>0x0){_0x274051=_0x274051[_0xb30d('0xa')](function(_0x2ef78b){return _0x362950['includes'](_0x2ef78b['id']);});}return _0x274051;})['then'](function(){return db[_0xb30d('0x2d')][_0xb30d('0x2e')]({'attributes':['id',_0xb30d('0x2f'),_0xb30d('0x30'),_0xb30d('0x3'),_0xb30d('0x4'),_0xb30d('0x5'),'openchannelPause',_0xb30d('0x6'),'voicePause','whatsappPause',_0xb30d('0x31')],'where':{'id':{'$in':_[_0xb30d('0x26')](_0x274051,'id')}},'raw':!![]});})[_0xb30d('0x17')](function(_0x2dca64){return _0x2dca64[_0xb30d('0x26')](function(_0x121fdb){var _0x26c169=_['find'](_0x274051,['id',_0x121fdb['id']]);var _0x3a0044=filterAgentAttributes(_0x26c169);_['merge'](_0x121fdb,_0x3a0044);_0x121fdb[_0xb30d('0x32')]=getAgentStatus(_0x121fdb);return _0x121fdb;});})[_0xb30d('0x17')](function(_0x54c037){var _0x3fbc20=sortAgentsByStatus(_0x54c037,_0x2536ff);return _[_0xb30d('0x26')](_0x3fbc20,'id');})[_0xb30d('0x1e')](function(_0x1d164){throw _0x1d164;});}exports[_0xb30d('0x33')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x4df8d1){var _0x49385d={'fields':[],'order':null};var _0x173fc1=_0x4df8d1['split'](',');_0x49385d[_0xb30d('0x34')]=_[_0xb30d('0xa')](_0x173fc1,function(_0x51a5cb){if(!_0x51a5cb[_0xb30d('0x2b')]('globalStatus')){return!![];}_0x49385d[_0xb30d('0x35')]=_[_0xb30d('0x36')](_0x51a5cb,'-')?_0xb30d('0x37'):_0xb30d('0x38');return![];});return _0x49385d;}exports[_0xb30d('0x39')]=getUpdatedSortOptions;function validateSortParameter(_0x935560){if(!_0x935560){_0x935560=_0xb30d('0x3a');}if(_0x935560[_0xb30d('0x2b')](_0xb30d('0x30'))&&!_0x935560['includes'](_0xb30d('0x3b'))){var _0x415d09=_0x935560[_0xb30d('0x3c')](0x0,_0x935560['indexOf'](_0xb30d('0x30')));_0x935560+=','+_0x415d09+'internal';}return _0x935560;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0x5b99df,_0x5457f9){var _0x1e1f6e=_0x5b99df['sort'](function(_0x5d2a67,_0x3abf12){if(_0x5d2a67[_0xb30d('0x32')]===_0x3abf12['globalStatus']){if(_0x5d2a67['globalStatus']===_0xb30d('0x11')){if(_0x5457f9==='DESC'){return(_0x5d2a67[_0xb30d('0x31')]||'')<(_0x3abf12['pauseType']||'')||_0x5d2a67[_0xb30d('0x30')][_0xb30d('0x3d')]()>_0x3abf12[_0xb30d('0x30')][_0xb30d('0x3d')]()?0x1:-0x1;}else{return(_0x5d2a67['pauseType']||'')<(_0x3abf12[_0xb30d('0x31')]||'')||_0x5d2a67[_0xb30d('0x30')][_0xb30d('0x3d')]()>_0x3abf12[_0xb30d('0x30')][_0xb30d('0x3d')]()?-0x1:0x1;}}else{if(_0x5457f9==='DESC'){return _0x5d2a67['fullname'][_0xb30d('0x3d')]()<_0x3abf12['fullname']['toLowerCase']()?0x1:-0x1;}else{return _0x5d2a67[_0xb30d('0x30')]['toLowerCase']()<_0x3abf12[_0xb30d('0x30')]['toLowerCase']()?-0x1:0x1;}}}else{if(_0x5457f9===_0xb30d('0x37')){return _0x5d2a67['globalStatus']<_0x3abf12[_0xb30d('0x32')]?0x1:-0x1;}else{return _0x5d2a67[_0xb30d('0x32')]<_0x3abf12['globalStatus']?-0x1:0x1;}}});return _0x1e1f6e;}exports[_0xb30d('0x3e')]=sortAgentsByStatus;function filterAgentAttributes(_0x1075ee){var _0x55872f=[_0xb30d('0x3f'),_0xb30d('0x40'),_0xb30d('0x41'),_0xb30d('0x42'),_0xb30d('0x31'),_0xb30d('0x42'),_0xb30d('0x3b'),_0xb30d('0x43'),_0xb30d('0x3'),'openchannelPause',_0xb30d('0x5'),_0xb30d('0x6'),_0xb30d('0x8'),_0xb30d('0x4'),_0xb30d('0x7'),_0xb30d('0x44'),'openchannelCapacity',_0xb30d('0x45'),_0xb30d('0x46'),_0xb30d('0x47'),'faxCapacity',_0xb30d('0x48'),'openchannelCurrentCapacity',_0xb30d('0x49'),'smsCurrentCapacity','whatsappCurrentCapacity',_0xb30d('0x4a'),_0xb30d('0x4b'),_0xb30d('0x13'),_0xb30d('0x4c'),'smsStatus','whatsappStatus',_0xb30d('0x12'),_0xb30d('0x10'),_0xb30d('0x4d'),_0xb30d('0x4e'),_0xb30d('0x4f'),_0xb30d('0x50'),'whatsappStatusTime',_0xb30d('0x51'),'voiceStatusTime',_0xb30d('0x52'),_0xb30d('0x53'),_0xb30d('0x54'),_0xb30d('0x55'),_0xb30d('0x56'),'routealias'];var _0x5c6f6e=[_0xb30d('0x3'),_0xb30d('0x57'),_0xb30d('0x5'),_0xb30d('0x6'),_0xb30d('0x8'),_0xb30d('0x4'),_0xb30d('0x7'),_0xb30d('0x40')];var _0xb6cabb=_(_0x1075ee)[_0xb30d('0x58')](_0x5c6f6e)[_0xb30d('0x59')](_0x55872f)[_0xb30d('0x5a')]();return _0xb6cabb;}exports[_0xb30d('0x5b')]=filterAgentAttributes; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index 4fa48b7..ed1e906 100644 --- a/server/components/realtime/queues.js +++ b/server/components/realtime/queues.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe06e=['outbound','map','paused','loggedIn','available','pTalking','find','pick','initializeQueues','lodash','jayson/promise','client','http','waiting','busy','inUse','loggedInDb','notInUse','onHold','ringInUse','talking','unavailable','unknown','originated','message','statusMessage','dialMethod','startPredictive','startProgressive','erlangCalls','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','startCase','Queues','then','error','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','concat'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xe06e,0x129));var _0xee06=function(_0x118afa,_0x4bf0c1){_0x118afa=_0x118afa-0x0;var _0x167d76=_0xe06e[_0x118afa];return _0x167d76;};'use strict';var _=require(_0xee06('0x0'));var jayson=require(_0xee06('0x1'));var util=require('util');var amiClient=jayson[_0xee06('0x2')][_0xee06('0x3')]({'port':0x232a});var routingClient=jayson[_0xee06('0x2')][_0xee06('0x3')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=['available','loggedIn','paused',_0xee06('0x4')];var VOICE_QUEUE_ATTRIBUTES=[_0xee06('0x5'),_0xee06('0x6'),'invalid',_0xee06('0x7'),_0xee06('0x8'),_0xee06('0x9'),'ringing',_0xee06('0xa'),_0xee06('0xb'),_0xee06('0xc'),_0xee06('0xd')];var OUTBOUND_QUEUE_ATTRIBUTES=['pTalking',_0xee06('0xe'),_0xee06('0xf'),_0xee06('0x10'),'dialActive',_0xee06('0x11'),'Trunk',_0xee06('0x12'),_0xee06('0x13'),_0xee06('0x14'),'erlangCallToSecond',_0xee06('0x15'),'erlangBusyFactor',_0xee06('0x16'),_0xee06('0x17'),'dialPredictiveIntervalMinThreshold',_0xee06('0x18'),_0xee06('0x19'),_0xee06('0x1a'),_0xee06('0x1b'),_0xee06('0x1c'),_0xee06('0x1d'),_0xee06('0x1e')];function getRealtimeQueues(_0x38c78b,_0x422a58){var _0x395eef=_0x422a58===_0xee06('0x1f')?amiClient:routingClient;return _0x395eef['request'](_[_0xee06('0x20')](_0x422a58)+_0xee06('0x21'),_0x38c78b)[_0xee06('0x22')](function(_0x25bc72){if(_0x25bc72[_0xee06('0x23')])throw new Error(util['format'](_0xee06('0x24'),_0x422a58));return _0x25bc72[_0xee06('0x25')];})['catch'](function(_0x193859){throw _0x193859;});}exports['getRealtimeQueues']=getRealtimeQueues;function initializeQueues(_0x1c8028,_0x579f1a,_0x244788,_0x13ce14){var _0x4dd839=DEFAULT_QUEUE_ATTRIBUTES;if(_0x244788===_0xee06('0x1f')){if(_0x13ce14==='inbound'){_0x4dd839=_0x4dd839[_0xee06('0x26')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x13ce14===_0xee06('0x27')){_0x4dd839=_0x4dd839[_0xee06('0x26')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x1c8028[_0xee06('0x28')](function(_0x1bf188){var _0x3ae1c3=_0x1bf188['get']({'plain':!![]});_0x3ae1c3[_0xee06('0x29')]=0x0;_0x3ae1c3['loggedInDb']=0x0;_0x3ae1c3[_0xee06('0x2a')]=0x0;_0x3ae1c3[_0xee06('0x2b')]=0x0;_0x3ae1c3[_0xee06('0x4')]=0x0;if(_0x244788===_0xee06('0x1f')){_0x3ae1c3[_0xee06('0xb')]=0x0;_0x3ae1c3[_0xee06('0x5')]=0x0;if(_0x13ce14==='outbound'){_0x3ae1c3[_0xee06('0x2c')]=0x0;_0x3ae1c3[_0xee06('0xe')]=0x0;}}var _0x552807=_[_0xee06('0x2d')](_0x579f1a,['id',_0x3ae1c3['id']]);if(_0x552807){_['merge'](_0x3ae1c3,_[_0xee06('0x2e')](_0x552807,_0x4dd839));}return _0x3ae1c3;});}exports[_0xee06('0x2f')]=initializeQueues; \ No newline at end of file +var _0x2125=['then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','catch','inbound','concat','outbound','map','get','waiting','voice','pTalking','find','pick','initializeQueues','lodash','jayson/promise','client','http','available','loggedIn','paused','busy','inUse','invalid','loggedInDb','notInUse','onHold','ringing','ringInUse','talking','unknown','originated','message','statusMessage','Trunk','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','request','Queues'];(function(_0x45f74d,_0x1e4f2d){var _0x571441=function(_0x3fb97f){while(--_0x3fb97f){_0x45f74d['push'](_0x45f74d['shift']());}};_0x571441(++_0x1e4f2d);}(_0x2125,0x105));var _0x5212=function(_0xc8388a,_0x2dfbf6){_0xc8388a=_0xc8388a-0x0;var _0x5fdde7=_0x2125[_0xc8388a];return _0x5fdde7;};'use strict';var _=require(_0x5212('0x0'));var jayson=require(_0x5212('0x1'));var util=require('util');var amiClient=jayson[_0x5212('0x2')]['http']({'port':0x232a});var routingClient=jayson['client'][_0x5212('0x3')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x5212('0x4'),_0x5212('0x5'),_0x5212('0x6'),'waiting'];var VOICE_QUEUE_ATTRIBUTES=[_0x5212('0x7'),_0x5212('0x8'),_0x5212('0x9'),_0x5212('0xa'),_0x5212('0xb'),_0x5212('0xc'),_0x5212('0xd'),_0x5212('0xe'),_0x5212('0xf'),'unavailable',_0x5212('0x10')];var OUTBOUND_QUEUE_ATTRIBUTES=['pTalking',_0x5212('0x11'),_0x5212('0x12'),_0x5212('0x13'),'dialActive','dialMethod',_0x5212('0x14'),'startPredictive','startProgressive',_0x5212('0x15'),_0x5212('0x16'),_0x5212('0x17'),_0x5212('0x18'),_0x5212('0x19'),'dialPredictiveIntervalMaxThreshold',_0x5212('0x1a'),_0x5212('0x1b'),'predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls',_0x5212('0x1c'),_0x5212('0x1d'),'predictiveIntervalAvgHoldtime',_0x5212('0x1e')];function getRealtimeQueues(_0x343fda,_0x38ffb5){var _0x58850a=_0x38ffb5==='voice'?amiClient:routingClient;return _0x58850a[_0x5212('0x1f')](_['startCase'](_0x38ffb5)+_0x5212('0x20'),_0x343fda)[_0x5212('0x21')](function(_0x4c2b6c){if(_0x4c2b6c[_0x5212('0x22')])throw new Error(util[_0x5212('0x23')](_0x5212('0x24'),_0x38ffb5));return _0x4c2b6c['result'];})[_0x5212('0x25')](function(_0x40ce51){throw _0x40ce51;});}exports['getRealtimeQueues']=getRealtimeQueues;function initializeQueues(_0x35aef0,_0x4f4b00,_0x22c3cb,_0x21caf9){var _0xea74a8=DEFAULT_QUEUE_ATTRIBUTES;if(_0x22c3cb==='voice'){if(_0x21caf9===_0x5212('0x26')){_0xea74a8=_0xea74a8[_0x5212('0x27')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x21caf9===_0x5212('0x28')){_0xea74a8=_0xea74a8[_0x5212('0x27')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x35aef0[_0x5212('0x29')](function(_0x5c3d12){var _0x39b34b=_0x5c3d12[_0x5212('0x2a')]({'plain':!![]});_0x39b34b[_0x5212('0x6')]=0x0;_0x39b34b[_0x5212('0xa')]=0x0;_0x39b34b[_0x5212('0x5')]=0x0;_0x39b34b[_0x5212('0x4')]=0x0;_0x39b34b[_0x5212('0x2b')]=0x0;if(_0x22c3cb===_0x5212('0x2c')){_0x39b34b[_0x5212('0xf')]=0x0;_0x39b34b['busy']=0x0;if(_0x21caf9===_0x5212('0x28')){_0x39b34b[_0x5212('0x2d')]=0x0;_0x39b34b[_0x5212('0x11')]=0x0;}}var _0x4d5260=_[_0x5212('0x2e')](_0x4f4b00,['id',_0x39b34b['id']]);if(_0x4d5260){_['merge'](_0x39b34b,_[_0x5212('0x2f')](_0x4d5260,_0xea74a8));}return _0x39b34b;});}exports[_0x5212('0x30')]=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index b5d67b2..20fb379 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x5dee44,_0x115b60){var _0x46f720=function(_0x169927){while(--_0x169927){_0x5dee44['push'](_0x5dee44['shift']());}};_0x46f720(++_0x115b60);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file +var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0xdbccf0,_0x3dba4d){var _0x162a01=function(_0x7a4d05){while(--_0x7a4d05){_0xdbccf0['push'](_0xdbccf0['shift']());}};_0x162a01(++_0x3dba4d);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 776f165..98f466e 100644 --- a/server/config/license/hardware.js +++ b/server/config/license/hardware.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbe9e=['getFirstInterface','cpus','map','model','join','md5','update','hex','getUuid','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','hostname','macAddress','ipAddress','createHash','digest','substring','execSync','../environment','networkInterfaces','orderBy','keys','length','IPv4','concat','head','mac','address','127.0.0.1'];(function(_0x493a93,_0x5ecb0b){var _0x3df857=function(_0x226d5a){while(--_0x226d5a){_0x493a93['push'](_0x493a93['shift']());}};_0x3df857(++_0x5ecb0b);}(_0xbe9e,0x13e));var _0xebe9=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xbe9e[_0xfae23b];return _0x200640;};'use strict';var _=require('lodash');var os=require('os');var crypto=require('crypto');var machine=require('bimedia-machine-uuid');var exec=require('child_process')[_0xebe9('0x0')];var config=require(_0xebe9('0x1'));function getInterfaces(){var _0x25f508=[];var _0x19ee8e=os[_0xebe9('0x2')]();var _0x2d6db6=_[_0xebe9('0x3')](_[_0xebe9('0x4')](_0x19ee8e));for(var _0x9421e8=0x0;_0x9421e8<_0x2d6db6[_0xebe9('0x5')];_0x9421e8++){var _0x1264ad=_0x19ee8e[_0x2d6db6[_0x9421e8]]['filter'](function(_0x424ed2){return _0x424ed2['family']===_0xebe9('0x6')&&_0x424ed2['internal']===![];});_0x25f508=_0x25f508[_0xebe9('0x7')](_0x1264ad);}return _0x25f508;}function getFirstInterface(){var _0xfa33c1=_[_0xebe9('0x8')](getInterfaces());return{'macAddress':_0xfa33c1&&_0xfa33c1['mac']?_0xfa33c1[_0xebe9('0x9')]:'00:00:00:00:00:00','ipAddress':_0xfa33c1&&_0xfa33c1[_0xebe9('0xa')]?_0xfa33c1[_0xebe9('0xa')]:_0xebe9('0xb')};}exports[_0xebe9('0xc')]=getFirstInterface;function getCPUhash(){var _0x568d2f=_[_0xebe9('0x3')](os[_0xebe9('0xd')]()[_0xebe9('0xe')](function(_0x5badfe){return _0x5badfe[_0xebe9('0xf')];}))[_0xebe9('0x10')](':');return crypto['createHash'](_0xebe9('0x11'))[_0xebe9('0x12')](_0x568d2f)['digest'](_0xebe9('0x13'));}exports[_0xebe9('0x14')]=function(){var _0x5b8229=os[_0xebe9('0x15')]();var _0x3ba9ff=/[0-9a-f-]{36}/;if(config[_0xebe9('0x16')]&&_0x3ba9ff[_0xebe9('0x17')](config['licenseToken'])){return config[_0xebe9('0x16')];}else if(_0x5b8229===_0xebe9('0x18')){return exec(_0xebe9('0x19'),{'encoding':_0xebe9('0x1a')})['replace']('\x0d\x0a','');}else{var _0x32beff=getFirstInterface();var _0x4679ab=getCPUhash();var _0x4bb5d8=_0x4679ab+'|'+os[_0xebe9('0x1b')]()+'|'+_0x32beff[_0xebe9('0x1c')]+'|'+_0x32beff[_0xebe9('0x1d')];var _0x53711d=crypto[_0xebe9('0x1e')](_0xebe9('0x11'))[_0xebe9('0x12')](_0x4bb5d8)[_0xebe9('0x1f')]('hex');return _0x53711d[_0xebe9('0x20')](0x0,0x8)+'-'+_0x53711d[_0xebe9('0x20')](0x8,0xc)+'-'+_0x53711d[_0xebe9('0x20')](0xc,0x10)+'-'+_0x53711d[_0xebe9('0x20')](0x10,0x14)+'-'+_0x53711d['substring'](0x14);}}; \ No newline at end of file +var _0x110a=['licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','update','substring','child_process','execSync','../environment','keys','filter','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','orderBy','cpus','model','join','md5','digest','hex','getUuid','platform'];(function(_0x40db77,_0x518ab2){var _0x49aded=function(_0x259e83){while(--_0x259e83){_0x40db77['push'](_0x40db77['shift']());}};_0x49aded(++_0x518ab2);}(_0x110a,0xd0));var _0xa110=function(_0x39efbf,_0x118364){_0x39efbf=_0x39efbf-0x0;var _0xcbd510=_0x110a[_0x39efbf];return _0xcbd510;};'use strict';var _=require('lodash');var os=require('os');var crypto=require('crypto');var machine=require('bimedia-machine-uuid');var exec=require(_0xa110('0x0'))[_0xa110('0x1')];var config=require(_0xa110('0x2'));function getInterfaces(){var _0x5980d3=[];var _0x379215=os['networkInterfaces']();var _0x5d0b27=_['orderBy'](_[_0xa110('0x3')](_0x379215));for(var _0x14583c=0x0;_0x14583c<_0x5d0b27['length'];_0x14583c++){var _0x1fd68c=_0x379215[_0x5d0b27[_0x14583c]][_0xa110('0x4')](function(_0x1830c8){return _0x1830c8['family']===_0xa110('0x5')&&_0x1830c8[_0xa110('0x6')]===![];});_0x5980d3=_0x5980d3[_0xa110('0x7')](_0x1fd68c);}return _0x5980d3;}function getFirstInterface(){var _0x45f075=_[_0xa110('0x8')](getInterfaces());return{'macAddress':_0x45f075&&_0x45f075[_0xa110('0x9')]?_0x45f075[_0xa110('0x9')]:_0xa110('0xa'),'ipAddress':_0x45f075&&_0x45f075['address']?_0x45f075[_0xa110('0xb')]:_0xa110('0xc')};}exports[_0xa110('0xd')]=getFirstInterface;function getCPUhash(){var _0x39a8a4=_[_0xa110('0xe')](os[_0xa110('0xf')]()['map'](function(_0x10522c){return _0x10522c[_0xa110('0x10')];}))[_0xa110('0x11')](':');return crypto['createHash'](_0xa110('0x12'))['update'](_0x39a8a4)[_0xa110('0x13')](_0xa110('0x14'));}exports[_0xa110('0x15')]=function(){var _0x13de2a=os[_0xa110('0x16')]();var _0x489d02=/[0-9a-f-]{36}/;if(config[_0xa110('0x17')]&&_0x489d02[_0xa110('0x18')](config[_0xa110('0x17')])){return config['licenseToken'];}else if(_0x13de2a===_0xa110('0x19')){return exec(_0xa110('0x1a'),{'encoding':_0xa110('0x1b')})[_0xa110('0x1c')]('\x0d\x0a','');}else{var _0x49ef7f=getFirstInterface();var _0x28be1d=getCPUhash();var _0x4a79cb=_0x28be1d+'|'+os[_0xa110('0x1d')]()+'|'+_0x49ef7f[_0xa110('0x1e')]+'|'+_0x49ef7f['ipAddress'];var _0x1ec9d9=crypto['createHash'](_0xa110('0x12'))[_0xa110('0x1f')](_0x4a79cb)['digest'](_0xa110('0x14'));return _0x1ec9d9[_0xa110('0x20')](0x0,0x8)+'-'+_0x1ec9d9[_0xa110('0x20')](0x8,0xc)+'-'+_0x1ec9d9['substring'](0xc,0x10)+'-'+_0x1ec9d9[_0xa110('0x20')](0x10,0x14)+'-'+_0x1ec9d9[_0xa110('0x20')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 7777e35..44b1534 100644 --- a/server/config/license/index.js +++ b/server/config/license/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8d4f=['findOrCreate','spread','error','default','moment','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','exports','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data1','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','Changed','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','DEMO\x20START\x20AT\x20%s','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','message','finally','getUuid','License'];(function(_0x56756b,_0x3e8cc7){var _0xa3002=function(_0x5f1386){while(--_0x5f1386){_0x56756b['push'](_0x56756b['shift']());}};_0xa3002(++_0x3e8cc7);}(_0x8d4f,0x187));var _0xf8d4=function(_0x222a4b,_0x3d53d2){_0x222a4b=_0x222a4b-0x0;var _0x2bedb3=_0x8d4f[_0x222a4b];return _0x2bedb3;};'use strict';var util=require('util');var moment=require(_0xf8d4('0x0'));var rp=require('request-promise');var BPromise=require(_0xf8d4('0x1'));var pkginfo=require(_0xf8d4('0x2'))(module,_0xf8d4('0x3'));var db=require(_0xf8d4('0x4'))['db'];var encryptor=require(_0xf8d4('0x5'));var hardware=require(_0xf8d4('0x6'));var logger=require(_0xf8d4('0x7'))(_0xf8d4('0x8'));var HOST=_0xf8d4('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x224353){return new BPromise(function(_0x50e94f,_0x26bfb8){var _0x5dca6e=util['format'](_0xf8d4('0xa'),HOST,_0x224353,module[_0xf8d4('0xb')][_0xf8d4('0x3')]);if(oldToken){_0x5dca6e=util[_0xf8d4('0xc')](_0xf8d4('0xd'),HOST,_0x224353,module['exports'][_0xf8d4('0x3')],oldToken);}var _0x40c4c2={'uri':_0x5dca6e,'method':_0xf8d4('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x40c4c2)[_0xf8d4('0xf')](function(_0x109e4a){_0x50e94f(_0x109e4a);})[_0xf8d4('0x10')](function(_0x21278d){_0x26bfb8(_0x21278d);});});}function manageLicense(_0xa2f503,_0x13be92){var _0x22efd3=_0x13be92[_0xf8d4('0x11')]({'plain':!![]});if(!isOldTokenSent&&_0x22efd3['data1']!==_0xa2f503&&!_0x22efd3['data2']){oldToken=_0x22efd3[_0xf8d4('0x12')];}httpRequest(_0xa2f503)[_0xf8d4('0xf')](function(_0x5133ec){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x5133ec[_0xf8d4('0x13')]){isOldTokenSent=![];if(!_0x22efd3[_0xf8d4('0x8')]&&_0x22efd3[_0xf8d4('0x8')]!=_0x5133ec['license']||_0x22efd3[_0xf8d4('0x8')]&&_0x22efd3[_0xf8d4('0x14')]){logger[_0xf8d4('0x15')](_0xf8d4('0x16'));}if(_0x22efd3[_0xf8d4('0x8')]&&!_0x22efd3[_0xf8d4('0x14')]&&_0x22efd3['license']!=_0x5133ec[_0xf8d4('0x8')]){logger[_0xf8d4('0x15')](_0xf8d4('0x17'));}if(_0x22efd3[_0xf8d4('0x8')]&&!_0x22efd3['data2']&&_0x22efd3[_0xf8d4('0x8')]==_0x5133ec[_0xf8d4('0x8')]){return _0x13be92;}return _0x13be92[_0xf8d4('0x18')]({'data1':_0xa2f503,'data2':null,'license':_0x5133ec[_0xf8d4('0x8')]});}else{if(_0x5133ec[_0xf8d4('0x8')]||_0x22efd3['license']){if(!_0x22efd3[_0xf8d4('0x14')]){if(_0x22efd3['data1']==_0xa2f503){GRAY_PERIOD_REASON=_0xf8d4('0x19');logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0xf8d4('0x1a');logger['info']('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x22efd3['data1'],_0xa2f503);}logger['info'](_0xf8d4('0x1b'),GRAY_PERIOD_REASON[_0xf8d4('0x1c')](),moment()[_0xf8d4('0xc')](_0xf8d4('0x1d')));return _0x13be92['update']({'data2':encryptor[_0xf8d4('0x1e')](moment()[_0xf8d4('0xc')](_0xf8d4('0x1d')))});}else{if(moment()[_0xf8d4('0x1f')](encryptor[_0xf8d4('0x20')](_0x22efd3[_0xf8d4('0x14')]),'days')>DAYS){logger[_0xf8d4('0x15')](_0xf8d4('0x21'),moment()['format'](_0xf8d4('0x1d')));isOldTokenSent=![];return _0x13be92[_0xf8d4('0x18')]({'data1':_0xa2f503,'data2':null,'license':null});}}}else{if(_0x22efd3[_0xf8d4('0x12')]!=_0xa2f503){logger[_0xf8d4('0x15')](_0xf8d4('0x22'),_0x22efd3[_0xf8d4('0x12')],_0xa2f503);return _0x13be92[_0xf8d4('0x18')]({'data1':_0xa2f503,'data2':null,'license':null});}}}return _0x13be92;})[_0xf8d4('0xf')](function(_0x12dfed){_0x13be92=_0x12dfed;})['catch'](function(_0x49c309){logger['error'](_0x49c309[_0xf8d4('0x23')]);})[_0xf8d4('0x24')](function(){setTimeout(function(){manageLicense(hardware[_0xf8d4('0x25')](),_0x13be92);},TIME);});}function defaultLicense(){var _0x276f83=hardware[_0xf8d4('0x25')]();if(_0x276f83){return db[_0xf8d4('0x26')][_0xf8d4('0x27')]({'where':{'id':0x1},'defaults':{'data1':_0x276f83}})[_0xf8d4('0x28')](function(_0x56b9f4,_0x31be60){logger[_0xf8d4('0x15')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x276f83);manageLicense(_0x276f83,_0x56b9f4);})[_0xf8d4('0x10')](function(_0x3f4c41){logger[_0xf8d4('0x29')](_0x3f4c41[_0xf8d4('0x23')]);});}}exports[_0xf8d4('0x2a')]=defaultLicense; \ No newline at end of file +var _0x4482=['message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','default','moment','request-promise','bluebird','version','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','then','catch','get','data1','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s'];(function(_0x24bfe3,_0x51fa99){var _0x502c2c=function(_0x52936c){while(--_0x52936c){_0x24bfe3['push'](_0x24bfe3['shift']());}};_0x502c2c(++_0x51fa99);}(_0x4482,0x10b));var _0x2448=function(_0x4ec2d4,_0x2e1677){_0x4ec2d4=_0x4ec2d4-0x0;var _0xb79c3d=_0x4482[_0x4ec2d4];return _0xb79c3d;};'use strict';var util=require('util');var moment=require(_0x2448('0x0'));var rp=require(_0x2448('0x1'));var BPromise=require(_0x2448('0x2'));var pkginfo=require('pkginfo')(module,_0x2448('0x3'));var db=require('../../mysqldb')['db'];var encryptor=require(_0x2448('0x4'));var hardware=require(_0x2448('0x5'));var logger=require(_0x2448('0x6'))(_0x2448('0x7'));var HOST=_0x2448('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x51aa6a){return new BPromise(function(_0x588276,_0x4144f0){var _0x444e9b=util[_0x2448('0x9')](_0x2448('0xa'),HOST,_0x51aa6a,module[_0x2448('0xb')]['version']);if(oldToken){_0x444e9b=util[_0x2448('0x9')](_0x2448('0xc'),HOST,_0x51aa6a,module[_0x2448('0xb')][_0x2448('0x3')],oldToken);}var _0x5b5137={'uri':_0x444e9b,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x5b5137)[_0x2448('0xd')](function(_0x473713){_0x588276(_0x473713);})[_0x2448('0xe')](function(_0x5cf0f6){_0x4144f0(_0x5cf0f6);});});}function manageLicense(_0x599e96,_0x2729a4){var _0x2320ad=_0x2729a4[_0x2448('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x2320ad['data1']!==_0x599e96&&!_0x2320ad['data2']){oldToken=_0x2320ad[_0x2448('0x10')];}httpRequest(_0x599e96)[_0x2448('0xd')](function(_0x5bed5f){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x5bed5f[_0x2448('0x11')]){isOldTokenSent=![];if(!_0x2320ad[_0x2448('0x7')]&&_0x2320ad[_0x2448('0x7')]!=_0x5bed5f[_0x2448('0x7')]||_0x2320ad['license']&&_0x2320ad[_0x2448('0x12')]){logger[_0x2448('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x2320ad[_0x2448('0x7')]&&!_0x2320ad['data2']&&_0x2320ad[_0x2448('0x7')]!=_0x5bed5f['license']){logger[_0x2448('0x13')](_0x2448('0x14'));}if(_0x2320ad[_0x2448('0x7')]&&!_0x2320ad[_0x2448('0x12')]&&_0x2320ad[_0x2448('0x7')]==_0x5bed5f[_0x2448('0x7')]){return _0x2729a4;}return _0x2729a4[_0x2448('0x15')]({'data1':_0x599e96,'data2':null,'license':_0x5bed5f[_0x2448('0x7')]});}else{if(_0x5bed5f[_0x2448('0x7')]||_0x2320ad[_0x2448('0x7')]){if(!_0x2320ad['data2']){if(_0x2320ad[_0x2448('0x10')]==_0x599e96){GRAY_PERIOD_REASON=_0x2448('0x16');logger[_0x2448('0x13')](_0x2448('0x17'));}else{GRAY_PERIOD_REASON=_0x2448('0x18');logger[_0x2448('0x13')](_0x2448('0x19'),_0x2320ad[_0x2448('0x10')],_0x599e96);}logger[_0x2448('0x13')](_0x2448('0x1a'),GRAY_PERIOD_REASON[_0x2448('0x1b')](),moment()['format'](_0x2448('0x1c')));return _0x2729a4[_0x2448('0x15')]({'data2':encryptor[_0x2448('0x1d')](moment()['format']('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x2448('0x1e')](encryptor[_0x2448('0x1f')](_0x2320ad[_0x2448('0x12')]),_0x2448('0x20'))>DAYS){logger[_0x2448('0x13')](_0x2448('0x21'),moment()[_0x2448('0x9')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x2729a4[_0x2448('0x15')]({'data1':_0x599e96,'data2':null,'license':null});}}}else{if(_0x2320ad[_0x2448('0x10')]!=_0x599e96){logger[_0x2448('0x13')](_0x2448('0x19'),_0x2320ad[_0x2448('0x10')],_0x599e96);return _0x2729a4[_0x2448('0x15')]({'data1':_0x599e96,'data2':null,'license':null});}}}return _0x2729a4;})[_0x2448('0xd')](function(_0x3f2a3b){_0x2729a4=_0x3f2a3b;})['catch'](function(_0x1214c4){logger['error'](_0x1214c4[_0x2448('0x22')]);})[_0x2448('0x23')](function(){setTimeout(function(){manageLicense(hardware[_0x2448('0x24')](),_0x2729a4);},TIME);});}function defaultLicense(){var _0x2465e9=hardware['getUuid']();if(_0x2465e9){return db[_0x2448('0x25')][_0x2448('0x26')]({'where':{'id':0x1},'defaults':{'data1':_0x2465e9}})[_0x2448('0x27')](function(_0x33e7a1,_0x7e741b){logger[_0x2448('0x13')](_0x2448('0x28'),_0x2465e9);manageLicense(_0x2465e9,_0x33e7a1);})[_0x2448('0xe')](function(_0x137342){logger[_0x2448('0x29')](_0x137342[_0x2448('0x22')]);});}}exports[_0x2448('0x2a')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 2c7ac64..790e901 100644 --- a/server/config/license/util.js +++ b/server/config/license/util.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3c81=['%s:%s:%s','demo','machineUuid','add','changed','disabled','message','findAll','role','sequelize','col','count','admin','user','telephone','users','telephones','forEach','catch','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','getUuid','License','find','defaults','then','uuid','data1','license','isEmpty','data2','split','decryptString','format'];(function(_0x1f00bf,_0x9a46c5){var _0x4be18f=function(_0x52ae99){while(--_0x52ae99){_0x1f00bf['push'](_0x1f00bf['shift']());}};_0x4be18f(++_0x9a46c5);}(_0x3c81,0xc8));var _0x13c8=function(_0x5c6b9a,_0x42b65b){_0x5c6b9a=_0x5c6b9a-0x0;var _0x36cd36=_0x3c81[_0x5c6b9a];return _0x36cd36;};'use strict';var util=require(_0x13c8('0x0'));var _=require('lodash');var moment=require(_0x13c8('0x1'));var BPromise=require(_0x13c8('0x2'));var hardware=require(_0x13c8('0x3'));var encryptor=require(_0x13c8('0x4'));var db=require(_0x13c8('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x13c8('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0x13c8('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x4af37c){return new BPromise(function(_0x53aaa4,_0xf06593){return db[_0x13c8('0x8')][_0x13c8('0x9')](_[_0x13c8('0xa')](_0x4af37c,{'raw':!![],'where':{'id':0x1}}))[_0x13c8('0xb')](function(_0x208a1b){return checkLicense(_0x208a1b,null);})[_0x13c8('0xb')](function(_0x37f5d6){_0x53aaa4(_0x37f5d6);return;})['catch'](function(_0x2301b4){_0xf06593(_0x2301b4);});});}function checkLicense(_0x3f010d,_0x5c4186){if(!_0x3f010d){demoLicense[_0x13c8('0xc')]=_0x3f010d[_0x13c8('0xd')];return demoLicense;}try{var _0x48ecdf=_0x5c4186||_0x3f010d[_0x13c8('0xe')];if(_[_0x13c8('0xf')](_0x48ecdf)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x2000ea=_0x3f010d[_0x13c8('0xd')];var _0x1854e2=_0x3f010d[_0x13c8('0x10')];var _0xfb30f6=_0x2000ea['split']('-')[0x4];var _0x3a4a23=_0x2000ea[_0x13c8('0x11')]('-')[0x0];var _0x1202f7=encryptor[_0x13c8('0x12')](_0x48ecdf,util[_0x13c8('0x13')](_0x13c8('0x14'),_0xfb30f6,_0x2000ea,_0x3a4a23));var _0x560e57=JSON['parse'](_0x1202f7);_0x560e57[_0x13c8('0x15')]=![];_0x560e57['uuid']=_0x2000ea;_0x560e57[_0x13c8('0x16')]=hardware[_0x13c8('0x7')]();if(_0x1854e2){var _0x264fd3=encryptor[_0x13c8('0x12')](_0x1854e2);_0x560e57['gray']=_0x264fd3;_0x560e57['deadline']=moment(_0x264fd3)[_0x13c8('0x17')](0x7,'days')[_0x13c8('0x13')]();_0x560e57['grayReason']=_0x560e57[_0x13c8('0xc')]!=_0x560e57[_0x13c8('0x16')]?_0x13c8('0x18'):_0x13c8('0x19');}return _0x560e57;}catch(_0x4c8aa5){breakingLicense[_0x13c8('0xc')]=_0x3f010d['data1'];breakingLicense[_0x13c8('0x1a')]=_0x4c8aa5[_0x13c8('0x1a')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x5573ea,_0x1585b9){getLicense()[_0x13c8('0xb')](function(_0x1463fe){return db['User'][_0x13c8('0x1b')]({'attributes':[_0x13c8('0x1c'),[db[_0x13c8('0x1d')]['fn']('COUNT',db[_0x13c8('0x1d')][_0x13c8('0x1e')]('role')),_0x13c8('0x1f')]],'group':'role','where':{'role':{'$or':[_0x13c8('0x20'),_0x13c8('0x21'),_0x13c8('0x22')]}},'raw':!![]})[_0x13c8('0xb')](function(_0x15ae2d){var _0x18c195={'user':_0x1463fe[_0x13c8('0x23')]||0x0,'telephone':_0x1463fe[_0x13c8('0x24')]||0x0};_0x15ae2d[_0x13c8('0x25')](function(_0x103942){var _0x25ef8b=_0x103942[_0x13c8('0x1c')]===_0x13c8('0x20')?_0x13c8('0x21'):_0x103942[_0x13c8('0x1c')];_0x18c195[_0x25ef8b]-=_0x103942[_0x13c8('0x1f')];if(_0x18c195[_0x25ef8b]<0x0)_0x18c195[_0x25ef8b]=0x0;});_0x5573ea(_0x18c195);return;});})[_0x13c8('0x26')](function(_0x4f1704){_0x1585b9(_0x4f1704);});});}function checkUserLimits(_0x1de887){return new BPromise(function(_0x1ca799,_0x3b122b){getLimits()[_0x13c8('0xb')](function(_0x2de7f5){var _0x5881eb=_[_0x13c8('0x27')](_[_0x13c8('0x28')](_0x1de887,_0x13c8('0x1c')),[_0x13c8('0x20'),_0x13c8('0x21'),_0x13c8('0x22')]);var _0x3bc3e6=(_0x5881eb['admin']||0x0)+(_0x5881eb[_0x13c8('0x21')]||0x0);var _0x40922d=_0x5881eb[_0x13c8('0x22')]||0x0;if(_0x3bc3e6>_0x2de7f5[_0x13c8('0x21')])return _0x3b122b(_0x13c8('0x29'));if(_0x40922d>_0x2de7f5[_0x13c8('0x22')])return _0x3b122b(_0x13c8('0x2a'));return _0x1ca799();})['catch'](function(_0x56da3f){_0x3b122b(_0x56da3f);});});}module[_0x13c8('0x2b')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xd685=['pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','./hardware','../../components/encryptor','2027-01-01T00:00:00.000Z','getUuid','License','find','then','catch','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','split','decryptString','format','%s:%s:%s','parse','demo','uuid','machineUuid','gray','deadline','days','grayReason','changed','disabled','message','findAll','role','sequelize','col','count','user','telephone','users','admin'];(function(_0x4bc428,_0xf56dd9){var _0x3ca37f=function(_0x39db20){while(--_0x39db20){_0x4bc428['push'](_0x4bc428['shift']());}};_0x3ca37f(++_0xf56dd9);}(_0xd685,0x1f4));var _0x5d68=function(_0x40c77b,_0x592aae){_0x40c77b=_0x40c77b-0x0;var _0xd8ca2e=_0xd685[_0x40c77b];return _0xd8ca2e;};'use strict';var util=require(_0x5d68('0x0'));var _=require(_0x5d68('0x1'));var moment=require(_0x5d68('0x2'));var BPromise=require(_0x5d68('0x3'));var hardware=require(_0x5d68('0x4'));var encryptor=require(_0x5d68('0x5'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x5d68('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0x5d68('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x5d68('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0x5d68('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x4e2bc5){return new BPromise(function(_0x4fd0ed,_0x42e364){return db[_0x5d68('0x8')][_0x5d68('0x9')](_['defaults'](_0x4e2bc5,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x1e7373){return checkLicense(_0x1e7373,null);})[_0x5d68('0xa')](function(_0x363429){_0x4fd0ed(_0x363429);return;})[_0x5d68('0xb')](function(_0x2824dd){_0x42e364(_0x2824dd);});});}function checkLicense(_0x340ec4,_0xe81763){if(!_0x340ec4){demoLicense['uuid']=_0x340ec4[_0x5d68('0xc')];return demoLicense;}try{var _0x1f5763=_0xe81763||_0x340ec4[_0x5d68('0xd')];if(_[_0x5d68('0xe')](_0x1f5763)){throw new Error(_0x5d68('0xf'));}var _0x4ba77f=_0x340ec4['data1'];var _0x41eeeb=_0x340ec4['data2'];var _0xf4c1aa=_0x4ba77f['split']('-')[0x4];var _0x57937a=_0x4ba77f[_0x5d68('0x10')]('-')[0x0];var _0xb767d7=encryptor[_0x5d68('0x11')](_0x1f5763,util[_0x5d68('0x12')](_0x5d68('0x13'),_0xf4c1aa,_0x4ba77f,_0x57937a));var _0x5d699d=JSON[_0x5d68('0x14')](_0xb767d7);_0x5d699d[_0x5d68('0x15')]=![];_0x5d699d[_0x5d68('0x16')]=_0x4ba77f;_0x5d699d[_0x5d68('0x17')]=hardware[_0x5d68('0x7')]();if(_0x41eeeb){var _0x41f4cf=encryptor[_0x5d68('0x11')](_0x41eeeb);_0x5d699d[_0x5d68('0x18')]=_0x41f4cf;_0x5d699d[_0x5d68('0x19')]=moment(_0x41f4cf)['add'](0x7,_0x5d68('0x1a'))[_0x5d68('0x12')]();_0x5d699d[_0x5d68('0x1b')]=_0x5d699d[_0x5d68('0x16')]!=_0x5d699d[_0x5d68('0x17')]?_0x5d68('0x1c'):_0x5d68('0x1d');}return _0x5d699d;}catch(_0x51fb10){breakingLicense[_0x5d68('0x16')]=_0x340ec4[_0x5d68('0xc')];breakingLicense[_0x5d68('0x1e')]=_0x51fb10[_0x5d68('0x1e')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x3c35df,_0x81a918){getLicense()[_0x5d68('0xa')](function(_0x2c28a5){return db['User'][_0x5d68('0x1f')]({'attributes':[_0x5d68('0x20'),[db[_0x5d68('0x21')]['fn']('COUNT',db[_0x5d68('0x21')][_0x5d68('0x22')](_0x5d68('0x20'))),_0x5d68('0x23')]],'group':'role','where':{'role':{'$or':['admin',_0x5d68('0x24'),_0x5d68('0x25')]}},'raw':!![]})[_0x5d68('0xa')](function(_0x2018d8){var _0xc29f55={'user':_0x2c28a5[_0x5d68('0x26')]||0x0,'telephone':_0x2c28a5['telephones']||0x0};_0x2018d8['forEach'](function(_0x29145b){var _0xea69b2=_0x29145b[_0x5d68('0x20')]===_0x5d68('0x27')?_0x5d68('0x24'):_0x29145b['role'];_0xc29f55[_0xea69b2]-=_0x29145b[_0x5d68('0x23')];if(_0xc29f55[_0xea69b2]<0x0)_0xc29f55[_0xea69b2]=0x0;});_0x3c35df(_0xc29f55);return;});})[_0x5d68('0xb')](function(_0x1d3a8d){_0x81a918(_0x1d3a8d);});});}function checkUserLimits(_0x4fe61c){return new BPromise(function(_0x1cf6e0,_0x437f02){getLimits()[_0x5d68('0xa')](function(_0x208a35){var _0x2f5482=_[_0x5d68('0x28')](_[_0x5d68('0x29')](_0x4fe61c,'role'),[_0x5d68('0x27'),_0x5d68('0x24'),_0x5d68('0x25')]);var _0x377497=(_0x2f5482['admin']||0x0)+(_0x2f5482['user']||0x0);var _0x3091d7=_0x2f5482['telephone']||0x0;if(_0x377497>_0x208a35[_0x5d68('0x24')])return _0x437f02(_0x5d68('0x2a'));if(_0x3091d7>_0x208a35['telephone'])return _0x437f02(_0x5d68('0x2b'));return _0x1cf6e0();})[_0x5d68('0xb')](function(_0x289207){_0x437f02(_0x289207);});});}module[_0x5d68('0x2c')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index 480a7bc..b71e954 100644 --- a/server/config/local.env.js +++ b/server/config/local.env.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2da6=['app-id','secret','exports','http://localhost:9000','myappanuglar-secret'];(function(_0x512cde,_0x10aa7f){var _0x6f1dc3=function(_0x158e38){while(--_0x158e38){_0x512cde['push'](_0x512cde['shift']());}};_0x6f1dc3(++_0x10aa7f);}(_0x2da6,0x1dd));var _0x62da=function(_0x51b332,_0x11bd05){_0x51b332=_0x51b332-0x0;var _0x9db2d1=_0x2da6[_0x51b332];return _0x9db2d1;};'use strict';module[_0x62da('0x0')]={'DOMAIN':_0x62da('0x1'),'SESSION_SECRET':_0x62da('0x2'),'GOOGLE_ID':_0x62da('0x3'),'GOOGLE_SECRET':_0x62da('0x4'),'DEBUG':''}; \ No newline at end of file +var _0x4991=['secret','exports','myappanuglar-secret'];(function(_0x32514b,_0x3db395){var _0x432749=function(_0x1eaf0c){while(--_0x1eaf0c){_0x32514b['push'](_0x32514b['shift']());}};_0x432749(++_0x3db395);}(_0x4991,0xf7));var _0x1499=function(_0x44e0a4,_0x4dbc5a){_0x44e0a4=_0x44e0a4-0x0;var _0x16c53b=_0x4991[_0x44e0a4];return _0x16c53b;};'use strict';module[_0x1499('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x1499('0x1'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0x1499('0x2'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 3851d97..9d4525b 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x14b8=['../utils/loggers','exports'];(function(_0x15cdcb,_0x4340e9){var _0x37b069=function(_0x304cfb){while(--_0x304cfb){_0x15cdcb['push'](_0x15cdcb['shift']());}};_0x37b069(++_0x4340e9);}(_0x14b8,0x150));var _0x814b=function(_0x5515b3,_0x5bcffd){_0x5515b3=_0x5515b3-0x0;var _0x3ace2f=_0x14b8[_0x5515b3];return _0x3ace2f;};'use strict';var fileLogger=require(_0x814b('0x0'))['fileLogger'];module[_0x814b('0x1')]=fileLogger; \ No newline at end of file +var _0xd480=['../utils/loggers','fileLogger','exports'];(function(_0x5ecb82,_0x3bfc4f){var _0x517494=function(_0x271ba4){while(--_0x271ba4){_0x5ecb82['push'](_0x5ecb82['shift']());}};_0x517494(++_0x3bfc4f);}(_0xd480,0x114));var _0x0d48=function(_0x1f9964,_0x5ff03b){_0x1f9964=_0x1f9964-0x0;var _0x2a2a81=_0xd480[_0x1f9964];return _0x2a2a81;};'use strict';var fileLogger=require(_0x0d48('0x0'))[_0x0d48('0x1')];module[_0x0d48('0x2')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 07f2929..df85fa6 100644 --- a/server/config/pm2/config.js +++ b/server/config/pm2/config.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x49f6=['resolve','join','root','legacy-libs','express','../../services/express/index.js','ami','../../services/ami/index.js','agi','email','../../services/email/index.js','routing','xdr','../../services/xdr/index.js','exports','../../config/environment'];(function(_0x11e1ab,_0x4bb093){var _0x530ca0=function(_0x329d8b){while(--_0x329d8b){_0x11e1ab['push'](_0x11e1ab['shift']());}};_0x530ca0(++_0x4bb093);}(_0x49f6,0x9f));var _0x649f=function(_0x228ac5,_0x2b13b1){_0x228ac5=_0x228ac5-0x0;var _0x55a9fc=_0x49f6[_0x228ac5];return _0x55a9fc;};'use strict';var path=require('path');var cfg=require(_0x649f('0x0'));var env={'NODE_PATH':path[_0x649f('0x1')](path[_0x649f('0x2')](cfg[_0x649f('0x3')],_0x649f('0x4')))};var pm2config={'apps':[{'name':_0x649f('0x5'),'script':path[_0x649f('0x2')](__dirname,_0x649f('0x6')),'env':env},{'name':_0x649f('0x7'),'script':path[_0x649f('0x2')](__dirname,_0x649f('0x8')),'env':env},{'name':_0x649f('0x9'),'script':path[_0x649f('0x2')](__dirname,'../../services/agi/index.js'),'env':env},{'name':_0x649f('0xa'),'script':path[_0x649f('0x2')](__dirname,_0x649f('0xb')),'env':env},{'name':_0x649f('0xc'),'script':path[_0x649f('0x2')](__dirname,'../../services/routing/index.js'),'env':env},{'name':_0x649f('0xd'),'script':path['join'](__dirname,_0x649f('0xe')),'env':env}]};module[_0x649f('0xf')]=pm2config; \ No newline at end of file +var _0xc8ad=['email','../../services/email/index.js','routing','../../services/xdr/index.js','exports','../../config/environment','express','join','../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js'];(function(_0x2a0b4c,_0x43db32){var _0x175819=function(_0x3feb8a){while(--_0x3feb8a){_0x2a0b4c['push'](_0x2a0b4c['shift']());}};_0x175819(++_0x43db32);}(_0xc8ad,0x1bf));var _0xdc8a=function(_0x28d674,_0x4133bc){_0x28d674=_0x28d674-0x0;var _0x137586=_0xc8ad[_0x28d674];return _0x137586;};'use strict';var path=require('path');var cfg=require(_0xdc8a('0x0'));var env={'NODE_PATH':path['resolve'](path['join'](cfg['root'],'legacy-libs'))};var pm2config={'apps':[{'name':_0xdc8a('0x1'),'script':path[_0xdc8a('0x2')](__dirname,_0xdc8a('0x3')),'env':env},{'name':_0xdc8a('0x4'),'script':path['join'](__dirname,_0xdc8a('0x5')),'env':env},{'name':_0xdc8a('0x6'),'script':path[_0xdc8a('0x2')](__dirname,_0xdc8a('0x7')),'env':env},{'name':_0xdc8a('0x8'),'script':path[_0xdc8a('0x2')](__dirname,_0xdc8a('0x9')),'env':env},{'name':_0xdc8a('0xa'),'script':path['join'](__dirname,'../../services/routing/index.js'),'env':env},{'name':'xdr','script':path['join'](__dirname,_0xdc8a('0xb')),'env':env}]};module[_0xdc8a('0xc')]=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 215f39a..1252e1f 100644 --- a/server/config/pm2/index.js +++ b/server/config/pm2/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4cac=['stop','restart','list','describe','delete','dump','pm2','./config','connect','connected','then','start','disconnect'];(function(_0x92c0be,_0x4391d2){var _0x3b4c1d=function(_0x27424b){while(--_0x27424b){_0x92c0be['push'](_0x92c0be['shift']());}};_0x3b4c1d(++_0x4391d2);}(_0x4cac,0x117));var _0xc4ca=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4cac[_0x14add3];return _0x4a174f;};'use strict';var pm2=require(_0xc4ca('0x0'));var BPromise=require('bluebird');var config=require(_0xc4ca('0x1'));function connect(){return new BPromise(function(_0x3534b7,_0x22be5c){return pm2[_0xc4ca('0x2')](function(_0x442904){if(_0x442904){return _0x22be5c(_0x442904);}return _0x3534b7(_0xc4ca('0x3'));});});};exports['start']=function(_0x57d80d){return connect()[_0xc4ca('0x4')](function(){return new BPromise(function(_0x52d56b,_0x14131f){return pm2[_0xc4ca('0x5')](_0x57d80d,function(_0x531a66,_0x4a51f4){if(_0x531a66){return _0x14131f(_0x531a66);}pm2[_0xc4ca('0x6')]();return _0x52d56b(_0x4a51f4);});});});};exports[_0xc4ca('0x7')]=function(_0x16e893){return connect()[_0xc4ca('0x4')](function(){return new BPromise(function(_0x501a10,_0x5e33d2){return pm2['stop'](_0x16e893,function(_0x564813,_0xa8f01c){if(_0x564813){return _0x5e33d2(_0x564813);}pm2[_0xc4ca('0x6')]();return _0x501a10(_0xa8f01c);});});});};exports[_0xc4ca('0x8')]=function(_0x247bcc){return connect()[_0xc4ca('0x4')](function(){return new BPromise(function(_0x499d5e,_0x586b4a){return pm2['restart'](_0x247bcc,function(_0x2c59aa,_0x46a644){if(_0x2c59aa){return _0x586b4a(_0x2c59aa);}pm2[_0xc4ca('0x6')]();return _0x499d5e(_0x46a644);});});});};exports[_0xc4ca('0x9')]=function(){return connect()[_0xc4ca('0x4')](function(){return new BPromise(function(_0x299fdc,_0x588ccf){return pm2[_0xc4ca('0x9')](function(_0x11e695,_0x4c9a94){if(_0x11e695){return _0x588ccf(_0x11e695);}pm2[_0xc4ca('0x6')]();return _0x299fdc(_0x4c9a94);});});});};exports[_0xc4ca('0xa')]=function(_0x1660f0){return connect()['then'](function(){return new BPromise(function(_0x2b5ca9,_0x2fc2ed){return pm2[_0xc4ca('0xa')](_0x1660f0,function(_0x4c9895,_0x28af81){if(_0x4c9895){return _0x2fc2ed(_0x4c9895);}pm2[_0xc4ca('0x6')]();return _0x2b5ca9(_0x28af81);});});});};exports[_0xc4ca('0xb')]=function(_0x2eac27){return connect()[_0xc4ca('0x4')](function(){return new BPromise(function(_0xf297f9,_0x221169){return pm2[_0xc4ca('0xb')](_0x2eac27,function(_0x381333,_0x509032){if(_0x381333){return _0x221169(_0x381333);}pm2[_0xc4ca('0x6')]();return _0xf297f9(_0x509032);});});});};exports[_0xc4ca('0xc')]=function(){return connect()['then'](function(){return new BPromise(function(_0x4b3944,_0x28615e){return pm2[_0xc4ca('0xc')](function(_0x2e9df1){if(_0x2e9df1){return _0x28615e(_0x2e9df1);}return _0x4b3944('saved');});});});}; \ No newline at end of file +var _0xc619=['dump','saved','pm2','bluebird','connect','connected','start','then','disconnect','stop','restart','list','describe','delete'];(function(_0x38c9ae,_0x2f9a0b){var _0x2ba2f7=function(_0x4b0f43){while(--_0x4b0f43){_0x38c9ae['push'](_0x38c9ae['shift']());}};_0x2ba2f7(++_0x2f9a0b);}(_0xc619,0xb8));var _0x9c61=function(_0x8e47bb,_0x3fd253){_0x8e47bb=_0x8e47bb-0x0;var _0x31d123=_0xc619[_0x8e47bb];return _0x31d123;};'use strict';var pm2=require(_0x9c61('0x0'));var BPromise=require(_0x9c61('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x370284,_0x387b55){return pm2[_0x9c61('0x2')](function(_0x224dca){if(_0x224dca){return _0x387b55(_0x224dca);}return _0x370284(_0x9c61('0x3'));});});};exports[_0x9c61('0x4')]=function(_0x53b766){return connect()[_0x9c61('0x5')](function(){return new BPromise(function(_0x2703d0,_0x2b02b3){return pm2[_0x9c61('0x4')](_0x53b766,function(_0x4d5286,_0x9e35f8){if(_0x4d5286){return _0x2b02b3(_0x4d5286);}pm2[_0x9c61('0x6')]();return _0x2703d0(_0x9e35f8);});});});};exports[_0x9c61('0x7')]=function(_0x4f4a8b){return connect()[_0x9c61('0x5')](function(){return new BPromise(function(_0x2ce550,_0x3ba62b){return pm2[_0x9c61('0x7')](_0x4f4a8b,function(_0x5b6d26,_0x7cf1d0){if(_0x5b6d26){return _0x3ba62b(_0x5b6d26);}pm2[_0x9c61('0x6')]();return _0x2ce550(_0x7cf1d0);});});});};exports['restart']=function(_0x4815a1){return connect()[_0x9c61('0x5')](function(){return new BPromise(function(_0x5d43a6,_0x38a7f6){return pm2[_0x9c61('0x8')](_0x4815a1,function(_0x3859b2,_0x47c118){if(_0x3859b2){return _0x38a7f6(_0x3859b2);}pm2[_0x9c61('0x6')]();return _0x5d43a6(_0x47c118);});});});};exports[_0x9c61('0x9')]=function(){return connect()[_0x9c61('0x5')](function(){return new BPromise(function(_0x27a86a,_0x2f2801){return pm2['list'](function(_0x1ff782,_0x3baf3a){if(_0x1ff782){return _0x2f2801(_0x1ff782);}pm2['disconnect']();return _0x27a86a(_0x3baf3a);});});});};exports[_0x9c61('0xa')]=function(_0x473dec){return connect()['then'](function(){return new BPromise(function(_0x458353,_0x29ae3b){return pm2[_0x9c61('0xa')](_0x473dec,function(_0x3aae7f,_0x270e2d){if(_0x3aae7f){return _0x29ae3b(_0x3aae7f);}pm2[_0x9c61('0x6')]();return _0x458353(_0x270e2d);});});});};exports[_0x9c61('0xb')]=function(_0x192bfd){return connect()[_0x9c61('0x5')](function(){return new BPromise(function(_0x41fd87,_0x2ed7fd){return pm2['delete'](_0x192bfd,function(_0x39c223,_0x2853c4){if(_0x39c223){return _0x2ed7fd(_0x39c223);}pm2['disconnect']();return _0x41fd87(_0x2853c4);});});});};exports['dump']=function(){return connect()['then'](function(){return new BPromise(function(_0x39e283,_0x13dec4){return pm2[_0x9c61('0xc')](function(_0x11c146){if(_0x11c146){return _0x13dec4(_0x11c146);}return _0x39e283(_0x9c61('0xd'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 645fdd2..290268a 100644 --- a/server/config/schedule/chat.js +++ b/server/config/schedule/chat.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa501=['update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','catch','[CHAT]\x20Error\x20closing\x20interactions','inspect','lodash','ioredis','util','../../mysqldb','../logger','schedule','redis','defaults','socket.io-emitter','Setting','find','then','chatTimeout','ChatInteraction','findAll','lastMsgAt','subtract','minutes','map','info'];(function(_0x404957,_0x5192a4){var _0x4e0365=function(_0x4f6cd7){while(--_0x4f6cd7){_0x404957['push'](_0x404957['shift']());}};_0x4e0365(++_0x5192a4);}(_0xa501,0x17f));var _0x1a50=function(_0x526eca,_0x32288e){_0x526eca=_0x526eca-0x0;var _0x2a6c2c=_0xa501[_0x526eca];return _0x2a6c2c;};'use strict';var _=require(_0x1a50('0x0'));var moment=require('moment');var Redis=require(_0x1a50('0x1'));var util=require(_0x1a50('0x2'));var config=require('../../config/environment');var db=require(_0x1a50('0x3'))['db'];var logger=require(_0x1a50('0x4'))(_0x1a50('0x5'));config[_0x1a50('0x6')]=_[_0x1a50('0x7')](config[_0x1a50('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x1a50('0x8'))(new Redis(config[_0x1a50('0x6')]));function closeInteractions(){var _0x51c6b8=0x0;var _0x1bbac1=[];return db[_0x1a50('0x9')][_0x1a50('0xa')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x1a50('0xb')](function(_0x3b3507){_0x51c6b8=_0x3b3507[_0x1a50('0xc')];if(_0x51c6b8){return db[_0x1a50('0xd')][_0x1a50('0xe')]({'raw':!![],'attributes':['id',_0x1a50('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x1a50('0x10')](_0x3b3507[_0x1a50('0xc')],_0x1a50('0x11'))}}});}else{return[];}})['then'](function(_0x3d5545){if(_0x3d5545&&_0x3d5545['length']){_0x1bbac1=_[_0x1a50('0x12')](_0x3d5545||[],'id');logger[_0x1a50('0x13')]('[CHAT]\x20Interactions\x20to\x20close:',_0x1bbac1['join']());return db['ChatInteraction'][_0x1a50('0x14')]({'closeReason':_0x1a50('0x15'),'disposition':_0x1a50('0x16'),'closed':!![],'closedAt':moment()[_0x1a50('0x17')](_0x1a50('0x18'))},{'where':{'id':_0x1bbac1}});}})[_0x1a50('0xb')](function(){if(_0x1bbac1&&_0x1bbac1[_0x1a50('0x19')]){logger[_0x1a50('0x13')](_0x1a50('0x1a'),_0x1bbac1[_0x1a50('0x1b')]());for(var _0x5b2d9f=0x0;_0x5b2d9f<_0x1bbac1[_0x1a50('0x19')];_0x5b2d9f++){io['emit']('chatInteraction:update',{'id':_0x1bbac1[_0x5b2d9f],'closed':!![]});}}})[_0x1a50('0x1c')](function(_0x3561f1){logger['error'](_0x1a50('0x1d'),_0x3561f1?util[_0x1a50('0x1e')](_0x3561f1,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xfb26=['update','system','timeout','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update','error','start','lodash','moment','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join'];(function(_0x3d70ae,_0x6ddb0f){var _0x1ba273=function(_0x10db23){while(--_0x10db23){_0x3d70ae['push'](_0x3d70ae['shift']());}};_0x1ba273(++_0x6ddb0f);}(_0xfb26,0x133));var _0x6fb2=function(_0x49f30d,_0x50300a){_0x49f30d=_0x49f30d-0x0;var _0x2c75fa=_0xfb26[_0x49f30d];return _0x2c75fa;};'use strict';var _=require(_0x6fb2('0x0'));var moment=require(_0x6fb2('0x1'));var Redis=require('ioredis');var util=require(_0x6fb2('0x2'));var config=require(_0x6fb2('0x3'));var db=require(_0x6fb2('0x4'))['db'];var logger=require(_0x6fb2('0x5'))(_0x6fb2('0x6'));config[_0x6fb2('0x7')]=_[_0x6fb2('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x6fb2('0x9'))(new Redis(config[_0x6fb2('0x7')]));function closeInteractions(){var _0x36f163=0x0;var _0x59e2b3=[];return db[_0x6fb2('0xa')][_0x6fb2('0xb')]({'raw':!![],'attributes':['id',_0x6fb2('0xc')],'where':{'id':0x1}})[_0x6fb2('0xd')](function(_0x2daed4){_0x36f163=_0x2daed4[_0x6fb2('0xc')];if(_0x36f163){return db[_0x6fb2('0xe')][_0x6fb2('0xf')]({'raw':!![],'attributes':['id',_0x6fb2('0x10')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x2daed4[_0x6fb2('0xc')],_0x6fb2('0x11'))}}});}else{return[];}})[_0x6fb2('0xd')](function(_0x2c4eb1){if(_0x2c4eb1&&_0x2c4eb1[_0x6fb2('0x12')]){_0x59e2b3=_[_0x6fb2('0x13')](_0x2c4eb1||[],'id');logger[_0x6fb2('0x14')](_0x6fb2('0x15'),_0x59e2b3[_0x6fb2('0x16')]());return db[_0x6fb2('0xe')][_0x6fb2('0x17')]({'closeReason':_0x6fb2('0x18'),'disposition':_0x6fb2('0x19'),'closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x59e2b3}});}})[_0x6fb2('0xd')](function(){if(_0x59e2b3&&_0x59e2b3[_0x6fb2('0x12')]){logger[_0x6fb2('0x14')](_0x6fb2('0x1a'),_0x59e2b3[_0x6fb2('0x16')]());for(var _0x2e451e=0x0;_0x2e451e<_0x59e2b3[_0x6fb2('0x12')];_0x2e451e++){io['emit'](_0x6fb2('0x1b'),{'id':_0x59e2b3[_0x2e451e],'closed':!![]});}}})['catch'](function(_0x5a7f9c){logger[_0x6fb2('0x1c')]('[CHAT]\x20Error\x20closing\x20interactions',_0x5a7f9c?util['inspect'](_0x5a7f9c,{'showHidden':![],'depth':null}):'');});}exports[_0x6fb2('0x1d')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index a929069..b5808d3 100644 --- a/server/config/schedule/cloud-provider.js +++ b/server/config/schedule/cloud-provider.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedda=['startAllRefreshIntervals','exports','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x2b6a8f,_0x294599){var _0x2d2036=function(_0x1ea077){while(--_0x1ea077){_0x2b6a8f['push'](_0x2b6a8f['shift']());}};_0x2d2036(++_0x294599);}(_0xedda,0x86));var _0xaedd=function(_0x459fa1,_0x50ef75){_0x459fa1=_0x459fa1-0x0;var _0x19707a=_0xedda[_0x459fa1];return _0x19707a;};'use strict';function start(){var _0x3498d7=require(_0xaedd('0x0'));return _0x3498d7[_0xaedd('0x1')]();}module[_0xaedd('0x2')]={'intervals':{},'start':start}; \ No newline at end of file +var _0x827e=['../../api/cloudProvider/cloudProvider.oauth.js','exports'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x827e,0x122));var _0xe827=function(_0xd8b0c5,_0x4784e5){_0xd8b0c5=_0xd8b0c5-0x0;var _0x5e769f=_0x827e[_0xd8b0c5];return _0x5e769f;};'use strict';function start(){var _0x41ad93=require(_0xe827('0x0'));return _0x41ad93['startAllRefreshIntervals']();}module[_0xe827('0x1')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index c6d7ef8..7885e44 100644 --- a/server/config/schedule/index.js +++ b/server/config/schedule/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5687=['keyBy','difference','intersection','length','exists','stop','delete\x20cron','toRun','my\x20id','resolve','cron','isBetween','startAt','endAt','add','start','add\x20cron','deleteJob','stop\x20cron','active','update','update\x20cron','run','util','path','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','info','Try\x20to\x20send\x20a\x20mail\x20to','email','getSmtpOptions','format','\x22%s\x22\x20<%s>','name','MailAccount','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','basename','extname','zip','existsSync','Sent','attachments','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','SendMail','then','error','error\x20mail','email\x20sent','catch','data','Smtp','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','CloudProvider','keys','jobs','map','toString'];(function(_0x1e4b61,_0x3afe6b){var _0x14490e=function(_0x4fd428){while(--_0x4fd428){_0x1e4b61['push'](_0x1e4b61['shift']());}};_0x14490e(++_0x3afe6b);}(_0x5687,0x1de));var _0x7568=function(_0x5bbb66,_0x3fe14e){_0x5bbb66=_0x5bbb66-0x0;var _0x3baea2=_0x5687[_0x5bbb66];return _0x3baea2;};'use strict';var fs=require('fs');var util=require(_0x7568('0x0'));var path=require(_0x7568('0x1'));var _=require('lodash');var moment=require(_0x7568('0x2'));var CronJobManager=require(_0x7568('0x3'));var jayson=require(_0x7568('0x4'));var BPromise=require(_0x7568('0x5'));var logger=require(_0x7568('0x6'))(_0x7568('0x7'));var db=require(_0x7568('0x8'))['db'];var analyticCustomReportController=require(_0x7568('0x9'));var analyticDefaultReportController=require(_0x7568('0xa'));var client=jayson[_0x7568('0xb')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x28a6c6,_0x249178){return function(){logger[_0x7568('0xc')](_0x7568('0xd'),_0x28a6c6[_0x7568('0xe')]);var _0x315737=!![];var _0x43c88c=_0x28a6c6['MailAccount'][_0x7568('0xf')]();var _0x2d3f65={'account':_0x43c88c,'message':{'from':util[_0x7568('0x10')](_0x7568('0x11'),_0x28a6c6['MailAccount'][_0x7568('0x12')],_0x28a6c6['MailAccount'][_0x7568('0xe')]||_0x28a6c6[_0x7568('0x13')]['Smtp'][_0x7568('0x14')]),'to':_0x28a6c6[_0x7568('0xe')],'cc':_0x28a6c6['cc'],'bcc':_0x28a6c6[_0x7568('0x15')],'subject':util[_0x7568('0x10')](_0x7568('0x16'),_0x249178[_0x7568('0x12')],_0x28a6c6[_0x7568('0x17')],_0x28a6c6[_0x7568('0x18')])}};var _0x1aa73b=path[_0x7568('0x19')](__dirname,_0x7568('0x1a'));var _0xce4903=_0x249178[_0x7568('0x1b')];var _0x28bcc3=util['format']('%s.%s',path[_0x7568('0x1c')](_0x249178['savename'],path[_0x7568('0x1d')](_0x249178[_0x7568('0x1b')])),_0x7568('0x1e'));var _0x4ab469=path[_0x7568('0x19')](_0x1aa73b,_0xce4903);var _0x129f17=path[_0x7568('0x19')](_0x1aa73b,_0x28bcc3);if(fs[_0x7568('0x1f')](_0x4ab469)){_0x249178['status']=_0x7568('0x20');_0x2d3f65['message'][_0x7568('0x21')]=[{'filename':_0xce4903,'path':_0x4ab469}];_0x2d3f65[_0x7568('0x22')][_0x7568('0x23')]=util[_0x7568('0x10')](_0x7568('0x24'),JSON[_0x7568('0x25')](_0x249178,null,0x2));}else if(fs['existsSync'](_0x129f17)){_0x249178['status']='Sent';_0x2d3f65['message']['attachments']=[{'filename':_0x28bcc3,'path':_0x129f17}];}else{_0x2d3f65[_0x7568('0x22')][_0x7568('0x23')]=_0x7568('0x26');if(!_0x28a6c6[_0x7568('0x27')]){_0x315737=![];logger[_0x7568('0xc')](_0x7568('0x28'));}}if(_0x315737){return client['request'](_0x7568('0x29'),_0x2d3f65)[_0x7568('0x2a')](function(_0x23b0ce){if(_0x23b0ce[_0x7568('0x2b')]){return logger['error'](_0x7568('0x2c'),JSON[_0x7568('0x25')](_0x23b0ce));}return logger[_0x7568('0xc')](_0x7568('0x2d'));})[_0x7568('0x2e')](function(_0x506a19){return logger[_0x7568('0x2b')](_0x7568('0x2c'),JSON['stringify'](_0x506a19));});}};}function handleError(){return function(_0x40b47a){return logger[_0x7568('0x2b')](JSON['stringify'](_0x40b47a));};}function handleResult(_0x26491c){return function(_0x1152f1){logger[_0x7568('0xc')](_0x7568('0x2f'),JSON[_0x7568('0x25')](_0x1152f1));if(_0x26491c[_0x7568('0x13')]&&_0x26491c['MailAccount'][_0x7568('0x30')]&&!_[_0x7568('0x31')](_0x26491c[_0x7568('0xe')])){setTimeout(handleSendEmail(_0x26491c,_0x1152f1),0x3c*0x3e8);}};}function handleJob(_0x47ffe9){return function(){try{if(_[_0x7568('0x31')](_0x47ffe9[_0x7568('0x17')])){return logger[_0x7568('0xc')](_0x7568('0x32'));}if(_[_0x7568('0x31')](_0x47ffe9['subtractUnit'])){return logger[_0x7568('0xc')](_0x7568('0x33'));}var _0x3f847a={'startDate':moment()[_0x7568('0x34')](_0x47ffe9['subtractNumber'],_0x47ffe9[_0x7568('0x18')])[_0x7568('0x10')](_0x7568('0x35')),'endDate':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'type':_0x7568('0x36'),'output':_0x47ffe9[_0x7568('0x37')],'name':_0x47ffe9[_0x7568('0x12')]};if(!_['isNil'](_0x47ffe9[_0x7568('0x38')])){logger[_0x7568('0xc')]('exec\x20defaul\x20report\x20id:%s',_0x47ffe9[_0x7568('0x38')]);return analyticDefaultReportController['runReport']({'id':_0x47ffe9[_0x7568('0x38')]},_0x3f847a)[_0x7568('0x2a')](handleResult(_0x47ffe9))[_0x7568('0x2e')](handleError());}if(!_[_0x7568('0x31')](_0x47ffe9[_0x7568('0x39')])){logger[_0x7568('0xc')](_0x7568('0x3a'),_0x47ffe9['CustomReportId']);return analyticCustomReportController['runReport']({'id':_0x47ffe9[_0x7568('0x39')]},_0x3f847a)[_0x7568('0x2a')](handleResult(_0x47ffe9))[_0x7568('0x2e')](handleError());}}catch(_0x1dadaa){logger[_0x7568('0x2b')](JSON['stringify'](_0x1dadaa));}return logger['info'](_0x7568('0x3b'));};}function getJobs(_0x1ddae7){var _0x2862f0={};if(_0x1ddae7){_0x2862f0['id']=_0x1ddae7;}return db[_0x7568('0x3c')][_0x7568('0x3d')]({'where':_0x2862f0,'include':[{'model':db[_0x7568('0x13')],'attributes':['id',_0x7568('0x12'),_0x7568('0xe')],'include':[{'model':db[_0x7568('0x3e')],'as':_0x7568('0x30'),'include':[{'model':db[_0x7568('0x3f')],'as':_0x7568('0x3f')}]}]}]})[_0x7568('0x2a')](function(_0x13f8d9){var _0x115ee7=_[_0x7568('0x40')](manager[_0x7568('0x41')]);var _0x378336=_[_0x7568('0x42')](_0x13f8d9,function(_0x23d447){return _0x23d447['id'][_0x7568('0x43')]();});var _0x433533=_[_0x7568('0x44')](_0x13f8d9,function(_0x13966e){return _0x13966e['id'][_0x7568('0x43')]();});var _0x578ee2=_0x1ddae7?_0x378336:_[_0x7568('0x45')](_0x378336,_0x115ee7);var _0x4578ab=_[_0x7568('0x46')](_0x378336,_0x115ee7);var _0x5dbc53=_[_0x7568('0x45')](_0x115ee7,_0x378336);var _0x2fb244;var _0x5cbafc;for(_0x2fb244=0x0;_0x2fb244<_0x5dbc53[_0x7568('0x47')]&&!_0x1ddae7;_0x2fb244+=0x1){_0x5cbafc=_0x5dbc53[_0x2fb244][_0x7568('0x43')]();if(manager[_0x7568('0x48')](_0x5cbafc)){manager[_0x7568('0x49')](_0x5cbafc);manager['deleteJob'](_0x5cbafc);logger[_0x7568('0xc')](_0x7568('0x4a'),_0x5cbafc);}}logger[_0x7568('0xc')](_0x7568('0x4b'),JSON[_0x7568('0x25')](_0x578ee2));for(_0x2fb244=0x0;_0x2fb244<_0x578ee2[_0x7568('0x47')];_0x2fb244+=0x1){_0x5cbafc=_0x578ee2[_0x2fb244][_0x7568('0x43')]();logger['info']('index',_0x5cbafc);if(_0x1ddae7){logger[_0x7568('0xc')](_0x7568('0x4c'),_0x1ddae7);logger[_0x7568('0xc')](JSON[_0x7568('0x25')](_0x433533[_0x5cbafc]));BPromise[_0x7568('0x4d')]()[_0x7568('0x2a')](handleJob(_0x433533[_0x5cbafc]));logger[_0x7568('0xc')]('run\x20job',_0x433533[_0x5cbafc]['name'],_0x433533[_0x5cbafc]['cron']);}else if(_0x433533[_0x5cbafc][_0x7568('0x4e')]&&_0x433533[_0x5cbafc]['active']&&moment()[_0x7568('0x4f')](_0x433533[_0x5cbafc][_0x7568('0x50')],_0x433533[_0x5cbafc][_0x7568('0x51')])){manager[_0x7568('0x52')](_0x5cbafc,_0x433533[_0x5cbafc][_0x7568('0x4e')],handleJob(_0x433533[_0x5cbafc]));manager[_0x7568('0x53')](_0x5cbafc);logger['info'](_0x7568('0x54'),_0x433533[_0x5cbafc][_0x7568('0x12')],_0x433533[_0x5cbafc][_0x7568('0x4e')]);}else if(manager[_0x7568('0x48')](_0x5cbafc)){manager[_0x7568('0x49')](_0x5cbafc);manager[_0x7568('0x55')](_0x5cbafc);logger[_0x7568('0xc')](_0x7568('0x56'),_0x433533[_0x5cbafc][_0x7568('0x12')],_0x433533[_0x5cbafc][_0x7568('0x4e')]);}}for(_0x2fb244=0x0,_0x5cbafc;_0x2fb244<_0x4578ab[_0x7568('0x47')]&&!_0x1ddae7;_0x2fb244+=0x1){_0x5cbafc=_0x4578ab[_0x2fb244]['toString']();if(manager[_0x7568('0x48')](_0x5cbafc)){if(_0x433533[_0x5cbafc][_0x7568('0x4e')]&&_0x433533[_0x5cbafc][_0x7568('0x57')]&&moment()['isBetween'](_0x433533[_0x5cbafc][_0x7568('0x50')],_0x433533[_0x5cbafc][_0x7568('0x51')])){manager[_0x7568('0x58')](_0x5cbafc,_0x433533[_0x5cbafc][_0x7568('0x4e')],handleJob(_0x433533[_0x5cbafc]));logger['info'](_0x7568('0x59'),_0x433533[_0x5cbafc][_0x7568('0x12')],_0x433533[_0x5cbafc]['cron']);}else{manager[_0x7568('0x49')](_0x5cbafc);manager['deleteJob'](_0x5cbafc);logger[_0x7568('0xc')]('stop\x20cron',_0x433533[_0x5cbafc]['name'],_0x433533[_0x5cbafc][_0x7568('0x4e')]);}}}})[_0x7568('0x2e')](function(_0xcf3957){logger['error'](JSON[_0x7568('0x25')](_0xcf3957));});}exports[_0x7568('0x5a')]=function(_0x1e49eb){return getJobs(_0x1e49eb);};exports[_0x7568('0x53')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x5365=['Smtp','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','basename','extname','zip','Sent','message','stringify','existsSync','status','attachments','text','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','request','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','CloudProvider','keys','jobs','map','toString','difference','intersection','exists','stop','delete\x20cron','toRun','length','index','my\x20id','cron','isBetween','startAt','endAt','add','start','add\x20cron','deleteJob','stop\x20cron','active','update','update\x20cron','run','util','path','lodash','cron-job-manager','jayson/promise','../logger','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','name'];(function(_0x2689a7,_0x5a3c32){var _0xe102f4=function(_0x5f1db1){while(--_0x5f1db1){_0x2689a7['push'](_0x2689a7['shift']());}};_0xe102f4(++_0x5a3c32);}(_0x5365,0x19c));var _0x5536=function(_0x2341ff,_0x4890b8){_0x2341ff=_0x2341ff-0x0;var _0x46c06e=_0x5365[_0x2341ff];return _0x46c06e;};'use strict';var fs=require('fs');var util=require(_0x5536('0x0'));var path=require(_0x5536('0x1'));var _=require(_0x5536('0x2'));var moment=require('moment');var CronJobManager=require(_0x5536('0x3'));var jayson=require(_0x5536('0x4'));var BPromise=require('bluebird');var logger=require(_0x5536('0x5'))(_0x5536('0x6'));var db=require(_0x5536('0x7'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x5536('0x8'));var client=jayson[_0x5536('0x9')][_0x5536('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x1e402a,_0x19bc04){return function(){logger[_0x5536('0xb')](_0x5536('0xc'),_0x1e402a[_0x5536('0xd')]);var _0x484d69=!![];var _0x2e5946=_0x1e402a[_0x5536('0xe')][_0x5536('0xf')]();var _0x29cbd8={'account':_0x2e5946,'message':{'from':util[_0x5536('0x10')]('\x22%s\x22\x20<%s>',_0x1e402a['MailAccount'][_0x5536('0x11')],_0x1e402a['MailAccount'][_0x5536('0xd')]||_0x1e402a[_0x5536('0xe')][_0x5536('0x12')][_0x5536('0x13')]),'to':_0x1e402a['email'],'cc':_0x1e402a['cc'],'bcc':_0x1e402a[_0x5536('0x14')],'subject':util[_0x5536('0x10')](_0x5536('0x15'),_0x19bc04[_0x5536('0x11')],_0x1e402a[_0x5536('0x16')],_0x1e402a[_0x5536('0x17')])}};var _0x583212=path[_0x5536('0x18')](__dirname,_0x5536('0x19'));var _0x20ef8f=_0x19bc04[_0x5536('0x1a')];var _0x450264=util[_0x5536('0x10')]('%s.%s',path[_0x5536('0x1b')](_0x19bc04[_0x5536('0x1a')],path[_0x5536('0x1c')](_0x19bc04[_0x5536('0x1a')])),_0x5536('0x1d'));var _0xabea73=path['join'](_0x583212,_0x20ef8f);var _0x53ba90=path[_0x5536('0x18')](_0x583212,_0x450264);if(fs['existsSync'](_0xabea73)){_0x19bc04['status']=_0x5536('0x1e');_0x29cbd8[_0x5536('0x1f')]['attachments']=[{'filename':_0x20ef8f,'path':_0xabea73}];_0x29cbd8[_0x5536('0x1f')]['text']=util['format']('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0x5536('0x20')](_0x19bc04,null,0x2));}else if(fs[_0x5536('0x21')](_0x53ba90)){_0x19bc04[_0x5536('0x22')]=_0x5536('0x1e');_0x29cbd8[_0x5536('0x1f')][_0x5536('0x23')]=[{'filename':_0x450264,'path':_0x53ba90}];}else{_0x29cbd8[_0x5536('0x1f')][_0x5536('0x24')]=_0x5536('0x25');if(!_0x1e402a['sendIfEmpty']){_0x484d69=![];logger['info']('empty\x20file,\x20email\x20not\x20sent');}}if(_0x484d69){return client[_0x5536('0x26')]('SendMail',_0x29cbd8)[_0x5536('0x27')](function(_0x36a03c){if(_0x36a03c[_0x5536('0x28')]){return logger[_0x5536('0x28')](_0x5536('0x29'),JSON[_0x5536('0x20')](_0x36a03c));}return logger[_0x5536('0xb')](_0x5536('0x2a'));})[_0x5536('0x2b')](function(_0x4d57f5){return logger['error']('error\x20mail',JSON[_0x5536('0x20')](_0x4d57f5));});}};}function handleError(){return function(_0x25cfc2){return logger[_0x5536('0x28')](JSON[_0x5536('0x20')](_0x25cfc2));};}function handleResult(_0x5290e3){return function(_0x144ae8){logger['info'](_0x5536('0x2c'),JSON[_0x5536('0x20')](_0x144ae8));if(_0x5290e3[_0x5536('0xe')]&&_0x5290e3[_0x5536('0xe')][_0x5536('0x12')]&&!_[_0x5536('0x2d')](_0x5290e3[_0x5536('0xd')])){setTimeout(handleSendEmail(_0x5290e3,_0x144ae8),0x3c*0x3e8);}};}function handleJob(_0x21580f){return function(){try{if(_[_0x5536('0x2d')](_0x21580f[_0x5536('0x16')])){return logger[_0x5536('0xb')](_0x5536('0x2e'));}if(_[_0x5536('0x2d')](_0x21580f['subtractUnit'])){return logger[_0x5536('0xb')](_0x5536('0x2f'));}var _0x4b6020={'startDate':moment()[_0x5536('0x30')](_0x21580f['subtractNumber'],_0x21580f[_0x5536('0x17')])[_0x5536('0x10')](_0x5536('0x31')),'endDate':moment()[_0x5536('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0x5536('0x32'),'output':_0x21580f[_0x5536('0x33')],'name':_0x21580f[_0x5536('0x11')]};if(!_[_0x5536('0x2d')](_0x21580f['DefaultReportId'])){logger[_0x5536('0xb')](_0x5536('0x34'),_0x21580f[_0x5536('0x35')]);return analyticDefaultReportController[_0x5536('0x36')]({'id':_0x21580f[_0x5536('0x35')]},_0x4b6020)[_0x5536('0x27')](handleResult(_0x21580f))['catch'](handleError());}if(!_[_0x5536('0x2d')](_0x21580f[_0x5536('0x37')])){logger['info'](_0x5536('0x38'),_0x21580f[_0x5536('0x37')]);return analyticCustomReportController[_0x5536('0x36')]({'id':_0x21580f[_0x5536('0x37')]},_0x4b6020)['then'](handleResult(_0x21580f))[_0x5536('0x2b')](handleError());}}catch(_0x1954b8){logger[_0x5536('0x28')](JSON['stringify'](_0x1954b8));}return logger[_0x5536('0xb')](_0x5536('0x39'));};}function getJobs(_0x1ce6a4){var _0x5f3457={};if(_0x1ce6a4){_0x5f3457['id']=_0x1ce6a4;}return db[_0x5536('0x3a')]['findAll']({'where':_0x5f3457,'include':[{'model':db['MailAccount'],'attributes':['id','name',_0x5536('0xd')],'include':[{'model':db['MailServerOut'],'as':_0x5536('0x12'),'include':[{'model':db[_0x5536('0x3b')],'as':_0x5536('0x3b')}]}]}]})[_0x5536('0x27')](function(_0x361516){var _0x252063=_[_0x5536('0x3c')](manager[_0x5536('0x3d')]);var _0x523a88=_[_0x5536('0x3e')](_0x361516,function(_0x16b8ce){return _0x16b8ce['id']['toString']();});var _0x38202d=_['keyBy'](_0x361516,function(_0x130e47){return _0x130e47['id'][_0x5536('0x3f')]();});var _0x349f7b=_0x1ce6a4?_0x523a88:_[_0x5536('0x40')](_0x523a88,_0x252063);var _0x349d62=_[_0x5536('0x41')](_0x523a88,_0x252063);var _0x110154=_['difference'](_0x252063,_0x523a88);var _0x5dcc32;var _0x4d931b;for(_0x5dcc32=0x0;_0x5dcc32<_0x110154['length']&&!_0x1ce6a4;_0x5dcc32+=0x1){_0x4d931b=_0x110154[_0x5dcc32][_0x5536('0x3f')]();if(manager[_0x5536('0x42')](_0x4d931b)){manager[_0x5536('0x43')](_0x4d931b);manager['deleteJob'](_0x4d931b);logger['info'](_0x5536('0x44'),_0x4d931b);}}logger[_0x5536('0xb')](_0x5536('0x45'),JSON['stringify'](_0x349f7b));for(_0x5dcc32=0x0;_0x5dcc32<_0x349f7b[_0x5536('0x46')];_0x5dcc32+=0x1){_0x4d931b=_0x349f7b[_0x5dcc32][_0x5536('0x3f')]();logger[_0x5536('0xb')](_0x5536('0x47'),_0x4d931b);if(_0x1ce6a4){logger['info'](_0x5536('0x48'),_0x1ce6a4);logger['info'](JSON[_0x5536('0x20')](_0x38202d[_0x4d931b]));BPromise['resolve']()['then'](handleJob(_0x38202d[_0x4d931b]));logger['info']('run\x20job',_0x38202d[_0x4d931b]['name'],_0x38202d[_0x4d931b][_0x5536('0x49')]);}else if(_0x38202d[_0x4d931b][_0x5536('0x49')]&&_0x38202d[_0x4d931b]['active']&&moment()[_0x5536('0x4a')](_0x38202d[_0x4d931b][_0x5536('0x4b')],_0x38202d[_0x4d931b][_0x5536('0x4c')])){manager[_0x5536('0x4d')](_0x4d931b,_0x38202d[_0x4d931b][_0x5536('0x49')],handleJob(_0x38202d[_0x4d931b]));manager[_0x5536('0x4e')](_0x4d931b);logger[_0x5536('0xb')](_0x5536('0x4f'),_0x38202d[_0x4d931b][_0x5536('0x11')],_0x38202d[_0x4d931b][_0x5536('0x49')]);}else if(manager[_0x5536('0x42')](_0x4d931b)){manager[_0x5536('0x43')](_0x4d931b);manager[_0x5536('0x50')](_0x4d931b);logger[_0x5536('0xb')](_0x5536('0x51'),_0x38202d[_0x4d931b][_0x5536('0x11')],_0x38202d[_0x4d931b][_0x5536('0x49')]);}}for(_0x5dcc32=0x0,_0x4d931b;_0x5dcc32<_0x349d62[_0x5536('0x46')]&&!_0x1ce6a4;_0x5dcc32+=0x1){_0x4d931b=_0x349d62[_0x5dcc32][_0x5536('0x3f')]();if(manager[_0x5536('0x42')](_0x4d931b)){if(_0x38202d[_0x4d931b][_0x5536('0x49')]&&_0x38202d[_0x4d931b][_0x5536('0x52')]&&moment()[_0x5536('0x4a')](_0x38202d[_0x4d931b][_0x5536('0x4b')],_0x38202d[_0x4d931b][_0x5536('0x4c')])){manager[_0x5536('0x53')](_0x4d931b,_0x38202d[_0x4d931b][_0x5536('0x49')],handleJob(_0x38202d[_0x4d931b]));logger[_0x5536('0xb')](_0x5536('0x54'),_0x38202d[_0x4d931b][_0x5536('0x11')],_0x38202d[_0x4d931b][_0x5536('0x49')]);}else{manager[_0x5536('0x43')](_0x4d931b);manager[_0x5536('0x50')](_0x4d931b);logger['info'](_0x5536('0x51'),_0x38202d[_0x4d931b][_0x5536('0x11')],_0x38202d[_0x4d931b][_0x5536('0x49')]);}}}})[_0x5536('0x2b')](function(_0x4bfb72){logger[_0x5536('0x28')](JSON[_0x5536('0x20')](_0x4bfb72));});}exports[_0x5536('0x55')]=function(_0x1623d9){return getJobs(_0x1623d9);};exports[_0x5536('0x4e')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index 31e89d3..56e97f3 100644 --- a/server/config/schedule/transcribe.js +++ b/server/config/schedule/transcribe.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x235a=['then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','fileText','TranscriptionJob','TranscriptionJobStatus','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','sentiment','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','sentimentRegion','language','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','update','Sentiment','SentimentScore','Positive','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Sentiment\x20Analysis\x20not\x20requested','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Negative','Mixed','Neutral','COMPLETED','catch','name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','bucket','Transcribe\x20not\x20configured','push','error','start','lodash','aws-sdk','request-promise','bluebird','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion'];(function(_0x2202fa,_0x79a46d){var _0x108bed=function(_0x11f5c7){while(--_0x11f5c7){_0x2202fa['push'](_0x2202fa['shift']());}};_0x108bed(++_0x79a46d);}(_0x235a,0x1ef));var _0xa235=function(_0x5bb106,_0x1f8961){_0x5bb106=_0x5bb106-0x0;var _0xbd1b71=_0x235a[_0x5bb106];return _0xbd1b71;};var _=require(_0xa235('0x0'));var AWS=require(_0xa235('0x1'));var rp=require(_0xa235('0x2'));var util=require('util');var BPromise=require(_0xa235('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0xa235('0x4'))(_0xa235('0x5'));function getTranscriptionJob(_0x277a68,_0x314ebf,_0x2e6eca,_0x5e94b0){return new Promise(function(_0x2961c8,_0x1707fc){var _0x4b849b=new AWS[(_0xa235('0x6'))]({'accessKeyId':_0x314ebf,'secretAccessKey':_0x277a68,'region':_0x2e6eca});_0x4b849b[_0xa235('0x7')]({'TranscriptionJobName':_0x5e94b0},function(_0x450e27,_0x2f3403){if(_0x450e27){return _0x1707fc(_0x450e27);}else{return _0x2961c8(_0x2f3403);}});});}function sentiment(_0x5c60d9,_0x2f73d3,_0x561602,_0x560eb1,_0x10bb4f){return new Promise(function(_0x504b60,_0xbde1c7){var _0x535bb9=new AWS['Comprehend']({'accessKeyId':_0x2f73d3,'secretAccessKey':_0x5c60d9,'region':_0x561602});_0x535bb9['detectSentiment']({'Text':_0x560eb1,'LanguageCode':_0x10bb4f[_0xa235('0x8')](0x0,0x2)},function(_0x3026d1,_0x3e620c){if(_0x3026d1){return _0xbde1c7(_0x3026d1);}else{return _0x504b60(_0x3e620c);}});});}function checkTranscribeJob(_0x1fe5cf,_0x5330db,_0x5510ff){var _0x47aad7;return new BPromise(function(_0x3187e4,_0x1080d7){logger[_0xa235('0x9')](util[_0xa235('0xa')](_0xa235('0xb'),_0x1fe5cf['id'],_0x1fe5cf[_0xa235('0xc')]));return getTranscriptionJob(_0x5510ff[_0xa235('0xd')],_0x5510ff[_0xa235('0xe')],_0x5330db[_0xa235('0xf')],_0x1fe5cf['transcribeName'])[_0xa235('0x10')](function(_0x20cd67){logger[_0xa235('0x9')](util[_0xa235('0xa')](_0xa235('0x11'),_0x1fe5cf['id'],_0x1fe5cf[_0xa235('0xc')],_0x20cd67['TranscriptionJob']['TranscriptionJobStatus']));if(!_0x1fe5cf[_0xa235('0x12')]){switch(_0x20cd67[_0xa235('0x13')][_0xa235('0x14')]){case'COMPLETED':var _0x40b4a9={'transcribeStatus':_0x20cd67[_0xa235('0x13')][_0xa235('0x14')],'fileUri':_0x20cd67[_0xa235('0x13')][_0xa235('0x15')][_0xa235('0x16')]};logger[_0xa235('0x9')](util['format']('[RECORDING:%d]\x20Get\x20transcript',_0x1fe5cf['id']));return rp({'uri':_0x20cd67[_0xa235('0x13')][_0xa235('0x15')][_0xa235('0x16')],'json':!![]})[_0xa235('0x10')](function(_0x2e38e){logger[_0xa235('0x9')](util[_0xa235('0xa')](_0xa235('0x17'),_0x1fe5cf['id']));if(_0x2e38e&&_0x2e38e[_0xa235('0x18')]&&_0x2e38e[_0xa235('0x18')][_0xa235('0x19')]&&_0x2e38e[_0xa235('0x18')][_0xa235('0x19')][_0xa235('0x1a')]){_0x40b4a9[_0xa235('0x12')]='';for(var _0x3364ee=0x0;_0x3364ee<_0x2e38e[_0xa235('0x18')][_0xa235('0x19')][_0xa235('0x1a')];_0x3364ee++){_0x40b4a9[_0xa235('0x12')]+=_0x2e38e[_0xa235('0x18')]['transcripts'][_0x3364ee][_0xa235('0x1b')]+'';}}return _0x1fe5cf['update'](_0x40b4a9);})[_0xa235('0x10')](function(){logger['info'](util[_0xa235('0xa')](_0xa235('0x1c'),_0x1fe5cf['id']));if(!_0x1fe5cf[_0xa235('0x1d')]){throw new db[(_0xa235('0x1e'))][(_0xa235('0x1f'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x5330db[_0xa235('0x20')]||!_0x5330db[_0xa235('0x21')]||!_0x5330db['sentimentRegion']||!_0x5330db['language']||!_0x5330db['bucket']){throw new db['Sequelize'][(_0xa235('0x1f'))](_0xa235('0x22'));}if(!_0x40b4a9[_0xa235('0x12')]){throw new Error(_0xa235('0x23'));}if(_0x5330db[_0xa235('0x21')]===_0x5510ff['id']){return _0x5510ff;}else{return db[_0xa235('0x24')][_0xa235('0x25')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x2832be){if(!_0x2832be){throw new db[(_0xa235('0x1e'))]['ValidationError'](_0xa235('0x26'));}if(!_0x2832be[_0xa235('0xd')]||!_0x2832be[_0xa235('0xe')]){throw new db[(_0xa235('0x1e'))][(_0xa235('0x1f'))](_0xa235('0x27'));}_0x47aad7=_0x2832be;logger[_0xa235('0x9')](util[_0xa235('0xa')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x1fe5cf['id']));return sentiment(_0x47aad7[_0xa235('0xd')],_0x47aad7['data2'],_0x5330db[_0xa235('0x28')],_0x40b4a9[_0xa235('0x12')],_0x5330db[_0xa235('0x29')]);})[_0xa235('0x10')](function(_0x453571){logger[_0xa235('0x9')](util[_0xa235('0xa')](_0xa235('0x2a'),_0x1fe5cf['id']));return _0x1fe5cf[_0xa235('0x2b')]({'sentiment':_0x453571[_0xa235('0x2c')],'sPositive':_0x453571[_0xa235('0x2d')][_0xa235('0x2e')],'sNegative':_0x453571[_0xa235('0x2d')]['Negative'],'sMixed':_0x453571['SentimentScore']['Mixed'],'sNeutral':_0x453571[_0xa235('0x2d')]['Neutral']});})[_0xa235('0x10')](function(){logger[_0xa235('0x9')](util[_0xa235('0xa')](_0xa235('0x1c'),_0x1fe5cf['id']));_0x3187e4();});case _0xa235('0x2f'):return _0x1fe5cf[_0xa235('0x2b')]({'transcribeStatus':_0xa235('0x2f'),'failureReason':_0x20cd67['TranscriptionJob'][_0xa235('0x30')]})[_0xa235('0x10')](function(){logger['info'](util[_0xa235('0xa')](_0xa235('0x1c'),_0x1fe5cf['id']));_0x3187e4();});default:logger[_0xa235('0x9')](util[_0xa235('0xa')](_0xa235('0x31'),_0x1fe5cf['id']));break;}}else{return BPromise[_0xa235('0x32')]()[_0xa235('0x10')](function(){if(!_0x1fe5cf[_0xa235('0x1d')]){throw new db[(_0xa235('0x1e'))]['ValidationError'](_0xa235('0x33'));}if(!_0x5330db[_0xa235('0x20')]||!_0x5330db[_0xa235('0x21')]||!_0x5330db[_0xa235('0x28')]||!_0x5330db[_0xa235('0x29')]||!_0x5330db['bucket']){throw new db[(_0xa235('0x1e'))][(_0xa235('0x1f'))](_0xa235('0x22'));}if(!_0x1fe5cf[_0xa235('0x12')]){throw new Error('Transcript\x20not\x20available');}if(_0x5330db[_0xa235('0x21')]===_0x5510ff['id']){return _0x5510ff;}else{return db[_0xa235('0x24')][_0xa235('0x25')]({'where':{'id':_settings[_0xa235('0x21')]}});}})[_0xa235('0x10')](function(_0x22caf6){if(!_0x22caf6){throw new db[(_0xa235('0x1e'))]['ValidationError'](_0xa235('0x26'));}if(!_0x22caf6[_0xa235('0xd')]||!_0x22caf6[_0xa235('0xe')]){throw new db[(_0xa235('0x1e'))][(_0xa235('0x1f'))]('Cloud\x20Provider\x20not\x20configured');}_0x47aad7=_0x22caf6;logger[_0xa235('0x9')](util[_0xa235('0xa')](_0xa235('0x34'),_0x1fe5cf['id']));return sentiment(_0x47aad7[_0xa235('0xd')],_0x47aad7[_0xa235('0xe')],_0x5330db['sentimentRegion'],_0x1fe5cf[_0xa235('0x12')],_0x5330db[_0xa235('0x29')]);})[_0xa235('0x10')](function(_0x59de31){logger[_0xa235('0x9')](util[_0xa235('0xa')](_0xa235('0x2a'),_0x1fe5cf['id']));return _0x1fe5cf[_0xa235('0x2b')]({'sentiment':_0x59de31['Sentiment'],'sPositive':_0x59de31[_0xa235('0x2d')][_0xa235('0x2e')],'sNegative':_0x59de31[_0xa235('0x2d')][_0xa235('0x35')],'sMixed':_0x59de31[_0xa235('0x2d')][_0xa235('0x36')],'sNeutral':_0x59de31[_0xa235('0x2d')][_0xa235('0x37')],'transcribeStatus':_0xa235('0x38')});})['then'](function(){logger[_0xa235('0x9')](util[_0xa235('0xa')](_0xa235('0x1c'),_0x1fe5cf['id']));_0x3187e4();});}})[_0xa235('0x39')](function(_0x38d6ec){if(_0x38d6ec){if(!_0x38d6ec['name']||_0x38d6ec[_0xa235('0x3a')]!==_0xa235('0x3b')){logger['error'](util[_0xa235('0xa')](_0xa235('0x3c'),_0x1fe5cf['id']),util[_0xa235('0x3d')](_0x38d6ec,{'showHidden':![],'depth':null}));}}_0x3187e4();});});}function checkTranscribe(){var _0x2e7562;var _0x5c735d;var _0x16d9e8;return db['VoiceRecording'][_0xa235('0x3e')]({'where':{'transcribeStatus':_0xa235('0x3f')}})['then'](function(_0x308dc1){if(!_0x308dc1||!_0x308dc1[_0xa235('0x1a')]){throw new db[(_0xa235('0x1e'))][(_0xa235('0x1f'))](_0xa235('0x40'));}_0x2e7562=_0x308dc1;return db[_0xa235('0x41')][_0xa235('0x25')]({'where':{'id':0x1}});})[_0xa235('0x10')](function(_0x5ab614){if(!_0x5ab614){throw new db['Sequelize']['ValidationError'](_0xa235('0x42'));}_0x5c735d=_0x5ab614;if(!_0x5c735d[_0xa235('0x5')]||!_0x5c735d[_0xa235('0x43')]||!_0x5c735d[_0xa235('0xf')]||!_0x5c735d['language']||!_0x5c735d[_0xa235('0x44')]){throw new db['Sequelize'][(_0xa235('0x1f'))](_0xa235('0x45'));}return db[_0xa235('0x24')][_0xa235('0x25')]({'where':{'id':_0x5c735d['transcribeAccountId']}});})[_0xa235('0x10')](function(_0x51144e){if(!_0x51144e){throw new db[(_0xa235('0x1e'))][(_0xa235('0x1f'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x51144e[_0xa235('0xd')]||!_0x51144e[_0xa235('0xe')]){throw new db[(_0xa235('0x1e'))][(_0xa235('0x1f'))]('Cloud\x20Provider\x20not\x20configured');}_0x16d9e8=_0x51144e;var _0x550f21=[];_0x2e7562['forEach'](function(_0x386ba7){_0x550f21[_0xa235('0x46')](checkTranscribeJob(_0x386ba7,_0x5c735d,_0x16d9e8));});return BPromise['all'](_0x550f21);})['catch'](function(_0x9ce653){if(_0x9ce653){if(!_0x9ce653['name']||_0x9ce653['name']!==_0xa235('0x3b')){logger[_0xa235('0x47')](util[_0xa235('0x3d')](_0x9ce653,{'showHidden':![],'depth':null}));}}});}exports[_0xa235('0x48')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x8c7a=['../../mysqldb','../../config/logger','transcribe','getTranscriptionJob','Comprehend','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','fileText','TranscriptionJob','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentiment','ValidationError','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','language','update','Sentiment','Positive','SentimentScore','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','catch','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','Settings\x20not\x20available','transcribeAccountId','bucket','Transcribe\x20not\x20configured','all','name','SequelizeValidationError','start','lodash','util'];(function(_0xc5a279,_0x155360){var _0xc755d3=function(_0x15051c){while(--_0x15051c){_0xc5a279['push'](_0xc5a279['shift']());}};_0xc755d3(++_0x155360);}(_0x8c7a,0x8c));var _0xa8c7=function(_0x987d10,_0x2c4677){_0x987d10=_0x987d10-0x0;var _0x5cdfc3=_0x8c7a[_0x987d10];return _0x5cdfc3;};var _=require(_0xa8c7('0x0'));var AWS=require('aws-sdk');var rp=require('request-promise');var util=require(_0xa8c7('0x1'));var BPromise=require('bluebird');var db=require(_0xa8c7('0x2'))['db'];var logger=require(_0xa8c7('0x3'))(_0xa8c7('0x4'));function getTranscriptionJob(_0x582b2c,_0x4a58b9,_0x13d954,_0x21780c){return new Promise(function(_0x1afbe0,_0x2ecdf1){var _0x416db0=new AWS['TranscribeService']({'accessKeyId':_0x4a58b9,'secretAccessKey':_0x582b2c,'region':_0x13d954});_0x416db0[_0xa8c7('0x5')]({'TranscriptionJobName':_0x21780c},function(_0x5b85e2,_0x1338c6){if(_0x5b85e2){return _0x2ecdf1(_0x5b85e2);}else{return _0x1afbe0(_0x1338c6);}});});}function sentiment(_0x3bec48,_0x3e9fe9,_0x31e479,_0x15e0a1,_0x57bd28){return new Promise(function(_0x5e8a9e,_0x2b2b42){var _0x79ba9a=new AWS[(_0xa8c7('0x6'))]({'accessKeyId':_0x3e9fe9,'secretAccessKey':_0x3bec48,'region':_0x31e479});_0x79ba9a['detectSentiment']({'Text':_0x15e0a1,'LanguageCode':_0x57bd28['substring'](0x0,0x2)},function(_0x57baf7,_0x31f131){if(_0x57baf7){return _0x2b2b42(_0x57baf7);}else{return _0x5e8a9e(_0x31f131);}});});}function checkTranscribeJob(_0x19892c,_0x441533,_0x210b8b){var _0x29f6dd;return new BPromise(function(_0x2784c0,_0x380fb8){logger[_0xa8c7('0x7')](util['format'](_0xa8c7('0x8'),_0x19892c['id'],_0x19892c[_0xa8c7('0x9')]));return getTranscriptionJob(_0x210b8b[_0xa8c7('0xa')],_0x210b8b[_0xa8c7('0xb')],_0x441533[_0xa8c7('0xc')],_0x19892c[_0xa8c7('0x9')])[_0xa8c7('0xd')](function(_0x256c04){logger[_0xa8c7('0x7')](util[_0xa8c7('0xe')](_0xa8c7('0xf'),_0x19892c['id'],_0x19892c[_0xa8c7('0x9')],_0x256c04['TranscriptionJob'][_0xa8c7('0x10')]));if(!_0x19892c[_0xa8c7('0x11')]){switch(_0x256c04[_0xa8c7('0x12')][_0xa8c7('0x10')]){case _0xa8c7('0x13'):var _0x2eef0b={'transcribeStatus':_0x256c04['TranscriptionJob'][_0xa8c7('0x10')],'fileUri':_0x256c04[_0xa8c7('0x12')][_0xa8c7('0x14')][_0xa8c7('0x15')]};logger[_0xa8c7('0x7')](util[_0xa8c7('0xe')](_0xa8c7('0x16'),_0x19892c['id']));return rp({'uri':_0x256c04[_0xa8c7('0x12')][_0xa8c7('0x14')]['TranscriptFileUri'],'json':!![]})['then'](function(_0x2e37c2){logger[_0xa8c7('0x7')](util[_0xa8c7('0xe')](_0xa8c7('0x17'),_0x19892c['id']));if(_0x2e37c2&&_0x2e37c2[_0xa8c7('0x18')]&&_0x2e37c2[_0xa8c7('0x18')][_0xa8c7('0x19')]&&_0x2e37c2[_0xa8c7('0x18')][_0xa8c7('0x19')][_0xa8c7('0x1a')]){_0x2eef0b[_0xa8c7('0x11')]='';for(var _0x4ea629=0x0;_0x4ea629<_0x2e37c2[_0xa8c7('0x18')][_0xa8c7('0x19')]['length'];_0x4ea629++){_0x2eef0b[_0xa8c7('0x11')]+=_0x2e37c2[_0xa8c7('0x18')]['transcripts'][_0x4ea629][_0xa8c7('0x1b')]+'';}}return _0x19892c['update'](_0x2eef0b);})[_0xa8c7('0xd')](function(){logger[_0xa8c7('0x7')](util['format'](_0xa8c7('0x1c'),_0x19892c['id']));if(!_0x19892c[_0xa8c7('0x1d')]){throw new db[(_0xa8c7('0x1e'))]['ValidationError'](_0xa8c7('0x1f'));}if(!_0x441533[_0xa8c7('0x20')]||!_0x441533['sentimentAccountId']||!_0x441533['sentimentRegion']||!_0x441533['language']||!_0x441533['bucket']){throw new db[(_0xa8c7('0x1e'))][(_0xa8c7('0x21'))](_0xa8c7('0x22'));}if(!_0x2eef0b[_0xa8c7('0x11')]){throw new Error(_0xa8c7('0x23'));}if(_0x441533[_0xa8c7('0x24')]===_0x210b8b['id']){return _0x210b8b;}else{return db[_0xa8c7('0x25')][_0xa8c7('0x26')]({'where':{'id':_settings[_0xa8c7('0x24')]}});}})[_0xa8c7('0xd')](function(_0x19ae36){if(!_0x19ae36){throw new db['Sequelize'][(_0xa8c7('0x21'))](_0xa8c7('0x27'));}if(!_0x19ae36[_0xa8c7('0xa')]||!_0x19ae36[_0xa8c7('0xb')]){throw new db['Sequelize'][(_0xa8c7('0x21'))](_0xa8c7('0x28'));}_0x29f6dd=_0x19ae36;logger[_0xa8c7('0x7')](util[_0xa8c7('0xe')](_0xa8c7('0x29'),_0x19892c['id']));return sentiment(_0x29f6dd[_0xa8c7('0xa')],_0x29f6dd[_0xa8c7('0xb')],_0x441533[_0xa8c7('0x2a')],_0x2eef0b[_0xa8c7('0x11')],_0x441533[_0xa8c7('0x2b')]);})[_0xa8c7('0xd')](function(_0x2c6f35){logger[_0xa8c7('0x7')](util[_0xa8c7('0xe')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x19892c['id']));return _0x19892c[_0xa8c7('0x2c')]({'sentiment':_0x2c6f35[_0xa8c7('0x2d')],'sPositive':_0x2c6f35['SentimentScore'][_0xa8c7('0x2e')],'sNegative':_0x2c6f35[_0xa8c7('0x2f')][_0xa8c7('0x30')],'sMixed':_0x2c6f35[_0xa8c7('0x2f')][_0xa8c7('0x31')],'sNeutral':_0x2c6f35['SentimentScore'][_0xa8c7('0x32')]});})['then'](function(){logger[_0xa8c7('0x7')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x19892c['id']));_0x2784c0();});case _0xa8c7('0x33'):return _0x19892c['update']({'transcribeStatus':_0xa8c7('0x33'),'failureReason':_0x256c04[_0xa8c7('0x12')][_0xa8c7('0x34')]})[_0xa8c7('0xd')](function(){logger[_0xa8c7('0x7')](util[_0xa8c7('0xe')](_0xa8c7('0x1c'),_0x19892c['id']));_0x2784c0();});default:logger[_0xa8c7('0x7')](util[_0xa8c7('0xe')](_0xa8c7('0x35'),_0x19892c['id']));break;}}else{return BPromise[_0xa8c7('0x36')]()['then'](function(){if(!_0x19892c[_0xa8c7('0x1d')]){throw new db['Sequelize'][(_0xa8c7('0x21'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x441533['sentiment']||!_0x441533['sentimentAccountId']||!_0x441533['sentimentRegion']||!_0x441533['language']||!_0x441533['bucket']){throw new db[(_0xa8c7('0x1e'))][(_0xa8c7('0x21'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x19892c['fileText']){throw new Error(_0xa8c7('0x23'));}if(_0x441533[_0xa8c7('0x24')]===_0x210b8b['id']){return _0x210b8b;}else{return db[_0xa8c7('0x25')]['findOne']({'where':{'id':_settings[_0xa8c7('0x24')]}});}})[_0xa8c7('0xd')](function(_0x5263ec){if(!_0x5263ec){throw new db[(_0xa8c7('0x1e'))][(_0xa8c7('0x21'))](_0xa8c7('0x27'));}if(!_0x5263ec[_0xa8c7('0xa')]||!_0x5263ec[_0xa8c7('0xb')]){throw new db[(_0xa8c7('0x1e'))][(_0xa8c7('0x21'))](_0xa8c7('0x28'));}_0x29f6dd=_0x5263ec;logger[_0xa8c7('0x7')](util[_0xa8c7('0xe')](_0xa8c7('0x29'),_0x19892c['id']));return sentiment(_0x29f6dd[_0xa8c7('0xa')],_0x29f6dd['data2'],_0x441533[_0xa8c7('0x2a')],_0x19892c['fileText'],_0x441533[_0xa8c7('0x2b')]);})[_0xa8c7('0xd')](function(_0x493a9b){logger[_0xa8c7('0x7')](util[_0xa8c7('0xe')](_0xa8c7('0x37'),_0x19892c['id']));return _0x19892c[_0xa8c7('0x2c')]({'sentiment':_0x493a9b['Sentiment'],'sPositive':_0x493a9b[_0xa8c7('0x2f')][_0xa8c7('0x2e')],'sNegative':_0x493a9b[_0xa8c7('0x2f')][_0xa8c7('0x30')],'sMixed':_0x493a9b[_0xa8c7('0x2f')][_0xa8c7('0x31')],'sNeutral':_0x493a9b[_0xa8c7('0x2f')][_0xa8c7('0x32')],'transcribeStatus':_0xa8c7('0x13')});})[_0xa8c7('0xd')](function(){logger['info'](util[_0xa8c7('0xe')](_0xa8c7('0x1c'),_0x19892c['id']));_0x2784c0();});}})[_0xa8c7('0x38')](function(_0x3a1d75){if(_0x3a1d75){if(!_0x3a1d75['name']||_0x3a1d75['name']!=='SequelizeValidationError'){logger[_0xa8c7('0x39')](util[_0xa8c7('0xe')](_0xa8c7('0x3a'),_0x19892c['id']),util[_0xa8c7('0x3b')](_0x3a1d75,{'showHidden':![],'depth':null}));}}_0x2784c0();});});}function checkTranscribe(){var _0x433a54;var _0x47479e;var _0x1fb711;return db[_0xa8c7('0x3c')][_0xa8c7('0x3d')]({'where':{'transcribeStatus':_0xa8c7('0x3e')}})['then'](function(_0x4bd087){if(!_0x4bd087||!_0x4bd087[_0xa8c7('0x1a')]){throw new db[(_0xa8c7('0x1e'))][(_0xa8c7('0x21'))]('No\x20transcribe\x20job\x20to\x20check');}_0x433a54=_0x4bd087;return db['Setting'][_0xa8c7('0x26')]({'where':{'id':0x1}});})[_0xa8c7('0xd')](function(_0x104c01){if(!_0x104c01){throw new db['Sequelize'][(_0xa8c7('0x21'))](_0xa8c7('0x3f'));}_0x47479e=_0x104c01;if(!_0x47479e[_0xa8c7('0x4')]||!_0x47479e[_0xa8c7('0x40')]||!_0x47479e[_0xa8c7('0xc')]||!_0x47479e[_0xa8c7('0x2b')]||!_0x47479e[_0xa8c7('0x41')]){throw new db[(_0xa8c7('0x1e'))][(_0xa8c7('0x21'))](_0xa8c7('0x42'));}return db[_0xa8c7('0x25')][_0xa8c7('0x26')]({'where':{'id':_0x47479e[_0xa8c7('0x40')]}});})['then'](function(_0x49c14e){if(!_0x49c14e){throw new db[(_0xa8c7('0x1e'))][(_0xa8c7('0x21'))](_0xa8c7('0x27'));}if(!_0x49c14e[_0xa8c7('0xa')]||!_0x49c14e[_0xa8c7('0xb')]){throw new db[(_0xa8c7('0x1e'))][(_0xa8c7('0x21'))]('Cloud\x20Provider\x20not\x20configured');}_0x1fb711=_0x49c14e;var _0x1f5115=[];_0x433a54['forEach'](function(_0x1446bf){_0x1f5115['push'](checkTranscribeJob(_0x1446bf,_0x47479e,_0x1fb711));});return BPromise[_0xa8c7('0x43')](_0x1f5115);})[_0xa8c7('0x38')](function(_0xdb8d1e){if(_0xdb8d1e){if(!_0xdb8d1e['name']||_0xdb8d1e[_0xa8c7('0x44')]!==_0xa8c7('0x45')){logger[_0xa8c7('0x39')](util[_0xa8c7('0x3b')](_0xdb8d1e,{'showHidden':![],'depth':null}));}}});}exports[_0xa8c7('0x46')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index c97f314..61094fc 100644 --- a/server/config/schedule/whatsapp.js +++ b/server/config/schedule/whatsapp.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x10ee=['moment','util','../../mysqldb','../logger','schedule','redis','localhost','socket.io-emitter','WhatsappInteraction','lastMsgAt','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','timeout','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','catch','inspect','start','lodash'];(function(_0xad42a6,_0xc47139){var _0x44714b=function(_0x4d83c9){while(--_0x4d83c9){_0xad42a6['push'](_0xad42a6['shift']());}};_0x44714b(++_0xc47139);}(_0x10ee,0x9b));var _0xe10e=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x10ee[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0xe10e('0x0'));var moment=require(_0xe10e('0x1'));var Redis=require('ioredis');var util=require(_0xe10e('0x2'));var config=require('../../config/environment');var db=require(_0xe10e('0x3'))['db'];var logger=require(_0xe10e('0x4'))(_0xe10e('0x5'));config[_0xe10e('0x6')]=_['defaults'](config[_0xe10e('0x6')],{'host':_0xe10e('0x7'),'port':0x18eb});var io=require(_0xe10e('0x8'))(new Redis(config[_0xe10e('0x6')]));function closeInteractions(){var _0x30fd80=[];return db[_0xe10e('0x9')]['findAll']({'raw':!![],'attributes':['id',_0xe10e('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0xe10e('0xb'))}}})[_0xe10e('0xc')](function(_0x5acc91){if(_0x5acc91&&_0x5acc91[_0xe10e('0xd')]){_0x30fd80=_[_0xe10e('0xe')](_0x5acc91||[],'id');logger[_0xe10e('0xf')](_0xe10e('0x10'),_0x30fd80[_0xe10e('0x11')]());return db[_0xe10e('0x9')][_0xe10e('0x12')]({'closeReason':'system','disposition':_0xe10e('0x13'),'closed':!![],'closedAt':moment()['format'](_0xe10e('0x14'))},{'where':{'id':_0x30fd80}});}})[_0xe10e('0xc')](function(){if(_0x30fd80&&_0x30fd80[_0xe10e('0xd')]){logger[_0xe10e('0xf')](_0xe10e('0x15'),_0x30fd80[_0xe10e('0x11')]());for(var _0x5ec88c=0x0;_0x5ec88c<_0x30fd80[_0xe10e('0xd')];_0x5ec88c++){io[_0xe10e('0x16')]('whatsappInteraction:update',{'id':_0x30fd80[_0x5ec88c],'closed':!![]});}}})[_0xe10e('0x17')](function(_0xad2f2a){logger['error']('[WHATSAPP]\x20Error\x20closing\x20interactions',_0xad2f2a?util[_0xe10e('0x18')](_0xad2f2a,{'showHidden':![],'depth':null}):'');});}exports[_0xe10e('0x19')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x1666=['join','system','timeout','info','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','catch','error','inspect','start','lodash','ioredis','util','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','lastMsgAt','subtract','hours','then','length','map','[WHATSAPP]\x20Interactions\x20to\x20close:'];(function(_0x6b590b,_0x1a8745){var _0x518053=function(_0x19ea13){while(--_0x19ea13){_0x6b590b['push'](_0x6b590b['shift']());}};_0x518053(++_0x1a8745);}(_0x1666,0xbf));var _0x6166=function(_0xd2e8b9,_0x180b89){_0xd2e8b9=_0xd2e8b9-0x0;var _0x21d580=_0x1666[_0xd2e8b9];return _0x21d580;};'use strict';var _=require(_0x6166('0x0'));var moment=require('moment');var Redis=require(_0x6166('0x1'));var util=require(_0x6166('0x2'));var config=require(_0x6166('0x3'));var db=require(_0x6166('0x4'))['db'];var logger=require('../logger')('schedule');config[_0x6166('0x5')]=_[_0x6166('0x6')](config['redis'],{'host':_0x6166('0x7'),'port':0x18eb});var io=require(_0x6166('0x8'))(new Redis(config['redis']));function closeInteractions(){var _0x593187=[];return db[_0x6166('0x9')]['findAll']({'raw':!![],'attributes':['id',_0x6166('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x6166('0xb')](0x18,_0x6166('0xc'))}}})[_0x6166('0xd')](function(_0x1edda5){if(_0x1edda5&&_0x1edda5[_0x6166('0xe')]){_0x593187=_[_0x6166('0xf')](_0x1edda5||[],'id');logger['info'](_0x6166('0x10'),_0x593187[_0x6166('0x11')]());return db['WhatsappInteraction']['update']({'closeReason':_0x6166('0x12'),'disposition':_0x6166('0x13'),'closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x593187}});}})[_0x6166('0xd')](function(){if(_0x593187&&_0x593187[_0x6166('0xe')]){logger[_0x6166('0x14')](_0x6166('0x15'),_0x593187['join']());for(var _0x3075c5=0x0;_0x3075c5<_0x593187[_0x6166('0xe')];_0x3075c5++){io['emit']('whatsappInteraction:update',{'id':_0x593187[_0x3075c5],'closed':!![]});}}})[_0x6166('0x16')](function(_0x1b5de5){logger[_0x6166('0x17')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x1b5de5?util[_0x6166('0x18')](_0x1b5de5,{'showHidden':![],'depth':null}):'');});}exports[_0x6166('0x19')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index deb8b9a..2b39e69 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x93c3=['contacts1','CmHopper','hopper1','hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','now','@xcally.com','CmContact','destroy','bulkCreate','then','log','finished\x20populating'];(function(_0x379a60,_0x206cb4){var _0x4f2f73=function(_0x43f02a){while(--_0x43f02a){_0x379a60['push'](_0x379a60['shift']());}};_0x4f2f73(++_0x206cb4);}(_0x93c3,0x135));var _0x393c=function(_0x1b70f8,_0x546078){_0x1b70f8=_0x1b70f8-0x0;var _0xb942=_0x93c3[_0x1b70f8];return _0xb942;};'use strict';var util=require(_0x393c('0x0'));var db=require(_0x393c('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x393c('0x2')]({'id':i,'firstName':_0x393c('0x3')+i,'lastName':_0x393c('0x4')+i,'phone':0xf879fb460+i,'email':_0x393c('0x5')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x393c('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x393c('0x6')](),'updatedAt':Date[_0x393c('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x393c('0x2')]({'id':i,'firstName':_0x393c('0x3')+i,'lastName':_0x393c('0x4')+i,'phone':0xf879fb460+i,'email':_0x393c('0x5')+i+_0x393c('0x7')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x393c('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x393c('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x393c('0x6')](),'updatedAt':Date[_0x393c('0x6')]()});}db[_0x393c('0x8')][_0x393c('0x9')]({'where':{}})['then'](function(){return db['CmContact'][_0x393c('0xa')](contacts);})[_0x393c('0xb')](function(){console[_0x393c('0xc')](_0x393c('0xd'),_0x393c('0xe'));return db[_0x393c('0xf')][_0x393c('0x9')]({'where':{}});})[_0x393c('0xb')](function(){return db[_0x393c('0xf')][_0x393c('0xa')](hopper);})['then'](function(){console[_0x393c('0xc')](_0x393c('0xd'),_0x393c('0x10'));return db['CmContact'][_0x393c('0xa')](contacts2);})[_0x393c('0xb')](function(){console[_0x393c('0xc')](_0x393c('0xd'),'contacts2');return db['CmHopper']['bulkCreate'](hopper2);})[_0x393c('0xb')](function(){console[_0x393c('0xc')](_0x393c('0xd'),_0x393c('0x11'));})[_0x393c('0x12')](function(_0x348a2b){console[_0x393c('0xc')](_0x348a2b);}); \ No newline at end of file +var _0x8a3c=['Innocenzo','CmContact','then','finished\x20populating','CmHopper','destroy','bulkCreate','log','util','../mysqldb','push','Biondo','innocenzo.biondo','@xcally.com','now'];(function(_0x3e0674,_0x4db90b){var _0x2c204a=function(_0x41cdf7){while(--_0x41cdf7){_0x3e0674['push'](_0x3e0674['shift']());}};_0x2c204a(++_0x4db90b);}(_0x8a3c,0x19d));var _0xc8a3=function(_0x461886,_0x4fc171){_0x461886=_0x461886-0x0;var _0x295e0a=_0x8a3c[_0x461886];return _0x295e0a;};'use strict';var util=require(_0xc8a3('0x0'));var db=require(_0xc8a3('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xc8a3('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xc8a3('0x3')+i,'phone':0xf879fb460+i,'email':_0xc8a3('0x4')+i+_0xc8a3('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xc8a3('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xc8a3('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xc8a3('0x6')](),'updatedAt':Date[_0xc8a3('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xc8a3('0x2')]({'id':i,'firstName':_0xc8a3('0x7')+i,'lastName':_0xc8a3('0x3')+i,'phone':0xf879fb460+i,'email':_0xc8a3('0x4')+i+_0xc8a3('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xc8a3('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xc8a3('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xc8a3('0x6')]()});}db[_0xc8a3('0x8')]['destroy']({'where':{}})[_0xc8a3('0x9')](function(){return db[_0xc8a3('0x8')]['bulkCreate'](contacts);})[_0xc8a3('0x9')](function(){console['log'](_0xc8a3('0xa'),'contacts1');return db[_0xc8a3('0xb')][_0xc8a3('0xc')]({'where':{}});})[_0xc8a3('0x9')](function(){return db[_0xc8a3('0xb')][_0xc8a3('0xd')](hopper);})[_0xc8a3('0x9')](function(){console[_0xc8a3('0xe')]('finished\x20populating','hopper1');return db['CmContact'][_0xc8a3('0xd')](contacts2);})[_0xc8a3('0x9')](function(){console[_0xc8a3('0xe')](_0xc8a3('0xa'),'contacts2');return db[_0xc8a3('0xb')]['bulkCreate'](hopper2);})[_0xc8a3('0x9')](function(){console[_0xc8a3('0xe')]('finished\x20populating','hopper2');})['catch'](function(_0x17a216){console[_0xc8a3('0xe')](_0x17a216);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 7d91ad2..b96178c 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc327=['bulkCreate','then','log','catch','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','password','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','User'];(function(_0x354354,_0x4488f7){var _0x13c5fb=function(_0x161e77){while(--_0x161e77){_0x354354['push'](_0x354354['shift']());}};_0x13c5fb(++_0x4488f7);}(_0xc327,0xe0));var _0x7c32=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xc327[_0x30ae5e];return _0x1f2e93;};'use strict';var util=require(_0x7c32('0x0'));var db=require(_0x7c32('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x7c32('0x2')]({'name':util[_0x7c32('0x3')](_0x7c32('0x4'),'agent',i),'fullname':util['format'](_0x7c32('0x4'),_0x7c32('0x5'),i),'email':util['format'](_0x7c32('0x6'),'agent',i),'role':_0x7c32('0x5'),'password':_0x7c32('0x7'),'internal':0xfa0+i,'type':_0x7c32('0x8'),'transport':[_0x7c32('0x9'),'ws',_0x7c32('0xa')],'disallow':[_0x7c32('0xb')],'allow':[_0x7c32('0xc')],'defaultuser':util[_0x7c32('0x3')]('%s%s',_0x7c32('0x5'),i),'encryption':'yes','avpf':_0x7c32('0xd'),'force_avp':_0x7c32('0xd'),'icesupport':'yes','dtlsenable':_0x7c32('0xd'),'dtlsverify':'no','dtlscertfile':_0x7c32('0xe'),'dtlsprivatekey':_0x7c32('0xf'),'dtlssetup':_0x7c32('0x10'),'callerid':util[_0x7c32('0x3')]('\x22%s\x22\x20<%s>',util['format']('%s%s',_0x7c32('0x5'),i),0xfa0+i)});}db[_0x7c32('0x11')][_0x7c32('0x12')](users)[_0x7c32('0x13')](function(){console[_0x7c32('0x14')]('add\x20user');})[_0x7c32('0x15')](function(_0x1231a7){console[_0x7c32('0x14')](_0x1231a7);}); \ No newline at end of file +var _0x32b6=['actpass','User','bulkCreate','then','add\x20user','catch','log','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','friend','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key'];(function(_0x654eb9,_0x4add84){var _0x2b7391=function(_0x30f152){while(--_0x30f152){_0x654eb9['push'](_0x654eb9['shift']());}};_0x2b7391(++_0x4add84);}(_0x32b6,0x181));var _0x632b=function(_0x3d7631,_0x19d457){_0x3d7631=_0x3d7631-0x0;var _0x1cb142=_0x32b6[_0x3d7631];return _0x1cb142;};'use strict';var util=require(_0x632b('0x0'));var db=require(_0x632b('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x632b('0x2')]({'name':util[_0x632b('0x3')](_0x632b('0x4'),_0x632b('0x5'),i),'fullname':util[_0x632b('0x3')](_0x632b('0x4'),_0x632b('0x5'),i),'email':util[_0x632b('0x3')](_0x632b('0x6'),_0x632b('0x5'),i),'role':'agent','password':'password','internal':0xfa0+i,'type':_0x632b('0x7'),'transport':['udp','ws',_0x632b('0x8')],'disallow':[_0x632b('0x9')],'allow':[_0x632b('0xa')],'defaultuser':util[_0x632b('0x3')]('%s%s',_0x632b('0x5'),i),'encryption':_0x632b('0xb'),'avpf':'yes','force_avp':_0x632b('0xb'),'icesupport':_0x632b('0xb'),'dtlsenable':_0x632b('0xb'),'dtlsverify':'no','dtlscertfile':_0x632b('0xc'),'dtlsprivatekey':_0x632b('0xd'),'dtlssetup':_0x632b('0xe'),'callerid':util[_0x632b('0x3')]('\x22%s\x22\x20<%s>',util[_0x632b('0x3')](_0x632b('0x4'),_0x632b('0x5'),i),0xfa0+i)});}db[_0x632b('0xf')][_0x632b('0x10')](users)[_0x632b('0x11')](function(){console['log'](_0x632b('0x12'));})[_0x632b('0x13')](function(_0x421844){console[_0x632b('0x14')](_0x421844);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 63370e2..a982897 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1189=['type','ivr','UserProfileSection','findOne','then','autoAssociation','ChatQueues','MailQueues','OpenchannelQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','where','telephone','format','%s:queue:%s','length','user:%s','query','find','userProfileId','handshake','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:outbound','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','Trunk','Campaign','voice:inbound','FaxQueues','OpenchannelQueue','WhatsappQueues','WhatsappQueue','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','fax','sms','openchannel','telephone:%s','trunk:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','user_has_mail_interactions:remove','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','log','SocketIO\x20','nsp','disconnect','DISCONNECTED','lodash','util','bluebird','../mysqldb','name','Agents','User','role','agent'];(function(_0x8a0496,_0x382fd9){var _0x43c918=function(_0x590135){while(--_0x590135){_0x8a0496['push'](_0x8a0496['shift']());}};_0x43c918(++_0x382fd9);}(_0x1189,0x17f));var _0x9118=function(_0x3eb450,_0x592b0a){_0x3eb450=_0x3eb450-0x0;var _0x2c4cfd=_0x1189[_0x3eb450];return _0x2c4cfd;};'use strict';var _=require(_0x9118('0x0'));var util=require(_0x9118('0x1'));var BPromise=require(_0x9118('0x2'));var db=require(_0x9118('0x3'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x9118('0x4')],'include':[{'as':_0x9118('0x5'),'model':db[_0x9118('0x6')],'attributes':['id',_0x9118('0x4'),_0x9118('0x7')],'raw':!![],'where':{'role':_0x9118('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x9118('0x4')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x9118('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0x9118('0x4')],'where':{'role':_0x9118('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x9118('0x4'),_0x9118('0x9')],'where':{'type':_0x9118('0xa')}};function getAssociatedResources(_0x5cfd42,_0x3de6a2,_0x227eea){return db[_0x9118('0xb')][_0x9118('0xc')]({'where':{'name':_0x5cfd42,'userProfileId':_0x3de6a2},'raw':!![]})[_0x9118('0xd')](function(_0x319690){if(_0x319690){if(_0x319690[_0x9118('0xe')]){switch(_0x5cfd42){case'VoiceQueues':case _0x9118('0xf'):case'FaxQueues':case'SmsQueues':case _0x9118('0x10'):case _0x9118('0x11'):case'WhatsappQueues':return db[_0x227eea][_0x9118('0x12')](queryQueues);case _0x9118('0x13'):return db[_0x227eea][_0x9118('0x12')](queryTelephones);case _0x9118('0x14'):return db[_0x227eea][_0x9118('0x12')](queryTrunks);case _0x9118('0x15'):return db[_0x227eea][_0x9118('0x12')](queryCampaigns);}}else{return db[_0x9118('0x16')][_0x9118('0x12')]({'attributes':[_0x9118('0x17')],'where':{'sectionId':_0x319690['id']},'raw':!![]})[_0x9118('0xd')](function(_0x48e13a){if(_0x48e13a){var _0x5c403d={'where':{'id':_[_0x9118('0x18')](_0x48e13a,'resourceId')},'raw':!![]};switch(_0x227eea){case _0x9118('0x6'):_0x5c403d[_0x9118('0x19')][_0x9118('0x7')]=_0x9118('0x1a');break;case'Campaign':_0x5c403d[_0x9118('0x19')]['type']=_0x9118('0xa');break;}return db[_0x227eea]['findAll'](_0x5c403d);}else{return[];}});}}else{return[];}})[_0x9118('0xd')](function(_0x3f30a0){return _0x3f30a0;});}function joinOrLeaveQueues(_0x4d4826,_0x2763a3,_0x1e133b,_0x2a3b29){_0x4d4826[_0x2763a3](util[_0x9118('0x1b')](_0x9118('0x1c'),_0x1e133b,_0x2a3b29['name']));if(_0x2a3b29[_0x9118('0x5')]){for(var _0x178b01=0x0;_0x178b01<_0x2a3b29[_0x9118('0x5')][_0x9118('0x1d')];_0x178b01+=0x1){_0x4d4826[_0x2763a3](util[_0x9118('0x1b')](_0x9118('0x1e'),_0x2a3b29[_0x9118('0x5')][_0x178b01][_0x9118('0x4')]));}}}function joinOrLeave(_0x3d77de,_0x47177b,_0x5613dc){var _0x2f338e;if(_0x3d77de['handshake'][_0x9118('0x1f')]['id']){db[_0x9118('0x6')][_0x9118('0x20')]({'attributes':['id','name','role',_0x9118('0x21')],'where':{'id':_0x3d77de[_0x9118('0x22')]['query']['id']},'include':[{'model':db[_0x9118('0x23')],'as':_0x9118('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x9118('0x25')],'as':_0x9118('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x9118('0x27')],'as':_0x9118('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x9118('0x29')],'as':_0x9118('0x2a'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x9118('0x2b'),'attributes':['id'],'raw':!![]},{'model':db[_0x9118('0x2c')],'as':_0x9118('0x2d'),'attributes':['id'],'raw':!![]}]})[_0x9118('0xd')](function(_0x2f72bb){if(_0x2f72bb){_0x2f338e=_0x2f72bb;_0x3d77de[_0x47177b](util[_0x9118('0x1b')](_0x9118('0x1e'),_0x2f72bb[_0x9118('0x4')]));var _0x57c5d2=[];switch(_0x2f72bb[_0x9118('0x7')]){case _0x9118('0x2e'):_0x3d77de[_0x47177b]('voice:inbound');_0x3d77de[_0x47177b](_0x9118('0x2f'));if(queryQueues['hasOwnProperty']('include')){delete queryQueues['include'];}_0x57c5d2[_0x9118('0x30')](db[_0x9118('0x31')][_0x9118('0x12')](queryQueues));_0x57c5d2[_0x9118('0x30')](db[_0x9118('0x32')][_0x9118('0x12')](queryQueues));_0x57c5d2[_0x9118('0x30')](db[_0x9118('0x33')]['findAll'](queryQueues));_0x57c5d2[_0x9118('0x30')](db[_0x9118('0x34')][_0x9118('0x12')](queryQueues));_0x57c5d2['push'](db[_0x9118('0x35')][_0x9118('0x12')](queryQueues));_0x57c5d2[_0x9118('0x30')](db['OpenchannelQueue'][_0x9118('0x12')](queryQueues));_0x57c5d2['push'](db['WhatsappQueue'][_0x9118('0x12')](queryQueues));_0x57c5d2['push'](db[_0x9118('0x6')][_0x9118('0x12')](queryTelephones));_0x57c5d2[_0x9118('0x30')](db[_0x9118('0x36')][_0x9118('0x12')](queryTrunks));_0x57c5d2[_0x9118('0x30')](db[_0x9118('0x37')]['findAll'](queryCampaigns));_0x57c5d2['push'](db[_0x9118('0x6')][_0x9118('0x12')](queryAgents));break;case'user':_0x3d77de[_0x47177b](_0x9118('0x38'));_0x3d77de[_0x47177b](_0x9118('0x2f'));_0x57c5d2[_0x9118('0x30')](getAssociatedResources('VoiceQueues',_0x2f72bb[_0x9118('0x21')],_0x9118('0x31')));_0x57c5d2[_0x9118('0x30')](getAssociatedResources(_0x9118('0xf'),_0x2f72bb[_0x9118('0x21')],_0x9118('0x32')));_0x57c5d2[_0x9118('0x30')](getAssociatedResources(_0x9118('0x39'),_0x2f72bb['userProfileId'],_0x9118('0x33')));_0x57c5d2['push'](getAssociatedResources('SmsQueues',_0x2f72bb[_0x9118('0x21')],_0x9118('0x34')));_0x57c5d2[_0x9118('0x30')](getAssociatedResources(_0x9118('0x10'),_0x2f72bb[_0x9118('0x21')],'MailQueue'));_0x57c5d2['push'](getAssociatedResources('OpenchannelQueues',_0x2f72bb['userProfileId'],_0x9118('0x3a')));_0x57c5d2['push'](getAssociatedResources(_0x9118('0x3b'),_0x2f72bb[_0x9118('0x21')],_0x9118('0x3c')));_0x57c5d2['push'](getAssociatedResources(_0x9118('0x13'),_0x2f72bb[_0x9118('0x21')],'User'));_0x57c5d2['push'](getAssociatedResources(_0x9118('0x14'),_0x2f72bb[_0x9118('0x21')],'Trunk'));_0x57c5d2[_0x9118('0x30')](getAssociatedResources(_0x9118('0x15'),_0x2f72bb['userProfileId'],_0x9118('0x37')));_0x57c5d2[_0x9118('0x30')](db[_0x9118('0x6')][_0x9118('0x12')](queryAgents));break;case'agent':_0x3d77de[_0x47177b](_0x9118('0x38'));_0x3d77de[_0x47177b](_0x9118('0x2f'));_0x57c5d2[_0x9118('0x30')](_0x2f72bb['getVoiceQueues']({'attributes':['id',_0x9118('0x4')]}));_0x57c5d2[_0x9118('0x30')](_0x2f72bb[_0x9118('0x3d')]({'attributes':['id','name']}));_0x57c5d2[_0x9118('0x30')](_0x2f72bb[_0x9118('0x3e')]({'attributes':['id',_0x9118('0x4')]}));_0x57c5d2[_0x9118('0x30')](_0x2f72bb[_0x9118('0x3f')]({'attributes':['id',_0x9118('0x4')]}));_0x57c5d2['push'](_0x2f72bb[_0x9118('0x40')]({'attributes':['id',_0x9118('0x4')]}));_0x57c5d2[_0x9118('0x30')](_0x2f72bb[_0x9118('0x41')]({'attributes':['id','name']}));_0x57c5d2[_0x9118('0x30')](_0x2f72bb[_0x9118('0x42')]({'attributes':['id',_0x9118('0x4')]}));break;}return BPromise[_0x9118('0x43')](_0x57c5d2);}})[_0x9118('0xd')](function(_0x2475a9){if(_0x2475a9&&_0x2475a9[_0x9118('0x1d')]){for(var _0x1fc9b5=0x0;_0x1fc9b5<_0x2475a9['length'];_0x1fc9b5+=0x1){for(var _0x1b6f40=0x0;_0x1b6f40<_0x2475a9[_0x1fc9b5][_0x9118('0x1d')];_0x1b6f40+=0x1){switch(_0x1fc9b5){case 0x0:joinOrLeaveQueues(_0x3d77de,_0x47177b,_0x9118('0x44'),_0x2475a9[_0x1fc9b5][_0x1b6f40]);break;case 0x1:joinOrLeaveQueues(_0x3d77de,_0x47177b,'chat',_0x2475a9[_0x1fc9b5][_0x1b6f40]);break;case 0x2:joinOrLeaveQueues(_0x3d77de,_0x47177b,_0x9118('0x45'),_0x2475a9[_0x1fc9b5][_0x1b6f40]);break;case 0x3:joinOrLeaveQueues(_0x3d77de,_0x47177b,_0x9118('0x46'),_0x2475a9[_0x1fc9b5][_0x1b6f40]);break;case 0x4:joinOrLeaveQueues(_0x3d77de,_0x47177b,'mail',_0x2475a9[_0x1fc9b5][_0x1b6f40]);break;case 0x5:joinOrLeaveQueues(_0x3d77de,_0x47177b,_0x9118('0x47'),_0x2475a9[_0x1fc9b5][_0x1b6f40]);break;case 0x6:joinOrLeaveQueues(_0x3d77de,_0x47177b,'whatsapp',_0x2475a9[_0x1fc9b5][_0x1b6f40]);break;case 0x7:if(_0x2f338e['role']!=='agent')_0x3d77de[_0x47177b](util[_0x9118('0x1b')](_0x9118('0x48'),_0x2475a9[_0x1fc9b5][_0x1b6f40][_0x9118('0x4')]));break;case 0x8:if(_0x2f338e[_0x9118('0x7')]!==_0x9118('0x8'))_0x3d77de[_0x47177b](util[_0x9118('0x1b')](_0x9118('0x49'),_0x2475a9[_0x1fc9b5][_0x1b6f40]['name']));break;case 0x9:if(_0x2f338e['role']!==_0x9118('0x8'))_0x3d77de[_0x47177b](util[_0x9118('0x1b')]('campaign:%s:%s',_0x2475a9[_0x1fc9b5][_0x1b6f40]['type'],_0x2475a9[_0x1fc9b5][_0x1b6f40][_0x9118('0x4')]));break;case 0xa:_0x3d77de[_0x47177b](util['format']('user:%s',_0x2475a9[_0x1fc9b5][_0x1b6f40][_0x9118('0x4')]));break;}}}}})[_0x9118('0xd')](function(){if(_0x47177b===_0x9118('0x4a')){var _0x4018b8=_[_0x9118('0x18')](_0x2f338e[_0x9118('0x24')],'id');return _0x2f338e[_0x9118('0x4b')](_0x4018b8)[_0x9118('0xd')](function(){for(var _0x170ff5=0x0;_0x170ff5<_0x4018b8['length'];_0x170ff5+=0x1){_0x5613dc[_0x9118('0x4c')](_0x9118('0x4d'),{'ChatInteractionId':Number(_0x4018b8[_0x170ff5]),'UserId':Number(_0x2f338e['id'])});}});}})[_0x9118('0xd')](function(){if(_0x47177b==='leave'){var _0x52ca84=_[_0x9118('0x18')](_0x2f338e[_0x9118('0x26')],'id');return _0x2f338e['removeMailInteractions'](_0x52ca84)[_0x9118('0xd')](function(){for(var _0x3d8692=0x0;_0x3d8692<_0x52ca84['length'];_0x3d8692+=0x1){_0x5613dc[_0x9118('0x4c')](_0x9118('0x4e'),{'MailInteractionId':Number(_0x52ca84[_0x3d8692]),'UserId':Number(_0x2f338e['id'])});}});}})[_0x9118('0xd')](function(){if(_0x47177b===_0x9118('0x4a')){var _0x2a19e4=_[_0x9118('0x18')](_0x2f338e[_0x9118('0x28')],'id');return _0x2f338e['removeFaxInteractions'](_0x2a19e4)[_0x9118('0xd')](function(){for(var _0x115322=0x0;_0x115322<_0x2a19e4['length'];_0x115322+=0x1){_0x5613dc[_0x9118('0x4c')](_0x9118('0x4f'),{'FaxInteractionId':Number(_0x2a19e4[_0x115322]),'UserId':Number(_0x2f338e['id'])});}});}})[_0x9118('0xd')](function(){if(_0x47177b===_0x9118('0x4a')){var _0x38ce4d=_['map'](_0x2f338e[_0x9118('0x2a')],'id');return _0x2f338e[_0x9118('0x50')](_0x38ce4d)[_0x9118('0xd')](function(){for(var _0x2e7adc=0x0;_0x2e7adc<_0x38ce4d[_0x9118('0x1d')];_0x2e7adc+=0x1){_0x5613dc['emit'](_0x9118('0x51'),{'SmsInteractionId':Number(_0x38ce4d[_0x2e7adc]),'UserId':Number(_0x2f338e['id'])});}});}})[_0x9118('0xd')](function(){if(_0x47177b===_0x9118('0x4a')){var _0x418f27=_['map'](_0x2f338e[_0x9118('0x2b')],'id');return _0x2f338e[_0x9118('0x52')](_0x418f27)[_0x9118('0xd')](function(){for(var _0x337513=0x0;_0x337513<_0x418f27[_0x9118('0x1d')];_0x337513+=0x1){_0x5613dc[_0x9118('0x4c')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x418f27[_0x337513]),'UserId':Number(_0x2f338e['id'])});}});}})[_0x9118('0xd')](function(){if(_0x47177b===_0x9118('0x4a')){var _0x2767b6=_[_0x9118('0x18')](_0x2f338e[_0x9118('0x2d')],'id');return _0x2f338e[_0x9118('0x53')](_0x2767b6)[_0x9118('0xd')](function(){for(var _0x3ce059=0x0;_0x3ce059<_0x2767b6[_0x9118('0x1d')];_0x3ce059+=0x1){_0x5613dc[_0x9118('0x4c')](_0x9118('0x54'),{'WhatsappInteractionId':Number(_0x2767b6[_0x3ce059]),'UserId':Number(_0x2f338e['id'])});}});}})[_0x9118('0x55')](function(_0x5b7cde){_0x3d77de['log'](_0x5b7cde);});}}function onDisconnect(_0x280bdb,_0x3809d4){joinOrLeave(_0x280bdb,_0x9118('0x4a'),_0x3809d4);}function onConnect(_0x54641f){joinOrLeave(_0x54641f,'join');}exports['default']=function(_0x41271d){_0x41271d['on'](_0x9118('0x56'),function(_0x2ab6d6){_0x2ab6d6[_0x9118('0x57')](0x0);_0x2ab6d6[_0x9118('0x58')]=_0x2ab6d6[_0x9118('0x59')][_0x9118('0x56')][_0x9118('0x5a')]+':'+_0x2ab6d6[_0x9118('0x59')]['connection'][_0x9118('0x5b')];_0x2ab6d6[_0x9118('0x5c')]=new Date();_0x2ab6d6[_0x9118('0x5d')]=function(_0x57a3ec){console[_0x9118('0x5d')](_0x9118('0x5e')+_0x2ab6d6[_0x9118('0x5f')][_0x9118('0x4')]+'['+_0x2ab6d6[_0x9118('0x58')]+']',_0x57a3ec);};_0x2ab6d6['on'](_0x9118('0x60'),function(){onDisconnect(_0x2ab6d6,_0x41271d);_0x2ab6d6[_0x9118('0x5d')](_0x9118('0x61'));});onConnect(_0x2ab6d6);_0x2ab6d6[_0x9118('0x5d')]('CONNECTED');});}; \ No newline at end of file +var _0xfd2e=['join','default','connection','remoteAddress','request','log','SocketIO\x20','nsp','address','DISCONNECTED','CONNECTED','lodash','bluebird','./environment','Agents','User','name','role','agent','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','IvrCampaigns','UserProfileResource','resourceId','map','where','Campaign','type','format','%s:queue:%s','length','user:%s','handshake','query','find','userProfileId','ChatInteraction','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','Trunks','getChatQueues','getSmsQueues','getWhatsappQueues','all','chat','sms','openchannel','whatsapp','telephone:%s','trunk:%s','leave','ChatInteractions','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','user_has_whatsapp_interactions:remove','catch'];(function(_0x46dd33,_0x492982){var _0x979584=function(_0x5a414b){while(--_0x5a414b){_0x46dd33['push'](_0x46dd33['shift']());}};_0x979584(++_0x492982);}(_0xfd2e,0x6e));var _0xefd2=function(_0xf1d19f,_0x12e741){_0xf1d19f=_0xf1d19f-0x0;var _0x4b876d=_0xfd2e[_0xf1d19f];return _0x4b876d;};'use strict';var _=require(_0xefd2('0x0'));var util=require('util');var BPromise=require(_0xefd2('0x1'));var db=require('../mysqldb')['db'];var config=require(_0xefd2('0x2'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0xefd2('0x3'),'model':db[_0xefd2('0x4')],'attributes':['id',_0xefd2('0x5'),_0xefd2('0x6')],'raw':!![],'where':{'role':_0xefd2('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0xefd2('0x5')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0xefd2('0x5'),'type'],'where':{'type':_0xefd2('0x8')}};function getAssociatedResources(_0x2cfcf2,_0x4483e5,_0xded765){return db[_0xefd2('0x9')][_0xefd2('0xa')]({'where':{'name':_0x2cfcf2,'userProfileId':_0x4483e5},'raw':!![]})[_0xefd2('0xb')](function(_0x490a6d){if(_0x490a6d){if(_0x490a6d[_0xefd2('0xc')]){switch(_0x2cfcf2){case _0xefd2('0xd'):case _0xefd2('0xe'):case _0xefd2('0xf'):case _0xefd2('0x10'):case _0xefd2('0x11'):case _0xefd2('0x12'):case _0xefd2('0x13'):return db[_0xded765]['findAll'](queryQueues);case'Telephones':return db[_0xded765][_0xefd2('0x14')](queryTelephones);case'Trunks':return db[_0xded765]['findAll'](queryTrunks);case _0xefd2('0x15'):return db[_0xded765][_0xefd2('0x14')](queryCampaigns);}}else{return db[_0xefd2('0x16')][_0xefd2('0x14')]({'attributes':[_0xefd2('0x17')],'where':{'sectionId':_0x490a6d['id']},'raw':!![]})['then'](function(_0x1a35b7){if(_0x1a35b7){var _0x20192b={'where':{'id':_[_0xefd2('0x18')](_0x1a35b7,_0xefd2('0x17'))},'raw':!![]};switch(_0xded765){case _0xefd2('0x4'):_0x20192b[_0xefd2('0x19')]['role']='telephone';break;case _0xefd2('0x1a'):_0x20192b[_0xefd2('0x19')][_0xefd2('0x1b')]=_0xefd2('0x8');break;}return db[_0xded765][_0xefd2('0x14')](_0x20192b);}else{return[];}});}}else{return[];}})['then'](function(_0x129ada){return _0x129ada;});}function joinOrLeaveQueues(_0x1ca355,_0x33c88f,_0x11baea,_0x4d2e38){_0x1ca355[_0x33c88f](util[_0xefd2('0x1c')](_0xefd2('0x1d'),_0x11baea,_0x4d2e38[_0xefd2('0x5')]));if(_0x4d2e38[_0xefd2('0x3')]){for(var _0x570473=0x0;_0x570473<_0x4d2e38[_0xefd2('0x3')][_0xefd2('0x1e')];_0x570473+=0x1){_0x1ca355[_0x33c88f](util[_0xefd2('0x1c')](_0xefd2('0x1f'),_0x4d2e38[_0xefd2('0x3')][_0x570473][_0xefd2('0x5')]));}}}function joinOrLeave(_0x41918a,_0x49146f,_0x491286){var _0x31180b;if(_0x41918a[_0xefd2('0x20')][_0xefd2('0x21')]['id']){db[_0xefd2('0x4')][_0xefd2('0x22')]({'attributes':['id',_0xefd2('0x5'),_0xefd2('0x6'),_0xefd2('0x23')],'where':{'id':_0x41918a[_0xefd2('0x20')][_0xefd2('0x21')]['id']},'include':[{'model':db[_0xefd2('0x24')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xefd2('0x25')],'as':_0xefd2('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0xefd2('0x27')],'as':_0xefd2('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0xefd2('0x29')],'as':_0xefd2('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0xefd2('0x2b')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xefd2('0x2c')],'as':_0xefd2('0x2d'),'attributes':['id'],'raw':!![]}]})[_0xefd2('0xb')](function(_0x46e68d){if(_0x46e68d){_0x31180b=_0x46e68d;_0x41918a[_0x49146f](util[_0xefd2('0x1c')]('user:%s',_0x46e68d[_0xefd2('0x5')]));var _0x328714=[];switch(_0x46e68d['role']){case _0xefd2('0x2e'):_0x41918a[_0x49146f](_0xefd2('0x2f'));_0x41918a[_0x49146f](_0xefd2('0x30'));if(queryQueues[_0xefd2('0x31')](_0xefd2('0x32'))){delete queryQueues[_0xefd2('0x32')];}_0x328714[_0xefd2('0x33')](db[_0xefd2('0x34')][_0xefd2('0x14')](queryQueues));_0x328714[_0xefd2('0x33')](db[_0xefd2('0x35')]['findAll'](queryQueues));_0x328714[_0xefd2('0x33')](db[_0xefd2('0x36')][_0xefd2('0x14')](queryQueues));_0x328714[_0xefd2('0x33')](db[_0xefd2('0x37')][_0xefd2('0x14')](queryQueues));_0x328714[_0xefd2('0x33')](db[_0xefd2('0x38')][_0xefd2('0x14')](queryQueues));_0x328714[_0xefd2('0x33')](db[_0xefd2('0x39')]['findAll'](queryQueues));_0x328714[_0xefd2('0x33')](db[_0xefd2('0x3a')]['findAll'](queryQueues));_0x328714[_0xefd2('0x33')](db[_0xefd2('0x4')]['findAll'](queryTelephones));_0x328714['push'](db[_0xefd2('0x3b')]['findAll'](queryTrunks));_0x328714[_0xefd2('0x33')](db[_0xefd2('0x1a')][_0xefd2('0x14')](queryCampaigns));_0x328714[_0xefd2('0x33')](db[_0xefd2('0x4')]['findAll'](queryAgents));break;case _0xefd2('0x3c'):_0x41918a[_0x49146f](_0xefd2('0x2f'));_0x41918a[_0x49146f](_0xefd2('0x30'));_0x328714[_0xefd2('0x33')](getAssociatedResources(_0xefd2('0xd'),_0x46e68d[_0xefd2('0x23')],_0xefd2('0x34')));_0x328714[_0xefd2('0x33')](getAssociatedResources(_0xefd2('0xe'),_0x46e68d[_0xefd2('0x23')],_0xefd2('0x35')));_0x328714[_0xefd2('0x33')](getAssociatedResources(_0xefd2('0xf'),_0x46e68d[_0xefd2('0x23')],_0xefd2('0x36')));_0x328714[_0xefd2('0x33')](getAssociatedResources(_0xefd2('0x10'),_0x46e68d[_0xefd2('0x23')],_0xefd2('0x37')));_0x328714[_0xefd2('0x33')](getAssociatedResources(_0xefd2('0x11'),_0x46e68d['userProfileId'],_0xefd2('0x38')));_0x328714['push'](getAssociatedResources(_0xefd2('0x12'),_0x46e68d['userProfileId'],'OpenchannelQueue'));_0x328714[_0xefd2('0x33')](getAssociatedResources(_0xefd2('0x13'),_0x46e68d[_0xefd2('0x23')],_0xefd2('0x3a')));_0x328714[_0xefd2('0x33')](getAssociatedResources('Telephones',_0x46e68d['userProfileId'],_0xefd2('0x4')));_0x328714['push'](getAssociatedResources(_0xefd2('0x3d'),_0x46e68d[_0xefd2('0x23')],'Trunk'));_0x328714[_0xefd2('0x33')](getAssociatedResources(_0xefd2('0x15'),_0x46e68d[_0xefd2('0x23')],_0xefd2('0x1a')));_0x328714['push'](db[_0xefd2('0x4')][_0xefd2('0x14')](queryAgents));break;case'agent':_0x41918a[_0x49146f](_0xefd2('0x2f'));_0x41918a[_0x49146f]('voice:outbound');_0x328714[_0xefd2('0x33')](_0x46e68d['getVoiceQueues']({'attributes':['id','name']}));_0x328714[_0xefd2('0x33')](_0x46e68d[_0xefd2('0x3e')]({'attributes':['id','name']}));_0x328714[_0xefd2('0x33')](_0x46e68d['getFaxQueues']({'attributes':['id',_0xefd2('0x5')]}));_0x328714['push'](_0x46e68d[_0xefd2('0x3f')]({'attributes':['id',_0xefd2('0x5')]}));_0x328714[_0xefd2('0x33')](_0x46e68d['getMailQueues']({'attributes':['id',_0xefd2('0x5')]}));_0x328714[_0xefd2('0x33')](_0x46e68d['getOpenchannelQueues']({'attributes':['id','name']}));_0x328714[_0xefd2('0x33')](_0x46e68d[_0xefd2('0x40')]({'attributes':['id','name']}));break;}return BPromise[_0xefd2('0x41')](_0x328714);}})[_0xefd2('0xb')](function(_0x18c4ed){if(_0x18c4ed&&_0x18c4ed[_0xefd2('0x1e')]){for(var _0x53841d=0x0;_0x53841d<_0x18c4ed[_0xefd2('0x1e')];_0x53841d+=0x1){for(var _0x359ab3=0x0;_0x359ab3<_0x18c4ed[_0x53841d][_0xefd2('0x1e')];_0x359ab3+=0x1){switch(_0x53841d){case 0x0:joinOrLeaveQueues(_0x41918a,_0x49146f,'voice',_0x18c4ed[_0x53841d][_0x359ab3]);break;case 0x1:joinOrLeaveQueues(_0x41918a,_0x49146f,_0xefd2('0x42'),_0x18c4ed[_0x53841d][_0x359ab3]);break;case 0x2:joinOrLeaveQueues(_0x41918a,_0x49146f,'fax',_0x18c4ed[_0x53841d][_0x359ab3]);break;case 0x3:joinOrLeaveQueues(_0x41918a,_0x49146f,_0xefd2('0x43'),_0x18c4ed[_0x53841d][_0x359ab3]);break;case 0x4:joinOrLeaveQueues(_0x41918a,_0x49146f,'mail',_0x18c4ed[_0x53841d][_0x359ab3]);break;case 0x5:joinOrLeaveQueues(_0x41918a,_0x49146f,_0xefd2('0x44'),_0x18c4ed[_0x53841d][_0x359ab3]);break;case 0x6:joinOrLeaveQueues(_0x41918a,_0x49146f,_0xefd2('0x45'),_0x18c4ed[_0x53841d][_0x359ab3]);break;case 0x7:if(_0x31180b['role']!==_0xefd2('0x7'))_0x41918a[_0x49146f](util[_0xefd2('0x1c')](_0xefd2('0x46'),_0x18c4ed[_0x53841d][_0x359ab3]['name']));break;case 0x8:if(_0x31180b['role']!==_0xefd2('0x7'))_0x41918a[_0x49146f](util['format'](_0xefd2('0x47'),_0x18c4ed[_0x53841d][_0x359ab3][_0xefd2('0x5')]));break;case 0x9:if(_0x31180b[_0xefd2('0x6')]!=='agent')_0x41918a[_0x49146f](util['format']('campaign:%s:%s',_0x18c4ed[_0x53841d][_0x359ab3][_0xefd2('0x1b')],_0x18c4ed[_0x53841d][_0x359ab3][_0xefd2('0x5')]));break;case 0xa:_0x41918a[_0x49146f](util[_0xefd2('0x1c')](_0xefd2('0x1f'),_0x18c4ed[_0x53841d][_0x359ab3][_0xefd2('0x5')]));break;}}}}})['then'](function(){if(_0x49146f===_0xefd2('0x48')){var _0x2c93cd=_[_0xefd2('0x18')](_0x31180b[_0xefd2('0x49')],'id');return _0x31180b[_0xefd2('0x4a')](_0x2c93cd)[_0xefd2('0xb')](function(){for(var _0x2dc474=0x0;_0x2dc474<_0x2c93cd[_0xefd2('0x1e')];_0x2dc474+=0x1){_0x491286[_0xefd2('0x4b')](_0xefd2('0x4c'),{'ChatInteractionId':Number(_0x2c93cd[_0x2dc474]),'UserId':Number(_0x31180b['id'])});}});}})[_0xefd2('0xb')](function(){if(_0x49146f===_0xefd2('0x48')){var _0x1445ed=_[_0xefd2('0x18')](_0x31180b[_0xefd2('0x26')],'id');return _0x31180b[_0xefd2('0x4d')](_0x1445ed)[_0xefd2('0xb')](function(){for(var _0x3226d3=0x0;_0x3226d3<_0x1445ed[_0xefd2('0x1e')];_0x3226d3+=0x1){_0x491286['emit'](_0xefd2('0x4e'),{'MailInteractionId':Number(_0x1445ed[_0x3226d3]),'UserId':Number(_0x31180b['id'])});}});}})[_0xefd2('0xb')](function(){if(_0x49146f===_0xefd2('0x48')){var _0x139468=_['map'](_0x31180b[_0xefd2('0x28')],'id');return _0x31180b[_0xefd2('0x4f')](_0x139468)[_0xefd2('0xb')](function(){for(var _0x421906=0x0;_0x421906<_0x139468[_0xefd2('0x1e')];_0x421906+=0x1){_0x491286[_0xefd2('0x4b')](_0xefd2('0x50'),{'FaxInteractionId':Number(_0x139468[_0x421906]),'UserId':Number(_0x31180b['id'])});}});}})[_0xefd2('0xb')](function(){if(_0x49146f===_0xefd2('0x48')){var _0x80b817=_[_0xefd2('0x18')](_0x31180b['SmsInteractions'],'id');return _0x31180b[_0xefd2('0x51')](_0x80b817)[_0xefd2('0xb')](function(){for(var _0x111c38=0x0;_0x111c38<_0x80b817[_0xefd2('0x1e')];_0x111c38+=0x1){_0x491286[_0xefd2('0x4b')](_0xefd2('0x52'),{'SmsInteractionId':Number(_0x80b817[_0x111c38]),'UserId':Number(_0x31180b['id'])});}});}})[_0xefd2('0xb')](function(){if(_0x49146f===_0xefd2('0x48')){var _0x3b45df=_[_0xefd2('0x18')](_0x31180b[_0xefd2('0x53')],'id');return _0x31180b[_0xefd2('0x54')](_0x3b45df)[_0xefd2('0xb')](function(){for(var _0x38b642=0x0;_0x38b642<_0x3b45df['length'];_0x38b642+=0x1){_0x491286[_0xefd2('0x4b')](_0xefd2('0x55'),{'OpenchannelInteractionId':Number(_0x3b45df[_0x38b642]),'UserId':Number(_0x31180b['id'])});}});}})['then'](function(){if(_0x49146f===_0xefd2('0x48')){var _0x2ccbc2=_[_0xefd2('0x18')](_0x31180b['WhatsappInteractions'],'id');return _0x31180b['removeWhatsappInteractions'](_0x2ccbc2)[_0xefd2('0xb')](function(){for(var _0x28d690=0x0;_0x28d690<_0x2ccbc2['length'];_0x28d690+=0x1){_0x491286[_0xefd2('0x4b')](_0xefd2('0x56'),{'WhatsappInteractionId':Number(_0x2ccbc2[_0x28d690]),'UserId':Number(_0x31180b['id'])});}});}})[_0xefd2('0x57')](function(_0x5cb14c){_0x41918a['log'](_0x5cb14c);});}}function onDisconnect(_0x468670,_0x61ed2a){joinOrLeave(_0x468670,'leave',_0x61ed2a);}function onConnect(_0x414746){joinOrLeave(_0x414746,_0xefd2('0x58'));}exports[_0xefd2('0x59')]=function(_0x1698e0){_0x1698e0['on']('connection',function(_0x917297){_0x917297['setMaxListeners'](0x0);_0x917297['address']=_0x917297['request'][_0xefd2('0x5a')][_0xefd2('0x5b')]+':'+_0x917297[_0xefd2('0x5c')]['connection']['remotePort'];_0x917297['connectedAt']=new Date();_0x917297['log']=function(_0x24824d){console[_0xefd2('0x5d')](_0xefd2('0x5e')+_0x917297[_0xefd2('0x5f')][_0xefd2('0x5')]+'['+_0x917297[_0xefd2('0x60')]+']',_0x24824d);};_0x917297['on']('disconnect',function(){onDisconnect(_0x917297,_0x1698e0);_0x917297[_0xefd2('0x5d')](_0xefd2('0x61'));});onConnect(_0x917297);_0x917297['log'](_0xefd2('0x62'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index ac651db..63fa9fa 100644 --- a/server/config/triggers/index.js +++ b/server/config/triggers/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x78fd=['afterCreate','newmessage','ChatOfflineMessage','Sms','newinteraction','SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','Fax','FaxInteraction','FaxMessage','Mail','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','info','Trigger,\x20%s','error','code','catch','get','channel','direction','resolve','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','Sequelize','SELECT','contact','format','SIP/%s','name','agent','outgoingmessage','AfterCreateMessage','motionChannel','offlineMessage','event','opened','QueryTypes','UserId','interface','changed','closed','substatus','AfterUpdate','User','find','fullname','internal','default','length','model','hook','callback','toLowerCase','condition','util','../../mysqldb','jayson/promise','../logger','client','http','ChatInteraction','Chat','afterUpdate','closedinteraction','ChatMessage'];(function(_0x191d27,_0x47a7b3){var _0x2edd07=function(_0x2cc6d7){while(--_0x2cc6d7){_0x191d27['push'](_0x191d27['shift']());}};_0x2edd07(++_0x47a7b3);}(_0x78fd,0xd6));var _0xd78f=function(_0x35dd2e,_0x4e858a){_0x35dd2e=_0x35dd2e-0x0;var _0x3c3791=_0x78fd[_0x35dd2e];return _0x3c3791;};'use strict';var util=require(_0xd78f('0x0'));var db=require(_0xd78f('0x1'))['db'];var jayson=require(_0xd78f('0x2'));var logger=require(_0xd78f('0x3'))('triggers');var client=jayson[_0xd78f('0x4')][_0xd78f('0x5')]({'port':0x232a});var triggers=[{'channel':'Chat','model':_0xd78f('0x6'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0xd78f('0x7'),'model':_0xd78f('0x6'),'event':_0xd78f('0x8'),'condition':_0xd78f('0x9'),'callback':afterUpdate},{'channel':_0xd78f('0x7'),'model':_0xd78f('0xa'),'event':_0xd78f('0xb'),'condition':_0xd78f('0xc'),'callback':afterCreateMessage},{'channel':_0xd78f('0x7'),'model':_0xd78f('0xd'),'event':'afterCreate','condition':_0xd78f('0xc'),'callback':afterCreateOfflineMessage},{'channel':_0xd78f('0xe'),'model':'SmsInteraction','event':_0xd78f('0xb'),'condition':_0xd78f('0xf'),'callback':afterCreate},{'channel':'Sms','model':_0xd78f('0x10'),'event':'afterUpdate','condition':_0xd78f('0x9'),'callback':afterUpdate},{'channel':_0xd78f('0xe'),'model':_0xd78f('0x11'),'event':_0xd78f('0xb'),'condition':_0xd78f('0xc'),'callback':afterCreateMessage},{'channel':_0xd78f('0x12'),'model':'WhatsappInteraction','event':_0xd78f('0xb'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xd78f('0x12'),'model':_0xd78f('0x13'),'event':_0xd78f('0x8'),'condition':_0xd78f('0x9'),'callback':afterUpdate},{'channel':_0xd78f('0x12'),'model':'WhatsappMessage','event':_0xd78f('0xb'),'condition':_0xd78f('0xc'),'callback':afterCreateMessage},{'channel':_0xd78f('0x14'),'model':'FaxInteraction','event':_0xd78f('0xb'),'condition':_0xd78f('0xf'),'callback':afterCreate},{'channel':'Fax','model':_0xd78f('0x15'),'event':_0xd78f('0x8'),'condition':_0xd78f('0x9'),'callback':afterUpdate},{'channel':_0xd78f('0x14'),'model':_0xd78f('0x16'),'event':_0xd78f('0xb'),'condition':_0xd78f('0xc'),'callback':afterCreateMessage},{'channel':_0xd78f('0x17'),'model':'MailInteraction','event':_0xd78f('0xb'),'condition':_0xd78f('0xf'),'callback':afterCreate},{'channel':_0xd78f('0x17'),'model':'MailInteraction','event':_0xd78f('0x8'),'condition':_0xd78f('0x9'),'callback':afterUpdate},{'channel':_0xd78f('0x17'),'model':'MailMessage','event':_0xd78f('0xb'),'condition':_0xd78f('0xc'),'callback':afterCreateMessage},{'channel':_0xd78f('0x18'),'model':_0xd78f('0x19'),'event':_0xd78f('0xb'),'condition':_0xd78f('0xf'),'callback':afterCreate},{'channel':_0xd78f('0x18'),'model':'OpenchannelInteraction','event':_0xd78f('0x8'),'condition':_0xd78f('0x9'),'callback':afterUpdate},{'channel':_0xd78f('0x18'),'model':_0xd78f('0x1a'),'event':'afterCreate','condition':_0xd78f('0xc'),'callback':afterCreateMessage}];function request(_0x1f5d83){return client[_0xd78f('0x1b')](_0xd78f('0x1c'),_0x1f5d83)[_0xd78f('0x1d')](function(_0x47afd4){logger[_0xd78f('0x1e')](_0xd78f('0x1f'),_0xd78f('0x1c'),_0x47afd4);if(_0x47afd4[_0xd78f('0x20')]){if(_0x47afd4[_0xd78f('0x20')][_0xd78f('0x21')]===0x1f4){logger[_0xd78f('0x20')]('Trigger,\x20%s',_0xd78f('0x1c'),_0x47afd4['error']);}}})[_0xd78f('0x22')](function(_0x2107e6){logger[_0xd78f('0x20')](_0xd78f('0x1f'),'EventManager',_0x2107e6);});}function afterCreateMessage(_0x44fd1c){return function(_0x1ec366){_0x1ec366=_0x1ec366[_0xd78f('0x23')]({'plain':!![]});_0x1ec366[_0xd78f('0x24')]=_0x44fd1c;_0x1ec366['motionChannel']=_0x44fd1c;_0x1ec366['event']=_0x1ec366[_0xd78f('0x25')];Promise[_0xd78f('0x26')]()[_0xd78f('0x1d')](function(){if(typeof _0x1ec366[_0xd78f('0x27')]===_0xd78f('0x28'))return null;var _0x1a7128=_0xd78f('0x29')+_0x1ec366[_0xd78f('0x27')];return db[_0xd78f('0x2a')][_0xd78f('0x2b')](_0x1a7128,{'type':db[_0xd78f('0x2c')]['QueryTypes'][_0xd78f('0x2d')],'raw':!![]});})['then'](function(_0x503794){if(_0x503794){_0x1ec366[_0xd78f('0x2e')]=_0x503794[0x0];}if(typeof _0x1ec366['UserId']===_0xd78f('0x28'))return;return getAgent(_0x1ec366['UserId']);})[_0xd78f('0x1d')](function(_0x2a450b){if(_0x2a450b){_0x1ec366['interface']=util[_0xd78f('0x2f')](_0xd78f('0x30'),_0x2a450b[_0xd78f('0x31')]);_0x1ec366[_0xd78f('0x32')]=_0x2a450b;_0x1ec366[_0xd78f('0x24')]=_0x44fd1c;return request({'event':'incomingmessage','message':_0x1ec366});}else{return request({'event':_0xd78f('0x33'),'message':_0x1ec366});}})[_0xd78f('0x22')](function(_0x504376){logger['error'](_0xd78f('0x1f'),_0xd78f('0x34'),_0x504376);});};}function afterCreateOfflineMessage(_0xc56af2){return function(_0xa5a4d3){_0xa5a4d3=_0xa5a4d3[_0xd78f('0x23')]({'plain':!![]});_0xa5a4d3[_0xd78f('0x24')]=_0xc56af2;_0xa5a4d3[_0xd78f('0x35')]=_0xc56af2;_0xa5a4d3['event']=_0xd78f('0x36');return request({'event':_0xa5a4d3[_0xd78f('0x37')],'message':_0xa5a4d3});};}function afterCreate(_0x12777e,_0x43b468){return function(_0x495988){_0x495988=_0x495988['get']({'plain':!![]});_0x495988[_0xd78f('0x24')]=_0x12777e;_0x495988['motionChannel']=_0x12777e;_0x495988['event']=_0xd78f('0x38');Promise[_0xd78f('0x26')]()[_0xd78f('0x1d')](function(){var _0x547680='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x495988[_0xd78f('0x27')];return db[_0xd78f('0x2a')]['query'](_0x547680,{'type':db[_0xd78f('0x2c')][_0xd78f('0x39')][_0xd78f('0x2d')],'raw':!![]});})[_0xd78f('0x1d')](function(_0x528060){if(_0x528060){_0x495988['contact']=_0x528060[0x0];}if(typeof _0x495988[_0xd78f('0x3a')]==='undefined')return;return getAgent(_0x495988[_0xd78f('0x3a')]);})[_0xd78f('0x1d')](function(_0x5edf10){if(_0x5edf10){_0x495988[_0xd78f('0x3b')]=util[_0xd78f('0x2f')](_0xd78f('0x30'),_0x5edf10[_0xd78f('0x31')]);_0x495988[_0xd78f('0x32')]=_0x5edf10;}return request({'event':_0x43b468,'message':_0x495988});})[_0xd78f('0x22')](function(_0x5378d5){logger[_0xd78f('0x20')](_0xd78f('0x1f'),'AfterCreate',_0x5378d5);});};}function afterUpdate(_0x481604){return function(_0x531857){var _0x46066a=_0x531857[_0xd78f('0x3c')](_0xd78f('0x3d'))&&_0x531857['closed'];var _0x116d8c=_0x531857['changed'](_0xd78f('0x3e'));if(_0x46066a||_0x116d8c){var _0x4dd4e3=_0x46066a?_0xd78f('0x9'):_0xd78f('0x3e');var _0x25ae8a=_0x531857[_0xd78f('0x23')]({'plain':!![]});_0x25ae8a['channel']=_0x481604;_0x25ae8a['motionChannel']=_0x481604;_0x25ae8a['event']=_0x46066a?_0xd78f('0x3d'):_0xd78f('0x3e');var _0x3ab1d9=_0xd78f('0x29')+_0x25ae8a[_0xd78f('0x27')];return db[_0xd78f('0x2a')][_0xd78f('0x2b')](_0x3ab1d9,{'type':db[_0xd78f('0x2c')][_0xd78f('0x39')][_0xd78f('0x2d')],'raw':!![]})[_0xd78f('0x1d')](function(_0x27cdd2){if(_0x27cdd2){_0x25ae8a[_0xd78f('0x2e')]=_0x27cdd2[0x0];}if(typeof _0x25ae8a['UserId']===_0xd78f('0x28'))return;return getAgent(_0x25ae8a[_0xd78f('0x3a')]);})[_0xd78f('0x1d')](function(_0xc71ae3){if(_0xc71ae3){_0x25ae8a[_0xd78f('0x3b')]=util['format'](_0xd78f('0x30'),_0xc71ae3[_0xd78f('0x31')]);_0x25ae8a['agent']=_0xc71ae3;}return request({'event':_0x4dd4e3,'message':_0x25ae8a});})[_0xd78f('0x22')](function(_0x3c306d){logger['error'](_0xd78f('0x1f'),_0xd78f('0x3f'),_0x3c306d);});}};}function getAgent(_0x156b60){return db[_0xd78f('0x40')][_0xd78f('0x41')]({'where':{'id':_0x156b60},'attributes':['id',_0xd78f('0x31'),_0xd78f('0x42'),'email',_0xd78f('0x43')],'raw':!![]})[_0xd78f('0x1d')](function(_0x5210be){return _0x5210be;});}exports[_0xd78f('0x44')]=function(){for(var _0x8fb0a7=0x0;_0x8fb0a7=_0x8b2f70['agents']){throw Error(_0x1fe2('0x16'));}_0x2426dd(_0x5a7a2d);})[_0x1fe2('0x17')](function(_0x547959){_0x156b99(_0x547959);});});}; \ No newline at end of file +var _0x874e=['then','agents','catch','lodash','./license/util','voice','chat','fax','sms','whatsapp','openchannel','getChannels','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','role','count','agent'];(function(_0x5cbcaf,_0x4ff829){var _0x48a8f6=function(_0x317798){while(--_0x317798){_0x5cbcaf['push'](_0x5cbcaf['shift']());}};_0x48a8f6(++_0x4ff829);}(_0x874e,0x114));var _0xe874=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x874e[_0x1969a7];return _0x3d665f;};'use strict';var _=require(_0xe874('0x0'));var BPromise=require('bluebird');var db=require('../mysqldb')['db'];var util=require(_0xe874('0x1'));var channels=[_0xe874('0x2'),'mail',_0xe874('0x3'),_0xe874('0x4'),_0xe874('0x5'),_0xe874('0x6'),_0xe874('0x7')];exports[_0xe874('0x8')]=function(){return channels;};exports['isValidChannel']=function(_0x254e4c){_0x254e4c=_0x254e4c['toLowerCase']();return _[_0xe874('0x9')](channels,_0x254e4c);};exports[_0xe874('0xa')]=function(_0x3f13fd,_0x15a1b4,_0x599d51,_0x5ede14){var _0x23bb88={'loginAttempts':_0x15a1b4,'blocked':_0x599d51};if(!_[_0xe874('0xb')](_0x5ede14)){_0x23bb88[_0xe874('0xc')]=_0x5ede14;}return _0x3f13fd[_0xe874('0xd')](_0x23bb88);};exports[_0xe874('0xe')]=function(_0x344194){return new BPromise(function(_0x19a5b3,_0x36c776){var _0x53ff3d=0x0;if(_0x344194[_0xe874('0xf')]!=='agent'){_0x19a5b3(_0x344194);}db['User'][_0xe874('0x10')]({'where':{'role':_0xe874('0x11'),'online':!![],'id':{'$ne':_0x344194['id']}}})[_0xe874('0x12')](function(_0x555791){_0x53ff3d=_0x555791;return util[_0xe874('0xe')]();})['then'](function(_0x3157dd){if(_0x3157dd&&_0x3157dd[_0xe874('0x13')]&&_0x53ff3d>=_0x3157dd[_0xe874('0x13')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x19a5b3(_0x344194);})[_0xe874('0x14')](function(_0x446a9b){_0x36c776(_0x446a9b);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index e759d9e..aede91c 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Bad\x20Request','Forbidden','Out\x20Of\x20Interval','Not\x20Found','error','stack','statusMessage','status','send','exports','util','../config/logger','api','message','name','Error','inherits','Entity\x20not\x20found'];(function(_0x2a5c24,_0x1f022a){var _0x401d9e=function(_0x2617e3){while(--_0x2617e3){_0x2a5c24['push'](_0x2a5c24['shift']());}};_0x401d9e(++_0x1f022a);}(_0x7a54,0x106));var _0x47a5=function(_0x6dffed,_0x14eed1){_0x6dffed=_0x6dffed-0x0;var _0x541ed1=_0x7a54[_0x6dffed];return _0x541ed1;};'use strict';var util=require(_0x47a5('0x0'));var logger=require(_0x47a5('0x1'))(_0x47a5('0x2'));var APIError=function(_0x58157c,_0x1d33e){this[_0x47a5('0x3')]=_0x58157c||'Internal\x20Server\x20Error';this[_0x47a5('0x4')]=_0x1d33e||_0x47a5('0x5');util[_0x47a5('0x6')](APIError,Error);};var APIBadRequestError=function(_0x3717e1){this[_0x47a5('0x3')]=_0x3717e1||'Bad\x20Request';this[_0x47a5('0x4')]='Bad\x20Request';util[_0x47a5('0x6')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x30e405){this['message']=_0x30e405||_0x47a5('0x7');this['name']='Not\x20Found';util['inherits'](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x2a0e98){this[_0x47a5('0x3')]=_0x2a0e98||'Message\x20sent\x20outside\x20a\x20valid\x20interval';this[_0x47a5('0x4')]='Out\x20Of\x20Interval';util['inherits'](APIOutOfIntervalError,APIError);};function getStatusCode(_0x1f47f4){switch(_0x1f47f4){case _0x47a5('0x8'):return 0x190;case _0x47a5('0x9'),_0x47a5('0xa'):return 0x193;case _0x47a5('0xb'):return 0x194;default:return 0x1f4;}}function getCustomStatusMessage(_0xd308b8){if(_0xd308b8===_0x47a5('0xa'))return _0xd308b8;return null;}function handleError(_0x5beb89){return function(_0x44bd3e){logger[_0x47a5('0xc')](_0x44bd3e[_0x47a5('0xd')]);var _0x711793=getStatusCode(_0x44bd3e[_0x47a5('0x4')]);var _0x620ee9=getCustomStatusMessage(_0x44bd3e[_0x47a5('0x4')]);if(_0x44bd3e[_0x47a5('0x4')])delete _0x44bd3e['name'];if(_0x620ee9)_0x5beb89[_0x47a5('0xe')]=_0x620ee9;return _0x5beb89[_0x47a5('0xf')](_0x711793)[_0x47a5('0x10')](_0x44bd3e);};}module[_0x47a5('0x11')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIOutOfIntervalError':APIOutOfIntervalError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0x814b=['statusMessage','status','send','exports','util','../config/logger','api','message','name','Error','inherits','Bad\x20Request','Entity\x20not\x20found','Not\x20Found','Message\x20sent\x20outside\x20a\x20valid\x20interval','Out\x20Of\x20Interval','error','stack'];(function(_0x559d35,_0x267080){var _0x51bbc3=function(_0x51bac2){while(--_0x51bac2){_0x559d35['push'](_0x559d35['shift']());}};_0x51bbc3(++_0x267080);}(_0x814b,0x1a2));var _0xb814=function(_0x4c0622,_0x5dacaf){_0x4c0622=_0x4c0622-0x0;var _0x1799d8=_0x814b[_0x4c0622];return _0x1799d8;};'use strict';var util=require(_0xb814('0x0'));var logger=require(_0xb814('0x1'))(_0xb814('0x2'));var APIError=function(_0x2f4ece,_0xfbb64b){this[_0xb814('0x3')]=_0x2f4ece||'Internal\x20Server\x20Error';this[_0xb814('0x4')]=_0xfbb64b||_0xb814('0x5');util[_0xb814('0x6')](APIError,Error);};var APIBadRequestError=function(_0x4237bc){this[_0xb814('0x3')]=_0x4237bc||_0xb814('0x7');this['name']=_0xb814('0x7');util[_0xb814('0x6')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x5c8539){this[_0xb814('0x3')]=_0x5c8539||_0xb814('0x8');this[_0xb814('0x4')]=_0xb814('0x9');util[_0xb814('0x6')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x21d4a5){this[_0xb814('0x3')]=_0x21d4a5||_0xb814('0xa');this[_0xb814('0x4')]=_0xb814('0xb');util[_0xb814('0x6')](APIOutOfIntervalError,APIError);};function getStatusCode(_0x4b5f14){switch(_0x4b5f14){case _0xb814('0x7'):return 0x190;case'Forbidden',_0xb814('0xb'):return 0x193;case _0xb814('0x9'):return 0x194;default:return 0x1f4;}}function getCustomStatusMessage(_0x35b10d){if(_0x35b10d===_0xb814('0xb'))return _0x35b10d;return null;}function handleError(_0x2ce718){return function(_0x3bde14){logger[_0xb814('0xc')](_0x3bde14[_0xb814('0xd')]);var _0xa0a2e5=getStatusCode(_0x3bde14[_0xb814('0x4')]);var _0x3f4881=getCustomStatusMessage(_0x3bde14[_0xb814('0x4')]);if(_0x3bde14[_0xb814('0x4')])delete _0x3bde14[_0xb814('0x4')];if(_0x3f4881)_0x2ce718[_0xb814('0xe')]=_0x3f4881;return _0x2ce718[_0xb814('0xf')](_0xa0a2e5)[_0xb814('0x10')](_0x3bde14);};}module[_0xb814('0x11')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIOutOfIntervalError':APIOutOfIntervalError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index b649b9f..869d118 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9017=['send','exports','404','status'];(function(_0x503be0,_0x254ab5){var _0x2300f6=function(_0x17c3c4){while(--_0x17c3c4){_0x503be0['push'](_0x503be0['shift']());}};_0x2300f6(++_0x254ab5);}(_0x9017,0x149));var _0x7901=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9017[_0x3dd15e];return _0x231fd0;};'use strict';module[_0x7901('0x0')][0x194]=function pageNotFound(_0x3e42f9,_0xcf0009){var _0x2fd856=_0x7901('0x1');var _0x23f2e5=0x194;var _0x16fc9c={'status':_0x23f2e5};_0xcf0009['status'](_0x16fc9c[_0x7901('0x2')]);_0xcf0009['render'](_0x2fd856,{},function(_0x1e0fe2,_0x45762c){if(_0x1e0fe2){return _0xcf0009[_0x7901('0x2')](_0x16fc9c['status'])['json'](_0x16fc9c);}_0xcf0009[_0x7901('0x3')](_0x45762c);});}; \ No newline at end of file +var _0xb71a=['json','send','404','status'];(function(_0x151655,_0x105004){var _0x1544a4=function(_0xe7933a){while(--_0xe7933a){_0x151655['push'](_0x151655['shift']());}};_0x1544a4(++_0x105004);}(_0xb71a,0x102));var _0xab71=function(_0x50e40b,_0x338d17){_0x50e40b=_0x50e40b-0x0;var _0x2608b7=_0xb71a[_0x50e40b];return _0x2608b7;};'use strict';module['exports'][0x194]=function pageNotFound(_0x24ccd7,_0x3a29b2){var _0x3bb502=_0xab71('0x0');var _0xce52a=0x194;var _0xf86de4={'status':_0xce52a};_0x3a29b2[_0xab71('0x1')](_0xf86de4[_0xab71('0x1')]);_0x3a29b2['render'](_0x3bb502,{},function(_0x62ff49,_0x458779){if(_0x62ff49){return _0x3a29b2[_0xab71('0x1')](_0xf86de4['status'])[_0xab71('0x2')](_0xf86de4);}_0x3a29b2[_0xab71('0x3')](_0x458779);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index b9402d6..7be49a7 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','License','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','userSetting','cascade','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','ChatQueues','UserChatQueue','FaxQueues','SmsQueues','OpenchannelQueue','WhatsappQueues','CmList','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','MailAccountId','CloudProviderId','MailServerOut','restrict','Imap','Smtp','Disposition','Dispositions','Answers','Interactions','MailApplication','List','ListId','TemplateId','mandatoryDispositionPause','Agents','team_has_mail_queues','ContactId','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','ChatWebsiteId','Interval','MailQueueReport','Dashboard','CannedAnswer','FaxAccountId','Exntensions','TagId','FaxInteractionId','Account','Owner','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','CmContactId','HopperHistories','CmCompany','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','Campaign','OwnerId','CampaignId','All','OneAll','OneAny','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','CmContactHasItem','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','AnalyticCustomReport','Fields','MetricId','Configurations','Subjects','DescriptionId','FieldId','AccountId','Subject','SubjectId','Description','Field','SugarcrmField','Descriptions','VariableId','DeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowField','ToId','JscriptyQuestionReport','JscriptyProject','ProjectId','MailQueues','OpenchannelQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToQueue','FromSmsAccountId','CmCustomField','CustomFields','voice_queues_has_cm_lists','userProfileId','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','UserSetting','user','../config/environment','sequelize','lodash','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','defaultsDeep','mysql','username','password','options','database','sequelizeHistory','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','ChatMessage','ChatOfflineMessage','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','ReportAgentPreview','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject'];(function(_0x5dee2a,_0x47d02a){var _0x31e98e=function(_0x48b1e9){while(--_0x48b1e9){_0x5dee2a['push'](_0x5dee2a['shift']());}};_0x31e98e(++_0x47d02a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'use strict';var config=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0x0a9e('0x1')]=_['defaultsDeep'](config[_0x0a9e('0x1')],{'database':_0x0a9e('0x3'),'username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':_0x0a9e('0x9'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0x0a9e('0xa')](config['sequelizeHistory'],{'database':'motion2','username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':_0x0a9e('0xb'),'dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0x0a9e('0x1')][_0x0a9e('0xc')],config[_0x0a9e('0x1')][_0x0a9e('0xd')],config[_0x0a9e('0x1')][_0x0a9e('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x0a9e('0xf')],config[_0x0a9e('0x10')][_0x0a9e('0xc')],config[_0x0a9e('0x10')][_0x0a9e('0xd')],config[_0x0a9e('0x10')]['options'])};db[_0x0a9e('0x11')]=db['sequelize'][_0x0a9e('0x12')]('../api/user/user.model');db[_0x0a9e('0x13')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x14'));db['VoiceContext']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x15'));db[_0x0a9e('0x16')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x17'));db[_0x0a9e('0x18')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x19'));db[_0x0a9e('0x1a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x1b'));db['VoiceRecording']=db[_0x0a9e('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db[_0x0a9e('0x1c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1d'));db['VoiceMail']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1e'));db[_0x0a9e('0x1f')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x20'));db['VoiceCallReport']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x21'));db[_0x0a9e('0x22')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x23'));db['VoiceAgentReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x24'));db[_0x0a9e('0x25')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x26'));db[_0x0a9e('0x27')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/memberReport/memberReport.model');db[_0x0a9e('0x28')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x29'));db['VoiceTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2a'));db[_0x0a9e('0x2b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2c'));db[_0x0a9e('0x2d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x2e'));db['UserChatQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2f'));db[_0x0a9e('0x30')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x31'));db[_0x0a9e('0x32')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x33'));db[_0x0a9e('0x34')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0x0a9e('0x35')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x36'));db[_0x0a9e('0x37')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x38'));db[_0x0a9e('0x39')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x3a'));db[_0x0a9e('0x3b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailAccount/mailAccount.model');db[_0x0a9e('0x3c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailQueue/mailQueue.model');db[_0x0a9e('0x3d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailInteraction/mailInteraction.model');db[_0x0a9e('0x3e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x3f'));db['MailApplication']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x40'));db['MailQueueReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x41'));db['Dashboard']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x42'));db[_0x0a9e('0x43')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x44'));db[_0x0a9e('0x45')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x46'));db[_0x0a9e('0x47')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x48'));db['FaxInteraction']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x49'));db[_0x0a9e('0x4a')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4b'));db[_0x0a9e('0x4c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4d'));db[_0x0a9e('0x4e')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x4f'));db[_0x0a9e('0x50')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x51'));db[_0x0a9e('0x52')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/smsApplication/smsApplication.model');db[_0x0a9e('0x53')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x54'));db[_0x0a9e('0x55')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x56'));db[_0x0a9e('0x57')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x58'));db[_0x0a9e('0x59')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x5a'));db[_0x0a9e('0x5b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5c'));db[_0x0a9e('0x5d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x0a9e('0x5e')]=db[_0x0a9e('0x1')]['import']('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5f'));db[_0x0a9e('0x60')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x61'));db[_0x0a9e('0x62')]=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x0a9e('0x63')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatApplication/chatApplication.model');db[_0x0a9e('0x64')]=db[_0x0a9e('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x0a9e('0x65')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatMessage/chatMessage.model');db[_0x0a9e('0x66')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x0a9e('0x67')]=db[_0x0a9e('0x1')]['import']('../api/chatQueue/chatQueue.model');db[_0x0a9e('0x68')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x69'));db['ChatProactiveAction']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x6a'));db['CmCompany']=db['sequelize']['import'](_0x0a9e('0x6b'));db['CmContact']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6c'));db[_0x0a9e('0x6d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6e'));db[_0x0a9e('0x6f')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x70'));db[_0x0a9e('0x71')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x72'));db['CmHopperHistory']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x0a9e('0x73')]=db['sequelize'][_0x0a9e('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db['sequelize'][_0x0a9e('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x0a9e('0x74')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x75'));db[_0x0a9e('0x76')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x77'));db['CannedAnswer']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x78'));db['Disposition']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x79'));db[_0x0a9e('0x7a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x7b'));db['Interval']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x7c'));db[_0x0a9e('0x7d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x7e'));db[_0x0a9e('0x7f')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x80'));db['VoiceQueuesLog']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x81'));db[_0x0a9e('0x82')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x83'));db[_0x0a9e('0x84')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x85'));db[_0x0a9e('0x86')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x87'));db[_0x0a9e('0x88')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x89'));db['CmContactHasItem']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8a'));db['CmHopperAdditionalPhone']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x0a9e('0x8b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8c'));db[_0x0a9e('0x8d')]=db['sequelize']['import']('../api/trigger/trigger.model');db[_0x0a9e('0x8e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8f'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['IntegrationReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x92'));db['AnalyticCustomReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x93'));db[_0x0a9e('0x94')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x95'));db[_0x0a9e('0x96')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x97'));db[_0x0a9e('0x98')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/analyticMetric/analyticMetric.model');db[_0x0a9e('0x99')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9a'));db['AnalyticTreeReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9b'));db[_0x0a9e('0x9c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9d'));db[_0x0a9e('0x9e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9f'));db[_0x0a9e('0xa0')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSalesforceField/intSalesforceField.model');db[_0x0a9e('0xa1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x0a9e('0xa2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa3'));db['SugarcrmField']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa4'));db['DeskAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xa5'));db[_0x0a9e('0xa6')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa7'));db[_0x0a9e('0xa8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa9'));db[_0x0a9e('0xaa')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xab'));db[_0x0a9e('0xac')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xad'));db[_0x0a9e('0xae')]=db['sequelize'][_0x0a9e('0x12')]('../api/intZohoField/intZohoField.model');db[_0x0a9e('0xaf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb0'));db['ZendeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb1'));db[_0x0a9e('0xb2')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb3'));db['FreshdeskAccount']=db['sequelize'][_0x0a9e('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb4'));db[_0x0a9e('0xb5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb6'));db['VtigerAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xb7'));db[_0x0a9e('0xb8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x0a9e('0xb9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerField/intVtigerField.model');db[_0x0a9e('0xba')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbb'));db[_0x0a9e('0xbc')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbd'));db['ServicenowField']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0x0a9e('0xbe')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x0a9e('0xbf')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xc0'));db[_0x0a9e('0xc1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc2'));db[_0x0a9e('0xc3')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xc4'));db[_0x0a9e('0xc5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc6'));db[_0x0a9e('0xc7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc8'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['Network']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc9'));db[_0x0a9e('0xca')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcb'));db[_0x0a9e('0xcc')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x0a9e('0xcd')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xce'));db['JscriptyQuestionReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcf'));db[_0x0a9e('0xd0')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xd1'));db[_0x0a9e('0xd2')]=db['sequelize']['import'](_0x0a9e('0xd3'));db[_0x0a9e('0xd4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd5'));db[_0x0a9e('0xd6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd7'));db['JscriptyProject']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xd8'));db[_0x0a9e('0xd9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xda'));db['SquareOdbc']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xdb'));db[_0x0a9e('0xdc')]=db[_0x0a9e('0x1')]['import']('../api/squareProject/squareProject.model');db[_0x0a9e('0xdd')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xde'));db[_0x0a9e('0xdf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe0'));db['Team']=db['sequelize'][_0x0a9e('0x12')]('../api/team/team.model');db[_0x0a9e('0xe1')]=db['sequelize'][_0x0a9e('0x12')]('../api/license/license.model');db['Campaign']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/campaign/campaign.model');db[_0x0a9e('0xe2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe3'));db[_0x0a9e('0xe4')]=db['sequelize']['import'](_0x0a9e('0xe5'));db[_0x0a9e('0xe6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe7'));db['MailTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailTransferReport/mailTransferReport.model');db[_0x0a9e('0xe8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe9'));db[_0x0a9e('0xea')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xeb'));db[_0x0a9e('0xec')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xed'));db[_0x0a9e('0xee')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xef'));db['CmList']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf0'));db[_0x0a9e('0xf1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0x0a9e('0xf2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfile/userProfile.model');db[_0x0a9e('0xf3')]=db['sequelize'][_0x0a9e('0x12')]('../api/userProfileSection/userProfileSection.model');db[_0x0a9e('0xf4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfileResource/userProfileResource.model');db[_0x0a9e('0xf5')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf6'));db[_0x0a9e('0xf7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xf8'));db[_0x0a9e('0xf9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfa'));db[_0x0a9e('0xfb')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfc'));db[_0x0a9e('0xfd')]=db[_0x0a9e('0x1')]['import']('../api/whatsappMessage/whatsappMessage.model');db[_0x0a9e('0xfe')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xff'));db['WhatsappTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x100'));db[_0x0a9e('0x101')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x102'));db[_0x0a9e('0x103')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x104'));db[_0x0a9e('0x105')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x106'));db[_0x0a9e('0x107')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x108'));db[_0x0a9e('0x109')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x10a'));db['UserSetting']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/user-setting/user-setting.model');db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db[_0x0a9e('0x10c')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db['UserSetting'],{'as':_0x0a9e('0x10d'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x112'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x113'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x117'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x118'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x11a'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xfb')],{'as':_0x0a9e('0x11e'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xf5')],{'as':_0x0a9e('0x11f'),'foreignKey':_0x0a9e('0x120')});db[_0x0a9e('0x11')]['belongsTo'](db[_0x0a9e('0xf2')],{'as':'UserProfile','foreignKey':'userProfileId'});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x68')],{'as':_0x0a9e('0x122'),'through':_0x0a9e('0x123')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x125'),'through':_0x0a9e('0x126')});db[_0x0a9e('0x11')]['belongsToMany'](db['CmList'],{'as':_0x0a9e('0x127'),'through':_0x0a9e('0x128')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x12a')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'through':_0x0a9e('0x12b')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'through':'user_has_chat_interactions'});db['User']['belongsToMany'](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x12c'),'through':_0x0a9e('0x12d')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x53')],{'as':'SmsInteractions','through':_0x0a9e('0x12e')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'as':_0x0a9e('0x118'),'through':_0x0a9e('0x12f')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0xfb')],{'as':'WhatsappInteractions','through':_0x0a9e('0x130')});db['User'][_0x0a9e('0x121')](db['VoiceQueue'],{'as':_0x0a9e('0x131'),'through':_0x0a9e('0x2d'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0xf1')],{'as':_0x0a9e('0x132'),'through':_0x0a9e('0x109'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x3c')],{'as':'MailQueues','through':_0x0a9e('0x30'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x133'),'through':_0x0a9e('0x134'),'required':![],'hooks':!![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x4c')],{'as':_0x0a9e('0x135'),'through':_0x0a9e('0x32'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'as':_0x0a9e('0x136'),'through':_0x0a9e('0x34'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x137')],{'as':'OpenchannelQueues','through':_0x0a9e('0x35'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'as':_0x0a9e('0x138'),'through':_0x0a9e('0x37'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'through':_0x0a9e('0x128')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x13a'),'through':_0x0a9e('0x13b')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x45')],{'as':'FaxAccounts','through':_0x0a9e('0x13c')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x13d'),'through':_0x0a9e('0x13e')});db[_0x0a9e('0x11')]['belongsToMany'](db['OpenchannelAccount'],{'as':_0x0a9e('0x13f'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x141'),'through':_0x0a9e('0x142')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x143'),'through':_0x0a9e('0x144')});db[_0x0a9e('0x13')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':'SpiedAgents','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x145')});db[_0x0a9e('0x146')]['hasMany'](db[_0x0a9e('0x16')],{'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x16')][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x147'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x18')][_0x0a9e('0x121')](db[_0x0a9e('0x84')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x149')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x14a'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db['CmHopper'],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'VoiceQueueId'});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x116')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db['CmHopperBlack'],{'as':_0x0a9e('0x14d'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':_0x0a9e('0x14e'),'foreignKey':_0x0a9e('0x14b')});db['VoiceQueue']['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a')][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':_0x0a9e('0x151'),'foreignKey':_0x0a9e('0x152')});db['VoiceQueue'][_0x0a9e('0x150')](db['Interval'],{'as':'Interval','foreignKey':_0x0a9e('0x153')});db['VoiceQueue'][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db['VoiceQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x127'),'through':'voice_queues_has_cm_lists'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'as':_0x0a9e('0x155'),'through':_0x0a9e('0x105')});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x157')});db['VoiceRecording']['belongsTo'](db['User'],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x1c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x10c')]['hasMany'](db['VoiceMailMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'mailboxuser','sourceKey':_0x0a9e('0x159')});db[_0x0a9e('0x1f')][_0x0a9e('0x150')](db[_0x0a9e('0x10c')],{'foreignKey':_0x0a9e('0x15a'),'targetKey':_0x0a9e('0x159')});db[_0x0a9e('0x15b')][_0x0a9e('0x110')](db[_0x0a9e('0x25')],{'as':_0x0a9e('0x15c'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')]['hasMany'](db[_0x0a9e('0x15e')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db['MailServerIn'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x39')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':'CloudProvider','foreignKey':_0x0a9e('0x162'),'onDelete':'restrict'});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':_0x0a9e('0x103'),'foreignKey':_0x0a9e('0x162'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x3b')][_0x0a9e('0x10b')](db[_0x0a9e('0x39')],{'as':_0x0a9e('0x165'),'onDelete':_0x0a9e('0x10e')});db['MailAccount']['hasOne'](db[_0x0a9e('0x163')],{'as':_0x0a9e('0x166'),'onDelete':'cascade'});db['MailAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'MailAccountId','onDelete':_0x0a9e('0x10e')});db['MailAccount'][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':'MailAccountId'});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x3e')],{'as':'Messages','foreignKey':_0x0a9e('0x161')});db['MailAccount']['hasMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x161'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x8b')],{'as':_0x0a9e('0x8b'),'foreignKey':_0x0a9e('0x16e')});db[_0x0a9e('0x3b')]['belongsTo'](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x3b')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x0a9e('0x13e')});db['MailQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x30')});db[_0x0a9e('0x3c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x11c')]['hasMany'](db[_0x0a9e('0x3e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':'MailInteractionId'});db[_0x0a9e('0x11c')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x11c')]['belongsTo'](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11c')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12b'),'foreignKey':_0x0a9e('0x177')});db[_0x0a9e('0x3e')]['hasMany'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0x178'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':'User'});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x179'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x60')],{'as':'ChatWebsite','foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':'ChatOfflineMessageId'});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')]['belongsTo'](db[_0x0a9e('0x3b')],{'onDelete':_0x0a9e('0x164')});db['MailApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport']['belongsTo'](db['MailAccount'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':_0x0a9e('0x16d')});db['MailQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailInteraction'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailMessage'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{});db[_0x0a9e('0x17d')]['hasMany'](db[_0x0a9e('0x43')],{'as':'Items','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')]['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':'Answers','foreignKey':_0x0a9e('0x17f')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x147'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x180'),'onDelete':'cascade'});db[_0x0a9e('0x45')]['hasMany'](db['FaxMessage'],{'as':_0x0a9e('0x158')});db['FaxAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':'Trunk'});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0a9e('0x45')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_fax_accounts'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'restrict'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x4c')],{'onDelete':'restrict'});db[_0x0a9e('0x47')]['belongsTo'](db[_0x0a9e('0x45')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['FaxInteraction'][_0x0a9e('0x110')](db[_0x0a9e('0x4a')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':'fax_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x185'),'as':'ThroughTags'});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12d'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x11')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x179'),'foreignKey':'FaxInteractionId'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':'Contact'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':'Account','foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db['User'],{'as':'Agents','through':_0x0a9e('0x32')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x187'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['FaxAccount'],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxInteraction'],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x4a')],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxQueue'],{});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x188'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db['SmsMessage'],{'as':_0x0a9e('0x158'),'foreignKey':_0x0a9e('0x188')});db['SmsAccount']['hasMany'](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x147'),'foreignKey':'SmsAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x50')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x142')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db['SmsApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{'onDelete':_0x0a9e('0x164')});db['SmsApplication']['belongsTo'](db[_0x0a9e('0x50')],{'onDelete':'restrict'});db[_0x0a9e('0x52')]['belongsTo'](db['Interval'],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x53')][_0x0a9e('0x110')](db[_0x0a9e('0x55')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x189')});db['SmsInteraction']['belongsTo'](db[_0x0a9e('0x50')],{'as':'Account','foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'sms_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x18a'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x53')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Users','through':_0x0a9e('0x12e'),'foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x55')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x57')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x34'),'foreignKey':_0x0a9e('0x18b')});db[_0x0a9e('0x57')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x59')]['hasMany'](db['Disposition'],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x59')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x16a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','foreignKey':_0x0a9e('0x18d')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5b')],{'as':'Applications','foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x59')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x59')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x5b')]['belongsTo'](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0x0a9e('0x18e')});db['OpenchannelApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db['OpenchannelApplication']['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x5d')][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x18f')});db[_0x0a9e('0x5d')]['belongsTo'](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db['OpenchannelInteraction'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x5d')][_0x0a9e('0x150')](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x175')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':'user_has_openchannel_interactions','foreignKey':_0x0a9e('0x18f')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0x5d')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x179'),'foreignKey':'OpenchannelInteractionId'});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x35'),'foreignKey':_0x0a9e('0x18e')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x155')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x17a')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x191')],{'as':_0x0a9e('0x192')});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x63')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x65')],{'as':_0x0a9e('0x158')});db['ChatWebsite'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x60')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db['ChatWebsite'][_0x0a9e('0x150')](db['MailAccount'],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db['ChatWebsite'][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db['ChatWebsite'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x13b')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelAccount'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x5d')],{});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db['OpenchannelMessage'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{});db['ChatApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x193'),'foreignKey':'UserId','onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x194'),'foreignKey':_0x0a9e('0x195'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':_0x0a9e('0x17a'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x64')][_0x0a9e('0x110')](db['ChatMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x64')]['belongsTo'](db['User'],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x199'),'foreignKey':_0x0a9e('0x197')});db['ChatMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x66')][_0x0a9e('0x110')](db['Attachment'],{'as':_0x0a9e('0x178'),'foreignKey':_0x0a9e('0x19a'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0x66')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x0a9e('0x67')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserChatQueue','hooks':!![]});db[_0x0a9e('0x67')]['belongsToMany'](db['Team'],{'through':_0x0a9e('0x19b'),'as':'Teams'});db[_0x0a9e('0x68')][_0x0a9e('0x110')](db[_0x0a9e('0xcc')],{'as':'Messages','foreignKey':_0x0a9e('0x19c'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x68')]['belongsToMany'](db['User'],{'as':_0x0a9e('0x14a'),'through':_0x0a9e('0x123')});db[_0x0a9e('0x191')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x0a9e('0x110')](db[_0x0a9e('0x124')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact']['hasMany'](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0x0a9e('0x19d')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':'HopperFinals','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':'JscriptySessions','foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db['MailInteraction'],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x172'),'onDelete':'restrict'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x19f')],{'as':_0x0a9e('0x1a0'),'foreignKey':'CompanyId'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':'cascade'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':'cm_user_has_contacts'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x1a1')});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1a1'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x6d')][_0x0a9e('0x110')](db[_0x0a9e('0x1a2')],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1a4')});db['CmHopper'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db['CmHopper'][_0x0a9e('0x150')](db['User'],{'as':'Agent','foreignKey':'UserId'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':_0x0a9e('0x194'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':'CampaignId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x1a6')});db['CmHopperBlack'][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172'),'onDelete':'cascade'});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':'Queue','foreignKey':_0x0a9e('0x14b'),'onDelete':_0x0a9e('0x10e')});db['CmHopperBlack'][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':_0x0a9e('0x1a7'),'onDelete':'cascade'});db[_0x0a9e('0x76')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1a8'),'singular':_0x0a9e('0x1a9')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x76')]['hasMany'](db[_0x0a9e('0x7a')],{'as':{'plural':'Any','singular':_0x0a9e('0x1aa')},'foreignKey':'AutomationAnyId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['Automation'][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x167')]['hasMany'](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1ac'),'onDelete':'cascade'});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db['Interval'],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x10e'),'hooks':!![],'required':![]});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x164')});db['Interval'][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')]['hasMany'](db['ChatApplication'],{'as':_0x0a9e('0x1af'),'foreignKey':'IntervalId'});db[_0x0a9e('0x17b')]['hasMany'](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x1b1'),'foreignKey':'IntervalId'});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x94')],{'foreignKey':_0x0a9e('0x1b2')});db['Schedule']['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x0a9e('0x1b3')});db[_0x0a9e('0x84')][_0x0a9e('0x121')](db[_0x0a9e('0x18')],{'as':'Mohs','through':_0x0a9e('0x149'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0x124')],{'through':'cm_contact_has_tags'});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'through':'chat_interaction_has_tags'});db['Tag'][_0x0a9e('0x121')](db['MailInteraction'],{'through':_0x0a9e('0x173')});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x53')],{'through':_0x0a9e('0x18a')});db['Tag']['belongsToMany'](db[_0x0a9e('0x11b')],{'through':_0x0a9e('0x185')});db[_0x0a9e('0x86')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'through':_0x0a9e('0x1b4')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0xfb')],{'through':_0x0a9e('0x1b5')});db[_0x0a9e('0x1b6')]['belongsTo'](db[_0x0a9e('0x88')],{'as':_0x0a9e('0x1b7'),'foreignKey':_0x0a9e('0x1b8')});db[_0x0a9e('0x1a2')][_0x0a9e('0x150')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x1b9'),'foreignKey':_0x0a9e('0x1a4')});db[_0x0a9e('0x1b6')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x19d')});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1ba'),'singular':_0x0a9e('0x1bb')},'foreignKey':_0x0a9e('0x1bc'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db['Condition'],{'as':{'plural':_0x0a9e('0x1bd'),'singular':_0x0a9e('0x1be')},'foreignKey':_0x0a9e('0x1bf'),'onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'TriggerId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x1c0')]['hasMany'](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x0a9e('0x98')][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c2')});db['AnalyticFieldReport']['belongsTo'](db[_0x0a9e('0x98')],{'foreignKey':_0x0a9e('0x1c2')});db[_0x0a9e('0x9c')]['hasMany'](db[_0x0a9e('0x9e')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0x9e')]['hasMany'](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x9e')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db['SalesforceConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x9c')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa0')][_0x0a9e('0x110')](db['SalesforceField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa0')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['SalesforceField'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa0')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xa1')][_0x0a9e('0x110')](db[_0x0a9e('0xa2')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa2')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa2')][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['SugarcrmConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0xa1')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db['SugarcrmField'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1cc')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmField'][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1cf')]['hasMany'](db[_0x0a9e('0xa6')],{'as':'Configurations','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa6')]['hasMany'](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'DescriptionId'});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':'FieldId'});db[_0x0a9e('0xa6')][_0x0a9e('0x150')](db[_0x0a9e('0x1cf')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'int_desk_configuration_has_tags'});db['DeskField'][_0x0a9e('0x110')](db['DeskField'],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xa8')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['DeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':'Field','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa8')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xaa')][_0x0a9e('0x110')](db[_0x0a9e('0xac')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Subjects','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db['ZohoConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xac')][_0x0a9e('0x150')](db[_0x0a9e('0xaa')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xae')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xaf')][_0x0a9e('0x110')](db['ZendeskConfiguration'],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d0')]['hasMany'](db[_0x0a9e('0xb2')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x0a9e('0x1d0')][_0x0a9e('0x150')](db[_0x0a9e('0xaf')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0x1d0')]['belongsToMany'](db['Tag'],{'through':_0x0a9e('0x1d1')});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['ZendeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb2')][_0x0a9e('0x150')](db['Variable'],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d2')][_0x0a9e('0x110')](db[_0x0a9e('0x1d3')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d3')]['hasMany'](db['FreshdeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['FreshdeskConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x1d2')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['FreshdeskConfiguration'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1d4')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['FreshdeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb5')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d5')]['hasMany'](db[_0x0a9e('0xb8')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xb8')]['hasMany'](db[_0x0a9e('0xb9')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db['VtigerConfiguration'][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb8')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Fields','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb8')][_0x0a9e('0x150')](db[_0x0a9e('0x1d5')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db['VtigerField']['hasMany'](db[_0x0a9e('0xb9')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb9')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xba')]['hasMany'](db[_0x0a9e('0xbc')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbc')]['hasMany'](db['ServicenowField'],{'as':_0x0a9e('0x1c4'),'foreignKey':'SubjectId'});db[_0x0a9e('0xbc')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xbc')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c1'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbc')][_0x0a9e('0x150')](db[_0x0a9e('0xba')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['ServicenowField'][_0x0a9e('0x110')](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d6')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d6')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cb'),'foreignKey':'FieldId'});db[_0x0a9e('0x1d6')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xbe')]['hasMany'](db[_0x0a9e('0xbf')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbe')][_0x0a9e('0x150')](db['CloudProvider'],{'as':_0x0a9e('0x103'),'foreignKey':'CloudProviderId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['Dynamics365Configuration'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbf')][_0x0a9e('0x150')](db[_0x0a9e('0xbe')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['Dynamics365Field'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xc1')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['FreshsalesAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xc5')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cd'),'foreignKey':'DescriptionId'});db[_0x0a9e('0xc5')]['hasMany'](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1c1'),'foreignKey':'FieldId'});db[_0x0a9e('0xc5')]['belongsTo'](db[_0x0a9e('0xc3')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['FreshsalesField'][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['FreshsalesField']['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x60')],{});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':'ListId'});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{});db['ChatInternalMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1d7')});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0x1d8')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0xcd')],{'foreignKey':'SessionId','onDelete':_0x0a9e('0x10e')});db['SmsQueueReport']['belongsTo'](db[_0x0a9e('0x50')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0xd2')]['belongsTo'](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xd2')]['belongsTo'](db['SmsMessage'],{});db['SmsQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0x1d8')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_teams'});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0x1a')],{'through':'TeamVoiceQueue','as':_0x0a9e('0x131')});db['Team']['belongsToMany'](db[_0x0a9e('0x3c')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x1db')});db[_0x0a9e('0x129')]['belongsToMany'](db['ChatQueue'],{'through':_0x0a9e('0x19b'),'as':'ChatQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db['FaxQueue'],{'through':_0x0a9e('0x187'),'as':'FaxQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x136')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x137')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x1dc')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'through':_0x0a9e('0x1dd'),'as':_0x0a9e('0x138')});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0xf1')],{'through':_0x0a9e('0x107'),'as':_0x0a9e('0x132')});db['Campaign'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db['CmHopperHistory'],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')]['hasMany'](db[_0x0a9e('0x6f')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x0a9e('0x1a5')]['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['Trunk'],{'as':_0x0a9e('0x151'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['SquareProject'],{'as':_0x0a9e('0xdc'),'foreignKey':_0x0a9e('0x1de')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':'Lists','through':_0x0a9e('0x1df')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x1e0')});db[_0x0a9e('0xe4')][_0x0a9e('0x150')](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':_0x0a9e('0x19a')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db['MailMessage'],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e2'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0x1e1')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e7'),'as':_0x0a9e('0x1e8')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['ChatInteraction'],{});db[_0x0a9e('0xe8')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1e9'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xe8')]['belongsTo'](db[_0x0a9e('0x67')],{'foreignKey':_0x0a9e('0x1eb'),'as':'ToQueue'});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1ec'),'as':_0x0a9e('0x1e8')});db['FaxTransferReport'][_0x0a9e('0x150')](db['FaxMessage'],{});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{});db['FaxTransferReport']['belongsTo'](db[_0x0a9e('0x45')],{'foreignKey':_0x0a9e('0x1ed'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xea')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x0a9e('0x1ee'),'as':_0x0a9e('0x1ef')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'foreignKey':'ToFaxAccountId','as':_0x0a9e('0x1e8')});db[_0x0a9e('0xec')]['belongsTo'](db[_0x0a9e('0x5e')],{});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x0a9e('0x1e3')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db[_0x0a9e('0x55')],{});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':_0x0a9e('0x1f0'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xee')]['belongsTo'](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x0a9e('0x1ef')});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList']['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x1f1')],{'as':_0x0a9e('0x1f2'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db['CmContact'],{'as':_0x0a9e('0x125'),'onDelete':'cascade','foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':'HopperHistory','foreignKey':'ListId'});db['CmList'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':'ListId'});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x1a')],{'as':'Queues','through':_0x0a9e('0x1f3')});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x128')});db[_0x0a9e('0xf1')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf1')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserVoicePrefix'});db[_0x0a9e('0xf1')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':'TeamVoicePrefix','as':_0x0a9e('0x155')});db[_0x0a9e('0xf2')][_0x0a9e('0x110')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'foreignKey':_0x0a9e('0x1f4')});db['UserProfile'][_0x0a9e('0x110')](db['UserProfileSection'],{'as':_0x0a9e('0x1f5'),'foreignKey':_0x0a9e('0x1f4'),'onDelete':_0x0a9e('0x10e')});db['UserProfileSection']['hasMany'](db['UserProfileResource'],{'as':_0x0a9e('0x1f6'),'foreignKey':_0x0a9e('0x1f7'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x1f8')});db['WhatsappAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xfd')],{'as':_0x0a9e('0x158'),'foreignKey':'WhatsappAccountId'});db[_0x0a9e('0xf7')]['hasMany'](db[_0x0a9e('0xfb')],{'as':'Interactions'});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['WhatsappApplication'],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db['WhatsappAccount'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xf7')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0xf7')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x144')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x101')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db['WhatsappAccount'],{'onDelete':_0x0a9e('0x164')});db['WhatsappApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0xf9')]['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['WhatsappInteraction'][_0x0a9e('0x110')](db['WhatsappMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0xfb')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x174')});db['WhatsappInteraction'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x175')});db[_0x0a9e('0xfb')]['belongsToMany'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x130'),'foreignKey':'WhatsappInteractionId'});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':_0x0a9e('0x160')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfd')]['belongsTo'](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{});db['WhatsappQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['WhatsappInteraction'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x0a9e('0x101')],{});db[_0x0a9e('0xfe')]['belongsTo'](db['WhatsappMessage'],{});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['User'],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfd')],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfb')],{});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x0a9e('0x1fb'),'as':_0x0a9e('0x1e3')});db['WhatsappTransferReport']['belongsTo'](db[_0x0a9e('0xf7')],{'foreignKey':_0x0a9e('0x1fc'),'as':'ToAccount'});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0x0a9e('0x1fd'),'as':_0x0a9e('0x1ef')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':'FromAgent'});db[_0x0a9e('0x1fa')][_0x0a9e('0x150')](db['User'],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x37'),'foreignKey':'WhatsappQueueId'});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x1dd'),'as':'Teams'});db[_0x0a9e('0x1fe')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x1ff'),'foreignKey':_0x0a9e('0x10f'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x103')][_0x0a9e('0x10b')](db['Dynamics365Account'],{'as':_0x0a9e('0xbe'),'onDelete':_0x0a9e('0x164')});db['CloudProvider'][_0x0a9e('0x10b')](db['MailServerIn'],{'as':'Imap','onDelete':_0x0a9e('0x164')});db['CloudProvider']['hasOne'](db['MailServerOut'],{'as':'Smtp','onDelete':_0x0a9e('0x164')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xa9e0=['SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','License','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','userSetting','cascade','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','ChatQueues','UserChatQueue','FaxQueues','SmsQueues','OpenchannelQueue','WhatsappQueues','CmList','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','MailAccountId','CloudProviderId','MailServerOut','restrict','Imap','Smtp','Disposition','Dispositions','Answers','Interactions','MailApplication','List','ListId','TemplateId','mandatoryDispositionPause','Agents','team_has_mail_queues','ContactId','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','ChatWebsiteId','Interval','MailQueueReport','Dashboard','CannedAnswer','FaxAccountId','Exntensions','TagId','FaxInteractionId','Account','Owner','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','CmContactId','HopperHistories','CmCompany','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','Campaign','OwnerId','CampaignId','All','OneAll','OneAny','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','CmContactHasItem','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','AnalyticCustomReport','Fields','MetricId','Configurations','Subjects','DescriptionId','FieldId','AccountId','Subject','SubjectId','Description','Field','SugarcrmField','Descriptions','VariableId','DeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowField','ToId','JscriptyQuestionReport','JscriptyProject','ProjectId','MailQueues','OpenchannelQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToQueue','FromSmsAccountId','CmCustomField','CustomFields','voice_queues_has_cm_lists','userProfileId','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','UserSetting','user','../config/environment','sequelize','lodash','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','defaultsDeep','mysql','username','password','options','database','sequelizeHistory','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','ChatMessage','ChatOfflineMessage','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','ReportAgentPreview','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject'];(function(_0x44b3bd,_0x44c97d){var _0x1efc4a=function(_0x5d0205){while(--_0x5d0205){_0x44b3bd['push'](_0x44b3bd['shift']());}};_0x1efc4a(++_0x44c97d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var config=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0x0a9e('0x1')]=_['defaultsDeep'](config[_0x0a9e('0x1')],{'database':_0x0a9e('0x3'),'username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':_0x0a9e('0x9'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0x0a9e('0xa')](config['sequelizeHistory'],{'database':'motion2','username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':_0x0a9e('0xb'),'dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0x0a9e('0x1')][_0x0a9e('0xc')],config[_0x0a9e('0x1')][_0x0a9e('0xd')],config[_0x0a9e('0x1')][_0x0a9e('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x0a9e('0xf')],config[_0x0a9e('0x10')][_0x0a9e('0xc')],config[_0x0a9e('0x10')][_0x0a9e('0xd')],config[_0x0a9e('0x10')]['options'])};db[_0x0a9e('0x11')]=db['sequelize'][_0x0a9e('0x12')]('../api/user/user.model');db[_0x0a9e('0x13')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x14'));db['VoiceContext']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x15'));db[_0x0a9e('0x16')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x17'));db[_0x0a9e('0x18')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x19'));db[_0x0a9e('0x1a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x1b'));db['VoiceRecording']=db[_0x0a9e('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db[_0x0a9e('0x1c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1d'));db['VoiceMail']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1e'));db[_0x0a9e('0x1f')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x20'));db['VoiceCallReport']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x21'));db[_0x0a9e('0x22')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x23'));db['VoiceAgentReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x24'));db[_0x0a9e('0x25')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x26'));db[_0x0a9e('0x27')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/memberReport/memberReport.model');db[_0x0a9e('0x28')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x29'));db['VoiceTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2a'));db[_0x0a9e('0x2b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2c'));db[_0x0a9e('0x2d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x2e'));db['UserChatQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2f'));db[_0x0a9e('0x30')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x31'));db[_0x0a9e('0x32')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x33'));db[_0x0a9e('0x34')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0x0a9e('0x35')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x36'));db[_0x0a9e('0x37')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x38'));db[_0x0a9e('0x39')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x3a'));db[_0x0a9e('0x3b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailAccount/mailAccount.model');db[_0x0a9e('0x3c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailQueue/mailQueue.model');db[_0x0a9e('0x3d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailInteraction/mailInteraction.model');db[_0x0a9e('0x3e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x3f'));db['MailApplication']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x40'));db['MailQueueReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x41'));db['Dashboard']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x42'));db[_0x0a9e('0x43')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x44'));db[_0x0a9e('0x45')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x46'));db[_0x0a9e('0x47')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x48'));db['FaxInteraction']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x49'));db[_0x0a9e('0x4a')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4b'));db[_0x0a9e('0x4c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4d'));db[_0x0a9e('0x4e')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x4f'));db[_0x0a9e('0x50')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x51'));db[_0x0a9e('0x52')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/smsApplication/smsApplication.model');db[_0x0a9e('0x53')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x54'));db[_0x0a9e('0x55')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x56'));db[_0x0a9e('0x57')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x58'));db[_0x0a9e('0x59')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x5a'));db[_0x0a9e('0x5b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5c'));db[_0x0a9e('0x5d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x0a9e('0x5e')]=db[_0x0a9e('0x1')]['import']('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5f'));db[_0x0a9e('0x60')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x61'));db[_0x0a9e('0x62')]=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x0a9e('0x63')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatApplication/chatApplication.model');db[_0x0a9e('0x64')]=db[_0x0a9e('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x0a9e('0x65')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatMessage/chatMessage.model');db[_0x0a9e('0x66')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x0a9e('0x67')]=db[_0x0a9e('0x1')]['import']('../api/chatQueue/chatQueue.model');db[_0x0a9e('0x68')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x69'));db['ChatProactiveAction']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x6a'));db['CmCompany']=db['sequelize']['import'](_0x0a9e('0x6b'));db['CmContact']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6c'));db[_0x0a9e('0x6d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6e'));db[_0x0a9e('0x6f')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x70'));db[_0x0a9e('0x71')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x72'));db['CmHopperHistory']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x0a9e('0x73')]=db['sequelize'][_0x0a9e('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db['sequelize'][_0x0a9e('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x0a9e('0x74')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x75'));db[_0x0a9e('0x76')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x77'));db['CannedAnswer']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x78'));db['Disposition']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x79'));db[_0x0a9e('0x7a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x7b'));db['Interval']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x7c'));db[_0x0a9e('0x7d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x7e'));db[_0x0a9e('0x7f')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x80'));db['VoiceQueuesLog']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x81'));db[_0x0a9e('0x82')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x83'));db[_0x0a9e('0x84')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x85'));db[_0x0a9e('0x86')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x87'));db[_0x0a9e('0x88')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x89'));db['CmContactHasItem']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8a'));db['CmHopperAdditionalPhone']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x0a9e('0x8b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8c'));db[_0x0a9e('0x8d')]=db['sequelize']['import']('../api/trigger/trigger.model');db[_0x0a9e('0x8e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8f'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['IntegrationReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x92'));db['AnalyticCustomReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x93'));db[_0x0a9e('0x94')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x95'));db[_0x0a9e('0x96')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x97'));db[_0x0a9e('0x98')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/analyticMetric/analyticMetric.model');db[_0x0a9e('0x99')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9a'));db['AnalyticTreeReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9b'));db[_0x0a9e('0x9c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9d'));db[_0x0a9e('0x9e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9f'));db[_0x0a9e('0xa0')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSalesforceField/intSalesforceField.model');db[_0x0a9e('0xa1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x0a9e('0xa2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa3'));db['SugarcrmField']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa4'));db['DeskAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xa5'));db[_0x0a9e('0xa6')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa7'));db[_0x0a9e('0xa8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa9'));db[_0x0a9e('0xaa')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xab'));db[_0x0a9e('0xac')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xad'));db[_0x0a9e('0xae')]=db['sequelize'][_0x0a9e('0x12')]('../api/intZohoField/intZohoField.model');db[_0x0a9e('0xaf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb0'));db['ZendeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb1'));db[_0x0a9e('0xb2')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb3'));db['FreshdeskAccount']=db['sequelize'][_0x0a9e('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb4'));db[_0x0a9e('0xb5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb6'));db['VtigerAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xb7'));db[_0x0a9e('0xb8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x0a9e('0xb9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerField/intVtigerField.model');db[_0x0a9e('0xba')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbb'));db[_0x0a9e('0xbc')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbd'));db['ServicenowField']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0x0a9e('0xbe')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x0a9e('0xbf')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xc0'));db[_0x0a9e('0xc1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc2'));db[_0x0a9e('0xc3')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xc4'));db[_0x0a9e('0xc5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc6'));db[_0x0a9e('0xc7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc8'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['Network']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc9'));db[_0x0a9e('0xca')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcb'));db[_0x0a9e('0xcc')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x0a9e('0xcd')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xce'));db['JscriptyQuestionReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcf'));db[_0x0a9e('0xd0')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xd1'));db[_0x0a9e('0xd2')]=db['sequelize']['import'](_0x0a9e('0xd3'));db[_0x0a9e('0xd4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd5'));db[_0x0a9e('0xd6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd7'));db['JscriptyProject']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xd8'));db[_0x0a9e('0xd9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xda'));db['SquareOdbc']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xdb'));db[_0x0a9e('0xdc')]=db[_0x0a9e('0x1')]['import']('../api/squareProject/squareProject.model');db[_0x0a9e('0xdd')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xde'));db[_0x0a9e('0xdf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe0'));db['Team']=db['sequelize'][_0x0a9e('0x12')]('../api/team/team.model');db[_0x0a9e('0xe1')]=db['sequelize'][_0x0a9e('0x12')]('../api/license/license.model');db['Campaign']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/campaign/campaign.model');db[_0x0a9e('0xe2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe3'));db[_0x0a9e('0xe4')]=db['sequelize']['import'](_0x0a9e('0xe5'));db[_0x0a9e('0xe6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe7'));db['MailTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailTransferReport/mailTransferReport.model');db[_0x0a9e('0xe8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe9'));db[_0x0a9e('0xea')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xeb'));db[_0x0a9e('0xec')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xed'));db[_0x0a9e('0xee')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xef'));db['CmList']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf0'));db[_0x0a9e('0xf1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0x0a9e('0xf2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfile/userProfile.model');db[_0x0a9e('0xf3')]=db['sequelize'][_0x0a9e('0x12')]('../api/userProfileSection/userProfileSection.model');db[_0x0a9e('0xf4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfileResource/userProfileResource.model');db[_0x0a9e('0xf5')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf6'));db[_0x0a9e('0xf7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xf8'));db[_0x0a9e('0xf9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfa'));db[_0x0a9e('0xfb')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfc'));db[_0x0a9e('0xfd')]=db[_0x0a9e('0x1')]['import']('../api/whatsappMessage/whatsappMessage.model');db[_0x0a9e('0xfe')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xff'));db['WhatsappTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x100'));db[_0x0a9e('0x101')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x102'));db[_0x0a9e('0x103')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x104'));db[_0x0a9e('0x105')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x106'));db[_0x0a9e('0x107')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x108'));db[_0x0a9e('0x109')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x10a'));db['UserSetting']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/user-setting/user-setting.model');db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db[_0x0a9e('0x10c')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db['UserSetting'],{'as':_0x0a9e('0x10d'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x112'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x113'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x117'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x118'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x11a'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xfb')],{'as':_0x0a9e('0x11e'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xf5')],{'as':_0x0a9e('0x11f'),'foreignKey':_0x0a9e('0x120')});db[_0x0a9e('0x11')]['belongsTo'](db[_0x0a9e('0xf2')],{'as':'UserProfile','foreignKey':'userProfileId'});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x68')],{'as':_0x0a9e('0x122'),'through':_0x0a9e('0x123')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x125'),'through':_0x0a9e('0x126')});db[_0x0a9e('0x11')]['belongsToMany'](db['CmList'],{'as':_0x0a9e('0x127'),'through':_0x0a9e('0x128')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x12a')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'through':_0x0a9e('0x12b')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'through':'user_has_chat_interactions'});db['User']['belongsToMany'](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x12c'),'through':_0x0a9e('0x12d')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x53')],{'as':'SmsInteractions','through':_0x0a9e('0x12e')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'as':_0x0a9e('0x118'),'through':_0x0a9e('0x12f')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0xfb')],{'as':'WhatsappInteractions','through':_0x0a9e('0x130')});db['User'][_0x0a9e('0x121')](db['VoiceQueue'],{'as':_0x0a9e('0x131'),'through':_0x0a9e('0x2d'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0xf1')],{'as':_0x0a9e('0x132'),'through':_0x0a9e('0x109'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x3c')],{'as':'MailQueues','through':_0x0a9e('0x30'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x133'),'through':_0x0a9e('0x134'),'required':![],'hooks':!![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x4c')],{'as':_0x0a9e('0x135'),'through':_0x0a9e('0x32'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'as':_0x0a9e('0x136'),'through':_0x0a9e('0x34'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x137')],{'as':'OpenchannelQueues','through':_0x0a9e('0x35'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'as':_0x0a9e('0x138'),'through':_0x0a9e('0x37'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'through':_0x0a9e('0x128')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x13a'),'through':_0x0a9e('0x13b')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x45')],{'as':'FaxAccounts','through':_0x0a9e('0x13c')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x13d'),'through':_0x0a9e('0x13e')});db[_0x0a9e('0x11')]['belongsToMany'](db['OpenchannelAccount'],{'as':_0x0a9e('0x13f'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x141'),'through':_0x0a9e('0x142')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x143'),'through':_0x0a9e('0x144')});db[_0x0a9e('0x13')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':'SpiedAgents','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x145')});db[_0x0a9e('0x146')]['hasMany'](db[_0x0a9e('0x16')],{'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x16')][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x147'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x18')][_0x0a9e('0x121')](db[_0x0a9e('0x84')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x149')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x14a'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db['CmHopper'],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'VoiceQueueId'});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x116')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db['CmHopperBlack'],{'as':_0x0a9e('0x14d'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':_0x0a9e('0x14e'),'foreignKey':_0x0a9e('0x14b')});db['VoiceQueue']['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a')][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':_0x0a9e('0x151'),'foreignKey':_0x0a9e('0x152')});db['VoiceQueue'][_0x0a9e('0x150')](db['Interval'],{'as':'Interval','foreignKey':_0x0a9e('0x153')});db['VoiceQueue'][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db['VoiceQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x127'),'through':'voice_queues_has_cm_lists'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'as':_0x0a9e('0x155'),'through':_0x0a9e('0x105')});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x157')});db['VoiceRecording']['belongsTo'](db['User'],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x1c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x10c')]['hasMany'](db['VoiceMailMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'mailboxuser','sourceKey':_0x0a9e('0x159')});db[_0x0a9e('0x1f')][_0x0a9e('0x150')](db[_0x0a9e('0x10c')],{'foreignKey':_0x0a9e('0x15a'),'targetKey':_0x0a9e('0x159')});db[_0x0a9e('0x15b')][_0x0a9e('0x110')](db[_0x0a9e('0x25')],{'as':_0x0a9e('0x15c'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')]['hasMany'](db[_0x0a9e('0x15e')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db['MailServerIn'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x39')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':'CloudProvider','foreignKey':_0x0a9e('0x162'),'onDelete':'restrict'});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':_0x0a9e('0x103'),'foreignKey':_0x0a9e('0x162'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x3b')][_0x0a9e('0x10b')](db[_0x0a9e('0x39')],{'as':_0x0a9e('0x165'),'onDelete':_0x0a9e('0x10e')});db['MailAccount']['hasOne'](db[_0x0a9e('0x163')],{'as':_0x0a9e('0x166'),'onDelete':'cascade'});db['MailAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'MailAccountId','onDelete':_0x0a9e('0x10e')});db['MailAccount'][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':'MailAccountId'});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x3e')],{'as':'Messages','foreignKey':_0x0a9e('0x161')});db['MailAccount']['hasMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x161'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x8b')],{'as':_0x0a9e('0x8b'),'foreignKey':_0x0a9e('0x16e')});db[_0x0a9e('0x3b')]['belongsTo'](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x3b')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x0a9e('0x13e')});db['MailQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x30')});db[_0x0a9e('0x3c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x11c')]['hasMany'](db[_0x0a9e('0x3e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':'MailInteractionId'});db[_0x0a9e('0x11c')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x11c')]['belongsTo'](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11c')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12b'),'foreignKey':_0x0a9e('0x177')});db[_0x0a9e('0x3e')]['hasMany'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0x178'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':'User'});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x179'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x60')],{'as':'ChatWebsite','foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':'ChatOfflineMessageId'});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')]['belongsTo'](db[_0x0a9e('0x3b')],{'onDelete':_0x0a9e('0x164')});db['MailApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport']['belongsTo'](db['MailAccount'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':_0x0a9e('0x16d')});db['MailQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailInteraction'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailMessage'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{});db[_0x0a9e('0x17d')]['hasMany'](db[_0x0a9e('0x43')],{'as':'Items','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')]['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':'Answers','foreignKey':_0x0a9e('0x17f')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x147'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x180'),'onDelete':'cascade'});db[_0x0a9e('0x45')]['hasMany'](db['FaxMessage'],{'as':_0x0a9e('0x158')});db['FaxAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':'Trunk'});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0a9e('0x45')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_fax_accounts'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'restrict'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x4c')],{'onDelete':'restrict'});db[_0x0a9e('0x47')]['belongsTo'](db[_0x0a9e('0x45')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['FaxInteraction'][_0x0a9e('0x110')](db[_0x0a9e('0x4a')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':'fax_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x185'),'as':'ThroughTags'});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12d'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x11')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x179'),'foreignKey':'FaxInteractionId'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':'Contact'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':'Account','foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db['User'],{'as':'Agents','through':_0x0a9e('0x32')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x187'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['FaxAccount'],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxInteraction'],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x4a')],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxQueue'],{});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x188'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db['SmsMessage'],{'as':_0x0a9e('0x158'),'foreignKey':_0x0a9e('0x188')});db['SmsAccount']['hasMany'](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x147'),'foreignKey':'SmsAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x50')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x142')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db['SmsApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{'onDelete':_0x0a9e('0x164')});db['SmsApplication']['belongsTo'](db[_0x0a9e('0x50')],{'onDelete':'restrict'});db[_0x0a9e('0x52')]['belongsTo'](db['Interval'],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x53')][_0x0a9e('0x110')](db[_0x0a9e('0x55')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x189')});db['SmsInteraction']['belongsTo'](db[_0x0a9e('0x50')],{'as':'Account','foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'sms_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x18a'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x53')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Users','through':_0x0a9e('0x12e'),'foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x55')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x57')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x34'),'foreignKey':_0x0a9e('0x18b')});db[_0x0a9e('0x57')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x59')]['hasMany'](db['Disposition'],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x59')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x16a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','foreignKey':_0x0a9e('0x18d')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5b')],{'as':'Applications','foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x59')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x59')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x5b')]['belongsTo'](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0x0a9e('0x18e')});db['OpenchannelApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db['OpenchannelApplication']['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x5d')][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x18f')});db[_0x0a9e('0x5d')]['belongsTo'](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db['OpenchannelInteraction'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x5d')][_0x0a9e('0x150')](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x175')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':'user_has_openchannel_interactions','foreignKey':_0x0a9e('0x18f')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0x5d')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x179'),'foreignKey':'OpenchannelInteractionId'});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x35'),'foreignKey':_0x0a9e('0x18e')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x155')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x17a')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x191')],{'as':_0x0a9e('0x192')});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x63')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x65')],{'as':_0x0a9e('0x158')});db['ChatWebsite'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x60')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db['ChatWebsite'][_0x0a9e('0x150')](db['MailAccount'],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db['ChatWebsite'][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db['ChatWebsite'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x13b')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelAccount'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x5d')],{});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db['OpenchannelMessage'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{});db['ChatApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x193'),'foreignKey':'UserId','onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x194'),'foreignKey':_0x0a9e('0x195'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':_0x0a9e('0x17a'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x64')][_0x0a9e('0x110')](db['ChatMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x64')]['belongsTo'](db['User'],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x199'),'foreignKey':_0x0a9e('0x197')});db['ChatMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x66')][_0x0a9e('0x110')](db['Attachment'],{'as':_0x0a9e('0x178'),'foreignKey':_0x0a9e('0x19a'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0x66')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x0a9e('0x67')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserChatQueue','hooks':!![]});db[_0x0a9e('0x67')]['belongsToMany'](db['Team'],{'through':_0x0a9e('0x19b'),'as':'Teams'});db[_0x0a9e('0x68')][_0x0a9e('0x110')](db[_0x0a9e('0xcc')],{'as':'Messages','foreignKey':_0x0a9e('0x19c'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x68')]['belongsToMany'](db['User'],{'as':_0x0a9e('0x14a'),'through':_0x0a9e('0x123')});db[_0x0a9e('0x191')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x0a9e('0x110')](db[_0x0a9e('0x124')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact']['hasMany'](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0x0a9e('0x19d')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':'HopperFinals','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':'JscriptySessions','foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db['MailInteraction'],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x172'),'onDelete':'restrict'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x19f')],{'as':_0x0a9e('0x1a0'),'foreignKey':'CompanyId'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':'cascade'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':'cm_user_has_contacts'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x1a1')});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1a1'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x6d')][_0x0a9e('0x110')](db[_0x0a9e('0x1a2')],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1a4')});db['CmHopper'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db['CmHopper'][_0x0a9e('0x150')](db['User'],{'as':'Agent','foreignKey':'UserId'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':_0x0a9e('0x194'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':'CampaignId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x1a6')});db['CmHopperBlack'][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172'),'onDelete':'cascade'});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':'Queue','foreignKey':_0x0a9e('0x14b'),'onDelete':_0x0a9e('0x10e')});db['CmHopperBlack'][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':_0x0a9e('0x1a7'),'onDelete':'cascade'});db[_0x0a9e('0x76')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1a8'),'singular':_0x0a9e('0x1a9')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x76')]['hasMany'](db[_0x0a9e('0x7a')],{'as':{'plural':'Any','singular':_0x0a9e('0x1aa')},'foreignKey':'AutomationAnyId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['Automation'][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x167')]['hasMany'](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1ac'),'onDelete':'cascade'});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db['Interval'],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x10e'),'hooks':!![],'required':![]});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x164')});db['Interval'][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')]['hasMany'](db['ChatApplication'],{'as':_0x0a9e('0x1af'),'foreignKey':'IntervalId'});db[_0x0a9e('0x17b')]['hasMany'](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x1b1'),'foreignKey':'IntervalId'});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x94')],{'foreignKey':_0x0a9e('0x1b2')});db['Schedule']['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x0a9e('0x1b3')});db[_0x0a9e('0x84')][_0x0a9e('0x121')](db[_0x0a9e('0x18')],{'as':'Mohs','through':_0x0a9e('0x149'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0x124')],{'through':'cm_contact_has_tags'});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'through':'chat_interaction_has_tags'});db['Tag'][_0x0a9e('0x121')](db['MailInteraction'],{'through':_0x0a9e('0x173')});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x53')],{'through':_0x0a9e('0x18a')});db['Tag']['belongsToMany'](db[_0x0a9e('0x11b')],{'through':_0x0a9e('0x185')});db[_0x0a9e('0x86')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'through':_0x0a9e('0x1b4')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0xfb')],{'through':_0x0a9e('0x1b5')});db[_0x0a9e('0x1b6')]['belongsTo'](db[_0x0a9e('0x88')],{'as':_0x0a9e('0x1b7'),'foreignKey':_0x0a9e('0x1b8')});db[_0x0a9e('0x1a2')][_0x0a9e('0x150')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x1b9'),'foreignKey':_0x0a9e('0x1a4')});db[_0x0a9e('0x1b6')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x19d')});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1ba'),'singular':_0x0a9e('0x1bb')},'foreignKey':_0x0a9e('0x1bc'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db['Condition'],{'as':{'plural':_0x0a9e('0x1bd'),'singular':_0x0a9e('0x1be')},'foreignKey':_0x0a9e('0x1bf'),'onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'TriggerId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x1c0')]['hasMany'](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x0a9e('0x98')][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c2')});db['AnalyticFieldReport']['belongsTo'](db[_0x0a9e('0x98')],{'foreignKey':_0x0a9e('0x1c2')});db[_0x0a9e('0x9c')]['hasMany'](db[_0x0a9e('0x9e')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0x9e')]['hasMany'](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x9e')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db['SalesforceConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x9c')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa0')][_0x0a9e('0x110')](db['SalesforceField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa0')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['SalesforceField'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa0')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xa1')][_0x0a9e('0x110')](db[_0x0a9e('0xa2')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa2')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa2')][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['SugarcrmConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0xa1')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db['SugarcrmField'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1cc')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmField'][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1cf')]['hasMany'](db[_0x0a9e('0xa6')],{'as':'Configurations','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa6')]['hasMany'](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'DescriptionId'});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':'FieldId'});db[_0x0a9e('0xa6')][_0x0a9e('0x150')](db[_0x0a9e('0x1cf')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'int_desk_configuration_has_tags'});db['DeskField'][_0x0a9e('0x110')](db['DeskField'],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xa8')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['DeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':'Field','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa8')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xaa')][_0x0a9e('0x110')](db[_0x0a9e('0xac')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Subjects','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db['ZohoConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xac')][_0x0a9e('0x150')](db[_0x0a9e('0xaa')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xae')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xaf')][_0x0a9e('0x110')](db['ZendeskConfiguration'],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d0')]['hasMany'](db[_0x0a9e('0xb2')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x0a9e('0x1d0')][_0x0a9e('0x150')](db[_0x0a9e('0xaf')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0x1d0')]['belongsToMany'](db['Tag'],{'through':_0x0a9e('0x1d1')});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['ZendeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb2')][_0x0a9e('0x150')](db['Variable'],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d2')][_0x0a9e('0x110')](db[_0x0a9e('0x1d3')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d3')]['hasMany'](db['FreshdeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['FreshdeskConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x1d2')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['FreshdeskConfiguration'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1d4')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['FreshdeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb5')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d5')]['hasMany'](db[_0x0a9e('0xb8')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xb8')]['hasMany'](db[_0x0a9e('0xb9')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db['VtigerConfiguration'][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb8')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Fields','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb8')][_0x0a9e('0x150')](db[_0x0a9e('0x1d5')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db['VtigerField']['hasMany'](db[_0x0a9e('0xb9')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb9')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xba')]['hasMany'](db[_0x0a9e('0xbc')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbc')]['hasMany'](db['ServicenowField'],{'as':_0x0a9e('0x1c4'),'foreignKey':'SubjectId'});db[_0x0a9e('0xbc')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xbc')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c1'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbc')][_0x0a9e('0x150')](db[_0x0a9e('0xba')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['ServicenowField'][_0x0a9e('0x110')](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d6')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d6')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cb'),'foreignKey':'FieldId'});db[_0x0a9e('0x1d6')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xbe')]['hasMany'](db[_0x0a9e('0xbf')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbe')][_0x0a9e('0x150')](db['CloudProvider'],{'as':_0x0a9e('0x103'),'foreignKey':'CloudProviderId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['Dynamics365Configuration'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbf')][_0x0a9e('0x150')](db[_0x0a9e('0xbe')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['Dynamics365Field'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xc1')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['FreshsalesAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xc5')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cd'),'foreignKey':'DescriptionId'});db[_0x0a9e('0xc5')]['hasMany'](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1c1'),'foreignKey':'FieldId'});db[_0x0a9e('0xc5')]['belongsTo'](db[_0x0a9e('0xc3')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['FreshsalesField'][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['FreshsalesField']['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x60')],{});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':'ListId'});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{});db['ChatInternalMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1d7')});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0x1d8')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0xcd')],{'foreignKey':'SessionId','onDelete':_0x0a9e('0x10e')});db['SmsQueueReport']['belongsTo'](db[_0x0a9e('0x50')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0xd2')]['belongsTo'](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xd2')]['belongsTo'](db['SmsMessage'],{});db['SmsQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0x1d8')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_teams'});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0x1a')],{'through':'TeamVoiceQueue','as':_0x0a9e('0x131')});db['Team']['belongsToMany'](db[_0x0a9e('0x3c')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x1db')});db[_0x0a9e('0x129')]['belongsToMany'](db['ChatQueue'],{'through':_0x0a9e('0x19b'),'as':'ChatQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db['FaxQueue'],{'through':_0x0a9e('0x187'),'as':'FaxQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x136')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x137')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x1dc')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'through':_0x0a9e('0x1dd'),'as':_0x0a9e('0x138')});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0xf1')],{'through':_0x0a9e('0x107'),'as':_0x0a9e('0x132')});db['Campaign'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db['CmHopperHistory'],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')]['hasMany'](db[_0x0a9e('0x6f')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x0a9e('0x1a5')]['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['Trunk'],{'as':_0x0a9e('0x151'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['SquareProject'],{'as':_0x0a9e('0xdc'),'foreignKey':_0x0a9e('0x1de')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':'Lists','through':_0x0a9e('0x1df')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x1e0')});db[_0x0a9e('0xe4')][_0x0a9e('0x150')](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':_0x0a9e('0x19a')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db['MailMessage'],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e2'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0x1e1')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e7'),'as':_0x0a9e('0x1e8')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['ChatInteraction'],{});db[_0x0a9e('0xe8')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1e9'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xe8')]['belongsTo'](db[_0x0a9e('0x67')],{'foreignKey':_0x0a9e('0x1eb'),'as':'ToQueue'});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1ec'),'as':_0x0a9e('0x1e8')});db['FaxTransferReport'][_0x0a9e('0x150')](db['FaxMessage'],{});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{});db['FaxTransferReport']['belongsTo'](db[_0x0a9e('0x45')],{'foreignKey':_0x0a9e('0x1ed'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xea')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x0a9e('0x1ee'),'as':_0x0a9e('0x1ef')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'foreignKey':'ToFaxAccountId','as':_0x0a9e('0x1e8')});db[_0x0a9e('0xec')]['belongsTo'](db[_0x0a9e('0x5e')],{});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x0a9e('0x1e3')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db[_0x0a9e('0x55')],{});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':_0x0a9e('0x1f0'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xee')]['belongsTo'](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x0a9e('0x1ef')});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList']['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x1f1')],{'as':_0x0a9e('0x1f2'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db['CmContact'],{'as':_0x0a9e('0x125'),'onDelete':'cascade','foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':'HopperHistory','foreignKey':'ListId'});db['CmList'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':'ListId'});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x1a')],{'as':'Queues','through':_0x0a9e('0x1f3')});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x128')});db[_0x0a9e('0xf1')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf1')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserVoicePrefix'});db[_0x0a9e('0xf1')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':'TeamVoicePrefix','as':_0x0a9e('0x155')});db[_0x0a9e('0xf2')][_0x0a9e('0x110')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'foreignKey':_0x0a9e('0x1f4')});db['UserProfile'][_0x0a9e('0x110')](db['UserProfileSection'],{'as':_0x0a9e('0x1f5'),'foreignKey':_0x0a9e('0x1f4'),'onDelete':_0x0a9e('0x10e')});db['UserProfileSection']['hasMany'](db['UserProfileResource'],{'as':_0x0a9e('0x1f6'),'foreignKey':_0x0a9e('0x1f7'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x1f8')});db['WhatsappAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xfd')],{'as':_0x0a9e('0x158'),'foreignKey':'WhatsappAccountId'});db[_0x0a9e('0xf7')]['hasMany'](db[_0x0a9e('0xfb')],{'as':'Interactions'});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['WhatsappApplication'],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db['WhatsappAccount'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xf7')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0xf7')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x144')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x101')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db['WhatsappAccount'],{'onDelete':_0x0a9e('0x164')});db['WhatsappApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0xf9')]['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['WhatsappInteraction'][_0x0a9e('0x110')](db['WhatsappMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0xfb')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x174')});db['WhatsappInteraction'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x175')});db[_0x0a9e('0xfb')]['belongsToMany'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x130'),'foreignKey':'WhatsappInteractionId'});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':_0x0a9e('0x160')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfd')]['belongsTo'](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{});db['WhatsappQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['WhatsappInteraction'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x0a9e('0x101')],{});db[_0x0a9e('0xfe')]['belongsTo'](db['WhatsappMessage'],{});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['User'],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfd')],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfb')],{});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x0a9e('0x1fb'),'as':_0x0a9e('0x1e3')});db['WhatsappTransferReport']['belongsTo'](db[_0x0a9e('0xf7')],{'foreignKey':_0x0a9e('0x1fc'),'as':'ToAccount'});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0x0a9e('0x1fd'),'as':_0x0a9e('0x1ef')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':'FromAgent'});db[_0x0a9e('0x1fa')][_0x0a9e('0x150')](db['User'],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x37'),'foreignKey':'WhatsappQueueId'});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x1dd'),'as':'Teams'});db[_0x0a9e('0x1fe')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x1ff'),'foreignKey':_0x0a9e('0x10f'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x103')][_0x0a9e('0x10b')](db['Dynamics365Account'],{'as':_0x0a9e('0xbe'),'onDelete':_0x0a9e('0x164')});db['CloudProvider'][_0x0a9e('0x10b')](db['MailServerIn'],{'as':'Imap','onDelete':_0x0a9e('0x164')});db['CloudProvider']['hasOne'](db['MailServerOut'],{'as':'Smtp','onDelete':_0x0a9e('0x164')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 17c479e..07ddd54 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8e0d=['/api/integrations/desk/fields','./api/intDeskField','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','./api/intDynamics365Configuration','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/license','/api/campaigns','/api/migrations','/api/attachments','./api/attachment','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/messages','./api/whatsappMessage','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','/api/system','./api/system','/api/webbar','./api/webbar','/api/logs','static','join','root','/www','/demo','/snippet','snippet','3.5.0','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','appPath','/index.html','path','./config/environment','./utils/client-side-logger','./api/client-side-logs','default','then','./api/user','use','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','/api/voice/recordings','./api/voiceRecording','./api/screenRecording','/api/voice/mails','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','./api/voiceTransferReport','./api/mailServerOut','/api/mail/queues','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','/api/fax/applications','./api/faxApplication','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','./api/cmHopperBlack','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','./api/cmContactHasItem','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','./api/analyticFieldReport','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration'];(function(_0x196119,_0x4108de){var _0xa3ddce=function(_0x2c618a){while(--_0x2c618a){_0x196119['push'](_0x196119['shift']());}};_0xa3ddce(++_0x4108de);}(_0x8e0d,0x82));var _0xd8e0=function(_0xa79977,_0x4f7f12){_0xa79977=_0xa79977-0x0;var _0x109f10=_0x8e0d[_0xa79977];return _0x109f10;};'use strict';var path=require(_0xd8e0('0x0'));var express=require('express');var errors=require('./errors');var config=require(_0xd8e0('0x1'));var setupLoggers=require(_0xd8e0('0x2'))['setupLoggers'];var clientSideLogs=require(_0xd8e0('0x3'));exports[_0xd8e0('0x4')]=function(_0x14598d){return setupLoggers(_0x14598d)[_0xd8e0('0x5')](function(){_0x14598d['use']('/api/users',require(_0xd8e0('0x6')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x8'),require(_0xd8e0('0x9')));_0x14598d['use'](_0xd8e0('0xa'),require(_0xd8e0('0xb')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0xc'),require(_0xd8e0('0xd')));_0x14598d['use'](_0xd8e0('0xe'),require('./api/voiceMusicOnHold'));_0x14598d[_0xd8e0('0x7')]('/api/voice/queues',require('./api/voiceQueue'));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0xf'),require(_0xd8e0('0x10')));_0x14598d['use']('/api/screen/recordings',require(_0xd8e0('0x11')));_0x14598d['use'](_0xd8e0('0x12'),require('./api/voiceMail'));_0x14598d['use']('/api/voice/mails/messages',require(_0xd8e0('0x13')));_0x14598d['use'](_0xd8e0('0x14'),require(_0xd8e0('0x15')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x16'),require(_0xd8e0('0x17')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x18'),require(_0xd8e0('0x19')));_0x14598d[_0xd8e0('0x7')]('/api/voice/queues/reports',require(_0xd8e0('0x1a')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x1b'),require(_0xd8e0('0x1c')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x1d'),require(_0xd8e0('0x1e')));_0x14598d[_0xd8e0('0x7')]('/api/voice/transfers/reports',require(_0xd8e0('0x1f')));_0x14598d[_0xd8e0('0x7')]('/api/mail/out_servers',require(_0xd8e0('0x20')));_0x14598d['use']('/api/mail/accounts',require('./api/mailAccount'));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x21'),require('./api/mailQueue'));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x22'),require(_0xd8e0('0x23')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x24'),require(_0xd8e0('0x25')));_0x14598d['use'](_0xd8e0('0x26'),require(_0xd8e0('0x27')));_0x14598d['use']('/api/mail/applications',require('./api/mailApplication'));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x28'),require(_0xd8e0('0x29')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x2a'),require('./api/dashboard'));_0x14598d['use'](_0xd8e0('0x2b'),require(_0xd8e0('0x2c')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x2d'),require('./api/faxAccount'));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x2e'),require(_0xd8e0('0x2f')));_0x14598d[_0xd8e0('0x7')]('/api/fax/interactions',require(_0xd8e0('0x30')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x31'),require(_0xd8e0('0x32')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x33'),require(_0xd8e0('0x34')));_0x14598d['use'](_0xd8e0('0x35'),require(_0xd8e0('0x36')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x37'),require(_0xd8e0('0x38')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x39'),require(_0xd8e0('0x3a')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x3b'),require(_0xd8e0('0x3c')));_0x14598d['use'](_0xd8e0('0x3d'),require(_0xd8e0('0x3e')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x3f'),require(_0xd8e0('0x40')));_0x14598d[_0xd8e0('0x7')]('/api/openchannel/accounts',require(_0xd8e0('0x41')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x42'),require(_0xd8e0('0x43')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x44'),require('./api/openchannelInteraction'));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x45'),require(_0xd8e0('0x46')));_0x14598d['use'](_0xd8e0('0x47'),require('./api/openchannelQueue'));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x48'),require(_0xd8e0('0x49')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x4a'),require(_0xd8e0('0x4b')));_0x14598d['use'](_0xd8e0('0x4c'),require(_0xd8e0('0x4d')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x4e'),require(_0xd8e0('0x4f')));_0x14598d['use'](_0xd8e0('0x50'),require(_0xd8e0('0x51')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x52'),require(_0xd8e0('0x53')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x54'),require(_0xd8e0('0x55')));_0x14598d[_0xd8e0('0x7')]('/api/chat/groups',require(_0xd8e0('0x56')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x57'),require(_0xd8e0('0x58')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x59'),require(_0xd8e0('0x5a')));_0x14598d['use'](_0xd8e0('0x5b'),require(_0xd8e0('0x5c')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x5d'),require(_0xd8e0('0x5e')));_0x14598d[_0xd8e0('0x7')]('/api/cm/hopper_black',require(_0xd8e0('0x5f')));_0x14598d[_0xd8e0('0x7')]('/api/cm/hopper_final',require(_0xd8e0('0x60')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x61'),require(_0xd8e0('0x62')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x63'),require(_0xd8e0('0x64')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x65'),require(_0xd8e0('0x66')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x67'),require(_0xd8e0('0x68')));_0x14598d['use']('/api/canned_answers',require(_0xd8e0('0x69')));_0x14598d['use'](_0xd8e0('0x6a'),require(_0xd8e0('0x6b')));_0x14598d['use'](_0xd8e0('0x6c'),require(_0xd8e0('0x6d')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x6e'),require(_0xd8e0('0x6f')));_0x14598d['use'](_0xd8e0('0x70'),require(_0xd8e0('0x71')));_0x14598d[_0xd8e0('0x7')]('/api/cdr',require('./api/cdr'));_0x14598d['use'](_0xd8e0('0x72'),require(_0xd8e0('0x73')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x74'),require(_0xd8e0('0x75')));_0x14598d[_0xd8e0('0x7')]('/api/sounds',require(_0xd8e0('0x76')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x77'),require(_0xd8e0('0x78')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x79'),require(_0xd8e0('0x7a')));_0x14598d[_0xd8e0('0x7')]('/api/cm_contact_has_items',require(_0xd8e0('0x7b')));_0x14598d[_0xd8e0('0x7')]('/api/cm_hopper_additional_phones',require('./api/cmHopperAdditionalPhone'));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x7c'),require(_0xd8e0('0x7d')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x7e'),require(_0xd8e0('0x7f')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x80'),require(_0xd8e0('0x81')));_0x14598d['use'](_0xd8e0('0x82'),require(_0xd8e0('0x83')));_0x14598d[_0xd8e0('0x7')]('/api/integrations/reports',require(_0xd8e0('0x84')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x85'),require(_0xd8e0('0x86')));_0x14598d['use'](_0xd8e0('0x87'),require(_0xd8e0('0x88')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x89'),require(_0xd8e0('0x8a')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x8b'),require(_0xd8e0('0x8c')));_0x14598d[_0xd8e0('0x7')]('/api/analytics/field_reports',require(_0xd8e0('0x8d')));_0x14598d['use'](_0xd8e0('0x8e'),require('./api/analyticTreeReport'));_0x14598d['use'](_0xd8e0('0x8f'),require(_0xd8e0('0x90')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x91'),require(_0xd8e0('0x92')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x93'),require('./api/intSalesforceField'));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x94'),require(_0xd8e0('0x95')));_0x14598d[_0xd8e0('0x7')]('/api/integrations/sugarcrm/configurations',require(_0xd8e0('0x96')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x97'),require(_0xd8e0('0x98')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x99'),require(_0xd8e0('0x9a')));_0x14598d['use'](_0xd8e0('0x9b'),require(_0xd8e0('0x9c')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x9d'),require(_0xd8e0('0x9e')));_0x14598d[_0xd8e0('0x7')]('/api/integrations/zoho/accounts',require(_0xd8e0('0x9f')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0xa0'),require(_0xd8e0('0xa1')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0xa2'),require(_0xd8e0('0xa3')));_0x14598d['use'](_0xd8e0('0xa4'),require(_0xd8e0('0xa5')));_0x14598d[_0xd8e0('0x7')]('/api/integrations/zendesk/configurations',require(_0xd8e0('0xa6')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0xa7'),require('./api/intZendeskField'));_0x14598d['use']('/api/integrations/freshdesk/accounts',require('./api/intFreshdeskAccount'));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0xa8'),require(_0xd8e0('0xa9')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0xaa'),require(_0xd8e0('0xab')));_0x14598d[_0xd8e0('0x7')]('/api/integrations/vtiger/accounts',require(_0xd8e0('0xac')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0xad'),require(_0xd8e0('0xae')));_0x14598d['use'](_0xd8e0('0xaf'),require(_0xd8e0('0xb0')));_0x14598d[_0xd8e0('0x7')]('/api/integrations/servicenow/accounts',require(_0xd8e0('0xb1')));_0x14598d['use']('/api/integrations/servicenow/configurations',require(_0xd8e0('0xb2')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0xb3'),require('./api/intServicenowField'));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0xb4'),require(_0xd8e0('0xb5')));_0x14598d[_0xd8e0('0x7')]('/api/integrations/dynamics365/configurations',require(_0xd8e0('0xb6')));_0x14598d[_0xd8e0('0x7')]('/api/integrations/dynamics365/fields',require(_0xd8e0('0xb7')));_0x14598d[_0xd8e0('0x7')]('/api/integrations/freshsales/accounts',require(_0xd8e0('0xb8')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0xb9'),require('./api/intFreshsalesConfiguration'));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0xba'),require('./api/intFreshsalesField'));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0xbb'),require(_0xd8e0('0xbc')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0xbd'),require(_0xd8e0('0xbe')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0xbf'),require(_0xd8e0('0xc0')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0xc1'),require(_0xd8e0('0xc2')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0xc3'),require(_0xd8e0('0xc4')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0xc5'),require(_0xd8e0('0xc6')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0xc7'),require('./api/smsQueueReport'));_0x14598d[_0xd8e0('0x7')]('/api/square/reports',require(_0xd8e0('0xc8')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0xc9'),require(_0xd8e0('0xca')));_0x14598d['use'](_0xd8e0('0xcb'),require(_0xd8e0('0xcc')));_0x14598d[_0xd8e0('0x7')]('/api/settings',require(_0xd8e0('0xcd')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0xce'),require(_0xd8e0('0xcf')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0xd0'),require(_0xd8e0('0xd1')));_0x14598d['use'](_0xd8e0('0xd2'),require(_0xd8e0('0xd3')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0xd4'),require(_0xd8e0('0xd5')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0xd6'),require('./api/team'));_0x14598d[_0xd8e0('0x7')]('/api/license',require(_0xd8e0('0xd7')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0xd8'),require('./api/campaign'));_0x14598d['use'](_0xd8e0('0xd9'),require('./api/migration'));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0xda'),require(_0xd8e0('0xdb')));_0x14598d[_0xd8e0('0x7')]('/api/plugins',require(_0xd8e0('0xdc')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0xdd'),require(_0xd8e0('0xde')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0xdf'),require(_0xd8e0('0xe0')));_0x14598d['use'](_0xd8e0('0xe1'),require(_0xd8e0('0xe2')));_0x14598d['use'](_0xd8e0('0xe3'),require(_0xd8e0('0xe4')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0xe5'),require(_0xd8e0('0xe6')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0xe7'),require(_0xd8e0('0xe8')));_0x14598d['use']('/api/voice/prefixes',require(_0xd8e0('0xe9')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0xea'),require(_0xd8e0('0xeb')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0xec'),require(_0xd8e0('0xed')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0xee'),require(_0xd8e0('0xef')));_0x14598d[_0xd8e0('0x7')]('/api/userNotifications',require(_0xd8e0('0xf0')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0xf1'),require(_0xd8e0('0xf2')));_0x14598d['use'](_0xd8e0('0xf3'),require(_0xd8e0('0xf4')));_0x14598d['use'](_0xd8e0('0xf5'),require('./api/whatsappInteraction'));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0xf6'),require(_0xd8e0('0xf7')));_0x14598d['use']('/api/whatsapp/reports/queue',require(_0xd8e0('0xf8')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0xf9'),require(_0xd8e0('0xfa')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0xfb'),require(_0xd8e0('0xfc')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0xfd'),require(_0xd8e0('0xfe')));_0x14598d[_0xd8e0('0x7')]('/api/realtime',require(_0xd8e0('0xff')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x100'),require(_0xd8e0('0x101')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x102'),require('./api/authLocal'));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x103'),require(_0xd8e0('0x104')));_0x14598d['use'](_0xd8e0('0x105'),require(_0xd8e0('0x106')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x107'),require(_0xd8e0('0x108')));_0x14598d['use'](_0xd8e0('0x109'),require(_0xd8e0('0x10a')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x10b'),require('./api/version'));_0x14598d['use'](_0xd8e0('0x10c'),require(_0xd8e0('0x10d')));_0x14598d[_0xd8e0('0x7')]('/api/pm2',require('./api/pm2'));_0x14598d['use'](_0xd8e0('0x10e'),require(_0xd8e0('0x10f')));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x110'),clientSideLogs);_0x14598d[_0xd8e0('0x7')]('/apidoc',express[_0xd8e0('0x111')](path[_0xd8e0('0x112')](config[_0xd8e0('0x113')],'/apidoc')));_0x14598d['use'](_0xd8e0('0x114'),express[_0xd8e0('0x111')](path[_0xd8e0('0x112')](config[_0xd8e0('0x113')],_0xd8e0('0x114'))));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x115'),express[_0xd8e0('0x111')](path[_0xd8e0('0x112')](config[_0xd8e0('0x113')],_0xd8e0('0x115'))));_0x14598d[_0xd8e0('0x7')](_0xd8e0('0x116'),express['static'](path[_0xd8e0('0x112')](config[_0xd8e0('0x113')],_0xd8e0('0x117'),_0xd8e0('0x118'))));_0x14598d['use']('/plugins',express[_0xd8e0('0x111')](path[_0xd8e0('0x112')](config[_0xd8e0('0x113')],_0xd8e0('0x119'))));_0x14598d['route'](_0xd8e0('0x11a'))[_0xd8e0('0x11b')](errors[0x194]);_0x14598d['route']('/*')['get'](function(_0x33a30b,_0xb6165e){_0xb6165e[_0xd8e0('0x11c')](path['resolve'](_0x14598d['get'](_0xd8e0('0x11d'))+_0xd8e0('0x11e')));});return _0x14598d;});}; \ No newline at end of file +var _0x37f8=['/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatApplication','./api/chatInteraction','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','./api/chatProactiveAction','/api/cm/companies','/api/cm/contacts','./api/cmContact','./api/cmHopper','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','/api/automations','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/templates','./api/template','/api/triggers','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/intFreshsalesAccount','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','/api/networks','./api/network','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','./api/jscriptySessionReport','/api/sms/reports/queue','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','/api/campaigns','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','./api/faxTransferReport','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/user-setting','/api/auth/google','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','static','root','/www','join','/demo','snippet','3.5.0','/plugins','/server/files/plugins','route','get','resolve','/index.html','express','./errors','./config/environment','./utils/client-side-logger','./api/client-side-logs','./api/user','use','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','./api/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/applications','./api/smsApplication','./api/smsInteraction','/api/sms/messages','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','./api/openchannelApplication'];(function(_0x2ba0ba,_0x47771a){var _0x40c367=function(_0x9bfa92){while(--_0x9bfa92){_0x2ba0ba['push'](_0x2ba0ba['shift']());}};_0x40c367(++_0x47771a);}(_0x37f8,0xd2));var _0x837f=function(_0x25c33d,_0x146d3b){_0x25c33d=_0x25c33d-0x0;var _0xd23473=_0x37f8[_0x25c33d];return _0xd23473;};'use strict';var path=require('path');var express=require(_0x837f('0x0'));var errors=require(_0x837f('0x1'));var config=require(_0x837f('0x2'));var setupLoggers=require(_0x837f('0x3'))['setupLoggers'];var clientSideLogs=require(_0x837f('0x4'));exports['default']=function(_0x5f2d01){return setupLoggers(_0x5f2d01)['then'](function(){_0x5f2d01['use']('/api/users',require(_0x837f('0x5')));_0x5f2d01[_0x837f('0x6')](_0x837f('0x7'),require(_0x837f('0x8')));_0x5f2d01[_0x837f('0x6')](_0x837f('0x9'),require(_0x837f('0xa')));_0x5f2d01[_0x837f('0x6')](_0x837f('0xb'),require(_0x837f('0xc')));_0x5f2d01[_0x837f('0x6')](_0x837f('0xd'),require(_0x837f('0xe')));_0x5f2d01[_0x837f('0x6')](_0x837f('0xf'),require('./api/voiceQueue'));_0x5f2d01[_0x837f('0x6')](_0x837f('0x10'),require(_0x837f('0x11')));_0x5f2d01[_0x837f('0x6')](_0x837f('0x12'),require('./api/screenRecording'));_0x5f2d01['use'](_0x837f('0x13'),require(_0x837f('0x14')));_0x5f2d01[_0x837f('0x6')](_0x837f('0x15'),require(_0x837f('0x16')));_0x5f2d01['use'](_0x837f('0x17'),require(_0x837f('0x18')));_0x5f2d01[_0x837f('0x6')](_0x837f('0x19'),require(_0x837f('0x1a')));_0x5f2d01[_0x837f('0x6')]('/api/voice/agents/reports',require(_0x837f('0x1b')));_0x5f2d01[_0x837f('0x6')]('/api/voice/queues/reports',require(_0x837f('0x1c')));_0x5f2d01[_0x837f('0x6')](_0x837f('0x1d'),require(_0x837f('0x1e')));_0x5f2d01['use'](_0x837f('0x1f'),require(_0x837f('0x20')));_0x5f2d01[_0x837f('0x6')](_0x837f('0x21'),require(_0x837f('0x22')));_0x5f2d01['use'](_0x837f('0x23'),require(_0x837f('0x24')));_0x5f2d01[_0x837f('0x6')](_0x837f('0x25'),require(_0x837f('0x26')));_0x5f2d01['use'](_0x837f('0x27'),require(_0x837f('0x28')));_0x5f2d01[_0x837f('0x6')](_0x837f('0x29'),require(_0x837f('0x2a')));_0x5f2d01[_0x837f('0x6')](_0x837f('0x2b'),require(_0x837f('0x2c')));_0x5f2d01[_0x837f('0x6')](_0x837f('0x2d'),require(_0x837f('0x2e')));_0x5f2d01[_0x837f('0x6')](_0x837f('0x2f'),require(_0x837f('0x30')));_0x5f2d01[_0x837f('0x6')](_0x837f('0x31'),require(_0x837f('0x32')));_0x5f2d01[_0x837f('0x6')](_0x837f('0x33'),require(_0x837f('0x34')));_0x5f2d01[_0x837f('0x6')](_0x837f('0x35'),require(_0x837f('0x36')));_0x5f2d01['use'](_0x837f('0x37'),require(_0x837f('0x38')));_0x5f2d01[_0x837f('0x6')]('/api/fax/applications',require('./api/faxApplication'));_0x5f2d01[_0x837f('0x6')](_0x837f('0x39'),require(_0x837f('0x3a')));_0x5f2d01[_0x837f('0x6')](_0x837f('0x3b'),require(_0x837f('0x3c')));_0x5f2d01[_0x837f('0x6')]('/api/fax/queues',require(_0x837f('0x3d')));_0x5f2d01[_0x837f('0x6')](_0x837f('0x3e'),require(_0x837f('0x3f')));_0x5f2d01['use']('/api/sms/accounts',require('./api/smsAccount'));_0x5f2d01[_0x837f('0x6')](_0x837f('0x40'),require(_0x837f('0x41')));_0x5f2d01[_0x837f('0x6')]('/api/sms/interactions',require(_0x837f('0x42')));_0x5f2d01['use'](_0x837f('0x43'),require('./api/smsMessage'));_0x5f2d01['use'](_0x837f('0x44'),require(_0x837f('0x45')));_0x5f2d01[_0x837f('0x6')](_0x837f('0x46'),require(_0x837f('0x47')));_0x5f2d01['use']('/api/openchannel/applications',require(_0x837f('0x48')));_0x5f2d01['use'](_0x837f('0x49'),require(_0x837f('0x4a')));_0x5f2d01['use'](_0x837f('0x4b'),require(_0x837f('0x4c')));_0x5f2d01[_0x837f('0x6')](_0x837f('0x4d'),require(_0x837f('0x4e')));_0x5f2d01['use'](_0x837f('0x4f'),require(_0x837f('0x50')));_0x5f2d01[_0x837f('0x6')](_0x837f('0x51'),require(_0x837f('0x52')));_0x5f2d01['use']('/api/chat/applications',require(_0x837f('0x53')));_0x5f2d01['use']('/api/chat/interactions',require(_0x837f('0x54')));_0x5f2d01[_0x837f('0x6')]('/api/chat/messages',require('./api/chatMessage'));_0x5f2d01[_0x837f('0x6')](_0x837f('0x55'),require(_0x837f('0x56')));_0x5f2d01['use'](_0x837f('0x57'),require(_0x837f('0x58')));_0x5f2d01[_0x837f('0x6')](_0x837f('0x59'),require(_0x837f('0x5a')));_0x5f2d01['use']('/api/chat/proactive_actions',require(_0x837f('0x5b')));_0x5f2d01[_0x837f('0x6')](_0x837f('0x5c'),require('./api/cmCompany'));_0x5f2d01['use'](_0x837f('0x5d'),require(_0x837f('0x5e')));_0x5f2d01[_0x837f('0x6')]('/api/cm/hopper',require(_0x837f('0x5f')));_0x5f2d01[_0x837f('0x6')]('/api/cm/hopper_black',require('./api/cmHopperBlack'));_0x5f2d01['use'](_0x837f('0x60'),require(_0x837f('0x61')));_0x5f2d01[_0x837f('0x6')](_0x837f('0x62'),require(_0x837f('0x63')));_0x5f2d01[_0x837f('0x6')](_0x837f('0x64'),require(_0x837f('0x65')));_0x5f2d01[_0x837f('0x6')](_0x837f('0x66'),require('./api/action'));_0x5f2d01[_0x837f('0x6')](_0x837f('0x67'),require('./api/automation'));_0x5f2d01[_0x837f('0x6')](_0x837f('0x68'),require(_0x837f('0x69')));_0x5f2d01[_0x837f('0x6')](_0x837f('0x6a'),require(_0x837f('0x6b')));_0x5f2d01['use'](_0x837f('0x6c'),require(_0x837f('0x6d')));_0x5f2d01[_0x837f('0x6')](_0x837f('0x6e'),require(_0x837f('0x6f')));_0x5f2d01[_0x837f('0x6')](_0x837f('0x70'),require(_0x837f('0x71')));_0x5f2d01['use'](_0x837f('0x72'),require(_0x837f('0x73')));_0x5f2d01['use'](_0x837f('0x74'),require(_0x837f('0x75')));_0x5f2d01['use'](_0x837f('0x76'),require(_0x837f('0x77')));_0x5f2d01[_0x837f('0x6')](_0x837f('0x78'),require(_0x837f('0x79')));_0x5f2d01[_0x837f('0x6')]('/api/tags',require(_0x837f('0x7a')));_0x5f2d01['use'](_0x837f('0x7b'),require(_0x837f('0x7c')));_0x5f2d01[_0x837f('0x6')](_0x837f('0x7d'),require(_0x837f('0x7e')));_0x5f2d01[_0x837f('0x6')]('/api/cm_hopper_additional_phones',require('./api/cmHopperAdditionalPhone'));_0x5f2d01['use'](_0x837f('0x7f'),require(_0x837f('0x80')));_0x5f2d01['use'](_0x837f('0x81'),require('./api/trigger'));_0x5f2d01[_0x837f('0x6')](_0x837f('0x82'),require(_0x837f('0x83')));_0x5f2d01[_0x837f('0x6')](_0x837f('0x84'),require(_0x837f('0x85')));_0x5f2d01['use'](_0x837f('0x86'),require('./api/integrationReport'));_0x5f2d01[_0x837f('0x6')](_0x837f('0x87'),require(_0x837f('0x88')));_0x5f2d01['use'](_0x837f('0x89'),require(_0x837f('0x8a')));_0x5f2d01[_0x837f('0x6')](_0x837f('0x8b'),require(_0x837f('0x8c')));_0x5f2d01[_0x837f('0x6')]('/api/analytics/metrics',require(_0x837f('0x8d')));_0x5f2d01[_0x837f('0x6')](_0x837f('0x8e'),require(_0x837f('0x8f')));_0x5f2d01['use'](_0x837f('0x90'),require('./api/analyticTreeReport'));_0x5f2d01[_0x837f('0x6')]('/api/integrations/salesforce/accounts',require(_0x837f('0x91')));_0x5f2d01[_0x837f('0x6')](_0x837f('0x92'),require(_0x837f('0x93')));_0x5f2d01[_0x837f('0x6')](_0x837f('0x94'),require(_0x837f('0x95')));_0x5f2d01[_0x837f('0x6')](_0x837f('0x96'),require(_0x837f('0x97')));_0x5f2d01[_0x837f('0x6')](_0x837f('0x98'),require('./api/intSugarcrmConfiguration'));_0x5f2d01[_0x837f('0x6')](_0x837f('0x99'),require('./api/intSugarcrmField'));_0x5f2d01[_0x837f('0x6')](_0x837f('0x9a'),require(_0x837f('0x9b')));_0x5f2d01[_0x837f('0x6')](_0x837f('0x9c'),require(_0x837f('0x9d')));_0x5f2d01[_0x837f('0x6')](_0x837f('0x9e'),require(_0x837f('0x9f')));_0x5f2d01[_0x837f('0x6')](_0x837f('0xa0'),require(_0x837f('0xa1')));_0x5f2d01[_0x837f('0x6')]('/api/integrations/zoho/configurations',require(_0x837f('0xa2')));_0x5f2d01[_0x837f('0x6')](_0x837f('0xa3'),require('./api/intZohoField'));_0x5f2d01[_0x837f('0x6')](_0x837f('0xa4'),require(_0x837f('0xa5')));_0x5f2d01[_0x837f('0x6')](_0x837f('0xa6'),require(_0x837f('0xa7')));_0x5f2d01[_0x837f('0x6')]('/api/integrations/zendesk/fields',require(_0x837f('0xa8')));_0x5f2d01[_0x837f('0x6')](_0x837f('0xa9'),require('./api/intFreshdeskAccount'));_0x5f2d01[_0x837f('0x6')](_0x837f('0xaa'),require(_0x837f('0xab')));_0x5f2d01[_0x837f('0x6')]('/api/integrations/freshdesk/fields',require(_0x837f('0xac')));_0x5f2d01[_0x837f('0x6')](_0x837f('0xad'),require('./api/intVtigerAccount'));_0x5f2d01['use']('/api/integrations/vtiger/configurations',require(_0x837f('0xae')));_0x5f2d01[_0x837f('0x6')](_0x837f('0xaf'),require(_0x837f('0xb0')));_0x5f2d01[_0x837f('0x6')](_0x837f('0xb1'),require(_0x837f('0xb2')));_0x5f2d01[_0x837f('0x6')](_0x837f('0xb3'),require(_0x837f('0xb4')));_0x5f2d01[_0x837f('0x6')](_0x837f('0xb5'),require(_0x837f('0xb6')));_0x5f2d01[_0x837f('0x6')]('/api/integrations/dynamics365/accounts',require('./api/intDynamics365Account'));_0x5f2d01['use'](_0x837f('0xb7'),require(_0x837f('0xb8')));_0x5f2d01[_0x837f('0x6')](_0x837f('0xb9'),require(_0x837f('0xba')));_0x5f2d01[_0x837f('0x6')]('/api/integrations/freshsales/accounts',require(_0x837f('0xbb')));_0x5f2d01[_0x837f('0x6')]('/api/integrations/freshsales/configurations',require(_0x837f('0xbc')));_0x5f2d01[_0x837f('0x6')](_0x837f('0xbd'),require('./api/intFreshsalesField'));_0x5f2d01[_0x837f('0x6')](_0x837f('0xbe'),require(_0x837f('0xbf')));_0x5f2d01['use']('/api/chat/reports/queue',require(_0x837f('0xc0')));_0x5f2d01['use'](_0x837f('0xc1'),require(_0x837f('0xc2')));_0x5f2d01[_0x837f('0x6')](_0x837f('0xc3'),require('./api/jscriptyAnswerReport'));_0x5f2d01[_0x837f('0x6')](_0x837f('0xc4'),require(_0x837f('0xc5')));_0x5f2d01['use']('/api/jscripty/sessions/reports',require(_0x837f('0xc6')));_0x5f2d01[_0x837f('0x6')](_0x837f('0xc7'),require('./api/smsQueueReport'));_0x5f2d01['use']('/api/square/reports',require(_0x837f('0xc8')));_0x5f2d01[_0x837f('0x6')](_0x837f('0xc9'),require(_0x837f('0xca')));_0x5f2d01['use'](_0x837f('0xcb'),require(_0x837f('0xcc')));_0x5f2d01['use'](_0x837f('0xcd'),require('./api/setting'));_0x5f2d01[_0x837f('0x6')](_0x837f('0xce'),require(_0x837f('0xcf')));_0x5f2d01[_0x837f('0x6')](_0x837f('0xd0'),require('./api/squareProject'));_0x5f2d01[_0x837f('0x6')]('/api/square/recordings',require(_0x837f('0xd1')));_0x5f2d01[_0x837f('0x6')](_0x837f('0xd2'),require(_0x837f('0xd3')));_0x5f2d01['use'](_0x837f('0xd4'),require(_0x837f('0xd5')));_0x5f2d01['use'](_0x837f('0xd6'),require('./api/license'));_0x5f2d01[_0x837f('0x6')](_0x837f('0xd7'),require('./api/campaign'));_0x5f2d01[_0x837f('0x6')](_0x837f('0xd8'),require(_0x837f('0xd9')));_0x5f2d01[_0x837f('0x6')](_0x837f('0xda'),require(_0x837f('0xdb')));_0x5f2d01[_0x837f('0x6')](_0x837f('0xdc'),require('./api/plugin'));_0x5f2d01[_0x837f('0x6')](_0x837f('0xdd'),require(_0x837f('0xde')));_0x5f2d01['use'](_0x837f('0xdf'),require(_0x837f('0xe0')));_0x5f2d01[_0x837f('0x6')]('/api/fax/reports/transfer',require(_0x837f('0xe1')));_0x5f2d01[_0x837f('0x6')](_0x837f('0xe2'),require('./api/openchannelTransferReport'));_0x5f2d01[_0x837f('0x6')](_0x837f('0xe3'),require(_0x837f('0xe4')));_0x5f2d01[_0x837f('0x6')]('/api/cm/lists',require(_0x837f('0xe5')));_0x5f2d01[_0x837f('0x6')](_0x837f('0xe6'),require(_0x837f('0xe7')));_0x5f2d01[_0x837f('0x6')](_0x837f('0xe8'),require(_0x837f('0xe9')));_0x5f2d01[_0x837f('0x6')](_0x837f('0xea'),require(_0x837f('0xeb')));_0x5f2d01[_0x837f('0x6')](_0x837f('0xec'),require('./api/userProfileResource'));_0x5f2d01[_0x837f('0x6')](_0x837f('0xed'),require(_0x837f('0xee')));_0x5f2d01[_0x837f('0x6')](_0x837f('0xef'),require(_0x837f('0xf0')));_0x5f2d01[_0x837f('0x6')](_0x837f('0xf1'),require('./api/whatsappApplication'));_0x5f2d01['use'](_0x837f('0xf2'),require(_0x837f('0xf3')));_0x5f2d01[_0x837f('0x6')](_0x837f('0xf4'),require(_0x837f('0xf5')));_0x5f2d01[_0x837f('0x6')]('/api/whatsapp/reports/queue',require(_0x837f('0xf6')));_0x5f2d01[_0x837f('0x6')](_0x837f('0xf7'),require(_0x837f('0xf8')));_0x5f2d01[_0x837f('0x6')](_0x837f('0xf9'),require('./api/whatsappQueue'));_0x5f2d01[_0x837f('0x6')](_0x837f('0xfa'),require(_0x837f('0xfb')));_0x5f2d01['use'](_0x837f('0xfc'),require('./api/realtime'));_0x5f2d01[_0x837f('0x6')]('/api/user-settings',require(_0x837f('0xfd')));_0x5f2d01[_0x837f('0x6')]('/api/auth/local',require('./api/authLocal'));_0x5f2d01[_0x837f('0x6')](_0x837f('0xfe'),require('./api/authGoogle'));_0x5f2d01['use'](_0x837f('0xff'),require(_0x837f('0x100')));_0x5f2d01[_0x837f('0x6')](_0x837f('0x101'),require(_0x837f('0x102')));_0x5f2d01[_0x837f('0x6')](_0x837f('0x103'),require(_0x837f('0x104')));_0x5f2d01[_0x837f('0x6')](_0x837f('0x105'),require(_0x837f('0x106')));_0x5f2d01[_0x837f('0x6')]('/api/system',require(_0x837f('0x107')));_0x5f2d01[_0x837f('0x6')](_0x837f('0x108'),require(_0x837f('0x109')));_0x5f2d01[_0x837f('0x6')](_0x837f('0x10a'),require(_0x837f('0x10b')));_0x5f2d01['use'](_0x837f('0x10c'),clientSideLogs);_0x5f2d01[_0x837f('0x6')](_0x837f('0x10d'),express[_0x837f('0x10e')](path['join'](config[_0x837f('0x10f')],_0x837f('0x10d'))));_0x5f2d01['use'](_0x837f('0x110'),express[_0x837f('0x10e')](path[_0x837f('0x111')](config[_0x837f('0x10f')],_0x837f('0x110'))));_0x5f2d01[_0x837f('0x6')](_0x837f('0x112'),express[_0x837f('0x10e')](path['join'](config[_0x837f('0x10f')],_0x837f('0x112'))));_0x5f2d01[_0x837f('0x6')]('/snippet',express[_0x837f('0x10e')](path[_0x837f('0x111')](config[_0x837f('0x10f')],_0x837f('0x113'),_0x837f('0x114'))));_0x5f2d01['use'](_0x837f('0x115'),express[_0x837f('0x10e')](path[_0x837f('0x111')](config[_0x837f('0x10f')],_0x837f('0x116'))));_0x5f2d01[_0x837f('0x117')]('/:url(api|auth|components|app|bower_components|assets)/*')['get'](errors[0x194]);_0x5f2d01[_0x837f('0x117')]('/*')[_0x837f('0x118')](function(_0xfc0905,_0x15c869){_0x15c869['sendFile'](path[_0x837f('0x119')](_0x5f2d01[_0x837f('0x118')]('appPath')+_0x837f('0x11a')));});return _0x5f2d01;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index e605536..04c9871 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6cae=['../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','listen','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc'];(function(_0x3b134d,_0x52a257){var _0x42fd9c=function(_0x1de2c5){while(--_0x1de2c5){_0x3b134d['push'](_0x3b134d['shift']());}};_0x42fd9c(++_0x52a257);}(_0x6cae,0xf0));var _0xe6ca=function(_0x102de6,_0x40832b){_0x102de6=_0x102de6-0x0;var _0x28dae0=_0x6cae[_0x102de6];return _0x28dae0;};'use strict';var jayson=require(_0xe6ca('0x0'));var _=require(_0xe6ca('0x1'));var config=require('../config/environment');exports[_0xe6ca('0x2')]=function(){return new Promise(function(_0x321f19,_0x3bc22b){var _0x3630f1={};_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x4')));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require('../api/voiceExtension/voiceExtension.rpc'));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x5')));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x6')));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x7')));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x8')));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x9')));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0xa')));_0x3630f1=_['merge'](_0x3630f1,require(_0xe6ca('0xb')));_0x3630f1=_['merge'](_0x3630f1,require(_0xe6ca('0xc')));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0xd')));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0xe')));_0x3630f1=_['merge'](_0x3630f1,require(_0xe6ca('0xf')));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x10')));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x11')));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x12')));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require('../api/mailMessage/mailMessage.rpc'));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require('../api/mailApplication/mailApplication.rpc'));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x13')));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x14')));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x15')));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x16')));_0x3630f1=_['merge'](_0x3630f1,require(_0xe6ca('0x17')));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x18')));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x19')));_0x3630f1=_['merge'](_0x3630f1,require('../api/smsAccount/smsAccount.rpc'));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x1a')));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require('../api/smsMessage/smsMessage.rpc'));_0x3630f1=_['merge'](_0x3630f1,require('../api/smsQueue/smsQueue.rpc'));_0x3630f1=_['merge'](_0x3630f1,require(_0xe6ca('0x1b')));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x1c')));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x1d')));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x1e')));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x1f')));_0x3630f1=_['merge'](_0x3630f1,require('../api/chatInteraction/chatInteraction.rpc'));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x20')));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x21')));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x22')));_0x3630f1=_['merge'](_0x3630f1,require(_0xe6ca('0x23')));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x24')));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x25')));_0x3630f1=_['merge'](_0x3630f1,require(_0xe6ca('0x26')));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x27')));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require('../api/pause/pause.rpc'));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x28')));_0x3630f1=_['merge'](_0x3630f1,require('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x29')));_0x3630f1=_['merge'](_0x3630f1,require(_0xe6ca('0x2a')));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x2b')));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x2c')));_0x3630f1=_['merge'](_0x3630f1,require(_0xe6ca('0x2d')));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x2e')));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x2f')));_0x3630f1=_['merge'](_0x3630f1,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x30')));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x31')));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x32')));_0x3630f1=_['merge'](_0x3630f1,require(_0xe6ca('0x33')));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x34')));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x35')));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x36')));_0x3630f1=_['merge'](_0x3630f1,require(_0xe6ca('0x37')));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x38')));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x39')));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require('../api/squareProject/squareProject.rpc'));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x3a')));_0x3630f1=_['merge'](_0x3630f1,require(_0xe6ca('0x3b')));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x3c')));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x3d')));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require('../api/plugin/plugin.rpc'));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x3e')));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x3f')));_0x3630f1=_['merge'](_0x3630f1,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x3630f1=_[_0xe6ca('0x3')](_0x3630f1,require(_0xe6ca('0x40')));var _0x9a0b50=jayson[_0xe6ca('0x41')](_0x3630f1)[_0xe6ca('0x42')]();var _0x405b4e=config[_0xe6ca('0x43')]['port']||config['port']+0x1;var _0x45cbec=config[_0xe6ca('0x43')]['ip']||_0xe6ca('0x44');_0x9a0b50['on'](_0xe6ca('0x45'),function(_0x2d1416){return _0x3bc22b(_0x2d1416);});_0x9a0b50[_0xe6ca('0x2')](_0x405b4e,_0x45cbec,function(){console[_0xe6ca('0x46')](_0xe6ca('0x47'),_0x45cbec,_0x405b4e);require(_0xe6ca('0x48'))[_0xe6ca('0x49')]();return _0x321f19(_0xe6ca('0x4a')+_0x45cbec+':'+_0x405b4e);});});}; \ No newline at end of file +var _0x2371=['../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/trigger/trigger.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','http','rpc','port','localhost','error','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/trunk/trunk.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueueReport/faxQueueReport.rpc'];(function(_0x280535,_0x601fd3){var _0x753e4=function(_0x8622af){while(--_0x8622af){_0x280535['push'](_0x280535['shift']());}};_0x753e4(++_0x601fd3);}(_0x2371,0x140));var _0x1237=function(_0x3dee92,_0x55e1eb){_0x3dee92=_0x3dee92-0x0;var _0x44d36e=_0x2371[_0x3dee92];return _0x44d36e;};'use strict';var jayson=require(_0x1237('0x0'));var _=require(_0x1237('0x1'));var config=require(_0x1237('0x2'));exports[_0x1237('0x3')]=function(){return new Promise(function(_0x3234d1,_0x24bed3){var _0x1e4346={};_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require('../api/user/user.rpc'));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require(_0x1237('0x5')));_0x1e4346=_['merge'](_0x1e4346,require(_0x1237('0x6')));_0x1e4346=_['merge'](_0x1e4346,require(_0x1237('0x7')));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require(_0x1237('0x8')));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require(_0x1237('0x9')));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require('../api/memberReport/memberReport.rpc'));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require(_0x1237('0xa')));_0x1e4346=_['merge'](_0x1e4346,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x1e4346=_['merge'](_0x1e4346,require('../api/mailServerIn/mailServerIn.rpc'));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require(_0x1237('0xb')));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require('../api/mailQueue/mailQueue.rpc'));_0x1e4346=_['merge'](_0x1e4346,require(_0x1237('0xc')));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require(_0x1237('0xd')));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require(_0x1237('0xe')));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require(_0x1237('0xf')));_0x1e4346=_['merge'](_0x1e4346,require(_0x1237('0x10')));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require(_0x1237('0x11')));_0x1e4346=_['merge'](_0x1e4346,require(_0x1237('0x12')));_0x1e4346=_['merge'](_0x1e4346,require('../api/faxMessage/faxMessage.rpc'));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require('../api/faxQueue/faxQueue.rpc'));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require(_0x1237('0x13')));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require(_0x1237('0x14')));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require(_0x1237('0x15')));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require('../api/smsMessage/smsMessage.rpc'));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require(_0x1237('0x16')));_0x1e4346=_['merge'](_0x1e4346,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x1e4346=_['merge'](_0x1e4346,require(_0x1237('0x17')));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require(_0x1237('0x18')));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require(_0x1237('0x19')));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require(_0x1237('0x1a')));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require(_0x1237('0x1b')));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require('../api/chatQueue/chatQueue.rpc'));_0x1e4346=_['merge'](_0x1e4346,require(_0x1237('0x1c')));_0x1e4346=_['merge'](_0x1e4346,require(_0x1237('0x1d')));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require(_0x1237('0x1e')));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require(_0x1237('0x1f')));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require(_0x1237('0x20')));_0x1e4346=_['merge'](_0x1e4346,require('../api/interval/interval.rpc'));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require(_0x1237('0x21')));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require(_0x1237('0x22')));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require(_0x1237('0x23')));_0x1e4346=_['merge'](_0x1e4346,require('../api/template/template.rpc'));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require(_0x1237('0x24')));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require('../api/variable/variable.rpc'));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require(_0x1237('0x25')));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require(_0x1237('0x26')));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require(_0x1237('0x27')));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require(_0x1237('0x28')));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require(_0x1237('0x29')));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require(_0x1237('0x2a')));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require(_0x1237('0x2b')));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require(_0x1237('0x2c')));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require(_0x1237('0x2d')));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require(_0x1237('0x2e')));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require(_0x1237('0x2f')));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require(_0x1237('0x30')));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require(_0x1237('0x31')));_0x1e4346=_['merge'](_0x1e4346,require('../api/setting/setting.rpc'));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require(_0x1237('0x32')));_0x1e4346=_['merge'](_0x1e4346,require(_0x1237('0x33')));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require(_0x1237('0x34')));_0x1e4346=_['merge'](_0x1e4346,require(_0x1237('0x35')));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require(_0x1237('0x36')));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require(_0x1237('0x37')));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require('../api/plugin/plugin.rpc'));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require(_0x1237('0x38')));_0x1e4346=_['merge'](_0x1e4346,require(_0x1237('0x39')));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require(_0x1237('0x3a')));_0x1e4346=_[_0x1237('0x4')](_0x1e4346,require(_0x1237('0x3b')));var _0x54d1aa=jayson['server'](_0x1e4346)[_0x1237('0x3c')]();var _0x3ae97d=config[_0x1237('0x3d')][_0x1237('0x3e')]||config[_0x1237('0x3e')]+0x1;var _0x2365d8=config[_0x1237('0x3d')]['ip']||_0x1237('0x3f');_0x54d1aa['on'](_0x1237('0x40'),function(_0x22a315){return _0x24bed3(_0x22a315);});_0x54d1aa[_0x1237('0x3')](_0x3ae97d,_0x2365d8,function(){console['log'](_0x1237('0x41'),_0x2365d8,_0x3ae97d);require('../config/triggers')[_0x1237('0x42')]();return _0x3234d1(_0x1237('0x43')+_0x2365d8+':'+_0x3ae97d);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 225c50a..1f81842 100644 --- a/server/services/agi/channel.js +++ b/server/services/agi/channel.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['startsWith','split','length','error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','pipe','command','write','destroy','inherits','prototype','sendRequest','sync','ANSWER','getData','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','format','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','setExtension','setPriority','SET\x20PRIORITY\x20%s','HANGUP','isBoolean','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','continueAt','extension','setContext','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','util','lodash','EventEmitter','./error','call','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','substring','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','substr'];(function(_0x1892ac,_0x1a0450){var _0x5ac57d=function(_0x458415){while(--_0x458415){_0x1892ac['push'](_0x1892ac['shift']());}};_0x5ac57d(++_0x1a0450);}(_0xe706,0x1ab));var _0x6e70=function(_0x5b0f89,_0x303a8b){_0x5b0f89=_0x5b0f89-0x0;var _0x21ae25=_0xe706[_0x5b0f89];return _0x21ae25;};'use strict';var util=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));var EventEmitter=require('events')[_0x6e70('0x2')];var AGIReply=require('./reply');var AGIError=require(_0x6e70('0x3'));function AGIChannel(_0x1f2cd6){var _0x35e727=this,_0x5c9fb3=new AGIReply(),_0x26a1be=![],_0xdad23b={};EventEmitter[_0x6e70('0x4')](_0x35e727);_0x1f2cd6[_0x6e70('0x5')](_0x6e70('0x6'));_0x1f2cd6[_0x6e70('0x7')](0x8*0x3c*0x3c*0x3e8);_0x5c9fb3[_0x6e70('0x5')](_0x6e70('0x6'));_0x5c9fb3['on'](_0x6e70('0x8'),function(_0x4a674f){for(var _0x4fafb2 in _0x4a674f){_0x35e727[_0x4fafb2]=_0x4a674f[_0x4fafb2];}_0x35e727[_0x6e70('0x9')](_0x6e70('0xa'));});_0x5c9fb3['on'](_0x6e70('0xb'),function(_0x68fdd3){if(_0x68fdd3[_0x6e70('0xc')]()=='hangup'){_0x35e727[_0x6e70('0x9')](_0x6e70('0xd'));return;}if(_0x68fdd3[_0x6e70('0xe')](0x0,0xb)=='520-Invalid'){_0x26a1be=!![];}if(_0x26a1be){_0xdad23b['rx']+=_0x68fdd3+'\x0a';if(_0x68fdd3[_0x6e70('0xf')](_0x6e70('0x10'))!=-0x1){_0x26a1be=![];}}else{_0xdad23b['rx']=_0x68fdd3;}if(_0x26a1be){return;}if(typeof _0xdad23b['cb']==_0x6e70('0x11')){var _0x4aff11=_0xdad23b['rx'][_0x6e70('0xe')](0x0,0x3),_0x34133e=null,_0x824c1e=null;_0x4aff11=parseInt(_0x4aff11);if(isNaN(_0x4aff11)){_0xdad23b['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x6e70('0x12')});return;}if(_0x4aff11!=0xc8){_0xdad23b['cb'](null,{'code':_0x4aff11,'result':-0x1,'extra':'KO'});return;}_0x34133e=_0xdad23b['rx']['substring'](0x4)[_0x6e70('0x13')](_0x6e70('0x14'),'');if(_0x34133e[_0x6e70('0x15')]('\x20')!=-0x1){_0x34133e=_0x34133e[_0x6e70('0x16')](0x0,_0x34133e[_0x6e70('0x15')]('\x20'));}if(_[_0x6e70('0x17')](_0x34133e,'-1')){_0x34133e=parseInt(_0x34133e);}_0x824c1e=_0xdad23b['rx'][_0x6e70('0x18')]('\x20');if(_0x824c1e[_0x6e70('0x19')]==0x3){_0x824c1e=_0x824c1e[0x2][_0x6e70('0xe')](0x1,_0x824c1e[0x2][_0x6e70('0x19')]-0x1);}else if(_0x824c1e[_0x6e70('0x19')]>0x3){var _0x3cdfd5=/\((.+)\)/;var _0x35506a=_0xdad23b['rx']['match'](_0x3cdfd5);if(_0x35506a){_0x824c1e=_0x35506a[0x1];}else{_0x824c1e=null;}}else{_0x824c1e=null;}_0xdad23b['cb'](null,{'code':_0x4aff11,'result':_0x34133e,'extra':_0x824c1e});}});_0x1f2cd6['on']('error',function(_0x5a940f){_0x35e727[_0x6e70('0x9')](_0x6e70('0x1a'),new AGIError(_0x6e70('0x1b'),_0x5a940f['code']));});_0x1f2cd6['on'](_0x6e70('0x1c'),function(){_0x35e727[_0x6e70('0x9')](_0x6e70('0x1c'),new AGIError(_0x6e70('0x1d')));});_0x1f2cd6['on']('timeout',function(){_0x35e727['emit']('timeout',new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x1f2cd6['destroy']();});_0x1f2cd6[_0x6e70('0x1e')](_0x5c9fb3);this[_0x6e70('0x1f')]=function(_0x604071,_0x46dea3){var _0x604071=_0x604071||'',_0x46dea3=typeof _0x46dea3==_0x6e70('0x11')?_0x46dea3:new Function();_0xdad23b={'tx':_0x604071,'rx':'','cb':_0x46dea3};_0x1f2cd6[_0x6e70('0x20')](_0x604071+'\x0a');},this['close']=function(){_0x1f2cd6[_0x6e70('0x21')]();};}util[_0x6e70('0x22')](AGIChannel,EventEmitter);AGIChannel[_0x6e70('0x23')][_0x6e70('0x24')]=function(_0x17e7cb){return this[_0x6e70('0x1f')][_0x6e70('0x25')](this,_0x17e7cb);};AGIChannel[_0x6e70('0x23')]['answer']=function(){return this[_0x6e70('0x24')](_0x6e70('0x26'));};AGIChannel[_0x6e70('0x23')][_0x6e70('0x27')]=function(_0x1012aa,_0x378aca,_0x3d3ee9){_0x1012aa=_0x1012aa===undefined?'beep':_0x1012aa;_0x378aca=_0x378aca===undefined?'5':_0x378aca;_0x3d3ee9=_0x3d3ee9===undefined?'1':_0x3d3ee9;return this['sendRequest'](util['format'](_0x6e70('0x28'),_0x1012aa,_0x378aca*0x3e8,_0x3d3ee9));};AGIChannel[_0x6e70('0x23')][_0x6e70('0x29')]=function(_0x3933a2){_0x3933a2=_0x3933a2||_0x6e70('0x2a');return this[_0x6e70('0x24')](util[_0x6e70('0x2b')](_0x6e70('0x2c'),_0x3933a2));};AGIChannel[_0x6e70('0x23')][_0x6e70('0x2d')]=function(_0x163dac,_0x1ab669){if(_[_0x6e70('0x2e')](_0x1ab669)){return this[_0x6e70('0x24')](util[_0x6e70('0x2b')](_0x6e70('0x2f'),_0x163dac,_0x1ab669['join'](',')));}return this[_0x6e70('0x24')](util[_0x6e70('0x2b')]('EXEC\x20%s\x20%s',_0x163dac,_0x1ab669));};AGIChannel['prototype']['setContext']=function(_0x32836a){return this[_0x6e70('0x24')](util[_0x6e70('0x2b')]('SET\x20CONTEXT\x20%s',_0x32836a));};AGIChannel['prototype'][_0x6e70('0x30')]=function(_0x20070d){return this[_0x6e70('0x24')](util[_0x6e70('0x2b')]('SET\x20EXTENSION\x20%s',_0x20070d));};AGIChannel[_0x6e70('0x23')][_0x6e70('0x31')]=function(_0x1614eb){return this['sendRequest'](util[_0x6e70('0x2b')](_0x6e70('0x32'),_0x1614eb));};AGIChannel[_0x6e70('0x23')][_0x6e70('0xd')]=function(){return this[_0x6e70('0x24')](_0x6e70('0x33'));};AGIChannel[_0x6e70('0x23')]['setVariable']=function(_0x49993e,_0x358ac5){var _0x405fca=_[_0x6e70('0x34')](_0x358ac5)||_[_0x6e70('0x35')](_0x358ac5)?_0x358ac5['toString']():_0x358ac5;return this[_0x6e70('0x24')](util[_0x6e70('0x2b')](_0x6e70('0x36'),_0x49993e,_0x405fca?_0x405fca[_0x6e70('0x37')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype']['sayNumber']=function(_0x580652,_0x3d8be4){return this['sendRequest'](util['format'](_0x6e70('0x38'),_0x580652,_0x3d8be4));};AGIChannel[_0x6e70('0x23')]['sayDigits']=function(_0x9527d3,_0x9ac887){return this[_0x6e70('0x24')](util[_0x6e70('0x2b')](_0x6e70('0x39'),_0x9527d3,_0x9ac887));};AGIChannel[_0x6e70('0x23')][_0x6e70('0x3a')]=function(_0x1d0df0,_0x524291){return this[_0x6e70('0x24')](util[_0x6e70('0x2b')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x1d0df0,_0x524291));};AGIChannel[_0x6e70('0x23')][_0x6e70('0x3b')]=function(_0x6fbef6,_0x501c64,_0x4d303e){_0x501c64=_0x501c64||this[_0x6e70('0x3c')];_0x4d303e=_0x4d303e||0x1;this[_0x6e70('0x3d')](_0x6fbef6);this[_0x6e70('0x30')](_0x501c64);this[_0x6e70('0x31')](_0x4d303e);return this[_0x6e70('0x29')](util[_0x6e70('0x2b')](_0x6e70('0x3e'),_0x6fbef6,_0x501c64,_0x4d303e));};AGIChannel[_0x6e70('0x23')][_0x6e70('0x3f')]=function(_0x19e6dd){return this[_0x6e70('0x24')](util[_0x6e70('0x2b')](_0x6e70('0x40'),_0x19e6dd));};AGIChannel['prototype'][_0x6e70('0x41')]=function(_0x3f2a0c,_0xc1c48,_0x309f7c,_0x1f731f,_0x4c51c8,_0x5b6b7f){_0xc1c48=_0xc1c48||_0x6e70('0x42');_0x309f7c=_0x309f7c||'';_0x1f731f=_0x1f731f===undefined?-0x1:_0x1f731f==='-1'?-0x1:_0x1f731f*0x3e8;_0x4c51c8=_0x4c51c8===undefined?'':'s='+_0x4c51c8;_0x5b6b7f=_0x5b6b7f?_0x6e70('0x43'):'';return this[_0x6e70('0x24')](util[_0x6e70('0x2b')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x3f2a0c,_0xc1c48,_0x309f7c,_0x1f731f,_0x5b6b7f,_0x4c51c8));};AGIChannel['prototype']['streamFile']=function(_0x3f9c17,_0x50339e){_0x50339e=_0x50339e||'';return this[_0x6e70('0x24')](util[_0x6e70('0x2b')](_0x6e70('0x44'),_0x3f9c17,_0x50339e));};AGIChannel[_0x6e70('0x23')][_0x6e70('0x45')]=function(_0x2b4ab7){return this[_0x6e70('0x2d')](_0x6e70('0x46'),_0x2b4ab7);};AGIChannel['prototype'][_0x6e70('0x47')]=function(_0x503e9d){return this[_0x6e70('0x2d')](_0x6e70('0x48'),_0x503e9d);};AGIChannel[_0x6e70('0x23')][_0x6e70('0x1a')]=function(_0x325669,_0xc501ba){this['noop'](util[_0x6e70('0x2b')](_0x6e70('0x49'),_0x325669['id'],_0x325669[_0x6e70('0x4a')],_0xc501ba));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file +var _0x1c9c=['replace','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','continueAt','setExtension','setPriority','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','AGI','exec','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','lodash','events','EventEmitter','./reply','call','utf8','headers','line','emit','hangup','substring','520-Invalid','search','function','no\x20code','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','command','write','inherits','sync','prototype','answer','ANSWER','beep','sendRequest','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setVariable','isBoolean','isNumber','toString'];(function(_0x434544,_0x39fc91){var _0x364cd4=function(_0x2fe5de){while(--_0x2fe5de){_0x434544['push'](_0x434544['shift']());}};_0x364cd4(++_0x39fc91);}(_0x1c9c,0xa7));var _0xc1c9=function(_0x242566,_0x4ec88d){_0x242566=_0x242566-0x0;var _0x1bc410=_0x1c9c[_0x242566];return _0x1bc410;};'use strict';var util=require('util');var _=require(_0xc1c9('0x0'));var EventEmitter=require(_0xc1c9('0x1'))[_0xc1c9('0x2')];var AGIReply=require(_0xc1c9('0x3'));var AGIError=require('./error');function AGIChannel(_0x1915c4){var _0x24af8f=this,_0x2a36c6=new AGIReply(),_0xf95dc4=![],_0x3106a1={};EventEmitter[_0xc1c9('0x4')](_0x24af8f);_0x1915c4['setEncoding'](_0xc1c9('0x5'));_0x1915c4['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x2a36c6['setEncoding'](_0xc1c9('0x5'));_0x2a36c6['on'](_0xc1c9('0x6'),function(_0x491c1b){for(var _0x1909df in _0x491c1b){_0x24af8f[_0x1909df]=_0x491c1b[_0x1909df];}_0x24af8f['emit']('ready');});_0x2a36c6['on'](_0xc1c9('0x7'),function(_0xd564ad){if(_0xd564ad['toLowerCase']()=='hangup'){_0x24af8f[_0xc1c9('0x8')](_0xc1c9('0x9'));return;}if(_0xd564ad[_0xc1c9('0xa')](0x0,0xb)==_0xc1c9('0xb')){_0xf95dc4=!![];}if(_0xf95dc4){_0x3106a1['rx']+=_0xd564ad+'\x0a';if(_0xd564ad[_0xc1c9('0xc')]('520\x20End\x20of\x20proper')!=-0x1){_0xf95dc4=![];}}else{_0x3106a1['rx']=_0xd564ad;}if(_0xf95dc4){return;}if(typeof _0x3106a1['cb']==_0xc1c9('0xd')){var _0x4bf3c9=_0x3106a1['rx'][_0xc1c9('0xa')](0x0,0x3),_0x14b563=null,_0xf7ddaa=null;_0x4bf3c9=parseInt(_0x4bf3c9);if(isNaN(_0x4bf3c9)){_0x3106a1['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xc1c9('0xe')});return;}if(_0x4bf3c9!=0xc8){_0x3106a1['cb'](null,{'code':_0x4bf3c9,'result':-0x1,'extra':'KO'});return;}_0x14b563=_0x3106a1['rx'][_0xc1c9('0xa')](0x4)['replace']('result=','');if(_0x14b563[_0xc1c9('0xf')]('\x20')!=-0x1){_0x14b563=_0x14b563[_0xc1c9('0x10')](0x0,_0x14b563['indexOf']('\x20'));}if(_[_0xc1c9('0x11')](_0x14b563,'-1')){_0x14b563=parseInt(_0x14b563);}_0xf7ddaa=_0x3106a1['rx'][_0xc1c9('0x12')]('\x20');if(_0xf7ddaa[_0xc1c9('0x13')]==0x3){_0xf7ddaa=_0xf7ddaa[0x2][_0xc1c9('0xa')](0x1,_0xf7ddaa[0x2][_0xc1c9('0x13')]-0x1);}else if(_0xf7ddaa[_0xc1c9('0x13')]>0x3){var _0x3bc28c=/\((.+)\)/;var _0x507ea4=_0x3106a1['rx'][_0xc1c9('0x14')](_0x3bc28c);if(_0x507ea4){_0xf7ddaa=_0x507ea4[0x1];}else{_0xf7ddaa=null;}}else{_0xf7ddaa=null;}_0x3106a1['cb'](null,{'code':_0x4bf3c9,'result':_0x14b563,'extra':_0xf7ddaa});}});_0x1915c4['on'](_0xc1c9('0x15'),function(_0x32666e){_0x24af8f['emit'](_0xc1c9('0x15'),new AGIError(_0xc1c9('0x16'),_0x32666e[_0xc1c9('0x17')]));});_0x1915c4['on'](_0xc1c9('0x18'),function(){_0x24af8f['emit'](_0xc1c9('0x18'),new AGIError(_0xc1c9('0x19')));});_0x1915c4['on'](_0xc1c9('0x1a'),function(){_0x24af8f[_0xc1c9('0x8')](_0xc1c9('0x1a'),new AGIError(_0xc1c9('0x1b')));_0x1915c4[_0xc1c9('0x1c')]();});_0x1915c4['pipe'](_0x2a36c6);this[_0xc1c9('0x1d')]=function(_0x373a86,_0x5382f4){var _0x373a86=_0x373a86||'',_0x5382f4=typeof _0x5382f4==_0xc1c9('0xd')?_0x5382f4:new Function();_0x3106a1={'tx':_0x373a86,'rx':'','cb':_0x5382f4};_0x1915c4[_0xc1c9('0x1e')](_0x373a86+'\x0a');},this[_0xc1c9('0x18')]=function(){_0x1915c4[_0xc1c9('0x1c')]();};}util[_0xc1c9('0x1f')](AGIChannel,EventEmitter);AGIChannel['prototype']['sendRequest']=function(_0x5a35f3){return this[_0xc1c9('0x1d')][_0xc1c9('0x20')](this,_0x5a35f3);};AGIChannel[_0xc1c9('0x21')][_0xc1c9('0x22')]=function(){return this['sendRequest'](_0xc1c9('0x23'));};AGIChannel[_0xc1c9('0x21')]['getData']=function(_0x3e5545,_0x577a38,_0xa383da){_0x3e5545=_0x3e5545===undefined?_0xc1c9('0x24'):_0x3e5545;_0x577a38=_0x577a38===undefined?'5':_0x577a38;_0xa383da=_0xa383da===undefined?'1':_0xa383da;return this[_0xc1c9('0x25')](util[_0xc1c9('0x26')](_0xc1c9('0x27'),_0x3e5545,_0x577a38*0x3e8,_0xa383da));};AGIChannel[_0xc1c9('0x21')][_0xc1c9('0x28')]=function(_0x39e875){_0x39e875=_0x39e875||_0xc1c9('0x29');return this[_0xc1c9('0x25')](util[_0xc1c9('0x26')](_0xc1c9('0x2a'),_0x39e875));};AGIChannel[_0xc1c9('0x21')]['exec']=function(_0x46b6b7,_0x1691a8){if(_[_0xc1c9('0x2b')](_0x1691a8)){return this['sendRequest'](util[_0xc1c9('0x26')](_0xc1c9('0x2c'),_0x46b6b7,_0x1691a8[_0xc1c9('0x2d')](',')));}return this['sendRequest'](util['format']('EXEC\x20%s\x20%s',_0x46b6b7,_0x1691a8));};AGIChannel['prototype'][_0xc1c9('0x2e')]=function(_0x3899f4){return this['sendRequest'](util['format'](_0xc1c9('0x2f'),_0x3899f4));};AGIChannel[_0xc1c9('0x21')]['setExtension']=function(_0x1704c4){return this[_0xc1c9('0x25')](util['format']('SET\x20EXTENSION\x20%s',_0x1704c4));};AGIChannel[_0xc1c9('0x21')]['setPriority']=function(_0xa75f02){return this[_0xc1c9('0x25')](util['format']('SET\x20PRIORITY\x20%s',_0xa75f02));};AGIChannel[_0xc1c9('0x21')]['hangup']=function(){return this[_0xc1c9('0x25')]('HANGUP');};AGIChannel[_0xc1c9('0x21')][_0xc1c9('0x30')]=function(_0x28e960,_0x2f3184){var _0x52f39e=_[_0xc1c9('0x31')](_0x2f3184)||_[_0xc1c9('0x32')](_0x2f3184)?_0x2f3184[_0xc1c9('0x33')]():_0x2f3184;return this[_0xc1c9('0x25')](util[_0xc1c9('0x26')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x28e960,_0x52f39e?_0x52f39e['toString']()[_0xc1c9('0x34')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xc1c9('0x21')]['sayNumber']=function(_0x3a8537,_0x1652a7){return this[_0xc1c9('0x25')](util[_0xc1c9('0x26')](_0xc1c9('0x35'),_0x3a8537,_0x1652a7));};AGIChannel[_0xc1c9('0x21')][_0xc1c9('0x36')]=function(_0x5ab2fd,_0x142cb8){return this[_0xc1c9('0x25')](util[_0xc1c9('0x26')](_0xc1c9('0x37'),_0x5ab2fd,_0x142cb8));};AGIChannel['prototype']['sayPhonetic']=function(_0x144dfd,_0x418ec2){return this[_0xc1c9('0x25')](util[_0xc1c9('0x26')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x144dfd,_0x418ec2));};AGIChannel[_0xc1c9('0x21')][_0xc1c9('0x38')]=function(_0x225261,_0x4f1bfc,_0x48022b){_0x4f1bfc=_0x4f1bfc||this['extension'];_0x48022b=_0x48022b||0x1;this['setContext'](_0x225261);this[_0xc1c9('0x39')](_0x4f1bfc);this[_0xc1c9('0x3a')](_0x48022b);return this[_0xc1c9('0x28')](util['format'](_0xc1c9('0x3b'),_0x225261,_0x4f1bfc,_0x48022b));};AGIChannel[_0xc1c9('0x21')][_0xc1c9('0x3c')]=function(_0x5db2f2){return this[_0xc1c9('0x25')](util[_0xc1c9('0x26')](_0xc1c9('0x3d'),_0x5db2f2));};AGIChannel['prototype'][_0xc1c9('0x3e')]=function(_0x205dce,_0x30d625,_0x2f7b2a,_0x34abec,_0x5c3dbe,_0x1da3ee){_0x30d625=_0x30d625||'wav';_0x2f7b2a=_0x2f7b2a||'';_0x34abec=_0x34abec===undefined?-0x1:_0x34abec==='-1'?-0x1:_0x34abec*0x3e8;_0x5c3dbe=_0x5c3dbe===undefined?'':'s='+_0x5c3dbe;_0x1da3ee=_0x1da3ee?_0xc1c9('0x3f'):'';return this[_0xc1c9('0x25')](util[_0xc1c9('0x26')](_0xc1c9('0x40'),_0x205dce,_0x30d625,_0x2f7b2a,_0x34abec,_0x1da3ee,_0x5c3dbe));};AGIChannel[_0xc1c9('0x21')][_0xc1c9('0x41')]=function(_0x3d1510,_0x32a03a){_0x32a03a=_0x32a03a||'';return this['sendRequest'](util[_0xc1c9('0x26')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x3d1510,_0x32a03a));};AGIChannel[_0xc1c9('0x21')][_0xc1c9('0x42')]=function(_0x3d9539){return this['exec'](_0xc1c9('0x43'),_0x3d9539);};AGIChannel[_0xc1c9('0x21')]['wait']=function(_0x3c1d97){return this[_0xc1c9('0x44')](_0xc1c9('0x45'),_0x3c1d97);};AGIChannel[_0xc1c9('0x21')][_0xc1c9('0x15')]=function(_0xb0ca14,_0x1f01f8){this[_0xc1c9('0x28')](util[_0xc1c9('0x26')](_0xc1c9('0x46'),_0xb0ca14['id'],_0xb0ca14[_0xc1c9('0x47')],_0x1f01f8));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xc1c9('0x48')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 7dde45f..e7566ce 100644 --- a/server/services/agi/error.js +++ b/server/services/agi/error.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe3d5=['Server\x20closed.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','message','name','exports','util','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.'];(function(_0x10b1c5,_0x5622cf){var _0x210223=function(_0x527f10){while(--_0x527f10){_0x10b1c5['push'](_0x10b1c5['shift']());}};_0x210223(++_0x5622cf);}(_0xe3d5,0x84));var _0x5e3d=function(_0x2f62aa,_0x108e95){_0x2f62aa=_0x2f62aa-0x0;var _0x1a341f=_0xe3d5[_0x2f62aa];return _0x1a341f;};'use strict';var util=require(_0x5e3d('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0x5e3d('0x1'),'E_AGI_SERVER_ERROR':_0x5e3d('0x2'),'E_AGI_SERVER_CLOSE':_0x5e3d('0x3'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0x5e3d('0x4'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x5e3d('0x5'),'E_AGI_COMMAND_EMPTY':_0x5e3d('0x6'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x5e3d('0x7'),'E_AGI_IVR_ENTRY':_0x5e3d('0x8')};function AGIError(_0x279138){var _0x279138=_0x279138||null,_0x3807d0=_0x3807d0||[],_0x1c9eb7=0x1,_0x3f142d='';if(!error[_0x279138]){_0x279138=_0x5e3d('0x9');}_0x3807d0[_0x5e3d('0xa')](error[_0x279138]);while(arguments[_0x1c9eb7]){_0x3807d0[_0x5e3d('0xa')](arguments[_0x1c9eb7]);_0x1c9eb7++;}_0x3f142d=util[_0x5e3d('0xb')]['apply'](util,_0x3807d0);this[_0x5e3d('0xc')]=_0x3f142d;this[_0x5e3d('0xd')]=_0x279138;}module[_0x5e3d('0xe')]=AGIError; \ No newline at end of file +var _0x4280=['message','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','apply'];(function(_0x4b3565,_0x35f90b){var _0x3d8153=function(_0x186441){while(--_0x186441){_0x4b3565['push'](_0x4b3565['shift']());}};_0x3d8153(++_0x35f90b);}(_0x4280,0x16c));var _0x0428=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4280[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x0428('0x0'));var error={'E_AGI_UNDEFINED':_0x0428('0x1'),'E_AGI_ARGUMENT_PORT':_0x0428('0x2'),'E_AGI_SERVER_ERROR':_0x0428('0x3'),'E_AGI_SERVER_CLOSE':_0x0428('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x0428('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0x0428('0x6'),'E_AGI_SOCKET_ERROR':_0x0428('0x7'),'E_AGI_SOCKET_CLOSE':_0x0428('0x8'),'E_AGI_SOCKET_TIMEOUT':_0x0428('0x9'),'E_AGI_COMMAND_EMPTY':_0x0428('0xa'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x0428('0xb'),'E_AGI_IVR_ENTRY':_0x0428('0xc')};function AGIError(_0x51d58c){var _0x51d58c=_0x51d58c||null,_0x410d59=_0x410d59||[],_0x551bf1=0x1,_0x272baf='';if(!error[_0x51d58c]){_0x51d58c=_0x0428('0xd');}_0x410d59['push'](error[_0x51d58c]);while(arguments[_0x551bf1]){_0x410d59[_0x0428('0xe')](arguments[_0x551bf1]);_0x551bf1++;}_0x272baf=util['format'][_0x0428('0xf')](util,_0x410d59);this[_0x0428('0x10')]=_0x272baf;this[_0x0428('0x11')]=_0x51d58c;}module[_0x0428('0x12')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index 28437d7..e29f91d 100644 --- a/server/services/agi/events.js +++ b/server/services/agi/events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xae83=['events','EventEmitter','./error','../../config/environment','redis','defaults','localhost','subscribe','emit','error','E_AGI_SERVER_ERROR','message','agi','parse','projectUpdate','lodash'];(function(_0x133ec0,_0x4ba91f){var _0x4ff979=function(_0xa28257){while(--_0xa28257){_0x133ec0['push'](_0x133ec0['shift']());}};_0x4ff979(++_0x4ba91f);}(_0xae83,0x1cf));var _0x3ae8=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xae83[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0x3ae8('0x0'));var EventEmitter=require(_0x3ae8('0x1'))[_0x3ae8('0x2')];var Redis=require('ioredis');var AGIError=require(_0x3ae8('0x3'));var config=require(_0x3ae8('0x4'));config[_0x3ae8('0x5')]=_[_0x3ae8('0x6')](config[_0x3ae8('0x5')],{'host':_0x3ae8('0x7'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x3ae8('0x5')]);sub[_0x3ae8('0x8')]('agi',function(_0x55eae8){if(_0x55eae8)return eventEmitter[_0x3ae8('0x9')](_0x3ae8('0xa'),new AGIError(_0x3ae8('0xb'),_0x55eae8));});sub['on'](_0x3ae8('0xc'),function(_0x51d2d7,_0x462162){if(_0x51d2d7!==_0x3ae8('0xd'))return;try{var _0x3103ee=JSON[_0x3ae8('0xe')](_0x462162);eventEmitter[_0x3ae8('0x9')](_0x3ae8('0xf'),_0x3103ee);}catch(_0x429247){eventEmitter[_0x3ae8('0x9')](_0x3ae8('0xa'),new AGIError('E_AGI_SERVER_ERROR',_0x429247));}});module['exports']={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0x1fc4=['events','../../config/environment','redis','defaults','localhost','subscribe','emit','error','E_AGI_SERVER_ERROR','message','agi','projectUpdate','exports','lodash'];(function(_0x4897d9,_0x588dc4){var _0x201954=function(_0x4da00b){while(--_0x4da00b){_0x4897d9['push'](_0x4897d9['shift']());}};_0x201954(++_0x588dc4);}(_0x1fc4,0x187));var _0x41fc=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x1fc4[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0x41fc('0x0'));var EventEmitter=require(_0x41fc('0x1'))['EventEmitter'];var Redis=require('ioredis');var AGIError=require('./error');var config=require(_0x41fc('0x2'));config[_0x41fc('0x3')]=_[_0x41fc('0x4')](config[_0x41fc('0x3')],{'host':_0x41fc('0x5'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x41fc('0x3')]);sub[_0x41fc('0x6')]('agi',function(_0x1e923c){if(_0x1e923c)return eventEmitter[_0x41fc('0x7')](_0x41fc('0x8'),new AGIError(_0x41fc('0x9'),_0x1e923c));});sub['on'](_0x41fc('0xa'),function(_0x268f70,_0x24348e){if(_0x268f70!==_0x41fc('0xb'))return;try{var _0x49ac03=JSON['parse'](_0x24348e);eventEmitter[_0x41fc('0x7')](_0x41fc('0xc'),_0x49ac03);}catch(_0x47b202){eventEmitter[_0x41fc('0x7')](_0x41fc('0x8'),new AGIError(_0x41fc('0x9'),_0x47b202));}});module[_0x41fc('0xd')]={'EventEmitter':eventEmitter}; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 316fcb5..5688551 100644 --- a/server/services/agi/graph/index.js +++ b/server/services/agi/graph/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0f0b=['no\x20vertex\x20found','length','condition','split','default','target','invalid','traverseBFS','vswitch','default\x20on\x20switch\x20not\x20found','includes','agicommand','max\x20retry\x20reach','exports','../../../config/logger','menu','getdigits','vertices','edges','numberOfEdges','addEdge','push','prototype','size','getVertex','info'];(function(_0x2af759,_0x52949b){var _0x2e0378=function(_0x472ad2){while(--_0x472ad2){_0x2af759['push'](_0x2af759['shift']());}};_0x2e0378(++_0x52949b);}(_0x0f0b,0x194));var _0xb0f0=function(_0x4ed836,_0x2bdd68){_0x4ed836=_0x4ed836-0x0;var _0x2bab5b=_0x0f0b[_0x4ed836];return _0x2bab5b;};'use strict';var _=require('lodash');var logger=require(_0xb0f0('0x0'))('agi');var verticesWithRetry=[_0xb0f0('0x1'),_0xb0f0('0x2'),'getsecretdigits'];var Graph=function(){this[_0xb0f0('0x3')]={};this[_0xb0f0('0x4')]={};this[_0xb0f0('0x5')]=0x0;};Graph['prototype']['addVertex']=function(_0x5352f5){this['vertices'][_0x5352f5['id']]=_0x5352f5;this[_0xb0f0('0x4')][_0x5352f5['id']]=[];};Graph['prototype'][_0xb0f0('0x6')]=function(_0x343f6e,_0x218179,_0x584d96){this[_0xb0f0('0x4')][_0x343f6e][_0xb0f0('0x7')]({'target':_0x218179,'condition':_0x584d96});this[_0xb0f0('0x5')]+=0x1;};Graph[_0xb0f0('0x8')][_0xb0f0('0x9')]=function(){return _[_0xb0f0('0x9')](this[_0xb0f0('0x3')]);};Graph[_0xb0f0('0x8')]['relations']=function(){return this[_0xb0f0('0x5')];};Graph['prototype'][_0xb0f0('0xa')]=function(_0x36b0d8){return this[_0xb0f0('0x3')][_0x36b0d8];};Graph[_0xb0f0('0x8')]['traverseBFS']=function(_0x24491d,_0x1e8842){if(!this['vertices'][_0x24491d]){return logger[_0xb0f0('0xb')](_0xb0f0('0xc'));}var _0x13229c=_0x1e8842(this[_0xb0f0('0x3')][_0x24491d]);if(!_0x13229c){return logger[_0xb0f0('0xb')]('stop\x20traverse');}if(this[_0xb0f0('0x4')][_0x24491d][_0xb0f0('0xd')]===0x0){return logger[_0xb0f0('0xb')]('no\x20edge/s\x20available');}for(var _0x26521a=0x0,_0x595d60=[],_0x34724b=![];_0x26521a\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','evtHangup','createSquareReport','then','hasOwnProperty','indexOf','agi_','substring','debug','variables','stringify','timeout','find','production','handleUnpublished','initialize','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll'];(function(_0xc8dea4,_0x3df123){var _0xf99ad=function(_0xab0203){while(--_0xab0203){_0xc8dea4['push'](_0xc8dea4['shift']());}};_0xf99ad(++_0x3df123);}(_0x5ca6,0xf6));var _0x65ca=function(_0x214a25,_0x15071d){_0x214a25=_0x214a25-0x0;var _0x405988=_0x5ca6[_0x214a25];return _0x405988;};'use strict';var _=require(_0x65ca('0x0'));var syncho=require(_0x65ca('0x1'));var util=require(_0x65ca('0x2'));var config=require(_0x65ca('0x3'));var logger=require(_0x65ca('0x4'))(_0x65ca('0x5'));var utilLicense=require(_0x65ca('0x6'));var rpc=require(_0x65ca('0x7'));var Project=require('./project');var AGIEmitter=require(_0x65ca('0x8'))[_0x65ca('0x9')];var projects=[];config[_0x65ca('0x5')]=_[_0x65ca('0xa')](config[_0x65ca('0x5')],{'ip':_0x65ca('0xb'),'port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x7d66e9){process[_0x65ca('0xc')](function(){syncho(function(){try{setChannelVariables(_0x7d66e9);agiHandler(_0x7d66e9);}catch(_0x554e5f){logger[_0x65ca('0xd')](_0x554e5f[_0x65ca('0xe')]);}});});}function projectUpdateHandler(_0x3823ea){try{var _0x37bb2d=_['findIndex'](projects,['id',_0x3823ea['id']]);if(_0x37bb2d>-0x1){if(_0x3823ea[_0x65ca('0xf')]===!![]){projects['splice'](_0x37bb2d,0x1);}else{projects[_0x37bb2d]=_0x3823ea;}}else{projects[_0x65ca('0x10')](_0x3823ea);}}catch(_0x4bd539){logger['error'](_0x4bd539[_0x65ca('0xe')]);}}function listeningHandler(){console[_0x65ca('0x11')](_0x65ca('0x12'),config[_0x65ca('0x5')][_0x65ca('0x13')]);logger[_0x65ca('0x14')](util[_0x65ca('0x15')](_0x65ca('0x16'),config[_0x65ca('0x5')]['ip'],config[_0x65ca('0x5')][_0x65ca('0x13')]));}function errorHandler(_0x3a700d){if(_0x3a700d&&_0x3a700d['name']&&_0x3a700d[_0x65ca('0x17')]){logger[_0x65ca('0xd')](util[_0x65ca('0x15')](_0x65ca('0x18'),_0x3a700d[_0x65ca('0x19')],_0x3a700d[_0x65ca('0x17')]));}else{logger['error'](util['format'](_0x65ca('0x1a'),_0x3a700d[_0x65ca('0xe')]));}}function closeHandler(){logger[_0x65ca('0x14')](util[_0x65ca('0x15')](_0x65ca('0x1b'),this[_0x65ca('0x1c')],this[_0x65ca('0x1d')],this[_0x65ca('0x1e')],this[_0x65ca('0x1f')],this[_0x65ca('0x20')]));try{createSquareReport(this);}catch(_0x238961){logger[_0x65ca('0xd')](_0x238961['stack']);}}function timeoutHandler(){logger[_0x65ca('0x14')](util[_0x65ca('0x15')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0x65ca('0x1d')],this[_0x65ca('0x1e')],this[_0x65ca('0x1f')],this[_0x65ca('0x20')]));}function hangupHandler(){logger[_0x65ca('0x14')](util[_0x65ca('0x15')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x65ca('0x1c')],this[_0x65ca('0x1d')],this[_0x65ca('0x1e')],this[_0x65ca('0x1f')],this[_0x65ca('0x20')]));this[_0x65ca('0x21')]=!![];}function createSquareReport(_0x491ab5,_0x48c89e){rpc[_0x65ca('0x22')](_0x491ab5)[_0x65ca('0x23')](function(_0x44c953){if(_0x48c89e){_0x48c89e(null,_0x44c953);}})['catch'](function(_0x216683){if(_0x48c89e){_0x48c89e(null,_0x216683);}});}function setChannelVariables(_0x3f9db2){for(var _0x1d0556 in _0x3f9db2){if(_0x3f9db2[_0x65ca('0x24')](_0x1d0556)){if(_0x1d0556[_0x65ca('0x25')](_0x65ca('0x26'))===0x0){_0x3f9db2[_0x1d0556[_0x65ca('0x27')](0x4)]=_0x3f9db2[_0x1d0556];delete _0x3f9db2[_0x1d0556];}}}}function agiHandler(_0x2f8713){logger[_0x65ca('0x28')](_0x65ca('0x29'),JSON[_0x65ca('0x2a')](_0x2f8713,null,0x2));logger[_0x65ca('0x14')](util[_0x65ca('0x15')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x2f8713['arg_1'],_0x2f8713[_0x65ca('0x1d')],_0x2f8713[_0x65ca('0x1e')],_0x2f8713[_0x65ca('0x1f')],_0x2f8713[_0x65ca('0x20')]));_0x2f8713['on'](_0x65ca('0xd'),errorHandler);_0x2f8713['on']('close',closeHandler);_0x2f8713['on'](_0x65ca('0x2b'),timeoutHandler);_0x2f8713[_0x65ca('0x21')]=![];_0x2f8713['on']('hangup',hangupHandler);var _0x97cc01=_[_0x65ca('0x2c')](projects,[_0x65ca('0x19'),_0x2f8713[_0x65ca('0x1c')]]);if(!_0x97cc01)return Project['handleNotFound'](_0x2f8713);if(!_0x97cc01[_0x65ca('0x2d')])return Project[_0x65ca('0x2e')](_0x2f8713);return Project[_0x65ca('0x2f')](_0x97cc01,_0x2f8713);}function main(){var _0x1b5fa0;return utilLicense[_0x65ca('0x30')]()['then'](function(_0x5c76ae){if(!_0x5c76ae)return;if(_0x5c76ae['voice']){if(_0x5c76ae['callysquare']&&_0x5c76ae[_0x65ca('0x31')]>0x0){logger[_0x65ca('0x14')](util[_0x65ca('0x15')](_0x65ca('0x32'),_0x5c76ae[_0x65ca('0x31')]));_0x1b5fa0=_0x5c76ae[_0x65ca('0x31')];}else{logger[_0x65ca('0x14')](_0x65ca('0x33'));}}else{logger[_0x65ca('0x14')](_0x65ca('0x34'));_0x1b5fa0=-0x1;}})[_0x65ca('0x23')](function(){return Project[_0x65ca('0x35')]();})[_0x65ca('0x23')](function(_0x50b5e9){projects=_0x50b5e9;return;})[_0x65ca('0x36')](function(_0x304881){logger['error']('[LICENSE]',_0x304881[_0x65ca('0xe')]);})[_0x65ca('0x37')](function(){var _0x3d438d=require(_0x65ca('0x38'))(config[_0x65ca('0x5')][_0x65ca('0x13')],config['agi']['ip'],_0x1b5fa0);_0x3d438d['on'](_0x65ca('0xd'),errorHandler);_0x3d438d['on'](_0x65ca('0x39'),listeningHandler);_0x3d438d['on'](_0x65ca('0x3a'),connectionHandler);_0x3d438d['on'](_0x65ca('0x3b'),closeHandler);});}main(); \ No newline at end of file +var _0x56c4=['[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','finally','connection','lodash','syncho','util','../../config/logger','agi','../../config/license/util','./rpc','./project','./events','EventEmitter','defaults','projectUpdate','nextTick','error','stack','findIndex','deleted','splice','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','name','message','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','then','catch','hasOwnProperty','indexOf','agi_','variables','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','find','handleNotFound','handleUnpublished','initialize','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x56c4,0xe8));var _0x456c=function(_0x58bf27,_0x30815a){_0x58bf27=_0x58bf27-0x0;var _0x100cc8=_0x56c4[_0x58bf27];return _0x100cc8;};'use strict';var _=require(_0x456c('0x0'));var syncho=require(_0x456c('0x1'));var util=require(_0x456c('0x2'));var config=require('../../config/environment');var logger=require(_0x456c('0x3'))(_0x456c('0x4'));var utilLicense=require(_0x456c('0x5'));var rpc=require(_0x456c('0x6'));var Project=require(_0x456c('0x7'));var AGIEmitter=require(_0x456c('0x8'))[_0x456c('0x9')];var projects=[];config[_0x456c('0x4')]=_[_0x456c('0xa')](config[_0x456c('0x4')],{'ip':'127.0.0.1','port':0x11dd});AGIEmitter['on'](_0x456c('0xb'),projectUpdateHandler);function connectionHandler(_0x25fdd7){process[_0x456c('0xc')](function(){syncho(function(){try{setChannelVariables(_0x25fdd7);agiHandler(_0x25fdd7);}catch(_0x1961f3){logger[_0x456c('0xd')](_0x1961f3[_0x456c('0xe')]);}});});}function projectUpdateHandler(_0x3c48e3){try{var _0x3c731c=_[_0x456c('0xf')](projects,['id',_0x3c48e3['id']]);if(_0x3c731c>-0x1){if(_0x3c48e3[_0x456c('0x10')]===!![]){projects[_0x456c('0x11')](_0x3c731c,0x1);}else{projects[_0x3c731c]=_0x3c48e3;}}else{projects['push'](_0x3c48e3);}}catch(_0x5e62e){logger['error'](_0x5e62e['stack']);}}function listeningHandler(){console[_0x456c('0x12')](_0x456c('0x13'),config[_0x456c('0x4')]['port']);logger[_0x456c('0x14')](util[_0x456c('0x15')](_0x456c('0x16'),config[_0x456c('0x4')]['ip'],config[_0x456c('0x4')][_0x456c('0x17')]));}function errorHandler(_0x534967){if(_0x534967&&_0x534967[_0x456c('0x18')]&&_0x534967[_0x456c('0x19')]){logger[_0x456c('0xd')](util['format']('[%s]\x20%s',_0x534967['name'],_0x534967[_0x456c('0x19')]));}else{logger[_0x456c('0xd')](util[_0x456c('0x15')]('[ERROR]\x20%s',_0x534967[_0x456c('0xe')]));}}function closeHandler(){logger['info'](util['format'](_0x456c('0x1a'),this[_0x456c('0x1b')],this[_0x456c('0x1c')],this[_0x456c('0x1d')],this[_0x456c('0x1e')],this[_0x456c('0x1f')]));try{createSquareReport(this);}catch(_0x2d8e30){logger[_0x456c('0xd')](_0x2d8e30[_0x456c('0xe')]);}}function timeoutHandler(){logger['info'](util['format'](_0x456c('0x20'),this[_0x456c('0x1b')],this[_0x456c('0x1c')],this[_0x456c('0x1d')],this[_0x456c('0x1e')],this[_0x456c('0x1f')]));}function hangupHandler(){logger['info'](util['format'](_0x456c('0x21'),this[_0x456c('0x1b')],this[_0x456c('0x1c')],this['callerid'],this[_0x456c('0x1e')],this[_0x456c('0x1f')]));this[_0x456c('0x22')]=!![];}function createSquareReport(_0x2ffeaf,_0x552636){rpc[_0x456c('0x23')](_0x2ffeaf)[_0x456c('0x24')](function(_0x2a1c38){if(_0x552636){_0x552636(null,_0x2a1c38);}})[_0x456c('0x25')](function(_0x43612e){if(_0x552636){_0x552636(null,_0x43612e);}});}function setChannelVariables(_0x356158){for(var _0x60f5ac in _0x356158){if(_0x356158[_0x456c('0x26')](_0x60f5ac)){if(_0x60f5ac[_0x456c('0x27')](_0x456c('0x28'))===0x0){_0x356158[_0x60f5ac['substring'](0x4)]=_0x356158[_0x60f5ac];delete _0x356158[_0x60f5ac];}}}}function agiHandler(_0x5cd6d4){logger['debug'](_0x456c('0x29'),JSON['stringify'](_0x5cd6d4,null,0x2));logger[_0x456c('0x14')](util[_0x456c('0x15')](_0x456c('0x2a'),_0x5cd6d4[_0x456c('0x1b')],_0x5cd6d4[_0x456c('0x1c')],_0x5cd6d4[_0x456c('0x1d')],_0x5cd6d4[_0x456c('0x1e')],_0x5cd6d4[_0x456c('0x1f')]));_0x5cd6d4['on'](_0x456c('0xd'),errorHandler);_0x5cd6d4['on'](_0x456c('0x2b'),closeHandler);_0x5cd6d4['on'](_0x456c('0x2c'),timeoutHandler);_0x5cd6d4[_0x456c('0x22')]=![];_0x5cd6d4['on'](_0x456c('0x2d'),hangupHandler);var _0x1c7d7e=_[_0x456c('0x2e')](projects,[_0x456c('0x18'),_0x5cd6d4[_0x456c('0x1b')]]);if(!_0x1c7d7e)return Project[_0x456c('0x2f')](_0x5cd6d4);if(!_0x1c7d7e['production'])return Project[_0x456c('0x30')](_0x5cd6d4);return Project[_0x456c('0x31')](_0x1c7d7e,_0x5cd6d4);}function main(){var _0x5b1244;return utilLicense[_0x456c('0x32')]()['then'](function(_0x38cd83){if(!_0x38cd83)return;if(_0x38cd83['voice']){if(_0x38cd83[_0x456c('0x33')]&&_0x38cd83[_0x456c('0x33')]>0x0){logger[_0x456c('0x14')](util[_0x456c('0x15')](_0x456c('0x34'),_0x38cd83[_0x456c('0x33')]));_0x5b1244=_0x38cd83[_0x456c('0x33')];}else{logger[_0x456c('0x14')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0x456c('0x14')](_0x456c('0x35'));_0x5b1244=-0x1;}})[_0x456c('0x24')](function(){return Project['getAll']();})[_0x456c('0x24')](function(_0x4013d4){projects=_0x4013d4;return;})[_0x456c('0x25')](function(_0x1332d7){logger[_0x456c('0xd')](_0x456c('0x36'),_0x1332d7['stack']);})[_0x456c('0x37')](function(){var _0x45c9f3=require('./server')(config[_0x456c('0x4')][_0x456c('0x17')],config['agi']['ip'],_0x5b1244);_0x45c9f3['on'](_0x456c('0xd'),errorHandler);_0x45c9f3['on']('listening',listeningHandler);_0x45c9f3['on'](_0x456c('0x38'),connectionHandler);_0x45c9f3['on']('close',closeHandler);});}main(); \ No newline at end of file diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index 486c4d7..9266e09 100644 --- a/server/services/agi/mailRpc/index.js +++ b/server/services/agi/mailRpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5239=['SendMail','bluebird','client','http','request','then','error','message','catch','sendMailMessage'];(function(_0x596ab8,_0x2b80c2){var _0x174e4f=function(_0x18e402){while(--_0x18e402){_0x596ab8['push'](_0x596ab8['shift']());}};_0x174e4f(++_0x2b80c2);}(_0x5239,0x123));var _0x9523=function(_0x3e13a2,_0x225dad){_0x3e13a2=_0x3e13a2-0x0;var _0x52ab96=_0x5239[_0x3e13a2];return _0x52ab96;};'use strict';var BPromise=require(_0x9523('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x9523('0x1')][_0x9523('0x2')]({'port':0x232b});function request(_0x17c658,_0x3a2fa7){return new BPromise(function(_0x2e882c,_0x4db514){return client[_0x9523('0x3')](_0x17c658,_0x3a2fa7)[_0x9523('0x4')](function(_0x3018ee){if(_0x3018ee[_0x9523('0x5')]){return _0x4db514(_0x3018ee[_0x9523('0x5')][_0x9523('0x6')]);}else{return _0x2e882c(_0x3018ee['result']);}})[_0x9523('0x7')](function(_0x3e8782){return _0x4db514(_0x3e8782);});});}exports[_0x9523('0x8')]=function(_0x406030,_0x30672d){return request(_0x9523('0x9'),{'account':_0x406030,'message':_0x30672d});}; \ No newline at end of file +var _0xb9e9=['then','error','message','result','catch','sendMailMessage','jayson/promise','client','http','request'];(function(_0x4a4d88,_0x2be95a){var _0x479329=function(_0x37bb8e){while(--_0x37bb8e){_0x4a4d88['push'](_0x4a4d88['shift']());}};_0x479329(++_0x2be95a);}(_0xb9e9,0x150));var _0x9b9e=function(_0x34190e,_0x50ecc7){_0x34190e=_0x34190e-0x0;var _0x41a4e6=_0xb9e9[_0x34190e];return _0x41a4e6;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x9b9e('0x0'));var client=jayson[_0x9b9e('0x1')][_0x9b9e('0x2')]({'port':0x232b});function request(_0x1b84e2,_0xec6f7a){return new BPromise(function(_0x3552d3,_0x290326){return client[_0x9b9e('0x3')](_0x1b84e2,_0xec6f7a)[_0x9b9e('0x4')](function(_0x2f6675){if(_0x2f6675[_0x9b9e('0x5')]){return _0x290326(_0x2f6675[_0x9b9e('0x5')][_0x9b9e('0x6')]);}else{return _0x3552d3(_0x2f6675[_0x9b9e('0x7')]);}})[_0x9b9e('0x8')](function(_0x1c49d9){return _0x290326(_0x1c49d9);});});}exports[_0x9b9e('0x9')]=function(_0x4d0d72,_0x93ec80){return request('SendMail',{'account':_0x4d0d72,'message':_0x93ec80});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index e71136c..92e9579 100644 --- a/server/services/agi/project.js +++ b/server/services/agi/project.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6ad2=['hasOwnProperty','maxRetry','addVertex','mxCell','length','source','target','addEdge','value','toJson','inspect','production','start','debug','root','stringify','joinAt','format','omit','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','evtHangup','isUndefined','error','finally','agicommand\x20not\x20found','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20found','exports','moment','xml2json','util','../../config/logger','agi','./rpc','./graph','./vertices','getSquareProjects','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x6ad2,0x66));var _0x26ad=function(_0x3f79c5,_0xde0759){_0x3f79c5=_0x3f79c5-0x0;var _0x4a3979=_0x6ad2[_0x3f79c5];return _0x4a3979;};'use strict';var _=require('lodash');var moment=require(_0x26ad('0x0'));var parser=require(_0x26ad('0x1'));var util=require(_0x26ad('0x2'));var logger=require(_0x26ad('0x3'))(_0x26ad('0x4'));var rpc=require(_0x26ad('0x5'));var mailRpc=require('./mailRpc');var Graph=require(_0x26ad('0x6'));var Vertices=require(_0x26ad('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x26ad('0x8')]()['catch'](function(_0x3abe46){logger['error'](_0x26ad('0x9'),_0x3abe46[_0x26ad('0xa')]);return[];});}function addVertex(_0x471692,_0x56d5be,_0xfd0985){_0x56d5be[_0x26ad('0xb')]=_0xfd0985;if(_0x56d5be[_0x26ad('0xc')]('retry')){_0x56d5be[_0x26ad('0xd')]=parseInt(_0x56d5be['retry'],0xa);}_0x471692[_0x26ad('0xe')](_['omit'](_0x56d5be,_0x26ad('0xf')));}function initGraph(_0xf2da0d,_0x2d1a7a){var _0x2b4e18=new Graph();for(var _0x407413 in _0xf2da0d){if(_0xf2da0d[_0x26ad('0xc')](_0x407413)){if(_['isArray'](_0xf2da0d[_0x407413])){for(var _0xca3c18=0x0;_0xca3c18<_0xf2da0d[_0x407413][_0x26ad('0x10')];_0xca3c18+=0x1){addVertex(_0x2b4e18,_0xf2da0d[_0x407413][_0xca3c18],_0x407413);}}else{addVertex(_0x2b4e18,_0xf2da0d[_0x407413],_0x407413);}}}for(var _0x22b126=0x0;_0x22b126<_0x2d1a7a[_0x26ad('0x10')];_0x22b126+=0x1){if(_0x2d1a7a[_0x22b126][_0x26ad('0x11')]&&_0x2d1a7a[_0x22b126][_0x26ad('0x12')]){_0x2b4e18[_0x26ad('0x13')](_0x2d1a7a[_0x22b126][_0x26ad('0x11')],_0x2d1a7a[_0x22b126][_0x26ad('0x12')],_0x2d1a7a[_0x22b126][_0x26ad('0x14')]);}}return _0x2b4e18;}function getRoot(_0x264329){return parser[_0x26ad('0x15')](_0x264329,{'object':!![]})['mxGraphModel']['root'];}function inspect(_0x215672){return util[_0x26ad('0x16')](_0x215672,{'showHidden':![],'depth':null});}function initialize(_0x230bab,_0x55d83a){var _0xd44e8f=getRoot(_0x230bab[_0x26ad('0x17')]);if(!_0xd44e8f||!_0xd44e8f[_0x26ad('0x18')])return;var _0x17748,_0x1af303,_0xf9b5e8;logger[_0x26ad('0x19')](_0x26ad('0x1a'),JSON[_0x26ad('0x1b')](_0xd44e8f,null,0x2));_0x55d83a[_0x26ad('0x1c')]=moment()[_0x26ad('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');_0x17748=initGraph(_[_0x26ad('0x1e')](_0xd44e8f,'mxCell'),_0xd44e8f[_0x26ad('0xf')]);_0x1af303=new Vertices(_0x55d83a,rpc,mailRpc);logger[_0x26ad('0x1f')](util[_0x26ad('0x1d')](_0x26ad('0x20'),_0x55d83a[_0x26ad('0x21')],_0x55d83a[_0x26ad('0x22')],_0x55d83a[_0x26ad('0x23')],_0x55d83a[_0x26ad('0x24')],_0x55d83a[_0x26ad('0x25')]));_0x17748['traverseBFS'](_0xd44e8f[_0x26ad('0x18')]['id'],function(_0x46e215){try{_0x46e215=_0x1af303['clear'](_0x46e215);logger[_0x26ad('0x19')](_0x26ad('0x26'),JSON[_0x26ad('0x1b')](_0x46e215,null,0x2));if(_0x46e215[_0x26ad('0xb')]===_0x26ad('0x27')){logger[_0x26ad('0x1f')](_0x26ad('0x28'));_0x55d83a[_0x26ad('0x29')]=_0x46e215[_0x26ad('0x29')]||_0x55d83a[_0x26ad('0x29')];_0x55d83a['extension']=_0x46e215[_0x26ad('0x2a')];_0x55d83a[_0x26ad('0x2b')]=_0x46e215[_0x26ad('0x2b')]?_0x46e215[_0x26ad('0x2b')]-0x1:0x1;return null;}else if(_0x46e215&&_0x1af303[_0x46e215[_0x26ad('0xb')]]){_0xf9b5e8=_0x1af303[_0x46e215[_0x26ad('0xb')]](_0x46e215);logger[_0x26ad('0x1f')](_0x26ad('0x2c'),JSON['stringify'](_0xf9b5e8,null,0x2));if(_0xf9b5e8&&_0xf9b5e8[_0x26ad('0x2d')]===AGI_CODE_SUCCESS&&_0xf9b5e8[_0x26ad('0x2e')]!==AGI_RESULT_ERROR&&!_0x55d83a[_0x26ad('0x2f')]){logger['debug'](_0x26ad('0x2c'),inspect(_0xf9b5e8));return _[_0x26ad('0x30')](_0xf9b5e8[_0x26ad('0x2e')])?null:_0xf9b5e8[_0x26ad('0x2e')]['toString']();}else{logger[_0x26ad('0x31')]('response',inspect(_0xf9b5e8));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x4129d2){logger[_0x26ad('0x31')](_0x4129d2[_0x26ad('0xa')]);return null;}});if(_0xd44e8f['finally']){logger['info'](util[_0x26ad('0x1d')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x55d83a[_0x26ad('0x21')],_0x55d83a[_0x26ad('0x22')],_0x55d83a[_0x26ad('0x23')],_0x55d83a[_0x26ad('0x24')],_0x55d83a[_0x26ad('0x25')]));_0x17748['traverseBFS'](_0xd44e8f[_0x26ad('0x32')]['id'],function(_0x791ad1){try{_0x791ad1=_0x1af303['clear'](_0x791ad1);logger[_0x26ad('0x19')](_0x26ad('0x26'),JSON[_0x26ad('0x1b')](_0x791ad1,null,0x2));if(_0x791ad1&&_0x1af303[_0x791ad1[_0x26ad('0xb')]]){_0xf9b5e8=_0x1af303[_0x791ad1[_0x26ad('0xb')]](_0x791ad1);if(_0xf9b5e8){logger[_0x26ad('0x19')](_0x26ad('0x2c'),inspect(_0xf9b5e8));return _[_0x26ad('0x30')](_0xf9b5e8[_0x26ad('0x2e')])?null:_0xf9b5e8[_0x26ad('0x2e')]['toString']();}else{logger[_0x26ad('0x31')](_0x26ad('0x2c'),inspect(_0xf9b5e8));return null;}}else{logger[_0x26ad('0x31')](_0x26ad('0x33'));return null;}}catch(_0x3e1e6f){logger['error'](_0x3e1e6f[_0x26ad('0xa')]);return null;}});}logger['info'](util[_0x26ad('0x1d')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x55d83a[_0x26ad('0x21')],_0x55d83a['calleridname'],_0x55d83a[_0x26ad('0x23')],_0x55d83a[_0x26ad('0x24')],_0x55d83a[_0x26ad('0x25')]));logger[_0x26ad('0x1f')](util['format'](_0x26ad('0x34'),_0x55d83a[_0x26ad('0x29')],_0x55d83a[_0x26ad('0x2a')],parseInt(_0x55d83a['priority'],0xa)+0x1));_0x55d83a[_0x26ad('0x35')](_0x55d83a[_0x26ad('0x29')],_0x55d83a[_0x26ad('0x2a')],parseInt(_0x55d83a[_0x26ad('0x2b')],0xa)+0x1);_0x55d83a[_0x26ad('0x36')]();}function handleNotFound(_0x451151){logger[_0x26ad('0x31')](util[_0x26ad('0x1d')](_0x26ad('0x37'),_0x451151['arg_1']));_0x451151[_0x26ad('0x35')](_0x451151['context'],_0x451151[_0x26ad('0x2a')],parseInt(_0x451151[_0x26ad('0x2b')],0xa)+0x1);_0x451151[_0x26ad('0x36')]();}function handleUnpublished(_0x55f617){logger['error'](util['format']('Project\x20%s\x20not\x20published',_0x55f617['arg_1']));_0x55f617[_0x26ad('0x35')](_0x55f617[_0x26ad('0x29')],_0x55f617[_0x26ad('0x2a')],parseInt(_0x55f617['priority'],0xa)+0x1);_0x55f617[_0x26ad('0x36')]();}module[_0x26ad('0x38')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0xf68a=['priority','response','code','result','isUndefined','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','vertex','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','close','Project\x20%s\x20not\x20published','continueAt','lodash','moment','xml2json','util','./rpc','./mailRpc','./vertices','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','retry','addVertex','omit','mxCell','isArray','length','source','target','addEdge','value','toJson','mxGraphModel','root','inspect','production','debug','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','traverseBFS','start','clear','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension'];(function(_0x4aafb8,_0x1488f5){var _0x139671=function(_0x5a747a){while(--_0x5a747a){_0x4aafb8['push'](_0x4aafb8['shift']());}};_0x139671(++_0x1488f5);}(_0xf68a,0x106));var _0xaf68=function(_0x2b7fd3,_0x3dd896){_0x2b7fd3=_0x2b7fd3-0x0;var _0x2ea637=_0xf68a[_0x2b7fd3];return _0x2ea637;};'use strict';var _=require(_0xaf68('0x0'));var moment=require(_0xaf68('0x1'));var parser=require(_0xaf68('0x2'));var util=require(_0xaf68('0x3'));var logger=require('../../config/logger')('agi');var rpc=require(_0xaf68('0x4'));var mailRpc=require(_0xaf68('0x5'));var Graph=require('./graph');var Vertices=require(_0xaf68('0x6'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xaf68('0x7')]()[_0xaf68('0x8')](function(_0x16b0d3){logger[_0xaf68('0x9')](_0xaf68('0xa'),_0x16b0d3[_0xaf68('0xb')]);return[];});}function addVertex(_0x204c63,_0x3b77de,_0x2d86f6){_0x3b77de[_0xaf68('0xc')]=_0x2d86f6;if(_0x3b77de[_0xaf68('0xd')](_0xaf68('0xe'))){_0x3b77de['maxRetry']=parseInt(_0x3b77de['retry'],0xa);}_0x204c63[_0xaf68('0xf')](_[_0xaf68('0x10')](_0x3b77de,_0xaf68('0x11')));}function initGraph(_0x21d62d,_0x27e916){var _0x35758c=new Graph();for(var _0x276c4d in _0x21d62d){if(_0x21d62d[_0xaf68('0xd')](_0x276c4d)){if(_[_0xaf68('0x12')](_0x21d62d[_0x276c4d])){for(var _0x22b0a2=0x0;_0x22b0a2<_0x21d62d[_0x276c4d][_0xaf68('0x13')];_0x22b0a2+=0x1){addVertex(_0x35758c,_0x21d62d[_0x276c4d][_0x22b0a2],_0x276c4d);}}else{addVertex(_0x35758c,_0x21d62d[_0x276c4d],_0x276c4d);}}}for(var _0x109abb=0x0;_0x109abb<_0x27e916[_0xaf68('0x13')];_0x109abb+=0x1){if(_0x27e916[_0x109abb][_0xaf68('0x14')]&&_0x27e916[_0x109abb][_0xaf68('0x15')]){_0x35758c[_0xaf68('0x16')](_0x27e916[_0x109abb][_0xaf68('0x14')],_0x27e916[_0x109abb][_0xaf68('0x15')],_0x27e916[_0x109abb][_0xaf68('0x17')]);}}return _0x35758c;}function getRoot(_0x2d7910){return parser[_0xaf68('0x18')](_0x2d7910,{'object':!![]})[_0xaf68('0x19')][_0xaf68('0x1a')];}function inspect(_0x58f5d5){return util[_0xaf68('0x1b')](_0x58f5d5,{'showHidden':![],'depth':null});}function initialize(_0x2a2c77,_0x2eae90){var _0x1920bd=getRoot(_0x2a2c77[_0xaf68('0x1c')]);if(!_0x1920bd||!_0x1920bd['start'])return;var _0x29733d,_0x7ff033,_0x381b2e;logger[_0xaf68('0x1d')](_0xaf68('0x1a'),JSON[_0xaf68('0x1e')](_0x1920bd,null,0x2));_0x2eae90[_0xaf68('0x1f')]=moment()[_0xaf68('0x20')](_0xaf68('0x21'));_0x29733d=initGraph(_[_0xaf68('0x10')](_0x1920bd,'mxCell'),_0x1920bd[_0xaf68('0x11')]);_0x7ff033=new Vertices(_0x2eae90,rpc,mailRpc);logger[_0xaf68('0x22')](util['format'](_0xaf68('0x23'),_0x2eae90[_0xaf68('0x24')],_0x2eae90[_0xaf68('0x25')],_0x2eae90[_0xaf68('0x26')],_0x2eae90[_0xaf68('0x27')],_0x2eae90[_0xaf68('0x28')]));_0x29733d[_0xaf68('0x29')](_0x1920bd[_0xaf68('0x2a')]['id'],function(_0x3ab3b3){try{_0x3ab3b3=_0x7ff033[_0xaf68('0x2b')](_0x3ab3b3);logger[_0xaf68('0x1d')]('vertex',JSON['stringify'](_0x3ab3b3,null,0x2));if(_0x3ab3b3[_0xaf68('0xc')]===_0xaf68('0x2c')){logger['info'](_0xaf68('0x2d'));_0x2eae90[_0xaf68('0x2e')]=_0x3ab3b3[_0xaf68('0x2e')]||_0x2eae90['context'];_0x2eae90[_0xaf68('0x2f')]=_0x3ab3b3[_0xaf68('0x2f')];_0x2eae90[_0xaf68('0x30')]=_0x3ab3b3[_0xaf68('0x30')]?_0x3ab3b3[_0xaf68('0x30')]-0x1:0x1;return null;}else if(_0x3ab3b3&&_0x7ff033[_0x3ab3b3[_0xaf68('0xc')]]){_0x381b2e=_0x7ff033[_0x3ab3b3[_0xaf68('0xc')]](_0x3ab3b3);logger[_0xaf68('0x22')](_0xaf68('0x31'),JSON['stringify'](_0x381b2e,null,0x2));if(_0x381b2e&&_0x381b2e[_0xaf68('0x32')]===AGI_CODE_SUCCESS&&_0x381b2e[_0xaf68('0x33')]!==AGI_RESULT_ERROR&&!_0x2eae90['evtHangup']){logger['debug'](_0xaf68('0x31'),inspect(_0x381b2e));return _[_0xaf68('0x34')](_0x381b2e[_0xaf68('0x33')])?null:_0x381b2e[_0xaf68('0x33')][_0xaf68('0x35')]();}else{logger[_0xaf68('0x9')]('response',inspect(_0x381b2e));return null;}}else{logger[_0xaf68('0x9')](_0xaf68('0x36'));return null;}}catch(_0x58832c){logger['error'](_0x58832c[_0xaf68('0xb')]);return null;}});if(_0x1920bd[_0xaf68('0x37')]){logger['info'](util['format'](_0xaf68('0x38'),_0x2eae90[_0xaf68('0x24')],_0x2eae90[_0xaf68('0x25')],_0x2eae90['callerid'],_0x2eae90[_0xaf68('0x27')],_0x2eae90[_0xaf68('0x28')]));_0x29733d['traverseBFS'](_0x1920bd[_0xaf68('0x37')]['id'],function(_0x37cea7){try{_0x37cea7=_0x7ff033[_0xaf68('0x2b')](_0x37cea7);logger[_0xaf68('0x1d')](_0xaf68('0x39'),JSON[_0xaf68('0x1e')](_0x37cea7,null,0x2));if(_0x37cea7&&_0x7ff033[_0x37cea7[_0xaf68('0xc')]]){_0x381b2e=_0x7ff033[_0x37cea7[_0xaf68('0xc')]](_0x37cea7);if(_0x381b2e){logger[_0xaf68('0x1d')]('response',inspect(_0x381b2e));return _[_0xaf68('0x34')](_0x381b2e[_0xaf68('0x33')])?null:_0x381b2e[_0xaf68('0x33')][_0xaf68('0x35')]();}else{logger[_0xaf68('0x9')]('response',inspect(_0x381b2e));return null;}}else{logger[_0xaf68('0x9')](_0xaf68('0x36'));return null;}}catch(_0x58d7bd){logger[_0xaf68('0x9')](_0x58d7bd['stack']);return null;}});}logger[_0xaf68('0x22')](util[_0xaf68('0x20')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x2eae90[_0xaf68('0x24')],_0x2eae90[_0xaf68('0x25')],_0x2eae90['callerid'],_0x2eae90['dnid'],_0x2eae90['uniqueid']));logger[_0xaf68('0x22')](util['format'](_0xaf68('0x3a'),_0x2eae90[_0xaf68('0x2e')],_0x2eae90[_0xaf68('0x2f')],parseInt(_0x2eae90[_0xaf68('0x30')],0xa)+0x1));_0x2eae90['continueAt'](_0x2eae90[_0xaf68('0x2e')],_0x2eae90[_0xaf68('0x2f')],parseInt(_0x2eae90[_0xaf68('0x30')],0xa)+0x1);_0x2eae90[_0xaf68('0x3b')]();}function handleNotFound(_0x549d6b){logger[_0xaf68('0x9')](util[_0xaf68('0x20')]('Project\x20%s\x20not\x20found',_0x549d6b[_0xaf68('0x24')]));_0x549d6b['continueAt'](_0x549d6b[_0xaf68('0x2e')],_0x549d6b[_0xaf68('0x2f')],parseInt(_0x549d6b['priority'],0xa)+0x1);_0x549d6b[_0xaf68('0x3b')]();}function handleUnpublished(_0x3be38b){logger[_0xaf68('0x9')](util[_0xaf68('0x20')](_0xaf68('0x3c'),_0x3be38b['arg_1']));_0x3be38b[_0xaf68('0x3d')](_0x3be38b[_0xaf68('0x2e')],_0x3be38b[_0xaf68('0x2f')],parseInt(_0x3be38b[_0xaf68('0x30')],0xa)+0x1);_0x3be38b[_0xaf68('0x3b')]();}module['exports']={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index d6aa7ea..3e965dc 100644 --- a/server/services/agi/reply.js +++ b/server/services/agi/reply.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7497=['_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','substring','length','indexOf','slice','trim','emit','headers','line','exports','util','stream','Transform','call'];(function(_0x2edf26,_0x229eec){var _0x256d52=function(_0x2eab6a){while(--_0x2eab6a){_0x2edf26['push'](_0x2edf26['shift']());}};_0x256d52(++_0x229eec);}(_0x7497,0x13c));var _0x7749=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7497[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x7749('0x0'));var Transform=require(_0x7749('0x1'))[_0x7749('0x2')];function AGIReply(_0x74dc6d){Transform[_0x7749('0x3')](this,_0x74dc6d);this[_0x7749('0x4')]='';this[_0x7749('0x5')]=![];}util[_0x7749('0x6')](AGIReply,Transform);AGIReply[_0x7749('0x7')][_0x7749('0x8')]=function(_0x1ab389,_0x131f78,_0x35c27b){var _0x341c81='\x0a',_0xef965f=['\x0a\x0a',_0x7749('0x9')],_0x5882e7=-0x1,_0x544812=-0x1,_0x2a6ae8='',_0x1bd19b=0x0,_0x4af29d='',_0x5505b5='';this[_0x7749('0x4')]+=_0x1ab389[_0x7749('0xa')]();_0x4af29d=this[_0x7749('0x4')];if(!this['_inBody']){_0x1bd19b=0x0;while(_0xef965f[_0x1bd19b]){while((_0x544812=_0x4af29d['indexOf'](_0xef965f[_0x1bd19b]))!=-0x1){_0x2a6ae8=_0xef965f[_0x1bd19b];_0x5505b5=_0x4af29d[_0x7749('0xb')](0x0,_0x544812);_0x4af29d=_0x4af29d['substring'](_0x544812+_0x2a6ae8[_0x7749('0xc')]);var _0x51a57d=_0x5505b5['split'](_0x341c81),_0x504caf=0x0,_0x7f2c06={},_0x405149='',_0x28202e='',_0x55c9ba=-0x1;while(_0x51a57d[_0x504caf]){_0x55c9ba=_0x51a57d[_0x504caf][_0x7749('0xd')](':');if(_0x55c9ba!=-0x1){_0x405149=_0x51a57d[_0x504caf][_0x7749('0xe')](0x0,_0x55c9ba)[_0x7749('0xf')]();_0x28202e=_0x51a57d[_0x504caf][_0x7749('0xe')](_0x55c9ba+0x1)[_0x7749('0xf')]();if(_0x405149['length']>0x0){_0x7f2c06[_0x405149]=_0x28202e;}}else{}_0x504caf++;}this[_0x7749('0x10')](_0x7749('0x11'),_0x7f2c06);this[_0x7749('0x5')]=!![];}_0x1bd19b++;}this[_0x7749('0x4')]=_0x4af29d;}else{while((_0x5882e7=_0x4af29d['indexOf'](_0x341c81))!=-0x1){_0x5505b5=_0x4af29d[_0x7749('0xb')](0x0,_0x5882e7);this[_0x7749('0x10')](_0x7749('0x12'),_0x5505b5);_0x4af29d=_0x4af29d[_0x7749('0xb')](_0x5882e7+_0x341c81['length']);}this[_0x7749('0x4')]=_0x4af29d;}_0x35c27b();};module[_0x7749('0x13')]=AGIReply; \ No newline at end of file +var _0xae8d=['emit','headers','line','exports','Transform','call','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','slice','trim'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xae8d,0x94));var _0xdae8=function(_0x2f6fee,_0xb92834){_0x2f6fee=_0x2f6fee-0x0;var _0x53388f=_0xae8d[_0x2f6fee];return _0x53388f;};'use strict';var util=require('util');var Transform=require('stream')[_0xdae8('0x0')];function AGIReply(_0xeebe7a){Transform[_0xdae8('0x1')](this,_0xeebe7a);this[_0xdae8('0x2')]='';this[_0xdae8('0x3')]=![];}util[_0xdae8('0x4')](AGIReply,Transform);AGIReply[_0xdae8('0x5')][_0xdae8('0x6')]=function(_0x434d28,_0x1e7df4,_0x510a7d){var _0x1d4acb='\x0a',_0x21cc50=['\x0a\x0a',_0xdae8('0x7')],_0x2d33aa=-0x1,_0x4c5d60=-0x1,_0xfccff2='',_0x2611a0=0x0,_0x4a91ac='',_0x469b5b='';this[_0xdae8('0x2')]+=_0x434d28[_0xdae8('0x8')]();_0x4a91ac=this[_0xdae8('0x2')];if(!this[_0xdae8('0x3')]){_0x2611a0=0x0;while(_0x21cc50[_0x2611a0]){while((_0x4c5d60=_0x4a91ac[_0xdae8('0x9')](_0x21cc50[_0x2611a0]))!=-0x1){_0xfccff2=_0x21cc50[_0x2611a0];_0x469b5b=_0x4a91ac[_0xdae8('0xa')](0x0,_0x4c5d60);_0x4a91ac=_0x4a91ac[_0xdae8('0xa')](_0x4c5d60+_0xfccff2[_0xdae8('0xb')]);var _0x54b38f=_0x469b5b['split'](_0x1d4acb),_0x15f91e=0x0,_0x356dc2={},_0x3872f8='',_0x39bf2c='',_0x2d0783=-0x1;while(_0x54b38f[_0x15f91e]){_0x2d0783=_0x54b38f[_0x15f91e][_0xdae8('0x9')](':');if(_0x2d0783!=-0x1){_0x3872f8=_0x54b38f[_0x15f91e][_0xdae8('0xc')](0x0,_0x2d0783)[_0xdae8('0xd')]();_0x39bf2c=_0x54b38f[_0x15f91e][_0xdae8('0xc')](_0x2d0783+0x1)[_0xdae8('0xd')]();if(_0x3872f8[_0xdae8('0xb')]>0x0){_0x356dc2[_0x3872f8]=_0x39bf2c;}}else{}_0x15f91e++;}this[_0xdae8('0xe')](_0xdae8('0xf'),_0x356dc2);this[_0xdae8('0x3')]=!![];}_0x2611a0++;}this['_localBuffer']=_0x4a91ac;}else{while((_0x2d33aa=_0x4a91ac['indexOf'](_0x1d4acb))!=-0x1){_0x469b5b=_0x4a91ac[_0xdae8('0xa')](0x0,_0x2d33aa);this[_0xdae8('0xe')](_0xdae8('0x10'),_0x469b5b);_0x4a91ac=_0x4a91ac[_0xdae8('0xa')](_0x2d33aa+_0x1d4acb[_0xdae8('0xb')]);}this[_0xdae8('0x2')]=_0x4a91ac;}_0x510a7d();};module[_0xdae8('0x11')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 4992892..61ac97a 100644 --- a/server/services/agi/rpc/index.js +++ b/server/services/agi/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0e35=['agentPause','PauseUser','UnpauseUser','agentLogout','LogoutUser','lodash','moment','jayson/promise','client','http','request','error','result','catch','GetSquareProjects','name','production','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','getTrunkById','ShowTrunk','ShowSound','save_name','ShowInterval','Interval','Intervals','getSmsAccountById','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','ShowCmHopper','phone','ListId','then','CreateCmContact','getPauseById','agentLogin','LoginUser'];(function(_0x489cf9,_0x5501a2){var _0x1114e8=function(_0x18fe5b){while(--_0x18fe5b){_0x489cf9['push'](_0x489cf9['shift']());}};_0x1114e8(++_0x5501a2);}(_0x0e35,0xc2));var _0x50e3=function(_0xb2a88a,_0xf31598){_0xb2a88a=_0xb2a88a-0x0;var _0xec3788=_0x0e35[_0xb2a88a];return _0xec3788;};'use strict';var _=require(_0x50e3('0x0'));var moment=require(_0x50e3('0x1'));var jayson=require(_0x50e3('0x2'));var client=jayson[_0x50e3('0x3')][_0x50e3('0x4')]({'port':0x2329});function request(_0x1d3e38,_0x3925be){return new Promise(function(_0x50a6c5,_0x2ae102){return client[_0x50e3('0x5')](_0x1d3e38,_0x3925be)['then'](function(_0x86283e){if(_0x86283e[_0x50e3('0x6')]){return _0x2ae102(_0x86283e['error']['message']);}else{return _0x50a6c5(_0x86283e[_0x50e3('0x7')]);}})[_0x50e3('0x8')](function(_0x57bb5f){return _0x2ae102(_0x57bb5f);});});}exports['getSquareProjects']=function(){return request(_0x50e3('0x9'),{'options':{'raw':![],'attributes':['id',_0x50e3('0xa'),_0x50e3('0xb')]}});};exports[_0x50e3('0xc')]=function(_0x3dbc46){return request(_0x50e3('0xd'),{'options':{'raw':![],'where':{'name':_0x3dbc46},'attributes':[_0x50e3('0xb')]}});};exports[_0x50e3('0xe')]=function(_0x2d43c5){return request(_0x50e3('0xf'),{'options':{'raw':![],'where':{'id':_0x2d43c5},'include':[{'model':_0x50e3('0x10'),'as':_0x50e3('0x11'),'include':[{'model':_0x50e3('0x12'),'as':'CloudProvider'}]}],'attributes':['id',_0x50e3('0xa'),_0x50e3('0x13')],'smtp':!![]}});};exports[_0x50e3('0x14')]=function(_0x9eb0c8){return request('ShowSquareProject',{'options':{'where':{'id':_0x9eb0c8},'attributes':[_0x50e3('0xa')]}});};exports[_0x50e3('0x15')]=function(_0x4b4d6f){return request(_0x50e3('0x16'),{'options':{'where':{'id':_0x4b4d6f},'attributes':[_0x50e3('0xa')]}});};exports[_0x50e3('0x17')]=function(_0x18f144){return request(_0x50e3('0x18'),{'options':{'where':{'id':_0x18f144},'attributes':['name']}});};exports[_0x50e3('0x19')]=function(_0x5f44e1){return request(_0x50e3('0x1a'),{'options':{'where':{'id':_0x5f44e1},'attributes':[_0x50e3('0x1b')]}});};exports[_0x50e3('0x1c')]=function(_0x4b1b85){return request(_0x50e3('0x1d'),{'options':{'where':{'id':_0x4b1b85},'attributes':[_0x50e3('0xa')]}});};exports[_0x50e3('0x1e')]=function(_0x3e56b6){return request('GetContactByPhone',{'options':{'where':{'phone':_0x3e56b6['phone']},'attributes':['id']}});};exports[_0x50e3('0x1f')]=function(_0x5d002b){return request(_0x50e3('0x20'),{'options':{'where':{'id':_0x5d002b},'attributes':[_0x50e3('0xa')]}});};exports['getSoundById']=function(_0x4d20b1){return request(_0x50e3('0x21'),{'options':{'where':{'id':_0x4d20b1},'attributes':[_0x50e3('0x22')]}});};exports['getIntervalById']=function(_0x3444e3){return request(_0x50e3('0x23'),{'options':{'raw':![],'where':{'id':_0x3444e3},'include':[{'model':_0x50e3('0x24'),'as':_0x50e3('0x25')}]}});};exports[_0x50e3('0x26')]=function(_0x164e11){return request('ShowSmsAccount',{'options':{'where':{'id':_0x164e11},'attributes':['id',_0x50e3('0xa')]}});};exports[_0x50e3('0x27')]=function(_0x37acdb){return request(_0x50e3('0x28'),{'body':_0x37acdb});};exports[_0x50e3('0x29')]=function(_0x283459){return request(_0x50e3('0x2a'),{'body':_0x283459});};exports[_0x50e3('0x2b')]=function(_0x4dec8c){return request(_0x50e3('0x2c'),{'body':_['merge'](_0x4dec8c,{'project_name':_0x4dec8c[_0x50e3('0x2d')],'prev_project_name':_0x4dec8c[_0x50e3('0x2e')]||'','is_subproject':_0x4dec8c[_0x50e3('0x2e')]?!![]:![],'leaveAt':moment()[_0x50e3('0x2f')](_0x50e3('0x30'))})});};exports['createSquareRecording']=function(_0x5af9a4){return request(_0x50e3('0x31'),{'body':_0x5af9a4});};exports['createSquareMessage']=function(_0x3675db){return request('CreateSquareMessage',{'body':_0x3675db});};exports['createCmContact']=function(_0x5e5b36){return request(_0x50e3('0x32'),{'options':{'raw':![],'where':{'phone':_0x5e5b36[_0x50e3('0x33')],'ListId':_0x5e5b36[_0x50e3('0x34')]}}})[_0x50e3('0x35')](function(_0xda5416){if(_0xda5416){return _0xda5416;}return request(_0x50e3('0x36'),{'body':_0x5e5b36});});};exports[_0x50e3('0x37')]=function(_0x2a028b){return request('ShowPause',{'options':{'where':{'id':_0x2a028b},'attributes':[_0x50e3('0xa')]}});};exports[_0x50e3('0x38')]=function(_0x34fb1c,_0x47cae9){return request(_0x50e3('0x39'),{'body':{'interface':_0x47cae9},'options':{'where':_0x34fb1c}});};exports[_0x50e3('0x3a')]=function(_0x412d48,_0x501574,_0x21c561){return request(_0x50e3('0x3b'),{'body':{'type':_0x501574,'uniqueid':_0x21c561},'options':{'where':_0x412d48}});};exports['agentUnpause']=function(_0x3ac5d0){return request(_0x50e3('0x3c'),{'body':{},'options':{'where':_0x3ac5d0}});};exports[_0x50e3('0x3d')]=function(_0x53f4d3){return request(_0x50e3('0x3e'),{'body':{},'options':{'where':_0x53f4d3}});}; \ No newline at end of file +var _0x7d86=['CloudProvider','email','getVoiceQueueById','ShowVoiceQueue','ShowVariable','ShowSquareOdbc','getUserById','ShowUser','getContactByPhone','phone','getTrunkById','ShowTrunk','ShowSound','Interval','Intervals','getSmsAccountById','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','merge','arg_1','arg_2','format','CreateSquareRecording','CreateSquareMessage','ListId','agentLogin','agentPause','UnpauseUser','LogoutUser','lodash','jayson/promise','client','http','then','error','message','result','catch','getSquareProjects','GetSquareProjects','name','production','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp'];(function(_0x5a99db,_0x1cece5){var _0x3aad62=function(_0x334cb7){while(--_0x334cb7){_0x5a99db['push'](_0x5a99db['shift']());}};_0x3aad62(++_0x1cece5);}(_0x7d86,0x86));var _0x67d8=function(_0x49453c,_0x427afb){_0x49453c=_0x49453c-0x0;var _0x542daa=_0x7d86[_0x49453c];return _0x542daa;};'use strict';var _=require(_0x67d8('0x0'));var moment=require('moment');var jayson=require(_0x67d8('0x1'));var client=jayson[_0x67d8('0x2')][_0x67d8('0x3')]({'port':0x2329});function request(_0xd94f63,_0x382a09){return new Promise(function(_0x431294,_0x3f58a1){return client['request'](_0xd94f63,_0x382a09)[_0x67d8('0x4')](function(_0x33de53){if(_0x33de53[_0x67d8('0x5')]){return _0x3f58a1(_0x33de53[_0x67d8('0x5')][_0x67d8('0x6')]);}else{return _0x431294(_0x33de53[_0x67d8('0x7')]);}})[_0x67d8('0x8')](function(_0x16e834){return _0x3f58a1(_0x16e834);});});}exports[_0x67d8('0x9')]=function(){return request(_0x67d8('0xa'),{'options':{'raw':![],'attributes':['id',_0x67d8('0xb'),_0x67d8('0xc')]}});};exports[_0x67d8('0xd')]=function(_0x265552){return request(_0x67d8('0xe'),{'options':{'raw':![],'where':{'name':_0x265552},'attributes':[_0x67d8('0xc')]}});};exports[_0x67d8('0xf')]=function(_0x14d7be){return request(_0x67d8('0x10'),{'options':{'raw':![],'where':{'id':_0x14d7be},'include':[{'model':_0x67d8('0x11'),'as':_0x67d8('0x12'),'include':[{'model':'CloudProvider','as':_0x67d8('0x13')}]}],'attributes':['id',_0x67d8('0xb'),_0x67d8('0x14')],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x159982){return request(_0x67d8('0xe'),{'options':{'where':{'id':_0x159982},'attributes':[_0x67d8('0xb')]}});};exports[_0x67d8('0x15')]=function(_0x2d54e6){return request(_0x67d8('0x16'),{'options':{'where':{'id':_0x2d54e6},'attributes':[_0x67d8('0xb')]}});};exports['getVariableById']=function(_0x4757c4){return request(_0x67d8('0x17'),{'options':{'where':{'id':_0x4757c4},'attributes':[_0x67d8('0xb')]}});};exports['getSquareOdbcById']=function(_0x2c0e96){return request(_0x67d8('0x18'),{'options':{'where':{'id':_0x2c0e96},'attributes':['dsn']}});};exports[_0x67d8('0x19')]=function(_0xaf5197){return request(_0x67d8('0x1a'),{'options':{'where':{'id':_0xaf5197},'attributes':[_0x67d8('0xb')]}});};exports[_0x67d8('0x1b')]=function(_0x2a9e66){return request('GetContactByPhone',{'options':{'where':{'phone':_0x2a9e66[_0x67d8('0x1c')]},'attributes':['id']}});};exports[_0x67d8('0x1d')]=function(_0x434810){return request(_0x67d8('0x1e'),{'options':{'where':{'id':_0x434810},'attributes':[_0x67d8('0xb')]}});};exports['getSoundById']=function(_0x35c293){return request(_0x67d8('0x1f'),{'options':{'where':{'id':_0x35c293},'attributes':['save_name']}});};exports['getIntervalById']=function(_0x360b29){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x360b29},'include':[{'model':_0x67d8('0x20'),'as':_0x67d8('0x21')}]}});};exports[_0x67d8('0x22')]=function(_0x490e0e){return request('ShowSmsAccount',{'options':{'where':{'id':_0x490e0e},'attributes':['id',_0x67d8('0xb')]}});};exports[_0x67d8('0x23')]=function(_0x43694a){return request(_0x67d8('0x24'),{'body':_0x43694a});};exports[_0x67d8('0x25')]=function(_0x5a6725){return request(_0x67d8('0x26'),{'body':_0x5a6725});};exports[_0x67d8('0x27')]=function(_0x590cff){return request('CreateSquareReport',{'body':_[_0x67d8('0x28')](_0x590cff,{'project_name':_0x590cff[_0x67d8('0x29')],'prev_project_name':_0x590cff['arg_2']||'','is_subproject':_0x590cff[_0x67d8('0x2a')]?!![]:![],'leaveAt':moment()[_0x67d8('0x2b')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports['createSquareRecording']=function(_0x432a5a){return request(_0x67d8('0x2c'),{'body':_0x432a5a});};exports['createSquareMessage']=function(_0x344288){return request(_0x67d8('0x2d'),{'body':_0x344288});};exports['createCmContact']=function(_0x1e7e8f){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x1e7e8f[_0x67d8('0x1c')],'ListId':_0x1e7e8f[_0x67d8('0x2e')]}}})[_0x67d8('0x4')](function(_0x48074a){if(_0x48074a){return _0x48074a;}return request('CreateCmContact',{'body':_0x1e7e8f});});};exports['getPauseById']=function(_0x19099f){return request('ShowPause',{'options':{'where':{'id':_0x19099f},'attributes':[_0x67d8('0xb')]}});};exports[_0x67d8('0x2f')]=function(_0x40c4ef,_0xbb3471){return request('LoginUser',{'body':{'interface':_0xbb3471},'options':{'where':_0x40c4ef}});};exports[_0x67d8('0x30')]=function(_0x41717a,_0x1620f2,_0x48e81e){return request('PauseUser',{'body':{'type':_0x1620f2,'uniqueid':_0x48e81e},'options':{'where':_0x41717a}});};exports['agentUnpause']=function(_0x433d55){return request(_0x67d8('0x31'),{'body':{},'options':{'where':_0x433d55}});};exports['agentLogout']=function(_0x21b195){return request(_0x67d8('0x32'),{'body':{},'options':{'where':_0x21b195}});}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/index.js b/server/services/agi/scripts/aws/index.js index 8b6eb3e..0c147a5 100644 --- a/server/services/agi/scripts/aws/index.js +++ b/server/services/agi/scripts/aws/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f6f=['./polly','./lex','exports'];(function(_0x3bef2c,_0x5a86fd){var _0x331503=function(_0x463430){while(--_0x463430){_0x3bef2c['push'](_0x3bef2c['shift']());}};_0x331503(++_0x5a86fd);}(_0x5f6f,0x1ef));var _0xf5f6=function(_0x33fb76,_0x450ed3){_0x33fb76=_0x33fb76-0x0;var _0x41033e=_0x5f6f[_0x33fb76];return _0x41033e;};var polly=require(_0xf5f6('0x0'));var lex=require(_0xf5f6('0x1'));module[_0xf5f6('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x82c4=['./lex','exports','./polly'];(function(_0x2227d3,_0x3c2f68){var _0x256f62=function(_0x138324){while(--_0x138324){_0x2227d3['push'](_0x2227d3['shift']());}};_0x256f62(++_0x3c2f68);}(_0x82c4,0x1ca));var _0x482c=function(_0x6bc68,_0x162239){_0x6bc68=_0x6bc68-0x0;var _0x102cdb=_0x82c4[_0x6bc68];return _0x102cdb;};var polly=require(_0x482c('0x0'));var lex=require(_0x482c('0x1'));module[_0x482c('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index a173244..8934c4e 100644 --- a/server/services/agi/scripts/aws/lex/index.js +++ b/server/services/agi/scripts/aws/lex/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['exports','./lib/api'];(function(_0x5b2a20,_0x53a830){var _0x9d623a=function(_0x312009){while(--_0x312009){_0x5b2a20['push'](_0x5b2a20['shift']());}};_0x9d623a(++_0x53a830);}(_0xe706,0xa3));var _0x6e70=function(_0x527387,_0x331638){_0x527387=_0x527387-0x0;var _0x22032f=_0xe706[_0x527387];return _0x22032f;};'use strict';var lex=require(_0x6e70('0x0'));module[_0x6e70('0x1')]=function(_0x311951,_0x5e8446,_0x2cae77,_0x315629,_0x2ca810,_0x7dfbc3){return lex(_0x311951,_0x5e8446,_0x2cae77,_0x315629,_0x2ca810,_0x7dfbc3);}; \ No newline at end of file +var _0xe706=['exports','./lib/api'];(function(_0x38f964,_0x598492){var _0x3633bf=function(_0x23fcbe){while(--_0x23fcbe){_0x38f964['push'](_0x38f964['shift']());}};_0x3633bf(++_0x598492);}(_0xe706,0xa3));var _0x6e70=function(_0x526786,_0x105cbf){_0x526786=_0x526786-0x0;var _0x3a512d=_0xe706[_0x526786];return _0x3a512d;};'use strict';var lex=require(_0x6e70('0x0'));module[_0x6e70('0x1')]=function(_0x311951,_0x5e8446,_0x2cae77,_0x315629,_0x2ca810,_0x7dfbc3){return lex(_0x311951,_0x5e8446,_0x2cae77,_0x315629,_0x2ca810,_0x7dfbc3);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/lib/api.js b/server/services/agi/scripts/aws/lex/lib/api.js index 030b70c..8088a3f 100644 --- a/server/services/agi/scripts/aws/lex/lib/api.js +++ b/server/services/agi/scripts/aws/lex/lib/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x2cc115,_0x1cfd0c){var _0x3906f8=function(_0x5651b9){while(--_0x5651b9){_0x2cc115['push'](_0x2cc115['shift']());}};_0x3906f8(++_0x1cfd0c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);}; \ No newline at end of file +var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x14b309,_0x5c58d5){var _0x5c32a3=function(_0x283cb7){while(--_0x283cb7){_0x14b309['push'](_0x14b309['shift']());}};_0x5c32a3(++_0x5c58d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/polly/index.js b/server/services/agi/scripts/aws/polly/index.js index 0c19bd0..c6f5211 100644 --- a/server/services/agi/scripts/aws/polly/index.js +++ b/server/services/agi/scripts/aws/polly/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3069=['./lib/api','exports'];(function(_0x1db251,_0xf0443d){var _0x56685a=function(_0x6ec6b7){while(--_0x6ec6b7){_0x1db251['push'](_0x1db251['shift']());}};_0x56685a(++_0xf0443d);}(_0x3069,0x15a));var _0x9306=function(_0x57c49b,_0x512e22){_0x57c49b=_0x57c49b-0x0;var _0x24fcb9=_0x3069[_0x57c49b];return _0x24fcb9;};'use strict';var polly=require(_0x9306('0x0'));module[_0x9306('0x1')]=function(_0x2e7112,_0x533768,_0x27fa75,_0x398ab7,_0x32a8aa,_0x5f0726,_0x2ed448){return polly(_0x2e7112,_0x533768,_0x27fa75,_0x398ab7,_0x32a8aa,_0x5f0726,_0x2ed448);}; \ No newline at end of file +var _0x8dab=['./lib/api'];(function(_0x396e2a,_0xd9f0ce){var _0xef762d=function(_0x501704){while(--_0x501704){_0x396e2a['push'](_0x396e2a['shift']());}};_0xef762d(++_0xd9f0ce);}(_0x8dab,0x168));var _0xb8da=function(_0x318ea0,_0x3d10bc){_0x318ea0=_0x318ea0-0x0;var _0x3631f1=_0x8dab[_0x318ea0];return _0x3631f1;};'use strict';var polly=require(_0xb8da('0x0'));module['exports']=function(_0x254fa0,_0x861be2,_0x275ed3,_0x5aa48a,_0x1d7e3a,_0x1bfcdf,_0x26067b){return polly(_0x254fa0,_0x861be2,_0x275ed3,_0x5aa48a,_0x1d7e3a,_0x1bfcdf,_0x26067b);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/polly/lib/api.js b/server/services/agi/scripts/aws/polly/lib/api.js index 6be2b81..34716f4 100644 --- a/server/services/agi/scripts/aws/polly/lib/api.js +++ b/server/services/agi/scripts/aws/polly/lib/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd55d=['synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','text','mp3','bluebird','aws-sdk'];(function(_0x148ffd,_0x3a94e2){var _0x1159cc=function(_0x55e19d){while(--_0x55e19d){_0x148ffd['push'](_0x148ffd['shift']());}};_0x1159cc(++_0x3a94e2);}(_0xd55d,0x14e));var _0xdd55=function(_0x30ae5f,_0x3a1d8a){_0x30ae5f=_0x30ae5f-0x0;var _0x38f5c2=_0xd55d[_0x30ae5f];return _0x38f5c2;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0xdd55('0x0'));var rs=require('randomstring');var AWS=require(_0xdd55('0x1'));function pollyResult(_0x281ca9,_0x4e66b3,_0x27ba1a){return new BPromise(function(_0x41f349,_0xc13725){_0x281ca9[_0xdd55('0x2')](_0x4e66b3,function(_0x3839b6,_0x4f2fe6){if(_0x3839b6){_0xc13725(_0x3839b6);}else if(_0x4f2fe6){if(_0x4f2fe6[_0xdd55('0x3')]instanceof Buffer){fs[_0xdd55('0x4')](_0x27ba1a,_0x4f2fe6['AudioStream'],function(_0x58d857){if(_0x58d857){_0xc13725(_0x58d857);}else{_0x41f349();}});}else{_0xc13725(new Error(_0xdd55('0x5')));}}else{_0xc13725(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module['exports']=function(_0x3aabed,_0x255f28,_0x30fbec,_0x5bf69e,_0xfc723b,_0x1fc3e9,_0x3e04c8){var _0x4e8545=new AWS['Polly']({'accessKeyId':_0x3aabed,'secretAccessKey':_0x255f28,'region':_0x30fbec});var _0x5ef850={'Text':_0xfc723b,'TextType':_0x1fc3e9||_0xdd55('0x6'),'OutputFormat':_0xdd55('0x7'),'VoiceId':_0x5bf69e};return pollyResult(_0x4e8545,_0x5ef850,_0x3e04c8);}; \ No newline at end of file +var _0x7b9f=['path','bluebird','randomstring','synthesizeSpeech','AudioStream','writeFile','exports','Polly','text'];(function(_0x24e64a,_0x2063ec){var _0x4a0fd5=function(_0x38954b){while(--_0x38954b){_0x24e64a['push'](_0x24e64a['shift']());}};_0x4a0fd5(++_0x2063ec);}(_0x7b9f,0x14d));var _0xf7b9=function(_0x310142,_0x22a68f){_0x310142=_0x310142-0x0;var _0x34d431=_0x7b9f[_0x310142];return _0x34d431;};'use strict';var fs=require('fs');var path=require(_0xf7b9('0x0'));var BPromise=require(_0xf7b9('0x1'));var rs=require(_0xf7b9('0x2'));var AWS=require('aws-sdk');function pollyResult(_0x56c585,_0xba4578,_0x19a30c){return new BPromise(function(_0x587a57,_0x33b7be){_0x56c585[_0xf7b9('0x3')](_0xba4578,function(_0x7de570,_0x382259){if(_0x7de570){_0x33b7be(_0x7de570);}else if(_0x382259){if(_0x382259[_0xf7b9('0x4')]instanceof Buffer){fs[_0xf7b9('0x5')](_0x19a30c,_0x382259['AudioStream'],function(_0x558b0a){if(_0x558b0a){_0x33b7be(_0x558b0a);}else{_0x587a57();}});}else{_0x33b7be(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x33b7be(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0xf7b9('0x6')]=function(_0x298a0c,_0x2de29b,_0x40e7be,_0x335fe3,_0x2f84e4,_0x46f544,_0x449f07){var _0x5a620a=new AWS[(_0xf7b9('0x7'))]({'accessKeyId':_0x298a0c,'secretAccessKey':_0x2de29b,'region':_0x40e7be});var _0x1688be={'Text':_0x2f84e4,'TextType':_0x46f544||_0xf7b9('0x8'),'OutputFormat':'mp3','VoiceId':_0x335fe3};return pollyResult(_0x5a620a,_0x1688be,_0x449f07);}; \ No newline at end of file diff --git a/server/services/agi/scripts/google/asr/index.js b/server/services/agi/scripts/google/asr/index.js index bfe94d3..082ab5f 100644 --- a/server/services/agi/scripts/google/asr/index.js +++ b/server/services/agi/scripts/google/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -'use strict';var asr=require('./lib/api');module['exports']=function(_0x4d91ed,_0x5cf905,_0x5b59f2,_0x4287f9){return asr(_0x4d91ed,_0x5cf905,_0x5b59f2);}; \ No newline at end of file +var _0x732a=['./lib/api','exports'];(function(_0x20ccc6,_0x38e17f){var _0x424eb5=function(_0x5c217d){while(--_0x5c217d){_0x20ccc6['push'](_0x20ccc6['shift']());}};_0x424eb5(++_0x38e17f);}(_0x732a,0x13c));var _0xa732=function(_0x3a924d,_0x1f0870){_0x3a924d=_0x3a924d-0x0;var _0x2f9f0b=_0x732a[_0x3a924d];return _0x2f9f0b;};'use strict';var asr=require(_0xa732('0x0'));module[_0xa732('0x1')]=function(_0x1c5518,_0x2bbb33,_0x554784,_0x309b9a){return asr(_0x1c5518,_0x2bbb33,_0x554784);}; \ No newline at end of file diff --git a/server/services/agi/scripts/google/asr/lib/api.js b/server/services/agi/scripts/google/asr/lib/api.js index 68e296c..5992682 100644 --- a/server/services/agi/scripts/google/asr/lib/api.js +++ b/server/services/agi/scripts/google/asr/lib/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc36d=['bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','url'];(function(_0x5e0c67,_0xed9c5){var _0x2d447d=function(_0x357b7a){while(--_0x357b7a){_0x5e0c67['push'](_0x5e0c67['shift']());}};_0x2d447d(++_0xed9c5);}(_0xc36d,0x7d));var _0xdc36=function(_0x400322,_0x4353a8){_0x400322=_0x400322-0x0;var _0xfdd597=_0xc36d[_0x400322];return _0xfdd597;};'use strict';var url=require(_0xdc36('0x0'));var BPromise=require(_0xdc36('0x1'));var fs=require('fs');var host=_0xdc36('0x2');module[_0xdc36('0x3')]=function(_0x471240,_0x2d5df5,_0x4c42dd){return new BPromise(function(_0x42522b,_0x3431f9){var _0x53ac17;if(typeof _0x471240!==_0xdc36('0x4')||_0x471240[_0xdc36('0x5')]===0x0){return _0x3431f9(_0xdc36('0x6'));}if(typeof _0x2d5df5!==_0xdc36('0x4')||_0x2d5df5[_0xdc36('0x5')]===0x0){return _0x3431f9('key\x20should\x20be\x20a\x20string');}if(typeof _0x4c42dd!==_0xdc36('0x7')&&(typeof _0x4c42dd!==_0xdc36('0x4')||_0x4c42dd[_0xdc36('0x5')]===0x0)){return _0x3431f9(_0xdc36('0x8'));}try{_0x53ac17=fs['readFileSync'](_0x471240)[_0xdc36('0x9')](_0xdc36('0xa'));}catch(_0x573f8e){return _0x3431f9(_0x573f8e);}return _0x42522b({'method':_0xdc36('0xb'),'uri':host+_0xdc36('0xc')+_0x2d5df5,'body':{'config':{'encoding':_0xdc36('0xd'),'sampleRateHertz':'8000','languageCode':_0x4c42dd},'audio':{'content':_0x53ac17}},'json':!![]});});}; \ No newline at end of file +var _0xb6b1=['LINEAR16','8000','url','https://speech.googleapis.com','string','length','filepath\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','POST','/v1/speech:recognize?key='];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x49ad79,_0x48ee93){_0x49ad79=_0x49ad79-0x0;var _0xa4e38a=_0xb6b1[_0x49ad79];return _0xa4e38a;};'use strict';var url=require(_0x1b6b('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0x1b6b('0x1');module['exports']=function(_0xede124,_0x29651a,_0x59b931){return new BPromise(function(_0x3f12e2,_0x5100e5){var _0x2a2c45;if(typeof _0xede124!==_0x1b6b('0x2')||_0xede124[_0x1b6b('0x3')]===0x0){return _0x5100e5(_0x1b6b('0x4'));}if(typeof _0x29651a!=='string'||_0x29651a[_0x1b6b('0x3')]===0x0){return _0x5100e5('key\x20should\x20be\x20a\x20string');}if(typeof _0x59b931!==_0x1b6b('0x5')&&(typeof _0x59b931!=='string'||_0x59b931[_0x1b6b('0x3')]===0x0)){return _0x5100e5(_0x1b6b('0x6'));}try{_0x2a2c45=fs[_0x1b6b('0x7')](_0xede124)[_0x1b6b('0x8')]('base64');}catch(_0x4c750a){return _0x5100e5(_0x4c750a);}return _0x3f12e2({'method':_0x1b6b('0x9'),'uri':host+_0x1b6b('0xa')+_0x29651a,'body':{'config':{'encoding':_0x1b6b('0xb'),'sampleRateHertz':_0x1b6b('0xc'),'languageCode':_0x59b931},'audio':{'content':_0x2a2c45}},'json':!![]});});}; \ No newline at end of file diff --git a/server/services/agi/scripts/google/index.js b/server/services/agi/scripts/google/index.js index 2df533b..10cb4be 100644 --- a/server/services/agi/scripts/google/index.js +++ b/server/services/agi/scripts/google/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe87a=['./asr'];(function(_0x539f3a,_0x5e3f6d){var _0x3b5599=function(_0x158af2){while(--_0x158af2){_0x539f3a['push'](_0x539f3a['shift']());}};_0x3b5599(++_0x5e3f6d);}(_0xe87a,0x130));var _0xae87=function(_0x807954,_0x22eb1d){_0x807954=_0x807954-0x0;var _0x5c023e=_0xe87a[_0x807954];return _0x5c023e;};var asr=require(_0xae87('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var asr=require('./asr');module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index 400015b..542379c 100644 --- a/server/services/agi/scripts/index.js +++ b/server/services/agi/scripts/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd2f0=['%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','format','model=%s','freeform=3','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','dialogflow','http','https','md5','path','querystring','request-promise','randomstring','sox','google-tts-api','url','./aws','./google','./sestek','./tilde','../../../config/logger','agi','protocol','https:','host','WHAT_EVER','get','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','request\x20to\x20','finish','info','finish\x20download\x20file','close','end','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','generate','.wav','writeFileSync','base64','then','unlink','chmodSync','777','readFileSync','toString','googleCloudTTS','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','tmp','audioContent','googleCloudTTS\x20path','split','googleTTS','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','parse\x20response\x20failed:\x0a','data','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','.mp3','goggleTTS\x20path','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','source','action','actionIncomplete','fulfillment','speech','score','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','allRequiredParamsPresent','diagnosticInfo','queryResult','end_conversation','boolValue','intent','isFallback','languageCode','queryText','responseId','fulfillmentText','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsLex','ispeechTTS'];(function(_0x51e545,_0x5b33fd){var _0x25d5ef=function(_0x12dc28){while(--_0x12dc28){_0x51e545['push'](_0x51e545['shift']());}};_0x25d5ef(++_0x5b33fd);}(_0xd2f0,0x1a9));var _0x0d2f=function(_0x5ab89b,_0x131968){_0x5ab89b=_0x5ab89b-0x0;var _0x184e76=_0xd2f0[_0x5ab89b];return _0x184e76;};'use strict';var apiai=require(_0x0d2f('0x0'));var BPromise=require('bluebird');var dialogflow=require(_0x0d2f('0x1'));var fs=require('fs');var http=require(_0x0d2f('0x2'));var https=require(_0x0d2f('0x3'));var md5=require(_0x0d2f('0x4'));var path=require(_0x0d2f('0x5'));var querystring=require(_0x0d2f('0x6'));var rp=require(_0x0d2f('0x7'));var rs=require(_0x0d2f('0x8'));var sox=require(_0x0d2f('0x9'));var tts=require(_0x0d2f('0xa'));var urlParse=require(_0x0d2f('0xb'))['parse'];var util=require('util');var aws=require(_0x0d2f('0xc'));var google=require(_0x0d2f('0xd'));var sestek=require(_0x0d2f('0xe'));var tilde=require(_0x0d2f('0xf'));var logger=require(_0x0d2f('0x10'))(_0x0d2f('0x11'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x408441,_0x2f5da7){return new BPromise(function(_0x503b90,_0x18f08d){var _0x4c1aed=urlParse(_0x408441);var _0x47e5e9=_0x4c1aed[_0x0d2f('0x12')]===_0x0d2f('0x13')?https:http;var _0x4e74ae={'host':_0x4c1aed[_0x0d2f('0x14')],'path':_0x4c1aed[_0x0d2f('0x5')],'headers':{'user-agent':_0x0d2f('0x15')}};_0x47e5e9[_0x0d2f('0x16')](_0x4e74ae,function(_0x56e380){if(_0x56e380[_0x0d2f('0x17')]!==0xc8){logger[_0x0d2f('0x18')]('request\x20to\x20'+_0x408441+_0x0d2f('0x19')+_0x56e380['statusCode']+'\x20('+_0x56e380[_0x0d2f('0x1a')]+')');_0x18f08d(new Error(_0x0d2f('0x1b')+_0x408441+_0x0d2f('0x19')+_0x56e380['statusCode']+'\x20('+_0x56e380[_0x0d2f('0x1a')]+')'));return;}var _0x465f3c=fs['createWriteStream'](_0x2f5da7);_0x465f3c['on'](_0x0d2f('0x1c'),function(){logger[_0x0d2f('0x1d')](_0x0d2f('0x1e'));_0x465f3c[_0x0d2f('0x1f')](_0x503b90);});_0x465f3c['on'](_0x0d2f('0x18'),function(_0x374240){fs['unlink'](_0x2f5da7);logger[_0x0d2f('0x18')]('download\x20error',_0x374240);_0x18f08d(_0x374240);});_0x56e380['pipe'](_0x465f3c);})['on'](_0x0d2f('0x18'),function(_0x590bb8){logger[_0x0d2f('0x18')](_0x590bb8);_0x18f08d(_0x590bb8);})[_0x0d2f('0x20')]();});}function uploadFile(_0x3ae446){return new BPromise(function(_0x1ec522,_0x5c5c18){var _0x978c07=urlParse(_0x3ae446);var _0x12ce58=_0x978c07[_0x0d2f('0x12')]===_0x0d2f('0x13')?https:http;var _0x6fb868={'host':_0x978c07[_0x0d2f('0x14')],'path':_0x978c07[_0x0d2f('0x5')],'headers':{'user-agent':_0x0d2f('0x15')}};_0x12ce58['get'](_0x6fb868,function(_0x1ee5e8){if(_0x1ee5e8[_0x0d2f('0x17')]!==0xc8){_0x5c5c18(new Error(_0x0d2f('0x1b')+_0x3ae446+'\x20failed,\x20status\x20code\x20=\x20'+_0x1ee5e8[_0x0d2f('0x17')]+'\x20('+_0x1ee5e8['statusMessage']+')'));return;}var _0x52dec2='';_0x1ee5e8['on']('data',function(_0x5a7b5c){_0x52dec2+=_0x5a7b5c;});_0x1ee5e8['on']('end',function(){_0x1ec522(_0x52dec2);});})['on']('error',function(_0x5027d6){_0x5c5c18(_0x5027d6);})[_0x0d2f('0x20')]();});}function convertFile(_0x78918e,_0x1217f7){return new BPromise(function(_0x25ad06,_0x3f504a){var _0x250310=sox[_0x0d2f('0x21')](_0x78918e,_0x1217f7,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x250310['on'](_0x0d2f('0x18'),function(_0x214499){logger[_0x0d2f('0x18')](_0x0d2f('0x22'),_0x214499);_0x3f504a(_0x214499);});_0x250310['on']('end',function(){logger[_0x0d2f('0x1d')](_0x0d2f('0x23'));_0x25ad06();});_0x250310[_0x0d2f('0x24')]();});}function base64Decode(_0x464580,_0x1d11b8){var _0x3585c5=path[_0x0d2f('0x25')](__dirname,'tmp',rs[_0x0d2f('0x26')](0x4)+_0x0d2f('0x27'));fs[_0x0d2f('0x28')](_0x3585c5,_0x464580,_0x0d2f('0x29'));return convertFile(_0x3585c5,_0x1d11b8)[_0x0d2f('0x2a')](function(){try{fs[_0x0d2f('0x2b')](_0x3585c5);fs[_0x0d2f('0x2c')](_0x1d11b8,_0x0d2f('0x2d'));}catch(_0x55b5ff){logger['error'](_0x55b5ff);}return _0x1d11b8['split']('.')[0x0];});}function base64Encode(_0x7faae5){var _0x2aa4d8=fs[_0x0d2f('0x2e')](_0x7faae5);return new Buffer(_0x2aa4d8)[_0x0d2f('0x2f')]('base64');}exports[_0x0d2f('0x30')]=function(_0x33d990,_0x48fb7b,_0x445205,_0x1c5e57,_0x1301e6,_0x3e3eaf){var _0x73da45,_0xa5021a;var _0x30d7f6='https://texttospeech.googleapis.com/v1/';var _0x159db1='?key='+_0x33d990;var _0x5b78ae={};if(_0x48fb7b===_0x0d2f('0x31')){_0x5b78ae['input']={'ssml':_0x445205};}else{_0x5b78ae[_0x0d2f('0x32')]={'text':_0x445205};};_0x5b78ae[_0x0d2f('0x33')]={'languageCode':_0x1c5e57,'ssmlGender':_0x1301e6};_0x5b78ae[_0x0d2f('0x34')]={'audioEncoding':_0x0d2f('0x35'),'sampleRateHertz':0x1f40};var _0x4ecabb={'url':_0x30d7f6+_0x0d2f('0x36')+_0x159db1,'method':_0x0d2f('0x37'),'json':!![],'body':_0x5b78ae};return rp(_0x4ecabb)['then'](function(_0x61b639){return new BPromise(function(_0x2ee566,_0xab210d){_0x73da45=path[_0x0d2f('0x25')](__dirname,_0x0d2f('0x38'),rs[_0x0d2f('0x26')](0x4)+'.mp3');var _0x1597ba=Buffer['from'](_0x61b639[_0x0d2f('0x39')],_0x0d2f('0x29'));return fs['writeFile'](_0x73da45,_0x1597ba,function(_0x429f8f){_0xab210d(_0x429f8f);},function(_0x3e2d40){fs['chmodSync'](_0x73da45,'777');_0x2ee566(_0x3e2d40);});});})[_0x0d2f('0x2a')](function(_0x522579){_0xa5021a=path[_0x0d2f('0x25')](__dirname,'tmp',rs[_0x0d2f('0x26')](0x4)+'.wav');return convertFile(_0x73da45,_0xa5021a);})['then'](function(){try{fs[_0x0d2f('0x2b')](_0x73da45);fs[_0x0d2f('0x2c')](_0xa5021a,_0x0d2f('0x2d'));}catch(_0x2c4acc){logger[_0x0d2f('0x18')](_0x2c4acc);}logger[_0x0d2f('0x1d')](_0x0d2f('0x3a'),_0xa5021a[_0x0d2f('0x3b')]('.')[0x0]);return _0xa5021a[_0x0d2f('0x3b')]('.')[0x0];});};exports[_0x0d2f('0x3c')]=function(_0x1f2e02,_0x245ba4){var _0x423d45='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x4cbc35,_0x468752;var _0x5a7239;var _0x5513ab={'encoding':_0x0d2f('0x3d'),'method':_0x0d2f('0x37'),'timeout':0x2710,'url':_0x423d45,'headers':{'Content-Type':_0x0d2f('0x3e')},'body':_0x0d2f('0x3f')+encodeURIComponent(JSON[_0x0d2f('0x40')]([[[_0x0d2f('0x41'),JSON[_0x0d2f('0x40')]([_0x1f2e02,_0x245ba4||'en',![],_0x0d2f('0x42')]),null,'generic']]]))};return rp(_0x5513ab)[_0x0d2f('0x2a')](function(_0x145ada){try{_0x5a7239=eval(_0x145ada['slice'](0x5))[0x0][0x2];}catch(_0x3d037e){throw new Error(_0x0d2f('0x43')+_0x145ada[_0x0d2f('0x44')]);}if(!_0x5a7239){if(_0x1f2e02[_0x0d2f('0x45')]>0xc8){throw new Error(_0x0d2f('0x46'));}else{throw new Error(_0x0d2f('0x47')+_0x245ba4+_0x0d2f('0x48'));}}try{_0x5a7239=eval(_0x5a7239)[0x0];}catch(_0x4923fc){throw new Error(_0x0d2f('0x43')+res[_0x0d2f('0x44')]);}const _0x1746b1=_0x5a7239;_0x4cbc35=path['resolve'](__dirname,_0x0d2f('0x38'),rs[_0x0d2f('0x26')](0x4)+_0x0d2f('0x49'));fs['writeFileSync'](_0x4cbc35,_0x5a7239,{'encoding':_0x0d2f('0x29')});_0x468752=path['resolve'](__dirname,_0x0d2f('0x38'),rs['generate'](0x4)+_0x0d2f('0x27'));return convertFile(_0x4cbc35,_0x468752);})[_0x0d2f('0x2a')](function(){try{fs[_0x0d2f('0x2b')](_0x4cbc35);fs[_0x0d2f('0x2c')](_0x468752,'777');}catch(_0x5e4529){logger['error'](_0x5e4529);}logger[_0x0d2f('0x1d')](_0x0d2f('0x4a'),_0x468752[_0x0d2f('0x3b')]('.')[0x0]);return _0x468752['split']('.')[0x0];});};exports['googleASR']=function(_0xf320cb,_0xbece8b,_0x50357d){return google[_0x0d2f('0x4b')](_0xf320cb,_0xbece8b,_0x50357d)[_0x0d2f('0x2a')](function(_0x388f83){logger['info'](_0x388f83[_0x0d2f('0x4c')]);return rp(_0x388f83);})[_0x0d2f('0x2a')](function(_0x5e2bc8){var _0x3cbe0d='';var _0x2755bd=0x0;try{fs[_0x0d2f('0x2b')](_0xf320cb);}catch(_0x1ba6d2){logger[_0x0d2f('0x18')](_0x1ba6d2);}if(_0x5e2bc8&&_0x5e2bc8[_0x0d2f('0x4d')]){_0x3cbe0d=_0x5e2bc8[_0x0d2f('0x4d')][_0x0d2f('0x4e')](function(_0xfbbf9c){return _0xfbbf9c&&_0xfbbf9c[_0x0d2f('0x4f')][0x0]&&_0xfbbf9c[_0x0d2f('0x4f')][0x0][_0x0d2f('0x50')]?_0xfbbf9c['alternatives'][0x0][_0x0d2f('0x50')]:'';})[_0x0d2f('0x51')]('\x0a');_0x2755bd=_0x5e2bc8[_0x0d2f('0x4d')][_0x0d2f('0x4e')](function(_0xd1d62b){return _0xd1d62b&&_0xd1d62b[_0x0d2f('0x4f')][0x0]&&_0xd1d62b[_0x0d2f('0x4f')][0x0][_0x0d2f('0x52')]?_0xd1d62b[_0x0d2f('0x4f')][0x0][_0x0d2f('0x52')]:0x0;})[_0x0d2f('0x51')]('\x0a');}logger[_0x0d2f('0x1d')](_0x0d2f('0x53'),_0x3cbe0d);logger[_0x0d2f('0x1d')]('googleASR\x20confidence',_0x2755bd);return{'transcript':_0x3cbe0d,'confidence':_0x2755bd};})[_0x0d2f('0x54')](function(_0x17e1e1){logger[_0x0d2f('0x18')](_0x0d2f('0x55'),_0x17e1e1[_0x0d2f('0x17')],_0x17e1e1[_0x0d2f('0x56')],_0x17e1e1[_0x0d2f('0x57')]);});};exports[_0x0d2f('0x58')]=function(_0x208ab8,_0x44b3a2,_0x21be60,_0x15ee52){var _0x42487e=apiai(_0x44b3a2,{'language':_0x15ee52||'en'});return _0x42487e[_0x0d2f('0x59')](_0x21be60,{'sessionId':md5(_0x208ab8)})[_0x0d2f('0x2a')](function(_0x45fc7c){logger[_0x0d2f('0x1d')](JSON['stringify'](_0x45fc7c));return{'source':_0x45fc7c[_0x0d2f('0x5a')][_0x0d2f('0x5b')],'resolvedQuery':_0x45fc7c[_0x0d2f('0x5a')]['resolvedQuery'],'action':_0x45fc7c[_0x0d2f('0x5a')][_0x0d2f('0x5c')],'actionIncomplete':_0x45fc7c['result'][_0x0d2f('0x5d')],'speech':_0x45fc7c[_0x0d2f('0x5a')][_0x0d2f('0x5e')][_0x0d2f('0x5f')],'score':_0x45fc7c['result'][_0x0d2f('0x60')],'statusCode':_0x45fc7c[_0x0d2f('0x61')][_0x0d2f('0x62')],'endConversation':_0x45fc7c['result'][_0x0d2f('0x63')][_0x0d2f('0x64')]||![],'isFallbackIntent':_0x45fc7c[_0x0d2f('0x5a')][_0x0d2f('0x63')][_0x0d2f('0x65')]};});};exports[_0x0d2f('0x66')]=function(_0x939f29,_0x4cedc9,_0x1d7b80,_0x4d8895,_0x249dc5,_0x4a4360){var _0x34df0e=_0x4d8895['replace'](/\\n/g,'\x0a');var _0x5e2968={'credentials':{'private_key':_0x34df0e,'client_email':_0x1d7b80}};var _0x5eba9c=new dialogflow[(_0x0d2f('0x67'))](_0x5e2968);var _0x513faa=_0x5eba9c[_0x0d2f('0x68')](_0x4cedc9,md5(_0x939f29));var _0x36c85f={'session':_0x513faa,'queryInput':{'text':{'text':_0x249dc5,'languageCode':_0x4a4360}}};return _0x5eba9c[_0x0d2f('0x69')](_0x36c85f)[_0x0d2f('0x2a')](function(_0xf3ed8){if(_0xf3ed8&&_0xf3ed8[_0x0d2f('0x45')]){logger[_0x0d2f('0x1d')](_0x0d2f('0x6a'),JSON[_0x0d2f('0x40')](_0xf3ed8));var _0x3fee8a=_0xf3ed8[0x0];if(_0x3fee8a){var _0x437b5b={'action':_0x3fee8a['queryResult'][_0x0d2f('0x5c')],'allRequiredParamsPresent':_0x3fee8a['queryResult'][_0x0d2f('0x6b')],'endConversation':_0x3fee8a['queryResult'][_0x0d2f('0x6c')]&&_0x3fee8a['queryResult'][_0x0d2f('0x6c')]['fields']?_0x3fee8a[_0x0d2f('0x6d')][_0x0d2f('0x6c')]['fields'][_0x0d2f('0x6e')][_0x0d2f('0x6f')]:![],'fulfillmentText':_0x3fee8a[_0x0d2f('0x6d')]['fulfillmentText'],'intentName':_0x3fee8a['queryResult'][_0x0d2f('0x70')][_0x0d2f('0x56')],'intentDisplayName':_0x3fee8a[_0x0d2f('0x6d')][_0x0d2f('0x70')]['displayName'],'isFallbackIntent':_0x3fee8a[_0x0d2f('0x6d')]['intent'][_0x0d2f('0x71')],'languageCode':_0x3fee8a[_0x0d2f('0x6d')][_0x0d2f('0x72')],'queryText':_0x3fee8a[_0x0d2f('0x6d')][_0x0d2f('0x73')],'responseId':_0x3fee8a[_0x0d2f('0x74')],'score':_0x3fee8a['queryResult']['intentDetectionConfidence'],'speech':_0x3fee8a[_0x0d2f('0x6d')][_0x0d2f('0x75')],'providerResponse':JSON[_0x0d2f('0x40')](_0xf3ed8)};return _0x437b5b;}}});};exports[_0x0d2f('0x76')]=function(_0x5aabf9,_0x69f5ca,_0x349414,_0x1441dc){return tilde[_0x0d2f('0x4b')](_0x5aabf9,_0x69f5ca,_0x349414,_0x1441dc)[_0x0d2f('0x2a')](function(_0x19c9e4){try{fs['unlink'](_0x5aabf9);}catch(_0x1637d5){logger[_0x0d2f('0x18')](_0x1637d5);}logger[_0x0d2f('0x1d')](_0x0d2f('0x77'),_0x19c9e4[_0x0d2f('0x50')]);logger[_0x0d2f('0x1d')](_0x0d2f('0x78'),_0x19c9e4['confidence']);return _0x19c9e4;});};exports['awsPolly']=function(_0x2fda7b,_0x5464dd,_0x562bc3,_0x9a46bf,_0x1b9401,_0x42a5ac){var _0x19409e=path[_0x0d2f('0x25')](__dirname,_0x0d2f('0x38'),rs[_0x0d2f('0x26')](0x4)+_0x0d2f('0x49'));var _0x1a5e92;return aws['polly'](_0x2fda7b,_0x5464dd,_0x562bc3,_0x9a46bf,_0x1b9401,_0x42a5ac,_0x19409e)[_0x0d2f('0x2a')](function(){_0x1a5e92=path[_0x0d2f('0x25')](__dirname,_0x0d2f('0x38'),rs[_0x0d2f('0x26')](0x4)+_0x0d2f('0x27'));return convertFile(_0x19409e,_0x1a5e92);})['then'](function(){try{fs['unlink'](_0x19409e);fs['chmodSync'](_0x1a5e92,'777');}catch(_0x519733){logger[_0x0d2f('0x18')](_0x519733);}return _0x1a5e92['split']('.')[0x0];});};exports[_0x0d2f('0x79')]=function(_0xc340b7,_0x18da6c,_0x5e50cf,_0x39fac0,_0x3ac35d,_0x3d260f){return aws['lex'](_0xc340b7,_0x18da6c,_0x5e50cf,_0x39fac0,_0x3ac35d,_0x3d260f)[_0x0d2f('0x2a')](function(_0x2cbd2f){logger[_0x0d2f('0x1d')](JSON[_0x0d2f('0x40')](_0x2cbd2f));return _0x2cbd2f;});};exports[_0x0d2f('0x7a')]=function(_0x4b5ca1,_0x4e1342,_0x4c3366,_0x16780f){var _0xda4bd6=util['format'](_0x0d2f('0x7b'),ISPEECH_API,_0x4b5ca1,encodeURIComponent(_0x4e1342),_0x4c3366,_0x16780f);var _0x22efb7=path['resolve'](__dirname,_0x0d2f('0x38'),rs[_0x0d2f('0x26')](0x4)+'.mp3');var _0x336afb;return downloadFile(_0xda4bd6,_0x22efb7)[_0x0d2f('0x2a')](function(){_0x336afb=path[_0x0d2f('0x25')](__dirname,_0x0d2f('0x38'),rs['generate'](0x4)+_0x0d2f('0x27'));return convertFile(_0x22efb7,_0x336afb);})[_0x0d2f('0x2a')](function(){try{fs[_0x0d2f('0x2b')](_0x22efb7);fs['chmodSync'](_0x336afb,_0x0d2f('0x2d'));}catch(_0xe46cd6){logger['error'](_0xe46cd6);}return _0x336afb[_0x0d2f('0x3b')]('.')[0x0];});};exports['ispeechASR']=function(_0x2e4ecd,_0x1deaf8,_0x5b20ee,_0x2be320){var _0x2dc01c=util['format'](_0x0d2f('0x7c'),ISPEECH_API,_0x1deaf8,_0x5b20ee,base64Encode(_0x2e4ecd),_0x2be320?util[_0x0d2f('0x7d')](_0x0d2f('0x7e'),encodeURIComponent(_0x2be320)):_0x0d2f('0x7f'));return uploadFile(_0x2dc01c)[_0x0d2f('0x2a')](function(_0x158116){return querystring['parse'](_0x158116);});};exports['sestekNDA']=function(_0x11fac7,_0x1c2d08){return sestek[_0x0d2f('0x80')](_0x11fac7,_0x1c2d08)[_0x0d2f('0x2a')](function(_0xc1b6c9){logger[_0x0d2f('0x1d')](JSON[_0x0d2f('0x40')](_0xc1b6c9));var _0x125258={'speech':_0xc1b6c9[_0x0d2f('0x81')],'action':_0xc1b6c9['channelData']?_0xc1b6c9[_0x0d2f('0x82')][_0x0d2f('0x83')]:undefined,'actiondata':_0xc1b6c9[_0x0d2f('0x82')]?_0xc1b6c9[_0x0d2f('0x82')][_0x0d2f('0x84')]:undefined};if(_0xc1b6c9[_0x0d2f('0x82')]&&_0xc1b6c9[_0x0d2f('0x82')][_0x0d2f('0x85')]){return base64Decode(_0xc1b6c9[_0x0d2f('0x82')][_0x0d2f('0x85')][_0x0d2f('0x86')],path['resolve'](__dirname,_0x0d2f('0x38'),rs['generate'](0x4)+_0x0d2f('0x27')))[_0x0d2f('0x2a')](function(_0x44dfad){_0x125258[_0x0d2f('0x87')]=_0x44dfad;return _0x125258;});}return _0x125258;});};exports[_0x0d2f('0x88')]=function(){return __dirname;}; \ No newline at end of file +var _0xfded=['text','channelData','CustomAction','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','https','md5','path','request-promise','randomstring','google-tts-api','url','parse','util','./aws','./google','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','createWriteStream','info','finish\x20download\x20file','close','error','unlink','download\x20error','pipe','end','statusMessage','error\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','base64','then','777','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','.mp3','from','audioContent','writeFile','googleCloudTTS\x20path','googleTTS','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','length','\x22\x20might\x20not\x20exist','split','googleASR','asr','uri','map','alternatives','transcript','results','confidence','join','googleASR\x20confidence','catch','[%s]\x20%s:%s','message','textRequest','result','source','resolvedQuery','fulfillment','speech','score','status','code','metadata','endConversation','replace','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','action','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','name','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','fulfillmentText','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','chmodSync','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','nda'];(function(_0x1742e0,_0x47f52b){var _0x3bc1b5=function(_0x3905a8){while(--_0x3905a8){_0x1742e0['push'](_0x1742e0['shift']());}};_0x3bc1b5(++_0x47f52b);}(_0xfded,0x1a5));var _0xdfde=function(_0x56a616,_0x5a3c7c){_0x56a616=_0x56a616-0x0;var _0xe94844=_0xfded[_0x56a616];return _0xe94844;};'use strict';var apiai=require(_0xdfde('0x0'));var BPromise=require(_0xdfde('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require('http');var https=require(_0xdfde('0x2'));var md5=require(_0xdfde('0x3'));var path=require(_0xdfde('0x4'));var querystring=require('querystring');var rp=require(_0xdfde('0x5'));var rs=require(_0xdfde('0x6'));var sox=require('sox');var tts=require(_0xdfde('0x7'));var urlParse=require(_0xdfde('0x8'))[_0xdfde('0x9')];var util=require(_0xdfde('0xa'));var aws=require(_0xdfde('0xb'));var google=require(_0xdfde('0xc'));var sestek=require(_0xdfde('0xd'));var tilde=require(_0xdfde('0xe'));var logger=require(_0xdfde('0xf'))(_0xdfde('0x10'));var ISPEECH_API=_0xdfde('0x11');function downloadFile(_0x2c29b3,_0x40abe5){return new BPromise(function(_0x49ea6c,_0x2c2568){var _0x584c04=urlParse(_0x2c29b3);var _0x4a30fe=_0x584c04[_0xdfde('0x12')]===_0xdfde('0x13')?https:http;var _0x1b08d2={'host':_0x584c04[_0xdfde('0x14')],'path':_0x584c04[_0xdfde('0x4')],'headers':{'user-agent':_0xdfde('0x15')}};_0x4a30fe[_0xdfde('0x16')](_0x1b08d2,function(_0x2c3c7c){if(_0x2c3c7c[_0xdfde('0x17')]!==0xc8){logger['error'](_0xdfde('0x18')+_0x2c29b3+_0xdfde('0x19')+_0x2c3c7c[_0xdfde('0x17')]+'\x20('+_0x2c3c7c['statusMessage']+')');_0x2c2568(new Error(_0xdfde('0x18')+_0x2c29b3+_0xdfde('0x19')+_0x2c3c7c[_0xdfde('0x17')]+'\x20('+_0x2c3c7c['statusMessage']+')'));return;}var _0x3b98ce=fs[_0xdfde('0x1a')](_0x40abe5);_0x3b98ce['on']('finish',function(){logger[_0xdfde('0x1b')](_0xdfde('0x1c'));_0x3b98ce[_0xdfde('0x1d')](_0x49ea6c);});_0x3b98ce['on'](_0xdfde('0x1e'),function(_0x2b76c7){fs[_0xdfde('0x1f')](_0x40abe5);logger[_0xdfde('0x1e')](_0xdfde('0x20'),_0x2b76c7);_0x2c2568(_0x2b76c7);});_0x2c3c7c[_0xdfde('0x21')](_0x3b98ce);})['on'](_0xdfde('0x1e'),function(_0x38b084){logger[_0xdfde('0x1e')](_0x38b084);_0x2c2568(_0x38b084);})[_0xdfde('0x22')]();});}function uploadFile(_0x37481b){return new BPromise(function(_0x554a41,_0x12e2b6){var _0x37188c=urlParse(_0x37481b);var _0x567355=_0x37188c[_0xdfde('0x12')]===_0xdfde('0x13')?https:http;var _0x50f676={'host':_0x37188c[_0xdfde('0x14')],'path':_0x37188c['path'],'headers':{'user-agent':_0xdfde('0x15')}};_0x567355[_0xdfde('0x16')](_0x50f676,function(_0x14768b){if(_0x14768b[_0xdfde('0x17')]!==0xc8){_0x12e2b6(new Error(_0xdfde('0x18')+_0x37481b+'\x20failed,\x20status\x20code\x20=\x20'+_0x14768b[_0xdfde('0x17')]+'\x20('+_0x14768b[_0xdfde('0x23')]+')'));return;}var _0x3e33a0='';_0x14768b['on']('data',function(_0x217e1c){_0x3e33a0+=_0x217e1c;});_0x14768b['on'](_0xdfde('0x22'),function(){_0x554a41(_0x3e33a0);});})['on'](_0xdfde('0x1e'),function(_0x4b722f){_0x12e2b6(_0x4b722f);})[_0xdfde('0x22')]();});}function convertFile(_0x36fdda,_0x290bd0){return new BPromise(function(_0x23479b,_0x16a9fb){var _0x5baeb6=sox['transcode'](_0x36fdda,_0x290bd0,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5baeb6['on'](_0xdfde('0x1e'),function(_0x9d2a71){logger[_0xdfde('0x1e')](_0xdfde('0x24'),_0x9d2a71);_0x16a9fb(_0x9d2a71);});_0x5baeb6['on'](_0xdfde('0x22'),function(){logger['info']('finish\x20to\x20convert');_0x23479b();});_0x5baeb6[_0xdfde('0x25')]();});}function base64Decode(_0x9b6c11,_0x5cbbdb){var _0xe18c0=path[_0xdfde('0x26')](__dirname,_0xdfde('0x27'),rs[_0xdfde('0x28')](0x4)+_0xdfde('0x29'));fs[_0xdfde('0x2a')](_0xe18c0,_0x9b6c11,_0xdfde('0x2b'));return convertFile(_0xe18c0,_0x5cbbdb)[_0xdfde('0x2c')](function(){try{fs[_0xdfde('0x1f')](_0xe18c0);fs['chmodSync'](_0x5cbbdb,_0xdfde('0x2d'));}catch(_0x33546a){logger[_0xdfde('0x1e')](_0x33546a);}return _0x5cbbdb['split']('.')[0x0];});}function base64Encode(_0x44fa68){var _0x3eee48=fs[_0xdfde('0x2e')](_0x44fa68);return new Buffer(_0x3eee48)[_0xdfde('0x2f')](_0xdfde('0x2b'));}exports[_0xdfde('0x30')]=function(_0xbf0e93,_0x1ab305,_0x2ff800,_0x4f0ab9,_0x397fb0,_0x268b33){var _0x264c9a,_0x77a07e;var _0x114c84=_0xdfde('0x31');var _0xe892d8='?key='+_0xbf0e93;var _0x53bdda={};if(_0x1ab305===_0xdfde('0x32')){_0x53bdda[_0xdfde('0x33')]={'ssml':_0x2ff800};}else{_0x53bdda['input']={'text':_0x2ff800};};_0x53bdda[_0xdfde('0x34')]={'languageCode':_0x4f0ab9,'ssmlGender':_0x397fb0};_0x53bdda[_0xdfde('0x35')]={'audioEncoding':_0xdfde('0x36'),'sampleRateHertz':0x1f40};var _0x1fca10={'url':_0x114c84+_0xdfde('0x37')+_0xe892d8,'method':_0xdfde('0x38'),'json':!![],'body':_0x53bdda};return rp(_0x1fca10)[_0xdfde('0x2c')](function(_0x1e725d){return new BPromise(function(_0x41c229,_0x40ca5e){_0x264c9a=path[_0xdfde('0x26')](__dirname,_0xdfde('0x27'),rs[_0xdfde('0x28')](0x4)+_0xdfde('0x39'));var _0x542df6=Buffer[_0xdfde('0x3a')](_0x1e725d[_0xdfde('0x3b')],_0xdfde('0x2b'));return fs[_0xdfde('0x3c')](_0x264c9a,_0x542df6,function(_0x102533){_0x40ca5e(_0x102533);},function(_0x288052){fs['chmodSync'](_0x264c9a,_0xdfde('0x2d'));_0x41c229(_0x288052);});});})[_0xdfde('0x2c')](function(_0x437b10){_0x77a07e=path[_0xdfde('0x26')](__dirname,_0xdfde('0x27'),rs['generate'](0x4)+_0xdfde('0x29'));return convertFile(_0x264c9a,_0x77a07e);})['then'](function(){try{fs[_0xdfde('0x1f')](_0x264c9a);fs['chmodSync'](_0x77a07e,'777');}catch(_0x6a1078){logger['error'](_0x6a1078);}logger[_0xdfde('0x1b')](_0xdfde('0x3d'),_0x77a07e['split']('.')[0x0]);return _0x77a07e['split']('.')[0x0];});};exports[_0xdfde('0x3e')]=function(_0x1e3687,_0x136293){var _0x3566b4='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x3117eb,_0x5d796b;var _0x191408;var _0x208fe5={'encoding':'utf8','method':'POST','timeout':0x2710,'url':_0x3566b4,'headers':{'Content-Type':_0xdfde('0x3f')},'body':_0xdfde('0x40')+encodeURIComponent(JSON[_0xdfde('0x41')]([[[_0xdfde('0x42'),JSON['stringify']([_0x1e3687,_0x136293||'en',![],_0xdfde('0x43')]),null,_0xdfde('0x44')]]]))};return rp(_0x208fe5)['then'](function(_0x553261){try{_0x191408=eval(_0x553261[_0xdfde('0x45')](0x5))[0x0][0x2];}catch(_0xf608d6){throw new Error(_0xdfde('0x46')+_0x553261['data']);}if(!_0x191408){if(_0x1e3687[_0xdfde('0x47')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error('lang\x20\x22'+_0x136293+_0xdfde('0x48'));}}try{_0x191408=eval(_0x191408)[0x0];}catch(_0x3edb01){throw new Error(_0xdfde('0x46')+res['data']);}const _0x246a2e=_0x191408;_0x3117eb=path['resolve'](__dirname,_0xdfde('0x27'),rs['generate'](0x4)+_0xdfde('0x39'));fs[_0xdfde('0x2a')](_0x3117eb,_0x191408,{'encoding':_0xdfde('0x2b')});_0x5d796b=path[_0xdfde('0x26')](__dirname,_0xdfde('0x27'),rs[_0xdfde('0x28')](0x4)+_0xdfde('0x29'));return convertFile(_0x3117eb,_0x5d796b);})[_0xdfde('0x2c')](function(){try{fs[_0xdfde('0x1f')](_0x3117eb);fs['chmodSync'](_0x5d796b,_0xdfde('0x2d'));}catch(_0xebd52b){logger['error'](_0xebd52b);}logger[_0xdfde('0x1b')]('goggleTTS\x20path',_0x5d796b[_0xdfde('0x49')]('.')[0x0]);return _0x5d796b[_0xdfde('0x49')]('.')[0x0];});};exports[_0xdfde('0x4a')]=function(_0x16485b,_0x2ebe05,_0x46ba3b){return google[_0xdfde('0x4b')](_0x16485b,_0x2ebe05,_0x46ba3b)[_0xdfde('0x2c')](function(_0x5d9bdf){logger[_0xdfde('0x1b')](_0x5d9bdf[_0xdfde('0x4c')]);return rp(_0x5d9bdf);})[_0xdfde('0x2c')](function(_0x2d74aa){var _0xe35d25='';var _0x52ec7c=0x0;try{fs[_0xdfde('0x1f')](_0x16485b);}catch(_0x53215d){logger['error'](_0x53215d);}if(_0x2d74aa&&_0x2d74aa['results']){_0xe35d25=_0x2d74aa['results'][_0xdfde('0x4d')](function(_0x58bf19){return _0x58bf19&&_0x58bf19['alternatives'][0x0]&&_0x58bf19[_0xdfde('0x4e')][0x0][_0xdfde('0x4f')]?_0x58bf19[_0xdfde('0x4e')][0x0]['transcript']:'';})['join']('\x0a');_0x52ec7c=_0x2d74aa[_0xdfde('0x50')]['map'](function(_0x13530b){return _0x13530b&&_0x13530b[_0xdfde('0x4e')][0x0]&&_0x13530b[_0xdfde('0x4e')][0x0][_0xdfde('0x51')]?_0x13530b[_0xdfde('0x4e')][0x0][_0xdfde('0x51')]:0x0;})[_0xdfde('0x52')]('\x0a');}logger[_0xdfde('0x1b')]('googleASR\x20transcription',_0xe35d25);logger[_0xdfde('0x1b')](_0xdfde('0x53'),_0x52ec7c);return{'transcript':_0xe35d25,'confidence':_0x52ec7c};})[_0xdfde('0x54')](function(_0x193f12){logger[_0xdfde('0x1e')](_0xdfde('0x55'),_0x193f12[_0xdfde('0x17')],_0x193f12['name'],_0x193f12[_0xdfde('0x56')]);});};exports['googleDialogflow']=function(_0x1be820,_0x2c451a,_0x20e800,_0x378374){var _0xd0a206=apiai(_0x2c451a,{'language':_0x378374||'en'});return _0xd0a206[_0xdfde('0x57')](_0x20e800,{'sessionId':md5(_0x1be820)})[_0xdfde('0x2c')](function(_0x549483){logger['info'](JSON[_0xdfde('0x41')](_0x549483));return{'source':_0x549483[_0xdfde('0x58')][_0xdfde('0x59')],'resolvedQuery':_0x549483[_0xdfde('0x58')][_0xdfde('0x5a')],'action':_0x549483[_0xdfde('0x58')]['action'],'actionIncomplete':_0x549483[_0xdfde('0x58')]['actionIncomplete'],'speech':_0x549483[_0xdfde('0x58')][_0xdfde('0x5b')][_0xdfde('0x5c')],'score':_0x549483[_0xdfde('0x58')][_0xdfde('0x5d')],'statusCode':_0x549483[_0xdfde('0x5e')][_0xdfde('0x5f')],'endConversation':_0x549483[_0xdfde('0x58')][_0xdfde('0x60')][_0xdfde('0x61')]||![],'isFallbackIntent':_0x549483[_0xdfde('0x58')][_0xdfde('0x60')]['isFallbackIntent']};});};exports['googleDialogflowV2']=function(_0x4f8013,_0x4a6e52,_0x1dd302,_0x4a32c5,_0x547c28,_0x4109ed){var _0x189ccd=_0x4a32c5[_0xdfde('0x62')](/\\n/g,'\x0a');var _0x3bfdd7={'credentials':{'private_key':_0x189ccd,'client_email':_0x1dd302}};var _0x10770d=new dialogflow['SessionsClient'](_0x3bfdd7);var _0x15018d=_0x10770d[_0xdfde('0x63')](_0x4a6e52,md5(_0x4f8013));var _0x498b8b={'session':_0x15018d,'queryInput':{'text':{'text':_0x547c28,'languageCode':_0x4109ed}}};return _0x10770d[_0xdfde('0x64')](_0x498b8b)[_0xdfde('0x2c')](function(_0x19d743){if(_0x19d743&&_0x19d743['length']){logger[_0xdfde('0x1b')](_0xdfde('0x65'),JSON[_0xdfde('0x41')](_0x19d743));var _0x495ab7=_0x19d743[0x0];if(_0x495ab7){var _0x774e2f={'action':_0x495ab7[_0xdfde('0x66')][_0xdfde('0x67')],'allRequiredParamsPresent':_0x495ab7[_0xdfde('0x66')][_0xdfde('0x68')],'endConversation':_0x495ab7[_0xdfde('0x66')][_0xdfde('0x69')]&&_0x495ab7[_0xdfde('0x66')]['diagnosticInfo'][_0xdfde('0x6a')]?_0x495ab7['queryResult']['diagnosticInfo'][_0xdfde('0x6a')][_0xdfde('0x6b')]['boolValue']:![],'fulfillmentText':_0x495ab7[_0xdfde('0x66')]['fulfillmentText'],'intentName':_0x495ab7[_0xdfde('0x66')]['intent'][_0xdfde('0x6c')],'intentDisplayName':_0x495ab7[_0xdfde('0x66')][_0xdfde('0x6d')][_0xdfde('0x6e')],'isFallbackIntent':_0x495ab7['queryResult'][_0xdfde('0x6d')][_0xdfde('0x6f')],'languageCode':_0x495ab7[_0xdfde('0x66')][_0xdfde('0x70')],'queryText':_0x495ab7['queryResult'][_0xdfde('0x71')],'responseId':_0x495ab7[_0xdfde('0x72')],'score':_0x495ab7[_0xdfde('0x66')][_0xdfde('0x73')],'speech':_0x495ab7[_0xdfde('0x66')][_0xdfde('0x74')],'providerResponse':JSON['stringify'](_0x19d743)};return _0x774e2f;}}});};exports[_0xdfde('0x75')]=function(_0x520a1c,_0x2487e0,_0x4f2fa0,_0x1352ca){return tilde['asr'](_0x520a1c,_0x2487e0,_0x4f2fa0,_0x1352ca)[_0xdfde('0x2c')](function(_0x31c3e6){try{fs['unlink'](_0x520a1c);}catch(_0x1238c7){logger['error'](_0x1238c7);}logger[_0xdfde('0x1b')](_0xdfde('0x76'),_0x31c3e6['transcript']);logger[_0xdfde('0x1b')](_0xdfde('0x77'),_0x31c3e6[_0xdfde('0x51')]);return _0x31c3e6;});};exports[_0xdfde('0x78')]=function(_0x23ec32,_0x2b07e4,_0x58d9af,_0x136568,_0x3d64b9,_0x3a2dbb){var _0x42fd9d=path[_0xdfde('0x26')](__dirname,_0xdfde('0x27'),rs[_0xdfde('0x28')](0x4)+_0xdfde('0x39'));var _0x2f7ab8;return aws[_0xdfde('0x79')](_0x23ec32,_0x2b07e4,_0x58d9af,_0x136568,_0x3d64b9,_0x3a2dbb,_0x42fd9d)['then'](function(){_0x2f7ab8=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0xdfde('0x29'));return convertFile(_0x42fd9d,_0x2f7ab8);})[_0xdfde('0x2c')](function(){try{fs['unlink'](_0x42fd9d);fs['chmodSync'](_0x2f7ab8,_0xdfde('0x2d'));}catch(_0x1133b9){logger[_0xdfde('0x1e')](_0x1133b9);}return _0x2f7ab8['split']('.')[0x0];});};exports[_0xdfde('0x7a')]=function(_0x5882d7,_0x419170,_0x25c4b1,_0x19ad54,_0x4bff1b,_0xc9bd06){return aws[_0xdfde('0x7b')](_0x5882d7,_0x419170,_0x25c4b1,_0x19ad54,_0x4bff1b,_0xc9bd06)['then'](function(_0x3037f4){logger[_0xdfde('0x1b')](JSON['stringify'](_0x3037f4));return _0x3037f4;});};exports[_0xdfde('0x7c')]=function(_0x3c0347,_0x3aa7bd,_0x4aaefe,_0x5a6e68){var _0x7cb0d0=util[_0xdfde('0x7d')](_0xdfde('0x7e'),ISPEECH_API,_0x3c0347,encodeURIComponent(_0x3aa7bd),_0x4aaefe,_0x5a6e68);var _0x4ffbbf=path[_0xdfde('0x26')](__dirname,_0xdfde('0x27'),rs[_0xdfde('0x28')](0x4)+_0xdfde('0x39'));var _0x3321aa;return downloadFile(_0x7cb0d0,_0x4ffbbf)['then'](function(){_0x3321aa=path[_0xdfde('0x26')](__dirname,_0xdfde('0x27'),rs[_0xdfde('0x28')](0x4)+_0xdfde('0x29'));return convertFile(_0x4ffbbf,_0x3321aa);})[_0xdfde('0x2c')](function(){try{fs[_0xdfde('0x1f')](_0x4ffbbf);fs[_0xdfde('0x7f')](_0x3321aa,'777');}catch(_0x28be4f){logger[_0xdfde('0x1e')](_0x28be4f);}return _0x3321aa[_0xdfde('0x49')]('.')[0x0];});};exports['ispeechASR']=function(_0x2510dc,_0x58c0b3,_0x4d50c1,_0x393c35){var _0x1bb26f=util[_0xdfde('0x7d')](_0xdfde('0x80'),ISPEECH_API,_0x58c0b3,_0x4d50c1,base64Encode(_0x2510dc),_0x393c35?util[_0xdfde('0x7d')](_0xdfde('0x81'),encodeURIComponent(_0x393c35)):'freeform=3');return uploadFile(_0x1bb26f)[_0xdfde('0x2c')](function(_0x425dad){return querystring[_0xdfde('0x9')](_0x425dad);});};exports['sestekNDA']=function(_0x24e2a9,_0x3920c4){return sestek[_0xdfde('0x82')](_0x24e2a9,_0x3920c4)[_0xdfde('0x2c')](function(_0x3b76a0){logger[_0xdfde('0x1b')](JSON[_0xdfde('0x41')](_0x3b76a0));var _0x35aad3={'speech':_0x3b76a0[_0xdfde('0x83')],'action':_0x3b76a0[_0xdfde('0x84')]?_0x3b76a0[_0xdfde('0x84')][_0xdfde('0x85')]:undefined,'actiondata':_0x3b76a0[_0xdfde('0x84')]?_0x3b76a0[_0xdfde('0x84')]['CustomActionData']:undefined};if(_0x3b76a0[_0xdfde('0x84')]&&_0x3b76a0[_0xdfde('0x84')][_0xdfde('0x86')]){return base64Decode(_0x3b76a0[_0xdfde('0x84')][_0xdfde('0x86')][_0xdfde('0x87')],path[_0xdfde('0x26')](__dirname,_0xdfde('0x27'),rs[_0xdfde('0x28')](0x4)+_0xdfde('0x29')))[_0xdfde('0x2c')](function(_0x3e6c41){_0x35aad3[_0xdfde('0x88')]=_0x3e6c41;return _0x35aad3;});}return _0x35aad3;});};exports[_0xdfde('0x89')]=function(){return __dirname;}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/index.js b/server/services/agi/scripts/sestek/index.js index 98afa90..234394f 100644 --- a/server/services/agi/scripts/sestek/index.js +++ b/server/services/agi/scripts/sestek/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a68=['exports','./nda'];(function(_0x55065b,_0x7d5de6){var _0x30869b=function(_0xfa70b){while(--_0xfa70b){_0x55065b['push'](_0x55065b['shift']());}};_0x30869b(++_0x7d5de6);}(_0x7a68,0x1df));var _0x87a6=function(_0x34a161,_0x52a77b){_0x34a161=_0x34a161-0x0;var _0x4412a1=_0x7a68[_0x34a161];return _0x4412a1;};var nda=require(_0x87a6('0x0'));module[_0x87a6('0x1')]={'nda':nda}; \ No newline at end of file +var _0xb539=['./nda'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0xb539,0x11e));var _0x9b53=function(_0x5e51d3,_0x211dcf){_0x5e51d3=_0x5e51d3-0x0;var _0x157e65=_0xb539[_0x5e51d3];return _0x157e65;};var nda=require(_0x9b53('0x0'));module['exports']={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index c166152..08b3ce3 100644 --- a/server/services/agi/scripts/sestek/nda/index.js +++ b/server/services/agi/scripts/sestek/nda/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd691=['audio/wav','CustomAction','custom_action','custom_action_data','info','stringify','request-promise','url','../../../../../config/logger','exports','POST','resolve','ndauth_url','/token','password','username','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message','Nda','uniqueid','callerid','calleridname','text','Bearer\x20','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings'];(function(_0x19e655,_0x5901c7){var _0x5e7c82=function(_0x2f3fb4){while(--_0x2f3fb4){_0x19e655['push'](_0x19e655['shift']());}};_0x5e7c82(++_0x5901c7);}(_0xd691,0xe6));var _0x1d69=function(_0xcdac34,_0x43f665){_0xcdac34=_0xcdac34-0x0;var _0x269d23=_0xd691[_0xcdac34];return _0x269d23;};'use strict';var rp=require(_0x1d69('0x0'));var url=require(_0x1d69('0x1'));var logger=require(_0x1d69('0x2'))('agi');module[_0x1d69('0x3')]=function(_0x44899f,_0x32502d){var _0x3dc1c9={'method':_0x1d69('0x4'),'uri':url[_0x1d69('0x5')](_0x32502d[_0x1d69('0x6')],_0x1d69('0x7')),'form':{'grant_type':_0x1d69('0x8'),'username':_0x32502d[_0x1d69('0x9')],'password':_0x32502d['password']},'json':!![]};return rp(_0x3dc1c9)['then'](function(_0x267da3){var _0x49f008={'method':_0x1d69('0x4'),'uri':url[_0x1d69('0x5')](_0x32502d[_0x1d69('0xa')],_0x1d69('0xb')),'body':{'type':_0x32502d['ndaactivity_type']||_0x1d69('0xc'),'channelId':_0x1d69('0xd'),'conversation':{'id':_0x44899f[_0x1d69('0xe')]},'from':{'id':_0x44899f[_0x1d69('0xf')],'name':_0x44899f[_0x1d69('0x10')]},'recipient':{'id':_0x44899f['dnid'],'name':_0x44899f['extension']},'text':_0x32502d[_0x1d69('0x11')],'channelData':{}},'headers':{'Authorization':_0x1d69('0x12')+_0x267da3[_0x1d69('0x13')]},'json':!![]};if(_0x32502d[_0x1d69('0x14')]){_0x49f008[_0x1d69('0x15')][_0x1d69('0x16')][_0x1d69('0x17')]=_0x32502d[_0x1d69('0x14')];}if(_0x32502d[_0x1d69('0x18')]=='1'){_0x49f008[_0x1d69('0x15')][_0x1d69('0x16')][_0x1d69('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x1d69('0x1a')};}if(_0x32502d['custom_action']){_0x49f008['body'][_0x1d69('0x16')][_0x1d69('0x1b')]=_0x32502d[_0x1d69('0x1c')];if(_0x32502d[_0x1d69('0x1d')]){_0x49f008[_0x1d69('0x15')][_0x1d69('0x16')]['CustomActionData']=_0x32502d[_0x1d69('0x1d')];}}logger[_0x1d69('0x1e')](JSON[_0x1d69('0x1f')](_0x49f008));return rp(_0x49f008);});}; \ No newline at end of file +var _0xfd6f=['ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','POST','resolve','/token','password','username','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','uniqueid','dnid','extension','text','access_token','project','channelData'];(function(_0x55dd5b,_0x4f547c){var _0x447d1c=function(_0x2343df){while(--_0x2343df){_0x55dd5b['push'](_0x55dd5b['shift']());}};_0x447d1c(++_0x4f547c);}(_0xfd6f,0x19d));var _0xffd6=function(_0x1c9d1d,_0x1a1d2a){_0x1c9d1d=_0x1c9d1d-0x0;var _0x201975=_0xfd6f[_0x1c9d1d];return _0x201975;};'use strict';var rp=require(_0xffd6('0x0'));var url=require(_0xffd6('0x1'));var logger=require(_0xffd6('0x2'))(_0xffd6('0x3'));module[_0xffd6('0x4')]=function(_0x595470,_0xb84411){var _0x1e3b9b={'method':_0xffd6('0x5'),'uri':url[_0xffd6('0x6')](_0xb84411['ndauth_url'],_0xffd6('0x7')),'form':{'grant_type':_0xffd6('0x8'),'username':_0xb84411[_0xffd6('0x9')],'password':_0xb84411[_0xffd6('0x8')]},'json':!![]};return rp(_0x1e3b9b)['then'](function(_0x3f9538){var _0x534a1b={'method':'POST','uri':url['resolve'](_0xb84411[_0xffd6('0xa')],_0xffd6('0xb')),'body':{'type':_0xb84411[_0xffd6('0xc')]||_0xffd6('0xd'),'channelId':'Nda','conversation':{'id':_0x595470[_0xffd6('0xe')]},'from':{'id':_0x595470['callerid'],'name':_0x595470['calleridname']},'recipient':{'id':_0x595470[_0xffd6('0xf')],'name':_0x595470[_0xffd6('0x10')]},'text':_0xb84411[_0xffd6('0x11')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x3f9538[_0xffd6('0x12')]},'json':!![]};if(_0xb84411[_0xffd6('0x13')]){_0x534a1b['body'][_0xffd6('0x14')][_0xffd6('0x15')]=_0xb84411[_0xffd6('0x13')];}if(_0xb84411[_0xffd6('0x16')]=='1'){_0x534a1b['body']['channelData'][_0xffd6('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xffd6('0x18')};}if(_0xb84411[_0xffd6('0x19')]){_0x534a1b['body'][_0xffd6('0x14')][_0xffd6('0x1a')]=_0xb84411['custom_action'];if(_0xb84411[_0xffd6('0x1b')]){_0x534a1b['body'][_0xffd6('0x14')][_0xffd6('0x1c')]=_0xb84411[_0xffd6('0x1b')];}}logger[_0xffd6('0x1d')](JSON[_0xffd6('0x1e')](_0x534a1b));return rp(_0x534a1b);});}; \ No newline at end of file diff --git a/server/services/agi/scripts/tilde/asr/index.js b/server/services/agi/scripts/tilde/asr/index.js index a6fb4a1..7c3e35f 100644 --- a/server/services/agi/scripts/tilde/asr/index.js +++ b/server/services/agi/scripts/tilde/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaed1=['./lib/api','exports'];(function(_0x4da2e1,_0x379552){var _0x2c9e92=function(_0x1acab2){while(--_0x1acab2){_0x4da2e1['push'](_0x4da2e1['shift']());}};_0x2c9e92(++_0x379552);}(_0xaed1,0x1ba));var _0x1aed=function(_0x18fec8,_0x31d0cd){_0x18fec8=_0x18fec8-0x0;var _0x5e400c=_0xaed1[_0x18fec8];return _0x5e400c;};'use strict';var asr=require(_0x1aed('0x0'));module[_0x1aed('0x1')]=function(_0x6a3afa,_0x14420d,_0x3198ec,_0x1f0415){return asr(_0x6a3afa,_0x14420d,_0x3198ec,_0x1f0415);}; \ No newline at end of file +var _0x4c1b=['exports','./lib/api'];(function(_0x1583da,_0x351014){var _0x2c73c1=function(_0x4943fd){while(--_0x4943fd){_0x1583da['push'](_0x1583da['shift']());}};_0x2c73c1(++_0x351014);}(_0x4c1b,0xc5));var _0xb4c1=function(_0x1a37da,_0x171127){_0x1a37da=_0x1a37da-0x0;var _0x5da8c1=_0x4c1b[_0x1a37da];return _0x5da8c1;};'use strict';var asr=require(_0xb4c1('0x0'));module[_0xb4c1('0x1')]=function(_0x5cbc4c,_0x59ba6f,_0x50b310,_0x254276){return asr(_0x5cbc4c,_0x59ba6f,_0x50b310,_0x254276);}; \ No newline at end of file diff --git a/server/services/agi/scripts/tilde/asr/lib/api.js b/server/services/agi/scripts/tilde/asr/lib/api.js index c24d9a4..b68f553 100644 --- a/server/services/agi/scripts/tilde/asr/lib/api.js +++ b/server/services/agi/scripts/tilde/asr/lib/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0074=['update','hex','Open\x20Tilde\x20ASR\x20socket','send','stringify','createReadStream','close','EOS','error','Tilde\x20ASR\x20send\x20error','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','terminate','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','bluebird','lodash','../../../../../../config/logger','agi','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1'];(function(_0x3f8d17,_0x5851dc){var _0x3e6914=function(_0x56f707){while(--_0x56f707){_0x3f8d17['push'](_0x3f8d17['shift']());}};_0x3e6914(++_0x5851dc);}(_0x0074,0x145));var _0x4007=function(_0x4200f2,_0x2baf7a){_0x4200f2=_0x4200f2-0x0;var _0x5a2a85=_0x0074[_0x4200f2];return _0x5a2a85;};'use strict';var BPromise=require(_0x4007('0x0'));var _=require(_0x4007('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require('crypto');var logger=require(_0x4007('0x2'))(_0x4007('0x3'));module['exports']=function(_0x4f6210,_0x28c0ef,_0x3f5254,_0x275f7c){return new BPromise(function(_0x2b0cb1,_0x5a7b33){logger[_0x4007('0x4')]('Tilde\x20URI',_0x275f7c||_0x4007('0x5'));var _0x564fe5=new WebSocket(_0x275f7c||_0x4007('0x5'),{'perMessageDeflate':![]});var _0x3c4ab7='';var _0x1589d2='0';var _0x3ac6f8='1';var _0x55d316='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x3d3218(_0x464aa9){var _0x16c859=crypto[_0x4007('0x6')](_0x4007('0x7'));_0x16c859[_0x4007('0x8')](_0x464aa9);return _0x16c859['digest'](_0x4007('0x9'));}function _0x587181(){try{logger[_0x4007('0x4')](_0x4007('0xa'));var _0x2f3694=moment()['unix']();var _0x4f1a20=_0x3d3218(_0x2f3694+_0x28c0ef+_0x3f5254);_0x564fe5[_0x4007('0xb')](JSON[_0x4007('0xc')]({'appID':_0x28c0ef,'timestamp':_0x2f3694,'appKey':_0x4f1a20}));var _0x225f6d=fs[_0x4007('0xd')](_0x4f6210);_0x225f6d['on']('data',function(_0x356648){_0x564fe5[_0x4007('0xb')](_0x356648);});_0x225f6d['on'](_0x4007('0xe'),function(){_0x564fe5[_0x4007('0xb')](_0x4007('0xf'));});}catch(_0x49314e){logger[_0x4007('0x10')](_0x4007('0x11'),JSON[_0x4007('0xc')](_0x49314e));_0x564fe5['terminate']();}}function _0x18e3c2(_0x32a399){try{if(_0x32a399){var _0x2069e5=JSON[_0x4007('0x12')](_0x32a399);switch(_0x2069e5[_0x4007('0x13')]){case 0x0:if(_0x2069e5[_0x4007('0x14')]){if(_0x2069e5[_0x4007('0x14')][_0x4007('0x15')]){logger[_0x4007('0x4')](_0x4007('0x16'),JSON['stringify'](_0x2069e5[_0x4007('0x14')]['hypotheses']));_0x3c4ab7=_0x2069e5[_0x4007('0x14')][_0x4007('0x17')][0x0][_0x4007('0x18')];_0x1589d2=_0x2069e5['result'][_0x4007('0x17')][0x0][_0x4007('0x19')];_0x3ac6f8='0';_0x55d316='Success.';_0x564fe5[_0x4007('0x1a')]();}}break;case 0x1:logger[_0x4007('0x4')](_0x4007('0x1b'));_0x3ac6f8='1';_0x55d316='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0x4007('0x4')](_0x4007('0x1c'));_0x3ac6f8='2';_0x55d316=_0x4007('0x1c');break;case 0x9:logger[_0x4007('0x4')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x3ac6f8='9';_0x55d316=_0x4007('0x1d');break;case 0xa:logger[_0x4007('0x4')](_0x4007('0x1e'));_0x3ac6f8='10';_0x55d316='Authentication\x20failed.';break;case 0xb:logger['info'](_0x4007('0x1f'));_0x3ac6f8='11';_0x55d316=_0x4007('0x1f');}}}catch(_0x27f4ac){logger[_0x4007('0x10')](_0x4007('0x20'),JSON[_0x4007('0xc')](_0x27f4ac));_0x564fe5[_0x4007('0x1a')]();}}function _0xe454df(){logger[_0x4007('0x4')](_0x4007('0x21'));_0x2b0cb1({'transcript':_0x3c4ab7,'confidence':_0x1589d2,'status':_0x3ac6f8,'status_message':_0x55d316});}function _0x5103e4(_0x24fffa){logger['error'](_0x4007('0x22'));if(!_[_0x4007('0x23')](_0x24fffa)){logger['error'](_[_0x4007('0x24')](_0x24fffa)?JSON['stringify'](_0x24fffa):_0x24fffa);}}_0x564fe5['on']('open',_0x587181);_0x564fe5['on']('message',_0x18e3c2);_0x564fe5['on']('close',_0xe454df);_0x564fe5['on'](_0x4007('0x10'),_0x5103e4);});}; \ No newline at end of file +var _0x7c5b=['info','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','lodash','moment','crypto','agi','exports','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','sha1','update','digest','hex'];(function(_0x9b7daf,_0x1de6f1){var _0x3756cd=function(_0x431091){while(--_0x431091){_0x9b7daf['push'](_0x9b7daf['shift']());}};_0x3756cd(++_0x1de6f1);}(_0x7c5b,0xd0));var _0xb7c5=function(_0x44e1c4,_0x13efe2){_0x44e1c4=_0x44e1c4-0x0;var _0x52b155=_0x7c5b[_0x44e1c4];return _0x52b155;};'use strict';var BPromise=require(_0xb7c5('0x0'));var _=require(_0xb7c5('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xb7c5('0x2'));var crypto=require(_0xb7c5('0x3'));var logger=require('../../../../../../config/logger')(_0xb7c5('0x4'));module[_0xb7c5('0x5')]=function(_0x782e2,_0x152f10,_0x7755cd,_0x521f5d){return new BPromise(function(_0x96d09e,_0x443124){logger['info'](_0xb7c5('0x6'),_0x521f5d||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0xf99d84=new WebSocket(_0x521f5d||_0xb7c5('0x7'),{'perMessageDeflate':![]});var _0x29014f='';var _0x349f43='0';var _0x3ac65f='1';var _0x144f5f='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x40e025(_0xe5c20d){var _0x420bef=crypto['createHash'](_0xb7c5('0x8'));_0x420bef[_0xb7c5('0x9')](_0xe5c20d);return _0x420bef[_0xb7c5('0xa')](_0xb7c5('0xb'));}function _0x2776f5(){try{logger[_0xb7c5('0xc')](_0xb7c5('0xd'));var _0x50c4bd=moment()[_0xb7c5('0xe')]();var _0x34f0eb=_0x40e025(_0x50c4bd+_0x152f10+_0x7755cd);_0xf99d84[_0xb7c5('0xf')](JSON[_0xb7c5('0x10')]({'appID':_0x152f10,'timestamp':_0x50c4bd,'appKey':_0x34f0eb}));var _0x56407c=fs[_0xb7c5('0x11')](_0x782e2);_0x56407c['on']('data',function(_0x556387){_0xf99d84[_0xb7c5('0xf')](_0x556387);});_0x56407c['on'](_0xb7c5('0x12'),function(){_0xf99d84['send'](_0xb7c5('0x13'));});}catch(_0x27de72){logger[_0xb7c5('0x14')](_0xb7c5('0x15'),JSON[_0xb7c5('0x10')](_0x27de72));_0xf99d84[_0xb7c5('0x16')]();}}function _0x1481b6(_0x41ccfc){try{if(_0x41ccfc){var _0x26f550=JSON[_0xb7c5('0x17')](_0x41ccfc);switch(_0x26f550[_0xb7c5('0x18')]){case 0x0:if(_0x26f550['result']){if(_0x26f550[_0xb7c5('0x19')][_0xb7c5('0x1a')]){logger[_0xb7c5('0xc')](_0xb7c5('0x1b'),JSON[_0xb7c5('0x10')](_0x26f550[_0xb7c5('0x19')][_0xb7c5('0x1c')]));_0x29014f=_0x26f550[_0xb7c5('0x19')][_0xb7c5('0x1c')][0x0][_0xb7c5('0x1d')];_0x349f43=_0x26f550[_0xb7c5('0x19')]['hypotheses'][0x0][_0xb7c5('0x1e')];_0x3ac65f='0';_0x144f5f=_0xb7c5('0x1f');_0xf99d84[_0xb7c5('0x16')]();}}break;case 0x1:logger['info'](_0xb7c5('0x20'));_0x3ac65f='1';_0x144f5f=_0xb7c5('0x20');break;case 0x2:logger[_0xb7c5('0xc')](_0xb7c5('0x21'));_0x3ac65f='2';_0x144f5f=_0xb7c5('0x21');break;case 0x9:logger['info'](_0xb7c5('0x22'));_0x3ac65f='9';_0x144f5f=_0xb7c5('0x22');break;case 0xa:logger[_0xb7c5('0xc')]('Authentication\x20failed.');_0x3ac65f='10';_0x144f5f=_0xb7c5('0x23');break;case 0xb:logger[_0xb7c5('0xc')](_0xb7c5('0x24'));_0x3ac65f='11';_0x144f5f='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x74915a){logger[_0xb7c5('0x14')](_0xb7c5('0x25'),JSON[_0xb7c5('0x10')](_0x74915a));_0xf99d84[_0xb7c5('0x16')]();}}function _0x12e3e3(){logger[_0xb7c5('0xc')](_0xb7c5('0x26'));_0x96d09e({'transcript':_0x29014f,'confidence':_0x349f43,'status':_0x3ac65f,'status_message':_0x144f5f});}function _0xa76288(_0x5a3197){logger['error'](_0xb7c5('0x27'));if(!_[_0xb7c5('0x28')](_0x5a3197)){logger[_0xb7c5('0x14')](_[_0xb7c5('0x29')](_0x5a3197)?JSON[_0xb7c5('0x10')](_0x5a3197):_0x5a3197);}}_0xf99d84['on'](_0xb7c5('0x2a'),_0x2776f5);_0xf99d84['on'](_0xb7c5('0x2b'),_0x1481b6);_0xf99d84['on'](_0xb7c5('0x12'),_0x12e3e3);_0xf99d84['on']('error',_0xa76288);});}; \ No newline at end of file diff --git a/server/services/agi/scripts/tilde/index.js b/server/services/agi/scripts/tilde/index.js index 2104917..633023d 100644 --- a/server/services/agi/scripts/tilde/index.js +++ b/server/services/agi/scripts/tilde/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c2a=['exports','./asr'];(function(_0x2745fd,_0x47ee3c){var _0x5d4842=function(_0x347d43){while(--_0x347d43){_0x2745fd['push'](_0x2745fd['shift']());}};_0x5d4842(++_0x47ee3c);}(_0x5c2a,0x1b7));var _0xa5c2=function(_0x2bb3f6,_0x25fde0){_0x2bb3f6=_0x2bb3f6-0x0;var _0x62b339=_0x5c2a[_0x2bb3f6];return _0x62b339;};var asr=require(_0xa5c2('0x0'));module[_0xa5c2('0x1')]={'asr':asr}; \ No newline at end of file +var _0x3de3=['./asr'];(function(_0x58f21c,_0x12c603){var _0x8fecd9=function(_0x58a406){while(--_0x58a406){_0x58f21c['push'](_0x58f21c['shift']());}};_0x8fecd9(++_0x12c603);}(_0x3de3,0xc3));var _0x33de=function(_0x3a2c0f,_0x18facc){_0x3a2c0f=_0x3a2c0f-0x0;var _0x20be8d=_0x3de3[_0x3a2c0f];return _0x20be8d;};var asr=require(_0x33de('0x0'));module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 8401a08..90c0e76 100644 --- a/server/services/agi/server.js +++ b/server/services/agi/server.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','inherits','exports','util','net','events','EventEmitter','./channel','call','emit','error'];(function(_0xa28533,_0x2475d0){var _0x4d3d4b=function(_0x575577){while(--_0x575577){_0xa28533['push'](_0xa28533['shift']());}};_0x4d3d4b(++_0x2475d0);}(_0x34e8,0x12c));var _0x834e=function(_0x131d9f,_0x23538b){_0x131d9f=_0x131d9f-0x0;var _0x55ba64=_0x34e8[_0x131d9f];return _0x55ba64;};'use strict';var util=require(_0x834e('0x0'));var net=require(_0x834e('0x1'));var EventEmitter=require(_0x834e('0x2'))[_0x834e('0x3')];var AGIError=require('./error');var AGIChannel=require(_0x834e('0x4'));var AGIServer=function(_0x21e2e0,_0x472111,_0x31bf20){var _0x289ef2=this;var _0x19a3e0=null;var _0x398bee=0x0;if(!_0x21e2e0)_0x21e2e0=0x11dd;if(!_0x472111)_0x472111='127.0.0.1';EventEmitter[_0x834e('0x5')](_0x289ef2);function _0x52056d(){if(!_0x21e2e0){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0x8')));return![];}_0x19a3e0=net[_0x834e('0x9')]();_0x19a3e0[_0x834e('0xa')](_0x21e2e0,_0x472111);_0x19a3e0['on'](_0x834e('0xb'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xb'));});_0x19a3e0['on'](_0x834e('0xc'),function(_0x186b3b){_0x19a3e0[_0x834e('0xd')](function(_0x36e124,_0x14038b){if(_0x36e124){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x36e124));}else if(_0x31bf20&&_0x31bf20<0x0){_0x289ef2[_0x834e('0x6')]('error',new AGIError(_0x834e('0xf')));_0x186b3b[_0x834e('0x10')]();}else if(_0x31bf20&&_0x31bf20>0x0&&_0x31bf20<_0x14038b){_0x398bee+=0x1;_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0x11'),_0x398bee));_0x186b3b[_0x834e('0x10')]();}else{var _0x21cc0a=new AGIChannel(_0x186b3b);_0x21cc0a['on']('ready',function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xc'),_0x21cc0a);});}});});_0x19a3e0['on']('error',function(_0x316205){_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x316205['code']));});_0x19a3e0['on'](_0x834e('0x12'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0x12'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x834e('0x13')](function(){_0x52056d();});};util[_0x834e('0x14')](AGIServer,EventEmitter);module[_0x834e('0x15')]=function(_0xb993a1,_0x237947,_0x254677){return new AGIServer(_0xb993a1,_0x237947,_0x254677);}; \ No newline at end of file +var _0x9c44=['./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','events','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x9c44[_0x2b7764];return _0x848dcb;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 4f70e0c..e621fa3 100644 --- a/server/services/agi/vertices.js +++ b/server/services/agi/vertices.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8819=['beep','NOBEEP','recordFile','intKey','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','tilde\x20%s\x20file\x20created','tildeASR','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','extension','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','true','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','operation','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','response','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','queue','queue_id','no\x20queue\x20selected','getVoiceQueue','no\x20queue\x20found','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','%s/recordings/%s.%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','restAPI','Response:','%s_STATUS_CODE','200','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','sayNumber','sayphonetic','sayPhonetic','account_id','no\x20mail\x20account\x20configured','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','Smtp','user','bcc','subject','template_id','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Sms\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','XMCS-UNIQUEID','yes','Answer','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','shelljs','odbc','randomstring','moment','mustache','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','menu','channel','mailRpc','prototype','getVariable','rpc','getVariableById','then','name','catch','getVoiceQueueById','getSquareProject','getSquareOdbc','getSquareOdbcById','dsn','getUser','getTrunkById','getSound','getSoundById','getSoundPath','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','callerid','createSquareRecording','context','priority','dnid','arg_1','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','scheduledAt','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','%s/%s@from-sip/n','LOCAL','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','ssmlGender','audioEncoding','MP3','googleTTS','google_tts_language','url','method','timeout','POST','PUT','toUpperCase','body','rawBody','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','statusCode','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','key','ispeech_tts_language','en-US','speed','ispeechASR','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','appid','appsecret','includes','hasOwnProperty','isString','replaceObjectAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','replaceAllVariables','saveRestApiResult','%s.%s','setVariable','replaceAll','getAndSetVariable','extra','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','exec','MRCPSynth','result','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','no\x20grammar\x20configured','grammar','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','query','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','debug','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','providerResponse','dialogflowV2','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','username','password','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','.wav','SestekNDA\x20is\x20unreachable','trunk_id','no\x20trunk\x20selected','getTrunk','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','no\x20file\x20audio\x20selected','file_id','getData','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','streamFile','unlink','aws\x20Polly\x20is\x20unreachable','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','%s/recordings/%s'];(function(_0x81e065,_0x50994e){var _0x16441b=function(_0x3ae149){while(--_0x3ae149){_0x81e065['push'](_0x81e065['shift']());}};_0x16441b(++_0x50994e);}(_0x8819,0x94));var _0x9881=function(_0x6c7872,_0x11aa19){_0x6c7872=_0x6c7872-0x0;var _0x2bd8b3=_0x8819[_0x6c7872];return _0x2bd8b3;};'use strict';var fs=require('fs');var util=require('util');var _=require('lodash');var sh=require(_0x9881('0x0'));var odbc=require(_0x9881('0x1'))();var rs=require(_0x9881('0x2'));var moment=require(_0x9881('0x3'));var Mustache=require(_0x9881('0x4'));var rp=require('request-promise');var logger=require(_0x9881('0x5'))(_0x9881('0x6'));var config=require(_0x9881('0x7'));var scripts=require(_0x9881('0x8'));var FILES_PATH=_0x9881('0x9');var recursiveMapAttributes=[_0x9881('0xa'),'rawBody'];var verticesWithRetry=[_0x9881('0xb'),'getdigits','getsecretdigits'];var AGIVertices=function(_0x15c0f8,_0x48d5a6,_0x5c2c0f){this[_0x9881('0xc')]=_0x15c0f8;this['rpc']=_0x48d5a6;this[_0x9881('0xd')]=_0x5c2c0f;};AGIVertices[_0x9881('0xe')][_0x9881('0xf')]=function(_0x571947,_0x1df0ba){this[_0x9881('0x10')][_0x9881('0x11')](_0x571947)[_0x9881('0x12')](function(_0x5b6bad){_0x1df0ba(null,_0x5b6bad?_0x5b6bad[_0x9881('0x13')]:![]);})[_0x9881('0x14')](function(_0x5c6d2d){_0x1df0ba(_0x5c6d2d);});};AGIVertices[_0x9881('0xe')]['getVoiceQueue']=function(_0x52744e,_0x48cfe1){this['rpc'][_0x9881('0x15')](_0x52744e)[_0x9881('0x12')](function(_0x39f5fb){_0x48cfe1(null,_0x39f5fb?_0x39f5fb[_0x9881('0x13')]:![]);})[_0x9881('0x14')](function(_0x1d57ea){_0x48cfe1(_0x1d57ea);});};AGIVertices['prototype'][_0x9881('0x16')]=function(_0x14b5a9,_0xcc4b6d){this['rpc']['getSquareProjectById'](_0x14b5a9)['then'](function(_0x280ea2){_0xcc4b6d(null,_0x280ea2?_0x280ea2['name']:![]);})[_0x9881('0x14')](function(_0x5a9848){_0xcc4b6d(_0x5a9848);});};AGIVertices['prototype'][_0x9881('0x17')]=function(_0x310f11,_0x1cbac3){this[_0x9881('0x10')][_0x9881('0x18')](_0x310f11)[_0x9881('0x12')](function(_0x3ae21d){_0x1cbac3(null,_0x3ae21d?_0x3ae21d[_0x9881('0x19')]:![]);})[_0x9881('0x14')](function(_0x3a9cb2){_0x1cbac3(_0x3a9cb2);});};AGIVertices[_0x9881('0xe')][_0x9881('0x1a')]=function(_0xe60803,_0x300fa6){this[_0x9881('0x10')]['getUserById'](_0xe60803)['then'](function(_0x4031af){_0x300fa6(null,_0x4031af?_0x4031af['name']:![]);})['catch'](function(_0x1ba558){_0x300fa6(_0x1ba558);});};AGIVertices[_0x9881('0xe')]['getTrunk']=function(_0x501343,_0x92a67e){this['rpc'][_0x9881('0x1b')](_0x501343)[_0x9881('0x12')](function(_0x16eeca){_0x92a67e(null,_0x16eeca?_0x16eeca[_0x9881('0x13')]:![]);})[_0x9881('0x14')](function(_0x14e6f9){_0x92a67e(_0x14e6f9);});};AGIVertices[_0x9881('0xe')][_0x9881('0x1c')]=function(_0xc328b7,_0x23727b){var _0x900eae=this;this[_0x9881('0x10')][_0x9881('0x1d')](_0xc328b7)['then'](function(_0x31956e){_0x23727b(null,_0x31956e?_0x900eae[_0x9881('0x1e')](_0x31956e['save_name']):![]);})[_0x9881('0x14')](function(_0x3d7120){_0x23727b(_0x3d7120);});};AGIVertices['prototype'][_0x9881('0x1f')]=function(_0x3b6c6f,_0x217a1c){this[_0x9881('0x10')][_0x9881('0x20')](_0x3b6c6f)[_0x9881('0x12')](function(_0x225a4c){_0x217a1c(null,_0x225a4c?_0x225a4c:![]);})[_0x9881('0x14')](function(_0x4b203f){_0x217a1c(_0x4b203f);});};AGIVertices[_0x9881('0xe')][_0x9881('0x21')]=function(_0x2690f8,_0x4685a4,_0xffc845){this[_0x9881('0xd')]['sendMailMessage'](_0x2690f8,_0x4685a4)[_0x9881('0x12')](function(){_0xffc845(null);})[_0x9881('0x14')](function(_0x5daeb8){_0xffc845(_0x5daeb8);});};AGIVertices[_0x9881('0xe')][_0x9881('0x22')]=function(_0x23537b,_0x101e6e){this[_0x9881('0x10')]['getIntervalById'](_0x23537b)[_0x9881('0x12')](function(_0x152abc){if(_0x152abc){if(_0x152abc[_0x9881('0x23')]){_0x101e6e(null,[_0x152abc[_0x9881('0x24')]]);}else{_0x101e6e(null,_[_0x9881('0x25')](_0x152abc[_0x9881('0x26')],_0x9881('0x24')));}}else{_0x101e6e(null,![]);}})[_0x9881('0x14')](function(_0x2f6aea){_0x101e6e(_0x2f6aea);});};AGIVertices[_0x9881('0xe')][_0x9881('0x1e')]=function(_0x9bbbe8){return util[_0x9881('0x27')](_0x9881('0x28'),FILES_PATH,_0x9bbbe8);};AGIVertices[_0x9881('0xe')][_0x9881('0x29')]=function(_0x5d902d,_0x241c82,_0x5f14d5){odbc[_0x9881('0x2a')](_0x5d902d,function(_0x5c2277){if(_0x5c2277){logger[_0x9881('0x2b')](_0x9881('0x2c'),_0x5c2277);_0x5f14d5(_0x5c2277);}else{logger['info'](_0x9881('0x2d'));odbc['query'](_0x241c82,function(_0x2f298d,_0x39be9a){if(_0x2f298d){logger[_0x9881('0x2e')](_0x9881('0x2f'),_0x241c82);_0x5f14d5(_0x2f298d);}else{logger['info'](_0x9881('0x30'),_0x241c82);odbc[_0x9881('0x31')](function(_0xf2e781){if(_0xf2e781){logger[_0x9881('0x2b')](_0x9881('0x32'),_0xf2e781);}_0x5f14d5(null,_0x39be9a);});}});}});};AGIVertices[_0x9881('0xe')][_0x9881('0x33')]=function(_0x4feb70,_0x3f25db){this['rpc'][_0x9881('0x34')](_0x4feb70)[_0x9881('0x12')](function(_0x1c0396){_0x3f25db(null,_0x1c0396?_0x1c0396:![]);})['catch'](function(_0x51be30){_0x3f25db(_0x51be30);});};AGIVertices[_0x9881('0xe')][_0x9881('0x35')]=function(_0x4c5b11,_0x424d71){this[_0x9881('0x10')]['createSmsMessage'](_0x4c5b11)[_0x9881('0x12')](function(_0x41e48b){_0x424d71(null,_0x41e48b);})[_0x9881('0x14')](function(_0x1f84a5){_0x424d71(_0x1f84a5);});};AGIVertices[_0x9881('0xe')][_0x9881('0x36')]=function(_0x2ac606,_0x4421bc,_0x3240b0){this[_0x9881('0x10')]['createSquareDetailsReport']({'uniqueid':this[_0x9881('0xc')][_0x9881('0x37')],'node':_0x2ac606[_0x9881('0x38')],'application':_0x2ac606[_0x9881('0x39')],'data':_0x4421bc||null,'project_name':this[_0x9881('0xc')]['arg_1'],'callerid':this[_0x9881('0xc')][_0x9881('0x3a')]})[_0x9881('0x12')](function(_0x3bd039){if(_0x3240b0){_0x3240b0(null,_0x3bd039);}})['catch'](function(_0x28f0c0){if(_0x3240b0){_0x3240b0(_0x28f0c0);}});};AGIVertices[_0x9881('0xe')][_0x9881('0x3b')]=function(_0x5528b9,_0x249c07,_0x3746f6,_0x35f875){this[_0x9881('0x10')][_0x9881('0x3b')]({'uniqueid':this[_0x9881('0xc')][_0x9881('0x37')],'callerid':this[_0x9881('0xc')][_0x9881('0x3a')],'calleridname':this[_0x9881('0xc')]['calleridname'],'context':this[_0x9881('0xc')][_0x9881('0x3c')],'extension':this[_0x9881('0xc')]['extension'],'priority':this[_0x9881('0xc')][_0x9881('0x3d')],'accountcode':this[_0x9881('0xc')]['accountcode'],'dnid':this['channel'][_0x9881('0x3e')],'projectName':this[_0x9881('0xc')][_0x9881('0x3f')],'saveName':_0x249c07,'filename':_0x5528b9[_0x9881('0x40')]||_0x249c07,'savePath':_0x3746f6})['then'](function(_0x514263){_0x35f875(null,_0x514263);})[_0x9881('0x14')](function(_0x355357){_0x35f875(_0x355357);});};AGIVertices[_0x9881('0xe')]['createSquareMessage']=function(_0x2e22e8,_0x20cea3,_0x49839f,_0xe8a758,_0x262b8b){this[_0x9881('0x10')][_0x9881('0x41')]({'uniqueid':this[_0x9881('0xc')][_0x9881('0x37')],'body':_0x2e22e8,'direction':_0x20cea3,'providerName':_0x49839f,'providerResponse':_0xe8a758})[_0x9881('0x12')](function(_0x506a5a){if(_0x262b8b){_0x262b8b(null,_0x506a5a);}})[_0x9881('0x14')](function(_0x52b05f){if(_0x262b8b){_0x262b8b(_0x52b05f);}});};AGIVertices[_0x9881('0xe')][_0x9881('0x42')]=function(_0x7fb92e,_0x16ca26){this['rpc']['createCmContact']({'firstName':_[_0x9881('0x43')](_0x7fb92e[_0x9881('0x13')])||_[_0x9881('0x44')](_0x7fb92e['name'])?_0x9881('0x45')+Math[_0x9881('0x46')]():_0x7fb92e[_0x9881('0x13')],'lastName':_[_0x9881('0x43')](_0x7fb92e[_0x9881('0x47')])||_[_0x9881('0x44')](_0x7fb92e['lastName'])?null:_0x7fb92e[_0x9881('0x47')],'phone':_0x7fb92e[_0x9881('0x48')],'ListId':_0x7fb92e[_0x9881('0x49')],'scheduledat':_0x7fb92e[_0x9881('0x4a')],'callbackUniqueid':this[_0x9881('0xc')]['uniqueid'],'tags':'callback','description':'Callback\x20scheduled\x20at\x20'+_0x7fb92e[_0x9881('0x4a')][_0x9881('0x4b')](),'priority':_0x7fb92e[_0x9881('0x4c')]})[_0x9881('0x12')](function(_0x407e3e){_0x16ca26(null,_0x407e3e);})[_0x9881('0x14')](function(_0x4da4bf){_0x16ca26(_0x4da4bf);});};AGIVertices['prototype'][_0x9881('0x4d')]=function(_0x4429a4,_0x5e53c8){this[_0x9881('0x10')][_0x9881('0x4e')](_0x4429a4)[_0x9881('0x12')](function(_0x3b76b9){_0x5e53c8(null,_0x3b76b9?_0x3b76b9['name']:![]);})[_0x9881('0x14')](function(_0x5b4535){_0x5e53c8(_0x5b4535);});};AGIVertices[_0x9881('0xe')][_0x9881('0x4f')]=function(_0x4c11cb,_0x506371,_0x594da8){var _0x489fc0={'role':_0x9881('0x50')};_0x489fc0[_0x4c11cb]=this[_0x9881('0xc')]['callerid'];this[_0x9881('0x10')][_0x9881('0x4f')](_0x489fc0,_0x506371,this[_0x9881('0xc')][_0x9881('0x37')])[_0x9881('0x12')](function(_0x3cea77){_0x594da8(null,_[_0x9881('0x44')](_0x3cea77)?![]:!![]);})[_0x9881('0x14')](function(_0x5a9958){logger['error'](_0x5a9958);_0x594da8(null,![]);});};AGIVertices[_0x9881('0xe')][_0x9881('0x51')]=function(_0xb9d0ac,_0x12f6eb){var _0x16c60d={'role':_0x9881('0x50')};_0x16c60d[_0xb9d0ac]=this['channel'][_0x9881('0x3a')];this[_0x9881('0x10')][_0x9881('0x51')](_0x16c60d)[_0x9881('0x12')](function(_0x5de5cd){_0x12f6eb(null,_[_0x9881('0x44')](_0x5de5cd)?![]:!![]);})['catch'](function(_0xab3040){logger[_0x9881('0x2b')](_0xab3040);_0x12f6eb(null,![]);});};AGIVertices[_0x9881('0xe')][_0x9881('0x52')]=function(_0x5bfbdd,_0x581ebf){var _0x23f6cf={'role':'agent'};_0x23f6cf[_0x5bfbdd]=this['channel'][_0x9881('0x3a')];this[_0x9881('0x10')][_0x9881('0x52')](_0x23f6cf)['then'](function(_0x20f271){_0x581ebf(null,_[_0x9881('0x44')](_0x20f271)?![]:!![]);})['catch'](function(_0x2938e3){logger[_0x9881('0x2b')](_0x2938e3);_0x581ebf(null,![]);});};AGIVertices['prototype'][_0x9881('0x53')]=function(_0x5d2649,_0x410b54){var _0x1d2be9={'role':_0x9881('0x50')};_0x1d2be9[_0x5d2649]=this[_0x9881('0xc')][_0x9881('0x3a')];var _0x2d4bc4=_0x5d2649!='internal'?util[_0x9881('0x27')](_0x9881('0x54'),_0x9881('0x55'),this[_0x9881('0xc')][_0x9881('0x3a')]):undefined;this[_0x9881('0x10')][_0x9881('0x53')](_0x1d2be9,_0x2d4bc4)[_0x9881('0x12')](function(_0x2f7706){_0x410b54(null,_[_0x9881('0x44')](_0x2f7706)?![]:!![]);})[_0x9881('0x14')](function(_0x4d49ec){logger[_0x9881('0x2b')](_0x4d49ec);_0x410b54(null,![]);});};AGIVertices[_0x9881('0xe')]['shellCommand']=function(_0x1abcc3,_0x24fcb5){sh['exec'](_[_0x9881('0x56')](_0x1abcc3),function(_0x39dba7,_0x3dfc16){var _0x18ad64=_0x3dfc16[_0x9881('0x57')](/(\r\n|\n|\r)/gm,'');_0x24fcb5(null,_0x18ad64);});};AGIVertices['prototype'][_0x9881('0x58')]=function(_0x3658a7,_0x45c1b1){scripts['googleCloudTTS'](_0x3658a7[_0x9881('0x59')],_0x3658a7[_0x9881('0x5a')]||_0x9881('0x5b'),_0x3658a7[_0x9881('0x5b')],_0x3658a7[_0x9881('0x5c')]||'en-US',_0x3658a7[_0x9881('0x5d')]||'MALE',_0x3658a7[_0x9881('0x5e')]||_0x9881('0x5f'))[_0x9881('0x12')](function(_0x5997e5){_0x45c1b1(null,_0x5997e5);})[_0x9881('0x14')](function(_0xc7495b){_0x45c1b1(_0xc7495b);});};AGIVertices['prototype'][_0x9881('0x60')]=function(_0x402b94,_0x23206d){scripts[_0x9881('0x60')](_0x402b94[_0x9881('0x5b')],_0x402b94[_0x9881('0x61')]||'en',0x1)['then'](function(_0x20e70c){_0x23206d(null,_0x20e70c);})[_0x9881('0x14')](function(_0x3a1115){_0x23206d(_0x3a1115);});};AGIVertices[_0x9881('0xe')]['restAPI']=function(_0x1489cf,_0x30bd50){var _0x5125c1={'uri':_0x1489cf[_0x9881('0x62')],'method':_0x1489cf[_0x9881('0x63')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x1489cf[_0x9881('0x64')])==='number'&&parseInt(_0x1489cf['timeout'])>=0x1?parseInt(_0x1489cf['timeout'])*0x3e8:0x5*0x3e8};if(_['includes']([_0x9881('0x65'),_0x9881('0x66')],_0x5125c1[_0x9881('0x63')][_0x9881('0x67')]())){try{_0x5125c1[_0x9881('0x68')]=_0x1489cf[_0x9881('0x69')]?JSON[_0x9881('0x6a')](_0x1489cf[_0x9881('0x69')]):{};}catch(_0x4dc3d6){logger[_0x9881('0x2b')](_0x9881('0x6b'),_0x4dc3d6);}}try{_0x5125c1[_0x9881('0x6c')]=_0x1489cf['rawHeaders']?JSON[_0x9881('0x6a')](_0x1489cf[_0x9881('0xa')]):{};}catch(_0x1f61d7){logger[_0x9881('0x2b')](_0x9881('0x6d'),_0x1f61d7);}if(_0x1489cf[_0x9881('0x6e')]){try{var _0x5e245b=require(_0x1489cf['computedVariables'])[_0x9881('0x6f')](this,_0x5125c1);_0x5125c1[_0x9881('0x70')]=Mustache[_0x9881('0x71')](_0x1489cf['url'],_0x5e245b,{},['$$','$$']);if(_0x5125c1[_0x9881('0x6c')]){_0x5125c1[_0x9881('0x6c')]=JSON[_0x9881('0x6a')](Mustache['render'](JSON[_0x9881('0x72')](_0x5125c1[_0x9881('0x6c')]),_0x5e245b,{},['$$','$$']));}if(_0x5125c1[_0x9881('0x68')]){_0x5125c1[_0x9881('0x68')]=JSON[_0x9881('0x6a')](Mustache[_0x9881('0x71')](JSON['stringify'](_0x5125c1['body']),_0x5e245b,{},['$$','$$']));}}catch(_0x21bc73){logger[_0x9881('0x2b')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x21bc73);}}rp(_0x5125c1)[_0x9881('0x12')](function(_0x3de821){var _0x14dd3b={'statusCode':_0x3de821[_0x9881('0x73')]||0xc8,'statusMessage':_0x3de821['statusMessage']||'OK','headers':_0x3de821[_0x9881('0x6c')]||{},'body':_0x3de821['body']||{}};_0x30bd50(null,_0x14dd3b);})[_0x9881('0x14')](function(_0x3cee87){var _0xadf33={'statusCode':_0x3cee87['statusCode']||0x1f4,'statusMessage':_0x3cee87['message']||_0x9881('0x74'),'headers':_0x3cee87[_0x9881('0x75')][_0x9881('0x6c')]||{},'body':_0x3cee87['options'][_0x9881('0x68')]||{}};_0x30bd50(null,_0xadf33);});};AGIVertices[_0x9881('0xe')][_0x9881('0x76')]=function(_0x1c8218,_0x19937d){scripts[_0x9881('0x76')](this['channel'][_0x9881('0x37')],_0x1c8218['key'],_0x1c8218['text'],_0x1c8218[_0x9881('0x77')]||'en')[_0x9881('0x12')](function(_0x48c924){_0x19937d(null,_0x48c924);})[_0x9881('0x14')](function(_0x48d2d0){_0x19937d(_0x48d2d0);});};AGIVertices[_0x9881('0xe')][_0x9881('0x78')]=function(_0x2d598b,_0x5e8c3a){scripts[_0x9881('0x78')](this['channel'][_0x9881('0x37')],_0x2d598b[_0x9881('0x79')],_0x2d598b[_0x9881('0x7a')],_0x2d598b[_0x9881('0x7b')],_0x2d598b[_0x9881('0x5b')],_0x2d598b[_0x9881('0x7c')]||'en')[_0x9881('0x12')](function(_0x304552){_0x5e8c3a(null,_0x304552);})['catch'](function(_0x4a67d5){_0x5e8c3a(_0x4a67d5);});};AGIVertices[_0x9881('0xe')][_0x9881('0x7d')]=function(_0x99c85d,_0x436e15){scripts[_0x9881('0x7d')](this[_0x9881('0xc')],_0x99c85d)['then'](function(_0x28839e){_0x436e15(null,_0x28839e);})[_0x9881('0x14')](function(_0x567eed){_0x436e15(_0x567eed);});};AGIVertices[_0x9881('0xe')][_0x9881('0x7e')]=function(_0x32f08c,_0x1a6052){scripts[_0x9881('0x7e')](_0x32f08c[_0x9881('0x7f')],_0x32f08c['text'],_0x32f08c[_0x9881('0x80')]||_0x9881('0x81'),_0x32f08c[_0x9881('0x82')])['then'](function(_0x53d900){_0x1a6052(null,_0x53d900);})[_0x9881('0x14')](function(_0x2dfbc5){_0x1a6052(_0x2dfbc5);});};AGIVertices['prototype']['ispeechASR']=function(_0x169026,_0x22d856,_0xdb99b2){scripts[_0x9881('0x83')](_0x22d856,_0x169026[_0x9881('0x7f')],_0x169026['ispeech_asr_language']||_0x9881('0x81'),this[_0x9881('0x84')](_0x169026[_0x9881('0x85')])?_0x169026[_0x9881('0x85')]:undefined)[_0x9881('0x12')](function(_0x3c4293){_0xdb99b2(null,_0x3c4293);})[_0x9881('0x14')](function(_0x13b181){_0xdb99b2(_0x13b181);});};AGIVertices[_0x9881('0xe')]['awsPolly']=function(_0xaff6a9,_0x393628){scripts[_0x9881('0x86')](_0xaff6a9[_0x9881('0x87')],_0xaff6a9[_0x9881('0x88')],_0xaff6a9['aws_polly_region'],_0xaff6a9[_0x9881('0x89')]||_0x9881('0x8a'),_0xaff6a9['text'],_0xaff6a9[_0x9881('0x8b')]||_0x9881('0x5b'))['then'](function(_0xcc5481){_0x393628(null,_0xcc5481);})[_0x9881('0x14')](function(_0x516d8f){_0x393628(_0x516d8f);});};AGIVertices[_0x9881('0xe')][_0x9881('0x8c')]=function(_0x57736b,_0x2a35be){scripts[_0x9881('0x8c')](this[_0x9881('0xc')]['uniqueid'],_0x57736b['aws_access_key_id'],_0x57736b[_0x9881('0x88')],_0x57736b[_0x9881('0x8d')],_0x57736b[_0x9881('0x5b')],_0x57736b[_0x9881('0x8e')])[_0x9881('0x12')](function(_0x3ce499){_0x2a35be(null,_0x3ce499);})[_0x9881('0x14')](function(_0x2b445a){_0x2a35be(_0x2b445a);});};AGIVertices[_0x9881('0xe')]['googleASR']=function(_0xba04cc,_0x443aca,_0x425656){scripts[_0x9881('0x8f')](_0x443aca,_0xba04cc[_0x9881('0x7f')],_0xba04cc[_0x9881('0x90')]||_0x9881('0x81'))[_0x9881('0x12')](function(_0x504cf7){_0x425656(null,_0x504cf7);})[_0x9881('0x14')](function(_0x499286){_0x425656(_0x499286);});};AGIVertices[_0x9881('0xe')]['tildeASR']=function(_0x2b104d,_0x5892a3,_0x3d581a){scripts['tildeASR'](_0x5892a3,_0x2b104d[_0x9881('0x91')],_0x2b104d[_0x9881('0x92')],_0x2b104d['uri'])[_0x9881('0x12')](function(_0x19c2d2){_0x3d581a(null,_0x19c2d2);})[_0x9881('0x14')](function(_0x51e805){_0x3d581a(_0x51e805);});};AGIVertices['prototype']['clear']=function(_0x357c5f){var _0x463bb5=_[_0x9881('0x93')](verticesWithRetry,_0x357c5f['agicommand'])?_0x357c5f:_['clone'](_0x357c5f);for(var _0x3689de in _0x463bb5){if(_0x463bb5[_0x9881('0x94')](_0x3689de)){if(_0x463bb5[_0x3689de]&&_[_0x9881('0x95')](_0x463bb5[_0x3689de])){if(_[_0x9881('0x93')](recursiveMapAttributes,_0x3689de)){_0x463bb5[_0x3689de]=this[_0x9881('0x96')](_0x463bb5[_0x3689de]);}else{_0x463bb5[_0x3689de]=this['replaceAllVariables'](_0x463bb5[_0x3689de]);}}}}return _0x463bb5;};AGIVertices[_0x9881('0xe')][_0x9881('0x97')]=function(_0x186d4c){for(var _0x27cc14 in _0x186d4c){if(_0x186d4c[_0x9881('0x94')](_0x27cc14)){if(_[_0x9881('0x98')](_0x186d4c[_0x27cc14])){this[_0x9881('0x97')](_0x186d4c[_0x27cc14]);}else if(_[_0x9881('0x99')](_0x186d4c[_0x27cc14])){for(var _0x20c5e6=0x0;_0x20c5e6<_0x186d4c[_0x27cc14][_0x9881('0x9a')];_0x20c5e6++){this['recursiveNodeIndex'](_0x186d4c[_0x27cc14][_0x20c5e6]);}}else if(_['isString'](_0x186d4c[_0x27cc14])){_0x186d4c[_0x27cc14]=this[_0x9881('0x9b')](_0x186d4c[_0x27cc14]);}}}};AGIVertices[_0x9881('0xe')][_0x9881('0x9c')]=function(_0x1e6727,_0x6c3d7d){for(var _0x18c553 in _0x1e6727){if(_0x1e6727[_0x9881('0x94')](_0x18c553)){if(_[_0x9881('0x98')](_0x1e6727[_0x18c553])){if(!_[_0x9881('0x43')](_0x1e6727[_0x18c553])){this['saveRestApiResult'](_0x1e6727[_0x18c553],util[_0x9881('0x27')](_0x9881('0x9d'),_0x6c3d7d,_0x18c553));}}else if(_[_0x9881('0x99')](_0x1e6727[_0x18c553])){for(var _0x2d4933=0x0;_0x2d4933<_0x1e6727[_0x18c553][_0x9881('0x9a')];_0x2d4933++){this[_0x9881('0x9c')](_0x1e6727[_0x18c553][_0x2d4933],util[_0x9881('0x27')]('%s.%s',_0x6c3d7d,_0x18c553+'['+_0x2d4933+']'));}}else{if(!_[_0x9881('0x44')](_0x1e6727[_0x18c553])){this['channel'][_0x9881('0x9e')](util[_0x9881('0x27')](_0x9881('0x9d'),_0x6c3d7d,_0x18c553),_0x1e6727[_0x18c553]);}}}}};AGIVertices[_0x9881('0xe')]['replaceObjectAllVariables']=function(_0x59db35){try{var _0x37064d=JSON[_0x9881('0x6a')](_0x59db35);this[_0x9881('0x97')](_0x37064d);return JSON[_0x9881('0x72')](_0x37064d);}catch(_0x29671a){return this[_0x9881('0x9b')](_0x59db35);}};AGIVertices['prototype'][_0x9881('0x9b')]=function(_0xf06bf0){var _0x2ade74=_0xf06bf0['split']('{');for(var _0x3b2943=0x1;_0x3b2943<_0x2ade74['length'];_0x3b2943+=0x1){var _0x595560=_0x2ade74[_0x3b2943]['split']('}');if(_0x595560[_0x9881('0x9a')]>0x1){_0xf06bf0=_0xf06bf0[_0x9881('0x9f')]('{'+_0x595560[0x0]+'}',this[_0x9881('0xc')][_0x9881('0xf')](_0x595560[0x0])['extra']||_0x595560[0x0]);}}if(_0x2ade74[_0x9881('0x9a')]===0x1){return _0xf06bf0['toString']();}return this['replaceAllVariables'](_0xf06bf0);};AGIVertices[_0x9881('0xe')][_0x9881('0xa0')]=function(_0xb107a9,_0x26a6ca){var _0x3c9a2f=this[_0x9881('0xc')][_0x9881('0xf')](_0xb107a9);if(_0x3c9a2f['result']===-0x1){return _0x3c9a2f;}logger[_0x9881('0x2e')](util[_0x9881('0x27')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x26a6ca,_0x3c9a2f[_0x9881('0xa1')]));return this[_0x9881('0xc')][_0x9881('0x9e')](_0x26a6ca,_0x3c9a2f[_0x9881('0xa1')]);};AGIVertices[_0x9881('0xe')]['isConfigured']=function(_0x473457){return _0x473457&&_0x473457!=='0'&&_0x473457!=='-1'&&_0x473457!=='';};AGIVertices[_0x9881('0xe')][_0x9881('0xa2')]=function(_0x58c49e){this['createSquareDetailsReport'][_0x9881('0x6f')](this,_0x58c49e,'-');_0x58c49e[_0x9881('0xa3')]=_0x58c49e[_0x9881('0xa2')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x9881('0xa4')]=function(_0x3d38f3){logger['info'](util['format'](_0x9881('0xa5'),_0x3d38f3[_0x9881('0x38')]));if(!this['isConfigured'](_0x3d38f3[_0x9881('0x5b')])){return this['channel'][_0x9881('0xa6')](_0x9881('0xa7'));}var _0x3be7cb='\x22'+_0x3d38f3['text']+'\x22';if(this[_0x9881('0x84')](_0x3d38f3[_0x9881('0x75')])){_0x3be7cb+=','+_0x3d38f3[_0x9881('0x75')];}var _0x4ed659=this['channel'][_0x9881('0xa8')](_0x9881('0xa9'),_0x3be7cb);if(_0x4ed659[_0x9881('0xaa')]===-0x1){return _0x4ed659;}return this['channel']['noop'](util[_0x9881('0x27')]('Executed\x20command\x20MRCPSynth\x20%s',_0x3be7cb));};AGIVertices[_0x9881('0xe')][_0x9881('0xab')]=function(_0x335847){logger[_0x9881('0x2e')](util[_0x9881('0x27')](_0x9881('0xac'),_0x335847[_0x9881('0x38')]));if(!this[_0x9881('0x84')](_0x335847['grammar'])){return this['channel']['noop'](_0x9881('0xad'));}var _0x22afca=_0x335847[_0x9881('0xae')];if(this[_0x9881('0x84')](_0x335847[_0x9881('0x75')])){_0x22afca+=','+_0x335847[_0x9881('0x75')];}var _0x1285a6=this[_0x9881('0xc')][_0x9881('0xa8')](_0x9881('0xaf'),_0x22afca);if(_0x1285a6[_0x9881('0xaa')]===-0x1){return _0x1285a6;}var _0x48052d=this[_0x9881('0xa0')](_0x9881('0xb0'),_0x9881('0xb1'));if(_0x48052d['result']===-0x1){return _0x48052d;}var _0x57eb75=this[_0x9881('0xa0')](_0x9881('0xb2'),_0x9881('0xb3'));if(_0x57eb75[_0x9881('0xaa')]===-0x1){return _0x57eb75;}var _0x138e58=this[_0x9881('0xa0')](_0x9881('0xb4'),_0x9881('0xb5'));if(_0x138e58[_0x9881('0xaa')]===-0x1){return _0x138e58;}return this['channel'][_0x9881('0xa6')](util[_0x9881('0x27')](_0x9881('0xb6'),_0x22afca));};AGIVertices[_0x9881('0xe')][_0x9881('0x6')]=function(_0x1f96f0){logger[_0x9881('0x2e')](util[_0x9881('0x27')](_0x9881('0xb7'),_0x1f96f0[_0x9881('0x38')]));return this[_0x9881('0xc')][_0x9881('0x6')]([_0x1f96f0[_0x9881('0xb8')],_0x1f96f0['args']]);};AGIVertices[_0x9881('0xe')][_0x9881('0xb9')]=function(_0x1bb0e1){logger[_0x9881('0x2e')](util['format'](_0x9881('0xba'),_0x1bb0e1[_0x9881('0x38')]));if(this[_0x9881('0x84')](_0x1bb0e1[_0x9881('0x64')])){logger[_0x9881('0x2e')](util['format'](_0x9881('0xbb'),_0x1bb0e1[_0x9881('0x64')]));var _0xb80d6d=this[_0x9881('0xc')][_0x9881('0xbc')](_0x1bb0e1[_0x9881('0x64')]);if(_0xb80d6d[_0x9881('0xaa')]===-0x1){return _0xb80d6d;}}return this['channel']['answer']();};AGIVertices['prototype'][_0x9881('0xbd')]=function(_0x4b7c4b){logger[_0x9881('0x2e')](util[_0x9881('0x27')](_0x9881('0xbe'),_0x4b7c4b[_0x9881('0x38')]));if(!this[_0x9881('0x84')](_0x4b7c4b[_0x9881('0x49')])){return this[_0x9881('0xc')][_0x9881('0x2b')](_0x4b7c4b,_0x9881('0xbf'));}_0x4b7c4b['scheduledAt']=moment();if(this[_0x9881('0x84')](_0x4b7c4b[_0x9881('0xc0')])){_0x4b7c4b['scheduledAt']=moment()[_0x9881('0xc1')](_0x4b7c4b[_0x9881('0xc0')],'minutes');}if(!this[_0x9881('0x84')](_0x4b7c4b[_0x9881('0x4c')])){_0x4b7c4b[_0x9881('0x4c')]=0x2;}this['createCmContact'][_0x9881('0x6f')](this,_0x4b7c4b);return this['channel']['noop'](util[_0x9881('0x27')](_0x9881('0xc2'),_0x4b7c4b['phone'],_0x4b7c4b[_0x9881('0x49')],_0x4b7c4b[_0x9881('0x4a')]));};AGIVertices['prototype'][_0x9881('0xc3')]=function(_0x71e0a1){logger[_0x9881('0x2e')](util[_0x9881('0x27')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x71e0a1[_0x9881('0x38')]));var _0x3acaef=this[_0x9881('0xc')]['exec'](_0x71e0a1[_0x9881('0xc4')],_0x71e0a1['options']);if(_0x3acaef[_0x9881('0xaa')]===-0x1){return _0x3acaef;}return this[_0x9881('0xc')][_0x9881('0xa6')](util[_0x9881('0x27')]('Executed\x20command\x20%s\x20%s',_0x71e0a1[_0x9881('0xc4')],_0x71e0a1[_0x9881('0x75')]));};AGIVertices[_0x9881('0xe')][_0x9881('0xc5')]=function(_0x139ace){logger[_0x9881('0x2e')](util[_0x9881('0x27')](_0x9881('0xc6'),_0x139ace[_0x9881('0x38')]));if(!this[_0x9881('0x84')](_0x139ace[_0x9881('0x5b')])){return this[_0x9881('0xc')][_0x9881('0xa6')](_0x9881('0xa7'));}var _0x3d4ef7='\x22'+_0x139ace['text']+'\x22';if(this[_0x9881('0x84')](_0x139ace[_0x9881('0x75')])){_0x3d4ef7+=','+_0x139ace['options'];}var _0x431834=this['channel'][_0x9881('0xa8')](_0x9881('0xa9'),_0x3d4ef7);if(_0x431834['result']===-0x1){return _0x431834;}return this[_0x9881('0xc')]['noop'](util[_0x9881('0x27')](_0x9881('0xc7'),_0x3d4ef7));};AGIVertices[_0x9881('0xe')][_0x9881('0xc8')]=function(_0x536708){logger['info'](util[_0x9881('0x27')](_0x9881('0xc9'),_0x536708[_0x9881('0x38')]));if(!this[_0x9881('0x84')](_0x536708[_0x9881('0x5b')])){return this[_0x9881('0xc')][_0x9881('0xa6')](_0x9881('0xa7'));}var _0xbe6640='\x22'+_0x536708[_0x9881('0x5b')]+'\x22';if(this['isConfigured'](_0x536708['options'])){_0xbe6640+=','+_0x536708[_0x9881('0x75')];}var _0x33af2a=this[_0x9881('0xc')][_0x9881('0xa8')]('MRCPSynth',_0xbe6640);if(_0x33af2a[_0x9881('0xaa')]===-0x1){return _0x33af2a;}return this[_0x9881('0xc')][_0x9881('0xa6')](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0xbe6640));};AGIVertices[_0x9881('0xe')][_0x9881('0xca')]=function(_0x5e1a45){logger[_0x9881('0x2e')](util[_0x9881('0x27')](_0x9881('0xcb'),_0x5e1a45['label']));if(!this[_0x9881('0x84')](_0x5e1a45[_0x9881('0xae')])){return this[_0x9881('0xc')][_0x9881('0xa6')](_0x9881('0xad'));}var _0x414c24=_0x5e1a45[_0x9881('0xae')];if(this[_0x9881('0x84')](_0x5e1a45[_0x9881('0x75')])){_0x414c24+=','+_0x5e1a45[_0x9881('0x75')];}var _0x3e874b=this[_0x9881('0xc')][_0x9881('0xa8')](_0x9881('0xaf'),_0x414c24);if(_0x3e874b['result']===-0x1){return _0x3e874b;}var _0xb75f75=this[_0x9881('0xa0')](_0x9881('0xb0'),_0x9881('0xcc'));if(_0xb75f75[_0x9881('0xaa')]===-0x1){return _0xb75f75;}var _0x142180=this[_0x9881('0xa0')](_0x9881('0xb2'),_0x9881('0xcd'));if(_0x142180[_0x9881('0xaa')]===-0x1){return _0x142180;}var _0x92a0ba=this['getAndSetVariable'](_0x9881('0xb4'),_0x9881('0xce'));if(_0x92a0ba[_0x9881('0xaa')]===-0x1){return _0x92a0ba;}return this['channel'][_0x9881('0xa6')](util[_0x9881('0x27')](_0x9881('0xb6'),_0x414c24));};AGIVertices[_0x9881('0xe')]['sestekasr']=function(_0x1c678b){logger[_0x9881('0x2e')](util[_0x9881('0x27')](_0x9881('0xcf'),_0x1c678b[_0x9881('0x38')]));if(!this[_0x9881('0x84')](_0x1c678b[_0x9881('0xae')])){return this['channel']['noop'](_0x9881('0xad'));}var _0x51b709=_0x1c678b[_0x9881('0xae')];if(this['isConfigured'](_0x1c678b[_0x9881('0x75')])){_0x51b709+=','+_0x1c678b[_0x9881('0x75')];}var _0x27d812=this[_0x9881('0xc')][_0x9881('0xa8')]('MRCPRecog',_0x51b709);if(_0x27d812[_0x9881('0xaa')]===-0x1){return _0x27d812;}var _0x4b217a=this[_0x9881('0xa0')]('RECOG_CONFIDENCE()',_0x9881('0xd0'));if(_0x4b217a['result']===-0x1){return _0x4b217a;}var _0x1933b8=this[_0x9881('0xa0')](_0x9881('0xb2'),_0x9881('0xd1'));if(_0x1933b8[_0x9881('0xaa')]===-0x1){return _0x1933b8;}var _0x2b0874=this[_0x9881('0xa0')]('RECOG_INSTANCE()',_0x9881('0xd2'));if(_0x2b0874['result']===-0x1){return _0x2b0874;}return this['channel'][_0x9881('0xa6')](util[_0x9881('0x27')](_0x9881('0xb6'),_0x51b709));};AGIVertices[_0x9881('0xe')][_0x9881('0xd3')]=function(_0x852b21){logger[_0x9881('0x2e')](util[_0x9881('0x27')](_0x9881('0xd4'),_0x852b21[_0x9881('0x38')]));if(!this[_0x9881('0x84')](_0x852b21[_0x9881('0xd5')])){return this[_0x9881('0xc')][_0x9881('0x2b')](_0x852b21,_0x9881('0xd6'));}var _0x59288b=this[_0x9881('0x17')]['sync'](this,_0x852b21[_0x9881('0xd5')]);if(!_0x59288b){return this[_0x9881('0xc')][_0x9881('0x2b')](_0x852b21,_0x9881('0xd7'));}if(!this['isConfigured'](_0x852b21[_0x9881('0xd8')])){return this[_0x9881('0xc')][_0x9881('0x2b')](_0x852b21,_0x9881('0xd9'));}var _0xfee37e=_0x852b21['query'][_0x9881('0x57')](/(\r\n|\n|\r)/gm,'\x20');this[_0x9881('0xc')][_0x9881('0xa6')](util[_0x9881('0x27')](_0x9881('0xda'),_0xfee37e));var _0x535550=this['getQueryOdbc'][_0x9881('0x6f')](this,_0x59288b,_0xfee37e);this[_0x9881('0x36')][_0x9881('0x6f')](this,_0x852b21,_0xfee37e);if(!this[_0x9881('0x84')](_0x852b21[_0x9881('0xdb')])){return this[_0x9881('0xc')][_0x9881('0xa6')](_0x9881('0xdc'));}var _0x51bace=this[_0x9881('0xf')][_0x9881('0x6f')](this,_0x852b21['variable_id']);if(!_0x51bace){return this['channel'][_0x9881('0x2b')](_0x852b21,_0x9881('0xdd'));}var _0x4bef20=this;_0x535550[_0x9881('0xde')](function(_0x34c943,_0x179ada){Object[_0x9881('0xdf')](_0x34c943)[_0x9881('0xde')](function(_0x2fc562){_0x4bef20[_0x9881('0xc')]['setVariable'](util['format'](_0x9881('0xe0'),_0x51bace,_0x179ada,_0x2fc562),_0x34c943[_0x2fc562]);});});this[_0x9881('0xc')][_0x9881('0x9e')](util[_0x9881('0x27')](_0x9881('0xe1'),_0x51bace),_0x535550[_0x9881('0x9a')]);return this['channel'][_0x9881('0xa6')](util[_0x9881('0x27')](_0x9881('0xe2'),_0x51bace));};AGIVertices['prototype']['dial']=function(_0x3a3aed){logger[_0x9881('0xe3')](util['format']('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x3a3aed['label']));if(!this[_0x9881('0x84')](_0x3a3aed[_0x9881('0xe4')])){return this[_0x9881('0xc')][_0x9881('0x2b')](_0x3a3aed,_0x9881('0xe5'));}var _0x43b646=this[_0x9881('0x1a')][_0x9881('0x6f')](this,_0x3a3aed[_0x9881('0xe4')]);if(!_0x43b646){return this[_0x9881('0xc')][_0x9881('0x2b')](_0x3a3aed,_0x9881('0xe6'));}var _0x236050=this['channel'][_0x9881('0xa8')](_0x9881('0xe7'),[util[_0x9881('0x27')](_0x9881('0xe8'),_0x43b646),_0x3a3aed[_0x9881('0x64')],_0x3a3aed[_0x9881('0xe9')],_0x3a3aed[_0x9881('0x62')]]);if(_0x236050[_0x9881('0xaa')]===-0x1){return _0x236050;}return this[_0x9881('0xc')]['noop'](util[_0x9881('0x27')](_0x9881('0xea'),_0x9881('0xe7')));};AGIVertices['prototype'][_0x9881('0xeb')]=function(_0x490316){logger[_0x9881('0x2e')](util[_0x9881('0x27')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x490316[_0x9881('0x38')]));if(!this[_0x9881('0x84')](_0x490316[_0x9881('0x7f')])){return this[_0x9881('0xc')][_0x9881('0xa6')]('no\x20key\x20configured');}if(!this[_0x9881('0x84')](_0x490316['text'])){return this[_0x9881('0xc')]['noop'](_0x9881('0xa7'));}this['channel'][_0x9881('0xec')]=!![];this[_0x9881('0x36')](_0x490316);this[_0x9881('0x41')](_0x490316[_0x9881('0x5b')],'in','','');this['channel']['noop'](util['format'](_0x9881('0xed'),_0x490316['text']));var _0x5906aa=this[_0x9881('0x76')]['sync'](this,_0x490316);if(_0x5906aa){for(var _0x278aa2 in _0x5906aa){if(_0x5906aa[_0x9881('0x94')](_0x278aa2)){this['channel'][_0x9881('0x9e')](util[_0x9881('0x27')](_0x9881('0xee'),_0x278aa2['toUpperCase']()),_0x5906aa[_0x278aa2]);}}this[_0x9881('0x41')](_0x5906aa[_0x9881('0xef')],_0x9881('0xf0'),_0x9881('0xeb'),'');return this[_0x9881('0xc')][_0x9881('0xa6')](util[_0x9881('0x27')](_0x9881('0xf1'),_0x5906aa[_0x9881('0xef')]));}return this[_0x9881('0xc')][_0x9881('0x2b')](_0x490316,_0x9881('0xf2'));};AGIVertices[_0x9881('0xe')]['dialogflowV2']=function(_0x53b2ec){logger['info'](util[_0x9881('0x27')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x53b2ec[_0x9881('0x38')]));if(!this[_0x9881('0x84')](_0x53b2ec['dialogflowV2_project_id'])){return this[_0x9881('0xc')][_0x9881('0xa6')](_0x9881('0xf3'));}if(!this[_0x9881('0x84')](_0x53b2ec['client_email'])){return this[_0x9881('0xc')][_0x9881('0xa6')](_0x9881('0xf4'));}if(!this[_0x9881('0x84')](_0x53b2ec[_0x9881('0x7b')])){return this['channel'][_0x9881('0xa6')](_0x9881('0xf5'));}if(!this['isConfigured'](_0x53b2ec[_0x9881('0x7c')])){return this[_0x9881('0xc')][_0x9881('0xa6')](_0x9881('0xf6'));}if(!this[_0x9881('0x84')](_0x53b2ec['text'])){return this[_0x9881('0xc')][_0x9881('0xa6')](_0x9881('0xa7'));}this[_0x9881('0xc')][_0x9881('0xec')]=!![];this[_0x9881('0x36')](_0x53b2ec);this[_0x9881('0x41')](_0x53b2ec[_0x9881('0x5b')],'in','','');this[_0x9881('0xc')][_0x9881('0xa6')](util[_0x9881('0x27')]('Trying\x20DialogflowV2:\x20%s',_0x53b2ec[_0x9881('0x5b')]));var _0x554c48=this[_0x9881('0x78')][_0x9881('0x6f')](this,_0x53b2ec);if(_0x554c48){for(var _0x2ff3be in _0x554c48){if(_0x554c48['hasOwnProperty'](_0x2ff3be)){if(_0x2ff3be!==_0x9881('0xf7')){this['channel']['setVariable'](util[_0x9881('0x27')](_0x9881('0xee'),_0x2ff3be['toUpperCase']()),_0x554c48[_0x2ff3be]);}}}this[_0x9881('0x41')](_0x554c48['speech'],_0x9881('0xf0'),_0x9881('0xf8'),_0x554c48[_0x9881('0xf7')]);return this[_0x9881('0xc')][_0x9881('0xa6')](util[_0x9881('0x27')](_0x9881('0xf9'),_0x554c48[_0x9881('0xef')]));}return this[_0x9881('0xc')][_0x9881('0x2b')](_0x53b2ec,_0x9881('0xfa'));};AGIVertices[_0x9881('0xe')][_0x9881('0xfb')]=function(_0x52caf9){logger[_0x9881('0x2e')](util['format']('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x52caf9[_0x9881('0x38')]));if(!this['isConfigured'](_0x52caf9[_0x9881('0xfc')])){return this['channel']['noop'](_0x9881('0xfd'));}if(!this[_0x9881('0x84')](_0x52caf9[_0x9881('0xfe')])){return this[_0x9881('0xc')][_0x9881('0xa6')]('no\x20username\x20configured');}if(!this[_0x9881('0x84')](_0x52caf9[_0x9881('0xff')])){return this[_0x9881('0xc')][_0x9881('0xa6')]('no\x20password\x20configured');}if(!this[_0x9881('0x84')](_0x52caf9[_0x9881('0x100')])){return this[_0x9881('0xc')][_0x9881('0xa6')](_0x9881('0xa7'));}this[_0x9881('0xc')]['bot']=!![];this[_0x9881('0x36')](_0x52caf9);this[_0x9881('0x41')](_0x52caf9[_0x9881('0x5b')],'in','','');this['channel'][_0x9881('0xa6')](util[_0x9881('0x27')](_0x9881('0x101'),_0x52caf9[_0x9881('0x5b')]));var _0x433bf6=this['sestekNDA'][_0x9881('0x6f')](this,_0x52caf9);if(_0x433bf6){for(var _0x1ce8d3 in _0x433bf6){if(_0x433bf6[_0x9881('0x94')](_0x1ce8d3)){this[_0x9881('0xc')][_0x9881('0x9e')](util[_0x9881('0x27')](_0x9881('0x102'),_0x1ce8d3['toUpperCase']()),_0x433bf6[_0x1ce8d3]);}}this[_0x9881('0x41')](_0x433bf6[_0x9881('0xef')],'out',_0x9881('0xfb'),'');if(_0x433bf6[_0x9881('0x103')]){this[_0x9881('0xc')][_0x9881('0xa6')](util['format'](_0x9881('0x104'),_0x433bf6['audiofile']));var _0x221f51=this[_0x9881('0xc')]['streamFile'](_0x433bf6[_0x9881('0x103')]);try{fs['unlink'](_0x433bf6[_0x9881('0x103')]+_0x9881('0x105'));}catch(_0x46f3a9){logger[_0x9881('0x2b')](_0x46f3a9);}return _0x221f51;}else{return this[_0x9881('0xc')][_0x9881('0xa6')](util[_0x9881('0x27')]('SestekNDA\x20Result\x20%s',_0x433bf6[_0x9881('0xef')]));}}return this[_0x9881('0xc')][_0x9881('0x2b')](_0x52caf9,_0x9881('0x106'));};AGIVertices[_0x9881('0xe')]['end']=function(_0xc22caf){logger['info'](util['format']('Enter\x20in\x20END\x20(%s)\x20block',_0xc22caf[_0x9881('0x38')]));return this[_0x9881('0xc')]['noop']('end');};AGIVertices[_0x9881('0xe')]['ext_dial']=function(_0x1a12c0){logger['info'](util['format']('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x1a12c0[_0x9881('0x38')]));var _0x362cbb='';if(_0x1a12c0['trunk_id']){if(!this[_0x9881('0x84')](_0x1a12c0[_0x9881('0x107')])){return this[_0x9881('0xc')][_0x9881('0x2b')](_0x1a12c0,_0x9881('0x108'));}else{var _0xfec949=parseInt(_0x1a12c0[_0x9881('0x107')],0xa);if(isNaN(_0xfec949)){_0x362cbb=_0x1a12c0[_0x9881('0x107')];}else{_0x362cbb=this[_0x9881('0x109')][_0x9881('0x6f')](this,_0x1a12c0[_0x9881('0x107')]);if(!_0x362cbb){return this[_0x9881('0xc')]['error'](_0x1a12c0,_0x9881('0x10a'));}}}}else if(_0x1a12c0[_0x9881('0x10b')]){_0x362cbb=_0x1a12c0[_0x9881('0x10b')];}else{return this['channel'][_0x9881('0x2b')](_0x1a12c0,_0x9881('0x108'));}var _0x57144d=this[_0x9881('0xc')][_0x9881('0xa8')](_0x9881('0xe7'),[util[_0x9881('0x27')](_0x9881('0x10c'),_0x362cbb,_0x1a12c0['phone']),_0x1a12c0['timeout'],_0x1a12c0[_0x9881('0xe9')],_0x1a12c0[_0x9881('0x62')]]);if(_0x57144d[_0x9881('0xaa')]===-0x1){return _0x57144d;}return this['channel'][_0x9881('0xa6')](util['format'](_0x9881('0xea'),_0x9881('0xe7')));};AGIVertices[_0x9881('0xe')][_0x9881('0x10d')]=function(_0x120793){logger[_0x9881('0x2e')](util[_0x9881('0x27')](_0x9881('0x10e'),_0x120793[_0x9881('0x38')]));return this['channel'][_0x9881('0xa6')](_0x9881('0x10d'));};AGIVertices[_0x9881('0xe')]['getdigits']=function(_0x23c664){logger[_0x9881('0x2e')](util[_0x9881('0x27')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x23c664[_0x9881('0x38')]));if(_0x23c664[_0x9881('0xa3')]===0x0){return this['maxRetry'](_0x23c664);}_0x23c664[_0x9881('0xa3')]-=0x1;if(!this[_0x9881('0x84')](_0x23c664['file_id'])){return this['channel']['error'](_0x23c664,_0x9881('0x10f'));}var _0x1c43c6=this[_0x9881('0x1c')][_0x9881('0x6f')](this,_0x23c664[_0x9881('0x110')]);if(!_0x1c43c6){return this[_0x9881('0xc')]['error'](_0x23c664,'no\x20file\x20audio\x20found');}if(!this[_0x9881('0x84')](_0x23c664[_0x9881('0xdb')])){return this['channel'][_0x9881('0x2b')](_0x9881('0xdc'));}var _0x58aad2=this['channel'][_0x9881('0x111')](_0x1c43c6,_0x23c664['response'],_0x23c664[_0x9881('0x112')]);var _0x152ae1=_0x58aad2['result']?_0x58aad2[_0x9881('0xaa')][_0x9881('0x4b')]():'';logger[_0x9881('0x2e')](_0x9881('0x113'),JSON['stringify'](_0x58aad2));if(_0x58aad2['result']===-0x1){this[_0x9881('0x36')]['sync'](this,_0x23c664,_0x152ae1);return _0x58aad2;}else if(_0x58aad2[_0x9881('0xa1')]===_0x9881('0x64')){_0x58aad2['result']=_0x152ae1['length']>=parseInt(_0x23c664[_0x9881('0x114')])?'x':'i';}else{_0x58aad2[_0x9881('0xaa')]=_0x152ae1[_0x9881('0x9a')]>=parseInt(_0x23c664[_0x9881('0x114')])&&_0x152ae1[_0x9881('0x9a')]<=parseInt(_0x23c664['maxdigit'])?'x':'i';}var _0x185e69=this[_0x9881('0xf')]['sync'](this,_0x23c664[_0x9881('0xdb')]);if(!_0x185e69){return this[_0x9881('0xc')]['error'](_0x23c664,_0x9881('0xdd'));}this[_0x9881('0xc')][_0x9881('0x9e')](_0x185e69,_0x152ae1);if(this['isConfigured'](_0x23c664[_0x9881('0x115')])){var _0x410fe2=parseInt(_0x23c664[_0x9881('0x115')],0xa);var _0x168e09=rs[_0x9881('0x116')]({'charset':'*','length':_0x410fe2});var _0x51ed83=_0x152ae1[_0x9881('0x9a')];if(_0x51ed83>0x0){if(_0x51ed83>_0x410fe2){this['createSquareDetailsReport'][_0x9881('0x6f')](this,_0x23c664,_0x23c664[_0x9881('0x117')]===_0x9881('0x118')?_0x168e09+_0x152ae1[_0x9881('0x119')](_0x410fe2):_0x152ae1['substr'](0x0,_0x51ed83-_0x410fe2)+_0x168e09);}else{this['createSquareDetailsReport']['sync'](this,_0x23c664,rs[_0x9881('0x116')]({'charset':'*','length':_0x51ed83}));}}else{this['createSquareDetailsReport']['sync'](this,_0x23c664,'');}}else{this[_0x9881('0x36')][_0x9881('0x6f')](this,_0x23c664,_0x152ae1);}return _0x58aad2;};AGIVertices[_0x9881('0xe')][_0x9881('0x11a')]=function(_0x15aad9){logger['info'](util[_0x9881('0x27')](_0x9881('0x11b'),_0x15aad9[_0x9881('0x38')]));return this['getdigits'](_0x15aad9);};AGIVertices[_0x9881('0xe')][_0x9881('0x11c')]=function(_0x31a7f9){logger[_0x9881('0x2e')](util[_0x9881('0x27')](_0x9881('0x11d'),_0x31a7f9[_0x9881('0x38')]));this[_0x9881('0x36')][_0x9881('0x6f')](this,_0x31a7f9,_0x31a7f9['goalname']);return this[_0x9881('0xc')][_0x9881('0xa6')](util[_0x9881('0x27')](_0x9881('0x11e'),_0x31a7f9[_0x9881('0x11f')]));};AGIVertices[_0x9881('0xe')][_0x9881('0x120')]=function(_0x1d5cc5){logger[_0x9881('0x2e')](util[_0x9881('0x27')](_0x9881('0x121'),_0x1d5cc5[_0x9881('0x38')]));if(!this[_0x9881('0x84')](_0x1d5cc5['aws_access_key_id'])||!this[_0x9881('0x84')](_0x1d5cc5[_0x9881('0x88')])){return this[_0x9881('0xc')]['noop'](_0x9881('0x122'));}if(!this[_0x9881('0x84')](_0x1d5cc5[_0x9881('0x5b')])){return this[_0x9881('0xc')][_0x9881('0xa6')](_0x9881('0xa7'));}this[_0x9881('0xc')]['noop'](util[_0x9881('0x27')](_0x9881('0x123'),_0x1d5cc5[_0x9881('0x5b')]));var _0x420c34=this[_0x9881('0x86')][_0x9881('0x6f')](this,_0x1d5cc5);if(_0x420c34){this[_0x9881('0xc')][_0x9881('0xa6')](util['format'](_0x9881('0x124'),_0x420c34));var _0x4f140f=this['channel'][_0x9881('0x125')](_0x420c34);try{fs[_0x9881('0x126')](_0x420c34+_0x9881('0x105'));}catch(_0x323f2a){logger['error'](_0x323f2a);}return _0x4f140f;}return this[_0x9881('0xc')][_0x9881('0x2b')](_0x1d5cc5,_0x9881('0x127'));};AGIVertices[_0x9881('0xe')]['awslex']=function(_0x48b91e){logger[_0x9881('0x2e')](util[_0x9881('0x27')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x48b91e[_0x9881('0x38')]));if(!this[_0x9881('0x84')](_0x48b91e[_0x9881('0x87')])||!this[_0x9881('0x84')](_0x48b91e[_0x9881('0x88')])){return this[_0x9881('0xc')][_0x9881('0xa6')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x9881('0x84')](_0x48b91e['aws_bot_name'])){return this[_0x9881('0xc')][_0x9881('0xa6')](_0x9881('0x128'));}if(!this[_0x9881('0x84')](_0x48b91e[_0x9881('0x5b')])){return this['channel'][_0x9881('0xa6')]('no\x20text\x20configured');}this[_0x9881('0xc')][_0x9881('0xec')]=!![];this['createSquareDetailsReport'](_0x48b91e);this[_0x9881('0x41')](_0x48b91e[_0x9881('0x5b')],'in','','');this[_0x9881('0xc')][_0x9881('0xa6')](util[_0x9881('0x27')](_0x9881('0x129'),_0x48b91e[_0x9881('0x5b')]));var _0x43530a=this[_0x9881('0x8c')][_0x9881('0x6f')](this,_0x48b91e);if(_0x43530a){for(var _0x6c349 in _0x43530a){if(_0x43530a[_0x9881('0x94')](_0x6c349)&&_[_0x9881('0x95')](_0x43530a[_0x6c349])){this['channel'][_0x9881('0x9e')](util[_0x9881('0x27')](_0x9881('0x12a'),_0x6c349[_0x9881('0x67')]()),_0x43530a[_0x6c349]);}}if(_[_0x9881('0x44')](_0x43530a[_0x9881('0x12b')])){return this[_0x9881('0xc')]['noop'](_0x9881('0x12c'));}else{this[_0x9881('0x41')](_0x43530a['message'],'out',_0x9881('0x12d'),'');return this['channel'][_0x9881('0xa6')](util[_0x9881('0x27')](_0x9881('0x12e'),_0x43530a[_0x9881('0x12b')]));}}return this['channel'][_0x9881('0x2b')](_0x48b91e,_0x9881('0x12f'));};AGIVertices[_0x9881('0xe')][_0x9881('0x130')]=function(_0x388ae8){logger['info'](util[_0x9881('0x27')](_0x9881('0x131'),_0x388ae8[_0x9881('0x38')],_0x388ae8[_0x9881('0x64')]));if(!this[_0x9881('0x84')](_0x388ae8['key'])){return this[_0x9881('0xc')]['noop'](_0x9881('0x132'));}var _0x1cdc30=_0x9881('0x133');var _0x4bf477=util[_0x9881('0x27')](_0x9881('0x134'),FILES_PATH,rs[_0x9881('0x116')](0x4));var _0x6dda0d=util[_0x9881('0x27')]('%s.%s',_0x4bf477,_0x1cdc30);var _0x2a6220=!![];if(_0x388ae8[_0x9881('0x135')]===_0x9881('0x136')){_0x2a6220=![];}var _0x467e7c=this[_0x9881('0xc')][_0x9881('0x137')](_0x4bf477,_0x1cdc30,_0x388ae8[_0x9881('0x138')],_0x388ae8[_0x9881('0x64')],undefined,_0x2a6220);if(_0x467e7c[_0x9881('0xaa')]!==-0x1){this['channel'][_0x9881('0xa6')](util[_0x9881('0x27')]('google\x20%s\x20file\x20created',_0x6dda0d));var _0x1892ed=this[_0x9881('0x8f')][_0x9881('0x6f')](this,_0x388ae8,_0x6dda0d);if(_0x1892ed){for(var _0x3c9a96 in _0x1892ed){if(_0x1892ed['hasOwnProperty'](_0x3c9a96)){this[_0x9881('0xc')][_0x9881('0x9e')](util[_0x9881('0x27')](_0x9881('0x139'),_0x3c9a96[_0x9881('0x67')]()),_0x1892ed[_0x3c9a96]);}}return this['channel']['noop'](util['format'](_0x9881('0x13a'),JSON[_0x9881('0x72')](_0x1892ed)));}}return _0x467e7c;};AGIVertices[_0x9881('0xe')][_0x9881('0x13b')]=function(_0x2caa37){logger['info'](util[_0x9881('0x27')](_0x9881('0x13c'),_0x2caa37[_0x9881('0x38')]));if(!this[_0x9881('0x84')](_0x2caa37['appid'])){return this[_0x9881('0xc')]['noop']('no\x20appid\x20configured');}if(!this[_0x9881('0x84')](_0x2caa37[_0x9881('0x92')])){return this[_0x9881('0xc')][_0x9881('0xa6')]('no\x20appsecret\x20configured');}var _0x55aaec='wav';var _0xa41ddc=util[_0x9881('0x27')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x310ed8=util[_0x9881('0x27')](_0x9881('0x9d'),_0xa41ddc,_0x55aaec);var _0xd60d1b=!![];if(_0x2caa37[_0x9881('0x135')]==='NOBEEP'){_0xd60d1b=![];}var _0x57d3cb=this[_0x9881('0xc')]['recordFile'](_0xa41ddc,_0x55aaec,_0x2caa37[_0x9881('0x138')],_0x2caa37['timeout'],undefined,_0xd60d1b);if(_0x57d3cb['result']!==-0x1){this[_0x9881('0xc')][_0x9881('0xa6')](util['format'](_0x9881('0x13d'),_0x310ed8));var _0x3783c1=this[_0x9881('0x13e')][_0x9881('0x6f')](this,_0x2caa37,_0x310ed8);if(_0x3783c1){for(var _0x59f668 in _0x3783c1){if(_0x3783c1[_0x9881('0x94')](_0x59f668)){this[_0x9881('0xc')][_0x9881('0x9e')](util[_0x9881('0x27')](_0x9881('0x13f'),_0x59f668[_0x9881('0x67')]()),_0x3783c1[_0x59f668]);}}return this[_0x9881('0xc')]['noop'](util['format'](_0x9881('0x140'),JSON[_0x9881('0x72')](_0x3783c1)));}}return _0x57d3cb;};AGIVertices[_0x9881('0xe')][_0x9881('0x141')]=function(_0x2f2e83){logger[_0x9881('0x2e')](util['format']('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x2f2e83[_0x9881('0x38')]));return this['channel']['continueAt'](_0x2f2e83[_0x9881('0x3c')],_0x2f2e83[_0x9881('0x142')],_0x2f2e83['priority']);};AGIVertices[_0x9881('0xe')][_0x9881('0x143')]=function(_0x406704){logger[_0x9881('0x2e')](util[_0x9881('0x27')](_0x9881('0x144'),_0x406704[_0x9881('0x38')]));if(!this['isConfigured'](_0x406704[_0x9881('0x145')])){return this[_0x9881('0xc')][_0x9881('0x2b')](_0x406704,_0x9881('0x146'));}try{var _0x58ab62=eval(_0x406704[_0x9881('0x145')])?'true':_0x9881('0x147');this[_0x9881('0xc')][_0x9881('0xa6')](util[_0x9881('0x27')]('EVAL\x20CONDITION\x20%s\x20%s',_0x406704['condition'],_0x58ab62));return{'code':0xc8,'result':_0x58ab62};}catch(_0x503a73){return{'code':0xc8,'result':'false'};}};AGIVertices['prototype'][_0x9881('0x148')]=function(_0x198e3b){logger[_0x9881('0x2e')](util[_0x9881('0x27')](_0x9881('0x149'),_0x198e3b['label']));if(!this[_0x9881('0x84')](_0x198e3b[_0x9881('0x14a')])){return this['channel'][_0x9881('0x2b')](_0x198e3b,'no\x20interval\x20configured');}var _0x556681=this['getIntervals'][_0x9881('0x6f')](this,_0x198e3b[_0x9881('0x14a')]);if(!_0x556681){return this[_0x9881('0xc')][_0x9881('0x2b')](_0x198e3b,_0x9881('0x14b'));}for(var _0x4d011e=0x0;_0x4d011e<_0x556681[_0x9881('0x9a')];_0x4d011e+=0x1){var _0xbd2d15=this[_0x9881('0xc')][_0x9881('0xf')](util[_0x9881('0x27')](_0x9881('0x14c'),_0x556681[_0x4d011e]));if(_0xbd2d15[_0x9881('0xaa')]===-0x1){return _0xbd2d15;}logger[_0x9881('0x2e')](util[_0x9881('0x27')]('IFTIME\x20%s\x20%s',_0x556681[_0x4d011e],_0xbd2d15[_0x9881('0xa1')]));if(_0xbd2d15[_0x9881('0xa1')]===_0x9881('0x14d')){logger[_0x9881('0x2e')](util['format'](_0x9881('0x14e'),_0x556681[_0x4d011e],_0x9881('0x14d')));this[_0x9881('0xc')][_0x9881('0xa6')](util[_0x9881('0x27')]('IFTIME\x20%s\x20%s',_0x556681[_0x4d011e],'true'));return{'code':0xc8,'result':'true'};}else{logger[_0x9881('0x2e')](util['format'](_0x9881('0x14e'),_0x556681[_0x4d011e],'false'));this[_0x9881('0xc')][_0x9881('0xa6')](util[_0x9881('0x27')](_0x9881('0x14e'),_0x556681[_0x4d011e],'false'));}}return{'code':0xc8,'result':_0x9881('0x147')};};AGIVertices[_0x9881('0xe')][_0x9881('0x14f')]=function(_0x2590c8){logger[_0x9881('0x2e')](util[_0x9881('0x27')](_0x9881('0x150'),_0x2590c8[_0x9881('0x38')]));return this[_0x9881('0xc')][_0x9881('0x14f')]();};AGIVertices['prototype'][_0x9881('0x151')]=function(_0x4ce7f4){logger[_0x9881('0x2e')](util[_0x9881('0x27')](_0x9881('0x152'),_0x4ce7f4[_0x9881('0x38')]));if(!this[_0x9881('0x84')](_0x4ce7f4[_0x9881('0x7f')])){return this[_0x9881('0xc')][_0x9881('0xa6')](_0x9881('0x132'));}var _0x4af8a3='wav';var _0x341a81=util[_0x9881('0x27')](_0x9881('0x134'),FILES_PATH,rs[_0x9881('0x116')](0x4));var _0x55c92d=util[_0x9881('0x27')]('%s.%s',_0x341a81,_0x4af8a3);var _0x8825ff=!![];if(_0x4ce7f4[_0x9881('0x135')]===_0x9881('0x136')){_0x8825ff=![];}var _0x5a66de=this[_0x9881('0xc')][_0x9881('0x137')](_0x341a81,_0x4af8a3,_0x4ce7f4[_0x9881('0x138')],_0x4ce7f4[_0x9881('0x64')],undefined,_0x8825ff);if(_0x5a66de[_0x9881('0xaa')]!==-0x1){this[_0x9881('0xc')][_0x9881('0xa6')](util['format'](_0x9881('0x153'),_0x55c92d));var _0x7261e7=this['ispeechASR'][_0x9881('0x6f')](this,_0x4ce7f4,_0x55c92d);if(_0x7261e7){for(var _0x1ac5f7 in _0x7261e7){if(_0x7261e7[_0x9881('0x94')](_0x1ac5f7)){this[_0x9881('0xc')][_0x9881('0x9e')](util[_0x9881('0x27')](_0x9881('0x154'),_0x1ac5f7[_0x9881('0x67')]()),_0x7261e7[_0x1ac5f7]);}}return this[_0x9881('0xc')]['noop'](util[_0x9881('0x27')](_0x9881('0x155'),JSON[_0x9881('0x72')](_0x7261e7)));}}return _0x5a66de;};AGIVertices['prototype'][_0x9881('0x156')]=function(_0x3b2f29){logger['info'](util['format']('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x3b2f29['label']));if(!this[_0x9881('0x84')](_0x3b2f29[_0x9881('0x7f')])){return this[_0x9881('0xc')]['noop'](_0x9881('0x132'));}if(!this[_0x9881('0x84')](_0x3b2f29[_0x9881('0x5b')])){return this[_0x9881('0xc')]['noop'](_0x9881('0xa7'));}this['channel'][_0x9881('0xa6')](util[_0x9881('0x27')](_0x9881('0x157'),_0x3b2f29[_0x9881('0x5b')]));var _0x467bee=this[_0x9881('0x7e')]['sync'](this,_0x3b2f29);if(_0x467bee){this[_0x9881('0xc')][_0x9881('0xa6')](util[_0x9881('0x27')](_0x9881('0x153'),_0x467bee));var _0x406037=this[_0x9881('0xc')][_0x9881('0x125')](_0x467bee,_0x3b2f29[_0x9881('0x138')]);try{fs['unlink'](_0x467bee+_0x9881('0x105'));}catch(_0x5f15e0){logger['error'](_0x5f15e0);}return _0x406037;}return this[_0x9881('0xc')][_0x9881('0x2b')](_0x3b2f29,_0x9881('0x158'));};AGIVertices[_0x9881('0xe')][_0x9881('0x159')]=function(_0x2fa80d){logger[_0x9881('0x2e')](util[_0x9881('0x27')](_0x9881('0x15a'),_0x2fa80d[_0x9881('0x38')]));if(!this[_0x9881('0x84')](_0x2fa80d[_0x9881('0x15b')])){return this[_0x9881('0xc')][_0x9881('0x2b')](_0x2fa80d,_0x9881('0x15c'));}logger[_0x9881('0x2e')](util[_0x9881('0x27')](_0x9881('0x15d'),this[_0x9881('0xc')][_0x9881('0x3a')],_0x2fa80d[_0x9881('0x15b')]));var _0x335a96=this[_0x9881('0x53')][_0x9881('0x6f')](this,_0x2fa80d['findBy']);if(_0x335a96){logger[_0x9881('0x2e')](util['format'](_0x9881('0x15e'),this[_0x9881('0xc')]['callerid'],_0x2fa80d[_0x9881('0x15b')]));this[_0x9881('0xc')]['noop'](util[_0x9881('0x27')](_0x9881('0x15e'),this[_0x9881('0xc')]['callerid'],_0x2fa80d[_0x9881('0x15b')]));return{'code':0xc8,'result':_0x9881('0x15f')};}else{logger['info'](util[_0x9881('0x27')](_0x9881('0x160'),this[_0x9881('0xc')][_0x9881('0x3a')],_0x2fa80d[_0x9881('0x15b')]));this[_0x9881('0xc')][_0x9881('0xa6')](util['format'](_0x9881('0x160'),this[_0x9881('0xc')][_0x9881('0x3a')],_0x2fa80d[_0x9881('0x15b')]));return{'code':0xc8,'result':_0x9881('0x161')};}};AGIVertices['prototype'][_0x9881('0x162')]=function(_0x4a0a2f){logger[_0x9881('0x2e')](util['format'](_0x9881('0x163'),_0x4a0a2f[_0x9881('0x38')]));if(!this[_0x9881('0x84')](_0x4a0a2f[_0x9881('0x15b')])){return this[_0x9881('0xc')][_0x9881('0x2b')](_0x4a0a2f,'no\x20find\x20by\x20configured');}logger[_0x9881('0x2e')](util[_0x9881('0x27')](_0x9881('0x15d'),this['channel'][_0x9881('0x3a')],_0x4a0a2f[_0x9881('0x15b')]));var _0x2ef54f=this[_0x9881('0x52')][_0x9881('0x6f')](this,_0x4a0a2f[_0x9881('0x15b')]);if(_0x2ef54f){logger['info'](util[_0x9881('0x27')](_0x9881('0x15e'),this['channel'][_0x9881('0x3a')],_0x4a0a2f['findBy']));this[_0x9881('0xc')]['noop'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x9881('0xc')][_0x9881('0x3a')],_0x4a0a2f[_0x9881('0x15b')]));return{'code':0xc8,'result':_0x9881('0x15f')};}else{logger['info'](util['format'](_0x9881('0x160'),this['channel'][_0x9881('0x3a')],_0x4a0a2f[_0x9881('0x15b')]));this[_0x9881('0xc')][_0x9881('0xa6')](util[_0x9881('0x27')](_0x9881('0x160'),this[_0x9881('0xc')][_0x9881('0x3a')],_0x4a0a2f[_0x9881('0x15b')]));return{'code':0xc8,'result':_0x9881('0x161')};}};AGIVertices[_0x9881('0xe')]['math']=function(_0x169e8b){logger[_0x9881('0x2e')](util[_0x9881('0x27')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x169e8b['label']));if(!this[_0x9881('0x84')](_0x169e8b[_0x9881('0x164')])){return this[_0x9881('0xc')]['error'](_0x169e8b,'no\x20operation\x20configured');}this['channel'][_0x9881('0xa6')](util[_0x9881('0x27')]('math\x20%s',_0x169e8b[_0x9881('0x164')]));var _0x482132=eval(_0x169e8b[_0x9881('0x164')]);if(!this[_0x9881('0x84')](_0x169e8b[_0x9881('0xdb')])){return this[_0x9881('0xc')][_0x9881('0xa6')](_0x9881('0xdc'));}var _0x2c2ba8=this[_0x9881('0xf')]['sync'](this,_0x169e8b[_0x9881('0xdb')]);if(!_0x2c2ba8){return this[_0x9881('0xc')]['error'](_0x169e8b,'no\x20variable\x20found');}if(_[_0x9881('0x99')](_0x482132)){var _0x49502e=this;_0x482132[_0x9881('0xde')](function(_0x4ab5de,_0x2bb16b){_0x49502e['channel'][_0x9881('0x9e')](util[_0x9881('0x27')]('%s[%s]',_0x2c2ba8,_0x2bb16b),_0x4ab5de);});return this[_0x9881('0xc')]['noop'](util[_0x9881('0x27')](_0x9881('0x165'),_0x2c2ba8));}else{return this[_0x9881('0xc')][_0x9881('0x9e')](_0x2c2ba8,_0x482132);}};AGIVertices[_0x9881('0xe')][_0x9881('0xb')]=function(_0x5c3d10){logger[_0x9881('0x2e')](util[_0x9881('0x27')](_0x9881('0x166'),_0x5c3d10[_0x9881('0x38')]));if(_0x5c3d10['retry']===0x0){return this[_0x9881('0xa2')](_0x5c3d10);}_0x5c3d10[_0x9881('0xa3')]-=0x1;if(!this['isConfigured'](_0x5c3d10[_0x9881('0x110')])){return this[_0x9881('0xc')]['error'](_0x5c3d10,_0x9881('0x10f'));}var _0x1395f4=this[_0x9881('0x1c')][_0x9881('0x6f')](this,_0x5c3d10[_0x9881('0x110')]);if(!_0x1395f4){return this[_0x9881('0xc')][_0x9881('0x2b')](_0x5c3d10,_0x9881('0x167'));}var _0x229c66=this[_0x9881('0xc')][_0x9881('0x111')](_0x1395f4,_0x5c3d10[_0x9881('0x168')],_0x5c3d10['digit']);var _0x5212db=_0x229c66[_0x9881('0xaa')];if(_0x229c66[_0x9881('0xaa')]===-0x1){this[_0x9881('0x36')][_0x9881('0x6f')](this,_0x5c3d10,'-1');return _0x229c66;}else if(_0x229c66[_0x9881('0xa1')]==='timeout'){_0x229c66['result']=_0x229c66['result'][_0x9881('0x9a')]>0x0?_0x229c66[_0x9881('0xaa')]:'t';}else if(_[_0x9881('0x43')](_0x229c66[_0x9881('0xaa')])){_0x229c66[_0x9881('0xaa')]='#';_0x5212db='#';}if(!this['isConfigured'](_0x5c3d10[_0x9881('0xdb')])){this['channel'][_0x9881('0xa6')](_0x9881('0xdc'));}else{var _0x2d21e8=this['getVariable'][_0x9881('0x6f')](this,_0x5c3d10[_0x9881('0xdb')]);if(!_0x2d21e8){return this[_0x9881('0xc')]['error'](_0x5c3d10,_0x9881('0xdd'));}this[_0x9881('0xc')][_0x9881('0x9e')](_0x2d21e8,_0x5212db);}this['createSquareDetailsReport'][_0x9881('0x6f')](this,_0x5c3d10,_0x5212db);return _0x229c66;};AGIVertices['prototype'][_0x9881('0xa6')]=function(_0x125e0a){logger[_0x9881('0x2e')](util['format'](_0x9881('0x169'),_0x125e0a['label']));return this['channel'][_0x9881('0xa6')](_0x125e0a[_0x9881('0x16a')]||_0x125e0a[_0x9881('0x38')]);};AGIVertices[_0x9881('0xe')]['pause']=function(_0x41326d){logger[_0x9881('0x2e')](util[_0x9881('0x27')](_0x9881('0x16b'),_0x41326d['label']));if(!this[_0x9881('0x84')](_0x41326d[_0x9881('0x15b')])){return this[_0x9881('0xc')][_0x9881('0x2b')](_0x41326d,_0x9881('0x15c'));}logger[_0x9881('0x2e')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x9881('0xc')]['callerid'],_0x41326d[_0x9881('0x15b')]));var _0xbe5457=this['getPause'][_0x9881('0x6f')](this,_0x41326d[_0x9881('0x16c')]);var _0x3d88a6=this[_0x9881('0x4f')][_0x9881('0x6f')](this,_0x41326d['findBy'],_0xbe5457);if(_0x3d88a6){logger['info'](util[_0x9881('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x9881('0xc')]['callerid'],_0x41326d[_0x9881('0x15b')]));this[_0x9881('0xc')]['noop'](util[_0x9881('0x27')](_0x9881('0x15e'),this[_0x9881('0xc')][_0x9881('0x3a')],_0x41326d[_0x9881('0x15b')]));return{'code':0xc8,'result':_0x9881('0x15f')};}else{logger[_0x9881('0x2e')](util[_0x9881('0x27')](_0x9881('0x160'),this[_0x9881('0xc')]['callerid'],_0x41326d['findBy']));this[_0x9881('0xc')][_0x9881('0xa6')](util[_0x9881('0x27')](_0x9881('0x15e'),this[_0x9881('0xc')][_0x9881('0x3a')],_0x41326d[_0x9881('0x15b')]));return{'code':0xc8,'result':_0x9881('0x161')};}};AGIVertices[_0x9881('0xe')]['playback']=function(_0x9e0295){logger['info'](util[_0x9881('0x27')](_0x9881('0x16d'),_0x9e0295[_0x9881('0x38')]));if(!this[_0x9881('0x84')](_0x9e0295['file_id'])){return this[_0x9881('0xc')][_0x9881('0x2b')](_0x9e0295,_0x9881('0x10f'));}var _0x127381=this[_0x9881('0x1c')][_0x9881('0x6f')](this,_0x9e0295[_0x9881('0x110')]);if(!_0x127381){return this[_0x9881('0xc')][_0x9881('0x2b')](_0x9e0295,_0x9881('0x167'));}var _0x3ea358=this['channel'][_0x9881('0xa8')]('PLAYBACK',[_0x127381,_0x9e0295['opts']]);if(_0x3ea358['result']===-0x1){return _0x3ea358;}return this[_0x9881('0xc')]['noop'](util['format'](_0x9881('0x16e'),'PLAYBACK',_0x127381));};AGIVertices[_0x9881('0xe')][_0x9881('0x16f')]=function(_0x329283){logger[_0x9881('0x2e')](util[_0x9881('0x27')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x329283['label']));if(!this['isConfigured'](_0x329283[_0x9881('0x170')])){return this[_0x9881('0xc')][_0x9881('0x2b')](_0x329283,_0x9881('0x171'));}var _0x261e2e='';var _0x550aee=parseInt(_0x329283[_0x9881('0x170')],0xa);if(isNaN(_0x550aee)){_0x261e2e=_0x329283[_0x9881('0x170')];}else{_0x261e2e=this[_0x9881('0x172')][_0x9881('0x6f')](this,_0x329283['queue_id']);if(!_0x261e2e){return this[_0x9881('0xc')][_0x9881('0x2b')](_0x329283,_0x9881('0x173'));}}var _0x2c7599='';if(this['isConfigured'](_0x329283[_0x9881('0x110')])){var _0x28ac6e=this[_0x9881('0x1c')][_0x9881('0x6f')](this,_0x329283['file_id']);if(_0x28ac6e){_0x2c7599=_0x28ac6e;}}this[_0x9881('0x36')][_0x9881('0x6f')](this,_0x329283,_0x261e2e);if(_0x329283[_0x9881('0xe9')]['indexOf']('x')<0x0){_0x329283['opts']+='x';}if(_0x329283[_0x9881('0xe9')]['indexOf']('X')<0x0){_0x329283[_0x9881('0xe9')]+='X';}this[_0x9881('0xc')][_0x9881('0x9e')](_0x9881('0x174'),_0x261e2e?_0x261e2e[_0x9881('0x175')]():'');var _0x3e4f57=this[_0x9881('0xc')]['exec'](_0x9881('0x176'),[_0x261e2e,_0x329283['opts'],_0x329283[_0x9881('0x62')],_0x2c7599,_0x329283[_0x9881('0x64')],_0x329283[_0x9881('0x6')],_0x329283[_0x9881('0x177')],_0x329283[_0x9881('0x178')],'',_0x329283[_0x9881('0x179')]]);if(_0x3e4f57['result']===-0x1){return _0x3e4f57;}return this[_0x9881('0xc')][_0x9881('0xa6')](util[_0x9881('0x27')](_0x9881('0x16e'),_0x9881('0x176'),_0x261e2e));};AGIVertices[_0x9881('0xe')][_0x9881('0x17a')]=function(_0x50d404){logger['info'](util[_0x9881('0x27')](_0x9881('0x17b'),_0x50d404[_0x9881('0x38')]));var _0x32337c=_0x50d404['recordingFormat']||_0x9881('0x133');var _0x39a6a4=util['format'](_0x9881('0x17c'),this[_0x9881('0xc')][_0x9881('0x37')],rs['generate'](0x5));var _0x31a373=util['format'](_0x9881('0x17d'),FILES_PATH,_0x39a6a4,_0x32337c);var _0x167440=util['format'](_0x9881('0x134'),FILES_PATH,_0x39a6a4);this[_0x9881('0x3b')][_0x9881('0x6f')](this,_0x50d404,_0x39a6a4,_0x31a373);this[_0x9881('0xc')]['setVariable']('RECORDING_SAVENAME',_0x39a6a4);logger[_0x9881('0x2e')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x167440,_0x32337c,_0x50d404[_0x9881('0x17e')],_0x50d404['timeout']);return this[_0x9881('0xc')][_0x9881('0x137')](_0x167440,_0x32337c,_0x50d404['escape_digits'],_0x50d404[_0x9881('0x64')],undefined,!![]);};AGIVertices[_0x9881('0xe')]['restapi']=function(_0x4d6419){logger[_0x9881('0x2e')](util['format'](_0x9881('0x17f'),_0x4d6419[_0x9881('0x38')]));if(!this[_0x9881('0x84')](_0x4d6419[_0x9881('0x62')])){return this['channel'][_0x9881('0xa6')](_0x9881('0x180'));}var _0x1e8492=this[_0x9881('0x181')][_0x9881('0x6f')](this,_0x4d6419);logger['info'](util['format'](_0x9881('0x182'),util['inspect'](_0x1e8492,{'showHidden':![],'depth':null})));if(!this[_0x9881('0x84')](_0x4d6419[_0x9881('0xdb')])){return this[_0x9881('0xc')][_0x9881('0xa6')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x2e9833=this[_0x9881('0xf')][_0x9881('0x6f')](this,_0x4d6419[_0x9881('0xdb')]);if(!_0x2e9833){return this[_0x9881('0xc')][_0x9881('0x2b')](_0x4d6419,_0x9881('0xdd'));}this[_0x9881('0xc')][_0x9881('0x9e')](util['format'](_0x9881('0x183'),_0x2e9833),_0x1e8492[_0x9881('0x73')]?_0x1e8492[_0x9881('0x73')]:_0x9881('0x184'));this[_0x9881('0xc')][_0x9881('0x9e')](util['format']('%s_STATUS_MESSAGE',_0x2e9833),_0x1e8492['statusMessage']?_0x1e8492[_0x9881('0x185')]:'OK');if(_0x1e8492[_0x9881('0x68')]){try{this[_0x9881('0x9c')](_0x1e8492[_0x9881('0x68')],_0x2e9833);}catch(_0x1b628a){logger[_0x9881('0x2b')](util['format'](_0x9881('0x186'),_0x2e9833));}}return this[_0x9881('0xc')][_0x9881('0xa6')](util[_0x9881('0x27')](_0x9881('0xe2'),_0x2e9833));};AGIVertices[_0x9881('0xe')][_0x9881('0x187')]=function(_0x501825){logger[_0x9881('0x2e')](util[_0x9881('0x27')](_0x9881('0x188'),_0x501825['label']));return this[_0x9881('0xc')][_0x9881('0x189')](_0x501825[_0x9881('0x18a')][_0x9881('0x57')](/\s+/g,''),_0x501825[_0x9881('0x17e')]);};AGIVertices[_0x9881('0xe')]['saynumber']=function(_0x3b5d59){logger['info'](util[_0x9881('0x27')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x3b5d59[_0x9881('0x38')]));return this[_0x9881('0xc')][_0x9881('0x18b')](_0x3b5d59['number']['replace'](/\s+/g,''),_0x3b5d59[_0x9881('0x17e')]);};AGIVertices[_0x9881('0xe')][_0x9881('0x18c')]=function(_0x228f3c){logger[_0x9881('0x2e')](util[_0x9881('0x27')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x228f3c[_0x9881('0x38')]));return this[_0x9881('0xc')][_0x9881('0x18d')](_0x228f3c[_0x9881('0x5b')],_0x228f3c[_0x9881('0x17e')]);};AGIVertices[_0x9881('0xe')]['sendMail']=function(_0xec4cb7){logger[_0x9881('0x2e')](util[_0x9881('0x27')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0xec4cb7['label']));if(!this['isConfigured'](_0xec4cb7[_0x9881('0x18e')])){return this[_0x9881('0xc')][_0x9881('0xa6')](_0x9881('0x18f'));}var _0x54cd4b=this['getMailAccount'][_0x9881('0x6f')](this,_0xec4cb7[_0x9881('0x18e')]);if(!_0x54cd4b||!_0x54cd4b['Smtp']){return this[_0x9881('0xc')][_0x9881('0x2b')](_0xec4cb7,_0x9881('0x190'));}var _0x3dee1c={'from':util[_0x9881('0x27')](_0x9881('0x191'),_0x54cd4b[_0x9881('0x13')],_0x54cd4b[_0x9881('0x192')]||_0x54cd4b[_0x9881('0x193')][_0x9881('0x194')]),'to':_0xec4cb7['to']||'','cc':_0xec4cb7['cc']||'','bcc':_0xec4cb7[_0x9881('0x195')]||'','subject':_0xec4cb7[_0x9881('0x196')],'html':_0xec4cb7['text'],'text':_0xec4cb7[_0x9881('0x5b')]};if(this['isConfigured'](_0xec4cb7[_0x9881('0x197')])){}logger[_0x9881('0xe3')]('sendMail\x20message',JSON[_0x9881('0x72')](_0x3dee1c));this[_0x9881('0x36')]['sync'](this,_0xec4cb7,_0xec4cb7[_0x9881('0x18e')]);this[_0x9881('0xc')][_0x9881('0xa6')](util[_0x9881('0x27')](_0x9881('0x198'),_0x54cd4b['name']));this[_0x9881('0x21')][_0x9881('0x6f')](this,_0x54cd4b[_0x9881('0x199')],_0x3dee1c);return this['channel'][_0x9881('0xa6')](_0x9881('0x19a'));};AGIVertices[_0x9881('0xe')][_0x9881('0x19b')]=function(_0x4104cd){logger['info'](util['format'](_0x9881('0x19c'),_0x4104cd[_0x9881('0x38')]));return this[_0x9881('0xc')]['noop'](_0x9881('0x19d'));};AGIVertices[_0x9881('0xe')]['sendSMS']=function(_0x24e2e8){logger['info'](util[_0x9881('0x27')](_0x9881('0x19e'),_0x24e2e8[_0x9881('0x38')]));if(!this[_0x9881('0x84')](_0x24e2e8[_0x9881('0x19f')])){return this[_0x9881('0xc')][_0x9881('0xa6')](_0x9881('0x1a0'));}var _0x5a880a=this[_0x9881('0x33')][_0x9881('0x6f')](this,_0x24e2e8[_0x9881('0x19f')]);if(!_0x5a880a){return this['channel'][_0x9881('0x2b')](_0x24e2e8,_0x9881('0x1a1'));}var _0x261e36={'body':_0x24e2e8[_0x9881('0x1a2')],'phone':_0x24e2e8['to']||'','SmsAccountId':_0x5a880a['id']};logger[_0x9881('0xe3')](_0x9881('0x1a3'),JSON[_0x9881('0x72')](_0x261e36));this[_0x9881('0x36')][_0x9881('0x6f')](this,_0x24e2e8,_0x24e2e8[_0x9881('0x19f')]);this[_0x9881('0xc')][_0x9881('0xa6')](util[_0x9881('0x27')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x5a880a[_0x9881('0x13')]));this[_0x9881('0x35')][_0x9881('0x6f')](this,_0x261e36);return this[_0x9881('0xc')]['noop'](_0x9881('0x1a4'));};AGIVertices[_0x9881('0xe')]['set']=function(_0x478a8e){logger[_0x9881('0x2e')](util[_0x9881('0x27')](_0x9881('0x1a5'),_0x478a8e[_0x9881('0x38')]));if(!this[_0x9881('0x84')](_0x478a8e[_0x9881('0xdb')])){return this['channel'][_0x9881('0x2b')](_0x478a8e,_0x9881('0x1a6'));}var _0x5e9a0d=this['getVariable'][_0x9881('0x6f')](this,_0x478a8e['variable_id']);if(!_0x5e9a0d){return this[_0x9881('0xc')][_0x9881('0x2b')](_0x478a8e,_0x9881('0xdd'));}return this['channel']['setVariable'](_0x5e9a0d,_0x478a8e[_0x9881('0x1a7')]);};AGIVertices['prototype']['start']=function(_0x3c1a49){logger[_0x9881('0x2e')](util[_0x9881('0x27')](_0x9881('0x1a8'),_0x3c1a49[_0x9881('0x38')]));this[_0x9881('0xc')]['noop'](_0x9881('0x1a9'));var _0x13235f=this[_0x9881('0xc')][_0x9881('0xf')](_0x9881('0x1aa'));if(!_['isEmpty'](_0x13235f[_0x9881('0xa1')])){this['channel'][_0x9881('0x37')]=_0x13235f[_0x9881('0xa1')];}if(_0x3c1a49['answer']===_0x9881('0x1ab')){this['channel'][_0x9881('0xa6')](_0x9881('0x1ac'));return this['channel'][_0x9881('0xb9')]();}return this['channel']['noop'](_0x9881('0x1ad'));};AGIVertices[_0x9881('0xe')]['subproject']=function(_0x21ef81){logger[_0x9881('0x2e')](util[_0x9881('0x27')](_0x9881('0x1ae'),_0x21ef81[_0x9881('0x38')]));if(!this[_0x9881('0x84')](_0x21ef81['project_id'])){return this['channel']['error'](_0x21ef81,'no\x20subproject\x20selected');}var _0x4638ea=this['getSquareProject']['sync'](this,_0x21ef81[_0x9881('0x1af')]);if(!this[_0x9881('0x84')](_0x4638ea)){return this[_0x9881('0xc')]['error'](_0x21ef81,util['format'](_0x9881('0x1b0'),_0x21ef81['project_id']));}if(_0x4638ea===this[_0x9881('0xc')]['arg_1']){return this[_0x9881('0xc')]['error'](_0x21ef81,_0x9881('0x1b1'));}this[_0x9881('0x36')][_0x9881('0x6f')](this,_0x21ef81,_0x4638ea);var _0x14df05=this[_0x9881('0xc')][_0x9881('0xa8')](_0x9881('0x1b2'),util[_0x9881('0x27')](_0x9881('0x1b3'),config[_0x9881('0x6')][_0x9881('0x1b4')]||_0x9881('0x1b5'),_0x4638ea,this[_0x9881('0xc')][_0x9881('0x3f')]));if(_0x14df05[_0x9881('0xaa')]===-0x1){return _0x14df05;}return this[_0x9881('0xc')][_0x9881('0xa6')](util[_0x9881('0x27')]('Executed\x20command\x20%s\x20%s',_0x9881('0x1b2'),_0x4638ea));};AGIVertices[_0x9881('0xe')]['system']=function(_0x345c4b){logger[_0x9881('0x2e')](util[_0x9881('0x27')](_0x9881('0x1b6'),_0x345c4b[_0x9881('0x38')]));var _0x1a378b=this['shellCommand'][_0x9881('0x6f')](this,_0x345c4b[_0x9881('0xb8')]);this['createSquareDetailsReport'][_0x9881('0x6f')](this,_0x345c4b,_0x345c4b[_0x9881('0xb8')]);if(this[_0x9881('0x84')](_0x345c4b[_0x9881('0xdb')])){var _0x3f3af7=this['getVariable']['sync'](this,_0x345c4b[_0x9881('0xdb')]);if(_0x3f3af7){this[_0x9881('0xc')]['setVariable'](_0x3f3af7,_0x1a378b);return this['channel'][_0x9881('0xa6')](util[_0x9881('0x27')](_0x9881('0x1b7'),_0x345c4b[_0x9881('0xb8')],_0x3f3af7));}}return this['channel'][_0x9881('0xa6')](util['format']('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x345c4b[_0x9881('0xb8')]));};AGIVertices[_0x9881('0xe')][_0x9881('0x1b8')]=function(_0x5a70d8){logger['info'](util[_0x9881('0x27')](_0x9881('0x1b9'),_0x5a70d8[_0x9881('0x38')]));_0x5a70d8['text']=_0x5a70d8['text'][_0x9881('0x57')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x9881('0x84')](_0x5a70d8[_0x9881('0x59')])){return this['channel'][_0x9881('0xa6')](_0x9881('0x1ba'));}if(!this[_0x9881('0x84')](_0x5a70d8[_0x9881('0x5b')])){return this['channel'][_0x9881('0xa6')](_0x9881('0xa7'));}this['channel'][_0x9881('0xa6')](util[_0x9881('0x27')](_0x9881('0x1bb'),_0x5a70d8[_0x9881('0x5b')]));var _0x455353=this['googleCloudTTS'][_0x9881('0x6f')](this,_0x5a70d8);if(_0x455353){this[_0x9881('0xc')][_0x9881('0xa6')](util[_0x9881('0x27')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x455353));var _0x863b56=this[_0x9881('0xc')][_0x9881('0x125')](_0x455353);try{fs[_0x9881('0x126')](_0x455353+_0x9881('0x105'));}catch(_0x3d77a9){logger[_0x9881('0x2b')](_0x3d77a9);}return _0x863b56;}return this['channel'][_0x9881('0x2b')](_0x5a70d8,_0x9881('0x1bc'));};AGIVertices[_0x9881('0xe')][_0x9881('0x1bd')]=function(_0x38ec47){logger['info'](util[_0x9881('0x27')](_0x9881('0x1be'),_0x38ec47[_0x9881('0x38')]));_0x38ec47['text']=_0x38ec47[_0x9881('0x5b')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x9881('0x84')](_0x38ec47[_0x9881('0x5b')])){return this[_0x9881('0xc')][_0x9881('0xa6')](_0x9881('0xa7'));}this[_0x9881('0xc')][_0x9881('0xa6')](util['format']('Trying\x20Google\x20TTS\x20%s',_0x38ec47[_0x9881('0x5b')]));var _0x3a1283=this[_0x9881('0x60')][_0x9881('0x6f')](this,_0x38ec47);if(_0x3a1283){this[_0x9881('0xc')][_0x9881('0xa6')](util[_0x9881('0x27')](_0x9881('0x1bf'),_0x3a1283));var _0x287b30=this[_0x9881('0xc')]['streamFile'](_0x3a1283);try{fs['unlink'](_0x3a1283+'.wav');}catch(_0x56db28){logger[_0x9881('0x2b')](_0x56db28);}return _0x287b30;}return this[_0x9881('0xc')][_0x9881('0x2b')](_0x38ec47,_0x9881('0x1c0'));};AGIVertices[_0x9881('0xe')][_0x9881('0x1c1')]=function(_0x4e0fc0){logger[_0x9881('0x2e')](util['format'](_0x9881('0x1c2'),_0x4e0fc0[_0x9881('0x38')]));if(!this[_0x9881('0x84')](_0x4e0fc0[_0x9881('0x15b')])){return this[_0x9881('0xc')][_0x9881('0x2b')](_0x4e0fc0,'no\x20find\x20by\x20configured');}logger[_0x9881('0x2e')](util[_0x9881('0x27')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel']['callerid'],_0x4e0fc0[_0x9881('0x15b')]));var _0x3e147e=this['agentUnpause'][_0x9881('0x6f')](this,_0x4e0fc0['findBy']);if(_0x3e147e){logger['info'](util['format'](_0x9881('0x15e'),this[_0x9881('0xc')][_0x9881('0x3a')],_0x4e0fc0['findBy']));this[_0x9881('0xc')]['noop'](util[_0x9881('0x27')](_0x9881('0x15e'),this['channel'][_0x9881('0x3a')],_0x4e0fc0[_0x9881('0x15b')]));return{'code':0xc8,'result':_0x9881('0x15f')};}else{logger[_0x9881('0x2e')](util[_0x9881('0x27')](_0x9881('0x160'),this[_0x9881('0xc')][_0x9881('0x3a')],_0x4e0fc0[_0x9881('0x15b')]));this[_0x9881('0xc')][_0x9881('0xa6')](util[_0x9881('0x27')](_0x9881('0x160'),this[_0x9881('0xc')][_0x9881('0x3a')],_0x4e0fc0[_0x9881('0x15b')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype']['voicemail']=function(_0x4886de){logger[_0x9881('0x2e')](util[_0x9881('0x27')](_0x9881('0x1c3'),_0x4886de[_0x9881('0x38')]));var _0x2611c1=this[_0x9881('0xc')][_0x9881('0xa8')](_0x9881('0x1c4'),[_0x4886de[_0x9881('0x1c5')],_0x4886de[_0x9881('0x75')]]);if(_0x2611c1[_0x9881('0xaa')]===-0x1){return _0x2611c1;}return this[_0x9881('0xc')][_0x9881('0xa6')](util[_0x9881('0x27')]('Executed\x20command\x20%s\x20%s',_0x9881('0x1c4'),_0x4886de['mailbox']));};AGIVertices[_0x9881('0xe')][_0x9881('0x1c6')]=function(_0x448aa0){logger[_0x9881('0x2e')](util['format'](_0x9881('0x1c7'),_0x448aa0[_0x9881('0x38')]));if(!this[_0x9881('0x84')](_0x448aa0['variable_id'])){return this[_0x9881('0xc')][_0x9881('0x2b')](_0x448aa0,_0x9881('0x1a6'));}var _0x241ffa=this[_0x9881('0xf')][_0x9881('0x6f')](this,_0x448aa0[_0x9881('0xdb')]);if(!_0x241ffa){return this['channel'][_0x9881('0x2b')](_0x448aa0,_0x9881('0xdd'));}var _0x96e44b=this[_0x9881('0xc')][_0x9881('0xf')](_0x241ffa);return{'code':0xc8,'result':_0x96e44b['extra']?_0x96e44b['extra']:'-'};};String[_0x9881('0xe')][_0x9881('0x9f')]=function(_0x53b1a7,_0x4cd45f){return this['split'](_0x53b1a7)[_0x9881('0x1c8')](_0x4cd45f);};module['exports']=AGIVertices; \ No newline at end of file +var _0x3937=['trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','mindigit','no\x20variable\x20found','hiddendigitsnum','hiddendigitspos','first','substr','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','unlink','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','wav','%s/recordings/%s','beep','NOBEEP','recordFile','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','intKey','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME\x20%s\x20%s','true','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','no\x20key\x20configured','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','Enter\x20in\x20LOGOUT\x20(%s)\x20block','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20MATH\x20(%s)\x20block','math\x20%s','operation','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','no\x20variable\x20selected\x20for\x20the\x20result','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','XMCS-QUEUE','toLowerCase','gosub','position','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','statusCode','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','sayPhonetic','sendMail','account_id','getMailAccount','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','bcc','subject','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','getSquareProject','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','host','AGI','system','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','.wav','Google\x20TTS\x20is\x20unreachable','unpause','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','shelljs','odbc','moment','request-promise','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','rpc','prototype','getVariableById','then','catch','getVoiceQueue','getVoiceQueueById','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getUser','getTrunk','getTrunkById','name','getSound','getSoundById','getSoundPath','getMailAccountById','sendMailMessage','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','Error\x20executing\x20query\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','agicommand','arg_1','callerid','createSquareRecording','uniqueid','calleridname','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','internal','%s/%s@from-sip/n','LOCAL','agentLogin','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','method','timeout','includes','POST','PUT','body','parse','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','url','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','clear','clone','hasOwnProperty','isString','recursiveNodeIndex','isPlainObject','isArray','replaceAllVariables','saveRestApiResult','length','%s.%s','replaceObjectAllVariables','stringify','split','replaceAll','getVariable','extra','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','getAndSetVariable','RECOG_INPUT()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','add','delay','minutes','custom_app','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','query','no\x20query\x20configured','query:\x20%s','variable_id','forEach','%s[%s][%s]','%s_ROWS_COUNT','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','opts','Executed\x20command\x20%s','dialogflow','bot','Trying\x20Dialogflow:\x20%s','toUpperCase','speech','out','Dialogflow\x20Result\x20%s','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','client_email','no\x20client_email\x20configured','private_key','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3937,0xbf));var _0x7393=function(_0x2e47fb,_0x46f673){_0x2e47fb=_0x2e47fb-0x0;var _0x422740=_0x3937[_0x2e47fb];return _0x422740;};'use strict';var fs=require('fs');var util=require(_0x7393('0x0'));var _=require('lodash');var sh=require(_0x7393('0x1'));var odbc=require(_0x7393('0x2'))();var rs=require('randomstring');var moment=require(_0x7393('0x3'));var Mustache=require('mustache');var rp=require(_0x7393('0x4'));var logger=require('../../config/logger')(_0x7393('0x5'));var config=require(_0x7393('0x6'));var scripts=require(_0x7393('0x7'));var FILES_PATH=_0x7393('0x8');var recursiveMapAttributes=[_0x7393('0x9'),_0x7393('0xa')];var verticesWithRetry=[_0x7393('0xb'),_0x7393('0xc'),_0x7393('0xd')];var AGIVertices=function(_0x4efb50,_0x565ab6,_0x287359){this[_0x7393('0xe')]=_0x4efb50;this[_0x7393('0xf')]=_0x565ab6;this['mailRpc']=_0x287359;};AGIVertices[_0x7393('0x10')]['getVariable']=function(_0x56ed4c,_0x47c5c6){this['rpc'][_0x7393('0x11')](_0x56ed4c)[_0x7393('0x12')](function(_0x29d8cc){_0x47c5c6(null,_0x29d8cc?_0x29d8cc['name']:![]);})[_0x7393('0x13')](function(_0x470f09){_0x47c5c6(_0x470f09);});};AGIVertices[_0x7393('0x10')][_0x7393('0x14')]=function(_0xe86cf4,_0x1fe171){this[_0x7393('0xf')][_0x7393('0x15')](_0xe86cf4)[_0x7393('0x12')](function(_0x4e521c){_0x1fe171(null,_0x4e521c?_0x4e521c['name']:![]);})[_0x7393('0x13')](function(_0x5d0d2b){_0x1fe171(_0x5d0d2b);});};AGIVertices['prototype']['getSquareProject']=function(_0x82f5fa,_0x54dc47){this[_0x7393('0xf')][_0x7393('0x16')](_0x82f5fa)['then'](function(_0x459abf){_0x54dc47(null,_0x459abf?_0x459abf['name']:![]);})['catch'](function(_0x31c8c2){_0x54dc47(_0x31c8c2);});};AGIVertices[_0x7393('0x10')][_0x7393('0x17')]=function(_0x1dc3e3,_0x31902f){this[_0x7393('0xf')][_0x7393('0x18')](_0x1dc3e3)[_0x7393('0x12')](function(_0x546642){_0x31902f(null,_0x546642?_0x546642['dsn']:![]);})[_0x7393('0x13')](function(_0x16f617){_0x31902f(_0x16f617);});};AGIVertices[_0x7393('0x10')][_0x7393('0x19')]=function(_0x131667,_0x52f716){this['rpc']['getUserById'](_0x131667)[_0x7393('0x12')](function(_0x5b5ca9){_0x52f716(null,_0x5b5ca9?_0x5b5ca9['name']:![]);})[_0x7393('0x13')](function(_0xa8f852){_0x52f716(_0xa8f852);});};AGIVertices['prototype'][_0x7393('0x1a')]=function(_0x2b0389,_0x1ac912){this[_0x7393('0xf')][_0x7393('0x1b')](_0x2b0389)[_0x7393('0x12')](function(_0x1b31b8){_0x1ac912(null,_0x1b31b8?_0x1b31b8[_0x7393('0x1c')]:![]);})[_0x7393('0x13')](function(_0x3d8773){_0x1ac912(_0x3d8773);});};AGIVertices[_0x7393('0x10')][_0x7393('0x1d')]=function(_0x19160c,_0x4e1fea){var _0x39d95f=this;this[_0x7393('0xf')][_0x7393('0x1e')](_0x19160c)[_0x7393('0x12')](function(_0x1013aa){_0x4e1fea(null,_0x1013aa?_0x39d95f[_0x7393('0x1f')](_0x1013aa['save_name']):![]);})[_0x7393('0x13')](function(_0x4befa4){_0x4e1fea(_0x4befa4);});};AGIVertices[_0x7393('0x10')]['getMailAccount']=function(_0x6749ff,_0x3a04dd){this[_0x7393('0xf')][_0x7393('0x20')](_0x6749ff)[_0x7393('0x12')](function(_0x1107f6){_0x3a04dd(null,_0x1107f6?_0x1107f6:![]);})[_0x7393('0x13')](function(_0x28ff33){_0x3a04dd(_0x28ff33);});};AGIVertices[_0x7393('0x10')][_0x7393('0x21')]=function(_0x46e91f,_0x2a3824,_0x55ebdd){this['mailRpc'][_0x7393('0x21')](_0x46e91f,_0x2a3824)['then'](function(){_0x55ebdd(null);})[_0x7393('0x13')](function(_0x489f32){_0x55ebdd(_0x489f32);});};AGIVertices[_0x7393('0x10')]['getIntervals']=function(_0x224b4b,_0x3fe138){this[_0x7393('0xf')][_0x7393('0x22')](_0x224b4b)[_0x7393('0x12')](function(_0x34217a){if(_0x34217a){if(_0x34217a[_0x7393('0x23')]){_0x3fe138(null,[_0x34217a[_0x7393('0x24')]]);}else{_0x3fe138(null,_[_0x7393('0x25')](_0x34217a[_0x7393('0x26')],'interval'));}}else{_0x3fe138(null,![]);}})[_0x7393('0x13')](function(_0x4c957d){_0x3fe138(_0x4c957d);});};AGIVertices[_0x7393('0x10')]['getSoundPath']=function(_0x1ffbea){return util[_0x7393('0x27')](_0x7393('0x28'),FILES_PATH,_0x1ffbea);};AGIVertices[_0x7393('0x10')][_0x7393('0x29')]=function(_0x487a9b,_0x14ee6e,_0x596f49){odbc[_0x7393('0x2a')](_0x487a9b,function(_0x1237ae){if(_0x1237ae){logger[_0x7393('0x2b')](_0x7393('0x2c'),_0x1237ae);_0x596f49(_0x1237ae);}else{logger[_0x7393('0x2d')]('ODBC\x20connection\x20successfully');odbc['query'](_0x14ee6e,function(_0x1b5d87,_0xfc12ab){if(_0x1b5d87){logger[_0x7393('0x2d')](_0x7393('0x2e'),_0x14ee6e);_0x596f49(_0x1b5d87);}else{logger['info']('Query\x20executed\x20correctly\x20%s',_0x14ee6e);odbc['close'](function(_0x264393){if(_0x264393){logger[_0x7393('0x2b')](_0x7393('0x2f'),_0x264393);}_0x596f49(null,_0xfc12ab);});}});}});};AGIVertices[_0x7393('0x10')][_0x7393('0x30')]=function(_0x406b35,_0x146afb){this[_0x7393('0xf')][_0x7393('0x31')](_0x406b35)[_0x7393('0x12')](function(_0xc39c05){_0x146afb(null,_0xc39c05?_0xc39c05:![]);})[_0x7393('0x13')](function(_0x7c5976){_0x146afb(_0x7c5976);});};AGIVertices[_0x7393('0x10')][_0x7393('0x32')]=function(_0x13e53c,_0x1644ac){this[_0x7393('0xf')][_0x7393('0x32')](_0x13e53c)[_0x7393('0x12')](function(_0x300858){_0x1644ac(null,_0x300858);})[_0x7393('0x13')](function(_0x49990d){_0x1644ac(_0x49990d);});};AGIVertices[_0x7393('0x10')][_0x7393('0x33')]=function(_0x25a2a6,_0x40ab6d,_0x1517c2){this[_0x7393('0xf')][_0x7393('0x33')]({'uniqueid':this[_0x7393('0xe')]['uniqueid'],'node':_0x25a2a6['label'],'application':_0x25a2a6[_0x7393('0x34')],'data':_0x40ab6d||null,'project_name':this['channel'][_0x7393('0x35')],'callerid':this[_0x7393('0xe')][_0x7393('0x36')]})[_0x7393('0x12')](function(_0x19f751){if(_0x1517c2){_0x1517c2(null,_0x19f751);}})[_0x7393('0x13')](function(_0x585c89){if(_0x1517c2){_0x1517c2(_0x585c89);}});};AGIVertices[_0x7393('0x10')][_0x7393('0x37')]=function(_0x1cff7a,_0x227e6b,_0x1b616e,_0x5421a5){this['rpc'][_0x7393('0x37')]({'uniqueid':this['channel'][_0x7393('0x38')],'callerid':this[_0x7393('0xe')][_0x7393('0x36')],'calleridname':this[_0x7393('0xe')][_0x7393('0x39')],'context':this[_0x7393('0xe')][_0x7393('0x3a')],'extension':this[_0x7393('0xe')][_0x7393('0x3b')],'priority':this[_0x7393('0xe')][_0x7393('0x3c')],'accountcode':this[_0x7393('0xe')][_0x7393('0x3d')],'dnid':this[_0x7393('0xe')][_0x7393('0x3e')],'projectName':this['channel'][_0x7393('0x35')],'saveName':_0x227e6b,'filename':_0x1cff7a[_0x7393('0x3f')]||_0x227e6b,'savePath':_0x1b616e})[_0x7393('0x12')](function(_0x351ba9){_0x5421a5(null,_0x351ba9);})['catch'](function(_0x103a90){_0x5421a5(_0x103a90);});};AGIVertices[_0x7393('0x10')][_0x7393('0x40')]=function(_0x275192,_0x1deca3,_0x2bf8bd,_0x26af1e,_0x8cac53){this[_0x7393('0xf')]['createSquareMessage']({'uniqueid':this[_0x7393('0xe')][_0x7393('0x38')],'body':_0x275192,'direction':_0x1deca3,'providerName':_0x2bf8bd,'providerResponse':_0x26af1e})[_0x7393('0x12')](function(_0x5b82d4){if(_0x8cac53){_0x8cac53(null,_0x5b82d4);}})[_0x7393('0x13')](function(_0x3150c5){if(_0x8cac53){_0x8cac53(_0x3150c5);}});};AGIVertices['prototype'][_0x7393('0x41')]=function(_0x57ee59,_0x396992){this['rpc'][_0x7393('0x41')]({'firstName':_[_0x7393('0x42')](_0x57ee59['name'])||_[_0x7393('0x43')](_0x57ee59[_0x7393('0x1c')])?_0x7393('0x44')+Math[_0x7393('0x45')]():_0x57ee59['name'],'lastName':_['isEmpty'](_0x57ee59['lastName'])||_[_0x7393('0x43')](_0x57ee59[_0x7393('0x46')])?null:_0x57ee59[_0x7393('0x46')],'phone':_0x57ee59[_0x7393('0x47')],'ListId':_0x57ee59[_0x7393('0x48')],'scheduledat':_0x57ee59[_0x7393('0x49')],'callbackUniqueid':this[_0x7393('0xe')][_0x7393('0x38')],'tags':_0x7393('0x4a'),'description':_0x7393('0x4b')+_0x57ee59[_0x7393('0x49')][_0x7393('0x4c')](),'priority':_0x57ee59[_0x7393('0x4d')]})[_0x7393('0x12')](function(_0x4594a1){_0x396992(null,_0x4594a1);})[_0x7393('0x13')](function(_0x48fc92){_0x396992(_0x48fc92);});};AGIVertices['prototype'][_0x7393('0x4e')]=function(_0x5560af,_0x5e97cd){this['rpc'][_0x7393('0x4f')](_0x5560af)['then'](function(_0x4645bd){_0x5e97cd(null,_0x4645bd?_0x4645bd['name']:![]);})['catch'](function(_0x17a94b){_0x5e97cd(_0x17a94b);});};AGIVertices['prototype'][_0x7393('0x50')]=function(_0x4a0642,_0x11c739,_0x5f7d6c){var _0x1ebcf5={'role':_0x7393('0x51')};_0x1ebcf5[_0x4a0642]=this['channel'][_0x7393('0x36')];this[_0x7393('0xf')][_0x7393('0x50')](_0x1ebcf5,_0x11c739,this['channel'][_0x7393('0x38')])['then'](function(_0x4bf1dc){_0x5f7d6c(null,_['isNil'](_0x4bf1dc)?![]:!![]);})[_0x7393('0x13')](function(_0x27a3b0){logger[_0x7393('0x2b')](_0x27a3b0);_0x5f7d6c(null,![]);});};AGIVertices[_0x7393('0x10')]['agentUnpause']=function(_0x4e3917,_0x5995af){var _0x452153={'role':'agent'};_0x452153[_0x4e3917]=this[_0x7393('0xe')][_0x7393('0x36')];this[_0x7393('0xf')][_0x7393('0x52')](_0x452153)[_0x7393('0x12')](function(_0x10dbef){_0x5995af(null,_['isNil'](_0x10dbef)?![]:!![]);})[_0x7393('0x13')](function(_0x177335){logger['error'](_0x177335);_0x5995af(null,![]);});};AGIVertices[_0x7393('0x10')][_0x7393('0x53')]=function(_0x182f95,_0x57c8b5){var _0x406bb1={'role':'agent'};_0x406bb1[_0x182f95]=this['channel'][_0x7393('0x36')];this[_0x7393('0xf')][_0x7393('0x53')](_0x406bb1)['then'](function(_0x22397a){_0x57c8b5(null,_[_0x7393('0x43')](_0x22397a)?![]:!![]);})['catch'](function(_0x56190d){logger['error'](_0x56190d);_0x57c8b5(null,![]);});};AGIVertices['prototype']['agentLogin']=function(_0x469209,_0x1e50a2){var _0x3ae0fb={'role':_0x7393('0x51')};_0x3ae0fb[_0x469209]=this['channel']['callerid'];var _0x11ff30=_0x469209!=_0x7393('0x54')?util[_0x7393('0x27')](_0x7393('0x55'),_0x7393('0x56'),this['channel'][_0x7393('0x36')]):undefined;this[_0x7393('0xf')][_0x7393('0x57')](_0x3ae0fb,_0x11ff30)['then'](function(_0x1a42c8){_0x1e50a2(null,_['isNil'](_0x1a42c8)?![]:!![]);})[_0x7393('0x13')](function(_0x5c1a25){logger['error'](_0x5c1a25);_0x1e50a2(null,![]);});};AGIVertices[_0x7393('0x10')][_0x7393('0x58')]=function(_0x2a99e7,_0x1d7b59){sh[_0x7393('0x59')](_[_0x7393('0x5a')](_0x2a99e7),function(_0x574736,_0x531e32){var _0x2ccdcd=_0x531e32[_0x7393('0x5b')](/(\r\n|\n|\r)/gm,'');_0x1d7b59(null,_0x2ccdcd);});};AGIVertices[_0x7393('0x10')][_0x7393('0x5c')]=function(_0x5a07d0,_0x1c9656){scripts[_0x7393('0x5c')](_0x5a07d0[_0x7393('0x5d')],_0x5a07d0['google_cloud_tts_text_type']||_0x7393('0x5e'),_0x5a07d0[_0x7393('0x5e')],_0x5a07d0[_0x7393('0x5f')]||_0x7393('0x60'),_0x5a07d0[_0x7393('0x61')]||_0x7393('0x62'),_0x5a07d0[_0x7393('0x63')]||_0x7393('0x64'))[_0x7393('0x12')](function(_0xe197ef){_0x1c9656(null,_0xe197ef);})['catch'](function(_0x33edce){_0x1c9656(_0x33edce);});};AGIVertices[_0x7393('0x10')][_0x7393('0x65')]=function(_0x2f80b6,_0x5e42f3){scripts[_0x7393('0x65')](_0x2f80b6[_0x7393('0x5e')],_0x2f80b6[_0x7393('0x66')]||'en',0x1)[_0x7393('0x12')](function(_0x135b5b){_0x5e42f3(null,_0x135b5b);})[_0x7393('0x13')](function(_0x10c081){_0x5e42f3(_0x10c081);});};AGIVertices[_0x7393('0x10')][_0x7393('0x67')]=function(_0x923d80,_0x52e070){var _0x5e4ad6={'uri':_0x923d80['url'],'method':_0x923d80[_0x7393('0x68')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x923d80[_0x7393('0x69')])==='number'&&parseInt(_0x923d80[_0x7393('0x69')])>=0x1?parseInt(_0x923d80[_0x7393('0x69')])*0x3e8:0x5*0x3e8};if(_[_0x7393('0x6a')]([_0x7393('0x6b'),_0x7393('0x6c')],_0x5e4ad6[_0x7393('0x68')]['toUpperCase']())){try{_0x5e4ad6[_0x7393('0x6d')]=_0x923d80[_0x7393('0xa')]?JSON[_0x7393('0x6e')](_0x923d80[_0x7393('0xa')]):{};}catch(_0x3899ad){logger[_0x7393('0x2b')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x3899ad);}}try{_0x5e4ad6[_0x7393('0x6f')]=_0x923d80[_0x7393('0x9')]?JSON[_0x7393('0x6e')](_0x923d80['rawHeaders']):{};}catch(_0x93c792){logger[_0x7393('0x2b')](_0x7393('0x70'),_0x93c792);}if(_0x923d80[_0x7393('0x71')]){try{var _0x430bfd=require(_0x923d80[_0x7393('0x71')])[_0x7393('0x72')](this,_0x5e4ad6);_0x5e4ad6[_0x7393('0x73')]=Mustache[_0x7393('0x74')](_0x923d80[_0x7393('0x75')],_0x430bfd,{},['$$','$$']);if(_0x5e4ad6[_0x7393('0x6f')]){_0x5e4ad6[_0x7393('0x6f')]=JSON[_0x7393('0x6e')](Mustache[_0x7393('0x74')](JSON['stringify'](_0x5e4ad6[_0x7393('0x6f')]),_0x430bfd,{},['$$','$$']));}if(_0x5e4ad6[_0x7393('0x6d')]){_0x5e4ad6[_0x7393('0x6d')]=JSON['parse'](Mustache[_0x7393('0x74')](JSON['stringify'](_0x5e4ad6[_0x7393('0x6d')]),_0x430bfd,{},['$$','$$']));}}catch(_0x38486b){logger['error'](_0x7393('0x76'),_0x38486b);}}rp(_0x5e4ad6)[_0x7393('0x12')](function(_0x3c7614){var _0x1a8799={'statusCode':_0x3c7614['statusCode']||0xc8,'statusMessage':_0x3c7614[_0x7393('0x77')]||'OK','headers':_0x3c7614['headers']||{},'body':_0x3c7614[_0x7393('0x6d')]||{}};_0x52e070(null,_0x1a8799);})[_0x7393('0x13')](function(_0x41224e){var _0x508bf5={'statusCode':_0x41224e['statusCode']||0x1f4,'statusMessage':_0x41224e['message']||_0x7393('0x78'),'headers':_0x41224e['options']['headers']||{},'body':_0x41224e[_0x7393('0x79')][_0x7393('0x6d')]||{}};_0x52e070(null,_0x508bf5);});};AGIVertices[_0x7393('0x10')][_0x7393('0x7a')]=function(_0x52111c,_0x3b3d59){scripts[_0x7393('0x7a')](this[_0x7393('0xe')]['uniqueid'],_0x52111c[_0x7393('0x7b')],_0x52111c['text'],_0x52111c[_0x7393('0x7c')]||'en')[_0x7393('0x12')](function(_0x29f0bb){_0x3b3d59(null,_0x29f0bb);})[_0x7393('0x13')](function(_0xf1692e){_0x3b3d59(_0xf1692e);});};AGIVertices[_0x7393('0x10')][_0x7393('0x7d')]=function(_0x5e40c3,_0x5f3d52){scripts[_0x7393('0x7d')](this[_0x7393('0xe')]['uniqueid'],_0x5e40c3[_0x7393('0x7e')],_0x5e40c3['client_email'],_0x5e40c3['private_key'],_0x5e40c3[_0x7393('0x5e')],_0x5e40c3[_0x7393('0x7f')]||'en')['then'](function(_0x3c048c){_0x5f3d52(null,_0x3c048c);})[_0x7393('0x13')](function(_0x14a5bd){_0x5f3d52(_0x14a5bd);});};AGIVertices[_0x7393('0x10')]['sestekNDA']=function(_0x506285,_0x127abf){scripts[_0x7393('0x80')](this[_0x7393('0xe')],_0x506285)[_0x7393('0x12')](function(_0x52da15){_0x127abf(null,_0x52da15);})[_0x7393('0x13')](function(_0x5947be){_0x127abf(_0x5947be);});};AGIVertices[_0x7393('0x10')][_0x7393('0x81')]=function(_0x29f655,_0xb7e7a0){scripts[_0x7393('0x81')](_0x29f655[_0x7393('0x7b')],_0x29f655['text'],_0x29f655[_0x7393('0x82')]||_0x7393('0x60'),_0x29f655[_0x7393('0x83')])[_0x7393('0x12')](function(_0x4f1449){_0xb7e7a0(null,_0x4f1449);})[_0x7393('0x13')](function(_0x4f2ae9){_0xb7e7a0(_0x4f2ae9);});};AGIVertices['prototype'][_0x7393('0x84')]=function(_0x3697e6,_0x3bd6f7,_0x57cf0a){scripts[_0x7393('0x84')](_0x3bd6f7,_0x3697e6[_0x7393('0x7b')],_0x3697e6[_0x7393('0x85')]||'en-US',this[_0x7393('0x86')](_0x3697e6[_0x7393('0x87')])?_0x3697e6[_0x7393('0x87')]:undefined)['then'](function(_0x13fd17){_0x57cf0a(null,_0x13fd17);})[_0x7393('0x13')](function(_0x3403d9){_0x57cf0a(_0x3403d9);});};AGIVertices[_0x7393('0x10')]['awsPolly']=function(_0x13b18c,_0x366372){scripts[_0x7393('0x88')](_0x13b18c[_0x7393('0x89')],_0x13b18c[_0x7393('0x8a')],_0x13b18c[_0x7393('0x8b')],_0x13b18c[_0x7393('0x8c')]||'Amy',_0x13b18c[_0x7393('0x5e')],_0x13b18c[_0x7393('0x8d')]||_0x7393('0x5e'))['then'](function(_0x5dc60e){_0x366372(null,_0x5dc60e);})[_0x7393('0x13')](function(_0x4298df){_0x366372(_0x4298df);});};AGIVertices[_0x7393('0x10')]['awsLex']=function(_0x3507ea,_0x34f4b8){scripts[_0x7393('0x8e')](this[_0x7393('0xe')][_0x7393('0x38')],_0x3507ea['aws_access_key_id'],_0x3507ea[_0x7393('0x8a')],_0x3507ea[_0x7393('0x8f')],_0x3507ea['text'],_0x3507ea[_0x7393('0x90')])[_0x7393('0x12')](function(_0x31e7ac){_0x34f4b8(null,_0x31e7ac);})[_0x7393('0x13')](function(_0x5f1b35){_0x34f4b8(_0x5f1b35);});};AGIVertices[_0x7393('0x10')]['googleASR']=function(_0x469767,_0x282ff7,_0x54eaba){scripts[_0x7393('0x91')](_0x282ff7,_0x469767[_0x7393('0x7b')],_0x469767[_0x7393('0x92')]||_0x7393('0x60'))[_0x7393('0x12')](function(_0x270af9){_0x54eaba(null,_0x270af9);})[_0x7393('0x13')](function(_0x3f54bb){_0x54eaba(_0x3f54bb);});};AGIVertices[_0x7393('0x10')]['tildeASR']=function(_0x1921d6,_0x4e0acf,_0x392bff){scripts[_0x7393('0x93')](_0x4e0acf,_0x1921d6[_0x7393('0x94')],_0x1921d6['appsecret'],_0x1921d6[_0x7393('0x73')])[_0x7393('0x12')](function(_0x353e21){_0x392bff(null,_0x353e21);})[_0x7393('0x13')](function(_0x244c2c){_0x392bff(_0x244c2c);});};AGIVertices['prototype'][_0x7393('0x95')]=function(_0xeadd09){var _0x3c9069=_['includes'](verticesWithRetry,_0xeadd09[_0x7393('0x34')])?_0xeadd09:_[_0x7393('0x96')](_0xeadd09);for(var _0x31ab6e in _0x3c9069){if(_0x3c9069[_0x7393('0x97')](_0x31ab6e)){if(_0x3c9069[_0x31ab6e]&&_[_0x7393('0x98')](_0x3c9069[_0x31ab6e])){if(_[_0x7393('0x6a')](recursiveMapAttributes,_0x31ab6e)){_0x3c9069[_0x31ab6e]=this['replaceObjectAllVariables'](_0x3c9069[_0x31ab6e]);}else{_0x3c9069[_0x31ab6e]=this['replaceAllVariables'](_0x3c9069[_0x31ab6e]);}}}}return _0x3c9069;};AGIVertices['prototype'][_0x7393('0x99')]=function(_0x2e225e){for(var _0x1994b6 in _0x2e225e){if(_0x2e225e[_0x7393('0x97')](_0x1994b6)){if(_[_0x7393('0x9a')](_0x2e225e[_0x1994b6])){this[_0x7393('0x99')](_0x2e225e[_0x1994b6]);}else if(_[_0x7393('0x9b')](_0x2e225e[_0x1994b6])){for(var _0x50fd0d=0x0;_0x50fd0d<_0x2e225e[_0x1994b6]['length'];_0x50fd0d++){this['recursiveNodeIndex'](_0x2e225e[_0x1994b6][_0x50fd0d]);}}else if(_['isString'](_0x2e225e[_0x1994b6])){_0x2e225e[_0x1994b6]=this[_0x7393('0x9c')](_0x2e225e[_0x1994b6]);}}}};AGIVertices['prototype'][_0x7393('0x9d')]=function(_0x324eca,_0x1b6b5c){for(var _0x4c47c2 in _0x324eca){if(_0x324eca[_0x7393('0x97')](_0x4c47c2)){if(_[_0x7393('0x9a')](_0x324eca[_0x4c47c2])){if(!_[_0x7393('0x42')](_0x324eca[_0x4c47c2])){this[_0x7393('0x9d')](_0x324eca[_0x4c47c2],util[_0x7393('0x27')]('%s.%s',_0x1b6b5c,_0x4c47c2));}}else if(_[_0x7393('0x9b')](_0x324eca[_0x4c47c2])){for(var _0x54e4b5=0x0;_0x54e4b5<_0x324eca[_0x4c47c2][_0x7393('0x9e')];_0x54e4b5++){this[_0x7393('0x9d')](_0x324eca[_0x4c47c2][_0x54e4b5],util[_0x7393('0x27')](_0x7393('0x9f'),_0x1b6b5c,_0x4c47c2+'['+_0x54e4b5+']'));}}else{if(!_[_0x7393('0x43')](_0x324eca[_0x4c47c2])){this[_0x7393('0xe')]['setVariable'](util['format'](_0x7393('0x9f'),_0x1b6b5c,_0x4c47c2),_0x324eca[_0x4c47c2]);}}}}};AGIVertices[_0x7393('0x10')][_0x7393('0xa0')]=function(_0x5d16bd){try{var _0x52b5de=JSON[_0x7393('0x6e')](_0x5d16bd);this[_0x7393('0x99')](_0x52b5de);return JSON[_0x7393('0xa1')](_0x52b5de);}catch(_0x4370ac){return this[_0x7393('0x9c')](_0x5d16bd);}};AGIVertices['prototype'][_0x7393('0x9c')]=function(_0x256ade){var _0x3e59b2=_0x256ade[_0x7393('0xa2')]('{');for(var _0x411c06=0x1;_0x411c06<_0x3e59b2['length'];_0x411c06+=0x1){var _0x50d7af=_0x3e59b2[_0x411c06][_0x7393('0xa2')]('}');if(_0x50d7af['length']>0x1){_0x256ade=_0x256ade[_0x7393('0xa3')]('{'+_0x50d7af[0x0]+'}',this[_0x7393('0xe')][_0x7393('0xa4')](_0x50d7af[0x0])[_0x7393('0xa5')]||_0x50d7af[0x0]);}}if(_0x3e59b2[_0x7393('0x9e')]===0x1){return _0x256ade[_0x7393('0x4c')]();}return this['replaceAllVariables'](_0x256ade);};AGIVertices[_0x7393('0x10')]['getAndSetVariable']=function(_0x358c9c,_0x5e6045){var _0x4fbc19=this[_0x7393('0xe')]['getVariable'](_0x358c9c);if(_0x4fbc19[_0x7393('0xa6')]===-0x1){return _0x4fbc19;}logger['info'](util['format'](_0x7393('0xa7'),_0x5e6045,_0x4fbc19['extra']));return this['channel'][_0x7393('0xa8')](_0x5e6045,_0x4fbc19['extra']);};AGIVertices[_0x7393('0x10')][_0x7393('0x86')]=function(_0x5b2b42){return _0x5b2b42&&_0x5b2b42!=='0'&&_0x5b2b42!=='-1'&&_0x5b2b42!=='';};AGIVertices[_0x7393('0x10')][_0x7393('0xa9')]=function(_0x26535a){this[_0x7393('0x33')][_0x7393('0x72')](this,_0x26535a,'-');_0x26535a[_0x7393('0xaa')]=_0x26535a[_0x7393('0xa9')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x7393('0x10')][_0x7393('0xab')]=function(_0xae034b){logger['info'](util[_0x7393('0x27')](_0x7393('0xac'),_0xae034b[_0x7393('0xad')]));if(!this['isConfigured'](_0xae034b[_0x7393('0x5e')])){return this[_0x7393('0xe')][_0x7393('0xae')](_0x7393('0xaf'));}var _0x5358d1='\x22'+_0xae034b[_0x7393('0x5e')]+'\x22';if(this[_0x7393('0x86')](_0xae034b[_0x7393('0x79')])){_0x5358d1+=','+_0xae034b[_0x7393('0x79')];}var _0x30ba26=this[_0x7393('0xe')]['exec'](_0x7393('0xb0'),_0x5358d1);if(_0x30ba26[_0x7393('0xa6')]===-0x1){return _0x30ba26;}return this[_0x7393('0xe')]['noop'](util[_0x7393('0x27')](_0x7393('0xb1'),_0x5358d1));};AGIVertices['prototype']['mrcprecog']=function(_0x2318df){logger['info'](util['format'](_0x7393('0xb2'),_0x2318df[_0x7393('0xad')]));if(!this[_0x7393('0x86')](_0x2318df[_0x7393('0xb3')])){return this['channel']['noop'](_0x7393('0xb4'));}var _0x955e5c=_0x2318df[_0x7393('0xb3')];if(this['isConfigured'](_0x2318df[_0x7393('0x79')])){_0x955e5c+=','+_0x2318df[_0x7393('0x79')];}var _0x1510c7=this[_0x7393('0xe')]['exec'](_0x7393('0xb5'),_0x955e5c);if(_0x1510c7[_0x7393('0xa6')]===-0x1){return _0x1510c7;}var _0x53096d=this['getAndSetVariable'](_0x7393('0xb6'),_0x7393('0xb7'));if(_0x53096d[_0x7393('0xa6')]===-0x1){return _0x53096d;}var _0x2f3e8d=this[_0x7393('0xb8')](_0x7393('0xb9'),'MRCP_RECOG_TRANSCRIPT');if(_0x2f3e8d[_0x7393('0xa6')]===-0x1){return _0x2f3e8d;}var _0x801e00=this[_0x7393('0xb8')](_0x7393('0xba'),_0x7393('0xbb'));if(_0x801e00['result']===-0x1){return _0x801e00;}return this[_0x7393('0xe')][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0xbc'),_0x955e5c));};AGIVertices[_0x7393('0x10')]['agi']=function(_0x3401a2){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0xbd'),_0x3401a2[_0x7393('0xad')]));return this['channel'][_0x7393('0x5')]([_0x3401a2[_0x7393('0xbe')],_0x3401a2[_0x7393('0xbf')]]);};AGIVertices['prototype'][_0x7393('0xc0')]=function(_0x381a94){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0xc1'),_0x381a94[_0x7393('0xad')]));if(this[_0x7393('0x86')](_0x381a94['timeout'])){logger['info'](util[_0x7393('0x27')](_0x7393('0xc2'),_0x381a94[_0x7393('0x69')]));var _0x48f3d0=this['channel']['wait'](_0x381a94[_0x7393('0x69')]);if(_0x48f3d0[_0x7393('0xa6')]===-0x1){return _0x48f3d0;}}return this['channel']['answer']();};AGIVertices[_0x7393('0x10')][_0x7393('0x4a')]=function(_0x886a9){logger['info'](util[_0x7393('0x27')](_0x7393('0xc3'),_0x886a9[_0x7393('0xad')]));if(!this[_0x7393('0x86')](_0x886a9[_0x7393('0x48')])){return this['channel'][_0x7393('0x2b')](_0x886a9,_0x7393('0xc4'));}_0x886a9[_0x7393('0x49')]=moment();if(this[_0x7393('0x86')](_0x886a9['delay'])){_0x886a9[_0x7393('0x49')]=moment()[_0x7393('0xc5')](_0x886a9[_0x7393('0xc6')],_0x7393('0xc7'));}if(!this[_0x7393('0x86')](_0x886a9[_0x7393('0x4d')])){_0x886a9['callback_priority']=0x2;}this[_0x7393('0x41')][_0x7393('0x72')](this,_0x886a9);return this[_0x7393('0xe')][_0x7393('0xae')](util[_0x7393('0x27')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x886a9[_0x7393('0x47')],_0x886a9['list_id'],_0x886a9[_0x7393('0x49')]));};AGIVertices[_0x7393('0x10')][_0x7393('0xc8')]=function(_0x2a47be){logger[_0x7393('0x2d')](util[_0x7393('0x27')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x2a47be['label']));var _0x101c04=this['channel'][_0x7393('0x59')](_0x2a47be[_0x7393('0xc9')],_0x2a47be['options']);if(_0x101c04[_0x7393('0xa6')]===-0x1){return _0x101c04;}return this[_0x7393('0xe')][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0xca'),_0x2a47be['application'],_0x2a47be[_0x7393('0x79')]));};AGIVertices[_0x7393('0x10')][_0x7393('0xcb')]=function(_0x16d390){logger[_0x7393('0x2d')](util['format'](_0x7393('0xcc'),_0x16d390['label']));if(!this[_0x7393('0x86')](_0x16d390[_0x7393('0x5e')])){return this[_0x7393('0xe')][_0x7393('0xae')]('no\x20text\x20configured');}var _0x1f82dc='\x22'+_0x16d390[_0x7393('0x5e')]+'\x22';if(this[_0x7393('0x86')](_0x16d390['options'])){_0x1f82dc+=','+_0x16d390[_0x7393('0x79')];}var _0x42ccac=this['channel'][_0x7393('0x59')](_0x7393('0xb0'),_0x1f82dc);if(_0x42ccac[_0x7393('0xa6')]===-0x1){return _0x42ccac;}return this[_0x7393('0xe')][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0xb1'),_0x1f82dc));};AGIVertices['prototype'][_0x7393('0xcd')]=function(_0x527781){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0xce'),_0x527781[_0x7393('0xad')]));if(!this[_0x7393('0x86')](_0x527781[_0x7393('0x5e')])){return this[_0x7393('0xe')][_0x7393('0xae')]('no\x20text\x20configured');}var _0x1458a0='\x22'+_0x527781[_0x7393('0x5e')]+'\x22';if(this[_0x7393('0x86')](_0x527781[_0x7393('0x79')])){_0x1458a0+=','+_0x527781[_0x7393('0x79')];}var _0x6855e=this[_0x7393('0xe')][_0x7393('0x59')]('MRCPSynth',_0x1458a0);if(_0x6855e[_0x7393('0xa6')]===-0x1){return _0x6855e;}return this['channel'][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0xb1'),_0x1458a0));};AGIVertices['prototype'][_0x7393('0xcf')]=function(_0x3c6da7){logger['info'](util['format']('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x3c6da7[_0x7393('0xad')]));if(!this['isConfigured'](_0x3c6da7[_0x7393('0xb3')])){return this[_0x7393('0xe')][_0x7393('0xae')]('no\x20grammar\x20configured');}var _0x406060=_0x3c6da7['grammar'];if(this[_0x7393('0x86')](_0x3c6da7[_0x7393('0x79')])){_0x406060+=','+_0x3c6da7['options'];}var _0x3cc376=this['channel'][_0x7393('0x59')](_0x7393('0xb5'),_0x406060);if(_0x3cc376['result']===-0x1){return _0x3cc376;}var _0x21727e=this[_0x7393('0xb8')](_0x7393('0xb6'),_0x7393('0xd0'));if(_0x21727e['result']===-0x1){return _0x21727e;}var _0x13d167=this[_0x7393('0xb8')]('RECOG_INPUT()',_0x7393('0xd1'));if(_0x13d167['result']===-0x1){return _0x13d167;}var _0x36347b=this[_0x7393('0xb8')](_0x7393('0xba'),_0x7393('0xd2'));if(_0x36347b['result']===-0x1){return _0x36347b;}return this[_0x7393('0xe')][_0x7393('0xae')](util[_0x7393('0x27')]('Executed\x20command\x20MRCPRecog\x20%s',_0x406060));};AGIVertices[_0x7393('0x10')]['sestekasr']=function(_0x2debcf){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0xd3'),_0x2debcf[_0x7393('0xad')]));if(!this['isConfigured'](_0x2debcf['grammar'])){return this[_0x7393('0xe')]['noop'](_0x7393('0xb4'));}var _0x4c2716=_0x2debcf['grammar'];if(this[_0x7393('0x86')](_0x2debcf[_0x7393('0x79')])){_0x4c2716+=','+_0x2debcf[_0x7393('0x79')];}var _0x2dffbb=this[_0x7393('0xe')][_0x7393('0x59')]('MRCPRecog',_0x4c2716);if(_0x2dffbb[_0x7393('0xa6')]===-0x1){return _0x2dffbb;}var _0xe22872=this[_0x7393('0xb8')](_0x7393('0xb6'),_0x7393('0xd4'));if(_0xe22872[_0x7393('0xa6')]===-0x1){return _0xe22872;}var _0x126b16=this['getAndSetVariable']('RECOG_INPUT()',_0x7393('0xd5'));if(_0x126b16[_0x7393('0xa6')]===-0x1){return _0x126b16;}var _0x410ab4=this[_0x7393('0xb8')](_0x7393('0xba'),_0x7393('0xd6'));if(_0x410ab4[_0x7393('0xa6')]===-0x1){return _0x410ab4;}return this['channel'][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0xbc'),_0x4c2716));};AGIVertices[_0x7393('0x10')][_0x7393('0xd7')]=function(_0x3c4355){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0xd8'),_0x3c4355[_0x7393('0xad')]));if(!this[_0x7393('0x86')](_0x3c4355[_0x7393('0xd9')])){return this[_0x7393('0xe')][_0x7393('0x2b')](_0x3c4355,_0x7393('0xda'));}var _0x7fd7b6=this[_0x7393('0x17')]['sync'](this,_0x3c4355[_0x7393('0xd9')]);if(!_0x7fd7b6){return this['channel'][_0x7393('0x2b')](_0x3c4355,_0x7393('0xdb'));}if(!this['isConfigured'](_0x3c4355[_0x7393('0xdc')])){return this[_0x7393('0xe')]['error'](_0x3c4355,_0x7393('0xdd'));}var _0x56987e=_0x3c4355[_0x7393('0xdc')][_0x7393('0x5b')](/(\r\n|\n|\r)/gm,'\x20');this[_0x7393('0xe')]['noop'](util[_0x7393('0x27')](_0x7393('0xde'),_0x56987e));var _0x2ab7d8=this[_0x7393('0x29')][_0x7393('0x72')](this,_0x7fd7b6,_0x56987e);this['createSquareDetailsReport'][_0x7393('0x72')](this,_0x3c4355,_0x56987e);if(!this[_0x7393('0x86')](_0x3c4355['variable_id'])){return this[_0x7393('0xe')][_0x7393('0xae')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x3e6959=this[_0x7393('0xa4')][_0x7393('0x72')](this,_0x3c4355[_0x7393('0xdf')]);if(!_0x3e6959){return this['channel']['error'](_0x3c4355,'no\x20variable\x20found');}var _0x381ff2=this;_0x2ab7d8['forEach'](function(_0x255995,_0x471a64){Object['keys'](_0x255995)[_0x7393('0xe0')](function(_0x159db3){_0x381ff2[_0x7393('0xe')][_0x7393('0xa8')](util[_0x7393('0x27')](_0x7393('0xe1'),_0x3e6959,_0x471a64,_0x159db3),_0x255995[_0x159db3]);});});this[_0x7393('0xe')][_0x7393('0xa8')](util[_0x7393('0x27')](_0x7393('0xe2'),_0x3e6959),_0x2ab7d8[_0x7393('0x9e')]);return this[_0x7393('0xe')][_0x7393('0xae')](util[_0x7393('0x27')]('variable\x20%s\x20set',_0x3e6959));};AGIVertices[_0x7393('0x10')]['dial']=function(_0x566679){logger[_0x7393('0xe3')](util[_0x7393('0x27')](_0x7393('0xe4'),_0x566679[_0x7393('0xad')]));if(!this[_0x7393('0x86')](_0x566679[_0x7393('0xe5')])){return this[_0x7393('0xe')][_0x7393('0x2b')](_0x566679,_0x7393('0xe6'));}var _0xc169c7=this[_0x7393('0x19')][_0x7393('0x72')](this,_0x566679[_0x7393('0xe5')]);if(!_0xc169c7){return this[_0x7393('0xe')][_0x7393('0x2b')](_0x566679,_0x7393('0xe7'));}var _0x3456d6=this[_0x7393('0xe')][_0x7393('0x59')](_0x7393('0xe8'),[util[_0x7393('0x27')]('SIP/%s',_0xc169c7),_0x566679['timeout'],_0x566679[_0x7393('0xe9')],_0x566679[_0x7393('0x75')]]);if(_0x3456d6[_0x7393('0xa6')]===-0x1){return _0x3456d6;}return this[_0x7393('0xe')][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0xea'),'DIAL'));};AGIVertices['prototype'][_0x7393('0xeb')]=function(_0x1a9c51){logger[_0x7393('0x2d')](util[_0x7393('0x27')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x1a9c51['label']));if(!this[_0x7393('0x86')](_0x1a9c51['key'])){return this[_0x7393('0xe')]['noop']('no\x20key\x20configured');}if(!this[_0x7393('0x86')](_0x1a9c51['text'])){return this[_0x7393('0xe')][_0x7393('0xae')](_0x7393('0xaf'));}this[_0x7393('0xe')][_0x7393('0xec')]=!![];this[_0x7393('0x33')](_0x1a9c51);this[_0x7393('0x40')](_0x1a9c51[_0x7393('0x5e')],'in','','');this[_0x7393('0xe')][_0x7393('0xae')](util['format'](_0x7393('0xed'),_0x1a9c51[_0x7393('0x5e')]));var _0x17017a=this[_0x7393('0x7a')][_0x7393('0x72')](this,_0x1a9c51);if(_0x17017a){for(var _0x175c4c in _0x17017a){if(_0x17017a[_0x7393('0x97')](_0x175c4c)){this['channel'][_0x7393('0xa8')](util[_0x7393('0x27')]('DIALOGFLOW_%s',_0x175c4c[_0x7393('0xee')]()),_0x17017a[_0x175c4c]);}}this[_0x7393('0x40')](_0x17017a[_0x7393('0xef')],_0x7393('0xf0'),_0x7393('0xeb'),'');return this[_0x7393('0xe')]['noop'](util[_0x7393('0x27')](_0x7393('0xf1'),_0x17017a[_0x7393('0xef')]));}return this[_0x7393('0xe')][_0x7393('0x2b')](_0x1a9c51,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0x7393('0x10')][_0x7393('0xf2')]=function(_0x5045b1){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0xf3'),_0x5045b1[_0x7393('0xad')]));if(!this['isConfigured'](_0x5045b1[_0x7393('0x7e')])){return this['channel'][_0x7393('0xae')](_0x7393('0xf4'));}if(!this[_0x7393('0x86')](_0x5045b1[_0x7393('0xf5')])){return this[_0x7393('0xe')][_0x7393('0xae')](_0x7393('0xf6'));}if(!this[_0x7393('0x86')](_0x5045b1[_0x7393('0xf7')])){return this[_0x7393('0xe')][_0x7393('0xae')](_0x7393('0xf8'));}if(!this[_0x7393('0x86')](_0x5045b1[_0x7393('0x7f')])){return this[_0x7393('0xe')][_0x7393('0xae')](_0x7393('0xf9'));}if(!this[_0x7393('0x86')](_0x5045b1[_0x7393('0x5e')])){return this[_0x7393('0xe')][_0x7393('0xae')](_0x7393('0xaf'));}this[_0x7393('0xe')][_0x7393('0xec')]=!![];this[_0x7393('0x33')](_0x5045b1);this[_0x7393('0x40')](_0x5045b1[_0x7393('0x5e')],'in','','');this['channel'][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0xfa'),_0x5045b1[_0x7393('0x5e')]));var _0x20215a=this[_0x7393('0x7d')][_0x7393('0x72')](this,_0x5045b1);if(_0x20215a){for(var _0x3d910f in _0x20215a){if(_0x20215a['hasOwnProperty'](_0x3d910f)){if(_0x3d910f!==_0x7393('0xfb')){this[_0x7393('0xe')][_0x7393('0xa8')](util[_0x7393('0x27')]('DIALOGFLOW_%s',_0x3d910f['toUpperCase']()),_0x20215a[_0x3d910f]);}}}this[_0x7393('0x40')](_0x20215a[_0x7393('0xef')],'out',_0x7393('0xf2'),_0x20215a['providerResponse']);return this[_0x7393('0xe')][_0x7393('0xae')](util['format'](_0x7393('0xfc'),_0x20215a[_0x7393('0xef')]));}return this[_0x7393('0xe')][_0x7393('0x2b')](_0x5045b1,_0x7393('0xfd'));};AGIVertices[_0x7393('0x10')][_0x7393('0xfe')]=function(_0x185a29){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0xff'),_0x185a29['label']));if(!this[_0x7393('0x86')](_0x185a29[_0x7393('0x100')])){return this['channel'][_0x7393('0xae')](_0x7393('0x101'));}if(!this[_0x7393('0x86')](_0x185a29[_0x7393('0x102')])){return this[_0x7393('0xe')][_0x7393('0xae')](_0x7393('0x103'));}if(!this[_0x7393('0x86')](_0x185a29['password'])){return this[_0x7393('0xe')][_0x7393('0xae')](_0x7393('0x104'));}if(!this['isConfigured'](_0x185a29[_0x7393('0x105')])){return this[_0x7393('0xe')][_0x7393('0xae')](_0x7393('0xaf'));}this[_0x7393('0xe')][_0x7393('0xec')]=!![];this[_0x7393('0x33')](_0x185a29);this[_0x7393('0x40')](_0x185a29[_0x7393('0x5e')],'in','','');this['channel'][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0x106'),_0x185a29[_0x7393('0x5e')]));var _0x2b0911=this[_0x7393('0x80')][_0x7393('0x72')](this,_0x185a29);if(_0x2b0911){for(var _0x5c286f in _0x2b0911){if(_0x2b0911[_0x7393('0x97')](_0x5c286f)){this['channel'][_0x7393('0xa8')](util[_0x7393('0x27')](_0x7393('0x107'),_0x5c286f[_0x7393('0xee')]()),_0x2b0911[_0x5c286f]);}}this['createSquareMessage'](_0x2b0911[_0x7393('0xef')],_0x7393('0xf0'),_0x7393('0xfe'),'');if(_0x2b0911[_0x7393('0x108')]){this['channel'][_0x7393('0xae')](util['format'](_0x7393('0x109'),_0x2b0911[_0x7393('0x108')]));var _0x1996b4=this['channel'][_0x7393('0x10a')](_0x2b0911[_0x7393('0x108')]);try{fs['unlink'](_0x2b0911[_0x7393('0x108')]+'.wav');}catch(_0x4d6da1){logger[_0x7393('0x2b')](_0x4d6da1);}return _0x1996b4;}else{return this[_0x7393('0xe')][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0x10b'),_0x2b0911[_0x7393('0xef')]));}}return this[_0x7393('0xe')][_0x7393('0x2b')](_0x185a29,'SestekNDA\x20is\x20unreachable');};AGIVertices['prototype'][_0x7393('0x10c')]=function(_0x2e90ad){logger['info'](util[_0x7393('0x27')](_0x7393('0x10d'),_0x2e90ad[_0x7393('0xad')]));return this['channel'][_0x7393('0xae')](_0x7393('0x10c'));};AGIVertices['prototype'][_0x7393('0x10e')]=function(_0x52f451){logger[_0x7393('0x2d')](util[_0x7393('0x27')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x52f451[_0x7393('0xad')]));var _0x3f43c0='';if(_0x52f451[_0x7393('0x10f')]){if(!this[_0x7393('0x86')](_0x52f451['trunk_id'])){return this[_0x7393('0xe')][_0x7393('0x2b')](_0x52f451,_0x7393('0x110'));}else{var _0x560646=parseInt(_0x52f451[_0x7393('0x10f')],0xa);if(isNaN(_0x560646)){_0x3f43c0=_0x52f451[_0x7393('0x10f')];}else{_0x3f43c0=this['getTrunk']['sync'](this,_0x52f451[_0x7393('0x10f')]);if(!_0x3f43c0){return this[_0x7393('0xe')][_0x7393('0x2b')](_0x52f451,_0x7393('0x111'));}}}}else if(_0x52f451[_0x7393('0x112')]){_0x3f43c0=_0x52f451[_0x7393('0x112')];}else{return this[_0x7393('0xe')][_0x7393('0x2b')](_0x52f451,_0x7393('0x110'));}var _0x36b487=this[_0x7393('0xe')]['exec'](_0x7393('0xe8'),[util[_0x7393('0x27')](_0x7393('0x113'),_0x3f43c0,_0x52f451[_0x7393('0x47')]),_0x52f451['timeout'],_0x52f451[_0x7393('0xe9')],_0x52f451[_0x7393('0x75')]]);if(_0x36b487[_0x7393('0xa6')]===-0x1){return _0x36b487;}return this[_0x7393('0xe')][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0xea'),_0x7393('0xe8')));};AGIVertices[_0x7393('0x10')][_0x7393('0x114')]=function(_0x49baff){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0x115'),_0x49baff[_0x7393('0xad')]));return this[_0x7393('0xe')][_0x7393('0xae')](_0x7393('0x114'));};AGIVertices['prototype'][_0x7393('0xc')]=function(_0x3ff801){logger['info'](util[_0x7393('0x27')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x3ff801[_0x7393('0xad')]));if(_0x3ff801[_0x7393('0xaa')]===0x0){return this['maxRetry'](_0x3ff801);}_0x3ff801['retry']-=0x1;if(!this['isConfigured'](_0x3ff801[_0x7393('0x116')])){return this[_0x7393('0xe')][_0x7393('0x2b')](_0x3ff801,_0x7393('0x117'));}var _0x56e6c9=this['getSound']['sync'](this,_0x3ff801['file_id']);if(!_0x56e6c9){return this[_0x7393('0xe')][_0x7393('0x2b')](_0x3ff801,_0x7393('0x118'));}if(!this['isConfigured'](_0x3ff801['variable_id'])){return this[_0x7393('0xe')]['error']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x478a9d=this[_0x7393('0xe')][_0x7393('0x119')](_0x56e6c9,_0x3ff801[_0x7393('0x11a')],_0x3ff801[_0x7393('0x11b')]);var _0x19c9fa=_0x478a9d[_0x7393('0xa6')]?_0x478a9d[_0x7393('0xa6')]['toString']():'';logger['info']('test',JSON[_0x7393('0xa1')](_0x478a9d));if(_0x478a9d[_0x7393('0xa6')]===-0x1){this[_0x7393('0x33')]['sync'](this,_0x3ff801,_0x19c9fa);return _0x478a9d;}else if(_0x478a9d[_0x7393('0xa5')]===_0x7393('0x69')){_0x478a9d['result']=_0x19c9fa['length']>=parseInt(_0x3ff801['mindigit'])?'x':'i';}else{_0x478a9d[_0x7393('0xa6')]=_0x19c9fa[_0x7393('0x9e')]>=parseInt(_0x3ff801[_0x7393('0x11c')])&&_0x19c9fa['length']<=parseInt(_0x3ff801['maxdigit'])?'x':'i';}var _0x44bd6d=this[_0x7393('0xa4')][_0x7393('0x72')](this,_0x3ff801[_0x7393('0xdf')]);if(!_0x44bd6d){return this[_0x7393('0xe')][_0x7393('0x2b')](_0x3ff801,_0x7393('0x11d'));}this['channel'][_0x7393('0xa8')](_0x44bd6d,_0x19c9fa);if(this[_0x7393('0x86')](_0x3ff801[_0x7393('0x11e')])){var _0x2875a1=parseInt(_0x3ff801[_0x7393('0x11e')],0xa);var _0x3a192b=rs['generate']({'charset':'*','length':_0x2875a1});var _0x555c75=_0x19c9fa[_0x7393('0x9e')];if(_0x555c75>0x0){if(_0x555c75>_0x2875a1){this[_0x7393('0x33')]['sync'](this,_0x3ff801,_0x3ff801[_0x7393('0x11f')]===_0x7393('0x120')?_0x3a192b+_0x19c9fa['substr'](_0x2875a1):_0x19c9fa[_0x7393('0x121')](0x0,_0x555c75-_0x2875a1)+_0x3a192b);}else{this[_0x7393('0x33')][_0x7393('0x72')](this,_0x3ff801,rs[_0x7393('0x122')]({'charset':'*','length':_0x555c75}));}}else{this['createSquareDetailsReport']['sync'](this,_0x3ff801,'');}}else{this[_0x7393('0x33')][_0x7393('0x72')](this,_0x3ff801,_0x19c9fa);}return _0x478a9d;};AGIVertices[_0x7393('0x10')][_0x7393('0xd')]=function(_0x363c53){logger[_0x7393('0x2d')](util['format'](_0x7393('0x123'),_0x363c53[_0x7393('0xad')]));return this[_0x7393('0xc')](_0x363c53);};AGIVertices[_0x7393('0x10')][_0x7393('0x124')]=function(_0x8330b3){logger['info'](util['format'](_0x7393('0x125'),_0x8330b3[_0x7393('0xad')]));this[_0x7393('0x33')][_0x7393('0x72')](this,_0x8330b3,_0x8330b3[_0x7393('0x126')]);return this[_0x7393('0xe')]['noop'](util[_0x7393('0x27')](_0x7393('0x127'),_0x8330b3[_0x7393('0x126')]));};AGIVertices[_0x7393('0x10')]['awspolly']=function(_0x2e0cf0){logger[_0x7393('0x2d')](util['format'](_0x7393('0x128'),_0x2e0cf0[_0x7393('0xad')]));if(!this['isConfigured'](_0x2e0cf0[_0x7393('0x89')])||!this[_0x7393('0x86')](_0x2e0cf0[_0x7393('0x8a')])){return this[_0x7393('0xe')][_0x7393('0xae')](_0x7393('0x129'));}if(!this['isConfigured'](_0x2e0cf0[_0x7393('0x5e')])){return this[_0x7393('0xe')][_0x7393('0xae')](_0x7393('0xaf'));}this['channel'][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0x12a'),_0x2e0cf0['text']));var _0x1b6281=this[_0x7393('0x88')][_0x7393('0x72')](this,_0x2e0cf0);if(_0x1b6281){this[_0x7393('0xe')]['noop'](util['format']('aws\x20Polly\x20%s\x20file\x20created',_0x1b6281));var _0x5f04f3=this[_0x7393('0xe')][_0x7393('0x10a')](_0x1b6281);try{fs[_0x7393('0x12b')](_0x1b6281+'.wav');}catch(_0x4e597a){logger[_0x7393('0x2b')](_0x4e597a);}return _0x5f04f3;}return this[_0x7393('0xe')]['error'](_0x2e0cf0,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x7393('0x10')][_0x7393('0x12c')]=function(_0x529bf2){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0x12d'),_0x529bf2['label']));if(!this[_0x7393('0x86')](_0x529bf2[_0x7393('0x89')])||!this[_0x7393('0x86')](_0x529bf2[_0x7393('0x8a')])){return this['channel'][_0x7393('0xae')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x7393('0x86')](_0x529bf2['aws_bot_name'])){return this['channel'][_0x7393('0xae')]('no\x20bot\x20name\x20configured');}if(!this[_0x7393('0x86')](_0x529bf2[_0x7393('0x5e')])){return this['channel'][_0x7393('0xae')](_0x7393('0xaf'));}this['channel'][_0x7393('0xec')]=!![];this['createSquareDetailsReport'](_0x529bf2);this[_0x7393('0x40')](_0x529bf2[_0x7393('0x5e')],'in','','');this[_0x7393('0xe')][_0x7393('0xae')](util['format']('Trying\x20Amazon\x20Lex:\x20%s',_0x529bf2[_0x7393('0x5e')]));var _0x3bcdc3=this[_0x7393('0x8e')][_0x7393('0x72')](this,_0x529bf2);if(_0x3bcdc3){for(var _0x666ef8 in _0x3bcdc3){if(_0x3bcdc3[_0x7393('0x97')](_0x666ef8)&&_[_0x7393('0x98')](_0x3bcdc3[_0x666ef8])){this['channel'][_0x7393('0xa8')](util['format'](_0x7393('0x12e'),_0x666ef8['toUpperCase']()),_0x3bcdc3[_0x666ef8]);}}if(_[_0x7393('0x43')](_0x3bcdc3[_0x7393('0x12f')])){return this[_0x7393('0xe')][_0x7393('0xae')](_0x7393('0x130'));}else{this[_0x7393('0x40')](_0x3bcdc3[_0x7393('0x12f')],_0x7393('0xf0'),_0x7393('0x131'),'');return this['channel'][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0x132'),_0x3bcdc3[_0x7393('0x12f')]));}}return this[_0x7393('0xe')][_0x7393('0x2b')](_0x529bf2,_0x7393('0x133'));};AGIVertices[_0x7393('0x10')][_0x7393('0x134')]=function(_0x13d49c){logger[_0x7393('0x2d')](util['format']('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x13d49c[_0x7393('0xad')],_0x13d49c[_0x7393('0x69')]));if(!this[_0x7393('0x86')](_0x13d49c[_0x7393('0x7b')])){return this['channel'][_0x7393('0xae')]('no\x20key\x20configured');}var _0x355908=_0x7393('0x135');var _0x1ffdee=util[_0x7393('0x27')](_0x7393('0x136'),FILES_PATH,rs['generate'](0x4));var _0x34947a=util['format'](_0x7393('0x9f'),_0x1ffdee,_0x355908);var _0x3a3c91=!![];if(_0x13d49c[_0x7393('0x137')]===_0x7393('0x138')){_0x3a3c91=![];}var _0xb484fe=this[_0x7393('0xe')][_0x7393('0x139')](_0x1ffdee,_0x355908,_0x13d49c['intKey'],_0x13d49c['timeout'],undefined,_0x3a3c91);if(_0xb484fe[_0x7393('0xa6')]!==-0x1){this[_0x7393('0xe')][_0x7393('0xae')](util['format'](_0x7393('0x13a'),_0x34947a));var _0xd7dc74=this[_0x7393('0x91')][_0x7393('0x72')](this,_0x13d49c,_0x34947a);if(_0xd7dc74){for(var _0x235a8b in _0xd7dc74){if(_0xd7dc74['hasOwnProperty'](_0x235a8b)){this[_0x7393('0xe')][_0x7393('0xa8')](util[_0x7393('0x27')](_0x7393('0x13b'),_0x235a8b[_0x7393('0xee')]()),_0xd7dc74[_0x235a8b]);}}return this[_0x7393('0xe')][_0x7393('0xae')](util['format'](_0x7393('0x13c'),JSON[_0x7393('0xa1')](_0xd7dc74)));}}return _0xb484fe;};AGIVertices['prototype'][_0x7393('0x13d')]=function(_0x22a5bd){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0x13e'),_0x22a5bd['label']));if(!this[_0x7393('0x86')](_0x22a5bd[_0x7393('0x94')])){return this[_0x7393('0xe')][_0x7393('0xae')](_0x7393('0x13f'));}if(!this['isConfigured'](_0x22a5bd[_0x7393('0x140')])){return this[_0x7393('0xe')][_0x7393('0xae')](_0x7393('0x141'));}var _0x2c3873='wav';var _0x37f660=util['format'](_0x7393('0x136'),FILES_PATH,rs[_0x7393('0x122')](0x4));var _0x48a17c=util[_0x7393('0x27')](_0x7393('0x9f'),_0x37f660,_0x2c3873);var _0x6b6d7e=!![];if(_0x22a5bd['beep']===_0x7393('0x138')){_0x6b6d7e=![];}var _0x6d4a95=this[_0x7393('0xe')][_0x7393('0x139')](_0x37f660,_0x2c3873,_0x22a5bd[_0x7393('0x142')],_0x22a5bd['timeout'],undefined,_0x6b6d7e);if(_0x6d4a95['result']!==-0x1){this['channel'][_0x7393('0xae')](util[_0x7393('0x27')]('tilde\x20%s\x20file\x20created',_0x48a17c));var _0x401943=this[_0x7393('0x93')][_0x7393('0x72')](this,_0x22a5bd,_0x48a17c);if(_0x401943){for(var _0x311ba5 in _0x401943){if(_0x401943[_0x7393('0x97')](_0x311ba5)){this[_0x7393('0xe')]['setVariable'](util[_0x7393('0x27')](_0x7393('0x143'),_0x311ba5[_0x7393('0xee')]()),_0x401943[_0x311ba5]);}}return this[_0x7393('0xe')][_0x7393('0xae')](util['format']('TildeASR\x20Result\x20%s',JSON[_0x7393('0xa1')](_0x401943)));}}return _0x6d4a95;};AGIVertices['prototype'][_0x7393('0x144')]=function(_0x3d253d){logger['info'](util[_0x7393('0x27')](_0x7393('0x145'),_0x3d253d[_0x7393('0xad')]));return this[_0x7393('0xe')]['continueAt'](_0x3d253d[_0x7393('0x3a')],_0x3d253d[_0x7393('0x3b')],_0x3d253d[_0x7393('0x3c')]);};AGIVertices['prototype']['gotoif']=function(_0x265da7){logger['info'](util[_0x7393('0x27')](_0x7393('0x146'),_0x265da7['label']));if(!this['isConfigured'](_0x265da7[_0x7393('0x147')])){return this['channel'][_0x7393('0x2b')](_0x265da7,'no\x20condition\x20configured');}try{var _0x22ef8c=eval(_0x265da7[_0x7393('0x147')])?'true':_0x7393('0x148');this[_0x7393('0xe')][_0x7393('0xae')](util['format']('EVAL\x20CONDITION\x20%s\x20%s',_0x265da7[_0x7393('0x147')],_0x22ef8c));return{'code':0xc8,'result':_0x22ef8c};}catch(_0x97e1c8){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x7393('0x10')][_0x7393('0x149')]=function(_0x2e5cb6){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0x14a'),_0x2e5cb6[_0x7393('0xad')]));if(!this['isConfigured'](_0x2e5cb6[_0x7393('0x14b')])){return this[_0x7393('0xe')][_0x7393('0x2b')](_0x2e5cb6,_0x7393('0x14c'));}var _0x148dde=this['getIntervals'][_0x7393('0x72')](this,_0x2e5cb6[_0x7393('0x14b')]);if(!_0x148dde){return this['channel']['error'](_0x2e5cb6,_0x7393('0x14d'));}for(var _0x292cbd=0x0;_0x292cbd<_0x148dde[_0x7393('0x9e')];_0x292cbd+=0x1){var _0x10958c=this['channel']['getVariable'](util[_0x7393('0x27')]('IFTIME(%s?true:false)',_0x148dde[_0x292cbd]));if(_0x10958c[_0x7393('0xa6')]===-0x1){return _0x10958c;}logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0x14e'),_0x148dde[_0x292cbd],_0x10958c[_0x7393('0xa5')]));if(_0x10958c['extra']===_0x7393('0x14f')){logger['info'](util['format'](_0x7393('0x14e'),_0x148dde[_0x292cbd],_0x7393('0x14f')));this[_0x7393('0xe')][_0x7393('0xae')](util['format']('IFTIME\x20%s\x20%s',_0x148dde[_0x292cbd],_0x7393('0x14f')));return{'code':0xc8,'result':_0x7393('0x14f')};}else{logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0x14e'),_0x148dde[_0x292cbd],_0x7393('0x148')));this['channel'][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0x14e'),_0x148dde[_0x292cbd],_0x7393('0x148')));}}return{'code':0xc8,'result':_0x7393('0x148')};};AGIVertices[_0x7393('0x10')][_0x7393('0x150')]=function(_0x3c26a7){logger[_0x7393('0x2d')](util[_0x7393('0x27')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x3c26a7[_0x7393('0xad')]));return this[_0x7393('0xe')]['hangup']();};AGIVertices[_0x7393('0x10')][_0x7393('0x151')]=function(_0x32844a){logger[_0x7393('0x2d')](util['format'](_0x7393('0x152'),_0x32844a[_0x7393('0xad')]));if(!this[_0x7393('0x86')](_0x32844a['key'])){return this['channel'][_0x7393('0xae')](_0x7393('0x153'));}var _0x57e824='wav';var _0x2f13dd=util[_0x7393('0x27')](_0x7393('0x136'),FILES_PATH,rs['generate'](0x4));var _0xf842ec=util[_0x7393('0x27')](_0x7393('0x9f'),_0x2f13dd,_0x57e824);var _0x192680=!![];if(_0x32844a[_0x7393('0x137')]===_0x7393('0x138')){_0x192680=![];}var _0x1c3bf5=this[_0x7393('0xe')]['recordFile'](_0x2f13dd,_0x57e824,_0x32844a[_0x7393('0x142')],_0x32844a['timeout'],undefined,_0x192680);if(_0x1c3bf5[_0x7393('0xa6')]!==-0x1){this[_0x7393('0xe')]['noop'](util['format'](_0x7393('0x154'),_0xf842ec));var _0x21f09a=this['ispeechASR'][_0x7393('0x72')](this,_0x32844a,_0xf842ec);if(_0x21f09a){for(var _0x18b6e1 in _0x21f09a){if(_0x21f09a[_0x7393('0x97')](_0x18b6e1)){this[_0x7393('0xe')][_0x7393('0xa8')](util[_0x7393('0x27')]('ISPEECH_ASR_%s',_0x18b6e1[_0x7393('0xee')]()),_0x21f09a[_0x18b6e1]);}}return this[_0x7393('0xe')][_0x7393('0xae')](util['format'](_0x7393('0x155'),JSON[_0x7393('0xa1')](_0x21f09a)));}}return _0x1c3bf5;};AGIVertices[_0x7393('0x10')][_0x7393('0x156')]=function(_0x15667b){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0x157'),_0x15667b[_0x7393('0xad')]));if(!this['isConfigured'](_0x15667b[_0x7393('0x7b')])){return this[_0x7393('0xe')][_0x7393('0xae')](_0x7393('0x153'));}if(!this['isConfigured'](_0x15667b[_0x7393('0x5e')])){return this[_0x7393('0xe')]['noop'](_0x7393('0xaf'));}this[_0x7393('0xe')][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0x158'),_0x15667b[_0x7393('0x5e')]));var _0x4d36b8=this[_0x7393('0x81')]['sync'](this,_0x15667b);if(_0x4d36b8){this['channel']['noop'](util['format'](_0x7393('0x154'),_0x4d36b8));var _0x38b30c=this[_0x7393('0xe')][_0x7393('0x10a')](_0x4d36b8,_0x15667b[_0x7393('0x142')]);try{fs[_0x7393('0x12b')](_0x4d36b8+'.wav');}catch(_0x31c849){logger[_0x7393('0x2b')](_0x31c849);}return _0x38b30c;}return this['channel'][_0x7393('0x2b')](_0x15667b,_0x7393('0x159'));};AGIVertices[_0x7393('0x10')][_0x7393('0x15a')]=function(_0x59859a){logger['info'](util[_0x7393('0x27')](_0x7393('0x15b'),_0x59859a[_0x7393('0xad')]));if(!this[_0x7393('0x86')](_0x59859a[_0x7393('0x15c')])){return this['channel']['error'](_0x59859a,_0x7393('0x15d'));}logger['info'](util['format'](_0x7393('0x15e'),this['channel'][_0x7393('0x36')],_0x59859a[_0x7393('0x15c')]));var _0xc68a66=this[_0x7393('0x57')]['sync'](this,_0x59859a[_0x7393('0x15c')]);if(_0xc68a66){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0x15f'),this['channel'][_0x7393('0x36')],_0x59859a[_0x7393('0x15c')]));this['channel'][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0x15f'),this[_0x7393('0xe')][_0x7393('0x36')],_0x59859a[_0x7393('0x15c')]));return{'code':0xc8,'result':_0x7393('0x160')};}else{logger[_0x7393('0x2d')](util[_0x7393('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x7393('0xe')]['callerid'],_0x59859a[_0x7393('0x15c')]));this[_0x7393('0xe')][_0x7393('0xae')](util[_0x7393('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x59859a[_0x7393('0x15c')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype']['logout']=function(_0x530d8a){logger[_0x7393('0x2d')](util['format'](_0x7393('0x161'),_0x530d8a[_0x7393('0xad')]));if(!this[_0x7393('0x86')](_0x530d8a[_0x7393('0x15c')])){return this[_0x7393('0xe')]['error'](_0x530d8a,_0x7393('0x15d'));}logger['info'](util[_0x7393('0x27')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x7393('0xe')][_0x7393('0x36')],_0x530d8a[_0x7393('0x15c')]));var _0x45bf9d=this[_0x7393('0x53')][_0x7393('0x72')](this,_0x530d8a[_0x7393('0x15c')]);if(_0x45bf9d){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0x15f'),this[_0x7393('0xe')][_0x7393('0x36')],_0x530d8a[_0x7393('0x15c')]));this[_0x7393('0xe')]['noop'](util[_0x7393('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x7393('0x36')],_0x530d8a['findBy']));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x7393('0x27')](_0x7393('0x162'),this[_0x7393('0xe')][_0x7393('0x36')],_0x530d8a['findBy']));this[_0x7393('0xe')]['noop'](util[_0x7393('0x27')](_0x7393('0x162'),this[_0x7393('0xe')][_0x7393('0x36')],_0x530d8a[_0x7393('0x15c')]));return{'code':0xc8,'result':_0x7393('0x163')};}};AGIVertices[_0x7393('0x10')]['math']=function(_0x33bfdd){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0x164'),_0x33bfdd[_0x7393('0xad')]));if(!this['isConfigured'](_0x33bfdd['operation'])){return this[_0x7393('0xe')][_0x7393('0x2b')](_0x33bfdd,'no\x20operation\x20configured');}this[_0x7393('0xe')][_0x7393('0xae')](util['format'](_0x7393('0x165'),_0x33bfdd['operation']));var _0x5e54e6=eval(_0x33bfdd[_0x7393('0x166')]);if(!this[_0x7393('0x86')](_0x33bfdd[_0x7393('0xdf')])){return this[_0x7393('0xe')][_0x7393('0xae')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x220660=this[_0x7393('0xa4')]['sync'](this,_0x33bfdd['variable_id']);if(!_0x220660){return this[_0x7393('0xe')][_0x7393('0x2b')](_0x33bfdd,_0x7393('0x11d'));}if(_['isArray'](_0x5e54e6)){var _0x1ced1c=this;_0x5e54e6[_0x7393('0xe0')](function(_0x4a89d1,_0x548653){_0x1ced1c['channel'][_0x7393('0xa8')](util[_0x7393('0x27')]('%s[%s]',_0x220660,_0x548653),_0x4a89d1);});return this[_0x7393('0xe')][_0x7393('0xae')](util['format'](_0x7393('0x167'),_0x220660));}else{return this[_0x7393('0xe')][_0x7393('0xa8')](_0x220660,_0x5e54e6);}};AGIVertices[_0x7393('0x10')][_0x7393('0xb')]=function(_0x1a012a){logger['info'](util[_0x7393('0x27')](_0x7393('0x168'),_0x1a012a[_0x7393('0xad')]));if(_0x1a012a[_0x7393('0xaa')]===0x0){return this[_0x7393('0xa9')](_0x1a012a);}_0x1a012a[_0x7393('0xaa')]-=0x1;if(!this[_0x7393('0x86')](_0x1a012a[_0x7393('0x116')])){return this[_0x7393('0xe')][_0x7393('0x2b')](_0x1a012a,'no\x20file\x20audio\x20selected');}var _0x1d13b6=this[_0x7393('0x1d')]['sync'](this,_0x1a012a['file_id']);if(!_0x1d13b6){return this[_0x7393('0xe')][_0x7393('0x2b')](_0x1a012a,'no\x20file\x20audio\x20found');}var _0x38a23f=this[_0x7393('0xe')][_0x7393('0x119')](_0x1d13b6,_0x1a012a[_0x7393('0x11a')],_0x1a012a[_0x7393('0x169')]);var _0x503915=_0x38a23f['result'];if(_0x38a23f[_0x7393('0xa6')]===-0x1){this[_0x7393('0x33')][_0x7393('0x72')](this,_0x1a012a,'-1');return _0x38a23f;}else if(_0x38a23f[_0x7393('0xa5')]===_0x7393('0x69')){_0x38a23f['result']=_0x38a23f['result'][_0x7393('0x9e')]>0x0?_0x38a23f[_0x7393('0xa6')]:'t';}else if(_[_0x7393('0x42')](_0x38a23f[_0x7393('0xa6')])){_0x38a23f[_0x7393('0xa6')]='#';_0x503915='#';}if(!this[_0x7393('0x86')](_0x1a012a['variable_id'])){this[_0x7393('0xe')][_0x7393('0xae')](_0x7393('0x16a'));}else{var _0x2e6889=this[_0x7393('0xa4')]['sync'](this,_0x1a012a[_0x7393('0xdf')]);if(!_0x2e6889){return this[_0x7393('0xe')][_0x7393('0x2b')](_0x1a012a,'no\x20variable\x20found');}this[_0x7393('0xe')]['setVariable'](_0x2e6889,_0x503915);}this[_0x7393('0x33')][_0x7393('0x72')](this,_0x1a012a,_0x503915);return _0x38a23f;};AGIVertices['prototype'][_0x7393('0xae')]=function(_0x155bbd){logger['info'](util[_0x7393('0x27')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x155bbd['label']));return this['channel']['noop'](_0x155bbd[_0x7393('0x16b')]||_0x155bbd[_0x7393('0xad')]);};AGIVertices[_0x7393('0x10')]['pause']=function(_0x140c3f){logger[_0x7393('0x2d')](util['format'](_0x7393('0x16c'),_0x140c3f[_0x7393('0xad')]));if(!this[_0x7393('0x86')](_0x140c3f['findBy'])){return this[_0x7393('0xe')][_0x7393('0x2b')](_0x140c3f,_0x7393('0x15d'));}logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0x15e'),this[_0x7393('0xe')]['callerid'],_0x140c3f[_0x7393('0x15c')]));var _0x44e66f=this[_0x7393('0x4e')][_0x7393('0x72')](this,_0x140c3f[_0x7393('0x16d')]);var _0x1c3b7d=this['agentPause']['sync'](this,_0x140c3f[_0x7393('0x15c')],_0x44e66f);if(_0x1c3b7d){logger[_0x7393('0x2d')](util[_0x7393('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x7393('0xe')][_0x7393('0x36')],_0x140c3f[_0x7393('0x15c')]));this[_0x7393('0xe')]['noop'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x7393('0x36')],_0x140c3f[_0x7393('0x15c')]));return{'code':0xc8,'result':_0x7393('0x160')};}else{logger[_0x7393('0x2d')](util[_0x7393('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x7393('0xe')]['callerid'],_0x140c3f['findBy']));this[_0x7393('0xe')][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0x15f'),this[_0x7393('0xe')]['callerid'],_0x140c3f[_0x7393('0x15c')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x7393('0x16e')]=function(_0x47af62){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0x16f'),_0x47af62['label']));if(!this[_0x7393('0x86')](_0x47af62[_0x7393('0x116')])){return this[_0x7393('0xe')][_0x7393('0x2b')](_0x47af62,_0x7393('0x117'));}var _0x1b90b3=this[_0x7393('0x1d')][_0x7393('0x72')](this,_0x47af62['file_id']);if(!_0x1b90b3){return this[_0x7393('0xe')][_0x7393('0x2b')](_0x47af62,_0x7393('0x118'));}var _0x62045e=this[_0x7393('0xe')][_0x7393('0x59')](_0x7393('0x170'),[_0x1b90b3,_0x47af62['opts']]);if(_0x62045e['result']===-0x1){return _0x62045e;}return this['channel']['noop'](util[_0x7393('0x27')](_0x7393('0xca'),'PLAYBACK',_0x1b90b3));};AGIVertices[_0x7393('0x10')][_0x7393('0x171')]=function(_0x28d65a){logger[_0x7393('0x2d')](util['format'](_0x7393('0x172'),_0x28d65a[_0x7393('0xad')]));if(!this[_0x7393('0x86')](_0x28d65a[_0x7393('0x173')])){return this[_0x7393('0xe')]['error'](_0x28d65a,_0x7393('0x174'));}var _0x397bd1='';var _0x3ec50f=parseInt(_0x28d65a[_0x7393('0x173')],0xa);if(isNaN(_0x3ec50f)){_0x397bd1=_0x28d65a[_0x7393('0x173')];}else{_0x397bd1=this['getVoiceQueue'][_0x7393('0x72')](this,_0x28d65a['queue_id']);if(!_0x397bd1){return this[_0x7393('0xe')]['error'](_0x28d65a,_0x7393('0x175'));}}var _0x10382a='';if(this[_0x7393('0x86')](_0x28d65a[_0x7393('0x116')])){var _0x5dec0e=this[_0x7393('0x1d')]['sync'](this,_0x28d65a[_0x7393('0x116')]);if(_0x5dec0e){_0x10382a=_0x5dec0e;}}this[_0x7393('0x33')][_0x7393('0x72')](this,_0x28d65a,_0x397bd1);if(_0x28d65a[_0x7393('0xe9')]['indexOf']('x')<0x0){_0x28d65a[_0x7393('0xe9')]+='x';}if(_0x28d65a[_0x7393('0xe9')]['indexOf']('X')<0x0){_0x28d65a[_0x7393('0xe9')]+='X';}this[_0x7393('0xe')]['setVariable'](_0x7393('0x176'),_0x397bd1?_0x397bd1[_0x7393('0x177')]():'');var _0x12cef7=this[_0x7393('0xe')][_0x7393('0x59')]('QUEUE',[_0x397bd1,_0x28d65a[_0x7393('0xe9')],_0x28d65a[_0x7393('0x75')],_0x10382a,_0x28d65a['timeout'],_0x28d65a['agi'],_0x28d65a['macro'],_0x28d65a[_0x7393('0x178')],'',_0x28d65a[_0x7393('0x179')]]);if(_0x12cef7[_0x7393('0xa6')]===-0x1){return _0x12cef7;}return this[_0x7393('0xe')]['noop'](util[_0x7393('0x27')](_0x7393('0xca'),'QUEUE',_0x397bd1));};AGIVertices[_0x7393('0x10')]['record']=function(_0xa39ce9){logger['info'](util[_0x7393('0x27')](_0x7393('0x17a'),_0xa39ce9['label']));var _0x28bb8f=_0xa39ce9[_0x7393('0x17b')]||_0x7393('0x135');var _0x587a80=util['format'](_0x7393('0x17c'),this[_0x7393('0xe')]['uniqueid'],rs[_0x7393('0x122')](0x5));var _0x285a25=util[_0x7393('0x27')]('%s/recordings/%s.%s',FILES_PATH,_0x587a80,_0x28bb8f);var _0x191423=util['format']('%s/recordings/%s',FILES_PATH,_0x587a80);this[_0x7393('0x37')]['sync'](this,_0xa39ce9,_0x587a80,_0x285a25);this['channel']['setVariable']('RECORDING_SAVENAME',_0x587a80);logger[_0x7393('0x2d')](_0x7393('0x17d'),_0x191423,_0x28bb8f,_0xa39ce9[_0x7393('0x17e')],_0xa39ce9[_0x7393('0x69')]);return this['channel'][_0x7393('0x139')](_0x191423,_0x28bb8f,_0xa39ce9[_0x7393('0x17e')],_0xa39ce9[_0x7393('0x69')],undefined,!![]);};AGIVertices[_0x7393('0x10')][_0x7393('0x17f')]=function(_0x2df09e){logger['info'](util[_0x7393('0x27')](_0x7393('0x180'),_0x2df09e[_0x7393('0xad')]));if(!this[_0x7393('0x86')](_0x2df09e[_0x7393('0x75')])){return this[_0x7393('0xe')]['noop'](_0x7393('0x181'));}var _0x1ab8d8=this['restAPI'][_0x7393('0x72')](this,_0x2df09e);logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0x182'),util[_0x7393('0x183')](_0x1ab8d8,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x2df09e[_0x7393('0xdf')])){return this['channel'][_0x7393('0xae')](_0x7393('0x184'));}var _0x2d0c8a=this[_0x7393('0xa4')][_0x7393('0x72')](this,_0x2df09e['variable_id']);if(!_0x2d0c8a){return this[_0x7393('0xe')][_0x7393('0x2b')](_0x2df09e,_0x7393('0x11d'));}this[_0x7393('0xe')][_0x7393('0xa8')](util['format'](_0x7393('0x185'),_0x2d0c8a),_0x1ab8d8[_0x7393('0x186')]?_0x1ab8d8[_0x7393('0x186')]:_0x7393('0x187'));this[_0x7393('0xe')][_0x7393('0xa8')](util[_0x7393('0x27')]('%s_STATUS_MESSAGE',_0x2d0c8a),_0x1ab8d8['statusMessage']?_0x1ab8d8['statusMessage']:'OK');if(_0x1ab8d8[_0x7393('0x6d')]){try{this[_0x7393('0x9d')](_0x1ab8d8['body'],_0x2d0c8a);}catch(_0x3aa8ca){logger[_0x7393('0x2b')](util[_0x7393('0x27')](_0x7393('0x188'),_0x2d0c8a));}}return this[_0x7393('0xe')][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0x189'),_0x2d0c8a));};AGIVertices[_0x7393('0x10')][_0x7393('0x18a')]=function(_0xe9237f){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0x18b'),_0xe9237f[_0x7393('0xad')]));return this[_0x7393('0xe')][_0x7393('0x18c')](_0xe9237f[_0x7393('0x18d')][_0x7393('0x5b')](/\s+/g,''),_0xe9237f[_0x7393('0x17e')]);};AGIVertices[_0x7393('0x10')][_0x7393('0x18e')]=function(_0x55004e){logger['info'](util[_0x7393('0x27')](_0x7393('0x18f'),_0x55004e[_0x7393('0xad')]));return this[_0x7393('0xe')][_0x7393('0x190')](_0x55004e[_0x7393('0x191')][_0x7393('0x5b')](/\s+/g,''),_0x55004e[_0x7393('0x17e')]);};AGIVertices['prototype']['sayphonetic']=function(_0x510523){logger[_0x7393('0x2d')](util[_0x7393('0x27')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x510523[_0x7393('0xad')]));return this[_0x7393('0xe')][_0x7393('0x192')](_0x510523[_0x7393('0x5e')],_0x510523[_0x7393('0x17e')]);};AGIVertices[_0x7393('0x10')][_0x7393('0x193')]=function(_0x5af3c2){logger[_0x7393('0x2d')](util[_0x7393('0x27')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x5af3c2['label']));if(!this[_0x7393('0x86')](_0x5af3c2[_0x7393('0x194')])){return this[_0x7393('0xe')][_0x7393('0xae')]('no\x20mail\x20account\x20configured');}var _0x65dc50=this[_0x7393('0x195')]['sync'](this,_0x5af3c2[_0x7393('0x194')]);if(!_0x65dc50||!_0x65dc50[_0x7393('0x196')]){return this[_0x7393('0xe')]['error'](_0x5af3c2,_0x7393('0x197'));}var _0x56bb49={'from':util[_0x7393('0x27')](_0x7393('0x198'),_0x65dc50['name'],_0x65dc50[_0x7393('0x199')]||_0x65dc50[_0x7393('0x196')]['user']),'to':_0x5af3c2['to']||'','cc':_0x5af3c2['cc']||'','bcc':_0x5af3c2[_0x7393('0x19a')]||'','subject':_0x5af3c2[_0x7393('0x19b')],'html':_0x5af3c2[_0x7393('0x5e')],'text':_0x5af3c2['text']};if(this[_0x7393('0x86')](_0x5af3c2['template_id'])){}logger[_0x7393('0xe3')]('sendMail\x20message',JSON['stringify'](_0x56bb49));this[_0x7393('0x33')]['sync'](this,_0x5af3c2,_0x5af3c2[_0x7393('0x194')]);this[_0x7393('0xe')][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0x19c'),_0x65dc50[_0x7393('0x1c')]));this[_0x7393('0x21')][_0x7393('0x72')](this,_0x65dc50[_0x7393('0x19d')],_0x56bb49);return this[_0x7393('0xe')]['noop'](_0x7393('0x19e'));};AGIVertices['prototype'][_0x7393('0x19f')]=function(_0x553c9e){logger[_0x7393('0x2d')](util['format']('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x553c9e['label']));return this[_0x7393('0xe')][_0x7393('0xae')](_0x7393('0x1a0'));};AGIVertices[_0x7393('0x10')][_0x7393('0x1a1')]=function(_0x18515a){logger[_0x7393('0x2d')](util[_0x7393('0x27')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x18515a[_0x7393('0xad')]));if(!this[_0x7393('0x86')](_0x18515a[_0x7393('0x1a2')])){return this[_0x7393('0xe')]['noop'](_0x7393('0x1a3'));}var _0xc15778=this[_0x7393('0x30')][_0x7393('0x72')](this,_0x18515a[_0x7393('0x1a2')]);if(!_0xc15778){return this[_0x7393('0xe')][_0x7393('0x2b')](_0x18515a,_0x7393('0x1a4'));}var _0x4af0f6={'body':_0x18515a['sms_text'],'phone':_0x18515a['to']||'','SmsAccountId':_0xc15778['id']};logger[_0x7393('0xe3')](_0x7393('0x1a5'),JSON['stringify'](_0x4af0f6));this[_0x7393('0x33')]['sync'](this,_0x18515a,_0x18515a['sms_account_id']);this[_0x7393('0xe')][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0x1a6'),_0xc15778[_0x7393('0x1c')]));this['createSmsMessage']['sync'](this,_0x4af0f6);return this[_0x7393('0xe')][_0x7393('0xae')](_0x7393('0x1a7'));};AGIVertices['prototype']['set']=function(_0x20ba7e){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0x1a8'),_0x20ba7e[_0x7393('0xad')]));if(!this[_0x7393('0x86')](_0x20ba7e[_0x7393('0xdf')])){return this[_0x7393('0xe')]['error'](_0x20ba7e,_0x7393('0x1a9'));}var _0x5d0681=this[_0x7393('0xa4')][_0x7393('0x72')](this,_0x20ba7e[_0x7393('0xdf')]);if(!_0x5d0681){return this[_0x7393('0xe')]['error'](_0x20ba7e,_0x7393('0x11d'));}return this[_0x7393('0xe')][_0x7393('0xa8')](_0x5d0681,_0x20ba7e[_0x7393('0x1aa')]);};AGIVertices[_0x7393('0x10')][_0x7393('0x1ab')]=function(_0x53cbc5){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0x1ac'),_0x53cbc5[_0x7393('0xad')]));this[_0x7393('0xe')]['noop'](_0x7393('0x1ad'));var _0x18cab1=this[_0x7393('0xe')][_0x7393('0xa4')]('XMCS-UNIQUEID');if(!_['isEmpty'](_0x18cab1[_0x7393('0xa5')])){this['channel']['uniqueid']=_0x18cab1[_0x7393('0xa5')];}if(_0x53cbc5['answer']==='yes'){this[_0x7393('0xe')][_0x7393('0xae')](_0x7393('0x1ae'));return this[_0x7393('0xe')][_0x7393('0xc0')]();}return this[_0x7393('0xe')][_0x7393('0xae')](_0x7393('0x1af'));};AGIVertices['prototype'][_0x7393('0x1b0')]=function(_0x181a6b){logger[_0x7393('0x2d')](util['format'](_0x7393('0x1b1'),_0x181a6b[_0x7393('0xad')]));if(!this['isConfigured'](_0x181a6b['project_id'])){return this[_0x7393('0xe')][_0x7393('0x2b')](_0x181a6b,_0x7393('0x1b2'));}var _0x522fdc=this[_0x7393('0x1b3')][_0x7393('0x72')](this,_0x181a6b[_0x7393('0x1b4')]);if(!this[_0x7393('0x86')](_0x522fdc)){return this[_0x7393('0xe')][_0x7393('0x2b')](_0x181a6b,util[_0x7393('0x27')](_0x7393('0x1b5'),_0x181a6b['project_id']));}if(_0x522fdc===this[_0x7393('0xe')]['arg_1']){return this[_0x7393('0xe')]['error'](_0x181a6b,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0x7393('0x33')][_0x7393('0x72')](this,_0x181a6b,_0x522fdc);var _0x3f5b19=this['channel']['exec']('AGI',util['format']('agi://%s/square,\x22%s\x22,\x22%s\x22',config['agi'][_0x7393('0x1b6')]||'127.0.0.1',_0x522fdc,this[_0x7393('0xe')]['arg_1']));if(_0x3f5b19[_0x7393('0xa6')]===-0x1){return _0x3f5b19;}return this[_0x7393('0xe')][_0x7393('0xae')](util['format'](_0x7393('0xca'),_0x7393('0x1b7'),_0x522fdc));};AGIVertices['prototype'][_0x7393('0x1b8')]=function(_0x4ed0e6){logger[_0x7393('0x2d')](util[_0x7393('0x27')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x4ed0e6['label']));var _0x134baf=this[_0x7393('0x58')]['sync'](this,_0x4ed0e6['command']);this['createSquareDetailsReport'][_0x7393('0x72')](this,_0x4ed0e6,_0x4ed0e6[_0x7393('0xbe')]);if(this[_0x7393('0x86')](_0x4ed0e6[_0x7393('0xdf')])){var _0x587c4b=this[_0x7393('0xa4')][_0x7393('0x72')](this,_0x4ed0e6[_0x7393('0xdf')]);if(_0x587c4b){this[_0x7393('0xe')]['setVariable'](_0x587c4b,_0x134baf);return this[_0x7393('0xe')]['noop'](util[_0x7393('0x27')](_0x7393('0x1b9'),_0x4ed0e6[_0x7393('0xbe')],_0x587c4b));}}return this[_0x7393('0xe')][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0x1ba'),_0x4ed0e6[_0x7393('0xbe')]));};AGIVertices[_0x7393('0x10')][_0x7393('0x1bb')]=function(_0x2ea58f){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0x1bc'),_0x2ea58f['label']));_0x2ea58f['text']=_0x2ea58f[_0x7393('0x5e')][_0x7393('0x5b')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x7393('0x86')](_0x2ea58f[_0x7393('0x5d')])){return this[_0x7393('0xe')][_0x7393('0xae')](_0x7393('0x1bd'));}if(!this[_0x7393('0x86')](_0x2ea58f['text'])){return this['channel'][_0x7393('0xae')]('no\x20text\x20configured');}this['channel'][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0x1be'),_0x2ea58f['text']));var _0x217334=this[_0x7393('0x5c')][_0x7393('0x72')](this,_0x2ea58f);if(_0x217334){this[_0x7393('0xe')][_0x7393('0xae')](util['format']('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x217334));var _0x1837da=this[_0x7393('0xe')][_0x7393('0x10a')](_0x217334);try{fs['unlink'](_0x217334+'.wav');}catch(_0x1ee305){logger[_0x7393('0x2b')](_0x1ee305);}return _0x1837da;}return this[_0x7393('0xe')][_0x7393('0x2b')](_0x2ea58f,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0x7393('0x1bf')]=function(_0x4e667e){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0x1c0'),_0x4e667e[_0x7393('0xad')]));_0x4e667e[_0x7393('0x5e')]=_0x4e667e[_0x7393('0x5e')][_0x7393('0x5b')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x7393('0x86')](_0x4e667e[_0x7393('0x5e')])){return this['channel'][_0x7393('0xae')]('no\x20text\x20configured');}this[_0x7393('0xe')][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0x1c1'),_0x4e667e['text']));var _0x3a14e0=this[_0x7393('0x65')][_0x7393('0x72')](this,_0x4e667e);if(_0x3a14e0){this[_0x7393('0xe')][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0x1c2'),_0x3a14e0));var _0x23719f=this[_0x7393('0xe')]['streamFile'](_0x3a14e0);try{fs[_0x7393('0x12b')](_0x3a14e0+_0x7393('0x1c3'));}catch(_0x23ae9f){logger['error'](_0x23ae9f);}return _0x23719f;}return this[_0x7393('0xe')][_0x7393('0x2b')](_0x4e667e,_0x7393('0x1c4'));};AGIVertices['prototype'][_0x7393('0x1c5')]=function(_0x38282d){logger[_0x7393('0x2d')](util[_0x7393('0x27')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x38282d[_0x7393('0xad')]));if(!this[_0x7393('0x86')](_0x38282d[_0x7393('0x15c')])){return this[_0x7393('0xe')]['error'](_0x38282d,'no\x20find\x20by\x20configured');}logger['info'](util['format'](_0x7393('0x15e'),this['channel']['callerid'],_0x38282d['findBy']));var _0x39d2c1=this[_0x7393('0x52')]['sync'](this,_0x38282d[_0x7393('0x15c')]);if(_0x39d2c1){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0x15f'),this[_0x7393('0xe')][_0x7393('0x36')],_0x38282d['findBy']));this['channel'][_0x7393('0xae')](util[_0x7393('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x7393('0x36')],_0x38282d[_0x7393('0x15c')]));return{'code':0xc8,'result':_0x7393('0x160')};}else{logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0x162'),this[_0x7393('0xe')][_0x7393('0x36')],_0x38282d[_0x7393('0x15c')]));this[_0x7393('0xe')][_0x7393('0xae')](util['format'](_0x7393('0x162'),this['channel'][_0x7393('0x36')],_0x38282d[_0x7393('0x15c')]));return{'code':0xc8,'result':_0x7393('0x163')};}};AGIVertices[_0x7393('0x10')][_0x7393('0x1c6')]=function(_0x1b4545){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0x1c7'),_0x1b4545['label']));var _0x39f716=this[_0x7393('0xe')][_0x7393('0x59')](_0x7393('0x1c8'),[_0x1b4545[_0x7393('0x1c9')],_0x1b4545['options']]);if(_0x39f716['result']===-0x1){return _0x39f716;}return this[_0x7393('0xe')][_0x7393('0xae')](util[_0x7393('0x27')]('Executed\x20command\x20%s\x20%s',_0x7393('0x1c8'),_0x1b4545['mailbox']));};AGIVertices['prototype'][_0x7393('0x1ca')]=function(_0x3ba761){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0x1cb'),_0x3ba761[_0x7393('0xad')]));if(!this[_0x7393('0x86')](_0x3ba761[_0x7393('0xdf')])){return this['channel'][_0x7393('0x2b')](_0x3ba761,_0x7393('0x1a9'));}var _0x467121=this[_0x7393('0xa4')][_0x7393('0x72')](this,_0x3ba761[_0x7393('0xdf')]);if(!_0x467121){return this[_0x7393('0xe')]['error'](_0x3ba761,_0x7393('0x11d'));}var _0x2d185c=this[_0x7393('0xe')][_0x7393('0xa4')](_0x467121);return{'code':0xc8,'result':_0x2d185c[_0x7393('0xa5')]?_0x2d185c[_0x7393('0xa5')]:'-'};};String[_0x7393('0x10')][_0x7393('0xa3')]=function(_0x24a136,_0x143ca3){return this['split'](_0x24a136)[_0x7393('0x1cc')](_0x143ca3);};module[_0x7393('0x1cd')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 06b6e73..faf3f5d 100644 --- a/server/services/ami/acw/index.js +++ b/server/services/ami/acw/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x50e5=['[ACW][syncHangup]\x20%s','syncAttendedTransfer','isNil','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereeuniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','syncAgentConnect','bind','syncHangupRequest','hangup','attendedtransfer','blindtransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','diff','seconds','updateAcw','lastPauseAt','timer','uniqueid','then','info','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','prototype','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','resolve','getAgent','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','format','YYYY-MM-DD\x20HH:mm:ss','finally','stopAcw','update','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','message','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[%s][HANGUP:LINKEDID]','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]'];(function(_0x2b9c9f,_0x14bdb7){var _0x91e5e5=function(_0x429f32){while(--_0x429f32){_0x2b9c9f['push'](_0x2b9c9f['shift']());}};_0x91e5e5(++_0x14bdb7);}(_0x50e5,0xb7));var _0x550e=function(_0x558bef,_0x106ae4){_0x558bef=_0x558bef-0x0;var _0x945cb1=_0x50e5[_0x558bef];return _0x945cb1;};'use strict';var _=require(_0x550e('0x0'));var moment=require(_0x550e('0x1'));var ami=require('../ami');var logger=require(_0x550e('0x2'))(_0x550e('0x3'));var RpcUser=require(_0x550e('0x4'));var RpcVoiceAgentReport=require(_0x550e('0x5'));function Acw(_0x40aee6){this[_0x550e('0x6')]=_0x40aee6[_0x550e('0x6')];this[_0x550e('0x7')]=_0x40aee6[_0x550e('0x7')];this[_0x550e('0x8')]=_0x40aee6[_0x550e('0x8')];this[_0x550e('0x9')]={};ami['on']('agentconnect',this[_0x550e('0xa')][_0x550e('0xb')](this));ami['on']('hanguprequest',this[_0x550e('0xc')][_0x550e('0xb')](this));ami['on'](_0x550e('0xd'),this['syncHangup'][_0x550e('0xb')](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x550e('0xb')](this));ami['on'](_0x550e('0xe'),this['syncAttendedTransfer'][_0x550e('0xb')](this));ami['on'](_0x550e('0xf'),this[_0x550e('0x10')][_0x550e('0xb')](this));ami['on']('custom:agentConnectPreview',this[_0x550e('0x11')]['bind'](this));}function getDiff(_0x2dc276){var _0x4f5255=moment()[_0x550e('0x12')](0x0);var _0x4c6070=moment(_0x2dc276)[_0x550e('0x12')](0x0);return _0x4f5255[_0x550e('0x13')](_0x4c6070,_0x550e('0x14'));}Acw['prototype'][_0x550e('0x15')]=function(_0x49787c,_0xf28ba7){var _0x49474f=this;var _0x4a5f7a=getDiff(_0x49474f[_0x550e('0x8')][_0x49787c][_0x550e('0x16')]);clearTimeout(_0x49474f['timers'][_0x49787c]['timer']);_0x49474f['timers'][_0x49787c][_0x550e('0x17')]=![];return RpcVoiceAgentReport['update']({'acwtime':_0x4a5f7a},_0x49474f['timers'][_0x49787c][_0x550e('0x18')],_0x49787c)[_0x550e('0x19')](function(_0x6c7178){logger[_0x550e('0x1a')](_0x550e('0x1b'),_0xf28ba7,_0x4a5f7a,_0x6c7178);})[_0x550e('0x1c')](function(_0x3b4dca){logger[_0x550e('0x1d')](_0x550e('0x1e'),_0xf28ba7,_0x3b4dca);})['finally'](function(){delete _0x49474f[_0x550e('0x8')][_0x49787c];});};Acw[_0x550e('0x1f')]['startAcw']=function(_0x4f70bd){try{var _0x3e9822=this;var _0x2663c7=this['channels'][_0x4f70bd][_0x550e('0x20')];var _0xcf3981=this[_0x550e('0x9')][_0x4f70bd][_0x550e('0x21')];var _0x3aa1b8=this[_0x550e('0x6')][_0xcf3981];var _0x56f6a2=![];var _0x707f72=_0x550e('0x22');if(_0x3aa1b8[_0x550e('0x23')]&&_0x3aa1b8[_0x550e('0x24')][_0x550e('0x25')]){_0x56f6a2=!![];_0x707f72=_0x3aa1b8[_0x550e('0x24')][_0x550e('0x25')];}if(!_0x3e9822[_0x550e('0x7')][_0x2663c7]){return Promise[_0x550e('0x26')]();}return RpcUser[_0x550e('0x27')](_0x3e9822[_0x550e('0x7')][_0x2663c7]['id'])[_0x550e('0x19')](function(_0x5e0434){if(!_0x5e0434||_0x5e0434[_0x550e('0x28')]){logger[_0x550e('0x1a')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x4f70bd,_0x2663c7,_0xcf3981);return;}logger[_0x550e('0x1a')](_0x550e('0x29'),_0x4f70bd,_0x2663c7,_0xcf3981);var _0x7ae242=_0x3e9822[_0x550e('0x9')][_0x4f70bd][_0x550e('0x2a')]&&_0x3e9822[_0x550e('0x9')][_0x4f70bd][_0x550e('0x2b')]?_0x3e9822[_0x550e('0x9')][_0x4f70bd][_0x550e('0x2b')]:_0x4f70bd;return RpcUser[_0x550e('0x2c')](_0x3e9822[_0x550e('0x7')][_0x2663c7],_0x707f72,_0x7ae242);})[_0x550e('0x19')](function(_0x32fd38){if(_0x56f6a2||!_0x32fd38){return;}_0x3e9822[_0x550e('0x8')][_0x2663c7]={};logger['info'](_0x550e('0x2d'),_0x4f70bd,_0x3e9822[_0x550e('0x6')][_0xcf3981]['acwTimeout'],_0x2663c7,_0xcf3981);_0x3e9822[_0x550e('0x8')][_0x2663c7][_0x550e('0x17')]=setTimeout(_0x3e9822['stopAcw'][_0x550e('0xb')](_0x3e9822,_0x2663c7),_0x3e9822[_0x550e('0x6')][_0xcf3981][_0x550e('0x2e')]*0x3e8);_0x3e9822[_0x550e('0x8')][_0x2663c7][_0x550e('0x16')]=moment()[_0x550e('0x2f')](_0x550e('0x30'));_0x3e9822[_0x550e('0x8')][_0x2663c7]['uniqueid']=_0x4f70bd;_0x3e9822[_0x550e('0x8')][_0x2663c7]['queue']=_0xcf3981;_0x3e9822[_0x550e('0x8')][_0x2663c7][_0x550e('0x15')]=_0x3e9822['updateAcw'][_0x550e('0xb')](_0x3e9822,_0x2663c7,_0x4f70bd);})[_0x550e('0x1c')](function(){logger['error']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x4f70bd,_0x3e9822['voiceQueues'][_0xcf3981]['acwTimeout'],_0x2663c7,_0xcf3981);})[_0x550e('0x31')](function(){delete _0x3e9822[_0x550e('0x9')][_0x4f70bd];});}catch(_0x6c42c6){logger['error']('[ACW][START]\x20%s',_0x6c42c6['message']);}};Acw[_0x550e('0x1f')][_0x550e('0x32')]=function(_0x4f44e3){try{var _0x5342bf=this;if(_0x5342bf['timers'][_0x4f44e3]){_0x5342bf[_0x550e('0x8')][_0x4f44e3][_0x550e('0x17')]=![];var _0x252e62=_0x5342bf['timers'][_0x4f44e3]['uniqueid'];var _0x33a720=_0x5342bf[_0x550e('0x8')][_0x4f44e3][_0x550e('0x21')];var _0xb54bf8=_0x5342bf['voiceQueues'][_0x33a720][_0x550e('0x2e')];logger[_0x550e('0x1a')]('[%s][TIMER][STOP][AGENT:%s]',_0x252e62,_0x4f44e3);RpcUser['saveUnpause'](this[_0x550e('0x7')][_0x4f44e3]);RpcVoiceAgentReport[_0x550e('0x33')]({'acwtime':_0xb54bf8,'agentacw':!![]},_0x252e62,_0x4f44e3)[_0x550e('0x19')](function(_0x437716){logger['info'](_0x550e('0x1b'),_0x252e62,_0xb54bf8,_0x437716);})[_0x550e('0x1c')](function(_0x1dc236){logger[_0x550e('0x1d')]('[%s][UPDATE][ERRORS:%s]',_0x252e62,_0x1dc236);});}else{logger[_0x550e('0x1d')](_0x550e('0x34'),_0x4f44e3);if(_0x5342bf[_0x550e('0x8')]){logger[_0x550e('0x1a')](_0x550e('0x35'),JSON[_0x550e('0x36')](_0x5342bf['timers']));}}}catch(_0x2f8cf5){logger[_0x550e('0x1d')](_0x550e('0x37'),_0x2f8cf5[_0x550e('0x38')]);}};Acw[_0x550e('0x1f')]['syncAgentConnect']=function(_0x10f18f){try{if(this[_0x550e('0x6')][_0x10f18f['queue']]&&(this[_0x550e('0x6')][_0x10f18f[_0x550e('0x21')]][_0x550e('0x3')]||this['voiceQueues'][_0x10f18f['queue']][_0x550e('0x23')])){if(this[_0x550e('0x7')][_0x10f18f['interface']]){this[_0x550e('0x9')][_0x10f18f[_0x550e('0x18')]]={'queue':_0x10f18f['queue'],'interface':_0x10f18f[_0x550e('0x20')],'destlinkedid':_0x10f18f[_0x550e('0x2b')]};}}}catch(_0x1a8405){logger[_0x550e('0x1d')](_0x550e('0x39'),_0x1a8405[_0x550e('0x38')]);}};Acw['prototype'][_0x550e('0x11')]=function(_0x56351d){try{if(this[_0x550e('0x6')][_0x56351d[_0x550e('0x21')]]&&(this['voiceQueues'][_0x56351d[_0x550e('0x21')]][_0x550e('0x3')]||this[_0x550e('0x6')][_0x56351d[_0x550e('0x21')]][_0x550e('0x23')])){if(this[_0x550e('0x7')][_0x56351d['interface']]){this[_0x550e('0x9')][_0x56351d[_0x550e('0x18')]]={'queue':_0x56351d[_0x550e('0x21')],'interface':_0x56351d[_0x550e('0x20')]};}}}catch(_0x5a9ef5){logger[_0x550e('0x1d')](_0x550e('0x3a'),_0x5a9ef5[_0x550e('0x38')]);}};Acw[_0x550e('0x1f')][_0x550e('0xc')]=function(_0x343d4b){try{if(this[_0x550e('0x9')][_0x343d4b[_0x550e('0x18')]]&&_[_0x550e('0x3b')](this[_0x550e('0x9')][_0x343d4b[_0x550e('0x18')]][_0x550e('0x2a')])){logger[_0x550e('0x1a')](_0x550e('0x3c'),_0x343d4b[_0x550e('0x18')]);this[_0x550e('0x3d')](_0x343d4b[_0x550e('0x18')]);}else if(this['channels'][_0x343d4b[_0x550e('0x3e')]]&&_[_0x550e('0x3b')](this[_0x550e('0x9')][_0x343d4b[_0x550e('0x3e')]][_0x550e('0x2a')])){logger[_0x550e('0x1a')](_0x550e('0x3f'),_0x343d4b['linkedid']);this[_0x550e('0x3d')](_0x343d4b[_0x550e('0x3e')]);}}catch(_0x23486f){logger['error']('[ACW][syncHangupRequest]\x20%s',_0x23486f['message']);}};Acw[_0x550e('0x1f')][_0x550e('0x40')]=function(_0xe8a979){try{if(this[_0x550e('0x9')][_0xe8a979[_0x550e('0x18')]]&&this[_0x550e('0x9')][_0xe8a979['uniqueid']][_0x550e('0x2a')]){logger[_0x550e('0x1a')](_0x550e('0x41'),_0xe8a979['uniqueid']);this[_0x550e('0x3d')](_0xe8a979['uniqueid']);}else if(this[_0x550e('0x9')][_0xe8a979['linkedid']]&&this[_0x550e('0x9')][_0xe8a979[_0x550e('0x3e')]]['attended']){logger[_0x550e('0x1a')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0xe8a979[_0x550e('0x3e')]);this['startAcw'](_0xe8a979[_0x550e('0x3e')]);}}catch(_0x45b188){logger['error'](_0x550e('0x42'),_0x45b188['message']);}};Acw[_0x550e('0x1f')][_0x550e('0x43')]=function(_0x2c8734){try{if(!_[_0x550e('0x44')](this['channels'][_0x2c8734['transfereeuniqueid']])){this[_0x550e('0x3d')](_0x2c8734['transfereeuniqueid']);if(this['channels'][_0x2c8734[_0x550e('0x45')]]){this[_0x550e('0x9')][_0x2c8734[_0x550e('0x45')]][_0x550e('0x2a')]=!![];this[_0x550e('0x9')][_0x2c8734[_0x550e('0x46')]]=this['channels'][_0x2c8734[_0x550e('0x45')]];delete this[_0x550e('0x9')][_0x2c8734[_0x550e('0x45')]];}}else if(!_[_0x550e('0x44')](this[_0x550e('0x9')][_0x2c8734[_0x550e('0x46')]])){this[_0x550e('0x3d')](_0x2c8734[_0x550e('0x46')]);if(this[_0x550e('0x9')][_0x2c8734['origtransfereruniqueid']]){this[_0x550e('0x9')][_0x2c8734[_0x550e('0x47')]][_0x550e('0x2a')]=!![];this[_0x550e('0x9')][_0x2c8734[_0x550e('0x48')]]=this[_0x550e('0x9')][_0x2c8734[_0x550e('0x47')]];delete this[_0x550e('0x9')][_0x2c8734[_0x550e('0x47')]];}}}catch(_0x368cd8){logger['error'](_0x550e('0x49'),_0x368cd8[_0x550e('0x38')]);}};Acw[_0x550e('0x1f')][_0x550e('0x10')]=function(_0x4056fb){try{if(this[_0x550e('0x9')][_0x4056fb[_0x550e('0x4a')]]){logger[_0x550e('0x1a')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON['stringify'](_0x4056fb[_0x550e('0x4a')]));this[_0x550e('0x3d')](_0x4056fb[_0x550e('0x4a')]);}else if(this[_0x550e('0x9')][_0x4056fb[_0x550e('0x4b')]]){logger[_0x550e('0x1a')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x550e('0x36')](_0x4056fb[_0x550e('0x4b')]));this['startAcw'](_0x4056fb['transfererlinkedid']);}}catch(_0xde5985){logger[_0x550e('0x1d')](_0x550e('0x4c'),_0xde5985[_0x550e('0x38')]);}};Acw[_0x550e('0x1f')][_0x550e('0x4d')]=function(_0x3da626){try{if(this[_0x550e('0x6')][_0x3da626['queue']]&&this[_0x550e('0x6')][_0x3da626[_0x550e('0x21')]]['autopause']===_0x550e('0x4e')){if(this[_0x550e('0x7')][_0x3da626[_0x550e('0x20')]]){logger[_0x550e('0x1a')](_0x550e('0x4f'),_0x3da626[_0x550e('0x18')],_0x3da626[_0x550e('0x20')],_0x3da626['queue']);return RpcUser[_0x550e('0x2c')](this[_0x550e('0x7')][_0x3da626[_0x550e('0x20')]],_0x550e('0x50'),_0x3da626[_0x550e('0x18')]);}}}catch(_0x59bf83){logger[_0x550e('0x1d')](_0x550e('0x51'),_0x59bf83['message']);}};module[_0x550e('0x52')]=Acw; \ No newline at end of file +var _0x36c3=['transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','lodash','moment','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','diff','prototype','updateAcw','lastPauseAt','timer','uniqueid','then','info','catch','finally','queue','ACW','mandatoryDispositionPause','name','resolve','voicePause','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','attended','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','format','error','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ACWTIME:%s]','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','syncAgentConnect','interface','destlinkedid','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','mandatoryDisposition','[ACW][syncAgentConnectPreview]\x20%s','startAcw','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil'];(function(_0x19b9b0,_0x3a6235){var _0xaaeca0=function(_0x4a8220){while(--_0x4a8220){_0x19b9b0['push'](_0x19b9b0['shift']());}};_0xaaeca0(++_0x3a6235);}(_0x36c3,0x1a6));var _0x336c=function(_0x219143,_0x451ca3){_0x219143=_0x219143-0x0;var _0x501e6b=_0x36c3[_0x219143];return _0x501e6b;};'use strict';var _=require(_0x336c('0x0'));var moment=require(_0x336c('0x1'));var ami=require('../ami');var logger=require(_0x336c('0x2'))(_0x336c('0x3'));var RpcUser=require(_0x336c('0x4'));var RpcVoiceAgentReport=require(_0x336c('0x5'));function Acw(_0x32aed2){this[_0x336c('0x6')]=_0x32aed2[_0x336c('0x6')];this['agents']=_0x32aed2[_0x336c('0x7')];this[_0x336c('0x8')]=_0x32aed2[_0x336c('0x8')];this[_0x336c('0x9')]={};ami['on'](_0x336c('0xa'),this['syncAgentConnect'][_0x336c('0xb')](this));ami['on'](_0x336c('0xc'),this[_0x336c('0xd')][_0x336c('0xb')](this));ami['on'](_0x336c('0xe'),this[_0x336c('0xf')][_0x336c('0xb')](this));ami['on'](_0x336c('0x10'),this[_0x336c('0x11')][_0x336c('0xb')](this));ami['on'](_0x336c('0x12'),this[_0x336c('0x13')][_0x336c('0xb')](this));ami['on'](_0x336c('0x14'),this[_0x336c('0x15')][_0x336c('0xb')](this));ami['on'](_0x336c('0x16'),this['syncAgentConnectPreview']['bind'](this));}function getDiff(_0x1c3961){var _0x577bd6=moment()[_0x336c('0x17')](0x0);var _0xc6a857=moment(_0x1c3961)[_0x336c('0x17')](0x0);return _0x577bd6[_0x336c('0x18')](_0xc6a857,'seconds');}Acw[_0x336c('0x19')][_0x336c('0x1a')]=function(_0x4ce90a,_0x23b375){var _0x5f5ae1=this;var _0x2c7474=getDiff(_0x5f5ae1['timers'][_0x4ce90a][_0x336c('0x1b')]);clearTimeout(_0x5f5ae1['timers'][_0x4ce90a][_0x336c('0x1c')]);_0x5f5ae1[_0x336c('0x8')][_0x4ce90a]['timer']=![];return RpcVoiceAgentReport['update']({'acwtime':_0x2c7474},_0x5f5ae1[_0x336c('0x8')][_0x4ce90a][_0x336c('0x1d')],_0x4ce90a)[_0x336c('0x1e')](function(_0x221408){logger[_0x336c('0x1f')]('[%s][UPDATE][ACWTIME:%s]',_0x23b375,_0x2c7474,_0x221408);})[_0x336c('0x20')](function(_0x532e12){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x23b375,_0x532e12);})[_0x336c('0x21')](function(){delete _0x5f5ae1[_0x336c('0x8')][_0x4ce90a];});};Acw[_0x336c('0x19')]['startAcw']=function(_0x5adb5f){try{var _0x5b6cc3=this;var _0x3ba228=this[_0x336c('0x9')][_0x5adb5f]['interface'];var _0x260ef3=this[_0x336c('0x9')][_0x5adb5f][_0x336c('0x22')];var _0x56a6fb=this[_0x336c('0x6')][_0x260ef3];var _0x314f5f=![];var _0x24f8ca=_0x336c('0x23');if(_0x56a6fb['mandatoryDisposition']&&_0x56a6fb[_0x336c('0x24')][_0x336c('0x25')]){_0x314f5f=!![];_0x24f8ca=_0x56a6fb[_0x336c('0x24')][_0x336c('0x25')];}if(!_0x5b6cc3[_0x336c('0x7')][_0x3ba228]){return Promise[_0x336c('0x26')]();}return RpcUser['getAgent'](_0x5b6cc3[_0x336c('0x7')][_0x3ba228]['id'])[_0x336c('0x1e')](function(_0x2a1fb3){if(!_0x2a1fb3||_0x2a1fb3[_0x336c('0x27')]){logger['info'](_0x336c('0x28'),_0x5adb5f,_0x3ba228,_0x260ef3);return;}logger[_0x336c('0x1f')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x5adb5f,_0x3ba228,_0x260ef3);var _0x5476ff=_0x5b6cc3['channels'][_0x5adb5f][_0x336c('0x29')]&&_0x5b6cc3[_0x336c('0x9')][_0x5adb5f]['destlinkedid']?_0x5b6cc3['channels'][_0x5adb5f]['destlinkedid']:_0x5adb5f;return RpcUser[_0x336c('0x2a')](_0x5b6cc3[_0x336c('0x7')][_0x3ba228],_0x24f8ca,_0x5476ff);})[_0x336c('0x1e')](function(_0x424712){if(_0x314f5f||!_0x424712){return;}_0x5b6cc3[_0x336c('0x8')][_0x3ba228]={};logger[_0x336c('0x1f')](_0x336c('0x2b'),_0x5adb5f,_0x5b6cc3['voiceQueues'][_0x260ef3][_0x336c('0x2c')],_0x3ba228,_0x260ef3);_0x5b6cc3[_0x336c('0x8')][_0x3ba228][_0x336c('0x1c')]=setTimeout(_0x5b6cc3[_0x336c('0x2d')]['bind'](_0x5b6cc3,_0x3ba228),_0x5b6cc3[_0x336c('0x6')][_0x260ef3][_0x336c('0x2c')]*0x3e8);_0x5b6cc3['timers'][_0x3ba228][_0x336c('0x1b')]=moment()[_0x336c('0x2e')]('YYYY-MM-DD\x20HH:mm:ss');_0x5b6cc3[_0x336c('0x8')][_0x3ba228][_0x336c('0x1d')]=_0x5adb5f;_0x5b6cc3[_0x336c('0x8')][_0x3ba228][_0x336c('0x22')]=_0x260ef3;_0x5b6cc3[_0x336c('0x8')][_0x3ba228][_0x336c('0x1a')]=_0x5b6cc3[_0x336c('0x1a')][_0x336c('0xb')](_0x5b6cc3,_0x3ba228,_0x5adb5f);})['catch'](function(){logger[_0x336c('0x2f')](_0x336c('0x2b'),_0x5adb5f,_0x5b6cc3[_0x336c('0x6')][_0x260ef3][_0x336c('0x2c')],_0x3ba228,_0x260ef3);})[_0x336c('0x21')](function(){delete _0x5b6cc3[_0x336c('0x9')][_0x5adb5f];});}catch(_0x6d823a){logger[_0x336c('0x2f')](_0x336c('0x30'),_0x6d823a[_0x336c('0x31')]);}};Acw['prototype'][_0x336c('0x2d')]=function(_0x3d3583){try{var _0x4690c3=this;if(_0x4690c3[_0x336c('0x8')][_0x3d3583]){_0x4690c3[_0x336c('0x8')][_0x3d3583][_0x336c('0x1c')]=![];var _0x853b2d=_0x4690c3[_0x336c('0x8')][_0x3d3583][_0x336c('0x1d')];var _0xf9c76a=_0x4690c3['timers'][_0x3d3583][_0x336c('0x22')];var _0x20e7a5=_0x4690c3[_0x336c('0x6')][_0xf9c76a]['acwTimeout'];logger[_0x336c('0x1f')](_0x336c('0x32'),_0x853b2d,_0x3d3583);RpcUser[_0x336c('0x33')](this[_0x336c('0x7')][_0x3d3583]);RpcVoiceAgentReport['update']({'acwtime':_0x20e7a5,'agentacw':!![]},_0x853b2d,_0x3d3583)[_0x336c('0x1e')](function(_0x1055bd){logger['info'](_0x336c('0x34'),_0x853b2d,_0x20e7a5,_0x1055bd);})[_0x336c('0x20')](function(_0x1d30ac){logger['error'](_0x336c('0x35'),_0x853b2d,_0x1d30ac);});}else{logger[_0x336c('0x2f')](_0x336c('0x36'),_0x3d3583);if(_0x4690c3[_0x336c('0x8')]){logger[_0x336c('0x1f')](_0x336c('0x37'),JSON[_0x336c('0x38')](_0x4690c3[_0x336c('0x8')]));}}}catch(_0x1ab068){logger[_0x336c('0x2f')]('[ACW][STOP]\x20%s',_0x1ab068[_0x336c('0x31')]);}};Acw[_0x336c('0x19')][_0x336c('0x39')]=function(_0x5b2f25){try{if(this[_0x336c('0x6')][_0x5b2f25[_0x336c('0x22')]]&&(this['voiceQueues'][_0x5b2f25[_0x336c('0x22')]][_0x336c('0x3')]||this[_0x336c('0x6')][_0x5b2f25[_0x336c('0x22')]]['mandatoryDisposition'])){if(this[_0x336c('0x7')][_0x5b2f25[_0x336c('0x3a')]]){this['channels'][_0x5b2f25[_0x336c('0x1d')]]={'queue':_0x5b2f25[_0x336c('0x22')],'interface':_0x5b2f25['interface'],'destlinkedid':_0x5b2f25[_0x336c('0x3b')]};}}}catch(_0xcf3f00){logger[_0x336c('0x2f')](_0x336c('0x3c'),_0xcf3f00['message']);}};Acw[_0x336c('0x19')][_0x336c('0x3d')]=function(_0x8df853){try{if(this[_0x336c('0x6')][_0x8df853[_0x336c('0x22')]]&&(this[_0x336c('0x6')][_0x8df853[_0x336c('0x22')]][_0x336c('0x3')]||this[_0x336c('0x6')][_0x8df853['queue']][_0x336c('0x3e')])){if(this[_0x336c('0x7')][_0x8df853[_0x336c('0x3a')]]){this[_0x336c('0x9')][_0x8df853[_0x336c('0x1d')]]={'queue':_0x8df853[_0x336c('0x22')],'interface':_0x8df853[_0x336c('0x3a')]};}}}catch(_0xbfac47){logger[_0x336c('0x2f')](_0x336c('0x3f'),_0xbfac47[_0x336c('0x31')]);}};Acw[_0x336c('0x19')][_0x336c('0xd')]=function(_0x58d26c){try{if(this[_0x336c('0x9')][_0x58d26c['uniqueid']]&&_['isUndefined'](this[_0x336c('0x9')][_0x58d26c['uniqueid']]['attended'])){logger[_0x336c('0x1f')]('[%s][HANGUP:UNIQUEID]',_0x58d26c[_0x336c('0x1d')]);this[_0x336c('0x40')](_0x58d26c[_0x336c('0x1d')]);}else if(this[_0x336c('0x9')][_0x58d26c['linkedid']]&&_['isUndefined'](this[_0x336c('0x9')][_0x58d26c[_0x336c('0x41')]]['attended'])){logger[_0x336c('0x1f')](_0x336c('0x42'),_0x58d26c['linkedid']);this[_0x336c('0x40')](_0x58d26c[_0x336c('0x41')]);}}catch(_0x2eb56f){logger[_0x336c('0x2f')]('[ACW][syncHangupRequest]\x20%s',_0x2eb56f[_0x336c('0x31')]);}};Acw[_0x336c('0x19')]['syncHangup']=function(_0x57857d){try{if(this['channels'][_0x57857d['uniqueid']]&&this['channels'][_0x57857d[_0x336c('0x1d')]][_0x336c('0x29')]){logger[_0x336c('0x1f')](_0x336c('0x43'),_0x57857d['uniqueid']);this[_0x336c('0x40')](_0x57857d[_0x336c('0x1d')]);}else if(this[_0x336c('0x9')][_0x57857d[_0x336c('0x41')]]&&this['channels'][_0x57857d[_0x336c('0x41')]]['attended']){logger[_0x336c('0x1f')](_0x336c('0x44'),_0x57857d[_0x336c('0x41')]);this[_0x336c('0x40')](_0x57857d[_0x336c('0x41')]);}}catch(_0x171b00){logger['error']('[ACW][syncHangup]\x20%s',_0x171b00[_0x336c('0x31')]);}};Acw[_0x336c('0x19')]['syncAttendedTransfer']=function(_0x22a0bd){try{if(!_[_0x336c('0x45')](this[_0x336c('0x9')][_0x22a0bd['transfereeuniqueid']])){this['startAcw'](_0x22a0bd[_0x336c('0x46')]);if(this[_0x336c('0x9')][_0x22a0bd[_0x336c('0x47')]]){this[_0x336c('0x9')][_0x22a0bd[_0x336c('0x47')]][_0x336c('0x29')]=!![];this['channels'][_0x22a0bd[_0x336c('0x48')]]=this[_0x336c('0x9')][_0x22a0bd[_0x336c('0x47')]];delete this['channels'][_0x22a0bd['secondtransfereruniqueid']];}}else if(!_[_0x336c('0x45')](this[_0x336c('0x9')][_0x22a0bd[_0x336c('0x48')]])){this[_0x336c('0x40')](_0x22a0bd[_0x336c('0x48')]);if(this[_0x336c('0x9')][_0x22a0bd[_0x336c('0x49')]]){this[_0x336c('0x9')][_0x22a0bd[_0x336c('0x49')]][_0x336c('0x29')]=!![];this[_0x336c('0x9')][_0x22a0bd[_0x336c('0x46')]]=this[_0x336c('0x9')][_0x22a0bd['origtransfereruniqueid']];delete this['channels'][_0x22a0bd['origtransfereruniqueid']];}}}catch(_0x4ddd8d){logger[_0x336c('0x2f')](_0x336c('0x4a'),_0x4ddd8d['message']);}};Acw[_0x336c('0x19')][_0x336c('0x15')]=function(_0x3c31f6){try{if(this[_0x336c('0x9')][_0x3c31f6[_0x336c('0x4b')]]){logger[_0x336c('0x1f')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x336c('0x38')](_0x3c31f6['transfereruniqueid']));this[_0x336c('0x40')](_0x3c31f6[_0x336c('0x4b')]);}else if(this[_0x336c('0x9')][_0x3c31f6['transfererlinkedid']]){logger[_0x336c('0x1f')](_0x336c('0x4c'),JSON['stringify'](_0x3c31f6[_0x336c('0x4d')]));this['startAcw'](_0x3c31f6[_0x336c('0x4d')]);}}catch(_0x186177){logger[_0x336c('0x2f')](_0x336c('0x4e'),_0x186177[_0x336c('0x31')]);}};Acw[_0x336c('0x19')]['syncAgentRingNoAnswer']=function(_0x33130d){try{if(this['voiceQueues'][_0x33130d['queue']]&&this['voiceQueues'][_0x33130d['queue']]['autopause']==='all'){if(this[_0x336c('0x7')][_0x33130d[_0x336c('0x3a')]]){logger[_0x336c('0x1f')](_0x336c('0x4f'),_0x33130d[_0x336c('0x1d')],_0x33130d[_0x336c('0x3a')],_0x33130d[_0x336c('0x22')]);return RpcUser['savePause'](this[_0x336c('0x7')][_0x33130d[_0x336c('0x3a')]],_0x336c('0x50'),_0x33130d[_0x336c('0x1d')]);}}}catch(_0x4ba9de){logger[_0x336c('0x2f')](_0x336c('0x51'),_0x4ba9de[_0x336c('0x31')]);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index a35481f..23e1245 100644 --- a/server/services/ami/ami.js +++ b/server/services/ami/ami.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1a0f=['inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','devicestatelist','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','port','once','close','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','actionDeviceStateList','then','actionSipPeerStatus','[ami.js][fullybooted]','exports','asterisk-manager','bluebird','ami','../../config/environment','asterisk','username','password','Action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s'];(function(_0x1c7079,_0x1b1d7f){var _0x23602d=function(_0x1442b8){while(--_0x1442b8){_0x1c7079['push'](_0x1c7079['shift']());}};_0x23602d(++_0x1b1d7f);}(_0x1a0f,0x9a));var _0xf1a0=function(_0x51160c,_0x374b59){_0x51160c=_0x51160c-0x0;var _0x15a3fb=_0x1a0f[_0x51160c];return _0x15a3fb;};'use strict';var Manager=require(_0xf1a0('0x0'));var BPromise=require(_0xf1a0('0x1'));var util=require('util');var logger=require('../../config/logger')(_0xf1a0('0x2'));var config=require(_0xf1a0('0x3'));var ami=new Manager(config[_0xf1a0('0x4')]['port'],config[_0xf1a0('0x4')]['ip'],config[_0xf1a0('0x4')][_0xf1a0('0x5')],config[_0xf1a0('0x4')][_0xf1a0('0x6')],!![]);ami['keepConnected']();ami[_0xf1a0('0x7')]=BPromise['promisify'](ami['action']);function error(_0x56a38e){logger[_0xf1a0('0x8')](util[_0xf1a0('0x9')](_0xf1a0('0xa'),config[_0xf1a0('0x4')]['username'],config['asterisk']['ip'],config[_0xf1a0('0x4')]['port'],util[_0xf1a0('0xb')](_0x56a38e,![],null)));}function close(){logger[_0xf1a0('0x8')](util['format'](_0xf1a0('0xc'),config['asterisk']['username'],config[_0xf1a0('0x4')]['ip'],config[_0xf1a0('0x4')]['port']));}ami[_0xf1a0('0xd')]=function(){return function(){return ami[_0xf1a0('0x7')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0xf1a0('0x7')]({'action':_0xf1a0('0xe')});};};ami['actionSipPeerStatus']=function(){return function(){return ami['Action']({'action':_0xf1a0('0xf')});};};ami[_0xf1a0('0x10')]=function(){return function(){return ami[_0xf1a0('0x7')]({'action':_0xf1a0('0x11')});};};ami[_0xf1a0('0x12')]=function(){return function(){return ami[_0xf1a0('0x7')]({'action':'coreshowchannels'});};};function connect(){logger[_0xf1a0('0x13')](util[_0xf1a0('0x9')](_0xf1a0('0x14'),config[_0xf1a0('0x4')][_0xf1a0('0x5')],config['asterisk']['ip'],config[_0xf1a0('0x4')][_0xf1a0('0x15')]));ami[_0xf1a0('0x16')]('error',error);ami[_0xf1a0('0x16')](_0xf1a0('0x17'),close);}ami['on']('connect',connect);ami['on'](_0xf1a0('0x18'),function(_0x401f80){logger[_0xf1a0('0x13')](util[_0xf1a0('0x9')](_0xf1a0('0x19'),config[_0xf1a0('0x4')]['username'],config[_0xf1a0('0x4')]['ip'],config[_0xf1a0('0x4')]['port'],util[_0xf1a0('0xb')](_0x401f80,![],null)));});ami['on']('fullybooted',function(){logger['info'](util[_0xf1a0('0x9')](_0xf1a0('0x1a'),config['asterisk'][_0xf1a0('0x5')],config[_0xf1a0('0x4')]['ip'],config['asterisk'][_0xf1a0('0x15')]));return Promise[_0xf1a0('0x1b')]()['then'](ami[_0xf1a0('0xd')]())['then'](ami[_0xf1a0('0x1c')]())[_0xf1a0('0x1d')](ami[_0xf1a0('0x1e')]())[_0xf1a0('0x1d')](ami[_0xf1a0('0x10')]())[_0xf1a0('0x1d')](ami[_0xf1a0('0x12')]())['catch'](function(_0x47515e){logger['error'](_0xf1a0('0x1f'),util[_0xf1a0('0xb')](_0x47515e,{'showHidden':![],'depth':null}));});});ami[_0xf1a0('0x16')]('error',error);ami[_0xf1a0('0x16')](_0xf1a0('0x17'),close);module[_0xf1a0('0x20')]=ami; \ No newline at end of file +var _0xb335=['Action','action','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','error','format','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','sipshowregistry','actionDeviceStateList','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','inspect','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','then','actionSipShowRegistry','actionQueueSummary','catch','exports','asterisk-manager','util','../../config/logger','ami','../../config/environment','port','asterisk','username','password','keepConnected'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0xb335,0xd4));var _0x5b33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb335[_0x3dd15e];return _0x231fd0;};'use strict';var Manager=require(_0x5b33('0x0'));var BPromise=require('bluebird');var util=require(_0x5b33('0x1'));var logger=require(_0x5b33('0x2'))(_0x5b33('0x3'));var config=require(_0x5b33('0x4'));var ami=new Manager(config['asterisk'][_0x5b33('0x5')],config[_0x5b33('0x6')]['ip'],config[_0x5b33('0x6')][_0x5b33('0x7')],config['asterisk'][_0x5b33('0x8')],!![]);ami[_0x5b33('0x9')]();ami[_0x5b33('0xa')]=BPromise['promisify'](ami[_0x5b33('0xb')]);function error(_0x569ee9){logger['error'](util['format'](_0x5b33('0xc'),config[_0x5b33('0x6')][_0x5b33('0x7')],config[_0x5b33('0x6')]['ip'],config[_0x5b33('0x6')]['port'],util['inspect'](_0x569ee9,![],null)));}function close(){logger[_0x5b33('0xd')](util[_0x5b33('0xe')](_0x5b33('0xf'),config[_0x5b33('0x6')][_0x5b33('0x7')],config[_0x5b33('0x6')]['ip'],config[_0x5b33('0x6')][_0x5b33('0x5')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x5b33('0xa')]({'action':_0x5b33('0x10')});};};ami[_0x5b33('0x11')]=function(){return function(){return ami['Action']({'action':'devicestatelist'});};};ami[_0x5b33('0x12')]=function(){return function(){return ami[_0x5b33('0xa')]({'action':_0x5b33('0x13')});};};ami['actionQueueSummary']=function(){return function(){return ami[_0x5b33('0xa')]({'action':_0x5b33('0x14')});};};ami[_0x5b33('0x15')]=function(){return function(){return ami[_0x5b33('0xa')]({'action':'coreshowchannels'});};};function connect(){logger[_0x5b33('0x16')](util[_0x5b33('0xe')](_0x5b33('0x17'),config[_0x5b33('0x6')][_0x5b33('0x7')],config[_0x5b33('0x6')]['ip'],config[_0x5b33('0x6')]['port']));ami[_0x5b33('0x18')](_0x5b33('0xd'),error);ami[_0x5b33('0x18')](_0x5b33('0x19'),close);}ami['on'](_0x5b33('0x1a'),connect);ami['on'](_0x5b33('0x1b'),function(_0x5984ee){logger[_0x5b33('0x16')](util[_0x5b33('0xe')](_0x5b33('0x1c'),config[_0x5b33('0x6')][_0x5b33('0x7')],config[_0x5b33('0x6')]['ip'],config[_0x5b33('0x6')]['port'],util[_0x5b33('0x1d')](_0x5984ee,![],null)));});ami['on'](_0x5b33('0x1e'),function(){logger[_0x5b33('0x16')](util['format'](_0x5b33('0x1f'),config[_0x5b33('0x6')]['username'],config[_0x5b33('0x6')]['ip'],config['asterisk'][_0x5b33('0x5')]));return Promise['resolve']()[_0x5b33('0x20')](ami[_0x5b33('0x21')]())[_0x5b33('0x20')](ami['actionDeviceStateList']())[_0x5b33('0x20')](ami[_0x5b33('0x12')]())['then'](ami[_0x5b33('0x22')]())[_0x5b33('0x20')](ami[_0x5b33('0x15')]())[_0x5b33('0x23')](function(_0x47fae9){logger['error']('[ami.js][fullybooted]',util[_0x5b33('0x1d')](_0x47fae9,{'showHidden':![],'depth':null}));});});ami['once'](_0x5b33('0xd'),error);ami[_0x5b33('0x18')]('close',close);module[_0x5b33('0x24')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index f7cf241..87bccba 100644 --- a/server/services/ami/client.js +++ b/server/services/ami/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['message','result','catch','exports','jayson/promise','bluebird','http','Request','then','debug','memberReport','error','rpc'];(function(_0x119c85,_0x268175){var _0x41d288=function(_0x52c0b2){while(--_0x52c0b2){_0x119c85['push'](_0x119c85['shift']());}};_0x41d288(++_0x268175);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var jayson=require(_0x0d8b('0x0'));var BPromise=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('ami');var client=jayson['client'][_0x0d8b('0x2')]({'port':0x2329});client[_0x0d8b('0x3')]=function(_0x43bca1,_0x364286){return new BPromise(function(_0x8196ed,_0x577834){return client['request'](_0x43bca1,_0x364286)[_0x0d8b('0x4')](function(_0x227c63){logger[_0x0d8b('0x5')]('rpc',_0x0d8b('0x6'),_0x43bca1,_0x364286,_0x227c63);if(_0x227c63[_0x0d8b('0x7')]){logger['error'](_0x0d8b('0x8'),_0x0d8b('0x6'),_0x43bca1,_0x227c63[_0x0d8b('0x7')][_0x0d8b('0x9')],_0x364286);return _0x577834(_0x227c63[_0x0d8b('0x7')][_0x0d8b('0x9')]);}else{return _0x8196ed(_0x227c63[_0x0d8b('0xa')]);}})[_0x0d8b('0xb')](function(_0x48fa16){logger[_0x0d8b('0x7')]('rpc',_0x0d8b('0x6'),_0x43bca1,_0x48fa16,_0x364286);return _0x577834(_0x48fa16);});});};module[_0x0d8b('0xc')]=client; \ No newline at end of file +var _0xb7e7=['exports','jayson/promise','../../config/logger','client','Request','debug','rpc','error','memberReport','message','result','catch'];(function(_0x57d370,_0x3ed0f6){var _0x550fd2=function(_0x59634f){while(--_0x59634f){_0x57d370['push'](_0x57d370['shift']());}};_0x550fd2(++_0x3ed0f6);}(_0xb7e7,0x121));var _0x7b7e=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0xb7e7[_0x278e3c];return _0x3e2d9b;};'use strict';var jayson=require(_0x7b7e('0x0'));var BPromise=require('bluebird');var logger=require(_0x7b7e('0x1'))('ami');var client=jayson[_0x7b7e('0x2')]['http']({'port':0x2329});client[_0x7b7e('0x3')]=function(_0x556d68,_0x31d0ed){return new BPromise(function(_0x118577,_0x1d9384){return client['request'](_0x556d68,_0x31d0ed)['then'](function(_0x333fa4){logger[_0x7b7e('0x4')](_0x7b7e('0x5'),'memberReport',_0x556d68,_0x31d0ed,_0x333fa4);if(_0x333fa4[_0x7b7e('0x6')]){logger[_0x7b7e('0x6')](_0x7b7e('0x5'),_0x7b7e('0x7'),_0x556d68,_0x333fa4[_0x7b7e('0x6')][_0x7b7e('0x8')],_0x31d0ed);return _0x1d9384(_0x333fa4[_0x7b7e('0x6')]['message']);}else{return _0x118577(_0x333fa4[_0x7b7e('0x9')]);}})[_0x7b7e('0xa')](function(_0x10a666){logger[_0x7b7e('0x6')](_0x7b7e('0x5'),_0x7b7e('0x7'),_0x556d68,_0x10a666,_0x31d0ed);return _0x1d9384(_0x10a666);});});};module[_0x7b7e('0xb')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index bf8d544..30887fe 100644 --- a/server/services/ami/dialer/index.js +++ b/server/services/ami/dialer/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2f55=['predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','erlangCalls','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','merge','startProgressive','startProgressive\x20value\x20cleared','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','checkContactLowerLimitOriginate','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','[getContactDialer2][Empty]','statedesc','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','is\x20not\x20active','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','isTrunkReachable','active','SIP/%s','reachable','status','unmonitored','checkIsTrunkReachable','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','ifTime','timezones','UNKNOWN_TIMEZONE','length','push','Action','command','iftime\x20%s,%s','interval','content','true','catch','indexOf','some','OVERTIME_INTERVAL','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','resetActiveCalls','syncCampaigns','undefined','[syncCampaigns]','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','Queue','dialTimezone','dialGlobalInterval','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','OVERTIME_GLOBAL_INTERVAL','Global:\x20','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','[ifTime][Action]','Error','uniqueid','updateOriginated','queue','answertime','YYYY-MM-DD\x20HH:mm:ss','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','[syncAgentComplete]','ivr','getSeconds','droptime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','TIMEOUT','countdropretry','countglobal','callAdditionalPhoneAfterMin','state','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','minutes','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','predictiveIntervalDroppedCallsCallersExit','outboundDropCallsDayCallersExit','Abandoned','dropreason','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','verifyAdditionalPhones','dialAbandonedMaxRetry','add','ContactId','[rescheduleContact][Abandoned]','calleridname','[syncAgentComplete][createHistory][11]','channel','actionid','strategy','rrmemory','roundrobin','isNil','paused','stateinterface','locked','idHopper','syncQueueStatusComplete','preview','[Catch][Preview][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','run','[booked][RR][finaly]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[unlock][syncQueueStatusComplete]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncOriginateResponse','responsetime','getQueue','response','Success','[callProgressDetecting]\x20','variable','amdstatus','xcally-motion-dialer','dialAMDActive','outboundAnswerCallsDay','HangupInAMD','AMD','custom:amd','buildObj','amd','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','value','outboundAnswerAgiCallsDay','Machine','membername','countmachineretry','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','HANGUP','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','dialMachineMaxRetry','dialMachineRetryFrequency','ivrAnswerCallsDay','moveContactManagedDialer','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr][createHistory]','outboundUnknownCallsDay','cause-txt','Unknow','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','resolve','available','talking','pTalking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','assign','throttle','dialPreviewRecallmeReminder','filter','handlePreviewRecallNotifications','map','Agent','user:dialPreviewRecallReminder','[uniqueid]','clearZombieChannels','[actions]','No\x20such\x20channel','getVoiceQueueRtPauses','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','[emptyContact][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','checkPreviewRecallReminder','user:%s','launchHandleIvr','actionOriginate','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','\x22%s,%s%s,,,%s\x22','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','setXMDContactVariables','Trunk','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','dialPrefix','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialDropRetryFrequency','[rescheduleContact][Machine]','[rescheduleContact][AgentReject]','callProgressDetecting','[callProgressDetecting]','object','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','dialNoAnswerRetryFrequency','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','reason\x2011\x20abandoned','outboundRejectCallsDay','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','Dropped\x20calls\x20day','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','getDataPredictive','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','dialPredictiveOptimizationPercentage','busyFactor','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','loggedIn','outboundQueuePauses','[CatchErlangB]','predictiveIntervalPauses','erlangCallToSecond','[handlePredictive]','checkContactBlack','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','voicePause','unlockContact','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','outboundBlacklistCallsDay','Blacklist','[Originate][historyBlacklist]','inBlackList','handleIvr','limitCalls','temp','checkContactEmpty','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','checkIsBlackListIvr','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','countReScheduled','[countReScheduled]\x20','Contact','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','dialOrderByScheduledAt','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','[abandonmentRate]','Ts\x20=\x20','interval\x20=\x20','erlangb','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','util','lodash','uuid','moment','ioredis','./utils','./utils/hopper','../preview/util/util','../../../config/environment/','dialer','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/setting','../rpc/interval','./models/history','./models/queueCallerAbandon','./models/hangup','env','XCALLY_IP_AGI','prototype','enqueue','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','ivrOriginated','queueBooked','queuesSummary','agentconnect','syncAgentConnect','syncQueueCallerAbandon','bind','originateresponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummaryComplete','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','then','previewRecallmeReminderInterval','isUndefined','emit','type','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','voice:queue:%s','name','voice_queue:save','isEmpty','-----\x20Stats\x20Predictive\x20---','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive'];(function(_0x166dda,_0x13780a){var _0x1231a0=function(_0x980b3c){while(--_0x980b3c){_0x166dda['push'](_0x166dda['shift']());}};_0x1231a0(++_0x13780a);}(_0x2f55,0x1c9));var _0x52f5=function(_0x4c538c,_0x46c4dc){_0x4c538c=_0x4c538c-0x0;var _0x236796=_0x2f55[_0x4c538c];return _0x236796;};'use strict';var util=require(_0x52f5('0x0'));var _=require(_0x52f5('0x1'));var uuid=require(_0x52f5('0x2'));var moment=require(_0x52f5('0x3'));var rr=require('rr');var Redis=require(_0x52f5('0x4'));var utils=require(_0x52f5('0x5'));var hopperUtils=require(_0x52f5('0x6'));var ut=require(_0x52f5('0x7'));var config=require(_0x52f5('0x8'));var logger=require('../../../config/logger')(_0x52f5('0x9'));var loggerBooked=require(_0x52f5('0xa'))(_0x52f5('0xb'));var loggerPredictive=require(_0x52f5('0xa'))(_0x52f5('0xc'));var loggerPredictiveCalls=require(_0x52f5('0xa'))(_0x52f5('0xd'));var loggerSyncQueueSummary=require(_0x52f5('0xa'))(_0x52f5('0xe'));var ami=require(_0x52f5('0xf'));config[_0x52f5('0x10')]=_[_0x52f5('0x11')](config['redis'],{'host':_0x52f5('0x12'),'port':0x18eb});var io=require(_0x52f5('0x13'))(new Redis(config[_0x52f5('0x10')]));var cmHopper=require(_0x52f5('0x14'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0x52f5('0x15'));var Interval=require(_0x52f5('0x16'));var Action=require('./models/action');var History=require(_0x52f5('0x17'));var Final=require('./models/final');var AgentComplete=require('./models/agentComplete');var QueueCallerAbandon=require(_0x52f5('0x18'));var Hangup=require(_0x52f5('0x19'));var ipAgi=process[_0x52f5('0x1a')][_0x52f5('0x1b')]||'127.0.0.1';var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x52f5('0x1c')][_0x52f5('0x1d')]=function(_0x5f3cc2){this[_0x52f5('0x1e')]=this[_0x52f5('0x1e')]?this[_0x52f5('0x1e')][_0x52f5('0x1f')](_0x5f3cc2):_0x5f3cc2();};function Dialer(_0x89e839,_0x4554a1){this[_0x52f5('0x20')]=new Sequence();this['preview']=_0x4554a1;this[_0x52f5('0x21')]=_0x89e839[_0x52f5('0x21')];this[_0x52f5('0x22')]=_0x89e839[_0x52f5('0x22')];this[_0x52f5('0x23')]=_0x89e839[_0x52f5('0x23')];this[_0x52f5('0x24')]=_0x89e839[_0x52f5('0x24')];this[_0x52f5('0x25')]=config['maxNumberOriginate']||0x2;this[_0x52f5('0x26')]={};this[_0x52f5('0x27')]={};this[_0x52f5('0x28')]={};this[_0x52f5('0x29')]={};this[_0x52f5('0x2a')]={};this[_0x52f5('0x2b')]={};this['startProgressive']={};this[_0x52f5('0x2c')]={};this[_0x52f5('0x2d')]={};this['queueBookedRR']={};this[_0x52f5('0x2e')]={};ami['on'](_0x52f5('0x2f'),this[_0x52f5('0x30')]['bind'](this));ami['on']('queuecallerabandon',this[_0x52f5('0x31')][_0x52f5('0x32')](this));ami['on'](_0x52f5('0x33'),this['syncOriginateResponse'][_0x52f5('0x32')](this));ami['on'](_0x52f5('0x34'),this[_0x52f5('0x35')][_0x52f5('0x32')](this));ami['on'](_0x52f5('0x36'),this[_0x52f5('0xe')][_0x52f5('0x32')](this));ami['on']('custom:queuesummarycomplete',this[_0x52f5('0x37')][_0x52f5('0x32')](this));ami['on'](_0x52f5('0x38'),this[_0x52f5('0x39')][_0x52f5('0x32')](this));ami['on'](_0x52f5('0x3a'),this[_0x52f5('0x3b')][_0x52f5('0x32')](this));ami['on'](_0x52f5('0x3c'),this[_0x52f5('0x3d')]['bind'](this));ami['on'](_0x52f5('0x3e'),this[_0x52f5('0x3f')][_0x52f5('0x32')](this));ami['on'](_0x52f5('0x40'),this['syncQueueStatusComplete'][_0x52f5('0x32')](this));this[_0x52f5('0x41')]();this[_0x52f5('0x42')]();RpcSetting['getSettings']()[_0x52f5('0x43')](function(_0x558885){previewRecallmeReminderInterval=_0x558885[_0x52f5('0x44')];});}function isNotNull(_0x31d098){return _0x31d098!==null&&!_[_0x52f5('0x45')](_0x31d098);}function msgResponse(_0x646fd0,_0x1de43b,_0x3ba03f){return{'action':_0x646fd0,'response':_0x1de43b,'message':_0x3ba03f,'stack':_0x3ba03f};}function emit(_0x289d75,_0x575d4d,_0x1f184d){io['to'](_0x289d75)[_0x52f5('0x46')](_0x575d4d,_0x1f184d);}function emitOutboundVoiceQueueSummary(_0x4b674a){if(_0x4b674a[_0x52f5('0x47')]===_0x52f5('0x48')){logger[_0x52f5('0x49')](_0x52f5('0x4a'),util[_0x52f5('0x4b')](_0x4b674a,{'showHidden':![],'depth':null}));emit(util[_0x52f5('0x4c')](_0x52f5('0x4d'),_0x4b674a[_0x52f5('0x4e')]),_0x52f5('0x4f'),_0x4b674a);}}function checkGetDataPredictive(_0x1f1765){if(isNotNull(_0x1f1765)&&!_[_0x52f5('0x50')](_0x1f1765)){loggerPredictive['info'](_0x52f5('0x51'));loggerPredictive[_0x52f5('0x52')](_0x52f5('0x53'),_0x1f1765[_0x52f5('0x54')]);loggerPredictive['info'](_0x52f5('0x55'),_0x1f1765[_0x52f5('0x56')]);loggerPredictive[_0x52f5('0x52')](_0x52f5('0x57'),_0x1f1765[_0x52f5('0x58')]);loggerPredictive['info'](_0x52f5('0x59'),_0x1f1765['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x52f5('0x52')](_0x52f5('0x5a'),_0x1f1765['predictiveIntervalAvgHoldtime']);loggerPredictive['info'](_0x52f5('0x5b'),_0x1f1765[_0x52f5('0x5c')]);loggerPredictive[_0x52f5('0x52')](_0x52f5('0x5d'));if(_0x1f1765[_0x52f5('0x54')]>0x0){if(!_[_0x52f5('0x45')](_0x1f1765[_0x52f5('0x5c')])&&_0x1f1765[_0x52f5('0x5c')]>0x0){return!![];}loggerPredictive[_0x52f5('0x52')](_0x52f5('0x5e'));if(!_[_0x52f5('0x45')](_0x1f1765[_0x52f5('0x5f')])&&_0x1f1765[_0x52f5('0x5f')]>0x0){return!![];}loggerPredictive[_0x52f5('0x52')](_0x52f5('0x60'));}else{loggerPredictive['info'](_0x52f5('0x61'));}}else{loggerPredictive[_0x52f5('0x52')](_0x52f5('0x62'));}return![];}function mergeDataErlangB(_0x4a5f09){return function(_0x250d3d){loggerPredictive[_0x52f5('0x52')](_0x52f5('0x63'));loggerPredictive['info']('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x250d3d[_0x52f5('0x64')]);loggerPredictive[_0x52f5('0x52')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x250d3d['erlangCallToSecond']);loggerPredictive[_0x52f5('0x52')](_0x52f5('0x65'),_0x250d3d[_0x52f5('0x66')]);loggerPredictive[_0x52f5('0x52')](_0x52f5('0x67'),_0x250d3d[_0x52f5('0x68')]);loggerPredictive[_0x52f5('0x52')](_0x52f5('0x65'),_0x250d3d[_0x52f5('0x66')]);loggerPredictive[_0x52f5('0x52')]('---------------------------');_[_0x52f5('0x69')](_0x4a5f09,_0x250d3d);};}function ifInterval(_0x3365dd,_0x37f343){if(_[_0x52f5('0x45')](_0x37f343)){return![];}return utils['getSeconds'](undefined,_0x37f343)<_0x3365dd*0x3c;}function clearPredictiveAttributes(_0x3ba9f8){if(_0x3ba9f8[_0x52f5('0x6a')]){_0x3ba9f8[_0x52f5('0x6a')]=undefined;loggerPredictive['debug'](_0x3ba9f8[_0x52f5('0x4e')],_0x52f5('0x6b'));}if(_0x3ba9f8['startPredictive']){_0x3ba9f8[_0x52f5('0x2b')]=undefined;loggerPredictive[_0x52f5('0x49')](_0x3ba9f8['name'],_0x52f5('0x6c'));}if(_0x3ba9f8[_0x52f5('0x6d')]){clearInterval(_0x3ba9f8[_0x52f5('0x6d')]);_0x3ba9f8[_0x52f5('0x6d')]=undefined;loggerPredictive['debug'](_0x3ba9f8['name'],_0x52f5('0x6e'));}}function loggerCatchPredictive(_0x576f03,_0x25d6e2){return function(_0x22b8b9){loggerPredictive[_0x52f5('0x6f')](_0x25d6e2['name'],_0x576f03);loggerPredictive[_0x52f5('0x6f')](_0x22b8b9[_0x52f5('0x70')]);clearPredictiveAttributes(_0x25d6e2);};}function loggerCatch(_0x41b1ab){return function(_0x19d830){logger[_0x52f5('0x6f')](_0x41b1ab,util[_0x52f5('0x4b')](_0x19d830,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x2b0750,_0x28af85,_0x338f20){return function(_0x545c9c){utils[_0x52f5('0x71')](_0x28af85,_0x338f20,0x0);_0x28af85['temp']=0x0;logger[_0x52f5('0x6f')](_0x2b0750,util['inspect'](_0x545c9c,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x1bdc9c){return function(_0x2af22c){if(isNotNull(_0x2af22c)&&isNotNull(_0x2af22c[0x0])){if(_0x2af22c[0x0][_0x52f5('0x72')]>0x0){_0x1bdc9c[_0x52f5('0x73')]=utils[_0x52f5('0x74')][_0x52f5('0x75')];logger[_0x52f5('0x52')](_0x52f5('0x76')+_0x1bdc9c[_0x52f5('0x4e')],_0x2af22c[0x0][_0x52f5('0x72')],'contacts');}else{_0x1bdc9c[_0x52f5('0x73')]=utils[_0x52f5('0x74')]['NO_AVAILABLE_CONTACTS'];logger['info'](_0x52f5('0x77')+_0x1bdc9c[_0x52f5('0x4e')]);}}};}function createObjHistory(_0x413c51,_0x365cea,_0x9a35c9,_0x36bf3b,_0x25fbd9){_0x413c51['message']=_0x9a35c9;var _0x1c9206=new Action(_0x413c51,_0x365cea);var _0x72b453=new History(_0x1c9206);_0x72b453['state']=_0x36bf3b;_0x72b453[_0x52f5('0x78')]=_0x25fbd9;_0x72b453[_0x52f5('0x79')]=_0x1c9206[_0x52f5('0x7a')];return _0x72b453;}function unlockQueueStatus(_0x318b2f,_0x37f5c7){setTimeout(function(){if(_[_0x52f5('0x45')](_0x318b2f[_0x52f5('0x7b')])){loggerBooked[_0x52f5('0x6f')](_0x52f5('0x7c'),_0x37f5c7);}_0x318b2f[_0x52f5('0x7b')]=!![];loggerBooked[_0x52f5('0x52')](_0x52f5('0x7d'),_0x37f5c7,JSON[_0x52f5('0x7e')](_[_0x52f5('0x7f')](_0x318b2f,[_0x52f5('0x4e'),'queueStatusComplete'])));},0x1f3);}function checkInterval(_0x3c08e5){return function(){if(!isNotNull(_0x3c08e5[_0x52f5('0x80')])){_0x3c08e5['message']=utils[_0x52f5('0x74')][_0x52f5('0x81')];throw _0x3c08e5[_0x52f5('0x4e')]+_0x52f5('0x82');}if(!isNotNull(_0x3c08e5[_0x52f5('0x80')][_0x52f5('0x83')])){_0x3c08e5['message']=utils['CAMPAIGN_STATUS'][_0x52f5('0x81')];throw _0x3c08e5[_0x52f5('0x4e')]+_0x52f5('0x82');}if(!isNotNull(_[_0x52f5('0x50')](_0x3c08e5[_0x52f5('0x80')][_0x52f5('0x83')]))){_0x3c08e5[_0x52f5('0x73')]=utils[_0x52f5('0x74')][_0x52f5('0x81')];throw _0x3c08e5['name']+'\x20INTERVAL_IS_NULL';}};}function checkIsIVRCampaignActive(_0x231979){return function(){if(!utils[_0x52f5('0x84')](_0x231979)){_0x231979[_0x52f5('0x73')]=utils[_0x52f5('0x74')][_0x52f5('0x85')];throw _0x231979['name']+_0x52f5('0x86');}};}function emitCampaignSummary(_0x1110f1){if(utils[_0x52f5('0x87')](_0x1110f1)){emit(util[_0x52f5('0x4c')](_0x52f5('0x88'),_0x1110f1[_0x52f5('0x4e')]),_0x52f5('0x89'),_0x1110f1);}}function loggerCatchQueueSummary(_0x55bd14,_0x1f6659){return function(_0x15deb4){clearPredictiveAttributes(_0x1f6659);emitCampaignSummary(_0x1f6659);loggerSyncQueueSummary[_0x52f5('0x49')](_0x55bd14,util[_0x52f5('0x4b')](_0x15deb4,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x3793d6){if(_0x3793d6[_0x52f5('0x8a')]){if(_0x3793d6['originated']===0x0){_0x3793d6[_0x52f5('0x8a')]=![];_0x3793d6[_0x52f5('0x73')]=utils[_0x52f5('0x74')][_0x52f5('0x85')];loggerSyncQueueSummary[_0x52f5('0x49')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x3793d6['name'],_0x52f5('0x8b'));}else{_0x3793d6[_0x52f5('0x73')]=utils['CAMPAIGN_STATUS']['DISACTIVED'];loggerSyncQueueSummary[_0x52f5('0x49')](_0x52f5('0x8c'),_0x3793d6[_0x52f5('0x4e')],_0x52f5('0x8d'));}emitCampaignSummary(_0x3793d6);}}function myreject(_0x55cd6e){return function(_0x301b24){return _0x55cd6e(msgResponse('[ifTime][Action]','Error',JSON[_0x52f5('0x7e')](_0x301b24)));};}Dialer[_0x52f5('0x1c')][_0x52f5('0x8e')]=function(_0x57ffbb){return!_['isUndefined'](_0x57ffbb)&&_0x57ffbb&&!_[_0x52f5('0x45')](_0x57ffbb[_0x52f5('0x4e')])&&!_[_0x52f5('0x45')](_0x57ffbb[_0x52f5('0x8f')])&&_0x57ffbb['active']&&(this[_0x52f5('0x24')][util[_0x52f5('0x4c')](_0x52f5('0x90'),_0x57ffbb['name'])]['status']===_0x52f5('0x91')||this[_0x52f5('0x24')][util[_0x52f5('0x4c')](_0x52f5('0x90'),_0x57ffbb[_0x52f5('0x4e')])][_0x52f5('0x92')]===_0x52f5('0x93'));};Dialer[_0x52f5('0x1c')][_0x52f5('0x94')]=function(_0x164cdc){var _0x5d2abc=this;return function(){if(!_0x5d2abc[_0x52f5('0x8e')](_0x164cdc['Trunk'])){if(!_0x5d2abc[_0x52f5('0x8e')](_0x164cdc['TrunkBackup'])){_0x164cdc[_0x52f5('0x73')]=utils[_0x52f5('0x74')][_0x52f5('0x95')];throw _0x164cdc[_0x52f5('0x4e')]+_0x52f5('0x96');}}};};Dialer['prototype'][_0x52f5('0x97')]=function(_0x130a15,_0x6eebcf,_0x3b2e8f,_0x5f561d){var _0x1ed2c5=this;return function(){var _0x40b2b0=!![];return _0x1ed2c5[_0x52f5('0x98')](_0x130a15,_0x6eebcf,_0x3b2e8f,_0x5f561d,_0x40b2b0);};};Dialer[_0x52f5('0x1c')][_0x52f5('0x99')]=function(_0x540306,_0x267af0,_0x20a235,_0x17184a){var _0x45b430=this;return function(){var _0x4dec7a=![];return _0x45b430['ifTimeIvr'](_0x540306[_0x52f5('0x83')],_0x267af0,_0x20a235,_0x17184a,_0x4dec7a);};};Dialer[_0x52f5('0x1c')][_0x52f5('0x98')]=function(_0x57ede5,_0x3097d8,_0x4130d3,_0x3f18e3,_0x27d287){var _0x5cd267=[];return new Promise(function(_0x45ceba,_0x1beb03){if(!isNotNull(_0x57ede5)){_0x3f18e3[_0x52f5('0x73')]=utils['CAMPAIGN_STATUS'][_0x52f5('0x81')];return _0x1beb03(msgResponse('ifTime',_0x52f5('0x9a'),_0x4130d3+_0x52f5('0x9b')));}if(_[_0x52f5('0x50')](_0x57ede5)){_0x3f18e3['message']=utils[_0x52f5('0x74')][_0x52f5('0x9c')];return _0x1beb03(msgResponse(_0x52f5('0x9d'),_0x52f5('0x9a'),_0x4130d3+'\x20Intervals\x20is\x20empty\x20'));}if(_0x3097d8&&_[_0x52f5('0x45')](config[_0x52f5('0x9e')][_0x3097d8])){_0x3f18e3['message']=utils[_0x52f5('0x74')][_0x52f5('0x9f')];return _0x1beb03(msgResponse('ifTime',_0x52f5('0x9a'),_0x4130d3+'\x20Timezone\x20unknow\x20'+_0x3097d8));}if(_['isArray'](_0x57ede5)){for(var _0x281009=0x0;_0x281009<_0x57ede5[_0x52f5('0xa0')];_0x281009+=0x1){_0x5cd267[_0x52f5('0xa1')](ami[_0x52f5('0xa2')]({'action':_0x52f5('0xa3'),'command':util[_0x52f5('0x4c')](_0x52f5('0xa4'),_0x57ede5[_0x281009][_0x52f5('0xa5')],!_[_0x52f5('0x45')](config[_0x52f5('0x9e')][_0x3097d8])?_0x3097d8:'')})[_0x52f5('0x43')](function(_0x2e00ad){return _0x2e00ad[_0x52f5('0xa6')]['indexOf'](_0x52f5('0xa7'))>=0x0;})[_0x52f5('0xa8')](myreject(_0x1beb03)));}}else{_0x5cd267[_0x52f5('0xa1')](ami[_0x52f5('0xa2')]({'action':_0x52f5('0xa3'),'command':util[_0x52f5('0x4c')](_0x52f5('0xa4'),_0x57ede5,!_[_0x52f5('0x45')](config[_0x52f5('0x9e')][_0x3097d8])?_0x3097d8:'')})[_0x52f5('0x43')](function(_0x249aa1){return _0x249aa1[_0x52f5('0xa6')][_0x52f5('0xa9')]('true')>=0x0;})[_0x52f5('0xa8')](myreject(_0x1beb03)));}Promise['all'](_0x5cd267)['then'](function(_0x4d3af8){var _0x35d643=_[_0x52f5('0xaa')](_0x4d3af8);if(_0x35d643){return _0x45ceba(_0x35d643);}else{_0x3f18e3[_0x52f5('0x73')]=_0x27d287?utils[_0x52f5('0x74')]['OVERTIME_GLOBAL_INTERVAL']:utils['CAMPAIGN_STATUS'][_0x52f5('0xab')];return _0x1beb03(msgResponse(_0x52f5('0xac'),_0x52f5('0x9a'),'Global:\x20'+_0x27d287+'\x20'+_0x4130d3+_0x52f5('0xad')+util[_0x52f5('0x4b')](_0x57ede5,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x3097d8));}})[_0x52f5('0xa8')](function(_0x393167){return _0x1beb03(msgResponse('ifTime',_0x52f5('0x9a'),JSON[_0x52f5('0x7e')](_0x393167)));});});};Dialer[_0x52f5('0x1c')]['loopCampaigns']=function(){var _0x144ead=this;return cmHopper[_0x52f5('0xae')]({'active':![]},{'where':{'active':!![]}})['then'](function(){setInterval(function(){_0x144ead['syncCampaigns']();},0x3e8);});};Dialer[_0x52f5('0x1c')][_0x52f5('0xaf')]=function(){var _0x3a6e41=this;var _0x5024d3;for(var _0x308bf8 in this[_0x52f5('0x22')]){if(typeof this[_0x52f5('0x22')][_0x308bf8]!==_0x52f5('0xb0')){_0x5024d3=this['campaigns'][_0x308bf8];if(utils[_0x52f5('0x87')](_0x5024d3)&&utils[_0x52f5('0x84')](_0x5024d3)){_0x5024d3[_0x52f5('0x8a')]=!![];Promise['resolve']()['then'](checkIsIVRCampaignActive(_0x5024d3))[_0x52f5('0x43')](checkInterval(_0x5024d3))['then'](_0x3a6e41[_0x52f5('0x94')](_0x5024d3))['then'](_0x3a6e41[_0x52f5('0x97')](_0x5024d3['dialGlobalInterval'],_0x5024d3['dialTimezone'],_0x5024d3[_0x52f5('0x4e')],_0x5024d3))[_0x52f5('0x43')](_0x3a6e41[_0x52f5('0x99')](_0x5024d3[_0x52f5('0x80')],_0x5024d3['dialTimezone'],_0x5024d3[_0x52f5('0x4e')],_0x5024d3))[_0x52f5('0x43')](_0x3a6e41['launchHandleIvr'](_0x5024d3))[_0x52f5('0xa8')](loggerCatchQueueSummary(_0x52f5('0xb1'),_0x5024d3));}else{notSendMessagesCampaign(_0x5024d3);}}}};Dialer[_0x52f5('0x1c')][_0x52f5('0xb2')]=function(_0x3b0680){if(_0x3b0680[_0x52f5('0xb3')]!=='predictive'){clearPredictiveAttributes(_0x3b0680);}switch(_0x3b0680['dialMethod']){case _0x52f5('0xb4'):this[_0x52f5('0xb5')](_0x3b0680,0x1);break;case _0x52f5('0xb6'):this[_0x52f5('0xb5')](_0x3b0680,_0x3b0680[_0x52f5('0xb7')]);break;case _0x52f5('0xc'):this['predictive'](_0x3b0680);break;case _0x52f5('0xb'):this[_0x52f5('0xb5')](_0x3b0680,0x1);break;default:logger[_0x52f5('0x6f')](_0x52f5('0xb8'),_0x3b0680[_0x52f5('0x4e')],'method\x20not\x20recognized');}};Dialer[_0x52f5('0x1c')][_0x52f5('0x9d')]=function(_0x3eb4f0,_0x2e82a2){var _0x3174d0=_0x3eb4f0[_0x52f5('0xb9')];var _0x2f06d4=_0x2e82a2?_0x3eb4f0[_0x52f5('0xba')]:_0x3eb4f0[_0x52f5('0x80')][_0x52f5('0x83')];logger[_0x52f5('0xbb')](_0x52f5('0xbc'),_0x2f06d4,_0x3174d0,_0x3eb4f0[_0x52f5('0x4e')],util[_0x52f5('0x4c')](_0x52f5('0xbd'),_0x3eb4f0[_0x52f5('0x4e')],_0x3eb4f0['id']));var _0x5d51b6=null;return Interval[_0x52f5('0xbe')](_0x2f06d4,_0x3174d0)[_0x52f5('0x43')](function(_0x4c5d47){if(_0x4c5d47===!![]){return _0x4c5d47;}else{_0x3eb4f0['message']=_0x2e82a2?utils[_0x52f5('0x74')][_0x52f5('0xbf')]:utils[_0x52f5('0x74')][_0x52f5('0xab')];_0x5d51b6=msgResponse(_0x52f5('0xac'),_0x52f5('0x9a'),_0x52f5('0xc0')+_0x2e82a2+'\x20'+_0x3eb4f0['name']+_0x52f5('0xad')+util['inspect'](_0x2f06d4,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x3174d0);}if(_0x5d51b6!==null){logger[_0x52f5('0xbb')](_0x52f5('0xc1'),_0x5d51b6);_0x5d51b6['isGlobal']=_0x2e82a2;throw _0x5d51b6;}})[_0x52f5('0xa8')](function(_0x1addea){logger[_0x52f5('0x6f')]('AMI\x20IfTime',_0x1addea);throw msgResponse(_0x52f5('0xc2'),_0x52f5('0xc3'),util[_0x52f5('0x4b')](_0x1addea,{'showHidden':![],'depth':null}));});};Dialer[_0x52f5('0x1c')][_0x52f5('0x30')]=function(_0x1b4b88){if(this[_0x52f5('0x21')][_0x1b4b88['queue']]){if(this[_0x52f5('0x29')][_0x1b4b88[_0x52f5('0xc4')]]&&this[_0x52f5('0x29')][_0x1b4b88[_0x52f5('0xc4')]][_0x52f5('0x47')]!=='ivr'){this[_0x52f5('0xc5')](this['voiceQueues'][_0x1b4b88[_0x52f5('0xc6')]]);this['uniqueId'][_0x1b4b88['uniqueid']][_0x52f5('0xc7')]=moment()[_0x52f5('0x4c')](_0x52f5('0xc8'));}}};Dialer[_0x52f5('0x1c')][_0x52f5('0x35')]=function(_0x4706bc){var _0x32a213=this[_0x52f5('0x29')][_0x4706bc[_0x52f5('0xc4')]];if(this[_0x52f5('0x21')][_0x4706bc['queue']]){if(_0x32a213&&_0x32a213[_0x52f5('0x47')]!=='ivr'){delete this[_0x52f5('0x29')][_0x4706bc[_0x52f5('0xc4')]];this[_0x52f5('0x21')][_0x4706bc[_0x52f5('0xc6')]]['outboundAnswerCallsDay']+=0x1;var _0x3e41a7=new AgentComplete(_0x32a213,_0x4706bc);if(_0x4706bc[_0x52f5('0xc9')]===_0x52f5('0xca')){_0x3e41a7[_0x52f5('0xcb')]=this[_0x52f5('0x21')][_0x4706bc[_0x52f5('0xc6')]][_0x52f5('0xcc')]&&this[_0x52f5('0x21')][_0x4706bc[_0x52f5('0xc6')]][_0x52f5('0xcd')]?moment()[_0x52f5('0x4c')](_0x52f5('0xc8')):undefined;}hopperUtils[_0x52f5('0xce')](_0x3e41a7)['catch'](loggerCatch(_0x52f5('0xcf')));hopperUtils['moveContactManagedDialer'](_0x3e41a7)[_0x52f5('0xa8')](loggerCatch(_0x52f5('0xd0')));}}};Dialer[_0x52f5('0x1c')][_0x52f5('0x31')]=function(_0x2d4143){var _0x26d1ec=this['uniqueId'][_0x2d4143[_0x52f5('0xc4')]];var _0x3fe031=this;var _0x32a4cb=![];var _0x48984d;var _0x475c13;if(this['voiceQueues'][_0x2d4143[_0x52f5('0xc6')]]){if(_0x26d1ec&&_0x26d1ec[_0x52f5('0x47')]!==_0x52f5('0xd1')){delete this['uniqueId'][_0x2d4143[_0x52f5('0xc4')]];this[_0x52f5('0xc5')](this[_0x52f5('0x21')][_0x2d4143['queue']]);_0x26d1ec['droptime']=moment()[_0x52f5('0x4c')](_0x52f5('0xc8'));var _0x3ecb2c=new QueueCallerAbandon(_0x26d1ec,_0x2d4143);if(utils[_0x52f5('0xd2')](_0x26d1ec[_0x52f5('0xd3')],_0x26d1ec['responsetime'])>=_0x26d1ec[_0x52f5('0xd4')]){this[_0x52f5('0x21')][_0x2d4143['queue']]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x52f5('0x21')][_0x2d4143[_0x52f5('0xc6')]][_0x52f5('0xd5')]+=0x1;this['voiceQueues'][_0x2d4143[_0x52f5('0xc6')]][_0x52f5('0xd6')]+=0x1;_0x3ecb2c['state']=0xa;_0x3ecb2c[_0x52f5('0x78')]=_0x52f5('0xd7');_0x3ecb2c['dropreason']=_0x52f5('0xd8');_0x3ecb2c[_0x52f5('0xcb')]=this[_0x52f5('0x21')][_0x2d4143[_0x52f5('0xc6')]][_0x52f5('0xcc')]?moment()['format'](_0x52f5('0xc8')):undefined;_0x3ecb2c[_0x52f5('0xd9')]+=0x1;_0x3ecb2c[_0x52f5('0xda')]+=0x1;_0x48984d=this[_0x52f5('0x21')][_0x2d4143[_0x52f5('0xc6')]]['dialDropRetryFrequency'];_0x475c13=this['voiceQueues'][_0x2d4143['queue']][_0x52f5('0xdb')];hopperUtils['verifyAdditionalPhones'](_0x3ecb2c,_0x3ecb2c[_0x52f5('0xdc')],_0x26d1ec[_0x52f5('0xdd')])[_0x52f5('0x43')](function(_0x22c198){_0x32a4cb=_0x22c198[_0x52f5('0xde')]==0x1;if(_0x3ecb2c[_0x52f5('0xd9')]>=_0x3fe031[_0x52f5('0x21')][_0x2d4143[_0x52f5('0xc6')]][_0x52f5('0xdf')]){_0x3fe031[_0x52f5('0xe0')](_0x3ecb2c,_0x22c198['additional']);}else{hopperUtils[_0x52f5('0xe1')]({'active':![],'countdropretry':_0x3ecb2c[_0x52f5('0xd9')],'scheduledat':moment()['add'](_0x3fe031[_0x52f5('0x21')][_0x2d4143[_0x52f5('0xc6')]]['dialDropRetryFrequency'],_0x52f5('0xe2'))[_0x52f5('0x4c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x26d1ec['ContactId'],'ListId':_0x26d1ec[_0x52f5('0xe3')],'VoiceQueueId':_0x26d1ec[_0x52f5('0xe4')]||undefined,'CampaignId':_0x26d1ec[_0x52f5('0xe5')]||undefined})[_0x52f5('0xa8')](loggerCatch(_0x52f5('0xe6')));var _0x5a7dbb=new History(_0x3ecb2c);_0x5a7dbb[_0x52f5('0xdc')]=0xa;_0x5a7dbb['statedesc']='Drop';_0x5a7dbb[_0x52f5('0x7a')]=moment()[_0x52f5('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0x5a7dbb['endtime']=_0x5a7dbb['starttime'];_0x5a7dbb['calleridname']=_0x3ecb2c['calleridname'];_0x5a7dbb['calleridnum']=_0x3ecb2c[_0x52f5('0xe7')];hopperUtils[_0x52f5('0xce')](_0x5a7dbb)['catch'](loggerCatch(_0x52f5('0xe8')));}})[_0x52f5('0x43')](function(){if(_0x32a4cb)hopperUtils[_0x52f5('0xe9')](_0x3ecb2c,_0x48984d,_0x475c13)['then'](function(){return 0x1;});});}else{this['voiceQueues'][_0x2d4143['queue']][_0x52f5('0xea')]+=0x1;this[_0x52f5('0x21')][_0x2d4143[_0x52f5('0xc6')]][_0x52f5('0xeb')]+=0x1;_0x3ecb2c['state']=0xb;_0x3ecb2c['statedesc']=_0x52f5('0xec');_0x3ecb2c[_0x52f5('0xed')]=_0x52f5('0xee');_0x3ecb2c[_0x52f5('0xef')]+=0x1;_0x3ecb2c[_0x52f5('0xda')]+=0x1;_0x48984d=this[_0x52f5('0x21')][_0x2d4143['queue']][_0x52f5('0xf0')];_0x475c13=this[_0x52f5('0x21')][_0x2d4143[_0x52f5('0xc6')]][_0x52f5('0xdb')];hopperUtils[_0x52f5('0xf1')](_0x3ecb2c,_0x3ecb2c[_0x52f5('0xdc')],_0x26d1ec[_0x52f5('0xdd')])[_0x52f5('0x43')](function(_0x45e10e){if(_0x3ecb2c[_0x52f5('0xef')]>=_0x3fe031['voiceQueues'][_0x2d4143[_0x52f5('0xc6')]][_0x52f5('0xf2')]){_0x3fe031['queueCallerAbandonCreateState'](_0x3ecb2c,_0x45e10e['additional']);}else{hopperUtils[_0x52f5('0xe1')]({'active':![],'countabandonedretry':_0x3ecb2c[_0x52f5('0xef')],'scheduledat':moment()[_0x52f5('0xf3')](_0x3fe031[_0x52f5('0x21')][_0x2d4143[_0x52f5('0xc6')]][_0x52f5('0xf0')],_0x52f5('0xe2'))[_0x52f5('0x4c')](_0x52f5('0xc8')),'ContactId':_0x26d1ec[_0x52f5('0xf4')],'ListId':_0x26d1ec[_0x52f5('0xe3')],'VoiceQueueId':_0x26d1ec[_0x52f5('0xe4')]||undefined,'CampaignId':_0x26d1ec['CampaignId']||undefined})[_0x52f5('0xa8')](loggerCatch(_0x52f5('0xf5')));var _0x2b4f79=new History(_0x3ecb2c);_0x2b4f79['state']=0xb;_0x2b4f79['statedesc']=_0x52f5('0xec');_0x2b4f79[_0x52f5('0x7a')]=moment()[_0x52f5('0x4c')](_0x52f5('0xc8'));_0x2b4f79['endtime']=_0x2b4f79[_0x52f5('0x7a')];_0x2b4f79[_0x52f5('0xf6')]=_0x3ecb2c[_0x52f5('0xf6')];_0x2b4f79[_0x52f5('0xe7')]=_0x3ecb2c[_0x52f5('0xe7')];hopperUtils['createHistory'](_0x2b4f79)[_0x52f5('0xa8')](loggerCatch(_0x52f5('0xf7')));}})[_0x52f5('0x43')](function(){if(_0x32a4cb)hopperUtils[_0x52f5('0xe9')](_0x3ecb2c,_0x48984d,_0x475c13)[_0x52f5('0x43')](function(){return 0x1;});});}}}};Dialer[_0x52f5('0x1c')][_0x52f5('0x3b')]=function(_0x34c609){if(this[_0x52f5('0x27')][_0x34c609[_0x52f5('0xc4')]]){this[_0x52f5('0x27')][_0x34c609['uniqueid']]['channel']=_0x34c609[_0x52f5('0xf8')];}if(this['uniqueId'][_0x34c609['uniqueid']]){this[_0x52f5('0x29')][_0x34c609[_0x52f5('0xc4')]]['channel']=_0x34c609[_0x52f5('0xf8')];}};Dialer['prototype'][_0x52f5('0x3f')]=function(_0x6103f0){if(!this[_0x52f5('0x27')][_0x6103f0[_0x52f5('0xf9')]]){return;}var _0x3adf0d=this[_0x52f5('0x21')][this['actions'][_0x6103f0['actionid']]['queue']][_0x52f5('0xfa')]||_0x52f5('0xfb');if(_0x3adf0d===_0x52f5('0xfc')){if(this[_0x52f5('0x27')][_0x6103f0[_0x52f5('0xf9')]]&&_[_0x52f5('0xfd')](this[_0x52f5('0x27')][_0x6103f0[_0x52f5('0xf9')]]['locked'])&&_0x6103f0[_0x52f5('0x92')]==='1'&&_0x6103f0[_0x52f5('0xfe')]==='0'){if(this[_0x52f5('0x23')][_0x6103f0['stateinterface']]){if(!this[_0x52f5('0x23')][_0x6103f0[_0x52f5('0xff')]]['locked']){this['agents'][_0x6103f0[_0x52f5('0xff')]][_0x52f5('0x100')]=!![];this[_0x52f5('0x27')][_0x6103f0[_0x52f5('0xf9')]][_0x52f5('0x100')]=!![];this[_0x52f5('0x27')][_0x6103f0[_0x52f5('0xf9')]]['stateinterface']=_0x6103f0[_0x52f5('0xff')];}}}}else if(_0x3adf0d===_0x52f5('0xfb')){if(this[_0x52f5('0x27')][_0x6103f0[_0x52f5('0xf9')]]){if(this['agents'][_0x6103f0['stateinterface']]){this[_0x52f5('0x27')][_0x6103f0[_0x52f5('0xf9')]][_0x52f5('0xff')]=_0x6103f0['stateinterface'];if(_[_0x52f5('0xfd')](this[_0x52f5('0x2d')][this[_0x52f5('0x27')][_0x6103f0['actionid']][_0x52f5('0xc6')]])){this['queueBooked'][this[_0x52f5('0x27')][_0x6103f0[_0x52f5('0xf9')]][_0x52f5('0xc6')]]=[];}this[_0x52f5('0x2d')][this[_0x52f5('0x27')][_0x6103f0[_0x52f5('0xf9')]]['queue']][_0x52f5('0xa1')](_[_0x52f5('0x69')](_['pick'](this[_0x52f5('0x27')][_0x6103f0[_0x52f5('0xf9')]],[_0x52f5('0x101'),_0x52f5('0xff')]),{'status':_0x6103f0[_0x52f5('0x92')],'paused':_0x6103f0['paused']}));}}}};Dialer[_0x52f5('0x1c')][_0x52f5('0x102')]=function(_0x2a76bd){if(!this['actions'][_0x2a76bd[_0x52f5('0xf9')]]){return;}var _0x5f2017=this;var _0x5540be=this['voiceQueues'][this[_0x52f5('0x27')][_0x2a76bd[_0x52f5('0xf9')]][_0x52f5('0xc6')]];var _0x596bcb=_0x5540be['strategy']||_0x52f5('0xfb');if(_0x596bcb===_0x52f5('0xfc')){if(this['actions'][_0x2a76bd[_0x52f5('0xf9')]]&&this['actions'][_0x2a76bd[_0x52f5('0xf9')]][_0x52f5('0xff')]){this[_0x52f5('0x103')]['run'](this['actions'][_0x2a76bd['actionid']][_0x52f5('0x101')],this[_0x52f5('0x27')][_0x2a76bd['actionid']][_0x52f5('0xff')])[_0x52f5('0xa8')](function(_0x438fa8){logger['error'](_0x52f5('0x104'),util[_0x52f5('0x4b')](_0x438fa8,{'showHidden':![],'depth':null}));})['finally'](function(){_0x5f2017[_0x52f5('0xc5')](_0x5f2017[_0x52f5('0x21')][_0x5f2017['actions'][_0x2a76bd['actionid']][_0x52f5('0xc6')]]);_0x5f2017['agents'][_0x5f2017[_0x52f5('0x27')][_0x2a76bd[_0x52f5('0xf9')]][_0x52f5('0xff')]][_0x52f5('0x100')]=![];delete _0x5f2017[_0x52f5('0x27')][_0x2a76bd[_0x52f5('0xf9')]];unlockQueueStatus(_0x5540be);});}else{this[_0x52f5('0xc5')](this[_0x52f5('0x21')][this[_0x52f5('0x27')][_0x2a76bd[_0x52f5('0xf9')]][_0x52f5('0xc6')]]);hopperUtils[_0x52f5('0xe1')]({'active':![],'ContactId':this[_0x52f5('0x27')][_0x2a76bd['actionid']][_0x52f5('0xf4')],'ListId':this[_0x52f5('0x27')][_0x2a76bd['actionid']][_0x52f5('0xe3')],'VoiceQueueId':this[_0x52f5('0x27')][_0x2a76bd[_0x52f5('0xf9')]][_0x52f5('0xe4')]||undefined,'CampaignId':this['actions'][_0x2a76bd['actionid']][_0x52f5('0xe5')]||undefined})['catch'](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x52f5('0x27')][_0x2a76bd[_0x52f5('0xf9')]];unlockQueueStatus(_0x5540be);}}else if(_0x596bcb===_0x52f5('0xfb')){var _0x5a9266;if(this[_0x52f5('0x27')][_0x2a76bd['actionid']]&&!_[_0x52f5('0x50')](this[_0x52f5('0x2d')][this[_0x52f5('0x27')][_0x2a76bd['actionid']]['queue']])){if(this[_0x52f5('0x105')][_0x5f2017[_0x52f5('0x27')][_0x2a76bd['actionid']]['queue']]){this[_0x52f5('0x105')][_0x5f2017[_0x52f5('0x27')][_0x2a76bd[_0x52f5('0xf9')]][_0x52f5('0xc6')]]=this[_0x52f5('0x105')][this['actions'][_0x2a76bd[_0x52f5('0xf9')]][_0x52f5('0xc6')]]?this[_0x52f5('0x105')][this['actions'][_0x2a76bd[_0x52f5('0xf9')]][_0x52f5('0xc6')]]:this[_0x52f5('0x2d')][this[_0x52f5('0x27')][_0x2a76bd[_0x52f5('0xf9')]]['queue']]?this[_0x52f5('0x2d')][this[_0x52f5('0x27')][_0x2a76bd[_0x52f5('0xf9')]][_0x52f5('0xc6')]][_0x52f5('0x106')]||0x0:0x0;}this[_0x52f5('0x2d')][this[_0x52f5('0x27')][_0x2a76bd['actionid']][_0x52f5('0xc6')]][_0x52f5('0x106')]=this[_0x52f5('0x105')][this[_0x52f5('0x27')][_0x2a76bd[_0x52f5('0xf9')]]['queue']];for(var _0x4377d3=0x0;_0x4377d3=_0x59d22a[_0x52f5('0x130')]){_0x20ab33[_0x52f5('0x131')](_0x20bfbe,_0x4e9b8d,_0x570185,_0x52f5('0x132'));}else{if(_0x20bfbe[_0x52f5('0x129')]>=_0x59d22a['dialMachineMaxRetry']){_0x20ab33[_0x52f5('0x133')](_0x20bfbe,_0x4e9b8d,_0x570185,_0x52f5('0x134'));}else{hopperUtils[_0x52f5('0xe1')]({'active':![],'countmachineretry':_0x20bfbe[_0x52f5('0x129')],'scheduledat':moment()[_0x52f5('0xf3')](_0x59d22a['dialMachineRetryFrequency'],_0x52f5('0xe2'))[_0x52f5('0x4c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x20bfbe[_0x52f5('0xf4')],'ListId':_0x20bfbe[_0x52f5('0xe3')],'VoiceQueueId':_0x20bfbe[_0x52f5('0xe4')]||undefined,'CampaignId':_0x20bfbe['CampaignId']||undefined})[_0x52f5('0xa8')](loggerCatch('[rescheduleContact][Machine]'));_0x4e9b8d({'reschedule':0x1});}}});}if(_0x3c84b4[_0x52f5('0x47')]===_0x52f5('0xd1')&&this['campaigns'][_0x3c84b4[_0x52f5('0xc6')]][_0x52f5('0x11b')]&&_0xb516e2[_0x52f5('0x125')]===_0x52f5('0x135')){delete this[_0x52f5('0x29')][_0xb516e2[_0x52f5('0xc4')]];this['updateOriginated'](this[_0x52f5('0x22')][_0x3c84b4[_0x52f5('0xc6')]]);_0x414e71=new Hangup(_0x3c84b4,_0xb516e2);_0x414e71['state']=0x12;_0x414e71['statedesc']='HangupInAMD';_0x414e71['membername']=_0x52f5('0x11e');ami[_0x52f5('0x46')](_0x52f5('0x11f'),ut[_0x52f5('0x120')](_0x414e71,_0x52f5('0x121')));this[_0x52f5('0x122')](_0x414e71,_0x52f5('0x136'),_0x52f5('0x137'));}if(_0x3c84b4['type']===_0x52f5('0xd1')&&this[_0x52f5('0x22')][_0x3c84b4[_0x52f5('0xc6')]][_0x52f5('0x11b')]&&_0xb516e2[_0x52f5('0x125')]===_0x52f5('0x138')){return new Promise(function(_0x430111,_0x378aa7){delete _0x20ab33['uniqueId'][_0xb516e2[_0x52f5('0xc4')]];_0x20ab33['updateOriginated'](_0x20ab33[_0x52f5('0x22')][_0x3c84b4[_0x52f5('0xc6')]]);_0x20ab33[_0x52f5('0x22')][_0x3c84b4[_0x52f5('0xc6')]][_0x52f5('0x11c')]+=0x1;_0x20ab33[_0x52f5('0x22')][_0x3c84b4[_0x52f5('0xc6')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x2dd63a=_0x20ab33[_0x52f5('0x22')][_0x3c84b4[_0x52f5('0xc6')]];var _0x3a2e9d=new Hangup(_0x3c84b4,_0xb516e2);_0x3a2e9d[_0x52f5('0xdc')]=0x13;_0x3a2e9d[_0x52f5('0x78')]='Machine';_0x3a2e9d['membername']='AMD';_0x3a2e9d[_0x52f5('0x129')]+=0x1;_0x3a2e9d[_0x52f5('0xda')]+=0x1;_0x3a2e9d[_0x52f5('0x121')]=!![];ami[_0x52f5('0x46')](_0x52f5('0x11f'),ut[_0x52f5('0x120')](_0x3a2e9d,_0x52f5('0x121')));hopperUtils[_0x52f5('0xce')](_0x3a2e9d)[_0x52f5('0xa8')](loggerCatch(_0x52f5('0x12a')));if(_0x3a2e9d[_0x52f5('0x12b')]+_0x3a2e9d['countcongestionretry']+_0x3a2e9d[_0x52f5('0x12d')]+_0x3a2e9d[_0x52f5('0x12e')]+_0x3a2e9d['countdropretry']+_0x3a2e9d[_0x52f5('0xef')]+_0x3a2e9d['countmachineretry']+_0x3a2e9d[_0x52f5('0x12f')]>=_0x2dd63a[_0x52f5('0x130')]){_0x20ab33[_0x52f5('0x131')](_0x3a2e9d,_0x430111,_0x378aa7,_0x52f5('0x132'));}else{if(_0x3a2e9d[_0x52f5('0x129')]>=_0x2dd63a[_0x52f5('0x139')]){_0x20ab33[_0x52f5('0x133')](_0x3a2e9d,_0x430111,_0x378aa7,_0x52f5('0x134'));}else{hopperUtils[_0x52f5('0xe1')]({'active':![],'countmachineretry':_0x3a2e9d['countmachineretry'],'scheduledat':moment()['add'](_0x2dd63a[_0x52f5('0x13a')],_0x52f5('0xe2'))[_0x52f5('0x4c')](_0x52f5('0xc8')),'ContactId':_0x3a2e9d[_0x52f5('0xf4')],'ListId':_0x3a2e9d[_0x52f5('0xe3')],'VoiceQueueId':_0x3a2e9d[_0x52f5('0xe4')]||undefined,'CampaignId':_0x3a2e9d[_0x52f5('0xe5')]||undefined})[_0x52f5('0xa8')](loggerCatch('[rescheduleContact][Machine]'));_0x430111({'reschedule':0x1});}}});}}};Dialer[_0x52f5('0x1c')][_0x52f5('0x39')]=function(_0x4b91c8){var _0x3c1248=this['uniqueId'][_0x4b91c8[_0x52f5('0xc4')]];var _0x45de8c;if(_0x3c1248&&_0x3c1248['type']===_0x52f5('0xd1')){delete this[_0x52f5('0x29')][_0x4b91c8['uniqueid']];this[_0x52f5('0xc5')](this[_0x52f5('0x22')][_0x3c1248[_0x52f5('0xc6')]]);this[_0x52f5('0x22')][_0x3c1248['queue']][_0x52f5('0x13b')]+=0x1;_0x45de8c=new Hangup(_0x3c1248,_0x4b91c8);hopperUtils['createHistory'](_0x45de8c)[_0x52f5('0xa8')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0x52f5('0x13c')](_0x45de8c)[_0x52f5('0xa8')](loggerCatch(_0x52f5('0x13d')));}if(_0x3c1248&&_0x3c1248[_0x52f5('0x47')]!==_0x52f5('0xd1')&&isNotNull(this[_0x52f5('0x21')][_0x3c1248[_0x52f5('0xc6')]][_0x52f5('0x13e')])){delete this['uniqueId'][_0x4b91c8[_0x52f5('0xc4')]];this[_0x52f5('0xc5')](this[_0x52f5('0x21')][_0x3c1248[_0x52f5('0xc6')]]);this[_0x52f5('0x21')][_0x3c1248[_0x52f5('0xc6')]][_0x52f5('0x11c')]+=0x1;this['voiceQueues'][_0x3c1248[_0x52f5('0xc6')]][_0x52f5('0x126')]+=0x1;_0x45de8c=new Hangup(_0x3c1248,_0x4b91c8);_0x45de8c['state']=0x10;_0x45de8c[_0x52f5('0x78')]=_0x52f5('0x13f');_0x45de8c[_0x52f5('0x128')]=_0x52f5('0x140');hopperUtils[_0x52f5('0xce')](_0x45de8c)[_0x52f5('0xa8')](loggerCatch(_0x52f5('0x141')));hopperUtils[_0x52f5('0x13c')](_0x45de8c)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x3c1248&&_0x3c1248[_0x52f5('0x47')]!=='ivr'&&!isNotNull(this['voiceQueues'][_0x3c1248[_0x52f5('0xc6')]]['dialQueueProject'])){delete this[_0x52f5('0x29')][_0x4b91c8[_0x52f5('0xc4')]];this[_0x52f5('0xc5')](this[_0x52f5('0x21')][_0x3c1248[_0x52f5('0xc6')]]);this[_0x52f5('0x21')][_0x3c1248[_0x52f5('0xc6')]][_0x52f5('0x142')]+=0x1;_0x45de8c=new Hangup(_0x3c1248,_0x4b91c8);_0x45de8c['state']=0xc;_0x45de8c[_0x52f5('0x78')]=_0x4b91c8[_0x52f5('0x143')];_0x45de8c[_0x52f5('0x128')]=_0x52f5('0x144');hopperUtils['createHistory'](_0x45de8c)[_0x52f5('0xa8')](loggerCatch(_0x52f5('0x141')));hopperUtils['moveContactManagedDialer'](_0x45de8c)[_0x52f5('0xa8')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0x52f5('0x1c')][_0x52f5('0xe')]=function(_0x119276){var _0x1258f9=this;if(!_0x1258f9[_0x52f5('0x2e')][_0x119276[_0x52f5('0x4e')]]){_0x1258f9[_0x52f5('0x2e')][_0x119276[_0x52f5('0x4e')]]={'running':![]};}else if(_0x1258f9['queuesSummary'][_0x119276['name']]['running']===!![]){return;}else if(_0x1258f9[_0x52f5('0x2e')][_0x119276[_0x52f5('0x4e')]][_0x52f5('0x145')]===![]){_0x1258f9[_0x52f5('0x2e')][_0x119276[_0x52f5('0x4e')]][_0x52f5('0x145')]=!![];}var _0xd8ef70=_0x1258f9[_0x52f5('0x21')][_0x119276[_0x52f5('0x4e')]];var _0x1b1e5a=_0xd8ef70['message']!==utils[_0x52f5('0x74')][_0x52f5('0x85')];var _0x23aa6d=utils[_0x52f5('0x146')](_0xd8ef70);_0xd8ef70[_0x52f5('0x147')]=utils[_0x52f5('0x148')](_0xd8ef70,_0x1258f9[_0x52f5('0x24')]);Promise[_0x52f5('0x149')]()['then'](function(){if(_0xd8ef70[_0x52f5('0x147')]===utils[_0x52f5('0x74')]['INACTIVE']){if(_0x1b1e5a){clearPredictiveAttributes(_0xd8ef70);_0x119276[_0x52f5('0x2b')]=undefined;_0x119276['startProgressive']=undefined;}if(_0xd8ef70[_0x52f5('0x147')]===utils[_0x52f5('0x74')][_0x52f5('0x85')]){_0x119276[_0x52f5('0x14a')]=0x0;_0x119276['paused']=0x0;_0x119276['inUse']=0x0;_0x119276[_0x52f5('0x14b')]=0x0;_0x119276[_0x52f5('0x14c')]=0x0;}}else if(_0xd8ef70[_0x52f5('0x147')]===utils['CAMPAIGN_STATUS'][_0x52f5('0x14d')]&&!_0x23aa6d){return _0x1258f9[_0x52f5('0x9d')](_0xd8ef70,!![])['then'](function(){return _0x1258f9['ifTime'](_0xd8ef70,![]);})[_0x52f5('0x43')](function(){return _0x1258f9['checkDialMethod'](_0xd8ef70);})[_0x52f5('0xa8')](function(_0x2c2d16){loggerSyncQueueSummary[_0x52f5('0x49')](_0x52f5('0x14e'),util[_0x52f5('0x4b')](_0x2c2d16,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0xd8ef70);});}else{clearPredictiveAttributes(_0xd8ef70);}})[_0x52f5('0x43')](function(){var _0x364117=_0x119276[_0x52f5('0x14f')](_0xd8ef70);if(_0x364117||_0xd8ef70[_0x52f5('0x150')]){_0xd8ef70[_0x52f5('0x150')]=![];_0x119276['updateReportFromOutboundQueue'](_0xd8ef70);Object[_0x52f5('0x151')](_0xd8ef70,_0x119276);emitOutboundVoiceQueueSummary(_0x119276);}_0x1258f9[_0x52f5('0x2e')][_0xd8ef70['name']][_0x52f5('0x145')]=![];})[_0x52f5('0xa8')](function(_0x3929a4){logger[_0x52f5('0x6f')](_0x52f5('0x14e'),util[_0x52f5('0x4b')](_0x3929a4,{'showHidden':![],'depth':null}));_0x1258f9[_0x52f5('0x2e')][_0xd8ef70[_0x52f5('0x4e')]][_0x52f5('0x145')]=![];});};Dialer['prototype'][_0x52f5('0x37')]=_[_0x52f5('0x152')](function(){var _0xe2eb47=_['filter'](this[_0x52f5('0x21')],function(_0x5e9972){return _0x5e9972[_0x52f5('0x153')];});var _0x539587=_[_0x52f5('0x154')](this['agents'],function(_0x5b4b01){return _0x5b4b01['online']&&_0x5b4b01[_0x52f5('0x92')]===_0x52f5('0x91');});if(_0xe2eb47[_0x52f5('0xa0')]>0x0&&_0x539587['length']>0x0){return Promise['resolve']()['then'](cmHopper[_0x52f5('0x155')](_['map'](_0xe2eb47,'id'),previewRecallmeReminderInterval,_[_0x52f5('0x156')](_0x539587,'id')))[_0x52f5('0x43')](function(_0x24c467){for(var _0x4c71f5=0x0;_0x4c71f5<_0x24c467[_0x52f5('0xa0')];_0x4c71f5++){var _0x1a96cb=_0x24c467[_0x4c71f5][_0x52f5('0x157')][_0x52f5('0x4e')];if(_0x1a96cb)io['to'](util[_0x52f5('0x4c')]('user:%s',_0x1a96cb))['emit'](_0x52f5('0x158'),{'hopper':_0x24c467[_0x4c71f5]});}})[_0x52f5('0xa8')](function(_0x1b3160){logger[_0x52f5('0x6f')]('checkPreviewRecallReminder',_0x1b3160);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x52f5('0x1c')][_0x52f5('0x42')]=function(){var _0x31ca46=this;setInterval(function(){_0x31ca46['clearZombieChannels'](_0x31ca46[_0x52f5('0x29')],_0x52f5('0x159'));_0x31ca46[_0x52f5('0x15a')](_0x31ca46[_0x52f5('0x27')],_0x52f5('0x15b'));},0x32c8);};Dialer['prototype'][_0x52f5('0x15a')]=function(_0x339cf5,_0x30355d){var _0x26be0d=this;for(var _0x31c516 in _0x339cf5){if(typeof _0x339cf5[_0x31c516]!==_0x52f5('0xb0')){this[_0x52f5('0x20')]['enqueue'](function(){if(!_[_0x52f5('0xfd')](_0x339cf5[_0x31c516])){return ami[_0x52f5('0xa2')]({'action':_0x52f5('0x92'),'channel':_0x339cf5[_0x31c516]['channel']})[_0x52f5('0xa8')](function(_0x4d658a){if(_0x4d658a[_0x52f5('0x73')]===_0x52f5('0x15c')){setTimeout(function(){if(_0x339cf5[_0x31c516]&&_0x339cf5[_0x31c516][_0x52f5('0x47')]!==_0x52f5('0xd1')){_0x26be0d[_0x52f5('0xc5')](_0x26be0d[_0x52f5('0x21')][_0x339cf5[_0x31c516]['queue']]);logger[_0x52f5('0x6f')]('[Dialer][checkChannel]',_0x30355d,_0x31c516,_0x339cf5[_0x31c516][_0x52f5('0xc6')]);delete _0x339cf5[_0x31c516];}if(_0x339cf5[_0x31c516]&&_0x339cf5[_0x31c516]['type']==='ivr'){_0x26be0d[_0x52f5('0xc5')](_0x26be0d[_0x52f5('0x22')][_0x339cf5[_0x31c516]['queue']]);logger['error']('[Dialer][checkChannel][ivr]',_0x30355d,_0x31c516,_0x339cf5[_0x31c516][_0x52f5('0xc6')]);delete _0x339cf5[_0x31c516];}},0x2328);}});}});}}};Dialer[_0x52f5('0x1c')][_0x52f5('0x15d')]=function(_0x3b612c){return Promise['resolve']()[_0x52f5('0x43')](voiceQueueRt[_0x52f5('0x15d')](_0x3b612c))[_0x52f5('0xa8')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x52f5('0x1c')][_0x52f5('0xc5')]=function(_0x54f694){if(!_[_0x52f5('0x45')](_0x54f694)&&_0x54f694!==null){if(typeof _0x54f694[_0x52f5('0x15e')]!==_0x52f5('0xb0')){if(_0x54f694[_0x52f5('0x15e')]>0x0){_0x54f694[_0x52f5('0x15e')]-=0x1;}else{logger[_0x52f5('0x6f')](_0x52f5('0x15f'));}}}else{logger[_0x52f5('0x6f')](_0x52f5('0x160'));}};Dialer['prototype'][_0x52f5('0x161')]=function(_0x513c92,_0xee0941){var _0x46e7ce=this;return function(_0x4978bd){_0x46e7ce[_0x52f5('0xc5')](_0xee0941);logger[_0x52f5('0x6f')](_0x513c92,util['inspect'](_0x4978bd,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x52f5('0x162')]=function(_0xfff9d9,_0x5106c2,_0x51f64f){var _0x5c7f91={'state':0x19,'statedesc':_0x52f5('0x163')};this[_0x52f5('0xc5')](_0x5106c2);this[_0x52f5('0x122')](_[_0x52f5('0x69')](_0x5c7f91,_['pick'](_0x51f64f,[_0x52f5('0xf4'),_0x52f5('0xe3'),'UserId',_0x52f5('0xe4'),'CampaignId'])),_0x52f5('0x164'),'[emptyContact]');logger['error'](_0xfff9d9);};Dialer['prototype'][_0x52f5('0x122')]=function(_0x4d3dc6,_0x3dc4a9,_0x263675){hopperUtils[_0x52f5('0xce')](_0x4d3dc6)[_0x52f5('0xa8')](loggerCatch(_0x3dc4a9));hopperUtils['moveContactManagedDialer'](_0x4d3dc6)['catch'](loggerCatch(_0x263675));};Dialer['prototype']['queueCallerAbandonCreateState']=function(_0x349d41,_0x3f99b3){hopperUtils[_0x52f5('0xce')](_0x349d41)[_0x52f5('0xa8')](loggerCatch(_0x52f5('0xcf')));if(_0x3f99b3==0x0){hopperUtils[_0x52f5('0x13c')](_0x349d41)[_0x52f5('0xa8')](loggerCatch(_0x52f5('0x165')));}};Dialer['prototype'][_0x52f5('0x166')]=function(_0x30208b){return Promise[_0x52f5('0x149')]()[_0x52f5('0x43')](cmHopper[_0x52f5('0x155')](_0x30208b['id'],previewRecallmeReminderInterval))[_0x52f5('0x43')](function(_0x563bed){for(var _0x1e74c6=0x0;_0x1e74c6<_0x563bed[_0x52f5('0xa0')];_0x1e74c6++){var _0x331836=_0x563bed[_0x1e74c6][_0x52f5('0x157')][_0x52f5('0x4e')];if(_0x331836)io['to'](util[_0x52f5('0x4c')](_0x52f5('0x167'),_0x331836))[_0x52f5('0x46')]('user:dialPreviewRecallReminder',{'hopper':_0x563bed[_0x1e74c6]});}})[_0x52f5('0xa8')](function(){});};Dialer[_0x52f5('0x1c')][_0x52f5('0x168')]=function(_0x53e561){var _0x43b72b=this;return function(){_0x43b72b['handleIvr'](_0x53e561);};};Dialer[_0x52f5('0x1c')][_0x52f5('0x169')]=function(_0x2b7084,_0x35f70b){var _0x34d011=this;var _0x488065=uuid['v4']();this['actions'][_0x488065]=new Action(_0x2b7084,_0x35f70b,_0x488065);return new Promise(function(_0x58ab02,_0xe65354){if(_['isUndefined'](_0x2b7084)&&typeof _0x2b7084!=='object'){return _0xe65354(msgResponse(_0x52f5('0x16a'),_0x52f5('0x9a'),_0x52f5('0x16b')));}if(_['isUndefined'](_0x35f70b[_0x52f5('0x16c')])||_0x35f70b['phone']===null){return _0xe65354(msgResponse('originate',_0x52f5('0x9a'),_0x52f5('0x16d')));}var _0x39ec5d={'XMD-CALLERID':_0x34d011[_0x52f5('0x27')][_0x488065][_0x52f5('0x16e')](),'XMD-AGI':_0x2b7084['dialQueueProject']?util['format'](_0x52f5('0x16f'),ipAgi,_0x2b7084[_0x52f5('0x13e')]):_0x52f5('0x170'),'XMD-AGIAFTER':_0x2b7084[_0x52f5('0xcc')]?util[_0x52f5('0x4c')](_0x52f5('0x16f'),ipAgi,_0x2b7084[_0x52f5('0xcc')]):_0x52f5('0x170'),'XMD-QUEUE':utils[_0x52f5('0x171')](_0x2b7084)?util[_0x52f5('0x4c')](_0x52f5('0x172'),_0x2b7084[_0x52f5('0x4e')],_0x2b7084['dialQueueOptions']||'',_0x2b7084[_0x52f5('0xcd')]?'c':'',_0x2b7084[_0x52f5('0xd4')]||0x3):'NONE','XMD-CONTACTID':_0x35f70b[_0x52f5('0xf4')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x34d011['actions'][_0x488065][_0x52f5('0x16e')](),'XMD-AMD':_0x2b7084[_0x52f5('0x11b')]?_0x52f5('0x14d'):_0x52f5('0x170'),'XMD-DESTINATION':_0x52f5('0x11a')};if(_0x2b7084[_0x52f5('0x11b')]){_0x39ec5d[_0x52f5('0x173')]=_0x2b7084['dialAMDInitialSilence']||0x9c4;_0x39ec5d[_0x52f5('0x174')]=_0x2b7084[_0x52f5('0x175')]||0x5dc;_0x39ec5d[_0x52f5('0x176')]=_0x2b7084[_0x52f5('0x177')]||0x320;_0x39ec5d[_0x52f5('0x178')]=_0x2b7084[_0x52f5('0x179')]||0x1388;_0x39ec5d['XMD-AMDMINWORDLENGTH']=_0x2b7084['dialAMDMinWordLength']||0x64;_0x39ec5d[_0x52f5('0x17a')]=_0x2b7084[_0x52f5('0x17b')]||0x32;_0x39ec5d[_0x52f5('0x17c')]=_0x2b7084[_0x52f5('0x17d')]||0x3;_0x39ec5d[_0x52f5('0x17e')]=_0x2b7084[_0x52f5('0x17f')]||0x100;_0x39ec5d['XMD-AMDMAXIMUMWORDLENGTH']=_0x2b7084[_0x52f5('0x180')]||0x1388;}if(utils[_0x52f5('0x171')](_0x2b7084)){_0x39ec5d[_0x52f5('0x181')]=_0x35f70b[_0x52f5('0xe4')];}else{_0x39ec5d['XMD-CAMPAIGNID']=_0x35f70b[_0x52f5('0xe5')];}var _0x471dea=utils[_0x52f5('0x182')](_0x35f70b['Contact']);Object[_0x52f5('0x151')](_0x39ec5d,_0x471dea);var _0x56f406=_0x34d011['isTrunkReachable'](_0x2b7084[_0x52f5('0x183')])?utils[_0x52f5('0x184')](_0x2b7084[_0x52f5('0x183')][_0x52f5('0x185')],_0x2b7084[_0x52f5('0x186')],_0x2b7084[_0x52f5('0x187')]>0x0?utils[_0x52f5('0x188')](_0x2b7084['dialOriginateCallerIdNumber'],_0x2b7084[_0x52f5('0x187')]):_0x2b7084[_0x52f5('0x189')]):utils[_0x52f5('0x184')](_['isNil'](_0x2b7084[_0x52f5('0x18a')])?_0x2b7084[_0x52f5('0x183')][_0x52f5('0x185')]:_0x2b7084[_0x52f5('0x18a')][_0x52f5('0x185')],_0x2b7084[_0x52f5('0x186')],_0x2b7084[_0x52f5('0x187')]>0x0?utils['getCallerIdRandom'](_0x2b7084[_0x52f5('0x189')],_0x2b7084[_0x52f5('0x187')]):_0x2b7084[_0x52f5('0x189')]);if(_0x56f406){_0x39ec5d[_0x52f5('0x18b')]=_0x34d011[_0x52f5('0x27')][_0x488065][_0x52f5('0x18c')]=utils[_0x52f5('0x18d')](_0x56f406);_0x39ec5d[_0x52f5('0x18e')]=_0x35f70b['phone'];}_0x2b7084[_0x52f5('0x18f')]=_0x39ec5d;return ami['Action']({'actionid':_0x488065,'action':'originate','channel':_0x34d011[_0x52f5('0x8e')](_0x2b7084['Trunk'])?util[_0x52f5('0x4c')]('SIP/%s/%s%s',_0x2b7084[_0x52f5('0x183')]['name'],isNotNull(_0x2b7084[_0x52f5('0x190')])?_0x2b7084[_0x52f5('0x190')][_0x52f5('0x191')]()||'':'',_0x2b7084[_0x52f5('0x192')]>0x0?_0x35f70b[_0x52f5('0x16c')][_0x52f5('0x193')](_0x2b7084[_0x52f5('0x192')]):_0x35f70b[_0x52f5('0x16c')]):util[_0x52f5('0x4c')]('SIP/%s/%s%s',_['isNil'](_0x2b7084['TrunkBackup'])?_0x2b7084['Trunk'][_0x52f5('0x4e')]:_0x2b7084[_0x52f5('0x18a')][_0x52f5('0x4e')],isNotNull(_0x2b7084[_0x52f5('0x190')])?_0x2b7084[_0x52f5('0x190')][_0x52f5('0x191')]()||'':'',_0x2b7084[_0x52f5('0x192')]>0x0?_0x35f70b['phone']['substring'](_0x2b7084['dialCutDigit']):_0x35f70b[_0x52f5('0x16c')]),'callerid':_0x56f406,'Exten':_0x52f5('0x11a'),'Context':_0x52f5('0x194'),'Priority':'1','variable':_0x39ec5d,'timeout':(_0x2b7084[_0x52f5('0x195')]||0x1e)*0x3e8,'async':!![],'channelid':_0x488065})[_0x52f5('0x43')](function(_0x6ff629){return _0x58ab02(_0x6ff629);})['catch'](function(_0x494024){_0x2b7084[_0x52f5('0x196')]+=0x1;var _0x15eb30=new History(_0x34d011[_0x52f5('0x27')][_0x488065]);logger[_0x52f5('0x6f')](util[_0x52f5('0x4c')]('[originateError]:\x20%s',JSON[_0x52f5('0x7e')](_0x494024)));_0x15eb30[_0x52f5('0xdc')]=0xe;_0x15eb30[_0x52f5('0x78')]=_0x52f5('0x197');_0x15eb30[_0x52f5('0x7a')]=moment()[_0x52f5('0x4c')](_0x52f5('0xc8'));_0x15eb30[_0x52f5('0x79')]=_0x15eb30['starttime'];hopperUtils[_0x52f5('0xce')](_0x15eb30)[_0x52f5('0xa8')](loggerCatch(_0x52f5('0x198')));_0x34d011[_0x52f5('0x13c')](_0x15eb30)[_0x52f5('0xa8')](loggerCatch(_0x52f5('0x198')))[_0x52f5('0x1f')](function(){delete _0x34d011[_0x52f5('0x27')][_0x488065];return _0xe65354(msgResponse(_0x52f5('0x16a'),_0x52f5('0xc3'),_0x52f5('0x199')));});});});};Dialer[_0x52f5('0x1c')][_0x52f5('0x19a')]=function(_0x4bdb0f,_0xe41e2e,_0x4df605){var _0x788f5a=new History(_0xe41e2e);if(_0x788f5a[_0x52f5('0x12b')]+_0x788f5a['countcongestionretry']+_0x788f5a['countnoanswerretry']+_0x788f5a[_0x52f5('0x12e')]+_0x788f5a['countdropretry']+_0x788f5a[_0x52f5('0xef')]+_0x788f5a[_0x52f5('0x129')]+_0x788f5a[_0x52f5('0x12f')]>=_0x4df605[_0x52f5('0x130')]-0x1){return!![];}switch(_0x4bdb0f){case 0x3:if(_0x788f5a['countnoanswerretry']>=_0x4df605[_0x52f5('0x19b')]-0x1){return!![];}hopperUtils[_0x52f5('0xe1')]({'active':![],'countnoanswerretry':_0x788f5a[_0x52f5('0x12d')]+=0x1,'scheduledat':moment()[_0x52f5('0xf3')](_0x4df605['dialNoAnswerRetryFrequency'],_0x52f5('0xe2'))[_0x52f5('0x4c')](_0x52f5('0xc8')),'ContactId':_0x788f5a[_0x52f5('0xf4')],'ListId':_0x788f5a[_0x52f5('0xe3')],'VoiceQueueId':_0x788f5a[_0x52f5('0xe4')]||undefined,'CampaignId':_0x788f5a[_0x52f5('0xe5')]||undefined})[_0x52f5('0xa8')](loggerCatch(_0x52f5('0x19c')));break;case 0x5:if(_0x788f5a[_0x52f5('0x12b')]>=_0x4df605[_0x52f5('0x19d')]-0x1){return!![];}hopperUtils[_0x52f5('0xe1')]({'active':![],'countbusyretry':_0x788f5a['countbusyretry']+=0x1,'scheduledat':moment()[_0x52f5('0xf3')](_0x4df605[_0x52f5('0x19e')],_0x52f5('0xe2'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x788f5a['ContactId'],'ListId':_0x788f5a[_0x52f5('0xe3')],'VoiceQueueId':_0x788f5a[_0x52f5('0xe4')]||undefined,'CampaignId':_0x788f5a[_0x52f5('0xe5')]||undefined})[_0x52f5('0xa8')](loggerCatch(_0x52f5('0x19f')));break;case 0x8:if(_0x788f5a[_0x52f5('0x12c')]>=_0x4df605['dialCongestionMaxRetry']-0x1){return!![];}hopperUtils[_0x52f5('0xe1')]({'active':![],'countcongestionretry':_0x788f5a[_0x52f5('0x12c')]+=0x1,'scheduledat':moment()[_0x52f5('0xf3')](_0x4df605[_0x52f5('0x1a0')],'minutes')[_0x52f5('0x4c')](_0x52f5('0xc8')),'ContactId':_0x788f5a[_0x52f5('0xf4')],'ListId':_0x788f5a[_0x52f5('0xe3')],'VoiceQueueId':_0x788f5a[_0x52f5('0xe4')]||undefined,'CampaignId':_0x788f5a[_0x52f5('0xe5')]||undefined})[_0x52f5('0xa8')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x788f5a[_0x52f5('0x12e')]>=_0x4df605['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{hopperUtils[_0x52f5('0xe1')]({'active':![],'countnosuchnumberretry':_0x788f5a['countnosuchnumberretry']+=0x1,'scheduledat':moment()['add'](_0x4df605[_0x52f5('0x1a1')],_0x52f5('0xe2'))[_0x52f5('0x4c')](_0x52f5('0xc8')),'ContactId':_0x788f5a[_0x52f5('0xf4')],'ListId':_0x788f5a['ListId'],'VoiceQueueId':_0x788f5a['VoiceQueueId']||undefined,'CampaignId':_0x788f5a['CampaignId']||undefined})[_0x52f5('0xa8')](loggerCatch(_0x52f5('0x1a2')));}break;case 0xa:if(_0x788f5a[_0x52f5('0xd9')]>=_0x4df605[_0x52f5('0xdf')]-0x1){return!![];}hopperUtils[_0x52f5('0xe1')]({'active':![],'countdropretry':_0x788f5a[_0x52f5('0xd9')]+=0x1,'scheduledat':moment()[_0x52f5('0xf3')](_0x4df605[_0x52f5('0x1a3')],_0x52f5('0xe2'))[_0x52f5('0x4c')](_0x52f5('0xc8')),'ContactId':_0x788f5a[_0x52f5('0xf4')],'ListId':_0x788f5a['ListId'],'VoiceQueueId':_0x788f5a['VoiceQueueId']||undefined,'CampaignId':_0x788f5a[_0x52f5('0xe5')]||undefined})[_0x52f5('0xa8')](loggerCatch(_0x52f5('0xe6')));break;case 0xb:if(_0x788f5a[_0x52f5('0xef')]>=_0x4df605[_0x52f5('0xf2')]-0x1){return!![];}hopperUtils[_0x52f5('0xe1')]({'active':![],'countabandonedretry':_0x788f5a[_0x52f5('0xef')]+=0x1,'scheduledat':moment()[_0x52f5('0xf3')](_0x4df605['dialAbandonedRetryFrequency'],_0x52f5('0xe2'))[_0x52f5('0x4c')](_0x52f5('0xc8')),'ContactId':_0x788f5a[_0x52f5('0xf4')],'ListId':_0x788f5a[_0x52f5('0xe3')],'VoiceQueueId':_0x788f5a['VoiceQueueId']||undefined,'CampaignId':_0x788f5a[_0x52f5('0xe5')]||undefined})[_0x52f5('0xa8')](loggerCatch(_0x52f5('0xf5')));break;case 0x13:if(_0x788f5a[_0x52f5('0x129')]>=_0x4df605[_0x52f5('0x139')]-0x1){return!![];}hopperUtils[_0x52f5('0xe1')]({'active':![],'countmachineretry':_0x788f5a['countmachineretry']+=0x1,'scheduledat':moment()[_0x52f5('0xf3')](_0x4df605[_0x52f5('0x13a')],_0x52f5('0xe2'))['format'](_0x52f5('0xc8')),'ContactId':_0x788f5a[_0x52f5('0xf4')],'ListId':_0x788f5a['ListId'],'VoiceQueueId':_0x788f5a['VoiceQueueId']||undefined,'CampaignId':_0x788f5a[_0x52f5('0xe5')]||undefined})[_0x52f5('0xa8')](loggerCatch(_0x52f5('0x1a4')));break;case 0x14:if(_0x788f5a[_0x52f5('0x12f')]>=_0x4df605['dialAgentRejectMaxRetry']-0x1){return!![];}hopperUtils[_0x52f5('0xe1')]({'active':![],'countagentrejectretry':_0x788f5a[_0x52f5('0x12f')]+=0x1,'scheduledat':moment()[_0x52f5('0xf3')](_0x4df605['dialAgentRejectRetryFrequency'],_0x52f5('0xe2'))['format'](_0x52f5('0xc8')),'ContactId':_0x788f5a[_0x52f5('0xf4')],'ListId':_0x788f5a['ListId'],'VoiceQueueId':_0x788f5a['VoiceQueueId']||undefined,'CampaignId':_0x788f5a[_0x52f5('0xe5')]||undefined})[_0x52f5('0xa8')](loggerCatch(_0x52f5('0x1a5')));break;default:return!![];}};Dialer[_0x52f5('0x1c')][_0x52f5('0x1a6')]=function(_0x3f59f8,_0x48535f,_0x5cdfce){var _0x5dc3b7=this;var _0x34137a=new History(_0x3f59f8);var _0x9e40f5=![];var _0x5a51f5;var _0x4d0045;return new Promise(function(_0x394bdd,_0x43a57c){if(_['isUndefined'](_0x48535f)&&typeof _0x48535f!=='object'){return _0x43a57c(msgResponse(_0x52f5('0x1a7'),_0x52f5('0x9a'),'entity\x20is\x20undefine'));}if(_['isUndefined'](_0x5cdfce)&&typeof _0x5cdfce!==_0x52f5('0x1a8')){return _0x43a57c(msgResponse(_0x52f5('0x1a7'),_0x52f5('0x9a'),_0x52f5('0x1a9')));}hopperUtils['verifyAdditionalPhones'](_0x34137a,_0x5cdfce[_0x52f5('0xc9')],_0x48535f)[_0x52f5('0x43')](function(_0x5b2917){if(_0x5b2917[_0x52f5('0xde')]==0x1)_0x9e40f5=!![];switch(_0x5cdfce['reason']){case'0':_0x48535f['outboundNoSuchCallsDay']+=0x1;_0x34137a[_0x52f5('0xdc')]=0x0;_0x34137a[_0x52f5('0x78')]=_0x52f5('0x1aa');_0x34137a[_0x52f5('0x12e')]+=0x1;_0x34137a['countglobal']+=0x1;ami[_0x52f5('0x46')](_0x52f5('0x1ab'),ut['buildObj'](_0x3f59f8,_0x52f5('0x1ac')));_0x5a51f5=_0x48535f[_0x52f5('0x1a1')];_0x4d0045=_0x48535f[_0x52f5('0xdb')];hopperUtils['createHistory'](_0x34137a)['catch'](loggerCatch(_0x52f5('0x12a')));if(_0x5dc3b7['checkRetriveMax'](0x0,_0x3f59f8,_0x48535f)&&!_0x9e40f5){if(_0x34137a['countnosuchnumberretry']>=_0x48535f[_0x52f5('0x1ad')]){_0x5dc3b7[_0x52f5('0x133')](_0x34137a,_0x394bdd,_0x43a57c,_0x52f5('0x1ae'));}else{_0x5dc3b7['stateGlobal'](_0x34137a,_0x394bdd,_0x43a57c,_0x52f5('0x1ae'));}}break;case'3':_0x48535f[_0x52f5('0x1af')]+=0x1;_0x34137a['state']=0x3;_0x34137a[_0x52f5('0x78')]=_0x52f5('0x1b0');_0x34137a[_0x52f5('0x12d')]+=0x1;_0x34137a[_0x52f5('0xda')]+=0x1;var _0x20afa6=ut[_0x52f5('0x1b1')](_0x3f59f8,_0x48535f);ami['emit']('custom:agentnoanswer',_0x20afa6);_0x5a51f5=_0x48535f[_0x52f5('0x1b2')];_0x4d0045=_0x48535f[_0x52f5('0xdb')];hopperUtils[_0x52f5('0xce')](_0x34137a)[_0x52f5('0xa8')](loggerCatch(_0x52f5('0x1b3')));if(_0x5dc3b7[_0x52f5('0x19a')](0x3,_0x3f59f8,_0x48535f)&&!_0x9e40f5){if(_0x34137a[_0x52f5('0x12d')]>=_0x48535f['dialNoAnswerMaxRetry']){_0x5dc3b7[_0x52f5('0x133')](_0x34137a,_0x394bdd,_0x43a57c,_0x52f5('0x1b4'));}else{_0x5dc3b7[_0x52f5('0x131')](_0x34137a,_0x394bdd,_0x43a57c,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x48535f[_0x52f5('0x1b5')]+=0x1;_0x34137a[_0x52f5('0xdc')]=0x5;_0x34137a[_0x52f5('0x78')]=_0x52f5('0x1b6');_0x34137a[_0x52f5('0x12b')]+=0x1;_0x34137a[_0x52f5('0xda')]+=0x1;ami[_0x52f5('0x46')](_0x52f5('0x1b7'),ut['buildObj'](_0x3f59f8,'busy'));_0x5a51f5=_0x48535f[_0x52f5('0x19e')];_0x4d0045=_0x48535f[_0x52f5('0xdb')];hopperUtils['createHistory'](_0x34137a)['catch'](loggerCatch(_0x52f5('0x1b8')));if(_0x5dc3b7[_0x52f5('0x19a')](0x5,_0x3f59f8,_0x48535f)&&!_0x9e40f5){if(_0x34137a[_0x52f5('0x12b')]>=_0x48535f[_0x52f5('0x19d')]){_0x5dc3b7[_0x52f5('0x133')](_0x34137a,_0x394bdd,_0x43a57c,_0x52f5('0x1b9'));}else{_0x5dc3b7[_0x52f5('0x131')](_0x34137a,_0x394bdd,_0x43a57c,_0x52f5('0x1b9'));}}break;case'8':_0x48535f[_0x52f5('0x1ba')]+=0x1;_0x34137a['state']=0x8;_0x34137a[_0x52f5('0x78')]=_0x52f5('0x1bb');_0x34137a[_0x52f5('0x12c')]+=0x1;_0x34137a[_0x52f5('0xda')]+=0x1;_0x5a51f5=_0x48535f[_0x52f5('0x1a0')];_0x4d0045=_0x48535f[_0x52f5('0xdb')];ami[_0x52f5('0x46')]('custom:agentcongestion',ut['buildObj'](_0x3f59f8,_0x52f5('0x1bc')));hopperUtils[_0x52f5('0xce')](_0x34137a)[_0x52f5('0xa8')](loggerCatch(_0x52f5('0x1bd')));if(_0x5dc3b7[_0x52f5('0x19a')](0x8,_0x3f59f8,_0x48535f)&&!_0x9e40f5){if(_0x34137a['countcongestionretry']>=_0x48535f[_0x52f5('0x1be')]){_0x5dc3b7[_0x52f5('0x133')](_0x34137a,_0x394bdd,_0x43a57c,_0x52f5('0x1bf'));}else{_0x5dc3b7[_0x52f5('0x131')](_0x34137a,_0x394bdd,_0x43a57c,'reason\x208\x20congestion');}}break;case'11':_0x48535f['outboundAbandonedCallsDay']+=0x1;_0x34137a[_0x52f5('0xdc')]=0xb;_0x34137a[_0x52f5('0x78')]=_0x52f5('0xec');_0x34137a['countabandonedretry']+=0x1;_0x34137a[_0x52f5('0xda')]+=0x1;_0x5a51f5=_0x48535f[_0x52f5('0xf0')];_0x4d0045=_0x48535f['callAdditionalPhoneAfterMin'];hopperUtils[_0x52f5('0xce')](_0x34137a)[_0x52f5('0xa8')](loggerCatch(_0x52f5('0xf7')));if(_0x5dc3b7['checkRetriveMax'](0xb,_0x3f59f8,_0x48535f)&&!_0x9e40f5){if(_0x34137a[_0x52f5('0xef')]>=_0x48535f[_0x52f5('0xf2')]){_0x5dc3b7[_0x52f5('0x133')](_0x34137a,_0x394bdd,_0x43a57c,_0x52f5('0x1c0'));}else{_0x5dc3b7['stateGlobal'](_0x34137a,_0x394bdd,_0x43a57c,_0x52f5('0x1c0'));}}break;case'20':_0x48535f[_0x52f5('0x1c1')]+=0x1;_0x34137a['state']=0x14;_0x34137a[_0x52f5('0x78')]='AgentReject';_0x34137a[_0x52f5('0x12f')]+=0x1;_0x34137a[_0x52f5('0xda')]+=0x1;_0x5a51f5=_0x48535f[_0x52f5('0x1c2')];_0x4d0045=_0x48535f[_0x52f5('0xdb')];ami[_0x52f5('0x46')](_0x52f5('0x1c3'),ut[_0x52f5('0x120')](_0x3f59f8,_0x52f5('0x1c4')));hopperUtils[_0x52f5('0xce')](_0x34137a)[_0x52f5('0xa8')](loggerCatch(_0x52f5('0x1c5')));if(_0x5dc3b7[_0x52f5('0x19a')](0x14,_0x3f59f8,_0x48535f)&&!_0x9e40f5){if(_0x34137a['countagentrejectretry']>=_0x48535f['dialAgentRejectMaxRetry']){_0x5dc3b7[_0x52f5('0x133')](_0x34137a,_0x394bdd,_0x43a57c,_0x52f5('0x1c6'));}else{_0x5dc3b7['stateGlobal'](_0x34137a,_0x394bdd,_0x43a57c,_0x52f5('0x1c6'));}}break;default:_0x48535f[_0x52f5('0x142')]+=0x1;_0x34137a['state']=0xc;_0x34137a[_0x52f5('0x78')]=_0x5cdfce[_0x52f5('0xc9')];_0x5a51f5=_0x48535f['dialAgentRejectRetryFrequency'];_0x4d0045=_0x48535f[_0x52f5('0xdb')];hopperUtils[_0x52f5('0xce')](_0x34137a)['catch'](loggerCatch(_0x52f5('0x1c7')));if(_0x5dc3b7[_0x52f5('0x19a')](_0x5cdfce[_0x52f5('0xc9')],_0x3f59f8,_0x48535f)&&!_0x9e40f5){if(_0x34137a['countbusyretry']+_0x34137a['countcongestionretry']+_0x34137a[_0x52f5('0x12d')]+_0x34137a[_0x52f5('0x12e')]+_0x34137a[_0x52f5('0xd9')]+_0x34137a[_0x52f5('0xef')]+_0x34137a[_0x52f5('0x129')]+_0x34137a[_0x52f5('0x12f')]>=_0x48535f[_0x52f5('0x130')]){_0x5dc3b7[_0x52f5('0x131')](_0x34137a,_0x394bdd,_0x43a57c,_0x5cdfce['reason']);}else{_0x5dc3b7['createStateFinal'](_0x34137a,_0x394bdd,_0x43a57c,_0x5cdfce[_0x52f5('0xc9')]);}}}})[_0x52f5('0x43')](function(){if(_0x9e40f5){hopperUtils[_0x52f5('0xe9')](_0x34137a,_0x5a51f5,_0x4d0045)[_0x52f5('0x43')](function(){return _0x394bdd(0x1);});}});});};Dialer['prototype'][_0x52f5('0x131')]=function(_0x3d130f,_0x5d48dc,_0x419dad,_0x143bde){var _0x4a0bb6=new Final(_0x3d130f);_0x4a0bb6[_0x52f5('0xdc')]=0xf;_0x4a0bb6[_0x52f5('0x78')]=_0x52f5('0x1c8');this['createStateFinal'](_0x4a0bb6,_0x5d48dc,_0x419dad,_0x143bde);};Dialer[_0x52f5('0x1c')][_0x52f5('0x133')]=function(_0x3afa2e,_0x544b8b,_0x3dca6b,_0x538896){hopperUtils['moveContactManagedDialer'](_0x3afa2e)[_0x52f5('0x43')](function(){return _0x544b8b(msgResponse(_0x52f5('0x1a7'),_0x52f5('0x116'),_0x538896));})[_0x52f5('0xa8')](function(){return _0x3dca6b(msgResponse(_0x52f5('0x1c9'),'Failure',_0x52f5('0x1ca')));});};Dialer[_0x52f5('0x1c')][_0x52f5('0xc')]=function(_0x1a2cf7){var _0x28f31c=_0x1a2cf7['dialPredictiveOptimizationPercentage']/0x64;var _0x49e751=_0x1a2cf7[_0x52f5('0xd5')]/(_0x1a2cf7[_0x52f5('0xd5')]+_0x1a2cf7[_0x52f5('0x11c')]);var _0x23fb12=Math[_0x52f5('0x1cb')](_0x1a2cf7[_0x52f5('0x1cc')]*(_0x1a2cf7[_0x52f5('0x1cd')]/0x64));var _0x40fd01=Math[_0x52f5('0x1cb')](_0x1a2cf7[_0x52f5('0x1cc')]*(_0x1a2cf7[_0x52f5('0x1ce')]/0x64));var _0x59ceae=_0x1a2cf7[_0x52f5('0x14a')]+_0x1a2cf7[_0x52f5('0x14b')];var _0x3791e8=Math[_0x52f5('0x1cf')](_0x1a2cf7[_0x52f5('0x64')]*_0x1a2cf7[_0x52f5('0x66')]*_0x1a2cf7[_0x52f5('0x1d0')]*_0x1a2cf7[_0x52f5('0x1d1')]);if(_[_0x52f5('0x45')](_0x1a2cf7[_0x52f5('0x6a')])){if(!_[_0x52f5('0x45')](_0x1a2cf7[_0x52f5('0x2b')])){_0x1a2cf7[_0x52f5('0x2b')]=undefined;loggerPredictive['error'](_0x52f5('0x1d2'),_0x52f5('0x1d3'));}if(!_['isUndefined'](_0x1a2cf7[_0x52f5('0x6d')])){loggerPredictive[_0x52f5('0x6f')](_0x52f5('0x1d2'),_0x52f5('0x1d4'));clearInterval(_0x1a2cf7[_0x52f5('0x6d')]);_0x1a2cf7[_0x52f5('0x6d')]=undefined;}_0x1a2cf7[_0x52f5('0x6a')]=moment()[_0x52f5('0x4c')](_0x52f5('0xc8'));loggerPredictive[_0x52f5('0x52')](_0x1a2cf7[_0x52f5('0x4e')],_0x52f5('0x1d5'),_0x1a2cf7[_0x52f5('0x6a')]);this[_0x52f5('0xb5')](_0x1a2cf7,0x1);}else if(ifInterval(_0x1a2cf7[_0x52f5('0x1d6')],_0x1a2cf7['startProgressive'])){this[_0x52f5('0xb5')](_0x1a2cf7,0x1);loggerPredictiveCalls[_0x52f5('0x52')](_0x52f5('0x1d7'),_0x1a2cf7[_0x52f5('0x6a')],_0x1a2cf7[_0x52f5('0x4e')]);_0x1a2cf7[_0x52f5('0x64')]=0x0;_0x1a2cf7[_0x52f5('0xd6')]=0x0;}else if(_0x28f31c<_0x49e751&&_0x1a2cf7[_0x52f5('0x1d8')]==='dropRate'){clearPredictiveAttributes(_0x1a2cf7);loggerPredictive[_0x52f5('0x52')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x52f5('0x1d9'),_0x49e751,_0x52f5('0x6a'),_0x1a2cf7[_0x52f5('0x4e')]);}else if(_0x3791e8<_0x1a2cf7['predictiveIntervalErlangCallsDroppedCalls']&&_0x1a2cf7[_0x52f5('0x1d8')]===_0x52f5('0x1da')){clearPredictiveAttributes(_0x1a2cf7);loggerPredictive['info'](_0x52f5('0x1db'),_0x52f5('0x1dc'),_0x3791e8,_0x52f5('0x1dd'),_0x1a2cf7[_0x52f5('0xd6')],_0x52f5('0x6a'),_0x1a2cf7[_0x52f5('0x4e')]);}else if(!ifInterval(_0x1a2cf7[_0x52f5('0x1d6')],_0x1a2cf7[_0x52f5('0x6a')])&&_['isUndefined'](_0x1a2cf7[_0x52f5('0x2b')])&&!_['isUndefined'](_0x1a2cf7[_0x52f5('0x6a')])){_0x1a2cf7['startPredictive']=moment()['format'](_0x52f5('0xc8'));loggerPredictive[_0x52f5('0x52')](_0x1a2cf7['name'],'started\x20in\x20predictive\x20at',_0x1a2cf7[_0x52f5('0x2b')]);hopperUtils['avgHandleTime'](_0x1a2cf7[_0x52f5('0x1d6')])[_0x52f5('0x43')](this[_0x52f5('0x1de')](_0x1a2cf7))['then'](mergeDataErlangB(_0x1a2cf7))[_0x52f5('0x43')](this[_0x52f5('0x1df')](_0x1a2cf7))[_0x52f5('0xa8')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x1a2cf7));}else if(!ifInterval(_0x1a2cf7['dialPredictiveInterval'],_0x1a2cf7[_0x52f5('0x2b')])){_0x1a2cf7[_0x52f5('0xd6')]=0x0;_0x1a2cf7[_0x52f5('0x2b')]=moment()[_0x52f5('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x52f5('0x52')](_0x1a2cf7[_0x52f5('0x4e')],'recalculate\x20predictive\x20at',_0x1a2cf7[_0x52f5('0x2b')]);clearInterval(_0x1a2cf7[_0x52f5('0x6d')]);_0x1a2cf7[_0x52f5('0x6d')]=undefined;hopperUtils['avgHandleTime'](_0x1a2cf7[_0x52f5('0x1d6')])['then'](this[_0x52f5('0x1de')](_0x1a2cf7))[_0x52f5('0x43')](mergeDataErlangB(_0x1a2cf7))[_0x52f5('0x43')](this[_0x52f5('0x1df')](_0x1a2cf7))['catch'](loggerCatchPredictive(_0x52f5('0x1e0'),_0x1a2cf7));}else if(_0x1a2cf7[_0x52f5('0x1cc')]&&_0x59ceae<_0x1a2cf7[_0x52f5('0x1cc')]-_0x40fd01){clearPredictiveAttributes(_0x1a2cf7);loggerPredictive[_0x52f5('0x52')](_0x1a2cf7[_0x52f5('0x4e')],_0x52f5('0x1e1'),_0x59ceae,_0x52f5('0x1e2'),_0x1a2cf7[_0x52f5('0x1cc')],'-',_0x40fd01,'=',_0x1a2cf7[_0x52f5('0x1cc')]-_0x40fd01,')');}else if(_0x1a2cf7[_0x52f5('0x1cc')]&&_0x59ceae>_0x1a2cf7[_0x52f5('0x1cc')]+_0x23fb12){clearPredictiveAttributes(_0x1a2cf7);loggerPredictive[_0x52f5('0x52')](_0x1a2cf7['name'],_0x52f5('0x1e1'),_0x59ceae,_0x52f5('0x1e3'),_0x1a2cf7[_0x52f5('0x1cc')],'+',_0x23fb12,'=',_0x1a2cf7[_0x52f5('0x1cc')]+_0x23fb12,')');}};Dialer[_0x52f5('0x1c')][_0x52f5('0x1de')]=function(_0x151de9){var _0x1998c8=this;return function(_0x3fd0cb){return new Promise(function(_0x38ee92,_0xf470e1){_[_0x52f5('0x69')](_0x151de9,_0x3fd0cb[0x0]);if(checkGetDataPredictive(_0x3fd0cb[0x0])){var _0x165df2=_0x151de9[_0x52f5('0x1cc')]=_0x151de9['talking']+_0x151de9['available'];var _0x117cd4=_0x151de9['dialPredictiveInterval']*0x3c;var _0x1deaa3=_0x3fd0cb[0x0][_0x52f5('0x5c')]+_0x3fd0cb[0x0][_0x52f5('0x5f')];var _0x28db58=(_0x3fd0cb[0x0][_0x52f5('0x56')]+_0x3fd0cb[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x3fd0cb[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x3fd0cb[0x0]['predictiveIntervalTotalCalls'];_0x151de9['predictiveIntervalHitRate']=_0x28db58>0x0?_0x28db58:0x1;switch(_0x151de9[_0x52f5('0x1d8')]){case _0x52f5('0x1da'):var _0x12825a=_0x151de9['dialPredictiveOptimizationPercentage']/0x64;return _0x1998c8[_0x52f5('0x1e4')](_0x165df2,_0x117cd4,_0x1deaa3,_0x28db58,_0x12825a)[_0x52f5('0x43')](function(_0x5c6889){return _0x38ee92(_0x5c6889);});case _0x52f5('0x1e5'):var _0x6a02d1=_0x151de9[_0x52f5('0x1e6')]/0x64;return _0x1998c8[_0x52f5('0x1e7')](_0x165df2,_0x117cd4,_0x1deaa3,_0x28db58,_0x6a02d1)[_0x52f5('0x43')](function(_0x1974d2){return _0x38ee92(_0x1974d2);});default:return _0xf470e1(msgResponse(_0x52f5('0x1e8'),_0x52f5('0x9a'),_0x52f5('0x1e9')));}}else{return _0xf470e1(msgResponse('[getDataPredictive]',_0x52f5('0x9a'),'check\x20failure'));}});};};Dialer[_0x52f5('0x1c')][_0x52f5('0x1ea')]=function(_0x3997fb){var _0x3a5c80=this;return function(_0x3ec55){return new Promise(function(_0x504b77,_0x2cefe5){_['merge'](_0x3997fb,_0x3ec55[0x0]);if(checkGetDataPredictive(_0x3ec55[0x0])){loggerPredictive[_0x52f5('0x52')](JSON[_0x52f5('0x7e')](_0x3ec55[0x0]));if(_0x3997fb['dialPredictiveOptimization']===_0x52f5('0x1da')){return _0x3a5c80['getVoiceQueueRtPauses'](_0x3997fb['id'])['then'](function(_0x11d744){var _0x41de46=_0x3997fb[_0x52f5('0x1eb')]-_0x11d744[0x0][_0x52f5('0x1ec')];var _0x3dcb5d=_0x3997fb['dialPredictiveInterval']*0x3c;var _0x185cb4=_0x3ec55[0x0][_0x52f5('0x5c')]+_0x3ec55[0x0][_0x52f5('0x5f')];var _0x4ceafd=(_0x3ec55[0x0][_0x52f5('0x56')]+_0x3ec55[0x0][_0x52f5('0x58')]+_0x3ec55[0x0][_0x52f5('0xea')])/_0x3ec55[0x0]['predictiveIntervalTotalCalls'];var _0x1b4804=_0x3997fb['dialPredictiveOptimizationPercentage']/0x64;_0x3997fb['predictiveIntervalPauses']=_0x11d744[0x0][_0x52f5('0x1ec')]||0x0;_0x3997fb[_0x52f5('0x1d0')]=_0x4ceafd>0x0?_0x4ceafd:0x1;return _0x3a5c80['abandonmentRate'](_0x41de46,_0x3dcb5d,_0x185cb4,_0x4ceafd,_0x1b4804);})['then'](function(_0x56ff77){return _0x504b77(_0x56ff77);})[_0x52f5('0xa8')](function(_0x2a6856){return _0x2cefe5(msgResponse(_0x52f5('0x1ed'),'Failure',JSON['stringify'](_0x2a6856)));});}if(_0x3997fb['dialPredictiveOptimization']===_0x52f5('0x1e5')){return _0x3a5c80[_0x52f5('0x15d')](_0x3997fb['id'])['then'](function(_0x595a98){var _0x3a8cd0=_0x3997fb[_0x52f5('0x1eb')]-_0x595a98[0x0][_0x52f5('0x1ec')];var _0x5ee5a4=_0x3997fb['dialPredictiveInterval']*0x3c;var _0x23bb36=_0x3ec55[0x0][_0x52f5('0x5c')]+_0x3ec55[0x0][_0x52f5('0x5f')];var _0x37eaf3=(_0x3ec55[0x0][_0x52f5('0x56')]+_0x3ec55[0x0][_0x52f5('0x58')]+_0x3ec55[0x0][_0x52f5('0xea')])/_0x3ec55[0x0][_0x52f5('0x54')];var _0x5c8114=_0x3997fb[_0x52f5('0x1e6')]/0x64;_0x3997fb[_0x52f5('0x1ee')]=_0x595a98[0x0][_0x52f5('0x1ec')]||0x0;_0x3997fb[_0x52f5('0x1d0')]=_0x37eaf3>0x0?_0x37eaf3:0x1;return _0x3a5c80[_0x52f5('0x1e7')](_0x3a8cd0,_0x5ee5a4,_0x23bb36,_0x37eaf3,_0x5c8114);})[_0x52f5('0x43')](function(_0x74b133){return _0x504b77(_0x74b133);})['catch'](function(_0x34c117){return _0x2cefe5(msgResponse(_0x52f5('0x1ed'),'Failure',JSON[_0x52f5('0x7e')](_0x34c117)));});}}else{return _0x2cefe5(msgResponse('[getDataPredictive]','Failure','check\x20failure'));}});};};Dialer[_0x52f5('0x1c')][_0x52f5('0x1df')]=function(_0x2e8ebd){var _0x926715=this;return function(){var _0x1aede2=0x0;var _0x43c18e=Math[_0x52f5('0x1cf')](_0x2e8ebd[_0x52f5('0x1ef')]*0x3e8);if(_0x43c18e>0x0){_0x43c18e=_0x43c18e<0x64?0x64:_0x43c18e;loggerPredictive[_0x52f5('0x52')](_0x2e8ebd[_0x52f5('0x4e')],'one\x20call\x20every:',_0x43c18e,'milliseconds');_0x2e8ebd[_0x52f5('0x6d')]=setInterval(function(){_0x926715['handlePredictive'](_0x2e8ebd);loggerPredictiveCalls['info'](_0x52f5('0x1f0'),_0x1aede2+=0x1);},_0x43c18e);}else{loggerPredictive[_0x52f5('0x52')](_0x2e8ebd[_0x52f5('0x4e')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x52f5('0x1c')][_0x52f5('0x1f1')]=function(_0x3fc7d0,_0x2c3daa){var _0x368b34=this;return function(_0x4300ed){if(_[_0x52f5('0x50')](_0x4300ed)){if(_[_0x52f5('0xfd')](_0x2c3daa['UserId'])||!_0x2c3daa['recallme']){if(_0x3fc7d0['dialMethod']===_0x52f5('0xb')){_0x3fc7d0[_0x52f5('0x7b')]=_[_0x52f5('0x45')](_0x3fc7d0[_0x52f5('0x7b')])?!![]:_0x3fc7d0['queueStatusComplete'];var _0x2a44b3=uuid['v4']();_0x368b34[_0x52f5('0x27')][_0x2a44b3]=new Action(_0x3fc7d0,_0x2c3daa,_0x2a44b3);loggerBooked[_0x52f5('0x52')]('[booked][checkContactBlack]',_0x2a44b3,'queueStatusComplete:\x20',JSON[_0x52f5('0x7e')](_0x3fc7d0['queueStatusComplete']),_0x52f5('0x1f2'),_0x3fc7d0['name']);if(_0x3fc7d0['queueStatusComplete']){_0x3fc7d0[_0x52f5('0x7b')]=![];_0x368b34[_0x52f5('0x2d')][_0x368b34[_0x52f5('0x27')][_0x2a44b3][_0x52f5('0xc6')]]=[];ami[_0x52f5('0xa2')]({'actionid':_0x2a44b3,'action':_0x52f5('0x1f3'),'queue':_0x3fc7d0['name']})[_0x52f5('0xa8')](function(){_0x368b34[_0x52f5('0xc5')](_0x3fc7d0);hopperUtils[_0x52f5('0xe1')]({'active':![],'ContactId':_0x368b34[_0x52f5('0x27')][_0x2a44b3][_0x52f5('0xf4')],'ListId':_0x368b34[_0x52f5('0x27')][_0x2a44b3][_0x52f5('0xe3')],'VoiceQueueId':_0x368b34[_0x52f5('0x27')][_0x2a44b3][_0x52f5('0xe4')]||undefined,'CampaignId':_0x368b34[_0x52f5('0x27')][_0x2a44b3][_0x52f5('0xe5')]||undefined})[_0x52f5('0xa8')](loggerCatch(_0x52f5('0x1f4')));delete _0x368b34[_0x52f5('0x27')][_0x2a44b3];});}else{loggerBooked[_0x52f5('0x52')]('[booked][checkContactBlack][else]',JSON[_0x52f5('0x7e')](_0x3fc7d0[_0x52f5('0x7b')]),_0x52f5('0x1f2'),_0x3fc7d0[_0x52f5('0x4e')]);_0x368b34[_0x52f5('0xc5')](_0x3fc7d0);hopperUtils[_0x52f5('0xe1')]({'active':![],'ContactId':_0x368b34[_0x52f5('0x27')][_0x2a44b3][_0x52f5('0xf4')],'ListId':_0x368b34[_0x52f5('0x27')][_0x2a44b3]['ListId'],'VoiceQueueId':_0x368b34[_0x52f5('0x27')][_0x2a44b3][_0x52f5('0xe4')]||undefined,'CampaignId':_0x368b34[_0x52f5('0x27')][_0x2a44b3][_0x52f5('0xe5')]||undefined})[_0x52f5('0xa8')](loggerCatch(_0x52f5('0x1f4')));delete _0x368b34[_0x52f5('0x27')][_0x2a44b3];}}else{return _0x368b34[_0x52f5('0x169')](_0x3fc7d0,_0x2c3daa);}}else{if(utils[_0x52f5('0xd2')](undefined,_0x2c3daa[_0x52f5('0x1f5')])<_0x3fc7d0[_0x52f5('0x1f6')]*0x3c){if(_0x2c3daa[_0x52f5('0x157')]&&!_0x2c3daa[_0x52f5('0x157')][_0x52f5('0x1f7')]){_0x368b34['preview'][_0x52f5('0x109')](_0x2c3daa['id'])['finally'](function(){_0x368b34[_0x52f5('0xc5')](_0x3fc7d0);});}else{hopperUtils[_0x52f5('0x1f8')]({'active':![]},_0x2c3daa['id'],0x1)[_0x52f5('0x1f')](function(){_0x368b34[_0x52f5('0xc5')](_0x3fc7d0);});}}else{_0x3fc7d0['outboundReCallsDay']+=0x1;_0x368b34['updateOriginated'](_0x3fc7d0);if(_0x3fc7d0[_0x52f5('0x1f9')]){hopperUtils[_0x52f5('0xe1')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x2c3daa[_0x52f5('0xf4')],'ListId':_0x2c3daa[_0x52f5('0xe3')],'VoiceQueueId':_0x2c3daa[_0x52f5('0xe4')]||undefined,'CampaignId':_0x2c3daa['CampaignId']||undefined})[_0x52f5('0xa8')](loggerCatch(_0x52f5('0x1fa')));hopperUtils[_0x52f5('0xce')](createObjHistory(_0x3fc7d0,_0x2c3daa,utils['CAMPAIGN_STATUS']['QUEUE_RECALL'],0x17,_0x52f5('0x1fb')))[_0x52f5('0xa8')](loggerCatch(_0x52f5('0x1fc')));}else{_0x368b34[_0x52f5('0x122')](createObjHistory(_0x3fc7d0,_0x2c3daa,utils[_0x52f5('0x74')][_0x52f5('0x1fd')],0x16,_0x52f5('0x1fe')),_0x52f5('0x1ff'),'[Originate][HistoryRecallClose]');}}}}else{_0x3fc7d0[_0x52f5('0x200')]+=0x1;_0x368b34['saveInDb'](createObjHistory(_0x3fc7d0,_0x2c3daa,utils[_0x52f5('0x74')]['BLACKLIST'],0xd,_0x52f5('0x201')),_0x52f5('0x202'),'[Originate][MoveBlacklist]');throw _0x52f5('0x203');}};};Dialer[_0x52f5('0x1c')][_0x52f5('0x204')]=function(_0x149370){var _0x41c876=this;var _0xaa7686=_0x149370[_0x52f5('0x205')]-_0x149370[_0x52f5('0x15e')];emitCampaignSummary(_0x149370);if(_0xaa7686>0x0&&_0x149370[_0x52f5('0x206')]==0x0){if(_0xaa7686>this[_0x52f5('0x25')]){_0xaa7686=this['maxNumberOriginate'];}_0x149370[_0x52f5('0x206')]=0x1;hopperUtils['getContactDialerIvr'](_0x149370,_0xaa7686)[_0x52f5('0x43')](function(_0x1acf27){_0x149370[_0x52f5('0x206')]=0x0;if(_0x1acf27){if(!utils[_0x52f5('0x207')](_0x1acf27)){_0x149370[_0x52f5('0x73')]=utils[_0x52f5('0x74')]['NO_AVAILABLE_CONTACTS'];logger[_0x52f5('0x52')]('[getContactCampaign2][Empty]'+_0x149370[_0x52f5('0x4e')]);}else{_0x149370[_0x52f5('0x15e')]+=_0x1acf27[_0x52f5('0xa0')];_0x149370[_0x52f5('0x73')]=utils[_0x52f5('0x74')][_0x52f5('0x208')];for(var _0x510e18=0x0;_0x510e18<_0x1acf27['length'];_0x510e18+=0x1){_0x149370[_0x52f5('0x209')]+=0x1;if(_[_0x52f5('0xfd')](_0x1acf27[_0x510e18])||_['isNil'](_0x1acf27[_0x510e18]['Contact'])||_[_0x52f5('0xfd')](_0x1acf27[_0x510e18][_0x52f5('0x16c')])){_0x41c876[_0x52f5('0x162')](_0x52f5('0x20a'),_0x149370,_0x1acf27[_0x510e18]);}else{hopperUtils[_0x52f5('0x20b')](_[_0x52f5('0x7f')](_0x1acf27[_0x510e18],[_0x52f5('0xe5'),_0x52f5('0x16c')]))[_0x52f5('0x43')](_0x41c876['checkContactBlack'](_0x149370,_0x1acf27[_0x510e18]))['catch'](_0x41c876[_0x52f5('0x161')](_0x52f5('0x20c'),_0x149370));}}}}})[_0x52f5('0xa8')](loggerGetContactDialer(_0x52f5('0x20d'),_0x149370,_0xaa7686));}};Dialer[_0x52f5('0x1c')][_0x52f5('0xb5')]=function(_0x562828,_0x115220){var _0x1f74ec=this;var _0x489d1a=[];if(_0x115220<0x1||_0x562828[_0x52f5('0xb3')]===_0x52f5('0xb')){_0x115220=0x1;}var _0x34cc36=Math['floor'](_0x562828[_0x52f5('0x14a')]*_0x115220)-_0x562828[_0x52f5('0x15e')];if(_0x562828[_0x52f5('0x20e')]>0x0){var _0x592d5d=_0x562828['dialLimitQueue']-_0x562828['originated']-_0x562828[_0x52f5('0x14b')]-_0x562828[_0x52f5('0x14c')];if(_0x34cc36>_0x592d5d){_0x34cc36=_0x592d5d;}}if(_0x34cc36>0x0&&_0x562828[_0x52f5('0x206')]==0x0){if(_0x562828[_0x52f5('0xb3')]==='booked'){_0x34cc36=0x1;}if(_0x34cc36>this['maxNumberOriginate']){_0x34cc36=this[_0x52f5('0x25')];}for(var _0x4ebbb7 in this[_0x52f5('0x23')]){if(typeof this[_0x52f5('0x23')][_0x4ebbb7]!==_0x52f5('0xb0')){if(this[_0x52f5('0x23')][_0x4ebbb7][_0x52f5('0xdc')]===_0x52f5('0x20f')&&this['agents'][_0x4ebbb7][_0x52f5('0x92')]===_0x52f5('0x91')){_0x489d1a[_0x52f5('0xa1')](this[_0x52f5('0x23')][_0x4ebbb7]['id']);}}}_0x562828['temp']=0x1;hopperUtils['getContactDialer'](_0x562828,_0x489d1a,_0x34cc36)[_0x52f5('0x43')](function(_0x222866){_0x562828['temp']=0x0;if(_0x222866){if(!utils[_0x52f5('0x207')](_0x222866)){hopperUtils[_0x52f5('0x210')](_0x562828)['then'](sendMessageReschedule(_0x562828))[_0x52f5('0xa8')](loggerCatch(_0x52f5('0x211')));}else{_0x562828[_0x52f5('0x15e')]+=_0x222866['length'];_0x562828[_0x52f5('0x73')]=_0x562828[_0x52f5('0xb3')]===_0x52f5('0xb')?utils[_0x52f5('0x74')]['ACTIVE']:utils[_0x52f5('0x74')][_0x52f5('0x208')];for(var _0x56aa1e=0x0;_0x56aa1e<_0x222866[_0x52f5('0xa0')];_0x56aa1e+=0x1){if(_[_0x52f5('0xfd')](_0x222866[_0x56aa1e])||_['isNil'](_0x222866[_0x56aa1e][_0x52f5('0x212')])||_[_0x52f5('0xfd')](_0x222866[_0x56aa1e][_0x52f5('0x16c')])){_0x1f74ec['emptyContact']('[actionOriginate]\x20',_0x562828,_0x222866[_0x56aa1e]);}else{hopperUtils['checkIsBlackList'](_[_0x52f5('0x7f')](_0x222866[_0x56aa1e],[_0x52f5('0xe4'),'phone']))[_0x52f5('0x43')](_0x1f74ec[_0x52f5('0x1f1')](_0x562828,_0x222866[_0x56aa1e]))['catch'](_0x1f74ec[_0x52f5('0x161')]('[actionOriginate]\x20',_0x562828));}}}}})[_0x52f5('0xa8')](loggerGetContactDialer(_0x52f5('0x213'),_0x562828,_0x34cc36));}};Dialer[_0x52f5('0x1c')][_0x52f5('0x6d')]=function(_0x5bc08d){if(_0x5bc08d[_0x52f5('0x20e')]>0x0){var _0x452d66=_0x5bc08d['dialLimitQueue']-_0x5bc08d['originated']-_0x5bc08d[_0x52f5('0x14b')];if(_0x452d66>0x0&&_0x5bc08d[_0x52f5('0x206')]==0x0){this[_0x52f5('0x214')](_0x5bc08d);}else{loggerPredictiveCalls[_0x52f5('0x52')](_0x52f5('0x215'));}}else{this['tryOriginatePredictive'](_0x5bc08d);}};Dialer['prototype'][_0x52f5('0x214')]=function(_0x2e2220){var _0x3c4249=this;var _0x1c1bc9=[];_0x2e2220[_0x52f5('0x15e')]+=0x1;for(var _0x2335a6 in this[_0x52f5('0x23')]){if(typeof this['agents'][_0x2335a6]!==_0x52f5('0xb0')){if(this[_0x52f5('0x23')][_0x2335a6]['state']===_0x52f5('0x20f')&&this[_0x52f5('0x23')][_0x2335a6]['status']===_0x52f5('0x91')){_0x1c1bc9[_0x52f5('0xa1')](this[_0x52f5('0x23')][_0x2335a6]['id']);}}}_0x2e2220[_0x52f5('0x206')]=0x1;return this['getContactDialer'](_0x2e2220['id'],_0x1c1bc9,0x1,_0x2e2220[_0x52f5('0x216')],_0x2e2220)[_0x52f5('0x43')](function(_0x55d178){_0x2e2220['temp']=0x1;if(_0x55d178){if(!utils[_0x52f5('0x207')](_0x55d178)){utils[_0x52f5('0x71')](_0x2e2220,0x1,0x0);return hopperUtils[_0x52f5('0x210')](_0x2e2220)[_0x52f5('0x43')](sendMessageReschedule(_0x2e2220))[_0x52f5('0xa8')](loggerCatch('[countReScheduled]\x20'));}else{_0x2e2220[_0x52f5('0x73')]=utils[_0x52f5('0x74')][_0x52f5('0x208')];if(_[_0x52f5('0xfd')](_0x55d178[0x0])||_[_0x52f5('0xfd')](_0x55d178[0x0][_0x52f5('0x212')])||_[_0x52f5('0xfd')](_0x55d178[0x0][_0x52f5('0x16c')])){_0x3c4249[_0x52f5('0x162')](_0x52f5('0x20a'),_0x2e2220,_0x55d178[0x0]);}else{return hopperUtils['checkIsBlackList'](_[_0x52f5('0x7f')](_0x55d178[0x0],['VoiceQueueId',_0x52f5('0x16c')]))[_0x52f5('0x43')](_0x3c4249[_0x52f5('0x1f1')](_0x2e2220,_0x55d178[0x0]))[_0x52f5('0xa8')](_0x3c4249[_0x52f5('0x161')](_0x52f5('0x217'),_0x2e2220));}}}})['catch'](loggerGetContactDialer(_0x52f5('0x218'),_0x2e2220,0x1));};Dialer[_0x52f5('0x1c')]['abandonmentRate']=function(_0x280ed3,_0x53bfbc,_0x3b4e03,_0xdbbc7f,_0x57188c,_0x2f4d79){loggerPredictive['info'](_0x52f5('0x219'));loggerPredictive[_0x52f5('0x52')](_0x52f5('0x21a'),_0x280ed3);loggerPredictive[_0x52f5('0x52')](_0x52f5('0x21b'),_0x53bfbc);loggerPredictive[_0x52f5('0x52')](_0x52f5('0x21c'),_0x3b4e03);loggerPredictive[_0x52f5('0x52')](_0x52f5('0x21d'),_0xdbbc7f);loggerPredictive['info'](_0x52f5('0x21e'),_0x57188c);loggerPredictive[_0x52f5('0x52')](_0x52f5('0x5d'));return new Promise(function(_0x3f9705,_0x2a033f){if(_0x280ed3<=0x0||isNaN(_0x280ed3)){return _0x2a033f(msgResponse('[abandonmentRate]',_0x52f5('0xc3'),_0x52f5('0x21f')+_0x280ed3));}if(_0x3b4e03<=0x0||isNaN(_0x3b4e03)){return _0x2a033f(msgResponse(_0x52f5('0x220'),'Error',_0x52f5('0x221')+_0x3b4e03));}if(_0xdbbc7f<=0x0||isNaN(_0xdbbc7f)){return _0x2a033f(msgResponse(_0x52f5('0x220'),_0x52f5('0xc3'),'p\x20=\x20'+_0xdbbc7f));}if(_0x53bfbc<=0x0||isNaN(_0x53bfbc)){return _0x2a033f(msgResponse('[abandonmentRate]',_0x52f5('0xc3'),_0x52f5('0x222')+_0x53bfbc));}if(_0x57188c<=0x0||isNaN(_0x57188c)){return _0x2a033f(msgResponse(_0x52f5('0x220'),_0x52f5('0xc3'),'Amax\x20=\x20'+_0x57188c));}_0x2f4d79=_0x2f4d79||0x0;var _0x1d7524=0x1/_0x3b4e03;var _0x4294e3=0x0;var _0x46a874=0x0;var _0x48fb37=0x0;var _0x5e6e26=0x0;for(var _0x10cf25=0x0;_0x48fb37<_0x57188c;_0x10cf25+=0x1){_0x46a874=_0x10cf25/_0x53bfbc;_0x4294e3=(_0xdbbc7f*_0x46a874+_0x2f4d79)/_0x1d7524;_0x48fb37=utils[_0x52f5('0x223')](_0x4294e3,_0x280ed3);_0x5e6e26=_0x4294e3/_0x280ed3*(0x1-utils[_0x52f5('0x223')](_0x4294e3,_0x280ed3));}return _0x3f9705({'erlangCalls':_0x10cf25,'erlangCallToSecond':_0x53bfbc/_0x10cf25,'erlangAbandonmentRate':_0x48fb37,'erlangBusyFactor':_0x5e6e26});});};Dialer['prototype']['busyFactor']=function(_0x105668,_0x31c306,_0x2e465f,_0x46be76,_0xe9f55e,_0x10d505){loggerPredictive[_0x52f5('0x52')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x52f5('0x52')](_0x52f5('0x21a'),_0x105668);loggerPredictive[_0x52f5('0x52')](_0x52f5('0x21b'),_0x31c306);loggerPredictive['info']('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2e465f);loggerPredictive['info']('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x46be76);loggerPredictive[_0x52f5('0x52')](_0x52f5('0x224'),_0xe9f55e);loggerPredictive[_0x52f5('0x52')](_0x52f5('0x5d'));return new Promise(function(_0x51c741,_0x568fe2){if(_0x105668<=0x0||isNaN(_0x105668)){return _0x568fe2(msgResponse(_0x52f5('0x225'),_0x52f5('0xc3'),_0x52f5('0x21f')+_0x105668));}if(_0x2e465f<=0x0||isNaN(_0x2e465f)){return _0x568fe2(msgResponse(_0x52f5('0x225'),'Error',_0x52f5('0x221')+_0x2e465f));}if(_0x46be76<=0x0||isNaN(_0x46be76)){return _0x568fe2(msgResponse(_0x52f5('0x225'),'Error','p\x20=\x20'+_0x46be76));}if(_0x31c306<=0x0||isNaN(_0x31c306)){return _0x568fe2(msgResponse(_0x52f5('0x225'),_0x52f5('0xc3'),_0x52f5('0x222')+_0x31c306));}if(_0xe9f55e<=0x0||isNaN(_0xe9f55e)){return _0x568fe2(msgResponse(_0x52f5('0x225'),_0x52f5('0xc3'),_0x52f5('0x226')+_0xe9f55e));}_0x10d505=_0x10d505||0x0;var _0x51095e=0x1/_0x2e465f;var _0x51ad43=0x0;var _0x2be284=0x0;var _0x13ac8c=0x0;var _0x5d9c79=0x0;for(var _0x536c25=0x0;_0x5d9c79<_0xe9f55e;_0x536c25+=0x1){_0x2be284=_0x536c25/_0x31c306;_0x51ad43=(_0x46be76*_0x2be284+_0x10d505)/_0x51095e;_0x13ac8c=utils[_0x52f5('0x223')](_0x51ad43,_0x105668);_0x5d9c79=_0x51ad43/_0x105668*(0x1-utils[_0x52f5('0x223')](_0x51ad43,_0x105668));}return _0x51c741({'erlangCalls':_0x536c25,'erlangCallToSecond':_0x31c306/_0x536c25,'erlangAbandonmentRate':_0x13ac8c,'erlangBusyFactor':_0x5d9c79});});};module[_0x52f5('0x227')]=Dialer; \ No newline at end of file +var _0xefb9=['membername','buildObj','saveInDb','[syncHangupInAMD]','value','Machine','AMD','amd','[syncAgentComplete][createHistory][0]','countnosuchnumberretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','createStateFinal','dialMachineRetryFrequency','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','custom:amd','countbusyretry','countcongestionretry','countnoanswerretry','reason19\x20machine....','reason\x2019\x20machine....','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','outboundUnknownCallsDay','cause-txt','Unknow','running','isPreviewCampaign','getQueueCampaignStatusMessage','statusMessage','available','inUse','talking','ACTIVE','checkDialMethod','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','assign','throttle','filter','handlePreviewRecallNotifications','map','Agent','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','[actions]','sequence','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','undefined','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','notFound','UserId','[emptyContact][createHistory]','user:%s','user:dialPreviewRecallReminder','actionOriginate','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','NONE','\x22agi://%s/square,%s\x22','isOutboundQueue','dialQueueOptions','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-CAMPAIGNID','Contact','Trunk','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','TrunkBackup','callerid','getCallerIdRandom','XMD-ORIGINATECALLERIDNAME','extractCalleridName','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','dialPrefix','dialCutDigit','substring','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','OriginateError','[originate][error]','Error','originate\x20action\x20Error','checkRetriveMax','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberRetryFrequency','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','object','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','dialNoAnswerRetryFrequency','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','dialBusyRetryFrequency','[syncAgentComplete][createHistory][5]','outboundCongestionCallsDay','Congestion','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','erlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','avgHandleTime','getDataPredictive','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','loggedIn','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','busyFactor','one\x20call\x20every:','milliseconds','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','voicePause','unlockContact','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','handleIvr','limitCalls','temp','getContactDialerIvr','checkContactEmpty','[actionOriginate]\x20','checkIsBlackListIvr','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','pTalking','not_inuse','countReScheduled','[countReScheduled]\x20','RUNNING','checkIsBlackList','[getContactDialer2]','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','util','lodash','moment','ioredis','./utils','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','../rpc/cmHopper','../rpc/setting','../rpc/interval','./models/history','./models/final','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','enqueue','tail','finally','preview','voiceQueues','campaigns','trunks','maxNumberOriginate','channels','actions','uniqueId','optionPredictive','startPredictive','startProgressive','queueBooked','queueBookedRR','queuesSummary','agentconnect','queuecallerabandon','syncQueueCallerAbandon','bind','originateresponse','agentcomplete','custom:queuesummarycomplete','syncQueueSummaryComplete','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','previewRecallmeReminderInterval','isUndefined','emit','outbound','debug','format','voice:queue:%s','name','voice_queue:save','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','erlangAbandonmentRate','---------------------------','merge','getSeconds','startProgressive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','checkContactLowerLimitOriginate','inspect','contactsRescheduled','CONTACTS_RESCHEDULED','contacts','CAMPAIGN_STATUS','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','pick','Interval','message','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','[ifTime][Action]','stringify','isTrunkReachable','active','status','reachable','SIP/%s','unmonitored','prototype','checkIsTrunkReachable','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','checkIfTimeIntervals','ifTimeIvr','ifTime','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','length','Action','command','iftime\x20%s,%s','interval','then','content','true','push','catch','all','some','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','isIVRCampaignActive','resolve','dialGlobalInterval','dialMethod','progressive','handlePower','dialPowerLevel','Queue','method\x20not\x20recognized','dialTimezone','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','OVERTIME_GLOBAL_INTERVAL','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','queue','uniqueid','type','ivr','updateOriginated','answertime','YYYY-MM-DD\x20HH:mm:ss','syncAgentComplete','outboundAnswerCallsDay','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','droptime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','statedesc','Drop','dropreason','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','state','additional','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','countdropretry','minutes','ContactId','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','endtime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','predictiveIntervalDroppedCallsCallersExit','Abandoned','CALLEREXIT','countabandonedretry','countglobal','dialAbandonedRetryFrequency','voiceQueue','dialAbandonedMaxRetry','add','[syncAgentComplete][createHistory][11]','channel','syncQueueMember','actionid','strategy','isNil','paused','agents','stateinterface','locked','rrmemory','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncOriginateResponse','responsetime','getQueue','response','Success','callProgressDetecting','[callProgressDetecting]\x20','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD'];(function(_0x218cec,_0x5797e0){var _0x1a1756=function(_0x1980e9){while(--_0x1980e9){_0x218cec['push'](_0x218cec['shift']());}};_0x1a1756(++_0x5797e0);}(_0xefb9,0x10a));var _0x9efb=function(_0x409251,_0x40f525){_0x409251=_0x409251-0x0;var _0x216f47=_0xefb9[_0x409251];return _0x216f47;};'use strict';var util=require(_0x9efb('0x0'));var _=require(_0x9efb('0x1'));var uuid=require('uuid');var moment=require(_0x9efb('0x2'));var rr=require('rr');var Redis=require(_0x9efb('0x3'));var utils=require(_0x9efb('0x4'));var hopperUtils=require(_0x9efb('0x5'));var ut=require(_0x9efb('0x6'));var config=require(_0x9efb('0x7'));var logger=require(_0x9efb('0x8'))(_0x9efb('0x9'));var loggerBooked=require(_0x9efb('0x8'))(_0x9efb('0xa'));var loggerPredictive=require(_0x9efb('0x8'))(_0x9efb('0xb'));var loggerPredictiveCalls=require('../../../config/logger')(_0x9efb('0xc'));var loggerSyncQueueSummary=require(_0x9efb('0x8'))(_0x9efb('0xd'));var ami=require(_0x9efb('0xe'));config[_0x9efb('0xf')]=_[_0x9efb('0x10')](config[_0x9efb('0xf')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9efb('0xf')]));var cmHopper=require(_0x9efb('0x11'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0x9efb('0x12'));var Interval=require(_0x9efb('0x13'));var Action=require('./models/action');var History=require(_0x9efb('0x14'));var Final=require(_0x9efb('0x15'));var AgentComplete=require(_0x9efb('0x16'));var QueueCallerAbandon=require(_0x9efb('0x17'));var Hangup=require(_0x9efb('0x18'));var ipAgi=process[_0x9efb('0x19')][_0x9efb('0x1a')]||_0x9efb('0x1b');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype'][_0x9efb('0x1c')]=function(_0x4a53f9){this[_0x9efb('0x1d')]=this['tail']?this[_0x9efb('0x1d')][_0x9efb('0x1e')](_0x4a53f9):_0x4a53f9();};function Dialer(_0x3b1ed3,_0xd5088f){this['sequence']=new Sequence();this[_0x9efb('0x1f')]=_0xd5088f;this['voiceQueues']=_0x3b1ed3[_0x9efb('0x20')];this[_0x9efb('0x21')]=_0x3b1ed3[_0x9efb('0x21')];this['agents']=_0x3b1ed3['agents'];this[_0x9efb('0x22')]=_0x3b1ed3[_0x9efb('0x22')];this[_0x9efb('0x23')]=config[_0x9efb('0x23')]||0x2;this[_0x9efb('0x24')]={};this[_0x9efb('0x25')]={};this['contactsId']={};this[_0x9efb('0x26')]={};this[_0x9efb('0x27')]={};this[_0x9efb('0x28')]={};this[_0x9efb('0x29')]={};this['ivrOriginated']={};this[_0x9efb('0x2a')]={};this[_0x9efb('0x2b')]={};this[_0x9efb('0x2c')]={};ami['on'](_0x9efb('0x2d'),this['syncAgentConnect']['bind'](this));ami['on'](_0x9efb('0x2e'),this[_0x9efb('0x2f')][_0x9efb('0x30')](this));ami['on'](_0x9efb('0x31'),this['syncOriginateResponse'][_0x9efb('0x30')](this));ami['on'](_0x9efb('0x32'),this['syncAgentComplete'][_0x9efb('0x30')](this));ami['on']('custom:queuesummary',this[_0x9efb('0xd')][_0x9efb('0x30')](this));ami['on'](_0x9efb('0x33'),this[_0x9efb('0x34')][_0x9efb('0x30')](this));ami['on']('hangup',this[_0x9efb('0x35')]['bind'](this));ami['on'](_0x9efb('0x36'),this[_0x9efb('0x37')][_0x9efb('0x30')](this));ami['on'](_0x9efb('0x38'),this[_0x9efb('0x39')][_0x9efb('0x30')](this));ami['on'](_0x9efb('0x3a'),this['syncQueueMember'][_0x9efb('0x30')](this));ami['on']('queuestatuscomplete',this[_0x9efb('0x3b')][_0x9efb('0x30')](this));this[_0x9efb('0x3c')]();this[_0x9efb('0x3d')]();RpcSetting[_0x9efb('0x3e')]()['then'](function(_0x593b88){previewRecallmeReminderInterval=_0x593b88[_0x9efb('0x3f')];});}function isNotNull(_0x4c5a10){return _0x4c5a10!==null&&!_[_0x9efb('0x40')](_0x4c5a10);}function msgResponse(_0x103553,_0x5210e9,_0x117bd6){return{'action':_0x103553,'response':_0x5210e9,'message':_0x117bd6,'stack':_0x117bd6};}function emit(_0x5893ab,_0x3ea9ca,_0x21eff5){io['to'](_0x5893ab)[_0x9efb('0x41')](_0x3ea9ca,_0x21eff5);}function emitOutboundVoiceQueueSummary(_0x2b9250){if(_0x2b9250['type']===_0x9efb('0x42')){logger[_0x9efb('0x43')]('[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:',util['inspect'](_0x2b9250,{'showHidden':![],'depth':null}));emit(util[_0x9efb('0x44')](_0x9efb('0x45'),_0x2b9250[_0x9efb('0x46')]),_0x9efb('0x47'),_0x2b9250);}}function checkGetDataPredictive(_0x40694a){if(isNotNull(_0x40694a)&&!_['isEmpty'](_0x40694a)){loggerPredictive[_0x9efb('0x48')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x9efb('0x48')](_0x9efb('0x49'),_0x40694a[_0x9efb('0x4a')]);loggerPredictive[_0x9efb('0x48')](_0x9efb('0x4b'),_0x40694a[_0x9efb('0x4c')]);loggerPredictive[_0x9efb('0x48')](_0x9efb('0x4d'),_0x40694a[_0x9efb('0x4e')]);loggerPredictive[_0x9efb('0x48')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x40694a['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive['info']('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x40694a['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x9efb('0x48')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x40694a['predictiveIntervalAvgTalktime']);loggerPredictive[_0x9efb('0x48')]('---------------------------');if(_0x40694a[_0x9efb('0x4a')]>0x0){if(!_[_0x9efb('0x40')](_0x40694a[_0x9efb('0x4f')])&&_0x40694a['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0x9efb('0x48')](_0x9efb('0x50'));if(!_[_0x9efb('0x40')](_0x40694a[_0x9efb('0x51')])&&_0x40694a[_0x9efb('0x51')]>0x0){return!![];}loggerPredictive[_0x9efb('0x48')](_0x9efb('0x52'));}else{loggerPredictive[_0x9efb('0x48')](_0x9efb('0x53'));}}else{loggerPredictive[_0x9efb('0x48')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x2669ce){return function(_0x5bec57){loggerPredictive[_0x9efb('0x48')](_0x9efb('0x54'));loggerPredictive['info'](_0x9efb('0x55'),_0x5bec57['erlangCalls']);loggerPredictive['info'](_0x9efb('0x56'),_0x5bec57[_0x9efb('0x57')]);loggerPredictive[_0x9efb('0x48')](_0x9efb('0x58'),_0x5bec57['erlangAbandonmentRate']);loggerPredictive[_0x9efb('0x48')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5bec57[_0x9efb('0x59')]);loggerPredictive[_0x9efb('0x48')](_0x9efb('0x58'),_0x5bec57[_0x9efb('0x5a')]);loggerPredictive['info'](_0x9efb('0x5b'));_[_0x9efb('0x5c')](_0x2669ce,_0x5bec57);};}function ifInterval(_0x41e326,_0x3d39b2){if(_[_0x9efb('0x40')](_0x3d39b2)){return![];}return utils[_0x9efb('0x5d')](undefined,_0x3d39b2)<_0x41e326*0x3c;}function clearPredictiveAttributes(_0x226572){if(_0x226572[_0x9efb('0x29')]){_0x226572[_0x9efb('0x29')]=undefined;loggerPredictive[_0x9efb('0x43')](_0x226572[_0x9efb('0x46')],_0x9efb('0x5e'));}if(_0x226572[_0x9efb('0x28')]){_0x226572['startPredictive']=undefined;loggerPredictive['debug'](_0x226572[_0x9efb('0x46')],'startPredictive\x20value\x20cleared');}if(_0x226572[_0x9efb('0x5f')]){clearInterval(_0x226572[_0x9efb('0x5f')]);_0x226572[_0x9efb('0x5f')]=undefined;loggerPredictive[_0x9efb('0x43')](_0x226572[_0x9efb('0x46')],_0x9efb('0x60'));}}function loggerCatchPredictive(_0x23e0d3,_0xd89a47){return function(_0x26cdc6){loggerPredictive['error'](_0xd89a47[_0x9efb('0x46')],_0x23e0d3);loggerPredictive[_0x9efb('0x61')](_0x26cdc6['stack']);clearPredictiveAttributes(_0xd89a47);};}function loggerCatch(_0x151a7e){return function(_0x1eb031){logger[_0x9efb('0x61')](_0x151a7e,util['inspect'](_0x1eb031,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x37817b,_0x346baf,_0xe2288b){return function(_0x2b480f){utils[_0x9efb('0x62')](_0x346baf,_0xe2288b,0x0);_0x346baf['temp']=0x0;logger[_0x9efb('0x61')](_0x37817b,util[_0x9efb('0x63')](_0x2b480f,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x32a477){return function(_0x53a224){if(isNotNull(_0x53a224)&&isNotNull(_0x53a224[0x0])){if(_0x53a224[0x0][_0x9efb('0x64')]>0x0){_0x32a477['message']=utils['CAMPAIGN_STATUS'][_0x9efb('0x65')];logger['info']('[getContactDialer2][ReScheduled]'+_0x32a477[_0x9efb('0x46')],_0x53a224[0x0]['contactsRescheduled'],_0x9efb('0x66'));}else{_0x32a477['message']=utils[_0x9efb('0x67')][_0x9efb('0x68')];logger[_0x9efb('0x48')](_0x9efb('0x69')+_0x32a477[_0x9efb('0x46')]);}}};}function createObjHistory(_0x5c3aac,_0x4607b2,_0x218434,_0x1c5e22,_0x40f081){_0x5c3aac['message']=_0x218434;var _0x15c936=new Action(_0x5c3aac,_0x4607b2);var _0x1184d3=new History(_0x15c936);_0x1184d3['state']=_0x1c5e22;_0x1184d3['statedesc']=_0x40f081;_0x1184d3['endtime']=_0x15c936[_0x9efb('0x6a')];return _0x1184d3;}function unlockQueueStatus(_0x3f88f0,_0x1985e1){setTimeout(function(){if(_['isUndefined'](_0x3f88f0[_0x9efb('0x6b')])){loggerBooked[_0x9efb('0x61')](_0x9efb('0x6c'),_0x1985e1);}_0x3f88f0['queueStatusComplete']=!![];loggerBooked[_0x9efb('0x48')]('[booked][unlockQueueStatus]',_0x1985e1,JSON['stringify'](_[_0x9efb('0x6d')](_0x3f88f0,[_0x9efb('0x46'),_0x9efb('0x6b')])));},0x1f3);}function checkInterval(_0x2666dc){return function(){if(!isNotNull(_0x2666dc[_0x9efb('0x6e')])){_0x2666dc[_0x9efb('0x6f')]=utils[_0x9efb('0x67')][_0x9efb('0x70')];throw _0x2666dc[_0x9efb('0x46')]+_0x9efb('0x71');}if(!isNotNull(_0x2666dc[_0x9efb('0x6e')][_0x9efb('0x72')])){_0x2666dc[_0x9efb('0x6f')]=utils[_0x9efb('0x67')][_0x9efb('0x70')];throw _0x2666dc[_0x9efb('0x46')]+_0x9efb('0x71');}if(!isNotNull(_[_0x9efb('0x73')](_0x2666dc[_0x9efb('0x6e')][_0x9efb('0x72')]))){_0x2666dc[_0x9efb('0x6f')]=utils[_0x9efb('0x67')][_0x9efb('0x70')];throw _0x2666dc[_0x9efb('0x46')]+_0x9efb('0x71');}};}function checkIsIVRCampaignActive(_0x56b143){return function(){if(!utils['isIVRCampaignActive'](_0x56b143)){_0x56b143[_0x9efb('0x6f')]=utils[_0x9efb('0x67')][_0x9efb('0x74')];throw _0x56b143[_0x9efb('0x46')]+_0x9efb('0x75');}};}function emitCampaignSummary(_0x4ba4be){if(utils[_0x9efb('0x76')](_0x4ba4be)){emit(util[_0x9efb('0x44')](_0x9efb('0x77'),_0x4ba4be[_0x9efb('0x46')]),_0x9efb('0x78'),_0x4ba4be);}}function loggerCatchQueueSummary(_0x42811b,_0x590224){return function(_0x32fafb){clearPredictiveAttributes(_0x590224);emitCampaignSummary(_0x590224);loggerSyncQueueSummary[_0x9efb('0x43')](_0x42811b,util['inspect'](_0x32fafb,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x17ccd1){if(_0x17ccd1[_0x9efb('0x79')]){if(_0x17ccd1[_0x9efb('0x7a')]===0x0){_0x17ccd1[_0x9efb('0x79')]=![];_0x17ccd1[_0x9efb('0x6f')]=utils[_0x9efb('0x67')][_0x9efb('0x74')];loggerSyncQueueSummary[_0x9efb('0x43')](_0x9efb('0x7b'),_0x17ccd1[_0x9efb('0x46')],_0x9efb('0x7c'));}else{_0x17ccd1[_0x9efb('0x6f')]=utils[_0x9efb('0x67')]['DISACTIVED'];loggerSyncQueueSummary[_0x9efb('0x43')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x17ccd1[_0x9efb('0x46')],'is\x20disactive');}emitCampaignSummary(_0x17ccd1);}}function myreject(_0x2a131a){return function(_0xec13b9){return _0x2a131a(msgResponse(_0x9efb('0x7d'),'Error',JSON[_0x9efb('0x7e')](_0xec13b9)));};}Dialer['prototype'][_0x9efb('0x7f')]=function(_0x5c9b92){return!_[_0x9efb('0x40')](_0x5c9b92)&&_0x5c9b92&&!_[_0x9efb('0x40')](_0x5c9b92[_0x9efb('0x46')])&&!_[_0x9efb('0x40')](_0x5c9b92['active'])&&_0x5c9b92[_0x9efb('0x80')]&&(this[_0x9efb('0x22')][util[_0x9efb('0x44')]('SIP/%s',_0x5c9b92[_0x9efb('0x46')])][_0x9efb('0x81')]===_0x9efb('0x82')||this['trunks'][util['format'](_0x9efb('0x83'),_0x5c9b92['name'])][_0x9efb('0x81')]===_0x9efb('0x84'));};Dialer[_0x9efb('0x85')][_0x9efb('0x86')]=function(_0x4cd8da){var _0x478818=this;return function(){if(!_0x478818[_0x9efb('0x7f')](_0x4cd8da['Trunk'])){if(!_0x478818[_0x9efb('0x7f')](_0x4cd8da['TrunkBackup'])){_0x4cd8da['message']=utils['CAMPAIGN_STATUS'][_0x9efb('0x87')];throw _0x4cd8da[_0x9efb('0x46')]+_0x9efb('0x88');}}};};Dialer[_0x9efb('0x85')][_0x9efb('0x89')]=function(_0x1c76ee,_0x3e8d97,_0x3e8b5b,_0x406735){var _0x272c42=this;return function(){var _0x73c556=!![];return _0x272c42['ifTimeIvr'](_0x1c76ee,_0x3e8d97,_0x3e8b5b,_0x406735,_0x73c556);};};Dialer[_0x9efb('0x85')][_0x9efb('0x8a')]=function(_0x40b22b,_0x51984e,_0x499a03,_0xf2cb26){var _0x573554=this;return function(){var _0xb5d908=![];return _0x573554[_0x9efb('0x8b')](_0x40b22b[_0x9efb('0x72')],_0x51984e,_0x499a03,_0xf2cb26,_0xb5d908);};};Dialer[_0x9efb('0x85')][_0x9efb('0x8b')]=function(_0x4bcdaf,_0x300dc8,_0x315dae,_0x2283e4,_0x413523){var _0x3270f6=[];return new Promise(function(_0x410ef9,_0x335dc1){if(!isNotNull(_0x4bcdaf)){_0x2283e4[_0x9efb('0x6f')]=utils[_0x9efb('0x67')][_0x9efb('0x70')];return _0x335dc1(msgResponse(_0x9efb('0x8c'),_0x9efb('0x8d'),_0x315dae+_0x9efb('0x8e')));}if(_[_0x9efb('0x73')](_0x4bcdaf)){_0x2283e4['message']=utils['CAMPAIGN_STATUS'][_0x9efb('0x8f')];return _0x335dc1(msgResponse(_0x9efb('0x8c'),_0x9efb('0x8d'),_0x315dae+_0x9efb('0x90')));}if(_0x300dc8&&_[_0x9efb('0x40')](config[_0x9efb('0x91')][_0x300dc8])){_0x2283e4[_0x9efb('0x6f')]=utils[_0x9efb('0x67')][_0x9efb('0x92')];return _0x335dc1(msgResponse(_0x9efb('0x8c'),'Failure',_0x315dae+_0x9efb('0x93')+_0x300dc8));}if(_[_0x9efb('0x94')](_0x4bcdaf)){for(var _0x3e3627=0x0;_0x3e3627<_0x4bcdaf[_0x9efb('0x95')];_0x3e3627+=0x1){_0x3270f6['push'](ami[_0x9efb('0x96')]({'action':_0x9efb('0x97'),'command':util[_0x9efb('0x44')](_0x9efb('0x98'),_0x4bcdaf[_0x3e3627][_0x9efb('0x99')],!_['isUndefined'](config[_0x9efb('0x91')][_0x300dc8])?_0x300dc8:'')})[_0x9efb('0x9a')](function(_0x4aa4e7){return _0x4aa4e7[_0x9efb('0x9b')]['indexOf'](_0x9efb('0x9c'))>=0x0;})['catch'](myreject(_0x335dc1)));}}else{_0x3270f6[_0x9efb('0x9d')](ami['Action']({'action':_0x9efb('0x97'),'command':util[_0x9efb('0x44')](_0x9efb('0x98'),_0x4bcdaf,!_[_0x9efb('0x40')](config['timezones'][_0x300dc8])?_0x300dc8:'')})[_0x9efb('0x9a')](function(_0x5c21eb){return _0x5c21eb[_0x9efb('0x9b')]['indexOf']('true')>=0x0;})[_0x9efb('0x9e')](myreject(_0x335dc1)));}Promise[_0x9efb('0x9f')](_0x3270f6)[_0x9efb('0x9a')](function(_0xa84ba6){var _0x5bfc0d=_[_0x9efb('0xa0')](_0xa84ba6);if(_0x5bfc0d){return _0x410ef9(_0x5bfc0d);}else{_0x2283e4['message']=_0x413523?utils[_0x9efb('0x67')]['OVERTIME_GLOBAL_INTERVAL']:utils[_0x9efb('0x67')][_0x9efb('0xa1')];return _0x335dc1(msgResponse(_0x9efb('0xa2'),_0x9efb('0x8d'),_0x9efb('0xa3')+_0x413523+'\x20'+_0x315dae+_0x9efb('0xa4')+util[_0x9efb('0x63')](_0x4bcdaf,{'showHidden':![],'depth':null})+_0x9efb('0xa5')+_0x300dc8));}})['catch'](function(_0x5768f5){return _0x335dc1(msgResponse('ifTime',_0x9efb('0x8d'),JSON[_0x9efb('0x7e')](_0x5768f5)));});});};Dialer[_0x9efb('0x85')][_0x9efb('0x3c')]=function(){var _0x29c56d=this;return cmHopper[_0x9efb('0xa6')]({'active':![]},{'where':{'active':!![]}})[_0x9efb('0x9a')](function(){setInterval(function(){_0x29c56d[_0x9efb('0xa7')]();},0x3e8);});};Dialer[_0x9efb('0x85')][_0x9efb('0xa7')]=function(){var _0x116db4=this;var _0x231939;for(var _0x5b6ecc in this[_0x9efb('0x21')]){if(typeof this['campaigns'][_0x5b6ecc]!=='undefined'){_0x231939=this[_0x9efb('0x21')][_0x5b6ecc];if(utils[_0x9efb('0x76')](_0x231939)&&utils[_0x9efb('0xa8')](_0x231939)){_0x231939[_0x9efb('0x79')]=!![];Promise[_0x9efb('0xa9')]()['then'](checkIsIVRCampaignActive(_0x231939))[_0x9efb('0x9a')](checkInterval(_0x231939))[_0x9efb('0x9a')](_0x116db4[_0x9efb('0x86')](_0x231939))['then'](_0x116db4[_0x9efb('0x89')](_0x231939[_0x9efb('0xaa')],_0x231939['dialTimezone'],_0x231939['name'],_0x231939))[_0x9efb('0x9a')](_0x116db4['checkIfTimeIntervals'](_0x231939[_0x9efb('0x6e')],_0x231939['dialTimezone'],_0x231939[_0x9efb('0x46')],_0x231939))[_0x9efb('0x9a')](_0x116db4['launchHandleIvr'](_0x231939))[_0x9efb('0x9e')](loggerCatchQueueSummary('[syncCampaigns]',_0x231939));}else{notSendMessagesCampaign(_0x231939);}}}};Dialer['prototype']['checkDialMethod']=function(_0x149f13){if(_0x149f13[_0x9efb('0xab')]!==_0x9efb('0xb')){clearPredictiveAttributes(_0x149f13);}switch(_0x149f13['dialMethod']){case _0x9efb('0xac'):this['handlePower'](_0x149f13,0x1);break;case'power':this[_0x9efb('0xad')](_0x149f13,_0x149f13[_0x9efb('0xae')]);break;case _0x9efb('0xb'):this[_0x9efb('0xb')](_0x149f13);break;case _0x9efb('0xa'):this[_0x9efb('0xad')](_0x149f13,0x1);break;default:logger['error'](_0x9efb('0xaf'),_0x149f13['name'],_0x9efb('0xb0'));}};Dialer[_0x9efb('0x85')][_0x9efb('0x8c')]=function(_0x41e5a0,_0x5c701a){var _0x1919f0=_0x41e5a0[_0x9efb('0xb1')];var _0xe1a7ce=_0x5c701a?_0x41e5a0['dialGlobalInterval']:_0x41e5a0[_0x9efb('0x6e')][_0x9efb('0x72')];logger[_0x9efb('0xb2')](_0x9efb('0xb3'),_0xe1a7ce,_0x1919f0,_0x41e5a0[_0x9efb('0x46')],util[_0x9efb('0x44')](_0x9efb('0xb4'),_0x41e5a0['name'],_0x41e5a0['id']));var _0x242d69=null;return Interval[_0x9efb('0xb5')](_0xe1a7ce,_0x1919f0)[_0x9efb('0x9a')](function(_0x48d430){if(_0x48d430===!![]){return _0x48d430;}else{_0x41e5a0['message']=_0x5c701a?utils['CAMPAIGN_STATUS'][_0x9efb('0xb6')]:utils[_0x9efb('0x67')][_0x9efb('0xa1')];_0x242d69=msgResponse(_0x9efb('0xa2'),_0x9efb('0x8d'),_0x9efb('0xa3')+_0x5c701a+'\x20'+_0x41e5a0[_0x9efb('0x46')]+_0x9efb('0xa4')+util[_0x9efb('0x63')](_0xe1a7ce,{'showHidden':![],'depth':null})+_0x9efb('0xa5')+_0x1919f0);}if(_0x242d69!==null){logger[_0x9efb('0xb2')](_0x9efb('0xb7'),_0x242d69);_0x242d69[_0x9efb('0xb8')]=_0x5c701a;throw _0x242d69;}})[_0x9efb('0x9e')](function(_0x32d19d){logger['error']('AMI\x20IfTime',_0x32d19d);throw msgResponse(_0x9efb('0x7d'),'Error',util['inspect'](_0x32d19d,{'showHidden':![],'depth':null}));});};Dialer[_0x9efb('0x85')]['syncAgentConnect']=function(_0x391829){if(this[_0x9efb('0x20')][_0x391829[_0x9efb('0xb9')]]){if(this[_0x9efb('0x26')][_0x391829[_0x9efb('0xba')]]&&this[_0x9efb('0x26')][_0x391829[_0x9efb('0xba')]][_0x9efb('0xbb')]!==_0x9efb('0xbc')){this[_0x9efb('0xbd')](this[_0x9efb('0x20')][_0x391829[_0x9efb('0xb9')]]);this[_0x9efb('0x26')][_0x391829['uniqueid']][_0x9efb('0xbe')]=moment()[_0x9efb('0x44')](_0x9efb('0xbf'));}}};Dialer[_0x9efb('0x85')][_0x9efb('0xc0')]=function(_0xf283aa){var _0x481627=this[_0x9efb('0x26')][_0xf283aa[_0x9efb('0xba')]];if(this['voiceQueues'][_0xf283aa[_0x9efb('0xb9')]]){if(_0x481627&&_0x481627[_0x9efb('0xbb')]!==_0x9efb('0xbc')){delete this[_0x9efb('0x26')][_0xf283aa[_0x9efb('0xba')]];this[_0x9efb('0x20')][_0xf283aa['queue']][_0x9efb('0xc1')]+=0x1;var _0x392723=new AgentComplete(_0x481627,_0xf283aa);if(_0xf283aa[_0x9efb('0xc2')]===_0x9efb('0xc3')){_0x392723[_0x9efb('0xc4')]=this[_0x9efb('0x20')][_0xf283aa[_0x9efb('0xb9')]][_0x9efb('0xc5')]&&this[_0x9efb('0x20')][_0xf283aa[_0x9efb('0xb9')]][_0x9efb('0xc6')]?moment()[_0x9efb('0x44')](_0x9efb('0xbf')):undefined;}hopperUtils[_0x9efb('0xc7')](_0x392723)['catch'](loggerCatch(_0x9efb('0xc8')));hopperUtils[_0x9efb('0xc9')](_0x392723)['catch'](loggerCatch(_0x9efb('0xca')));}}};Dialer['prototype'][_0x9efb('0x2f')]=function(_0x1540f5){var _0x46d038=this['uniqueId'][_0x1540f5[_0x9efb('0xba')]];var _0x14af56=this;var _0x472a48=![];var _0x38f1a0;var _0x2359ce;if(this[_0x9efb('0x20')][_0x1540f5[_0x9efb('0xb9')]]){if(_0x46d038&&_0x46d038['type']!=='ivr'){delete this[_0x9efb('0x26')][_0x1540f5[_0x9efb('0xba')]];this[_0x9efb('0xbd')](this[_0x9efb('0x20')][_0x1540f5['queue']]);_0x46d038[_0x9efb('0xcb')]=moment()['format'](_0x9efb('0xbf'));var _0x566831=new QueueCallerAbandon(_0x46d038,_0x1540f5);if(utils['getSeconds'](_0x46d038[_0x9efb('0xcb')],_0x46d038['responsetime'])>=_0x46d038[_0x9efb('0xcc')]){this[_0x9efb('0x20')][_0x1540f5[_0x9efb('0xb9')]][_0x9efb('0x4e')]+=0x1;this[_0x9efb('0x20')][_0x1540f5[_0x9efb('0xb9')]][_0x9efb('0xcd')]+=0x1;this[_0x9efb('0x20')][_0x1540f5[_0x9efb('0xb9')]][_0x9efb('0xce')]+=0x1;_0x566831['state']=0xa;_0x566831[_0x9efb('0xcf')]=_0x9efb('0xd0');_0x566831[_0x9efb('0xd1')]='TIMEOUT';_0x566831[_0x9efb('0xc4')]=this[_0x9efb('0x20')][_0x1540f5[_0x9efb('0xb9')]][_0x9efb('0xc5')]?moment()[_0x9efb('0x44')](_0x9efb('0xbf')):undefined;_0x566831['countdropretry']+=0x1;_0x566831['countglobal']+=0x1;_0x38f1a0=this[_0x9efb('0x20')][_0x1540f5['queue']][_0x9efb('0xd2')];_0x2359ce=this[_0x9efb('0x20')][_0x1540f5[_0x9efb('0xb9')]][_0x9efb('0xd3')];hopperUtils[_0x9efb('0xd4')](_0x566831,_0x566831[_0x9efb('0xd5')],_0x46d038['voiceQueue'])['then'](function(_0x541ed8){_0x472a48=_0x541ed8[_0x9efb('0xd6')]==0x1;if(_0x566831['countdropretry']>=_0x14af56[_0x9efb('0x20')][_0x1540f5[_0x9efb('0xb9')]][_0x9efb('0xd7')]){_0x14af56[_0x9efb('0xd8')](_0x566831,_0x541ed8[_0x9efb('0xd6')]);}else{hopperUtils[_0x9efb('0xd9')]({'active':![],'countdropretry':_0x566831[_0x9efb('0xda')],'scheduledat':moment()['add'](_0x14af56['voiceQueues'][_0x1540f5[_0x9efb('0xb9')]][_0x9efb('0xd2')],_0x9efb('0xdb'))[_0x9efb('0x44')](_0x9efb('0xbf')),'ContactId':_0x46d038[_0x9efb('0xdc')],'ListId':_0x46d038[_0x9efb('0xdd')],'VoiceQueueId':_0x46d038[_0x9efb('0xde')]||undefined,'CampaignId':_0x46d038[_0x9efb('0xdf')]||undefined})['catch'](loggerCatch(_0x9efb('0xe0')));var _0x171b52=new History(_0x566831);_0x171b52[_0x9efb('0xd5')]=0xa;_0x171b52[_0x9efb('0xcf')]=_0x9efb('0xd0');_0x171b52[_0x9efb('0x6a')]=moment()[_0x9efb('0x44')](_0x9efb('0xbf'));_0x171b52[_0x9efb('0xe1')]=_0x171b52[_0x9efb('0x6a')];_0x171b52[_0x9efb('0xe2')]=_0x566831[_0x9efb('0xe2')];_0x171b52['calleridnum']=_0x566831[_0x9efb('0xe3')];hopperUtils[_0x9efb('0xc7')](_0x171b52)[_0x9efb('0x9e')](loggerCatch(_0x9efb('0xe4')));}})[_0x9efb('0x9a')](function(){if(_0x472a48)hopperUtils[_0x9efb('0xe5')](_0x566831,_0x38f1a0,_0x2359ce)['then'](function(){return 0x1;});});}else{this['voiceQueues'][_0x1540f5['queue']][_0x9efb('0xe6')]+=0x1;this[_0x9efb('0x20')][_0x1540f5[_0x9efb('0xb9')]]['outboundDropCallsDayCallersExit']+=0x1;_0x566831[_0x9efb('0xd5')]=0xb;_0x566831[_0x9efb('0xcf')]=_0x9efb('0xe7');_0x566831[_0x9efb('0xd1')]=_0x9efb('0xe8');_0x566831[_0x9efb('0xe9')]+=0x1;_0x566831[_0x9efb('0xea')]+=0x1;_0x38f1a0=this[_0x9efb('0x20')][_0x1540f5['queue']][_0x9efb('0xeb')];_0x2359ce=this['voiceQueues'][_0x1540f5[_0x9efb('0xb9')]]['callAdditionalPhoneAfterMin'];hopperUtils[_0x9efb('0xd4')](_0x566831,_0x566831['state'],_0x46d038[_0x9efb('0xec')])[_0x9efb('0x9a')](function(_0x502786){if(_0x566831['countabandonedretry']>=_0x14af56['voiceQueues'][_0x1540f5[_0x9efb('0xb9')]][_0x9efb('0xed')]){_0x14af56[_0x9efb('0xd8')](_0x566831,_0x502786['additional']);}else{hopperUtils[_0x9efb('0xd9')]({'active':![],'countabandonedretry':_0x566831[_0x9efb('0xe9')],'scheduledat':moment()[_0x9efb('0xee')](_0x14af56[_0x9efb('0x20')][_0x1540f5[_0x9efb('0xb9')]][_0x9efb('0xeb')],_0x9efb('0xdb'))[_0x9efb('0x44')](_0x9efb('0xbf')),'ContactId':_0x46d038[_0x9efb('0xdc')],'ListId':_0x46d038[_0x9efb('0xdd')],'VoiceQueueId':_0x46d038[_0x9efb('0xde')]||undefined,'CampaignId':_0x46d038['CampaignId']||undefined})[_0x9efb('0x9e')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x44c300=new History(_0x566831);_0x44c300['state']=0xb;_0x44c300['statedesc']=_0x9efb('0xe7');_0x44c300['starttime']=moment()['format'](_0x9efb('0xbf'));_0x44c300[_0x9efb('0xe1')]=_0x44c300[_0x9efb('0x6a')];_0x44c300[_0x9efb('0xe2')]=_0x566831[_0x9efb('0xe2')];_0x44c300['calleridnum']=_0x566831['calleridnum'];hopperUtils[_0x9efb('0xc7')](_0x44c300)[_0x9efb('0x9e')](loggerCatch(_0x9efb('0xef')));}})['then'](function(){if(_0x472a48)hopperUtils['swapAdditionalPhones'](_0x566831,_0x38f1a0,_0x2359ce)[_0x9efb('0x9a')](function(){return 0x1;});});}}}};Dialer[_0x9efb('0x85')][_0x9efb('0x37')]=function(_0x5b4512){if(this['actions'][_0x5b4512[_0x9efb('0xba')]]){this['actions'][_0x5b4512[_0x9efb('0xba')]][_0x9efb('0xf0')]=_0x5b4512[_0x9efb('0xf0')];}if(this[_0x9efb('0x26')][_0x5b4512[_0x9efb('0xba')]]){this[_0x9efb('0x26')][_0x5b4512[_0x9efb('0xba')]][_0x9efb('0xf0')]=_0x5b4512[_0x9efb('0xf0')];}};Dialer[_0x9efb('0x85')][_0x9efb('0xf1')]=function(_0x394d66){if(!this[_0x9efb('0x25')][_0x394d66['actionid']]){return;}var _0x31c4d0=this['voiceQueues'][this['actions'][_0x394d66[_0x9efb('0xf2')]][_0x9efb('0xb9')]][_0x9efb('0xf3')]||'rrmemory';if(_0x31c4d0==='roundrobin'){if(this[_0x9efb('0x25')][_0x394d66[_0x9efb('0xf2')]]&&_[_0x9efb('0xf4')](this[_0x9efb('0x25')][_0x394d66[_0x9efb('0xf2')]]['locked'])&&_0x394d66[_0x9efb('0x81')]==='1'&&_0x394d66[_0x9efb('0xf5')]==='0'){if(this[_0x9efb('0xf6')][_0x394d66[_0x9efb('0xf7')]]){if(!this[_0x9efb('0xf6')][_0x394d66[_0x9efb('0xf7')]][_0x9efb('0xf8')]){this[_0x9efb('0xf6')][_0x394d66[_0x9efb('0xf7')]]['locked']=!![];this[_0x9efb('0x25')][_0x394d66[_0x9efb('0xf2')]]['locked']=!![];this[_0x9efb('0x25')][_0x394d66[_0x9efb('0xf2')]][_0x9efb('0xf7')]=_0x394d66['stateinterface'];}}}}else if(_0x31c4d0===_0x9efb('0xf9')){if(this['actions'][_0x394d66[_0x9efb('0xf2')]]){if(this[_0x9efb('0xf6')][_0x394d66['stateinterface']]){this[_0x9efb('0x25')][_0x394d66['actionid']][_0x9efb('0xf7')]=_0x394d66[_0x9efb('0xf7')];if(_['isNil'](this[_0x9efb('0x2a')][this['actions'][_0x394d66[_0x9efb('0xf2')]][_0x9efb('0xb9')]])){this[_0x9efb('0x2a')][this[_0x9efb('0x25')][_0x394d66['actionid']][_0x9efb('0xb9')]]=[];}this[_0x9efb('0x2a')][this[_0x9efb('0x25')][_0x394d66['actionid']][_0x9efb('0xb9')]][_0x9efb('0x9d')](_[_0x9efb('0x5c')](_[_0x9efb('0x6d')](this['actions'][_0x394d66['actionid']],['idHopper',_0x9efb('0xf7')]),{'status':_0x394d66[_0x9efb('0x81')],'paused':_0x394d66[_0x9efb('0xf5')]}));}}}};Dialer['prototype'][_0x9efb('0x3b')]=function(_0x2c9ccd){if(!this[_0x9efb('0x25')][_0x2c9ccd[_0x9efb('0xf2')]]){return;}var _0x553ade=this;var _0x493902=this[_0x9efb('0x20')][this[_0x9efb('0x25')][_0x2c9ccd[_0x9efb('0xf2')]]['queue']];var _0x442b4b=_0x493902[_0x9efb('0xf3')]||_0x9efb('0xf9');if(_0x442b4b==='roundrobin'){if(this[_0x9efb('0x25')][_0x2c9ccd[_0x9efb('0xf2')]]&&this[_0x9efb('0x25')][_0x2c9ccd['actionid']]['stateinterface']){this[_0x9efb('0x1f')][_0x9efb('0xfa')](this['actions'][_0x2c9ccd[_0x9efb('0xf2')]][_0x9efb('0xfb')],this[_0x9efb('0x25')][_0x2c9ccd[_0x9efb('0xf2')]][_0x9efb('0xf7')])['catch'](function(_0x471c45){logger['error'](_0x9efb('0xfc'),util[_0x9efb('0x63')](_0x471c45,{'showHidden':![],'depth':null}));})['finally'](function(){_0x553ade[_0x9efb('0xbd')](_0x553ade[_0x9efb('0x20')][_0x553ade['actions'][_0x2c9ccd[_0x9efb('0xf2')]]['queue']]);_0x553ade[_0x9efb('0xf6')][_0x553ade[_0x9efb('0x25')][_0x2c9ccd[_0x9efb('0xf2')]][_0x9efb('0xf7')]]['locked']=![];delete _0x553ade[_0x9efb('0x25')][_0x2c9ccd['actionid']];unlockQueueStatus(_0x493902);});}else{this['updateOriginated'](this[_0x9efb('0x20')][this[_0x9efb('0x25')][_0x2c9ccd[_0x9efb('0xf2')]][_0x9efb('0xb9')]]);hopperUtils[_0x9efb('0xd9')]({'active':![],'ContactId':this['actions'][_0x2c9ccd[_0x9efb('0xf2')]][_0x9efb('0xdc')],'ListId':this['actions'][_0x2c9ccd[_0x9efb('0xf2')]][_0x9efb('0xdd')],'VoiceQueueId':this['actions'][_0x2c9ccd[_0x9efb('0xf2')]][_0x9efb('0xde')]||undefined,'CampaignId':this['actions'][_0x2c9ccd[_0x9efb('0xf2')]][_0x9efb('0xdf')]||undefined})[_0x9efb('0x9e')](loggerCatch(_0x9efb('0xfd')));delete this[_0x9efb('0x25')][_0x2c9ccd[_0x9efb('0xf2')]];unlockQueueStatus(_0x493902);}}else if(_0x442b4b==='rrmemory'){var _0x24b94d;if(this[_0x9efb('0x25')][_0x2c9ccd[_0x9efb('0xf2')]]&&!_[_0x9efb('0x73')](this[_0x9efb('0x2a')][this[_0x9efb('0x25')][_0x2c9ccd[_0x9efb('0xf2')]]['queue']])){if(this[_0x9efb('0x2b')][_0x553ade[_0x9efb('0x25')][_0x2c9ccd[_0x9efb('0xf2')]]['queue']]){this[_0x9efb('0x2b')][_0x553ade[_0x9efb('0x25')][_0x2c9ccd[_0x9efb('0xf2')]][_0x9efb('0xb9')]]=this['queueBookedRR'][this[_0x9efb('0x25')][_0x2c9ccd[_0x9efb('0xf2')]][_0x9efb('0xb9')]]?this[_0x9efb('0x2b')][this[_0x9efb('0x25')][_0x2c9ccd['actionid']][_0x9efb('0xb9')]]:this['queueBooked'][this[_0x9efb('0x25')][_0x2c9ccd['actionid']]['queue']]?this['queueBooked'][this[_0x9efb('0x25')][_0x2c9ccd[_0x9efb('0xf2')]]['queue']][_0x9efb('0xfe')]||0x0:0x0;}this[_0x9efb('0x2a')][this[_0x9efb('0x25')][_0x2c9ccd[_0x9efb('0xf2')]][_0x9efb('0xb9')]][_0x9efb('0xfe')]=this['queueBookedRR'][this['actions'][_0x2c9ccd['actionid']][_0x9efb('0xb9')]];for(var _0xcd95bd=0x0;_0xcd95bd=_0x46b413[_0x9efb('0x124')]){_0x1eab98[_0x9efb('0x125')](_0x12b99f,_0x1d0d27,_0x48981b,'reason19\x20machine....');}else{if(_0x12b99f[_0x9efb('0x122')]>=_0x46b413[_0x9efb('0x126')]){_0x1eab98[_0x9efb('0x127')](_0x12b99f,_0x1d0d27,_0x48981b,'reason\x2019\x20machine....');}else{hopperUtils[_0x9efb('0xd9')]({'active':![],'countmachineretry':_0x12b99f['countmachineretry'],'scheduledat':moment()[_0x9efb('0xee')](_0x46b413[_0x9efb('0x128')],'minutes')[_0x9efb('0x44')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x12b99f[_0x9efb('0xdc')],'ListId':_0x12b99f['ListId'],'VoiceQueueId':_0x12b99f[_0x9efb('0xde')]||undefined,'CampaignId':_0x12b99f[_0x9efb('0xdf')]||undefined})['catch'](loggerCatch(_0x9efb('0x129')));_0x1d0d27({'reschedule':0x1});}}});}if(_0x5eae9b[_0x9efb('0xbb')]==='ivr'&&this[_0x9efb('0x21')][_0x5eae9b[_0x9efb('0xb9')]][_0x9efb('0x114')]&&_0x40e0cd[_0x9efb('0x11c')]===_0x9efb('0x115')){delete this['uniqueId'][_0x40e0cd[_0x9efb('0xba')]];this['updateOriginated'](this[_0x9efb('0x21')][_0x5eae9b[_0x9efb('0xb9')]]);_0x14d6ea=new Hangup(_0x5eae9b,_0x40e0cd);_0x14d6ea[_0x9efb('0xd5')]=0x12;_0x14d6ea[_0x9efb('0xcf')]=_0x9efb('0x117');_0x14d6ea[_0x9efb('0x118')]=_0x9efb('0x11e');ami[_0x9efb('0x41')]('custom:amd',ut[_0x9efb('0x119')](_0x14d6ea,'amd'));this[_0x9efb('0x11a')](_0x14d6ea,_0x9efb('0x12a'),_0x9efb('0x12b'));}if(_0x5eae9b['type']===_0x9efb('0xbc')&&this[_0x9efb('0x21')][_0x5eae9b[_0x9efb('0xb9')]][_0x9efb('0x114')]&&_0x40e0cd[_0x9efb('0x11c')]===_0x9efb('0x12c')){return new Promise(function(_0xb9d598,_0x4a68b6){delete _0x1eab98['uniqueId'][_0x40e0cd[_0x9efb('0xba')]];_0x1eab98[_0x9efb('0xbd')](_0x1eab98['campaigns'][_0x5eae9b['queue']]);_0x1eab98[_0x9efb('0x21')][_0x5eae9b[_0x9efb('0xb9')]][_0x9efb('0xc1')]+=0x1;_0x1eab98[_0x9efb('0x21')][_0x5eae9b[_0x9efb('0xb9')]][_0x9efb('0x116')]+=0x1;var _0x4da9f6=_0x1eab98['campaigns'][_0x5eae9b[_0x9efb('0xb9')]];var _0xe867b4=new Hangup(_0x5eae9b,_0x40e0cd);_0xe867b4[_0x9efb('0xd5')]=0x13;_0xe867b4[_0x9efb('0xcf')]=_0x9efb('0x11d');_0xe867b4[_0x9efb('0x118')]='AMD';_0xe867b4[_0x9efb('0x122')]+=0x1;_0xe867b4[_0x9efb('0xea')]+=0x1;_0xe867b4['amd']=!![];ami[_0x9efb('0x41')](_0x9efb('0x12d'),ut[_0x9efb('0x119')](_0xe867b4,_0x9efb('0x11f')));hopperUtils['createHistory'](_0xe867b4)[_0x9efb('0x9e')](loggerCatch(_0x9efb('0x120')));if(_0xe867b4[_0x9efb('0x12e')]+_0xe867b4[_0x9efb('0x12f')]+_0xe867b4[_0x9efb('0x130')]+_0xe867b4[_0x9efb('0x121')]+_0xe867b4[_0x9efb('0xda')]+_0xe867b4[_0x9efb('0xe9')]+_0xe867b4['countmachineretry']+_0xe867b4[_0x9efb('0x123')]>=_0x4da9f6[_0x9efb('0x124')]){_0x1eab98['stateGlobal'](_0xe867b4,_0xb9d598,_0x4a68b6,_0x9efb('0x131'));}else{if(_0xe867b4[_0x9efb('0x122')]>=_0x4da9f6[_0x9efb('0x126')]){_0x1eab98[_0x9efb('0x127')](_0xe867b4,_0xb9d598,_0x4a68b6,_0x9efb('0x132'));}else{hopperUtils[_0x9efb('0xd9')]({'active':![],'countmachineretry':_0xe867b4[_0x9efb('0x122')],'scheduledat':moment()[_0x9efb('0xee')](_0x4da9f6[_0x9efb('0x128')],_0x9efb('0xdb'))[_0x9efb('0x44')](_0x9efb('0xbf')),'ContactId':_0xe867b4[_0x9efb('0xdc')],'ListId':_0xe867b4[_0x9efb('0xdd')],'VoiceQueueId':_0xe867b4[_0x9efb('0xde')]||undefined,'CampaignId':_0xe867b4['CampaignId']||undefined})[_0x9efb('0x9e')](loggerCatch('[rescheduleContact][Machine]'));_0xb9d598({'reschedule':0x1});}}});}}};Dialer[_0x9efb('0x85')][_0x9efb('0x35')]=function(_0x285e3d){var _0x560217=this[_0x9efb('0x26')][_0x285e3d[_0x9efb('0xba')]];var _0x36fb3d;if(_0x560217&&_0x560217[_0x9efb('0xbb')]===_0x9efb('0xbc')){delete this[_0x9efb('0x26')][_0x285e3d['uniqueid']];this[_0x9efb('0xbd')](this[_0x9efb('0x21')][_0x560217[_0x9efb('0xb9')]]);this[_0x9efb('0x21')][_0x560217[_0x9efb('0xb9')]][_0x9efb('0x133')]+=0x1;_0x36fb3d=new Hangup(_0x560217,_0x285e3d);hopperUtils[_0x9efb('0xc7')](_0x36fb3d)[_0x9efb('0x9e')](loggerCatch(_0x9efb('0x134')));hopperUtils['moveContactManagedDialer'](_0x36fb3d)['catch'](loggerCatch(_0x9efb('0x135')));}if(_0x560217&&_0x560217[_0x9efb('0xbb')]!==_0x9efb('0xbc')&&isNotNull(this[_0x9efb('0x20')][_0x560217[_0x9efb('0xb9')]][_0x9efb('0x136')])){delete this[_0x9efb('0x26')][_0x285e3d[_0x9efb('0xba')]];this[_0x9efb('0xbd')](this[_0x9efb('0x20')][_0x560217[_0x9efb('0xb9')]]);this['voiceQueues'][_0x560217['queue']]['outboundAnswerCallsDay']+=0x1;this[_0x9efb('0x20')][_0x560217['queue']][_0x9efb('0x116')]+=0x1;_0x36fb3d=new Hangup(_0x560217,_0x285e3d);_0x36fb3d['state']=0x10;_0x36fb3d['statedesc']=_0x9efb('0x137');_0x36fb3d[_0x9efb('0x118')]='AGI';hopperUtils[_0x9efb('0xc7')](_0x36fb3d)[_0x9efb('0x9e')](loggerCatch(_0x9efb('0x134')));hopperUtils[_0x9efb('0xc9')](_0x36fb3d)[_0x9efb('0x9e')](loggerCatch(_0x9efb('0x135')));}if(_0x560217&&_0x560217['type']!=='ivr'&&!isNotNull(this[_0x9efb('0x20')][_0x560217[_0x9efb('0xb9')]][_0x9efb('0x136')])){delete this[_0x9efb('0x26')][_0x285e3d['uniqueid']];this[_0x9efb('0xbd')](this[_0x9efb('0x20')][_0x560217[_0x9efb('0xb9')]]);this['voiceQueues'][_0x560217[_0x9efb('0xb9')]][_0x9efb('0x138')]+=0x1;_0x36fb3d=new Hangup(_0x560217,_0x285e3d);_0x36fb3d[_0x9efb('0xd5')]=0xc;_0x36fb3d[_0x9efb('0xcf')]=_0x285e3d[_0x9efb('0x139')];_0x36fb3d[_0x9efb('0x118')]=_0x9efb('0x13a');hopperUtils[_0x9efb('0xc7')](_0x36fb3d)[_0x9efb('0x9e')](loggerCatch(_0x9efb('0x134')));hopperUtils['moveContactManagedDialer'](_0x36fb3d)[_0x9efb('0x9e')](loggerCatch(_0x9efb('0x135')));}};Dialer[_0x9efb('0x85')]['syncQueueSummary']=function(_0x4d120f){var _0x4cd292=this;if(!_0x4cd292[_0x9efb('0x2c')][_0x4d120f[_0x9efb('0x46')]]){_0x4cd292[_0x9efb('0x2c')][_0x4d120f[_0x9efb('0x46')]]={'running':![]};}else if(_0x4cd292[_0x9efb('0x2c')][_0x4d120f[_0x9efb('0x46')]]['running']===!![]){return;}else if(_0x4cd292[_0x9efb('0x2c')][_0x4d120f[_0x9efb('0x46')]][_0x9efb('0x13b')]===![]){_0x4cd292[_0x9efb('0x2c')][_0x4d120f['name']][_0x9efb('0x13b')]=!![];}var _0x4a2669=_0x4cd292[_0x9efb('0x20')][_0x4d120f['name']];var _0x1664b0=_0x4a2669[_0x9efb('0x6f')]!==utils['CAMPAIGN_STATUS'][_0x9efb('0x74')];var _0x393b43=utils[_0x9efb('0x13c')](_0x4a2669);_0x4a2669['statusMessage']=utils[_0x9efb('0x13d')](_0x4a2669,_0x4cd292[_0x9efb('0x22')]);Promise[_0x9efb('0xa9')]()['then'](function(){if(_0x4a2669[_0x9efb('0x13e')]===utils[_0x9efb('0x67')]['INACTIVE']){if(_0x1664b0){clearPredictiveAttributes(_0x4a2669);_0x4d120f[_0x9efb('0x28')]=undefined;_0x4d120f[_0x9efb('0x29')]=undefined;}if(_0x4a2669[_0x9efb('0x13e')]===utils[_0x9efb('0x67')][_0x9efb('0x74')]){_0x4d120f[_0x9efb('0x13f')]=0x0;_0x4d120f['paused']=0x0;_0x4d120f[_0x9efb('0x140')]=0x0;_0x4d120f[_0x9efb('0x141')]=0x0;_0x4d120f['pTalking']=0x0;}}else if(_0x4a2669[_0x9efb('0x13e')]===utils[_0x9efb('0x67')][_0x9efb('0x142')]&&!_0x393b43){return _0x4cd292['ifTime'](_0x4a2669,!![])[_0x9efb('0x9a')](function(){return _0x4cd292[_0x9efb('0x8c')](_0x4a2669,![]);})[_0x9efb('0x9a')](function(){return _0x4cd292[_0x9efb('0x143')](_0x4a2669);})[_0x9efb('0x9e')](function(_0x206b8e){loggerSyncQueueSummary[_0x9efb('0x43')](_0x9efb('0x144'),util[_0x9efb('0x63')](_0x206b8e,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x4a2669);});}else{clearPredictiveAttributes(_0x4a2669);}})[_0x9efb('0x9a')](function(){var _0x4de860=_0x4d120f[_0x9efb('0x145')](_0x4a2669);if(_0x4de860||_0x4a2669[_0x9efb('0x146')]){_0x4a2669[_0x9efb('0x146')]=![];_0x4d120f['updateReportFromOutboundQueue'](_0x4a2669);Object[_0x9efb('0x147')](_0x4a2669,_0x4d120f);emitOutboundVoiceQueueSummary(_0x4d120f);}_0x4cd292[_0x9efb('0x2c')][_0x4a2669[_0x9efb('0x46')]][_0x9efb('0x13b')]=![];})[_0x9efb('0x9e')](function(_0x1d68bc){logger['error'](_0x9efb('0x144'),util['inspect'](_0x1d68bc,{'showHidden':![],'depth':null}));_0x4cd292['queuesSummary'][_0x4a2669[_0x9efb('0x46')]][_0x9efb('0x13b')]=![];});};Dialer[_0x9efb('0x85')][_0x9efb('0x34')]=_[_0x9efb('0x148')](function(){var _0x234976=_['filter'](this[_0x9efb('0x20')],function(_0x5a3f84){return _0x5a3f84['dialPreviewRecallmeReminder'];});var _0x3c701d=_[_0x9efb('0x149')](this[_0x9efb('0xf6')],function(_0x2d7d99){return _0x2d7d99['online']&&_0x2d7d99['status']===_0x9efb('0x82');});if(_0x234976[_0x9efb('0x95')]>0x0&&_0x3c701d['length']>0x0){return Promise[_0x9efb('0xa9')]()[_0x9efb('0x9a')](cmHopper[_0x9efb('0x14a')](_[_0x9efb('0x14b')](_0x234976,'id'),previewRecallmeReminderInterval,_[_0x9efb('0x14b')](_0x3c701d,'id')))[_0x9efb('0x9a')](function(_0x184bca){for(var _0x535225=0x0;_0x535225<_0x184bca[_0x9efb('0x95')];_0x535225++){var _0x2a295d=_0x184bca[_0x535225][_0x9efb('0x14c')][_0x9efb('0x46')];if(_0x2a295d)io['to'](util[_0x9efb('0x44')]('user:%s',_0x2a295d))['emit']('user:dialPreviewRecallReminder',{'hopper':_0x184bca[_0x535225]});}})[_0x9efb('0x9e')](function(_0x22f778){logger['error'](_0x9efb('0x14d'),_0x22f778);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype'][_0x9efb('0x3d')]=function(){var _0x3815c5=this;setInterval(function(){_0x3815c5[_0x9efb('0x14e')](_0x3815c5['uniqueId'],_0x9efb('0x14f'));_0x3815c5[_0x9efb('0x14e')](_0x3815c5[_0x9efb('0x25')],_0x9efb('0x150'));},0x32c8);};Dialer[_0x9efb('0x85')][_0x9efb('0x14e')]=function(_0x297194,_0x3ef149){var _0xe12438=this;for(var _0x11e029 in _0x297194){if(typeof _0x297194[_0x11e029]!=='undefined'){this[_0x9efb('0x151')]['enqueue'](function(){if(!_[_0x9efb('0xf4')](_0x297194[_0x11e029])){return ami[_0x9efb('0x96')]({'action':'status','channel':_0x297194[_0x11e029][_0x9efb('0xf0')]})[_0x9efb('0x9e')](function(_0x3c956f){if(_0x3c956f[_0x9efb('0x6f')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x297194[_0x11e029]&&_0x297194[_0x11e029][_0x9efb('0xbb')]!==_0x9efb('0xbc')){_0xe12438[_0x9efb('0xbd')](_0xe12438['voiceQueues'][_0x297194[_0x11e029][_0x9efb('0xb9')]]);logger[_0x9efb('0x61')](_0x9efb('0x152'),_0x3ef149,_0x11e029,_0x297194[_0x11e029][_0x9efb('0xb9')]);delete _0x297194[_0x11e029];}if(_0x297194[_0x11e029]&&_0x297194[_0x11e029][_0x9efb('0xbb')]===_0x9efb('0xbc')){_0xe12438[_0x9efb('0xbd')](_0xe12438[_0x9efb('0x21')][_0x297194[_0x11e029][_0x9efb('0xb9')]]);logger[_0x9efb('0x61')](_0x9efb('0x153'),_0x3ef149,_0x11e029,_0x297194[_0x11e029][_0x9efb('0xb9')]);delete _0x297194[_0x11e029];}},0x2328);}});}});}}};Dialer[_0x9efb('0x85')][_0x9efb('0x154')]=function(_0x1946f5){return Promise[_0x9efb('0xa9')]()[_0x9efb('0x9a')](voiceQueueRt['getVoiceQueueRtPauses'](_0x1946f5))[_0x9efb('0x9e')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x9efb('0x85')]['updateOriginated']=function(_0x7c8920){if(!_[_0x9efb('0x40')](_0x7c8920)&&_0x7c8920!==null){if(typeof _0x7c8920['originated']!==_0x9efb('0x155')){if(_0x7c8920[_0x9efb('0x7a')]>0x0){_0x7c8920[_0x9efb('0x7a')]-=0x1;}else{logger['error'](_0x9efb('0x156'));}}}else{logger[_0x9efb('0x61')](_0x9efb('0x157'));}};Dialer[_0x9efb('0x85')]['loggerHandler']=function(_0x5f2ad9,_0x3135fa){var _0x4bcbcc=this;return function(_0x3a3e6a){_0x4bcbcc['updateOriginated'](_0x3135fa);logger[_0x9efb('0x61')](_0x5f2ad9,util[_0x9efb('0x63')](_0x3a3e6a,{'showHidden':![],'depth':null}));};};Dialer[_0x9efb('0x85')][_0x9efb('0x158')]=function(_0x27ceb3,_0x558c3d,_0x479ee9){var _0x4c83f8={'state':0x19,'statedesc':_0x9efb('0x159')};this[_0x9efb('0xbd')](_0x558c3d);this[_0x9efb('0x11a')](_[_0x9efb('0x5c')](_0x4c83f8,_[_0x9efb('0x6d')](_0x479ee9,[_0x9efb('0xdc'),_0x9efb('0xdd'),_0x9efb('0x15a'),'VoiceQueueId',_0x9efb('0xdf')])),_0x9efb('0x15b'),'[emptyContact]');logger[_0x9efb('0x61')](_0x27ceb3);};Dialer[_0x9efb('0x85')]['saveInDb']=function(_0x3c3572,_0x4081f1,_0x4940fd){hopperUtils[_0x9efb('0xc7')](_0x3c3572)[_0x9efb('0x9e')](loggerCatch(_0x4081f1));hopperUtils[_0x9efb('0xc9')](_0x3c3572)[_0x9efb('0x9e')](loggerCatch(_0x4940fd));};Dialer['prototype'][_0x9efb('0xd8')]=function(_0x5d2ce1,_0x1b1a88){hopperUtils[_0x9efb('0xc7')](_0x5d2ce1)[_0x9efb('0x9e')](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x1b1a88==0x0){hopperUtils[_0x9efb('0xc9')](_0x5d2ce1)['catch'](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0x9efb('0x85')][_0x9efb('0x14d')]=function(_0xa11278){return Promise['resolve']()['then'](cmHopper[_0x9efb('0x14a')](_0xa11278['id'],previewRecallmeReminderInterval))[_0x9efb('0x9a')](function(_0x5d3a81){for(var _0xe5b3fe=0x0;_0xe5b3fe<_0x5d3a81['length'];_0xe5b3fe++){var _0x4c72c1=_0x5d3a81[_0xe5b3fe][_0x9efb('0x14c')][_0x9efb('0x46')];if(_0x4c72c1)io['to'](util[_0x9efb('0x44')](_0x9efb('0x15c'),_0x4c72c1))[_0x9efb('0x41')](_0x9efb('0x15d'),{'hopper':_0x5d3a81[_0xe5b3fe]});}})[_0x9efb('0x9e')](function(){});};Dialer[_0x9efb('0x85')]['launchHandleIvr']=function(_0x219dc5){var _0x2a34e2=this;return function(){_0x2a34e2['handleIvr'](_0x219dc5);};};Dialer[_0x9efb('0x85')][_0x9efb('0x15e')]=function(_0x38c50f,_0x507923){var _0x83184=this;var _0x410c8b=uuid['v4']();this[_0x9efb('0x25')][_0x410c8b]=new Action(_0x38c50f,_0x507923,_0x410c8b);return new Promise(function(_0x3efa34,_0x1b2a59){if(_[_0x9efb('0x40')](_0x38c50f)&&typeof _0x38c50f!=='object'){return _0x1b2a59(msgResponse(_0x9efb('0x15f'),'Failure',_0x9efb('0x160')));}if(_[_0x9efb('0x40')](_0x507923[_0x9efb('0x161')])||_0x507923['phone']===null){return _0x1b2a59(msgResponse(_0x9efb('0x15f'),_0x9efb('0x8d'),_0x9efb('0x162')));}var _0x5d8522={'XMD-CALLERID':_0x83184['actions'][_0x410c8b][_0x9efb('0x163')](),'XMD-AGI':_0x38c50f[_0x9efb('0x136')]?util[_0x9efb('0x44')]('\x22agi://%s/square,%s\x22',ipAgi,_0x38c50f[_0x9efb('0x136')]):_0x9efb('0x164'),'XMD-AGIAFTER':_0x38c50f[_0x9efb('0xc5')]?util['format'](_0x9efb('0x165'),ipAgi,_0x38c50f[_0x9efb('0xc5')]):'NONE','XMD-QUEUE':utils[_0x9efb('0x166')](_0x38c50f)?util[_0x9efb('0x44')]('\x22%s,%s%s,,,%s\x22',_0x38c50f[_0x9efb('0x46')],_0x38c50f[_0x9efb('0x167')]||'',_0x38c50f[_0x9efb('0xc6')]?'c':'',_0x38c50f['dialQueueTimeout']||0x3):'NONE','XMD-CONTACTID':_0x507923[_0x9efb('0xdc')],'XMD-CDRTYPE':_0x9efb('0x9'),'CALLERID(all)':_0x83184['actions'][_0x410c8b][_0x9efb('0x163')](),'XMD-AMD':_0x38c50f[_0x9efb('0x114')]?'ACTIVE':_0x9efb('0x164'),'XMD-DESTINATION':_0x9efb('0x113')};if(_0x38c50f[_0x9efb('0x114')]){_0x5d8522[_0x9efb('0x168')]=_0x38c50f[_0x9efb('0x169')]||0x9c4;_0x5d8522[_0x9efb('0x16a')]=_0x38c50f[_0x9efb('0x16b')]||0x5dc;_0x5d8522[_0x9efb('0x16c')]=_0x38c50f[_0x9efb('0x16d')]||0x320;_0x5d8522['XMD-AMDTOTALANALYSISTIME']=_0x38c50f[_0x9efb('0x16e')]||0x1388;_0x5d8522[_0x9efb('0x16f')]=_0x38c50f[_0x9efb('0x170')]||0x64;_0x5d8522[_0x9efb('0x171')]=_0x38c50f[_0x9efb('0x172')]||0x32;_0x5d8522[_0x9efb('0x173')]=_0x38c50f[_0x9efb('0x174')]||0x3;_0x5d8522['XMD-AMDSILENCETHRESHOLD']=_0x38c50f[_0x9efb('0x175')]||0x100;_0x5d8522[_0x9efb('0x176')]=_0x38c50f[_0x9efb('0x177')]||0x1388;}if(utils['isOutboundQueue'](_0x38c50f)){_0x5d8522['XMD-VOICEQUEUEID']=_0x507923['VoiceQueueId'];}else{_0x5d8522[_0x9efb('0x178')]=_0x507923[_0x9efb('0xdf')];}var _0xfba742=utils['setXMDContactVariables'](_0x507923[_0x9efb('0x179')]);Object['assign'](_0x5d8522,_0xfba742);var _0x380a23=_0x83184[_0x9efb('0x7f')](_0x38c50f[_0x9efb('0x17a')])?utils['getCallerId'](_0x38c50f[_0x9efb('0x17a')]['callerid'],_0x38c50f[_0x9efb('0x17b')],_0x38c50f[_0x9efb('0x17c')]>0x0?utils['getCallerIdRandom'](_0x38c50f[_0x9efb('0x17d')],_0x38c50f['dialRandomLastDigitCallerIdNumber']):_0x38c50f[_0x9efb('0x17d')]):utils['getCallerId'](_[_0x9efb('0xf4')](_0x38c50f[_0x9efb('0x17e')])?_0x38c50f[_0x9efb('0x17a')][_0x9efb('0x17f')]:_0x38c50f[_0x9efb('0x17e')][_0x9efb('0x17f')],_0x38c50f[_0x9efb('0x17b')],_0x38c50f[_0x9efb('0x17c')]>0x0?utils[_0x9efb('0x180')](_0x38c50f[_0x9efb('0x17d')],_0x38c50f[_0x9efb('0x17c')]):_0x38c50f[_0x9efb('0x17d')]);if(_0x380a23){_0x5d8522[_0x9efb('0x181')]=_0x83184[_0x9efb('0x25')][_0x410c8b]['originatecalleridname']=utils[_0x9efb('0x182')](_0x380a23);_0x5d8522[_0x9efb('0x183')]=_0x507923[_0x9efb('0x161')];}_0x38c50f['variables']=_0x5d8522;return ami[_0x9efb('0x96')]({'actionid':_0x410c8b,'action':_0x9efb('0x15f'),'channel':_0x83184[_0x9efb('0x7f')](_0x38c50f[_0x9efb('0x17a')])?util[_0x9efb('0x44')](_0x9efb('0x184'),_0x38c50f[_0x9efb('0x17a')]['name'],isNotNull(_0x38c50f[_0x9efb('0x185')])?_0x38c50f['dialPrefix']['trim']()||'':'',_0x38c50f[_0x9efb('0x186')]>0x0?_0x507923[_0x9efb('0x161')][_0x9efb('0x187')](_0x38c50f[_0x9efb('0x186')]):_0x507923[_0x9efb('0x161')]):util[_0x9efb('0x44')](_0x9efb('0x184'),_[_0x9efb('0xf4')](_0x38c50f[_0x9efb('0x17e')])?_0x38c50f[_0x9efb('0x17a')][_0x9efb('0x46')]:_0x38c50f[_0x9efb('0x17e')][_0x9efb('0x46')],isNotNull(_0x38c50f[_0x9efb('0x185')])?_0x38c50f['dialPrefix']['trim']()||'':'',_0x38c50f[_0x9efb('0x186')]>0x0?_0x507923[_0x9efb('0x161')][_0x9efb('0x187')](_0x38c50f[_0x9efb('0x186')]):_0x507923[_0x9efb('0x161')]),'callerid':_0x380a23,'Exten':_0x9efb('0x113'),'Context':_0x9efb('0x188'),'Priority':'1','variable':_0x5d8522,'timeout':(_0x38c50f[_0x9efb('0x189')]||0x1e)*0x3e8,'async':!![],'channelid':_0x410c8b})[_0x9efb('0x9a')](function(_0x690510){return _0x3efa34(_0x690510);})[_0x9efb('0x9e')](function(_0x2cab21){_0x38c50f[_0x9efb('0x18a')]+=0x1;var _0x575c90=new History(_0x83184[_0x9efb('0x25')][_0x410c8b]);logger['error'](util[_0x9efb('0x44')]('[originateError]:\x20%s',JSON[_0x9efb('0x7e')](_0x2cab21)));_0x575c90[_0x9efb('0xd5')]=0xe;_0x575c90[_0x9efb('0xcf')]=_0x9efb('0x18b');_0x575c90[_0x9efb('0x6a')]=moment()[_0x9efb('0x44')]('YYYY-MM-DD\x20HH:mm:ss');_0x575c90[_0x9efb('0xe1')]=_0x575c90['starttime'];hopperUtils[_0x9efb('0xc7')](_0x575c90)[_0x9efb('0x9e')](loggerCatch('[originate][error]'));_0x83184['moveContactManagedDialer'](_0x575c90)['catch'](loggerCatch(_0x9efb('0x18c')))['finally'](function(){delete _0x83184[_0x9efb('0x25')][_0x410c8b];return _0x1b2a59(msgResponse(_0x9efb('0x15f'),_0x9efb('0x18d'),_0x9efb('0x18e')));});});});};Dialer[_0x9efb('0x85')][_0x9efb('0x18f')]=function(_0xabc0f9,_0x376e9a,_0x242777){var _0xfb7257=new History(_0x376e9a);if(_0xfb7257['countbusyretry']+_0xfb7257[_0x9efb('0x12f')]+_0xfb7257[_0x9efb('0x130')]+_0xfb7257['countnosuchnumberretry']+_0xfb7257[_0x9efb('0xda')]+_0xfb7257['countabandonedretry']+_0xfb7257[_0x9efb('0x122')]+_0xfb7257[_0x9efb('0x123')]>=_0x242777['dialGlobalMaxRetry']-0x1){return!![];}switch(_0xabc0f9){case 0x3:if(_0xfb7257[_0x9efb('0x130')]>=_0x242777['dialNoAnswerMaxRetry']-0x1){return!![];}hopperUtils[_0x9efb('0xd9')]({'active':![],'countnoanswerretry':_0xfb7257[_0x9efb('0x130')]+=0x1,'scheduledat':moment()[_0x9efb('0xee')](_0x242777['dialNoAnswerRetryFrequency'],'minutes')['format'](_0x9efb('0xbf')),'ContactId':_0xfb7257[_0x9efb('0xdc')],'ListId':_0xfb7257[_0x9efb('0xdd')],'VoiceQueueId':_0xfb7257['VoiceQueueId']||undefined,'CampaignId':_0xfb7257['CampaignId']||undefined})[_0x9efb('0x9e')](loggerCatch(_0x9efb('0x190')));break;case 0x5:if(_0xfb7257['countbusyretry']>=_0x242777[_0x9efb('0x191')]-0x1){return!![];}hopperUtils[_0x9efb('0xd9')]({'active':![],'countbusyretry':_0xfb7257['countbusyretry']+=0x1,'scheduledat':moment()['add'](_0x242777['dialBusyRetryFrequency'],_0x9efb('0xdb'))[_0x9efb('0x44')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xfb7257[_0x9efb('0xdc')],'ListId':_0xfb7257['ListId'],'VoiceQueueId':_0xfb7257[_0x9efb('0xde')]||undefined,'CampaignId':_0xfb7257[_0x9efb('0xdf')]||undefined})['catch'](loggerCatch(_0x9efb('0x192')));break;case 0x8:if(_0xfb7257[_0x9efb('0x12f')]>=_0x242777[_0x9efb('0x193')]-0x1){return!![];}hopperUtils[_0x9efb('0xd9')]({'active':![],'countcongestionretry':_0xfb7257[_0x9efb('0x12f')]+=0x1,'scheduledat':moment()[_0x9efb('0xee')](_0x242777[_0x9efb('0x194')],_0x9efb('0xdb'))['format'](_0x9efb('0xbf')),'ContactId':_0xfb7257[_0x9efb('0xdc')],'ListId':_0xfb7257[_0x9efb('0xdd')],'VoiceQueueId':_0xfb7257[_0x9efb('0xde')]||undefined,'CampaignId':_0xfb7257['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0xfb7257[_0x9efb('0x121')]>=_0x242777['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{hopperUtils[_0x9efb('0xd9')]({'active':![],'countnosuchnumberretry':_0xfb7257['countnosuchnumberretry']+=0x1,'scheduledat':moment()['add'](_0x242777[_0x9efb('0x195')],'minutes')[_0x9efb('0x44')](_0x9efb('0xbf')),'ContactId':_0xfb7257[_0x9efb('0xdc')],'ListId':_0xfb7257['ListId'],'VoiceQueueId':_0xfb7257[_0x9efb('0xde')]||undefined,'CampaignId':_0xfb7257[_0x9efb('0xdf')]||undefined})[_0x9efb('0x9e')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0xfb7257[_0x9efb('0xda')]>=_0x242777[_0x9efb('0xd7')]-0x1){return!![];}hopperUtils[_0x9efb('0xd9')]({'active':![],'countdropretry':_0xfb7257['countdropretry']+=0x1,'scheduledat':moment()[_0x9efb('0xee')](_0x242777['dialDropRetryFrequency'],_0x9efb('0xdb'))[_0x9efb('0x44')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xfb7257[_0x9efb('0xdc')],'ListId':_0xfb7257[_0x9efb('0xdd')],'VoiceQueueId':_0xfb7257[_0x9efb('0xde')]||undefined,'CampaignId':_0xfb7257[_0x9efb('0xdf')]||undefined})[_0x9efb('0x9e')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0xfb7257[_0x9efb('0xe9')]>=_0x242777[_0x9efb('0xed')]-0x1){return!![];}hopperUtils[_0x9efb('0xd9')]({'active':![],'countabandonedretry':_0xfb7257['countabandonedretry']+=0x1,'scheduledat':moment()[_0x9efb('0xee')](_0x242777['dialAbandonedRetryFrequency'],_0x9efb('0xdb'))[_0x9efb('0x44')](_0x9efb('0xbf')),'ContactId':_0xfb7257[_0x9efb('0xdc')],'ListId':_0xfb7257['ListId'],'VoiceQueueId':_0xfb7257[_0x9efb('0xde')]||undefined,'CampaignId':_0xfb7257[_0x9efb('0xdf')]||undefined})[_0x9efb('0x9e')](loggerCatch(_0x9efb('0x196')));break;case 0x13:if(_0xfb7257['countmachineretry']>=_0x242777['dialMachineMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0xfb7257[_0x9efb('0x122')]+=0x1,'scheduledat':moment()[_0x9efb('0xee')](_0x242777[_0x9efb('0x128')],_0x9efb('0xdb'))[_0x9efb('0x44')](_0x9efb('0xbf')),'ContactId':_0xfb7257[_0x9efb('0xdc')],'ListId':_0xfb7257[_0x9efb('0xdd')],'VoiceQueueId':_0xfb7257['VoiceQueueId']||undefined,'CampaignId':_0xfb7257[_0x9efb('0xdf')]||undefined})['catch'](loggerCatch(_0x9efb('0x129')));break;case 0x14:if(_0xfb7257['countagentrejectretry']>=_0x242777[_0x9efb('0x197')]-0x1){return!![];}hopperUtils[_0x9efb('0xd9')]({'active':![],'countagentrejectretry':_0xfb7257[_0x9efb('0x123')]+=0x1,'scheduledat':moment()[_0x9efb('0xee')](_0x242777[_0x9efb('0x198')],_0x9efb('0xdb'))['format'](_0x9efb('0xbf')),'ContactId':_0xfb7257[_0x9efb('0xdc')],'ListId':_0xfb7257[_0x9efb('0xdd')],'VoiceQueueId':_0xfb7257[_0x9efb('0xde')]||undefined,'CampaignId':_0xfb7257[_0x9efb('0xdf')]||undefined})['catch'](loggerCatch(_0x9efb('0x199')));break;default:return!![];}};Dialer['prototype'][_0x9efb('0x10e')]=function(_0x12b26c,_0x18571,_0x58c3fa){var _0x151782=this;var _0x219ccb=new History(_0x12b26c);var _0x3cc409=![];var _0x354926;var _0x515345;return new Promise(function(_0x3979d2,_0x5b58ca){if(_['isUndefined'](_0x18571)&&typeof _0x18571!==_0x9efb('0x19a')){return _0x5b58ca(msgResponse(_0x9efb('0x19b'),_0x9efb('0x8d'),_0x9efb('0x19c')));}if(_['isUndefined'](_0x58c3fa)&&typeof _0x58c3fa!==_0x9efb('0x19a')){return _0x5b58ca(msgResponse(_0x9efb('0x19b'),_0x9efb('0x8d'),_0x9efb('0x19d')));}hopperUtils['verifyAdditionalPhones'](_0x219ccb,_0x58c3fa['reason'],_0x18571)[_0x9efb('0x9a')](function(_0x49ea5e){if(_0x49ea5e['additional']==0x1)_0x3cc409=!![];switch(_0x58c3fa[_0x9efb('0xc2')]){case'0':_0x18571['outboundNoSuchCallsDay']+=0x1;_0x219ccb[_0x9efb('0xd5')]=0x0;_0x219ccb[_0x9efb('0xcf')]=_0x9efb('0x19e');_0x219ccb[_0x9efb('0x121')]+=0x1;_0x219ccb['countglobal']+=0x1;ami['emit'](_0x9efb('0x19f'),ut[_0x9efb('0x119')](_0x12b26c,_0x9efb('0x1a0')));_0x354926=_0x18571[_0x9efb('0x195')];_0x515345=_0x18571[_0x9efb('0xd3')];hopperUtils['createHistory'](_0x219ccb)[_0x9efb('0x9e')](loggerCatch(_0x9efb('0x120')));if(_0x151782[_0x9efb('0x18f')](0x0,_0x12b26c,_0x18571)&&!_0x3cc409){if(_0x219ccb['countnosuchnumberretry']>=_0x18571[_0x9efb('0x1a1')]){_0x151782[_0x9efb('0x127')](_0x219ccb,_0x3979d2,_0x5b58ca,_0x9efb('0x1a2'));}else{_0x151782[_0x9efb('0x125')](_0x219ccb,_0x3979d2,_0x5b58ca,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x18571[_0x9efb('0x1a3')]+=0x1;_0x219ccb[_0x9efb('0xd5')]=0x3;_0x219ccb[_0x9efb('0xcf')]=_0x9efb('0x1a4');_0x219ccb[_0x9efb('0x130')]+=0x1;_0x219ccb['countglobal']+=0x1;var _0x45474b=ut[_0x9efb('0x1a5')](_0x12b26c,_0x18571);ami[_0x9efb('0x41')]('custom:agentnoanswer',_0x45474b);_0x354926=_0x18571[_0x9efb('0x1a6')];_0x515345=_0x18571[_0x9efb('0xd3')];hopperUtils[_0x9efb('0xc7')](_0x219ccb)[_0x9efb('0x9e')](loggerCatch(_0x9efb('0x1a7')));if(_0x151782[_0x9efb('0x18f')](0x3,_0x12b26c,_0x18571)&&!_0x3cc409){if(_0x219ccb['countnoanswerretry']>=_0x18571[_0x9efb('0x1a8')]){_0x151782[_0x9efb('0x127')](_0x219ccb,_0x3979d2,_0x5b58ca,'reason\x203\x20ringing\x20no\x20answer');}else{_0x151782[_0x9efb('0x125')](_0x219ccb,_0x3979d2,_0x5b58ca,_0x9efb('0x1a9'));}}break;case'5':_0x18571['outboundBusyCallsDay']+=0x1;_0x219ccb[_0x9efb('0xd5')]=0x5;_0x219ccb[_0x9efb('0xcf')]=_0x9efb('0x1aa');_0x219ccb[_0x9efb('0x12e')]+=0x1;_0x219ccb['countglobal']+=0x1;ami[_0x9efb('0x41')](_0x9efb('0x1ab'),ut['buildObj'](_0x12b26c,_0x9efb('0x1ac')));_0x354926=_0x18571[_0x9efb('0x1ad')];_0x515345=_0x18571['callAdditionalPhoneAfterMin'];hopperUtils[_0x9efb('0xc7')](_0x219ccb)[_0x9efb('0x9e')](loggerCatch(_0x9efb('0x1ae')));if(_0x151782[_0x9efb('0x18f')](0x5,_0x12b26c,_0x18571)&&!_0x3cc409){if(_0x219ccb[_0x9efb('0x12e')]>=_0x18571[_0x9efb('0x191')]){_0x151782[_0x9efb('0x127')](_0x219ccb,_0x3979d2,_0x5b58ca,'reason\x205\x20busy');}else{_0x151782[_0x9efb('0x125')](_0x219ccb,_0x3979d2,_0x5b58ca,'reason\x205\x20busy');}}break;case'8':_0x18571[_0x9efb('0x1af')]+=0x1;_0x219ccb[_0x9efb('0xd5')]=0x8;_0x219ccb[_0x9efb('0xcf')]=_0x9efb('0x1b0');_0x219ccb[_0x9efb('0x12f')]+=0x1;_0x219ccb[_0x9efb('0xea')]+=0x1;_0x354926=_0x18571[_0x9efb('0x194')];_0x515345=_0x18571[_0x9efb('0xd3')];ami[_0x9efb('0x41')](_0x9efb('0x1b1'),ut[_0x9efb('0x119')](_0x12b26c,'congestion'));hopperUtils['createHistory'](_0x219ccb)[_0x9efb('0x9e')](loggerCatch(_0x9efb('0x1b2')));if(_0x151782['checkRetriveMax'](0x8,_0x12b26c,_0x18571)&&!_0x3cc409){if(_0x219ccb['countcongestionretry']>=_0x18571[_0x9efb('0x193')]){_0x151782[_0x9efb('0x127')](_0x219ccb,_0x3979d2,_0x5b58ca,_0x9efb('0x1b3'));}else{_0x151782['stateGlobal'](_0x219ccb,_0x3979d2,_0x5b58ca,_0x9efb('0x1b3'));}}break;case'11':_0x18571['outboundAbandonedCallsDay']+=0x1;_0x219ccb[_0x9efb('0xd5')]=0xb;_0x219ccb['statedesc']=_0x9efb('0xe7');_0x219ccb[_0x9efb('0xe9')]+=0x1;_0x219ccb[_0x9efb('0xea')]+=0x1;_0x354926=_0x18571['dialAbandonedRetryFrequency'];_0x515345=_0x18571['callAdditionalPhoneAfterMin'];hopperUtils[_0x9efb('0xc7')](_0x219ccb)[_0x9efb('0x9e')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x151782[_0x9efb('0x18f')](0xb,_0x12b26c,_0x18571)&&!_0x3cc409){if(_0x219ccb['countabandonedretry']>=_0x18571[_0x9efb('0xed')]){_0x151782['createStateFinal'](_0x219ccb,_0x3979d2,_0x5b58ca,_0x9efb('0x1b4'));}else{_0x151782[_0x9efb('0x125')](_0x219ccb,_0x3979d2,_0x5b58ca,'reason\x2011\x20abandoned');}}break;case'20':_0x18571[_0x9efb('0x1b5')]+=0x1;_0x219ccb['state']=0x14;_0x219ccb[_0x9efb('0xcf')]=_0x9efb('0x1b6');_0x219ccb[_0x9efb('0x123')]+=0x1;_0x219ccb[_0x9efb('0xea')]+=0x1;_0x354926=_0x18571[_0x9efb('0x198')];_0x515345=_0x18571[_0x9efb('0xd3')];ami[_0x9efb('0x41')](_0x9efb('0x1b7'),ut[_0x9efb('0x119')](_0x12b26c,_0x9efb('0x1b8')));hopperUtils[_0x9efb('0xc7')](_0x219ccb)[_0x9efb('0x9e')](loggerCatch(_0x9efb('0x1b9')));if(_0x151782[_0x9efb('0x18f')](0x14,_0x12b26c,_0x18571)&&!_0x3cc409){if(_0x219ccb[_0x9efb('0x123')]>=_0x18571[_0x9efb('0x197')]){_0x151782['createStateFinal'](_0x219ccb,_0x3979d2,_0x5b58ca,'reason\x2020\x20agentreject');}else{_0x151782['stateGlobal'](_0x219ccb,_0x3979d2,_0x5b58ca,'reason\x2020\x20agentreject');}}break;default:_0x18571[_0x9efb('0x138')]+=0x1;_0x219ccb[_0x9efb('0xd5')]=0xc;_0x219ccb[_0x9efb('0xcf')]=_0x58c3fa['reason'];_0x354926=_0x18571[_0x9efb('0x198')];_0x515345=_0x18571['callAdditionalPhoneAfterMin'];hopperUtils['createHistory'](_0x219ccb)[_0x9efb('0x9e')](loggerCatch(_0x9efb('0x1ba')));if(_0x151782[_0x9efb('0x18f')](_0x58c3fa[_0x9efb('0xc2')],_0x12b26c,_0x18571)&&!_0x3cc409){if(_0x219ccb[_0x9efb('0x12e')]+_0x219ccb['countcongestionretry']+_0x219ccb[_0x9efb('0x130')]+_0x219ccb[_0x9efb('0x121')]+_0x219ccb[_0x9efb('0xda')]+_0x219ccb[_0x9efb('0xe9')]+_0x219ccb[_0x9efb('0x122')]+_0x219ccb[_0x9efb('0x123')]>=_0x18571[_0x9efb('0x124')]){_0x151782[_0x9efb('0x125')](_0x219ccb,_0x3979d2,_0x5b58ca,_0x58c3fa['reason']);}else{_0x151782['createStateFinal'](_0x219ccb,_0x3979d2,_0x5b58ca,_0x58c3fa[_0x9efb('0xc2')]);}}}})[_0x9efb('0x9a')](function(){if(_0x3cc409){hopperUtils['swapAdditionalPhones'](_0x219ccb,_0x354926,_0x515345)['then'](function(){return _0x3979d2(0x1);});}});});};Dialer[_0x9efb('0x85')][_0x9efb('0x125')]=function(_0x25e903,_0x2e6e66,_0x2d5b78,_0x1802a0){var _0x14f87e=new Final(_0x25e903);_0x14f87e[_0x9efb('0xd5')]=0xf;_0x14f87e[_0x9efb('0xcf')]=_0x9efb('0x1bb');this[_0x9efb('0x127')](_0x14f87e,_0x2e6e66,_0x2d5b78,_0x1802a0);};Dialer[_0x9efb('0x85')]['createStateFinal']=function(_0x4c0327,_0x10f844,_0x30e816,_0x409132){hopperUtils[_0x9efb('0xc9')](_0x4c0327)[_0x9efb('0x9a')](function(){return _0x10f844(msgResponse(_0x9efb('0x19b'),_0x9efb('0x10d'),_0x409132));})[_0x9efb('0x9e')](function(){return _0x30e816(msgResponse(_0x9efb('0x1bc'),_0x9efb('0x8d'),'contact\x20not\x20moved'));});};Dialer['prototype'][_0x9efb('0xb')]=function(_0x31ec59){var _0x4d0a88=_0x31ec59[_0x9efb('0x1bd')]/0x64;var _0x39bb58=_0x31ec59[_0x9efb('0xcd')]/(_0x31ec59[_0x9efb('0xcd')]+_0x31ec59[_0x9efb('0xc1')]);var _0x5172a8=Math[_0x9efb('0x1be')](_0x31ec59[_0x9efb('0x1bf')]*(_0x31ec59[_0x9efb('0x1c0')]/0x64));var _0x557fa7=Math[_0x9efb('0x1be')](_0x31ec59[_0x9efb('0x1bf')]*(_0x31ec59[_0x9efb('0x1c1')]/0x64));var _0x3ddee2=_0x31ec59[_0x9efb('0x13f')]+_0x31ec59['talking'];var _0x10896e=Math[_0x9efb('0x1c2')](_0x31ec59[_0x9efb('0x1c3')]*_0x31ec59[_0x9efb('0x5a')]*_0x31ec59[_0x9efb('0x1c4')]*_0x31ec59[_0x9efb('0x1c5')]);if(_[_0x9efb('0x40')](_0x31ec59['startProgressive'])){if(!_[_0x9efb('0x40')](_0x31ec59['startPredictive'])){_0x31ec59[_0x9efb('0x28')]=undefined;loggerPredictive[_0x9efb('0x61')](_0x9efb('0x1c6'),_0x9efb('0x1c7'));}if(!_[_0x9efb('0x40')](_0x31ec59[_0x9efb('0x5f')])){loggerPredictive[_0x9efb('0x61')](_0x9efb('0x1c6'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x31ec59[_0x9efb('0x5f')]);_0x31ec59[_0x9efb('0x5f')]=undefined;}_0x31ec59[_0x9efb('0x29')]=moment()['format'](_0x9efb('0xbf'));loggerPredictive['info'](_0x31ec59['name'],_0x9efb('0x1c8'),_0x31ec59[_0x9efb('0x29')]);this[_0x9efb('0xad')](_0x31ec59,0x1);}else if(ifInterval(_0x31ec59[_0x9efb('0x1c9')],_0x31ec59[_0x9efb('0x29')])){this[_0x9efb('0xad')](_0x31ec59,0x1);loggerPredictiveCalls[_0x9efb('0x48')](_0x9efb('0x1ca'),_0x31ec59['startProgressive'],_0x31ec59[_0x9efb('0x46')]);_0x31ec59['erlangCalls']=0x0;_0x31ec59[_0x9efb('0xce')]=0x0;}else if(_0x4d0a88<_0x39bb58&&_0x31ec59[_0x9efb('0x1cb')]==='dropRate'){clearPredictiveAttributes(_0x31ec59);loggerPredictive['info'](_0x9efb('0x1cc'),'Dropped\x20calls\x20day',_0x39bb58,'startProgressive',_0x31ec59['name']);}else if(_0x10896e<_0x31ec59[_0x9efb('0xce')]&&_0x31ec59[_0x9efb('0x1cb')]===_0x9efb('0x1cd')){clearPredictiveAttributes(_0x31ec59);loggerPredictive['info'](_0x9efb('0x1ce'),'Max\x20Drop\x20',_0x10896e,_0x9efb('0x1cf'),_0x31ec59['predictiveIntervalErlangCallsDroppedCalls'],_0x9efb('0x29'),_0x31ec59[_0x9efb('0x46')]);}else if(!ifInterval(_0x31ec59[_0x9efb('0x1c9')],_0x31ec59['startProgressive'])&&_[_0x9efb('0x40')](_0x31ec59['startPredictive'])&&!_[_0x9efb('0x40')](_0x31ec59[_0x9efb('0x29')])){_0x31ec59[_0x9efb('0x28')]=moment()[_0x9efb('0x44')](_0x9efb('0xbf'));loggerPredictive[_0x9efb('0x48')](_0x31ec59[_0x9efb('0x46')],'started\x20in\x20predictive\x20at',_0x31ec59['startPredictive']);hopperUtils['avgHandleTime'](_0x31ec59[_0x9efb('0x1c9')])[_0x9efb('0x9a')](this['getDataPredictive'](_0x31ec59))['then'](mergeDataErlangB(_0x31ec59))[_0x9efb('0x9a')](this[_0x9efb('0x1d0')](_0x31ec59))['catch'](loggerCatchPredictive(_0x9efb('0x1d1'),_0x31ec59));}else if(!ifInterval(_0x31ec59[_0x9efb('0x1c9')],_0x31ec59[_0x9efb('0x28')])){_0x31ec59[_0x9efb('0xce')]=0x0;_0x31ec59[_0x9efb('0x28')]=moment()[_0x9efb('0x44')](_0x9efb('0xbf'));loggerPredictive[_0x9efb('0x48')](_0x31ec59['name'],_0x9efb('0x1d2'),_0x31ec59[_0x9efb('0x28')]);clearInterval(_0x31ec59[_0x9efb('0x5f')]);_0x31ec59['handlePredictive']=undefined;hopperUtils[_0x9efb('0x1d3')](_0x31ec59['dialPredictiveInterval'])['then'](this[_0x9efb('0x1d4')](_0x31ec59))[_0x9efb('0x9a')](mergeDataErlangB(_0x31ec59))[_0x9efb('0x9a')](this[_0x9efb('0x1d0')](_0x31ec59))['catch'](loggerCatchPredictive(_0x9efb('0x1d5'),_0x31ec59));}else if(_0x31ec59[_0x9efb('0x1bf')]&&_0x3ddee2<_0x31ec59[_0x9efb('0x1bf')]-_0x557fa7){clearPredictiveAttributes(_0x31ec59);loggerPredictive['info'](_0x31ec59[_0x9efb('0x46')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x3ddee2,_0x9efb('0x1d6'),_0x31ec59[_0x9efb('0x1bf')],'-',_0x557fa7,'=',_0x31ec59['predictiveIntervalAvailable']-_0x557fa7,')');}else if(_0x31ec59['predictiveIntervalAvailable']&&_0x3ddee2>_0x31ec59[_0x9efb('0x1bf')]+_0x5172a8){clearPredictiveAttributes(_0x31ec59);loggerPredictive[_0x9efb('0x48')](_0x31ec59['name'],_0x9efb('0x1d7'),_0x3ddee2,_0x9efb('0x1d8'),_0x31ec59[_0x9efb('0x1bf')],'+',_0x5172a8,'=',_0x31ec59[_0x9efb('0x1bf')]+_0x5172a8,')');}};Dialer[_0x9efb('0x85')][_0x9efb('0x1d4')]=function(_0x16c786){var _0x2f2441=this;return function(_0x5c49e0){return new Promise(function(_0x5bd79e,_0x70e4ec){_['merge'](_0x16c786,_0x5c49e0[0x0]);if(checkGetDataPredictive(_0x5c49e0[0x0])){var _0x17022e=_0x16c786[_0x9efb('0x1bf')]=_0x16c786[_0x9efb('0x141')]+_0x16c786[_0x9efb('0x13f')];var _0x330e7=_0x16c786[_0x9efb('0x1c9')]*0x3c;var _0x43813b=_0x5c49e0[0x0][_0x9efb('0x4f')]+_0x5c49e0[0x0][_0x9efb('0x51')];var _0x53ca47=(_0x5c49e0[0x0]['predictiveIntervalAnsweredCalls']+_0x5c49e0[0x0][_0x9efb('0x4e')]+_0x5c49e0[0x0][_0x9efb('0xe6')])/_0x5c49e0[0x0][_0x9efb('0x4a')];_0x16c786['predictiveIntervalHitRate']=_0x53ca47>0x0?_0x53ca47:0x1;switch(_0x16c786[_0x9efb('0x1cb')]){case'dropRate':var _0xec843e=_0x16c786[_0x9efb('0x1bd')]/0x64;return _0x2f2441[_0x9efb('0x1d9')](_0x17022e,_0x330e7,_0x43813b,_0x53ca47,_0xec843e)['then'](function(_0x21e1b2){return _0x5bd79e(_0x21e1b2);});case _0x9efb('0x1da'):var _0x1df65d=_0x16c786[_0x9efb('0x1bd')]/0x64;return _0x2f2441['busyFactor'](_0x17022e,_0x330e7,_0x43813b,_0x53ca47,_0x1df65d)[_0x9efb('0x9a')](function(_0x406423){return _0x5bd79e(_0x406423);});default:return _0x70e4ec(msgResponse(_0x9efb('0x1db'),'Failure',_0x9efb('0x1dc')));}}else{return _0x70e4ec(msgResponse(_0x9efb('0x1db'),'Failure','check\x20failure'));}});};};Dialer[_0x9efb('0x85')][_0x9efb('0x1dd')]=function(_0x168b2f){var _0xa17bdf=this;return function(_0x5e60ca){return new Promise(function(_0x57ea30,_0x4aad4d){_[_0x9efb('0x5c')](_0x168b2f,_0x5e60ca[0x0]);if(checkGetDataPredictive(_0x5e60ca[0x0])){loggerPredictive[_0x9efb('0x48')](JSON[_0x9efb('0x7e')](_0x5e60ca[0x0]));if(_0x168b2f[_0x9efb('0x1cb')]==='dropRate'){return _0xa17bdf[_0x9efb('0x154')](_0x168b2f['id'])[_0x9efb('0x9a')](function(_0xd2f1ac){var _0x19635c=_0x168b2f[_0x9efb('0x1de')]-_0xd2f1ac[0x0][_0x9efb('0x1df')];var _0x368b02=_0x168b2f[_0x9efb('0x1c9')]*0x3c;var _0xd70e8c=_0x5e60ca[0x0][_0x9efb('0x4f')]+_0x5e60ca[0x0][_0x9efb('0x51')];var _0x4b0da0=(_0x5e60ca[0x0]['predictiveIntervalAnsweredCalls']+_0x5e60ca[0x0][_0x9efb('0x4e')]+_0x5e60ca[0x0][_0x9efb('0xe6')])/_0x5e60ca[0x0][_0x9efb('0x4a')];var _0x456e57=_0x168b2f['dialPredictiveOptimizationPercentage']/0x64;_0x168b2f[_0x9efb('0x1e0')]=_0xd2f1ac[0x0]['outboundQueuePauses']||0x0;_0x168b2f['predictiveIntervalHitRate']=_0x4b0da0>0x0?_0x4b0da0:0x1;return _0xa17bdf[_0x9efb('0x1d9')](_0x19635c,_0x368b02,_0xd70e8c,_0x4b0da0,_0x456e57);})[_0x9efb('0x9a')](function(_0x21fda6){return _0x57ea30(_0x21fda6);})[_0x9efb('0x9e')](function(_0x8e2b26){return _0x4aad4d(msgResponse(_0x9efb('0x1e1'),'Failure',JSON[_0x9efb('0x7e')](_0x8e2b26)));});}if(_0x168b2f[_0x9efb('0x1cb')]===_0x9efb('0x1da')){return _0xa17bdf[_0x9efb('0x154')](_0x168b2f['id'])['then'](function(_0x3542fa){var _0x4971e7=_0x168b2f['loggedIn']-_0x3542fa[0x0]['outboundQueuePauses'];var _0x485bb6=_0x168b2f[_0x9efb('0x1c9')]*0x3c;var _0x5a7d1e=_0x5e60ca[0x0][_0x9efb('0x4f')]+_0x5e60ca[0x0]['predictiveIntervalAvgHoldtime'];var _0xd3f909=(_0x5e60ca[0x0][_0x9efb('0x4c')]+_0x5e60ca[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x5e60ca[0x0][_0x9efb('0xe6')])/_0x5e60ca[0x0][_0x9efb('0x4a')];var _0x3d13cc=_0x168b2f['dialPredictiveOptimizationPercentage']/0x64;_0x168b2f[_0x9efb('0x1e0')]=_0x3542fa[0x0]['outboundQueuePauses']||0x0;_0x168b2f['predictiveIntervalHitRate']=_0xd3f909>0x0?_0xd3f909:0x1;return _0xa17bdf[_0x9efb('0x1e2')](_0x4971e7,_0x485bb6,_0x5a7d1e,_0xd3f909,_0x3d13cc);})[_0x9efb('0x9a')](function(_0x3c9f4d){return _0x57ea30(_0x3c9f4d);})[_0x9efb('0x9e')](function(_0x4bd5ae){return _0x4aad4d(msgResponse('[CatchErlangB]',_0x9efb('0x8d'),JSON['stringify'](_0x4bd5ae)));});}}else{return _0x4aad4d(msgResponse(_0x9efb('0x1db'),'Failure','check\x20failure'));}});};};Dialer[_0x9efb('0x85')][_0x9efb('0x1d0')]=function(_0x56bc74){var _0x68cc7d=this;return function(){var _0x308ad7=0x0;var _0xeaf8f5=Math[_0x9efb('0x1c2')](_0x56bc74[_0x9efb('0x57')]*0x3e8);if(_0xeaf8f5>0x0){_0xeaf8f5=_0xeaf8f5<0x64?0x64:_0xeaf8f5;loggerPredictive[_0x9efb('0x48')](_0x56bc74[_0x9efb('0x46')],_0x9efb('0x1e3'),_0xeaf8f5,_0x9efb('0x1e4'));_0x56bc74[_0x9efb('0x5f')]=setInterval(function(){_0x68cc7d[_0x9efb('0x5f')](_0x56bc74);loggerPredictiveCalls[_0x9efb('0x48')]('[handlePredictive]',_0x308ad7+=0x1);},_0xeaf8f5);}else{loggerPredictive[_0x9efb('0x48')](_0x56bc74[_0x9efb('0x46')],_0x9efb('0x1e5'));}};};Dialer['prototype'][_0x9efb('0x1e6')]=function(_0x633981,_0x2665ff){var _0x54d0b7=this;return function(_0x58c27d){if(_[_0x9efb('0x73')](_0x58c27d)){if(_['isNil'](_0x2665ff[_0x9efb('0x15a')])||!_0x2665ff[_0x9efb('0x1e7')]){if(_0x633981[_0x9efb('0xab')]===_0x9efb('0xa')){_0x633981[_0x9efb('0x6b')]=_[_0x9efb('0x40')](_0x633981['queueStatusComplete'])?!![]:_0x633981[_0x9efb('0x6b')];var _0x5e7ce2=uuid['v4']();_0x54d0b7['actions'][_0x5e7ce2]=new Action(_0x633981,_0x2665ff,_0x5e7ce2);loggerBooked[_0x9efb('0x48')](_0x9efb('0x1e8'),_0x5e7ce2,'queueStatusComplete:\x20',JSON[_0x9efb('0x7e')](_0x633981['queueStatusComplete']),_0x9efb('0x1e9'),_0x633981['name']);if(_0x633981[_0x9efb('0x6b')]){_0x633981[_0x9efb('0x6b')]=![];_0x54d0b7[_0x9efb('0x2a')][_0x54d0b7['actions'][_0x5e7ce2][_0x9efb('0xb9')]]=[];ami[_0x9efb('0x96')]({'actionid':_0x5e7ce2,'action':'queuestatus','queue':_0x633981[_0x9efb('0x46')]})[_0x9efb('0x9e')](function(){_0x54d0b7[_0x9efb('0xbd')](_0x633981);hopperUtils[_0x9efb('0xd9')]({'active':![],'ContactId':_0x54d0b7['actions'][_0x5e7ce2][_0x9efb('0xdc')],'ListId':_0x54d0b7[_0x9efb('0x25')][_0x5e7ce2][_0x9efb('0xdd')],'VoiceQueueId':_0x54d0b7[_0x9efb('0x25')][_0x5e7ce2][_0x9efb('0xde')]||undefined,'CampaignId':_0x54d0b7['actions'][_0x5e7ce2][_0x9efb('0xdf')]||undefined})['catch'](loggerCatch(_0x9efb('0x1ea')));delete _0x54d0b7[_0x9efb('0x25')][_0x5e7ce2];});}else{loggerBooked[_0x9efb('0x48')](_0x9efb('0x1eb'),JSON[_0x9efb('0x7e')](_0x633981[_0x9efb('0x6b')]),_0x9efb('0x1e9'),_0x633981[_0x9efb('0x46')]);_0x54d0b7[_0x9efb('0xbd')](_0x633981);hopperUtils[_0x9efb('0xd9')]({'active':![],'ContactId':_0x54d0b7[_0x9efb('0x25')][_0x5e7ce2][_0x9efb('0xdc')],'ListId':_0x54d0b7[_0x9efb('0x25')][_0x5e7ce2][_0x9efb('0xdd')],'VoiceQueueId':_0x54d0b7[_0x9efb('0x25')][_0x5e7ce2][_0x9efb('0xde')]||undefined,'CampaignId':_0x54d0b7[_0x9efb('0x25')][_0x5e7ce2][_0x9efb('0xdf')]||undefined})[_0x9efb('0x9e')](loggerCatch(_0x9efb('0x1ea')));delete _0x54d0b7[_0x9efb('0x25')][_0x5e7ce2];}}else{return _0x54d0b7[_0x9efb('0x15e')](_0x633981,_0x2665ff);}}else{if(utils[_0x9efb('0x5d')](undefined,_0x2665ff[_0x9efb('0x1ec')])<_0x633981[_0x9efb('0x1ed')]*0x3c){if(_0x2665ff[_0x9efb('0x14c')]&&!_0x2665ff[_0x9efb('0x14c')][_0x9efb('0x1ee')]){_0x54d0b7[_0x9efb('0x1f')][_0x9efb('0xfa')](_0x2665ff['id'])[_0x9efb('0x1e')](function(){_0x54d0b7[_0x9efb('0xbd')](_0x633981);});}else{hopperUtils[_0x9efb('0x1ef')]({'active':![]},_0x2665ff['id'],0x1)[_0x9efb('0x1e')](function(){_0x54d0b7[_0x9efb('0xbd')](_0x633981);});}}else{_0x633981[_0x9efb('0x1f0')]+=0x1;_0x54d0b7[_0x9efb('0xbd')](_0x633981);if(_0x633981[_0x9efb('0x1f1')]){hopperUtils[_0x9efb('0xd9')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x2665ff['ContactId'],'ListId':_0x2665ff[_0x9efb('0xdd')],'VoiceQueueId':_0x2665ff[_0x9efb('0xde')]||undefined,'CampaignId':_0x2665ff[_0x9efb('0xdf')]||undefined})[_0x9efb('0x9e')](loggerCatch(_0x9efb('0x1f2')));hopperUtils[_0x9efb('0xc7')](createObjHistory(_0x633981,_0x2665ff,utils['CAMPAIGN_STATUS']['QUEUE_RECALL'],0x17,_0x9efb('0x1f3')))['catch'](loggerCatch(_0x9efb('0x1f4')));}else{_0x54d0b7[_0x9efb('0x11a')](createObjHistory(_0x633981,_0x2665ff,utils['CAMPAIGN_STATUS'][_0x9efb('0x1f5')],0x16,_0x9efb('0x1f6')),_0x9efb('0x1f7'),_0x9efb('0x1f8'));}}}}else{_0x633981['outboundBlacklistCallsDay']+=0x1;_0x54d0b7[_0x9efb('0x11a')](createObjHistory(_0x633981,_0x2665ff,utils[_0x9efb('0x67')]['BLACKLIST'],0xd,_0x9efb('0x1f9')),_0x9efb('0x1fa'),_0x9efb('0x1fb'));throw'inBlackList';}};};Dialer[_0x9efb('0x85')][_0x9efb('0x1fc')]=function(_0x297e4b){var _0x2e6d40=this;var _0x3aed8f=_0x297e4b[_0x9efb('0x1fd')]-_0x297e4b[_0x9efb('0x7a')];emitCampaignSummary(_0x297e4b);if(_0x3aed8f>0x0&&_0x297e4b[_0x9efb('0x1fe')]==0x0){if(_0x3aed8f>this[_0x9efb('0x23')]){_0x3aed8f=this[_0x9efb('0x23')];}_0x297e4b[_0x9efb('0x1fe')]=0x1;hopperUtils[_0x9efb('0x1ff')](_0x297e4b,_0x3aed8f)[_0x9efb('0x9a')](function(_0x4b5a96){_0x297e4b[_0x9efb('0x1fe')]=0x0;if(_0x4b5a96){if(!utils[_0x9efb('0x200')](_0x4b5a96)){_0x297e4b[_0x9efb('0x6f')]=utils['CAMPAIGN_STATUS']['NO_AVAILABLE_CONTACTS'];logger[_0x9efb('0x48')]('[getContactCampaign2][Empty]'+_0x297e4b[_0x9efb('0x46')]);}else{_0x297e4b['originated']+=_0x4b5a96[_0x9efb('0x95')];_0x297e4b['message']=utils[_0x9efb('0x67')]['RUNNING'];for(var _0x3db59b=0x0;_0x3db59b<_0x4b5a96[_0x9efb('0x95')];_0x3db59b+=0x1){_0x297e4b['ivrTotalCallsDays']+=0x1;if(_['isNil'](_0x4b5a96[_0x3db59b])||_[_0x9efb('0xf4')](_0x4b5a96[_0x3db59b][_0x9efb('0x179')])||_[_0x9efb('0xf4')](_0x4b5a96[_0x3db59b]['phone'])){_0x2e6d40[_0x9efb('0x158')](_0x9efb('0x201'),_0x297e4b,_0x4b5a96[_0x3db59b]);}else{hopperUtils[_0x9efb('0x202')](_[_0x9efb('0x6d')](_0x4b5a96[_0x3db59b],[_0x9efb('0xdf'),_0x9efb('0x161')]))['then'](_0x2e6d40['checkContactBlack'](_0x297e4b,_0x4b5a96[_0x3db59b]))['catch'](_0x2e6d40[_0x9efb('0x203')](_0x9efb('0x204'),_0x297e4b));}}}}})['catch'](loggerGetContactDialer(_0x9efb('0x205'),_0x297e4b,_0x3aed8f));}};Dialer['prototype'][_0x9efb('0xad')]=function(_0x5befcb,_0x575bda){var _0x5139ab=this;var _0x476b3b=[];if(_0x575bda<0x1||_0x5befcb[_0x9efb('0xab')]==='booked'){_0x575bda=0x1;}var _0x59b85d=Math['floor'](_0x5befcb[_0x9efb('0x13f')]*_0x575bda)-_0x5befcb[_0x9efb('0x7a')];if(_0x5befcb[_0x9efb('0x206')]>0x0){var _0x28561a=_0x5befcb['dialLimitQueue']-_0x5befcb[_0x9efb('0x7a')]-_0x5befcb['talking']-_0x5befcb[_0x9efb('0x207')];if(_0x59b85d>_0x28561a){_0x59b85d=_0x28561a;}}if(_0x59b85d>0x0&&_0x5befcb[_0x9efb('0x1fe')]==0x0){if(_0x5befcb['dialMethod']==='booked'){_0x59b85d=0x1;}if(_0x59b85d>this[_0x9efb('0x23')]){_0x59b85d=this['maxNumberOriginate'];}for(var _0x29b70f in this['agents']){if(typeof this['agents'][_0x29b70f]!==_0x9efb('0x155')){if(this[_0x9efb('0xf6')][_0x29b70f][_0x9efb('0xd5')]===_0x9efb('0x208')&&this[_0x9efb('0xf6')][_0x29b70f][_0x9efb('0x81')]==='reachable'){_0x476b3b[_0x9efb('0x9d')](this[_0x9efb('0xf6')][_0x29b70f]['id']);}}}_0x5befcb[_0x9efb('0x1fe')]=0x1;hopperUtils['getContactDialer'](_0x5befcb,_0x476b3b,_0x59b85d)[_0x9efb('0x9a')](function(_0x110040){_0x5befcb[_0x9efb('0x1fe')]=0x0;if(_0x110040){if(!utils[_0x9efb('0x200')](_0x110040)){hopperUtils[_0x9efb('0x209')](_0x5befcb)['then'](sendMessageReschedule(_0x5befcb))['catch'](loggerCatch(_0x9efb('0x20a')));}else{_0x5befcb['originated']+=_0x110040[_0x9efb('0x95')];_0x5befcb[_0x9efb('0x6f')]=_0x5befcb['dialMethod']===_0x9efb('0xa')?utils[_0x9efb('0x67')][_0x9efb('0x142')]:utils[_0x9efb('0x67')][_0x9efb('0x20b')];for(var _0x5b9e10=0x0;_0x5b9e10<_0x110040['length'];_0x5b9e10+=0x1){if(_[_0x9efb('0xf4')](_0x110040[_0x5b9e10])||_[_0x9efb('0xf4')](_0x110040[_0x5b9e10][_0x9efb('0x179')])||_[_0x9efb('0xf4')](_0x110040[_0x5b9e10][_0x9efb('0x161')])){_0x5139ab['emptyContact']('[actionOriginate]\x20',_0x5befcb,_0x110040[_0x5b9e10]);}else{hopperUtils[_0x9efb('0x20c')](_[_0x9efb('0x6d')](_0x110040[_0x5b9e10],[_0x9efb('0xde'),_0x9efb('0x161')]))[_0x9efb('0x9a')](_0x5139ab[_0x9efb('0x1e6')](_0x5befcb,_0x110040[_0x5b9e10]))['catch'](_0x5139ab[_0x9efb('0x203')](_0x9efb('0x201'),_0x5befcb));}}}}})['catch'](loggerGetContactDialer(_0x9efb('0x20d'),_0x5befcb,_0x59b85d));}};Dialer[_0x9efb('0x85')][_0x9efb('0x5f')]=function(_0x2dc466){if(_0x2dc466['dialLimitQueue']>0x0){var _0x4398b2=_0x2dc466['dialLimitQueue']-_0x2dc466[_0x9efb('0x7a')]-_0x2dc466[_0x9efb('0x141')];if(_0x4398b2>0x0&&_0x2dc466['temp']==0x0){this[_0x9efb('0x20e')](_0x2dc466);}else{loggerPredictiveCalls[_0x9efb('0x48')]('[handlePredictive][limitChannel]');}}else{this[_0x9efb('0x20e')](_0x2dc466);}};Dialer['prototype'][_0x9efb('0x20e')]=function(_0x27424f){var _0x1987dc=this;var _0x52c0e5=[];_0x27424f[_0x9efb('0x7a')]+=0x1;for(var _0x7816b4 in this[_0x9efb('0xf6')]){if(typeof this[_0x9efb('0xf6')][_0x7816b4]!==_0x9efb('0x155')){if(this[_0x9efb('0xf6')][_0x7816b4][_0x9efb('0xd5')]===_0x9efb('0x208')&&this[_0x9efb('0xf6')][_0x7816b4]['status']===_0x9efb('0x82')){_0x52c0e5['push'](this[_0x9efb('0xf6')][_0x7816b4]['id']);}}}_0x27424f[_0x9efb('0x1fe')]=0x1;return this['getContactDialer'](_0x27424f['id'],_0x52c0e5,0x1,_0x27424f['dialOrderByScheduledAt'],_0x27424f)[_0x9efb('0x9a')](function(_0xa4fe95){_0x27424f[_0x9efb('0x1fe')]=0x1;if(_0xa4fe95){if(!utils['checkContactEmpty'](_0xa4fe95)){utils['checkContactLowerLimitOriginate'](_0x27424f,0x1,0x0);return hopperUtils[_0x9efb('0x209')](_0x27424f)['then'](sendMessageReschedule(_0x27424f))[_0x9efb('0x9e')](loggerCatch(_0x9efb('0x20a')));}else{_0x27424f['message']=utils['CAMPAIGN_STATUS'][_0x9efb('0x20b')];if(_[_0x9efb('0xf4')](_0xa4fe95[0x0])||_[_0x9efb('0xf4')](_0xa4fe95[0x0][_0x9efb('0x179')])||_['isNil'](_0xa4fe95[0x0][_0x9efb('0x161')])){_0x1987dc['emptyContact'](_0x9efb('0x201'),_0x27424f,_0xa4fe95[0x0]);}else{return hopperUtils[_0x9efb('0x20c')](_[_0x9efb('0x6d')](_0xa4fe95[0x0],[_0x9efb('0xde'),_0x9efb('0x161')]))['then'](_0x1987dc[_0x9efb('0x1e6')](_0x27424f,_0xa4fe95[0x0]))[_0x9efb('0x9e')](_0x1987dc[_0x9efb('0x203')](_0x9efb('0x20f'),_0x27424f));}}}})[_0x9efb('0x9e')](loggerGetContactDialer(_0x9efb('0x210'),_0x27424f,0x1));};Dialer[_0x9efb('0x85')][_0x9efb('0x1d9')]=function(_0x255171,_0x517451,_0x80cd59,_0x5b0276,_0x2f0297,_0x1c9fc4){loggerPredictive[_0x9efb('0x48')](_0x9efb('0x211'));loggerPredictive[_0x9efb('0x48')](_0x9efb('0x212'),_0x255171);loggerPredictive['info'](_0x9efb('0x213'),_0x517451);loggerPredictive['info'](_0x9efb('0x214'),_0x80cd59);loggerPredictive['info'](_0x9efb('0x215'),_0x5b0276);loggerPredictive[_0x9efb('0x48')](_0x9efb('0x216'),_0x2f0297);loggerPredictive[_0x9efb('0x48')]('---------------------------');return new Promise(function(_0x2be95d,_0x55367d){if(_0x255171<=0x0||isNaN(_0x255171)){return _0x55367d(msgResponse('[abandonmentRate]','Error',_0x9efb('0x217')+_0x255171));}if(_0x80cd59<=0x0||isNaN(_0x80cd59)){return _0x55367d(msgResponse(_0x9efb('0x218'),_0x9efb('0x18d'),_0x9efb('0x219')+_0x80cd59));}if(_0x5b0276<=0x0||isNaN(_0x5b0276)){return _0x55367d(msgResponse(_0x9efb('0x218'),'Error',_0x9efb('0x21a')+_0x5b0276));}if(_0x517451<=0x0||isNaN(_0x517451)){return _0x55367d(msgResponse('[abandonmentRate]','Error',_0x9efb('0x21b')+_0x517451));}if(_0x2f0297<=0x0||isNaN(_0x2f0297)){return _0x55367d(msgResponse(_0x9efb('0x218'),'Error',_0x9efb('0x21c')+_0x2f0297));}_0x1c9fc4=_0x1c9fc4||0x0;var _0x49d57f=0x1/_0x80cd59;var _0x460c7d=0x0;var _0x452242=0x0;var _0x3001fa=0x0;var _0x3fcc80=0x0;for(var _0x587df0=0x0;_0x3001fa<_0x2f0297;_0x587df0+=0x1){_0x452242=_0x587df0/_0x517451;_0x460c7d=(_0x5b0276*_0x452242+_0x1c9fc4)/_0x49d57f;_0x3001fa=utils[_0x9efb('0x21d')](_0x460c7d,_0x255171);_0x3fcc80=_0x460c7d/_0x255171*(0x1-utils['erlangb'](_0x460c7d,_0x255171));}return _0x2be95d({'erlangCalls':_0x587df0,'erlangCallToSecond':_0x517451/_0x587df0,'erlangAbandonmentRate':_0x3001fa,'erlangBusyFactor':_0x3fcc80});});};Dialer[_0x9efb('0x85')][_0x9efb('0x1e2')]=function(_0x48dcc7,_0x1ddefc,_0x341213,_0x18a8d0,_0x4b9596,_0xac66d0){loggerPredictive[_0x9efb('0x48')](_0x9efb('0x21e'));loggerPredictive[_0x9efb('0x48')](_0x9efb('0x212'),_0x48dcc7);loggerPredictive[_0x9efb('0x48')](_0x9efb('0x213'),_0x1ddefc);loggerPredictive[_0x9efb('0x48')](_0x9efb('0x214'),_0x341213);loggerPredictive[_0x9efb('0x48')]('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x18a8d0);loggerPredictive[_0x9efb('0x48')](_0x9efb('0x21f'),_0x4b9596);loggerPredictive[_0x9efb('0x48')](_0x9efb('0x5b'));return new Promise(function(_0x566da2,_0x151c36){if(_0x48dcc7<=0x0||isNaN(_0x48dcc7)){return _0x151c36(msgResponse('[busyFactor]',_0x9efb('0x18d'),_0x9efb('0x217')+_0x48dcc7));}if(_0x341213<=0x0||isNaN(_0x341213)){return _0x151c36(msgResponse('[busyFactor]',_0x9efb('0x18d'),_0x9efb('0x219')+_0x341213));}if(_0x18a8d0<=0x0||isNaN(_0x18a8d0)){return _0x151c36(msgResponse(_0x9efb('0x220'),_0x9efb('0x18d'),_0x9efb('0x21a')+_0x18a8d0));}if(_0x1ddefc<=0x0||isNaN(_0x1ddefc)){return _0x151c36(msgResponse(_0x9efb('0x220'),_0x9efb('0x18d'),'interval\x20=\x20'+_0x1ddefc));}if(_0x4b9596<=0x0||isNaN(_0x4b9596)){return _0x151c36(msgResponse(_0x9efb('0x220'),_0x9efb('0x18d'),_0x9efb('0x221')+_0x4b9596));}_0xac66d0=_0xac66d0||0x0;var _0x30a723=0x1/_0x341213;var _0x180bbb=0x0;var _0x1d3bf0=0x0;var _0x94a2a=0x0;var _0x2a0f0b=0x0;for(var _0x36ad63=0x0;_0x2a0f0b<_0x4b9596;_0x36ad63+=0x1){_0x1d3bf0=_0x36ad63/_0x1ddefc;_0x180bbb=(_0x18a8d0*_0x1d3bf0+_0xac66d0)/_0x30a723;_0x94a2a=utils['erlangb'](_0x180bbb,_0x48dcc7);_0x2a0f0b=_0x180bbb/_0x48dcc7*(0x1-utils['erlangb'](_0x180bbb,_0x48dcc7));}return _0x566da2({'erlangCalls':_0x36ad63,'erlangCallToSecond':_0x1ddefc/_0x36ad63,'erlangAbandonmentRate':_0x94a2a,'erlangBusyFactor':_0x2a0f0b});});};module['exports']=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/models/action.js b/server/services/ami/dialer/models/action.js index 969e33a..d7bd70f 100644 --- a/server/services/ami/dialer/models/action.js +++ b/server/services/ami/dialer/models/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x900f=['countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','exports','isNil','string','voiceQueue','uniqueid','phone','Contact','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x37d798,_0x483c95){var _0x402b46=function(_0x458651){while(--_0x458651){_0x37d798['push'](_0x37d798['shift']());}};_0x402b46(++_0x483c95);}(_0x900f,0x9b));var _0xf900=function(_0x2b9120,_0x4cba82){_0x2b9120=_0x2b9120-0x0;var _0x459db0=_0x900f[_0x2b9120];return _0x459db0;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x2ecdbf,_0x3442a9,_0x1ba209){var _0x518258='';if(!_[_0xf900('0x0')](_0x3442a9)&&_0xf900('0x1')===typeof _0x3442a9){_0x518258+=_0x3442a9;}if(!_['isNil'](_0x1ba209)&&_0xf900('0x1')===typeof _0x1ba209){_0x518258+='\x20'+_0x1ba209;}if(_0x518258!==''){return _0x518258;}return _0x2ecdbf;}function Action(_0x524697,_0x5a177f,_0x4bacd1){this[_0xf900('0x2')]=_0x524697;this[_0xf900('0x3')]=_0x4bacd1||undefined;this['name']=checkNameSurname(_0x5a177f['Contact'][_0xf900('0x4')],_0x5a177f[_0xf900('0x5')][_0xf900('0x6')],_0x5a177f[_0xf900('0x5')][_0xf900('0x7')]);this[_0xf900('0x8')]=_0x5a177f['phone'];this[_0xf900('0x9')]=_0x524697['name'];this[_0xf900('0xa')]=_0x5a177f[_0xf900('0xa')]||![];this[_0xf900('0xb')]=_0x524697[_0xf900('0xb')];this[_0xf900('0xc')]=_0x524697[_0xf900('0xc')]||0x3;this[_0xf900('0xd')]=_0x5a177f[_0xf900('0xd')];this[_0xf900('0xe')]=_0x5a177f['countbusyretry'];this[_0xf900('0xf')]=_0x5a177f['countcongestionretry'];this[_0xf900('0x10')]=_0x5a177f[_0xf900('0x10')];this[_0xf900('0x11')]=_0x5a177f[_0xf900('0x11')];this[_0xf900('0x12')]=_0x5a177f[_0xf900('0x12')];this['countabandonedretry']=_0x5a177f[_0xf900('0x13')];this['countmachineretry']=_0x5a177f[_0xf900('0x14')];this[_0xf900('0x15')]=_0x5a177f[_0xf900('0x15')];this[_0xf900('0x16')]=_0x5a177f['ContactId'];this[_0xf900('0x17')]=_0x5a177f[_0xf900('0x17')];this[_0xf900('0x18')]=_0x5a177f[_0xf900('0x18')];this['VoiceQueueId']=_0x5a177f[_0xf900('0x19')];this[_0xf900('0x1a')]=_0x5a177f['CampaignId'];this[_0xf900('0x1b')]=_0x5a177f['id'];this[_0xf900('0x1c')]=_0x5a177f[_0xf900('0x5')]['firstName']||'';this[_0xf900('0x1d')]=moment()[_0xf900('0x1e')](_0xf900('0x1f'));this[_0xf900('0x20')]=_0x5a177f[_0xf900('0x20')];this[_0xf900('0x21')]=_0x5a177f[_0xf900('0x21')];this[_0xf900('0x22')]=_0x5a177f['callbackat'];this[_0xf900('0x23')]=_0x5a177f['recallme'];this[_0xf900('0x24')]='';this[_0xf900('0x25')]='';}Action['prototype'][_0xf900('0x26')]=function(){return util[_0xf900('0x1e')](_0xf900('0x27'),this['name'],this[_0xf900('0x2')][_0xf900('0x28')]>0x0?this[_0xf900('0x8')][_0xf900('0x29')](this['voiceQueue'][_0xf900('0x28')]):this['number']);};Action['prototype']['getQueue']=function(){return this['queue'];};module[_0xf900('0x2a')]=Action; \ No newline at end of file +var _0x2823=['lodash','moment','string','name','Contact','firstName','lastName','number','phone','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','prototype','getCaller','voiceQueue','substring','dialCutDigit','getQueue','queue'];(function(_0x3b2c77,_0x1048dc){var _0xde4103=function(_0x16daa7){while(--_0x16daa7){_0x3b2c77['push'](_0x3b2c77['shift']());}};_0xde4103(++_0x1048dc);}(_0x2823,0x1a4));var _0x3282=function(_0x3f3f3a,_0x41a675){_0x3f3f3a=_0x3f3f3a-0x0;var _0x27d948=_0x2823[_0x3f3f3a];return _0x27d948;};'use strict';var util=require('util');var _=require(_0x3282('0x0'));var moment=require(_0x3282('0x1'));function checkNameSurname(_0xd8f257,_0x34bb8f,_0x185af8){var _0x380f66='';if(!_['isNil'](_0x34bb8f)&&_0x3282('0x2')===typeof _0x34bb8f){_0x380f66+=_0x34bb8f;}if(!_['isNil'](_0x185af8)&&_0x3282('0x2')===typeof _0x185af8){_0x380f66+='\x20'+_0x185af8;}if(_0x380f66!==''){return _0x380f66;}return _0xd8f257;}function Action(_0x5159d4,_0x1450a1,_0x2de75e){this['voiceQueue']=_0x5159d4;this['uniqueid']=_0x2de75e||undefined;this[_0x3282('0x3')]=checkNameSurname(_0x1450a1[_0x3282('0x4')]['phone'],_0x1450a1['Contact'][_0x3282('0x5')],_0x1450a1[_0x3282('0x4')][_0x3282('0x6')]);this[_0x3282('0x7')]=_0x1450a1[_0x3282('0x8')];this['queue']=_0x5159d4[_0x3282('0x3')];this[_0x3282('0x9')]=_0x1450a1[_0x3282('0x9')]||![];this['type']=_0x5159d4[_0x3282('0xa')];this[_0x3282('0xb')]=_0x5159d4[_0x3282('0xb')]||0x3;this[_0x3282('0xc')]=_0x1450a1[_0x3282('0xc')];this[_0x3282('0xd')]=_0x1450a1[_0x3282('0xd')];this[_0x3282('0xe')]=_0x1450a1[_0x3282('0xe')];this[_0x3282('0xf')]=_0x1450a1[_0x3282('0xf')];this['countnosuchnumberretry']=_0x1450a1[_0x3282('0x10')];this[_0x3282('0x11')]=_0x1450a1['countdropretry'];this[_0x3282('0x12')]=_0x1450a1[_0x3282('0x12')];this[_0x3282('0x13')]=_0x1450a1[_0x3282('0x13')];this['countagentrejectretry']=_0x1450a1[_0x3282('0x14')];this[_0x3282('0x15')]=_0x1450a1[_0x3282('0x15')];this[_0x3282('0x16')]=_0x1450a1[_0x3282('0x16')];this[_0x3282('0x17')]=_0x1450a1[_0x3282('0x17')];this[_0x3282('0x18')]=_0x1450a1['VoiceQueueId'];this[_0x3282('0x19')]=_0x1450a1[_0x3282('0x19')];this[_0x3282('0x1a')]=_0x1450a1['id'];this[_0x3282('0x1b')]=_0x1450a1[_0x3282('0x4')][_0x3282('0x5')]||'';this[_0x3282('0x1c')]=moment()[_0x3282('0x1d')](_0x3282('0x1e'));this['callback']=_0x1450a1[_0x3282('0x1f')];this['callbackuniqueid']=_0x1450a1[_0x3282('0x20')];this[_0x3282('0x21')]=_0x1450a1[_0x3282('0x21')];this[_0x3282('0x22')]=_0x1450a1['recallme'];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0x3282('0x23')][_0x3282('0x24')]=function(){return util[_0x3282('0x1d')]('\x22%s\x22\x20<%s>',this['name'],this[_0x3282('0x25')]['dialCutDigit']>0x0?this['number'][_0x3282('0x26')](this[_0x3282('0x25')][_0x3282('0x27')]):this['number']);};Action[_0x3282('0x23')][_0x3282('0x28')]=function(){return this[_0x3282('0x29')];};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/models/agentComplete.js b/server/services/ami/dialer/models/agentComplete.js index 43d848d..fafeec4 100644 --- a/server/services/ami/dialer/models/agentComplete.js +++ b/server/services/ami/dialer/models/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3848=['format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','moment','../utils','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','name','number','starttime','responsetime','answertime','endtime'];(function(_0x1ebe55,_0x17e463){var _0x240610=function(_0x290a88){while(--_0x290a88){_0x1ebe55['push'](_0x1ebe55['shift']());}};_0x240610(++_0x17e463);}(_0x3848,0x172));var _0x8384=function(_0x4ed32d,_0x327695){_0x4ed32d=_0x4ed32d-0x0;var _0xf624df=_0x3848[_0x4ed32d];return _0xf624df;};'use strict';var moment=require(_0x8384('0x0'));var utils=require(_0x8384('0x1'));function AgentComplete(_0x4c9c0d,_0x1f0f41){this[_0x8384('0x2')]=0x4;this[_0x8384('0x3')]=_0x8384('0x4');this[_0x8384('0x5')]=_0x4c9c0d[_0x8384('0x5')];this['type']=_0x4c9c0d[_0x8384('0x6')];this[_0x8384('0x7')]=_0x4c9c0d[_0x8384('0x6')]===_0x8384('0x8')?_0x8384('0x9'):_0x4c9c0d[_0x8384('0x6')];this['countbusyretry']=_0x4c9c0d[_0x8384('0xa')];this[_0x8384('0xb')]=_0x4c9c0d['countcongestionretry'];this[_0x8384('0xc')]=_0x4c9c0d['countnoanswerretry'];this['countglobal']=_0x4c9c0d[_0x8384('0xa')]+_0x4c9c0d[_0x8384('0xb')]+_0x4c9c0d[_0x8384('0xc')]+_0x4c9c0d['countnosuchnumberretry']+_0x4c9c0d[_0x8384('0xd')]+_0x4c9c0d[_0x8384('0xe')]+_0x4c9c0d[_0x8384('0xf')]+_0x4c9c0d[_0x8384('0x10')];this[_0x8384('0x11')]=_0x4c9c0d['countnosuchnumberretry'];this[_0x8384('0xd')]=_0x4c9c0d[_0x8384('0xd')];this[_0x8384('0xe')]=_0x4c9c0d[_0x8384('0xe')];this[_0x8384('0xf')]=_0x4c9c0d[_0x8384('0xf')];this['countagentrejectretry']=_0x4c9c0d[_0x8384('0x10')];this['uniqueid']=_0x1f0f41[_0x8384('0x12')];this[_0x8384('0x13')]=_0x4c9c0d[_0x8384('0x14')];this['calleridnum']=_0x4c9c0d[_0x8384('0x15')];this[_0x8384('0x16')]=_0x4c9c0d[_0x8384('0x16')];this[_0x8384('0x17')]=_0x4c9c0d[_0x8384('0x17')];this[_0x8384('0x18')]=_0x4c9c0d[_0x8384('0x18')];this[_0x8384('0x19')]=moment()[_0x8384('0x1a')](_0x8384('0x1b'));this[_0x8384('0x1c')]=utils[_0x8384('0x1d')](_0x4c9c0d[_0x8384('0x17')],_0x4c9c0d[_0x8384('0x16')]);this['holdtime']=utils['getSeconds'](_0x4c9c0d[_0x8384('0x18')],_0x4c9c0d[_0x8384('0x17')]);this['talktime']=utils[_0x8384('0x1d')](this[_0x8384('0x19')],_0x4c9c0d[_0x8384('0x18')]);this[_0x8384('0x9')]=_0x1f0f41[_0x8384('0x9')];this[_0x8384('0x1e')]=_0x1f0f41['membername'];this[_0x8384('0x1f')]=_0x1f0f41['reason'];this['callback']=_0x4c9c0d[_0x8384('0x20')];this['callbackuniqueid']=_0x4c9c0d[_0x8384('0x21')];this[_0x8384('0x22')]=_0x4c9c0d['callbackat'];this[_0x8384('0x23')]=_0x4c9c0d[_0x8384('0x23')];this[_0x8384('0x24')]=_0x4c9c0d[_0x8384('0x24')];this[_0x8384('0x25')]=_0x4c9c0d[_0x8384('0x25')];this[_0x8384('0x26')]=_0x4c9c0d[_0x8384('0x26')];this[_0x8384('0x27')]=_0x4c9c0d[_0x8384('0x27')];this[_0x8384('0x28')]=_0x4c9c0d[_0x8384('0x28')];this[_0x8384('0x29')]=_0x4c9c0d[_0x8384('0x29')]||'';this[_0x8384('0x2a')]=_0x4c9c0d[_0x8384('0x2a')]||'';this[_0x8384('0x2b')]=_0x4c9c0d[_0x8384('0x2b')];}module['exports']=AgentComplete; \ No newline at end of file +var _0xac8d=['countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','getSeconds','holdtime','talktime','endtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','moment','statedesc','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry'];(function(_0x4d9bb2,_0x3db50d){var _0x3179fe=function(_0x5272f3){while(--_0x5272f3){_0x4d9bb2['push'](_0x4d9bb2['shift']());}};_0x3179fe(++_0x3db50d);}(_0xac8d,0xce));var _0xdac8=function(_0x5667b0,_0x40cced){_0x5667b0=_0x5667b0-0x0;var _0x57aa17=_0xac8d[_0x5667b0];return _0x57aa17;};'use strict';var moment=require(_0xdac8('0x0'));var utils=require('../utils');function AgentComplete(_0x3f626e,_0x477764){this['state']=0x4;this[_0xdac8('0x1')]=_0xdac8('0x2');this[_0xdac8('0x3')]=_0x3f626e[_0xdac8('0x3')];this[_0xdac8('0x4')]=_0x3f626e['type'];this['campaigntype']=_0x3f626e[_0xdac8('0x4')]===_0xdac8('0x5')?_0xdac8('0x6'):_0x3f626e[_0xdac8('0x4')];this[_0xdac8('0x7')]=_0x3f626e[_0xdac8('0x7')];this[_0xdac8('0x8')]=_0x3f626e[_0xdac8('0x8')];this[_0xdac8('0x9')]=_0x3f626e[_0xdac8('0x9')];this[_0xdac8('0xa')]=_0x3f626e[_0xdac8('0x7')]+_0x3f626e[_0xdac8('0x8')]+_0x3f626e['countnoanswerretry']+_0x3f626e[_0xdac8('0xb')]+_0x3f626e[_0xdac8('0xc')]+_0x3f626e[_0xdac8('0xd')]+_0x3f626e[_0xdac8('0xe')]+_0x3f626e[_0xdac8('0xf')];this['countnosuchnumberretry']=_0x3f626e[_0xdac8('0xb')];this[_0xdac8('0xc')]=_0x3f626e[_0xdac8('0xc')];this[_0xdac8('0xd')]=_0x3f626e[_0xdac8('0xd')];this[_0xdac8('0xe')]=_0x3f626e[_0xdac8('0xe')];this['countagentrejectretry']=_0x3f626e[_0xdac8('0xf')];this[_0xdac8('0x10')]=_0x477764[_0xdac8('0x10')];this[_0xdac8('0x11')]=_0x3f626e[_0xdac8('0x12')];this[_0xdac8('0x13')]=_0x3f626e[_0xdac8('0x14')];this[_0xdac8('0x15')]=_0x3f626e['starttime'];this[_0xdac8('0x16')]=_0x3f626e['responsetime'];this['answertime']=_0x3f626e[_0xdac8('0x17')];this['endtime']=moment()[_0xdac8('0x18')](_0xdac8('0x19'));this['ringtime']=utils[_0xdac8('0x1a')](_0x3f626e[_0xdac8('0x16')],_0x3f626e[_0xdac8('0x15')]);this[_0xdac8('0x1b')]=utils[_0xdac8('0x1a')](_0x3f626e[_0xdac8('0x17')],_0x3f626e[_0xdac8('0x16')]);this[_0xdac8('0x1c')]=utils[_0xdac8('0x1a')](this[_0xdac8('0x1d')],_0x3f626e[_0xdac8('0x17')]);this[_0xdac8('0x6')]=_0x477764[_0xdac8('0x6')];this['membername']=_0x477764[_0xdac8('0x1e')];this[_0xdac8('0x1f')]=_0x477764[_0xdac8('0x1f')];this[_0xdac8('0x20')]=_0x3f626e[_0xdac8('0x20')];this['callbackuniqueid']=_0x3f626e[_0xdac8('0x21')];this[_0xdac8('0x22')]=_0x3f626e[_0xdac8('0x22')];this[_0xdac8('0x23')]=_0x3f626e[_0xdac8('0x23')];this[_0xdac8('0x24')]=_0x3f626e['ContactId'];this[_0xdac8('0x25')]=_0x3f626e[_0xdac8('0x25')];this['UserId']=_0x3f626e['UserId'];this[_0xdac8('0x26')]=_0x3f626e[_0xdac8('0x26')];this[_0xdac8('0x27')]=_0x3f626e[_0xdac8('0x27')];this[_0xdac8('0x28')]=_0x3f626e[_0xdac8('0x28')]||'';this[_0xdac8('0x29')]=_0x3f626e[_0xdac8('0x29')]||'';this[_0xdac8('0x2a')]=_0x3f626e[_0xdac8('0x2a')];}module[_0xdac8('0x2b')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/models/final.js b/server/services/ami/dialer/models/final.js index 6ec3816..723ae1a 100644 --- a/server/services/ami/dialer/models/final.js +++ b/server/services/ami/dialer/models/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x219a=['countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countnoanswerretry','countcongestionretry'];(function(_0x36c5aa,_0x1e5b00){var _0x172211=function(_0x164bbe){while(--_0x164bbe){_0x36c5aa['push'](_0x36c5aa['shift']());}};_0x172211(++_0x1e5b00);}(_0x219a,0x118));var _0xa219=function(_0x5efb97,_0x2e56b7){_0x5efb97=_0x5efb97-0x0;var _0x8a64c5=_0x219a[_0x5efb97];return _0x8a64c5;};'use strict';function Final(_0x4ff050){this['uniqueid']=_0x4ff050[_0xa219('0x0')];this['scheduledat']=_0x4ff050[_0xa219('0x1')];this[_0xa219('0x2')]=_0x4ff050[_0xa219('0x2')];this[_0xa219('0x3')]=_0x4ff050[_0xa219('0x2')]===_0xa219('0x4')?'queue':_0x4ff050[_0xa219('0x2')];this['countbusyretry']=_0x4ff050[_0xa219('0x5')];this['countcongestionretry']=_0x4ff050['countcongestionretry'];this[_0xa219('0x6')]=_0x4ff050['countnoanswerretry'];this['countglobal']=_0x4ff050['countbusyretry']+_0x4ff050[_0xa219('0x7')]+_0x4ff050['countnoanswerretry']+_0x4ff050[_0xa219('0x8')]+_0x4ff050[_0xa219('0x9')]+_0x4ff050['countabandonedretry']+_0x4ff050[_0xa219('0xa')]+_0x4ff050[_0xa219('0xb')];this[_0xa219('0x8')]=_0x4ff050[_0xa219('0x8')];this[_0xa219('0x9')]=_0x4ff050[_0xa219('0x9')];this[_0xa219('0xc')]=_0x4ff050[_0xa219('0xc')];this[_0xa219('0xa')]=_0x4ff050['countmachineretry'];this[_0xa219('0xb')]=_0x4ff050[_0xa219('0xb')];this[_0xa219('0xd')]=_0x4ff050['queue'];this['calleridname']=_0x4ff050[_0xa219('0xe')];this['calleridnum']=_0x4ff050[_0xa219('0xf')];this[_0xa219('0x10')]=_0x4ff050[_0xa219('0x10')];this[_0xa219('0x11')]=_0x4ff050[_0xa219('0x11')];this[_0xa219('0x12')]=_0x4ff050[_0xa219('0x11')];this['ringtime']=_0x4ff050[_0xa219('0x13')]||0x0;this[_0xa219('0x14')]=_0x4ff050['holdtime']||0x0;this['talktime']=_0x4ff050[_0xa219('0x15')]||0x0;this[_0xa219('0x16')]=_0x4ff050[_0xa219('0x16')];this[_0xa219('0x17')]=_0x4ff050[_0xa219('0x17')];this['callbackat']=_0x4ff050[_0xa219('0x18')];this[_0xa219('0x19')]=_0x4ff050[_0xa219('0x19')];this[_0xa219('0x1a')]=_0x4ff050[_0xa219('0x1a')];this[_0xa219('0x1b')]=_0x4ff050[_0xa219('0x1b')];this[_0xa219('0x1c')]=_0x4ff050['UserId'];this[_0xa219('0x1d')]=_0x4ff050[_0xa219('0x1d')];this[_0xa219('0x1e')]=_0x4ff050['CampaignId'];this[_0xa219('0x1f')]=_0x4ff050[_0xa219('0x1f')]||'';this[_0xa219('0x20')]=_0x4ff050[_0xa219('0x20')]||'';this[_0xa219('0x21')]=_0x4ff050[_0xa219('0x21')];this[_0xa219('0x22')]=_0x4ff050[_0xa219('0x22')];}module[_0xa219('0x23')]=Final; \ No newline at end of file +var _0xd66b=['VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId'];(function(_0xeb3141,_0x2b6641){var _0x507c26=function(_0x5e777b){while(--_0x5e777b){_0xeb3141['push'](_0xeb3141['shift']());}};_0x507c26(++_0x2b6641);}(_0xd66b,0xd8));var _0xbd66=function(_0x67b14e,_0x3c20c2){_0x67b14e=_0x67b14e-0x0;var _0x312bf5=_0xd66b[_0x67b14e];return _0x312bf5;};'use strict';function Final(_0x16366b){this[_0xbd66('0x0')]=_0x16366b['uniqueid'];this[_0xbd66('0x1')]=_0x16366b[_0xbd66('0x1')];this[_0xbd66('0x2')]=_0x16366b[_0xbd66('0x2')];this[_0xbd66('0x3')]=_0x16366b[_0xbd66('0x2')]==='outbound'?_0xbd66('0x4'):_0x16366b[_0xbd66('0x2')];this[_0xbd66('0x5')]=_0x16366b[_0xbd66('0x5')];this[_0xbd66('0x6')]=_0x16366b[_0xbd66('0x6')];this[_0xbd66('0x7')]=_0x16366b[_0xbd66('0x7')];this[_0xbd66('0x8')]=_0x16366b[_0xbd66('0x5')]+_0x16366b[_0xbd66('0x6')]+_0x16366b[_0xbd66('0x7')]+_0x16366b[_0xbd66('0x9')]+_0x16366b[_0xbd66('0xa')]+_0x16366b[_0xbd66('0xb')]+_0x16366b[_0xbd66('0xc')]+_0x16366b[_0xbd66('0xd')];this[_0xbd66('0x9')]=_0x16366b['countnosuchnumberretry'];this['countdropretry']=_0x16366b[_0xbd66('0xa')];this[_0xbd66('0xb')]=_0x16366b[_0xbd66('0xb')];this[_0xbd66('0xc')]=_0x16366b[_0xbd66('0xc')];this[_0xbd66('0xd')]=_0x16366b['countagentrejectretry'];this['queue']=_0x16366b['queue'];this['calleridname']=_0x16366b[_0xbd66('0xe')];this[_0xbd66('0xf')]=_0x16366b[_0xbd66('0xf')];this[_0xbd66('0x10')]=_0x16366b[_0xbd66('0x10')];this[_0xbd66('0x11')]=_0x16366b[_0xbd66('0x11')];this[_0xbd66('0x12')]=_0x16366b[_0xbd66('0x11')];this[_0xbd66('0x13')]=_0x16366b[_0xbd66('0x13')]||0x0;this[_0xbd66('0x14')]=_0x16366b[_0xbd66('0x14')]||0x0;this[_0xbd66('0x15')]=_0x16366b[_0xbd66('0x15')]||0x0;this['callback']=_0x16366b[_0xbd66('0x16')];this[_0xbd66('0x17')]=_0x16366b[_0xbd66('0x17')];this[_0xbd66('0x18')]=_0x16366b[_0xbd66('0x18')];this['recallme']=_0x16366b[_0xbd66('0x19')];this[_0xbd66('0x1a')]=_0x16366b[_0xbd66('0x1a')];this[_0xbd66('0x1b')]=_0x16366b[_0xbd66('0x1b')];this['UserId']=_0x16366b[_0xbd66('0x1c')];this[_0xbd66('0x1d')]=_0x16366b[_0xbd66('0x1d')];this['CampaignId']=_0x16366b[_0xbd66('0x1e')];this[_0xbd66('0x1f')]=_0x16366b[_0xbd66('0x1f')]||'';this[_0xbd66('0x20')]=_0x16366b['originatecalleridname']||'';this['state']=_0x16366b[_0xbd66('0x21')];this[_0xbd66('0x22')]=_0x16366b[_0xbd66('0x22')];}module['exports']=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/models/hangup.js b/server/services/ami/dialer/models/hangup.js index f50b33c..51d10c2 100644 --- a/server/services/ami/dialer/models/hangup.js +++ b/server/services/ami/dialer/models/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4d18=['countdropretry','uniqueid','calleridnum','number','starttime','endtime','ringtime','holdtime','talktime','responsetime','queue','membername','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','../utils','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry'];(function(_0x1fd9e7,_0x24cdbe){var _0x1781f2=function(_0x2bd0a3){while(--_0x2bd0a3){_0x1fd9e7['push'](_0x1fd9e7['shift']());}};_0x1781f2(++_0x24cdbe);}(_0x4d18,0x188));var _0x84d1=function(_0x19544f,_0x4fb146){_0x19544f=_0x19544f-0x0;var _0xb51561=_0x4d18[_0x19544f];return _0xb51561;};'use strict';var moment=require(_0x84d1('0x0'));var utils=require(_0x84d1('0x1'));function Hangup(_0x15f47c,_0x4a748a){this[_0x84d1('0x2')]=0x4;this[_0x84d1('0x3')]=_0x84d1('0x4');this[_0x84d1('0x5')]=_0x15f47c[_0x84d1('0x5')];this[_0x84d1('0x6')]=_0x15f47c['type'];this[_0x84d1('0x7')]=_0x15f47c[_0x84d1('0x6')]===_0x84d1('0x8')?'queue':_0x15f47c[_0x84d1('0x6')];this[_0x84d1('0x9')]=_0x15f47c[_0x84d1('0x9')]||![];this[_0x84d1('0xa')]=_0x15f47c['countbusyretry'];this[_0x84d1('0xb')]=_0x15f47c[_0x84d1('0xb')];this['countnoanswerretry']=_0x15f47c[_0x84d1('0xc')];this[_0x84d1('0xd')]=_0x15f47c[_0x84d1('0xa')]+_0x15f47c['countcongestionretry']+_0x15f47c[_0x84d1('0xc')]+_0x15f47c[_0x84d1('0xe')]+_0x15f47c['countdropretry']+_0x15f47c[_0x84d1('0xf')]+_0x15f47c[_0x84d1('0x10')]+_0x15f47c[_0x84d1('0x11')];this['countnosuchnumberretry']=_0x15f47c['countnosuchnumberretry'];this[_0x84d1('0x12')]=_0x15f47c['countdropretry'];this[_0x84d1('0xf')]=_0x15f47c[_0x84d1('0xf')];this[_0x84d1('0x10')]=_0x15f47c[_0x84d1('0x10')];this['countagentrejectretry']=_0x15f47c[_0x84d1('0x11')];this[_0x84d1('0x13')]=_0x4a748a[_0x84d1('0x13')];this['calleridname']=_0x15f47c['name'];this[_0x84d1('0x14')]=_0x15f47c[_0x84d1('0x15')];this[_0x84d1('0x16')]=_0x15f47c[_0x84d1('0x16')];this['responsetime']=_0x15f47c['responsetime'];this[_0x84d1('0x17')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x84d1('0x18')]=utils['getSeconds'](_0x15f47c['responsetime'],_0x15f47c[_0x84d1('0x16')]);this[_0x84d1('0x19')]=0x0;this[_0x84d1('0x1a')]=utils['getSeconds'](this['endtime'],_0x15f47c[_0x84d1('0x1b')]);this[_0x84d1('0x1c')]=_0x15f47c[_0x84d1('0x1c')];this[_0x84d1('0x1d')]='IVR';this['reason']=_0x4a748a[_0x84d1('0x1e')];this[_0x84d1('0x1f')]=_0x15f47c[_0x84d1('0x1f')];this[_0x84d1('0x20')]=_0x15f47c[_0x84d1('0x20')];this[_0x84d1('0x21')]=_0x15f47c['callbackat'];this[_0x84d1('0x22')]=_0x15f47c[_0x84d1('0x22')];this['ContactId']=_0x15f47c[_0x84d1('0x23')];this['ListId']=_0x15f47c[_0x84d1('0x24')];this[_0x84d1('0x25')]=_0x15f47c[_0x84d1('0x25')];this[_0x84d1('0x26')]=_0x15f47c['VoiceQueueId'];this['CampaignId']=_0x15f47c[_0x84d1('0x27')];}module[_0x84d1('0x28')]=Hangup; \ No newline at end of file +var _0x5a7e=['countagentrejectretry','uniqueid','calleridname','name','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','endtime','queue','membername','IVR','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countdropretry','countmachineretry'];(function(_0x3f5863,_0x1ea5b3){var _0x16f6ca=function(_0x7420e){while(--_0x7420e){_0x3f5863['push'](_0x3f5863['shift']());}};_0x16f6ca(++_0x1ea5b3);}(_0x5a7e,0x147));var _0xe5a7=function(_0x47de83,_0x4e1db8){_0x47de83=_0x47de83-0x0;var _0x2e8be2=_0x5a7e[_0x47de83];return _0x2e8be2;};'use strict';var moment=require(_0xe5a7('0x0'));var utils=require('../utils');function Hangup(_0x4da83d,_0x69e215){this[_0xe5a7('0x1')]=0x4;this[_0xe5a7('0x2')]=_0xe5a7('0x3');this['scheduledat']=_0x4da83d[_0xe5a7('0x4')];this[_0xe5a7('0x5')]=_0x4da83d['type'];this[_0xe5a7('0x6')]=_0x4da83d['type']===_0xe5a7('0x7')?'queue':_0x4da83d[_0xe5a7('0x5')];this['amd']=_0x4da83d[_0xe5a7('0x8')]||![];this[_0xe5a7('0x9')]=_0x4da83d[_0xe5a7('0x9')];this[_0xe5a7('0xa')]=_0x4da83d['countcongestionretry'];this['countnoanswerretry']=_0x4da83d[_0xe5a7('0xb')];this[_0xe5a7('0xc')]=_0x4da83d[_0xe5a7('0x9')]+_0x4da83d[_0xe5a7('0xa')]+_0x4da83d[_0xe5a7('0xb')]+_0x4da83d[_0xe5a7('0xd')]+_0x4da83d['countdropretry']+_0x4da83d[_0xe5a7('0xe')]+_0x4da83d['countmachineretry']+_0x4da83d['countagentrejectretry'];this[_0xe5a7('0xd')]=_0x4da83d['countnosuchnumberretry'];this[_0xe5a7('0xf')]=_0x4da83d[_0xe5a7('0xf')];this[_0xe5a7('0xe')]=_0x4da83d[_0xe5a7('0xe')];this[_0xe5a7('0x10')]=_0x4da83d[_0xe5a7('0x10')];this[_0xe5a7('0x11')]=_0x4da83d[_0xe5a7('0x11')];this['uniqueid']=_0x69e215[_0xe5a7('0x12')];this[_0xe5a7('0x13')]=_0x4da83d[_0xe5a7('0x14')];this['calleridnum']=_0x4da83d['number'];this[_0xe5a7('0x15')]=_0x4da83d[_0xe5a7('0x15')];this[_0xe5a7('0x16')]=_0x4da83d[_0xe5a7('0x16')];this['endtime']=moment()[_0xe5a7('0x17')](_0xe5a7('0x18'));this[_0xe5a7('0x19')]=utils[_0xe5a7('0x1a')](_0x4da83d[_0xe5a7('0x16')],_0x4da83d[_0xe5a7('0x15')]);this[_0xe5a7('0x1b')]=0x0;this['talktime']=utils[_0xe5a7('0x1a')](this[_0xe5a7('0x1c')],_0x4da83d['responsetime']);this[_0xe5a7('0x1d')]=_0x4da83d[_0xe5a7('0x1d')];this[_0xe5a7('0x1e')]=_0xe5a7('0x1f');this['reason']=_0x69e215[_0xe5a7('0x20')];this[_0xe5a7('0x21')]=_0x4da83d[_0xe5a7('0x21')];this[_0xe5a7('0x22')]=_0x4da83d[_0xe5a7('0x22')];this[_0xe5a7('0x23')]=_0x4da83d[_0xe5a7('0x23')];this[_0xe5a7('0x24')]=_0x4da83d[_0xe5a7('0x24')];this[_0xe5a7('0x25')]=_0x4da83d[_0xe5a7('0x25')];this[_0xe5a7('0x26')]=_0x4da83d['ListId'];this[_0xe5a7('0x27')]=_0x4da83d[_0xe5a7('0x27')];this[_0xe5a7('0x28')]=_0x4da83d[_0xe5a7('0x28')];this[_0xe5a7('0x29')]=_0x4da83d['CampaignId'];}module[_0xe5a7('0x2a')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/models/history.js b/server/services/ami/dialer/models/history.js index 3308e37..4899e23 100644 --- a/server/services/ami/dialer/models/history.js +++ b/server/services/ami/dialer/models/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xff57=['countmachineretry','countagentrejectretry','countabandonedretry','calleridname','name','calleridnum','number','responsetime','endtime','getSeconds','starttime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','uniqueid','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry'];(function(_0x57f7d7,_0x41443c){var _0x11b297=function(_0x2783ce){while(--_0x2783ce){_0x57f7d7['push'](_0x57f7d7['shift']());}};_0x11b297(++_0x41443c);}(_0xff57,0x197));var _0x7ff5=function(_0x36d03c,_0x35b8c9){_0x36d03c=_0x36d03c-0x0;var _0x3ae972=_0xff57[_0x36d03c];return _0x3ae972;};'use strict';var utils=require(_0x7ff5('0x0'));function History(_0x3c5013){this['uniqueid']=_0x3c5013[_0x7ff5('0x1')];this['scheduledat']=_0x3c5013['scheduledat']||undefined;this['type']=_0x3c5013[_0x7ff5('0x2')];this[_0x7ff5('0x3')]=_0x3c5013[_0x7ff5('0x2')]===_0x7ff5('0x4')?_0x7ff5('0x5'):_0x3c5013[_0x7ff5('0x2')];this['countbusyretry']=_0x3c5013[_0x7ff5('0x6')];this['countcongestionretry']=_0x3c5013[_0x7ff5('0x7')];this[_0x7ff5('0x8')]=_0x3c5013[_0x7ff5('0x8')];this['countglobal']=_0x3c5013[_0x7ff5('0x6')]+_0x3c5013[_0x7ff5('0x7')]+_0x3c5013[_0x7ff5('0x8')]+_0x3c5013[_0x7ff5('0x9')]+_0x3c5013[_0x7ff5('0xa')]+_0x3c5013['countabandonedretry']+_0x3c5013[_0x7ff5('0xb')]+_0x3c5013[_0x7ff5('0xc')];this[_0x7ff5('0x9')]=_0x3c5013[_0x7ff5('0x9')];this['countdropretry']=_0x3c5013[_0x7ff5('0xa')];this[_0x7ff5('0xd')]=_0x3c5013[_0x7ff5('0xd')];this['countmachineretry']=_0x3c5013['countmachineretry'];this[_0x7ff5('0xc')]=_0x3c5013['countagentrejectretry'];this['queue']=_0x3c5013[_0x7ff5('0x5')];this[_0x7ff5('0xe')]=_0x3c5013[_0x7ff5('0xf')];this[_0x7ff5('0x10')]=_0x3c5013[_0x7ff5('0x11')];this['starttime']=_0x3c5013['starttime'];this['responsetime']=_0x3c5013[_0x7ff5('0x12')];this[_0x7ff5('0x13')]=_0x3c5013[_0x7ff5('0x12')];this['ringtime']=utils[_0x7ff5('0x14')](_0x3c5013[_0x7ff5('0x12')],_0x3c5013[_0x7ff5('0x15')]);this[_0x7ff5('0x16')]=0x0;this[_0x7ff5('0x17')]=0x0;this[_0x7ff5('0x18')]=_0x3c5013['callback'];this[_0x7ff5('0x19')]=_0x3c5013[_0x7ff5('0x19')];this['callbackat']=_0x3c5013[_0x7ff5('0x1a')];this[_0x7ff5('0x1b')]=_0x3c5013[_0x7ff5('0x1b')];this[_0x7ff5('0x1c')]=_0x3c5013[_0x7ff5('0x1c')];this[_0x7ff5('0x1d')]=_0x3c5013['ListId'];this[_0x7ff5('0x1e')]=_0x3c5013[_0x7ff5('0x1e')];this[_0x7ff5('0x1f')]=_0x3c5013[_0x7ff5('0x1f')];this[_0x7ff5('0x20')]=_0x3c5013['CampaignId'];this[_0x7ff5('0x21')]=_0x3c5013[_0x7ff5('0x21')]||'';this[_0x7ff5('0x22')]=_0x3c5013[_0x7ff5('0x22')]||'';this[_0x7ff5('0x23')]=_0x3c5013[_0x7ff5('0x23')];this[_0x7ff5('0x24')]=_0x3c5013[_0x7ff5('0x24')];}module[_0x7ff5('0x25')]=History; \ No newline at end of file +var _0x1f0c=['recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','uniqueid','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','endtime','responsetime','getSeconds','holdtime','talktime','callback','callbackat'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1f0c,0x115));var _0xc1f0=function(_0x13c187,_0x1ce71e){_0x13c187=_0x13c187-0x0;var _0x45cc5e=_0x1f0c[_0x13c187];return _0x45cc5e;};'use strict';var utils=require(_0xc1f0('0x0'));function History(_0x3f0fe2){this['uniqueid']=_0x3f0fe2[_0xc1f0('0x1')];this['scheduledat']=_0x3f0fe2['scheduledat']||undefined;this[_0xc1f0('0x2')]=_0x3f0fe2[_0xc1f0('0x2')];this[_0xc1f0('0x3')]=_0x3f0fe2[_0xc1f0('0x2')]===_0xc1f0('0x4')?_0xc1f0('0x5'):_0x3f0fe2[_0xc1f0('0x2')];this['countbusyretry']=_0x3f0fe2[_0xc1f0('0x6')];this[_0xc1f0('0x7')]=_0x3f0fe2['countcongestionretry'];this[_0xc1f0('0x8')]=_0x3f0fe2['countnoanswerretry'];this[_0xc1f0('0x9')]=_0x3f0fe2[_0xc1f0('0x6')]+_0x3f0fe2[_0xc1f0('0x7')]+_0x3f0fe2[_0xc1f0('0x8')]+_0x3f0fe2[_0xc1f0('0xa')]+_0x3f0fe2[_0xc1f0('0xb')]+_0x3f0fe2[_0xc1f0('0xc')]+_0x3f0fe2[_0xc1f0('0xd')]+_0x3f0fe2[_0xc1f0('0xe')];this[_0xc1f0('0xa')]=_0x3f0fe2[_0xc1f0('0xa')];this[_0xc1f0('0xb')]=_0x3f0fe2[_0xc1f0('0xb')];this[_0xc1f0('0xc')]=_0x3f0fe2[_0xc1f0('0xc')];this['countmachineretry']=_0x3f0fe2['countmachineretry'];this[_0xc1f0('0xe')]=_0x3f0fe2['countagentrejectretry'];this[_0xc1f0('0x5')]=_0x3f0fe2[_0xc1f0('0x5')];this[_0xc1f0('0xf')]=_0x3f0fe2[_0xc1f0('0x10')];this[_0xc1f0('0x11')]=_0x3f0fe2[_0xc1f0('0x12')];this[_0xc1f0('0x13')]=_0x3f0fe2[_0xc1f0('0x13')];this['responsetime']=_0x3f0fe2['responsetime'];this[_0xc1f0('0x14')]=_0x3f0fe2[_0xc1f0('0x15')];this['ringtime']=utils[_0xc1f0('0x16')](_0x3f0fe2[_0xc1f0('0x15')],_0x3f0fe2[_0xc1f0('0x13')]);this[_0xc1f0('0x17')]=0x0;this[_0xc1f0('0x18')]=0x0;this[_0xc1f0('0x19')]=_0x3f0fe2[_0xc1f0('0x19')];this['callbackuniqueid']=_0x3f0fe2['callbackuniqueid'];this[_0xc1f0('0x1a')]=_0x3f0fe2[_0xc1f0('0x1a')];this['recallme']=_0x3f0fe2[_0xc1f0('0x1b')];this['ContactId']=_0x3f0fe2[_0xc1f0('0x1c')];this[_0xc1f0('0x1d')]=_0x3f0fe2[_0xc1f0('0x1d')];this[_0xc1f0('0x1e')]=_0x3f0fe2[_0xc1f0('0x1e')];this[_0xc1f0('0x1f')]=_0x3f0fe2[_0xc1f0('0x1f')];this[_0xc1f0('0x20')]=_0x3f0fe2[_0xc1f0('0x20')];this['originatecalleridnum']=_0x3f0fe2[_0xc1f0('0x21')]||'';this[_0xc1f0('0x22')]=_0x3f0fe2['originatecalleridname']||'';this[_0xc1f0('0x23')]=_0x3f0fe2['state'];this[_0xc1f0('0x24')]=_0x3f0fe2[_0xc1f0('0x24')];}module[_0xc1f0('0x25')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/models/queueCallerAbandon.js b/server/services/ami/dialer/models/queueCallerAbandon.js index 8072e7e..f9033b2 100644 --- a/server/services/ami/dialer/models/queueCallerAbandon.js +++ b/server/services/ami/dialer/models/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd22d=['agiafterat','state','statedesc','exports','../utils','scheduledat','type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','name','number','starttime','responsetime','droptime','dropreason','endtime','getSeconds','holdtime','talktime','queue','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname'];(function(_0x148879,_0x5b4c11){var _0x4f7027=function(_0xad056b){while(--_0xad056b){_0x148879['push'](_0x148879['shift']());}};_0x4f7027(++_0x5b4c11);}(_0xd22d,0x1a8));var _0xdd22=function(_0x1ca9eb,_0x99a10b){_0x1ca9eb=_0x1ca9eb-0x0;var _0x2e284e=_0xd22d[_0x1ca9eb];return _0x2e284e;};'use strict';var utils=require(_0xdd22('0x0'));function QueueCallerAbandon(_0x49232a,_0x21413b){this[_0xdd22('0x1')]=_0x49232a['scheduledat'];this[_0xdd22('0x2')]=_0x49232a[_0xdd22('0x2')];this['campaigntype']=_0x49232a[_0xdd22('0x2')]==='outbound'?'queue':_0x49232a['type'];this[_0xdd22('0x3')]=_0x49232a['countbusyretry'];this['countcongestionretry']=_0x49232a[_0xdd22('0x4')];this['countnoanswerretry']=_0x49232a[_0xdd22('0x5')];this[_0xdd22('0x6')]=_0x49232a['countbusyretry']+_0x49232a['countcongestionretry']+_0x49232a[_0xdd22('0x5')]+_0x49232a['countnosuchnumberretry']+_0x49232a[_0xdd22('0x7')]+_0x49232a[_0xdd22('0x8')]+_0x49232a[_0xdd22('0x9')]+_0x49232a[_0xdd22('0xa')];this['countnosuchnumberretry']=_0x49232a[_0xdd22('0xb')];this[_0xdd22('0x7')]=_0x49232a[_0xdd22('0x7')];this[_0xdd22('0x8')]=_0x49232a[_0xdd22('0x8')];this[_0xdd22('0x9')]=_0x49232a['countmachineretry'];this[_0xdd22('0xa')]=_0x49232a[_0xdd22('0xa')];this['uniqueid']=_0x21413b[_0xdd22('0xc')];this[_0xdd22('0xd')]=_0x49232a[_0xdd22('0xe')];this['calleridnum']=_0x49232a[_0xdd22('0xf')];this[_0xdd22('0x10')]=_0x49232a['starttime'];this[_0xdd22('0x11')]=_0x49232a[_0xdd22('0x11')];this[_0xdd22('0x12')]=_0x49232a[_0xdd22('0x12')];this[_0xdd22('0x13')]=_0x49232a['dropreason'];this[_0xdd22('0x14')]=this[_0xdd22('0x12')];this['ringtime']=utils[_0xdd22('0x15')](_0x49232a[_0xdd22('0x11')],_0x49232a['starttime']);this[_0xdd22('0x16')]=utils[_0xdd22('0x15')](this['droptime'],_0x49232a['responsetime']);this[_0xdd22('0x17')]=0x0;this['queue']=_0x21413b[_0xdd22('0x18')];this['membername']=_0x21413b[_0xdd22('0x19')];this['reason']=_0x21413b[_0xdd22('0x1a')];this[_0xdd22('0x1b')]=_0x49232a[_0xdd22('0x1b')];this[_0xdd22('0x1c')]=_0x49232a[_0xdd22('0x1c')];this['callbackat']=_0x49232a[_0xdd22('0x1d')];this[_0xdd22('0x1e')]=_0x49232a[_0xdd22('0x1e')];this[_0xdd22('0x1f')]=_0x49232a['ContactId'];this[_0xdd22('0x20')]=_0x49232a[_0xdd22('0x20')];this[_0xdd22('0x21')]=_0x49232a['UserId'];this[_0xdd22('0x22')]=_0x49232a[_0xdd22('0x22')];this[_0xdd22('0x23')]=_0x49232a[_0xdd22('0x23')];this[_0xdd22('0x24')]=_0x49232a[_0xdd22('0x24')]||'';this['originatecalleridname']=_0x49232a[_0xdd22('0x25')]||'';this[_0xdd22('0x26')]=_0x49232a[_0xdd22('0x26')];this[_0xdd22('0x27')]=_0x49232a[_0xdd22('0x27')];this['statedesc']=_0x49232a[_0xdd22('0x28')];}module[_0xdd22('0x29')]=QueueCallerAbandon; \ No newline at end of file +var _0x07df=['responsetime','dropreason','droptime','ringtime','getSeconds','holdtime','talktime','queue','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','campaigntype','type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridnum','starttime'];(function(_0x551604,_0x52cf0c){var _0x31086b=function(_0x2ba750){while(--_0x2ba750){_0x551604['push'](_0x551604['shift']());}};_0x31086b(++_0x52cf0c);}(_0x07df,0x194));var _0xf07d=function(_0x547fb7,_0x459b13){_0x547fb7=_0x547fb7-0x0;var _0x41389e=_0x07df[_0x547fb7];return _0x41389e;};'use strict';var utils=require('../utils');function QueueCallerAbandon(_0x52f336,_0x15eacc){this['scheduledat']=_0x52f336['scheduledat'];this['type']=_0x52f336['type'];this[_0xf07d('0x0')]=_0x52f336[_0xf07d('0x1')]==='outbound'?'queue':_0x52f336['type'];this[_0xf07d('0x2')]=_0x52f336[_0xf07d('0x2')];this[_0xf07d('0x3')]=_0x52f336[_0xf07d('0x3')];this[_0xf07d('0x4')]=_0x52f336[_0xf07d('0x4')];this[_0xf07d('0x5')]=_0x52f336[_0xf07d('0x2')]+_0x52f336[_0xf07d('0x3')]+_0x52f336['countnoanswerretry']+_0x52f336[_0xf07d('0x6')]+_0x52f336[_0xf07d('0x7')]+_0x52f336[_0xf07d('0x8')]+_0x52f336['countmachineretry']+_0x52f336[_0xf07d('0x9')];this['countnosuchnumberretry']=_0x52f336[_0xf07d('0x6')];this[_0xf07d('0x7')]=_0x52f336[_0xf07d('0x7')];this[_0xf07d('0x8')]=_0x52f336[_0xf07d('0x8')];this[_0xf07d('0xa')]=_0x52f336[_0xf07d('0xa')];this[_0xf07d('0x9')]=_0x52f336[_0xf07d('0x9')];this['uniqueid']=_0x15eacc[_0xf07d('0xb')];this['calleridname']=_0x52f336['name'];this[_0xf07d('0xc')]=_0x52f336['number'];this['starttime']=_0x52f336[_0xf07d('0xd')];this[_0xf07d('0xe')]=_0x52f336[_0xf07d('0xe')];this['droptime']=_0x52f336['droptime'];this[_0xf07d('0xf')]=_0x52f336[_0xf07d('0xf')];this['endtime']=this[_0xf07d('0x10')];this[_0xf07d('0x11')]=utils[_0xf07d('0x12')](_0x52f336[_0xf07d('0xe')],_0x52f336[_0xf07d('0xd')]);this[_0xf07d('0x13')]=utils[_0xf07d('0x12')](this[_0xf07d('0x10')],_0x52f336['responsetime']);this[_0xf07d('0x14')]=0x0;this[_0xf07d('0x15')]=_0x15eacc[_0xf07d('0x15')];this['membername']=_0x15eacc[_0xf07d('0x16')];this[_0xf07d('0x17')]=_0x15eacc['reason'];this[_0xf07d('0x18')]=_0x52f336[_0xf07d('0x18')];this[_0xf07d('0x19')]=_0x52f336[_0xf07d('0x19')];this['callbackat']=_0x52f336[_0xf07d('0x1a')];this[_0xf07d('0x1b')]=_0x52f336['recallme'];this[_0xf07d('0x1c')]=_0x52f336[_0xf07d('0x1c')];this[_0xf07d('0x1d')]=_0x52f336['ListId'];this['UserId']=_0x52f336['UserId'];this[_0xf07d('0x1e')]=_0x52f336[_0xf07d('0x1e')];this[_0xf07d('0x1f')]=_0x52f336['CampaignId'];this['originatecalleridnum']=_0x52f336[_0xf07d('0x20')]||'';this[_0xf07d('0x21')]=_0x52f336['originatecalleridname']||'';this[_0xf07d('0x22')]=_0x52f336[_0xf07d('0x22')];this[_0xf07d('0x23')]=_0x52f336['state'];this[_0xf07d('0x24')]=_0x52f336[_0xf07d('0x24')];}module[_0xf07d('0x25')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/hopper.js b/server/services/ami/dialer/utils/hopper.js index faf03e5..bd3a298 100644 --- a/server/services/ami/dialer/utils/hopper.js +++ b/server/services/ami/dialer/utils/hopper.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xafb9=['[swapAdditionalPhone]','[avgHandleTime]','avgHandleTime','createHistory','[createHistory]','util','../../../../config/logger','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','dialOrderByScheduledAt','temp','error','[getContactDialer]','getContactDialerIvr','catch','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackList]','[checkIsBlackListIvr]','checkIsBlackListIvr','verifyAdditionalPhones','swapAdditionalPhones'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xafb9,0x68));var _0x9afb=function(_0x217979,_0x1bc533){_0x217979=_0x217979-0x0;var _0x103af=_0xafb9[_0x217979];return _0x103af;};'use strict';var util=require(_0x9afb('0x0'));var logger=require(_0x9afb('0x1'))(_0x9afb('0x2'));var cmHopper=require(_0x9afb('0x3'));var cmHopperAdditionalPhone=require(_0x9afb('0x4'));var cmHopperBlack=require(_0x9afb('0x5'));var cmHopperHistory=require(_0x9afb('0x6'));function inspectError(_0x44892f){return util[_0x9afb('0x7')](_0x44892f,{'showHidden':![],'depth':null});}function getContactDialer(_0x4e983d,_0x498463,_0x91ffa0){return cmHopper['getContactDialer'](_0x4e983d['id'],_0x498463,_0x91ffa0,_0x4e983d[_0x9afb('0x8')])['catch'](function(_0x556880){_0x4e983d[_0x9afb('0x9')]=0x0;logger[_0x9afb('0xa')](_0x9afb('0xb'),inspectError(_0x556880));});}exports['getContactDialer']=getContactDialer;function getContactDialerIvr(_0x3ef362,_0x3e0264){return cmHopper[_0x9afb('0xc')](_0x3ef362['id'],_0x3e0264,_0x3ef362[_0x9afb('0x8')])[_0x9afb('0xd')](function(_0x56f477){_0x3ef362['temp']=0x0;logger[_0x9afb('0xa')](_0x9afb('0xe'),inspectError(_0x56f477));});}exports[_0x9afb('0xc')]=getContactDialerIvr;function countReScheduled(_0x31b574){return cmHopper[_0x9afb('0xf')](_0x31b574)[_0x9afb('0xd')](function(_0x374094){logger[_0x9afb('0xa')](_0x9afb('0x10'),inspectError(_0x374094));});}exports[_0x9afb('0xf')]=countReScheduled;function rescheduleContact(_0x47a804){return cmHopper[_0x9afb('0x11')](_0x47a804)['catch'](function(_0x59fd82){logger[_0x9afb('0xa')](_0x9afb('0x12'),inspectError(_0x59fd82));});}exports[_0x9afb('0x11')]=rescheduleContact;function unlockContact(_0x2d664d,_0x46b16f,_0x39cdf1){return cmHopper[_0x9afb('0x13')](_0x2d664d,_0x46b16f,_0x39cdf1)['catch'](function(_0x18505a){logger[_0x9afb('0xa')](_0x9afb('0x14'),inspectError(_0x18505a));});}exports[_0x9afb('0x13')]=unlockContact;function moveContactManagedDialer(_0x223aef){return cmHopper['moveContactManagedDialer'](_0x223aef)[_0x9afb('0xd')](function(_0x50a7e4){logger[_0x9afb('0xa')](_0x9afb('0x15'),inspectError(_0x50a7e4));});}exports['moveContactManagedDialer']=moveContactManagedDialer;function checkIsBlackList(_0x4a1c74){return cmHopperBlack[_0x9afb('0x16')](_0x4a1c74)[_0x9afb('0xd')](function(_0x3d8450){logger[_0x9afb('0xa')](_0x9afb('0x17'),inspectError(_0x3d8450));});}exports['checkIsBlackList']=checkIsBlackList;function checkIsBlackListIvr(_0x105253){return cmHopperBlack['checkIsBlackListIvr'](_0x105253)['catch'](function(_0x3fb534){logger[_0x9afb('0xa')](_0x9afb('0x18'),inspectError(_0x3fb534));});}exports[_0x9afb('0x19')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x50c835,_0x1e6f9c,_0x725a04){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x50c835,_0x1e6f9c,_0x725a04)['catch'](function(_0x5b5dab){logger[_0x9afb('0xa')]('[verifyAdditionalPhone]',inspectError(_0x5b5dab));});}exports[_0x9afb('0x1a')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x123510,_0x50a919,_0x324293){return cmHopperAdditionalPhone[_0x9afb('0x1b')](_0x123510,_0x50a919,_0x324293)[_0x9afb('0xd')](function(_0x337d81){logger['error'](_0x9afb('0x1c'),inspectError(_0x337d81));});}exports['swapAdditionalPhones']=swapAdditionalPhones;function avgHandleTime(_0x29e092){return cmHopperHistory['avgHandleTime'](_0x29e092)['catch'](function(_0x1e6100){logger[_0x9afb('0xa')](_0x9afb('0x1d'),inspectError(_0x1e6100));});}exports[_0x9afb('0x1e')]=avgHandleTime;function createHistory(_0x119e04){return cmHopperHistory[_0x9afb('0x1f')](_0x119e04)[_0x9afb('0xd')](function(_0x5aabd5){logger['error'](_0x9afb('0x20'),inspectError(_0x5aabd5));});}exports[_0x9afb('0x1f')]=createHistory; \ No newline at end of file +var _0xf494=['[checkIsBlackListIvr]','verifyAdditionalPhones','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','util','../../../../config/logger','dialer','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','catch','error','[getContactDialer]','getContactDialerIvr','temp','[countReScheduled]','countReScheduled','rescheduleContact','unlockContact','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0xf494,0x1c6));var _0x4f49=function(_0x24bfd6,_0x40e032){_0x24bfd6=_0x24bfd6-0x0;var _0x4f46c1=_0xf494[_0x24bfd6];return _0x4f46c1;};'use strict';var util=require(_0x4f49('0x0'));var logger=require(_0x4f49('0x1'))(_0x4f49('0x2'));var cmHopper=require('../../rpc/cmHopper');var cmHopperAdditionalPhone=require(_0x4f49('0x3'));var cmHopperBlack=require(_0x4f49('0x4'));var cmHopperHistory=require(_0x4f49('0x5'));function inspectError(_0x25677c){return util[_0x4f49('0x6')](_0x25677c,{'showHidden':![],'depth':null});}function getContactDialer(_0x2a15fb,_0x3267c1,_0x790e8b){return cmHopper[_0x4f49('0x7')](_0x2a15fb['id'],_0x3267c1,_0x790e8b,_0x2a15fb[_0x4f49('0x8')])[_0x4f49('0x9')](function(_0x5eb186){_0x2a15fb['temp']=0x0;logger[_0x4f49('0xa')](_0x4f49('0xb'),inspectError(_0x5eb186));});}exports[_0x4f49('0x7')]=getContactDialer;function getContactDialerIvr(_0x30ca57,_0x185174){return cmHopper[_0x4f49('0xc')](_0x30ca57['id'],_0x185174,_0x30ca57[_0x4f49('0x8')])[_0x4f49('0x9')](function(_0x53ee74){_0x30ca57[_0x4f49('0xd')]=0x0;logger[_0x4f49('0xa')]('[getContactDialerIvr]',inspectError(_0x53ee74));});}exports[_0x4f49('0xc')]=getContactDialerIvr;function countReScheduled(_0x5bbc75){return cmHopper['countReScheduled'](_0x5bbc75)[_0x4f49('0x9')](function(_0x12527d){logger['error'](_0x4f49('0xe'),inspectError(_0x12527d));});}exports[_0x4f49('0xf')]=countReScheduled;function rescheduleContact(_0x1b9145){return cmHopper[_0x4f49('0x10')](_0x1b9145)[_0x4f49('0x9')](function(_0x2f0131){logger[_0x4f49('0xa')]('[rescheduleContact]',inspectError(_0x2f0131));});}exports[_0x4f49('0x10')]=rescheduleContact;function unlockContact(_0x1f2d0d,_0x415e83,_0x5878f4){return cmHopper['unlockContact'](_0x1f2d0d,_0x415e83,_0x5878f4)[_0x4f49('0x9')](function(_0x2ecaaa){logger[_0x4f49('0xa')]('[unlockContact]',inspectError(_0x2ecaaa));});}exports[_0x4f49('0x11')]=unlockContact;function moveContactManagedDialer(_0x399be7){return cmHopper[_0x4f49('0x12')](_0x399be7)['catch'](function(_0x5bb23b){logger['error']('[moveContactManagedDialer]',inspectError(_0x5bb23b));});}exports[_0x4f49('0x12')]=moveContactManagedDialer;function checkIsBlackList(_0x1834f4){return cmHopperBlack[_0x4f49('0x13')](_0x1834f4)[_0x4f49('0x9')](function(_0x5793ac){logger[_0x4f49('0xa')](_0x4f49('0x14'),inspectError(_0x5793ac));});}exports[_0x4f49('0x13')]=checkIsBlackList;function checkIsBlackListIvr(_0xaab5e7){return cmHopperBlack[_0x4f49('0x15')](_0xaab5e7)['catch'](function(_0x3e7e28){logger[_0x4f49('0xa')](_0x4f49('0x16'),inspectError(_0x3e7e28));});}exports['checkIsBlackListIvr']=checkIsBlackListIvr;function verifyAdditionalPhones(_0x40755e,_0x1d70a7,_0x32ca7b){return cmHopperAdditionalPhone[_0x4f49('0x17')](_0x40755e,_0x1d70a7,_0x32ca7b)[_0x4f49('0x9')](function(_0x36187b){logger['error']('[verifyAdditionalPhone]',inspectError(_0x36187b));});}exports[_0x4f49('0x17')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x429de7,_0x4fedbb,_0x408552){return cmHopperAdditionalPhone[_0x4f49('0x18')](_0x429de7,_0x4fedbb,_0x408552)[_0x4f49('0x9')](function(_0x525950){logger[_0x4f49('0xa')](_0x4f49('0x19'),inspectError(_0x525950));});}exports[_0x4f49('0x18')]=swapAdditionalPhones;function avgHandleTime(_0x148153){return cmHopperHistory[_0x4f49('0x1a')](_0x148153)[_0x4f49('0x9')](function(_0x4915af){logger['error'](_0x4f49('0x1b'),inspectError(_0x4915af));});}exports[_0x4f49('0x1a')]=avgHandleTime;function createHistory(_0x605c91){return cmHopperHistory['createHistory'](_0x605c91)[_0x4f49('0x9')](function(_0x206203){logger[_0x4f49('0xa')]('[createHistory]',inspectError(_0x206203));});}exports['createHistory']=createHistory; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/index.js b/server/services/ami/dialer/utils/index.js index d2d6a0e..768fcf0 100644 --- a/server/services/ami/dialer/utils/index.js +++ b/server/services/ami/dialer/utils/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x165a=['isIVRCampaignActive','milliseconds','diff','message','available','loggedIn','loggedInDb','paused','talking','waiting','inUse','originated','Trunk','name','dialTimezone','isNil','dialGlobalInterval','Interval','isEmpty','Intervals','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','includes','status','TrunkBackup','ACTIVE','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','getQueueCampaignStatusMessage','pTalking','getQueueCampaignActiveStatusMessage','match','extractCalleridName','string','isUndefined','format','\x22%s\x22\x20<%s>','getCallerId','pow','replace','random','toString','getCallerIdRandom','error','decrementOriginate','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','createdAt','description','tags','XMD-','toUpperCase','setXMDContactVariables','util','../../../../config/logger','../../../../config/environment/shared','timezones','BLACKLIST','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','RECALLINQUEUE','RECALLFAILEDTIMEOUT','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','preview','isPreviewCampaign','type','isIVRCampaign','outbound','isOutboundQueue','dialActive','active'];(function(_0x4a31c5,_0x5a4ad9){var _0x59f364=function(_0x3c11d0){while(--_0x3c11d0){_0x4a31c5['push'](_0x4a31c5['shift']());}};_0x59f364(++_0x5a4ad9);}(_0x165a,0x12f));var _0xa165=function(_0x5c46e7,_0x2ec078){_0x5c46e7=_0x5c46e7-0x0;var _0x4467f3=_0x165a[_0x5c46e7];return _0x4467f3;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0xa165('0x0'));var logger=require(_0xa165('0x1'))('dialer');var timezones=require(_0xa165('0x2'))[_0xa165('0x3')];var CAMPAIGN_STATUS={'ACTIVE':'ACTIVE','BLACKLIST':_0xa165('0x4'),'CONTACTS_RESCHEDULED':'RESCHEDULED_CONTACTS','DEACTIVATED':'DEACTIVATED','DISACTIVED':_0xa165('0x5'),'EMPTY_INTERVAL':_0xa165('0x6'),'INACTIVE':_0xa165('0x7'),'NO_AGENTS_LOGGED':_0xa165('0x8'),'NO_AVAILABLE_CONTACTS':_0xa165('0x9'),'NULL_INTERVAL':_0xa165('0xa'),'OVERTIME_INTERVAL':'INTERVAL_IS_OVERTIME','OVERTIME_GLOBAL_INTERVAL':'GLOBAL_INTERVAL_IS_OVERTIME','QUEUE_RECALL':_0xa165('0xb'),'RECALL_TIMEOUT':_0xa165('0xc'),'RUNNING':'RUNNING','UNKNOWN_TIMEZONE':_0xa165('0xd'),'UNREACHABLE_TRUNK':_0xa165('0xe')};exports[_0xa165('0xf')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x518661){return _0x518661[_0xa165('0x10')]===_0xa165('0x11');}exports[_0xa165('0x12')]=isPreviewCampaign;function isIVRCampaign(_0x2b8e6c){return _0x2b8e6c[_0xa165('0x13')]==='ivr';}exports[_0xa165('0x14')]=isIVRCampaign;function isOutboundQueue(_0x3a635d){return _0x3a635d['type']===_0xa165('0x15');}exports[_0xa165('0x16')]=isOutboundQueue;function isQueueCampaignActive(_0x3d1db1){return _0x3d1db1[_0xa165('0x17')];}exports['isQueueCampaignActive']=isQueueCampaignActive;function isIVRCampaignActive(_0x4d59c9){return _0x4d59c9[_0xa165('0x18')];}exports[_0xa165('0x19')]=isIVRCampaignActive;function getSeconds(_0x539f02,_0x4951ee){var _0x338167=moment(_0x539f02)[_0xa165('0x1a')](0x0);var _0xbdb204=moment(_0x4951ee)[_0xa165('0x1a')](0x0);return _0x338167[_0xa165('0x1b')](_0xbdb204,'seconds');}exports['getSeconds']=getSeconds;function hasQueueCampaignDataChanged(_0x80d9e0,_0x46d61b){var _0x31062a=![];var _0x2479bf=_0x80d9e0[_0xa165('0x10')]!==_0x46d61b['dialMethod']||_0x80d9e0[_0xa165('0x17')]!==_0x46d61b['dialActive']||_0x80d9e0[_0xa165('0x1c')]!==_0x46d61b[_0xa165('0x1c')];var _0x5c5e25=_0x80d9e0[_0xa165('0x1d')]!==_0x46d61b['available']||_0x80d9e0[_0xa165('0x1e')]!==_0x46d61b[_0xa165('0x1e')]||_0x80d9e0[_0xa165('0x1f')]!==_0x46d61b[_0xa165('0x1f')]||_0x80d9e0['paused']!==_0x46d61b[_0xa165('0x20')]||_0x80d9e0[_0xa165('0x21')]!==_0x46d61b['talking']||_0x80d9e0['pTalking']!==_0x46d61b['pTalking']||_0x80d9e0[_0xa165('0x22')]!==_0x46d61b[_0xa165('0x22')]||_0x80d9e0['inUse']!==_0x46d61b[_0xa165('0x23')]||_0x80d9e0[_0xa165('0x24')]!==_0x46d61b[_0xa165('0x24')];if(_0x80d9e0[_0xa165('0x25')]&&_0x46d61b['Trunk']){_0x31062a=_0x80d9e0['Trunk']['name']!==_0x46d61b[_0xa165('0x25')][_0xa165('0x26')]||_0x80d9e0[_0xa165('0x25')][_0xa165('0x18')]!==_0x46d61b[_0xa165('0x25')]['active'];}return _0x2479bf||_0x5c5e25||_0x31062a;}exports['hasQueueCampaignDataChanged']=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x1dd208){var _0x1a5b82=null;var _0x5a7d16=_0x1dd208[_0xa165('0x27')];if(_[_0xa165('0x28')](_0x1dd208[_0xa165('0x29')])||_['isNil'](_0x1dd208[_0xa165('0x2a')])||_['isNil'](_0x1dd208[_0xa165('0x2a')]['Intervals'])){_0x1a5b82=CAMPAIGN_STATUS['NULL_INTERVAL'];}else if(_[_0xa165('0x2b')](_0x1dd208[_0xa165('0x29')])||_[_0xa165('0x2b')](_0x1dd208['Interval'][_0xa165('0x2c')])){_0x1a5b82=CAMPAIGN_STATUS['EMPTY_INTERVAL'];}else if(_0x5a7d16&&!timezones[_0x5a7d16]){_0x1a5b82=CAMPAIGN_STATUS[_0xa165('0x2d')];}return _0x1a5b82;}function checkAnyValidTrunk(_0x307f0a,_0x120564){var _0x59d49d=null;var _0xbd6dfb=_0xa165('0x2e');var _0x360bf3=[_0xa165('0x2f'),_0xa165('0x30')];var _0x1b3adf=!![];if(_0x307f0a[_0xa165('0x25')]&&_0x307f0a[_0xa165('0x25')][_0xa165('0x18')]){_0xbd6dfb+=_0x307f0a[_0xa165('0x25')][_0xa165('0x26')];_0x59d49d=_0x120564[_0xbd6dfb];_0x1b3adf=_0x360bf3[_0xa165('0x31')](_0x59d49d[_0xa165('0x32')]);}else if(_0x307f0a[_0xa165('0x33')]&&_0x307f0a[_0xa165('0x33')]['active']){_0xbd6dfb+=_0x307f0a[_0xa165('0x33')][_0xa165('0x26')];_0x59d49d=_0x120564[_0xbd6dfb];_0x1b3adf=_0x360bf3[_0xa165('0x31')](_0x59d49d[_0xa165('0x32')]);}return _0x1b3adf;}function getQueueCampaignStatusMessage(_0x2a614c,_0x199b3c){var _0x2eb8a4=CAMPAIGN_STATUS[_0xa165('0x34')];var _0x260e6d=isPreviewCampaign(_0x2a614c);if(!isQueueCampaignActive(_0x2a614c)){if(_0x260e6d){_0x2eb8a4=CAMPAIGN_STATUS['INACTIVE'];}else{if(_0x2a614c['originated']===0x0&&_0x2a614c[_0xa165('0x21')]===0x0&&_0x2a614c[_0xa165('0x22')]===0x0&&(_0x2a614c['pTalking']||0x0)===0x0){_0x2eb8a4=CAMPAIGN_STATUS[_0xa165('0x35')];}else{_0x2eb8a4=CAMPAIGN_STATUS[_0xa165('0x36')];}}}else if(_0x2a614c[_0xa165('0x1e')]===0x0){_0x2eb8a4=CAMPAIGN_STATUS[_0xa165('0x37')];}else if(!checkAnyValidTrunk(_0x2a614c,_0x199b3c)){_0x2eb8a4=CAMPAIGN_STATUS['UNREACHABLE_TRUNK'];}else if(!isPreviewCampaign(_0x2a614c)){var _0x46e603=checkAnyValidQueueCampaignInterval(_0x2a614c);if(_0x46e603){_0x2eb8a4=_0x46e603;}}return _0x2eb8a4;}exports[_0xa165('0x38')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x364a9a){var _0x4c2fb0=CAMPAIGN_STATUS[_0xa165('0x36')];if(_0x364a9a[_0xa165('0x24')]===0x0&&_0x364a9a[_0xa165('0x21')]===0x0&&_0x364a9a[_0xa165('0x22')]===0x0&&(_0x364a9a[_0xa165('0x39')]||0x0)===0x0){_0x4c2fb0=CAMPAIGN_STATUS[_0xa165('0x35')];}return _0x4c2fb0;}exports[_0xa165('0x3a')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x38a0d7){var _0x3af671=_0x38a0d7[_0xa165('0x3b')](/"(.*?)"/);return _0x3af671?_0x3af671[0x1]:_0x38a0d7;}exports[_0xa165('0x3c')]=extractCalleridName;function getCallerId(_0x185ed9,_0x1ac81c,_0x211655){if(!_['isUndefined'](_0x211655)&&typeof _0x211655===_0xa165('0x3d')&&!_[_0xa165('0x2b')](_0x211655)){if(!_[_0xa165('0x3e')](_0x1ac81c)&&typeof _0x1ac81c===_0xa165('0x3d')&&!_[_0xa165('0x2b')](_0x1ac81c)){return util[_0xa165('0x3f')](_0xa165('0x40'),_0x1ac81c,_0x211655);}return util[_0xa165('0x3f')](_0xa165('0x40'),_0x211655,_0x211655);}if(!_[_0xa165('0x3e')](_0x185ed9)&&typeof _0x185ed9===_0xa165('0x3d')&&!_[_0xa165('0x2b')](_0x185ed9)){return _0x185ed9;}return'\x22\x22\x20<>';}exports[_0xa165('0x41')]=getCallerId;function getCallerIdRandom(_0x4cc417,_0x390de3){var _0x4c1ab7;var _0x480548;var _0x3d26db;if(_0x390de3<=0x0){_0x390de3=0x1;}_0x4c1ab7=new RegExp('\x5cw{0,'+_0x390de3+'}$');_0x480548=Math[_0xa165('0x42')](0xa,_0x390de3-0x1);_0x3d26db=Math['pow'](0xa,_0x390de3)-0x1;return util[_0xa165('0x3f')]('%s',_[_0xa165('0x43')](_0x4cc417,_0x4c1ab7,_[_0xa165('0x44')](_0x480548,_0x3d26db)[_0xa165('0x45')]()));}exports[_0xa165('0x46')]=getCallerIdRandom;function decrementOriginate(_0x20251e){if(_0x20251e[_0xa165('0x24')]&&_0x20251e[_0xa165('0x24')]>0x0){_0x20251e[_0xa165('0x24')]-=0x1;}else{logger[_0xa165('0x47')]('[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative');}}exports[_0xa165('0x48')]=decrementOriginate;function checkContactEmpty(_0x3feca3){return _0x3feca3&&_0x3feca3['length']>0x0;}exports[_0xa165('0x49')]=checkContactEmpty;function erlangb(_0x45cc9b,_0x13116a){if(_0x13116a===0x0){return 0x0;}var _0x51b6a0=0x1;for(var _0x3c0f4e=0x1;_0x3c0f4e<=_0x13116a;_0x3c0f4e+=0x1){_0x51b6a0=0x1+_0x51b6a0*_0x3c0f4e/_0x45cc9b;}return 0x1/_0x51b6a0;}exports[_0xa165('0x4a')]=erlangb;function checkContactLowerLimitOriginate(_0x50d319,_0x316caa,_0x551db9){if(_0x316caa>_0x551db9){for(var _0x239128=0x0;_0x239128<_0x316caa-_0x551db9;_0x239128+=0x1){decrementOriginate(_0x50d319);}}}exports[_0xa165('0x4b')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x4ad06f){var _0x4e3574={};var _0x3e55cb=['id',_0xa165('0x4c'),_0xa165('0x4d'),_0xa165('0x4e'),'updatedAt'];if(_0x4ad06f){for(var _0x3da808 in _0x4ad06f){if(typeof _0x4ad06f[_0x3da808]!=='undefined'){if(!_[_0xa165('0x28')](_0x4ad06f[_0x3da808])&&!_0x3e55cb['includes'](_0x3da808)){_0x4e3574[util[_0xa165('0x3f')]('%s%s',_0xa165('0x4f'),_0x3da808[_0xa165('0x50')]())]=_0x4ad06f[_0x3da808];}}}}return _0x4e3574;}exports[_0xa165('0x51')]=setXMDContactVariables; \ No newline at end of file +var _0x7eba=['preview','isPreviewCampaign','type','ivr','isIVRCampaign','isOutboundQueue','dialActive','isIVRCampaignActive','milliseconds','diff','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','active','hasQueueCampaignDataChanged','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','SIP/','unmonitored','includes','status','TrunkBackup','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','match','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','getCallerId','\x5cw{0,','pow','random','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','erlangb','description','updatedAt','undefined','%s%s','XMD-','toUpperCase','setXMDContactVariables','lodash','moment','util','dialer','../../../../config/environment/shared','timezones','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','CAMPAIGN_STATUS','dialMethod'];(function(_0x2a3c0c,_0x27709d){var _0x1b0fd0=function(_0x120a7f){while(--_0x120a7f){_0x2a3c0c['push'](_0x2a3c0c['shift']());}};_0x1b0fd0(++_0x27709d);}(_0x7eba,0x1a4));var _0xa7eb=function(_0x4c40b3,_0x27fb35){_0x4c40b3=_0x4c40b3-0x0;var _0x1d7e31=_0x7eba[_0x4c40b3];return _0x1d7e31;};'use strict';var _=require(_0xa7eb('0x0'));var moment=require(_0xa7eb('0x1'));var util=require(_0xa7eb('0x2'));var logger=require('../../../../config/logger')(_0xa7eb('0x3'));var timezones=require(_0xa7eb('0x4'))[_0xa7eb('0x5')];var CAMPAIGN_STATUS={'ACTIVE':'ACTIVE','BLACKLIST':'BLACKLIST','CONTACTS_RESCHEDULED':_0xa7eb('0x6'),'DEACTIVATED':_0xa7eb('0x7'),'DISACTIVED':_0xa7eb('0x8'),'EMPTY_INTERVAL':'INTERVAL_IS_EMPTY','INACTIVE':_0xa7eb('0x9'),'NO_AGENTS_LOGGED':_0xa7eb('0xa'),'NO_AVAILABLE_CONTACTS':_0xa7eb('0xb'),'NULL_INTERVAL':'INTERVAL_IS_NULL','OVERTIME_INTERVAL':_0xa7eb('0xc'),'OVERTIME_GLOBAL_INTERVAL':_0xa7eb('0xd'),'QUEUE_RECALL':_0xa7eb('0xe'),'RECALL_TIMEOUT':_0xa7eb('0xf'),'RUNNING':_0xa7eb('0x10'),'UNKNOWN_TIMEZONE':_0xa7eb('0x11'),'UNREACHABLE_TRUNK':'TRUNK_IS_NOT_REACHABLE'};exports[_0xa7eb('0x12')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x3bed22){return _0x3bed22[_0xa7eb('0x13')]===_0xa7eb('0x14');}exports[_0xa7eb('0x15')]=isPreviewCampaign;function isIVRCampaign(_0xc48bb4){return _0xc48bb4[_0xa7eb('0x16')]===_0xa7eb('0x17');}exports[_0xa7eb('0x18')]=isIVRCampaign;function isOutboundQueue(_0x477201){return _0x477201[_0xa7eb('0x16')]==='outbound';}exports[_0xa7eb('0x19')]=isOutboundQueue;function isQueueCampaignActive(_0x39db87){return _0x39db87[_0xa7eb('0x1a')];}exports['isQueueCampaignActive']=isQueueCampaignActive;function isIVRCampaignActive(_0x5c8fc5){return _0x5c8fc5['active'];}exports[_0xa7eb('0x1b')]=isIVRCampaignActive;function getSeconds(_0x573e1f,_0x298dc7){var _0x465a19=moment(_0x573e1f)[_0xa7eb('0x1c')](0x0);var _0x94b58d=moment(_0x298dc7)[_0xa7eb('0x1c')](0x0);return _0x465a19[_0xa7eb('0x1d')](_0x94b58d,'seconds');}exports[_0xa7eb('0x1e')]=getSeconds;function hasQueueCampaignDataChanged(_0x3ebbea,_0x235424){var _0x163151=![];var _0x4bfbd0=_0x3ebbea[_0xa7eb('0x13')]!==_0x235424[_0xa7eb('0x13')]||_0x3ebbea[_0xa7eb('0x1a')]!==_0x235424['dialActive']||_0x3ebbea[_0xa7eb('0x1f')]!==_0x235424['message'];var _0x47343e=_0x3ebbea[_0xa7eb('0x20')]!==_0x235424[_0xa7eb('0x20')]||_0x3ebbea[_0xa7eb('0x21')]!==_0x235424[_0xa7eb('0x21')]||_0x3ebbea[_0xa7eb('0x22')]!==_0x235424['loggedInDb']||_0x3ebbea[_0xa7eb('0x23')]!==_0x235424[_0xa7eb('0x23')]||_0x3ebbea['talking']!==_0x235424[_0xa7eb('0x24')]||_0x3ebbea['pTalking']!==_0x235424[_0xa7eb('0x25')]||_0x3ebbea[_0xa7eb('0x26')]!==_0x235424[_0xa7eb('0x26')]||_0x3ebbea['inUse']!==_0x235424[_0xa7eb('0x27')]||_0x3ebbea[_0xa7eb('0x28')]!==_0x235424[_0xa7eb('0x28')];if(_0x3ebbea[_0xa7eb('0x29')]&&_0x235424['Trunk']){_0x163151=_0x3ebbea['Trunk'][_0xa7eb('0x2a')]!==_0x235424[_0xa7eb('0x29')][_0xa7eb('0x2a')]||_0x3ebbea['Trunk']['active']!==_0x235424['Trunk'][_0xa7eb('0x2b')];}return _0x4bfbd0||_0x47343e||_0x163151;}exports[_0xa7eb('0x2c')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x4db71b){var _0x473133=null;var _0x271a33=_0x4db71b['dialTimezone'];if(_[_0xa7eb('0x2d')](_0x4db71b[_0xa7eb('0x2e')])||_[_0xa7eb('0x2d')](_0x4db71b[_0xa7eb('0x2f')])||_[_0xa7eb('0x2d')](_0x4db71b[_0xa7eb('0x2f')][_0xa7eb('0x30')])){_0x473133=CAMPAIGN_STATUS[_0xa7eb('0x31')];}else if(_[_0xa7eb('0x32')](_0x4db71b[_0xa7eb('0x2e')])||_[_0xa7eb('0x32')](_0x4db71b[_0xa7eb('0x2f')]['Intervals'])){_0x473133=CAMPAIGN_STATUS[_0xa7eb('0x33')];}else if(_0x271a33&&!timezones[_0x271a33]){_0x473133=CAMPAIGN_STATUS['UNKNOWN_TIMEZONE'];}return _0x473133;}function checkAnyValidTrunk(_0x1f87ac,_0xb19315){var _0xb242df=null;var _0x34be16=_0xa7eb('0x34');var _0x254ec6=['reachable',_0xa7eb('0x35')];var _0xe875a5=!![];if(_0x1f87ac[_0xa7eb('0x29')]&&_0x1f87ac[_0xa7eb('0x29')][_0xa7eb('0x2b')]){_0x34be16+=_0x1f87ac['Trunk'][_0xa7eb('0x2a')];_0xb242df=_0xb19315[_0x34be16];_0xe875a5=_0x254ec6[_0xa7eb('0x36')](_0xb242df[_0xa7eb('0x37')]);}else if(_0x1f87ac['TrunkBackup']&&_0x1f87ac[_0xa7eb('0x38')][_0xa7eb('0x2b')]){_0x34be16+=_0x1f87ac[_0xa7eb('0x38')][_0xa7eb('0x2a')];_0xb242df=_0xb19315[_0x34be16];_0xe875a5=_0x254ec6[_0xa7eb('0x36')](_0xb242df[_0xa7eb('0x37')]);}return _0xe875a5;}function getQueueCampaignStatusMessage(_0x4ebaca,_0x10c9f3){var _0x203cd2=CAMPAIGN_STATUS['ACTIVE'];var _0x1169c8=isPreviewCampaign(_0x4ebaca);if(!isQueueCampaignActive(_0x4ebaca)){if(_0x1169c8){_0x203cd2=CAMPAIGN_STATUS[_0xa7eb('0x39')];}else{if(_0x4ebaca[_0xa7eb('0x28')]===0x0&&_0x4ebaca['talking']===0x0&&_0x4ebaca[_0xa7eb('0x26')]===0x0&&(_0x4ebaca[_0xa7eb('0x25')]||0x0)===0x0){_0x203cd2=CAMPAIGN_STATUS[_0xa7eb('0x39')];}else{_0x203cd2=CAMPAIGN_STATUS[_0xa7eb('0x3a')];}}}else if(_0x4ebaca['loggedIn']===0x0){_0x203cd2=CAMPAIGN_STATUS[_0xa7eb('0x3b')];}else if(!checkAnyValidTrunk(_0x4ebaca,_0x10c9f3)){_0x203cd2=CAMPAIGN_STATUS[_0xa7eb('0x3c')];}else if(!isPreviewCampaign(_0x4ebaca)){var _0x402f00=checkAnyValidQueueCampaignInterval(_0x4ebaca);if(_0x402f00){_0x203cd2=_0x402f00;}}return _0x203cd2;}exports[_0xa7eb('0x3d')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x85f66){var _0x553ce7=CAMPAIGN_STATUS[_0xa7eb('0x3a')];if(_0x85f66[_0xa7eb('0x28')]===0x0&&_0x85f66['talking']===0x0&&_0x85f66['waiting']===0x0&&(_0x85f66[_0xa7eb('0x25')]||0x0)===0x0){_0x553ce7=CAMPAIGN_STATUS['INACTIVE'];}return _0x553ce7;}exports[_0xa7eb('0x3e')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x2f0713){var _0x5a9e21=_0x2f0713[_0xa7eb('0x3f')](/"(.*?)"/);return _0x5a9e21?_0x5a9e21[0x1]:_0x2f0713;}exports[_0xa7eb('0x40')]=extractCalleridName;function getCallerId(_0x1f0c1d,_0xa03e1e,_0x522906){if(!_[_0xa7eb('0x41')](_0x522906)&&typeof _0x522906===_0xa7eb('0x42')&&!_[_0xa7eb('0x32')](_0x522906)){if(!_['isUndefined'](_0xa03e1e)&&typeof _0xa03e1e===_0xa7eb('0x42')&&!_[_0xa7eb('0x32')](_0xa03e1e)){return util[_0xa7eb('0x43')](_0xa7eb('0x44'),_0xa03e1e,_0x522906);}return util[_0xa7eb('0x43')]('\x22%s\x22\x20<%s>',_0x522906,_0x522906);}if(!_[_0xa7eb('0x41')](_0x1f0c1d)&&typeof _0x1f0c1d===_0xa7eb('0x42')&&!_['isEmpty'](_0x1f0c1d)){return _0x1f0c1d;}return'\x22\x22\x20<>';}exports[_0xa7eb('0x45')]=getCallerId;function getCallerIdRandom(_0x39ebc2,_0xfae1bb){var _0x157b45;var _0x282b19;var _0x67e750;if(_0xfae1bb<=0x0){_0xfae1bb=0x1;}_0x157b45=new RegExp(_0xa7eb('0x46')+_0xfae1bb+'}$');_0x282b19=Math[_0xa7eb('0x47')](0xa,_0xfae1bb-0x1);_0x67e750=Math['pow'](0xa,_0xfae1bb)-0x1;return util['format']('%s',_['replace'](_0x39ebc2,_0x157b45,_[_0xa7eb('0x48')](_0x282b19,_0x67e750)[_0xa7eb('0x49')]()));}exports[_0xa7eb('0x4a')]=getCallerIdRandom;function decrementOriginate(_0x55977a){if(_0x55977a[_0xa7eb('0x28')]&&_0x55977a[_0xa7eb('0x28')]>0x0){_0x55977a['originated']-=0x1;}else{logger[_0xa7eb('0x4b')](_0xa7eb('0x4c'));}}exports[_0xa7eb('0x4d')]=decrementOriginate;function checkContactEmpty(_0x132efb){return _0x132efb&&_0x132efb[_0xa7eb('0x4e')]>0x0;}exports[_0xa7eb('0x4f')]=checkContactEmpty;function erlangb(_0x33b387,_0x4006a1){if(_0x4006a1===0x0){return 0x0;}var _0x59d92b=0x1;for(var _0x3e8fe7=0x1;_0x3e8fe7<=_0x4006a1;_0x3e8fe7+=0x1){_0x59d92b=0x1+_0x59d92b*_0x3e8fe7/_0x33b387;}return 0x1/_0x59d92b;}exports[_0xa7eb('0x50')]=erlangb;function checkContactLowerLimitOriginate(_0x2a4118,_0x3b57bb,_0x43b0ff){if(_0x3b57bb>_0x43b0ff){for(var _0x18c8b5=0x0;_0x18c8b5<_0x3b57bb-_0x43b0ff;_0x18c8b5+=0x1){decrementOriginate(_0x2a4118);}}}exports['checkContactLowerLimitOriginate']=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x344a65){var _0x1912a3={};var _0x277438=['id','createdAt',_0xa7eb('0x51'),'tags',_0xa7eb('0x52')];if(_0x344a65){for(var _0x440ff2 in _0x344a65){if(typeof _0x344a65[_0x440ff2]!==_0xa7eb('0x53')){if(!_[_0xa7eb('0x2d')](_0x344a65[_0x440ff2])&&!_0x277438[_0xa7eb('0x36')](_0x440ff2)){_0x1912a3[util[_0xa7eb('0x43')](_0xa7eb('0x54'),_0xa7eb('0x55'),_0x440ff2[_0xa7eb('0x56')]())]=_0x344a65[_0x440ff2];}}}}return _0x1912a3;}exports[_0xa7eb('0x57')]=setXMDContactVariables; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 3694575..a870afe 100644 --- a/server/services/ami/fax/action.js +++ b/server/services/ami/fax/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x1f0aba,_0x438de9){var _0x545a52=function(_0x4bed40){while(--_0x4bed40){_0x1f0aba['push'](_0x1f0aba['shift']());}};_0x545a52(++_0x438de9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file +var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x1695b9,_0x2994e4){var _0x3049bf=function(_0x4bed9e){while(--_0x4bed9e){_0x1695b9['push'](_0x1695b9['shift']());}};_0x3049bf(++_0x2994e4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index 4e8f981..2e23e11 100644 --- a/server/services/ami/fax/index.js +++ b/server/services/ami/fax/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3080=['[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','util','lodash','uuid','moment','path','tiff2pdf','../../../config/logger','fax','./rpcDb','./channel','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','syncNewchannel','varset','syncVarSet','bind','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','prototype','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','resolution','calleridnum','pagestransferred','\x20result\x20conversion\x20file\x20','message','parse','.pdf','application/pdf','then','notify','catch','error','stringify','\x20receiveFax\x20','merge','pick','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate1]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','checkTrunk','Trunk','Trunk\x20Reachable','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','format','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly'];(function(_0x42855f,_0x3c26c1){var _0x38511b=function(_0x4dab30){while(--_0x4dab30){_0x42855f['push'](_0x42855f['shift']());}};_0x38511b(++_0x3c26c1);}(_0x3080,0xf3));var _0x0308=function(_0x4d184c,_0x1169e3){_0x4d184c=_0x4d184c-0x0;var _0x3b254a=_0x3080[_0x4d184c];return _0x3b254a;};'use strict';var util=require(_0x0308('0x0'));var _=require(_0x0308('0x1'));var BPromise=require('bluebird');var uuid=require(_0x0308('0x2'));var moment=require(_0x0308('0x3'));var path=require(_0x0308('0x4'));var tiff2pdf=require(_0x0308('0x5'));var gs=require('./util/gs');var logger=require(_0x0308('0x6'))(_0x0308('0x7'));var ami=require('../ami');var rpcDb=require(_0x0308('0x8'));var Channel=require(_0x0308('0x9'));var ut=require('./util/util');var Action=require(_0x0308('0xa'));var faxAccount=require(_0x0308('0xb'));var attachment=require(_0x0308('0xc'));var faxMessage=require(_0x0308('0xd'));function Fax(_0x27bb6b){this[_0x0308('0xe')]={};this[_0x0308('0xf')]=_0x27bb6b['faxAccounts'];this[_0x0308('0x10')]=_0x27bb6b[_0x0308('0x10')];this[_0x0308('0x11')]={};ami['on']('newchannel',this[_0x0308('0x12')]['bind'](this));ami['on'](_0x0308('0x13'),this[_0x0308('0x14')][_0x0308('0x15')](this));ami['on'](_0x0308('0x16'),this[_0x0308('0x17')][_0x0308('0x15')](this));ami['on'](_0x0308('0x18'),this[_0x0308('0x19')][_0x0308('0x15')](this));ami['on'](_0x0308('0x1a'),this[_0x0308('0x1b')]['bind'](this));ami['on'](_0x0308('0x1c'),this[_0x0308('0x1d')][_0x0308('0x15')](this));ami['on'](_0x0308('0x1e'),this[_0x0308('0x1f')][_0x0308('0x15')](this));ami['on'](_0x0308('0x20'),this[_0x0308('0x21')][_0x0308('0x15')](this));}Fax['prototype'][_0x0308('0x12')]=function(_0x54e36e){if(_0x54e36e[_0x0308('0x22')]===_0x0308('0x23')){for(var _0x49e99f in this[_0x0308('0xf')]){if(this[_0x0308('0xf')][_0x0308('0x24')](_0x49e99f)){if(_0x54e36e[_0x0308('0x25')]===this[_0x0308('0xf')][_0x49e99f][_0x0308('0x26')]){this[_0x0308('0xe')][_0x54e36e['uniqueid']]={};this[_0x0308('0xe')][_0x54e36e[_0x0308('0x27')]]['channel']=_0x54e36e[_0x0308('0x28')];this[_0x0308('0xe')][_0x54e36e[_0x0308('0x27')]]['id']=this[_0x0308('0xf')][_0x49e99f]['id'];this[_0x0308('0xe')][_0x54e36e[_0x0308('0x27')]][_0x0308('0x29')]=this['faxAccounts'][_0x49e99f][_0x0308('0x29')];logger[_0x0308('0x2a')](_0x54e36e[_0x0308('0x27')],'\x20syncNewchannel\x20');}}}}if(this[_0x0308('0x11')][_0x54e36e[_0x0308('0x27')]]){this[_0x0308('0xe')][_0x54e36e[_0x0308('0x27')]]={};this[_0x0308('0xe')][_0x54e36e[_0x0308('0x27')]][_0x0308('0x28')]=_0x54e36e[_0x0308('0x28')];logger[_0x0308('0x2a')](_0x54e36e[_0x0308('0x27')],'\x20syncNewchannel\x20');}};Fax[_0x0308('0x2b')][_0x0308('0x14')]=function(_0x3ebd90){if(this[_0x0308('0xe')][_0x3ebd90[_0x0308('0x27')]]){for(var _0x3febec in _0x3ebd90[_0x0308('0x2c')]){if(_0x3ebd90[_0x0308('0x2c')][_0x0308('0x24')](_0x3febec)){this['channels'][_0x3ebd90[_0x0308('0x27')]][_0x3febec]=_0x3ebd90[_0x0308('0x2d')];}}}};Fax[_0x0308('0x2b')][_0x0308('0x17')]=function(_0x48cf39){if(this['channels'][_0x48cf39['uniqueid']]){this[_0x0308('0xe')][_0x48cf39['uniqueid']][_0x0308('0x2e')]=_0x48cf39['channelstate'];this[_0x0308('0xe')][_0x48cf39[_0x0308('0x27')]][_0x0308('0x2f')]=_0x48cf39[_0x0308('0x2f')];}};Fax[_0x0308('0x2b')][_0x0308('0x19')]=function(_0x1152b2){if(this['channels'][_0x1152b2[_0x0308('0x27')]]){for(var _0x3b4189 in _0x1152b2[_0x0308('0x2c')]){if(_0x1152b2[_0x0308('0x2c')]['hasOwnProperty'](_0x3b4189)){this[_0x0308('0xe')][_0x1152b2['uniqueid']][_0x3b4189]=_0x1152b2[_0x0308('0x2d')];}}}};Fax[_0x0308('0x2b')][_0x0308('0x1b')]=function(_0x551ace){if(this[_0x0308('0xe')][_0x551ace['uniqueid']]){this['channels'][_0x551ace[_0x0308('0x27')]][_0x0308('0x30')]=_0x551ace[_0x0308('0x30')];this[_0x0308('0xe')][_0x551ace[_0x0308('0x27')]][_0x0308('0x31')]=_0x551ace[_0x0308('0x31')];this['channels'][_0x551ace[_0x0308('0x27')]][_0x0308('0x26')]=_0x551ace['localstationid'];this[_0x0308('0xe')][_0x551ace[_0x0308('0x27')]][_0x0308('0x32')]=_0x551ace['filename'];logger[_0x0308('0x2a')](_0x551ace[_0x0308('0x27')],_0x0308('0x33'));}};Fax[_0x0308('0x2b')]['syncReceiveFax']=function(_0x2e3be9){var _0x81c4a0=this;if(this[_0x0308('0xe')][_0x2e3be9[_0x0308('0x27')]]){var _0x19da89=this[_0x0308('0xe')][_0x2e3be9['uniqueid']]['id'];this['channels'][_0x2e3be9[_0x0308('0x27')]]['remotestationid']=_0x2e3be9[_0x0308('0x34')];this[_0x0308('0xe')][_0x2e3be9[_0x0308('0x27')]]['pagestransferred']=_0x2e3be9['pagestransferred'];this['channels'][_0x2e3be9[_0x0308('0x27')]][_0x0308('0x26')]=_0x2e3be9[_0x0308('0x26')];this['channels'][_0x2e3be9[_0x0308('0x27')]][_0x0308('0x35')]=_0x2e3be9[_0x0308('0x35')];this[_0x0308('0xe')][_0x2e3be9[_0x0308('0x27')]]['transferrate']=_0x2e3be9['transferrate'];this[_0x0308('0xe')][_0x2e3be9[_0x0308('0x27')]][_0x0308('0x32')]=_0x2e3be9['filename'];this[_0x0308('0xe')][_0x2e3be9['uniqueid']][_0x0308('0x36')]=_0x2e3be9[_0x0308('0x36')];if(this[_0x0308('0xe')][_0x2e3be9[_0x0308('0x27')]][_0x0308('0x37')]>0x0){tiff2pdf(_0x2e3be9[_0x0308('0x32')],'/var/opt/motion2/server/files/attachments/',function(_0x1cbd2d){logger['info'](_0x2e3be9[_0x0308('0x27')],_0x0308('0x38'),_0x1cbd2d[_0x0308('0x39')]);attachment['create']({'name':path[_0x0308('0x3a')](_0x2e3be9['filename'])['name'],'basename':path[_0x0308('0x3a')](_0x2e3be9[_0x0308('0x32')])[_0x0308('0x29')]+_0x0308('0x3b'),'type':_0x0308('0x3c')})[_0x0308('0x3d')](function(_0x1310b8){faxAccount[_0x0308('0x3e')](_0x19da89,{'from':_0x2e3be9[_0x0308('0x36')],'mapKey':_0x0308('0x7'),'body':path[_0x0308('0x3a')](_0x2e3be9[_0x0308('0x32')])[_0x0308('0x29')]+_0x0308('0x3b'),'AttachmentId':_0x1310b8['id']})[_0x0308('0x3f')](function(_0x1ccdad){logger[_0x0308('0x40')](_0x2e3be9['uniqueid'],'\x20notify\x20',JSON[_0x0308('0x41')](_0x1ccdad));});})[_0x0308('0x3f')](function(_0x1e0e6d){logger['error'](_0x2e3be9[_0x0308('0x27')],_0x0308('0x42'),JSON['stringify'](_0x1e0e6d));});});}logger[_0x0308('0x2a')](_0x2e3be9['uniqueid'],_0x0308('0x42'));}};Fax['prototype'][_0x0308('0x21')]=function(_0x3ddf7c){if(this[_0x0308('0x11')][_0x3ddf7c['uniqueid']]){_[_0x0308('0x43')](this[_0x0308('0xe')][_0x3ddf7c[_0x0308('0x27')]],_[_0x0308('0x44')](_0x3ddf7c,['response','reason']));}};function updateStatus(_0x27bf57){if(_0x27bf57[_0x0308('0x45')]){faxMessage[_0x0308('0x46')](_0x27bf57[_0x0308('0x45')],{'failMessage':_0x0308('0x47')})[_0x0308('0x3d')](function(_0x140dfc){ut[_0x0308('0x48')]('[Fax][Message][Error][Updated]',_0x140dfc);})['catch'](function(_0x121bba){ut['logger'](_0x0308('0x49'),_0x121bba);});}else{ut[_0x0308('0x48')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x0308('0x2b')][_0x0308('0x4a')]=function(_0x28b57d,_0x594263,_0x483e5c){var _0x5be875=this;var _0xa42846={};if(_0x594263){_0xa42846={'read':_0x594263};}else{_0xa42846={'failMessage':_0x483e5c};}if(this[_0x0308('0x11')][_0x28b57d][_0x0308('0x45')]){faxMessage[_0x0308('0x46')](this['actions'][_0x28b57d][_0x0308('0x45')],_0xa42846)[_0x0308('0x3d')](function(_0x583f09){ut['logger'](_0x0308('0x4b'),_0x583f09);})['catch'](function(_0x4e6856){ut[_0x0308('0x48')](_0x0308('0x4c'),_0x4e6856);})[_0x0308('0x4d')](function(){delete _0x5be875[_0x0308('0xe')][_0x28b57d];delete _0x5be875['actions'][_0x28b57d];});}else{ut['logger'](_0x0308('0x4e'));delete this['channels'][_0x28b57d];delete this[_0x0308('0x11')][_0x28b57d];}};Fax[_0x0308('0x2b')][_0x0308('0x1f')]=function(_0x5c9a38){var _0x1fbca6=this;if(this[_0x0308('0xe')][_0x5c9a38[_0x0308('0x27')]]){if(this[_0x0308('0x11')][_0x5c9a38[_0x0308('0x27')]]){this[_0x0308('0xe')][_0x5c9a38[_0x0308('0x27')]]['id']=this[_0x0308('0x11')][_0x5c9a38[_0x0308('0x27')]]['id'];this[_0x0308('0xe')][_0x5c9a38[_0x0308('0x27')]][_0x0308('0x29')]=this['actions'][_0x5c9a38[_0x0308('0x27')]][_0x0308('0x29')];}logger[_0x0308('0x2a')](_0x5c9a38[_0x0308('0x27')],this[_0x0308('0x11')][_0x5c9a38['uniqueid']]?_0x0308('0x4f'):'\x20hangup\x20faxRiceive\x20',JSON[_0x0308('0x41')](this[_0x0308('0xe')][_0x5c9a38[_0x0308('0x27')]]));if(this[_0x0308('0x11')][_0x5c9a38[_0x0308('0x27')]]){if(this[_0x0308('0xe')][_0x5c9a38[_0x0308('0x27')]][_0x0308('0x50')]>0x0&&this[_0x0308('0xe')][_0x5c9a38[_0x0308('0x27')]]['faxstatus']===_0x0308('0x51')){this['updateStatus'](_0x5c9a38[_0x0308('0x27')],!![]);}else{this[_0x0308('0x4a')](_0x5c9a38[_0x0308('0x27')],![],this[_0x0308('0xe')][_0x5c9a38[_0x0308('0x27')]][_0x0308('0x52')]?_0x0308('0x53')+this['channels'][_0x5c9a38[_0x0308('0x27')]]['faxstatusstring']:_0x0308('0x54'));}}}};Fax[_0x0308('0x2b')][_0x0308('0x55')]=function(_0x455ba8){var _0x1a65d5=this;return new BPromise(function(_0x2751cd,_0x3bec9c){_0x1a65d5[_0x0308('0x56')](_0x455ba8,_0x1a65d5[_0x0308('0xf')][_0x455ba8[_0x0308('0x57')]])[_0x0308('0x3d')](function(_0x316fb1){ut[_0x0308('0x48')](_0x0308('0x58'),_0x316fb1);_0x2751cd(ut[_0x0308('0x39')](_0x0308('0x59')));})[_0x0308('0x3f')](function(_0xaee09c){ut[_0x0308('0x48')](_0x0308('0x5a'),_0xaee09c);updateStatus(_0x455ba8);_0x3bec9c(ut[_0x0308('0x39')]('Fax\x20failed'));});});};Fax[_0x0308('0x2b')]['checkAfterSend']=function(_0x35481c){var _0x19b795=this;return new BPromise(function(_0x54435a,_0x530302){var _0x3114b8=_0x19b795[_0x0308('0x5b')](_0x19b795[_0x0308('0xf')][_0x35481c[_0x0308('0x57')]][_0x0308('0x5c')],_0x35481c);if(_0x3114b8['isValid']){_0x54435a(ut[_0x0308('0x39')](_0x0308('0x5d')));}else{_0x530302(ut[_0x0308('0x39')](_0x3114b8[_0x0308('0x39')]));}});};function originate(_0x4acdef,_0x345228,_0x51d87d){return new BPromise(function(_0x526e15,_0x252bbf){if(_0x51d87d){var _0x1ae2b8=util['format'](_0x0308('0x5e'),path[_0x0308('0x3a')](_0x4acdef['path'])[_0x0308('0x29')],_0x4acdef['path']);gs[_0x0308('0x5f')](_0x1ae2b8)['then'](function(){_0x4acdef[_0x0308('0x4')]=util['format'](_0x0308('0x60'),path[_0x0308('0x3a')](_0x4acdef[_0x0308('0x4')])[_0x0308('0x61')],path[_0x0308('0x3a')](_0x4acdef['path'])[_0x0308('0x29')]);_0x345228[_0x0308('0x62')]=_0x4acdef[_0x0308('0x4')];ut['logger'](_0x0308('0x63'),'');ami[_0x0308('0x64')](ut['variablesAction'](_0x4acdef,_0x345228))[_0x0308('0x3d')](function(_0x43a417){_0x526e15(_0x43a417);})['catch'](function(_0x5f5a27){_0x252bbf(_0x5f5a27);});})['catch'](function(_0x5b20ec){_0x252bbf(_0x5b20ec);});}else{ami['Action'](ut[_0x0308('0x65')](_0x4acdef,_0x345228))[_0x0308('0x3d')](function(_0x21a3c3){_0x526e15(_0x21a3c3);})['catch'](function(_0x4b5ee1){_0x252bbf(_0x4b5ee1);});}});}Fax[_0x0308('0x2b')][_0x0308('0x56')]=function(_0x11f91e,_0x1026ad){var _0x3dd8d1=this;return new BPromise(function(_0x2507b9,_0x32c396){var _0x239f53=uuid['v4']();var _0x563f9f=ut[_0x0308('0x66')](_0x11f91e,_0x1026ad);_0x3dd8d1[_0x0308('0x11')][_0x239f53]=new Action(_0x239f53,_0x1026ad,_0x11f91e);var _0x343f97=_0x3dd8d1[_0x0308('0x11')][_0x239f53];if(path[_0x0308('0x3a')](_0x11f91e[_0x0308('0x4')])[_0x0308('0x67')]===_0x0308('0x3b')){originate(_0x343f97,_0x563f9f,!![])[_0x0308('0x3d')](function(_0x2080e2){_0x2507b9(_0x2080e2);})[_0x0308('0x3f')](function(_0x43365){_0x32c396(_0x43365);});}else{originate(_0x343f97,_0x563f9f,![])[_0x0308('0x3d')](function(_0x47e50d){_0x2507b9(_0x47e50d);})[_0x0308('0x3f')](function(_0x17d0d3){_0x32c396(_0x17d0d3);});}});};Fax[_0x0308('0x2b')][_0x0308('0x68')]=function(_0x2b55fa){return!_[_0x0308('0x69')](_0x2b55fa)&&!_[_0x0308('0x69')](_0x2b55fa[_0x0308('0x29')])&&!_[_0x0308('0x69')](_0x2b55fa[_0x0308('0x6a')])&&_0x2b55fa[_0x0308('0x6a')]&&!_['isNil'](this[_0x0308('0x10')][util['format'](_0x0308('0x6b'),_0x2b55fa[_0x0308('0x29')])])&&!_['isNil'](this['trunks'][util[_0x0308('0x6c')]('SIP/%s',_0x2b55fa[_0x0308('0x29')])]['status'])&&(this[_0x0308('0x10')][util[_0x0308('0x6c')](_0x0308('0x6b'),_0x2b55fa[_0x0308('0x29')])][_0x0308('0x31')]===_0x0308('0x6d')||this['trunks'][util[_0x0308('0x6c')](_0x0308('0x6b'),_0x2b55fa[_0x0308('0x29')])][_0x0308('0x31')]===_0x0308('0x6e'));};Fax[_0x0308('0x2b')][_0x0308('0x5b')]=function(_0x50da1a,_0x285f49){if(!this[_0x0308('0x68')](_0x50da1a)){ut['logger'](_0x0308('0x6f'),_[_0x0308('0x69')](_0x50da1a)?'':_0x50da1a[_0x0308('0x29')]+_0x0308('0x70'));return{'isValid':![],'message':_0x0308('0x71')};}if(_[_0x0308('0x69')](_0x285f49['fax'])){ut[_0x0308('0x48')](_0x0308('0x72'),JSON[_0x0308('0x41')](_0x285f49));return{'isValid':![],'message':_0x0308('0x73')};}if(_[_0x0308('0x69')](_0x285f49[_0x0308('0x4')])){ut[_0x0308('0x48')](_0x0308('0x74'),JSON['stringify'](_0x285f49));return{'isValid':![],'message':_0x0308('0x75')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x0308('0x76')]=Fax; \ No newline at end of file +var _0xfad0=['\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','path','execute','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','isTrunkReachable','isNil','active','SIP/%s','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','exports','lodash','uuid','moment','tiff2pdf','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','newchannel','bind','varset','syncVarSet','newstate','syncNewState','syncNewExten','syncFaxStatus','receivefax','originateresponse','syncOriginateResponse','syncNewchannel','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','actions','\x20syncNewchannel\x20','variable','prototype','channelstate','channelstatedesc','value','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','then','.pdf','catch','error'];(function(_0xf30510,_0x1dabf0){var _0x149218=function(_0x16e3ad){while(--_0x16e3ad){_0xf30510['push'](_0xf30510['shift']());}};_0x149218(++_0x1dabf0);}(_0xfad0,0xb0));var _0x0fad=function(_0x5015f0,_0x587229){_0x5015f0=_0x5015f0-0x0;var _0x1d4aea=_0xfad0[_0x5015f0];return _0x1d4aea;};'use strict';var util=require('util');var _=require(_0x0fad('0x0'));var BPromise=require('bluebird');var uuid=require(_0x0fad('0x1'));var moment=require(_0x0fad('0x2'));var path=require('path');var tiff2pdf=require(_0x0fad('0x3'));var gs=require('./util/gs');var logger=require(_0x0fad('0x4'))(_0x0fad('0x5'));var ami=require(_0x0fad('0x6'));var rpcDb=require(_0x0fad('0x7'));var Channel=require(_0x0fad('0x8'));var ut=require(_0x0fad('0x9'));var Action=require(_0x0fad('0xa'));var faxAccount=require(_0x0fad('0xb'));var attachment=require(_0x0fad('0xc'));var faxMessage=require(_0x0fad('0xd'));function Fax(_0x10a816){this[_0x0fad('0xe')]={};this[_0x0fad('0xf')]=_0x10a816[_0x0fad('0xf')];this[_0x0fad('0x10')]=_0x10a816[_0x0fad('0x10')];this['actions']={};ami['on'](_0x0fad('0x11'),this['syncNewchannel'][_0x0fad('0x12')](this));ami['on'](_0x0fad('0x13'),this[_0x0fad('0x14')][_0x0fad('0x12')](this));ami['on'](_0x0fad('0x15'),this[_0x0fad('0x16')][_0x0fad('0x12')](this));ami['on']('newexten',this[_0x0fad('0x17')][_0x0fad('0x12')](this));ami['on']('faxstatus',this[_0x0fad('0x18')][_0x0fad('0x12')](this));ami['on'](_0x0fad('0x19'),this['syncReceiveFax']['bind'](this));ami['on']('hangup',this['syncHangup'][_0x0fad('0x12')](this));ami['on'](_0x0fad('0x1a'),this[_0x0fad('0x1b')]['bind'](this));}Fax['prototype'][_0x0fad('0x1c')]=function(_0x3c1604){if(_0x3c1604[_0x0fad('0x1d')]===_0x0fad('0x1e')){for(var _0x41e214 in this[_0x0fad('0xf')]){if(this['faxAccounts'][_0x0fad('0x1f')](_0x41e214)){if(_0x3c1604[_0x0fad('0x20')]===this[_0x0fad('0xf')][_0x41e214][_0x0fad('0x21')]){this[_0x0fad('0xe')][_0x3c1604[_0x0fad('0x22')]]={};this[_0x0fad('0xe')][_0x3c1604['uniqueid']][_0x0fad('0x23')]=_0x3c1604[_0x0fad('0x23')];this[_0x0fad('0xe')][_0x3c1604[_0x0fad('0x22')]]['id']=this[_0x0fad('0xf')][_0x41e214]['id'];this[_0x0fad('0xe')][_0x3c1604[_0x0fad('0x22')]][_0x0fad('0x24')]=this[_0x0fad('0xf')][_0x41e214][_0x0fad('0x24')];logger[_0x0fad('0x25')](_0x3c1604[_0x0fad('0x22')],'\x20syncNewchannel\x20');}}}}if(this[_0x0fad('0x26')][_0x3c1604[_0x0fad('0x22')]]){this['channels'][_0x3c1604[_0x0fad('0x22')]]={};this[_0x0fad('0xe')][_0x3c1604['uniqueid']][_0x0fad('0x23')]=_0x3c1604[_0x0fad('0x23')];logger[_0x0fad('0x25')](_0x3c1604['uniqueid'],_0x0fad('0x27'));}};Fax['prototype'][_0x0fad('0x14')]=function(_0xdb5e95){if(this[_0x0fad('0xe')][_0xdb5e95[_0x0fad('0x22')]]){for(var _0x463ea9 in _0xdb5e95[_0x0fad('0x28')]){if(_0xdb5e95[_0x0fad('0x28')][_0x0fad('0x1f')](_0x463ea9)){this[_0x0fad('0xe')][_0xdb5e95[_0x0fad('0x22')]][_0x463ea9]=_0xdb5e95['value'];}}}};Fax[_0x0fad('0x29')][_0x0fad('0x16')]=function(_0x18547c){if(this[_0x0fad('0xe')][_0x18547c['uniqueid']]){this[_0x0fad('0xe')][_0x18547c[_0x0fad('0x22')]][_0x0fad('0x2a')]=_0x18547c['channelstate'];this['channels'][_0x18547c[_0x0fad('0x22')]]['channelstatedesc']=_0x18547c[_0x0fad('0x2b')];}};Fax[_0x0fad('0x29')]['syncNewExten']=function(_0x34554f){if(this[_0x0fad('0xe')][_0x34554f[_0x0fad('0x22')]]){for(var _0x52e58d in _0x34554f[_0x0fad('0x28')]){if(_0x34554f[_0x0fad('0x28')][_0x0fad('0x1f')](_0x52e58d)){this[_0x0fad('0xe')][_0x34554f[_0x0fad('0x22')]][_0x52e58d]=_0x34554f[_0x0fad('0x2c')];}}}};Fax[_0x0fad('0x29')][_0x0fad('0x18')]=function(_0x1c743e){if(this[_0x0fad('0xe')][_0x1c743e[_0x0fad('0x22')]]){this[_0x0fad('0xe')][_0x1c743e['uniqueid']]['operation']=_0x1c743e['operation'];this[_0x0fad('0xe')][_0x1c743e[_0x0fad('0x22')]][_0x0fad('0x2d')]=_0x1c743e[_0x0fad('0x2d')];this[_0x0fad('0xe')][_0x1c743e[_0x0fad('0x22')]][_0x0fad('0x21')]=_0x1c743e[_0x0fad('0x21')];this[_0x0fad('0xe')][_0x1c743e['uniqueid']][_0x0fad('0x2e')]=_0x1c743e['filename'];logger[_0x0fad('0x25')](_0x1c743e[_0x0fad('0x22')],_0x0fad('0x2f'));}};Fax[_0x0fad('0x29')]['syncReceiveFax']=function(_0xaead14){var _0x4aa140=this;if(this[_0x0fad('0xe')][_0xaead14['uniqueid']]){var _0x532d9d=this['channels'][_0xaead14[_0x0fad('0x22')]]['id'];this['channels'][_0xaead14[_0x0fad('0x22')]]['remotestationid']=_0xaead14[_0x0fad('0x30')];this['channels'][_0xaead14[_0x0fad('0x22')]][_0x0fad('0x31')]=_0xaead14[_0x0fad('0x31')];this[_0x0fad('0xe')][_0xaead14[_0x0fad('0x22')]]['localstationid']=_0xaead14['localstationid'];this['channels'][_0xaead14[_0x0fad('0x22')]][_0x0fad('0x32')]=_0xaead14[_0x0fad('0x32')];this[_0x0fad('0xe')][_0xaead14['uniqueid']][_0x0fad('0x33')]=_0xaead14[_0x0fad('0x33')];this[_0x0fad('0xe')][_0xaead14[_0x0fad('0x22')]][_0x0fad('0x2e')]=_0xaead14[_0x0fad('0x2e')];this[_0x0fad('0xe')][_0xaead14[_0x0fad('0x22')]][_0x0fad('0x34')]=_0xaead14[_0x0fad('0x34')];if(this['channels'][_0xaead14[_0x0fad('0x22')]][_0x0fad('0x31')]>0x0){tiff2pdf(_0xaead14['filename'],_0x0fad('0x35'),function(_0x40755c){logger['info'](_0xaead14[_0x0fad('0x22')],_0x0fad('0x36'),_0x40755c[_0x0fad('0x37')]);attachment[_0x0fad('0x38')]({'name':path[_0x0fad('0x39')](_0xaead14[_0x0fad('0x2e')])[_0x0fad('0x24')],'basename':path[_0x0fad('0x39')](_0xaead14[_0x0fad('0x2e')])[_0x0fad('0x24')]+'.pdf','type':'application/pdf'})[_0x0fad('0x3a')](function(_0x4c52af){faxAccount['notify'](_0x532d9d,{'from':_0xaead14['calleridnum'],'mapKey':_0x0fad('0x5'),'body':path['parse'](_0xaead14['filename'])[_0x0fad('0x24')]+_0x0fad('0x3b'),'AttachmentId':_0x4c52af['id']})[_0x0fad('0x3c')](function(_0x5abd91){logger[_0x0fad('0x3d')](_0xaead14[_0x0fad('0x22')],_0x0fad('0x3e'),JSON[_0x0fad('0x3f')](_0x5abd91));});})['catch'](function(_0x541e35){logger[_0x0fad('0x3d')](_0xaead14['uniqueid'],'\x20receiveFax\x20',JSON[_0x0fad('0x3f')](_0x541e35));});});}logger[_0x0fad('0x25')](_0xaead14[_0x0fad('0x22')],_0x0fad('0x40'));}};Fax[_0x0fad('0x29')][_0x0fad('0x1b')]=function(_0x1161c7){if(this[_0x0fad('0x26')][_0x1161c7['uniqueid']]){_[_0x0fad('0x41')](this[_0x0fad('0xe')][_0x1161c7[_0x0fad('0x22')]],_[_0x0fad('0x42')](_0x1161c7,[_0x0fad('0x43'),'reason']));}};function updateStatus(_0x100087){if(_0x100087[_0x0fad('0x44')]){faxMessage[_0x0fad('0x45')](_0x100087['AttachmentId'],{'failMessage':_0x0fad('0x46')})[_0x0fad('0x3a')](function(_0x4fec67){ut[_0x0fad('0x47')](_0x0fad('0x48'),_0x4fec67);})[_0x0fad('0x3c')](function(_0x5a9c06){ut[_0x0fad('0x47')](_0x0fad('0x49'),_0x5a9c06);});}else{ut['logger'](_0x0fad('0x4a'));}}Fax[_0x0fad('0x29')][_0x0fad('0x4b')]=function(_0x5d7999,_0x50ffc5,_0x2de1a6){var _0x5428e5=this;var _0x38b1ae={};if(_0x50ffc5){_0x38b1ae={'read':_0x50ffc5};}else{_0x38b1ae={'failMessage':_0x2de1a6};}if(this[_0x0fad('0x26')][_0x5d7999][_0x0fad('0x44')]){faxMessage[_0x0fad('0x45')](this['actions'][_0x5d7999]['AttachmentId'],_0x38b1ae)[_0x0fad('0x3a')](function(_0x4ad50b){ut['logger'](_0x0fad('0x4c'),_0x4ad50b);})['catch'](function(_0x2c522e){ut[_0x0fad('0x47')](_0x0fad('0x4d'),_0x2c522e);})[_0x0fad('0x4e')](function(){delete _0x5428e5[_0x0fad('0xe')][_0x5d7999];delete _0x5428e5['actions'][_0x5d7999];});}else{ut['logger'](_0x0fad('0x4f'));delete this['channels'][_0x5d7999];delete this[_0x0fad('0x26')][_0x5d7999];}};Fax[_0x0fad('0x29')]['syncHangup']=function(_0x5edfca){var _0x200edf=this;if(this[_0x0fad('0xe')][_0x5edfca[_0x0fad('0x22')]]){if(this[_0x0fad('0x26')][_0x5edfca[_0x0fad('0x22')]]){this['channels'][_0x5edfca['uniqueid']]['id']=this[_0x0fad('0x26')][_0x5edfca[_0x0fad('0x22')]]['id'];this[_0x0fad('0xe')][_0x5edfca[_0x0fad('0x22')]][_0x0fad('0x24')]=this[_0x0fad('0x26')][_0x5edfca[_0x0fad('0x22')]]['name'];}logger[_0x0fad('0x25')](_0x5edfca[_0x0fad('0x22')],this[_0x0fad('0x26')][_0x5edfca[_0x0fad('0x22')]]?_0x0fad('0x50'):_0x0fad('0x51'),JSON[_0x0fad('0x3f')](this[_0x0fad('0xe')][_0x5edfca[_0x0fad('0x22')]]));if(this[_0x0fad('0x26')][_0x5edfca[_0x0fad('0x22')]]){if(this[_0x0fad('0xe')][_0x5edfca[_0x0fad('0x22')]][_0x0fad('0x52')]>0x0&&this[_0x0fad('0xe')][_0x5edfca['uniqueid']][_0x0fad('0x53')]===_0x0fad('0x54')){this[_0x0fad('0x4b')](_0x5edfca['uniqueid'],!![]);}else{this['updateStatus'](_0x5edfca[_0x0fad('0x22')],![],this[_0x0fad('0xe')][_0x5edfca[_0x0fad('0x22')]][_0x0fad('0x55')]?_0x0fad('0x56')+this[_0x0fad('0xe')][_0x5edfca['uniqueid']][_0x0fad('0x55')]:_0x0fad('0x57'));}}}};Fax['prototype'][_0x0fad('0x58')]=function(_0x53a8cf){var _0x4551ee=this;return new BPromise(function(_0x4af644,_0x231a57){_0x4551ee[_0x0fad('0x59')](_0x53a8cf,_0x4551ee[_0x0fad('0xf')][_0x53a8cf[_0x0fad('0x5a')]])[_0x0fad('0x3a')](function(_0x344d86){ut[_0x0fad('0x47')]('[Fax][execOriginate][success]',_0x344d86);_0x4af644(ut['message'](_0x0fad('0x5b')));})[_0x0fad('0x3c')](function(_0x4af433){ut['logger'](_0x0fad('0x5c'),_0x4af433);updateStatus(_0x53a8cf);_0x231a57(ut[_0x0fad('0x37')](_0x0fad('0x5d')));});});};Fax[_0x0fad('0x29')][_0x0fad('0x5e')]=function(_0x3df036){var _0x380a22=this;return new BPromise(function(_0x532c5c,_0x19c720){var _0x5de0a8=_0x380a22[_0x0fad('0x5f')](_0x380a22[_0x0fad('0xf')][_0x3df036[_0x0fad('0x5a')]]['Trunk'],_0x3df036);if(_0x5de0a8[_0x0fad('0x60')]){_0x532c5c(ut[_0x0fad('0x37')](_0x0fad('0x61')));}else{_0x19c720(ut[_0x0fad('0x37')](_0x5de0a8[_0x0fad('0x37')]));}});};function originate(_0x1ea2f5,_0xd8a1d8,_0xe04af6){return new BPromise(function(_0x5f241b,_0x3b7683){if(_0xe04af6){var _0x25cae6=util[_0x0fad('0x62')](_0x0fad('0x63'),path['parse'](_0x1ea2f5['path'])['name'],_0x1ea2f5[_0x0fad('0x64')]);gs[_0x0fad('0x65')](_0x25cae6)[_0x0fad('0x3a')](function(){_0x1ea2f5[_0x0fad('0x64')]=util['format']('%s/%s.tif',path['parse'](_0x1ea2f5['path'])[_0x0fad('0x66')],path[_0x0fad('0x39')](_0x1ea2f5[_0x0fad('0x64')])[_0x0fad('0x24')]);_0xd8a1d8[_0x0fad('0x67')]=_0x1ea2f5[_0x0fad('0x64')];ut[_0x0fad('0x47')](_0x0fad('0x68'),'');ami['Action'](ut['variablesAction'](_0x1ea2f5,_0xd8a1d8))['then'](function(_0x32cab2){_0x5f241b(_0x32cab2);})[_0x0fad('0x3c')](function(_0x1c2b26){_0x3b7683(_0x1c2b26);});})[_0x0fad('0x3c')](function(_0x3f1581){_0x3b7683(_0x3f1581);});}else{ami[_0x0fad('0x69')](ut[_0x0fad('0x6a')](_0x1ea2f5,_0xd8a1d8))[_0x0fad('0x3a')](function(_0x1f8580){_0x5f241b(_0x1f8580);})['catch'](function(_0x3e0ece){_0x3b7683(_0x3e0ece);});}});}Fax[_0x0fad('0x29')]['execOriginate']=function(_0x3b121f,_0x3e62f6){var _0x27f790=this;return new BPromise(function(_0x16ef74,_0x4ea4a4){var _0x5218dd=uuid['v4']();var _0x40ae64=ut[_0x0fad('0x6b')](_0x3b121f,_0x3e62f6);_0x27f790['actions'][_0x5218dd]=new Action(_0x5218dd,_0x3e62f6,_0x3b121f);var _0x3ed777=_0x27f790['actions'][_0x5218dd];if(path[_0x0fad('0x39')](_0x3b121f[_0x0fad('0x64')])['ext']==='.pdf'){originate(_0x3ed777,_0x40ae64,!![])[_0x0fad('0x3a')](function(_0x6e9f9){_0x16ef74(_0x6e9f9);})[_0x0fad('0x3c')](function(_0x172b28){_0x4ea4a4(_0x172b28);});}else{originate(_0x3ed777,_0x40ae64,![])[_0x0fad('0x3a')](function(_0x5b9892){_0x16ef74(_0x5b9892);})[_0x0fad('0x3c')](function(_0x58c8d7){_0x4ea4a4(_0x58c8d7);});}});};Fax[_0x0fad('0x29')][_0x0fad('0x6c')]=function(_0x40cb56){return!_[_0x0fad('0x6d')](_0x40cb56)&&!_[_0x0fad('0x6d')](_0x40cb56[_0x0fad('0x24')])&&!_['isNil'](_0x40cb56[_0x0fad('0x6e')])&&_0x40cb56[_0x0fad('0x6e')]&&!_[_0x0fad('0x6d')](this[_0x0fad('0x10')][util['format']('SIP/%s',_0x40cb56['name'])])&&!_[_0x0fad('0x6d')](this['trunks'][util['format'](_0x0fad('0x6f'),_0x40cb56['name'])][_0x0fad('0x2d')])&&(this[_0x0fad('0x10')][util[_0x0fad('0x62')](_0x0fad('0x6f'),_0x40cb56['name'])][_0x0fad('0x2d')]==='reachable'||this[_0x0fad('0x10')][util[_0x0fad('0x62')](_0x0fad('0x6f'),_0x40cb56['name'])][_0x0fad('0x2d')]===_0x0fad('0x70'));};Fax[_0x0fad('0x29')][_0x0fad('0x5f')]=function(_0x290c02,_0x2d4786){if(!this[_0x0fad('0x6c')](_0x290c02)){ut[_0x0fad('0x47')](_0x0fad('0x71'),_[_0x0fad('0x6d')](_0x290c02)?'':_0x290c02['name']+_0x0fad('0x72'));return{'isValid':![],'message':_0x0fad('0x73')};}if(_['isNil'](_0x2d4786[_0x0fad('0x5')])){ut['logger']('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0x0fad('0x3f')](_0x2d4786));return{'isValid':![],'message':_0x0fad('0x74')};}if(_['isNil'](_0x2d4786[_0x0fad('0x64')])){ut[_0x0fad('0x47')](_0x0fad('0x75'),JSON['stringify'](_0x2d4786));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x0fad('0x76')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 9cb4b7d..dc955f0 100644 --- a/server/services/ami/fax/rpcDb.js +++ b/server/services/ami/fax/rpcDb.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x224d=['[Notify]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','inspect','notify','resolve','then','catch'];(function(_0xb6eb8a,_0x38cc80){var _0x247fd9=function(_0xd2d6d9){while(--_0xd2d6d9){_0xb6eb8a['push'](_0xb6eb8a['shift']());}};_0x247fd9(++_0x38cc80);}(_0x224d,0x6d));var _0xd224=function(_0x542a5d,_0x27e6c8){_0x542a5d=_0x542a5d-0x0;var _0x251378=_0x224d[_0x542a5d];return _0x251378;};'use strict';var util=require(_0xd224('0x0'));var BPromise=require(_0xd224('0x1'));var logger=require(_0xd224('0x2'))(_0xd224('0x3'));var _=require(_0xd224('0x4'));var faxAccount=require(_0xd224('0x5'));function loggerCatch(_0x3475db){return function(_0x5d8987){logger['error'](_0x3475db,util[_0xd224('0x6')](_0x5d8987,{'showHidden':![],'depth':null}));};}exports[_0xd224('0x7')]=function(_0x4d3700,_0x38e71e){return BPromise[_0xd224('0x8')]()[_0xd224('0x9')](faxAccount['notify'](_0x4d3700,_0x38e71e))[_0xd224('0xa')](loggerCatch(_0xd224('0xb')));}; \ No newline at end of file +var _0xcc45=['catch','[Notify]\x20','util','bluebird','preview','notify','resolve'];(function(_0x563c8e,_0x52c64e){var _0x5533dc=function(_0x145b49){while(--_0x145b49){_0x563c8e['push'](_0x563c8e['shift']());}};_0x5533dc(++_0x52c64e);}(_0xcc45,0xdb));var _0x5cc4=function(_0x237725,_0x168928){_0x237725=_0x237725-0x0;var _0xe326cc=_0xcc45[_0x237725];return _0xe326cc;};'use strict';var util=require(_0x5cc4('0x0'));var BPromise=require(_0x5cc4('0x1'));var logger=require('../../../config/logger')(_0x5cc4('0x2'));var _=require('lodash');var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x563441){return function(_0x4ca612){logger['error'](_0x563441,util['inspect'](_0x4ca612,{'showHidden':![],'depth':null}));};}exports[_0x5cc4('0x3')]=function(_0x46f4a1,_0x31a7f6){return BPromise[_0x5cc4('0x4')]()['then'](faxAccount[_0x5cc4('0x3')](_0x46f4a1,_0x31a7f6))[_0x5cc4('0x5')](loggerCatch(_0x5cc4('0x6')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index 89558f6..2b1828b 100644 --- a/server/services/ami/fax/util/gs.js +++ b/server/services/ami/fax/util/gs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7b2c=['fax','child_process','exec','execute','info','Exec\x20gs','inspect','util','../../../../config/logger'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x7b2c,0xbb));var _0xc7b2=function(_0x58be64,_0x12c943){_0x58be64=_0x58be64-0x0;var _0x166728=_0x7b2c[_0x58be64];return _0x166728;};'use strict';var util=require(_0xc7b2('0x0'));var logger=require(_0xc7b2('0x1'))(_0xc7b2('0x2'));var BPromise=require('bluebird');var exec=require(_0xc7b2('0x3'))[_0xc7b2('0x4')];exports[_0xc7b2('0x5')]=function(_0x4823fe){return new BPromise(function(_0x427254,_0x5cd98d){exec(_0x4823fe,function(_0xd4247c,_0x1c5ae9,_0x465a0e){logger[_0xc7b2('0x6')](_0xc7b2('0x7'),_0x1c5ae9);if(_0xd4247c){logger[_0xc7b2('0x6')](_0xc7b2('0x7'),'\x20Error\x20:',util[_0xc7b2('0x8')](_0xd4247c,{'showHidden':![],'depth':null}),_0x1c5ae9,_0x465a0e);_0x5cd98d(_0xd4247c);}_0x427254(_0x1c5ae9);});});}; \ No newline at end of file +var _0x12b7=['bluebird','child_process','execute','info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger','fax'];(function(_0x317b63,_0x2acf92){var _0x36a2e2=function(_0x11024b){while(--_0x11024b){_0x317b63['push'](_0x317b63['shift']());}};_0x36a2e2(++_0x2acf92);}(_0x12b7,0x15b));var _0x712b=function(_0x29417d,_0x30066c){_0x29417d=_0x29417d-0x0;var _0x12a18d=_0x12b7[_0x29417d];return _0x12a18d;};'use strict';var util=require(_0x712b('0x0'));var logger=require(_0x712b('0x1'))(_0x712b('0x2'));var BPromise=require(_0x712b('0x3'));var exec=require(_0x712b('0x4'))['exec'];exports[_0x712b('0x5')]=function(_0x518a1f){return new BPromise(function(_0x2d8f51,_0x3187e4){exec(_0x518a1f,function(_0x4a4041,_0x785516,_0x598dbb){logger[_0x712b('0x6')](_0x712b('0x7'),_0x785516);if(_0x4a4041){logger[_0x712b('0x6')](_0x712b('0x7'),_0x712b('0x8'),util[_0x712b('0x9')](_0x4a4041,{'showHidden':![],'depth':null}),_0x785516,_0x598dbb);_0x3187e4(_0x4a4041);}_0x2d8f51(_0x785516);});});}; \ No newline at end of file diff --git a/server/services/ami/fax/util/util.js b/server/services/ami/fax/util/util.js index 4b62db3..5474476 100644 --- a/server/services/ami/fax/util/util.js +++ b/server/services/ami/fax/util/util.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x07c0=['format','modem','gateway','faxdetect','t38timeout','localstationid','path','uniqueid','originate','channel','\x22%s\x22\x20<%s>','headerinfo','lodash','../../../../config/logger','logger','info','inspect','ecm','minrate','maxrate'];(function(_0x241237,_0xaaabec){var _0x1bc339=function(_0x2336df){while(--_0x2336df){_0x241237['push'](_0x241237['shift']());}};_0x1bc339(++_0xaaabec);}(_0x07c0,0x1ec));var _0x007c=function(_0x51cabf,_0x2828db){_0x51cabf=_0x51cabf-0x0;var _0x517538=_0x07c0[_0x51cabf];return _0x517538;};'use strict';var util=require('util');var _=require(_0x007c('0x0'));var moment=require('moment');var logger=require(_0x007c('0x1'))('fax');exports['message']=function(_0x20b72b){return{'message':_0x20b72b};};exports[_0x007c('0x2')]=function(_0x259b19,_0x5c2773){logger[_0x007c('0x3')](_0x259b19,util[_0x007c('0x4')](_0x5c2773,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x1a7a64,_0xc3778){var _0x1015f4={'XMF-ECM':_0xc3778[_0x007c('0x5')],'XMF-HEADERINFO':_0xc3778['headerinfo'],'XMF-MINRATE':_0xc3778[_0x007c('0x6')],'XMF-MAXRATE':_0xc3778[_0x007c('0x7')],'XMF-MODEM':util[_0x007c('0x8')]('\x22%s\x22',_0xc3778[_0x007c('0x9')]),'XMF-GATEWAY':_0xc3778[_0x007c('0xa')],'XMF-FAXDETECT':_0xc3778[_0x007c('0xb')],'XMF-T38TIMEOUT':_0xc3778[_0x007c('0xc')],'XMF-LOCALSTATIONID':_0xc3778[_0x007c('0xd')],'XMF-PATH':_0x1a7a64[_0x007c('0xe')]};return _0x1015f4;};exports['variablesAction']=function(_0x213fcf,_0x53a570){return{'actionid':_0x213fcf[_0x007c('0xf')],'action':_0x007c('0x10'),'channel':_0x213fcf[_0x007c('0x11')],'Exten':'xcally-motion-fax','Context':'from-sip','Priority':'1','callerid':util[_0x007c('0x8')](_0x007c('0x12'),_0x213fcf[_0x007c('0x13')]?_0x213fcf[_0x007c('0x13')]:'',_0x213fcf[_0x007c('0xd')]),'variable':_0x53a570,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x213fcf[_0x007c('0xf')]};}; \ No newline at end of file +var _0xee9a=['t38timeout','localstationid','path','variablesAction','uniqueid','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','lodash','moment','../../../../config/logger','fax','info','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','modem','gateway','faxdetect'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xee9a,0xc9));var _0xaee9=function(_0x174a9e,_0x5eecc8){_0x174a9e=_0x174a9e-0x0;var _0x485f82=_0xee9a[_0x174a9e];return _0x485f82;};'use strict';var util=require('util');var _=require(_0xaee9('0x0'));var moment=require(_0xaee9('0x1'));var logger=require(_0xaee9('0x2'))(_0xaee9('0x3'));exports['message']=function(_0x532d51){return{'message':_0x532d51};};exports['logger']=function(_0x5e5845,_0x15e9cd){logger[_0xaee9('0x4')](_0x5e5845,util[_0xaee9('0x5')](_0x15e9cd,{'showHidden':![],'depth':null}));};exports[_0xaee9('0x6')]=function(_0x296266,_0x8cf4d9){var _0x1f7b88={'XMF-ECM':_0x8cf4d9[_0xaee9('0x7')],'XMF-HEADERINFO':_0x8cf4d9[_0xaee9('0x8')],'XMF-MINRATE':_0x8cf4d9[_0xaee9('0x9')],'XMF-MAXRATE':_0x8cf4d9[_0xaee9('0xa')],'XMF-MODEM':util[_0xaee9('0xb')]('\x22%s\x22',_0x8cf4d9[_0xaee9('0xc')]),'XMF-GATEWAY':_0x8cf4d9[_0xaee9('0xd')],'XMF-FAXDETECT':_0x8cf4d9[_0xaee9('0xe')],'XMF-T38TIMEOUT':_0x8cf4d9[_0xaee9('0xf')],'XMF-LOCALSTATIONID':_0x8cf4d9[_0xaee9('0x10')],'XMF-PATH':_0x296266[_0xaee9('0x11')]};return _0x1f7b88;};exports[_0xaee9('0x12')]=function(_0x56dee7,_0x1c8aa8){return{'actionid':_0x56dee7[_0xaee9('0x13')],'action':'originate','channel':_0x56dee7[_0xaee9('0x14')],'Exten':_0xaee9('0x15'),'Context':_0xaee9('0x16'),'Priority':'1','callerid':util[_0xaee9('0xb')](_0xaee9('0x17'),_0x56dee7[_0xaee9('0x8')]?_0x56dee7[_0xaee9('0x8')]:'',_0x56dee7[_0xaee9('0x10')]),'variable':_0x1c8aa8,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x56dee7[_0xaee9('0x13')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 812f3f8..69fdc4e 100644 --- a/server/services/ami/index.js +++ b/server/services/ami/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x200d=['ami','hour','get','resolve','then','initAgents','initTelephones','getTrunks','initTrunks','getTriggers','initTriggers','getTemplates','initTemplates','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','initVtigerAccounts','initFreshsalesAccounts','initServicenowAccounts','initDynamics365Accounts','getCampaigns','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','catch','inspect','listen','./server','./report','./acw','./trigger','./dialer','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trunk','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger'];(function(_0x5c9317,_0x38bba4){var _0x50ccb4=function(_0x467423){while(--_0x467423){_0x5c9317['push'](_0x5c9317['shift']());}};_0x50ccb4(++_0x38bba4);}(_0x200d,0x64));var _0xd200=function(_0x4382bc,_0x231a2d){_0x4382bc=_0x4382bc-0x0;var _0x13c82a=_0x200d[_0x4382bc];return _0x13c82a;};'use strict';var util=require('util');var moment=require('moment');var server=require(_0xd200('0x0'));var Realtime=require('./realtime');var Report=require(_0xd200('0x1'));var Acw=require(_0xd200('0x2'));var Trigger=require(_0xd200('0x3'));var Dialer=require(_0xd200('0x4'));var Preview=require('./preview');var Fax=require(_0xd200('0x5'));var user=require(_0xd200('0x6'));var voiceQueue=require(_0xd200('0x7'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0xd200('0x8'));var trunk=require(_0xd200('0x9'));var trigger=require('./rpc/trigger');var template=require(_0xd200('0xa'));var cmHopperHistory=require(_0xd200('0xb'));var campaign=require(_0xd200('0xc'));var voiceExtension=require(_0xd200('0xd'));var faxAccount=require(_0xd200('0xe'));var zendesk=require(_0xd200('0xf'));var salesforce=require(_0xd200('0x10'));var sugarcrm=require(_0xd200('0x11'));var freshdesk=require(_0xd200('0x12'));var desk=require(_0xd200('0x13'));var zoho=require(_0xd200('0x14'));var vtiger=require(_0xd200('0x15'));var freshsales=require(_0xd200('0x16'));var servicenow=require(_0xd200('0x17'));var dynamics365=require(_0xd200('0x18'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0xd200('0x19'))(_0xd200('0x1a'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0xd200('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xd200('0x1c')](_0xd200('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0xd200('0x1d')]()[_0xd200('0x1e')](user['getAgents']())[_0xd200('0x1e')](realtime[_0xd200('0x1f')]())[_0xd200('0x1e')](user['getTelephones']())[_0xd200('0x1e')](realtime[_0xd200('0x20')]())['then'](trunk[_0xd200('0x21')]())['then'](realtime[_0xd200('0x22')]())['then'](voiceQueue['getVoiceQueues']())[_0xd200('0x1e')](realtime['initVoiceQueues']())[_0xd200('0x1e')](trigger[_0xd200('0x23')]())[_0xd200('0x1e')](realtime[_0xd200('0x24')]())[_0xd200('0x1e')](template[_0xd200('0x25')]())[_0xd200('0x1e')](realtime[_0xd200('0x26')]())[_0xd200('0x1e')](zendesk['getZendeskAccounts']())[_0xd200('0x1e')](realtime[_0xd200('0x27')]())['then'](salesforce[_0xd200('0x28')]())[_0xd200('0x1e')](realtime['initSalesforceAccounts']())['then'](sugarcrm[_0xd200('0x29')]())[_0xd200('0x1e')](realtime['initSugarcrmAccounts']())['then'](freshdesk[_0xd200('0x2a')]())['then'](realtime[_0xd200('0x2b')]())[_0xd200('0x1e')](desk[_0xd200('0x2c')]())[_0xd200('0x1e')](realtime[_0xd200('0x2d')]())['then'](zoho['getZohoAccounts']())[_0xd200('0x1e')](realtime[_0xd200('0x2e')]())[_0xd200('0x1e')](vtiger['getVtigerAccounts']())[_0xd200('0x1e')](realtime[_0xd200('0x2f')]())[_0xd200('0x1e')](freshsales['getFreshsalesAccounts']())[_0xd200('0x1e')](realtime[_0xd200('0x30')]())['then'](servicenow['getServicenowAccounts']())[_0xd200('0x1e')](realtime[_0xd200('0x31')]())[_0xd200('0x1e')](dynamics365['getDynamics365Accounts']())[_0xd200('0x1e')](realtime[_0xd200('0x32')]())[_0xd200('0x1e')](campaign[_0xd200('0x33')]())['then'](realtime['initCampaigns']())[_0xd200('0x1e')](voiceExtension['getVoiceExtensions']())[_0xd200('0x1e')](realtime[_0xd200('0x34')]())[_0xd200('0x1e')](faxAccount[_0xd200('0x35')]())[_0xd200('0x1e')](realtime[_0xd200('0x36')]())[_0xd200('0x1e')](function(){return realtime;});}function initParams(){return Promise[_0xd200('0x1d')]()['then'](voiceQueueReport['getVoiceQueueReports']())['then'](realtime['initVoiceQueueReports']())[_0xd200('0x1e')](cmHopperHistory[_0xd200('0x37')]())[_0xd200('0x1e')](realtime[_0xd200('0x38')]())[_0xd200('0x1e')](cmHopperHistory[_0xd200('0x39')]())[_0xd200('0x1e')](realtime[_0xd200('0x3a')]())[_0xd200('0x1e')](voiceCallReport[_0xd200('0x3b')]())[_0xd200('0x1e')](realtime['initVoiceCallReports']())[_0xd200('0x3c')](function(_0xe3b8cf){logger['error']('[index.js][initParams]',util[_0xd200('0x3d')](_0xe3b8cf,{'showHidden':![],'depth':null}));});}function main(){return server[_0xd200('0x3e')](realtime,preview,fax)[_0xd200('0x1e')](function(){return initRealtime();})[_0xd200('0x1e')](function(){return initParams();})['then'](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0xd200('0x3c')](function(_0x355621){logger['error']('[index.js][main]',util[_0xd200('0x3d')](_0x355621,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0xf964=['./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','hour','get','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initVoiceQueues','getTriggers','initTriggers','getTemplates','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','error','[index.js][initParams]','inspect','listen','sync','catch','[index.js][main]','util','moment','./server','./realtime','./report','./acw','./trigger','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trunk','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales'];(function(_0x11774d,_0x482443){var _0x416af8=function(_0x192416){while(--_0x192416){_0x11774d['push'](_0x11774d['shift']());}};_0x416af8(++_0x482443);}(_0xf964,0x144));var _0x4f96=function(_0x3e9f69,_0xa9faae){_0x3e9f69=_0x3e9f69-0x0;var _0x5f4e2c=_0xf964[_0x3e9f69];return _0x5f4e2c;};'use strict';var util=require(_0x4f96('0x0'));var moment=require(_0x4f96('0x1'));var server=require(_0x4f96('0x2'));var Realtime=require(_0x4f96('0x3'));var Report=require(_0x4f96('0x4'));var Acw=require(_0x4f96('0x5'));var Trigger=require(_0x4f96('0x6'));var Dialer=require('./dialer');var Preview=require(_0x4f96('0x7'));var Fax=require(_0x4f96('0x8'));var user=require(_0x4f96('0x9'));var voiceQueue=require(_0x4f96('0xa'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0x4f96('0xb'));var trunk=require(_0x4f96('0xc'));var trigger=require('./rpc/trigger');var template=require('./rpc/template');var cmHopperHistory=require(_0x4f96('0xd'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x4f96('0xe'));var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x4f96('0xf'));var salesforce=require(_0x4f96('0x10'));var sugarcrm=require(_0x4f96('0x11'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require('./rpc/integrations/desk');var zoho=require(_0x4f96('0x12'));var vtiger=require(_0x4f96('0x13'));var freshsales=require(_0x4f96('0x14'));var servicenow=require(_0x4f96('0x15'));var dynamics365=require(_0x4f96('0x16'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x4f96('0x17'))(_0x4f96('0x18'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x4f96('0x19'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x4f96('0x1a')](_0x4f96('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x4f96('0x1b')]()[_0x4f96('0x1c')](user[_0x4f96('0x1d')]())[_0x4f96('0x1c')](realtime[_0x4f96('0x1e')]())[_0x4f96('0x1c')](user[_0x4f96('0x1f')]())['then'](realtime[_0x4f96('0x20')]())['then'](trunk[_0x4f96('0x21')]())[_0x4f96('0x1c')](realtime['initTrunks']())[_0x4f96('0x1c')](voiceQueue['getVoiceQueues']())[_0x4f96('0x1c')](realtime[_0x4f96('0x22')]())[_0x4f96('0x1c')](trigger[_0x4f96('0x23')]())[_0x4f96('0x1c')](realtime[_0x4f96('0x24')]())[_0x4f96('0x1c')](template[_0x4f96('0x25')]())[_0x4f96('0x1c')](realtime['initTemplates']())[_0x4f96('0x1c')](zendesk['getZendeskAccounts']())[_0x4f96('0x1c')](realtime[_0x4f96('0x26')]())[_0x4f96('0x1c')](salesforce[_0x4f96('0x27')]())[_0x4f96('0x1c')](realtime['initSalesforceAccounts']())[_0x4f96('0x1c')](sugarcrm[_0x4f96('0x28')]())[_0x4f96('0x1c')](realtime['initSugarcrmAccounts']())[_0x4f96('0x1c')](freshdesk[_0x4f96('0x29')]())[_0x4f96('0x1c')](realtime['initFreshdeskAccounts']())['then'](desk[_0x4f96('0x2a')]())[_0x4f96('0x1c')](realtime[_0x4f96('0x2b')]())['then'](zoho[_0x4f96('0x2c')]())[_0x4f96('0x1c')](realtime[_0x4f96('0x2d')]())['then'](vtiger['getVtigerAccounts']())[_0x4f96('0x1c')](realtime[_0x4f96('0x2e')]())[_0x4f96('0x1c')](freshsales[_0x4f96('0x2f')]())[_0x4f96('0x1c')](realtime['initFreshsalesAccounts']())['then'](servicenow[_0x4f96('0x30')]())[_0x4f96('0x1c')](realtime[_0x4f96('0x31')]())[_0x4f96('0x1c')](dynamics365[_0x4f96('0x32')]())[_0x4f96('0x1c')](realtime[_0x4f96('0x33')]())[_0x4f96('0x1c')](campaign[_0x4f96('0x34')]())[_0x4f96('0x1c')](realtime[_0x4f96('0x35')]())['then'](voiceExtension['getVoiceExtensions']())[_0x4f96('0x1c')](realtime[_0x4f96('0x36')]())['then'](faxAccount[_0x4f96('0x37')]())[_0x4f96('0x1c')](realtime[_0x4f96('0x38')]())[_0x4f96('0x1c')](function(){return realtime;});}function initParams(){return Promise[_0x4f96('0x1b')]()[_0x4f96('0x1c')](voiceQueueReport[_0x4f96('0x39')]())[_0x4f96('0x1c')](realtime['initVoiceQueueReports']())['then'](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x4f96('0x1c')](realtime[_0x4f96('0x3a')]())['then'](cmHopperHistory[_0x4f96('0x3b')]())[_0x4f96('0x1c')](realtime[_0x4f96('0x3c')]())[_0x4f96('0x1c')](voiceCallReport[_0x4f96('0x3d')]())[_0x4f96('0x1c')](realtime['initVoiceCallReports']())['catch'](function(_0x3bc10f){logger[_0x4f96('0x3e')](_0x4f96('0x3f'),util[_0x4f96('0x40')](_0x3bc10f,{'showHidden':![],'depth':null}));});}function main(){return server[_0x4f96('0x41')](realtime,preview,fax)[_0x4f96('0x1c')](function(){return initRealtime();})[_0x4f96('0x1c')](function(){return initParams();})['then'](function(){report[_0x4f96('0x42')]();setInterval(initRealtime,0x1388);})[_0x4f96('0x43')](function(_0x343281){logger[_0x4f96('0x3e')](_0x4f96('0x44'),util[_0x4f96('0x40')](_0x343281,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index a58f022..b03a364 100644 --- a/server/services/ami/model/agent.js +++ b/server/services/ami/model/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ee1=['unknown','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusQueue','onhold','prototype','toLowerCase','not_inuse','idle','talking','statePause','toNumber','format','voiceStatusCallerIdNumber','user:%s','emit','user:ami:update','exports','lodash','moment','ioredis','../../../config/environment','redis','defaults','localhost','name','email','accountcode','fullname','state','stateTime','status'];(function(_0x4d207a,_0x3d4b39){var _0x3ff007=function(_0x1e52f1){while(--_0x1e52f1){_0x4d207a['push'](_0x4d207a['shift']());}};_0x3ff007(++_0x3d4b39);}(_0x7ee1,0xab));var _0x17ee=function(_0x3b902f,_0x2f65df){_0x3b902f=_0x3b902f-0x0;var _0x55af07=_0x7ee1[_0x3b902f];return _0x55af07;};'use strict';var _=require(_0x17ee('0x0'));var util=require('util');var moment=require(_0x17ee('0x1'));var Redis=require(_0x17ee('0x2'));var config=require(_0x17ee('0x3'));config[_0x17ee('0x4')]=_[_0x17ee('0x5')](config['redis'],{'host':_0x17ee('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function Agent(_0x126d34){this['id']=_0x126d34['id']||0x0;this[_0x17ee('0x7')]=_0x126d34[_0x17ee('0x7')]||'';this[_0x17ee('0x8')]=_0x126d34[_0x17ee('0x8')]||'';this['accountcode']=_0x126d34[_0x17ee('0x9')]||'';this['fullname']=_0x126d34[_0x17ee('0xa')]||'';this[_0x17ee('0xb')]='unknown';this[_0x17ee('0xc')]=0x0;this[_0x17ee('0xd')]=_0x17ee('0xe');this[_0x17ee('0xf')]='';this[_0x17ee('0x10')]='';this[_0x17ee('0x11')]='';this[_0x17ee('0x12')]='';this[_0x17ee('0x13')]=_0x126d34[_0x17ee('0x13')]||![];this[_0x17ee('0x14')]=_0x17ee('0xe');this[_0x17ee('0x15')]=0x0;this['voiceStatusCallerIdNumber']='';this[_0x17ee('0x16')]='';this[_0x17ee('0x17')]=![];this['local']=![];}Agent[_0x17ee('0x18')]['updateStatusRealtime']=function(_0x2f452e){if(!_0x2f452e[_0x17ee('0xb')]){return;}var _0x16a1b5=null;var _0x206f85=_0x2f452e['state'][_0x17ee('0x19')]();switch(_0x206f85){case _0x17ee('0x1a'):_0x206f85=_0x17ee('0x1b');break;case'inuse':_0x206f85=_0x17ee('0x1c');break;}if(this[_0x17ee('0x14')]!==_0x206f85||_0x2f452e[_0x17ee('0x1d')]){_0x16a1b5=_[_0x17ee('0x1e')](moment()[_0x17ee('0x1f')]('x'));}var _0x3785ed={'id':this['id'],'name':this[_0x17ee('0x7')],'email':this['email'],'accountcode':this['accountcode'],'fullname':this[_0x17ee('0xa')],'state':this[_0x17ee('0xb')],'stateTime':this[_0x17ee('0xc')],'status':this[_0x17ee('0xd')],'address':this['address'],'voiceStatus':_0x206f85||this[_0x17ee('0x14')],'voiceStatusTime':_0x16a1b5||this[_0x17ee('0x15')],'voiceStatusCallerIdNumber':this[_0x17ee('0x20')],'voiceStatusQueue':this[_0x17ee('0x16')],'interface':this['interface'],'onhold':this[_0x17ee('0x17')]};if(this[_0x17ee('0x14')]!==_0x206f85){this[_0x17ee('0x14')]=_0x206f85;io['to'](util['format'](_0x17ee('0x21'),_0x3785ed[_0x17ee('0x7')]))[_0x17ee('0x22')](_0x17ee('0x23'),_0x3785ed);io[_0x17ee('0x22')]('user:presence',_0x3785ed);}};module[_0x17ee('0x24')]=Agent; \ No newline at end of file +var _0x149c=['accountcode','fullname','state','unknown','stateTime','status','address','phone','mobile','interface','online','voiceStatus','voiceStatusCallerIdNumber','onhold','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','talking','statePause','toNumber','format','voiceStatusQueue','user:%s','user:ami:update','exports','lodash','moment','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','email'];(function(_0x9f7af3,_0xcbe532){var _0x64fafa=function(_0x1a3cfe){while(--_0x1a3cfe){_0x9f7af3['push'](_0x9f7af3['shift']());}};_0x64fafa(++_0xcbe532);}(_0x149c,0x143));var _0xc149=function(_0x15e393,_0x3d8642){_0x15e393=_0x15e393-0x0;var _0x42d38e=_0x149c[_0x15e393];return _0x42d38e;};'use strict';var _=require(_0xc149('0x0'));var util=require('util');var moment=require(_0xc149('0x1'));var Redis=require(_0xc149('0x2'));var config=require(_0xc149('0x3'));config['redis']=_[_0xc149('0x4')](config[_0xc149('0x5')],{'host':_0xc149('0x6'),'port':0x18eb});var io=require(_0xc149('0x7'))(new Redis(config[_0xc149('0x5')]));function Agent(_0x331504){this['id']=_0x331504['id']||0x0;this[_0xc149('0x8')]=_0x331504['name']||'';this['email']=_0x331504[_0xc149('0x9')]||'';this[_0xc149('0xa')]=_0x331504[_0xc149('0xa')]||'';this[_0xc149('0xb')]=_0x331504[_0xc149('0xb')]||'';this[_0xc149('0xc')]=_0xc149('0xd');this[_0xc149('0xe')]=0x0;this[_0xc149('0xf')]=_0xc149('0xd');this[_0xc149('0x10')]='';this[_0xc149('0x11')]='';this[_0xc149('0x12')]='';this[_0xc149('0x13')]='';this[_0xc149('0x14')]=_0x331504[_0xc149('0x14')]||![];this[_0xc149('0x15')]=_0xc149('0xd');this['voiceStatusTime']=0x0;this[_0xc149('0x16')]='';this['voiceStatusQueue']='';this[_0xc149('0x17')]=![];this['local']=![];}Agent[_0xc149('0x18')][_0xc149('0x19')]=function(_0x5e8968){if(!_0x5e8968['state']){return;}var _0x9dd0b=null;var _0xd4bc13=_0x5e8968[_0xc149('0xc')][_0xc149('0x1a')]();switch(_0xd4bc13){case _0xc149('0x1b'):_0xd4bc13=_0xc149('0x1c');break;case'inuse':_0xd4bc13=_0xc149('0x1d');break;}if(this[_0xc149('0x15')]!==_0xd4bc13||_0x5e8968[_0xc149('0x1e')]){_0x9dd0b=_[_0xc149('0x1f')](moment()[_0xc149('0x20')]('x'));}var _0x503124={'id':this['id'],'name':this[_0xc149('0x8')],'email':this[_0xc149('0x9')],'accountcode':this[_0xc149('0xa')],'fullname':this[_0xc149('0xb')],'state':this[_0xc149('0xc')],'stateTime':this[_0xc149('0xe')],'status':this['status'],'address':this[_0xc149('0x10')],'voiceStatus':_0xd4bc13||this[_0xc149('0x15')],'voiceStatusTime':_0x9dd0b||this['voiceStatusTime'],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0xc149('0x21')],'interface':this[_0xc149('0x13')],'onhold':this[_0xc149('0x17')]};if(this[_0xc149('0x15')]!==_0xd4bc13){this[_0xc149('0x15')]=_0xd4bc13;io['to'](util[_0xc149('0x20')](_0xc149('0x22'),_0x503124['name']))['emit'](_0xc149('0x23'),_0x503124);io['emit']('user:presence',_0x503124);}};module[_0xc149('0x24')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 818648c..51071b4 100644 --- a/server/services/ami/model/campaign.js +++ b/server/services/ami/model/campaign.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9529=['dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency'];(function(_0x19925b,_0x5727f0){var _0x1acd8a=function(_0xbb4619){while(--_0xbb4619){_0x19925b['push'](_0x19925b['shift']());}};_0x1acd8a(++_0x5727f0);}(_0x9529,0x1a7));var _0x9952=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9529[_0x321bb2];return _0x9c12ed;};'use strict';function Campaign(_0x48037e){this['id']=_0x48037e['id']||0x0;this[_0x9952('0x0')]=_0x48037e[_0x9952('0x0')]||'';this['type']=_0x48037e[_0x9952('0x1')]||_0x9952('0x2');this['originated']=0x0;this[_0x9952('0x3')]=0x0;this[_0x9952('0x4')]=0x0;this[_0x9952('0x5')]=0x0;this[_0x9952('0x6')]='';this['sendMessageOneNotActive']=!![];this[_0x9952('0x7')]=_0x48037e[_0x9952('0x7')];this[_0x9952('0x8')]=_0x48037e['limitCalls'];this[_0x9952('0x9')]=_0x48037e[_0x9952('0x9')]||null;this[_0x9952('0xa')]=_0x48037e[_0x9952('0xa')]?_0x48037e[_0x9952('0xa')]:null;this['dialOriginateCallerIdName']=_0x48037e[_0x9952('0xb')];this[_0x9952('0xc')]=_0x48037e[_0x9952('0xc')];this[_0x9952('0xd')]=_0x48037e[_0x9952('0xd')]||0x1e;this[_0x9952('0xe')]=_0x48037e[_0x9952('0xe')];this[_0x9952('0xf')]=_0x48037e[_0x9952('0xf')];this[_0x9952('0x10')]=_0x48037e[_0x9952('0x10')];this[_0x9952('0x11')]=_0x48037e['dialBusyRetryFrequency'];this[_0x9952('0x12')]=_0x48037e[_0x9952('0x12')];this[_0x9952('0x13')]=_0x48037e[_0x9952('0x13')];this[_0x9952('0x14')]=_0x48037e[_0x9952('0x14')];this[_0x9952('0x15')]=_0x48037e[_0x9952('0x15')]||0x3;this[_0x9952('0x16')]=_0x48037e['dialNoSuchNumberRetryFrequency']||0x96;this[_0x9952('0x17')]=_0x48037e[_0x9952('0x17')]||0x3;this[_0x9952('0x18')]=_0x48037e[_0x9952('0x18')]||0x96;this['dialAbandonedMaxRetry']=_0x48037e[_0x9952('0x19')]||0x3;this[_0x9952('0x1a')]=_0x48037e['dialAbandonedRetryFrequency']||0x96;this[_0x9952('0x1b')]=_0x48037e['dialMachineMaxRetry']||0x3;this[_0x9952('0x1c')]=_0x48037e[_0x9952('0x1c')]||0x96;this[_0x9952('0x1d')]=_0x48037e[_0x9952('0x1d')]||0x3;this[_0x9952('0x1e')]=_0x48037e['dialAgentRejectRetryFrequency']||0x96;this[_0x9952('0x1f')]=_0x48037e[_0x9952('0x1f')]||_0x9952('0x20');this[_0x9952('0x21')]=_0x48037e[_0x9952('0x21')]||undefined;this[_0x9952('0x22')]=_0x48037e[_0x9952('0x22')]||undefined;this['dialCutDigit']=_0x48037e['dialCutDigit']||undefined;this[_0x9952('0x23')]=_0x48037e[_0x9952('0x23')]?_0x48037e[_0x9952('0x23')]:undefined;this[_0x9952('0x24')]=_0x48037e[_0x9952('0x24')]?_0x48037e[_0x9952('0x24')]:undefined;this['Interval']=_0x48037e[_0x9952('0x25')]?_0x48037e[_0x9952('0x25')]:undefined;this[_0x9952('0x26')]=_0x48037e[_0x9952('0x26')]?_0x48037e[_0x9952('0x26')]:undefined;this[_0x9952('0x27')]=_0x48037e[_0x9952('0x26')]?_0x48037e[_0x9952('0x26')][_0x9952('0x0')]:undefined;this[_0x9952('0x28')]=_0x48037e['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x48037e['dialAMDInitialSilence'];this[_0x9952('0x29')]=_0x48037e['dialAMDGreeting'];this[_0x9952('0x2a')]=_0x48037e['dialAMDAfterGreetingSilence'];this[_0x9952('0x2b')]=_0x48037e[_0x9952('0x2b')];this['dialAMDMinWordLength']=_0x48037e[_0x9952('0x2c')];this[_0x9952('0x2d')]=_0x48037e[_0x9952('0x2d')];this['dialAMDMaximumNumberOfWords']=_0x48037e[_0x9952('0x2e')];this[_0x9952('0x2f')]=_0x48037e[_0x9952('0x2f')];this[_0x9952('0x30')]=_0x48037e[_0x9952('0x30')];}module[_0x9952('0x31')]=Campaign; \ No newline at end of file +var _0x7002=['dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName'];(function(_0xbcc64c,_0x2c6512){var _0xdf1b0d=function(_0x4d5575){while(--_0x4d5575){_0xbcc64c['push'](_0xbcc64c['shift']());}};_0xdf1b0d(++_0x2c6512);}(_0x7002,0xed));var _0x2700=function(_0x44d9ab,_0x76bc69){_0x44d9ab=_0x44d9ab-0x0;var _0x31485e=_0x7002[_0x44d9ab];return _0x31485e;};'use strict';function Campaign(_0x214a58){this['id']=_0x214a58['id']||0x0;this[_0x2700('0x0')]=_0x214a58[_0x2700('0x0')]||'';this[_0x2700('0x1')]=_0x214a58[_0x2700('0x1')]||_0x2700('0x2');this['originated']=0x0;this[_0x2700('0x3')]=0x0;this[_0x2700('0x4')]=0x0;this[_0x2700('0x5')]=0x0;this[_0x2700('0x6')]='';this[_0x2700('0x7')]=!![];this[_0x2700('0x8')]=_0x214a58[_0x2700('0x8')];this[_0x2700('0x9')]=_0x214a58['limitCalls'];this['dialTimezone']=_0x214a58[_0x2700('0xa')]||null;this[_0x2700('0xb')]=_0x214a58[_0x2700('0xb')]?_0x214a58[_0x2700('0xb')]:null;this[_0x2700('0xc')]=_0x214a58['dialOriginateCallerIdName'];this['dialOriginateCallerIdNumber']=_0x214a58[_0x2700('0xd')];this[_0x2700('0xe')]=_0x214a58[_0x2700('0xe')]||0x1e;this[_0x2700('0xf')]=_0x214a58[_0x2700('0xf')];this[_0x2700('0x10')]=_0x214a58[_0x2700('0x10')];this[_0x2700('0x11')]=_0x214a58[_0x2700('0x11')];this[_0x2700('0x12')]=_0x214a58[_0x2700('0x12')];this[_0x2700('0x13')]=_0x214a58['dialNoAnswerMaxRetry'];this[_0x2700('0x14')]=_0x214a58['dialNoAnswerRetryFrequency'];this[_0x2700('0x15')]=_0x214a58[_0x2700('0x15')];this['dialNoSuchNumberMaxRetry']=_0x214a58[_0x2700('0x16')]||0x3;this[_0x2700('0x17')]=_0x214a58['dialNoSuchNumberRetryFrequency']||0x96;this['dialDropMaxRetry']=_0x214a58[_0x2700('0x18')]||0x3;this['dialDropRetryFrequency']=_0x214a58[_0x2700('0x19')]||0x96;this[_0x2700('0x1a')]=_0x214a58[_0x2700('0x1a')]||0x3;this[_0x2700('0x1b')]=_0x214a58['dialAbandonedRetryFrequency']||0x96;this[_0x2700('0x1c')]=_0x214a58[_0x2700('0x1c')]||0x3;this[_0x2700('0x1d')]=_0x214a58[_0x2700('0x1d')]||0x96;this[_0x2700('0x1e')]=_0x214a58['dialAgentRejectMaxRetry']||0x3;this['dialAgentRejectRetryFrequency']=_0x214a58[_0x2700('0x1f')]||0x96;this['dialOrderByScheduledAt']=_0x214a58['dialOrderByScheduledAt']||_0x2700('0x20');this[_0x2700('0x21')]=_0x214a58[_0x2700('0x21')]||undefined;this[_0x2700('0x22')]=_0x214a58[_0x2700('0x22')]||undefined;this[_0x2700('0x23')]=_0x214a58[_0x2700('0x23')]||undefined;this['TrunkBackup']=_0x214a58[_0x2700('0x24')]?_0x214a58['TrunkBackup']:undefined;this[_0x2700('0x25')]=_0x214a58[_0x2700('0x25')]?_0x214a58[_0x2700('0x25')]:undefined;this[_0x2700('0x26')]=_0x214a58['Interval']?_0x214a58[_0x2700('0x26')]:undefined;this['SquareProject']=_0x214a58['SquareProject']?_0x214a58[_0x2700('0x27')]:undefined;this[_0x2700('0x28')]=_0x214a58[_0x2700('0x27')]?_0x214a58[_0x2700('0x27')][_0x2700('0x0')]:undefined;this[_0x2700('0x29')]=_0x214a58[_0x2700('0x29')]||![];this[_0x2700('0x2a')]=_0x214a58[_0x2700('0x2a')];this['dialAMDGreeting']=_0x214a58['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x214a58[_0x2700('0x2b')];this[_0x2700('0x2c')]=_0x214a58['dialAMDTotalAnalysisTime'];this[_0x2700('0x2d')]=_0x214a58[_0x2700('0x2d')];this[_0x2700('0x2e')]=_0x214a58[_0x2700('0x2e')];this[_0x2700('0x2f')]=_0x214a58[_0x2700('0x2f')];this[_0x2700('0x30')]=_0x214a58[_0x2700('0x30')];this[_0x2700('0x31')]=_0x214a58[_0x2700('0x31')];}module['exports']=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index c04c952..3c6804b 100644 --- a/server/services/ami/model/channel.js +++ b/server/services/ami/model/channel.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeb3f=['monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answered','answertime','endtime','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','type','tag','disposition'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0xeb3f,0xa8));var _0xfeb3=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xeb3f[_0x432682];return _0x463d05;};'use strict';function Channel(){this[_0xfeb3('0x0')]=null;this[_0xfeb3('0x1')]='';this[_0xfeb3('0x2')]='';this[_0xfeb3('0x3')]=0x0;this[_0xfeb3('0x4')]='';this[_0xfeb3('0x5')]=undefined;this[_0xfeb3('0x6')]=undefined;this[_0xfeb3('0x7')]=0x0;this[_0xfeb3('0x8')]='';this[_0xfeb3('0x9')]=0x0;this[_0xfeb3('0xa')]=0x0;this[_0xfeb3('0xb')]=0x0;this[_0xfeb3('0xc')]=![];this[_0xfeb3('0xd')]=null;this[_0xfeb3('0xe')]=null;this['unmanaged']=![];this[_0xfeb3('0xf')]=![];this[_0xfeb3('0x10')]='';this[_0xfeb3('0x11')]='';this[_0xfeb3('0x12')]=0x0;this[_0xfeb3('0x13')]=0x0;this[_0xfeb3('0x14')]=0x0;this[_0xfeb3('0x15')]=null;this[_0xfeb3('0x16')]=null;this[_0xfeb3('0x17')]=null;this['monitor']=![];this[_0xfeb3('0x18')]=null;this[_0xfeb3('0x19')]=null;this[_0xfeb3('0x1a')]=[];this[_0xfeb3('0x1b')]=undefined;this[_0xfeb3('0x1c')]=undefined;this[_0xfeb3('0x1d')]=undefined;this[_0xfeb3('0x1e')]=0x0;}module[_0xfeb3('0x1f')]=Channel; \ No newline at end of file +var _0xab9c=['calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','exten','answered','answertime','unmanaged','abandoned','lastapplication','duration','billableseconds','holdtime','type','tag','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','channel','destinationchannel'];(function(_0x188d6c,_0xed9823){var _0x4cdb20=function(_0x49fe66){while(--_0x49fe66){_0x188d6c['push'](_0x188d6c['shift']());}};_0x4cdb20(++_0xed9823);}(_0xab9c,0xd0));var _0xcab9=function(_0x62e715,_0x25b4a3){_0x62e715=_0x62e715-0x0;var _0x51f030=_0xab9c[_0x62e715];return _0x51f030;};'use strict';function Channel(){this['starttime']=null;this[_0xcab9('0x0')]='';this[_0xcab9('0x1')]='';this[_0xcab9('0x2')]=0x0;this[_0xcab9('0x3')]='';this[_0xcab9('0x4')]=undefined;this[_0xcab9('0x5')]=undefined;this[_0xcab9('0x6')]=0x0;this[_0xcab9('0x7')]='';this[_0xcab9('0x8')]=0x0;this['linkedid']=0x0;this[_0xcab9('0x9')]=0x0;this[_0xcab9('0xa')]=![];this[_0xcab9('0xb')]=null;this['endtime']=null;this[_0xcab9('0xc')]=![];this[_0xcab9('0xd')]=![];this[_0xcab9('0xe')]='';this['lastdata']='';this[_0xcab9('0xf')]=0x0;this[_0xcab9('0x10')]=0x0;this[_0xcab9('0x11')]=0x0;this[_0xcab9('0x12')]=null;this[_0xcab9('0x13')]=null;this[_0xcab9('0x14')]=null;this[_0xcab9('0x15')]=![];this[_0xcab9('0x16')]=null;this[_0xcab9('0x17')]=null;this[_0xcab9('0x18')]=[];this[_0xcab9('0x19')]=undefined;this[_0xcab9('0x1a')]=undefined;this[_0xcab9('0x1b')]=undefined;this[_0xcab9('0x1c')]=0x0;}module[_0xcab9('0x1d')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 451025e..efceea4 100644 --- a/server/services/ami/model/deskAccount.js +++ b/server/services/ami/model/deskAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x52cb=['name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','type','serverUrl','Configurations','exports'];(function(_0x5d8910,_0x3c93ae){var _0x285190=function(_0x22f28f){while(--_0x22f28f){_0x5d8910['push'](_0x5d8910['shift']());}};_0x285190(++_0x3c93ae);}(_0x52cb,0x90));var _0xb52c=function(_0x3e74f4,_0x3e9c91){_0x3e74f4=_0x3e74f4-0x0;var _0x489758=_0x52cb[_0x3e74f4];return _0x489758;};'use strict';function DeskAccount(_0x5bfa1e){this['id']=_0x5bfa1e['id']||0x0;this[_0xb52c('0x0')]=_0x5bfa1e[_0xb52c('0x0')]||'';this['username']=_0x5bfa1e[_0xb52c('0x1')]||'';this[_0xb52c('0x2')]=_0x5bfa1e[_0xb52c('0x2')]||'';this[_0xb52c('0x3')]=_0x5bfa1e['authType']||'';this[_0xb52c('0x4')]=_0x5bfa1e[_0xb52c('0x4')]||'';this[_0xb52c('0x5')]=_0x5bfa1e[_0xb52c('0x5')]||'';this[_0xb52c('0x6')]=_0x5bfa1e['consumerSecret']||'';this['token']=_0x5bfa1e[_0xb52c('0x7')]||'';this['tokenSecret']=_0x5bfa1e['tokenSecret']||'';this[_0xb52c('0x8')]=_0x5bfa1e['type']||'';this[_0xb52c('0x9')]=_0x5bfa1e[_0xb52c('0x9')]||'';this[_0xb52c('0xa')]=_0x5bfa1e[_0xb52c('0xa')]||{};}module[_0xb52c('0xb')]=DeskAccount; \ No newline at end of file +var _0x03a7=['username','remoteUri','authType','password','token','tokenSecret','type','Configurations','name'];(function(_0x5a0cc7,_0x304360){var _0x35c261=function(_0x10fce9){while(--_0x10fce9){_0x5a0cc7['push'](_0x5a0cc7['shift']());}};_0x35c261(++_0x304360);}(_0x03a7,0xd7));var _0x703a=function(_0x9ba32c,_0x425db8){_0x9ba32c=_0x9ba32c-0x0;var _0x3ed8e7=_0x03a7[_0x9ba32c];return _0x3ed8e7;};'use strict';function DeskAccount(_0x6aff25){this['id']=_0x6aff25['id']||0x0;this['name']=_0x6aff25[_0x703a('0x0')]||'';this[_0x703a('0x1')]=_0x6aff25[_0x703a('0x1')]||'';this[_0x703a('0x2')]=_0x6aff25[_0x703a('0x2')]||'';this[_0x703a('0x3')]=_0x6aff25[_0x703a('0x3')]||'';this['password']=_0x6aff25[_0x703a('0x4')]||'';this['consumerKey']=_0x6aff25['consumerKey']||'';this['consumerSecret']=_0x6aff25['consumerSecret']||'';this['token']=_0x6aff25[_0x703a('0x5')]||'';this[_0x703a('0x6')]=_0x6aff25[_0x703a('0x6')]||'';this['type']=_0x6aff25[_0x703a('0x7')]||'';this['serverUrl']=_0x6aff25['serverUrl']||'';this[_0x703a('0x8')]=_0x6aff25['Configurations']||{};}module['exports']=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 94d1066..0700b1f 100644 --- a/server/services/ami/model/dynamics365Account.js +++ b/server/services/ami/model/dynamics365Account.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc0fe=['username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','CloudProvider','exports'];(function(_0x2c2032,_0x416574){var _0x25a977=function(_0x3db53d){while(--_0x3db53d){_0x2c2032['push'](_0x2c2032['shift']());}};_0x25a977(++_0x416574);}(_0xc0fe,0xf0));var _0xec0f=function(_0x1dacba,_0x3b81a9){_0x1dacba=_0x1dacba-0x0;var _0x5edf7b=_0xc0fe[_0x1dacba];return _0x5edf7b;};'use strict';function Dynamics365Account(_0x336adb){this['id']=_0x336adb['id']||0x0;this['name']=_0x336adb['name']||'';this[_0xec0f('0x0')]=_0x336adb[_0xec0f('0x0')]||'';this['password']=_0x336adb[_0xec0f('0x1')]||'';this[_0xec0f('0x2')]=_0x336adb[_0xec0f('0x2')]||'';this[_0xec0f('0x3')]=_0x336adb[_0xec0f('0x3')]||'';this[_0xec0f('0x4')]=_0x336adb[_0xec0f('0x4')]||'';this['clientSecret']=_0x336adb[_0xec0f('0x5')]||{};this['serverUrl']=_0x336adb[_0xec0f('0x6')]||'';this['modernAuthentication']=_0x336adb[_0xec0f('0x7')]||![];this['Configurations']=_0x336adb['Configurations']||{};this[_0xec0f('0x8')]=_0x336adb[_0xec0f('0x8')]||{};}module[_0xec0f('0x9')]=Dynamics365Account; \ No newline at end of file +var _0x07cf=['clientId','clientSecret','serverUrl','Configurations','exports','name','username','password','remoteUri','tenantId'];(function(_0x3ec1da,_0x1e36f5){var _0x472358=function(_0x1d41b1){while(--_0x1d41b1){_0x3ec1da['push'](_0x3ec1da['shift']());}};_0x472358(++_0x1e36f5);}(_0x07cf,0x1bd));var _0xf07c=function(_0xf89c3,_0x351bf1){_0xf89c3=_0xf89c3-0x0;var _0x274fc8=_0x07cf[_0xf89c3];return _0x274fc8;};'use strict';function Dynamics365Account(_0x2488d0){this['id']=_0x2488d0['id']||0x0;this[_0xf07c('0x0')]=_0x2488d0['name']||'';this[_0xf07c('0x1')]=_0x2488d0['username']||'';this['password']=_0x2488d0[_0xf07c('0x2')]||'';this[_0xf07c('0x3')]=_0x2488d0[_0xf07c('0x3')]||'';this[_0xf07c('0x4')]=_0x2488d0[_0xf07c('0x4')]||'';this[_0xf07c('0x5')]=_0x2488d0[_0xf07c('0x5')]||'';this[_0xf07c('0x6')]=_0x2488d0[_0xf07c('0x6')]||{};this['serverUrl']=_0x2488d0[_0xf07c('0x7')]||'';this['modernAuthentication']=_0x2488d0['modernAuthentication']||![];this[_0xf07c('0x8')]=_0x2488d0[_0xf07c('0x8')]||{};this['CloudProvider']=_0x2488d0['CloudProvider']||{};}module[_0xf07c('0x9')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 9adc716..5cc8b6d 100644 --- a/server/services/ami/model/faxAccount.js +++ b/server/services/ami/model/faxAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0d87=['key','exports','name','description','ecm','headerinfo','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','Trunk','ListId'];(function(_0x53381d,_0x41ab1a){var _0x5a1ace=function(_0x3432f4){while(--_0x3432f4){_0x53381d['push'](_0x53381d['shift']());}};_0x5a1ace(++_0x41ab1a);}(_0x0d87,0x12e));var _0x70d8=function(_0xae3adc,_0x53d7bc){_0xae3adc=_0xae3adc-0x0;var _0xc6e031=_0x0d87[_0xae3adc];return _0xc6e031;};'use strict';function FaxAccount(_0x16b8cb){this['id']=_0x16b8cb['id']||0x0;this[_0x70d8('0x0')]=_0x16b8cb[_0x70d8('0x0')]||'';this[_0x70d8('0x1')]=_0x16b8cb['description'];this[_0x70d8('0x2')]=_0x16b8cb[_0x70d8('0x2')];this[_0x70d8('0x3')]=_0x16b8cb['headerinfo'];this['localstationid']=_0x16b8cb['localstationid'];this[_0x70d8('0x4')]=_0x16b8cb[_0x70d8('0x4')]||0x960;this['maxrate']=_0x16b8cb[_0x70d8('0x5')]||0x3840;this[_0x70d8('0x6')]=_0x16b8cb[_0x70d8('0x6')]||'v17,v27,v29';this['gateway']=_0x16b8cb[_0x70d8('0x7')]||'no';this['faxdetect']=_0x16b8cb[_0x70d8('0x8')]||'no';this[_0x70d8('0x9')]=_0x16b8cb[_0x70d8('0x9')]||0x1388;this[_0x70d8('0xa')]=_0x16b8cb[_0x70d8('0xa')]||'SIP';this[_0x70d8('0xb')]=_0x16b8cb[_0x70d8('0xb')]?_0x16b8cb[_0x70d8('0xb')]:undefined;this[_0x70d8('0xc')]=_0x16b8cb[_0x70d8('0xc')];this[_0x70d8('0xd')]=_0x16b8cb[_0x70d8('0xd')];}module[_0x70d8('0xe')]=FaxAccount; \ No newline at end of file +var _0x3c91=['t38timeout','tech','Trunk','ListId','key','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x3c91,0x8c));var _0x13c9=function(_0x39f15a,_0x4e834f){_0x39f15a=_0x39f15a-0x0;var _0x4fa228=_0x3c91[_0x39f15a];return _0x4fa228;};'use strict';function FaxAccount(_0x2bab3a){this['id']=_0x2bab3a['id']||0x0;this['name']=_0x2bab3a['name']||'';this[_0x13c9('0x0')]=_0x2bab3a['description'];this[_0x13c9('0x1')]=_0x2bab3a['ecm'];this['headerinfo']=_0x2bab3a[_0x13c9('0x2')];this[_0x13c9('0x3')]=_0x2bab3a[_0x13c9('0x3')];this[_0x13c9('0x4')]=_0x2bab3a['minrate']||0x960;this['maxrate']=_0x2bab3a[_0x13c9('0x5')]||0x3840;this['modem']=_0x2bab3a[_0x13c9('0x6')]||_0x13c9('0x7');this[_0x13c9('0x8')]=_0x2bab3a[_0x13c9('0x8')]||'no';this[_0x13c9('0x9')]=_0x2bab3a[_0x13c9('0x9')]||'no';this[_0x13c9('0xa')]=_0x2bab3a[_0x13c9('0xa')]||0x1388;this['tech']=_0x2bab3a[_0x13c9('0xb')]||'SIP';this[_0x13c9('0xc')]=_0x2bab3a[_0x13c9('0xc')]?_0x2bab3a[_0x13c9('0xc')]:undefined;this['ListId']=_0x2bab3a[_0x13c9('0xd')];this[_0x13c9('0xe')]=_0x2bab3a[_0x13c9('0xe')];}module['exports']=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 50fe088..b0ca1b3 100644 --- a/server/services/ami/model/freshdeskAccount.js +++ b/server/services/ami/model/freshdeskAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9153=['exports','name','username','token','remoteUri','serverUrl','Configurations'];(function(_0x45313f,_0x46caf4){var _0x402910=function(_0x4883d8){while(--_0x4883d8){_0x45313f['push'](_0x45313f['shift']());}};_0x402910(++_0x46caf4);}(_0x9153,0x1d6));var _0x3915=function(_0x60a68c,_0x5ad819){_0x60a68c=_0x60a68c-0x0;var _0x253abe=_0x9153[_0x60a68c];return _0x253abe;};'use strict';function FreshdeskAccount(_0x18a7bc){this['id']=_0x18a7bc['id']||0x0;this[_0x3915('0x0')]=_0x18a7bc[_0x3915('0x0')]||'';this[_0x3915('0x1')]=_0x18a7bc[_0x3915('0x1')]||'';this['apiKey']=_0x18a7bc[_0x3915('0x2')]||'';this[_0x3915('0x3')]=_0x18a7bc[_0x3915('0x3')]||'';this[_0x3915('0x4')]=_0x18a7bc[_0x3915('0x4')]||'';this[_0x3915('0x5')]=_0x18a7bc[_0x3915('0x5')]||{};}module[_0x3915('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0x6caf=['remoteUri','serverUrl','Configurations','name','username','apiKey','token'];(function(_0x47791a,_0x562c56){var _0x3b0a30=function(_0x1e01c2){while(--_0x1e01c2){_0x47791a['push'](_0x47791a['shift']());}};_0x3b0a30(++_0x562c56);}(_0x6caf,0xd5));var _0xf6ca=function(_0x5c2c7c,_0xa7d3b1){_0x5c2c7c=_0x5c2c7c-0x0;var _0xea7ffe=_0x6caf[_0x5c2c7c];return _0xea7ffe;};'use strict';function FreshdeskAccount(_0xd8ff14){this['id']=_0xd8ff14['id']||0x0;this['name']=_0xd8ff14[_0xf6ca('0x0')]||'';this[_0xf6ca('0x1')]=_0xd8ff14[_0xf6ca('0x1')]||'';this[_0xf6ca('0x2')]=_0xd8ff14[_0xf6ca('0x3')]||'';this[_0xf6ca('0x4')]=_0xd8ff14[_0xf6ca('0x4')]||'';this[_0xf6ca('0x5')]=_0xd8ff14[_0xf6ca('0x5')]||'';this[_0xf6ca('0x6')]=_0xd8ff14[_0xf6ca('0x6')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 586c503..1e457b3 100644 --- a/server/services/ami/model/freshsalesAccount.js +++ b/server/services/ami/model/freshsalesAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2cd3=['exports','name','username','apiKey','token','remoteUri','serverUrl','Configurations'];(function(_0x54fbc0,_0x3ed298){var _0x55108f=function(_0x4c1e5c){while(--_0x4c1e5c){_0x54fbc0['push'](_0x54fbc0['shift']());}};_0x55108f(++_0x3ed298);}(_0x2cd3,0xf1));var _0x32cd=function(_0x289891,_0x49a0fa){_0x289891=_0x289891-0x0;var _0x31cf2e=_0x2cd3[_0x289891];return _0x31cf2e;};'use strict';function FreshsalesAccount(_0x21c841){this['id']=_0x21c841['id']||0x0;this['name']=_0x21c841[_0x32cd('0x0')]||'';this[_0x32cd('0x1')]=_0x21c841[_0x32cd('0x1')]||'';this[_0x32cd('0x2')]=_0x21c841[_0x32cd('0x3')]||'';this[_0x32cd('0x4')]=_0x21c841['remoteUri']||'';this['serverUrl']=_0x21c841[_0x32cd('0x5')]||'';this[_0x32cd('0x6')]=_0x21c841[_0x32cd('0x6')]||{};}module[_0x32cd('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0x51f2=['serverUrl','Configurations','exports','name','username','apiKey','token','remoteUri'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x51f2,0xeb));var _0x251f=function(_0x452e31,_0x53a3e2){_0x452e31=_0x452e31-0x0;var _0x3c1eba=_0x51f2[_0x452e31];return _0x3c1eba;};'use strict';function FreshsalesAccount(_0x1cf463){this['id']=_0x1cf463['id']||0x0;this[_0x251f('0x0')]=_0x1cf463[_0x251f('0x0')]||'';this[_0x251f('0x1')]=_0x1cf463[_0x251f('0x1')]||'';this[_0x251f('0x2')]=_0x1cf463[_0x251f('0x3')]||'';this[_0x251f('0x4')]=_0x1cf463[_0x251f('0x4')]||'';this['serverUrl']=_0x1cf463[_0x251f('0x5')]||'';this[_0x251f('0x6')]=_0x1cf463[_0x251f('0x6')]||{};}module[_0x251f('0x7')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index c56e148..ef119a3 100644 --- a/server/services/ami/model/queueReport.js +++ b/server/services/ami/model/queueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x420d=['mohtime','variables','exports','inbound','uniqueid','calleridname','queue','queuecallerjoinAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','accountcode','context','exten','priority','holdtime','assigned','motionChannel','voice'];(function(_0x346caa,_0x46888d){var _0x1f4548=function(_0x3e7c1b){while(--_0x3e7c1b){_0x346caa['push'](_0x346caa['shift']());}};_0x1f4548(++_0x46888d);}(_0x420d,0x85));var _0xd420=function(_0x4beb90,_0x333b47){_0x4beb90=_0x4beb90-0x0;var _0x1f509a=_0x420d[_0x4beb90];return _0x1f509a;};'use strict';function QueueReport(){this['type']=_0xd420('0x0');this[_0xd420('0x1')]='';this['calleridnum']='';this[_0xd420('0x2')]='';this[_0xd420('0x3')]='';this[_0xd420('0x4')]=null;this['queuecallerleaveAt']=null;this[_0xd420('0x5')]=0x1;this[_0xd420('0x6')]=0x1;this[_0xd420('0x7')]=![];this[_0xd420('0x8')]=null;this['queuecallercomplete']=![];this[_0xd420('0x9')]=null;this[_0xd420('0xa')]=![];this[_0xd420('0xb')]=null;this[_0xd420('0xc')]=0x1;this[_0xd420('0xd')]='';this[_0xd420('0xe')]='';this['connectedlinename']='';this[_0xd420('0xf')]='';this[_0xd420('0x10')]='';this[_0xd420('0x11')]='';this[_0xd420('0x12')]='';this[_0xd420('0x13')]=0x0;this[_0xd420('0x14')]=![];this['lastAssignedTo']='';this[_0xd420('0x15')]=_0xd420('0x16');this['routealias']=null;this[_0xd420('0x17')]=0x0;this[_0xd420('0x18')]={};}module[_0xd420('0x19')]=QueueReport; \ No newline at end of file +var _0xa2d8=['exten','priority','holdtime','assigned','lastAssignedTo','motionChannel','voice','routealias','mohtime','variables','exports','type','inbound','uniqueid','calleridnum','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','originalposition','channel','connectedlinenum','context'];(function(_0x2932cf,_0x362fd9){var _0x1711dd=function(_0x2d8de6){while(--_0x2d8de6){_0x2932cf['push'](_0x2932cf['shift']());}};_0x1711dd(++_0x362fd9);}(_0xa2d8,0x1af));var _0x8a2d=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xa2d8[_0x3bf83f];return _0x22c4a9;};'use strict';function QueueReport(){this[_0x8a2d('0x0')]=_0x8a2d('0x1');this[_0x8a2d('0x2')]='';this[_0x8a2d('0x3')]='';this['calleridname']='';this['queue']='';this[_0x8a2d('0x4')]=null;this[_0x8a2d('0x5')]=null;this[_0x8a2d('0x6')]=0x1;this[_0x8a2d('0x7')]=0x1;this[_0x8a2d('0x8')]=![];this[_0x8a2d('0x9')]=null;this[_0x8a2d('0xa')]=![];this[_0x8a2d('0xb')]=null;this[_0x8a2d('0xc')]=![];this['queuecallerexitAt']=null;this[_0x8a2d('0xd')]=0x1;this[_0x8a2d('0xe')]='';this[_0x8a2d('0xf')]='';this['connectedlinename']='';this['accountcode']='';this[_0x8a2d('0x10')]='';this[_0x8a2d('0x11')]='';this[_0x8a2d('0x12')]='';this[_0x8a2d('0x13')]=0x0;this[_0x8a2d('0x14')]=![];this[_0x8a2d('0x15')]='';this[_0x8a2d('0x16')]=_0x8a2d('0x17');this[_0x8a2d('0x18')]=null;this[_0x8a2d('0x19')]=0x0;this[_0x8a2d('0x1a')]={};}module[_0x8a2d('0x1b')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index a3681b9..74986b7 100644 --- a/server/services/ami/model/salesforceAccount.js +++ b/server/services/ami/model/salesforceAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb3c3=['name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','Configurations','exports'];(function(_0x1a957b,_0x3a5dca){var _0x2b79f4=function(_0x113582){while(--_0x113582){_0x1a957b['push'](_0x1a957b['shift']());}};_0x2b79f4(++_0x3a5dca);}(_0xb3c3,0x1ce));var _0x3b3c=function(_0x4708e3,_0x630b5){_0x4708e3=_0x4708e3-0x0;var _0x52977f=_0xb3c3[_0x4708e3];return _0x52977f;};'use strict';function SalesforceAccount(_0x217e43){this['id']=_0x217e43['id']||0x0;this['name']=_0x217e43[_0x3b3c('0x0')]||'';this['username']=_0x217e43[_0x3b3c('0x1')]||'';this['remoteUri']=_0x217e43[_0x3b3c('0x2')]||'';this[_0x3b3c('0x3')]=_0x217e43[_0x3b3c('0x3')]||'';this['clientId']=_0x217e43[_0x3b3c('0x4')]||'';this[_0x3b3c('0x5')]=_0x217e43['clientSecret']||'';this[_0x3b3c('0x6')]=_0x217e43['securityToken']||'';this[_0x3b3c('0x7')]=_0x217e43[_0x3b3c('0x7')]||_0x3b3c('0x8');this['serverUrl']=_0x217e43['serverUrl']||'';this[_0x3b3c('0x9')]=_0x217e43['Configurations']||{};}module[_0x3b3c('0xa')]=SalesforceAccount; \ No newline at end of file +var _0x0007=['Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl'];(function(_0x3f8e02,_0xe673ae){var _0x3ddf2a=function(_0x23352f){while(--_0x23352f){_0x3f8e02['push'](_0x3f8e02['shift']());}};_0x3ddf2a(++_0xe673ae);}(_0x0007,0x1ee));var _0x7000=function(_0x1d930e,_0x20d8b8){_0x1d930e=_0x1d930e-0x0;var _0x5bbd66=_0x0007[_0x1d930e];return _0x5bbd66;};'use strict';function SalesforceAccount(_0x4a4b06){this['id']=_0x4a4b06['id']||0x0;this[_0x7000('0x0')]=_0x4a4b06[_0x7000('0x0')]||'';this['username']=_0x4a4b06[_0x7000('0x1')]||'';this[_0x7000('0x2')]=_0x4a4b06[_0x7000('0x2')]||'';this[_0x7000('0x3')]=_0x4a4b06['password']||'';this[_0x7000('0x4')]=_0x4a4b06[_0x7000('0x4')]||'';this[_0x7000('0x5')]=_0x4a4b06[_0x7000('0x5')]||'';this[_0x7000('0x6')]=_0x4a4b06[_0x7000('0x6')]||'';this[_0x7000('0x7')]=_0x4a4b06['type']||_0x7000('0x8');this[_0x7000('0x9')]=_0x4a4b06[_0x7000('0x9')]||'';this[_0x7000('0xa')]=_0x4a4b06[_0x7000('0xa')]||{};}module[_0x7000('0xb')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 74cfc55..3fcbdf7 100644 --- a/server/services/ami/model/servicenowAccount.js +++ b/server/services/ami/model/servicenowAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8587=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x49cf28,_0x5eed1d){var _0x280cba=function(_0x1750a4){while(--_0x1750a4){_0x49cf28['push'](_0x49cf28['shift']());}};_0x280cba(++_0x5eed1d);}(_0x8587,0x1dc));var _0x7858=function(_0x3f4125,_0x2456f9){_0x3f4125=_0x3f4125-0x0;var _0x227221=_0x8587[_0x3f4125];return _0x227221;};'use strict';function ServicenowAccount(_0x43f938){this['id']=_0x43f938['id']||0x0;this[_0x7858('0x0')]=_0x43f938[_0x7858('0x0')]||'';this[_0x7858('0x1')]=_0x43f938[_0x7858('0x1')]||'';this[_0x7858('0x2')]=_0x43f938[_0x7858('0x2')]||'';this[_0x7858('0x3')]=_0x43f938[_0x7858('0x3')]||'';this[_0x7858('0x4')]=_0x43f938[_0x7858('0x4')]||'';this[_0x7858('0x5')]=_0x43f938[_0x7858('0x5')]||{};}module[_0x7858('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x5ec2=['serverUrl','Configurations','name','username','password','remoteUri'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x5ec2,0x1be));var _0x25ec=function(_0x46a38b,_0x16ffb5){_0x46a38b=_0x46a38b-0x0;var _0x346e75=_0x5ec2[_0x46a38b];return _0x346e75;};'use strict';function ServicenowAccount(_0x545dcc){this['id']=_0x545dcc['id']||0x0;this[_0x25ec('0x0')]=_0x545dcc[_0x25ec('0x0')]||'';this[_0x25ec('0x1')]=_0x545dcc[_0x25ec('0x1')]||'';this['password']=_0x545dcc[_0x25ec('0x2')]||'';this[_0x25ec('0x3')]=_0x545dcc[_0x25ec('0x3')]||'';this[_0x25ec('0x4')]=_0x545dcc[_0x25ec('0x4')]||'';this[_0x25ec('0x5')]=_0x545dcc[_0x25ec('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 441033d..e5228bd 100644 --- a/server/services/ami/model/sugarcrmAccount.js +++ b/server/services/ami/model/sugarcrmAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa2d7=['remoteUri','serverUrl','Configurations','exports','name','password'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xa2d7,0x1ba));var _0x7a2d=function(_0x51c358,_0x54c9d2){_0x51c358=_0x51c358-0x0;var _0x522ee1=_0xa2d7[_0x51c358];return _0x522ee1;};'use strict';function SugarcrmAccount(_0x1b8b7d){this['id']=_0x1b8b7d['id']||0x0;this[_0x7a2d('0x0')]=_0x1b8b7d[_0x7a2d('0x0')]||'';this['username']=_0x1b8b7d['username']||'';this[_0x7a2d('0x1')]=_0x1b8b7d[_0x7a2d('0x1')]||'';this[_0x7a2d('0x2')]=_0x1b8b7d[_0x7a2d('0x2')]||'';this['serverUrl']=_0x1b8b7d[_0x7a2d('0x3')]||'';this[_0x7a2d('0x4')]=_0x1b8b7d[_0x7a2d('0x4')]||{};}module[_0x7a2d('0x5')]=SugarcrmAccount; \ No newline at end of file +var _0xb7ca=['serverUrl','Configurations','name','username','remoteUri'];(function(_0x573d71,_0x2854d4){var _0x2fe711=function(_0x528f32){while(--_0x528f32){_0x573d71['push'](_0x573d71['shift']());}};_0x2fe711(++_0x2854d4);}(_0xb7ca,0x89));var _0xab7c=function(_0x11c0d7,_0x4c8eea){_0x11c0d7=_0x11c0d7-0x0;var _0x51be4c=_0xb7ca[_0x11c0d7];return _0x51be4c;};'use strict';function SugarcrmAccount(_0x57c6f3){this['id']=_0x57c6f3['id']||0x0;this[_0xab7c('0x0')]=_0x57c6f3[_0xab7c('0x0')]||'';this['username']=_0x57c6f3[_0xab7c('0x1')]||'';this['password']=_0x57c6f3['password']||'';this[_0xab7c('0x2')]=_0x57c6f3['remoteUri']||'';this[_0xab7c('0x3')]=_0x57c6f3[_0xab7c('0x3')]||'';this[_0xab7c('0x4')]=_0x57c6f3[_0xab7c('0x4')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index f6c57b5..5e141c8 100644 --- a/server/services/ami/model/telephone.js +++ b/server/services/ami/model/telephone.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x42cb=['status','name','accountcode','unknown','stateTime'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x42cb,0x178));var _0xb42c=function(_0x4d8027,_0xfb9231){_0x4d8027=_0x4d8027-0x0;var _0x2ee50e=_0x42cb[_0x4d8027];return _0x2ee50e;};'use strict';function Telephone(_0xd87a11){this['id']=_0xd87a11['id']||0x0;this['name']=_0xd87a11[_0xb42c('0x0')]||'';this['accountcode']=_0xd87a11[_0xb42c('0x1')]||'';this['state']=_0xb42c('0x2');this[_0xb42c('0x3')]=0x0;this[_0xb42c('0x4')]=_0xb42c('0x2');this['address']='';}module['exports']=Telephone; \ No newline at end of file +var _0xda54=['accountcode','unknown','status','name'];(function(_0x11946c,_0x12152c){var _0x383935=function(_0x61fce2){while(--_0x61fce2){_0x11946c['push'](_0x11946c['shift']());}};_0x383935(++_0x12152c);}(_0xda54,0xa3));var _0x4da5=function(_0x2dd615,_0x18099c){_0x2dd615=_0x2dd615-0x0;var _0x5255a4=_0xda54[_0x2dd615];return _0x5255a4;};'use strict';function Telephone(_0x3d4bbb){this['id']=_0x3d4bbb['id']||0x0;this[_0x4da5('0x0')]=_0x3d4bbb[_0x4da5('0x0')]||'';this[_0x4da5('0x1')]=_0x3d4bbb['accountcode']||'';this['state']=_0x4da5('0x2');this['stateTime']=0x0;this[_0x4da5('0x3')]='unknown';this['address']='';}module['exports']=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 68ffb90..a28724c 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['exports','name'];(function(_0x54968b,_0x409b73){var _0x9c12d6=function(_0x2ae72a){while(--_0x2ae72a){_0x54968b['push'](_0x54968b['shift']());}};_0x9c12d6(++_0x409b73);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x2d844c,_0x8aa1cc){var _0x52cad8=function(_0x9c9885){while(--_0x9c9885){_0x2d844c['push'](_0x2d844c['shift']());}};_0x52cad8(++_0x8aa1cc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index fbba75c..ee24174 100644 --- a/server/services/ami/model/trigger.js +++ b/server/services/ami/model/trigger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4fc2=['name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x43f16f,_0x5b99e5){var _0x66db51=function(_0x1b017b){while(--_0x1b017b){_0x43f16f['push'](_0x43f16f['shift']());}};_0x66db51(++_0x5b99e5);}(_0x4fc2,0x111));var _0x24fc=function(_0x401e25,_0x51ce02){_0x401e25=_0x401e25-0x0;var _0x192d3d=_0x4fc2[_0x401e25];return _0x192d3d;};'use strict';function Trigger(_0x5ea3ab){this['id']=_0x5ea3ab['id']||0x0;this[_0x24fc('0x0')]=_0x5ea3ab[_0x24fc('0x0')]||'';this[_0x24fc('0x1')]=_0x5ea3ab['channel']||_0x24fc('0x2');this[_0x24fc('0x3')]=_0x5ea3ab[_0x24fc('0x3')]||![];this['AllConditions']=_0x5ea3ab[_0x24fc('0x4')]||[];this[_0x24fc('0x5')]=_0x5ea3ab['AnyConditions']||[];this[_0x24fc('0x6')]=_0x5ea3ab[_0x24fc('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file +var _0x5eb8=['Actions','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x2650e9,_0xb91cc){var _0x3511c8=function(_0x5069cf){while(--_0x5069cf){_0x2650e9['push'](_0x2650e9['shift']());}};_0x3511c8(++_0xb91cc);}(_0x5eb8,0xb0));var _0x85eb=function(_0x4b935a,_0x327ee3){_0x4b935a=_0x4b935a-0x0;var _0xa298f0=_0x5eb8[_0x4b935a];return _0xa298f0;};'use strict';function Trigger(_0x5ea4df){this['id']=_0x5ea4df['id']||0x0;this['name']=_0x5ea4df[_0x85eb('0x0')]||'';this[_0x85eb('0x1')]=_0x5ea4df[_0x85eb('0x1')]||_0x85eb('0x2');this[_0x85eb('0x3')]=_0x5ea4df[_0x85eb('0x3')]||![];this[_0x85eb('0x4')]=_0x5ea4df[_0x85eb('0x4')]||[];this[_0x85eb('0x5')]=_0x5ea4df[_0x85eb('0x5')]||[];this[_0x85eb('0x6')]=_0x5ea4df[_0x85eb('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 2204e29..631127a 100644 --- a/server/services/ami/model/trunk.js +++ b/server/services/ami/model/trunk.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5cfc=['registry','split','host','port','domain','stateRegistry','registrationtime','address','defaultuser','exports','active','name','state','unknown','stateTime'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x5cfc,0x118));var _0xc5cf=function(_0x2fdce0,_0x496242){_0x2fdce0=_0x2fdce0-0x0;var _0x36f07e=_0x5cfc[_0x2fdce0];return _0x36f07e;};'use strict';function Trunk(_0x11f397){this['id']=_0x11f397['id']||0x0;this[_0xc5cf('0x0')]=_0x11f397[_0xc5cf('0x0')]||![];this['name']=_0x11f397[_0xc5cf('0x1')]||'';this[_0xc5cf('0x2')]=_0xc5cf('0x3');this[_0xc5cf('0x4')]=0x0;this['status']=_0xc5cf('0x3');this[_0xc5cf('0x5')]=_0x11f397['registry']&&_0x11f397[_0xc5cf('0x5')]['indexOf'](':')?_0x11f397['registry'][_0xc5cf('0x6')](':')[0x0]:'';this[_0xc5cf('0x7')]='';this[_0xc5cf('0x8')]='';this[_0xc5cf('0x9')]='';this['domainport']='';this['refresh']='';this[_0xc5cf('0xa')]=_0xc5cf('0x3');this[_0xc5cf('0xb')]='';this[_0xc5cf('0xc')]='';this['defaultuser']=_0x11f397[_0xc5cf('0xd')]||'';}module[_0xc5cf('0xe')]=Trunk; \ No newline at end of file +var _0x6e56=['split','host','domain','domainport','refresh','exports','active','name','state','unknown','stateTime','status','registry','indexOf'];(function(_0x49ab57,_0x410a7b){var _0xde4bf9=function(_0x277315){while(--_0x277315){_0x49ab57['push'](_0x49ab57['shift']());}};_0xde4bf9(++_0x410a7b);}(_0x6e56,0x11e));var _0x66e5=function(_0x4f9d26,_0x641341){_0x4f9d26=_0x4f9d26-0x0;var _0x57debc=_0x6e56[_0x4f9d26];return _0x57debc;};'use strict';function Trunk(_0x4318e8){this['id']=_0x4318e8['id']||0x0;this[_0x66e5('0x0')]=_0x4318e8[_0x66e5('0x0')]||![];this[_0x66e5('0x1')]=_0x4318e8['name']||'';this[_0x66e5('0x2')]=_0x66e5('0x3');this[_0x66e5('0x4')]=0x0;this[_0x66e5('0x5')]=_0x66e5('0x3');this[_0x66e5('0x6')]=_0x4318e8[_0x66e5('0x6')]&&_0x4318e8[_0x66e5('0x6')][_0x66e5('0x7')](':')?_0x4318e8[_0x66e5('0x6')][_0x66e5('0x8')](':')[0x0]:'';this[_0x66e5('0x9')]='';this['port']='';this[_0x66e5('0xa')]='';this[_0x66e5('0xb')]='';this[_0x66e5('0xc')]='';this['stateRegistry']=_0x66e5('0x3');this['registrationtime']='';this['address']='';this['defaultuser']=_0x4318e8['defaultuser']||'';}module[_0x66e5('0xd')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 46657ff..57fbb55 100644 --- a/server/services/ami/model/voiceExtension.js +++ b/server/services/ami/model/voiceExtension.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8ad=['exten','recordingFormat','none','mandatoryDisposition','exports'];(function(_0x4f4ad,_0x4374f8){var _0x48ad55=function(_0x58ca24){while(--_0x58ca24){_0x4f4ad['push'](_0x4f4ad['shift']());}};_0x48ad55(++_0x4374f8);}(_0xd8ad,0x73));var _0xdd8a=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xd8ad[_0x47a7d0];return _0xb9bd08;};'use strict';function voiceExtension(_0x51297a){this['id']=_0x51297a['id']||0x0;this[_0xdd8a('0x0')]=_0x51297a[_0xdd8a('0x0')]||'';this['recordingFormat']=_0x51297a[_0xdd8a('0x1')]||_0xdd8a('0x2');this[_0xdd8a('0x3')]=_0x51297a[_0xdd8a('0x3')]||![];}module[_0xdd8a('0x4')]=voiceExtension; \ No newline at end of file +var _0x66ac=['recordingFormat','mandatoryDisposition','exports','exten'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x66ac,0xf3));var _0xc66a=function(_0xeeaa4b,_0x3f21cd){_0xeeaa4b=_0xeeaa4b-0x0;var _0x2cc03a=_0x66ac[_0xeeaa4b];return _0x2cc03a;};'use strict';function voiceExtension(_0x372502){this['id']=_0x372502['id']||0x0;this[_0xc66a('0x0')]=_0x372502[_0xc66a('0x0')]||'';this[_0xc66a('0x1')]=_0x372502[_0xc66a('0x1')]||'none';this[_0xc66a('0x2')]=_0x372502[_0xc66a('0x2')]||![];}module[_0xc66a('0x3')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index c57de8f..4c9c8e4 100644 --- a/server/services/ami/model/voiceQueue.js +++ b/server/services/ami/model/voiceQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x04cc=['startPredictive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','gsm','fewestcalls','linear','roundrobin','rrmemory','rrordered','wrandom','name','monitor_format','type','inbound','waiting','total','answered','sumDuration','unmanaged','abandoned','available','busy','inUse','invalid','loggedIn','paused','ringInUse','talking','unavailable','unknown','acw','acwTimeout','autopause','statusMessage','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive'];(function(_0x173eff,_0x55a7d0){var _0x119fbd=function(_0x31a223){while(--_0x31a223){_0x173eff['push'](_0x173eff['shift']());}};_0x119fbd(++_0x55a7d0);}(_0x04cc,0x11a));var _0xc04c=function(_0x48dfc7,_0x28410f){_0x48dfc7=_0x48dfc7-0x0;var _0x553cbf=_0x04cc[_0x48dfc7];return _0x553cbf;};'use strict';var monitorFormat={'wav':_0xc04c('0x0'),'wav49':_0xc04c('0x1'),'gsm':_0xc04c('0x2')};var strategy={'fewestcalls':_0xc04c('0x3'),'leastrecent':'leastrecent','linear':_0xc04c('0x4'),'random':'random','ringall':'ringall','rr':_0xc04c('0x5'),'rrmemory':_0xc04c('0x6'),'rrordered':_0xc04c('0x7'),'wrandom':_0xc04c('0x8')};function VoiceQueue(_0x28d35d){this['id']=_0x28d35d['id']||0x0;this[_0xc04c('0x9')]=_0x28d35d[_0xc04c('0x9')]||'';this['monitor_format']=_0x28d35d[_0xc04c('0xa')]||'';this[_0xc04c('0xb')]=_0x28d35d[_0xc04c('0xb')]||_0xc04c('0xc');this[_0xc04c('0xd')]=0x0;this[_0xc04c('0xe')]=0x0;this[_0xc04c('0xf')]=0x0;this[_0xc04c('0x10')]=0x0;this['sumHoldTime']=0x0;this['sumBillable']=0x0;this[_0xc04c('0x11')]=0x0;this[_0xc04c('0x12')]=0x0;this[_0xc04c('0x13')]=0x0;this[_0xc04c('0x14')]=0x0;this[_0xc04c('0x15')]=0x0;this[_0xc04c('0x16')]=0x0;this[_0xc04c('0x17')]=0x0;this['notInUse']=0x0;this['onHold']=0x0;this[_0xc04c('0x18')]=0x0;this['ringing']=0x0;this[_0xc04c('0x19')]=0x0;this[_0xc04c('0x1a')]=0x0;this[_0xc04c('0x1b')]=0x0;this[_0xc04c('0x1c')]=0x0;this['acw']=_0x28d35d[_0xc04c('0x1d')]||![];this[_0xc04c('0x1e')]=_0x28d35d[_0xc04c('0x1e')]||0xa;this[_0xc04c('0x1f')]=_0x28d35d['autopause']||'no';this['sendMessageOneNotActive']=!![];this['message']='';this[_0xc04c('0x20')]='';this[_0xc04c('0x21')]=0x0;this['temp']=0x0;this[_0xc04c('0x22')]=_0x28d35d['dialTimezone']||null;this[_0xc04c('0x23')]=_0x28d35d[_0xc04c('0x23')]?_0x28d35d['dialGlobalInterval']:null;this[_0xc04c('0x24')]=_0x28d35d[_0xc04c('0x24')];this[_0xc04c('0x25')]=_0x28d35d[_0xc04c('0x25')]||_0xc04c('0x26');this[_0xc04c('0x27')]=_0x28d35d[_0xc04c('0x27')]||0x0;this[_0xc04c('0x28')]=_0x28d35d[_0xc04c('0x28')]||0x0;this[_0xc04c('0x29')]=_0x28d35d[_0xc04c('0x29')]||0x1;this['dialPredictiveOptimization']=_0x28d35d[_0xc04c('0x2a')]||_0xc04c('0x2b');this[_0xc04c('0x2c')]=_0x28d35d[_0xc04c('0x2c')]||0.03;this[_0xc04c('0x2d')]=_0x28d35d[_0xc04c('0x2d')]||0x258;this[_0xc04c('0x2e')]=_0x28d35d[_0xc04c('0x2e')]||_0xc04c('0x2f');this[_0xc04c('0x30')]=_0x28d35d['dialOriginateCallerIdNumber']||_0xc04c('0x2f');this['dialOriginateTimeout']=_0x28d35d[_0xc04c('0x31')]||0x1e;this[_0xc04c('0x32')]=_0x28d35d[_0xc04c('0x32')]||_0xc04c('0x33');this[_0xc04c('0x34')]=_0x28d35d['dialQueueTimeout']||0x3;this[_0xc04c('0x35')]=_0x28d35d[_0xc04c('0x35')]||undefined;this[_0xc04c('0x36')]=_0x28d35d[_0xc04c('0x36')]||0x3;this[_0xc04c('0x37')]=_0x28d35d['dialCongestionRetryFrequency']||0x96;this[_0xc04c('0x38')]=_0x28d35d[_0xc04c('0x38')]||0x3;this[_0xc04c('0x39')]=_0x28d35d['dialBusyRetryFrequency']||0x96;this[_0xc04c('0x3a')]=_0x28d35d['dialNoAnswerMaxRetry']||0x3;this[_0xc04c('0x3b')]=_0x28d35d[_0xc04c('0x3b')]||0x96;this[_0xc04c('0x3c')]=_0x28d35d['dialNoSuchNumberMaxRetry']||0x3;this[_0xc04c('0x3d')]=_0x28d35d['dialNoSuchNumberRetryFrequency']||0x96;this[_0xc04c('0x3e')]=_0x28d35d[_0xc04c('0x3e')]||0x3;this[_0xc04c('0x3f')]=_0x28d35d[_0xc04c('0x3f')]||0x96;this[_0xc04c('0x40')]=_0x28d35d['dialAbandonedMaxRetry']||0x3;this[_0xc04c('0x41')]=_0x28d35d['dialAbandonedRetryFrequency']||0x96;this[_0xc04c('0x42')]=_0x28d35d['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x28d35d['dialMachineRetryFrequency']||0x96;this[_0xc04c('0x43')]=_0x28d35d[_0xc04c('0x43')]||0x3;this['dialAgentRejectRetryFrequency']=_0x28d35d['dialAgentRejectRetryFrequency']||0x96;this[_0xc04c('0x44')]=_0x28d35d[_0xc04c('0x44')]||0x3;this[_0xc04c('0x45')]=_0x28d35d[_0xc04c('0x45')]||0x4;this['Trunk']=_0x28d35d[_0xc04c('0x46')]?_0x28d35d[_0xc04c('0x46')]:undefined;this[_0xc04c('0x47')]=_0x28d35d[_0xc04c('0x47')]?_0x28d35d[_0xc04c('0x47')]:undefined;this[_0xc04c('0x48')]=_0x28d35d[_0xc04c('0x48')]||undefined;this[_0xc04c('0x49')]=_0x28d35d[_0xc04c('0x49')]?_0x28d35d['Interval']:undefined;this[_0xc04c('0x4a')]=_0x28d35d[_0xc04c('0x4a')]||_0xc04c('0x4b');this[_0xc04c('0x4c')]=_0x28d35d[_0xc04c('0x4c')]||undefined;this[_0xc04c('0x4d')]=_0x28d35d['dialCutDigit']||undefined;this[_0xc04c('0x4e')]=strategy[_0x28d35d['strategy']];this['queueStatusComplete']=!![];this['dialAMDActive']=_0x28d35d[_0xc04c('0x4f')]||![];this[_0xc04c('0x50')]=_0x28d35d[_0xc04c('0x50')];this[_0xc04c('0x51')]=_0x28d35d[_0xc04c('0x51')];this[_0xc04c('0x52')]=_0x28d35d[_0xc04c('0x52')];this[_0xc04c('0x53')]=_0x28d35d['dialAMDTotalAnalysisTime'];this[_0xc04c('0x54')]=_0x28d35d[_0xc04c('0x54')];this['dialAMDBetweenWordsSilence']=_0x28d35d[_0xc04c('0x55')];this[_0xc04c('0x56')]=_0x28d35d[_0xc04c('0x56')];this[_0xc04c('0x57')]=_0x28d35d[_0xc04c('0x57')];this[_0xc04c('0x58')]=_0x28d35d[_0xc04c('0x58')];this[_0xc04c('0x59')]=0x0;this['pTalking']=0x0;this[_0xc04c('0x5a')]=_0x28d35d['timeout'];this[_0xc04c('0x5b')]=0x0;this[_0xc04c('0x5c')]=0x0;this[_0xc04c('0x5d')]=0x0;this[_0xc04c('0x5e')]=0x0;this[_0xc04c('0x5f')]=0x0;this[_0xc04c('0x60')]=0x0;this[_0xc04c('0x61')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0xc04c('0x62')]=0x0;this[_0xc04c('0x63')]=0x0;this[_0xc04c('0x64')]=0x0;this[_0xc04c('0x65')]=0x0;this[_0xc04c('0x66')]=0x0;this[_0xc04c('0x67')]=0x0;this[_0xc04c('0x68')]=undefined;this[_0xc04c('0x69')]=undefined;this[_0xc04c('0x6a')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0xc04c('0x6b')]=0x0;this[_0xc04c('0x6c')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0xc04c('0x6d')]=0x0;this[_0xc04c('0x6e')]=0x0;this[_0xc04c('0x6f')]=0x0;this[_0xc04c('0x70')]=0x0;this[_0xc04c('0x71')]=0x0;this[_0xc04c('0x72')]=_0x28d35d[_0xc04c('0x73')]||0x14;this['predictiveIntervalMinThreshold']=_0x28d35d[_0xc04c('0x73')]||0xa;this[_0xc04c('0x74')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0xc04c('0x75')]=0x1;this[_0xc04c('0x76')]=0x0;this[_0xc04c('0x77')]=0x0;this[_0xc04c('0x78')]=0x0;this['erlangBusyFactor']=0x0;this['dialRecallMeTimeout']=_0x28d35d['dialRecallMeTimeout']||0x1e;this['dialRecallInQueue']=_0x28d35d['dialRecallInQueue']||![];this[_0xc04c('0x79')]=!!_0x28d35d[_0xc04c('0x79')]||![];this['dialPreviewRecallmeReminder']=!!_0x28d35d[_0xc04c('0x7a')]||![];this[_0xc04c('0x7b')]=_0x28d35d[_0xc04c('0x7b')]||undefined;this[_0xc04c('0x7c')]=_0x28d35d[_0xc04c('0x7c')]||![];this['dialAgiAfterHangupAgent']=_0x28d35d['dialAgiAfterHangupAgent']||![];this[_0xc04c('0xa')]=monitorFormat[_0x28d35d[_0xc04c('0xa')]]?monitorFormat[_0x28d35d[_0xc04c('0xa')]]:undefined;this[_0xc04c('0x7d')]=_0x28d35d[_0xc04c('0x7d')]||![];this['mandatoryDispositionPause']=_0x28d35d[_0xc04c('0x7e')]?_0x28d35d[_0xc04c('0x7e')]:undefined;this[_0xc04c('0x7f')]=![];}module[_0xc04c('0x80')]=VoiceQueue; \ No newline at end of file +var _0x869e=['dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','wav','wav49','gsm','leastrecent','linear','random','ringall','roundrobin','rrordered','wrandom','name','monitor_format','type','inbound','waiting','total','answered','sumDuration','unmanaged','abandoned','available','busy','loggedIn','onHold','paused','ringInUse','talking','unavailable','unknown','acw','autopause','sendMessageOneNotActive','message','statusMessage','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject'];(function(_0x569876,_0x51f913){var _0xa0fab5=function(_0x2083b8){while(--_0x2083b8){_0x569876['push'](_0x569876['shift']());}};_0xa0fab5(++_0x51f913);}(_0x869e,0x15c));var _0xe869=function(_0x2f8cab,_0x4562a2){_0x2f8cab=_0x2f8cab-0x0;var _0x2c6a7f=_0x869e[_0x2f8cab];return _0x2c6a7f;};'use strict';var monitorFormat={'wav':_0xe869('0x0'),'wav49':_0xe869('0x1'),'gsm':_0xe869('0x2')};var strategy={'fewestcalls':'fewestcalls','leastrecent':_0xe869('0x3'),'linear':_0xe869('0x4'),'random':_0xe869('0x5'),'ringall':_0xe869('0x6'),'rr':_0xe869('0x7'),'rrmemory':'rrmemory','rrordered':_0xe869('0x8'),'wrandom':_0xe869('0x9')};function VoiceQueue(_0x26a223){this['id']=_0x26a223['id']||0x0;this[_0xe869('0xa')]=_0x26a223['name']||'';this['monitor_format']=_0x26a223[_0xe869('0xb')]||'';this[_0xe869('0xc')]=_0x26a223[_0xe869('0xc')]||_0xe869('0xd');this[_0xe869('0xe')]=0x0;this[_0xe869('0xf')]=0x0;this[_0xe869('0x10')]=0x0;this[_0xe869('0x11')]=0x0;this['sumHoldTime']=0x0;this['sumBillable']=0x0;this[_0xe869('0x12')]=0x0;this[_0xe869('0x13')]=0x0;this[_0xe869('0x14')]=0x0;this[_0xe869('0x15')]=0x0;this['inUse']=0x0;this['invalid']=0x0;this[_0xe869('0x16')]=0x0;this['notInUse']=0x0;this[_0xe869('0x17')]=0x0;this[_0xe869('0x18')]=0x0;this['ringing']=0x0;this[_0xe869('0x19')]=0x0;this[_0xe869('0x1a')]=0x0;this[_0xe869('0x1b')]=0x0;this[_0xe869('0x1c')]=0x0;this[_0xe869('0x1d')]=_0x26a223['acw']||![];this['acwTimeout']=_0x26a223['acwTimeout']||0xa;this[_0xe869('0x1e')]=_0x26a223['autopause']||'no';this[_0xe869('0x1f')]=!![];this[_0xe869('0x20')]='';this[_0xe869('0x21')]='';this['originated']=0x0;this[_0xe869('0x22')]=0x0;this[_0xe869('0x23')]=_0x26a223['dialTimezone']||null;this[_0xe869('0x24')]=_0x26a223['dialGlobalInterval']?_0x26a223[_0xe869('0x24')]:null;this[_0xe869('0x25')]=_0x26a223['dialActive'];this['dialMethod']=_0x26a223[_0xe869('0x26')]||'progressive';this[_0xe869('0x27')]=_0x26a223[_0xe869('0x27')]||0x0;this[_0xe869('0x28')]=_0x26a223[_0xe869('0x28')]||0x0;this[_0xe869('0x29')]=_0x26a223[_0xe869('0x29')]||0x1;this[_0xe869('0x2a')]=_0x26a223[_0xe869('0x2a')]||_0xe869('0x2b');this[_0xe869('0x2c')]=_0x26a223['dialPredictiveOptimizationPercentage']||0.03;this[_0xe869('0x2d')]=_0x26a223[_0xe869('0x2d')]||0x258;this[_0xe869('0x2e')]=_0x26a223[_0xe869('0x2e')]||_0xe869('0x2f');this['dialOriginateCallerIdNumber']=_0x26a223[_0xe869('0x30')]||_0xe869('0x2f');this[_0xe869('0x31')]=_0x26a223[_0xe869('0x31')]||0x1e;this[_0xe869('0x32')]=_0x26a223[_0xe869('0x32')]||_0xe869('0x33');this[_0xe869('0x34')]=_0x26a223[_0xe869('0x34')]||0x3;this[_0xe869('0x35')]=_0x26a223[_0xe869('0x35')]||undefined;this[_0xe869('0x36')]=_0x26a223[_0xe869('0x36')]||0x3;this['dialCongestionRetryFrequency']=_0x26a223[_0xe869('0x37')]||0x96;this[_0xe869('0x38')]=_0x26a223[_0xe869('0x38')]||0x3;this[_0xe869('0x39')]=_0x26a223[_0xe869('0x39')]||0x96;this[_0xe869('0x3a')]=_0x26a223['dialNoAnswerMaxRetry']||0x3;this[_0xe869('0x3b')]=_0x26a223[_0xe869('0x3b')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x26a223['dialNoSuchNumberMaxRetry']||0x3;this[_0xe869('0x3c')]=_0x26a223['dialNoSuchNumberRetryFrequency']||0x96;this[_0xe869('0x3d')]=_0x26a223['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x26a223[_0xe869('0x3e')]||0x96;this[_0xe869('0x3f')]=_0x26a223[_0xe869('0x3f')]||0x3;this['dialAbandonedRetryFrequency']=_0x26a223[_0xe869('0x40')]||0x96;this['dialMachineMaxRetry']=_0x26a223[_0xe869('0x41')]||0x3;this[_0xe869('0x42')]=_0x26a223[_0xe869('0x42')]||0x96;this[_0xe869('0x43')]=_0x26a223[_0xe869('0x43')]||0x3;this[_0xe869('0x44')]=_0x26a223[_0xe869('0x44')]||0x96;this['callAdditionalPhoneAfterMin']=_0x26a223[_0xe869('0x45')]||0x3;this[_0xe869('0x46')]=_0x26a223[_0xe869('0x46')]||0x4;this['Trunk']=_0x26a223['Trunk']?_0x26a223[_0xe869('0x47')]:undefined;this['TrunkBackup']=_0x26a223['TrunkBackup']?_0x26a223[_0xe869('0x48')]:undefined;this[_0xe869('0x49')]=_0x26a223['dialPrefix']||undefined;this[_0xe869('0x4a')]=_0x26a223[_0xe869('0x4a')]?_0x26a223[_0xe869('0x4a')]:undefined;this[_0xe869('0x4b')]=_0x26a223['dialOrderByScheduledAt']||_0xe869('0x4c');this[_0xe869('0x4d')]=_0x26a223[_0xe869('0x4d')]||undefined;this['dialCutDigit']=_0x26a223[_0xe869('0x4e')]||undefined;this[_0xe869('0x4f')]=strategy[_0x26a223['strategy']];this[_0xe869('0x50')]=!![];this[_0xe869('0x51')]=_0x26a223['dialAMDActive']||![];this[_0xe869('0x52')]=_0x26a223['dialAMDInitialSilence'];this[_0xe869('0x53')]=_0x26a223[_0xe869('0x53')];this['dialAMDAfterGreetingSilence']=_0x26a223[_0xe869('0x54')];this[_0xe869('0x55')]=_0x26a223[_0xe869('0x55')];this[_0xe869('0x56')]=_0x26a223[_0xe869('0x56')];this['dialAMDBetweenWordsSilence']=_0x26a223[_0xe869('0x57')];this[_0xe869('0x58')]=_0x26a223[_0xe869('0x58')];this['dialAMDSilenceThreshold']=_0x26a223[_0xe869('0x59')];this[_0xe869('0x5a')]=_0x26a223[_0xe869('0x5a')];this[_0xe869('0x5b')]=0x0;this[_0xe869('0x5c')]=0x0;this[_0xe869('0x5d')]=_0x26a223['timeout'];this[_0xe869('0x5e')]=0x0;this[_0xe869('0x5f')]=0x0;this[_0xe869('0x60')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0xe869('0x61')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0xe869('0x62')]=0x0;this[_0xe869('0x63')]=0x0;this[_0xe869('0x64')]=0x0;this[_0xe869('0x65')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0xe869('0x66')]=0x0;this[_0xe869('0x67')]=0x0;this['outboundAbandonedDay']=0x0;this[_0xe869('0x68')]=undefined;this[_0xe869('0x69')]=undefined;this[_0xe869('0x6a')]=undefined;this[_0xe869('0x6b')]=1.05;this[_0xe869('0x6c')]=0x0;this[_0xe869('0x6d')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0xe869('0x6e')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0xe869('0x6f')]=0x0;this[_0xe869('0x70')]=0x0;this[_0xe869('0x71')]=0x0;this[_0xe869('0x72')]=_0x26a223[_0xe869('0x73')]||0x14;this[_0xe869('0x74')]=_0x26a223[_0xe869('0x73')]||0xa;this[_0xe869('0x75')]=0x0;this[_0xe869('0x76')]=0x0;this[_0xe869('0x77')]=0x1;this[_0xe869('0x78')]=0x0;this[_0xe869('0x79')]=0x0;this[_0xe869('0x7a')]=0x0;this[_0xe869('0x7b')]=0x0;this['dialRecallMeTimeout']=_0x26a223[_0xe869('0x7c')]||0x1e;this[_0xe869('0x7d')]=_0x26a223['dialRecallInQueue']||![];this[_0xe869('0x7e')]=!!_0x26a223['dialPreviewAutoRecallMe']||![];this[_0xe869('0x7f')]=!!_0x26a223[_0xe869('0x7f')]||![];this[_0xe869('0x80')]=_0x26a223[_0xe869('0x80')]||undefined;this[_0xe869('0x81')]=_0x26a223[_0xe869('0x81')]||![];this[_0xe869('0x82')]=_0x26a223[_0xe869('0x82')]||![];this[_0xe869('0xb')]=monitorFormat[_0x26a223[_0xe869('0xb')]]?monitorFormat[_0x26a223['monitor_format']]:undefined;this[_0xe869('0x83')]=_0x26a223[_0xe869('0x83')]||![];this[_0xe869('0x84')]=_0x26a223[_0xe869('0x84')]?_0x26a223[_0xe869('0x84')]:undefined;this[_0xe869('0x85')]=![];}module['exports']=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index 495ea8a..b2ce993 100644 --- a/server/services/ami/model/voiceQueueSummary.js +++ b/server/services/ami/model/voiceQueueSummary.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9a22=['predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','prototype','createReport','callers','SIP/','incall','includes','status','booked','keys','length','queue','dialer','exten','updateReportFromOutboundQueue','preview','exports','available','loggedIn','loggedInDb','paused','ringing','talking','waiting','inUse','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','pTalking','sumDuration','total','name','strategy','abandoned','answered','busy','invalid','onHold','notInUse','ringInUse','sumBillable','sumHoldTime','type','unavailable','unknown','unmanaged','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundReCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor'];(function(_0x437db1,_0x284aa2){var _0x106945=function(_0x51b942){while(--_0x51b942){_0x437db1['push'](_0x437db1['shift']());}};_0x106945(++_0x284aa2);}(_0x9a22,0x75));var _0x29a2=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0x9a22[_0x38a7ac];return _0x53061a;};'use strict';var INBOUND_COUNTERS=[_0x29a2('0x0'),_0x29a2('0x1'),_0x29a2('0x2'),_0x29a2('0x3'),_0x29a2('0x4'),_0x29a2('0x5'),_0x29a2('0x6')];var OUTBOUND_COUNTERS=['available','answered',_0x29a2('0x7'),_0x29a2('0x1'),_0x29a2('0x2'),_0x29a2('0x8'),_0x29a2('0x9'),_0x29a2('0xa'),_0x29a2('0xb'),_0x29a2('0xc'),'outboundCongestionCallsDay',_0x29a2('0xd'),_0x29a2('0xe'),'outboundReCallsDay',_0x29a2('0xf'),_0x29a2('0x10'),'paused',_0x29a2('0x11'),_0x29a2('0x5'),'sumBillable',_0x29a2('0x12'),_0x29a2('0x13'),_0x29a2('0x6')];function VoiceQueueSummary(_0x1cd604){this['id']=_0x1cd604['id'];this[_0x29a2('0x14')]=_0x1cd604[_0x29a2('0x14')];this['strategy']=_0x1cd604[_0x29a2('0x15')];this[_0x29a2('0x16')]=_0x1cd604[_0x29a2('0x16')]||0x0;this[_0x29a2('0x17')]=_0x1cd604[_0x29a2('0x17')]||0x0;this[_0x29a2('0x0')]=_0x1cd604[_0x29a2('0x0')]||0x0;this['busy']=_0x1cd604[_0x29a2('0x18')]||0x0;this[_0x29a2('0x7')]=_0x1cd604[_0x29a2('0x7')]||0x0;this[_0x29a2('0x19')]=_0x1cd604['invalid']||0x0;this['loggedIn']=_0x1cd604[_0x29a2('0x1')]||0x0;this[_0x29a2('0x2')]=_0x1cd604[_0x29a2('0x2')]||0x0;this[_0x29a2('0x1a')]=_0x1cd604[_0x29a2('0x1a')]||0x0;this['notInUse']=_0x1cd604[_0x29a2('0x1b')]||0x0;this[_0x29a2('0x3')]=_0x1cd604['paused']||0x0;this[_0x29a2('0x4')]=_0x1cd604['ringing']||0x0;this[_0x29a2('0x1c')]=_0x1cd604[_0x29a2('0x1c')];this[_0x29a2('0x1d')]=_0x1cd604[_0x29a2('0x1d')];this['sumDuration']=_0x1cd604['sumDuration'];this['sumHoldTime']=_0x1cd604[_0x29a2('0x1e')]||0x0;this[_0x29a2('0x5')]=_0x1cd604[_0x29a2('0x5')]||0x0;this[_0x29a2('0x13')]=_0x1cd604[_0x29a2('0x13')]||0x0;this[_0x29a2('0x1f')]=_0x1cd604[_0x29a2('0x1f')];this['unavailable']=_0x1cd604[_0x29a2('0x20')]||0x0;this[_0x29a2('0x21')]=_0x1cd604[_0x29a2('0x21')]||0x0;this[_0x29a2('0x22')]=_0x1cd604[_0x29a2('0x22')]||0x0;this[_0x29a2('0x6')]=_0x1cd604[_0x29a2('0x6')]||0x0;if(_0x1cd604[_0x29a2('0x1f')]==='outbound'){this['pTalking']=_0x1cd604[_0x29a2('0x11')]||0x0;this[_0x29a2('0x23')]=_0x1cd604[_0x29a2('0x23')];this[_0x29a2('0x24')]=_0x1cd604[_0x29a2('0x24')];this[_0x29a2('0x25')]=_0x1cd604[_0x29a2('0x25')];this[_0x29a2('0x26')]=_0x1cd604[_0x29a2('0x26')];this[_0x29a2('0x27')]=_0x1cd604[_0x29a2('0x27')];this[_0x29a2('0x28')]=_0x1cd604[_0x29a2('0x28')];this['temp']=_0x1cd604[_0x29a2('0x29')];this[_0x29a2('0x2a')]=_0x1cd604[_0x29a2('0x2a')];this[_0x29a2('0xa')]=_0x1cd604['outboundAnswerCallsDay'];this['outboundBlacklistCallsDay']=_0x1cd604[_0x29a2('0xb')];this[_0x29a2('0xc')]=_0x1cd604['outboundBusyCallsDay'];this[_0x29a2('0x2b')]=_0x1cd604['outboundCongestionCallsDay'];this[_0x29a2('0x2c')]=_0x1cd604['outboundDropCallsDayACS'];this[_0x29a2('0x2d')]=_0x1cd604['outboundDropCallsDayCallersExit'];this[_0x29a2('0x2e')]=_0x1cd604[_0x29a2('0x2e')];this[_0x29a2('0xd')]=_0x1cd604['outboundNoAnswerCallsDay'];this[_0x29a2('0xe')]=_0x1cd604[_0x29a2('0xe')];this[_0x29a2('0x2f')]=_0x1cd604['outboundOriginateFailureCallsDay'];this[_0x29a2('0x30')]=_0x1cd604[_0x29a2('0x30')];this[_0x29a2('0xf')]=_0x1cd604['outboundRejectCallsDay'];this['outboundUnknownCallsDay']=_0x1cd604['outboundUnknownCallsDay'];this['predictiveIntervalAnsweredCalls']=_0x1cd604[_0x29a2('0x31')];this[_0x29a2('0x32')]=_0x1cd604[_0x29a2('0x32')];this[_0x29a2('0x33')]=_0x1cd604[_0x29a2('0x33')];this[_0x29a2('0x34')]=_0x1cd604[_0x29a2('0x34')];this['predictiveIntervalDroppedCallsTimeout']=_0x1cd604[_0x29a2('0x35')];this[_0x29a2('0x36')]=_0x1cd604['predictiveIntervalErlangCalls'];this['predictiveIntervalErlangCallsDroppedCalls']=_0x1cd604['predictiveIntervalErlangCallsDroppedCalls'];this[_0x29a2('0x37')]=_0x1cd604[_0x29a2('0x37')];this[_0x29a2('0x38')]=_0x1cd604['predictiveIntervalMultiplicativeFactor'];this[_0x29a2('0x39')]=_0x1cd604[_0x29a2('0x39')];this[_0x29a2('0x3a')]=_0x1cd604['predictiveIntervalAvailable'];this[_0x29a2('0x3b')]=_0x1cd604[_0x29a2('0x3b')];this['originated']=_0x1cd604[_0x29a2('0x8')];this['erlangCalls']=_0x1cd604[_0x29a2('0x3c')];this[_0x29a2('0x3d')]=_0x1cd604[_0x29a2('0x3d')];this[_0x29a2('0x3e')]=_0x1cd604[_0x29a2('0x3e')];this[_0x29a2('0x3f')]=_0x1cd604[_0x29a2('0x3f')];this[_0x29a2('0x40')]=_0x1cd604['startPredictive'];this[_0x29a2('0x41')]=_0x1cd604[_0x29a2('0x41')];this['message']=_0x1cd604[_0x29a2('0x42')];this[_0x29a2('0x43')]=_0x1cd604[_0x29a2('0x43')];}if(_0x1cd604['Trunk']){this[_0x29a2('0x44')]={'id':_0x1cd604[_0x29a2('0x44')]['id'],'name':_0x1cd604[_0x29a2('0x44')]['name'],'active':_0x1cd604['Trunk'][_0x29a2('0x45')],'callerid':_0x1cd604[_0x29a2('0x44')][_0x29a2('0x46')]};}}VoiceQueueSummary[_0x29a2('0x47')][_0x29a2('0x48')]=function(_0x1f5e32,_0x329b50,_0x4d38df,_0x51382e){this[_0x29a2('0x2')]=0x0;this[_0x29a2('0x5')]=0x0;this[_0x29a2('0x3')]=0x0;this['unknown']=0x0;this['notInUse']=0x0;this[_0x29a2('0x7')]=0x0;this[_0x29a2('0x18')]=0x0;this['invalid']=0x0;this['unavailable']=0x0;this['ringing']=0x0;this[_0x29a2('0x1c')]=0x0;this[_0x29a2('0x1a')]=0x0;if(_0x4d38df){if(_0x4d38df[_0x29a2('0x0')]){this['available']=Number(_0x4d38df[_0x29a2('0x0')]);}if(_0x4d38df['loggedin']){this[_0x29a2('0x1')]=Number(_0x4d38df['loggedin']);}if(_0x4d38df[_0x29a2('0x49')]){this[_0x29a2('0x6')]=Number(_0x4d38df[_0x29a2('0x49')]);}}for(var _0x4d6976=0x0;_0x4d6976<_0x1f5e32['length'];_0x4d6976++){var _0x652255=_0x329b50[_0x29a2('0x4a')+_0x1f5e32[_0x4d6976][_0x29a2('0x14')]];if(_0x652255&&_0x652255['online']){this[_0x29a2('0x2')]+=0x1;}if(_0x1f5e32[_0x4d6976][_0x29a2('0x4b')]==='1'){this[_0x29a2('0x5')]+=0x1;}if(_0x1f5e32[_0x4d6976][_0x29a2('0x3')]==='1'&&!['2','7','8'][_0x29a2('0x4c')](_0x1f5e32[_0x4d6976][_0x29a2('0x4d')])){this[_0x29a2('0x3')]+=0x1;}switch(_0x1f5e32[_0x4d6976][_0x29a2('0x4d')]){case'0':this['unknown']+=0x1;break;case'1':this['notInUse']+=0x1;break;case'2':this[_0x29a2('0x7')]+=0x1;break;case'3':this[_0x29a2('0x18')]+=0x1;break;case'4':this[_0x29a2('0x19')]+=0x1;break;case'5':this[_0x29a2('0x20')]+=0x1;break;case'6':this['ringing']+=0x1;break;case'7':this['ringInUse']+=0x1;break;case'8':this[_0x29a2('0x1a')]+=0x1;break;}}if(this[_0x29a2('0x24')]===_0x29a2('0x4e')){var _0x1563a0=Object[_0x29a2('0x4f')](_0x51382e);for(var _0x3e40cc=0x0;_0x3e40cc<_0x1563a0[_0x29a2('0x50')];_0x3e40cc++){var _0x421d70=_0x1563a0[_0x3e40cc];var _0x3da968=_0x51382e[_0x421d70];if(_0x3da968[_0x29a2('0x51')]===this[_0x29a2('0x14')]&&_0x3da968['type']===_0x29a2('0x52')&&_0x3da968[_0x29a2('0x53')]==='xcally-motion-preview'){this[_0x29a2('0x5')]+=0x1;}}if(this['talking']>this['inUse']){this['talking']=this[_0x29a2('0x7')];}this[_0x29a2('0x11')]=0x0;}return this;};VoiceQueueSummary[_0x29a2('0x47')]['compareToInboundQueue']=function(_0x151ad5){var _0x4c1807=![];if(_0x151ad5){_0x4c1807=INBOUND_COUNTERS['some'](function(_0x22dbce){return this[_0x22dbce]!==_0x151ad5[_0x22dbce];},this);}return _0x4c1807;};VoiceQueueSummary['prototype']['compareToOutboundQueue']=function(_0x10610a){var _0x21dd26=![];var _0x19072d=![];var _0xd33bbb=![];if(_0x10610a){_0x21dd26=this[_0x29a2('0x24')]!==_0x10610a['dialMethod']||this[_0x29a2('0x23')]!==_0x10610a[_0x29a2('0x23')]||this['message']!==_0x10610a[_0x29a2('0x42')]||this[_0x29a2('0x43')]!==_0x10610a[_0x29a2('0x43')];_0x19072d=OUTBOUND_COUNTERS['some'](function(_0x1a1ffa){return this[_0x1a1ffa]!==_0x10610a[_0x1a1ffa];},this);if(this['Trunk']&&_0x10610a[_0x29a2('0x44')]){_0xd33bbb=this[_0x29a2('0x44')]['name']!==_0x10610a[_0x29a2('0x44')][_0x29a2('0x14')]||this[_0x29a2('0x44')]['active']!==_0x10610a[_0x29a2('0x44')][_0x29a2('0x45')];}}return _0x21dd26||_0x19072d||_0xd33bbb;};VoiceQueueSummary['prototype'][_0x29a2('0x54')]=function(_0x774fc5){this[_0x29a2('0x17')]=_0x774fc5[_0x29a2('0x17')];this[_0x29a2('0x42')]=_0x774fc5[_0x29a2('0x42')];this[_0x29a2('0x43')]=_0x774fc5['statusMessage'];this[_0x29a2('0x8')]=_0x774fc5[_0x29a2('0x8')];this['outboundAbandonedCallsDay']=_0x774fc5[_0x29a2('0x9')];this['outboundAnswerCallsDay']=_0x774fc5[_0x29a2('0xa')];this[_0x29a2('0xb')]=_0x774fc5['outboundBlacklistCallsDay'];this['outboundBusyCallsDay']=_0x774fc5['outboundBusyCallsDay'];this[_0x29a2('0x2b')]=_0x774fc5[_0x29a2('0x2b')];this[_0x29a2('0xd')]=_0x774fc5[_0x29a2('0xd')];this['outboundNoSuchCallsDay']=_0x774fc5['outboundNoSuchCallsDay'];this[_0x29a2('0x30')]=_0x774fc5[_0x29a2('0x30')];this[_0x29a2('0xf')]=_0x774fc5['outboundRejectCallsDay'];this[_0x29a2('0x10')]=_0x774fc5[_0x29a2('0x10')];this[_0x29a2('0x1d')]=_0x774fc5[_0x29a2('0x1d')];this[_0x29a2('0x12')]=_0x774fc5['sumDuration'];this[_0x29a2('0x13')]=_0x774fc5[_0x29a2('0x13')];if(this[_0x29a2('0x24')]===_0x29a2('0x55')){this[_0x29a2('0x11')]=_0x774fc5[_0x29a2('0x11')];}};module[_0x29a2('0x56')]=VoiceQueueSummary; \ No newline at end of file +var _0xf611=['predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','message','statusMessage','Trunk','active','prototype','createReport','loggedin','callers','length','incall','status','booked','keys','queue','dialer','exten','xcally-motion-preview','some','compareToOutboundQueue','updateReportFromOutboundQueue','preview','exports','loggedIn','loggedInDb','paused','available','inUse','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundUnknownCallsDay','sumBillable','sumDuration','total','waiting','name','strategy','abandoned','answered','busy','invalid','onHold','notInUse','ringing','ringInUse','sumHoldTime','talking','type','unavailable','unknown','unmanaged','pTalking','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout'];(function(_0x168b0e,_0x2e94f5){var _0x4c1b41=function(_0x574475){while(--_0x574475){_0x168b0e['push'](_0x168b0e['shift']());}};_0x4c1b41(++_0x2e94f5);}(_0xf611,0x7b));var _0x1f61=function(_0x5e9888,_0x3abe60){_0x5e9888=_0x5e9888-0x0;var _0x2c8a6c=_0xf611[_0x5e9888];return _0x2c8a6c;};'use strict';var INBOUND_COUNTERS=['available',_0x1f61('0x0'),_0x1f61('0x1'),_0x1f61('0x2'),'ringing','talking','waiting'];var OUTBOUND_COUNTERS=[_0x1f61('0x3'),'answered',_0x1f61('0x4'),_0x1f61('0x0'),'loggedInDb','originated',_0x1f61('0x5'),_0x1f61('0x6'),_0x1f61('0x7'),_0x1f61('0x8'),'outboundCongestionCallsDay',_0x1f61('0x9'),_0x1f61('0xa'),_0x1f61('0xb'),'outboundRejectCallsDay',_0x1f61('0xc'),_0x1f61('0x2'),'pTalking','talking',_0x1f61('0xd'),_0x1f61('0xe'),_0x1f61('0xf'),_0x1f61('0x10')];function VoiceQueueSummary(_0x4329cf){this['id']=_0x4329cf['id'];this[_0x1f61('0x11')]=_0x4329cf[_0x1f61('0x11')];this[_0x1f61('0x12')]=_0x4329cf['strategy'];this[_0x1f61('0x13')]=_0x4329cf[_0x1f61('0x13')]||0x0;this[_0x1f61('0x14')]=_0x4329cf[_0x1f61('0x14')]||0x0;this[_0x1f61('0x3')]=_0x4329cf[_0x1f61('0x3')]||0x0;this[_0x1f61('0x15')]=_0x4329cf[_0x1f61('0x15')]||0x0;this[_0x1f61('0x4')]=_0x4329cf[_0x1f61('0x4')]||0x0;this[_0x1f61('0x16')]=_0x4329cf[_0x1f61('0x16')]||0x0;this[_0x1f61('0x0')]=_0x4329cf[_0x1f61('0x0')]||0x0;this[_0x1f61('0x1')]=_0x4329cf[_0x1f61('0x1')]||0x0;this[_0x1f61('0x17')]=_0x4329cf[_0x1f61('0x17')]||0x0;this[_0x1f61('0x18')]=_0x4329cf[_0x1f61('0x18')]||0x0;this[_0x1f61('0x2')]=_0x4329cf['paused']||0x0;this[_0x1f61('0x19')]=_0x4329cf[_0x1f61('0x19')]||0x0;this[_0x1f61('0x1a')]=_0x4329cf['ringInUse'];this[_0x1f61('0xd')]=_0x4329cf[_0x1f61('0xd')];this[_0x1f61('0xe')]=_0x4329cf[_0x1f61('0xe')];this[_0x1f61('0x1b')]=_0x4329cf[_0x1f61('0x1b')]||0x0;this[_0x1f61('0x1c')]=_0x4329cf[_0x1f61('0x1c')]||0x0;this[_0x1f61('0xf')]=_0x4329cf[_0x1f61('0xf')]||0x0;this['type']=_0x4329cf[_0x1f61('0x1d')];this['unavailable']=_0x4329cf[_0x1f61('0x1e')]||0x0;this['unknown']=_0x4329cf[_0x1f61('0x1f')]||0x0;this[_0x1f61('0x20')]=_0x4329cf[_0x1f61('0x20')]||0x0;this[_0x1f61('0x10')]=_0x4329cf['waiting']||0x0;if(_0x4329cf[_0x1f61('0x1d')]==='outbound'){this[_0x1f61('0x21')]=_0x4329cf[_0x1f61('0x21')]||0x0;this['dialActive']=_0x4329cf[_0x1f61('0x22')];this['dialMethod']=_0x4329cf[_0x1f61('0x23')];this[_0x1f61('0x24')]=_0x4329cf[_0x1f61('0x24')];this[_0x1f61('0x25')]=_0x4329cf['dialOriginateCallerIdNumber'];this[_0x1f61('0x26')]=_0x4329cf[_0x1f61('0x26')];this[_0x1f61('0x27')]=_0x4329cf[_0x1f61('0x27')];this[_0x1f61('0x28')]=_0x4329cf[_0x1f61('0x28')];this['outboundAnswerAgiCallsDay']=_0x4329cf[_0x1f61('0x29')];this[_0x1f61('0x6')]=_0x4329cf[_0x1f61('0x6')];this[_0x1f61('0x7')]=_0x4329cf['outboundBlacklistCallsDay'];this['outboundBusyCallsDay']=_0x4329cf[_0x1f61('0x8')];this['outboundCongestionCallsDay']=_0x4329cf[_0x1f61('0x2a')];this[_0x1f61('0x2b')]=_0x4329cf[_0x1f61('0x2b')];this[_0x1f61('0x2c')]=_0x4329cf[_0x1f61('0x2c')];this[_0x1f61('0x2d')]=_0x4329cf[_0x1f61('0x2d')];this[_0x1f61('0x9')]=_0x4329cf['outboundNoAnswerCallsDay'];this[_0x1f61('0xa')]=_0x4329cf[_0x1f61('0xa')];this['outboundOriginateFailureCallsDay']=_0x4329cf[_0x1f61('0x2e')];this[_0x1f61('0xb')]=_0x4329cf['outboundReCallsDay'];this['outboundRejectCallsDay']=_0x4329cf[_0x1f61('0x2f')];this[_0x1f61('0xc')]=_0x4329cf['outboundUnknownCallsDay'];this[_0x1f61('0x30')]=_0x4329cf[_0x1f61('0x30')];this[_0x1f61('0x31')]=_0x4329cf['predictiveIntervalAvgHoldtime'];this[_0x1f61('0x32')]=_0x4329cf[_0x1f61('0x32')];this[_0x1f61('0x33')]=_0x4329cf['predictiveIntervalDroppedCallsCallersExit'];this[_0x1f61('0x34')]=_0x4329cf['predictiveIntervalDroppedCallsTimeout'];this[_0x1f61('0x35')]=_0x4329cf['predictiveIntervalErlangCalls'];this['predictiveIntervalErlangCallsDroppedCalls']=_0x4329cf[_0x1f61('0x36')];this[_0x1f61('0x37')]=_0x4329cf['predictiveIntervalHitRate'];this[_0x1f61('0x38')]=_0x4329cf[_0x1f61('0x38')];this['predictiveIntervalPauses']=_0x4329cf[_0x1f61('0x39')];this[_0x1f61('0x3a')]=_0x4329cf[_0x1f61('0x3a')];this[_0x1f61('0x3b')]=_0x4329cf['predictiveIntervalTotalCalls'];this[_0x1f61('0x3c')]=_0x4329cf[_0x1f61('0x3c')];this[_0x1f61('0x3d')]=_0x4329cf[_0x1f61('0x3d')];this[_0x1f61('0x3e')]=_0x4329cf[_0x1f61('0x3e')];this[_0x1f61('0x3f')]=_0x4329cf[_0x1f61('0x3f')];this[_0x1f61('0x40')]=_0x4329cf[_0x1f61('0x40')];this[_0x1f61('0x41')]=_0x4329cf[_0x1f61('0x41')];this['startProgressive']=_0x4329cf['startProgressive'];this[_0x1f61('0x42')]=_0x4329cf[_0x1f61('0x42')];this[_0x1f61('0x43')]=_0x4329cf['statusMessage'];}if(_0x4329cf['Trunk']){this['Trunk']={'id':_0x4329cf[_0x1f61('0x44')]['id'],'name':_0x4329cf[_0x1f61('0x44')][_0x1f61('0x11')],'active':_0x4329cf[_0x1f61('0x44')][_0x1f61('0x45')],'callerid':_0x4329cf[_0x1f61('0x44')]['callerid']};}}VoiceQueueSummary[_0x1f61('0x46')][_0x1f61('0x47')]=function(_0x1292cb,_0x53c4b4,_0x3492c1,_0x31947f){this[_0x1f61('0x1')]=0x0;this[_0x1f61('0x1c')]=0x0;this[_0x1f61('0x2')]=0x0;this[_0x1f61('0x1f')]=0x0;this[_0x1f61('0x18')]=0x0;this[_0x1f61('0x4')]=0x0;this['busy']=0x0;this[_0x1f61('0x16')]=0x0;this[_0x1f61('0x1e')]=0x0;this[_0x1f61('0x19')]=0x0;this[_0x1f61('0x1a')]=0x0;this[_0x1f61('0x17')]=0x0;if(_0x3492c1){if(_0x3492c1[_0x1f61('0x3')]){this[_0x1f61('0x3')]=Number(_0x3492c1[_0x1f61('0x3')]);}if(_0x3492c1[_0x1f61('0x48')]){this[_0x1f61('0x0')]=Number(_0x3492c1[_0x1f61('0x48')]);}if(_0x3492c1[_0x1f61('0x49')]){this[_0x1f61('0x10')]=Number(_0x3492c1['callers']);}}for(var _0x4444e7=0x0;_0x4444e7<_0x1292cb[_0x1f61('0x4a')];_0x4444e7++){var _0x3fd8b7=_0x53c4b4['SIP/'+_0x1292cb[_0x4444e7][_0x1f61('0x11')]];if(_0x3fd8b7&&_0x3fd8b7['online']){this[_0x1f61('0x1')]+=0x1;}if(_0x1292cb[_0x4444e7][_0x1f61('0x4b')]==='1'){this[_0x1f61('0x1c')]+=0x1;}if(_0x1292cb[_0x4444e7][_0x1f61('0x2')]==='1'&&!['2','7','8']['includes'](_0x1292cb[_0x4444e7][_0x1f61('0x4c')])){this['paused']+=0x1;}switch(_0x1292cb[_0x4444e7]['status']){case'0':this[_0x1f61('0x1f')]+=0x1;break;case'1':this[_0x1f61('0x18')]+=0x1;break;case'2':this[_0x1f61('0x4')]+=0x1;break;case'3':this['busy']+=0x1;break;case'4':this[_0x1f61('0x16')]+=0x1;break;case'5':this[_0x1f61('0x1e')]+=0x1;break;case'6':this[_0x1f61('0x19')]+=0x1;break;case'7':this[_0x1f61('0x1a')]+=0x1;break;case'8':this['onHold']+=0x1;break;}}if(this[_0x1f61('0x23')]===_0x1f61('0x4d')){var _0x175499=Object[_0x1f61('0x4e')](_0x31947f);for(var _0x4f0be2=0x0;_0x4f0be2<_0x175499[_0x1f61('0x4a')];_0x4f0be2++){var _0x1fe212=_0x175499[_0x4f0be2];var _0x5ae939=_0x31947f[_0x1fe212];if(_0x5ae939[_0x1f61('0x4f')]===this[_0x1f61('0x11')]&&_0x5ae939[_0x1f61('0x1d')]===_0x1f61('0x50')&&_0x5ae939[_0x1f61('0x51')]===_0x1f61('0x52')){this[_0x1f61('0x1c')]+=0x1;}}if(this[_0x1f61('0x1c')]>this['inUse']){this[_0x1f61('0x1c')]=this[_0x1f61('0x4')];}this[_0x1f61('0x21')]=0x0;}return this;};VoiceQueueSummary['prototype']['compareToInboundQueue']=function(_0x47b503){var _0xf3793=![];if(_0x47b503){_0xf3793=INBOUND_COUNTERS[_0x1f61('0x53')](function(_0x19d162){return this[_0x19d162]!==_0x47b503[_0x19d162];},this);}return _0xf3793;};VoiceQueueSummary['prototype'][_0x1f61('0x54')]=function(_0x801cb5){var _0x2ecbc1=![];var _0x2565bb=![];var _0x1ae84b=![];if(_0x801cb5){_0x2ecbc1=this[_0x1f61('0x23')]!==_0x801cb5[_0x1f61('0x23')]||this['dialActive']!==_0x801cb5[_0x1f61('0x22')]||this[_0x1f61('0x42')]!==_0x801cb5['message']||this['statusMessage']!==_0x801cb5['statusMessage'];_0x2565bb=OUTBOUND_COUNTERS[_0x1f61('0x53')](function(_0x569844){return this[_0x569844]!==_0x801cb5[_0x569844];},this);if(this[_0x1f61('0x44')]&&_0x801cb5[_0x1f61('0x44')]){_0x1ae84b=this[_0x1f61('0x44')][_0x1f61('0x11')]!==_0x801cb5['Trunk'][_0x1f61('0x11')]||this['Trunk'][_0x1f61('0x45')]!==_0x801cb5[_0x1f61('0x44')][_0x1f61('0x45')];}}return _0x2ecbc1||_0x2565bb||_0x1ae84b;};VoiceQueueSummary[_0x1f61('0x46')][_0x1f61('0x55')]=function(_0x499248){this[_0x1f61('0x14')]=_0x499248[_0x1f61('0x14')];this[_0x1f61('0x42')]=_0x499248[_0x1f61('0x42')];this[_0x1f61('0x43')]=_0x499248['statusMessage'];this['originated']=_0x499248[_0x1f61('0x3c')];this['outboundAbandonedCallsDay']=_0x499248[_0x1f61('0x5')];this[_0x1f61('0x6')]=_0x499248[_0x1f61('0x6')];this[_0x1f61('0x7')]=_0x499248['outboundBlacklistCallsDay'];this[_0x1f61('0x8')]=_0x499248[_0x1f61('0x8')];this[_0x1f61('0x2a')]=_0x499248['outboundCongestionCallsDay'];this[_0x1f61('0x9')]=_0x499248['outboundNoAnswerCallsDay'];this[_0x1f61('0xa')]=_0x499248[_0x1f61('0xa')];this[_0x1f61('0xb')]=_0x499248[_0x1f61('0xb')];this[_0x1f61('0x2f')]=_0x499248[_0x1f61('0x2f')];this[_0x1f61('0xc')]=_0x499248[_0x1f61('0xc')];this['sumBillable']=_0x499248[_0x1f61('0xd')];this['sumDuration']=_0x499248[_0x1f61('0xe')];this['total']=_0x499248['total'];if(this['dialMethod']===_0x1f61('0x56')){this[_0x1f61('0x21')]=_0x499248['pTalking'];}};module[_0x1f61('0x57')]=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 62de678..ee52a2a 100644 --- a/server/services/ami/model/vtigerAccount.js +++ b/server/services/ami/model/vtigerAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa14b=['Configurations','exports','name','accessKey','remoteUri','serverUrl'];(function(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0xa14b,0x68));var _0xba14=function(_0x209c44,_0x12eb9b){_0x209c44=_0x209c44-0x0;var _0x1bfb1d=_0xa14b[_0x209c44];return _0x1bfb1d;};'use strict';function VtigerAccount(_0x2b21a0){this['id']=_0x2b21a0['id']||0x0;this[_0xba14('0x0')]=_0x2b21a0[_0xba14('0x0')]||'';this['username']=_0x2b21a0['username']||'';this[_0xba14('0x1')]=_0x2b21a0['accessKey']||'';this[_0xba14('0x2')]=_0x2b21a0['remoteUri']||'';this[_0xba14('0x3')]=_0x2b21a0[_0xba14('0x3')]||'';this[_0xba14('0x4')]=_0x2b21a0[_0xba14('0x4')]||{};}module[_0xba14('0x5')]=VtigerAccount; \ No newline at end of file +var _0x22e4=['name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x2fc122,_0x13d8d1){var _0x4cc6f4=function(_0xce511e){while(--_0xce511e){_0x2fc122['push'](_0x2fc122['shift']());}};_0x4cc6f4(++_0x13d8d1);}(_0x22e4,0x150));var _0x422e=function(_0x49eec4,_0x291d82){_0x49eec4=_0x49eec4-0x0;var _0x5723e7=_0x22e4[_0x49eec4];return _0x5723e7;};'use strict';function VtigerAccount(_0x1524e7){this['id']=_0x1524e7['id']||0x0;this[_0x422e('0x0')]=_0x1524e7[_0x422e('0x0')]||'';this[_0x422e('0x1')]=_0x1524e7[_0x422e('0x1')]||'';this[_0x422e('0x2')]=_0x1524e7[_0x422e('0x2')]||'';this['remoteUri']=_0x1524e7[_0x422e('0x3')]||'';this[_0x422e('0x4')]=_0x1524e7[_0x422e('0x4')]||'';this[_0x422e('0x5')]=_0x1524e7['Configurations']||{};}module['exports']=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index fff85f7..12ce625 100644 --- a/server/services/ami/model/zendeskAccount.js +++ b/server/services/ami/model/zendeskAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x48bb=['authType','type','integrationTab','serverUrl','Configurations','exports','name','username','password','token','remoteUri'];(function(_0x2d89ce,_0x24d58d){var _0x3fad10=function(_0xad0ec){while(--_0xad0ec){_0x2d89ce['push'](_0x2d89ce['shift']());}};_0x3fad10(++_0x24d58d);}(_0x48bb,0xed));var _0xb48b=function(_0x243217,_0x522951){_0x243217=_0x243217-0x0;var _0x478029=_0x48bb[_0x243217];return _0x478029;};'use strict';function ZendeskAccount(_0x2b60a2){this['id']=_0x2b60a2['id']||0x0;this[_0xb48b('0x0')]=_0x2b60a2['name']||'';this[_0xb48b('0x1')]=_0x2b60a2['username']||'';this[_0xb48b('0x2')]=_0x2b60a2['password']||'';this[_0xb48b('0x3')]=_0x2b60a2[_0xb48b('0x3')]||'';this[_0xb48b('0x4')]=_0x2b60a2[_0xb48b('0x4')]||'';this[_0xb48b('0x5')]=_0x2b60a2[_0xb48b('0x5')]||'';this[_0xb48b('0x6')]=_0x2b60a2[_0xb48b('0x6')]||_0xb48b('0x7');this[_0xb48b('0x8')]=_0x2b60a2[_0xb48b('0x8')]||'';this[_0xb48b('0x9')]=_0x2b60a2[_0xb48b('0x9')]||{};}module[_0xb48b('0xa')]=ZendeskAccount; \ No newline at end of file +var _0xd76d=['integrationTab','serverUrl','name','username','password','token','remoteUri','authType','type'];(function(_0x1aa5a1,_0x6415e2){var _0x5f23fc=function(_0x12dbf7){while(--_0x12dbf7){_0x1aa5a1['push'](_0x1aa5a1['shift']());}};_0x5f23fc(++_0x6415e2);}(_0xd76d,0x119));var _0xdd76=function(_0x5ce2e3,_0x3dc503){_0x5ce2e3=_0x5ce2e3-0x0;var _0x3b53ab=_0xd76d[_0x5ce2e3];return _0x3b53ab;};'use strict';function ZendeskAccount(_0x1a0cd3){this['id']=_0x1a0cd3['id']||0x0;this[_0xdd76('0x0')]=_0x1a0cd3[_0xdd76('0x0')]||'';this[_0xdd76('0x1')]=_0x1a0cd3[_0xdd76('0x1')]||'';this[_0xdd76('0x2')]=_0x1a0cd3[_0xdd76('0x2')]||'';this[_0xdd76('0x3')]=_0x1a0cd3['token']||'';this['remoteUri']=_0x1a0cd3[_0xdd76('0x4')]||'';this['authType']=_0x1a0cd3[_0xdd76('0x5')]||'';this[_0xdd76('0x6')]=_0x1a0cd3[_0xdd76('0x6')]||_0xdd76('0x7');this[_0xdd76('0x8')]=_0x1a0cd3[_0xdd76('0x8')]||'';this['Configurations']=_0x1a0cd3['Configurations']||{};}module['exports']=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index b65e5c5..41d49c2 100644 --- a/server/services/ami/model/zohoAccount.js +++ b/server/services/ami/model/zohoAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x12b2=['name','description','host','zone','clientId','clientSecret','serverUrl','code','Configurations','exports'];(function(_0x28e71a,_0x4405bd){var _0x268fed=function(_0x404197){while(--_0x404197){_0x28e71a['push'](_0x28e71a['shift']());}};_0x268fed(++_0x4405bd);}(_0x12b2,0x1d6));var _0x212b=function(_0x48ea27,_0x2b1d54){_0x48ea27=_0x48ea27-0x0;var _0xc63a78=_0x12b2[_0x48ea27];return _0xc63a78;};'use strict';function ZohoAccount(_0x39fb27){this['id']=_0x39fb27['id']||0x0;this['name']=_0x39fb27[_0x212b('0x0')]||'';this[_0x212b('0x1')]=_0x39fb27[_0x212b('0x1')]||'';this[_0x212b('0x2')]=_0x39fb27['host']||'';this[_0x212b('0x3')]=_0x39fb27[_0x212b('0x3')]||'';this['clientId']=_0x39fb27[_0x212b('0x4')]||'';this[_0x212b('0x5')]=_0x39fb27['clientSecret']||'';this[_0x212b('0x6')]=_0x39fb27[_0x212b('0x6')]||'';this[_0x212b('0x7')]=_0x39fb27[_0x212b('0x7')]||'';this['refreshToken']=_0x39fb27['refreshToken']||'';this[_0x212b('0x8')]=_0x39fb27[_0x212b('0x8')]||{};}module[_0x212b('0x9')]=ZohoAccount; \ No newline at end of file +var _0xeaa2=['zone','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description','host'];(function(_0x191651,_0x2b53f0){var _0x1e3a60=function(_0x24df7f){while(--_0x24df7f){_0x191651['push'](_0x191651['shift']());}};_0x1e3a60(++_0x2b53f0);}(_0xeaa2,0x115));var _0x2eaa=function(_0xc5e02a,_0xd9da3c){_0xc5e02a=_0xc5e02a-0x0;var _0xbeca77=_0xeaa2[_0xc5e02a];return _0xbeca77;};'use strict';function ZohoAccount(_0x178a5e){this['id']=_0x178a5e['id']||0x0;this[_0x2eaa('0x0')]=_0x178a5e[_0x2eaa('0x0')]||'';this[_0x2eaa('0x1')]=_0x178a5e[_0x2eaa('0x1')]||'';this[_0x2eaa('0x2')]=_0x178a5e[_0x2eaa('0x2')]||'';this['zone']=_0x178a5e[_0x2eaa('0x3')]||'';this['clientId']=_0x178a5e['clientId']||'';this['clientSecret']=_0x178a5e[_0x2eaa('0x4')]||'';this[_0x2eaa('0x5')]=_0x178a5e[_0x2eaa('0x5')]||'';this[_0x2eaa('0x6')]=_0x178a5e[_0x2eaa('0x6')]||'';this[_0x2eaa('0x7')]=_0x178a5e[_0x2eaa('0x7')]||'';this['Configurations']=_0x178a5e[_0x2eaa('0x8')]||{};}module[_0x2eaa('0x9')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 5fd2c10..5e820dd 100644 --- a/server/services/ami/preview/action.js +++ b/server/services/ami/preview/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x57ca=['name','type','campaigntype','dialAnswer','Agent','membername','format','SIP/%s','calleridname','phone','firstName','Contact','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','exports','lodash','moment','isNil','string','uniqueid','idContact'];(function(_0x324786,_0x47a15a){var _0x172caa=function(_0x43290d){while(--_0x43290d){_0x324786['push'](_0x324786['shift']());}};_0x172caa(++_0x47a15a);}(_0x57ca,0x108));var _0xa57c=function(_0x21bdb9,_0x22ad79){_0x21bdb9=_0x21bdb9-0x0;var _0x49d8d8=_0x57ca[_0x21bdb9];return _0x49d8d8;};'use strict';var util=require('util');var _=require(_0xa57c('0x0'));var moment=require(_0xa57c('0x1'));function checkNameSurname(_0x4b1712,_0x3a7394,_0x396613){var _0x1d38e7='';if(!_[_0xa57c('0x2')](_0x3a7394)&&_0xa57c('0x3')===typeof _0x3a7394){_0x1d38e7+=_0x3a7394;}if(!_['isNil'](_0x396613)&&_0xa57c('0x3')===typeof _0x396613){_0x1d38e7+='\x20'+_0x396613;}if(_0x1d38e7!==''){return _0x1d38e7;}return _0x4b1712;}function Action(_0x1c3e31,_0x113dcf,_0x19473f,_0xbdfffb,_0x314574){this[_0xa57c('0x4')]=_0x19473f||undefined;this[_0xa57c('0x5')]=_0x1c3e31['id'];this['queue']=_0x113dcf[_0xa57c('0x6')];this['type']=_0x113dcf[_0xa57c('0x7')];this[_0xa57c('0x8')]='queue';this[_0xa57c('0x9')]=![];this['membername']=_[_0xa57c('0x2')](_0x1c3e31[_0xa57c('0xa')])?undefined:_0x1c3e31['Agent'][_0xa57c('0x6')];this['channelAgent']=this[_0xa57c('0xb')]?util[_0xa57c('0xc')](_0xa57c('0xd'),this[_0xa57c('0xb')]):_0xbdfffb||undefined;this[_0xa57c('0xe')]=checkNameSurname(_0x1c3e31['Contact'][_0xa57c('0xf')],_0x1c3e31['Contact'][_0xa57c('0x10')],_0x1c3e31[_0xa57c('0x11')][_0xa57c('0x12')]);this[_0xa57c('0x13')]=_0x1c3e31[_0xa57c('0x13')]||![];this[_0xa57c('0x14')]=_0x1c3e31[_0xa57c('0xf')];this['scheduledat']=_0x1c3e31[_0xa57c('0x15')];this[_0xa57c('0x16')]=_0x1c3e31[_0xa57c('0x16')]||0x0;this['countcongestionretry']=_0x1c3e31[_0xa57c('0x17')]||0x0;this['countnoanswerretry']=_0x1c3e31[_0xa57c('0x18')]||0x0;this[_0xa57c('0x19')]=(_0x1c3e31[_0xa57c('0x16')]||0x0)+(_0x1c3e31[_0xa57c('0x17')]||0x0)+(_0x1c3e31[_0xa57c('0x18')]||0x0)+(_0x1c3e31[_0xa57c('0x1a')]||0x0)+(_0x1c3e31[_0xa57c('0x1b')]||0x0)+(_0x1c3e31[_0xa57c('0x1c')]||0x0)+(_0x1c3e31['countmachineretry']||0x0)+(_0x1c3e31[_0xa57c('0x1d')]||0x0);this['countnosuchnumberretry']=_0x1c3e31['countnosuchnumberretry']||0x0;this[_0xa57c('0x1b')]=_0x1c3e31[_0xa57c('0x1b')]||0x0;this[_0xa57c('0x1c')]=_0x1c3e31[_0xa57c('0x1c')]||0x0;this['countmachineretry']=_0x1c3e31[_0xa57c('0x1e')]||0x0;this[_0xa57c('0x1d')]=_0x1c3e31[_0xa57c('0x1d')]||0x0;this[_0xa57c('0x1f')]=_0x1c3e31[_0xa57c('0x1f')];this[_0xa57c('0x20')]=_0x1c3e31[_0xa57c('0x20')];this[_0xa57c('0x21')]=_0x1c3e31[_0xa57c('0x21')];this[_0xa57c('0x22')]=_0x1c3e31[_0xa57c('0x22')];this[_0xa57c('0x23')]=_0x1c3e31[_0xa57c('0x23')];this[_0xa57c('0x24')]=_0x1c3e31[_0xa57c('0x24')];this['UserId']=_[_0xa57c('0x2')](_0x1c3e31[_0xa57c('0xa')])?_0x1c3e31[_0xa57c('0x25')]:_0x1c3e31[_0xa57c('0xa')]['id'];this[_0xa57c('0x26')]=_0x1c3e31[_0xa57c('0x26')];this[_0xa57c('0x27')]='';this[_0xa57c('0x28')]='';}Action[_0xa57c('0x29')][_0xa57c('0x2a')]=function(){return util['format'](_0xa57c('0x2b'),this['calleridname'],this['number']);};module[_0xa57c('0x2c')]=Action; \ No newline at end of file +var _0x5c3c=['prototype','format','\x22%s\x22\x20<%s>','number','exports','util','lodash','moment','isNil','string','idContact','queue','type','dialAnswer','Agent','channelAgent','membername','SIP/%s','calleridname','phone','Contact','firstName','lastName','calleridnum','scheduledat','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum'];(function(_0x687ddc,_0x2092fa){var _0x441991=function(_0x49c6a6){while(--_0x49c6a6){_0x687ddc['push'](_0x687ddc['shift']());}};_0x441991(++_0x2092fa);}(_0x5c3c,0x132));var _0xc5c3=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0x5c3c[_0xe66cf2];return _0x2d84e7;};'use strict';var util=require(_0xc5c3('0x0'));var _=require(_0xc5c3('0x1'));var moment=require(_0xc5c3('0x2'));function checkNameSurname(_0x32103c,_0x4b9233,_0x400726){var _0x3c5552='';if(!_[_0xc5c3('0x3')](_0x4b9233)&&_0xc5c3('0x4')===typeof _0x4b9233){_0x3c5552+=_0x4b9233;}if(!_[_0xc5c3('0x3')](_0x400726)&&_0xc5c3('0x4')===typeof _0x400726){_0x3c5552+='\x20'+_0x400726;}if(_0x3c5552!==''){return _0x3c5552;}return _0x32103c;}function Action(_0xe85098,_0x23a6b5,_0x28bdd9,_0x5a392b,_0x4b8404){this['uniqueid']=_0x28bdd9||undefined;this[_0xc5c3('0x5')]=_0xe85098['id'];this[_0xc5c3('0x6')]=_0x23a6b5['name'];this[_0xc5c3('0x7')]=_0x23a6b5[_0xc5c3('0x7')];this['campaigntype']=_0xc5c3('0x6');this[_0xc5c3('0x8')]=![];this['membername']=_[_0xc5c3('0x3')](_0xe85098[_0xc5c3('0x9')])?undefined:_0xe85098[_0xc5c3('0x9')]['name'];this[_0xc5c3('0xa')]=this[_0xc5c3('0xb')]?util['format'](_0xc5c3('0xc'),this[_0xc5c3('0xb')]):_0x5a392b||undefined;this[_0xc5c3('0xd')]=checkNameSurname(_0xe85098['Contact'][_0xc5c3('0xe')],_0xe85098[_0xc5c3('0xf')][_0xc5c3('0x10')],_0xe85098[_0xc5c3('0xf')][_0xc5c3('0x11')]);this['active']=_0xe85098['active']||![];this[_0xc5c3('0x12')]=_0xe85098[_0xc5c3('0xe')];this[_0xc5c3('0x13')]=_0xe85098[_0xc5c3('0x13')];this['countbusyretry']=_0xe85098['countbusyretry']||0x0;this[_0xc5c3('0x14')]=_0xe85098['countcongestionretry']||0x0;this[_0xc5c3('0x15')]=_0xe85098[_0xc5c3('0x15')]||0x0;this[_0xc5c3('0x16')]=(_0xe85098[_0xc5c3('0x17')]||0x0)+(_0xe85098[_0xc5c3('0x14')]||0x0)+(_0xe85098['countnoanswerretry']||0x0)+(_0xe85098[_0xc5c3('0x18')]||0x0)+(_0xe85098[_0xc5c3('0x19')]||0x0)+(_0xe85098[_0xc5c3('0x1a')]||0x0)+(_0xe85098[_0xc5c3('0x1b')]||0x0)+(_0xe85098['countagentrejectretry']||0x0);this[_0xc5c3('0x18')]=_0xe85098[_0xc5c3('0x18')]||0x0;this[_0xc5c3('0x19')]=_0xe85098[_0xc5c3('0x19')]||0x0;this[_0xc5c3('0x1a')]=_0xe85098['countabandonedretry']||0x0;this[_0xc5c3('0x1b')]=_0xe85098[_0xc5c3('0x1b')]||0x0;this[_0xc5c3('0x1c')]=_0xe85098[_0xc5c3('0x1c')]||0x0;this[_0xc5c3('0x1d')]=_0xe85098[_0xc5c3('0x1d')];this[_0xc5c3('0x1e')]=_0xe85098['callbackuniqueid'];this['callbackat']=_0xe85098[_0xc5c3('0x1f')];this[_0xc5c3('0x20')]=_0xe85098['recallme'];this['ContactId']=_0xe85098[_0xc5c3('0x21')];this[_0xc5c3('0x22')]=_0xe85098[_0xc5c3('0x22')];this['UserId']=_['isNil'](_0xe85098[_0xc5c3('0x9')])?_0xe85098[_0xc5c3('0x23')]:_0xe85098[_0xc5c3('0x9')]['id'];this[_0xc5c3('0x24')]=_0xe85098['VoiceQueueId'];this[_0xc5c3('0x25')]='';this['originatecalleridname']='';}Action[_0xc5c3('0x26')]['getCaller']=function(){return util[_0xc5c3('0x27')](_0xc5c3('0x28'),this[_0xc5c3('0xd')],this[_0xc5c3('0x29')]);};module[_0xc5c3('0x2a')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 6061408..8afa5da 100644 --- a/server/services/ami/preview/index.js +++ b/server/services/ami/preview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa2da=['buildNoAnswerEventPayload','[callProgressDetectingCustomer][logNoAnswer]','additional','[callProgressDetectingCustomer][logNoAnswerGlobal]','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','outboundRejectCallsDay','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','verifyAdditionalPhones','dialAgentRejectMaxRetry','[callProgressDetectingCustomer][logAgentReject]','countagentrejectretry','outboundAbandonedCallsDay','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','linkedid','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','originated:\x20','destlinkedid','queueSummaryCountersUpdated','callProgressDetectingAgent','isUndefined','reason','[callProgressDetectingAgent][logNoSuch]','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','isNil','Contact','Contact\x20is\x20undefined','Queue','lookAgent','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','reachable','unmonitored','execRun','unlockContact','recallme','validateContact','isValid','checkIsBlackList','phone','checkInBlack','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','dialOriginateCallerIdName','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','setXMDContactVariables','merge','toLowerVariables','variables','variablesAction','OriginateError','logLookAgent','clone','custom:agentringnoanswer','[callProgressDetectingAgent][logAnswer]','syncHangup','[syncHangup][talking]','cause','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','syncDialEnd','destuniqueid','addVariable','syncVarSet','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','syncAttendedTransfer','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','ioredis','../../../config/environment','../../../config/logger','preview','../ami','./rpcDb','../rpc/cmHopperAdditionalPhone','./util/util','../dialer/utils','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','originateresponse','syncOriginateResponse','bind','hangup','hanguprequest','syncHangupRequest','dialend','newexten','syncNewExten','varset','attendedtransfer','blindtransfer','emit','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','voice:queue:%s','voice_queue_channel:remove','sendMessageOneNotActive','originated','pTalking','available','paused','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','name','\x20is\x20not\x20active','message','\x20is\x20deactivated','loopCampaigns','syncCampaigns','clockClearZombieChannels','dialMethod','booked','type','clearZombieChannels','outbound','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','queue','pTalking:\x20','dialAnswer','pick','contactId','VoiceQueueId','ListId','status','channel','catch','updateOriginated','[clearZombieChannel]','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','info','size','hasOwnProperty','length','scheduledat','Agent','run','then','logger2','[RecallMe]','disableContact','starttime','format','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','RecallFailedTimeout','createCustomerHistory','[HistoryRecallClose]','createCustomerFinal','IsNotLoggedIn','loggedIn','dialActive','isTrunkReachable','Trunk','UNREACHABLE_TRUNK','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','responsetime','answertime','uniqueid','\x20Queue','custom:agentconnect','connect','custom:agentcomplete','complete','outboundAnswerCallsDay','total','answered','decrementTalkink','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','sumDuration','talktime','sumBillable','BUSY','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','dialNoAnswerRetryFrequency','callAdditionalPhoneAfterMin'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xa2da,0x1e1));var _0xaa2d=function(_0x1fa760,_0x1bf063){_0x1fa760=_0x1fa760-0x0;var _0xd8eda1=_0xa2da[_0x1fa760];return _0xd8eda1;};'use strict';var util=require(_0xaa2d('0x0'));var _=require(_0xaa2d('0x1'));var uuid=require('uuid');var moment=require('moment');var Redis=require(_0xaa2d('0x2'));var config=require(_0xaa2d('0x3'));var logger=require(_0xaa2d('0x4'))(_0xaa2d('0x5'));var loggerAction=require(_0xaa2d('0x4'))('actionPreview');var ami=require(_0xaa2d('0x6'));var rpcDb=require(_0xaa2d('0x7'));var cmHopperAdditionalPhone=require(_0xaa2d('0x8'));var Action=require('./action');var ut=require(_0xaa2d('0x9'));var utils=require(_0xaa2d('0xa'));config[_0xaa2d('0xb')]=_[_0xaa2d('0xc')](config[_0xaa2d('0xb')],{'host':_0xaa2d('0xd'),'port':0x18eb});var io=require(_0xaa2d('0xe'))(new Redis(config[_0xaa2d('0xb')]));var Sequence=function(){};Sequence[_0xaa2d('0xf')][_0xaa2d('0x10')]=function(_0x6b2613){this['tail']=this['tail']?this[_0xaa2d('0x11')]['finally'](_0x6b2613):_0x6b2613();};function Preview(_0x454ef7){this[_0xaa2d('0x12')]=new Sequence();this[_0xaa2d('0x13')]=_0x454ef7[_0xaa2d('0x14')];this['trunks']=_0x454ef7[_0xaa2d('0x15')];this[_0xaa2d('0x16')]={};this['agents']=_0x454ef7[_0xaa2d('0x17')];this['clockClearZombieChannels']=0x0;ami['on'](_0xaa2d('0x18'),this[_0xaa2d('0x19')][_0xaa2d('0x1a')](this));ami['on'](_0xaa2d('0x1b'),this['syncHangup'][_0xaa2d('0x1a')](this));ami['on'](_0xaa2d('0x1c'),this[_0xaa2d('0x1d')]['bind'](this));ami['on'](_0xaa2d('0x1e'),this['syncDialEnd'][_0xaa2d('0x1a')](this));ami['on'](_0xaa2d('0x1f'),this[_0xaa2d('0x20')][_0xaa2d('0x1a')](this));ami['on'](_0xaa2d('0x21'),this['syncVarSet'][_0xaa2d('0x1a')](this));ami['on'](_0xaa2d('0x22'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0xaa2d('0x23'),this['syncBlindTransfer'][_0xaa2d('0x1a')](this));this['loopCampaigns'](this['campaignsPreview']);}function emit(_0x2bed14,_0x5b6d0f,_0x488aea){io['to'](_0x2bed14)[_0xaa2d('0x24')](_0x5b6d0f,_0x488aea);}function emitVoiceQueueChannelRemove(_0x229dab){logger['info'](_0xaa2d('0x25'),JSON[_0xaa2d('0x26')](_0x229dab));emit(util['format'](_0xaa2d('0x27'),_0x229dab['name']),_0xaa2d('0x28'),_0x229dab);io[_0xaa2d('0x24')]('voice_queue_presence:remove',_0x229dab);}function notSendMessagesQueue(_0xba08e3){if(_0xba08e3[_0xaa2d('0x29')]){if(_0xba08e3[_0xaa2d('0x2a')]===0x0&&_0xba08e3[_0xaa2d('0x2b')]===0x0){_0xba08e3[_0xaa2d('0x29')]=![];_0xba08e3[_0xaa2d('0x2c')]=0x0;_0xba08e3[_0xaa2d('0x2d')]=0x0;_0xba08e3['message']=utils[_0xaa2d('0x2e')][_0xaa2d('0x2f')];ut[_0xaa2d('0x30')](_0xaa2d('0x31'),_0xba08e3[_0xaa2d('0x32')]+_0xaa2d('0x33'));}else{_0xba08e3[_0xaa2d('0x34')]=utils[_0xaa2d('0x2e')]['DEACTIVATED'];ut[_0xaa2d('0x30')](_0xaa2d('0x31'),_0xba08e3[_0xaa2d('0x32')]+_0xaa2d('0x35'));}}}Preview[_0xaa2d('0xf')][_0xaa2d('0x36')]=function(){var _0x4ae53a=this;setInterval(function(){_0x4ae53a[_0xaa2d('0x37')]();},0x7cf);};Preview['prototype'][_0xaa2d('0x37')]=function(){var _0x132bbb=this['campaignsPreview'];this[_0xaa2d('0x38')]+=0x1;for(var _0x5718b5 in _0x132bbb){if(_0x132bbb['hasOwnProperty'](_0x5718b5)&&(_0x132bbb[_0x5718b5]['dialMethod']==='preview'||_0x132bbb[_0x5718b5][_0xaa2d('0x39')]===_0xaa2d('0x3a'))&&_0x132bbb[_0x5718b5][_0xaa2d('0x3b')]==='outbound'){if(this['clockClearZombieChannels']>0x7){this['clockClearZombieChannels']=0x0;this[_0xaa2d('0x3c')]();}}if(_0x132bbb['hasOwnProperty'](_0x5718b5)&&_0x132bbb[_0x5718b5][_0xaa2d('0x39')]==='preview'&&_0x132bbb[_0x5718b5][_0xaa2d('0x3b')]===_0xaa2d('0x3d')){if(_0x132bbb[_0x5718b5]['dialActive']){this[_0xaa2d('0x3e')](_0x132bbb[_0x5718b5]);if(_0x132bbb[_0x5718b5][_0xaa2d('0x3f')])this[_0xaa2d('0x40')](_0x132bbb[_0x5718b5]);}else{notSendMessagesQueue(_0x132bbb[_0x5718b5]);}}}};Preview['prototype'][_0xaa2d('0x41')]=function(_0x3e3066){var _0x138c0a=this;this['sequence'][_0xaa2d('0x10')](function(){if(!_['isNil'](_0x138c0a[_0xaa2d('0x16')][_0x3e3066])){loggerAction['info']('[clearZombieChannels][talking]',_0x3e3066,'Queue',_0x138c0a[_0xaa2d('0x16')][_0x3e3066][_0xaa2d('0x42')],'originated:\x20',JSON[_0xaa2d('0x26')](_0x138c0a[_0xaa2d('0x13')][_0x138c0a[_0xaa2d('0x16')][_0x3e3066][_0xaa2d('0x42')]][_0xaa2d('0x2a')]),_0xaa2d('0x43'),JSON['stringify'](_0x138c0a[_0xaa2d('0x13')][_0x138c0a[_0xaa2d('0x16')][_0x3e3066][_0xaa2d('0x42')]][_0xaa2d('0x2b')]),JSON[_0xaa2d('0x26')](_0x138c0a[_0xaa2d('0x16')][_0x3e3066][_0xaa2d('0x44')]),JSON['stringify'](_[_0xaa2d('0x45')](_0x138c0a[_0xaa2d('0x16')][_0x3e3066],[_0xaa2d('0x46'),'UserId',_0xaa2d('0x47'),_0xaa2d('0x48')])));return ami['Action']({'action':_0xaa2d('0x49'),'channel':_0x138c0a[_0xaa2d('0x16')][_0x3e3066][_0xaa2d('0x4a')]})[_0xaa2d('0x4b')](function(_0x349309){if(_0x349309['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x138c0a[_0xaa2d('0x16')][_0x3e3066]){ut[_0xaa2d('0x4c')](_0x138c0a[_0xaa2d('0x13')][_0x138c0a[_0xaa2d('0x16')][_0x3e3066][_0xaa2d('0x42')]],_0xaa2d('0x4d'));if(_0x138c0a[_0xaa2d('0x16')][_0x3e3066][_0xaa2d('0x44')]===!![]){ut['decrementTalkink'](_0x138c0a['campaignsPreview'][_0x138c0a[_0xaa2d('0x16')][_0x3e3066][_0xaa2d('0x42')]],_0xaa2d('0x4d'));ut['loggerError'](_0xaa2d('0x4e')+_0x3e3066,_0x138c0a[_0xaa2d('0x16')][_0x3e3066]['queue']);}ut[_0xaa2d('0x4f')](_0xaa2d('0x50')+_0x3e3066,_0x138c0a[_0xaa2d('0x16')][_0x3e3066][_0xaa2d('0x42')]);delete _0x138c0a[_0xaa2d('0x16')][_0x3e3066];}},0x2328);}});}});};Preview[_0xaa2d('0xf')][_0xaa2d('0x3c')]=function(){var _0x1af7a1=this;loggerAction[_0xaa2d('0x51')]('[action]',_[_0xaa2d('0x52')](this[_0xaa2d('0x16')]));for(var _0x12c81b in this['actions']){if(_0x1af7a1['actions'][_0xaa2d('0x53')](_0x12c81b)){_0x1af7a1['clearZombieChannel'](_0x12c81b);}}};Preview[_0xaa2d('0xf')]['recallMe']=function(_0x3e1f30){var _0x1c77e1=this;rpcDb['getContactRecallMe'](_0x3e1f30['id'],ut['agentReadyId'](this[_0xaa2d('0x17')]))['then'](function(_0x2bb5bb){if(!_['isNil'](_0x2bb5bb)){for(var _0x54723d=0x0;_0x54723d<_0x2bb5bb[_0xaa2d('0x54')];_0x54723d+=0x1){if(ut['getDiff'](_0x2bb5bb[_0x54723d][_0xaa2d('0x55')])<_0x3e1f30['dialRecallMeTimeout']*0x3c){if(_0x2bb5bb[_0x54723d]['Agent']&&!_0x2bb5bb[_0x54723d][_0xaa2d('0x56')]['voicePause']){_0x1c77e1[_0xaa2d('0x57')](_0x2bb5bb[_0x54723d]['id'])[_0xaa2d('0x58')](ut[_0xaa2d('0x59')]('[RecallMe]'))['catch'](ut[_0xaa2d('0x59')](_0xaa2d('0x5a')));}else{rpcDb[_0xaa2d('0x5b')](_0x2bb5bb[_0x54723d]['id']);}}else{var _0x3ef817=new Action(_0x2bb5bb[_0x54723d],_0x3e1f30);_0x3ef817[_0xaa2d('0x5c')]=moment()[_0xaa2d('0x5d')](_0xaa2d('0x5e'));_0x3e1f30[_0xaa2d('0x5f')]+=0x1;ut[_0xaa2d('0x60')](_0x3ef817,0x17,_0xaa2d('0x61'));if(_0x3e1f30[_0xaa2d('0x62')]){rpcDb['rescheduleContactInQueue'](ut['createBody'](_0x2bb5bb[_0x54723d]));rpcDb['createCustomerHistory'](_0x3ef817,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0xaa2d('0x60')](_0x3ef817,0x16,_0xaa2d('0x63'));rpcDb[_0xaa2d('0x64')](_0x3ef817,_0xaa2d('0x65'));rpcDb[_0xaa2d('0x66')](_0x3ef817,_0xaa2d('0x65'));}}}}})['catch'](ut[_0xaa2d('0x59')]('[getContactRecallMe]'));};Preview[_0xaa2d('0xf')][_0xaa2d('0x3e')]=function(_0x1c6429){_0x1c6429[_0xaa2d('0x29')]=!![];if(ut[_0xaa2d('0x67')](_0x1c6429[_0xaa2d('0x68')])){_0x1c6429[_0xaa2d('0x34')]=utils['CAMPAIGN_STATUS']['NO_AGENTS_LOGGED'];}else if(!ut['isActive'](_0x1c6429[_0xaa2d('0x69')])){_0x1c6429[_0xaa2d('0x34')]=utils[_0xaa2d('0x2e')][_0xaa2d('0x2f')];}else if(!this[_0xaa2d('0x6a')](_0x1c6429[_0xaa2d('0x6b')])){if(!this['isTrunkReachable'](_0x1c6429['TrunkBackup'])){_0x1c6429[_0xaa2d('0x34')]=utils[_0xaa2d('0x2e')][_0xaa2d('0x6c')];}else{_0x1c6429['message']=utils[_0xaa2d('0x2e')]['ACTIVE'];}}else{_0x1c6429[_0xaa2d('0x34')]=utils[_0xaa2d('0x2e')][_0xaa2d('0x6d')];}};Preview[_0xaa2d('0xf')][_0xaa2d('0x6e')]=function(_0x46005f,_0x39b1b2,_0x4c059b){var _0x2b3526=this;var _0x1efd02=this[_0xaa2d('0x16')][_0x39b1b2];var _0x21b086=this[_0xaa2d('0x13')][_0x1efd02[_0xaa2d('0x42')]];var _0x568333;var _0x3fbd32=![];var _0x1a6218=0x2;var _0x19e796=0x3;if(_0x21b086){switch(_0x4c059b){case'1':_0x21b086[_0xaa2d('0x6f')]+=0x1;_0x1efd02[_0xaa2d('0x70')]+=0x1;_0x1efd02[_0xaa2d('0x71')]=ut[_0xaa2d('0x72')](_0x1efd02);ut[_0xaa2d('0x60')](_0x1efd02,0x0,_0xaa2d('0x73'));ami['emit'](_0xaa2d('0x74'),ut[_0xaa2d('0x75')](_0x1efd02,_0xaa2d('0x76')));rpcDb[_0xaa2d('0x64')](_0x1efd02,_0xaa2d('0x77'));_0x2b3526['verifyAdditionalPhones'](_0x1efd02,'0',_0x21b086)[_0xaa2d('0x58')](function(_0x406513){_0x3fbd32=_0x406513['additional']==0x1;_0x1a6218=_0x21b086['dialNoSuchNumberRetryFrequency'];_0x19e796=_0x21b086['callAdditionalPhoneAfterMin'];if(!_0x3fbd32){if(ut[_0xaa2d('0x72')](_0x1efd02)>=_0x21b086[_0xaa2d('0x78')]){_0x568333=ut['cloneAction'](_0x1efd02,0xf,_0xaa2d('0x79'));rpcDb[_0xaa2d('0x66')](_0x568333,_0xaa2d('0x7a'));}else{if(_0x1efd02[_0xaa2d('0x70')]>=_0x21b086['dialNoSuchNumberMaxRetry']){rpcDb['createCustomerFinal'](_0x1efd02,_0xaa2d('0x7a'));}else{rpcDb[_0xaa2d('0x7b')](ut[_0xaa2d('0x7c')](_0x1efd02,_0xaa2d('0x70'),_0x21b086[_0xaa2d('0x7d')]),_0x1efd02[_0xaa2d('0x7e')],_0x1efd02[_0xaa2d('0x7f')]);}}delete this['actions'][_0x46005f['linkedid']];}else{_0x1efd02['countnosuchnumberretry']++;logger[_0xaa2d('0x51')](_0xaa2d('0x80'),_0x1efd02[_0xaa2d('0x70')]);logger[_0xaa2d('0x51')]('id',_0x1efd02[_0xaa2d('0x81')]);_0x2b3526[_0xaa2d('0x82')]({'id':_0x1efd02[_0xaa2d('0x81')],'field':{'countnosuchnumberretry':_0x1efd02[_0xaa2d('0x70')]}})[_0xaa2d('0x58')](function(){_0x2b3526[_0xaa2d('0x83')](_0x1efd02,_0x1a6218,_0x19e796)[_0xaa2d('0x58')](function(){});});}});break;case _0xaa2d('0x84'):var _0x483115=moment()[_0xaa2d('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0x1efd02[_0xaa2d('0x85')]=_0x483115;_0x1efd02[_0xaa2d('0x86')]=_0x483115;_0x1efd02['dialAnswer']=!![];_0x21b086[_0xaa2d('0x2b')]+=0x1;logger['info']('[syncHangup][talking][increment]',_0x1efd02[_0xaa2d('0x87')],_0xaa2d('0x88'),_0x21b086[_0xaa2d('0x32')],_0xaa2d('0x43'),_0x21b086[_0xaa2d('0x2b')]);ami[_0xaa2d('0x24')](_0xaa2d('0x89'),ut[_0xaa2d('0x75')](_0x1efd02,_0xaa2d('0x8a'),this[_0xaa2d('0x13')][_0x1efd02[_0xaa2d('0x42')]]));if(_0x21b086['acw']){ami[_0xaa2d('0x24')]('custom:agentConnectPreview',ut['buildAcw'](_0x1efd02));}break;case'16':ami[_0xaa2d('0x24')](_0xaa2d('0x8b'),ut[_0xaa2d('0x75')](_0x1efd02,_0xaa2d('0x8c'),this[_0xaa2d('0x13')][_0x1efd02['queue']]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x1efd02,_0xaa2d('0x8c')));_0x21b086[_0xaa2d('0x8d')]+=0x1;_0x21b086[_0xaa2d('0x8e')]+=0x1;_0x21b086[_0xaa2d('0x8f')]+=0x1;ut[_0xaa2d('0x90')](_0x21b086,_0xaa2d('0x91'));_0x1efd02[_0xaa2d('0x71')]=ut['totalGlobal'](_0x1efd02);ut['logCustomer'](_0x1efd02,0x4,_0xaa2d('0x92'));rpcDb[_0xaa2d('0x64')](_0x1efd02,_0xaa2d('0x93'));rpcDb[_0xaa2d('0x66')](_0x1efd02,_0xaa2d('0x94'));rpcDb['crateCustomerReportQueue'](_0x1efd02);_0x21b086[_0xaa2d('0x95')]+=_0x1efd02[_0xaa2d('0x96')];_0x21b086[_0xaa2d('0x97')]+=_0x1efd02[_0xaa2d('0x96')];logger['info']('[syncHangup][talking][decrement]',_0x1efd02[_0xaa2d('0x87')],_0xaa2d('0x88'),_0x21b086['name'],_0xaa2d('0x43'),_0x21b086[_0xaa2d('0x2b')]);delete this[_0xaa2d('0x16')][_0x46005f['linkedid']];break;case _0xaa2d('0x98'):_0x21b086[_0xaa2d('0x99')]+=0x1;_0x1efd02[_0xaa2d('0x9a')]+=0x1;_0x1efd02['countglobal']=ut[_0xaa2d('0x72')](_0x1efd02);ut[_0xaa2d('0x60')](_0x1efd02,0x5,_0xaa2d('0x9b'));_0x1a6218=_0x21b086[_0xaa2d('0x9c')];_0x19e796=_0x21b086['callAdditionalPhoneAfterMin'];ami[_0xaa2d('0x24')](_0xaa2d('0x9d'),ut[_0xaa2d('0x75')](_0x1efd02,_0xaa2d('0x9e')));rpcDb[_0xaa2d('0x64')](_0x1efd02,_0xaa2d('0x9f'));_0x2b3526['verifyAdditionalPhones'](_0x1efd02,'5',_0x21b086)[_0xaa2d('0x58')](function(_0x31ec78){_0x3fbd32=_0x31ec78['additional']==0x1;if(!_0x3fbd32){if(ut[_0xaa2d('0x72')](_0x1efd02)>=_0x21b086[_0xaa2d('0x78')]){_0x568333=ut[_0xaa2d('0xa0')](_0x1efd02,0xf,_0xaa2d('0x79'));rpcDb[_0xaa2d('0x66')](_0x568333,_0xaa2d('0xa1'));}else{if(_0x1efd02[_0xaa2d('0x9a')]>=_0x21b086[_0xaa2d('0xa2')]){rpcDb[_0xaa2d('0x66')](_0x1efd02,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0xaa2d('0x7b')](ut[_0xaa2d('0x7c')](_0x1efd02,_0xaa2d('0x9a'),_0x21b086[_0xaa2d('0x9c')]),_0x1efd02['unlockAgent'],_0x1efd02[_0xaa2d('0x7f')]);}}}else{_0x1efd02[_0xaa2d('0x9a')]++;_0x2b3526['incrementPreviewCounters']({'id':_0x1efd02['idContact'],'field':{'countbusyretry':_0x1efd02[_0xaa2d('0x9a')]}})[_0xaa2d('0x58')](function(){_0x2b3526['swapAdditionalPhones'](_0x1efd02,_0x1a6218,_0x19e796)[_0xaa2d('0x58')](function(){});});}});break;case _0xaa2d('0xa3'):_0x21b086[_0xaa2d('0xa4')]+=0x1;_0x1efd02[_0xaa2d('0xa5')]+=0x1;_0x1efd02['countglobal']=ut[_0xaa2d('0x72')](_0x1efd02);ut[_0xaa2d('0x60')](_0x1efd02,0x3,_0xaa2d('0xa6'));_0x1a6218=_0x21b086[_0xaa2d('0xa7')];_0x19e796=_0x21b086[_0xaa2d('0xa8')];var _0x118bf7=ut[_0xaa2d('0xa9')](_0x1efd02,_0x21b086);ami[_0xaa2d('0x24')]('custom:agentnoanswer',_0x118bf7);rpcDb[_0xaa2d('0x64')](_0x1efd02,_0xaa2d('0xaa'));_0x2b3526['verifyAdditionalPhones'](_0x1efd02,'3',_0x21b086)[_0xaa2d('0x58')](function(_0x1533eb){_0x3fbd32=_0x1533eb[_0xaa2d('0xab')]==0x1;if(!_0x3fbd32){if(ut['totalGlobal'](_0x1efd02)>=_0x21b086[_0xaa2d('0x78')]){_0x568333=ut['cloneAction'](_0x1efd02,0xf,_0xaa2d('0x79'));rpcDb['createCustomerFinal'](_0x568333,_0xaa2d('0xac'));}else{if(_0x1efd02[_0xaa2d('0xa5')]>=_0x21b086['dialNoAnswerMaxRetry']){rpcDb['createCustomerFinal'](_0x1efd02,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0xaa2d('0x7b')](ut[_0xaa2d('0x7c')](_0x1efd02,_0xaa2d('0xa5'),_0x21b086[_0xaa2d('0xa7')]),_0x1efd02['unlockAgent'],_0x1efd02[_0xaa2d('0x7f')]);}}}else{_0x1efd02[_0xaa2d('0xa5')]++;_0x2b3526[_0xaa2d('0x82')]({'id':_0x1efd02[_0xaa2d('0x81')],'field':{'countnoanswerretry':_0x1efd02[_0xaa2d('0xa5')]}})[_0xaa2d('0x58')](function(){_0x2b3526['swapAdditionalPhones'](_0x1efd02,_0x1a6218,_0x19e796)[_0xaa2d('0x58')](function(){});});}});break;case _0xaa2d('0xad'):_0x21b086[_0xaa2d('0xae')]+=0x1;_0x1efd02[_0xaa2d('0xaf')]+=0x1;_0x1efd02[_0xaa2d('0x71')]=ut[_0xaa2d('0x72')](_0x1efd02);ut[_0xaa2d('0x60')](_0x1efd02,0x8,_0xaa2d('0xb0'));_0x1a6218=_0x21b086['dialCongestionRetryFrequency'];_0x19e796=_0x21b086[_0xaa2d('0xa8')];ami[_0xaa2d('0x24')](_0xaa2d('0xb1'),ut[_0xaa2d('0x75')](_0x1efd02,_0xaa2d('0xb2')));rpcDb['createCustomerHistory'](_0x1efd02,_0xaa2d('0xb3'));_0x2b3526['verifyAdditionalPhones'](_0x1efd02,'8',_0x21b086)['then'](function(_0x3e5d86){_0x3fbd32=_0x3e5d86['additional']==0x1;if(!_0x3fbd32){if(ut[_0xaa2d('0x72')](_0x1efd02)>=_0x21b086['dialGlobalMaxRetry']){_0x568333=ut[_0xaa2d('0xa0')](_0x1efd02,0xf,_0xaa2d('0x79'));rpcDb[_0xaa2d('0x66')](_0x568333,_0xaa2d('0xb4'));}else{if(_0x1efd02[_0xaa2d('0xaf')]>=_0x21b086[_0xaa2d('0xb5')]){rpcDb['createCustomerFinal'](_0x1efd02,_0xaa2d('0xb3'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x1efd02,'countcongestionretry',_0x21b086['dialBusyRetryFrequency']),_0x1efd02[_0xaa2d('0x7e')],_0x1efd02['activeContact']);}}}else{_0x1efd02[_0xaa2d('0xaf')]++;_0x2b3526[_0xaa2d('0x82')]({'id':_0x1efd02[_0xaa2d('0x81')],'field':{'countcongestionretry':_0x1efd02[_0xaa2d('0xaf')]}})[_0xaa2d('0x58')](function(){_0x2b3526[_0xaa2d('0x83')](_0x1efd02,_0x1a6218,_0x19e796)[_0xaa2d('0x58')](function(){});});}});break;case _0xaa2d('0xb6'):_0x21b086[_0xaa2d('0xb7')]+=0x1;_0x1efd02['countagentrejectretry']+=0x1;_0x1efd02[_0xaa2d('0x71')]=ut['totalGlobal'](_0x1efd02);ut['logCustomer'](_0x1efd02,0x14,'AgentReject');_0x1a6218=_0x21b086[_0xaa2d('0xb8')];_0x19e796=_0x21b086[_0xaa2d('0xa8')];ami['emit'](_0xaa2d('0xb9'),ut[_0xaa2d('0x75')](_0x1efd02,_0xaa2d('0xba')));rpcDb[_0xaa2d('0x64')](_0x1efd02,_0xaa2d('0xbb'));_0x2b3526[_0xaa2d('0xbc')](_0x1efd02,'20',_0x21b086)[_0xaa2d('0x58')](function(_0x3e4d75){_0x3fbd32=_0x3e4d75[_0xaa2d('0xab')]==0x1;if(!_0x3fbd32){if(ut[_0xaa2d('0x72')](_0x1efd02)>=_0x21b086[_0xaa2d('0x78')]){_0x568333=ut['cloneAction'](_0x1efd02,0x14,'AgentReject');rpcDb[_0xaa2d('0x66')](_0x568333,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x1efd02['countagentrejectretry']>=_0x21b086[_0xaa2d('0xbd')]){rpcDb[_0xaa2d('0x66')](_0x1efd02,_0xaa2d('0xbe'));}else{rpcDb[_0xaa2d('0x7b')](ut['scheduledAt'](_0x1efd02,_0xaa2d('0xbf'),_0x21b086[_0xaa2d('0xb8')]),_0x1efd02[_0xaa2d('0x7e')],_0x1efd02[_0xaa2d('0x7f')]);}}}else{_0x1efd02['countnoanswerretry']++;_0x2b3526[_0xaa2d('0x82')]({'id':_0x1efd02[_0xaa2d('0x81')],'field':{'countnoanswerretry':_0x1efd02[_0xaa2d('0xa5')]}})[_0xaa2d('0x58')](function(){_0x2b3526[_0xaa2d('0x83')](_0x1efd02,_0x1a6218,_0x19e796)[_0xaa2d('0x58')](function(){});});}});break;case'ABANDONED':_0x21b086[_0xaa2d('0xc0')]+=0x1;_0x1efd02['countabandonedretry']+=0x1;_0x1efd02[_0xaa2d('0x71')]=ut[_0xaa2d('0x72')](_0x1efd02);ut[_0xaa2d('0x60')](_0x1efd02,0xb,_0xaa2d('0xc1'));rpcDb['createCustomerHistory'](_0x1efd02,_0xaa2d('0xc2'));_0x2b3526['verifyAdditionalPhones'](_0x1efd02,'11',_0x21b086)[_0xaa2d('0x58')](function(_0x232b61){_0x3fbd32=_0x232b61[_0xaa2d('0xab')]==0x1;if(!_0x3fbd32){if(ut['totalGlobal'](_0x1efd02)>=_0x21b086[_0xaa2d('0x78')]){_0x568333=ut[_0xaa2d('0xa0')](_0x1efd02,0xf,_0xaa2d('0x79'));rpcDb[_0xaa2d('0x66')](_0x568333,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x1efd02[_0xaa2d('0xc3')]>=_0x21b086[_0xaa2d('0xc4')]){rpcDb[_0xaa2d('0x66')](_0x1efd02,_0xaa2d('0xc2'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x1efd02,'countabandonedretry',_0x21b086[_0xaa2d('0xc5')]),_0x1efd02[_0xaa2d('0x7e')],_0x1efd02['activeContact']);}}}else{_0x1efd02[_0xaa2d('0xa5')]++;_0x2b3526[_0xaa2d('0x82')]({'id':_0x1efd02[_0xaa2d('0x81')],'field':{'countnoanswerretry':_0x1efd02[_0xaa2d('0xa5')]}})[_0xaa2d('0x58')](function(){_0x2b3526['swapAdditionalPhones'](_0x1efd02,_0x1a6218,_0x19e796)[_0xaa2d('0x58')](function(){});});}});break;case'18':_0x21b086[_0xaa2d('0xc6')]+=0x1;_0x1efd02[_0xaa2d('0xc7')]+=0x1;_0x1efd02['countglobal']=ut[_0xaa2d('0x72')](_0x1efd02);ut['logCustomer'](_0x1efd02,0x12,_0x46005f[_0xaa2d('0xc8')]||_0x46005f[_0xaa2d('0xc9')]);ami[_0xaa2d('0x24')](_0xaa2d('0xca'),ut[_0xaa2d('0x75')](_0x1efd02,'amd'));rpcDb[_0xaa2d('0x64')](_0x1efd02,'[callProgressDetectingCustomer][hangupInAMD]');_0x2b3526[_0xaa2d('0xbc')](_0x1efd02,'18',_0x21b086)[_0xaa2d('0x58')](function(_0x4e5563){_0x3fbd32=_0x4e5563['additional']==0x1;if(!_0x3fbd32){if(ut[_0xaa2d('0x72')](_0x1efd02)>=_0x21b086['dialGlobalMaxRetry']){_0x568333=ut['cloneAction'](_0x1efd02,0x12,'Global');rpcDb[_0xaa2d('0x66')](_0x568333,_0xaa2d('0xcb'));}else{rpcDb[_0xaa2d('0x66')](_0x1efd02,_0xaa2d('0xcb'));}}else{_0x1efd02[_0xaa2d('0xa5')]++;_0x2b3526[_0xaa2d('0x82')]({'id':_0x1efd02[_0xaa2d('0x81')],'field':{'countnoanswerretry':_0x1efd02[_0xaa2d('0xa5')]}})[_0xaa2d('0x58')](function(){_0x2b3526[_0xaa2d('0x83')](_0x1efd02,_0x1a6218,_0x19e796)['then'](function(){});});}});delete this['actions'][_0x46005f['linkedid']];break;case'19':_0x21b086[_0xaa2d('0xc6')]+=0x1;_0x1efd02[_0xaa2d('0x71')]=ut[_0xaa2d('0x72')](_0x1efd02);ut[_0xaa2d('0x60')](_0x1efd02,0x13,_0x46005f[_0xaa2d('0xc8')]||_0x46005f[_0xaa2d('0xc9')]);ami['emit']('custom:amd',ut[_0xaa2d('0x75')](_0x1efd02,'amd'));rpcDb[_0xaa2d('0x64')](_0x1efd02,_0xaa2d('0xcc'));_0x2b3526[_0xaa2d('0xbc')](_0x1efd02,'18',_0x21b086)[_0xaa2d('0x58')](function(_0x348558){_0x3fbd32=_0x348558[_0xaa2d('0xab')]==0x1;if(!_0x3fbd32){if(ut[_0xaa2d('0x72')](_0x1efd02)>=_0x21b086['dialGlobalMaxRetry']){_0x568333=ut['cloneAction'](_0x1efd02,0xf,_0xaa2d('0x79'));rpcDb[_0xaa2d('0x66')](_0x568333,_0xaa2d('0xcc'));}else{rpcDb[_0xaa2d('0x66')](_0x1efd02,_0xaa2d('0xcc'));}}else{_0x1efd02[_0xaa2d('0xa5')]++;_0x2b3526['incrementPreviewCounters']({'id':_0x1efd02['idContact'],'field':{'countnoanswerretry':_0x1efd02[_0xaa2d('0xa5')]}})[_0xaa2d('0x58')](function(){_0x2b3526[_0xaa2d('0x83')](_0x1efd02,_0x1a6218,_0x19e796)[_0xaa2d('0x58')](function(){});});}});delete this[_0xaa2d('0x16')][_0x46005f[_0xaa2d('0xcd')]];break;default:if(_0x1efd02[_0xaa2d('0x44')]){ut[_0xaa2d('0x90')](_0x21b086,_0xaa2d('0xce'));ut[_0xaa2d('0x4f')](_0xaa2d('0xcf')+_0x21b086[_0xaa2d('0x32')],_0x46005f);}_0x21b086[_0xaa2d('0xc6')]+=0x1;_0x1efd02[_0xaa2d('0x71')]=ut['totalGlobal'](_0x1efd02);ut[_0xaa2d('0x60')](_0x1efd02,0xc,_0x46005f[_0xaa2d('0xc8')]||_0x46005f[_0xaa2d('0xc9')]);_0x1a6218=_0x21b086['dialAgentRejectRetryFrequency'];_0x19e796=_0x21b086[_0xaa2d('0xa8')];rpcDb['createCustomerHistory'](_0x1efd02,_0xaa2d('0xd0'));_0x2b3526[_0xaa2d('0xbc')](_0x1efd02,'20',_0x21b086)[_0xaa2d('0x58')](function(_0x222e8f){_0x3fbd32=_0x222e8f[_0xaa2d('0xab')]==0x1;if(!_0x3fbd32){if(ut['totalGlobal'](_0x1efd02)>=_0x21b086['dialGlobalMaxRetry']){_0x568333=ut[_0xaa2d('0xa0')](_0x1efd02,0xf,_0xaa2d('0x79'));rpcDb[_0xaa2d('0x66')](_0x568333,_0xaa2d('0xd1'));}else{rpcDb[_0xaa2d('0x66')](_0x1efd02,_0xaa2d('0xd1'));}delete this[_0xaa2d('0x16')][_0x46005f[_0xaa2d('0xcd')]];}else{_0x2b3526[_0xaa2d('0x83')](_0x1efd02,_0x1a6218,_0x19e796)[_0xaa2d('0x58')](function(){});}});}if(!(_0x1efd02[_0xaa2d('0x44')]&&_0x4c059b==='16')){ut[_0xaa2d('0x4c')](_0x21b086,_0xaa2d('0xd2'));logger[_0xaa2d('0x51')]('[originated][decrement][callProgressDetectingCustomer]',_0x1efd02[_0xaa2d('0x87')],'\x20Queue',_0x21b086['name'],_0xaa2d('0xd3'),_0x21b086[_0xaa2d('0x2a')]);}if(_0x4c059b!==_0xaa2d('0x84')){delete this[_0xaa2d('0x16')][_0x46005f['linkedid']];delete this['actions'][_0x46005f[_0xaa2d('0xd4')]];}_0x21b086[_0xaa2d('0xd5')]=!![];}};Preview['prototype'][_0xaa2d('0xd6')]=function(_0x7e9a4,_0xb3725f,_0x3d06fd){if(_[_0xaa2d('0xd7')](_0xb3725f)&&'object'!==typeof _0xb3725f){return;}if(_[_0xaa2d('0xd7')](_0x3d06fd)&&'object'!==typeof _0x3d06fd){return;}switch(_0x3d06fd[_0xaa2d('0xd8')]){case'0':ut['logAgent'](_0x7e9a4,0x0,_0xaa2d('0x73'));rpcDb['createAgentHistory'](_0x7e9a4,_0xaa2d('0xd9'));break;case'3':ut[_0xaa2d('0xda')](_0x7e9a4,0x3,'NoAnswer');rpcDb[_0xaa2d('0xdb')](_0x7e9a4,_0xaa2d('0xdc'));break;case'5':ut[_0xaa2d('0xda')](_0x7e9a4,0x5,_0xaa2d('0x9b'));rpcDb[_0xaa2d('0xdb')](_0x7e9a4,_0xaa2d('0xdd'));break;case'8':ut[_0xaa2d('0xda')](_0x7e9a4,0x8,_0xaa2d('0xb0'));rpcDb[_0xaa2d('0xdb')](_0x7e9a4,_0xaa2d('0xde'));break;case'22':ut['logAgent'](_0x7e9a4,0x16,_0xaa2d('0xdf'));rpcDb[_0xaa2d('0xdb')](_0x7e9a4,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0xaa2d('0xda')](_0x7e9a4,0xc,_0x3d06fd[_0xaa2d('0xd8')]);rpcDb[_0xaa2d('0xdb')](_0x7e9a4,_0xaa2d('0xde'));}ut['updateOriginated'](_0xb3725f,_0xaa2d('0xe0'));logger[_0xaa2d('0x51')](_0xaa2d('0xe1'),_0x7e9a4['uniqueid'],_0xaa2d('0x88'),_0xb3725f[_0xaa2d('0x32')],_0xaa2d('0xd3'),_0xb3725f[_0xaa2d('0x2a')]);delete this[_0xaa2d('0x16')][_0x7e9a4[_0xaa2d('0x87')]];};Preview['prototype']['verifyAdditionalPhones']=function(_0x53d9e7,_0x4405ef,_0x545411){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x53d9e7,_0x4405ef,_0x545411)[_0xaa2d('0x4b')](logger['info'](_0xaa2d('0xe2')));};Preview[_0xaa2d('0xf')]['swapAdditionalPhones']=function(_0x582d26,_0x3343df,_0x12601b){return cmHopperAdditionalPhone['swapAdditionalPhones'](_0x582d26,_0x3343df,_0x12601b)['catch'](logger['info'](_0xaa2d('0xe3')));};Preview[_0xaa2d('0xf')]['incrementPreviewCounters']=function(_0x37981e){return Promise[_0xaa2d('0xe4')]()[_0xaa2d('0x58')](cmHopperAdditionalPhone[_0xaa2d('0x82')](_0x37981e))[_0xaa2d('0x4b')](logger[_0xaa2d('0x51')]('[incrementPreviewCounters]\x20'));};Preview[_0xaa2d('0xf')]['checkInBlack']=function(_0x379a7d,_0xaf2711,_0x787521,_0x402156,_0x473679){var _0x16525c=this;return new Promise(function(_0x4d0e6c,_0x27bcd7){if(_['isNil'](_0xaf2711)||_[_0xaa2d('0xe5')](_0xaf2711[_0xaa2d('0xe6')])||_[_0xaa2d('0xe5')](_0xaf2711['phone'])||_[_0xaa2d('0xe5')](_0xaf2711[_0xaa2d('0x47')])){_0x27bcd7(ut[_0xaa2d('0x34')](_0xaa2d('0xe7'),_0x402156,_0x473679));return;}var _0x4db43c=uuid['v4']();var _0x1a24d6=_0x16525c[_0xaa2d('0x13')][_0xaf2711[_0xaa2d('0xe8')]['name']];var _0x35066d=_0x787521?_0x16525c[_0xaa2d('0x17')][_0x787521]['id']:undefined;_0x16525c[_0xaa2d('0x16')][_0x4db43c]=new Action(_0xaf2711,_0x1a24d6,_0x4db43c,_0x787521,_0x35066d);var _0x14a9e6=_0x16525c[_0xaa2d('0x16')][_0x4db43c];_0x14a9e6[_0xaa2d('0x7e')]=_0x402156;_0x14a9e6[_0xaa2d('0x7f')]=_0x473679;_0x14a9e6[_0xaa2d('0xe9')]=_0x787521;if(_['isEmpty'](_0x379a7d)){_0x16525c[_0xaa2d('0xea')](_0x14a9e6,_0x1a24d6,_0xaf2711,_0x787521)[_0xaa2d('0x58')](function(_0x58ca5d){logger['info'](_0xaa2d('0xeb'),_0xaa2d('0xec')+_0x14a9e6[_0xaa2d('0x42')]+_0xaa2d('0xed')+_0x14a9e6[_0xaa2d('0x81')],JSON[_0xaa2d('0x26')](_0x58ca5d));ami[_0xaa2d('0x24')](_0xaa2d('0xee'),ut[_0xaa2d('0x75')](_0x14a9e6,_0xaa2d('0xef'),_0x16525c[_0xaa2d('0x13')][_0x14a9e6[_0xaa2d('0x42')]]));_0x4d0e6c(ut[_0xaa2d('0x34')]('Calling'));})[_0xaa2d('0x4b')](function(_0x410584){ut[_0xaa2d('0x30')](_0xaa2d('0xf0'),_0x410584);_0x27bcd7(ut['message'](_0xaa2d('0xf1'),_0x402156,_0x473679));});}else{_0x1a24d6[_0xaa2d('0xf2')]+=0x1;ut[_0xaa2d('0xf3')](_0x14a9e6);rpcDb[_0xaa2d('0xf4')](_0x14a9e6,_0xaa2d('0xf5'));delete _0x16525c[_0xaa2d('0x16')][_0x4db43c];_0x27bcd7(ut[_0xaa2d('0x34')](_0xaa2d('0xf6'),_0x402156,_0x473679));}});};Preview[_0xaa2d('0xf')][_0xaa2d('0x6a')]=function(_0x3aa3b4){return!_['isNil'](_0x3aa3b4)&&!_[_0xaa2d('0xe5')](_0x3aa3b4[_0xaa2d('0x32')])&&!_[_0xaa2d('0xe5')](_0x3aa3b4[_0xaa2d('0xf7')])&&_0x3aa3b4[_0xaa2d('0xf7')]&&!_[_0xaa2d('0xe5')](this['trunks'][util[_0xaa2d('0x5d')](_0xaa2d('0xf8'),_0x3aa3b4['name'])])&&!_[_0xaa2d('0xe5')](this['trunks'][util[_0xaa2d('0x5d')](_0xaa2d('0xf8'),_0x3aa3b4['name'])][_0xaa2d('0x49')])&&(this['trunks'][util[_0xaa2d('0x5d')](_0xaa2d('0xf8'),_0x3aa3b4[_0xaa2d('0x32')])][_0xaa2d('0x49')]===_0xaa2d('0xf9')||this[_0xaa2d('0x15')][util['format'](_0xaa2d('0xf8'),_0x3aa3b4['name'])]['status']===_0xaa2d('0xfa'));};Preview[_0xaa2d('0xf')]['run']=function(_0x408a3f,_0x16279a){return this[_0xaa2d('0xfb')](_0x408a3f,_0x16279a)[_0xaa2d('0x58')](function(_0x457987){return _[_0xaa2d('0x45')](_0x457987,[_0xaa2d('0x34')]);})[_0xaa2d('0x4b')](function(_0x408f68){if(_0x408f68['unlock']){rpcDb[_0xaa2d('0xfc')](_0x408a3f);}if(_0x408f68['active']){rpcDb['disableContact'](_0x408a3f);}throw _[_0xaa2d('0x45')](_0x408f68,['message']);});};Preview[_0xaa2d('0xf')][_0xaa2d('0xfb')]=function(_0x1ae847,_0x285210){var _0x2ad96c=this;var _0x5c45f1,_0x2bbb78;return rpcDb['getContactPreview'](_0x1ae847)[_0xaa2d('0x58')](function(_0xc1f86a){if(!_[_0xaa2d('0xe5')](_0xc1f86a[0x0])){_0x2bbb78=_0xc1f86a[0x0][_0xaa2d('0xfd')]?![]:!![];_0x5c45f1=_0xc1f86a[0x0][_0xaa2d('0xfd')]?!![]:![];_0x5c45f1=_0x285210?!![]:_0x5c45f1;}var _0x314552=_0x2ad96c[_0xaa2d('0xfe')](_0xc1f86a);if(_0x314552[_0xaa2d('0xff')]){rpcDb[_0xaa2d('0x100')](_[_0xaa2d('0x45')](_0xc1f86a[0x0],[_0xaa2d('0x47'),_0xaa2d('0x101')]))[_0xaa2d('0x58')](function(_0x1b40ab){_0x2ad96c[_0xaa2d('0x102')](_0x1b40ab,_0xc1f86a[0x0],_0x285210,_0x2bbb78,_0x5c45f1)[_0xaa2d('0x58')](function(_0x2b3f0f){return _0x2b3f0f;})[_0xaa2d('0x4b')](function(_0x4c9265){throw _0x4c9265;});})['catch'](function(_0xd518f4){ut[_0xaa2d('0x30')](_0xaa2d('0x103'),_0xd518f4);throw ut[_0xaa2d('0x34')](_0xaa2d('0x104'),_0x2bbb78,_0x5c45f1);});}else{throw ut[_0xaa2d('0x34')](_0x314552[_0xaa2d('0x34')],_0x2bbb78,_0x5c45f1);}})[_0xaa2d('0x4b')](function(_0x4d575b){ut[_0xaa2d('0x30')](_0xaa2d('0x105'),_0x4d575b);throw ut[_0xaa2d('0x34')](_0xaa2d('0x104'),![],!![]);});};Preview[_0xaa2d('0xf')][_0xaa2d('0xfe')]=function(_0x2e3a16){if(_[_0xaa2d('0xe5')](_0x2e3a16)||_['isEmpty'](_0x2e3a16)||!_[_0xaa2d('0xe5')](_0x2e3a16[0x0][_0xaa2d('0x56')])&&_['isNil'](_0x2e3a16[0x0][_0xaa2d('0x56')][_0xaa2d('0x32')])){ut[_0xaa2d('0x30')](_0xaa2d('0x106'),_0x2e3a16);return{'isValid':![],'message':_0xaa2d('0x107')};}var _0x1b0f5d=this['campaignsPreview'][_0x2e3a16[0x0][_0xaa2d('0xe8')][_0xaa2d('0x32')]];_0x1b0f5d['message']=utils[_0xaa2d('0x2e')][_0xaa2d('0x6d')];if(_[_0xaa2d('0xe5')](_0x1b0f5d)){ut['logger'](_0xaa2d('0x108'),_0x1b0f5d);return{'isValid':![],'message':_0xaa2d('0x109')};}if(!this[_0xaa2d('0x6a')](_0x1b0f5d['Trunk'])){ut[_0xaa2d('0x30')](_0xaa2d('0x10a'),_0xaa2d('0x10b')+_0x1b0f5d[_0xaa2d('0x32')]+_0xaa2d('0x10c'));if(!this['isTrunkReachable'](_0x1b0f5d[_0xaa2d('0x10d')])){ut[_0xaa2d('0x30')](_0xaa2d('0x10a'),_0x1b0f5d[_0xaa2d('0x32')]+_0xaa2d('0x10e'));return{'isValid':![],'message':_0xaa2d('0x10f')};}}if(!ut[_0xaa2d('0x110')](_0x1b0f5d[_0xaa2d('0x69')])){ut[_0xaa2d('0x30')](_0xaa2d('0x111'),_0x1b0f5d[_0xaa2d('0x32')]+_0xaa2d('0x112'));return{'isValid':![],'message':_0xaa2d('0x10b')+_0x1b0f5d[_0xaa2d('0x32')]+_0xaa2d('0x112')};}return{'isValid':!![],'message':_0xaa2d('0x113')};};Preview[_0xaa2d('0xf')][_0xaa2d('0xea')]=function(_0x3652ae,_0xdaa731,_0xe9f4d5,_0xf47acb){var _0x5c499b=this;return new Promise(function(_0x22a822,_0x4fcfe5){var _0x52d5d1=_0x3652ae[_0xaa2d('0x87')];var _0x3f32c5=_0x5c499b['isTrunkReachable'](_0xdaa731[_0xaa2d('0x6b')])?util['format'](_0xaa2d('0x114'),_0xdaa731[_0xaa2d('0x6b')][_0xaa2d('0x32')],_[_0xaa2d('0xe5')](_0xdaa731[_0xaa2d('0x115')])?'':_0xdaa731[_0xaa2d('0x115')][_0xaa2d('0x116')]()||'',_0xdaa731[_0xaa2d('0x117')]>0x0?_0xe9f4d5[_0xaa2d('0x101')][_0xaa2d('0x118')](_0xdaa731[_0xaa2d('0x117')]):_0xe9f4d5[_0xaa2d('0x101')]):util[_0xaa2d('0x5d')](_0xaa2d('0x114'),_['isNil'](_0xdaa731[_0xaa2d('0x10d')])?_0xdaa731['Trunk'][_0xaa2d('0x32')]:_0xdaa731['TrunkBackup'][_0xaa2d('0x32')],_[_0xaa2d('0xe5')](_0xdaa731[_0xaa2d('0x115')])?'':_0xdaa731['dialPrefix'][_0xaa2d('0x116')]()||'',_0xdaa731['dialCutDigit']>0x0?_0xe9f4d5['phone'][_0xaa2d('0x118')](_0xdaa731['dialCutDigit']):_0xe9f4d5['phone']);var _0x5a8113=_0x5c499b[_0xaa2d('0x6a')](_0xdaa731[_0xaa2d('0x6b')])?ut[_0xaa2d('0x119')](_0xdaa731['Trunk'][_0xaa2d('0x11a')],_0xdaa731['dialOriginateCallerIdName'],_0xdaa731[_0xaa2d('0x11b')]>0x0?ut[_0xaa2d('0x11c')](_0xdaa731['dialOriginateCallerIdNumber'],_0xdaa731[_0xaa2d('0x11b')]):_0xdaa731[_0xaa2d('0x11d')]):ut[_0xaa2d('0x119')](_['isNil'](_0xdaa731['TrunkBackup'])?_0xdaa731['Trunk']['callerid']:_0xdaa731[_0xaa2d('0x10d')][_0xaa2d('0x11a')],_0xdaa731[_0xaa2d('0x11e')],_0xdaa731[_0xaa2d('0x11b')]>0x0?ut[_0xaa2d('0x11c')](_0xdaa731[_0xaa2d('0x11d')],_0xdaa731[_0xaa2d('0x11b')]):_0xdaa731[_0xaa2d('0x11d')]);if(_0x5a8113){_0x3652ae['originatecalleridname']=ut[_0xaa2d('0x11f')](_0x5a8113);_0x3652ae[_0xaa2d('0x120')]=ut[_0xaa2d('0x121')](_0x5a8113);}var _0x4297d0=ut[_0xaa2d('0x122')](_0xdaa731,_0xe9f4d5,_0x3f32c5,_0x5a8113,_0x52d5d1,_0x3652ae);var _0x3aa345=utils[_0xaa2d('0x123')](_0xe9f4d5[_0xaa2d('0xe6')]);Object['assign'](_0x4297d0,_0x3aa345);_[_0xaa2d('0x124')](_0x3652ae,ut[_0xaa2d('0x125')](_0x4297d0));_0x3652ae[_0xaa2d('0x5c')]=moment()[_0xaa2d('0x5d')](_0xaa2d('0x5e'));_0xdaa731[_0xaa2d('0x126')]=_0x4297d0;var _0x33c134=ut[_0xaa2d('0x127')](_0x3652ae,_0xdaa731,_0x4297d0,_0x3652ae[_0xaa2d('0x7f')],_0xf47acb);return ami['Action'](_0x33c134)[_0xaa2d('0x58')](function(_0x4413b1){_0xdaa731[_0xaa2d('0x2a')]+=0x1;logger[_0xaa2d('0x51')]('[originated][increment]',_0x52d5d1,_0xaa2d('0x88'),_0xdaa731[_0xaa2d('0x32')],_0xaa2d('0xd3'),_0xdaa731[_0xaa2d('0x2a')]);_0x22a822(_0x4413b1);})[_0xaa2d('0x4b')](function(_0x4a2937){ut['logAgent'](_0x3652ae,0xe,_0xaa2d('0x128'));rpcDb['createAgentHistory'](_0x3652ae,'[originateFailure][logOriginateFailure]');_0x4fcfe5(_0x4a2937);});});};Preview[_0xaa2d('0xf')][_0xaa2d('0x20')]=function(_0xf2a0d1){if(this[_0xaa2d('0x16')][_0xf2a0d1[_0xaa2d('0xcd')]]){this[_0xaa2d('0x16')][_0xf2a0d1[_0xaa2d('0xcd')]][_0xaa2d('0x4a')]=_0xf2a0d1[_0xaa2d('0x4a')];}};Preview[_0xaa2d('0xf')][_0xaa2d('0x19')]=function(_0x27f924){var _0x40b054=this;var _0xb9aec2=this[_0xaa2d('0x16')][_0x27f924['actionid']];if(_0xb9aec2){if(_0xb9aec2[_0xaa2d('0xe9')]&&this[_0xaa2d('0x17')][_0xb9aec2[_0xaa2d('0xe9')]]){ut[_0xaa2d('0x129')](_0xb9aec2,this[_0xaa2d('0x17')][_0xb9aec2[_0xaa2d('0xe9')]][_0xaa2d('0x32')],this[_0xaa2d('0x17')][_0xb9aec2[_0xaa2d('0xe9')]]['id']);}var _0x755736=_[_0xaa2d('0x12a')](_0xb9aec2);_0x755736[_0xaa2d('0x85')]=moment()[_0xaa2d('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');var _0x3102f6=_0x40b054[_0xaa2d('0x13')][_0xb9aec2['queue']];if(ut['isFailure'](_0x27f924['response'])){if(_0xb9aec2[_0xaa2d('0x7e')]){rpcDb[_0xaa2d('0xfc')](_0xb9aec2[_0xaa2d('0x81')]);}if(_0xb9aec2[_0xaa2d('0x7f')]){rpcDb[_0xaa2d('0x5b')](_0xb9aec2[_0xaa2d('0x81')]);}ami[_0xaa2d('0x24')](_0xaa2d('0x12b'),ut['buildObj'](_0xb9aec2,'rejected',this['campaignsPreview'][_0xb9aec2[_0xaa2d('0x42')]]));this['callProgressDetectingAgent'](_0x755736,_0x3102f6,_0x27f924);}else{_0xb9aec2[_0xaa2d('0x5c')]=moment()[_0xaa2d('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0xaa2d('0xda')](_0x755736,0x4,_0xaa2d('0x92'));rpcDb[_0xaa2d('0xdb')](_0x755736,_0xaa2d('0x12c'));}}};Preview['prototype'][_0xaa2d('0x12d')]=function(_0x32dda7){var _0x589715=this[_0xaa2d('0x16')][_0x32dda7['linkedid']];var _0x1afb0c;if(_0x589715){_0x1afb0c=this[_0xaa2d('0x13')][_0x589715[_0xaa2d('0x42')]];logger['info'](_0xaa2d('0x12e'),_0x32dda7[_0xaa2d('0xcd')],_0xaa2d('0x88'),_0x1afb0c['name'],_0xaa2d('0x43'),_0x1afb0c[_0xaa2d('0x2b')]);}if(this[_0xaa2d('0x16')][_0x32dda7[_0xaa2d('0xcd')]]&&_0x32dda7[_0xaa2d('0xcd')]!==_0x32dda7[_0xaa2d('0x87')]){if(_0x32dda7[_0xaa2d('0x12f')]==='16'&&this['actions'][_0x32dda7[_0xaa2d('0xcd')]]['dialAnswer']){this[_0xaa2d('0x6e')](_0x32dda7,_0x32dda7[_0xaa2d('0xcd')],_0x32dda7[_0xaa2d('0x12f')]);}else if(this['actions'][_0x32dda7['linkedid']][_0xaa2d('0x44')]){logger[_0xaa2d('0x51')]('[syncHangup][talking][cause]',_0x32dda7[_0xaa2d('0xcd')],_0x32dda7['cause'],_0xaa2d('0x88'),_0x1afb0c['name'],_0xaa2d('0x43'),_0x1afb0c[_0xaa2d('0x2b')]);this[_0xaa2d('0x6e')](_0x32dda7,_0x32dda7[_0xaa2d('0xcd')],_0x32dda7[_0xaa2d('0x12f')]);}}else if(_0x589715&&_[_0xaa2d('0xe5')](_0x589715[_0xaa2d('0x130')])&&_0x1afb0c[_0xaa2d('0x131')]&&_0x32dda7[_0xaa2d('0xcd')]===_0x32dda7[_0xaa2d('0x87')]&&_[_0xaa2d('0xe5')](_0x32dda7[_0xaa2d('0xd8')])&&_0x32dda7['cause']==='16'&&_0x32dda7[_0xaa2d('0x132')]==='6'&&_[_0xaa2d('0xd7')](_0x589715[_0xaa2d('0x133')])){if(_0x589715[_0xaa2d('0x7e')]){rpcDb['unlockContact'](_0x589715[_0xaa2d('0x81')]);}if(_0x589715[_0xaa2d('0x7f')]){rpcDb['disableContact'](_0x589715[_0xaa2d('0x81')]);}_0x32dda7[_0xaa2d('0xd8')]='22';this[_0xaa2d('0xd6')](_0x589715,_0x1afb0c,_0x32dda7);}else if(_0x589715&&_0x589715[_0xaa2d('0x133')]){if(_0x32dda7[_0xaa2d('0x12f')]==='16'&&this[_0xaa2d('0x16')][_0x32dda7[_0xaa2d('0xcd')]][_0xaa2d('0x44')]){logger[_0xaa2d('0x51')](_0xaa2d('0x134'),_0x32dda7[_0xaa2d('0xcd')],_0x32dda7['cause'],_0xaa2d('0x88'),_0x1afb0c['name'],_0xaa2d('0x43'),_0x1afb0c[_0xaa2d('0x2b')]);this['callProgressDetectingCustomer'](_0x32dda7,_0x32dda7['linkedid'],_0x32dda7[_0xaa2d('0x12f')]);}else if(this[_0xaa2d('0x16')][_0x32dda7[_0xaa2d('0xcd')]]['dialAnswer']){logger[_0xaa2d('0x51')](_0xaa2d('0x135'),_0x32dda7[_0xaa2d('0xcd')],_0x32dda7[_0xaa2d('0x12f')],_0xaa2d('0x88'),_0x1afb0c[_0xaa2d('0x32')],_0xaa2d('0x43'),_0x1afb0c[_0xaa2d('0x2b')]);this[_0xaa2d('0x6e')](_0x32dda7,_0x32dda7[_0xaa2d('0xcd')],_0x32dda7[_0xaa2d('0x12f')]);}}};Preview[_0xaa2d('0xf')][_0xaa2d('0x136')]=function(_0x29e8f6){if(this[_0xaa2d('0x16')][_0x29e8f6[_0xaa2d('0xd4')]]&&_0x29e8f6[_0xaa2d('0xd4')]!==_0x29e8f6[_0xaa2d('0x137')]){this['callProgressDetectingCustomer'](_0x29e8f6,_0x29e8f6[_0xaa2d('0xd4')],_0x29e8f6[_0xaa2d('0xc9')]);}};Preview[_0xaa2d('0xf')][_0xaa2d('0x1d')]=function(_0x1599db){if(this[_0xaa2d('0x16')][_0x1599db[_0xaa2d('0xcd')]]&&_0x1599db[_0xaa2d('0xcd')]!==_0x1599db[_0xaa2d('0x87')]&&!this['actions'][_0x1599db['linkedid']][_0xaa2d('0x44')]){if(_0x1599db['cause']==='1'){this[_0xaa2d('0x6e')](_0x1599db,_0x1599db[_0xaa2d('0xcd')],_0x1599db[_0xaa2d('0x12f')]);}}};Preview[_0xaa2d('0xf')][_0xaa2d('0x138')]=function(_0x51087c,_0x263ca0,_0x30645f){if(this[_0xaa2d('0x16')][_0x51087c]){if(_['isNil'](this['actions'][_0x51087c][_0xaa2d('0x126')])){this[_0xaa2d('0x16')][_0x51087c]['variables']={};}this[_0xaa2d('0x16')][_0x51087c][_0xaa2d('0x126')][_0x263ca0]=_0x30645f;}};Preview['prototype'][_0xaa2d('0x139')]=function(_0x4c6a6e){try{if(!_[_0xaa2d('0xe5')](_0x4c6a6e)){if(ut[_0xaa2d('0x13a')](_[_0xaa2d('0x13b')](_0x4c6a6e[_0xaa2d('0x13c')])[0x0])){this[_0xaa2d('0x138')](_0x4c6a6e[_0xaa2d('0x87')],_[_0xaa2d('0x13b')](_0x4c6a6e[_0xaa2d('0x13c')])[0x0],_0x4c6a6e[_0xaa2d('0x13d')]);}}}catch(_0x19e8c5){logger[_0xaa2d('0x13e')](_0xaa2d('0x13f'),util[_0xaa2d('0x140')](_0x19e8c5,{'showHidden':![],'depth':null}));}};Preview[_0xaa2d('0xf')][_0xaa2d('0x141')]=function(_0x663736){if(_0x663736){if(this[_0xaa2d('0x16')][_0x663736[_0xaa2d('0x142')]]){this[_0xaa2d('0x16')][_0x663736[_0xaa2d('0x142')]][_0xaa2d('0x133')]=!![];}}};Preview[_0xaa2d('0xf')]['syncBlindTransfer']=function(_0x50a8a3){if(_0x50a8a3){if(this[_0xaa2d('0x16')][_0x50a8a3[_0xaa2d('0x143')]]){this[_0xaa2d('0x16')][_0x50a8a3['transfererlinkedid']][_0xaa2d('0x133')]=!![];}}};module[_0xaa2d('0x144')]=Preview; \ No newline at end of file +var _0x3772=['[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','dialCongestionRetryFrequency','congestion','[callProgressDetectingCustomer][logCongestion]','dialCongestionMaxRetry','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','outboundAbandonedCallsDay','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','[callProgressDetectingCustomer][machine]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','queueSummaryCountersUpdated','callProgressDetectingAgent','isUndefined','object','logAgent','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','Congestion','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[originated][decrement][callProgressDetectingAgent]','[swapAdditionalPhone]\x20','resolve','[incrementPreviewCounters]\x20','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','logBlacklist','createHistory','active','SIP/%s','reachable','unmonitored','execRun','unlock','getContactPreview','recallme','validateContact','isValid','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','Queue','ACTIVE','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','SIP/%s/%s%s','trim','substring','dialCutDigit','dialPrefix','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','originatecalleridnum','extractCalleridNumber','addVariables','setXMDContactVariables','assign','merge','toLowerVariables','variables','variablesAction','Action','OriginateError','[originateFailure][logOriginateFailure]','logLookAgent','clone','isFailure','response','unlockContact','custom:agentringnoanswer','rejected','Answer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','statedesc','reason','channelstate','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','syncDialEnd','destuniqueid','keys','variable','addVariable','value','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','moment','ioredis','../../../config/environment','../../../config/logger','../ami','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','./util/util','redis','localhost','socket.io-emitter','prototype','tail','finally','sequence','campaignsPreview','trunks','agents','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','newexten','syncNewExten','varset','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','format','voice:queue:%s','voice_queue_channel:remove','voice_queue_presence:remove','originated','pTalking','sendMessageOneNotActive','paused','message','CAMPAIGN_STATUS','logger','name','\x20is\x20not\x20active','DEACTIVATED','\x20is\x20deactivated','syncCampaigns','clockClearZombieChannels','hasOwnProperty','booked','outbound','clearZombieChannels','dialMethod','preview','type','dialActive','setMessage','clearZombieChannel','enqueue','isNil','actions','[clearZombieChannels][talking]','originated:\x20','queue','pick','contactId','UserId','VoiceQueueId','ListId','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','recallMe','getContactRecallMe','then','getDiff','scheduledat','Agent','run','logger2','[RecallMe]','disableContact','starttime','logCustomer','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','NO_AGENTS_LOGGED','isActive','isTrunkReachable','Trunk','TrunkBackup','UNREACHABLE_TRUNK','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','custom:agentnosuchnumber','buildObj','nosuchnumber','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','totalGlobal','dialGlobalMaxRetry','cloneAction','Global','rescheduleContact','scheduledAt','unlockAgent','activeContact','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','pTalking:\x20','acw','buildAcw','complete','outboundAnswerCallsDay','decrementTalkink','[16]','sumDuration','sumBillable','talktime','[syncHangup][talking][decrement]','\x20Queue','BUSY','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','dialBusyMaxRetry','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3772,0x1d5));var _0x2377=function(_0x1c443f,_0x51319d){_0x1c443f=_0x1c443f-0x0;var _0x4a4a71=_0x3772[_0x1c443f];return _0x4a4a71;};'use strict';var util=require(_0x2377('0x0'));var _=require(_0x2377('0x1'));var uuid=require(_0x2377('0x2'));var moment=require(_0x2377('0x3'));var Redis=require(_0x2377('0x4'));var config=require(_0x2377('0x5'));var logger=require(_0x2377('0x6'))('preview');var loggerAction=require(_0x2377('0x6'))('actionPreview');var ami=require(_0x2377('0x7'));var rpcDb=require(_0x2377('0x8'));var cmHopperAdditionalPhone=require(_0x2377('0x9'));var Action=require(_0x2377('0xa'));var ut=require(_0x2377('0xb'));var utils=require('../dialer/utils');config[_0x2377('0xc')]=_['defaults'](config[_0x2377('0xc')],{'host':_0x2377('0xd'),'port':0x18eb});var io=require(_0x2377('0xe'))(new Redis(config[_0x2377('0xc')]));var Sequence=function(){};Sequence[_0x2377('0xf')]['enqueue']=function(_0x565503){this['tail']=this[_0x2377('0x10')]?this[_0x2377('0x10')][_0x2377('0x11')](_0x565503):_0x565503();};function Preview(_0x4e765d){this[_0x2377('0x12')]=new Sequence();this[_0x2377('0x13')]=_0x4e765d['voiceQueues'];this[_0x2377('0x14')]=_0x4e765d['trunks'];this['actions']={};this[_0x2377('0x15')]=_0x4e765d[_0x2377('0x15')];this['clockClearZombieChannels']=0x0;ami['on']('originateresponse',this[_0x2377('0x16')][_0x2377('0x17')](this));ami['on'](_0x2377('0x18'),this[_0x2377('0x19')][_0x2377('0x17')](this));ami['on'](_0x2377('0x1a'),this[_0x2377('0x1b')][_0x2377('0x17')](this));ami['on'](_0x2377('0x1c'),this['syncDialEnd']['bind'](this));ami['on'](_0x2377('0x1d'),this[_0x2377('0x1e')][_0x2377('0x17')](this));ami['on'](_0x2377('0x1f'),this['syncVarSet']['bind'](this));ami['on'](_0x2377('0x20'),this[_0x2377('0x21')][_0x2377('0x17')](this));ami['on'](_0x2377('0x22'),this[_0x2377('0x23')][_0x2377('0x17')](this));this[_0x2377('0x24')](this[_0x2377('0x13')]);}function emit(_0x34b17e,_0x127011,_0x2604f9){io['to'](_0x34b17e)[_0x2377('0x25')](_0x127011,_0x2604f9);}function emitVoiceQueueChannelRemove(_0x508a36){logger[_0x2377('0x26')](_0x2377('0x27'),JSON[_0x2377('0x28')](_0x508a36));emit(util[_0x2377('0x29')](_0x2377('0x2a'),_0x508a36['name']),_0x2377('0x2b'),_0x508a36);io[_0x2377('0x25')](_0x2377('0x2c'),_0x508a36);}function notSendMessagesQueue(_0x2a7026){if(_0x2a7026['sendMessageOneNotActive']){if(_0x2a7026[_0x2377('0x2d')]===0x0&&_0x2a7026[_0x2377('0x2e')]===0x0){_0x2a7026[_0x2377('0x2f')]=![];_0x2a7026['available']=0x0;_0x2a7026[_0x2377('0x30')]=0x0;_0x2a7026[_0x2377('0x31')]=utils[_0x2377('0x32')]['INACTIVE'];ut[_0x2377('0x33')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x2a7026[_0x2377('0x34')]+_0x2377('0x35'));}else{_0x2a7026[_0x2377('0x31')]=utils['CAMPAIGN_STATUS'][_0x2377('0x36')];ut[_0x2377('0x33')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x2a7026['name']+_0x2377('0x37'));}}}Preview[_0x2377('0xf')][_0x2377('0x24')]=function(){var _0xf91a0d=this;setInterval(function(){_0xf91a0d[_0x2377('0x38')]();},0x7cf);};Preview[_0x2377('0xf')]['syncCampaigns']=function(){var _0x230cf2=this['campaignsPreview'];this[_0x2377('0x39')]+=0x1;for(var _0x5aa89f in _0x230cf2){if(_0x230cf2[_0x2377('0x3a')](_0x5aa89f)&&(_0x230cf2[_0x5aa89f]['dialMethod']==='preview'||_0x230cf2[_0x5aa89f]['dialMethod']===_0x2377('0x3b'))&&_0x230cf2[_0x5aa89f]['type']===_0x2377('0x3c')){if(this[_0x2377('0x39')]>0x7){this[_0x2377('0x39')]=0x0;this[_0x2377('0x3d')]();}}if(_0x230cf2[_0x2377('0x3a')](_0x5aa89f)&&_0x230cf2[_0x5aa89f][_0x2377('0x3e')]===_0x2377('0x3f')&&_0x230cf2[_0x5aa89f][_0x2377('0x40')]==='outbound'){if(_0x230cf2[_0x5aa89f][_0x2377('0x41')]){this[_0x2377('0x42')](_0x230cf2[_0x5aa89f]);if(_0x230cf2[_0x5aa89f]['dialPreviewAutoRecallMe'])this['recallMe'](_0x230cf2[_0x5aa89f]);}else{notSendMessagesQueue(_0x230cf2[_0x5aa89f]);}}}};Preview[_0x2377('0xf')][_0x2377('0x43')]=function(_0x46ffd1){var _0x37afda=this;this['sequence'][_0x2377('0x44')](function(){if(!_[_0x2377('0x45')](_0x37afda[_0x2377('0x46')][_0x46ffd1])){loggerAction['info'](_0x2377('0x47'),_0x46ffd1,'Queue',_0x37afda['actions'][_0x46ffd1]['queue'],_0x2377('0x48'),JSON[_0x2377('0x28')](_0x37afda[_0x2377('0x13')][_0x37afda[_0x2377('0x46')][_0x46ffd1][_0x2377('0x49')]][_0x2377('0x2d')]),'pTalking:\x20',JSON[_0x2377('0x28')](_0x37afda[_0x2377('0x13')][_0x37afda[_0x2377('0x46')][_0x46ffd1][_0x2377('0x49')]][_0x2377('0x2e')]),JSON[_0x2377('0x28')](_0x37afda[_0x2377('0x46')][_0x46ffd1]['dialAnswer']),JSON[_0x2377('0x28')](_[_0x2377('0x4a')](_0x37afda[_0x2377('0x46')][_0x46ffd1],[_0x2377('0x4b'),_0x2377('0x4c'),_0x2377('0x4d'),_0x2377('0x4e')])));return ami['Action']({'action':_0x2377('0x4f'),'channel':_0x37afda[_0x2377('0x46')][_0x46ffd1][_0x2377('0x50')]})[_0x2377('0x51')](function(_0x543281){if(_0x543281['message']===_0x2377('0x52')){setTimeout(function(){if(_0x37afda[_0x2377('0x46')][_0x46ffd1]){ut[_0x2377('0x53')](_0x37afda['campaignsPreview'][_0x37afda[_0x2377('0x46')][_0x46ffd1]['queue']],_0x2377('0x54'));if(_0x37afda[_0x2377('0x46')][_0x46ffd1][_0x2377('0x55')]===!![]){ut['decrementTalkink'](_0x37afda[_0x2377('0x13')][_0x37afda[_0x2377('0x46')][_0x46ffd1][_0x2377('0x49')]],_0x2377('0x54'));ut[_0x2377('0x56')](_0x2377('0x57')+_0x46ffd1,_0x37afda['actions'][_0x46ffd1][_0x2377('0x49')]);}ut[_0x2377('0x56')](_0x2377('0x58')+_0x46ffd1,_0x37afda[_0x2377('0x46')][_0x46ffd1][_0x2377('0x49')]);delete _0x37afda[_0x2377('0x46')][_0x46ffd1];}},0x2328);}});}});};Preview[_0x2377('0xf')]['clearZombieChannels']=function(){var _0x98d64a=this;loggerAction[_0x2377('0x26')](_0x2377('0x59'),_[_0x2377('0x5a')](this[_0x2377('0x46')]));for(var _0x8c9bfc in this['actions']){if(_0x98d64a[_0x2377('0x46')][_0x2377('0x3a')](_0x8c9bfc)){_0x98d64a[_0x2377('0x43')](_0x8c9bfc);}}};Preview[_0x2377('0xf')][_0x2377('0x5b')]=function(_0x50bf54){var _0x3a49b2=this;rpcDb[_0x2377('0x5c')](_0x50bf54['id'],ut['agentReadyId'](this[_0x2377('0x15')]))[_0x2377('0x5d')](function(_0x920eb2){if(!_['isNil'](_0x920eb2)){for(var _0x229a56=0x0;_0x229a56<_0x920eb2['length'];_0x229a56+=0x1){if(ut[_0x2377('0x5e')](_0x920eb2[_0x229a56][_0x2377('0x5f')])<_0x50bf54['dialRecallMeTimeout']*0x3c){if(_0x920eb2[_0x229a56][_0x2377('0x60')]&&!_0x920eb2[_0x229a56][_0x2377('0x60')]['voicePause']){_0x3a49b2[_0x2377('0x61')](_0x920eb2[_0x229a56]['id'])[_0x2377('0x5d')](ut[_0x2377('0x62')]('[RecallMe]'))[_0x2377('0x51')](ut[_0x2377('0x62')](_0x2377('0x63')));}else{rpcDb[_0x2377('0x64')](_0x920eb2[_0x229a56]['id']);}}else{var _0x24de1d=new Action(_0x920eb2[_0x229a56],_0x50bf54);_0x24de1d[_0x2377('0x65')]=moment()[_0x2377('0x29')]('YYYY-MM-DD\x20HH:mm:ss');_0x50bf54['outboundReCallsDay']+=0x1;ut[_0x2377('0x66')](_0x24de1d,0x17,_0x2377('0x67'));if(_0x50bf54['dialRecallInQueue']){rpcDb[_0x2377('0x68')](ut[_0x2377('0x69')](_0x920eb2[_0x229a56]));rpcDb[_0x2377('0x6a')](_0x24de1d,_0x2377('0x6b'));}else{ut['logCustomer'](_0x24de1d,0x16,_0x2377('0x6c'));rpcDb['createCustomerHistory'](_0x24de1d,_0x2377('0x6d'));rpcDb[_0x2377('0x6e')](_0x24de1d,'[HistoryRecallClose]');}}}}})[_0x2377('0x51')](ut[_0x2377('0x62')](_0x2377('0x6f')));};Preview['prototype'][_0x2377('0x42')]=function(_0x1528a5){_0x1528a5[_0x2377('0x2f')]=!![];if(ut['IsNotLoggedIn'](_0x1528a5['loggedIn'])){_0x1528a5[_0x2377('0x31')]=utils[_0x2377('0x32')][_0x2377('0x70')];}else if(!ut[_0x2377('0x71')](_0x1528a5['dialActive'])){_0x1528a5[_0x2377('0x31')]=utils[_0x2377('0x32')]['INACTIVE'];}else if(!this[_0x2377('0x72')](_0x1528a5[_0x2377('0x73')])){if(!this[_0x2377('0x72')](_0x1528a5[_0x2377('0x74')])){_0x1528a5[_0x2377('0x31')]=utils[_0x2377('0x32')][_0x2377('0x75')];}else{_0x1528a5[_0x2377('0x31')]=utils[_0x2377('0x32')]['ACTIVE'];}}else{_0x1528a5[_0x2377('0x31')]=utils[_0x2377('0x32')]['ACTIVE'];}};Preview[_0x2377('0xf')][_0x2377('0x76')]=function(_0x35ade3,_0xd70833,_0x5da173){var _0xef214e=this;var _0x457787=this['actions'][_0xd70833];var _0x237d35=this[_0x2377('0x13')][_0x457787['queue']];var _0x25852e;var _0x377f2e=![];var _0x4a6e83=0x2;var _0x491529=0x3;if(_0x237d35){switch(_0x5da173){case'1':_0x237d35[_0x2377('0x77')]+=0x1;_0x457787[_0x2377('0x78')]+=0x1;_0x457787[_0x2377('0x79')]=ut['totalGlobal'](_0x457787);ut[_0x2377('0x66')](_0x457787,0x0,'NoSuchNumber');ami[_0x2377('0x25')](_0x2377('0x7a'),ut[_0x2377('0x7b')](_0x457787,_0x2377('0x7c')));rpcDb['createCustomerHistory'](_0x457787,'[callProgressDetectingCustomer][logNoSuch]');_0xef214e[_0x2377('0x7d')](_0x457787,'0',_0x237d35)['then'](function(_0x4a3a8d){_0x377f2e=_0x4a3a8d[_0x2377('0x7e')]==0x1;_0x4a6e83=_0x237d35[_0x2377('0x7f')];_0x491529=_0x237d35[_0x2377('0x80')];if(!_0x377f2e){if(ut[_0x2377('0x81')](_0x457787)>=_0x237d35[_0x2377('0x82')]){_0x25852e=ut[_0x2377('0x83')](_0x457787,0xf,_0x2377('0x84'));rpcDb['createCustomerFinal'](_0x25852e,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x457787[_0x2377('0x78')]>=_0x237d35['dialNoSuchNumberMaxRetry']){rpcDb['createCustomerFinal'](_0x457787,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0x2377('0x85')](ut[_0x2377('0x86')](_0x457787,_0x2377('0x78'),_0x237d35['dialNoSuchNumberRetryFrequency']),_0x457787[_0x2377('0x87')],_0x457787[_0x2377('0x88')]);}}delete this[_0x2377('0x46')][_0x35ade3[_0x2377('0x89')]];}else{_0x457787['countnosuchnumberretry']++;logger[_0x2377('0x26')](_0x2377('0x8a'),_0x457787[_0x2377('0x78')]);logger['info']('id',_0x457787[_0x2377('0x8b')]);_0xef214e[_0x2377('0x8c')]({'id':_0x457787['idContact'],'field':{'countnosuchnumberretry':_0x457787['countnosuchnumberretry']}})['then'](function(){_0xef214e[_0x2377('0x8d')](_0x457787,_0x4a6e83,_0x491529)[_0x2377('0x5d')](function(){});});}});break;case _0x2377('0x8e'):var _0x43a66e=moment()['format'](_0x2377('0x8f'));_0x457787[_0x2377('0x90')]=_0x43a66e;_0x457787[_0x2377('0x91')]=_0x43a66e;_0x457787['dialAnswer']=!![];_0x237d35[_0x2377('0x2e')]+=0x1;logger[_0x2377('0x26')](_0x2377('0x92'),_0x457787[_0x2377('0x93')],'\x20Queue',_0x237d35[_0x2377('0x34')],_0x2377('0x94'),_0x237d35[_0x2377('0x2e')]);ami[_0x2377('0x25')]('custom:agentconnect',ut[_0x2377('0x7b')](_0x457787,'connect',this[_0x2377('0x13')][_0x457787[_0x2377('0x49')]]));if(_0x237d35[_0x2377('0x95')]){ami[_0x2377('0x25')]('custom:agentConnectPreview',ut[_0x2377('0x96')](_0x457787));}break;case'16':ami[_0x2377('0x25')]('custom:agentcomplete',ut[_0x2377('0x7b')](_0x457787,_0x2377('0x97'),this['campaignsPreview'][_0x457787[_0x2377('0x49')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x457787,'complete'));_0x237d35[_0x2377('0x98')]+=0x1;_0x237d35['total']+=0x1;_0x237d35['answered']+=0x1;ut[_0x2377('0x99')](_0x237d35,_0x2377('0x9a'));_0x457787[_0x2377('0x79')]=ut[_0x2377('0x81')](_0x457787);ut['logCustomer'](_0x457787,0x4,'Answer');rpcDb['createCustomerHistory'](_0x457787,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0x2377('0x6e')](_0x457787,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb['crateCustomerReportQueue'](_0x457787);_0x237d35[_0x2377('0x9b')]+=_0x457787['talktime'];_0x237d35[_0x2377('0x9c')]+=_0x457787[_0x2377('0x9d')];logger[_0x2377('0x26')](_0x2377('0x9e'),_0x457787['uniqueid'],_0x2377('0x9f'),_0x237d35['name'],_0x2377('0x94'),_0x237d35[_0x2377('0x2e')]);delete this[_0x2377('0x46')][_0x35ade3[_0x2377('0x89')]];break;case _0x2377('0xa0'):_0x237d35[_0x2377('0xa1')]+=0x1;_0x457787[_0x2377('0xa2')]+=0x1;_0x457787[_0x2377('0x79')]=ut[_0x2377('0x81')](_0x457787);ut[_0x2377('0x66')](_0x457787,0x5,_0x2377('0xa3'));_0x4a6e83=_0x237d35[_0x2377('0xa4')];_0x491529=_0x237d35['callAdditionalPhoneAfterMin'];ami[_0x2377('0x25')](_0x2377('0xa5'),ut[_0x2377('0x7b')](_0x457787,_0x2377('0xa6')));rpcDb[_0x2377('0x6a')](_0x457787,_0x2377('0xa7'));_0xef214e[_0x2377('0x7d')](_0x457787,'5',_0x237d35)['then'](function(_0x134b6c){_0x377f2e=_0x134b6c[_0x2377('0x7e')]==0x1;if(!_0x377f2e){if(ut[_0x2377('0x81')](_0x457787)>=_0x237d35[_0x2377('0x82')]){_0x25852e=ut[_0x2377('0x83')](_0x457787,0xf,_0x2377('0x84'));rpcDb[_0x2377('0x6e')](_0x25852e,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x457787[_0x2377('0xa2')]>=_0x237d35[_0x2377('0xa8')]){rpcDb[_0x2377('0x6e')](_0x457787,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x2377('0x85')](ut[_0x2377('0x86')](_0x457787,'countbusyretry',_0x237d35[_0x2377('0xa4')]),_0x457787[_0x2377('0x87')],_0x457787[_0x2377('0x88')]);}}}else{_0x457787['countbusyretry']++;_0xef214e[_0x2377('0x8c')]({'id':_0x457787[_0x2377('0x8b')],'field':{'countbusyretry':_0x457787[_0x2377('0xa2')]}})[_0x2377('0x5d')](function(){_0xef214e[_0x2377('0x8d')](_0x457787,_0x4a6e83,_0x491529)[_0x2377('0x5d')](function(){});});}});break;case _0x2377('0xa9'):_0x237d35[_0x2377('0xaa')]+=0x1;_0x457787[_0x2377('0xab')]+=0x1;_0x457787[_0x2377('0x79')]=ut['totalGlobal'](_0x457787);ut[_0x2377('0x66')](_0x457787,0x3,_0x2377('0xac'));_0x4a6e83=_0x237d35['dialNoAnswerRetryFrequency'];_0x491529=_0x237d35['callAdditionalPhoneAfterMin'];var _0x49d4ea=ut[_0x2377('0xad')](_0x457787,_0x237d35);ami['emit'](_0x2377('0xae'),_0x49d4ea);rpcDb[_0x2377('0x6a')](_0x457787,_0x2377('0xaf'));_0xef214e['verifyAdditionalPhones'](_0x457787,'3',_0x237d35)[_0x2377('0x5d')](function(_0x2ada40){_0x377f2e=_0x2ada40[_0x2377('0x7e')]==0x1;if(!_0x377f2e){if(ut[_0x2377('0x81')](_0x457787)>=_0x237d35[_0x2377('0x82')]){_0x25852e=ut['cloneAction'](_0x457787,0xf,_0x2377('0x84'));rpcDb['createCustomerFinal'](_0x25852e,_0x2377('0xb0'));}else{if(_0x457787[_0x2377('0xab')]>=_0x237d35[_0x2377('0xb1')]){rpcDb['createCustomerFinal'](_0x457787,_0x2377('0xaf'));}else{rpcDb[_0x2377('0x85')](ut['scheduledAt'](_0x457787,_0x2377('0xab'),_0x237d35[_0x2377('0xb2')]),_0x457787['unlockAgent'],_0x457787[_0x2377('0x88')]);}}}else{_0x457787[_0x2377('0xab')]++;_0xef214e[_0x2377('0x8c')]({'id':_0x457787[_0x2377('0x8b')],'field':{'countnoanswerretry':_0x457787[_0x2377('0xab')]}})[_0x2377('0x5d')](function(){_0xef214e[_0x2377('0x8d')](_0x457787,_0x4a6e83,_0x491529)['then'](function(){});});}});break;case _0x2377('0xb3'):_0x237d35['outboundCongestionCallsDay']+=0x1;_0x457787[_0x2377('0xb4')]+=0x1;_0x457787[_0x2377('0x79')]=ut['totalGlobal'](_0x457787);ut['logCustomer'](_0x457787,0x8,'Congestion');_0x4a6e83=_0x237d35[_0x2377('0xb5')];_0x491529=_0x237d35['callAdditionalPhoneAfterMin'];ami[_0x2377('0x25')]('custom:agentcongestion',ut[_0x2377('0x7b')](_0x457787,_0x2377('0xb6')));rpcDb['createCustomerHistory'](_0x457787,_0x2377('0xb7'));_0xef214e[_0x2377('0x7d')](_0x457787,'8',_0x237d35)[_0x2377('0x5d')](function(_0x48c71c){_0x377f2e=_0x48c71c[_0x2377('0x7e')]==0x1;if(!_0x377f2e){if(ut[_0x2377('0x81')](_0x457787)>=_0x237d35[_0x2377('0x82')]){_0x25852e=ut[_0x2377('0x83')](_0x457787,0xf,_0x2377('0x84'));rpcDb[_0x2377('0x6e')](_0x25852e,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x457787['countcongestionretry']>=_0x237d35[_0x2377('0xb8')]){rpcDb['createCustomerFinal'](_0x457787,_0x2377('0xb7'));}else{rpcDb[_0x2377('0x85')](ut[_0x2377('0x86')](_0x457787,_0x2377('0xb4'),_0x237d35['dialBusyRetryFrequency']),_0x457787[_0x2377('0x87')],_0x457787['activeContact']);}}}else{_0x457787['countcongestionretry']++;_0xef214e[_0x2377('0x8c')]({'id':_0x457787['idContact'],'field':{'countcongestionretry':_0x457787[_0x2377('0xb4')]}})[_0x2377('0x5d')](function(){_0xef214e['swapAdditionalPhones'](_0x457787,_0x4a6e83,_0x491529)['then'](function(){});});}});break;case _0x2377('0xb9'):_0x237d35[_0x2377('0xba')]+=0x1;_0x457787[_0x2377('0xbb')]+=0x1;_0x457787[_0x2377('0x79')]=ut[_0x2377('0x81')](_0x457787);ut[_0x2377('0x66')](_0x457787,0x14,_0x2377('0xbc'));_0x4a6e83=_0x237d35['dialAgentRejectRetryFrequency'];_0x491529=_0x237d35[_0x2377('0x80')];ami[_0x2377('0x25')]('custom:agentreject',ut[_0x2377('0x7b')](_0x457787,_0x2377('0xbd')));rpcDb[_0x2377('0x6a')](_0x457787,_0x2377('0xbe'));_0xef214e[_0x2377('0x7d')](_0x457787,'20',_0x237d35)['then'](function(_0x37d1d3){_0x377f2e=_0x37d1d3[_0x2377('0x7e')]==0x1;if(!_0x377f2e){if(ut[_0x2377('0x81')](_0x457787)>=_0x237d35[_0x2377('0x82')]){_0x25852e=ut[_0x2377('0x83')](_0x457787,0x14,_0x2377('0xbc'));rpcDb[_0x2377('0x6e')](_0x25852e,_0x2377('0xbf'));}else{if(_0x457787[_0x2377('0xbb')]>=_0x237d35[_0x2377('0xc0')]){rpcDb[_0x2377('0x6e')](_0x457787,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x2377('0x85')](ut[_0x2377('0x86')](_0x457787,_0x2377('0xbb'),_0x237d35[_0x2377('0xc1')]),_0x457787[_0x2377('0x87')],_0x457787[_0x2377('0x88')]);}}}else{_0x457787[_0x2377('0xab')]++;_0xef214e[_0x2377('0x8c')]({'id':_0x457787['idContact'],'field':{'countnoanswerretry':_0x457787[_0x2377('0xab')]}})[_0x2377('0x5d')](function(){_0xef214e[_0x2377('0x8d')](_0x457787,_0x4a6e83,_0x491529)[_0x2377('0x5d')](function(){});});}});break;case'ABANDONED':_0x237d35[_0x2377('0xc2')]+=0x1;_0x457787[_0x2377('0xc3')]+=0x1;_0x457787['countglobal']=ut[_0x2377('0x81')](_0x457787);ut['logCustomer'](_0x457787,0xb,'Abandoned');rpcDb[_0x2377('0x6a')](_0x457787,_0x2377('0xc4'));_0xef214e[_0x2377('0x7d')](_0x457787,'11',_0x237d35)[_0x2377('0x5d')](function(_0x47a393){_0x377f2e=_0x47a393[_0x2377('0x7e')]==0x1;if(!_0x377f2e){if(ut['totalGlobal'](_0x457787)>=_0x237d35[_0x2377('0x82')]){_0x25852e=ut[_0x2377('0x83')](_0x457787,0xf,_0x2377('0x84'));rpcDb[_0x2377('0x6e')](_0x25852e,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x457787[_0x2377('0xc5')]>=_0x237d35['dialAbandonedMaxRety']){rpcDb[_0x2377('0x6e')](_0x457787,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x457787,'countabandonedretry',_0x237d35[_0x2377('0xc6')]),_0x457787[_0x2377('0x87')],_0x457787[_0x2377('0x88')]);}}}else{_0x457787[_0x2377('0xab')]++;_0xef214e['incrementPreviewCounters']({'id':_0x457787[_0x2377('0x8b')],'field':{'countnoanswerretry':_0x457787[_0x2377('0xab')]}})[_0x2377('0x5d')](function(){_0xef214e[_0x2377('0x8d')](_0x457787,_0x4a6e83,_0x491529)[_0x2377('0x5d')](function(){});});}});break;case'18':_0x237d35['outboundUnknownCallsDay']+=0x1;_0x457787[_0x2377('0xc7')]+=0x1;_0x457787[_0x2377('0x79')]=ut[_0x2377('0x81')](_0x457787);ut[_0x2377('0x66')](_0x457787,0x12,_0x35ade3[_0x2377('0xc8')]||_0x35ade3[_0x2377('0xc9')]);ami[_0x2377('0x25')](_0x2377('0xca'),ut['buildObj'](_0x457787,'amd'));rpcDb[_0x2377('0x6a')](_0x457787,_0x2377('0xcb'));_0xef214e[_0x2377('0x7d')](_0x457787,'18',_0x237d35)['then'](function(_0x455332){_0x377f2e=_0x455332[_0x2377('0x7e')]==0x1;if(!_0x377f2e){if(ut[_0x2377('0x81')](_0x457787)>=_0x237d35[_0x2377('0x82')]){_0x25852e=ut[_0x2377('0x83')](_0x457787,0x12,'Global');rpcDb['createCustomerFinal'](_0x25852e,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0x2377('0x6e')](_0x457787,_0x2377('0xcb'));}}else{_0x457787['countnoanswerretry']++;_0xef214e['incrementPreviewCounters']({'id':_0x457787[_0x2377('0x8b')],'field':{'countnoanswerretry':_0x457787[_0x2377('0xab')]}})[_0x2377('0x5d')](function(){_0xef214e[_0x2377('0x8d')](_0x457787,_0x4a6e83,_0x491529)['then'](function(){});});}});delete this[_0x2377('0x46')][_0x35ade3[_0x2377('0x89')]];break;case'19':_0x237d35[_0x2377('0xcc')]+=0x1;_0x457787['countglobal']=ut[_0x2377('0x81')](_0x457787);ut[_0x2377('0x66')](_0x457787,0x13,_0x35ade3[_0x2377('0xc8')]||_0x35ade3[_0x2377('0xc9')]);ami[_0x2377('0x25')](_0x2377('0xca'),ut['buildObj'](_0x457787,'amd'));rpcDb['createCustomerHistory'](_0x457787,_0x2377('0xcd'));_0xef214e[_0x2377('0x7d')](_0x457787,'18',_0x237d35)[_0x2377('0x5d')](function(_0x342d3c){_0x377f2e=_0x342d3c[_0x2377('0x7e')]==0x1;if(!_0x377f2e){if(ut['totalGlobal'](_0x457787)>=_0x237d35['dialGlobalMaxRetry']){_0x25852e=ut[_0x2377('0x83')](_0x457787,0xf,_0x2377('0x84'));rpcDb['createCustomerFinal'](_0x25852e,_0x2377('0xcd'));}else{rpcDb[_0x2377('0x6e')](_0x457787,_0x2377('0xcd'));}}else{_0x457787['countnoanswerretry']++;_0xef214e[_0x2377('0x8c')]({'id':_0x457787[_0x2377('0x8b')],'field':{'countnoanswerretry':_0x457787[_0x2377('0xab')]}})['then'](function(){_0xef214e[_0x2377('0x8d')](_0x457787,_0x4a6e83,_0x491529)[_0x2377('0x5d')](function(){});});}});delete this[_0x2377('0x46')][_0x35ade3['linkedid']];break;default:if(_0x457787[_0x2377('0x55')]){ut[_0x2377('0x99')](_0x237d35,'[default]');ut[_0x2377('0x56')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x237d35[_0x2377('0x34')],_0x35ade3);}_0x237d35[_0x2377('0xcc')]+=0x1;_0x457787[_0x2377('0x79')]=ut[_0x2377('0x81')](_0x457787);ut[_0x2377('0x66')](_0x457787,0xc,_0x35ade3[_0x2377('0xc8')]||_0x35ade3['dialstatus']);_0x4a6e83=_0x237d35[_0x2377('0xc1')];_0x491529=_0x237d35[_0x2377('0x80')];rpcDb['createCustomerHistory'](_0x457787,_0x2377('0xce'));_0xef214e[_0x2377('0x7d')](_0x457787,'20',_0x237d35)[_0x2377('0x5d')](function(_0x564ece){_0x377f2e=_0x564ece[_0x2377('0x7e')]==0x1;if(!_0x377f2e){if(ut[_0x2377('0x81')](_0x457787)>=_0x237d35[_0x2377('0x82')]){_0x25852e=ut[_0x2377('0x83')](_0x457787,0xf,'Global');rpcDb[_0x2377('0x6e')](_0x25852e,_0x2377('0xcf'));}else{rpcDb[_0x2377('0x6e')](_0x457787,_0x2377('0xcf'));}delete this[_0x2377('0x46')][_0x35ade3['linkedid']];}else{_0xef214e[_0x2377('0x8d')](_0x457787,_0x4a6e83,_0x491529)[_0x2377('0x5d')](function(){});}});}if(!(_0x457787[_0x2377('0x55')]&&_0x5da173==='16')){ut['updateOriginated'](_0x237d35,_0x2377('0xd0'));logger['info'](_0x2377('0xd1'),_0x457787[_0x2377('0x93')],_0x2377('0x9f'),_0x237d35[_0x2377('0x34')],_0x2377('0x48'),_0x237d35[_0x2377('0x2d')]);}if(_0x5da173!==_0x2377('0x8e')){delete this[_0x2377('0x46')][_0x35ade3[_0x2377('0x89')]];delete this['actions'][_0x35ade3[_0x2377('0xd2')]];}_0x237d35[_0x2377('0xd3')]=!![];}};Preview['prototype'][_0x2377('0xd4')]=function(_0x5dffcd,_0x50d55c,_0x128d51){if(_[_0x2377('0xd5')](_0x50d55c)&&_0x2377('0xd6')!==typeof _0x50d55c){return;}if(_['isUndefined'](_0x128d51)&&_0x2377('0xd6')!==typeof _0x128d51){return;}switch(_0x128d51['reason']){case'0':ut[_0x2377('0xd7')](_0x5dffcd,0x0,_0x2377('0xd8'));rpcDb['createAgentHistory'](_0x5dffcd,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0x2377('0xd7')](_0x5dffcd,0x3,'NoAnswer');rpcDb[_0x2377('0xd9')](_0x5dffcd,_0x2377('0xda'));break;case'5':ut['logAgent'](_0x5dffcd,0x5,_0x2377('0xa3'));rpcDb[_0x2377('0xd9')](_0x5dffcd,_0x2377('0xdb'));break;case'8':ut[_0x2377('0xd7')](_0x5dffcd,0x8,_0x2377('0xdc'));rpcDb[_0x2377('0xd9')](_0x5dffcd,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x2377('0xd7')](_0x5dffcd,0x16,_0x2377('0xdd'));rpcDb[_0x2377('0xd9')](_0x5dffcd,_0x2377('0xde'));break;default:ut[_0x2377('0xd7')](_0x5dffcd,0xc,_0x128d51['reason']);rpcDb['createAgentHistory'](_0x5dffcd,_0x2377('0xdf'));}ut[_0x2377('0x53')](_0x50d55c,'[callProgressDetectingAgent]');logger[_0x2377('0x26')](_0x2377('0xe0'),_0x5dffcd[_0x2377('0x93')],_0x2377('0x9f'),_0x50d55c[_0x2377('0x34')],_0x2377('0x48'),_0x50d55c[_0x2377('0x2d')]);delete this[_0x2377('0x46')][_0x5dffcd[_0x2377('0x93')]];};Preview[_0x2377('0xf')][_0x2377('0x7d')]=function(_0x49aef4,_0x588e6c,_0x2513a7){return cmHopperAdditionalPhone[_0x2377('0x7d')](_0x49aef4,_0x588e6c,_0x2513a7)['catch'](logger[_0x2377('0x26')]('[verifyAdditionalPhone]\x20'));};Preview[_0x2377('0xf')][_0x2377('0x8d')]=function(_0x14ed45,_0x9dec84,_0x5916ce){return cmHopperAdditionalPhone[_0x2377('0x8d')](_0x14ed45,_0x9dec84,_0x5916ce)[_0x2377('0x51')](logger[_0x2377('0x26')](_0x2377('0xe1')));};Preview['prototype']['incrementPreviewCounters']=function(_0x491f37){return Promise[_0x2377('0xe2')]()[_0x2377('0x5d')](cmHopperAdditionalPhone['incrementPreviewCounters'](_0x491f37))[_0x2377('0x51')](logger[_0x2377('0x26')](_0x2377('0xe3')));};Preview[_0x2377('0xf')][_0x2377('0xe4')]=function(_0x3d8478,_0x348572,_0x468dab,_0xdc86f5,_0x2899b1){var _0x177573=this;return new Promise(function(_0x325c95,_0x471bfe){if(_[_0x2377('0x45')](_0x348572)||_['isNil'](_0x348572[_0x2377('0xe5')])||_[_0x2377('0x45')](_0x348572[_0x2377('0xe6')])||_['isNil'](_0x348572[_0x2377('0x4d')])){_0x471bfe(ut['message'](_0x2377('0xe7'),_0xdc86f5,_0x2899b1));return;}var _0x24ccbb=uuid['v4']();var _0x13ccf3=_0x177573[_0x2377('0x13')][_0x348572['Queue'][_0x2377('0x34')]];var _0x5b28cc=_0x468dab?_0x177573['agents'][_0x468dab]['id']:undefined;_0x177573[_0x2377('0x46')][_0x24ccbb]=new Action(_0x348572,_0x13ccf3,_0x24ccbb,_0x468dab,_0x5b28cc);var _0x4411f4=_0x177573[_0x2377('0x46')][_0x24ccbb];_0x4411f4[_0x2377('0x87')]=_0xdc86f5;_0x4411f4[_0x2377('0x88')]=_0x2899b1;_0x4411f4[_0x2377('0xe8')]=_0x468dab;if(_[_0x2377('0xe9')](_0x3d8478)){_0x177573['execCall'](_0x4411f4,_0x13ccf3,_0x348572,_0x468dab)[_0x2377('0x5d')](function(_0x3e917d){logger['info'](_0x2377('0xea'),_0x2377('0xeb')+_0x4411f4[_0x2377('0x49')]+_0x2377('0xec')+_0x4411f4[_0x2377('0x8b')],JSON[_0x2377('0x28')](_0x3e917d));ami[_0x2377('0x25')](_0x2377('0xed'),ut['buildObj'](_0x4411f4,_0x2377('0xee'),_0x177573[_0x2377('0x13')][_0x4411f4[_0x2377('0x49')]]));_0x325c95(ut['message'](_0x2377('0xef')));})[_0x2377('0x51')](function(_0x3fc8e7){ut[_0x2377('0x33')](_0x2377('0xf0'),_0x3fc8e7);_0x471bfe(ut[_0x2377('0x31')]('Call\x20failed',_0xdc86f5,_0x2899b1));});}else{_0x13ccf3['outboundBlacklistCallsDay']+=0x1;ut[_0x2377('0xf1')](_0x4411f4);rpcDb[_0x2377('0xf2')](_0x4411f4,'[Blacklist][error]');delete _0x177573[_0x2377('0x46')][_0x24ccbb];_0x471bfe(ut[_0x2377('0x31')]('Contact\x20in\x20black\x20List',_0xdc86f5,_0x2899b1));}});};Preview[_0x2377('0xf')][_0x2377('0x72')]=function(_0x54d27c){return!_['isNil'](_0x54d27c)&&!_[_0x2377('0x45')](_0x54d27c[_0x2377('0x34')])&&!_['isNil'](_0x54d27c[_0x2377('0xf3')])&&_0x54d27c['active']&&!_[_0x2377('0x45')](this[_0x2377('0x14')][util[_0x2377('0x29')](_0x2377('0xf4'),_0x54d27c[_0x2377('0x34')])])&&!_[_0x2377('0x45')](this[_0x2377('0x14')][util[_0x2377('0x29')](_0x2377('0xf4'),_0x54d27c[_0x2377('0x34')])][_0x2377('0x4f')])&&(this[_0x2377('0x14')][util[_0x2377('0x29')](_0x2377('0xf4'),_0x54d27c[_0x2377('0x34')])][_0x2377('0x4f')]===_0x2377('0xf5')||this['trunks'][util[_0x2377('0x29')]('SIP/%s',_0x54d27c[_0x2377('0x34')])][_0x2377('0x4f')]===_0x2377('0xf6'));};Preview[_0x2377('0xf')][_0x2377('0x61')]=function(_0xd6a7ac,_0x492777){return this[_0x2377('0xf7')](_0xd6a7ac,_0x492777)[_0x2377('0x5d')](function(_0xb2a793){return _[_0x2377('0x4a')](_0xb2a793,[_0x2377('0x31')]);})[_0x2377('0x51')](function(_0x5da5d5){if(_0x5da5d5[_0x2377('0xf8')]){rpcDb['unlockContact'](_0xd6a7ac);}if(_0x5da5d5[_0x2377('0xf3')]){rpcDb[_0x2377('0x64')](_0xd6a7ac);}throw _[_0x2377('0x4a')](_0x5da5d5,[_0x2377('0x31')]);});};Preview[_0x2377('0xf')][_0x2377('0xf7')]=function(_0x20e6a9,_0xc6462){var _0x1ba21e=this;var _0x40d463,_0x25413d;return rpcDb[_0x2377('0xf9')](_0x20e6a9)[_0x2377('0x5d')](function(_0x3f9aaa){if(!_[_0x2377('0x45')](_0x3f9aaa[0x0])){_0x25413d=_0x3f9aaa[0x0][_0x2377('0xfa')]?![]:!![];_0x40d463=_0x3f9aaa[0x0][_0x2377('0xfa')]?!![]:![];_0x40d463=_0xc6462?!![]:_0x40d463;}var _0x41c956=_0x1ba21e[_0x2377('0xfb')](_0x3f9aaa);if(_0x41c956[_0x2377('0xfc')]){rpcDb['checkIsBlackList'](_[_0x2377('0x4a')](_0x3f9aaa[0x0],[_0x2377('0x4d'),_0x2377('0xe6')]))[_0x2377('0x5d')](function(_0x2bb376){_0x1ba21e[_0x2377('0xe4')](_0x2bb376,_0x3f9aaa[0x0],_0xc6462,_0x25413d,_0x40d463)[_0x2377('0x5d')](function(_0x188789){return _0x188789;})[_0x2377('0x51')](function(_0x44e21d){throw _0x44e21d;});})[_0x2377('0x51')](function(_0x3c259d){ut[_0x2377('0x33')](_0x2377('0xfd'),_0x3c259d);throw ut[_0x2377('0x31')](_0x2377('0xfe'),_0x25413d,_0x40d463);});}else{throw ut['message'](_0x41c956[_0x2377('0x31')],_0x25413d,_0x40d463);}})['catch'](function(_0x5dcc0a){ut['logger'](_0x2377('0xff'),_0x5dcc0a);throw ut['message'](_0x2377('0xfe'),![],!![]);});};Preview['prototype'][_0x2377('0xfb')]=function(_0x499050){if(_['isNil'](_0x499050)||_['isEmpty'](_0x499050)||!_['isNil'](_0x499050[0x0][_0x2377('0x60')])&&_['isNil'](_0x499050[0x0][_0x2377('0x60')][_0x2377('0x34')])){ut[_0x2377('0x33')](_0x2377('0x100'),_0x499050);return{'isValid':![],'message':_0x2377('0x101')};}var _0x21aa3a=this[_0x2377('0x13')][_0x499050[0x0][_0x2377('0x102')][_0x2377('0x34')]];_0x21aa3a['message']=utils[_0x2377('0x32')][_0x2377('0x103')];if(_[_0x2377('0x45')](_0x21aa3a)){ut[_0x2377('0x33')]('[Preview][validateContact][Empty\x20Campaign]',_0x21aa3a);return{'isValid':![],'message':_0x2377('0x104')};}if(!this[_0x2377('0x72')](_0x21aa3a[_0x2377('0x73')])){ut['logger'](_0x2377('0x105'),_0x2377('0x106')+_0x21aa3a[_0x2377('0x34')]+_0x2377('0x107'));if(!this[_0x2377('0x72')](_0x21aa3a[_0x2377('0x74')])){ut[_0x2377('0x33')](_0x2377('0x105'),_0x21aa3a['name']+_0x2377('0x108'));return{'isValid':![],'message':_0x2377('0x109')};}}if(!ut[_0x2377('0x71')](_0x21aa3a[_0x2377('0x41')])){ut[_0x2377('0x33')](_0x2377('0x10a'),_0x21aa3a[_0x2377('0x34')]+_0x2377('0x10b'));return{'isValid':![],'message':_0x2377('0x106')+_0x21aa3a[_0x2377('0x34')]+_0x2377('0x10b')};}return{'isValid':!![],'message':_0x2377('0x10c')};};Preview[_0x2377('0xf')][_0x2377('0x10d')]=function(_0x51b5ca,_0xd5981f,_0x2fd999,_0xc0cb7d){var _0x24c343=this;return new Promise(function(_0x66f7d1,_0x39ea99){var _0xcb35a0=_0x51b5ca[_0x2377('0x93')];var _0x133a89=_0x24c343['isTrunkReachable'](_0xd5981f['Trunk'])?util[_0x2377('0x29')](_0x2377('0x10e'),_0xd5981f['Trunk'][_0x2377('0x34')],_['isNil'](_0xd5981f['dialPrefix'])?'':_0xd5981f['dialPrefix'][_0x2377('0x10f')]()||'',_0xd5981f['dialCutDigit']>0x0?_0x2fd999['phone'][_0x2377('0x110')](_0xd5981f[_0x2377('0x111')]):_0x2fd999[_0x2377('0xe6')]):util[_0x2377('0x29')](_0x2377('0x10e'),_['isNil'](_0xd5981f[_0x2377('0x74')])?_0xd5981f[_0x2377('0x73')][_0x2377('0x34')]:_0xd5981f[_0x2377('0x74')][_0x2377('0x34')],_['isNil'](_0xd5981f[_0x2377('0x112')])?'':_0xd5981f[_0x2377('0x112')]['trim']()||'',_0xd5981f[_0x2377('0x111')]>0x0?_0x2fd999[_0x2377('0xe6')][_0x2377('0x110')](_0xd5981f[_0x2377('0x111')]):_0x2fd999[_0x2377('0xe6')]);var _0x318ff0=_0x24c343[_0x2377('0x72')](_0xd5981f[_0x2377('0x73')])?ut[_0x2377('0x113')](_0xd5981f['Trunk'][_0x2377('0x114')],_0xd5981f[_0x2377('0x115')],_0xd5981f[_0x2377('0x116')]>0x0?ut[_0x2377('0x117')](_0xd5981f[_0x2377('0x118')],_0xd5981f[_0x2377('0x116')]):_0xd5981f[_0x2377('0x118')]):ut[_0x2377('0x113')](_[_0x2377('0x45')](_0xd5981f['TrunkBackup'])?_0xd5981f[_0x2377('0x73')]['callerid']:_0xd5981f['TrunkBackup'][_0x2377('0x114')],_0xd5981f[_0x2377('0x115')],_0xd5981f[_0x2377('0x116')]>0x0?ut[_0x2377('0x117')](_0xd5981f[_0x2377('0x118')],_0xd5981f[_0x2377('0x116')]):_0xd5981f[_0x2377('0x118')]);if(_0x318ff0){_0x51b5ca[_0x2377('0x119')]=ut['extractCalleridName'](_0x318ff0);_0x51b5ca[_0x2377('0x11a')]=ut[_0x2377('0x11b')](_0x318ff0);}var _0x2415c2=ut[_0x2377('0x11c')](_0xd5981f,_0x2fd999,_0x133a89,_0x318ff0,_0xcb35a0,_0x51b5ca);var _0x4a9ff8=utils[_0x2377('0x11d')](_0x2fd999[_0x2377('0xe5')]);Object[_0x2377('0x11e')](_0x2415c2,_0x4a9ff8);_[_0x2377('0x11f')](_0x51b5ca,ut[_0x2377('0x120')](_0x2415c2));_0x51b5ca[_0x2377('0x65')]=moment()[_0x2377('0x29')](_0x2377('0x8f'));_0xd5981f[_0x2377('0x121')]=_0x2415c2;var _0xffcfd3=ut[_0x2377('0x122')](_0x51b5ca,_0xd5981f,_0x2415c2,_0x51b5ca[_0x2377('0x88')],_0xc0cb7d);return ami[_0x2377('0x123')](_0xffcfd3)[_0x2377('0x5d')](function(_0xda386b){_0xd5981f[_0x2377('0x2d')]+=0x1;logger[_0x2377('0x26')]('[originated][increment]',_0xcb35a0,_0x2377('0x9f'),_0xd5981f[_0x2377('0x34')],_0x2377('0x48'),_0xd5981f[_0x2377('0x2d')]);_0x66f7d1(_0xda386b);})[_0x2377('0x51')](function(_0x1c36fd){ut[_0x2377('0xd7')](_0x51b5ca,0xe,_0x2377('0x124'));rpcDb[_0x2377('0xd9')](_0x51b5ca,_0x2377('0x125'));_0x39ea99(_0x1c36fd);});});};Preview['prototype']['syncNewExten']=function(_0x5a3de3){if(this[_0x2377('0x46')][_0x5a3de3[_0x2377('0x89')]]){this[_0x2377('0x46')][_0x5a3de3['linkedid']]['channel']=_0x5a3de3[_0x2377('0x50')];}};Preview[_0x2377('0xf')][_0x2377('0x16')]=function(_0x426a78){var _0x5aa02a=this;var _0x3768d8=this[_0x2377('0x46')][_0x426a78['actionid']];if(_0x3768d8){if(_0x3768d8[_0x2377('0xe8')]&&this[_0x2377('0x15')][_0x3768d8[_0x2377('0xe8')]]){ut[_0x2377('0x126')](_0x3768d8,this[_0x2377('0x15')][_0x3768d8['lookAgent']][_0x2377('0x34')],this['agents'][_0x3768d8[_0x2377('0xe8')]]['id']);}var _0x56f498=_[_0x2377('0x127')](_0x3768d8);_0x56f498[_0x2377('0x90')]=moment()[_0x2377('0x29')]('YYYY-MM-DD\x20HH:mm:ss');var _0x245182=_0x5aa02a[_0x2377('0x13')][_0x3768d8[_0x2377('0x49')]];if(ut[_0x2377('0x128')](_0x426a78[_0x2377('0x129')])){if(_0x3768d8[_0x2377('0x87')]){rpcDb[_0x2377('0x12a')](_0x3768d8['idContact']);}if(_0x3768d8[_0x2377('0x88')]){rpcDb[_0x2377('0x64')](_0x3768d8[_0x2377('0x8b')]);}ami[_0x2377('0x25')](_0x2377('0x12b'),ut[_0x2377('0x7b')](_0x3768d8,_0x2377('0x12c'),this[_0x2377('0x13')][_0x3768d8['queue']]));this[_0x2377('0xd4')](_0x56f498,_0x245182,_0x426a78);}else{_0x3768d8['starttime']=moment()['format'](_0x2377('0x8f'));ut[_0x2377('0xd7')](_0x56f498,0x4,_0x2377('0x12d'));rpcDb[_0x2377('0xd9')](_0x56f498,_0x2377('0x12e'));}}};Preview[_0x2377('0xf')][_0x2377('0x19')]=function(_0x36ed9d){var _0x161b19=this[_0x2377('0x46')][_0x36ed9d['linkedid']];var _0x82f6b9;if(_0x161b19){_0x82f6b9=this[_0x2377('0x13')][_0x161b19[_0x2377('0x49')]];logger[_0x2377('0x26')](_0x2377('0x12f'),_0x36ed9d[_0x2377('0x89')],'\x20Queue',_0x82f6b9[_0x2377('0x34')],_0x2377('0x94'),_0x82f6b9['pTalking']);}if(this[_0x2377('0x46')][_0x36ed9d[_0x2377('0x89')]]&&_0x36ed9d[_0x2377('0x89')]!==_0x36ed9d[_0x2377('0x93')]){if(_0x36ed9d[_0x2377('0x130')]==='16'&&this[_0x2377('0x46')][_0x36ed9d['linkedid']][_0x2377('0x55')]){this[_0x2377('0x76')](_0x36ed9d,_0x36ed9d[_0x2377('0x89')],_0x36ed9d[_0x2377('0x130')]);}else if(this[_0x2377('0x46')][_0x36ed9d[_0x2377('0x89')]]['dialAnswer']){logger[_0x2377('0x26')]('[syncHangup][talking][cause]',_0x36ed9d['linkedid'],_0x36ed9d['cause'],_0x2377('0x9f'),_0x82f6b9['name'],'pTalking:\x20',_0x82f6b9[_0x2377('0x2e')]);this[_0x2377('0x76')](_0x36ed9d,_0x36ed9d[_0x2377('0x89')],_0x36ed9d[_0x2377('0x130')]);}}else if(_0x161b19&&_[_0x2377('0x45')](_0x161b19[_0x2377('0x131')])&&_0x82f6b9['dialQueueProject']&&_0x36ed9d[_0x2377('0x89')]===_0x36ed9d[_0x2377('0x93')]&&_[_0x2377('0x45')](_0x36ed9d[_0x2377('0x132')])&&_0x36ed9d[_0x2377('0x130')]==='16'&&_0x36ed9d[_0x2377('0x133')]==='6'&&_['isUndefined'](_0x161b19[_0x2377('0x134')])){if(_0x161b19['unlockAgent']){rpcDb['unlockContact'](_0x161b19[_0x2377('0x8b')]);}if(_0x161b19['activeContact']){rpcDb['disableContact'](_0x161b19['idContact']);}_0x36ed9d[_0x2377('0x132')]='22';this[_0x2377('0xd4')](_0x161b19,_0x82f6b9,_0x36ed9d);}else if(_0x161b19&&_0x161b19['transfer']){if(_0x36ed9d[_0x2377('0x130')]==='16'&&this[_0x2377('0x46')][_0x36ed9d[_0x2377('0x89')]][_0x2377('0x55')]){logger[_0x2377('0x26')](_0x2377('0x135'),_0x36ed9d['linkedid'],_0x36ed9d['cause'],'\x20Queue',_0x82f6b9[_0x2377('0x34')],'pTalking:\x20',_0x82f6b9[_0x2377('0x2e')]);this[_0x2377('0x76')](_0x36ed9d,_0x36ed9d[_0x2377('0x89')],_0x36ed9d['cause']);}else if(this[_0x2377('0x46')][_0x36ed9d['linkedid']][_0x2377('0x55')]){logger[_0x2377('0x26')](_0x2377('0x136'),_0x36ed9d[_0x2377('0x89')],_0x36ed9d[_0x2377('0x130')],_0x2377('0x9f'),_0x82f6b9[_0x2377('0x34')],_0x2377('0x94'),_0x82f6b9[_0x2377('0x2e')]);this[_0x2377('0x76')](_0x36ed9d,_0x36ed9d[_0x2377('0x89')],_0x36ed9d['cause']);}}};Preview[_0x2377('0xf')][_0x2377('0x137')]=function(_0x179aef){if(this['actions'][_0x179aef[_0x2377('0xd2')]]&&_0x179aef[_0x2377('0xd2')]!==_0x179aef[_0x2377('0x138')]){this[_0x2377('0x76')](_0x179aef,_0x179aef[_0x2377('0xd2')],_0x179aef[_0x2377('0xc9')]);}};Preview[_0x2377('0xf')]['syncHangupRequest']=function(_0x49637c){if(this[_0x2377('0x46')][_0x49637c[_0x2377('0x89')]]&&_0x49637c[_0x2377('0x89')]!==_0x49637c[_0x2377('0x93')]&&!this[_0x2377('0x46')][_0x49637c[_0x2377('0x89')]][_0x2377('0x55')]){if(_0x49637c[_0x2377('0x130')]==='1'){this[_0x2377('0x76')](_0x49637c,_0x49637c[_0x2377('0x89')],_0x49637c[_0x2377('0x130')]);}}};Preview[_0x2377('0xf')]['addVariable']=function(_0x5940b4,_0x132274,_0x20077f){if(this[_0x2377('0x46')][_0x5940b4]){if(_[_0x2377('0x45')](this[_0x2377('0x46')][_0x5940b4]['variables'])){this[_0x2377('0x46')][_0x5940b4][_0x2377('0x121')]={};}this['actions'][_0x5940b4][_0x2377('0x121')][_0x132274]=_0x20077f;}};Preview['prototype']['syncVarSet']=function(_0x984dd9){try{if(!_[_0x2377('0x45')](_0x984dd9)){if(ut['filterKey'](_[_0x2377('0x139')](_0x984dd9[_0x2377('0x13a')])[0x0])){this[_0x2377('0x13b')](_0x984dd9['uniqueid'],_[_0x2377('0x139')](_0x984dd9[_0x2377('0x13a')])[0x0],_0x984dd9[_0x2377('0x13c')]);}}}catch(_0xf3423b){logger['error'](_0x2377('0x13d'),util[_0x2377('0x13e')](_0xf3423b,{'showHidden':![],'depth':null}));}};Preview[_0x2377('0xf')][_0x2377('0x21')]=function(_0x185661){if(_0x185661){if(this[_0x2377('0x46')][_0x185661[_0x2377('0x13f')]]){this[_0x2377('0x46')][_0x185661[_0x2377('0x13f')]][_0x2377('0x134')]=!![];}}};Preview[_0x2377('0xf')]['syncBlindTransfer']=function(_0x4ae218){if(_0x4ae218){if(this[_0x2377('0x46')][_0x4ae218[_0x2377('0x140')]]){this[_0x2377('0x46')][_0x4ae218[_0x2377('0x140')]]['transfer']=!![];}}};module[_0x2377('0x141')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index f7d019b..6d8477f 100644 --- a/server/services/ami/preview/rpcDb.js +++ b/server/services/ami/preview/rpcDb.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3b95=['[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','membername','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/agentReportPreview','error','inspect','createHistory','catch','resolve','then','[createHistory]\x20','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','rescheduleContact','UserId','active'];(function(_0x414ba2,_0x13cdaa){var _0x5f341f=function(_0x37d382){while(--_0x37d382){_0x414ba2['push'](_0x414ba2['shift']());}};_0x5f341f(++_0x13cdaa);}(_0x3b95,0x89));var _0x53b9=function(_0x113b6b,_0x5081f4){_0x113b6b=_0x113b6b-0x0;var _0x515e0f=_0x3b95[_0x113b6b];return _0x515e0f;};'use strict';var util=require(_0x53b9('0x0'));var BPromise=require(_0x53b9('0x1'));var logger=require(_0x53b9('0x2'))(_0x53b9('0x3'));var cmHopper=require(_0x53b9('0x4'));var cmHopperHistory=require(_0x53b9('0x5'));var cmHopperBlack=require('../rpc/cmHopperBlack');var agentReportPreview=require(_0x53b9('0x6'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x4eed41){return function(_0x426632){logger[_0x53b9('0x7')](_0x4eed41,util[_0x53b9('0x8')](_0x426632,{'showHidden':![],'depth':null}));};}function create(_0x743132){return cmHopperHistory[_0x53b9('0x9')](_0x743132)[_0x53b9('0xa')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x393f1d){return BPromise[_0x53b9('0xb')]()[_0x53b9('0xc')](agentReportPreview['createHistory'](_0x393f1d))['catch'](loggerCatch(_0x53b9('0xd')));}function moveContact(_0x3027e7){return cmHopper[_0x53b9('0xe')](_0x3027e7,!![])[_0x53b9('0xa')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x53b9('0xf')]=function(_0x48cd92){return cmHopperBlack['checkIsBlackList'](_0x48cd92)[_0x53b9('0xa')](loggerCatch(_0x53b9('0x10')));};exports[_0x53b9('0x11')]=function(_0x384794){return BPromise[_0x53b9('0xb')]()['then'](cmHopper[_0x53b9('0x11')](_0x384794))[_0x53b9('0xa')](loggerCatch(_0x53b9('0x12')));};exports[_0x53b9('0x9')]=function(_0x5729ff,_0x21e106){create(_0x5729ff)[_0x53b9('0xa')](loggerCatch(_0x21e106));moveContact(_0x5729ff)[_0x53b9('0xa')](loggerCatch(_0x21e106));};exports['createAgentHistory']=function(_0x377e21,_0x1ad710){createAgent(_0x377e21)[_0x53b9('0xa')](loggerCatch(_0x1ad710));};exports['createCustomerHistory']=function(_0xfb351,_0x114fdb){create(_0xfb351)[_0x53b9('0xa')](loggerCatch(_0x114fdb));};exports['createCustomerFinal']=function(_0x28f1c7,_0x57c1f3){moveContact(_0x28f1c7)[_0x53b9('0xa')](loggerCatch(_0x57c1f3));};exports[_0x53b9('0x13')]=function(_0x31fd11,_0x75a62,_0x22da5f){if(_0x75a62){_0x31fd11[_0x53b9('0x14')]=null;}if(_0x22da5f){_0x31fd11[_0x53b9('0x15')]=![];}return cmHopper[_0x53b9('0x13')](_0x31fd11)[_0x53b9('0xa')](loggerCatch(_0x53b9('0x16')));};exports[_0x53b9('0x17')]=function(_0x510795){return cmHopper['countReScheduled'](_0x510795)[_0x53b9('0xa')](loggerCatch('[countReScheduled]\x20'));};exports['unlockContact']=function(_0x371f80){return cmHopper[_0x53b9('0x18')]({'UserId':null},_0x371f80,0x1)[_0x53b9('0xa')](loggerCatch(_0x53b9('0x19')));};exports[_0x53b9('0x1a')]=function(_0x5d4fed){return cmHopper[_0x53b9('0x18')]({'active':![]},_0x5d4fed,0x1)['catch'](loggerCatch(_0x53b9('0x1b')));};exports[_0x53b9('0x1c')]=function(_0x2ce8be){var _0x2162d6={};_0x2162d6[_0x53b9('0x1d')]=_0x2ce8be['type'];_0x2162d6['uniqueid']=_0x2ce8be[_0x53b9('0x1e')];_0x2162d6['calleridnum']=_0x2ce8be[_0x53b9('0x1f')];_0x2162d6['calleridname']=_0x2ce8be[_0x53b9('0x20')];_0x2162d6[_0x53b9('0x21')]=_0x2ce8be[_0x53b9('0x21')];_0x2162d6[_0x53b9('0x22')]=_0x2ce8be[_0x53b9('0x23')];_0x2162d6[_0x53b9('0x24')]=_0x2ce8be[_0x53b9('0x23')];_0x2162d6[_0x53b9('0x25')]=0x1;_0x2162d6[_0x53b9('0x26')]=_0x2ce8be['endtime'];_0x2162d6['connectedlinename']=_0x2ce8be['membername'];_0x2162d6[_0x53b9('0x27')]=_0x53b9('0x28');_0x2162d6[_0x53b9('0x29')]=_0x53b9('0x2a');_0x2162d6[_0x53b9('0x2b')]=0x0;_0x2162d6[_0x53b9('0x2c')]=0x1;_0x2162d6['lastAssignedTo']=_0x2ce8be[_0x53b9('0x2d')];_0x2162d6[_0x53b9('0x2e')]=_0x53b9('0x2f');return BPromise[_0x53b9('0xb')]()[_0x53b9('0xc')](voiceQueueReport[_0x53b9('0x30')](_0x2162d6))[_0x53b9('0xa')](loggerCatch(_0x53b9('0x31')));};exports[_0x53b9('0x32')]=function(_0x293fc0,_0x5a1676){return BPromise[_0x53b9('0xb')]()[_0x53b9('0xc')](cmHopper[_0x53b9('0x32')](_0x293fc0,_0x5a1676))[_0x53b9('0xa')](loggerCatch(_0x53b9('0x33')));};exports[_0x53b9('0x34')]=function(_0x54b951){return cmHopper[_0x53b9('0x13')](_0x54b951,!![],!![])[_0x53b9('0xa')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file +var _0x2483=['calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','util','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','createHistory','catch','[createHistory]\x20','resolve','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0x2483,0x187));var _0x3248=function(_0x33aa76,_0x414722){_0x33aa76=_0x33aa76-0x0;var _0x3c952b=_0x2483[_0x33aa76];return _0x3c952b;};'use strict';var util=require(_0x3248('0x0'));var BPromise=require('bluebird');var logger=require('../../../config/logger')('preview');var cmHopper=require(_0x3248('0x1'));var cmHopperHistory=require(_0x3248('0x2'));var cmHopperBlack=require(_0x3248('0x3'));var agentReportPreview=require(_0x3248('0x4'));var voiceQueueReport=require(_0x3248('0x5'));function loggerCatch(_0x48447a){return function(_0x45da0f){logger[_0x3248('0x6')](_0x48447a,util[_0x3248('0x7')](_0x45da0f,{'showHidden':![],'depth':null}));};}function create(_0x567a1f){return cmHopperHistory[_0x3248('0x8')](_0x567a1f)[_0x3248('0x9')](loggerCatch(_0x3248('0xa')));}function createAgent(_0x1f0ed2){return BPromise[_0x3248('0xb')]()[_0x3248('0xc')](agentReportPreview[_0x3248('0x8')](_0x1f0ed2))[_0x3248('0x9')](loggerCatch('[createHistory]\x20'));}function moveContact(_0xb34608){return cmHopper[_0x3248('0xd')](_0xb34608,!![])['catch'](loggerCatch(_0x3248('0xe')));}exports[_0x3248('0xf')]=function(_0x4e9c2d){return cmHopperBlack[_0x3248('0xf')](_0x4e9c2d)[_0x3248('0x9')](loggerCatch(_0x3248('0x10')));};exports[_0x3248('0x11')]=function(_0x385243){return BPromise['resolve']()[_0x3248('0xc')](cmHopper['getContactPreview'](_0x385243))[_0x3248('0x9')](loggerCatch(_0x3248('0x12')));};exports[_0x3248('0x8')]=function(_0x587f8b,_0x4e0ddc){create(_0x587f8b)[_0x3248('0x9')](loggerCatch(_0x4e0ddc));moveContact(_0x587f8b)[_0x3248('0x9')](loggerCatch(_0x4e0ddc));};exports[_0x3248('0x13')]=function(_0x2957a5,_0x2c96aa){createAgent(_0x2957a5)['catch'](loggerCatch(_0x2c96aa));};exports['createCustomerHistory']=function(_0x1cb768,_0x4ce4d8){create(_0x1cb768)[_0x3248('0x9')](loggerCatch(_0x4ce4d8));};exports[_0x3248('0x14')]=function(_0x4921e3,_0x50f438){moveContact(_0x4921e3)[_0x3248('0x9')](loggerCatch(_0x50f438));};exports[_0x3248('0x15')]=function(_0x56bca2,_0x49a9ff,_0x5469f2){if(_0x49a9ff){_0x56bca2[_0x3248('0x16')]=null;}if(_0x5469f2){_0x56bca2[_0x3248('0x17')]=![];}return cmHopper[_0x3248('0x15')](_0x56bca2)[_0x3248('0x9')](loggerCatch(_0x3248('0x18')));};exports[_0x3248('0x19')]=function(_0x57bfa4){return cmHopper[_0x3248('0x19')](_0x57bfa4)[_0x3248('0x9')](loggerCatch(_0x3248('0x1a')));};exports['unlockContact']=function(_0x2c3737){return cmHopper[_0x3248('0x1b')]({'UserId':null},_0x2c3737,0x1)[_0x3248('0x9')](loggerCatch(_0x3248('0x1c')));};exports['disableContact']=function(_0x242ac5){return cmHopper[_0x3248('0x1b')]({'active':![]},_0x242ac5,0x1)[_0x3248('0x9')](loggerCatch('[activeContact]\x20'));};exports[_0x3248('0x1d')]=function(_0x2165d7){var _0x559bca={};_0x559bca[_0x3248('0x1e')]=_0x2165d7[_0x3248('0x1e')];_0x559bca[_0x3248('0x1f')]=_0x2165d7[_0x3248('0x1f')];_0x559bca[_0x3248('0x20')]=_0x2165d7[_0x3248('0x20')];_0x559bca[_0x3248('0x21')]=_0x2165d7[_0x3248('0x21')];_0x559bca['queue']=_0x2165d7[_0x3248('0x22')];_0x559bca[_0x3248('0x23')]=_0x2165d7[_0x3248('0x24')];_0x559bca[_0x3248('0x25')]=_0x2165d7[_0x3248('0x24')];_0x559bca[_0x3248('0x26')]=0x1;_0x559bca[_0x3248('0x27')]=_0x2165d7[_0x3248('0x28')];_0x559bca[_0x3248('0x29')]=_0x2165d7[_0x3248('0x2a')];_0x559bca['context']=_0x3248('0x2b');_0x559bca[_0x3248('0x2c')]=_0x3248('0x2d');_0x559bca[_0x3248('0x2e')]=0x0;_0x559bca[_0x3248('0x2f')]=0x1;_0x559bca[_0x3248('0x30')]=_0x2165d7['membername'];_0x559bca['queuecallerexitreason']='COMPLETED';return BPromise[_0x3248('0xb')]()[_0x3248('0xc')](voiceQueueReport['create'](_0x559bca))[_0x3248('0x9')](loggerCatch(_0x3248('0x31')));};exports[_0x3248('0x32')]=function(_0x5450e9,_0x21bfde){return BPromise['resolve']()[_0x3248('0xc')](cmHopper['getContactRecallMe'](_0x5450e9,_0x21bfde))[_0x3248('0x9')](loggerCatch(_0x3248('0x33')));};exports['rescheduleContactInQueue']=function(_0x1848a4){return cmHopper[_0x3248('0x15')](_0x1848a4,!![],!![])['catch'](loggerCatch(_0x3248('0x34')));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index 20807a0..46889ce 100644 --- a/server/services/ami/preview/util/util.js +++ b/server/services/ami/preview/util/util.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x447c=['diff','seconds','createBody','CampaignId','filterKey','idContact','type','dialAnswer','active','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialchannel','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqoslossbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','extractCalleridName','match','noanswer','variables','toLowerCase','buildNoAnswerEventPayload','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','../../dialer/utils','loggerCatch','error','inspect','logger','info','loggerError','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','addVariables','Queue','calleridname','ContactId','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridnum','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','toLower','updateOriginated','isNil','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','endtime','responsetime','ringtime','starttime','logLookAgent','membername','UserId','logCustomer','getSeconds','talktime','answertime','isFailure','Failure','RECALL','BOOKED','uniqueid','originate','channelAgent','calleridnum','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','scheduledat','add','minutes','ListId','VoiceQueueId','decrementTalkink','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','lastevent','name','queue','interface','motionChannel','voice','mandatoryDisposition','buildObj','buildAcw','agentReadyId','not_inuse','status','push','getDiff','milliseconds'];(function(_0x1b16ac,_0x108ae2){var _0x424d4b=function(_0x5077d6){while(--_0x5077d6){_0x1b16ac['push'](_0x1b16ac['shift']());}};_0x424d4b(++_0x108ae2);}(_0x447c,0x152));var _0xc447=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x447c[_0x40220a];return _0x3903cc;};'use strict';var util=require(_0xc447('0x0'));var _=require(_0xc447('0x1'));var moment=require(_0xc447('0x2'));var logger=require(_0xc447('0x3'))(_0xc447('0x4'));var ipAgi=process[_0xc447('0x5')][_0xc447('0x6')]||'127.0.0.1';var utils=require(_0xc447('0x7'));exports[_0xc447('0x8')]=function(_0x42f6b0){return function(_0x112335){logger[_0xc447('0x9')](_0x42f6b0,util[_0xc447('0xa')](_0x112335,{'showHidden':![],'depth':null}));};};exports[_0xc447('0xb')]=function(_0x370ac6,_0x4cb4b7){logger[_0xc447('0xc')](_0x370ac6,util['inspect'](_0x4cb4b7,{'showHidden':![],'depth':null}));};exports[_0xc447('0xd')]=function(_0x4f6aeb,_0x5303e4){logger[_0xc447('0x9')](_0x4f6aeb,util[_0xc447('0xa')](_0x5303e4,{'showHidden':![],'depth':null}));};exports[_0xc447('0xe')]=function(_0x4b02ec){return function(_0x36b30d){logger[_0xc447('0xc')](_0x4b02ec,util['inspect'](_0x36b30d,{'showHidden':![],'depth':null}));};};exports[_0xc447('0xf')]=function(_0x4acb6e,_0x3a5268,_0x9c626c){return{'message':_0x4acb6e,'unlock':_0x3a5268,'active':_0x9c626c};};exports[_0xc447('0x10')]=function(_0x20dc15,_0x5555bd,_0x5d4a0f){if(!_[_0xc447('0x11')](_0x5d4a0f)&&_0xc447('0x12')===typeof _0x5d4a0f&&!_[_0xc447('0x13')](_0x5d4a0f)){if(!_[_0xc447('0x11')](_0x5555bd)&&_0xc447('0x12')===typeof _0x5555bd&&!_[_0xc447('0x13')](_0x5555bd)){return util['format']('\x22%s\x22\x20<%s>',_0x5555bd,_0x5d4a0f);}return util[_0xc447('0x14')](_0xc447('0x15'),_0x5d4a0f,_0x5d4a0f);}if(!_[_0xc447('0x11')](_0x20dc15)&&_0xc447('0x12')===typeof _0x20dc15&&!_[_0xc447('0x13')](_0x20dc15)){return _0x20dc15;}return _0xc447('0x16');};exports[_0xc447('0x17')]=function(_0x199453){if(_['isNil'](_0x199453)){return![];}return _0x199453;};exports[_0xc447('0x18')]=function(_0x2ad636,_0x8f353a,_0x20777b,_0x235e8f,_0x4b3b5a,_0x30f69d){var _0x4d1130={'XMD-QUEUE':_0x8f353a['Queue']?_0x8f353a[_0xc447('0x19')]['name']:'','XMD-CALLERID':_0x235e8f,'XMD-CALLERID-PREVIEW':_0x30f69d?util[_0xc447('0x14')](_0xc447('0x15'),_0x30f69d[_0xc447('0x1a')],_0x30f69d['calleridnum']):_0x235e8f,'XMD-DIALID':_0x4b3b5a,'XMD-CONTACTID':_0x8f353a[_0xc447('0x1b')],'XMD-CDRTYPE':_0xc447('0x1c'),'CALLERID(all)':_0x235e8f,'XMD-VOICEQUEUEID':_0x8f353a['VoiceQueueId'],'XMD-DIALCHANNEL':_0x20777b,'XMD-DIALTIMEOUT':_0x2ad636[_0xc447('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0xc447('0x14')](_0xc447('0x1e'),_0x2ad636['dialQueueProject2']?'g':'',_[_0xc447('0x13')](_0x2ad636[_0xc447('0x1f')])?'':_0xc447('0x20')),'XMD-DIALURL':_0x2ad636[_0xc447('0x21')]||'','XMD-AGI':_0x2ad636[_0xc447('0x22')]?util[_0xc447('0x14')](_0xc447('0x23'),ipAgi,_0x2ad636[_0xc447('0x22')]):_0xc447('0x24'),'XMD-AGIAFTER':_0x2ad636['dialQueueProject2']?util[_0xc447('0x14')](_0xc447('0x23'),ipAgi,_0x2ad636[_0xc447('0x25')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x30f69d?_0x30f69d[_0xc447('0x26')]:'','XMD-ORIGINATECALLERIDNAME':_0x30f69d?_0x30f69d['originatecalleridname']:'','XMD-DESTINATION':_0xc447('0x27'),'SIPADDHEADER':_0xc447('0x28')};if(!_[_0xc447('0x13')](_0x2ad636[_0xc447('0x1f')])){_0x4d1130[util['format']('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x2ad636['monitor_format'];_0x4d1130[util[_0xc447('0x14')]('%s',_0xc447('0x29'))]=_0x4b3b5a;}return _0x4d1130;};exports[_0xc447('0x2a')]=function(_0x14b0fd){var _0x23266e={};for(var _0x289b40 in _0x14b0fd){if(_0x14b0fd[_0xc447('0x2b')](_0x289b40)){_0x23266e[util['format']('%s',_[_0xc447('0x2c')](_0x289b40))]=_0x14b0fd[_0x289b40];}}return{'variables':_0x23266e};};exports[_0xc447('0x2d')]=function(_0x443195,_0xce534f){if(!_[_0xc447('0x2e')](_0x443195)){if(_0x443195[_0xc447('0x2b')](_0xc447('0x2f'))){if(_0x443195[_0xc447('0x2f')]>0x0){_0x443195[_0xc447('0x2f')]-=0x1;}else{logger[_0xc447('0x9')](_0xc447('0x30'),_0xce534f);}}}else{logger[_0xc447('0x9')](_0xc447('0x31'),_0xce534f);}};exports[_0xc447('0x32')]=function(_0x5b062){var _0x5d3fa0=moment()[_0xc447('0x14')](_0xc447('0x33'));_0x5b062[_0xc447('0x34')]=0xd;_0x5b062[_0xc447('0x35')]='Blacklist';_0x5b062['starttime']=_0x5d3fa0;_0x5b062['responsetime']=_0x5d3fa0;_0x5b062[_0xc447('0x36')]=_0x5d3fa0;};exports['logAgent']=function(_0x2dff39,_0x27b5c,_0x11cb54){var _0x5f4fd3=moment()[_0xc447('0x14')](_0xc447('0x33'));_0x2dff39[_0xc447('0x34')]=_0x27b5c;_0x2dff39[_0xc447('0x35')]=_0x11cb54;_0x2dff39[_0xc447('0x37')]=_0x5f4fd3;_0x2dff39[_0xc447('0x38')]=utils['getSeconds'](_0x2dff39[_0xc447('0x37')],_0x2dff39[_0xc447('0x39')]);};exports[_0xc447('0x3a')]=function(_0x718814,_0x166efc,_0x25e268){_0x718814[_0xc447('0x3b')]=_0x166efc;_0x718814[_0xc447('0x3c')]=_0x25e268;};exports[_0xc447('0x3d')]=function(_0x56d517,_0x485f9a,_0x3217fe){var _0x171399=moment()[_0xc447('0x14')](_0xc447('0x33'));_0x56d517[_0xc447('0x34')]=_0x485f9a;_0x56d517['statedesc']=_0x3217fe;_0x56d517[_0xc447('0x37')]=_0x56d517['responsetime']?_0x56d517[_0xc447('0x37')]:_0x171399;_0x56d517[_0xc447('0x36')]=_0x56d517[_0xc447('0x36')]?_0x56d517['endtime']:_0x171399;_0x56d517[_0xc447('0x38')]=utils[_0xc447('0x3e')](_0x56d517[_0xc447('0x37')]||0x0,_0x56d517[_0xc447('0x39')]||0x0);_0x56d517[_0xc447('0x3f')]=_0x56d517[_0xc447('0x40')]?utils['getSeconds'](_0x56d517[_0xc447('0x36')],_0x56d517[_0xc447('0x40')]):0x0;};exports[_0xc447('0x41')]=function(_0x49bc3a){return _0x49bc3a===_0xc447('0x42');};exports['variablesAction']=function(_0x20eb5f,_0x601f65,_0x323628,_0x5245fe,_0x3d2c6f){var _0x354712=_0x5245fe?_0xc447('0x43'):_0x20eb5f[_0xc447('0x1a')];_0x354712=_0x3d2c6f?_0xc447('0x44'):_0x354712;return{'actionid':_0x20eb5f[_0xc447('0x45')],'action':_0xc447('0x46'),'channel':_0x20eb5f[_0xc447('0x47')],'callerid':util[_0xc447('0x14')](_0xc447('0x15'),_0x354712,_0x20eb5f[_0xc447('0x48')]),'Exten':_0xc447('0x27'),'Context':_0xc447('0x49'),'Priority':'1','variable':_0x323628,'timeout':(_0x601f65[_0xc447('0x4a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x20eb5f[_0xc447('0x45')]};};exports[_0xc447('0x4b')]=function(_0x1f3f13){return _0x1f3f13[_0xc447('0x4c')]+_0x1f3f13[_0xc447('0x4d')]+_0x1f3f13[_0xc447('0x4e')]+_0x1f3f13[_0xc447('0x4f')]+_0x1f3f13[_0xc447('0x50')];};exports[_0xc447('0x51')]=function(_0x424255){var _0x5f049e=_[_0xc447('0x52')](_0x424255);_0x5f049e[_0xc447('0x34')]=0xf;_0x5f049e[_0xc447('0x35')]='Global';return _0x5f049e;};exports['scheduledAt']=function(_0x3b3161,_0x2ef177,_0x64f7a5){var _0xe95cac={};_0xe95cac[_0x2ef177]=_0x3b3161[_0x2ef177];_0xe95cac['active']=![];_0xe95cac[_0xc447('0x53')]=moment()[_0xc447('0x54')](_0x64f7a5,_0xc447('0x55'))[_0xc447('0x14')](_0xc447('0x33'));_0xe95cac[_0xc447('0x1b')]=_0x3b3161[_0xc447('0x1b')];_0xe95cac[_0xc447('0x56')]=_0x3b3161[_0xc447('0x56')];_0xe95cac[_0xc447('0x57')]=_0x3b3161[_0xc447('0x57')]||undefined;return _0xe95cac;};exports[_0xc447('0x58')]=function(_0x311063,_0x30ad3d){if(!_[_0xc447('0x2e')](_0x311063)){if(_0x311063['pTalking']>0x0){_0x311063['pTalking']-=0x1;}else{logger[_0xc447('0x9')](_0x30ad3d,_0xc447('0x59'));}}else{logger[_0xc447('0x9')](_0x30ad3d,_0xc447('0x5a'));}};exports['IsNotLoggedIn']=function(_0x44f602){if(_0x44f602<=0x0){return!![];}return![];};function buildObj(_0x35ada0,_0x233719,_0x554dfa){_0x35ada0[_0xc447('0x5b')]=_0x233719;_0x35ada0[_0xc447('0x5c')]=_0x35ada0[_0xc447('0x5d')];_0x35ada0[_0xc447('0x5e')]=_0x35ada0[_0xc447('0x47')];_0x35ada0[_0xc447('0x5f')]=_0xc447('0x60');if(_0x554dfa){_0x35ada0['mandatoryDisposition']=_0x554dfa[_0xc447('0x61')];}return _0x35ada0;}exports[_0xc447('0x62')]=buildObj;exports[_0xc447('0x63')]=function(_0x33b0d1){var _0x5ce92d={};_0x5ce92d[_0xc447('0x5d')]=_0x33b0d1['queue'];_0x5ce92d['interface']=_0x33b0d1[_0xc447('0x47')];_0x5ce92d[_0xc447('0x45')]=_0x33b0d1['uniqueid'];return _0x5ce92d;};exports[_0xc447('0x64')]=function(_0x2802b2){var _0x366e99=[];for(var _0x34c086 in _0x2802b2){if(_0x2802b2['hasOwnProperty'](_0x34c086)){if(!_['isNil'](_0x2802b2[_0x34c086])&&_0x2802b2[_0x34c086][_0xc447('0x34')]===_0xc447('0x65')&&_0x2802b2[_0x34c086][_0xc447('0x66')]==='reachable'){_0x366e99[_0xc447('0x67')](_0x2802b2[_0x34c086]['id']);}}}return _0x366e99;};exports[_0xc447('0x68')]=function(_0x46d479){var _0x3bd38f=moment()[_0xc447('0x69')](0x0);var _0x2c447a=moment(_0x46d479)[_0xc447('0x69')](0x0);return _0x3bd38f[_0xc447('0x6a')](_0x2c447a,_0xc447('0x6b'));};exports[_0xc447('0x6c')]=function(_0x3d5ca8){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3d5ca8['ContactId'],'ListId':_0x3d5ca8[_0xc447('0x56')],'VoiceQueueId':_0x3d5ca8[_0xc447('0x57')]||undefined,'CampaignId':_0x3d5ca8[_0xc447('0x6d')]||undefined};};exports[_0xc447('0x6e')]=function(_0x4c354b){if(_0x4c354b===_0xc447('0x45')||_0x4c354b===_0xc447('0x6f')||_0x4c354b==='queue'||_0x4c354b===_0xc447('0x70')||_0x4c354b==='campaigntype'||_0x4c354b===_0xc447('0x71')||_0x4c354b==='membername'||_0x4c354b==='channelAgent'||_0x4c354b===_0xc447('0x1a')||_0x4c354b===_0xc447('0x72')||_0x4c354b===_0xc447('0x48')||_0x4c354b===_0xc447('0x53')||_0x4c354b==='countbusyretry'||_0x4c354b===_0xc447('0x4d')||_0x4c354b===_0xc447('0x4e')||_0x4c354b==='countglobal'||_0x4c354b===_0xc447('0x73')||_0x4c354b===_0xc447('0x74')||_0x4c354b===_0xc447('0x75')||_0x4c354b===_0xc447('0x76')||_0x4c354b===_0xc447('0x1b')||_0x4c354b==='ListId'||_0x4c354b===_0xc447('0x3c')||_0x4c354b===_0xc447('0x57')||_0x4c354b===_0xc447('0x77')||_0x4c354b===_0xc447('0x78')||_0x4c354b===_0xc447('0x79')||_0x4c354b===_0xc447('0x7a')||_0x4c354b===_0xc447('0x7b')||_0x4c354b===_0xc447('0x7c')||_0x4c354b==='xmd-dialtimeout'||_0x4c354b==='xmd-dialoptions'||_0x4c354b==='xmd-dialid'||_0x4c354b===_0xc447('0x7d')||_0x4c354b==='xmd-contactid'||_0x4c354b===_0xc447('0x7e')||_0x4c354b==='xmd-callerid'||_0x4c354b===_0xc447('0x7f')||_0x4c354b===_0xc447('0x80')||_0x4c354b===_0xc447('0x81')||_0x4c354b===_0xc447('0x82')||_0x4c354b===_0xc447('0x83')||_0x4c354b===_0xc447('0x84')||_0x4c354b===_0xc447('0x85')||_0x4c354b==='rtpaudioqoslossbridged'||_0x4c354b===_0xc447('0x86')||_0x4c354b===_0xc447('0x87')||_0x4c354b==='rtpaudioqos'||_0x4c354b==='rtpaudioqosbridged'||_0x4c354b===_0xc447('0x83')||_0x4c354b===_0xc447('0x84')||_0x4c354b===_0xc447('0x85')||_0x4c354b===_0xc447('0x88')||_0x4c354b==='rtpaudioqosrtt'||_0x4c354b==='rtpaudioqosrttbridged'||_0x4c354b===_0xc447('0x89')||_0x4c354b===_0xc447('0x8a')||_0x4c354b==='state'||_0x4c354b===_0xc447('0x35')){return![];}return!![];};exports[_0xc447('0x8b')]=function(_0x445db6,_0x19f4fb){var _0x395172,_0x3375eb,_0x56639e;if(_0x19f4fb<=0x0){_0x19f4fb=0x1;}_0x395172=new RegExp(_0xc447('0x8c')+_0x19f4fb+'}$');_0x3375eb=Math[_0xc447('0x8d')](0xa,_0x19f4fb-0x1);_0x56639e=Math[_0xc447('0x8d')](0xa,_0x19f4fb)-0x1;return util[_0xc447('0x14')]('%s',_['replace'](_0x445db6,_0x395172,_['random'](_0x3375eb,_0x56639e)));};exports[_0xc447('0x8e')]=function(_0x1ad161){var _0x1f1de5=_0x1ad161[_0xc447('0x8f')](/"(.*?)"/);return _0x1f1de5?_0x1f1de5[0x1]:_0x1ad161;};exports['extractCalleridNumber']=function(_0xc7044b){var _0x20f7eb=_0xc7044b[_0xc447('0x8f')](/<(.*?)>/);return _0x20f7eb?_0x20f7eb[0x1]:_0xc7044b;};function buildNoAnswerEventPayload(_0x899a03,_0x4d77bb){var _0x3711eb=buildObj(_0x899a03,_0xc447('0x90'));if(!_[_0xc447('0x13')](_0x4d77bb[_0xc447('0x91')])){Object['keys'](_0x4d77bb[_0xc447('0x91')])['forEach'](function(_0x12e8cd){_0x3711eb[_0x12e8cd[_0xc447('0x92')]()]=_0x4d77bb[_0xc447('0x91')][_0x12e8cd];});}return _0x3711eb;}exports[_0xc447('0x93')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0x1f11=['reachable','push','getDiff','milliseconds','diff','createBody','filterKey','idContact','type','campaigntype','active','countglobal','callbackuniqueid','callbackat','UserId','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqosrtt','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','replace','random','match','extractCalleridNumber','noanswer','variables','forEach','buildNoAnswerEventPayload','util','lodash','../../../../config/logger','env','XCALLY_IP_AGI','error','inspect','info','loggerError','logger2','getCallerId','isUndefined','isEmpty','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','Queue','name','calleridname','calleridnum','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','updateOriginated','hasOwnProperty','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','starttime','responsetime','logAgent','YYYY-MM-DD\x20HH:mm:ss','statedesc','ringtime','getSeconds','logLookAgent','membername','endtime','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','clone','scheduledat','add','minutes','ContactId','ListId','pTalking','IsNotLoggedIn','queue','interface','voice','mandatoryDisposition','buildObj','agentReadyId','state','not_inuse','status'];(function(_0x192354,_0x483891){var _0x8ead9e=function(_0x5188ab){while(--_0x5188ab){_0x192354['push'](_0x192354['shift']());}};_0x8ead9e(++_0x483891);}(_0x1f11,0x13f));var _0x11f1=function(_0x3e0cc1,_0xf42a9){_0x3e0cc1=_0x3e0cc1-0x0;var _0x5f0fbd=_0x1f11[_0x3e0cc1];return _0x5f0fbd;};'use strict';var util=require(_0x11f1('0x0'));var _=require(_0x11f1('0x1'));var moment=require('moment');var logger=require(_0x11f1('0x2'))('preview');var ipAgi=process[_0x11f1('0x3')][_0x11f1('0x4')]||'127.0.0.1';var utils=require('../../dialer/utils');exports['loggerCatch']=function(_0x23022a){return function(_0x396912){logger[_0x11f1('0x5')](_0x23022a,util[_0x11f1('0x6')](_0x396912,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0xa0953d,_0xe120dd){logger[_0x11f1('0x7')](_0xa0953d,util[_0x11f1('0x6')](_0xe120dd,{'showHidden':![],'depth':null}));};exports[_0x11f1('0x8')]=function(_0x21ee09,_0x7089e2){logger[_0x11f1('0x5')](_0x21ee09,util[_0x11f1('0x6')](_0x7089e2,{'showHidden':![],'depth':null}));};exports[_0x11f1('0x9')]=function(_0x35f9d0){return function(_0x3a85b3){logger[_0x11f1('0x7')](_0x35f9d0,util[_0x11f1('0x6')](_0x3a85b3,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x2976a1,_0x4c8484,_0x3adcfe){return{'message':_0x2976a1,'unlock':_0x4c8484,'active':_0x3adcfe};};exports[_0x11f1('0xa')]=function(_0x40ee7f,_0x446afd,_0x67e0fd){if(!_[_0x11f1('0xb')](_0x67e0fd)&&'string'===typeof _0x67e0fd&&!_[_0x11f1('0xc')](_0x67e0fd)){if(!_[_0x11f1('0xb')](_0x446afd)&&_0x11f1('0xd')===typeof _0x446afd&&!_['isEmpty'](_0x446afd)){return util[_0x11f1('0xe')](_0x11f1('0xf'),_0x446afd,_0x67e0fd);}return util[_0x11f1('0xe')]('\x22%s\x22\x20<%s>',_0x67e0fd,_0x67e0fd);}if(!_[_0x11f1('0xb')](_0x40ee7f)&&_0x11f1('0xd')===typeof _0x40ee7f&&!_[_0x11f1('0xc')](_0x40ee7f)){return _0x40ee7f;}return _0x11f1('0x10');};exports[_0x11f1('0x11')]=function(_0x302658){if(_[_0x11f1('0x12')](_0x302658)){return![];}return _0x302658;};exports['addVariables']=function(_0x334a5d,_0x46356c,_0x5e2677,_0x3a301c,_0x4158e5,_0x2353fe){var _0x681159={'XMD-QUEUE':_0x46356c[_0x11f1('0x13')]?_0x46356c[_0x11f1('0x13')][_0x11f1('0x14')]:'','XMD-CALLERID':_0x3a301c,'XMD-CALLERID-PREVIEW':_0x2353fe?util[_0x11f1('0xe')](_0x11f1('0xf'),_0x2353fe[_0x11f1('0x15')],_0x2353fe[_0x11f1('0x16')]):_0x3a301c,'XMD-DIALID':_0x4158e5,'XMD-CONTACTID':_0x46356c['ContactId'],'XMD-CDRTYPE':_0x11f1('0x17'),'CALLERID(all)':_0x3a301c,'XMD-VOICEQUEUEID':_0x46356c[_0x11f1('0x18')],'XMD-DIALCHANNEL':_0x5e2677,'XMD-DIALTIMEOUT':_0x334a5d[_0x11f1('0x19')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0x11f1('0x1a'),_0x334a5d[_0x11f1('0x1b')]?'g':'',_[_0x11f1('0xc')](_0x334a5d['monitor_format'])?'':_0x11f1('0x1c')),'XMD-DIALURL':_0x334a5d[_0x11f1('0x1d')]||'','XMD-AGI':_0x334a5d[_0x11f1('0x1e')]?util[_0x11f1('0xe')](_0x11f1('0x1f'),ipAgi,_0x334a5d[_0x11f1('0x1e')]):_0x11f1('0x20'),'XMD-AGIAFTER':_0x334a5d[_0x11f1('0x1b')]?util[_0x11f1('0xe')]('\x22agi://%s/square,%s\x22',ipAgi,_0x334a5d[_0x11f1('0x1b')]):_0x11f1('0x20'),'XMD-ORIGINATECALLERIDNUM':_0x2353fe?_0x2353fe[_0x11f1('0x21')]:'','XMD-ORIGINATECALLERIDNAME':_0x2353fe?_0x2353fe[_0x11f1('0x22')]:'','XMD-DESTINATION':_0x11f1('0x23'),'SIPADDHEADER':_0x11f1('0x24')};if(!_[_0x11f1('0xc')](_0x334a5d['monitor_format'])){_0x681159[util['format']('%s',_0x11f1('0x25'))]=_0x334a5d['monitor_format'];_0x681159[util['format']('%s',_0x11f1('0x26'))]=_0x4158e5;}return _0x681159;};exports['toLowerVariables']=function(_0x56f1c3){var _0x402e2c={};for(var _0x291a81 in _0x56f1c3){if(_0x56f1c3['hasOwnProperty'](_0x291a81)){_0x402e2c[util[_0x11f1('0xe')]('%s',_['toLower'](_0x291a81))]=_0x56f1c3[_0x291a81];}}return{'variables':_0x402e2c};};exports[_0x11f1('0x27')]=function(_0x32a167,_0x4102ea){if(!_[_0x11f1('0x12')](_0x32a167)){if(_0x32a167[_0x11f1('0x28')](_0x11f1('0x29'))){if(_0x32a167[_0x11f1('0x29')]>0x0){_0x32a167[_0x11f1('0x29')]-=0x1;}else{logger[_0x11f1('0x5')](_0x11f1('0x2a'),_0x4102ea);}}}else{logger[_0x11f1('0x5')](_0x11f1('0x2b'),_0x4102ea);}};exports[_0x11f1('0x2c')]=function(_0x122664){var _0xa89973=moment()[_0x11f1('0xe')]('YYYY-MM-DD\x20HH:mm:ss');_0x122664['state']=0xd;_0x122664['statedesc']='Blacklist';_0x122664[_0x11f1('0x2d')]=_0xa89973;_0x122664[_0x11f1('0x2e')]=_0xa89973;_0x122664['endtime']=_0xa89973;};exports[_0x11f1('0x2f')]=function(_0x10023c,_0x925954,_0x4c3b89){var _0x110853=moment()['format'](_0x11f1('0x30'));_0x10023c['state']=_0x925954;_0x10023c[_0x11f1('0x31')]=_0x4c3b89;_0x10023c[_0x11f1('0x2e')]=_0x110853;_0x10023c[_0x11f1('0x32')]=utils[_0x11f1('0x33')](_0x10023c[_0x11f1('0x2e')],_0x10023c[_0x11f1('0x2d')]);};exports[_0x11f1('0x34')]=function(_0x3959fe,_0x47d26a,_0x1125f5){_0x3959fe[_0x11f1('0x35')]=_0x47d26a;_0x3959fe['UserId']=_0x1125f5;};exports['logCustomer']=function(_0x19db58,_0x2d8555,_0x5477e3){var _0x536476=moment()[_0x11f1('0xe')](_0x11f1('0x30'));_0x19db58['state']=_0x2d8555;_0x19db58[_0x11f1('0x31')]=_0x5477e3;_0x19db58[_0x11f1('0x2e')]=_0x19db58[_0x11f1('0x2e')]?_0x19db58['responsetime']:_0x536476;_0x19db58[_0x11f1('0x36')]=_0x19db58[_0x11f1('0x36')]?_0x19db58[_0x11f1('0x36')]:_0x536476;_0x19db58[_0x11f1('0x32')]=utils[_0x11f1('0x33')](_0x19db58[_0x11f1('0x2e')]||0x0,_0x19db58['starttime']||0x0);_0x19db58[_0x11f1('0x37')]=_0x19db58[_0x11f1('0x38')]?utils[_0x11f1('0x33')](_0x19db58['endtime'],_0x19db58[_0x11f1('0x38')]):0x0;};exports[_0x11f1('0x39')]=function(_0x33645a){return _0x33645a===_0x11f1('0x3a');};exports[_0x11f1('0x3b')]=function(_0x160e81,_0x4280e3,_0x104ff7,_0x461dc1,_0x66c042){var _0x1a262c=_0x461dc1?_0x11f1('0x3c'):_0x160e81[_0x11f1('0x15')];_0x1a262c=_0x66c042?_0x11f1('0x3d'):_0x1a262c;return{'actionid':_0x160e81[_0x11f1('0x3e')],'action':_0x11f1('0x3f'),'channel':_0x160e81[_0x11f1('0x40')],'callerid':util['format'](_0x11f1('0xf'),_0x1a262c,_0x160e81[_0x11f1('0x16')]),'Exten':_0x11f1('0x23'),'Context':_0x11f1('0x41'),'Priority':'1','variable':_0x104ff7,'timeout':(_0x4280e3[_0x11f1('0x42')]||0x1e)*0x3e8,'async':!![],'channelid':_0x160e81[_0x11f1('0x3e')]};};exports[_0x11f1('0x43')]=function(_0x577da0){return _0x577da0[_0x11f1('0x44')]+_0x577da0[_0x11f1('0x45')]+_0x577da0[_0x11f1('0x46')]+_0x577da0[_0x11f1('0x47')]+_0x577da0['countnosuchnumberretry'];};exports['cloneAction']=function(_0x1a74ad){var _0x5986a2=_[_0x11f1('0x48')](_0x1a74ad);_0x5986a2['state']=0xf;_0x5986a2[_0x11f1('0x31')]='Global';return _0x5986a2;};exports['scheduledAt']=function(_0x4626a3,_0x51cb54,_0x399dc3){var _0x52f515={};_0x52f515[_0x51cb54]=_0x4626a3[_0x51cb54];_0x52f515['active']=![];_0x52f515[_0x11f1('0x49')]=moment()[_0x11f1('0x4a')](_0x399dc3,_0x11f1('0x4b'))[_0x11f1('0xe')](_0x11f1('0x30'));_0x52f515[_0x11f1('0x4c')]=_0x4626a3[_0x11f1('0x4c')];_0x52f515[_0x11f1('0x4d')]=_0x4626a3[_0x11f1('0x4d')];_0x52f515[_0x11f1('0x18')]=_0x4626a3[_0x11f1('0x18')]||undefined;return _0x52f515;};exports['decrementTalkink']=function(_0x5a6482,_0x13b7ba){if(!_[_0x11f1('0x12')](_0x5a6482)){if(_0x5a6482[_0x11f1('0x4e')]>0x0){_0x5a6482['pTalking']-=0x1;}else{logger['error'](_0x13b7ba,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x11f1('0x5')](_0x13b7ba,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x11f1('0x4f')]=function(_0x4d489a){if(_0x4d489a<=0x0){return!![];}return![];};function buildObj(_0x2fd09e,_0xbb13b2,_0x2033be){_0x2fd09e['lastevent']=_0xbb13b2;_0x2fd09e[_0x11f1('0x14')]=_0x2fd09e[_0x11f1('0x50')];_0x2fd09e[_0x11f1('0x51')]=_0x2fd09e[_0x11f1('0x40')];_0x2fd09e['motionChannel']=_0x11f1('0x52');if(_0x2033be){_0x2fd09e[_0x11f1('0x53')]=_0x2033be[_0x11f1('0x53')];}return _0x2fd09e;}exports[_0x11f1('0x54')]=buildObj;exports['buildAcw']=function(_0x53fa94){var _0x781a75={};_0x781a75['queue']=_0x53fa94['queue'];_0x781a75[_0x11f1('0x51')]=_0x53fa94['channelAgent'];_0x781a75[_0x11f1('0x3e')]=_0x53fa94['uniqueid'];return _0x781a75;};exports[_0x11f1('0x55')]=function(_0x4e63f7){var _0x820cf7=[];for(var _0x4519bb in _0x4e63f7){if(_0x4e63f7['hasOwnProperty'](_0x4519bb)){if(!_[_0x11f1('0x12')](_0x4e63f7[_0x4519bb])&&_0x4e63f7[_0x4519bb][_0x11f1('0x56')]===_0x11f1('0x57')&&_0x4e63f7[_0x4519bb][_0x11f1('0x58')]===_0x11f1('0x59')){_0x820cf7[_0x11f1('0x5a')](_0x4e63f7[_0x4519bb]['id']);}}}return _0x820cf7;};exports[_0x11f1('0x5b')]=function(_0x4143b1){var _0x26dfbd=moment()['milliseconds'](0x0);var _0x528fb0=moment(_0x4143b1)[_0x11f1('0x5c')](0x0);return _0x26dfbd[_0x11f1('0x5d')](_0x528fb0,'seconds');};exports[_0x11f1('0x5e')]=function(_0x379111){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x379111[_0x11f1('0x4c')],'ListId':_0x379111[_0x11f1('0x4d')],'VoiceQueueId':_0x379111[_0x11f1('0x18')]||undefined,'CampaignId':_0x379111['CampaignId']||undefined};};exports[_0x11f1('0x5f')]=function(_0x22fa5e){if(_0x22fa5e===_0x11f1('0x3e')||_0x22fa5e===_0x11f1('0x60')||_0x22fa5e===_0x11f1('0x50')||_0x22fa5e===_0x11f1('0x61')||_0x22fa5e===_0x11f1('0x62')||_0x22fa5e==='dialAnswer'||_0x22fa5e===_0x11f1('0x35')||_0x22fa5e===_0x11f1('0x40')||_0x22fa5e===_0x11f1('0x15')||_0x22fa5e===_0x11f1('0x63')||_0x22fa5e==='calleridnum'||_0x22fa5e==='scheduledat'||_0x22fa5e===_0x11f1('0x44')||_0x22fa5e===_0x11f1('0x45')||_0x22fa5e==='countnoanswerretry'||_0x22fa5e===_0x11f1('0x64')||_0x22fa5e==='callback'||_0x22fa5e===_0x11f1('0x65')||_0x22fa5e===_0x11f1('0x66')||_0x22fa5e==='recallme'||_0x22fa5e===_0x11f1('0x4c')||_0x22fa5e==='ListId'||_0x22fa5e===_0x11f1('0x67')||_0x22fa5e===_0x11f1('0x18')||_0x22fa5e===_0x11f1('0x68')||_0x22fa5e===_0x11f1('0x69')||_0x22fa5e===_0x11f1('0x6a')||_0x22fa5e===_0x11f1('0x6b')||_0x22fa5e==='xmd-listid'||_0x22fa5e===_0x11f1('0x6c')||_0x22fa5e===_0x11f1('0x6d')||_0x22fa5e===_0x11f1('0x6e')||_0x22fa5e===_0x11f1('0x6f')||_0x22fa5e===_0x11f1('0x70')||_0x22fa5e===_0x11f1('0x71')||_0x22fa5e==='xmd-cdrtype'||_0x22fa5e===_0x11f1('0x72')||_0x22fa5e===_0x11f1('0x73')||_0x22fa5e==='xmd-agi'||_0x22fa5e===_0x11f1('0x74')||_0x22fa5e===_0x11f1('0x75')||_0x22fa5e===_0x11f1('0x76')||_0x22fa5e===_0x11f1('0x77')||_0x22fa5e===_0x11f1('0x78')||_0x22fa5e===_0x11f1('0x79')||_0x22fa5e==='rtpaudioqosrtt'||_0x22fa5e===_0x11f1('0x7a')||_0x22fa5e===_0x11f1('0x74')||_0x22fa5e===_0x11f1('0x75')||_0x22fa5e===_0x11f1('0x76')||_0x22fa5e===_0x11f1('0x77')||_0x22fa5e===_0x11f1('0x78')||_0x22fa5e===_0x11f1('0x79')||_0x22fa5e===_0x11f1('0x7b')||_0x22fa5e==='rtpaudioqosrttbridged'||_0x22fa5e===_0x11f1('0x7c')||_0x22fa5e===_0x11f1('0x7d')||_0x22fa5e===_0x11f1('0x56')||_0x22fa5e==='statedesc'){return![];}return!![];};exports['getCallerIdRandom']=function(_0x25f136,_0x5896ec){var _0x43f159,_0x4015ec,_0x1f1d99;if(_0x5896ec<=0x0){_0x5896ec=0x1;}_0x43f159=new RegExp(_0x11f1('0x7e')+_0x5896ec+'}$');_0x4015ec=Math[_0x11f1('0x7f')](0xa,_0x5896ec-0x1);_0x1f1d99=Math[_0x11f1('0x7f')](0xa,_0x5896ec)-0x1;return util['format']('%s',_[_0x11f1('0x80')](_0x25f136,_0x43f159,_[_0x11f1('0x81')](_0x4015ec,_0x1f1d99)));};exports['extractCalleridName']=function(_0x1954a9){var _0x29812c=_0x1954a9[_0x11f1('0x82')](/"(.*?)"/);return _0x29812c?_0x29812c[0x1]:_0x1954a9;};exports[_0x11f1('0x83')]=function(_0x34efe2){var _0x1d69aa=_0x34efe2[_0x11f1('0x82')](/<(.*?)>/);return _0x1d69aa?_0x1d69aa[0x1]:_0x34efe2;};function buildNoAnswerEventPayload(_0x2aced9,_0x27c179){var _0x242f2b=buildObj(_0x2aced9,_0x11f1('0x84'));if(!_[_0x11f1('0xc')](_0x27c179['variables'])){Object['keys'](_0x27c179[_0x11f1('0x85')])[_0x11f1('0x86')](function(_0x3e911b){_0x242f2b[_0x3e911b['toLowerCase']()]=_0x27c179['variables'][_0x3e911b];});}return _0x242f2b;}exports[_0x11f1('0x87')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index efe3bef..58ab6ad 100644 --- a/server/services/ami/properties.js +++ b/server/services/ami/properties.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x80ca=['voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','boolean','queueremove','queuepause','voicechannel'];(function(_0x4a46d3,_0x1d41d4){var _0x2dde96=function(_0x325b94){while(--_0x325b94){_0x4a46d3['push'](_0x4a46d3['shift']());}};_0x2dde96(++_0x1d41d4);}(_0x80ca,0x13d));var _0xa80c=function(_0x1f2e74,_0xbcb68b){_0x1f2e74=_0x1f2e74-0x0;var _0x2802fc=_0x80ca[_0x1f2e74];return _0x2802fc;};'use strict';exports[_0xa80c('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0xa80c('0x1'),'required':!![]},'penalty':{'type':_0xa80c('0x2'),'required':![]},'paused':{'type':_0xa80c('0x3'),'required':![]}};exports[_0xa80c('0x4')]={'queue':{'type':_0xa80c('0x1'),'required':!![]},'interface':{'type':_0xa80c('0x1'),'required':!![]}};exports[_0xa80c('0x5')]={'interface':{'type':_0xa80c('0x1'),'required':!![]},'paused':{'type':_0xa80c('0x3')},'reason':{'type':_0xa80c('0x1'),'required':![]}};exports['reload']={'module':{'type':_0xa80c('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0xa80c('0x1'),'required':!![]}};exports[_0xa80c('0x6')]={'uniqueid':{'type':_0xa80c('0x1'),'required':!![]},'filename':{'type':_0xa80c('0x1')},'format':{'type':_0xa80c('0x1')},'mixmonitorid':{'type':'string'}};exports[_0xa80c('0x7')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xa80c('0x8')]={'uniqueid':{'type':_0xa80c('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0xa80c('0x1')}}; \ No newline at end of file +var _0xa49e=['string','number','queueremove','boolean','voicequeuechannel','voicechannel','voicequeuechannelredirect'];(function(_0x1a7550,_0x1edace){var _0x426e22=function(_0x1c10a1){while(--_0x1c10a1){_0x1a7550['push'](_0x1a7550['shift']());}};_0x426e22(++_0x1edace);}(_0xa49e,0x13b));var _0xea49=function(_0x55c937,_0x4136f7){_0x55c937=_0x55c937-0x0;var _0xc45fad=_0xa49e[_0x55c937];return _0xc45fad;};'use strict';exports['queueadd']={'queue':{'type':_0xea49('0x0'),'required':!![]},'interface':{'type':_0xea49('0x0'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0xea49('0x1'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0xea49('0x2')]={'queue':{'type':_0xea49('0x0'),'required':!![]},'interface':{'type':_0xea49('0x0'),'required':!![]}};exports['queuepause']={'interface':{'type':'string','required':!![]},'paused':{'type':_0xea49('0x3')},'reason':{'type':'string','required':![]}};exports['reload']={'module':{'type':_0xea49('0x0'),'required':![]}};exports[_0xea49('0x4')]={'uniqueid':{'type':_0xea49('0x0'),'required':!![]}};exports[_0xea49('0x5')]={'uniqueid':{'type':_0xea49('0x0'),'required':!![]},'filename':{'type':_0xea49('0x0')},'format':{'type':'string'},'mixmonitorid':{'type':_0xea49('0x0')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':'string','required':!![]}};exports[_0xea49('0x6')]={'uniqueid':{'type':_0xea49('0x0'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0xea49('0x0')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index a841376..3f96478 100644 --- a/server/services/ami/realtime/index.js +++ b/server/services/ami/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['voiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','exports','moment','util','../model/agent','../model/trunk','../model/voiceQueue','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/faxAccount','telephones','trunks','voiceQueues','campaigns','outbound','channels','queueChannels','sugarcrmAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','SIP/%s','name','hasOwnProperty','interface','total','answered','sumHoldTime','sumDuration','sumBillable','ivrTotalCallsDays','isEmpty','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundReCallsDay','queueStatusComplete','prototype','length','isNil','isUndefined','agents','initTelephones','initTrunks','mergeFromDatabase','initTriggers','triggers','initTemplates','templates','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x2032,0xd9));var _0x2203=function(_0x168044,_0x42e397){_0x168044=_0x168044-0x0;var _0x33cb61=_0x2032[_0x168044];return _0x33cb61;};'use strict';var _=require('lodash');var moment=require(_0x2203('0x0'));var util=require(_0x2203('0x1'));var Agent=require(_0x2203('0x2'));var Telephone=require('../model/telephone');var Trunk=require(_0x2203('0x3'));var VoiceQueue=require(_0x2203('0x4'));var Trigger=require('../model/trigger');var Template=require(_0x2203('0x5'));var Campaign=require(_0x2203('0x6'));var VoiceExtension=require(_0x2203('0x7'));var ZendeskAccount=require(_0x2203('0x8'));var SalesforceAccount=require(_0x2203('0x9'));var FreshdeskAccount=require(_0x2203('0xa'));var SugarcrmAccount=require(_0x2203('0xb'));var ZohoAccount=require(_0x2203('0xc'));var DeskAccount=require(_0x2203('0xd'));var VtigerAccount=require(_0x2203('0xe'));var ServicenowAccount=require(_0x2203('0xf'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x2203('0x10'));function Realtime(){this['agents']={};this[_0x2203('0x11')]={};this[_0x2203('0x12')]={};this[_0x2203('0x13')]={};this['triggers']={};this[_0x2203('0x14')]={};this['templates']={};this[_0x2203('0x15')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x2203('0x16')]={};this[_0x2203('0x17')]={};this['outboundChannels']={};this['timers']={};this['settings']={};this['zendeskAccounts']={};this['salesforceAccounts']={};this[_0x2203('0x18')]={};this['freshdeskAccounts']={};this['zohoAccounts']={};this[_0x2203('0x19')]={};this[_0x2203('0x1a')]={};this[_0x2203('0x1b')]={};this[_0x2203('0x1c')]={};this[_0x2203('0x1d')]={};this[_0x2203('0x1e')]={};}function freeIsNotKey(_0x2c36e6,_0x2c085c,_0xdf9d0b){var _0x3053f3=_['mapKeys'](_0x2c36e6,function(_0x280eda){return _0x280eda[_0xdf9d0b];});for(var _0x2ee127 in _0x2c085c){if(_0x2c085c['hasOwnProperty'](_0x2ee127)){if(!_0x3053f3[_0x2ee127]){delete _0x2c085c[_0x2ee127];}}}}function freeIsNotKeySip(_0x3f9ef6,_0x8906e1){var _0x4aeb9f=_[_0x2203('0x1f')](_0x3f9ef6,function(_0x5ee83c){return util[_0x2203('0x20')](_0x2203('0x21'),_0x5ee83c[_0x2203('0x22')]);});for(var _0x3b4034 in _0x8906e1){if(_0x8906e1[_0x2203('0x23')](_0x3b4034)){if(!_0x4aeb9f[_0x3b4034]){delete _0x8906e1[_0x3b4034];}}}}function freeIsNotKeyAgent(_0x449039,_0x538c23){var _0x13d3f7=_['mapKeys'](_0x449039,function(_0x5ac866){var _0x15f543=_['isNil'](_0x5ac866[_0x2203('0x24')])?util[_0x2203('0x20')]('SIP/%s',_0x5ac866[_0x2203('0x22')]):_0x5ac866['interface'];return _0x15f543;});for(var _0x5c8da9 in _0x538c23){if(_0x538c23[_0x2203('0x23')](_0x5c8da9)){if(!_0x13d3f7[_0x5c8da9]){delete _0x538c23[_0x5c8da9];}}}}function clearVoiceCallReports(_0x2718f5){_0x2718f5[_0x2203('0x25')]=0x0;_0x2718f5[_0x2203('0x26')]=0x0;_0x2718f5[_0x2203('0x27')]=0x0;_0x2718f5[_0x2203('0x28')]=0x0;_0x2718f5[_0x2203('0x29')]=0x0;}function clearCampaigns(_0x250349){if(!_['isEmpty'](_0x250349)){for(var _0x143f41 in _0x250349){if(_0x250349[_0x2203('0x23')](_0x143f41)){_0x250349[_0x143f41][_0x2203('0x2a')]=0x0;_0x250349[_0x143f41]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0xb2071b){if(!_[_0x2203('0x2b')](_0xb2071b)){for(var _0x5c5fd3 in _0xb2071b){if(_0xb2071b[_0x2203('0x23')](_0x5c5fd3)){_0xb2071b[_0x5c5fd3][_0x2203('0x25')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x26')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2c')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2d')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x27')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x28')]=0x0;_0xb2071b[_0x5c5fd3]['sumBillable']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2e')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2f')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x30')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x31')]=0x0;_0xb2071b[_0x5c5fd3]['outboundNoSuchCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x32')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x33')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x34')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x35')]=0x0;_0xb2071b[_0x5c5fd3]['outboundOriginateFailureCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x36')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x37')]=0x0;_0xb2071b[_0x5c5fd3]['outboundAnswerAgiCallsDay']=0x0;_0xb2071b[_0x5c5fd3]['outboundAnswerCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x38')]=!![];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x125dfc,_0x464c88){for(var _0x191894 in _0x464c88){if(_0x125dfc[_0x2203('0x23')](_0x191894)){_0x125dfc[_0x191894]=_0x464c88[_0x191894];}}};Realtime[_0x2203('0x39')]['initAgents']=function(){var _0xb22e28=this;return function(_0x2324c0){if(_0x2324c0){freeIsNotKeyAgent(_0x2324c0,_0xb22e28['agents']);for(var _0x2a2ee7=0x0,_0x20fbe1={};_0x2a2ee7<_0x2324c0[_0x2203('0x3a')];_0x2a2ee7+=0x1){_0x20fbe1=_0x2324c0[_0x2a2ee7];var _0x4187b4=_[_0x2203('0x3b')](_0x20fbe1[_0x2203('0x24')])?util[_0x2203('0x20')](_0x2203('0x21'),_0x20fbe1[_0x2203('0x22')]):_0x20fbe1['interface'];if(_[_0x2203('0x3c')](_0xb22e28[_0x2203('0x3d')][_0x4187b4])){_0xb22e28['agents'][_0x4187b4]=new Agent(_0x20fbe1);}else{_0xb22e28['mergeFromDatabase'](_0xb22e28[_0x2203('0x3d')][_0x4187b4],_0x20fbe1);}}}return _0xb22e28['agents'];};};Realtime[_0x2203('0x39')][_0x2203('0x3e')]=function(){var _0x127ee3=this;return function(_0x5221f0){if(_0x5221f0){freeIsNotKeySip(_0x5221f0,_0x127ee3['telephones']);for(var _0x34cdeb=0x0,_0x47c93a={};_0x34cdeb<_0x5221f0[_0x2203('0x3a')];_0x34cdeb+=0x1){_0x47c93a=_0x5221f0[_0x34cdeb];if(_['isUndefined'](_0x127ee3[_0x2203('0x11')][util['format'](_0x2203('0x21'),_0x47c93a[_0x2203('0x22')])])){_0x127ee3[_0x2203('0x11')][util[_0x2203('0x20')](_0x2203('0x21'),_0x47c93a['name'])]=new Telephone(_0x47c93a);}else{_0x127ee3['mergeFromDatabase'](_0x127ee3['telephones'][util[_0x2203('0x20')](_0x2203('0x21'),_0x47c93a[_0x2203('0x22')])],_0x47c93a);}}}return _0x127ee3[_0x2203('0x11')];};};Realtime[_0x2203('0x39')][_0x2203('0x3f')]=function(){var _0x1c7e3d=this;return function(_0x590b4e){if(_0x590b4e){freeIsNotKeySip(_0x590b4e,_0x1c7e3d[_0x2203('0x12')]);for(var _0x1b12c3=0x0,_0x108fde={};_0x1b12c3<_0x590b4e[_0x2203('0x3a')];_0x1b12c3+=0x1){_0x108fde=_0x590b4e[_0x1b12c3];if(_['isUndefined'](_0x1c7e3d['trunks'][util[_0x2203('0x20')]('SIP/%s',_0x108fde[_0x2203('0x22')])])){_0x1c7e3d[_0x2203('0x12')][util[_0x2203('0x20')]('SIP/%s',_0x108fde['name'])]=new Trunk(_0x108fde);}else{_0x1c7e3d[_0x2203('0x40')](_0x1c7e3d[_0x2203('0x12')][util[_0x2203('0x20')](_0x2203('0x21'),_0x108fde[_0x2203('0x22')])],_0x108fde);}}}return _0x1c7e3d[_0x2203('0x12')];};};Realtime['prototype'][_0x2203('0x41')]=function(){var _0x165a3f=this;return function(_0x3a866c){if(_0x3a866c){freeIsNotKey(_0x3a866c,_0x165a3f[_0x2203('0x42')],'id');for(var _0x16b452=0x0,_0x36b99f={};_0x16b452<_0x3a866c[_0x2203('0x3a')];_0x16b452+=0x1){_0x36b99f=_0x3a866c[_0x16b452];if(_[_0x2203('0x3c')](_0x165a3f[_0x2203('0x42')][_0x36b99f['id']])){_0x165a3f[_0x2203('0x42')][_0x36b99f['id']]=new Trigger(_0x36b99f);}else{_0x165a3f['mergeFromDatabase'](_0x165a3f[_0x2203('0x42')][_0x36b99f['id']],_0x36b99f);}}}return _0x165a3f[_0x2203('0x42')];};};Realtime[_0x2203('0x39')][_0x2203('0x43')]=function(){var _0x4c3259=this;return function(_0x58bd5c){if(_0x58bd5c){freeIsNotKey(_0x58bd5c,_0x4c3259[_0x2203('0x44')],'id');for(var _0x48129c=0x0,_0x273e5f={};_0x48129c<_0x58bd5c[_0x2203('0x3a')];_0x48129c+=0x1){_0x273e5f=_0x58bd5c[_0x48129c];if(_[_0x2203('0x3c')](_0x4c3259[_0x2203('0x44')][_0x273e5f['id']])){_0x4c3259['templates'][_0x273e5f['id']]=new Template(_0x273e5f);}else{_0x4c3259[_0x2203('0x40')](_0x4c3259[_0x2203('0x44')][_0x273e5f['id']],_0x273e5f);}}}return _0x4c3259['templates'];};};Realtime[_0x2203('0x39')][_0x2203('0x45')]=function(){var _0x35b2e9=this;return function(_0x2600a9){if(_0x2600a9){freeIsNotKey(_0x2600a9,_0x35b2e9['zendeskAccounts'],'id');for(var _0x4c1a29=0x0,_0x21b8ab={};_0x4c1a29<_0x2600a9['length'];_0x4c1a29+=0x1){_0x21b8ab=_0x2600a9[_0x4c1a29];if(_['isUndefined'](_0x35b2e9[_0x2203('0x46')][_0x21b8ab['id']])){_0x35b2e9[_0x2203('0x46')][_0x21b8ab['id']]=new ZendeskAccount(_0x21b8ab);}else{_0x35b2e9[_0x2203('0x40')](_0x35b2e9['zendeskAccounts'][_0x21b8ab['id']],_0x21b8ab);}}}return _0x35b2e9['zendeskAccounts'];};};Realtime[_0x2203('0x39')][_0x2203('0x47')]=function(){var _0x12d7fa=this;return function(_0x21d2d7){if(_0x21d2d7){freeIsNotKey(_0x21d2d7,_0x12d7fa[_0x2203('0x48')],'id');for(var _0x21fd78=0x0,_0x4a7f4e={};_0x21fd78<_0x21d2d7[_0x2203('0x3a')];_0x21fd78+=0x1){_0x4a7f4e=_0x21d2d7[_0x21fd78];if(_['isUndefined'](_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']])){_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']]=new SalesforceAccount(_0x4a7f4e);}else{_0x12d7fa[_0x2203('0x40')](_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']],_0x4a7f4e);}}}return _0x12d7fa['salesforceAccounts'];};};Realtime['prototype'][_0x2203('0x49')]=function(){var _0x1f772d=this;return function(_0x126aad){if(_0x126aad){freeIsNotKey(_0x126aad,_0x1f772d[_0x2203('0x4a')],'id');for(var _0x559370=0x0,_0x4de47a={};_0x559370<_0x126aad['length'];_0x559370+=0x1){_0x4de47a=_0x126aad[_0x559370];if(_[_0x2203('0x3c')](_0x1f772d[_0x2203('0x4a')][_0x4de47a['id']])){_0x1f772d['freshdeskAccounts'][_0x4de47a['id']]=new FreshdeskAccount(_0x4de47a);}else{_0x1f772d[_0x2203('0x40')](_0x1f772d[_0x2203('0x4a')][_0x4de47a['id']],_0x4de47a);}}}return _0x1f772d['freshdeskAccounts'];};};Realtime[_0x2203('0x39')][_0x2203('0x4b')]=function(){var _0x172c6a=this;return function(_0x6a1877){if(_0x6a1877){freeIsNotKey(_0x6a1877,_0x172c6a['zohoAccounts'],'id');for(var _0x120db1=0x0,_0x5268d6={};_0x120db1<_0x6a1877[_0x2203('0x3a')];_0x120db1+=0x1){_0x5268d6=_0x6a1877[_0x120db1];if(_[_0x2203('0x3c')](_0x172c6a['zohoAccounts'][_0x5268d6['id']])){_0x172c6a[_0x2203('0x4c')][_0x5268d6['id']]=new ZohoAccount(_0x5268d6);}else{_0x172c6a[_0x2203('0x40')](_0x172c6a[_0x2203('0x4c')][_0x5268d6['id']],_0x5268d6);}}}return _0x172c6a[_0x2203('0x4c')];};};Realtime[_0x2203('0x39')][_0x2203('0x4d')]=function(){var _0x569d4a=this;return function(_0x562a3d){if(_0x562a3d){freeIsNotKey(_0x562a3d,_0x569d4a[_0x2203('0x19')],'id');for(var _0x524356=0x0,_0x56e881={};_0x524356<_0x562a3d[_0x2203('0x3a')];_0x524356+=0x1){_0x56e881=_0x562a3d[_0x524356];if(_[_0x2203('0x3c')](_0x569d4a[_0x2203('0x19')][_0x56e881['id']])){_0x569d4a['deskAccounts'][_0x56e881['id']]=new DeskAccount(_0x56e881);}else{_0x569d4a[_0x2203('0x40')](_0x569d4a['deskAccounts'][_0x56e881['id']],_0x56e881);}}}return _0x569d4a['deskAccounts'];};};Realtime[_0x2203('0x39')]['initSugarcrmAccounts']=function(){var _0x54ec71=this;return function(_0x5efc59){if(_0x5efc59){freeIsNotKey(_0x5efc59,_0x54ec71[_0x2203('0x18')],'id');for(var _0x31256b=0x0,_0x367122={};_0x31256b<_0x5efc59[_0x2203('0x3a')];_0x31256b+=0x1){_0x367122=_0x5efc59[_0x31256b];if(_[_0x2203('0x3c')](_0x54ec71[_0x2203('0x18')][_0x367122['id']])){_0x54ec71[_0x2203('0x18')][_0x367122['id']]=new SugarcrmAccount(_0x367122);}else{_0x54ec71[_0x2203('0x40')](_0x54ec71[_0x2203('0x18')][_0x367122['id']],_0x367122);}}}return _0x54ec71[_0x2203('0x18')];};};Realtime[_0x2203('0x39')][_0x2203('0x4e')]=function(){var _0x58ff57=this;return function(_0x585bde){if(_0x585bde){freeIsNotKey(_0x585bde,_0x58ff57[_0x2203('0x1a')],'id');for(var _0x43d8c0=0x0,_0x2511bd={};_0x43d8c0<_0x585bde[_0x2203('0x3a')];_0x43d8c0+=0x1){_0x2511bd=_0x585bde[_0x43d8c0];if(_[_0x2203('0x3c')](_0x58ff57[_0x2203('0x1a')][_0x2511bd['id']])){_0x58ff57['vtigerAccounts'][_0x2511bd['id']]=new VtigerAccount(_0x2511bd);}else{_0x58ff57['mergeFromDatabase'](_0x58ff57[_0x2203('0x1a')][_0x2511bd['id']],_0x2511bd);}}}return _0x58ff57[_0x2203('0x1a')];};};Realtime[_0x2203('0x39')][_0x2203('0x4f')]=function(){var _0xcab922=this;return function(_0x7b0b9c){if(_0x7b0b9c){freeIsNotKey(_0x7b0b9c,_0xcab922[_0x2203('0x1b')],'id');for(var _0x191b67=0x0,_0x2c6bcc={};_0x191b67<_0x7b0b9c[_0x2203('0x3a')];_0x191b67+=0x1){_0x2c6bcc=_0x7b0b9c[_0x191b67];if(_[_0x2203('0x3c')](_0xcab922['servicenowAccounts'][_0x2c6bcc['id']])){_0xcab922[_0x2203('0x1b')][_0x2c6bcc['id']]=new ServicenowAccount(_0x2c6bcc);}else{_0xcab922[_0x2203('0x40')](_0xcab922[_0x2203('0x1b')][_0x2c6bcc['id']],_0x2c6bcc);}}}return _0xcab922[_0x2203('0x1b')];};};Realtime[_0x2203('0x39')][_0x2203('0x50')]=function(){var _0x52c159=this;return function(_0x544756){if(_0x544756){freeIsNotKey(_0x544756,_0x52c159[_0x2203('0x1c')],'id');for(var _0x35b7b9=0x0,_0x49e795={};_0x35b7b9<_0x544756[_0x2203('0x3a')];_0x35b7b9+=0x1){_0x49e795=_0x544756[_0x35b7b9];if(_[_0x2203('0x3c')](_0x52c159[_0x2203('0x1c')][_0x49e795['id']])){_0x52c159[_0x2203('0x1c')][_0x49e795['id']]=new Dynamics365Account(_0x49e795);}else{_0x52c159[_0x2203('0x40')](_0x52c159[_0x2203('0x1c')][_0x49e795['id']],_0x49e795);}}}return _0x52c159[_0x2203('0x1c')];};};Realtime[_0x2203('0x39')][_0x2203('0x51')]=function(){var _0x519120=this;return function(_0x468619){if(_0x468619){freeIsNotKey(_0x468619,_0x519120[_0x2203('0x1d')],'id');for(var _0x465898=0x0,_0x4e461e={};_0x465898<_0x468619[_0x2203('0x3a')];_0x465898+=0x1){_0x4e461e=_0x468619[_0x465898];if(_[_0x2203('0x3c')](_0x519120[_0x2203('0x1d')][_0x4e461e['id']])){_0x519120[_0x2203('0x1d')][_0x4e461e['id']]=new FreshsalesAccount(_0x4e461e);}else{_0x519120[_0x2203('0x40')](_0x519120['freshsalesAccounts'][_0x4e461e['id']],_0x4e461e);}}}return _0x519120[_0x2203('0x1d')];};};Realtime[_0x2203('0x39')][_0x2203('0x52')]=function(){var _0x4dde80=this;return function(_0x5507b6){for(var _0x5d9ae2=0x0;_0x5d9ae2<_0x5507b6['length'];_0x5d9ae2+=0x1){_['merge'](_0x4dde80[_0x2203('0x13')][_0x5507b6[_0x5d9ae2][_0x2203('0x22')]],_0x5507b6[_0x5d9ae2]);}return _0x4dde80[_0x2203('0x13')];};};Realtime[_0x2203('0x39')][_0x2203('0x53')]=function(){var _0x169845=this;return function(_0x3f7926){clearVoiceQueues(_0x169845[_0x2203('0x13')]);if(_0x3f7926){_0x3f7926=_['groupBy'](_0x3f7926,'uniqueid');for(var _0xb54e51 in _0x3f7926){if(_0x3f7926[_0x2203('0x23')](_0xb54e51)){for(var _0xafcc82=0x0;_0xafcc82<_0x3f7926[_0xb54e51][_0x2203('0x3a')];_0xafcc82+=0x1){var _0x1bbd2d=_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x54')];if(_0x169845[_0x2203('0x13')][_0x1bbd2d]){if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x55')]){_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x2c')]+=0x1;}if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x56')]){_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x2d')]+=0x1;}_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x27')]+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x57')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x59')]),_0x2203('0x5a'))||0x0;if(_0xafcc82===_0x3f7926[_0xb54e51]['length']-0x1){_0x169845[_0x2203('0x13')][_0x1bbd2d]['sumDuration']+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5b')]||_0x3f7926[_0xb54e51][_0xafcc82]['queuecallerabandonAt']||_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5c')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x59')]),_0x2203('0x5a'))||0x0;_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x25')]+=0x1;if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5d')]){_0x169845[_0x2203('0x13')][_0x1bbd2d]['answered']+=0x1;_0x169845['voiceQueues'][_0x1bbd2d][_0x2203('0x29')]+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5b')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x169845['voiceQueues'][_0x1bbd2d][_0x2203('0x28')]+=_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x27')]||0x0;}}}}}}return _0x169845[_0x2203('0x13')];};};Realtime['prototype'][_0x2203('0x5e')]=function(){var _0x47a2c7=this;return function(_0x48bd5){clearVoiceCallReports(_0x47a2c7[_0x2203('0x15')]);if(_0x48bd5){for(var _0xe3bee5=0x0;_0xe3bee5<_0x48bd5[_0x2203('0x3a')];_0xe3bee5+=0x1){_0x47a2c7[_0x2203('0x15')]['total']+=0x1;_0x47a2c7[_0x2203('0x15')][_0x2203('0x28')]+=_0x48bd5[_0xe3bee5][_0x2203('0x5f')];if(_0x48bd5[_0xe3bee5]['disposition']===_0x2203('0x60')){_0x47a2c7[_0x2203('0x15')][_0x2203('0x26')]+=0x1;_0x47a2c7[_0x2203('0x15')][_0x2203('0x27')]+=_0x48bd5[_0xe3bee5][_0x2203('0x5f')]-_0x48bd5[_0xe3bee5][_0x2203('0x61')]||0x0;_0x47a2c7[_0x2203('0x15')][_0x2203('0x29')]+=_0x48bd5[_0xe3bee5][_0x2203('0x61')];}}}return _0x47a2c7[_0x2203('0x15')];};};Realtime['prototype'][_0x2203('0x62')]=function(){var _0x7f71b8=this;return function(_0x21b755){if(_0x21b755){freeIsNotKey(_0x21b755,_0x7f71b8[_0x2203('0x14')],_0x2203('0x22'));for(var _0x52c35e=0x0,_0x23f7b1={};_0x52c35e<_0x21b755[_0x2203('0x3a')];_0x52c35e+=0x1){_0x23f7b1=_0x21b755[_0x52c35e];if(_[_0x2203('0x3c')](_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]])){_0x7f71b8[_0x2203('0x14')][_0x23f7b1['name']]=new Campaign(_0x23f7b1);}else{_0x7f71b8['mergeFromDatabase'](_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]],_0x23f7b1);_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]][_0x2203('0x63')]=_0x23f7b1['SquareProject']?_0x23f7b1[_0x2203('0x64')][_0x2203('0x22')]:undefined;}}}return _0x7f71b8['campaigns'];};};Realtime['prototype']['initVoiceExtensions']=function(){var _0x4fc51a=this;return function(_0x5e07d7){if(_0x5e07d7){freeIsNotKey(_0x5e07d7,_0x4fc51a[_0x2203('0x65')],'id');for(var _0x6319a3=0x0,_0x437095={};_0x6319a3<_0x5e07d7['length'];_0x6319a3+=0x1){_0x437095=_0x5e07d7[_0x6319a3];if(_['isUndefined'](_0x4fc51a['voiceExtensions'][_0x437095['id']])){_0x4fc51a[_0x2203('0x65')][_0x437095['id']]=new VoiceExtension(_0x437095);}else{_0x4fc51a[_0x2203('0x40')](_0x4fc51a[_0x2203('0x65')][_0x437095['id']],_0x437095);}}}return _0x4fc51a[_0x2203('0x65')];};};Realtime[_0x2203('0x39')][_0x2203('0x66')]=function(){var _0x3d1797=this;return function(_0x52f25e){clearCampaigns(_0x3d1797[_0x2203('0x14')]);for(var _0x74843=0x0;_0x74843<_0x52f25e[_0x2203('0x3a')];_0x74843+=0x1){_[_0x2203('0x67')](_0x3d1797[_0x2203('0x14')][_0x52f25e[_0x74843][_0x2203('0x22')]],_0x52f25e[_0x74843]);}return _0x3d1797[_0x2203('0x14')];};};Realtime['prototype'][_0x2203('0x68')]=function(){var _0x51a2fe=this;return function(_0x5d0176){if(_0x5d0176){freeIsNotKey(_0x5d0176,_0x51a2fe[_0x2203('0x1e')],'id');for(var _0x5cd030=0x0,_0xb9588e={};_0x5cd030<_0x5d0176[_0x2203('0x3a')];_0x5cd030+=0x1){_0xb9588e=_0x5d0176[_0x5cd030];if(_['isUndefined'](_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']])){_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']]=new FaxAccount(_0xb9588e);}else{_0x51a2fe[_0x2203('0x40')](_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']],_0xb9588e);}}}return _0x51a2fe[_0x2203('0x1e')];};};Realtime[_0x2203('0x39')]['initVoiceQueues']=function(){var _0x215638=this;return function(_0x3541b3){if(_0x3541b3){freeIsNotKey(_0x3541b3,_0x215638['voiceQueues'],'name');for(var _0x377176=0x0,_0x3fe71b={};_0x377176<_0x3541b3[_0x2203('0x3a')];_0x377176+=0x1){_0x3fe71b=_0x3541b3[_0x377176];if(_[_0x2203('0x3c')](_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]])){_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]]=new VoiceQueue(_0x3fe71b);}else{_0x215638[_0x2203('0x40')](_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]],_0x3fe71b);}}}return _0x215638[_0x2203('0x13')];};};module[_0x2203('0x69')]=Realtime; \ No newline at end of file +var _0x2032=['voiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','exports','moment','util','../model/agent','../model/trunk','../model/voiceQueue','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/faxAccount','telephones','trunks','voiceQueues','campaigns','outbound','channels','queueChannels','sugarcrmAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','SIP/%s','name','hasOwnProperty','interface','total','answered','sumHoldTime','sumDuration','sumBillable','ivrTotalCallsDays','isEmpty','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundReCallsDay','queueStatusComplete','prototype','length','isNil','isUndefined','agents','initTelephones','initTrunks','mergeFromDatabase','initTriggers','triggers','initTemplates','templates','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x2032,0xd9));var _0x2203=function(_0xb29695,_0x311fe2){_0xb29695=_0xb29695-0x0;var _0x59c937=_0x2032[_0xb29695];return _0x59c937;};'use strict';var _=require('lodash');var moment=require(_0x2203('0x0'));var util=require(_0x2203('0x1'));var Agent=require(_0x2203('0x2'));var Telephone=require('../model/telephone');var Trunk=require(_0x2203('0x3'));var VoiceQueue=require(_0x2203('0x4'));var Trigger=require('../model/trigger');var Template=require(_0x2203('0x5'));var Campaign=require(_0x2203('0x6'));var VoiceExtension=require(_0x2203('0x7'));var ZendeskAccount=require(_0x2203('0x8'));var SalesforceAccount=require(_0x2203('0x9'));var FreshdeskAccount=require(_0x2203('0xa'));var SugarcrmAccount=require(_0x2203('0xb'));var ZohoAccount=require(_0x2203('0xc'));var DeskAccount=require(_0x2203('0xd'));var VtigerAccount=require(_0x2203('0xe'));var ServicenowAccount=require(_0x2203('0xf'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x2203('0x10'));function Realtime(){this['agents']={};this[_0x2203('0x11')]={};this[_0x2203('0x12')]={};this[_0x2203('0x13')]={};this['triggers']={};this[_0x2203('0x14')]={};this['templates']={};this[_0x2203('0x15')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x2203('0x16')]={};this[_0x2203('0x17')]={};this['outboundChannels']={};this['timers']={};this['settings']={};this['zendeskAccounts']={};this['salesforceAccounts']={};this[_0x2203('0x18')]={};this['freshdeskAccounts']={};this['zohoAccounts']={};this[_0x2203('0x19')]={};this[_0x2203('0x1a')]={};this[_0x2203('0x1b')]={};this[_0x2203('0x1c')]={};this[_0x2203('0x1d')]={};this[_0x2203('0x1e')]={};}function freeIsNotKey(_0x2c36e6,_0x2c085c,_0xdf9d0b){var _0x3053f3=_['mapKeys'](_0x2c36e6,function(_0x280eda){return _0x280eda[_0xdf9d0b];});for(var _0x2ee127 in _0x2c085c){if(_0x2c085c['hasOwnProperty'](_0x2ee127)){if(!_0x3053f3[_0x2ee127]){delete _0x2c085c[_0x2ee127];}}}}function freeIsNotKeySip(_0x3f9ef6,_0x8906e1){var _0x4aeb9f=_[_0x2203('0x1f')](_0x3f9ef6,function(_0x5ee83c){return util[_0x2203('0x20')](_0x2203('0x21'),_0x5ee83c[_0x2203('0x22')]);});for(var _0x3b4034 in _0x8906e1){if(_0x8906e1[_0x2203('0x23')](_0x3b4034)){if(!_0x4aeb9f[_0x3b4034]){delete _0x8906e1[_0x3b4034];}}}}function freeIsNotKeyAgent(_0x449039,_0x538c23){var _0x13d3f7=_['mapKeys'](_0x449039,function(_0x5ac866){var _0x15f543=_['isNil'](_0x5ac866[_0x2203('0x24')])?util[_0x2203('0x20')]('SIP/%s',_0x5ac866[_0x2203('0x22')]):_0x5ac866['interface'];return _0x15f543;});for(var _0x5c8da9 in _0x538c23){if(_0x538c23[_0x2203('0x23')](_0x5c8da9)){if(!_0x13d3f7[_0x5c8da9]){delete _0x538c23[_0x5c8da9];}}}}function clearVoiceCallReports(_0x2718f5){_0x2718f5[_0x2203('0x25')]=0x0;_0x2718f5[_0x2203('0x26')]=0x0;_0x2718f5[_0x2203('0x27')]=0x0;_0x2718f5[_0x2203('0x28')]=0x0;_0x2718f5[_0x2203('0x29')]=0x0;}function clearCampaigns(_0x250349){if(!_['isEmpty'](_0x250349)){for(var _0x143f41 in _0x250349){if(_0x250349[_0x2203('0x23')](_0x143f41)){_0x250349[_0x143f41][_0x2203('0x2a')]=0x0;_0x250349[_0x143f41]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0xb2071b){if(!_[_0x2203('0x2b')](_0xb2071b)){for(var _0x5c5fd3 in _0xb2071b){if(_0xb2071b[_0x2203('0x23')](_0x5c5fd3)){_0xb2071b[_0x5c5fd3][_0x2203('0x25')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x26')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2c')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2d')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x27')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x28')]=0x0;_0xb2071b[_0x5c5fd3]['sumBillable']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2e')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2f')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x30')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x31')]=0x0;_0xb2071b[_0x5c5fd3]['outboundNoSuchCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x32')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x33')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x34')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x35')]=0x0;_0xb2071b[_0x5c5fd3]['outboundOriginateFailureCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x36')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x37')]=0x0;_0xb2071b[_0x5c5fd3]['outboundAnswerAgiCallsDay']=0x0;_0xb2071b[_0x5c5fd3]['outboundAnswerCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x38')]=!![];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x125dfc,_0x464c88){for(var _0x191894 in _0x464c88){if(_0x125dfc[_0x2203('0x23')](_0x191894)){_0x125dfc[_0x191894]=_0x464c88[_0x191894];}}};Realtime[_0x2203('0x39')]['initAgents']=function(){var _0xb22e28=this;return function(_0x2324c0){if(_0x2324c0){freeIsNotKeyAgent(_0x2324c0,_0xb22e28['agents']);for(var _0x2a2ee7=0x0,_0x20fbe1={};_0x2a2ee7<_0x2324c0[_0x2203('0x3a')];_0x2a2ee7+=0x1){_0x20fbe1=_0x2324c0[_0x2a2ee7];var _0x4187b4=_[_0x2203('0x3b')](_0x20fbe1[_0x2203('0x24')])?util[_0x2203('0x20')](_0x2203('0x21'),_0x20fbe1[_0x2203('0x22')]):_0x20fbe1['interface'];if(_[_0x2203('0x3c')](_0xb22e28[_0x2203('0x3d')][_0x4187b4])){_0xb22e28['agents'][_0x4187b4]=new Agent(_0x20fbe1);}else{_0xb22e28['mergeFromDatabase'](_0xb22e28[_0x2203('0x3d')][_0x4187b4],_0x20fbe1);}}}return _0xb22e28['agents'];};};Realtime[_0x2203('0x39')][_0x2203('0x3e')]=function(){var _0x127ee3=this;return function(_0x5221f0){if(_0x5221f0){freeIsNotKeySip(_0x5221f0,_0x127ee3['telephones']);for(var _0x34cdeb=0x0,_0x47c93a={};_0x34cdeb<_0x5221f0[_0x2203('0x3a')];_0x34cdeb+=0x1){_0x47c93a=_0x5221f0[_0x34cdeb];if(_['isUndefined'](_0x127ee3[_0x2203('0x11')][util['format'](_0x2203('0x21'),_0x47c93a[_0x2203('0x22')])])){_0x127ee3[_0x2203('0x11')][util[_0x2203('0x20')](_0x2203('0x21'),_0x47c93a['name'])]=new Telephone(_0x47c93a);}else{_0x127ee3['mergeFromDatabase'](_0x127ee3['telephones'][util[_0x2203('0x20')](_0x2203('0x21'),_0x47c93a[_0x2203('0x22')])],_0x47c93a);}}}return _0x127ee3[_0x2203('0x11')];};};Realtime[_0x2203('0x39')][_0x2203('0x3f')]=function(){var _0x1c7e3d=this;return function(_0x590b4e){if(_0x590b4e){freeIsNotKeySip(_0x590b4e,_0x1c7e3d[_0x2203('0x12')]);for(var _0x1b12c3=0x0,_0x108fde={};_0x1b12c3<_0x590b4e[_0x2203('0x3a')];_0x1b12c3+=0x1){_0x108fde=_0x590b4e[_0x1b12c3];if(_['isUndefined'](_0x1c7e3d['trunks'][util[_0x2203('0x20')]('SIP/%s',_0x108fde[_0x2203('0x22')])])){_0x1c7e3d[_0x2203('0x12')][util[_0x2203('0x20')]('SIP/%s',_0x108fde['name'])]=new Trunk(_0x108fde);}else{_0x1c7e3d[_0x2203('0x40')](_0x1c7e3d[_0x2203('0x12')][util[_0x2203('0x20')](_0x2203('0x21'),_0x108fde[_0x2203('0x22')])],_0x108fde);}}}return _0x1c7e3d[_0x2203('0x12')];};};Realtime['prototype'][_0x2203('0x41')]=function(){var _0x165a3f=this;return function(_0x3a866c){if(_0x3a866c){freeIsNotKey(_0x3a866c,_0x165a3f[_0x2203('0x42')],'id');for(var _0x16b452=0x0,_0x36b99f={};_0x16b452<_0x3a866c[_0x2203('0x3a')];_0x16b452+=0x1){_0x36b99f=_0x3a866c[_0x16b452];if(_[_0x2203('0x3c')](_0x165a3f[_0x2203('0x42')][_0x36b99f['id']])){_0x165a3f[_0x2203('0x42')][_0x36b99f['id']]=new Trigger(_0x36b99f);}else{_0x165a3f['mergeFromDatabase'](_0x165a3f[_0x2203('0x42')][_0x36b99f['id']],_0x36b99f);}}}return _0x165a3f[_0x2203('0x42')];};};Realtime[_0x2203('0x39')][_0x2203('0x43')]=function(){var _0x4c3259=this;return function(_0x58bd5c){if(_0x58bd5c){freeIsNotKey(_0x58bd5c,_0x4c3259[_0x2203('0x44')],'id');for(var _0x48129c=0x0,_0x273e5f={};_0x48129c<_0x58bd5c[_0x2203('0x3a')];_0x48129c+=0x1){_0x273e5f=_0x58bd5c[_0x48129c];if(_[_0x2203('0x3c')](_0x4c3259[_0x2203('0x44')][_0x273e5f['id']])){_0x4c3259['templates'][_0x273e5f['id']]=new Template(_0x273e5f);}else{_0x4c3259[_0x2203('0x40')](_0x4c3259[_0x2203('0x44')][_0x273e5f['id']],_0x273e5f);}}}return _0x4c3259['templates'];};};Realtime[_0x2203('0x39')][_0x2203('0x45')]=function(){var _0x35b2e9=this;return function(_0x2600a9){if(_0x2600a9){freeIsNotKey(_0x2600a9,_0x35b2e9['zendeskAccounts'],'id');for(var _0x4c1a29=0x0,_0x21b8ab={};_0x4c1a29<_0x2600a9['length'];_0x4c1a29+=0x1){_0x21b8ab=_0x2600a9[_0x4c1a29];if(_['isUndefined'](_0x35b2e9[_0x2203('0x46')][_0x21b8ab['id']])){_0x35b2e9[_0x2203('0x46')][_0x21b8ab['id']]=new ZendeskAccount(_0x21b8ab);}else{_0x35b2e9[_0x2203('0x40')](_0x35b2e9['zendeskAccounts'][_0x21b8ab['id']],_0x21b8ab);}}}return _0x35b2e9['zendeskAccounts'];};};Realtime[_0x2203('0x39')][_0x2203('0x47')]=function(){var _0x12d7fa=this;return function(_0x21d2d7){if(_0x21d2d7){freeIsNotKey(_0x21d2d7,_0x12d7fa[_0x2203('0x48')],'id');for(var _0x21fd78=0x0,_0x4a7f4e={};_0x21fd78<_0x21d2d7[_0x2203('0x3a')];_0x21fd78+=0x1){_0x4a7f4e=_0x21d2d7[_0x21fd78];if(_['isUndefined'](_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']])){_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']]=new SalesforceAccount(_0x4a7f4e);}else{_0x12d7fa[_0x2203('0x40')](_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']],_0x4a7f4e);}}}return _0x12d7fa['salesforceAccounts'];};};Realtime['prototype'][_0x2203('0x49')]=function(){var _0x1f772d=this;return function(_0x126aad){if(_0x126aad){freeIsNotKey(_0x126aad,_0x1f772d[_0x2203('0x4a')],'id');for(var _0x559370=0x0,_0x4de47a={};_0x559370<_0x126aad['length'];_0x559370+=0x1){_0x4de47a=_0x126aad[_0x559370];if(_[_0x2203('0x3c')](_0x1f772d[_0x2203('0x4a')][_0x4de47a['id']])){_0x1f772d['freshdeskAccounts'][_0x4de47a['id']]=new FreshdeskAccount(_0x4de47a);}else{_0x1f772d[_0x2203('0x40')](_0x1f772d[_0x2203('0x4a')][_0x4de47a['id']],_0x4de47a);}}}return _0x1f772d['freshdeskAccounts'];};};Realtime[_0x2203('0x39')][_0x2203('0x4b')]=function(){var _0x172c6a=this;return function(_0x6a1877){if(_0x6a1877){freeIsNotKey(_0x6a1877,_0x172c6a['zohoAccounts'],'id');for(var _0x120db1=0x0,_0x5268d6={};_0x120db1<_0x6a1877[_0x2203('0x3a')];_0x120db1+=0x1){_0x5268d6=_0x6a1877[_0x120db1];if(_[_0x2203('0x3c')](_0x172c6a['zohoAccounts'][_0x5268d6['id']])){_0x172c6a[_0x2203('0x4c')][_0x5268d6['id']]=new ZohoAccount(_0x5268d6);}else{_0x172c6a[_0x2203('0x40')](_0x172c6a[_0x2203('0x4c')][_0x5268d6['id']],_0x5268d6);}}}return _0x172c6a[_0x2203('0x4c')];};};Realtime[_0x2203('0x39')][_0x2203('0x4d')]=function(){var _0x569d4a=this;return function(_0x562a3d){if(_0x562a3d){freeIsNotKey(_0x562a3d,_0x569d4a[_0x2203('0x19')],'id');for(var _0x524356=0x0,_0x56e881={};_0x524356<_0x562a3d[_0x2203('0x3a')];_0x524356+=0x1){_0x56e881=_0x562a3d[_0x524356];if(_[_0x2203('0x3c')](_0x569d4a[_0x2203('0x19')][_0x56e881['id']])){_0x569d4a['deskAccounts'][_0x56e881['id']]=new DeskAccount(_0x56e881);}else{_0x569d4a[_0x2203('0x40')](_0x569d4a['deskAccounts'][_0x56e881['id']],_0x56e881);}}}return _0x569d4a['deskAccounts'];};};Realtime[_0x2203('0x39')]['initSugarcrmAccounts']=function(){var _0x54ec71=this;return function(_0x5efc59){if(_0x5efc59){freeIsNotKey(_0x5efc59,_0x54ec71[_0x2203('0x18')],'id');for(var _0x31256b=0x0,_0x367122={};_0x31256b<_0x5efc59[_0x2203('0x3a')];_0x31256b+=0x1){_0x367122=_0x5efc59[_0x31256b];if(_[_0x2203('0x3c')](_0x54ec71[_0x2203('0x18')][_0x367122['id']])){_0x54ec71[_0x2203('0x18')][_0x367122['id']]=new SugarcrmAccount(_0x367122);}else{_0x54ec71[_0x2203('0x40')](_0x54ec71[_0x2203('0x18')][_0x367122['id']],_0x367122);}}}return _0x54ec71[_0x2203('0x18')];};};Realtime[_0x2203('0x39')][_0x2203('0x4e')]=function(){var _0x58ff57=this;return function(_0x585bde){if(_0x585bde){freeIsNotKey(_0x585bde,_0x58ff57[_0x2203('0x1a')],'id');for(var _0x43d8c0=0x0,_0x2511bd={};_0x43d8c0<_0x585bde[_0x2203('0x3a')];_0x43d8c0+=0x1){_0x2511bd=_0x585bde[_0x43d8c0];if(_[_0x2203('0x3c')](_0x58ff57[_0x2203('0x1a')][_0x2511bd['id']])){_0x58ff57['vtigerAccounts'][_0x2511bd['id']]=new VtigerAccount(_0x2511bd);}else{_0x58ff57['mergeFromDatabase'](_0x58ff57[_0x2203('0x1a')][_0x2511bd['id']],_0x2511bd);}}}return _0x58ff57[_0x2203('0x1a')];};};Realtime[_0x2203('0x39')][_0x2203('0x4f')]=function(){var _0xcab922=this;return function(_0x7b0b9c){if(_0x7b0b9c){freeIsNotKey(_0x7b0b9c,_0xcab922[_0x2203('0x1b')],'id');for(var _0x191b67=0x0,_0x2c6bcc={};_0x191b67<_0x7b0b9c[_0x2203('0x3a')];_0x191b67+=0x1){_0x2c6bcc=_0x7b0b9c[_0x191b67];if(_[_0x2203('0x3c')](_0xcab922['servicenowAccounts'][_0x2c6bcc['id']])){_0xcab922[_0x2203('0x1b')][_0x2c6bcc['id']]=new ServicenowAccount(_0x2c6bcc);}else{_0xcab922[_0x2203('0x40')](_0xcab922[_0x2203('0x1b')][_0x2c6bcc['id']],_0x2c6bcc);}}}return _0xcab922[_0x2203('0x1b')];};};Realtime[_0x2203('0x39')][_0x2203('0x50')]=function(){var _0x52c159=this;return function(_0x544756){if(_0x544756){freeIsNotKey(_0x544756,_0x52c159[_0x2203('0x1c')],'id');for(var _0x35b7b9=0x0,_0x49e795={};_0x35b7b9<_0x544756[_0x2203('0x3a')];_0x35b7b9+=0x1){_0x49e795=_0x544756[_0x35b7b9];if(_[_0x2203('0x3c')](_0x52c159[_0x2203('0x1c')][_0x49e795['id']])){_0x52c159[_0x2203('0x1c')][_0x49e795['id']]=new Dynamics365Account(_0x49e795);}else{_0x52c159[_0x2203('0x40')](_0x52c159[_0x2203('0x1c')][_0x49e795['id']],_0x49e795);}}}return _0x52c159[_0x2203('0x1c')];};};Realtime[_0x2203('0x39')][_0x2203('0x51')]=function(){var _0x519120=this;return function(_0x468619){if(_0x468619){freeIsNotKey(_0x468619,_0x519120[_0x2203('0x1d')],'id');for(var _0x465898=0x0,_0x4e461e={};_0x465898<_0x468619[_0x2203('0x3a')];_0x465898+=0x1){_0x4e461e=_0x468619[_0x465898];if(_[_0x2203('0x3c')](_0x519120[_0x2203('0x1d')][_0x4e461e['id']])){_0x519120[_0x2203('0x1d')][_0x4e461e['id']]=new FreshsalesAccount(_0x4e461e);}else{_0x519120[_0x2203('0x40')](_0x519120['freshsalesAccounts'][_0x4e461e['id']],_0x4e461e);}}}return _0x519120[_0x2203('0x1d')];};};Realtime[_0x2203('0x39')][_0x2203('0x52')]=function(){var _0x4dde80=this;return function(_0x5507b6){for(var _0x5d9ae2=0x0;_0x5d9ae2<_0x5507b6['length'];_0x5d9ae2+=0x1){_['merge'](_0x4dde80[_0x2203('0x13')][_0x5507b6[_0x5d9ae2][_0x2203('0x22')]],_0x5507b6[_0x5d9ae2]);}return _0x4dde80[_0x2203('0x13')];};};Realtime[_0x2203('0x39')][_0x2203('0x53')]=function(){var _0x169845=this;return function(_0x3f7926){clearVoiceQueues(_0x169845[_0x2203('0x13')]);if(_0x3f7926){_0x3f7926=_['groupBy'](_0x3f7926,'uniqueid');for(var _0xb54e51 in _0x3f7926){if(_0x3f7926[_0x2203('0x23')](_0xb54e51)){for(var _0xafcc82=0x0;_0xafcc82<_0x3f7926[_0xb54e51][_0x2203('0x3a')];_0xafcc82+=0x1){var _0x1bbd2d=_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x54')];if(_0x169845[_0x2203('0x13')][_0x1bbd2d]){if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x55')]){_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x2c')]+=0x1;}if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x56')]){_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x2d')]+=0x1;}_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x27')]+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x57')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x59')]),_0x2203('0x5a'))||0x0;if(_0xafcc82===_0x3f7926[_0xb54e51]['length']-0x1){_0x169845[_0x2203('0x13')][_0x1bbd2d]['sumDuration']+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5b')]||_0x3f7926[_0xb54e51][_0xafcc82]['queuecallerabandonAt']||_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5c')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x59')]),_0x2203('0x5a'))||0x0;_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x25')]+=0x1;if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5d')]){_0x169845[_0x2203('0x13')][_0x1bbd2d]['answered']+=0x1;_0x169845['voiceQueues'][_0x1bbd2d][_0x2203('0x29')]+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5b')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x169845['voiceQueues'][_0x1bbd2d][_0x2203('0x28')]+=_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x27')]||0x0;}}}}}}return _0x169845[_0x2203('0x13')];};};Realtime['prototype'][_0x2203('0x5e')]=function(){var _0x47a2c7=this;return function(_0x48bd5){clearVoiceCallReports(_0x47a2c7[_0x2203('0x15')]);if(_0x48bd5){for(var _0xe3bee5=0x0;_0xe3bee5<_0x48bd5[_0x2203('0x3a')];_0xe3bee5+=0x1){_0x47a2c7[_0x2203('0x15')]['total']+=0x1;_0x47a2c7[_0x2203('0x15')][_0x2203('0x28')]+=_0x48bd5[_0xe3bee5][_0x2203('0x5f')];if(_0x48bd5[_0xe3bee5]['disposition']===_0x2203('0x60')){_0x47a2c7[_0x2203('0x15')][_0x2203('0x26')]+=0x1;_0x47a2c7[_0x2203('0x15')][_0x2203('0x27')]+=_0x48bd5[_0xe3bee5][_0x2203('0x5f')]-_0x48bd5[_0xe3bee5][_0x2203('0x61')]||0x0;_0x47a2c7[_0x2203('0x15')][_0x2203('0x29')]+=_0x48bd5[_0xe3bee5][_0x2203('0x61')];}}}return _0x47a2c7[_0x2203('0x15')];};};Realtime['prototype'][_0x2203('0x62')]=function(){var _0x7f71b8=this;return function(_0x21b755){if(_0x21b755){freeIsNotKey(_0x21b755,_0x7f71b8[_0x2203('0x14')],_0x2203('0x22'));for(var _0x52c35e=0x0,_0x23f7b1={};_0x52c35e<_0x21b755[_0x2203('0x3a')];_0x52c35e+=0x1){_0x23f7b1=_0x21b755[_0x52c35e];if(_[_0x2203('0x3c')](_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]])){_0x7f71b8[_0x2203('0x14')][_0x23f7b1['name']]=new Campaign(_0x23f7b1);}else{_0x7f71b8['mergeFromDatabase'](_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]],_0x23f7b1);_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]][_0x2203('0x63')]=_0x23f7b1['SquareProject']?_0x23f7b1[_0x2203('0x64')][_0x2203('0x22')]:undefined;}}}return _0x7f71b8['campaigns'];};};Realtime['prototype']['initVoiceExtensions']=function(){var _0x4fc51a=this;return function(_0x5e07d7){if(_0x5e07d7){freeIsNotKey(_0x5e07d7,_0x4fc51a[_0x2203('0x65')],'id');for(var _0x6319a3=0x0,_0x437095={};_0x6319a3<_0x5e07d7['length'];_0x6319a3+=0x1){_0x437095=_0x5e07d7[_0x6319a3];if(_['isUndefined'](_0x4fc51a['voiceExtensions'][_0x437095['id']])){_0x4fc51a[_0x2203('0x65')][_0x437095['id']]=new VoiceExtension(_0x437095);}else{_0x4fc51a[_0x2203('0x40')](_0x4fc51a[_0x2203('0x65')][_0x437095['id']],_0x437095);}}}return _0x4fc51a[_0x2203('0x65')];};};Realtime[_0x2203('0x39')][_0x2203('0x66')]=function(){var _0x3d1797=this;return function(_0x52f25e){clearCampaigns(_0x3d1797[_0x2203('0x14')]);for(var _0x74843=0x0;_0x74843<_0x52f25e[_0x2203('0x3a')];_0x74843+=0x1){_[_0x2203('0x67')](_0x3d1797[_0x2203('0x14')][_0x52f25e[_0x74843][_0x2203('0x22')]],_0x52f25e[_0x74843]);}return _0x3d1797[_0x2203('0x14')];};};Realtime['prototype'][_0x2203('0x68')]=function(){var _0x51a2fe=this;return function(_0x5d0176){if(_0x5d0176){freeIsNotKey(_0x5d0176,_0x51a2fe[_0x2203('0x1e')],'id');for(var _0x5cd030=0x0,_0xb9588e={};_0x5cd030<_0x5d0176[_0x2203('0x3a')];_0x5cd030+=0x1){_0xb9588e=_0x5d0176[_0x5cd030];if(_['isUndefined'](_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']])){_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']]=new FaxAccount(_0xb9588e);}else{_0x51a2fe[_0x2203('0x40')](_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']],_0xb9588e);}}}return _0x51a2fe[_0x2203('0x1e')];};};Realtime[_0x2203('0x39')]['initVoiceQueues']=function(){var _0x215638=this;return function(_0x3541b3){if(_0x3541b3){freeIsNotKey(_0x3541b3,_0x215638['voiceQueues'],'name');for(var _0x377176=0x0,_0x3fe71b={};_0x377176<_0x3541b3[_0x2203('0x3a')];_0x377176+=0x1){_0x3fe71b=_0x3541b3[_0x377176];if(_[_0x2203('0x3c')](_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]])){_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]]=new VoiceQueue(_0x3fe71b);}else{_0x215638[_0x2203('0x40')](_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]],_0x3fe71b);}}}return _0x215638[_0x2203('0x13')];};};module[_0x2203('0x69')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index a4a5a28..8ac6822 100644 --- a/server/services/ami/realtime/utils.js +++ b/server/services/ami/realtime/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4280=['mergeDBDataToRealtime','assign','hasOwnProperty'];(function(_0x1fc3ae,_0x14e4b8){var _0x5ede72=function(_0x1e3b0e){while(--_0x1e3b0e){_0x1fc3ae['push'](_0x1fc3ae['shift']());}};_0x5ede72(++_0x14e4b8);}(_0x4280,0xe8));var _0x0428=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4280[_0x3dd15e];return _0x231fd0;};'use strict';function mergeDBDataToRealtime(_0x3aa81f,_0x3f0042){var _0x3826e5=Object[_0x0428('0x0')]({},_0x3aa81f);for(var _0xb649e0 in _0x3f0042){if(_0x3826e5[_0x0428('0x1')](_0xb649e0)){_0x3826e5[_0xb649e0]=_0x3f0042[_0xb649e0];}}return _0x3826e5;}exports[_0x0428('0x2')]=mergeDBDataToRealtime; \ No newline at end of file +var _0x6134=['hasOwnProperty','mergeDBDataToRealtime'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6134,0x74));var _0x4613=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x6134[_0x46aff0];return _0x9d78cf;};'use strict';function mergeDBDataToRealtime(_0x1f2057,_0x4665d7){var _0x201a85=Object['assign']({},_0x1f2057);for(var _0x1b2bb5 in _0x4665d7){if(_0x201a85[_0x4613('0x0')](_0x1b2bb5)){_0x201a85[_0x1b2bb5]=_0x4665d7[_0x1b2bb5];}}return _0x201a85;}exports[_0x4613('0x1')]=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 24dfb80..e73d734 100644 --- a/server/services/ami/report/index.js +++ b/server/services/ami/report/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaf9b=['calleridpreview','originatecalleridnum','destinationchannel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','linkedid','transfereelinkedid','uniqueid','transfers','UserId','membername','monitor','monitors','monitorFilename','createdAt','connectedlinename','exten','xcally-motion-dialer','voiceAgentReport','forEach','substring','indexOf','mobile','transfererlinkedid','attendedTransfer','exports','lodash','../../../config/environment','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceDialReport','agents','telephones','prototype','sync','realtime','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','findAgent','find','accountcode','name','isNil','interface','format','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','getAgentByInternal','keys','channel','calleridnum','outbound','internal','destination','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview'];(function(_0x4ed997,_0x479eef){var _0x13132d=function(_0x4c24da){while(--_0x4c24da){_0x4ed997['push'](_0x4ed997['shift']());}};_0x13132d(++_0x479eef);}(_0xaf9b,0x18c));var _0xbaf9=function(_0x34407b,_0x75ade6){_0x34407b=_0x34407b-0x0;var _0x3d1302=_0xaf9b[_0x34407b];return _0x3d1302;};'use strict';var _=require(_0xbaf9('0x0'));var moment=require('moment');var util=require('util');var config=require(_0xbaf9('0x1'));var ami=require('../ami');var RpcVoiceAgentReport=require(_0xbaf9('0x2'));var RpcVoiceCallReport=require(_0xbaf9('0x3'));var RpcVoiceDialReport=require(_0xbaf9('0x4'));var RpcMemberReport=require(_0xbaf9('0x5'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0xbaf9('0x6'));var RpcVoiceTransferReport=require(_0xbaf9('0x7'));var VoiceQueueReport=require(_0xbaf9('0x8'));var VoiceCallReport=require(_0xbaf9('0x9'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0xbaf9('0xa'));var UserReport=require('./userReport');function Report(_0x48ece3){this['realtime']=_0x48ece3;this[_0xbaf9('0xb')]=_0x48ece3[_0xbaf9('0xb')];this[_0xbaf9('0xc')]=_0x48ece3[_0xbaf9('0xc')];}Report[_0xbaf9('0xd')][_0xbaf9('0xe')]=function(_0x5d7b1d){var _0x69de56=new VoiceQueueReport(this[_0xbaf9('0xf')]);var _0x4354e3=new VoiceAgentReport(this['realtime']);var _0x30507c=new VoiceDialReport(this[_0xbaf9('0xf')]);var _0x555c68=new VoiceCallReport(this[_0xbaf9('0xf')]);var _0x35bd62=new UserReport(this[_0xbaf9('0xf')]);if(config[_0xbaf9('0x10')]&&config[_0xbaf9('0x10')][_0xbaf9('0x11')]){ami['on'](_0xbaf9('0x12'),this[_0xbaf9('0x13')][_0xbaf9('0x14')](this));ami['on'](_0xbaf9('0x15'),this[_0xbaf9('0x16')][_0xbaf9('0x14')](this));ami['on'](_0xbaf9('0x17'),this['voiceAgentReport'][_0xbaf9('0x14')](this));ami['on'](_0xbaf9('0x18'),this[_0xbaf9('0x19')][_0xbaf9('0x14')](this));ami['on'](_0xbaf9('0x1a'),this[_0xbaf9('0x1b')][_0xbaf9('0x14')](this));ami['on'](_0xbaf9('0x1c'),this['attendedTransfer'][_0xbaf9('0x14')](this));}};Report[_0xbaf9('0xd')][_0xbaf9('0x1d')]=function(_0x97831a){var _0x5638b8;_0x5638b8=_[_0xbaf9('0x1e')](this[_0xbaf9('0xb')],function(_0x14286f){return _0x14286f[_0xbaf9('0x1f')]==_0x97831a||_0x14286f[_0xbaf9('0x20')]==_0x97831a;});if(_[_0xbaf9('0x21')](_0x5638b8)){var _0x1ee6c2=_[_0xbaf9('0x1e')](this['telephones'],function(_0x1bf7b6){return _0x1bf7b6[_0xbaf9('0x1f')]==_0x97831a||_0x1bf7b6['name']==_0x97831a;});if(_0x1ee6c2){_0x5638b8=_[_0xbaf9('0x1e')](this[_0xbaf9('0xb')],function(_0x4253bd){return _0x4253bd[_0xbaf9('0x22')]==util[_0xbaf9('0x23')](_0xbaf9('0x24'),_0x1ee6c2[_0xbaf9('0x20')]);});}}return _0x5638b8;};Report[_0xbaf9('0xd')]['voiceQueueReport']=function(_0x6d68a0){for(var _0x1b70d3=0x0;_0x1b70d3<_0x6d68a0[_0xbaf9('0x25')];_0x1b70d3+=0x1){var _0x5f3b84=this['findAgent'](_0x6d68a0[_0x1b70d3][_0xbaf9('0x26')]);if(_0x5f3b84){_0x6d68a0[_0x1b70d3][_0xbaf9('0x1f')]=_0x5f3b84[_0xbaf9('0x1f')];_0x6d68a0[_0x1b70d3][_0xbaf9('0x27')]=!![];_0x6d68a0[_0x1b70d3][_0xbaf9('0x28')]=_0x5f3b84[_0xbaf9('0x20')];_0x6d68a0[_0x1b70d3][_0xbaf9('0x22')]=_[_0xbaf9('0x21')](_0x5f3b84[_0xbaf9('0x22')])?util['format'](_0xbaf9('0x24'),_0x5f3b84[_0xbaf9('0x20')]):_0x5f3b84[_0xbaf9('0x22')];if(_0x6d68a0[_0x1b70d3][_0xbaf9('0x29')]){_0x6d68a0[_0x1b70d3][_0xbaf9('0x2a')]=moment()[_0xbaf9('0x23')](_0xbaf9('0x2b'));}if(_0x6d68a0[_0x1b70d3][_0xbaf9('0x2c')]){_0x6d68a0[_0x1b70d3][_0xbaf9('0x2d')]=moment()[_0xbaf9('0x23')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0xbaf9('0x13')](_0x6d68a0[_0x1b70d3]);}RpcVoiceQueueReport[_0xbaf9('0x2e')](_0x6d68a0[_0x1b70d3]);}};function extractCalleridNumber(_0x41c35c){var _0x48f008=_0x41c35c['match'](/<(.*?)>/);return _0x48f008?_0x48f008[0x1]:_0x41c35c;}Report[_0xbaf9('0xd')][_0xbaf9('0x2f')]=function(_0x113cf6){for(var _0x1c7294=0x0;_0x1c7294','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','type','UserId','split','membername','monitorFilename','monitors','filename','createdAt','connectedlinename','xcally-motion-dialer','forEach','startsWith','Local','indexOf','phone','substring','lastIndexOf','transfererlinkedid','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceCallReport'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1d11,0xac));var _0x11d1=function(_0x5bcf1,_0x4c44b4){_0x5bcf1=_0x5bcf1-0x0;var _0xfccb75=_0x1d11[_0x5bcf1];return _0xfccb75;};'use strict';var _=require(_0x11d1('0x0'));var moment=require(_0x11d1('0x1'));var util=require(_0x11d1('0x2'));var config=require(_0x11d1('0x3'));var ami=require(_0x11d1('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x11d1('0x5'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0x11d1('0x6'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0x11d1('0x7'));var RpcVoiceTransferReport=require(_0x11d1('0x8'));var VoiceQueueReport=require(_0x11d1('0x9'));var VoiceCallReport=require(_0x11d1('0xa'));var VoiceAgentReport=require(_0x11d1('0xb'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require('./userReport');function Report(_0x412467){this[_0x11d1('0xc')]=_0x412467;this[_0x11d1('0xd')]=_0x412467[_0x11d1('0xd')];this[_0x11d1('0xe')]=_0x412467[_0x11d1('0xe')];}Report['prototype']['sync']=function(_0x1b99ba){var _0x3a4c43=new VoiceQueueReport(this[_0x11d1('0xc')]);var _0x458de2=new VoiceAgentReport(this[_0x11d1('0xc')]);var _0xb809ad=new VoiceDialReport(this[_0x11d1('0xc')]);var _0x43c3c9=new VoiceCallReport(this[_0x11d1('0xc')]);var _0x54d457=new UserReport(this[_0x11d1('0xc')]);if(config['xdr']&&config['xdr'][_0x11d1('0xf')]){ami['on'](_0x11d1('0x10'),this['voiceQueueReport'][_0x11d1('0x11')](this));ami['on'](_0x11d1('0x12'),this[_0x11d1('0x13')][_0x11d1('0x11')](this));ami['on']('custom:voiceAgentReport',this[_0x11d1('0x14')][_0x11d1('0x11')](this));ami['on']('custom:voiceDialReport',this[_0x11d1('0x15')][_0x11d1('0x11')](this));ami['on']('blindtransfer',this[_0x11d1('0x16')][_0x11d1('0x11')](this));ami['on'](_0x11d1('0x17'),this[_0x11d1('0x18')]['bind'](this));}};Report[_0x11d1('0x19')][_0x11d1('0x1a')]=function(_0x3bfed1){var _0x1071b6;_0x1071b6=_['find'](this[_0x11d1('0xd')],function(_0x446a53){return _0x446a53['accountcode']==_0x3bfed1||_0x446a53['name']==_0x3bfed1;});if(_[_0x11d1('0x1b')](_0x1071b6)){var _0x2ac200=_[_0x11d1('0x1c')](this['telephones'],function(_0x13ca2a){return _0x13ca2a[_0x11d1('0x1d')]==_0x3bfed1||_0x13ca2a[_0x11d1('0x1e')]==_0x3bfed1;});if(_0x2ac200){_0x1071b6=_['find'](this[_0x11d1('0xd')],function(_0x4ff3e2){return _0x4ff3e2[_0x11d1('0x1f')]==util[_0x11d1('0x20')](_0x11d1('0x21'),_0x2ac200[_0x11d1('0x1e')]);});}}return _0x1071b6;};Report[_0x11d1('0x19')][_0x11d1('0x22')]=function(_0x37ae46){for(var _0x258348=0x0;_0x258348<_0x37ae46[_0x11d1('0x23')];_0x258348+=0x1){var _0x396a37=this['findAgent'](_0x37ae46[_0x258348][_0x11d1('0x24')]);if(_0x396a37){_0x37ae46[_0x258348]['accountcode']=_0x396a37[_0x11d1('0x1d')];_0x37ae46[_0x258348][_0x11d1('0x25')]=!![];_0x37ae46[_0x258348]['lastAssignedTo']=_0x396a37[_0x11d1('0x1e')];_0x37ae46[_0x258348]['interface']=_['isNil'](_0x396a37[_0x11d1('0x1f')])?util[_0x11d1('0x20')](_0x11d1('0x21'),_0x396a37['name']):_0x396a37[_0x11d1('0x1f')];if(_0x37ae46[_0x258348][_0x11d1('0x26')]){_0x37ae46[_0x258348][_0x11d1('0x27')]=moment()['format'](_0x11d1('0x28'));}if(_0x37ae46[_0x258348][_0x11d1('0x29')]){_0x37ae46[_0x258348]['queuecallerexitAt']=moment()[_0x11d1('0x20')](_0x11d1('0x28'));}RpcMemberReport['voiceQueueReport'](_0x37ae46[_0x258348]);}RpcVoiceQueueReport[_0x11d1('0x2a')](_0x37ae46[_0x258348]);}};function extractCalleridNumber(_0x4711fe){var _0x41ee11=_0x4711fe[_0x11d1('0x2b')](/<(.*?)>/);return _0x41ee11?_0x41ee11[0x1]:_0x4711fe;}Report[_0x11d1('0x19')]['getAgentByInternal']=function(_0xd9e79d){for(var _0x5555d8=0x0;_0x5555d80x0?!![]:![];if(!_0x21c28d){return this[_0xc941('0x19')](this[_0xc941('0x49')][_0xc941('0x74')]);}};VoiceQueueReport[_0xc941('0x46')]['syncQueueMember']=function(_0x233d39){var _0x1b42b6=this[_0xc941('0x49')]['id'];if(this[_0xc941('0x49')][_0xc941('0x68')][_0x1b42b6]&&this[_0xc941('0x49')][_0xc941('0x68')][_0x1b42b6][_0x233d39[_0xc941('0x67')]]){this['summary'][_0xc941('0x68')][_0x1b42b6][_0x233d39[_0xc941('0x67')]][_0xc941('0x10')][_0xc941('0x75')](_0x233d39);}};VoiceQueueReport[_0xc941('0x46')][_0xc941('0x16')]=function(_0x311c2b){var _0x45e39b=this;try{if(this[_0xc941('0x61')](_0x311c2b)&&this[_0xc941('0x61')](_0x311c2b[_0xc941('0x59')])){logger[_0xc941('0x4e')]('[voiceQueueReport][queuesummary]\x20event:',util['inspect'](_0x311c2b,{'showHidden':![],'depth':null}));var _0xce2c21=this[_0xc941('0x12')][_0x311c2b['queue']];if(_0xce2c21){logger[_0xc941('0x4e')](_0xc941('0x76'),_0xce2c21[_0xc941('0x6a')]);this[_0xc941('0x49')]['queues'][_0xce2c21[_0xc941('0x6a')]]={'summaryEvent':_0x311c2b};this[_0xc941('0x49')][_0xc941('0x73')]+=0x1;return ami[_0xc941('0x3b')]({'action':_0xc941('0x68'),'queue':_0xce2c21[_0xc941('0x6a')]})[_0xc941('0x66')](function(_0x57fdc7){if(!_0x45e39b[_0xc941('0x49')]['queuestatus'][_0x311c2b['actionid']]){_0x45e39b[_0xc941('0x49')][_0xc941('0x68')][_0x311c2b[_0xc941('0x67')]]={};}_0x45e39b['summary'][_0xc941('0x68')][_0x311c2b[_0xc941('0x67')]][_0x57fdc7['actionid']]={'queue':_0xce2c21[_0xc941('0x6a')],'agents':[]};})[_0xc941('0x3e')](function(_0x4e2387){throw _0x4e2387;});}}}catch(_0x1dd853){logger['error'](_0xc941('0x77'),util[_0xc941('0x43')](_0x1dd853,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xc941('0x19')]=function(_0x569e23){if(this[_0xc941('0x49')]['statusRequests']>0x0){this[_0xc941('0x49')][_0xc941('0x74')]=_0x569e23;return;}logger['debug'](_0xc941('0x78'),util[_0xc941('0x43')](_0x569e23,{'showHidden':![],'depth':null}));this[_0xc941('0x49')]=initializeSummary();ami['emit']('custom:queuesummarycomplete',{});};VoiceQueueReport[_0xc941('0x46')]['syncQueueCallerJoin']=function(_0x4cabfc){try{if(this['isNotNull'](_0x4cabfc)){logger['debug']('[%s][voiceQueueReport][queuecallerjoin]',_0x4cabfc[_0xc941('0x51')],util[_0xc941('0x43')](_0x4cabfc,{'showHidden':![],'depth':null}));if(_[_0xc941('0x62')](this[_0xc941('0xf')][_0x4cabfc['uniqueid']])){this['queueReports'][_0x4cabfc['uniqueid']]=[];}if(_['isUndefined'](this[_0xc941('0x39')][_0x4cabfc[_0xc941('0x51')]])){this[_0xc941('0x39')][_0x4cabfc[_0xc941('0x51')]]={};}var _0x2fb12e=new QueueReport();_0x2fb12e['queue']=_0x4cabfc[_0xc941('0x59')];_0x2fb12e[_0xc941('0x5d')]=this[_0xc941('0x12')][_0x2fb12e[_0xc941('0x59')]]&&this[_0xc941('0x12')][_0x2fb12e[_0xc941('0x59')]][_0xc941('0x5d')]?this[_0xc941('0x12')][_0x2fb12e[_0xc941('0x59')]]['type']||_0xc941('0x5e'):_0xc941('0x5e');_0x2fb12e[_0xc941('0x79')]=moment()[_0xc941('0x52')](_0xc941('0x7a'));_0x2fb12e[_0xc941('0x7b')]=_0x4cabfc[_0xc941('0x7b')];_0x2fb12e[_0xc941('0x7c')]=_0x4cabfc[_0xc941('0x7c')];_0x2fb12e['uniqueid']=_0x4cabfc['uniqueid'];_0x2fb12e['routealias']=this[_0xc941('0x39')][_0x4cabfc[_0xc941('0x51')]][_0xc941('0x7d')];logger[_0xc941('0x7e')](_0xc941('0x7f'),_0x2fb12e[_0xc941('0x59')],_0x2fb12e['type']);Object[_0xc941('0x70')](_0x2fb12e,_['pick'](_0x4cabfc,_[_0xc941('0x80')](_0x2fb12e)));this[_0xc941('0xf')][_0x4cabfc['uniqueid']][_0xc941('0x75')](_0x2fb12e);this[_0xc941('0x39')][_0x4cabfc[_0xc941('0x51')]]=_0x2fb12e;this[_0xc941('0x4d')](_0x2fb12e,_0xc941('0x1b'));}}catch(_0x142203){logger[_0xc941('0x41')]('[%s][voiceQueueReport][queuecallerjoin]',_0x4cabfc[_0xc941('0x51')],util['inspect'](_0x142203,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xc941('0x1d')]=function(_0x4fee42){try{if(this['isNotNull'](_0x4fee42)){logger['debug']('[%s][voiceQueueReport][queuecallerabandon]',_0x4fee42[_0xc941('0x51')],util[_0xc941('0x43')](_0x4fee42,{'showHidden':![],'depth':null}));if(this[_0xc941('0xf')][_0x4fee42[_0xc941('0x51')]]){var _0x551668=_[_0xc941('0x81')](this[_0xc941('0xf')][_0x4fee42[_0xc941('0x51')]]);_0x551668[_0xc941('0x37')]=![];_0x551668[_0xc941('0x82')]=null;_0x551668['holdtime']=_0x4fee42['holdtime'];_0x551668[_0xc941('0x83')]=_0x4fee42[_0xc941('0x83')];_0x551668['queuecallerabandon']=!![];_0x551668[_0xc941('0x84')]=moment()[_0xc941('0x52')](_0xc941('0x7a'));_0x551668['queuecallerexitreason']=_0xc941('0x85');_0x551668[_0xc941('0x86')]=null;logger['info'](_0xc941('0x87'),_0x551668[_0xc941('0x59')],_0x551668['type']);this['channels'][_0x4fee42[_0xc941('0x51')]]=_0x551668;this[_0xc941('0x4a')](_0x551668,_0xc941('0x1c'));}}}catch(_0x491d39){logger[_0xc941('0x41')](_0xc941('0x88'),_0x4fee42['uniqueid'],util['inspect'](_0x491d39,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xc941('0x89')]=function(_0x30a477){try{if(this['isNotNull'](_0x30a477)){logger[_0xc941('0x4e')]('[%s][voiceQueueReport][queuecallerleave]',_0x30a477[_0xc941('0x51')],util[_0xc941('0x43')](_0x30a477,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x30a477[_0xc941('0x51')]]){var _0x40b594=_[_0xc941('0x81')](this[_0xc941('0xf')][_0x30a477[_0xc941('0x51')]]);_0x40b594[_0xc941('0x8a')]=moment()[_0xc941('0x52')](_0xc941('0x7a'));_0x40b594[_0xc941('0x8b')]=_0x30a477['connectedlinenum'];_0x40b594[_0xc941('0x8c')]=_0x30a477[_0xc941('0x8c')];logger[_0xc941('0x7e')](_0xc941('0x8d'),_0x40b594['queue'],_0x40b594['type'],_0x30a477[_0xc941('0x8b')],_0x30a477[_0xc941('0x8c')]);this['channels'][_0x30a477['uniqueid']]=_0x40b594;this[_0xc941('0x4d')](_0x40b594,_0xc941('0x1e'));}}}catch(_0x258979){logger['error'](_0xc941('0x8e'),_0x30a477[_0xc941('0x51')],util[_0xc941('0x43')](_0x258979,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc941('0x46')][_0xc941('0x1f')]=function(_0x5de160){try{if(this[_0xc941('0x61')](_0x5de160)){logger['debug']('[%s][voiceQueueReport][agentconnect]',_0x5de160['uniqueid'],util[_0xc941('0x43')](_0x5de160,{'showHidden':![],'depth':null}));if(this[_0xc941('0xf')][_0x5de160[_0xc941('0x51')]]){var _0x622e5e=_[_0xc941('0x81')](this[_0xc941('0xf')][_0x5de160[_0xc941('0x51')]]);_0x622e5e[_0xc941('0x37')]=!![];_0x622e5e[_0xc941('0x57')]=_0xc941('0x8f');logger['info'](_0xc941('0x90'),_0x622e5e['queue'],_0x622e5e[_0xc941('0x5d')]);}}}catch(_0x315a65){logger[_0xc941('0x41')](_0xc941('0x91'),_0x5de160[_0xc941('0x51')],util[_0xc941('0x43')](_0x315a65,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xc941('0x92')]=function(_0x3caf34){try{if(this[_0xc941('0x61')](_0x3caf34)){logger[_0xc941('0x4e')](_0xc941('0x93'),_0x3caf34[_0xc941('0x51')],util['inspect'](_0x3caf34,{'showHidden':![],'depth':null}));if(this[_0xc941('0xf')][_0x3caf34[_0xc941('0x51')]]){var _0x54c431=_[_0xc941('0x81')](this[_0xc941('0xf')][_0x3caf34[_0xc941('0x51')]]);_0x54c431[_0xc941('0x1c')]=![];_0x54c431[_0xc941('0x84')]=null;_0x54c431[_0xc941('0x94')]=!![];_0x54c431['lastAssignedTo']=_0x3caf34[_0xc941('0x95')];_0x54c431[_0xc941('0x96')]=_0x3caf34['holdtime'];_0x54c431[_0xc941('0x37')]=!![];_0x54c431[_0xc941('0x36')]=![];_0x54c431[_0xc941('0x97')]=null;if(!_0x54c431[_0xc941('0x98')]){if(_0x3caf34[_0xc941('0x99')]==_0xc941('0x98')){_0x54c431[_0xc941('0x57')]=_0xc941('0x9a');logger[_0xc941('0x7e')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x54c431[_0xc941('0x59')],_0x54c431[_0xc941('0x5d')]);}else{if(_[_0xc941('0x9b')](_0x3caf34[_0xc941('0x3d')][_0xc941('0x9c')](),_0xc941('0x9d'))){if(this[_0xc941('0xf')][_0x3caf34[_0xc941('0x9e')]]){var _0xa7657a=_[_0xc941('0x81')](this[_0xc941('0xf')][_0x3caf34[_0xc941('0x9e')]]);_0xa7657a[_0xc941('0x37')]=![];_0xa7657a[_0xc941('0x36')]=!![];_0xa7657a[_0xc941('0x97')]=moment(_0x54c431['queuecallerjoinAt'])[_0xc941('0x9f')](_0x3caf34[_0xc941('0x96')],_0xc941('0xa0'))[_0xc941('0x52')](_0xc941('0x7a'));_0xa7657a['queuecallerexitreason']='FORWARDTRANSFER';_0xa7657a[_0xc941('0x98')]=!![];_0xa7657a[_0xc941('0xa1')]='FORWARD';_0xa7657a[_0xc941('0xa2')]=_0x3caf34[_0xc941('0xa3')];_0xa7657a[_0xc941('0xa4')]=_0x3caf34[_0xc941('0x51')];logger[_0xc941('0x7e')](_0xc941('0xa5'),_0xa7657a['queue'],_0xa7657a[_0xc941('0x5d')]);var _0x19b3f0=this[_0xc941('0xf')][_0x3caf34[_0xc941('0x9e')]];this['queueReports'][_0x3caf34[_0xc941('0x9e')]]=this[_0xc941('0xf')][_0x3caf34[_0xc941('0x51')]];this['queueReports'][_0x3caf34[_0xc941('0x51')]]=_0x19b3f0;}}else{_0x54c431[_0xc941('0x57')]='COMPLETEDBY'+_0x3caf34[_0xc941('0x99')][_0xc941('0xa6')]();logger['info'](_0xc941('0xa7'),_0x54c431[_0xc941('0x59')],_0x54c431[_0xc941('0x5d')],_0x54c431[_0xc941('0x57')]);}}}this[_0xc941('0x39')][_0x3caf34[_0xc941('0x51')]]=_0x54c431;}}}catch(_0x4b8bef){logger[_0xc941('0x41')](_0xc941('0x93'),_0x3caf34[_0xc941('0x51')],util[_0xc941('0x43')](_0x4b8bef,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xc941('0x21')]=function(_0x2431c2){try{if(this[_0xc941('0x61')](_0x2431c2)){logger[_0xc941('0x4e')](_0xc941('0xa8'),_0x2431c2[_0xc941('0x51')],util[_0xc941('0x43')](_0x2431c2,{'showHidden':![],'depth':null}));this['addVariable'](_0x2431c2[_0xc941('0x51')],_[_0xc941('0x80')](_0x2431c2[_0xc941('0xa9')])[0x0],_0x2431c2[_0xc941('0xaa')]);if(this[_0xc941('0xf')][_0x2431c2[_0xc941('0x51')]]){var _0x15b79b=_[_0xc941('0x81')](this[_0xc941('0xf')][_0x2431c2[_0xc941('0x51')]]);if(_0x15b79b){if(this[_0xc941('0x61')](_0x2431c2[_0xc941('0xa9')])&&this[_0xc941('0x61')](_0x2431c2['variable'][_0xc941('0x68')])){switch(_0x2431c2[_0xc941('0xaa')]){case'CONTINUE':_0x15b79b[_0xc941('0x36')]=![];_0x15b79b['queuecallerexitAt']=null;break;case _0xc941('0xab'):_0x15b79b[_0xc941('0xac')]=_0xc941('0xad');_0x15b79b[_0xc941('0x36')]=!![];_0x15b79b['queuecallerexitAt']=moment()[_0xc941('0x52')](_0xc941('0x7a'));_0x15b79b['queuecallerleaveAt']=moment()[_0xc941('0x52')](_0xc941('0x7a'));logger['debug'](_0xc941('0xae'),_0x2431c2[_0xc941('0x51')],util[_0xc941('0x43')](_0x15b79b,{'showHidden':![],'depth':null}));ami[_0xc941('0x4c')](_0xc941('0xaf'),_0x15b79b);break;default:_0x15b79b[_0xc941('0x36')]=!![];_0x15b79b['queuecallerexitAt']=moment()[_0xc941('0x52')](_0xc941('0x7a'));_0x15b79b[_0xc941('0x8a')]=moment()['format'](_0xc941('0x7a'));}_0x15b79b[_0xc941('0x1c')]=![];_0x15b79b[_0xc941('0x84')]=null;_0x15b79b[_0xc941('0x57')]=_0x2431c2['value'];this['channels'][_0x2431c2['uniqueid']]=_0x15b79b;this[_0xc941('0x4a')](_0x15b79b,'varset');}else if(this['isNotNull'](_0x2431c2['variable'])&&this[_0xc941('0x61')](_0x2431c2[_0xc941('0xa9')][_0xc941('0xb0')])){if(!_0x15b79b[_0xc941('0x1c')]){_0x15b79b[_0xc941('0x36')]=!![];_0x15b79b['queuecallerexitAt']=moment()[_0xc941('0x52')](_0xc941('0x7a'));_0x15b79b[_0xc941('0x57')]=_0xc941('0xb1');_0x15b79b['queuecallerleaveAt']=moment()['format'](_0xc941('0x7a'));this[_0xc941('0x39')][_0x2431c2[_0xc941('0x51')]]=_0x15b79b;}}logger[_0xc941('0x7e')](_0xc941('0xb2'),_0x2431c2[_0xc941('0x51')],_0x15b79b[_0xc941('0x59')],_0x15b79b[_0xc941('0x5d')],_[_0xc941('0x80')](_0x2431c2['variable'])[0x0],_0x2431c2[_0xc941('0xaa')]);_0x15b79b[_0xc941('0x14')]=this['variables'][_0x2431c2[_0xc941('0x51')]];}}}}catch(_0x394b3e){logger[_0xc941('0x41')](_0xc941('0xa8'),_0x2431c2[_0xc941('0x51')],util['inspect'](_0x394b3e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc941('0x46')][_0xc941('0xb3')]=function(_0x455320,_0x2a7a8b,_0x235c01){var _0x4d13d9=[_0xc941('0xb4'),_0xc941('0xb5'),_0xc941('0xb6'),_0xc941('0xb7'),_0xc941('0xb8'),_0xc941('0xb9'),_0xc941('0xba'),_0xc941('0xbb'),_0xc941('0xbc'),_0xc941('0xbd'),_0xc941('0xbe'),_0xc941('0xbf'),'membercalls',_0xc941('0xc0'),_0xc941('0xc1'),_0xc941('0xc2'),'membername','memberpenalty',_0xc941('0xc3')];if(!_[_0xc941('0x3a')](_0x2a7a8b)&&!_[_0xc941('0xc4')](_0x4d13d9,_0x2a7a8b)){if(_[_0xc941('0x62')](this[_0xc941('0x14')][_0x455320])){this[_0xc941('0x14')][_0x455320]={};}this['variables'][_0x455320][_0x2a7a8b]=_0x235c01;}};VoiceQueueReport[_0xc941('0x46')][_0xc941('0xc5')]=function(_0x382078,_0x164f62,_0x5ae64e){try{var _0x8e870b={};if(this[_0xc941('0xf')][_0x382078]){for(var _0x1a2e12=0x0;_0x1a2e120x0?!![]:![];if(!_0x55282e){return this[_0xbc0d('0x19')](this['summary'][_0xbc0d('0x69')]);}};VoiceQueueReport[_0xbc0d('0x8')]['syncQueueMember']=function(_0x106cf0){var _0x2538a4=this[_0xbc0d('0x14')]['id'];if(this[_0xbc0d('0x14')]['queuestatus'][_0x2538a4]&&this[_0xbc0d('0x14')]['queuestatus'][_0x2538a4][_0x106cf0[_0xbc0d('0x5f')]]){this['summary'][_0xbc0d('0x5e')][_0x2538a4][_0x106cf0['actionid']][_0xbc0d('0xf')][_0xbc0d('0x6a')](_0x106cf0);}};VoiceQueueReport['prototype'][_0xbc0d('0x17')]=function(_0x5b87b9){var _0x400720=this;try{if(this[_0xbc0d('0x56')](_0x5b87b9)&&this[_0xbc0d('0x56')](_0x5b87b9[_0xbc0d('0x47')])){logger[_0xbc0d('0x43')]('[voiceQueueReport][queuesummary]\x20event:',util['inspect'](_0x5b87b9,{'showHidden':![],'depth':null}));var _0x3fef03=this[_0xbc0d('0x12')][_0x5b87b9[_0xbc0d('0x47')]];if(_0x3fef03){logger[_0xbc0d('0x43')](_0xbc0d('0x6b'),_0x3fef03[_0xbc0d('0x54')]);this[_0xbc0d('0x14')][_0xbc0d('0x5a')][_0x3fef03[_0xbc0d('0x54')]]={'summaryEvent':_0x5b87b9};this[_0xbc0d('0x14')][_0xbc0d('0x68')]+=0x1;return ami[_0xbc0d('0x59')]({'action':_0xbc0d('0x5e'),'queue':_0x3fef03[_0xbc0d('0x54')]})[_0xbc0d('0x5d')](function(_0x1dec06){if(!_0x400720[_0xbc0d('0x14')][_0xbc0d('0x5e')][_0x5b87b9['actionid']]){_0x400720[_0xbc0d('0x14')][_0xbc0d('0x5e')][_0x5b87b9[_0xbc0d('0x5f')]]={};}_0x400720[_0xbc0d('0x14')][_0xbc0d('0x5e')][_0x5b87b9['actionid']][_0x1dec06['actionid']]={'queue':_0x3fef03[_0xbc0d('0x54')],'agents':[]};})[_0xbc0d('0x5b')](function(_0x31a5e1){throw _0x31a5e1;});}}}catch(_0x4efce9){logger['error'](_0xbc0d('0x60'),util['inspect'](_0x4efce9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xbc0d('0x8')][_0xbc0d('0x19')]=function(_0x2129c2){if(this[_0xbc0d('0x14')][_0xbc0d('0x68')]>0x0){this['summary'][_0xbc0d('0x69')]=_0x2129c2;return;}logger[_0xbc0d('0x43')](_0xbc0d('0x6c'),util['inspect'](_0x2129c2,{'showHidden':![],'depth':null}));this[_0xbc0d('0x14')]=initializeSummary();ami[_0xbc0d('0x41')](_0xbc0d('0x6d'),{});};VoiceQueueReport[_0xbc0d('0x8')][_0xbc0d('0x1f')]=function(_0x4983b4){try{if(this[_0xbc0d('0x56')](_0x4983b4)){logger[_0xbc0d('0x43')]('[%s][voiceQueueReport][queuecallerjoin]',_0x4983b4[_0xbc0d('0x46')],util[_0xbc0d('0x3c')](_0x4983b4,{'showHidden':![],'depth':null}));if(_[_0xbc0d('0x57')](this[_0xbc0d('0xd')][_0x4983b4['uniqueid']])){this[_0xbc0d('0xd')][_0x4983b4['uniqueid']]=[];}if(_[_0xbc0d('0x57')](this[_0xbc0d('0x10')][_0x4983b4[_0xbc0d('0x46')]])){this[_0xbc0d('0x10')][_0x4983b4['uniqueid']]={};}var _0x399fb7=new QueueReport();_0x399fb7[_0xbc0d('0x47')]=_0x4983b4[_0xbc0d('0x47')];_0x399fb7[_0xbc0d('0x50')]=this[_0xbc0d('0x12')][_0x399fb7[_0xbc0d('0x47')]]&&this[_0xbc0d('0x12')][_0x399fb7['queue']][_0xbc0d('0x50')]?this['voiceQueues'][_0x399fb7[_0xbc0d('0x47')]][_0xbc0d('0x50')]||_0xbc0d('0x51'):_0xbc0d('0x51');_0x399fb7[_0xbc0d('0x6e')]=moment()[_0xbc0d('0x53')]('YYYY-MM-DD\x20HH:mm:ss');_0x399fb7[_0xbc0d('0x6f')]=_0x4983b4[_0xbc0d('0x6f')];_0x399fb7['count']=_0x4983b4[_0xbc0d('0x70')];_0x399fb7[_0xbc0d('0x46')]=_0x4983b4['uniqueid'];_0x399fb7[_0xbc0d('0x71')]=this[_0xbc0d('0x10')][_0x4983b4[_0xbc0d('0x46')]][_0xbc0d('0x71')];logger[_0xbc0d('0x72')](_0xbc0d('0x73'),_0x399fb7[_0xbc0d('0x47')],_0x399fb7['type']);Object[_0xbc0d('0x74')](_0x399fb7,_[_0xbc0d('0x75')](_0x4983b4,_[_0xbc0d('0x76')](_0x399fb7)));this[_0xbc0d('0xd')][_0x4983b4['uniqueid']][_0xbc0d('0x6a')](_0x399fb7);this['channels'][_0x4983b4['uniqueid']]=_0x399fb7;this[_0xbc0d('0x42')](_0x399fb7,'queuecallerjoin');}}catch(_0x521d8f){logger['error'](_0xbc0d('0x77'),_0x4983b4[_0xbc0d('0x46')],util['inspect'](_0x521d8f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xbc0d('0x8')][_0xbc0d('0x78')]=function(_0x49754b){try{if(this[_0xbc0d('0x56')](_0x49754b)){logger['debug'](_0xbc0d('0x79'),_0x49754b[_0xbc0d('0x46')],util['inspect'](_0x49754b,{'showHidden':![],'depth':null}));if(this[_0xbc0d('0xd')][_0x49754b[_0xbc0d('0x46')]]){var _0x1716b0=_['last'](this['queueReports'][_0x49754b[_0xbc0d('0x46')]]);_0x1716b0['queuecallercomplete']=![];_0x1716b0[_0xbc0d('0x7a')]=null;_0x1716b0[_0xbc0d('0x7b')]=_0x49754b[_0xbc0d('0x7b')];_0x1716b0[_0xbc0d('0x7c')]=_0x49754b[_0xbc0d('0x7c')];_0x1716b0[_0xbc0d('0x36')]=!![];_0x1716b0[_0xbc0d('0x7d')]=moment()[_0xbc0d('0x53')](_0xbc0d('0x7e'));_0x1716b0[_0xbc0d('0x4c')]='ABANDONED';_0x1716b0[_0xbc0d('0x7f')]=null;logger[_0xbc0d('0x72')](_0xbc0d('0x80'),_0x1716b0['queue'],_0x1716b0[_0xbc0d('0x50')]);this[_0xbc0d('0x10')][_0x49754b['uniqueid']]=_0x1716b0;this[_0xbc0d('0x4a')](_0x1716b0,_0xbc0d('0x36'));}}}catch(_0x1b0fbb){logger[_0xbc0d('0x3a')]('[%s][voiceQueueReport][queuecallerabandon]',_0x49754b[_0xbc0d('0x46')],util[_0xbc0d('0x3c')](_0x1b0fbb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xbc0d('0x8')][_0xbc0d('0x20')]=function(_0x3f692b){try{if(this['isNotNull'](_0x3f692b)){logger[_0xbc0d('0x43')](_0xbc0d('0x81'),_0x3f692b[_0xbc0d('0x46')],util[_0xbc0d('0x3c')](_0x3f692b,{'showHidden':![],'depth':null}));if(this[_0xbc0d('0xd')][_0x3f692b['uniqueid']]){var _0x53570f=_['last'](this[_0xbc0d('0xd')][_0x3f692b[_0xbc0d('0x46')]]);_0x53570f['queuecallerleaveAt']=moment()['format'](_0xbc0d('0x7e'));_0x53570f[_0xbc0d('0x82')]=_0x3f692b['connectedlinenum'];_0x53570f['connectedlinename']=_0x3f692b[_0xbc0d('0x83')];logger[_0xbc0d('0x72')](_0xbc0d('0x84'),_0x53570f['queue'],_0x53570f['type'],_0x3f692b[_0xbc0d('0x82')],_0x3f692b[_0xbc0d('0x83')]);this[_0xbc0d('0x10')][_0x3f692b[_0xbc0d('0x46')]]=_0x53570f;this[_0xbc0d('0x42')](_0x53570f,_0xbc0d('0x85'));}}}catch(_0x1189f9){logger[_0xbc0d('0x3a')](_0xbc0d('0x81'),_0x3f692b[_0xbc0d('0x46')],util[_0xbc0d('0x3c')](_0x1189f9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xbc0d('0x8')][_0xbc0d('0x24')]=function(_0x397488){try{if(this['isNotNull'](_0x397488)){logger['debug'](_0xbc0d('0x86'),_0x397488[_0xbc0d('0x46')],util['inspect'](_0x397488,{'showHidden':![],'depth':null}));if(this[_0xbc0d('0xd')][_0x397488[_0xbc0d('0x46')]]){var _0x532f6f=_[_0xbc0d('0x87')](this['queueReports'][_0x397488[_0xbc0d('0x46')]]);_0x532f6f['queuecallercomplete']=!![];_0x532f6f[_0xbc0d('0x4c')]=_0xbc0d('0x88');logger[_0xbc0d('0x72')](_0xbc0d('0x89'),_0x532f6f[_0xbc0d('0x47')],_0x532f6f[_0xbc0d('0x50')]);}}}catch(_0x40d7a4){logger[_0xbc0d('0x3a')](_0xbc0d('0x86'),_0x397488[_0xbc0d('0x46')],util['inspect'](_0x40d7a4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xbc0d('0x8')]['syncAgentComplete']=function(_0x2088fc){try{if(this[_0xbc0d('0x56')](_0x2088fc)){logger[_0xbc0d('0x43')](_0xbc0d('0x8a'),_0x2088fc['uniqueid'],util[_0xbc0d('0x3c')](_0x2088fc,{'showHidden':![],'depth':null}));if(this[_0xbc0d('0xd')][_0x2088fc['uniqueid']]){var _0x586552=_[_0xbc0d('0x87')](this[_0xbc0d('0xd')][_0x2088fc['uniqueid']]);_0x586552[_0xbc0d('0x36')]=![];_0x586552[_0xbc0d('0x7d')]=null;_0x586552[_0xbc0d('0x8b')]=!![];_0x586552[_0xbc0d('0x7f')]=_0x2088fc[_0xbc0d('0x8c')];_0x586552[_0xbc0d('0x7b')]=_0x2088fc[_0xbc0d('0x7b')];_0x586552[_0xbc0d('0x37')]=!![];_0x586552[_0xbc0d('0x35')]=![];_0x586552[_0xbc0d('0x8d')]=null;if(!_0x586552[_0xbc0d('0x8e')]){if(_0x2088fc[_0xbc0d('0x8f')]==_0xbc0d('0x8e')){_0x586552[_0xbc0d('0x4c')]='COMPLETED';logger[_0xbc0d('0x72')](_0xbc0d('0x90'),_0x586552[_0xbc0d('0x47')],_0x586552[_0xbc0d('0x50')]);}else{if(_['startsWith'](_0x2088fc[_0xbc0d('0x91')][_0xbc0d('0x92')](),_0xbc0d('0x93'))){if(this['queueReports'][_0x2088fc['linkedid']]){var _0x37bb38=_['last'](this[_0xbc0d('0xd')][_0x2088fc[_0xbc0d('0x94')]]);_0x37bb38[_0xbc0d('0x37')]=![];_0x37bb38[_0xbc0d('0x35')]=!![];_0x37bb38[_0xbc0d('0x8d')]=moment(_0x586552[_0xbc0d('0x6e')])['add'](_0x2088fc[_0xbc0d('0x7b')],_0xbc0d('0x95'))[_0xbc0d('0x53')](_0xbc0d('0x7e'));_0x37bb38[_0xbc0d('0x4c')]='FORWARDTRANSFER';_0x37bb38[_0xbc0d('0x8e')]=!![];_0x37bb38['transfertype']=_0xbc0d('0x96');_0x37bb38['transferexten']=_0x2088fc[_0xbc0d('0x97')];_0x37bb38['transferuniqueid']=_0x2088fc[_0xbc0d('0x46')];logger[_0xbc0d('0x72')](_0xbc0d('0x98'),_0x37bb38[_0xbc0d('0x47')],_0x37bb38['type']);var _0x41a9a9=this[_0xbc0d('0xd')][_0x2088fc[_0xbc0d('0x94')]];this[_0xbc0d('0xd')][_0x2088fc['linkedid']]=this['queueReports'][_0x2088fc[_0xbc0d('0x46')]];this[_0xbc0d('0xd')][_0x2088fc[_0xbc0d('0x46')]]=_0x41a9a9;}}else{_0x586552[_0xbc0d('0x4c')]='COMPLETEDBY'+_0x2088fc[_0xbc0d('0x8f')]['toUpperCase']();logger[_0xbc0d('0x72')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x586552[_0xbc0d('0x47')],_0x586552[_0xbc0d('0x50')],_0x586552[_0xbc0d('0x4c')]);}}}this[_0xbc0d('0x10')][_0x2088fc[_0xbc0d('0x46')]]=_0x586552;}}}catch(_0x1d3f9b){logger['error']('[%s][voiceQueueReport][agentcomplete]',_0x2088fc[_0xbc0d('0x46')],util[_0xbc0d('0x3c')](_0x1d3f9b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xbc0d('0x8')][_0xbc0d('0x26')]=function(_0x43c823){try{if(this[_0xbc0d('0x56')](_0x43c823)){logger['debug'](_0xbc0d('0x99'),_0x43c823[_0xbc0d('0x46')],util[_0xbc0d('0x3c')](_0x43c823,{'showHidden':![],'depth':null}));this[_0xbc0d('0x9a')](_0x43c823[_0xbc0d('0x46')],_[_0xbc0d('0x76')](_0x43c823[_0xbc0d('0x9b')])[0x0],_0x43c823[_0xbc0d('0x9c')]);if(this[_0xbc0d('0xd')][_0x43c823[_0xbc0d('0x46')]]){var _0x30e0ee=_[_0xbc0d('0x87')](this[_0xbc0d('0xd')][_0x43c823[_0xbc0d('0x46')]]);if(_0x30e0ee){if(this['isNotNull'](_0x43c823[_0xbc0d('0x9b')])&&this[_0xbc0d('0x56')](_0x43c823[_0xbc0d('0x9b')]['queuestatus'])){switch(_0x43c823['value']){case _0xbc0d('0x9d'):_0x30e0ee[_0xbc0d('0x35')]=![];_0x30e0ee[_0xbc0d('0x8d')]=null;break;case _0xbc0d('0x9e'):_0x30e0ee[_0xbc0d('0x9f')]=_0xbc0d('0xa0');_0x30e0ee['queuecallerexit']=!![];_0x30e0ee[_0xbc0d('0x8d')]=moment()[_0xbc0d('0x53')]('YYYY-MM-DD\x20HH:mm:ss');_0x30e0ee[_0xbc0d('0xa1')]=moment()[_0xbc0d('0x53')](_0xbc0d('0x7e'));logger[_0xbc0d('0x43')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x43c823[_0xbc0d('0x46')],util[_0xbc0d('0x3c')](_0x30e0ee,{'showHidden':![],'depth':null}));ami[_0xbc0d('0x41')]('custom:timeout',_0x30e0ee);break;default:_0x30e0ee[_0xbc0d('0x35')]=!![];_0x30e0ee['queuecallerexitAt']=moment()['format'](_0xbc0d('0x7e'));_0x30e0ee[_0xbc0d('0xa1')]=moment()[_0xbc0d('0x53')]('YYYY-MM-DD\x20HH:mm:ss');}_0x30e0ee['queuecallerabandon']=![];_0x30e0ee[_0xbc0d('0x7d')]=null;_0x30e0ee[_0xbc0d('0x4c')]=_0x43c823[_0xbc0d('0x9c')];this['channels'][_0x43c823['uniqueid']]=_0x30e0ee;this[_0xbc0d('0x4a')](_0x30e0ee,'varset');}else if(this['isNotNull'](_0x43c823['variable'])&&this[_0xbc0d('0x56')](_0x43c823[_0xbc0d('0x9b')][_0xbc0d('0xa2')])){if(!_0x30e0ee['queuecallerabandon']){_0x30e0ee[_0xbc0d('0x35')]=!![];_0x30e0ee[_0xbc0d('0x8d')]=moment()[_0xbc0d('0x53')](_0xbc0d('0x7e'));_0x30e0ee[_0xbc0d('0x4c')]='EXITWITHKEY';_0x30e0ee['queuecallerleaveAt']=moment()['format'](_0xbc0d('0x7e'));this['channels'][_0x43c823[_0xbc0d('0x46')]]=_0x30e0ee;}}logger[_0xbc0d('0x72')](_0xbc0d('0xa3'),_0x43c823['uniqueid'],_0x30e0ee[_0xbc0d('0x47')],_0x30e0ee['type'],_[_0xbc0d('0x76')](_0x43c823[_0xbc0d('0x9b')])[0x0],_0x43c823[_0xbc0d('0x9c')]);_0x30e0ee[_0xbc0d('0x15')]=this[_0xbc0d('0x15')][_0x43c823[_0xbc0d('0x46')]];}}}}catch(_0x4d64af){logger[_0xbc0d('0x3a')]('[%s][voiceQueueReport][varset]',_0x43c823[_0xbc0d('0x46')],util[_0xbc0d('0x3c')](_0x4d64af,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xbc0d('0x8')][_0xbc0d('0x9a')]=function(_0x1f8c66,_0x4f408f,_0x1812b0){var _0x1ec8a8=['rtpaudioqos',_0xbc0d('0xa4'),_0xbc0d('0xa5'),'rtpaudioqosjitterbridged',_0xbc0d('0xa6'),_0xbc0d('0xa7'),_0xbc0d('0xa8'),_0xbc0d('0xa9'),'sipcallid','sipuri',_0xbc0d('0xaa'),_0xbc0d('0xab'),_0xbc0d('0xac'),_0xbc0d('0xad'),'memberinterface',_0xbc0d('0xae'),_0xbc0d('0x8c'),_0xbc0d('0xaf'),'memberrealtime'];if(!_[_0xbc0d('0xb0')](_0x4f408f)&&!_['includes'](_0x1ec8a8,_0x4f408f)){if(_[_0xbc0d('0x57')](this['variables'][_0x1f8c66])){this['variables'][_0x1f8c66]={};}this[_0xbc0d('0x15')][_0x1f8c66][_0x4f408f]=_0x1812b0;}};VoiceQueueReport['prototype'][_0xbc0d('0xb1')]=function(_0x3f621f,_0x502a01,_0x47f2f7){try{var _0x3ba2d5={};if(this['queueReports'][_0x3f621f]){for(var _0x51ceb3=0x0;_0x51ceb3=0x0?moment(_0x3a13ea[_0xfba4('0x18')])['diff'](_0x3a13ea[_0xfba4('0x19')],_0xfba4('0xf')):null,'data1':_0xfba4('0x1a'),'data2':_0x3a13ea[_0xfba4('0x13')],'data3':_0x3a13ea['exten'],'data4':_0x3a13ea[_0xfba4('0x1b')]||null,'role':_0xfba4('0x12'),'internal':_0x3a13ea[_0xfba4('0x13')]?_[_0xfba4('0x1c')](_0x3a13ea[_0xfba4('0x13')]):undefined,'uniqueid':_0x3a13ea[_0xfba4('0x14')]},'log':_0xfba4('0x6')});}; \ No newline at end of file +var _0xbfc0=['voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','CreateMemberReport','voice','lastAssignedTo','interface','format','SIP/%s','diff','queuecallerleaveAt','seconds','inbound','calleridnum','exten','agent','accountcode','toNumber','voiceDialReport','Request','starttime','endtime','uniqueid','moment','util'];(function(_0x31a4fd,_0x4e25ab){var _0x529fb2=function(_0x29e0f3){while(--_0x29e0f3){_0x31a4fd['push'](_0x31a4fd['shift']());}};_0x529fb2(++_0x4e25ab);}(_0xbfc0,0x1d9));var _0x0bfc=function(_0x4b9a62,_0x528ba3){_0x4b9a62=_0x4b9a62-0x0;var _0x45c582=_0xbfc0[_0x4b9a62];return _0x45c582;};'use strict';var moment=require(_0x0bfc('0x0'));var _=require('lodash');var util=require(_0x0bfc('0x1'));var client=require('../client');exports[_0x0bfc('0x2')]=function(_0x3d6322){var _0x8c0d4f=_0x3d6322[_0x0bfc('0x3')]||_0x3d6322[_0x0bfc('0x4')];return client['Request'](_0x0bfc('0x5'),{'body':{'channel':_0x0bfc('0x6'),'membername':_0x3d6322[_0x0bfc('0x7')],'interface':_['isNil'](_0x3d6322[_0x0bfc('0x8')])?util[_0x0bfc('0x9')](_0x0bfc('0xa'),_0x3d6322['lastAssignedTo']):_0x3d6322[_0x0bfc('0x8')],'type':'TALKING','enterAt':_0x3d6322['queuecallerleaveAt'],'exitAt':_0x8c0d4f,'duration':moment(_0x8c0d4f)[_0x0bfc('0xb')](_0x3d6322[_0x0bfc('0xc')],_0x0bfc('0xd')),'data1':_0x0bfc('0xe'),'data2':_0x3d6322[_0x0bfc('0xf')],'data3':_0x3d6322[_0x0bfc('0x10')],'data4':null,'data5':_0x3d6322['queue'],'role':_0x0bfc('0x11'),'internal':_0x3d6322[_0x0bfc('0x12')]?_[_0x0bfc('0x13')](_0x3d6322['accountcode']):undefined,'uniqueid':_0x3d6322['uniqueid']},'log':_0x0bfc('0x5')});};exports[_0x0bfc('0x14')]=function(_0xc2f345){return client[_0x0bfc('0x15')](_0x0bfc('0x5'),{'body':{'channel':'voice','membername':_0xc2f345['membername'],'interface':_0xc2f345['interface'],'type':'TALKING','enterAt':_0xc2f345[_0x0bfc('0x16')],'exitAt':_0xc2f345['endtime'],'duration':moment(_0xc2f345[_0x0bfc('0x17')])['diff'](_0xc2f345[_0x0bfc('0x16')],_0x0bfc('0xd'))>=0x0?moment(_0xc2f345['endtime'])[_0x0bfc('0xb')](_0xc2f345[_0x0bfc('0x16')],_0x0bfc('0xd')):null,'data1':'outbound','data2':_0xc2f345[_0x0bfc('0x12')],'data3':_0xc2f345[_0x0bfc('0x10')],'data4':_0xc2f345['dialstring']||null,'role':_0x0bfc('0x11'),'internal':_0xc2f345[_0x0bfc('0x12')]?_[_0x0bfc('0x13')](_0xc2f345[_0x0bfc('0x12')]):undefined,'uniqueid':_0xc2f345[_0x0bfc('0x18')]},'log':_0x0bfc('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index c03b574..f7a16dd 100644 --- a/server/services/ami/rpc/setting.js +++ b/server/services/ami/rpc/setting.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd509=['Request','ShowSetting','stopRecordingOnTransfer'];(function(_0x40737e,_0x25992e){var _0x263ca1=function(_0x521635){while(--_0x521635){_0x40737e['push'](_0x40737e['shift']());}};_0x263ca1(++_0x25992e);}(_0xd509,0xc9));var _0x9d50=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd509[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getSettings']=function(){return client[_0x9d50('0x0')](_0x9d50('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x9d50('0x2'),'previewRecallmeReminderInterval']},'log':'GetSettings'});}; \ No newline at end of file +var _0xe386=['Request','ShowSetting','previewRecallmeReminderInterval','GetSettings','getSettings'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0xe386,0x11c));var _0x6e38=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe386[_0x122ef9];return _0x42fba0;};'use strict';var client=require('../client');exports[_0x6e38('0x0')]=function(){return client[_0x6e38('0x1')](_0x6e38('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer',_0x6e38('0x3')]},'log':_0x6e38('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 110406e..e9b0f8e 100644 --- a/server/services/ami/rpc/template.js +++ b/server/services/ami/rpc/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x12d4=['Request','GetTemplate','html'];(function(_0x35d8b6,_0x2ae111){var _0x2ae569=function(_0x1fd4a4){while(--_0x1fd4a4){_0x35d8b6['push'](_0x35d8b6['shift']());}};_0x2ae569(++_0x2ae111);}(_0x12d4,0x1e0));var _0x412d=function(_0x44268d,_0xad8443){_0x44268d=_0x44268d-0x0;var _0x4be92d=_0x12d4[_0x44268d];return _0x4be92d;};'use strict';var client=require('../client');exports['getTemplates']=function(_0x2bc2d1){return function(_0x41ae15){return client[_0x412d('0x0')](_0x412d('0x1'),{'options':{'raw':!![],'attributes':['id','name',_0x412d('0x2')]},'log':'GetTemplate'});};}; \ No newline at end of file +var _0x80e9=['name','html','../client','getTemplates'];(function(_0x27a8e8,_0x491672){var _0x2b43e9=function(_0x5c91f9){while(--_0x5c91f9){_0x27a8e8['push'](_0x27a8e8['shift']());}};_0x2b43e9(++_0x491672);}(_0x80e9,0x9a));var _0x980e=function(_0x4acfe6,_0x5d40ce){_0x4acfe6=_0x4acfe6-0x0;var _0x5845a6=_0x80e9[_0x4acfe6];return _0x5845a6;};'use strict';var client=require(_0x980e('0x0'));exports[_0x980e('0x1')]=function(_0x5dcde2){return function(_0x1afdca){return client['Request']('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x980e('0x2'),_0x980e('0x3')]},'log':'GetTemplate'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index fbb0464..847b35c 100644 --- a/server/services/ami/rpc/trigger.js +++ b/server/services/ami/rpc/trigger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2a3d=['Condition','field','value','AnyConditions','operator','Action','Actions','action','data1','data3','data4','data5','data6','data7','../client','getTriggers','Request','GetTrigger','name','channel'];(function(_0x1bcc92,_0x4929b8){var _0x88406a=function(_0x4670f8){while(--_0x4670f8){_0x1bcc92['push'](_0x1bcc92['shift']());}};_0x88406a(++_0x4929b8);}(_0x2a3d,0x1ee));var _0xd2a3=function(_0x10fbd4,_0x59b9af){_0x10fbd4=_0x10fbd4-0x0;var _0x28a4e0=_0x2a3d[_0x10fbd4];return _0x28a4e0;};'use strict';var client=require(_0xd2a3('0x0'));exports[_0xd2a3('0x1')]=function(_0x3397c3){return function(_0x1ff0f4){return client[_0xd2a3('0x2')](_0xd2a3('0x3'),{'options':{'raw':![],'attributes':['id',_0xd2a3('0x4'),_0xd2a3('0x5'),'status'],'include':[{'model':_0xd2a3('0x6'),'as':'AllConditions','attributes':['id',_0xd2a3('0x7'),'operator',_0xd2a3('0x8')]},{'model':'Condition','as':_0xd2a3('0x9'),'attributes':['id',_0xd2a3('0x7'),_0xd2a3('0xa'),'value']},{'model':_0xd2a3('0xb'),'as':_0xd2a3('0xc'),'attributes':['id',_0xd2a3('0xd'),_0xd2a3('0xe'),'data2',_0xd2a3('0xf'),_0xd2a3('0x10'),_0xd2a3('0x11'),_0xd2a3('0x12'),_0xd2a3('0x13')]}]},'log':_0xd2a3('0x3')});};}; \ No newline at end of file +var _0xbde0=['../client','Request','GetTrigger','name','status','Condition','AllConditions','field','operator','value','AnyConditions','Action','Actions','action','data2','data3','data6','data7'];(function(_0x2db056,_0x2fce25){var _0x156b51=function(_0x420cc1){while(--_0x420cc1){_0x2db056['push'](_0x2db056['shift']());}};_0x156b51(++_0x2fce25);}(_0xbde0,0x17a));var _0x0bde=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0xbde0[_0x1deb03];return _0x189fe7;};'use strict';var client=require(_0x0bde('0x0'));exports['getTriggers']=function(_0x5e00af){return function(_0x5d1639){return client[_0x0bde('0x1')](_0x0bde('0x2'),{'options':{'raw':![],'attributes':['id',_0x0bde('0x3'),'channel',_0x0bde('0x4')],'include':[{'model':_0x0bde('0x5'),'as':_0x0bde('0x6'),'attributes':['id',_0x0bde('0x7'),_0x0bde('0x8'),_0x0bde('0x9')]},{'model':'Condition','as':_0x0bde('0xa'),'attributes':['id','field',_0x0bde('0x8'),_0x0bde('0x9')]},{'model':_0x0bde('0xb'),'as':_0x0bde('0xc'),'attributes':['id',_0x0bde('0xd'),'data1',_0x0bde('0xe'),_0x0bde('0xf'),'data4','data5',_0x0bde('0x10'),_0x0bde('0x11')]}]},'log':_0x0bde('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 9e54547..ff55266 100644 --- a/server/services/ami/rpc/trunk.js +++ b/server/services/ami/rpc/trunk.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1271=['GetTrunk','registry','../client','Request'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1271,0x9a));var _0x1127=function(_0x4a4437,_0x36702a){_0x4a4437=_0x4a4437-0x0;var _0x4eb03c=_0x1271[_0x4a4437];return _0x4eb03c;};'use strict';var client=require(_0x1127('0x0'));exports['getTrunks']=function(_0x229dd0){return function(_0x1d4123){return client[_0x1127('0x1')](_0x1127('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x1127('0x3'),'defaultuser']},'log':_0x1127('0x2')});};}; \ No newline at end of file +var _0x0f68=['../client','getTrunks','Request','name','registry','GetTrunk'];(function(_0x2f096d,_0x379a41){var _0x14d437=function(_0x5653a2){while(--_0x5653a2){_0x2f096d['push'](_0x2f096d['shift']());}};_0x14d437(++_0x379a41);}(_0x0f68,0xea));var _0x80f6=function(_0x32dfc4,_0xa48ca4){_0x32dfc4=_0x32dfc4-0x0;var _0x51099c=_0x0f68[_0x32dfc4];return _0x51099c;};'use strict';var client=require(_0x80f6('0x0'));exports[_0x80f6('0x1')]=function(_0x209810){return function(_0xb7f87d){return client[_0x80f6('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x80f6('0x3'),_0x80f6('0x4'),'defaultuser']},'log':_0x80f6('0x5')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 3789b44..221f2b4 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['getAgents','Request','name','email','accountcode','fullname','lastLoginAt','lastPauseAt','interface','getTelephones','GetUser','telephone','savePause','PauseUser','saveUnpause','getAgent','agent','online','pauseType','../client'];(function(_0x26a2ef,_0x5b3ee8){var _0x1c88b2=function(_0x1db5b4){while(--_0x1db5b4){_0x26a2ef['push'](_0x26a2ef['shift']());}};_0x1c88b2(++_0x5b3ee8);}(_0x70e0,0x17b));var _0x070e=function(_0x17c279,_0x4650f5){_0x17c279=_0x17c279-0x0;var _0x14fbfa=_0x70e0[_0x17c279];return _0x14fbfa;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5'),_0x070e('0x6'),'online',_0x070e('0x7'),'pauseType',_0x070e('0x8'),'voicePause','phone','mobile',_0x070e('0x9')]},'log':_0x070e('0x1')});};};exports[_0x070e('0xa')]=function(){return function(){return client[_0x070e('0x2')](_0x070e('0xb'),{'options':{'raw':!![],'where':{'role':_0x070e('0xc')},'attributes':['id',_0x070e('0x3'),'accountcode','internal']},'log':_0x070e('0xa')});};};exports[_0x070e('0xd')]=function(_0x12bb37,_0xb8d819,_0xa927a2){return client[_0x070e('0x2')](_0x070e('0xe'),{'body':{'type':_0xb8d819,'uniqueid':_0xa927a2},'options':{'where':{'id':_0x12bb37['id']}},'log':_0x070e('0xd')});};exports[_0x070e('0xf')]=function(_0x5bf079){return client[_0x070e('0x2')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5bf079['id']}},'log':'savePause'});};exports[_0x070e('0x10')]=function(_0x56c7ba){return client['Request']('ShowUser',{'options':{'raw':![],'where':{'role':_0x070e('0x11'),'id':_0x56c7ba},'attributes':['id',_0x070e('0x3'),'email','accountcode',_0x070e('0x6'),_0x070e('0x12'),_0x070e('0x7'),_0x070e('0x13'),'lastPauseAt','voicePause',_0x070e('0x9')]},'log':_0x070e('0x10')});}; \ No newline at end of file +var _0xe706=['internal','savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','getAgent','../client','getAgents','Request','agent','name','email','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','GetUser','telephone'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xe706,0xa3));var _0x6e70=function(_0x88249c,_0x24124e){_0x88249c=_0x88249c-0x0;var _0x951993=_0xe706[_0x88249c];return _0x951993;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':_0x6e70('0x3')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6'),_0x6e70('0x7'),_0x6e70('0x8'),_0x6e70('0x9'),_0x6e70('0xa'),_0x6e70('0xb'),_0x6e70('0xc'),_0x6e70('0xd'),_0x6e70('0xe'),_0x6e70('0xf')]},'log':_0x6e70('0x1')});};};exports[_0x6e70('0x10')]=function(){return function(){return client[_0x6e70('0x2')](_0x6e70('0x11'),{'options':{'raw':!![],'where':{'role':_0x6e70('0x12')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x6'),_0x6e70('0x13')]},'log':_0x6e70('0x10')});};};exports[_0x6e70('0x14')]=function(_0x4600f9,_0x5b3d07,_0x47f6b2){return client[_0x6e70('0x2')](_0x6e70('0x15'),{'body':{'type':_0x5b3d07,'uniqueid':_0x47f6b2},'options':{'where':{'id':_0x4600f9['id']}},'log':_0x6e70('0x14')});};exports[_0x6e70('0x16')]=function(_0x3b38f3){return client[_0x6e70('0x2')](_0x6e70('0x17'),{'body':{},'options':{'where':{'id':_0x3b38f3['id']}},'log':_0x6e70('0x14')});};exports['getAgent']=function(_0x52737e){return client['Request'](_0x6e70('0x18'),{'options':{'raw':![],'where':{'role':'agent','id':_0x52737e},'attributes':['id','name',_0x6e70('0x5'),_0x6e70('0x6'),'fullname',_0x6e70('0x8'),'lastLoginAt',_0x6e70('0xa'),_0x6e70('0xb'),'voicePause','interface']},'log':_0x6e70('0x19')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 4b530fc..5109dcf 100644 --- a/server/services/ami/rpc/voiceAgentReport.js +++ b/server/services/ami/rpc/voiceAgentReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb35c=['CreateVoiceAgentReport','UpdateVoiceAgentReport','create','Request'];(function(_0x217df4,_0x55e19a){var _0x45d49d=function(_0x1da478){while(--_0x1da478){_0x217df4['push'](_0x217df4['shift']());}};_0x45d49d(++_0x55e19a);}(_0xb35c,0x1ea));var _0xcb35=function(_0x5601d8,_0x25b23a){_0x5601d8=_0x5601d8-0x0;var _0x1fb771=_0xb35c[_0x5601d8];return _0x1fb771;};'use strict';var client=require('../client');exports[_0xcb35('0x0')]=function(_0x2569fc){return client[_0xcb35('0x1')](_0xcb35('0x2'),{'body':_0x2569fc,'log':'CreateVoiceAgentReport'});};exports['update']=function(_0x48f296,_0x3c507d,_0x133a90){return client['Request'](_0xcb35('0x3'),{'body':_0x48f296,'options':{'where':{'uniqueid':_0x3c507d,'interface':_0x133a90,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0x6128=['create','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport'];(function(_0x1bdfe9,_0x188780){var _0x16c105=function(_0x41cb45){while(--_0x41cb45){_0x1bdfe9['push'](_0x1bdfe9['shift']());}};_0x16c105(++_0x188780);}(_0x6128,0xdc));var _0x8612=function(_0x105762,_0x39e66b){_0x105762=_0x105762-0x0;var _0x3fe98e=_0x6128[_0x105762];return _0x3fe98e;};'use strict';var client=require('../client');exports[_0x8612('0x0')]=function(_0x329837){return client[_0x8612('0x1')](_0x8612('0x2'),{'body':_0x329837,'log':_0x8612('0x2')});};exports[_0x8612('0x3')]=function(_0xbcd82d,_0x1ce5c2,_0x508de2){return client['Request'](_0x8612('0x4'),{'body':_0xbcd82d,'options':{'where':{'uniqueid':_0x1ce5c2,'interface':_0x508de2,'agentcomplete':!![]}},'log':_0x8612('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index dfeb12b..45c4986 100644 --- a/server/services/ami/rpc/voiceCallReport.js +++ b/server/services/ami/rpc/voiceCallReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3efe=['lodash','../client','Request','merge','calleridnum','context','DOCUMENTATION','CreateVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration','billableseconds','GetVoiceCallReports','moment','util'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x3efe,0x18d));var _0xe3ef=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x3efe[_0x4b369d];return _0x571a98;};'use strict';var moment=require(_0xe3ef('0x0'));var util=require(_0xe3ef('0x1'));var _=require(_0xe3ef('0x2'));var client=require(_0xe3ef('0x3'));exports['create']=function(_0x269c6f){return client[_0xe3ef('0x4')]('CreateVoiceCallReport',{'body':_[_0xe3ef('0x5')](_0x269c6f,{'source':_0x269c6f[_0xe3ef('0x6')],'destinationcontext':_0x269c6f[_0xe3ef('0x7')],'callerid':_0x269c6f['callerid'],'amaflags':_0xe3ef('0x8')}),'log':_0xe3ef('0x9')});};exports['getVoiceCallReports']=function(){return function(){return client['Request']('GetVoiceCallReport',{'options':{'where':{'type':[_0xe3ef('0xa')],'createdAt':{'$between':[moment()[_0xe3ef('0xb')](_0xe3ef('0xc'))[_0xe3ef('0xd')](_0xe3ef('0xe')),moment()[_0xe3ef('0xf')](_0xe3ef('0xc'))['format'](_0xe3ef('0xe'))]}},'attributes':[_0xe3ef('0x10'),_0xe3ef('0x11'),_0xe3ef('0x12'),_0xe3ef('0x13')]},'log':_0xe3ef('0x14')});};}; \ No newline at end of file +var _0x15d2=['util','lodash','create','Request','CreateVoiceCallReport','calleridnum','context','DOCUMENTATION','format','YYYY-MM-DD\x20HH:mm:ss','endOf','day','type','disposition','billableseconds','GetVoiceCallReports','moment'];(function(_0x13a8cc,_0x45b4fc){var _0x31b53c=function(_0x3ea73b){while(--_0x3ea73b){_0x13a8cc['push'](_0x13a8cc['shift']());}};_0x31b53c(++_0x45b4fc);}(_0x15d2,0x1a8));var _0x215d=function(_0x2eac4f,_0x5173f9){_0x2eac4f=_0x2eac4f-0x0;var _0x58f73b=_0x15d2[_0x2eac4f];return _0x58f73b;};'use strict';var moment=require(_0x215d('0x0'));var util=require(_0x215d('0x1'));var _=require(_0x215d('0x2'));var client=require('../client');exports[_0x215d('0x3')]=function(_0x23868c){return client[_0x215d('0x4')](_0x215d('0x5'),{'body':_['merge'](_0x23868c,{'source':_0x23868c[_0x215d('0x6')],'destinationcontext':_0x23868c[_0x215d('0x7')],'callerid':_0x23868c['callerid'],'amaflags':_0x215d('0x8')}),'log':_0x215d('0x5')});};exports['getVoiceCallReports']=function(){return function(){return client[_0x215d('0x4')]('GetVoiceCallReport',{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()['startOf']('day')[_0x215d('0x9')](_0x215d('0xa')),moment()[_0x215d('0xb')](_0x215d('0xc'))[_0x215d('0x9')](_0x215d('0xa'))]}},'attributes':[_0x215d('0xd'),_0x215d('0xe'),'duration',_0x215d('0xf')]},'log':_0x215d('0x10')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index e247d79..b60dc8b 100644 --- a/server/services/ami/rpc/voiceDialReport.js +++ b/server/services/ami/rpc/voiceDialReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3c31=['../client','Request','CreateVoiceDialReport'];(function(_0x523321,_0x155e1f){var _0x13f85e=function(_0x5461e8){while(--_0x5461e8){_0x523321['push'](_0x523321['shift']());}};_0x13f85e(++_0x155e1f);}(_0x3c31,0x75));var _0x13c3=function(_0x166ed0,_0xf682dc){_0x166ed0=_0x166ed0-0x0;var _0x70f867=_0x3c31[_0x166ed0];return _0x70f867;};'use strict';var client=require(_0x13c3('0x0'));exports['create']=function(_0x1e426d){return client[_0x13c3('0x1')](_0x13c3('0x2'),{'body':_0x1e426d,'log':'CreateVoiceDialReport'});}; \ No newline at end of file +var _0x6b9b=['../client','Request','CreateVoiceDialReport'];(function(_0x204eb7,_0x4974c3){var _0x37e444=function(_0x390613){while(--_0x390613){_0x204eb7['push'](_0x204eb7['shift']());}};_0x37e444(++_0x4974c3);}(_0x6b9b,0x66));var _0xb6b9=function(_0x33fa9f,_0x32f2d7){_0x33fa9f=_0x33fa9f-0x0;var _0x4257e1=_0x6b9b[_0x33fa9f];return _0x4257e1;};'use strict';var client=require(_0xb6b9('0x0'));exports['create']=function(_0x49f9c3){return client[_0xb6b9('0x1')](_0xb6b9('0x2'),{'body':_0x49f9c3,'log':'CreateVoiceDialReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 820ba9c..95420ba 100644 --- a/server/services/ami/rpc/voiceExtension.js +++ b/server/services/ami/rpc/voiceExtension.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x131e=['GetVoiceExtension','exten','recordingFormat','getVoiceExtensions'];(function(_0x338e5d,_0x1f18a9){var _0x1ba1e2=function(_0x1e5403){while(--_0x1e5403){_0x338e5d['push'](_0x338e5d['shift']());}};_0x1ba1e2(++_0x1f18a9);}(_0x131e,0x1ec));var _0xe131=function(_0x5582a0,_0x698d59){_0x5582a0=_0x5582a0-0x0;var _0x913e83=_0x131e[_0x5582a0];return _0x913e83;};'use strict';var client=require('../client');exports['getVoiceExtensions']=function(){return function(){return client['Request'](_0xe131('0x0'),{'options':{'raw':!![],'attributes':['id',_0xe131('0x1'),_0xe131('0x2')],'where':{'VoiceExtensionId':null}},'log':_0xe131('0x3')});};}; \ No newline at end of file +var _0xf194=['../client','getVoiceExtensions','Request','GetVoiceExtension','recordingFormat'];(function(_0x19ad01,_0x18bd5e){var _0x2ccdc4=function(_0x19b20a){while(--_0x19b20a){_0x19ad01['push'](_0x19ad01['shift']());}};_0x2ccdc4(++_0x18bd5e);}(_0xf194,0x91));var _0x4f19=function(_0x3e0eef,_0x3f778e){_0x3e0eef=_0x3e0eef-0x0;var _0x15a37a=_0xf194[_0x3e0eef];return _0x15a37a;};'use strict';var client=require(_0x4f19('0x0'));exports[_0x4f19('0x1')]=function(){return function(){return client[_0x4f19('0x2')](_0x4f19('0x3'),{'options':{'raw':!![],'attributes':['id','exten',_0x4f19('0x4')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index c85cf81..2cf3a3d 100644 --- a/server/services/ami/rpc/voiceQueue.js +++ b/server/services/ami/rpc/voiceQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6b71=['dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewRecallmeReminder','Trunk','callerid','active','mandatoryDispositionPause','Interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialCutDigit','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry'];(function(_0xb21614,_0x4ab194){var _0xd5a175=function(_0x3e4056){while(--_0x3e4056){_0xb21614['push'](_0xb21614['shift']());}};_0xd5a175(++_0x4ab194);}(_0x6b71,0x1a6));var _0x16b7=function(_0x3cec7e,_0x9decf5){_0x3cec7e=_0x3cec7e-0x0;var _0xdb488d=_0x6b71[_0x3cec7e];return _0xdb488d;};'use strict';var client=require(_0x16b7('0x0'));exports[_0x16b7('0x1')]=function(){return function(){return client[_0x16b7('0x2')](_0x16b7('0x3'),{'options':{'raw':![],'attributes':['id',_0x16b7('0x4'),_0x16b7('0x5'),_0x16b7('0x6'),_0x16b7('0x7'),_0x16b7('0x8'),_0x16b7('0x9'),_0x16b7('0xa'),_0x16b7('0xb'),_0x16b7('0xc'),'dialLimitQueue',_0x16b7('0xd'),_0x16b7('0xe'),_0x16b7('0xf'),_0x16b7('0x10'),'dialOriginateCallerIdName',_0x16b7('0x11'),_0x16b7('0x12'),_0x16b7('0x13'),'dialQueueTimeout',_0x16b7('0x14'),_0x16b7('0x15'),_0x16b7('0x16'),_0x16b7('0x17'),_0x16b7('0x18'),'dialNoAnswerMaxRetry',_0x16b7('0x19'),'dialGlobalMaxRetry','dialTimezone',_0x16b7('0x1a'),_0x16b7('0x1b'),_0x16b7('0x1c'),'dialAMDActive',_0x16b7('0x1d'),_0x16b7('0x1e'),_0x16b7('0x1f'),_0x16b7('0x20'),_0x16b7('0x21'),_0x16b7('0x22'),_0x16b7('0x23'),_0x16b7('0x24'),'dialAMDMaximumWordLength',_0x16b7('0x25'),_0x16b7('0x26'),_0x16b7('0x27'),_0x16b7('0x28'),'dialAgiAfterHangupAgent',_0x16b7('0x29'),_0x16b7('0x2a'),'monitor_format',_0x16b7('0x2b'),'dialRandomLastDigitCallerIdNumber',_0x16b7('0x2c'),'dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency',_0x16b7('0x2d'),'dialDropRetryFrequency',_0x16b7('0x2e'),_0x16b7('0x2f'),'dialMachineMaxRetry',_0x16b7('0x30'),_0x16b7('0x31'),_0x16b7('0x32'),'mandatoryDisposition',_0x16b7('0x33'),_0x16b7('0x34'),'dialPreviewAutoRecallMe',_0x16b7('0x35')],'include':[{'model':'Trunk','as':_0x16b7('0x36'),'attributes':['id',_0x16b7('0x4'),_0x16b7('0x37'),_0x16b7('0x38')]},{'model':'Pause','as':_0x16b7('0x39'),'attributes':['id',_0x16b7('0x4')]},{'model':_0x16b7('0x36'),'as':'TrunkBackup','attributes':['id',_0x16b7('0x4'),_0x16b7('0x37'),_0x16b7('0x38')]},{'model':_0x16b7('0x3a'),'as':_0x16b7('0x3a'),'attributes':['id','name'],'include':[{'model':_0x16b7('0x3a'),'as':'Intervals','attributes':['id',_0x16b7('0x4'),'interval']}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file +var _0x2c51=['dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','name','callerid','active','Pause','mandatoryDispositionPause','Interval','interval','../client','getVoiceQueues','Request','GetVoiceQueue','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialCongestionMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency'];(function(_0x29df9a,_0x42aff3){var _0x3a8e96=function(_0x70fbe7){while(--_0x70fbe7){_0x29df9a['push'](_0x29df9a['shift']());}};_0x3a8e96(++_0x42aff3);}(_0x2c51,0x1c9));var _0x12c5=function(_0x11295b,_0x2b19be){_0x11295b=_0x11295b-0x0;var _0x1f96f5=_0x2c51[_0x11295b];return _0x1f96f5;};'use strict';var client=require(_0x12c5('0x0'));exports[_0x12c5('0x1')]=function(){return function(){return client[_0x12c5('0x2')](_0x12c5('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x12c5('0x4'),_0x12c5('0x5'),_0x12c5('0x6'),_0x12c5('0x7'),_0x12c5('0x8'),_0x12c5('0x9'),_0x12c5('0xa'),_0x12c5('0xb'),_0x12c5('0xc'),_0x12c5('0xd'),'dialPredictiveOptimization','dialPredictiveOptimizationPercentage',_0x12c5('0xe'),'dialOriginateCallerIdName',_0x12c5('0xf'),_0x12c5('0x10'),_0x12c5('0x11'),_0x12c5('0x12'),'dialQueueProject',_0x12c5('0x13'),'dialCongestionRetryFrequency','dialBusyMaxRetry',_0x12c5('0x14'),_0x12c5('0x15'),_0x12c5('0x16'),_0x12c5('0x17'),_0x12c5('0x18'),_0x12c5('0x19'),_0x12c5('0x1a'),'dialCheckDuplicateType',_0x12c5('0x1b'),_0x12c5('0x1c'),'dialAMDGreeting',_0x12c5('0x1d'),_0x12c5('0x1e'),'dialAMDMinWordLength','dialAMDBetweenWordsSilence',_0x12c5('0x1f'),'dialAMDSilenceThreshold',_0x12c5('0x20'),_0x12c5('0x21'),_0x12c5('0x22'),'dialRecallInQueue','dialOrderByScheduledAt',_0x12c5('0x23'),_0x12c5('0x24'),'dialQueueProject2',_0x12c5('0x7'),_0x12c5('0x25'),_0x12c5('0x26'),_0x12c5('0x27'),_0x12c5('0x28'),_0x12c5('0x29'),'dialDropMaxRetry',_0x12c5('0x2a'),'dialAbandonedMaxRetry',_0x12c5('0x2b'),_0x12c5('0x2c'),_0x12c5('0x2d'),_0x12c5('0x2e'),_0x12c5('0x2f'),_0x12c5('0x30'),'dialPredictiveIntervalMaxThreshold',_0x12c5('0x31'),_0x12c5('0x32'),_0x12c5('0x33')],'include':[{'model':'Trunk','as':_0x12c5('0x34'),'attributes':['id',_0x12c5('0x35'),_0x12c5('0x36'),_0x12c5('0x37')]},{'model':_0x12c5('0x38'),'as':_0x12c5('0x39'),'attributes':['id',_0x12c5('0x35')]},{'model':_0x12c5('0x34'),'as':'TrunkBackup','attributes':['id',_0x12c5('0x35'),_0x12c5('0x36'),_0x12c5('0x37')]},{'model':_0x12c5('0x3a'),'as':_0x12c5('0x3a'),'attributes':['id',_0x12c5('0x35')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0x12c5('0x35'),_0x12c5('0x3b')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index a5d7b34..130b6ee 100644 --- a/server/services/ami/rpc/voiceQueueReport.js +++ b/server/services/ami/rpc/voiceQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x4874c1,_0x3d1071){var _0x3212a5=function(_0x3c9cc4){while(--_0x3c9cc4){_0x4874c1['push'](_0x4874c1['shift']());}};_0x3212a5(++_0x3d1071);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file +var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x3e12e2,_0xe8c095){var _0x47727f=function(_0x50bac8){while(--_0x50bac8){_0x3e12e2['push'](_0x3e12e2['shift']());}};_0x47727f(++_0xe8c095);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index 59be1e3..e0aa901 100644 --- a/server/services/ami/rpc/voiceQueueRt.js +++ b/server/services/ami/rpc/voiceQueueRt.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa618=['../client','Request','GetVoiceQueueRtPauses'];(function(_0x380e75,_0x486360){var _0x444d96=function(_0x32c8f8){while(--_0x32c8f8){_0x380e75['push'](_0x380e75['shift']());}};_0x444d96(++_0x486360);}(_0xa618,0x1e9));var _0x8a61=function(_0x171543,_0x209ad9){_0x171543=_0x171543-0x0;var _0x598472=_0xa618[_0x171543];return _0x598472;};'use strict';var client=require(_0x8a61('0x0'));exports['getVoiceQueueRtPauses']=function(_0x4660c2){return function(){return client[_0x8a61('0x1')](_0x8a61('0x2'),{'options':{'where':{'VoiceQueueId':_0x4660c2,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file +var _0xa9cd=['../client','getVoiceQueueRtPauses'];(function(_0x429f52,_0x1dc067){var _0x20f80b=function(_0x230799){while(--_0x230799){_0x429f52['push'](_0x429f52['shift']());}};_0x20f80b(++_0x1dc067);}(_0xa9cd,0x10e));var _0xda9c=function(_0x4ab378,_0x2c0c5b){_0x4ab378=_0x4ab378-0x0;var _0x12c8f3=_0xa9cd[_0x4ab378];return _0x12c8f3;};'use strict';var client=require(_0xda9c('0x0'));exports[_0xda9c('0x1')]=function(_0x1ccb85){return function(){return client['Request']('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x1ccb85,'paused':!![]},'raw':!![]},'log':_0xda9c('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index aedc1df..b0b73fb 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x4df8f8,_0x106fe1){var _0x2826d7=function(_0x1ee497){while(--_0x1ee497){_0x4df8f8['push'](_0x4df8f8['shift']());}};_0x2826d7(++_0x106fe1);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file +var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x48f58d,_0x198b9d){var _0x414285=function(_0x187d3e){while(--_0x187d3e){_0x48f58d['push'](_0x48f58d['shift']());}};_0x414285(++_0x198b9d);}(_0x7a54,0x106));var _0x47a5=function(_0x10a1c0,_0x23fce0){_0x10a1c0=_0x10a1c0-0x0;var _0x571f12=_0x7a54[_0x10a1c0];return _0x571f12;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index f5440b7..fb99ae8 100644 --- a/server/services/ami/rpc/voiceTransferReport.js +++ b/server/services/ami/rpc/voiceTransferReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3ede=['transfererconnectedlinename','transfereraccountcode','transferercontext','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','blind','attendedTransfer','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum'];(function(_0x1ff94f,_0x58c9d7){var _0x368fbc=function(_0xdadbe1){while(--_0xdadbe1){_0x1ff94f['push'](_0x1ff94f['shift']());}};_0x368fbc(++_0x58c9d7);}(_0x3ede,0x198));var _0xe3ed=function(_0x30e004,_0x46f8c2){_0x30e004=_0x30e004-0x0;var _0x5ca247=_0x3ede[_0x30e004];return _0x5ca247;};'use strict';var client=require(_0xe3ed('0x0'));exports[_0xe3ed('0x1')]={};exports[_0xe3ed('0x2')]=function(_0x2d86d9){return client[_0xe3ed('0x3')](_0xe3ed('0x4'),{'body':{'result':_0x2d86d9[_0xe3ed('0x5')],'transfererchannel':_0x2d86d9[_0xe3ed('0x6')],'transferercalleridnum':_0x2d86d9[_0xe3ed('0x7')],'transferercalleridname':_0x2d86d9[_0xe3ed('0x8')],'transfererconnectedlinenum':_0x2d86d9[_0xe3ed('0x9')],'transfererconnectedlinename':_0x2d86d9[_0xe3ed('0xa')],'transfereraccountcode':_0x2d86d9[_0xe3ed('0xb')],'transferercontext':_0x2d86d9[_0xe3ed('0xc')],'transfererexten':_0x2d86d9['transfererexten'],'transfererlinkedid':_0x2d86d9['transfererlinkedid'],'transfereechannel':_0x2d86d9[_0xe3ed('0xd')],'transfereecalleridnum':_0x2d86d9[_0xe3ed('0xe')],'transfereecalleridname':_0x2d86d9[_0xe3ed('0xf')],'transfereeconnectedlinenum':_0x2d86d9[_0xe3ed('0x10')],'transfereeconnectedlinename':_0x2d86d9[_0xe3ed('0x11')],'transfereeaccountcode':_0x2d86d9['transfereeaccountcode'],'transfereecontext':_0x2d86d9[_0xe3ed('0x12')],'transfereeexten':_0x2d86d9[_0xe3ed('0x13')],'transfereelinkedid':_0x2d86d9[_0xe3ed('0x14')],'isexternal':_0x2d86d9[_0xe3ed('0x15')],'context':_0x2d86d9[_0xe3ed('0x16')],'extension':_0x2d86d9['extension'],'type':_0xe3ed('0x17')},'log':_0xe3ed('0x4')});};exports[_0xe3ed('0x18')]=function(_0x306059){return client['Request'](_0xe3ed('0x4'),{'body':{'result':_0x306059['result'],'transfererchannel':_0x306059['origtransfererchannel'],'transferercalleridnum':_0x306059[_0xe3ed('0x19')],'transferercalleridname':_0x306059['origtransferercalleridname'],'transfererconnectedlinenum':_0x306059[_0xe3ed('0x1a')],'transfererconnectedlinename':_0x306059[_0xe3ed('0x1b')],'transfereraccountcode':_0x306059['origtransfereraccountcode'],'transferercontext':_0x306059[_0xe3ed('0x1c')],'transfererexten':_0x306059[_0xe3ed('0x1d')],'transfererlinkedid':_0x306059[_0xe3ed('0x1e')],'transfereechannel':_0x306059['transfertargetchannel'],'transfereecalleridnum':_0x306059[_0xe3ed('0x1f')],'transfereecalleridname':_0x306059[_0xe3ed('0x20')],'transfereeconnectedlinenum':_0x306059[_0xe3ed('0x21')],'transfereeconnectedlinename':_0x306059[_0xe3ed('0x22')],'transfereeaccountcode':_0x306059[_0xe3ed('0x23')],'transfereecontext':_0x306059['transfertargetcontext'],'transfereeexten':_0x306059[_0xe3ed('0x24')],'transfereelinkedid':_0x306059['transfertargetlinkedid'],'isexternal':_0x306059[_0xe3ed('0x15')],'context':_0x306059['origtransferercontext'],'extension':_0x306059['origtransfererexten'],'type':_0xe3ed('0x25')},'log':_0xe3ed('0x4')});}; \ No newline at end of file +var _0xf6d0=['transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','blind','result','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','Request','CreateVoiceTransferReport','transfererchannel','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid'];(function(_0x406e46,_0x5799cb){var _0x4a3742=function(_0x1fa435){while(--_0x1fa435){_0x406e46['push'](_0x406e46['shift']());}};_0x4a3742(++_0x5799cb);}(_0xf6d0,0x145));var _0x0f6d=function(_0x3aee22,_0x227b34){_0x3aee22=_0x3aee22-0x0;var _0x61fec2=_0xf6d0[_0x3aee22];return _0x61fec2;};'use strict';var client=require(_0x0f6d('0x0'));exports['transfers']={};exports['blindTransfer']=function(_0x1c5f46){return client[_0x0f6d('0x1')](_0x0f6d('0x2'),{'body':{'result':_0x1c5f46['result'],'transfererchannel':_0x1c5f46[_0x0f6d('0x3')],'transferercalleridnum':_0x1c5f46['transferercalleridnum'],'transferercalleridname':_0x1c5f46[_0x0f6d('0x4')],'transfererconnectedlinenum':_0x1c5f46[_0x0f6d('0x5')],'transfererconnectedlinename':_0x1c5f46[_0x0f6d('0x6')],'transfereraccountcode':_0x1c5f46[_0x0f6d('0x7')],'transferercontext':_0x1c5f46[_0x0f6d('0x8')],'transfererexten':_0x1c5f46[_0x0f6d('0x9')],'transfererlinkedid':_0x1c5f46[_0x0f6d('0xa')],'transfereechannel':_0x1c5f46[_0x0f6d('0xb')],'transfereecalleridnum':_0x1c5f46[_0x0f6d('0xc')],'transfereecalleridname':_0x1c5f46[_0x0f6d('0xd')],'transfereeconnectedlinenum':_0x1c5f46[_0x0f6d('0xe')],'transfereeconnectedlinename':_0x1c5f46[_0x0f6d('0xf')],'transfereeaccountcode':_0x1c5f46[_0x0f6d('0x10')],'transfereecontext':_0x1c5f46[_0x0f6d('0x11')],'transfereeexten':_0x1c5f46[_0x0f6d('0x12')],'transfereelinkedid':_0x1c5f46[_0x0f6d('0x13')],'isexternal':_0x1c5f46[_0x0f6d('0x14')],'context':_0x1c5f46[_0x0f6d('0x15')],'extension':_0x1c5f46['extension'],'type':_0x0f6d('0x16')},'log':'CreateVoiceTransferReport'});};exports['attendedTransfer']=function(_0x3f8581){return client[_0x0f6d('0x1')](_0x0f6d('0x2'),{'body':{'result':_0x3f8581[_0x0f6d('0x17')],'transfererchannel':_0x3f8581[_0x0f6d('0x18')],'transferercalleridnum':_0x3f8581[_0x0f6d('0x19')],'transferercalleridname':_0x3f8581[_0x0f6d('0x1a')],'transfererconnectedlinenum':_0x3f8581['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x3f8581[_0x0f6d('0x1b')],'transfereraccountcode':_0x3f8581[_0x0f6d('0x1c')],'transferercontext':_0x3f8581['secondtransferercontext'],'transfererexten':_0x3f8581[_0x0f6d('0x1d')],'transfererlinkedid':_0x3f8581[_0x0f6d('0x1e')],'transfereechannel':_0x3f8581[_0x0f6d('0x1f')],'transfereecalleridnum':_0x3f8581[_0x0f6d('0x20')],'transfereecalleridname':_0x3f8581[_0x0f6d('0x21')],'transfereeconnectedlinenum':_0x3f8581['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x3f8581[_0x0f6d('0x22')],'transfereeaccountcode':_0x3f8581[_0x0f6d('0x23')],'transfereecontext':_0x3f8581[_0x0f6d('0x24')],'transfereeexten':_0x3f8581[_0x0f6d('0x25')],'transfereelinkedid':_0x3f8581[_0x0f6d('0x26')],'isexternal':_0x3f8581[_0x0f6d('0x14')],'context':_0x3f8581[_0x0f6d('0x27')],'extension':_0x3f8581[_0x0f6d('0x28')],'type':_0x0f6d('0x29')},'log':_0x0f6d('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 1f2f56b..0b42713 100644 --- a/server/services/ami/server/index.js +++ b/server/services/ami/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','moment','../../../config/environment','../ami','../model/voiceQueueSummary','listen','name','timers','updateAcw','agents','updateStatusRealtime','voiceStatus','pause','isConnected','error','asterisk','ami\x20disconnected','join','pick','keys','reload','Reload','message','catch','username','command','action','Command','then','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','channels','validate','map','uniqueid','channel','format','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','toLowerCase','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','Action','StopMixMonitor','destinationchannel','stop','filename','queueChannels','type','outbound','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','run','custom:','event','faxAccounts','send'];(function(_0x434c6c,_0x23ffd8){var _0x2379c9=function(_0x1568f9){while(--_0x1568f9){_0x434c6c['push'](_0x434c6c['shift']());}};_0x2379c9(++_0x23ffd8);}(_0x7a54,0x106));var _0x47a5=function(_0x5b3679,_0x3fe47c){_0x5b3679=_0x5b3679-0x0;var _0x11adc2=_0x7a54[_0x5b3679];return _0x11adc2;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var jayson=require(_0x47a5('0x2'));var schema=require('validate');var moment=require(_0x47a5('0x3'));var config=require(_0x47a5('0x4'));var properties=require('../properties');var ami=require(_0x47a5('0x5'));var VoiceQueueSummary=require(_0x47a5('0x6'));exports[_0x47a5('0x7')]=function(_0x3717e1,_0xfdf934,_0x545a97){return new Promise(function(_0x3d5629,_0x59199c){var _0x343372={'QueuePause':function(_0x30e405){return new Promise(function(_0x506eda){var _0x194fb0=util['format']('%s/%s','SIP',_0x30e405[_0x47a5('0x8')]);if(_0x3717e1[_0x47a5('0x9')]&&_0x3717e1['timers'][_0x194fb0]&&_0x3717e1[_0x47a5('0x9')][_0x194fb0]['timer']){_0x3717e1['timers'][_0x194fb0][_0x47a5('0xa')]();}if(_0x3717e1[_0x47a5('0xb')][_0x194fb0]){_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xc')]({'state':_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xd')],'statePause':_0x30e405[_0x47a5('0xe')]?!![]:![]});}_0x506eda({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x44bd3e){var _0x221b54=this;return new Promise(function(_0x1cf309,_0x711793){if(ami[_0x47a5('0xf')]()==![]){return _0x711793(_0x221b54[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}_0x44bd3e=_[_0x47a5('0x14')](_0x44bd3e,_[_0x47a5('0x15')](properties[_0x47a5('0x16')]['module']));_0x44bd3e['action']=_0x47a5('0x17');return ami['Action'](_0x44bd3e)['then'](function(_0x423a81){_0x1cf309({'code':0xc8,'message':_0x423a81[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x1ef371){_0x711793(_0x221b54[_0x47a5('0x10')](0x1f5,_0x1ef371[_0x47a5('0x18')]));});});},'Command':function(_0x2763d6){var _0xe3c618=this;return new Promise(function(_0x3aed38,_0x4a9fcb){if(ami[_0x47a5('0xf')]()==![]){return _0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f4,[config['asterisk']['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')]['join']('\x20')));}_0x2763d6=_[_0x47a5('0x14')](_0x2763d6,_0x47a5('0x1b'));_0x2763d6[_0x47a5('0x1c')]=_0x47a5('0x1d');return ami['Action'](_0x2763d6)[_0x47a5('0x1e')](function(_0x385687){_0x3aed38({'code':0xc8,'message':_0x385687['content']});})[_0x47a5('0x19')](function(_0xc4cd63){_0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f5,_0xc4cd63[_0x47a5('0x18')]));});});},'VoiceQueues':function(){return new Promise(function(_0x3abd6a){var _0x50bf17=[];for(var _0x53078a in _0x3717e1[_0x47a5('0x1f')]){if(_0x3717e1['voiceQueues'][_0x47a5('0x20')](_0x53078a)){var _0x5b6c4e=_0x3717e1[_0x47a5('0x1f')][_0x53078a];var _0x378208=new VoiceQueueSummary(_0x5b6c4e);_0x50bf17[_0x47a5('0x21')](_0x378208);}}_0x3abd6a({'count':_0x50bf17[_0x47a5('0x22')],'rows':_0x50bf17});});},'UpdateVoiceQueue':function(_0x21f296){return new Promise(function(_0x3ba0b7,_0x24b162){var _0x136b14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x1f')],{'id':parseInt(_0x21f296['id'])});var _0x1127f8=_[_0x47a5('0x24')](_0x21f296,['id']);if(_0x136b14){for(var _0x3ad507 in _0x1127f8){if(typeof _0x1127f8[_0x3ad507]!=='undefined'&&typeof _0x136b14[_0x3ad507]!==_0x47a5('0x25')){_0x136b14[_0x3ad507]=_0x1127f8[_0x3ad507];}}_0x3ba0b7(_0x136b14);}else{_0x24b162();}});},'VoiceChannels':function(){return new Promise(function(_0x51833b){var _0x2ef875=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x27')]);_0x51833b({'count':_0x2ef875['length'],'rows':_0x2ef875});});},'VoiceChannelMixMonitor':function(_0x256650){var _0x625952=this;return new Promise(function(_0x39b50b,_0x1f1c68){if(ami['isConnected']()==![]){return _0x1f1c68(_0x625952['error'](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],'ami\x20disconnected'][_0x47a5('0x13')]('\x20')));}var _0x51544e=schema(properties['voicechannel'])[_0x47a5('0x28')](_0x256650);if(_0x51544e['length']>0x0){return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x51544e,'message')['join'](',\x20')));}var _0x274e34=_['find'](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x256650[_0x47a5('0x2a')]});if(_0x274e34&&_0x274e34[_0x47a5('0x2b')]){var _0x52749b=util[_0x47a5('0x2c')]('%s.%s',_0x256650['filename']||_0x256650[_0x47a5('0x2a')],_0x256650['format']||_0x47a5('0x2d'));return ami['Action']({'action':_0x47a5('0x2e'),'channel':_0x274e34[_0x47a5('0x2b')],'file':_0x52749b,'options':_0x47a5('0x2f')})[_0x47a5('0x1e')](function(_0x36add5){var _0xed6320=_[_0x47a5('0x23')](_0x274e34[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52749b['toLowerCase']()});if(_[_0x47a5('0x32')](_0xed6320)){_0x274e34[_0x47a5('0x30')]['push']({'filename':_0x47a5('0x31')+_0x52749b[_0x47a5('0x33')](),'createdAt':moment()[_0x47a5('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x36add5[_0x47a5('0x34')],'status':_0x47a5('0x35')});}else{_0xed6320['mixmonitorid']=_0x36add5[_0x47a5('0x34')];_0xed6320[_0x47a5('0x36')]='rec';}_0x39b50b({'code':0xc8,'message':[_0x256650['uniqueid'],'MixMonitor\x20Success',_0x36add5[_0x47a5('0x34')]]['join']('\x20'),'mixmonitorid':_0x36add5[_0x47a5('0x34')]});})[_0x47a5('0x19')](function(_0x301a85){_0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,[_0x256650[_0x47a5('0x2a')],_0x301a85[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,_0x47a5('0x37')));}});},'VoiceChannelStopMixMonitor':function(_0x280500){var _0x1658e8=this;return new Promise(function(_0x23d6d8,_0x56dbbd){if(ami[_0x47a5('0xf')]()==![]){return _0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')]['join']('\x20')));}var _0x47c7a2=schema(properties['voicechannel'])['validate'](_0x280500);if(_0x47c7a2[_0x47a5('0x22')]>0x0){return _0x56dbbd(_0x1658e8['error'](0x1f4,_[_0x47a5('0x29')](_0x47c7a2,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x494526=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x280500['uniqueid']});if(_0x494526){return Promise['resolve']()[_0x47a5('0x1e')](function(){if(_0x494526['channel']){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x2b')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){if(_0x494526[_0x47a5('0x3a')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x3a')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){var _0x3574d4=_[_0x47a5('0x23')](_0x494526[_0x47a5('0x30')],{'mixmonitorid':_0x280500['mixmonitorid']});if(_0x3574d4){_0x3574d4[_0x47a5('0x36')]=_0x47a5('0x3b');}})['then'](function(){var _0x52b3a8=util[_0x47a5('0x2c')]('%s.%s',_0x280500[_0x47a5('0x3c')]||_0x280500[_0x47a5('0x2a')],_0x280500['format']||'wav');var _0x3d85cc=_['find'](_0x494526[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52b3a8[_0x47a5('0x33')]()});if(_0x3d85cc){_0x3d85cc[_0x47a5('0x36')]=_0x47a5('0x3b');}})[_0x47a5('0x1e')](function(){_0x23d6d8({'code':0xc8,'message':[_0x280500[_0x47a5('0x2a')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0x47a5('0x19')](function(_0x411230){_0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f5,[_0x280500[_0x47a5('0x2a')],_0x411230[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x56dbbd(_0x1658e8['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannels':function(_0x1c9a62){var _0x5f6a=this;return new Promise(function(_0x5c3c75){var _0x12ca40=_['values'](_0x3717e1[_0x47a5('0x3d')]);var _0xe31817={'count':_0x12ca40[_0x47a5('0x22')],'rows':_0x12ca40};if(_0x1c9a62&&_0x1c9a62[_0x47a5('0x3e')]){if(!['inbound',_0x47a5('0x3f')][_0x47a5('0x40')](_0x1c9a62[_0x47a5('0x3e')])){return _0x59199c(_0x5f6a[_0x47a5('0x10')](0x190,_0x47a5('0x41')));}var _0x6a53b3=_[_0x47a5('0x42')](_0x12ca40,function(_0x481089){return _0x481089[_0x47a5('0x3e')]===_0x1c9a62[_0x47a5('0x3e')];});_0xe31817[_0x47a5('0x43')]=_0x6a53b3[_0x47a5('0x22')];_0xe31817[_0x47a5('0x44')]=_0x6a53b3;}_0x5c3c75(_0xe31817);});},'VoiceQueuesChannel':function(_0x1ab0bf){var _0x572233=this;return new Promise(function(_0x1ad6a9,_0x245a15){var _0x1aa581=schema(properties['voicequeuechannel'])[_0x47a5('0x28')](_0x1ab0bf);if(_0x1aa581[_0x47a5('0x22')]>0x0){return _0x245a15(_0x572233[_0x47a5('0x10')](0x1f4,_['map'](_0x1aa581,'message')[_0x47a5('0x13')](',\x20')));}var _0x376e1d=_['find'](_0x3717e1['queueChannels'],{'uniqueid':_0x1ab0bf[_0x47a5('0x2a')]});if(_0x376e1d){_0x1ad6a9(_0x376e1d);}else{return _0x245a15(_0x572233['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannelHangup':function(_0x5d383d){var _0x482de6=this;return new Promise(function(_0x389ed9,_0x46d2d3){if(ami['isConnected']()==![]){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config['asterisk']['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x867da0=schema(properties[_0x47a5('0x45')])['validate'](_0x5d383d);if(_0x867da0[_0x47a5('0x22')]>0x0){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x867da0,'message')[_0x47a5('0x13')](',\x20')));}var _0x4db625=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x5d383d[_0x47a5('0x2a')]});if(_0x4db625&&_0x4db625[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':'Hangup','channel':_0x4db625[_0x47a5('0x2b')]})['then'](function(_0x5cbe97){_0x389ed9({'code':0xc8,'message':[_0x5d383d['uniqueid'],_0x5cbe97['message'][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')});})[_0x47a5('0x19')](function(_0x52e3ee){_0x46d2d3(_0x482de6['error'](0x1f5,[_0x5d383d[_0x47a5('0x2a')],_0x52e3ee[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x3474b7){var _0x519e9e=this;return new Promise(function(_0x22c886,_0x274d31){if(ami['isConnected']()==![]){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x35cca8=schema(properties[_0x47a5('0x46')])['validate'](_0x3474b7);if(_0x35cca8[_0x47a5('0x22')]>0x0){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x35cca8,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x4bbe14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x3474b7[_0x47a5('0x2a')]});if(_0x4bbe14&&_0x4bbe14[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x47'),'channel':_0x4bbe14[_0x47a5('0x2b')],'exten':_0x3474b7[_0x47a5('0x48')],'context':_0x3474b7[_0x47a5('0x49')]||_0x4bbe14[_0x47a5('0x49')],'priority':0x1})[_0x47a5('0x1e')](function(_0x44fda9){_0x22c886({'code':0xc8,'message':[_0x3474b7[_0x47a5('0x2a')],_0x44fda9[_0x47a5('0x18')][_0x47a5('0x33')]()]['join']('\x20')});})[_0x47a5('0x19')](function(_0x284fb8){_0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,[_0x3474b7['uniqueid'],_0x284fb8[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x3ac402){return new Promise(function(_0x522ccf){var _0x2d5ee6=_['values'](_0x3717e1[_0x47a5('0xb')]);if(_0x3ac402&&_0x3ac402['id']){var _0x4cf7c5=_[_0x47a5('0x23')](_0x2d5ee6,function(_0x2f27c3){return _0x2f27c3['id']===_0x3ac402['id'];});_0x522ccf(_0x4cf7c5);}else{_0x522ccf({'count':_0x2d5ee6[_0x47a5('0x22')],'rows':_0x2d5ee6});}});},'Telephones':function(){return new Promise(function(_0x58473b){var _0x4af557=_['values'](_0x3717e1[_0x47a5('0x4a')]);_0x58473b({'count':_0x4af557[_0x47a5('0x22')],'rows':_0x4af557});});},'Trunks':function(){return new Promise(function(_0xe3c0a7){var _0x117510=_['values'](_0x3717e1[_0x47a5('0x4b')]);_0xe3c0a7({'count':_0x117510[_0x47a5('0x22')],'rows':_0x117510});});},'OutboundChannels':function(){return new Promise(function(_0x390bc0){var _0xd5b23f=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x4c')]);_0x390bc0({'count':_0xd5b23f[_0x47a5('0x22')],'rows':_0xd5b23f});});},'Outbound':function(){return new Promise(function(_0x39939a){_0x39939a(_0x3717e1[_0x47a5('0x3f')]);});},'Campaigns':function(){return new Promise(function(_0xc69a68){var _0x2e6fcc=_[_0x47a5('0x26')](_0x3717e1['campaigns']);_0xc69a68({'count':_0x2e6fcc[_0x47a5('0x22')],'rows':_0x2e6fcc});});},'VoiceQueuesPreview':function(_0x4833be){var _0x2ad00a=this;return new Promise(function(_0x2ac30f,_0x281e5f){_0xfdf934[_0x47a5('0x4d')](_0x4833be['id'])[_0x47a5('0x1e')](function(_0xa9c853){_0x2ac30f({'code':0xc8,'message':_0xa9c853[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x11c1db){_0x281e5f(_0x2ad00a[_0x47a5('0x10')](0x1f4,_0x11c1db[_0x47a5('0x18')]));});});},'EventManager':function(_0x1f07ac){var _0x8f0035=this;return new Promise(function(_0x2d434c,_0x441d64){if(!_0x1f07ac['event']){return _0x441d64(_0x8f0035['error'](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0x47a5('0x4e')+_0x1f07ac[_0x47a5('0x4f')],_0x1f07ac['message']);_0x2d434c({'code':0xc8,'message':_0x1f07ac});});},'FaxAccounts':function(){return new Promise(function(_0x732e00){var _0x44dda2=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x50')]);_0x732e00({'count':_0x44dda2[_0x47a5('0x22')],'rows':_0x44dda2});});},'SendFax':function(_0x930d25){var _0x218dfa=this;return new Promise(function(_0x1c7302,_0x2e9a96){_0x545a97[_0x47a5('0x51')](_0x930d25)[_0x47a5('0x1e')](function(_0x5e5f16){_0x1c7302({'code':0xc8,'message':_0x5e5f16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x420671){_0x2e9a96(_0x218dfa['error'](0x1f4,_0x420671[_0x47a5('0x18')]));});});},'CheckAfterSend':function(_0x32f393){var _0x17b61d=this;return new Promise(function(_0x5d41d8,_0x19dc8c){_0x545a97['checkAfterSend'](_0x32f393)['then'](function(_0x356e16){_0x5d41d8({'code':0xc8,'message':_0x356e16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x27333e){_0x19dc8c(_0x17b61d[_0x47a5('0x10')](0x1f4,_0x27333e[_0x47a5('0x18')]));});});}};var _0x479a82=jayson['server'](_0x343372)[_0x47a5('0x52')]();_0x479a82['on']('error',function(_0x24dbee){return _0x59199c(_0x24dbee);});_0x479a82[_0x47a5('0x7')](0x232a,_0x47a5('0x53'),function(){console[_0x47a5('0x54')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x3d5629(_0x47a5('0x55')+0x232a);});});}; \ No newline at end of file +var _0x7a54=['http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','moment','../../../config/environment','../ami','../model/voiceQueueSummary','listen','name','timers','updateAcw','agents','updateStatusRealtime','voiceStatus','pause','isConnected','error','asterisk','ami\x20disconnected','join','pick','keys','reload','Reload','message','catch','username','command','action','Command','then','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','channels','validate','map','uniqueid','channel','format','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','toLowerCase','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','Action','StopMixMonitor','destinationchannel','stop','filename','queueChannels','type','outbound','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','run','custom:','event','faxAccounts','send'];(function(_0x149b45,_0x3b4e62){var _0xe7af75=function(_0x5f37e6){while(--_0x5f37e6){_0x149b45['push'](_0x149b45['shift']());}};_0xe7af75(++_0x3b4e62);}(_0x7a54,0x106));var _0x47a5=function(_0x3dd026,_0x3d2d5d){_0x3dd026=_0x3dd026-0x0;var _0x24d43a=_0x7a54[_0x3dd026];return _0x24d43a;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var jayson=require(_0x47a5('0x2'));var schema=require('validate');var moment=require(_0x47a5('0x3'));var config=require(_0x47a5('0x4'));var properties=require('../properties');var ami=require(_0x47a5('0x5'));var VoiceQueueSummary=require(_0x47a5('0x6'));exports[_0x47a5('0x7')]=function(_0x3717e1,_0xfdf934,_0x545a97){return new Promise(function(_0x3d5629,_0x59199c){var _0x343372={'QueuePause':function(_0x30e405){return new Promise(function(_0x506eda){var _0x194fb0=util['format']('%s/%s','SIP',_0x30e405[_0x47a5('0x8')]);if(_0x3717e1[_0x47a5('0x9')]&&_0x3717e1['timers'][_0x194fb0]&&_0x3717e1[_0x47a5('0x9')][_0x194fb0]['timer']){_0x3717e1['timers'][_0x194fb0][_0x47a5('0xa')]();}if(_0x3717e1[_0x47a5('0xb')][_0x194fb0]){_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xc')]({'state':_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xd')],'statePause':_0x30e405[_0x47a5('0xe')]?!![]:![]});}_0x506eda({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x44bd3e){var _0x221b54=this;return new Promise(function(_0x1cf309,_0x711793){if(ami[_0x47a5('0xf')]()==![]){return _0x711793(_0x221b54[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}_0x44bd3e=_[_0x47a5('0x14')](_0x44bd3e,_[_0x47a5('0x15')](properties[_0x47a5('0x16')]['module']));_0x44bd3e['action']=_0x47a5('0x17');return ami['Action'](_0x44bd3e)['then'](function(_0x423a81){_0x1cf309({'code':0xc8,'message':_0x423a81[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x1ef371){_0x711793(_0x221b54[_0x47a5('0x10')](0x1f5,_0x1ef371[_0x47a5('0x18')]));});});},'Command':function(_0x2763d6){var _0xe3c618=this;return new Promise(function(_0x3aed38,_0x4a9fcb){if(ami[_0x47a5('0xf')]()==![]){return _0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f4,[config['asterisk']['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')]['join']('\x20')));}_0x2763d6=_[_0x47a5('0x14')](_0x2763d6,_0x47a5('0x1b'));_0x2763d6[_0x47a5('0x1c')]=_0x47a5('0x1d');return ami['Action'](_0x2763d6)[_0x47a5('0x1e')](function(_0x385687){_0x3aed38({'code':0xc8,'message':_0x385687['content']});})[_0x47a5('0x19')](function(_0xc4cd63){_0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f5,_0xc4cd63[_0x47a5('0x18')]));});});},'VoiceQueues':function(){return new Promise(function(_0x3abd6a){var _0x50bf17=[];for(var _0x53078a in _0x3717e1[_0x47a5('0x1f')]){if(_0x3717e1['voiceQueues'][_0x47a5('0x20')](_0x53078a)){var _0x5b6c4e=_0x3717e1[_0x47a5('0x1f')][_0x53078a];var _0x378208=new VoiceQueueSummary(_0x5b6c4e);_0x50bf17[_0x47a5('0x21')](_0x378208);}}_0x3abd6a({'count':_0x50bf17[_0x47a5('0x22')],'rows':_0x50bf17});});},'UpdateVoiceQueue':function(_0x21f296){return new Promise(function(_0x3ba0b7,_0x24b162){var _0x136b14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x1f')],{'id':parseInt(_0x21f296['id'])});var _0x1127f8=_[_0x47a5('0x24')](_0x21f296,['id']);if(_0x136b14){for(var _0x3ad507 in _0x1127f8){if(typeof _0x1127f8[_0x3ad507]!=='undefined'&&typeof _0x136b14[_0x3ad507]!==_0x47a5('0x25')){_0x136b14[_0x3ad507]=_0x1127f8[_0x3ad507];}}_0x3ba0b7(_0x136b14);}else{_0x24b162();}});},'VoiceChannels':function(){return new Promise(function(_0x51833b){var _0x2ef875=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x27')]);_0x51833b({'count':_0x2ef875['length'],'rows':_0x2ef875});});},'VoiceChannelMixMonitor':function(_0x256650){var _0x625952=this;return new Promise(function(_0x39b50b,_0x1f1c68){if(ami['isConnected']()==![]){return _0x1f1c68(_0x625952['error'](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],'ami\x20disconnected'][_0x47a5('0x13')]('\x20')));}var _0x51544e=schema(properties['voicechannel'])[_0x47a5('0x28')](_0x256650);if(_0x51544e['length']>0x0){return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x51544e,'message')['join'](',\x20')));}var _0x274e34=_['find'](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x256650[_0x47a5('0x2a')]});if(_0x274e34&&_0x274e34[_0x47a5('0x2b')]){var _0x52749b=util[_0x47a5('0x2c')]('%s.%s',_0x256650['filename']||_0x256650[_0x47a5('0x2a')],_0x256650['format']||_0x47a5('0x2d'));return ami['Action']({'action':_0x47a5('0x2e'),'channel':_0x274e34[_0x47a5('0x2b')],'file':_0x52749b,'options':_0x47a5('0x2f')})[_0x47a5('0x1e')](function(_0x36add5){var _0xed6320=_[_0x47a5('0x23')](_0x274e34[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52749b['toLowerCase']()});if(_[_0x47a5('0x32')](_0xed6320)){_0x274e34[_0x47a5('0x30')]['push']({'filename':_0x47a5('0x31')+_0x52749b[_0x47a5('0x33')](),'createdAt':moment()[_0x47a5('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x36add5[_0x47a5('0x34')],'status':_0x47a5('0x35')});}else{_0xed6320['mixmonitorid']=_0x36add5[_0x47a5('0x34')];_0xed6320[_0x47a5('0x36')]='rec';}_0x39b50b({'code':0xc8,'message':[_0x256650['uniqueid'],'MixMonitor\x20Success',_0x36add5[_0x47a5('0x34')]]['join']('\x20'),'mixmonitorid':_0x36add5[_0x47a5('0x34')]});})[_0x47a5('0x19')](function(_0x301a85){_0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,[_0x256650[_0x47a5('0x2a')],_0x301a85[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,_0x47a5('0x37')));}});},'VoiceChannelStopMixMonitor':function(_0x280500){var _0x1658e8=this;return new Promise(function(_0x23d6d8,_0x56dbbd){if(ami[_0x47a5('0xf')]()==![]){return _0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')]['join']('\x20')));}var _0x47c7a2=schema(properties['voicechannel'])['validate'](_0x280500);if(_0x47c7a2[_0x47a5('0x22')]>0x0){return _0x56dbbd(_0x1658e8['error'](0x1f4,_[_0x47a5('0x29')](_0x47c7a2,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x494526=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x280500['uniqueid']});if(_0x494526){return Promise['resolve']()[_0x47a5('0x1e')](function(){if(_0x494526['channel']){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x2b')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){if(_0x494526[_0x47a5('0x3a')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x3a')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){var _0x3574d4=_[_0x47a5('0x23')](_0x494526[_0x47a5('0x30')],{'mixmonitorid':_0x280500['mixmonitorid']});if(_0x3574d4){_0x3574d4[_0x47a5('0x36')]=_0x47a5('0x3b');}})['then'](function(){var _0x52b3a8=util[_0x47a5('0x2c')]('%s.%s',_0x280500[_0x47a5('0x3c')]||_0x280500[_0x47a5('0x2a')],_0x280500['format']||'wav');var _0x3d85cc=_['find'](_0x494526[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52b3a8[_0x47a5('0x33')]()});if(_0x3d85cc){_0x3d85cc[_0x47a5('0x36')]=_0x47a5('0x3b');}})[_0x47a5('0x1e')](function(){_0x23d6d8({'code':0xc8,'message':[_0x280500[_0x47a5('0x2a')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0x47a5('0x19')](function(_0x411230){_0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f5,[_0x280500[_0x47a5('0x2a')],_0x411230[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x56dbbd(_0x1658e8['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannels':function(_0x1c9a62){var _0x5f6a=this;return new Promise(function(_0x5c3c75){var _0x12ca40=_['values'](_0x3717e1[_0x47a5('0x3d')]);var _0xe31817={'count':_0x12ca40[_0x47a5('0x22')],'rows':_0x12ca40};if(_0x1c9a62&&_0x1c9a62[_0x47a5('0x3e')]){if(!['inbound',_0x47a5('0x3f')][_0x47a5('0x40')](_0x1c9a62[_0x47a5('0x3e')])){return _0x59199c(_0x5f6a[_0x47a5('0x10')](0x190,_0x47a5('0x41')));}var _0x6a53b3=_[_0x47a5('0x42')](_0x12ca40,function(_0x481089){return _0x481089[_0x47a5('0x3e')]===_0x1c9a62[_0x47a5('0x3e')];});_0xe31817[_0x47a5('0x43')]=_0x6a53b3[_0x47a5('0x22')];_0xe31817[_0x47a5('0x44')]=_0x6a53b3;}_0x5c3c75(_0xe31817);});},'VoiceQueuesChannel':function(_0x1ab0bf){var _0x572233=this;return new Promise(function(_0x1ad6a9,_0x245a15){var _0x1aa581=schema(properties['voicequeuechannel'])[_0x47a5('0x28')](_0x1ab0bf);if(_0x1aa581[_0x47a5('0x22')]>0x0){return _0x245a15(_0x572233[_0x47a5('0x10')](0x1f4,_['map'](_0x1aa581,'message')[_0x47a5('0x13')](',\x20')));}var _0x376e1d=_['find'](_0x3717e1['queueChannels'],{'uniqueid':_0x1ab0bf[_0x47a5('0x2a')]});if(_0x376e1d){_0x1ad6a9(_0x376e1d);}else{return _0x245a15(_0x572233['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannelHangup':function(_0x5d383d){var _0x482de6=this;return new Promise(function(_0x389ed9,_0x46d2d3){if(ami['isConnected']()==![]){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config['asterisk']['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x867da0=schema(properties[_0x47a5('0x45')])['validate'](_0x5d383d);if(_0x867da0[_0x47a5('0x22')]>0x0){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x867da0,'message')[_0x47a5('0x13')](',\x20')));}var _0x4db625=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x5d383d[_0x47a5('0x2a')]});if(_0x4db625&&_0x4db625[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':'Hangup','channel':_0x4db625[_0x47a5('0x2b')]})['then'](function(_0x5cbe97){_0x389ed9({'code':0xc8,'message':[_0x5d383d['uniqueid'],_0x5cbe97['message'][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')});})[_0x47a5('0x19')](function(_0x52e3ee){_0x46d2d3(_0x482de6['error'](0x1f5,[_0x5d383d[_0x47a5('0x2a')],_0x52e3ee[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x3474b7){var _0x519e9e=this;return new Promise(function(_0x22c886,_0x274d31){if(ami['isConnected']()==![]){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x35cca8=schema(properties[_0x47a5('0x46')])['validate'](_0x3474b7);if(_0x35cca8[_0x47a5('0x22')]>0x0){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x35cca8,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x4bbe14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x3474b7[_0x47a5('0x2a')]});if(_0x4bbe14&&_0x4bbe14[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x47'),'channel':_0x4bbe14[_0x47a5('0x2b')],'exten':_0x3474b7[_0x47a5('0x48')],'context':_0x3474b7[_0x47a5('0x49')]||_0x4bbe14[_0x47a5('0x49')],'priority':0x1})[_0x47a5('0x1e')](function(_0x44fda9){_0x22c886({'code':0xc8,'message':[_0x3474b7[_0x47a5('0x2a')],_0x44fda9[_0x47a5('0x18')][_0x47a5('0x33')]()]['join']('\x20')});})[_0x47a5('0x19')](function(_0x284fb8){_0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,[_0x3474b7['uniqueid'],_0x284fb8[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x3ac402){return new Promise(function(_0x522ccf){var _0x2d5ee6=_['values'](_0x3717e1[_0x47a5('0xb')]);if(_0x3ac402&&_0x3ac402['id']){var _0x4cf7c5=_[_0x47a5('0x23')](_0x2d5ee6,function(_0x2f27c3){return _0x2f27c3['id']===_0x3ac402['id'];});_0x522ccf(_0x4cf7c5);}else{_0x522ccf({'count':_0x2d5ee6[_0x47a5('0x22')],'rows':_0x2d5ee6});}});},'Telephones':function(){return new Promise(function(_0x58473b){var _0x4af557=_['values'](_0x3717e1[_0x47a5('0x4a')]);_0x58473b({'count':_0x4af557[_0x47a5('0x22')],'rows':_0x4af557});});},'Trunks':function(){return new Promise(function(_0xe3c0a7){var _0x117510=_['values'](_0x3717e1[_0x47a5('0x4b')]);_0xe3c0a7({'count':_0x117510[_0x47a5('0x22')],'rows':_0x117510});});},'OutboundChannels':function(){return new Promise(function(_0x390bc0){var _0xd5b23f=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x4c')]);_0x390bc0({'count':_0xd5b23f[_0x47a5('0x22')],'rows':_0xd5b23f});});},'Outbound':function(){return new Promise(function(_0x39939a){_0x39939a(_0x3717e1[_0x47a5('0x3f')]);});},'Campaigns':function(){return new Promise(function(_0xc69a68){var _0x2e6fcc=_[_0x47a5('0x26')](_0x3717e1['campaigns']);_0xc69a68({'count':_0x2e6fcc[_0x47a5('0x22')],'rows':_0x2e6fcc});});},'VoiceQueuesPreview':function(_0x4833be){var _0x2ad00a=this;return new Promise(function(_0x2ac30f,_0x281e5f){_0xfdf934[_0x47a5('0x4d')](_0x4833be['id'])[_0x47a5('0x1e')](function(_0xa9c853){_0x2ac30f({'code':0xc8,'message':_0xa9c853[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x11c1db){_0x281e5f(_0x2ad00a[_0x47a5('0x10')](0x1f4,_0x11c1db[_0x47a5('0x18')]));});});},'EventManager':function(_0x1f07ac){var _0x8f0035=this;return new Promise(function(_0x2d434c,_0x441d64){if(!_0x1f07ac['event']){return _0x441d64(_0x8f0035['error'](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0x47a5('0x4e')+_0x1f07ac[_0x47a5('0x4f')],_0x1f07ac['message']);_0x2d434c({'code':0xc8,'message':_0x1f07ac});});},'FaxAccounts':function(){return new Promise(function(_0x732e00){var _0x44dda2=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x50')]);_0x732e00({'count':_0x44dda2[_0x47a5('0x22')],'rows':_0x44dda2});});},'SendFax':function(_0x930d25){var _0x218dfa=this;return new Promise(function(_0x1c7302,_0x2e9a96){_0x545a97[_0x47a5('0x51')](_0x930d25)[_0x47a5('0x1e')](function(_0x5e5f16){_0x1c7302({'code':0xc8,'message':_0x5e5f16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x420671){_0x2e9a96(_0x218dfa['error'](0x1f4,_0x420671[_0x47a5('0x18')]));});});},'CheckAfterSend':function(_0x32f393){var _0x17b61d=this;return new Promise(function(_0x5d41d8,_0x19dc8c){_0x545a97['checkAfterSend'](_0x32f393)['then'](function(_0x356e16){_0x5d41d8({'code':0xc8,'message':_0x356e16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x27333e){_0x19dc8c(_0x17b61d[_0x47a5('0x10')](0x1f4,_0x27333e[_0x47a5('0x18')]));});});}};var _0x479a82=jayson['server'](_0x343372)[_0x47a5('0x52')]();_0x479a82['on']('error',function(_0x24dbee){return _0x59199c(_0x24dbee);});_0x479a82[_0x47a5('0x7')](0x232a,_0x47a5('0x53'),function(){console[_0x47a5('0x54')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x3d5629(_0x47a5('0x55')+0x232a);});});}; \ No newline at end of file diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index 9894854..f84e0b1 100644 --- a/server/services/ami/trigger/cmContact/index.js +++ b/server/services/ami/trigger/cmContact/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x00c2=['[CM][%s][%s]\x20Contact\x20created:%s','user:%s','name','trigger:%s','action','toLowerCase','merge','lodash','bluebird','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','defaults','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','map','destcalleridnum','calleridnum','routeId','firstName','mobile','fax','createdAt','updatedAt','union','resolve','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','destcalleridname','','Unknown','push'];(function(_0x220b24,_0x2f3599){var _0x52cc97=function(_0x5651c0){while(--_0x5651c0){_0x220b24['push'](_0x220b24['shift']());}};_0x52cc97(++_0x2f3599);}(_0x00c2,0x79));var _0x200c=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x00c2[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x200c('0x0'));var BPromise=require(_0x200c('0x1'));var Redis=require('ioredis');var util=require(_0x200c('0x2'));var config=require(_0x200c('0x3'));var logger=require(_0x200c('0x4'))(_0x200c('0x5'));var cmContactRpc=require(_0x200c('0x6'));config['redis']=_[_0x200c('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x200c('0x8'))(new Redis(config['redis']));function emit(_0x3f612b,_0x18a250,_0x26ff74,_0x32dfd6,_0x262279){logger[_0x200c('0x9')](_0x200c('0xa'),_0x3f612b,_0x18a250['id'],_0x26ff74,_0x32dfd6,JSON[_0x200c('0xb')](_0x262279));io['to'](_0x26ff74)[_0x200c('0xc')](_0x32dfd6,_0x262279);}exports[_0x200c('0xd')]=function(_0x383d46,_0x77929c,_0x5dfb71,_0x5e7c2c){var _0x5baeb4,_0x2402ce;var _0x13fd84={};var _0x2e301d;var _0x7d2c63=Number(_0x5dfb71[_0x200c('0xe')]);var _0x3c9243=_0x5dfb71[_0x200c('0xf')]?Boolean(Number(_0x5dfb71[_0x200c('0xf')])):![];var _0xb0125d;var _0x34a21c=![];if(!_[_0x200c('0x10')](_0x5dfb71[_0x200c('0x11')])){if(_0x5dfb71[_0x200c('0x11')]=='1')_0x34a21c=!![];}if(!_0x34a21c){if(_0x5e7c2c[_0x200c('0x12')]){_0x13fd84['id']=_0x5e7c2c[_0x200c('0x12')];}}if(!_0x13fd84['id']){_0x13fd84[_0x200c('0x13')]=_0x7d2c63;_0xb0125d=_0x5dfb71[_0x200c('0x14')]&&_0x5dfb71[_0x200c('0x14')]!=='0'?_0x5dfb71[_0x200c('0x14')][_0x200c('0x15')](','):[_0x200c('0x16')];_0x13fd84['$or']=_[_0x200c('0x17')](_0xb0125d,function(_0x5699d9){var _0x3d92e2={};_0x3d92e2[_0x5699d9]=_0x5e7c2c['routeId']?_0x5e7c2c[_0x200c('0x18')]:_0x5e7c2c[_0x200c('0x19')];return _0x3d92e2;});_0x2e301d=_0x5e7c2c[_0x200c('0x1a')]?_0x5e7c2c[_0x200c('0x18')]:_0x5e7c2c['calleridnum'];}var _0x721ad4=['id',_0x200c('0x1b'),'lastName',_0x200c('0x16'),_0x200c('0x1c'),_0x200c('0x1d'),_0x200c('0x13'),_0x200c('0x1e'),'scheduledAt',_0x200c('0x1f')];var _0x2a5883=_[_0x200c('0x20')](_0x721ad4,_0xb0125d);BPromise[_0x200c('0x21')]()[_0x200c('0x22')](cmContactRpc[_0x200c('0x23')]({'attributes':_0x2a5883,'where':_0x13fd84,'phone':_0x2e301d}))[_0x200c('0x22')](function(_0x44cc1c){_0x2402ce=_0x44cc1c;if(!_[_0x200c('0x24')](_0x2402ce)){if(_0x2402ce[_0x200c('0x25')]===0x1){_0x5baeb4=_0x2402ce[0x0];logger['info'](_0x200c('0x26'),_0x5e7c2c['uniqueid'],_0x77929c['id'],_0x5baeb4['id']);}else{logger[_0x200c('0x9')](_0x200c('0x27'),_0x5e7c2c[_0x200c('0x28')],_0x77929c['id'],_[_0x200c('0x17')](_0x2402ce,'id')[_0x200c('0x29')](','));}return;}else{logger['info'](_0x200c('0x2a'),_0x5e7c2c[_0x200c('0x28')],_0x77929c['id']);var _0x3776f6={'ListId':_0x7d2c63};var _0x38d676=_0x5dfb71[_0x200c('0x2b')]&&_0x5dfb71[_0x200c('0x2b')]!=='0'?_0x5dfb71['data4']:_0x200c('0x16');if(_0x3c9243){logger[_0x200c('0x9')](_0x200c('0x2c'),_0x5e7c2c[_0x200c('0x28')],_0x77929c['id']);_0x3776f6[_0x38d676]=_[_0x200c('0x10')](_0x5e7c2c[_0x200c('0x1a')])?_0x5e7c2c[_0x200c('0x19')]:_0x5e7c2c[_0x200c('0x18')];if(_[_0x200c('0x10')](_0x5e7c2c[_0x200c('0x1a')])){_0x3776f6[_0x200c('0x1b')]=_0x5e7c2c[_0x200c('0x2d')]&&_0x5e7c2c[_0x200c('0x2d')]!==''?_0x5e7c2c[_0x200c('0x2d')]:'Unknown';}else{_0x3776f6[_0x200c('0x1b')]=_0x5e7c2c[_0x200c('0x2e')]&&_0x5e7c2c[_0x200c('0x2e')]!==_0x200c('0x2f')?_0x5e7c2c[_0x200c('0x2e')]:_0x200c('0x30');}return BPromise[_0x200c('0x21')]()[_0x200c('0x22')](cmContactRpc['createContact'](_0x3776f6))['then'](function(_0x482efb){_0x5baeb4=_0x482efb;_0x2402ce[_0x200c('0x31')](_0x482efb);if(_0x5baeb4){logger[_0x200c('0x9')](_0x200c('0x32'),_0x5e7c2c[_0x200c('0x28')],_0x77929c['id'],_0x5baeb4['id']);}return;});}else{logger['info']('[CM][%s][%s]\x20Autocreate\x20disabled',_0x5e7c2c[_0x200c('0x28')],_0x77929c['id']);_0x3776f6[_0x38d676]=_[_0x200c('0x10')](_0x5e7c2c[_0x200c('0x1a')])?_0x5e7c2c['calleridnum']:_0x5e7c2c[_0x200c('0x18')];if(_[_0x200c('0x10')](_0x5e7c2c[_0x200c('0x1a')])){_0x3776f6['firstName']=_0x5e7c2c[_0x200c('0x2d')]&&_0x5e7c2c[_0x200c('0x2d')]!==''?_0x5e7c2c[_0x200c('0x2d')]:_0x200c('0x30');}else{_0x3776f6[_0x200c('0x1b')]=_0x5e7c2c[_0x200c('0x2e')]&&_0x5e7c2c['destcalleridname']!==_0x200c('0x2f')?_0x5e7c2c[_0x200c('0x2e')]:_0x200c('0x30');}_0x5baeb4=_0x3776f6;_0x2402ce[_0x200c('0x31')](_0x3776f6);return;}}})[_0x200c('0x22')](function(){if(_0x383d46){emit(_0x5e7c2c[_0x200c('0x28')],_0x77929c,util['format'](_0x200c('0x33'),_0x383d46[_0x200c('0x34')]),util['format'](_0x200c('0x35'),_0x5dfb71[_0x200c('0x36')][_0x200c('0x37')]()),{'evt':_[_0x200c('0x38')](_0x5e7c2c,{'autoCreate':_0x3c9243}),'contact':_0x5baeb4===undefined?{}:_0x5baeb4,'contacts':_0x2402ce[_0x200c('0x25')]===0x0?undefined:_0x2402ce});}});}; \ No newline at end of file +var _0xb91a=['map','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','Unknown','destcalleridname','resolve','push','format','user:%s','trigger:%s','action','toLowerCase','merge','bluebird','ioredis','util','../../../../config/environment','trigger','../../rpc/cmContact','defaults','socket.io-emitter','redis','info','exec','data1','data2','isNil','data5','xmd-contactid','data3','split','phone','$or','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','fax','ListId','scheduledAt','updatedAt','then','getContacts','length','[CM][%s][%s]\x20Contact\x20found:%s','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','uniqueid'];(function(_0x575ff4,_0x1a8fe6){var _0x4fbe65=function(_0x49e038){while(--_0x49e038){_0x575ff4['push'](_0x575ff4['shift']());}};_0x4fbe65(++_0x1a8fe6);}(_0xb91a,0xe5));var _0xab91=function(_0x426467,_0x27aefc){_0x426467=_0x426467-0x0;var _0x29c0ed=_0xb91a[_0x426467];return _0x29c0ed;};'use strict';var _=require('lodash');var BPromise=require(_0xab91('0x0'));var Redis=require(_0xab91('0x1'));var util=require(_0xab91('0x2'));var config=require(_0xab91('0x3'));var logger=require('../../../../config/logger')(_0xab91('0x4'));var cmContactRpc=require(_0xab91('0x5'));config['redis']=_[_0xab91('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xab91('0x7'))(new Redis(config[_0xab91('0x8')]));function emit(_0x56f24d,_0x2ebd86,_0x26e44b,_0x55a554,_0x1748f2){logger[_0xab91('0x9')]('[CM][%s][%s]',_0x56f24d,_0x2ebd86['id'],_0x26e44b,_0x55a554,JSON['stringify'](_0x1748f2));io['to'](_0x26e44b)['emit'](_0x55a554,_0x1748f2);}exports[_0xab91('0xa')]=function(_0x2273c9,_0x44d8b8,_0x8da5ed,_0x53f6b9){var _0x213e50,_0x28025c;var _0x5b8203={};var _0x3c3271;var _0x4e5ef7=Number(_0x8da5ed[_0xab91('0xb')]);var _0x56295c=_0x8da5ed['data2']?Boolean(Number(_0x8da5ed[_0xab91('0xc')])):![];var _0x4967bb;var _0x1dd6fa=![];if(!_[_0xab91('0xd')](_0x8da5ed[_0xab91('0xe')])){if(_0x8da5ed[_0xab91('0xe')]=='1')_0x1dd6fa=!![];}if(!_0x1dd6fa){if(_0x53f6b9[_0xab91('0xf')]){_0x5b8203['id']=_0x53f6b9[_0xab91('0xf')];}}if(!_0x5b8203['id']){_0x5b8203['ListId']=_0x4e5ef7;_0x4967bb=_0x8da5ed[_0xab91('0x10')]&&_0x8da5ed['data3']!=='0'?_0x8da5ed[_0xab91('0x10')][_0xab91('0x11')](','):[_0xab91('0x12')];_0x5b8203[_0xab91('0x13')]=_['map'](_0x4967bb,function(_0x434dcd){var _0xa63f1d={};_0xa63f1d[_0x434dcd]=_0x53f6b9[_0xab91('0x14')]?_0x53f6b9['destcalleridnum']:_0x53f6b9['calleridnum'];return _0xa63f1d;});_0x3c3271=_0x53f6b9[_0xab91('0x14')]?_0x53f6b9[_0xab91('0x15')]:_0x53f6b9[_0xab91('0x16')];}var _0x1f9fa9=['id',_0xab91('0x17'),_0xab91('0x18'),_0xab91('0x12'),_0xab91('0x19'),_0xab91('0x1a'),_0xab91('0x1b'),'createdAt',_0xab91('0x1c'),_0xab91('0x1d')];var _0x39eb11=_['union'](_0x1f9fa9,_0x4967bb);BPromise['resolve']()[_0xab91('0x1e')](cmContactRpc[_0xab91('0x1f')]({'attributes':_0x39eb11,'where':_0x5b8203,'phone':_0x3c3271}))[_0xab91('0x1e')](function(_0x5995de){_0x28025c=_0x5995de;if(!_['isEmpty'](_0x28025c)){if(_0x28025c[_0xab91('0x20')]===0x1){_0x213e50=_0x28025c[0x0];logger['info'](_0xab91('0x21'),_0x53f6b9['uniqueid'],_0x44d8b8['id'],_0x213e50['id']);}else{logger['info'](_0xab91('0x22'),_0x53f6b9[_0xab91('0x23')],_0x44d8b8['id'],_[_0xab91('0x24')](_0x28025c,'id')[_0xab91('0x25')](','));}return;}else{logger[_0xab91('0x9')](_0xab91('0x26'),_0x53f6b9[_0xab91('0x23')],_0x44d8b8['id']);var _0x17a1f3={'ListId':_0x4e5ef7};var _0x4cf706=_0x8da5ed[_0xab91('0x27')]&&_0x8da5ed[_0xab91('0x27')]!=='0'?_0x8da5ed[_0xab91('0x27')]:_0xab91('0x12');if(_0x56295c){logger['info'](_0xab91('0x28'),_0x53f6b9[_0xab91('0x23')],_0x44d8b8['id']);_0x17a1f3[_0x4cf706]=_['isNil'](_0x53f6b9['routeId'])?_0x53f6b9[_0xab91('0x16')]:_0x53f6b9[_0xab91('0x15')];if(_[_0xab91('0xd')](_0x53f6b9[_0xab91('0x14')])){_0x17a1f3[_0xab91('0x17')]=_0x53f6b9[_0xab91('0x29')]&&_0x53f6b9[_0xab91('0x29')]!==_0xab91('0x2a')?_0x53f6b9[_0xab91('0x29')]:_0xab91('0x2b');}else{_0x17a1f3[_0xab91('0x17')]=_0x53f6b9['destcalleridname']&&_0x53f6b9[_0xab91('0x2c')]!==_0xab91('0x2a')?_0x53f6b9['destcalleridname']:_0xab91('0x2b');}return BPromise[_0xab91('0x2d')]()[_0xab91('0x1e')](cmContactRpc['createContact'](_0x17a1f3))[_0xab91('0x1e')](function(_0x4f6818){_0x213e50=_0x4f6818;_0x28025c[_0xab91('0x2e')](_0x4f6818);if(_0x213e50){logger[_0xab91('0x9')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x53f6b9[_0xab91('0x23')],_0x44d8b8['id'],_0x213e50['id']);}return;});}else{logger[_0xab91('0x9')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x53f6b9[_0xab91('0x23')],_0x44d8b8['id']);_0x17a1f3[_0x4cf706]=_[_0xab91('0xd')](_0x53f6b9[_0xab91('0x14')])?_0x53f6b9['calleridnum']:_0x53f6b9[_0xab91('0x15')];if(_[_0xab91('0xd')](_0x53f6b9['routeId'])){_0x17a1f3[_0xab91('0x17')]=_0x53f6b9[_0xab91('0x29')]&&_0x53f6b9[_0xab91('0x29')]!==''?_0x53f6b9['calleridname']:_0xab91('0x2b');}else{_0x17a1f3['firstName']=_0x53f6b9['destcalleridname']&&_0x53f6b9[_0xab91('0x2c')]!==_0xab91('0x2a')?_0x53f6b9['destcalleridname']:_0xab91('0x2b');}_0x213e50=_0x17a1f3;_0x28025c[_0xab91('0x2e')](_0x17a1f3);return;}}})[_0xab91('0x1e')](function(){if(_0x2273c9){emit(_0x53f6b9[_0xab91('0x23')],_0x44d8b8,util[_0xab91('0x2f')](_0xab91('0x30'),_0x2273c9['name']),util[_0xab91('0x2f')](_0xab91('0x31'),_0x8da5ed[_0xab91('0x32')][_0xab91('0x33')]()),{'evt':_[_0xab91('0x34')](_0x53f6b9,{'autoCreate':_0x56295c}),'contact':_0x213e50===undefined?{}:_0x213e50,'contacts':_0x28025c[_0xab91('0x20')]===0x0?undefined:_0x28025c});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 6706470..d94e533 100644 --- a/server/services/ami/trigger/index.js +++ b/server/services/ami/trigger/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc04a=['evt','field','chat','ChatWebsiteId','value','upperFirst','AccountId','operator','interaction','message','event','lastevent','null','substatus','created','equals','util','mustache','./urlforward','./integration','./cmContact','./script','../../../config/logger','trigger','../ami','redis','localhost','socket.io-emitter','url','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','zohoAccounts','custom:agentcalled','bind','custom:agentconnect','custom:agentringnoanswer','syncCustomEvent','custom:agentcomplete','custom:agentnosuchnumber','custom:agentcongestion','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','stringify','clone','motionChannel','voice','checkTriggers','hasOwnProperty','checkTrigger','merge','Actions','length','action','toLowerCase','contactmanager','motionbar','browser','popup','TemplateId','data2','render','html','uri','buildUri','isNil','data3','data4','location','windowWidth','data5','800','windowHeight','data6','600','winApplication','interface','name','format','trigger:%s:%s','data1','jscripty','user:%s','trigger:%s','exec','integration','accounts','queue','routeId','urlforward','script','parse','query','replace','channel','every','AllConditions','checkConditions','AnyConditions','debug','checkTrigger:\x20trigger','inspect'];(function(_0x47a802,_0x424bf1){var _0xb3badc=function(_0x5f44d3){while(--_0x5f44d3){_0x47a802['push'](_0x47a802['shift']());}};_0xb3badc(++_0x424bf1);}(_0xc04a,0x184));var _0xac04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc04a[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xac04('0x0'));var _=require('lodash');var url=require('url');var Mustache=require(_0xac04('0x1'));var Redis=require('ioredis');var urlforward=require(_0xac04('0x2'));var integration=require(_0xac04('0x3'));var cmContact=require(_0xac04('0x4'));var script=require(_0xac04('0x5'));var config=require('../../../config/environment');var logger=require(_0xac04('0x6'))(_0xac04('0x7'));var ami=require(_0xac04('0x8'));config[_0xac04('0x9')]=_['defaults'](config[_0xac04('0x9')],{'host':_0xac04('0xa'),'port':0x18eb});var io=require(_0xac04('0xb'))(new Redis(config[_0xac04('0x9')]));var operators={'equals':function(_0x5b98a4,_0x451b2b){return _0x5b98a4==_0x451b2b;},'not_equals':function(_0xf1d00f,_0x5d012b){return _0xf1d00f!=_0x5d012b;}};var barAndWebActions=['popup',_0xac04('0xc'),_0xac04('0xd')];function Trigger(_0x4da3b6){this[_0xac04('0xe')]=_0x4da3b6[_0xac04('0xe')];this[_0xac04('0xf')]=_0x4da3b6[_0xac04('0xf')];this[_0xac04('0x10')]=_0x4da3b6[_0xac04('0x10')];this[_0xac04('0x11')]=_0x4da3b6[_0xac04('0x11')];this[_0xac04('0x12')]=_0x4da3b6[_0xac04('0x12')];this['zendeskAccounts']=_0x4da3b6[_0xac04('0x13')];this['freshdeskAccounts']=_0x4da3b6[_0xac04('0x14')];this[_0xac04('0x15')]=_0x4da3b6['salesforceAccounts'];this[_0xac04('0x16')]=_0x4da3b6[_0xac04('0x16')];this['zohoAccounts']=_0x4da3b6['zohoAccounts'];this[_0xac04('0x17')]=_0x4da3b6[_0xac04('0x17')];this[_0xac04('0x18')]=_0x4da3b6[_0xac04('0x18')];this[_0xac04('0x19')]=_0x4da3b6['servicenowAccounts'];this[_0xac04('0x1a')]=_0x4da3b6['dynamics365Accounts'];this[_0xac04('0x1b')]=_0x4da3b6[_0xac04('0x1b')];this['accounts']={'zendesk':this[_0xac04('0x13')],'salesforce':this[_0xac04('0x15')],'freshdesk':this[_0xac04('0x14')],'sugarcrm':this[_0xac04('0x16')],'zoho':this[_0xac04('0x1c')],'desk':this[_0xac04('0x17')],'vtiger':this[_0xac04('0x18')],'dynamics365':this[_0xac04('0x1a')],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0xac04('0x19')]};ami['on'](_0xac04('0x1d'),this['syncCustomEvent'][_0xac04('0x1e')](this));ami['on'](_0xac04('0x1f'),this['syncCustomEvent']['bind'](this));ami['on'](_0xac04('0x20'),this[_0xac04('0x21')][_0xac04('0x1e')](this));ami['on'](_0xac04('0x22'),this[_0xac04('0x21')][_0xac04('0x1e')](this));ami['on'](_0xac04('0x23'),this[_0xac04('0x21')]['bind'](this));ami['on']('custom:agentnoanswer',this[_0xac04('0x21')][_0xac04('0x1e')](this));ami['on']('custom:agentbusy',this['syncCustomEvent']['bind'](this));ami['on'](_0xac04('0x24'),this[_0xac04('0x21')][_0xac04('0x1e')](this));ami['on']('custom:agentreject',this[_0xac04('0x21')][_0xac04('0x1e')](this));ami['on']('custom:amd',this[_0xac04('0x21')][_0xac04('0x1e')](this));ami['on']('custom:queuecallerabandon',this[_0xac04('0x21')]['bind'](this));ami['on'](_0xac04('0x25'),this[_0xac04('0x21')][_0xac04('0x1e')](this));ami['on'](_0xac04('0x26'),this[_0xac04('0x27')][_0xac04('0x1e')](this));ami['on'](_0xac04('0x28'),this['syncAgentDial'][_0xac04('0x1e')](this));ami['on']('custom:dialend',this[_0xac04('0x27')][_0xac04('0x1e')](this));ami['on']('custom:newinteraction',this[_0xac04('0x21')][_0xac04('0x1e')](this));ami['on'](_0xac04('0x29'),this['syncCustomEvent'][_0xac04('0x1e')](this));ami['on']('custom:substatus',this[_0xac04('0x21')][_0xac04('0x1e')](this));ami['on'](_0xac04('0x2a'),this[_0xac04('0x21')][_0xac04('0x1e')](this));ami['on'](_0xac04('0x2b'),this[_0xac04('0x21')]['bind'](this));ami['on'](_0xac04('0x2c'),this[_0xac04('0x21')][_0xac04('0x1e')](this));ami['on'](_0xac04('0x2d'),this[_0xac04('0x21')]['bind'](this));ami['on'](_0xac04('0x2e'),this[_0xac04('0x21')][_0xac04('0x1e')](this));}Trigger[_0xac04('0x2f')][_0xac04('0x30')]=function(_0xba9760,_0x24d0be,_0x1c631c){logger['info'](_0xba9760,_0x24d0be,JSON[_0xac04('0x31')](_0x1c631c));io['to'](_0xba9760)['emit'](_0x24d0be,_0x1c631c);};Trigger[_0xac04('0x2f')][_0xac04('0x21')]=function(_0x5670a6){var _0x3304cd=_[_0xac04('0x32')](_0x5670a6);if(typeof _0x3304cd[_0xac04('0x33')]==='undefined'){_0x3304cd[_0xac04('0x33')]=_0xac04('0x34');}logger['debug'](_0xac04('0x21'),util['inspect'](_0x3304cd,{'showHidden':!![],'depth':null}));this[_0xac04('0x35')](_0x3304cd);};Trigger[_0xac04('0x2f')][_0xac04('0x27')]=function(_0x1c8708){if(this[_0xac04('0xf')][_0x1c8708['interface']]){this[_0xac04('0x21')](_0x1c8708);}};Trigger[_0xac04('0x2f')]['checkTriggers']=function(_0x5dea2f){var _0x1a8f51;for(var _0x156ad3 in this[_0xac04('0xe')]){if(this[_0xac04('0xe')][_0xac04('0x36')](_0x156ad3)){if(this[_0xac04('0xe')][_0x156ad3]['status']){_0x1a8f51=this[_0xac04('0x37')](this['triggers'][_0x156ad3],_0x5dea2f);if(_0x1a8f51){_[_0xac04('0x38')](_0x5dea2f,_0x5dea2f['variables']);for(var _0x378280=0x0,_0x133544,_0x61485b,_0x38fbf5;_0x3782800x0){_0x59bf34=_[_0xbe14('0x2b')](_0x16f884,_0x29fc64);}return _0x59bf34;}function getCustomFields(_0x1c7cc7,_0x19252f){var _0x34d648=[];var _0x36d4b2={'custom_fields':{}};if(_0x1c7cc7[_0xbe14('0x2a')]>0x0){_[_0xbe14('0x2c')](_0x1c7cc7,function(_0x4168c8){if(_[_0xbe14('0x2d')]([_0xbe14('0x2e'),_0xbe14('0x2f')],_0x4168c8[_0xbe14('0x30')])&&_0x4168c8[_0xbe14('0x31')]&&!_0x4168c8[_0xbe14('0x32')]){_0x36d4b2[_0x4168c8[_0xbe14('0x31')][_0xbe14('0x33')]()]=_0x4168c8[_0xbe14('0x34')][_0xbe14('0x35')]();}else if(_[_0xbe14('0x2d')](['string',_0xbe14('0x2f')],_0x4168c8['type'])&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x36d4b2['custom_fields'][_0x4168c8[_0xbe14('0x36')]]=_0x4168c8[_0xbe14('0x34')]['toString']();}else if(_0x4168c8['type']==='variable'&&_0x4168c8[_0xbe14('0x37')]&&_0x4168c8[_0xbe14('0x36')]&&_0x4168c8['customField']){_0x19252f[_0x4168c8[_0xbe14('0x37')]]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x37')]][_0xbe14('0x35')]());}else if(_0x4168c8['type']==='customVariable'&&_0x4168c8[_0xbe14('0x39')]&&_0x4168c8['Variable']['name']&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()][_0xbe14('0x35')]());}});}if(_0x36d4b2[_0xbe14('0x3b')]){_0x36d4b2[_0xbe14('0x3b')]=Number(_0x36d4b2['priority']);}return _0x36d4b2;}function getTicket(_0x4f51f8,_0x43cdaa,_0x2951e1,_0x13bfcf,_0x520e09){logger[_0xbe14('0x12')](_0xbe14('0x3c'));var _0xeda70e=_[_0xbe14('0x3d')]({'subject':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x3f')],_0x520e09,'\x20'),'type':_0xbe14('0x40'),'status':_0xbe14('0x41'),'labels':[_0xbe14('0x42'),'Motion',_0xbe14('0x43')][_0xbe14('0x44')](getTags(_0x13bfcf[_0xbe14('0x45')],_0xbe14('0x3a'))),'description':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0xbe14('0x47'),_0x43cdaa['id']),'class':_0xbe14('0x48')}},'message':{'direction':'in','body':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a')}},getCustomFields(_0x13bfcf['Fields'],_0x520e09));return request({'uri':util['format'](_0xbe14('0x49'),_0x4f51f8[_0xbe14('0x28')],_0x2951e1['id']),'method':_0xbe14('0x29'),'body':_0xeda70e});}exports['queue']=function(_0x5d5318,_0x6b6aa8,_0x59ae4d,_0x5657fe,_0x3593f8,_0x1f0355){var _0x8216c3,_0x5051e4;_0x1f0355['remoteUri']=intUtil['stripTrailingSlash'](_0x1f0355[_0xbe14('0x28')]);_0x1f0355[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x1f0355['serverUrl']);if(_0x3593f8&&_0x3593f8[_0xbe14('0x4c')]){logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x4e'));_0x6b6aa8['recordingURL']=util['format'](_0xbe14('0x4f'),_0x1f0355[_0xbe14('0x4a')],_0x6b6aa8[_0xbe14('0x50')],md5(_0x6b6aa8[_0xbe14('0x50')]));}else{_0x6b6aa8[_0xbe14('0x51')]='';}headers['Authorization']=getAuth(_0x1f0355);return getUser(_0x1f0355,_0x5657fe['email'])[_0xbe14('0xd')](function(_0x2a3623){_0x8216c3=_0x2a3623;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x8216c3['id']);return getEndUser(_0x1f0355,_0x6b6aa8['calleridname'],_0x6b6aa8[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x53e8ab){_0x5051e4=_0x53e8ab;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x5051e4['id']);return getTicket(_0x1f0355,_0x8216c3,_0x5051e4,_0x59ae4d,_0x6b6aa8);})[_0xbe14('0xd')](function(_0x36c20c){if(_0x36c20c){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x36c20c['id']);switch(_0x1f0355['type']){case'integrationTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x36c20c['id']});break;case'newTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe['name']),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')](_0xbe14('0x5b'),_0x36c20c['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x4d'),_0xbe14('0x5d'));}}})['catch'](function(_0x5aeea9){console[_0xbe14('0x5c')](_0x5aeea9);logger[_0xbe14('0x5c')](_0xbe14('0x4d'),JSON['stringify'](_0x5aeea9));});};exports['outbound']=function(_0x44fe0d,_0x134878,_0x50d78f,_0x339a86,_0x32496a,_0x50c2a0,_0x28f995){var _0x4a40d2,_0x41ba58;_0x50c2a0[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['remoteUri']);_0x50c2a0[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['serverUrl']);if(_0x28f995&&_0x28f995[_0xbe14('0x5e')]&&_0x28f995[_0xbe14('0x5e')]!==_0xbe14('0x5f')){logger[_0xbe14('0x12')](_0xbe14('0x60'),'Recording\x20is\x20enabled!');_0x134878[_0xbe14('0x51')]=util[_0xbe14('0xb')](_0xbe14('0x4f'),_0x50c2a0[_0xbe14('0x4a')],_0x134878[_0xbe14('0x50')],md5(_0x134878[_0xbe14('0x50')]));}headers[_0xbe14('0x61')]=getAuth(_0x50c2a0);return getUser(_0x50c2a0,_0x339a86['email'])[_0xbe14('0xd')](function(_0x1b47a4){_0x4a40d2=_0x1b47a4;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x4a40d2['id']);return getEndUser(_0x50c2a0,_0x134878[_0xbe14('0x62')],_0x134878[_0xbe14('0x63')]);})[_0xbe14('0xd')](function(_0x32df3c){_0x41ba58=_0x32df3c;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x41ba58['id']);return getTicket(_0x50c2a0,_0x4a40d2,_0x41ba58,_0x50d78f,_0x134878);})[_0xbe14('0xd')](function(_0x4bccfc){if(_0x4bccfc){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x4bccfc['id']);switch(_0x50c2a0[_0xbe14('0x30')]){case _0xbe14('0x64'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x4bccfc['id']});break;case _0xbe14('0x65'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')]('%s/agent/tickets/%s',_0x50c2a0[_0xbe14('0x28')],_0x4bccfc['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x60'),_0xbe14('0x5d'));}}})[_0xbe14('0x66')](function(_0x222944){logger[_0xbe14('0x5c')](_0xbe14('0x60'),JSON[_0xbe14('0x19')](_0x222944));});};exports[_0xbe14('0x67')]=function(_0x5917d5,_0x18be56,_0x442ec4,_0x2d4dd4,_0xfd32a3,_0x3ac6d8){var _0x5a1ea6,_0x42b341;_0x3ac6d8[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x3ac6d8[_0xbe14('0x28')]);_0x3ac6d8[_0xbe14('0x4a')]=intUtil['stripTrailingSlash'](_0x3ac6d8[_0xbe14('0x4a')]);if(_0xfd32a3&&_0xfd32a3[_0xbe14('0x4c')]){logger[_0xbe14('0x12')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',_0xbe14('0x4e'));_0x18be56[_0xbe14('0x51')]=util[_0xbe14('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ac6d8[_0xbe14('0x4a')],_0x18be56[_0xbe14('0x50')],md5(_0x18be56[_0xbe14('0x50')]));}else{_0x18be56[_0xbe14('0x51')]='';}headers[_0xbe14('0x61')]=getAuth(_0x3ac6d8);return getUser(_0x3ac6d8)[_0xbe14('0xd')](function(_0x445302){_0x5a1ea6=_0x445302;logger['info']('The\x20User\x20ID\x20is:',_0x5a1ea6['id']);return getEndUser(_0x3ac6d8,_0x18be56[_0xbe14('0x6a')],_0x18be56[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x2510a0){_0x42b341=_0x2510a0;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x42b341['id']);return getTicket(_0x3ac6d8,_0x5a1ea6,_0x42b341,_0x442ec4,_0x18be56);})[_0xbe14('0xd')](function(_0x43511e){if(_0x43511e){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x43511e['id']);}})[_0xbe14('0x66')](function(_0x57729f){logger[_0xbe14('0x5c')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',JSON[_0xbe14('0x19')](_0x57729f));});}; \ No newline at end of file +var _0x5fc3=['map','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','type','custom_fields','variable','variableName','idField','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','phone','new','xCALLY','Motion','CTI','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','recordingURL','The\x20User\x20ID\x20is:','destcalleridnum','Ticket\x20created!','[OUTBOUND]','unmanaged','lastevent','Recording\x20is\x20enabled!','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','emit','application/json','info','Getting\x20agent\x20with\x20email','%s/users','remoteUri','total_entries','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','format','%s/users/me','debug','stringify','authType','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','length'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x5fc3,0xa8));var _0x35fc=function(_0xb1174e,_0x1e68a7){_0xb1174e=_0xb1174e-0x0;var _0x285bac=_0x5fc3[_0xb1174e];return _0x285bac;};'use strict';var _=require(_0x35fc('0x0'));var rp=require(_0x35fc('0x1'));var md5=require('md5');var util=require(_0x35fc('0x2'));var Redis=require(_0x35fc('0x3'));var intUtil=require(_0x35fc('0x4'));var config=require(_0x35fc('0x5'));var logger=require(_0x35fc('0x6'))('desk');config[_0x35fc('0x7')]=_[_0x35fc('0x8')](config[_0x35fc('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x35fc('0x7')]));function emit(_0x508b32,_0x16e153,_0x27524f){io['to'](_0x508b32)[_0x35fc('0x9')](_0x16e153,_0x27524f);}var headers={'Content-Type':_0x35fc('0xa'),'Accept':_0x35fc('0xa')};function getUser(_0xf9d3a6,_0x2051ab){if(intUtil['validateEmail'](_0x2051ab)===!![]){logger[_0x35fc('0xb')](_0x35fc('0xc'),_0x2051ab);return request({'uri':util['format'](_0x35fc('0xd'),_0xf9d3a6[_0x35fc('0xe')])})['then'](function(_0xda83fb){if(_0xda83fb[_0x35fc('0xf')]){return _['find'](_0xda83fb['_embedded'][_0x35fc('0x10')],{'email':_0x2051ab});}})['then'](function(_0x397738){if(_0x397738){logger[_0x35fc('0xb')](_0x35fc('0x11'));return _0x397738;}else{logger[_0x35fc('0xb')](_0x35fc('0x12'));return request({'uri':util['format']('%s/users/me',_0xf9d3a6['remoteUri'])});}});}else{logger['info'](_0x35fc('0x13'));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x15'),_0xf9d3a6[_0x35fc('0xe')])});}}function request(_0x227a49){logger[_0x35fc('0x16')]('[HTTP]',JSON[_0x35fc('0x17')](_0x227a49));return rp(_[_0x35fc('0x8')](_0x227a49,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x41e165){var _0x363e47;if(_0x41e165[_0x35fc('0x18')]==='basic'){_0x363e47=util[_0x35fc('0x14')](_0x35fc('0x19'),_0x41e165[_0x35fc('0x1a')],_0x41e165['password']);}else if(_0x41e165[_0x35fc('0x18')]===_0x35fc('0x1b')){_0x363e47=util[_0x35fc('0x14')](_0x35fc('0x1c'),_0x41e165[_0x35fc('0x1a')],_0x41e165[_0x35fc('0x1b')]);}return util[_0x35fc('0x14')](_0x35fc('0x1d'),new Buffer(_0x363e47)[_0x35fc('0x1e')](_0x35fc('0x1f')));}function getEndUser(_0x5bd2b8,_0x323aee,_0xd5399f){logger[_0x35fc('0xb')](_0x35fc('0x20'),_0xd5399f);return request({'uri':util[_0x35fc('0x14')]('%s/customers/search',_0x5bd2b8[_0x35fc('0xe')]),'qs':{'phone':_0xd5399f}})[_0x35fc('0x21')](function(_0x561bf8){if(_0x561bf8[_0x35fc('0xf')]){logger[_0x35fc('0xb')](_0x35fc('0x22'));return _0x561bf8['_embedded'][_0x35fc('0x10')][0x0];}else{logger['info'](_0x35fc('0x23'));return request({'uri':util[_0x35fc('0x14')]('%s/customers',_0x5bd2b8['remoteUri']),'method':_0x35fc('0x24'),'body':{'first_name':_0x323aee,'title':_0x323aee,'phone_numbers':[{'type':'work','value':_0xd5399f}]}});}});}function getTags(_0x274208,_0x1a5d92){var _0x57001c=[];if(_0x274208&&_0x274208[_0x35fc('0x25')]>0x0){_0x57001c=_[_0x35fc('0x26')](_0x274208,_0x1a5d92);}return _0x57001c;}function getCustomFields(_0x383837,_0x9f3c8a){var _0x3735da=[];var _0x134dfa={'custom_fields':{}};if(_0x383837[_0x35fc('0x25')]>0x0){_[_0x35fc('0x27')](_0x383837,function(_0x54aedc){if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc['type'])&&_0x54aedc[_0x35fc('0x2b')]&&!_0x54aedc[_0x35fc('0x2c')]){_0x134dfa[_0x54aedc[_0x35fc('0x2b')][_0x35fc('0x2d')]()]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc[_0x35fc('0x2f')])&&_0x54aedc['idField']&&_0x54aedc['customField']){_0x134dfa[_0x35fc('0x30')][_0x54aedc['idField']]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_0x54aedc[_0x35fc('0x2f')]===_0x35fc('0x31')&&_0x54aedc[_0x35fc('0x32')]&&_0x54aedc[_0x35fc('0x33')]&&_0x54aedc['customField']){_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]][_0x35fc('0x1e')]());}else if(_0x54aedc[_0x35fc('0x2f')]==='customVariable'&&_0x54aedc[_0x35fc('0x34')]&&_0x54aedc[_0x35fc('0x34')][_0x35fc('0x35')]&&_0x54aedc['idField']&&_0x54aedc[_0x35fc('0x2c')]){_0x9f3c8a[_0x54aedc['Variable'][_0x35fc('0x35')][_0x35fc('0x2d')]()]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc['Variable']['name']['toLowerCase']()][_0x35fc('0x1e')]());}});}if(_0x134dfa['priority']){_0x134dfa[_0x35fc('0x36')]=Number(_0x134dfa['priority']);}return _0x134dfa;}function getTicket(_0x9c6b65,_0x1f2d66,_0x2ca9ac,_0x22b724,_0x1c10e0){logger[_0x35fc('0xb')](_0x35fc('0x37'));var _0x4ec0dc=_[_0x35fc('0x38')]({'subject':intUtil[_0x35fc('0x39')](_0x22b724['Subjects'],_0x1c10e0,'\x20'),'type':_0x35fc('0x3a'),'status':_0x35fc('0x3b'),'labels':[_0x35fc('0x3c'),_0x35fc('0x3d'),_0x35fc('0x3e')][_0x35fc('0x3f')](getTags(_0x22b724['Tags'],_0x35fc('0x35'))),'description':intUtil[_0x35fc('0x39')](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0x35fc('0x41'),_0x1f2d66['id']),'class':_0x35fc('0x42')}},'message':{'direction':'in','body':intUtil['getString'](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a')}},getCustomFields(_0x22b724[_0x35fc('0x43')],_0x1c10e0));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x44'),_0x9c6b65[_0x35fc('0xe')],_0x2ca9ac['id']),'method':_0x35fc('0x24'),'body':_0x4ec0dc});}exports[_0x35fc('0x45')]=function(_0x3ec51f,_0x5a7e9e,_0x596e83,_0x210d5d,_0x36fcf9,_0x4fdc6d){var _0x5c2e5c,_0x4ff202;_0x4fdc6d[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x4fdc6d['remoteUri']);_0x4fdc6d[_0x35fc('0x47')]=intUtil[_0x35fc('0x46')](_0x4fdc6d[_0x35fc('0x47')]);if(_0x36fcf9&&_0x36fcf9[_0x35fc('0x48')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x5a7e9e['recordingURL']=util['format'](_0x35fc('0x49'),_0x4fdc6d[_0x35fc('0x47')],_0x5a7e9e['uniqueid'],md5(_0x5a7e9e[_0x35fc('0x4a')]));}else{_0x5a7e9e['recordingURL']='';}headers[_0x35fc('0x4b')]=getAuth(_0x4fdc6d);return getUser(_0x4fdc6d,_0x210d5d[_0x35fc('0x4c')])[_0x35fc('0x21')](function(_0x2de5d1){_0x5c2e5c=_0x2de5d1;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x5c2e5c['id']);return getEndUser(_0x4fdc6d,_0x5a7e9e[_0x35fc('0x4d')],_0x5a7e9e[_0x35fc('0x4e')]);})['then'](function(_0x18181b){_0x4ff202=_0x18181b;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x4ff202['id']);return getTicket(_0x4fdc6d,_0x5c2e5c,_0x4ff202,_0x596e83,_0x5a7e9e);})[_0x35fc('0x21')](function(_0x5bc8c3){if(_0x5bc8c3){logger[_0x35fc('0xb')]('Ticket\x20created!');logger['info'](_0x35fc('0x50'),_0x5bc8c3['id']);switch(_0x4fdc6d[_0x35fc('0x2f')]){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x53'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d['name']),_0x35fc('0x55'),{'recordId':_0x5bc8c3['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d[_0x35fc('0x35')]),_0x35fc('0x58'),{'uri':util[_0x35fc('0x14')](_0x35fc('0x59'),_0x5bc8c3['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x52'),_0x35fc('0x5b'));}}})['catch'](function(_0x553ed6){console[_0x35fc('0x5a')](_0x553ed6);logger[_0x35fc('0x5a')](_0x35fc('0x52'),JSON[_0x35fc('0x17')](_0x553ed6));});};exports[_0x35fc('0x5c')]=function(_0x3e6494,_0x4a4798,_0x4f024c,_0x388521,_0x19b2ce,_0x395d63,_0x38bc78){var _0x5b2595,_0x467980;_0x395d63[_0x35fc('0xe')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0xe')]);_0x395d63[_0x35fc('0x47')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0x47')]);if(_0x38bc78&&_0x38bc78[_0x35fc('0x5d')]&&_0x38bc78[_0x35fc('0x5d')]!==_0x35fc('0x5e')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4a4798[_0x35fc('0x5f')]=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x395d63[_0x35fc('0x47')],_0x4a4798[_0x35fc('0x4a')],md5(_0x4a4798[_0x35fc('0x4a')]));}headers[_0x35fc('0x4b')]=getAuth(_0x395d63);return getUser(_0x395d63,_0x388521[_0x35fc('0x4c')])['then'](function(_0x2d9d45){_0x5b2595=_0x2d9d45;logger[_0x35fc('0xb')](_0x35fc('0x60'),_0x5b2595['id']);return getEndUser(_0x395d63,_0x4a4798['destcalleridname'],_0x4a4798[_0x35fc('0x61')]);})[_0x35fc('0x21')](function(_0x47fb1a){_0x467980=_0x47fb1a;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x467980['id']);return getTicket(_0x395d63,_0x5b2595,_0x467980,_0x4f024c,_0x4a4798);})[_0x35fc('0x21')](function(_0x1c4c33){if(_0x1c4c33){logger[_0x35fc('0xb')](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x1c4c33['id']);switch(_0x395d63['type']){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:desk:display',{'recordId':_0x1c4c33['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:browser:url',{'uri':util['format']('%s/agent/tickets/%s',_0x395d63[_0x35fc('0xe')],_0x1c4c33['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x63'),_0x35fc('0x5b'));}}})['catch'](function(_0x458eb8){logger[_0x35fc('0x5a')](_0x35fc('0x63'),JSON[_0x35fc('0x17')](_0x458eb8));});};exports[_0x35fc('0x64')]=function(_0x1d0e53,_0x27071b,_0x2127e0,_0x462ceb,_0x4c3ace,_0x35d7c8){var _0x47c75f,_0xfbd737;_0x35d7c8[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x35d7c8[_0x35fc('0xe')]);_0x35d7c8['serverUrl']=intUtil[_0x35fc('0x46')](_0x35d7c8['serverUrl']);if(_0x4c3ace&&_0x4c3ace['monitor_format']){logger['info']('['+_0x27071b[_0x35fc('0x65')]['toUpperCase']()+']',_0x35fc('0x66'));_0x27071b['recordingURL']=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x35d7c8[_0x35fc('0x47')],_0x27071b[_0x35fc('0x4a')],md5(_0x27071b[_0x35fc('0x4a')]));}else{_0x27071b[_0x35fc('0x5f')]='';}headers['Authorization']=getAuth(_0x35d7c8);return getUser(_0x35d7c8)[_0x35fc('0x21')](function(_0x1e2214){_0x47c75f=_0x1e2214;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x47c75f['id']);return getEndUser(_0x35d7c8,_0x27071b[_0x35fc('0x4d')],_0x27071b[_0x35fc('0x4e')]);})[_0x35fc('0x21')](function(_0x3c1b56){_0xfbd737=_0x3c1b56;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0xfbd737['id']);return getTicket(_0x35d7c8,_0x47c75f,_0xfbd737,_0x2127e0,_0x27071b);})[_0x35fc('0x21')](function(_0x4464d5){if(_0x4464d5){logger['info'](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x4464d5['id']);}})['catch'](function(_0x1c88d8){logger[_0x35fc('0x5a')]('['+_0x27071b['lastevent']['toUpperCase']()+']',JSON[_0x35fc('0x17')](_0x1c88d8));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 350980d..c29ef45 100644 --- a/server/services/ami/trigger/integration/dynamics365.js +++ b/server/services/ami/trigger/integration/dynamics365.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd3cc=['unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','ticketId',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','./util','md5','ioredis','../../../../config/logger','../../../../config/environment','redis','localhost','socket.io-emitter','remoteUri','CloudProvider','tenantId','data2','data5','POST','clientId','username','password','then','access_token','catch','error',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','validateEmail','email','userEmail','length','info',']\x20Agent\x20found\x20','systemuserid','userId','toUpperCase','toLowerCase','destcalleridnum','calleridnum','contacts','body','headers','odata-entityid','substring','lastIndexOf','outbound','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','%2b','enduserId','contactid','nothing','forEach','includes','string','type','nameField','customField','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','/systemusers(','Fields','phonecall','queue','callDirection','phonecalls','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','trigger:browser:url','modernAuthentication','data7','stripTrailingSlash','serverUrl'];(function(_0x40fd7a,_0x1e8293){var _0x20e00c=function(_0x473a81){while(--_0x473a81){_0x40fd7a['push'](_0x40fd7a['shift']());}};_0x20e00c(++_0x1e8293);}(_0xd3cc,0x163));var _0xcd3c=function(_0x52788c,_0x235d0a){_0x52788c=_0x52788c-0x0;var _0x203c56=_0xd3cc[_0x52788c];return _0x203c56;};'use strict';var _=require(_0xcd3c('0x0'));var rp=require(_0xcd3c('0x1'));var util=require('util');var intUtil=require(_0xcd3c('0x2'));var md5=require(_0xcd3c('0x3'));var Redis=require(_0xcd3c('0x4'));var logger=require(_0xcd3c('0x5'))('dynamics365');var config=require(_0xcd3c('0x6'));config[_0xcd3c('0x7')]=_['defaults'](config[_0xcd3c('0x7')],{'host':_0xcd3c('0x8'),'port':0x18eb});var io=require(_0xcd3c('0x9'))(new Redis(config[_0xcd3c('0x7')]));function getAuthToken(_0x391d7f,_0x523d3a,_0x4abdad){if(_0x391d7f['modernAuthentication']){_0x391d7f[_0xcd3c('0xa')]=_0x391d7f[_0xcd3c('0xb')]['data7'];_0x391d7f[_0xcd3c('0xc')]=_0x391d7f['CloudProvider'][_0xcd3c('0xd')];return Promise['resolve'](_0x391d7f['CloudProvider'][_0xcd3c('0xe')]);}var _0x17ffde={'method':_0xcd3c('0xf'),'uri':_0x523d3a,'form':{'client_id':_0x391d7f[_0xcd3c('0x10')],'resource':_0x391d7f[_0xcd3c('0xa')],'username':_0x391d7f[_0xcd3c('0x11')],'password':_0x391d7f[_0xcd3c('0x12')],'grant_type':_0xcd3c('0x12'),'client_secret':_0x391d7f['clientSecret']},'json':!![]};return rp(_0x17ffde)[_0xcd3c('0x13')](function(_0x23bc5f){return _0x23bc5f[_0xcd3c('0x14')];})[_0xcd3c('0x15')](function(_0x59494a){logger[_0xcd3c('0x16')]('['+[_0x4abdad['toUpperCase']()]+_0xcd3c('0x17'));return _0x59494a[_0xcd3c('0x18')];});}function getUser(_0x2b38a6,_0xa41c0d,_0x412fae,_0x5079d3,_0x10eaf9,_0x12db7c){return new Promise(function(_0x26910c,_0x2239ba){return getAuthToken(_0xa41c0d,_0x5079d3,_0x12db7c)[_0xcd3c('0x13')](function(_0x554f5c){var _0x1334e3={'method':_0xcd3c('0x19'),'uri':_0x10eaf9+_0xcd3c('0x1a'),'headers':{'Authorization':_0xcd3c('0x1b')+_0x554f5c,'OData-Version':_0xcd3c('0x1c')},'json':!![]};return rp(_0x1334e3);})[_0xcd3c('0x13')](function(_0x3b52f6){var _0x5bf1d3=_0x3b52f6[_0xcd3c('0x1d')];var _0x677e48=![];var _0x5ed4a9=null;if(!_['isNil'](_0x412fae)){if(intUtil[_0xcd3c('0x1e')](_0x412fae[_0xcd3c('0x1f')])){_0x2b38a6[_0xcd3c('0x20')]=_0x412fae[_0xcd3c('0x1f')];for(_0x5ed4a9=0x0;_0x5ed4a9<_0x5bf1d3[_0xcd3c('0x21')];_0x5ed4a9++){if(_0x5bf1d3[_0x5ed4a9]['internalemailaddress']===_0x412fae[_0xcd3c('0x1f')]&&!_0x5bf1d3[_0x5ed4a9]['isdisabled']){_0x677e48=!![];logger[_0xcd3c('0x22')]('['+[_0x12db7c['toUpperCase']()]+_0xcd3c('0x23')+_0x5bf1d3[_0x5ed4a9][_0xcd3c('0x24')]+'!');_0x2b38a6[_0xcd3c('0x25')]=_0x5bf1d3[_0x5ed4a9][_0xcd3c('0x24')];}}}}if(!_0x677e48){logger[_0xcd3c('0x22')]('['+[_0x12db7c[_0xcd3c('0x26')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x2b38a6[_0xcd3c('0x20')]=_0xa41c0d['username'];for(_0x5ed4a9=0x0;_0x5ed4a9<_0x5bf1d3['length'];_0x5ed4a9++){if(_0x5bf1d3[_0x5ed4a9]['internalemailaddress']===_0xa41c0d[_0xcd3c('0x11')]){_0x2b38a6[_0xcd3c('0x25')]=_0x5bf1d3[_0x5ed4a9]['systemuserid'];}}}_0x26910c(_0x2b38a6);})['catch'](function(_0x52081d){_0x2239ba(_0x52081d['message']);});});}function createEndUser(_0x45bceb,_0xedb729,_0x543966,_0x4b7001,_0xdf8916,_0x17cebc,_0x2eef01){return new Promise(function(_0x3fbd85,_0x349494){return getAuthToken(_0xedb729,_0x543966,_0x17cebc)[_0xcd3c('0x13')](function(_0x75b222){var _0x58c723=_0x17cebc[_0xcd3c('0x27')]()==='outbound'?_0xdf8916[_0xcd3c('0x28')]:_0xdf8916[_0xcd3c('0x29')];var _0x43d649={'method':_0xcd3c('0xf'),'uri':_0x4b7001+_0xcd3c('0x2a'),'body':{'fullname':_0x58c723,'firstname':_0x58c723,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x45bceb[_0xcd3c('0x25')]+')'},'headers':{'Authorization':_0xcd3c('0x1b')+_0x75b222,'OData-Version':_0xcd3c('0x1c')},'json':!![],'resolveWithFullResponse':!![]};_0x43d649[_0xcd3c('0x2b')][_0x2eef01]=_0x58c723;return rp(_0x43d649);})[_0xcd3c('0x13')](function(_0x49540f){var _0xd75ef3=_0x49540f[_0xcd3c('0x2c')][_0xcd3c('0x2d')];var _0x182744=_0xd75ef3[_0xcd3c('0x2e')](_0xd75ef3['lastIndexOf']('(')+0x1,_0xd75ef3[_0xcd3c('0x2f')](')'));_0x45bceb['enduserId']=_0x182744;_0x3fbd85(_0x45bceb);})[_0xcd3c('0x15')](function(_0x53d9f0){_0x349494(_0x53d9f0[_0xcd3c('0x18')]);});});}function getEndUser(_0x1bf020,_0x274742,_0xf9101e,_0x5b8cb0,_0x1544d5,_0x153e2b,_0x4542cd,_0x5b7768){var _0x449966=_0x153e2b[_0xcd3c('0x27')]()===_0xcd3c('0x30')?_0x1544d5[_0xcd3c('0x28')]:_0x1544d5[_0xcd3c('0x29')];return getAuthToken(_0x274742,_0xf9101e,_0x153e2b)[_0xcd3c('0x13')](function(_0x368e3c){_0x5b7768=_0x5b7768?_0x5b7768:_0xcd3c('0x31');var _0x506c4a={'method':_0xcd3c('0x19'),'uri':_0x5b8cb0+_0xcd3c('0x32')+_0x5b7768+_0xcd3c('0x33')+_0x5b7768+_0xcd3c('0x34')+_0x449966['replace']('+',_0xcd3c('0x35'))+'\x27','headers':{'Authorization':_0xcd3c('0x1b')+_0x368e3c,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x506c4a);})[_0xcd3c('0x13')](function(_0xdca527){var _0x56ff98=![];if(!_0xdca527)return _0x56ff98;var _0x38c821=_0xdca527['value'];for(var _0x391a18=0x0;_0x391a18<_0x38c821[_0xcd3c('0x21')];_0x391a18++){if(_0x38c821[_0x391a18][_0x5b7768]===_0x449966){_0x56ff98=!![];_0x1bf020[_0xcd3c('0x36')]=_0x38c821[_0x391a18][_0xcd3c('0x37')];}}return _0x56ff98;})[_0xcd3c('0x13')](function(_0xcf2a95){if(_0xcf2a95)return _0x1bf020;if(_0x4542cd===_0xcd3c('0x38')){logger['info']('['+[_0x153e2b[_0xcd3c('0x26')]()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x1bf020;}return createEndUser(_0x1bf020,_0x274742,_0xf9101e,_0x5b8cb0,_0x1544d5,_0x153e2b,_0x5b7768)[_0xcd3c('0x13')](function(_0x3dbecc){logger['info']('['+[_0x153e2b[_0xcd3c('0x26')]()]+']\x20Enduser\x20created!',_0x3dbecc[_0xcd3c('0x36')]);return _0x3dbecc;});});}function getCustomFields(_0x1418f6,_0x8ac3c6,_0x4d8b34){var _0x2d360f={};if(_0x1418f6[_0xcd3c('0x21')]>0x0){_[_0xcd3c('0x39')](_0x1418f6,function(_0x49e3f2){if(_[_0xcd3c('0x3a')]([_0xcd3c('0x3b'),'picklist'],_0x49e3f2[_0xcd3c('0x3c')])&&_0x49e3f2[_0xcd3c('0x3d')]&&!_0x49e3f2[_0xcd3c('0x3e')]){var _0xdb3881=_0x49e3f2['idField'][_0xcd3c('0x27')]();var _0x5dd2cb=_0xdb3881[_0xcd3c('0x2e')](0x0,_0xdb3881['indexOf']('_'));var _0x404eb=_0xdb3881[_0xcd3c('0x2e')](_0xdb3881['indexOf']('_')+0x1);if(_0x5dd2cb===_0x4d8b34){_0x2d360f[_0x404eb]=_0x49e3f2['content'];}}});}return _0x2d360f;}function getTicket(_0x346f75,_0x1cb091,_0x4bc97d,_0x120820,_0xd570e5,_0x3019b4,_0x2f176a){return new Promise(function(_0xf1b3bd,_0x1b9ef1){var _0x3a477d;return getAuthToken(_0x1cb091,_0x4bc97d,_0x2f176a)[_0xcd3c('0x13')](function(_0x648543){if(_0x3019b4[_0xcd3c('0x3f')]===_0xcd3c('0x40')){_0x3a477d={'method':'POST','uri':_0x120820+_0xcd3c('0x41'),'body':Object[_0xcd3c('0x42')]({},{'title':intUtil[_0xcd3c('0x43')](_0x3019b4[_0xcd3c('0x44')],_0xd570e5,'\x20'),'description':intUtil[_0xcd3c('0x43')](_0x3019b4[_0xcd3c('0x45')],_0xd570e5,'\x0a'),'customerid_contact@odata.bind':_0x346f75['enduserId']?_0xcd3c('0x46')+_0x346f75['enduserId']+')':undefined,'ownerid@odata.bind':_0xcd3c('0x47')+_0x346f75[_0xcd3c('0x25')]+')','caseorigincode':'1'},getCustomFields(_0x3019b4[_0xcd3c('0x48')],_0xd570e5,_0x3019b4['ticketType'])),'headers':{'Authorization':_0xcd3c('0x1b')+_0x648543,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x3019b4[_0xcd3c('0x3f')]===_0xcd3c('0x49')){var _0x38e14c=_0x346f75[_0xcd3c('0x36')]?[{'partyid_systemuser@odata.bind':_0xcd3c('0x47')+_0x346f75[_0xcd3c('0x25')]+')','participationtypemask':_0x346f75['callDirection']===_0xcd3c('0x4a')?0x2:0x1},{'partyid_contact@odata.bind':_0xcd3c('0x46')+_0x346f75[_0xcd3c('0x36')]+')','participationtypemask':_0x346f75[_0xcd3c('0x4b')]===_0xcd3c('0x4a')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0x346f75[_0xcd3c('0x25')]+')','participationtypemask':_0x346f75[_0xcd3c('0x4b')]===_0xcd3c('0x4a')?0x2:0x1}];_0x3a477d={'method':_0xcd3c('0xf'),'uri':_0x120820+_0xcd3c('0x4c'),'body':Object[_0xcd3c('0x42')]({},{'subject':intUtil[_0xcd3c('0x43')](_0x3019b4[_0xcd3c('0x44')],_0xd570e5,'\x20'),'phonenumber':String(_0xd570e5[_0xcd3c('0x29')]),'description':intUtil[_0xcd3c('0x43')](_0x3019b4['Descriptions'],_0xd570e5,'\x0a'),'regardingobjectid_contact@odata.bind':_0x346f75[_0xcd3c('0x36')]?_0xcd3c('0x46')+_0x346f75['enduserId']+')':undefined,'ownerid@odata.bind':_0xcd3c('0x47')+_0x346f75[_0xcd3c('0x25')]+')','directioncode':_0x346f75['callDirection']===_0xcd3c('0x4a')?![]:!![],'phonecall_activity_parties':_0x38e14c},getCustomFields(_0x3019b4[_0xcd3c('0x48')],_0xd570e5,_0x3019b4[_0xcd3c('0x3f')])),'headers':{'Authorization':_0xcd3c('0x1b')+_0x648543,'OData-Version':_0xcd3c('0x1c')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x3a477d);})[_0xcd3c('0x13')](function(_0x640fb3){var _0x4aeb92=_0x640fb3[_0xcd3c('0x2c')][_0xcd3c('0x2d')];var _0x4c85e5=_0x4aeb92[_0xcd3c('0x2e')](_0x4aeb92['lastIndexOf']('(')+0x1,_0x4aeb92[_0xcd3c('0x2f')](')'));_0x346f75['ticketId']=_0x4c85e5;_0xf1b3bd(_0x346f75);})['catch'](function(_0x7a45a7){_0x1b9ef1(_0x7a45a7[_0xcd3c('0x18')]);});});}function emit(_0xd8324a,_0x25eb1c,_0x545ddc,_0x2f61e9){var _0x39c1e4={'uri':util[_0xcd3c('0x4d')](_0xcd3c('0x4e'),_0xd8324a,_0x545ddc,_0x2f61e9)};io['to'](util[_0xcd3c('0x4d')]('user:%s',_0x25eb1c))[_0xcd3c('0x4f')](_0xcd3c('0x50'),_0x39c1e4);}exports['cs']=function(_0x6bae0d,_0x14d314,_0x2fc5a7,_0x13f9eb,_0x36b51b,_0x75cde1,_0x5700bb,_0x8600d){var _0x2e2571={};_0x75cde1[_0xcd3c('0xa')]=_0x75cde1[_0xcd3c('0x51')]?intUtil['stripTrailingSlash'](_0x75cde1['CloudProvider'][_0xcd3c('0x52')]):intUtil[_0xcd3c('0x53')](_0x75cde1['remoteUri']);_0x75cde1['serverUrl']=intUtil[_0xcd3c('0x53')](_0x75cde1[_0xcd3c('0x54')]);_0x2e2571[_0xcd3c('0x4b')]=_0x8600d==='queue'||_0x8600d===_0xcd3c('0x55')?_0xcd3c('0x4a'):_0xcd3c('0x30');var _0x58723b=_0x75cde1[_0xcd3c('0x51')]?util[_0xcd3c('0x4d')](_0xcd3c('0x56'),_0x75cde1[_0xcd3c('0xb')]['data7']):util[_0xcd3c('0x4d')](_0xcd3c('0x56'),_0x75cde1['remoteUri']);var _0x3e5dd2=util[_0xcd3c('0x4d')](_0xcd3c('0x57'),_0x75cde1[_0xcd3c('0xc')]);var _0x3657b0=util['format'](_0xcd3c('0x58'),_0x75cde1[_0xcd3c('0x54')],_0x14d314[_0xcd3c('0x59')],md5(_0x14d314['uniqueid']));if(_0x36b51b&&_0x36b51b[_0xcd3c('0x5a')]){logger[_0xcd3c('0x22')](_0xcd3c('0x5b'),_0xcd3c('0x5c'));_0x14d314[_0xcd3c('0x5d')]=_0x3657b0;}else if(_0x5700bb&&_0x5700bb[_0xcd3c('0x5e')]&&_0x5700bb[_0xcd3c('0x5e')]!==_0xcd3c('0x5f')){logger['info'](_0xcd3c('0x60'),'Recording\x20is\x20enabled!');_0x14d314[_0xcd3c('0x5d')]=_0x3657b0;}else{_0x14d314[_0xcd3c('0x5d')]='';}return getUser(_0x2e2571,_0x75cde1,_0x13f9eb,_0x3e5dd2,_0x58723b,_0x8600d)[_0xcd3c('0x13')](function(_0x41f49e){logger[_0xcd3c('0x22')]('['+_0x8600d['toUpperCase']()+_0xcd3c('0x61'),_0x41f49e['userId']);logger['info']('['+_0x8600d['toUpperCase']()+_0xcd3c('0x62'),_0x41f49e[_0xcd3c('0x20')]);return getEndUser(_0x41f49e,_0x75cde1,_0x3e5dd2,_0x58723b,_0x14d314,_0x8600d,_0x2fc5a7[_0xcd3c('0x63')],_0x2fc5a7[_0xcd3c('0x64')]);})[_0xcd3c('0x13')](function(_0x22b304){logger[_0xcd3c('0x22')]('['+_0x8600d[_0xcd3c('0x26')]()+_0xcd3c('0x65'),_0x22b304[_0xcd3c('0x36')]);logger[_0xcd3c('0x22')]('['+_0x8600d[_0xcd3c('0x26')]()+_0xcd3c('0x66'),_0x14d314['calleridnum']);return getTicket(_0x22b304,_0x75cde1,_0x3e5dd2,_0x58723b,_0x14d314,_0x2fc5a7,_0x8600d);})[_0xcd3c('0x13')](function(_0x36e4be){logger[_0xcd3c('0x22')](util['format']('['+_0x8600d[_0xcd3c('0x26')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x2fc5a7[_0xcd3c('0x3f')],_0x36e4be['ticketId']));logger[_0xcd3c('0x22')](util['format']('['+_0x8600d[_0xcd3c('0x26')]()+_0xcd3c('0x67'),_0x8600d));if(_0x8600d!==_0xcd3c('0x55')&&_0x2fc5a7[_0xcd3c('0x68')]){logger[_0xcd3c('0x22')]('['+_0x8600d[_0xcd3c('0x26')]()+']',_0xcd3c('0x69'));emit(_0x75cde1[_0xcd3c('0xa')],_0x13f9eb[_0xcd3c('0x6a')],_0x2fc5a7['ticketType'],_0x36e4be[_0xcd3c('0x6b')]);}})[_0xcd3c('0x15')](function(_0x4df9f5){logger['error']('['+_0x8600d['toUpperCase']()+_0xcd3c('0x6c'),_0x4df9f5[_0xcd3c('0x18')]);console['error'](_0xcd3c('0x6d'),_0x4df9f5);});}; \ No newline at end of file +var _0x0852=['headers','odata-entityid','substring','lastIndexOf','toLowerCase','calleridnum','telephone1','contacts?$select=','&$filter=','%2b','value','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','enduserId','forEach','includes','string','nameField','customField','idField','indexOf','content','assign','Subjects','getString','/contacts(','Fields','ticketType','callDirection','queue','phonecalls','Descriptions','ticketId','format','user:%s','emit','stripTrailingSlash','serverUrl','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20email\x20is:','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','unmanaged','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','error',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','resolve','data5','POST','clientId','username','password','then','access_token','catch','toUpperCase',']\x20Wrong\x20credentials!','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','systemuserid','message','outbound','destcalleridnum','/systemusers(','userId','body'];(function(_0xca492a,_0x120a84){var _0x22cd25=function(_0x5c2e99){while(--_0x5c2e99){_0xca492a['push'](_0xca492a['shift']());}};_0x22cd25(++_0x120a84);}(_0x0852,0x111));var _0x2085=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0852[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var rp=require('request-promise');var util=require('util');var intUtil=require(_0x2085('0x0'));var md5=require(_0x2085('0x1'));var Redis=require(_0x2085('0x2'));var logger=require(_0x2085('0x3'))(_0x2085('0x4'));var config=require(_0x2085('0x5'));config[_0x2085('0x6')]=_[_0x2085('0x7')](config['redis'],{'host':_0x2085('0x8'),'port':0x18eb});var io=require(_0x2085('0x9'))(new Redis(config['redis']));function getAuthToken(_0x22c87b,_0x183a8b,_0x44a56f){if(_0x22c87b[_0x2085('0xa')]){_0x22c87b[_0x2085('0xb')]=_0x22c87b[_0x2085('0xc')][_0x2085('0xd')];_0x22c87b[_0x2085('0xe')]=_0x22c87b['CloudProvider']['data2'];return Promise[_0x2085('0xf')](_0x22c87b['CloudProvider'][_0x2085('0x10')]);}var _0x441d1e={'method':_0x2085('0x11'),'uri':_0x183a8b,'form':{'client_id':_0x22c87b[_0x2085('0x12')],'resource':_0x22c87b[_0x2085('0xb')],'username':_0x22c87b[_0x2085('0x13')],'password':_0x22c87b[_0x2085('0x14')],'grant_type':_0x2085('0x14'),'client_secret':_0x22c87b['clientSecret']},'json':!![]};return rp(_0x441d1e)[_0x2085('0x15')](function(_0x52e37e){return _0x52e37e[_0x2085('0x16')];})[_0x2085('0x17')](function(_0x2daf39){logger['error']('['+[_0x44a56f[_0x2085('0x18')]()]+_0x2085('0x19'));return _0x2daf39['message'];});}function getUser(_0x3a9339,_0x1e9701,_0x3fcf31,_0x4e0f2d,_0xedc782,_0x4c46d9){return new Promise(function(_0x3f06bf,_0x167226){return getAuthToken(_0x1e9701,_0x4e0f2d,_0x4c46d9)[_0x2085('0x15')](function(_0x3903dd){var _0xec537d={'method':_0x2085('0x1a'),'uri':_0xedc782+_0x2085('0x1b'),'headers':{'Authorization':_0x2085('0x1c')+_0x3903dd,'OData-Version':_0x2085('0x1d')},'json':!![]};return rp(_0xec537d);})['then'](function(_0xfe0a3){var _0x4d0b88=_0xfe0a3['value'];var _0x36d376=![];var _0x33d7b9=null;if(!_['isNil'](_0x3fcf31)){if(intUtil['validateEmail'](_0x3fcf31[_0x2085('0x1e')])){_0x3a9339[_0x2085('0x1f')]=_0x3fcf31[_0x2085('0x1e')];for(_0x33d7b9=0x0;_0x33d7b9<_0x4d0b88[_0x2085('0x20')];_0x33d7b9++){if(_0x4d0b88[_0x33d7b9][_0x2085('0x21')]===_0x3fcf31[_0x2085('0x1e')]&&!_0x4d0b88[_0x33d7b9][_0x2085('0x22')]){_0x36d376=!![];logger[_0x2085('0x23')]('['+[_0x4c46d9[_0x2085('0x18')]()]+_0x2085('0x24')+_0x4d0b88[_0x33d7b9]['systemuserid']+'!');_0x3a9339['userId']=_0x4d0b88[_0x33d7b9]['systemuserid'];}}}}if(!_0x36d376){logger[_0x2085('0x23')]('['+[_0x4c46d9[_0x2085('0x18')]()]+_0x2085('0x25'));_0x3a9339['userEmail']=_0x1e9701[_0x2085('0x13')];for(_0x33d7b9=0x0;_0x33d7b9<_0x4d0b88[_0x2085('0x20')];_0x33d7b9++){if(_0x4d0b88[_0x33d7b9][_0x2085('0x21')]===_0x1e9701[_0x2085('0x13')]){_0x3a9339['userId']=_0x4d0b88[_0x33d7b9][_0x2085('0x26')];}}}_0x3f06bf(_0x3a9339);})['catch'](function(_0x15b63b){_0x167226(_0x15b63b[_0x2085('0x27')]);});});}function createEndUser(_0x292afd,_0x56551a,_0x4f350c,_0x5310f3,_0x134dc5,_0x1291fe,_0x2a41ee){return new Promise(function(_0x29dc80,_0x48479f){return getAuthToken(_0x56551a,_0x4f350c,_0x1291fe)[_0x2085('0x15')](function(_0x55c3a0){var _0x15bf07=_0x1291fe['toLowerCase']()===_0x2085('0x28')?_0x134dc5[_0x2085('0x29')]:_0x134dc5['calleridnum'];var _0x519211={'method':'POST','uri':_0x5310f3+'contacts','body':{'fullname':_0x15bf07,'firstname':_0x15bf07,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x2085('0x2a')+_0x292afd[_0x2085('0x2b')]+')'},'headers':{'Authorization':_0x2085('0x1c')+_0x55c3a0,'OData-Version':_0x2085('0x1d')},'json':!![],'resolveWithFullResponse':!![]};_0x519211[_0x2085('0x2c')][_0x2a41ee]=_0x15bf07;return rp(_0x519211);})[_0x2085('0x15')](function(_0x20c8fd){var _0x34d5eb=_0x20c8fd[_0x2085('0x2d')][_0x2085('0x2e')];var _0x2927e4=_0x34d5eb[_0x2085('0x2f')](_0x34d5eb[_0x2085('0x30')]('(')+0x1,_0x34d5eb[_0x2085('0x30')](')'));_0x292afd['enduserId']=_0x2927e4;_0x29dc80(_0x292afd);})[_0x2085('0x17')](function(_0x25788b){_0x48479f(_0x25788b[_0x2085('0x27')]);});});}function getEndUser(_0x2eda77,_0x4417fc,_0x314c21,_0x40c170,_0x388ea7,_0x4920f7,_0xf6c18d,_0x480597){var _0x39b030=_0x4920f7[_0x2085('0x31')]()===_0x2085('0x28')?_0x388ea7[_0x2085('0x29')]:_0x388ea7[_0x2085('0x32')];return getAuthToken(_0x4417fc,_0x314c21,_0x4920f7)[_0x2085('0x15')](function(_0x80ec33){_0x480597=_0x480597?_0x480597:_0x2085('0x33');var _0x466a0b={'method':'GET','uri':_0x40c170+_0x2085('0x34')+_0x480597+_0x2085('0x35')+_0x480597+'\x20eq\x20\x27'+_0x39b030['replace']('+',_0x2085('0x36'))+'\x27','headers':{'Authorization':_0x2085('0x1c')+_0x80ec33,'If-None-Match':null,'OData-Version':_0x2085('0x1d')},'json':!![]};return rp(_0x466a0b);})['then'](function(_0x41f35a){var _0x382654=![];if(!_0x41f35a)return _0x382654;var _0xa4cfd1=_0x41f35a[_0x2085('0x37')];for(var _0x321234=0x0;_0x321234<_0xa4cfd1['length'];_0x321234++){if(_0xa4cfd1[_0x321234][_0x480597]===_0x39b030){_0x382654=!![];_0x2eda77['enduserId']=_0xa4cfd1[_0x321234][_0x2085('0x38')];}}return _0x382654;})[_0x2085('0x15')](function(_0x32fc68){if(_0x32fc68)return _0x2eda77;if(_0xf6c18d===_0x2085('0x39')){logger['info']('['+[_0x4920f7[_0x2085('0x18')]()]+_0x2085('0x3a'));return _0x2eda77;}return createEndUser(_0x2eda77,_0x4417fc,_0x314c21,_0x40c170,_0x388ea7,_0x4920f7,_0x480597)[_0x2085('0x15')](function(_0x385495){logger[_0x2085('0x23')]('['+[_0x4920f7[_0x2085('0x18')]()]+']\x20Enduser\x20created!',_0x385495[_0x2085('0x3b')]);return _0x385495;});});}function getCustomFields(_0x55ed10,_0x4e79fd,_0x286997){var _0x55f457={};if(_0x55ed10[_0x2085('0x20')]>0x0){_[_0x2085('0x3c')](_0x55ed10,function(_0x5f40f1){if(_[_0x2085('0x3d')]([_0x2085('0x3e'),'picklist'],_0x5f40f1['type'])&&_0x5f40f1[_0x2085('0x3f')]&&!_0x5f40f1[_0x2085('0x40')]){var _0x36a664=_0x5f40f1[_0x2085('0x41')]['toLowerCase']();var _0x2cbc89=_0x36a664['substring'](0x0,_0x36a664[_0x2085('0x42')]('_'));var _0x2be9d3=_0x36a664[_0x2085('0x2f')](_0x36a664[_0x2085('0x42')]('_')+0x1);if(_0x2cbc89===_0x286997){_0x55f457[_0x2be9d3]=_0x5f40f1[_0x2085('0x43')];}}});}return _0x55f457;}function getTicket(_0x39c3e6,_0xca53fa,_0x48d4bd,_0x20604c,_0x76e192,_0x3ffe7b,_0x578e98){return new Promise(function(_0x26776f,_0x1efe42){var _0xfcf3ac;return getAuthToken(_0xca53fa,_0x48d4bd,_0x578e98)[_0x2085('0x15')](function(_0x52851d){if(_0x3ffe7b['ticketType']==='incident'){_0xfcf3ac={'method':_0x2085('0x11'),'uri':_0x20604c+'incidents','body':Object[_0x2085('0x44')]({},{'title':intUtil['getString'](_0x3ffe7b[_0x2085('0x45')],_0x76e192,'\x20'),'description':intUtil[_0x2085('0x46')](_0x3ffe7b['Descriptions'],_0x76e192,'\x0a'),'customerid_contact@odata.bind':_0x39c3e6['enduserId']?_0x2085('0x47')+_0x39c3e6[_0x2085('0x3b')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x39c3e6[_0x2085('0x2b')]+')','caseorigincode':'1'},getCustomFields(_0x3ffe7b[_0x2085('0x48')],_0x76e192,_0x3ffe7b[_0x2085('0x49')])),'headers':{'Authorization':_0x2085('0x1c')+_0x52851d,'OData-Version':_0x2085('0x1d')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x3ffe7b['ticketType']==='phonecall'){var _0x1acd14=_0x39c3e6[_0x2085('0x3b')]?[{'partyid_systemuser@odata.bind':_0x2085('0x2a')+_0x39c3e6['userId']+')','participationtypemask':_0x39c3e6[_0x2085('0x4a')]===_0x2085('0x4b')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x39c3e6[_0x2085('0x3b')]+')','participationtypemask':_0x39c3e6[_0x2085('0x4a')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x2085('0x2a')+_0x39c3e6[_0x2085('0x2b')]+')','participationtypemask':_0x39c3e6[_0x2085('0x4a')]===_0x2085('0x4b')?0x2:0x1}];_0xfcf3ac={'method':_0x2085('0x11'),'uri':_0x20604c+_0x2085('0x4c'),'body':Object['assign']({},{'subject':intUtil[_0x2085('0x46')](_0x3ffe7b[_0x2085('0x45')],_0x76e192,'\x20'),'phonenumber':String(_0x76e192[_0x2085('0x32')]),'description':intUtil[_0x2085('0x46')](_0x3ffe7b[_0x2085('0x4d')],_0x76e192,'\x0a'),'regardingobjectid_contact@odata.bind':_0x39c3e6[_0x2085('0x3b')]?_0x2085('0x47')+_0x39c3e6[_0x2085('0x3b')]+')':undefined,'ownerid@odata.bind':_0x2085('0x2a')+_0x39c3e6['userId']+')','directioncode':_0x39c3e6[_0x2085('0x4a')]===_0x2085('0x4b')?![]:!![],'phonecall_activity_parties':_0x1acd14},getCustomFields(_0x3ffe7b['Fields'],_0x76e192,_0x3ffe7b[_0x2085('0x49')])),'headers':{'Authorization':_0x2085('0x1c')+_0x52851d,'OData-Version':_0x2085('0x1d')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0xfcf3ac);})[_0x2085('0x15')](function(_0x173268){var _0x518d65=_0x173268[_0x2085('0x2d')][_0x2085('0x2e')];var _0x43ce3c=_0x518d65['substring'](_0x518d65[_0x2085('0x30')]('(')+0x1,_0x518d65[_0x2085('0x30')](')'));_0x39c3e6[_0x2085('0x4e')]=_0x43ce3c;_0x26776f(_0x39c3e6);})[_0x2085('0x17')](function(_0x3bc5b8){_0x1efe42(_0x3bc5b8['message']);});});}function emit(_0x285dc9,_0x207bfb,_0x217d8e,_0x14f5ab){var _0x3f8615={'uri':util['format']('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x285dc9,_0x217d8e,_0x14f5ab)};io['to'](util[_0x2085('0x4f')](_0x2085('0x50'),_0x207bfb))[_0x2085('0x51')]('trigger:browser:url',_0x3f8615);}exports['cs']=function(_0x4e3cde,_0x17e6e3,_0x42c124,_0x1c6efd,_0x48008e,_0x413c86,_0x656651,_0x1539a9){var _0x408bc1={};_0x413c86[_0x2085('0xb')]=_0x413c86[_0x2085('0xa')]?intUtil[_0x2085('0x52')](_0x413c86[_0x2085('0xc')][_0x2085('0xd')]):intUtil['stripTrailingSlash'](_0x413c86[_0x2085('0xb')]);_0x413c86[_0x2085('0x53')]=intUtil['stripTrailingSlash'](_0x413c86[_0x2085('0x53')]);_0x408bc1[_0x2085('0x4a')]=_0x1539a9===_0x2085('0x4b')||_0x1539a9==='unmanaged'?_0x2085('0x4b'):'outbound';var _0x3f36b2=_0x413c86[_0x2085('0xa')]?util[_0x2085('0x4f')]('%s/api/data/v9.0/',_0x413c86['CloudProvider'][_0x2085('0xd')]):util[_0x2085('0x4f')](_0x2085('0x54'),_0x413c86[_0x2085('0xb')]);var _0x45d87b=util[_0x2085('0x4f')](_0x2085('0x55'),_0x413c86['tenantId']);var _0x15c0a9=util['format'](_0x2085('0x56'),_0x413c86[_0x2085('0x53')],_0x17e6e3[_0x2085('0x57')],md5(_0x17e6e3[_0x2085('0x57')]));if(_0x48008e&&_0x48008e[_0x2085('0x58')]){logger[_0x2085('0x23')](_0x2085('0x59'),_0x2085('0x5a'));_0x17e6e3[_0x2085('0x5b')]=_0x15c0a9;}else if(_0x656651&&_0x656651[_0x2085('0x5c')]&&_0x656651[_0x2085('0x5c')]!==_0x2085('0x5d')){logger['info'](_0x2085('0x5e'),_0x2085('0x5a'));_0x17e6e3[_0x2085('0x5b')]=_0x15c0a9;}else{_0x17e6e3[_0x2085('0x5b')]='';}return getUser(_0x408bc1,_0x413c86,_0x1c6efd,_0x45d87b,_0x3f36b2,_0x1539a9)[_0x2085('0x15')](function(_0x5b6ca5){logger[_0x2085('0x23')]('['+_0x1539a9['toUpperCase']()+']\x20The\x20User\x20ID\x20is:',_0x5b6ca5[_0x2085('0x2b')]);logger['info']('['+_0x1539a9['toUpperCase']()+_0x2085('0x5f'),_0x5b6ca5[_0x2085('0x1f')]);return getEndUser(_0x5b6ca5,_0x413c86,_0x45d87b,_0x3f36b2,_0x17e6e3,_0x1539a9,_0x42c124[_0x2085('0x60')],_0x42c124['additionalSearchContact']);})[_0x2085('0x15')](function(_0x309b4f){logger['info']('['+_0x1539a9['toUpperCase']()+_0x2085('0x61'),_0x309b4f[_0x2085('0x3b')]);logger[_0x2085('0x23')]('['+_0x1539a9[_0x2085('0x18')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x17e6e3[_0x2085('0x32')]);return getTicket(_0x309b4f,_0x413c86,_0x45d87b,_0x3f36b2,_0x17e6e3,_0x42c124,_0x1539a9);})['then'](function(_0x44c81c){logger[_0x2085('0x23')](util[_0x2085('0x4f')]('['+_0x1539a9[_0x2085('0x18')]()+_0x2085('0x62'),_0x42c124['ticketType'],_0x44c81c[_0x2085('0x4e')]));logger[_0x2085('0x23')](util[_0x2085('0x4f')]('['+_0x1539a9[_0x2085('0x18')]()+_0x2085('0x63'),_0x1539a9));if(_0x1539a9!==_0x2085('0x64')&&_0x42c124[_0x2085('0x65')]){logger['info']('['+_0x1539a9[_0x2085('0x18')]()+']',_0x2085('0x66'));emit(_0x413c86[_0x2085('0xb')],_0x1c6efd['name'],_0x42c124[_0x2085('0x49')],_0x44c81c[_0x2085('0x4e')]);}})[_0x2085('0x17')](function(_0x4b68b2){logger[_0x2085('0x67')]('['+_0x1539a9[_0x2085('0x18')]()+_0x2085('0x68'),_0x4b68b2[_0x2085('0x27')]);console[_0x2085('0x67')](_0x2085('0x69'),_0x4b68b2);});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshdesk.js b/server/services/ami/trigger/integration/freshdesk.js index 8800d50..afb7a5b 100644 --- a/server/services/ami/trigger/integration/freshdesk.js +++ b/server/services/ami/trigger/integration/freshdesk.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe561=['monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','recordingFormat','none','[OUTBOUND]','recordingURL','destcalleridnum','The\x20Ticket\x20ID\x20is:','%s/helpdesk/tickets/%d','unmanaged','lastevent','toUpperCase','lodash','md5','util','./util','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','
','Tags','Fields','custom_fields','mapValues','keyBy','%s/api/v2/tickets','POST','Ticket\x20created!','%s/api/v2/agents','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','remoteUri','then','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/contacts','length','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','[HTTP]','stringify','includes','picklist','type','nameField','toLowerCase','content','string','idField','customField','push','variable','variableName','Variable','name','queue','serverUrl','stripTrailingSlash'];(function(_0x2842ed,_0x23ba81){var _0x1625bd=function(_0x29acd1){while(--_0x29acd1){_0x2842ed['push'](_0x2842ed['shift']());}};_0x1625bd(++_0x23ba81);}(_0xe561,0x177));var _0x1e56=function(_0x27378b,_0x1a7162){_0x27378b=_0x27378b-0x0;var _0x4b637b=_0xe561[_0x27378b];return _0x4b637b;};'use strict';var _=require(_0x1e56('0x0'));var rp=require('request-promise');var md5=require(_0x1e56('0x1'));var util=require(_0x1e56('0x2'));var Redis=require('ioredis');var intUtil=require(_0x1e56('0x3'));var config=require('../../../../config/environment');var logger=require(_0x1e56('0x4'))('freshdesk');config[_0x1e56('0x5')]=_[_0x1e56('0x6')](config['redis'],{'host':_0x1e56('0x7'),'port':0x18eb});var io=require(_0x1e56('0x8'))(new Redis(config[_0x1e56('0x5')]));var headers={'Content-Type':_0x1e56('0x9'),'Accept':_0x1e56('0x9')};function emit(_0x17c9c5,_0x2af5f0,_0x581d69){io['to'](_0x17c9c5)[_0x1e56('0xa')](_0x2af5f0,_0x581d69);}function getTicket(_0x9d4266,_0x46d237,_0x18bde9,_0x129f34,_0x5ecb04){logger[_0x1e56('0xb')]('Creating\x20new\x20ticket...');var _0x5ea5eb=_['merge']({'responder_id':_0x46d237['id'],'requester_id':_0x18bde9['id'],'name':util[_0x1e56('0xc')](_0x1e56('0xd'),_0x5ecb04[_0x1e56('0xe')]),'phone':_0x5ecb04[_0x1e56('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x1e56('0x10')](_0x129f34[_0x1e56('0x11')],_0x5ecb04,'\x20'),'description':intUtil[_0x1e56('0x10')](_0x129f34['Descriptions'],_0x5ecb04,_0x1e56('0x12')),'tags':getTags(_0x129f34[_0x1e56('0x13')],'name')},getCustomFields(_0x129f34[_0x1e56('0x14')],_0x5ecb04));_0x5ea5eb[_0x1e56('0x15')]=_[_0x1e56('0x16')](_[_0x1e56('0x17')](_0x5ea5eb[_0x1e56('0x15')],'id'),'value');return request({'uri':util[_0x1e56('0xc')](_0x1e56('0x18'),_0x9d4266['remoteUri']),'method':_0x1e56('0x19'),'body':_0x5ea5eb})['then'](function(_0x2f6ce4){logger[_0x1e56('0xb')](_0x1e56('0x1a'));return _0x2f6ce4;});}function getUser(_0x2d3df9,_0x46791e){if(intUtil['validateEmail'](_0x46791e)){return request({'uri':util[_0x1e56('0xc')](_0x1e56('0x1b'),_0x2d3df9['remoteUri']),'qs':{'email':_0x46791e}})['then'](function(_0x374e16){if(_0x374e16['length']){logger[_0x1e56('0xb')](_0x1e56('0x1c'));return _[_0x1e56('0x1d')](_0x374e16,function(_0x3acc0e){return _0x3acc0e[_0x1e56('0x1e')][_0x1e56('0x1f')]===_0x46791e;});}else{logger['info'](_0x1e56('0x20'));return request({'uri':util['format'](_0x1e56('0x21'),_0x2d3df9[_0x1e56('0x22')])})[_0x1e56('0x23')](function(_0x51672d){logger[_0x1e56('0xb')](_0x1e56('0x24'));return _0x51672d;});}});}else{logger['info'](_0x1e56('0x25'));return request({'uri':util['format'](_0x1e56('0x21'),_0x2d3df9[_0x1e56('0x22')])})[_0x1e56('0x23')](function(_0x3ccaf4){logger[_0x1e56('0xb')](_0x1e56('0x24'));return _0x3ccaf4;});}}function getEndUser(_0x11a16d,_0x18a9d4,_0x37c77b){logger[_0x1e56('0xb')]('Searching\x20enduser\x20with\x20phone',_0x37c77b);return request({'uri':util[_0x1e56('0xc')](_0x1e56('0x26'),_0x11a16d[_0x1e56('0x22')]),'qs':{'phone':_0x37c77b}})[_0x1e56('0x23')](function(_0x535aeb){if(_0x535aeb[_0x1e56('0x27')]){logger['info']('Enduser\x20found!');return _[_0x1e56('0x1d')](_0x535aeb,{'phone':_0x37c77b});}else{logger[_0x1e56('0xb')](_0x1e56('0x28'));return request({'uri':util[_0x1e56('0xc')]('%s/api/v2/contacts',_0x11a16d[_0x1e56('0x22')]),'method':_0x1e56('0x19'),'body':{'name':_0x18a9d4,'phone':_0x37c77b}})[_0x1e56('0x23')](function(_0x1de3b0){logger[_0x1e56('0xb')](_0x1e56('0x29'));return _0x1de3b0;});}});}function getAuth(_0x138308){return util[_0x1e56('0xc')](_0x1e56('0x2a'),new Buffer(_0x138308[_0x1e56('0x2b')]+':X')[_0x1e56('0x2c')](_0x1e56('0x2d')));}function request(_0x3eea17){logger['debug'](_0x1e56('0x2e'),JSON[_0x1e56('0x2f')](_0x3eea17));return rp(_[_0x1e56('0x6')](_0x3eea17,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x3c507a,_0x32c20c){var _0x4d0402=[];if(_0x3c507a&&_0x3c507a[_0x1e56('0x27')]>0x0){_0x4d0402=_['map'](_0x3c507a,_0x32c20c);}return _0x4d0402;}function getCustomFields(_0x53e3a7,_0x1958fc){var _0x23e6c1=[];var _0x40bbf9={'custom_fields':[]};if(_0x53e3a7[_0x1e56('0x27')]>0x0){_['forEach'](_0x53e3a7,function(_0x794b7){if(_[_0x1e56('0x30')](['string',_0x1e56('0x31')],_0x794b7[_0x1e56('0x32')])&&_0x794b7[_0x1e56('0x33')]&&!_0x794b7['customField']){_0x40bbf9[_0x794b7['nameField'][_0x1e56('0x34')]()]=_0x794b7[_0x1e56('0x35')]['toString']();}else if(_[_0x1e56('0x30')]([_0x1e56('0x36'),_0x1e56('0x31')],_0x794b7['type'])&&_0x794b7[_0x1e56('0x37')]&&_0x794b7[_0x1e56('0x38')]){_0x40bbf9[_0x1e56('0x15')][_0x1e56('0x39')]({'id':_0x794b7[_0x1e56('0x37')],'value':_0x794b7[_0x1e56('0x35')][_0x1e56('0x2c')]()});}else if(_0x794b7['type']===_0x1e56('0x3a')&&_0x794b7[_0x1e56('0x3b')]&&_0x794b7[_0x1e56('0x37')]&&_0x794b7['customField']){_0x1958fc[_0x794b7[_0x1e56('0x3b')]]&&_0x40bbf9[_0x1e56('0x15')]['push']({'id':_0x794b7['idField'],'value':_0x1958fc[_0x794b7[_0x1e56('0x3b')]][_0x1e56('0x2c')]()});}else if(_0x794b7[_0x1e56('0x32')]==='customVariable'&&_0x794b7[_0x1e56('0x3c')]&&_0x794b7['Variable'][_0x1e56('0x3d')]&&_0x794b7[_0x1e56('0x37')]&&_0x794b7[_0x1e56('0x38')]){_0x1958fc[_0x794b7[_0x1e56('0x3c')][_0x1e56('0x3d')][_0x1e56('0x34')]()]&&_0x40bbf9[_0x1e56('0x15')]['push']({'id':_0x794b7[_0x1e56('0x37')],'value':_0x1958fc[_0x794b7['Variable'][_0x1e56('0x3d')][_0x1e56('0x34')]()][_0x1e56('0x2c')]()});}});}return _0x40bbf9;}exports[_0x1e56('0x3e')]=function(_0x8714a6,_0x535a2c,_0x105421,_0x40deba,_0x3d29cf,_0x20d61c){var _0x4a2894,_0x37c526;_0x20d61c[_0x1e56('0x22')]=intUtil['stripTrailingSlash'](_0x20d61c['remoteUri']);_0x20d61c[_0x1e56('0x3f')]=intUtil[_0x1e56('0x40')](_0x20d61c['serverUrl']);if(_0x3d29cf&&_0x3d29cf[_0x1e56('0x41')]){logger[_0x1e56('0xb')](_0x1e56('0x42'),_0x1e56('0x43'));_0x535a2c['recordingURL']=util['format'](_0x1e56('0x44'),_0x20d61c[_0x1e56('0x3f')],_0x535a2c[_0x1e56('0x45')],md5(_0x535a2c[_0x1e56('0x45')]));}else{_0x535a2c['recordingURL']='';}headers[_0x1e56('0x46')]=getAuth(_0x20d61c);return getUser(_0x20d61c,_0x40deba[_0x1e56('0x1f')])[_0x1e56('0x23')](function(_0x4d256f){_0x4a2894=_0x4d256f;logger[_0x1e56('0xb')](_0x1e56('0x47'),_0x4a2894['id']);return getEndUser(_0x20d61c,_0x535a2c[_0x1e56('0xe')],_0x535a2c[_0x1e56('0xf')]);})[_0x1e56('0x23')](function(_0x7d9405){_0x37c526=_0x7d9405;logger[_0x1e56('0xb')](_0x1e56('0x48'),_0x37c526['id']);return getTicket(_0x20d61c,_0x4a2894,_0x37c526,_0x105421,_0x535a2c);})[_0x1e56('0x23')](function(_0x473e8d){if(_0x473e8d&&_0x473e8d['id']){logger[_0x1e56('0xb')]('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x473e8d['id']);logger[_0x1e56('0xb')](_0x1e56('0x42'),_0x1e56('0x49'));emit(util[_0x1e56('0xc')](_0x1e56('0x4a'),_0x40deba['name']),_0x1e56('0x4b'),{'uri':util[_0x1e56('0xc')]('%s/helpdesk/tickets/%d',_0x20d61c[_0x1e56('0x22')],_0x473e8d['id'])});}})[_0x1e56('0x4c')](function(_0x5a24cc){logger[_0x1e56('0x4d')](_0x1e56('0x42'),JSON[_0x1e56('0x2f')](_0x5a24cc));});};exports['outbound']=function(_0x432d4a,_0x5db6d3,_0x47b168,_0x1d64d2,_0x120d4b,_0x612d82,_0x4f2f6c){var _0x357114,_0xc563dc;_0x612d82[_0x1e56('0x22')]=intUtil[_0x1e56('0x40')](_0x612d82[_0x1e56('0x22')]);_0x612d82[_0x1e56('0x3f')]=intUtil[_0x1e56('0x40')](_0x612d82['serverUrl']);if(_0x4f2f6c&&_0x4f2f6c[_0x1e56('0x4e')]&&_0x4f2f6c['recordingFormat']!==_0x1e56('0x4f')){logger[_0x1e56('0xb')](_0x1e56('0x50'),_0x1e56('0x43'));_0x5db6d3[_0x1e56('0x51')]=util[_0x1e56('0xc')](_0x1e56('0x44'),_0x612d82[_0x1e56('0x3f')],_0x5db6d3[_0x1e56('0x45')],md5(_0x5db6d3[_0x1e56('0x45')]));}headers[_0x1e56('0x46')]=getAuth(_0x612d82);return getUser(_0x612d82,_0x1d64d2[_0x1e56('0x1f')])[_0x1e56('0x23')](function(_0x358556){_0x357114=_0x358556;logger[_0x1e56('0xb')]('The\x20User\x20ID\x20is:',_0x357114['id']);return getEndUser(_0x612d82,_0x5db6d3['destcalleridname'],_0x5db6d3[_0x1e56('0x52')]);})[_0x1e56('0x23')](function(_0x256fc8){_0xc563dc=_0x256fc8;logger['info']('The\x20Enduser\x20ID\x20is:',_0xc563dc['id']);return getTicket(_0x612d82,_0x357114,_0xc563dc,_0x47b168,_0x5db6d3);})[_0x1e56('0x23')](function(_0x9d955b){if(_0x9d955b&&_0x9d955b['id']){logger[_0x1e56('0xb')](_0x1e56('0x1a'));logger[_0x1e56('0xb')](_0x1e56('0x53'),_0x9d955b['id']);logger[_0x1e56('0xb')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x1e56('0xc')](_0x1e56('0x4a'),_0x1d64d2['name']),'trigger:browser:url',{'uri':util[_0x1e56('0xc')](_0x1e56('0x54'),_0x612d82[_0x1e56('0x22')],_0x9d955b['id'])});}})[_0x1e56('0x4c')](function(_0x20cee2){logger['error'](_0x1e56('0x50'),JSON[_0x1e56('0x2f')](_0x20cee2));});};exports[_0x1e56('0x55')]=function(_0x19632b,_0x549951,_0x55bf49,_0x1c5b2d,_0x2d92a1,_0x14cc6b){var _0x58d671,_0x3a20bb;_0x14cc6b[_0x1e56('0x22')]=intUtil[_0x1e56('0x40')](_0x14cc6b['remoteUri']);_0x14cc6b['serverUrl']=intUtil[_0x1e56('0x40')](_0x14cc6b['serverUrl']);if(_0x2d92a1&&_0x2d92a1[_0x1e56('0x41')]){logger[_0x1e56('0xb')]('['+_0x549951[_0x1e56('0x56')][_0x1e56('0x57')]()+']',_0x1e56('0x43'));_0x549951[_0x1e56('0x51')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x14cc6b[_0x1e56('0x3f')],_0x549951[_0x1e56('0x45')],md5(_0x549951['uniqueid']));}else{_0x549951[_0x1e56('0x51')]='';}headers['Authorization']=getAuth(_0x14cc6b);return getUser(_0x14cc6b,'')[_0x1e56('0x23')](function(_0x26b193){_0x58d671=_0x26b193;logger['info']('The\x20User\x20ID\x20is:',_0x58d671['id']);return getEndUser(_0x14cc6b,_0x549951[_0x1e56('0xe')],_0x549951[_0x1e56('0xf')]);})['then'](function(_0x49ee33){_0x3a20bb=_0x49ee33;logger['info'](_0x1e56('0x48'),_0x3a20bb['id']);return getTicket(_0x14cc6b,_0x58d671,_0x3a20bb,_0x55bf49,_0x549951);})[_0x1e56('0x23')](function(_0x1910e1){if(_0x1910e1){logger['info'](_0x1e56('0x1a'));logger[_0x1e56('0xb')]('The\x20Ticket\x20ID\x20is:',_0x1910e1['id']);}})[_0x1e56('0x4c')](function(_0x8ba7cc){logger[_0x1e56('0x4d')]('['+_0x549951[_0x1e56('0x56')]['toUpperCase']()+']',JSON[_0x1e56('0x2f')](_0x8ba7cc));});}; \ No newline at end of file +var _0xe5e5=['[OUTBOUND]','error','unmanaged','toUpperCase','catch','lastevent','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','
','name','Fields','keyBy','custom_fields','value','remoteUri','then','Ticket\x20created!','%s/api/v2/agents','Agent\x20found!','find','contact','email','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','%s/api/v2/contacts','Enduser\x20created.','apiKey','base64','debug','[HTTP]','stringify','defaults','GET','length','forEach','includes','string','type','nameField','customField','toLowerCase','toString','idField','content','variable','variableName','push','customVariable','Variable','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','outbound','recordingFormat'];(function(_0x4eb653,_0x369ac0){var _0x553c9c=function(_0x20ef68){while(--_0x20ef68){_0x4eb653['push'](_0x4eb653['shift']());}};_0x553c9c(++_0x369ac0);}(_0xe5e5,0xb2));var _0x5e5e=function(_0x39f559,_0x2ad5bc){_0x39f559=_0x39f559-0x0;var _0x359a88=_0xe5e5[_0x39f559];return _0x359a88;};'use strict';var _=require('lodash');var rp=require(_0x5e5e('0x0'));var md5=require(_0x5e5e('0x1'));var util=require('util');var Redis=require(_0x5e5e('0x2'));var intUtil=require(_0x5e5e('0x3'));var config=require(_0x5e5e('0x4'));var logger=require(_0x5e5e('0x5'))('freshdesk');config['redis']=_['defaults'](config[_0x5e5e('0x6')],{'host':_0x5e5e('0x7'),'port':0x18eb});var io=require(_0x5e5e('0x8'))(new Redis(config[_0x5e5e('0x6')]));var headers={'Content-Type':_0x5e5e('0x9'),'Accept':_0x5e5e('0x9')};function emit(_0x57bdab,_0x55214b,_0x48612a){io['to'](_0x57bdab)[_0x5e5e('0xa')](_0x55214b,_0x48612a);}function getTicket(_0x16936a,_0x1fb875,_0x32b372,_0x32a94f,_0x42d67c){logger[_0x5e5e('0xb')](_0x5e5e('0xc'));var _0x5206cd=_[_0x5e5e('0xd')]({'responder_id':_0x1fb875['id'],'requester_id':_0x32b372['id'],'name':util[_0x5e5e('0xe')](_0x5e5e('0xf'),_0x42d67c[_0x5e5e('0x10')]),'phone':_0x42d67c[_0x5e5e('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x5e5e('0x12')](_0x32a94f[_0x5e5e('0x13')],_0x42d67c,'\x20'),'description':intUtil[_0x5e5e('0x12')](_0x32a94f['Descriptions'],_0x42d67c,_0x5e5e('0x14')),'tags':getTags(_0x32a94f['Tags'],_0x5e5e('0x15'))},getCustomFields(_0x32a94f[_0x5e5e('0x16')],_0x42d67c));_0x5206cd['custom_fields']=_['mapValues'](_[_0x5e5e('0x17')](_0x5206cd[_0x5e5e('0x18')],'id'),_0x5e5e('0x19'));return request({'uri':util[_0x5e5e('0xe')]('%s/api/v2/tickets',_0x16936a[_0x5e5e('0x1a')]),'method':'POST','body':_0x5206cd})[_0x5e5e('0x1b')](function(_0x291506){logger[_0x5e5e('0xb')](_0x5e5e('0x1c'));return _0x291506;});}function getUser(_0x14e5b2,_0x470cee){if(intUtil['validateEmail'](_0x470cee)){return request({'uri':util['format'](_0x5e5e('0x1d'),_0x14e5b2['remoteUri']),'qs':{'email':_0x470cee}})[_0x5e5e('0x1b')](function(_0x3d3e3f){if(_0x3d3e3f['length']){logger[_0x5e5e('0xb')](_0x5e5e('0x1e'));return _[_0x5e5e('0x1f')](_0x3d3e3f,function(_0x4c19df){return _0x4c19df[_0x5e5e('0x20')][_0x5e5e('0x21')]===_0x470cee;});}else{logger[_0x5e5e('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x5e5e('0xe')](_0x5e5e('0x22'),_0x14e5b2['remoteUri'])})[_0x5e5e('0x1b')](function(_0x45a4e3){logger[_0x5e5e('0xb')]('Admin\x20account\x20selected.');return _0x45a4e3;});}});}else{logger[_0x5e5e('0xb')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/api/v2/agents/me',_0x14e5b2['remoteUri'])})['then'](function(_0x3be1c2){logger[_0x5e5e('0xb')](_0x5e5e('0x23'));return _0x3be1c2;});}}function getEndUser(_0x9a0c55,_0x592651,_0x144381){logger[_0x5e5e('0xb')](_0x5e5e('0x24'),_0x144381);return request({'uri':util[_0x5e5e('0xe')]('%s/api/v2/contacts',_0x9a0c55[_0x5e5e('0x1a')]),'qs':{'phone':_0x144381}})[_0x5e5e('0x1b')](function(_0x20c665){if(_0x20c665['length']){logger[_0x5e5e('0xb')](_0x5e5e('0x25'));return _[_0x5e5e('0x1f')](_0x20c665,{'phone':_0x144381});}else{logger[_0x5e5e('0xb')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x5e5e('0xe')](_0x5e5e('0x26'),_0x9a0c55['remoteUri']),'method':'POST','body':{'name':_0x592651,'phone':_0x144381}})[_0x5e5e('0x1b')](function(_0x32bfb6){logger[_0x5e5e('0xb')](_0x5e5e('0x27'));return _0x32bfb6;});}});}function getAuth(_0x36d01d){return util[_0x5e5e('0xe')]('Basic\x20%s',new Buffer(_0x36d01d[_0x5e5e('0x28')]+':X')['toString'](_0x5e5e('0x29')));}function request(_0x49ced2){logger[_0x5e5e('0x2a')](_0x5e5e('0x2b'),JSON[_0x5e5e('0x2c')](_0x49ced2));return rp(_[_0x5e5e('0x2d')](_0x49ced2,{'method':_0x5e5e('0x2e'),'headers':headers,'json':!![]}));}function getTags(_0x5413af,_0x41b4b7){var _0x3d15d3=[];if(_0x5413af&&_0x5413af[_0x5e5e('0x2f')]>0x0){_0x3d15d3=_['map'](_0x5413af,_0x41b4b7);}return _0x3d15d3;}function getCustomFields(_0x32f080,_0x2dd60e){var _0x3486be=[];var _0x3134a7={'custom_fields':[]};if(_0x32f080[_0x5e5e('0x2f')]>0x0){_[_0x5e5e('0x30')](_0x32f080,function(_0x1b0747){if(_[_0x5e5e('0x31')]([_0x5e5e('0x32'),'picklist'],_0x1b0747[_0x5e5e('0x33')])&&_0x1b0747[_0x5e5e('0x34')]&&!_0x1b0747[_0x5e5e('0x35')]){_0x3134a7[_0x1b0747['nameField'][_0x5e5e('0x36')]()]=_0x1b0747['content'][_0x5e5e('0x37')]();}else if(_[_0x5e5e('0x31')]([_0x5e5e('0x32'),'picklist'],_0x1b0747[_0x5e5e('0x33')])&&_0x1b0747[_0x5e5e('0x38')]&&_0x1b0747[_0x5e5e('0x35')]){_0x3134a7[_0x5e5e('0x18')]['push']({'id':_0x1b0747[_0x5e5e('0x38')],'value':_0x1b0747[_0x5e5e('0x39')]['toString']()});}else if(_0x1b0747[_0x5e5e('0x33')]===_0x5e5e('0x3a')&&_0x1b0747[_0x5e5e('0x3b')]&&_0x1b0747[_0x5e5e('0x38')]&&_0x1b0747[_0x5e5e('0x35')]){_0x2dd60e[_0x1b0747['variableName']]&&_0x3134a7['custom_fields'][_0x5e5e('0x3c')]({'id':_0x1b0747[_0x5e5e('0x38')],'value':_0x2dd60e[_0x1b0747['variableName']][_0x5e5e('0x37')]()});}else if(_0x1b0747[_0x5e5e('0x33')]===_0x5e5e('0x3d')&&_0x1b0747[_0x5e5e('0x3e')]&&_0x1b0747[_0x5e5e('0x3e')][_0x5e5e('0x15')]&&_0x1b0747[_0x5e5e('0x38')]&&_0x1b0747[_0x5e5e('0x35')]){_0x2dd60e[_0x1b0747[_0x5e5e('0x3e')][_0x5e5e('0x15')][_0x5e5e('0x36')]()]&&_0x3134a7[_0x5e5e('0x18')][_0x5e5e('0x3c')]({'id':_0x1b0747[_0x5e5e('0x38')],'value':_0x2dd60e[_0x1b0747[_0x5e5e('0x3e')][_0x5e5e('0x15')][_0x5e5e('0x36')]()][_0x5e5e('0x37')]()});}});}return _0x3134a7;}exports['queue']=function(_0x82796a,_0xbfaf72,_0x55a491,_0x2b22d1,_0x138703,_0x3b2b86){var _0x5c2fa3,_0x1c28a6;_0x3b2b86[_0x5e5e('0x1a')]=intUtil[_0x5e5e('0x3f')](_0x3b2b86[_0x5e5e('0x1a')]);_0x3b2b86[_0x5e5e('0x40')]=intUtil['stripTrailingSlash'](_0x3b2b86[_0x5e5e('0x40')]);if(_0x138703&&_0x138703['monitor_format']){logger['info'](_0x5e5e('0x41'),_0x5e5e('0x42'));_0xbfaf72[_0x5e5e('0x43')]=util[_0x5e5e('0xe')](_0x5e5e('0x44'),_0x3b2b86[_0x5e5e('0x40')],_0xbfaf72[_0x5e5e('0x45')],md5(_0xbfaf72[_0x5e5e('0x45')]));}else{_0xbfaf72[_0x5e5e('0x43')]='';}headers[_0x5e5e('0x46')]=getAuth(_0x3b2b86);return getUser(_0x3b2b86,_0x2b22d1[_0x5e5e('0x21')])[_0x5e5e('0x1b')](function(_0x5cdf46){_0x5c2fa3=_0x5cdf46;logger[_0x5e5e('0xb')](_0x5e5e('0x47'),_0x5c2fa3['id']);return getEndUser(_0x3b2b86,_0xbfaf72[_0x5e5e('0x10')],_0xbfaf72['calleridnum']);})['then'](function(_0x4b0380){_0x1c28a6=_0x4b0380;logger[_0x5e5e('0xb')](_0x5e5e('0x48'),_0x1c28a6['id']);return getTicket(_0x3b2b86,_0x5c2fa3,_0x1c28a6,_0x55a491,_0xbfaf72);})['then'](function(_0x407a2a){if(_0x407a2a&&_0x407a2a['id']){logger[_0x5e5e('0xb')](_0x5e5e('0x1c'));logger[_0x5e5e('0xb')](_0x5e5e('0x49'),_0x407a2a['id']);logger['info'](_0x5e5e('0x41'),_0x5e5e('0x4a'));emit(util[_0x5e5e('0xe')](_0x5e5e('0x4b'),_0x2b22d1[_0x5e5e('0x15')]),_0x5e5e('0x4c'),{'uri':util[_0x5e5e('0xe')](_0x5e5e('0x4d'),_0x3b2b86[_0x5e5e('0x1a')],_0x407a2a['id'])});}})['catch'](function(_0x840dce){logger['error'](_0x5e5e('0x41'),JSON[_0x5e5e('0x2c')](_0x840dce));});};exports[_0x5e5e('0x4e')]=function(_0x543530,_0x450087,_0x4ff680,_0x18d91d,_0x553b90,_0x44e138,_0x523742){var _0x4f3cab,_0x53b13b;_0x44e138[_0x5e5e('0x1a')]=intUtil[_0x5e5e('0x3f')](_0x44e138[_0x5e5e('0x1a')]);_0x44e138[_0x5e5e('0x40')]=intUtil[_0x5e5e('0x3f')](_0x44e138[_0x5e5e('0x40')]);if(_0x523742&&_0x523742[_0x5e5e('0x4f')]&&_0x523742[_0x5e5e('0x4f')]!=='none'){logger[_0x5e5e('0xb')](_0x5e5e('0x50'),_0x5e5e('0x42'));_0x450087[_0x5e5e('0x43')]=util[_0x5e5e('0xe')](_0x5e5e('0x44'),_0x44e138[_0x5e5e('0x40')],_0x450087[_0x5e5e('0x45')],md5(_0x450087['uniqueid']));}headers[_0x5e5e('0x46')]=getAuth(_0x44e138);return getUser(_0x44e138,_0x18d91d[_0x5e5e('0x21')])[_0x5e5e('0x1b')](function(_0x2682bc){_0x4f3cab=_0x2682bc;logger['info'](_0x5e5e('0x47'),_0x4f3cab['id']);return getEndUser(_0x44e138,_0x450087['destcalleridname'],_0x450087['destcalleridnum']);})['then'](function(_0x208097){_0x53b13b=_0x208097;logger['info'](_0x5e5e('0x48'),_0x53b13b['id']);return getTicket(_0x44e138,_0x4f3cab,_0x53b13b,_0x4ff680,_0x450087);})['then'](function(_0x2c3f0a){if(_0x2c3f0a&&_0x2c3f0a['id']){logger[_0x5e5e('0xb')](_0x5e5e('0x1c'));logger[_0x5e5e('0xb')](_0x5e5e('0x49'),_0x2c3f0a['id']);logger[_0x5e5e('0xb')](_0x5e5e('0x50'),_0x5e5e('0x4a'));emit(util['format'](_0x5e5e('0x4b'),_0x18d91d[_0x5e5e('0x15')]),'trigger:browser:url',{'uri':util['format']('%s/helpdesk/tickets/%d',_0x44e138[_0x5e5e('0x1a')],_0x2c3f0a['id'])});}})['catch'](function(_0x5e504c){logger[_0x5e5e('0x51')](_0x5e5e('0x50'),JSON[_0x5e5e('0x2c')](_0x5e504c));});};exports[_0x5e5e('0x52')]=function(_0x4d6bca,_0x69706e,_0x28126a,_0x22cc66,_0xc2d250,_0x16b1fe){var _0x7c7973,_0xce2839;_0x16b1fe[_0x5e5e('0x1a')]=intUtil[_0x5e5e('0x3f')](_0x16b1fe[_0x5e5e('0x1a')]);_0x16b1fe[_0x5e5e('0x40')]=intUtil[_0x5e5e('0x3f')](_0x16b1fe[_0x5e5e('0x40')]);if(_0xc2d250&&_0xc2d250['monitor_format']){logger[_0x5e5e('0xb')]('['+_0x69706e['lastevent'][_0x5e5e('0x53')]()+']',_0x5e5e('0x42'));_0x69706e[_0x5e5e('0x43')]=util[_0x5e5e('0xe')](_0x5e5e('0x44'),_0x16b1fe[_0x5e5e('0x40')],_0x69706e['uniqueid'],md5(_0x69706e[_0x5e5e('0x45')]));}else{_0x69706e['recordingURL']='';}headers[_0x5e5e('0x46')]=getAuth(_0x16b1fe);return getUser(_0x16b1fe,'')[_0x5e5e('0x1b')](function(_0x275dad){_0x7c7973=_0x275dad;logger['info'](_0x5e5e('0x47'),_0x7c7973['id']);return getEndUser(_0x16b1fe,_0x69706e[_0x5e5e('0x10')],_0x69706e['calleridnum']);})[_0x5e5e('0x1b')](function(_0x47bf1c){_0xce2839=_0x47bf1c;logger['info'](_0x5e5e('0x48'),_0xce2839['id']);return getTicket(_0x16b1fe,_0x7c7973,_0xce2839,_0x28126a,_0x69706e);})[_0x5e5e('0x1b')](function(_0x57491a){if(_0x57491a){logger['info'](_0x5e5e('0x1c'));logger[_0x5e5e('0xb')]('The\x20Ticket\x20ID\x20is:',_0x57491a['id']);}})[_0x5e5e('0x54')](function(_0x2c798b){logger[_0x5e5e('0x51')]('['+_0x69706e[_0x5e5e('0x55')]['toUpperCase']()+']',JSON['stringify'](_0x2c798b));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshsales.js b/server/services/ami/trigger/integration/freshsales.js index 3c3126e..67438a3 100644 --- a/server/services/ami/trigger/integration/freshsales.js +++ b/server/services/ami/trigger/integration/freshsales.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1e69=['recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','moment','bluebird','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','GET','/api/selector/owners','headers','Getting\x20admin\x20information','length','email','adminEmail','info','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','message','Getting\x20user\x20list','then','users','Getting\x20user\x20with\x20email','agentEmail','userEmail','userId','User\x20found:','Admin\x20selected','error','/api/lookup?q=','&f=','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','contactNumber','endUserId','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','getString','Descriptions','Contact','task','Task\x20created:','ticketId','user:%s','trigger:browser:url','Token\x20token=','remoteUri','stripTrailingSlash','username','toLowerCase','destcalleridnum','calleridnum','unmanaged','outbound','monitor_format','[QUEUE]','recordingURL'];(function(_0x256961,_0x3768d1){var _0xbd1500=function(_0x4f2b73){while(--_0x4f2b73){_0x256961['push'](_0x256961['shift']());}};_0xbd1500(++_0x3768d1);}(_0x1e69,0xa4));var _0x91e6=function(_0xd274ec,_0x6b590b){_0xd274ec=_0xd274ec-0x0;var _0x5345c8=_0x1e69[_0xd274ec];return _0x5345c8;};'use strict';var _=require(_0x91e6('0x0'));var rp=require(_0x91e6('0x1'));var md5=require('md5');var util=require('util');var moment=require(_0x91e6('0x2'));var Promise=require(_0x91e6('0x3'));var Redis=require(_0x91e6('0x4'));var intUtil=require('./util');var config=require(_0x91e6('0x5'));var logger=require(_0x91e6('0x6'))('freshsales');config[_0x91e6('0x7')]=_[_0x91e6('0x8')](config[_0x91e6('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x91e6('0x7')]));function getAdminId(_0x5d506d,_0x5005a1,_0x312470,_0x46a85e){return new Promise(function(_0xd43b00,_0x5a8278){var _0x2b6d1b=![];var _0x486cfe={'method':_0x91e6('0x9'),'uri':_0x46a85e+_0x91e6('0xa'),'json':!![]};_0x486cfe[_0x91e6('0xb')]=_0x312470;logger['info'](_0x91e6('0xc'));return rp(_0x486cfe)['then'](function(_0x3d0e65){if(_0x3d0e65){var _0xbff4e1=_0x3d0e65['users'];var _0x131b63=null;for(_0x131b63=0x0;_0x131b63<_0xbff4e1[_0x91e6('0xd')];_0x131b63++){if(_0xbff4e1[_0x131b63][_0x91e6('0xe')]===_0x5d506d[_0x91e6('0xf')]){_0x5d506d['adminId']=_0xbff4e1[_0x131b63]['id'];_0x2b6d1b=!![];}}if(_0x2b6d1b){logger[_0x91e6('0x10')](_0x91e6('0x11'),_0x5d506d[_0x91e6('0x12')]);_0xd43b00(_0x5d506d);}else{_0x5a8278({'statusCode':0x194,'message':_0x91e6('0x13')});}}else{_0x5a8278({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x91e6('0x14')](function(_0x1e9806){logger['error']('['+[_0x5005a1[_0x91e6('0x15')]()]+']',_0x1e9806[_0x91e6('0x16')]);_0x5a8278(_0x1e9806);});});}function getUser(_0x2c3f3c,_0x3532a2,_0x3ba56e){return function(_0x429bb1){return new Promise(function(_0x11ffb6,_0x8619f6){var _0x3dad72={'method':_0x91e6('0x9'),'uri':_0x3ba56e+_0x91e6('0xa'),'json':!![]};_0x3dad72['headers']=_0x3532a2;logger[_0x91e6('0x10')](_0x91e6('0x17'));return rp(_0x3dad72)[_0x91e6('0x18')](function(_0xee3c36){if(_0xee3c36){var _0x2388ef=_0xee3c36[_0x91e6('0x19')];var _0x33fe8f=![];var _0x1d1d1d=null;if(_0x429bb1['agentEmail']!==null){logger[_0x91e6('0x10')](_0x91e6('0x1a'),_0x429bb1[_0x91e6('0x1b')]);_0x429bb1[_0x91e6('0x1c')]=_0x429bb1[_0x91e6('0x1b')];for(_0x1d1d1d=0x0;_0x1d1d1d<_0x2388ef[_0x91e6('0xd')];_0x1d1d1d++){if(_0x2388ef[_0x1d1d1d][_0x91e6('0xe')]===_0x429bb1[_0x91e6('0x1b')]){_0x33fe8f=!![];_0x429bb1[_0x91e6('0x1d')]=_0x2388ef[_0x1d1d1d]['id'];logger[_0x91e6('0x10')](_0x91e6('0x1e'),_0x429bb1[_0x91e6('0x1d')]);}}}if(!_0x33fe8f){logger[_0x91e6('0x10')](_0x91e6('0x1f'));_0x429bb1[_0x91e6('0x1c')]=_0x429bb1[_0x91e6('0xf')];_0x429bb1['userId']=_0x429bb1[_0x91e6('0x12')];_0x33fe8f=!![];}if(_0x33fe8f){_0x11ffb6(_0x429bb1);}else{_0x8619f6({'statusCode':0x194,'message':_0x91e6('0x13')});}}else{_0x8619f6({'statusCode':0x194,'message':_0x91e6('0x13')});}})['catch'](function(_0xff1b9a){logger[_0x91e6('0x20')]('['+[_0x2c3f3c['toUpperCase']()]+']',_0xff1b9a[_0x91e6('0x16')]);_0x8619f6(_0xff1b9a);});});};}function searchContact(_0x85d462,_0x46da0a,_0x3a6af4,_0xe2c4ab){return new Promise(function(_0x4ace75,_0x9b50cb){var _0x4a7a7d={'method':_0x91e6('0x9'),'headers':_0x46da0a,'uri':_0x85d462+_0x91e6('0x21')+_0xe2c4ab+_0x91e6('0x22')+_0x3a6af4+'&entities=contact','json':!![]};rp(_0x4a7a7d)[_0x91e6('0x18')](function(_0x415b90){var _0x518e3a=_[_0x91e6('0x23')](_0x415b90[_0x91e6('0x24')]['contacts'],[_0x3a6af4,_0xe2c4ab]);_0x4ace75(_0x518e3a);})[_0x91e6('0x14')](function(_0x2dd45d){_0x9b50cb(_0x2dd45d);});});}function getEndUser(_0x28cd0a,_0x545b62,_0x25a7e7){return function(_0x3e21ab){return new Promise(function(_0xc9fc3,_0xb88401){logger[_0x91e6('0x10')](util[_0x91e6('0x25')](_0x91e6('0x26'),_0x3e21ab['contactNumber']));searchContact(_0x25a7e7,_0x545b62,_0x91e6('0x27'),_0x3e21ab[_0x91e6('0x28')])[_0x91e6('0x18')](function(_0xf7e14b){if(_0xf7e14b){_0x3e21ab[_0x91e6('0x29')]=_0xf7e14b['id'];logger[_0x91e6('0x10')]('Contact\x20found\x20mobile_number:',_0x3e21ab[_0x91e6('0x29')]);return _0xc9fc3(_0x3e21ab);}searchContact(_0x25a7e7,_0x545b62,_0x91e6('0x2a'),_0x3e21ab[_0x91e6('0x28')])[_0x91e6('0x18')](function(_0x5a6d54){if(_0x5a6d54){_0x3e21ab['endUserId']=_0x5a6d54['id'];logger[_0x91e6('0x10')](_0x91e6('0x2b'),_0x3e21ab['endUserId']);return _0xc9fc3(_0x3e21ab);}createEndUser(_0x3e21ab,_0x28cd0a,_0x545b62,_0x25a7e7)[_0x91e6('0x18')](function(_0x52ee54){logger[_0x91e6('0x10')](_0x91e6('0x2c'),_0x52ee54[_0x91e6('0x29')]);return _0xc9fc3(_0x52ee54);});});})['catch'](function(_0x4ee295){_0xb88401(_0x4ee295);});});};}function createEndUser(_0x28d269,_0x443e12,_0x311611,_0x5bc8cc){return new Promise(function(_0x56a686,_0x314737){var _0x234850=moment();var _0x29ee65={'method':_0x91e6('0x2d'),'uri':_0x5bc8cc+'/api/contacts','body':{'contact':{'last_name':_0x28d269[_0x91e6('0x28')],'work_number':_0x28d269['contactNumber'],'mobile_number':_0x28d269[_0x91e6('0x28')],'owner_id':_0x28d269['userId'],'created_at':_0x234850['format'](_0x91e6('0x2e'))}},'json':!![]};_0x29ee65[_0x91e6('0xb')]=_0x311611;logger['info'](_0x91e6('0x2f'));return rp(_0x29ee65)[_0x91e6('0x18')](function(_0x30ffef){_0x28d269['endUserId']=_0x30ffef[_0x91e6('0x30')]['id'];_0x56a686(_0x28d269);})[_0x91e6('0x14')](function(_0x555e2d){logger[_0x91e6('0x20')]('['+[_0x443e12[_0x91e6('0x15')]()]+']',_0x555e2d[_0x91e6('0x16')]);_0x314737(_0x555e2d['message']);});});}function getTicket(_0x490420,_0x2013bb,_0xc4cdba,_0x275309,_0x2139b5){return function(_0x250ee4){logger[_0x91e6('0x10')](_0x91e6('0x31'));return new Promise(function(_0x316440,_0x281b55){var _0x3c0917=moment();var _0x4a128b={'method':_0x91e6('0x2d'),'uri':_0xc4cdba+'/api/tasks','body':{'title':intUtil[_0x91e6('0x32')](_0x275309['Subjects'],_0x2139b5,'\x20'),'description':intUtil['getString'](_0x275309[_0x91e6('0x33')],_0x2139b5,'\x0a'),'owner_id':_0x250ee4[_0x91e6('0x1d')],'creater_id':_0x250ee4['adminId'],'targetable_id':_0x250ee4['endUserId'],'targetable_type':_0x91e6('0x34'),'created_at':_0x3c0917['format'](_0x91e6('0x2e')),'due_date':_0x3c0917['add'](0x1e,'m')[_0x91e6('0x25')](_0x91e6('0x2e'))},'json':!![]};_0x4a128b[_0x91e6('0xb')]=_0x2013bb;return rp(_0x4a128b)[_0x91e6('0x18')](function(_0xd9275c){_0x250ee4['ticketId']=_0xd9275c[_0x91e6('0x35')]['id'];logger['info'](_0x91e6('0x36'),_0x250ee4[_0x91e6('0x37')]);_0x316440(_0x250ee4);})[_0x91e6('0x14')](function(_0x525604){logger[_0x91e6('0x20')]('['+[_0x490420[_0x91e6('0x15')]()]+']',_0x525604['message']);_0x281b55(_0x525604[_0x91e6('0x16')]);});});};}function emit(_0x3ea734,_0x3775e1,_0x5848f3){var _0x55b05d={'uri':_0x3ea734+'/contacts/'+_0x5848f3};io['to'](util['format'](_0x91e6('0x38'),_0x3775e1))['emit'](_0x91e6('0x39'),_0x55b05d);}exports['cs']=function(_0x19767b,_0x1ed936,_0x390d56,_0x426755,_0xd302b7,_0x5b31bf,_0x3fa1d6,_0x216ce3){var _0x355ab9={};var _0x23d165={'Authorization':_0x91e6('0x3a')+_0x5b31bf['apiKey']};_0x5b31bf[_0x91e6('0x3b')]=intUtil[_0x91e6('0x3c')](_0x5b31bf[_0x91e6('0x3b')]);_0x5b31bf['serverUrl']=intUtil[_0x91e6('0x3c')](_0x5b31bf['serverUrl']);var _0x17a243=_0x5b31bf['remoteUri'];_0x355ab9['adminEmail']=_0x5b31bf[_0x91e6('0x3d')];_0x355ab9[_0x91e6('0x28')]=_0x216ce3[_0x91e6('0x3e')]()==='outbound'?_0x1ed936[_0x91e6('0x3f')]:_0x1ed936[_0x91e6('0x40')];_0x355ab9['callDirection']=_0x216ce3==='queue'||_0x216ce3===_0x91e6('0x41')?'queue':_0x91e6('0x42');if(_0x426755){_0x355ab9[_0x91e6('0x1b')]=_0x426755[_0x91e6('0xe')];}var _0x5e4047=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5b31bf['serverUrl'],_0x1ed936['uniqueid'],md5(_0x1ed936['uniqueid']));if(_0xd302b7&&_0xd302b7[_0x91e6('0x43')]){logger[_0x91e6('0x10')](_0x91e6('0x44'),'Recording\x20is\x20enabled!');_0x1ed936[_0x91e6('0x45')]=_0x5e4047;}else if(_0x3fa1d6&&_0x3fa1d6[_0x91e6('0x46')]&&_0x3fa1d6['recordingFormat']!==_0x91e6('0x47')){logger[_0x91e6('0x10')](_0x91e6('0x48'),'Recording\x20is\x20enabled!');_0x1ed936[_0x91e6('0x45')]=_0x5e4047;}else{_0x1ed936['recordingURL']='';}return getAdminId(_0x355ab9,_0x216ce3,_0x23d165,_0x17a243)[_0x91e6('0x18')](getUser(_0x216ce3,_0x23d165,_0x17a243))[_0x91e6('0x18')](getEndUser(_0x216ce3,_0x23d165,_0x17a243))[_0x91e6('0x18')](getTicket(_0x216ce3,_0x23d165,_0x17a243,_0x390d56,_0x1ed936))[_0x91e6('0x18')](function(_0x4b8c98){logger['info'](util[_0x91e6('0x25')](_0x91e6('0x49'),_0x4b8c98['ticketId']));if(_0x216ce3!==_0x91e6('0x41')){logger[_0x91e6('0x10')]('['+[_0x216ce3[_0x91e6('0x15')]()]+']',_0x91e6('0x4a'));emit(_0x17a243,_0x426755[_0x91e6('0x4b')],_0x4b8c98['endUserId']);}})[_0x91e6('0x14')](function(_0x3f9106){logger[_0x91e6('0x20')]('['+[_0x216ce3[_0x91e6('0x15')]()]+_0x91e6('0x4c'),util[_0x91e6('0x4d')](_0x3f9106,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x3c72=['Contact\x20found\x20work_number:','POST','format','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','getString','Subjects','YYYY-MM-DDTHH:mm:ss','add','task','ticketId','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','remoteUri','stripTrailingSlash','serverUrl','username','destcalleridnum','calleridnum','callDirection','queue','unmanaged','outbound','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','moment','bluebird','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','users','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','Getting\x20user\x20list','then','Getting\x20user\x20with\x20email','agentEmail','userEmail','length','userId','User\x20found:','Admin\x20selected','toUpperCase','message','&f=','&entities=contact','find','contacts','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','endUserId','Contact\x20found\x20mobile_number:'];(function(_0x39484b,_0x4fd8ad){var _0x2190b5=function(_0x14ffb5){while(--_0x14ffb5){_0x39484b['push'](_0x39484b['shift']());}};_0x2190b5(++_0x4fd8ad);}(_0x3c72,0x70));var _0x23c7=function(_0x2a0811,_0x48487c){_0x2a0811=_0x2a0811-0x0;var _0x4ceed0=_0x3c72[_0x2a0811];return _0x4ceed0;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require('md5');var util=require('util');var moment=require(_0x23c7('0x0'));var Promise=require(_0x23c7('0x1'));var Redis=require(_0x23c7('0x2'));var intUtil=require('./util');var config=require(_0x23c7('0x3'));var logger=require(_0x23c7('0x4'))('freshsales');config[_0x23c7('0x5')]=_[_0x23c7('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x23c7('0x7'))(new Redis(config[_0x23c7('0x5')]));function getAdminId(_0x4183d0,_0x525344,_0x2c1052,_0x9401d8){return new Promise(function(_0x1d1306,_0x52068f){var _0x4f166a=![];var _0x4c21d7={'method':_0x23c7('0x8'),'uri':_0x9401d8+_0x23c7('0x9'),'json':!![]};_0x4c21d7[_0x23c7('0xa')]=_0x2c1052;logger[_0x23c7('0xb')](_0x23c7('0xc'));return rp(_0x4c21d7)['then'](function(_0x5537dd){if(_0x5537dd){var _0x3782cc=_0x5537dd[_0x23c7('0xd')];var _0x4ceb1=null;for(_0x4ceb1=0x0;_0x4ceb1<_0x3782cc['length'];_0x4ceb1++){if(_0x3782cc[_0x4ceb1][_0x23c7('0xe')]===_0x4183d0[_0x23c7('0xf')]){_0x4183d0[_0x23c7('0x10')]=_0x3782cc[_0x4ceb1]['id'];_0x4f166a=!![];}}if(_0x4f166a){logger[_0x23c7('0xb')](_0x23c7('0x11'),_0x4183d0['adminId']);_0x1d1306(_0x4183d0);}else{_0x52068f({'statusCode':0x194,'message':_0x23c7('0x12')});}}else{_0x52068f({'statusCode':0x194,'message':_0x23c7('0x12')});}})[_0x23c7('0x13')](function(_0x47f306){logger[_0x23c7('0x14')]('['+[_0x525344['toUpperCase']()]+']',_0x47f306['message']);_0x52068f(_0x47f306);});});}function getUser(_0x14fa71,_0x3f25c6,_0x48061d){return function(_0x25dfdb){return new Promise(function(_0x2b986a,_0xd9fd72){var _0x420c38={'method':'GET','uri':_0x48061d+_0x23c7('0x9'),'json':!![]};_0x420c38[_0x23c7('0xa')]=_0x3f25c6;logger[_0x23c7('0xb')](_0x23c7('0x15'));return rp(_0x420c38)[_0x23c7('0x16')](function(_0x34d876){if(_0x34d876){var _0x4f4632=_0x34d876[_0x23c7('0xd')];var _0x5405f3=![];var _0x181153=null;if(_0x25dfdb['agentEmail']!==null){logger[_0x23c7('0xb')](_0x23c7('0x17'),_0x25dfdb[_0x23c7('0x18')]);_0x25dfdb[_0x23c7('0x19')]=_0x25dfdb[_0x23c7('0x18')];for(_0x181153=0x0;_0x181153<_0x4f4632[_0x23c7('0x1a')];_0x181153++){if(_0x4f4632[_0x181153][_0x23c7('0xe')]===_0x25dfdb[_0x23c7('0x18')]){_0x5405f3=!![];_0x25dfdb[_0x23c7('0x1b')]=_0x4f4632[_0x181153]['id'];logger[_0x23c7('0xb')](_0x23c7('0x1c'),_0x25dfdb[_0x23c7('0x1b')]);}}}if(!_0x5405f3){logger[_0x23c7('0xb')](_0x23c7('0x1d'));_0x25dfdb[_0x23c7('0x19')]=_0x25dfdb[_0x23c7('0xf')];_0x25dfdb[_0x23c7('0x1b')]=_0x25dfdb[_0x23c7('0x10')];_0x5405f3=!![];}if(_0x5405f3){_0x2b986a(_0x25dfdb);}else{_0xd9fd72({'statusCode':0x194,'message':_0x23c7('0x12')});}}else{_0xd9fd72({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x23c7('0x13')](function(_0x1ae4d6){logger['error']('['+[_0x14fa71[_0x23c7('0x1e')]()]+']',_0x1ae4d6[_0x23c7('0x1f')]);_0xd9fd72(_0x1ae4d6);});});};}function searchContact(_0x1aa71e,_0x46622c,_0x2d05a2,_0x27fb7){return new Promise(function(_0x5355c6,_0x331d86){var _0x49b526={'method':'GET','headers':_0x46622c,'uri':_0x1aa71e+'/api/lookup?q='+_0x27fb7+_0x23c7('0x20')+_0x2d05a2+_0x23c7('0x21'),'json':!![]};rp(_0x49b526)[_0x23c7('0x16')](function(_0x545b14){var _0x556ca1=_[_0x23c7('0x22')](_0x545b14['contacts'][_0x23c7('0x23')],[_0x2d05a2,_0x27fb7]);_0x5355c6(_0x556ca1);})[_0x23c7('0x13')](function(_0x23fb44){_0x331d86(_0x23fb44);});});}function getEndUser(_0x3aec05,_0x3199aa,_0x346725){return function(_0x1e1845){return new Promise(function(_0x19b7fc,_0x562671){logger[_0x23c7('0xb')](util['format'](_0x23c7('0x24'),_0x1e1845[_0x23c7('0x25')]));searchContact(_0x346725,_0x3199aa,'mobile_number',_0x1e1845[_0x23c7('0x25')])['then'](function(_0xe9cb46){if(_0xe9cb46){_0x1e1845[_0x23c7('0x26')]=_0xe9cb46['id'];logger[_0x23c7('0xb')](_0x23c7('0x27'),_0x1e1845[_0x23c7('0x26')]);return _0x19b7fc(_0x1e1845);}searchContact(_0x346725,_0x3199aa,'work_number',_0x1e1845[_0x23c7('0x25')])[_0x23c7('0x16')](function(_0x4f14cb){if(_0x4f14cb){_0x1e1845[_0x23c7('0x26')]=_0x4f14cb['id'];logger[_0x23c7('0xb')](_0x23c7('0x28'),_0x1e1845[_0x23c7('0x26')]);return _0x19b7fc(_0x1e1845);}createEndUser(_0x1e1845,_0x3aec05,_0x3199aa,_0x346725)[_0x23c7('0x16')](function(_0x7195e){logger[_0x23c7('0xb')]('Contact\x20created:',_0x7195e['endUserId']);return _0x19b7fc(_0x7195e);});});})[_0x23c7('0x13')](function(_0x356a2b){_0x562671(_0x356a2b);});});};}function createEndUser(_0x287dbd,_0x28aa10,_0x5e8730,_0x60505c){return new Promise(function(_0x2b20ae,_0x1a4e24){var _0xec7a27=moment();var _0x549753={'method':_0x23c7('0x29'),'uri':_0x60505c+'/api/contacts','body':{'contact':{'last_name':_0x287dbd[_0x23c7('0x25')],'work_number':_0x287dbd['contactNumber'],'mobile_number':_0x287dbd['contactNumber'],'owner_id':_0x287dbd[_0x23c7('0x1b')],'created_at':_0xec7a27[_0x23c7('0x2a')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x549753[_0x23c7('0xa')]=_0x5e8730;logger[_0x23c7('0xb')](_0x23c7('0x2b'));return rp(_0x549753)[_0x23c7('0x16')](function(_0x6b71c0){_0x287dbd['endUserId']=_0x6b71c0[_0x23c7('0x2c')]['id'];_0x2b20ae(_0x287dbd);})[_0x23c7('0x13')](function(_0x1d7461){logger['error']('['+[_0x28aa10[_0x23c7('0x1e')]()]+']',_0x1d7461[_0x23c7('0x1f')]);_0x1a4e24(_0x1d7461[_0x23c7('0x1f')]);});});}function getTicket(_0x5b8d9e,_0x118a2e,_0x5cd7ac,_0x3e31a1,_0x1cf3a5){return function(_0x2e53e4){logger[_0x23c7('0xb')]('Creating\x20new\x20task');return new Promise(function(_0x40907,_0x38ec21){var _0x327f5e=moment();var _0x41f8a5={'method':_0x23c7('0x29'),'uri':_0x5cd7ac+'/api/tasks','body':{'title':intUtil[_0x23c7('0x2d')](_0x3e31a1[_0x23c7('0x2e')],_0x1cf3a5,'\x20'),'description':intUtil[_0x23c7('0x2d')](_0x3e31a1['Descriptions'],_0x1cf3a5,'\x0a'),'owner_id':_0x2e53e4[_0x23c7('0x1b')],'creater_id':_0x2e53e4[_0x23c7('0x10')],'targetable_id':_0x2e53e4['endUserId'],'targetable_type':'Contact','created_at':_0x327f5e[_0x23c7('0x2a')](_0x23c7('0x2f')),'due_date':_0x327f5e[_0x23c7('0x30')](0x1e,'m')[_0x23c7('0x2a')](_0x23c7('0x2f'))},'json':!![]};_0x41f8a5['headers']=_0x118a2e;return rp(_0x41f8a5)[_0x23c7('0x16')](function(_0x51c1c0){_0x2e53e4['ticketId']=_0x51c1c0[_0x23c7('0x31')]['id'];logger[_0x23c7('0xb')]('Task\x20created:',_0x2e53e4[_0x23c7('0x32')]);_0x40907(_0x2e53e4);})[_0x23c7('0x13')](function(_0x8d69c0){logger[_0x23c7('0x14')]('['+[_0x5b8d9e['toUpperCase']()]+']',_0x8d69c0[_0x23c7('0x1f')]);_0x38ec21(_0x8d69c0[_0x23c7('0x1f')]);});});};}function emit(_0x3e20d6,_0x5771f8,_0x5e83a0){var _0x1de652={'uri':_0x3e20d6+_0x23c7('0x33')+_0x5e83a0};io['to'](util['format'](_0x23c7('0x34'),_0x5771f8))[_0x23c7('0x35')](_0x23c7('0x36'),_0x1de652);}exports['cs']=function(_0x37b995,_0xdb1926,_0x41e17c,_0x5c2c49,_0x44102b,_0x9e94fd,_0x19ebcb,_0x3c2fe9){var _0x52b6f1={};var _0x3c9d62={'Authorization':_0x23c7('0x37')+_0x9e94fd['apiKey']};_0x9e94fd[_0x23c7('0x38')]=intUtil[_0x23c7('0x39')](_0x9e94fd['remoteUri']);_0x9e94fd[_0x23c7('0x3a')]=intUtil[_0x23c7('0x39')](_0x9e94fd[_0x23c7('0x3a')]);var _0x54e7c6=_0x9e94fd[_0x23c7('0x38')];_0x52b6f1[_0x23c7('0xf')]=_0x9e94fd[_0x23c7('0x3b')];_0x52b6f1[_0x23c7('0x25')]=_0x3c2fe9['toLowerCase']()==='outbound'?_0xdb1926[_0x23c7('0x3c')]:_0xdb1926[_0x23c7('0x3d')];_0x52b6f1[_0x23c7('0x3e')]=_0x3c2fe9===_0x23c7('0x3f')||_0x3c2fe9===_0x23c7('0x40')?'queue':_0x23c7('0x41');if(_0x5c2c49){_0x52b6f1[_0x23c7('0x18')]=_0x5c2c49['email'];}var _0x183147=util[_0x23c7('0x2a')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x9e94fd['serverUrl'],_0xdb1926[_0x23c7('0x42')],md5(_0xdb1926['uniqueid']));if(_0x44102b&&_0x44102b['monitor_format']){logger[_0x23c7('0xb')](_0x23c7('0x43'),_0x23c7('0x44'));_0xdb1926[_0x23c7('0x45')]=_0x183147;}else if(_0x19ebcb&&_0x19ebcb[_0x23c7('0x46')]&&_0x19ebcb[_0x23c7('0x46')]!=='none'){logger[_0x23c7('0xb')](_0x23c7('0x47'),_0x23c7('0x44'));_0xdb1926[_0x23c7('0x45')]=_0x183147;}else{_0xdb1926[_0x23c7('0x45')]='';}return getAdminId(_0x52b6f1,_0x3c2fe9,_0x3c9d62,_0x54e7c6)[_0x23c7('0x16')](getUser(_0x3c2fe9,_0x3c9d62,_0x54e7c6))[_0x23c7('0x16')](getEndUser(_0x3c2fe9,_0x3c9d62,_0x54e7c6))[_0x23c7('0x16')](getTicket(_0x3c2fe9,_0x3c9d62,_0x54e7c6,_0x41e17c,_0xdb1926))[_0x23c7('0x16')](function(_0x2a3fba){logger[_0x23c7('0xb')](util[_0x23c7('0x2a')](_0x23c7('0x48'),_0x2a3fba['ticketId']));if(_0x3c2fe9!==_0x23c7('0x40')){logger[_0x23c7('0xb')]('['+[_0x3c2fe9['toUpperCase']()]+']',_0x23c7('0x49'));emit(_0x54e7c6,_0x5c2c49[_0x23c7('0x4a')],_0x2a3fba['endUserId']);}})[_0x23c7('0x13')](function(_0x25cab1){logger[_0x23c7('0x14')]('['+[_0x3c2fe9['toUpperCase']()]+_0x23c7('0x4b'),util['inspect'](_0x25cab1,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/index.js b/server/services/ami/trigger/integration/index.js index 5699af4..950eaa3 100644 --- a/server/services/ami/trigger/integration/index.js +++ b/server/services/ami/trigger/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd5c=['unmanaged','toLowerCase','salesforce','dynamics365','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20account\x20#%s\x20not\x20found','data2','lodash','util','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','sugarcrm','freshdesk','zoho','desk','vtiger','freshsales','exec','includes','data1','find','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN'];(function(_0x5afa77,_0x17e8a5){var _0x527c05=function(_0x4677dc){while(--_0x4677dc){_0x5afa77['push'](_0x5afa77['shift']());}};_0x527c05(++_0x17e8a5);}(_0xfd5c,0x143));var _0xcfd5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd5c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xcfd5('0x0'));var util=require(_0xcfd5('0x1'));var zendesk=require('./zendesk');var salesforce=require('./salesforce');var sugarcrm=require(_0xcfd5('0x2'));var freshdesk=require(_0xcfd5('0x3'));var zoho=require(_0xcfd5('0x4'));var desk=require(_0xcfd5('0x5'));var vtiger=require(_0xcfd5('0x6'));var servicenow=require(_0xcfd5('0x7'));var dynamics365=require(_0xcfd5('0x8'));var freshsales=require(_0xcfd5('0x9'));var integrations=[_0xcfd5('0xa'),'salesforce',_0xcfd5('0xb'),_0xcfd5('0xc'),_0xcfd5('0xd'),_0xcfd5('0xe'),_0xcfd5('0xf'),'dynamics365',_0xcfd5('0x10'),'servicenow'];exports[_0xcfd5('0x11')]=function(_0x41ea04,_0x30488b,_0x475f7,_0x25ea38,_0x268b3e,_0x2b1385){if(_0x475f7){if(_[_0xcfd5('0x12')](integrations,_0x41ea04[_0xcfd5('0x13')]['toLowerCase']())){try{var _0xed6769=null;var _0x4d2e6f='';var _0x1717f8=_0x475f7[_0x41ea04[_0xcfd5('0x13')]['toLowerCase']()];if(_0x1717f8){var _0x1c0d7d=_0x1717f8[_0x41ea04['data2']];if(_0x1c0d7d){var _0x262bed=_[_0xcfd5('0x14')](_0x1c0d7d[_0xcfd5('0x15')],{'id':parseInt(_0x41ea04[_0xcfd5('0x16')],0xa)});if(_0x262bed){if(_0x25ea38){if(_0x268b3e&&_0x30488b[_0xcfd5('0x17')]){_0x4d2e6f=_0xcfd5('0x17');}else if(_0x30488b[_0xcfd5('0x18')]){_0x4d2e6f=_0xcfd5('0x19');}else{console[_0xcfd5('0x1a')](_0xcfd5('0x1b'),_0x30488b);}}else{_0x4d2e6f=_0xcfd5('0x1c');}switch(_0x41ea04[_0xcfd5('0x13')][_0xcfd5('0x1d')]()){case _0xcfd5('0xa'):zendesk[_0x4d2e6f](_0x41ea04,_0x30488b,_0x262bed,_0x25ea38,_0x268b3e,_0x1c0d7d,_0x2b1385);break;case _0xcfd5('0x1e'):salesforce[_0x4d2e6f](_0x41ea04,_0x30488b,_0x262bed,_0x25ea38,_0x268b3e,_0x1c0d7d,_0x2b1385);break;case _0xcfd5('0xb'):sugarcrm[_0x4d2e6f](_0x41ea04,_0x30488b,_0x262bed,_0x25ea38,_0x268b3e,_0x1c0d7d,_0x2b1385);break;case _0xcfd5('0xc'):freshdesk[_0x4d2e6f](_0x41ea04,_0x30488b,_0x262bed,_0x25ea38,_0x268b3e,_0x1c0d7d,_0x2b1385);break;case _0xcfd5('0xd'):zoho[_0x4d2e6f](_0x41ea04,_0x30488b,_0x262bed,_0x25ea38,_0x268b3e,_0x1c0d7d,_0x2b1385);break;case _0xcfd5('0xe'):desk[_0x4d2e6f](_0x41ea04,_0x30488b,_0x262bed,_0x25ea38,_0x268b3e,_0x1c0d7d,_0x2b1385);break;case _0xcfd5('0xf'):vtiger[_0x4d2e6f](_0x41ea04,_0x30488b,_0x262bed,_0x25ea38,_0x268b3e,_0x1c0d7d,_0x2b1385);break;case'freshsales':freshsales['cs'](_0x41ea04,_0x30488b,_0x262bed,_0x25ea38,_0x268b3e,_0x1c0d7d,_0x2b1385,_0x4d2e6f);break;case'servicenow':servicenow['cs'](_0x41ea04,_0x30488b,_0x262bed,_0x25ea38,_0x268b3e,_0x1c0d7d,_0x2b1385,_0x4d2e6f);break;case _0xcfd5('0x1f'):dynamics365['cs'](_0x41ea04,_0x30488b,_0x262bed,_0x25ea38,_0x268b3e,_0x1c0d7d,_0x2b1385,_0x4d2e6f);break;default:console[_0xcfd5('0x1a')](_0xcfd5('0x20'));}}else{_0xed6769=require(_0xcfd5('0x21'))(_0x41ea04[_0xcfd5('0x13')][_0xcfd5('0x1d')]());_0xed6769[_0xcfd5('0x22')](_0xcfd5('0x23'),util[_0xcfd5('0x24')]('%s\x20configuration\x20#%s\x20not\x20found',_0x41ea04[_0xcfd5('0x13')][_0xcfd5('0x1d')](),_0x41ea04[_0xcfd5('0x16')]));}}else{_0xed6769=require(_0xcfd5('0x21'))(_0x41ea04[_0xcfd5('0x13')]['toLowerCase']());_0xed6769[_0xcfd5('0x22')](_0xcfd5('0x23'),util[_0xcfd5('0x24')](_0xcfd5('0x25'),_0x41ea04[_0xcfd5('0x13')][_0xcfd5('0x1d')](),_0x41ea04[_0xcfd5('0x26')]));}}else{}}catch(_0x4d5980){console[_0xcfd5('0x22')](_0x4d5980);}}}}; \ No newline at end of file +var _0x2b80=['./vtiger','./dynamics365','./freshsales','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','freshsales','servicenow','exec','includes','data1','toLowerCase','Configurations','data3','queue','routeId','outbound','EVENT\x20UNKNOWN','unmanaged','zendesk','dynamics365','log','unknown\x20integration','../../../../config/logger','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','error','%s\x20account\x20#%s\x20not\x20found','lodash','./salesforce','./sugarcrm','./freshdesk','./zoho'];(function(_0xc9b8a4,_0x3a6bf1){var _0x47cefb=function(_0x24bac5){while(--_0x24bac5){_0xc9b8a4['push'](_0xc9b8a4['shift']());}};_0x47cefb(++_0x3a6bf1);}(_0x2b80,0x16d));var _0x02b8=function(_0x3d9ee0,_0x3e106a){_0x3d9ee0=_0x3d9ee0-0x0;var _0x126719=_0x2b80[_0x3d9ee0];return _0x126719;};'use strict';var _=require(_0x02b8('0x0'));var util=require('util');var zendesk=require('./zendesk');var salesforce=require(_0x02b8('0x1'));var sugarcrm=require(_0x02b8('0x2'));var freshdesk=require(_0x02b8('0x3'));var zoho=require(_0x02b8('0x4'));var desk=require('./desk');var vtiger=require(_0x02b8('0x5'));var servicenow=require('./servicenow');var dynamics365=require(_0x02b8('0x6'));var freshsales=require(_0x02b8('0x7'));var integrations=['zendesk',_0x02b8('0x8'),_0x02b8('0x9'),_0x02b8('0xa'),_0x02b8('0xb'),_0x02b8('0xc'),_0x02b8('0xd'),'dynamics365',_0x02b8('0xe'),_0x02b8('0xf')];exports[_0x02b8('0x10')]=function(_0x47209d,_0x4c6b79,_0x39cfed,_0x10c924,_0x2b93fa,_0x21f184){if(_0x39cfed){if(_[_0x02b8('0x11')](integrations,_0x47209d[_0x02b8('0x12')][_0x02b8('0x13')]())){try{var _0x367078=null;var _0x2e52e2='';var _0x1927f9=_0x39cfed[_0x47209d[_0x02b8('0x12')][_0x02b8('0x13')]()];if(_0x1927f9){var _0x1c5819=_0x1927f9[_0x47209d['data2']];if(_0x1c5819){var _0x109e46=_['find'](_0x1c5819[_0x02b8('0x14')],{'id':parseInt(_0x47209d[_0x02b8('0x15')],0xa)});if(_0x109e46){if(_0x10c924){if(_0x2b93fa&&_0x4c6b79[_0x02b8('0x16')]){_0x2e52e2='queue';}else if(_0x4c6b79[_0x02b8('0x17')]){_0x2e52e2=_0x02b8('0x18');}else{console['log'](_0x02b8('0x19'),_0x4c6b79);}}else{_0x2e52e2=_0x02b8('0x1a');}switch(_0x47209d[_0x02b8('0x12')][_0x02b8('0x13')]()){case _0x02b8('0x1b'):zendesk[_0x2e52e2](_0x47209d,_0x4c6b79,_0x109e46,_0x10c924,_0x2b93fa,_0x1c5819,_0x21f184);break;case _0x02b8('0x8'):salesforce[_0x2e52e2](_0x47209d,_0x4c6b79,_0x109e46,_0x10c924,_0x2b93fa,_0x1c5819,_0x21f184);break;case _0x02b8('0x9'):sugarcrm[_0x2e52e2](_0x47209d,_0x4c6b79,_0x109e46,_0x10c924,_0x2b93fa,_0x1c5819,_0x21f184);break;case _0x02b8('0xa'):freshdesk[_0x2e52e2](_0x47209d,_0x4c6b79,_0x109e46,_0x10c924,_0x2b93fa,_0x1c5819,_0x21f184);break;case _0x02b8('0xb'):zoho[_0x2e52e2](_0x47209d,_0x4c6b79,_0x109e46,_0x10c924,_0x2b93fa,_0x1c5819,_0x21f184);break;case'desk':desk[_0x2e52e2](_0x47209d,_0x4c6b79,_0x109e46,_0x10c924,_0x2b93fa,_0x1c5819,_0x21f184);break;case _0x02b8('0xd'):vtiger[_0x2e52e2](_0x47209d,_0x4c6b79,_0x109e46,_0x10c924,_0x2b93fa,_0x1c5819,_0x21f184);break;case'freshsales':freshsales['cs'](_0x47209d,_0x4c6b79,_0x109e46,_0x10c924,_0x2b93fa,_0x1c5819,_0x21f184,_0x2e52e2);break;case _0x02b8('0xf'):servicenow['cs'](_0x47209d,_0x4c6b79,_0x109e46,_0x10c924,_0x2b93fa,_0x1c5819,_0x21f184,_0x2e52e2);break;case _0x02b8('0x1c'):dynamics365['cs'](_0x47209d,_0x4c6b79,_0x109e46,_0x10c924,_0x2b93fa,_0x1c5819,_0x21f184,_0x2e52e2);break;default:console[_0x02b8('0x1d')](_0x02b8('0x1e'));}}else{_0x367078=require(_0x02b8('0x1f'))(_0x47209d[_0x02b8('0x12')][_0x02b8('0x13')]());_0x367078['error'](_0x02b8('0x20'),util[_0x02b8('0x21')](_0x02b8('0x22'),_0x47209d[_0x02b8('0x12')][_0x02b8('0x13')](),_0x47209d['data3']));}}else{_0x367078=require('../../../../config/logger')(_0x47209d[_0x02b8('0x12')]['toLowerCase']());_0x367078[_0x02b8('0x23')](_0x02b8('0x20'),util[_0x02b8('0x21')](_0x02b8('0x24'),_0x47209d[_0x02b8('0x12')][_0x02b8('0x13')](),_0x47209d['data2']));}}else{}}catch(_0x36227e){console[_0x02b8('0x23')](_0x36227e);}}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/salesforce.js b/server/services/ami/trigger/integration/salesforce.js index 75f5d9d..54b4040 100644 --- a/server/services/ami/trigger/integration/salesforce.js +++ b/server/services/ami/trigger/integration/salesforce.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdde1=['recordingFormat','none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','%s/%s/e','instanceUrl','Salesforce\x20account\x20type\x20not\x20recognized','catch','unmanaged','lastevent','calleridnum','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','emit','assign','getString','Subjects','ticketType','ActivityDate','IsReminderSet','IsRecurrence','endUserType','contact','WhoId','Case','ContactId','AccountId','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','isNil','validateEmail','sobject','User','find','length','Email','info','Agent\x20%s\x20found.','resolve','user_id','display_name','identity','then','moduleSearch','contact_lead','additionalSearchContact','merge','$or','Contact','execute','additionalSearchLead','Lead','Account','cloneDeep','lead','account','additionalSearchAccount','Name','Phone','attributes','type','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','LastName','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','','Company','No\x20Company','upperFirst','forEach','string','picklist','idField','variable','variableName','toString','customVariable','Variable','name','toLowerCase','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientSecret','username','queue','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','format','serverUrl','uniqueid','email','calleridname','Fields','integrationTab','user:%s','trigger:salesforce:display','newTab','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','[QUEUE]','outbound'];(function(_0x3cb773,_0x3ba3b7){var _0x520be6=function(_0x5c8659){while(--_0x5c8659){_0x3cb773['push'](_0x3cb773['shift']());}};_0x520be6(++_0x3ba3b7);}(_0xdde1,0x10c));var _0x1dde=function(_0x113945,_0x102a24){_0x113945=_0x113945-0x0;var _0x5836c8=_0xdde1[_0x113945];return _0x5836c8;};'use strict';var _=require(_0x1dde('0x0'));var rp=require(_0x1dde('0x1'));var moment=require(_0x1dde('0x2'));var BPromise=require(_0x1dde('0x3'));var md5=require(_0x1dde('0x4'));var jsforce=require('jsforce');var util=require(_0x1dde('0x5'));var Redis=require(_0x1dde('0x6'));var intUtil=require(_0x1dde('0x7'));var config=require(_0x1dde('0x8'));var logger=require(_0x1dde('0x9'))(_0x1dde('0xa'));config[_0x1dde('0xb')]=_[_0x1dde('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x383377,_0x32e8d0,_0x152a56){io['to'](_0x383377)[_0x1dde('0xd')](_0x32e8d0,_0x152a56);}function getTicket(_0x34f882,_0x330dfd,_0x403a38,_0x2c936c,_0x3b9635,_0x568d88,_0xc97d56,_0x4e70b5){var _0x5646fb=Object[_0x1dde('0xe')]({},{'OwnerId':_0x330dfd['id'],'Subject':intUtil[_0x1dde('0xf')](_0x2c936c[_0x1dde('0x10')],_0x3b9635,'\x20'),'Description':intUtil[_0x1dde('0xf')](_0x2c936c['Descriptions'],_0x3b9635,'\x0a')},getCustomFields(_0x568d88,_0x3b9635));if(_0x403a38){if(_0x2c936c[_0x1dde('0x11')]==='Task'){_0x5646fb[_0x1dde('0x12')]=moment['utc']();_0x5646fb[_0x1dde('0x13')]=![];_0x5646fb[_0x1dde('0x14')]=![];if(_0x403a38[_0x1dde('0x15')]===_0x1dde('0x16')||_0x403a38[_0x1dde('0x15')]==='lead'){_0x5646fb[_0x1dde('0x17')]=_0x403a38['id'];}else if(_0x403a38[_0x1dde('0x15')]==='account'){_0x5646fb['WhatId']=_0x403a38['id'];}}else if(_0x2c936c[_0x1dde('0x11')]===_0x1dde('0x18')){if(_0x403a38[_0x1dde('0x15')]===_0x1dde('0x16')){_0x5646fb[_0x1dde('0x19')]=_0x403a38['id'];}else if(_0x403a38['endUserType']==='account'){_0x5646fb[_0x1dde('0x1a')]=_0x403a38['id'];}else if(_0x403a38[_0x1dde('0x15')]==='lead'&&_0x2c936c[_0x1dde('0x1b')]){_0x5646fb[_0x2c936c[_0x1dde('0x1b')]]=_0x403a38['id'];}else{logger['info'](_0x1dde('0x1c'));}}}return _0xc97d56['sobject'](_0x2c936c[_0x1dde('0x11')])[_0x1dde('0x1d')](_0x5646fb);}function getUser(_0xaffc6a,_0x3ecd0d,_0x5a3457){if(!_[_0x1dde('0x1e')](_0x3ecd0d)&&intUtil[_0x1dde('0x1f')](_0x3ecd0d)){var _0x2527f3={'Email':_0x3ecd0d};var _0x39cb4c={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x5a3457[_0x1dde('0x20')](_0x1dde('0x21'))[_0x1dde('0x22')](_0x2527f3,_0x39cb4c)['execute']()['then'](function(_0x3c7d03){if(_0x3c7d03[_0x1dde('0x23')]){var _0x1915a3=_[_0x1dde('0x22')](_0x3c7d03,function(_0x8bf88c){return _0x8bf88c[_0x1dde('0x24')]===_0x3ecd0d;});if(_0x1915a3){logger[_0x1dde('0x25')](_0x1dde('0x26'),_0x3ecd0d);return BPromise[_0x1dde('0x27')]({'id':_0x1915a3['Id'],'name':_0x1915a3['Name']});}}else{logger[_0x1dde('0x25')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x3ecd0d);return _0x5a3457['identity']()['then'](function(_0x3f7452){return BPromise[_0x1dde('0x27')]({'id':_0x3f7452[_0x1dde('0x28')],'name':_0x3f7452[_0x1dde('0x29')]});});}});}else{logger[_0x1dde('0x25')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x3ecd0d);return _0x5a3457[_0x1dde('0x2a')]()[_0x1dde('0x2b')](function(_0x3e1caa){return BPromise['resolve']({'id':_0x3e1caa[_0x1dde('0x28')],'name':_0x3e1caa['display_name']});});}}function getEndUser(_0x5f07e1,_0x460cac,_0x3e69f7,_0x1d4f68,_0x21627a){var _0x1383b5={'$or':{'Phone':_0x1d4f68}};var _0x14415b={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x1dde('0x27')]()[_0x1dde('0x2b')](function(){logger[_0x1dde('0x25')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x1d4f68,_0x460cac['moduleSearch']);switch(_0x460cac[_0x1dde('0x2c')]){case _0x1dde('0x2d'):var _0x5c3b3b=_['cloneDeep'](_0x1383b5);if(_0x460cac[_0x1dde('0x2e')]){var _0xb376fb={};_0xb376fb[_0x460cac[_0x1dde('0x2e')]]=_0x1d4f68;_[_0x1dde('0x2f')](_0x5c3b3b[_0x1dde('0x30')],_0xb376fb);}return _0x21627a['sobject'](_0x1dde('0x31'))[_0x1dde('0x22')](_0x5c3b3b,_0x14415b)[_0x1dde('0x32')]()[_0x1dde('0x2b')](function(_0xf5c927){if(_0xf5c927&&_0xf5c927['length']){return _0xf5c927;}else{var _0x96742=_['cloneDeep'](_0x1383b5);if(_0x460cac[_0x1dde('0x33')]){var _0x373856={};_0x373856[_0x460cac[_0x1dde('0x33')]]=_0x1d4f68;_['merge'](_0x96742[_0x1dde('0x30')],_0x373856);}return _0x21627a[_0x1dde('0x20')](_0x1dde('0x34'))['find'](_0x96742,_0x14415b);}});case'account_contact_lead':var _0x2c9668=_['cloneDeep'](_0x1383b5);if(_0x460cac['additionalSearchAccount']){var _0xb376fb={};_0xb376fb[_0x460cac['additionalSearchAccount']]=_0x1d4f68;_[_0x1dde('0x2f')](_0x2c9668[_0x1dde('0x30')],_0xb376fb);}return _0x21627a[_0x1dde('0x20')](_0x1dde('0x35'))['find'](_0x2c9668,_0x14415b)[_0x1dde('0x32')]()[_0x1dde('0x2b')](function(_0x55f282){if(_0x55f282&&_0x55f282[_0x1dde('0x23')]){return _0x55f282;}else{var _0x536ac8=_[_0x1dde('0x36')](_0x1383b5);if(_0x460cac[_0x1dde('0x2e')]){var _0x116c5c={};_0x116c5c[_0x460cac[_0x1dde('0x2e')]]=_0x1d4f68;_['merge'](_0x536ac8[_0x1dde('0x30')],_0x116c5c);}return _0x21627a[_0x1dde('0x20')]('Contact')[_0x1dde('0x22')](_0x536ac8,_0x14415b)['then'](function(_0x3258b){if(_0x3258b&&_0x3258b['length']){return _0x3258b;}else{var _0x3c9a10=_[_0x1dde('0x36')](_0x1383b5);if(_0x460cac[_0x1dde('0x33')]){var _0x1b6398={};_0x1b6398[_0x460cac[_0x1dde('0x33')]]=_0x1d4f68;_[_0x1dde('0x2f')](_0x3c9a10['$or'],_0x1b6398);}return _0x21627a[_0x1dde('0x20')]('Lead')['find'](_0x3c9a10,_0x14415b);}});}});case _0x1dde('0x16'):var _0x5c3b3b=_[_0x1dde('0x36')](_0x1383b5);if(_0x460cac[_0x1dde('0x2e')]){var _0xb376fb={};_0xb376fb[_0x460cac[_0x1dde('0x2e')]]=_0x1d4f68;_[_0x1dde('0x2f')](_0x5c3b3b[_0x1dde('0x30')],_0xb376fb);}return _0x21627a['sobject'](_0x1dde('0x31'))[_0x1dde('0x22')](_0x5c3b3b,_0x14415b)[_0x1dde('0x32')]();case _0x1dde('0x37'):var _0x427d83=_['cloneDeep'](_0x1383b5);if(_0x460cac[_0x1dde('0x33')]){var _0xb376fb={};_0xb376fb[_0x460cac[_0x1dde('0x33')]]=_0x1d4f68;_[_0x1dde('0x2f')](_0x427d83[_0x1dde('0x30')],_0xb376fb);}return _0x21627a[_0x1dde('0x20')]('Lead')[_0x1dde('0x22')](_0x427d83,_0x14415b);case _0x1dde('0x38'):var _0x2c9668=_[_0x1dde('0x36')](_0x1383b5);if(_0x460cac[_0x1dde('0x39')]){var _0xb376fb={};_0xb376fb[_0x460cac[_0x1dde('0x39')]]=_0x1d4f68;_['merge'](_0x2c9668[_0x1dde('0x30')],_0xb376fb);}return _0x21627a['sobject']('Account')[_0x1dde('0x22')](_0x2c9668,_0x14415b);default:return null;}})[_0x1dde('0x2b')](function(_0x167f16){if(_0x167f16&&_0x167f16['length']){var _0x152ddb=_['first'](_0x167f16);if(_0x152ddb){return BPromise[_0x1dde('0x27')]({'id':_0x152ddb['Id'],'name':_0x152ddb[_0x1dde('0x3a')],'phone':_0x152ddb[_0x1dde('0x3b')],'endUserType':_0x152ddb[_0x1dde('0x3c')][_0x1dde('0x3d')]['toLowerCase']()});}}})[_0x1dde('0x2b')](function(_0x13dd52){if(_0x13dd52){logger[_0x1dde('0x25')](_0x1dde('0x3e'),_0x13dd52[_0x1dde('0x15')],_0x1d4f68);return BPromise[_0x1dde('0x27')](_0x13dd52);}else{logger[_0x1dde('0x25')](_0x1dde('0x3f'),_0x1d4f68);var _0x5b30f5={'Phone':_0x1d4f68};if(_0x460cac[_0x1dde('0x40')]){if(_0x460cac[_0x1dde('0x40')]===_0x1dde('0x16')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x1d4f68,_0x460cac[_0x1dde('0x40')]);_0x5b30f5[_0x1dde('0x41')]=_0x3e69f7!==''?_0x3e69f7:util['format'](_0x1dde('0x42'),_0x1d4f68);}else if(_0x460cac['moduleCreate']==='lead'){logger[_0x1dde('0x25')](_0x1dde('0x43'),_0x1d4f68,_0x460cac[_0x1dde('0x40')]);_0x5b30f5[_0x1dde('0x41')]=_0x3e69f7!==_0x1dde('0x44')?_0x3e69f7:util['format'](_0x1dde('0x42'),_0x1d4f68);_0x5b30f5[_0x1dde('0x45')]=_0x1dde('0x46');}else if(_0x460cac[_0x1dde('0x40')]===_0x1dde('0x38')){logger[_0x1dde('0x25')](_0x1dde('0x43'),_0x1d4f68,_0x460cac['moduleCreate']);_0x5b30f5[_0x1dde('0x3a')]=_0x3e69f7!==_0x1dde('0x44')?_0x3e69f7:util['format'](_0x1dde('0x42'),_0x1d4f68);}else{return null;}}return _0x21627a[_0x1dde('0x20')](_[_0x1dde('0x47')](_0x460cac['moduleCreate']))[_0x1dde('0x1d')](_0x5b30f5)[_0x1dde('0x2b')](function(_0x4af091){return BPromise[_0x1dde('0x27')]({'id':_0x4af091['id'],'endUserType':_0x460cac[_0x1dde('0x40')]});});}});}function getCustomFields(_0x4cf954,_0x5ec036){var _0x5a2564={};if(_0x4cf954[_0x1dde('0x23')]>0x0){_[_0x1dde('0x48')](_0x4cf954,function(_0x3690ba){if(_['includes']([_0x1dde('0x49'),_0x1dde('0x4a')],_0x3690ba[_0x1dde('0x3d')])&&_0x3690ba[_0x1dde('0x4b')]){_0x5a2564[_0x3690ba['idField']]=_0x3690ba['content']['toString']();}else if(_0x3690ba['type']===_0x1dde('0x4c')&&_0x3690ba[_0x1dde('0x4d')]&&_0x3690ba[_0x1dde('0x4b')]){_0x5ec036[_0x3690ba[_0x1dde('0x4d')]]&&(_0x5a2564[_0x3690ba[_0x1dde('0x4b')]]=_0x5ec036[_0x3690ba[_0x1dde('0x4d')]][_0x1dde('0x4e')]());}else if(_0x3690ba[_0x1dde('0x3d')]===_0x1dde('0x4f')&&_0x3690ba[_0x1dde('0x50')]&&_0x3690ba['Variable'][_0x1dde('0x51')]&&_0x3690ba[_0x1dde('0x4b')]){_0x5ec036[_0x3690ba['Variable'][_0x1dde('0x51')][_0x1dde('0x52')]()]&&(_0x5a2564[_0x3690ba[_0x1dde('0x4b')]]=_0x5ec036[_0x3690ba[_0x1dde('0x50')][_0x1dde('0x51')][_0x1dde('0x52')]()][_0x1dde('0x4e')]());}});}return _0x5a2564;}function getConnection(_0x4b4d9b){var _0x462b44=_0x4b4d9b[_0x1dde('0x53')][_0x1dde('0x54')](_0x4b4d9b[_0x1dde('0x55')]);var _0x493158=new jsforce[(_0x1dde('0x56'))]({'oauth2':{'loginUrl':_0x4b4d9b[_0x1dde('0x57')]||_0x1dde('0x58'),'clientId':_0x4b4d9b['clientId'],'clientSecret':_0x4b4d9b[_0x1dde('0x59')]}});return _0x493158['login'](_0x4b4d9b[_0x1dde('0x5a')],_0x462b44)['then'](function(){logger[_0x1dde('0x25')]('Connection\x20established.');return _0x493158;});}exports[_0x1dde('0x5b')]=function(_0x4a3637,_0x33fe19,_0xc07365,_0x1cf222,_0x1d51fc,_0x1d30c4){var _0x5596ed,_0x529e42,_0x5b04a1,_0x41303c;_0x1d30c4['serverUrl']=intUtil['stripTrailingSlash'](_0x1d30c4['serverUrl']);_0x1d30c4[_0x1dde('0x57')]=intUtil[_0x1dde('0x5c')](_0x1d30c4[_0x1dde('0x57')]);if(_0x1d51fc&&_0x1d51fc[_0x1dde('0x5d')]){logger[_0x1dde('0x25')]('[QUEUE]',_0x1dde('0x5e'));_0x33fe19[_0x1dde('0x5f')]=util[_0x1dde('0x60')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1d30c4[_0x1dde('0x61')],_0x33fe19['uniqueid'],md5(_0x33fe19[_0x1dde('0x62')]));}else{_0x33fe19[_0x1dde('0x5f')]='';}return getConnection(_0x1d30c4)[_0x1dde('0x2b')](function(_0x2881f6){_0x41303c=_0x2881f6;return getUser(_0x1d30c4,_0x1cf222[_0x1dde('0x63')],_0x41303c);})['then'](function(_0x236e7b){_0x5596ed=_0x236e7b;return getEndUser(_0x1d30c4,_0xc07365,_0x33fe19[_0x1dde('0x64')],_0x33fe19['calleridnum'],_0x41303c);})['then'](function(_0xf60c2d){_0x529e42=_0xf60c2d;return getTicket(_0x1d30c4,_0x5596ed,_0x529e42,_0xc07365,_0x33fe19,_0xc07365[_0x1dde('0x65')],_0x41303c,_0x1dde('0x5b'));})[_0x1dde('0x2b')](function(_0x535234){_0x5b04a1=_0x535234;logger[_0x1dde('0x25')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x5b04a1['id']);logger[_0x1dde('0x25')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x5b04a1['id'],_0x1cf222['name'],_0x1d30c4[_0x1dde('0x3d')]);switch(_0x1d30c4[_0x1dde('0x3d')]){case _0x1dde('0x66'):emit(util['format'](_0x1dde('0x67'),_0x1cf222[_0x1dde('0x51')]),_0x1dde('0x68'),{'recordId':_0x5b04a1['id']});break;case _0x1dde('0x69'):emit(util[_0x1dde('0x60')](_0x1dde('0x67'),_0x1cf222['name']),'trigger:browser:url',{'uri':util[_0x1dde('0x60')]('%s/%s/e',_0x41303c['instanceUrl'],_0x5b04a1['id'])});break;default:logger[_0x1dde('0x6a')](_0x1dde('0x6b'));}})['catch'](function(_0x14cdea){logger[_0x1dde('0x6a')](_0x1dde('0x6c'),_0x14cdea);});};exports[_0x1dde('0x6d')]=function(_0x39c20a,_0x3d3ce7,_0x477ab1,_0x5aa3cd,_0x53035c,_0xc5407b,_0x3c2fe0){var _0x4ffb3d,_0xadeb55,_0x1dd069,_0x5e1cac;_0xc5407b[_0x1dde('0x61')]=intUtil[_0x1dde('0x5c')](_0xc5407b[_0x1dde('0x61')]);_0xc5407b[_0x1dde('0x57')]=intUtil[_0x1dde('0x5c')](_0xc5407b['remoteUri']);if(_0x3c2fe0&&_0x3c2fe0[_0x1dde('0x6e')]&&_0x3c2fe0[_0x1dde('0x6e')]!==_0x1dde('0x6f')){logger[_0x1dde('0x25')]('[OUTBOUND]',_0x1dde('0x5e'));_0x3d3ce7[_0x1dde('0x5f')]=util[_0x1dde('0x60')](_0x1dde('0x70'),_0xc5407b[_0x1dde('0x61')],_0x3d3ce7['uniqueid'],md5(_0x3d3ce7[_0x1dde('0x62')]));}return getConnection(_0xc5407b)[_0x1dde('0x2b')](function(_0x380de5){_0x5e1cac=_0x380de5;return getUser(_0xc5407b,_0x5aa3cd[_0x1dde('0x63')],_0x5e1cac);})[_0x1dde('0x2b')](function(_0x2b445a){_0x4ffb3d=_0x2b445a;return getEndUser(_0xc5407b,_0x477ab1,_0x3d3ce7['destcalleridname'],_0x3d3ce7[_0x1dde('0x71')],_0x5e1cac);})['then'](function(_0x3eb42e){_0xadeb55=_0x3eb42e;return getTicket(_0xc5407b,_0x4ffb3d,_0xadeb55,_0x477ab1,_0x3d3ce7,_0x477ab1[_0x1dde('0x65')],_0x5e1cac,'outbound');})[_0x1dde('0x2b')](function(_0x51139a){_0x1dd069=_0x51139a;logger[_0x1dde('0x25')](_0x1dde('0x72'),_0x1dd069['id']);logger[_0x1dde('0x25')](_0x1dde('0x73'),_0x1dd069['id'],_0x5aa3cd['name'],_0xc5407b[_0x1dde('0x3d')]);switch(_0xc5407b[_0x1dde('0x3d')]){case _0x1dde('0x66'):emit(util[_0x1dde('0x60')](_0x1dde('0x67'),_0x5aa3cd[_0x1dde('0x51')]),'trigger:salesforce:display',{'recordId':_0x1dd069['id']});break;case _0x1dde('0x69'):emit(util['format'](_0x1dde('0x67'),_0x5aa3cd[_0x1dde('0x51')]),'trigger:browser:url',{'uri':util['format'](_0x1dde('0x74'),_0x5e1cac[_0x1dde('0x75')],_0x1dd069['id'])});break;default:logger['error']('[OUTBOUND]',_0x1dde('0x76'));}})[_0x1dde('0x77')](function(_0xa71ebd){logger['error']('[OUTBOUND]',_0xa71ebd);});};exports[_0x1dde('0x78')]=function(_0xb8ffee,_0x348847,_0x9e1180,_0xecb94c,_0xa849fb,_0x542fe0){var _0x35b6f7,_0x1a0671,_0x1e8e30,_0x1efa1d;_0x542fe0[_0x1dde('0x61')]=intUtil['stripTrailingSlash'](_0x542fe0[_0x1dde('0x61')]);_0x542fe0[_0x1dde('0x57')]=intUtil['stripTrailingSlash'](_0x542fe0[_0x1dde('0x57')]);if(_0xa849fb&&_0xa849fb[_0x1dde('0x5d')]){logger[_0x1dde('0x25')]('['+_0x348847[_0x1dde('0x79')]['toUpperCase']()+']',_0x1dde('0x5e'));_0x348847[_0x1dde('0x5f')]=util[_0x1dde('0x60')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x542fe0[_0x1dde('0x61')],_0x348847[_0x1dde('0x62')],md5(_0x348847[_0x1dde('0x62')]));}else{_0x348847[_0x1dde('0x5f')]='';}return getConnection(_0x542fe0)[_0x1dde('0x2b')](function(_0x21068a){_0x1efa1d=_0x21068a;if(!_[_0x1dde('0x1e')](_0xecb94c)){return getUser(_0x542fe0,_0xecb94c[_0x1dde('0x51')],_0x1efa1d);}else{return getUser(_0x542fe0,null,_0x1efa1d);}})['then'](function(_0x1f05c9){_0x35b6f7=_0x1f05c9;return getEndUser(_0x542fe0,_0x9e1180,_0x348847['calleridname'],_0x348847[_0x1dde('0x7a')],_0x1efa1d);})[_0x1dde('0x2b')](function(_0x5e7623){_0x1a0671=_0x5e7623;return getTicket(_0x542fe0,_0x35b6f7,_0x1a0671,_0x9e1180,_0x348847,_0x9e1180[_0x1dde('0x65')],_0x1efa1d);})['then'](function(_0x4a1738){_0x1e8e30=_0x4a1738;logger[_0x1dde('0x25')]('['+_0x348847['lastevent'][_0x1dde('0x7b')]()+_0x1dde('0x7c'),_0x1e8e30['id']);logger[_0x1dde('0x25')]('['+_0x348847['lastevent'][_0x1dde('0x7b')]()+_0x1dde('0x7d'),_0x542fe0[_0x1dde('0x3d')]);})[_0x1dde('0x77')](function(_0x2bbc5d){logger['error']('['+_0x348847[_0x1dde('0x79')]['toUpperCase']()+']',_0x2bbc5d);});}; \ No newline at end of file +var _0x5f55=['customVariable','Variable','name','toLowerCase','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','username','Connection\x20established.','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','calleridname','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','newTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','catch','[QUEUE]','outbound','recordingFormat','none','[OUTBOUND]','email','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','Salesforce\x20account\x20type\x20not\x20recognized','toUpperCase','isNil','lastevent',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','socket.io-emitter','assign','getString','Subjects','ticketType','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','lead','WhoId','account','WhatId','contact','ContactId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','validateEmail','User','find','execute','then','length','Email','Agent\x20%s\x20found.','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','resolve','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','type','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','forEach','includes','picklist','idField','variable','variableName','toString'];(function(_0x5a0fc2,_0x8ce4fb){var _0x4213f8=function(_0x352ab5){while(--_0x352ab5){_0x5a0fc2['push'](_0x5a0fc2['shift']());}};_0x4213f8(++_0x8ce4fb);}(_0x5f55,0x127));var _0x55f5=function(_0x55754e,_0x286388){_0x55754e=_0x55754e-0x0;var _0x2e9948=_0x5f55[_0x55754e];return _0x2e9948;};'use strict';var _=require(_0x55f5('0x0'));var rp=require(_0x55f5('0x1'));var moment=require(_0x55f5('0x2'));var BPromise=require(_0x55f5('0x3'));var md5=require(_0x55f5('0x4'));var jsforce=require('jsforce');var util=require(_0x55f5('0x5'));var Redis=require(_0x55f5('0x6'));var intUtil=require(_0x55f5('0x7'));var config=require(_0x55f5('0x8'));var logger=require(_0x55f5('0x9'))('salesforce');config[_0x55f5('0xa')]=_['defaults'](config[_0x55f5('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x55f5('0xb'))(new Redis(config[_0x55f5('0xa')]));function emit(_0x56a0ac,_0xf696f5,_0x390727){io['to'](_0x56a0ac)['emit'](_0xf696f5,_0x390727);}function getTicket(_0x29013e,_0x4f3df9,_0x223a00,_0xaea8e1,_0xdd31f7,_0x378dcf,_0x4b20fa,_0x3239c6){var _0x64970d=Object[_0x55f5('0xc')]({},{'OwnerId':_0x4f3df9['id'],'Subject':intUtil[_0x55f5('0xd')](_0xaea8e1[_0x55f5('0xe')],_0xdd31f7,'\x20'),'Description':intUtil[_0x55f5('0xd')](_0xaea8e1['Descriptions'],_0xdd31f7,'\x0a')},getCustomFields(_0x378dcf,_0xdd31f7));if(_0x223a00){if(_0xaea8e1[_0x55f5('0xf')]==='Task'){_0x64970d[_0x55f5('0x10')]=moment[_0x55f5('0x11')]();_0x64970d[_0x55f5('0x12')]=![];_0x64970d[_0x55f5('0x13')]=![];if(_0x223a00[_0x55f5('0x14')]==='contact'||_0x223a00[_0x55f5('0x14')]===_0x55f5('0x15')){_0x64970d[_0x55f5('0x16')]=_0x223a00['id'];}else if(_0x223a00[_0x55f5('0x14')]===_0x55f5('0x17')){_0x64970d[_0x55f5('0x18')]=_0x223a00['id'];}}else if(_0xaea8e1[_0x55f5('0xf')]==='Case'){if(_0x223a00[_0x55f5('0x14')]===_0x55f5('0x19')){_0x64970d[_0x55f5('0x1a')]=_0x223a00['id'];}else if(_0x223a00[_0x55f5('0x14')]===_0x55f5('0x17')){_0x64970d['AccountId']=_0x223a00['id'];}else if(_0x223a00['endUserType']==='lead'&&_0xaea8e1[_0x55f5('0x1b')]){_0x64970d[_0xaea8e1[_0x55f5('0x1b')]]=_0x223a00['id'];}else{logger[_0x55f5('0x1c')](_0x55f5('0x1d'));}}}return _0x4b20fa[_0x55f5('0x1e')](_0xaea8e1[_0x55f5('0xf')])[_0x55f5('0x1f')](_0x64970d);}function getUser(_0x19ae43,_0x57666d,_0x22297d){if(!_['isNil'](_0x57666d)&&intUtil[_0x55f5('0x20')](_0x57666d)){var _0x19158f={'Email':_0x57666d};var _0x4eebca={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x22297d[_0x55f5('0x1e')](_0x55f5('0x21'))[_0x55f5('0x22')](_0x19158f,_0x4eebca)[_0x55f5('0x23')]()[_0x55f5('0x24')](function(_0x2a9c94){if(_0x2a9c94[_0x55f5('0x25')]){var _0x32c46b=_[_0x55f5('0x22')](_0x2a9c94,function(_0x4dd7ee){return _0x4dd7ee[_0x55f5('0x26')]===_0x57666d;});if(_0x32c46b){logger[_0x55f5('0x1c')](_0x55f5('0x27'),_0x57666d);return BPromise['resolve']({'id':_0x32c46b['Id'],'name':_0x32c46b[_0x55f5('0x28')]});}}else{logger[_0x55f5('0x1c')](_0x55f5('0x29'),_0x57666d);return _0x22297d[_0x55f5('0x2a')]()[_0x55f5('0x24')](function(_0x254059){return BPromise[_0x55f5('0x2b')]({'id':_0x254059[_0x55f5('0x2c')],'name':_0x254059[_0x55f5('0x2d')]});});}});}else{logger['info'](_0x55f5('0x29'),_0x57666d);return _0x22297d[_0x55f5('0x2a')]()[_0x55f5('0x24')](function(_0x56c30c){return BPromise[_0x55f5('0x2b')]({'id':_0x56c30c[_0x55f5('0x2c')],'name':_0x56c30c['display_name']});});}}function getEndUser(_0x336ed2,_0x113600,_0x48d9c2,_0x5c4915,_0x5adedc){var _0x5857db={'$or':{'Phone':_0x5c4915}};var _0x5ab27b={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x55f5('0x2b')]()[_0x55f5('0x24')](function(){logger[_0x55f5('0x1c')](_0x55f5('0x2e'),_0x5c4915,_0x113600[_0x55f5('0x2f')]);switch(_0x113600[_0x55f5('0x2f')]){case _0x55f5('0x30'):var _0xb2c3fc=_[_0x55f5('0x31')](_0x5857db);if(_0x113600['additionalSearchContact']){var _0x455eff={};_0x455eff[_0x113600[_0x55f5('0x32')]]=_0x5c4915;_[_0x55f5('0x33')](_0xb2c3fc[_0x55f5('0x34')],_0x455eff);}return _0x5adedc[_0x55f5('0x1e')](_0x55f5('0x35'))['find'](_0xb2c3fc,_0x5ab27b)['execute']()[_0x55f5('0x24')](function(_0x50feef){if(_0x50feef&&_0x50feef[_0x55f5('0x25')]){return _0x50feef;}else{var _0x4d3483=_[_0x55f5('0x31')](_0x5857db);if(_0x113600[_0x55f5('0x36')]){var _0x3fe766={};_0x3fe766[_0x113600['additionalSearchLead']]=_0x5c4915;_[_0x55f5('0x33')](_0x4d3483[_0x55f5('0x34')],_0x3fe766);}return _0x5adedc[_0x55f5('0x1e')](_0x55f5('0x37'))[_0x55f5('0x22')](_0x4d3483,_0x5ab27b);}});case _0x55f5('0x38'):var _0x149337=_[_0x55f5('0x31')](_0x5857db);if(_0x113600[_0x55f5('0x39')]){var _0x455eff={};_0x455eff[_0x113600['additionalSearchAccount']]=_0x5c4915;_[_0x55f5('0x33')](_0x149337[_0x55f5('0x34')],_0x455eff);}return _0x5adedc['sobject'](_0x55f5('0x3a'))['find'](_0x149337,_0x5ab27b)[_0x55f5('0x23')]()[_0x55f5('0x24')](function(_0x4dccfe){if(_0x4dccfe&&_0x4dccfe[_0x55f5('0x25')]){return _0x4dccfe;}else{var _0x2055a3=_['cloneDeep'](_0x5857db);if(_0x113600[_0x55f5('0x32')]){var _0x809cde={};_0x809cde[_0x113600[_0x55f5('0x32')]]=_0x5c4915;_['merge'](_0x2055a3['$or'],_0x809cde);}return _0x5adedc['sobject'](_0x55f5('0x35'))[_0x55f5('0x22')](_0x2055a3,_0x5ab27b)[_0x55f5('0x24')](function(_0x1994f0){if(_0x1994f0&&_0x1994f0[_0x55f5('0x25')]){return _0x1994f0;}else{var _0x569dfb=_['cloneDeep'](_0x5857db);if(_0x113600['additionalSearchLead']){var _0x4881a7={};_0x4881a7[_0x113600['additionalSearchLead']]=_0x5c4915;_['merge'](_0x569dfb['$or'],_0x4881a7);}return _0x5adedc['sobject']('Lead')[_0x55f5('0x22')](_0x569dfb,_0x5ab27b);}});}});case _0x55f5('0x19'):var _0xb2c3fc=_[_0x55f5('0x31')](_0x5857db);if(_0x113600[_0x55f5('0x32')]){var _0x455eff={};_0x455eff[_0x113600[_0x55f5('0x32')]]=_0x5c4915;_[_0x55f5('0x33')](_0xb2c3fc[_0x55f5('0x34')],_0x455eff);}return _0x5adedc[_0x55f5('0x1e')](_0x55f5('0x35'))[_0x55f5('0x22')](_0xb2c3fc,_0x5ab27b)['execute']();case _0x55f5('0x15'):var _0x4f9a31=_[_0x55f5('0x31')](_0x5857db);if(_0x113600[_0x55f5('0x36')]){var _0x455eff={};_0x455eff[_0x113600[_0x55f5('0x36')]]=_0x5c4915;_[_0x55f5('0x33')](_0x4f9a31[_0x55f5('0x34')],_0x455eff);}return _0x5adedc[_0x55f5('0x1e')](_0x55f5('0x37'))[_0x55f5('0x22')](_0x4f9a31,_0x5ab27b);case'account':var _0x149337=_[_0x55f5('0x31')](_0x5857db);if(_0x113600[_0x55f5('0x39')]){var _0x455eff={};_0x455eff[_0x113600[_0x55f5('0x39')]]=_0x5c4915;_[_0x55f5('0x33')](_0x149337[_0x55f5('0x34')],_0x455eff);}return _0x5adedc[_0x55f5('0x1e')](_0x55f5('0x3a'))['find'](_0x149337,_0x5ab27b);default:return null;}})[_0x55f5('0x24')](function(_0x1e74e9){if(_0x1e74e9&&_0x1e74e9['length']){var _0x145173=_['first'](_0x1e74e9);if(_0x145173){return BPromise['resolve']({'id':_0x145173['Id'],'name':_0x145173[_0x55f5('0x28')],'phone':_0x145173['Phone'],'endUserType':_0x145173['attributes'][_0x55f5('0x3b')]['toLowerCase']()});}}})['then'](function(_0x49b4fb){if(_0x49b4fb){logger['info'](_0x55f5('0x3c'),_0x49b4fb['endUserType'],_0x5c4915);return BPromise['resolve'](_0x49b4fb);}else{logger[_0x55f5('0x1c')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x5c4915);var _0x233556={'Phone':_0x5c4915};if(_0x113600[_0x55f5('0x3d')]){if(_0x113600[_0x55f5('0x3d')]===_0x55f5('0x19')){logger[_0x55f5('0x1c')](_0x55f5('0x3e'),_0x5c4915,_0x113600['moduleCreate']);_0x233556[_0x55f5('0x3f')]=_0x48d9c2!==_0x55f5('0x40')?_0x48d9c2:util[_0x55f5('0x41')](_0x55f5('0x42'),_0x5c4915);}else if(_0x113600[_0x55f5('0x3d')]==='lead'){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x5c4915,_0x113600[_0x55f5('0x3d')]);_0x233556['LastName']=_0x48d9c2!==_0x55f5('0x40')?_0x48d9c2:util['format'](_0x55f5('0x42'),_0x5c4915);_0x233556[_0x55f5('0x43')]=_0x55f5('0x44');}else if(_0x113600[_0x55f5('0x3d')]==='account'){logger[_0x55f5('0x1c')](_0x55f5('0x3e'),_0x5c4915,_0x113600[_0x55f5('0x3d')]);_0x233556[_0x55f5('0x28')]=_0x48d9c2!==''?_0x48d9c2:util[_0x55f5('0x41')](_0x55f5('0x42'),_0x5c4915);}else{return null;}}return _0x5adedc['sobject'](_[_0x55f5('0x45')](_0x113600[_0x55f5('0x3d')]))[_0x55f5('0x1f')](_0x233556)[_0x55f5('0x24')](function(_0xa2a3d9){return BPromise['resolve']({'id':_0xa2a3d9['id'],'endUserType':_0x113600[_0x55f5('0x3d')]});});}});}function getCustomFields(_0x485ad5,_0x402724){var _0x726612={};if(_0x485ad5[_0x55f5('0x25')]>0x0){_[_0x55f5('0x46')](_0x485ad5,function(_0x3c88be){if(_[_0x55f5('0x47')](['string',_0x55f5('0x48')],_0x3c88be[_0x55f5('0x3b')])&&_0x3c88be[_0x55f5('0x49')]){_0x726612[_0x3c88be[_0x55f5('0x49')]]=_0x3c88be['content']['toString']();}else if(_0x3c88be[_0x55f5('0x3b')]===_0x55f5('0x4a')&&_0x3c88be[_0x55f5('0x4b')]&&_0x3c88be[_0x55f5('0x49')]){_0x402724[_0x3c88be[_0x55f5('0x4b')]]&&(_0x726612[_0x3c88be[_0x55f5('0x49')]]=_0x402724[_0x3c88be[_0x55f5('0x4b')]][_0x55f5('0x4c')]());}else if(_0x3c88be[_0x55f5('0x3b')]===_0x55f5('0x4d')&&_0x3c88be['Variable']&&_0x3c88be[_0x55f5('0x4e')][_0x55f5('0x4f')]&&_0x3c88be[_0x55f5('0x49')]){_0x402724[_0x3c88be[_0x55f5('0x4e')][_0x55f5('0x4f')][_0x55f5('0x50')]()]&&(_0x726612[_0x3c88be['idField']]=_0x402724[_0x3c88be[_0x55f5('0x4e')][_0x55f5('0x4f')]['toLowerCase']()][_0x55f5('0x4c')]());}});}return _0x726612;}function getConnection(_0xb46117){var _0x8e3f2=_0xb46117[_0x55f5('0x51')][_0x55f5('0x52')](_0xb46117[_0x55f5('0x53')]);var _0x53b467=new jsforce[(_0x55f5('0x54'))]({'oauth2':{'loginUrl':_0xb46117[_0x55f5('0x55')]||_0x55f5('0x56'),'clientId':_0xb46117[_0x55f5('0x57')],'clientSecret':_0xb46117[_0x55f5('0x58')]}});return _0x53b467['login'](_0xb46117[_0x55f5('0x59')],_0x8e3f2)[_0x55f5('0x24')](function(){logger['info'](_0x55f5('0x5a'));return _0x53b467;});}exports['queue']=function(_0x484ae8,_0x28e94b,_0x478993,_0x515b90,_0x5c54e0,_0x2f57e5){var _0x2c2976,_0x20adb2,_0x58b362,_0x4669b0;_0x2f57e5[_0x55f5('0x5b')]=intUtil[_0x55f5('0x5c')](_0x2f57e5['serverUrl']);_0x2f57e5[_0x55f5('0x55')]=intUtil[_0x55f5('0x5c')](_0x2f57e5[_0x55f5('0x55')]);if(_0x5c54e0&&_0x5c54e0[_0x55f5('0x5d')]){logger[_0x55f5('0x1c')]('[QUEUE]',_0x55f5('0x5e'));_0x28e94b['recordingURL']=util[_0x55f5('0x41')](_0x55f5('0x5f'),_0x2f57e5[_0x55f5('0x5b')],_0x28e94b[_0x55f5('0x60')],md5(_0x28e94b[_0x55f5('0x60')]));}else{_0x28e94b[_0x55f5('0x61')]='';}return getConnection(_0x2f57e5)['then'](function(_0x5c6a63){_0x4669b0=_0x5c6a63;return getUser(_0x2f57e5,_0x515b90['email'],_0x4669b0);})[_0x55f5('0x24')](function(_0xa2ac9c){_0x2c2976=_0xa2ac9c;return getEndUser(_0x2f57e5,_0x478993,_0x28e94b[_0x55f5('0x62')],_0x28e94b['calleridnum'],_0x4669b0);})[_0x55f5('0x24')](function(_0x11bb4d){_0x20adb2=_0x11bb4d;return getTicket(_0x2f57e5,_0x2c2976,_0x20adb2,_0x478993,_0x28e94b,_0x478993[_0x55f5('0x63')],_0x4669b0,'queue');})[_0x55f5('0x24')](function(_0x339f94){_0x58b362=_0x339f94;logger[_0x55f5('0x1c')](_0x55f5('0x64'),_0x58b362['id']);logger[_0x55f5('0x1c')](_0x55f5('0x65'),_0x58b362['id'],_0x515b90[_0x55f5('0x4f')],_0x2f57e5[_0x55f5('0x3b')]);switch(_0x2f57e5[_0x55f5('0x3b')]){case _0x55f5('0x66'):emit(util[_0x55f5('0x41')]('user:%s',_0x515b90[_0x55f5('0x4f')]),'trigger:salesforce:display',{'recordId':_0x58b362['id']});break;case _0x55f5('0x67'):emit(util['format'](_0x55f5('0x68'),_0x515b90['name']),_0x55f5('0x69'),{'uri':util[_0x55f5('0x41')](_0x55f5('0x6a'),_0x4669b0[_0x55f5('0x6b')],_0x58b362['id'])});break;default:logger[_0x55f5('0x6c')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x55f5('0x6d')](function(_0x26ef1c){logger[_0x55f5('0x6c')](_0x55f5('0x6e'),_0x26ef1c);});};exports[_0x55f5('0x6f')]=function(_0xcfef2e,_0x22996d,_0x3da264,_0x3f392e,_0x23b1d7,_0xebe1a4,_0x2044a0){var _0x492c69,_0x4bf714,_0x56208d,_0x3a9d9a;_0xebe1a4['serverUrl']=intUtil[_0x55f5('0x5c')](_0xebe1a4[_0x55f5('0x5b')]);_0xebe1a4[_0x55f5('0x55')]=intUtil[_0x55f5('0x5c')](_0xebe1a4['remoteUri']);if(_0x2044a0&&_0x2044a0[_0x55f5('0x70')]&&_0x2044a0[_0x55f5('0x70')]!==_0x55f5('0x71')){logger[_0x55f5('0x1c')](_0x55f5('0x72'),'Recording\x20is\x20enabled!');_0x22996d[_0x55f5('0x61')]=util['format'](_0x55f5('0x5f'),_0xebe1a4[_0x55f5('0x5b')],_0x22996d['uniqueid'],md5(_0x22996d['uniqueid']));}return getConnection(_0xebe1a4)['then'](function(_0x1c02e2){_0x3a9d9a=_0x1c02e2;return getUser(_0xebe1a4,_0x3f392e[_0x55f5('0x73')],_0x3a9d9a);})['then'](function(_0x55e29d){_0x492c69=_0x55e29d;return getEndUser(_0xebe1a4,_0x3da264,_0x22996d['destcalleridname'],_0x22996d['destcalleridnum'],_0x3a9d9a);})[_0x55f5('0x24')](function(_0x62d235){_0x4bf714=_0x62d235;return getTicket(_0xebe1a4,_0x492c69,_0x4bf714,_0x3da264,_0x22996d,_0x3da264[_0x55f5('0x63')],_0x3a9d9a,_0x55f5('0x6f'));})[_0x55f5('0x24')](function(_0x459653){_0x56208d=_0x459653;logger[_0x55f5('0x1c')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x56208d['id']);logger[_0x55f5('0x1c')](_0x55f5('0x74'),_0x56208d['id'],_0x3f392e[_0x55f5('0x4f')],_0xebe1a4['type']);switch(_0xebe1a4[_0x55f5('0x3b')]){case _0x55f5('0x66'):emit(util[_0x55f5('0x41')](_0x55f5('0x68'),_0x3f392e[_0x55f5('0x4f')]),_0x55f5('0x75'),{'recordId':_0x56208d['id']});break;case _0x55f5('0x67'):emit(util[_0x55f5('0x41')](_0x55f5('0x68'),_0x3f392e['name']),'trigger:browser:url',{'uri':util[_0x55f5('0x41')]('%s/%s/e',_0x3a9d9a[_0x55f5('0x6b')],_0x56208d['id'])});break;default:logger[_0x55f5('0x6c')](_0x55f5('0x72'),_0x55f5('0x76'));}})[_0x55f5('0x6d')](function(_0x143c88){logger[_0x55f5('0x6c')](_0x55f5('0x72'),_0x143c88);});};exports['unmanaged']=function(_0x36fb61,_0x17af7f,_0xf550e6,_0x57c5fb,_0x4a7be7,_0x335cbb){var _0x37e922,_0x1fb68d,_0x464fab,_0x2c9aeb;_0x335cbb[_0x55f5('0x5b')]=intUtil[_0x55f5('0x5c')](_0x335cbb[_0x55f5('0x5b')]);_0x335cbb['remoteUri']=intUtil[_0x55f5('0x5c')](_0x335cbb['remoteUri']);if(_0x4a7be7&&_0x4a7be7[_0x55f5('0x5d')]){logger['info']('['+_0x17af7f['lastevent'][_0x55f5('0x77')]()+']',_0x55f5('0x5e'));_0x17af7f['recordingURL']=util[_0x55f5('0x41')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x335cbb[_0x55f5('0x5b')],_0x17af7f[_0x55f5('0x60')],md5(_0x17af7f[_0x55f5('0x60')]));}else{_0x17af7f['recordingURL']='';}return getConnection(_0x335cbb)['then'](function(_0x396ce9){_0x2c9aeb=_0x396ce9;if(!_[_0x55f5('0x78')](_0x57c5fb)){return getUser(_0x335cbb,_0x57c5fb[_0x55f5('0x4f')],_0x2c9aeb);}else{return getUser(_0x335cbb,null,_0x2c9aeb);}})[_0x55f5('0x24')](function(_0x35ae64){_0x37e922=_0x35ae64;return getEndUser(_0x335cbb,_0xf550e6,_0x17af7f[_0x55f5('0x62')],_0x17af7f['calleridnum'],_0x2c9aeb);})[_0x55f5('0x24')](function(_0x5a0a57){_0x1fb68d=_0x5a0a57;return getTicket(_0x335cbb,_0x37e922,_0x1fb68d,_0xf550e6,_0x17af7f,_0xf550e6[_0x55f5('0x63')],_0x2c9aeb);})['then'](function(_0xcf5789){_0x464fab=_0xcf5789;logger['info']('['+_0x17af7f[_0x55f5('0x79')][_0x55f5('0x77')]()+_0x55f5('0x7a'),_0x464fab['id']);logger[_0x55f5('0x1c')]('['+_0x17af7f['lastevent'][_0x55f5('0x77')]()+_0x55f5('0x7b'),_0x335cbb['type']);})['catch'](function(_0x4f0b23){logger[_0x55f5('0x6c')]('['+_0x17af7f[_0x55f5('0x79')]['toUpperCase']()+']',_0x4f0b23);});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/servicenow.js b/server/services/ami/trigger/integration/servicenow.js index 953e53f..c48e9d1 100644 --- a/server/services/ami/trigger/integration/servicenow.js +++ b/server/services/ami/trigger/integration/servicenow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x546c=['getString',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','push',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','all','Tags','name','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','unmanaged','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','localhost','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','],\x20getAdminUser\x20crm','error','toUpperCase','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','active','userId','adminEmail','],\x20getUser\x20crm','catch','],\x20createEndUser\x20input\x20crm','POST','endUserNumber','user','true','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20crm','forEach','includes','string','type','customField','toLowerCase','content','toString','picklist','idField','variable','customVariable','Variable',']\x20getTicket\x20input\x20crm','outbound','incident','Subjects'];(function(_0x2487c0,_0x22b578){var _0x1564bd=function(_0x39d687){while(--_0x39d687){_0x2487c0['push'](_0x2487c0['shift']());}};_0x1564bd(++_0x22b578);}(_0x546c,0x1c9));var _0xc546=function(_0x2a484f,_0x547207){_0x2a484f=_0x2a484f-0x0;var _0x345763=_0x546c[_0x2a484f];return _0x345763;};'use strict';var _=require(_0xc546('0x0'));var Promise=require(_0xc546('0x1'));var rp=require(_0xc546('0x2'));var util=require(_0xc546('0x3'));var md5=require(_0xc546('0x4'));var Redis=require(_0xc546('0x5'));var intUtil=require(_0xc546('0x6'));var config=require(_0xc546('0x7'));var logger=require(_0xc546('0x8'))(_0xc546('0x9'));config[_0xc546('0xa')]=_['defaults'](config[_0xc546('0xa')],{'host':_0xc546('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminUser(_0x13cb23,_0x3ebd8c,_0x442033,_0x50e7ee,_0x46a3e7,_0x192667){return new Promise(function(_0x55dc6f,_0x5cfa47){var _0x60d0d5={'method':_0xc546('0xc'),'uri':_0x50e7ee+_0xc546('0xd')+'&'+_0x46a3e7+'&'+_0x192667,'auth':_0x3ebd8c,'json':!![]};return rp(_0x60d0d5)[_0xc546('0xe')](function(_0x5c95fd){if(_0x5c95fd[_0xc546('0xf')][_0xc546('0x10')]>0x0){_0x442033[_0xc546('0x11')]=_0x5c95fd[_0xc546('0xf')][0x0][_0xc546('0x12')];}logger[_0xc546('0x13')]('['+[_0x13cb23['toUpperCase']()]+_0xc546('0x14'),_0x442033);_0x55dc6f(_0x442033);})['catch'](function(_0x4f4014){logger[_0xc546('0x15')]('['+[_0x13cb23[_0xc546('0x16')]()]+']',_0x4f4014[_0xc546('0x17')]);_0x5cfa47(_0x4f4014[_0xc546('0x17')]);});});}function getUser(_0x282b95,_0x51e584,_0x35d037,_0x45e5b5,_0x3d5eb9){return function(_0x407d65){logger[_0xc546('0x13')]('['+[_0x282b95[_0xc546('0x16')]()]+_0xc546('0x18'),_0x407d65);return new Promise(function(_0x2ef4bd,_0x52a204){if(intUtil[_0xc546('0x19')](_0x407d65[_0xc546('0x1a')])){var _0x25efa5={'method':_0xc546('0xc'),'uri':_0x35d037+_0xc546('0x1b')+_0x407d65[_0xc546('0x1a')]+'&'+_0x45e5b5+'&'+_0x3d5eb9,'auth':_0x51e584,'json':!![]};logger['info']('['+[_0x282b95[_0xc546('0x16')]()]+'],\x20getUser\x20rp\x20obj',_0x25efa5);return rp(_0x25efa5)['then'](function(_0x373b31){logger[_0xc546('0x13')]('['+[_0x282b95['toUpperCase']()]+'],\x20getUser\x20entity',_0x373b31);if(_0x373b31['result']['length']>0x0&&String(_0x373b31[_0xc546('0xf')][0x0][_0xc546('0x1c')])==='true'){_0x407d65[_0xc546('0x1d')]=_0x373b31[_0xc546('0xf')][0x0][_0xc546('0x12')];}else{_0x407d65[_0xc546('0x1d')]=_0x407d65[_0xc546('0x11')];_0x407d65['userEmail']=_0x407d65[_0xc546('0x1e')];}logger[_0xc546('0x13')]('['+[_0x282b95[_0xc546('0x16')]()]+_0xc546('0x1f'),_0x407d65);_0x2ef4bd(_0x407d65);})[_0xc546('0x20')](function(_0x34400d){logger[_0xc546('0x15')]('['+[_0x282b95[_0xc546('0x16')]()]+']',_0x34400d[_0xc546('0x17')]);_0x52a204(_0x34400d[_0xc546('0x17')]);});}else{logger[_0xc546('0x13')]('['+[_0x282b95[_0xc546('0x16')]()]+']\x20using\x20admin\x20profile');_0x407d65[_0xc546('0x1d')]=_0x407d65[_0xc546('0x11')];_0x407d65[_0xc546('0x1a')]=_0x407d65['adminEmail'];_0x2ef4bd(_0x407d65);}});};}function createEndUser(_0x2cd2f6,_0x5b8054,_0x2323ed,_0x3bb0e0,_0x4e11d6){logger[_0xc546('0x13')]('['+[_0x2cd2f6[_0xc546('0x16')]()]+_0xc546('0x21'),_0x2323ed);return new Promise(function(_0x5addb8,_0xf6883b){var _0x3509a5={'method':_0xc546('0x22'),'uri':_0x3bb0e0+'sys_user?'+_0x4e11d6,'body':{'user_name':_0x2323ed[_0xc546('0x23')],'roles':_0xc546('0x24'),'first_name':_0x2323ed['endUserNumber'],'active':_0xc546('0x25'),'date_format':'System','phone':_0x2323ed[_0xc546('0x23')]},'auth':_0x5b8054,'json':!![]};return rp(_0x3509a5)[_0xc546('0xe')](function(_0x738bb9){logger[_0xc546('0x13')]('['+[_0x2cd2f6[_0xc546('0x16')]()]+_0xc546('0x26'),_0x738bb9[_0xc546('0xf')]);_0x2323ed[_0xc546('0x27')]=_0x738bb9[_0xc546('0xf')]['sys_id'];_0x5addb8(_0x2323ed);})[_0xc546('0x20')](function(_0x459fb0){logger[_0xc546('0x15')]('['+[_0x2cd2f6[_0xc546('0x16')]()]+']',_0x459fb0[_0xc546('0x17')]);_0xf6883b(_0x459fb0[_0xc546('0x17')]);});});}function getEndUser(_0x39029d,_0x2e091a,_0x4c575f,_0x4a8452,_0x257c2f){return function(_0x5f1c6d){logger[_0xc546('0x13')]('['+[_0x39029d['toUpperCase']()]+'],\x20getEndUser\x20input\x20crm',_0x5f1c6d);return new Promise(function(_0x583f3e,_0x28e1a9){var _0x267d10={'method':'GET','uri':_0x4c575f+'sys_user?sysparm_query=phone%3D'+_0x5f1c6d[_0xc546('0x23')]+'&'+_0x4a8452+'&'+_0x257c2f,'auth':_0x2e091a,'json':!![]};return rp(_0x267d10)[_0xc546('0xe')](function(_0x20b677){if(_0x20b677[_0xc546('0xf')][_0xc546('0x10')]>0x0){_0x5f1c6d[_0xc546('0x27')]=_0x20b677[_0xc546('0xf')][0x0][_0xc546('0x12')];logger[_0xc546('0x13')]('['+[_0x39029d[_0xc546('0x16')]()]+_0xc546('0x28'),_0x5f1c6d);_0x583f3e(_0x5f1c6d);}else{return createEndUser(_0x39029d,_0x2e091a,_0x5f1c6d,_0x4c575f,_0x4a8452)[_0xc546('0xe')](function(_0x4e10c6){logger[_0xc546('0x13')]('['+[_0x39029d[_0xc546('0x16')]()]+'],\x20createEndUser\x20crm',_0x4e10c6);_0x583f3e(_0x4e10c6);});}})[_0xc546('0x20')](function(_0xd3a32a){logger[_0xc546('0x15')]('['+[_0x39029d['toUpperCase']()]+']',_0xd3a32a[_0xc546('0x17')]);_0x28e1a9(_0xd3a32a[_0xc546('0x17')]);});});};}function getCustomFields(_0x4e44e9,_0x62203c){var _0xeade8b={};if(_0x4e44e9[_0xc546('0x10')]>0x0){_[_0xc546('0x29')](_0x4e44e9,function(_0x496819){if(_[_0xc546('0x2a')]([_0xc546('0x2b'),'picklist'],_0x496819[_0xc546('0x2c')])&&_0x496819['nameField']&&!_0x496819[_0xc546('0x2d')]){_0xeade8b[_0x496819['nameField'][_0xc546('0x2e')]()]=_0x496819[_0xc546('0x2f')][_0xc546('0x30')]();}else if(_['includes'](['string',_0xc546('0x31')],_0x496819[_0xc546('0x2c')])&&_0x496819[_0xc546('0x32')]&&_0x496819[_0xc546('0x2d')]){_0xeade8b[_0x496819['idField'][_0xc546('0x2e')]()]=_0x496819['content']['toString']();}else if(_0x496819[_0xc546('0x2c')]===_0xc546('0x33')&&_0x496819['variableName']&&_0x496819['idField']&&_0x496819[_0xc546('0x2d')]){_0xeade8b[_0x496819['idField']['toLowerCase']()]=_0x62203c[_0x496819['variableName']][_0xc546('0x30')]();}else if(_0x496819[_0xc546('0x2c')]===_0xc546('0x34')&&_0x496819[_0xc546('0x35')]&&_0x496819[_0xc546('0x35')]['name']&&_0x496819[_0xc546('0x32')]&&_0x496819[_0xc546('0x2d')]){_0xeade8b[_0x496819[_0xc546('0x32')][_0xc546('0x2e')]()]=_0x62203c[_0x496819['Variable']['name'][_0xc546('0x2e')]()][_0xc546('0x30')]();}});}return _0xeade8b;}function getTicket(_0x860ee1,_0x2c6325,_0x16e2ad,_0x1c182f,_0xeb5c07,_0xae586c){return function(_0x4c6989){logger['info']('['+[_0x860ee1[_0xc546('0x16')]()]+_0xc546('0x36'),_0x4c6989);return new Promise(function(_0x5d923a,_0x3b5a86){var _0x38f398=_0x860ee1[_0xc546('0x2e')]()===_0xc546('0x37')?_0x4c6989[_0xc546('0x1d')]:_0x4c6989['endUserId'];var _0x21b432={'method':_0xc546('0x22'),'uri':_0x16e2ad+_0xc546('0x38')+'?'+_0xae586c,'body':Object['assign']({},{'active':_0xc546('0x25'),'caller_id':_0x38f398,'assigned_to':_0x4c6989['userId'],'short_description':intUtil['getString'](_0x1c182f[_0xc546('0x39')],_0xeb5c07,'\x20'),'description':intUtil[_0xc546('0x3a')](_0x1c182f['Descriptions'],_0xeb5c07,'\x0a')},getCustomFields(_0x1c182f['Fields'],_0xeb5c07)),'auth':_0x2c6325,'json':!![]};return rp(_0x21b432)[_0xc546('0xe')](function(_0x33c33f){logger[_0xc546('0x13')]('['+[_0x860ee1[_0xc546('0x16')]()]+_0xc546('0x3b'),_0x33c33f[_0xc546('0xf')]);_0x4c6989[_0xc546('0x3c')]=_0x33c33f[_0xc546('0xf')][_0xc546('0x12')];_0x4c6989[_0xc546('0x3d')]=_0x33c33f[_0xc546('0xf')]['number'];logger['info']('['+[_0x860ee1[_0xc546('0x16')]()]+_0xc546('0x3e'),_0x4c6989);_0x5d923a(_0x4c6989);})[_0xc546('0x20')](function(_0x910e02){logger[_0xc546('0x15')]('['+[_0x860ee1[_0xc546('0x16')]()]+']',_0x910e02[_0xc546('0x17')]);_0x3b5a86(_0x910e02[_0xc546('0x17')]);});});};}function createRemoteTag(_0x1ca6f3,_0x531515,_0xf72588,_0x81c8cf){return new Promise(function(_0x126d56,_0x5dc670){var _0x333afb={'method':'POST','uri':_0xf72588+_0xc546('0x3f')+'?'+_0x81c8cf,'body':{'short_description':_0x1ca6f3,'global':!![],'active':!![],'name':_0x1ca6f3},'auth':_0x531515,'json':!![]};return rp(_0x333afb)[_0xc546('0xe')](function(_0x384b16){var _0x162f39=_0x384b16[_0xc546('0xf')][_0xc546('0x12')];_0x126d56(_0x162f39);});});}function getRemoteTag(_0x287766,_0x136a50,_0x4f7da3,_0x1daa5e,_0x5799e5){return new Promise(function(_0x2d2577,_0xf6033f){var _0x3ff048={'method':'GET','uri':_0x4f7da3+'label'+_0xc546('0x40')+_0x287766+'&'+_0x1daa5e,'auth':_0x136a50,'json':!![]};return rp(_0x3ff048)['then'](function(_0x33c623){if(_0x33c623[_0xc546('0xf')]['length']>0x0){var _0x2d8668=_0x33c623[_0xc546('0xf')][0x0][_0xc546('0x12')];_0x2d2577(_0x2d8668);}else{return createRemoteTag(_0x287766,_0x136a50,_0x4f7da3,_0x1daa5e)['then'](function(_0x408370){_0x2d2577(_0x408370);});}});});}function assignTagToIncident(_0x42912f,_0x2f6654,_0x3139ca,_0x3c8943,_0x2b717e){return new Promise(function(_0x361e1e,_0xca7729){var _0xef3642={'method':_0xc546('0x22'),'uri':_0x3139ca+_0xc546('0x41')+'?'+_0x2b717e,'body':{'label':_0x42912f,'table':'incident','id_type':_0xc546('0x42'),'table_key':_0x3c8943[_0xc546('0x3c')],'title':'Incident\x20-\x20'+_0x3c8943[_0xc546('0x3d')],'id_display':_0x3c8943[_0xc546('0x3d')]},'auth':_0x2f6654,'json':!![]};return rp(_0xef3642)[_0xc546('0xe')](function(_0x17b9ef){_0x361e1e();})['catch'](function(){_0x361e1e();});});}function manageTags(_0x14f428,_0x5bc1b6,_0xd42c61,_0x3c6a96,_0x31af96,_0x32ac60,_0x184325){return new Promise(function(_0x3e317d,_0x1bf915){var _0x1682ae=[];_0x5bc1b6[_0xc546('0x29')](function(_0x3d0c0a){_0x1682ae[_0xc546('0x43')](getRemoteTag(_0x3d0c0a,_0xd42c61,_0x3c6a96,_0x32ac60,_0x184325));});return Promise['all'](_0x1682ae)[_0xc546('0xe')](function(_0x219b08){if(_0x219b08[_0xc546('0x10')]){logger[_0xc546('0x13')]('['+[_0x14f428[_0xc546('0x16')]()]+_0xc546('0x44'),_0x219b08);var _0x3b1c42=[];_0x219b08[_0xc546('0x29')](function(_0x90f3ad){_0x3b1c42[_0xc546('0x43')](assignTagToIncident(_0x90f3ad,_0xd42c61,_0x3c6a96,_0x31af96,_0x32ac60));});return Promise[_0xc546('0x45')](_0x3b1c42)['then'](function(){_0x3e317d();})[_0xc546('0x20')](function(){_0x3e317d();});}else{_0x3e317d();}});});}function getTags(_0x4de2a4,_0x275a94,_0x51e903,_0x3342ab,_0x58504e,_0x38d2d5){return function(_0x46346a){return new Promise(function(_0x396cb3,_0x2d558a){var _0x2c470d=[];var _0xacc48f=_0x3342ab[_0xc546('0x46')];if(_0xacc48f&&_0xacc48f[_0xc546('0x10')]>0x0){_0x2c470d=_['map'](_0xacc48f,_0xc546('0x47'));}if(_0x2c470d['length']>0x0){return manageTags(_0x4de2a4,_0x2c470d,_0x275a94,_0x51e903,_0x46346a,_0x58504e,_0x38d2d5)['then'](function(){_0x396cb3(_0x46346a);});}else{_0x396cb3(_0x46346a);}});};}function emit(_0x3eb8e0,_0x12b7ed,_0xb6d47a){var _0x4a2193=_0xc546('0x48')+_0xc546('0x49')+_0xc546('0x4a')+'%255EORDERBYDESCnumber';var _0x50654a={'uri':_0x3eb8e0+_0xc546('0x4b')+_0xb6d47a+_0x4a2193};io['to'](util[_0xc546('0x4c')](_0xc546('0x4d'),_0x12b7ed))[_0xc546('0x4e')](_0xc546('0x4f'),_0x50654a);}exports['cs']=function(_0x2badc2,_0x38b53a,_0x17da2e,_0x2241fe,_0x37fed4,_0x3ac97d,_0xdeff33,_0x4a24c8){var _0x5e16d3={};var _0x228740={'user':_0x3ac97d[_0xc546('0x50')],'pass':_0x3ac97d['password']};var _0x7823e9=_0xc546('0x51');var _0x71cef7=_0xc546('0x52');_0x3ac97d[_0xc546('0x53')]=intUtil[_0xc546('0x54')](_0x3ac97d[_0xc546('0x53')]);_0x3ac97d['serverUrl']=intUtil[_0xc546('0x54')](_0x3ac97d[_0xc546('0x55')]);var _0x33c746=util[_0xc546('0x4c')](_0xc546('0x56'),_0x3ac97d[_0xc546('0x53')]);_0x5e16d3['userEmail']=!_[_0xc546('0x57')](_0x2241fe)?_0x2241fe[_0xc546('0x58')]:null;_0x5e16d3[_0xc546('0x1e')]=_0x3ac97d[_0xc546('0x58')];_0x5e16d3['endUserNumber']=_0x4a24c8['toLowerCase']()===_0xc546('0x37')?_0x38b53a[_0xc546('0x59')]:_0x38b53a[_0xc546('0x5a')];_0x5e16d3[_0xc546('0x5b')]=_0x4a24c8==='queue'||_0x4a24c8===_0xc546('0x5c')?'queue':_0xc546('0x37');var _0x4ab305=util[_0xc546('0x4c')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ac97d[_0xc546('0x55')],_0x38b53a[_0xc546('0x5d')],md5(_0x38b53a[_0xc546('0x5d')]));if(_0x37fed4&&_0x37fed4[_0xc546('0x5e')]){logger[_0xc546('0x13')]('[QUEUE]',_0xc546('0x5f'));_0x38b53a[_0xc546('0x60')]=_0x4ab305;}else if(_0xdeff33&&_0xdeff33['recordingFormat']&&_0xdeff33['recordingFormat']!==_0xc546('0x61')){logger[_0xc546('0x13')](_0xc546('0x62'),_0xc546('0x5f'));_0x38b53a[_0xc546('0x60')]=_0x4ab305;}else{_0x38b53a[_0xc546('0x60')]='';}return getAdminUser(_0x4a24c8,_0x228740,_0x5e16d3,_0x33c746,_0x71cef7,_0x7823e9)[_0xc546('0xe')](getUser(_0x4a24c8,_0x228740,_0x33c746,_0x71cef7,_0x7823e9))[_0xc546('0xe')](getEndUser(_0x4a24c8,_0x228740,_0x33c746,_0x71cef7,_0x7823e9))[_0xc546('0xe')](getTicket(_0x4a24c8,_0x228740,_0x33c746,_0x17da2e,_0x38b53a,_0x71cef7))[_0xc546('0xe')](function(_0x4e3c34){logger[_0xc546('0x13')](util['format'](_0xc546('0x63'),_0x4e3c34[_0xc546('0x3c')]));logger[_0xc546('0x13')](util[_0xc546('0x4c')](_0xc546('0x64'),_0x4a24c8));if(_0x4a24c8!==_0xc546('0x5c')){logger[_0xc546('0x13')]('['+[_0x4a24c8[_0xc546('0x16')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x3ac97d[_0xc546('0x53')],_0x2241fe[_0xc546('0x47')],_0x4e3c34[_0xc546('0x3c')]);}})['catch'](function(_0x1c1ba6){logger[_0xc546('0x15')]('['+[_0x4a24c8[_0xc546('0x16')]()]+_0xc546('0x65'),util[_0xc546('0x66')](_0x1c1ba6,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xc812=['variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','number','label','?sysparm_query=name%3D','label_entry','Incident','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','format','user:%s','trigger:browser:url','username','sysparm_display_value=true','stripTrailingSlash','remoteUri','serverUrl','isNil','email','calleridnum','callDirection','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','request-promise','util','md5','ioredis','./util','../../../../config/environment','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','length','adminId','info','],\x20getAdminUser\x20crm','catch','toUpperCase','message','validateEmail','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20rp\x20obj','result','true','userId','sys_id','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','POST','endUserNumber','System','],\x20EndUser\x20schema','endUserId','error','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','forEach','includes','string','picklist','type','customField','content','toString','idField','variable','toLowerCase'];(function(_0x7f982b,_0x2ef252){var _0x18f03d=function(_0x1cd3eb){while(--_0x1cd3eb){_0x7f982b['push'](_0x7f982b['shift']());}};_0x18f03d(++_0x2ef252);}(_0xc812,0x1e4));var _0x2c81=function(_0x316301,_0x26ccf0){_0x316301=_0x316301-0x0;var _0x423bf8=_0xc812[_0x316301];return _0x423bf8;};'use strict';var _=require('lodash');var Promise=require('bluebird');var rp=require(_0x2c81('0x0'));var util=require(_0x2c81('0x1'));var md5=require(_0x2c81('0x2'));var Redis=require(_0x2c81('0x3'));var intUtil=require(_0x2c81('0x4'));var config=require(_0x2c81('0x5'));var logger=require('../../../../config/logger')(_0x2c81('0x6'));config[_0x2c81('0x7')]=_[_0x2c81('0x8')](config['redis'],{'host':_0x2c81('0x9'),'port':0x18eb});var io=require(_0x2c81('0xa'))(new Redis(config[_0x2c81('0x7')]));function getAdminUser(_0x2e4c8b,_0x4ca3d4,_0x48bea9,_0xb25373,_0x396926,_0x4901a6){return new Promise(function(_0x5f55a2,_0x163a99){var _0x2b2a20={'method':_0x2c81('0xb'),'uri':_0xb25373+_0x2c81('0xc')+'&'+_0x396926+'&'+_0x4901a6,'auth':_0x4ca3d4,'json':!![]};return rp(_0x2b2a20)[_0x2c81('0xd')](function(_0x1a8ffc){if(_0x1a8ffc['result'][_0x2c81('0xe')]>0x0){_0x48bea9[_0x2c81('0xf')]=_0x1a8ffc['result'][0x0]['sys_id'];}logger[_0x2c81('0x10')]('['+[_0x2e4c8b['toUpperCase']()]+_0x2c81('0x11'),_0x48bea9);_0x5f55a2(_0x48bea9);})[_0x2c81('0x12')](function(_0x3fe09e){logger['error']('['+[_0x2e4c8b[_0x2c81('0x13')]()]+']',_0x3fe09e[_0x2c81('0x14')]);_0x163a99(_0x3fe09e[_0x2c81('0x14')]);});});}function getUser(_0x5cec93,_0x316afc,_0x55ba6a,_0x4b62c6,_0x2bc637){return function(_0x31c29e){logger[_0x2c81('0x10')]('['+[_0x5cec93[_0x2c81('0x13')]()]+'],\x20getUser\x20input\x20crm',_0x31c29e);return new Promise(function(_0x2f1f9b,_0x929bdf){if(intUtil[_0x2c81('0x15')](_0x31c29e['userEmail'])){var _0x359302={'method':'GET','uri':_0x55ba6a+_0x2c81('0x16')+_0x31c29e[_0x2c81('0x17')]+'&'+_0x4b62c6+'&'+_0x2bc637,'auth':_0x316afc,'json':!![]};logger[_0x2c81('0x10')]('['+[_0x5cec93['toUpperCase']()]+_0x2c81('0x18'),_0x359302);return rp(_0x359302)[_0x2c81('0xd')](function(_0x3df093){logger[_0x2c81('0x10')]('['+[_0x5cec93['toUpperCase']()]+'],\x20getUser\x20entity',_0x3df093);if(_0x3df093[_0x2c81('0x19')][_0x2c81('0xe')]>0x0&&String(_0x3df093[_0x2c81('0x19')][0x0]['active'])===_0x2c81('0x1a')){_0x31c29e[_0x2c81('0x1b')]=_0x3df093[_0x2c81('0x19')][0x0][_0x2c81('0x1c')];}else{_0x31c29e[_0x2c81('0x1b')]=_0x31c29e[_0x2c81('0xf')];_0x31c29e[_0x2c81('0x17')]=_0x31c29e[_0x2c81('0x1d')];}logger[_0x2c81('0x10')]('['+[_0x5cec93[_0x2c81('0x13')]()]+_0x2c81('0x1e'),_0x31c29e);_0x2f1f9b(_0x31c29e);})['catch'](function(_0x23812f){logger['error']('['+[_0x5cec93[_0x2c81('0x13')]()]+']',_0x23812f[_0x2c81('0x14')]);_0x929bdf(_0x23812f[_0x2c81('0x14')]);});}else{logger['info']('['+[_0x5cec93[_0x2c81('0x13')]()]+_0x2c81('0x1f'));_0x31c29e[_0x2c81('0x1b')]=_0x31c29e[_0x2c81('0xf')];_0x31c29e[_0x2c81('0x17')]=_0x31c29e[_0x2c81('0x1d')];_0x2f1f9b(_0x31c29e);}});};}function createEndUser(_0x33c143,_0x551460,_0x5582b9,_0x2d093e,_0x17bb24){logger[_0x2c81('0x10')]('['+[_0x33c143['toUpperCase']()]+'],\x20createEndUser\x20input\x20crm',_0x5582b9);return new Promise(function(_0x35bc26,_0x4af8b5){var _0x37cceb={'method':_0x2c81('0x20'),'uri':_0x2d093e+'sys_user?'+_0x17bb24,'body':{'user_name':_0x5582b9[_0x2c81('0x21')],'roles':'user','first_name':_0x5582b9[_0x2c81('0x21')],'active':'true','date_format':_0x2c81('0x22'),'phone':_0x5582b9[_0x2c81('0x21')]},'auth':_0x551460,'json':!![]};return rp(_0x37cceb)[_0x2c81('0xd')](function(_0x295295){logger[_0x2c81('0x10')]('['+[_0x33c143[_0x2c81('0x13')]()]+_0x2c81('0x23'),_0x295295['result']);_0x5582b9[_0x2c81('0x24')]=_0x295295['result'][_0x2c81('0x1c')];_0x35bc26(_0x5582b9);})['catch'](function(_0x16d81a){logger[_0x2c81('0x25')]('['+[_0x33c143['toUpperCase']()]+']',_0x16d81a[_0x2c81('0x14')]);_0x4af8b5(_0x16d81a[_0x2c81('0x14')]);});});}function getEndUser(_0xcf0cfc,_0x1f50ff,_0x3fdf8e,_0x417600,_0x215195){return function(_0x32f1f6){logger['info']('['+[_0xcf0cfc['toUpperCase']()]+_0x2c81('0x26'),_0x32f1f6);return new Promise(function(_0x217a8c,_0x5bafe9){var _0x2b396f={'method':_0x2c81('0xb'),'uri':_0x3fdf8e+_0x2c81('0x27')+_0x32f1f6[_0x2c81('0x21')]+'&'+_0x417600+'&'+_0x215195,'auth':_0x1f50ff,'json':!![]};return rp(_0x2b396f)[_0x2c81('0xd')](function(_0x345e0d){if(_0x345e0d[_0x2c81('0x19')]['length']>0x0){_0x32f1f6[_0x2c81('0x24')]=_0x345e0d[_0x2c81('0x19')][0x0][_0x2c81('0x1c')];logger[_0x2c81('0x10')]('['+[_0xcf0cfc[_0x2c81('0x13')]()]+'],\x20getEndUser\x20crm',_0x32f1f6);_0x217a8c(_0x32f1f6);}else{return createEndUser(_0xcf0cfc,_0x1f50ff,_0x32f1f6,_0x3fdf8e,_0x417600)[_0x2c81('0xd')](function(_0xb88eb1){logger['info']('['+[_0xcf0cfc[_0x2c81('0x13')]()]+'],\x20createEndUser\x20crm',_0xb88eb1);_0x217a8c(_0xb88eb1);});}})['catch'](function(_0x5987f6){logger[_0x2c81('0x25')]('['+[_0xcf0cfc['toUpperCase']()]+']',_0x5987f6['message']);_0x5bafe9(_0x5987f6[_0x2c81('0x14')]);});});};}function getCustomFields(_0x178071,_0x2a5e8c){var _0x5b00bd={};if(_0x178071['length']>0x0){_[_0x2c81('0x28')](_0x178071,function(_0x1124b3){if(_[_0x2c81('0x29')]([_0x2c81('0x2a'),_0x2c81('0x2b')],_0x1124b3[_0x2c81('0x2c')])&&_0x1124b3['nameField']&&!_0x1124b3[_0x2c81('0x2d')]){_0x5b00bd[_0x1124b3['nameField']['toLowerCase']()]=_0x1124b3[_0x2c81('0x2e')][_0x2c81('0x2f')]();}else if(_['includes'](['string',_0x2c81('0x2b')],_0x1124b3[_0x2c81('0x2c')])&&_0x1124b3[_0x2c81('0x30')]&&_0x1124b3[_0x2c81('0x2d')]){_0x5b00bd[_0x1124b3['idField']['toLowerCase']()]=_0x1124b3[_0x2c81('0x2e')][_0x2c81('0x2f')]();}else if(_0x1124b3[_0x2c81('0x2c')]===_0x2c81('0x31')&&_0x1124b3['variableName']&&_0x1124b3[_0x2c81('0x30')]&&_0x1124b3[_0x2c81('0x2d')]){_0x5b00bd[_0x1124b3[_0x2c81('0x30')][_0x2c81('0x32')]()]=_0x2a5e8c[_0x1124b3[_0x2c81('0x33')]][_0x2c81('0x2f')]();}else if(_0x1124b3[_0x2c81('0x2c')]===_0x2c81('0x34')&&_0x1124b3[_0x2c81('0x35')]&&_0x1124b3[_0x2c81('0x35')][_0x2c81('0x36')]&&_0x1124b3[_0x2c81('0x30')]&&_0x1124b3[_0x2c81('0x2d')]){_0x5b00bd[_0x1124b3[_0x2c81('0x30')][_0x2c81('0x32')]()]=_0x2a5e8c[_0x1124b3[_0x2c81('0x35')][_0x2c81('0x36')][_0x2c81('0x32')]()]['toString']();}});}return _0x5b00bd;}function getTicket(_0x3a2883,_0x8582c2,_0x5d96c9,_0x577846,_0x299422,_0x5a8d4d){return function(_0x35a8fe){logger[_0x2c81('0x10')]('['+[_0x3a2883['toUpperCase']()]+_0x2c81('0x37'),_0x35a8fe);return new Promise(function(_0x46c1c1,_0x36e7d6){var _0x31e385=_0x3a2883[_0x2c81('0x32')]()===_0x2c81('0x38')?_0x35a8fe[_0x2c81('0x1b')]:_0x35a8fe[_0x2c81('0x24')];var _0x47e195={'method':_0x2c81('0x20'),'uri':_0x5d96c9+_0x2c81('0x39')+'?'+_0x5a8d4d,'body':Object[_0x2c81('0x3a')]({},{'active':_0x2c81('0x1a'),'caller_id':_0x31e385,'assigned_to':_0x35a8fe[_0x2c81('0x1b')],'short_description':intUtil[_0x2c81('0x3b')](_0x577846[_0x2c81('0x3c')],_0x299422,'\x20'),'description':intUtil['getString'](_0x577846[_0x2c81('0x3d')],_0x299422,'\x0a')},getCustomFields(_0x577846[_0x2c81('0x3e')],_0x299422)),'auth':_0x8582c2,'json':!![]};return rp(_0x47e195)[_0x2c81('0xd')](function(_0x1b7a6c){logger[_0x2c81('0x10')]('['+[_0x3a2883[_0x2c81('0x13')]()]+_0x2c81('0x3f'),_0x1b7a6c[_0x2c81('0x19')]);_0x35a8fe[_0x2c81('0x40')]=_0x1b7a6c[_0x2c81('0x19')][_0x2c81('0x1c')];_0x35a8fe['ticketNumber']=_0x1b7a6c[_0x2c81('0x19')][_0x2c81('0x41')];logger[_0x2c81('0x10')]('['+[_0x3a2883[_0x2c81('0x13')]()]+']\x20getTicket\x20crm',_0x35a8fe);_0x46c1c1(_0x35a8fe);})[_0x2c81('0x12')](function(_0x382640){logger[_0x2c81('0x25')]('['+[_0x3a2883[_0x2c81('0x13')]()]+']',_0x382640['message']);_0x36e7d6(_0x382640[_0x2c81('0x14')]);});});};}function createRemoteTag(_0x54255e,_0x3ad322,_0x5f0267,_0x2ad16c){return new Promise(function(_0x122c87,_0x58e199){var _0x5c2930={'method':_0x2c81('0x20'),'uri':_0x5f0267+_0x2c81('0x42')+'?'+_0x2ad16c,'body':{'short_description':_0x54255e,'global':!![],'active':!![],'name':_0x54255e},'auth':_0x3ad322,'json':!![]};return rp(_0x5c2930)[_0x2c81('0xd')](function(_0x43e15c){var _0x553579=_0x43e15c['result'][_0x2c81('0x1c')];_0x122c87(_0x553579);});});}function getRemoteTag(_0x23219c,_0x4f9157,_0x4fea10,_0x305b84,_0x41f494){return new Promise(function(_0x3b5610,_0x306a6b){var _0x50ab59={'method':'GET','uri':_0x4fea10+_0x2c81('0x42')+_0x2c81('0x43')+_0x23219c+'&'+_0x305b84,'auth':_0x4f9157,'json':!![]};return rp(_0x50ab59)[_0x2c81('0xd')](function(_0x482ba9){if(_0x482ba9[_0x2c81('0x19')]['length']>0x0){var _0x30c9ff=_0x482ba9[_0x2c81('0x19')][0x0]['sys_id'];_0x3b5610(_0x30c9ff);}else{return createRemoteTag(_0x23219c,_0x4f9157,_0x4fea10,_0x305b84)['then'](function(_0x150dd4){_0x3b5610(_0x150dd4);});}});});}function assignTagToIncident(_0x1b6537,_0x3390af,_0x27f108,_0x4f0cde,_0x1cb96c){return new Promise(function(_0x29a84d,_0x1c892f){var _0x817df6={'method':_0x2c81('0x20'),'uri':_0x27f108+_0x2c81('0x44')+'?'+_0x1cb96c,'body':{'label':_0x1b6537,'table':_0x2c81('0x39'),'id_type':_0x2c81('0x45'),'table_key':_0x4f0cde[_0x2c81('0x40')],'title':'Incident\x20-\x20'+_0x4f0cde[_0x2c81('0x46')],'id_display':_0x4f0cde[_0x2c81('0x46')]},'auth':_0x3390af,'json':!![]};return rp(_0x817df6)[_0x2c81('0xd')](function(_0x127e3a){_0x29a84d();})[_0x2c81('0x12')](function(){_0x29a84d();});});}function manageTags(_0x29dba6,_0x19d45f,_0x59b667,_0x872312,_0x1693b2,_0xa89e63,_0x5b9b98){return new Promise(function(_0x38629a,_0x219dac){var _0x440cae=[];_0x19d45f[_0x2c81('0x28')](function(_0x3b389d){_0x440cae[_0x2c81('0x47')](getRemoteTag(_0x3b389d,_0x59b667,_0x872312,_0xa89e63,_0x5b9b98));});return Promise[_0x2c81('0x48')](_0x440cae)[_0x2c81('0xd')](function(_0x4fccf8){if(_0x4fccf8['length']){logger['info']('['+[_0x29dba6[_0x2c81('0x13')]()]+_0x2c81('0x49'),_0x4fccf8);var _0x2cdb8b=[];_0x4fccf8['forEach'](function(_0x5d1b63){_0x2cdb8b[_0x2c81('0x47')](assignTagToIncident(_0x5d1b63,_0x59b667,_0x872312,_0x1693b2,_0xa89e63));});return Promise['all'](_0x2cdb8b)['then'](function(){_0x38629a();})[_0x2c81('0x12')](function(){_0x38629a();});}else{_0x38629a();}});});}function getTags(_0x409118,_0x48acd6,_0x400845,_0x305a0b,_0xb86080,_0x368da1){return function(_0x2ac460){return new Promise(function(_0x409e0e,_0x4f016e){var _0x281583=[];var _0x53fb35=_0x305a0b[_0x2c81('0x4a')];if(_0x53fb35&&_0x53fb35[_0x2c81('0xe')]>0x0){_0x281583=_[_0x2c81('0x4b')](_0x53fb35,_0x2c81('0x36'));}if(_0x281583['length']>0x0){return manageTags(_0x409118,_0x281583,_0x48acd6,_0x400845,_0x2ac460,_0xb86080,_0x368da1)[_0x2c81('0xd')](function(){_0x409e0e(_0x2ac460);});}else{_0x409e0e(_0x2ac460);}});};}function emit(_0x582dbf,_0x83d51,_0x30e9d0){var _0x17dd9c=_0x2c81('0x4c')+_0x2c81('0x4d')+_0x2c81('0x4e')+'%255EORDERBYDESCnumber';var _0x220371={'uri':_0x582dbf+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x30e9d0+_0x17dd9c};io['to'](util[_0x2c81('0x4f')](_0x2c81('0x50'),_0x83d51))['emit'](_0x2c81('0x51'),_0x220371);}exports['cs']=function(_0x33bf64,_0x3c79b3,_0x8cbdd0,_0x188bc5,_0x18bc1e,_0x37a1f0,_0x1da2b7,_0x39fc54){var _0x22cbcd={};var _0x212a0a={'user':_0x37a1f0[_0x2c81('0x52')],'pass':_0x37a1f0['password']};var _0x254f24='sysparm_limit=1';var _0x2251fd=_0x2c81('0x53');_0x37a1f0['remoteUri']=intUtil[_0x2c81('0x54')](_0x37a1f0[_0x2c81('0x55')]);_0x37a1f0[_0x2c81('0x56')]=intUtil['stripTrailingSlash'](_0x37a1f0['serverUrl']);var _0xb3e38c=util['format']('%s/api/now/table/',_0x37a1f0[_0x2c81('0x55')]);_0x22cbcd['userEmail']=!_[_0x2c81('0x57')](_0x188bc5)?_0x188bc5[_0x2c81('0x58')]:null;_0x22cbcd[_0x2c81('0x1d')]=_0x37a1f0['email'];_0x22cbcd[_0x2c81('0x21')]=_0x39fc54[_0x2c81('0x32')]()===_0x2c81('0x38')?_0x3c79b3['destcalleridnum']:_0x3c79b3[_0x2c81('0x59')];_0x22cbcd[_0x2c81('0x5a')]=_0x39fc54==='queue'||_0x39fc54===_0x2c81('0x5b')?_0x2c81('0x5c'):_0x2c81('0x38');var _0x17ad6a=util[_0x2c81('0x4f')](_0x2c81('0x5d'),_0x37a1f0['serverUrl'],_0x3c79b3[_0x2c81('0x5e')],md5(_0x3c79b3[_0x2c81('0x5e')]));if(_0x18bc1e&&_0x18bc1e[_0x2c81('0x5f')]){logger[_0x2c81('0x10')](_0x2c81('0x60'),_0x2c81('0x61'));_0x3c79b3[_0x2c81('0x62')]=_0x17ad6a;}else if(_0x1da2b7&&_0x1da2b7[_0x2c81('0x63')]&&_0x1da2b7[_0x2c81('0x63')]!==_0x2c81('0x64')){logger[_0x2c81('0x10')](_0x2c81('0x65'),_0x2c81('0x61'));_0x3c79b3[_0x2c81('0x62')]=_0x17ad6a;}else{_0x3c79b3[_0x2c81('0x62')]='';}return getAdminUser(_0x39fc54,_0x212a0a,_0x22cbcd,_0xb3e38c,_0x2251fd,_0x254f24)[_0x2c81('0xd')](getUser(_0x39fc54,_0x212a0a,_0xb3e38c,_0x2251fd,_0x254f24))[_0x2c81('0xd')](getEndUser(_0x39fc54,_0x212a0a,_0xb3e38c,_0x2251fd,_0x254f24))[_0x2c81('0xd')](getTicket(_0x39fc54,_0x212a0a,_0xb3e38c,_0x8cbdd0,_0x3c79b3,_0x2251fd))[_0x2c81('0xd')](function(_0x888487){logger[_0x2c81('0x10')](util[_0x2c81('0x4f')](_0x2c81('0x66'),_0x888487['ticketId']));logger[_0x2c81('0x10')](util[_0x2c81('0x4f')](_0x2c81('0x67'),_0x39fc54));if(_0x39fc54!==_0x2c81('0x5b')){logger[_0x2c81('0x10')]('['+[_0x39fc54[_0x2c81('0x13')]()]+']',_0x2c81('0x68'));emit(_0x37a1f0[_0x2c81('0x55')],_0x188bc5[_0x2c81('0x36')],_0x888487['ticketId']);}})[_0x2c81('0x12')](function(_0x5e24bd){logger[_0x2c81('0x25')]('['+[_0x39fc54['toUpperCase']()]+_0x2c81('0x69'),util[_0x2c81('0x6a')](_0x5e24bd,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/sugarcrm.js b/server/services/ami/trigger/integration/sugarcrm.js index b119d4f..9cd0bbc 100644 --- a/server/services/ami/trigger/integration/sugarcrm.js +++ b/server/services/ami/trigger/integration/sugarcrm.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x718e=['catch','error','outbound','uri','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','Fields','Outbound','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','toUpperCase','lodash','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','defaults','localhost','redis','POST','emit','info','getString','Subjects','assigned_user_id','created_by','description','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','variableName','push','idField','set_entry','JSON','stringify','Calls','format','toString','base64','get_server_info','isNil','get_entry_list','Employees','name','entry_list','length','find','name_value_list','value','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','user_name','Searching\x20enduser\x20with\x20phone','Contacts','phone_home','then','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','type','string','nameField','customField','content','variable','custom_fields','customVariable','Variable','toLowerCase','login','password','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','user:%s','trigger:browser:url'];(function(_0xad6d58,_0x38fc4f){var _0x2dd640=function(_0xf802da){while(--_0xf802da){_0xad6d58['push'](_0xad6d58['shift']());}};_0x2dd640(++_0x38fc4f);}(_0x718e,0x1ee));var _0xe718=function(_0x2526e3,_0x5f22f8){_0x2526e3=_0x2526e3-0x0;var _0xcf6f48=_0x718e[_0x2526e3];return _0xcf6f48;};'use strict';var _=require(_0xe718('0x0'));var rp=require('request-promise');var BPromise=require(_0xe718('0x1'));var md5=require('md5');var util=require(_0xe718('0x2'));var Redis=require(_0xe718('0x3'));var intUtil=require(_0xe718('0x4'));var config=require(_0xe718('0x5'));var logger=require(_0xe718('0x6'))(_0xe718('0x7'));config['redis']=_[_0xe718('0x8')](config['redis'],{'host':_0xe718('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe718('0xa')]));var def={'method':_0xe718('0xb'),'json':!![]};function emit(_0x4491aa,_0x51bbbe,_0x582b7d){io['to'](_0x4491aa)[_0xe718('0xc')](_0x51bbbe,_0x582b7d);}function getTicket(_0x3db820,_0x2b0ea3,_0x4976bc,_0x358736,_0x2644c9,_0x435986,_0x4c3401,_0x1721fc){logger[_0xe718('0xd')]('Creating\x20new\x20ticket...');var _0x1c9988=new Date();var _0x24d1b0=[{'name':'name','value':intUtil[_0xe718('0xe')](_0x358736[_0xe718('0xf')],_0x2644c9,'\x20')},{'name':_0xe718('0x10'),'value':_0x2b0ea3['id']},{'name':_0xe718('0x11'),'value':_0x2b0ea3['id']},{'name':_0xe718('0x12'),'value':intUtil[_0xe718('0xe')](_0x358736['Descriptions'],_0x2644c9,'\x0a')},{'name':_0xe718('0x13'),'value':_0x1c9988[_0xe718('0x14')]()[_0xe718('0x15')](0x0,0x13)[_0xe718('0x16')]('T','\x20')},{'name':_0xe718('0x17'),'value':'0'},{'name':_0xe718('0x18'),'value':'15'},{'name':_0xe718('0x19'),'value':_0x4976bc['id']},{'name':_0xe718('0x1a'),'value':'Contacts'},{'name':_0xe718('0x1b'),'value':_0x4976bc['name']},{'name':_0xe718('0x1c'),'value':_0x1721fc}];if(_0x435986['length']){_['forEach'](_0x435986,function(_0x48ef92){if(_0x2644c9[_0x48ef92[_0xe718('0x1d')]]){_0x24d1b0[_0xe718('0x1e')]({'name':_0x48ef92[_0xe718('0x1f')],'value':_0x2644c9[_0x48ef92['variableName']]});}});}return request({'form':{'method':_0xe718('0x20'),'input_type':_0xe718('0x21'),'response_type':_0xe718('0x21'),'rest_data':JSON[_0xe718('0x22')]({'session':_0x4c3401['id'],'module_name':_0xe718('0x23'),'name_value_list':_0x24d1b0})}});}function getAuth(_0x43d92e){return util[_0xe718('0x24')]('Basic\x20%s',new Buffer(_0x43d92e['apiKey']+':X')[_0xe718('0x25')](_0xe718('0x26')));}function getServerInfo(_0xc11be2){return request({'form':{'method':_0xe718('0x27'),'input_type':_0xe718('0x21'),'response_type':_0xe718('0x21'),'rest_data':JSON[_0xe718('0x22')]({'session':_0xc11be2['id']})}});}function getUser(_0x2fb769,_0x5aebbd,_0x29a07f){if(!_[_0xe718('0x28')](_0x5aebbd)){logger[_0xe718('0xd')]('Getting\x20agent\x20with\x20name',_0x5aebbd);return request({'form':{'method':_0xe718('0x29'),'input_type':_0xe718('0x21'),'response_type':_0xe718('0x21'),'rest_data':JSON[_0xe718('0x22')]({'session':_0x29a07f['id'],'module_name':_0xe718('0x2a'),'query':util['format']('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x5aebbd),'order_by':'','offset':'0','select_fields':['id',_0xe718('0x2b'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x379806){if(_0x379806[_0xe718('0x2c')][_0xe718('0x2d')]){var _0x447217=_[_0xe718('0x2e')](_0x379806['entry_list'],function(_0x363d91){return _0x363d91[_0xe718('0x2f')]['user_name'][_0xe718('0x30')]===_0x5aebbd;});if(_0x447217){logger[_0xe718('0xd')]('Agent\x20found!');return BPromise[_0xe718('0x31')]({'id':_0x447217[_0xe718('0x2f')]['id'][_0xe718('0x30')],'name':_0x447217[_0xe718('0x2f')][_0xe718('0x2b')][_0xe718('0x30')]});}}logger['info'](_0xe718('0x32'));return BPromise[_0xe718('0x31')]({'id':_0x29a07f[_0xe718('0x2f')][_0xe718('0x33')]['value'],'name':_0x29a07f[_0xe718('0x2f')][_0xe718('0x34')][_0xe718('0x30')]});});}else{logger[_0xe718('0xd')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0xe718('0x31')]({'id':_0x29a07f['name_value_list'][_0xe718('0x33')][_0xe718('0x30')],'name':_0x29a07f[_0xe718('0x2f')][_0xe718('0x34')]['value']});}}function getEndUser(_0xccf4ec,_0x1c258f,_0x816974,_0x27cfaa){logger[_0xe718('0xd')](_0xe718('0x35'),_0x816974);return request({'form':{'method':_0xe718('0x29'),'input_type':'JSON','response_type':_0xe718('0x21'),'rest_data':JSON['stringify']({'session':_0x27cfaa['id'],'module_name':_0xe718('0x36'),'query':util[_0xe718('0x24')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x816974),'order_by':'','offset':'0','select_fields':['id','name',_0xe718('0x37')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xe718('0x38')](function(_0x539b1b){if(_0x539b1b[_0xe718('0x2c')][_0xe718('0x2d')]){var _0x2c357e=_[_0xe718('0x2e')](_0x539b1b[_0xe718('0x2c')],function(_0x4517d8){return _0x4517d8[_0xe718('0x2f')][_0xe718('0x37')][_0xe718('0x30')]===_0x816974;});if(_0x2c357e){logger[_0xe718('0xd')]('Enduser\x20found!');return BPromise['resolve']({'id':_0x2c357e[_0xe718('0x2f')]['id'][_0xe718('0x30')],'name':_0x2c357e[_0xe718('0x2f')][_0xe718('0x2b')][_0xe718('0x30')],'phone':_0x2c357e['name_value_list']['phone_home']['value']});}}else{logger[_0xe718('0xd')](_0xe718('0x39'));return request({'form':{'method':_0xe718('0x20'),'input_type':'JSON','response_type':_0xe718('0x21'),'rest_data':JSON[_0xe718('0x22')]({'session':_0x27cfaa['id'],'module_name':'Contacts','name_value_list':[{'name':_0xe718('0x3a'),'value':_0x1c258f!==_0xe718('0x3b')?_0x1c258f:util[_0xe718('0x24')](_0xe718('0x3c'),_0x816974)},{'name':'phone_home','value':_0x816974}]})}})[_0xe718('0x38')](function(_0x404f09){logger[_0xe718('0xd')](_0xe718('0x3d'));return BPromise[_0xe718('0x31')]({'id':_0x404f09['id'],'name':_0x404f09[_0xe718('0x2c')]['first_name'][_0xe718('0x30')],'phone':_0x404f09[_0xe718('0x2c')][_0xe718('0x37')][_0xe718('0x30')]});});}});}function request(_0x4b6a0c){logger[_0xe718('0x3e')](_0xe718('0x3f'),JSON[_0xe718('0x22')](_0x4b6a0c));return rp(_[_0xe718('0x40')](def,_0x4b6a0c));}function getTags(_0x422a28,_0x50e65d){var _0x2157bc=[];if(_0x422a28&&_0x422a28[_0xe718('0x2d')]>0x0){_0x2157bc=_[_0xe718('0x41')](_0x422a28,_0x50e65d);}return _0x2157bc;}function getCustomFields(_0x112d4e,_0x5c14cd){var _0x555f80=[];var _0x460dfc={'custom_fields':[]};if(_0x112d4e[_0xe718('0x2d')]>0x0){_['forEach'](_0x112d4e,function(_0x4cd3f8){if(_0x4cd3f8[_0xe718('0x42')]===_0xe718('0x43')&&_0x4cd3f8[_0xe718('0x44')]&&!_0x4cd3f8['customField']){_0x460dfc[_0x4cd3f8['nameField']['toLowerCase']()]=_0x4cd3f8['content'][_0xe718('0x25')]();}else if(_0x4cd3f8['type']===_0xe718('0x43')&&_0x4cd3f8[_0xe718('0x1f')]&&_0x4cd3f8[_0xe718('0x45')]){_0x460dfc['custom_fields']['push']({'id':_0x4cd3f8['idField'],'value':_0x4cd3f8[_0xe718('0x46')][_0xe718('0x25')]()});}else if(_0x4cd3f8['type']===_0xe718('0x47')&&_0x4cd3f8[_0xe718('0x1d')]&&_0x4cd3f8[_0xe718('0x1f')]&&_0x4cd3f8[_0xe718('0x45')]){_0x5c14cd[_0x4cd3f8[_0xe718('0x1d')]]&&_0x460dfc[_0xe718('0x48')]['push']({'id':_0x4cd3f8[_0xe718('0x1f')],'value':_0x5c14cd[_0x4cd3f8[_0xe718('0x1d')]][_0xe718('0x25')]()});}else if(_0x4cd3f8[_0xe718('0x42')]===_0xe718('0x49')&&_0x4cd3f8[_0xe718('0x4a')]&&_0x4cd3f8[_0xe718('0x4a')][_0xe718('0x2b')]&&_0x4cd3f8[_0xe718('0x1f')]&&_0x4cd3f8[_0xe718('0x45')]){_0x5c14cd[_0x4cd3f8[_0xe718('0x4a')][_0xe718('0x2b')][_0xe718('0x4b')]()]&&_0x460dfc[_0xe718('0x48')][_0xe718('0x1e')]({'id':_0x4cd3f8['idField'],'value':_0x5c14cd[_0x4cd3f8[_0xe718('0x4a')][_0xe718('0x2b')][_0xe718('0x4b')]()][_0xe718('0x25')]()});}});}return _0x460dfc;}function getConnection(_0x4c2fd7){return request({'method':_0xe718('0xb'),'form':{'method':_0xe718('0x4c'),'input_type':_0xe718('0x21'),'response_type':_0xe718('0x21'),'rest_data':JSON[_0xe718('0x22')]({'user_auth':{'user_name':_0x4c2fd7['username'],'password':_0x4c2fd7[_0xe718('0x4d')],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20integration'})}})[_0xe718('0x38')](function(_0x10e514){var _0x1a449b=_0x10e514;if(_0x1a449b['id']){def[_0xe718('0x4e')]=_0x1a449b['id'];return BPromise['resolve'](_0x1a449b);}else{throw new Error(util['format'](_0xe718('0x4f'),_0x4c2fd7['id']));}});}function setRelationship(_0x5ca623,_0xf1c14,_0x59ce0f,_0x5db61c){return request({'form':{'method':_0xe718('0x50'),'input_type':_0xe718('0x21'),'response_type':_0xe718('0x21'),'rest_data':JSON[_0xe718('0x22')]({'session':_0x5ca623['id'],'module_name':'Calls','module_id':_0x59ce0f['id'],'link_field_name':_0x5db61c,'related_ids':[_0xf1c14['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xe718('0x51')]=function(_0x2e1c5d,_0x3bbdfd,_0x19252a,_0x2e4b3f,_0x5592bd,_0x38cf55){var _0x27762d,_0x2c1ba5,_0x535597,_0x967afd;_0x38cf55[_0xe718('0x52')]=intUtil[_0xe718('0x53')](_0x38cf55[_0xe718('0x52')]);_0x38cf55['serverUrl']=intUtil['stripTrailingSlash'](_0x38cf55[_0xe718('0x54')]);def['uri']=util[_0xe718('0x24')](_0xe718('0x55'),_0x38cf55[_0xe718('0x52')]);if(_0x5592bd&&_0x5592bd[_0xe718('0x56')]){logger[_0xe718('0xd')](_0xe718('0x57'),_0xe718('0x58'));_0x3bbdfd[_0xe718('0x59')]=util['format'](_0xe718('0x5a'),_0x38cf55[_0xe718('0x54')],_0x3bbdfd['uniqueid'],md5(_0x3bbdfd[_0xe718('0x5b')]));}else{_0x3bbdfd['recordingURL']='';}return getConnection(_0x38cf55)[_0xe718('0x38')](function(_0x4db80d){_0x967afd=_0x4db80d;return getUser(_0x38cf55,_0x2e4b3f[_0xe718('0x2b')],_0x967afd);})[_0xe718('0x38')](function(_0x217fe7){_0x27762d=_0x217fe7;logger[_0xe718('0xd')](_0xe718('0x5c'),_0x27762d['id']);return getEndUser(_0x38cf55,_0x3bbdfd[_0xe718('0x5d')],_0x3bbdfd[_0xe718('0x5e')],_0x967afd);})[_0xe718('0x38')](function(_0x559b0e){_0x2c1ba5=_0x559b0e;logger[_0xe718('0xd')](_0xe718('0x5f'),_0x2c1ba5['id']);return getTicket(_0x38cf55,_0x27762d,_0x2c1ba5,_0x19252a,_0x3bbdfd,_0x19252a['Fields'],_0x967afd,_0xe718('0x60'));})[_0xe718('0x38')](function(_0x14f0f5){_0x535597=_0x14f0f5;logger[_0xe718('0xd')]('Ticket\x20created!');logger[_0xe718('0xd')](_0xe718('0x61'),_0x535597['id']);return setRelationship(_0x967afd,_0x27762d,_0x535597,_0xe718('0x62'));})['then'](function(){return setRelationship(_0x967afd,_0x2c1ba5,_0x535597,_0xe718('0x63'));})[_0xe718('0x38')](function(){return getServerInfo(_0x967afd);})['then'](function(_0x4ab21e){var _0x12d1ca=parseInt(_0x4ab21e[_0xe718('0x64')][_0xe718('0x65')](0x0));var _0x5a38b6=util[_0xe718('0x24')](_0xe718('0x66'),_0x38cf55[_0xe718('0x52')],_0x535597['id']);if(_0x12d1ca>0x6){_0x5a38b6=util[_0xe718('0x24')](_0xe718('0x67'),_0x38cf55[_0xe718('0x52')],_0x535597['id']);}logger[_0xe718('0xd')](_0xe718('0x57'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xe718('0x68'),_0x2e4b3f['name']),_0xe718('0x69'),{'uri':_0x5a38b6});})[_0xe718('0x6a')](function(_0x487056){logger[_0xe718('0x6b')](_0xe718('0x57'),JSON['stringify'](_0x487056));});};exports[_0xe718('0x6c')]=function(_0x3f2dda,_0x24ef9c,_0x52e5b5,_0x112ead,_0x4b738b,_0xbea5ca,_0x3b3760){var _0x103f07,_0x36ebc1,_0x474357,_0x226835;_0xbea5ca[_0xe718('0x52')]=intUtil['stripTrailingSlash'](_0xbea5ca['remoteUri']);_0xbea5ca[_0xe718('0x54')]=intUtil[_0xe718('0x53')](_0xbea5ca[_0xe718('0x54')]);def[_0xe718('0x6d')]=util[_0xe718('0x24')](_0xe718('0x55'),_0xbea5ca[_0xe718('0x52')]);if(_0x3b3760&&_0x3b3760[_0xe718('0x6e')]&&_0x3b3760[_0xe718('0x6e')]!=='none'){logger[_0xe718('0xd')](_0xe718('0x6f'),_0xe718('0x58'));_0x24ef9c[_0xe718('0x59')]=util['format'](_0xe718('0x5a'),_0xbea5ca[_0xe718('0x54')],_0x24ef9c[_0xe718('0x5b')],md5(_0x24ef9c[_0xe718('0x5b')]));}return getConnection(_0xbea5ca)['then'](function(_0x5ed4d3){_0x226835=_0x5ed4d3;return getUser(_0xbea5ca,_0x112ead['name'],_0x226835);})[_0xe718('0x38')](function(_0x2c7a91){_0x103f07=_0x2c7a91;logger[_0xe718('0xd')](_0xe718('0x5c'),_0x103f07['id']);return getEndUser(_0xbea5ca,_0x24ef9c[_0xe718('0x70')],_0x24ef9c[_0xe718('0x71')],_0x226835);})[_0xe718('0x38')](function(_0x16075e){_0x36ebc1=_0x16075e;logger[_0xe718('0xd')](_0xe718('0x5f'),_0x36ebc1['id']);return getTicket(_0xbea5ca,_0x103f07,_0x36ebc1,_0x52e5b5,_0x24ef9c,_0x52e5b5[_0xe718('0x72')],_0x226835,_0xe718('0x73'));})[_0xe718('0x38')](function(_0x5751d4){_0x474357=_0x5751d4;logger[_0xe718('0xd')](_0xe718('0x74'));logger['info'](_0xe718('0x61'),_0x474357['id']);return setRelationship(_0x226835,_0x103f07,_0x474357,'users');})['then'](function(){return setRelationship(_0x226835,_0x36ebc1,_0x474357,_0xe718('0x63'));})[_0xe718('0x38')](function(){return getServerInfo(_0x226835);})[_0xe718('0x38')](function(_0x458cb1){var _0x51f9d3=parseInt(_0x458cb1[_0xe718('0x64')][_0xe718('0x65')](0x0));var _0x5ef117=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0xbea5ca[_0xe718('0x52')],_0x474357['id']);if(_0x51f9d3>0x6){_0x5ef117=util[_0xe718('0x24')](_0xe718('0x67'),_0xbea5ca['remoteUri'],_0x474357['id']);}logger['info'](_0xe718('0x6f'),_0xe718('0x75'));emit(util[_0xe718('0x24')](_0xe718('0x68'),_0x112ead[_0xe718('0x2b')]),'trigger:browser:url',{'uri':_0x5ef117});})[_0xe718('0x6a')](function(_0x58b69c){logger[_0xe718('0x6b')](_0xe718('0x6f'),JSON[_0xe718('0x22')](_0x58b69c));});};exports[_0xe718('0x76')]=function(_0x286cb6,_0x4de32f,_0x445640,_0x1fc5e1,_0x5d8cd3,_0x185526){var _0x5a9862,_0x1ca3ab,_0x4cc20c,_0x353bc2;_0x185526[_0xe718('0x52')]=intUtil[_0xe718('0x53')](_0x185526['remoteUri']);_0x185526['serverUrl']=intUtil[_0xe718('0x53')](_0x185526[_0xe718('0x54')]);def[_0xe718('0x6d')]=util[_0xe718('0x24')](_0xe718('0x55'),_0x185526['remoteUri']);if(_0x5d8cd3&&_0x5d8cd3['monitor_format']){logger[_0xe718('0xd')]('['+_0x4de32f['lastevent']['toUpperCase']()+']',_0xe718('0x58'));_0x4de32f[_0xe718('0x59')]=util[_0xe718('0x24')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x185526[_0xe718('0x54')],_0x4de32f['uniqueid'],md5(_0x4de32f[_0xe718('0x5b')]));}else{_0x4de32f[_0xe718('0x59')]='';}return getConnection(_0x185526)[_0xe718('0x38')](function(_0x180525){_0x353bc2=_0x180525;if(!_[_0xe718('0x28')](_0x1fc5e1)){return getUser(_0x185526,_0x1fc5e1[_0xe718('0x2b')],_0x353bc2);}else{return getUser(_0x185526,null,_0x353bc2);}})[_0xe718('0x38')](function(_0x40589f){_0x5a9862=_0x40589f;logger['info'](_0xe718('0x5c'),_0x5a9862['id']);return getEndUser(_0x185526,_0x4de32f[_0xe718('0x5d')],_0x4de32f[_0xe718('0x5e')],_0x353bc2);})[_0xe718('0x38')](function(_0xc48dad){_0x1ca3ab=_0xc48dad;logger[_0xe718('0xd')](_0xe718('0x5f'),_0x1ca3ab['id']);return getTicket(_0x185526,_0x5a9862,_0x1ca3ab,_0x445640,_0x4de32f,_0x445640[_0xe718('0x72')],_0x353bc2,_0xe718('0x60'));})[_0xe718('0x38')](function(_0x8fb673){_0x4cc20c=_0x8fb673;logger['info']('Ticket\x20created!');logger[_0xe718('0xd')](_0xe718('0x61'),_0x4cc20c['id']);return setRelationship(_0x353bc2,_0x5a9862,_0x4cc20c,_0xe718('0x62'));})[_0xe718('0x38')](function(){return setRelationship(_0x353bc2,_0x1ca3ab,_0x4cc20c,'contacts');})[_0xe718('0x38')](function(){return getServerInfo(_0x353bc2);})[_0xe718('0x6a')](function(_0x57f765){logger[_0xe718('0x6b')]('['+_0x4de32f['lastevent'][_0xe718('0x77')]()+']',JSON[_0xe718('0x22')](_0x57f765));});}; \ No newline at end of file +var _0xd8f6=['util','./util','../../../../config/environment','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','Descriptions','date_start','toISOString','slice','replace','duration_minutes','parent_id','parent_type','Contacts','parent_name','length','forEach','push','idField','variableName','set_entry','JSON','Calls','apiKey','toString','base64','get_server_info','stringify','info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','format','user_name','then','entry_list','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','find','Enduser\x20found!','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','debug','[HTTP]','string','customField','nameField','toLowerCase','content','custom_fields','type','variable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','error','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','trigger:browser:url','monitor_format','lastevent','toUpperCase','Recording\x20is\x20enabled!','isNil','calleridname','request-promise','bluebird','md5'];(function(_0x3f57d7,_0x218827){var _0x15d43a=function(_0x6fb7b7){while(--_0x6fb7b7){_0x3f57d7['push'](_0x3f57d7['shift']());}};_0x15d43a(++_0x218827);}(_0xd8f6,0x16b));var _0x6d8f=function(_0x240d73,_0x4c66bc){_0x240d73=_0x240d73-0x0;var _0xfb10a5=_0xd8f6[_0x240d73];return _0xfb10a5;};'use strict';var _=require('lodash');var rp=require(_0x6d8f('0x0'));var BPromise=require(_0x6d8f('0x1'));var md5=require(_0x6d8f('0x2'));var util=require(_0x6d8f('0x3'));var Redis=require('ioredis');var intUtil=require(_0x6d8f('0x4'));var config=require(_0x6d8f('0x5'));var logger=require('../../../../config/logger')(_0x6d8f('0x6'));config[_0x6d8f('0x7')]=_[_0x6d8f('0x8')](config[_0x6d8f('0x7')],{'host':_0x6d8f('0x9'),'port':0x18eb});var io=require(_0x6d8f('0xa'))(new Redis(config[_0x6d8f('0x7')]));var def={'method':_0x6d8f('0xb'),'json':!![]};function emit(_0x189ad7,_0xb3a7df,_0x320d94){io['to'](_0x189ad7)[_0x6d8f('0xc')](_0xb3a7df,_0x320d94);}function getTicket(_0x495d57,_0x5e10bf,_0x4bba07,_0x9c9d8b,_0x11e943,_0x4ee5f7,_0x3346d5,_0x4e8861){logger['info'](_0x6d8f('0xd'));var _0x3c66f0=new Date();var _0x2af6e9=[{'name':_0x6d8f('0xe'),'value':intUtil[_0x6d8f('0xf')](_0x9c9d8b[_0x6d8f('0x10')],_0x11e943,'\x20')},{'name':_0x6d8f('0x11'),'value':_0x5e10bf['id']},{'name':_0x6d8f('0x12'),'value':_0x5e10bf['id']},{'name':'description','value':intUtil[_0x6d8f('0xf')](_0x9c9d8b[_0x6d8f('0x13')],_0x11e943,'\x0a')},{'name':_0x6d8f('0x14'),'value':_0x3c66f0[_0x6d8f('0x15')]()[_0x6d8f('0x16')](0x0,0x13)[_0x6d8f('0x17')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x6d8f('0x18'),'value':'15'},{'name':_0x6d8f('0x19'),'value':_0x4bba07['id']},{'name':_0x6d8f('0x1a'),'value':_0x6d8f('0x1b')},{'name':_0x6d8f('0x1c'),'value':_0x4bba07['name']},{'name':'direction','value':_0x4e8861}];if(_0x4ee5f7[_0x6d8f('0x1d')]){_[_0x6d8f('0x1e')](_0x4ee5f7,function(_0x24439f){if(_0x11e943[_0x24439f['variableName']]){_0x2af6e9[_0x6d8f('0x1f')]({'name':_0x24439f[_0x6d8f('0x20')],'value':_0x11e943[_0x24439f[_0x6d8f('0x21')]]});}});}return request({'form':{'method':_0x6d8f('0x22'),'input_type':_0x6d8f('0x23'),'response_type':_0x6d8f('0x23'),'rest_data':JSON['stringify']({'session':_0x3346d5['id'],'module_name':_0x6d8f('0x24'),'name_value_list':_0x2af6e9})}});}function getAuth(_0x34132f){return util['format']('Basic\x20%s',new Buffer(_0x34132f[_0x6d8f('0x25')]+':X')[_0x6d8f('0x26')](_0x6d8f('0x27')));}function getServerInfo(_0x1b8962){return request({'form':{'method':_0x6d8f('0x28'),'input_type':_0x6d8f('0x23'),'response_type':_0x6d8f('0x23'),'rest_data':JSON[_0x6d8f('0x29')]({'session':_0x1b8962['id']})}});}function getUser(_0x12251d,_0x1c0e33,_0x5910a7){if(!_['isNil'](_0x1c0e33)){logger[_0x6d8f('0x2a')](_0x6d8f('0x2b'),_0x1c0e33);return request({'form':{'method':_0x6d8f('0x2c'),'input_type':'JSON','response_type':_0x6d8f('0x23'),'rest_data':JSON[_0x6d8f('0x29')]({'session':_0x5910a7['id'],'module_name':_0x6d8f('0x2d'),'query':util[_0x6d8f('0x2e')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x1c0e33),'order_by':'','offset':'0','select_fields':['id',_0x6d8f('0xe'),_0x6d8f('0x2f')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x6d8f('0x30')](function(_0x380727){if(_0x380727[_0x6d8f('0x31')][_0x6d8f('0x1d')]){var _0x401f53=_['find'](_0x380727[_0x6d8f('0x31')],function(_0x2ee652){return _0x2ee652[_0x6d8f('0x32')][_0x6d8f('0x2f')][_0x6d8f('0x33')]===_0x1c0e33;});if(_0x401f53){logger[_0x6d8f('0x2a')](_0x6d8f('0x34'));return BPromise[_0x6d8f('0x35')]({'id':_0x401f53[_0x6d8f('0x32')]['id'][_0x6d8f('0x33')],'name':_0x401f53['name_value_list'][_0x6d8f('0xe')][_0x6d8f('0x33')]});}}logger['info'](_0x6d8f('0x36'));return BPromise['resolve']({'id':_0x5910a7[_0x6d8f('0x32')]['user_id'][_0x6d8f('0x33')],'name':_0x5910a7[_0x6d8f('0x32')][_0x6d8f('0x2f')]['value']});});}else{logger[_0x6d8f('0x2a')](_0x6d8f('0x37'));return BPromise[_0x6d8f('0x35')]({'id':_0x5910a7[_0x6d8f('0x32')][_0x6d8f('0x38')]['value'],'name':_0x5910a7[_0x6d8f('0x32')][_0x6d8f('0x2f')][_0x6d8f('0x33')]});}}function getEndUser(_0x2edf40,_0x3f891b,_0x4c7db4,_0x5be033){logger[_0x6d8f('0x2a')](_0x6d8f('0x39'),_0x4c7db4);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':_0x6d8f('0x23'),'rest_data':JSON[_0x6d8f('0x29')]({'session':_0x5be033['id'],'module_name':_0x6d8f('0x1b'),'query':util[_0x6d8f('0x2e')](_0x6d8f('0x3a'),_0x4c7db4),'order_by':'','offset':'0','select_fields':['id',_0x6d8f('0xe'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x6d8f('0x30')](function(_0x3e8c31){if(_0x3e8c31['entry_list'][_0x6d8f('0x1d')]){var _0x47759b=_[_0x6d8f('0x3b')](_0x3e8c31[_0x6d8f('0x31')],function(_0x2dd801){return _0x2dd801[_0x6d8f('0x32')]['phone_home'][_0x6d8f('0x33')]===_0x4c7db4;});if(_0x47759b){logger[_0x6d8f('0x2a')](_0x6d8f('0x3c'));return BPromise[_0x6d8f('0x35')]({'id':_0x47759b[_0x6d8f('0x32')]['id']['value'],'name':_0x47759b[_0x6d8f('0x32')]['name'][_0x6d8f('0x33')],'phone':_0x47759b[_0x6d8f('0x32')][_0x6d8f('0x3d')][_0x6d8f('0x33')]});}}else{logger[_0x6d8f('0x2a')](_0x6d8f('0x3e'));return request({'form':{'method':_0x6d8f('0x22'),'input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'session':_0x5be033['id'],'module_name':_0x6d8f('0x1b'),'name_value_list':[{'name':_0x6d8f('0x3f'),'value':_0x3f891b!==_0x6d8f('0x40')?_0x3f891b:util[_0x6d8f('0x2e')]('Caller\x20-\x20%s',_0x4c7db4)},{'name':_0x6d8f('0x3d'),'value':_0x4c7db4}]})}})[_0x6d8f('0x30')](function(_0x7bef90){logger['info']('Enduser\x20created.');return BPromise[_0x6d8f('0x35')]({'id':_0x7bef90['id'],'name':_0x7bef90[_0x6d8f('0x31')][_0x6d8f('0x3f')][_0x6d8f('0x33')],'phone':_0x7bef90[_0x6d8f('0x31')][_0x6d8f('0x3d')][_0x6d8f('0x33')]});});}});}function request(_0x4b1079){logger[_0x6d8f('0x41')](_0x6d8f('0x42'),JSON[_0x6d8f('0x29')](_0x4b1079));return rp(_['merge'](def,_0x4b1079));}function getTags(_0x1aad12,_0x4250e2){var _0x17cdf8=[];if(_0x1aad12&&_0x1aad12[_0x6d8f('0x1d')]>0x0){_0x17cdf8=_['map'](_0x1aad12,_0x4250e2);}return _0x17cdf8;}function getCustomFields(_0x30a436,_0x1dafdf){var _0xc5539a=[];var _0x2ad2b7={'custom_fields':[]};if(_0x30a436[_0x6d8f('0x1d')]>0x0){_['forEach'](_0x30a436,function(_0x50c0cb){if(_0x50c0cb['type']===_0x6d8f('0x43')&&_0x50c0cb['nameField']&&!_0x50c0cb[_0x6d8f('0x44')]){_0x2ad2b7[_0x50c0cb[_0x6d8f('0x45')][_0x6d8f('0x46')]()]=_0x50c0cb[_0x6d8f('0x47')][_0x6d8f('0x26')]();}else if(_0x50c0cb['type']===_0x6d8f('0x43')&&_0x50c0cb[_0x6d8f('0x20')]&&_0x50c0cb[_0x6d8f('0x44')]){_0x2ad2b7[_0x6d8f('0x48')][_0x6d8f('0x1f')]({'id':_0x50c0cb[_0x6d8f('0x20')],'value':_0x50c0cb[_0x6d8f('0x47')][_0x6d8f('0x26')]()});}else if(_0x50c0cb[_0x6d8f('0x49')]===_0x6d8f('0x4a')&&_0x50c0cb[_0x6d8f('0x21')]&&_0x50c0cb['idField']&&_0x50c0cb['customField']){_0x1dafdf[_0x50c0cb[_0x6d8f('0x21')]]&&_0x2ad2b7[_0x6d8f('0x48')][_0x6d8f('0x1f')]({'id':_0x50c0cb[_0x6d8f('0x20')],'value':_0x1dafdf[_0x50c0cb[_0x6d8f('0x21')]][_0x6d8f('0x26')]()});}else if(_0x50c0cb[_0x6d8f('0x49')]==='customVariable'&&_0x50c0cb[_0x6d8f('0x4b')]&&_0x50c0cb['Variable'][_0x6d8f('0xe')]&&_0x50c0cb[_0x6d8f('0x20')]&&_0x50c0cb['customField']){_0x1dafdf[_0x50c0cb[_0x6d8f('0x4b')]['name'][_0x6d8f('0x46')]()]&&_0x2ad2b7[_0x6d8f('0x48')][_0x6d8f('0x1f')]({'id':_0x50c0cb[_0x6d8f('0x20')],'value':_0x1dafdf[_0x50c0cb[_0x6d8f('0x4b')][_0x6d8f('0xe')][_0x6d8f('0x46')]()]['toString']()});}});}return _0x2ad2b7;}function getConnection(_0x11f63a){return request({'method':_0x6d8f('0xb'),'form':{'method':_0x6d8f('0x4c'),'input_type':_0x6d8f('0x23'),'response_type':_0x6d8f('0x23'),'rest_data':JSON[_0x6d8f('0x29')]({'user_auth':{'user_name':_0x11f63a[_0x6d8f('0x4d')],'password':_0x11f63a[_0x6d8f('0x4e')],'encryption':_0x6d8f('0x4f')},'application':_0x6d8f('0x50')})}})[_0x6d8f('0x30')](function(_0x241ed3){var _0x295d5b=_0x241ed3;if(_0x295d5b['id']){def['sessionID']=_0x295d5b['id'];return BPromise[_0x6d8f('0x35')](_0x295d5b);}else{throw new Error(util[_0x6d8f('0x2e')]('Account\x20%d\x20is\x20not\x20valid',_0x11f63a['id']));}});}function setRelationship(_0x5c2f9b,_0x1d8697,_0x255d13,_0x1aa354){return request({'form':{'method':_0x6d8f('0x51'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x6d8f('0x29')]({'session':_0x5c2f9b['id'],'module_name':_0x6d8f('0x24'),'module_id':_0x255d13['id'],'link_field_name':_0x1aa354,'related_ids':[_0x1d8697['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x6d8f('0x52')]=function(_0x382a81,_0x135325,_0x41d4cb,_0x4ebdf4,_0x28a2fb,_0x3105bc){var _0x10c08e,_0x7685d8,_0x86fb5,_0x1bb9ce;_0x3105bc[_0x6d8f('0x53')]=intUtil[_0x6d8f('0x54')](_0x3105bc[_0x6d8f('0x53')]);_0x3105bc[_0x6d8f('0x55')]=intUtil[_0x6d8f('0x54')](_0x3105bc['serverUrl']);def[_0x6d8f('0x56')]=util[_0x6d8f('0x2e')](_0x6d8f('0x57'),_0x3105bc['remoteUri']);if(_0x28a2fb&&_0x28a2fb['monitor_format']){logger[_0x6d8f('0x2a')](_0x6d8f('0x58'),'Recording\x20is\x20enabled!');_0x135325[_0x6d8f('0x59')]=util[_0x6d8f('0x2e')](_0x6d8f('0x5a'),_0x3105bc[_0x6d8f('0x55')],_0x135325['uniqueid'],md5(_0x135325[_0x6d8f('0x5b')]));}else{_0x135325[_0x6d8f('0x59')]='';}return getConnection(_0x3105bc)[_0x6d8f('0x30')](function(_0x5de2cb){_0x1bb9ce=_0x5de2cb;return getUser(_0x3105bc,_0x4ebdf4['name'],_0x1bb9ce);})[_0x6d8f('0x30')](function(_0xab41a6){_0x10c08e=_0xab41a6;logger[_0x6d8f('0x2a')]('The\x20User\x20ID\x20is:',_0x10c08e['id']);return getEndUser(_0x3105bc,_0x135325['calleridname'],_0x135325[_0x6d8f('0x5c')],_0x1bb9ce);})[_0x6d8f('0x30')](function(_0x30741d){_0x7685d8=_0x30741d;logger[_0x6d8f('0x2a')](_0x6d8f('0x5d'),_0x7685d8['id']);return getTicket(_0x3105bc,_0x10c08e,_0x7685d8,_0x41d4cb,_0x135325,_0x41d4cb[_0x6d8f('0x5e')],_0x1bb9ce,_0x6d8f('0x5f'));})[_0x6d8f('0x30')](function(_0x2a4221){_0x86fb5=_0x2a4221;logger['info'](_0x6d8f('0x60'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x86fb5['id']);return setRelationship(_0x1bb9ce,_0x10c08e,_0x86fb5,_0x6d8f('0x61'));})['then'](function(){return setRelationship(_0x1bb9ce,_0x7685d8,_0x86fb5,_0x6d8f('0x62'));})['then'](function(){return getServerInfo(_0x1bb9ce);})['then'](function(_0x37086c){var _0x4f09ba=parseInt(_0x37086c[_0x6d8f('0x63')][_0x6d8f('0x64')](0x0));var _0x1cf2d0=util[_0x6d8f('0x2e')](_0x6d8f('0x65'),_0x3105bc[_0x6d8f('0x53')],_0x86fb5['id']);if(_0x4f09ba>0x6){_0x1cf2d0=util[_0x6d8f('0x2e')](_0x6d8f('0x66'),_0x3105bc[_0x6d8f('0x53')],_0x86fb5['id']);}logger[_0x6d8f('0x2a')]('[QUEUE]',_0x6d8f('0x67'));emit(util[_0x6d8f('0x2e')](_0x6d8f('0x68'),_0x4ebdf4[_0x6d8f('0xe')]),'trigger:browser:url',{'uri':_0x1cf2d0});})[_0x6d8f('0x69')](function(_0x2dc9f3){logger[_0x6d8f('0x6a')](_0x6d8f('0x58'),JSON['stringify'](_0x2dc9f3));});};exports[_0x6d8f('0x6b')]=function(_0x164f69,_0x234161,_0x5494bd,_0x385a8f,_0x598c7a,_0x36584b,_0x4f1a3e){var _0x1ef928,_0x4b60cc,_0x56dd01,_0x2c3cf8;_0x36584b[_0x6d8f('0x53')]=intUtil[_0x6d8f('0x54')](_0x36584b[_0x6d8f('0x53')]);_0x36584b[_0x6d8f('0x55')]=intUtil[_0x6d8f('0x54')](_0x36584b['serverUrl']);def[_0x6d8f('0x56')]=util[_0x6d8f('0x2e')]('%s/service/v4_1/rest.php',_0x36584b[_0x6d8f('0x53')]);if(_0x4f1a3e&&_0x4f1a3e[_0x6d8f('0x6c')]&&_0x4f1a3e[_0x6d8f('0x6c')]!==_0x6d8f('0x6d')){logger['info'](_0x6d8f('0x6e'),'Recording\x20is\x20enabled!');_0x234161['recordingURL']=util['format'](_0x6d8f('0x5a'),_0x36584b['serverUrl'],_0x234161[_0x6d8f('0x5b')],md5(_0x234161[_0x6d8f('0x5b')]));}return getConnection(_0x36584b)[_0x6d8f('0x30')](function(_0x3bb0eb){_0x2c3cf8=_0x3bb0eb;return getUser(_0x36584b,_0x385a8f[_0x6d8f('0xe')],_0x2c3cf8);})[_0x6d8f('0x30')](function(_0xc3409e){_0x1ef928=_0xc3409e;logger['info'](_0x6d8f('0x6f'),_0x1ef928['id']);return getEndUser(_0x36584b,_0x234161[_0x6d8f('0x70')],_0x234161[_0x6d8f('0x71')],_0x2c3cf8);})[_0x6d8f('0x30')](function(_0x22411a){_0x4b60cc=_0x22411a;logger[_0x6d8f('0x2a')](_0x6d8f('0x5d'),_0x4b60cc['id']);return getTicket(_0x36584b,_0x1ef928,_0x4b60cc,_0x5494bd,_0x234161,_0x5494bd[_0x6d8f('0x5e')],_0x2c3cf8,'Outbound');})['then'](function(_0x28e73d){_0x56dd01=_0x28e73d;logger[_0x6d8f('0x2a')]('Ticket\x20created!');logger['info'](_0x6d8f('0x72'),_0x56dd01['id']);return setRelationship(_0x2c3cf8,_0x1ef928,_0x56dd01,_0x6d8f('0x61'));})[_0x6d8f('0x30')](function(){return setRelationship(_0x2c3cf8,_0x4b60cc,_0x56dd01,_0x6d8f('0x62'));})[_0x6d8f('0x30')](function(){return getServerInfo(_0x2c3cf8);})[_0x6d8f('0x30')](function(_0x53dc9e){var _0x47d765=parseInt(_0x53dc9e[_0x6d8f('0x63')][_0x6d8f('0x64')](0x0));var _0x321aec=util[_0x6d8f('0x2e')](_0x6d8f('0x65'),_0x36584b[_0x6d8f('0x53')],_0x56dd01['id']);if(_0x47d765>0x6){_0x321aec=util['format']('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x36584b[_0x6d8f('0x53')],_0x56dd01['id']);}logger['info'](_0x6d8f('0x6e'),_0x6d8f('0x67'));emit(util['format'](_0x6d8f('0x68'),_0x385a8f['name']),_0x6d8f('0x73'),{'uri':_0x321aec});})[_0x6d8f('0x69')](function(_0x56f01a){logger[_0x6d8f('0x6a')](_0x6d8f('0x6e'),JSON['stringify'](_0x56f01a));});};exports['unmanaged']=function(_0x32a00a,_0x39bffd,_0x50142d,_0x3cc88b,_0x115663,_0x31fb3a){var _0x166e5d,_0x4a1f42,_0x5a0dde,_0x263fac;_0x31fb3a[_0x6d8f('0x53')]=intUtil[_0x6d8f('0x54')](_0x31fb3a[_0x6d8f('0x53')]);_0x31fb3a['serverUrl']=intUtil[_0x6d8f('0x54')](_0x31fb3a[_0x6d8f('0x55')]);def['uri']=util[_0x6d8f('0x2e')](_0x6d8f('0x57'),_0x31fb3a[_0x6d8f('0x53')]);if(_0x115663&&_0x115663[_0x6d8f('0x74')]){logger[_0x6d8f('0x2a')]('['+_0x39bffd[_0x6d8f('0x75')][_0x6d8f('0x76')]()+']',_0x6d8f('0x77'));_0x39bffd[_0x6d8f('0x59')]=util['format'](_0x6d8f('0x5a'),_0x31fb3a[_0x6d8f('0x55')],_0x39bffd[_0x6d8f('0x5b')],md5(_0x39bffd[_0x6d8f('0x5b')]));}else{_0x39bffd[_0x6d8f('0x59')]='';}return getConnection(_0x31fb3a)['then'](function(_0x323aeb){_0x263fac=_0x323aeb;if(!_[_0x6d8f('0x78')](_0x3cc88b)){return getUser(_0x31fb3a,_0x3cc88b[_0x6d8f('0xe')],_0x263fac);}else{return getUser(_0x31fb3a,null,_0x263fac);}})[_0x6d8f('0x30')](function(_0x77f93c){_0x166e5d=_0x77f93c;logger[_0x6d8f('0x2a')](_0x6d8f('0x6f'),_0x166e5d['id']);return getEndUser(_0x31fb3a,_0x39bffd[_0x6d8f('0x79')],_0x39bffd['calleridnum'],_0x263fac);})['then'](function(_0x324bbe){_0x4a1f42=_0x324bbe;logger[_0x6d8f('0x2a')]('The\x20Enduser\x20ID\x20is:',_0x4a1f42['id']);return getTicket(_0x31fb3a,_0x166e5d,_0x4a1f42,_0x50142d,_0x39bffd,_0x50142d[_0x6d8f('0x5e')],_0x263fac,_0x6d8f('0x5f'));})[_0x6d8f('0x30')](function(_0x35b39a){_0x5a0dde=_0x35b39a;logger[_0x6d8f('0x2a')](_0x6d8f('0x60'));logger['info'](_0x6d8f('0x72'),_0x5a0dde['id']);return setRelationship(_0x263fac,_0x166e5d,_0x5a0dde,_0x6d8f('0x61'));})[_0x6d8f('0x30')](function(){return setRelationship(_0x263fac,_0x4a1f42,_0x5a0dde,'contacts');})[_0x6d8f('0x30')](function(){return getServerInfo(_0x263fac);})[_0x6d8f('0x69')](function(_0x313b47){logger['error']('['+_0x39bffd[_0x6d8f('0x75')][_0x6d8f('0x76')]()+']',JSON[_0x6d8f('0x29')](_0x313b47));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/util.js b/server/services/ami/trigger/integration/util.js index 1c4ebf0..0ef97d3 100644 --- a/server/services/ami/trigger/integration/util.js +++ b/server/services/ami/trigger/integration/util.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x00a1=['validateEmail','isNil','test','lodash','util','getString','length','sortBy','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','push','keyValue','keyType','string','key','format','keyContent','%s:\x20%s','join','stripTrailingSlash','slice','substring','lastIndexOf'];(function(_0x2f3d43,_0x151f9f){var _0x483214=function(_0x3cc1e2){while(--_0x3cc1e2){_0x2f3d43['push'](_0x2f3d43['shift']());}};_0x483214(++_0x151f9f);}(_0x00a1,0x1d3));var _0x100a=function(_0x5c32a9,_0x471541){_0x5c32a9=_0x5c32a9-0x0;var _0x5489e0=_0x00a1[_0x5c32a9];return _0x5489e0;};'use strict';var _=require(_0x100a('0x0'));var util=require(_0x100a('0x1'));exports[_0x100a('0x2')]=function(_0xb6d1c8,_0x13dd87,_0x1c84d8){var _0x442dfd=[];if(_0xb6d1c8[_0x100a('0x3')]>0x0){var _0x561344=_[_0x100a('0x4')](_0xb6d1c8,['id']);for(var _0x150e18=0x0;_0x150e18<_0x561344['length'];_0x150e18++){var _0x3900c9=_0x561344[_0x150e18];if(_0x3900c9[_0x100a('0x5')]==='string'){_0x442dfd['push'](_0x3900c9['content']);}else if(_0x3900c9['type']===_0x100a('0x6')&&_0x3900c9[_0x100a('0x7')]){_0x13dd87[_0x3900c9[_0x100a('0x7')]]&&_0x442dfd['push'](_0x13dd87[_0x3900c9[_0x100a('0x7')]][_0x100a('0x8')]());}else if(_0x3900c9[_0x100a('0x5')]===_0x100a('0x9')&&_0x3900c9[_0x100a('0xa')]&&_0x3900c9[_0x100a('0xa')][_0x100a('0xb')]){_0x13dd87[_0x3900c9[_0x100a('0xa')][_0x100a('0xb')][_0x100a('0xc')]()]&&_0x442dfd[_0x100a('0xd')](_0x13dd87[_0x3900c9[_0x100a('0xa')][_0x100a('0xb')][_0x100a('0xc')]()][_0x100a('0x8')]());}else if(_0x3900c9[_0x100a('0x5')]===_0x100a('0xe')){if(_0x3900c9[_0x100a('0xf')]===_0x100a('0x10')&&_0x3900c9[_0x100a('0x11')]){_0x442dfd['push'](util[_0x100a('0x12')]('%s:\x20%s',_0x3900c9['key'],_0x3900c9[_0x100a('0x13')]));}else if(_0x3900c9[_0x100a('0xf')]===_0x100a('0x6')&&_0x3900c9[_0x100a('0x7')]&&_0x3900c9['key']){_0x13dd87[_0x3900c9[_0x100a('0x7')]]&&_0x442dfd[_0x100a('0xd')](util['format'](_0x100a('0x14'),_0x3900c9[_0x100a('0x11')],_0x13dd87[_0x3900c9[_0x100a('0x7')]]));}else if(_0x3900c9[_0x100a('0xf')]===_0x100a('0x9')&&_0x3900c9['Variable']&&_0x3900c9[_0x100a('0xa')][_0x100a('0xb')]&&_0x3900c9[_0x100a('0x11')]){_0x13dd87[_0x3900c9['Variable']['name'][_0x100a('0xc')]()]&&_0x442dfd[_0x100a('0xd')](util['format']('%s:\x20%s',_0x3900c9[_0x100a('0x11')],_0x13dd87[_0x3900c9[_0x100a('0xa')]['name'][_0x100a('0xc')]()]));}}}}return _0x442dfd[_0x100a('0x15')](_0x1c84d8);};exports[_0x100a('0x16')]=function(_0x573cf5){var _0x1fc306=_0x573cf5[_0x100a('0x17')](-0x1);if(_0x1fc306==='/'){_0x573cf5=_0x573cf5[_0x100a('0x18')](0x0,_0x573cf5[_0x100a('0x19')](_0x1fc306));}return _0x573cf5;};exports[_0x100a('0x1a')]=function(_0x32c0ad){if(!_[_0x100a('0x1b')](_0x32c0ad)&&_0x32c0ad!==''){var _0x355bbe=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return _0x355bbe[_0x100a('0x1c')](String(_0x32c0ad)[_0x100a('0xc')]());}else{return![];}}; \ No newline at end of file +var _0xed92=['keyValue','keyType','key','format','%s:\x20%s','keyContent','variable','stripTrailingSlash','slice','lastIndexOf','validateEmail','isNil','test','getString','length','sortBy','type','string','push','content','variableName','toString','customVariable','Variable','name','toLowerCase'];(function(_0x415635,_0x425116){var _0x40521b=function(_0xa2a6d3){while(--_0xa2a6d3){_0x415635['push'](_0x415635['shift']());}};_0x40521b(++_0x425116);}(_0xed92,0x1ad));var _0x2ed9=function(_0x3eff2c,_0x126d62){_0x3eff2c=_0x3eff2c-0x0;var _0x5262c8=_0xed92[_0x3eff2c];return _0x5262c8;};'use strict';var _=require('lodash');var util=require('util');exports[_0x2ed9('0x0')]=function(_0x4eda42,_0x48d5bd,_0x38f0a5){var _0x18b0a6=[];if(_0x4eda42[_0x2ed9('0x1')]>0x0){var _0xa6d980=_[_0x2ed9('0x2')](_0x4eda42,['id']);for(var _0x3f262a=0x0;_0x3f262a<_0xa6d980[_0x2ed9('0x1')];_0x3f262a++){var _0x1bf7a9=_0xa6d980[_0x3f262a];if(_0x1bf7a9[_0x2ed9('0x3')]===_0x2ed9('0x4')){_0x18b0a6[_0x2ed9('0x5')](_0x1bf7a9[_0x2ed9('0x6')]);}else if(_0x1bf7a9[_0x2ed9('0x3')]==='variable'&&_0x1bf7a9[_0x2ed9('0x7')]){_0x48d5bd[_0x1bf7a9[_0x2ed9('0x7')]]&&_0x18b0a6[_0x2ed9('0x5')](_0x48d5bd[_0x1bf7a9[_0x2ed9('0x7')]][_0x2ed9('0x8')]());}else if(_0x1bf7a9['type']===_0x2ed9('0x9')&&_0x1bf7a9['Variable']&&_0x1bf7a9[_0x2ed9('0xa')][_0x2ed9('0xb')]){_0x48d5bd[_0x1bf7a9[_0x2ed9('0xa')][_0x2ed9('0xb')][_0x2ed9('0xc')]()]&&_0x18b0a6[_0x2ed9('0x5')](_0x48d5bd[_0x1bf7a9[_0x2ed9('0xa')]['name'][_0x2ed9('0xc')]()][_0x2ed9('0x8')]());}else if(_0x1bf7a9['type']===_0x2ed9('0xd')){if(_0x1bf7a9[_0x2ed9('0xe')]===_0x2ed9('0x4')&&_0x1bf7a9[_0x2ed9('0xf')]){_0x18b0a6['push'](util[_0x2ed9('0x10')](_0x2ed9('0x11'),_0x1bf7a9[_0x2ed9('0xf')],_0x1bf7a9[_0x2ed9('0x12')]));}else if(_0x1bf7a9[_0x2ed9('0xe')]===_0x2ed9('0x13')&&_0x1bf7a9[_0x2ed9('0x7')]&&_0x1bf7a9['key']){_0x48d5bd[_0x1bf7a9[_0x2ed9('0x7')]]&&_0x18b0a6[_0x2ed9('0x5')](util[_0x2ed9('0x10')](_0x2ed9('0x11'),_0x1bf7a9[_0x2ed9('0xf')],_0x48d5bd[_0x1bf7a9[_0x2ed9('0x7')]]));}else if(_0x1bf7a9[_0x2ed9('0xe')]===_0x2ed9('0x9')&&_0x1bf7a9[_0x2ed9('0xa')]&&_0x1bf7a9[_0x2ed9('0xa')]['name']&&_0x1bf7a9['key']){_0x48d5bd[_0x1bf7a9[_0x2ed9('0xa')]['name'][_0x2ed9('0xc')]()]&&_0x18b0a6[_0x2ed9('0x5')](util[_0x2ed9('0x10')](_0x2ed9('0x11'),_0x1bf7a9['key'],_0x48d5bd[_0x1bf7a9['Variable'][_0x2ed9('0xb')][_0x2ed9('0xc')]()]));}}}}return _0x18b0a6['join'](_0x38f0a5);};exports[_0x2ed9('0x14')]=function(_0x3a239f){var _0x5961eb=_0x3a239f[_0x2ed9('0x15')](-0x1);if(_0x5961eb==='/'){_0x3a239f=_0x3a239f['substring'](0x0,_0x3a239f[_0x2ed9('0x16')](_0x5961eb));}return _0x3a239f;};exports[_0x2ed9('0x17')]=function(_0x598668){if(!_[_0x2ed9('0x18')](_0x598668)&&_0x598668!==''){var _0x297181=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return _0x297181[_0x2ed9('0x19')](String(_0x598668)['toLowerCase']());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index df0290a..c9a82e0 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x4b440a,_0x4e3005){var _0x2506f6=function(_0x2adbb3){while(--_0x2adbb3){_0x4b440a['push'](_0x4b440a['shift']());}};_0x2506f6(++_0x4e3005);}(_0x9c44,0x178));var _0x49c4=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x9c44[_0x4b055c];return _0x4b62bb;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file +var _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x10c1ec,_0x7ecce3){var _0x327d5e=function(_0x8d4c21){while(--_0x8d4c21){_0x10c1ec['push'](_0x10c1ec['shift']());}};_0x327d5e(++_0x7ecce3);}(_0x9c44,0x178));var _0x49c4=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x9c44[_0x5f09c5];return _0x426ad9;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 9419425..1373b1d 100644 --- a/server/services/ami/trigger/integration/zendesk.js +++ b/server/services/ami/trigger/integration/zendesk.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb9f8=['Searching\x20enduser\x20with\x20phone','results','filter','end-user','length','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','%s/token:%s','token','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','nameField','toLowerCase','content','type','idField','customField','custom_fields','push','variable','variableName','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridname','%s/channels/voice/agents/%d/tickets/%d/display.json','/api/v2','Zendesk\x20account\x20type\x20not\x20recognized','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','calleridname','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','Subjects','getString','Fields','then','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','user','%s/users/me.json'];(function(_0x44c768,_0x552a5e){var _0x55daf5=function(_0x4958e8){while(--_0x4958e8){_0x44c768['push'](_0x44c768['shift']());}};_0x55daf5(++_0x552a5e);}(_0xb9f8,0xc7));var _0x8b9f=function(_0x28ad9c,_0x19d2d2){_0x28ad9c=_0x28ad9c-0x0;var _0x432523=_0xb9f8[_0x28ad9c];return _0x432523;};'use strict';var _=require(_0x8b9f('0x0'));var rp=require(_0x8b9f('0x1'));var md5=require(_0x8b9f('0x2'));var util=require(_0x8b9f('0x3'));var Redis=require('ioredis');var intUtil=require(_0x8b9f('0x4'));var config=require(_0x8b9f('0x5'));var logger=require(_0x8b9f('0x6'))('zendesk');config[_0x8b9f('0x7')]=_[_0x8b9f('0x8')](config[_0x8b9f('0x7')],{'host':_0x8b9f('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8b9f('0x7')]));function emit(_0x1625f2,_0x462a18,_0x3959f7){io['to'](_0x1625f2)['emit'](_0x462a18,_0x3959f7);}var headers={'Content-Type':_0x8b9f('0xa'),'Accept':_0x8b9f('0xa')};function getTicket(_0x549ac0,_0x40bdd1,_0x5aeb73,_0x1cb20e,_0x54604b){logger[_0x8b9f('0xb')](_0x8b9f('0xc'));return request({'uri':util[_0x8b9f('0xd')](_0x8b9f('0xe'),_0x549ac0[_0x8b9f('0xf')]),'method':_0x8b9f('0x10'),'body':{'ticket':_[_0x8b9f('0x11')]({'requester_id':_0x5aeb73['id'],'submitter_id':_0x40bdd1?_0x40bdd1['id']:undefined,'assignee_id':_0x40bdd1?_0x40bdd1['id']:undefined,'tags':getTags(_0x1cb20e[_0x8b9f('0x12')],'name'),'subject':intUtil['getString'](_0x1cb20e[_0x8b9f('0x13')],_0x54604b,'\x20'),'description':intUtil[_0x8b9f('0x14')](_0x1cb20e['Descriptions'],_0x54604b,'\x0a'),'comment':{'public':![],'body':intUtil[_0x8b9f('0x14')](_0x1cb20e['Descriptions'],_0x54604b,'\x0a')}},getCustomFields(_0x1cb20e[_0x8b9f('0x15')],_0x54604b))}})[_0x8b9f('0x16')](function(_0x3a3c41){logger[_0x8b9f('0xb')](_0x8b9f('0x17'));return _0x3a3c41[_0x8b9f('0x18')];});}function getUser(_0x589417,_0x3ffa80){if(intUtil['validateEmail'](_0x3ffa80)){logger['info'](_0x8b9f('0x19'),_0x3ffa80);return request({'uri':util[_0x8b9f('0xd')](_0x8b9f('0x1a'),_0x589417[_0x8b9f('0xf')]),'qs':{'query':util[_0x8b9f('0xd')](_0x8b9f('0x1b'),_0x3ffa80)}})[_0x8b9f('0x16')](function(_0x4d3bd8){if(_0x4d3bd8[_0x8b9f('0x1c')]){logger[_0x8b9f('0xb')]('Agent\x20found!');return _[_0x8b9f('0x1d')](_0x4d3bd8['results'],{'email':_0x3ffa80,'role':_0x8b9f('0x1e')});}else{logger['info'](_0x8b9f('0x1f'));return request({'uri':util[_0x8b9f('0xd')]('%s/users/me.json',_0x589417[_0x8b9f('0xf')])})[_0x8b9f('0x16')](function(_0x2fa059){logger[_0x8b9f('0xb')](_0x8b9f('0x20'));return _0x2fa059[_0x8b9f('0x21')];});}});}else{logger[_0x8b9f('0xb')](_0x8b9f('0x1f'));return request({'uri':util[_0x8b9f('0xd')](_0x8b9f('0x22'),_0x589417['remoteUri'])})[_0x8b9f('0x16')](function(_0x3d92a2){logger[_0x8b9f('0xb')]('Admin\x20account\x20selected.');return _0x3d92a2[_0x8b9f('0x21')];});}}function getEndUser(_0x5a1aa2,_0x430ff3,_0x2d52e0){logger[_0x8b9f('0xb')](_0x8b9f('0x23'),_0x2d52e0);return request({'uri':util[_0x8b9f('0xd')](_0x8b9f('0x1a'),_0x5a1aa2['remoteUri']),'qs':{'query':util[_0x8b9f('0xd')]('type:user\x20role:end-user\x20phone:%s',_0x2d52e0)}})[_0x8b9f('0x16')](function(_0x194765){var _0x571586;if(_0x194765[_0x8b9f('0x24')]['length']){_0x194765[_0x8b9f('0x24')]=_[_0x8b9f('0x25')](_0x194765['results'],{'suspended':![],'role':_0x8b9f('0x26')});if(_0x194765['results'][_0x8b9f('0x27')]){_0x571586=_[_0x8b9f('0x28')](_0x194765['results']);}}if(_0x571586){logger[_0x8b9f('0xb')](_0x8b9f('0x29'));return _0x571586;}else{logger[_0x8b9f('0xb')](_0x8b9f('0x2a'));return request({'uri':util['format']('%s/users.json',_0x5a1aa2[_0x8b9f('0xf')]),'method':'POST','body':{'user':{'role':_0x8b9f('0x26'),'name':util[_0x8b9f('0xd')](_0x8b9f('0x2b'),_0x430ff3||_0x2d52e0),'phone':_0x2d52e0}}})['then'](function(_0x3c5846){logger[_0x8b9f('0xb')](_0x8b9f('0x2c'));return _0x3c5846[_0x8b9f('0x21')];});}});}function getAuth(_0x79f7a9){var _0x5de879;if(_0x79f7a9[_0x8b9f('0x2d')]===_0x8b9f('0x2e')){_0x5de879=util[_0x8b9f('0xd')](_0x8b9f('0x2f'),_0x79f7a9[_0x8b9f('0x30')],_0x79f7a9['password']);}else if(_0x79f7a9['authType']==='token'){_0x5de879=util[_0x8b9f('0xd')](_0x8b9f('0x31'),_0x79f7a9[_0x8b9f('0x30')],_0x79f7a9[_0x8b9f('0x32')]);}return util[_0x8b9f('0xd')](_0x8b9f('0x33'),new Buffer(_0x5de879)[_0x8b9f('0x34')](_0x8b9f('0x35')));}function request(_0x3e04b1){logger[_0x8b9f('0x36')](_0x8b9f('0x37'),JSON[_0x8b9f('0x38')](_0x3e04b1));return rp(_[_0x8b9f('0x8')](_0x3e04b1,{'method':_0x8b9f('0x39'),'headers':headers,'json':!![]}));}function getTags(_0x389edd,_0x1754da){var _0x1d1b54=[];if(_0x389edd&&_0x389edd[_0x8b9f('0x27')]>0x0){_0x1d1b54=_[_0x8b9f('0x3a')](_0x389edd,_0x1754da);}return _0x1d1b54;}function getCustomFields(_0x237e9d,_0x2b64e4){var _0x50ac55=[];var _0x5f2469={'custom_fields':[]};if(_0x237e9d[_0x8b9f('0x27')]>0x0){_[_0x8b9f('0x3b')](_0x237e9d,function(_0xda96a6){if(_[_0x8b9f('0x3c')]([_0x8b9f('0x3d'),_0x8b9f('0x3e')],_0xda96a6['type'])&&_0xda96a6[_0x8b9f('0x3f')]&&!_0xda96a6['customField']){_0x5f2469[_0xda96a6['nameField'][_0x8b9f('0x40')]()]=_0xda96a6[_0x8b9f('0x41')]['toString']();}else if(_['includes'](['string','picklist'],_0xda96a6[_0x8b9f('0x42')])&&_0xda96a6[_0x8b9f('0x43')]&&_0xda96a6[_0x8b9f('0x44')]){_0x5f2469[_0x8b9f('0x45')][_0x8b9f('0x46')]({'id':_0xda96a6['idField'],'value':_0xda96a6[_0x8b9f('0x41')][_0x8b9f('0x34')]()});}else if(_0xda96a6[_0x8b9f('0x42')]===_0x8b9f('0x47')&&_0xda96a6['variableName']&&_0xda96a6[_0x8b9f('0x43')]&&_0xda96a6['customField']){_0x2b64e4[_0xda96a6[_0x8b9f('0x48')]]&&_0x5f2469[_0x8b9f('0x45')]['push']({'id':_0xda96a6['idField'],'value':_0x2b64e4[_0xda96a6[_0x8b9f('0x48')]][_0x8b9f('0x34')]()});}else if(_0xda96a6['type']===_0x8b9f('0x49')&&_0xda96a6['Variable']&&_0xda96a6[_0x8b9f('0x4a')][_0x8b9f('0x4b')]&&_0xda96a6['idField']&&_0xda96a6[_0x8b9f('0x44')]){_0x2b64e4[_0xda96a6['Variable']['name'][_0x8b9f('0x40')]()]&&_0x5f2469[_0x8b9f('0x45')][_0x8b9f('0x46')]({'id':_0xda96a6['idField'],'value':_0x2b64e4[_0xda96a6[_0x8b9f('0x4a')]['name'][_0x8b9f('0x40')]()][_0x8b9f('0x34')]()});}});}return _0x5f2469;}exports[_0x8b9f('0x4c')]=function(_0x198a13,_0x2fe954,_0x661dad,_0x4dfbe4,_0x1543f1,_0x5385c5){var _0x494321,_0x5c8f62;_0x5385c5[_0x8b9f('0xf')]=intUtil[_0x8b9f('0x4d')](_0x5385c5[_0x8b9f('0xf')]);_0x5385c5[_0x8b9f('0x4e')]=intUtil[_0x8b9f('0x4d')](_0x5385c5['serverUrl']);if(_0x1543f1&&_0x1543f1[_0x8b9f('0x4f')]){logger[_0x8b9f('0xb')](_0x8b9f('0x50'),_0x8b9f('0x51'));_0x2fe954[_0x8b9f('0x52')]=util[_0x8b9f('0xd')](_0x8b9f('0x53'),_0x5385c5[_0x8b9f('0x4e')],_0x2fe954[_0x8b9f('0x54')],md5(_0x2fe954[_0x8b9f('0x54')]));}else{_0x2fe954[_0x8b9f('0x52')]='';}headers['Authorization']=getAuth(_0x5385c5);return getUser(_0x5385c5,_0x4dfbe4[_0x8b9f('0x55')])[_0x8b9f('0x16')](function(_0x266a94){_0x494321=_0x266a94;logger[_0x8b9f('0xb')](_0x8b9f('0x56'),_0x494321['id']);return getEndUser(_0x5385c5,_0x2fe954['calleridname'],_0x2fe954[_0x8b9f('0x57')]);})['then'](function(_0x2e84e6){_0x5c8f62=_0x2e84e6;logger['info'](_0x8b9f('0x58'),_0x5c8f62['id']);return getTicket(_0x5385c5,_0x494321,_0x5c8f62,_0x661dad,_0x2fe954);})[_0x8b9f('0x16')](function(_0x22e428){if(_0x22e428){logger[_0x8b9f('0xb')](_0x8b9f('0x59'),_0x22e428['id']);switch(_0x5385c5['type']){case _0x8b9f('0x5a'):logger[_0x8b9f('0xb')]('[QUEUE]',_0x8b9f('0x5b'));return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x5385c5[_0x8b9f('0xf')],_0x494321['id'],_0x22e428['id']),'method':'POST'});case _0x8b9f('0x5c'):logger['info']('[QUEUE]',_0x8b9f('0x5d'));emit(util[_0x8b9f('0xd')](_0x8b9f('0x5e'),_0x4dfbe4['name']),_0x8b9f('0x5f'),{'uri':util[_0x8b9f('0xd')](_0x8b9f('0x60'),_0x5385c5[_0x8b9f('0xf')][_0x8b9f('0x61')]('/api/v2',''),_0x22e428['id'])});break;default:logger[_0x8b9f('0x62')]('[QUEUE]','Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x6f611d){logger[_0x8b9f('0x62')](_0x8b9f('0x63'),util[_0x8b9f('0x64')](_0x6f611d,{'showHidden':!![],'depth':null}));});};exports[_0x8b9f('0x65')]=function(_0x43a62b,_0x46800c,_0x5208f8,_0x4beae5,_0x24b52b,_0x177ccd,_0x30795a){var _0x120b6b,_0x5b8143;_0x177ccd['remoteUri']=intUtil[_0x8b9f('0x4d')](_0x177ccd['remoteUri']);_0x177ccd[_0x8b9f('0x4e')]=intUtil[_0x8b9f('0x4d')](_0x177ccd[_0x8b9f('0x4e')]);if(_0x30795a&&_0x30795a[_0x8b9f('0x66')]&&_0x30795a[_0x8b9f('0x66')]!==_0x8b9f('0x67')){logger[_0x8b9f('0xb')](_0x8b9f('0x68'),_0x8b9f('0x51'));_0x46800c[_0x8b9f('0x52')]=util['format'](_0x8b9f('0x53'),_0x177ccd[_0x8b9f('0x4e')],_0x46800c[_0x8b9f('0x54')],md5(_0x46800c[_0x8b9f('0x54')]));}headers[_0x8b9f('0x69')]=getAuth(_0x177ccd);return getUser(_0x177ccd,_0x4beae5[_0x8b9f('0x55')])[_0x8b9f('0x16')](function(_0x537cd1){_0x120b6b=_0x537cd1;logger['info'](_0x8b9f('0x56'),_0x120b6b['id']);return getEndUser(_0x177ccd,_0x46800c[_0x8b9f('0x6a')],_0x46800c['destcalleridnum']);})[_0x8b9f('0x16')](function(_0x2b4e17){_0x5b8143=_0x2b4e17;logger[_0x8b9f('0xb')](_0x8b9f('0x58'),_0x5b8143['id']);return getTicket(_0x177ccd,_0x120b6b,_0x5b8143,_0x5208f8,_0x46800c);})[_0x8b9f('0x16')](function(_0xd5301e){if(_0xd5301e){logger[_0x8b9f('0xb')](_0x8b9f('0x59'),_0xd5301e['id']);switch(_0x177ccd[_0x8b9f('0x42')]){case'integrationTab':logger[_0x8b9f('0xb')]('[OUTBOUND]',_0x8b9f('0x5b'));return request({'uri':util[_0x8b9f('0xd')](_0x8b9f('0x6b'),_0x177ccd[_0x8b9f('0xf')],_0x120b6b['id'],_0xd5301e['id']),'method':_0x8b9f('0x10')});case _0x8b9f('0x5c'):logger['info']('[OUTBOUND]',_0x8b9f('0x5d'));emit(util[_0x8b9f('0xd')](_0x8b9f('0x5e'),_0x4beae5['name']),_0x8b9f('0x5f'),{'uri':util[_0x8b9f('0xd')]('%s/agent/tickets/%s',_0x177ccd[_0x8b9f('0xf')][_0x8b9f('0x61')](_0x8b9f('0x6c'),''),_0xd5301e['id'])});break;default:logger[_0x8b9f('0x62')](_0x8b9f('0x68'),_0x8b9f('0x6d'));}}})[_0x8b9f('0x6e')](function(_0x49d4c8){logger['error'](_0x8b9f('0x6f'),util[_0x8b9f('0x64')](_0x49d4c8,{'showHidden':!![],'depth':null}));});};exports[_0x8b9f('0x70')]=function(_0x4fc94f,_0x5be0d7,_0x9f21ac,_0x1c19cf,_0x1b56e2,_0x1361e6){var _0x32c089,_0x23cbf6;_0x1361e6[_0x8b9f('0xf')]=intUtil['stripTrailingSlash'](_0x1361e6[_0x8b9f('0xf')]);_0x1361e6[_0x8b9f('0x4e')]=intUtil['stripTrailingSlash'](_0x1361e6['serverUrl']);if(_0x1b56e2&&_0x1b56e2[_0x8b9f('0x4f')]){logger['info']('['+_0x5be0d7[_0x8b9f('0x71')][_0x8b9f('0x72')]()+']',_0x8b9f('0x51'));_0x5be0d7['recordingURL']=util[_0x8b9f('0xd')](_0x8b9f('0x53'),_0x1361e6[_0x8b9f('0x4e')],_0x5be0d7[_0x8b9f('0x54')],md5(_0x5be0d7[_0x8b9f('0x54')]));}else{_0x5be0d7[_0x8b9f('0x52')]='';}headers[_0x8b9f('0x69')]=getAuth(_0x1361e6);return getUser(_0x1361e6)[_0x8b9f('0x16')](function(_0x121f30){_0x32c089=_0x121f30;logger[_0x8b9f('0xb')](_0x8b9f('0x56'),_0x32c089['id']);return getEndUser(_0x1361e6,_0x5be0d7[_0x8b9f('0x73')],_0x5be0d7[_0x8b9f('0x57')]);})[_0x8b9f('0x16')](function(_0x501fb7){_0x23cbf6=_0x501fb7;logger[_0x8b9f('0xb')](_0x8b9f('0x58'),_0x23cbf6['id']);return getTicket(_0x1361e6,_0x32c089,_0x23cbf6,_0x9f21ac,_0x5be0d7);})[_0x8b9f('0x16')](function(_0x2dd54d){if(_0x2dd54d){logger['info']('The\x20Ticket\x20ID\x20is:',_0x2dd54d['id']);}})[_0x8b9f('0x6e')](function(_0x2f1948){logger['error']('['+_0x5be0d7[_0x8b9f('0x71')][_0x8b9f('0x72')]()+']'+_0x8b9f('0x74'),util[_0x8b9f('0x64')](_0x2f1948,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x74c5=['Variable','name','custom_fields','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','Zendesk\x20account\x20type\x20not\x20recognized','inspect','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','error','catch','toUpperCase','calleridname','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','POST','Tags','Subjects','getString','Descriptions','then','ticket','validateEmail','Getting\x20agent\x20with\x20email','format','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','remoteUri','Admin\x20account\x20selected.','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','token','%s/token:%s','base64','[HTTP]','length','includes','string','type','nameField','customField','toLowerCase','content','toString','picklist','push','variable','variableName','idField','customVariable'];(function(_0x3feae8,_0x2d60b3){var _0x59693b=function(_0x39c2aa){while(--_0x39c2aa){_0x3feae8['push'](_0x3feae8['shift']());}};_0x59693b(++_0x2d60b3);}(_0x74c5,0x104));var _0x574c=function(_0xbc1a4b,_0x4dfbe4){_0xbc1a4b=_0xbc1a4b-0x0;var _0x108b87=_0x74c5[_0xbc1a4b];return _0x108b87;};'use strict';var _=require(_0x574c('0x0'));var rp=require(_0x574c('0x1'));var md5=require(_0x574c('0x2'));var util=require(_0x574c('0x3'));var Redis=require(_0x574c('0x4'));var intUtil=require(_0x574c('0x5'));var config=require(_0x574c('0x6'));var logger=require(_0x574c('0x7'))(_0x574c('0x8'));config[_0x574c('0x9')]=_[_0x574c('0xa')](config[_0x574c('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x574c('0xb'))(new Redis(config['redis']));function emit(_0x5cdf8b,_0x407c39,_0x150ea9){io['to'](_0x5cdf8b)[_0x574c('0xc')](_0x407c39,_0x150ea9);}var headers={'Content-Type':_0x574c('0xd'),'Accept':_0x574c('0xd')};function getTicket(_0x434392,_0x36b9c5,_0x306480,_0xb27d21,_0x27e9fb){logger[_0x574c('0xe')](_0x574c('0xf'));return request({'uri':util['format'](_0x574c('0x10'),_0x434392['remoteUri']),'method':_0x574c('0x11'),'body':{'ticket':_['merge']({'requester_id':_0x306480['id'],'submitter_id':_0x36b9c5?_0x36b9c5['id']:undefined,'assignee_id':_0x36b9c5?_0x36b9c5['id']:undefined,'tags':getTags(_0xb27d21[_0x574c('0x12')],'name'),'subject':intUtil['getString'](_0xb27d21[_0x574c('0x13')],_0x27e9fb,'\x20'),'description':intUtil[_0x574c('0x14')](_0xb27d21[_0x574c('0x15')],_0x27e9fb,'\x0a'),'comment':{'public':![],'body':intUtil[_0x574c('0x14')](_0xb27d21[_0x574c('0x15')],_0x27e9fb,'\x0a')}},getCustomFields(_0xb27d21['Fields'],_0x27e9fb))}})[_0x574c('0x16')](function(_0x6de002){logger[_0x574c('0xe')]('Ticket\x20created!');return _0x6de002[_0x574c('0x17')];});}function getUser(_0x4781dc,_0x2ca08f){if(intUtil[_0x574c('0x18')](_0x2ca08f)){logger[_0x574c('0xe')](_0x574c('0x19'),_0x2ca08f);return request({'uri':util[_0x574c('0x1a')](_0x574c('0x1b'),_0x4781dc['remoteUri']),'qs':{'query':util[_0x574c('0x1a')](_0x574c('0x1c'),_0x2ca08f)}})[_0x574c('0x16')](function(_0x49b5ad){if(_0x49b5ad[_0x574c('0x1d')]){logger['info'](_0x574c('0x1e'));return _[_0x574c('0x1f')](_0x49b5ad[_0x574c('0x20')],{'email':_0x2ca08f,'role':_0x574c('0x21')});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x574c('0x1a')]('%s/users/me.json',_0x4781dc[_0x574c('0x22')])})[_0x574c('0x16')](function(_0x53ea19){logger[_0x574c('0xe')](_0x574c('0x23'));return _0x53ea19['user'];});}});}else{logger[_0x574c('0xe')](_0x574c('0x24'));return request({'uri':util[_0x574c('0x1a')](_0x574c('0x25'),_0x4781dc[_0x574c('0x22')])})[_0x574c('0x16')](function(_0x29ffdd){logger[_0x574c('0xe')](_0x574c('0x23'));return _0x29ffdd[_0x574c('0x26')];});}}function getEndUser(_0x4d9e2a,_0x4ec527,_0x3fd737){logger['info'](_0x574c('0x27'),_0x3fd737);return request({'uri':util[_0x574c('0x1a')](_0x574c('0x1b'),_0x4d9e2a[_0x574c('0x22')]),'qs':{'query':util['format'](_0x574c('0x28'),_0x3fd737)}})[_0x574c('0x16')](function(_0x678d07){var _0x43c53b;if(_0x678d07['results']['length']){_0x678d07[_0x574c('0x20')]=_['filter'](_0x678d07[_0x574c('0x20')],{'suspended':![],'role':_0x574c('0x29')});if(_0x678d07[_0x574c('0x20')]['length']){_0x43c53b=_[_0x574c('0x2a')](_0x678d07[_0x574c('0x20')]);}}if(_0x43c53b){logger[_0x574c('0xe')](_0x574c('0x2b'));return _0x43c53b;}else{logger[_0x574c('0xe')](_0x574c('0x2c'));return request({'uri':util[_0x574c('0x1a')](_0x574c('0x2d'),_0x4d9e2a[_0x574c('0x22')]),'method':_0x574c('0x11'),'body':{'user':{'role':_0x574c('0x29'),'name':util[_0x574c('0x1a')](_0x574c('0x2e'),_0x4ec527||_0x3fd737),'phone':_0x3fd737}}})['then'](function(_0x19efb2){logger[_0x574c('0xe')](_0x574c('0x2f'));return _0x19efb2['user'];});}});}function getAuth(_0x13bb99){var _0xf2f31e;if(_0x13bb99[_0x574c('0x30')]===_0x574c('0x31')){_0xf2f31e=util[_0x574c('0x1a')](_0x574c('0x32'),_0x13bb99['username'],_0x13bb99[_0x574c('0x31')]);}else if(_0x13bb99[_0x574c('0x30')]===_0x574c('0x33')){_0xf2f31e=util[_0x574c('0x1a')](_0x574c('0x34'),_0x13bb99['username'],_0x13bb99[_0x574c('0x33')]);}return util[_0x574c('0x1a')]('Basic\x20%s',new Buffer(_0xf2f31e)['toString'](_0x574c('0x35')));}function request(_0x1c9b4c){logger['debug'](_0x574c('0x36'),JSON['stringify'](_0x1c9b4c));return rp(_[_0x574c('0xa')](_0x1c9b4c,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x1dc4e0,_0x32c9f1){var _0x3c6db7=[];if(_0x1dc4e0&&_0x1dc4e0[_0x574c('0x37')]>0x0){_0x3c6db7=_['map'](_0x1dc4e0,_0x32c9f1);}return _0x3c6db7;}function getCustomFields(_0x191717,_0x2f07a7){var _0x50877b=[];var _0x58916c={'custom_fields':[]};if(_0x191717[_0x574c('0x37')]>0x0){_['forEach'](_0x191717,function(_0x441f18){if(_[_0x574c('0x38')]([_0x574c('0x39'),'picklist'],_0x441f18[_0x574c('0x3a')])&&_0x441f18[_0x574c('0x3b')]&&!_0x441f18[_0x574c('0x3c')]){_0x58916c[_0x441f18[_0x574c('0x3b')][_0x574c('0x3d')]()]=_0x441f18[_0x574c('0x3e')][_0x574c('0x3f')]();}else if(_[_0x574c('0x38')]([_0x574c('0x39'),_0x574c('0x40')],_0x441f18[_0x574c('0x3a')])&&_0x441f18['idField']&&_0x441f18[_0x574c('0x3c')]){_0x58916c['custom_fields'][_0x574c('0x41')]({'id':_0x441f18['idField'],'value':_0x441f18[_0x574c('0x3e')][_0x574c('0x3f')]()});}else if(_0x441f18[_0x574c('0x3a')]===_0x574c('0x42')&&_0x441f18[_0x574c('0x43')]&&_0x441f18[_0x574c('0x44')]&&_0x441f18[_0x574c('0x3c')]){_0x2f07a7[_0x441f18[_0x574c('0x43')]]&&_0x58916c['custom_fields']['push']({'id':_0x441f18[_0x574c('0x44')],'value':_0x2f07a7[_0x441f18[_0x574c('0x43')]]['toString']()});}else if(_0x441f18['type']===_0x574c('0x45')&&_0x441f18[_0x574c('0x46')]&&_0x441f18[_0x574c('0x46')][_0x574c('0x47')]&&_0x441f18[_0x574c('0x44')]&&_0x441f18[_0x574c('0x3c')]){_0x2f07a7[_0x441f18[_0x574c('0x46')][_0x574c('0x47')]['toLowerCase']()]&&_0x58916c[_0x574c('0x48')][_0x574c('0x41')]({'id':_0x441f18[_0x574c('0x44')],'value':_0x2f07a7[_0x441f18['Variable'][_0x574c('0x47')][_0x574c('0x3d')]()][_0x574c('0x3f')]()});}});}return _0x58916c;}exports[_0x574c('0x49')]=function(_0x390a4e,_0x464614,_0x3b486f,_0x6a8634,_0x3510cf,_0x2362b1){var _0x19f5b8,_0x425ff7;_0x2362b1[_0x574c('0x22')]=intUtil[_0x574c('0x4a')](_0x2362b1[_0x574c('0x22')]);_0x2362b1['serverUrl']=intUtil[_0x574c('0x4a')](_0x2362b1[_0x574c('0x4b')]);if(_0x3510cf&&_0x3510cf[_0x574c('0x4c')]){logger['info']('[QUEUE]',_0x574c('0x4d'));_0x464614[_0x574c('0x4e')]=util[_0x574c('0x1a')](_0x574c('0x4f'),_0x2362b1[_0x574c('0x4b')],_0x464614['uniqueid'],md5(_0x464614['uniqueid']));}else{_0x464614[_0x574c('0x4e')]='';}headers[_0x574c('0x50')]=getAuth(_0x2362b1);return getUser(_0x2362b1,_0x6a8634[_0x574c('0x51')])[_0x574c('0x16')](function(_0x4dcc8e){_0x19f5b8=_0x4dcc8e;logger['info'](_0x574c('0x52'),_0x19f5b8['id']);return getEndUser(_0x2362b1,_0x464614['calleridname'],_0x464614[_0x574c('0x53')]);})[_0x574c('0x16')](function(_0x34d1da){_0x425ff7=_0x34d1da;logger[_0x574c('0xe')](_0x574c('0x54'),_0x425ff7['id']);return getTicket(_0x2362b1,_0x19f5b8,_0x425ff7,_0x3b486f,_0x464614);})[_0x574c('0x16')](function(_0x38e53a){if(_0x38e53a){logger[_0x574c('0xe')](_0x574c('0x55'),_0x38e53a['id']);switch(_0x2362b1['type']){case _0x574c('0x56'):logger['info'](_0x574c('0x57'),_0x574c('0x58'));return request({'uri':util[_0x574c('0x1a')](_0x574c('0x59'),_0x2362b1[_0x574c('0x22')],_0x19f5b8['id'],_0x38e53a['id']),'method':_0x574c('0x11')});case _0x574c('0x5a'):logger[_0x574c('0xe')](_0x574c('0x57'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x574c('0x1a')](_0x574c('0x5b'),_0x6a8634[_0x574c('0x47')]),_0x574c('0x5c'),{'uri':util['format'](_0x574c('0x5d'),_0x2362b1[_0x574c('0x22')][_0x574c('0x5e')](_0x574c('0x5f'),''),_0x38e53a['id'])});break;default:logger['error'](_0x574c('0x57'),_0x574c('0x60'));}}})['catch'](function(_0x1a927b){logger['error']('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0x574c('0x61')](_0x1a927b,{'showHidden':!![],'depth':null}));});};exports[_0x574c('0x62')]=function(_0x39119d,_0x350770,_0x1721a9,_0xbff52d,_0x46b52a,_0x48ea61,_0x4720d0){var _0x501034,_0x1c466f;_0x48ea61['remoteUri']=intUtil[_0x574c('0x4a')](_0x48ea61[_0x574c('0x22')]);_0x48ea61[_0x574c('0x4b')]=intUtil[_0x574c('0x4a')](_0x48ea61[_0x574c('0x4b')]);if(_0x4720d0&&_0x4720d0[_0x574c('0x63')]&&_0x4720d0[_0x574c('0x63')]!==_0x574c('0x64')){logger[_0x574c('0xe')](_0x574c('0x65'),_0x574c('0x4d'));_0x350770[_0x574c('0x4e')]=util[_0x574c('0x1a')](_0x574c('0x4f'),_0x48ea61[_0x574c('0x4b')],_0x350770[_0x574c('0x66')],md5(_0x350770['uniqueid']));}headers['Authorization']=getAuth(_0x48ea61);return getUser(_0x48ea61,_0xbff52d['email'])['then'](function(_0x89dbf8){_0x501034=_0x89dbf8;logger[_0x574c('0xe')](_0x574c('0x52'),_0x501034['id']);return getEndUser(_0x48ea61,_0x350770[_0x574c('0x67')],_0x350770['destcalleridnum']);})[_0x574c('0x16')](function(_0xb45330){_0x1c466f=_0xb45330;logger[_0x574c('0xe')](_0x574c('0x54'),_0x1c466f['id']);return getTicket(_0x48ea61,_0x501034,_0x1c466f,_0x1721a9,_0x350770);})['then'](function(_0x1ca779){if(_0x1ca779){logger[_0x574c('0xe')](_0x574c('0x55'),_0x1ca779['id']);switch(_0x48ea61[_0x574c('0x3a')]){case'integrationTab':logger[_0x574c('0xe')](_0x574c('0x65'),_0x574c('0x58'));return request({'uri':util[_0x574c('0x1a')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x48ea61[_0x574c('0x22')],_0x501034['id'],_0x1ca779['id']),'method':'POST'});case _0x574c('0x5a'):logger[_0x574c('0xe')](_0x574c('0x65'),_0x574c('0x68'));emit(util[_0x574c('0x1a')](_0x574c('0x5b'),_0xbff52d[_0x574c('0x47')]),_0x574c('0x5c'),{'uri':util[_0x574c('0x1a')](_0x574c('0x5d'),_0x48ea61[_0x574c('0x22')][_0x574c('0x5e')](_0x574c('0x5f'),''),_0x1ca779['id'])});break;default:logger[_0x574c('0x69')]('[OUTBOUND]',_0x574c('0x60'));}}})[_0x574c('0x6a')](function(_0x165476){logger[_0x574c('0x69')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0x574c('0x61')](_0x165476,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x46cf4c,_0x4b4b9a,_0x4b1f94,_0x202312,_0x24ddcf,_0x433048){var _0x4ae3e5,_0x476043;_0x433048['remoteUri']=intUtil[_0x574c('0x4a')](_0x433048[_0x574c('0x22')]);_0x433048[_0x574c('0x4b')]=intUtil[_0x574c('0x4a')](_0x433048[_0x574c('0x4b')]);if(_0x24ddcf&&_0x24ddcf[_0x574c('0x4c')]){logger[_0x574c('0xe')]('['+_0x4b4b9a['lastevent'][_0x574c('0x6b')]()+']',_0x574c('0x4d'));_0x4b4b9a[_0x574c('0x4e')]=util[_0x574c('0x1a')](_0x574c('0x4f'),_0x433048[_0x574c('0x4b')],_0x4b4b9a['uniqueid'],md5(_0x4b4b9a[_0x574c('0x66')]));}else{_0x4b4b9a['recordingURL']='';}headers['Authorization']=getAuth(_0x433048);return getUser(_0x433048)[_0x574c('0x16')](function(_0x3e995c){_0x4ae3e5=_0x3e995c;logger[_0x574c('0xe')](_0x574c('0x52'),_0x4ae3e5['id']);return getEndUser(_0x433048,_0x4b4b9a[_0x574c('0x6c')],_0x4b4b9a[_0x574c('0x53')]);})[_0x574c('0x16')](function(_0x45a1b0){_0x476043=_0x45a1b0;logger[_0x574c('0xe')](_0x574c('0x54'),_0x476043['id']);return getTicket(_0x433048,_0x4ae3e5,_0x476043,_0x4b1f94,_0x4b4b9a);})[_0x574c('0x16')](function(_0x11cb23){if(_0x11cb23){logger[_0x574c('0xe')]('The\x20Ticket\x20ID\x20is:',_0x11cb23['id']);}})[_0x574c('0x6a')](function(_0x512ad0){logger[_0x574c('0x69')]('['+_0x4b4b9a['lastevent'][_0x574c('0x6b')]()+']'+_0x574c('0x6d'),util[_0x574c('0x61')](_0x512ad0,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zoho.js b/server/services/ami/trigger/integration/zoho.js index 9800f5a..f43fd2f 100644 --- a/server/services/ami/trigger/integration/zoho.js +++ b/server/services/ami/trigger/integration/zoho.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xca57=['[OUTBOUND]','Recording\x20is\x20enabled!','/api/voice/recordings/','zoho.eu','com','The\x20User\x20ID\x20is:','destcalleridnum','Outbound','unmanaged','toUpperCase','lodash','request-promise','./util','moment','ioredis','../../../../config/environment','../../../../config/logger','zoho','redis','localhost','socket.io-emitter','debug','[HTTP]','stringify','length','forEach','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','seconds','catch','error','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','then','users','isArrayLikeObject','findIndex','email','Agent\x20found!','profile','Administrator','Using\x20the\x20admin\x20account!','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','SUCCESS','details','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','Contacts','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Subjects','Description','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','endtime','diff','starttime','YYYY-MM-DDTHH:mm:ss','lastevent','called','Call_Result','Called','complete','connect','abandoned','Abandoned','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','code','Call\x20created!','err','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','uniqueid','/downloads?type=uniqueid&token=','recordingURL','host','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat'];(function(_0x3f81af,_0x3a5250){var _0x5e376a=function(_0x4bb366){while(--_0x4bb366){_0x3f81af['push'](_0x3f81af['shift']());}};_0x5e376a(++_0x3a5250);}(_0xca57,0x1d5));var _0x7ca5=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xca57[_0x110c3d];return _0x226d67;};'use strict';var _=require(_0x7ca5('0x0'));var rp=require(_0x7ca5('0x1'));var md5=require('md5');var util=require('util');var intUtil=require(_0x7ca5('0x2'));var moment=require(_0x7ca5('0x3'));var Redis=require(_0x7ca5('0x4'));var BPromise=require('bluebird');var config=require(_0x7ca5('0x5'));var logger=require(_0x7ca5('0x6'))(_0x7ca5('0x7'));config[_0x7ca5('0x8')]=_['defaults'](config[_0x7ca5('0x8')],{'host':_0x7ca5('0x9'),'port':0x18eb});var io=require(_0x7ca5('0xa'))(new Redis(config[_0x7ca5('0x8')]));function emit(_0x75d51a,_0x2f0b07,_0x286a14){io['to'](_0x75d51a)['emit'](_0x2f0b07,_0x286a14);}function request(_0x9c227e){logger[_0x7ca5('0xb')](_0x7ca5('0xc'),JSON[_0x7ca5('0xd')](_0x9c227e));return rp(_0x9c227e);}function getCustomFields(_0x2d7da4,_0xef60f8){var _0x38ed4d={};if(_0x2d7da4[_0x7ca5('0xe')]>0x0){_[_0x7ca5('0xf')](_0x2d7da4,function(_0x4af35c){if(_['includes'](['string',_0x7ca5('0x10')],_0x4af35c[_0x7ca5('0x11')])&&_0x4af35c[_0x7ca5('0x12')]){_0x38ed4d[_0x4af35c['idField']]=_0x4af35c[_0x7ca5('0x13')][_0x7ca5('0x14')]();}else if(_0x4af35c['type']===_0x7ca5('0x15')&&_0x4af35c[_0x7ca5('0x16')]&&_0x4af35c['idField']&&_0xef60f8[_0x4af35c[_0x7ca5('0x16')]]){_0x38ed4d[_0x4af35c[_0x7ca5('0x12')]]=_0xef60f8[_0x4af35c[_0x7ca5('0x16')]]['toString']();}else if(_0x4af35c[_0x7ca5('0x11')]===_0x7ca5('0x17')&&_0x4af35c[_0x7ca5('0x18')]&&_0x4af35c[_0x7ca5('0x18')][_0x7ca5('0x19')]&&_0x4af35c[_0x7ca5('0x12')]&&_0xef60f8[_0x4af35c[_0x7ca5('0x18')]['name']['toLowerCase']()]){_0x38ed4d[_0x4af35c[_0x7ca5('0x12')]]=_0xef60f8[_0x4af35c['Variable'][_0x7ca5('0x19')][_0x7ca5('0x1a')]()][_0x7ca5('0x14')]();}});}return _0x38ed4d;}function getName(_0x3d616c){if(_0x3d616c[_0x7ca5('0x1b')]('\x20')>0x0){var _0x11b1ac=_0x3d616c[_0x7ca5('0x1c')](/ (.+)/);if(_0x11b1ac[0x1]){return _0x11b1ac;}}return[_0x3d616c,_0x3d616c];}var accountsTokens={};function getAccessToken(_0x4ea5db){return new Promise(function(_0x15865f,_0x2f9af7){if(!_['isNil'](accountsTokens[_0x4ea5db['id']])&&!_[_0x7ca5('0x1d')](accountsTokens[_0x4ea5db['id']][_0x7ca5('0x1e')])){if(moment()[_0x7ca5('0x1f')](accountsTokens[_0x4ea5db['id']][_0x7ca5('0x20')])){_0x15865f(accountsTokens[_0x4ea5db['id']][_0x7ca5('0x1e')]);}}var _0x279be9;switch(_0x4ea5db[_0x7ca5('0x21')]){case'US':_0x279be9=_0x7ca5('0x22');break;case'AU':_0x279be9=_0x7ca5('0x23');break;case'EU':_0x279be9=_0x7ca5('0x24');break;case'IN':_0x279be9=_0x7ca5('0x25');break;case'CN':_0x279be9=_0x7ca5('0x26');break;default:_0x279be9=_0x7ca5('0x24');break;}var _0x155196={'method':_0x7ca5('0x27'),'uri':_0x279be9+_0x7ca5('0x28'),'qs':{'refresh_token':_0x4ea5db['refreshToken'],'client_id':_0x4ea5db[_0x7ca5('0x29')],'client_secret':_0x4ea5db[_0x7ca5('0x2a')],'grant_type':_0x7ca5('0x2b')},'json':!![]};return rp(_0x155196)['then'](function(_0x342d62){accountsTokens[_0x4ea5db['id']]={'access_token':_0x342d62[_0x7ca5('0x1e')],'expires_in':moment()['add'](_0x342d62[_0x7ca5('0x20')],_0x7ca5('0x2c'))};_0x15865f(_0x342d62[_0x7ca5('0x1e')]);})[_0x7ca5('0x2d')](function(_0x3a65fe){logger[_0x7ca5('0x2e')]('Failing\x20creating\x20the\x20access_token',_0x3a65fe[_0x7ca5('0x2f')]);_0x2f9af7(_0x3a65fe);});});}function getUser(_0xe82dba,_0xa83b40,_0x35938b,_0x5a19bb){logger[_0x7ca5('0x30')](_0x7ca5('0x31'));return request({'method':_0x7ca5('0x32'),'uri':util[_0x7ca5('0x33')](_0x7ca5('0x34'),_0xa83b40),'qs':{'type':_0x7ca5('0x35')},'headers':{'Authorization':_0x7ca5('0x36')+_0xe82dba},'json':!![]})[_0x7ca5('0x37')](function(_0x10497f){if(_0x10497f[_0x7ca5('0x38')]){var _0x5a17fc=-0x1;if(_[_0x7ca5('0x39')](_0x10497f[_0x7ca5('0x38')])){if(!_[_0x7ca5('0x1d')](_0x5a19bb)){_0x5a17fc=_[_0x7ca5('0x3a')](_0x10497f['users'],function(_0x4f5843){return _0x4f5843[_0x7ca5('0x3b')]===_0x5a19bb;});}if(_0x5a17fc>=0x0){logger[_0x7ca5('0x30')](_0x7ca5('0x3c'));}else{logger[_0x7ca5('0x30')]('Using\x20the\x20admin\x20account!');_0x5a17fc=_['findIndex'](_0x10497f[_0x7ca5('0x38')],function(_0x3dc03d){return _0x3dc03d[_0x7ca5('0x3d')][_0x7ca5('0x19')]===_0x7ca5('0x3e');});}return _0x10497f[_0x7ca5('0x38')][_0x5a17fc];}else{if(_0x10497f['user'][_0x7ca5('0x3d')]['name']==='Administrator'){logger[_0x7ca5('0x30')](_0x7ca5('0x3f'));user=_0x10497f[_0x7ca5('0x40')];return user;}else{logger[_0x7ca5('0x2e')](_0x7ca5('0x41'),JSON[_0x7ca5('0xd')](_0x10497f));throw new Error(_0x7ca5('0x42')+JSON[_0x7ca5('0xd')](_0x10497f));}}}else{logger[_0x7ca5('0x2e')](_0x7ca5('0x41'),JSON['stringify'](_0x10497f));throw new Error(_0x7ca5('0x42')+JSON[_0x7ca5('0xd')](_0x10497f));}})[_0x7ca5('0x2d')](function(_0x23d0f2){console[_0x7ca5('0x2e')](_0x23d0f2);});}function getZohoUser(_0xfba6a8,_0x395fdb){return new BPromise(function(_0x50f0fc,_0x2d34a0){request(_0xfba6a8)[_0x7ca5('0x37')](function(_0x2c8771){var _0x2e1b1a=null;if(_0x2c8771){_0x2e1b1a=_0x2c8771[_0x7ca5('0x43')][0x0];_0x2e1b1a[_0x7ca5('0x44')]=_0x395fdb;}_0x50f0fc(_0x2e1b1a);})[_0x7ca5('0x2d')](function(_0x182c5c){_0x2d34a0(_0x182c5c);});});}function createEndUser(_0x26729f,_0x29949d,_0x1ae330,_0x89ced5,_0x4b6135,_0x320494){var _0x1ae330=getName(_0x1ae330);return request({'method':_0x7ca5('0x27'),'uri':_0x7ca5('0x45')+_0x29949d+_0x7ca5('0x46')+_[_0x7ca5('0x47')](_0x320494[_0x7ca5('0x48')])+'s','body':{'data':[{'Last_Name':_0x1ae330[0x1],'First_Name':_0x1ae330[0x0],'Phone':_0x89ced5,'Owner':{'name':!_[_0x7ca5('0x1d')](_0x4b6135[_0x7ca5('0x49')]['name'])?_0x4b6135[_0x7ca5('0x49')][_0x7ca5('0x19')]:!_[_0x7ca5('0x1d')](_0x4b6135[_0x7ca5('0x4a')])?_0x4b6135[_0x7ca5('0x4a')]+'\x20'+_0x4b6135['last_name']:_0x4b6135[_0x7ca5('0x4b')],'id':_0x4b6135['id']}}]},'headers':{'Authorization':_0x7ca5('0x36')+_0x26729f},'json':!![]})[_0x7ca5('0x37')](function(_0x3d04bf){if(_0x3d04bf&&_0x3d04bf['data'][0x0]['code']===_0x7ca5('0x4c')){var _0x42a211=_0x3d04bf[_0x7ca5('0x43')][0x0][_0x7ca5('0x4d')];_0x42a211['enduserType']=_['startCase'](_0x320494[_0x7ca5('0x48')])+'s';return _0x42a211;}logger['error'](_0x7ca5('0x41'),JSON[_0x7ca5('0xd')](data));throw new Error('Error:\x20'+JSON[_0x7ca5('0xd')](data));})[_0x7ca5('0x2d')](function(_0x33feb3){console[_0x7ca5('0x4e')](_0x7ca5('0x4f'),_0x33feb3);});}function getEndUser(_0x450eb2,_0xd020d4,_0x244888,_0x33f977,_0x3cd25e,_0x502047,_0x39e21e){var _0x1ddbb1={'method':_0x7ca5('0x32'),'uri':'','headers':{'Authorization':_0x7ca5('0x36')+_0x450eb2},'json':!![]};switch(_0x39e21e[_0x7ca5('0x50')]){case _0x7ca5('0x51'):_0x1ddbb1[_0x7ca5('0x52')]=_0x7ca5('0x45')+_0xd020d4+_0x7ca5('0x53')+_0x3cd25e+'))';return getZohoUser(_0x1ddbb1,'Contacts')[_0x7ca5('0x37')](function(_0x3f355d){if(_0x3f355d)return _0x3f355d;_0x1ddbb1[_0x7ca5('0x52')]=_0x7ca5('0x45')+_0xd020d4+_0x7ca5('0x54')+_0x3cd25e+'))';return getZohoUser(_0x1ddbb1,_0x7ca5('0x55'))[_0x7ca5('0x37')](function(_0xb3f6a2){if(_0xb3f6a2)return _0xb3f6a2;if(_0x39e21e[_0x7ca5('0x48')]!=_0x7ca5('0x56')){return createEndUser(_0x450eb2,_0xd020d4,_0x33f977,_0x3cd25e,_0x502047,_0x39e21e);}else{return{};}});});break;case _0x7ca5('0x57'):_0x1ddbb1[_0x7ca5('0x52')]='https://www.zohoapis.'+_0xd020d4+_0x7ca5('0x53')+_0x3cd25e+'))';return getZohoUser(_0x1ddbb1,_0x7ca5('0x58'))[_0x7ca5('0x37')](function(_0x1f151b){if(_0x1f151b)return _0x1f151b;if(_0x39e21e[_0x7ca5('0x48')]!=_0x7ca5('0x56')){return createEndUser(_0x450eb2,_0xd020d4,_0x33f977,_0x3cd25e,_0x502047,_0x39e21e);}else{return{};}});break;case'lead':_0x1ddbb1[_0x7ca5('0x52')]='https://www.zohoapis.'+_0xd020d4+_0x7ca5('0x54')+_0x3cd25e+'))';return getZohoUser(_0x1ddbb1,_0x7ca5('0x55'))[_0x7ca5('0x37')](function(_0x3cae46){if(_0x3cae46)return _0x3cae46;if(_0x39e21e['moduleCreate']!=_0x7ca5('0x56')){return createEndUser(_0x450eb2,_0xd020d4,_0x33f977,_0x3cd25e,_0x502047,_0x39e21e);}else{return{};}});break;}}function getCall(_0x5ea4d4,_0x582bb5,_0x45af95,_0x1ca60f,_0xfb8e49,_0x3194ce,_0x219d7c,_0x555ce6){logger[_0x7ca5('0x30')](_0x7ca5('0x59'));var _0x14578b={};_0x14578b[_0x7ca5('0x5a')]={'name':!_[_0x7ca5('0x1d')](_0x1ca60f[_0x7ca5('0x49')][_0x7ca5('0x19')])&&!_['isNil'](_0x1ca60f[_0x7ca5('0x3d')]['name'])&&_0x1ca60f[_0x7ca5('0x3d')][_0x7ca5('0x19')]===_0x7ca5('0x5b')?_0x1ca60f[_0x7ca5('0x49')]['name']:!_[_0x7ca5('0x1d')](_0x1ca60f['first_name'])?_0x1ca60f[_0x7ca5('0x4a')]+'\x20'+_0x1ca60f['last_name']:_0x1ca60f[_0x7ca5('0x4b')],'id':_0x1ca60f['id']};_0x14578b[_0x7ca5('0x5c')]=intUtil[_0x7ca5('0x5d')](_0x3194ce[_0x7ca5('0x5e')],_0x219d7c,'\x20');_0x14578b[_0x7ca5('0x5f')]=intUtil['getString'](_0x3194ce['Descriptions'],_0x219d7c,'\x0a');if(_0xfb8e49['enduserType']===_0x7ca5('0x58')){_0x14578b[_0x7ca5('0x60')]={'name':!_[_0x7ca5('0x1d')](_0xfb8e49[_0x7ca5('0x61')])?_0xfb8e49[_0x7ca5('0x61')]:!_['isNil'](_0xfb8e49[_0x7ca5('0x62')])?_0xfb8e49[_0x7ca5('0x62')]+'\x20'+_0xfb8e49[_0x7ca5('0x63')]:_0xfb8e49['Last_Name'],'id':_0xfb8e49['id']};}if(_0xfb8e49['enduserType']===_0x7ca5('0x55')){_0x14578b[_0x7ca5('0x64')]={'name':!_[_0x7ca5('0x1d')](_0xfb8e49[_0x7ca5('0x61')])?_0xfb8e49[_0x7ca5('0x61')]:!_[_0x7ca5('0x1d')](_0xfb8e49[_0x7ca5('0x62')])?_0xfb8e49[_0x7ca5('0x62')]+'\x20'+_0xfb8e49[_0x7ca5('0x63')]:_0xfb8e49[_0x7ca5('0x63')],'id':_0xfb8e49['id']};_0x14578b[_0x7ca5('0x65')]=_['startCase'](_0xfb8e49[_0x7ca5('0x44')]);}if(_0x219d7c[_0x7ca5('0x66')]){_0x14578b[_0x7ca5('0x67')]=moment['utc'](parseInt(_0x219d7c[_0x7ca5('0x66')])*0x3e8)[_0x7ca5('0x33')]('mm:ss');}else if(_0x219d7c['answertime']&&_0x219d7c[_0x7ca5('0x68')]){_0x14578b[_0x7ca5('0x67')]=moment['utc'](moment(_0x219d7c[_0x7ca5('0x68')],'YYYY-MM-DDTHH:mm:ss')[_0x7ca5('0x69')](moment(_0x219d7c[_0x7ca5('0x6a')],_0x7ca5('0x6b'))))[_0x7ca5('0x33')]('mm:ss');}switch(_0x219d7c[_0x7ca5('0x6c')]){case _0x7ca5('0x6d'):_0x14578b[_0x7ca5('0x6e')]=_0x7ca5('0x6f');break;case _0x7ca5('0x70'):case _0x7ca5('0x71'):_0x14578b['Call_Result']='Answered';break;case'rejected':_0x14578b[_0x7ca5('0x6e')]='Rejected';break;case _0x7ca5('0x72'):_0x14578b[_0x7ca5('0x6e')]=_0x7ca5('0x73');break;case'timeout':_0x14578b[_0x7ca5('0x6e')]='Timeout';default:}_0x14578b['Call_Start_Time']=(_0x555ce6===_0x7ca5('0x74')?moment(_0x219d7c[_0x7ca5('0x6a')])['format'](_0x7ca5('0x6b')):moment(_0x219d7c[_0x7ca5('0x75')])['format'](_0x7ca5('0x6b')))||moment()['format']('YYYY-MM-DDTHH:mm:ss');_0x14578b[_0x7ca5('0x76')]=_0x555ce6||_0x7ca5('0x77');_0x14578b=_[_0x7ca5('0x78')](_0x14578b,getCustomFields(_0x3194ce[_0x7ca5('0x79')],_0x219d7c));return request({'method':_0x7ca5('0x27'),'uri':_0x7ca5('0x45')+_0x582bb5+_0x7ca5('0x7a'),'headers':{'Authorization':_0x7ca5('0x36')+_0x5ea4d4},'body':{'data':[_0x14578b]},'json':!![]})[_0x7ca5('0x37')](function(_0x37f641){if(_0x37f641&&_0x37f641[_0x7ca5('0x43')][0x0][_0x7ca5('0x7b')]===_0x7ca5('0x4c')){logger[_0x7ca5('0x30')](_0x7ca5('0x7c'));return{'id':_0x37f641[_0x7ca5('0x43')][0x0][_0x7ca5('0x4d')]['id']};}})[_0x7ca5('0x2d')](function(_0x207b4a){logger[_0x7ca5('0x30')](_0x7ca5('0x7d'),_0x207b4a[_0x7ca5('0x2f')]);console[_0x7ca5('0x4e')]('err',_0x207b4a);});}exports[_0x7ca5('0x7e')]=function(_0x388f62,_0x583e38,_0x54cf88,_0x3f0190,_0x3e7a3d,_0x28b1f1){var _0x1a351b,_0x221c43,_0xfca0b3;_0x28b1f1['host']=intUtil['stripTrailingSlash'](_0x28b1f1['host']);_0x28b1f1[_0x7ca5('0x7f')]=intUtil[_0x7ca5('0x80')](_0x28b1f1[_0x7ca5('0x7f')]);if(_0x3e7a3d&&_0x3e7a3d[_0x7ca5('0x81')]){logger['info'](_0x7ca5('0x82'),'Recording\x20is\x20enabled!');_0x583e38['recordingURL']=_0x28b1f1['serverUrl']+'/api/voice/recordings/'+_0x583e38[_0x7ca5('0x83')]+_0x7ca5('0x84')+md5(_0x583e38[_0x7ca5('0x83')]);}else{_0x583e38[_0x7ca5('0x85')]='';}var _0x51e30f=_0x28b1f1[_0x7ca5('0x86')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x28b1f1)[_0x7ca5('0x37')](function(_0x4ab627){_0xfca0b3=_0x4ab627;return getUser(_0xfca0b3,_0x51e30f,_0x28b1f1,_0x3f0190['email']);})['then'](function(_0x24a324){_0x1a351b=_0x24a324;logger[_0x7ca5('0x30')]('The\x20User\x20ID\x20is:',_0x1a351b['id']);return getEndUser(_0xfca0b3,_0x51e30f,_0x28b1f1,_0x583e38[_0x7ca5('0x87')],_0x583e38[_0x7ca5('0x88')],_0x1a351b,_0x54cf88);})[_0x7ca5('0x37')](function(_0x3cf356){_0x221c43=_0x3cf356;return getCall(_0xfca0b3,_0x51e30f,_0x28b1f1,_0x1a351b,_0x221c43,_0x54cf88,_0x583e38,_0x7ca5('0x77'));})['then'](function(_0x1ac0e3){if(_0x1ac0e3){logger[_0x7ca5('0x30')](_0x7ca5('0x89'),_0x1ac0e3['id']);logger[_0x7ca5('0x30')](_0x7ca5('0x82'),_0x7ca5('0x8a'));emit(util[_0x7ca5('0x33')]('user:%s',_0x3f0190[_0x7ca5('0x19')]),_0x7ca5('0x8b'),{'uri':_0x7ca5('0x8c')+_0x28b1f1['host']+_0x7ca5('0x8d')+_0x1ac0e3['id']});}})[_0x7ca5('0x2d')](function(_0x26f707){logger[_0x7ca5('0x2e')](_0x7ca5('0x82'),JSON[_0x7ca5('0xd')](_0x26f707));});};exports[_0x7ca5('0x74')]=function(_0x308ecf,_0x4a07e9,_0x565314,_0xbca0fa,_0x11f72f,_0x375bd2,_0x47acab){var _0x9d091e,_0x3351b9,_0x43af59;_0x375bd2[_0x7ca5('0x86')]=intUtil[_0x7ca5('0x80')](_0x375bd2['host']);_0x375bd2[_0x7ca5('0x7f')]=intUtil[_0x7ca5('0x80')](_0x375bd2[_0x7ca5('0x7f')]);if(_0x47acab&&_0x47acab[_0x7ca5('0x8e')]&&_0x47acab[_0x7ca5('0x8e')]!=='none'){logger[_0x7ca5('0x30')](_0x7ca5('0x8f'),_0x7ca5('0x90'));_0x4a07e9[_0x7ca5('0x85')]=_0x375bd2[_0x7ca5('0x7f')]+_0x7ca5('0x91')+_0x4a07e9[_0x7ca5('0x83')]+_0x7ca5('0x84')+md5(_0x4a07e9['uniqueid']);}var _0x2a9151=_0x375bd2[_0x7ca5('0x86')]===_0x7ca5('0x92')?'eu':_0x7ca5('0x93');return getAccessToken(_0x375bd2)['then'](function(_0x4c709d){_0x43af59=_0x4c709d;return getUser(_0x43af59,_0x2a9151,_0x375bd2,_0xbca0fa[_0x7ca5('0x3b')]);})[_0x7ca5('0x37')](function(_0x14aa8d){_0x9d091e=_0x14aa8d;logger[_0x7ca5('0x30')](_0x7ca5('0x94'),_0x9d091e['id']);return getEndUser(_0x43af59,_0x2a9151,_0x375bd2,_0x4a07e9['destcalleridname'],_0x4a07e9[_0x7ca5('0x95')],_0x9d091e,_0x565314);})[_0x7ca5('0x37')](function(_0x4f7990){_0x3351b9=_0x4f7990;return getCall(_0x43af59,_0x2a9151,_0x375bd2,_0x9d091e,_0x3351b9,_0x565314,_0x4a07e9,_0x7ca5('0x96'));})[_0x7ca5('0x37')](function(_0x2c9af6){if(_0x2c9af6){logger[_0x7ca5('0x30')](_0x7ca5('0x89'),_0x2c9af6['id']);logger[_0x7ca5('0x30')]('[OUTBOUND]',_0x7ca5('0x8a'));emit(util[_0x7ca5('0x33')]('user:%s',_0xbca0fa['name']),_0x7ca5('0x8b'),{'uri':_0x7ca5('0x8c')+_0x375bd2['host']+_0x7ca5('0x8d')+_0x2c9af6['id']});}})[_0x7ca5('0x2d')](function(_0x3b194c){logger[_0x7ca5('0x2e')](_0x7ca5('0x8f'),JSON[_0x7ca5('0xd')](_0x3b194c));});};exports[_0x7ca5('0x97')]=function(_0x58ec35,_0x6fef2c,_0x4a9e2e,_0x1ac3e3,_0x1c5e3e,_0x5f3294){var _0x562e85,_0x23a4cb,_0x49d27e;_0x5f3294[_0x7ca5('0x86')]=intUtil[_0x7ca5('0x80')](_0x5f3294[_0x7ca5('0x86')]);_0x5f3294['serverUrl']=intUtil[_0x7ca5('0x80')](_0x5f3294['serverUrl']);if(_0x1c5e3e&&_0x1c5e3e['monitor_format']){logger[_0x7ca5('0x30')]('['+_0x6fef2c[_0x7ca5('0x6c')][_0x7ca5('0x98')]()+']','Recording\x20is\x20enabled!');_0x6fef2c[_0x7ca5('0x85')]=_0x5f3294[_0x7ca5('0x7f')]+'/api/voice/recordings/'+_0x6fef2c[_0x7ca5('0x83')]+'/downloads?type=uniqueid&token='+md5(_0x6fef2c[_0x7ca5('0x83')]);}else{_0x6fef2c[_0x7ca5('0x85')]='';}var _0x542a8f=_0x5f3294[_0x7ca5('0x86')]==='zoho.eu'?'eu':_0x7ca5('0x93');return getAccessToken(_0x5f3294)[_0x7ca5('0x37')](function(_0x2fa0ff){_0x49d27e=_0x2fa0ff;return getUser(_0x49d27e,_0x542a8f,_0x5f3294);})[_0x7ca5('0x37')](function(_0x26284f){_0x562e85=_0x26284f;logger[_0x7ca5('0x30')](_0x7ca5('0x94'),_0x562e85['id']);return getEndUser(_0x49d27e,_0x542a8f,_0x5f3294,_0x6fef2c['calleridname'],_0x6fef2c['calleridnum'],_0x562e85,_0x4a9e2e);})[_0x7ca5('0x37')](function(_0xef2288){_0x23a4cb=_0xef2288;return getCall(_0x49d27e,_0x542a8f,_0x5f3294,_0x562e85,_0x23a4cb,_0x4a9e2e,_0x6fef2c,_0x7ca5('0x77'));})[_0x7ca5('0x37')](function(_0x3b1e3f){if(_0x3b1e3f){logger['info'](_0x7ca5('0x89'),_0x3b1e3f['id']);}})[_0x7ca5('0x2d')](function(_0x223b45){logger['error']('['+_0x6fef2c[_0x7ca5('0x6c')][_0x7ca5('0x98')]()+']',JSON[_0x7ca5('0xd')](_0x223b45));});}; \ No newline at end of file +var _0x86f5=['Owner','administrator','first_name','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','Call_Duration','talktime','format','mm:ss','answertime','utc','endtime','YYYY-MM-DDTHH:mm:ss','starttime','lastevent','called','Called','complete','connect','Call_Result','rejected','abandoned','Abandoned','timeout','Call_Type','Inbound','Fields','Call\x20created!','details','err','stack','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','outbound','recordingFormat','zoho.eu','destcalleridname','destcalleridnum','Outbound','[OUTBOUND]','unmanaged','toUpperCase','Recording\x20is\x20enabled!','lodash','md5','util','moment','ioredis','bluebird','../../../../config/environment','redis','defaults','socket.io-emitter','emit','debug','[HTTP]','stringify','length','string','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','then','expires_in','seconds','catch','error','Failing\x20creating\x20the\x20access_token','Search\x20user','GET','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','email','info','Agent\x20found!','Using\x20the\x20admin\x20account!','findIndex','Administrator','user','profile','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','last_name','code','SUCCESS','Error:\x20','CREATE\x20ERROR','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','Contacts','lead','Creating\x20new\x20call...'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x86f5,0x178));var _0x586f=function(_0x5e07a7,_0x1438b3){_0x5e07a7=_0x5e07a7-0x0;var _0x22ced5=_0x86f5[_0x5e07a7];return _0x22ced5;};'use strict';var _=require(_0x586f('0x0'));var rp=require('request-promise');var md5=require(_0x586f('0x1'));var util=require(_0x586f('0x2'));var intUtil=require('./util');var moment=require(_0x586f('0x3'));var Redis=require(_0x586f('0x4'));var BPromise=require(_0x586f('0x5'));var config=require(_0x586f('0x6'));var logger=require('../../../../config/logger')('zoho');config[_0x586f('0x7')]=_[_0x586f('0x8')](config[_0x586f('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x586f('0x9'))(new Redis(config[_0x586f('0x7')]));function emit(_0x315fd9,_0x4f82f5,_0x5d31da){io['to'](_0x315fd9)[_0x586f('0xa')](_0x4f82f5,_0x5d31da);}function request(_0x226d5a){logger[_0x586f('0xb')](_0x586f('0xc'),JSON[_0x586f('0xd')](_0x226d5a));return rp(_0x226d5a);}function getCustomFields(_0xff4253,_0x2f98db){var _0x497eea={};if(_0xff4253[_0x586f('0xe')]>0x0){_['forEach'](_0xff4253,function(_0x147099){if(_['includes']([_0x586f('0xf'),'picklist'],_0x147099[_0x586f('0x10')])&&_0x147099['idField']){_0x497eea[_0x147099[_0x586f('0x11')]]=_0x147099[_0x586f('0x12')][_0x586f('0x13')]();}else if(_0x147099[_0x586f('0x10')]===_0x586f('0x14')&&_0x147099[_0x586f('0x15')]&&_0x147099['idField']&&_0x2f98db[_0x147099[_0x586f('0x15')]]){_0x497eea[_0x147099['idField']]=_0x2f98db[_0x147099['variableName']][_0x586f('0x13')]();}else if(_0x147099[_0x586f('0x10')]===_0x586f('0x16')&&_0x147099[_0x586f('0x17')]&&_0x147099[_0x586f('0x17')][_0x586f('0x18')]&&_0x147099['idField']&&_0x2f98db[_0x147099['Variable'][_0x586f('0x18')][_0x586f('0x19')]()]){_0x497eea[_0x147099[_0x586f('0x11')]]=_0x2f98db[_0x147099[_0x586f('0x17')][_0x586f('0x18')][_0x586f('0x19')]()][_0x586f('0x13')]();}});}return _0x497eea;}function getName(_0x1ff7f4){if(_0x1ff7f4[_0x586f('0x1a')]('\x20')>0x0){var _0x375686=_0x1ff7f4[_0x586f('0x1b')](/ (.+)/);if(_0x375686[0x1]){return _0x375686;}}return[_0x1ff7f4,_0x1ff7f4];}var accountsTokens={};function getAccessToken(_0x38fda7){return new Promise(function(_0x2c9e43,_0x5ec95f){if(!_[_0x586f('0x1c')](accountsTokens[_0x38fda7['id']])&&!_[_0x586f('0x1c')](accountsTokens[_0x38fda7['id']][_0x586f('0x1d')])){if(moment()[_0x586f('0x1e')](accountsTokens[_0x38fda7['id']]['expires_in'])){_0x2c9e43(accountsTokens[_0x38fda7['id']][_0x586f('0x1d')]);}}var _0x1d0f15;switch(_0x38fda7[_0x586f('0x1f')]){case'US':_0x1d0f15=_0x586f('0x20');break;case'AU':_0x1d0f15=_0x586f('0x21');break;case'EU':_0x1d0f15='https://accounts.zoho.eu';break;case'IN':_0x1d0f15=_0x586f('0x22');break;case'CN':_0x1d0f15=_0x586f('0x23');break;default:_0x1d0f15=_0x586f('0x24');break;}var _0x15a854={'method':_0x586f('0x25'),'uri':_0x1d0f15+_0x586f('0x26'),'qs':{'refresh_token':_0x38fda7['refreshToken'],'client_id':_0x38fda7[_0x586f('0x27')],'client_secret':_0x38fda7[_0x586f('0x28')],'grant_type':_0x586f('0x29')},'json':!![]};return rp(_0x15a854)[_0x586f('0x2a')](function(_0x5536ce){accountsTokens[_0x38fda7['id']]={'access_token':_0x5536ce[_0x586f('0x1d')],'expires_in':moment()['add'](_0x5536ce[_0x586f('0x2b')],_0x586f('0x2c'))};_0x2c9e43(_0x5536ce[_0x586f('0x1d')]);})[_0x586f('0x2d')](function(_0x36e035){logger[_0x586f('0x2e')](_0x586f('0x2f'),_0x36e035['stack']);_0x5ec95f(_0x36e035);});});}function getUser(_0x44e83f,_0x550277,_0x3d6bb2,_0x527a5b){logger['info'](_0x586f('0x30'));return request({'method':_0x586f('0x31'),'uri':util['format']('https://www.zohoapis.%s/crm/v2/users',_0x550277),'qs':{'type':_0x586f('0x32')},'headers':{'Authorization':_0x586f('0x33')+_0x44e83f},'json':!![]})['then'](function(_0x15c0fa){if(_0x15c0fa[_0x586f('0x34')]){var _0x28b2c6=-0x1;if(_[_0x586f('0x35')](_0x15c0fa[_0x586f('0x34')])){if(!_[_0x586f('0x1c')](_0x527a5b)){_0x28b2c6=_['findIndex'](_0x15c0fa[_0x586f('0x34')],function(_0x4bfd5b){return _0x4bfd5b[_0x586f('0x36')]===_0x527a5b;});}if(_0x28b2c6>=0x0){logger[_0x586f('0x37')](_0x586f('0x38'));}else{logger[_0x586f('0x37')](_0x586f('0x39'));_0x28b2c6=_[_0x586f('0x3a')](_0x15c0fa[_0x586f('0x34')],function(_0x4767c5){return _0x4767c5['profile'][_0x586f('0x18')]===_0x586f('0x3b');});}return _0x15c0fa[_0x586f('0x34')][_0x28b2c6];}else{if(_0x15c0fa[_0x586f('0x3c')][_0x586f('0x3d')]['name']===_0x586f('0x3b')){logger['info'](_0x586f('0x39'));user=_0x15c0fa['user'];return user;}else{logger[_0x586f('0x2e')](_0x586f('0x3e'),JSON[_0x586f('0xd')](_0x15c0fa));throw new Error(_0x586f('0x3f')+JSON[_0x586f('0xd')](_0x15c0fa));}}}else{logger[_0x586f('0x2e')](_0x586f('0x3e'),JSON[_0x586f('0xd')](_0x15c0fa));throw new Error(_0x586f('0x3f')+JSON[_0x586f('0xd')](_0x15c0fa));}})['catch'](function(_0xd4dfab){console[_0x586f('0x2e')](_0xd4dfab);});}function getZohoUser(_0x5690fe,_0x5097f7){return new BPromise(function(_0x46f31b,_0x4ab7fe){request(_0x5690fe)['then'](function(_0x34b3ba){var _0x47e381=null;if(_0x34b3ba){_0x47e381=_0x34b3ba[_0x586f('0x40')][0x0];_0x47e381[_0x586f('0x41')]=_0x5097f7;}_0x46f31b(_0x47e381);})[_0x586f('0x2d')](function(_0x2ad5c9){_0x4ab7fe(_0x2ad5c9);});});}function createEndUser(_0x1754b4,_0x348953,_0x5269e7,_0x242ff8,_0x1ed450,_0x4aed23){var _0x5269e7=getName(_0x5269e7);return request({'method':'POST','uri':_0x586f('0x42')+_0x348953+_0x586f('0x43')+_[_0x586f('0x44')](_0x4aed23[_0x586f('0x45')])+'s','body':{'data':[{'Last_Name':_0x5269e7[0x1],'First_Name':_0x5269e7[0x0],'Phone':_0x242ff8,'Owner':{'name':!_[_0x586f('0x1c')](_0x1ed450[_0x586f('0x46')][_0x586f('0x18')])?_0x1ed450[_0x586f('0x46')][_0x586f('0x18')]:!_[_0x586f('0x1c')](_0x1ed450['first_name'])?_0x1ed450['first_name']+'\x20'+_0x1ed450[_0x586f('0x47')]:_0x1ed450['last_name'],'id':_0x1ed450['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x1754b4},'json':!![]})['then'](function(_0x2c7bf6){if(_0x2c7bf6&&_0x2c7bf6[_0x586f('0x40')][0x0][_0x586f('0x48')]===_0x586f('0x49')){var _0x320c3d=_0x2c7bf6[_0x586f('0x40')][0x0]['details'];_0x320c3d[_0x586f('0x41')]=_[_0x586f('0x44')](_0x4aed23[_0x586f('0x45')])+'s';return _0x320c3d;}logger[_0x586f('0x2e')]('The\x20failing\x20result\x20is',JSON[_0x586f('0xd')](data));throw new Error(_0x586f('0x4a')+JSON['stringify'](data));})[_0x586f('0x2d')](function(_0x213bef){console['log'](_0x586f('0x4b'),_0x213bef);});}function getEndUser(_0x190202,_0x476aee,_0x1b77d2,_0xd385bd,_0x5d3796,_0x45b25f,_0x4fd194){var _0x17817e={'method':_0x586f('0x31'),'uri':'','headers':{'Authorization':_0x586f('0x33')+_0x190202},'json':!![]};switch(_0x4fd194['moduleSearch']){case _0x586f('0x4c'):_0x17817e[_0x586f('0x4d')]=_0x586f('0x42')+_0x476aee+_0x586f('0x4e')+_0x5d3796+'))';return getZohoUser(_0x17817e,'Contacts')[_0x586f('0x2a')](function(_0x5692fd){if(_0x5692fd)return _0x5692fd;_0x17817e[_0x586f('0x4d')]=_0x586f('0x42')+_0x476aee+_0x586f('0x4f')+_0x5d3796+'))';return getZohoUser(_0x17817e,_0x586f('0x50'))['then'](function(_0x1207e9){if(_0x1207e9)return _0x1207e9;if(_0x4fd194[_0x586f('0x45')]!=_0x586f('0x51')){return createEndUser(_0x190202,_0x476aee,_0xd385bd,_0x5d3796,_0x45b25f,_0x4fd194);}else{return{};}});});break;case _0x586f('0x52'):_0x17817e[_0x586f('0x4d')]=_0x586f('0x42')+_0x476aee+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x5d3796+'))';return getZohoUser(_0x17817e,_0x586f('0x53'))['then'](function(_0x23ca93){if(_0x23ca93)return _0x23ca93;if(_0x4fd194[_0x586f('0x45')]!=_0x586f('0x51')){return createEndUser(_0x190202,_0x476aee,_0xd385bd,_0x5d3796,_0x45b25f,_0x4fd194);}else{return{};}});break;case _0x586f('0x54'):_0x17817e[_0x586f('0x4d')]=_0x586f('0x42')+_0x476aee+_0x586f('0x4f')+_0x5d3796+'))';return getZohoUser(_0x17817e,_0x586f('0x50'))[_0x586f('0x2a')](function(_0x37cd26){if(_0x37cd26)return _0x37cd26;if(_0x4fd194[_0x586f('0x45')]!=_0x586f('0x51')){return createEndUser(_0x190202,_0x476aee,_0xd385bd,_0x5d3796,_0x45b25f,_0x4fd194);}else{return{};}});break;}}function getCall(_0x5543fc,_0x2e5b00,_0x51d5df,_0x549d88,_0x59a3f6,_0x419fd5,_0x525a1a,_0x2913cc){logger[_0x586f('0x37')](_0x586f('0x55'));var _0x1e8c86={};_0x1e8c86[_0x586f('0x56')]={'name':!_[_0x586f('0x1c')](_0x549d88[_0x586f('0x46')]['name'])&&!_['isNil'](_0x549d88['profile'][_0x586f('0x18')])&&_0x549d88[_0x586f('0x3d')]['name']===_0x586f('0x57')?_0x549d88[_0x586f('0x46')]['name']:!_['isNil'](_0x549d88['first_name'])?_0x549d88[_0x586f('0x58')]+'\x20'+_0x549d88[_0x586f('0x47')]:_0x549d88[_0x586f('0x47')],'id':_0x549d88['id']};_0x1e8c86[_0x586f('0x59')]=intUtil[_0x586f('0x5a')](_0x419fd5[_0x586f('0x5b')],_0x525a1a,'\x20');_0x1e8c86[_0x586f('0x5c')]=intUtil[_0x586f('0x5a')](_0x419fd5[_0x586f('0x5d')],_0x525a1a,'\x0a');if(_0x59a3f6[_0x586f('0x41')]===_0x586f('0x53')){_0x1e8c86[_0x586f('0x5e')]={'name':!_[_0x586f('0x1c')](_0x59a3f6['Full_Name'])?_0x59a3f6[_0x586f('0x5f')]:!_[_0x586f('0x1c')](_0x59a3f6[_0x586f('0x60')])?_0x59a3f6[_0x586f('0x60')]+'\x20'+_0x59a3f6[_0x586f('0x61')]:_0x59a3f6['Last_Name'],'id':_0x59a3f6['id']};}if(_0x59a3f6[_0x586f('0x41')]===_0x586f('0x50')){_0x1e8c86[_0x586f('0x62')]={'name':!_[_0x586f('0x1c')](_0x59a3f6['Full_Name'])?_0x59a3f6['Full_Name']:!_[_0x586f('0x1c')](_0x59a3f6[_0x586f('0x60')])?_0x59a3f6[_0x586f('0x60')]+'\x20'+_0x59a3f6[_0x586f('0x61')]:_0x59a3f6[_0x586f('0x61')],'id':_0x59a3f6['id']};_0x1e8c86[_0x586f('0x63')]=_[_0x586f('0x44')](_0x59a3f6[_0x586f('0x41')]);}if(_0x525a1a['talktime']){_0x1e8c86[_0x586f('0x64')]=moment['utc'](parseInt(_0x525a1a[_0x586f('0x65')])*0x3e8)[_0x586f('0x66')](_0x586f('0x67'));}else if(_0x525a1a[_0x586f('0x68')]&&_0x525a1a['endtime']){_0x1e8c86[_0x586f('0x64')]=moment[_0x586f('0x69')](moment(_0x525a1a[_0x586f('0x6a')],_0x586f('0x6b'))['diff'](moment(_0x525a1a[_0x586f('0x6c')],_0x586f('0x6b'))))[_0x586f('0x66')](_0x586f('0x67'));}switch(_0x525a1a[_0x586f('0x6d')]){case _0x586f('0x6e'):_0x1e8c86['Call_Result']=_0x586f('0x6f');break;case _0x586f('0x70'):case _0x586f('0x71'):_0x1e8c86[_0x586f('0x72')]='Answered';break;case _0x586f('0x73'):_0x1e8c86[_0x586f('0x72')]='Rejected';break;case _0x586f('0x74'):_0x1e8c86['Call_Result']=_0x586f('0x75');break;case _0x586f('0x76'):_0x1e8c86['Call_Result']='Timeout';default:}_0x1e8c86['Call_Start_Time']=(_0x2913cc==='outbound'?moment(_0x525a1a[_0x586f('0x6c')])[_0x586f('0x66')](_0x586f('0x6b')):moment(_0x525a1a['agentcalledAt'])[_0x586f('0x66')](_0x586f('0x6b')))||moment()[_0x586f('0x66')](_0x586f('0x6b'));_0x1e8c86[_0x586f('0x77')]=_0x2913cc||_0x586f('0x78');_0x1e8c86=_['merge'](_0x1e8c86,getCustomFields(_0x419fd5[_0x586f('0x79')],_0x525a1a));return request({'method':'POST','uri':_0x586f('0x42')+_0x2e5b00+'/crm/v2/Calls','headers':{'Authorization':_0x586f('0x33')+_0x5543fc},'body':{'data':[_0x1e8c86]},'json':!![]})[_0x586f('0x2a')](function(_0x3af022){if(_0x3af022&&_0x3af022[_0x586f('0x40')][0x0][_0x586f('0x48')]===_0x586f('0x49')){logger[_0x586f('0x37')](_0x586f('0x7a'));return{'id':_0x3af022['data'][0x0][_0x586f('0x7b')]['id']};}})[_0x586f('0x2d')](function(_0x3385a3){logger['info'](_0x586f('0x7c'),_0x3385a3[_0x586f('0x7d')]);console['log'](_0x586f('0x7c'),_0x3385a3);});}exports['queue']=function(_0x3d240,_0x4769da,_0x256386,_0x265ac9,_0x12cc5b,_0x29f981){var _0x1eddde,_0x25a7b3,_0x2eb6a8;_0x29f981[_0x586f('0x7e')]=intUtil[_0x586f('0x7f')](_0x29f981[_0x586f('0x7e')]);_0x29f981['serverUrl']=intUtil[_0x586f('0x7f')](_0x29f981[_0x586f('0x80')]);if(_0x12cc5b&&_0x12cc5b[_0x586f('0x81')]){logger[_0x586f('0x37')](_0x586f('0x82'),'Recording\x20is\x20enabled!');_0x4769da[_0x586f('0x83')]=_0x29f981['serverUrl']+_0x586f('0x84')+_0x4769da[_0x586f('0x85')]+_0x586f('0x86')+md5(_0x4769da[_0x586f('0x85')]);}else{_0x4769da[_0x586f('0x83')]='';}var _0x152aa5=_0x29f981['host']==='zoho.eu'?'eu':_0x586f('0x87');return getAccessToken(_0x29f981)[_0x586f('0x2a')](function(_0x3e5ed5){_0x2eb6a8=_0x3e5ed5;return getUser(_0x2eb6a8,_0x152aa5,_0x29f981,_0x265ac9[_0x586f('0x36')]);})[_0x586f('0x2a')](function(_0x1a4a3a){_0x1eddde=_0x1a4a3a;logger[_0x586f('0x37')](_0x586f('0x88'),_0x1eddde['id']);return getEndUser(_0x2eb6a8,_0x152aa5,_0x29f981,_0x4769da[_0x586f('0x89')],_0x4769da[_0x586f('0x8a')],_0x1eddde,_0x256386);})[_0x586f('0x2a')](function(_0xcada5a){_0x25a7b3=_0xcada5a;return getCall(_0x2eb6a8,_0x152aa5,_0x29f981,_0x1eddde,_0x25a7b3,_0x256386,_0x4769da,_0x586f('0x78'));})[_0x586f('0x2a')](function(_0xc6f331){if(_0xc6f331){logger['info'](_0x586f('0x8b'),_0xc6f331['id']);logger[_0x586f('0x37')]('[QUEUE]',_0x586f('0x8c'));emit(util[_0x586f('0x66')]('user:%s',_0x265ac9['name']),_0x586f('0x8d'),{'uri':_0x586f('0x8e')+_0x29f981[_0x586f('0x7e')]+_0x586f('0x8f')+_0xc6f331['id']});}})['catch'](function(_0x288c5e){logger['error'](_0x586f('0x82'),JSON[_0x586f('0xd')](_0x288c5e));});};exports[_0x586f('0x90')]=function(_0x4f3971,_0x4bc28a,_0x6bee29,_0x75bf0,_0x2709b6,_0x2097ad,_0x314c6a){var _0x1197d3,_0x507472,_0x44007d;_0x2097ad[_0x586f('0x7e')]=intUtil[_0x586f('0x7f')](_0x2097ad['host']);_0x2097ad['serverUrl']=intUtil[_0x586f('0x7f')](_0x2097ad[_0x586f('0x80')]);if(_0x314c6a&&_0x314c6a['recordingFormat']&&_0x314c6a[_0x586f('0x91')]!=='none'){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4bc28a[_0x586f('0x83')]=_0x2097ad[_0x586f('0x80')]+_0x586f('0x84')+_0x4bc28a[_0x586f('0x85')]+_0x586f('0x86')+md5(_0x4bc28a['uniqueid']);}var _0x462784=_0x2097ad[_0x586f('0x7e')]===_0x586f('0x92')?'eu':'com';return getAccessToken(_0x2097ad)[_0x586f('0x2a')](function(_0x461758){_0x44007d=_0x461758;return getUser(_0x44007d,_0x462784,_0x2097ad,_0x75bf0[_0x586f('0x36')]);})[_0x586f('0x2a')](function(_0x5cd4c2){_0x1197d3=_0x5cd4c2;logger[_0x586f('0x37')]('The\x20User\x20ID\x20is:',_0x1197d3['id']);return getEndUser(_0x44007d,_0x462784,_0x2097ad,_0x4bc28a[_0x586f('0x93')],_0x4bc28a[_0x586f('0x94')],_0x1197d3,_0x6bee29);})[_0x586f('0x2a')](function(_0x2923e1){_0x507472=_0x2923e1;return getCall(_0x44007d,_0x462784,_0x2097ad,_0x1197d3,_0x507472,_0x6bee29,_0x4bc28a,_0x586f('0x95'));})[_0x586f('0x2a')](function(_0x2eab76){if(_0x2eab76){logger[_0x586f('0x37')](_0x586f('0x8b'),_0x2eab76['id']);logger[_0x586f('0x37')](_0x586f('0x96'),_0x586f('0x8c'));emit(util[_0x586f('0x66')]('user:%s',_0x75bf0[_0x586f('0x18')]),_0x586f('0x8d'),{'uri':'https://crm.'+_0x2097ad[_0x586f('0x7e')]+_0x586f('0x8f')+_0x2eab76['id']});}})['catch'](function(_0x1adda4){logger[_0x586f('0x2e')](_0x586f('0x96'),JSON[_0x586f('0xd')](_0x1adda4));});};exports[_0x586f('0x97')]=function(_0x2dd076,_0x3cdd1b,_0x1bfd6e,_0x19dab4,_0x14c4c2,_0x2a8432){var _0x1d6e78,_0x4a9ac3,_0x243b1f;_0x2a8432[_0x586f('0x7e')]=intUtil['stripTrailingSlash'](_0x2a8432[_0x586f('0x7e')]);_0x2a8432[_0x586f('0x80')]=intUtil['stripTrailingSlash'](_0x2a8432[_0x586f('0x80')]);if(_0x14c4c2&&_0x14c4c2[_0x586f('0x81')]){logger[_0x586f('0x37')]('['+_0x3cdd1b['lastevent'][_0x586f('0x98')]()+']',_0x586f('0x99'));_0x3cdd1b[_0x586f('0x83')]=_0x2a8432[_0x586f('0x80')]+_0x586f('0x84')+_0x3cdd1b['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x3cdd1b[_0x586f('0x85')]);}else{_0x3cdd1b['recordingURL']='';}var _0x4f6307=_0x2a8432['host']===_0x586f('0x92')?'eu':_0x586f('0x87');return getAccessToken(_0x2a8432)['then'](function(_0xae21b3){_0x243b1f=_0xae21b3;return getUser(_0x243b1f,_0x4f6307,_0x2a8432);})[_0x586f('0x2a')](function(_0x3f54ab){_0x1d6e78=_0x3f54ab;logger[_0x586f('0x37')](_0x586f('0x88'),_0x1d6e78['id']);return getEndUser(_0x243b1f,_0x4f6307,_0x2a8432,_0x3cdd1b[_0x586f('0x89')],_0x3cdd1b[_0x586f('0x8a')],_0x1d6e78,_0x1bfd6e);})[_0x586f('0x2a')](function(_0x4e1a76){_0x4a9ac3=_0x4e1a76;return getCall(_0x243b1f,_0x4f6307,_0x2a8432,_0x1d6e78,_0x4a9ac3,_0x1bfd6e,_0x3cdd1b,_0x586f('0x78'));})['then'](function(_0x1df4f6){if(_0x1df4f6){logger[_0x586f('0x37')](_0x586f('0x8b'),_0x1df4f6['id']);}})['catch'](function(_0x45c22b){logger[_0x586f('0x2e')]('['+_0x3cdd1b[_0x586f('0x6d')]['toUpperCase']()+']',JSON[_0x586f('0xd')](_0x45c22b));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/script/index.js b/server/services/ami/trigger/script/index.js index 059c911..bcb0cb8 100644 --- a/server/services/ami/trigger/script/index.js +++ b/server/services/ami/trigger/script/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeb65=['%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','../../../../config/logger','trigger','exec','data2','Script','data3','render','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xeb65,0x121));var _0x5eb6=function(_0x3f12c8,_0x5ecee0){_0x3f12c8=_0x3f12c8-0x0;var _0xbc9d49=_0xeb65[_0x3f12c8];return _0xbc9d49;};'use strict';var util=require(_0x5eb6('0x0'));var sh=require('shelljs');var Mustache=require('mustache');var logger=require(_0x5eb6('0x1'))(_0x5eb6('0x2'));exports[_0x5eb6('0x3')]=function(_0x2db5c7,_0x2139ac){var _0x261eda=_0x2db5c7[_0x5eb6('0x4')]?_0x2db5c7[_0x5eb6('0x4')]:_0x5eb6('0x5');var _0x286fe8=_0x2db5c7[_0x5eb6('0x6')]?Mustache[_0x5eb6('0x7')](_0x2db5c7[_0x5eb6('0x6')],_0x2139ac):_0x2139ac;sh[_0x5eb6('0x3')](_0x286fe8,function(_0x593fb4,_0x26061c,_0xfbaf73){if(_0x593fb4!==0x0){logger[_0x5eb6('0x8')](util[_0x5eb6('0x9')](_0x5eb6('0xa'),_0x261eda,_0x286fe8,_0x593fb4,_0xfbaf73));}else{logger['info'](util[_0x5eb6('0x9')](_0x5eb6('0xb'),_0x261eda,_0x286fe8,_0x26061c));}});}; \ No newline at end of file +var _0xbe82=['exec','data2','Script','data3','render','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','../../../../config/logger','trigger'];(function(_0x3c346f,_0x38991a){var _0x40de4c=function(_0x553fc8){while(--_0x553fc8){_0x3c346f['push'](_0x3c346f['shift']());}};_0x40de4c(++_0x38991a);}(_0xbe82,0xa3));var _0x2be8=function(_0x181363,_0x40cd9e){_0x181363=_0x181363-0x0;var _0x51a4af=_0xbe82[_0x181363];return _0x51a4af;};'use strict';var util=require(_0x2be8('0x0'));var sh=require(_0x2be8('0x1'));var Mustache=require(_0x2be8('0x2'));var logger=require(_0x2be8('0x3'))(_0x2be8('0x4'));exports[_0x2be8('0x5')]=function(_0x24b4be,_0x507126){var _0x39abae=_0x24b4be['data2']?_0x24b4be[_0x2be8('0x6')]:_0x2be8('0x7');var _0x458039=_0x24b4be[_0x2be8('0x8')]?Mustache[_0x2be8('0x9')](_0x24b4be[_0x2be8('0x8')],_0x507126):_0x507126;sh[_0x2be8('0x5')](_0x458039,function(_0x385b15,_0x485316,_0x39a423){if(_0x385b15!==0x0){logger['error'](util[_0x2be8('0xa')](_0x2be8('0xb'),_0x39abae,_0x458039,_0x385b15,_0x39a423));}else{logger[_0x2be8('0xc')](util['format'](_0x2be8('0xd'),_0x39abae,_0x458039,_0x485316));}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/urlforward/index.js b/server/services/ami/trigger/urlforward/index.js index 34eccac..2fc1a01 100644 --- a/server/services/ami/trigger/urlforward/index.js +++ b/server/services/ami/trigger/urlforward/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x16b3=['error','stack','GET','POST','PUT','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','util','lodash','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','data5','number','headers','data6','parse'];(function(_0x2fc013,_0x1bb40e){var _0x2ecda6=function(_0x2ab3fb){while(--_0x2ab3fb){_0x2fc013['push'](_0x2fc013['shift']());}};_0x2ecda6(++_0x1bb40e);}(_0x16b3,0x9c));var _0x316b=function(_0x3ef286,_0x304988){_0x3ef286=_0x3ef286-0x0;var _0xf7420a=_0x16b3[_0x3ef286];return _0xf7420a;};'use strict';var rp=require('request-promise');var util=require(_0x316b('0x0'));var _=require(_0x316b('0x1'));var Mustache=require('mustache');var logger=require(_0x316b('0x2'))(_0x316b('0x3'));exports[_0x316b('0x4')]=function(_0x5edb66,_0x3d7ac4){var _0xc09a93,_0x35bd25;var _0x1529fd={'method':_0x5edb66[_0x316b('0x5')][_0x316b('0x6')](),'uri':Mustache[_0x316b('0x7')](_0x5edb66[_0x316b('0x8')],_0x3d7ac4),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5edb66[_0x316b('0x9')])===_0x316b('0xa')&&parseInt(_0x5edb66['data5'])>=0x1&&parseInt(_0x5edb66[_0x316b('0x9')])<=0xa?parseInt(_0x5edb66[_0x316b('0x9')])*0x3e8:0x5*0x3e8};try{_0x1529fd[_0x316b('0xb')]=_0x5edb66[_0x316b('0xc')]?JSON[_0x316b('0xd')](Mustache['render'](_0x5edb66[_0x316b('0xc')],_0x3d7ac4)):{};}catch(_0x5712c0){logger[_0x316b('0xe')](_0x5712c0[_0x316b('0xf')]);}switch(_0x5edb66[_0x316b('0x5')][_0x316b('0x6')]()){case _0x316b('0x10'):case'DELETE':_0xc09a93=null;_0x1529fd['qs']=_0x3d7ac4;break;case _0x316b('0x11'):case _0x316b('0x12'):if(_0x5edb66['data7']){try{_0xc09a93=JSON[_0x316b('0xd')](Mustache['render'](_0x5edb66['data7'],_0x3d7ac4));_0x1529fd[_0x316b('0x13')]=_0xc09a93;}catch(_0x22264b){logger[_0x316b('0xe')](_0x22264b['stack']);logger[_0x316b('0xe')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0xc09a93=_0x3d7ac4;_0x1529fd[_0x316b('0x13')]=_0xc09a93;}break;}logger[_0x316b('0x14')](util[_0x316b('0x15')](_0x316b('0x16'),_0x5edb66[_0x316b('0x5')],_0x5edb66[_0x316b('0x8')],JSON[_0x316b('0x17')](_0x1529fd)));rp(_0x1529fd)[_0x316b('0x18')](function(_0x48f7b4){_0xc09a93=!_[_0x316b('0x19')](_0xc09a93)?_0x316b('0x1a')+_0xc09a93:'';_0x35bd25=typeof _0x48f7b4[_0x316b('0x13')]===_0x316b('0x1b')?JSON[_0x316b('0x17')](_0x48f7b4[_0x316b('0x13')]):_0x48f7b4[_0x316b('0x13')];logger['info'](util['format'](_0x316b('0x1c'),_0x5edb66['data1'],_0x5edb66[_0x316b('0x8')],_0x48f7b4[_0x316b('0x1d')],_0x35bd25));})[_0x316b('0x1e')](function(_0x2f0038){logger['error'](util[_0x316b('0x15')](_0x316b('0x1f'),_0x5edb66[_0x316b('0x5')],_0x5edb66[_0x316b('0x8')],_0x2f0038['statusCode'],_0x2f0038[_0x316b('0x20')],_0x2f0038[_0x316b('0x21')]));});}; \ No newline at end of file +var _0x81a2=['statusCode','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','mustache','data1','data2','data5','number','render','data6','stack','toUpperCase','DELETE','POST','PUT','parse','data7','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object'];(function(_0x51418c,_0x3d5701){var _0x303689=function(_0x5f018e){while(--_0x5f018e){_0x51418c['push'](_0x51418c['shift']());}};_0x303689(++_0x3d5701);}(_0x81a2,0x178));var _0x281a=function(_0x347b04,_0x32ac86){_0x347b04=_0x347b04-0x0;var _0x13e412=_0x81a2[_0x347b04];return _0x13e412;};'use strict';var rp=require(_0x281a('0x0'));var util=require(_0x281a('0x1'));var _=require('lodash');var Mustache=require(_0x281a('0x2'));var logger=require('../../../../config/logger')('trigger');exports['exec']=function(_0x41d97a,_0x2c38e6){var _0x376239,_0x4368d5;var _0x5356d8={'method':_0x41d97a[_0x281a('0x3')]['toUpperCase'](),'uri':Mustache['render'](_0x41d97a[_0x281a('0x4')],_0x2c38e6),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x41d97a[_0x281a('0x5')])===_0x281a('0x6')&&parseInt(_0x41d97a[_0x281a('0x5')])>=0x1&&parseInt(_0x41d97a['data5'])<=0xa?parseInt(_0x41d97a['data5'])*0x3e8:0x5*0x3e8};try{_0x5356d8['headers']=_0x41d97a['data6']?JSON['parse'](Mustache[_0x281a('0x7')](_0x41d97a[_0x281a('0x8')],_0x2c38e6)):{};}catch(_0x103913){logger['error'](_0x103913[_0x281a('0x9')]);}switch(_0x41d97a[_0x281a('0x3')][_0x281a('0xa')]()){case'GET':case _0x281a('0xb'):_0x376239=null;_0x5356d8['qs']=_0x2c38e6;break;case _0x281a('0xc'):case _0x281a('0xd'):if(_0x41d97a['data7']){try{_0x376239=JSON[_0x281a('0xe')](Mustache[_0x281a('0x7')](_0x41d97a[_0x281a('0xf')],_0x2c38e6));_0x5356d8[_0x281a('0x10')]=_0x376239;}catch(_0x5e4c6c){logger[_0x281a('0x11')](_0x5e4c6c[_0x281a('0x9')]);logger[_0x281a('0x11')](_0x281a('0x12'));}}else{_0x376239=_0x2c38e6;_0x5356d8[_0x281a('0x10')]=_0x376239;}break;}logger[_0x281a('0x13')](util[_0x281a('0x14')](_0x281a('0x15'),_0x41d97a[_0x281a('0x3')],_0x41d97a[_0x281a('0x4')],JSON[_0x281a('0x16')](_0x5356d8)));rp(_0x5356d8)[_0x281a('0x17')](function(_0x14f487){_0x376239=!_[_0x281a('0x18')](_0x376239)?_0x281a('0x19')+_0x376239:'';_0x4368d5=typeof _0x14f487['body']===_0x281a('0x1a')?JSON[_0x281a('0x16')](_0x14f487[_0x281a('0x10')]):_0x14f487[_0x281a('0x10')];logger[_0x281a('0x13')](util[_0x281a('0x14')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x41d97a[_0x281a('0x3')],_0x41d97a[_0x281a('0x4')],_0x14f487[_0x281a('0x1b')],_0x4368d5));})['catch'](function(_0x15fba3){logger['error'](util[_0x281a('0x14')](_0x281a('0x1c'),_0x41d97a[_0x281a('0x3')],_0x41d97a[_0x281a('0x4')],_0x15fba3['statusCode'],_0x15fba3[_0x281a('0x1d')],_0x15fba3[_0x281a('0x1e')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 7bd4dab..f175da0 100644 --- a/server/services/email/client.js +++ b/server/services/email/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x146a=['result','catch','jayson/promise','../../config/logger','routing','then','debug','rpc','error','message'];(function(_0x33aeab,_0x1242b4){var _0x50cec9=function(_0x7eee88){while(--_0x7eee88){_0x33aeab['push'](_0x33aeab['shift']());}};_0x50cec9(++_0x1242b4);}(_0x146a,0x1b0));var _0xa146=function(_0x4b8fc7,_0x5022fc){_0x4b8fc7=_0x4b8fc7-0x0;var _0x249f4a=_0x146a[_0x4b8fc7];return _0x249f4a;};'use strict';var jayson=require(_0xa146('0x0'));var BPromise=require('bluebird');var logger=require(_0xa146('0x1'))(_0xa146('0x2'));var client=jayson['client']['http']({'port':0x2329});client['Request']=function(_0x140ed2,_0x430399){return new BPromise(function(_0x41f5c7,_0x143de3){return client['request'](_0x140ed2,_0x430399)[_0xa146('0x3')](function(_0x20d306){logger[_0xa146('0x4')](_0xa146('0x5'),_0xa146('0x2'),_0x140ed2,_0x430399,_0x20d306);if(_0x20d306['error']){logger[_0xa146('0x6')](_0xa146('0x5'),_0xa146('0x2'),_0x140ed2,_0x20d306['error'][_0xa146('0x7')],_0x430399);return _0x143de3(_0x20d306[_0xa146('0x6')]['message']);}else{return _0x41f5c7(_0x20d306[_0xa146('0x8')]);}})[_0xa146('0x9')](function(_0x2a91b0){logger['error']('rpc',_0xa146('0x2'),_0x140ed2,_0x2a91b0,_0x430399);return _0x143de3(_0x2a91b0);});});};module['exports']=client; \ No newline at end of file +var _0x04dc=['request','then','debug','rpc','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request'];(function(_0x437760,_0x13d1a1){var _0x439581=function(_0x4d22d6){while(--_0x4d22d6){_0x437760['push'](_0x437760['shift']());}};_0x439581(++_0x13d1a1);}(_0x04dc,0x159));var _0xc04d=function(_0xde6565,_0x37a2d7){_0xde6565=_0xde6565-0x0;var _0x3df782=_0x04dc[_0xde6565];return _0x3df782;};'use strict';var jayson=require(_0xc04d('0x0'));var BPromise=require(_0xc04d('0x1'));var logger=require(_0xc04d('0x2'))(_0xc04d('0x3'));var client=jayson[_0xc04d('0x4')][_0xc04d('0x5')]({'port':0x2329});client[_0xc04d('0x6')]=function(_0x403ba9,_0xc13c0){return new BPromise(function(_0x381017,_0x3d38b0){return client[_0xc04d('0x7')](_0x403ba9,_0xc13c0)[_0xc04d('0x8')](function(_0x5f05be){logger[_0xc04d('0x9')](_0xc04d('0xa'),_0xc04d('0x3'),_0x403ba9,_0xc13c0,_0x5f05be);if(_0x5f05be[_0xc04d('0xb')]){logger['error'](_0xc04d('0xa'),'routing',_0x403ba9,_0x5f05be[_0xc04d('0xb')][_0xc04d('0xc')],_0xc13c0);return _0x3d38b0(_0x5f05be['error'][_0xc04d('0xc')]);}else{return _0x381017(_0x5f05be[_0xc04d('0xd')]);}})[_0xc04d('0xe')](function(_0x18cbd9){logger[_0xc04d('0xb')](_0xc04d('0xa'),_0xc04d('0x3'),_0x403ba9,_0x18cbd9,_0xc13c0);return _0x3d38b0(_0x18cbd9);});});};module[_0xc04d('0xf')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 1dc97ed..c15dffa 100644 --- a/server/services/email/index.js +++ b/server/services/email/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0779=['./realtime','./rpc/mailAccount','./rpc/setting','../../config/logger','email','resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','listen','getSettings','loginMailFrequency','catch','Email\x20service\x20initialization','./server'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0779,0x1b9));var _0x9077=function(_0x5b036c,_0x26691b){_0x5b036c=_0x5b036c-0x0;var _0x2309e5=_0x0779[_0x5b036c];return _0x2309e5;};'use strict';var server=require(_0x9077('0x0'));var Realtime=require(_0x9077('0x1'));var EmailChannel=require('./lib/email');var mailAccount=require(_0x9077('0x2'));var setting=require(_0x9077('0x3'));var logger=require(_0x9077('0x4'))(_0x9077('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x9077('0x6')]()[_0x9077('0x7')](mailAccount[_0x9077('0x8')]())[_0x9077('0x7')](realtime[_0x9077('0x9')]())[_0x9077('0x7')](function(){email[_0x9077('0xa')](realtime[_0x9077('0xb')]);return realtime;});}function main(){return server[_0x9077('0xc')](realtime,email)[_0x9077('0x7')](function(){return initRealtime();})[_0x9077('0x7')](function(){return setting[_0x9077('0xd')]();})[_0x9077('0x7')](function(_0x3b33a5){return setInterval(initRealtime,_0x3b33a5[_0x9077('0xe')]*0x3e8);})[_0x9077('0xf')](function(_0x5516d4){logger['error'](_0x9077('0x10'),_0x5516d4);});}main(); \ No newline at end of file +var _0xdada=['loginMailFrequency','catch','error','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/setting','../../config/logger','email','resolve','getMailAccounts','initMailAccounts','refresh','then','getSettings'];(function(_0x48ffc9,_0x581b31){var _0x1985cb=function(_0x4702d6){while(--_0x4702d6){_0x48ffc9['push'](_0x48ffc9['shift']());}};_0x1985cb(++_0x581b31);}(_0xdada,0x1d4));var _0xadad=function(_0x3cd674,_0x4f7752){_0x3cd674=_0x3cd674-0x0;var _0x5e1b1b=_0xdada[_0x3cd674];return _0x5e1b1b;};'use strict';var server=require(_0xadad('0x0'));var Realtime=require(_0xadad('0x1'));var EmailChannel=require(_0xadad('0x2'));var mailAccount=require('./rpc/mailAccount');var setting=require(_0xadad('0x3'));var logger=require(_0xadad('0x4'))(_0xadad('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xadad('0x6')]()['then'](mailAccount[_0xadad('0x7')]())['then'](realtime[_0xadad('0x8')]())['then'](function(){email[_0xadad('0x9')](realtime['mailAccounts']);return realtime;});}function main(){return server['listen'](realtime,email)[_0xadad('0xa')](function(){return initRealtime();})[_0xadad('0xa')](function(){return setting[_0xadad('0xb')]();})[_0xadad('0xa')](function(_0x1e8bbe){return setInterval(initRealtime,_0x1e8bbe[_0xadad('0xc')]*0x3e8);})[_0xadad('0xd')](function(_0x1aa188){logger[_0xadad('0xe')](_0xadad('0xf'),_0x1aa188);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index c225339..9260d38 100644 --- a/server/services/email/lib/email.js +++ b/server/services/email/lib/email.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x134a=['sendMail','send','verifySmtp','Smtp','verify','verified','exports','lodash','moment','bluebird','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./smtp','../rpc/mailAccount','info','mailAccounts','smtp','prototype','emit','key','active','Imap','status','messageStatus','total','md5','mailAccount:update','hasOwnProperty','service','provider','imapAccounts','handleImapEmail','bind','error','handleImapError','isNil','disabled','handleImapBox','connected','name','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','catch','stringify','handleImapEnd','lastSync'];(function(_0x3006ec,_0x520480){var _0x1b7e14=function(_0x4657b2){while(--_0x4657b2){_0x3006ec['push'](_0x3006ec['shift']());}};_0x1b7e14(++_0x520480);}(_0x134a,0x77));var _0xa134=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x134a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xa134('0x0'));var moment=require(_0xa134('0x1'));var BPromise=require(_0xa134('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0xa134('0x3'));var logger=require(_0xa134('0x4'))(_0xa134('0x5'));config[_0xa134('0x6')]=_[_0xa134('0x7')](config[_0xa134('0x6')],{'host':_0xa134('0x8'),'port':0x18eb});var io=require(_0xa134('0x9'))(new Redis(config[_0xa134('0x6')]));var EmailImap=require('./imap');var EmailSmtp=require(_0xa134('0xa'));var mailAccount=require(_0xa134('0xb'));var md5Accounts={};function EmailChannel(_0x3ad65e){logger[_0xa134('0xc')]('start\x20email\x20channel');this[_0xa134('0xd')]=_0x3ad65e[_0xa134('0xd')];this['imapAccounts']={};this[_0xa134('0xe')]=new EmailSmtp();}EmailChannel[_0xa134('0xf')][_0xa134('0x10')]=function(_0x586889){var _0x81d455=this[_0xa134('0xd')][_0x586889];var _0x16f959={'id':_0x81d455['id'],'name':_0x81d455['name'],'key':_0x81d455[_0xa134('0x11')],'active':_0x81d455[_0xa134('0x12')],'Imap':{'status':_0x81d455[_0xa134('0x13')][_0xa134('0x14')],'messageStatus':_0x81d455['Imap'][_0xa134('0x15')],'total':_0x81d455['Imap'][_0xa134('0x16')]}};if(_['isNil'](md5Accounts[_0x586889])){md5Accounts[_0x586889]={};}var _0x5e1161=md5(JSON['stringify'](_0x16f959));if(md5Accounts[_0x586889][_0xa134('0x17')]!==_0x5e1161){md5Accounts[_0x586889][_0xa134('0x17')]=_0x5e1161;io[_0xa134('0x10')](_0xa134('0x18'),_0x16f959);}};EmailChannel[_0xa134('0xf')]['refresh']=function(_0x3bb9a6){for(var _0x2bcbca in _0x3bb9a6){if(_0x3bb9a6[_0xa134('0x19')](_0x2bcbca)){if(_0x3bb9a6[_0x2bcbca][_0xa134('0x13')]&&_0x3bb9a6[_0x2bcbca][_0xa134('0x12')]){var _0x1af48d=_0x3bb9a6[_0x2bcbca]['Imap'];if(!_0x1af48d[_0xa134('0x1a')]&&_0x3bb9a6[_0x2bcbca][_0xa134('0x1b')]!=='custom')_0x1af48d[_0xa134('0x1a')]=_0x3bb9a6[_0x2bcbca][_0xa134('0x1b')];if(!this['imapAccounts'][_0xa134('0x19')](_0x1af48d['id'])){this[_0xa134('0x1c')][_0x1af48d['id']]=new EmailImap(_0x1af48d,_0x3bb9a6[_0x2bcbca][_0xa134('0x5')]);this['imapAccounts'][_0x1af48d['id']]['on']('box',this['handleImapBox']['bind'](this,_0x2bcbca));this[_0xa134('0x1c')][_0x1af48d['id']]['on'](_0xa134('0x5'),this[_0xa134('0x1d')]['bind'](this,_0x2bcbca));this[_0xa134('0x1c')][_0x1af48d['id']]['on']('end',this['handleImapEnd'][_0xa134('0x1e')](this,_0x2bcbca));this[_0xa134('0x1c')][_0x1af48d['id']]['on'](_0xa134('0x1f'),this[_0xa134('0x20')][_0xa134('0x1e')](this,_0x2bcbca));}}else{if(_[_0xa134('0x21')](this[_0xa134('0xd')][_0x2bcbca][_0xa134('0x13')])){this[_0xa134('0xd')][_0x2bcbca]['Imap']={};}this[_0xa134('0xd')][_0x2bcbca][_0xa134('0x13')][_0xa134('0x14')]=_0xa134('0x22');this[_0xa134('0xd')][_0x2bcbca]['Imap']['messageStatus']='';this[_0xa134('0x10')](_0x2bcbca);}}}};EmailChannel[_0xa134('0xf')][_0xa134('0x23')]=function(_0x5aa47d,_0x5a2068){if(this['mailAccounts'][_0x5aa47d]){this[_0xa134('0xd')][_0x5aa47d][_0xa134('0x13')]['status']=_0xa134('0x24');this[_0xa134('0xd')][_0x5aa47d][_0xa134('0x13')][_0xa134('0x15')]=_0x5a2068[_0xa134('0x25')];if(_0x5a2068[_0xa134('0x26')]){this[_0xa134('0xd')][_0x5aa47d][_0xa134('0x13')][_0xa134('0x16')]=_0x5a2068[_0xa134('0x26')][_0xa134('0x16')];}return this[_0xa134('0x10')](_0x5aa47d);}};EmailChannel[_0xa134('0xf')][_0xa134('0x1d')]=function(_0x3d0fd1,_0x59fb5e){logger[_0xa134('0xc')](_0xa134('0x27'),_0x59fb5e[_0xa134('0x28')],_0x59fb5e[_0xa134('0x29')],_0x59fb5e[_0xa134('0x2a')],_0x3d0fd1);if(this[_0xa134('0xd')][_0x3d0fd1]){return mailAccount[_0xa134('0x2b')](_0x3d0fd1,_0x59fb5e)[_0xa134('0x2c')](function(_0xad12bd){if(_0xad12bd){logger[_0xa134('0xc')]('Mail\x20accepted\x20from\x20routing');}})[_0xa134('0x2d')](function(_0x371623){logger[_0xa134('0x1f')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0xa134('0x2e')](_0x371623));});}};EmailChannel[_0xa134('0xf')][_0xa134('0x2f')]=function(_0xddb1a1){if(this[_0xa134('0xd')][_0xddb1a1]&&this[_0xa134('0xd')][_0xddb1a1][_0xa134('0x13')]){if(this[_0xa134('0x1c')][this[_0xa134('0xd')][_0xddb1a1][_0xa134('0x13')]['id']]){delete this[_0xa134('0x1c')][this['mailAccounts'][_0xddb1a1][_0xa134('0x13')]['id']];}this['mailAccounts'][_0xddb1a1][_0xa134('0x13')][_0xa134('0x30')]=moment();this['emit'](_0xddb1a1);}};EmailChannel[_0xa134('0xf')][_0xa134('0x20')]=function(_0x2a1d7a,_0x16cf68){if(this['mailAccounts'][_0x2a1d7a]){this[_0xa134('0xd')][_0x2a1d7a][_0xa134('0x13')]['status']=_0xa134('0x1f');this[_0xa134('0xd')][_0x2a1d7a][_0xa134('0x13')][_0xa134('0x15')]=_0x16cf68;return this['emit'](_0x2a1d7a);}};EmailChannel[_0xa134('0xf')][_0xa134('0x31')]=function(_0x371f7d,_0x58722b){return this['smtp'][_0xa134('0x32')](_0x371f7d,_0x58722b);};EmailChannel['prototype'][_0xa134('0x33')]=function(_0xc38a67){var _0x582824=this;if(this['mailAccounts'][_0xc38a67['id']]){if(_[_0xa134('0x21')](this[_0xa134('0xd')][_0xc38a67['id']][_0xa134('0x34')])){this['mailAccounts'][_0xc38a67['id']][_0xa134('0x34')]={};}this[_0xa134('0xd')][_0xc38a67['id']][_0xa134('0x34')]['lastSync']=moment();return new BPromise(function(_0x5744ea,_0x369008){return _0x582824[_0xa134('0xe')][_0xa134('0x35')](_0xc38a67)[_0xa134('0x2c')](function(_0x4465b2){_0x582824[_0xa134('0xd')][_0xc38a67['id']][_0xa134('0x34')]['status']=_0xa134('0x36');_0x582824[_0xa134('0xd')][_0xc38a67['id']][_0xa134('0x34')][_0xa134('0x15')]='';_0x582824['emit'](_0xc38a67['id']);_0x5744ea(_0x4465b2);})[_0xa134('0x2d')](function(_0x423651){_0x582824[_0xa134('0xd')][_0xc38a67['id']][_0xa134('0x34')][_0xa134('0x14')]=_0xa134('0x1f');_0x582824[_0xa134('0xd')][_0xc38a67['id']]['Smtp'][_0xa134('0x15')]=_0x423651;_0x582824[_0xa134('0x10')](_0xc38a67['id']);_0x369008(_0x423651);});});}return this['smtp'][_0xa134('0x35')](_0xc38a67);};module[_0xa134('0x37')]=EmailChannel; \ No newline at end of file +var _0xe4cf=['name','key','active','Imap','messageStatus','total','isNil','stringify','mailAccount:update','hasOwnProperty','service','provider','custom','bind','end','handleImapEnd','error','handleImapError','disabled','prototype','handleImapBox','status','messages','handleImapEmail','firstName','lastName','from','notify','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','send','verifySmtp','Smtp','lastSync','verified','verify','lodash','moment','md5','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','emit'];(function(_0x1cb0b4,_0x1fd48d){var _0x525b60=function(_0x1efccc){while(--_0x1efccc){_0x1cb0b4['push'](_0x1cb0b4['shift']());}};_0x525b60(++_0x1fd48d);}(_0xe4cf,0x90));var _0xfe4c=function(_0x433b85,_0x518c22){_0x433b85=_0x433b85-0x0;var _0x15474f=_0xe4cf[_0x433b85];return _0x15474f;};'use strict';var _=require(_0xfe4c('0x0'));var moment=require(_0xfe4c('0x1'));var BPromise=require('bluebird');var md5=require(_0xfe4c('0x2'));var Redis=require('ioredis');var config=require(_0xfe4c('0x3'));var logger=require(_0xfe4c('0x4'))(_0xfe4c('0x5'));config[_0xfe4c('0x6')]=_[_0xfe4c('0x7')](config[_0xfe4c('0x6')],{'host':_0xfe4c('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xfe4c('0x6')]));var EmailImap=require(_0xfe4c('0x9'));var EmailSmtp=require(_0xfe4c('0xa'));var mailAccount=require(_0xfe4c('0xb'));var md5Accounts={};function EmailChannel(_0x34de11){logger[_0xfe4c('0xc')](_0xfe4c('0xd'));this[_0xfe4c('0xe')]=_0x34de11[_0xfe4c('0xe')];this[_0xfe4c('0xf')]={};this[_0xfe4c('0x10')]=new EmailSmtp();}EmailChannel['prototype'][_0xfe4c('0x11')]=function(_0x6979a0){var _0x4ade81=this[_0xfe4c('0xe')][_0x6979a0];var _0x5b9ae3={'id':_0x4ade81['id'],'name':_0x4ade81[_0xfe4c('0x12')],'key':_0x4ade81[_0xfe4c('0x13')],'active':_0x4ade81[_0xfe4c('0x14')],'Imap':{'status':_0x4ade81['Imap']['status'],'messageStatus':_0x4ade81[_0xfe4c('0x15')][_0xfe4c('0x16')],'total':_0x4ade81[_0xfe4c('0x15')][_0xfe4c('0x17')]}};if(_[_0xfe4c('0x18')](md5Accounts[_0x6979a0])){md5Accounts[_0x6979a0]={};}var _0x3ae223=md5(JSON[_0xfe4c('0x19')](_0x5b9ae3));if(md5Accounts[_0x6979a0][_0xfe4c('0x2')]!==_0x3ae223){md5Accounts[_0x6979a0][_0xfe4c('0x2')]=_0x3ae223;io[_0xfe4c('0x11')](_0xfe4c('0x1a'),_0x5b9ae3);}};EmailChannel['prototype']['refresh']=function(_0x42a24d){for(var _0x1dba45 in _0x42a24d){if(_0x42a24d[_0xfe4c('0x1b')](_0x1dba45)){if(_0x42a24d[_0x1dba45]['Imap']&&_0x42a24d[_0x1dba45][_0xfe4c('0x14')]){var _0x39ed1e=_0x42a24d[_0x1dba45][_0xfe4c('0x15')];if(!_0x39ed1e[_0xfe4c('0x1c')]&&_0x42a24d[_0x1dba45][_0xfe4c('0x1d')]!==_0xfe4c('0x1e'))_0x39ed1e[_0xfe4c('0x1c')]=_0x42a24d[_0x1dba45][_0xfe4c('0x1d')];if(!this['imapAccounts'][_0xfe4c('0x1b')](_0x39ed1e['id'])){this[_0xfe4c('0xf')][_0x39ed1e['id']]=new EmailImap(_0x39ed1e,_0x42a24d[_0x1dba45]['email']);this[_0xfe4c('0xf')][_0x39ed1e['id']]['on']('box',this['handleImapBox']['bind'](this,_0x1dba45));this[_0xfe4c('0xf')][_0x39ed1e['id']]['on'](_0xfe4c('0x5'),this['handleImapEmail'][_0xfe4c('0x1f')](this,_0x1dba45));this['imapAccounts'][_0x39ed1e['id']]['on'](_0xfe4c('0x20'),this[_0xfe4c('0x21')][_0xfe4c('0x1f')](this,_0x1dba45));this[_0xfe4c('0xf')][_0x39ed1e['id']]['on'](_0xfe4c('0x22'),this[_0xfe4c('0x23')][_0xfe4c('0x1f')](this,_0x1dba45));}}else{if(_['isNil'](this['mailAccounts'][_0x1dba45][_0xfe4c('0x15')])){this[_0xfe4c('0xe')][_0x1dba45][_0xfe4c('0x15')]={};}this[_0xfe4c('0xe')][_0x1dba45][_0xfe4c('0x15')]['status']=_0xfe4c('0x24');this[_0xfe4c('0xe')][_0x1dba45]['Imap'][_0xfe4c('0x16')]='';this['emit'](_0x1dba45);}}}};EmailChannel[_0xfe4c('0x25')][_0xfe4c('0x26')]=function(_0x31b4ab,_0x13803f){if(this[_0xfe4c('0xe')][_0x31b4ab]){this[_0xfe4c('0xe')][_0x31b4ab][_0xfe4c('0x15')][_0xfe4c('0x27')]='connected';this[_0xfe4c('0xe')][_0x31b4ab][_0xfe4c('0x15')]['messageStatus']=_0x13803f[_0xfe4c('0x12')];if(_0x13803f[_0xfe4c('0x28')]){this[_0xfe4c('0xe')][_0x31b4ab][_0xfe4c('0x15')][_0xfe4c('0x17')]=_0x13803f[_0xfe4c('0x28')][_0xfe4c('0x17')];}return this['emit'](_0x31b4ab);}};EmailChannel[_0xfe4c('0x25')][_0xfe4c('0x29')]=function(_0x2d2cfd,_0xb12b76){logger['info']('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0xb12b76[_0xfe4c('0x2a')],_0xb12b76[_0xfe4c('0x2b')],_0xb12b76[_0xfe4c('0x2c')],_0x2d2cfd);if(this['mailAccounts'][_0x2d2cfd]){return mailAccount[_0xfe4c('0x2d')](_0x2d2cfd,_0xb12b76)['then'](function(_0x3cf339){if(_0x3cf339){logger[_0xfe4c('0xc')]('Mail\x20accepted\x20from\x20routing');}})[_0xfe4c('0x2e')](function(_0x3b3e5d){logger[_0xfe4c('0x22')](_0xfe4c('0x2f'),JSON[_0xfe4c('0x19')](_0x3b3e5d));});}};EmailChannel[_0xfe4c('0x25')][_0xfe4c('0x21')]=function(_0x4fb2cb){if(this[_0xfe4c('0xe')][_0x4fb2cb]&&this[_0xfe4c('0xe')][_0x4fb2cb][_0xfe4c('0x15')]){if(this[_0xfe4c('0xf')][this[_0xfe4c('0xe')][_0x4fb2cb][_0xfe4c('0x15')]['id']]){delete this[_0xfe4c('0xf')][this[_0xfe4c('0xe')][_0x4fb2cb][_0xfe4c('0x15')]['id']];}this[_0xfe4c('0xe')][_0x4fb2cb][_0xfe4c('0x15')]['lastSync']=moment();this[_0xfe4c('0x11')](_0x4fb2cb);}};EmailChannel[_0xfe4c('0x25')][_0xfe4c('0x23')]=function(_0xc536c8,_0x2203de){if(this[_0xfe4c('0xe')][_0xc536c8]){this['mailAccounts'][_0xc536c8][_0xfe4c('0x15')]['status']=_0xfe4c('0x22');this[_0xfe4c('0xe')][_0xc536c8][_0xfe4c('0x15')]['messageStatus']=_0x2203de;return this[_0xfe4c('0x11')](_0xc536c8);}};EmailChannel[_0xfe4c('0x25')]['sendMail']=function(_0x4c2dfd,_0x3b30b7){return this[_0xfe4c('0x10')][_0xfe4c('0x30')](_0x4c2dfd,_0x3b30b7);};EmailChannel[_0xfe4c('0x25')][_0xfe4c('0x31')]=function(_0x4b9a2f){var _0x315de6=this;if(this[_0xfe4c('0xe')][_0x4b9a2f['id']]){if(_[_0xfe4c('0x18')](this[_0xfe4c('0xe')][_0x4b9a2f['id']][_0xfe4c('0x32')])){this['mailAccounts'][_0x4b9a2f['id']][_0xfe4c('0x32')]={};}this[_0xfe4c('0xe')][_0x4b9a2f['id']][_0xfe4c('0x32')][_0xfe4c('0x33')]=moment();return new BPromise(function(_0x12aa1a,_0x2459c9){return _0x315de6[_0xfe4c('0x10')]['verify'](_0x4b9a2f)['then'](function(_0x88f91f){_0x315de6['mailAccounts'][_0x4b9a2f['id']]['Smtp']['status']=_0xfe4c('0x34');_0x315de6['mailAccounts'][_0x4b9a2f['id']][_0xfe4c('0x32')][_0xfe4c('0x16')]='';_0x315de6[_0xfe4c('0x11')](_0x4b9a2f['id']);_0x12aa1a(_0x88f91f);})['catch'](function(_0x225171){_0x315de6[_0xfe4c('0xe')][_0x4b9a2f['id']][_0xfe4c('0x32')][_0xfe4c('0x27')]='error';_0x315de6['mailAccounts'][_0x4b9a2f['id']][_0xfe4c('0x32')][_0xfe4c('0x16')]=_0x225171;_0x315de6[_0xfe4c('0x11')](_0x4b9a2f['id']);_0x2459c9(_0x225171);});});}return this[_0xfe4c('0x10')][_0xfe4c('0x35')](_0x4b9a2f);};module['exports']=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index dcce643..17adb12 100644 --- a/server/services/email/lib/imap.js +++ b/server/services/email/lib/imap.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5d25=['authentication','host','port','tls','autotls','handleReady','openBox','handleOpenBox','handleError','readUnseen','end','search','UNSEEN','handleReadUnseen','fetch','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','handleCloseBox','handleMessageEnd','handleMessageBody','handleSimpleParser','handleMessageAttributes','parser','emit','stringify','textCode','hasOwnProperty','exports','lodash','util','imap','simpleParser','iconv','Iconv','EventEmitter','../../../config/logger','email','mailbox','account','getAccount','once','ready','handleEnd','bind','error','connect','prototype','authTimeout','service','user','xoauth2','generateXOAuth2Token','data5','password'];(function(_0x3dfd03,_0x4f887b){var _0x262bd1=function(_0x37aed6){while(--_0x37aed6){_0x3dfd03['push'](_0x3dfd03['shift']());}};_0x262bd1(++_0x4f887b);}(_0x5d25,0x8e));var _0x55d2=function(_0x2c95aa,_0x403df0){_0x2c95aa=_0x2c95aa-0x0;var _0x5db2d5=_0x5d25[_0x2c95aa];return _0x5db2d5;};'use strict';var _=require(_0x55d2('0x0'));var util=require(_0x55d2('0x1'));var Imap=require(_0x55d2('0x2'));var simpleParser=require('mailparser')[_0x55d2('0x3')];var Iconv=require(_0x55d2('0x4'))[_0x55d2('0x5')];var EventEmitter=require('events')[_0x55d2('0x6')];var utils=require('./utils');var logger=require(_0x55d2('0x7'))(_0x55d2('0x8'));function EmailImap(_0x15543c,_0x53bbf2){this[_0x55d2('0x9')]=_0x15543c[_0x55d2('0x9')];this[_0x55d2('0xa')]=this[_0x55d2('0xb')](_0x15543c,_0x53bbf2);this['imap']=new Imap(this[_0x55d2('0xa')]);this[_0x55d2('0x2')][_0x55d2('0xc')](_0x55d2('0xd'),this['handleReady']['bind'](this));this[_0x55d2('0x2')]['once']('end',this[_0x55d2('0xe')][_0x55d2('0xf')](this));this[_0x55d2('0x2')]['on'](_0x55d2('0x10'),this['handleError'][_0x55d2('0xf')](this));this[_0x55d2('0x2')][_0x55d2('0x11')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0x55d2('0x12')][_0x55d2('0xb')]=function(_0x4edb88,_0x168b21){var _0x35de20={'connTimeout':_0x4edb88['connTimeout']?_0x4edb88['connTimeout']*0x3e8:0x2710,'authTimeout':_0x4edb88[_0x55d2('0x13')]?_0x4edb88[_0x55d2('0x13')]*0x3e8:0x1388};if(_0x4edb88[_0x55d2('0x14')]){_0x35de20[_0x55d2('0x15')]=_0x4edb88[_0x55d2('0x15')];if(_0x4edb88['modernAuthentication']){_0x35de20[_0x55d2('0x16')]=utils[_0x55d2('0x17')](_0x4edb88['CloudProvider'][_0x55d2('0x18')],_0x4edb88[_0x55d2('0x15')]);}else{_0x35de20['password']=_0x4edb88[_0x55d2('0x19')];}}else{if(_0x4edb88[_0x55d2('0x1a')]){_0x35de20[_0x55d2('0x15')]=_0x4edb88[_0x55d2('0x15')];_0x35de20['password']=_0x4edb88[_0x55d2('0x19')];}}_0x35de20[_0x55d2('0x8')]=_0x168b21||_0x4edb88[_0x55d2('0x15')]||'anonymous@xcally.com';_0x35de20[_0x55d2('0x1b')]=_0x4edb88['host'];_0x35de20[_0x55d2('0x1c')]=_0x4edb88[_0x55d2('0x1c')]||0x3e1;if(_0x4edb88['tls']){_0x35de20[_0x55d2('0x1d')]=!![];}else{_0x35de20[_0x55d2('0x1d')]=![];_0x35de20[_0x55d2('0x1e')]='required';}return _0x35de20;};EmailImap[_0x55d2('0x12')][_0x55d2('0x1f')]=function(){this[_0x55d2('0x2')][_0x55d2('0x20')](this[_0x55d2('0x9')],![],this['handleOpenBox'][_0x55d2('0xf')](this));};EmailImap[_0x55d2('0x12')][_0x55d2('0x21')]=function(_0x589db2,_0x3c35bc){if(_0x589db2){this[_0x55d2('0x22')](_0x589db2,!![]);}else{this['emit']('box',_0x3c35bc);this[_0x55d2('0x23')]();}};EmailImap[_0x55d2('0x12')]['handleCloseBox']=function(_0x4e29db){if(_0x4e29db){this['handleError'](_0x4e29db,!![]);}else{this[_0x55d2('0x2')][_0x55d2('0x24')]();}};EmailImap[_0x55d2('0x12')]['readUnseen']=function(){this['imap'][_0x55d2('0x25')]([_0x55d2('0x26')],this[_0x55d2('0x27')][_0x55d2('0xf')](this));};EmailImap[_0x55d2('0x12')][_0x55d2('0x27')]=function(_0x479b32,_0x1fe876){if(_0x479b32){this[_0x55d2('0x22')](_0x479b32,!![]);}else{if(_0x1fe876['length']){try{var _0xc71e5d=this['imap'][_0x55d2('0x28')](_0x1fe876,{'bodies':'','markSeen':!![]});_0xc71e5d['on']('message',this[_0x55d2('0x29')][_0x55d2('0xf')](this));_0xc71e5d[_0x55d2('0xc')](_0x55d2('0x10'),this[_0x55d2('0x2a')][_0x55d2('0xf')](this));_0xc71e5d[_0x55d2('0xc')](_0x55d2('0x24'),this[_0x55d2('0x2b')][_0x55d2('0xf')](this));}catch(_0x476dae){logger[_0x55d2('0x10')](_0x476dae);}}else{this['imap'][_0x55d2('0x2c')](!![],this[_0x55d2('0x2d')][_0x55d2('0xf')](this));}}};EmailImap['prototype'][_0x55d2('0x29')]=function(_0x147fbc){_0x147fbc['on']('body',this['handleMessageBody'][_0x55d2('0xf')](this));_0x147fbc[_0x55d2('0xc')]('attributes',this['handleMessageAttributes'][_0x55d2('0xf')](this));_0x147fbc['once'](_0x55d2('0x24'),this[_0x55d2('0x2e')][_0x55d2('0xf')](this));};EmailImap['prototype'][_0x55d2('0x2f')]=function(_0x4c585a){simpleParser(_0x4c585a,{'Iconv':Iconv},this[_0x55d2('0x30')][_0x55d2('0xf')](this));};EmailImap['prototype'][_0x55d2('0x31')]=function(){};EmailImap[_0x55d2('0x12')][_0x55d2('0x2e')]=function(){};EmailImap[_0x55d2('0x12')][_0x55d2('0x30')]=function(_0x5b5d02,_0x9d12d){if(_0x5b5d02){logger[_0x55d2('0x10')](_0x5b5d02);}else{var _0x317052=this;utils[_0x55d2('0x32')](this[_0x55d2('0xa')],_0x9d12d,function(_0x35752c){_0x317052[_0x55d2('0x33')](_0x55d2('0x8'),_0x35752c);});}};EmailImap[_0x55d2('0x12')][_0x55d2('0x2b')]=function(){this[_0x55d2('0x2')][_0x55d2('0x2c')](!![],this[_0x55d2('0x2d')]['bind'](this));};EmailImap['prototype'][_0x55d2('0x2a')]=function(_0x549459){this[_0x55d2('0x22')](_0x549459);this[_0x55d2('0x2')][_0x55d2('0x2c')](!![],this[_0x55d2('0x2d')][_0x55d2('0xf')](this));};EmailImap['prototype']['handleEnd']=function(){this['emit'](_0x55d2('0x24'));};EmailImap[_0x55d2('0x12')][_0x55d2('0x22')]=function(_0x5776bc,_0x197014){logger[_0x55d2('0x10')]('handleError',this['account'][_0x55d2('0x8')],JSON[_0x55d2('0x34')](_0x5776bc));var _0x8ed57b='';if(_0x5776bc){if(_0x5776bc[_0x55d2('0x35')]){_0x8ed57b=_0x5776bc['textCode'];}else{for(var _0x444677 in _0x5776bc){if(_0x5776bc[_0x55d2('0x36')](_0x444677)){_0x8ed57b+=_['upperFirst'](_0x444677)+':\x20'+_0x5776bc[_0x444677]+'\x0a';}}}}if(_0x197014){this['imap']['end']();}else{this[_0x55d2('0x33')](_0x55d2('0x10'),_0x8ed57b);this[_0x55d2('0x33')](_0x55d2('0x24'));}};module[_0x55d2('0x37')]=EmailImap; \ No newline at end of file +var _0xf893=['handleReadUnseen','length','fetch','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','handleMessageBody','attributes','handleMessageEnd','handleSimpleParser','handleMessageAttributes','parser','handleCloseBox','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','util','imap','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','mailbox','account','once','ready','handleReady','bind','end','handleEnd','error','handleError','inherits','prototype','getAccount','connTimeout','authTimeout','user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','password','email','anonymous@xcally.com','host','port','tls','autotls','required','openBox','handleOpenBox','emit','box','readUnseen','UNSEEN'];(function(_0x30e579,_0x19cbd7){var _0x2b75fd=function(_0x251fb1){while(--_0x251fb1){_0x30e579['push'](_0x30e579['shift']());}};_0x2b75fd(++_0x19cbd7);}(_0xf893,0xd3));var _0x3f89=function(_0x2d3495,_0x30ca21){_0x2d3495=_0x2d3495-0x0;var _0x1e4fbb=_0xf893[_0x2d3495];return _0x1e4fbb;};'use strict';var _=require(_0x3f89('0x0'));var util=require(_0x3f89('0x1'));var Imap=require(_0x3f89('0x2'));var simpleParser=require(_0x3f89('0x3'))[_0x3f89('0x4')];var Iconv=require(_0x3f89('0x5'))[_0x3f89('0x6')];var EventEmitter=require(_0x3f89('0x7'))[_0x3f89('0x8')];var utils=require(_0x3f89('0x9'));var logger=require(_0x3f89('0xa'))('email');function EmailImap(_0x2cc071,_0x42dd32){this[_0x3f89('0xb')]=_0x2cc071[_0x3f89('0xb')];this['account']=this['getAccount'](_0x2cc071,_0x42dd32);this['imap']=new Imap(this[_0x3f89('0xc')]);this[_0x3f89('0x2')][_0x3f89('0xd')](_0x3f89('0xe'),this[_0x3f89('0xf')][_0x3f89('0x10')](this));this[_0x3f89('0x2')]['once'](_0x3f89('0x11'),this[_0x3f89('0x12')]['bind'](this));this[_0x3f89('0x2')]['on'](_0x3f89('0x13'),this[_0x3f89('0x14')]['bind'](this));this[_0x3f89('0x2')]['connect']();}util[_0x3f89('0x15')](EmailImap,EventEmitter);EmailImap[_0x3f89('0x16')][_0x3f89('0x17')]=function(_0xe878d3,_0x20a6f3){var _0x1e7152={'connTimeout':_0xe878d3[_0x3f89('0x18')]?_0xe878d3['connTimeout']*0x3e8:0x2710,'authTimeout':_0xe878d3[_0x3f89('0x19')]?_0xe878d3[_0x3f89('0x19')]*0x3e8:0x1388};if(_0xe878d3['service']){_0x1e7152[_0x3f89('0x1a')]=_0xe878d3[_0x3f89('0x1a')];if(_0xe878d3[_0x3f89('0x1b')]){_0x1e7152[_0x3f89('0x1c')]=utils[_0x3f89('0x1d')](_0xe878d3[_0x3f89('0x1e')]['data5'],_0xe878d3[_0x3f89('0x1a')]);}else{_0x1e7152['password']=_0xe878d3[_0x3f89('0x1f')];}}else{if(_0xe878d3['authentication']){_0x1e7152[_0x3f89('0x1a')]=_0xe878d3[_0x3f89('0x1a')];_0x1e7152['password']=_0xe878d3[_0x3f89('0x1f')];}}_0x1e7152[_0x3f89('0x20')]=_0x20a6f3||_0xe878d3[_0x3f89('0x1a')]||_0x3f89('0x21');_0x1e7152['host']=_0xe878d3[_0x3f89('0x22')];_0x1e7152['port']=_0xe878d3[_0x3f89('0x23')]||0x3e1;if(_0xe878d3['tls']){_0x1e7152['tls']=!![];}else{_0x1e7152[_0x3f89('0x24')]=![];_0x1e7152[_0x3f89('0x25')]=_0x3f89('0x26');}return _0x1e7152;};EmailImap[_0x3f89('0x16')][_0x3f89('0xf')]=function(){this[_0x3f89('0x2')][_0x3f89('0x27')](this[_0x3f89('0xb')],![],this['handleOpenBox'][_0x3f89('0x10')](this));};EmailImap[_0x3f89('0x16')][_0x3f89('0x28')]=function(_0xf3e41d,_0xd53213){if(_0xf3e41d){this[_0x3f89('0x14')](_0xf3e41d,!![]);}else{this[_0x3f89('0x29')](_0x3f89('0x2a'),_0xd53213);this[_0x3f89('0x2b')]();}};EmailImap[_0x3f89('0x16')]['handleCloseBox']=function(_0x454ab5){if(_0x454ab5){this['handleError'](_0x454ab5,!![]);}else{this[_0x3f89('0x2')]['end']();}};EmailImap[_0x3f89('0x16')]['readUnseen']=function(){this[_0x3f89('0x2')]['search']([_0x3f89('0x2c')],this[_0x3f89('0x2d')]['bind'](this));};EmailImap[_0x3f89('0x16')]['handleReadUnseen']=function(_0x521d7c,_0x432253){if(_0x521d7c){this[_0x3f89('0x14')](_0x521d7c,!![]);}else{if(_0x432253[_0x3f89('0x2e')]){try{var _0x5e48bc=this[_0x3f89('0x2')][_0x3f89('0x2f')](_0x432253,{'bodies':'','markSeen':!![]});_0x5e48bc['on']('message',this[_0x3f89('0x30')][_0x3f89('0x10')](this));_0x5e48bc[_0x3f89('0xd')](_0x3f89('0x13'),this[_0x3f89('0x31')]['bind'](this));_0x5e48bc[_0x3f89('0xd')](_0x3f89('0x11'),this[_0x3f89('0x32')][_0x3f89('0x10')](this));}catch(_0x49da45){logger[_0x3f89('0x13')](_0x49da45);}}else{this['imap'][_0x3f89('0x33')](!![],this['handleCloseBox'][_0x3f89('0x10')](this));}}};EmailImap['prototype']['handleFetchMessage']=function(_0x1649d5){_0x1649d5['on']('body',this[_0x3f89('0x34')][_0x3f89('0x10')](this));_0x1649d5[_0x3f89('0xd')](_0x3f89('0x35'),this['handleMessageAttributes']['bind'](this));_0x1649d5[_0x3f89('0xd')](_0x3f89('0x11'),this[_0x3f89('0x36')][_0x3f89('0x10')](this));};EmailImap[_0x3f89('0x16')][_0x3f89('0x34')]=function(_0x293c3d){simpleParser(_0x293c3d,{'Iconv':Iconv},this[_0x3f89('0x37')]['bind'](this));};EmailImap[_0x3f89('0x16')][_0x3f89('0x38')]=function(){};EmailImap[_0x3f89('0x16')][_0x3f89('0x36')]=function(){};EmailImap[_0x3f89('0x16')][_0x3f89('0x37')]=function(_0x30a326,_0x2f7194){if(_0x30a326){logger[_0x3f89('0x13')](_0x30a326);}else{var _0x1a6e0d=this;utils[_0x3f89('0x39')](this[_0x3f89('0xc')],_0x2f7194,function(_0x3e75e7){_0x1a6e0d['emit']('email',_0x3e75e7);});}};EmailImap['prototype'][_0x3f89('0x32')]=function(){this[_0x3f89('0x2')]['closeBox'](!![],this[_0x3f89('0x3a')]['bind'](this));};EmailImap[_0x3f89('0x16')][_0x3f89('0x31')]=function(_0x187993){this['handleError'](_0x187993);this[_0x3f89('0x2')][_0x3f89('0x33')](!![],this['handleCloseBox'][_0x3f89('0x10')](this));};EmailImap[_0x3f89('0x16')][_0x3f89('0x12')]=function(){this[_0x3f89('0x29')](_0x3f89('0x11'));};EmailImap[_0x3f89('0x16')][_0x3f89('0x14')]=function(_0x47c4e8,_0x2dfca0){logger[_0x3f89('0x13')](_0x3f89('0x14'),this[_0x3f89('0xc')][_0x3f89('0x20')],JSON[_0x3f89('0x3b')](_0x47c4e8));var _0x302932='';if(_0x47c4e8){if(_0x47c4e8[_0x3f89('0x3c')]){_0x302932=_0x47c4e8['textCode'];}else{for(var _0x2bbe4f in _0x47c4e8){if(_0x47c4e8[_0x3f89('0x3d')](_0x2bbe4f)){_0x302932+=_[_0x3f89('0x3e')](_0x2bbe4f)+':\x20'+_0x47c4e8[_0x2bbe4f]+'\x0a';}}}}if(_0x2dfca0){this[_0x3f89('0x2')][_0x3f89('0x11')]();}else{this[_0x3f89('0x29')](_0x3f89('0x13'),_0x302932);this[_0x3f89('0x29')](_0x3f89('0x11'));}};module[_0x3f89('0x3f')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index c942011..d00ece6 100644 --- a/server/services/email/lib/smtp.js +++ b/server/services/email/lib/smtp.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe454=['toString','verify','exports','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','sendMail'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0xe454,0x1b3));var _0x4e45=function(_0x1e3993,_0x5358b8){_0x1e3993=_0x1e3993-0x0;var _0x25b3c1=_0xe454[_0x1e3993];return _0x25b3c1;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0x4e45('0x0'));function EmailSmtp(){}EmailSmtp[_0x4e45('0x1')][_0x4e45('0x2')]=function(_0x2703ff,_0x5764db){return new Promise(function(_0x2bda07,_0x1af203){var _0x4edbad=nodemailer[_0x4e45('0x3')](_0x2703ff);_0x4edbad[_0x4e45('0x4')]('compile',inlineBase64());_0x4edbad[_0x4e45('0x5')](_0x5764db,function(_0x3096fd,_0x2676d1){if(_0x3096fd){_0x1af203(_0x3096fd[_0x4e45('0x6')]());}else{_0x2bda07(_0x2676d1);}});});};EmailSmtp[_0x4e45('0x1')][_0x4e45('0x7')]=function(_0x8a4a89){return new Promise(function(_0x4d6667,_0x7d165d){var _0x99f2db=nodemailer['createTransport'](_0x8a4a89);_0x99f2db['verify'](function(_0x12629a,_0x4667dd){if(_0x12629a){_0x7d165d(_0x12629a[_0x4e45('0x6')]());}else{if(_0x4667dd){_0x4d6667(_0x4667dd);}else{_0x7d165d('Not\x20verifired');}}});});};module[_0x4e45('0x8')]=EmailSmtp; \ No newline at end of file +var _0x3fc3=['sendMail','toString','verify','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','prototype','send','createTransport','compile'];(function(_0x3f7371,_0x47621f){var _0x345fe0=function(_0x17bc3a){while(--_0x17bc3a){_0x3f7371['push'](_0x3f7371['shift']());}};_0x345fe0(++_0x47621f);}(_0x3fc3,0x19c));var _0x33fc=function(_0x1d0dd8,_0x2111de){_0x1d0dd8=_0x1d0dd8-0x0;var _0x1f5e6f=_0x3fc3[_0x1d0dd8];return _0x1f5e6f;};'use strict';var nodemailer=require(_0x33fc('0x0'));var inlineBase64=require(_0x33fc('0x1'));function EmailSmtp(){}EmailSmtp[_0x33fc('0x2')][_0x33fc('0x3')]=function(_0x559d3c,_0x5a2507){return new Promise(function(_0x229e23,_0x94b068){var _0x19b9ea=nodemailer[_0x33fc('0x4')](_0x559d3c);_0x19b9ea['use'](_0x33fc('0x5'),inlineBase64());_0x19b9ea[_0x33fc('0x6')](_0x5a2507,function(_0x41f749,_0x4f1d1c){if(_0x41f749){_0x94b068(_0x41f749[_0x33fc('0x7')]());}else{_0x229e23(_0x4f1d1c);}});});};EmailSmtp['prototype'][_0x33fc('0x8')]=function(_0x584fdd){return new Promise(function(_0x12e828,_0x3d0f36){var _0x1ade8b=nodemailer[_0x33fc('0x4')](_0x584fdd);_0x1ade8b[_0x33fc('0x8')](function(_0x1bb704,_0x321a4d){if(_0x1bb704){_0x3d0f36(_0x1bb704[_0x33fc('0x7')]());}else{if(_0x321a4d){_0x12e828(_0x321a4d);}else{_0x3d0f36(_0x33fc('0x9'));}}});});};module[_0x33fc('0xa')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index ec0ccab..ccc55bd 100644 --- a/server/services/email/lib/utils.js +++ b/server/services/email/lib/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf437=['filename','_SRC','_IMG','\x20[Attachment:\x20','\x20]','body','textAsHtml','Empty\x20message

','Attachments','generateXOAuth2Token','user=','utf-8','toString','base64','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','split','length','slice','Anonymous','isEmpty','html','replace','0x1?_0x57449f[_0x7f43('0x12')](0x0,-0x1)['join']('\x20'):_0x5d1d24[_0x7f43('0xf')];}return _0x7f43('0x13');}function getLastName(_0x202c5f){var _0x55f6af=_['head'](_0x202c5f[_0x7f43('0xa')]);if(_0x55f6af&&_0x55f6af[_0x7f43('0xf')]){var _0x588ec3=_0x55f6af[_0x7f43('0xf')][_0x7f43('0x10')](/\s+/);return _0x588ec3[_0x7f43('0x11')]>0x1?_0x588ec3['pop']():'';}return'';}function getMails(_0x3a3509,_0x4860ea){var _0x46dbb8='';for(var _0x5dd9d2=0x0;_0x5dd9d2<_0x4860ea[_0x7f43('0xa')]['length'];_0x5dd9d2+=0x1){if(_0x4860ea[_0x7f43('0xa')][_0x5dd9d2][_0x7f43('0xb')]!==_0x3a3509){if(!_[_0x7f43('0x14')](_0x46dbb8)){_0x46dbb8+=',';}_0x46dbb8+=_0x4860ea[_0x7f43('0xa')][_0x5dd9d2][_0x7f43('0xf')]||_0x4860ea[_0x7f43('0xa')][_0x5dd9d2]['address']||'';_0x46dbb8+='\x20<';_0x46dbb8+=_0x4860ea['value'][_0x5dd9d2][_0x7f43('0xb')]?_0x4860ea['value'][_0x5dd9d2]['address']:'anonymous'+random[_0x7f43('0xd')](0x6)+_0x7f43('0xe');_0x46dbb8+='>';}}return _0x46dbb8;}function parseEmail(_0x406ebd,_0x5abfb8,_0x46d88a){if(_0x5abfb8[_0x7f43('0x15')]){var _0x40368a=/)<[^<]*)*<\/script>/gi;while(_0x40368a['test'](_0x5abfb8[_0x7f43('0x15')])){_0x5abfb8['html']=_0x5abfb8[_0x7f43('0x15')][_0x7f43('0x16')](_0x40368a,'');}if(_0x5abfb8[_0x7f43('0x15')]['includes'](_0x7f43('0x17'))){var _0x2ac901=[];_0x5abfb8[_0x7f43('0x18')][_0x7f43('0x19')](_0x51d045=>{_0x2ac901[_0x7f43('0x1a')](_0x51d045[_0x7f43('0x1b')]);});var _0x1b25b0=/]+>/g;var _0x44da0f=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x10a480=_0x5abfb8[_0x7f43('0x15')]['replace'](_0x44da0f,_0x7f43('0x1c'));var _0x235bc5=_0x10a480[_0x7f43('0x16')](_0x1b25b0,_0x7f43('0x1d'));for(let _0x1b5c41=0x0;_0x1b5c41<_0x2ac901[_0x7f43('0x11')];_0x1b5c41++){var _0x511edb=_0x235bc5['replace']('_IMG',_0x7f43('0x1e')+_0x2ac901[_0x1b5c41]+_0x7f43('0x1f'));_0x235bc5=_0x511edb;}_0x5abfb8['html']=_0x235bc5;}_0x46d88a[_0x7f43('0x20')]=_0x5abfb8[_0x7f43('0x15')];}else{_0x46d88a['body']=_0x5abfb8[_0x7f43('0x21')];}if(_0x46d88a[_0x7f43('0x20')]){_0x46d88a[_0x7f43('0x20')]=_0x46d88a[_0x7f43('0x20')]['replace'](/0x0){var _0x45bb6e=[_0x7f43('0x33'),_0x7f43('0x34'),_0x7f43('0x35')];for(var _0x3594d6=0x0;_0x3594d6<_0x5abfb8[_0x7f43('0x32')][_0x7f43('0x11')];_0x3594d6++){var _0x7a1368=_['indexOf'](_0x45bb6e,_0x5abfb8[_0x7f43('0x32')][_0x3594d6][_0x7f43('0x36')]);if(_0x7a1368>=0x0){_0x46d88a['isAutoreply']=!![];}}}return _0x46d88a;}exports[_0x7f43('0x37')]=function(_0x4e2024,_0x4a93f4,_0x32e134){var _0x4c0e51={'from':getAddress(_0x4a93f4['from']),'firstName':getFirstName(_0x4a93f4[_0x7f43('0x38')]),'lastName':getLastName(_0x4a93f4['from']),'mapKey':_0x7f43('0x7'),'message':{'from':getMails(_0x4e2024[_0x7f43('0x7')],_0x4a93f4[_0x7f43('0x38')]),'to':_0x4e2024[_0x7f43('0x7')],'cc':'','subject':_0x4a93f4[_0x7f43('0x39')]||'','messageId':_0x4a93f4[_0x7f43('0x3a')],'inReplyTo':_0x4a93f4[_0x7f43('0x3b')],'sentAt':moment(_0x4a93f4[_0x7f43('0x3c')])[_0x7f43('0x2a')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x4a93f4[_0x7f43('0x15')]&&!_0x4a93f4[_0x7f43('0x21')]){var _0x28024c=_[_0x7f43('0x3d')](_0x4a93f4[_0x7f43('0x18')],{'contentType':_0x7f43('0x3e')});if(_0x28024c[_0x7f43('0x11')]){logger['info'](util[_0x7f43('0x2a')](_0x7f43('0x3f'),_0x4a93f4[_0x7f43('0x3a')]));tnef['parseBuffer'](_[_0x7f43('0x40')](_0x28024c)[_0x7f43('0x31')],function(_0x2bd404,_0x1386a5){if(_0x1386a5){_0x4a93f4[_0x7f43('0x15')]=_0x1386a5[_0x7f43('0x41')]||_0x7f43('0x42');if(_0x1386a5['Attachments']){for(var _0x29e275=0x0;_0x29e275<_0x1386a5[_0x7f43('0x43')][_0x7f43('0x11')];_0x29e275++){var _0x2c2149=_0x1386a5[_0x7f43('0x43')][_0x29e275];_0x4c0e51[_0x7f43('0x23')][_0x7f43('0x18')]['push']({'filename':_0x2c2149['Title'],'content':Buffer[_0x7f43('0x38')](_0x2c2149['Data'])});}}}_0x32e134(parseEmail(_0x4e2024,_0x4a93f4,_0x4c0e51));});}else{_0x4a93f4[_0x7f43('0x15')]=_0x7f43('0x42');_0x32e134(parseEmail(_0x4e2024,_0x4a93f4,_0x4c0e51));}}else{_0x32e134(parseEmail(_0x4e2024,_0x4a93f4,_0x4c0e51));}};exports[_0x7f43('0x44')]=function(_0x4f3e7f,_0x573281){var _0x37f4b6=[_0x7f43('0x45')+(_0x573281||''),'auth=Bearer\x20'+_0x4f3e7f,'',''];return Buffer[_0x7f43('0x38')](_0x37f4b6[_0x7f43('0x2d')](''),_0x7f43('0x46'))[_0x7f43('0x47')](_0x7f43('0x48'));}; \ No newline at end of file +var _0x62b3=['pop','isEmpty','html','test','replace','includes','attachments','forEach','push','filename','_SRC','_IMG','\x20[Attachment:\x20','\x20]','body','textAsHtml','message','originCc','originTo','bcc','attachment-','format','%s-%s','join','root','server/files/attachments/','content','contentType','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','headerLines','isAutoreply','parser','from','messageId','inReplyTo','date','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','first','BodyHTML','Attachments','Data','

Empty\x20message

','utf-8','lodash','moment','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','substring','indexOf','split','length','slice','Anonymous'];(function(_0x459776,_0x36de5a){var _0x3c3188=function(_0x170146){while(--_0x170146){_0x459776['push'](_0x459776['shift']());}};_0x3c3188(++_0x36de5a);}(_0x62b3,0x1ce));var _0x362b=function(_0x8e09ef,_0x1dfa56){_0x8e09ef=_0x8e09ef-0x0;var _0x8a409=_0x62b3[_0x8e09ef];return _0x8a409;};'use strict';var _=require(_0x362b('0x0'));var moment=require(_0x362b('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0x362b('0x2'));var util=require(_0x362b('0x3'));var tnef=require(_0x362b('0x4'));var logger=require(_0x362b('0x5'))(_0x362b('0x6'));var config=require(_0x362b('0x7'));function getAddress(_0x39503a){var _0xbd86c9=_[_0x362b('0x8')](_0x39503a[_0x362b('0x9')]);return _0xbd86c9&&_0xbd86c9[_0x362b('0xa')]?_0xbd86c9[_0x362b('0xa')]:_0x362b('0xb')+random[_0x362b('0xc')](0x6)+_0x362b('0xd');}function getFirstName(_0x263599){var _0xc2b073=_[_0x362b('0x8')](_0x263599[_0x362b('0x9')]);if(_0xc2b073&&_0xc2b073[_0x362b('0xe')]){if(_0xc2b073[_0x362b('0xe')]==_0xc2b073[_0x362b('0xa')]){return _0xc2b073[_0x362b('0xe')][_0x362b('0xf')](0x0,_0xc2b073['name'][_0x362b('0x10')]('@'));}var _0x39c2ab=_0xc2b073['name'][_0x362b('0x11')](/\s+/);return _0x39c2ab[_0x362b('0x12')]>0x1?_0x39c2ab[_0x362b('0x13')](0x0,-0x1)['join']('\x20'):_0xc2b073[_0x362b('0xe')];}return _0x362b('0x14');}function getLastName(_0x3da4d3){var _0x110f87=_[_0x362b('0x8')](_0x3da4d3[_0x362b('0x9')]);if(_0x110f87&&_0x110f87[_0x362b('0xe')]){var _0x7d78ac=_0x110f87['name'][_0x362b('0x11')](/\s+/);return _0x7d78ac[_0x362b('0x12')]>0x1?_0x7d78ac[_0x362b('0x15')]():'';}return'';}function getMails(_0x5948a3,_0x10d30d){var _0x521e06='';for(var _0x586b05=0x0;_0x586b05<_0x10d30d['value'][_0x362b('0x12')];_0x586b05+=0x1){if(_0x10d30d[_0x362b('0x9')][_0x586b05][_0x362b('0xa')]!==_0x5948a3){if(!_[_0x362b('0x16')](_0x521e06)){_0x521e06+=',';}_0x521e06+=_0x10d30d[_0x362b('0x9')][_0x586b05]['name']||_0x10d30d[_0x362b('0x9')][_0x586b05][_0x362b('0xa')]||'';_0x521e06+='\x20<';_0x521e06+=_0x10d30d[_0x362b('0x9')][_0x586b05][_0x362b('0xa')]?_0x10d30d[_0x362b('0x9')][_0x586b05][_0x362b('0xa')]:'anonymous'+random[_0x362b('0xc')](0x6)+_0x362b('0xd');_0x521e06+='>';}}return _0x521e06;}function parseEmail(_0x502593,_0x490e5e,_0x51b4a5){if(_0x490e5e[_0x362b('0x17')]){var _0x16b0e6=/)<[^<]*)*<\/script>/gi;while(_0x16b0e6[_0x362b('0x18')](_0x490e5e['html'])){_0x490e5e[_0x362b('0x17')]=_0x490e5e[_0x362b('0x17')][_0x362b('0x19')](_0x16b0e6,'');}if(_0x490e5e['html'][_0x362b('0x1a')]('{_0x4538b2[_0x362b('0x1d')](_0x1d32f9[_0x362b('0x1e')]);});var _0x1957ab=/]+>/g;var _0x43afe0=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x2434dc=_0x490e5e[_0x362b('0x17')][_0x362b('0x19')](_0x43afe0,_0x362b('0x1f'));var _0x391654=_0x2434dc[_0x362b('0x19')](_0x1957ab,_0x362b('0x20'));for(let _0x4ec73a=0x0;_0x4ec73a<_0x4538b2[_0x362b('0x12')];_0x4ec73a++){var _0x1ce364=_0x391654[_0x362b('0x19')]('_IMG',_0x362b('0x21')+_0x4538b2[_0x4ec73a]+_0x362b('0x22'));_0x391654=_0x1ce364;}_0x490e5e[_0x362b('0x17')]=_0x391654;}_0x51b4a5[_0x362b('0x23')]=_0x490e5e[_0x362b('0x17')];}else{_0x51b4a5[_0x362b('0x23')]=_0x490e5e[_0x362b('0x24')];}if(_0x51b4a5[_0x362b('0x23')]){_0x51b4a5[_0x362b('0x23')]=_0x51b4a5[_0x362b('0x23')][_0x362b('0x19')](/0x0){var _0x41423a=[_0x362b('0x31'),_0x362b('0x32'),_0x362b('0x33')];for(var _0x2cb8ec=0x0;_0x2cb8ec<_0x490e5e[_0x362b('0x34')][_0x362b('0x12')];_0x2cb8ec++){var _0x17ba29=_[_0x362b('0x10')](_0x41423a,_0x490e5e[_0x362b('0x34')][_0x2cb8ec]['line']);if(_0x17ba29>=0x0){_0x51b4a5[_0x362b('0x35')]=!![];}}}return _0x51b4a5;}exports[_0x362b('0x36')]=function(_0x3ca445,_0x390f9e,_0xdf4cb7){var _0x2e23fb={'from':getAddress(_0x390f9e[_0x362b('0x37')]),'firstName':getFirstName(_0x390f9e[_0x362b('0x37')]),'lastName':getLastName(_0x390f9e[_0x362b('0x37')]),'mapKey':_0x362b('0x6'),'message':{'from':getMails(_0x3ca445[_0x362b('0x6')],_0x390f9e[_0x362b('0x37')]),'to':_0x3ca445[_0x362b('0x6')],'cc':'','subject':_0x390f9e['subject']||'','messageId':_0x390f9e[_0x362b('0x38')],'inReplyTo':_0x390f9e[_0x362b('0x39')],'sentAt':moment(_0x390f9e[_0x362b('0x3a')])['format']('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x390f9e[_0x362b('0x17')]&&!_0x390f9e['textAsHtml']){var _0x4e5df6=_[_0x362b('0x3b')](_0x390f9e[_0x362b('0x1b')],{'contentType':_0x362b('0x3c')});if(_0x4e5df6['length']){logger[_0x362b('0x3d')](util['format'](_0x362b('0x3e'),_0x390f9e[_0x362b('0x38')]));tnef['parseBuffer'](_[_0x362b('0x3f')](_0x4e5df6)['content'],function(_0x5ac69b,_0x286bbb){if(_0x286bbb){_0x390f9e[_0x362b('0x17')]=_0x286bbb[_0x362b('0x40')]||'

Empty\x20message

';if(_0x286bbb['Attachments']){for(var _0x268d2e=0x0;_0x268d2e<_0x286bbb[_0x362b('0x41')][_0x362b('0x12')];_0x268d2e++){var _0xdc86f9=_0x286bbb[_0x362b('0x41')][_0x268d2e];_0x2e23fb[_0x362b('0x25')]['attachments'][_0x362b('0x1d')]({'filename':_0xdc86f9['Title'],'content':Buffer[_0x362b('0x37')](_0xdc86f9[_0x362b('0x42')])});}}}_0xdf4cb7(parseEmail(_0x3ca445,_0x390f9e,_0x2e23fb));});}else{_0x390f9e[_0x362b('0x17')]=_0x362b('0x43');_0xdf4cb7(parseEmail(_0x3ca445,_0x390f9e,_0x2e23fb));}}else{_0xdf4cb7(parseEmail(_0x3ca445,_0x390f9e,_0x2e23fb));}};exports['generateXOAuth2Token']=function(_0x2d67c7,_0x592ac5){var _0x579cef=['user='+(_0x592ac5||''),'auth=Bearer\x20'+_0x2d67c7,'',''];return Buffer['from'](_0x579cef[_0x362b('0x2c')](''),_0x362b('0x44'))['toString']('base64');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index b28323a..ab34bcd 100644 --- a/server/services/email/model/mailAccount.js +++ b/server/services/email/model/mailAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8088=['lodash','name','Service','active','Imap','Smtp'];(function(_0x40f3a4,_0x42e6e8){var _0x440dcf=function(_0x5da3b1){while(--_0x5da3b1){_0x40f3a4['push'](_0x40f3a4['shift']());}};_0x440dcf(++_0x42e6e8);}(_0x8088,0x66));var _0x8808=function(_0x4d4498,_0x3b0d44){_0x4d4498=_0x4d4498-0x0;var _0x2cfc0f=_0x8088[_0x4d4498];return _0x2cfc0f;};'use strict';var _=require(_0x8808('0x0'));function MailAccount(_0x416823){this['id']=_0x416823['id']||0x0;this[_0x8808('0x1')]=_0x416823[_0x8808('0x1')]||_0x8808('0x2');this['key']=_0x416823['key']||'SERV';this[_0x8808('0x3')]=_0x416823[_0x8808('0x3')]||![];this['Imap']=_0x416823[_0x8808('0x4')]||[];this[_0x8808('0x5')]=_0x416823['Smtp']||[];}module['exports']=MailAccount; \ No newline at end of file +var _0x8e29=['Imap','Smtp','exports','lodash','name','Service','key','SERV','active'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8e29,0x147));var _0x98e2=function(_0x549b57,_0x225612){_0x549b57=_0x549b57-0x0;var _0xcaa2c8=_0x8e29[_0x549b57];return _0xcaa2c8;};'use strict';var _=require(_0x98e2('0x0'));function MailAccount(_0x558476){this['id']=_0x558476['id']||0x0;this['name']=_0x558476[_0x98e2('0x1')]||_0x98e2('0x2');this[_0x98e2('0x3')]=_0x558476[_0x98e2('0x3')]||_0x98e2('0x4');this[_0x98e2('0x5')]=_0x558476[_0x98e2('0x5')]||![];this[_0x98e2('0x6')]=_0x558476[_0x98e2('0x6')]||[];this[_0x98e2('0x7')]=_0x558476[_0x98e2('0x7')]||[];}module[_0x98e2('0x8')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 154bb72..2f2de98 100644 --- a/server/services/email/realtime/index.js +++ b/server/services/email/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x18bd=['exports','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','mergeFromDatabase','prototype','merge'];(function(_0x3dfe45,_0x15ae78){var _0x27fde2=function(_0x435120){while(--_0x435120){_0x3dfe45['push'](_0x3dfe45['shift']());}};_0x27fde2(++_0x15ae78);}(_0x18bd,0x139));var _0xd18b=function(_0x559f3c,_0x38a42a){_0x559f3c=_0x559f3c-0x0;var _0xa4a879=_0x18bd[_0x559f3c];return _0xa4a879;};'use strict';var _=require('lodash');var MailAccount=require(_0xd18b('0x0'));var Realtime=function(){this[_0xd18b('0x1')]={};};function freeIsNotKey(_0x4b3434,_0x5d51a0,_0x54b443){var _0x2311e9=_[_0xd18b('0x2')](_0x4b3434,function(_0x547c49,_0x486a71){return _0x547c49[_0x54b443];});for(var _0xafc5b3 in _0x5d51a0){if(_0x5d51a0[_0xd18b('0x3')](_0xafc5b3)){if(!_0x2311e9[_0xafc5b3]){delete _0x5d51a0[_0xafc5b3];}}}}Realtime['prototype'][_0xd18b('0x4')]=function(_0x13b02e,_0x2df281){for(var _0x425ce3 in _0x2df281){if(_0x13b02e[_0xd18b('0x3')](_0x425ce3)){_0x13b02e[_0x425ce3]=_0x2df281[_0x425ce3];}}};Realtime[_0xd18b('0x5')]['initMailAccounts']=function(){var _0x15158f=this;return function(_0x171efc){if(_0x171efc){freeIsNotKey(_0x171efc,_0x15158f[_0xd18b('0x1')],'id');for(var _0x5e5312=0x0,_0x19976d={},_0x5f3971={};_0x5e5312<_0x171efc['length'];_0x5e5312+=0x1){_0x19976d=_0x171efc[_0x5e5312];if(_['isUndefined'](_0x15158f[_0xd18b('0x1')][_0x19976d['id']])){_0x15158f[_0xd18b('0x1')][_0x19976d['id']]=new MailAccount(_0x19976d);}else{_[_0xd18b('0x6')](_0x15158f[_0xd18b('0x1')][_0x19976d['id']],_0x19976d);}}}return _0x15158f[_0xd18b('0x1')];};};module[_0xd18b('0x7')]=Realtime; \ No newline at end of file +var _0xab93=['initMailAccounts','mailAccounts','isUndefined','merge','exports','../model/mailAccount','mapKeys','hasOwnProperty','prototype','mergeFromDatabase'];(function(_0x61ed32,_0x5638de){var _0x44cacd=function(_0x28ea71){while(--_0x28ea71){_0x61ed32['push'](_0x61ed32['shift']());}};_0x44cacd(++_0x5638de);}(_0xab93,0xf5));var _0x3ab9=function(_0x1d0941,_0x24844c){_0x1d0941=_0x1d0941-0x0;var _0xfc8dfd=_0xab93[_0x1d0941];return _0xfc8dfd;};'use strict';var _=require('lodash');var MailAccount=require(_0x3ab9('0x0'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x5a8dc9,_0x1fe25b,_0x1c3a93){var _0x16a6b4=_[_0x3ab9('0x1')](_0x5a8dc9,function(_0x3723e9,_0x4d6f01){return _0x3723e9[_0x1c3a93];});for(var _0x4b1258 in _0x1fe25b){if(_0x1fe25b[_0x3ab9('0x2')](_0x4b1258)){if(!_0x16a6b4[_0x4b1258]){delete _0x1fe25b[_0x4b1258];}}}}Realtime[_0x3ab9('0x3')][_0x3ab9('0x4')]=function(_0x208243,_0xe39d){for(var _0x2e4164 in _0xe39d){if(_0x208243[_0x3ab9('0x2')](_0x2e4164)){_0x208243[_0x2e4164]=_0xe39d[_0x2e4164];}}};Realtime[_0x3ab9('0x3')][_0x3ab9('0x5')]=function(){var _0x32fb13=this;return function(_0x2d1c69){if(_0x2d1c69){freeIsNotKey(_0x2d1c69,_0x32fb13[_0x3ab9('0x6')],'id');for(var _0x4412fa=0x0,_0x34d0ba={},_0x109aae={};_0x4412fa<_0x2d1c69['length'];_0x4412fa+=0x1){_0x34d0ba=_0x2d1c69[_0x4412fa];if(_[_0x3ab9('0x7')](_0x32fb13[_0x3ab9('0x6')][_0x34d0ba['id']])){_0x32fb13[_0x3ab9('0x6')][_0x34d0ba['id']]=new MailAccount(_0x34d0ba);}else{_[_0x3ab9('0x8')](_0x32fb13[_0x3ab9('0x6')][_0x34d0ba['id']],_0x34d0ba);}}}return _0x32fb13[_0x3ab9('0x6')];};};module[_0x3ab9('0x9')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index cb9135e..ee99021 100644 --- a/server/services/email/rpc/mailAccount.js +++ b/server/services/email/rpc/mailAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1574=['Imap','CloudProvider','name','type','data5','Smtp','notify','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','provider','service','email','active','key','ListId','TemplateId','MailServerIn'];(function(_0x1fb25f,_0x5a62dc){var _0x1c5ad1=function(_0x575f94){while(--_0x575f94){_0x1fb25f['push'](_0x1fb25f['shift']());}};_0x1c5ad1(++_0x5a62dc);}(_0x1574,0x148));var _0x4157=function(_0x5dbde1,_0x3ae4fc){_0x5dbde1=_0x5dbde1-0x0;var _0x52b518=_0x1574[_0x5dbde1];return _0x52b518;};'use strict';var client=require(_0x4157('0x0'));exports[_0x4157('0x1')]=function(){return function(){return client[_0x4157('0x2')](_0x4157('0x3'),{'options':{'attributes':['id','name',_0x4157('0x4'),_0x4157('0x5'),_0x4157('0x6'),_0x4157('0x7'),_0x4157('0x8'),_0x4157('0x9'),_0x4157('0xa')],'raw':![],'include':[{'model':_0x4157('0xb'),'as':_0x4157('0xc'),'include':[{'model':_0x4157('0xd'),'attributes':['id',_0x4157('0xe'),_0x4157('0x5'),_0x4157('0xf'),_0x4157('0x10')],'as':_0x4157('0xd')}]},{'model':'MailServerOut','as':_0x4157('0x11'),'include':[{'model':'CloudProvider','attributes':['id','name','service',_0x4157('0xf'),_0x4157('0x10')],'as':_0x4157('0xd')}]}]},'log':'getMailAccount'});};};exports[_0x4157('0x12')]=function(_0x127130,_0x4316a6){return client[_0x4157('0x2')](_0x4157('0x13'),{'account':{'id':_0x127130},'body':_0x4316a6,'log':_0x4157('0x13')});}; \ No newline at end of file +var _0xcb22=['key','ListId','MailServerIn','Imap','CloudProvider','data5','Smtp','type','notify','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name','provider','service','email','active'];(function(_0x111614,_0x4a7ac4){var _0x2c958e=function(_0x227e95){while(--_0x227e95){_0x111614['push'](_0x111614['shift']());}};_0x2c958e(++_0x4a7ac4);}(_0xcb22,0xc8));var _0x2cb2=function(_0xac7c93,_0x436cd0){_0xac7c93=_0xac7c93-0x0;var _0x1e1b2c=_0xcb22[_0xac7c93];return _0x1e1b2c;};'use strict';var client=require(_0x2cb2('0x0'));exports[_0x2cb2('0x1')]=function(){return function(){return client[_0x2cb2('0x2')](_0x2cb2('0x3'),{'options':{'attributes':['id',_0x2cb2('0x4'),_0x2cb2('0x5'),_0x2cb2('0x6'),_0x2cb2('0x7'),_0x2cb2('0x8'),_0x2cb2('0x9'),_0x2cb2('0xa'),'TemplateId'],'raw':![],'include':[{'model':_0x2cb2('0xb'),'as':_0x2cb2('0xc'),'include':[{'model':_0x2cb2('0xd'),'attributes':['id',_0x2cb2('0x4'),_0x2cb2('0x6'),'type',_0x2cb2('0xe')],'as':_0x2cb2('0xd')}]},{'model':'MailServerOut','as':_0x2cb2('0xf'),'include':[{'model':_0x2cb2('0xd'),'attributes':['id',_0x2cb2('0x4'),_0x2cb2('0x6'),_0x2cb2('0x10'),_0x2cb2('0xe')],'as':'CloudProvider'}]}]},'log':'getMailAccount'});};};exports[_0x2cb2('0x11')]=function(_0x4f3750,_0x5429d7){return client['Request'](_0x2cb2('0x12'),{'account':{'id':_0x4f3750},'body':_0x5429d7,'log':'NotifyMailAccount'});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index e5e3d6e..0a25245 100644 --- a/server/services/email/rpc/setting.js +++ b/server/services/email/rpc/setting.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e0a=['loginMailFrequency','../client','getSettings','ShowSetting'];(function(_0x2ae2ad,_0xac5b0c){var _0x26dbd7=function(_0x5e685b){while(--_0x5e685b){_0x2ae2ad['push'](_0x2ae2ad['shift']());}};_0x26dbd7(++_0xac5b0c);}(_0x3e0a,0x10d));var _0xa3e0=function(_0x3238ea,_0x91809d){_0x3238ea=_0x3238ea-0x0;var _0x4aaac2=_0x3e0a[_0x3238ea];return _0x4aaac2;};'use strict';var client=require(_0xa3e0('0x0'));exports[_0xa3e0('0x1')]=function(){return client['Request'](_0xa3e0('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xa3e0('0x3')]},'log':'GetSettings'});}; \ No newline at end of file +var _0x668c=['loginMailFrequency','GetSettings','../client','Request','ShowSetting'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x668c,0xe3));var _0xc668=function(_0x261e29,_0x10fffd){_0x261e29=_0x261e29-0x0;var _0x25ef43=_0x668c[_0x261e29];return _0x25ef43;};'use strict';var client=require(_0xc668('0x0'));exports['getSettings']=function(){return client[_0xc668('0x1')](_0xc668('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xc668('0x3')]},'log':_0xc668('0x4')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index c8a91a7..990d74f 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file diff --git a/server/services/express/index.js b/server/services/express/index.js index f413564..37c1bed 100644 --- a/server/services/express/index.js +++ b/server/services/express/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34ef=['defaults','localhost','../../config/triggers','../../config/socketio','default','../../config/express','../../routes','listening','log','exports','lodash','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','websocket','polling','redis'];(function(_0x9d65f5,_0x3d7c56){var _0x107b0e=function(_0x2ae578){while(--_0x2ae578){_0x9d65f5['push'](_0x9d65f5['shift']());}};_0x107b0e(++_0x3d7c56);}(_0x34ef,0x1d8));var _0xf34e=function(_0xad1c22,_0x2b2ed4){_0xad1c22=_0xad1c22-0x0;var _0x33f8ee=_0x34ef[_0xad1c22];return _0x33f8ee;};'use strict';var _=require(_0xf34e('0x0'));var http=require('http');var express=require('express');var sticky=require('sticky-session');var Redis=require(_0xf34e('0x1'));var config=require(_0xf34e('0x2'));var app=express();var server=http[_0xf34e('0x3')](app);server[_0xf34e('0x4')]=0xdbba0;if(sticky[_0xf34e('0x5')](server,config[_0xf34e('0x6')])){var socketio=require(_0xf34e('0x7'))(server,{'transports':[_0xf34e('0x8'),_0xf34e('0x9')]});config[_0xf34e('0xa')]=_[_0xf34e('0xb')](config[_0xf34e('0xa')],{'host':_0xf34e('0xc'),'port':0x18eb});socketio['adapter'](require('socket.io-redis')({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0xf34e('0xa')])}));require(_0xf34e('0xd'))['default']();require(_0xf34e('0xe'))[_0xf34e('0xf')](socketio);require(_0xf34e('0x10'))['default'](app);require(_0xf34e('0x11'))[_0xf34e('0xf')](app);}else{server['once'](_0xf34e('0x12'),function(){console[_0xf34e('0x13')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config['port']);});}exports=module[_0xf34e('0x14')]=app; \ No newline at end of file +var _0x7d39=['polling','redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once','listening','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','websocket'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7d39,0x96));var _0x97d3=function(_0x1e7381,_0x447a95){_0x1e7381=_0x1e7381-0x0;var _0x380f92=_0x7d39[_0x1e7381];return _0x380f92;};'use strict';var _=require(_0x97d3('0x0'));var http=require(_0x97d3('0x1'));var express=require(_0x97d3('0x2'));var sticky=require(_0x97d3('0x3'));var Redis=require(_0x97d3('0x4'));var config=require(_0x97d3('0x5'));var app=express();var server=http[_0x97d3('0x6')](app);server[_0x97d3('0x7')]=0xdbba0;if(sticky[_0x97d3('0x8')](server,config[_0x97d3('0x9')])){var socketio=require(_0x97d3('0xa'))(server,{'transports':[_0x97d3('0xb'),_0x97d3('0xc')]});config[_0x97d3('0xd')]=_[_0x97d3('0xe')](config[_0x97d3('0xd')],{'host':_0x97d3('0xf'),'port':0x18eb});socketio[_0x97d3('0x10')](require(_0x97d3('0x11'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0x97d3('0xd')])}));require(_0x97d3('0x12'))[_0x97d3('0x13')]();require(_0x97d3('0x14'))[_0x97d3('0x13')](socketio);require(_0x97d3('0x15'))['default'](app);require(_0x97d3('0x16'))[_0x97d3('0x13')](app);}else{server[_0x97d3('0x17')](_0x97d3('0x18'),function(){console['log'](_0x97d3('0x19'),config[_0x97d3('0x9')]);});}exports=module[_0x97d3('0x1a')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 81df227..38d3b13 100644 --- a/server/services/routing/client.js +++ b/server/services/routing/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8cf3=['rpc','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','request','then','debug','error','message','result'];(function(_0x1ffb7e,_0x3846dd){var _0xc3f67c=function(_0xbeee80){while(--_0xbeee80){_0x1ffb7e['push'](_0x1ffb7e['shift']());}};_0xc3f67c(++_0x3846dd);}(_0x8cf3,0xf0));var _0x38cf=function(_0x2ff37b,_0x390997){_0x2ff37b=_0x2ff37b-0x0;var _0x2b7eae=_0x8cf3[_0x2ff37b];return _0x2b7eae;};'use strict';var jayson=require(_0x38cf('0x0'));var BPromise=require(_0x38cf('0x1'));var logger=require(_0x38cf('0x2'))(_0x38cf('0x3'));var client=jayson[_0x38cf('0x4')][_0x38cf('0x5')]({'port':0x2329});client['Request']=function(_0x226b23,_0xa96f16){return new BPromise(function(_0x12095b,_0x15a433){return client[_0x38cf('0x6')](_0x226b23,_0xa96f16)[_0x38cf('0x7')](function(_0x1ba6cd){logger[_0x38cf('0x8')]('rpc',_0x38cf('0x3'),_0x226b23,_0xa96f16,_0x1ba6cd);if(_0x1ba6cd[_0x38cf('0x9')]){logger['error']('rpc','routing',_0x226b23,_0x1ba6cd[_0x38cf('0x9')][_0x38cf('0xa')],_0xa96f16);return _0x15a433(_0x1ba6cd[_0x38cf('0x9')][_0x38cf('0xa')]);}else{return _0x12095b(_0x1ba6cd[_0x38cf('0xb')]);}})['catch'](function(_0x3422d1){logger['error'](_0x38cf('0xc'),_0x38cf('0x3'),_0x226b23,_0x3422d1,_0xa96f16);return _0x15a433(_0x3422d1);});});};module[_0x38cf('0xd')]=client; \ No newline at end of file +var _0x3df7=['catch','rpc','exports','bluebird','../../config/logger','routing','client','http','Request','debug','error','message','result'];(function(_0x2c0cd1,_0x17b069){var _0x1dbec5=function(_0x383416){while(--_0x383416){_0x2c0cd1['push'](_0x2c0cd1['shift']());}};_0x1dbec5(++_0x17b069);}(_0x3df7,0x78));var _0x73df=function(_0x2f396d,_0x1dd838){_0x2f396d=_0x2f396d-0x0;var _0x331f1b=_0x3df7[_0x2f396d];return _0x331f1b;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x73df('0x0'));var logger=require(_0x73df('0x1'))(_0x73df('0x2'));var client=jayson[_0x73df('0x3')][_0x73df('0x4')]({'port':0x2329});client[_0x73df('0x5')]=function(_0x2b009c,_0x40d6ef){return new BPromise(function(_0x145851,_0xa4fbe2){return client['request'](_0x2b009c,_0x40d6ef)['then'](function(_0x300f66){logger[_0x73df('0x6')]('rpc',_0x73df('0x2'),_0x2b009c,_0x40d6ef,_0x300f66);if(_0x300f66[_0x73df('0x7')]){logger[_0x73df('0x7')]('rpc',_0x73df('0x2'),_0x2b009c,_0x300f66['error'][_0x73df('0x8')],_0x40d6ef);return _0xa4fbe2(_0x300f66['error'][_0x73df('0x8')]);}else{return _0x145851(_0x300f66[_0x73df('0x9')]);}})[_0x73df('0xa')](function(_0x9b4fb6){logger[_0x73df('0x7')](_0x73df('0xb'),_0x73df('0x2'),_0x2b009c,_0x9b4fb6,_0x40d6ef);return _0xa4fbe2(_0x9b4fb6);});});};module[_0x73df('0xc')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 49e3059..108c2eb 100644 --- a/server/services/routing/index.js +++ b/server/services/routing/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe9c5=['resolve','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initFaxQueues','listen','catch','./server','./rpc/interval','./rpc/smsQueue','./rpc/mailQueue','./rpc/whatsappQueue'];(function(_0x2a573d,_0x284675){var _0x370c3f=function(_0x1ddb31){while(--_0x1ddb31){_0x2a573d['push'](_0x2a573d['shift']());}};_0x370c3f(++_0x284675);}(_0xe9c5,0x93));var _0x5e9c=function(_0x416e48,_0x5cd0c7){_0x416e48=_0x416e48-0x0;var _0x32cf9b=_0xe9c5[_0x416e48];return _0x32cf9b;};'use strict';var BPromise=require('bluebird');var server=require(_0x5e9c('0x0'));var Realtime=require('./realtime');var user=require('./rpc/user');var interval=require(_0x5e9c('0x1'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0x5e9c('0x2'));var mailQueue=require(_0x5e9c('0x3'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0x5e9c('0x4'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x5e9c('0x5')]()[_0x5e9c('0x6')](user['getAgents']())[_0x5e9c('0x6')](realtime[_0x5e9c('0x7')]())['then'](interval[_0x5e9c('0x8')]())[_0x5e9c('0x6')](realtime[_0x5e9c('0x9')]())['then'](openchannelQueue[_0x5e9c('0xa')]())[_0x5e9c('0x6')](realtime['initOpenchannelQueues']())[_0x5e9c('0x6')](chatQueue[_0x5e9c('0xb')]())[_0x5e9c('0x6')](realtime[_0x5e9c('0xc')]())[_0x5e9c('0x6')](smsQueue[_0x5e9c('0xd')]())[_0x5e9c('0x6')](realtime[_0x5e9c('0xe')]())[_0x5e9c('0x6')](mailQueue[_0x5e9c('0xf')]())[_0x5e9c('0x6')](realtime['initMailQueues']())[_0x5e9c('0x6')](faxQueue['getFaxQueues']())[_0x5e9c('0x6')](realtime[_0x5e9c('0x10')]())[_0x5e9c('0x6')](whatsappQueue['getWhatsappQueues']())[_0x5e9c('0x6')](realtime['initWhatsappQueues']())[_0x5e9c('0x6')](function(){return realtime;});}function main(){return server[_0x5e9c('0x11')](realtime)[_0x5e9c('0x6')](function(_0x4bbb5b){return initRealtime();})[_0x5e9c('0x6')](function(_0x5add0a){return setInterval(initRealtime,0x1388);})[_0x5e9c('0x12')](function(_0x470c79){console['log'](_0x470c79);});}main(); \ No newline at end of file +var _0x28e4=['resolve','then','getAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initMailQueues','getFaxQueues','initFaxQueues','initWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue'];(function(_0x33cb97,_0x2be8e8){var _0xe85595=function(_0x664fa2){while(--_0x664fa2){_0x33cb97['push'](_0x33cb97['shift']());}};_0xe85595(++_0x2be8e8);}(_0x28e4,0x1ba));var _0x428e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28e4[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x428e('0x0'));var server=require(_0x428e('0x1'));var Realtime=require(_0x428e('0x2'));var user=require(_0x428e('0x3'));var interval=require('./rpc/interval');var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0x428e('0x4'));var smsQueue=require(_0x428e('0x5'));var mailQueue=require(_0x428e('0x6'));var faxQueue=require(_0x428e('0x7'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0x428e('0x8')]()[_0x428e('0x9')](user[_0x428e('0xa')]())[_0x428e('0x9')](realtime['initAgents']())[_0x428e('0x9')](interval[_0x428e('0xb')]())['then'](realtime[_0x428e('0xc')]())[_0x428e('0x9')](openchannelQueue[_0x428e('0xd')]())[_0x428e('0x9')](realtime[_0x428e('0xe')]())[_0x428e('0x9')](chatQueue[_0x428e('0xf')]())[_0x428e('0x9')](realtime[_0x428e('0x10')]())[_0x428e('0x9')](smsQueue[_0x428e('0x11')]())['then'](realtime['initSmsQueues']())[_0x428e('0x9')](mailQueue['getMailQueues']())[_0x428e('0x9')](realtime[_0x428e('0x12')]())[_0x428e('0x9')](faxQueue[_0x428e('0x13')]())[_0x428e('0x9')](realtime[_0x428e('0x14')]())['then'](whatsappQueue['getWhatsappQueues']())[_0x428e('0x9')](realtime[_0x428e('0x15')]())[_0x428e('0x9')](function(){return realtime;});}function main(){return server[_0x428e('0x16')](realtime)[_0x428e('0x9')](function(_0x37af93){return initRealtime();})[_0x428e('0x9')](function(_0x59aaa5){return setInterval(initRealtime,0x1388);})[_0x428e('0x17')](function(_0x91bbbe){console[_0x428e('0x18')](_0x91bbbe);});}main(); \ No newline at end of file diff --git a/server/services/routing/lib/rule-engine.js b/server/services/routing/lib/rule-engine.js index 1d416f1..0b0d012 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['next','isEqual','restart','condition','matches','filter','turn','prioritize','findRules','length','priority','toJSON','map','toString','fromJSON','parse','object','exports','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','rules','activeRules','prototype','isArray','concat','push','sync','orderBy','result','clone','consequence','name','index_','nextTick','ruleRef','call'];(function(_0x3378a6,_0x2eedcc){var _0x1674d9=function(_0x275430){while(--_0x275430){_0x3378a6['push'](_0x3378a6['shift']());}};_0x1674d9(++_0x2eedcc);}(_0x2ef3,0xba));var _0x32ef=function(_0xa20e68,_0x4c0160){_0xa20e68=_0xa20e68-0x0;var _0x5b425d=_0x2ef3[_0xa20e68];return _0x5b425d;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var EventEmitter=require(_0x32ef('0x2'))[_0x32ef('0x3')];function RuleEngine(_0x3944df,_0x38047b){this['init']();if(!_[_0x32ef('0x4')](_0x3944df)){this[_0x32ef('0x5')](_0x3944df);}if(_0x38047b){this['ignoreFactChanges']=_0x38047b[_0x32ef('0x6')];}return this;}util[_0x32ef('0x7')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x2c0089){this[_0x32ef('0x8')]=[];this[_0x32ef('0x9')]=[];};RuleEngine[_0x32ef('0xa')][_0x32ef('0x5')]=function(_0x298066){if(Array[_0x32ef('0xb')](_0x298066)){this[_0x32ef('0x8')]=this[_0x32ef('0x8')][_0x32ef('0xc')](_0x298066);}else if(_0x298066!==null&&_['isObject'](_0x298066)){this['rules'][_0x32ef('0xd')](_0x298066);}this[_0x32ef('0xe')]();};RuleEngine[_0x32ef('0xa')][_0x32ef('0xe')]=function(){this['activeRules']=this[_0x32ef('0x8')]['filter'](function(_0x1a5106){if(_['isNil'](_0x1a5106['on'])){_0x1a5106['on']=!![];}if(_0x1a5106['on']===!![]){return _0x1a5106;}});this[_0x32ef('0x9')]=_[_0x32ef('0xf')](this['activeRules'],['p'],['asc']);};RuleEngine[_0x32ef('0xa')]['execute']=function(_0x326fce,_0x40a6e6){var _0x93d492=![];_0x326fce[_0x32ef('0x10')]=!![];var _0x57aff1=_['clone'](_0x326fce);var _0x531e30=_[_0x32ef('0x11')](_0x326fce);var _0x3950e6=this[_0x32ef('0x9')];var _0x53a5ca=[];var _0x5d559b=this[_0x32ef('0x6')];(function FnRuleLoop(_0x1a9476){var _0x286bfb={'rules':function(){return _0x3950e6;},'rule':function(){return _0x3950e6[_0x1a9476];},'when':function(_0x57863c){if(_0x57863c){var _0xbe37f6=_0x3950e6[_0x1a9476][_0x32ef('0x12')];_0xbe37f6['ruleRef']=_0x3950e6[_0x1a9476]['id']||_0x3950e6[_0x1a9476][_0x32ef('0x13')]||_0x32ef('0x14')+_0x1a9476;process[_0x32ef('0x15')](function(){_0x53a5ca[_0x32ef('0xd')](_0xbe37f6[_0x32ef('0x16')]);_0xbe37f6[_0x32ef('0x17')](_0x57aff1,_0x286bfb);});}else{process['nextTick'](function(){_0x286bfb[_0x32ef('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x93d492=!![];return FnRuleLoop(0x0);},'next':function(_0x5cc3ef){if(!_0x5d559b&&!_[_0x32ef('0x19')](_0x531e30,_0x57aff1)){_0x531e30=_[_0x32ef('0x11')](_0x57aff1);process['nextTick'](function(){_0x286bfb[_0x32ef('0x1a')]();});}else{process[_0x32ef('0x15')](function(){if(_[_0x32ef('0x4')](_0x5cc3ef)){return FnRuleLoop(_0x1a9476+0x1);}else{return FnRuleLoop(_0x5cc3ef);}});}}};if(_0x1a9476<_0x3950e6['length']&&_0x93d492===![]){var _0x57f5e5=_0x3950e6[_0x1a9476][_0x32ef('0x1b')];_0x57f5e5[_0x32ef('0x17')](_0x57aff1,_0x286bfb);}else{process[_0x32ef('0x15')](function(){_0x57aff1['matchPath']=_0x53a5ca;return _0x40a6e6?_0x40a6e6(_0x57aff1):_['noop']();});}}(0x0));};RuleEngine[_0x32ef('0xa')]['findRules']=function(_0x51a412){if(_[_0x32ef('0x4')](_0x51a412)){return this[_0x32ef('0x8')];}else{var _0x371540=_[_0x32ef('0x1c')](_0x51a412);return _[_0x32ef('0x1d')](this[_0x32ef('0x8')],_0x371540);}};RuleEngine[_0x32ef('0xa')][_0x32ef('0x1e')]=function(_0x338f19,_0x2f52d7){var _0x1335e2=_0x338f19==='on'||_0x338f19==='ON'?!![]:![];var _0xba4b3f=this['findRules'](_0x2f52d7);for(var _0xd65fde=0x0,_0x2f5d06=_0xba4b3f['length'];_0xd65fde<_0x2f5d06;_0xd65fde+=0x1){_0xba4b3f[_0xd65fde]['on']=_0x1335e2;}this[_0x32ef('0xe')]();};RuleEngine[_0x32ef('0xa')][_0x32ef('0x1f')]=function(_0x26e207,_0x50a95b){_0x26e207=parseInt(_0x26e207,0xa);var _0x10e38c=this[_0x32ef('0x20')](_0x50a95b);for(var _0x31dbc3=0x0,_0x2ac686=_0x10e38c[_0x32ef('0x21')];_0x31dbc3<_0x2ac686;_0x31dbc3+=0x1){_0x10e38c[_0x31dbc3][_0x32ef('0x22')]=_0x26e207;}this[_0x32ef('0xe')]();};RuleEngine['prototype'][_0x32ef('0x23')]=function(){var _0x537214=this[_0x32ef('0x8')];if(_0x537214 instanceof Array){_0x537214=_0x537214[_0x32ef('0x24')](function(_0x5a9565){_0x5a9565[_0x32ef('0x1b')]=_0x5a9565[_0x32ef('0x1b')][_0x32ef('0x25')]();_0x5a9565[_0x32ef('0x12')]=_0x5a9565[_0x32ef('0x12')]['toString']();return _0x5a9565;});}else if(!_['isNil'](_0x537214)){_0x537214[_0x32ef('0x1b')]=_0x537214['condition'][_0x32ef('0x25')]();_0x537214[_0x32ef('0x12')]=_0x537214[_0x32ef('0x12')][_0x32ef('0x25')]();}return _0x537214;};RuleEngine[_0x32ef('0xa')][_0x32ef('0x26')]=function(_0x566b56){this['init']();if(_['isString'](_0x566b56)){_0x566b56=JSON[_0x32ef('0x27')](_0x566b56);}if(_0x566b56 instanceof Array){_0x566b56=_0x566b56[_0x32ef('0x24')](function(_0x136b02){_0x136b02['condition']=eval('('+_0x136b02['condition']+')');_0x136b02[_0x32ef('0x12')]=eval('('+_0x136b02[_0x32ef('0x12')]+')');return _0x136b02;});}else if(_0x566b56!==null&&typeof _0x566b56==_0x32ef('0x28')){_0x566b56['condition']=eval('('+_0x566b56['condition']+')');_0x566b56[_0x32ef('0x12')]=eval('('+_0x566b56[_0x32ef('0x12')]+')');}this[_0x32ef('0x5')](_0x566b56);};module[_0x32ef('0x29')]=RuleEngine; \ No newline at end of file +var _0xc4aa=['ruleRef','name','nextTick','push','call','next','isEqual','restart','isNil','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','fromJSON','isString','parse','register','exports','lodash','util','events','EventEmitter','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','isObject','sync','filter','orderBy','asc','execute','result','clone','consequence'];(function(_0x1b311e,_0x4f7a51){var _0x17b3a8=function(_0x4f417b){while(--_0x4f417b){_0x1b311e['push'](_0x1b311e['shift']());}};_0x17b3a8(++_0x4f7a51);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xc4aa[_0x21549c];return _0x426cbd;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var EventEmitter=require(_0xac4a('0x2'))[_0xac4a('0x3')];function RuleEngine(_0x275161,_0x22469d){this['init']();if(!_['isNil'](_0x275161)){this['register'](_0x275161);}if(_0x22469d){this[_0xac4a('0x4')]=_0x22469d[_0xac4a('0x4')];}return this;}util[_0xac4a('0x5')](RuleEngine,EventEmitter);RuleEngine[_0xac4a('0x6')][_0xac4a('0x7')]=function(_0x15cd34){this[_0xac4a('0x8')]=[];this[_0xac4a('0x9')]=[];};RuleEngine['prototype']['register']=function(_0x1aba6d){if(Array[_0xac4a('0xa')](_0x1aba6d)){this[_0xac4a('0x8')]=this['rules'][_0xac4a('0xb')](_0x1aba6d);}else if(_0x1aba6d!==null&&_[_0xac4a('0xc')](_0x1aba6d)){this[_0xac4a('0x8')]['push'](_0x1aba6d);}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0xd')]=function(){this['activeRules']=this[_0xac4a('0x8')][_0xac4a('0xe')](function(_0x24291d){if(_['isNil'](_0x24291d['on'])){_0x24291d['on']=!![];}if(_0x24291d['on']===!![]){return _0x24291d;}});this[_0xac4a('0x9')]=_[_0xac4a('0xf')](this[_0xac4a('0x9')],['p'],[_0xac4a('0x10')]);};RuleEngine[_0xac4a('0x6')][_0xac4a('0x11')]=function(_0x34bc01,_0x33c287){var _0x190418=![];_0x34bc01[_0xac4a('0x12')]=!![];var _0x11e101=_[_0xac4a('0x13')](_0x34bc01);var _0x4a2119=_[_0xac4a('0x13')](_0x34bc01);var _0x34d797=this[_0xac4a('0x9')];var _0x144553=[];var _0x3e88e3=this[_0xac4a('0x4')];(function FnRuleLoop(_0x28e304){var _0x44ec59={'rules':function(){return _0x34d797;},'rule':function(){return _0x34d797[_0x28e304];},'when':function(_0x546c5d){if(_0x546c5d){var _0x5ac21e=_0x34d797[_0x28e304][_0xac4a('0x14')];_0x5ac21e[_0xac4a('0x15')]=_0x34d797[_0x28e304]['id']||_0x34d797[_0x28e304][_0xac4a('0x16')]||'index_'+_0x28e304;process[_0xac4a('0x17')](function(){_0x144553[_0xac4a('0x18')](_0x5ac21e[_0xac4a('0x15')]);_0x5ac21e[_0xac4a('0x19')](_0x11e101,_0x44ec59);});}else{process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1a')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190418=!![];return FnRuleLoop(0x0);},'next':function(_0xe38996){if(!_0x3e88e3&&!_[_0xac4a('0x1b')](_0x4a2119,_0x11e101)){_0x4a2119=_['clone'](_0x11e101);process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1c')]();});}else{process['nextTick'](function(){if(_[_0xac4a('0x1d')](_0xe38996)){return FnRuleLoop(_0x28e304+0x1);}else{return FnRuleLoop(_0xe38996);}});}}};if(_0x28e304<_0x34d797[_0xac4a('0x1e')]&&_0x190418===![]){var _0x3eacd3=_0x34d797[_0x28e304][_0xac4a('0x1f')];_0x3eacd3['call'](_0x11e101,_0x44ec59);}else{process[_0xac4a('0x17')](function(){_0x11e101[_0xac4a('0x20')]=_0x144553;return _0x33c287?_0x33c287(_0x11e101):_[_0xac4a('0x21')]();});}}(0x0));};RuleEngine[_0xac4a('0x6')][_0xac4a('0x22')]=function(_0x2b0dc2){if(_[_0xac4a('0x1d')](_0x2b0dc2)){return this[_0xac4a('0x8')];}else{var _0x3e2c69=_[_0xac4a('0x23')](_0x2b0dc2);return _[_0xac4a('0xe')](this[_0xac4a('0x8')],_0x3e2c69);}};RuleEngine[_0xac4a('0x6')][_0xac4a('0x24')]=function(_0x1c13dc,_0x20202c){var _0x4e17ce=_0x1c13dc==='on'||_0x1c13dc==='ON'?!![]:![];var _0x23b061=this[_0xac4a('0x22')](_0x20202c);for(var _0x42a33c=0x0,_0x2772fe=_0x23b061[_0xac4a('0x1e')];_0x42a33c<_0x2772fe;_0x42a33c+=0x1){_0x23b061[_0x42a33c]['on']=_0x4e17ce;}this['sync']();};RuleEngine['prototype'][_0xac4a('0x25')]=function(_0x7a948b,_0x1f12d5){_0x7a948b=parseInt(_0x7a948b,0xa);var _0x546b65=this['findRules'](_0x1f12d5);for(var _0x355755=0x0,_0x2896bc=_0x546b65[_0xac4a('0x1e')];_0x355755<_0x2896bc;_0x355755+=0x1){_0x546b65[_0x355755][_0xac4a('0x26')]=_0x7a948b;}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0x27')]=function(){var _0x482afc=this[_0xac4a('0x8')];if(_0x482afc instanceof Array){_0x482afc=_0x482afc['map'](function(_0x17e6de){_0x17e6de[_0xac4a('0x1f')]=_0x17e6de[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x17e6de[_0xac4a('0x14')]=_0x17e6de[_0xac4a('0x14')][_0xac4a('0x28')]();return _0x17e6de;});}else if(!_[_0xac4a('0x1d')](_0x482afc)){_0x482afc[_0xac4a('0x1f')]=_0x482afc[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x482afc[_0xac4a('0x14')]=_0x482afc[_0xac4a('0x14')][_0xac4a('0x28')]();}return _0x482afc;};RuleEngine['prototype'][_0xac4a('0x29')]=function(_0x1c41fb){this['init']();if(_[_0xac4a('0x2a')](_0x1c41fb)){_0x1c41fb=JSON[_0xac4a('0x2b')](_0x1c41fb);}if(_0x1c41fb instanceof Array){_0x1c41fb=_0x1c41fb['map'](function(_0x58804b){_0x58804b[_0xac4a('0x1f')]=eval('('+_0x58804b[_0xac4a('0x1f')]+')');_0x58804b[_0xac4a('0x14')]=eval('('+_0x58804b[_0xac4a('0x14')]+')');return _0x58804b;});}else if(_0x1c41fb!==null&&typeof _0x1c41fb=='object'){_0x1c41fb[_0xac4a('0x1f')]=eval('('+_0x1c41fb[_0xac4a('0x1f')]+')');_0x1c41fb['consequence']=eval('('+_0x1c41fb[_0xac4a('0x14')]+')');}this[_0xac4a('0x2c')](_0x1c41fb);};module[_0xac4a('0x2d')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 3531b89..59bffa6 100644 --- a/server/services/routing/mailRpc/index.js +++ b/server/services/routing/mailRpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x28b0=['then','error','result','catch','SendMail','bluebird','jayson/promise','client'];(function(_0xc7bea9,_0xe5f6b8){var _0xf25d6c=function(_0x4e00a2){while(--_0x4e00a2){_0xc7bea9['push'](_0xc7bea9['shift']());}};_0xf25d6c(++_0xe5f6b8);}(_0x28b0,0x11d));var _0x028b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28b0[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x028b('0x0'));var jayson=require(_0x028b('0x1'));var client=jayson[_0x028b('0x2')]['http']({'port':0x232b});function request(_0x53b88c,_0xdf02da){return new BPromise(function(_0x48011f,_0x2c1e70){return client['request'](_0x53b88c,_0xdf02da)[_0x028b('0x3')](function(_0x3ddb0b){if(_0x3ddb0b[_0x028b('0x4')]){return _0x2c1e70(_0x3ddb0b[_0x028b('0x4')]['message']);}else{return _0x48011f(_0x3ddb0b[_0x028b('0x5')]);}})[_0x028b('0x6')](function(_0x255264){return _0x2c1e70(_0x255264);});});}exports['sendMailMessage']=function(_0x136835,_0x37497b){return request(_0x028b('0x7'),{'account':_0x136835,'message':_0x37497b});}; \ No newline at end of file +var _0x0f03=['result','sendMailMessage','SendMail','bluebird','client','request','message'];(function(_0x429948,_0x1a6851){var _0x35d5d1=function(_0x574853){while(--_0x574853){_0x429948['push'](_0x429948['shift']());}};_0x35d5d1(++_0x1a6851);}(_0x0f03,0x199));var _0x30f0=function(_0x472ade,_0x14afa4){_0x472ade=_0x472ade-0x0;var _0x55a4c1=_0x0f03[_0x472ade];return _0x55a4c1;};'use strict';var BPromise=require(_0x30f0('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x30f0('0x1')]['http']({'port':0x232b});function request(_0x2a1fde,_0xba7f76){return new BPromise(function(_0xee1873,_0x543174){return client[_0x30f0('0x2')](_0x2a1fde,_0xba7f76)['then'](function(_0x33ebff){if(_0x33ebff['error']){return _0x543174(_0x33ebff['error'][_0x30f0('0x3')]);}else{return _0xee1873(_0x33ebff[_0x30f0('0x4')]);}})['catch'](function(_0x4e4ebf){return _0x543174(_0x4e4ebf);});});}exports[_0x30f0('0x5')]=function(_0x23ca90,_0x4cae1e){return request(_0x30f0('0x6'),{'account':_0x23ca90,'message':_0x4cae1e});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 144ad67..09b8a27 100644 --- a/server/services/routing/model/agent.js +++ b/server/services/routing/model/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x430c=['smsCurrentCapacity','whatsappStatus','whatsappCapacity','whatsappCurrentCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','md5','faxWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','updateRealtime','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','idle','mail','chat','fax','sms','whatsapp','length','Status','StatusTime','toNumber','mailCurrentCapacity','smsStatus','smsStatusTime','whatsappStatusTime','chatWaitingInteractions','openchannelWaitingInteractions','stringify','emit','user:routing:update','omit','exports','lodash','ioredis','../../../config/environment','redis','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','unknown','mailStatusTime','mailCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity','smsCapacity'];(function(_0x4fb6b6,_0x5eb1c7){var _0x3ea470=function(_0x26228c){while(--_0x26228c){_0x4fb6b6['push'](_0x4fb6b6['shift']());}};_0x3ea470(++_0x5eb1c7);}(_0x430c,0x1a1));var _0xc430=function(_0x3c504b,_0x437693){_0x3c504b=_0x3c504b-0x0;var _0x2e5354=_0x430c[_0x3c504b];return _0x2e5354;};'use strict';var _=require(_0xc430('0x0'));var md5=require('md5');var moment=require('moment');var Redis=require(_0xc430('0x1'));var config=require(_0xc430('0x2'));config[_0xc430('0x3')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc430('0x3')]));function Agent(_0x2408f5){this['id']=_0x2408f5['id']||0x0;this['name']=_0x2408f5[_0xc430('0x4')]||'';this['online']=_0x2408f5[_0xc430('0x5')]||!![];this[_0xc430('0x6')]=_0x2408f5[_0xc430('0x6')]||![];this[_0xc430('0x7')]=_0x2408f5[_0xc430('0x7')]||![];this[_0xc430('0x8')]=_0x2408f5[_0xc430('0x8')]||![];this[_0xc430('0x9')]=_0x2408f5[_0xc430('0x9')]||![];this['smsPause']=_0x2408f5[_0xc430('0xa')]||![];this[_0xc430('0xb')]=_0x2408f5['openchannelPause']||![];this[_0xc430('0xc')]='unknown';this[_0xc430('0xd')]=0x0;this['chatCapacity']=_0x2408f5[_0xc430('0xe')]||0x0;this[_0xc430('0xf')]=0x0;this[_0xc430('0x10')]=_0xc430('0x11');this[_0xc430('0x12')]=0x0;this[_0xc430('0x13')]=_0x2408f5[_0xc430('0x13')]||0x0;this['mailCurrentCapacity']=0x0;this['faxStatus']=_0xc430('0x11');this[_0xc430('0x14')]=0x0;this[_0xc430('0x15')]=_0x2408f5[_0xc430('0x15')]||0x0;this[_0xc430('0x16')]=0x0;this['smsStatus']=_0xc430('0x11');this['smsStatusTime']=0x0;this['smsCapacity']=_0x2408f5[_0xc430('0x17')]||0x0;this[_0xc430('0x18')]=0x0;this[_0xc430('0x19')]='unknown';this['whatsappStatusTime']=0x0;this[_0xc430('0x1a')]=_0x2408f5['whatsappCapacity']||0x0;this[_0xc430('0x1b')]=0x0;this['openchannelStatus']='unknown';this[_0xc430('0x1c')]=0x0;this['openchannelCapacity']=_0x2408f5[_0xc430('0x1d')]||0x0;this[_0xc430('0x1e')]=0x0;this[_0xc430('0x1f')]=![];this[_0xc430('0x20')]=undefined;this[_0xc430('0x21')]='';this['chatWaitingInteractions']={};this[_0xc430('0x22')]={};this['mailWaitingInteractions']={};this['openchannelWaitingInteractions']={};this[_0xc430('0x23')]={};this[_0xc430('0x24')]={};this[_0xc430('0x25')]();}Agent['prototype'][_0xc430('0x26')]=function(_0x57d26e){if(this[_0x57d26e+_0xc430('0x27')]>0x0){if(this[_0x57d26e+_0xc430('0x28')]>0x0&&this[_0x57d26e+'CurrentCapacity']>=this[_0x57d26e+_0xc430('0x28')]){return _0xc430('0x29');}else{return'working';}}else{return _0xc430('0x2a');}};Agent['prototype'][_0xc430('0x25')]=function(){var _0x4b5280=[_0xc430('0x2b'),_0xc430('0x2c'),'openchannel',_0xc430('0x2d'),_0xc430('0x2e'),_0xc430('0x2f')];for(var _0x44833e=0x0;_0x44833e<_0x4b5280[_0xc430('0x30')];_0x44833e+=0x1){var _0x57cd72=this[_0xc430('0x26')](_0x4b5280[_0x44833e]);if(this[_0x4b5280[_0x44833e]+_0xc430('0x31')]!==_0x57cd72){this[_0x4b5280[_0x44833e]+_0xc430('0x32')]=_[_0xc430('0x33')](moment()['format']('x'));}this[_0x4b5280[_0x44833e]+_0xc430('0x31')]=_0x57cd72;}var _0x4cf56c={'id':this['id'],'name':this[_0xc430('0x4')],'online':this['online'],'voicePause':this[_0xc430('0x6')],'chatPause':this[_0xc430('0x7')],'mailPause':this[_0xc430('0x8')],'smsPause':this[_0xc430('0xa')],'faxPause':this['faxPause'],'openchannelPause':this[_0xc430('0xb')],'chatStatus':this[_0xc430('0xc')],'chatStatusTime':this[_0xc430('0xd')],'chatCapacity':this[_0xc430('0xe')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0xc430('0x10')],'mailStatusTime':this[_0xc430('0x12')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0xc430('0x34')],'faxStatus':this['faxStatus'],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0xc430('0x15')],'faxCurrentCapacity':this[_0xc430('0x16')],'smsStatus':this[_0xc430('0x35')],'smsStatusTime':this[_0xc430('0x36')],'smsCapacity':this[_0xc430('0x17')],'smsCurrentCapacity':this[_0xc430('0x18')],'whatsappStatus':this[_0xc430('0x19')],'whatsappStatusTime':this[_0xc430('0x37')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0xc430('0x1b')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0xc430('0x1c')],'openchannelCapacity':this[_0xc430('0x1d')],'openchannelCurrentCapacity':this[_0xc430('0x1e')],'busy':this[_0xc430('0x1f')],'busyQueue':this['busyQueue'],'chatWaitingInteractions':this[_0xc430('0x38')],'faxWaitingInteractions':this['faxWaitingInteractions'],'mailWaitingInteractions':this['mailWaitingInteractions'],'openchannelWaitingInteractions':this[_0xc430('0x39')],'smsWaitingInteractions':this[_0xc430('0x23')],'whatsappWaitingInteractions':this['whatsappWaitingInteractions']};var _0x5ff73c=md5(JSON[_0xc430('0x3a')](_0x4cf56c));if(this[_0xc430('0x21')]!==_0x5ff73c){this[_0xc430('0x21')]=_0x5ff73c;io[_0xc430('0x3b')](_0xc430('0x3c'),_[_0xc430('0x3d')](_0x4cf56c,[_0xc430('0x5')]));}};module[_0xc430('0x3e')]=Agent; \ No newline at end of file +var _0x3e24=['emit','user:routing:update','omit','exports','lodash','md5','moment','ioredis','../../../config/environment','defaults','redis','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','unknown','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busyQueue','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','updateRealtime','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','prototype','mail','chat','openchannel','fax','sms','length','Status','StatusTime','toNumber','format','chatStatus','faxStatusTime','busy','openchannelWaitingInteractions','stringify'];(function(_0x5a2d14,_0x3367e7){var _0x444560=function(_0x6fc9b5){while(--_0x6fc9b5){_0x5a2d14['push'](_0x5a2d14['shift']());}};_0x444560(++_0x3367e7);}(_0x3e24,0x167));var _0x43e2=function(_0x21cd8e,_0x583fc0){_0x21cd8e=_0x21cd8e-0x0;var _0x19551c=_0x3e24[_0x21cd8e];return _0x19551c;};'use strict';var _=require(_0x43e2('0x0'));var md5=require(_0x43e2('0x1'));var moment=require(_0x43e2('0x2'));var Redis=require(_0x43e2('0x3'));var config=require(_0x43e2('0x4'));config['redis']=_[_0x43e2('0x5')](config[_0x43e2('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x43e2('0x7'))(new Redis(config[_0x43e2('0x6')]));function Agent(_0x1a89fc){this['id']=_0x1a89fc['id']||0x0;this[_0x43e2('0x8')]=_0x1a89fc[_0x43e2('0x8')]||'';this[_0x43e2('0x9')]=_0x1a89fc[_0x43e2('0x9')]||!![];this['voicePause']=_0x1a89fc[_0x43e2('0xa')]||![];this[_0x43e2('0xb')]=_0x1a89fc['chatPause']||![];this[_0x43e2('0xc')]=_0x1a89fc[_0x43e2('0xc')]||![];this['faxPause']=_0x1a89fc[_0x43e2('0xd')]||![];this[_0x43e2('0xe')]=_0x1a89fc['smsPause']||![];this[_0x43e2('0xf')]=_0x1a89fc['openchannelPause']||![];this['chatStatus']='unknown';this[_0x43e2('0x10')]=0x0;this[_0x43e2('0x11')]=_0x1a89fc[_0x43e2('0x11')]||0x0;this[_0x43e2('0x12')]=0x0;this[_0x43e2('0x13')]=_0x43e2('0x14');this[_0x43e2('0x15')]=0x0;this[_0x43e2('0x16')]=_0x1a89fc[_0x43e2('0x16')]||0x0;this[_0x43e2('0x17')]=0x0;this[_0x43e2('0x18')]=_0x43e2('0x14');this['faxStatusTime']=0x0;this[_0x43e2('0x19')]=_0x1a89fc[_0x43e2('0x19')]||0x0;this[_0x43e2('0x1a')]=0x0;this[_0x43e2('0x1b')]='unknown';this['smsStatusTime']=0x0;this[_0x43e2('0x1c')]=_0x1a89fc[_0x43e2('0x1c')]||0x0;this[_0x43e2('0x1d')]=0x0;this[_0x43e2('0x1e')]=_0x43e2('0x14');this[_0x43e2('0x1f')]=0x0;this[_0x43e2('0x20')]=_0x1a89fc[_0x43e2('0x20')]||0x0;this[_0x43e2('0x21')]=0x0;this[_0x43e2('0x22')]='unknown';this[_0x43e2('0x23')]=0x0;this[_0x43e2('0x24')]=_0x1a89fc['openchannelCapacity']||0x0;this[_0x43e2('0x25')]=0x0;this['busy']=![];this[_0x43e2('0x26')]=undefined;this[_0x43e2('0x1')]='';this[_0x43e2('0x27')]={};this[_0x43e2('0x28')]={};this[_0x43e2('0x29')]={};this['openchannelWaitingInteractions']={};this[_0x43e2('0x2a')]={};this[_0x43e2('0x2b')]={};this[_0x43e2('0x2c')]();}Agent['prototype'][_0x43e2('0x2d')]=function(_0x32f048){if(this[_0x32f048+_0x43e2('0x2e')]>0x0){if(this[_0x32f048+_0x43e2('0x2f')]>0x0&&this[_0x32f048+'CurrentCapacity']>=this[_0x32f048+_0x43e2('0x2f')]){return _0x43e2('0x30');}else{return _0x43e2('0x31');}}else{return _0x43e2('0x32');}};Agent[_0x43e2('0x33')][_0x43e2('0x2c')]=function(){var _0x3ca16b=[_0x43e2('0x34'),_0x43e2('0x35'),_0x43e2('0x36'),_0x43e2('0x37'),_0x43e2('0x38'),'whatsapp'];for(var _0x430a0e=0x0;_0x430a0e<_0x3ca16b[_0x43e2('0x39')];_0x430a0e+=0x1){var _0x545246=this[_0x43e2('0x2d')](_0x3ca16b[_0x430a0e]);if(this[_0x3ca16b[_0x430a0e]+_0x43e2('0x3a')]!==_0x545246){this[_0x3ca16b[_0x430a0e]+_0x43e2('0x3b')]=_[_0x43e2('0x3c')](moment()[_0x43e2('0x3d')]('x'));}this[_0x3ca16b[_0x430a0e]+'Status']=_0x545246;}var _0x42f495={'id':this['id'],'name':this[_0x43e2('0x8')],'online':this[_0x43e2('0x9')],'voicePause':this[_0x43e2('0xa')],'chatPause':this[_0x43e2('0xb')],'mailPause':this[_0x43e2('0xc')],'smsPause':this['smsPause'],'faxPause':this['faxPause'],'openchannelPause':this[_0x43e2('0xf')],'chatStatus':this[_0x43e2('0x3e')],'chatStatusTime':this[_0x43e2('0x10')],'chatCapacity':this[_0x43e2('0x11')],'chatCurrentCapacity':this[_0x43e2('0x12')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x43e2('0x15')],'mailCapacity':this[_0x43e2('0x16')],'mailCurrentCapacity':this[_0x43e2('0x17')],'faxStatus':this[_0x43e2('0x18')],'faxStatusTime':this[_0x43e2('0x3f')],'faxCapacity':this[_0x43e2('0x19')],'faxCurrentCapacity':this[_0x43e2('0x1a')],'smsStatus':this['smsStatus'],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x43e2('0x1c')],'smsCurrentCapacity':this[_0x43e2('0x1d')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x43e2('0x1f')],'whatsappCapacity':this[_0x43e2('0x20')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x43e2('0x22')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x43e2('0x40')],'busyQueue':this['busyQueue'],'chatWaitingInteractions':this[_0x43e2('0x27')],'faxWaitingInteractions':this[_0x43e2('0x28')],'mailWaitingInteractions':this[_0x43e2('0x29')],'openchannelWaitingInteractions':this[_0x43e2('0x41')],'smsWaitingInteractions':this[_0x43e2('0x2a')],'whatsappWaitingInteractions':this[_0x43e2('0x2b')]};var _0x1cf8e5=md5(JSON[_0x43e2('0x42')](_0x42f495));if(this[_0x43e2('0x1')]!==_0x1cf8e5){this[_0x43e2('0x1')]=_0x1cf8e5;io[_0x43e2('0x43')](_0x43e2('0x44'),_[_0x43e2('0x45')](_0x42f495,[_0x43e2('0x9')]));}};module[_0x43e2('0x46')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index a709eb9..c1d9da5 100644 --- a/server/services/routing/model/chatQueue.js +++ b/server/services/routing/model/chatQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa7ee=['localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','prototype','_rr','map','updateRealtime','loggedIn','paused','length','online','chatPause','available','waiting','md5','format','chat:queue:%s','emit','chat_queue:save','exports','util','ioredis','../../../config/environment','redis'];(function(_0x49fa12,_0x8e837e){var _0x19c441=function(_0x477c65){while(--_0x477c65){_0x49fa12['push'](_0x49fa12['shift']());}};_0x19c441(++_0x8e837e);}(_0xa7ee,0x1be));var _0xea7e=function(_0x2a453b,_0x479c50){_0x2a453b=_0x2a453b-0x0;var _0x132f79=_0xa7ee[_0x2a453b];return _0x132f79;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0xea7e('0x0'));var Redis=require(_0xea7e('0x1'));var config=require(_0xea7e('0x2'));config['redis']=_['defaults'](config[_0xea7e('0x3')],{'host':_0xea7e('0x4'),'port':0x18eb});var io=require(_0xea7e('0x5'))(new Redis(config[_0xea7e('0x3')]));function ChatQueue(_0x19b075){this['id']=_0x19b075['id']||0x0;this[_0xea7e('0x6')]=_0x19b075[_0xea7e('0x6')]||'';this[_0xea7e('0x7')]=_0x19b075['timeout']||0xa;this[_0xea7e('0x8')]=_0x19b075['strategy']||_0xea7e('0x9');this['Agents']=_0x19b075[_0xea7e('0xa')];this[_0xea7e('0xb')]={};this['waiting']=0x0;this['md5']='';this[_0xea7e('0xc')]();this['updateRealtime']();}ChatQueue[_0xea7e('0xd')][_0xea7e('0xc')]=function(){var _0x22c2b7=this['mapAgentsId'][_0xea7e('0xe')];this[_0xea7e('0xb')]=_[_0xea7e('0xf')](this[_0xea7e('0xa')],'id');this[_0xea7e('0xb')][_0xea7e('0xe')]=_0x22c2b7;};ChatQueue[_0xea7e('0xd')][_0xea7e('0x10')]=function(){this[_0xea7e('0x11')]=0x0;this[_0xea7e('0x12')]=0x0;for(var _0x279a65=0x0;_0x279a65=0x0?this['available']:0x0;var _0x40cece={'id':this['id'],'available':this[_0xea7e('0x16')],'loggedIn':this[_0xea7e('0x11')],'name':this[_0xea7e('0x6')],'paused':this['paused'],'waiting':this[_0xea7e('0x17')]};var _0x25097c=md5(JSON['stringify'](_0x40cece));if(this[_0xea7e('0x18')]!==_0x25097c){this[_0xea7e('0x18')]=_0x25097c;io['to'](util[_0xea7e('0x19')](_0xea7e('0x1a'),_0x40cece[_0xea7e('0x6')]))[_0xea7e('0x1b')](_0xea7e('0x1c'),_0x40cece);}};module[_0xea7e('0x1d')]=ChatQueue; \ No newline at end of file +var _0xc845=['available','stringify','chat:queue:%s','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','map','prototype','updateRealtime','loggedIn','paused','length','chatPause'];(function(_0x51904f,_0x439694){var _0x24dc27=function(_0x3046b1){while(--_0x3046b1){_0x51904f['push'](_0x51904f['shift']());}};_0x24dc27(++_0x439694);}(_0xc845,0x161));var _0x5c84=function(_0x4f89f1,_0x57e61c){_0x4f89f1=_0x4f89f1-0x0;var _0x7d651e=_0xc845[_0x4f89f1];return _0x7d651e;};'use strict';var _=require(_0x5c84('0x0'));var md5=require(_0x5c84('0x1'));var util=require(_0x5c84('0x2'));var Redis=require(_0x5c84('0x3'));var config=require(_0x5c84('0x4'));config[_0x5c84('0x5')]=_[_0x5c84('0x6')](config['redis'],{'host':_0x5c84('0x7'),'port':0x18eb});var io=require(_0x5c84('0x8'))(new Redis(config[_0x5c84('0x5')]));function ChatQueue(_0x597a4e){this['id']=_0x597a4e['id']||0x0;this[_0x5c84('0x9')]=_0x597a4e[_0x5c84('0x9')]||'';this['timeout']=_0x597a4e['timeout']||0xa;this[_0x5c84('0xa')]=_0x597a4e[_0x5c84('0xa')]||_0x5c84('0xb');this[_0x5c84('0xc')]=_0x597a4e['Agents'];this[_0x5c84('0xd')]={};this[_0x5c84('0xe')]=0x0;this['md5']='';this['updateRouting']();this['updateRealtime']();}ChatQueue['prototype'][_0x5c84('0xf')]=function(){var _0x2b90f6=this['mapAgentsId'][_0x5c84('0x10')];this[_0x5c84('0xd')]=_[_0x5c84('0x11')](this[_0x5c84('0xc')],'id');this[_0x5c84('0xd')]['_rr']=_0x2b90f6;};ChatQueue[_0x5c84('0x12')][_0x5c84('0x13')]=function(){this[_0x5c84('0x14')]=0x0;this[_0x5c84('0x15')]=0x0;for(var _0x474d1a=0x0;_0x474d1a=0x0?this['available']:0x0;var _0x25eeac={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x5c84('0x15')],'waiting':this[_0x5c84('0xe')]};var _0x52c643=md5(JSON[_0x5c84('0x19')](_0x25eeac));if(this['md5']!==_0x52c643){this[_0x5c84('0x1')]=_0x52c643;io['to'](util['format'](_0x5c84('0x1a'),_0x25eeac['name']))['emit'](_0x5c84('0x1b'),_0x25eeac);}};module[_0x5c84('0x1c')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index fed77e2..fb469e6 100644 --- a/server/services/routing/model/faxQueue.js +++ b/server/services/routing/model/faxQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55eb=['paused','length','online','faxPause','available','stringify','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn'];(function(_0xa1c46b,_0x2e035b){var _0x5114e7=function(_0x1757cd){while(--_0x1757cd){_0xa1c46b['push'](_0xa1c46b['shift']());}};_0x5114e7(++_0x2e035b);}(_0x55eb,0x122));var _0xb55e=function(_0x2c31d6,_0x3df631){_0x2c31d6=_0x2c31d6-0x0;var _0x1798ba=_0x55eb[_0x2c31d6];return _0x1798ba;};'use strict';var _=require(_0xb55e('0x0'));var md5=require(_0xb55e('0x1'));var util=require('util');var Redis=require(_0xb55e('0x2'));var config=require(_0xb55e('0x3'));config[_0xb55e('0x4')]=_[_0xb55e('0x5')](config['redis'],{'host':_0xb55e('0x6'),'port':0x18eb});var io=require(_0xb55e('0x7'))(new Redis(config[_0xb55e('0x4')]));function FaxQueue(_0x147d4c){this['id']=_0x147d4c['id']||0x0;this[_0xb55e('0x8')]=_0x147d4c[_0xb55e('0x8')]||'';this[_0xb55e('0x9')]=_0x147d4c[_0xb55e('0x9')]||0xa;this[_0xb55e('0xa')]=_0x147d4c['strategy']||'beepall';this[_0xb55e('0xb')]=_0x147d4c['Agents'];this['mapAgentsId']={};this[_0xb55e('0xc')]=0x0;this[_0xb55e('0x1')]='';this[_0xb55e('0xd')]();this[_0xb55e('0xe')]();}FaxQueue[_0xb55e('0xf')][_0xb55e('0xd')]=function(){var _0xc3859d=this[_0xb55e('0x10')][_0xb55e('0x11')];this[_0xb55e('0x10')]=_[_0xb55e('0x12')](this[_0xb55e('0xb')],'id');this[_0xb55e('0x10')][_0xb55e('0x11')]=_0xc3859d;};FaxQueue[_0xb55e('0xf')][_0xb55e('0xe')]=function(){this[_0xb55e('0x13')]=0x0;this[_0xb55e('0x14')]=0x0;for(var _0x18dd76=0x0;_0x18dd76=0x0?this['available']:0x0;var _0x23470c={'id':this['id'],'available':this[_0xb55e('0x18')],'loggedIn':this['loggedIn'],'name':this[_0xb55e('0x8')],'paused':this[_0xb55e('0x14')],'waiting':this[_0xb55e('0xc')]};var _0x3ceebb=md5(JSON[_0xb55e('0x19')](_0x23470c));if(this['md5']!==_0x3ceebb){this['md5']=_0x3ceebb;io['to'](util[_0xb55e('0x1a')](_0xb55e('0x1b'),_0x23470c['name']))[_0xb55e('0x1c')](_0xb55e('0x1d'),_0x23470c);}};module[_0xb55e('0x1e')]=FaxQueue; \ No newline at end of file +var _0x2537=['defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','md5','updateRouting','updateRealtime','_rr','mapAgentsId','map','prototype','paused','loggedIn','faxPause','available','stringify','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','util','ioredis','redis'];(function(_0x26e424,_0xfcf210){var _0x2c81d6=function(_0x58feef){while(--_0x58feef){_0x26e424['push'](_0x26e424['shift']());}};_0x2c81d6(++_0xfcf210);}(_0x2537,0xce));var _0x7253=function(_0x34cea1,_0x875430){_0x34cea1=_0x34cea1-0x0;var _0x3bc13b=_0x2537[_0x34cea1];return _0x3bc13b;};'use strict';var _=require(_0x7253('0x0'));var md5=require('md5');var util=require(_0x7253('0x1'));var Redis=require(_0x7253('0x2'));var config=require('../../../config/environment');config[_0x7253('0x3')]=_[_0x7253('0x4')](config[_0x7253('0x3')],{'host':_0x7253('0x5'),'port':0x18eb});var io=require(_0x7253('0x6'))(new Redis(config['redis']));function FaxQueue(_0x3cd5d7){this['id']=_0x3cd5d7['id']||0x0;this[_0x7253('0x7')]=_0x3cd5d7[_0x7253('0x7')]||'';this[_0x7253('0x8')]=_0x3cd5d7['timeout']||0xa;this[_0x7253('0x9')]=_0x3cd5d7[_0x7253('0x9')]||_0x7253('0xa');this['Agents']=_0x3cd5d7[_0x7253('0xb')];this['mapAgentsId']={};this[_0x7253('0xc')]=0x0;this[_0x7253('0xd')]='';this[_0x7253('0xe')]();this[_0x7253('0xf')]();}FaxQueue['prototype'][_0x7253('0xe')]=function(){var _0x5d36be=this['mapAgentsId'][_0x7253('0x10')];this[_0x7253('0x11')]=_[_0x7253('0x12')](this[_0x7253('0xb')],'id');this[_0x7253('0x11')]['_rr']=_0x5d36be;};FaxQueue[_0x7253('0x13')][_0x7253('0xf')]=function(){this['loggedIn']=0x0;this[_0x7253('0x14')]=0x0;for(var _0x42fc53=0x0;_0x42fc53=0x0?this['available']:0x0;var _0x264e84={'id':this['id'],'available':this['available'],'loggedIn':this[_0x7253('0x15')],'name':this[_0x7253('0x7')],'paused':this['paused'],'waiting':this[_0x7253('0xc')]};var _0x22d139=md5(JSON[_0x7253('0x18')](_0x264e84));if(this[_0x7253('0xd')]!==_0x22d139){this[_0x7253('0xd')]=_0x22d139;io['to'](util[_0x7253('0x19')](_0x7253('0x1a'),_0x264e84[_0x7253('0x7')]))[_0x7253('0x1b')](_0x7253('0x1c'),_0x264e84);}};module[_0x7253('0x1d')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index c01adee..f6724d4 100644 --- a/server/services/routing/model/interval.js +++ b/server/services/routing/model/interval.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb324=['exports','name'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xb324,0x1bb));var _0x4b32=function(_0x2a6e6a,_0x26e879){_0x2a6e6a=_0x2a6e6a-0x0;var _0xd216a4=_0xb324[_0x2a6e6a];return _0xd216a4;};'use strict';function Interval(_0x51ebe6){this['id']=_0x51ebe6['id']||0x0;this[_0x4b32('0x0')]=_0x51ebe6['name']||'';this['Intervals']=_0x51ebe6['Intervals']||{};}module[_0x4b32('0x1')]=Interval; \ No newline at end of file +var _0x6c5d=['exports','name','Intervals'];(function(_0x4b6043,_0x4073b7){var _0x52ae03=function(_0x2b944a){while(--_0x2b944a){_0x4b6043['push'](_0x4b6043['shift']());}};_0x52ae03(++_0x4073b7);}(_0x6c5d,0x16c));var _0xd6c5=function(_0x1e75eb,_0x3f4e09){_0x1e75eb=_0x1e75eb-0x0;var _0x1a722d=_0x6c5d[_0x1e75eb];return _0x1a722d;};'use strict';function Interval(_0x2e49f6){this['id']=_0x2e49f6['id']||0x0;this['name']=_0x2e49f6[_0xd6c5('0x0')]||'';this[_0xd6c5('0x1')]=_0x2e49f6[_0xd6c5('0x1')]||{};}module[_0xd6c5('0x2')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index f7effb6..183fe6e 100644 --- a/server/services/routing/model/mailQueue.js +++ b/server/services/routing/model/mailQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5599=['name','emit','mail_queue:save','exports','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','timeout','strategy','Agents','mapAgentsId','prototype','_rr','updateRealtime','loggedIn','paused','length','online','available','waiting','stringify','mail:queue:%s'];(function(_0x376805,_0x322613){var _0x4af5e4=function(_0x14bbda){while(--_0x14bbda){_0x376805['push'](_0x376805['shift']());}};_0x4af5e4(++_0x322613);}(_0x5599,0x148));var _0x9559=function(_0x5a9baa,_0x387d86){_0x5a9baa=_0x5a9baa-0x0;var _0x411439=_0x5599[_0x5a9baa];return _0x411439;};'use strict';var _=require('lodash');var md5=require(_0x9559('0x0'));var util=require(_0x9559('0x1'));var Redis=require(_0x9559('0x2'));var config=require(_0x9559('0x3'));config['redis']=_[_0x9559('0x4')](config[_0x9559('0x5')],{'host':_0x9559('0x6'),'port':0x18eb});var io=require(_0x9559('0x7'))(new Redis(config[_0x9559('0x5')]));function MailQueue(_0x3edf89){this['id']=_0x3edf89['id']||0x0;this['name']=_0x3edf89['name']||'';this[_0x9559('0x8')]=_0x3edf89[_0x9559('0x8')]||0xa;this[_0x9559('0x9')]=_0x3edf89['strategy']||'beepall';this[_0x9559('0xa')]=_0x3edf89[_0x9559('0xa')];this[_0x9559('0xb')]={};this['waiting']=0x0;this[_0x9559('0x0')]='';this['updateRouting']();this['updateRealtime']();}MailQueue[_0x9559('0xc')]['updateRouting']=function(){var _0x532481=this['mapAgentsId'][_0x9559('0xd')];this[_0x9559('0xb')]=_['map'](this['Agents'],'id');this['mapAgentsId'][_0x9559('0xd')]=_0x532481;};MailQueue[_0x9559('0xc')][_0x9559('0xe')]=function(){this[_0x9559('0xf')]=0x0;this[_0x9559('0x10')]=0x0;for(var _0x2e6dc7=0x0;_0x2e6dc7=0x0?this['available']:0x0;var _0x12bed5={'id':this['id'],'available':this[_0x9559('0x13')],'loggedIn':this[_0x9559('0xf')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x9559('0x14')]};var _0x397107=md5(JSON[_0x9559('0x15')](_0x12bed5));if(this[_0x9559('0x0')]!==_0x397107){this[_0x9559('0x0')]=_0x397107;io['to'](util['format'](_0x9559('0x16'),_0x12bed5[_0x9559('0x17')]))[_0x9559('0x18')](_0x9559('0x19'),_0x12bed5);}};module[_0x9559('0x1a')]=MailQueue; \ No newline at end of file +var _0xe2a5=['ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','prototype','updateRouting','map','_rr','updateRealtime','loggedIn','paused','length','online','available','mail:queue:%s','emit','mail_queue:save','lodash','md5','util'];(function(_0x327d92,_0x3d5a7b){var _0x27739b=function(_0x4634cb){while(--_0x4634cb){_0x327d92['push'](_0x327d92['shift']());}};_0x27739b(++_0x3d5a7b);}(_0xe2a5,0x131));var _0x5e2a=function(_0x3a22f2,_0x1489b3){_0x3a22f2=_0x3a22f2-0x0;var _0x3ad94b=_0xe2a5[_0x3a22f2];return _0x3ad94b;};'use strict';var _=require(_0x5e2a('0x0'));var md5=require(_0x5e2a('0x1'));var util=require(_0x5e2a('0x2'));var Redis=require(_0x5e2a('0x3'));var config=require('../../../config/environment');config[_0x5e2a('0x4')]=_[_0x5e2a('0x5')](config['redis'],{'host':_0x5e2a('0x6'),'port':0x18eb});var io=require(_0x5e2a('0x7'))(new Redis(config[_0x5e2a('0x4')]));function MailQueue(_0x3be35a){this['id']=_0x3be35a['id']||0x0;this[_0x5e2a('0x8')]=_0x3be35a['name']||'';this[_0x5e2a('0x9')]=_0x3be35a[_0x5e2a('0x9')]||0xa;this['strategy']=_0x3be35a[_0x5e2a('0xa')]||_0x5e2a('0xb');this['Agents']=_0x3be35a[_0x5e2a('0xc')];this[_0x5e2a('0xd')]={};this[_0x5e2a('0xe')]=0x0;this[_0x5e2a('0x1')]='';this['updateRouting']();this['updateRealtime']();}MailQueue[_0x5e2a('0xf')][_0x5e2a('0x10')]=function(){var _0x1db295=this['mapAgentsId']['_rr'];this[_0x5e2a('0xd')]=_[_0x5e2a('0x11')](this[_0x5e2a('0xc')],'id');this[_0x5e2a('0xd')][_0x5e2a('0x12')]=_0x1db295;};MailQueue[_0x5e2a('0xf')][_0x5e2a('0x13')]=function(){this[_0x5e2a('0x14')]=0x0;this[_0x5e2a('0x15')]=0x0;for(var _0x3f3f19=0x0;_0x3f3f19=0x0?this['available']:0x0;var _0x349ca6={'id':this['id'],'available':this[_0x5e2a('0x18')],'loggedIn':this[_0x5e2a('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x5e2a('0xe')]};var _0x61f0ad=md5(JSON['stringify'](_0x349ca6));if(this['md5']!==_0x61f0ad){this[_0x5e2a('0x1')]=_0x61f0ad;io['to'](util['format'](_0x5e2a('0x19'),_0x349ca6[_0x5e2a('0x8')]))[_0x5e2a('0x1a')](_0x5e2a('0x1b'),_0x349ca6);}};module['exports']=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index bfa109d..e73a15f 100644 --- a/server/services/routing/model/openchannelQueue.js +++ b/server/services/routing/model/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['strategy','Agents','mapAgentsId','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','paused','length','online','available','waiting','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xc4aa[_0x255d5b];return _0x3e141a;};'use strict';var _=require(_0xac4a('0x0'));var md5=require(_0xac4a('0x1'));var util=require(_0xac4a('0x2'));var Redis=require(_0xac4a('0x3'));var config=require(_0xac4a('0x4'));config[_0xac4a('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xac4a('0x6'))(new Redis(config[_0xac4a('0x5')]));function OpenchannelQueue(_0x730a38){this['id']=_0x730a38['id']||0x0;this[_0xac4a('0x7')]=_0x730a38[_0xac4a('0x7')]||'';this[_0xac4a('0x8')]=_0x730a38[_0xac4a('0x8')]||0xa;this[_0xac4a('0x9')]=_0x730a38['strategy']||'beepall';this[_0xac4a('0xa')]=_0x730a38[_0xac4a('0xa')];this[_0xac4a('0xb')]={};this['waiting']=0x0;this[_0xac4a('0x1')]='';this[_0xac4a('0xc')]();this[_0xac4a('0xd')]();}OpenchannelQueue['prototype'][_0xac4a('0xc')]=function(){var _0x488e3c=this[_0xac4a('0xb')]['_rr'];this[_0xac4a('0xb')]=_[_0xac4a('0xe')](this[_0xac4a('0xa')],'id');this['mapAgentsId'][_0xac4a('0xf')]=_0x488e3c;};OpenchannelQueue[_0xac4a('0x10')][_0xac4a('0xd')]=function(){this[_0xac4a('0x11')]=0x0;this[_0xac4a('0x12')]=0x0;for(var _0x3b71c0=0x0;_0x3b71c0=0x0?this[_0xac4a('0x15')]:0x0;var _0x44ec59={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xac4a('0x7')],'paused':this[_0xac4a('0x12')],'waiting':this[_0xac4a('0x16')]};var _0x4d837c=md5(JSON[_0xac4a('0x17')](_0x44ec59));if(this[_0xac4a('0x1')]!==_0x4d837c){this[_0xac4a('0x1')]=_0x4d837c;io['to'](util[_0xac4a('0x18')](_0xac4a('0x19'),_0x44ec59[_0xac4a('0x7')]))[_0xac4a('0x1a')](_0xac4a('0x1b'),_0x44ec59);}};module['exports']=OpenchannelQueue; \ No newline at end of file +var _0x2ef3=['stringify','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','timeout','strategy','beepall','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','paused','length','online','available','loggedIn','name'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0x2ef3,0xba));var _0x32ef=function(_0x22873b,_0x156af3){_0x22873b=_0x22873b-0x0;var _0x2fa2fb=_0x2ef3[_0x22873b];return _0x2fa2fb;};'use strict';var _=require(_0x32ef('0x0'));var md5=require(_0x32ef('0x1'));var util=require(_0x32ef('0x2'));var Redis=require(_0x32ef('0x3'));var config=require(_0x32ef('0x4'));config[_0x32ef('0x5')]=_['defaults'](config[_0x32ef('0x5')],{'host':_0x32ef('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x32ef('0x5')]));function OpenchannelQueue(_0x37dd1d){this['id']=_0x37dd1d['id']||0x0;this['name']=_0x37dd1d['name']||'';this[_0x32ef('0x7')]=_0x37dd1d[_0x32ef('0x7')]||0xa;this[_0x32ef('0x8')]=_0x37dd1d[_0x32ef('0x8')]||_0x32ef('0x9');this[_0x32ef('0xa')]=_0x37dd1d[_0x32ef('0xa')];this[_0x32ef('0xb')]={};this[_0x32ef('0xc')]=0x0;this[_0x32ef('0x1')]='';this['updateRouting']();this['updateRealtime']();}OpenchannelQueue[_0x32ef('0xd')][_0x32ef('0xe')]=function(){var _0x45bfd5=this[_0x32ef('0xb')]['_rr'];this[_0x32ef('0xb')]=_['map'](this[_0x32ef('0xa')],'id');this['mapAgentsId'][_0x32ef('0xf')]=_0x45bfd5;};OpenchannelQueue[_0x32ef('0xd')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x32ef('0x10')]=0x0;for(var _0x4d8009=0x0;_0x4d8009=0x0?this[_0x32ef('0x13')]:0x0;var _0x286bfb={'id':this['id'],'available':this['available'],'loggedIn':this[_0x32ef('0x14')],'name':this[_0x32ef('0x15')],'paused':this['paused'],'waiting':this[_0x32ef('0xc')]};var _0x314ef1=md5(JSON[_0x32ef('0x16')](_0x286bfb));if(this[_0x32ef('0x1')]!==_0x314ef1){this[_0x32ef('0x1')]=_0x314ef1;io['to'](util[_0x32ef('0x17')]('openchannel:queue:%s',_0x286bfb[_0x32ef('0x15')]))['emit'](_0x32ef('0x18'),_0x286bfb);}};module[_0x32ef('0x19')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index f45d4c1..690432a 100644 --- a/server/services/routing/model/smsQueue.js +++ b/server/services/routing/model/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb38e=['smsPause','available','stringify','format','sms:queue:%s','sms_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','paused','length','online'];(function(_0x336c75,_0x234d58){var _0x5e37fd=function(_0x26480e){while(--_0x26480e){_0x336c75['push'](_0x336c75['shift']());}};_0x5e37fd(++_0x234d58);}(_0xb38e,0xa7));var _0xeb38=function(_0x51f3ff,_0x134155){_0x51f3ff=_0x51f3ff-0x0;var _0x4db8e3=_0xb38e[_0x51f3ff];return _0x4db8e3;};'use strict';var _=require(_0xeb38('0x0'));var md5=require(_0xeb38('0x1'));var util=require(_0xeb38('0x2'));var Redis=require(_0xeb38('0x3'));var config=require(_0xeb38('0x4'));config[_0xeb38('0x5')]=_[_0xeb38('0x6')](config['redis'],{'host':_0xeb38('0x7'),'port':0x18eb});var io=require(_0xeb38('0x8'))(new Redis(config['redis']));function SmsQueue(_0x113205){this['id']=_0x113205['id']||0x0;this[_0xeb38('0x9')]=_0x113205[_0xeb38('0x9')]||'';this[_0xeb38('0xa')]=_0x113205['timeout']||0xa;this[_0xeb38('0xb')]=_0x113205[_0xeb38('0xb')]||_0xeb38('0xc');this[_0xeb38('0xd')]=_0x113205['Agents'];this[_0xeb38('0xe')]={};this[_0xeb38('0xf')]=0x0;this[_0xeb38('0x1')]='';this[_0xeb38('0x10')]();this[_0xeb38('0x11')]();}SmsQueue[_0xeb38('0x12')][_0xeb38('0x10')]=function(){var _0x5838cd=this[_0xeb38('0xe')]['_rr'];this[_0xeb38('0xe')]=_[_0xeb38('0x13')](this['Agents'],'id');this[_0xeb38('0xe')][_0xeb38('0x14')]=_0x5838cd;};SmsQueue[_0xeb38('0x12')][_0xeb38('0x11')]=function(){this[_0xeb38('0x15')]=0x0;this[_0xeb38('0x16')]=0x0;for(var _0x4d765f=0x0;_0x4d765f=0x0?this['available']:0x0;var _0x521ef1={'id':this['id'],'available':this[_0xeb38('0x1a')],'loggedIn':this[_0xeb38('0x15')],'name':this[_0xeb38('0x9')],'paused':this['paused'],'waiting':this['waiting']};var _0x3f8ed1=md5(JSON[_0xeb38('0x1b')](_0x521ef1));if(this[_0xeb38('0x1')]!==_0x3f8ed1){this[_0xeb38('0x1')]=_0x3f8ed1;io['to'](util[_0xeb38('0x1c')](_0xeb38('0x1d'),_0x521ef1['name']))['emit'](_0xeb38('0x1e'),_0x521ef1);}};module[_0xeb38('0x1f')]=SmsQueue; \ No newline at end of file +var _0xb49a=['loggedIn','paused','online','smsPause','available','sms:queue:%s','emit','sms_queue:save','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','map','_rr'];(function(_0x4e6fbc,_0x5c95ec){var _0xd44dc1=function(_0x4aa3f5){while(--_0x4aa3f5){_0x4e6fbc['push'](_0x4e6fbc['shift']());}};_0xd44dc1(++_0x5c95ec);}(_0xb49a,0xfb));var _0xab49=function(_0x4cc280,_0x3b77f3){_0x4cc280=_0x4cc280-0x0;var _0x16ed24=_0xb49a[_0x4cc280];return _0x16ed24;};'use strict';var _=require(_0xab49('0x0'));var md5=require(_0xab49('0x1'));var util=require(_0xab49('0x2'));var Redis=require(_0xab49('0x3'));var config=require(_0xab49('0x4'));config['redis']=_[_0xab49('0x5')](config[_0xab49('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xab49('0x6')]));function SmsQueue(_0x287cd5){this['id']=_0x287cd5['id']||0x0;this[_0xab49('0x7')]=_0x287cd5[_0xab49('0x7')]||'';this[_0xab49('0x8')]=_0x287cd5[_0xab49('0x8')]||0xa;this[_0xab49('0x9')]=_0x287cd5['strategy']||_0xab49('0xa');this[_0xab49('0xb')]=_0x287cd5[_0xab49('0xb')];this[_0xab49('0xc')]={};this[_0xab49('0xd')]=0x0;this['md5']='';this['updateRouting']();this[_0xab49('0xe')]();}SmsQueue[_0xab49('0xf')][_0xab49('0x10')]=function(){var _0x126f00=this[_0xab49('0xc')]['_rr'];this[_0xab49('0xc')]=_[_0xab49('0x11')](this[_0xab49('0xb')],'id');this[_0xab49('0xc')][_0xab49('0x12')]=_0x126f00;};SmsQueue[_0xab49('0xf')][_0xab49('0xe')]=function(){this[_0xab49('0x13')]=0x0;this[_0xab49('0x14')]=0x0;for(var _0x389ebb=0x0;_0x389ebb=0x0?this['available']:0x0;var _0x167a2a={'id':this['id'],'available':this[_0xab49('0x17')],'loggedIn':this[_0xab49('0x13')],'name':this['name'],'paused':this['paused'],'waiting':this[_0xab49('0xd')]};var _0xa039ed=md5(JSON['stringify'](_0x167a2a));if(this[_0xab49('0x1')]!==_0xa039ed){this[_0xab49('0x1')]=_0xa039ed;io['to'](util['format'](_0xab49('0x18'),_0x167a2a['name']))[_0xab49('0x19')](_0xab49('0x1a'),_0x167a2a);}};module['exports']=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 079e4be..35dbe1f 100644 --- a/server/services/routing/model/whatsappQueue.js +++ b/server/services/routing/model/whatsappQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x68d6=['redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','paused','length','online','loggedIn','whatsappPause','available','format','whatsapp:queue:%s','emit','exports','lodash','md5','util','ioredis','../../../config/environment'];(function(_0x555512,_0x243de7){var _0x268e3b=function(_0x535abf){while(--_0x535abf){_0x555512['push'](_0x555512['shift']());}};_0x268e3b(++_0x243de7);}(_0x68d6,0x1ae));var _0x668d=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x68d6[_0x25e7cb];return _0x375d92;};'use strict';var _=require(_0x668d('0x0'));var md5=require(_0x668d('0x1'));var util=require(_0x668d('0x2'));var Redis=require(_0x668d('0x3'));var config=require(_0x668d('0x4'));config[_0x668d('0x5')]=_[_0x668d('0x6')](config[_0x668d('0x5')],{'host':_0x668d('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x668d('0x5')]));function WhatsappQueue(_0x1b7f96){this['id']=_0x1b7f96['id']||0x0;this[_0x668d('0x8')]=_0x1b7f96[_0x668d('0x8')]||'';this[_0x668d('0x9')]=_0x1b7f96[_0x668d('0x9')]||0xa;this[_0x668d('0xa')]=_0x1b7f96['strategy']||_0x668d('0xb');this[_0x668d('0xc')]=_0x1b7f96[_0x668d('0xc')];this[_0x668d('0xd')]={};this[_0x668d('0xe')]=0x0;this[_0x668d('0x1')]='';this['updateRouting']();this[_0x668d('0xf')]();}WhatsappQueue[_0x668d('0x10')][_0x668d('0x11')]=function(){var _0x6fbe01=this[_0x668d('0xd')]['_rr'];this[_0x668d('0xd')]=_['map'](this[_0x668d('0xc')],'id');this[_0x668d('0xd')][_0x668d('0x12')]=_0x6fbe01;};WhatsappQueue[_0x668d('0x10')][_0x668d('0xf')]=function(){this['loggedIn']=0x0;this[_0x668d('0x13')]=0x0;for(var _0x22ed9b=0x0;_0x22ed9b=0x0?this[_0x668d('0x18')]:0x0;var _0x1c53a1={'id':this['id'],'available':this[_0x668d('0x18')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x668d('0x13')],'waiting':this['waiting']};var _0x3458d5=md5(JSON['stringify'](_0x1c53a1));if(this[_0x668d('0x1')]!==_0x3458d5){this[_0x668d('0x1')]=_0x3458d5;io['to'](util[_0x668d('0x19')](_0x668d('0x1a'),_0x1c53a1[_0x668d('0x8')]))[_0x668d('0x1b')]('whatsapp_queue:save',_0x1c53a1);}};module[_0x668d('0x1c')]=WhatsappQueue; \ No newline at end of file +var _0xa9b0=['online','paused','loggedIn','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','ioredis','redis','defaults','socket.io-emitter','name','strategy','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','length'];(function(_0x1f96d7,_0x20d141){var _0x728705=function(_0x55e0fd){while(--_0x55e0fd){_0x1f96d7['push'](_0x1f96d7['shift']());}};_0x728705(++_0x20d141);}(_0xa9b0,0x72));var _0x0a9b=function(_0x24875d,_0x4fb24d){_0x24875d=_0x24875d-0x0;var _0x181471=_0xa9b0[_0x24875d];return _0x181471;};'use strict';var _=require(_0x0a9b('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9b('0x1'));var config=require('../../../config/environment');config[_0x0a9b('0x2')]=_[_0x0a9b('0x3')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x0a9b('0x4'))(new Redis(config['redis']));function WhatsappQueue(_0x452361){this['id']=_0x452361['id']||0x0;this[_0x0a9b('0x5')]=_0x452361[_0x0a9b('0x5')]||'';this['timeout']=_0x452361['timeout']||0xa;this[_0x0a9b('0x6')]=_0x452361[_0x0a9b('0x6')]||'beepall';this['Agents']=_0x452361[_0x0a9b('0x7')];this[_0x0a9b('0x8')]={};this[_0x0a9b('0x9')]=0x0;this[_0x0a9b('0xa')]='';this[_0x0a9b('0xb')]();this[_0x0a9b('0xc')]();}WhatsappQueue[_0x0a9b('0xd')][_0x0a9b('0xb')]=function(){var _0x4d6f63=this[_0x0a9b('0x8')][_0x0a9b('0xe')];this[_0x0a9b('0x8')]=_['map'](this[_0x0a9b('0x7')],'id');this[_0x0a9b('0x8')][_0x0a9b('0xe')]=_0x4d6f63;};WhatsappQueue[_0x0a9b('0xd')][_0x0a9b('0xc')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x3502d1=0x0;_0x3502d1=0x0?this[_0x0a9b('0x13')]:0x0;var _0x2ebed2={'id':this['id'],'available':this[_0x0a9b('0x13')],'loggedIn':this[_0x0a9b('0x12')],'name':this[_0x0a9b('0x5')],'paused':this[_0x0a9b('0x11')],'waiting':this[_0x0a9b('0x9')]};var _0x318a5d=md5(JSON[_0x0a9b('0x14')](_0x2ebed2));if(this[_0x0a9b('0xa')]!==_0x318a5d){this['md5']=_0x318a5d;io['to'](util[_0x0a9b('0x15')](_0x0a9b('0x16'),_0x2ebed2[_0x0a9b('0x5')]))[_0x0a9b('0x17')](_0x0a9b('0x18'),_0x2ebed2);}};module[_0x0a9b('0x19')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 03c5c5d..d65743a 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x843849,_0x22fbec){var _0xf6f4d3=function(_0x37596b){while(--_0x37596b){_0x843849['push'](_0x843849['shift']());}};_0xf6f4d3(++_0x22fbec);}(_0xb10b,0x12a));var _0xbb10=function(_0x3ccbc7,_0x3093c8){_0x3ccbc7=_0x3ccbc7-0x0;var _0x50c97a=_0xb10b[_0x3ccbc7];return _0x50c97a;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 0225652..7e53c00 100644 --- a/server/services/routing/rpc/chatInteraction.js +++ b/server/services/routing/rpc/chatInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x19f4=['update','Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','../client'];(function(_0x52e333,_0x4fc3a5){var _0x5e6562=function(_0x3cdfd8){while(--_0x3cdfd8){_0x52e333['push'](_0x52e333['shift']());}};_0x5e6562(++_0x4fc3a5);}(_0x19f4,0x6f));var _0x419f=function(_0x2dfd4b,_0x4e2999){_0x2dfd4b=_0x2dfd4b-0x0;var _0x1a6200=_0x19f4[_0x2dfd4b];return _0x1a6200;};'use strict';var client=require(_0x419f('0x0'));exports[_0x419f('0x1')]=function(_0xfcf6de,_0x4e4f9a){return client[_0x419f('0x2')](_0x419f('0x3'),{'body':_0x4e4f9a,'options':{'where':{'id':_0xfcf6de}},'log':_0x419f('0x4')});};exports[_0x419f('0x5')]=function(_0x1d10a4,_0x1a742f){return client[_0x419f('0x2')](_0x419f('0x6'),{'body':_0x1a742f,'options':{'where':{'id':_0x1d10a4}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x0972=['Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','update'];(function(_0x326fa7,_0x450551){var _0x3848ed=function(_0x637f26){while(--_0x637f26){_0x326fa7['push'](_0x326fa7['shift']());}};_0x3848ed(++_0x450551);}(_0x0972,0xd8));var _0x2097=function(_0x4694f0,_0x5c3dae){_0x4694f0=_0x4694f0-0x0;var _0x2aa0aa=_0x0972[_0x4694f0];return _0x2aa0aa;};'use strict';var client=require('../client');exports[_0x2097('0x0')]=function(_0x5908b2,_0x2f3866){return client[_0x2097('0x1')](_0x2097('0x2'),{'body':_0x2f3866,'options':{'where':{'id':_0x5908b2}},'log':_0x2097('0x3')});};exports[_0x2097('0x4')]=function(_0x572b1c,_0x274c07){return client[_0x2097('0x1')](_0x2097('0x5'),{'body':_0x274c07,'options':{'where':{'id':_0x572b1c}},'log':_0x2097('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index cc6f194..c858e3d 100644 --- a/server/services/routing/rpc/chatMessage.js +++ b/server/services/routing/rpc/chatMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8c4f=['../client','createChatMessage'];(function(_0x1551bc,_0x334b59){var _0x228deb=function(_0x15551d){while(--_0x15551d){_0x1551bc['push'](_0x1551bc['shift']());}};_0x228deb(++_0x334b59);}(_0x8c4f,0x138));var _0xf8c4=function(_0x5668aa,_0x1cd4cd){_0x5668aa=_0x5668aa-0x0;var _0x455a3d=_0x8c4f[_0x5668aa];return _0x455a3d;};'use strict';var client=require(_0xf8c4('0x0'));exports['create']=function(_0x3df2cc){return client['Request']('CreateChatMessage',{'body':_0x3df2cc,'log':_0xf8c4('0x1')});}; \ No newline at end of file +var _0xc760=['CreateChatMessage','createChatMessage','../client'];(function(_0x264b1e,_0x1b5530){var _0x14aa66=function(_0x5d4d8b){while(--_0x5d4d8b){_0x264b1e['push'](_0x264b1e['shift']());}};_0x14aa66(++_0x1b5530);}(_0xc760,0x10a));var _0x0c76=function(_0x4a4b51,_0x209811){_0x4a4b51=_0x4a4b51-0x0;var _0x3199d4=_0xc760[_0x4a4b51];return _0x3199d4;};'use strict';var client=require(_0x0c76('0x0'));exports['create']=function(_0x1682d7){return client['Request'](_0x0c76('0x1'),{'body':_0x1682d7,'log':_0x0c76('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 3275d6f..c625225 100644 --- a/server/services/routing/rpc/chatQueue.js +++ b/server/services/routing/rpc/chatQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf776=['getChatQueues','../client','Request','GetChatQueue','timeout','strategy','User','Agents','online'];(function(_0x32c20f,_0x814731){var _0x54cec0=function(_0x3b9cd7){while(--_0x3b9cd7){_0x32c20f['push'](_0x32c20f['shift']());}};_0x54cec0(++_0x814731);}(_0xf776,0x169));var _0x6f77=function(_0x3f91a7,_0x5b570d){_0x3f91a7=_0x3f91a7-0x0;var _0x53fa1c=_0xf776[_0x3f91a7];return _0x53fa1c;};'use strict';var client=require(_0x6f77('0x0'));exports['getChatQueues']=function(){return function(){return client[_0x6f77('0x1')](_0x6f77('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x6f77('0x3'),_0x6f77('0x4')],'include':[{'model':_0x6f77('0x5'),'as':_0x6f77('0x6'),'attributes':['id','name',_0x6f77('0x7'),'chatPause']}]},'log':_0x6f77('0x8')});};}; \ No newline at end of file +var _0x5b7f=['GetChatQueue','name','timeout','strategy','User','Agents','online','chatPause','../client','getChatQueues','Request'];(function(_0x1eb82d,_0x1e23cb){var _0x2c9502=function(_0x4a3500){while(--_0x4a3500){_0x1eb82d['push'](_0x1eb82d['shift']());}};_0x2c9502(++_0x1e23cb);}(_0x5b7f,0x8c));var _0xf5b7=function(_0x1913be,_0x54e4ae){_0x1913be=_0x1913be-0x0;var _0x57fd14=_0x5b7f[_0x1913be];return _0x57fd14;};'use strict';var client=require(_0xf5b7('0x0'));exports[_0xf5b7('0x1')]=function(){return function(){return client[_0xf5b7('0x2')](_0xf5b7('0x3'),{'options':{'raw':![],'attributes':['id',_0xf5b7('0x4'),_0xf5b7('0x5'),_0xf5b7('0x6')],'include':[{'model':_0xf5b7('0x7'),'as':_0xf5b7('0x8'),'attributes':['id',_0xf5b7('0x4'),_0xf5b7('0x9'),_0xf5b7('0xa')]}]},'log':_0xf5b7('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 25cd029..ed6f43a 100644 --- a/server/services/routing/rpc/chatQueueReport.js +++ b/server/services/routing/rpc/chatQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc1c4=['../client','create','Request','CreateChatQueueReport','update','UpdateChatQueueReport','DESC'];(function(_0x5bddde,_0x384afd){var _0x4d19c6=function(_0x2323c9){while(--_0x2323c9){_0x5bddde['push'](_0x5bddde['shift']());}};_0x4d19c6(++_0x384afd);}(_0xc1c4,0x1c7));var _0x4c1c=function(_0x4f45ec,_0x270691){_0x4f45ec=_0x4f45ec-0x0;var _0x3640d8=_0xc1c4[_0x4f45ec];return _0x3640d8;};'use strict';var client=require(_0x4c1c('0x0'));exports[_0x4c1c('0x1')]=function(_0x2fb284){return client[_0x4c1c('0x2')](_0x4c1c('0x3'),{'body':_0x2fb284,'log':_0x4c1c('0x3')});};exports[_0x4c1c('0x4')]=function(_0x5b8a39,_0x5c1e2c){return client[_0x4c1c('0x2')](_0x4c1c('0x5'),{'body':_0x5c1e2c,'options':{'where':{'uniqueid':_0x5b8a39},'order':[['id',_0x4c1c('0x6')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0xfe60=['Request','CreateChatQueueReport','UpdateChatQueueReport','DESC','create'];(function(_0x11e746,_0x4a4260){var _0x43686f=function(_0xf3be83){while(--_0xf3be83){_0x11e746['push'](_0x11e746['shift']());}};_0x43686f(++_0x4a4260);}(_0xfe60,0x1cb));var _0x0fe6=function(_0xccc3d5,_0x4d170a){_0xccc3d5=_0xccc3d5-0x0;var _0x1185ae=_0xfe60[_0xccc3d5];return _0x1185ae;};'use strict';var client=require('../client');exports[_0x0fe6('0x0')]=function(_0x55f382){return client[_0x0fe6('0x1')](_0x0fe6('0x2'),{'body':_0x55f382,'log':_0x0fe6('0x2')});};exports['update']=function(_0x40740,_0x244c56){return client[_0x0fe6('0x1')](_0x0fe6('0x3'),{'body':_0x244c56,'options':{'where':{'uniqueid':_0x40740},'order':[['id',_0x0fe6('0x4')]],'limit':0x1},'log':_0x0fe6('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 09f590d..06170e9 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x483ab9,_0x419148){var _0x35043b=function(_0x3453a3){while(--_0x3453a3){_0x483ab9['push'](_0x483ab9['shift']());}};_0x35043b(++_0x419148);}(_0x7a54,0x106));var _0x47a5=function(_0x3ead0e,_0x35469f){_0x3ead0e=_0x3ead0e-0x0;var _0x531373=_0x7a54[_0x3ead0e];return _0x531373;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x1bbc08,_0x444008){var _0x5d825b=function(_0x522920){while(--_0x522920){_0x1bbc08['push'](_0x1bbc08['shift']());}};_0x5d825b(++_0x444008);}(_0x7a54,0x106));var _0x47a5=function(_0x474c6c,_0x51b196){_0x474c6c=_0x474c6c-0x0;var _0x4d49e2=_0x7a54[_0x474c6c];return _0x4d49e2;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 4e1c3fd..521511e 100644 --- a/server/services/routing/rpc/faxMessage.js +++ b/server/services/routing/rpc/faxMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa5b9=['../client','CreateFaxMessage'];(function(_0x595dac,_0x4563cc){var _0x1c4062=function(_0x53a491){while(--_0x53a491){_0x595dac['push'](_0x595dac['shift']());}};_0x1c4062(++_0x4563cc);}(_0xa5b9,0xe6));var _0x9a5b=function(_0x5d85a9,_0x36d5e2){_0x5d85a9=_0x5d85a9-0x0;var _0x52ecd3=_0xa5b9[_0x5d85a9];return _0x52ecd3;};'use strict';var client=require(_0x9a5b('0x0'));exports['create']=function(_0x3f340b){return client['Request'](_0x9a5b('0x1'),{'body':_0x3f340b,'log':'createFaxMessage'});}; \ No newline at end of file +var _0x56ef=['CreateFaxMessage','createFaxMessage','Request'];(function(_0x5b3d37,_0x1d7e56){var _0x5e6bed=function(_0x24408c){while(--_0x24408c){_0x5b3d37['push'](_0x5b3d37['shift']());}};_0x5e6bed(++_0x1d7e56);}(_0x56ef,0xd7));var _0xf56e=function(_0x37756b,_0x24db76){_0x37756b=_0x37756b-0x0;var _0x46efec=_0x56ef[_0x37756b];return _0x46efec;};'use strict';var client=require('../client');exports['create']=function(_0x4d12da){return client[_0xf56e('0x0')](_0xf56e('0x1'),{'body':_0x4d12da,'log':_0xf56e('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 9a8d971..f85981b 100644 --- a/server/services/routing/rpc/faxQueue.js +++ b/server/services/routing/rpc/faxQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7bef=['getFaxQueues','Request','name','strategy','Agents','faxPause','../client'];(function(_0x129479,_0x256c7e){var _0x3fa0ce=function(_0x35401f){while(--_0x35401f){_0x129479['push'](_0x129479['shift']());}};_0x3fa0ce(++_0x256c7e);}(_0x7bef,0x102));var _0xf7be=function(_0x1b9a9f,_0x482c35){_0x1b9a9f=_0x1b9a9f-0x0;var _0x2552fd=_0x7bef[_0x1b9a9f];return _0x2552fd;};'use strict';var client=require(_0xf7be('0x0'));exports[_0xf7be('0x1')]=function(){return function(){return client[_0xf7be('0x2')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0xf7be('0x3'),'timeout',_0xf7be('0x4')],'include':[{'model':'User','as':_0xf7be('0x5'),'attributes':['id',_0xf7be('0x3'),'online',_0xf7be('0x6')]}]},'log':_0xf7be('0x1')});};}; \ No newline at end of file +var _0x1a98=['name','timeout','User','Agents','faxPause','../client','getFaxQueues'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x1a98,0x67));var _0x81a9=function(_0x2291cb,_0x3d2b79){_0x2291cb=_0x2291cb-0x0;var _0x53b5d2=_0x1a98[_0x2291cb];return _0x53b5d2;};'use strict';var client=require(_0x81a9('0x0'));exports[_0x81a9('0x1')]=function(){return function(){return client['Request']('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x81a9('0x2'),_0x81a9('0x3'),'strategy'],'include':[{'model':_0x81a9('0x4'),'as':_0x81a9('0x5'),'attributes':['id','name','online',_0x81a9('0x6')]}]},'log':_0x81a9('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index c6a5422..0216577 100644 --- a/server/services/routing/rpc/faxQueueReport.js +++ b/server/services/routing/rpc/faxQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9089=['UpdateFaxQueueReport','DESC','../client','create','CreateFaxQueueReport','update','Request'];(function(_0x2886b5,_0x16820b){var _0x44ae6e=function(_0x38e044){while(--_0x38e044){_0x2886b5['push'](_0x2886b5['shift']());}};_0x44ae6e(++_0x16820b);}(_0x9089,0x136));var _0x9908=function(_0x36d203,_0x3653f3){_0x36d203=_0x36d203-0x0;var _0x2f9e62=_0x9089[_0x36d203];return _0x2f9e62;};'use strict';var client=require(_0x9908('0x0'));exports[_0x9908('0x1')]=function(_0x1b504a){return client['Request'](_0x9908('0x2'),{'body':_0x1b504a,'log':_0x9908('0x2')});};exports[_0x9908('0x3')]=function(_0xdcf13f,_0x5e71ee){return client[_0x9908('0x4')](_0x9908('0x5'),{'body':_0x5e71ee,'options':{'where':{'uniqueid':_0xdcf13f},'order':[['id',_0x9908('0x6')]],'limit':0x1},'log':_0x9908('0x5')});}; \ No newline at end of file +var _0x3f29=['UpdateFaxQueueReport','../client','Request','CreateFaxQueueReport','update'];(function(_0xf4d42,_0x18a851){var _0x26fc69=function(_0x89a5df){while(--_0x89a5df){_0xf4d42['push'](_0xf4d42['shift']());}};_0x26fc69(++_0x18a851);}(_0x3f29,0x7e));var _0x93f2=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x3f29[_0x40ac5e];return _0x2839d6;};'use strict';var client=require(_0x93f2('0x0'));exports['create']=function(_0x34ef0d){return client[_0x93f2('0x1')](_0x93f2('0x2'),{'body':_0x34ef0d,'log':_0x93f2('0x2')});};exports[_0x93f2('0x3')]=function(_0x105089,_0x390d97){return client['Request'](_0x93f2('0x4'),{'body':_0x390d97,'options':{'where':{'uniqueid':_0x105089},'order':[['id','DESC']],'limit':0x1},'log':_0x93f2('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 1fe3101..4830984 100644 --- a/server/services/routing/rpc/interval.js +++ b/server/services/routing/rpc/interval.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x51af=['Request','name','Interval','Intervals','interval','../client','getIntervals'];(function(_0xf02eaf,_0x3b3e68){var _0xde78a5=function(_0x310dc0){while(--_0x310dc0){_0xf02eaf['push'](_0xf02eaf['shift']());}};_0xde78a5(++_0x3b3e68);}(_0x51af,0x7c));var _0xf51a=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x51af[_0x1e4360];return _0x31e6b4;};'use strict';var client=require(_0xf51a('0x0'));exports[_0xf51a('0x1')]=function(){return function(){return client[_0xf51a('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xf51a('0x3')],'include':[{'model':_0xf51a('0x4'),'as':_0xf51a('0x5'),'attributes':['id',_0xf51a('0x3'),_0xf51a('0x6')]}]},'log':_0xf51a('0x1')});};}; \ No newline at end of file +var _0x5e67=['Interval','Intervals','interval','../client','getIntervals','Request','GetInterval','name'];(function(_0x2405bc,_0x2f28a1){var _0x5272d4=function(_0x225294){while(--_0x225294){_0x2405bc['push'](_0x2405bc['shift']());}};_0x5272d4(++_0x2f28a1);}(_0x5e67,0x14b));var _0x75e6=function(_0x4c86d6,_0x3864b0){_0x4c86d6=_0x4c86d6-0x0;var _0x1e0216=_0x5e67[_0x4c86d6];return _0x1e0216;};'use strict';var client=require(_0x75e6('0x0'));exports[_0x75e6('0x1')]=function(){return function(){return client[_0x75e6('0x2')](_0x75e6('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x75e6('0x4')],'include':[{'model':_0x75e6('0x5'),'as':_0x75e6('0x6'),'attributes':['id',_0x75e6('0x4'),_0x75e6('0x7')]}]},'log':'getIntervals'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index ddd70ae..d09e475 100644 --- a/server/services/routing/rpc/mailInteraction.js +++ b/server/services/routing/rpc/mailInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4325=['update','Request','UpdateMailInteraction','addTagsToChatInteraction','../client'];(function(_0x2e5e73,_0x30d4d9){var _0x4cf641=function(_0x26b1b6){while(--_0x26b1b6){_0x2e5e73['push'](_0x2e5e73['shift']());}};_0x4cf641(++_0x30d4d9);}(_0x4325,0x1da));var _0x5432=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x4325[_0x4b369d];return _0x571a98;};'use strict';var client=require(_0x5432('0x0'));exports[_0x5432('0x1')]=function(_0x5aa4b8,_0x3f491f){return client[_0x5432('0x2')](_0x5432('0x3'),{'body':_0x3f491f,'options':{'where':{'id':_0x5aa4b8}},'log':'updateMailInteraction'});};exports['addTags']=function(_0x20f704,_0x36ce53){return client[_0x5432('0x2')]('AddTagsToMailInteraction',{'body':_0x36ce53,'options':{'where':{'id':_0x20f704}},'log':_0x5432('0x4')});}; \ No newline at end of file +var _0x4888=['AddTagsToMailInteraction','addTagsToChatInteraction','update','Request','UpdateMailInteraction','updateMailInteraction','addTags'];(function(_0x4d9409,_0x383e81){var _0x153efe=function(_0x10a6d9){while(--_0x10a6d9){_0x4d9409['push'](_0x4d9409['shift']());}};_0x153efe(++_0x383e81);}(_0x4888,0x198));var _0x8488=function(_0x13e758,_0x317d23){_0x13e758=_0x13e758-0x0;var _0x5b53c3=_0x4888[_0x13e758];return _0x5b53c3;};'use strict';var client=require('../client');exports[_0x8488('0x0')]=function(_0x1f0e53,_0x2af900){return client[_0x8488('0x1')](_0x8488('0x2'),{'body':_0x2af900,'options':{'where':{'id':_0x1f0e53}},'log':_0x8488('0x3')});};exports[_0x8488('0x4')]=function(_0x571e4b,_0x267093){return client[_0x8488('0x1')](_0x8488('0x5'),{'body':_0x267093,'options':{'where':{'id':_0x571e4b}},'log':_0x8488('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 2a092d6..f672c10 100644 --- a/server/services/routing/rpc/mailMessage.js +++ b/server/services/routing/rpc/mailMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4670=['create','CreateMailMessage','createMailMessage','../client'];(function(_0x33c1b1,_0x2355fb){var _0x2c2037=function(_0x1200fd){while(--_0x1200fd){_0x33c1b1['push'](_0x33c1b1['shift']());}};_0x2c2037(++_0x2355fb);}(_0x4670,0xc3));var _0x0467=function(_0x4f082b,_0x39268d){_0x4f082b=_0x4f082b-0x0;var _0x18aa26=_0x4670[_0x4f082b];return _0x18aa26;};'use strict';var client=require(_0x0467('0x0'));exports[_0x0467('0x1')]=function(_0x5583f8){return client['Request'](_0x0467('0x2'),{'body':_0x5583f8,'log':_0x0467('0x3')});}; \ No newline at end of file +var _0xb5a2=['create','Request','../client'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0xb5a2,0x104));var _0x2b5a=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xb5a2[_0x2c91e9];return _0x13f0ff;};'use strict';var client=require(_0x2b5a('0x0'));exports[_0x2b5a('0x1')]=function(_0x20ee3b){return client[_0x2b5a('0x2')]('CreateMailMessage',{'body':_0x20ee3b,'log':'createMailMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 71f761c..a9e6fb9 100644 --- a/server/services/routing/rpc/mailQueue.js +++ b/server/services/routing/rpc/mailQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2fa9=['name','timeout','strategy','User','getMailQueues','Request','GetMailQueue'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x2fa9,0x1ee));var _0x92fa=function(_0x3201cd,_0x384776){_0x3201cd=_0x3201cd-0x0;var _0x317977=_0x2fa9[_0x3201cd];return _0x317977;};'use strict';var client=require('../client');exports[_0x92fa('0x0')]=function(){return function(){return client[_0x92fa('0x1')](_0x92fa('0x2'),{'options':{'raw':![],'attributes':['id',_0x92fa('0x3'),_0x92fa('0x4'),_0x92fa('0x5')],'include':[{'model':_0x92fa('0x6'),'as':'Agents','attributes':['id',_0x92fa('0x3'),'online','mailPause']}]},'log':_0x92fa('0x0')});};}; \ No newline at end of file +var _0xdf97=['GetMailQueue','name','timeout','User','online','getMailQueues','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdf97,0x11d));var _0x7df9=function(_0x4f0ba1,_0x73d00f){_0x4f0ba1=_0x4f0ba1-0x0;var _0x34c92e=_0xdf97[_0x4f0ba1];return _0x34c92e;};'use strict';var client=require('../client');exports[_0x7df9('0x0')]=function(){return function(){return client[_0x7df9('0x1')](_0x7df9('0x2'),{'options':{'raw':![],'attributes':['id',_0x7df9('0x3'),_0x7df9('0x4'),'strategy'],'include':[{'model':_0x7df9('0x5'),'as':'Agents','attributes':['id','name',_0x7df9('0x6'),'mailPause']}]},'log':_0x7df9('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index bd424be..a603983 100644 --- a/server/services/routing/rpc/mailQueueReport.js +++ b/server/services/routing/rpc/mailQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfef6=['create','Request','CreateMailQueueReport','UpdateMailQueueReport','DESC','../client'];(function(_0x1062e1,_0x1be769){var _0x26c085=function(_0x5bcd11){while(--_0x5bcd11){_0x1062e1['push'](_0x1062e1['shift']());}};_0x26c085(++_0x1be769);}(_0xfef6,0x95));var _0x6fef=function(_0x203ef7,_0x22e5ca){_0x203ef7=_0x203ef7-0x0;var _0x2ae754=_0xfef6[_0x203ef7];return _0x2ae754;};'use strict';var client=require(_0x6fef('0x0'));exports[_0x6fef('0x1')]=function(_0x236457){return client[_0x6fef('0x2')]('CreateMailQueueReport',{'body':_0x236457,'log':_0x6fef('0x3')});};exports['update']=function(_0x2f8c51,_0x238c41){return client[_0x6fef('0x2')](_0x6fef('0x4'),{'body':_0x238c41,'options':{'where':{'uniqueid':_0x2f8c51},'order':[['id',_0x6fef('0x5')]],'limit':0x1},'log':_0x6fef('0x4')});}; \ No newline at end of file +var _0x8302=['Request','CreateMailQueueReport','UpdateMailQueueReport','create'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x8302,0x6f));var _0x2830=function(_0x5ec61d,_0x36c73c){_0x5ec61d=_0x5ec61d-0x0;var _0x2e0e5c=_0x8302[_0x5ec61d];return _0x2e0e5c;};'use strict';var client=require('../client');exports[_0x2830('0x0')]=function(_0x209ef8){return client[_0x2830('0x1')](_0x2830('0x2'),{'body':_0x209ef8,'log':'CreateMailQueueReport'});};exports['update']=function(_0x200086,_0x3b9aff){return client[_0x2830('0x1')](_0x2830('0x3'),{'body':_0x3b9aff,'options':{'where':{'uniqueid':_0x200086},'order':[['id','DESC']],'limit':0x1},'log':_0x2830('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 3f3f2f0..a12d368 100644 --- a/server/services/routing/rpc/openchannelInteraction.js +++ b/server/services/routing/rpc/openchannelInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0eea=['Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update'];(function(_0x237546,_0xa81b26){var _0x233e29=function(_0x728aa4){while(--_0x728aa4){_0x237546['push'](_0x237546['shift']());}};_0x233e29(++_0xa81b26);}(_0x0eea,0x1ae));var _0xa0ee=function(_0x580103,_0x438384){_0x580103=_0x580103-0x0;var _0x5d1096=_0x0eea[_0x580103];return _0x5d1096;};'use strict';var client=require(_0xa0ee('0x0'));exports[_0xa0ee('0x1')]=function(_0x5c3ce1,_0x4fe1da){return client[_0xa0ee('0x2')](_0xa0ee('0x3'),{'body':_0x4fe1da,'options':{'where':{'id':_0x5c3ce1}},'log':_0xa0ee('0x4')});};exports[_0xa0ee('0x5')]=function(_0x240f2d,_0x1b63c3){return client[_0xa0ee('0x2')](_0xa0ee('0x6'),{'body':_0x1b63c3,'options':{'where':{'id':_0x240f2d}},'log':_0xa0ee('0x7')});}; \ No newline at end of file +var _0x625e=['Request','AddTagsToOpenchannelInteraction','../client','update','updateOpenchannelInteraction','addTags'];(function(_0x82226b,_0x404c63){var _0x2a94b5=function(_0x2a2602){while(--_0x2a2602){_0x82226b['push'](_0x82226b['shift']());}};_0x2a94b5(++_0x404c63);}(_0x625e,0x7a));var _0xe625=function(_0x446208,_0xb483fb){_0x446208=_0x446208-0x0;var _0xe49563=_0x625e[_0x446208];return _0xe49563;};'use strict';var client=require(_0xe625('0x0'));exports[_0xe625('0x1')]=function(_0x2181ae,_0xa933d2){return client['Request']('UpdateOpenchannelInteraction',{'body':_0xa933d2,'options':{'where':{'id':_0x2181ae}},'log':_0xe625('0x2')});};exports[_0xe625('0x3')]=function(_0x35a57e,_0x951d6b){return client[_0xe625('0x4')](_0xe625('0x5'),{'body':_0x951d6b,'options':{'where':{'id':_0x35a57e}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index c383b47..2d8dfe1 100644 --- a/server/services/routing/rpc/openchannelMessage.js +++ b/server/services/routing/rpc/openchannelMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x61fd=['createOpenchannelMessage','../client','create','Request','CreateOpenchannelMessage'];(function(_0x174ef5,_0x256e8e){var _0x1cc379=function(_0x3eafcf){while(--_0x3eafcf){_0x174ef5['push'](_0x174ef5['shift']());}};_0x1cc379(++_0x256e8e);}(_0x61fd,0x100));var _0xd61f=function(_0x26c0dc,_0x5c87e0){_0x26c0dc=_0x26c0dc-0x0;var _0x244d35=_0x61fd[_0x26c0dc];return _0x244d35;};'use strict';var client=require(_0xd61f('0x0'));exports[_0xd61f('0x1')]=function(_0x1b8165){return client[_0xd61f('0x2')](_0xd61f('0x3'),{'body':_0x1b8165,'log':_0xd61f('0x4')});}; \ No newline at end of file +var _0x3fef=['create','Request','../client'];(function(_0x4d8549,_0x273735){var _0x5cc4a5=function(_0x27167a){while(--_0x27167a){_0x4d8549['push'](_0x4d8549['shift']());}};_0x5cc4a5(++_0x273735);}(_0x3fef,0x8c));var _0xf3fe=function(_0x9aaf75,_0x5edcd9){_0x9aaf75=_0x9aaf75-0x0;var _0x5cf395=_0x3fef[_0x9aaf75];return _0x5cf395;};'use strict';var client=require(_0xf3fe('0x0'));exports[_0xf3fe('0x1')]=function(_0x533bcd){return client[_0xf3fe('0x2')]('CreateOpenchannelMessage',{'body':_0x533bcd,'log':'createOpenchannelMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index fdbb2ed..dce522f 100644 --- a/server/services/routing/rpc/openchannelQueue.js +++ b/server/services/routing/rpc/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4d88=['Request','GetOpenchannelQueue','name','timeout','strategy','User','Agents','online','openchannelPause','../client','getOpenchannelQueues'];(function(_0x463de0,_0x4a0c27){var _0x51314b=function(_0x5e79df){while(--_0x5e79df){_0x463de0['push'](_0x463de0['shift']());}};_0x51314b(++_0x4a0c27);}(_0x4d88,0x195));var _0x84d8=function(_0x2432da,_0x524e50){_0x2432da=_0x2432da-0x0;var _0x2318dc=_0x4d88[_0x2432da];return _0x2318dc;};'use strict';var client=require(_0x84d8('0x0'));exports[_0x84d8('0x1')]=function(){return function(){return client[_0x84d8('0x2')](_0x84d8('0x3'),{'options':{'raw':![],'attributes':['id',_0x84d8('0x4'),_0x84d8('0x5'),_0x84d8('0x6')],'include':[{'model':_0x84d8('0x7'),'as':_0x84d8('0x8'),'attributes':['id',_0x84d8('0x4'),_0x84d8('0x9'),_0x84d8('0xa')]}]},'log':_0x84d8('0x1')});};}; \ No newline at end of file +var _0x4cff=['GetOpenchannelQueue','timeout','strategy','User','Agents','name','online','openchannelPause','../client','getOpenchannelQueues','Request'];(function(_0x2697d9,_0x26806a){var _0x25e6ae=function(_0x4ff250){while(--_0x4ff250){_0x2697d9['push'](_0x2697d9['shift']());}};_0x25e6ae(++_0x26806a);}(_0x4cff,0x105));var _0xf4cf=function(_0x140e3a,_0x45a338){_0x140e3a=_0x140e3a-0x0;var _0x18c230=_0x4cff[_0x140e3a];return _0x18c230;};'use strict';var client=require(_0xf4cf('0x0'));exports[_0xf4cf('0x1')]=function(){return function(){return client[_0xf4cf('0x2')](_0xf4cf('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xf4cf('0x4'),_0xf4cf('0x5')],'include':[{'model':_0xf4cf('0x6'),'as':_0xf4cf('0x7'),'attributes':['id',_0xf4cf('0x8'),_0xf4cf('0x9'),_0xf4cf('0xa')]}]},'log':_0xf4cf('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index cb73a66..41cd800 100644 --- a/server/services/routing/rpc/openchannelQueueReport.js +++ b/server/services/routing/rpc/openchannelQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9a89=['update','DESC','UpdateOpenchannelQueueReport','../client','create','Request','CreateOpenchannelQueueReport'];(function(_0x5e6b45,_0x4d1d98){var _0x34de84=function(_0x4b3da9){while(--_0x4b3da9){_0x5e6b45['push'](_0x5e6b45['shift']());}};_0x34de84(++_0x4d1d98);}(_0x9a89,0xce));var _0x99a8=function(_0x10f31b,_0x486fc9){_0x10f31b=_0x10f31b-0x0;var _0x33744c=_0x9a89[_0x10f31b];return _0x33744c;};'use strict';var client=require(_0x99a8('0x0'));exports[_0x99a8('0x1')]=function(_0x3816f3){return client[_0x99a8('0x2')](_0x99a8('0x3'),{'body':_0x3816f3,'log':'CreateOpenchannelQueueReport'});};exports[_0x99a8('0x4')]=function(_0x17d139,_0x5bb08c){return client[_0x99a8('0x2')]('UpdateOpenchannelQueueReport',{'body':_0x5bb08c,'options':{'where':{'uniqueid':_0x17d139},'order':[['id',_0x99a8('0x5')]],'limit':0x1},'log':_0x99a8('0x6')});}; \ No newline at end of file +var _0xbde2=['UpdateOpenchannelQueueReport','DESC','create','Request','CreateOpenchannelQueueReport','update'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xbde2,0x7a));var _0x2bde=function(_0x25559e,_0x567d76){_0x25559e=_0x25559e-0x0;var _0xd3cbb0=_0xbde2[_0x25559e];return _0xd3cbb0;};'use strict';var client=require('../client');exports[_0x2bde('0x0')]=function(_0x1dcb5a){return client[_0x2bde('0x1')]('CreateOpenchannelQueueReport',{'body':_0x1dcb5a,'log':_0x2bde('0x2')});};exports[_0x2bde('0x3')]=function(_0xa16ec1,_0x530c9f){return client[_0x2bde('0x1')](_0x2bde('0x4'),{'body':_0x530c9f,'options':{'where':{'uniqueid':_0xa16ec1},'order':[['id',_0x2bde('0x5')]],'limit':0x1},'log':_0x2bde('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 50c495e..1a94ec8 100644 --- a/server/services/routing/rpc/smsInteraction.js +++ b/server/services/routing/rpc/smsInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3351=['AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','Request','UpdateSmsInteraction','updateSmsInteraction','addTags'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0x3351,0x1b4));var _0x1335=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0x3351[_0x3899d1];return _0xeb4a7d;};'use strict';var client=require(_0x1335('0x0'));exports['update']=function(_0x5a075d,_0x2bf4df){return client[_0x1335('0x1')](_0x1335('0x2'),{'body':_0x2bf4df,'options':{'where':{'id':_0x5a075d}},'log':_0x1335('0x3')});};exports[_0x1335('0x4')]=function(_0x173f26,_0x1f635d){return client['Request'](_0x1335('0x5'),{'body':_0x1f635d,'options':{'where':{'id':_0x173f26}},'log':_0x1335('0x6')});}; \ No newline at end of file +var _0xbc8d=['Request','UpdateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client'];(function(_0x1486e5,_0x39684f){var _0x29d89b=function(_0x4a0a80){while(--_0x4a0a80){_0x1486e5['push'](_0x1486e5['shift']());}};_0x29d89b(++_0x39684f);}(_0xbc8d,0x15b));var _0xdbc8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbc8d[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xdbc8('0x0'));exports['update']=function(_0x2a1f46,_0x40e28f){return client[_0xdbc8('0x1')](_0xdbc8('0x2'),{'body':_0x40e28f,'options':{'where':{'id':_0x2a1f46}},'log':'updateSmsInteraction'});};exports[_0xdbc8('0x3')]=function(_0x172112,_0x2dd539){return client['Request'](_0xdbc8('0x4'),{'body':_0x2dd539,'options':{'where':{'id':_0x172112}},'log':_0xdbc8('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 33d72ef..efa3bcb 100644 --- a/server/services/routing/rpc/smsMessage.js +++ b/server/services/routing/rpc/smsMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x75ef=['create','Request','CreateSmsMessage','createSmsMessage','../client'];(function(_0x30e43d,_0x4f8159){var _0x48d9dc=function(_0x47fc51){while(--_0x47fc51){_0x30e43d['push'](_0x30e43d['shift']());}};_0x48d9dc(++_0x4f8159);}(_0x75ef,0xc2));var _0xf75e=function(_0x10189a,_0x42e328){_0x10189a=_0x10189a-0x0;var _0x2bd6a9=_0x75ef[_0x10189a];return _0x2bd6a9;};'use strict';var client=require(_0xf75e('0x0'));exports[_0xf75e('0x1')]=function(_0x504242){return client[_0xf75e('0x2')](_0xf75e('0x3'),{'body':_0x504242,'log':_0xf75e('0x4')});}; \ No newline at end of file +var _0x4197=['../client','CreateSmsMessage','createSmsMessage'];(function(_0x384c35,_0xd75070){var _0x4ded4e=function(_0x30d2fa){while(--_0x30d2fa){_0x384c35['push'](_0x384c35['shift']());}};_0x4ded4e(++_0xd75070);}(_0x4197,0x1da));var _0x7419=function(_0x517a69,_0x24de23){_0x517a69=_0x517a69-0x0;var _0x4917da=_0x4197[_0x517a69];return _0x4917da;};'use strict';var client=require(_0x7419('0x0'));exports['create']=function(_0x5a0def){return client['Request'](_0x7419('0x1'),{'body':_0x5a0def,'log':_0x7419('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 6161d92..6b9861e 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['timeout','strategy','User','Agents','name','../client','getSmsQueues'];(function(_0x3fc83f,_0x59b527){var _0x5e6146=function(_0x57e093){while(--_0x57e093){_0x3fc83f['push'](_0x3fc83f['shift']());}};_0x5e6146(++_0x59b527);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var client=require(_0x0d8b('0x0'));exports[_0x0d8b('0x1')]=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0d8b('0x2'),_0x0d8b('0x3')],'include':[{'model':_0x0d8b('0x4'),'as':_0x0d8b('0x5'),'attributes':['id',_0x0d8b('0x6'),'online','smsPause']}]},'log':_0x0d8b('0x1')});};}; \ No newline at end of file +var _0xe706=['Agents','online','smsPause','../client','getSmsQueues','Request','name','timeout','strategy','User'];(function(_0x5e097b,_0x1bd653){var _0x4bc702=function(_0x4357cb){while(--_0x4357cb){_0x5e097b['push'](_0x5e097b['shift']());}};_0x4bc702(++_0x1bd653);}(_0xe706,0xa3));var _0x6e70=function(_0x14a34a,_0x424129){_0x14a34a=_0x14a34a-0x0;var _0x4d921e=_0xe706[_0x14a34a];return _0x4d921e;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x6e70('0x3'),_0x6e70('0x4'),_0x6e70('0x5')],'include':[{'model':_0x6e70('0x6'),'as':_0x6e70('0x7'),'attributes':['id',_0x6e70('0x3'),_0x6e70('0x8'),_0x6e70('0x9')]}]},'log':_0x6e70('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index d013ba5..b8db544 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['create','CreateSmsQueueReport','update','UpdateSmsQueueReport','../client'];(function(_0x33b4d8,_0x51cc78){var _0x20234f=function(_0x50c932){while(--_0x50c932){_0x33b4d8['push'](_0x33b4d8['shift']());}};_0x20234f(++_0x51cc78);}(_0x70e0,0x17b));var _0x070e=function(_0x4ad4a2,_0x16da40){_0x4ad4a2=_0x4ad4a2-0x0;var _0xe9b5da=_0x70e0[_0x4ad4a2];return _0xe9b5da;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(_0x198c2e){return client['Request']('CreateSmsQueueReport',{'body':_0x198c2e,'log':_0x070e('0x2')});};exports[_0x070e('0x3')]=function(_0x277d32,_0x2593e5){return client['Request'](_0x070e('0x4'),{'body':_0x2593e5,'options':{'where':{'uniqueid':_0x277d32},'order':[['id','DESC']],'limit':0x1},'log':_0x070e('0x4')});}; \ No newline at end of file +var _0x3e74=['CreateSmsQueueReport','UpdateSmsQueueReport','DESC','../client','Request'];(function(_0x313ece,_0x1928bb){var _0x14db2a=function(_0x4fe0ef){while(--_0x4fe0ef){_0x313ece['push'](_0x313ece['shift']());}};_0x14db2a(++_0x1928bb);}(_0x3e74,0x175));var _0x43e7=function(_0x2dd1fb,_0x3bd8bb){_0x2dd1fb=_0x2dd1fb-0x0;var _0x47b210=_0x3e74[_0x2dd1fb];return _0x47b210;};'use strict';var client=require(_0x43e7('0x0'));exports['create']=function(_0x349480){return client[_0x43e7('0x1')](_0x43e7('0x2'),{'body':_0x349480,'log':'CreateSmsQueueReport'});};exports['update']=function(_0xc58479,_0x4f9bbe){return client[_0x43e7('0x1')](_0x43e7('0x3'),{'body':_0x4f9bbe,'options':{'where':{'uniqueid':_0xc58479},'order':[['id',_0x43e7('0x4')]],'limit':0x1},'log':_0x43e7('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 67c04d0..4bc26a6 100644 --- a/server/services/routing/rpc/user.js +++ b/server/services/routing/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x530188,_0x4ef913){var _0xa3513f=function(_0x3e6024){while(--_0x3e6024){_0x530188['push'](_0x530188['shift']());}};_0xa3513f(++_0x4ef913);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file +var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x34ffd5,_0x513764){var _0x6adef8=function(_0x69d2a8){while(--_0x69d2a8){_0x34ffd5['push'](_0x34ffd5['shift']());}};_0x6adef8(++_0x513764);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappInteraction.js b/server/services/routing/rpc/whatsappInteraction.js index 5bd6c47..52f7283 100644 --- a/server/services/routing/rpc/whatsappInteraction.js +++ b/server/services/routing/rpc/whatsappInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x01d9=['addTags','Request','AddTagsToWhatsappInteraction','../client','update','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x6aaa03,_0x44db85){var _0x51a1bc=function(_0x1f003f){while(--_0x1f003f){_0x6aaa03['push'](_0x6aaa03['shift']());}};_0x51a1bc(++_0x44db85);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0x901d('0x0'));exports[_0x901d('0x1')]=function(_0x30eba2,_0x209575){return client['Request'](_0x901d('0x2'),{'body':_0x209575,'options':{'where':{'id':_0x30eba2}},'log':_0x901d('0x3')});};exports[_0x901d('0x4')]=function(_0x8f7b4,_0x214f38){return client[_0x901d('0x5')](_0x901d('0x6'),{'body':_0x214f38,'options':{'where':{'id':_0x8f7b4}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file +var _0x7dee=['addTagsToWhatsappInteraction','../client','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction'];(function(_0x317d0f,_0x3a3ca8){var _0x413392=function(_0x130e40){while(--_0x130e40){_0x317d0f['push'](_0x317d0f['shift']());}};_0x413392(++_0x3a3ca8);}(_0x7dee,0xb0));var _0xe7de=function(_0x2fa978,_0x442cbb){_0x2fa978=_0x2fa978-0x0;var _0x19af40=_0x7dee[_0x2fa978];return _0x19af40;};'use strict';var client=require(_0xe7de('0x0'));exports['update']=function(_0x339ee2,_0x51419e){return client[_0xe7de('0x1')](_0xe7de('0x2'),{'body':_0x51419e,'options':{'where':{'id':_0x339ee2}},'log':_0xe7de('0x3')});};exports[_0xe7de('0x4')]=function(_0x4b846b,_0x12be83){return client['Request'](_0xe7de('0x5'),{'body':_0x12be83,'options':{'where':{'id':_0x4b846b}},'log':_0xe7de('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 458a693..8492c9b 100644 --- a/server/services/routing/rpc/whatsappMessage.js +++ b/server/services/routing/rpc/whatsappMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5a26=['create','Request','CreateWhatsappMessage','../client'];(function(_0x1e78bd,_0x308895){var _0x37625a=function(_0x4cb58c){while(--_0x4cb58c){_0x1e78bd['push'](_0x1e78bd['shift']());}};_0x37625a(++_0x308895);}(_0x5a26,0xdb));var _0x65a2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5a26[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x65a2('0x0'));exports[_0x65a2('0x1')]=function(_0x11522d){return client[_0x65a2('0x2')](_0x65a2('0x3'),{'body':_0x11522d,'log':'createWhatsappMessage'});}; \ No newline at end of file +var _0xa5cd=['Request','CreateWhatsappMessage','create'];(function(_0x29749a,_0x1d2e64){var _0x2a6fc0=function(_0x5da30e){while(--_0x5da30e){_0x29749a['push'](_0x29749a['shift']());}};_0x2a6fc0(++_0x1d2e64);}(_0xa5cd,0xf2));var _0xda5c=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xa5cd[_0x173441];return _0x2423a8;};'use strict';var client=require('../client');exports[_0xda5c('0x0')]=function(_0x40d004){return client[_0xda5c('0x1')](_0xda5c('0x2'),{'body':_0x40d004,'log':'createWhatsappMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 551a584..4443992 100644 --- a/server/services/routing/rpc/whatsappQueue.js +++ b/server/services/routing/rpc/whatsappQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7dfc=['timeout','Agents','whatsappPause','getWhatsappQueues','../client','Request','GetWhatsappQueue','name'];(function(_0x6e94f7,_0x1f5855){var _0x37e5fb=function(_0xc69edb){while(--_0xc69edb){_0x6e94f7['push'](_0x6e94f7['shift']());}};_0x37e5fb(++_0x1f5855);}(_0x7dfc,0xec));var _0xc7df=function(_0x4ec540,_0xdaecd3){_0x4ec540=_0x4ec540-0x0;var _0x460cad=_0x7dfc[_0x4ec540];return _0x460cad;};'use strict';var client=require(_0xc7df('0x0'));exports['getWhatsappQueues']=function(){return function(){return client[_0xc7df('0x1')](_0xc7df('0x2'),{'options':{'raw':![],'attributes':['id',_0xc7df('0x3'),_0xc7df('0x4'),'strategy'],'include':[{'model':'User','as':_0xc7df('0x5'),'attributes':['id',_0xc7df('0x3'),'online',_0xc7df('0x6')]}]},'log':_0xc7df('0x7')});};}; \ No newline at end of file +var _0x1e26=['Request','GetWhatsappQueue','name','timeout','strategy','Agents','online','whatsappPause','../client','getWhatsappQueues'];(function(_0xe6e3e2,_0x2b01da){var _0x126571=function(_0x515ab3){while(--_0x515ab3){_0xe6e3e2['push'](_0xe6e3e2['shift']());}};_0x126571(++_0x2b01da);}(_0x1e26,0x148));var _0x61e2=function(_0x52b0d0,_0x3a92ca){_0x52b0d0=_0x52b0d0-0x0;var _0x536814=_0x1e26[_0x52b0d0];return _0x536814;};'use strict';var client=require(_0x61e2('0x0'));exports[_0x61e2('0x1')]=function(){return function(){return client[_0x61e2('0x2')](_0x61e2('0x3'),{'options':{'raw':![],'attributes':['id',_0x61e2('0x4'),_0x61e2('0x5'),_0x61e2('0x6')],'include':[{'model':'User','as':_0x61e2('0x7'),'attributes':['id',_0x61e2('0x4'),_0x61e2('0x8'),_0x61e2('0x9')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 8c06b87..07b421f 100644 --- a/server/services/routing/rpc/whatsappQueueReport.js +++ b/server/services/routing/rpc/whatsappQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8bef=['UpdateWhatsappQueueReport','DESC','create','Request'];(function(_0x3bd984,_0x4050f2){var _0x137f4b=function(_0x322734){while(--_0x322734){_0x3bd984['push'](_0x3bd984['shift']());}};_0x137f4b(++_0x4050f2);}(_0x8bef,0x1ea));var _0xf8be=function(_0x3f105a,_0x459d89){_0x3f105a=_0x3f105a-0x0;var _0x41a968=_0x8bef[_0x3f105a];return _0x41a968;};'use strict';var client=require('../client');exports[_0xf8be('0x0')]=function(_0x5dd73c){return client[_0xf8be('0x1')]('CreateWhatsappQueueReport',{'body':_0x5dd73c,'log':'CreateWhatsappQueueReport'});};exports['update']=function(_0x5ea373,_0x383704){return client[_0xf8be('0x1')](_0xf8be('0x2'),{'body':_0x383704,'options':{'where':{'uniqueid':_0x5ea373},'order':[['id',_0xf8be('0x3')]],'limit':0x1},'log':_0xf8be('0x2')});}; \ No newline at end of file +var _0x4cb2=['Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','create'];(function(_0x547af,_0x17abff){var _0x22f7f4=function(_0x5f0384){while(--_0x5f0384){_0x547af['push'](_0x547af['shift']());}};_0x22f7f4(++_0x17abff);}(_0x4cb2,0x1b2));var _0x24cb=function(_0x4615be,_0xb9d9d3){_0x4615be=_0x4615be-0x0;var _0x4d5b92=_0x4cb2[_0x4615be];return _0x4d5b92;};'use strict';var client=require('../client');exports[_0x24cb('0x0')]=function(_0x11658f){return client[_0x24cb('0x1')](_0x24cb('0x2'),{'body':_0x11658f,'log':'CreateWhatsappQueueReport'});};exports[_0x24cb('0x3')]=function(_0x390fe6,_0x44638b){return client[_0x24cb('0x1')](_0x24cb('0x4'),{'body':_0x44638b,'options':{'where':{'uniqueid':_0x390fe6},'order':[['id','DESC']],'limit':0x1},'log':_0x24cb('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index 07614d0..1d893a7 100644 --- a/server/services/routing/server/applications/agent.js +++ b/server/services/routing/server/applications/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x41e0=['timeout\x20is\x20a\x20number','info','format','name','toLowerCase','consequence','length','map','message','join','agents','timeout','createQueue','atimeout','channel','START:%s','rules','end','stop','complete','[%s][AGENT]\x20ROUTING\x20END','close','next','agent','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x41e0,0x69));var _0x041e=function(_0x526713,_0x2d99c7){_0x526713=_0x526713-0x0;var _0x883e74=_0x41e0[_0x526713];return _0x883e74;};'use strict';var schema=require(_0x041e('0x0'));var _=require(_0x041e('0x1'));var util=require(_0x041e('0x2'));var seqqueue=require('seq-queue');var logger=require(_0x041e('0x3'))(_0x041e('0x4'));var strategy=require(_0x041e('0x5'));var queue=schema({'name':{'type':_0x041e('0x6'),'required':!![],'message':_0x041e('0x7')},'timeout':{'type':_0x041e('0x8'),'message':_0x041e('0x9')}});function writeLog(_0x5df9bf,_0x520c5c,_0x2305a4){return logger[_0x041e('0xa')](util[_0x041e('0xb')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x5df9bf,_0x520c5c[_0x041e('0xc')],_0x2305a4));}function handleFindAgent(_0x419a38){return function(_0x2e1d1f){return _0x2e1d1f['name'][_0x041e('0xd')]()===_0x419a38[_0x041e('0xd')]();};}exports[_0x041e('0xe')]=function(_0x5b26d7,_0x45fb8a,_0x7a214e,_0x42c9cc){return function(_0x348b99){try{var _0x458702={'name':_0x45fb8a[0x0],'timeout':_0x45fb8a[0x1]};var _0x287e51=queue[_0x041e('0x0')](_0x458702,{'typecast':!![]});if(_0x287e51[_0x041e('0xf')]){logger['error']('[%s][AGENT]\x20%s',_0x5b26d7,_[_0x041e('0x10')](_0x287e51,_0x041e('0x11'))[_0x041e('0x12')](',\x20'));_0x348b99['stop']();}else{var _0x52acb0=_['find'](_0x7a214e[_0x041e('0x13')],handleFindAgent(_0x458702[_0x041e('0xc')]));if(_0x52acb0){var _0x13ea1c=(_0x458702[_0x041e('0x14')]||0xa)*0x3e8;var _0x4dae65,_0xe76856;var _0xe8dabe=seqqueue[_0x041e('0x15')](_0x13ea1c);_0xe8dabe['id']=_0x5b26d7;_0xe8dabe[_0x041e('0x16')]=_0x13ea1c;_0xe8dabe[_0x041e('0x17')]=_0x42c9cc[_0x041e('0x17')];writeLog(_0x5b26d7,_0x52acb0,util[_0x041e('0xb')](_0x041e('0x18'),_0x13ea1c));_0x7a214e[_0x041e('0x19')][_0x5b26d7]['on'](_0x041e('0x1a'),function(){logger[_0x041e('0xa')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x5b26d7);clearTimeout(_0xe76856);_0xe76856=undefined;_0xe8dabe['close']();if(_0x7a214e['rules'][_0x5b26d7]){delete _0x7a214e[_0x041e('0x19')][_0x5b26d7];}_0x348b99[_0x041e('0x1b')]();});_0x7a214e['rules'][_0x5b26d7]['on'](_0x041e('0x1c'),function(){if(_0x7a214e[_0x041e('0x19')][_0x5b26d7]){delete _0x7a214e[_0x041e('0x19')][_0x5b26d7];}});_0xe76856=setTimeout(function(){logger[_0x041e('0xa')](_0x041e('0x1d'),_0x5b26d7);clearTimeout(_0xe76856);_0xe8dabe[_0x041e('0x1e')]();_0x348b99[_0x041e('0x1f')]();},_0x13ea1c);strategy[_0x041e('0x20')](_0xe8dabe,_0x52acb0,_0x7a214e,_0x42c9cc);}else{logger[_0x041e('0x21')](_0x041e('0x22'),_0x5b26d7,_0x458702[_0x041e('0xc')]);_0x348b99[_0x041e('0x1b')]();}}}catch(_0x838c65){console[_0x041e('0x23')](_0x838c65);logger[_0x041e('0x21')](_0x041e('0x24'),_0x5b26d7,_0x838c65[_0x041e('0x25')]);_0x348b99[_0x041e('0x1b')]();}};}; \ No newline at end of file +var _0xdbcd=['number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','validate','length','map','message','agents','createQueue','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','stop','[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','lodash','seq-queue','../../../../config/logger','routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x335031,_0x3e1100){var _0x30b931=function(_0x17bede){while(--_0x17bede){_0x335031['push'](_0x335031['shift']());}};_0x30b931(++_0x3e1100);}(_0xdbcd,0x1bc));var _0xddbc=function(_0x3e8201,_0x5eebdb){_0x3e8201=_0x3e8201-0x0;var _0x171226=_0xdbcd[_0x3e8201];return _0x171226;};'use strict';var schema=require('validate');var _=require(_0xddbc('0x0'));var util=require('util');var seqqueue=require(_0xddbc('0x1'));var logger=require(_0xddbc('0x2'))(_0xddbc('0x3'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0xddbc('0x4'),'required':!![],'message':_0xddbc('0x5')},'timeout':{'type':_0xddbc('0x6'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x2f27fa,_0x44136e,_0x284670){return logger[_0xddbc('0x7')](util[_0xddbc('0x8')](_0xddbc('0x9'),_0x2f27fa,_0x44136e[_0xddbc('0xa')],_0x284670));}function handleFindAgent(_0x1f1c55){return function(_0x3fde0e){return _0x3fde0e[_0xddbc('0xa')][_0xddbc('0xb')]()===_0x1f1c55[_0xddbc('0xb')]();};}exports[_0xddbc('0xc')]=function(_0x2cdc1b,_0x58e21a,_0x1f7b5d,_0x4da4a7){return function(_0x4c21bf){try{var _0x45d2eb={'name':_0x58e21a[0x0],'timeout':_0x58e21a[0x1]};var _0x58a16e=queue[_0xddbc('0xd')](_0x45d2eb,{'typecast':!![]});if(_0x58a16e[_0xddbc('0xe')]){logger['error']('[%s][AGENT]\x20%s',_0x2cdc1b,_[_0xddbc('0xf')](_0x58a16e,_0xddbc('0x10'))['join'](',\x20'));_0x4c21bf['stop']();}else{var _0x27d5e8=_['find'](_0x1f7b5d[_0xddbc('0x11')],handleFindAgent(_0x45d2eb[_0xddbc('0xa')]));if(_0x27d5e8){var _0x594353=(_0x45d2eb['timeout']||0xa)*0x3e8;var _0x29cd74,_0x16e5bc;var _0x2220a6=seqqueue[_0xddbc('0x12')](_0x594353);_0x2220a6['id']=_0x2cdc1b;_0x2220a6[_0xddbc('0x13')]=_0x594353;_0x2220a6[_0xddbc('0x14')]=_0x4da4a7[_0xddbc('0x14')];writeLog(_0x2cdc1b,_0x27d5e8,util['format'](_0xddbc('0x15'),_0x594353));_0x1f7b5d[_0xddbc('0x16')][_0x2cdc1b]['on'](_0xddbc('0x17'),function(){logger[_0xddbc('0x7')](_0xddbc('0x18'),_0x2cdc1b);clearTimeout(_0x16e5bc);_0x16e5bc=undefined;_0x2220a6[_0xddbc('0x19')]();if(_0x1f7b5d['rules'][_0x2cdc1b]){delete _0x1f7b5d[_0xddbc('0x16')][_0x2cdc1b];}_0x4c21bf[_0xddbc('0x1a')]();});_0x1f7b5d['rules'][_0x2cdc1b]['on']('complete',function(){if(_0x1f7b5d[_0xddbc('0x16')][_0x2cdc1b]){delete _0x1f7b5d['rules'][_0x2cdc1b];}});_0x16e5bc=setTimeout(function(){logger[_0xddbc('0x7')]('[%s][AGENT]\x20ROUTING\x20END',_0x2cdc1b);clearTimeout(_0x16e5bc);_0x2220a6[_0xddbc('0x19')]();_0x4c21bf['next']();},_0x594353);strategy['agent'](_0x2220a6,_0x27d5e8,_0x1f7b5d,_0x4da4a7);}else{logger['error'](_0xddbc('0x1b'),_0x2cdc1b,_0x45d2eb[_0xddbc('0xa')]);_0x4c21bf['stop']();}}}catch(_0x251a74){console['log'](_0x251a74);logger['error'](_0xddbc('0x1c'),_0x2cdc1b,_0x251a74[_0xddbc('0x1d')]);_0x4c21bf[_0xddbc('0x1a')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index bafdfe0..9cbbb00 100644 --- a/server/services/routing/server/applications/amazonlex.js +++ b/server/services/routing/server/applications/amazonlex.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe724=['postText','error','next','providerName','stringify','dialogState','Failed','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','body','Message','create','then','catch','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString'];(function(_0x500785,_0x15e5ff){var _0x1f8bcc=function(_0x406983){while(--_0x406983){_0x500785['push'](_0x500785['shift']());}};_0x1f8bcc(++_0x15e5ff);}(_0xe724,0x15e));var _0x4e72=function(_0x574617,_0x42eccc){_0x574617=_0x574617-0x0;var _0x29de90=_0xe724[_0x574617];return _0x29de90;};'use strict';var _=require('lodash');var moment=require(_0x4e72('0x0'));var AWS=require(_0x4e72('0x1'));var utils=require(_0x4e72('0x2'));var logger=require(_0x4e72('0x3'))(_0x4e72('0x4'));var rpc={'chatMessage':require(_0x4e72('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x4e72('0x6')),'faxMessage':require(_0x4e72('0x7')),'whatsappMessage':require(_0x4e72('0x8'))};exports[_0x4e72('0x9')]=function(_0x219dfe,_0x13f67a){return function(_0x142963){try{if(!_[_0x4e72('0xa')](this[_0x4e72('0xb')][_0x4e72('0xc')])){logger[_0x4e72('0xd')](_0x4e72('0xe'),_0x219dfe,_0x4e72('0xf'));return _0x142963['next']();}var _0x2a426b={'ContactId':this[_0x4e72('0x10')]['id'],'sentAt':moment()[_0x4e72('0x11')](_0x4e72('0x12')),'direction':'out'};if(this['channel']==='sms'||this[_0x4e72('0x13')]===_0x4e72('0x14')){_0x2a426b[_0x4e72('0x15')]=this[_0x4e72('0xb')]['phone'];}var _0x1f5d0d=this[_0x4e72('0x13')];if(_0x1f5d0d===_0x4e72('0x16')){_0x2a426b[_0x4e72('0x17')]=this[_0x4e72('0x18')]['id'];}else{_0x2a426b[_[_0x4e72('0x19')](_0x1f5d0d)+_0x4e72('0x1a')]=this[_0x4e72('0x18')]['id'];}_0x2a426b[_[_0x4e72('0x19')](_0x1f5d0d)+_0x4e72('0x1b')]=this['interaction']['id'];if(this[_0x4e72('0xb')][_0x4e72('0x1c')]){var _0xb50fb6=_0x13f67a[0x4];if(!_['isEmpty'](_0xb50fb6)){_0x2a426b[_0x4e72('0x1d')]=utils['getMustacheRender'](_0xb50fb6,this);return rpc[_0x1f5d0d+_0x4e72('0x1e')][_0x4e72('0x1f')](_0x2a426b)[_0x4e72('0x20')](function(_0x20d9f6){logger['info'](_0x4e72('0xe'),_0x219dfe,_0x2a426b[_0x4e72('0x1d')]);})[_0x4e72('0x21')](function(_0x44555e){logger['error'](_0x4e72('0xe'),_0x219dfe,JSON['stringify'](_0x44555e));})[_0x4e72('0x22')](function(){logger[_0x4e72('0xd')](_0x4e72('0x23'),_0x219dfe);_0x142963[_0x4e72('0x24')]();});}else{logger[_0x4e72('0xd')](_0x4e72('0x25'),_0x219dfe);_0x142963['stop']();}}else{var _0x2a683e=this;var _0xb30f2c=new AWS[(_0x4e72('0x26'))]({'accessKeyId':_0x13f67a[0x0],'secretAccessKey':_0x13f67a[0x1],'region':_0x13f67a[0x2]});var _0x566518={'botAlias':_0x4e72('0x27'),'botName':_0x13f67a[0x3],'inputText':this[_0x4e72('0x28')][_0x4e72('0x1d')],'userId':this['channel']+':'+this[_0x4e72('0xb')]['id'][_0x4e72('0x29')]()};_0xb30f2c[_0x4e72('0x2a')](_0x566518,function(_0x1aa6b0,_0x277404){if(_0x1aa6b0){logger[_0x4e72('0x2b')](_0x4e72('0xe'),_0x219dfe,_0x1aa6b0[_0x4e72('0x28')]);_0x142963[_0x4e72('0x2c')]();}else if(_0x277404&&_0x277404[_0x4e72('0x28')]){_0x2a683e['body']['amazonlex']=_0x277404;_0x2a426b[_0x4e72('0x1d')]=_0x277404[_0x4e72('0x28')];_0x2a426b[_0x4e72('0x2d')]='amazonlex';_0x2a426b['providerResponse']=JSON[_0x4e72('0x2e')](_0x277404);return rpc[_0x1f5d0d+_0x4e72('0x1e')]['create'](_0x2a426b)[_0x4e72('0x20')](function(_0x500a07){logger[_0x4e72('0xd')]('[%s][AMAZONLEX]\x20%s',_0x219dfe,_0x2a426b[_0x4e72('0x1d')]);if(_0x277404[_0x4e72('0x2f')]==_0x4e72('0x30')){_0x142963[_0x4e72('0x2c')]();}else{_0x142963[_0x4e72('0x24')]();}})[_0x4e72('0x21')](function(_0x2abb82){logger['error'](_0x4e72('0xe'),_0x219dfe,JSON[_0x4e72('0x2e')](_0x2abb82));_0x142963[_0x4e72('0x2c')]();});}else{_0x142963[_0x4e72('0x2c')]();}});}}catch(_0x17e1c3){logger[_0x4e72('0x2b')]('[%s][AMAZONLEX]\x20%s',_0x219dfe,JSON[_0x4e72('0x2e')](_0x17e1c3));_0x142963[_0x4e72('0x24')]();}};}; \ No newline at end of file +var _0x153a=['LexRuntime','$LATEST','message','postText','error','providerName','amazonlex','providerResponse','dialogState','Failed','aws-sdk','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','interaction','info','[%s][AMAZONLEX]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','catch','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!'];(function(_0x405663,_0x3aeccb){var _0x241305=function(_0x1cf3d2){while(--_0x1cf3d2){_0x405663['push'](_0x405663['shift']());}};_0x241305(++_0x3aeccb);}(_0x153a,0xd2));var _0xa153=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0x153a[_0x172747];return _0x509692;};'use strict';var _=require('lodash');var moment=require('moment');var AWS=require(_0xa153('0x0'));var utils=require(_0xa153('0x1'));var logger=require(_0xa153('0x2'))('routing');var rpc={'chatMessage':require(_0xa153('0x3')),'openchannelMessage':require(_0xa153('0x4')),'mailMessage':require(_0xa153('0x5')),'smsMessage':require(_0xa153('0x6')),'faxMessage':require(_0xa153('0x7')),'whatsappMessage':require(_0xa153('0x8'))};exports['consequence']=function(_0x3199bb,_0x72221a){return function(_0x140e04){try{if(!_[_0xa153('0x9')](this[_0xa153('0xa')]['UserId'])){logger[_0xa153('0xb')](_0xa153('0xc'),_0x3199bb,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x140e04[_0xa153('0xd')]();}var _0x56ec1e={'ContactId':this[_0xa153('0xe')]['id'],'sentAt':moment()[_0xa153('0xf')](_0xa153('0x10')),'direction':_0xa153('0x11')};if(this[_0xa153('0x12')]==='sms'||this[_0xa153('0x12')]===_0xa153('0x13')){_0x56ec1e[_0xa153('0x14')]=this[_0xa153('0xa')][_0xa153('0x14')];}var _0x2e947d=this[_0xa153('0x12')];if(_0x2e947d===_0xa153('0x15')){_0x56ec1e[_0xa153('0x16')]=this[_0xa153('0x17')]['id'];}else{_0x56ec1e[_['upperFirst'](_0x2e947d)+_0xa153('0x18')]=this[_0xa153('0x17')]['id'];}_0x56ec1e[_[_0xa153('0x19')](_0x2e947d)+_0xa153('0x1a')]=this[_0xa153('0xa')]['id'];if(this[_0xa153('0xa')][_0xa153('0x1b')]){var _0x1799bf=_0x72221a[0x4];if(!_[_0xa153('0x1c')](_0x1799bf)){_0x56ec1e[_0xa153('0x1d')]=utils[_0xa153('0x1e')](_0x1799bf,this);return rpc[_0x2e947d+_0xa153('0x1f')][_0xa153('0x20')](_0x56ec1e)[_0xa153('0x21')](function(_0x2b36b9){logger['info'](_0xa153('0xc'),_0x3199bb,_0x56ec1e['body']);})[_0xa153('0x22')](function(_0x1135f6){logger['error'](_0xa153('0xc'),_0x3199bb,JSON[_0xa153('0x23')](_0x1135f6));})[_0xa153('0x24')](function(){logger[_0xa153('0xb')](_0xa153('0x25'),_0x3199bb);_0x140e04[_0xa153('0x26')]();});}else{logger[_0xa153('0xb')](_0xa153('0x27'),_0x3199bb);_0x140e04[_0xa153('0x26')]();}}else{var _0x992954=this;var _0x48b904=new AWS[(_0xa153('0x28'))]({'accessKeyId':_0x72221a[0x0],'secretAccessKey':_0x72221a[0x1],'region':_0x72221a[0x2]});var _0x5c9ee4={'botAlias':_0xa153('0x29'),'botName':_0x72221a[0x3],'inputText':this[_0xa153('0x2a')][_0xa153('0x1d')],'userId':this[_0xa153('0x12')]+':'+this['interaction']['id']['toString']()};_0x48b904[_0xa153('0x2b')](_0x5c9ee4,function(_0x1d0c7c,_0x298143){if(_0x1d0c7c){logger[_0xa153('0x2c')](_0xa153('0xc'),_0x3199bb,_0x1d0c7c[_0xa153('0x2a')]);_0x140e04[_0xa153('0xd')]();}else if(_0x298143&&_0x298143[_0xa153('0x2a')]){_0x992954[_0xa153('0x1d')]['amazonlex']=_0x298143;_0x56ec1e[_0xa153('0x1d')]=_0x298143['message'];_0x56ec1e[_0xa153('0x2d')]=_0xa153('0x2e');_0x56ec1e[_0xa153('0x2f')]=JSON[_0xa153('0x23')](_0x298143);return rpc[_0x2e947d+_0xa153('0x1f')][_0xa153('0x20')](_0x56ec1e)['then'](function(_0x2dd3a5){logger['info'](_0xa153('0xc'),_0x3199bb,_0x56ec1e['body']);if(_0x298143[_0xa153('0x30')]==_0xa153('0x31')){_0x140e04['next']();}else{_0x140e04[_0xa153('0x26')]();}})['catch'](function(_0x455192){logger[_0xa153('0x2c')](_0xa153('0xc'),_0x3199bb,JSON['stringify'](_0x455192));_0x140e04[_0xa153('0xd')]();});}else{_0x140e04[_0xa153('0xd')]();}});}}catch(_0x4a136a){logger[_0xa153('0x2c')](_0xa153('0xc'),_0x3199bb,JSON['stringify'](_0x4a136a));_0x140e04[_0xa153('0x26')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index e329039..8c69280 100644 --- a/server/services/routing/server/applications/autoreply.js +++ b/server/services/routing/server/applications/autoreply.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7e21=['[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','finally','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','moment','./utils','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','body','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','info','Autoreply\x20already\x20sent','autoreplyExecuted','One\x20Time\x20already\x20sent','contact','format','out','getMustacheRender','message','from','phone','subject','startsWith','Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','inReplyTo','messageId','','','headers','All','sendMailMessage','smtpOptions','then','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','resolve','Interaction','update'];(function(_0x3441d7,_0x465329){var _0x64c81d=function(_0x20f2cd){while(--_0x20f2cd){_0x3441d7['push'](_0x3441d7['shift']());}};_0x64c81d(++_0x465329);}(_0x7e21,0x83));var _0x17e2=function(_0x3b7d38,_0x34b4c8){_0x3b7d38=_0x3b7d38-0x0;var _0x44bdaa=_0x7e21[_0x3b7d38];return _0x44bdaa;};'use strict';var _=require('lodash');var moment=require(_0x17e2('0x0'));var utils=require(_0x17e2('0x1'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x17e2('0x2')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x17e2('0x3')),'smsMessage':require(_0x17e2('0x4')),'faxMessage':require(_0x17e2('0x5')),'whatsappMessage':require(_0x17e2('0x6')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0x17e2('0x7')),'smsInteraction':require(_0x17e2('0x8')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x17e2('0x9'))};var mailRpc=require(_0x17e2('0xa'));exports[_0x17e2('0xb')]=function(_0x519a31,_0x5e766d,_0x2f132e,_0x4125a5){return function(_0x40b4ef){try{var _0x2d0968=this[_0x17e2('0xc')];if(_0x2d0968===_0x17e2('0xd')&&_0x4125a5[_0x17e2('0xe')]['isAutoreply']){logger['info'](_0x17e2('0xf'),_0x519a31,_0x17e2('0x10'));return _0x40b4ef[_0x17e2('0x11')]();}if(_0x5e766d[0x0]==='1'&&(_[_0x17e2('0x12')](this[_0x17e2('0x13')][_0x17e2('0x14')])||!this[_0x17e2('0x13')]['created'])){logger[_0x17e2('0x15')]('[%s][AUTOREPLY]\x20%s',_0x519a31,_0x17e2('0x16'));return _0x40b4ef[_0x17e2('0x11')]();}if(_0x5e766d[0x0]==='2'&&this[_0x17e2('0x13')][_0x17e2('0x17')]){logger['info']('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x519a31,_0x17e2('0x18'));return _0x40b4ef[_0x17e2('0x11')]();}var _0x5b8d83={'ContactId':this[_0x17e2('0x19')]['id'],'sentAt':moment()[_0x17e2('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x17e2('0x1b')};if(this['channel']===_0x17e2('0xd')){_0x5b8d83[_0x17e2('0xe')]=utils[_0x17e2('0x1c')](_0x5e766d[0x2],this);}else{_0x5b8d83[_0x17e2('0xe')]=utils['getMustacheRender'](_0x5e766d[0x1],this);}if(this[_0x17e2('0x1d')]){_0x5b8d83['to']=this['message'][_0x17e2('0x1e')]||'';if(this['channel']===_0x17e2('0xd')&&_0x5e766d[0x1]==='1'){_0x5b8d83['cc']=this[_0x17e2('0x1d')]['cc']||'';}_0x5b8d83['from']=this['message']['to']||'';_0x5b8d83[_0x17e2('0x1f')]=this[_0x17e2('0x1d')][_0x17e2('0x1f')]||'';_0x5b8d83['read']=!![];if(this[_0x17e2('0x1d')][_0x17e2('0x20')]){_0x5b8d83['subject']='';_0x5b8d83[_0x17e2('0x20')]+=_[_0x17e2('0x21')](this['message'][_0x17e2('0x20')],'Re:')?'':_0x17e2('0x22');_0x5b8d83[_0x17e2('0x20')]+=this[_0x17e2('0x1d')]['subject'];}}if(this[_0x17e2('0xc')]===_0x17e2('0x23')){_0x5b8d83[_0x17e2('0x24')]=this[_0x17e2('0x25')]['id'];}else{_0x5b8d83[_[_0x17e2('0x26')](this[_0x17e2('0xc')])+_0x17e2('0x27')]=this['account']['id'];}_0x5b8d83[_[_0x17e2('0x26')](this[_0x17e2('0xc')])+_0x17e2('0x28')]=this[_0x17e2('0x13')]['id'];var _0x3d7d3c=this[_0x17e2('0x13')];if(rpc[this[_0x17e2('0xc')]+_0x17e2('0x29')]){if(this[_0x17e2('0xc')]===_0x17e2('0xd')){_0x5b8d83[_0x17e2('0x2a')]=this[_0x17e2('0x1d')][_0x17e2('0x2b')];_0x5b8d83['html']=_0x17e2('0x2c')+_['replace'](_0x5b8d83['body'],_0x17e2('0x2d'),_0x17e2('0x2e'))+_0x17e2('0x2f');_0x5b8d83[_0x17e2('0x30')]={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':_0x17e2('0x31'),'Precedence':'auto_reply'};return mailRpc[_0x17e2('0x32')](this[_0x17e2('0x25')][_0x17e2('0x33')],_0x5b8d83)[_0x17e2('0x34')](function(_0xfdce2){logger[_0x17e2('0x15')]('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x519a31);_0x5b8d83[_0x17e2('0x2b')]=_0xfdce2['message']['messageId'];return rpc[_0x2d0968+_0x17e2('0x29')][_0x17e2('0x35')](_0x5b8d83);})['then'](function(_0x30984f){logger[_0x17e2('0x15')](_0x17e2('0xf'),_0x519a31,JSON[_0x17e2('0x36')](_0x30984f));})[_0x17e2('0x37')](function(_0x34751c){logger[_0x17e2('0x38')](_0x17e2('0x39'),_0x519a31,JSON[_0x17e2('0x36')](_0x34751c));})['finally'](function(){Promise[_0x17e2('0x3a')]()[_0x17e2('0x34')](function(){if(_0x5e766d[0x0]!=='2'||_0x3d7d3c[_0x17e2('0x17')])return;return rpc[_0x2d0968+_0x17e2('0x3b')][_0x17e2('0x3c')](_0x3d7d3c['id'],{'autoreplyExecuted':!![]})[_0x17e2('0x34')](function(_0x1d6551){logger[_0x17e2('0x15')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x519a31,JSON[_0x17e2('0x36')](_0x1d6551));})[_0x17e2('0x37')](function(_0x575613){logger['error'](_0x17e2('0x3d'),_0x519a31,JSON[_0x17e2('0x36')](_0x575613));});})[_0x17e2('0x34')](function(){_0x40b4ef[_0x17e2('0x11')]();});});}else{return rpc[this[_0x17e2('0xc')]+'Message'][_0x17e2('0x35')](_0x5b8d83)[_0x17e2('0x34')](function(){logger[_0x17e2('0x15')]('[%s][AUTOREPLY]\x20%s',_0x519a31,_0x5b8d83[_0x17e2('0xe')]);})[_0x17e2('0x37')](function(_0x35d78f){logger[_0x17e2('0x38')]('[%s][AUTOREPLY]\x20%s',_0x519a31,JSON[_0x17e2('0x36')](_0x35d78f));})[_0x17e2('0x3e')](function(){Promise[_0x17e2('0x3a')]()[_0x17e2('0x34')](function(){if(_0x5e766d[0x0]!=='2'||_0x3d7d3c[_0x17e2('0x17')])return;return rpc[_0x2d0968+'Interaction'][_0x17e2('0x3c')](_0x3d7d3c['id'],{'autoreplyExecuted':!![]})[_0x17e2('0x34')](function(_0x82dc03){logger['info'](_0x17e2('0x3f'),_0x519a31,JSON[_0x17e2('0x36')](_0x82dc03));})[_0x17e2('0x37')](function(_0x54c233){logger[_0x17e2('0x38')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x519a31,JSON[_0x17e2('0x36')](_0x54c233));});})[_0x17e2('0x34')](function(){_0x40b4ef[_0x17e2('0x11')]();});});}}}catch(_0x3d19d9){logger['error']('[%s][AUTOREPLY]\x20%s',_0x519a31,JSON[_0x17e2('0x36')](_0x3d19d9));_0x40b4ef['stop']();}};}; \ No newline at end of file +var _0x67b2=['../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','info','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','subject','startsWith','Re:','Re:\x20','chat','account','upperFirst','AccountId','Message','inReplyTo','messageId','replace','','headers','All','sendMailMessage','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','error','stringify','finally','resolve','update','catch','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','Interaction','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction'];(function(_0x32b62e,_0x422213){var _0x967254=function(_0x25dfaa){while(--_0x25dfaa){_0x32b62e['push'](_0x32b62e['shift']());}};_0x967254(++_0x422213);}(_0x67b2,0x156));var _0x267b=function(_0x25df80,_0xa2aec5){_0x25df80=_0x25df80-0x0;var _0x17b6d0=_0x67b2[_0x25df80];return _0x17b6d0;};'use strict';var _=require(_0x267b('0x0'));var moment=require(_0x267b('0x1'));var utils=require(_0x267b('0x2'));var logger=require(_0x267b('0x3'))(_0x267b('0x4'));var rpc={'chatMessage':require(_0x267b('0x5')),'openchannelMessage':require(_0x267b('0x6')),'mailMessage':require(_0x267b('0x7')),'smsMessage':require(_0x267b('0x8')),'faxMessage':require(_0x267b('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0x267b('0xa')),'openchannelInteraction':require(_0x267b('0xb')),'mailInteraction':require(_0x267b('0xc')),'smsInteraction':require(_0x267b('0xd')),'faxInteraction':require(_0x267b('0xe')),'whatsappInteraction':require(_0x267b('0xf'))};var mailRpc=require(_0x267b('0x10'));exports[_0x267b('0x11')]=function(_0x5a6541,_0xb135a2,_0x1c0cbd,_0x55eba7){return function(_0x55e52c){try{var _0x1e6047=this[_0x267b('0x12')];if(_0x1e6047===_0x267b('0x13')&&_0x55eba7[_0x267b('0x14')][_0x267b('0x15')]){logger['info'](_0x267b('0x16'),_0x5a6541,_0x267b('0x17'));return _0x55e52c[_0x267b('0x18')]();}if(_0xb135a2[0x0]==='1'&&(_[_0x267b('0x19')](this[_0x267b('0x1a')]['created'])||!this['interaction'][_0x267b('0x1b')])){logger[_0x267b('0x1c')]('[%s][AUTOREPLY]\x20%s',_0x5a6541,_0x267b('0x1d'));return _0x55e52c['next']();}if(_0xb135a2[0x0]==='2'&&this['interaction'][_0x267b('0x1e')]){logger['info'](_0x267b('0x1f'),_0x5a6541,_0x267b('0x20'));return _0x55e52c[_0x267b('0x18')]();}var _0x2e38af={'ContactId':this[_0x267b('0x21')]['id'],'sentAt':moment()[_0x267b('0x22')](_0x267b('0x23')),'direction':_0x267b('0x24')};if(this[_0x267b('0x12')]===_0x267b('0x13')){_0x2e38af[_0x267b('0x14')]=utils[_0x267b('0x25')](_0xb135a2[0x2],this);}else{_0x2e38af['body']=utils[_0x267b('0x25')](_0xb135a2[0x1],this);}if(this[_0x267b('0x26')]){_0x2e38af['to']=this[_0x267b('0x26')]['from']||'';if(this[_0x267b('0x12')]===_0x267b('0x13')&&_0xb135a2[0x1]==='1'){_0x2e38af['cc']=this[_0x267b('0x26')]['cc']||'';}_0x2e38af[_0x267b('0x27')]=this[_0x267b('0x26')]['to']||'';_0x2e38af[_0x267b('0x28')]=this[_0x267b('0x26')][_0x267b('0x28')]||'';_0x2e38af['read']=!![];if(this[_0x267b('0x26')][_0x267b('0x29')]){_0x2e38af[_0x267b('0x29')]='';_0x2e38af[_0x267b('0x29')]+=_[_0x267b('0x2a')](this[_0x267b('0x26')][_0x267b('0x29')],_0x267b('0x2b'))?'':_0x267b('0x2c');_0x2e38af['subject']+=this[_0x267b('0x26')][_0x267b('0x29')];}}if(this['channel']===_0x267b('0x2d')){_0x2e38af['ChatWebsiteId']=this[_0x267b('0x2e')]['id'];}else{_0x2e38af[_[_0x267b('0x2f')](this[_0x267b('0x12')])+_0x267b('0x30')]=this[_0x267b('0x2e')]['id'];}_0x2e38af[_[_0x267b('0x2f')](this['channel'])+'InteractionId']=this[_0x267b('0x1a')]['id'];var _0x26602c=this[_0x267b('0x1a')];if(rpc[this[_0x267b('0x12')]+_0x267b('0x31')]){if(this[_0x267b('0x12')]==='mail'){_0x2e38af[_0x267b('0x32')]=this[_0x267b('0x26')][_0x267b('0x33')];_0x2e38af['html']=''+_[_0x267b('0x34')](_0x2e38af[_0x267b('0x14')],_0x267b('0x35'),_0x267b('0x36'))+_0x267b('0x37');_0x2e38af[_0x267b('0x38')]={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':_0x267b('0x39'),'Precedence':'auto_reply'};return mailRpc[_0x267b('0x3a')](this[_0x267b('0x2e')][_0x267b('0x3b')],_0x2e38af)[_0x267b('0x3c')](function(_0x56697a){logger[_0x267b('0x1c')](_0x267b('0x3d'),_0x5a6541);_0x2e38af['messageId']=_0x56697a[_0x267b('0x26')][_0x267b('0x33')];return rpc[_0x1e6047+_0x267b('0x31')][_0x267b('0x3e')](_0x2e38af);})['then'](function(_0x57e02){logger[_0x267b('0x1c')](_0x267b('0x16'),_0x5a6541,JSON['stringify'](_0x57e02));})['catch'](function(_0x4b540c){logger[_0x267b('0x3f')]('[RPC][%s][AUTOREPLY]\x20%s',_0x5a6541,JSON[_0x267b('0x40')](_0x4b540c));})[_0x267b('0x41')](function(){Promise[_0x267b('0x42')]()[_0x267b('0x3c')](function(){if(_0xb135a2[0x0]!=='2'||_0x26602c['autoreplyExecuted'])return;return rpc[_0x1e6047+'Interaction'][_0x267b('0x43')](_0x26602c['id'],{'autoreplyExecuted':!![]})['then'](function(_0x1f6483){logger['info'](_0x267b('0x1f'),_0x5a6541,JSON[_0x267b('0x40')](_0x1f6483));})[_0x267b('0x44')](function(_0x19ff6e){logger[_0x267b('0x3f')](_0x267b('0x45'),_0x5a6541,JSON[_0x267b('0x40')](_0x19ff6e));});})['then'](function(){_0x55e52c['next']();});});}else{return rpc[this[_0x267b('0x12')]+'Message'][_0x267b('0x3e')](_0x2e38af)[_0x267b('0x3c')](function(){logger['info'](_0x267b('0x16'),_0x5a6541,_0x2e38af[_0x267b('0x14')]);})['catch'](function(_0x406442){logger[_0x267b('0x3f')](_0x267b('0x16'),_0x5a6541,JSON[_0x267b('0x40')](_0x406442));})[_0x267b('0x41')](function(){Promise[_0x267b('0x42')]()[_0x267b('0x3c')](function(){if(_0xb135a2[0x0]!=='2'||_0x26602c['autoreplyExecuted'])return;return rpc[_0x1e6047+_0x267b('0x46')][_0x267b('0x43')](_0x26602c['id'],{'autoreplyExecuted':!![]})[_0x267b('0x3c')](function(_0x4d8220){logger[_0x267b('0x1c')](_0x267b('0x1f'),_0x5a6541,JSON['stringify'](_0x4d8220));})['catch'](function(_0x9dadf3){logger[_0x267b('0x3f')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x5a6541,JSON['stringify'](_0x9dadf3));});})['then'](function(){_0x55e52c[_0x267b('0x18')]();});});}}}catch(_0x7434a0){logger[_0x267b('0x3f')]('[%s][AUTOREPLY]\x20%s',_0x5a6541,JSON[_0x267b('0x40')](_0x7434a0));_0x55e52c['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index b3943dd..95599de 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x676a=['update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','finally','stop','stringify','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','format','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction'];(function(_0x4a558f,_0x119a03){var _0x2570f8=function(_0xa9dc34){while(--_0xa9dc34){_0x4a558f['push'](_0x4a558f['shift']());}};_0x2570f8(++_0x119a03);}(_0x676a,0x136));var _0xa676=function(_0x43b584,_0x20a6bd){_0x43b584=_0x43b584-0x0;var _0x48f27b=_0x676a[_0x43b584];return _0x48f27b;};'use strict';var moment=require(_0xa676('0x0'));var logger=require(_0xa676('0x1'))(_0xa676('0x2'));var rpc={'chatInteraction':require(_0xa676('0x3')),'openchannelInteraction':require(_0xa676('0x4')),'smsInteraction':require(_0xa676('0x5')),'mailInteraction':require(_0xa676('0x6')),'faxInteraction':require(_0xa676('0x7')),'whatsappInteraction':require(_0xa676('0x8'))};exports[_0xa676('0x9')]=function(_0x1136a5,_0x5b4e86,_0x41eeba,_0x4f90df){return function(_0x22b47c){try{logger[_0xa676('0xa')]('[%s][CLOSE]\x20reason\x20%s',_0x1136a5,_0x5b4e86[0x0]);var _0x2ffc03={'closed':0x1,'closedAt':moment()[_0xa676('0xb')](_0xa676('0xc')),'closeReason':'system','disposition':_0x5b4e86[0x0]};if(rpc[_0x4f90df[_0xa676('0xd')]+_0xa676('0xe')]){rpc[_0x4f90df[_0xa676('0xd')]+'Interaction'][_0xa676('0xf')](_0x4f90df[_0xa676('0x10')]['id'],_0x2ffc03)[_0xa676('0x11')](function(_0x2121c3){logger[_0xa676('0xa')](_0xa676('0x12'),_0x1136a5,_0x4f90df[_0xa676('0x10')]['id']);})[_0xa676('0x13')](function(_0x3e9d78){logger[_0xa676('0x14')](_0xa676('0x15'),_0x1136a5,JSON['stringify'](_0x3e9d78));})[_0xa676('0x16')](function(){_0x22b47c[_0xa676('0x17')]();});}}catch(_0x3cc273){logger['error'](_0xa676('0x15'),_0x1136a5,JSON[_0xa676('0x18')](_0x3cc273));_0x22b47c['stop']();}};}; \ No newline at end of file +var _0x9590=['finally','stop','error','stringify','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','channel','Interaction','interaction','catch','[%s][CLOSE]\x20%s'];(function(_0x475095,_0x271b7d){var _0x231cd5=function(_0x186ae3){while(--_0x186ae3){_0x475095['push'](_0x475095['shift']());}};_0x231cd5(++_0x271b7d);}(_0x9590,0x154));var _0x0959=function(_0x385ec9,_0x32f910){_0x385ec9=_0x385ec9-0x0;var _0x106cf6=_0x9590[_0x385ec9];return _0x106cf6;};'use strict';var moment=require(_0x0959('0x0'));var logger=require(_0x0959('0x1'))(_0x0959('0x2'));var rpc={'chatInteraction':require(_0x0959('0x3')),'openchannelInteraction':require(_0x0959('0x4')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x0959('0x5')),'faxInteraction':require(_0x0959('0x6')),'whatsappInteraction':require(_0x0959('0x7'))};exports[_0x0959('0x8')]=function(_0x28e696,_0x1f5d14,_0x4b500d,_0x206b14){return function(_0x40c250){try{logger[_0x0959('0x9')](_0x0959('0xa'),_0x28e696,_0x1f5d14[0x0]);var _0x4b276c={'closed':0x1,'closedAt':moment()[_0x0959('0xb')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':'system','disposition':_0x1f5d14[0x0]};if(rpc[_0x206b14[_0x0959('0xc')]+_0x0959('0xd')]){rpc[_0x206b14[_0x0959('0xc')]+_0x0959('0xd')]['update'](_0x206b14[_0x0959('0xe')]['id'],_0x4b276c)['then'](function(_0x171d88){logger[_0x0959('0x9')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x28e696,_0x206b14[_0x0959('0xe')]['id']);})[_0x0959('0xf')](function(_0x595779){logger['error'](_0x0959('0x10'),_0x28e696,JSON['stringify'](_0x595779));})[_0x0959('0x11')](function(){_0x40c250[_0x0959('0x12')]();});}}catch(_0x6e9d88){logger[_0x0959('0x13')](_0x0959('0x10'),_0x28e696,JSON[_0x0959('0x14')](_0x6e9d88));_0x40c250[_0x0959('0x12')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index f3e872d..438161d 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6657=['Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','whatsapp','phone','chat','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','catch','error','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','textRequest','dialogflow','providerResponse','stringify','result','metadata','endConversation','message','lodash','apiai-promise','md5','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s'];(function(_0x402c8f,_0x30cc1d){var _0x11e809=function(_0x4ccfa3){while(--_0x4ccfa3){_0x402c8f['push'](_0x402c8f['shift']());}};_0x11e809(++_0x30cc1d);}(_0x6657,0x17f));var _0x7665=function(_0x312940,_0x27d5aa){_0x312940=_0x312940-0x0;var _0x4c2cc5=_0x6657[_0x312940];return _0x4c2cc5;};'use strict';var _=require(_0x7665('0x0'));var moment=require('moment');var apiai=require(_0x7665('0x1'));var md5=require(_0x7665('0x2'));var utils=require(_0x7665('0x3'));var logger=require(_0x7665('0x4'))('routing');var rpc={'chatMessage':require(_0x7665('0x5')),'openchannelMessage':require(_0x7665('0x6')),'mailMessage':require(_0x7665('0x7')),'smsMessage':require(_0x7665('0x8')),'faxMessage':require(_0x7665('0x9')),'whatsappMessage':require(_0x7665('0xa'))};exports[_0x7665('0xb')]=function(_0x3387d8,_0x4c0b5c){return function(_0x31da89){try{if(!_[_0x7665('0xc')](this[_0x7665('0xd')][_0x7665('0xe')])){logger[_0x7665('0xf')](_0x7665('0x10'),_0x3387d8,_0x7665('0x11'));return _0x31da89[_0x7665('0x12')]();}var _0x5ca72e={'ContactId':this[_0x7665('0x13')]['id'],'sentAt':moment()[_0x7665('0x14')](_0x7665('0x15')),'direction':'out'};if(this[_0x7665('0x16')]==='sms'||this[_0x7665('0x16')]===_0x7665('0x17')){_0x5ca72e['phone']=this[_0x7665('0xd')][_0x7665('0x18')];}var _0x4dd9aa=this[_0x7665('0x16')];if(_0x4dd9aa===_0x7665('0x19')){_0x5ca72e['ChatWebsiteId']=this[_0x7665('0x1a')]['id'];}else{_0x5ca72e[_[_0x7665('0x1b')](_0x4dd9aa)+_0x7665('0x1c')]=this[_0x7665('0x1a')]['id'];}_0x5ca72e[_[_0x7665('0x1b')](_0x4dd9aa)+_0x7665('0x1d')]=this[_0x7665('0xd')]['id'];if(this[_0x7665('0xd')][_0x7665('0x1e')]){var _0x334ee6=_0x4c0b5c[0x2];if(!_[_0x7665('0x1f')](_0x334ee6)){_0x5ca72e[_0x7665('0x20')]=utils[_0x7665('0x21')](_0x334ee6,this);return rpc[_0x4dd9aa+_0x7665('0x22')][_0x7665('0x23')](_0x5ca72e)[_0x7665('0x24')](function(_0x522944){logger[_0x7665('0xf')](_0x7665('0x10'),_0x3387d8,_0x5ca72e['body']);})[_0x7665('0x25')](function(_0x2033a5){logger[_0x7665('0x26')](_0x7665('0x10'),_0x3387d8,JSON['stringify'](_0x2033a5));})[_0x7665('0x27')](function(){logger[_0x7665('0xf')](_0x7665('0x28'),_0x3387d8);_0x31da89[_0x7665('0x29')]();});}else{logger[_0x7665('0xf')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x3387d8);_0x31da89[_0x7665('0x29')]();}}else{var _0x51d577=this;var _0x37be5d=apiai(_0x4c0b5c[0x0],{'language':_0x4c0b5c[0x1]||'en'});return _0x37be5d[_0x7665('0x2a')](this['message']['body'],{'sessionId':md5(this[_0x7665('0xd')]['id'])})[_0x7665('0x24')](function(_0x4a9a25){_0x51d577[_0x7665('0x20')][_0x7665('0x2b')]=_0x4a9a25;_0x5ca72e[_0x7665('0x20')]=_0x4a9a25['result']['fulfillment']['speech'];_0x5ca72e['providerName']=_0x7665('0x2b');_0x5ca72e[_0x7665('0x2c')]=JSON[_0x7665('0x2d')](_0x4a9a25);return rpc[_0x4dd9aa+'Message'][_0x7665('0x23')](_0x5ca72e)[_0x7665('0x24')](function(_0x50bfa5){logger['info'](_0x7665('0x10'),_0x3387d8,_0x5ca72e[_0x7665('0x20')]);if(_0x4a9a25[_0x7665('0x2e')][_0x7665('0x2f')][_0x7665('0x30')]){_0x31da89[_0x7665('0x12')]();}else{_0x31da89['stop']();}})[_0x7665('0x25')](function(_0x55d046){logger['error'](_0x7665('0x10'),_0x3387d8,JSON[_0x7665('0x2d')](_0x55d046));_0x31da89[_0x7665('0x12')]();});})[_0x7665('0x25')](function(_0x264b6e){logger[_0x7665('0x26')](_0x7665('0x10'),_0x3387d8,_0x264b6e[_0x7665('0x31')]);_0x31da89[_0x7665('0x12')]();});}}catch(_0x415cb8){logger[_0x7665('0x26')](_0x7665('0x10'),_0x3387d8,JSON[_0x7665('0x2d')](_0x415cb8));_0x31da89[_0x7665('0x29')]();}};}; \ No newline at end of file +var _0xcedf=['apiai-promise','md5','../../../../config/logger','routing','../../rpc/mailMessage','../../rpc/faxMessage','consequence','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','chat','account','upperFirst','AccountId','InteractionId','body','getMustacheRender','Message','create','then','catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','result','providerName','providerResponse','endConversation','stop','lodash','moment'];(function(_0x50416f,_0x924b83){var _0x26dc53=function(_0x4f9c5f){while(--_0x4f9c5f){_0x50416f['push'](_0x50416f['shift']());}};_0x26dc53(++_0x924b83);}(_0xcedf,0x1b6));var _0xfced=function(_0x26e0c5,_0x4a445e){_0x26e0c5=_0x26e0c5-0x0;var _0x582941=_0xcedf[_0x26e0c5];return _0x582941;};'use strict';var _=require(_0xfced('0x0'));var moment=require(_0xfced('0x1'));var apiai=require(_0xfced('0x2'));var md5=require(_0xfced('0x3'));var utils=require('./utils');var logger=require(_0xfced('0x4'))(_0xfced('0x5'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xfced('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xfced('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xfced('0x8')]=function(_0x571725,_0x2cc4d1){return function(_0x5bd518){try{if(!_['isNil'](this[_0xfced('0x9')][_0xfced('0xa')])){logger[_0xfced('0xb')](_0xfced('0xc'),_0x571725,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x5bd518[_0xfced('0xd')]();}var _0x3487bd={'ContactId':this[_0xfced('0xe')]['id'],'sentAt':moment()[_0xfced('0xf')](_0xfced('0x10')),'direction':_0xfced('0x11')};if(this[_0xfced('0x12')]===_0xfced('0x13')||this[_0xfced('0x12')]==='whatsapp'){_0x3487bd[_0xfced('0x14')]=this['interaction'][_0xfced('0x14')];}var _0x5792c1=this[_0xfced('0x12')];if(_0x5792c1===_0xfced('0x15')){_0x3487bd['ChatWebsiteId']=this[_0xfced('0x16')]['id'];}else{_0x3487bd[_[_0xfced('0x17')](_0x5792c1)+_0xfced('0x18')]=this[_0xfced('0x16')]['id'];}_0x3487bd[_[_0xfced('0x17')](_0x5792c1)+_0xfced('0x19')]=this[_0xfced('0x9')]['id'];if(this[_0xfced('0x9')]['created']){var _0x95b06f=_0x2cc4d1[0x2];if(!_['isEmpty'](_0x95b06f)){_0x3487bd[_0xfced('0x1a')]=utils[_0xfced('0x1b')](_0x95b06f,this);return rpc[_0x5792c1+_0xfced('0x1c')][_0xfced('0x1d')](_0x3487bd)[_0xfced('0x1e')](function(_0x27e988){logger[_0xfced('0xb')](_0xfced('0xc'),_0x571725,_0x3487bd[_0xfced('0x1a')]);})[_0xfced('0x1f')](function(_0x4dc7ba){logger[_0xfced('0x20')](_0xfced('0xc'),_0x571725,JSON[_0xfced('0x21')](_0x4dc7ba));})[_0xfced('0x22')](function(){logger[_0xfced('0xb')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x571725);_0x5bd518['stop']();});}else{logger[_0xfced('0xb')](_0xfced('0x23'),_0x571725);_0x5bd518['stop']();}}else{var _0x12f832=this;var _0x445862=apiai(_0x2cc4d1[0x0],{'language':_0x2cc4d1[0x1]||'en'});return _0x445862[_0xfced('0x24')](this[_0xfced('0x25')][_0xfced('0x1a')],{'sessionId':md5(this[_0xfced('0x9')]['id'])})['then'](function(_0x16d9a3){_0x12f832[_0xfced('0x1a')][_0xfced('0x26')]=_0x16d9a3;_0x3487bd[_0xfced('0x1a')]=_0x16d9a3[_0xfced('0x27')]['fulfillment']['speech'];_0x3487bd[_0xfced('0x28')]=_0xfced('0x26');_0x3487bd[_0xfced('0x29')]=JSON[_0xfced('0x21')](_0x16d9a3);return rpc[_0x5792c1+'Message'][_0xfced('0x1d')](_0x3487bd)['then'](function(_0x506855){logger[_0xfced('0xb')](_0xfced('0xc'),_0x571725,_0x3487bd['body']);if(_0x16d9a3[_0xfced('0x27')]['metadata'][_0xfced('0x2a')]){_0x5bd518[_0xfced('0xd')]();}else{_0x5bd518[_0xfced('0x2b')]();}})[_0xfced('0x1f')](function(_0x561698){logger[_0xfced('0x20')](_0xfced('0xc'),_0x571725,JSON[_0xfced('0x21')](_0x561698));_0x5bd518[_0xfced('0xd')]();});})['catch'](function(_0x1fab8d){logger[_0xfced('0x20')](_0xfced('0xc'),_0x571725,_0x1fab8d['message']);_0x5bd518[_0xfced('0xd')]();});}}catch(_0x6fdd87){logger[_0xfced('0x20')](_0xfced('0xc'),_0x571725,JSON[_0xfced('0x21')](_0x6fdd87));_0x5bd518[_0xfced('0x2b')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index a231965..0283d2d 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf8b6=['[%s][DIALOGFLOWV2]\x20%s','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','channel','sms','whatsapp','phone','ChatWebsiteId','AccountId','upperFirst','InteractionId','created','isEmpty','then','info','catch','error','stringify','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','isFallback','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','intentDetectionConfidence','providerName','providerResponse','push','fulfillmentText','all','md5','moment','bluebird','../../../../config/logger','./utils','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','create'];(function(_0x2e2ddb,_0xffac9f){var _0x65373d=function(_0xd22602){while(--_0xd22602){_0x2e2ddb['push'](_0x2e2ddb['shift']());}};_0x65373d(++_0xffac9f);}(_0xf8b6,0x15f));var _0x6f8b=function(_0x2b7e10,_0x5e90f8){_0x2b7e10=_0x2b7e10-0x0;var _0x2f536b=_0xf8b6[_0x2b7e10];return _0x2f536b;};'use strict';var _=require('lodash');var dialogflow=require('dialogflow');var md5=require(_0x6f8b('0x0'));var moment=require(_0x6f8b('0x1'));var Promise=require(_0x6f8b('0x2'));var logger=require(_0x6f8b('0x3'))('routing');var utils=require(_0x6f8b('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x6f8b('0x5')),'mailMessage':require(_0x6f8b('0x6')),'smsMessage':require(_0x6f8b('0x7')),'faxMessage':require(_0x6f8b('0x8')),'whatsappMessage':require(_0x6f8b('0x9'))};function createMessage(_0xb6f4fe,_0x586eb7,_0x5a3e06,_0xc68d5b){return new Promise(function(_0x48be6f,_0x24ffcb){var _0x4c37cd=_[_0x6f8b('0xa')](_0x5a3e06);_0x4c37cd[_0x6f8b('0xb')]=_0xc68d5b;return rpc[_0x586eb7+_0x6f8b('0xc')][_0x6f8b('0xd')](_0x4c37cd)['then'](function(){logger['info'](_0x6f8b('0xe'),_0xb6f4fe,_0x4c37cd['body']);_0x48be6f();})['catch'](function(_0x2d8c0b){logger['error'](_0x6f8b('0xe'),_0xb6f4fe,JSON['stringify'](_0x2d8c0b));_0x24ffcb(_0x2d8c0b);});});}exports[_0x6f8b('0xf')]=function(_0x23f475,_0x2e205f){return function(_0xa1d47b){try{if(!_[_0x6f8b('0x10')](this[_0x6f8b('0x11')][_0x6f8b('0x12')])){logger['info'](_0x6f8b('0xe'),_0x23f475,_0x6f8b('0x13'));return _0xa1d47b[_0x6f8b('0x14')]();}var _0x265c15={'ContactId':this[_0x6f8b('0x15')]['id'],'sentAt':moment()[_0x6f8b('0x16')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x6f8b('0x17')};if(this[_0x6f8b('0x18')]===_0x6f8b('0x19')||this[_0x6f8b('0x18')]===_0x6f8b('0x1a')){_0x265c15['phone']=this[_0x6f8b('0x11')][_0x6f8b('0x1b')];}var _0x224503=this[_0x6f8b('0x18')];if(_0x224503==='chat'){_0x265c15[_0x6f8b('0x1c')]=this['account']['id'];}else{_0x265c15[_['upperFirst'](_0x224503)+_0x6f8b('0x1d')]=this['account']['id'];}_0x265c15[_[_0x6f8b('0x1e')](_0x224503)+_0x6f8b('0x1f')]=this[_0x6f8b('0x11')]['id'];if(this[_0x6f8b('0x11')][_0x6f8b('0x20')]){var _0x44ed12=_0x2e205f[0x4];if(!_[_0x6f8b('0x21')](_0x44ed12)){_0x265c15['body']=utils['getMustacheRender'](_0x44ed12,this);return rpc[_0x224503+'Message']['create'](_0x265c15)[_0x6f8b('0x22')](function(_0xcb38d0){logger[_0x6f8b('0x23')]('[%s][DIALOGFLOWV2]\x20%s',_0x23f475,_0x265c15['body']);})[_0x6f8b('0x24')](function(_0x96abdd){logger[_0x6f8b('0x25')](_0x6f8b('0xe'),_0x23f475,JSON[_0x6f8b('0x26')](_0x96abdd));})[_0x6f8b('0x27')](function(){logger['info'](_0x6f8b('0x28'),_0x23f475);_0xa1d47b[_0x6f8b('0x29')]();});}else{logger[_0x6f8b('0x23')](_0x6f8b('0x2a'),_0x23f475);_0xa1d47b['stop']();}}else{var _0x3fd9d5=this;var _0x40493c=_0x2e205f[0x2][_0x6f8b('0x2b')](/\\n/g,'\x0a');var _0x2ad488={'credentials':{'private_key':_0x40493c,'client_email':_0x2e205f[0x1]}};var _0xee9c85=new dialogflow[(_0x6f8b('0x2c'))](_0x2ad488);var _0x269060=_0xee9c85[_0x6f8b('0x2d')](_0x2e205f[0x0],md5(_0x3fd9d5['interaction']['id']));var _0x292dcd={'session':_0x269060,'queryInput':{'text':{'text':_0x3fd9d5[_0x6f8b('0x2e')][_0x6f8b('0xb')],'languageCode':_0x2e205f[0x3]||'en'}}};return _0xee9c85[_0x6f8b('0x2f')](_0x292dcd)[_0x6f8b('0x22')](function(_0x619dd2){if(_0x619dd2&&_0x619dd2[_0x6f8b('0x30')]){_0x3fd9d5[_0x6f8b('0xb')][_0x6f8b('0x31')]=_0x619dd2;var _0x42d065=_0x619dd2[0x0];var _0x10bf34=_0x42d065[_0x6f8b('0x32')][_0x6f8b('0x33')]&&_0x42d065[_0x6f8b('0x32')][_0x6f8b('0x33')][_0x6f8b('0x34')]?_0x42d065[_0x6f8b('0x32')][_0x6f8b('0x33')][_0x6f8b('0x34')]['end_conversation'][_0x6f8b('0x35')]:![];_0x3fd9d5[_0x6f8b('0xb')][_0x6f8b('0x36')]=_0x42d065['queryResult'][_0x6f8b('0x37')];_0x3fd9d5['body'][_0x6f8b('0x38')]=_0x42d065[_0x6f8b('0x32')][_0x6f8b('0x39')];_0x3fd9d5[_0x6f8b('0xb')][_0x6f8b('0x3a')]=_0x42d065['queryResult'][_0x6f8b('0x33')]&&_0x42d065[_0x6f8b('0x32')][_0x6f8b('0x33')]['fields']?_0x42d065['queryResult'][_0x6f8b('0x33')][_0x6f8b('0x34')]['end_conversation'][_0x6f8b('0x35')]:![];_0x3fd9d5[_0x6f8b('0xb')][_0x6f8b('0x3b')]=_0x42d065[_0x6f8b('0x32')][_0x6f8b('0x3c')][_0x6f8b('0x3d')];_0x3fd9d5['body'][_0x6f8b('0x3e')]=_0x42d065['queryResult'][_0x6f8b('0x3c')]['displayName'];_0x3fd9d5[_0x6f8b('0xb')]['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x42d065['queryResult'][_0x6f8b('0x3c')][_0x6f8b('0x3f')];_0x3fd9d5[_0x6f8b('0xb')]['DIALOGFLOWV2_LANGUAGECODE']=_0x42d065['queryResult'][_0x6f8b('0x40')];_0x3fd9d5[_0x6f8b('0xb')][_0x6f8b('0x41')]=_0x42d065[_0x6f8b('0x32')][_0x6f8b('0x42')];_0x3fd9d5[_0x6f8b('0xb')]['DIALOGFLOWV2_SCORE']=_0x42d065[_0x6f8b('0x32')][_0x6f8b('0x43')];_0x265c15[_0x6f8b('0x44')]=_0x6f8b('0x31');_0x265c15[_0x6f8b('0x45')]=JSON[_0x6f8b('0x26')](_0x619dd2);var _0x3c3090=[];for(var _0x434698=0x0;_0x434698<_0x619dd2[_0x6f8b('0x30')];_0x434698++){var _0x229ad8=_0x619dd2[_0x434698];if(_0x229ad8&&_0x229ad8[_0x6f8b('0x32')]&&_0x229ad8[_0x6f8b('0x32')]['fulfillmentText']){_0x3c3090[_0x6f8b('0x46')](createMessage(_0x23f475,_0x224503,_0x265c15,_0x229ad8[_0x6f8b('0x32')][_0x6f8b('0x47')]));}}return Promise[_0x6f8b('0x48')](_0x3c3090)[_0x6f8b('0x22')](function(){if(_0x10bf34){_0xa1d47b[_0x6f8b('0x14')]();}else{_0xa1d47b[_0x6f8b('0x29')]();}})[_0x6f8b('0x24')](function(_0x51f948){logger[_0x6f8b('0x25')](_0x6f8b('0xe'),_0x23f475,JSON['stringify'](_0x51f948));_0xa1d47b[_0x6f8b('0x14')]();});}})[_0x6f8b('0x24')](function(_0x1ab50a){logger[_0x6f8b('0x25')](_0x6f8b('0xe'),_0x23f475,_0x1ab50a['message'],_0x1ab50a['stack']);_0xa1d47b[_0x6f8b('0x14')]();});}}catch(_0x3834e0){logger[_0x6f8b('0x25')](_0x6f8b('0xe'),_0x23f475,JSON[_0x6f8b('0x26')](_0x3834e0));_0xa1d47b[_0x6f8b('0x29')]();}};}; \ No newline at end of file +var _0x3aa7=['boolValue','DIALOGFLOWV2_ACTION','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','intent','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','push','all','stop','stack','lodash','dialogflow','md5','moment','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','consequence','interaction','UserId','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','SessionsClient','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0x3aa7,0x1d6));var _0x73aa=function(_0x56c7e5,_0x19dfba){_0x56c7e5=_0x56c7e5-0x0;var _0x16ff5e=_0x3aa7[_0x56c7e5];return _0x16ff5e;};'use strict';var _=require(_0x73aa('0x0'));var dialogflow=require(_0x73aa('0x1'));var md5=require(_0x73aa('0x2'));var moment=require(_0x73aa('0x3'));var Promise=require('bluebird');var logger=require(_0x73aa('0x4'))(_0x73aa('0x5'));var utils=require(_0x73aa('0x6'));var rpc={'chatMessage':require(_0x73aa('0x7')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x73aa('0x8')),'faxMessage':require(_0x73aa('0x9')),'whatsappMessage':require(_0x73aa('0xa'))};function createMessage(_0x252b6e,_0x8e5092,_0x51d9e3,_0x2593b5){return new Promise(function(_0x18878a,_0x1b4c23){var _0x744d09=_[_0x73aa('0xb')](_0x51d9e3);_0x744d09[_0x73aa('0xc')]=_0x2593b5;return rpc[_0x8e5092+_0x73aa('0xd')][_0x73aa('0xe')](_0x744d09)[_0x73aa('0xf')](function(){logger[_0x73aa('0x10')](_0x73aa('0x11'),_0x252b6e,_0x744d09[_0x73aa('0xc')]);_0x18878a();})[_0x73aa('0x12')](function(_0x32aeac){logger[_0x73aa('0x13')]('[%s][DIALOGFLOWV2]\x20%s',_0x252b6e,JSON[_0x73aa('0x14')](_0x32aeac));_0x1b4c23(_0x32aeac);});});}exports[_0x73aa('0x15')]=function(_0xb6abfc,_0x349d75){return function(_0x247f2e){try{if(!_['isNil'](this[_0x73aa('0x16')][_0x73aa('0x17')])){logger[_0x73aa('0x10')](_0x73aa('0x11'),_0xb6abfc,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x247f2e[_0x73aa('0x18')]();}var _0x320167={'ContactId':this[_0x73aa('0x19')]['id'],'sentAt':moment()[_0x73aa('0x1a')](_0x73aa('0x1b')),'direction':_0x73aa('0x1c')};if(this[_0x73aa('0x1d')]===_0x73aa('0x1e')||this[_0x73aa('0x1d')]===_0x73aa('0x1f')){_0x320167['phone']=this[_0x73aa('0x16')][_0x73aa('0x20')];}var _0x44db91=this[_0x73aa('0x1d')];if(_0x44db91===_0x73aa('0x21')){_0x320167[_0x73aa('0x22')]=this[_0x73aa('0x23')]['id'];}else{_0x320167[_[_0x73aa('0x24')](_0x44db91)+_0x73aa('0x25')]=this[_0x73aa('0x23')]['id'];}_0x320167[_[_0x73aa('0x24')](_0x44db91)+_0x73aa('0x26')]=this[_0x73aa('0x16')]['id'];if(this[_0x73aa('0x16')][_0x73aa('0x27')]){var _0x2336fe=_0x349d75[0x4];if(!_[_0x73aa('0x28')](_0x2336fe)){_0x320167[_0x73aa('0xc')]=utils[_0x73aa('0x29')](_0x2336fe,this);return rpc[_0x44db91+'Message'][_0x73aa('0xe')](_0x320167)[_0x73aa('0xf')](function(_0x3133f3){logger[_0x73aa('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0xb6abfc,_0x320167[_0x73aa('0xc')]);})[_0x73aa('0x12')](function(_0x3ac46e){logger[_0x73aa('0x13')]('[%s][DIALOGFLOWV2]\x20%s',_0xb6abfc,JSON[_0x73aa('0x14')](_0x3ac46e));})[_0x73aa('0x2a')](function(){logger['info'](_0x73aa('0x2b'),_0xb6abfc);_0x247f2e['stop']();});}else{logger[_0x73aa('0x10')](_0x73aa('0x2c'),_0xb6abfc);_0x247f2e['stop']();}}else{var _0x245654=this;var _0x15c6b2=_0x349d75[0x2]['replace'](/\\n/g,'\x0a');var _0x566659={'credentials':{'private_key':_0x15c6b2,'client_email':_0x349d75[0x1]}};var _0x540905=new dialogflow[(_0x73aa('0x2d'))](_0x566659);var _0x3a6527=_0x540905[_0x73aa('0x2e')](_0x349d75[0x0],md5(_0x245654['interaction']['id']));var _0x12d18e={'session':_0x3a6527,'queryInput':{'text':{'text':_0x245654[_0x73aa('0x2f')][_0x73aa('0xc')],'languageCode':_0x349d75[0x3]||'en'}}};return _0x540905[_0x73aa('0x30')](_0x12d18e)[_0x73aa('0xf')](function(_0x197cfd){if(_0x197cfd&&_0x197cfd[_0x73aa('0x31')]){_0x245654[_0x73aa('0xc')][_0x73aa('0x32')]=_0x197cfd;var _0x58edcf=_0x197cfd[0x0];var _0x4304b3=_0x58edcf['queryResult']['diagnosticInfo']&&_0x58edcf[_0x73aa('0x33')][_0x73aa('0x34')]['fields']?_0x58edcf[_0x73aa('0x33')][_0x73aa('0x34')][_0x73aa('0x35')][_0x73aa('0x36')][_0x73aa('0x37')]:![];_0x245654[_0x73aa('0xc')][_0x73aa('0x38')]=_0x58edcf['queryResult']['action'];_0x245654[_0x73aa('0xc')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x58edcf['queryResult'][_0x73aa('0x39')];_0x245654[_0x73aa('0xc')][_0x73aa('0x3a')]=_0x58edcf[_0x73aa('0x33')]['diagnosticInfo']&&_0x58edcf[_0x73aa('0x33')][_0x73aa('0x34')][_0x73aa('0x35')]?_0x58edcf[_0x73aa('0x33')]['diagnosticInfo'][_0x73aa('0x35')][_0x73aa('0x36')][_0x73aa('0x37')]:![];_0x245654['body']['DIALOGFLOWV2_INTENTNAME']=_0x58edcf[_0x73aa('0x33')]['intent']['name'];_0x245654[_0x73aa('0xc')]['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x58edcf[_0x73aa('0x33')][_0x73aa('0x3b')][_0x73aa('0x3c')];_0x245654[_0x73aa('0xc')][_0x73aa('0x3d')]=_0x58edcf[_0x73aa('0x33')][_0x73aa('0x3b')][_0x73aa('0x3e')];_0x245654[_0x73aa('0xc')]['DIALOGFLOWV2_LANGUAGECODE']=_0x58edcf[_0x73aa('0x33')][_0x73aa('0x3f')];_0x245654[_0x73aa('0xc')][_0x73aa('0x40')]=_0x58edcf['queryResult'][_0x73aa('0x41')];_0x245654[_0x73aa('0xc')][_0x73aa('0x42')]=_0x58edcf['queryResult'][_0x73aa('0x43')];_0x320167[_0x73aa('0x44')]=_0x73aa('0x32');_0x320167[_0x73aa('0x45')]=JSON[_0x73aa('0x14')](_0x197cfd);var _0x537dc6=[];for(var _0x4592ba=0x0;_0x4592ba<_0x197cfd[_0x73aa('0x31')];_0x4592ba++){var _0x2d4e49=_0x197cfd[_0x4592ba];if(_0x2d4e49&&_0x2d4e49['queryResult']&&_0x2d4e49[_0x73aa('0x33')][_0x73aa('0x46')]){_0x537dc6[_0x73aa('0x47')](createMessage(_0xb6abfc,_0x44db91,_0x320167,_0x2d4e49[_0x73aa('0x33')][_0x73aa('0x46')]));}}return Promise[_0x73aa('0x48')](_0x537dc6)[_0x73aa('0xf')](function(){if(_0x4304b3){_0x247f2e['next']();}else{_0x247f2e[_0x73aa('0x49')]();}})['catch'](function(_0x48a28c){logger[_0x73aa('0x13')]('[%s][DIALOGFLOWV2]\x20%s',_0xb6abfc,JSON[_0x73aa('0x14')](_0x48a28c));_0x247f2e['next']();});}})[_0x73aa('0x12')](function(_0x2da8d6){logger[_0x73aa('0x13')](_0x73aa('0x11'),_0xb6abfc,_0x2da8d6['message'],_0x2da8d6[_0x73aa('0x4a')]);_0x247f2e[_0x73aa('0x18')]();});}}catch(_0x4ecad1){logger[_0x73aa('0x13')](_0x73aa('0x11'),_0xb6abfc,JSON['stringify'](_0x4ecad1));_0x247f2e[_0x73aa('0x49')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 7c745a2..4d9b49f 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x40e5=['next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','map','message','stop','condition','priorityTrue','priorityFalse','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x40e5,0xff));var _0x540e=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x40e5[_0x4e676e];return _0x336a3c;};'use strict';var schema=require(_0x540e('0x0'));var _=require(_0x540e('0x1'));var htmlToText=require(_0x540e('0x2'));var utils=require(_0x540e('0x3'));var logger=require(_0x540e('0x4'))(_0x540e('0x5'));var gotoif=schema({'condition':{'type':_0x540e('0x6'),'required':!![],'message':_0x540e('0x7')},'priorityTrue':{'type':_0x540e('0x8'),'message':_0x540e('0x9')},'priorityFalse':{'type':_0x540e('0x8'),'message':_0x540e('0xa')}});exports[_0x540e('0xb')]=function(_0x51514e,_0x12c7e2){return function(_0x300a8c){try{var _0x47391e={'condition':htmlToText['fromString'](utils[_0x540e('0xc')](_0x12c7e2[0x0],this),{'wordwrap':![]})[_0x540e('0xd')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x12c7e2[0x1],'priorityFalse':_0x12c7e2[0x2]};var _0x44fa44=gotoif[_0x540e('0x0')](_0x47391e,{'typecast':!![]});if(_0x44fa44[_0x540e('0xe')]){logger[_0x540e('0xf')](_0x540e('0x10'),_0x51514e,_[_0x540e('0x11')](_0x44fa44,_0x540e('0x12'))['join'](',\x20'));_0x300a8c[_0x540e('0x13')]();}else{try{var _0x20c042=eval('('+_0x47391e[_0x540e('0x14')]+')');var _0x17ed44=_0x20c042?_0x47391e[_0x540e('0x15')]:_0x47391e[_0x540e('0x16')];logger[_0x540e('0x17')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x51514e,_0x47391e[_0x540e('0x14')],_0x20c042,_0x17ed44||_0x540e('0x18'));if(_0x17ed44){var _0x3e1572=_[_0x540e('0x19')](_0x300a8c[_0x540e('0x1a')](),{'p':_0x17ed44});if(_0x3e1572>=0x0){logger['info'](_0x540e('0x1b'),_0x51514e,_0x17ed44||'next',_0x3e1572);_0x300a8c[_0x540e('0x18')](_0x3e1572);}else{logger['info'](_0x540e('0x1c'),_0x51514e,_0x17ed44||_0x540e('0x18'));_0x300a8c[_0x540e('0x13')]();}}else{_0x300a8c['next']();}}catch(_0x44c672){logger['error'](_0x540e('0x1d'),_0x51514e,_0x44c672['message']);_0x300a8c[_0x540e('0x13')]();}}}catch(_0x171e17){logger[_0x540e('0xf')]('[%s][GOTOIF]\x20%s',_0x51514e,JSON[_0x540e('0x1e')](_0x171e17));_0x300a8c[_0x540e('0x13')]();}};}; \ No newline at end of file +var _0xa608=['condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','number','consequence','fromString','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','map','join','condition','priorityTrue','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','stop','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','string'];(function(_0x46f6d8,_0x2c8754){var _0x32455c=function(_0x129b93){while(--_0x129b93){_0x46f6d8['push'](_0x46f6d8['shift']());}};_0x32455c(++_0x2c8754);}(_0xa608,0x81));var _0x8a60=function(_0xdb1c42,_0x4d6ce0){_0xdb1c42=_0xdb1c42-0x0;var _0x51ee81=_0xa608[_0xdb1c42];return _0x51ee81;};'use strict';var schema=require(_0x8a60('0x0'));var _=require(_0x8a60('0x1'));var htmlToText=require(_0x8a60('0x2'));var utils=require(_0x8a60('0x3'));var logger=require(_0x8a60('0x4'))('routing');var gotoif=schema({'condition':{'type':_0x8a60('0x5'),'required':!![],'message':_0x8a60('0x6')},'priorityTrue':{'type':'number','message':_0x8a60('0x7')},'priorityFalse':{'type':_0x8a60('0x8'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0x8a60('0x9')]=function(_0x54214c,_0x55cb70){return function(_0x3e9938){try{var _0x13036e={'condition':htmlToText[_0x8a60('0xa')](utils[_0x8a60('0xb')](_0x55cb70[0x0],this),{'wordwrap':![]})[_0x8a60('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x55cb70[0x1],'priorityFalse':_0x55cb70[0x2]};var _0xdc0c25=gotoif[_0x8a60('0x0')](_0x13036e,{'typecast':!![]});if(_0xdc0c25[_0x8a60('0xd')]){logger[_0x8a60('0xe')](_0x8a60('0xf'),_0x54214c,_[_0x8a60('0x10')](_0xdc0c25,'message')[_0x8a60('0x11')](',\x20'));_0x3e9938['stop']();}else{try{var _0x34dfa1=eval('('+_0x13036e[_0x8a60('0x12')]+')');var _0x32a319=_0x34dfa1?_0x13036e[_0x8a60('0x13')]:_0x13036e['priorityFalse'];logger[_0x8a60('0x14')](_0x8a60('0x15'),_0x54214c,_0x13036e[_0x8a60('0x12')],_0x34dfa1,_0x32a319||_0x8a60('0x16'));if(_0x32a319){var _0x1e19ea=_['findIndex'](_0x3e9938['rules'](),{'p':_0x32a319});if(_0x1e19ea>=0x0){logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x54214c,_0x32a319||_0x8a60('0x16'),_0x1e19ea);_0x3e9938[_0x8a60('0x16')](_0x1e19ea);}else{logger[_0x8a60('0x14')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x54214c,_0x32a319||'next');_0x3e9938['stop']();}}else{_0x3e9938[_0x8a60('0x16')]();}}catch(_0x14e933){logger[_0x8a60('0xe')](_0x8a60('0x17'),_0x54214c,_0x14e933[_0x8a60('0x18')]);_0x3e9938[_0x8a60('0x19')]();}}}catch(_0x4487b4){logger[_0x8a60('0xe')](_0x8a60('0xf'),_0x54214c,JSON[_0x8a60('0x1a')](_0x4487b4));_0x3e9938[_0x8a60('0x19')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index 9fabdcd..036aa11 100644 --- a/server/services/routing/server/applications/gotop.js +++ b/server/services/routing/server/applications/gotop.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfdcd=['[%s][GOTOP]\x20%s','message','stop','info','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','validate','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xfdcd,0x162));var _0xdfdc=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xfdcd[_0x2dafbe];return _0x58a45a;};'use strict';var schema=require(_0xdfdc('0x0'));var _=require('lodash');var logger=require('../../../../config/logger')(_0xdfdc('0x1'));var gotop=schema({'priority':{'type':_0xdfdc('0x2'),'required':!![],'message':_0xdfdc('0x3')}});exports[_0xdfdc('0x4')]=function(_0x4a149d,_0x1d0dab){return function(_0x539e2a){try{var _0x3bc9e7={'priority':_0x1d0dab[0x0]};var _0x5d08c2=gotop[_0xdfdc('0x0')](_0x3bc9e7,{'typecast':!![]});if(_0x5d08c2[_0xdfdc('0x5')]){logger['error'](_0xdfdc('0x6'),_0x4a149d,_['map'](_0x5d08c2,_0xdfdc('0x7'))['join'](',\x20'));_0x539e2a[_0xdfdc('0x8')]();}else{logger[_0xdfdc('0x9')]('[%s][GOTOP]\x20priority\x20%s',_0x4a149d,_0x3bc9e7[_0xdfdc('0xa')]);if(_0x3bc9e7[_0xdfdc('0xa')]){var _0x585430=_['findIndex'](_0x539e2a[_0xdfdc('0xb')](),{'p':_0x3bc9e7[_0xdfdc('0xa')]});if(_0x585430>=0x0){logger[_0xdfdc('0x9')](_0xdfdc('0xc'),_0x4a149d,_0x3bc9e7[_0xdfdc('0xa')]||_0xdfdc('0xd'),_0x585430);_0x539e2a[_0xdfdc('0xd')](_0x585430);}else{logger[_0xdfdc('0x9')](_0xdfdc('0xe'),_0x4a149d,_0x3bc9e7[_0xdfdc('0xa')]||'next');_0x539e2a[_0xdfdc('0x8')]();}}else{_0x539e2a[_0xdfdc('0xd')]();}}}catch(_0x3ded69){logger['error']('[%s][GOTOP]\x20%s',_0x4a149d,JSON['stringify'](_0x3ded69));_0x539e2a[_0xdfdc('0x8')]();}};}; \ No newline at end of file +var _0x0b83=['[%s][GOTOP]\x20priority\x20%s\x20not\x20found','error','stringify','validate','../../../../config/logger','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','[%s][GOTOP]\x20%s','map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next'];(function(_0x2dacca,_0x3b55a5){var _0x4e8745=function(_0x4c4515){while(--_0x4c4515){_0x2dacca['push'](_0x2dacca['shift']());}};_0x4e8745(++_0x3b55a5);}(_0x0b83,0x193));var _0x30b8=function(_0x14d6de,_0x4dc628){_0x14d6de=_0x14d6de-0x0;var _0x1a6bcc=_0x0b83[_0x14d6de];return _0x1a6bcc;};'use strict';var schema=require(_0x30b8('0x0'));var _=require('lodash');var logger=require(_0x30b8('0x1'))('routing');var gotop=schema({'priority':{'type':_0x30b8('0x2'),'required':!![],'message':_0x30b8('0x3')}});exports[_0x30b8('0x4')]=function(_0x1217e9,_0x8f065f){return function(_0x462858){try{var _0x3da339={'priority':_0x8f065f[0x0]};var _0x4b53ec=gotop['validate'](_0x3da339,{'typecast':!![]});if(_0x4b53ec[_0x30b8('0x5')]){logger['error'](_0x30b8('0x6'),_0x1217e9,_[_0x30b8('0x7')](_0x4b53ec,_0x30b8('0x8'))[_0x30b8('0x9')](',\x20'));_0x462858[_0x30b8('0xa')]();}else{logger[_0x30b8('0xb')](_0x30b8('0xc'),_0x1217e9,_0x3da339['priority']);if(_0x3da339[_0x30b8('0xd')]){var _0x2e333c=_['findIndex'](_0x462858[_0x30b8('0xe')](),{'p':_0x3da339[_0x30b8('0xd')]});if(_0x2e333c>=0x0){logger['info'](_0x30b8('0xf'),_0x1217e9,_0x3da339[_0x30b8('0xd')]||_0x30b8('0x10'),_0x2e333c);_0x462858[_0x30b8('0x10')](_0x2e333c);}else{logger[_0x30b8('0xb')](_0x30b8('0x11'),_0x1217e9,_0x3da339['priority']||_0x30b8('0x10'));_0x462858['stop']();}}else{_0x462858['next']();}}}catch(_0x3758fe){logger[_0x30b8('0x12')](_0x30b8('0x6'),_0x1217e9,JSON[_0x30b8('0x13')](_0x3758fe));_0x462858[_0x30b8('0xa')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index 0046e07..e3f083c 100644 --- a/server/services/routing/server/applications/message.js +++ b/server/services/routing/server/applications/message.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6208=['interaction','Message','create','then','next','catch','error','[%s][MESSAGE]\x20%s','stringify','stop','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','chat','ChatWebsiteId','upperFirst','channel','account','InteractionId'];(function(_0x255c14,_0x1cda1b){var _0x128deb=function(_0x2e6bee){while(--_0x2e6bee){_0x255c14['push'](_0x255c14['shift']());}};_0x128deb(++_0x1cda1b);}(_0x6208,0x192));var _0x8620=function(_0x2d4065,_0x38dc95){_0x2d4065=_0x2d4065-0x0;var _0xef6016=_0x6208[_0x2d4065];return _0xef6016;};'use strict';var _=require('lodash');var utils=require(_0x8620('0x0'));var logger=require(_0x8620('0x1'))(_0x8620('0x2'));var rpc={'chatMessage':require(_0x8620('0x3')),'openchannelMessage':require(_0x8620('0x4')),'mailMessage':require(_0x8620('0x5')),'smsMessage':require(_0x8620('0x6')),'faxMessage':require(_0x8620('0x7')),'whatsappMessage':require(_0x8620('0x8'))};exports[_0x8620('0x9')]=function(_0x47a088,_0x1069e7){return function(_0x431cfc){try{var _0x25e426={'body':utils[_0x8620('0xa')](_0x1069e7[0x0],this),'ContactId':this[_0x8620('0xb')]['id']};if(this['channel']===_0x8620('0xc')){_0x25e426[_0x8620('0xd')]=this['account']['id'];}else{_0x25e426[_[_0x8620('0xe')](this[_0x8620('0xf')])+'AccountId']=this[_0x8620('0x10')]['id'];}_0x25e426[_[_0x8620('0xe')](this['channel'])+_0x8620('0x11')]=this[_0x8620('0x12')]['id'];if(rpc[this[_0x8620('0xf')]+'Message']){return rpc[this[_0x8620('0xf')]+_0x8620('0x13')][_0x8620('0x14')](_0x25e426)[_0x8620('0x15')](function(_0x18de65){logger['info']('[%s][MESSAGE]\x20%s',_0x47a088,_0x25e426['body']);_0x431cfc[_0x8620('0x16')]();})[_0x8620('0x17')](function(_0x2b6dda){logger[_0x8620('0x18')](_0x8620('0x19'),_0x47a088,JSON[_0x8620('0x1a')](_0x2b6dda));_0x431cfc['stop']();});}}catch(_0x461e41){logger[_0x8620('0x18')](_0x8620('0x19'),_0x47a088,JSON[_0x8620('0x1a')](_0x461e41));_0x431cfc[_0x8620('0x1b')]();}};}; \ No newline at end of file +var _0xaa0c=['InteractionId','interaction','Message','create','[%s][MESSAGE]\x20%s','body','next','error','stringify','stop','lodash','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','AccountId'];(function(_0x3f1952,_0x3482fd){var _0x32dccb=function(_0x367b9b){while(--_0x367b9b){_0x3f1952['push'](_0x3f1952['shift']());}};_0x32dccb(++_0x3482fd);}(_0xaa0c,0xfa));var _0xcaa0=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0xaa0c[_0x5a95fa];return _0x1a61b8;};'use strict';var _=require(_0xcaa0('0x0'));var utils=require('./utils');var logger=require(_0xcaa0('0x1'))(_0xcaa0('0x2'));var rpc={'chatMessage':require(_0xcaa0('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xcaa0('0x4')),'smsMessage':require(_0xcaa0('0x5')),'faxMessage':require(_0xcaa0('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x22de82,_0x1cf755){return function(_0x1ef798){try{var _0xe2abcf={'body':utils[_0xcaa0('0x7')](_0x1cf755[0x0],this),'ContactId':this[_0xcaa0('0x8')]['id']};if(this[_0xcaa0('0x9')]===_0xcaa0('0xa')){_0xe2abcf[_0xcaa0('0xb')]=this[_0xcaa0('0xc')]['id'];}else{_0xe2abcf[_['upperFirst'](this[_0xcaa0('0x9')])+_0xcaa0('0xd')]=this['account']['id'];}_0xe2abcf[_['upperFirst'](this[_0xcaa0('0x9')])+_0xcaa0('0xe')]=this[_0xcaa0('0xf')]['id'];if(rpc[this[_0xcaa0('0x9')]+_0xcaa0('0x10')]){return rpc[this[_0xcaa0('0x9')]+_0xcaa0('0x10')][_0xcaa0('0x11')](_0xe2abcf)['then'](function(_0x34532c){logger['info'](_0xcaa0('0x12'),_0x22de82,_0xe2abcf[_0xcaa0('0x13')]);_0x1ef798[_0xcaa0('0x14')]();})['catch'](function(_0xcddf3){logger[_0xcaa0('0x15')](_0xcaa0('0x12'),_0x22de82,JSON[_0xcaa0('0x16')](_0xcddf3));_0x1ef798[_0xcaa0('0x17')]();});}}catch(_0x1a0d61){logger['error'](_0xcaa0('0x12'),_0x22de82,JSON[_0xcaa0('0x16')](_0x1a0d61));_0x1ef798[_0xcaa0('0x17')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index b814c50..21b8dbd 100644 --- a/server/services/routing/server/applications/noop.js +++ b/server/services/routing/server/applications/noop.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1e89=['error','stringify','stop','./utils','../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next'];(function(_0x1f65cd,_0x46ff70){var _0x1ae0b6=function(_0x113434){while(--_0x113434){_0x1f65cd['push'](_0x1f65cd['shift']());}};_0x1ae0b6(++_0x46ff70);}(_0x1e89,0xf5));var _0x91e8=function(_0x5e1c16,_0x279767){_0x5e1c16=_0x5e1c16-0x0;var _0x9ad669=_0x1e89[_0x5e1c16];return _0x9ad669;};'use strict';var utils=require(_0x91e8('0x0'));var logger=require(_0x91e8('0x1'))(_0x91e8('0x2'));exports[_0x91e8('0x3')]=function(_0x3a0c27,_0x54a69c){return function(_0x1d570f){try{logger[_0x91e8('0x4')](_0x91e8('0x5'),_0x3a0c27,utils[_0x91e8('0x6')](_0x54a69c[0x0],this));_0x1d570f[_0x91e8('0x7')]();}catch(_0x4954aa){logger[_0x91e8('0x8')](_0x91e8('0x5'),_0x3a0c27,JSON[_0x91e8('0x9')](_0x4954aa));_0x1d570f[_0x91e8('0xa')]();}};}; \ No newline at end of file +var _0x2ccd=['./utils','../../../../config/logger','routing','consequence','[%s][NOOP]\x20%s','getMustacheRender','next','error','stringify','stop'];(function(_0x54ee7e,_0x1e4e90){var _0x5280af=function(_0x34adb2){while(--_0x34adb2){_0x54ee7e['push'](_0x54ee7e['shift']());}};_0x5280af(++_0x1e4e90);}(_0x2ccd,0x172));var _0xd2cc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2ccd[_0x321bb2];return _0x9c12ed;};'use strict';var utils=require(_0xd2cc('0x0'));var logger=require(_0xd2cc('0x1'))(_0xd2cc('0x2'));exports[_0xd2cc('0x3')]=function(_0x3411bc,_0x403e89){return function(_0x48315c){try{logger['info'](_0xd2cc('0x4'),_0x3411bc,utils[_0xd2cc('0x5')](_0x403e89[0x0],this));_0x48315c[_0xd2cc('0x6')]();}catch(_0xd4f58a){logger[_0xd2cc('0x7')]('[%s][NOOP]\x20%s',_0x3411bc,JSON[_0xd2cc('0x8')](_0xd4f58a));_0x48315c[_0xd2cc('0x9')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index 304abc9..86337c1 100644 --- a/server/services/routing/server/applications/queue.js +++ b/server/services/routing/server/applications/queue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2741=['[%s][QUEUE]\x20%s','map','join','stop','find','Queues','createQueue','atimeout','qtimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','rules','complete','close','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','lodash','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','./strategy','redis','localhost','socket.io-emitter','queue_id','account','from','joinAt','clone','capitalize','InteractionId','format','%sQueuesWaitingInteractions','pick','%s_queue_waiting_interaction:%s','save','remove','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxInteraction','../../rpc/openchannelInteraction','../../rpc/whatsappInteraction','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','interaction','MessageId','message','chat','AccountId','WebsiteId','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','error','accepted','info','[%s][STOP:QUEUE][NAME:%s]','then','update','update\x20queue\x20report','timeout','catch','toLowerCase','consequence','length'];(function(_0x142c5d,_0x4b498c){var _0x76373b=function(_0x4905e7){while(--_0x4905e7){_0x142c5d['push'](_0x142c5d['shift']());}};_0x76373b(++_0x4b498c);}(_0x2741,0x1b8));var _0x1274=function(_0x2b193e,_0x8d000a){_0x2b193e=_0x2b193e-0x0;var _0x5e24e8=_0x2741[_0x2b193e];return _0x5e24e8;};'use strict';var schema=require(_0x1274('0x0'));var _=require(_0x1274('0x1'));var util=require('util');var seqqueue=require(_0x1274('0x2'));var moment=require(_0x1274('0x3'));var Redis=require(_0x1274('0x4'));var config=require(_0x1274('0x5'));var logger=require(_0x1274('0x6'))('routing');var strategy=require(_0x1274('0x7'));config[_0x1274('0x8')]=_['defaults'](config[_0x1274('0x8')],{'host':_0x1274('0x9'),'port':0x18eb});var io=require(_0x1274('0xa'))(new Redis(config['redis']));var attributes=['id',_0x1274('0xb'),_0x1274('0xc'),'queue',_0x1274('0xd'),_0x1274('0xe')];function emit(_0x525819,_0xfa5168,_0x319c76){io['to'](_0x525819)['emit'](_0xfa5168,_0x319c76);}function emitChannelQueueInteraction(_0x353cf9,_0x577738,_0x203e37,_0x524476,_0x22d12a,_0x5c7987,_0x15fec8,_0x1b4704){var _0x29b730=_[_0x1274('0xf')](_0x203e37);_0x29b730[_0x1274('0xb')]=_0x1b4704;_0x29b730['queue']=_0x577738;_0x29b730['account']=_0x524476;_0x29b730['id']=_0x22d12a;if(_0x5c7987){attributes['push'](_[_0x1274('0x10')](_0x353cf9)+_0x1274('0x11'));_0x15fec8[util[_0x1274('0x12')](_0x1274('0x13'),_0x353cf9)][_0x22d12a]=_[_0x1274('0x14')](_0x29b730,attributes);}else{delete _0x15fec8[util['format'](_0x1274('0x13'),_0x353cf9)][_0x22d12a];}emit(util[_0x1274('0x12')]('%s:queue:%s',_0x353cf9,_0x577738),util[_0x1274('0x12')](_0x1274('0x15'),_0x353cf9,_0x5c7987?_0x1274('0x16'):_0x1274('0x17')),_['pick'](_0x29b730,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x1274('0x18')),'chatQueueReport':require(_0x1274('0x19')),'smsQueueReport':require(_0x1274('0x1a')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require('../../rpc/whatsappQueueReport'),'chatInteraction':require('../../rpc/chatInteraction'),'faxInteraction':require(_0x1274('0x1b')),'mailInteraction':require('../../rpc/mailInteraction'),'openchannelInteraction':require(_0x1274('0x1c')),'smsInteraction':require('../../rpc/smsInteraction'),'whatsappInteraction':require(_0x1274('0x1d'))};var queue=schema({'name':{'type':_0x1274('0x1e'),'required':!![],'message':_0x1274('0x1f')},'timeout':{'type':_0x1274('0x20'),'message':_0x1274('0x21')}});function startRouting(_0x23dcaa,_0x1129c8,_0x4da228,_0x18c6b6){if(_0x23dcaa&&_0x1129c8&&_0x4da228){_0x1129c8[_0x1274('0x22')]+=0x1;var _0x90eff1={'uniqueid':_0x23dcaa,'from':_0x4da228['body']?_0x4da228[_0x1274('0x23')]['from']:'','joinAt':moment()[_0x1274('0x12')](_0x1274('0x24')),'ContactId':_0x4da228['contact']?_0x4da228[_0x1274('0x25')]['id']:null,'ListId':_0x4da228[_0x1274('0x26')]?_0x4da228[_0x1274('0x26')]['id']:null};_0x90eff1[_[_0x1274('0x27')](_0x4da228[_0x1274('0x28')])+_0x1274('0x29')]=_0x1129c8['id']||null;_0x90eff1[_[_0x1274('0x27')](_0x4da228[_0x1274('0x28')])+_0x1274('0x11')]=_0x4da228[_0x1274('0x2a')]?_0x4da228[_0x1274('0x2a')]['id']:null;_0x90eff1[_[_0x1274('0x27')](_0x4da228['channel'])+_0x1274('0x2b')]=_0x4da228[_0x1274('0x2c')]?_0x4da228['message']['id']:null;_0x90eff1[_[_0x1274('0x27')](_0x4da228['channel'])+(_0x4da228[_0x1274('0x28')]!==_0x1274('0x2d')?_0x1274('0x2e'):_0x1274('0x2f'))]=_0x4da228[_0x1274('0xc')]?_0x4da228[_0x1274('0xc')]['id']:null;logger['info'](util[_0x1274('0x12')](_0x1274('0x30'),_0x23dcaa,_0x1129c8[_0x1274('0x31')]));emitChannelQueueInteraction(_0x4da228['channel'],_0x1129c8['name'],_0x90eff1,_0x4da228['account'][_0x1274('0x31')],_0x4da228['message']['id'],!![],_0x18c6b6,_0x1129c8['id']);if(rpc[_0x4da228[_0x1274('0x28')]+_0x1274('0x32')]){return rpc[_0x4da228[_0x1274('0x28')]+_0x1274('0x32')][_0x1274('0x33')](_0x90eff1)['catch'](function(_0x530b9b){logger[_0x1274('0x34')]('create\x20queue\x20report',_0x530b9b);});}}}function stopRouting(_0xce1aa7,_0x53b1b1,_0x1eee1a,_0x4ce5ee){if(_0xce1aa7&&_0x53b1b1){_0x53b1b1[_0x1274('0x22')]-=0x1;var _0x2eee5f={'leaveAt':moment()['format'](_0x1274('0x24')),'acceptAt':moment()[_0x1274('0x12')](_0x1274('0x24')),'reason':_0x1274('0x35')};logger[_0x1274('0x36')](util['format'](_0x1274('0x37'),_0xce1aa7,_0x53b1b1[_0x1274('0x31')]));emitChannelQueueInteraction(_0x1eee1a[_0x1274('0x28')],_0x53b1b1['name'],_0x1eee1a[_0x1274('0x23')],_0x1eee1a[_0x1274('0xc')]['name'],_0x1eee1a[_0x1274('0x2c')]['id'],![],_0x4ce5ee,_0x53b1b1['id']);return rpc[_0x1eee1a['channel']+'Interaction']['update'](_0x1eee1a[_0x1274('0x2a')]['id'],{'queueId':_0x53b1b1['id']})[_0x1274('0x38')](function(){if(rpc[_0x1eee1a['channel']+_0x1274('0x32')]){return rpc[_0x1eee1a['channel']+_0x1274('0x32')][_0x1274('0x39')](_0xce1aa7,_0x2eee5f)['catch'](function(_0xb54ba1){logger['error'](_0x1274('0x3a'),_0xb54ba1);});}});}}function endRouting(_0x3573e5,_0x45b9e6,_0x16f12a,_0x2a37c8){if(_0x3573e5&&_0x45b9e6){_0x45b9e6[_0x1274('0x22')]-=0x1;var _0x197c83={'leaveAt':moment()[_0x1274('0x12')](_0x1274('0x24')),'exitAt':moment()['format'](_0x1274('0x24')),'reason':_0x1274('0x3b')};logger[_0x1274('0x36')](util['format']('[%s][END:QUEUE][NAME:%s]',_0x3573e5,_0x45b9e6['name']));emitChannelQueueInteraction(_0x16f12a[_0x1274('0x28')],_0x45b9e6['name'],_0x16f12a[_0x1274('0x23')],_0x16f12a[_0x1274('0xc')]['name'],_0x16f12a[_0x1274('0x2c')]['id'],![],_0x2a37c8);if(rpc[_0x16f12a[_0x1274('0x28')]+_0x1274('0x32')]){return rpc[_0x16f12a[_0x1274('0x28')]+_0x1274('0x32')][_0x1274('0x39')](_0x3573e5,_0x197c83)[_0x1274('0x3c')](function(_0x201495){logger[_0x1274('0x34')](_0x1274('0x3a'),_0x201495);});}}}function handleFindQueue(_0x1a85d3){return function(_0x4a7699){return _0x4a7699[_0x1274('0x31')]['toLowerCase']()===_0x1a85d3[_0x1274('0x3d')]();};}exports[_0x1274('0x3e')]=function(_0x467570,_0x367d17,_0x3648c1,_0x3b57c4){return function(_0x2d872f){try{var _0x5d97b8={'name':_0x367d17[0x0],'timeout':_0x367d17[0x1]};var _0x35885f=queue[_0x1274('0x0')](_0x5d97b8,{'typecast':!![]});if(_0x35885f[_0x1274('0x3f')]){logger[_0x1274('0x34')](_0x1274('0x40'),_0x467570,_[_0x1274('0x41')](_0x35885f,_0x1274('0x2c'))[_0x1274('0x42')](',\x20'));_0x2d872f[_0x1274('0x43')]();}else{var _0x3ec0e1=_[_0x1274('0x44')](_0x3648c1[_0x3b57c4['channel']+_0x1274('0x45')],handleFindQueue(_0x5d97b8[_0x1274('0x31')]));if(_0x3ec0e1){startRouting(_0x467570,_0x3ec0e1,_0x3b57c4,_0x3648c1);var _0x2ed96c=(_0x3ec0e1[_0x1274('0x3b')]||0xa)*0x3e8;var _0x3ca826=(_0x5d97b8['timeout']||0x14)*0x3e8;var _0xcd0faf;if(_0x2ed96c>_0x3ca826){_0x3ca826=_0x2ed96c;}var _0x3c0851=seqqueue[_0x1274('0x46')](_0x2ed96c);_0x3c0851['id']=_0x467570;_0x3c0851[_0x1274('0x47')]=_0x2ed96c;_0x3c0851[_0x1274('0x48')]=_0x3ca826;_0x3c0851[_0x1274('0x28')]=_0x3b57c4['channel'];_0x3648c1['rules'][_0x467570]['on'](_0x1274('0x49'),function(){logger[_0x1274('0x36')](_0x1274('0x4a'),_0x467570);stopRouting(_0x467570,_0x3ec0e1,_0x3b57c4,_0x3648c1);clearTimeout(_0xcd0faf);_0xcd0faf=undefined;_0x3c0851['close'](!![]);if(_0x3648c1[_0x1274('0x4b')][_0x467570]){delete _0x3648c1['rules'][_0x467570];}_0x2d872f[_0x1274('0x43')]();});_0x3648c1[_0x1274('0x4b')][_0x467570]['on'](_0x1274('0x4c'),function(){if(_0x3648c1[_0x1274('0x4b')][_0x467570]){delete _0x3648c1['rules'][_0x467570];}});_0xcd0faf=setTimeout(function(){logger['info']('[%s][QUEUE]\x20APPLICATION\x20END',_0x467570);endRouting(_0x467570,_0x3ec0e1,_0x3b57c4,_0x3648c1);clearTimeout(_0xcd0faf);_0x3c0851[_0x1274('0x4d')](!![]);_0x2d872f[_0x1274('0x4e')]();},_0x3ca826);switch(_0x3ec0e1[_0x1274('0x4f')]){case _0x1274('0x50'):strategy[_0x1274('0x50')](_0x3c0851,_0x3ec0e1,_0x3648c1,_0x3b57c4);break;default:strategy[_0x1274('0x51')](_0x3c0851,_0x3ec0e1,_0x3648c1,_0x3b57c4);}}else{logger[_0x1274('0x34')](_0x1274('0x52'),_0x467570,_0x5d97b8[_0x1274('0x31')]);_0x2d872f[_0x1274('0x43')]();}}}catch(_0x233968){logger[_0x1274('0x34')](_0x1274('0x40'),_0x467570,_0x233968[_0x1274('0x53')]);_0x2d872f[_0x1274('0x43')]();}};}; \ No newline at end of file +var _0xf746=['../../../../config/logger','./strategy','redis','localhost','socket.io-emitter','account','queue','from','queue_id','push','capitalize','InteractionId','format','pick','%sQueuesWaitingInteractions','%s:queue:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','QueueId','upperFirst','interaction','MessageId','message','AccountId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','waiting','accepted','[%s][STOP:QUEUE][NAME:%s]','update','then','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','validate','[%s][QUEUE]\x20%s','join','stop','Queues','timeout','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','complete','[%s][QUEUE]\x20APPLICATION\x20END','close','next','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','lodash','util','seq-queue','moment','ioredis','../../../../config/environment'];(function(_0x2394a6,_0x421f11){var _0x2bc864=function(_0x5b595b){while(--_0x5b595b){_0x2394a6['push'](_0x2394a6['shift']());}};_0x2bc864(++_0x421f11);}(_0xf746,0xf3));var _0x6f74=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xf746[_0x618414];return _0x21c19a;};'use strict';var schema=require('validate');var _=require(_0x6f74('0x0'));var util=require(_0x6f74('0x1'));var seqqueue=require(_0x6f74('0x2'));var moment=require(_0x6f74('0x3'));var Redis=require(_0x6f74('0x4'));var config=require(_0x6f74('0x5'));var logger=require(_0x6f74('0x6'))('routing');var strategy=require(_0x6f74('0x7'));config[_0x6f74('0x8')]=_['defaults'](config['redis'],{'host':_0x6f74('0x9'),'port':0x18eb});var io=require(_0x6f74('0xa'))(new Redis(config[_0x6f74('0x8')]));var attributes=['id','queue_id',_0x6f74('0xb'),_0x6f74('0xc'),_0x6f74('0xd'),'joinAt'];function emit(_0x6e4734,_0x5717d8,_0x407c3b){io['to'](_0x6e4734)['emit'](_0x5717d8,_0x407c3b);}function emitChannelQueueInteraction(_0x2e00bb,_0x7d4513,_0x11bdaa,_0x4a2736,_0x2010b0,_0x5cb994,_0x41f308,_0x2c4f33){var _0x21cfad=_['clone'](_0x11bdaa);_0x21cfad[_0x6f74('0xe')]=_0x2c4f33;_0x21cfad['queue']=_0x7d4513;_0x21cfad[_0x6f74('0xb')]=_0x4a2736;_0x21cfad['id']=_0x2010b0;if(_0x5cb994){attributes[_0x6f74('0xf')](_[_0x6f74('0x10')](_0x2e00bb)+_0x6f74('0x11'));_0x41f308[util[_0x6f74('0x12')]('%sQueuesWaitingInteractions',_0x2e00bb)][_0x2010b0]=_[_0x6f74('0x13')](_0x21cfad,attributes);}else{delete _0x41f308[util[_0x6f74('0x12')](_0x6f74('0x14'),_0x2e00bb)][_0x2010b0];}emit(util[_0x6f74('0x12')](_0x6f74('0x15'),_0x2e00bb,_0x7d4513),util[_0x6f74('0x12')]('%s_queue_waiting_interaction:%s',_0x2e00bb,_0x5cb994?_0x6f74('0x16'):_0x6f74('0x17')),_['pick'](_0x21cfad,attributes));}var rpc={'openchannelQueueReport':require(_0x6f74('0x18')),'mailQueueReport':require(_0x6f74('0x19')),'chatQueueReport':require(_0x6f74('0x1a')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0x6f74('0x1b')),'whatsappQueueReport':require(_0x6f74('0x1c')),'chatInteraction':require(_0x6f74('0x1d')),'faxInteraction':require('../../rpc/faxInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'openchannelInteraction':require(_0x6f74('0x1e')),'smsInteraction':require(_0x6f74('0x1f')),'whatsappInteraction':require(_0x6f74('0x20'))};var queue=schema({'name':{'type':_0x6f74('0x21'),'required':!![],'message':_0x6f74('0x22')},'timeout':{'type':_0x6f74('0x23'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x2c44e0,_0x5b3fe8,_0xe643fc,_0x42fedd){if(_0x2c44e0&&_0x5b3fe8&&_0xe643fc){_0x5b3fe8['waiting']+=0x1;var _0x48b991={'uniqueid':_0x2c44e0,'from':_0xe643fc[_0x6f74('0x24')]?_0xe643fc[_0x6f74('0x24')][_0x6f74('0xd')]:'','joinAt':moment()['format'](_0x6f74('0x25')),'ContactId':_0xe643fc[_0x6f74('0x26')]?_0xe643fc[_0x6f74('0x26')]['id']:null,'ListId':_0xe643fc[_0x6f74('0x27')]?_0xe643fc[_0x6f74('0x27')]['id']:null};_0x48b991[_['upperFirst'](_0xe643fc[_0x6f74('0x28')])+_0x6f74('0x29')]=_0x5b3fe8['id']||null;_0x48b991[_[_0x6f74('0x2a')](_0xe643fc['channel'])+_0x6f74('0x11')]=_0xe643fc[_0x6f74('0x2b')]?_0xe643fc['interaction']['id']:null;_0x48b991[_[_0x6f74('0x2a')](_0xe643fc[_0x6f74('0x28')])+_0x6f74('0x2c')]=_0xe643fc[_0x6f74('0x2d')]?_0xe643fc[_0x6f74('0x2d')]['id']:null;_0x48b991[_[_0x6f74('0x2a')](_0xe643fc[_0x6f74('0x28')])+(_0xe643fc[_0x6f74('0x28')]!=='chat'?_0x6f74('0x2e'):'WebsiteId')]=_0xe643fc['account']?_0xe643fc[_0x6f74('0xb')]['id']:null;logger[_0x6f74('0x2f')](util[_0x6f74('0x12')](_0x6f74('0x30'),_0x2c44e0,_0x5b3fe8[_0x6f74('0x31')]));emitChannelQueueInteraction(_0xe643fc[_0x6f74('0x28')],_0x5b3fe8[_0x6f74('0x31')],_0x48b991,_0xe643fc['account'][_0x6f74('0x31')],_0xe643fc[_0x6f74('0x2d')]['id'],!![],_0x42fedd,_0x5b3fe8['id']);if(rpc[_0xe643fc[_0x6f74('0x28')]+'QueueReport']){return rpc[_0xe643fc['channel']+_0x6f74('0x32')][_0x6f74('0x33')](_0x48b991)[_0x6f74('0x34')](function(_0x421bae){logger[_0x6f74('0x35')](_0x6f74('0x36'),_0x421bae);});}}}function stopRouting(_0x17804b,_0x30c16a,_0x48d285,_0xe1ffba){if(_0x17804b&&_0x30c16a){_0x30c16a[_0x6f74('0x37')]-=0x1;var _0x649c8a={'leaveAt':moment()[_0x6f74('0x12')](_0x6f74('0x25')),'acceptAt':moment()[_0x6f74('0x12')](_0x6f74('0x25')),'reason':_0x6f74('0x38')};logger['info'](util[_0x6f74('0x12')](_0x6f74('0x39'),_0x17804b,_0x30c16a['name']));emitChannelQueueInteraction(_0x48d285[_0x6f74('0x28')],_0x30c16a[_0x6f74('0x31')],_0x48d285[_0x6f74('0x24')],_0x48d285[_0x6f74('0xb')][_0x6f74('0x31')],_0x48d285['message']['id'],![],_0xe1ffba,_0x30c16a['id']);return rpc[_0x48d285[_0x6f74('0x28')]+'Interaction'][_0x6f74('0x3a')](_0x48d285['interaction']['id'],{'queueId':_0x30c16a['id']})[_0x6f74('0x3b')](function(){if(rpc[_0x48d285['channel']+'QueueReport']){return rpc[_0x48d285[_0x6f74('0x28')]+_0x6f74('0x32')][_0x6f74('0x3a')](_0x17804b,_0x649c8a)[_0x6f74('0x34')](function(_0x5a8f0d){logger[_0x6f74('0x35')](_0x6f74('0x3c'),_0x5a8f0d);});}});}}function endRouting(_0x583176,_0x3175b0,_0x468ab9,_0x1bdc24){if(_0x583176&&_0x3175b0){_0x3175b0[_0x6f74('0x37')]-=0x1;var _0x260f9e={'leaveAt':moment()[_0x6f74('0x12')](_0x6f74('0x25')),'exitAt':moment()[_0x6f74('0x12')](_0x6f74('0x25')),'reason':'timeout'};logger['info'](util[_0x6f74('0x12')](_0x6f74('0x3d'),_0x583176,_0x3175b0[_0x6f74('0x31')]));emitChannelQueueInteraction(_0x468ab9[_0x6f74('0x28')],_0x3175b0[_0x6f74('0x31')],_0x468ab9[_0x6f74('0x24')],_0x468ab9[_0x6f74('0xb')]['name'],_0x468ab9['message']['id'],![],_0x1bdc24);if(rpc[_0x468ab9[_0x6f74('0x28')]+_0x6f74('0x32')]){return rpc[_0x468ab9[_0x6f74('0x28')]+_0x6f74('0x32')][_0x6f74('0x3a')](_0x583176,_0x260f9e)[_0x6f74('0x34')](function(_0x348b2b){logger[_0x6f74('0x35')](_0x6f74('0x3c'),_0x348b2b);});}}}function handleFindQueue(_0x32f8e4){return function(_0x27b85f){return _0x27b85f['name'][_0x6f74('0x3e')]()===_0x32f8e4[_0x6f74('0x3e')]();};}exports[_0x6f74('0x3f')]=function(_0x334507,_0x263492,_0x2be7dc,_0x2dda4c){return function(_0x5bf48d){try{var _0x28d3a2={'name':_0x263492[0x0],'timeout':_0x263492[0x1]};var _0x10dedd=queue[_0x6f74('0x40')](_0x28d3a2,{'typecast':!![]});if(_0x10dedd['length']){logger[_0x6f74('0x35')](_0x6f74('0x41'),_0x334507,_['map'](_0x10dedd,'message')[_0x6f74('0x42')](',\x20'));_0x5bf48d[_0x6f74('0x43')]();}else{var _0x156ed6=_['find'](_0x2be7dc[_0x2dda4c[_0x6f74('0x28')]+_0x6f74('0x44')],handleFindQueue(_0x28d3a2[_0x6f74('0x31')]));if(_0x156ed6){startRouting(_0x334507,_0x156ed6,_0x2dda4c,_0x2be7dc);var _0x4474e2=(_0x156ed6[_0x6f74('0x45')]||0xa)*0x3e8;var _0x24c840=(_0x28d3a2['timeout']||0x14)*0x3e8;var _0x449fdd;if(_0x4474e2>_0x24c840){_0x24c840=_0x4474e2;}var _0x4bcc4e=seqqueue[_0x6f74('0x46')](_0x4474e2);_0x4bcc4e['id']=_0x334507;_0x4bcc4e[_0x6f74('0x47')]=_0x4474e2;_0x4bcc4e[_0x6f74('0x48')]=_0x24c840;_0x4bcc4e['channel']=_0x2dda4c[_0x6f74('0x28')];_0x2be7dc[_0x6f74('0x49')][_0x334507]['on'](_0x6f74('0x4a'),function(){logger[_0x6f74('0x2f')](_0x6f74('0x4b'),_0x334507);stopRouting(_0x334507,_0x156ed6,_0x2dda4c,_0x2be7dc);clearTimeout(_0x449fdd);_0x449fdd=undefined;_0x4bcc4e['close'](!![]);if(_0x2be7dc[_0x6f74('0x49')][_0x334507]){delete _0x2be7dc['rules'][_0x334507];}_0x5bf48d['stop']();});_0x2be7dc[_0x6f74('0x49')][_0x334507]['on'](_0x6f74('0x4c'),function(){if(_0x2be7dc['rules'][_0x334507]){delete _0x2be7dc[_0x6f74('0x49')][_0x334507];}});_0x449fdd=setTimeout(function(){logger[_0x6f74('0x2f')](_0x6f74('0x4d'),_0x334507);endRouting(_0x334507,_0x156ed6,_0x2dda4c,_0x2be7dc);clearTimeout(_0x449fdd);_0x4bcc4e[_0x6f74('0x4e')](!![]);_0x5bf48d[_0x6f74('0x4f')]();},_0x24c840);switch(_0x156ed6['strategy']){case _0x6f74('0x50'):strategy[_0x6f74('0x50')](_0x4bcc4e,_0x156ed6,_0x2be7dc,_0x2dda4c);break;default:strategy['beepall'](_0x4bcc4e,_0x156ed6,_0x2be7dc,_0x2dda4c);}}else{logger[_0x6f74('0x35')](_0x6f74('0x51'),_0x334507,_0x28d3a2['name']);_0x5bf48d[_0x6f74('0x43')]();}}}catch(_0x1dbbba){logger[_0x6f74('0x35')]('[%s][QUEUE]\x20%s',_0x334507,_0x1dbbba[_0x6f74('0x52')]);_0x5bf48d[_0x6f74('0x43')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index 4ff730a..694dac0 100644 --- a/server/services/routing/server/applications/strategy/agent.js +++ b/server/services/routing/server/applications/strategy/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8d0e=['handleTimeout','prototype','handleDrained','debug','[%s][AGENT]\x20try\x20with\x20%s','agent','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','realtime','busy','busyQueue','saveWaitingNotification','channel','notificationId','writeLog',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','hideNotification','STOP','TIMEOUT','lodash','uuid','./util','../../../../../config/logger','routing','squeue','push','handleRun','bind'];(function(_0x134fde,_0x2f3ce2){var _0x523b4d=function(_0xb55f1f){while(--_0xb55f1f){_0x134fde['push'](_0x134fde['shift']());}};_0x523b4d(++_0x2f3ce2);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x483807,_0x11861b){_0x483807=_0x483807-0x0;var _0x1f678a=_0x8d0e[_0x483807];return _0x1f678a;};'use strict';var _=require(_0xe8d0('0x0'));var uuid=require(_0xe8d0('0x1'));var util=require(_0xe8d0('0x2'));var logger=require(_0xe8d0('0x3'))(_0xe8d0('0x4'));var Agent=function(_0x3584ab,_0x15521e,_0x940176,_0x32cee9){this['notificationId']=uuid['v4']();this[_0xe8d0('0x5')]=_0x3584ab;this['agent']=_0x15521e;this['realtime']=_0x940176;this[_0xe8d0('0x4')]=_0x32cee9;this[_0xe8d0('0x5')][_0xe8d0('0x6')](this[_0xe8d0('0x7')][_0xe8d0('0x8')](this),this[_0xe8d0('0x9')][_0xe8d0('0x8')](this));this[_0xe8d0('0x5')]['on']('timeout',this[_0xe8d0('0x9')][_0xe8d0('0x8')](this));this[_0xe8d0('0x5')]['on']('drained',this['handleDrained'][_0xe8d0('0x8')](this));};Agent[_0xe8d0('0xa')][_0xe8d0('0x6')]=function(){this[_0xe8d0('0x5')][_0xe8d0('0x6')](this[_0xe8d0('0x7')]['bind'](this),this[_0xe8d0('0x9')][_0xe8d0('0x8')](this));};Agent['prototype'][_0xe8d0('0xb')]=function(){this['handleTimeout'](!![]);};Agent['prototype'][_0xe8d0('0x7')]=function(){logger[_0xe8d0('0xc')](_0xe8d0('0xd'),this[_0xe8d0('0x5')]['id'],this[_0xe8d0('0xe')]['id']);if(_[_0xe8d0('0xf')](this['realtime'][_0xe8d0('0x10')][this['agent']['id']])){logger[_0xe8d0('0xc')](_0xe8d0('0x11'),this[_0xe8d0('0x5')]['id'],this['agent']['id']);setTimeout(this['push']['bind'](this),0x3e8);}else{if(this[_0xe8d0('0x4')][_0xe8d0('0x12')]||util[_0xe8d0('0x13')](this[_0xe8d0('0x5')]['id'],this[_0xe8d0('0x14')]['agents'][this[_0xe8d0('0xe')]['id']],this[_0xe8d0('0x5')]['channel'],![])){this['realtime']['agents'][this[_0xe8d0('0xe')]['id']][_0xe8d0('0x15')]=!![];this[_0xe8d0('0x14')][_0xe8d0('0x10')][this[_0xe8d0('0xe')]['id']][_0xe8d0('0x16')]=undefined;util[_0xe8d0('0x17')](this[_0xe8d0('0x14')],this[_0xe8d0('0x4')],this['agent'],this[_0xe8d0('0x5')][_0xe8d0('0x18')]);util['showNotification'](this[_0xe8d0('0x19')],this[_0xe8d0('0x5')]['id'],this[_0xe8d0('0x14')][_0xe8d0('0x10')][this[_0xe8d0('0xe')]['id']],null,this[_0xe8d0('0x4')]);util[_0xe8d0('0x1a')](this[_0xe8d0('0x5')]['id'],this[_0xe8d0('0x14')][_0xe8d0('0x10')][this[_0xe8d0('0xe')]['id']],'RINGING'+(this[_0xe8d0('0x4')][_0xe8d0('0x12')]?_0xe8d0('0x1b'):''));}else{logger['debug'](_0xe8d0('0x1c'),this[_0xe8d0('0x5')]['id'],this['agent']['id']);setTimeout(this[_0xe8d0('0x6')][_0xe8d0('0x8')](this),0x3e8);}}};Agent[_0xe8d0('0xa')][_0xe8d0('0x9')]=function(_0x3cf3d6){if(_['isNil'](this[_0xe8d0('0x14')]['agents'][this['agent']['id']])){return logger['debug'](_0xe8d0('0x11'),this[_0xe8d0('0x5')]['id'],this[_0xe8d0('0xe')]['id']);}else{logger['debug']('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0xe8d0('0x5')]['id'],this['agent']['id']);util[_0xe8d0('0x1d')](this[_0xe8d0('0x19')],this[_0xe8d0('0x5')]['id'],this[_0xe8d0('0x14')][_0xe8d0('0x10')][this['agent']['id']],null,this[_0xe8d0('0x4')]);this[_0xe8d0('0x14')][_0xe8d0('0x10')][this[_0xe8d0('0xe')]['id']]['busy']=![];this[_0xe8d0('0x14')][_0xe8d0('0x10')][this['agent']['id']][_0xe8d0('0x16')]=undefined;util['removeWaitingNotification'](this[_0xe8d0('0x14')],this['routing'],this[_0xe8d0('0xe')],this['squeue'][_0xe8d0('0x18')]);util[_0xe8d0('0x1a')](this[_0xe8d0('0x5')]['id'],this[_0xe8d0('0x14')]['agents'][this[_0xe8d0('0xe')]['id']],_0x3cf3d6?_0xe8d0('0x1e'):_0xe8d0('0x1f'));}if(!_0x3cf3d6){setTimeout(this['push'][_0xe8d0('0x8')](this),0x3e8);}};function agent(_0xa02b8d,_0xdfc807,_0x9cb99b,_0x1ecd41){return new Agent(_0xa02b8d,_0xdfc807,_0x9cb99b,_0x1ecd41);}module['exports']=agent; \ No newline at end of file +var _0x34e5=['saveWaitingNotification','channel','showNotification','writeLog','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','removeWaitingNotification','TIMEOUT','uuid','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','push','bind','handleTimeout','handleDrained','prototype','handleRun','debug','[%s][AGENT]\x20try\x20with\x20%s','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','busy','busyQueue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x34e5,0x172));var _0x534e=function(_0x1abf76,_0x10b76e){_0x1abf76=_0x1abf76-0x0;var _0x4d8173=_0x34e5[_0x1abf76];return _0x4d8173;};'use strict';var _=require('lodash');var uuid=require(_0x534e('0x0'));var util=require('./util');var logger=require(_0x534e('0x1'))(_0x534e('0x2'));var Agent=function(_0x425ae8,_0x246650,_0x83eb2d,_0x50b790){this[_0x534e('0x3')]=uuid['v4']();this[_0x534e('0x4')]=_0x425ae8;this[_0x534e('0x5')]=_0x246650;this[_0x534e('0x6')]=_0x83eb2d;this[_0x534e('0x2')]=_0x50b790;this[_0x534e('0x4')][_0x534e('0x7')](this['handleRun'][_0x534e('0x8')](this),this[_0x534e('0x9')][_0x534e('0x8')](this));this['squeue']['on']('timeout',this[_0x534e('0x9')]['bind'](this));this[_0x534e('0x4')]['on']('drained',this[_0x534e('0xa')][_0x534e('0x8')](this));};Agent[_0x534e('0xb')]['push']=function(){this[_0x534e('0x4')][_0x534e('0x7')](this[_0x534e('0xc')][_0x534e('0x8')](this),this[_0x534e('0x9')]['bind'](this));};Agent[_0x534e('0xb')][_0x534e('0xa')]=function(){this[_0x534e('0x9')](!![]);};Agent[_0x534e('0xb')][_0x534e('0xc')]=function(){logger[_0x534e('0xd')](_0x534e('0xe'),this[_0x534e('0x4')]['id'],this[_0x534e('0x5')]['id']);if(_['isNil'](this[_0x534e('0x6')][_0x534e('0xf')][this['agent']['id']])){logger['debug'](_0x534e('0x10'),this[_0x534e('0x4')]['id'],this[_0x534e('0x5')]['id']);setTimeout(this[_0x534e('0x7')][_0x534e('0x8')](this),0x3e8);}else{if(this[_0x534e('0x2')][_0x534e('0x11')]||util['isAgentAvailable'](this[_0x534e('0x4')]['id'],this[_0x534e('0x6')][_0x534e('0xf')][this[_0x534e('0x5')]['id']],this[_0x534e('0x4')]['channel'],![])){this[_0x534e('0x6')][_0x534e('0xf')][this[_0x534e('0x5')]['id']][_0x534e('0x12')]=!![];this[_0x534e('0x6')][_0x534e('0xf')][this[_0x534e('0x5')]['id']][_0x534e('0x13')]=undefined;util[_0x534e('0x14')](this['realtime'],this[_0x534e('0x2')],this[_0x534e('0x5')],this[_0x534e('0x4')][_0x534e('0x15')]);util[_0x534e('0x16')](this[_0x534e('0x3')],this[_0x534e('0x4')]['id'],this[_0x534e('0x6')]['agents'][this[_0x534e('0x5')]['id']],null,this['routing']);util[_0x534e('0x17')](this[_0x534e('0x4')]['id'],this[_0x534e('0x6')][_0x534e('0xf')][this[_0x534e('0x5')]['id']],'RINGING'+(this[_0x534e('0x2')][_0x534e('0x11')]?':FORCED':''));}else{logger['debug'](_0x534e('0x18'),this['squeue']['id'],this[_0x534e('0x5')]['id']);setTimeout(this[_0x534e('0x7')][_0x534e('0x8')](this),0x3e8);}}};Agent[_0x534e('0xb')][_0x534e('0x9')]=function(_0x42119b){if(_[_0x534e('0x19')](this['realtime']['agents'][this[_0x534e('0x5')]['id']])){return logger[_0x534e('0xd')](_0x534e('0x10'),this[_0x534e('0x4')]['id'],this[_0x534e('0x5')]['id']);}else{logger[_0x534e('0xd')](_0x534e('0x1a'),this[_0x534e('0x4')]['id'],this[_0x534e('0x5')]['id']);util[_0x534e('0x1b')](this[_0x534e('0x3')],this[_0x534e('0x4')]['id'],this['realtime'][_0x534e('0xf')][this[_0x534e('0x5')]['id']],null,this['routing']);this[_0x534e('0x6')]['agents'][this[_0x534e('0x5')]['id']][_0x534e('0x12')]=![];this[_0x534e('0x6')][_0x534e('0xf')][this['agent']['id']][_0x534e('0x13')]=undefined;util[_0x534e('0x1c')](this['realtime'],this['routing'],this[_0x534e('0x5')],this[_0x534e('0x4')][_0x534e('0x15')]);util[_0x534e('0x17')](this['squeue']['id'],this[_0x534e('0x6')]['agents'][this[_0x534e('0x5')]['id']],_0x42119b?'STOP':_0x534e('0x1d'));}if(!_0x42119b){setTimeout(this[_0x534e('0x7')]['bind'](this),0x3e8);}};function agent(_0x2f5cd1,_0x5c34a7,_0x593fb0,_0x519b40){return new Agent(_0x2f5cd1,_0x5c34a7,_0x593fb0,_0x519b40);}module['exports']=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index 084b921..781299a 100644 --- a/server/services/routing/server/applications/strategy/beepall.js +++ b/server/services/routing/server/applications/strategy/beepall.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x18ca=['removeWaitingNotification','exports','lodash','./util','../../../../../config/logger','routing','notificationId','squeue','queue','realtime','handleRun','bind','timeout','handleTimeout','drained','handleDrained','prototype','push','isNil','Agents','length','agents','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','RINGING','busyQueue','name','saveWaitingNotification','showNotification','debug','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','STOP','busy'];(function(_0x590c0a,_0x572885){var _0x4c36c6=function(_0x204b52){while(--_0x204b52){_0x590c0a['push'](_0x590c0a['shift']());}};_0x4c36c6(++_0x572885);}(_0x18ca,0x146));var _0xa18c=function(_0x2f4360,_0x38558){_0x2f4360=_0x2f4360-0x0;var _0x3baddf=_0x18ca[_0x2f4360];return _0x3baddf;};'use strict';var _=require(_0xa18c('0x0'));var uuid=require('uuid');var util=require(_0xa18c('0x1'));var logger=require(_0xa18c('0x2'))(_0xa18c('0x3'));var Beepall=function(_0x23a80f,_0xed0e99,_0x4c9caa,_0x474171){this[_0xa18c('0x4')]=uuid['v4']();this[_0xa18c('0x5')]=_0x23a80f;this[_0xa18c('0x6')]=_0xed0e99;this[_0xa18c('0x7')]=_0x4c9caa;this['routing']=_0x474171;this[_0xa18c('0x5')]['push'](this[_0xa18c('0x8')][_0xa18c('0x9')](this),this['handleTimeout'][_0xa18c('0x9')](this));this[_0xa18c('0x5')]['on'](_0xa18c('0xa'),this[_0xa18c('0xb')][_0xa18c('0x9')](this));this[_0xa18c('0x5')]['on'](_0xa18c('0xc'),this[_0xa18c('0xd')]['bind'](this));};Beepall[_0xa18c('0xe')][_0xa18c('0xf')]=function(){this[_0xa18c('0x5')][_0xa18c('0xf')](this[_0xa18c('0x8')][_0xa18c('0x9')](this),this[_0xa18c('0xb')]['bind'](this));};Beepall[_0xa18c('0xe')]['handleDrained']=function(){this['handleTimeout'](!![]);};Beepall[_0xa18c('0xe')][_0xa18c('0x8')]=function(){var _0x2b98b5=!![];if(!_[_0xa18c('0x10')](this[_0xa18c('0x6')])&&!_[_0xa18c('0x10')](this[_0xa18c('0x6')]['Agents'])&&this[_0xa18c('0x6')][_0xa18c('0x11')][_0xa18c('0x12')]>0x0){for(var _0xb3c899=0x0,_0x32a76a;_0xb3c8990x0){for(var _0x45bcfa=0x0,_0x2d2af3;_0x45bcfa0x0&&_0x269835[_0xed4f9f+_0xee7d('0x26')]>=_0x269835[_0xed4f9f+_0xee7d('0x25')]){writeLog(_0x2d5dd6,_0x269835,_0xed4f9f['toUpperCase']()+_0xee7d('0x27'));return![];}}return!![];};exports[_0xee7d('0x28')]=function(_0x4532cb,_0x2b9482,_0x2e2264,_0x1b4492,_0xb727c9){return sendNotification(!![],_0x4532cb,_0x2b9482,_0x2e2264,_0x1b4492,_0xb727c9);};exports[_0xee7d('0x29')]=function(_0x3dda5b,_0x589fc0,_0x440bc4,_0x4e1bf5,_0x5ca947){return sendNotification(![],_0x3dda5b,_0x589fc0,_0x440bc4,_0x4e1bf5,_0x5ca947);};exports[_0xee7d('0x2a')]=function(_0x4d4ff0,_0x151094,_0xc2e2c1){var _0x4b7786=_0x151094[_0xee7d('0x2b')][_0xee7d('0x2c')];if(!_0x4b7786&&_0xc2e2c1){_0x4b7786=_0xc2e2c1['id'];}var _0xac47ec=_[_0xee7d('0x2d')](_0x4d4ff0[_0x151094[_0xee7d('0x2e')]+'QueuesWaitingInteractions'],function(_0x382630){var _0x303e1c=_[_0xee7d('0x2f')](_0x151094[_0xee7d('0x2e')])+_0xee7d('0x30');return _0x382630[_0x303e1c]===_0x151094[_0xee7d('0x2b')]['id'];});if(!_0xac47ec&&_0x4b7786&&_0x4d4ff0[_0xee7d('0x31')][_0x4b7786]){_0xac47ec=_[_0xee7d('0x2d')](_0x4d4ff0['agents'][_0x4b7786][_0x151094[_0xee7d('0x2e')]+_0xee7d('0x32')],function(_0xccf52c){return _0xccf52c['id']===_0x151094['interaction']['id'];});}return _0xac47ec;};exports[_0xee7d('0x33')]=function(_0x571cf4,_0x3cf5fb,_0x41fc59,_0x5d04ac){if(_0x41fc59&&_0x41fc59['id']&&_0x571cf4['agents']&&_0x571cf4[_0xee7d('0x31')][_0x41fc59['id']]){_0x571cf4['agents'][_0x41fc59['id']][_0x5d04ac+_0xee7d('0x32')][_0x3cf5fb[_0xee7d('0x18')]['id']]={'id':_0x3cf5fb[_0xee7d('0x2b')]['id']};}};exports[_0xee7d('0x34')]=function(_0x140e4a,_0x53de17,_0x57f0c2,_0x389c08){if(_0x57f0c2&&_0x57f0c2['id']&&_0x140e4a['agents']&&_0x140e4a[_0xee7d('0x31')][_0x57f0c2['id']]){delete _0x140e4a[_0xee7d('0x31')][_0x57f0c2['id']][_0x389c08+_0xee7d('0x32')][_0x53de17[_0xee7d('0x18')]['id']];}};exports[_0xee7d('0x35')]=writeLog; \ No newline at end of file +var _0xa631=['format','[%s][QUEUE]\x20%s','message','notification:%s','save','debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','BUSY','online','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','showNotification','hideNotification','UserId','some','channel','capitalize','InteractionId','interaction','agents','saveWaitingNotification','WaitingInteractions','removeWaitingNotification','writeLog','util','../utils','ioredis','../../../../../config/logger','defaults','redis','localhost','user:%s','name','emit','user:save','split','\x20interaction','notificationSound','account','notificationShake','body','queue','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template'];(function(_0x9b3b9b,_0x12e67f){var _0x1fc81f=function(_0xe62528){while(--_0xe62528){_0x9b3b9b['push'](_0x9b3b9b['shift']());}};_0x1fc81f(++_0x12e67f);}(_0xa631,0xe4));var _0x1a63=function(_0x3bbaaa,_0x397900){_0x3bbaaa=_0x3bbaaa-0x0;var _0x476a1f=_0xa631[_0x3bbaaa];return _0x476a1f;};'use strict';var _=require('lodash');var util=require(_0x1a63('0x0'));var utils=require(_0x1a63('0x1'));var Redis=require(_0x1a63('0x2'));var config=require('../../../../../config/environment');var logger=require(_0x1a63('0x3'))('routing');config['redis']=_[_0x1a63('0x4')](config[_0x1a63('0x5')],{'host':_0x1a63('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function sendNotification(_0x5a2067,_0x5df65f,_0x2a8dd9,_0xf1cb96,_0xd81213,_0x58f178){io['to'](util['format'](_0x1a63('0x7'),_0xf1cb96[_0x1a63('0x8')]))[_0x1a63('0x9')](_0x1a63('0xa'),_0xf1cb96);var _0x38b2be=_0x58f178||{};var _0x58dd88=_0x2a8dd9[_0x1a63('0xb')]('.');var _0x1047cb={'uniqueid':_0x5df65f,'channel':_0x58dd88[0x0],'id':_0x58dd88[0x1],'title':_0x58dd88[0x0]+_0x1a63('0xc'),'interactionId':_0x58dd88[0x2],'queue':_0xd81213?_0xd81213[_0x1a63('0x8')]:null,'sound':_0x38b2be['account'][_0x1a63('0xd')],'shake':_0x38b2be[_0x1a63('0xe')][_0x1a63('0xf')]};try{if(!_0x38b2be['body']){_0x38b2be[_0x1a63('0x10')]={};}if(_0xd81213){_0x38b2be['body'][_0x1a63('0x11')]=_0xd81213;}else if(_0x38b2be[_0x1a63('0x10')][_0x1a63('0x11')]){delete _0x38b2be['body']['queue'];}_0x1047cb[_0x1a63('0x12')]=utils[_0x1a63('0x13')](_0x38b2be[_0x1a63('0xe')][_0x1a63('0x14')],_0x38b2be);}catch(_0x1c1e8c){_0x1047cb['msg']=_0x1a63('0x15');logger['error'](util[_0x1a63('0x16')](_0x1a63('0x17'),_0x5df65f,_0x1c1e8c[_0x1a63('0x18')]));}io['to'](util[_0x1a63('0x16')](_0x1a63('0x7'),_0xf1cb96[_0x1a63('0x8')]))[_0x1a63('0x9')](util[_0x1a63('0x16')](_0x1a63('0x19'),_0x5a2067?_0x1a63('0x1a'):'remove'),_0x1047cb);}function writeLog(_0x34ad77,_0x27d502,_0x5d9c00){return logger[_0x1a63('0x1b')](util[_0x1a63('0x16')](_0x1a63('0x1c'),_0x34ad77,_0x27d502[_0x1a63('0x8')],_0x5d9c00));}exports[_0x1a63('0x1d')]=function(_0x2a0a4,_0x4f8af5,_0x547d78,_0x3e4b57){if(_0x4f8af5['busy']){writeLog(_0x2a0a4,_0x4f8af5,_0x1a63('0x1e'));return![];}if(!_0x4f8af5[_0x1a63('0x1f')]){writeLog(_0x2a0a4,_0x4f8af5,'OFFLINE');return![];}if(_0x4f8af5[_0x547d78+'Pause']){writeLog(_0x2a0a4,_0x4f8af5,_0x1a63('0x20'));return![];}if(_0x3e4b57&&_0x4f8af5[_0x1a63('0x21')](_0x547d78+_0x1a63('0x22'))&&_0x4f8af5[_0x1a63('0x21')](_0x547d78+_0x1a63('0x23'))){if(_0x4f8af5[_0x547d78+'Capacity']>0x0&&_0x4f8af5[_0x547d78+_0x1a63('0x23')]>=_0x4f8af5[_0x547d78+_0x1a63('0x22')]){writeLog(_0x2a0a4,_0x4f8af5,_0x547d78[_0x1a63('0x24')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x1a63('0x25')]=function(_0x41e05e,_0x81548f,_0x306dd4,_0x53867d,_0x4a7ffc){return sendNotification(!![],_0x41e05e,_0x81548f,_0x306dd4,_0x53867d,_0x4a7ffc);};exports[_0x1a63('0x26')]=function(_0x358dc8,_0xcebce9,_0x3e1646,_0xa125b3,_0x399570){return sendNotification(![],_0x358dc8,_0xcebce9,_0x3e1646,_0xa125b3,_0x399570);};exports['checkWaitingNotifications']=function(_0x177171,_0x4a52f4,_0xd1a2db){var _0x2451a1=_0x4a52f4['interaction'][_0x1a63('0x27')];if(!_0x2451a1&&_0xd1a2db){_0x2451a1=_0xd1a2db['id'];}var _0xaf11e5=_[_0x1a63('0x28')](_0x177171[_0x4a52f4[_0x1a63('0x29')]+'QueuesWaitingInteractions'],function(_0x50bdb7){var _0x382e23=_[_0x1a63('0x2a')](_0x4a52f4['channel'])+_0x1a63('0x2b');return _0x50bdb7[_0x382e23]===_0x4a52f4[_0x1a63('0x2c')]['id'];});if(!_0xaf11e5&&_0x2451a1&&_0x177171[_0x1a63('0x2d')][_0x2451a1]){_0xaf11e5=_[_0x1a63('0x28')](_0x177171[_0x1a63('0x2d')][_0x2451a1][_0x4a52f4[_0x1a63('0x29')]+'WaitingInteractions'],function(_0x6d3522){return _0x6d3522['id']===_0x4a52f4[_0x1a63('0x2c')]['id'];});}return _0xaf11e5;};exports[_0x1a63('0x2e')]=function(_0x4536a7,_0x5f1075,_0x5ea28d,_0x474016){if(_0x5ea28d&&_0x5ea28d['id']&&_0x4536a7['agents']&&_0x4536a7[_0x1a63('0x2d')][_0x5ea28d['id']]){_0x4536a7['agents'][_0x5ea28d['id']][_0x474016+_0x1a63('0x2f')][_0x5f1075[_0x1a63('0x18')]['id']]={'id':_0x5f1075['interaction']['id']};}};exports[_0x1a63('0x30')]=function(_0x1cb941,_0x20b129,_0x3ec72d,_0x52e909){if(_0x3ec72d&&_0x3ec72d['id']&&_0x1cb941[_0x1a63('0x2d')]&&_0x1cb941[_0x1a63('0x2d')][_0x3ec72d['id']]){delete _0x1cb941[_0x1a63('0x2d')][_0x3ec72d['id']][_0x52e909+_0x1a63('0x2f')][_0x20b129[_0x1a63('0x18')]['id']];}};exports[_0x1a63('0x31')]=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index e5c976d..064a685 100644 --- a/server/services/routing/server/applications/system.js +++ b/server/services/routing/server/applications/system.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd59a=['[%s][SYSTEM]\x20%s','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','[%s][SYSTEM]\x20no\x20variable','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body','isObject','stringify','validate','shelljs','lodash','./utils','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error'];(function(_0x2b4d02,_0x54d4f9){var _0x19a9c2=function(_0x8c4ea6){while(--_0x8c4ea6){_0x2b4d02['push'](_0x2b4d02['shift']());}};_0x19a9c2(++_0x54d4f9);}(_0xd59a,0x17d));var _0xad59=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xd59a[_0x57b54c];return _0x59cc19;};'use strict';var schema=require(_0xad59('0x0'));var sh=require(_0xad59('0x1'));var _=require(_0xad59('0x2'));var utils=require(_0xad59('0x3'));var logger=require('../../../../config/logger')(_0xad59('0x4'));var system=schema({'command':{'type':'string','required':!![],'message':_0xad59('0x5')}});exports[_0xad59('0x6')]=function(_0x58073b,_0x4f8174){return function(_0x23bcaf){try{var _0x3cf16f={'command':_0x4f8174[0x0]};var _0x50f1bf=system[_0xad59('0x0')](_0x3cf16f,{'typecast':!![]});if(_0x50f1bf[_0xad59('0x7')]){logger[_0xad59('0x8')](_0xad59('0x9'),_0x58073b,_['map'](_0x50f1bf,'message')[_0xad59('0xa')](',\x20'));logger[_0xad59('0xb')](_0xad59('0xc'),_0x58073b);_0x23bcaf[_0xad59('0xd')]();}else{var _0x49155a=this;var _0x22d8d2=utils[_0xad59('0xe')](_0x4f8174[0x0],this);logger[_0xad59('0xb')](_0xad59('0xf'),_0x58073b,_0x22d8d2);sh[_0xad59('0x10')](_[_0xad59('0x11')](_0x22d8d2),function(_0x4dcea5,_0x1c78a5){logger[_0xad59('0xb')](_0xad59('0x12'),_0x58073b,_0x4dcea5);if(_0x4dcea5==0x0){var _0x258f73=_0x1c78a5[_0xad59('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0xad59('0x14')](_0x4f8174[0x1])||_['isEmpty'](_0x4f8174[0x1])){logger[_0xad59('0xb')](_0xad59('0x15'),_0x58073b);_0x49155a['body'][_0x4f8174[0x1]]=_0x258f73;}else{logger[_0xad59('0xb')](_0xad59('0x16'),_0x58073b,_0x4f8174[0x1],_0x258f73);_0x49155a[_0xad59('0x17')][_0x4f8174[0x1]]=_0x258f73;}}_0x23bcaf[_0xad59('0xd')]();});}}catch(_0x340aad){logger[_0xad59('0x8')]('[%s][SYSTEM]\x20%s',_0x58073b,_[_0xad59('0x18')](_0x340aad)?JSON[_0xad59('0x19')](_0x340aad):_0x340aad);logger[_0xad59('0xb')](_0xad59('0xc'),_0x58073b);_0x23bcaf[_0xad59('0xd')]();}};}; \ No newline at end of file +var _0xaf85=['replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','error','isObject','stringify','next','shelljs','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','getMustacheRender','exec','[%s][SYSTEM]\x20result\x20code:\x20%s'];(function(_0x2a0f2e,_0x3bd84d){var _0x2b5928=function(_0x508656){while(--_0x508656){_0x2a0f2e['push'](_0x2a0f2e['shift']());}};_0x2b5928(++_0x3bd84d);}(_0xaf85,0x1e3));var _0x5af8=function(_0x5e8eae,_0x4f81e0){_0x5e8eae=_0x5e8eae-0x0;var _0xdd09cd=_0xaf85[_0x5e8eae];return _0xdd09cd;};'use strict';var schema=require('validate');var sh=require(_0x5af8('0x0'));var _=require('lodash');var utils=require(_0x5af8('0x1'));var logger=require(_0x5af8('0x2'))(_0x5af8('0x3'));var system=schema({'command':{'type':_0x5af8('0x4'),'required':!![],'message':_0x5af8('0x5')}});exports[_0x5af8('0x6')]=function(_0x92b73b,_0x46d2e1){return function(_0x5689a0){try{var _0x4c5633={'command':_0x46d2e1[0x0]};var _0x53a83c=system['validate'](_0x4c5633,{'typecast':!![]});if(_0x53a83c[_0x5af8('0x7')]){logger['error'](_0x5af8('0x8'),_0x92b73b,_[_0x5af8('0x9')](_0x53a83c,_0x5af8('0xa'))[_0x5af8('0xb')](',\x20'));logger[_0x5af8('0xc')](_0x5af8('0xd'),_0x92b73b);_0x5689a0['next']();}else{var _0x3f8506=this;var _0x57caed=utils[_0x5af8('0xe')](_0x46d2e1[0x0],this);logger[_0x5af8('0xc')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x92b73b,_0x57caed);sh[_0x5af8('0xf')](_['trim'](_0x57caed),function(_0x10a854,_0x3ad0ef){logger[_0x5af8('0xc')](_0x5af8('0x10'),_0x92b73b,_0x10a854);if(_0x10a854==0x0){var _0x39c3db=_0x3ad0ef[_0x5af8('0x11')](/(\r\n|\n|\r)/gm,'');if(_[_0x5af8('0x12')](_0x46d2e1[0x1])||_[_0x5af8('0x13')](_0x46d2e1[0x1])){logger[_0x5af8('0xc')](_0x5af8('0x14'),_0x92b73b);_0x3f8506['body'][_0x46d2e1[0x1]]=_0x39c3db;}else{logger[_0x5af8('0xc')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x92b73b,_0x46d2e1[0x1],_0x39c3db);_0x3f8506['body'][_0x46d2e1[0x1]]=_0x39c3db;}}_0x5689a0['next']();});}}catch(_0x259a74){logger[_0x5af8('0x15')](_0x5af8('0x8'),_0x92b73b,_[_0x5af8('0x16')](_0x259a74)?JSON[_0x5af8('0x17')](_0x259a74):_0x259a74);logger[_0x5af8('0xc')](_0x5af8('0xd'),_0x92b73b);_0x5689a0[_0x5af8('0x18')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index 5a71fd1..2d0140f 100644 --- a/server/services/routing/server/applications/tag.js +++ b/server/services/routing/server/applications/tag.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbcae=['then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','error','stringify','finally','next','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','../../../../config/logger','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','[%s][TAG]\x20%s','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','channel','Interaction','addTags','interaction'];(function(_0x532144,_0x1e15f3){var _0x57f65d=function(_0x3c0753){while(--_0x3c0753){_0x532144['push'](_0x532144['shift']());}};_0x57f65d(++_0x1e15f3);}(_0xbcae,0x11c));var _0xebca=function(_0x48c152,_0x2f3746){_0x48c152=_0x48c152-0x0;var _0x4f4012=_0xbcae[_0x48c152];return _0x4f4012;};'use strict';var schema=require(_0xebca('0x0'));var _=require(_0xebca('0x1'));var rpc={'chatInteraction':require(_0xebca('0x2')),'openchannelInteraction':require(_0xebca('0x3')),'smsInteraction':require(_0xebca('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xebca('0x5'))};var logger=require(_0xebca('0x6'))('routing');var tag=schema({'tag':{'type':'number','required':!![],'message':_0xebca('0x7')}});exports[_0xebca('0x8')]=function(_0xf577f4,_0x265b82,_0x1b4bef,_0x5e0c60){return function(_0xcc87ed){try{var _0x29bcb3={'tag':_0x265b82[0x0]};var _0x2bc5f1=tag[_0xebca('0x0')](_0x29bcb3,{'typecast':!![]});if(_0x2bc5f1['length']){logger['error'](_0xebca('0x9'),_0xf577f4,_['map'](_0x2bc5f1,'message')[_0xebca('0xa')](',\x20'));logger['info'](_0xebca('0xb'),_0xf577f4);_0xcc87ed['next']();}else{var _0x2b2c8c={'ids':[_0x265b82[0x0]]};if(rpc[_0x5e0c60[_0xebca('0xc')]+_0xebca('0xd')]){rpc[_0x5e0c60[_0xebca('0xc')]+_0xebca('0xd')][_0xebca('0xe')](_0x5e0c60[_0xebca('0xf')]['id'],_0x2b2c8c)[_0xebca('0x10')](function(_0x52513e){logger[_0xebca('0x11')](_0xebca('0x12'),_0xf577f4,_0x265b82[0x1],_0x5e0c60['channel'],_0x5e0c60[_0xebca('0xf')]['id']);})[_0xebca('0x13')](function(_0x5ee6d8){logger[_0xebca('0x14')](_0xebca('0x9'),_0xf577f4,JSON[_0xebca('0x15')](_0x5ee6d8));logger[_0xebca('0x11')](_0xebca('0xb'),_0xf577f4);})[_0xebca('0x16')](function(){_0xcc87ed[_0xebca('0x17')]();});}}}catch(_0x2929ba){logger[_0xebca('0x14')](_0xebca('0x9'),_0xf577f4,_[_0xebca('0x18')](_0x2929ba)?JSON[_0xebca('0x15')](_0x2929ba):_0x2929ba);logger[_0xebca('0x11')](_0xebca('0xb'),_0xf577f4);_0xcc87ed[_0xebca('0x17')]();}};}; \ No newline at end of file +var _0x850b=['[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','[%s][TAG]\x20%s','stringify','finally','validate','lodash','../../rpc/openchannelInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','map','info'];(function(_0x4ff25b,_0x31aad2){var _0x4bcaee=function(_0x58237f){while(--_0x58237f){_0x4ff25b['push'](_0x4ff25b['shift']());}};_0x4bcaee(++_0x31aad2);}(_0x850b,0x1ad));var _0xb850=function(_0x135c99,_0x45c9e3){_0x135c99=_0x135c99-0x0;var _0x237a29=_0x850b[_0x135c99];return _0x237a29;};'use strict';var schema=require(_0xb850('0x0'));var _=require(_0xb850('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xb850('0x2')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xb850('0x3'))};var logger=require(_0xb850('0x4'))(_0xb850('0x5'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0xb850('0x6')}});exports[_0xb850('0x7')]=function(_0xa5f519,_0x88c502,_0x35b48e,_0xa502c2){return function(_0x133a25){try{var _0x37d5be={'tag':_0x88c502[0x0]};var _0x1a9b8c=tag[_0xb850('0x0')](_0x37d5be,{'typecast':!![]});if(_0x1a9b8c['length']){logger[_0xb850('0x8')]('[%s][TAG]\x20%s',_0xa5f519,_[_0xb850('0x9')](_0x1a9b8c,'message')['join'](',\x20'));logger[_0xb850('0xa')](_0xb850('0xb'),_0xa5f519);_0x133a25[_0xb850('0xc')]();}else{var _0x2d428f={'ids':[_0x88c502[0x0]]};if(rpc[_0xa502c2[_0xb850('0xd')]+_0xb850('0xe')]){rpc[_0xa502c2[_0xb850('0xd')]+_0xb850('0xe')]['addTags'](_0xa502c2[_0xb850('0xf')]['id'],_0x2d428f)[_0xb850('0x10')](function(_0x1568d3){logger[_0xb850('0xa')](_0xb850('0x11'),_0xa5f519,_0x88c502[0x1],_0xa502c2['channel'],_0xa502c2[_0xb850('0xf')]['id']);})[_0xb850('0x12')](function(_0x5ab9d5){logger[_0xb850('0x8')](_0xb850('0x13'),_0xa5f519,JSON[_0xb850('0x14')](_0x5ab9d5));logger[_0xb850('0xa')](_0xb850('0xb'),_0xa5f519);})[_0xb850('0x15')](function(){_0x133a25['next']();});}}}catch(_0x1f302d){logger[_0xb850('0x8')](_0xb850('0x13'),_0xa5f519,_['isObject'](_0x1f302d)?JSON[_0xb850('0x14')](_0x1f302d):_0x1f302d);logger[_0xb850('0xa')](_0xb850('0xb'),_0xa5f519);_0x133a25[_0xb850('0xc')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index b2f587b..98653e0 100644 --- a/server/services/routing/server/applications/tvox.js +++ b/server/services/routing/server/applications/tvox.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1be8=['then','parse','result','logged','channelId=','&sessionId=','info','stop','catch','error','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','lodash','replace','includes','push','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','2.0','method','stringify','utf8'];(function(_0x2727aa,_0x5c0361){var _0x340b19=function(_0xff6258){while(--_0xff6258){_0x2727aa['push'](_0x2727aa['shift']());}};_0x340b19(++_0x5c0361);}(_0x1be8,0x113));var _0x81be=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0x1be8[_0x298ed3];return _0x5aad28;};'use strict';var rp=require(_0x81be('0x0'));var logger=require(_0x81be('0x1'))('routing');var _=require(_0x81be('0x2'));var arr=[];exports['consequence']=function(_0x4aa6e7,_0x2f32eb){return function(_0x11cf75){var _0xdccda0=_0x2f32eb[0xa];var _0x28e768=_0x2f32eb[0xb];var _0xe3bcc6=_0x2f32eb[0xc];var _0x5292fb=_0x2f32eb[0xd];var _0x44d4db=_0x2f32eb[0xe];var _0x79636b=_0x2f32eb[0xf][_0x81be('0x3')](/\n/g,'\x20-\x20');var _0x4ee470=_0x2f32eb[0x10][_0x81be('0x3')](/\n/g,'\x20');if(!arr[_0x81be('0x4')](_0x28e768)){arr[_0x81be('0x5')](_0x28e768);var _0x4b5d19=_0x2f32eb[0x3];var _0x22c003=_0x2f32eb[0x4];var _0x27f6f3=_0x2f32eb[0x1];var _0xd0a9e7=_0x2f32eb[0x0];var _0x39c287={};_0x39c287[_0x81be('0x6')]=_0x2f32eb[0x8]+_0x81be('0x7')+_0xe3bcc6+'|'+_0xdccda0+'|'+_0x5292fb+'|'+_0x28e768+'|'+_0x44d4db;_0x39c287[_0x81be('0x8')]=_0x2f32eb[0x7]+_0x81be('0x7')+_0xe3bcc6+'|'+_0xdccda0+'|'+_0x5292fb+'|'+_0x28e768+'|'+_0x44d4db+'|'+_0x79636b+'|'+_0x4ee470;_0x39c287[_0x81be('0x9')]=_0x2f32eb[0x9];var _0x1ea05a={};_0x1ea05a[_0x81be('0xa')]=_0x81be('0xb');_0x1ea05a[_0x81be('0xc')]='login';var _0x29d4ae=[];_0x29d4ae[_0x81be('0x5')](_0x2f32eb[0x2]);_0x29d4ae[_0x81be('0x5')](_0x2f32eb[0x5]);_0x29d4ae[_0x81be('0x5')](_0x2f32eb[0x6]);_0x1ea05a['params']=_0x29d4ae;_0x1ea05a['id']=0x1;var _0xb03483=JSON[_0x81be('0xd')](_0x1ea05a);var _0x200f0f={'encoding':_0x81be('0xe'),'method':'POST','timeout':0x2710,'url':_0x4b5d19,'headers':{'Content-Type':'application/json-rpc'},'body':_0xb03483};return rp(_0x200f0f)[_0x81be('0xf')](function(_0x3daf74){const _0x4e3b1d=JSON[_0x81be('0x10')](_0x3daf74);if(!_0x4e3b1d[_0x81be('0x11')][_0x81be('0x12')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x23e19f=_0x28e768;var _0x5563ee=_0x81be('0x13')+_0x27f6f3+'&serviceId='+_0xd0a9e7+_0x81be('0x14')+_0x23e19f+'&data='+JSON['stringify'](_0x39c287);var _0x16c1d9=_0x22c003+'?'+_0x5563ee;return rp(_0x16c1d9);})[_0x81be('0xf')](function(_0x1c2882){logger[_0x81be('0x15')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x4aa6e7,_0x1c2882);_0x11cf75[_0x81be('0x16')]();})[_0x81be('0x17')](function(_0x4dbbbe){logger[_0x81be('0x18')](_0x81be('0x19'),_0x4aa6e7,_[_0x81be('0x1a')](_0x4dbbbe)?JSON[_0x81be('0xd')](_0x4dbbbe):_0x4dbbbe);_0x11cf75[_0x81be('0x16')]();});}else{logger[_0x81be('0x15')](_0x81be('0x1b'),_0x4aa6e7);_0x11cf75[_0x81be('0x1c')]();}};}; \ No newline at end of file +var _0xca3f=['urlOnRing','jsonrpc','method','params','stringify','utf8','then','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','error','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','../../../../config/logger','routing','lodash','replace','\x20-\x20','includes','push','urlOnAnswer','?params='];(function(_0x314623,_0x1977d2){var _0x599e06=function(_0x3dda40){while(--_0x3dda40){_0x314623['push'](_0x314623['shift']());}};_0x599e06(++_0x1977d2);}(_0xca3f,0x136));var _0xfca3=function(_0x4b59e7,_0x1667fa){_0x4b59e7=_0x4b59e7-0x0;var _0x3b07d0=_0xca3f[_0x4b59e7];return _0x3b07d0;};'use strict';var rp=require('request-promise');var logger=require(_0xfca3('0x0'))(_0xfca3('0x1'));var _=require(_0xfca3('0x2'));var arr=[];exports['consequence']=function(_0x45ad71,_0x1ce71c){return function(_0x1a6e79){var _0x15cc0d=_0x1ce71c[0xa];var _0x58f880=_0x1ce71c[0xb];var _0x41ac80=_0x1ce71c[0xc];var _0x39e882=_0x1ce71c[0xd];var _0x5a418a=_0x1ce71c[0xe];var _0x5e2807=_0x1ce71c[0xf][_0xfca3('0x3')](/\n/g,_0xfca3('0x4'));var _0x1f12bc=_0x1ce71c[0x10][_0xfca3('0x3')](/\n/g,'\x20');if(!arr[_0xfca3('0x5')](_0x58f880)){arr[_0xfca3('0x6')](_0x58f880);var _0x5ed2d7=_0x1ce71c[0x3];var _0x148b0f=_0x1ce71c[0x4];var _0x48e5c8=_0x1ce71c[0x1];var _0xbe4657=_0x1ce71c[0x0];var _0x3f8c5b={};_0x3f8c5b[_0xfca3('0x7')]=_0x1ce71c[0x8]+_0xfca3('0x8')+_0x41ac80+'|'+_0x15cc0d+'|'+_0x39e882+'|'+_0x58f880+'|'+_0x5a418a;_0x3f8c5b[_0xfca3('0x9')]=_0x1ce71c[0x7]+_0xfca3('0x8')+_0x41ac80+'|'+_0x15cc0d+'|'+_0x39e882+'|'+_0x58f880+'|'+_0x5a418a+'|'+_0x5e2807+'|'+_0x1f12bc;_0x3f8c5b['title']=_0x1ce71c[0x9];var _0x5b1a58={};_0x5b1a58[_0xfca3('0xa')]='2.0';_0x5b1a58[_0xfca3('0xb')]='login';var _0x5ba1fa=[];_0x5ba1fa['push'](_0x1ce71c[0x2]);_0x5ba1fa[_0xfca3('0x6')](_0x1ce71c[0x5]);_0x5ba1fa['push'](_0x1ce71c[0x6]);_0x5b1a58[_0xfca3('0xc')]=_0x5ba1fa;_0x5b1a58['id']=0x1;var _0x5208ee=JSON[_0xfca3('0xd')](_0x5b1a58);var _0x28feb8={'encoding':_0xfca3('0xe'),'method':'POST','timeout':0x2710,'url':_0x5ed2d7,'headers':{'Content-Type':'application/json-rpc'},'body':_0x5208ee};return rp(_0x28feb8)[_0xfca3('0xf')](function(_0x8d7904){const _0x33376c=JSON['parse'](_0x8d7904);if(!_0x33376c[_0xfca3('0x10')][_0xfca3('0x11')]){throw new Error(_0xfca3('0x12'));}var _0x5160e5=_0x58f880;var _0x39ced=_0xfca3('0x13')+_0x48e5c8+_0xfca3('0x14')+_0xbe4657+'&sessionId='+_0x5160e5+_0xfca3('0x15')+JSON['stringify'](_0x3f8c5b);var _0x317796=_0x148b0f+'?'+_0x39ced;return rp(_0x317796);})['then'](function(_0x59aaa3){logger[_0xfca3('0x16')](_0xfca3('0x17'),_0x45ad71,_0x59aaa3);_0x1a6e79[_0xfca3('0x18')]();})['catch'](function(_0x39304a){logger[_0xfca3('0x19')](_0xfca3('0x1a'),_0x45ad71,_[_0xfca3('0x1b')](_0x39304a)?JSON[_0xfca3('0xd')](_0x39304a):_0x39304a);_0x1a6e79['stop']();});}else{logger[_0xfca3('0x16')](_0xfca3('0x1c'),_0x45ad71);_0x1a6e79['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index 05c6a48..7dc5270 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x3dc187,_0xd85c70){var _0x596f2c=function(_0x3ca940){while(--_0x3ca940){_0x3dc187['push'](_0x3dc187['shift']());}};_0x596f2c(++_0xd85c70);}(_0xe706,0xa3));var _0x6e70=function(_0x362e87,_0x38d17c){_0x362e87=_0x362e87-0x0;var _0x334244=_0xe706[_0x362e87];return _0x334244;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file +var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x305761,_0x1592e9){var _0x4a10ed=function(_0x199cab){while(--_0x199cab){_0x305761['push'](_0x305761['shift']());}};_0x4a10ed(++_0x1592e9);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 9901c90..4800a17 100644 --- a/server/services/routing/server/index.js +++ b/server/services/routing/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c57=['body','%s:%s:%s','./interval','intervals','./applications/','consequence','info','Push\x20new\x20rule','on\x20interval','error','Applications\x20executed','stringify','matchPath','emit','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','agents','busy','end','QueueReport','update','UserId','catch','message\x20is\x20empty','stack','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','bluebird','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','checkWaitingNotifications','transfer','applications','isArray','length','join','.js','app','autoreply','appdata','push','slice','dialogflow','split','amazonlex','tag','TagId','tvox','getMustacheRender','notificationTemplate','ChatWebsiteId','ContactId'];(function(_0x249e96,_0x3ea39d){var _0x17444c=function(_0x1221d0){while(--_0x1221d0){_0x249e96['push'](_0x249e96['shift']());}};_0x17444c(++_0x3ea39d);}(_0x9c57,0x99));var _0x79c5=function(_0x1cf279,_0x31c825){_0x1cf279=_0x1cf279-0x0;var _0x33f5b6=_0x9c57[_0x1cf279];return _0x33f5b6;};'use strict';var _=require(_0x79c5('0x0'));var util=require(_0x79c5('0x1'));var path=require(_0x79c5('0x2'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0x79c5('0x3'));var utils=require(_0x79c5('0x4'));var sUtils=require(_0x79c5('0x5'));var logger=require(_0x79c5('0x6'))(_0x79c5('0x7'));var rpc={'openchannelQueueReport':require(_0x79c5('0x8')),'mailQueueReport':require(_0x79c5('0x9')),'chatQueueReport':require(_0x79c5('0xa')),'smsQueueReport':require(_0x79c5('0xb')),'faxQueueReport':require(_0x79c5('0xc')),'whatsappQueueReport':require(_0x79c5('0xd'))};var RuleEngine=require(_0x79c5('0xe'));function getId(_0x355d14,_0x935b9c,_0x44f582){return util[_0x79c5('0xf')](_0x79c5('0x10'),_0x355d14,_0x935b9c||0x0,_0x44f582||0x0);}function getIntervals(_0x2b39e3,_0x3811e3){var _0x132a27=[];if(!_[_0x79c5('0x11')](_0x3811e3[_0x79c5('0x12')])&&!_[_0x79c5('0x11')](_0x2b39e3[_0x3811e3[_0x79c5('0x12')]])&&!_[_0x79c5('0x11')](_0x2b39e3[_0x3811e3[_0x79c5('0x12')]][_0x79c5('0x13')])){_0x132a27=_[_0x79c5('0x14')](_0x2b39e3[_0x3811e3[_0x79c5('0x12')]][_0x79c5('0x13')],_0x79c5('0x15'));}else if(!_[_0x79c5('0x11')](_0x3811e3[_0x79c5('0x15')])){_0x132a27=[_0x3811e3[_0x79c5('0x15')]];}return _0x132a27;}exports[_0x79c5('0x16')]=function(_0x4df93f){_0x4df93f[_0x79c5('0x17')]={};return new BPromise(function(_0x2d0410,_0x555da7){var _0x154a90={'Start':function(_0x53fe46){var _0x227d8e=this;return new Promise(function(_0x133f7c,_0x402a2e){if(_0x53fe46){try{var _0x297c6d=[];var _0x30be93=getId(_0x53fe46[_0x79c5('0x18')],_0x53fe46[_0x79c5('0x19')]?_0x53fe46['message']['id']:0x0,_0x53fe46[_0x79c5('0x1a')]?_0x53fe46['interaction']['id']:0x0);var _0x376c44=sUtils[_0x79c5('0x1b')](_0x4df93f,_0x53fe46);if(_0x53fe46[_0x79c5('0x1c')]||!_0x376c44&&_0x53fe46[_0x79c5('0x1d')]&&_[_0x79c5('0x1e')](_0x53fe46['applications'])&&_0x53fe46[_0x79c5('0x1d')][_0x79c5('0x1f')]){for(var _0x3887e5=0x0;_0x3887e5<_0x53fe46[_0x79c5('0x1d')]['length'];_0x3887e5+=0x1){var _0x386819=_0x53fe46[_0x79c5('0x1d')][_0x3887e5];if(fs['existsSync'](path[_0x79c5('0x20')](__dirname,_0x79c5('0x1d'),_0x386819['app']+_0x79c5('0x21')))){var _0x1f6c73=[];switch(_0x386819[_0x79c5('0x22')]['toLowerCase']()){case _0x79c5('0x23'):var _0x8d10ed=_0x386819[_0x79c5('0x24')]['split'](',');if(_0x53fe46[_0x79c5('0x18')]==='mail'){_0x1f6c73[_0x79c5('0x25')](_0x8d10ed[0x0]);_0x1f6c73['push'](_0x8d10ed[0x1]);_0x1f6c73[_0x79c5('0x25')](_0x8d10ed[_0x79c5('0x26')](0x2,_0x8d10ed['length'])[_0x79c5('0x20')](','));}else{_0x1f6c73[_0x79c5('0x25')](_0x8d10ed[0x0]);_0x1f6c73['push'](_0x8d10ed[_0x79c5('0x26')](0x1,_0x8d10ed[_0x79c5('0x1f')])['join'](','));}break;case _0x79c5('0x27'):var _0x52f60b=_0x386819[_0x79c5('0x24')][_0x79c5('0x28')](',');_0x1f6c73[_0x79c5('0x25')](_0x52f60b[0x0]);_0x1f6c73[_0x79c5('0x25')](_0x52f60b[0x1]);_0x1f6c73[_0x79c5('0x25')](_0x52f60b['slice'](0x2,_0x52f60b[_0x79c5('0x1f')])['join'](','));break;case'dialogflowv2':var _0x22a6dd=_0x386819['appdata'][_0x79c5('0x28')](',');_0x1f6c73[_0x79c5('0x25')](_0x22a6dd[0x0]);_0x1f6c73[_0x79c5('0x25')](_0x22a6dd[0x1]);_0x1f6c73[_0x79c5('0x25')](_0x22a6dd[0x2]);_0x1f6c73['push'](_0x22a6dd[0x3]);_0x1f6c73[_0x79c5('0x25')](_0x22a6dd['slice'](0x4,_0x22a6dd[_0x79c5('0x1f')])[_0x79c5('0x20')](','));break;case _0x79c5('0x29'):var _0x2c7ffc=_0x386819[_0x79c5('0x24')][_0x79c5('0x28')](',');_0x1f6c73[_0x79c5('0x25')](_0x2c7ffc[0x0]);_0x1f6c73[_0x79c5('0x25')](_0x2c7ffc[0x1]);_0x1f6c73[_0x79c5('0x25')](_0x2c7ffc[0x2]);_0x1f6c73['push'](_0x2c7ffc[0x3]);_0x1f6c73[_0x79c5('0x25')](_0x2c7ffc[_0x79c5('0x26')](0x4,_0x2c7ffc[_0x79c5('0x1f')])['join'](','));break;case _0x79c5('0x19'):_0x1f6c73['push'](_0x386819[_0x79c5('0x24')]);break;case _0x79c5('0x2a'):_0x1f6c73[_0x79c5('0x25')](_0x386819[_0x79c5('0x2b')]);_0x1f6c73['push'](_0x386819['appdata']);break;case _0x79c5('0x2c'):var _0x1f8e19=utils[_0x79c5('0x2d')](_0x53fe46['account'][_0x79c5('0x2e')],_0x53fe46);var _0x5b8660=_0x386819['appdata']['split'](',');_0x1f6c73['push'](_0x5b8660[0x0]);_0x1f6c73[_0x79c5('0x25')](_0x5b8660[0x1]);_0x1f6c73[_0x79c5('0x25')](_0x5b8660[0x2]);_0x1f6c73['push'](_0x5b8660[0x3]);_0x1f6c73[_0x79c5('0x25')](_0x5b8660[0x4]);_0x1f6c73[_0x79c5('0x25')](_0x5b8660[0x5]);_0x1f6c73[_0x79c5('0x25')](_0x5b8660[0x6]);_0x1f6c73[_0x79c5('0x25')](_0x5b8660[0x7]);_0x1f6c73[_0x79c5('0x25')](_0x5b8660[0x8]);_0x1f6c73[_0x79c5('0x25')](_0x5b8660[0x9]);_0x1f6c73[_0x79c5('0x25')](_0x5b8660[0xa]);_0x1f6c73[_0x79c5('0x25')](_0x53fe46['interaction']['id']);_0x1f6c73['push'](_0x53fe46[_0x79c5('0x19')]['id']);_0x1f6c73[_0x79c5('0x25')](_0x386819[_0x79c5('0x2f')]);_0x1f6c73[_0x79c5('0x25')](_0x53fe46[_0x79c5('0x1a')][_0x79c5('0x30')]);_0x1f6c73[_0x79c5('0x25')](_0x53fe46[_0x79c5('0x31')][_0x79c5('0x31')]);_0x1f6c73[_0x79c5('0x25')](_0x1f8e19);break;default:_0x1f6c73=_['isNil'](_0x386819[_0x79c5('0x24')])?[]:_0x386819[_0x79c5('0x24')][_0x79c5('0x28')](',');}var _0x395bdb={'id':util[_0x79c5('0xf')](_0x79c5('0x32'),_0x30be93,_0x386819['id'],_0x386819['app']),'condition':require(_0x79c5('0x33'))['condition'](_0x30be93,getIntervals(_0x4df93f[_0x79c5('0x34')],_0x386819),_0x4df93f),'consequence':require(_0x79c5('0x35')+_0x386819[_0x79c5('0x22')])[_0x79c5('0x36')](_0x30be93,_0x1f6c73,_0x4df93f,_0x53fe46),'p':_0x386819['priority']||0x0};logger[_0x79c5('0x37')](_0x79c5('0x38'),_0x395bdb['id'],_0x79c5('0x39'),getIntervals(_0x4df93f[_0x79c5('0x34')],_0x386819)[_0x79c5('0x20')]('\x20|\x20'));_0x297c6d[_0x79c5('0x25')](_0x395bdb);}else{logger[_0x79c5('0x3a')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0x79c5('0x20')](__dirname,_0x79c5('0x1d'),_0x386819[_0x79c5('0x22')]+'.js'));}}_0x4df93f[_0x79c5('0x17')][_0x30be93]=new RuleEngine(_0x297c6d);_0x4df93f[_0x79c5('0x17')][_0x30be93]['execute'](_0x53fe46,function(_0x5d7251){logger['info'](_0x79c5('0x3b'),JSON[_0x79c5('0x3c')](_0x5d7251[_0x79c5('0x3d')]));if(_0x4df93f['rules'][_0x30be93]){_0x4df93f[_0x79c5('0x17')][_0x30be93][_0x79c5('0x3e')]('complete');}});return _0x133f7c({'code':0xc8,'message':_0x53fe46});}else{if(_0x376c44){logger[_0x79c5('0x37')](util['format'](_0x79c5('0x3f'),_0x30be93));}else{logger['info'](_0x79c5('0x40'));}return _0x133f7c({'code':0xc8,'message':_0x53fe46});}}catch(_0x2ac89b){logger[_0x79c5('0x3a')](_0x2ac89b['stack']);return _0x402a2e(_0x227d8e[_0x79c5('0x3a')](0x1f4,_0x2ac89b));}}return _0x402a2e(_0x79c5('0x41'));});},'AcceptMessage':function(_0x57c0c5){var _0xae2135=this;return new Promise(function(_0x270e4a,_0x4c1d6d){if(_0x57c0c5[_0x79c5('0x42')]&&_0x57c0c5[_0x79c5('0x42')]['id']){if(_0x4df93f[_0x79c5('0x43')][_0x57c0c5[_0x79c5('0x42')]['id']]){_0x4df93f[_0x79c5('0x43')][_0x57c0c5[_0x79c5('0x42')]['id']][_0x79c5('0x44')]=![];_0x4df93f['agents'][_0x57c0c5['agent']['id']]['busyQueue']=undefined;}}if(_0x57c0c5[_0x79c5('0x19')]&&_0x57c0c5[_0x79c5('0x19')]['id']){try{var _0xe7dbb2=getId(_0x57c0c5[_0x79c5('0x18')],_0x57c0c5['message']?_0x57c0c5[_0x79c5('0x19')]['id']:0x0,_0x57c0c5[_0x79c5('0x1a')]?_0x57c0c5[_0x79c5('0x1a')]['id']:0x0);if(_0x4df93f[_0x79c5('0x17')][_0xe7dbb2]){_0x4df93f['rules'][_0xe7dbb2][_0x79c5('0x3e')](_0x79c5('0x45'));if(rpc[_0x57c0c5[_0x79c5('0x18')]+_0x79c5('0x46')]){rpc[_0x57c0c5['channel']+'QueueReport'][_0x79c5('0x47')](_0xe7dbb2,{'UserId':_0x57c0c5[_0x79c5('0x19')][_0x79c5('0x48')]})[_0x79c5('0x49')](function(){logger[_0x79c5('0x3a')]('error\x20update\x20queue\x20report');});}}return _0x270e4a({'code':0xc8,'message':_0x57c0c5});}catch(_0x197c6b){logger[_0x79c5('0x3a')](_0x197c6b['stack']);return _0x4c1d6d(_0xae2135['error'](0x1f4,_0x197c6b));}}logger[_0x79c5('0x3a')](_0x79c5('0x4a'));return _0x4c1d6d(_0xae2135[_0x79c5('0x3a')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x26f9c5){var _0x4a76ec=this;return new Promise(function(_0x1d4c22,_0x276ab4){if(_0x26f9c5[_0x79c5('0x42')]&&_0x26f9c5[_0x79c5('0x42')]['id']){try{if(_0x4df93f[_0x79c5('0x43')][_0x26f9c5[_0x79c5('0x42')]['id']]){_0x4df93f[_0x79c5('0x43')][_0x26f9c5['agent']['id']][_0x79c5('0x44')]=![];_0x4df93f[_0x79c5('0x43')][_0x26f9c5[_0x79c5('0x42')]['id']]['busyQueue']=undefined;}return _0x1d4c22({'code':0xc8,'message':_0x26f9c5});}catch(_0x5430ba){logger['error'](_0x5430ba[_0x79c5('0x4b')]);return _0x276ab4(_0x4a76ec[_0x79c5('0x3a')](0x1f4,_0x5430ba));}}logger['error'](_0x79c5('0x4a'));return _0x276ab4(_0x4a76ec['error'](0x1f4,_0x79c5('0x4a')));});},'AbandonInteraction':function(_0x456b94){var _0x23f26e=this;return new Promise(function(_0x4e8de5,_0x3fdef7){if(_0x456b94[_0x79c5('0x18')]&&_0x456b94[_0x79c5('0x1a')]&&_0x456b94[_0x79c5('0x1a')]['id']){try{var _0x50fe12=getId(_0x456b94[_0x79c5('0x18')],_0x456b94[_0x79c5('0x19')]?_0x456b94[_0x79c5('0x19')]['id']:0x0,_0x456b94[_0x79c5('0x1a')]?_0x456b94[_0x79c5('0x1a')]['id']:0x0);if(_0x4df93f[_0x79c5('0x17')][_0x50fe12]){_0x4df93f['rules'][_0x50fe12][_0x79c5('0x3e')]('end');}return _0x4e8de5({'code':0xc8,'message':_0x456b94});}catch(_0x5a95d7){logger[_0x79c5('0x3a')](_0x5a95d7[_0x79c5('0x4b')]);return _0x3fdef7(_0x23f26e[_0x79c5('0x3a')](0x1f4,_0x5a95d7));}}logger[_0x79c5('0x3a')](_0x79c5('0x4a'));return _0x3fdef7(_0x23f26e[_0x79c5('0x3a')](0x1f4,_0x79c5('0x4a')));});},'AgentCapacity':function(_0x4d5cb2){var _0x30bfc1=this;return new Promise(function(_0x39e44d,_0x989e97){if(_0x4df93f[_0x79c5('0x43')][_0x79c5('0x4c')](_0x4d5cb2['id'])){for(var _0x6f32e in _0x4d5cb2[_0x79c5('0x4d')]){if(_0x4d5cb2[_0x79c5('0x4d')][_0x79c5('0x4c')](_0x6f32e)){if(_0x4df93f['agents'][_0x4d5cb2['id']][_0x79c5('0x4c')](_0x6f32e+_0x79c5('0x4e'))){_0x4df93f['agents'][_0x4d5cb2['id']][_0x6f32e+_0x79c5('0x4e')]=parseInt(_0x4d5cb2[_0x79c5('0x4d')][_0x6f32e],0xa);}}}_0x4df93f[_0x79c5('0x43')][_0x4d5cb2['id']][_0x79c5('0x4f')]();return _0x39e44d({'code':0xc8,'message':_0x4df93f[_0x79c5('0x43')][_0x4d5cb2['id']]});}else{return _0x989e97(_0x30bfc1[_0x79c5('0x3a')](0x1f4,_0x79c5('0x50')));}});},'Agents':function(_0x422a1c){return new Promise(function(_0x354e15){var _0x55960c=_[_0x79c5('0x51')](_0x4df93f[_0x79c5('0x43')]);if(_0x422a1c&&_0x422a1c['id']){var _0x91544f=_['find'](_0x55960c,function(_0x1dde23){return _0x1dde23['id']===_0x422a1c['id'];});_0x354e15(_0x91544f);}else{_0x354e15({'count':_0x55960c[_0x79c5('0x1f')],'rows':_0x55960c});}});},'ChatQueues':function(){return new Promise(function(_0x2fef42){var _0x770778=[];for(var _0x30a027 in _0x4df93f[_0x79c5('0x52')]){if(_0x4df93f[_0x79c5('0x52')][_0x79c5('0x4c')](_0x30a027)){var _0x336032=_0x4df93f[_0x79c5('0x52')][_0x30a027];var _0x407b77={'id':_0x336032['id'],'available':_0x336032[_0x79c5('0x53')],'loggedIn':_0x336032[_0x79c5('0x54')],'name':_0x336032[_0x79c5('0x55')],'paused':_0x336032[_0x79c5('0x56')],'waiting':_0x336032[_0x79c5('0x57')]};_0x770778[_0x79c5('0x25')](_0x407b77);}}_0x2fef42({'count':_0x770778[_0x79c5('0x1f')],'rows':_0x770778});});},'MailQueues':function(){return new Promise(function(_0x2aa94b){var _0x37f1b0=[];for(var _0x48e4e8 in _0x4df93f[_0x79c5('0x58')]){if(_0x4df93f[_0x79c5('0x58')][_0x79c5('0x4c')](_0x48e4e8)){var _0x91cff6=_0x4df93f['mailQueues'][_0x48e4e8];var _0x21f2be={'id':_0x91cff6['id'],'available':_0x91cff6[_0x79c5('0x53')],'loggedIn':_0x91cff6['loggedIn'],'name':_0x91cff6[_0x79c5('0x55')],'paused':_0x91cff6[_0x79c5('0x56')],'waiting':_0x91cff6[_0x79c5('0x57')]};_0x37f1b0[_0x79c5('0x25')](_0x21f2be);}}_0x2aa94b({'count':_0x37f1b0[_0x79c5('0x1f')],'rows':_0x37f1b0});});},'OpenchannelQueues':function(){return new Promise(function(_0x33be99){var _0x45675f=[];for(var _0x5f008c in _0x4df93f[_0x79c5('0x59')]){if(_0x4df93f[_0x79c5('0x59')][_0x79c5('0x4c')](_0x5f008c)){var _0x2bda43=_0x4df93f[_0x79c5('0x59')][_0x5f008c];var _0x2b8bad={'id':_0x2bda43['id'],'available':_0x2bda43[_0x79c5('0x53')],'loggedIn':_0x2bda43['loggedIn'],'name':_0x2bda43[_0x79c5('0x55')],'paused':_0x2bda43[_0x79c5('0x56')],'waiting':_0x2bda43['waiting']};_0x45675f[_0x79c5('0x25')](_0x2b8bad);}}_0x33be99({'count':_0x45675f[_0x79c5('0x1f')],'rows':_0x45675f});});},'SmsQueues':function(){return new Promise(function(_0x2fd7ae){var _0x51f653=[];for(var _0x4792eb in _0x4df93f['smsQueues']){if(_0x4df93f[_0x79c5('0x5a')][_0x79c5('0x4c')](_0x4792eb)){var _0x45ed03=_0x4df93f[_0x79c5('0x5a')][_0x4792eb];var _0x1d4eef={'id':_0x45ed03['id'],'available':_0x45ed03['available'],'loggedIn':_0x45ed03[_0x79c5('0x54')],'name':_0x45ed03[_0x79c5('0x55')],'paused':_0x45ed03['paused'],'waiting':_0x45ed03[_0x79c5('0x57')]};_0x51f653['push'](_0x1d4eef);}}_0x2fd7ae({'count':_0x51f653[_0x79c5('0x1f')],'rows':_0x51f653});});},'FaxQueues':function(){return new Promise(function(_0x5e2901){var _0x3b6116=[];for(var _0xd03cbb in _0x4df93f[_0x79c5('0x5b')]){if(_0x4df93f['faxQueues'][_0x79c5('0x4c')](_0xd03cbb)){var _0x19cd46=_0x4df93f[_0x79c5('0x5b')][_0xd03cbb];var _0x133588={'id':_0x19cd46['id'],'available':_0x19cd46[_0x79c5('0x53')],'loggedIn':_0x19cd46[_0x79c5('0x54')],'name':_0x19cd46['name'],'paused':_0x19cd46[_0x79c5('0x56')],'waiting':_0x19cd46[_0x79c5('0x57')]};_0x3b6116[_0x79c5('0x25')](_0x133588);}}_0x5e2901({'count':_0x3b6116[_0x79c5('0x1f')],'rows':_0x3b6116});});},'WhatsappQueues':function(){return new Promise(function(_0x316ade){var _0x3e1e25=[];for(var _0x3e98d6 in _0x4df93f[_0x79c5('0x5c')]){if(_0x4df93f[_0x79c5('0x5c')][_0x79c5('0x4c')](_0x3e98d6)){var _0x3c3cde=_0x4df93f['whatsappQueues'][_0x3e98d6];var _0x5187bd={'id':_0x3c3cde['id'],'available':_0x3c3cde['available'],'loggedIn':_0x3c3cde['loggedIn'],'name':_0x3c3cde[_0x79c5('0x55')],'paused':_0x3c3cde['paused'],'waiting':_0x3c3cde[_0x79c5('0x57')]};_0x3e1e25[_0x79c5('0x25')](_0x5187bd);}}_0x316ade({'count':_0x3e1e25[_0x79c5('0x1f')],'rows':_0x3e1e25});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x26d6d0){var _0x36f7bf=_['values'](_0x4df93f[_0x79c5('0x5d')]);_0x26d6d0({'count':_0x36f7bf['length'],'rows':_0x36f7bf});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x5911e4){var _0xb01b8d=_[_0x79c5('0x51')](_0x4df93f['mailQueuesWaitingInteractions']);_0x5911e4({'count':_0xb01b8d[_0x79c5('0x1f')],'rows':_0xb01b8d});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x3102e0){var _0x1bec9c=_['values'](_0x4df93f[_0x79c5('0x5e')]);_0x3102e0({'count':_0x1bec9c[_0x79c5('0x1f')],'rows':_0x1bec9c});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x2e3e1d){var _0x3f90db=_['values'](_0x4df93f[_0x79c5('0x5f')]);_0x2e3e1d({'count':_0x3f90db[_0x79c5('0x1f')],'rows':_0x3f90db});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x19b72c){var _0x4ce1b4=_['values'](_0x4df93f[_0x79c5('0x60')]);_0x19b72c({'count':_0x4ce1b4[_0x79c5('0x1f')],'rows':_0x4ce1b4});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x460a8e){var _0x1456b0=_[_0x79c5('0x51')](_0x4df93f[_0x79c5('0x61')]);_0x460a8e({'count':_0x1456b0[_0x79c5('0x1f')],'rows':_0x1456b0});});}};var _0x4b20be=jayson['server'](_0x154a90)['http']();_0x4b20be['on'](_0x79c5('0x3a'),function(_0x4c7eb7){logger[_0x79c5('0x3a')](JSON[_0x79c5('0x3c')](_0x4c7eb7));return _0x555da7(_0x4c7eb7);});_0x4b20be[_0x79c5('0x16')](0x232c,_0x79c5('0x62'),function(){console['log'](_0x79c5('0x63'),0x232c);return _0x2d0410(_0x79c5('0x64')+0x232c);});});}; \ No newline at end of file +var _0x0b36=['body','%s:%s:%s','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','.js','execute','Applications\x20executed','stringify','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','stack','agent','agents','busy','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busyQueue','end','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','find','chatQueues','loggedIn','name','paused','mailQueues','available','openchannelQueues','smsQueues','waiting','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','./applications/strategy/util','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','checkWaitingNotifications','applications','isArray','length','existsSync','join','app','toLowerCase','appdata','split','push','slice','dialogflow','dialogflowv2','amazonlex','TagId','tvox','getMustacheRender','account','notificationTemplate','interaction','ChatWebsiteId','ContactId'];(function(_0x457ef8,_0x1a19ae){var _0x596c56=function(_0x3b3b8f){while(--_0x3b3b8f){_0x457ef8['push'](_0x457ef8['shift']());}};_0x596c56(++_0x1a19ae);}(_0x0b36,0x10c));var _0x60b3=function(_0xdd0313,_0x251c2b){_0xdd0313=_0xdd0313-0x0;var _0x2bd7e8=_0x0b36[_0xdd0313];return _0x2bd7e8;};'use strict';var _=require(_0x60b3('0x0'));var util=require(_0x60b3('0x1'));var path=require(_0x60b3('0x2'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require('bluebird');var utils=require('./applications/utils');var sUtils=require(_0x60b3('0x3'));var logger=require('../../../config/logger')(_0x60b3('0x4'));var rpc={'openchannelQueueReport':require(_0x60b3('0x5')),'mailQueueReport':require(_0x60b3('0x6')),'chatQueueReport':require(_0x60b3('0x7')),'smsQueueReport':require(_0x60b3('0x8')),'faxQueueReport':require(_0x60b3('0x9')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require('../lib/rule-engine');function getId(_0x406789,_0x2adbdc,_0x337f03){return util[_0x60b3('0xa')](_0x60b3('0xb'),_0x406789,_0x2adbdc||0x0,_0x337f03||0x0);}function getIntervals(_0x2ffa8e,_0x8e51d8){var _0x5cdf3d=[];if(!_[_0x60b3('0xc')](_0x8e51d8[_0x60b3('0xd')])&&!_['isNil'](_0x2ffa8e[_0x8e51d8[_0x60b3('0xd')]])&&!_[_0x60b3('0xc')](_0x2ffa8e[_0x8e51d8[_0x60b3('0xd')]][_0x60b3('0xe')])){_0x5cdf3d=_[_0x60b3('0xf')](_0x2ffa8e[_0x8e51d8[_0x60b3('0xd')]][_0x60b3('0xe')],_0x60b3('0x10'));}else if(!_[_0x60b3('0xc')](_0x8e51d8['interval'])){_0x5cdf3d=[_0x8e51d8[_0x60b3('0x10')]];}return _0x5cdf3d;}exports[_0x60b3('0x11')]=function(_0x390a65){_0x390a65[_0x60b3('0x12')]={};return new BPromise(function(_0x23d7ff,_0xd99ded){var _0x4550b3={'Start':function(_0x4f3453){var _0x1017ab=this;return new Promise(function(_0x1c3afe,_0x55793c){if(_0x4f3453){try{var _0x20dc0d=[];var _0xda085=getId(_0x4f3453[_0x60b3('0x13')],_0x4f3453[_0x60b3('0x14')]?_0x4f3453[_0x60b3('0x14')]['id']:0x0,_0x4f3453['interaction']?_0x4f3453['interaction']['id']:0x0);var _0x9df0ff=sUtils[_0x60b3('0x15')](_0x390a65,_0x4f3453);if(_0x4f3453['transfer']||!_0x9df0ff&&_0x4f3453[_0x60b3('0x16')]&&_[_0x60b3('0x17')](_0x4f3453[_0x60b3('0x16')])&&_0x4f3453['applications'][_0x60b3('0x18')]){for(var _0x1fb9ac=0x0;_0x1fb9ac<_0x4f3453['applications'][_0x60b3('0x18')];_0x1fb9ac+=0x1){var _0x2ee3ff=_0x4f3453[_0x60b3('0x16')][_0x1fb9ac];if(fs[_0x60b3('0x19')](path[_0x60b3('0x1a')](__dirname,_0x60b3('0x16'),_0x2ee3ff[_0x60b3('0x1b')]+'.js'))){var _0x3fa614=[];switch(_0x2ee3ff[_0x60b3('0x1b')][_0x60b3('0x1c')]()){case'autoreply':var _0x237d6c=_0x2ee3ff[_0x60b3('0x1d')][_0x60b3('0x1e')](',');if(_0x4f3453['channel']==='mail'){_0x3fa614['push'](_0x237d6c[0x0]);_0x3fa614[_0x60b3('0x1f')](_0x237d6c[0x1]);_0x3fa614[_0x60b3('0x1f')](_0x237d6c['slice'](0x2,_0x237d6c[_0x60b3('0x18')])[_0x60b3('0x1a')](','));}else{_0x3fa614[_0x60b3('0x1f')](_0x237d6c[0x0]);_0x3fa614[_0x60b3('0x1f')](_0x237d6c[_0x60b3('0x20')](0x1,_0x237d6c['length'])[_0x60b3('0x1a')](','));}break;case _0x60b3('0x21'):var _0x2ae666=_0x2ee3ff[_0x60b3('0x1d')][_0x60b3('0x1e')](',');_0x3fa614[_0x60b3('0x1f')](_0x2ae666[0x0]);_0x3fa614['push'](_0x2ae666[0x1]);_0x3fa614[_0x60b3('0x1f')](_0x2ae666[_0x60b3('0x20')](0x2,_0x2ae666[_0x60b3('0x18')])[_0x60b3('0x1a')](','));break;case _0x60b3('0x22'):var _0x559922=_0x2ee3ff[_0x60b3('0x1d')][_0x60b3('0x1e')](',');_0x3fa614[_0x60b3('0x1f')](_0x559922[0x0]);_0x3fa614[_0x60b3('0x1f')](_0x559922[0x1]);_0x3fa614[_0x60b3('0x1f')](_0x559922[0x2]);_0x3fa614['push'](_0x559922[0x3]);_0x3fa614[_0x60b3('0x1f')](_0x559922[_0x60b3('0x20')](0x4,_0x559922[_0x60b3('0x18')])['join'](','));break;case _0x60b3('0x23'):var _0x33d709=_0x2ee3ff['appdata'][_0x60b3('0x1e')](',');_0x3fa614[_0x60b3('0x1f')](_0x33d709[0x0]);_0x3fa614[_0x60b3('0x1f')](_0x33d709[0x1]);_0x3fa614['push'](_0x33d709[0x2]);_0x3fa614[_0x60b3('0x1f')](_0x33d709[0x3]);_0x3fa614[_0x60b3('0x1f')](_0x33d709[_0x60b3('0x20')](0x4,_0x33d709[_0x60b3('0x18')])['join'](','));break;case _0x60b3('0x14'):_0x3fa614[_0x60b3('0x1f')](_0x2ee3ff[_0x60b3('0x1d')]);break;case'tag':_0x3fa614['push'](_0x2ee3ff[_0x60b3('0x24')]);_0x3fa614[_0x60b3('0x1f')](_0x2ee3ff[_0x60b3('0x1d')]);break;case _0x60b3('0x25'):var _0x2c4687=utils[_0x60b3('0x26')](_0x4f3453[_0x60b3('0x27')][_0x60b3('0x28')],_0x4f3453);var _0x45ee44=_0x2ee3ff[_0x60b3('0x1d')][_0x60b3('0x1e')](',');_0x3fa614[_0x60b3('0x1f')](_0x45ee44[0x0]);_0x3fa614[_0x60b3('0x1f')](_0x45ee44[0x1]);_0x3fa614[_0x60b3('0x1f')](_0x45ee44[0x2]);_0x3fa614[_0x60b3('0x1f')](_0x45ee44[0x3]);_0x3fa614['push'](_0x45ee44[0x4]);_0x3fa614[_0x60b3('0x1f')](_0x45ee44[0x5]);_0x3fa614[_0x60b3('0x1f')](_0x45ee44[0x6]);_0x3fa614['push'](_0x45ee44[0x7]);_0x3fa614[_0x60b3('0x1f')](_0x45ee44[0x8]);_0x3fa614['push'](_0x45ee44[0x9]);_0x3fa614[_0x60b3('0x1f')](_0x45ee44[0xa]);_0x3fa614[_0x60b3('0x1f')](_0x4f3453[_0x60b3('0x29')]['id']);_0x3fa614[_0x60b3('0x1f')](_0x4f3453['message']['id']);_0x3fa614['push'](_0x2ee3ff[_0x60b3('0x2a')]);_0x3fa614[_0x60b3('0x1f')](_0x4f3453['interaction'][_0x60b3('0x2b')]);_0x3fa614[_0x60b3('0x1f')](_0x4f3453[_0x60b3('0x2c')][_0x60b3('0x2c')]);_0x3fa614['push'](_0x2c4687);break;default:_0x3fa614=_[_0x60b3('0xc')](_0x2ee3ff['appdata'])?[]:_0x2ee3ff['appdata']['split'](',');}var _0x9de7e3={'id':util[_0x60b3('0xa')](_0x60b3('0x2d'),_0xda085,_0x2ee3ff['id'],_0x2ee3ff[_0x60b3('0x1b')]),'condition':require('./interval')['condition'](_0xda085,getIntervals(_0x390a65[_0x60b3('0x2e')],_0x2ee3ff),_0x390a65),'consequence':require(_0x60b3('0x2f')+_0x2ee3ff[_0x60b3('0x1b')])[_0x60b3('0x30')](_0xda085,_0x3fa614,_0x390a65,_0x4f3453),'p':_0x2ee3ff[_0x60b3('0x31')]||0x0};logger[_0x60b3('0x32')](_0x60b3('0x33'),_0x9de7e3['id'],_0x60b3('0x34'),getIntervals(_0x390a65[_0x60b3('0x2e')],_0x2ee3ff)[_0x60b3('0x1a')](_0x60b3('0x35')));_0x20dc0d[_0x60b3('0x1f')](_0x9de7e3);}else{logger[_0x60b3('0x36')](_0x60b3('0x37'),path[_0x60b3('0x1a')](__dirname,_0x60b3('0x16'),_0x2ee3ff[_0x60b3('0x1b')]+_0x60b3('0x38')));}}_0x390a65[_0x60b3('0x12')][_0xda085]=new RuleEngine(_0x20dc0d);_0x390a65[_0x60b3('0x12')][_0xda085][_0x60b3('0x39')](_0x4f3453,function(_0x13e15f){logger[_0x60b3('0x32')](_0x60b3('0x3a'),JSON[_0x60b3('0x3b')](_0x13e15f[_0x60b3('0x3c')]));if(_0x390a65[_0x60b3('0x12')][_0xda085]){_0x390a65[_0x60b3('0x12')][_0xda085][_0x60b3('0x3d')](_0x60b3('0x3e'));}});return _0x1c3afe({'code':0xc8,'message':_0x4f3453});}else{if(_0x9df0ff){logger[_0x60b3('0x32')](util[_0x60b3('0xa')](_0x60b3('0x3f'),_0xda085));}else{logger[_0x60b3('0x32')]('No\x20applications\x20to\x20execute');}return _0x1c3afe({'code':0xc8,'message':_0x4f3453});}}catch(_0x406e35){logger['error'](_0x406e35[_0x60b3('0x40')]);return _0x55793c(_0x1017ab[_0x60b3('0x36')](0x1f4,_0x406e35));}}return _0x55793c('routing\x20is\x20empty');});},'AcceptMessage':function(_0xa3b473){var _0x31c9e0=this;return new Promise(function(_0x16f82b,_0x408125){if(_0xa3b473['agent']&&_0xa3b473[_0x60b3('0x41')]['id']){if(_0x390a65[_0x60b3('0x42')][_0xa3b473['agent']['id']]){_0x390a65['agents'][_0xa3b473[_0x60b3('0x41')]['id']][_0x60b3('0x43')]=![];_0x390a65[_0x60b3('0x42')][_0xa3b473[_0x60b3('0x41')]['id']]['busyQueue']=undefined;}}if(_0xa3b473[_0x60b3('0x14')]&&_0xa3b473[_0x60b3('0x14')]['id']){try{var _0x2bcead=getId(_0xa3b473[_0x60b3('0x13')],_0xa3b473[_0x60b3('0x14')]?_0xa3b473[_0x60b3('0x14')]['id']:0x0,_0xa3b473[_0x60b3('0x29')]?_0xa3b473['interaction']['id']:0x0);if(_0x390a65['rules'][_0x2bcead]){_0x390a65[_0x60b3('0x12')][_0x2bcead][_0x60b3('0x3d')]('end');if(rpc[_0xa3b473[_0x60b3('0x13')]+_0x60b3('0x44')]){rpc[_0xa3b473['channel']+_0x60b3('0x44')][_0x60b3('0x45')](_0x2bcead,{'UserId':_0xa3b473[_0x60b3('0x14')][_0x60b3('0x46')]})[_0x60b3('0x47')](function(){logger[_0x60b3('0x36')](_0x60b3('0x48'));});}}return _0x16f82b({'code':0xc8,'message':_0xa3b473});}catch(_0x300593){logger['error'](_0x300593[_0x60b3('0x40')]);return _0x408125(_0x31c9e0[_0x60b3('0x36')](0x1f4,_0x300593));}}logger[_0x60b3('0x36')](_0x60b3('0x49'));return _0x408125(_0x31c9e0['error'](0x1f4,_0x60b3('0x49')));});},'RejectMessage':function(_0x26c845){var _0x11c1d6=this;return new Promise(function(_0x1d0449,_0x11550f){if(_0x26c845[_0x60b3('0x41')]&&_0x26c845[_0x60b3('0x41')]['id']){try{if(_0x390a65['agents'][_0x26c845[_0x60b3('0x41')]['id']]){_0x390a65['agents'][_0x26c845['agent']['id']][_0x60b3('0x43')]=![];_0x390a65['agents'][_0x26c845[_0x60b3('0x41')]['id']][_0x60b3('0x4a')]=undefined;}return _0x1d0449({'code':0xc8,'message':_0x26c845});}catch(_0x5ee286){logger[_0x60b3('0x36')](_0x5ee286[_0x60b3('0x40')]);return _0x11550f(_0x11c1d6[_0x60b3('0x36')](0x1f4,_0x5ee286));}}logger[_0x60b3('0x36')](_0x60b3('0x49'));return _0x11550f(_0x11c1d6[_0x60b3('0x36')](0x1f4,_0x60b3('0x49')));});},'AbandonInteraction':function(_0x1b0522){var _0x55d133=this;return new Promise(function(_0x3e52db,_0x23e54d){if(_0x1b0522[_0x60b3('0x13')]&&_0x1b0522[_0x60b3('0x29')]&&_0x1b0522[_0x60b3('0x29')]['id']){try{var _0x2c1bef=getId(_0x1b0522['channel'],_0x1b0522[_0x60b3('0x14')]?_0x1b0522[_0x60b3('0x14')]['id']:0x0,_0x1b0522[_0x60b3('0x29')]?_0x1b0522[_0x60b3('0x29')]['id']:0x0);if(_0x390a65['rules'][_0x2c1bef]){_0x390a65[_0x60b3('0x12')][_0x2c1bef]['emit'](_0x60b3('0x4b'));}return _0x3e52db({'code':0xc8,'message':_0x1b0522});}catch(_0xed4d1a){logger[_0x60b3('0x36')](_0xed4d1a['stack']);return _0x23e54d(_0x55d133[_0x60b3('0x36')](0x1f4,_0xed4d1a));}}logger[_0x60b3('0x36')](_0x60b3('0x49'));return _0x23e54d(_0x55d133[_0x60b3('0x36')](0x1f4,_0x60b3('0x49')));});},'AgentCapacity':function(_0x676ef7){var _0x458b56=this;return new Promise(function(_0x19e00f,_0x54ba8b){if(_0x390a65[_0x60b3('0x42')][_0x60b3('0x4c')](_0x676ef7['id'])){for(var _0x12e1e3 in _0x676ef7['capacity']){if(_0x676ef7[_0x60b3('0x4d')][_0x60b3('0x4c')](_0x12e1e3)){if(_0x390a65['agents'][_0x676ef7['id']][_0x60b3('0x4c')](_0x12e1e3+_0x60b3('0x4e'))){_0x390a65[_0x60b3('0x42')][_0x676ef7['id']][_0x12e1e3+_0x60b3('0x4e')]=parseInt(_0x676ef7[_0x60b3('0x4d')][_0x12e1e3],0xa);}}}_0x390a65[_0x60b3('0x42')][_0x676ef7['id']][_0x60b3('0x4f')]();return _0x19e00f({'code':0xc8,'message':_0x390a65[_0x60b3('0x42')][_0x676ef7['id']]});}else{return _0x54ba8b(_0x458b56[_0x60b3('0x36')](0x1f4,_0x60b3('0x50')));}});},'Agents':function(_0x446f34){return new Promise(function(_0x1c7503){var _0xa6e42=_[_0x60b3('0x51')](_0x390a65[_0x60b3('0x42')]);if(_0x446f34&&_0x446f34['id']){var _0x16cc64=_[_0x60b3('0x52')](_0xa6e42,function(_0x4cea0c){return _0x4cea0c['id']===_0x446f34['id'];});_0x1c7503(_0x16cc64);}else{_0x1c7503({'count':_0xa6e42[_0x60b3('0x18')],'rows':_0xa6e42});}});},'ChatQueues':function(){return new Promise(function(_0x1ec577){var _0x3757d1=[];for(var _0x229732 in _0x390a65[_0x60b3('0x53')]){if(_0x390a65[_0x60b3('0x53')]['hasOwnProperty'](_0x229732)){var _0x24a3dd=_0x390a65[_0x60b3('0x53')][_0x229732];var _0x35a724={'id':_0x24a3dd['id'],'available':_0x24a3dd['available'],'loggedIn':_0x24a3dd[_0x60b3('0x54')],'name':_0x24a3dd[_0x60b3('0x55')],'paused':_0x24a3dd[_0x60b3('0x56')],'waiting':_0x24a3dd['waiting']};_0x3757d1[_0x60b3('0x1f')](_0x35a724);}}_0x1ec577({'count':_0x3757d1[_0x60b3('0x18')],'rows':_0x3757d1});});},'MailQueues':function(){return new Promise(function(_0xd7bb54){var _0xf5afb1=[];for(var _0x50575a in _0x390a65[_0x60b3('0x57')]){if(_0x390a65[_0x60b3('0x57')][_0x60b3('0x4c')](_0x50575a)){var _0x27cd5f=_0x390a65[_0x60b3('0x57')][_0x50575a];var _0x420761={'id':_0x27cd5f['id'],'available':_0x27cd5f[_0x60b3('0x58')],'loggedIn':_0x27cd5f[_0x60b3('0x54')],'name':_0x27cd5f[_0x60b3('0x55')],'paused':_0x27cd5f[_0x60b3('0x56')],'waiting':_0x27cd5f['waiting']};_0xf5afb1[_0x60b3('0x1f')](_0x420761);}}_0xd7bb54({'count':_0xf5afb1[_0x60b3('0x18')],'rows':_0xf5afb1});});},'OpenchannelQueues':function(){return new Promise(function(_0xfba138){var _0x50de78=[];for(var _0x127ef7 in _0x390a65[_0x60b3('0x59')]){if(_0x390a65[_0x60b3('0x59')][_0x60b3('0x4c')](_0x127ef7)){var _0x44952c=_0x390a65['openchannelQueues'][_0x127ef7];var _0x239f94={'id':_0x44952c['id'],'available':_0x44952c[_0x60b3('0x58')],'loggedIn':_0x44952c['loggedIn'],'name':_0x44952c[_0x60b3('0x55')],'paused':_0x44952c['paused'],'waiting':_0x44952c['waiting']};_0x50de78[_0x60b3('0x1f')](_0x239f94);}}_0xfba138({'count':_0x50de78[_0x60b3('0x18')],'rows':_0x50de78});});},'SmsQueues':function(){return new Promise(function(_0x5e1e01){var _0x5856a5=[];for(var _0x4f13d8 in _0x390a65[_0x60b3('0x5a')]){if(_0x390a65[_0x60b3('0x5a')][_0x60b3('0x4c')](_0x4f13d8)){var _0x18c6ba=_0x390a65['smsQueues'][_0x4f13d8];var _0x3a2b33={'id':_0x18c6ba['id'],'available':_0x18c6ba['available'],'loggedIn':_0x18c6ba[_0x60b3('0x54')],'name':_0x18c6ba[_0x60b3('0x55')],'paused':_0x18c6ba[_0x60b3('0x56')],'waiting':_0x18c6ba[_0x60b3('0x5b')]};_0x5856a5[_0x60b3('0x1f')](_0x3a2b33);}}_0x5e1e01({'count':_0x5856a5[_0x60b3('0x18')],'rows':_0x5856a5});});},'FaxQueues':function(){return new Promise(function(_0x5b8081){var _0x14f2c7=[];for(var _0x43f3b8 in _0x390a65['faxQueues']){if(_0x390a65[_0x60b3('0x5c')][_0x60b3('0x4c')](_0x43f3b8)){var _0x24a874=_0x390a65['faxQueues'][_0x43f3b8];var _0x14b92e={'id':_0x24a874['id'],'available':_0x24a874[_0x60b3('0x58')],'loggedIn':_0x24a874[_0x60b3('0x54')],'name':_0x24a874['name'],'paused':_0x24a874[_0x60b3('0x56')],'waiting':_0x24a874[_0x60b3('0x5b')]};_0x14f2c7[_0x60b3('0x1f')](_0x14b92e);}}_0x5b8081({'count':_0x14f2c7[_0x60b3('0x18')],'rows':_0x14f2c7});});},'WhatsappQueues':function(){return new Promise(function(_0x51f276){var _0x38d449=[];for(var _0x558b81 in _0x390a65[_0x60b3('0x5d')]){if(_0x390a65[_0x60b3('0x5d')][_0x60b3('0x4c')](_0x558b81)){var _0x3eea0d=_0x390a65['whatsappQueues'][_0x558b81];var _0x3b870d={'id':_0x3eea0d['id'],'available':_0x3eea0d[_0x60b3('0x58')],'loggedIn':_0x3eea0d[_0x60b3('0x54')],'name':_0x3eea0d[_0x60b3('0x55')],'paused':_0x3eea0d[_0x60b3('0x56')],'waiting':_0x3eea0d['waiting']};_0x38d449[_0x60b3('0x1f')](_0x3b870d);}}_0x51f276({'count':_0x38d449[_0x60b3('0x18')],'rows':_0x38d449});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x32333f){var _0x222606=_[_0x60b3('0x51')](_0x390a65['chatQueuesWaitingInteractions']);_0x32333f({'count':_0x222606['length'],'rows':_0x222606});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x407ea8){var _0x390252=_[_0x60b3('0x51')](_0x390a65[_0x60b3('0x5e')]);_0x407ea8({'count':_0x390252[_0x60b3('0x18')],'rows':_0x390252});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x3801ac){var _0x3af765=_[_0x60b3('0x51')](_0x390a65[_0x60b3('0x5f')]);_0x3801ac({'count':_0x3af765[_0x60b3('0x18')],'rows':_0x3af765});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x3de484){var _0x32a959=_[_0x60b3('0x51')](_0x390a65[_0x60b3('0x60')]);_0x3de484({'count':_0x32a959[_0x60b3('0x18')],'rows':_0x32a959});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x4b9838){var _0x3e2537=_['values'](_0x390a65[_0x60b3('0x61')]);_0x4b9838({'count':_0x3e2537[_0x60b3('0x18')],'rows':_0x3e2537});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0xe340b7){var _0xb3782b=_['values'](_0x390a65[_0x60b3('0x62')]);_0xe340b7({'count':_0xb3782b[_0x60b3('0x18')],'rows':_0xb3782b});});}};var _0xf51e19=jayson[_0x60b3('0x63')](_0x4550b3)[_0x60b3('0x64')]();_0xf51e19['on'](_0x60b3('0x36'),function(_0x3044b3){logger[_0x60b3('0x36')](JSON[_0x60b3('0x3b')](_0x3044b3));return _0xd99ded(_0x3044b3);});_0xf51e19['listen'](0x232c,_0x60b3('0x65'),function(){console['log'](_0x60b3('0x66'),0x232c);return _0x23d7ff(_0x60b3('0x67')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 0d2caef..97531bb 100644 --- a/server/services/routing/server/interval.js +++ b/server/services/routing/server/interval.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7358=['when','[%s][INTERVAL\x20NOT\x20VALID]\x20%s\x20%s','join','../../../utils/iftime','iftime','routing','condition','rules','stop','map','info','[%s][INTERVAL\x20VALID]\x20%s\x20%s','\x20|\x20'];(function(_0x4404ff,_0x13d7a9){var _0x5e7b19=function(_0x13847a){while(--_0x13847a){_0x4404ff['push'](_0x4404ff['shift']());}};_0x5e7b19(++_0x13d7a9);}(_0x7358,0xe0));var _0x8735=function(_0x454fcb,_0x5a9e7c){_0x454fcb=_0x454fcb-0x0;var _0x49458d=_0x7358[_0x454fcb];return _0x49458d;};'use strict';var _=require('lodash');var iftime=require(_0x8735('0x0'))[_0x8735('0x1')];var logger=require('../../../config/logger')(_0x8735('0x2'));exports[_0x8735('0x3')]=function(_0x565441,_0x43c876,_0x2a1f27){return function(_0x4a44f6){if(_0x2a1f27[_0x8735('0x4')]&&!_0x2a1f27[_0x8735('0x4')][_0x565441]){logger['info']('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x565441);return _0x4a44f6[_0x8735('0x5')]();}var _0x5e8e16=_0x43c876[_0x8735('0x6')](function(_0x46d378){return iftime(_0x46d378);});var _0x43b3af=_['some'](_0x5e8e16);if(_0x43b3af){logger[_0x8735('0x7')](_0x8735('0x8'),_0x565441,_0x43c876['join'](_0x8735('0x9')),_0x43b3af);_0x4a44f6[_0x8735('0xa')](_0x43b3af);}else{logger[_0x8735('0x7')](_0x8735('0xb'),_0x565441,_0x43c876[_0x8735('0xc')](_0x8735('0x9')));_0x4a44f6[_0x8735('0x5')]();}};}; \ No newline at end of file +var _0x4a24=['[%s][INTERVAL\x20VALID]\x20%s\x20%s','join','\x20|\x20','[%s][INTERVAL\x20NOT\x20VALID]\x20%s\x20%s','lodash','../../../utils/iftime','iftime','../../../config/logger','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','map','some'];(function(_0x33c603,_0x6d0ce4){var _0xae96f4=function(_0x2679f8){while(--_0x2679f8){_0x33c603['push'](_0x33c603['shift']());}};_0xae96f4(++_0x6d0ce4);}(_0x4a24,0xa9));var _0x44a2=function(_0x28611e,_0x586726){_0x28611e=_0x28611e-0x0;var _0x530f69=_0x4a24[_0x28611e];return _0x530f69;};'use strict';var _=require(_0x44a2('0x0'));var iftime=require(_0x44a2('0x1'))[_0x44a2('0x2')];var logger=require(_0x44a2('0x3'))('routing');exports[_0x44a2('0x4')]=function(_0x1743ce,_0x3a6c0f,_0x31af36){return function(_0x29fed5){if(_0x31af36[_0x44a2('0x5')]&&!_0x31af36[_0x44a2('0x5')][_0x1743ce]){logger[_0x44a2('0x6')](_0x44a2('0x7'),_0x1743ce);return _0x29fed5[_0x44a2('0x8')]();}var _0x503966=_0x3a6c0f[_0x44a2('0x9')](function(_0x2e8d22){return iftime(_0x2e8d22);});var _0x124a04=_[_0x44a2('0xa')](_0x503966);if(_0x124a04){logger['info'](_0x44a2('0xb'),_0x1743ce,_0x3a6c0f[_0x44a2('0xc')](_0x44a2('0xd')),_0x124a04);_0x29fed5['when'](_0x124a04);}else{logger[_0x44a2('0x6')](_0x44a2('0xe'),_0x1743ce,_0x3a6c0f[_0x44a2('0xc')]('\x20|\x20'));_0x29fed5[_0x44a2('0x8')]();}};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 7f83a82..09719bd 100644 --- a/server/services/xdr/agents.controller.js +++ b/server/services/xdr/agents.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6cb4=['[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','diffTime','agent','[%s][agents][hangup]','lodash','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','queue','interface','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentcomplete','acw','agentacw','acwTimeout','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinename','membername','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','ringtime','talktime','push','forIn','includes','[%s][agents][queuecallerabandon]','abandoned','holdtime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','answered_elsewhere','answeredelsewheredestinationuniqueid','[%s][agents][agentcomplete]','agentcompleteAt','complete','transfereruniqueid','[%s][agents][blindtransfer]','transfer','blind','transferexten','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','origtransfererexten','transferuniqueid','transfereeuniqueid','agententerreason','clone','calleridnum','calleridname','secondtransfererlinkedid','transfertype','secondtransfererexten','transfertargetuniqueid','hangup','cause'];(function(_0xe3cc6f,_0x1ab24e){var _0x33605e=function(_0x206a57){while(--_0x206a57){_0xe3cc6f['push'](_0xe3cc6f['shift']());}};_0x33605e(++_0x1ab24e);}(_0x6cb4,0xff));var _0x46cb=function(_0x30ba88,_0x130e87){_0x30ba88=_0x30ba88-0x0;var _0x58b89a=_0x6cb4[_0x30ba88];return _0x58b89a;};'use strict';var _=require(_0x46cb('0x0'));var util=require(_0x46cb('0x1'));var utils=require(_0x46cb('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x3403fc,_0x375bef){utils[_0x46cb('0x3')](util[_0x46cb('0x4')](_0x46cb('0x5'),_0x3403fc[_0x46cb('0x6')],_0x3403fc['channel'],_0x3403fc[_0x46cb('0x7')],_0x3403fc['membername'],_0x3403fc[_0x46cb('0x8')],_0x3403fc['calleridnum'],_0x3403fc[_0x46cb('0x9')],_0x3403fc[_0x46cb('0xa')]));if(_0x3403fc[_0x46cb('0x7')]){utils[_0x46cb('0xb')](_0x3403fc[_0x46cb('0x7')])[_0x46cb('0xc')](function(_0x56258a){if(_0x56258a){_0x3403fc[_0x46cb('0xd')]=_0x56258a[_0x46cb('0xd')];_0x3403fc['agentacw']=_0x3403fc[_0x46cb('0xe')]?_0x56258a[_0x46cb('0xf')]:![];_0x3403fc['acwtime']=_0x3403fc[_0x46cb('0x10')]?_0x56258a[_0x46cb('0x11')]:0x0;}utils['request']('CreateVoiceAgentReport',_0x3403fc);});}else{utils['request'](_0x46cb('0x12'),_0x3403fc);}if(_0x375bef){delete transfers[_0x3403fc[_0x46cb('0x6')]];}else{delete agents[_0x3403fc[_0x46cb('0x13')]];}}exports[_0x46cb('0x14')]=function(_0x553440){try{utils[_0x46cb('0x15')](util[_0x46cb('0x4')](_0x46cb('0x16'),_0x553440[_0x46cb('0x6')]),_0x553440);agents[_0x553440[_0x46cb('0x13')]]=_0x553440;agents[_0x553440[_0x46cb('0x13')]][_0x46cb('0x17')]=utils[_0x46cb('0x18')]();agents[_0x553440[_0x46cb('0x13')]][_0x46cb('0xa')]=_0x46cb('0x19');agents[_0x553440['destuniqueid']][_0x46cb('0x9')]=null;agents[_0x553440['destuniqueid']][_0x46cb('0x1a')]=null;utils['info'](util['format']('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x553440[_0x46cb('0x6')],agents[_0x553440[_0x46cb('0x13')]][_0x46cb('0x1b')],_0x553440[_0x46cb('0x13')]));}catch(_0xbd488f){utils[_0x46cb('0x1c')](util[_0x46cb('0x4')](_0x46cb('0x16'),_0x553440[_0x46cb('0x6')]),_0xbd488f);}};exports[_0x46cb('0x1d')]=function(_0x149483){try{if(!_[_0x46cb('0x1e')](agents[_0x149483[_0x46cb('0x13')]])){utils[_0x46cb('0x15')](util[_0x46cb('0x4')](_0x46cb('0x1f'),_0x149483[_0x46cb('0x6')]),_0x149483);utils[_0x46cb('0x3')](util[_0x46cb('0x4')](_0x46cb('0x20'),_0x149483[_0x46cb('0x6')],agents[_0x149483[_0x46cb('0x13')]][_0x46cb('0x1b')],_0x149483[_0x46cb('0x13')]));agents[_0x149483[_0x46cb('0x13')]]['agentringnoanswer']=!![];agents[_0x149483['destuniqueid']][_0x46cb('0x21')]=utils[_0x46cb('0x18')]();agents[_0x149483[_0x46cb('0x13')]][_0x46cb('0xa')]=_0x46cb('0x22');agents[_0x149483['destuniqueid']][_0x46cb('0x23')]='timeout';agents[_0x149483['destuniqueid']]['holdtime']=_0x149483[_0x46cb('0x24')]?parseInt(_0x149483[_0x46cb('0x24')])/0x3e8:0x0;agents[_0x149483[_0x46cb('0x13')]][_0x46cb('0x25')]=0x0;unanswered[_0x46cb('0x26')](_0x149483[_0x46cb('0x13')]);}}catch(_0x378dc7){utils[_0x46cb('0x1c')](util[_0x46cb('0x4')](_0x46cb('0x1f'),_0x149483[_0x46cb('0x6')]),_0x378dc7);}};exports['queuecallerabandon']=function(_0x1ce88f){try{_[_0x46cb('0x27')](agents,function(_0x4c73bd,_0x49e0bc){if(_0x4c73bd[_0x46cb('0x6')]==_0x1ce88f['uniqueid']&&!_[_0x46cb('0x28')](unanswered,_0x4c73bd[_0x46cb('0x13')])){utils[_0x46cb('0x15')](util[_0x46cb('0x4')](_0x46cb('0x29'),_0x1ce88f[_0x46cb('0x6')]),_0x1ce88f);utils['info'](util[_0x46cb('0x4')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x1ce88f[_0x46cb('0x6')],_0x4c73bd[_0x46cb('0x1b')],_0x4c73bd['destuniqueid']));_0x4c73bd[_0x46cb('0x1d')]=!![];_0x4c73bd[_0x46cb('0x21')]=utils[_0x46cb('0x18')]();_0x4c73bd[_0x46cb('0xa')]=_0x46cb('0x2a');_0x4c73bd['reason']=_0x46cb('0x2a');_0x4c73bd['holdtime']=_0x1ce88f[_0x46cb('0x2b')];_0x4c73bd[_0x46cb('0x25')]=0x0;writeDB(_0x4c73bd);}});}catch(_0x2630e0){utils['error'](util[_0x46cb('0x4')](_0x46cb('0x29'),_0x1ce88f['uniqueid']),_0x2630e0);}};exports[_0x46cb('0x2c')]=function(_0xf8be9){try{if(agents[_0xf8be9[_0x46cb('0x13')]]){utils[_0x46cb('0x15')](util[_0x46cb('0x4')](_0x46cb('0x2d'),_0xf8be9[_0x46cb('0x6')]),_0xf8be9);utils[_0x46cb('0x3')](util[_0x46cb('0x4')](_0x46cb('0x2e'),_0xf8be9[_0x46cb('0x6')],agents[_0xf8be9['destuniqueid']]['membername'],_0xf8be9['destuniqueid']));agents[_0xf8be9[_0x46cb('0x13')]][_0x46cb('0x2f')]=utils[_0x46cb('0x18')]();agents[_0xf8be9[_0x46cb('0x13')]][_0x46cb('0x9')]=_0xf8be9[_0x46cb('0x9')];agents[_0xf8be9['destuniqueid']][_0x46cb('0x1a')]=_0xf8be9['connectedlinename'];agents[_0xf8be9['destuniqueid']][_0x46cb('0x2b')]=_0xf8be9['ringtime'];agents[_0xf8be9['destuniqueid']][_0x46cb('0xa')]='connect';_['forIn'](agents,function(_0x67bd14,_0x10017d){if(_0x67bd14[_0x46cb('0x13')]!=_0xf8be9[_0x46cb('0x13')]&&_0x67bd14[_0x46cb('0x6')]==_0xf8be9[_0x46cb('0x6')]){_0x67bd14[_0x46cb('0x25')]=0x0;_0x67bd14['holdtime']=_0xf8be9[_0x46cb('0x24')];_0x67bd14['agentringnoanswer']=!![];_0x67bd14[_0x46cb('0x21')]=utils['now']();_0x67bd14[_0x46cb('0xa')]=_0x46cb('0x30');_0x67bd14[_0x46cb('0x23')]='answered_elsewhere';_0x67bd14[_0x46cb('0x31')]=_0xf8be9[_0x46cb('0x13')];_0x67bd14['answeredelsewheremembername']=_0xf8be9[_0x46cb('0x1b')];writeDB(_0x67bd14);}});}}catch(_0x3d0b83){utils[_0x46cb('0x1c')](util[_0x46cb('0x4')](_0x46cb('0x2d'),_0xf8be9['uniqueid']),_0x3d0b83);}};exports['agentcomplete']=function(_0x10bada){try{if(!_['isNil'](agents[_0x10bada[_0x46cb('0x13')]])){utils[_0x46cb('0x15')](util['format'](_0x46cb('0x32'),_0x10bada[_0x46cb('0x6')]),_0x10bada);utils[_0x46cb('0x3')](util['format']('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x10bada['uniqueid'],agents[_0x10bada['destuniqueid']][_0x46cb('0x1b')],_0x10bada[_0x46cb('0x13')]));agents[_0x10bada[_0x46cb('0x13')]][_0x46cb('0xe')]=!![];agents[_0x10bada[_0x46cb('0x13')]]['agentcompleteAt']=utils['now']();agents[_0x10bada[_0x46cb('0x13')]][_0x46cb('0x25')]=utils['diffTime'](agents[_0x10bada[_0x46cb('0x13')]][_0x46cb('0x33')],agents[_0x10bada[_0x46cb('0x13')]][_0x46cb('0x2f')]);agents[_0x10bada[_0x46cb('0x13')]][_0x46cb('0x23')]=_0x10bada[_0x46cb('0x23')];agents[_0x10bada['destuniqueid']]['lastevent']=_0x46cb('0x34');writeDB(agents[_0x10bada['destuniqueid']]);}}catch(_0x2c4ecb){utils[_0x46cb('0x1c')](util[_0x46cb('0x4')]('[%s][agents][agentcomplete]',_0x10bada[_0x46cb('0x6')]),_0x2c4ecb);}};exports['blindtransfer']=function(_0x5c02c9){try{if(!_[_0x46cb('0x1e')](agents[_0x5c02c9[_0x46cb('0x35')]])){utils[_0x46cb('0x15')](util[_0x46cb('0x4')](_0x46cb('0x36'),_0x5c02c9[_0x46cb('0x6')]),_0x5c02c9);utils[_0x46cb('0x3')](util['format']('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x5c02c9[_0x46cb('0x6')],agents[_0x5c02c9[_0x46cb('0x35')]]['membername'],agents[_0x5c02c9[_0x46cb('0x35')]][_0x46cb('0x6')]));agents[_0x5c02c9[_0x46cb('0x35')]][_0x46cb('0x37')]=!![];agents[_0x5c02c9[_0x46cb('0x35')]]['transfertype']=_0x46cb('0x38');agents[_0x5c02c9[_0x46cb('0x35')]][_0x46cb('0x39')]=_0x5c02c9['extension'];agents[_0x5c02c9[_0x46cb('0x35')]]['transferuniqueid']=agents[_0x5c02c9['transfereruniqueid']][_0x46cb('0x6')];}}catch(_0x2cfe6f){utils[_0x46cb('0x1c')](util[_0x46cb('0x4')](_0x46cb('0x36'),_0x5c02c9['uniqueid']),_0x2cfe6f);}};exports[_0x46cb('0x3a')]=function(_0xd51a75){try{utils['debug'](util['format'](_0x46cb('0x3b'),_0xd51a75[_0x46cb('0x3c')]),_0xd51a75);if(_0xd51a75[_0x46cb('0x3c')]==_0xd51a75['origtransfererlinkedid']){if(!_[_0x46cb('0x1e')](agents[_0xd51a75[_0x46cb('0x3d')]])){utils[_0x46cb('0x3')](util[_0x46cb('0x4')](_0x46cb('0x3e'),_0xd51a75[_0x46cb('0x3c')],agents[_0xd51a75[_0x46cb('0x3d')]][_0x46cb('0x1b')]));agents[_0xd51a75[_0x46cb('0x3d')]]['transfer']=!![];agents[_0xd51a75[_0x46cb('0x3d')]]['transfertype']=_0x46cb('0x3f');agents[_0xd51a75[_0x46cb('0x3d')]][_0x46cb('0x39')]=_0xd51a75[_0x46cb('0x40')];agents[_0xd51a75['secondtransfereruniqueid']][_0x46cb('0x41')]=_0xd51a75[_0x46cb('0x3c')];}if(_0xd51a75[_0x46cb('0x42')]&&agents[_0xd51a75[_0x46cb('0x42')]]){agents[_0xd51a75[_0x46cb('0x42')]][_0x46cb('0x43')]=0x1;transfers[_0xd51a75[_0x46cb('0x42')]]=_[_0x46cb('0x44')](agents[_0xd51a75['transfereeuniqueid']]);transfers[_0xd51a75['transfereeuniqueid']]['calleridnum']=agents[_0xd51a75['secondtransfereruniqueid']][_0x46cb('0x45')];transfers[_0xd51a75[_0x46cb('0x42')]]['calleridname']=agents[_0xd51a75[_0x46cb('0x3d')]][_0x46cb('0x46')];transfers[_0xd51a75[_0x46cb('0x42')]]['agentcalledAt']=utils['now']();transfers[_0xd51a75[_0x46cb('0x42')]]['agentconnectAt']=utils[_0x46cb('0x18')]();transfers[_0xd51a75[_0x46cb('0x42')]][_0x46cb('0x2b')]=0x0;transfers[_0xd51a75[_0x46cb('0x42')]][_0x46cb('0x43')]=0x2;}}else if(_0xd51a75[_0x46cb('0x3d')]==_0xd51a75[_0x46cb('0x47')]){if(!_[_0x46cb('0x1e')](agents[_0xd51a75[_0x46cb('0x3c')]])){utils[_0x46cb('0x3')](util[_0x46cb('0x4')](_0x46cb('0x3e'),_0xd51a75[_0x46cb('0x3c')],agents[_0xd51a75['origtransfereruniqueid']][_0x46cb('0x1b')]));agents[_0xd51a75['origtransfereruniqueid']][_0x46cb('0x37')]=!![];agents[_0xd51a75[_0x46cb('0x3c')]][_0x46cb('0x48')]=_0x46cb('0x3f');agents[_0xd51a75[_0x46cb('0x3c')]][_0x46cb('0x39')]=_0xd51a75[_0x46cb('0x49')];agents[_0xd51a75['origtransfereruniqueid']][_0x46cb('0x41')]=_0xd51a75[_0x46cb('0x3d')];}if(_0xd51a75[_0x46cb('0x4a')]&&agents[_0xd51a75[_0x46cb('0x4a')]]){agents[_0xd51a75['transfertargetuniqueid']][_0x46cb('0x43')]=0x1;transfers[_0xd51a75[_0x46cb('0x4a')]]=_[_0x46cb('0x44')](agents[_0xd51a75[_0x46cb('0x4a')]]);transfers[_0xd51a75[_0x46cb('0x4a')]]['calleridnum']=agents[_0xd51a75[_0x46cb('0x3c')]][_0x46cb('0x45')];transfers[_0xd51a75[_0x46cb('0x4a')]][_0x46cb('0x46')]=agents[_0xd51a75[_0x46cb('0x3c')]][_0x46cb('0x46')];transfers[_0xd51a75[_0x46cb('0x4a')]][_0x46cb('0x17')]=utils['now']();transfers[_0xd51a75['transfertargetuniqueid']]['agentconnectAt']=utils[_0x46cb('0x18')]();transfers[_0xd51a75[_0x46cb('0x4a')]][_0x46cb('0x2b')]=0x0;transfers[_0xd51a75[_0x46cb('0x4a')]][_0x46cb('0x43')]=0x2;}}}catch(_0x1e3dca){utils[_0x46cb('0x1c')](util[_0x46cb('0x4')](_0x46cb('0x3b'),_0xd51a75[_0x46cb('0x3c')]),_0x1e3dca);}};exports[_0x46cb('0x4b')]=function(_0x199dc0){try{utils[_0x46cb('0x15')](util[_0x46cb('0x4')]('[%s][agents][hangup]',_0x199dc0[_0x46cb('0x6')]),_0x199dc0);if(agents[_0x199dc0['uniqueid']]&&agents[_0x199dc0[_0x46cb('0x6')]]['reason']===_0x46cb('0x22')){if(_0x199dc0[_0x46cb('0x4c')]==='21'){agents[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0x23')]='rejected';agents[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0xa')]='rejected';}utils['info'](util[_0x46cb('0x4')](_0x46cb('0x4d'),_0x199dc0[_0x46cb('0x6')],agents[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0x1b')],agents[_0x199dc0['uniqueid']]['reason'],agents[_0x199dc0['uniqueid']][_0x46cb('0xa')]));writeDB(agents[_0x199dc0[_0x46cb('0x6')]]);var _0x30b303=unanswered[_0x46cb('0x4e')](_0x199dc0[_0x46cb('0x6')]);if(_0x30b303>-0x1){unanswered[_0x46cb('0x4f')](_0x30b303,0x1);}}if(transfers[_0x199dc0[_0x46cb('0x6')]]){transfers[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0xe')]=!![];transfers[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0x33')]=utils['now']();transfers[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0x25')]=utils[_0x46cb('0x50')](transfers[_0x199dc0[_0x46cb('0x6')]]['agentcompleteAt'],transfers[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0x2f')]);transfers[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0x23')]='agent';transfers[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0xa')]=_0x46cb('0x34');utils[_0x46cb('0x3')](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x199dc0['uniqueid'],transfers[_0x199dc0[_0x46cb('0x6')]]['membername'],transfers[_0x199dc0[_0x46cb('0x6')]]['reason'],transfers[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0xa')]));writeDB(transfers[_0x199dc0[_0x46cb('0x6')]],!![]);}if(agents[_0x199dc0[_0x46cb('0x6')]]&&agents[_0x199dc0['uniqueid']][_0x46cb('0x2f')]){agents[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0xe')]=!![];agents[_0x199dc0[_0x46cb('0x6')]]['agentcompleteAt']=utils['now']();agents[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0x25')]=utils[_0x46cb('0x50')](agents[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0x33')],agents[_0x199dc0[_0x46cb('0x6')]]['agentconnectAt']);agents[_0x199dc0['uniqueid']][_0x46cb('0x23')]=agents[_0x199dc0[_0x46cb('0x6')]]['transfer']?_0x46cb('0x37'):_0x46cb('0x51');agents[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0xa')]=_0x46cb('0x34');utils[_0x46cb('0x3')](util[_0x46cb('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x199dc0[_0x46cb('0x6')],agents[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0x1b')],agents[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0x23')],agents[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0xa')]));writeDB(agents[_0x199dc0[_0x46cb('0x6')]]);}}catch(_0x5567cc){utils['error'](util[_0x46cb('0x4')](_0x46cb('0x52'),_0x199dc0[_0x46cb('0x6')]),_0x5567cc);}}; \ No newline at end of file +var _0x34b7=['acwtime','agentacw','acwTimeout','request','CreateVoiceAgentReport','uniqueid','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','agentringnoanswerAt','timeout','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','reason','[%s][agents][queuecallerabandon]','agentconnect','agentconnectAt','connect','answered_elsewhere','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime','agentcompleteAt','complete','blindtransfer','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','origtransfererexten','transferuniqueid','transfereeuniqueid','agententerreason','secondtransfererexten','transfertargetuniqueid','clone','calleridname','[%s][agents][hangup]','cause','rejected','indexOf','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','type','agentcomplete','acw'];(function(_0x46204f,_0x471bcc){var _0x2081cd=function(_0x11867d){while(--_0x11867d){_0x46204f['push'](_0x46204f['shift']());}};_0x2081cd(++_0x471bcc);}(_0x34b7,0x196));var _0x734b=function(_0x23bf7f,_0x578f6c){_0x23bf7f=_0x23bf7f-0x0;var _0x64b00e=_0x34b7[_0x23bf7f];return _0x64b00e;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x734b('0x0'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x1aedd0,_0x6e4318){utils[_0x734b('0x1')](util[_0x734b('0x2')](_0x734b('0x3'),_0x1aedd0['uniqueid'],_0x1aedd0['channel'],_0x1aedd0[_0x734b('0x4')],_0x1aedd0[_0x734b('0x5')],_0x1aedd0[_0x734b('0x6')],_0x1aedd0[_0x734b('0x7')],_0x1aedd0[_0x734b('0x8')],_0x1aedd0[_0x734b('0x9')]));if(_0x1aedd0['queue']){utils[_0x734b('0xa')](_0x1aedd0[_0x734b('0x4')])['then'](function(_0x53f163){if(_0x53f163){_0x1aedd0['type']=_0x53f163[_0x734b('0xb')];_0x1aedd0['agentacw']=_0x1aedd0[_0x734b('0xc')]?_0x53f163[_0x734b('0xd')]:![];_0x1aedd0[_0x734b('0xe')]=_0x1aedd0[_0x734b('0xf')]?_0x53f163[_0x734b('0x10')]:0x0;}utils[_0x734b('0x11')](_0x734b('0x12'),_0x1aedd0);});}else{utils[_0x734b('0x11')](_0x734b('0x12'),_0x1aedd0);}if(_0x6e4318){delete transfers[_0x1aedd0[_0x734b('0x13')]];}else{delete agents[_0x1aedd0[_0x734b('0x14')]];}}exports[_0x734b('0x15')]=function(_0x145ec3){try{utils[_0x734b('0x16')](util['format'](_0x734b('0x17'),_0x145ec3[_0x734b('0x13')]),_0x145ec3);agents[_0x145ec3[_0x734b('0x14')]]=_0x145ec3;agents[_0x145ec3[_0x734b('0x14')]][_0x734b('0x18')]=utils[_0x734b('0x19')]();agents[_0x145ec3[_0x734b('0x14')]][_0x734b('0x9')]=_0x734b('0x1a');agents[_0x145ec3[_0x734b('0x14')]][_0x734b('0x8')]=null;agents[_0x145ec3['destuniqueid']][_0x734b('0x1b')]=null;utils[_0x734b('0x1')](util[_0x734b('0x2')](_0x734b('0x1c'),_0x145ec3['uniqueid'],agents[_0x145ec3['destuniqueid']][_0x734b('0x5')],_0x145ec3[_0x734b('0x14')]));}catch(_0x1e6ed9){utils[_0x734b('0x1d')](util[_0x734b('0x2')](_0x734b('0x17'),_0x145ec3[_0x734b('0x13')]),_0x1e6ed9);}};exports[_0x734b('0x1e')]=function(_0x67eed){try{if(!_[_0x734b('0x1f')](agents[_0x67eed[_0x734b('0x14')]])){utils[_0x734b('0x16')](util[_0x734b('0x2')](_0x734b('0x20'),_0x67eed['uniqueid']),_0x67eed);utils[_0x734b('0x1')](util[_0x734b('0x2')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x67eed[_0x734b('0x13')],agents[_0x67eed[_0x734b('0x14')]][_0x734b('0x5')],_0x67eed[_0x734b('0x14')]));agents[_0x67eed[_0x734b('0x14')]][_0x734b('0x1e')]=!![];agents[_0x67eed[_0x734b('0x14')]][_0x734b('0x21')]=utils[_0x734b('0x19')]();agents[_0x67eed[_0x734b('0x14')]][_0x734b('0x9')]=_0x734b('0x22');agents[_0x67eed[_0x734b('0x14')]]['reason']='timeout';agents[_0x67eed[_0x734b('0x14')]][_0x734b('0x23')]=_0x67eed['ringtime']?parseInt(_0x67eed[_0x734b('0x24')])/0x3e8:0x0;agents[_0x67eed[_0x734b('0x14')]][_0x734b('0x25')]=0x0;unanswered[_0x734b('0x26')](_0x67eed[_0x734b('0x14')]);}}catch(_0x1b8295){utils[_0x734b('0x1d')](util['format'](_0x734b('0x20'),_0x67eed[_0x734b('0x13')]),_0x1b8295);}};exports[_0x734b('0x27')]=function(_0x241c89){try{_[_0x734b('0x28')](agents,function(_0x427c36,_0x1fed72){if(_0x427c36[_0x734b('0x13')]==_0x241c89[_0x734b('0x13')]&&!_[_0x734b('0x29')](unanswered,_0x427c36['destuniqueid'])){utils[_0x734b('0x16')](util[_0x734b('0x2')]('[%s][agents][queuecallerabandon]',_0x241c89[_0x734b('0x13')]),_0x241c89);utils[_0x734b('0x1')](util[_0x734b('0x2')](_0x734b('0x2a'),_0x241c89[_0x734b('0x13')],_0x427c36[_0x734b('0x5')],_0x427c36[_0x734b('0x14')]));_0x427c36[_0x734b('0x1e')]=!![];_0x427c36[_0x734b('0x21')]=utils[_0x734b('0x19')]();_0x427c36[_0x734b('0x9')]=_0x734b('0x2b');_0x427c36[_0x734b('0x2c')]=_0x734b('0x2b');_0x427c36[_0x734b('0x23')]=_0x241c89['holdtime'];_0x427c36[_0x734b('0x25')]=0x0;writeDB(_0x427c36);}});}catch(_0x5e2444){utils[_0x734b('0x1d')](util[_0x734b('0x2')](_0x734b('0x2d'),_0x241c89[_0x734b('0x13')]),_0x5e2444);}};exports[_0x734b('0x2e')]=function(_0x16ab66){try{if(agents[_0x16ab66['destuniqueid']]){utils['debug'](util[_0x734b('0x2')]('[%s][agents][agentconnect]',_0x16ab66[_0x734b('0x13')]),_0x16ab66);utils['info'](util[_0x734b('0x2')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x16ab66[_0x734b('0x13')],agents[_0x16ab66['destuniqueid']][_0x734b('0x5')],_0x16ab66[_0x734b('0x14')]));agents[_0x16ab66[_0x734b('0x14')]][_0x734b('0x2f')]=utils[_0x734b('0x19')]();agents[_0x16ab66[_0x734b('0x14')]][_0x734b('0x8')]=_0x16ab66['connectedlinenum'];agents[_0x16ab66[_0x734b('0x14')]][_0x734b('0x1b')]=_0x16ab66['connectedlinename'];agents[_0x16ab66[_0x734b('0x14')]][_0x734b('0x23')]=_0x16ab66[_0x734b('0x24')];agents[_0x16ab66[_0x734b('0x14')]]['lastevent']=_0x734b('0x30');_[_0x734b('0x28')](agents,function(_0x4efb1f,_0x40674c){if(_0x4efb1f[_0x734b('0x14')]!=_0x16ab66['destuniqueid']&&_0x4efb1f[_0x734b('0x13')]==_0x16ab66[_0x734b('0x13')]){_0x4efb1f[_0x734b('0x25')]=0x0;_0x4efb1f[_0x734b('0x23')]=_0x16ab66['ringtime'];_0x4efb1f['agentringnoanswer']=!![];_0x4efb1f[_0x734b('0x21')]=utils['now']();_0x4efb1f['lastevent']=_0x734b('0x31');_0x4efb1f['reason']=_0x734b('0x31');_0x4efb1f['answeredelsewheredestinationuniqueid']=_0x16ab66[_0x734b('0x14')];_0x4efb1f[_0x734b('0x32')]=_0x16ab66[_0x734b('0x5')];writeDB(_0x4efb1f);}});}}catch(_0x4c3fdc){utils['error'](util[_0x734b('0x2')]('[%s][agents][agentconnect]',_0x16ab66['uniqueid']),_0x4c3fdc);}};exports[_0x734b('0xc')]=function(_0x159db9){try{if(!_['isNil'](agents[_0x159db9[_0x734b('0x14')]])){utils['debug'](util[_0x734b('0x2')](_0x734b('0x33'),_0x159db9[_0x734b('0x13')]),_0x159db9);utils['info'](util[_0x734b('0x2')](_0x734b('0x34'),_0x159db9[_0x734b('0x13')],agents[_0x159db9[_0x734b('0x14')]]['membername'],_0x159db9['destuniqueid']));agents[_0x159db9['destuniqueid']][_0x734b('0xc')]=!![];agents[_0x159db9['destuniqueid']]['agentcompleteAt']=utils[_0x734b('0x19')]();agents[_0x159db9['destuniqueid']][_0x734b('0x25')]=utils[_0x734b('0x35')](agents[_0x159db9[_0x734b('0x14')]][_0x734b('0x36')],agents[_0x159db9['destuniqueid']][_0x734b('0x2f')]);agents[_0x159db9['destuniqueid']][_0x734b('0x2c')]=_0x159db9[_0x734b('0x2c')];agents[_0x159db9[_0x734b('0x14')]]['lastevent']=_0x734b('0x37');writeDB(agents[_0x159db9['destuniqueid']]);}}catch(_0x357ae4){utils[_0x734b('0x1d')](util['format'](_0x734b('0x33'),_0x159db9[_0x734b('0x13')]),_0x357ae4);}};exports[_0x734b('0x38')]=function(_0x38125a){try{if(!_[_0x734b('0x1f')](agents[_0x38125a['transfereruniqueid']])){utils[_0x734b('0x16')](util['format'](_0x734b('0x39'),_0x38125a['uniqueid']),_0x38125a);utils[_0x734b('0x1')](util[_0x734b('0x2')](_0x734b('0x3a'),_0x38125a[_0x734b('0x13')],agents[_0x38125a[_0x734b('0x3b')]]['membername'],agents[_0x38125a['transfereruniqueid']]['uniqueid']));agents[_0x38125a[_0x734b('0x3b')]][_0x734b('0x3c')]=!![];agents[_0x38125a['transfereruniqueid']][_0x734b('0x3d')]=_0x734b('0x3e');agents[_0x38125a['transfereruniqueid']][_0x734b('0x3f')]=_0x38125a[_0x734b('0x40')];agents[_0x38125a[_0x734b('0x3b')]]['transferuniqueid']=agents[_0x38125a[_0x734b('0x3b')]][_0x734b('0x13')];}}catch(_0x423b22){utils[_0x734b('0x1d')](util['format'](_0x734b('0x39'),_0x38125a[_0x734b('0x13')]),_0x423b22);}};exports[_0x734b('0x41')]=function(_0x432a96){try{utils['debug'](util[_0x734b('0x2')]('[%s][agents][attendedtransfer]',_0x432a96[_0x734b('0x42')]),_0x432a96);if(_0x432a96[_0x734b('0x42')]==_0x432a96[_0x734b('0x43')]){if(!_[_0x734b('0x1f')](agents[_0x432a96['secondtransfereruniqueid']])){utils[_0x734b('0x1')](util[_0x734b('0x2')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x432a96['origtransfereruniqueid'],agents[_0x432a96[_0x734b('0x44')]]['membername']));agents[_0x432a96[_0x734b('0x44')]][_0x734b('0x3c')]=!![];agents[_0x432a96[_0x734b('0x44')]]['transfertype']=_0x734b('0x45');agents[_0x432a96['secondtransfereruniqueid']][_0x734b('0x3f')]=_0x432a96[_0x734b('0x46')];agents[_0x432a96[_0x734b('0x44')]][_0x734b('0x47')]=_0x432a96['origtransfereruniqueid'];}if(_0x432a96[_0x734b('0x48')]&&agents[_0x432a96['transfereeuniqueid']]){agents[_0x432a96[_0x734b('0x48')]][_0x734b('0x49')]=0x1;transfers[_0x432a96[_0x734b('0x48')]]=_['clone'](agents[_0x432a96[_0x734b('0x48')]]);transfers[_0x432a96['transfereeuniqueid']][_0x734b('0x7')]=agents[_0x432a96[_0x734b('0x44')]][_0x734b('0x7')];transfers[_0x432a96[_0x734b('0x48')]]['calleridname']=agents[_0x432a96[_0x734b('0x44')]]['calleridname'];transfers[_0x432a96[_0x734b('0x48')]][_0x734b('0x18')]=utils[_0x734b('0x19')]();transfers[_0x432a96['transfereeuniqueid']][_0x734b('0x2f')]=utils[_0x734b('0x19')]();transfers[_0x432a96[_0x734b('0x48')]][_0x734b('0x23')]=0x0;transfers[_0x432a96[_0x734b('0x48')]][_0x734b('0x49')]=0x2;}}else if(_0x432a96[_0x734b('0x44')]==_0x432a96['secondtransfererlinkedid']){if(!_[_0x734b('0x1f')](agents[_0x432a96[_0x734b('0x42')]])){utils[_0x734b('0x1')](util['format']('[%s][agents][attendedtransfer]\x20agent:%s',_0x432a96[_0x734b('0x42')],agents[_0x432a96[_0x734b('0x42')]][_0x734b('0x5')]));agents[_0x432a96[_0x734b('0x42')]]['transfer']=!![];agents[_0x432a96['origtransfereruniqueid']]['transfertype']=_0x734b('0x45');agents[_0x432a96[_0x734b('0x42')]][_0x734b('0x3f')]=_0x432a96[_0x734b('0x4a')];agents[_0x432a96[_0x734b('0x42')]][_0x734b('0x47')]=_0x432a96[_0x734b('0x44')];}if(_0x432a96[_0x734b('0x4b')]&&agents[_0x432a96[_0x734b('0x4b')]]){agents[_0x432a96[_0x734b('0x4b')]][_0x734b('0x49')]=0x1;transfers[_0x432a96[_0x734b('0x4b')]]=_[_0x734b('0x4c')](agents[_0x432a96[_0x734b('0x4b')]]);transfers[_0x432a96[_0x734b('0x4b')]][_0x734b('0x7')]=agents[_0x432a96[_0x734b('0x42')]][_0x734b('0x7')];transfers[_0x432a96[_0x734b('0x4b')]][_0x734b('0x4d')]=agents[_0x432a96[_0x734b('0x42')]]['calleridname'];transfers[_0x432a96[_0x734b('0x4b')]][_0x734b('0x18')]=utils[_0x734b('0x19')]();transfers[_0x432a96[_0x734b('0x4b')]][_0x734b('0x2f')]=utils['now']();transfers[_0x432a96[_0x734b('0x4b')]][_0x734b('0x23')]=0x0;transfers[_0x432a96[_0x734b('0x4b')]][_0x734b('0x49')]=0x2;}}}catch(_0x3c7d93){utils[_0x734b('0x1d')](util['format']('[%s][agents][attendedtransfer]',_0x432a96['origtransfereruniqueid']),_0x3c7d93);}};exports['hangup']=function(_0x4d95c7){try{utils[_0x734b('0x16')](util[_0x734b('0x2')](_0x734b('0x4e'),_0x4d95c7[_0x734b('0x13')]),_0x4d95c7);if(agents[_0x4d95c7['uniqueid']]&&agents[_0x4d95c7['uniqueid']][_0x734b('0x2c')]===_0x734b('0x22')){if(_0x4d95c7[_0x734b('0x4f')]==='21'){agents[_0x4d95c7[_0x734b('0x13')]]['reason']=_0x734b('0x50');agents[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x9')]=_0x734b('0x50');}utils['info'](util[_0x734b('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x4d95c7[_0x734b('0x13')],agents[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x5')],agents[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x2c')],agents[_0x4d95c7['uniqueid']][_0x734b('0x9')]));writeDB(agents[_0x4d95c7[_0x734b('0x13')]]);var _0x3c40b5=unanswered[_0x734b('0x51')](_0x4d95c7[_0x734b('0x13')]);if(_0x3c40b5>-0x1){unanswered['splice'](_0x3c40b5,0x1);}}if(transfers[_0x4d95c7[_0x734b('0x13')]]){transfers[_0x4d95c7[_0x734b('0x13')]][_0x734b('0xc')]=!![];transfers[_0x4d95c7[_0x734b('0x13')]]['agentcompleteAt']=utils[_0x734b('0x19')]();transfers[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x25')]=utils[_0x734b('0x35')](transfers[_0x4d95c7[_0x734b('0x13')]]['agentcompleteAt'],transfers[_0x4d95c7[_0x734b('0x13')]]['agentconnectAt']);transfers[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x2c')]=_0x734b('0x52');transfers[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x9')]=_0x734b('0x37');utils['info'](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x4d95c7[_0x734b('0x13')],transfers[_0x4d95c7['uniqueid']][_0x734b('0x5')],transfers[_0x4d95c7[_0x734b('0x13')]]['reason'],transfers[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x9')]));writeDB(transfers[_0x4d95c7[_0x734b('0x13')]],!![]);}if(agents[_0x4d95c7[_0x734b('0x13')]]&&agents[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x2f')]){agents[_0x4d95c7[_0x734b('0x13')]][_0x734b('0xc')]=!![];agents[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x36')]=utils['now']();agents[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x25')]=utils[_0x734b('0x35')](agents[_0x4d95c7['uniqueid']][_0x734b('0x36')],agents[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x2f')]);agents[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x2c')]=agents[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x3c')]?_0x734b('0x3c'):'agent';agents[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x9')]=_0x734b('0x37');utils[_0x734b('0x1')](util[_0x734b('0x2')](_0x734b('0x53'),_0x4d95c7[_0x734b('0x13')],agents[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x5')],agents[_0x4d95c7['uniqueid']][_0x734b('0x2c')],agents[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x9')]));writeDB(agents[_0x4d95c7['uniqueid']]);}}catch(_0x31e1ec){utils[_0x734b('0x1d')](util[_0x734b('0x2')](_0x734b('0x4e'),_0x4d95c7[_0x734b('0x13')]),_0x31e1ec);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index cb8fe24..d9f6c4f 100644 --- a/server/services/xdr/calls.controller.js +++ b/server/services/xdr/calls.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x51e5=['[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','now','transfer','destinationchannel','answertime','disposition','toNumber','hangup','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','duration','diffTime','endtime','starttime','billableseconds','[%s][calls][hangup]','localtwolinkedid','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','transfertargetchannel','origtransfererchannel','[%s][calls][attendedtransfer]','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','variable','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','routeid','sipcallid','[%s][calls][varset]','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','appdata','cdr','split','substring','lastIndexOf','includes','noop','execif','gotoif','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','info','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','queue','membername','interface','calleridnum','connectedlinenum','accountcode','request','CreateVoiceCallReport','newchannel','debug','format','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','[%s][calls][newstate]','isNil','channelstate'];(function(_0x56aba2,_0x4d4a5f){var _0x39176b=function(_0x5ec995){while(--_0x5ec995){_0x56aba2['push'](_0x56aba2['shift']());}};_0x39176b(++_0x4d4a5f);}(_0x51e5,0x124));var _0x551e=function(_0x2e598b,_0x29442d){_0x2e598b=_0x2e598b-0x0;var _0x5c52c2=_0x51e5[_0x2e598b];return _0x5c52c2;};'use strict';var _=require('lodash');var util=require(_0x551e('0x0'));var utils=require(_0x551e('0x1'));var dispositions=[_0x551e('0x2'),_0x551e('0x3'),_0x551e('0x3'),_0x551e('0x2'),_0x551e('0x2'),_0x551e('0x2'),_0x551e('0x4'),_0x551e('0x5'),_0x551e('0x3'),_0x551e('0x3'),'FAILED'];var channels={};function writeDB(_0x51339a){utils[_0x551e('0x6')](util['format'](_0x551e('0x7'),_0x51339a[_0x551e('0x8')],_0x51339a['channel'],_0x51339a[_0x551e('0x9')],_0x51339a[_0x551e('0xa')],_0x51339a[_0x551e('0xb')],_0x51339a[_0x551e('0xc')],_0x51339a[_0x551e('0xd')],_0x51339a['lastevent']));if(_0x51339a[_0x551e('0xe')]){utils['getUserByInternal'](_0x51339a[_0x551e('0xe')])['then'](function(_0x1dc5d2){if(_0x1dc5d2){_0x51339a['UserId']=_0x1dc5d2['id'];}utils[_0x551e('0xf')]('CreateVoiceCallReport',_0x51339a);});}else{utils['request'](_0x551e('0x10'),_0x51339a);}if(channels[_0x51339a[_0x551e('0x8')]]){delete channels[_0x51339a[_0x551e('0x8')]];}}exports[_0x551e('0x11')]=function(_0x1d1bc7){try{utils[_0x551e('0x12')](util[_0x551e('0x13')](_0x551e('0x14'),_0x1d1bc7[_0x551e('0x8')]),_0x1d1bc7);if(_0x1d1bc7['uniqueid']==_0x1d1bc7[_0x551e('0x15')]&&_0x1d1bc7['channel']!=_0x551e('0x16')){utils[_0x551e('0x6')](util[_0x551e('0x13')](_0x551e('0x17'),_0x1d1bc7[_0x551e('0x8')],_0x1d1bc7[_0x551e('0x18')],_0x1d1bc7['exten']));channels[_0x1d1bc7[_0x551e('0x8')]]={'uniqueid':_0x1d1bc7[_0x551e('0x8')],'accountcode':_0x1d1bc7['accountcode'],'source':_0x1d1bc7[_0x551e('0xc')],'destination':_0x1d1bc7[_0x551e('0x19')],'destinationcontext':_0x1d1bc7[_0x551e('0x18')],'channel':_0x1d1bc7[_0x551e('0x1a')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x551e('0x2'),'amaflags':'DOCUMENTATION'};}}catch(_0x578513){utils[_0x551e('0x1b')](util[_0x551e('0x13')](_0x551e('0x14'),_0x1d1bc7[_0x551e('0x8')]),_0x578513);}};exports[_0x551e('0x1c')]=function(_0x2760ac){try{utils['debug'](util[_0x551e('0x13')](_0x551e('0x1d'),_0x2760ac[_0x551e('0x8')]),_0x2760ac);if(!_[_0x551e('0x1e')](channels[_0x2760ac[_0x551e('0x8')]])&&_0x2760ac[_0x551e('0x1f')]==0x6){utils['info'](util[_0x551e('0x13')](_0x551e('0x20'),_0x2760ac[_0x551e('0x8')],_0x2760ac[_0x551e('0x18')],_0x2760ac['channel']));if(_[_0x551e('0x1e')](channels[_0x2760ac['uniqueid']][_0x551e('0x21')])){channels[_0x2760ac[_0x551e('0x8')]][_0x551e('0x21')]=utils[_0x551e('0x22')]();}}else if(!_['isNil'](channels[_0x2760ac[_0x551e('0x15')]])&&_0x2760ac[_0x551e('0x1f')]==0x6&&_0x2760ac[_0x551e('0x18')]!=_0x551e('0x23')){utils['info'](util[_0x551e('0x13')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x2760ac[_0x551e('0x8')],_0x2760ac[_0x551e('0x15')],_0x2760ac[_0x551e('0x18')],_0x2760ac['channel']));channels[_0x2760ac[_0x551e('0x15')]]['accountcode']=_0x2760ac['accountcode'];channels[_0x2760ac[_0x551e('0x15')]][_0x551e('0x24')]=_0x2760ac[_0x551e('0x1a')];if(_[_0x551e('0x1e')](channels[_0x2760ac[_0x551e('0x15')]]['answertime'])){channels[_0x2760ac[_0x551e('0x15')]][_0x551e('0x25')]=utils[_0x551e('0x22')]();}channels[_0x2760ac['linkedid']][_0x551e('0x26')]=dispositions[_[_0x551e('0x27')](_0x2760ac[_0x551e('0x1f')])]||_0x551e('0x4');}}catch(_0x15d8f8){utils[_0x551e('0x1b')](util['format'](_0x551e('0x1d'),_0x2760ac[_0x551e('0x8')]),_0x15d8f8);}};exports[_0x551e('0x28')]=function(_0x12d430){try{if(!_[_0x551e('0x1e')](channels[_0x12d430[_0x551e('0x8')]])){utils[_0x551e('0x12')](util[_0x551e('0x13')]('[%s][calls][hangup]',_0x12d430[_0x551e('0x8')]),_0x12d430);if(_[_0x551e('0x1e')](channels[_0x12d430[_0x551e('0x8')]][_0x551e('0x29')])){channels[_0x12d430[_0x551e('0x8')]]['callerid']=_0x12d430[_0x551e('0x2a')]+'\x20<'+_0x12d430['calleridnum']+'>';}utils['info'](util[_0x551e('0x13')](_0x551e('0x2b'),_0x12d430[_0x551e('0x8')],channels[_0x12d430[_0x551e('0x8')]][_0x551e('0x29')],_0x12d430[_0x551e('0x2c')]));channels[_0x12d430[_0x551e('0x8')]]['endtime']=utils[_0x551e('0x22')]();channels[_0x12d430['uniqueid']][_0x551e('0x2d')]=utils[_0x551e('0x2e')](channels[_0x12d430[_0x551e('0x8')]][_0x551e('0x2f')],channels[_0x12d430[_0x551e('0x8')]][_0x551e('0x30')]);channels[_0x12d430[_0x551e('0x8')]][_0x551e('0x31')]=channels[_0x12d430[_0x551e('0x8')]][_0x551e('0x25')]?utils[_0x551e('0x2e')](channels[_0x12d430[_0x551e('0x8')]][_0x551e('0x2f')],channels[_0x12d430[_0x551e('0x8')]][_0x551e('0x25')]):0x0;writeDB(channels[_0x12d430['uniqueid']]);}}catch(_0x291804){utils['error'](util[_0x551e('0x13')](_0x551e('0x32'),_0x12d430[_0x551e('0x8')]),_0x291804);}};exports['attendedtransfer']=function(_0x559bdd){try{if(!_[_0x551e('0x1e')](channels[_0x559bdd[_0x551e('0x33')]])){utils['debug'](util[_0x551e('0x13')]('[%s][calls][attendedtransfer]',_0x559bdd[_0x551e('0x34')]),_0x559bdd);if(channels[_0x559bdd[_0x551e('0x33')]][_0x551e('0x1a')]==_0x559bdd[_0x551e('0x35')]){utils[_0x551e('0x6')](util['format'](_0x551e('0x36'),_0x559bdd['origtransfereruniqueid'],_0x559bdd[_0x551e('0x33')],_0x559bdd[_0x551e('0x37')]));channels[_0x559bdd[_0x551e('0x33')]][_0x551e('0x24')]=_0x559bdd[_0x551e('0x37')];channels[_0x559bdd[_0x551e('0x33')]][_0x551e('0x38')]='_attended';}else if(channels[_0x559bdd[_0x551e('0x33')]]['channel']=_0x559bdd[_0x551e('0x39')]){utils[_0x551e('0x6')](util[_0x551e('0x13')](_0x551e('0x36'),_0x559bdd[_0x551e('0x34')],_0x559bdd[_0x551e('0x33')],_0x559bdd[_0x551e('0x3a')]));channels[_0x559bdd[_0x551e('0x33')]][_0x551e('0x24')]=_0x559bdd['origtransfererchannel'];channels[_0x559bdd[_0x551e('0x33')]][_0x551e('0x38')]='_attended';}}}catch(_0x1a2e70){utils[_0x551e('0x1b')](util[_0x551e('0x13')](_0x551e('0x3b'),_0x559bdd[_0x551e('0x34')]),_0x1a2e70);}};exports[_0x551e('0x3c')]=function(_0x56a257){try{if(!_[_0x551e('0x1e')](channels[_0x56a257[_0x551e('0x8')]])){utils[_0x551e('0x12')](util[_0x551e('0x13')](_0x551e('0x3d'),_0x56a257[_0x551e('0x8')]),_0x56a257);channels[_0x56a257[_0x551e('0x8')]][_0x551e('0x3e')]=utils['now']();utils[_0x551e('0x6')](util[_0x551e('0x13')](_0x551e('0x3f'),_0x56a257[_0x551e('0x8')],channels[_0x56a257[_0x551e('0x8')]][_0x551e('0x3e')]));}}catch(_0x35c2fd){utils[_0x551e('0x1b')](util['format'](_0x551e('0x3d'),_0x56a257['uniqueid']),_0x35c2fd);}};exports[_0x551e('0x40')]=function(_0x24373c){try{if(!_['isNil'](channels[_0x24373c[_0x551e('0x8')]])){utils['debug'](util[_0x551e('0x13')](_0x551e('0x41'),_0x24373c['uniqueid']),_0x24373c);if(!_[_0x551e('0x1e')](channels[_0x24373c[_0x551e('0x8')]][_0x551e('0x3e')])){channels[_0x24373c[_0x551e('0x8')]][_0x551e('0x42')]+=utils[_0x551e('0x2e')](utils[_0x551e('0x22')](),channels[_0x24373c[_0x551e('0x8')]]['musiconholdstartAt']);utils['info'](util[_0x551e('0x13')](_0x551e('0x43'),_0x24373c[_0x551e('0x8')],channels[_0x24373c['uniqueid']][_0x551e('0x42')]));delete channels[_0x24373c[_0x551e('0x8')]][_0x551e('0x3e')];}}}catch(_0x4d2351){utils['error'](util['format'](_0x551e('0x41'),_0x24373c[_0x551e('0x8')]),_0x4d2351);}};exports[_0x551e('0x44')]=function(_0x18abee){try{if(!_[_0x551e('0x1e')](channels[_0x18abee[_0x551e('0x8')]])){utils[_0x551e('0x12')](util[_0x551e('0x13')]('[%s][calls][varset]',_0x18abee[_0x551e('0x8')]),_0x18abee);if(!_[_0x551e('0x1e')](_0x18abee['variable']['xmd-originatecalleridnum'])){utils[_0x551e('0x6')](util[_0x551e('0x13')](_0x551e('0x45'),_0x18abee[_0x551e('0x8')],_0x18abee[_0x551e('0x46')]));channels[_0x18abee['uniqueid']][_0x551e('0x47')]=_0x18abee[_0x551e('0x46')];}if(!_[_0x551e('0x1e')](_0x18abee[_0x551e('0x48')][_0x551e('0x49')])){utils['info'](util[_0x551e('0x13')](_0x551e('0x4a'),_0x18abee['uniqueid'],_0x18abee[_0x551e('0x46')]));channels[_0x18abee[_0x551e('0x8')]][_0x551e('0x4b')]=_0x18abee[_0x551e('0x46')];channels[_0x18abee[_0x551e('0x8')]][_0x551e('0x29')]='\x22'+_0x18abee[_0x551e('0x46')]+_0x551e('0x4c')+_0x18abee[_0x551e('0x46')]+'>';}if(!_['isNil'](_0x18abee[_0x551e('0x48')][_0x551e('0x4d')])||!_[_0x551e('0x1e')](_0x18abee[_0x551e('0x48')][_0x551e('0x4e')])){utils[_0x551e('0x6')](util[_0x551e('0x13')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x18abee[_0x551e('0x8')],!_[_0x551e('0x1e')](_0x18abee['variable']['xmd-callerid-preview'])?_0x551e('0x4d'):_0x551e('0x4e'),_0x18abee[_0x551e('0x46')]));channels[_0x18abee[_0x551e('0x8')]][_0x551e('0x29')]=_0x18abee[_0x551e('0x46')];}if(!_[_0x551e('0x1e')](_0x18abee[_0x551e('0x48')][_0x551e('0x4f')])||!_[_0x551e('0x1e')](_0x18abee['variable'][_0x551e('0x50')])){utils[_0x551e('0x6')](util[_0x551e('0x13')](_0x551e('0x51'),_0x18abee[_0x551e('0x8')],!_[_0x551e('0x1e')](_0x18abee[_0x551e('0x48')][_0x551e('0x4f')])?_0x551e('0x4f'):'xmcs-queue',_0x18abee[_0x551e('0x46')]));channels[_0x18abee[_0x551e('0x8')]][_0x551e('0x52')]=_0x551e('0x53');channels[_0x18abee[_0x551e('0x8')]][_0x551e('0x54')]=_0x18abee[_0x551e('0x46')];channels[_0x18abee[_0x551e('0x8')]][_0x551e('0x9')]=!![];}if(!_['isNil'](_0x18abee['variable'][_0x551e('0x55')])){utils[_0x551e('0x6')](util['format'](_0x551e('0x56'),_0x18abee[_0x551e('0x8')],_0x18abee['value']));channels[_0x18abee[_0x551e('0x8')]][_0x551e('0x57')]=_0x18abee[_0x551e('0x46')];}if(!_[_0x551e('0x1e')](_0x18abee[_0x551e('0x48')]['xmd-cdrtype'])){utils[_0x551e('0x6')](util[_0x551e('0x13')](_0x551e('0x58'),_0x18abee[_0x551e('0x8')],_0x18abee[_0x551e('0x46')]));channels[_0x18abee[_0x551e('0x8')]][_0x551e('0x59')]=_0x18abee[_0x551e('0x46')];}if(!_[_0x551e('0x1e')](_0x18abee[_0x551e('0x48')]['outboundrouteid'])){utils[_0x551e('0x6')](util[_0x551e('0x13')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x18abee[_0x551e('0x8')],_0x18abee[_0x551e('0x46')]));channels[_0x18abee['uniqueid']][_0x551e('0x5a')]=_0x18abee[_0x551e('0x46')];}if(!_[_0x551e('0x1e')](_0x18abee[_0x551e('0x48')][_0x551e('0x5b')])){utils[_0x551e('0x6')](util[_0x551e('0x13')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x18abee['uniqueid'],_0x18abee['value']));channels[_0x18abee[_0x551e('0x8')]][_0x551e('0x5b')]=_0x18abee[_0x551e('0x46')];}}}catch(_0x3344fe){utils['error'](util[_0x551e('0x13')](_0x551e('0x5c'),_0x18abee[_0x551e('0x8')]),_0x3344fe);}};exports['newexten']=function(_0x532ed3){try{if(!_[_0x551e('0x1e')](channels[_0x532ed3['uniqueid']])){utils['debug'](util[_0x551e('0x13')](_0x551e('0x5d'),_0x532ed3['uniqueid']),_0x532ed3);utils[_0x551e('0x6')](util[_0x551e('0x13')](_0x551e('0x5e'),_0x532ed3[_0x551e('0x8')],_0x532ed3[_0x551e('0x5f')],_0x532ed3['appdata']));if(_0x532ed3[_0x551e('0x5f')][_0x551e('0x60')]()==_0x551e('0x61')&&_[_0x551e('0x62')](_0x532ed3[_0x551e('0x63')][_0x551e('0x60')](),_0x551e('0x64'))){var _0x3bc169=_0x532ed3[_0x551e('0x63')][_0x551e('0x65')]('=');var _0x3dc908=_0x3bc169[0x0][_0x551e('0x66')](_0x3bc169[0x0][_0x551e('0x67')]('(')+0x1,_0x3bc169[0x0][_0x551e('0x67')](')'));var _0x13758=_0x3bc169[0x1];channels[_0x532ed3[_0x551e('0x8')]][_0x3dc908]=_0x13758;}if(!_[_0x551e('0x68')](['hangup',_0x551e('0x69'),_0x551e('0x6a'),_0x551e('0x61'),_0x551e('0x6b')],_0x532ed3[_0x551e('0x5f')][_0x551e('0x60')]())){channels[_0x532ed3['uniqueid']]['lastapplication']=_0x532ed3['application'];channels[_0x532ed3['uniqueid']][_0x551e('0x54')]=_0x532ed3['appdata'];}}}catch(_0x28182b){utils[_0x551e('0x1b')](util[_0x551e('0x13')](_0x551e('0x5d'),_0x532ed3[_0x551e('0x8')]),_0x28182b);}}; \ No newline at end of file +var _0x692d=['disposition','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','starttime','billableseconds','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','secondtransfererchannel','userfield','transfertargetchannel','origtransfererchannel','_attended','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','variable','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','outboundrouteid','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][varset]','newexten','application','startsWith','appdata','toLowerCase','split','substring','lastIndexOf','includes','noop','execif','[%s][calls][newexten]','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','connectedlinenum','lastevent','accountcode','getUserByInternal','UserId','request','CreateVoiceCallReport','newchannel','[%s][calls][newchannel]','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','calleridnum','now','error','debug','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','linkedid','destinationchannel','answertime'];(function(_0x228ac9,_0x42f065){var _0x69fe02=function(_0x210551){while(--_0x210551){_0x228ac9['push'](_0x228ac9['shift']());}};_0x69fe02(++_0x42f065);}(_0x692d,0x17e));var _0xd692=function(_0x5568b6,_0x39a520){_0x5568b6=_0x5568b6-0x0;var _0x42e676=_0x692d[_0x5568b6];return _0x42e676;};'use strict';var _=require(_0xd692('0x0'));var util=require(_0xd692('0x1'));var utils=require(_0xd692('0x2'));var dispositions=[_0xd692('0x3'),_0xd692('0x4'),_0xd692('0x4'),_0xd692('0x3'),_0xd692('0x3'),_0xd692('0x3'),_0xd692('0x5'),_0xd692('0x6'),'FAILED',_0xd692('0x4'),_0xd692('0x4')];var channels={};function writeDB(_0x4460a1){utils[_0xd692('0x7')](util[_0xd692('0x8')](_0xd692('0x9'),_0x4460a1[_0xd692('0xa')],_0x4460a1[_0xd692('0xb')],_0x4460a1[_0xd692('0xc')],_0x4460a1[_0xd692('0xd')],_0x4460a1[_0xd692('0xe')],_0x4460a1['calleridnum'],_0x4460a1[_0xd692('0xf')],_0x4460a1[_0xd692('0x10')]));if(_0x4460a1[_0xd692('0x11')]){utils[_0xd692('0x12')](_0x4460a1[_0xd692('0x11')])['then'](function(_0x2e8d2d){if(_0x2e8d2d){_0x4460a1[_0xd692('0x13')]=_0x2e8d2d['id'];}utils[_0xd692('0x14')](_0xd692('0x15'),_0x4460a1);});}else{utils['request'](_0xd692('0x15'),_0x4460a1);}if(channels[_0x4460a1[_0xd692('0xa')]]){delete channels[_0x4460a1[_0xd692('0xa')]];}}exports[_0xd692('0x16')]=function(_0xaa455c){try{utils['debug'](util['format'](_0xd692('0x17'),_0xaa455c['uniqueid']),_0xaa455c);if(_0xaa455c['uniqueid']==_0xaa455c['linkedid']&&_0xaa455c['channel']!=_0xd692('0x18')){utils[_0xd692('0x7')](util[_0xd692('0x8')](_0xd692('0x19'),_0xaa455c[_0xd692('0xa')],_0xaa455c[_0xd692('0x1a')],_0xaa455c[_0xd692('0x1b')]));channels[_0xaa455c['uniqueid']]={'uniqueid':_0xaa455c[_0xd692('0xa')],'accountcode':_0xaa455c['accountcode'],'source':_0xaa455c[_0xd692('0x1c')],'destination':_0xaa455c['exten'],'destinationcontext':_0xaa455c['context'],'channel':_0xaa455c[_0xd692('0xb')],'starttime':utils[_0xd692('0x1d')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xd692('0x3'),'amaflags':'DOCUMENTATION'};}}catch(_0x994bc1){utils[_0xd692('0x1e')](util[_0xd692('0x8')](_0xd692('0x17'),_0xaa455c[_0xd692('0xa')]),_0x994bc1);}};exports['newstate']=function(_0x401302){try{utils[_0xd692('0x1f')](util[_0xd692('0x8')](_0xd692('0x20'),_0x401302[_0xd692('0xa')]),_0x401302);if(!_[_0xd692('0x21')](channels[_0x401302[_0xd692('0xa')]])&&_0x401302[_0xd692('0x22')]==0x6){utils[_0xd692('0x7')](util[_0xd692('0x8')](_0xd692('0x23'),_0x401302[_0xd692('0xa')],_0x401302[_0xd692('0x1a')],_0x401302[_0xd692('0xb')]));if(_[_0xd692('0x21')](channels[_0x401302[_0xd692('0xa')]][_0xd692('0x24')])){channels[_0x401302[_0xd692('0xa')]]['systemanswertime']=utils[_0xd692('0x1d')]();}}else if(!_['isNil'](channels[_0x401302['linkedid']])&&_0x401302[_0xd692('0x22')]==0x6&&_0x401302[_0xd692('0x1a')]!=_0xd692('0x25')){utils[_0xd692('0x7')](util[_0xd692('0x8')](_0xd692('0x26'),_0x401302['uniqueid'],_0x401302[_0xd692('0x27')],_0x401302['context'],_0x401302[_0xd692('0xb')]));channels[_0x401302[_0xd692('0x27')]]['accountcode']=_0x401302[_0xd692('0x11')];channels[_0x401302[_0xd692('0x27')]][_0xd692('0x28')]=_0x401302[_0xd692('0xb')];if(_[_0xd692('0x21')](channels[_0x401302[_0xd692('0x27')]][_0xd692('0x29')])){channels[_0x401302['linkedid']][_0xd692('0x29')]=utils['now']();}channels[_0x401302['linkedid']][_0xd692('0x2a')]=dispositions[_['toNumber'](_0x401302[_0xd692('0x22')])]||'ANSWERED';}}catch(_0x11418e){utils[_0xd692('0x1e')](util[_0xd692('0x8')]('[%s][calls][newstate]',_0x401302['uniqueid']),_0x11418e);}};exports[_0xd692('0x2b')]=function(_0x14543d){try{if(!_['isNil'](channels[_0x14543d[_0xd692('0xa')]])){utils[_0xd692('0x1f')](util['format'](_0xd692('0x2c'),_0x14543d[_0xd692('0xa')]),_0x14543d);if(_[_0xd692('0x21')](channels[_0x14543d[_0xd692('0xa')]][_0xd692('0x2d')])){channels[_0x14543d['uniqueid']][_0xd692('0x2d')]=_0x14543d[_0xd692('0x2e')]+'\x20<'+_0x14543d['calleridnum']+'>';}utils[_0xd692('0x7')](util[_0xd692('0x8')](_0xd692('0x2f'),_0x14543d[_0xd692('0xa')],channels[_0x14543d[_0xd692('0xa')]][_0xd692('0x2d')],_0x14543d[_0xd692('0x30')]));channels[_0x14543d[_0xd692('0xa')]][_0xd692('0x31')]=utils['now']();channels[_0x14543d[_0xd692('0xa')]][_0xd692('0x32')]=utils[_0xd692('0x33')](channels[_0x14543d[_0xd692('0xa')]][_0xd692('0x31')],channels[_0x14543d[_0xd692('0xa')]][_0xd692('0x34')]);channels[_0x14543d[_0xd692('0xa')]][_0xd692('0x35')]=channels[_0x14543d[_0xd692('0xa')]][_0xd692('0x29')]?utils[_0xd692('0x33')](channels[_0x14543d[_0xd692('0xa')]][_0xd692('0x31')],channels[_0x14543d[_0xd692('0xa')]]['answertime']):0x0;writeDB(channels[_0x14543d[_0xd692('0xa')]]);}}catch(_0x18d770){utils[_0xd692('0x1e')](util['format'](_0xd692('0x2c'),_0x14543d[_0xd692('0xa')]),_0x18d770);}};exports[_0xd692('0x36')]=function(_0x117d7){try{if(!_[_0xd692('0x21')](channels[_0x117d7[_0xd692('0x37')]])){utils['debug'](util[_0xd692('0x8')](_0xd692('0x38'),_0x117d7['origtransfereruniqueid']),_0x117d7);if(channels[_0x117d7['localtwolinkedid']][_0xd692('0xb')]==_0x117d7[_0xd692('0x39')]){utils[_0xd692('0x7')](util[_0xd692('0x8')](_0xd692('0x3a'),_0x117d7[_0xd692('0x3b')],_0x117d7[_0xd692('0x37')],_0x117d7[_0xd692('0x3c')]));channels[_0x117d7[_0xd692('0x37')]][_0xd692('0x28')]=_0x117d7['secondtransfererchannel'];channels[_0x117d7[_0xd692('0x37')]][_0xd692('0x3d')]='_attended';}else if(channels[_0x117d7[_0xd692('0x37')]][_0xd692('0xb')]=_0x117d7[_0xd692('0x3e')]){utils['info'](util['format'](_0xd692('0x3a'),_0x117d7[_0xd692('0x3b')],_0x117d7['localtwolinkedid'],_0x117d7[_0xd692('0x3f')]));channels[_0x117d7[_0xd692('0x37')]][_0xd692('0x28')]=_0x117d7[_0xd692('0x3f')];channels[_0x117d7['localtwolinkedid']][_0xd692('0x3d')]=_0xd692('0x40');}}}catch(_0x1b1d04){utils[_0xd692('0x1e')](util[_0xd692('0x8')](_0xd692('0x38'),_0x117d7['origtransfereruniqueid']),_0x1b1d04);}};exports['musiconholdstart']=function(_0x5b8532){try{if(!_[_0xd692('0x21')](channels[_0x5b8532[_0xd692('0xa')]])){utils['debug'](util[_0xd692('0x8')](_0xd692('0x41'),_0x5b8532[_0xd692('0xa')]),_0x5b8532);channels[_0x5b8532[_0xd692('0xa')]][_0xd692('0x42')]=utils[_0xd692('0x1d')]();utils[_0xd692('0x7')](util[_0xd692('0x8')](_0xd692('0x43'),_0x5b8532[_0xd692('0xa')],channels[_0x5b8532[_0xd692('0xa')]][_0xd692('0x42')]));}}catch(_0x527e07){utils['error'](util[_0xd692('0x8')](_0xd692('0x41'),_0x5b8532[_0xd692('0xa')]),_0x527e07);}};exports[_0xd692('0x44')]=function(_0x291b14){try{if(!_[_0xd692('0x21')](channels[_0x291b14[_0xd692('0xa')]])){utils['debug'](util[_0xd692('0x8')](_0xd692('0x45'),_0x291b14['uniqueid']),_0x291b14);if(!_[_0xd692('0x21')](channels[_0x291b14[_0xd692('0xa')]][_0xd692('0x42')])){channels[_0x291b14[_0xd692('0xa')]][_0xd692('0x46')]+=utils[_0xd692('0x33')](utils[_0xd692('0x1d')](),channels[_0x291b14[_0xd692('0xa')]][_0xd692('0x42')]);utils[_0xd692('0x7')](util[_0xd692('0x8')](_0xd692('0x47'),_0x291b14[_0xd692('0xa')],channels[_0x291b14[_0xd692('0xa')]][_0xd692('0x46')]));delete channels[_0x291b14[_0xd692('0xa')]][_0xd692('0x42')];}}}catch(_0x3ec7bd){utils[_0xd692('0x1e')](util[_0xd692('0x8')](_0xd692('0x45'),_0x291b14[_0xd692('0xa')]),_0x3ec7bd);}};exports[_0xd692('0x48')]=function(_0x524f7b){try{if(!_[_0xd692('0x21')](channels[_0x524f7b[_0xd692('0xa')]])){utils['debug'](util[_0xd692('0x8')]('[%s][calls][varset]',_0x524f7b['uniqueid']),_0x524f7b);if(!_[_0xd692('0x21')](_0x524f7b['variable']['xmd-originatecalleridnum'])){utils['info'](util[_0xd692('0x8')](_0xd692('0x49'),_0x524f7b[_0xd692('0xa')],_0x524f7b[_0xd692('0x4a')]));channels[_0x524f7b[_0xd692('0xa')]]['source']=_0x524f7b[_0xd692('0x4a')];}if(!_[_0xd692('0x21')](_0x524f7b[_0xd692('0x4b')]['xmd-phone'])){utils[_0xd692('0x7')](util[_0xd692('0x8')](_0xd692('0x4c'),_0x524f7b[_0xd692('0xa')],_0x524f7b[_0xd692('0x4a')]));channels[_0x524f7b['uniqueid']][_0xd692('0x4d')]=_0x524f7b['value'];channels[_0x524f7b[_0xd692('0xa')]]['callerid']='\x22'+_0x524f7b[_0xd692('0x4a')]+_0xd692('0x4e')+_0x524f7b[_0xd692('0x4a')]+'>';}if(!_[_0xd692('0x21')](_0x524f7b['variable'][_0xd692('0x4f')])||!_[_0xd692('0x21')](_0x524f7b[_0xd692('0x4b')][_0xd692('0x50')])){utils[_0xd692('0x7')](util['format'](_0xd692('0x51'),_0x524f7b[_0xd692('0xa')],!_[_0xd692('0x21')](_0x524f7b['variable'][_0xd692('0x4f')])?_0xd692('0x4f'):_0xd692('0x50'),_0x524f7b['value']));channels[_0x524f7b[_0xd692('0xa')]][_0xd692('0x2d')]=_0x524f7b[_0xd692('0x4a')];}if(!_[_0xd692('0x21')](_0x524f7b[_0xd692('0x4b')][_0xd692('0x52')])||!_['isNil'](_0x524f7b['variable'][_0xd692('0x53')])){utils[_0xd692('0x7')](util[_0xd692('0x8')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x524f7b['uniqueid'],!_[_0xd692('0x21')](_0x524f7b[_0xd692('0x4b')]['xmd-queue'])?_0xd692('0x52'):_0xd692('0x53'),_0x524f7b[_0xd692('0x4a')]));channels[_0x524f7b[_0xd692('0xa')]][_0xd692('0x54')]='Queue';channels[_0x524f7b['uniqueid']][_0xd692('0x55')]=_0x524f7b['value'];channels[_0x524f7b[_0xd692('0xa')]][_0xd692('0xc')]=!![];}if(!_['isNil'](_0x524f7b['variable'][_0xd692('0x56')])){utils['info'](util['format'](_0xd692('0x57'),_0x524f7b[_0xd692('0xa')],_0x524f7b[_0xd692('0x4a')]));channels[_0x524f7b[_0xd692('0xa')]][_0xd692('0x58')]=_0x524f7b[_0xd692('0x4a')];}if(!_['isNil'](_0x524f7b['variable']['xmd-cdrtype'])){utils[_0xd692('0x7')](util['format']('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x524f7b[_0xd692('0xa')],_0x524f7b[_0xd692('0x4a')]));channels[_0x524f7b[_0xd692('0xa')]]['type']=_0x524f7b['value'];}if(!_['isNil'](_0x524f7b[_0xd692('0x4b')][_0xd692('0x59')])){utils['info'](util[_0xd692('0x8')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x524f7b[_0xd692('0xa')],_0x524f7b[_0xd692('0x4a')]));channels[_0x524f7b[_0xd692('0xa')]][_0xd692('0x5a')]=_0x524f7b[_0xd692('0x4a')];}if(!_[_0xd692('0x21')](_0x524f7b[_0xd692('0x4b')][_0xd692('0x5b')])){utils[_0xd692('0x7')](util['format'](_0xd692('0x5c'),_0x524f7b[_0xd692('0xa')],_0x524f7b['value']));channels[_0x524f7b[_0xd692('0xa')]][_0xd692('0x5b')]=_0x524f7b[_0xd692('0x4a')];}}}catch(_0x39a2a7){utils[_0xd692('0x1e')](util[_0xd692('0x8')](_0xd692('0x5d'),_0x524f7b['uniqueid']),_0x39a2a7);}};exports[_0xd692('0x5e')]=function(_0x401da9){try{if(!_[_0xd692('0x21')](channels[_0x401da9['uniqueid']])){utils[_0xd692('0x1f')](util[_0xd692('0x8')]('[%s][calls][newexten]',_0x401da9[_0xd692('0xa')]),_0x401da9);utils[_0xd692('0x7')](util[_0xd692('0x8')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x401da9[_0xd692('0xa')],_0x401da9[_0xd692('0x5f')],_0x401da9['appdata']));if(_0x401da9[_0xd692('0x5f')]['toLowerCase']()=='set'&&_[_0xd692('0x60')](_0x401da9[_0xd692('0x61')][_0xd692('0x62')](),'cdr')){var _0x9b9cd=_0x401da9[_0xd692('0x61')][_0xd692('0x63')]('=');var _0xaac6a9=_0x9b9cd[0x0][_0xd692('0x64')](_0x9b9cd[0x0][_0xd692('0x65')]('(')+0x1,_0x9b9cd[0x0][_0xd692('0x65')](')'));var _0x5f3854=_0x9b9cd[0x1];channels[_0x401da9['uniqueid']][_0xaac6a9]=_0x5f3854;}if(!_[_0xd692('0x66')]([_0xd692('0x2b'),_0xd692('0x67'),_0xd692('0x68'),'set','gotoif'],_0x401da9['application'][_0xd692('0x62')]())){channels[_0x401da9[_0xd692('0xa')]][_0xd692('0x54')]=_0x401da9[_0xd692('0x5f')];channels[_0x401da9[_0xd692('0xa')]]['lastdata']=_0x401da9['appdata'];}}}catch(_0x1c6246){utils['error'](util['format'](_0xd692('0x69'),_0x401da9['uniqueid']),_0x1c6246);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 7d42e88..0537785 100644 --- a/server/services/xdr/core.controller.js +++ b/server/services/xdr/core.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0012=['error','[core]\x20error','managerevent','connect','info','[core]\x20connected','[core]\x20shutdown','fullybooted','[core]\x20fullybooted'];(function(_0x1fb038,_0xc3f69b){var _0x1600dc=function(_0x2a040e){while(--_0x2a040e){_0x1fb038['push'](_0x1fb038['shift']());}};_0x1600dc(++_0xc3f69b);}(_0x0012,0x111));var _0x2001=function(_0x94181e,_0x5f5a18){_0x94181e=_0x94181e-0x0;var _0x3582da=_0x0012[_0x94181e];return _0x3582da;};'use strict';var utils=require('./utils');exports[_0x2001('0x0')]=function(){utils[_0x2001('0x1')](_0x2001('0x2'));};exports['shutdown']=function(){utils[_0x2001('0x1')](_0x2001('0x3'));};exports[_0x2001('0x4')]=function(){utils[_0x2001('0x1')](_0x2001('0x5'));};exports[_0x2001('0x6')]=function(_0x39e632){utils[_0x2001('0x6')](_0x2001('0x7'),_0x39e632);};exports['close']=function(){utils[_0x2001('0x1')]('[core]\x20close');};exports[_0x2001('0x8')]=function(_0x10d12f){}; \ No newline at end of file +var _0xaf07=['error','[core]\x20error','close','[core]\x20close','./utils','connect','info','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted'];(function(_0x1774b9,_0x58a716){var _0x1023d2=function(_0x53a198){while(--_0x53a198){_0x1774b9['push'](_0x1774b9['shift']());}};_0x1023d2(++_0x58a716);}(_0xaf07,0x117));var _0x7af0=function(_0x2daf3f,_0x49bc97){_0x2daf3f=_0x2daf3f-0x0;var _0x380da3=_0xaf07[_0x2daf3f];return _0x380da3;};'use strict';var utils=require(_0x7af0('0x0'));exports[_0x7af0('0x1')]=function(){utils[_0x7af0('0x2')]('[core]\x20connected');};exports[_0x7af0('0x3')]=function(){utils[_0x7af0('0x2')](_0x7af0('0x4'));};exports[_0x7af0('0x5')]=function(){utils[_0x7af0('0x2')](_0x7af0('0x6'));};exports[_0x7af0('0x7')]=function(_0x127e5f){utils[_0x7af0('0x7')](_0x7af0('0x8'),_0x127e5f);};exports[_0x7af0('0x9')]=function(){utils[_0x7af0('0x2')](_0x7af0('0xa'));};exports['managerevent']=function(_0x3817d9){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 963c019..0606b70 100644 --- a/server/services/xdr/dials.controller.js +++ b/server/services/xdr/dials.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xffee=['[%s][dials][hangup]','calleridname','cause-txt','complete','duration','diffTime','endtime','holdtime','billableseconds','lodash','util','./utils','info','uniqueid','channel','calleridnum','dialstatus','request','CreateVoiceDialReport','debug','format','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','toLowerCase','split','[%s][dials][newexten]','varset','[%s][dials][varset]','variable','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','dialbegin','isNil','[%s][dials][dialbegin]','now','lastevent','starttime','dialend','ANSWER','assign','answertime','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','hangup'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xffee,0xfe));var _0xeffe=function(_0x471bc9,_0x79f788){_0x471bc9=_0x471bc9-0x0;var _0x3ec800=_0xffee[_0x471bc9];return _0x3ec800;};'use strict';var _=require(_0xeffe('0x0'));var util=require(_0xeffe('0x1'));var utils=require(_0xeffe('0x2'));var dials={};function writeDB(_0x3375f0){utils[_0xeffe('0x3')](util['format']('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x3375f0[_0xeffe('0x4')],_0x3375f0[_0xeffe('0x5')],_0x3375f0['dialstring'],_0x3375f0[_0xeffe('0x6')],_0x3375f0['connectedlinenum'],_0x3375f0[_0xeffe('0x7')]));utils[_0xeffe('0x8')](_0xeffe('0x9'),_0x3375f0);delete dials[_0x3375f0[_0xeffe('0x4')]];}exports['newexten']=function(_0x2ab3d8){try{utils[_0xeffe('0xa')](util[_0xeffe('0xb')]('[%s][dials][newexten]',_0x2ab3d8['uniqueid']),_0x2ab3d8);utils['info'](util['format'](_0xeffe('0xc'),_0x2ab3d8[_0xeffe('0x4')],_0x2ab3d8[_0xeffe('0xd')],_0x2ab3d8[_0xeffe('0xe')]));if(_0x2ab3d8[_0xeffe('0xd')]['toLowerCase']()==_0xeffe('0xf')&&_[_0xeffe('0x10')](_0x2ab3d8[_0xeffe('0xe')][_0xeffe('0x11')](),'cdr(routeid)')){var _0x2060e6=_0x2ab3d8[_0xeffe('0xe')][_0xeffe('0x12')]('=');dials[_0x2ab3d8[_0xeffe('0x4')]]={'routeId':_0x2060e6[0x1]};}}catch(_0x2aaad2){utils['error'](util['format'](_0xeffe('0x13'),_0x2ab3d8[_0xeffe('0x4')]),_0x2aaad2);}};exports[_0xeffe('0x14')]=function(_0x50f7b7){try{utils[_0xeffe('0xa')](util[_0xeffe('0xb')](_0xeffe('0x15'),_0x50f7b7[_0xeffe('0x4')]),_0x50f7b7);if(!_['isNil'](_0x50f7b7[_0xeffe('0x16')]['outboundrouteid'])){utils['info'](util[_0xeffe('0xb')](_0xeffe('0x17'),_0x50f7b7[_0xeffe('0x4')],_0x50f7b7[_0xeffe('0x18')]));dials[_0x50f7b7['uniqueid']]={'routeId':_0x50f7b7[_0xeffe('0x18')]};}}catch(_0x40417e){utils[_0xeffe('0x19')](util[_0xeffe('0xb')](_0xeffe('0x15'),_0x50f7b7[_0xeffe('0x4')]),_0x40417e);}};exports[_0xeffe('0x1a')]=function(_0x85d0b6){try{if(!_[_0xeffe('0x1b')](dials[_0x85d0b6[_0xeffe('0x4')]])){utils[_0xeffe('0xa')](util['format'](_0xeffe('0x1c'),_0x85d0b6[_0xeffe('0x4')]),_0x85d0b6);dials[_0x85d0b6['uniqueid']]=_['assign'](dials[_0x85d0b6['uniqueid']],_0x85d0b6);dials[_0x85d0b6[_0xeffe('0x4')]]['starttime']=utils[_0xeffe('0x1d')]();dials[_0x85d0b6[_0xeffe('0x4')]][_0xeffe('0x1e')]='called';utils[_0xeffe('0x3')](util['format']('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x85d0b6[_0xeffe('0x4')],dials[_0x85d0b6[_0xeffe('0x4')]][_0xeffe('0x1f')]));}}catch(_0x35acfa){utils[_0xeffe('0x19')](util[_0xeffe('0xb')](_0xeffe('0x1c'),_0x85d0b6['uniqueid']),_0x35acfa);}};exports[_0xeffe('0x20')]=function(_0x4e436c){try{if(!_[_0xeffe('0x1b')](dials[_0x4e436c['uniqueid']])){utils[_0xeffe('0xa')](util[_0xeffe('0xb')]('[%s][dials][dialend]',_0x4e436c[_0xeffe('0x4')]),_0x4e436c);dials[_0x4e436c['uniqueid']][_0xeffe('0x7')]=_0x4e436c['dialstatus'];if(_0x4e436c['dialstatus']==_0xeffe('0x21')){dials[_0x4e436c[_0xeffe('0x4')]]=_[_0xeffe('0x22')](dials[_0x4e436c['uniqueid']],_0x4e436c);dials[_0x4e436c[_0xeffe('0x4')]][_0xeffe('0x23')]=utils['now']();dials[_0x4e436c[_0xeffe('0x4')]][_0xeffe('0x1e')]='connect';utils[_0xeffe('0x3')](util[_0xeffe('0xb')](_0xeffe('0x24'),_0x4e436c['uniqueid'],_0x4e436c[_0xeffe('0x7')],dials[_0x4e436c[_0xeffe('0x4')]][_0xeffe('0x23')]));}else{utils['info'](util[_0xeffe('0xb')](_0xeffe('0x25'),_0x4e436c['uniqueid'],_0x4e436c[_0xeffe('0x7')]));}}}catch(_0x22895f){utils['error'](util[_0xeffe('0xb')](_0xeffe('0x26'),_0x4e436c[_0xeffe('0x4')]),_0x22895f);}};exports[_0xeffe('0x27')]=function(_0x153267){try{if(!_[_0xeffe('0x1b')](dials[_0x153267['uniqueid']])){utils[_0xeffe('0xa')](util[_0xeffe('0xb')](_0xeffe('0x28'),_0x153267[_0xeffe('0x4')]),_0x153267);utils['info'](util[_0xeffe('0xb')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x153267[_0xeffe('0x4')],_0x153267['calleridnum'],_0x153267[_0xeffe('0x29')],_0x153267[_0xeffe('0x2a')]));dials[_0x153267[_0xeffe('0x4')]]=_[_0xeffe('0x22')](dials[_0x153267['uniqueid']],{'endtime':utils['now'](),'lastevent':_0xeffe('0x2b')});dials[_0x153267['uniqueid']][_0xeffe('0x2c')]=utils[_0xeffe('0x2d')](dials[_0x153267[_0xeffe('0x4')]][_0xeffe('0x2e')],dials[_0x153267['uniqueid']][_0xeffe('0x1f')]);dials[_0x153267[_0xeffe('0x4')]][_0xeffe('0x2f')]=utils[_0xeffe('0x2d')](dials[_0x153267[_0xeffe('0x4')]][_0xeffe('0x23')]||dials[_0x153267['uniqueid']]['endtime'],dials[_0x153267['uniqueid']][_0xeffe('0x1f')]);dials[_0x153267[_0xeffe('0x4')]][_0xeffe('0x30')]=dials[_0x153267[_0xeffe('0x4')]][_0xeffe('0x23')]?utils['diffTime'](dials[_0x153267[_0xeffe('0x4')]][_0xeffe('0x2e')],dials[_0x153267[_0xeffe('0x4')]][_0xeffe('0x23')]):0x0;writeDB(dials[_0x153267[_0xeffe('0x4')]]);}}catch(_0x4693e6){utils[_0xeffe('0x19')](util[_0xeffe('0xb')](_0xeffe('0x28'),_0x153267[_0xeffe('0x4')]),_0x4693e6);}}; \ No newline at end of file +var _0xcb9c=['info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','connectedlinenum','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','appdata','application','toLowerCase','set','startsWith','split','error','[%s][dials][varset]','isNil','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','assign','now','called','starttime','dialstatus','ANSWER','lastevent','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridnum','cause-txt','duration','diffTime','endtime','holdtime','billableseconds','./utils'];(function(_0x2ad427,_0x44c2f1){var _0x1c1b2e=function(_0x17fde8){while(--_0x17fde8){_0x2ad427['push'](_0x2ad427['shift']());}};_0x1c1b2e(++_0x44c2f1);}(_0xcb9c,0xe5));var _0xccb9=function(_0x583e24,_0xc9ec6){_0x583e24=_0x583e24-0x0;var _0xdf4e7a=_0xcb9c[_0x583e24];return _0xdf4e7a;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xccb9('0x0'));var dials={};function writeDB(_0x1d28a4){utils[_0xccb9('0x1')](util[_0xccb9('0x2')](_0xccb9('0x3'),_0x1d28a4[_0xccb9('0x4')],_0x1d28a4['channel'],_0x1d28a4['dialstring'],_0x1d28a4['calleridnum'],_0x1d28a4[_0xccb9('0x5')],_0x1d28a4['dialstatus']));utils['request'](_0xccb9('0x6'),_0x1d28a4);delete dials[_0x1d28a4[_0xccb9('0x4')]];}exports[_0xccb9('0x7')]=function(_0x5e2109){try{utils[_0xccb9('0x8')](util[_0xccb9('0x2')](_0xccb9('0x9'),_0x5e2109[_0xccb9('0x4')]),_0x5e2109);utils[_0xccb9('0x1')](util[_0xccb9('0x2')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x5e2109['uniqueid'],_0x5e2109['application'],_0x5e2109[_0xccb9('0xa')]));if(_0x5e2109[_0xccb9('0xb')][_0xccb9('0xc')]()==_0xccb9('0xd')&&_[_0xccb9('0xe')](_0x5e2109[_0xccb9('0xa')][_0xccb9('0xc')](),'cdr(routeid)')){var _0x59f613=_0x5e2109[_0xccb9('0xa')][_0xccb9('0xf')]('=');dials[_0x5e2109['uniqueid']]={'routeId':_0x59f613[0x1]};}}catch(_0x480f9c){utils[_0xccb9('0x10')](util['format'](_0xccb9('0x9'),_0x5e2109['uniqueid']),_0x480f9c);}};exports['varset']=function(_0x3fea5f){try{utils[_0xccb9('0x8')](util['format'](_0xccb9('0x11'),_0x3fea5f['uniqueid']),_0x3fea5f);if(!_[_0xccb9('0x12')](_0x3fea5f['variable'][_0xccb9('0x13')])){utils[_0xccb9('0x1')](util[_0xccb9('0x2')](_0xccb9('0x14'),_0x3fea5f[_0xccb9('0x4')],_0x3fea5f[_0xccb9('0x15')]));dials[_0x3fea5f[_0xccb9('0x4')]]={'routeId':_0x3fea5f[_0xccb9('0x15')]};}}catch(_0x716a9f){utils[_0xccb9('0x10')](util[_0xccb9('0x2')]('[%s][dials][varset]',_0x3fea5f['uniqueid']),_0x716a9f);}};exports[_0xccb9('0x16')]=function(_0x5effdc){try{if(!_['isNil'](dials[_0x5effdc[_0xccb9('0x4')]])){utils['debug'](util[_0xccb9('0x2')](_0xccb9('0x17'),_0x5effdc[_0xccb9('0x4')]),_0x5effdc);dials[_0x5effdc[_0xccb9('0x4')]]=_[_0xccb9('0x18')](dials[_0x5effdc[_0xccb9('0x4')]],_0x5effdc);dials[_0x5effdc[_0xccb9('0x4')]]['starttime']=utils[_0xccb9('0x19')]();dials[_0x5effdc[_0xccb9('0x4')]]['lastevent']=_0xccb9('0x1a');utils['info'](util[_0xccb9('0x2')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x5effdc[_0xccb9('0x4')],dials[_0x5effdc[_0xccb9('0x4')]][_0xccb9('0x1b')]));}}catch(_0x3c098f){utils[_0xccb9('0x10')](util[_0xccb9('0x2')](_0xccb9('0x17'),_0x5effdc[_0xccb9('0x4')]),_0x3c098f);}};exports['dialend']=function(_0x4c1525){try{if(!_[_0xccb9('0x12')](dials[_0x4c1525[_0xccb9('0x4')]])){utils[_0xccb9('0x8')](util[_0xccb9('0x2')]('[%s][dials][dialend]',_0x4c1525[_0xccb9('0x4')]),_0x4c1525);dials[_0x4c1525[_0xccb9('0x4')]][_0xccb9('0x1c')]=_0x4c1525['dialstatus'];if(_0x4c1525[_0xccb9('0x1c')]==_0xccb9('0x1d')){dials[_0x4c1525[_0xccb9('0x4')]]=_[_0xccb9('0x18')](dials[_0x4c1525[_0xccb9('0x4')]],_0x4c1525);dials[_0x4c1525[_0xccb9('0x4')]]['answertime']=utils['now']();dials[_0x4c1525['uniqueid']][_0xccb9('0x1e')]=_0xccb9('0x1f');utils[_0xccb9('0x1')](util[_0xccb9('0x2')](_0xccb9('0x20'),_0x4c1525[_0xccb9('0x4')],_0x4c1525[_0xccb9('0x1c')],dials[_0x4c1525[_0xccb9('0x4')]][_0xccb9('0x21')]));}else{utils[_0xccb9('0x1')](util[_0xccb9('0x2')](_0xccb9('0x22'),_0x4c1525[_0xccb9('0x4')],_0x4c1525[_0xccb9('0x1c')]));}}}catch(_0x3ddf02){utils[_0xccb9('0x10')](util[_0xccb9('0x2')](_0xccb9('0x23'),_0x4c1525['uniqueid']),_0x3ddf02);}};exports[_0xccb9('0x24')]=function(_0x2fac27){try{if(!_[_0xccb9('0x12')](dials[_0x2fac27[_0xccb9('0x4')]])){utils['debug'](util[_0xccb9('0x2')](_0xccb9('0x25'),_0x2fac27[_0xccb9('0x4')]),_0x2fac27);utils[_0xccb9('0x1')](util[_0xccb9('0x2')](_0xccb9('0x26'),_0x2fac27[_0xccb9('0x4')],_0x2fac27[_0xccb9('0x27')],_0x2fac27['calleridname'],_0x2fac27[_0xccb9('0x28')]));dials[_0x2fac27['uniqueid']]=_[_0xccb9('0x18')](dials[_0x2fac27['uniqueid']],{'endtime':utils[_0xccb9('0x19')](),'lastevent':'complete'});dials[_0x2fac27['uniqueid']][_0xccb9('0x29')]=utils[_0xccb9('0x2a')](dials[_0x2fac27[_0xccb9('0x4')]][_0xccb9('0x2b')],dials[_0x2fac27[_0xccb9('0x4')]]['starttime']);dials[_0x2fac27[_0xccb9('0x4')]][_0xccb9('0x2c')]=utils[_0xccb9('0x2a')](dials[_0x2fac27['uniqueid']][_0xccb9('0x21')]||dials[_0x2fac27['uniqueid']]['endtime'],dials[_0x2fac27['uniqueid']][_0xccb9('0x1b')]);dials[_0x2fac27[_0xccb9('0x4')]][_0xccb9('0x2d')]=dials[_0x2fac27[_0xccb9('0x4')]]['answertime']?utils[_0xccb9('0x2a')](dials[_0x2fac27[_0xccb9('0x4')]]['endtime'],dials[_0x2fac27[_0xccb9('0x4')]][_0xccb9('0x21')]):0x0;writeDB(dials[_0x2fac27[_0xccb9('0x4')]]);}}catch(_0xaad02e){utils[_0xccb9('0x10')](util[_0xccb9('0x2')](_0xccb9('0x25'),_0x2fac27[_0xccb9('0x4')]),_0xaad02e);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 1b1245a..a866434 100644 --- a/server/services/xdr/index.js +++ b/server/services/xdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f8c=['hangup','cdr','blindtransfer','[%s][index][blindtransfer]','[%s][index][attendedtransfer]','origtransfereruniqueid','attendedtransfer','varset','[%s][index][newexten]','newexten','newchannel','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','../../config/environment','./utils','xdr','disabled','env','production','local','port','asterisk','username','password','keepConnected','info','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','[%s][index][devicestatechange]','device','format','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','debug','[%s][index][agentringnoanswer]','[%s][index][agentconnect]','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]'];(function(_0xe178b9,_0x1e68f1){var _0x3429d7=function(_0x5121f8){while(--_0x5121f8){_0xe178b9['push'](_0xe178b9['shift']());}};_0x3429d7(++_0x1e68f1);}(_0x3f8c,0xdf));var _0xc3f8=function(_0x3a540a,_0x567845){_0x3a540a=_0x3a540a-0x0;var _0x470024=_0x3f8c[_0x3a540a];return _0x470024;};var AsteriskManager=require('asterisk-manager');var config=require(_0xc3f8('0x0'));var utils=require(_0xc3f8('0x1'));var util=require('util');var isXDREnabled=config['xdr']&&config[_0xc3f8('0x2')][_0xc3f8('0x3')]?!config[_0xc3f8('0x2')][_0xc3f8('0x3')]:!![];var isProduction=config[_0xc3f8('0x4')]===_0xc3f8('0x5')||![];var isLocalAsterisk=config['xdr']&&config[_0xc3f8('0x2')][_0xc3f8('0x6')]===!![]||![];var ami=new AsteriskManager(config['asterisk'][_0xc3f8('0x7')],config[_0xc3f8('0x8')]['ip'],config[_0xc3f8('0x8')][_0xc3f8('0x9')],config[_0xc3f8('0x8')][_0xc3f8('0xa')],!![]);ami[_0xc3f8('0xb')]();if(!isXDREnabled){utils['info']('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils[_0xc3f8('0xc')](_0xc3f8('0xd'));}else{var agents=require(_0xc3f8('0xe'));var calls=require(_0xc3f8('0xf'));var queues=require(_0xc3f8('0x10'));var recordings=require(_0xc3f8('0x11'));var members=require('./members.controller');var dials=require(_0xc3f8('0x12'));var transfers=require(_0xc3f8('0x13'));var core=require(_0xc3f8('0x14'));ami['on'](_0xc3f8('0x15'),core[_0xc3f8('0x15')]);ami['on'](_0xc3f8('0x16'),core[_0xc3f8('0x16')]);ami['on'](_0xc3f8('0x17'),core[_0xc3f8('0x17')]);ami['on']('error',core[_0xc3f8('0x18')]);ami['on'](_0xc3f8('0x19'),core[_0xc3f8('0x19')]);ami['on']('managerevent',core[_0xc3f8('0x1a')]);ami['on'](_0xc3f8('0x1b'),function(_0x3b6cde){try{utils['debug'](util['format'](_0xc3f8('0x1c'),_0x3b6cde[_0xc3f8('0x1d')]),_0x3b6cde);members['devicestatechange'](_0x3b6cde);}catch(_0x240b95){utils[_0xc3f8('0x18')](util[_0xc3f8('0x1e')](_0xc3f8('0x1c'),_0x3b6cde['device']),_0x240b95);}});ami['on'](_0xc3f8('0x1f'),function(_0x4358f5){try{utils['debug'](util['format'](_0xc3f8('0x20'),_0x4358f5[_0xc3f8('0x21')]),_0x4358f5);agents['agentcalled'](_0x4358f5);}catch(_0x4da916){utils[_0xc3f8('0x18')](util['format']('[%s][index][agentcalled]',_0x4358f5['uniqueid']),_0x4da916);}});ami['on'](_0xc3f8('0x22'),function(_0xaf53d7){try{utils[_0xc3f8('0x23')](util[_0xc3f8('0x1e')](_0xc3f8('0x24'),_0xaf53d7[_0xc3f8('0x21')]),_0xaf53d7);agents['agentringnoanswer'](_0xaf53d7);}catch(_0x379942){utils[_0xc3f8('0x18')](util['format'](_0xc3f8('0x24'),_0xaf53d7[_0xc3f8('0x21')]),_0x379942);}});ami['on']('agentconnect',function(_0x3a0bae){try{utils[_0xc3f8('0x23')](util[_0xc3f8('0x1e')](_0xc3f8('0x25'),_0x3a0bae[_0xc3f8('0x21')]),_0x3a0bae);agents[_0xc3f8('0x26')](_0x3a0bae);queues['agentconnect'](_0x3a0bae);}catch(_0x4bf406){utils[_0xc3f8('0x18')](util[_0xc3f8('0x1e')]('[%s][index][agentconnect]',_0x3a0bae[_0xc3f8('0x21')]),_0x4bf406);}});ami['on']('agentcomplete',function(_0x3f02ea){try{utils[_0xc3f8('0x23')](util[_0xc3f8('0x1e')]('[%s][index][agentcomplete]',_0x3f02ea[_0xc3f8('0x21')]),_0x3f02ea);agents[_0xc3f8('0x27')](_0x3f02ea);queues[_0xc3f8('0x27')](_0x3f02ea);members[_0xc3f8('0x27')](_0x3f02ea);}catch(_0x3bb0e6){utils[_0xc3f8('0x18')](util[_0xc3f8('0x1e')](_0xc3f8('0x28'),_0x3f02ea[_0xc3f8('0x21')]),_0x3bb0e6);}});ami['on'](_0xc3f8('0x29'),function(_0x2c20be){try{utils[_0xc3f8('0x23')](util[_0xc3f8('0x1e')](_0xc3f8('0x2a'),_0x2c20be[_0xc3f8('0x21')]),_0x2c20be);agents[_0xc3f8('0x29')](_0x2c20be);queues[_0xc3f8('0x29')](_0x2c20be);}catch(_0x194bdf){utils[_0xc3f8('0x18')](util[_0xc3f8('0x1e')](_0xc3f8('0x2a'),_0x2c20be['uniqueid']),_0x194bdf);}});ami['on']('queuecallerjoin',function(_0x356dda){try{utils['debug'](util[_0xc3f8('0x1e')](_0xc3f8('0x2b'),_0x356dda[_0xc3f8('0x21')]),_0x356dda);queues[_0xc3f8('0x2c')](_0x356dda);recordings[_0xc3f8('0x2c')](_0x356dda);}catch(_0x2deb07){utils[_0xc3f8('0x18')](util[_0xc3f8('0x1e')](_0xc3f8('0x2b'),_0x356dda[_0xc3f8('0x21')]),_0x2deb07);}});ami['on'](_0xc3f8('0x2d'),function(_0x25b746){try{utils['debug'](util[_0xc3f8('0x1e')](_0xc3f8('0x2e'),_0x25b746[_0xc3f8('0x21')]),_0x25b746);queues[_0xc3f8('0x2d')](_0x25b746);}catch(_0x1da1c1){utils[_0xc3f8('0x18')](util[_0xc3f8('0x1e')](_0xc3f8('0x2e'),_0x25b746[_0xc3f8('0x21')]),_0x1da1c1);}});ami['on'](_0xc3f8('0x2f'),function(_0x117bd4){try{utils[_0xc3f8('0x23')](util[_0xc3f8('0x1e')](_0xc3f8('0x30'),_0x117bd4[_0xc3f8('0x21')]),_0x117bd4);queues[_0xc3f8('0x2f')](_0x117bd4);calls['musiconholdstart'](_0x117bd4);}catch(_0x49e264){utils[_0xc3f8('0x18')](util[_0xc3f8('0x1e')](_0xc3f8('0x30'),_0x117bd4['uniqueid']),_0x49e264);}});ami['on'](_0xc3f8('0x31'),function(_0x5e923c){try{utils['debug'](util['format'](_0xc3f8('0x32'),_0x5e923c[_0xc3f8('0x21')]),_0x5e923c);queues['musiconholdstop'](_0x5e923c);calls[_0xc3f8('0x31')](_0x5e923c);}catch(_0x19fae5){utils[_0xc3f8('0x18')](util[_0xc3f8('0x1e')](_0xc3f8('0x32'),_0x5e923c[_0xc3f8('0x21')]),_0x19fae5);}});ami['on'](_0xc3f8('0x33'),function(_0x31980e){try{utils['debug'](util[_0xc3f8('0x1e')](_0xc3f8('0x34'),_0x31980e[_0xc3f8('0x21')]),_0x31980e);calls[_0xc3f8('0x33')](_0x31980e);recordings[_0xc3f8('0x33')](_0x31980e);}catch(_0x3b4056){utils[_0xc3f8('0x18')](util[_0xc3f8('0x1e')](_0xc3f8('0x34'),_0x31980e[_0xc3f8('0x21')]),_0x3b4056);}});ami['on'](_0xc3f8('0x35'),function(_0x80c255){try{utils[_0xc3f8('0x23')](util['format']('[%s][index][hangup]',_0x80c255[_0xc3f8('0x21')]),_0x80c255);calls[_0xc3f8('0x35')](_0x80c255);recordings[_0xc3f8('0x35')](_0x80c255);dials[_0xc3f8('0x35')](_0x80c255);agents['hangup'](_0x80c255);queues['hangup'](_0x80c255);}catch(_0x102c7e){utils[_0xc3f8('0x18')](util[_0xc3f8('0x1e')]('[%s][index][hangup]',_0x80c255[_0xc3f8('0x21')]),_0x102c7e);}});ami['on'](_0xc3f8('0x36'),function(_0x33592b){try{utils['debug'](util[_0xc3f8('0x1e')]('[%s][index][cdr]',_0x33592b['uniqueid']),_0x33592b);members['cdr'](_0x33592b);}catch(_0x68dda8){utils[_0xc3f8('0x18')](util[_0xc3f8('0x1e')]('[%s][index][cdr]',_0x33592b[_0xc3f8('0x21')]),_0x68dda8);}});ami['on'](_0xc3f8('0x37'),function(_0x104f8f){try{utils[_0xc3f8('0x23')](util[_0xc3f8('0x1e')](_0xc3f8('0x38'),_0x104f8f[_0xc3f8('0x21')]),_0x104f8f);queues['blindtransfer'](_0x104f8f);agents[_0xc3f8('0x37')](_0x104f8f);transfers['blindtransfer'](_0x104f8f);}catch(_0x192139){utils['error'](util[_0xc3f8('0x1e')](_0xc3f8('0x38'),_0x104f8f[_0xc3f8('0x21')]),_0x192139);}});ami['on']('attendedtransfer',function(_0x32aebf){try{utils[_0xc3f8('0x23')](util[_0xc3f8('0x1e')](_0xc3f8('0x39'),_0x32aebf[_0xc3f8('0x3a')]),_0x32aebf);queues['attendedtransfer'](_0x32aebf);transfers[_0xc3f8('0x3b')](_0x32aebf);agents[_0xc3f8('0x3b')](_0x32aebf);calls['attendedtransfer'](_0x32aebf);}catch(_0xfa1a99){utils[_0xc3f8('0x18')](util[_0xc3f8('0x1e')]('[%s][index][attendedtransfer]',_0x32aebf['origtransfereruniqueid']),_0xfa1a99);}});ami['on']('varset',function(_0x5b7071){try{utils[_0xc3f8('0x23')](util['format']('[%s][index][varset]',_0x5b7071[_0xc3f8('0x21')]),_0x5b7071);queues[_0xc3f8('0x3c')](_0x5b7071);recordings[_0xc3f8('0x3c')](_0x5b7071);calls[_0xc3f8('0x3c')](_0x5b7071);dials[_0xc3f8('0x3c')](_0x5b7071);}catch(_0x36fdd5){utils['error'](util[_0xc3f8('0x1e')]('[%s][index][varset]',_0x5b7071['uniqueid']),_0x36fdd5);}});ami['on']('newexten',function(_0x29831e){try{utils['debug'](util[_0xc3f8('0x1e')](_0xc3f8('0x3d'),_0x29831e[_0xc3f8('0x21')]),_0x29831e);calls['newexten'](_0x29831e);recordings[_0xc3f8('0x3e')](_0x29831e);dials[_0xc3f8('0x3e')](_0x29831e);}catch(_0x2433b2){utils[_0xc3f8('0x18')](util[_0xc3f8('0x1e')](_0xc3f8('0x3d'),_0x29831e[_0xc3f8('0x21')]),_0x2433b2);}});ami['on'](_0xc3f8('0x3f'),function(_0x215fee){try{utils['debug'](util[_0xc3f8('0x1e')]('[%s][index][newchannel]',_0x215fee['uniqueid']),_0x215fee);calls[_0xc3f8('0x3f')](_0x215fee);recordings[_0xc3f8('0x3f')](_0x215fee);}catch(_0x391a74){utils[_0xc3f8('0x18')](util[_0xc3f8('0x1e')]('[%s][index][newchannel]',_0x215fee['uniqueid']),_0x391a74);}});ami['on'](_0xc3f8('0x40'),function(_0x4ab5bc){try{utils[_0xc3f8('0x23')](util['format'](_0xc3f8('0x41'),_0x4ab5bc['uniqueid']),_0x4ab5bc);dials['dialbegin'](_0x4ab5bc);}catch(_0x396b37){utils[_0xc3f8('0x18')](util['format'](_0xc3f8('0x42'),_0x4ab5bc[_0xc3f8('0x21')]),_0x396b37);}});ami['on'](_0xc3f8('0x43'),function(_0x2aacb2){try{utils[_0xc3f8('0x23')](util[_0xc3f8('0x1e')]('[%s][index][dialend]',_0x2aacb2['uniqueid']),_0x2aacb2);dials['dialend'](_0x2aacb2);}catch(_0x3d5247){utils[_0xc3f8('0x18')](util[_0xc3f8('0x1e')](_0xc3f8('0x44'),_0x2aacb2['uniqueid']),_0x3d5247);}});} \ No newline at end of file +var _0x88b3=['debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','[%s][index][newstate]','newstate','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','[%s][index][varset]','varset','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','[%s][index][dialend]','dialend','./utils','util','xdr','disabled','env','production','local','asterisk','port','password','keepConnected','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange'];(function(_0x4c6d6f,_0x291557){var _0x2d4478=function(_0x106946){while(--_0x106946){_0x4c6d6f['push'](_0x4c6d6f['shift']());}};_0x2d4478(++_0x291557);}(_0x88b3,0x18f));var _0x388b=function(_0x49fbb1,_0x4e7b6d){_0x49fbb1=_0x49fbb1-0x0;var _0x599efc=_0x88b3[_0x49fbb1];return _0x599efc;};var AsteriskManager=require('asterisk-manager');var config=require('../../config/environment');var utils=require(_0x388b('0x0'));var util=require(_0x388b('0x1'));var isXDREnabled=config[_0x388b('0x2')]&&config['xdr'][_0x388b('0x3')]?!config[_0x388b('0x2')][_0x388b('0x3')]:!![];var isProduction=config[_0x388b('0x4')]===_0x388b('0x5')||![];var isLocalAsterisk=config[_0x388b('0x2')]&&config[_0x388b('0x2')][_0x388b('0x6')]===!![]||![];var ami=new AsteriskManager(config[_0x388b('0x7')][_0x388b('0x8')],config[_0x388b('0x7')]['ip'],config[_0x388b('0x7')]['username'],config['asterisk'][_0x388b('0x9')],!![]);ami[_0x388b('0xa')]();if(!isXDREnabled){utils['info']('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils['info'](_0x388b('0xb'));}else{var agents=require(_0x388b('0xc'));var calls=require(_0x388b('0xd'));var queues=require(_0x388b('0xe'));var recordings=require(_0x388b('0xf'));var members=require(_0x388b('0x10'));var dials=require(_0x388b('0x11'));var transfers=require(_0x388b('0x12'));var core=require(_0x388b('0x13'));ami['on'](_0x388b('0x14'),core[_0x388b('0x14')]);ami['on'](_0x388b('0x15'),core[_0x388b('0x15')]);ami['on'](_0x388b('0x16'),core[_0x388b('0x16')]);ami['on'](_0x388b('0x17'),core[_0x388b('0x17')]);ami['on']('close',core[_0x388b('0x18')]);ami['on']('managerevent',core[_0x388b('0x19')]);ami['on'](_0x388b('0x1a'),function(_0x4649d3){try{utils[_0x388b('0x1b')](util[_0x388b('0x1c')](_0x388b('0x1d'),_0x4649d3[_0x388b('0x1e')]),_0x4649d3);members[_0x388b('0x1a')](_0x4649d3);}catch(_0x3912eb){utils[_0x388b('0x17')](util[_0x388b('0x1c')](_0x388b('0x1d'),_0x4649d3['device']),_0x3912eb);}});ami['on'](_0x388b('0x1f'),function(_0x762ef){try{utils[_0x388b('0x1b')](util[_0x388b('0x1c')](_0x388b('0x20'),_0x762ef[_0x388b('0x21')]),_0x762ef);agents[_0x388b('0x1f')](_0x762ef);}catch(_0x30d86d){utils[_0x388b('0x17')](util['format'](_0x388b('0x20'),_0x762ef[_0x388b('0x21')]),_0x30d86d);}});ami['on']('agentringnoanswer',function(_0xc48e69){try{utils['debug'](util[_0x388b('0x1c')](_0x388b('0x22'),_0xc48e69['uniqueid']),_0xc48e69);agents['agentringnoanswer'](_0xc48e69);}catch(_0x24c02c){utils['error'](util[_0x388b('0x1c')](_0x388b('0x22'),_0xc48e69[_0x388b('0x21')]),_0x24c02c);}});ami['on'](_0x388b('0x23'),function(_0xb0e4a2){try{utils[_0x388b('0x1b')](util[_0x388b('0x1c')](_0x388b('0x24'),_0xb0e4a2['uniqueid']),_0xb0e4a2);agents['agentconnect'](_0xb0e4a2);queues['agentconnect'](_0xb0e4a2);}catch(_0xf154b5){utils[_0x388b('0x17')](util[_0x388b('0x1c')](_0x388b('0x24'),_0xb0e4a2['uniqueid']),_0xf154b5);}});ami['on'](_0x388b('0x25'),function(_0x2a5436){try{utils[_0x388b('0x1b')](util[_0x388b('0x1c')](_0x388b('0x26'),_0x2a5436[_0x388b('0x21')]),_0x2a5436);agents[_0x388b('0x25')](_0x2a5436);queues[_0x388b('0x25')](_0x2a5436);members['agentcomplete'](_0x2a5436);}catch(_0x33b0b4){utils['error'](util[_0x388b('0x1c')](_0x388b('0x26'),_0x2a5436['uniqueid']),_0x33b0b4);}});ami['on'](_0x388b('0x27'),function(_0x471ae4){try{utils['debug'](util['format'](_0x388b('0x28'),_0x471ae4[_0x388b('0x21')]),_0x471ae4);agents[_0x388b('0x27')](_0x471ae4);queues[_0x388b('0x27')](_0x471ae4);}catch(_0x3ada43){utils[_0x388b('0x17')](util[_0x388b('0x1c')](_0x388b('0x28'),_0x471ae4[_0x388b('0x21')]),_0x3ada43);}});ami['on'](_0x388b('0x29'),function(_0x20848b){try{utils[_0x388b('0x1b')](util[_0x388b('0x1c')](_0x388b('0x2a'),_0x20848b[_0x388b('0x21')]),_0x20848b);queues[_0x388b('0x29')](_0x20848b);recordings[_0x388b('0x29')](_0x20848b);}catch(_0x462214){utils[_0x388b('0x17')](util[_0x388b('0x1c')]('[%s][index][queuecallerjoin]',_0x20848b[_0x388b('0x21')]),_0x462214);}});ami['on'](_0x388b('0x2b'),function(_0x129a6f){try{utils['debug'](util[_0x388b('0x1c')](_0x388b('0x2c'),_0x129a6f[_0x388b('0x21')]),_0x129a6f);queues[_0x388b('0x2b')](_0x129a6f);}catch(_0x5c3596){utils[_0x388b('0x17')](util[_0x388b('0x1c')](_0x388b('0x2c'),_0x129a6f[_0x388b('0x21')]),_0x5c3596);}});ami['on'](_0x388b('0x2d'),function(_0x204368){try{utils[_0x388b('0x1b')](util['format'](_0x388b('0x2e'),_0x204368[_0x388b('0x21')]),_0x204368);queues[_0x388b('0x2d')](_0x204368);calls['musiconholdstart'](_0x204368);}catch(_0x9fe903){utils[_0x388b('0x17')](util[_0x388b('0x1c')](_0x388b('0x2e'),_0x204368[_0x388b('0x21')]),_0x9fe903);}});ami['on'](_0x388b('0x2f'),function(_0x2965a8){try{utils[_0x388b('0x1b')](util['format'](_0x388b('0x30'),_0x2965a8[_0x388b('0x21')]),_0x2965a8);queues[_0x388b('0x2f')](_0x2965a8);calls['musiconholdstop'](_0x2965a8);}catch(_0x39a943){utils[_0x388b('0x17')](util[_0x388b('0x1c')](_0x388b('0x30'),_0x2965a8['uniqueid']),_0x39a943);}});ami['on']('newstate',function(_0xc5e69f){try{utils['debug'](util[_0x388b('0x1c')](_0x388b('0x31'),_0xc5e69f['uniqueid']),_0xc5e69f);calls['newstate'](_0xc5e69f);recordings[_0x388b('0x32')](_0xc5e69f);}catch(_0x161336){utils[_0x388b('0x17')](util['format']('[%s][index][newstate]',_0xc5e69f['uniqueid']),_0x161336);}});ami['on'](_0x388b('0x33'),function(_0x843385){try{utils[_0x388b('0x1b')](util['format'](_0x388b('0x34'),_0x843385[_0x388b('0x21')]),_0x843385);calls['hangup'](_0x843385);recordings[_0x388b('0x33')](_0x843385);dials['hangup'](_0x843385);agents['hangup'](_0x843385);queues['hangup'](_0x843385);}catch(_0x579477){utils[_0x388b('0x17')](util[_0x388b('0x1c')](_0x388b('0x34'),_0x843385[_0x388b('0x21')]),_0x579477);}});ami['on'](_0x388b('0x35'),function(_0x3c370a){try{utils[_0x388b('0x1b')](util[_0x388b('0x1c')]('[%s][index][cdr]',_0x3c370a[_0x388b('0x21')]),_0x3c370a);members[_0x388b('0x35')](_0x3c370a);}catch(_0x1ae5be){utils[_0x388b('0x17')](util['format'](_0x388b('0x36'),_0x3c370a['uniqueid']),_0x1ae5be);}});ami['on'](_0x388b('0x37'),function(_0x73c6c6){try{utils[_0x388b('0x1b')](util[_0x388b('0x1c')]('[%s][index][blindtransfer]',_0x73c6c6[_0x388b('0x21')]),_0x73c6c6);queues['blindtransfer'](_0x73c6c6);agents['blindtransfer'](_0x73c6c6);transfers['blindtransfer'](_0x73c6c6);}catch(_0x15d362){utils[_0x388b('0x17')](util[_0x388b('0x1c')](_0x388b('0x38'),_0x73c6c6['uniqueid']),_0x15d362);}});ami['on'](_0x388b('0x39'),function(_0x5de3b3){try{utils[_0x388b('0x1b')](util['format'](_0x388b('0x3a'),_0x5de3b3[_0x388b('0x3b')]),_0x5de3b3);queues[_0x388b('0x39')](_0x5de3b3);transfers[_0x388b('0x39')](_0x5de3b3);agents['attendedtransfer'](_0x5de3b3);calls[_0x388b('0x39')](_0x5de3b3);}catch(_0x212a85){utils[_0x388b('0x17')](util[_0x388b('0x1c')](_0x388b('0x3a'),_0x5de3b3['origtransfereruniqueid']),_0x212a85);}});ami['on']('varset',function(_0x251616){try{utils[_0x388b('0x1b')](util[_0x388b('0x1c')](_0x388b('0x3c'),_0x251616['uniqueid']),_0x251616);queues[_0x388b('0x3d')](_0x251616);recordings[_0x388b('0x3d')](_0x251616);calls[_0x388b('0x3d')](_0x251616);dials[_0x388b('0x3d')](_0x251616);}catch(_0x36db18){utils[_0x388b('0x17')](util['format'](_0x388b('0x3c'),_0x251616[_0x388b('0x21')]),_0x36db18);}});ami['on'](_0x388b('0x3e'),function(_0x1123e6){try{utils[_0x388b('0x1b')](util['format']('[%s][index][newexten]',_0x1123e6['uniqueid']),_0x1123e6);calls[_0x388b('0x3e')](_0x1123e6);recordings['newexten'](_0x1123e6);dials[_0x388b('0x3e')](_0x1123e6);}catch(_0x33f6ab){utils[_0x388b('0x17')](util[_0x388b('0x1c')](_0x388b('0x3f'),_0x1123e6['uniqueid']),_0x33f6ab);}});ami['on']('newchannel',function(_0x3d4bab){try{utils[_0x388b('0x1b')](util['format']('[%s][index][newchannel]',_0x3d4bab[_0x388b('0x21')]),_0x3d4bab);calls['newchannel'](_0x3d4bab);recordings[_0x388b('0x40')](_0x3d4bab);}catch(_0x1f916d){utils[_0x388b('0x17')](util[_0x388b('0x1c')](_0x388b('0x41'),_0x3d4bab[_0x388b('0x21')]),_0x1f916d);}});ami['on'](_0x388b('0x42'),function(_0x51cdf7){try{utils['debug'](util[_0x388b('0x1c')](_0x388b('0x43'),_0x51cdf7[_0x388b('0x21')]),_0x51cdf7);dials[_0x388b('0x42')](_0x51cdf7);}catch(_0x328587){utils[_0x388b('0x17')](util[_0x388b('0x1c')](_0x388b('0x44'),_0x51cdf7[_0x388b('0x21')]),_0x328587);}});ami['on']('dialend',function(_0x21c71c){try{utils[_0x388b('0x1b')](util[_0x388b('0x1c')](_0x388b('0x45'),_0x21c71c['uniqueid']),_0x21c71c);dials[_0x388b('0x46')](_0x21c71c);}catch(_0x2df08f){utils[_0x388b('0x17')](util[_0x388b('0x1c')](_0x388b('0x45'),_0x21c71c[_0x388b('0x21')]),_0x2df08f);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index d835036..3daf91b 100644 --- a/server/services/xdr/members.controller.js +++ b/server/services/xdr/members.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9a62=['getUserByName','catch','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','format','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','error','agentcomplete','[%s][members][agentcomplete]','info','queue','assign','cdr','[%s][members][cdr]','split','data1','data3','destination','destinationchannel','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','util','./utils','Queue:','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','membername','type','then','name','internal','request','CreateMemberReport'];(function(_0x28cae4,_0x444da3){var _0x2d8c20=function(_0x25fbb2){while(--_0x25fbb2){_0x28cae4['push'](_0x28cae4['shift']());}};_0x2d8c20(++_0x444da3);}(_0x9a62,0x1bc));var _0x29a6=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x9a62[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0x29a6('0x0'));var utils=require(_0x29a6('0x1'));var members={};var exclude=['Local/_attended@transfer',_0x29a6('0x2')];function writeDB(_0x2d49a0){utils['info'](util['format'](_0x29a6('0x3'),_0x2d49a0[_0x29a6('0x4')],_0x2d49a0[_0x29a6('0x5')],_0x2d49a0[_0x29a6('0x6')],_0x2d49a0[_0x29a6('0x7')],_0x2d49a0[_0x29a6('0x8')],_0x2d49a0[_0x29a6('0x9')]));if(_0x2d49a0['interface']){utils['getUserByInterface'](_0x2d49a0[_0x29a6('0x5')])[_0x29a6('0xa')](function(_0x5cee47){if(_0x5cee47){_0x2d49a0['membername']=_0x5cee47[_0x29a6('0xb')];_0x2d49a0[_0x29a6('0xc')]=_0x5cee47[_0x29a6('0xc')];utils[_0x29a6('0xd')](_0x29a6('0xe'),_0x2d49a0);}else{utils[_0x29a6('0xf')](_0x2d49a0[_0x29a6('0x5')]['split']('/')[0x1])[_0x29a6('0xa')](function(_0x6efb99){if(_0x6efb99){_0x2d49a0['membername']=_0x6efb99['name'];_0x2d49a0['internal']=_0x6efb99[_0x29a6('0xc')];utils[_0x29a6('0xd')]('CreateMemberReport',_0x2d49a0);}});}})[_0x29a6('0x10')](function(_0x13251a){utils['error'](util['format'](_0x29a6('0x11'),_0x2d49a0[_0x29a6('0x4')]),_0x13251a);});}delete members[_0x2d49a0['interface']];}function startsWith(_0x389255,_0x22378a){return _[_0x29a6('0x12')](_0x389255,function(_0x4fef5c){return _[_0x29a6('0x13')](_0x22378a,_0x4fef5c);});}exports[_0x29a6('0x14')]=function(_0x695718){try{utils[_0x29a6('0x15')](util[_0x29a6('0x16')](_0x29a6('0x17'),members[_0x695718[_0x29a6('0x18')]]?members[_0x695718[_0x29a6('0x18')]]['uniqueid']:_0x695718[_0x29a6('0x18')]),_0x695718);utils['info'](util[_0x29a6('0x16')](_0x29a6('0x19'),members[_0x695718[_0x29a6('0x18')]]?members[_0x695718['device']][_0x29a6('0x4')]:_0x695718['device'],_0x695718['state'],_0x695718['device']));switch(_0x695718[_0x29a6('0x1a')]){case _0x29a6('0x1b'):case _0x29a6('0x1c'):if(!startsWith(exclude,_0x695718[_0x29a6('0x18')])){members[_0x695718[_0x29a6('0x18')]]={'channel':'voice','interface':_0x695718[_0x29a6('0x18')],'type':_0x29a6('0x1d'),'enterAt':utils[_0x29a6('0x1e')](),'role':_0x29a6('0x1f')};}break;case _0x29a6('0x20'):if(!_[_0x29a6('0x21')](members[_0x695718[_0x29a6('0x18')]])){members[_0x695718['device']][_0x29a6('0x22')]=utils[_0x29a6('0x1e')]();members[_0x695718[_0x29a6('0x18')]][_0x29a6('0x23')]=utils[_0x29a6('0x24')](members[_0x695718[_0x29a6('0x18')]][_0x29a6('0x22')],members[_0x695718['device']]['enterAt']);if(members[_0x695718[_0x29a6('0x18')]][_0x29a6('0x4')]){writeDB(members[_0x695718[_0x29a6('0x18')]]);}}break;default:break;}}catch(_0x6f9041){utils[_0x29a6('0x25')](util[_0x29a6('0x16')]('[%s][members][devicestatechange]',members[_0x695718['device']]?members[_0x695718[_0x29a6('0x18')]][_0x29a6('0x4')]:_0x695718[_0x29a6('0x18')]),_0x6f9041);}};exports[_0x29a6('0x26')]=function(_0x2b6b35){try{if(!_['isNil'](members[_0x2b6b35['interface']])){utils[_0x29a6('0x15')](util[_0x29a6('0x16')](_0x29a6('0x27'),_0x2b6b35[_0x29a6('0x4')]),_0x2b6b35);utils[_0x29a6('0x28')](util[_0x29a6('0x16')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x2b6b35['uniqueid'],_0x2b6b35[_0x29a6('0x5')],_0x2b6b35[_0x29a6('0x29')]));members[_0x2b6b35[_0x29a6('0x5')]]=_[_0x29a6('0x2a')](members[_0x2b6b35[_0x29a6('0x5')]],{'data4':_0x2b6b35[_0x29a6('0x29')],'uniqueid':_0x2b6b35[_0x29a6('0x4')]});}}catch(_0x4aec1f){utils[_0x29a6('0x25')](util[_0x29a6('0x16')](_0x29a6('0x27'),_0x2b6b35[_0x29a6('0x4')]),_0x4aec1f);}};exports[_0x29a6('0x2b')]=function(_0x1abfe9){try{utils[_0x29a6('0x15')](util[_0x29a6('0x16')](_0x29a6('0x2c'),_0x1abfe9['uniqueid']),_0x1abfe9);if(_0x1abfe9[_0x29a6('0x6')]){var _0x10fc0a=_0x1abfe9[_0x29a6('0x6')][_0x29a6('0x2d')]('-')[0x0];if(!_[_0x29a6('0x21')](members[_0x10fc0a])){members[_0x10fc0a]=_[_0x29a6('0x2a')](members[_0x10fc0a],{'data1':members[_0x10fc0a][_0x29a6('0x2e')]||_0x1abfe9['type'],'data2':members[_0x10fc0a]['data2']||_0x1abfe9['source'],'data3':members[_0x10fc0a][_0x29a6('0x2f')]||_0x1abfe9[_0x29a6('0x30')],'uniqueid':members[_0x10fc0a][_0x29a6('0x4')]||_0x1abfe9[_0x29a6('0x4')]});utils[_0x29a6('0x28')](util[_0x29a6('0x16')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x1abfe9[_0x29a6('0x4')],members[_0x10fc0a][_0x29a6('0x2e')],members[_0x10fc0a]['data2'],members[_0x10fc0a][_0x29a6('0x2f')]));if(members[_0x10fc0a][_0x29a6('0x22')]){writeDB(members[_0x10fc0a]);}}}if(_0x1abfe9['destinationchannel']){var _0x479ee4=_0x1abfe9[_0x29a6('0x31')][_0x29a6('0x2d')]('-')[0x0];if(!_['isNil'](members[_0x479ee4])){members[_0x479ee4]=_[_0x29a6('0x2a')](members[_0x479ee4],{'data1':members[_0x479ee4][_0x29a6('0x2e')]||_0x1abfe9[_0x29a6('0x9')],'data2':members[_0x479ee4]['data2']||_0x1abfe9['source'],'data3':members[_0x479ee4][_0x29a6('0x2f')]||_0x1abfe9['destination'],'uniqueid':members[_0x479ee4][_0x29a6('0x4')]||_0x1abfe9[_0x29a6('0x4')]});utils['info'](util[_0x29a6('0x16')](_0x29a6('0x32'),_0x1abfe9[_0x29a6('0x4')],members[_0x479ee4][_0x29a6('0x2e')],members[_0x479ee4][_0x29a6('0x7')],members[_0x479ee4][_0x29a6('0x2f')]));if(members[_0x479ee4][_0x29a6('0x22')]){writeDB(members[_0x479ee4]);}}}}catch(_0x3621a3){utils[_0x29a6('0x25')](util[_0x29a6('0x16')](_0x29a6('0x2c'),_0x1abfe9[_0x29a6('0x4')]),_0x3621a3);}}; \ No newline at end of file +var _0xcd7c=['agentcomplete','isNil','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','debug','channel','data1','source','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data3','destinationchannel','lodash','util','Local/_attended@transfer','Queue:','info','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','data2','membername','type','getUserByInterface','then','internal','request','CreateMemberReport','split','name','catch','error','format','startsWith','devicestatechange','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','voice','TALKING','now','exitAt','duration','enterAt','[%s][members][devicestatechange]'];(function(_0x2ddc39,_0x55216){var _0x379c08=function(_0xef6a70){while(--_0xef6a70){_0x2ddc39['push'](_0x2ddc39['shift']());}};_0x379c08(++_0x55216);}(_0xcd7c,0x104));var _0xccd7=function(_0x2b857f,_0x2d903d){_0x2b857f=_0x2b857f-0x0;var _0x2f10d3=_0xcd7c[_0x2b857f];return _0x2f10d3;};'use strict';var _=require(_0xccd7('0x0'));var util=require(_0xccd7('0x1'));var utils=require('./utils');var members={};var exclude=[_0xccd7('0x2'),_0xccd7('0x3')];function writeDB(_0x14bc79){utils[_0xccd7('0x4')](util['format'](_0xccd7('0x5'),_0x14bc79[_0xccd7('0x6')],_0x14bc79[_0xccd7('0x7')],_0x14bc79['channel'],_0x14bc79[_0xccd7('0x8')],_0x14bc79[_0xccd7('0x9')],_0x14bc79[_0xccd7('0xa')]));if(_0x14bc79['interface']){utils[_0xccd7('0xb')](_0x14bc79[_0xccd7('0x7')])[_0xccd7('0xc')](function(_0x4e1e56){if(_0x4e1e56){_0x14bc79[_0xccd7('0x9')]=_0x4e1e56['name'];_0x14bc79[_0xccd7('0xd')]=_0x4e1e56[_0xccd7('0xd')];utils[_0xccd7('0xe')](_0xccd7('0xf'),_0x14bc79);}else{utils['getUserByName'](_0x14bc79[_0xccd7('0x7')][_0xccd7('0x10')]('/')[0x1])[_0xccd7('0xc')](function(_0x3951a8){if(_0x3951a8){_0x14bc79[_0xccd7('0x9')]=_0x3951a8[_0xccd7('0x11')];_0x14bc79[_0xccd7('0xd')]=_0x3951a8[_0xccd7('0xd')];utils[_0xccd7('0xe')](_0xccd7('0xf'),_0x14bc79);}});}})[_0xccd7('0x12')](function(_0x318a94){utils[_0xccd7('0x13')](util[_0xccd7('0x14')]('[%s][members][writeDB]',_0x14bc79[_0xccd7('0x6')]),_0x318a94);});}delete members[_0x14bc79[_0xccd7('0x7')]];}function startsWith(_0x204756,_0x3b8e85){return _['some'](_0x204756,function(_0x297ddd){return _[_0xccd7('0x15')](_0x3b8e85,_0x297ddd);});}exports[_0xccd7('0x16')]=function(_0x5320c8){try{utils['debug'](util[_0xccd7('0x14')]('[%s][members][devicestatechange]',members[_0x5320c8[_0xccd7('0x17')]]?members[_0x5320c8[_0xccd7('0x17')]][_0xccd7('0x6')]:_0x5320c8[_0xccd7('0x17')]),_0x5320c8);utils['info'](util[_0xccd7('0x14')](_0xccd7('0x18'),members[_0x5320c8[_0xccd7('0x17')]]?members[_0x5320c8['device']]['uniqueid']:_0x5320c8['device'],_0x5320c8[_0xccd7('0x19')],_0x5320c8['device']));switch(_0x5320c8['state']){case _0xccd7('0x1a'):case'BUSY':if(!startsWith(exclude,_0x5320c8[_0xccd7('0x17')])){members[_0x5320c8[_0xccd7('0x17')]]={'channel':_0xccd7('0x1b'),'interface':_0x5320c8['device'],'type':_0xccd7('0x1c'),'enterAt':utils[_0xccd7('0x1d')](),'role':'agent'};}break;case'NOT_INUSE':if(!_['isNil'](members[_0x5320c8[_0xccd7('0x17')]])){members[_0x5320c8[_0xccd7('0x17')]][_0xccd7('0x1e')]=utils[_0xccd7('0x1d')]();members[_0x5320c8[_0xccd7('0x17')]][_0xccd7('0x1f')]=utils['diffTime'](members[_0x5320c8[_0xccd7('0x17')]]['exitAt'],members[_0x5320c8[_0xccd7('0x17')]][_0xccd7('0x20')]);if(members[_0x5320c8['device']][_0xccd7('0x6')]){writeDB(members[_0x5320c8[_0xccd7('0x17')]]);}}break;default:break;}}catch(_0x42454c){utils['error'](util[_0xccd7('0x14')](_0xccd7('0x21'),members[_0x5320c8[_0xccd7('0x17')]]?members[_0x5320c8[_0xccd7('0x17')]][_0xccd7('0x6')]:_0x5320c8['device']),_0x42454c);}};exports[_0xccd7('0x22')]=function(_0x582958){try{if(!_[_0xccd7('0x23')](members[_0x582958[_0xccd7('0x7')]])){utils['debug'](util['format'](_0xccd7('0x24'),_0x582958[_0xccd7('0x6')]),_0x582958);utils[_0xccd7('0x4')](util[_0xccd7('0x14')](_0xccd7('0x25'),_0x582958[_0xccd7('0x6')],_0x582958[_0xccd7('0x7')],_0x582958[_0xccd7('0x26')]));members[_0x582958[_0xccd7('0x7')]]=_[_0xccd7('0x27')](members[_0x582958[_0xccd7('0x7')]],{'data4':_0x582958[_0xccd7('0x26')],'uniqueid':_0x582958['uniqueid']});}}catch(_0x1ec1df){utils[_0xccd7('0x13')](util['format'](_0xccd7('0x24'),_0x582958[_0xccd7('0x6')]),_0x1ec1df);}};exports[_0xccd7('0x28')]=function(_0x57dd5a){try{utils[_0xccd7('0x29')](util['format']('[%s][members][cdr]',_0x57dd5a[_0xccd7('0x6')]),_0x57dd5a);if(_0x57dd5a[_0xccd7('0x2a')]){var _0x54f9d7=_0x57dd5a[_0xccd7('0x2a')][_0xccd7('0x10')]('-')[0x0];if(!_['isNil'](members[_0x54f9d7])){members[_0x54f9d7]=_[_0xccd7('0x27')](members[_0x54f9d7],{'data1':members[_0x54f9d7][_0xccd7('0x2b')]||_0x57dd5a['type'],'data2':members[_0x54f9d7]['data2']||_0x57dd5a[_0xccd7('0x2c')],'data3':members[_0x54f9d7]['data3']||_0x57dd5a[_0xccd7('0x2d')],'uniqueid':members[_0x54f9d7][_0xccd7('0x6')]||_0x57dd5a[_0xccd7('0x6')]});utils[_0xccd7('0x4')](util[_0xccd7('0x14')](_0xccd7('0x2e'),_0x57dd5a[_0xccd7('0x6')],members[_0x54f9d7]['data1'],members[_0x54f9d7]['data2'],members[_0x54f9d7][_0xccd7('0x2f')]));if(members[_0x54f9d7]['exitAt']){writeDB(members[_0x54f9d7]);}}}if(_0x57dd5a[_0xccd7('0x30')]){var _0x1473c1=_0x57dd5a[_0xccd7('0x30')][_0xccd7('0x10')]('-')[0x0];if(!_['isNil'](members[_0x1473c1])){members[_0x1473c1]=_['assign'](members[_0x1473c1],{'data1':members[_0x1473c1][_0xccd7('0x2b')]||_0x57dd5a[_0xccd7('0xa')],'data2':members[_0x1473c1][_0xccd7('0x8')]||_0x57dd5a[_0xccd7('0x2c')],'data3':members[_0x1473c1][_0xccd7('0x2f')]||_0x57dd5a['destination'],'uniqueid':members[_0x1473c1]['uniqueid']||_0x57dd5a[_0xccd7('0x6')]});utils[_0xccd7('0x4')](util[_0xccd7('0x14')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x57dd5a[_0xccd7('0x6')],members[_0x1473c1][_0xccd7('0x2b')],members[_0x1473c1][_0xccd7('0x8')],members[_0x1473c1][_0xccd7('0x2f')]));if(members[_0x1473c1]['exitAt']){writeDB(members[_0x1473c1]);}}}}catch(_0x335f3e){utils['error'](util[_0xccd7('0x14')]('[%s][members][cdr]',_0x57dd5a[_0xccd7('0x6')]),_0x335f3e);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 833be48..e310b15 100644 --- a/server/services/xdr/queues.controller.js +++ b/server/services/xdr/queues.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9ba4=['[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','accountcode','queuecallerexitreason','then','type','request','CreateVoiceQueueReport','transfereduniqueid','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','position','error','hangup','isNil','debug','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','now','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','queuecallerexitAt','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','holdtime','diffTime','queuecallerjoinAt','count','connectedlinename','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','agentcomplete','assigned','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','BLIND','transferexten','extension','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','transfertype','ATTENDED','origtransfererexten','transferuniqueid','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','queuecallerenterreason','calleridnum','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format'];(function(_0x2ecebb,_0xf3a6d9){var _0xb8f864=function(_0x2af916){while(--_0x2af916){_0x2ecebb['push'](_0x2ecebb['shift']());}};_0xb8f864(++_0xf3a6d9);}(_0x9ba4,0x13c));var _0x49ba=function(_0x1e3697,_0x3e8d57){_0x1e3697=_0x1e3697-0x0;var _0x466dc7=_0x9ba4[_0x1e3697];return _0x466dc7;};'use strict';var _=require(_0x49ba('0x0'));var util=require(_0x49ba('0x1'));var utils=require(_0x49ba('0x2'));var queues={};function writeDB(_0x402ffe){utils[_0x49ba('0x3')](util[_0x49ba('0x4')](_0x49ba('0x5'),_0x402ffe[_0x49ba('0x6')],_0x402ffe[_0x49ba('0x7')],_0x402ffe[_0x49ba('0x8')],_0x402ffe[_0x49ba('0x9')],_0x402ffe['calleridnum'],_0x402ffe[_0x49ba('0xa')],_0x402ffe[_0x49ba('0xb')]));if(_0x402ffe[_0x49ba('0x8')]){utils['getVoiceQueueByName'](_0x402ffe[_0x49ba('0x8')])[_0x49ba('0xc')](function(_0x129b12){if(_0x129b12){_0x402ffe['type']=_0x129b12[_0x49ba('0xd')];}utils[_0x49ba('0xe')](_0x49ba('0xf'),_0x402ffe);});}else{utils[_0x49ba('0xe')](_0x49ba('0xf'),_0x402ffe);}if(_0x402ffe[_0x49ba('0x10')]){delete queues[_0x402ffe[_0x49ba('0x10')]];}else{delete queues[_0x402ffe['uniqueid']];}}exports['queuecallerjoin']=function(_0x3c4876){try{utils['debug'](util[_0x49ba('0x4')](_0x49ba('0x11'),_0x3c4876[_0x49ba('0x6')]),_0x3c4876);utils[_0x49ba('0x3')](util[_0x49ba('0x4')](_0x49ba('0x12'),_0x3c4876[_0x49ba('0x6')],_0x3c4876[_0x49ba('0x8')],_0x3c4876['position']));queues[_0x3c4876[_0x49ba('0x6')]]=_[_0x49ba('0x13')](_0x3c4876,{'originalposition':_0x3c4876[_0x49ba('0x14')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x321e8f){utils[_0x49ba('0x15')](util['format'](_0x49ba('0x11'),_0x3c4876[_0x49ba('0x6')]),_0x321e8f);}};exports[_0x49ba('0x16')]=function(_0x4d26d7){try{if(!_[_0x49ba('0x17')](queues[_0x4d26d7[_0x49ba('0x6')]])){utils[_0x49ba('0x18')](util[_0x49ba('0x4')]('[%s][queues][hangup]',_0x4d26d7['uniqueid']),_0x4d26d7);if(queues[_0x4d26d7[_0x49ba('0x6')]][_0x49ba('0x19')]){if(!queues[_0x4d26d7[_0x49ba('0x6')]][_0x49ba('0x1a')]&&!queues[_0x4d26d7[_0x49ba('0x6')]][_0x49ba('0x1b')]){queues[_0x4d26d7[_0x49ba('0x6')]][_0x49ba('0x1c')]=!![];queues[_0x4d26d7[_0x49ba('0x6')]][_0x49ba('0x1d')]=utils[_0x49ba('0x1e')]();queues[_0x4d26d7['uniqueid']][_0x49ba('0xb')]='COMPLETEDBYAGENT';}utils[_0x49ba('0x3')](util[_0x49ba('0x4')](_0x49ba('0x1f'),_0x4d26d7['uniqueid'],queues[_0x4d26d7[_0x49ba('0x6')]][_0x49ba('0x20')],queues[_0x4d26d7[_0x49ba('0x6')]][_0x49ba('0xb')]));writeDB(queues[_0x4d26d7[_0x49ba('0x6')]]);}else if(queues[_0x4d26d7[_0x49ba('0x6')]]['transfereduniqueid']){utils[_0x49ba('0x3')](util[_0x49ba('0x4')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x4d26d7[_0x49ba('0x6')],queues[_0x4d26d7['uniqueid']][_0x49ba('0x20')],queues[_0x4d26d7[_0x49ba('0x6')]][_0x49ba('0x10')]));queues[queues[_0x4d26d7[_0x49ba('0x6')]][_0x49ba('0x10')]]=queues[_0x4d26d7[_0x49ba('0x6')]];queues[queues[_0x4d26d7['uniqueid']][_0x49ba('0x10')]]['queuecallerenterreason']=0x2;delete queues[_0x4d26d7['uniqueid']];}}}catch(_0x2ba649){utils[_0x49ba('0x15')](util[_0x49ba('0x4')]('[%s][queues][hangup]',_0x4d26d7['uniqueid']),_0x2ba649);}};exports[_0x49ba('0x21')]=function(_0x4e07d0){try{utils[_0x49ba('0x18')](util[_0x49ba('0x4')](_0x49ba('0x22'),_0x4e07d0[_0x49ba('0x6')]),_0x4e07d0);if(!_[_0x49ba('0x17')](_0x4e07d0[_0x49ba('0x23')][_0x49ba('0x24')])&&_0x4e07d0[_0x49ba('0x25')][_0x49ba('0x26')]()!==_0x49ba('0x27')){if(!_[_0x49ba('0x17')](queues[_0x4e07d0[_0x49ba('0x6')]])){queues[_0x4e07d0[_0x49ba('0x6')]][_0x49ba('0x1a')]=![];queues[_0x4e07d0['uniqueid']][_0x49ba('0x28')]=null;queues[_0x4e07d0[_0x49ba('0x6')]][_0x49ba('0x1b')]=!![];queues[_0x4e07d0[_0x49ba('0x6')]]['queuecallerexitAt']=utils[_0x49ba('0x1e')]();queues[_0x4e07d0[_0x49ba('0x6')]][_0x49ba('0xb')]=_0x4e07d0[_0x49ba('0x25')]['toUpperCase']();utils[_0x49ba('0x3')](util['format'](_0x49ba('0x29'),_0x4e07d0['uniqueid'],queues[_0x4e07d0[_0x49ba('0x6')]][_0x49ba('0x20')],_0x4e07d0[_0x49ba('0x25')],queues[_0x4e07d0[_0x49ba('0x6')]][_0x49ba('0xb')]));writeDB(queues[_0x4e07d0[_0x49ba('0x6')]]);}}else if(!_[_0x49ba('0x17')](_0x4e07d0[_0x49ba('0x23')]['queueposition'])){if(!_[_0x49ba('0x17')](queues[_0x4e07d0[_0x49ba('0x6')]])&&!queues[_0x4e07d0[_0x49ba('0x6')]][_0x49ba('0x1a')]){queues[_0x4e07d0[_0x49ba('0x6')]][_0x49ba('0x1a')]=![];queues[_0x4e07d0[_0x49ba('0x6')]][_0x49ba('0x28')]=null;queues[_0x4e07d0[_0x49ba('0x6')]][_0x49ba('0x1b')]=!![];queues[_0x4e07d0[_0x49ba('0x6')]]['queuecallerexitAt']=utils[_0x49ba('0x1e')]();queues[_0x4e07d0[_0x49ba('0x6')]][_0x49ba('0xb')]=_0x49ba('0x2a');utils[_0x49ba('0x3')](util[_0x49ba('0x4')](_0x49ba('0x2b'),_0x4e07d0['uniqueid'],queues[_0x4e07d0[_0x49ba('0x6')]][_0x49ba('0x20')],_0x4e07d0[_0x49ba('0x25')],queues[_0x4e07d0[_0x49ba('0x6')]][_0x49ba('0xb')]));}}}catch(_0x517012){utils[_0x49ba('0x15')](util['format'](_0x49ba('0x22'),_0x4e07d0[_0x49ba('0x6')]),_0x517012);}};exports[_0x49ba('0x1a')]=function(_0x3645b8){try{if(!_['isNil'](queues[_0x3645b8[_0x49ba('0x6')]])){utils[_0x49ba('0x18')](util[_0x49ba('0x4')](_0x49ba('0x2c'),_0x3645b8[_0x49ba('0x6')]),_0x3645b8);queues[_0x3645b8[_0x49ba('0x6')]][_0x49ba('0x1b')]=![];queues[_0x3645b8[_0x49ba('0x6')]][_0x49ba('0x2d')]=null;queues[_0x3645b8[_0x49ba('0x6')]][_0x49ba('0x1a')]=!![];queues[_0x3645b8[_0x49ba('0x6')]][_0x49ba('0x28')]=utils[_0x49ba('0x1e')]();queues[_0x3645b8[_0x49ba('0x6')]][_0x49ba('0xb')]=_0x49ba('0x2e');utils[_0x49ba('0x3')](util[_0x49ba('0x4')](_0x49ba('0x2f'),_0x3645b8['uniqueid'],queues[_0x3645b8[_0x49ba('0x6')]][_0x49ba('0x20')],queues[_0x3645b8[_0x49ba('0x6')]][_0x49ba('0xb')]));}}catch(_0x53ec67){utils['error'](util[_0x49ba('0x4')]('[%s][queues][queuecallerabandon]',_0x3645b8['uniqueid']),_0x53ec67);}};exports[_0x49ba('0x30')]=function(_0x4ec8ff){try{if(!_[_0x49ba('0x17')](queues[_0x4ec8ff[_0x49ba('0x6')]])){utils[_0x49ba('0x18')](util[_0x49ba('0x4')](_0x49ba('0x31'),_0x4ec8ff[_0x49ba('0x6')]),_0x4ec8ff);utils['info'](util['format'](_0x49ba('0x32'),_0x4ec8ff['uniqueid'],queues[_0x4ec8ff[_0x49ba('0x6')]]['name'],_0x4ec8ff[_0x49ba('0x33')],_0x4ec8ff['connectedlinename']));queues[_0x4ec8ff['uniqueid']]['queuecallerleave']=!![];queues[_0x4ec8ff[_0x49ba('0x6')]][_0x49ba('0x19')]=utils[_0x49ba('0x1e')]();queues[_0x4ec8ff['uniqueid']][_0x49ba('0x34')]=utils[_0x49ba('0x35')](queues[_0x4ec8ff['uniqueid']][_0x49ba('0x19')],queues[_0x4ec8ff[_0x49ba('0x6')]][_0x49ba('0x36')]);queues[_0x4ec8ff['uniqueid']][_0x49ba('0x14')]=_0x4ec8ff[_0x49ba('0x14')];queues[_0x4ec8ff[_0x49ba('0x6')]][_0x49ba('0x37')]=_0x4ec8ff[_0x49ba('0x37')];queues[_0x4ec8ff[_0x49ba('0x6')]][_0x49ba('0x33')]=_0x4ec8ff['connectedlinenum'];queues[_0x4ec8ff[_0x49ba('0x6')]]['connectedlinename']=_0x4ec8ff[_0x49ba('0x38')];}}catch(_0x3e7ede){utils[_0x49ba('0x15')](util['format']('[%s][queues][queuecallerleave]',_0x4ec8ff['uniqueid']),_0x3e7ede);}};exports['agentconnect']=function(_0x23ef34){try{if(!_[_0x49ba('0x17')](queues[_0x23ef34[_0x49ba('0x6')]])){utils[_0x49ba('0x18')](util[_0x49ba('0x4')](_0x49ba('0x39'),_0x23ef34[_0x49ba('0x6')]),_0x23ef34);utils[_0x49ba('0x3')](util['format'](_0x49ba('0x3a'),_0x23ef34['uniqueid'],queues[_0x23ef34['uniqueid']][_0x49ba('0x20')],_0x23ef34[_0x49ba('0x3b')],_0x23ef34[_0x49ba('0x3c')]));queues[_0x23ef34[_0x49ba('0x6')]][_0x49ba('0x1a')]=![];queues[_0x23ef34['uniqueid']][_0x49ba('0x1a')]=![];queues[_0x23ef34['uniqueid']][_0x49ba('0x28')]=null;queues[_0x23ef34[_0x49ba('0x6')]][_0x49ba('0x1b')]=![];queues[_0x23ef34['uniqueid']][_0x49ba('0xb')]=null;queues[_0x23ef34[_0x49ba('0x6')]]['queuecallerexitAt']=null;queues[_0x23ef34[_0x49ba('0x6')]]['assigned']=!![];queues[_0x23ef34[_0x49ba('0x6')]][_0x49ba('0xa')]=_0x23ef34[_0x49ba('0x3c')];queues[_0x23ef34['uniqueid']][_0x49ba('0x9')]=_0x23ef34[_0x49ba('0x3b')];}}catch(_0x3d2771){utils[_0x49ba('0x15')](util['format']('[%s][queues][agentconnect]',_0x23ef34[_0x49ba('0x6')]),_0x3d2771);}};exports[_0x49ba('0x3d')]=function(_0x54fa57){try{if(!_[_0x49ba('0x17')](queues[_0x54fa57[_0x49ba('0x6')]])){if(queues[_0x54fa57[_0x49ba('0x6')]][_0x49ba('0x19')]){utils['debug'](util[_0x49ba('0x4')]('[%s][queues][agentcomplete]',_0x54fa57[_0x49ba('0x6')]),_0x54fa57);queues[_0x54fa57[_0x49ba('0x6')]][_0x49ba('0x1a')]=![];queues[_0x54fa57[_0x49ba('0x6')]][_0x49ba('0x1a')]=![];queues[_0x54fa57[_0x49ba('0x6')]][_0x49ba('0x28')]=null;queues[_0x54fa57[_0x49ba('0x6')]][_0x49ba('0x1b')]=![];queues[_0x54fa57[_0x49ba('0x6')]]['queuecallerexitAt']=null;queues[_0x54fa57[_0x49ba('0x6')]][_0x49ba('0x3e')]=!![];queues[_0x54fa57[_0x49ba('0x6')]][_0x49ba('0x9')]=_0x54fa57['membername'];queues[_0x54fa57['uniqueid']]['queuecallercomplete']=!![];queues[_0x54fa57[_0x49ba('0x6')]][_0x49ba('0x1d')]=utils[_0x49ba('0x1e')]();if(_0x54fa57[_0x49ba('0x3f')]==_0x49ba('0x40')){if(!queues[_0x54fa57['uniqueid']][_0x49ba('0x40')]){queues[_0x54fa57[_0x49ba('0x6')]][_0x49ba('0xb')]=_0x49ba('0x41');}}else{queues[_0x54fa57['uniqueid']][_0x49ba('0xb')]=_0x49ba('0x42')+_0x54fa57[_0x49ba('0x3f')][_0x49ba('0x26')]();}utils[_0x49ba('0x3')](util[_0x49ba('0x4')](_0x49ba('0x43'),_0x54fa57[_0x49ba('0x6')],queues[_0x54fa57[_0x49ba('0x6')]]['name'],_0x54fa57[_0x49ba('0x3b')],queues[_0x54fa57[_0x49ba('0x6')]][_0x49ba('0xb')]));writeDB(queues[_0x54fa57[_0x49ba('0x6')]]);}}}catch(_0xb95218){utils[_0x49ba('0x15')](util['format'](_0x49ba('0x44'),_0x54fa57[_0x49ba('0x6')]),_0xb95218);}};exports[_0x49ba('0x45')]=function(_0x154ae8){try{if(!_[_0x49ba('0x17')](queues[_0x154ae8[_0x49ba('0x46')]])){utils['debug'](util[_0x49ba('0x4')](_0x49ba('0x47'),_0x154ae8[_0x49ba('0x6')]),_0x154ae8);queues[_0x154ae8[_0x49ba('0x46')]][_0x49ba('0x40')]=!![];queues[_0x154ae8[_0x49ba('0x46')]]['transfertype']=_0x49ba('0x48');queues[_0x154ae8['transfereeuniqueid']][_0x49ba('0x49')]=_0x154ae8[_0x49ba('0x4a')];queues[_0x154ae8[_0x49ba('0x46')]]['transferuniqueid']=_0x154ae8[_0x49ba('0x46')];queues[_0x154ae8[_0x49ba('0x46')]][_0x49ba('0xb')]='BLINDTRANSFER';utils[_0x49ba('0x3')](util[_0x49ba('0x4')](_0x49ba('0x4b'),_0x154ae8[_0x49ba('0x6')],queues[_0x154ae8[_0x49ba('0x46')]][_0x49ba('0x20')],_0x154ae8[_0x49ba('0x46')],_0x154ae8[_0x49ba('0x4a')]));}}catch(_0x48a5a7){utils[_0x49ba('0x15')](util['format']('[%s][queues][blindtransfer]',_0x154ae8[_0x49ba('0x6')]),_0x48a5a7);}};exports[_0x49ba('0x4c')]=function(_0x2e9104){try{utils[_0x49ba('0x18')](util[_0x49ba('0x4')](_0x49ba('0x4d'),_0x2e9104[_0x49ba('0x4e')]),_0x2e9104);if(_0x2e9104['origtransfereruniqueid']==_0x2e9104[_0x49ba('0x4f')]){if(!_[_0x49ba('0x17')](queues[_0x2e9104[_0x49ba('0x50')]])){utils[_0x49ba('0x3')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x2e9104[_0x49ba('0x4e')],queues[_0x2e9104[_0x49ba('0x50')]][_0x49ba('0x20')],_0x2e9104['origtransfererexten']));queues[_0x2e9104[_0x49ba('0x50')]][_0x49ba('0x40')]=!![];queues[_0x2e9104['secondtransfererlinkedid']][_0x49ba('0x51')]=_0x49ba('0x52');queues[_0x2e9104[_0x49ba('0x50')]][_0x49ba('0x49')]=_0x2e9104[_0x49ba('0x53')];queues[_0x2e9104[_0x49ba('0x50')]][_0x49ba('0x54')]=_0x2e9104[_0x49ba('0x4e')];queues[_0x2e9104[_0x49ba('0x50')]][_0x49ba('0xb')]=_0x49ba('0x55');}if(!_[_0x49ba('0x17')](queues[_0x2e9104[_0x49ba('0x4f')]])){if(_0x2e9104[_0x49ba('0x56')]&&queues[_0x2e9104[_0x49ba('0x56')]]){queues[_0x2e9104['transfereelinkedid']]['queuecallerenterreason']=0x1;queues[_0x2e9104['transfereeuniqueid']]=_[_0x49ba('0x57')](queues[_0x2e9104[_0x49ba('0x56')]]);queues[_0x2e9104['transfereeuniqueid']][_0x49ba('0x10')]=_0x2e9104[_0x49ba('0x58')];queues[_0x2e9104[_0x49ba('0x46')]][_0x49ba('0x59')]=0x2;queues[_0x2e9104[_0x49ba('0x46')]][_0x49ba('0x5a')]=queues[_0x2e9104[_0x49ba('0x50')]][_0x49ba('0x5a')];queues[_0x2e9104[_0x49ba('0x46')]][_0x49ba('0x5b')]=queues[_0x2e9104['secondtransfererlinkedid']][_0x49ba('0x5b')];queues[_0x2e9104[_0x49ba('0x46')]][_0x49ba('0x36')]=utils['now']();queues[_0x2e9104['transfereeuniqueid']][_0x49ba('0x19')]=utils[_0x49ba('0x1e')]();queues[_0x2e9104[_0x49ba('0x46')]][_0x49ba('0x34')]=0x0;queues[_0x2e9104['transfereeuniqueid']]['mohtime']=0x0;utils[_0x49ba('0x3')](util[_0x49ba('0x4')](_0x49ba('0x5c'),_0x2e9104[_0x49ba('0x4e')],queues[_0x2e9104[_0x49ba('0x46')]][_0x49ba('0x20')],queues[_0x2e9104[_0x49ba('0x46')]][_0x49ba('0x5a')],queues[_0x2e9104[_0x49ba('0x46')]]['calleridname']));}else{utils['info'](util[_0x49ba('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x2e9104[_0x49ba('0x4e')],queues[_0x2e9104['origtransfererlinkedid']][_0x49ba('0x20')],_0x2e9104[_0x49ba('0x50')]));queues[_0x2e9104['origtransfererlinkedid']]['transfereduniqueid']=_0x2e9104[_0x49ba('0x50')];}}}else if(_0x2e9104['secondtransfereruniqueid']==_0x2e9104[_0x49ba('0x50')]){if(!_[_0x49ba('0x17')](queues[_0x2e9104[_0x49ba('0x4f')]])){utils[_0x49ba('0x3')](util[_0x49ba('0x4')](_0x49ba('0x5d'),_0x2e9104[_0x49ba('0x4e')],queues[_0x2e9104[_0x49ba('0x4f')]][_0x49ba('0x20')],_0x2e9104[_0x49ba('0x5e')],_0x2e9104[_0x49ba('0x5f')]));queues[_0x2e9104['origtransfererlinkedid']][_0x49ba('0x40')]=!![];queues[_0x2e9104[_0x49ba('0x4f')]]['transfertype']=_0x49ba('0x52');queues[_0x2e9104[_0x49ba('0x4f')]][_0x49ba('0x49')]=_0x2e9104[_0x49ba('0x5f')];queues[_0x2e9104['origtransfererlinkedid']][_0x49ba('0x54')]=_0x2e9104[_0x49ba('0x5e')];queues[_0x2e9104[_0x49ba('0x4f')]][_0x49ba('0xb')]=_0x49ba('0x55');}if(!_[_0x49ba('0x17')](queues[_0x2e9104[_0x49ba('0x50')]])){if(_0x2e9104[_0x49ba('0x60')]&&queues[_0x2e9104[_0x49ba('0x60')]]){queues[_0x2e9104['transfertargetlinkedid']][_0x49ba('0x59')]=0x1;queues[_0x2e9104['transfertargetuniqueid']]=_[_0x49ba('0x57')](queues[_0x2e9104[_0x49ba('0x60')]]);queues[_0x2e9104[_0x49ba('0x58')]][_0x49ba('0x10')]=_0x2e9104[_0x49ba('0x58')];queues[_0x2e9104[_0x49ba('0x58')]][_0x49ba('0x59')]=0x2;queues[_0x2e9104['transfertargetuniqueid']]['calleridnum']=queues[_0x2e9104['origtransfererlinkedid']][_0x49ba('0x5a')];queues[_0x2e9104[_0x49ba('0x58')]][_0x49ba('0x5b')]=queues[_0x2e9104[_0x49ba('0x4f')]][_0x49ba('0x5b')];queues[_0x2e9104[_0x49ba('0x58')]][_0x49ba('0x36')]=utils[_0x49ba('0x1e')]();queues[_0x2e9104[_0x49ba('0x58')]]['queuecallerleaveAt']=utils[_0x49ba('0x1e')]();queues[_0x2e9104[_0x49ba('0x58')]][_0x49ba('0x34')]=0x0;queues[_0x2e9104[_0x49ba('0x58')]][_0x49ba('0x61')]=0x0;utils[_0x49ba('0x3')](util[_0x49ba('0x4')](_0x49ba('0x62'),_0x2e9104[_0x49ba('0x4e')],queues[_0x2e9104[_0x49ba('0x58')]]['name'],queues[_0x2e9104['transfertargetuniqueid']]['transfereduniqueid'],queues[_0x2e9104[_0x49ba('0x58')]]['calleridnum'],queues[_0x2e9104['transfertargetuniqueid']]['calleridname']));}else{utils['info'](util['format'](_0x49ba('0x63'),_0x2e9104[_0x49ba('0x4e')],queues[_0x2e9104['secondtransfererlinkedid']][_0x49ba('0x20')],_0x2e9104[_0x49ba('0x4f')]));queues[_0x2e9104[_0x49ba('0x50')]][_0x49ba('0x10')]=_0x2e9104[_0x49ba('0x4f')];}}}}catch(_0x89c81d){utils[_0x49ba('0x15')](util[_0x49ba('0x4')](_0x49ba('0x4d'),_0x2e9104[_0x49ba('0x4e')]),_0x89c81d);}};exports[_0x49ba('0x64')]=function(_0x526575){try{if(!_[_0x49ba('0x17')](queues[_0x526575[_0x49ba('0x6')]])){utils[_0x49ba('0x18')](util[_0x49ba('0x4')](_0x49ba('0x65'),_0x526575[_0x49ba('0x6')]),_0x526575);queues[_0x526575[_0x49ba('0x6')]][_0x49ba('0x66')]=utils[_0x49ba('0x1e')]();utils[_0x49ba('0x3')](util[_0x49ba('0x4')](_0x49ba('0x67'),_0x526575[_0x49ba('0x6')],queues[_0x526575[_0x49ba('0x6')]]['name'],queues[_0x526575['uniqueid']][_0x49ba('0x66')]));}}catch(_0x42b245){utils[_0x49ba('0x15')](util[_0x49ba('0x4')](_0x49ba('0x65'),_0x526575[_0x49ba('0x6')]),_0x42b245);}};exports[_0x49ba('0x68')]=function(_0x51ddce){try{if(!_[_0x49ba('0x17')](queues[_0x51ddce[_0x49ba('0x6')]])){if(!_['isNil'](queues[_0x51ddce[_0x49ba('0x6')]][_0x49ba('0x66')])){utils[_0x49ba('0x18')](util['format'](_0x49ba('0x69'),_0x51ddce[_0x49ba('0x6')]),_0x51ddce);queues[_0x51ddce['uniqueid']][_0x49ba('0x61')]+=utils[_0x49ba('0x35')](utils[_0x49ba('0x1e')](),queues[_0x51ddce[_0x49ba('0x6')]]['musiconholdstartAt']);utils[_0x49ba('0x3')](util[_0x49ba('0x4')](_0x49ba('0x6a'),_0x51ddce[_0x49ba('0x6')],queues[_0x51ddce[_0x49ba('0x6')]]['name'],queues[_0x51ddce[_0x49ba('0x6')]][_0x49ba('0x61')]));delete queues[_0x51ddce[_0x49ba('0x6')]]['musiconholdstartAt'];}}}catch(_0x27a1b9){utils['error'](util['format'](_0x49ba('0x69'),_0x51ddce[_0x49ba('0x6')]),_0x27a1b9);}}; \ No newline at end of file +var _0x077f=['queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','varset','[%s][queues][varset]','isNil','variable','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','lastAssignedTo','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererlinkedid','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','queuecallerenterreason','clone','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','calleridname','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','[%s][queues][musiconholdstop]','lodash','./utils','info','format','uniqueid','channel','queue','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','position','assign','now','error','[%s][queues][queuecallerjoin]','hangup','[%s][queues][hangup]','queuecallerleaveAt'];(function(_0x28a2d8,_0x4d9575){var _0x24d1c3=function(_0x11d4d6){while(--_0x11d4d6){_0x28a2d8['push'](_0x28a2d8['shift']());}};_0x24d1c3(++_0x4d9575);}(_0x077f,0x1f3));var _0xf077=function(_0x3db9e4,_0x6b851a){_0x3db9e4=_0x3db9e4-0x0;var _0x1172ca=_0x077f[_0x3db9e4];return _0x1172ca;};'use strict';var _=require(_0xf077('0x0'));var util=require('util');var utils=require(_0xf077('0x1'));var queues={};function writeDB(_0x11540e){utils[_0xf077('0x2')](util[_0xf077('0x3')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x11540e[_0xf077('0x4')],_0x11540e[_0xf077('0x5')],_0x11540e[_0xf077('0x6')],_0x11540e['lastAssignedTo'],_0x11540e[_0xf077('0x7')],_0x11540e[_0xf077('0x8')],_0x11540e[_0xf077('0x9')]));if(_0x11540e[_0xf077('0x6')]){utils[_0xf077('0xa')](_0x11540e[_0xf077('0x6')])[_0xf077('0xb')](function(_0x167d28){if(_0x167d28){_0x11540e[_0xf077('0xc')]=_0x167d28[_0xf077('0xc')];}utils[_0xf077('0xd')](_0xf077('0xe'),_0x11540e);});}else{utils['request'](_0xf077('0xe'),_0x11540e);}if(_0x11540e[_0xf077('0xf')]){delete queues[_0x11540e[_0xf077('0xf')]];}else{delete queues[_0x11540e[_0xf077('0x4')]];}}exports[_0xf077('0x10')]=function(_0x4e77ef){try{utils[_0xf077('0x11')](util[_0xf077('0x3')]('[%s][queues][queuecallerjoin]',_0x4e77ef['uniqueid']),_0x4e77ef);utils[_0xf077('0x2')](util[_0xf077('0x3')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x4e77ef[_0xf077('0x4')],_0x4e77ef[_0xf077('0x6')],_0x4e77ef[_0xf077('0x12')]));queues[_0x4e77ef[_0xf077('0x4')]]=_[_0xf077('0x13')](_0x4e77ef,{'originalposition':_0x4e77ef[_0xf077('0x12')],'queuecallerjoinAt':utils[_0xf077('0x14')](),'mohtime':0x0});}catch(_0x219592){utils[_0xf077('0x15')](util[_0xf077('0x3')](_0xf077('0x16'),_0x4e77ef[_0xf077('0x4')]),_0x219592);}};exports[_0xf077('0x17')]=function(_0x19ba65){try{if(!_['isNil'](queues[_0x19ba65[_0xf077('0x4')]])){utils['debug'](util['format'](_0xf077('0x18'),_0x19ba65[_0xf077('0x4')]),_0x19ba65);if(queues[_0x19ba65[_0xf077('0x4')]][_0xf077('0x19')]){if(!queues[_0x19ba65[_0xf077('0x4')]][_0xf077('0x1a')]&&!queues[_0x19ba65['uniqueid']][_0xf077('0x1b')]){queues[_0x19ba65[_0xf077('0x4')]][_0xf077('0x1c')]=!![];queues[_0x19ba65[_0xf077('0x4')]][_0xf077('0x1d')]=utils[_0xf077('0x14')]();queues[_0x19ba65[_0xf077('0x4')]][_0xf077('0x9')]='COMPLETEDBYAGENT';}utils[_0xf077('0x2')](util[_0xf077('0x3')](_0xf077('0x1e'),_0x19ba65['uniqueid'],queues[_0x19ba65['uniqueid']][_0xf077('0x1f')],queues[_0x19ba65[_0xf077('0x4')]][_0xf077('0x9')]));writeDB(queues[_0x19ba65[_0xf077('0x4')]]);}else if(queues[_0x19ba65[_0xf077('0x4')]]['transfereduniqueid']){utils['info'](util[_0xf077('0x3')](_0xf077('0x20'),_0x19ba65['uniqueid'],queues[_0x19ba65[_0xf077('0x4')]]['name'],queues[_0x19ba65[_0xf077('0x4')]][_0xf077('0xf')]));queues[queues[_0x19ba65[_0xf077('0x4')]][_0xf077('0xf')]]=queues[_0x19ba65[_0xf077('0x4')]];queues[queues[_0x19ba65[_0xf077('0x4')]][_0xf077('0xf')]]['queuecallerenterreason']=0x2;delete queues[_0x19ba65['uniqueid']];}}}catch(_0x5bc38c){utils[_0xf077('0x15')](util[_0xf077('0x3')](_0xf077('0x18'),_0x19ba65[_0xf077('0x4')]),_0x5bc38c);}};exports[_0xf077('0x21')]=function(_0x487b65){try{utils[_0xf077('0x11')](util[_0xf077('0x3')](_0xf077('0x22'),_0x487b65[_0xf077('0x4')]),_0x487b65);if(!_[_0xf077('0x23')](_0x487b65[_0xf077('0x24')]['queuestatus'])&&_0x487b65[_0xf077('0x25')][_0xf077('0x26')]()!==_0xf077('0x27')){if(!_[_0xf077('0x23')](queues[_0x487b65[_0xf077('0x4')]])){queues[_0x487b65[_0xf077('0x4')]][_0xf077('0x1a')]=![];queues[_0x487b65[_0xf077('0x4')]][_0xf077('0x28')]=null;queues[_0x487b65['uniqueid']][_0xf077('0x1b')]=!![];queues[_0x487b65[_0xf077('0x4')]][_0xf077('0x29')]=utils['now']();queues[_0x487b65['uniqueid']]['queuecallerexitreason']=_0x487b65[_0xf077('0x25')][_0xf077('0x26')]();utils['info'](util['format'](_0xf077('0x2a'),_0x487b65[_0xf077('0x4')],queues[_0x487b65['uniqueid']][_0xf077('0x1f')],_0x487b65[_0xf077('0x25')],queues[_0x487b65[_0xf077('0x4')]]['queuecallerexitreason']));writeDB(queues[_0x487b65['uniqueid']]);}}else if(!_[_0xf077('0x23')](_0x487b65[_0xf077('0x24')]['queueposition'])){if(!_[_0xf077('0x23')](queues[_0x487b65['uniqueid']])&&!queues[_0x487b65[_0xf077('0x4')]]['queuecallerabandon']){queues[_0x487b65[_0xf077('0x4')]][_0xf077('0x1a')]=![];queues[_0x487b65[_0xf077('0x4')]][_0xf077('0x28')]=null;queues[_0x487b65['uniqueid']][_0xf077('0x1b')]=!![];queues[_0x487b65['uniqueid']][_0xf077('0x29')]=utils[_0xf077('0x14')]();queues[_0x487b65[_0xf077('0x4')]][_0xf077('0x9')]=_0xf077('0x2b');utils[_0xf077('0x2')](util[_0xf077('0x3')](_0xf077('0x2c'),_0x487b65[_0xf077('0x4')],queues[_0x487b65[_0xf077('0x4')]][_0xf077('0x1f')],_0x487b65['value'],queues[_0x487b65[_0xf077('0x4')]][_0xf077('0x9')]));}}}catch(_0x11e4eb){utils['error'](util[_0xf077('0x3')](_0xf077('0x22'),_0x487b65['uniqueid']),_0x11e4eb);}};exports[_0xf077('0x1a')]=function(_0x146e55){try{if(!_[_0xf077('0x23')](queues[_0x146e55[_0xf077('0x4')]])){utils[_0xf077('0x11')](util[_0xf077('0x3')](_0xf077('0x2d'),_0x146e55[_0xf077('0x4')]),_0x146e55);queues[_0x146e55['uniqueid']]['queuecallerexit']=![];queues[_0x146e55[_0xf077('0x4')]]['queuecallerexitAt']=null;queues[_0x146e55[_0xf077('0x4')]][_0xf077('0x1a')]=!![];queues[_0x146e55[_0xf077('0x4')]][_0xf077('0x28')]=utils[_0xf077('0x14')]();queues[_0x146e55[_0xf077('0x4')]][_0xf077('0x9')]=_0xf077('0x2e');utils[_0xf077('0x2')](util[_0xf077('0x3')](_0xf077('0x2f'),_0x146e55['uniqueid'],queues[_0x146e55[_0xf077('0x4')]][_0xf077('0x1f')],queues[_0x146e55['uniqueid']][_0xf077('0x9')]));}}catch(_0x3b7610){utils['error'](util['format'](_0xf077('0x2d'),_0x146e55['uniqueid']),_0x3b7610);}};exports[_0xf077('0x30')]=function(_0xd99b4d){try{if(!_[_0xf077('0x23')](queues[_0xd99b4d['uniqueid']])){utils['debug'](util[_0xf077('0x3')](_0xf077('0x31'),_0xd99b4d[_0xf077('0x4')]),_0xd99b4d);utils['info'](util[_0xf077('0x3')](_0xf077('0x32'),_0xd99b4d[_0xf077('0x4')],queues[_0xd99b4d['uniqueid']][_0xf077('0x1f')],_0xd99b4d[_0xf077('0x33')],_0xd99b4d[_0xf077('0x34')]));queues[_0xd99b4d[_0xf077('0x4')]][_0xf077('0x30')]=!![];queues[_0xd99b4d[_0xf077('0x4')]][_0xf077('0x19')]=utils[_0xf077('0x14')]();queues[_0xd99b4d[_0xf077('0x4')]][_0xf077('0x35')]=utils[_0xf077('0x36')](queues[_0xd99b4d[_0xf077('0x4')]][_0xf077('0x19')],queues[_0xd99b4d[_0xf077('0x4')]][_0xf077('0x37')]);queues[_0xd99b4d['uniqueid']][_0xf077('0x12')]=_0xd99b4d['position'];queues[_0xd99b4d[_0xf077('0x4')]][_0xf077('0x38')]=_0xd99b4d[_0xf077('0x38')];queues[_0xd99b4d['uniqueid']]['connectedlinenum']=_0xd99b4d[_0xf077('0x33')];queues[_0xd99b4d[_0xf077('0x4')]]['connectedlinename']=_0xd99b4d[_0xf077('0x34')];}}catch(_0x5ac7ea){utils['error'](util[_0xf077('0x3')](_0xf077('0x31'),_0xd99b4d[_0xf077('0x4')]),_0x5ac7ea);}};exports[_0xf077('0x39')]=function(_0x1a9ea1){try{if(!_[_0xf077('0x23')](queues[_0x1a9ea1[_0xf077('0x4')]])){utils[_0xf077('0x11')](util['format'](_0xf077('0x3a'),_0x1a9ea1[_0xf077('0x4')]),_0x1a9ea1);utils['info'](util[_0xf077('0x3')](_0xf077('0x3b'),_0x1a9ea1[_0xf077('0x4')],queues[_0x1a9ea1[_0xf077('0x4')]]['name'],_0x1a9ea1[_0xf077('0x3c')],_0x1a9ea1[_0xf077('0x3d')]));queues[_0x1a9ea1[_0xf077('0x4')]][_0xf077('0x1a')]=![];queues[_0x1a9ea1[_0xf077('0x4')]]['queuecallerabandon']=![];queues[_0x1a9ea1['uniqueid']][_0xf077('0x28')]=null;queues[_0x1a9ea1[_0xf077('0x4')]][_0xf077('0x1b')]=![];queues[_0x1a9ea1[_0xf077('0x4')]][_0xf077('0x9')]=null;queues[_0x1a9ea1[_0xf077('0x4')]]['queuecallerexitAt']=null;queues[_0x1a9ea1[_0xf077('0x4')]][_0xf077('0x3e')]=!![];queues[_0x1a9ea1[_0xf077('0x4')]][_0xf077('0x8')]=_0x1a9ea1[_0xf077('0x3d')];queues[_0x1a9ea1['uniqueid']][_0xf077('0x3f')]=_0x1a9ea1[_0xf077('0x3c')];}}catch(_0x340d5c){utils[_0xf077('0x15')](util[_0xf077('0x3')](_0xf077('0x3a'),_0x1a9ea1[_0xf077('0x4')]),_0x340d5c);}};exports['agentcomplete']=function(_0x9dedf7){try{if(!_['isNil'](queues[_0x9dedf7[_0xf077('0x4')]])){if(queues[_0x9dedf7[_0xf077('0x4')]][_0xf077('0x19')]){utils[_0xf077('0x11')](util[_0xf077('0x3')](_0xf077('0x40'),_0x9dedf7[_0xf077('0x4')]),_0x9dedf7);queues[_0x9dedf7[_0xf077('0x4')]][_0xf077('0x1a')]=![];queues[_0x9dedf7[_0xf077('0x4')]][_0xf077('0x1a')]=![];queues[_0x9dedf7[_0xf077('0x4')]][_0xf077('0x28')]=null;queues[_0x9dedf7[_0xf077('0x4')]][_0xf077('0x1b')]=![];queues[_0x9dedf7['uniqueid']][_0xf077('0x29')]=null;queues[_0x9dedf7[_0xf077('0x4')]]['assigned']=!![];queues[_0x9dedf7[_0xf077('0x4')]][_0xf077('0x3f')]=_0x9dedf7[_0xf077('0x3c')];queues[_0x9dedf7[_0xf077('0x4')]][_0xf077('0x1c')]=!![];queues[_0x9dedf7['uniqueid']][_0xf077('0x1d')]=utils[_0xf077('0x14')]();if(_0x9dedf7[_0xf077('0x41')]==_0xf077('0x42')){if(!queues[_0x9dedf7[_0xf077('0x4')]][_0xf077('0x42')]){queues[_0x9dedf7[_0xf077('0x4')]][_0xf077('0x9')]=_0xf077('0x43');}}else{queues[_0x9dedf7[_0xf077('0x4')]][_0xf077('0x9')]=_0xf077('0x44')+_0x9dedf7['reason'][_0xf077('0x26')]();}utils[_0xf077('0x2')](util[_0xf077('0x3')](_0xf077('0x45'),_0x9dedf7['uniqueid'],queues[_0x9dedf7['uniqueid']]['name'],_0x9dedf7[_0xf077('0x3c')],queues[_0x9dedf7[_0xf077('0x4')]][_0xf077('0x9')]));writeDB(queues[_0x9dedf7[_0xf077('0x4')]]);}}}catch(_0x4a554a){utils['error'](util[_0xf077('0x3')](_0xf077('0x40'),_0x9dedf7[_0xf077('0x4')]),_0x4a554a);}};exports[_0xf077('0x46')]=function(_0x335b38){try{if(!_[_0xf077('0x23')](queues[_0x335b38[_0xf077('0x47')]])){utils['debug'](util[_0xf077('0x3')](_0xf077('0x48'),_0x335b38[_0xf077('0x4')]),_0x335b38);queues[_0x335b38[_0xf077('0x47')]][_0xf077('0x42')]=!![];queues[_0x335b38[_0xf077('0x47')]][_0xf077('0x49')]=_0xf077('0x4a');queues[_0x335b38[_0xf077('0x47')]][_0xf077('0x4b')]=_0x335b38[_0xf077('0x4c')];queues[_0x335b38[_0xf077('0x47')]][_0xf077('0x4d')]=_0x335b38[_0xf077('0x47')];queues[_0x335b38[_0xf077('0x47')]][_0xf077('0x9')]=_0xf077('0x4e');utils[_0xf077('0x2')](util['format'](_0xf077('0x4f'),_0x335b38[_0xf077('0x4')],queues[_0x335b38[_0xf077('0x47')]][_0xf077('0x1f')],_0x335b38[_0xf077('0x47')],_0x335b38[_0xf077('0x4c')]));}}catch(_0x5643a5){utils[_0xf077('0x15')](util[_0xf077('0x3')](_0xf077('0x48'),_0x335b38[_0xf077('0x4')]),_0x5643a5);}};exports[_0xf077('0x50')]=function(_0x55db6b){try{utils[_0xf077('0x11')](util[_0xf077('0x3')](_0xf077('0x51'),_0x55db6b[_0xf077('0x52')]),_0x55db6b);if(_0x55db6b[_0xf077('0x52')]==_0x55db6b[_0xf077('0x53')]){if(!_['isNil'](queues[_0x55db6b['secondtransfererlinkedid']])){utils[_0xf077('0x2')](util[_0xf077('0x3')](_0xf077('0x54'),_0x55db6b[_0xf077('0x52')],queues[_0x55db6b[_0xf077('0x55')]]['name'],_0x55db6b[_0xf077('0x56')]));queues[_0x55db6b[_0xf077('0x55')]][_0xf077('0x42')]=!![];queues[_0x55db6b[_0xf077('0x55')]][_0xf077('0x49')]=_0xf077('0x57');queues[_0x55db6b[_0xf077('0x55')]][_0xf077('0x4b')]=_0x55db6b['origtransfererexten'];queues[_0x55db6b[_0xf077('0x55')]][_0xf077('0x4d')]=_0x55db6b[_0xf077('0x52')];queues[_0x55db6b['secondtransfererlinkedid']]['queuecallerexitreason']=_0xf077('0x58');}if(!_['isNil'](queues[_0x55db6b[_0xf077('0x53')]])){if(_0x55db6b[_0xf077('0x59')]&&queues[_0x55db6b[_0xf077('0x59')]]){queues[_0x55db6b[_0xf077('0x59')]][_0xf077('0x5a')]=0x1;queues[_0x55db6b['transfereeuniqueid']]=_[_0xf077('0x5b')](queues[_0x55db6b['transfereelinkedid']]);queues[_0x55db6b[_0xf077('0x47')]]['transfereduniqueid']=_0x55db6b['transfertargetuniqueid'];queues[_0x55db6b[_0xf077('0x47')]][_0xf077('0x5a')]=0x2;queues[_0x55db6b[_0xf077('0x47')]][_0xf077('0x7')]=queues[_0x55db6b['secondtransfererlinkedid']][_0xf077('0x7')];queues[_0x55db6b[_0xf077('0x47')]]['calleridname']=queues[_0x55db6b[_0xf077('0x55')]]['calleridname'];queues[_0x55db6b[_0xf077('0x47')]][_0xf077('0x37')]=utils[_0xf077('0x14')]();queues[_0x55db6b[_0xf077('0x47')]][_0xf077('0x19')]=utils[_0xf077('0x14')]();queues[_0x55db6b[_0xf077('0x47')]]['holdtime']=0x0;queues[_0x55db6b[_0xf077('0x47')]][_0xf077('0x5c')]=0x0;utils[_0xf077('0x2')](util[_0xf077('0x3')](_0xf077('0x5d'),_0x55db6b[_0xf077('0x52')],queues[_0x55db6b[_0xf077('0x47')]][_0xf077('0x1f')],queues[_0x55db6b[_0xf077('0x47')]][_0xf077('0x7')],queues[_0x55db6b[_0xf077('0x47')]]['calleridname']));}else{utils[_0xf077('0x2')](util[_0xf077('0x3')](_0xf077('0x5e'),_0x55db6b['origtransfereruniqueid'],queues[_0x55db6b['origtransfererlinkedid']][_0xf077('0x1f')],_0x55db6b[_0xf077('0x55')]));queues[_0x55db6b[_0xf077('0x53')]][_0xf077('0xf')]=_0x55db6b[_0xf077('0x55')];}}}else if(_0x55db6b['secondtransfereruniqueid']==_0x55db6b['secondtransfererlinkedid']){if(!_['isNil'](queues[_0x55db6b[_0xf077('0x53')]])){utils[_0xf077('0x2')](util[_0xf077('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x55db6b[_0xf077('0x52')],queues[_0x55db6b['origtransfererlinkedid']][_0xf077('0x1f')],_0x55db6b[_0xf077('0x5f')],_0x55db6b[_0xf077('0x60')]));queues[_0x55db6b['origtransfererlinkedid']]['transfer']=!![];queues[_0x55db6b[_0xf077('0x53')]][_0xf077('0x49')]=_0xf077('0x57');queues[_0x55db6b[_0xf077('0x53')]][_0xf077('0x4b')]=_0x55db6b['secondtransfererexten'];queues[_0x55db6b[_0xf077('0x53')]][_0xf077('0x4d')]=_0x55db6b['secondtransfereruniqueid'];queues[_0x55db6b[_0xf077('0x53')]][_0xf077('0x9')]=_0xf077('0x58');}if(!_[_0xf077('0x23')](queues[_0x55db6b[_0xf077('0x55')]])){if(_0x55db6b[_0xf077('0x61')]&&queues[_0x55db6b['transfertargetlinkedid']]){queues[_0x55db6b[_0xf077('0x61')]][_0xf077('0x5a')]=0x1;queues[_0x55db6b[_0xf077('0x62')]]=_['clone'](queues[_0x55db6b['transfertargetlinkedid']]);queues[_0x55db6b[_0xf077('0x62')]][_0xf077('0xf')]=_0x55db6b[_0xf077('0x62')];queues[_0x55db6b[_0xf077('0x62')]][_0xf077('0x5a')]=0x2;queues[_0x55db6b[_0xf077('0x62')]][_0xf077('0x7')]=queues[_0x55db6b[_0xf077('0x53')]][_0xf077('0x7')];queues[_0x55db6b['transfertargetuniqueid']]['calleridname']=queues[_0x55db6b[_0xf077('0x53')]]['calleridname'];queues[_0x55db6b['transfertargetuniqueid']]['queuecallerjoinAt']=utils[_0xf077('0x14')]();queues[_0x55db6b[_0xf077('0x62')]][_0xf077('0x19')]=utils[_0xf077('0x14')]();queues[_0x55db6b[_0xf077('0x62')]][_0xf077('0x35')]=0x0;queues[_0x55db6b['transfertargetuniqueid']][_0xf077('0x5c')]=0x0;utils[_0xf077('0x2')](util[_0xf077('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x55db6b['origtransfereruniqueid'],queues[_0x55db6b[_0xf077('0x62')]][_0xf077('0x1f')],queues[_0x55db6b[_0xf077('0x62')]]['transfereduniqueid'],queues[_0x55db6b[_0xf077('0x62')]]['calleridnum'],queues[_0x55db6b[_0xf077('0x62')]][_0xf077('0x63')]));}else{utils[_0xf077('0x2')](util[_0xf077('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x55db6b[_0xf077('0x52')],queues[_0x55db6b[_0xf077('0x55')]][_0xf077('0x1f')],_0x55db6b[_0xf077('0x53')]));queues[_0x55db6b[_0xf077('0x55')]][_0xf077('0xf')]=_0x55db6b[_0xf077('0x53')];}}}}catch(_0x114398){utils['error'](util[_0xf077('0x3')]('[%s][queues][attendedtransfer]',_0x55db6b[_0xf077('0x52')]),_0x114398);}};exports['musiconholdstart']=function(_0x5682c8){try{if(!_[_0xf077('0x23')](queues[_0x5682c8[_0xf077('0x4')]])){utils['debug'](util[_0xf077('0x3')](_0xf077('0x64'),_0x5682c8['uniqueid']),_0x5682c8);queues[_0x5682c8[_0xf077('0x4')]][_0xf077('0x65')]=utils[_0xf077('0x14')]();utils[_0xf077('0x2')](util['format']('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x5682c8['uniqueid'],queues[_0x5682c8[_0xf077('0x4')]][_0xf077('0x1f')],queues[_0x5682c8[_0xf077('0x4')]][_0xf077('0x65')]));}}catch(_0x56201a){utils[_0xf077('0x15')](util[_0xf077('0x3')](_0xf077('0x64'),_0x5682c8[_0xf077('0x4')]),_0x56201a);}};exports[_0xf077('0x66')]=function(_0x2d5bd5){try{if(!_[_0xf077('0x23')](queues[_0x2d5bd5['uniqueid']])){if(!_['isNil'](queues[_0x2d5bd5[_0xf077('0x4')]]['musiconholdstartAt'])){utils[_0xf077('0x11')](util[_0xf077('0x3')]('[%s][queues][musiconholdstop]',_0x2d5bd5[_0xf077('0x4')]),_0x2d5bd5);queues[_0x2d5bd5['uniqueid']][_0xf077('0x5c')]+=utils[_0xf077('0x36')](utils['now'](),queues[_0x2d5bd5[_0xf077('0x4')]][_0xf077('0x65')]);utils[_0xf077('0x2')](util[_0xf077('0x3')](_0xf077('0x67'),_0x2d5bd5[_0xf077('0x4')],queues[_0x2d5bd5[_0xf077('0x4')]][_0xf077('0x1f')],queues[_0x2d5bd5[_0xf077('0x4')]][_0xf077('0x5c')]));delete queues[_0x2d5bd5['uniqueid']][_0xf077('0x65')];}}}catch(_0x548653){utils[_0xf077('0x15')](util[_0xf077('0x3')](_0xf077('0x68'),_0x2d5bd5['uniqueid']),_0x548653);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index dc8dd72..0cf6c6f 100644 --- a/server/services/xdr/recordings.controller.js +++ b/server/services/xdr/recordings.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5289=['[%s][recordings][newchannel]','context','error','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channel','linkedid','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]','endsWith','.wav49','value','.WAV','find','monitors','push','hangup','debug','[%s][recordings][hangup]','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','clone','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr','split','substring','lastIndexOf','[%s][recordings][newexten]','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','./utils','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','then','name','UserId','request','CreateVoiceRecording','newchannel'];(function(_0x42eb51,_0xafa7f2){var _0x403569=function(_0x51d5b9){while(--_0x51d5b9){_0x42eb51['push'](_0x42eb51['shift']());}};_0x403569(++_0xafa7f2);}(_0x5289,0xa8));var _0x9528=function(_0x2fe336,_0x5c3905){_0x2fe336=_0x2fe336-0x0;var _0x394834=_0x5289[_0x2fe336];return _0x394834;};'use strict';var _=require(_0x9528('0x0'));var util=require(_0x9528('0x1'));var utils=require(_0x9528('0x2'));var recordings={};function writeDB(_0x13356c){utils[_0x9528('0x3')](util[_0x9528('0x4')](_0x9528('0x5'),_0x13356c[_0x9528('0x6')]));if(_0x13356c[_0x9528('0x7')]){utils[_0x9528('0x8')](_0x13356c['accountcode'])[_0x9528('0x9')](function(_0x2807c4){if(_0x2807c4){_0x13356c['membername']=_0x2807c4[_0x9528('0xa')];_0x13356c[_0x9528('0xb')]=_0x2807c4['id'];}utils['request']('CreateVoiceRecording',_0x13356c);});}else{utils[_0x9528('0xc')](_0x9528('0xd'),_0x13356c);}}exports[_0x9528('0xe')]=function(_0x58fff2){try{utils['debug'](util['format'](_0x9528('0xf'),_0x58fff2['uniqueid']),_0x58fff2);if(_0x58fff2[_0x9528('0x6')]==_0x58fff2['linkedid']){utils['info'](util[_0x9528('0x4')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x58fff2[_0x9528('0x6')],_0x58fff2[_0x9528('0x10')],_0x58fff2['exten']));recordings[_0x58fff2['uniqueid']]={'uniqueid':_0x58fff2[_0x9528('0x6')],'accountcode':_0x58fff2['accountcode'],'exten':_0x58fff2['exten'],'context':_0x58fff2[_0x9528('0x10')],'channel':_0x58fff2['channel'],'monitors':[]};}}catch(_0x19178e){utils[_0x9528('0x11')](util['format'](_0x9528('0xf'),_0x58fff2[_0x9528('0x6')]),_0x19178e);}};exports[_0x9528('0x12')]=function(_0x372587){try{utils['debug'](util[_0x9528('0x4')](_0x9528('0x13'),_0x372587[_0x9528('0x6')]),_0x372587);if(!_[_0x9528('0x14')](recordings[_0x372587['uniqueid']])&&_0x372587[_0x9528('0x15')]==0x6){utils[_0x9528('0x3')](util[_0x9528('0x4')](_0x9528('0x16'),_0x372587[_0x9528('0x6')],_0x372587['context'],_0x372587[_0x9528('0x17')]));}else if(!_['isNil'](recordings[_0x372587[_0x9528('0x18')]])&&_0x372587[_0x9528('0x15')]==0x6&&_0x372587[_0x9528('0x10')]!='transfer'){utils[_0x9528('0x3')](util[_0x9528('0x4')](_0x9528('0x19'),_0x372587[_0x9528('0x6')],_0x372587[_0x9528('0x18')],_0x372587['context'],_0x372587[_0x9528('0x17')]));recordings[_0x372587[_0x9528('0x18')]]['accountcode']=_0x372587['accountcode'];}}catch(_0x4cd472){utils[_0x9528('0x11')](util['format'](_0x9528('0x13'),_0x372587[_0x9528('0x6')]),_0x4cd472);}};exports[_0x9528('0x1a')]=function(_0xf71cad){try{if(!_['isNil'](_0xf71cad['variable'])&&!_['isNil'](_0xf71cad[_0x9528('0x1b')][_0x9528('0x1c')])){utils['debug'](util['format'](_0x9528('0x1d'),_0xf71cad[_0x9528('0x6')]),_0xf71cad);utils[_0x9528('0x3')](util[_0x9528('0x4')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0xf71cad[_0x9528('0x6')],_0xf71cad[_0x9528('0x1b')],_0xf71cad['value']));if(_[_0x9528('0x1e')](_0xf71cad['value'],_0x9528('0x1f'))){_0xf71cad[_0x9528('0x20')]=_0xf71cad[_0x9528('0x20')]['replace'](_0x9528('0x1f'),_0x9528('0x21'));}if(recordings[_0xf71cad['linkedid']]){var _0x2cbb9a=_[_0x9528('0x22')](recordings[_0xf71cad[_0x9528('0x18')]][_0x9528('0x23')],{'value':_0xf71cad[_0x9528('0x20')]});if(_[_0x9528('0x14')](_0x2cbb9a)){recordings[_0xf71cad[_0x9528('0x18')]][_0x9528('0x23')][_0x9528('0x24')]({'value':_0xf71cad[_0x9528('0x20')]});}}}}catch(_0x3ee448){utils['error'](util[_0x9528('0x4')](_0x9528('0x1d'),_0xf71cad[_0x9528('0x6')]),_0x3ee448);}};exports[_0x9528('0x25')]=function(_0x49f52f){try{if(!_['isNil'](recordings[_0x49f52f['uniqueid']])){utils[_0x9528('0x26')](util[_0x9528('0x4')](_0x9528('0x27'),_0x49f52f[_0x9528('0x6')]),_0x49f52f);utils[_0x9528('0x3')](util[_0x9528('0x4')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x49f52f[_0x9528('0x6')],_0x49f52f[_0x9528('0x28')],_0x49f52f[_0x9528('0x29')],_0x49f52f[_0x9528('0x2a')]));recordings[_0x49f52f[_0x9528('0x6')]][_0x9528('0x28')]=_0x49f52f[_0x9528('0x28')];recordings[_0x49f52f['uniqueid']]['calleridname']=_0x49f52f[_0x9528('0x29')];recordings[_0x49f52f['uniqueid']][_0x9528('0x2b')]=_0x49f52f['connectedlinenum'];recordings[_0x49f52f[_0x9528('0x6')]][_0x9528('0x2c')]=_0x49f52f['connectedlinename'];if(recordings[_0x49f52f[_0x9528('0x6')]][_0x9528('0x2d')]=='outbound'&&recordings[_0x49f52f[_0x9528('0x6')]][_0x9528('0x7')]){recordings[_0x49f52f[_0x9528('0x6')]][_0x9528('0x2b')]=recordings[_0x49f52f['uniqueid']][_0x9528('0x7')];recordings[_0x49f52f[_0x9528('0x6')]]['connectedlinename']='';}recordings[_0x49f52f['uniqueid']]['monitors']['forEach'](function(_0x4e7c5c){var _0x55290d=_[_0x9528('0x2e')](recordings[_0x49f52f[_0x9528('0x6')]]);_0x55290d[_0x9528('0x20')]=_0x4e7c5c[_0x9528('0x20')];writeDB(_0x55290d);});delete recordings[_0x49f52f[_0x9528('0x6')]];}}catch(_0x347e9f){utils['error'](util[_0x9528('0x4')]('[%s][recordings][hangup]',_0x49f52f['uniqueid']),_0x347e9f);}};exports[_0x9528('0x2f')]=function(_0x5d2b5b){try{if(!_[_0x9528('0x14')](recordings[_0x5d2b5b['uniqueid']])){utils['debug'](util[_0x9528('0x4')]('[%s][recordings][newexten]',_0x5d2b5b[_0x9528('0x6')]),_0x5d2b5b);utils['info'](util['format'](_0x9528('0x30'),_0x5d2b5b[_0x9528('0x6')],_0x5d2b5b[_0x9528('0x31')],_0x5d2b5b[_0x9528('0x32')]));if(_0x5d2b5b[_0x9528('0x31')][_0x9528('0x33')]()=='set'&&_[_0x9528('0x34')](_0x5d2b5b[_0x9528('0x32')]['toLowerCase'](),_0x9528('0x35'))){var _0x59b365=_0x5d2b5b[_0x9528('0x32')][_0x9528('0x36')]('=');var _0x572157=_0x59b365[0x0][_0x9528('0x37')](_0x59b365[0x0][_0x9528('0x38')]('(')+0x1,_0x59b365[0x0][_0x9528('0x38')](')'));var _0x274a4e=_0x59b365[0x1];recordings[_0x5d2b5b[_0x9528('0x6')]][_0x572157]=_0x274a4e;}}}catch(_0x2d6f81){utils['error'](util['format'](_0x9528('0x39'),_0x5d2b5b[_0x9528('0x6')]),_0x2d6f81);}};exports['queuecallerjoin']=function(_0x29bc18){try{if(!_['isNil'](recordings[_0x29bc18[_0x9528('0x6')]])){utils[_0x9528('0x26')](util[_0x9528('0x4')](_0x9528('0x3a'),_0x29bc18[_0x9528('0x6')]),_0x29bc18);utils[_0x9528('0x3')](util[_0x9528('0x4')](_0x9528('0x3b'),_0x29bc18[_0x9528('0x6')],_0x29bc18[_0x9528('0x3c')]));recordings[_0x29bc18[_0x9528('0x6')]][_0x9528('0x3c')]=_0x29bc18[_0x9528('0x3c')];}}catch(_0x3f51a5){utils['error'](util[_0x9528('0x4')](_0x9528('0x3a'),_0x29bc18[_0x9528('0x6')]),_0x3f51a5);}}; \ No newline at end of file +var _0x1786=['exten','newstate','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channel','linkedid','transfer','error','[%s][recordings][newstate]','varset','variable','mixmonitor_filename','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','.wav49','.WAV','find','monitors','[%s][recordings][varset]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinename','type','outbound','connectedlinenum','[%s][recordings][hangup]','newexten','[%s][recordings][newexten]','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','util','./utils','format','[%s][recordings][writeDB]','uniqueid','accountcode','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','info','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context'];(function(_0x1bb858,_0x10c1dc){var _0x48adad=function(_0x124d5c){while(--_0x124d5c){_0x1bb858['push'](_0x1bb858['shift']());}};_0x48adad(++_0x10c1dc);}(_0x1786,0xdf));var _0x6178=function(_0x5637b7,_0x225a98){_0x5637b7=_0x5637b7-0x0;var _0x5cd52b=_0x1786[_0x5637b7];return _0x5cd52b;};'use strict';var _=require('lodash');var util=require(_0x6178('0x0'));var utils=require(_0x6178('0x1'));var recordings={};function writeDB(_0x3d2ed){utils['info'](util[_0x6178('0x2')](_0x6178('0x3'),_0x3d2ed[_0x6178('0x4')]));if(_0x3d2ed[_0x6178('0x5')]){utils['getUserByInternal'](_0x3d2ed['accountcode'])['then'](function(_0x505197){if(_0x505197){_0x3d2ed[_0x6178('0x6')]=_0x505197[_0x6178('0x7')];_0x3d2ed[_0x6178('0x8')]=_0x505197['id'];}utils[_0x6178('0x9')](_0x6178('0xa'),_0x3d2ed);});}else{utils['request'](_0x6178('0xa'),_0x3d2ed);}}exports[_0x6178('0xb')]=function(_0x54d15e){try{utils[_0x6178('0xc')](util[_0x6178('0x2')](_0x6178('0xd'),_0x54d15e[_0x6178('0x4')]),_0x54d15e);if(_0x54d15e[_0x6178('0x4')]==_0x54d15e['linkedid']){utils[_0x6178('0xe')](util[_0x6178('0x2')](_0x6178('0xf'),_0x54d15e['uniqueid'],_0x54d15e[_0x6178('0x10')],_0x54d15e[_0x6178('0x11')]));recordings[_0x54d15e[_0x6178('0x4')]]={'uniqueid':_0x54d15e[_0x6178('0x4')],'accountcode':_0x54d15e['accountcode'],'exten':_0x54d15e[_0x6178('0x11')],'context':_0x54d15e[_0x6178('0x10')],'channel':_0x54d15e['channel'],'monitors':[]};}}catch(_0x3d72d3){utils['error'](util[_0x6178('0x2')](_0x6178('0xd'),_0x54d15e[_0x6178('0x4')]),_0x3d72d3);}};exports[_0x6178('0x12')]=function(_0x1d3a46){try{utils[_0x6178('0xc')](util['format']('[%s][recordings][newstate]',_0x1d3a46[_0x6178('0x4')]),_0x1d3a46);if(!_[_0x6178('0x13')](recordings[_0x1d3a46[_0x6178('0x4')]])&&_0x1d3a46[_0x6178('0x14')]==0x6){utils[_0x6178('0xe')](util['format'](_0x6178('0x15'),_0x1d3a46[_0x6178('0x4')],_0x1d3a46[_0x6178('0x10')],_0x1d3a46[_0x6178('0x16')]));}else if(!_['isNil'](recordings[_0x1d3a46[_0x6178('0x17')]])&&_0x1d3a46[_0x6178('0x14')]==0x6&&_0x1d3a46[_0x6178('0x10')]!=_0x6178('0x18')){utils[_0x6178('0xe')](util[_0x6178('0x2')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x1d3a46[_0x6178('0x4')],_0x1d3a46[_0x6178('0x17')],_0x1d3a46[_0x6178('0x10')],_0x1d3a46[_0x6178('0x16')]));recordings[_0x1d3a46[_0x6178('0x17')]][_0x6178('0x5')]=_0x1d3a46[_0x6178('0x5')];}}catch(_0x119fed){utils[_0x6178('0x19')](util[_0x6178('0x2')](_0x6178('0x1a'),_0x1d3a46[_0x6178('0x4')]),_0x119fed);}};exports[_0x6178('0x1b')]=function(_0x3c6026){try{if(!_['isNil'](_0x3c6026[_0x6178('0x1c')])&&!_[_0x6178('0x13')](_0x3c6026[_0x6178('0x1c')][_0x6178('0x1d')])){utils[_0x6178('0xc')](util[_0x6178('0x2')]('[%s][recordings][varset]',_0x3c6026['uniqueid']),_0x3c6026);utils['info'](util[_0x6178('0x2')](_0x6178('0x1e'),_0x3c6026[_0x6178('0x4')],_0x3c6026[_0x6178('0x1c')],_0x3c6026[_0x6178('0x1f')]));if(_['endsWith'](_0x3c6026[_0x6178('0x1f')],_0x6178('0x20'))){_0x3c6026[_0x6178('0x1f')]=_0x3c6026['value']['replace'](_0x6178('0x20'),_0x6178('0x21'));}if(recordings[_0x3c6026[_0x6178('0x17')]]){var _0x232249=_[_0x6178('0x22')](recordings[_0x3c6026[_0x6178('0x17')]][_0x6178('0x23')],{'value':_0x3c6026[_0x6178('0x1f')]});if(_[_0x6178('0x13')](_0x232249)){recordings[_0x3c6026[_0x6178('0x17')]][_0x6178('0x23')]['push']({'value':_0x3c6026[_0x6178('0x1f')]});}}}}catch(_0x29ea1d){utils['error'](util[_0x6178('0x2')](_0x6178('0x24'),_0x3c6026[_0x6178('0x4')]),_0x29ea1d);}};exports['hangup']=function(_0x45ed6c){try{if(!_[_0x6178('0x13')](recordings[_0x45ed6c['uniqueid']])){utils[_0x6178('0xc')](util[_0x6178('0x2')]('[%s][recordings][hangup]',_0x45ed6c[_0x6178('0x4')]),_0x45ed6c);utils[_0x6178('0xe')](util[_0x6178('0x2')](_0x6178('0x25'),_0x45ed6c['uniqueid'],_0x45ed6c[_0x6178('0x26')],_0x45ed6c[_0x6178('0x27')],_0x45ed6c[_0x6178('0x28')]));recordings[_0x45ed6c[_0x6178('0x4')]]['calleridnum']=_0x45ed6c['calleridnum'];recordings[_0x45ed6c[_0x6178('0x4')]][_0x6178('0x27')]=_0x45ed6c[_0x6178('0x27')];recordings[_0x45ed6c['uniqueid']]['connectedlinenum']=_0x45ed6c['connectedlinenum'];recordings[_0x45ed6c[_0x6178('0x4')]][_0x6178('0x29')]=_0x45ed6c[_0x6178('0x29')];if(recordings[_0x45ed6c[_0x6178('0x4')]][_0x6178('0x2a')]==_0x6178('0x2b')&&recordings[_0x45ed6c['uniqueid']][_0x6178('0x5')]){recordings[_0x45ed6c[_0x6178('0x4')]][_0x6178('0x2c')]=recordings[_0x45ed6c[_0x6178('0x4')]]['accountcode'];recordings[_0x45ed6c[_0x6178('0x4')]][_0x6178('0x29')]='';}recordings[_0x45ed6c[_0x6178('0x4')]]['monitors']['forEach'](function(_0x1b3117){var _0x1c86e9=_['clone'](recordings[_0x45ed6c[_0x6178('0x4')]]);_0x1c86e9[_0x6178('0x1f')]=_0x1b3117[_0x6178('0x1f')];writeDB(_0x1c86e9);});delete recordings[_0x45ed6c['uniqueid']];}}catch(_0x545cef){utils[_0x6178('0x19')](util[_0x6178('0x2')](_0x6178('0x2d'),_0x45ed6c[_0x6178('0x4')]),_0x545cef);}};exports[_0x6178('0x2e')]=function(_0x566562){try{if(!_[_0x6178('0x13')](recordings[_0x566562['uniqueid']])){utils[_0x6178('0xc')](util[_0x6178('0x2')](_0x6178('0x2f'),_0x566562[_0x6178('0x4')]),_0x566562);utils[_0x6178('0xe')](util['format']('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x566562[_0x6178('0x4')],_0x566562[_0x6178('0x30')],_0x566562[_0x6178('0x31')]));if(_0x566562[_0x6178('0x30')][_0x6178('0x32')]()==_0x6178('0x33')&&_[_0x6178('0x34')](_0x566562[_0x6178('0x31')][_0x6178('0x32')](),_0x6178('0x35'))){var _0x13378e=_0x566562[_0x6178('0x31')][_0x6178('0x36')]('=');var _0x2393ad=_0x13378e[0x0][_0x6178('0x37')](_0x13378e[0x0]['lastIndexOf']('(')+0x1,_0x13378e[0x0]['lastIndexOf'](')'));var _0x1fb961=_0x13378e[0x1];recordings[_0x566562['uniqueid']][_0x2393ad]=_0x1fb961;}}}catch(_0x271264){utils[_0x6178('0x19')](util[_0x6178('0x2')](_0x6178('0x2f'),_0x566562['uniqueid']),_0x271264);}};exports[_0x6178('0x38')]=function(_0x35f362){try{if(!_[_0x6178('0x13')](recordings[_0x35f362[_0x6178('0x4')]])){utils[_0x6178('0xc')](util['format'](_0x6178('0x39'),_0x35f362[_0x6178('0x4')]),_0x35f362);utils[_0x6178('0xe')](util['format'](_0x6178('0x3a'),_0x35f362[_0x6178('0x4')],_0x35f362['queue']));recordings[_0x35f362[_0x6178('0x4')]][_0x6178('0x3b')]=_0x35f362['queue'];}}catch(_0x5d69f0){utils[_0x6178('0x19')](util[_0x6178('0x2')](_0x6178('0x39'),_0x35f362['uniqueid']),_0x5d69f0);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index bd2aa96..f3aa42e 100644 --- a/server/services/xdr/transfers.controller.js +++ b/server/services/xdr/transfers.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3799=['secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','isNil','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','./utils','format','type','origtransfereruniqueid','CreateVoiceTransferReport','blindtransfer','debug','[%s][transfers][blindtransfer]','uniqueid','info','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridnum','transfereecalleridname','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','assign','origtransfererchannel'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x3799,0x1c8));var _0x9379=function(_0x1223a5,_0x420f36){_0x1223a5=_0x1223a5-0x0;var _0x3692c5=_0x3799[_0x1223a5];return _0x3692c5;};'use strict';var _=require(_0x9379('0x0'));var util=require('util');var utils=require(_0x9379('0x1'));function writeDB(_0x3831a0){utils['info'](util[_0x9379('0x2')]('[%s][transfers][writeDB]\x20type:%s',_0x3831a0[_0x9379('0x3')]==='attended'?_0x3831a0[_0x9379('0x4')]:_0x3831a0['uniqueid'],_0x3831a0[_0x9379('0x3')]));utils['request'](_0x9379('0x5'),_0x3831a0);}exports[_0x9379('0x6')]=function(_0x13c726){try{utils[_0x9379('0x7')](util[_0x9379('0x2')](_0x9379('0x8'),_0x13c726[_0x9379('0x9')]),_0x13c726);utils[_0x9379('0xa')](util['format'](_0x9379('0xb'),_0x13c726[_0x9379('0x9')],_0x13c726[_0x9379('0xc')],_0x13c726['transferercalleridname'],_0x13c726[_0x9379('0xd')],_0x13c726[_0x9379('0xe')]));_0x13c726['type']='blind';writeDB(_0x13c726);}catch(_0x2e24a6){utils[_0x9379('0xf')](util[_0x9379('0x2')](_0x9379('0x8'),_0x13c726[_0x9379('0x9')]),_0x2e24a6);}};exports[_0x9379('0x10')]=function(_0x4ab189){try{utils['debug'](util[_0x9379('0x2')](_0x9379('0x11'),_0x4ab189[_0x9379('0x4')]),_0x4ab189);utils['info'](util['format'](_0x9379('0x12'),_0x4ab189[_0x9379('0x4')],_0x4ab189[_0x9379('0x13')],_0x4ab189[_0x9379('0x14')],_0x4ab189[_0x9379('0x15')],_0x4ab189['transfertargetcalleridname']));_0x4ab189=_[_0x9379('0x16')](_0x4ab189,{'transfererchannel':_0x4ab189[_0x9379('0x17')],'transferercalleridnum':_0x4ab189[_0x9379('0x13')],'transferercalleridname':_0x4ab189[_0x9379('0x14')],'transfererconnectedlinenum':_0x4ab189[_0x9379('0x18')],'transfererconnectedlinename':_0x4ab189[_0x9379('0x19')],'transfereraccountcode':_0x4ab189[_0x9379('0x1a')],'transferercontext':_0x4ab189[_0x9379('0x1b')],'transfererexten':_0x4ab189['secondtransfererexten'],'transfererlinkedid':_0x4ab189[_0x9379('0x1c')],'context':_0x4ab189[_0x9379('0x1d')],'extension':_0x4ab189[_0x9379('0x1e')],'type':_0x9379('0x1f')});if(_[_0x9379('0x20')](_0x4ab189['transfereechannel'])){_0x4ab189=_['assign'](_0x4ab189,{'transfereechannel':_0x4ab189[_0x9379('0x21')],'transfereecalleridnum':_0x4ab189[_0x9379('0x15')],'transfereecalleridname':_0x4ab189[_0x9379('0x22')],'transfereeconnectedlinenum':_0x4ab189[_0x9379('0x23')],'transfereeconnectedlinename':_0x4ab189[_0x9379('0x24')],'transfereeaccountcode':_0x4ab189['transfertargetaccountcode'],'transfereecontext':_0x4ab189[_0x9379('0x25')],'transfereeexten':_0x4ab189[_0x9379('0x26')],'transfereelinkedid':_0x4ab189[_0x9379('0x27')]});}writeDB(_0x4ab189);}catch(_0x29ac94){utils[_0x9379('0xf')](util[_0x9379('0x2')](_0x9379('0x11'),_0x4ab189['origtransfereruniqueid']),_0x29ac94);}}; \ No newline at end of file +var _0x52f4=['transfereechannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','attended','origtransfereruniqueid','uniqueid','type','request','CreateVoiceTransferReport','blindtransfer','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridname','blind','error','attendedtransfer','debug','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','origtransfererchannel','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','origtransferercontext'];(function(_0xb91d94,_0x57cc77){var _0x55656d=function(_0x3d566d){while(--_0x3d566d){_0xb91d94['push'](_0xb91d94['shift']());}};_0x55656d(++_0x57cc77);}(_0x52f4,0x1ce));var _0x452f=function(_0x3f8e66,_0x3e8955){_0x3f8e66=_0x3f8e66-0x0;var _0x3a5c40=_0x52f4[_0x3f8e66];return _0x3a5c40;};'use strict';var _=require(_0x452f('0x0'));var util=require(_0x452f('0x1'));var utils=require(_0x452f('0x2'));function writeDB(_0x1e5b5e){utils[_0x452f('0x3')](util[_0x452f('0x4')](_0x452f('0x5'),_0x1e5b5e['type']===_0x452f('0x6')?_0x1e5b5e[_0x452f('0x7')]:_0x1e5b5e[_0x452f('0x8')],_0x1e5b5e[_0x452f('0x9')]));utils[_0x452f('0xa')](_0x452f('0xb'),_0x1e5b5e);}exports[_0x452f('0xc')]=function(_0x4b14c9){try{utils['debug'](util['format'](_0x452f('0xd'),_0x4b14c9['uniqueid']),_0x4b14c9);utils['info'](util[_0x452f('0x4')](_0x452f('0xe'),_0x4b14c9[_0x452f('0x8')],_0x4b14c9[_0x452f('0xf')],_0x4b14c9['transferercalleridname'],_0x4b14c9['transfereecalleridnum'],_0x4b14c9[_0x452f('0x10')]));_0x4b14c9['type']=_0x452f('0x11');writeDB(_0x4b14c9);}catch(_0x3b5f23){utils[_0x452f('0x12')](util[_0x452f('0x4')](_0x452f('0xd'),_0x4b14c9[_0x452f('0x8')]),_0x3b5f23);}};exports[_0x452f('0x13')]=function(_0x30d318){try{utils[_0x452f('0x14')](util[_0x452f('0x4')](_0x452f('0x15'),_0x30d318[_0x452f('0x7')]),_0x30d318);utils[_0x452f('0x3')](util[_0x452f('0x4')](_0x452f('0x16'),_0x30d318[_0x452f('0x7')],_0x30d318['origtransferercalleridnum'],_0x30d318[_0x452f('0x17')],_0x30d318[_0x452f('0x18')],_0x30d318[_0x452f('0x19')]));_0x30d318=_['assign'](_0x30d318,{'transfererchannel':_0x30d318[_0x452f('0x1a')],'transferercalleridnum':_0x30d318['origtransferercalleridnum'],'transferercalleridname':_0x30d318[_0x452f('0x17')],'transfererconnectedlinenum':_0x30d318['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x30d318[_0x452f('0x1b')],'transfereraccountcode':_0x30d318[_0x452f('0x1c')],'transferercontext':_0x30d318[_0x452f('0x1d')],'transfererexten':_0x30d318['secondtransfererexten'],'transfererlinkedid':_0x30d318[_0x452f('0x1e')],'context':_0x30d318[_0x452f('0x1f')],'extension':_0x30d318['origtransfererexten'],'type':_0x452f('0x6')});if(_['isNil'](_0x30d318[_0x452f('0x20')])){_0x30d318=_['assign'](_0x30d318,{'transfereechannel':_0x30d318['transfertargetchannel'],'transfereecalleridnum':_0x30d318[_0x452f('0x18')],'transfereecalleridname':_0x30d318[_0x452f('0x19')],'transfereeconnectedlinenum':_0x30d318[_0x452f('0x21')],'transfereeconnectedlinename':_0x30d318[_0x452f('0x22')],'transfereeaccountcode':_0x30d318[_0x452f('0x23')],'transfereecontext':_0x30d318[_0x452f('0x24')],'transfereeexten':_0x30d318[_0x452f('0x25')],'transfereelinkedid':_0x30d318['transfertargetlinkedid']});}writeDB(_0x30d318);}catch(_0x1eb69d){utils[_0x452f('0x12')](util['format'](_0x452f('0x15'),_0x30d318['origtransfereruniqueid']),_0x1eb69d);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 26d2672..abc1df0 100644 --- a/server/services/xdr/utils.js +++ b/server/services/xdr/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7fd1=['getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','[utils][getUserByInternal]','[utils][getUserByInterface]\x20interface:%s\x20%s','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','notfound','[utils][getUserByName]','GetVoiceQueue','type','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','addTime','add','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','seconds','diffTime','diff','isAfter','bluebird','jayson/promise','moment','util','http','xdr','info','inspect','debug','error','request','then','catch','internal','name','interface','[utils][getUser]\x20where:%s','stringify','length','result'];(function(_0x4b3bef,_0x2ae107){var _0x2c9a45=function(_0x5ceb3d){while(--_0x5ceb3d){_0x4b3bef['push'](_0x4b3bef['shift']());}};_0x2c9a45(++_0x2ae107);}(_0x7fd1,0x6a));var _0x17fd=function(_0x5bf3e2,_0x2d7c4b){_0x5bf3e2=_0x5bf3e2-0x0;var _0x44fe35=_0x7fd1[_0x5bf3e2];return _0x44fe35;};'use strict';var BPromise=require(_0x17fd('0x0'));var jayson=require(_0x17fd('0x1'));var moment=require(_0x17fd('0x2'));var util=require(_0x17fd('0x3'));var client=jayson['client'][_0x17fd('0x4')]({'port':0x2329});var logger=require('../../config/logger')(_0x17fd('0x5'));exports['info']=function(_0x35d465,_0x4c0c2f){logger[_0x17fd('0x6')](_0x35d465,_0x4c0c2f?util[_0x17fd('0x7')](_0x4c0c2f,{'showHidden':![],'depth':null}):'');};exports[_0x17fd('0x8')]=function(_0x55db38,_0x4bf786){logger[_0x17fd('0x8')](_0x55db38,_0x4bf786?util[_0x17fd('0x7')](_0x4bf786,{'showHidden':![],'depth':null}):'');};exports[_0x17fd('0x9')]=function(_0x2ed22d,_0x19cd32){logger[_0x17fd('0x9')](_0x2ed22d,_0x19cd32?util['inspect'](_0x19cd32,{'showHidden':![],'depth':null}):'');};exports[_0x17fd('0xa')]=function(_0x25142a,_0x40c717){return client[_0x17fd('0xa')](_0x25142a,{'body':_0x40c717})[_0x17fd('0xb')](function(_0x58f67e){logger[_0x17fd('0x8')]('[utils][request]\x20name:%s',_0x25142a,_0x58f67e?util[_0x17fd('0x7')](_0x58f67e,{'showHidden':![],'depth':null}):'');})[_0x17fd('0xc')](function(_0x42da8e){logger['error']('[utils][request]\x20name:%s',_0x25142a,_0x42da8e?util['inspect'](_0x42da8e,{'showHidden':![],'depth':null}):'');});};function getUser(_0x302931){return client[_0x17fd('0xa')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0x17fd('0xd'),_0x17fd('0xe'),_0x17fd('0xf')],'where':_0x302931,'limit':0x1}})[_0x17fd('0xb')](function(_0x4923d2){logger[_0x17fd('0x8')](_0x17fd('0x10'),JSON[_0x17fd('0x11')](_0x302931),_0x4923d2?util[_0x17fd('0x7')](_0x4923d2,{'showHidden':![],'depth':null}):'');return _0x4923d2['result'][_0x17fd('0x12')]?_0x4923d2[_0x17fd('0x13')][0x0]:null;});}exports[_0x17fd('0x14')]=function(_0x20fcb1){return new BPromise(function(_0x491b0c,_0x1456c2){if(_0x20fcb1){return getUser({'internal':_0x20fcb1})[_0x17fd('0xb')](function(_0x358d47){logger[_0x17fd('0x6')](_0x17fd('0x15'),_0x20fcb1,_0x358d47?_0x17fd('0x16'):'notfound');return _0x491b0c(_0x358d47);})[_0x17fd('0xc')](function(_0x7c5713){logger['error'](_0x17fd('0x17'),_0x7c5713?util['inspect'](_0x7c5713,{'showHidden':![],'depth':null}):'');return _0x491b0c(null);});}return _0x491b0c(null);});};exports['getUserByInterface']=function(_0x5b7948){return new BPromise(function(_0x223c24,_0x50ced7){if(_0x5b7948){return getUser({'interface':_0x5b7948})['then'](function(_0x421ffa){logger[_0x17fd('0x6')](_0x17fd('0x18'),_0x5b7948,_0x421ffa?_0x17fd('0x16'):'notfound');return _0x223c24(_0x421ffa);})[_0x17fd('0xc')](function(_0x56b524){logger['error']('[utils][getUserByInterface]',_0x56b524?util[_0x17fd('0x7')](_0x56b524,{'showHidden':![],'depth':null}):'');return _0x223c24(null);});}return _0x223c24(null);});};exports[_0x17fd('0x19')]=function(_0x4fc4b3){return new BPromise(function(_0x59bb77,_0x384448){if(_0x4fc4b3){return getUser({'name':_0x4fc4b3})[_0x17fd('0xb')](function(_0x4db24e){logger[_0x17fd('0x6')](_0x17fd('0x1a'),_0x4fc4b3,_0x4db24e?'found':_0x17fd('0x1b'));return _0x59bb77(_0x4db24e);})[_0x17fd('0xc')](function(_0x533379){logger[_0x17fd('0x9')](_0x17fd('0x1c'),_0x533379?util['inspect'](_0x533379,{'showHidden':![],'depth':null}):'');return _0x59bb77(null);});}return _0x59bb77(null);});};exports['getVoiceQueueByName']=function(_0x279748){return new BPromise(function(_0x486f5f,_0x1f6a5a){if(_0x279748){return client[_0x17fd('0xa')](_0x17fd('0x1d'),{'options':{'raw':!![],'attributes':['id','name',_0x17fd('0x1e'),'acw','acwTimeout'],'where':{'name':_0x279748},'limit':0x1}})[_0x17fd('0xb')](function(_0x476650){logger['debug'](_0x17fd('0x1f'),_0x279748,_0x476650?util[_0x17fd('0x7')](_0x476650,{'showHidden':![],'depth':null}):'');logger[_0x17fd('0x6')](_0x17fd('0x20'),_0x279748,_0x476650?_0x17fd('0x16'):'notfound');return _0x486f5f(_0x476650[_0x17fd('0x13')][_0x17fd('0x12')]?_0x476650[_0x17fd('0x13')][0x0]:null);})[_0x17fd('0xc')](function(_0x5586ae){logger['error']('[utils][getVoiceQueueByName]',_0x5586ae?util[_0x17fd('0x7')](_0x5586ae,{'showHidden':![],'depth':null}):'');return _0x486f5f(null);});}return _0x486f5f(null);});};exports[_0x17fd('0x21')]=function(_0xc0f772,_0x5d58ea){return moment(_0xc0f772)[_0x17fd('0x22')](_0x5d58ea,'seconds')[_0x17fd('0x23')](_0x17fd('0x24'));};exports[_0x17fd('0x25')]=function(_0x191596,_0x56b933){return moment(_0x191596)['subtract'](_0x56b933,_0x17fd('0x26'))[_0x17fd('0x23')](_0x17fd('0x24'));};exports[_0x17fd('0x27')]=function(_0x35f173,_0x55218e){return moment(_0x35f173)[_0x17fd('0x28')](moment(_0x55218e),'seconds');};exports['sumTime']=function(_0x5d5a13,_0x20ab81){return parseInt(_0x5d5a13,0xa)+parseInt(_0x20ab81,0xa);};exports['now']=function(){return moment()[_0x17fd('0x23')](_0x17fd('0x24'));};exports[_0x17fd('0x29')]=function(_0x1b1e24,_0x22cfa6){if(_0x22cfa6){return moment(_0x1b1e24)[_0x17fd('0x29')](_0x22cfa6);}return!![];};exports['isBefore']=function(_0x598424,_0x4e588f){if(_0x4e588f){return moment(_0x598424)['isBefore'](_0x4e588f);}else if(_0x598424){return!![];}return![];}; \ No newline at end of file +var _0x2c92=['subtract','diffTime','sumTime','now','isAfter','isBefore','jayson/promise','moment','util','client','http','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','GetUser','internal','name','[utils][getUser]\x20where:%s','stringify','result','length','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','catch','[utils][getUserByInternal]','[utils][getUserByInterface]\x20interface:%s\x20%s','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','seconds','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0xcc43fe,_0x3a4a21){var _0x16aa56=function(_0x1ee058){while(--_0x1ee058){_0xcc43fe['push'](_0xcc43fe['shift']());}};_0x16aa56(++_0x3a4a21);}(_0x2c92,0x93));var _0x22c9=function(_0x587fb5,_0x59cb3b){_0x587fb5=_0x587fb5-0x0;var _0x551105=_0x2c92[_0x587fb5];return _0x551105;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x22c9('0x0'));var moment=require(_0x22c9('0x1'));var util=require(_0x22c9('0x2'));var client=jayson[_0x22c9('0x3')][_0x22c9('0x4')]({'port':0x2329});var logger=require(_0x22c9('0x5'))(_0x22c9('0x6'));exports['info']=function(_0x7b7b2b,_0x1f3877){logger[_0x22c9('0x7')](_0x7b7b2b,_0x1f3877?util[_0x22c9('0x8')](_0x1f3877,{'showHidden':![],'depth':null}):'');};exports[_0x22c9('0x9')]=function(_0x21fdda,_0x58fd59){logger[_0x22c9('0x9')](_0x21fdda,_0x58fd59?util[_0x22c9('0x8')](_0x58fd59,{'showHidden':![],'depth':null}):'');};exports[_0x22c9('0xa')]=function(_0x4752e7,_0x4839d2){logger[_0x22c9('0xa')](_0x4752e7,_0x4839d2?util[_0x22c9('0x8')](_0x4839d2,{'showHidden':![],'depth':null}):'');};exports[_0x22c9('0xb')]=function(_0x4dc0a9,_0x2784fd){return client['request'](_0x4dc0a9,{'body':_0x2784fd})[_0x22c9('0xc')](function(_0x245e32){logger[_0x22c9('0x9')](_0x22c9('0xd'),_0x4dc0a9,_0x245e32?util[_0x22c9('0x8')](_0x245e32,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x43252c){logger[_0x22c9('0xa')]('[utils][request]\x20name:%s',_0x4dc0a9,_0x43252c?util[_0x22c9('0x8')](_0x43252c,{'showHidden':![],'depth':null}):'');});};function getUser(_0x252b04){return client[_0x22c9('0xb')](_0x22c9('0xe'),{'options':{'raw':!![],'attributes':['id',_0x22c9('0xf'),_0x22c9('0x10'),'interface'],'where':_0x252b04,'limit':0x1}})['then'](function(_0x5a8a00){logger[_0x22c9('0x9')](_0x22c9('0x11'),JSON[_0x22c9('0x12')](_0x252b04),_0x5a8a00?util[_0x22c9('0x8')](_0x5a8a00,{'showHidden':![],'depth':null}):'');return _0x5a8a00[_0x22c9('0x13')][_0x22c9('0x14')]?_0x5a8a00[_0x22c9('0x13')][0x0]:null;});}exports['getUserByInternal']=function(_0x434651){return new BPromise(function(_0x163b38,_0x3d1675){if(_0x434651){return getUser({'internal':_0x434651})['then'](function(_0x2e9882){logger[_0x22c9('0x7')](_0x22c9('0x15'),_0x434651,_0x2e9882?_0x22c9('0x16'):_0x22c9('0x17'));return _0x163b38(_0x2e9882);})[_0x22c9('0x18')](function(_0x94fa8c){logger[_0x22c9('0xa')](_0x22c9('0x19'),_0x94fa8c?util[_0x22c9('0x8')](_0x94fa8c,{'showHidden':![],'depth':null}):'');return _0x163b38(null);});}return _0x163b38(null);});};exports['getUserByInterface']=function(_0x1aba72){return new BPromise(function(_0xfd5549,_0x59a65b){if(_0x1aba72){return getUser({'interface':_0x1aba72})[_0x22c9('0xc')](function(_0x53f82c){logger['info'](_0x22c9('0x1a'),_0x1aba72,_0x53f82c?_0x22c9('0x16'):_0x22c9('0x17'));return _0xfd5549(_0x53f82c);})[_0x22c9('0x18')](function(_0x360e58){logger[_0x22c9('0xa')]('[utils][getUserByInterface]',_0x360e58?util[_0x22c9('0x8')](_0x360e58,{'showHidden':![],'depth':null}):'');return _0xfd5549(null);});}return _0xfd5549(null);});};exports[_0x22c9('0x1b')]=function(_0x4b8cb8){return new BPromise(function(_0x103ed8,_0x3a38bb){if(_0x4b8cb8){return getUser({'name':_0x4b8cb8})[_0x22c9('0xc')](function(_0x355c25){logger[_0x22c9('0x7')](_0x22c9('0x1c'),_0x4b8cb8,_0x355c25?_0x22c9('0x16'):'notfound');return _0x103ed8(_0x355c25);})[_0x22c9('0x18')](function(_0x303cdd){logger[_0x22c9('0xa')](_0x22c9('0x1d'),_0x303cdd?util['inspect'](_0x303cdd,{'showHidden':![],'depth':null}):'');return _0x103ed8(null);});}return _0x103ed8(null);});};exports[_0x22c9('0x1e')]=function(_0x31f25d){return new BPromise(function(_0x4eca7f,_0x56c0b2){if(_0x31f25d){return client[_0x22c9('0xb')](_0x22c9('0x1f'),{'options':{'raw':!![],'attributes':['id',_0x22c9('0x10'),_0x22c9('0x20'),_0x22c9('0x21'),'acwTimeout'],'where':{'name':_0x31f25d},'limit':0x1}})[_0x22c9('0xc')](function(_0x54b3c2){logger['debug'](_0x22c9('0x22'),_0x31f25d,_0x54b3c2?util[_0x22c9('0x8')](_0x54b3c2,{'showHidden':![],'depth':null}):'');logger['info'](_0x22c9('0x23'),_0x31f25d,_0x54b3c2?_0x22c9('0x16'):'notfound');return _0x4eca7f(_0x54b3c2['result'][_0x22c9('0x14')]?_0x54b3c2[_0x22c9('0x13')][0x0]:null);})['catch'](function(_0x4b1dc6){logger[_0x22c9('0xa')](_0x22c9('0x24'),_0x4b1dc6?util['inspect'](_0x4b1dc6,{'showHidden':![],'depth':null}):'');return _0x4eca7f(null);});}return _0x4eca7f(null);});};exports[_0x22c9('0x25')]=function(_0x7648d3,_0x30e881){return moment(_0x7648d3)['add'](_0x30e881,_0x22c9('0x26'))[_0x22c9('0x27')](_0x22c9('0x28'));};exports['subtractTime']=function(_0x58b6c1,_0x22f693){return moment(_0x58b6c1)[_0x22c9('0x29')](_0x22f693,_0x22c9('0x26'))[_0x22c9('0x27')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x22c9('0x2a')]=function(_0xcfb0f5,_0x3cdd68){return moment(_0xcfb0f5)['diff'](moment(_0x3cdd68),_0x22c9('0x26'));};exports[_0x22c9('0x2b')]=function(_0x1317bf,_0x1b8b5c){return parseInt(_0x1317bf,0xa)+parseInt(_0x1b8b5c,0xa);};exports[_0x22c9('0x2c')]=function(){return moment()[_0x22c9('0x27')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x22c9('0x2d')]=function(_0x46522d,_0x3b4703){if(_0x3b4703){return moment(_0x46522d)['isAfter'](_0x3b4703);}return!![];};exports[_0x22c9('0x2e')]=function(_0x529d1e,_0x143fac){if(_0x143fac){return moment(_0x529d1e)[_0x22c9('0x2e')](_0x143fac);}else if(_0x529d1e){return!![];}return![];}; \ No newline at end of file diff --git a/server/utils/client-side-logger.js b/server/utils/client-side-logger.js index ceb9c46..50c4517 100644 --- a/server/utils/client-side-logger.js +++ b/server/utils/client-side-logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1a81=['method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','use','device','agent_id','responseTime','other','agent_name','test','setupLoggers','fs-extra','lodash','path','util','./safe-template','safeTemplate','./mask-sensitive-data','join','/var','log','xcally','client','role','name','ensureDir','then','catch','user','no-user','timestamp','api','set','client-side-logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format'];(function(_0x2d5c70,_0x36487a){var _0x17ee2c=function(_0x861185){while(--_0x861185){_0x2d5c70['push'](_0x2d5c70['shift']());}};_0x17ee2c(++_0x36487a);}(_0x1a81,0x1e8));var _0x11a8=function(_0x49667b,_0x423b08){_0x49667b=_0x49667b-0x0;var _0x32d154=_0x1a81[_0x49667b];return _0x32d154;};var fs=require(_0x11a8('0x0'));var _=require(_0x11a8('0x1'));var ewinston=require('express-winston');var path=require(_0x11a8('0x2'));var util=require(_0x11a8('0x3'));var fileLogger=require('./loggers')['fileLogger'];var safeTemplate=require(_0x11a8('0x4'))[_0x11a8('0x5')];var maskSensitiveData=require(_0x11a8('0x6'))['maskSensitiveData'];function ClientSideLogger(){function _0x3fa57c(_0x4e3fe6){var _0x44624f=path[_0x11a8('0x7')](_0x11a8('0x8'),_0x11a8('0x9'),_0x11a8('0xa'));var _0x40735c=path[_0x11a8('0x7')](_0x11a8('0xb'),_0x4e3fe6[_0x11a8('0xc')]+'-'+_0x4e3fe6[_0x11a8('0xd')]);return fs[_0x11a8('0xe')](path[_0x11a8('0x7')](_0x44624f,_0x40735c))[_0x11a8('0xf')](function(){var _0x53c3e5=fileLogger(_0x11a8('0xb'),path[_0x11a8('0x7')](_0x44624f,_0x40735c));return _0x53c3e5;})[_0x11a8('0x10')](function(_0x3a3c9c){throw _0x3a3c9c;});}this[_0x11a8('0x9')]=function(_0x387004,_0xf91215,_0x831acd,_0x5b00c9){return _0x3fa57c(_0x387004[_0x11a8('0x11')])[_0x11a8('0xf')](function(_0x119527){var _0x335bb7=_0x119527[_0xf91215];return _0x335bb7;})[_0x11a8('0xf')](function(_0x53d69a){var _0x4edeb4=_0x387004[_0x11a8('0x11')]?_0x387004[_0x11a8('0x11')]['id']:_0x11a8('0x12');var _0x1f2a81=_0x5b00c9['data'];var _0x418dfa=_0x5b00c9[_0x11a8('0x13')];var _0x3587ef=new Date(Number(_0x418dfa));return _0x53d69a(_0x4edeb4,_0x3587ef,_0x831acd,_0x1f2a81);})['catch'](function(_0x2a4ab4){fileLogger(_0x11a8('0xb'))['error'](_0x2a4ab4);});};}function setupLoggers(_0x511a04){return new Promise(function(_0x29123f){var _0x5c4ddf=new ClientSideLogger();var _0x17c3e5=fileLogger(_0x11a8('0x14'));var _0x9164b2=fileLogger('auth');_0x511a04[_0x11a8('0x15')](_0x11a8('0x16'),_0x5c4ddf);_0x511a04['use'](ewinston['logger']({'winstonInstance':_0x17c3e5,'meta':![],'statusLevels':!![],'msg':function(_0x484b94,_0x26ec94){var _0x5d209c=_0x11a8('0x17');if(!_[_0x11a8('0x18')](_0x484b94[_0x11a8('0x19')])){_0x5d209c+=_0x11a8('0x1a');var _0x5063ee=_0x484b94[_0x11a8('0x19')];maskSensitiveData(_0x5063ee);}return safeTemplate(util[_0x11a8('0x1b')](_0x5d209c,_0x484b94[_0x11a8('0x1c')],_0x484b94[_0x11a8('0x1d')][_0x11a8('0x1e')]?_0x484b94[_0x11a8('0x1d')]['x-forwarded-for']:_0x484b94[_0x11a8('0x1f')][_0x11a8('0x20')]||_0x484b94['ip'],_0x484b94[_0x11a8('0x21')],_0x26ec94[_0x11a8('0x22')],_0x26ec94['responseTime'],_0x484b94[_0x11a8('0x11')]?_0x484b94[_0x11a8('0x11')]['id']:null,_0x484b94['user']?_0x484b94[_0x11a8('0x11')]['name']:null,_0x484b94['user']?_0x484b94['user'][_0x11a8('0xc')]:null,_0x5063ee?util['inspect'](_0x5063ee,![],null):''));}}));_0x511a04[_0x11a8('0x23')](ewinston['logger']({'winstonInstance':_0x9164b2,'meta':![],'statusLevels':!![],'msg':function(_0x55aa83,_0x524a5b){var _0x294d58='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x55aa83[_0x11a8('0x19')]&&_0x55aa83[_0x11a8('0x19')][_0x11a8('0x24')]&&_0x55aa83[_0x11a8('0x19')][_0x11a8('0x25')]){_0x294d58='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util['format'](_0x294d58,_0x55aa83['method'],_0x55aa83[_0x11a8('0x1d')][_0x11a8('0x1e')]?_0x55aa83[_0x11a8('0x1d')][_0x11a8('0x1e')]:_0x55aa83[_0x11a8('0x1f')][_0x11a8('0x20')]||_0x55aa83['ip'],_0x55aa83[_0x11a8('0x21')],_0x524a5b['statusCode'],_0x524a5b[_0x11a8('0x26')],_0x55aa83['user']?_0x55aa83[_0x11a8('0x11')]['id']:null,_0x55aa83[_0x11a8('0x11')]?_0x55aa83[_0x11a8('0x11')][_0x11a8('0xd')]:null,_0x55aa83['user']?_0x55aa83[_0x11a8('0x11')]['role']:null,_0x55aa83[_0x11a8('0x19')]&&_0x55aa83[_0x11a8('0x19')][_0x11a8('0x24')]?_0x55aa83[_0x11a8('0x19')][_0x11a8('0x24')]:_0x11a8('0x27'),_0x55aa83[_0x11a8('0x19')]&&_0x55aa83['body'][_0x11a8('0x25')]?_0x55aa83['body']['agent_id']:'',_0x55aa83[_0x11a8('0x19')]&&_0x55aa83[_0x11a8('0x19')][_0x11a8('0x28')]?_0x55aa83[_0x11a8('0x19')][_0x11a8('0x28')]:'');},'ignoreRoute':function(_0x5381b8){var _0x51f907=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x51f907[_0x11a8('0x29')](_0x5381b8[_0x11a8('0x21')]);}}));return _0x29123f();});}exports[_0x11a8('0x2a')]=setupLoggers; \ No newline at end of file +var _0xb256=['method','other','agent_name','test','setupLoggers','express-winston','./loggers','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','role','name','ensureDir','then','catch','user','no-user','data','client','error','api','auth','set','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','\x20body=%s','headers','x-forwarded-for','connection','remoteAddress','url','responseTime','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','device','agent_id','format'];(function(_0x4a9854,_0x55e3dd){var _0x326e2e=function(_0x1d0369){while(--_0x1d0369){_0x4a9854['push'](_0x4a9854['shift']());}};_0x326e2e(++_0x55e3dd);}(_0xb256,0x12b));var _0x6b25=function(_0x589f71,_0x212326){_0x589f71=_0x589f71-0x0;var _0x5763bd=_0xb256[_0x589f71];return _0x5763bd;};var fs=require('fs-extra');var _=require('lodash');var ewinston=require(_0x6b25('0x0'));var path=require('path');var util=require('util');var fileLogger=require(_0x6b25('0x1'))['fileLogger'];var safeTemplate=require(_0x6b25('0x2'))[_0x6b25('0x3')];var maskSensitiveData=require(_0x6b25('0x4'))[_0x6b25('0x5')];function ClientSideLogger(){function _0x3e599f(_0x6efcd9){var _0x202c89=path[_0x6b25('0x6')](_0x6b25('0x7'),'log','xcally');var _0x30ff18=path[_0x6b25('0x6')]('client',_0x6efcd9[_0x6b25('0x8')]+'-'+_0x6efcd9[_0x6b25('0x9')]);return fs[_0x6b25('0xa')](path[_0x6b25('0x6')](_0x202c89,_0x30ff18))[_0x6b25('0xb')](function(){var _0x38090a=fileLogger('client',path['join'](_0x202c89,_0x30ff18));return _0x38090a;})[_0x6b25('0xc')](function(_0x7b68c2){throw _0x7b68c2;});}this['log']=function(_0x3ffca5,_0x427dda,_0x319d97,_0x589f20){return _0x3e599f(_0x3ffca5[_0x6b25('0xd')])[_0x6b25('0xb')](function(_0x4d64de){var _0x243ec2=_0x4d64de[_0x427dda];return _0x243ec2;})[_0x6b25('0xb')](function(_0x5c2b3c){var _0x1da2a3=_0x3ffca5[_0x6b25('0xd')]?_0x3ffca5['user']['id']:_0x6b25('0xe');var _0x423957=_0x589f20[_0x6b25('0xf')];var _0x4099b0=_0x589f20['timestamp'];var _0x37e792=new Date(Number(_0x4099b0));return _0x5c2b3c(_0x1da2a3,_0x37e792,_0x319d97,_0x423957);})['catch'](function(_0x14fe54){fileLogger(_0x6b25('0x10'))[_0x6b25('0x11')](_0x14fe54);});};}function setupLoggers(_0x4c8ce4){return new Promise(function(_0x1ba496){var _0x5e68b1=new ClientSideLogger();var _0x2963f5=fileLogger(_0x6b25('0x12'));var _0x52ffcf=fileLogger(_0x6b25('0x13'));_0x4c8ce4[_0x6b25('0x14')]('client-side-logger',_0x5e68b1);_0x4c8ce4['use'](ewinston['logger']({'winstonInstance':_0x2963f5,'meta':![],'statusLevels':!![],'msg':function(_0x4001f4,_0x562677){var _0x295811=_0x6b25('0x15');if(!_[_0x6b25('0x16')](_0x4001f4['body'])){_0x295811+=_0x6b25('0x17');var _0x14ea4e=_0x4001f4['body'];maskSensitiveData(_0x14ea4e);}return safeTemplate(util['format'](_0x295811,_0x4001f4['method'],_0x4001f4[_0x6b25('0x18')][_0x6b25('0x19')]?_0x4001f4['headers'][_0x6b25('0x19')]:_0x4001f4[_0x6b25('0x1a')][_0x6b25('0x1b')]||_0x4001f4['ip'],_0x4001f4[_0x6b25('0x1c')],_0x562677['statusCode'],_0x562677[_0x6b25('0x1d')],_0x4001f4['user']?_0x4001f4['user']['id']:null,_0x4001f4[_0x6b25('0xd')]?_0x4001f4[_0x6b25('0xd')][_0x6b25('0x9')]:null,_0x4001f4[_0x6b25('0xd')]?_0x4001f4[_0x6b25('0xd')][_0x6b25('0x8')]:null,_0x14ea4e?util['inspect'](_0x14ea4e,![],null):''));}}));_0x4c8ce4[_0x6b25('0x1e')](ewinston[_0x6b25('0x1f')]({'winstonInstance':_0x52ffcf,'meta':![],'statusLevels':!![],'msg':function(_0x156b4e,_0x1930ad){var _0x8222f8=_0x6b25('0x20');if(_0x156b4e[_0x6b25('0x21')]&&_0x156b4e['body'][_0x6b25('0x22')]&&_0x156b4e[_0x6b25('0x21')][_0x6b25('0x23')]){_0x8222f8='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0x6b25('0x24')](_0x8222f8,_0x156b4e[_0x6b25('0x25')],_0x156b4e[_0x6b25('0x18')]['x-forwarded-for']?_0x156b4e[_0x6b25('0x18')]['x-forwarded-for']:_0x156b4e[_0x6b25('0x1a')][_0x6b25('0x1b')]||_0x156b4e['ip'],_0x156b4e[_0x6b25('0x1c')],_0x1930ad['statusCode'],_0x1930ad['responseTime'],_0x156b4e['user']?_0x156b4e[_0x6b25('0xd')]['id']:null,_0x156b4e['user']?_0x156b4e['user'][_0x6b25('0x9')]:null,_0x156b4e['user']?_0x156b4e[_0x6b25('0xd')][_0x6b25('0x8')]:null,_0x156b4e[_0x6b25('0x21')]&&_0x156b4e[_0x6b25('0x21')][_0x6b25('0x22')]?_0x156b4e['body'][_0x6b25('0x22')]:_0x6b25('0x26'),_0x156b4e[_0x6b25('0x21')]&&_0x156b4e['body']['agent_id']?_0x156b4e[_0x6b25('0x21')][_0x6b25('0x23')]:'',_0x156b4e[_0x6b25('0x21')]&&_0x156b4e['body'][_0x6b25('0x27')]?_0x156b4e['body'][_0x6b25('0x27')]:'');},'ignoreRoute':function(_0x2f91b1){var _0x198fcb=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x198fcb[_0x6b25('0x28')](_0x2f91b1['url']);}}));return _0x1ba496();});}exports[_0x6b25('0x29')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index 045d130..9f8db3a 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc241=['join','Date\x20not\x20valid','isValid','weekdaysShort','locale','indexOf','slice','concat','exports','circularDoWInterval','monthsShort','circularMonthInterval','clone','hours','minutes','isBefore','day','endOf','isBetween','timeCompare','ddd','includes','dowCompare','date','daysInMonth','max','min','domCompare','format','MMM','toLowerCase','monthCompare','split','padStart','length','moment-timezone','map','source'];(function(_0x26e081,_0x5677ed){var _0x4e91f4=function(_0x38126b){while(--_0x38126b){_0x26e081['push'](_0x26e081['shift']());}};_0x4e91f4(++_0x5677ed);}(_0xc241,0x1c5));var _0x1c24=function(_0x33523b,_0xaf579f){_0x33523b=_0x33523b-0x0;var _0x36f573=_0xc241[_0x33523b];return _0x36f573;};var _=require('lodash');var moment=require(_0x1c24('0x0'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0x1c24('0x1')](function(_0x3b2690){return _0x3b2690[_0x1c24('0x2')];})[_0x1c24('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING='Interval\x20string\x20not\x20valid';var EINVALID_DATE=_0x1c24('0x4');function throwIfDateNotValid(_0x12d1d7){if(!_0x12d1d7[_0x1c24('0x5')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x4f6a67){var _0x4a0b9b=_0x4f6a67['split'](':')[_0x1c24('0x1')](function(_0x40f09d){return parseInt(_0x40f09d,0xa);});var _0x867eba=_0x4a0b9b[0x0];var _0x2f3ce7=_0x4a0b9b[0x1];if(_0x867eba<0x0||_0x867eba>0x17||_0x2f3ce7<0x0||_0x2f3ce7>0x3b){throw new Error(EINVALID_DATE);}return[_0x867eba,_0x2f3ce7];}function circularDoWInterval(_0x47d4ca,_0x2221f8){if(_0x47d4ca===_0x2221f8){return[_0x47d4ca];}else{var _0x43e267=moment['locale']();moment['locale']('en');var _0x1706a1=moment[_0x1c24('0x6')]()[_0x1c24('0x1')](function(_0x2f91fd){return _0x2f91fd['toLowerCase']();});moment[_0x1c24('0x7')](_0x43e267);var _0x5670bd=_0x1706a1[_0x1c24('0x8')](_0x47d4ca);var _0x167d8b=_0x1706a1['indexOf'](_0x2221f8);if(_0x167d8b>_0x5670bd){return _0x1706a1[_0x1c24('0x9')](_0x5670bd,_0x167d8b+0x1);}else{var _0x5b1507=_0x1706a1['slice'](0x0,_0x167d8b+0x1);var _0x6f47ee=_0x1706a1[_0x1c24('0x9')](_0x5670bd);return _0x6f47ee[_0x1c24('0xa')](_0x5b1507);}}}module[_0x1c24('0xb')][_0x1c24('0xc')]=circularDoWInterval;function circularMonthInterval(_0x5baef9,_0x2031bf){if(_0x5baef9===_0x2031bf){return[_0x5baef9];}else{var _0x2a3299=moment[_0x1c24('0x7')]();moment[_0x1c24('0x7')]('en');var _0x5ca6d9=moment[_0x1c24('0xd')]()['map'](function(_0x3b0139){return _0x3b0139['toLowerCase']();});moment[_0x1c24('0x7')](_0x2a3299);var _0x190d3d=_0x5ca6d9[_0x1c24('0x8')](_0x5baef9);var _0x19159e=_0x5ca6d9['indexOf'](_0x2031bf);if(_0x19159e>_0x190d3d){return _0x5ca6d9[_0x1c24('0x9')](_0x190d3d,_0x19159e+0x1);}else{var _0x5587d7=_0x5ca6d9[_0x1c24('0x9')](0x0,_0x19159e+0x1);var _0x46a6ee=_0x5ca6d9['slice'](_0x190d3d);return _0x46a6ee['concat'](_0x5587d7);}}}module[_0x1c24('0xb')][_0x1c24('0xe')]=circularMonthInterval;function parseDom(_0x4970f3){var _0x231192=parseInt(_0x4970f3,0xa);if(_0x231192<0x1||_0x231192>0x1f){throw new Error(EINVALID_DATE);}return _0x231192;}function timeCompare(_0x325df4,_0x8d0266,_0x5567d7){var _0x3ad7b5=_0x325df4[_0x1c24('0xf')]();var _0x5b346a=extractTime(_0x8d0266);var _0x3a4181=_0x5b346a[0x0];var _0x5aa2c7=_0x5b346a[0x1];var _0x12c6cc=_0x325df4[_0x1c24('0xf')]()[_0x1c24('0x10')](_0x3a4181)[_0x1c24('0x11')](_0x5aa2c7);throwIfDateNotValid(_0x12c6cc);var _0x16fe76=extractTime(_0x5567d7);var _0x57f974=_0x16fe76[0x0];var _0xceaa80=_0x16fe76[0x1];var _0x21f624=_0x325df4[_0x1c24('0xf')]()[_0x1c24('0x10')](_0x57f974)[_0x1c24('0x11')](_0xceaa80);throwIfDateNotValid(_0x21f624);if(_0x21f624[_0x1c24('0x12')](_0x12c6cc)){var _0x49e66f=_0x3ad7b5[_0x1c24('0xf')]()['startOf'](_0x1c24('0x13'));var _0x4b0a96=_0x3ad7b5[_0x1c24('0xf')]()[_0x1c24('0x14')](_0x1c24('0x13'));return _0x3ad7b5[_0x1c24('0x15')](_0x12c6cc,_0x4b0a96,undefined,'[]')||_0x3ad7b5[_0x1c24('0x15')](_0x49e66f,_0x21f624,undefined,'[]');}else{return _0x3ad7b5[_0x1c24('0x15')](_0x12c6cc,_0x21f624,undefined,'[]');}}module['exports'][_0x1c24('0x16')]=timeCompare;function dowCompare(_0x27f4c9,_0x5ea422,_0x409f51){var _0x343954=_0x27f4c9['locale']('en')['format'](_0x1c24('0x17'))['toLowerCase']();return circularDoWInterval(_0x5ea422,_0x409f51)[_0x1c24('0x18')](_0x343954);}module['exports'][_0x1c24('0x19')]=dowCompare;function domCompare(_0x167147,_0x38581b,_0x41a2a5){var _0x342576=_0x167147[_0x1c24('0x1a')]();if(_0x38581b===_0x41a2a5){return _0x342576===_0x38581b;}else{var _0x467004=_0x167147[_0x1c24('0x1b')]();var _0x2bba43=_0x38581b<_0x41a2a5;let _0x54f107=![];var _0x10604e=0x0;var _0x4fc2a7=0x0;if(_0x2bba43){_0x10604e=Math[_0x1c24('0x1c')](0x1,_0x38581b);_0x4fc2a7=Math[_0x1c24('0x1d')](_0x41a2a5,_0x467004);_0x54f107=_0x342576>=_0x10604e&&_0x342576<=_0x4fc2a7;}else{_0x10604e=Math[_0x1c24('0x1d')](_0x38581b,_0x467004);_0x4fc2a7=Math['max'](0x1,_0x41a2a5);_0x54f107=_0x342576>=_0x10604e||_0x342576<=_0x4fc2a7;}return _0x54f107;}}module[_0x1c24('0xb')][_0x1c24('0x1e')]=domCompare;function monthCompare(_0x78d63d,_0x2a1a14,_0x14ea30){var _0xc9770=_0x78d63d[_0x1c24('0x7')]('en')[_0x1c24('0x1f')](_0x1c24('0x20'))[_0x1c24('0x21')]();return circularMonthInterval(_0x2a1a14,_0x14ea30)[_0x1c24('0x18')](_0xc9770);}module[_0x1c24('0xb')][_0x1c24('0x22')]=monthCompare;function iftime(_0x555c28,_0x36d1a6=moment['tz']['guess'](),_0x144334=moment()){if(!validateRx['test'](_0x555c28)){throw new Error(EINVALID_STRING);}else{var _0x4ab896=(moment['isMoment'](_0x144334)?_0x144334[_0x1c24('0xf')]():moment(_0x144334))['tz'](_0x36d1a6)[_0x1c24('0x7')]('en');throwIfDateNotValid(_0x4ab896);var _0x266737=_0x555c28['split'](',');var _0x1654a3=_0x266737[0x0];var _0x4e0cfb=_0x266737[0x1];var _0xdf7900=_0x266737[0x2];var _0x2eb5ba=_0x266737[0x3];let _0x1c6e28=!![];if(_0x1654a3!=='*'){var _0x4a50fa=_0x1654a3[_0x1c24('0x23')]('-');var _0xc2dcf4=_[_0x1c24('0x24')](_0x4a50fa[0x0],0x5,'0');var _0x4ab286=_0x4a50fa['length']===0x2?_['padStart'](_0x4a50fa[0x1],0x5,'0'):_0xc2dcf4;_0x1c6e28=timeCompare(_0x4ab896,_0xc2dcf4,_0x4ab286);}let _0x371630=!![];if(_0x4e0cfb!=='*'){var _0x6fa6bd=_0x4e0cfb[_0x1c24('0x23')]('-');var _0x8ae48d=_0x6fa6bd[0x0];var _0x21c2b9=_0x6fa6bd[_0x1c24('0x25')]===0x2?_0x6fa6bd[0x1]:_0x8ae48d;_0x371630=dowCompare(_0x4ab896,_0x8ae48d,_0x21c2b9);}let _0x14510b=!![];if(_0xdf7900!=='*'){var _0x414191=_0xdf7900[_0x1c24('0x23')]('-');var _0x253257=parseDom(_0x414191[0x0]);var _0x183ddf=_0x414191[_0x1c24('0x25')]===0x2?parseDom(_0x414191[0x1]):_0x253257;_0x14510b=domCompare(_0x4ab896,_0x253257,_0x183ddf);}let _0x2b1584=!![];if(_0x2eb5ba!=='*'){var _0x52b742=_0x2eb5ba[_0x1c24('0x23')]('-');var _0x5d8c9a=_0x52b742[0x0];var _0x5ab2c2=_0x52b742[_0x1c24('0x25')]===0x2?_0x52b742[0x1]:_0x52b742[0x0];_0x2b1584=monthCompare(_0x4ab896,_0x5d8c9a,_0x5ab2c2);}return _0x1c6e28&&_0x371630&&_0x14510b&&_0x2b1584;}}module['exports']['iftime']=iftime; \ No newline at end of file +var _0xeb2f=['join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','split','locale','weekdaysShort','toLowerCase','indexOf','slice','concat','circularDoWInterval','monthsShort','exports','clone','hours','minutes','isBefore','startOf','isBetween','timeCompare','format','includes','dowCompare','max','min','domCompare','MMM','monthCompare','guess','test','isMoment','padStart','length','iftime','lodash','moment-timezone','map','source'];(function(_0x1a48f2,_0x5d2109){var _0x2b46c6=function(_0x32a496){while(--_0x32a496){_0x1a48f2['push'](_0x1a48f2['shift']());}};_0x2b46c6(++_0x5d2109);}(_0xeb2f,0x98));var _0xfeb2=function(_0x4d1120,_0x57f789){_0x4d1120=_0x4d1120-0x0;var _0x350c20=_0xeb2f[_0x4d1120];return _0x350c20;};var _=require(_0xfeb2('0x0'));var moment=require(_0xfeb2('0x1'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0xfeb2('0x2')](function(_0x44dd6e){return _0x44dd6e[_0xfeb2('0x3')];})[_0xfeb2('0x4')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0xfeb2('0x5');var EINVALID_DATE=_0xfeb2('0x6');function throwIfDateNotValid(_0x500139){if(!_0x500139[_0xfeb2('0x7')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x5b0e4b){var _0x37e526=_0x5b0e4b[_0xfeb2('0x8')](':')[_0xfeb2('0x2')](function(_0x523d89){return parseInt(_0x523d89,0xa);});var _0x10e42e=_0x37e526[0x0];var _0x3f9215=_0x37e526[0x1];if(_0x10e42e<0x0||_0x10e42e>0x17||_0x3f9215<0x0||_0x3f9215>0x3b){throw new Error(EINVALID_DATE);}return[_0x10e42e,_0x3f9215];}function circularDoWInterval(_0x3bba2b,_0xa6ba20){if(_0x3bba2b===_0xa6ba20){return[_0x3bba2b];}else{var _0x4e8995=moment[_0xfeb2('0x9')]();moment[_0xfeb2('0x9')]('en');var _0x786bbd=moment[_0xfeb2('0xa')]()[_0xfeb2('0x2')](function(_0x594d82){return _0x594d82[_0xfeb2('0xb')]();});moment[_0xfeb2('0x9')](_0x4e8995);var _0x2be110=_0x786bbd[_0xfeb2('0xc')](_0x3bba2b);var _0x2c6c85=_0x786bbd[_0xfeb2('0xc')](_0xa6ba20);if(_0x2c6c85>_0x2be110){return _0x786bbd[_0xfeb2('0xd')](_0x2be110,_0x2c6c85+0x1);}else{var _0x3ffbb1=_0x786bbd['slice'](0x0,_0x2c6c85+0x1);var _0x557321=_0x786bbd[_0xfeb2('0xd')](_0x2be110);return _0x557321[_0xfeb2('0xe')](_0x3ffbb1);}}}module['exports'][_0xfeb2('0xf')]=circularDoWInterval;function circularMonthInterval(_0x50f54b,_0x5ceb24){if(_0x50f54b===_0x5ceb24){return[_0x50f54b];}else{var _0x29be8d=moment['locale']();moment[_0xfeb2('0x9')]('en');var _0x50657d=moment[_0xfeb2('0x10')]()['map'](function(_0x3988f0){return _0x3988f0[_0xfeb2('0xb')]();});moment['locale'](_0x29be8d);var _0x308dd3=_0x50657d[_0xfeb2('0xc')](_0x50f54b);var _0x322b21=_0x50657d['indexOf'](_0x5ceb24);if(_0x322b21>_0x308dd3){return _0x50657d['slice'](_0x308dd3,_0x322b21+0x1);}else{var _0x137ba6=_0x50657d[_0xfeb2('0xd')](0x0,_0x322b21+0x1);var _0xd5b716=_0x50657d['slice'](_0x308dd3);return _0xd5b716['concat'](_0x137ba6);}}}module[_0xfeb2('0x11')]['circularMonthInterval']=circularMonthInterval;function parseDom(_0x5cc1f6){var _0x339aa8=parseInt(_0x5cc1f6,0xa);if(_0x339aa8<0x1||_0x339aa8>0x1f){throw new Error(EINVALID_DATE);}return _0x339aa8;}function timeCompare(_0x413777,_0x13e95d,_0x151980){var _0x2c8aac=_0x413777[_0xfeb2('0x12')]();var _0x507596=extractTime(_0x13e95d);var _0xadefad=_0x507596[0x0];var _0x1cfbdc=_0x507596[0x1];var _0x27dcb8=_0x413777[_0xfeb2('0x12')]()[_0xfeb2('0x13')](_0xadefad)[_0xfeb2('0x14')](_0x1cfbdc);throwIfDateNotValid(_0x27dcb8);var _0x280186=extractTime(_0x151980);var _0x253d7a=_0x280186[0x0];var _0x306a3a=_0x280186[0x1];var _0x319748=_0x413777[_0xfeb2('0x12')]()[_0xfeb2('0x13')](_0x253d7a)[_0xfeb2('0x14')](_0x306a3a);throwIfDateNotValid(_0x319748);if(_0x319748[_0xfeb2('0x15')](_0x27dcb8)){var _0x543db2=_0x2c8aac[_0xfeb2('0x12')]()[_0xfeb2('0x16')]('day');var _0x2ca6f3=_0x2c8aac['clone']()['endOf']('day');return _0x2c8aac[_0xfeb2('0x17')](_0x27dcb8,_0x2ca6f3,undefined,'[]')||_0x2c8aac[_0xfeb2('0x17')](_0x543db2,_0x319748,undefined,'[]');}else{return _0x2c8aac[_0xfeb2('0x17')](_0x27dcb8,_0x319748,undefined,'[]');}}module[_0xfeb2('0x11')][_0xfeb2('0x18')]=timeCompare;function dowCompare(_0x1cfc36,_0x2fb71e,_0x5ba075){var _0x566690=_0x1cfc36[_0xfeb2('0x9')]('en')[_0xfeb2('0x19')]('ddd')['toLowerCase']();return circularDoWInterval(_0x2fb71e,_0x5ba075)[_0xfeb2('0x1a')](_0x566690);}module[_0xfeb2('0x11')][_0xfeb2('0x1b')]=dowCompare;function domCompare(_0x371211,_0x30604c,_0x5ab092){var _0x3ec37e=_0x371211['date']();if(_0x30604c===_0x5ab092){return _0x3ec37e===_0x30604c;}else{var _0x369041=_0x371211['daysInMonth']();var _0x10ddab=_0x30604c<_0x5ab092;let _0x4d96b7=![];var _0xfd3a10=0x0;var _0x1d616a=0x0;if(_0x10ddab){_0xfd3a10=Math[_0xfeb2('0x1c')](0x1,_0x30604c);_0x1d616a=Math[_0xfeb2('0x1d')](_0x5ab092,_0x369041);_0x4d96b7=_0x3ec37e>=_0xfd3a10&&_0x3ec37e<=_0x1d616a;}else{_0xfd3a10=Math[_0xfeb2('0x1d')](_0x30604c,_0x369041);_0x1d616a=Math[_0xfeb2('0x1c')](0x1,_0x5ab092);_0x4d96b7=_0x3ec37e>=_0xfd3a10||_0x3ec37e<=_0x1d616a;}return _0x4d96b7;}}module[_0xfeb2('0x11')][_0xfeb2('0x1e')]=domCompare;function monthCompare(_0x128242,_0x24895b,_0x3f6c40){var _0x3ee64f=_0x128242[_0xfeb2('0x9')]('en')[_0xfeb2('0x19')](_0xfeb2('0x1f'))[_0xfeb2('0xb')]();return circularMonthInterval(_0x24895b,_0x3f6c40)['includes'](_0x3ee64f);}module[_0xfeb2('0x11')][_0xfeb2('0x20')]=monthCompare;function iftime(_0x5b25a6,_0x591d58=moment['tz'][_0xfeb2('0x21')](),_0x2cb909=moment()){if(!validateRx[_0xfeb2('0x22')](_0x5b25a6)){throw new Error(EINVALID_STRING);}else{var _0xee111a=(moment[_0xfeb2('0x23')](_0x2cb909)?_0x2cb909[_0xfeb2('0x12')]():moment(_0x2cb909))['tz'](_0x591d58)[_0xfeb2('0x9')]('en');throwIfDateNotValid(_0xee111a);var _0x413a39=_0x5b25a6[_0xfeb2('0x8')](',');var _0x4c8291=_0x413a39[0x0];var _0xd27bb3=_0x413a39[0x1];var _0x2f9275=_0x413a39[0x2];var _0x26b79d=_0x413a39[0x3];let _0xa56fb9=!![];if(_0x4c8291!=='*'){var _0x4b5a67=_0x4c8291[_0xfeb2('0x8')]('-');var _0x5b050b=_[_0xfeb2('0x24')](_0x4b5a67[0x0],0x5,'0');var _0xca34aa=_0x4b5a67[_0xfeb2('0x25')]===0x2?_[_0xfeb2('0x24')](_0x4b5a67[0x1],0x5,'0'):_0x5b050b;_0xa56fb9=timeCompare(_0xee111a,_0x5b050b,_0xca34aa);}let _0x430ecf=!![];if(_0xd27bb3!=='*'){var _0x5ea0c1=_0xd27bb3[_0xfeb2('0x8')]('-');var _0x6bd02=_0x5ea0c1[0x0];var _0x49bacd=_0x5ea0c1[_0xfeb2('0x25')]===0x2?_0x5ea0c1[0x1]:_0x6bd02;_0x430ecf=dowCompare(_0xee111a,_0x6bd02,_0x49bacd);}let _0x25f0a6=!![];if(_0x2f9275!=='*'){var _0x35e59e=_0x2f9275['split']('-');var _0x4783e7=parseDom(_0x35e59e[0x0]);var _0x59d363=_0x35e59e[_0xfeb2('0x25')]===0x2?parseDom(_0x35e59e[0x1]):_0x4783e7;_0x25f0a6=domCompare(_0xee111a,_0x4783e7,_0x59d363);}let _0x55fe2a=!![];if(_0x26b79d!=='*'){var _0x2c5b86=_0x26b79d['split']('-');var _0x59c929=_0x2c5b86[0x0];var _0xe000c4=_0x2c5b86[_0xfeb2('0x25')]===0x2?_0x2c5b86[0x1]:_0x2c5b86[0x0];_0x55fe2a=monthCompare(_0xee111a,_0x59c929,_0xe000c4);}return _0xa56fb9&&_0x430ecf&&_0x25f0a6&&_0x55fe2a;}}module['exports'][_0xfeb2('0x26')]=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index e532347..44516f2 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd9a1=['util','winston','debugLevel','info','redBG\x20white','red','bold\x20yellow','white','bold\x20white','bold\x20green','bold\x20magenta','bold\x20cyan','addColors','/var/log/xcally','join','format','message','replace','{{{','}}}','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','meta','keys','length','Console','Logger','File','%s-%s','error','warn','fileLogger','path'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xd9a1,0x65));var _0x1d9a=function(_0x92bc95,_0x2dbcc0){_0x92bc95=_0x92bc95-0x0;var _0x1d671e=_0xd9a1[_0x92bc95];return _0x1d671e;};'use strict';var path=require(_0x1d9a('0x0'));var util=require(_0x1d9a('0x1'));var moment=require('moment');var winston=require(_0x1d9a('0x2'));var config=require('../config/environment');var debugLevel=config[_0x1d9a('0x3')]?config[_0x1d9a('0x3')]['toLowerCase']():_0x1d9a('0x4');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x1d9a('0x5'),'error':_0x1d9a('0x6'),'warn':_0x1d9a('0x7'),'info':_0x1d9a('0x8'),'print':_0x1d9a('0x9'),'success':_0x1d9a('0xa'),'http':'gray','verbose':_0x1d9a('0xb'),'debug':'bold\x20blue','silly':_0x1d9a('0xc')};winston[_0x1d9a('0xd')](XC_LOG_COLORS);function getLogFileName(_0x1d5018,_0x5ab798,_0x1fe184){var _0x30fdcf=_0x1d5018||_0x1d9a('0xe');return path[_0x1d9a('0xf')](_0x30fdcf,util[_0x1d9a('0x10')]('%s-%s.log',_0x5ab798,_0x1fe184));}function formatter(_0x393dd3,_0x23140f){_0x23140f['message']=_0x23140f[_0x1d9a('0x11')][_0x1d9a('0x12')](/@@{/g,_0x1d9a('0x13'))[_0x1d9a('0x12')](/}@@/g,_0x1d9a('0x14'))[_0x1d9a('0x12')](/@{/g,'{{')[_0x1d9a('0x12')](/}@/g,'}}');return util['format']('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x1d9a('0x10')](_0x1d9a('0x15')),_0x23140f[_0x1d9a('0x16')][_0x1d9a('0x17')](),_0x393dd3,_0x23140f['message']);}function fileFormat(_0x1ee5e2,_0x15ef1e){_0x15ef1e[_0x1d9a('0x11')]=_0x15ef1e['message'][_0x1d9a('0x12')](/@@{/g,_0x1d9a('0x13'))[_0x1d9a('0x12')](/}@@/g,_0x1d9a('0x14'))[_0x1d9a('0x12')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x1ce833=_0x15ef1e[_0x1d9a('0x18')]&&Object[_0x1d9a('0x19')](_0x15ef1e[_0x1d9a('0x18')])[_0x1d9a('0x1a')]?'\x0a\x09'+JSON['stringify'](_0x15ef1e[_0x1d9a('0x18')]):'';return util['format']('[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s',moment()['format'](_0x1d9a('0x15')),_0x15ef1e['level'][_0x1d9a('0x17')](),_0x1ee5e2,_0x15ef1e[_0x1d9a('0x11')],_0x1ce833);}function consoleLogger(){var _0x58bd96=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x1d9a('0x1b'))]({'level':'warn','json':![],'formatter':function(_0x597cbb){return formatter('',_0x597cbb);}})]});return _0x58bd96;}function fileLogger(_0x35f60c,_0x5c0c4a){var _0x12c1ef=new winston[(_0x1d9a('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x1d9a('0x1d'))]({'name':util['format'](_0x1d9a('0x1e'),_0x35f60c,_0x1d9a('0x1f')),'filename':getLogFileName(_0x5c0c4a,_0x35f60c,_0x1d9a('0x1f')),'level':_0x1d9a('0x1f'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x12cc94){return fileFormat(_0x35f60c,_0x12cc94);}}),new winston['transports'][(_0x1d9a('0x1d'))]({'name':util[_0x1d9a('0x10')](_0x1d9a('0x1e'),_0x35f60c,debugLevel),'filename':getLogFileName(_0x5c0c4a,_0x35f60c,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x254d22){return fileFormat(_0x35f60c,_0x254d22);}}),new winston['transports'][(_0x1d9a('0x1b'))]({'level':_0x1d9a('0x20'),'json':![],'formatter':function(_0x336bbe){return fileFormat(_0x35f60c,_0x336bbe);}})]});return _0x12c1ef;}exports['consoleLogger']=consoleLogger;exports[_0x1d9a('0x21')]=fileLogger; \ No newline at end of file +var _0x02a2=['keys','length','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','level','toUpperCase','Logger','transports','Console','File','%s-%s','error','warn','consoleLogger','fileLogger','path','util','moment','winston','debugLevel','toLowerCase','redBG\x20white','red','bold\x20yellow','white','bold\x20white','bold\x20green','bold\x20magenta','bold\x20blue','bold\x20cyan','/var/log/xcally','format','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','meta'];(function(_0x1b7b34,_0x4c7995){var _0x7c9776=function(_0x20bfcd){while(--_0x20bfcd){_0x1b7b34['push'](_0x1b7b34['shift']());}};_0x7c9776(++_0x4c7995);}(_0x02a2,0x1b0));var _0x202a=function(_0x13bf4c,_0x1b339b){_0x13bf4c=_0x13bf4c-0x0;var _0x3d2f8e=_0x02a2[_0x13bf4c];return _0x3d2f8e;};'use strict';var path=require(_0x202a('0x0'));var util=require(_0x202a('0x1'));var moment=require(_0x202a('0x2'));var winston=require(_0x202a('0x3'));var config=require('../config/environment');var debugLevel=config[_0x202a('0x4')]?config[_0x202a('0x4')][_0x202a('0x5')]():'info';var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x202a('0x6'),'error':_0x202a('0x7'),'warn':_0x202a('0x8'),'info':_0x202a('0x9'),'print':_0x202a('0xa'),'success':_0x202a('0xb'),'http':'gray','verbose':_0x202a('0xc'),'debug':_0x202a('0xd'),'silly':_0x202a('0xe')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x30d58a,_0x4d93da,_0x307f17){var _0x4b287a=_0x30d58a||_0x202a('0xf');return path['join'](_0x4b287a,util[_0x202a('0x10')]('%s-%s.log',_0x4d93da,_0x307f17));}function formatter(_0x15e0fb,_0x2e7f33){_0x2e7f33[_0x202a('0x11')]=_0x2e7f33[_0x202a('0x11')][_0x202a('0x12')](/@@{/g,_0x202a('0x13'))['replace'](/}@@/g,_0x202a('0x14'))[_0x202a('0x12')](/@{/g,'{{')[_0x202a('0x12')](/}@/g,'}}');return util['format'](_0x202a('0x15'),moment()['format'](_0x202a('0x16')),_0x2e7f33['level']['toUpperCase'](),_0x15e0fb,_0x2e7f33[_0x202a('0x11')]);}function fileFormat(_0x3993cf,_0x1798b0){_0x1798b0[_0x202a('0x11')]=_0x1798b0['message'][_0x202a('0x12')](/@@{/g,_0x202a('0x13'))[_0x202a('0x12')](/}@@/g,_0x202a('0x14'))[_0x202a('0x12')](/@{/g,'{{')[_0x202a('0x12')](/}@/g,'}}');var _0x5bb867=_0x1798b0[_0x202a('0x17')]&&Object[_0x202a('0x18')](_0x1798b0[_0x202a('0x17')])[_0x202a('0x19')]?'\x0a\x09'+JSON['stringify'](_0x1798b0[_0x202a('0x17')]):'';return util[_0x202a('0x10')](_0x202a('0x1a'),moment()[_0x202a('0x10')](_0x202a('0x16')),_0x1798b0[_0x202a('0x1b')][_0x202a('0x1c')](),_0x3993cf,_0x1798b0[_0x202a('0x11')],_0x5bb867);}function consoleLogger(){var _0x5169ac=new winston[(_0x202a('0x1d'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x202a('0x1e'))][(_0x202a('0x1f'))]({'level':'warn','json':![],'formatter':function(_0x275bd2){return formatter('',_0x275bd2);}})]});return _0x5169ac;}function fileLogger(_0x200965,_0x18f271){var _0x36afa3=new winston[(_0x202a('0x1d'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x202a('0x20'))]({'name':util['format'](_0x202a('0x21'),_0x200965,'error'),'filename':getLogFileName(_0x18f271,_0x200965,_0x202a('0x22')),'level':_0x202a('0x22'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x33e3cb){return fileFormat(_0x200965,_0x33e3cb);}}),new winston['transports']['File']({'name':util['format']('%s-%s',_0x200965,debugLevel),'filename':getLogFileName(_0x18f271,_0x200965,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x64bf8b){return fileFormat(_0x200965,_0x64bf8b);}}),new winston['transports'][(_0x202a('0x1f'))]({'level':_0x202a('0x23'),'json':![],'formatter':function(_0x153462){return fileFormat(_0x200965,_0x153462);}})]});return _0x36afa3;}exports[_0x202a('0x24')]=consoleLogger;exports[_0x202a('0x25')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index a4f9bab..1981b84 100644 --- a/server/utils/mask-sensitive-data.js +++ b/server/utils/mask-sensitive-data.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x66fa=['calleridnum','vidaooApiKey','privateKey','secretaccesskey','key','user','localstationid','oldPassword','isPlainObject','length','isString','replace','includes','exports','maskSensitiveData','lodash','username','newPassword','apiKey','firstName','lastName','street','phone','mobile','clientId','clientSecret','securityToken','code','accessKey','token','accessToken','authToken','calleridname'];(function(_0x451e52,_0x536a21){var _0x18a061=function(_0x122372){while(--_0x122372){_0x451e52['push'](_0x451e52['shift']());}};_0x18a061(++_0x536a21);}(_0x66fa,0x117));var _0xa66f=function(_0x217758,_0x16b285){_0x217758=_0x217758-0x0;var _0x37a035=_0x66fa[_0x217758];return _0x37a035;};var _=require(_0xa66f('0x0'));var sensitiveFields=[_0xa66f('0x1'),'password',_0xa66f('0x2'),_0xa66f('0x3'),_0xa66f('0x4'),_0xa66f('0x5'),_0xa66f('0x6'),_0xa66f('0x7'),_0xa66f('0x8'),'fax','email',_0xa66f('0x9'),_0xa66f('0xa'),_0xa66f('0xb'),_0xa66f('0xc'),_0xa66f('0xd'),'tenantId',_0xa66f('0xe'),'channelSecret',_0xa66f('0xf'),'accessTokenSecret',_0xa66f('0x10'),'consumerKey','consumerSecret','membername',_0xa66f('0x11'),_0xa66f('0x12'),'exten',_0xa66f('0x13'),'clientEmail',_0xa66f('0x14'),'accesskeyid',_0xa66f('0x15'),_0xa66f('0x16'),_0xa66f('0x17'),'pass','accountSid',_0xa66f('0x18'),'dsn','secret','registry',_0xa66f('0x19')];function maskSensitiveData(_0x452c37){const _0x267129=/(?!^)[\s\S](?!$)/g;if(_[_0xa66f('0x1a')](_0x452c37)){for(const _0xd348f9 in _0x452c37){if(_['isArray'](_0x452c37[_0xd348f9])){for(let _0x5510dc=0x0;_0x5510dc<_0x452c37[_0xd348f9][_0xa66f('0x1b')];_0x5510dc++){maskSensitiveData(_0x452c37[_0xd348f9][_0x5510dc]);}}else if(_[_0xa66f('0x1a')](_0x452c37[_0xd348f9])){maskSensitiveData(_0x452c37[_0xd348f9]);}else if(_[_0xa66f('0x1c')](_0x452c37[_0xd348f9])){_0x452c37[_0xd348f9]=_0x452c37[_0xd348f9][_0xa66f('0x1d')](/{{{/g,'@@{')[_0xa66f('0x1d')](/}}}/g,'}@@')['replace'](/{{/g,'@{')[_0xa66f('0x1d')](/}}/g,'}@');if(_[_0xa66f('0x1e')](sensitiveFields,_0xd348f9)){_0x452c37[_0xd348f9]=_0x452c37[_0xd348f9][_0xa66f('0x1d')](_0x267129,'*');}}}}}module[_0xa66f('0x1f')][_0xa66f('0x20')]=maskSensitiveData; \ No newline at end of file +var _0xdb28=['registry','oldPassword','isPlainObject','length','isString','replace','@@{','}@@','exports','maskSensitiveData','lodash','username','password','newPassword','firstName','lastName','street','phone','mobile','email','clientId','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','consumerKey','consumerSecret','membername','calleridnum','exten','clientEmail','privateKey','accesskeyid','secretaccesskey','key','accountSid','localstationid','dsn','secret'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xdb28,0x106));var _0x8db2=function(_0x2e8e2f,_0x5593a2){_0x2e8e2f=_0x2e8e2f-0x0;var _0x2b90b3=_0xdb28[_0x2e8e2f];return _0x2b90b3;};var _=require(_0x8db2('0x0'));var sensitiveFields=[_0x8db2('0x1'),_0x8db2('0x2'),_0x8db2('0x3'),'apiKey',_0x8db2('0x4'),_0x8db2('0x5'),_0x8db2('0x6'),_0x8db2('0x7'),_0x8db2('0x8'),'fax',_0x8db2('0x9'),_0x8db2('0xa'),'clientSecret','securityToken',_0x8db2('0xb'),_0x8db2('0xc'),_0x8db2('0xd'),_0x8db2('0xe'),_0x8db2('0xf'),_0x8db2('0x10'),_0x8db2('0x11'),'authToken',_0x8db2('0x12'),_0x8db2('0x13'),_0x8db2('0x14'),'calleridname',_0x8db2('0x15'),_0x8db2('0x16'),'vidaooApiKey',_0x8db2('0x17'),_0x8db2('0x18'),_0x8db2('0x19'),_0x8db2('0x1a'),_0x8db2('0x1b'),'user','pass',_0x8db2('0x1c'),_0x8db2('0x1d'),_0x8db2('0x1e'),_0x8db2('0x1f'),_0x8db2('0x20'),_0x8db2('0x21')];function maskSensitiveData(_0x2f177a){const _0x3c96a7=/(?!^)[\s\S](?!$)/g;if(_[_0x8db2('0x22')](_0x2f177a)){for(const _0x16c8c2 in _0x2f177a){if(_['isArray'](_0x2f177a[_0x16c8c2])){for(let _0x13b0f5=0x0;_0x13b0f5<_0x2f177a[_0x16c8c2][_0x8db2('0x23')];_0x13b0f5++){maskSensitiveData(_0x2f177a[_0x16c8c2][_0x13b0f5]);}}else if(_['isPlainObject'](_0x2f177a[_0x16c8c2])){maskSensitiveData(_0x2f177a[_0x16c8c2]);}else if(_[_0x8db2('0x24')](_0x2f177a[_0x16c8c2])){_0x2f177a[_0x16c8c2]=_0x2f177a[_0x16c8c2][_0x8db2('0x25')](/{{{/g,_0x8db2('0x26'))[_0x8db2('0x25')](/}}}/g,_0x8db2('0x27'))[_0x8db2('0x25')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x16c8c2)){_0x2f177a[_0x16c8c2]=_0x2f177a[_0x16c8c2][_0x8db2('0x25')](_0x3c96a7,'*');}}}}}module[_0x8db2('0x28')][_0x8db2('0x29')]=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index d766397..0ee73b4 100644 --- a/server/utils/safe-template.js +++ b/server/utils/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34b7=['string','replace','isPlainObject','keys','reduce','safeTemplate','{\x20{\x20','\x20}\x20}'];(function(_0x101125,_0x2c5953){var _0x40f6b0=function(_0x58a6fc){while(--_0x58a6fc){_0x101125['push'](_0x101125['shift']());}};_0x40f6b0(++_0x2c5953);}(_0x34b7,0x196));var _0x734b=function(_0x1bffc9,_0x505bf0){_0x1bffc9=_0x1bffc9-0x0;var _0x26177e=_0x34b7[_0x1bffc9];return _0x26177e;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x57123d){return _0x57123d==='{{'?_0x734b('0x0'):_0x734b('0x1');}function safeTemplate(_0x6e4318){var _0x354f96=_0x6e4318;if(typeof _0x6e4318===_0x734b('0x2')){_0x354f96=_0x6e4318[_0x734b('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x6e4318)){_0x354f96=_0x6e4318['map'](function(_0x303067){return safeTemplate(_0x303067);});}else if(_[_0x734b('0x4')](_0x6e4318)){_0x354f96=Object[_0x734b('0x5')](_0x6e4318)[_0x734b('0x6')](function(_0x28918a,_0x35d685){_0x28918a[_0x35d685]=safeTemplate(_0x6e4318[_0x35d685]);return _0x28918a;},{});}return _0x354f96;}module['exports'][_0x734b('0x7')]=safeTemplate; \ No newline at end of file +var _0xd7d1=['isArray','map','isPlainObject','keys','exports','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string','replace'];(function(_0x47f0ac,_0x147d60){var _0x263ee9=function(_0x3b423e){while(--_0x3b423e){_0x47f0ac['push'](_0x47f0ac['shift']());}};_0x263ee9(++_0x147d60);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x8b8a8,_0x453dc2){_0x8b8a8=_0x8b8a8-0x0;var _0x46b27d=_0xd7d1[_0x8b8a8];return _0x46b27d;};var _=require(_0x1d7d('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x23f73c){return _0x23f73c==='{{'?_0x1d7d('0x1'):_0x1d7d('0x2');}function safeTemplate(_0x1d1926){var _0x3c3a27=_0x1d1926;if(typeof _0x1d1926===_0x1d7d('0x3')){_0x3c3a27=_0x1d1926[_0x1d7d('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x1d7d('0x5')](_0x1d1926)){_0x3c3a27=_0x1d1926[_0x1d7d('0x6')](function(_0x3c0839){return safeTemplate(_0x3c0839);});}else if(_[_0x1d7d('0x7')](_0x1d1926)){_0x3c3a27=Object[_0x1d7d('0x8')](_0x1d1926)['reduce'](function(_0x462ef8,_0x1aa456){_0x462ef8[_0x1aa456]=safeTemplate(_0x1d1926[_0x1aa456]);return _0x462ef8;},{});}return _0x3c3a27;}module[_0x1d7d('0x9')][_0x1d7d('0xa')]=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index 79ac437..9d2bf23 100644 --- a/server/utils/update-app-config.js +++ b/server/utils/update-app-config.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7b24=['Updating\x20app.json','writeJSON','exports','fs-extra','path','../config/environment','root','resolve','server/app.json','legacy-libs','isArray','findIndex','name','motion2','apps','env','NODE_PATH','string','pathExists','then','readJSON','info'];(function(_0x5cf93c,_0x2b5075){var _0x56aa24=function(_0x20b2ee){while(--_0x20b2ee){_0x5cf93c['push'](_0x5cf93c['shift']());}};_0x56aa24(++_0x2b5075);}(_0x7b24,0x137));var _0x47b2=function(_0x24990a,_0x2e136c){_0x24990a=_0x24990a-0x0;var _0xf47942=_0x7b24[_0x24990a];return _0xf47942;};var fs=require(_0x47b2('0x0'));var path=require(_0x47b2('0x1'));var config=require(_0x47b2('0x2'));var root=config[_0x47b2('0x3')];var APP_JSON_PATH=path[_0x47b2('0x4')](root,_0x47b2('0x5'));var NODEPATH=path[_0x47b2('0x4')](root,_0x47b2('0x6'));function setLegacyLibsNodeEnvPath(_0x41ab31){let _0x19933c=![];if(Array[_0x47b2('0x7')](_0x41ab31['apps'])){var _0x22dab2=_0x41ab31['apps'][_0x47b2('0x8')](function(_0x4e52cf){return _0x4e52cf[_0x47b2('0x9')]===_0x47b2('0xa');});if(_0x22dab2>-0x1){var _0x11eb92=_0x41ab31[_0x47b2('0xb')][_0x22dab2];if(typeof _0x11eb92[_0x47b2('0xc')][_0x47b2('0xd')]!==_0x47b2('0xe')){_0x11eb92[_0x47b2('0xc')][_0x47b2('0xd')]=NODEPATH;_0x19933c=!![];}}return{'appConfig':_0x41ab31,'updated':_0x19933c};}}function updateAppConfig(_0x22dcec){return fs[_0x47b2('0xf')](APP_JSON_PATH)[_0x47b2('0x10')](function(_0x5833db){if(_0x5833db){return fs[_0x47b2('0x11')](APP_JSON_PATH)[_0x47b2('0x10')](function(_0x47b061){var _0x19133c=setLegacyLibsNodeEnvPath(_0x47b061);if(_0x19133c['updated']){_0x22dcec[_0x47b2('0x12')](_0x47b2('0x13'));return fs[_0x47b2('0x14')](APP_JSON_PATH,_0x47b061,{'spaces':0x2});}else{return Promise[_0x47b2('0x4')]();}});}else{return Promise['resolve']();}});}module[_0x47b2('0x15')]=updateAppConfig; \ No newline at end of file +var _0xb74e=['info','Updating\x20app.json','writeJSON','exports','fs-extra','path','../config/environment','root','resolve','server/app.json','legacy-libs','findIndex','motion2','env','string','NODE_PATH','then','readJSON','updated'];(function(_0x4b12ae,_0xf2b3b){var _0x16957b=function(_0x51932c){while(--_0x51932c){_0x4b12ae['push'](_0x4b12ae['shift']());}};_0x16957b(++_0xf2b3b);}(_0xb74e,0x15a));var _0xeb74=function(_0xdf9ae7,_0x1a1f8b){_0xdf9ae7=_0xdf9ae7-0x0;var _0x4ebb6f=_0xb74e[_0xdf9ae7];return _0x4ebb6f;};var fs=require(_0xeb74('0x0'));var path=require(_0xeb74('0x1'));var config=require(_0xeb74('0x2'));var root=config[_0xeb74('0x3')];var APP_JSON_PATH=path[_0xeb74('0x4')](root,_0xeb74('0x5'));var NODEPATH=path['resolve'](root,_0xeb74('0x6'));function setLegacyLibsNodeEnvPath(_0x587aff){let _0xb54ed1=![];if(Array['isArray'](_0x587aff['apps'])){var _0x5c1d45=_0x587aff['apps'][_0xeb74('0x7')](function(_0x17644d){return _0x17644d['name']===_0xeb74('0x8');});if(_0x5c1d45>-0x1){var _0x3875d4=_0x587aff['apps'][_0x5c1d45];if(typeof _0x3875d4[_0xeb74('0x9')]['NODE_PATH']!==_0xeb74('0xa')){_0x3875d4[_0xeb74('0x9')][_0xeb74('0xb')]=NODEPATH;_0xb54ed1=!![];}}return{'appConfig':_0x587aff,'updated':_0xb54ed1};}}function updateAppConfig(_0x54dedf){return fs['pathExists'](APP_JSON_PATH)[_0xeb74('0xc')](function(_0xc6148e){if(_0xc6148e){return fs[_0xeb74('0xd')](APP_JSON_PATH)[_0xeb74('0xc')](function(_0x34dbc1){var _0x2a1e79=setLegacyLibsNodeEnvPath(_0x34dbc1);if(_0x2a1e79[_0xeb74('0xe')]){_0x54dedf[_0xeb74('0xf')](_0xeb74('0x10'));return fs[_0xeb74('0x11')](APP_JSON_PATH,_0x34dbc1,{'spaces':0x2});}else{return Promise['resolve']();}});}else{return Promise[_0xeb74('0x4')]();}});}module[_0xeb74('0x12')]=updateAppConfig; \ No newline at end of file